ChangeLog - Rename CONFIG_FM801 to CONFIG_SOUND_FORTE and add help text (Martin Petersen) - Clean up arch/ia64/config.in (based on Keith Owens' patch) - Drop bogus reference to CONFIG_DRM_AGP (Keith Owens) - Restore eepro100 to use TX/RX ringsizes of 32 - Add missing #define's for tg3 to pci_ids.h (Bjorn Helgaas) - Disable "xconfig" and point users to "menuconfig" instead. diff -urN linux-2.4.18/Documentation/Configure.help lia64-2.4/Documentation/Configure.help --- linux-2.4.18/Documentation/Configure.help Tue Feb 26 11:03:49 2002 +++ lia64-2.4/Documentation/Configure.help Mon Jul 22 14:03:04 2002 @@ -3110,14 +3110,6 @@ say N here to save some memory. You can also say Y if you have an "intelligent" multiport card such as Cyclades, Digiboards, etc. -Support for serial ports defined by ACPI tables -CONFIG_SERIAL_ACPI - Legacy free machines may not have serial ports at the legacy COM1, - COM2 etc addresses. Serial ports on such machines are described by - the ACPI tables SPCR (Serial Port Console Redirection) table and - DBGP (Debug Port) table. Say Y here if you want to include support - for these serial ports. - Support for sharing serial interrupts CONFIG_SERIAL_SHARE_IRQ Some serial boards have hardware support which allows multiple dumb @@ -3253,6 +3245,16 @@ slot then this option isn't going to do you much good. If you're dying to do Direct Rendering on IA-64, this is what you're looking for. +Intel 460GX support +CONFIG_AGP_I460 + This option gives you AGP support for the Intel 460GX chipset. This + chipset, the first to support Intel Itanium processors, is new and + this option is correspondingly a little experimental. + + If you don't have a 460GX based machine (such as BigSur) with an AGP + slot then this option isn't going to do you much good. If you're + dying to do Direct Rendering on IA-64, this is what you're looking for. + Intel I810/I815 DC100/I810e support CONFIG_AGP_I810 This option gives you AGP support for the Xserver on the Intel 810 @@ -3307,6 +3309,10 @@ You should say Y here if you use XFree86 3.3.6 or 4.x and want to use GLX or DRI. If unsure, say N. +CONFIG_AGP_HP_ZX1 + This option gives you AGP GART support for the HP ZX1 chipset + for IA64 processors. + Support for ISA-bus hardware CONFIG_ISA Find out whether you have ISA slots on your motherboard. ISA is the @@ -14968,12 +14974,6 @@ were partitioned using EFI GPT. Presently only useful on the IA-64 platform. -/dev/guid support (EXPERIMENTAL) -CONFIG_DEVFS_GUID - Say Y here if you would like to access disks and partitions by - their Globally Unique Identifiers (GUIDs) which will appear as - symbolic links in /dev/guid. - Ultrix partition table support CONFIG_ULTRIX_PARTITION Say Y here if you would like to be able to read the hard disk @@ -18898,6 +18898,12 @@ Say Y or M if you have a sound system driven by ESS's Maestro 3 PCI sound chip. +ForteMedia FM801 driver +CONFIG_SOUND_FORTE + Say Y or M if you want driver support for the ForteMedia FM801 PCI + audio controller (Abit AU10, Genius Sound Maker, HP Workstation + zx2000, and others). + Adlib Cards CONFIG_SOUND_ADLIB Includes ASB 64 4D. Information on programming AdLib cards is @@ -23783,13 +23789,19 @@ HP-simulator For the HP simulator (). + HP-zx1 For HP zx1 Platforms. SN1 For SGI SN1 Platforms. SN2 For SGI SN2 Platforms. DIG-compliant For DIG ("Developer's Interface Guide") compliant - system. + systems. If you don't know what to do, choose "generic". +CONFIG_IA64_HP_ZX1 + Build a kernel that runs on HP zx1-based systems. This adds support + for the zx1 IOMMU and makes root bus bridges appear in PCI config space + (required for zx1 agpgart support). + CONFIG_IA64_SGI_SN_SIM Build a kernel that runs on both the SGI simulator AND on hardware. There is a very slight performance penalty on hardware for including this @@ -23888,6 +23900,15 @@ Layer) information in /proc/pal. This contains useful information about the processors in your systems, such as cache and TLB sizes and the PAL firmware version in use. + + To use this option, you have to check that the "/proc file system + support" (CONFIG_PROC_FS) is enabled, too. + +/proc/efi/vars support +CONFIG_EFI_VARS + If you say Y here, you are able to get EFI (Extensible Firmware + Interface) variable information in /proc/efi/vars. You may read, + write, create, and destroy EFI variables through this interface. To use this option, you have to check that the "/proc file system support" (CONFIG_PROC_FS) is enabled, too. diff -urN linux-2.4.18/Documentation/ia64/IRQ-redir.txt lia64-2.4/Documentation/ia64/IRQ-redir.txt --- linux-2.4.18/Documentation/ia64/IRQ-redir.txt Wed Dec 31 16:00:00 1969 +++ lia64-2.4/Documentation/ia64/IRQ-redir.txt Mon Feb 11 16:17:26 2002 @@ -0,0 +1,69 @@ +IRQ affinity on IA64 platforms +------------------------------ + 07.01.2002, Erich Focht + + +By writing to /proc/irq/IRQ#/smp_affinity the interrupt routing can be +controlled. The behavior on IA64 platforms is slightly different from +that described in Documentation/IRQ-affinity.txt for i386 systems. + +Because of the usage of SAPIC mode and physical destination mode the +IRQ target is one particular CPU and cannot be a mask of several +CPUs. Only the first non-zero bit is taken into account. + + +Usage examples: + +The target CPU has to be specified as a hexadecimal CPU mask. The +first non-zero bit is the selected CPU. This format has been kept for +compatibility reasons with i386. + +Set the delivery mode of interrupt 41 to fixed and route the +interrupts to CPU #3 (logical CPU number) (2^3=0x08): + echo "8" >/proc/irq/41/smp_affinity + +Set the default route for IRQ number 41 to CPU 6 in lowest priority +delivery mode (redirectable): + echo "r 40" >/proc/irq/41/smp_affinity + +The output of the command + cat /proc/irq/IRQ#/smp_affinity +gives the target CPU mask for the specified interrupt vector. If the CPU +mask is preceeded by the character "r", the interrupt is redirectable +(i.e. lowest priority mode routing is used), otherwise its route is +fixed. + + + +Initialization and default behavior: + +If the platform features IRQ redirection (info provided by SAL) all +IO-SAPIC interrupts are initialized with CPU#0 as their default target +and the routing is the so called "lowest priority mode" (actually +fixed SAPIC mode with hint). The XTP chipset registers are used as hints +for the IRQ routing. Currently in Linux XTP registers can have three +values: + - minimal for an idle task, + - normal if any other task runs, + - maximal if the CPU is going to be switched off. +The IRQ is routed to the CPU with lowest XTP register value, the +search begins at the default CPU. Therefore most of the interrupts +will be handled by CPU #0. + +If the platform doesn't feature interrupt redirection IOSAPIC fixed +routing is used. The target CPUs are distributed in a round robin +manner. IRQs will be routed only to the selected target CPUs. Check +with + cat /proc/interrupts + + + +Comments: + +On large (multi-node) systems it is recommended to route the IRQs to +the node to which the corresponding device is connected. +For systems like the NEC AzusA we get IRQ node-affinity for free. This +is because usually the chipsets on each node redirect the interrupts +only to their own CPUs (as they cannot see the XTP registers on the +other nodes). + diff -urN linux-2.4.18/Makefile lia64-2.4/Makefile --- linux-2.4.18/Makefile Tue Feb 26 11:03:51 2002 +++ lia64-2.4/Makefile Mon Jul 22 09:38:41 2002 @@ -88,7 +88,7 @@ CPPFLAGS := -D__KERNEL__ -I$(HPATH) -CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \ +CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -g -O2 \ -fomit-frame-pointer -fno-strict-aliasing -fno-common AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS) @@ -280,8 +280,9 @@ $(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in xconfig: symlinks - $(MAKE) -C scripts kconfig.tk - wish -f scripts/kconfig.tk + @echo -e "***\n* Sorry, xconfig is broken; use \"make menuconfig\" instead.\n***" +# $(MAKE) -C scripts kconfig.tk +# wish -f scripts/kconfig.tk menuconfig: include/linux/version.h symlinks $(MAKE) -C scripts/lxdialog all diff -urN linux-2.4.18/arch/ia64/Makefile lia64-2.4/arch/ia64/Makefile --- linux-2.4.18/arch/ia64/Makefile Mon Nov 26 11:18:19 2001 +++ lia64-2.4/arch/ia64/Makefile Tue Jun 11 23:27:18 2002 @@ -22,10 +22,10 @@ # -ffunction-sections CFLAGS_KERNEL := -mconstant-gp -GCC_VERSION=$(shell $(CROSS_COMPILE)$(HOSTCC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.') +GCC_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.') ifneq ($(GCC_VERSION),2) - CFLAGS += -frename-registers --param max-inline-insns=400 + CFLAGS += -frename-registers --param max-inline-insns=5000 endif ifeq ($(CONFIG_ITANIUM_BSTEP_SPECIFIC),y) @@ -33,16 +33,11 @@ endif ifdef CONFIG_IA64_GENERIC - CORE_FILES := arch/$(ARCH)/hp/hp.a \ - arch/$(ARCH)/sn/sn.o \ - arch/$(ARCH)/dig/dig.a \ - arch/$(ARCH)/sn/io/sgiio.o \ + CORE_FILES := arch/$(ARCH)/hp/hp.o \ + arch/$(ARCH)/dig/dig.a \ $(CORE_FILES) SUBDIRS := arch/$(ARCH)/hp \ - arch/$(ARCH)/sn/sn1 \ - arch/$(ARCH)/sn \ arch/$(ARCH)/dig \ - arch/$(ARCH)/sn/io \ $(SUBDIRS) else # !GENERIC @@ -50,7 +45,16 @@ ifdef CONFIG_IA64_HP_SIM SUBDIRS := arch/$(ARCH)/hp \ $(SUBDIRS) - CORE_FILES := arch/$(ARCH)/hp/hp.a \ + CORE_FILES := arch/$(ARCH)/hp/hp.o \ + $(CORE_FILES) +endif + +ifdef CONFIG_IA64_HP_ZX1 + SUBDIRS := arch/$(ARCH)/hp \ + arch/$(ARCH)/dig \ + $(SUBDIRS) + CORE_FILES := arch/$(ARCH)/hp/hp.o \ + arch/$(ARCH)/dig/dig.a \ $(CORE_FILES) endif @@ -58,7 +62,7 @@ CFLAGS += -DBRINGUP SUBDIRS := arch/$(ARCH)/sn/kernel \ arch/$(ARCH)/sn/io \ - arch/$(ARCH)/sn/fprom \ + arch/$(ARCH)/sn/fakeprom \ $(SUBDIRS) CORE_FILES := arch/$(ARCH)/sn/kernel/sn.o \ arch/$(ARCH)/sn/io/sgiio.o \ diff -urN linux-2.4.18/arch/ia64/config.in lia64-2.4/arch/ia64/config.in --- linux-2.4.18/arch/ia64/config.in Mon Nov 26 11:18:19 2001 +++ lia64-2.4/arch/ia64/config.in Mon Jul 22 21:54:02 2002 @@ -26,29 +26,32 @@ define_bool CONFIG_RWSEM_GENERIC_SPINLOCK y define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n -if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then - define_bool CONFIG_ACPI y - define_bool CONFIG_ACPI_EFI y - define_bool CONFIG_ACPI_INTERPRETER y - define_bool CONFIG_ACPI_KERNEL_CONFIG y -fi - choice 'IA-64 processor type' \ - "Itanium CONFIG_ITANIUM \ - McKinley CONFIG_MCKINLEY" Itanium + "Itanium CONFIG_ITANIUM \ + Itanium-2 CONFIG_MCKINLEY" Itanium choice 'IA-64 system type' \ "generic CONFIG_IA64_GENERIC \ DIG-compliant CONFIG_IA64_DIG \ HP-simulator CONFIG_IA64_HP_SIM \ + HP-zx1 CONFIG_IA64_HP_ZX1 \ SGI-SN1 CONFIG_IA64_SGI_SN1 \ SGI-SN2 CONFIG_IA64_SGI_SN2" generic -choice 'Kernel page size' \ +if [ "$CONFIG_ITANIUM" = "y" ]; then + choice 'Kernel page size' \ + "4KB CONFIG_IA64_PAGE_SIZE_4KB \ + 8KB CONFIG_IA64_PAGE_SIZE_8KB \ + 16KB CONFIG_IA64_PAGE_SIZE_16KB" 16KB +else + choice 'Kernel page size' \ "4KB CONFIG_IA64_PAGE_SIZE_4KB \ 8KB CONFIG_IA64_PAGE_SIZE_8KB \ 16KB CONFIG_IA64_PAGE_SIZE_16KB \ 64KB CONFIG_IA64_PAGE_SIZE_64KB" 16KB +fi + +bool 'Virtually mapped mem_map?' CONFIG_VIRTUAL_MEM_MAP n if [ "$CONFIG_ITANIUM" = "y" ]; then define_bool CONFIG_IA64_BRL_EMU y @@ -68,12 +71,12 @@ fi fi -if [ "$CONFIG_IA64_DIG" = "y" ]; then +if [ "$CONFIG_IA64_GENERIC" = "y" -o "$CONFIG_IA64_DIG" = "y" -o "$CONFIG_IA64_HP_ZX1" = "y" ]; then bool ' Enable IA-64 Machine Check Abort' CONFIG_IA64_MCA define_bool CONFIG_PM y fi -if [ "$CONFIG_IA64_SGI_SN1" = "y" ] || [ "$CONFIG_IA64_SGI_SN2" = "y" ]; then +if [ "$CONFIG_IA64_SGI_SN1" = "y" -o "$CONFIG_IA64_SGI_SN2" = "y" ]; then define_bool CONFIG_IA64_SGI_SN y bool ' Enable extra debugging code' CONFIG_IA64_SGI_SN_DEBUG n bool ' Enable SGI Medusa Simulator Support' CONFIG_IA64_SGI_SN_SIM @@ -107,21 +110,25 @@ tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then + define_bool CONFIG_ACPI y + define_bool CONFIG_ACPI_EFI y + define_bool CONFIG_ACPI_INTERPRETER y + define_bool CONFIG_ACPI_KERNEL_CONFIG y -source drivers/acpi/Config.in - -bool 'PCI support' CONFIG_PCI -source drivers/pci/Config.in + source drivers/acpi/Config.in -bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG -if [ "$CONFIG_HOTPLUG" = "y" ]; then - source drivers/pcmcia/Config.in -else - define_bool CONFIG_PCMCIA n -fi + bool 'PCI support' CONFIG_PCI + source drivers/pci/Config.in -source drivers/parport/Config.in + bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG + if [ "$CONFIG_HOTPLUG" = "y" ]; then + source drivers/hotplug/Config.in + source drivers/pcmcia/Config.in + else + define_bool CONFIG_PCMCIA n + fi + source drivers/parport/Config.in fi # !HP_SIM endmenu @@ -131,27 +138,38 @@ fi if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then + source drivers/mtd/Config.in + source drivers/pnp/Config.in + source drivers/block/Config.in + source drivers/ieee1394/Config.in + source drivers/message/i2o/Config.in + source drivers/md/Config.in + source drivers/message/fusion/Config.in -source drivers/mtd/Config.in -source drivers/pnp/Config.in -source drivers/block/Config.in -source drivers/message/i2o/Config.in -source drivers/md/Config.in - -mainmenu_option next_comment -comment 'ATA/IDE/MFM/RLL support' - -tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE + mainmenu_option next_comment + comment 'ATA/IDE/MFM/RLL support' -if [ "$CONFIG_IDE" != "n" ]; then - source drivers/ide/Config.in -else - define_bool CONFIG_BLK_DEV_IDE_MODES n - define_bool CONFIG_BLK_DEV_HD n -fi -endmenu + tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE -fi # !HP_SIM + if [ "$CONFIG_IDE" != "n" ]; then + source drivers/ide/Config.in + else + define_bool CONFIG_BLK_DEV_IDE_MODES n + define_bool CONFIG_BLK_DEV_HD n + fi + endmenu +else # HP_SIM + mainmenu_option next_comment + comment 'Block devices' + tristate 'Loopback device support' CONFIG_BLK_DEV_LOOP + dep_tristate 'Network block device support' CONFIG_BLK_DEV_NBD $CONFIG_NET + + tristate 'RAM disk support' CONFIG_BLK_DEV_RAM + if [ "$CONFIG_BLK_DEV_RAM" = "y" -o "$CONFIG_BLK_DEV_RAM" = "m" ]; then + int ' Default RAM disk size' CONFIG_BLK_DEV_RAM_SIZE 4096 + fi + endmenu +fi # HP_SIM mainmenu_option next_comment comment 'SCSI support' @@ -164,38 +182,36 @@ endmenu if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then + if [ "$CONFIG_NET" = "y" ]; then + mainmenu_option next_comment + comment 'Network device support' + + bool 'Network device support' CONFIG_NETDEVICES + if [ "$CONFIG_NETDEVICES" = "y" ]; then + source drivers/net/Config.in + fi + endmenu + fi + + source net/ax25/Config.in -if [ "$CONFIG_NET" = "y" ]; then mainmenu_option next_comment - comment 'Network device support' + comment 'ISDN subsystem' - bool 'Network device support' CONFIG_NETDEVICES - if [ "$CONFIG_NETDEVICES" = "y" ]; then - source drivers/net/Config.in + tristate 'ISDN support' CONFIG_ISDN + if [ "$CONFIG_ISDN" != "n" ]; then + source drivers/isdn/Config.in fi endmenu -fi - -source net/ax25/Config.in -mainmenu_option next_comment -comment 'ISDN subsystem' - -tristate 'ISDN support' CONFIG_ISDN -if [ "$CONFIG_ISDN" != "n" ]; then - source drivers/isdn/Config.in -fi -endmenu - -mainmenu_option next_comment -comment 'CD-ROM drivers (not for SCSI or IDE/ATAPI drives)' - -bool 'Support non-SCSI/IDE/ATAPI drives' CONFIG_CD_NO_IDESCSI -if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then - source drivers/cdrom/Config.in -fi -endmenu + mainmenu_option next_comment + comment 'CD-ROM drivers (not for SCSI or IDE/ATAPI drives)' + bool 'Support non-SCSI/IDE/ATAPI drives' CONFIG_CD_NO_IDESCSI + if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then + source drivers/cdrom/Config.in + fi + endmenu fi # !HP_SIM # @@ -222,29 +238,27 @@ fi if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then + mainmenu_option next_comment + comment 'Sound' -mainmenu_option next_comment -comment 'Sound' - -tristate 'Sound card support' CONFIG_SOUND -if [ "$CONFIG_SOUND" != "n" ]; then - source drivers/sound/Config.in -fi -endmenu - -source drivers/usb/Config.in + tristate 'Sound card support' CONFIG_SOUND + if [ "$CONFIG_SOUND" != "n" ]; then + source drivers/sound/Config.in + fi + endmenu -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - source net/bluetooth/Config.in -fi + source drivers/usb/Config.in + if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + source net/bluetooth/Config.in + fi fi # !HP_SIM if [ "$CONFIG_IA64_HP_SIM" != "n" -o "$CONFIG_IA64_GENERIC" != "n" ]; then mainmenu_option next_comment comment 'Simulated drivers' - tristate 'Simulated Ethernet ' CONFIG_SIMETH + bool 'Simulated Ethernet ' CONFIG_SIMETH bool 'Simulated serial driver support' CONFIG_SIM_SERIAL if [ "$CONFIG_SCSI" != "n" ]; then bool 'Simulated SCSI disk' CONFIG_SCSI_SIM @@ -266,9 +280,7 @@ bool ' Disable VHPT' CONFIG_DISABLE_VHPT bool ' Magic SysRq key' CONFIG_MAGIC_SYSRQ -# early printk is currently broken for SMP: the secondary processors get stuck... -# bool ' Early printk support (requires VGA!)' CONFIG_IA64_EARLY_PRINTK - + bool ' Early printk support (requires VGA!)' CONFIG_IA64_EARLY_PRINTK bool ' Debug memory allocations' CONFIG_DEBUG_SLAB bool ' Spinlock debugging' CONFIG_DEBUG_SPINLOCK bool ' Turn on compare-and-exchange bug checking (slow!)' CONFIG_IA64_DEBUG_CMPXCHG diff -urN linux-2.4.18/arch/ia64/defconfig lia64-2.4/arch/ia64/defconfig --- linux-2.4.18/arch/ia64/defconfig Mon Nov 26 11:18:19 2001 +++ lia64-2.4/arch/ia64/defconfig Thu Mar 28 16:11:08 2002 @@ -299,6 +299,7 @@ # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_NCR53C8XX is not set # CONFIG_SCSI_SYM53C8XX is not set # CONFIG_SCSI_PAS16 is not set @@ -373,6 +374,7 @@ # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set +# CONFIG_VIA_RHINE_MMIO is not set # CONFIG_WINBOND_840 is not set # CONFIG_NET_POCKET is not set @@ -554,6 +556,9 @@ # CONFIG_TUNER_3036 is not set # CONFIG_VIDEO_STRADIS is not set # CONFIG_VIDEO_ZORAN is not set +# CONFIG_VIDEO_ZORAN_BUZ is not set +# CONFIG_VIDEO_ZORAN_DC10 is not set +# CONFIG_VIDEO_ZORAN_LML33 is not set # CONFIG_VIDEO_ZR36120 is not set # CONFIG_VIDEO_MEYE is not set @@ -584,11 +589,15 @@ # CONFIG_AUTOFS4_FS is not set # CONFIG_REISERFS_FS is not set # CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set # CONFIG_ADFS_FS is not set # CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set +CONFIG_EXT3_FS=m +CONFIG_JBD=m +CONFIG_JBD_DEBUG=y CONFIG_FAT_FS=y CONFIG_MSDOS_FS=y # CONFIG_UMSDOS_FS is not set @@ -626,6 +635,7 @@ # Network File Systems # # CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set CONFIG_NFS_FS=y CONFIG_NFS_V3=y # CONFIG_ROOT_NFS is not set @@ -662,7 +672,6 @@ # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_UNIXWARE_DISKLABEL is not set CONFIG_EFI_PARTITION=y -# CONFIG_DEVFS_GUID is not set # CONFIG_LDM_PARTITION is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set @@ -874,6 +883,7 @@ CONFIG_IA64_PRINT_HAZARDS=y # CONFIG_DISABLE_VHPT is not set CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_IA64_DEBUG_CMPXCHG is not set diff -urN linux-2.4.18/arch/ia64/dig/setup.c lia64-2.4/arch/ia64/dig/setup.c --- linux-2.4.18/arch/ia64/dig/setup.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/dig/setup.c Wed Apr 10 11:04:02 2002 @@ -33,8 +33,7 @@ * is sufficient (the IDE driver will autodetect the drive geometry). */ char drive_info[4*16]; - -unsigned char aux_device_present = 0xaa; /* XXX remove this when legacy I/O is gone */ +extern int pcat_compat; void __init dig_setup (char **cmdline_p) @@ -81,13 +80,7 @@ screen_info.orig_video_ega_bx = 3; /* XXX fake */ } -void +void __init dig_irq_init (void) { - /* - * Disable the compatibility mode interrupts (8259 style), needs IN/OUT support - * enabled. - */ - outb(0xff, 0xA1); - outb(0xff, 0x21); } diff -urN linux-2.4.18/arch/ia64/hp/Makefile lia64-2.4/arch/ia64/hp/Makefile --- linux-2.4.18/arch/ia64/hp/Makefile Thu Jan 4 12:50:17 2001 +++ lia64-2.4/arch/ia64/hp/Makefile Fri Apr 5 16:44:44 2002 @@ -1,17 +1,15 @@ -# -# ia64/platform/hp/Makefile -# -# Copyright (C) 1999 Silicon Graphics, Inc. -# Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com) -# +# arch/ia64/hp/Makefile +# Copyright (c) 2002 Matthew Wilcox for Hewlett Packard -all: hp.a +ALL_SUB_DIRS := sim zx1 common -O_TARGET := hp.a +O_TARGET := hp.o -obj-y := hpsim_console.o hpsim_irq.o hpsim_setup.o -obj-$(CONFIG_IA64_GENERIC) += hpsim_machvec.o +subdir-$(CONFIG_IA64_GENERIC) += $(ALL_SUB_DIRS) +subdir-$(CONFIG_IA64_HP_SIM) += sim +subdir-$(CONFIG_IA64_HP_ZX1) += zx1 common -clean:: +SUB_DIRS := $(subdir-y) +obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o)) include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ia64/hp/common/Makefile lia64-2.4/arch/ia64/hp/common/Makefile --- linux-2.4.18/arch/ia64/hp/common/Makefile Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/hp/common/Makefile Fri Apr 5 16:44:44 2002 @@ -0,0 +1,14 @@ +# +# ia64/platform/hp/common/Makefile +# +# Copyright (C) 2002 Hewlett Packard +# Copyright (C) Alex Williamson (alex_williamson@hp.com) +# + +O_TARGET := common.o + +export-objs := sba_iommu.o + +obj-y := sba_iommu.o + +include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ia64/hp/common/sba_iommu.c lia64-2.4/arch/ia64/hp/common/sba_iommu.c --- linux-2.4.18/arch/ia64/hp/common/sba_iommu.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/hp/common/sba_iommu.c Fri Jul 12 17:35:46 2002 @@ -0,0 +1,1869 @@ +/* +** IA64 System Bus Adapter (SBA) I/O MMU manager +** +** (c) Copyright 2002 Alex Williamson +** (c) Copyright 2002 Hewlett-Packard Company +** +** Portions (c) 2000 Grant Grundler (from parisc I/O MMU code) +** Portions (c) 1999 Dave S. Miller (from sparc64 I/O MMU code) +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** +** This module initializes the IOC (I/O Controller) found on HP +** McKinley machines and their successors. +** +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include /* ia64_get_itc() */ +#include +#include /* PAGE_OFFSET */ +#include + + +#define DRIVER_NAME "SBA" + +#ifndef CONFIG_IA64_HP_PROTO +#define ALLOW_IOV_BYPASS +#endif +#define ENABLE_MARK_CLEAN +/* +** The number of debug flags is a clue - this code is fragile. +*/ +#undef DEBUG_SBA_INIT +#undef DEBUG_SBA_RUN +#undef DEBUG_SBA_RUN_SG +#undef DEBUG_SBA_RESOURCE +#undef ASSERT_PDIR_SANITY +#undef DEBUG_LARGE_SG_ENTRIES +#undef DEBUG_BYPASS + +#define SBA_INLINE __inline__ +/* #define SBA_INLINE */ + +#ifdef DEBUG_SBA_INIT +#define DBG_INIT(x...) printk(x) +#else +#define DBG_INIT(x...) +#endif + +#ifdef DEBUG_SBA_RUN +#define DBG_RUN(x...) printk(x) +#else +#define DBG_RUN(x...) +#endif + +#ifdef DEBUG_SBA_RUN_SG +#define DBG_RUN_SG(x...) printk(x) +#else +#define DBG_RUN_SG(x...) +#endif + + +#ifdef DEBUG_SBA_RESOURCE +#define DBG_RES(x...) printk(x) +#else +#define DBG_RES(x...) +#endif + +#ifdef DEBUG_BYPASS +#define DBG_BYPASS(x...) printk(x) +#else +#define DBG_BYPASS(x...) +#endif + +#ifdef ASSERT_PDIR_SANITY +#define ASSERT(expr) \ + if(!(expr)) { \ + printk( "\n" __FILE__ ":%d: Assertion " #expr " failed!\n",__LINE__); \ + panic(#expr); \ + } +#else +#define ASSERT(expr) +#endif + +#define KB(x) ((x) * 1024) +#define MB(x) (KB (KB (x))) +#define GB(x) (MB (KB (x))) + +/* +** The number of pdir entries to "free" before issueing +** a read to PCOM register to flush out PCOM writes. +** Interacts with allocation granularity (ie 4 or 8 entries +** allocated and free'd/purged at a time might make this +** less interesting). +*/ +#define DELAYED_RESOURCE_CNT 16 + +#define DEFAULT_DMA_HINT_REG 0 + +#define ZX1_FUNC_ID_VALUE ((PCI_DEVICE_ID_HP_ZX1_SBA << 16) | PCI_VENDOR_ID_HP) +#define ZX1_MC_ID ((PCI_DEVICE_ID_HP_ZX1_MC << 16) | PCI_VENDOR_ID_HP) + +#define SBA_FUNC_ID 0x0000 /* function id */ +#define SBA_FCLASS 0x0008 /* function class, bist, header, rev... */ + +#define SBA_FUNC_SIZE 0x10000 /* SBA configuration function reg set */ + +unsigned int __initdata zx1_func_offsets[] = {0x1000, 0x8000, + 0x9000, 0xa000, -1}; + +#define SBA_IOC_OFFSET 0x1000 + +#define MAX_IOC 1 /* we only have 1 for now*/ + +#define IOC_IBASE 0x300 /* IO TLB */ +#define IOC_IMASK 0x308 +#define IOC_PCOM 0x310 +#define IOC_TCNFG 0x318 +#define IOC_PDIR_BASE 0x320 + +#define IOC_IOVA_SPACE_BASE 0x40000000 /* IOVA ranges start at 1GB */ + +/* +** IOC supports 4/8/16/64KB page sizes (see TCNFG register) +** It's safer (avoid memory corruption) to keep DMA page mappings +** equivalently sized to VM PAGE_SIZE. +** +** We really can't avoid generating a new mapping for each +** page since the Virtual Coherence Index has to be generated +** and updated for each page. +** +** IOVP_SIZE could only be greater than PAGE_SIZE if we are +** confident the drivers really only touch the next physical +** page iff that driver instance owns it. +*/ +#define IOVP_SIZE PAGE_SIZE +#define IOVP_SHIFT PAGE_SHIFT +#define IOVP_MASK PAGE_MASK + +struct ioc { + unsigned long ioc_hpa; /* I/O MMU base address */ + char *res_map; /* resource map, bit == pdir entry */ + u64 *pdir_base; /* physical base address */ + unsigned long ibase; /* pdir IOV Space base */ + unsigned long imask; /* pdir IOV Space mask */ + + unsigned long *res_hint; /* next avail IOVP - circular search */ + spinlock_t res_lock; + unsigned long hint_mask_pdir; /* bits used for DMA hints */ + unsigned int res_bitshift; /* from the RIGHT! */ + unsigned int res_size; /* size of resource map in bytes */ + unsigned int hint_shift_pdir; + unsigned long dma_mask; +#if DELAYED_RESOURCE_CNT > 0 + int saved_cnt; + struct sba_dma_pair { + dma_addr_t iova; + size_t size; + } saved[DELAYED_RESOURCE_CNT]; +#endif + +#ifdef CONFIG_PROC_FS +#define SBA_SEARCH_SAMPLE 0x100 + unsigned long avg_search[SBA_SEARCH_SAMPLE]; + unsigned long avg_idx; /* current index into avg_search */ + unsigned long used_pages; + unsigned long msingle_calls; + unsigned long msingle_pages; + unsigned long msg_calls; + unsigned long msg_pages; + unsigned long usingle_calls; + unsigned long usingle_pages; + unsigned long usg_calls; + unsigned long usg_pages; +#ifdef ALLOW_IOV_BYPASS + unsigned long msingle_bypass; + unsigned long usingle_bypass; + unsigned long msg_bypass; +#endif +#endif + + /* STUFF We don't need in performance path */ + unsigned int pdir_size; /* in bytes, determined by IOV Space size */ +}; + +struct sba_device { + struct sba_device *next; /* list of SBA's in system */ + const char *name; + unsigned long sba_hpa; /* base address */ + spinlock_t sba_lock; + unsigned int flags; /* state/functionality enabled */ + unsigned int hw_rev; /* HW revision of chip */ + + unsigned int num_ioc; /* number of on-board IOC's */ + struct ioc ioc[MAX_IOC]; +}; + + +static struct sba_device *sba_list; +static int sba_count; +static int reserve_sba_gart = 1; +static struct pci_dev sac_only_dev; + +#define sba_sg_iova(sg) (sg->address) +#define sba_sg_len(sg) (sg->length) +#define sba_sg_buffer(sg) (sg->orig_address) + +/* REVISIT - fix me for multiple SBAs/IOCs */ +#define GET_IOC(dev) (sba_list->ioc) +#define SBA_SET_AGP(sba_dev) (sba_dev->flags |= 0x1) +#define SBA_GET_AGP(sba_dev) (sba_dev->flags & 0x1) + +/* +** DMA_CHUNK_SIZE is used by the SCSI mid-layer to break up +** (or rather not merge) DMA's into managable chunks. +** On parisc, this is more of the software/tuning constraint +** rather than the HW. I/O MMU allocation alogorithms can be +** faster with smaller size is (to some degree). +*/ +#define DMA_CHUNK_SIZE (BITS_PER_LONG*PAGE_SIZE) + +/* Looks nice and keeps the compiler happy */ +#define SBA_DEV(d) ((struct sba_device *) (d)) + +#define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1)) + +/************************************ +** SBA register read and write support +** +** BE WARNED: register writes are posted. +** (ie follow writes which must reach HW with a read) +** +*/ +#define READ_REG(addr) __raw_readq(addr) +#define WRITE_REG(val, addr) __raw_writeq(val, addr) + +#ifdef DEBUG_SBA_INIT + +/** + * sba_dump_tlb - debugging only - print IOMMU operating parameters + * @hpa: base address of the IOMMU + * + * Print the size/location of the IO MMU PDIR. + */ +static void +sba_dump_tlb(char *hpa) +{ + DBG_INIT("IO TLB at 0x%p\n", (void *)hpa); + DBG_INIT("IOC_IBASE : %016lx\n", READ_REG(hpa+IOC_IBASE)); + DBG_INIT("IOC_IMASK : %016lx\n", READ_REG(hpa+IOC_IMASK)); + DBG_INIT("IOC_TCNFG : %016lx\n", READ_REG(hpa+IOC_TCNFG)); + DBG_INIT("IOC_PDIR_BASE: %016lx\n", READ_REG(hpa+IOC_PDIR_BASE)); + DBG_INIT("\n"); +} +#endif + + +#ifdef ASSERT_PDIR_SANITY + +/** + * sba_dump_pdir_entry - debugging only - print one IOMMU PDIR entry + * @ioc: IO MMU structure which owns the pdir we are interested in. + * @msg: text to print ont the output line. + * @pide: pdir index. + * + * Print one entry of the IO MMU PDIR in human readable form. + */ +static void +sba_dump_pdir_entry(struct ioc *ioc, char *msg, uint pide) +{ + /* start printing from lowest pde in rval */ + u64 *ptr = &(ioc->pdir_base[pide & ~(BITS_PER_LONG - 1)]); + unsigned long *rptr = (unsigned long *) &(ioc->res_map[(pide >>3) & ~(sizeof(unsigned long) - 1)]); + uint rcnt; + + /* printk(KERN_DEBUG "SBA: %s rp %p bit %d rval 0x%lx\n", */ + printk("SBA: %s rp %p bit %d rval 0x%lx\n", + msg, rptr, pide & (BITS_PER_LONG - 1), *rptr); + + rcnt = 0; + while (rcnt < BITS_PER_LONG) { + printk("%s %2d %p %016Lx\n", + (rcnt == (pide & (BITS_PER_LONG - 1))) + ? " -->" : " ", + rcnt, ptr, *ptr ); + rcnt++; + ptr++; + } + printk("%s", msg); +} + + +/** + * sba_check_pdir - debugging only - consistency checker + * @ioc: IO MMU structure which owns the pdir we are interested in. + * @msg: text to print ont the output line. + * + * Verify the resource map and pdir state is consistent + */ +static int +sba_check_pdir(struct ioc *ioc, char *msg) +{ + u64 *rptr_end = (u64 *) &(ioc->res_map[ioc->res_size]); + u64 *rptr = (u64 *) ioc->res_map; /* resource map ptr */ + u64 *pptr = ioc->pdir_base; /* pdir ptr */ + uint pide = 0; + + while (rptr < rptr_end) { + u64 rval; + int rcnt; /* number of bits we might check */ + + rval = *rptr; + rcnt = 64; + + while (rcnt) { + /* Get last byte and highest bit from that */ + u32 pde = ((u32)((*pptr >> (63)) & 0x1)); + if ((rval & 0x1) ^ pde) + { + /* + ** BUMMER! -- res_map != pdir -- + ** Dump rval and matching pdir entries + */ + sba_dump_pdir_entry(ioc, msg, pide); + return(1); + } + rcnt--; + rval >>= 1; /* try the next bit */ + pptr++; + pide++; + } + rptr++; /* look at next word of res_map */ + } + /* It'd be nice if we always got here :^) */ + return 0; +} + + +/** + * sba_dump_sg - debugging only - print Scatter-Gather list + * @ioc: IO MMU structure which owns the pdir we are interested in. + * @startsg: head of the SG list + * @nents: number of entries in SG list + * + * print the SG list so we can verify it's correct by hand. + */ +static void +sba_dump_sg( struct ioc *ioc, struct scatterlist *startsg, int nents) +{ + while (nents-- > 0) { + printk(" %d : %08lx/%05x %p\n", + nents, + (unsigned long) sba_sg_iova(startsg), + sba_sg_len(startsg), + sba_sg_buffer(startsg)); + startsg++; + } +} +static void +sba_check_sg( struct ioc *ioc, struct scatterlist *startsg, int nents) +{ + struct scatterlist *the_sg = startsg; + int the_nents = nents; + + while (the_nents-- > 0) { + if (sba_sg_buffer(the_sg) == 0x0UL) + sba_dump_sg(NULL, startsg, nents); + the_sg++; + } +} + +#endif /* ASSERT_PDIR_SANITY */ + + + + +/************************************************************** +* +* I/O Pdir Resource Management +* +* Bits set in the resource map are in use. +* Each bit can represent a number of pages. +* LSbs represent lower addresses (IOVA's). +* +***************************************************************/ +#define PAGES_PER_RANGE 1 /* could increase this to 4 or 8 if needed */ + +/* Convert from IOVP to IOVA and vice versa. */ +#define SBA_IOVA(ioc,iovp,offset,hint_reg) ((ioc->ibase) | (iovp) | (offset) | ((hint_reg)<<(ioc->hint_shift_pdir))) +#define SBA_IOVP(ioc,iova) (((iova) & ioc->hint_mask_pdir) & ~(ioc->ibase)) + +/* FIXME : review these macros to verify correctness and usage */ +#define PDIR_INDEX(iovp) ((iovp)>>IOVP_SHIFT) + +#define RESMAP_MASK(n) ~(~0UL << (n)) +#define RESMAP_IDX_MASK (sizeof(unsigned long) - 1) + + +/** + * sba_search_bitmap - find free space in IO PDIR resource bitmap + * @ioc: IO MMU structure which owns the pdir we are interested in. + * @bits_wanted: number of entries we need. + * + * Find consecutive free bits in resource bitmap. + * Each bit represents one entry in the IO Pdir. + * Cool perf optimization: search for log2(size) bits at a time. + */ +static SBA_INLINE unsigned long +sba_search_bitmap(struct ioc *ioc, unsigned long bits_wanted) +{ + unsigned long *res_ptr = ioc->res_hint; + unsigned long *res_end = (unsigned long *) &(ioc->res_map[ioc->res_size]); + unsigned long pide = ~0UL; + + ASSERT(((unsigned long) ioc->res_hint & (sizeof(unsigned long) - 1UL)) == 0); + ASSERT(res_ptr < res_end); + if (bits_wanted > (BITS_PER_LONG/2)) { + /* Search word at a time - no mask needed */ + for(; res_ptr < res_end; ++res_ptr) { + if (*res_ptr == 0) { + *res_ptr = RESMAP_MASK(bits_wanted); + pide = ((unsigned long)res_ptr - (unsigned long)ioc->res_map); + pide <<= 3; /* convert to bit address */ + break; + } + } + /* point to the next word on next pass */ + res_ptr++; + ioc->res_bitshift = 0; + } else { + /* + ** Search the resource bit map on well-aligned values. + ** "o" is the alignment. + ** We need the alignment to invalidate I/O TLB using + ** SBA HW features in the unmap path. + */ + unsigned long o = 1 << get_order(bits_wanted << PAGE_SHIFT); + uint bitshiftcnt = ROUNDUP(ioc->res_bitshift, o); + unsigned long mask; + + if (bitshiftcnt >= BITS_PER_LONG) { + bitshiftcnt = 0; + res_ptr++; + } + mask = RESMAP_MASK(bits_wanted) << bitshiftcnt; + + DBG_RES("%s() o %ld %p", __FUNCTION__, o, res_ptr); + while(res_ptr < res_end) + { + DBG_RES(" %p %lx %lx\n", res_ptr, mask, *res_ptr); + ASSERT(0 != mask); + if(0 == ((*res_ptr) & mask)) { + *res_ptr |= mask; /* mark resources busy! */ + pide = ((unsigned long)res_ptr - (unsigned long)ioc->res_map); + pide <<= 3; /* convert to bit address */ + pide += bitshiftcnt; + break; + } + mask <<= o; + bitshiftcnt += o; + if (0 == mask) { + mask = RESMAP_MASK(bits_wanted); + bitshiftcnt=0; + res_ptr++; + } + } + /* look in the same word on the next pass */ + ioc->res_bitshift = bitshiftcnt + bits_wanted; + } + + /* wrapped ? */ + if (res_end <= res_ptr) { + ioc->res_hint = (unsigned long *) ioc->res_map; + ioc->res_bitshift = 0; + } else { + ioc->res_hint = res_ptr; + } + return (pide); +} + + +/** + * sba_alloc_range - find free bits and mark them in IO PDIR resource bitmap + * @ioc: IO MMU structure which owns the pdir we are interested in. + * @size: number of bytes to create a mapping for + * + * Given a size, find consecutive unmarked and then mark those bits in the + * resource bit map. + */ +static int +sba_alloc_range(struct ioc *ioc, size_t size) +{ + unsigned int pages_needed = size >> IOVP_SHIFT; +#ifdef CONFIG_PROC_FS + unsigned long itc_start = ia64_get_itc(); +#endif + unsigned long pide; + + ASSERT(pages_needed); + ASSERT((pages_needed * IOVP_SIZE) <= DMA_CHUNK_SIZE); + ASSERT(pages_needed <= BITS_PER_LONG); + ASSERT(0 == (size & ~IOVP_MASK)); + + /* + ** "seek and ye shall find"...praying never hurts either... + */ + + pide = sba_search_bitmap(ioc, pages_needed); + if (pide >= (ioc->res_size << 3)) { + pide = sba_search_bitmap(ioc, pages_needed); + if (pide >= (ioc->res_size << 3)) + panic(__FILE__ ": I/O MMU @ %lx is out of mapping resources\n", ioc->ioc_hpa); + } + +#ifdef ASSERT_PDIR_SANITY + /* verify the first enable bit is clear */ + if(0x00 != ((u8 *) ioc->pdir_base)[pide*sizeof(u64) + 7]) { + sba_dump_pdir_entry(ioc, "sba_search_bitmap() botched it?", pide); + } +#endif + + DBG_RES("%s(%x) %d -> %lx hint %x/%x\n", + __FUNCTION__, size, pages_needed, pide, + (uint) ((unsigned long) ioc->res_hint - (unsigned long) ioc->res_map), + ioc->res_bitshift ); + +#ifdef CONFIG_PROC_FS + { + unsigned long itc_end = ia64_get_itc(); + unsigned long tmp = itc_end - itc_start; + /* check for roll over */ + itc_start = (itc_end < itc_start) ? -(tmp) : (tmp); + } + ioc->avg_search[ioc->avg_idx++] = itc_start; + ioc->avg_idx &= SBA_SEARCH_SAMPLE - 1; + + ioc->used_pages += pages_needed; +#endif + + return (pide); +} + + +/** + * sba_free_range - unmark bits in IO PDIR resource bitmap + * @ioc: IO MMU structure which owns the pdir we are interested in. + * @iova: IO virtual address which was previously allocated. + * @size: number of bytes to create a mapping for + * + * clear bits in the ioc's resource map + */ +static SBA_INLINE void +sba_free_range(struct ioc *ioc, dma_addr_t iova, size_t size) +{ + unsigned long iovp = SBA_IOVP(ioc, iova); + unsigned int pide = PDIR_INDEX(iovp); + unsigned int ridx = pide >> 3; /* convert bit to byte address */ + unsigned long *res_ptr = (unsigned long *) &((ioc)->res_map[ridx & ~RESMAP_IDX_MASK]); + + int bits_not_wanted = size >> IOVP_SHIFT; + + /* 3-bits "bit" address plus 2 (or 3) bits for "byte" == bit in word */ + unsigned long m = RESMAP_MASK(bits_not_wanted) << (pide & (BITS_PER_LONG - 1)); + + DBG_RES("%s( ,%x,%x) %x/%lx %x %p %lx\n", + __FUNCTION__, (uint) iova, size, + bits_not_wanted, m, pide, res_ptr, *res_ptr); + +#ifdef CONFIG_PROC_FS + ioc->used_pages -= bits_not_wanted; +#endif + + ASSERT(m != 0); + ASSERT(bits_not_wanted); + ASSERT((bits_not_wanted * IOVP_SIZE) <= DMA_CHUNK_SIZE); + ASSERT(bits_not_wanted <= BITS_PER_LONG); + ASSERT((*res_ptr & m) == m); /* verify same bits are set */ + *res_ptr &= ~m; +} + + +/************************************************************** +* +* "Dynamic DMA Mapping" support (aka "Coherent I/O") +* +***************************************************************/ + +#define SBA_DMA_HINT(ioc, val) ((val) << (ioc)->hint_shift_pdir) + + +/** + * sba_io_pdir_entry - fill in one IO PDIR entry + * @pdir_ptr: pointer to IO PDIR entry + * @vba: Virtual CPU address of buffer to map + * + * SBA Mapping Routine + * + * Given a virtual address (vba, arg1) sba_io_pdir_entry() + * loads the I/O PDIR entry pointed to by pdir_ptr (arg0). + * Each IO Pdir entry consists of 8 bytes as shown below + * (LSB == bit 0): + * + * 63 40 11 7 0 + * +-+---------------------+----------------------------------+----+--------+ + * |V| U | PPN[39:12] | U | FF | + * +-+---------------------+----------------------------------+----+--------+ + * + * V == Valid Bit + * U == Unused + * PPN == Physical Page Number + * + * The physical address fields are filled with the results of virt_to_phys() + * on the vba. + */ + +#if 1 +#define sba_io_pdir_entry(pdir_ptr, vba) *pdir_ptr = ((vba & ~0xE000000000000FFFULL) | 0x80000000000000FFULL) +#else +void SBA_INLINE +sba_io_pdir_entry(u64 *pdir_ptr, unsigned long vba) +{ + *pdir_ptr = ((vba & ~0xE000000000000FFFULL) | 0x80000000000000FFULL); +} +#endif + +#ifdef ENABLE_MARK_CLEAN +/** + * Since DMA is i-cache coherent, any (complete) pages that were written via + * DMA can be marked as "clean" so that update_mmu_cache() doesn't have to + * flush them when they get mapped into an executable vm-area. + */ +static void +mark_clean (void *addr, size_t size) +{ + unsigned long pg_addr, end; + + pg_addr = PAGE_ALIGN((unsigned long) addr); + end = (unsigned long) addr + size; + while (pg_addr + PAGE_SIZE <= end) { + struct page *page = virt_to_page(pg_addr); + set_bit(PG_arch_1, &page->flags); + pg_addr += PAGE_SIZE; + } +} +#endif + +/** + * sba_mark_invalid - invalidate one or more IO PDIR entries + * @ioc: IO MMU structure which owns the pdir we are interested in. + * @iova: IO Virtual Address mapped earlier + * @byte_cnt: number of bytes this mapping covers. + * + * Marking the IO PDIR entry(ies) as Invalid and invalidate + * corresponding IO TLB entry. The PCOM (Purge Command Register) + * is to purge stale entries in the IO TLB when unmapping entries. + * + * The PCOM register supports purging of multiple pages, with a minium + * of 1 page and a maximum of 2GB. Hardware requires the address be + * aligned to the size of the range being purged. The size of the range + * must be a power of 2. The "Cool perf optimization" in the + * allocation routine helps keep that true. + */ +static SBA_INLINE void +sba_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt) +{ + u32 iovp = (u32) SBA_IOVP(ioc,iova); + + int off = PDIR_INDEX(iovp); + + /* Must be non-zero and rounded up */ + ASSERT(byte_cnt > 0); + ASSERT(0 == (byte_cnt & ~IOVP_MASK)); + +#ifdef ASSERT_PDIR_SANITY + /* Assert first pdir entry is set */ + if (!(ioc->pdir_base[off] >> 60)) { + sba_dump_pdir_entry(ioc,"sba_mark_invalid()", PDIR_INDEX(iovp)); + } +#endif + + if (byte_cnt <= IOVP_SIZE) + { + ASSERT(off < ioc->pdir_size); + + iovp |= IOVP_SHIFT; /* set "size" field for PCOM */ + + /* + ** clear I/O PDIR entry "valid" bit + ** Do NOT clear the rest - save it for debugging. + ** We should only clear bits that have previously + ** been enabled. + */ + ioc->pdir_base[off] &= ~(0x80000000000000FFULL); + } else { + u32 t = get_order(byte_cnt) + PAGE_SHIFT; + + iovp |= t; + ASSERT(t <= 31); /* 2GB! Max value of "size" field */ + + do { + /* verify this pdir entry is enabled */ + ASSERT(ioc->pdir_base[off] >> 63); + /* clear I/O Pdir entry "valid" bit first */ + ioc->pdir_base[off] &= ~(0x80000000000000FFULL); + off++; + byte_cnt -= IOVP_SIZE; + } while (byte_cnt > 0); + } + + WRITE_REG(iovp, ioc->ioc_hpa+IOC_PCOM); +} + +/** + * sba_map_single - map one buffer and return IOVA for DMA + * @dev: instance of PCI owned by the driver that's asking. + * @addr: driver buffer to map. + * @size: number of bytes to map in driver buffer. + * @direction: R/W or both. + * + * See Documentation/DMA-mapping.txt + */ +dma_addr_t +sba_map_single(struct pci_dev *dev, void *addr, size_t size, int direction) +{ + struct ioc *ioc; + unsigned long flags; + dma_addr_t iovp; + dma_addr_t offset; + u64 *pdir_start; + int pide; +#ifdef ALLOW_IOV_BYPASS + unsigned long pci_addr = virt_to_phys(addr); +#endif + + ioc = GET_IOC(dev); + ASSERT(ioc); + +#ifdef ALLOW_IOV_BYPASS + /* + ** Check if the PCI device can DMA to ptr... if so, just return ptr + */ + if ((pci_addr & ~dev->dma_mask) == 0) { + /* + ** Device is bit capable of DMA'ing to the buffer... + ** just return the PCI address of ptr + */ +#ifdef CONFIG_PROC_FS + spin_lock_irqsave(&ioc->res_lock, flags); + ioc->msingle_bypass++; + spin_unlock_irqrestore(&ioc->res_lock, flags); +#endif + DBG_BYPASS("sba_map_single() bypass mask/addr: 0x%lx/0x%lx\n", + dev->dma_mask, pci_addr); + return pci_addr; + } +#endif + + ASSERT(size > 0); + ASSERT(size <= DMA_CHUNK_SIZE); + + /* save offset bits */ + offset = ((dma_addr_t) (long) addr) & ~IOVP_MASK; + + /* round up to nearest IOVP_SIZE */ + size = (size + offset + ~IOVP_MASK) & IOVP_MASK; + + spin_lock_irqsave(&ioc->res_lock, flags); +#ifdef ASSERT_PDIR_SANITY + if (sba_check_pdir(ioc,"Check before sba_map_single()")) + panic("Sanity check failed"); +#endif + +#ifdef CONFIG_PROC_FS + ioc->msingle_calls++; + ioc->msingle_pages += size >> IOVP_SHIFT; +#endif + pide = sba_alloc_range(ioc, size); + iovp = (dma_addr_t) pide << IOVP_SHIFT; + + DBG_RUN("%s() 0x%p -> 0x%lx\n", + __FUNCTION__, addr, (long) iovp | offset); + + pdir_start = &(ioc->pdir_base[pide]); + + while (size > 0) { + ASSERT(((u8 *)pdir_start)[7] == 0); /* verify availability */ + sba_io_pdir_entry(pdir_start, (unsigned long) addr); + + DBG_RUN(" pdir 0x%p %lx\n", pdir_start, *pdir_start); + + addr += IOVP_SIZE; + size -= IOVP_SIZE; + pdir_start++; + } + /* form complete address */ +#ifdef ASSERT_PDIR_SANITY + sba_check_pdir(ioc,"Check after sba_map_single()"); +#endif + spin_unlock_irqrestore(&ioc->res_lock, flags); + return SBA_IOVA(ioc, iovp, offset, DEFAULT_DMA_HINT_REG); +} + +/** + * sba_unmap_single - unmap one IOVA and free resources + * @dev: instance of PCI owned by the driver that's asking. + * @iova: IOVA of driver buffer previously mapped. + * @size: number of bytes mapped in driver buffer. + * @direction: R/W or both. + * + * See Documentation/DMA-mapping.txt + */ +void sba_unmap_single(struct pci_dev *dev, dma_addr_t iova, size_t size, + int direction) +{ + struct ioc *ioc; +#if DELAYED_RESOURCE_CNT > 0 + struct sba_dma_pair *d; +#endif + unsigned long flags; + dma_addr_t offset; + + ioc = GET_IOC(dev); + ASSERT(ioc); + +#ifdef ALLOW_IOV_BYPASS + if ((iova & ioc->imask) != ioc->ibase) { + /* + ** Address does not fall w/in IOVA, must be bypassing + */ +#ifdef CONFIG_PROC_FS + spin_lock_irqsave(&ioc->res_lock, flags); + ioc->usingle_bypass++; + spin_unlock_irqrestore(&ioc->res_lock, flags); +#endif + DBG_BYPASS("sba_unmap_single() bypass addr: 0x%lx\n", iova); + +#ifdef ENABLE_MARK_CLEAN + if (direction == PCI_DMA_FROMDEVICE) { + mark_clean(phys_to_virt(iova), size); + } +#endif + return; + } +#endif + offset = iova & ~IOVP_MASK; + + DBG_RUN("%s() iovp 0x%lx/%x\n", + __FUNCTION__, (long) iova, size); + + iova ^= offset; /* clear offset bits */ + size += offset; + size = ROUNDUP(size, IOVP_SIZE); + + spin_lock_irqsave(&ioc->res_lock, flags); +#ifdef CONFIG_PROC_FS + ioc->usingle_calls++; + ioc->usingle_pages += size >> IOVP_SHIFT; +#endif + +#if DELAYED_RESOURCE_CNT > 0 + d = &(ioc->saved[ioc->saved_cnt]); + d->iova = iova; + d->size = size; + if (++(ioc->saved_cnt) >= DELAYED_RESOURCE_CNT) { + int cnt = ioc->saved_cnt; + while (cnt--) { + sba_mark_invalid(ioc, d->iova, d->size); + sba_free_range(ioc, d->iova, d->size); + d--; + } + ioc->saved_cnt = 0; + READ_REG(ioc->ioc_hpa+IOC_PCOM); /* flush purges */ + } +#else /* DELAYED_RESOURCE_CNT == 0 */ + sba_mark_invalid(ioc, iova, size); + sba_free_range(ioc, iova, size); + READ_REG(ioc->ioc_hpa+IOC_PCOM); /* flush purges */ +#endif /* DELAYED_RESOURCE_CNT == 0 */ +#ifdef ENABLE_MARK_CLEAN + if (direction == PCI_DMA_FROMDEVICE) { + u32 iovp = (u32) SBA_IOVP(ioc,iova); + int off = PDIR_INDEX(iovp); + void *addr; + + if (size <= IOVP_SIZE) { + addr = phys_to_virt(ioc->pdir_base[off] & + ~0xE000000000000FFFULL); + mark_clean(addr, size); + } else { + size_t byte_cnt = size; + + do { + addr = phys_to_virt(ioc->pdir_base[off] & + ~0xE000000000000FFFULL); + mark_clean(addr, min(byte_cnt, IOVP_SIZE)); + off++; + byte_cnt -= IOVP_SIZE; + + } while (byte_cnt > 0); + } + } +#endif + spin_unlock_irqrestore(&ioc->res_lock, flags); + + /* XXX REVISIT for 2.5 Linux - need syncdma for zero-copy support. + ** For Astro based systems this isn't a big deal WRT performance. + ** As long as 2.4 kernels copyin/copyout data from/to userspace, + ** we don't need the syncdma. The issue here is I/O MMU cachelines + ** are *not* coherent in all cases. May be hwrev dependent. + ** Need to investigate more. + asm volatile("syncdma"); + */ +} + + +/** + * sba_alloc_consistent - allocate/map shared mem for DMA + * @hwdev: instance of PCI owned by the driver that's asking. + * @size: number of bytes mapped in driver buffer. + * @dma_handle: IOVA of new buffer. + * + * See Documentation/DMA-mapping.txt + */ +void * +sba_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) +{ + void *ret; + + if (!hwdev) { + /* only support PCI */ + *dma_handle = 0; + return 0; + } + + ret = (void *) __get_free_pages(GFP_ATOMIC, get_order(size)); + + if (ret) { + memset(ret, 0, size); + /* + * REVISIT: if sba_map_single starts needing more + * than dma_mask from the device, this needs to be + * updated. + */ + *dma_handle = sba_map_single(&sac_only_dev, ret, size, 0); + } + + return ret; +} + + +/** + * sba_free_consistent - free/unmap shared mem for DMA + * @hwdev: instance of PCI owned by the driver that's asking. + * @size: number of bytes mapped in driver buffer. + * @vaddr: virtual address IOVA of "consistent" buffer. + * @dma_handler: IO virtual address of "consistent" buffer. + * + * See Documentation/DMA-mapping.txt + */ +void sba_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, + dma_addr_t dma_handle) +{ + sba_unmap_single(hwdev, dma_handle, size, 0); + free_pages((unsigned long) vaddr, get_order(size)); +} + + +/* +** Since 0 is a valid pdir_base index value, can't use that +** to determine if a value is valid or not. Use a flag to indicate +** the SG list entry contains a valid pdir index. +*/ +#define PIDE_FLAG 0x1UL + +#ifdef DEBUG_LARGE_SG_ENTRIES +int dump_run_sg = 0; +#endif + + +/** + * sba_fill_pdir - write allocated SG entries into IO PDIR + * @ioc: IO MMU structure which owns the pdir we are interested in. + * @startsg: list of IOVA/size pairs + * @nents: number of entries in startsg list + * + * Take preprocessed SG list and write corresponding entries + * in the IO PDIR. + */ + +static SBA_INLINE int +sba_fill_pdir( + struct ioc *ioc, + struct scatterlist *startsg, + int nents) +{ + struct scatterlist *dma_sg = startsg; /* pointer to current DMA */ + int n_mappings = 0; + u64 *pdirp = 0; + unsigned long dma_offset = 0; + + dma_sg--; + while (nents-- > 0) { + int cnt = sba_sg_len(startsg); + sba_sg_len(startsg) = 0; + +#ifdef DEBUG_LARGE_SG_ENTRIES + if (dump_run_sg) + printk(" %2d : %08lx/%05x %p\n", + nents, + (unsigned long) sba_sg_iova(startsg), cnt, + sba_sg_buffer(startsg) + ); +#else + DBG_RUN_SG(" %d : %08lx/%05x %p\n", + nents, + (unsigned long) sba_sg_iova(startsg), cnt, + sba_sg_buffer(startsg) + ); +#endif + /* + ** Look for the start of a new DMA stream + */ + if ((u64)sba_sg_iova(startsg) & PIDE_FLAG) { + u32 pide = (u64)sba_sg_iova(startsg) & ~PIDE_FLAG; + dma_offset = (unsigned long) pide & ~IOVP_MASK; + sba_sg_iova(startsg) = 0; + dma_sg++; + sba_sg_iova(dma_sg) = (char *)(pide | ioc->ibase); + pdirp = &(ioc->pdir_base[pide >> IOVP_SHIFT]); + n_mappings++; + } + + /* + ** Look for a VCONTIG chunk + */ + if (cnt) { + unsigned long vaddr = (unsigned long) sba_sg_buffer(startsg); + ASSERT(pdirp); + + /* Since multiple Vcontig blocks could make up + ** one DMA stream, *add* cnt to dma_len. + */ + sba_sg_len(dma_sg) += cnt; + cnt += dma_offset; + dma_offset=0; /* only want offset on first chunk */ + cnt = ROUNDUP(cnt, IOVP_SIZE); +#ifdef CONFIG_PROC_FS + ioc->msg_pages += cnt >> IOVP_SHIFT; +#endif + do { + sba_io_pdir_entry(pdirp, vaddr); + vaddr += IOVP_SIZE; + cnt -= IOVP_SIZE; + pdirp++; + } while (cnt > 0); + } + startsg++; + } +#ifdef DEBUG_LARGE_SG_ENTRIES + dump_run_sg = 0; +#endif + return(n_mappings); +} + + +/* +** Two address ranges are DMA contiguous *iff* "end of prev" and +** "start of next" are both on a page boundry. +** +** (shift left is a quick trick to mask off upper bits) +*/ +#define DMA_CONTIG(__X, __Y) \ + (((((unsigned long) __X) | ((unsigned long) __Y)) << (BITS_PER_LONG - PAGE_SHIFT)) == 0UL) + + +/** + * sba_coalesce_chunks - preprocess the SG list + * @ioc: IO MMU structure which owns the pdir we are interested in. + * @startsg: list of IOVA/size pairs + * @nents: number of entries in startsg list + * + * First pass is to walk the SG list and determine where the breaks are + * in the DMA stream. Allocates PDIR entries but does not fill them. + * Returns the number of DMA chunks. + * + * Doing the fill seperate from the coalescing/allocation keeps the + * code simpler. Future enhancement could make one pass through + * the sglist do both. + */ +static SBA_INLINE int +sba_coalesce_chunks( struct ioc *ioc, + struct scatterlist *startsg, + int nents) +{ + struct scatterlist *vcontig_sg; /* VCONTIG chunk head */ + unsigned long vcontig_len; /* len of VCONTIG chunk */ + unsigned long vcontig_end; + struct scatterlist *dma_sg; /* next DMA stream head */ + unsigned long dma_offset, dma_len; /* start/len of DMA stream */ + int n_mappings = 0; + + while (nents > 0) { + unsigned long vaddr = (unsigned long) (startsg->address); + + /* + ** Prepare for first/next DMA stream + */ + dma_sg = vcontig_sg = startsg; + dma_len = vcontig_len = vcontig_end = sba_sg_len(startsg); + vcontig_end += vaddr; + dma_offset = vaddr & ~IOVP_MASK; + + /* PARANOID: clear entries */ + sba_sg_buffer(startsg) = sba_sg_iova(startsg); + sba_sg_iova(startsg) = 0; + sba_sg_len(startsg) = 0; + + /* + ** This loop terminates one iteration "early" since + ** it's always looking one "ahead". + */ + while (--nents > 0) { + unsigned long vaddr; /* tmp */ + + startsg++; + + /* catch brokenness in SCSI layer */ + ASSERT(startsg->length <= DMA_CHUNK_SIZE); + + /* + ** First make sure current dma stream won't + ** exceed DMA_CHUNK_SIZE if we coalesce the + ** next entry. + */ + if (((dma_len + dma_offset + startsg->length + ~IOVP_MASK) & IOVP_MASK) > DMA_CHUNK_SIZE) + break; + + /* + ** Then look for virtually contiguous blocks. + ** + ** append the next transaction? + */ + vaddr = (unsigned long) sba_sg_iova(startsg); + if (vcontig_end == vaddr) + { + vcontig_len += sba_sg_len(startsg); + vcontig_end += sba_sg_len(startsg); + dma_len += sba_sg_len(startsg); + sba_sg_buffer(startsg) = (char *)vaddr; + sba_sg_iova(startsg) = 0; + sba_sg_len(startsg) = 0; + continue; + } + +#ifdef DEBUG_LARGE_SG_ENTRIES + dump_run_sg = (vcontig_len > IOVP_SIZE); +#endif + + /* + ** Not virtually contigous. + ** Terminate prev chunk. + ** Start a new chunk. + ** + ** Once we start a new VCONTIG chunk, dma_offset + ** can't change. And we need the offset from the first + ** chunk - not the last one. Ergo Successive chunks + ** must start on page boundaries and dove tail + ** with it's predecessor. + */ + sba_sg_len(vcontig_sg) = vcontig_len; + + vcontig_sg = startsg; + vcontig_len = sba_sg_len(startsg); + + /* + ** 3) do the entries end/start on page boundaries? + ** Don't update vcontig_end until we've checked. + */ + if (DMA_CONTIG(vcontig_end, vaddr)) + { + vcontig_end = vcontig_len + vaddr; + dma_len += vcontig_len; + sba_sg_buffer(startsg) = (char *)vaddr; + sba_sg_iova(startsg) = 0; + continue; + } else { + break; + } + } + + /* + ** End of DMA Stream + ** Terminate last VCONTIG block. + ** Allocate space for DMA stream. + */ + sba_sg_len(vcontig_sg) = vcontig_len; + dma_len = (dma_len + dma_offset + ~IOVP_MASK) & IOVP_MASK; + ASSERT(dma_len <= DMA_CHUNK_SIZE); + sba_sg_iova(dma_sg) = (char *) (PIDE_FLAG + | (sba_alloc_range(ioc, dma_len) << IOVP_SHIFT) + | dma_offset); + n_mappings++; + } + + return n_mappings; +} + + +/** + * sba_map_sg - map Scatter/Gather list + * @dev: instance of PCI owned by the driver that's asking. + * @sglist: array of buffer/length pairs + * @nents: number of entries in list + * @direction: R/W or both. + * + * See Documentation/DMA-mapping.txt + */ +int sba_map_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents, + int direction) +{ + struct ioc *ioc; + int coalesced, filled = 0; + unsigned long flags; +#ifdef ALLOW_IOV_BYPASS + struct scatterlist *sg; +#endif + + DBG_RUN_SG("%s() START %d entries\n", __FUNCTION__, nents); + ioc = GET_IOC(dev); + ASSERT(ioc); + +#ifdef ALLOW_IOV_BYPASS + if (dev->dma_mask >= ioc->dma_mask) { + for (sg = sglist ; filled < nents ; filled++, sg++){ + sba_sg_buffer(sg) = sba_sg_iova(sg); + sba_sg_iova(sg) = (char *)virt_to_phys(sba_sg_buffer(sg)); + } +#ifdef CONFIG_PROC_FS + spin_lock_irqsave(&ioc->res_lock, flags); + ioc->msg_bypass++; + spin_unlock_irqrestore(&ioc->res_lock, flags); +#endif + return filled; + } +#endif + /* Fast path single entry scatterlists. */ + if (nents == 1) { + sba_sg_buffer(sglist) = sba_sg_iova(sglist); + sba_sg_iova(sglist) = (char *)sba_map_single(dev, + sba_sg_buffer(sglist), + sba_sg_len(sglist), direction); +#ifdef CONFIG_PROC_FS + /* + ** Should probably do some stats counting, but trying to + ** be precise quickly starts wasting CPU time. + */ +#endif + return 1; + } + + spin_lock_irqsave(&ioc->res_lock, flags); + +#ifdef ASSERT_PDIR_SANITY + if (sba_check_pdir(ioc,"Check before sba_map_sg()")) + { + sba_dump_sg(ioc, sglist, nents); + panic("Check before sba_map_sg()"); + } +#endif + +#ifdef CONFIG_PROC_FS + ioc->msg_calls++; +#endif + + /* + ** First coalesce the chunks and allocate I/O pdir space + ** + ** If this is one DMA stream, we can properly map using the + ** correct virtual address associated with each DMA page. + ** w/o this association, we wouldn't have coherent DMA! + ** Access to the virtual address is what forces a two pass algorithm. + */ + coalesced = sba_coalesce_chunks(ioc, sglist, nents); + + /* + ** Program the I/O Pdir + ** + ** map the virtual addresses to the I/O Pdir + ** o dma_address will contain the pdir index + ** o dma_len will contain the number of bytes to map + ** o address contains the virtual address. + */ + filled = sba_fill_pdir(ioc, sglist, nents); + +#ifdef ASSERT_PDIR_SANITY + if (sba_check_pdir(ioc,"Check after sba_map_sg()")) + { + sba_dump_sg(ioc, sglist, nents); + panic("Check after sba_map_sg()\n"); + } +#endif + + spin_unlock_irqrestore(&ioc->res_lock, flags); + + ASSERT(coalesced == filled); + DBG_RUN_SG("%s() DONE %d mappings\n", __FUNCTION__, filled); + + return filled; +} + + +/** + * sba_unmap_sg - unmap Scatter/Gather list + * @dev: instance of PCI owned by the driver that's asking. + * @sglist: array of buffer/length pairs + * @nents: number of entries in list + * @direction: R/W or both. + * + * See Documentation/DMA-mapping.txt + */ +void sba_unmap_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents, + int direction) +{ + struct ioc *ioc; +#ifdef ASSERT_PDIR_SANITY + unsigned long flags; +#endif + + DBG_RUN_SG("%s() START %d entries, %p,%x\n", + __FUNCTION__, nents, sba_sg_buffer(sglist), sglist->length); + + ioc = GET_IOC(dev); + ASSERT(ioc); + +#ifdef CONFIG_PROC_FS + ioc->usg_calls++; +#endif + +#ifdef ASSERT_PDIR_SANITY + spin_lock_irqsave(&ioc->res_lock, flags); + sba_check_pdir(ioc,"Check before sba_unmap_sg()"); + spin_unlock_irqrestore(&ioc->res_lock, flags); +#endif + + while (sba_sg_len(sglist) && nents--) { + + sba_unmap_single(dev, (dma_addr_t)sba_sg_iova(sglist), + sba_sg_len(sglist), direction); +#ifdef CONFIG_PROC_FS + /* + ** This leaves inconsistent data in the stats, but we can't + ** tell which sg lists were mapped by map_single and which + ** were coalesced to a single entry. The stats are fun, + ** but speed is more important. + */ + ioc->usg_pages += (((u64)sba_sg_iova(sglist) & ~IOVP_MASK) + sba_sg_len(sglist) + IOVP_SIZE - 1) >> PAGE_SHIFT; +#endif + ++sglist; + } + + DBG_RUN_SG("%s() DONE (nents %d)\n", __FUNCTION__, nents); + +#ifdef ASSERT_PDIR_SANITY + spin_lock_irqsave(&ioc->res_lock, flags); + sba_check_pdir(ioc,"Check after sba_unmap_sg()"); + spin_unlock_irqrestore(&ioc->res_lock, flags); +#endif + +} + +unsigned long +sba_dma_address (struct scatterlist *sg) +{ + return ((unsigned long)sba_sg_iova(sg)); +} + +int +sba_dma_supported (struct pci_dev *dev, u64 mask) +{ + return 1; +} + +/************************************************************** +* +* Initialization and claim +* +***************************************************************/ + + +static void +sba_ioc_init(struct sba_device *sba_dev, struct ioc *ioc, int ioc_num) +{ + u32 iova_space_size, iova_space_mask; + void * pdir_base; + int pdir_size, iov_order, tcnfg; + + /* + ** Firmware programs the maximum IOV space size into the imask reg + */ + iova_space_size = ~(READ_REG(ioc->ioc_hpa + IOC_IMASK) & 0xFFFFFFFFUL) + 1; +#ifdef CONFIG_IA64_HP_PROTO + if (!iova_space_size) + iova_space_size = GB(1); +#endif + + /* + ** iov_order is always based on a 1GB IOVA space since we want to + ** turn on the other half for AGP GART. + */ + iov_order = get_order(iova_space_size >> (IOVP_SHIFT-PAGE_SHIFT)); + ioc->pdir_size = pdir_size = (iova_space_size/IOVP_SIZE) * sizeof(u64); + + DBG_INIT("%s() hpa 0x%lx IOV %dMB (%d bits) PDIR size 0x%0x\n", + __FUNCTION__, ioc->ioc_hpa, iova_space_size>>20, + iov_order + PAGE_SHIFT, ioc->pdir_size); + + /* FIXME : DMA HINTs not used */ + ioc->hint_shift_pdir = iov_order + PAGE_SHIFT; + ioc->hint_mask_pdir = ~(0x3 << (iov_order + PAGE_SHIFT)); + + ioc->pdir_base = + pdir_base = (void *) __get_free_pages(GFP_KERNEL, get_order(pdir_size)); + if (NULL == pdir_base) + { + panic(__FILE__ ":%s() could not allocate I/O Page Table\n", __FUNCTION__); + } + memset(pdir_base, 0, pdir_size); + + DBG_INIT("%s() pdir %p size %x hint_shift_pdir %x hint_mask_pdir %lx\n", + __FUNCTION__, pdir_base, pdir_size, + ioc->hint_shift_pdir, ioc->hint_mask_pdir); + + ASSERT((((unsigned long) pdir_base) & PAGE_MASK) == (unsigned long) pdir_base); + WRITE_REG(virt_to_phys(pdir_base), ioc->ioc_hpa + IOC_PDIR_BASE); + + DBG_INIT(" base %p\n", pdir_base); + + /* build IMASK for IOC and Elroy */ + iova_space_mask = 0xffffffff; + iova_space_mask <<= (iov_order + PAGE_SHIFT); + +#ifdef CONFIG_IA64_HP_PROTO + /* + ** REVISIT - this is a kludge, but we won't be supporting anything but + ** zx1 2.0 or greater for real. When fw is in shape, ibase will + ** be preprogrammed w/ the IOVA hole base and imask will give us + ** the size. + */ + if ((sba_dev->hw_rev & 0xFF) < 0x20) { + DBG_INIT("%s() Found SBA rev < 2.0, setting IOVA base to 0. This device will not be supported in the future.\n", __FUNCTION__); + ioc->ibase = 0x0; + } else +#endif + ioc->ibase = READ_REG(ioc->ioc_hpa + IOC_IBASE) & 0xFFFFFFFEUL; + + ioc->imask = iova_space_mask; /* save it */ + + DBG_INIT("%s() IOV base 0x%lx mask 0x%0lx\n", + __FUNCTION__, ioc->ibase, ioc->imask); + + /* + ** FIXME: Hint registers are programmed with default hint + ** values during boot, so hints should be sane even if we + ** can't reprogram them the way drivers want. + */ + + WRITE_REG(ioc->imask, ioc->ioc_hpa+IOC_IMASK); + + /* + ** Setting the upper bits makes checking for bypass addresses + ** a little faster later on. + */ + ioc->imask |= 0xFFFFFFFF00000000UL; + + /* Set I/O PDIR Page size to system page size */ + switch (PAGE_SHIFT) { + case 12: /* 4K */ + tcnfg = 0; + break; + case 13: /* 8K */ + tcnfg = 1; + break; + case 14: /* 16K */ + tcnfg = 2; + break; + case 16: /* 64K */ + tcnfg = 3; + break; + } + WRITE_REG(tcnfg, ioc->ioc_hpa+IOC_TCNFG); + + /* + ** Program the IOC's ibase and enable IOVA translation + ** Bit zero == enable bit. + */ + WRITE_REG(ioc->ibase | 1, ioc->ioc_hpa+IOC_IBASE); + + /* + ** Clear I/O TLB of any possible entries. + ** (Yes. This is a bit paranoid...but so what) + */ + WRITE_REG(0 | 31, ioc->ioc_hpa+IOC_PCOM); + + /* + ** If an AGP device is present, only use half of the IOV space + ** for PCI DMA. Unfortunately we can't know ahead of time + ** whether GART support will actually be used, for now we + ** can just key on an AGP device found in the system. + ** We program the next pdir index after we stop w/ a key for + ** the GART code to handshake on. + */ + if (SBA_GET_AGP(sba_dev)) { + DBG_INIT("%s() AGP Device found, reserving 512MB for GART support\n", __FUNCTION__); + ioc->pdir_size /= 2; + ((u64 *)pdir_base)[PDIR_INDEX(iova_space_size/2)] = 0x0000badbadc0ffeeULL; + } + + DBG_INIT("%s() DONE\n", __FUNCTION__); +} + + + +/************************************************************************** +** +** SBA initialization code (HW and SW) +** +** o identify SBA chip itself +** o FIXME: initialize DMA hints for reasonable defaults +** +**************************************************************************/ + +static void +sba_hw_init(struct sba_device *sba_dev) +{ + int i; + int num_ioc; + u64 dma_mask; + u32 func_id; + + /* + ** Identify the SBA so we can set the dma_mask. We can make a virtual + ** dma_mask of the memory subsystem such that devices not implmenting + ** a full 64bit mask might still be able to bypass efficiently. + */ + func_id = READ_REG(sba_dev->sba_hpa + SBA_FUNC_ID); + + if (func_id == ZX1_FUNC_ID_VALUE) { + dma_mask = 0xFFFFFFFFFFUL; + } else { + dma_mask = 0xFFFFFFFFFFFFFFFFUL; + } + + DBG_INIT("%s(): ioc->dma_mask == 0x%lx\n", __FUNCTION__, dma_mask); + + /* + ** Leaving in the multiple ioc code from parisc for the future, + ** currently there are no muli-ioc mckinley sbas + */ + sba_dev->ioc[0].ioc_hpa = SBA_IOC_OFFSET; + num_ioc = 1; + + sba_dev->num_ioc = num_ioc; + for (i = 0; i < num_ioc; i++) { + sba_dev->ioc[i].dma_mask = dma_mask; + sba_dev->ioc[i].ioc_hpa += sba_dev->sba_hpa; + sba_ioc_init(sba_dev, &(sba_dev->ioc[i]), i); + } +} + +static void +sba_common_init(struct sba_device *sba_dev) +{ + int i; + + /* add this one to the head of the list (order doesn't matter) + ** This will be useful for debugging - especially if we get coredumps + */ + sba_dev->next = sba_list; + sba_list = sba_dev; + sba_count++; + + for(i=0; i< sba_dev->num_ioc; i++) { + int res_size; + + /* resource map size dictated by pdir_size */ + res_size = sba_dev->ioc[i].pdir_size/sizeof(u64); /* entries */ + res_size >>= 3; /* convert bit count to byte count */ + DBG_INIT("%s() res_size 0x%x\n", + __FUNCTION__, res_size); + + sba_dev->ioc[i].res_size = res_size; + sba_dev->ioc[i].res_map = (char *) __get_free_pages(GFP_KERNEL, get_order(res_size)); + + if (NULL == sba_dev->ioc[i].res_map) + { + panic(__FILE__ ":%s() could not allocate resource map\n", __FUNCTION__ ); + } + + memset(sba_dev->ioc[i].res_map, 0, res_size); + /* next available IOVP - circular search */ + if ((sba_dev->hw_rev & 0xFF) >= 0x20) { + sba_dev->ioc[i].res_hint = (unsigned long *) + sba_dev->ioc[i].res_map; + } else { + u64 reserved_iov; + + /* Yet another 1.x hack */ + printk("zx1 1.x: Starting resource hint offset into IOV space to avoid initial zero value IOVA\n"); + sba_dev->ioc[i].res_hint = (unsigned long *) + &(sba_dev->ioc[i].res_map[L1_CACHE_BYTES]); + + sba_dev->ioc[i].res_map[0] = 0x1; + sba_dev->ioc[i].pdir_base[0] = 0x8000badbadc0ffeeULL; + + for (reserved_iov = 0xA0000 ; reserved_iov < 0xC0000 ; reserved_iov += IOVP_SIZE) { + u64 *res_ptr = (u64 *) sba_dev->ioc[i].res_map; + int index = PDIR_INDEX(reserved_iov); + int res_word; + u64 mask; + + res_word = (int)(index / BITS_PER_LONG); + mask = 0x1UL << (index - (res_word * BITS_PER_LONG)); + res_ptr[res_word] |= mask; + sba_dev->ioc[i].pdir_base[PDIR_INDEX(reserved_iov)] = (0x80000000000000FFULL | reserved_iov); + + } + } + +#ifdef ASSERT_PDIR_SANITY + /* Mark first bit busy - ie no IOVA 0 */ + sba_dev->ioc[i].res_map[0] = 0x1; + sba_dev->ioc[i].pdir_base[0] = 0x8000badbadc0ffeeULL; +#endif + + DBG_INIT("%s() %d res_map %x %p\n", __FUNCTION__, + i, res_size, (void *)sba_dev->ioc[i].res_map); + } + + sba_dev->sba_lock = SPIN_LOCK_UNLOCKED; +} + +#ifdef CONFIG_PROC_FS +static int sba_proc_info(char *buf, char **start, off_t offset, int len) +{ + struct sba_device *sba_dev = sba_list; + struct ioc *ioc = &sba_dev->ioc[0]; /* FIXME: Multi-IOC support! */ + int total_pages = (int) (ioc->res_size << 3); /* 8 bits per byte */ + unsigned long i = 0, avg = 0, min, max; + + sprintf(buf, "%s rev %d.%d\n", + "Hewlett Packard zx1 SBA", + ((sba_dev->hw_rev >> 4) & 0xF), + (sba_dev->hw_rev & 0xF) + ); + sprintf(buf, "%sIO PDIR size : %d bytes (%d entries)\n", + buf, + (int) ((ioc->res_size << 3) * sizeof(u64)), /* 8 bits/byte */ + total_pages); + + sprintf(buf, "%sIO PDIR entries : %ld free %ld used (%d%%)\n", buf, + total_pages - ioc->used_pages, ioc->used_pages, + (int) (ioc->used_pages * 100 / total_pages)); + + sprintf(buf, "%sResource bitmap : %d bytes (%d pages)\n", + buf, ioc->res_size, ioc->res_size << 3); /* 8 bits per byte */ + + min = max = ioc->avg_search[0]; + for (i = 0; i < SBA_SEARCH_SAMPLE; i++) { + avg += ioc->avg_search[i]; + if (ioc->avg_search[i] > max) max = ioc->avg_search[i]; + if (ioc->avg_search[i] < min) min = ioc->avg_search[i]; + } + avg /= SBA_SEARCH_SAMPLE; + sprintf(buf, "%s Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n", + buf, min, avg, max); + + sprintf(buf, "%spci_map_single(): %12ld calls %12ld pages (avg %d/1000)\n", + buf, ioc->msingle_calls, ioc->msingle_pages, + (int) ((ioc->msingle_pages * 1000)/ioc->msingle_calls)); +#ifdef ALLOW_IOV_BYPASS + sprintf(buf, "%spci_map_single(): %12ld bypasses\n", + buf, ioc->msingle_bypass); +#endif + + sprintf(buf, "%spci_unmap_single: %12ld calls %12ld pages (avg %d/1000)\n", + buf, ioc->usingle_calls, ioc->usingle_pages, + (int) ((ioc->usingle_pages * 1000)/ioc->usingle_calls)); +#ifdef ALLOW_IOV_BYPASS + sprintf(buf, "%spci_unmap_single: %12ld bypasses\n", + buf, ioc->usingle_bypass); +#endif + + sprintf(buf, "%spci_map_sg() : %12ld calls %12ld pages (avg %d/1000)\n", + buf, ioc->msg_calls, ioc->msg_pages, + (int) ((ioc->msg_pages * 1000)/ioc->msg_calls)); +#ifdef ALLOW_IOV_BYPASS + sprintf(buf, "%spci_map_sg() : %12ld bypasses\n", + buf, ioc->msg_bypass); +#endif + + sprintf(buf, "%spci_unmap_sg() : %12ld calls %12ld pages (avg %d/1000)\n", + buf, ioc->usg_calls, ioc->usg_pages, + (int) ((ioc->usg_pages * 1000)/ioc->usg_calls)); + + return strlen(buf); +} + +static int +sba_resource_map(char *buf, char **start, off_t offset, int len) +{ + struct ioc *ioc = sba_list->ioc; /* FIXME: Multi-IOC support! */ + unsigned int *res_ptr = (unsigned int *)ioc->res_map; + int i; + + buf[0] = '\0'; + for(i = 0; i < (ioc->res_size / sizeof(unsigned int)); ++i, ++res_ptr) { + if ((i & 7) == 0) + strcat(buf,"\n "); + sprintf(buf, "%s %08x", buf, *res_ptr); + } + strcat(buf, "\n"); + + return strlen(buf); +} +#endif + +/* +** Determine if sba should claim this chip (return 0) or not (return 1). +** If so, initialize the chip and tell other partners in crime they +** have work to do. +*/ +void __init sba_init(void) +{ + struct sba_device *sba_dev; + u32 func_id, hw_rev; + u32 *func_offset = NULL; + int i, agp_found = 0; + static char sba_rev[6]; + struct pci_dev *device = NULL; + u64 hpa = 0; + + if (!(device = pci_find_device(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_ZX1_SBA, NULL))) + return; + + for (i = 0; i < PCI_NUM_RESOURCES; i++) { + if (pci_resource_flags(device, i) == IORESOURCE_MEM) { + hpa = (u64) ioremap(pci_resource_start(device, i), + pci_resource_len(device, i)); + break; + } + } + + func_id = READ_REG(hpa + SBA_FUNC_ID); + + if (func_id == ZX1_FUNC_ID_VALUE) { + (void)strcpy(sba_rev, "zx1"); + func_offset = zx1_func_offsets; + } else { + return; + } + + /* Read HW Rev First */ + hw_rev = READ_REG(hpa + SBA_FCLASS) & 0xFFUL; + + /* + * Not all revision registers of the chipset are updated on every + * turn. Must scan through all functions looking for the highest rev + */ + if (func_offset) { + for (i = 0 ; func_offset[i] != -1 ; i++) { + u32 func_rev; + + func_rev = READ_REG(hpa + SBA_FCLASS + func_offset[i]) & 0xFFUL; + DBG_INIT("%s() func offset: 0x%x rev: 0x%x\n", + __FUNCTION__, func_offset[i], func_rev); + if (func_rev > hw_rev) + hw_rev = func_rev; + } + } + + printk(KERN_INFO "%s found %s %d.%d at %s, HPA 0x%lx\n", DRIVER_NAME, + sba_rev, ((hw_rev >> 4) & 0xF), (hw_rev & 0xF), + device->slot_name, hpa); + + if ((hw_rev & 0xFF) < 0x20) { + printk(KERN_INFO "%s WARNING rev 2.0 or greater will be required for IO MMU support in the future\n", DRIVER_NAME); +#ifndef CONFIG_IA64_HP_PROTO + panic("%s: CONFIG_IA64_HP_PROTO MUST be enabled to support SBA rev less than 2.0", DRIVER_NAME); +#endif + } + + sba_dev = kmalloc(sizeof(struct sba_device), GFP_KERNEL); + if (NULL == sba_dev) { + printk(KERN_ERR DRIVER_NAME " - couldn't alloc sba_device\n"); + return; + } + + memset(sba_dev, 0, sizeof(struct sba_device)); + + for(i=0; iioc[i].res_lock)); + + sba_dev->hw_rev = hw_rev; + sba_dev->sba_hpa = hpa; + + /* + * We pass this fake device from alloc_consistent to ensure + * we only use SAC for alloc_consistent mappings. + */ + sac_only_dev.dma_mask = 0xFFFFFFFFUL; + + /* + * We need to check for an AGP device, if we find one, then only + * use part of the IOVA space for PCI DMA, the rest is for GART. + * REVISIT for multiple IOC. + */ + pci_for_each_dev(device) + agp_found |= pci_find_capability(device, PCI_CAP_ID_AGP); + + if (agp_found && reserve_sba_gart) + SBA_SET_AGP(sba_dev); + + sba_hw_init(sba_dev); + sba_common_init(sba_dev); + +#ifdef CONFIG_PROC_FS + { + struct proc_dir_entry * proc_mckinley_root; + + proc_mckinley_root = proc_mkdir("bus/mckinley",0); + create_proc_info_entry(sba_rev, 0, proc_mckinley_root, sba_proc_info); + create_proc_info_entry("bitmap", 0, proc_mckinley_root, sba_resource_map); + } +#endif +} + +static int __init +nosbagart (char *str) +{ + reserve_sba_gart = 0; + return 1; +} + +__setup("nosbagart",nosbagart); + +EXPORT_SYMBOL(sba_init); +EXPORT_SYMBOL(sba_map_single); +EXPORT_SYMBOL(sba_unmap_single); +EXPORT_SYMBOL(sba_map_sg); +EXPORT_SYMBOL(sba_unmap_sg); +EXPORT_SYMBOL(sba_dma_address); +EXPORT_SYMBOL(sba_dma_supported); +EXPORT_SYMBOL(sba_alloc_consistent); +EXPORT_SYMBOL(sba_free_consistent); diff -urN linux-2.4.18/arch/ia64/hp/hpsim_console.c lia64-2.4/arch/ia64/hp/hpsim_console.c --- linux-2.4.18/arch/ia64/hp/hpsim_console.c Thu Oct 12 14:20:48 2000 +++ lia64-2.4/arch/ia64/hp/hpsim_console.c Wed Dec 31 16:00:00 1969 @@ -1,74 +0,0 @@ -/* - * Platform dependent support for HP simulator. - * - * Copyright (C) 1998, 1999 Hewlett-Packard Co - * Copyright (C) 1998, 1999 David Mosberger-Tang - * Copyright (C) 1999 Vijay Chander - */ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "hpsim_ssc.h" - -static int simcons_init (struct console *, char *); -static void simcons_write (struct console *, const char *, unsigned); -static int simcons_wait_key (struct console *); -static kdev_t simcons_console_device (struct console *); - -struct console hpsim_cons = { - name: "simcons", - write: simcons_write, - device: simcons_console_device, - wait_key: simcons_wait_key, - setup: simcons_init, - flags: CON_PRINTBUFFER, - index: -1, -}; - -static int -simcons_init (struct console *cons, char *options) -{ - return 0; -} - -static void -simcons_write (struct console *cons, const char *buf, unsigned count) -{ - unsigned long ch; - - while (count-- > 0) { - ch = *buf++; - ia64_ssc(ch, 0, 0, 0, SSC_PUTCHAR); - if (ch == '\n') - ia64_ssc('\r', 0, 0, 0, SSC_PUTCHAR); - } -} - -static int -simcons_wait_key (struct console *cons) -{ - char ch; - - do { - ch = ia64_ssc(0, 0, 0, 0, SSC_GETCHAR); - } while (ch == '\0'); - return ch; -} - -static kdev_t -simcons_console_device (struct console *c) -{ - return MKDEV(TTY_MAJOR, 64 + c->index); -} diff -urN linux-2.4.18/arch/ia64/hp/hpsim_irq.c lia64-2.4/arch/ia64/hp/hpsim_irq.c --- linux-2.4.18/arch/ia64/hp/hpsim_irq.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/hp/hpsim_irq.c Wed Dec 31 16:00:00 1969 @@ -1,46 +0,0 @@ -/* - * Platform dependent support for HP simulator. - * - * Copyright (C) 1998-2001 Hewlett-Packard Co - * Copyright (C) 1998-2001 David Mosberger-Tang - */ - -#include -#include -#include -#include - -static unsigned int -hpsim_irq_startup (unsigned int irq) -{ - return 0; -} - -static void -hpsim_irq_noop (unsigned int irq) -{ -} - -static struct hw_interrupt_type irq_type_hp_sim = { - typename: "hpsim", - startup: hpsim_irq_startup, - shutdown: hpsim_irq_noop, - enable: hpsim_irq_noop, - disable: hpsim_irq_noop, - ack: hpsim_irq_noop, - end: hpsim_irq_noop, - set_affinity: (void (*)(unsigned int, unsigned long)) hpsim_irq_noop, -}; - -void __init -hpsim_irq_init (void) -{ - irq_desc_t *idesc; - int i; - - for (i = 0; i < NR_IRQS; ++i) { - idesc = irq_desc(i); - if (idesc->handler == &no_irq_type) - idesc->handler = &irq_type_hp_sim; - } -} diff -urN linux-2.4.18/arch/ia64/hp/hpsim_machvec.c lia64-2.4/arch/ia64/hp/hpsim_machvec.c --- linux-2.4.18/arch/ia64/hp/hpsim_machvec.c Fri Aug 11 19:09:06 2000 +++ lia64-2.4/arch/ia64/hp/hpsim_machvec.c Wed Dec 31 16:00:00 1969 @@ -1,2 +0,0 @@ -#define MACHVEC_PLATFORM_NAME hpsim -#include diff -urN linux-2.4.18/arch/ia64/hp/hpsim_setup.c lia64-2.4/arch/ia64/hp/hpsim_setup.c --- linux-2.4.18/arch/ia64/hp/hpsim_setup.c Tue Jul 31 10:30:08 2001 +++ lia64-2.4/arch/ia64/hp/hpsim_setup.c Wed Dec 31 16:00:00 1969 @@ -1,58 +0,0 @@ -/* - * Platform dependent support for HP simulator. - * - * Copyright (C) 1998, 1999 Hewlett-Packard Co - * Copyright (C) 1998, 1999 David Mosberger-Tang - * Copyright (C) 1999 Vijay Chander - */ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "hpsim_ssc.h" - -extern struct console hpsim_cons; - -/* - * Simulator system call. - */ -asm (".text\n" - ".align 32\n" - ".global ia64_ssc\n" - ".proc ia64_ssc\n" - "ia64_ssc:\n" - "mov r15=r36\n" - "break 0x80001\n" - "br.ret.sptk.many rp\n" - ".endp\n"); - -void -ia64_ssc_connect_irq (long intr, long irq) -{ - ia64_ssc(intr, irq, 0, 0, SSC_CONNECT_INTERRUPT); -} - -void -ia64_ctl_trace (long on) -{ - ia64_ssc(on, 0, 0, 0, SSC_CTL_TRACE); -} - -void __init -hpsim_setup (char **cmdline_p) -{ - ROOT_DEV = to_kdev_t(0x0801); /* default to first SCSI drive */ - - register_console (&hpsim_cons); -} diff -urN linux-2.4.18/arch/ia64/hp/hpsim_ssc.h lia64-2.4/arch/ia64/hp/hpsim_ssc.h --- linux-2.4.18/arch/ia64/hp/hpsim_ssc.h Sun Feb 6 18:42:40 2000 +++ lia64-2.4/arch/ia64/hp/hpsim_ssc.h Wed Dec 31 16:00:00 1969 @@ -1,36 +0,0 @@ -/* - * Platform dependent support for HP simulator. - * - * Copyright (C) 1998, 1999 Hewlett-Packard Co - * Copyright (C) 1998, 1999 David Mosberger-Tang - * Copyright (C) 1999 Vijay Chander - */ -#ifndef _IA64_PLATFORM_HPSIM_SSC_H -#define _IA64_PLATFORM_HPSIM_SSC_H - -/* Simulator system calls: */ - -#define SSC_CONSOLE_INIT 20 -#define SSC_GETCHAR 21 -#define SSC_PUTCHAR 31 -#define SSC_CONNECT_INTERRUPT 58 -#define SSC_GENERATE_INTERRUPT 59 -#define SSC_SET_PERIODIC_INTERRUPT 60 -#define SSC_GET_RTC 65 -#define SSC_EXIT 66 -#define SSC_LOAD_SYMBOLS 69 -#define SSC_GET_TOD 74 -#define SSC_CTL_TRACE 76 - -#define SSC_NETDEV_PROBE 100 -#define SSC_NETDEV_SEND 101 -#define SSC_NETDEV_RECV 102 -#define SSC_NETDEV_ATTACH 103 -#define SSC_NETDEV_DETACH 104 - -/* - * Simulator system call. - */ -extern long ia64_ssc (long arg0, long arg1, long arg2, long arg3, int nr); - -#endif /* _IA64_PLATFORM_HPSIM_SSC_H */ diff -urN linux-2.4.18/arch/ia64/hp/sim/Makefile lia64-2.4/arch/ia64/hp/sim/Makefile --- linux-2.4.18/arch/ia64/hp/sim/Makefile Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/hp/sim/Makefile Fri Apr 5 16:44:44 2002 @@ -0,0 +1,13 @@ +# +# ia64/platform/hp/sim/Makefile +# +# Copyright (C) 1999 Silicon Graphics, Inc. +# Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com) +# + +O_TARGET := sim.o + +obj-y := hpsim_console.o hpsim_irq.o hpsim_setup.o +obj-$(CONFIG_IA64_GENERIC) += hpsim_machvec.o + +include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ia64/hp/sim/hpsim_console.c lia64-2.4/arch/ia64/hp/sim/hpsim_console.c --- linux-2.4.18/arch/ia64/hp/sim/hpsim_console.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/hp/sim/hpsim_console.c Wed Nov 1 23:10:42 2000 @@ -0,0 +1,74 @@ +/* + * Platform dependent support for HP simulator. + * + * Copyright (C) 1998, 1999 Hewlett-Packard Co + * Copyright (C) 1998, 1999 David Mosberger-Tang + * Copyright (C) 1999 Vijay Chander + */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "hpsim_ssc.h" + +static int simcons_init (struct console *, char *); +static void simcons_write (struct console *, const char *, unsigned); +static int simcons_wait_key (struct console *); +static kdev_t simcons_console_device (struct console *); + +struct console hpsim_cons = { + name: "simcons", + write: simcons_write, + device: simcons_console_device, + wait_key: simcons_wait_key, + setup: simcons_init, + flags: CON_PRINTBUFFER, + index: -1, +}; + +static int +simcons_init (struct console *cons, char *options) +{ + return 0; +} + +static void +simcons_write (struct console *cons, const char *buf, unsigned count) +{ + unsigned long ch; + + while (count-- > 0) { + ch = *buf++; + ia64_ssc(ch, 0, 0, 0, SSC_PUTCHAR); + if (ch == '\n') + ia64_ssc('\r', 0, 0, 0, SSC_PUTCHAR); + } +} + +static int +simcons_wait_key (struct console *cons) +{ + char ch; + + do { + ch = ia64_ssc(0, 0, 0, 0, SSC_GETCHAR); + } while (ch == '\0'); + return ch; +} + +static kdev_t +simcons_console_device (struct console *c) +{ + return MKDEV(TTY_MAJOR, 64 + c->index); +} diff -urN linux-2.4.18/arch/ia64/hp/sim/hpsim_irq.c lia64-2.4/arch/ia64/hp/sim/hpsim_irq.c --- linux-2.4.18/arch/ia64/hp/sim/hpsim_irq.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/hp/sim/hpsim_irq.c Wed Feb 28 14:43:45 2001 @@ -0,0 +1,46 @@ +/* + * Platform dependent support for HP simulator. + * + * Copyright (C) 1998-2001 Hewlett-Packard Co + * Copyright (C) 1998-2001 David Mosberger-Tang + */ + +#include +#include +#include +#include + +static unsigned int +hpsim_irq_startup (unsigned int irq) +{ + return 0; +} + +static void +hpsim_irq_noop (unsigned int irq) +{ +} + +static struct hw_interrupt_type irq_type_hp_sim = { + typename: "hpsim", + startup: hpsim_irq_startup, + shutdown: hpsim_irq_noop, + enable: hpsim_irq_noop, + disable: hpsim_irq_noop, + ack: hpsim_irq_noop, + end: hpsim_irq_noop, + set_affinity: (void (*)(unsigned int, unsigned long)) hpsim_irq_noop, +}; + +void __init +hpsim_irq_init (void) +{ + irq_desc_t *idesc; + int i; + + for (i = 0; i < NR_IRQS; ++i) { + idesc = irq_desc(i); + if (idesc->handler == &no_irq_type) + idesc->handler = &irq_type_hp_sim; + } +} diff -urN linux-2.4.18/arch/ia64/hp/sim/hpsim_machvec.c lia64-2.4/arch/ia64/hp/sim/hpsim_machvec.c --- linux-2.4.18/arch/ia64/hp/sim/hpsim_machvec.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/hp/sim/hpsim_machvec.c Thu Aug 24 08:17:30 2000 @@ -0,0 +1,2 @@ +#define MACHVEC_PLATFORM_NAME hpsim +#include diff -urN linux-2.4.18/arch/ia64/hp/sim/hpsim_setup.c lia64-2.4/arch/ia64/hp/sim/hpsim_setup.c --- linux-2.4.18/arch/ia64/hp/sim/hpsim_setup.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/hp/sim/hpsim_setup.c Wed May 30 22:41:37 2001 @@ -0,0 +1,58 @@ +/* + * Platform dependent support for HP simulator. + * + * Copyright (C) 1998, 1999 Hewlett-Packard Co + * Copyright (C) 1998, 1999 David Mosberger-Tang + * Copyright (C) 1999 Vijay Chander + */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "hpsim_ssc.h" + +extern struct console hpsim_cons; + +/* + * Simulator system call. + */ +asm (".text\n" + ".align 32\n" + ".global ia64_ssc\n" + ".proc ia64_ssc\n" + "ia64_ssc:\n" + "mov r15=r36\n" + "break 0x80001\n" + "br.ret.sptk.many rp\n" + ".endp\n"); + +void +ia64_ssc_connect_irq (long intr, long irq) +{ + ia64_ssc(intr, irq, 0, 0, SSC_CONNECT_INTERRUPT); +} + +void +ia64_ctl_trace (long on) +{ + ia64_ssc(on, 0, 0, 0, SSC_CTL_TRACE); +} + +void __init +hpsim_setup (char **cmdline_p) +{ + ROOT_DEV = to_kdev_t(0x0801); /* default to first SCSI drive */ + + register_console (&hpsim_cons); +} diff -urN linux-2.4.18/arch/ia64/hp/sim/hpsim_ssc.h lia64-2.4/arch/ia64/hp/sim/hpsim_ssc.h --- linux-2.4.18/arch/ia64/hp/sim/hpsim_ssc.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/hp/sim/hpsim_ssc.h Sun Feb 6 18:42:40 2000 @@ -0,0 +1,36 @@ +/* + * Platform dependent support for HP simulator. + * + * Copyright (C) 1998, 1999 Hewlett-Packard Co + * Copyright (C) 1998, 1999 David Mosberger-Tang + * Copyright (C) 1999 Vijay Chander + */ +#ifndef _IA64_PLATFORM_HPSIM_SSC_H +#define _IA64_PLATFORM_HPSIM_SSC_H + +/* Simulator system calls: */ + +#define SSC_CONSOLE_INIT 20 +#define SSC_GETCHAR 21 +#define SSC_PUTCHAR 31 +#define SSC_CONNECT_INTERRUPT 58 +#define SSC_GENERATE_INTERRUPT 59 +#define SSC_SET_PERIODIC_INTERRUPT 60 +#define SSC_GET_RTC 65 +#define SSC_EXIT 66 +#define SSC_LOAD_SYMBOLS 69 +#define SSC_GET_TOD 74 +#define SSC_CTL_TRACE 76 + +#define SSC_NETDEV_PROBE 100 +#define SSC_NETDEV_SEND 101 +#define SSC_NETDEV_RECV 102 +#define SSC_NETDEV_ATTACH 103 +#define SSC_NETDEV_DETACH 104 + +/* + * Simulator system call. + */ +extern long ia64_ssc (long arg0, long arg1, long arg2, long arg3, int nr); + +#endif /* _IA64_PLATFORM_HPSIM_SSC_H */ diff -urN linux-2.4.18/arch/ia64/hp/zx1/Makefile lia64-2.4/arch/ia64/hp/zx1/Makefile --- linux-2.4.18/arch/ia64/hp/zx1/Makefile Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/hp/zx1/Makefile Fri Apr 5 16:44:44 2002 @@ -0,0 +1,13 @@ +# +# ia64/platform/hp/zx1/Makefile +# +# Copyright (C) 2002 Hewlett Packard +# Copyright (C) Alex Williamson (alex_williamson@hp.com) +# + +O_TARGET := zx1.o + +obj-y := hpzx1_misc.o +obj-$(CONFIG_IA64_GENERIC) += hpzx1_machvec.o + +include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ia64/hp/zx1/hpzx1_machvec.c lia64-2.4/arch/ia64/hp/zx1/hpzx1_machvec.c --- linux-2.4.18/arch/ia64/hp/zx1/hpzx1_machvec.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/hp/zx1/hpzx1_machvec.c Fri Apr 5 16:44:44 2002 @@ -0,0 +1,2 @@ +#define MACHVEC_PLATFORM_NAME hpzx1 +#include diff -urN linux-2.4.18/arch/ia64/hp/zx1/hpzx1_misc.c lia64-2.4/arch/ia64/hp/zx1/hpzx1_misc.c --- linux-2.4.18/arch/ia64/hp/zx1/hpzx1_misc.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/hp/zx1/hpzx1_misc.c Fri Jul 19 23:13:35 2002 @@ -0,0 +1,359 @@ +/* + * Misc. support for HP zx1 chipset support + * + * Copyright (C) 2002 Hewlett-Packard Co + * Copyright (C) 2002 Alex Williamson + * Copyright (C) 2002 Bjorn Helgaas + */ + + +#include +#include +#include +#include +#include + +#include +#include +#include + +extern acpi_status acpi_evaluate_integer (acpi_handle, acpi_string, acpi_object_list *, unsigned long *); + +#define PFX "hpzx1: " + +static int hpzx1_devices; + +struct fake_pci_dev { + unsigned long csr_base; + unsigned long csr_size; + unsigned long mapped_csrs; // ioremapped + int sizing; // in middle of BAR sizing operation? +}; + +static struct pci_ops *orig_pci_ops; + +#define HP_CFG_RD(sz, bits, name) \ +static int hp_cfg_read##sz (struct pci_dev *dev, int where, u##bits *value) \ +{ \ + struct fake_pci_dev *fake_dev; \ + if (!(fake_dev = (struct fake_pci_dev *) dev->sysdata)) \ + return orig_pci_ops->name(dev, where, value); \ + \ + if (where == PCI_BASE_ADDRESS_0) { \ + if (fake_dev->sizing) \ + *value = ~(fake_dev->csr_size - 1); \ + else \ + *value = (fake_dev->csr_base & \ + PCI_BASE_ADDRESS_MEM_MASK) | \ + PCI_BASE_ADDRESS_SPACE_MEMORY; \ + fake_dev->sizing = 0; \ + return PCIBIOS_SUCCESSFUL; \ + } \ + *value = read##sz(fake_dev->mapped_csrs + where); \ + if (where == PCI_COMMAND) \ + *value |= PCI_COMMAND_MEMORY; /* SBA omits this */ \ + return PCIBIOS_SUCCESSFUL; \ +} + +#define HP_CFG_WR(sz, bits, name) \ +static int hp_cfg_write##sz (struct pci_dev *dev, int where, u##bits value) \ +{ \ + struct fake_pci_dev *fake_dev; \ + \ + if (!(fake_dev = (struct fake_pci_dev *) dev->sysdata)) \ + return orig_pci_ops->name(dev, where, value); \ + \ + if (where == PCI_BASE_ADDRESS_0) { \ + if (value == (u##bits) ~0) \ + fake_dev->sizing = 1; \ + return PCIBIOS_SUCCESSFUL; \ + } else \ + write##sz(value, fake_dev->mapped_csrs + where); \ + return PCIBIOS_SUCCESSFUL; \ +} + +HP_CFG_RD(b, 8, read_byte) +HP_CFG_RD(w, 16, read_word) +HP_CFG_RD(l, 32, read_dword) +HP_CFG_WR(b, 8, write_byte) +HP_CFG_WR(w, 16, write_word) +HP_CFG_WR(l, 32, write_dword) + +static struct pci_ops hp_pci_conf = { + hp_cfg_readb, + hp_cfg_readw, + hp_cfg_readl, + hp_cfg_writeb, + hp_cfg_writew, + hp_cfg_writel, +}; + +static void +hpzx1_fake_pci_dev(char *name, unsigned int busnum, unsigned long addr, unsigned int size) +{ + struct fake_pci_dev *fake; + int slot; + struct pci_dev *dev; + struct pci_bus *b, *bus = NULL; + u8 hdr; + + fake = kmalloc(sizeof(*fake), GFP_KERNEL); + if (!fake) { + printk(KERN_ERR PFX "No memory for %s (0x%p) sysdata\n", name, + (void *) addr); + return; + } + + memset(fake, 0, sizeof(*fake)); + fake->csr_base = addr; + fake->csr_size = size; + fake->mapped_csrs = (unsigned long) ioremap(addr, size); + fake->sizing = 0; + + pci_for_each_bus(b) + if (busnum == b->number) { + bus = b; + break; + } + + if (!bus) { + printk(KERN_ERR PFX "No host bus 0x%02x for %s (0x%p)\n", + busnum, name, (void *) addr); + kfree(fake); + return; + } + + for (slot = 0x1e; slot; slot--) + if (!pci_find_slot(busnum, PCI_DEVFN(slot, 0))) + break; + + if (slot < 0) { + printk(KERN_ERR PFX "No space for %s (0x%p) on bus 0x%02x\n", + name, (void *) addr, busnum); + kfree(fake); + return; + } + + dev = kmalloc(sizeof(*dev), GFP_KERNEL); + if (!dev) { + printk(KERN_ERR PFX "No memory for %s (0x%p)\n", name, + (void *) addr); + kfree(fake); + return; + } + + bus->ops = &hp_pci_conf; // replace pci ops for this bus + + memset(dev, 0, sizeof(*dev)); + dev->bus = bus; + dev->sysdata = fake; + dev->devfn = PCI_DEVFN(slot, 0); + pci_read_config_word(dev, PCI_VENDOR_ID, &dev->vendor); + pci_read_config_word(dev, PCI_DEVICE_ID, &dev->device); + pci_read_config_byte(dev, PCI_HEADER_TYPE, &hdr); + dev->hdr_type = hdr & 0x7f; + + pci_setup_device(dev); + + // pci_insert_device() without running /sbin/hotplug + list_add_tail(&dev->bus_list, &bus->devices); + list_add_tail(&dev->global_list, &pci_devices); + + printk(KERN_INFO PFX "%s at 0x%lx; pci dev %s\n", name, addr, + dev->slot_name); + + hpzx1_devices++; +} + +typedef struct { + u8 guid_id; + u8 guid[16]; + u8 csr_base[8]; + u8 csr_length[8]; +} acpi_hp_vendor_long; + +#define HP_CCSR_LENGTH 0x21 +#define HP_CCSR_TYPE 0x2 +#define HP_CCSR_GUID EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, \ + 0xf6, 0x4a, 0x24, 0xd2, 0x01, 0x37, 0x0e, 0xad) + +extern acpi_status acpi_get_crs(acpi_handle, acpi_buffer *); +extern acpi_resource *acpi_get_crs_next(acpi_buffer *, int *); +extern acpi_resource_data *acpi_get_crs_type(acpi_buffer *, int *, int); +extern void acpi_dispose_crs(acpi_buffer *); + +static acpi_status +hp_csr_space(acpi_handle obj, u64 *csr_base, u64 *csr_length) +{ + int i, offset = 0; + acpi_status status; + acpi_buffer buf; + acpi_resource_vendor *res; + acpi_hp_vendor_long *hp_res; + efi_guid_t vendor_guid; + + *csr_base = 0; + *csr_length = 0; + + status = acpi_get_crs(obj, &buf); + if (ACPI_FAILURE(status)) { + printk(KERN_ERR PFX "Unable to get _CRS data on object\n"); + return status; + } + + res = (acpi_resource_vendor *)acpi_get_crs_type(&buf, &offset, ACPI_RSTYPE_VENDOR); + if (!res) { + printk(KERN_ERR PFX "Failed to find config space for device\n"); + acpi_dispose_crs(&buf); + return AE_NOT_FOUND; + } + + hp_res = (acpi_hp_vendor_long *)(res->reserved); + + if (res->length != HP_CCSR_LENGTH || hp_res->guid_id != HP_CCSR_TYPE) { + printk(KERN_ERR PFX "Unknown Vendor data\n"); + acpi_dispose_crs(&buf); + return AE_TYPE; /* Revisit error? */ + } + + memcpy(&vendor_guid, hp_res->guid, sizeof(efi_guid_t)); + if (efi_guidcmp(vendor_guid, HP_CCSR_GUID) != 0) { + printk(KERN_ERR PFX "Vendor GUID does not match\n"); + acpi_dispose_crs(&buf); + return AE_TYPE; /* Revisit error? */ + } + + for (i = 0 ; i < 8 ; i++) { + *csr_base |= ((u64)(hp_res->csr_base[i]) << (i * 8)); + *csr_length |= ((u64)(hp_res->csr_length[i]) << (i * 8)); + } + + acpi_dispose_crs(&buf); + + return AE_OK; +} + +static acpi_status +hpzx1_sba_probe(acpi_handle obj, u32 depth, void *context, void **ret) +{ + u64 csr_base = 0, csr_length = 0; + acpi_status status; + char *name = context; + char fullname[16]; + + status = hp_csr_space(obj, &csr_base, &csr_length); + if (ACPI_FAILURE(status)) + return status; + + /* + * Only SBA shows up in ACPI namespace, so its CSR space + * includes both SBA and IOC. Make SBA and IOC show up + * separately in PCI space. + */ + sprintf(fullname, "%s SBA", name); + hpzx1_fake_pci_dev(fullname, 0, csr_base, 0x1000); + sprintf(fullname, "%s IOC", name); + hpzx1_fake_pci_dev(fullname, 0, csr_base + 0x1000, 0x1000); + + return AE_OK; +} + +static acpi_status +hpzx1_lba_probe(acpi_handle obj, u32 depth, void *context, void **ret) +{ + u64 csr_base = 0, csr_length = 0; + acpi_status status; + NATIVE_UINT busnum; + char *name = context; + char fullname[32]; + + status = hp_csr_space(obj, &csr_base, &csr_length); + if (ACPI_FAILURE(status)) + return status; + + status = acpi_evaluate_integer(obj, METHOD_NAME__BBN, NULL, &busnum); + if (ACPI_FAILURE(status)) { + printk(KERN_WARNING PFX "evaluate _BBN fail=0x%x\n", status); + busnum = 0; // no _BBN; stick it on bus 0 + } + + sprintf(fullname, "%s _BBN 0x%02x", name, (unsigned int) busnum); + hpzx1_fake_pci_dev(fullname, busnum, csr_base, csr_length); + + return AE_OK; +} + +static void +hpzx1_acpi_dev_init(void) +{ + extern struct pci_ops *pci_root_ops; + + orig_pci_ops = pci_root_ops; + + /* + * Make fake PCI devices for the following hardware in the + * ACPI namespace. This makes it more convenient for drivers + * because they can claim these devices based on PCI + * information, rather than needing to know about ACPI. The + * 64-bit "HPA" space for this hardware is available as BAR + * 0/1. + * + * HWP0001: Single IOC SBA w/o IOC in namespace + * HWP0002: LBA device + * HWP0003: AGP LBA device + */ + acpi_get_devices("HWP0001", hpzx1_sba_probe, "HWP0001", NULL); +#ifdef CONFIG_IA64_HP_PROTO + if (hpzx1_devices) { +#endif + acpi_get_devices("HWP0002", hpzx1_lba_probe, "HWP0002 PCI LBA", NULL); + acpi_get_devices("HWP0003", hpzx1_lba_probe, "HWP0003 AGP LBA", NULL); + +#ifdef CONFIG_IA64_HP_PROTO + } + +#define ZX1_FUNC_ID_VALUE (PCI_DEVICE_ID_HP_ZX1_SBA << 16) | PCI_VENDOR_ID_HP + /* + * Early protos don't have bridges in the ACPI namespace, so + * if we didn't find anything, add the things we know are + * there. + */ + if (hpzx1_devices == 0) { + u64 hpa, csr_base; + + csr_base = 0xfed00000UL; + hpa = (u64) ioremap(csr_base, 0x2000); + if (__raw_readl(hpa) == ZX1_FUNC_ID_VALUE) { + hpzx1_fake_pci_dev("HWP0001 SBA", 0, csr_base, 0x1000); + hpzx1_fake_pci_dev("HWP0001 IOC", 0, csr_base + 0x1000, + 0x1000); + + csr_base = 0xfed24000UL; + iounmap(hpa); + hpa = (u64) ioremap(csr_base, 0x1000); + hpzx1_fake_pci_dev("HWP0003 AGP LBA", 0x40, csr_base, + 0x1000); + } + iounmap(hpa); + } +#endif +} + +extern void sba_init(void); + +void +hpzx1_pci_fixup (int phase) +{ + iosapic_pci_fixup(phase); + switch (phase) { + case 0: + /* zx1 has a hardware I/O TLB which lets us DMA from any device to any address */ + MAX_DMA_ADDRESS = ~0UL; + break; + + case 1: + hpzx1_acpi_dev_init(); + sba_init(); + break; + } +} diff -urN linux-2.4.18/arch/ia64/ia32/binfmt_elf32.c lia64-2.4/arch/ia64/ia32/binfmt_elf32.c --- linux-2.4.18/arch/ia64/ia32/binfmt_elf32.c Mon Nov 26 11:18:19 2001 +++ lia64-2.4/arch/ia64/ia32/binfmt_elf32.c Fri Apr 12 11:36:49 2002 @@ -47,6 +47,8 @@ #define ELF_PLAT_INIT(_r) ia64_elf32_init(_r) #define setup_arg_pages(bprm) ia32_setup_arg_pages(bprm) #define elf_map elf32_map + +#undef SET_PERSONALITY #define SET_PERSONALITY(ex, ibcs2) elf32_set_personality() /* Ugly but avoids duplication */ @@ -142,10 +144,11 @@ /* * Setup GDTD. Note: GDTD is the descrambled version of the pseudo-descriptor * format defined by Figure 3-11 "Pseudo-Descriptor Format" in the IA-32 - * architecture manual. + * architecture manual. Also note that the only fields that are not ignored are + * `base', `limit', 'G', `P' (must be 1) and `S' (must be 0). */ - regs->r31 = IA32_SEG_UNSCRAMBLE(IA32_SEG_DESCRIPTOR(IA32_GDT_OFFSET, IA32_PAGE_SIZE - 1, 0, - 0, 0, 0, 0, 0, 0)); + regs->r31 = IA32_SEG_UNSCRAMBLE(IA32_SEG_DESCRIPTOR(IA32_GDT_OFFSET, IA32_PAGE_SIZE - 1, + 0, 0, 0, 1, 0, 0, 0)); /* Setup the segment selectors */ regs->r16 = (__USER_DS << 16) | __USER_DS; /* ES == DS, GS, FS are zero */ regs->r17 = (__USER_DS << 16) | __USER_CS; /* SS, CS; ia32_load_state() sets TSS and LDT */ @@ -206,6 +209,7 @@ set_personality(PER_LINUX32); current->thread.map_base = IA32_PAGE_OFFSET/3; current->thread.task_size = IA32_PAGE_OFFSET; /* use what Linux/x86 uses... */ + current->thread.flags |= IA64_THREAD_XSTACK; /* data must be executable */ set_fs(USER_DS); /* set addr limit for new TASK_SIZE */ } diff -urN linux-2.4.18/arch/ia64/ia32/ia32_entry.S lia64-2.4/arch/ia64/ia32/ia32_entry.S --- linux-2.4.18/arch/ia64/ia32/ia32_entry.S Mon Nov 26 11:18:19 2001 +++ lia64-2.4/arch/ia64/ia32/ia32_entry.S Sat Feb 9 10:41:41 2002 @@ -37,7 +37,7 @@ mov loc1=r16 // save ar.pfs across do_fork .body zxt4 out1=in1 // newsp - mov out3=0 // stacksize + mov out3=16 // stacksize (compensates for 16-byte scratch area) adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = ®s zxt4 out0=in0 // out0 = clone_flags br.call.sptk.many rp=do_fork @@ -220,7 +220,7 @@ data8 sys32_pipe data8 sys32_times data8 sys32_ni_syscall /* old prof syscall holder */ - data8 sys_brk /* 45 */ + data8 sys32_brk /* 45 */ data8 sys_setgid /* 16-bit version */ data8 sys_getgid /* 16-bit version */ data8 sys32_signal diff -urN linux-2.4.18/arch/ia64/ia32/ia32_ioctl.c lia64-2.4/arch/ia64/ia32/ia32_ioctl.c --- linux-2.4.18/arch/ia64/ia32/ia32_ioctl.c Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/ia32/ia32_ioctl.c Thu Feb 21 11:49:45 2002 @@ -79,6 +79,38 @@ return ret; } + case IOCTL_NR(SIOCGIFCONF): + { + struct ifconf32 { + int ifc_len; + unsigned int ifc_ptr; + } ifconf32; + struct ifconf ifconf; + int i, n; + char *p32, *p64; + char buf[32]; /* sizeof IA32 ifreq structure */ + + if (copy_from_user(&ifconf32, P(arg), sizeof(ifconf32))) + return -EFAULT; + ifconf.ifc_len = ifconf32.ifc_len; + ifconf.ifc_req = P(ifconf32.ifc_ptr); + ret = DO_IOCTL(fd, SIOCGIFCONF, &ifconf); + ifconf32.ifc_len = ifconf.ifc_len; + if (copy_to_user(P(arg), &ifconf32, sizeof(ifconf32))) + return -EFAULT; + n = ifconf.ifc_len / sizeof(struct ifreq); + p32 = P(ifconf32.ifc_ptr); + p64 = P(ifconf32.ifc_ptr); + for (i = 0; i < n; i++) { + if (copy_from_user(buf, p64, sizeof(struct ifreq))) + return -EFAULT; + if (copy_to_user(p32, buf, sizeof(buf))) + return -EFAULT; + p32 += sizeof(buf); + p64 += sizeof(struct ifreq); + } + return ret; + } case IOCTL_NR(DRM_IOCTL_VERSION): { diff -urN linux-2.4.18/arch/ia64/ia32/ia32_signal.c lia64-2.4/arch/ia64/ia32/ia32_signal.c --- linux-2.4.18/arch/ia64/ia32/ia32_signal.c Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/ia32/ia32_signal.c Tue Feb 26 13:53:30 2002 @@ -522,6 +522,7 @@ static int setup_frame_ia32 (int sig, struct k_sigaction *ka, sigset_t *set, struct pt_regs * regs) { + struct exec_domain *ed = current->exec_domain; struct sigframe_ia32 *frame; int err = 0; @@ -530,12 +531,8 @@ if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) goto give_sigsegv; - err |= __put_user((current->exec_domain - && current->exec_domain->signal_invmap - && sig < 32 - ? (int)(current->exec_domain->signal_invmap[sig]) - : sig), - &frame->sig); + err |= __put_user((ed && ed->signal_invmap + && sig < 32 ? (int)(ed->signal_invmap[sig]) : sig), &frame->sig); err |= setup_sigcontext_ia32(&frame->sc, &frame->fpstate, regs, set->sig[0]); @@ -590,6 +587,7 @@ setup_rt_frame_ia32 (int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set, struct pt_regs * regs) { + struct exec_domain *ed = current->exec_domain; struct rt_sigframe_ia32 *frame; int err = 0; @@ -598,11 +596,8 @@ if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) goto give_sigsegv; - err |= __put_user((current->exec_domain - && current->exec_domain->signal_invmap - && sig < 32 - ? current->exec_domain->signal_invmap[sig] - : sig), + err |= __put_user((ed && ed->signal_invmap + && sig < 32 ? ed->signal_invmap[sig] : sig), &frame->sig); err |= __put_user((long)&frame->info, &frame->pinfo); err |= __put_user((long)&frame->uc, &frame->puc); diff -urN linux-2.4.18/arch/ia64/ia32/ia32_support.c lia64-2.4/arch/ia64/ia32/ia32_support.c --- linux-2.4.18/arch/ia64/ia32/ia32_support.c Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/ia32/ia32_support.c Fri Feb 22 17:07:58 2002 @@ -3,7 +3,7 @@ * * Copyright (C) 1999 Arun Sharma * Copyright (C) 2000 Asit K. Mallick - * Copyright (C) 2001 Hewlett-Packard Co + * Copyright (C) 2001-2002 Hewlett-Packard Co * David Mosberger-Tang * * 06/16/00 A. Mallick added csd/ssd/tssd for ia32 thread context @@ -153,10 +153,12 @@ /* We never change the TSS and LDT descriptors, so we can share them across all CPUs. */ ldt_size = PAGE_ALIGN(IA32_LDT_ENTRIES*IA32_LDT_ENTRY_SIZE); for (nr = 0; nr < NR_CPUS; ++nr) { - ia32_gdt[_TSS(nr)] = IA32_SEG_DESCRIPTOR(IA32_TSS_OFFSET, 235, - 0xb, 0, 3, 1, 1, 1, 0); - ia32_gdt[_LDT(nr)] = IA32_SEG_DESCRIPTOR(IA32_LDT_OFFSET, ldt_size - 1, - 0x2, 0, 3, 1, 1, 1, 0); + ia32_gdt[_TSS(nr) >> IA32_SEGSEL_INDEX_SHIFT] + = IA32_SEG_DESCRIPTOR(IA32_TSS_OFFSET, 235, + 0xb, 0, 3, 1, 1, 1, 0); + ia32_gdt[_LDT(nr) >> IA32_SEGSEL_INDEX_SHIFT] + = IA32_SEG_DESCRIPTOR(IA32_LDT_OFFSET, ldt_size - 1, + 0x2, 0, 3, 1, 1, 1, 0); } } @@ -172,6 +174,10 @@ siginfo.si_signo = SIGTRAP; siginfo.si_errno = int_num; /* XXX is it OK to abuse si_errno like this? */ + siginfo.si_flags = 0; + siginfo.si_isr = 0; + siginfo.si_addr = 0; + siginfo.si_imm = 0; siginfo.si_code = TRAP_BRKPT; force_sig_info(SIGTRAP, &siginfo, current); } diff -urN linux-2.4.18/arch/ia64/ia32/ia32_traps.c lia64-2.4/arch/ia64/ia32/ia32_traps.c --- linux-2.4.18/arch/ia64/ia32/ia32_traps.c Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/ia32/ia32_traps.c Fri Mar 15 12:03:00 2002 @@ -2,7 +2,7 @@ * IA-32 exception handlers * * Copyright (C) 2000 Asit K. Mallick - * Copyright (C) 2001 Hewlett-Packard Co + * Copyright (C) 2001-2002 Hewlett-Packard Co * David Mosberger-Tang * * 06/16/00 A. Mallick added siginfo for most cases (close to IA32) @@ -20,7 +20,7 @@ { switch ((isr >> 16) & 0xff) { case 0: /* Instruction intercept fault */ - case 3: /* Locked Data reference fault */ + case 4: /* Locked Data reference fault */ case 1: /* Gate intercept trap */ return -1; @@ -40,7 +40,11 @@ { struct siginfo siginfo; + /* initialize these fields to avoid leaking kernel bits to user space: */ siginfo.si_errno = 0; + siginfo.si_flags = 0; + siginfo.si_isr = 0; + siginfo.si_imm = 0; switch ((isr >> 16) & 0xff) { case 1: case 2: @@ -103,6 +107,8 @@ * and it will suffer the consequences since we won't be able to * fully reproduce the context of the exception */ + siginfo.si_isr = isr; + siginfo.si_flags = __ISR_VALID; switch(((~fcr) & (fsr & 0x3f)) | (fsr & 0x240)) { case 0x000: default: diff -urN linux-2.4.18/arch/ia64/ia32/sys_ia32.c lia64-2.4/arch/ia64/ia32/sys_ia32.c --- linux-2.4.18/arch/ia64/ia32/sys_ia32.c Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/ia32/sys_ia32.c Tue Feb 26 14:35:20 2002 @@ -6,7 +6,7 @@ * Copyright (C) 1999 Arun Sharma * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) - * Copyright (C) 2000-2001 Hewlett-Packard Co + * Copyright (C) 2000-2002 Hewlett-Packard Co * David Mosberger-Tang * * These routines maintain argument size conversion between 32bit and 64bit @@ -82,6 +82,7 @@ /* forward declaration: */ asmlinkage long sys32_mprotect (unsigned int, unsigned int, int); +asmlinkage unsigned long sys_brk(unsigned long); /* * Anything that modifies or inspects ia32 user virtual memory must hold this semaphore @@ -412,7 +413,7 @@ return -EINVAL; } if (!(prot & PROT_WRITE) && sys_mprotect(pstart, pend - pstart, prot) < 0) - return EINVAL; + return -EINVAL; } return start; } @@ -2590,6 +2591,7 @@ default: return -EINVAL; } + return -EINVAL; } /* @@ -3807,6 +3809,19 @@ ret = sys_personality(personality); if (ret == PER_LINUX32) ret = PER_LINUX; + return ret; +} + +asmlinkage unsigned long +sys32_brk (unsigned int brk) +{ + unsigned long ret, obrk; + struct mm_struct *mm = current->mm; + + obrk = mm->brk; + ret = sys_brk(brk); + if (ret < obrk) + clear_user((void *) ret, PAGE_ALIGN(ret) - ret); return ret; } diff -urN linux-2.4.18/arch/ia64/kernel/Makefile lia64-2.4/arch/ia64/kernel/Makefile --- linux-2.4.18/arch/ia64/kernel/Makefile Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/kernel/Makefile Fri Apr 5 16:44:44 2002 @@ -14,9 +14,10 @@ export-objs := ia64_ksyms.o obj-y := acpi.o entry.o gate.o efi.o efi_stub.o ia64_ksyms.o irq.o irq_ia64.o irq_lsapic.o ivt.o \ - machvec.o pal.o process.o perfmon.o ptrace.o sal.o semaphore.o setup.o \ + machvec.o pal.o process.o perfmon.o ptrace.o sal.o salinfo.o semaphore.o setup.o \ signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o obj-$(CONFIG_IA64_GENERIC) += iosapic.o +obj-$(CONFIG_IA64_HP_ZX1) += iosapic.o obj-$(CONFIG_IA64_DIG) += iosapic.o obj-$(CONFIG_IA64_PALINFO) += palinfo.o obj-$(CONFIG_EFI_VARS) += efivars.o diff -urN linux-2.4.18/arch/ia64/kernel/acpi.c lia64-2.4/arch/ia64/kernel/acpi.c --- linux-2.4.18/arch/ia64/kernel/acpi.c Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/kernel/acpi.c Mon Jul 15 16:35:26 2002 @@ -1,21 +1,34 @@ /* - * Advanced Configuration and Power Interface + * acpi.c - Architecture-Specific Low-Level ACPI Support * - * Based on 'ACPI Specification 1.0b' February 2, 1999 and - * 'IA-64 Extensions to ACPI Specification' Revision 0.6 + * Copyright (C) 1999 VA Linux Systems + * Copyright (C) 1999,2000 Walt Drummond + * Copyright (C) 2000, 2002 Hewlett-Packard Co. + * David Mosberger-Tang + * Copyright (C) 2000 Intel Corp. + * Copyright (C) 2000,2001 J.I. Lee + * Copyright (C) 2001 Paul Diefenbaugh * - * Copyright (C) 1999 VA Linux Systems - * Copyright (C) 1999,2000 Walt Drummond - * Copyright (C) 2000 Hewlett-Packard Co. - * Copyright (C) 2000 David Mosberger-Tang - * Copyright (C) 2000 Intel Corp. - * Copyright (C) 2000,2001 J.I. Lee - * ACPI based kernel configuration manager. - * ACPI 2.0 & IA64 ext 0.71 + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include - #include #include #include @@ -23,29 +36,16 @@ #include #include #include -#ifdef CONFIG_SERIAL_ACPI -#include -#endif - -#include -#include +#include #include #include #include #include #include +#include -#undef ACPI_DEBUG /* Guess what this does? */ - -/* global array to record platform interrupt vectors for generic int routing */ -int platform_irq_list[ACPI_MAX_PLATFORM_IRQS]; - -/* These are ugly but will be reclaimed by the kernel */ -int __initdata available_cpus; -int __initdata total_cpus; -void (*pm_idle) (void); -void (*pm_power_off) (void); +#define PREFIX "ACPI: " asm (".weak iosapic_register_irq"); asm (".weak iosapic_register_legacy_irq"); @@ -53,35 +53,139 @@ asm (".weak iosapic_init"); asm (".weak iosapic_version"); +void (*pm_idle) (void); +void (*pm_power_off) (void); + const char * acpi_get_sysname (void) { - /* the following should go away once we have an ACPI parser: */ #ifdef CONFIG_IA64_GENERIC - return "hpsim"; + unsigned long rsdp_phys; + struct acpi20_table_rsdp *rsdp; + struct acpi_table_xsdt *xsdt; + struct acpi_table_header *hdr; + + rsdp_phys = acpi_find_rsdp(); + if (!rsdp_phys) { + printk("ACPI 2.0 RSDP not found, default to \"dig\"\n"); + return "dig"; + } + + rsdp = (struct acpi20_table_rsdp *) __va(rsdp_phys); + if (strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1)) { + printk("ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n"); + return "dig"; + } + + xsdt = (struct acpi_table_xsdt *) __va(rsdp->xsdt_address); + hdr = &xsdt->header; + if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1)) { + printk("ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n"); + return "dig"; + } + + if (!strcmp(hdr->oem_id, "HP")) { + return "hpzx1"; + } + + return "dig"; #else # if defined (CONFIG_IA64_HP_SIM) return "hpsim"; +# elif defined (CONFIG_IA64_HP_ZX1) + return "hpzx1"; # elif defined (CONFIG_IA64_SGI_SN1) return "sn1"; # elif defined (CONFIG_IA64_SGI_SN2) return "sn2"; # elif defined (CONFIG_IA64_DIG) return "dig"; +# elif defined (CONFIG_IA64_HP_ZX1) + return "hpzx1"; # else # error Unknown platform. Fix acpi.c. # endif #endif +} + +#ifdef CONFIG_ACPI +/** + * acpi_get_crs - Return the current resource settings for a device + * obj: A handle for this device + * buf: A buffer to be populated by this call. + * + * Pass a valid handle, typically obtained by walking the namespace and a + * pointer to an allocated buffer, and this function will fill in the buffer + * with a list of acpi_resource structures. + */ +acpi_status +acpi_get_crs (acpi_handle obj, acpi_buffer *buf) +{ + acpi_status result; + buf->length = 0; + buf->pointer = NULL; + + result = acpi_get_current_resources(obj, buf); + if (result != AE_BUFFER_OVERFLOW) + return result; + buf->pointer = kmalloc(buf->length, GFP_KERNEL); + if (!buf->pointer) + return -ENOMEM; + + result = acpi_get_current_resources(obj, buf); + + return result; +} + +acpi_resource * +acpi_get_crs_next (acpi_buffer *buf, int *offset) +{ + acpi_resource *res; + + if (*offset >= buf->length) + return NULL; + + res = buf->pointer + *offset; + *offset += res->length; + return res; +} + +acpi_resource_data * +acpi_get_crs_type (acpi_buffer *buf, int *offset, int type) +{ + for (;;) { + acpi_resource *res = acpi_get_crs_next(buf, offset); + if (!res) + return NULL; + if (res->id == type) + return &res->data; + } +} + +void +acpi_dispose_crs (acpi_buffer *buf) +{ + kfree(buf->pointer); } +#endif /* CONFIG_ACPI */ + +#ifdef CONFIG_ACPI_BOOT + +#define ACPI_MAX_PLATFORM_IRQS 256 + +/* Array to record platform interrupt vectors for generic interrupt routing. */ +int platform_irq_list[ACPI_MAX_PLATFORM_IRQS]; + +enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_IOSAPIC; + /* - * Interrupt routing API for device drivers. - * Provides the interrupt vector for a generic platform event - * (currently only CPEI implemented) + * Interrupt routing API for device drivers. Provides interrupt vector for + * a generic platform event. Currently only CPEI is implemented. */ int -acpi_request_vector(u32 int_type) +acpi_request_vector (u32 int_type) { int vector = -1; @@ -94,586 +198,499 @@ return vector; } -/* - * Configure legacy IRQ information. - */ -static void __init -acpi_legacy_irq (char *p) +char * +__acpi_map_table ( + unsigned long phys_addr, + unsigned long size) { - acpi_entry_int_override_t *legacy = (acpi_entry_int_override_t *) p; - unsigned long polarity = 0, edge_triggered = 0; + return __va(phys_addr); +} - /* - * If the platform we're running doesn't define - * iosapic_register_legacy_irq(), we ignore this info... - */ - if (!iosapic_register_legacy_irq) - return; +/* -------------------------------------------------------------------------- + Boot-time Table Parsing + -------------------------------------------------------------------------- */ - switch (legacy->flags) { - case 0x5: polarity = 1; edge_triggered = 1; break; - case 0x7: polarity = 0; edge_triggered = 1; break; - case 0xd: polarity = 1; edge_triggered = 0; break; - case 0xf: polarity = 0; edge_triggered = 0; break; - default: - printk(" ACPI Legacy IRQ 0x%02x: Unknown flags 0x%x\n", legacy->isa_irq, - legacy->flags); - break; - } - iosapic_register_legacy_irq(legacy->isa_irq, legacy->pin, polarity, edge_triggered); -} +static int total_cpus __initdata; +static int available_cpus __initdata; +struct acpi_table_madt * acpi_madt __initdata; -/* - * ACPI 2.0 tables parsing functions - */ -static unsigned long -readl_unaligned(void *p) +static int __init +acpi_parse_lapic_addr_ovr (acpi_table_entry_header *header) { - unsigned long ret; + struct acpi_table_lapic_addr_ovr *lapic = NULL; + + lapic = (struct acpi_table_lapic_addr_ovr *) header; + if (!lapic) + return -EINVAL; + + acpi_table_print_madt_entry(header); + + if (lapic->address) { + iounmap((void *) ipi_base_addr); + ipi_base_addr = (unsigned long) ioremap(lapic->address, 0); + } - memcpy(&ret, p, sizeof(long)); - return ret; + return 0; } -/* - * Identify usable CPU's and remember them for SMP bringup later. - */ -static void __init -acpi20_lsapic (char *p) + +static int __init +acpi_parse_lsapic (acpi_table_entry_header *header) { - int add = 1; + struct acpi_table_lsapic *lsapic = NULL; - acpi20_entry_lsapic_t *lsapic = (acpi20_entry_lsapic_t *) p; - printk(" CPU %.04x:%.04x: ", lsapic->eid, lsapic->id); + lsapic = (struct acpi_table_lsapic *) header; + if (!lsapic) + return -EINVAL; - if ((lsapic->flags & LSAPIC_ENABLED) == 0) { - printk("disabled.\n"); - add = 0; - } + acpi_table_print_madt_entry(header); -#ifdef CONFIG_SMP - smp_boot_data.cpu_phys_id[total_cpus] = -1; -#endif - if (add) { + printk("CPU %d (0x%04x)", total_cpus, (lsapic->id << 8) | lsapic->eid); + + if (lsapic->flags.enabled) { available_cpus++; - printk("available"); + printk(" enabled"); #ifdef CONFIG_SMP smp_boot_data.cpu_phys_id[total_cpus] = (lsapic->id << 8) | lsapic->eid; if (hard_smp_processor_id() == smp_boot_data.cpu_phys_id[total_cpus]) printk(" (BSP)"); #endif - printk(".\n"); } + else { + printk(" disabled"); +#ifdef CONFIG_SMP + smp_boot_data.cpu_phys_id[total_cpus] = -1; +#endif + } + + printk("\n"); + total_cpus++; + return 0; } -/* - * Extract iosapic info from madt (again) to determine which iosapic - * this platform interrupt resides in - */ + static int __init -acpi20_which_iosapic (int global_vector, acpi_madt_t *madt, u32 *irq_base, char **iosapic_address) +acpi_parse_lapic_nmi (acpi_table_entry_header *header) { - acpi_entry_iosapic_t *iosapic; - char *p, *end; - int ver, max_pin; + struct acpi_table_lapic_nmi *lacpi_nmi = NULL; - p = (char *) (madt + 1); - end = p + (madt->header.length - sizeof(acpi_madt_t)); + lacpi_nmi = (struct acpi_table_lapic_nmi*) header; + if (!lacpi_nmi) + return -EINVAL; + + acpi_table_print_madt_entry(header); + + /* TBD: Support lapic_nmi entries */ + + return 0; +} + + +static int __init +acpi_find_iosapic (int global_vector, u32 *irq_base, char **iosapic_address) +{ + struct acpi_table_iosapic *iosapic = NULL; + int ver = 0; + int max_pin = 0; + char *p = 0; + char *end = 0; + + if (!irq_base || !iosapic_address) + return -ENODEV; + + p = (char *) (acpi_madt + 1); + end = p + (acpi_madt->header.length - sizeof(struct acpi_table_madt)); while (p < end) { - switch (*p) { - case ACPI20_ENTRY_IO_SAPIC: - /* collect IOSAPIC info for platform int use later */ - iosapic = (acpi_entry_iosapic_t *)p; - *irq_base = iosapic->irq_base; + if (*p == ACPI_MADT_IOSAPIC) { + iosapic = (struct acpi_table_iosapic *) p; + + *irq_base = iosapic->global_irq_base; *iosapic_address = ioremap(iosapic->address, 0); - /* is this the iosapic we're looking for? */ + ver = iosapic_version(*iosapic_address); max_pin = (ver >> 16) & 0xff; + if ((global_vector - *irq_base) <= max_pin) - return 0; /* found it! */ - break; - default: - break; + return 0; /* Found it! */ } p += p[1]; } - return 1; + return -ENODEV; } -/* - * Info on platform interrupt sources: NMI, PMI, INIT, etc. - */ -static void __init -acpi20_platform (char *p, acpi_madt_t *madt) + +static int __init +acpi_parse_iosapic (acpi_table_entry_header *header) { - int vector; - u32 irq_base; - char *iosapic_address; - unsigned long polarity = 0, trigger = 0; - acpi20_entry_platform_src_t *plat = (acpi20_entry_platform_src_t *) p; + struct acpi_table_iosapic *iosapic; + + iosapic = (struct acpi_table_iosapic *) header; + if (!iosapic) + return -EINVAL; + + acpi_table_print_madt_entry(header); + + if (iosapic_init) { +#ifndef CONFIG_ITANIUM + /* PCAT_COMPAT flag indicates dual-8259 setup */ + iosapic_init(iosapic->address, iosapic->global_irq_base, + acpi_madt->flags.pcat_compat); +#else + /* Firmware on old Itanium systems is broken */ + iosapic_init(iosapic->address, iosapic->global_irq_base, 1); +#endif + } + return 0; +} - printk("PLATFORM: IOSAPIC %x -> Vector %x on CPU %.04u:%.04u\n", - plat->iosapic_vector, plat->global_vector, plat->eid, plat->id); - /* record platform interrupt vectors for generic int routing code */ +static int __init +acpi_parse_plat_int_src (acpi_table_entry_header *header) +{ + struct acpi_table_plat_int_src *plintsrc = NULL; + int vector = 0; + u32 irq_base = 0; + char *iosapic_address = NULL; + + plintsrc = (struct acpi_table_plat_int_src *) header; + if (!plintsrc) + return -EINVAL; + + acpi_table_print_madt_entry(header); if (!iosapic_register_platform_irq) { - printk("acpi20_platform(): no ACPI platform IRQ support\n"); - return; + printk(KERN_WARNING PREFIX "No ACPI platform IRQ support\n"); + return -ENODEV; } - /* extract polarity and trigger info from flags */ - switch (plat->flags) { - case 0x5: polarity = 1; trigger = 1; break; - case 0x7: polarity = 0; trigger = 1; break; - case 0xd: polarity = 1; trigger = 0; break; - case 0xf: polarity = 0; trigger = 0; break; - default: - printk("acpi20_platform(): unknown flags 0x%x\n", plat->flags); - break; - } - - /* which iosapic does this IRQ belong to? */ - if (acpi20_which_iosapic(plat->global_vector, madt, &irq_base, &iosapic_address)) { - printk("acpi20_platform(): I/O SAPIC not found!\n"); - return; + if (0 != acpi_find_iosapic(plintsrc->global_irq, &irq_base, &iosapic_address)) { + printk(KERN_WARNING PREFIX "IOSAPIC not found\n"); + return -ENODEV; } /* - * get vector assignment for this IRQ, set attributes, and program the IOSAPIC - * routing table + * Get vector assignment for this IRQ, set attributes, and program the + * IOSAPIC routing table. */ - vector = iosapic_register_platform_irq(plat->int_type, - plat->global_vector, - plat->iosapic_vector, - plat->eid, - plat->id, - polarity, - trigger, - irq_base, - iosapic_address); - platform_irq_list[plat->int_type] = vector; + vector = iosapic_register_platform_irq (plintsrc->type, + plintsrc->global_irq, + plintsrc->iosapic_vector, + plintsrc->eid, + plintsrc->id, + (plintsrc->flags.polarity == 1) ? 1 : 0, + (plintsrc->flags.trigger == 1) ? 1 : 0, + irq_base, + iosapic_address); + + platform_irq_list[plintsrc->type] = vector; + return 0; } -/* - * Override the physical address of the local APIC in the MADT stable header. - */ -static void __init -acpi20_lapic_addr_override (char *p) + +static int __init +acpi_parse_int_src_ovr (acpi_table_entry_header *header) { - acpi20_entry_lapic_addr_override_t * lapic = (acpi20_entry_lapic_addr_override_t *) p; + struct acpi_table_int_src_ovr *p = NULL; - if (lapic->lapic_address) { - iounmap((void *)ipi_base_addr); - ipi_base_addr = (unsigned long) ioremap(lapic->lapic_address, 0); + p = (struct acpi_table_int_src_ovr *) header; + if (!p) + return -EINVAL; - printk("LOCAL ACPI override to 0x%lx(p=0x%lx)\n", - ipi_base_addr, lapic->lapic_address); - } + acpi_table_print_madt_entry(header); + + /* Ignore if the platform doesn't support overrides */ + if (!iosapic_register_legacy_irq) + return 0; + + iosapic_register_legacy_irq(p->bus_irq, p->global_irq, + (p->flags.polarity == 1) ? 1 : 0, + (p->flags.trigger == 1) ? 1 : 0); + + return 0; } -/* - * Parse the ACPI Multiple APIC Description Table - */ -static void __init -acpi20_parse_madt (acpi_madt_t *madt) + +static int __init +acpi_parse_nmi_src (acpi_table_entry_header *header) { - acpi_entry_iosapic_t *iosapic = NULL; - acpi20_entry_lsapic_t *lsapic = NULL; - char *p, *end; - int i; - - /* Base address of IPI Message Block */ - if (madt->lapic_address) { - ipi_base_addr = (unsigned long) ioremap(madt->lapic_address, 0); - printk("Lapic address set to 0x%lx\n", ipi_base_addr); - } else - printk("Lapic address set to default 0x%lx\n", ipi_base_addr); + struct acpi_table_nmi_src *nmi_src = NULL; - p = (char *) (madt + 1); - end = p + (madt->header.length - sizeof(acpi_madt_t)); + nmi_src = (struct acpi_table_nmi_src*) header; + if (!nmi_src) + return -EINVAL; - /* Initialize platform interrupt vector array */ - for (i = 0; i < ACPI_MAX_PLATFORM_IRQS; i++) - platform_irq_list[i] = -1; + acpi_table_print_madt_entry(header); - /* - * Split-up entry parsing to ensure ordering. - */ - while (p < end) { - switch (*p) { - case ACPI20_ENTRY_LOCAL_APIC_ADDR_OVERRIDE: - printk("ACPI 2.0 MADT: LOCAL APIC Override\n"); - acpi20_lapic_addr_override(p); - break; - - case ACPI20_ENTRY_LOCAL_SAPIC: - printk("ACPI 2.0 MADT: LOCAL SAPIC\n"); - lsapic = (acpi20_entry_lsapic_t *) p; - acpi20_lsapic(p); - break; - - case ACPI20_ENTRY_IO_SAPIC: - iosapic = (acpi_entry_iosapic_t *) p; - if (iosapic_init) - /* - * The PCAT_COMPAT flag indicates that the system has a - * dual-8259 compatible setup. - */ - iosapic_init(iosapic->address, iosapic->irq_base, -#ifdef CONFIG_ITANIUM - 1 /* fw on some Itanium systems is broken... */ -#else - (madt->flags & MADT_PCAT_COMPAT) -#endif - ); - break; + /* TBD: Support nimsrc entries */ - case ACPI20_ENTRY_PLATFORM_INT_SOURCE: - printk("ACPI 2.0 MADT: PLATFORM INT SOURCE\n"); - acpi20_platform(p, madt); - break; - - case ACPI20_ENTRY_LOCAL_APIC: - printk("ACPI 2.0 MADT: LOCAL APIC entry\n"); break; - case ACPI20_ENTRY_IO_APIC: - printk("ACPI 2.0 MADT: IO APIC entry\n"); break; - case ACPI20_ENTRY_NMI_SOURCE: - printk("ACPI 2.0 MADT: NMI SOURCE entry\n"); break; - case ACPI20_ENTRY_LOCAL_APIC_NMI: - printk("ACPI 2.0 MADT: LOCAL APIC NMI entry\n"); break; - case ACPI20_ENTRY_INT_SRC_OVERRIDE: - break; - default: - printk("ACPI 2.0 MADT: unknown entry skip\n"); break; - break; - } - p += p[1]; - } + return 0; +} - p = (char *) (madt + 1); - end = p + (madt->header.length - sizeof(acpi_madt_t)); - while (p < end) { - switch (*p) { - case ACPI20_ENTRY_LOCAL_APIC: - if (lsapic) break; - printk("ACPI 2.0 MADT: LOCAL APIC entry\n"); - /* parse local apic if there's no local Sapic */ - break; - case ACPI20_ENTRY_IO_APIC: - if (iosapic) break; - printk("ACPI 2.0 MADT: IO APIC entry\n"); - /* parse ioapic if there's no ioSapic */ - break; - default: - break; - } - p += p[1]; - } +static int __init +acpi_parse_madt (unsigned long phys_addr, unsigned long size) +{ + int i = 0; - p = (char *) (madt + 1); - end = p + (madt->header.length - sizeof(acpi_madt_t)); + if (!phys_addr || !size) + return -EINVAL; - while (p < end) { - switch (*p) { - case ACPI20_ENTRY_INT_SRC_OVERRIDE: - printk("ACPI 2.0 MADT: INT SOURCE Override\n"); - acpi_legacy_irq(p); - break; - default: - break; - } - p += p[1]; + acpi_madt = (struct acpi_table_madt *) __va(phys_addr); + if (!acpi_madt) { + printk(KERN_WARNING PREFIX "Unable to map MADT\n"); + return -ENODEV; } - /* Make bootup pretty */ - printk(" %d CPUs available, %d CPUs total\n", - available_cpus, total_cpus); + /* Initialize platform interrupt vector array */ + + for (i = 0; i < ACPI_MAX_PLATFORM_IRQS; i++) + platform_irq_list[i] = -1; + + /* Get base address of IPI Message Block */ + + if (acpi_madt->lapic_address) + ipi_base_addr = (unsigned long) + ioremap(acpi_madt->lapic_address, 0); + + printk(KERN_INFO PREFIX "Local APIC address 0x%lx\n", ipi_base_addr); + + return 0; } -int __init -acpi20_parse (acpi20_rsdp_t *rsdp20) + +unsigned long __init +acpi_find_rsdp (void) { -# ifdef CONFIG_ACPI - acpi_xsdt_t *xsdt; - acpi_desc_table_hdr_t *hdrp; - acpi_madt_t *madt; - int tables, i; + unsigned long rsdp_phys = 0; - if (strncmp(rsdp20->signature, ACPI_RSDP_SIG, ACPI_RSDP_SIG_LEN)) { - printk("ACPI 2.0 RSDP signature incorrect!\n"); - return 0; - } else { - printk("ACPI 2.0 Root System Description Ptr at 0x%lx\n", - (unsigned long)rsdp20); + if (efi.acpi20) { + rsdp_phys = __pa(efi.acpi20); } - - xsdt = __va(rsdp20->xsdt); - hdrp = &xsdt->header; - if (strncmp(hdrp->signature, - ACPI_XSDT_SIG, ACPI_XSDT_SIG_LEN)) { - printk("ACPI 2.0 XSDT signature incorrect. Trying RSDT\n"); - /* RSDT parsing here */ - return 0; - } else { - printk("ACPI 2.0 XSDT at 0x%lx (p=0x%lx)\n", - (unsigned long)xsdt, (unsigned long)rsdp20->xsdt); + else if (efi.acpi) { + printk(KERN_WARNING PREFIX "v1.0/r0.71 tables no longer supported\n"); } - printk("ACPI 2.0: %.6s %.8s %d.%d\n", - hdrp->oem_id, - hdrp->oem_table_id, - hdrp->oem_revision >> 16, - hdrp->oem_revision & 0xffff); + return rsdp_phys; +} - acpi_cf_init((void *)rsdp20); - tables =(hdrp->length -sizeof(acpi_desc_table_hdr_t))>>3; +#ifdef CONFIG_SERIAL_ACPI - for (i = 0; i < tables; i++) { - hdrp = (acpi_desc_table_hdr_t *) __va(readl_unaligned(&xsdt->entry_ptrs[i])); - printk(" :table %4.4s found\n", hdrp->signature); +#include - /* Only interested int the MADT table for now ... */ - if (strncmp(hdrp->signature, - ACPI_MADT_SIG, ACPI_MADT_SIG_LEN) != 0) - continue; +static int __init +acpi_parse_spcr (unsigned long phys_addr, unsigned long size) +{ + acpi_ser_t *spcr = NULL; + unsigned long global_int = 0; - /* Save MADT pointer for later */ - madt = (acpi_madt_t *) hdrp; - acpi20_parse_madt(madt); - } + if (!phys_addr || !size) + return -EINVAL; + + if (!iosapic_register_irq) + return -ENODEV; -#ifdef CONFIG_SERIAL_ACPI /* - * Now we're interested in other tables. We want the iosapics already - * initialized, so we do it in a separate loop. + * ACPI is able to describe serial ports that live at non-standard + * memory addresses and use non-standard interrupts, either via + * direct SAPIC mappings or via PCI interrupts. We handle interrupt + * routing for SAPIC-based (non-PCI) devices here. Interrupt routing + * for PCI devices will be handled when processing the PCI Interrupt + * Routing Table (PRT). */ - for (i = 0; i < tables; i++) { - hdrp = (acpi_desc_table_hdr_t *) __va(readl_unaligned(&xsdt->entry_ptrs[i])); - /* - * search for SPCR and DBGP table entries so we can enable - * non-pci interrupts to IO-SAPICs. - */ - if (!strncmp(hdrp->signature, ACPI_SPCRT_SIG, ACPI_SPCRT_SIG_LEN) || - !strncmp(hdrp->signature, ACPI_DBGPT_SIG, ACPI_DBGPT_SIG_LEN)) - { - acpi_ser_t *spcr = (void *)hdrp; - unsigned long global_int; - - setup_serial_acpi(hdrp); - - /* - * ACPI is able to describe serial ports that live at non-standard - * memory space addresses and use SAPIC interrupts. If not also - * PCI devices, there would be no interrupt vector information for - * them. This checks for and fixes that situation. - */ - if (spcr->length < sizeof(acpi_ser_t)) - /* table is not long enough for full info, thus no int */ - break; - - /* - * If the device is not in PCI space, but uses a SAPIC interrupt, - * we need to program the SAPIC so that serial can autoprobe for - * the IA64 interrupt vector later on. If the device is in PCI - * space, it should already be setup via the PCI vectors - */ - if (spcr->base_addr.space_id != ACPI_SERIAL_PCICONF_SPACE && - spcr->int_type == ACPI_SERIAL_INT_SAPIC) - { - u32 irq_base; - char *iosapic_address; - int vector; - - /* We have a UART in memory space with a SAPIC interrupt */ - global_int = ( (spcr->global_int[3] << 24) - | (spcr->global_int[2] << 16) - | (spcr->global_int[1] << 8) - | spcr->global_int[0]); - - if (!iosapic_register_irq) - continue; - - /* which iosapic does this IRQ belong to? */ - if (acpi20_which_iosapic(global_int, madt, &irq_base, - &iosapic_address) == 0) - { - vector = iosapic_register_irq(global_int, - 1, /* active high polarity */ - 1, /* edge triggered */ - irq_base, - iosapic_address); - } - } - } + + spcr = (acpi_ser_t *) __va(phys_addr); + if (!spcr) { + printk(KERN_WARNING PREFIX "Unable to map SPCR\n"); + return -ENODEV; } -#endif - acpi_cf_terminate(); -# ifdef CONFIG_SMP - if (available_cpus == 0) { - printk("ACPI: Found 0 CPUS; assuming 1\n"); - available_cpus = 1; /* We've got at least one of these, no? */ + setup_serial_acpi(spcr); + + if (spcr->length < sizeof(acpi_ser_t)) + /* Table not long enough for full info, thus no interrupt */ + return -ENODEV; + + if ((spcr->base_addr.space_id != ACPI_SERIAL_PCICONF_SPACE) && + (spcr->int_type == ACPI_SERIAL_INT_SAPIC)) + { + u32 irq_base = 0; + char *iosapic_address = NULL; + int vector = 0; + + /* We have a UART in memory space with an SAPIC interrupt */ + + global_int = ( (spcr->global_int[3] << 24) | + (spcr->global_int[2] << 16) | + (spcr->global_int[1] << 8) | + (spcr->global_int[0]) ); + + /* Which iosapic does this IRQ belong to? */ + + if (0 == acpi_find_iosapic(global_int, &irq_base, &iosapic_address)) { + vector = iosapic_register_irq (global_int, 1, 1, + irq_base, iosapic_address); + } } - smp_boot_data.cpu_count = total_cpus; -# endif -# endif /* CONFIG_ACPI */ - return 1; + return 0; } -/* - * ACPI 1.0b with 0.71 IA64 extensions functions; should be removed once all - * platforms start supporting ACPI 2.0 - */ -/* - * Identify usable CPU's and remember them for SMP bringup later. - */ -static void __init -acpi_lsapic (char *p) +#endif /*CONFIG_SERIAL_ACPI*/ + + +int __init +acpi_boot_init (char *cmdline) { - int add = 1; + int result = 0; - acpi_entry_lsapic_t *lsapic = (acpi_entry_lsapic_t *) p; + /* Initialize the ACPI boot-time table parser */ + result = acpi_table_init(cmdline); + if (0 != result) + return result; - if ((lsapic->flags & LSAPIC_PRESENT) == 0) - return; + /* + * MADT + * ---- + * Parse the Multiple APIC Description Table (MADT), if exists. + * Note that this table provides platform SMP configuration + * information -- the successor to MPS tables. + */ - printk(" CPU %d (%.04x:%.04x): ", total_cpus, lsapic->eid, lsapic->id); + result = acpi_table_parse(ACPI_APIC, acpi_parse_madt); + if (1 > result) + return result; - if ((lsapic->flags & LSAPIC_ENABLED) == 0) { - printk("Disabled.\n"); - add = 0; - } else if (lsapic->flags & LSAPIC_PERFORMANCE_RESTRICTED) { - printk("Performance Restricted; ignoring.\n"); - add = 0; + /* Local APIC */ + + result = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr); + if (0 > result) { + printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n"); + return result; } -#ifdef CONFIG_SMP - smp_boot_data.cpu_phys_id[total_cpus] = -1; -#endif - if (add) { - printk("Available.\n"); - available_cpus++; -#ifdef CONFIG_SMP - smp_boot_data.cpu_phys_id[total_cpus] = (lsapic->id << 8) | lsapic->eid; -#endif /* CONFIG_SMP */ + result = acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic); + if (1 > result) { + printk(KERN_ERR PREFIX "Error parsing MADT - no LAPIC entries!\n"); + return -ENODEV; } - total_cpus++; -} -/* - * Info on platform interrupt sources: NMI. PMI, INIT, etc. - */ -static void __init -acpi_platform (char *p) -{ - acpi_entry_platform_src_t *plat = (acpi_entry_platform_src_t *) p; + result = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi); + if (0 > result) { + printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); + return result; + } - printk("PLATFORM: IOSAPIC %x -> Vector %x on CPU %.04u:%.04u\n", - plat->iosapic_vector, plat->global_vector, plat->eid, plat->id); -} + /* I/O APIC */ -/* - * Parse the ACPI Multiple SAPIC Table - */ -static void __init -acpi_parse_msapic (acpi_sapic_t *msapic) -{ - acpi_entry_iosapic_t *iosapic; - char *p, *end; + result = acpi_table_parse_madt(ACPI_MADT_IOSAPIC, acpi_parse_iosapic); + if (1 > result) { + printk(KERN_ERR PREFIX "Error parsing MADT - no IOAPIC entries!\n"); + return ((result == 0) ? -ENODEV : result); + } - /* Base address of IPI Message Block */ - ipi_base_addr = (unsigned long) ioremap(msapic->interrupt_block, 0); + /* System-Level Interrupt Routing */ - p = (char *) (msapic + 1); - end = p + (msapic->header.length - sizeof(acpi_sapic_t)); + result = acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src); + if (0 > result) { + printk(KERN_ERR PREFIX "Error parsing platform interrupt source entry\n"); + return result; + } - while (p < end) { - switch (*p) { - case ACPI_ENTRY_LOCAL_SAPIC: - acpi_lsapic(p); - break; - - case ACPI_ENTRY_IO_SAPIC: - iosapic = (acpi_entry_iosapic_t *) p; - if (iosapic_init) - /* - * The ACPI I/O SAPIC table doesn't have a PCAT_COMPAT - * flag like the MADT table, but we can safely assume that - * ACPI 1.0b systems have a dual-8259 setup. - */ - iosapic_init(iosapic->address, iosapic->irq_base, 1); - break; - - case ACPI_ENTRY_INT_SRC_OVERRIDE: - acpi_legacy_irq(p); - break; - - case ACPI_ENTRY_PLATFORM_INT_SOURCE: - acpi_platform(p); - break; + result = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr); + if (0 > result) { + printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n"); + return result; + } - default: - break; - } + result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src); + if (0 > result) { + printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); + return result; + } - /* Move to next table entry. */ - p += p[1]; +#ifdef CONFIG_SERIAL_ACPI + /* + * TBD: Need phased approach to table parsing (only do those absolutely + * required during boot-up). Recommend expanding concept of fix- + * feature devices (LDM) to include table-based devices such as + * serial ports, EC, SMBus, etc. + */ + acpi_table_parse(ACPI_SPCR, acpi_parse_spcr); +#endif /*CONFIG_SERIAL_ACPI*/ + +#ifdef CONFIG_SMP + if (available_cpus == 0) { + printk("ACPI: Found 0 CPUS; assuming 1\n"); + available_cpus = 1; /* We've got at least one of these, no? */ } + smp_boot_data.cpu_count = total_cpus; +#endif + /* Make boot-up look pretty */ + printk("%d CPUs available, %d CPUs total\n", available_cpus, total_cpus); - /* Make bootup pretty */ - printk(" %d CPUs available, %d CPUs total\n", available_cpus, total_cpus); + return 0; } + +/* -------------------------------------------------------------------------- + PCI Interrupt Routing + -------------------------------------------------------------------------- */ + int __init -acpi_parse (acpi_rsdp_t *rsdp) +acpi_get_prt (struct pci_vector_struct **vectors, int *count) { -# ifdef CONFIG_ACPI - acpi_rsdt_t *rsdt; - acpi_desc_table_hdr_t *hdrp; - long tables, i; + struct pci_vector_struct *vector = NULL; + struct list_head *node = NULL; + struct acpi_prt_entry *entry = NULL; + int i = 0; - if (strncmp(rsdp->signature, ACPI_RSDP_SIG, ACPI_RSDP_SIG_LEN)) { - printk("Uh-oh, ACPI RSDP signature incorrect!\n"); - return 0; - } + if (!vectors || !count) + return -EINVAL; - rsdt = __va(rsdp->rsdt); - if (strncmp(rsdt->header.signature, ACPI_RSDT_SIG, ACPI_RSDT_SIG_LEN)) { - printk("Uh-oh, ACPI RDST signature incorrect!\n"); - return 0; + *vectors = NULL; + *count = 0; + + if (acpi_prt.count < 0) { + printk(KERN_ERR PREFIX "No PCI IRQ routing entries\n"); + return -ENODEV; } - printk("ACPI: %.6s %.8s %d.%d\n", rsdt->header.oem_id, rsdt->header.oem_table_id, - rsdt->header.oem_revision >> 16, rsdt->header.oem_revision & 0xffff); + /* Allocate vectors */ - acpi_cf_init(rsdp); + *vectors = kmalloc(sizeof(struct pci_vector_struct) * acpi_prt.count, GFP_KERNEL); + if (!(*vectors)) + return -ENOMEM; - tables = (rsdt->header.length - sizeof(acpi_desc_table_hdr_t)) / 8; - for (i = 0; i < tables; i++) { - hdrp = (acpi_desc_table_hdr_t *) __va(rsdt->entry_ptrs[i]); + /* Convert PRT entries to IOSAPIC PCI vectors */ - /* Only interested int the MSAPIC table for now ... */ - if (strncmp(hdrp->signature, ACPI_SAPIC_SIG, ACPI_SAPIC_SIG_LEN) != 0) - continue; + vector = *vectors; - acpi_parse_msapic((acpi_sapic_t *) hdrp); + list_for_each(node, &acpi_prt.entries) { + entry = (struct acpi_prt_entry *)node; + vector[i].bus = entry->id.bus; + vector[i].pci_id = ((u32) entry->id.device << 16) | 0xffff; + vector[i].pin = entry->pin; + vector[i].irq = entry->link.index; + i++; } + *count = acpi_prt.count; + return 0; +} - acpi_cf_terminate(); +/* Assume IA64 always use I/O SAPIC */ -# ifdef CONFIG_SMP - if (available_cpus == 0) { - printk("ACPI: Found 0 CPUS; assuming 1\n"); - available_cpus = 1; /* We've got at least one of these, no? */ - } - smp_boot_data.cpu_count = total_cpus; -# endif -# endif /* CONFIG_ACPI */ - return 1; +int __init +acpi_get_interrupt_model (int *type) +{ + if (!type) + return -EINVAL; + + *type = ACPI_IRQ_MODEL_IOSAPIC; + + return 0; } + +#endif /* CONFIG_ACPI_BOOT */ diff -urN linux-2.4.18/arch/ia64/kernel/brl_emu.c lia64-2.4/arch/ia64/kernel/brl_emu.c --- linux-2.4.18/arch/ia64/kernel/brl_emu.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/kernel/brl_emu.c Fri Feb 22 17:12:29 2002 @@ -2,6 +2,9 @@ * Emulation of the "brl" instruction for IA64 processors that * don't support it in hardware. * Author: Stephan Zeisset, Intel Corp. + * + * 02/22/02 D. Mosberger Clear si_flgs, si_isr, and si_imm to avoid + * leaking kernel bits. */ #include @@ -195,6 +198,9 @@ printk("Woah! Unimplemented Instruction Address Trap!\n"); siginfo.si_signo = SIGILL; siginfo.si_errno = 0; + siginfo.si_flags = 0; + siginfo.si_isr = 0; + siginfo.si_imm = 0; siginfo.si_code = ILL_BADIADDR; force_sig_info(SIGILL, &siginfo, current); } else if (ia64_psr(regs)->tb) { @@ -205,6 +211,10 @@ siginfo.si_signo = SIGTRAP; siginfo.si_errno = 0; siginfo.si_code = TRAP_BRANCH; + siginfo.si_flags = 0; + siginfo.si_isr = 0; + siginfo.si_addr = 0; + siginfo.si_imm = 0; force_sig_info(SIGTRAP, &siginfo, current); } else if (ia64_psr(regs)->ss) { /* @@ -214,6 +224,10 @@ siginfo.si_signo = SIGTRAP; siginfo.si_errno = 0; siginfo.si_code = TRAP_TRACE; + siginfo.si_flags = 0; + siginfo.si_isr = 0; + siginfo.si_addr = 0; + siginfo.si_imm = 0; force_sig_info(SIGTRAP, &siginfo, current); } return rv; diff -urN linux-2.4.18/arch/ia64/kernel/efi.c lia64-2.4/arch/ia64/kernel/efi.c --- linux-2.4.18/arch/ia64/kernel/efi.c Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/kernel/efi.c Mon Jul 8 15:19:36 2002 @@ -5,7 +5,7 @@ * * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond - * Copyright (C) 1999-2001 Hewlett-Packard Co. + * Copyright (C) 1999-2002 Hewlett-Packard Co. * David Mosberger-Tang * Stephane Eranian * @@ -125,9 +125,79 @@ tv->tv_usec = tm.nanosecond / 1000; } +static int +is_available_memory (efi_memory_desc_t *md) +{ + if (!(md->attribute & EFI_MEMORY_WB)) + return 0; + + switch (md->type) { + case EFI_LOADER_CODE: + case EFI_LOADER_DATA: + case EFI_BOOT_SERVICES_CODE: + case EFI_BOOT_SERVICES_DATA: + case EFI_CONVENTIONAL_MEMORY: + return 1; + } + return 0; +} + /* - * Walks the EFI memory map and calls CALLBACK once for each EFI - * memory descriptor that has memory that is available for OS use. + * Trim descriptor MD so its starts at address START_ADDR. If the descriptor covers + * memory that is normally available to the kernel, issue a warning that some memory + * is being ignored. + */ +static void +trim_bottom (efi_memory_desc_t *md, u64 start_addr) +{ + u64 num_skipped_pages; + + if (md->phys_addr >= start_addr || !md->num_pages) + return; + + num_skipped_pages = (start_addr - md->phys_addr) >> EFI_PAGE_SHIFT; + if (num_skipped_pages > md->num_pages) + num_skipped_pages = md->num_pages; + + if (is_available_memory(md)) + printk(KERN_NOTICE "efi.%s: ignoring %luKB of memory at 0x%lx due to granule hole " + "at 0x%lx\n", __FUNCTION__, + (num_skipped_pages << EFI_PAGE_SHIFT) >> 10, + md->phys_addr, start_addr - IA64_GRANULE_SIZE); + /* + * NOTE: Don't set md->phys_addr to START_ADDR because that could cause the memory + * descriptor list to become unsorted. In such a case, md->num_pages will be + * zero, so the Right Thing will happen. + */ + md->phys_addr += num_skipped_pages << EFI_PAGE_SHIFT; + md->num_pages -= num_skipped_pages; +} + +static void +trim_top (efi_memory_desc_t *md, u64 end_addr) +{ + u64 num_dropped_pages, md_end_addr; + + md_end_addr = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT); + + if (md_end_addr <= end_addr || !md->num_pages) + return; + + num_dropped_pages = (md_end_addr - end_addr) >> EFI_PAGE_SHIFT; + if (num_dropped_pages > md->num_pages) + num_dropped_pages = md->num_pages; + + if (is_available_memory(md)) + printk(KERN_NOTICE "efi.%s: ignoring %luKB of memory at 0x%lx due to granule hole " + "at 0x%lx\n", __FUNCTION__, + (num_dropped_pages << EFI_PAGE_SHIFT) >> 10, + md->phys_addr, end_addr); + md->num_pages -= num_dropped_pages; +} + +/* + * Walks the EFI memory map and calls CALLBACK once for each EFI memory descriptor that + * has memory that is available for OS use. */ void efi_memmap_walk (efi_freemem_callback_t callback, void *arg) @@ -137,9 +207,9 @@ u64 start; u64 end; } prev, curr; - void *efi_map_start, *efi_map_end, *p; - efi_memory_desc_t *md; - u64 efi_desc_size, start, end; + void *efi_map_start, *efi_map_end, *p, *q; + efi_memory_desc_t *md, *check_md; + u64 efi_desc_size, start, end, granule_addr, first_non_wb_addr = 0; efi_map_start = __va(ia64_boot_param->efi_memmap); efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size; @@ -147,27 +217,59 @@ for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { md = p; - switch (md->type) { - case EFI_LOADER_CODE: - case EFI_LOADER_DATA: - case EFI_BOOT_SERVICES_CODE: - case EFI_BOOT_SERVICES_DATA: - case EFI_CONVENTIONAL_MEMORY: - if (!(md->attribute & EFI_MEMORY_WB)) - continue; - if (md->phys_addr + (md->num_pages << 12) > mem_limit) { + + /* skip over non-WB memory descriptors; that's all we're interested in... */ + if (!(md->attribute & EFI_MEMORY_WB)) + continue; + + if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > first_non_wb_addr) { + /* + * Search for the next run of contiguous WB memory. Start search + * at first granule boundary covered by md. + */ + granule_addr = ((md->phys_addr + IA64_GRANULE_SIZE - 1) + & -IA64_GRANULE_SIZE); + first_non_wb_addr = granule_addr; + for (q = p; q < efi_map_end; q += efi_desc_size) { + check_md = q; + + if (check_md->attribute & EFI_MEMORY_WB) + trim_bottom(md, granule_addr); + + if (check_md->phys_addr < granule_addr) + continue; + + if (!(check_md->attribute & EFI_MEMORY_WB)) + break; /* hit a non-WB region; stop search */ + + if (check_md->phys_addr != first_non_wb_addr) + break; /* hit a memory hole; stop search */ + + first_non_wb_addr += check_md->num_pages << EFI_PAGE_SHIFT; + } + /* round it down to the previous granule-boundary: */ + first_non_wb_addr &= -IA64_GRANULE_SIZE; + + if (!(first_non_wb_addr > granule_addr)) + continue; /* couldn't find enough contiguous memory */ + } + + /* BUG_ON((md->phys_addr >> IA64_GRANULE_SHIFT) < first_non_wb_addr); */ + + trim_top(md, first_non_wb_addr); + + if (is_available_memory(md)) { + if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > mem_limit) { if (md->phys_addr > mem_limit) continue; - md->num_pages = (mem_limit - md->phys_addr) >> 12; + md->num_pages = (mem_limit - md->phys_addr) >> EFI_PAGE_SHIFT; } - if (md->num_pages == 0) { - printk("efi_memmap_walk: ignoring empty region at 0x%lx", - md->phys_addr); + + if (md->num_pages == 0) continue; - } curr.start = PAGE_OFFSET + md->phys_addr; - curr.end = curr.start + (md->num_pages << 12); + curr.end = curr.start + (md->num_pages << EFI_PAGE_SHIFT); if (!prev_valid) { prev = curr; @@ -187,10 +289,6 @@ prev = curr; } } - break; - - default: - continue; } } if (prev_valid) { @@ -212,8 +310,8 @@ void *efi_map_start, *efi_map_end, *p; efi_memory_desc_t *md; u64 efi_desc_size; - int pal_code_count=0; - u64 mask, flags; + int pal_code_count = 0; + u64 mask, psr; u64 vaddr; efi_map_start = __va(ia64_boot_param->efi_memmap); @@ -250,25 +348,26 @@ * dedicated ITR for the PAL code. */ if ((vaddr & mask) == (KERNEL_START & mask)) { - printk(__FUNCTION__ ": no need to install ITR for PAL code\n"); + printk("%s: no need to install ITR for PAL code\n", __FUNCTION__); continue; } - if (md->num_pages << 12 > IA64_GRANULE_SIZE) + if (md->num_pages << EFI_PAGE_SHIFT > IA64_GRANULE_SIZE) panic("Woah! PAL code size bigger than a granule!"); mask = ~((1 << IA64_GRANULE_SHIFT) - 1); printk("CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n", - smp_processor_id(), md->phys_addr, md->phys_addr + (md->num_pages << 12), + smp_processor_id(), md->phys_addr, + md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE); /* * Cannot write to CRx with PSR.ic=1 */ - ia64_clear_ic(flags); + psr = ia64_clear_ic(); ia64_itr(0x1, IA64_TR_PALCODE, vaddr & mask, pte_val(mk_pte_phys(md->phys_addr, PAGE_KERNEL)), IA64_GRANULE_SHIFT); - local_irq_restore(flags); + ia64_set_psr(psr); /* restore psr */ ia64_srlz_i(); } } @@ -346,6 +445,9 @@ } else if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == 0) { efi.sal_systab = __va(config_tables[i].table); printk(" SALsystab=0x%lx", config_tables[i].table); + } else if (efi_guidcmp(config_tables[i].guid, HCDP_TABLE_GUID) == 0) { + efi.hcdp = __va(config_tables[i].table); + printk(" HCDP=0x%lx", config_tables[i].table); } } printk("\n"); @@ -375,7 +477,8 @@ md = p; printk("mem%02u: type=%u, attr=0x%lx, range=[0x%016lx-0x%016lx) (%luMB)\n", i, md->type, md->attribute, md->phys_addr, - md->phys_addr + (md->num_pages<<12) - 1, md->num_pages >> 8); + md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), + md->num_pages >> (20 - EFI_PAGE_SHIFT)); } } #endif @@ -482,8 +585,50 @@ return 0; } +u32 +efi_mem_type (unsigned long phys_addr) +{ + void *efi_map_start, *efi_map_end, *p; + efi_memory_desc_t *md; + u64 efi_desc_size; + + efi_map_start = __va(ia64_boot_param->efi_memmap); + efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size; + efi_desc_size = ia64_boot_param->efi_memdesc_size; + + for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { + md = p; + + if ((md->phys_addr <= phys_addr) && (phys_addr <= + (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - 1))) + return md->type; + } + return 0; +} + +u64 +efi_mem_attributes (unsigned long phys_addr) +{ + void *efi_map_start, *efi_map_end, *p; + efi_memory_desc_t *md; + u64 efi_desc_size; + + efi_map_start = __va(ia64_boot_param->efi_memmap); + efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size; + efi_desc_size = ia64_boot_param->efi_memdesc_size; + + for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { + md = p; + + if ((md->phys_addr <= phys_addr) && (phys_addr <= + (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - 1))) + return md->attribute; + } + return 0; +} + static void __exit -efivars_exit(void) +efivars_exit (void) { #ifdef CONFIG_PROC_FS remove_proc_entry(efi_dir->name, NULL); diff -urN linux-2.4.18/arch/ia64/kernel/efi_stub.S lia64-2.4/arch/ia64/kernel/efi_stub.S --- linux-2.4.18/arch/ia64/kernel/efi_stub.S Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/kernel/efi_stub.S Fri May 24 19:03:30 2002 @@ -53,23 +53,21 @@ mov loc4=ar.rsc // save RSE configuration mov ar.rsc=0 // put RSE in enforced lazy, LE mode ;; - ld8 gp=[in0] // load EFI function's global pointer - mov out0=in1 - mov out1=in2 movl r16=PSR_BITS_TO_CLEAR - mov loc3=psr // save processor status word movl r17=PSR_BITS_TO_SET ;; - mov out2=in3 or loc3=loc3,r17 mov b6=r2 ;; andcm r16=loc3,r16 // get psr with IT, DT, and RT bits cleared - mov out3=in4 br.call.sptk.many rp=ia64_switch_mode .ret0: mov out4=in5 + mov out0=in1 + mov out1=in2 + mov out2=in3 + mov out3=in4 mov out5=in6 mov out6=in7 br.call.sptk.many rp=b6 // call the EFI function diff -urN linux-2.4.18/arch/ia64/kernel/efivars.c lia64-2.4/arch/ia64/kernel/efivars.c --- linux-2.4.18/arch/ia64/kernel/efivars.c Wed Dec 26 16:58:36 2001 +++ lia64-2.4/arch/ia64/kernel/efivars.c Thu Mar 28 16:11:08 2002 @@ -29,6 +29,14 @@ * * Changelog: * + * 25 Mar 2002 - Matt Domsch + * move uuid_unparse() to include/asm-ia64/efi.h:efi_guid_unparse() + * + * 12 Feb 2002 - Matt Domsch + * use list_for_each_safe when deleting vars. + * remove ifdef CONFIG_SMP around include + * v0.04 release to linux-ia64@linuxia64.org + * * 20 April 2001 - Matt Domsch * Moved vars from /proc/efi to /proc/efi/vars, and made * efi.c own the /proc/efi directory. @@ -56,18 +64,16 @@ #include /* for capable() */ #include #include +#include #include #include -#ifdef CONFIG_SMP -#include -#endif MODULE_AUTHOR("Matt Domsch "); MODULE_DESCRIPTION("/proc interface to EFI Variables"); MODULE_LICENSE("GPL"); -#define EFIVARS_VERSION "0.03 2001-Apr-20" +#define EFIVARS_VERSION "0.05 2002-Mar-26" static int efivar_read(char *page, char **start, off_t off, @@ -138,20 +144,6 @@ return len; } - -static void -uuid_unparse(efi_guid_t *guid, char *out) -{ - sprintf(out, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - guid->data1, guid->data2, guid->data3, - guid->data4[0], guid->data4[1], guid->data4[2], guid->data4[3], - guid->data4[4], guid->data4[5], guid->data4[6], guid->data4[7]); -} - - - - - /* * efivar_create_proc_entry() * Requires: @@ -194,7 +186,7 @@ private variables from another's. */ *(short_name + strlen(short_name)) = '-'; - uuid_unparse(vendor_guid, short_name + strlen(short_name)); + efi_guid_unparse(vendor_guid, short_name + strlen(short_name)); /* Create the entry in proc */ @@ -265,7 +257,7 @@ { unsigned long strsize1, strsize2; int found=0; - struct list_head *pos; + struct list_head *pos, *n; unsigned long size = sizeof(efi_variable_t); efi_status_t status; efivar_entry_t *efivar = data, *search_efivar = NULL; @@ -297,7 +289,7 @@ This allows any properly formatted data structure to be written to any of the files in /proc/efi/vars and it will work. */ - list_for_each(pos, &efivar_list) { + list_for_each_safe(pos, n, &efivar_list) { search_efivar = efivar_entry(pos); strsize1 = utf8_strsize(search_efivar->var.VariableName, 1024); strsize2 = utf8_strsize(var_data->VariableName, 1024); @@ -413,12 +405,12 @@ static void __exit efivars_exit(void) { - struct list_head *pos; + struct list_head *pos, *n; efivar_entry_t *efivar; spin_lock(&efivars_lock); - list_for_each(pos, &efivar_list) { + list_for_each_safe(pos, n, &efivar_list) { efivar = efivar_entry(pos); remove_proc_entry(efivar->entry->name, efi_vars_dir); list_del(&efivar->list); diff -urN linux-2.4.18/arch/ia64/kernel/entry.S lia64-2.4/arch/ia64/kernel/entry.S --- linux-2.4.18/arch/ia64/kernel/entry.S Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/kernel/entry.S Tue Apr 9 22:01:38 2002 @@ -3,7 +3,7 @@ * * Kernel entry points. * - * Copyright (C) 1998-2001 Hewlett-Packard Co + * Copyright (C) 1998-2002 Hewlett-Packard Co * David Mosberger-Tang * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond @@ -115,7 +115,7 @@ mov loc1=r16 // save ar.pfs across do_fork .body mov out1=in1 - mov out3=0 + mov out3=16 // stacksize (compensates for 16-byte scratch area) adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = ®s mov out0=in0 // out0 = clone_flags br.call.sptk.many rp=do_fork @@ -521,35 +521,38 @@ ;; mov.ret.sptk rp=r14,.restart .restart: + // need_resched and signals atomic test +(pUser) rsm psr.i adds r17=IA64_TASK_NEED_RESCHED_OFFSET,r13 adds r18=IA64_TASK_SIGPENDING_OFFSET,r13 #ifdef CONFIG_PERFMON - adds r19=IA64_TASK_PFM_MUST_BLOCK_OFFSET,r13 + adds r19=IA64_TASK_PFM_OVFL_BLOCK_RESET_OFFSET,r13 #endif ;; #ifdef CONFIG_PERFMON -(pUser) ld8 r19=[r19] // load current->thread.pfm_must_block +(pUser) ld8 r19=[r19] // load current->thread.pfm_ovfl_block_reset #endif (pUser) ld8 r17=[r17] // load current->need_resched (pUser) ld4 r18=[r18] // load current->sigpending ;; #ifdef CONFIG_PERFMON -(pUser) cmp.ne.unc p9,p0=r19,r0 // current->thread.pfm_must_block != 0? +(pUser) cmp.ne.unc p9,p0=r19,r0 // current->thread.pfm_ovfl_block_reset != 0? #endif (pUser) cmp.ne.unc p7,p0=r17,r0 // current->need_resched != 0? (pUser) cmp.ne.unc p8,p0=r18,r0 // current->sigpending != 0? ;; - adds r2=PT(R8)+16,r12 - adds r3=PT(R9)+16,r12 #ifdef CONFIG_PERFMON -(p9) br.call.spnt.many b7=pfm_block_on_overflow +(p9) br.call.spnt.many b7=pfm_ovfl_block_reset #endif #if __GNUC__ < 3 (p7) br.call.spnt.many b7=invoke_schedule #else (p7) br.call.spnt.many b7=schedule #endif -(p8) br.call.spnt.many b7=handle_signal_delivery // check & deliver pending signals +(p8) br.call.spnt.many rp=handle_signal_delivery // check & deliver pending signals (once) + ;; +.ret9: adds r2=PT(R8)+16,r12 + adds r3=PT(R9)+16,r12 ;; // start restoring the state saved on the kernel stack (struct pt_regs): ld8.fill r8=[r2],16 @@ -582,7 +585,7 @@ ld8.fill r30=[r2],16 ld8.fill r31=[r3],16 ;; - rsm psr.i | psr.ic // initiate turning off of interrupts & interruption collection + rsm psr.i | psr.ic // initiate turning off of interrupt and interruption collection invala // invalidate ALAT ;; ld8 r1=[r2],16 // ar.ccv @@ -601,7 +604,7 @@ mov ar.fpsr=r13 mov b0=r14 ;; - srlz.i // ensure interrupts & interruption collection are off + srlz.i // ensure interruption collection is off mov b7=r15 ;; bsw.0 // switch back to bank 0 @@ -664,23 +667,38 @@ /* * To prevent leaking bits between the kernel and user-space, * we must clear the stacked registers in the "invalid" partition here. - * Not pretty, but at least it's fast (3.34 registers/cycle). - * Architecturally, this loop could go at 4.67 registers/cycle, but that would - * oversubscribe Itanium. + * Not pretty, but at least it's fast (3.34 registers/cycle on Itanium, + * 5 registers/cycle on McKinley). */ # define pRecurse p6 # define pReturn p7 +#ifdef CONFIG_ITANIUM # define Nregs 10 +#else +# define Nregs 14 +#endif alloc loc0=ar.pfs,2,Nregs-2,2,0 shr.u loc1=r18,9 // RNaTslots <= dirtySize / (64*8) + 1 sub r17=r17,r18 // r17 = (physStackedSize + 8) - dirtySize ;; +#if 1 + .align 32 // see comment below about gas bug... +#endif mov ar.rsc=r19 // load ar.rsc to be used for "loadrs" shladd in0=loc1,3,r17 mov in1=0 +#if 0 + // gas-2.11.90 is unable to generate a stop bit after .align, which is bad, + // because alloc must be at the beginning of an insn-group. + .align 32 +#else + nop 0 + nop 0 + nop 0 +#endif ;; -// .align 32 // gas-2.11.90 is unable to generate a stop bit after .align rse_clear_invalid: +#ifdef CONFIG_ITANIUM // cycle 0 { .mii alloc loc0=ar.pfs,2,Nregs-2,2,0 @@ -709,9 +727,31 @@ mov loc7=0 (pReturn) br.ret.sptk.many b6 } +#else /* !CONFIG_ITANIUM */ + alloc loc0=ar.pfs,2,Nregs-2,2,0 + cmp.lt pRecurse,p0=Nregs*8,in0 // if more than Nregs regs left to clear, (re)curse + add out0=-Nregs*8,in0 + add out1=1,in1 // increment recursion count + mov loc1=0 + mov loc2=0 + ;; + mov loc3=0 + mov loc4=0 + mov loc9=0 + mov loc5=0 + mov loc6=0 +(pRecurse) br.call.sptk.many b6=rse_clear_invalid + ;; + mov loc7=0 + mov loc8=0 + cmp.ne pReturn,p0=r0,in1 // if recursion count != 0, we need to do a br.ret + mov loc10=0 + mov loc11=0 +(pReturn) br.ret.sptk.many b6 +#endif /* !CONFIG_ITANIUM */ # undef pRecurse # undef pReturn - + ;; alloc r17=ar.pfs,0,0,0,0 // drop current register frame ;; loadrs diff -urN linux-2.4.18/arch/ia64/kernel/fw-emu.c lia64-2.4/arch/ia64/kernel/fw-emu.c --- linux-2.4.18/arch/ia64/kernel/fw-emu.c Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/kernel/fw-emu.c Fri Jun 21 23:08:15 2002 @@ -19,8 +19,10 @@ #include #define MB (1024*1024UL) +#define GB (1024*MB) +#define TB (1024*GB) -#define NUM_MEM_DESCS 3 +#define NUM_MEM_DESCS 4 static char fw_mem[( sizeof(struct ia64_boot_param) + sizeof(efi_system_table_t) @@ -471,7 +473,7 @@ md->phys_addr = 0*MB; md->virt_addr = 0; md->num_pages = (1*MB) >> 12; /* 1MB (in 4KB pages) */ - md->attribute = EFI_MEMORY_WB; + md->attribute = EFI_MEMORY_WB | EFI_MEMORY_WC | EFI_MEMORY_UC; /* fill in a memory descriptor: */ md = &efi_memmap[1]; @@ -489,23 +491,16 @@ md->phys_addr = 1*MB; md->virt_addr = 1*MB; md->num_pages = (1*MB) >> 12; /* 1MB (in 4KB pages) */ - md->attribute = EFI_MEMORY_WB; - -#if 0 - /* - * XXX bootmem is broken for now... (remember to NUM_MEM_DESCS - * if you re-enable this!) - */ + md->attribute = EFI_MEMORY_WB | EFI_MEMORY_WC | EFI_MEMORY_UC; /* descriptor for high memory (>4GB): */ md = &efi_memmap[3]; md->type = EFI_CONVENTIONAL_MEMORY; md->pad = 0; - md->phys_addr = 4096*MB; + md->phys_addr = 4*TB; md->virt_addr = 0; - md->num_pages = (32*MB) >> 12; /* 32MB (in 4KB pages) */ + md->num_pages = (64*MB) >> 12; /* 64MB (in 4KB pages) */ md->attribute = EFI_MEMORY_WB; -#endif bp->efi_systab = __pa(&fw_mem); bp->efi_memmap = __pa(efi_memmap); diff -urN linux-2.4.18/arch/ia64/kernel/gate.S lia64-2.4/arch/ia64/kernel/gate.S --- linux-2.4.18/arch/ia64/kernel/gate.S Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/kernel/gate.S Fri Apr 26 13:39:20 2002 @@ -29,7 +29,7 @@ # define UNAT_OFF IA64_SIGCONTEXT_AR_UNAT_OFFSET # define FPSR_OFF IA64_SIGCONTEXT_AR_FPSR_OFFSET # define PR_OFF IA64_SIGCONTEXT_PR_OFFSET -# define RP_OFF IA64_SIGCONTEXT_B0_OFFSET +# define RP_OFF IA64_SIGCONTEXT_IP_OFFSET # define SP_OFF IA64_SIGCONTEXT_R12_OFFSET # define RBS_BASE_OFF IA64_SIGCONTEXT_RBS_BASE_OFFSET # define LOADRS_OFF IA64_SIGCONTEXT_LOADRS_OFFSET @@ -90,7 +90,7 @@ (p8) br.cond.spnt setup_rbs // yup -> (clobbers r14, r15, and r16) back_from_setup_rbs: - .save ar.pfs, r8 + .spillreg ar.pfs, r8 alloc r8=ar.pfs,0,0,3,0 // get CFM0, EC0, and CPL0 into r8 ld8 out0=[base0],16 // load arg0 (signum) adds base1=(ARG1_OFF-(RBS_BASE_OFF+SIGCONTEXT_OFF)),base1 @@ -108,7 +108,7 @@ dep r8=0,r8,38,26 // clear EC0, CPL0 and reserved bits adds base1=(FR6_OFF+16+SIGCONTEXT_OFF),sp ;; - .spillsp ar.pfs, CFM_OFF + .spillsp ar.pfs, CFM_OFF+SIGCONTEXT_OFF st8 [base0]=r8 // save CFM0 adds base0=(FR6_OFF+SIGCONTEXT_OFF),sp ;; diff -urN linux-2.4.18/arch/ia64/kernel/head.S lia64-2.4/arch/ia64/kernel/head.S --- linux-2.4.18/arch/ia64/kernel/head.S Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/kernel/head.S Tue Apr 9 21:50:52 2002 @@ -180,10 +180,12 @@ .rodata alive_msg: stringz "I'm alive and well\n" +alive_msg_end: .previous alloc r2=ar.pfs,0,0,2,0 movl out0=alive_msg + movl out1=alive_msg_end-alive_msg-1 ;; br.call.sptk.many rp=early_printk 1: // force new bundle @@ -560,137 +562,114 @@ END(__ia64_load_fpu) GLOBAL_ENTRY(__ia64_init_fpu) - alloc r2=ar.pfs,0,0,0,0 - stf.spill [sp]=f0 - mov f32=f0 - ;; - ldf.fill f33=[sp] - ldf.fill f34=[sp] - mov f35=f0 - ;; - ldf.fill f36=[sp] - ldf.fill f37=[sp] - mov f38=f0 - ;; - ldf.fill f39=[sp] - ldf.fill f40=[sp] - mov f41=f0 - ;; - ldf.fill f42=[sp] - ldf.fill f43=[sp] - mov f44=f0 - ;; - ldf.fill f45=[sp] - ldf.fill f46=[sp] - mov f47=f0 - ;; - ldf.fill f48=[sp] - ldf.fill f49=[sp] - mov f50=f0 - ;; - ldf.fill f51=[sp] - ldf.fill f52=[sp] - mov f53=f0 - ;; - ldf.fill f54=[sp] - ldf.fill f55=[sp] - mov f56=f0 - ;; - ldf.fill f57=[sp] - ldf.fill f58=[sp] - mov f59=f0 - ;; - ldf.fill f60=[sp] - ldf.fill f61=[sp] - mov f62=f0 - ;; - ldf.fill f63=[sp] - ldf.fill f64=[sp] - mov f65=f0 - ;; - ldf.fill f66=[sp] - ldf.fill f67=[sp] - mov f68=f0 - ;; - ldf.fill f69=[sp] - ldf.fill f70=[sp] - mov f71=f0 - ;; - ldf.fill f72=[sp] - ldf.fill f73=[sp] - mov f74=f0 - ;; - ldf.fill f75=[sp] - ldf.fill f76=[sp] - mov f77=f0 - ;; - ldf.fill f78=[sp] - ldf.fill f79=[sp] - mov f80=f0 - ;; - ldf.fill f81=[sp] - ldf.fill f82=[sp] - mov f83=f0 - ;; - ldf.fill f84=[sp] - ldf.fill f85=[sp] - mov f86=f0 - ;; - ldf.fill f87=[sp] - ldf.fill f88=[sp] - mov f89=f0 - ;; - ldf.fill f90=[sp] - ldf.fill f91=[sp] - mov f92=f0 - ;; - ldf.fill f93=[sp] - ldf.fill f94=[sp] - mov f95=f0 - ;; - ldf.fill f96=[sp] - ldf.fill f97=[sp] - mov f98=f0 - ;; - ldf.fill f99=[sp] - ldf.fill f100=[sp] - mov f101=f0 - ;; - ldf.fill f102=[sp] - ldf.fill f103=[sp] - mov f104=f0 - ;; - ldf.fill f105=[sp] - ldf.fill f106=[sp] - mov f107=f0 - ;; - ldf.fill f108=[sp] - ldf.fill f109=[sp] - mov f110=f0 - ;; - ldf.fill f111=[sp] - ldf.fill f112=[sp] - mov f113=f0 - ;; - ldf.fill f114=[sp] - ldf.fill f115=[sp] - mov f116=f0 - ;; - ldf.fill f117=[sp] - ldf.fill f118=[sp] - mov f119=f0 - ;; - ldf.fill f120=[sp] - ldf.fill f121=[sp] - mov f122=f0 - ;; - ldf.fill f123=[sp] - ldf.fill f124=[sp] - mov f125=f0 + stf.spill [sp]=f0 // M3 + mov f32=f0 // F + nop.b 0 + + ldfps f33,f34=[sp] // M0 + ldfps f35,f36=[sp] // M1 + mov f37=f0 // F ;; - ldf.fill f126=[sp] - mov f127=f0 - br.ret.sptk.many rp + + setf.s f38=r0 // M2 + setf.s f39=r0 // M3 + mov f40=f0 // F + + ldfps f41,f42=[sp] // M0 + ldfps f43,f44=[sp] // M1 + mov f45=f0 // F + + setf.s f46=r0 // M2 + setf.s f47=r0 // M3 + mov f48=f0 // F + + ldfps f49,f50=[sp] // M0 + ldfps f51,f52=[sp] // M1 + mov f53=f0 // F + + setf.s f54=r0 // M2 + setf.s f55=r0 // M3 + mov f56=f0 // F + + ldfps f57,f58=[sp] // M0 + ldfps f59,f60=[sp] // M1 + mov f61=f0 // F + + setf.s f62=r0 // M2 + setf.s f63=r0 // M3 + mov f64=f0 // F + + ldfps f65,f66=[sp] // M0 + ldfps f67,f68=[sp] // M1 + mov f69=f0 // F + + setf.s f70=r0 // M2 + setf.s f71=r0 // M3 + mov f72=f0 // F + + ldfps f73,f74=[sp] // M0 + ldfps f75,f76=[sp] // M1 + mov f77=f0 // F + + setf.s f78=r0 // M2 + setf.s f79=r0 // M3 + mov f80=f0 // F + + ldfps f81,f82=[sp] // M0 + ldfps f83,f84=[sp] // M1 + mov f85=f0 // F + + setf.s f86=r0 // M2 + setf.s f87=r0 // M3 + mov f88=f0 // F + + /* + * When the instructions are cached, it would be faster to initialize + * the remaining registers with simply mov instructions (F-unit). + * This gets the time down to ~29 cycles. However, this would use up + * 33 bundles, whereas continuing with the above pattern yields + * 10 bundles and ~30 cycles. + */ + + ldfps f89,f90=[sp] // M0 + ldfps f91,f92=[sp] // M1 + mov f93=f0 // F + + setf.s f94=r0 // M2 + setf.s f95=r0 // M3 + mov f96=f0 // F + + ldfps f97,f98=[sp] // M0 + ldfps f99,f100=[sp] // M1 + mov f101=f0 // F + + setf.s f102=r0 // M2 + setf.s f103=r0 // M3 + mov f104=f0 // F + + ldfps f105,f106=[sp] // M0 + ldfps f107,f108=[sp] // M1 + mov f109=f0 // F + + setf.s f110=r0 // M2 + setf.s f111=r0 // M3 + mov f112=f0 // F + + ldfps f113,f114=[sp] // M0 + ldfps f115,f116=[sp] // M1 + mov f117=f0 // F + + setf.s f118=r0 // M2 + setf.s f119=r0 // M3 + mov f120=f0 // F + + ldfps f121,f122=[sp] // M0 + ldfps f123,f124=[sp] // M1 + mov f125=f0 // F + + setf.s f126=r0 // M2 + setf.s f127=r0 // M3 + br.ret.sptk.many rp // F END(__ia64_init_fpu) /* diff -urN linux-2.4.18/arch/ia64/kernel/ia64_ksyms.c lia64-2.4/arch/ia64/kernel/ia64_ksyms.c --- linux-2.4.18/arch/ia64/kernel/ia64_ksyms.c Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/kernel/ia64_ksyms.c Tue Jun 11 18:13:04 2002 @@ -1,11 +1,11 @@ /* * Architecture-specific kernel symbols */ - #include #include #include + EXPORT_SYMBOL_NOVERS(memset); EXPORT_SYMBOL(memchr); EXPORT_SYMBOL(memcmp); @@ -24,9 +24,11 @@ EXPORT_SYMBOL(strrchr); EXPORT_SYMBOL(strstr); EXPORT_SYMBOL(strtok); +EXPORT_SYMBOL(strpbrk); #include EXPORT_SYMBOL(isa_irq_to_vector_map); +EXPORT_SYMBOL(gsi_to_vector_map); EXPORT_SYMBOL(enable_irq); EXPORT_SYMBOL(disable_irq); EXPORT_SYMBOL(disable_irq_nosync); @@ -147,3 +149,10 @@ #include extern struct proc_dir_entry *efi_dir; EXPORT_SYMBOL(efi_dir); + +#include +#ifdef CONFIG_IA64_GENERIC +EXPORT_SYMBOL(ia64_mv); +#endif +EXPORT_SYMBOL(machvec_noop); + diff -urN linux-2.4.18/arch/ia64/kernel/iosapic.c lia64-2.4/arch/ia64/kernel/iosapic.c --- linux-2.4.18/arch/ia64/kernel/iosapic.c Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/kernel/iosapic.c Fri Jul 19 13:56:34 2002 @@ -3,8 +3,9 @@ * * Copyright (C) 1999 Intel Corp. * Copyright (C) 1999 Asit Mallick - * Copyright (C) 1999-2000 Hewlett-Packard Co. - * Copyright (C) 1999-2000 David Mosberger-Tang + * Copyright (C) 2000-2002 J.I. Lee + * Copyright (C) 1999-2000, 2002 Hewlett-Packard Co. + * David Mosberger-Tang * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999,2000 Walt Drummond * @@ -15,6 +16,15 @@ * PCI to vector mapping, shared PCI interrupts. * 00/10/27 D. Mosberger Document things a bit more to make them more understandable. * Clean up much of the old IOSAPIC cruft. + * 01/07/27 J.I. Lee PCI irq routing, Platform/Legacy interrupts and fixes for + * ACPI S5(SoftOff) support. + * 02/01/23 J.I. Lee iosapic pgm fixes for PCI irq routing from _PRT + * 02/01/07 E. Focht Redirectable interrupt vectors in + * iosapic_set_affinity(), initializations for + * /proc/irq/#/smp_affinity + * 02/04/02 P. Diefenbaugh Cleaned up ACPI PCI IRQ routing. + * 02/04/18 J.I. Lee bug fix in iosapic_init_pci_irq + * 02/04/30 J.I. Lee bug fix in find_iosapic to fix ACPI PCI IRQ to IOSAPIC mapping error */ /* * Here is what the interrupt logic between a PCI device and the CPU looks like: @@ -49,9 +59,8 @@ #include #include #include +#include -#include -#include #include #include #include @@ -63,6 +72,7 @@ #undef DEBUG_IRQ_ROUTING +#undef OVERRIDE_DEBUG static spinlock_t iosapic_lock = SPIN_LOCK_UNLOCKED; @@ -77,13 +87,39 @@ static struct iosapic_irq { char *addr; /* base address of IOSAPIC */ - unsigned char base_irq; /* first irq assigned to this IOSAPIC */ + unsigned int base_irq; /* first irq assigned to this IOSAPIC */ char pin; /* IOSAPIC pin (-1 => not an IOSAPIC irq) */ unsigned char dmode : 3; /* delivery mode (see iosapic.h) */ unsigned char polarity : 1; /* interrupt polarity (see iosapic.h) */ unsigned char trigger : 1; /* trigger mode (see iosapic.h) */ } iosapic_irq[IA64_NUM_VECTORS]; +static struct iosapic { + char *addr; /* base address of IOSAPIC */ + unsigned int base_irq; /* first irq assigned to this IOSAPIC */ + unsigned short max_pin; /* max input pin supported in this IOSAPIC */ + unsigned char pcat_compat; /* 8259 compatibility flag */ +} iosapic_lists[256] __initdata; + +static int num_iosapic = 0; + + +/* + * Find an IOSAPIC associated with an IRQ + */ +static inline int __init +find_iosapic (unsigned int irq) +{ + int i; + + for (i = 0; i < num_iosapic; i++) { + if ((unsigned) (irq - iosapic_lists[i].base_irq) <= iosapic_lists[i].max_pin) + return i; + } + + return -1; +} + /* * Translate IOSAPIC irq number to the corresponding IA-64 interrupt vector. If no * entry exists, return -1. @@ -103,7 +139,7 @@ * Map PCI pin to the corresponding IA-64 interrupt vector. If no such mapping exists, * return -1. */ -static int +int pci_pin_to_vector (int bus, int slot, int pci_pin) { struct pci_vector_struct *r; @@ -121,6 +157,7 @@ u32 low32, high32; char *addr; int pin; + char redir; pin = iosapic_irq[vector].pin; if (pin < 0) @@ -131,6 +168,11 @@ trigger = iosapic_irq[vector].trigger; dmode = iosapic_irq[vector].dmode; + redir = (dmode == IOSAPIC_LOWEST_PRIORITY) ? 1 : 0; +#ifdef CONFIG_SMP + set_irq_affinity_info(vector, (int)(dest & 0xffff), redir); +#endif + low32 = ((pol << IOSAPIC_POLARITY_SHIFT) | (trigger << IOSAPIC_TRIGGER_SHIFT) | (dmode << IOSAPIC_DELIVERY_SHIFT) | @@ -211,6 +253,7 @@ u32 high32, low32; int dest, pin; char *addr; + int redir = (irq & (1<<31)) ? 1 : 0; mask &= (1UL << smp_num_cpus) - 1; @@ -225,6 +268,8 @@ if (pin < 0) return; /* not an IOSAPIC interrupt */ + set_irq_affinity_info(irq,dest,redir); + /* dest contains both id and eid */ high32 = dest << IOSAPIC_DEST_SHIFT; @@ -234,9 +279,13 @@ writel(IOSAPIC_RTE_LOW(pin), addr + IOSAPIC_REG_SELECT); low32 = readl(addr + IOSAPIC_WINDOW); - /* change delivery mode to fixed */ low32 &= ~(7 << IOSAPIC_DELIVERY_SHIFT); - low32 |= (IOSAPIC_FIXED << IOSAPIC_DELIVERY_SHIFT); + if (redir) + /* change delivery mode to lowest priority */ + low32 |= (IOSAPIC_LOWEST_PRIORITY << IOSAPIC_DELIVERY_SHIFT); + else + /* change delivery mode to fixed */ + low32 |= (IOSAPIC_FIXED << IOSAPIC_DELIVERY_SHIFT); writel(IOSAPIC_RTE_HIGH(pin), addr + IOSAPIC_REG_SELECT); writel(high32, addr + IOSAPIC_WINDOW); @@ -343,29 +392,65 @@ } /* - * ACPI can describe IOSAPIC interrupts via static tables and namespace - * methods. This provides an interface to register those interrupts and - * program the IOSAPIC RTE. + * if the given vector is already owned by other, + * assign a new vector for the other and make the vector available */ -int -iosapic_register_irq (u32 global_vector, unsigned long polarity, unsigned long - edge_triggered, u32 base_irq, char *iosapic_address) +static void +iosapic_reassign_vector (int vector) +{ + int new_vector; + + if (iosapic_irq[vector].pin >= 0 || iosapic_irq[vector].addr + || iosapic_irq[vector].base_irq || iosapic_irq[vector].dmode + || iosapic_irq[vector].polarity || iosapic_irq[vector].trigger) + { + new_vector = ia64_alloc_irq(); + printk("Reassigning Vector 0x%x to 0x%x\n", vector, new_vector); + memcpy (&iosapic_irq[new_vector], &iosapic_irq[vector], + sizeof(struct iosapic_irq)); + memset (&iosapic_irq[vector], 0, sizeof(struct iosapic_irq)); + iosapic_irq[vector].pin = -1; + } +} + +static void +register_irq (u32 global_vector, int vector, int pin, unsigned char delivery, + unsigned long polarity, unsigned long edge_triggered, + u32 base_irq, char *iosapic_address) { irq_desc_t *idesc; struct hw_interrupt_type *irq_type; - int vector; - - vector = iosapic_irq_to_vector(global_vector); - if (vector < 0) - vector = ia64_alloc_irq(); - /* fill in information from this vector's IOSAPIC */ - iosapic_irq[vector].addr = iosapic_address; - iosapic_irq[vector].base_irq = base_irq; - iosapic_irq[vector].pin = global_vector - iosapic_irq[vector].base_irq; + gsi_to_vector(global_vector) = vector; + iosapic_irq[vector].pin = pin; iosapic_irq[vector].polarity = polarity ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW; - iosapic_irq[vector].dmode = IOSAPIC_LOWEST_PRIORITY; + iosapic_irq[vector].dmode = delivery; + /* + * In override, it does not provide addr/base_irq. global_vector is enough to + * locate iosapic addr, base_irq and pin by examining base_irq and max_pin of + * registered iosapics (tbd) + */ +#ifndef OVERRIDE_DEBUG + if (iosapic_address) { + iosapic_irq[vector].addr = iosapic_address; + iosapic_irq[vector].base_irq = base_irq; + } +#else + if (iosapic_address) { + if (iosapic_irq[vector].addr && (iosapic_irq[vector].addr != iosapic_address)) + printk("WARN: register_irq: diff IOSAPIC ADDRESS for gv %x, v %x\n", + global_vector, vector); + iosapic_irq[vector].addr = iosapic_address; + if (iosapic_irq[vector].base_irq && (iosapic_irq[vector].base_irq != base_irq)) { + printk("WARN: register_irq: diff BASE IRQ %x for gv %x, v %x\n", + base_irq, global_vector, vector); + } + iosapic_irq[vector].base_irq = base_irq; + } else if (!iosapic_irq[vector].addr) + printk("WARN: register_irq: invalid override for gv %x, v %x\n", + global_vector, vector); +#endif if (edge_triggered) { iosapic_irq[vector].trigger = IOSAPIC_EDGE; irq_type = &irq_type_iosapic_edge; @@ -377,12 +462,32 @@ idesc = irq_desc(vector); if (idesc->handler != irq_type) { if (idesc->handler != &no_irq_type) - printk("iosapic_register_irq(): changing vector 0x%02x from" + printk("register_irq(): changing vector 0x%02x from " "%s to %s\n", vector, idesc->handler->typename, irq_type->typename); idesc->handler = irq_type; } +} - printk("IOSAPIC %x(%s,%s) -> Vector %x\n", global_vector, +/* + * ACPI can describe IOSAPIC interrupts via static tables and namespace + * methods. This provides an interface to register those interrupts and + * program the IOSAPIC RTE. + */ +int +iosapic_register_irq (u32 global_vector, unsigned long polarity, unsigned long + edge_triggered, u32 base_irq, char *iosapic_address) +{ + int vector; + + vector = iosapic_irq_to_vector(global_vector); + if (vector < 0) + vector = ia64_alloc_irq(); + + register_irq (global_vector, vector, global_vector - base_irq, + IOSAPIC_LOWEST_PRIORITY, polarity, edge_triggered, + base_irq, iosapic_address); + + printk("IOSAPIC 0x%x(%s,%s) -> Vector 0x%x\n", global_vector, (polarity ? "high" : "low"), (edge_triggered ? "edge" : "level"), vector); /* program the IOSAPIC routing table */ @@ -395,51 +500,40 @@ * Note that the irq_base and IOSAPIC address must be set in iosapic_init(). */ int -iosapic_register_platform_irq (u32 int_type, u32 global_vector, u32 iosapic_vector, - u16 eid, u16 id, unsigned long polarity, +iosapic_register_platform_irq (u32 int_type, u32 global_vector, + u32 iosapic_vector, u16 eid, u16 id, unsigned long polarity, unsigned long edge_triggered, u32 base_irq, char *iosapic_address) { - struct hw_interrupt_type *irq_type; - irq_desc_t *idesc; + unsigned char delivery; int vector; switch (int_type) { - case ACPI20_ENTRY_PIS_CPEI: - vector = IA64_PCE_VECTOR; - iosapic_irq[vector].dmode = IOSAPIC_LOWEST_PRIORITY; + case ACPI_INTERRUPT_PMI: + vector = iosapic_vector; + /* + * since PMI vector is alloc'd by FW(ACPI) not by kernel, + * we need to make sure the vector is available + */ + iosapic_reassign_vector(vector); + delivery = IOSAPIC_PMI; break; - case ACPI20_ENTRY_PIS_INIT: + case ACPI_INTERRUPT_INIT: vector = ia64_alloc_irq(); - iosapic_irq[vector].dmode = IOSAPIC_INIT; + delivery = IOSAPIC_INIT; + break; + case ACPI_INTERRUPT_CPEI: + vector = IA64_PCE_VECTOR; + delivery = IOSAPIC_LOWEST_PRIORITY; break; default: printk("iosapic_register_platform_irq(): invalid int type\n"); return -1; } - /* fill in information from this vector's IOSAPIC */ - iosapic_irq[vector].addr = iosapic_address; - iosapic_irq[vector].base_irq = base_irq; - iosapic_irq[vector].pin = global_vector - iosapic_irq[vector].base_irq; - iosapic_irq[vector].polarity = polarity ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW; - - if (edge_triggered) { - iosapic_irq[vector].trigger = IOSAPIC_EDGE; - irq_type = &irq_type_iosapic_edge; - } else { - iosapic_irq[vector].trigger = IOSAPIC_LEVEL; - irq_type = &irq_type_iosapic_level; - } - - idesc = irq_desc(vector); - if (idesc->handler != irq_type) { - if (idesc->handler != &no_irq_type) - printk("iosapic_register_platform_irq(): changing vector 0x%02x from" - "%s to %s\n", vector, idesc->handler->typename, irq_type->typename); - idesc->handler = irq_type; - } + register_irq(global_vector, vector, global_vector - base_irq, delivery, polarity, + edge_triggered, base_irq, iosapic_address); - printk("PLATFORM int %x: IOSAPIC %x(%s,%s) -> Vector %x CPU %.02u:%.02u\n", + printk("PLATFORM int 0x%x: IOSAPIC 0x%x(%s,%s) -> Vector 0x%x CPU %.02u:%.02u\n", int_type, global_vector, (polarity ? "high" : "low"), (edge_triggered ? "edge" : "level"), vector, eid, id); @@ -450,15 +544,18 @@ /* - * ACPI calls this when it finds an entry for a legacy ISA interrupt. Note that the - * irq_base and IOSAPIC address must be set in iosapic_init(). + * ACPI calls this when it finds an entry for a legacy ISA interrupt. + * Note that the irq_base and IOSAPIC address must be set in iosapic_init(). */ void iosapic_register_legacy_irq (unsigned long irq, unsigned long pin, unsigned long polarity, unsigned long edge_triggered) { - unsigned int vector = isa_irq_to_vector(irq); + int vector = isa_irq_to_vector(irq); + + register_irq(irq, vector, (int)pin, IOSAPIC_LOWEST_PRIORITY, polarity, edge_triggered, + 0, NULL); /* ignored for override */ #ifdef DEBUG_IRQ_ROUTING printk("ISA: IRQ %u -> IOSAPIC irq 0x%02x (%s, %s) -> vector %02x\n", @@ -467,43 +564,48 @@ vector); #endif - iosapic_irq[vector].pin = pin; - iosapic_irq[vector].dmode = IOSAPIC_LOWEST_PRIORITY; - iosapic_irq[vector].polarity = polarity ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW; - iosapic_irq[vector].trigger = edge_triggered ? IOSAPIC_EDGE : IOSAPIC_LEVEL; + /* program the IOSAPIC routing table */ + set_rte(vector, (ia64_get_lid() >> 16) & 0xffff); } void __init iosapic_init (unsigned long phys_addr, unsigned int base_irq, int pcat_compat) { - struct hw_interrupt_type *irq_type; - int i, irq, max_pin, vector; - irq_desc_t *idesc; + int irq, max_pin, vector, pin; unsigned int ver; char *addr; static int first_time = 1; if (first_time) { first_time = 0; - for (vector = 0; vector < IA64_NUM_VECTORS; ++vector) iosapic_irq[vector].pin = -1; /* mark as unused */ + } + if (pcat_compat) { /* - * Fetch the PCI interrupt routing table: + * Disable the compatibility mode interrupts (8259 style), needs IN/OUT support + * enabled. */ - acpi_cf_get_pci_vectors(&pci_irq.route, &pci_irq.num_routes); + printk("%s: Disabling PC-AT compatible 8259 interrupts\n", __FUNCTION__); + outb(0xff, 0xA1); + outb(0xff, 0x21); } addr = ioremap(phys_addr, 0); - ver = iosapic_version(addr); max_pin = (ver >> 16) & 0xff; + iosapic_lists[num_iosapic].addr = addr; + iosapic_lists[num_iosapic].pcat_compat = pcat_compat; + iosapic_lists[num_iosapic].base_irq = base_irq; + iosapic_lists[num_iosapic].max_pin = max_pin; + num_iosapic++; + printk("IOSAPIC: version %x.%x, address 0x%lx, IRQs 0x%02x-0x%02x\n", (ver & 0xf0) >> 4, (ver & 0x0f), phys_addr, base_irq, base_irq + max_pin); - if ((base_irq == 0) && pcat_compat) + if ((base_irq == 0) && pcat_compat) { /* * Map the legacy ISA devices into the IOSAPIC data. Some of these may * get reprogrammed later on with data from the ACPI Interrupt Source @@ -511,36 +613,53 @@ */ for (irq = 0; irq < 16; ++irq) { vector = isa_irq_to_vector(irq); - iosapic_irq[vector].addr = addr; - iosapic_irq[vector].base_irq = 0; - if (iosapic_irq[vector].pin == -1) - iosapic_irq[vector].pin = irq; - iosapic_irq[vector].dmode = IOSAPIC_LOWEST_PRIORITY; - iosapic_irq[vector].trigger = IOSAPIC_EDGE; - iosapic_irq[vector].polarity = IOSAPIC_POL_HIGH; + if ((pin = iosapic_irq[vector].pin) == -1) + pin = irq; + + register_irq(irq, vector, pin, + /* IOSAPIC_POL_HIGH, IOSAPIC_EDGE */ + IOSAPIC_LOWEST_PRIORITY, 1, 1, base_irq, addr); + #ifdef DEBUG_IRQ_ROUTING printk("ISA: IRQ %u -> IOSAPIC irq 0x%02x (high, edge) -> vector 0x%02x\n", irq, iosapic_irq[vector].base_irq + iosapic_irq[vector].pin, vector); #endif - irq_type = &irq_type_iosapic_edge; - idesc = irq_desc(vector); - if (idesc->handler != irq_type) { - if (idesc->handler != &no_irq_type) - printk("iosapic_init: changing vector 0x%02x from %s to " - "%s\n", irq, idesc->handler->typename, - irq_type->typename); - idesc->handler = irq_type; - } /* program the IOSAPIC routing table: */ set_rte(vector, (ia64_get_lid() >> 16) & 0xffff); } + } +} + +void __init +iosapic_init_pci_irq (void) +{ + int i, index, vector, pin; + int base_irq, max_pin, pcat_compat; + unsigned int irq; + char *addr; + + if (0 != acpi_get_prt(&pci_irq.route, &pci_irq.num_routes)) + return; for (i = 0; i < pci_irq.num_routes; i++) { + irq = pci_irq.route[i].irq; - if ((unsigned) (irq - base_irq) > max_pin) + index = find_iosapic(irq); + if (index < 0) { + printk("PCI: IRQ %u has no IOSAPIC mapping\n", irq); + continue; + } + + addr = iosapic_lists[index].addr; + base_irq = iosapic_lists[index].base_irq; + max_pin = iosapic_lists[index].max_pin; + pcat_compat = iosapic_lists[index].pcat_compat; + pin = irq - base_irq; + + if ((unsigned) pin > max_pin) /* the interrupt route is for another controller... */ continue; @@ -553,29 +672,17 @@ vector = ia64_alloc_irq(); } - iosapic_irq[vector].addr = addr; - iosapic_irq[vector].base_irq = base_irq; - iosapic_irq[vector].pin = (irq - base_irq); - iosapic_irq[vector].dmode = IOSAPIC_LOWEST_PRIORITY; - iosapic_irq[vector].trigger = IOSAPIC_LEVEL; - iosapic_irq[vector].polarity = IOSAPIC_POL_LOW; + register_irq(irq, vector, pin, IOSAPIC_LOWEST_PRIORITY, 0, 0, base_irq, addr); -# ifdef DEBUG_IRQ_ROUTING +#ifdef DEBUG_IRQ_ROUTING printk("PCI: (B%d,I%d,P%d) -> IOSAPIC irq 0x%02x -> vector 0x%02x\n", pci_irq.route[i].bus, pci_irq.route[i].pci_id>>16, pci_irq.route[i].pin, iosapic_irq[vector].base_irq + iosapic_irq[vector].pin, vector); -# endif - irq_type = &irq_type_iosapic_level; - idesc = irq_desc(vector); - if (idesc->handler != irq_type){ - if (idesc->handler != &no_irq_type) - printk("iosapic_init: changing vector 0x%02x from %s to %s\n", - vector, idesc->handler->typename, irq_type->typename); - idesc->handler = irq_type; - } - - /* program the IOSAPIC routing table: */ - set_rte(vector, (ia64_get_lid() >> 16) & 0xffff); +#endif + /* + * NOTE: The IOSAPIC RTE will be programmed in iosapic_pci_fixup(). It + * needs to be done there to ensure PCI hotplug works right. + */ } } @@ -585,6 +692,13 @@ struct pci_dev *dev; unsigned char pin; int vector; + struct hw_interrupt_type *irq_type; + irq_desc_t *idesc; + + if (phase == 0) { + iosapic_init_pci_irq(); + return; + } if (phase != 1) return; @@ -611,19 +725,28 @@ if (vector >= 0) printk(KERN_WARNING "PCI: using PPB(B%d,I%d,P%d) to get vector %02x\n", - bridge->bus->number, PCI_SLOT(bridge->devfn), + dev->bus->number, PCI_SLOT(dev->devfn), pin, vector); else printk(KERN_WARNING - "PCI: Couldn't map irq for (B%d,I%d,P%d)o\n", - bridge->bus->number, PCI_SLOT(bridge->devfn), - pin); + "PCI: Couldn't map irq for (B%d,I%d,P%d)\n", + dev->bus->number, PCI_SLOT(dev->devfn), pin); } if (vector >= 0) { printk("PCI->APIC IRQ transform: (B%d,I%d,P%d) -> 0x%02x\n", dev->bus->number, PCI_SLOT(dev->devfn), pin, vector); dev->irq = vector; + irq_type = &irq_type_iosapic_level; + idesc = irq_desc(vector); + if (idesc->handler != irq_type) { + if (idesc->handler != &no_irq_type) + printk("iosapic_pci_fixup: changing vector 0x%02x " + "from %s to %s\n", vector, + idesc->handler->typename, + irq_type->typename); + idesc->handler = irq_type; + } #ifdef CONFIG_SMP /* * For platforms that do not support interrupt redirect @@ -638,7 +761,16 @@ cpu_index++; if (cpu_index >= smp_num_cpus) cpu_index = 0; + } else { + /* + * Direct the interrupt vector to the current cpu, + * platform redirection will distribute them. + */ + set_rte(vector, (ia64_get_lid() >> 16) & 0xffff); } +#else + /* direct the interrupt vector to the running cpu id */ + set_rte(vector, (ia64_get_lid() >> 16) & 0xffff); #endif } } diff -urN linux-2.4.18/arch/ia64/kernel/irq.c lia64-2.4/arch/ia64/kernel/irq.c --- linux-2.4.18/arch/ia64/kernel/irq.c Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/kernel/irq.c Fri May 3 15:48:56 2002 @@ -67,6 +67,27 @@ irq_desc_t _irq_desc[NR_IRQS] __cacheline_aligned = { [0 ... NR_IRQS-1] = { IRQ_DISABLED, &no_irq_type, NULL, 0, SPIN_LOCK_UNLOCKED}}; +#ifdef CONFIG_IA64_GENERIC +struct irq_desc * +__ia64_irq_desc (unsigned int irq) +{ + return _irq_desc + irq; +} + +ia64_vector +__ia64_irq_to_vector (unsigned int irq) +{ + return (ia64_vector) irq; +} + +unsigned int +__ia64_local_vector_to_irq (ia64_vector vec) +{ + return (unsigned int) vec; +} + +#endif + static void register_irq_proc (unsigned int irq); /* @@ -287,10 +308,11 @@ * already executing in one.. */ if (!irqs_running()) - if (local_bh_count() || !spin_is_locked(&global_bh_lock)) + if (really_local_bh_count() || !spin_is_locked(&global_bh_lock)) break; /* Duh, we have to loop. Release the lock to avoid deadlocks */ + smp_mb__before_clear_bit(); /* need barrier before releasing lock... */ clear_bit(0,&global_irq_lock); for (;;) { @@ -305,7 +327,7 @@ continue; if (global_irq_lock) continue; - if (!local_bh_count() && spin_is_locked(&global_bh_lock)) + if (!really_local_bh_count() && spin_is_locked(&global_bh_lock)) continue; if (!test_and_set_bit(0,&global_irq_lock)) break; @@ -378,14 +400,14 @@ __save_flags(flags); if (flags & IA64_PSR_I) { __cli(); - if (!local_irq_count()) + if (!really_local_irq_count()) get_irqlock(); } #else __save_flags(flags); if (flags & (1 << EFLAGS_IF_SHIFT)) { __cli(); - if (!local_irq_count()) + if (!really_local_irq_count()) get_irqlock(); } #endif @@ -393,7 +415,7 @@ void __global_sti(void) { - if (!local_irq_count()) + if (!really_local_irq_count()) release_irqlock(smp_processor_id()); __sti(); } @@ -422,7 +444,7 @@ retval = 2 + local_enabled; /* check for global flags if we're not in an interrupt */ - if (!local_irq_count()) { + if (!really_local_irq_count()) { if (local_enabled) retval = 1; if (global_irq_holder == cpu) @@ -529,7 +551,7 @@ disable_irq_nosync(irq); #ifdef CONFIG_SMP - if (!local_irq_count()) { + if (!really_local_irq_count()) { do { barrier(); } while (irq_desc(irq)->status & IRQ_INPROGRESS); @@ -1009,6 +1031,11 @@ rand_initialize_irq(irq); } + if (new->flags & SA_PERCPU_IRQ) { + desc->status |= IRQ_PER_CPU; + desc->handler = &irq_type_ia64_lsapic; + } + /* * The following block of code has to be executed atomically */ @@ -1089,13 +1116,25 @@ static struct proc_dir_entry * smp_affinity_entry [NR_IRQS]; static unsigned long irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL }; +static char irq_redir [NR_IRQS]; // = { [0 ... NR_IRQS-1] = 1 }; + +void set_irq_affinity_info(int irq, int hwid, int redir) +{ + unsigned long mask = 1UL<= 0 && irq < NR_IRQS) { + irq_affinity[irq] = mask; + irq_redir[irq] = (char) (redir & 0xff); + } +} static int irq_affinity_read_proc (char *page, char **start, off_t off, int count, int *eof, void *data) { - if (count < HEX_DIGITS+1) + if (count < HEX_DIGITS+3) return -EINVAL; - return sprintf (page, "%08lx\n", irq_affinity[(long)data]); + return sprintf (page, "%s%08lx\n", irq_redir[(long)data] ? "r " : "", + irq_affinity[(long)data]); } static int irq_affinity_write_proc (struct file *file, const char *buffer, @@ -1103,11 +1142,20 @@ { int irq = (long) data, full_count = count, err; unsigned long new_value; + const char *buf = buffer; + int redir; if (!irq_desc(irq)->handler->set_affinity) return -EIO; - err = parse_hex_value(buffer, count, &new_value); + if (buf[0] == 'r' || buf[0] == 'R') { + ++buf; + while (*buf == ' ') ++buf; + redir = 1; + } else + redir = 0; + + err = parse_hex_value(buf, count, &new_value); /* * Do not allow disabling IRQs completely - it's a too easy @@ -1117,8 +1165,7 @@ if (!(new_value & cpu_online_map)) return -EINVAL; - irq_affinity[irq] = new_value; - irq_desc(irq)->handler->set_affinity(irq, new_value); + irq_desc(irq)->handler->set_affinity(irq | (redir?(1<<31):0), new_value); return full_count; } @@ -1154,7 +1201,7 @@ { char name [MAX_NAMELEN]; - if (!root_irq_dir || (irq_desc(irq)->handler == &no_irq_type)) + if (!root_irq_dir || (irq_desc(irq)->handler == &no_irq_type) || irq_dir[irq]) return; memset(name, 0, MAX_NAMELEN); diff -urN linux-2.4.18/arch/ia64/kernel/irq_ia64.c lia64-2.4/arch/ia64/kernel/irq_ia64.c --- linux-2.4.18/arch/ia64/kernel/irq_ia64.c Mon Nov 26 11:18:20 2001 +++ lia64-2.4/arch/ia64/kernel/irq_ia64.c Mon Jul 8 14:20:21 2002 @@ -36,6 +36,10 @@ #include #include +#ifdef CONFIG_PERFMON +# include +#endif + #define IRQ_DEBUG 0 /* default base addr of IPI table */ @@ -50,6 +54,11 @@ 0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21 }; +/* + * GSI to IA-64 vector translation table. + */ +__u8 gsi_to_vector_map[255]; + int ia64_alloc_irq (void) { @@ -172,6 +181,9 @@ register_percpu_irq(IA64_SPURIOUS_INT_VECTOR, NULL); #ifdef CONFIG_SMP register_percpu_irq(IA64_IPI_VECTOR, &ipi_irqaction); +#endif +#ifdef CONFIG_PERFMON + perfmon_init_percpu(); #endif platform_irq_init(); } diff -urN linux-2.4.18/arch/ia64/kernel/ivt.S lia64-2.4/arch/ia64/kernel/ivt.S --- linux-2.4.18/arch/ia64/kernel/ivt.S Mon Nov 26 11:18:21 2001 +++ lia64-2.4/arch/ia64/kernel/ivt.S Thu Apr 25 15:52:10 2002 @@ -126,7 +126,7 @@ ;; (p7) dep r17=r17,r19,(PAGE_SHIFT-3),3 // put region number bits in place srlz.d // ensure "rsm psr.dt" has taken effect -(p6) movl r19=__pa(SWAPPER_PGD_ADDR) // region 5 is rooted at swapper_pg_dir +(p6) movl r19=__pa(swapper_pg_dir) // region 5 is rooted at swapper_pg_dir (p6) shr.u r21=r21,PGDIR_SHIFT+PAGE_SHIFT (p7) shr.u r21=r21,PGDIR_SHIFT+PAGE_SHIFT-3 ;; @@ -275,6 +275,7 @@ mov r16=cr.ifa // get address that caused the TLB miss movl r17=PAGE_KERNEL mov r21=cr.ipsr + movl r19=(((1 << IA64_MAX_PHYS_BITS) - 1) & ~0xfff) mov r31=pr ;; #ifdef CONFIG_DISABLE_VHPT @@ -289,12 +290,12 @@ (p8) br.cond.dptk itlb_fault #endif extr.u r23=r21,IA64_PSR_CPL0_BIT,2 // extract psr.cpl + and r19=r19,r16 // clear ed, reserved bits, and PTE control bits shr.u r18=r16,57 // move address bit 61 to bit 4 - dep r19=0,r16,IA64_MAX_PHYS_BITS,(64-IA64_MAX_PHYS_BITS) // clear ed & reserved bits ;; andcm r18=0x10,r18 // bit 4=~address-bit(61) cmp.ne p8,p0=r0,r23 // psr.cpl != 0? - dep r19=r17,r19,0,12 // insert PTE control bits into r19 + or r19=r17,r19 // insert PTE control bits into r19 ;; or r19=r19,r18 // set bit 4 (uncached) if the access was to region 6 (p8) br.cond.spnt page_fault @@ -312,6 +313,7 @@ mov r16=cr.ifa // get address that caused the TLB miss movl r17=PAGE_KERNEL mov r20=cr.isr + movl r19=(((1 << IA64_MAX_PHYS_BITS) - 1) & ~0xfff) mov r21=cr.ipsr mov r31=pr ;; @@ -327,16 +329,19 @@ (p8) br.cond.dptk dtlb_fault #endif extr.u r23=r21,IA64_PSR_CPL0_BIT,2 // extract psr.cpl + and r22=IA64_ISR_CODE_MASK,r20 // get the isr.code field tbit.nz p6,p7=r20,IA64_ISR_SP_BIT // is speculation bit on? - shr.u r18=r16,57 // move address bit 61 to bit 4 - dep r19=0,r16,IA64_MAX_PHYS_BITS,(64-IA64_MAX_PHYS_BITS) // clear ed & reserved bits + shr.u r18=r16,57 // move address bit 61 to bit 4 + and r19=r19,r16 // clear ed, reserved bits, and PTE control bits + tbit.nz p9,p0=r20,IA64_ISR_NA_BIT // is non-access bit on? ;; andcm r18=0x10,r18 // bit 4=~address-bit(61) cmp.ne p8,p0=r0,r23 +(p9) cmp.eq.or.andcm p6,p7=IA64_ISR_CODE_LFETCH,r22 // check isr.code field (p8) br.cond.spnt page_fault dep r21=-1,r21,IA64_PSR_ED_BIT,1 - dep r19=r17,r19,0,12 // insert PTE control bits into r19 + or r19=r19,r17 // insert PTE control bits into r19 ;; or r19=r19,r18 // set bit 4 (uncached) if the access was to region 6 (p6) mov cr.ipsr=r21 @@ -410,7 +415,7 @@ ;; (p7) dep r17=r17,r19,(PAGE_SHIFT-3),3 // put region number bits in place srlz.d -(p6) movl r19=__pa(SWAPPER_PGD_ADDR) // region 5 is rooted at swapper_pg_dir +(p6) movl r19=__pa(swapper_pg_dir) // region 5 is rooted at swapper_pg_dir (p6) shr.u r21=r21,PGDIR_SHIFT+PAGE_SHIFT (p7) shr.u r21=r21,PGDIR_SHIFT+PAGE_SHIFT-3 ;; diff -urN linux-2.4.18/arch/ia64/kernel/machvec.c lia64-2.4/arch/ia64/kernel/machvec.c --- linux-2.4.18/arch/ia64/kernel/machvec.c Thu Jan 4 12:50:17 2001 +++ lia64-2.4/arch/ia64/kernel/machvec.c Thu Jun 20 00:04:28 2002 @@ -11,8 +11,8 @@ struct ia64_machine_vector ia64_mv; /* - * Most platforms use this routine for mapping page frame addresses - * into a memory map index. + * Most platforms use this routine for mapping page frame addresses into a memory map + * index. */ unsigned long map_nr_dense (unsigned long addr) diff -urN linux-2.4.18/arch/ia64/kernel/mca.c lia64-2.4/arch/ia64/kernel/mca.c --- linux-2.4.18/arch/ia64/kernel/mca.c Mon Nov 26 11:18:21 2001 +++ lia64-2.4/arch/ia64/kernel/mca.c Sat Jun 22 00:52:58 2002 @@ -3,6 +3,12 @@ * Purpose: Generic MCA handling layer * * Updated for latest kernel + * Copyright (C) 2002 Dell Computer Corporation + * Copyright (C) Matt Domsch (Matt_Domsch@dell.com) + * + * Copyright (C) 2002 Intel + * Copyright (C) Jenna Hall (jenna.s.hall@intel.com) + * * Copyright (C) 2001 Intel * Copyright (C) Fred Lewis (frederick.v.lewis@intel.com) * @@ -12,6 +18,13 @@ * Copyright (C) 1999 Silicon Graphics, Inc. * Copyright (C) Vijay Chander(vijay@engr.sgi.com) * + * 02/03/25 M. Domsch GUID cleanups + * + * 02/01/04 J. Hall Aligned MCA stack to 16 bytes, added platform vs. CPU + * error flag, set SAL default return values, changed + * error record structure to linked list, added init call + * to sal_get_state_info_size(). + * * 01/01/03 F. Lewis Added setup of CMCI and CPEI IRQs, logging of corrected * platform errors, completed code for logging of * corrected & uncorrected machine check errors, and @@ -27,6 +40,8 @@ #include #include #include +#include +#include #include #include @@ -37,7 +52,6 @@ #include #include -#include #undef MCA_PRT_XTRA_DATA @@ -50,18 +64,22 @@ ia64_mca_sal_to_os_state_t ia64_sal_to_os_handoff_state; ia64_mca_os_to_sal_state_t ia64_os_to_sal_handoff_state; u64 ia64_mca_proc_state_dump[512]; -u64 ia64_mca_stack[1024]; +u64 ia64_mca_stack[1024] __attribute__((aligned(16))); u64 ia64_mca_stackframe[32]; u64 ia64_mca_bspstore[1024]; u64 ia64_init_stack[INIT_TASK_SIZE] __attribute__((aligned(16))); +u64 ia64_mca_sal_data_area[1356]; +u64 ia64_mca_min_state_save_info; +u64 ia64_tlb_functional; +u64 ia64_os_mca_recovery_successful; static void ia64_mca_wakeup_ipi_wait(void); static void ia64_mca_wakeup(int cpu); static void ia64_mca_wakeup_all(void); static void ia64_log_init(int); -extern void ia64_monarch_init_handler (void); -extern void ia64_slave_init_handler (void); -extern struct hw_interrupt_type irq_type_iosapic_level; +extern void ia64_monarch_init_handler (void); +extern void ia64_slave_init_handler (void); +extern struct hw_interrupt_type irq_type_iosapic_level; static struct irqaction cmci_irqaction = { handler: ia64_mca_cmc_int_handler, @@ -95,25 +113,31 @@ * memory. * * Inputs : sal_info_type (Type of error record MCA/CMC/CPE/INIT) - * Outputs : None + * Outputs : platform error status */ -void +int ia64_mca_log_sal_error_record(int sal_info_type) { + int platform_err = 0; + /* Get the MCA error record */ if (!ia64_log_get(sal_info_type, (prfunc_t)printk)) - return; // no record retrieved + return platform_err; // no record retrieved - /* Log the error record */ - ia64_log_print(sal_info_type, (prfunc_t)printk); + /* TODO: + * 1. analyze error logs to determine recoverability + * 2. perform error recovery procedures, if applicable + * 3. set ia64_os_mca_recovery_successful flag, if applicable + */ - /* Clear the CMC SAL logs now that they have been logged */ + platform_err = ia64_log_print(sal_info_type, (prfunc_t)printk); ia64_sal_clear_state_info(sal_info_type); + + return platform_err; } /* - * hack for now, add platform dependent handlers - * here + * platform dependent error handling */ #ifndef PLATFORM_MCA_HANDLERS void @@ -275,8 +299,8 @@ cmcv_reg_t cmcv; cmcv.cmcv_regval = 0; - cmcv.cmcv_mask = 0; /* Unmask/enable interrupt */ - cmcv.cmcv_vector = IA64_CMC_VECTOR; + cmcv.cmcv_mask = 0; /* Unmask/enable interrupt */ + cmcv.cmcv_vector = IA64_CMC_VECTOR; ia64_set_cmcv(cmcv.cmcv_regval); IA64_MCA_DEBUG("ia64_mca_platform_init: CPU %d corrected " @@ -329,17 +353,15 @@ verify_guid (efi_guid_t *test, efi_guid_t *target) { int rc; +#ifdef IA64_MCA_DEBUG_INFO + char out[40]; +#endif - if ((rc = memcmp((void *)test, (void *)target, sizeof(efi_guid_t)))) { - IA64_MCA_DEBUG("ia64_mca_print: invalid guid = " - "{ %08x, %04x, %04x, { %#02x, %#02x, %#02x, %#02x, " - "%#02x, %#02x, %#02x, %#02x, } } \n ", - test->data1, test->data2, test->data3, test->data4[0], - test->data4[1], test->data4[2], test->data4[3], - test->data4[4], test->data4[5], test->data4[6], - test->data4[7]); + if ((rc = efi_guidcmp(*test, *target))) { + IA64_MCA_DEBUG(KERN_DEBUG + "verify_guid: invalid GUID = %s\n", + efi_guid_unparse(test, out)); } - return rc; } @@ -374,6 +396,9 @@ IA64_MCA_DEBUG("ia64_mca_init: begin\n"); + /* initialize recovery success indicator */ + ia64_os_mca_recovery_successful = 0; + /* Clear the Rendez checkin flag for all cpus */ for(i = 0 ; i < NR_CPUS; i++) ia64_mc_info.imi_rendez_checkin[i] = IA64_MCA_RENDEZ_CHECKIN_NOTDONE; @@ -459,7 +484,7 @@ /* * Configure the CMCI vector and handler. Interrupts for CMC are - * per-processor, so AP CMC interrupts are setup in smp_callin() (smp.c). + * per-processor, so AP CMC interrupts are setup in smp_callin() (smpboot.c). */ register_percpu_irq(IA64_CMC_VECTOR, &cmci_irqaction); ia64_mca_cmc_vector_setup(); /* Setup vector on BSP & enable */ @@ -474,7 +499,7 @@ { irq_desc_t *desc; unsigned int irq; - int cpev = acpi_request_vector(ACPI20_ENTRY_PIS_CPEI); + int cpev = acpi_request_vector(ACPI_INTERRUPT_CPEI); if (cpev >= 0) { for (irq = 0; irq < NR_IRQS; ++irq) @@ -498,6 +523,9 @@ ia64_log_init(SAL_INFO_TYPE_CMC); ia64_log_init(SAL_INFO_TYPE_CPE); + /* Zero the min state save info */ + ia64_mca_min_state_save_info = 0; + #if defined(MCA_TEST) mca_test(); #endif /* #if defined(MCA_TEST) */ @@ -576,7 +604,7 @@ int cpu; /* Clear the Rendez checkin flag for all cpus */ - for(cpu = 0 ; cpu < smp_num_cpus; cpu++) + for(cpu = 0; cpu < smp_num_cpus; cpu++) if (ia64_mc_info.imi_rendez_checkin[cpu] == IA64_MCA_RENDEZ_CHECKIN_DONE) ia64_mca_wakeup(cpu); @@ -668,6 +696,13 @@ /* Cold Boot for uncorrectable MCA */ ia64_os_to_sal_handoff_state.imots_os_status = IA64_MCA_COLD_BOOT; + + /* Default = tell SAL to return to same context */ + ia64_os_to_sal_handoff_state.imots_context = IA64_MCA_SAME_CONTEXT; + + /* Register pointer to new min state values */ + /* NOTE: need to do something with this during recovery phase */ + ia64_os_to_sal_handoff_state.imots_new_min_state = &ia64_mca_min_state_save_info; } /* @@ -678,10 +713,10 @@ * This is the place where the core of OS MCA handling is done. * Right now the logs are extracted and displayed in a well-defined * format. This handler code is supposed to be run only on the - * monarch processor. Once the monarch is done with MCA handling + * monarch processor. Once the monarch is done with MCA handling * further MCA logging is enabled by clearing logs. * Monarch also has the duty of sending wakeup-IPIs to pull the - * slave processors out of rendezvous spinloop. + * slave processors out of rendezvous spinloop. * * Inputs : None * Outputs : None @@ -689,20 +724,16 @@ void ia64_mca_ucmc_handler(void) { -#if 0 /* stubbed out @FVL */ - /* - * Attempting to log a DBE error Causes "reserved register/field panic" - * in printk. - */ + int platform_err = 0; /* Get the MCA error record and log it */ - ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA); -#endif /* stubbed out @FVL */ + platform_err = ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA); /* * Do Platform-specific mca error handling if required. */ - mca_handler_platform() ; + if (platform_err) + mca_handler_platform(); /* * Wakeup all the processors which are spinning in the rendezvous @@ -749,13 +780,16 @@ { spinlock_t isl_lock; int isl_index; - ia64_err_rec_t isl_log[IA64_MAX_LOGS]; /* need space to store header + error log */ + ia64_err_rec_t *isl_log[IA64_MAX_LOGS]; /* need space to store header + error log */ } ia64_state_log_t; static ia64_state_log_t ia64_state_log[IA64_MAX_LOG_TYPES]; -/* Note: Some of these macros assume IA64_MAX_LOGS is always 2. Should be */ -/* fixed. @FVL */ +#define IA64_LOG_ALLOCATE(it, size) \ + {ia64_state_log[it].isl_log[IA64_LOG_CURR_INDEX(it)] = \ + (ia64_err_rec_t *)alloc_bootmem(size); \ + ia64_state_log[it].isl_log[IA64_LOG_NEXT_INDEX(it)] = \ + (ia64_err_rec_t *)alloc_bootmem(size);} #define IA64_LOG_LOCK_INIT(it) spin_lock_init(&ia64_state_log[it].isl_lock) #define IA64_LOG_LOCK(it) spin_lock_irqsave(&ia64_state_log[it].isl_lock, s) #define IA64_LOG_UNLOCK(it) spin_unlock_irqrestore(&ia64_state_log[it].isl_lock,s) @@ -765,13 +799,13 @@ ia64_state_log[it].isl_index = 1 - ia64_state_log[it].isl_index #define IA64_LOG_INDEX_DEC(it) \ ia64_state_log[it].isl_index = 1 - ia64_state_log[it].isl_index -#define IA64_LOG_NEXT_BUFFER(it) (void *)(&(ia64_state_log[it].isl_log[IA64_LOG_NEXT_INDEX(it)])) -#define IA64_LOG_CURR_BUFFER(it) (void *)(&(ia64_state_log[it].isl_log[IA64_LOG_CURR_INDEX(it)])) +#define IA64_LOG_NEXT_BUFFER(it) (void *)((ia64_state_log[it].isl_log[IA64_LOG_NEXT_INDEX(it)])) +#define IA64_LOG_CURR_BUFFER(it) (void *)((ia64_state_log[it].isl_log[IA64_LOG_CURR_INDEX(it)])) /* * C portion of the OS INIT handler * - * Called from ia64__init_handler + * Called from ia64_monarch_init_handler * * Inputs: pointer to pt_regs where processor info was saved. * @@ -825,11 +859,8 @@ void ia64_log_prt_guid (efi_guid_t *p_guid, prfunc_t prfunc) { - printk("GUID = { %08x, %04x, %04x, { %#02x, %#02x, %#02x, %#02x, " - "%#02x, %#02x, %#02x, %#02x, } } \n ", p_guid->data1, - p_guid->data2, p_guid->data3, p_guid->data4[0], p_guid->data4[1], - p_guid->data4[2], p_guid->data4[3], p_guid->data4[4], - p_guid->data4[5], p_guid->data4[6], p_guid->data4[7]); + char out[40]; + printk(KERN_DEBUG "GUID = %s\n", efi_guid_unparse(p_guid, out)); } static void @@ -885,10 +916,18 @@ void ia64_log_init(int sal_info_type) { - IA64_LOG_LOCK_INIT(sal_info_type); + u64 max_size = 0; + IA64_LOG_NEXT_INDEX(sal_info_type) = 0; - memset(IA64_LOG_NEXT_BUFFER(sal_info_type), 0, - sizeof(ia64_err_rec_t) * IA64_MAX_LOGS); + IA64_LOG_LOCK_INIT(sal_info_type); + + // SAL will tell us the maximum size of any error record of this type + max_size = ia64_sal_get_state_info_size(sal_info_type); + + // set up OS data structures to hold error info + IA64_LOG_ALLOCATE(sal_info_type, max_size); + memset(IA64_LOG_CURR_BUFFER(sal_info_type), 0, max_size); + memset(IA64_LOG_NEXT_BUFFER(sal_info_type), 0, max_size); } /* @@ -923,8 +962,7 @@ return total_len; } else { IA64_LOG_UNLOCK(sal_info_type); - prfunc("ia64_log_get: Failed to retrieve SAL error record type %d\n", - sal_info_type); + prfunc("ia64_log_get: No SAL error record available for type %d\n", sal_info_type); return 0; } } @@ -1268,7 +1306,7 @@ } if (mdei->valid.oem_data) { - ia64_log_prt_oem_data((int)mdei->header.len, + platform_mem_dev_err_print((int)mdei->header.len, (int)sizeof(sal_log_mem_dev_err_info_t) - 1, &(mdei->oem_data[0]), prfunc); } @@ -1357,7 +1395,7 @@ prfunc("\n"); if (pbei->valid.oem_data) { - ia64_log_prt_oem_data((int)pbei->header.len, + platform_pci_bus_err_print((int)pbei->header.len, (int)sizeof(sal_log_pci_bus_err_info_t) - 1, &(pbei->oem_data[0]), prfunc); } @@ -1456,7 +1494,7 @@ } } if (pcei->valid.oem_data) { - ia64_log_prt_oem_data((int)pcei->header.len, n_pci_data, + platform_pci_comp_err_print((int)pcei->header.len, n_pci_data, p_oem_data, prfunc); prfunc("\n"); } @@ -1485,7 +1523,7 @@ ia64_log_prt_guid(&psei->guid, prfunc); } if (psei->valid.oem_data) { - ia64_log_prt_oem_data((int)psei->header.len, + platform_plat_specific_err_print((int)psei->header.len, (int)sizeof(sal_log_plat_specific_err_info_t) - 1, &(psei->oem_data[0]), prfunc); } @@ -1519,7 +1557,7 @@ if (hcei->valid.bus_spec_data) prfunc(" Bus Specific Data: %#lx", hcei->bus_spec_data); if (hcei->valid.oem_data) { - ia64_log_prt_oem_data((int)hcei->header.len, + platform_host_ctlr_err_print((int)hcei->header.len, (int)sizeof(sal_log_host_ctlr_err_info_t) - 1, &(hcei->oem_data[0]), prfunc); } @@ -1553,7 +1591,7 @@ if (pbei->valid.bus_spec_data) prfunc(" Bus Specific Data: %#lx", pbei->bus_spec_data); if (pbei->valid.oem_data) { - ia64_log_prt_oem_data((int)pbei->header.len, + platform_plat_bus_err_print((int)pbei->header.len, (int)sizeof(sal_log_plat_bus_err_info_t) - 1, &(pbei->oem_data[0]), prfunc); } @@ -1716,7 +1754,7 @@ ia64_log_prt_section_header(slsh, prfunc); #endif // MCA_PRT_XTRA_DATA for test only @FVL - if (verify_guid((void *)&slsh->guid, (void *)&(SAL_PROC_DEV_ERR_SECT_GUID))) { + if (verify_guid(&slsh->guid, &(SAL_PROC_DEV_ERR_SECT_GUID))) { IA64_MCA_DEBUG("ia64_mca_log_print: unsupported record section\n"); continue; } @@ -1745,17 +1783,18 @@ * Inputs : lh (Pointer to the sal error record header with format * specified by the SAL spec). * prfunc (fn ptr of log output function to use) - * Outputs : None + * Outputs : platform error status */ -void +int ia64_log_platform_info_print (sal_log_record_header_t *lh, prfunc_t prfunc) { - sal_log_section_hdr_t *slsh; - int n_sects; - int ercd_pos; + sal_log_section_hdr_t *slsh; + int n_sects; + int ercd_pos; + int platform_err = 0; if (!lh) - return; + return platform_err; #ifdef MCA_PRT_XTRA_DATA // for test only @FVL ia64_log_prt_record_header(lh, prfunc); @@ -1765,7 +1804,7 @@ IA64_MCA_DEBUG("ia64_mca_log_print: " "truncated SAL error record. len = %d\n", lh->len); - return; + return platform_err; } /* Print record header info */ @@ -1796,35 +1835,43 @@ ia64_log_proc_dev_err_info_print((sal_log_processor_info_t *)slsh, prfunc); } else if (efi_guidcmp(slsh->guid, SAL_PLAT_MEM_DEV_ERR_SECT_GUID) == 0) { + platform_err = 1; prfunc("+Platform Memory Device Error Info Section\n"); ia64_log_mem_dev_err_info_print((sal_log_mem_dev_err_info_t *)slsh, prfunc); } else if (efi_guidcmp(slsh->guid, SAL_PLAT_SEL_DEV_ERR_SECT_GUID) == 0) { + platform_err = 1; prfunc("+Platform SEL Device Error Info Section\n"); ia64_log_sel_dev_err_info_print((sal_log_sel_dev_err_info_t *)slsh, prfunc); } else if (efi_guidcmp(slsh->guid, SAL_PLAT_PCI_BUS_ERR_SECT_GUID) == 0) { + platform_err = 1; prfunc("+Platform PCI Bus Error Info Section\n"); ia64_log_pci_bus_err_info_print((sal_log_pci_bus_err_info_t *)slsh, prfunc); } else if (efi_guidcmp(slsh->guid, SAL_PLAT_SMBIOS_DEV_ERR_SECT_GUID) == 0) { + platform_err = 1; prfunc("+Platform SMBIOS Device Error Info Section\n"); ia64_log_smbios_dev_err_info_print((sal_log_smbios_dev_err_info_t *)slsh, prfunc); } else if (efi_guidcmp(slsh->guid, SAL_PLAT_PCI_COMP_ERR_SECT_GUID) == 0) { + platform_err = 1; prfunc("+Platform PCI Component Error Info Section\n"); ia64_log_pci_comp_err_info_print((sal_log_pci_comp_err_info_t *)slsh, prfunc); } else if (efi_guidcmp(slsh->guid, SAL_PLAT_SPECIFIC_ERR_SECT_GUID) == 0) { + platform_err = 1; prfunc("+Platform Specific Error Info Section\n"); ia64_log_plat_specific_err_info_print((sal_log_plat_specific_err_info_t *) slsh, prfunc); } else if (efi_guidcmp(slsh->guid, SAL_PLAT_HOST_CTLR_ERR_SECT_GUID) == 0) { + platform_err = 1; prfunc("+Platform Host Controller Error Info Section\n"); ia64_log_host_ctlr_err_info_print((sal_log_host_ctlr_err_info_t *)slsh, prfunc); } else if (efi_guidcmp(slsh->guid, SAL_PLAT_BUS_ERR_SECT_GUID) == 0) { + platform_err = 1; prfunc("+Platform Bus Error Info Section\n"); ia64_log_plat_bus_err_info_print((sal_log_plat_bus_err_info_t *)slsh, prfunc); @@ -1838,8 +1885,9 @@ n_sects, lh->len); if (!n_sects) { prfunc("No Platform Error Info Sections found\n"); - return; + return platform_err; } + return platform_err; } /* @@ -1849,15 +1897,17 @@ * * Inputs : info_type (SAL_INFO_TYPE_{MCA,INIT,CMC,CPE}) * prfunc (fn ptr of log output function to use) - * Outputs : None + * Outputs : platform error status */ -void +int ia64_log_print(int sal_info_type, prfunc_t prfunc) { + int platform_err = 0; + switch(sal_info_type) { case SAL_INFO_TYPE_MCA: prfunc("+BEGIN HARDWARE ERROR STATE AT MCA\n"); - ia64_log_platform_info_print(IA64_LOG_CURR_BUFFER(sal_info_type), prfunc); + platform_err = ia64_log_platform_info_print(IA64_LOG_CURR_BUFFER(sal_info_type), prfunc); prfunc("+END HARDWARE ERROR STATE AT MCA\n"); break; case SAL_INFO_TYPE_INIT: @@ -1877,4 +1927,5 @@ prfunc("+MCA UNKNOWN ERROR LOG (UNIMPLEMENTED)\n"); break; } + return platform_err; } diff -urN linux-2.4.18/arch/ia64/kernel/mca_asm.S lia64-2.4/arch/ia64/kernel/mca_asm.S --- linux-2.4.18/arch/ia64/kernel/mca_asm.S Mon Nov 26 11:18:21 2001 +++ lia64-2.4/arch/ia64/kernel/mca_asm.S Fri May 31 13:18:48 2002 @@ -7,6 +7,12 @@ // 00/03/29 cfleck Added code to save INIT handoff state in pt_regs format, switch to temp // kstack, switch modes, jump to C INIT handler // +// 02/01/04 J.Hall +// Before entering virtual mode code: +// 1. Check for TLB CPU error +// 2. Restore current thread pointer to kr6 +// 3. Move stack ptr 16 bytes to conform to C calling convention +// #include #include @@ -21,10 +27,21 @@ */ #define MINSTATE_PHYS /* Make sure stack access is physical for MINSTATE */ +/* + * Needed for ia64_sal call + */ +#define SAL_GET_STATE_INFO 0x01000001 + +/* + * Needed for return context to SAL + */ +#define IA64_MCA_SAME_CONTEXT 0x0 +#define IA64_MCA_COLD_BOOT -2 + #include "minstate.h" /* - * SAL_TO_OS_MCA_HANDOFF_STATE (SAL 3.0 spec) + * SAL_TO_OS_MCA_HANDOFF_STATE (SAL 3.0 spec) * 1. GR1 = OS GP * 2. GR8 = PAL_PROC physical address * 3. GR9 = SAL_PROC physical address @@ -40,26 +57,34 @@ st8 [_tmp]=r9,0x08;; \ st8 [_tmp]=r10,0x08;; \ st8 [_tmp]=r11,0x08;; \ - st8 [_tmp]=r12,0x08;; + st8 [_tmp]=r12,0x08 /* - * OS_MCA_TO_SAL_HANDOFF_STATE (SAL 3.0 spec) - * 1. GR8 = OS_MCA return status + * OS_MCA_TO_SAL_HANDOFF_STATE (SAL 3.0 spec) + * (p6) is executed if we never entered virtual mode (TLB error) + * (p7) is executed if we entered virtual mode as expected (normal case) + * 1. GR8 = OS_MCA return status * 2. GR9 = SAL GP (physical) - * 3. GR10 = 0/1 returning same/new context - * 4. GR22 = New min state save area pointer - * returns ptr to SAL rtn save loc in _tmp + * 3. GR10 = 0/1 returning same/new context + * 4. GR22 = New min state save area pointer + * returns ptr to SAL rtn save loc in _tmp */ -#define OS_MCA_TO_SAL_HANDOFF_STATE_RESTORE(_tmp) \ - movl _tmp=ia64_os_to_sal_handoff_state;; \ - DATA_VA_TO_PA(_tmp);; \ - ld8 r8=[_tmp],0x08;; \ - ld8 r9=[_tmp],0x08;; \ - ld8 r10=[_tmp],0x08;; \ - ld8 r22=[_tmp],0x08;; \ - movl _tmp=ia64_sal_to_os_handoff_state;; \ - DATA_VA_TO_PA(_tmp);; \ - add _tmp=0x28,_tmp;; // point to SAL rtn save location +#define OS_MCA_TO_SAL_HANDOFF_STATE_RESTORE(_tmp) \ +(p6) movl _tmp=ia64_sal_to_os_handoff_state;; \ +(p7) movl _tmp=ia64_os_to_sal_handoff_state;; \ + DATA_VA_TO_PA(_tmp);; \ +(p6) movl r8=IA64_MCA_COLD_BOOT; \ +(p6) movl r10=IA64_MCA_SAME_CONTEXT; \ +(p6) add _tmp=0x18,_tmp;; \ +(p6) ld8 r9=[_tmp],0x10; \ +(p6) movl r22=ia64_mca_min_state_save_info;; \ +(p7) ld8 r8=[_tmp],0x08;; \ +(p7) ld8 r9=[_tmp],0x08;; \ +(p7) ld8 r10=[_tmp],0x08;; \ +(p7) ld8 r22=[_tmp],0x08;; \ + DATA_VA_TO_PA(r22) + // now _tmp is pointing to SAL rtn save location + .global ia64_os_mca_dispatch .global ia64_os_mca_dispatch_end @@ -70,6 +95,9 @@ .global ia64_mca_stackframe .global ia64_mca_bspstore .global ia64_init_stack + .global ia64_mca_sal_data_area + .global ia64_tlb_functional + .global ia64_mca_min_state_save_info .text .align 16 @@ -90,26 +118,34 @@ // for ia64_mca_sal_to_os_state_t has been // defined in include/asm/mca.h SAL_TO_OS_MCA_HANDOFF_STATE_SAVE(r2) + ;; // LOG PROCESSOR STATE INFO FROM HERE ON.. - ;; begin_os_mca_dump: br ia64_os_mca_proc_state_dump;; ia64_os_mca_done_dump: // Setup new stack frame for OS_MCA handling - movl r2=ia64_mca_bspstore;; // local bspstore area location in r2 + movl r2=ia64_mca_bspstore;; // local bspstore area location in r2 DATA_VA_TO_PA(r2);; - movl r3=ia64_mca_stackframe;; // save stack frame to memory in r3 + movl r3=ia64_mca_stackframe;; // save stack frame to memory in r3 DATA_VA_TO_PA(r3);; - rse_switch_context(r6,r3,r2);; // RSC management in this new context - movl r12=ia64_mca_stack;; - mov r2=8*1024;; // stack size must be same as c array - add r12=r2,r12;; // stack base @ bottom of array + rse_switch_context(r6,r3,r2);; // RSC management in this new context + movl r12=ia64_mca_stack + mov r2=8*1024;; // stack size must be same as C array + add r12=r2,r12;; // stack base @ bottom of array + adds r12=-16,r12;; // allow 16 bytes of scratch + // (C calling convention) DATA_VA_TO_PA(r12);; - // Enter virtual mode from physical mode + // Check to see if the MCA resulted from a TLB error +begin_tlb_error_check: + br ia64_os_mca_tlb_error_check;; + +done_tlb_error_check: + + // If TLB is functional, enter virtual mode from physical mode VIRTUAL_MODE_ENTER(r2, r3, ia64_os_mca_virtual_begin, r4) ia64_os_mca_virtual_begin: @@ -130,25 +166,28 @@ #endif /* #if defined(MCA_TEST) */ // restore the original stack frame here - movl r2=ia64_mca_stackframe // restore stack frame from memory at r2 + movl r2=ia64_mca_stackframe // restore stack frame from memory at r2 ;; DATA_VA_TO_PA(r2) movl r4=IA64_PSR_MC ;; - rse_return_context(r4,r3,r2) // switch from interrupt context for RSE + rse_return_context(r4,r3,r2) // switch from interrupt context for RSE // let us restore all the registers from our PSI structure - mov r8=gp + mov r8=gp ;; begin_os_mca_restore: br ia64_os_mca_proc_state_restore;; ia64_os_mca_done_restore: - ;; + movl r3=ia64_tlb_functional;; + DATA_VA_TO_PA(r3);; + ld8 r3=[r3];; + cmp.eq p6,p7=r0,r3;; + OS_MCA_TO_SAL_HANDOFF_STATE_RESTORE(r2);; // branch back to SALE_CHECK - OS_MCA_TO_SAL_HANDOFF_STATE_RESTORE(r2) ld8 r3=[r2];; - mov b0=r3;; // SAL_CHECK return address + mov b0=r3;; // SAL_CHECK return address br b0 ;; ia64_os_mca_dispatch_end: @@ -405,7 +444,7 @@ movl r2=ia64_mca_proc_state_dump // Convert virtual address ;; // of OS state dump area DATA_VA_TO_PA(r2) // to physical address - ;; + restore_GRs: // restore bank-1 GRs 16-31 bsw.1;; add r3=16*8,r2;; // to get to NaT of GR 16-31 @@ -621,6 +660,80 @@ //EndStub////////////////////////////////////////////////////////////////////// +//++ +// Name: +// ia64_os_mca_tlb_error_check() +// +// Stub Description: +// +// This stub checks to see if the MCA resulted from a TLB error +// +//-- + +ia64_os_mca_tlb_error_check: + + // Retrieve sal data structure for uncorrected MCA + + // Make the ia64_sal_get_state_info() call + movl r4=ia64_mca_sal_data_area;; + movl r7=ia64_sal;; + mov r6=r1 // save gp + DATA_VA_TO_PA(r4) // convert to physical address + DATA_VA_TO_PA(r7);; // convert to physical address + ld8 r7=[r7] // get addr of pdesc from ia64_sal + movl r3=SAL_GET_STATE_INFO;; + DATA_VA_TO_PA(r7);; // convert to physical address + ld8 r8=[r7],8;; // get pdesc function pointer + dep r8=0,r8,61,3;; // convert SAL VA to PA + ld8 r1=[r7];; // set new (ia64_sal) gp + dep r1=0,r1,61,3;; // convert SAL VA to PA + mov b6=r8 + + alloc r5=ar.pfs,8,0,8,0;; // allocate stack frame for SAL call + mov out0=r3 // which SAL proc to call + mov out1=r0 // error type == MCA + mov out2=r0 // null arg + mov out3=r4 // data copy area + mov out4=r0 // null arg + mov out5=r0 // null arg + mov out6=r0 // null arg + mov out7=r0;; // null arg + + br.call.sptk.few b0=b6;; + + mov r1=r6 // restore gp + mov ar.pfs=r5;; // restore ar.pfs + + movl r6=ia64_tlb_functional;; + DATA_VA_TO_PA(r6) // needed later + + cmp.eq p6,p7=r0,r8;; // check SAL call return address +(p7) st8 [r6]=r0 // clear tlb_functional flag +(p7) br tlb_failure // error; return to SAL + + // examine processor error log for type of error + add r4=40+24,r4;; // parse past record header (length=40) + // and section header (length=24) + ld4 r4=[r4] // get valid field of processor log + mov r5=0xf00;; + and r5=r4,r5;; // read bits 8-11 of valid field + // to determine if we have a TLB error + movl r3=0x1 + cmp.eq p6,p7=r0,r5;; + // if no TLB failure, set tlb_functional flag +(p6) st8 [r6]=r3 + // else clear flag +(p7) st8 [r6]=r0 + + // if no TLB failure, continue with normal virtual mode logging +(p6) br done_tlb_error_check + // else no point in entering virtual mode for logging +tlb_failure: + br ia64_os_mca_virtual_end + +//EndStub////////////////////////////////////////////////////////////////////// + + // ok, the issue here is that we need to save state information so // it can be useable by the kernel debugger and show regs routines. // In order to do this, our best bet is save the current state (plus @@ -633,7 +746,7 @@ // This has been defined for registration purposes with SAL // as a part of ia64_mca_init. // -// When we get here, the follow registers have been +// When we get here, the following registers have been // set by the SAL for our use // // 1. GR1 = OS INIT GP @@ -649,42 +762,10 @@ GLOBAL_ENTRY(ia64_monarch_init_handler) -#if defined(CONFIG_SMP) && defined(SAL_MPINIT_WORKAROUND) - // - // work around SAL bug that sends all processors to monarch entry - // - mov r17=cr.lid - // XXX fix me: this is wrong: hard_smp_processor_id() is a pair of lid/eid - movl r18=ia64_cpu_to_sapicid - ;; - dep r18=0,r18,61,3 // convert to physical address - ;; - shr.u r17=r17,16 - ld4 r18=[r18] // get the BSP ID - ;; - dep r17=0,r17,16,48 - ;; - cmp4.ne p6,p0=r17,r18 // Am I the BSP ? -(p6) br.cond.spnt slave_init_spin_me - ;; -#endif - -// -// ok, the first thing we do is stash the information -// the SAL passed to os -// -_tmp = r2 - movl _tmp=ia64_sal_to_os_handoff_state - ;; - dep _tmp=0,_tmp, 61, 3 // get physical address + // stash the information the SAL passed to os + SAL_TO_OS_MCA_HANDOFF_STATE_SAVE(r2) ;; - st8 [_tmp]=r1,0x08;; - st8 [_tmp]=r8,0x08;; - st8 [_tmp]=r9,0x08;; - st8 [_tmp]=r10,0x08;; - st8 [_tmp]=r11,0x08;; - st8 [_tmp]=r12,0x08;; // now we want to save information so we can dump registers SAVE_MIN_WITH_COVER @@ -695,12 +776,10 @@ ;; SAVE_REST -// ok, enough should be saved at this point to be dangerous, and supply +// ok, enough should be saved at this point to be dangerous, and supply // information for a dump // We need to switch to Virtual mode before hitting the C functions. -// -// -// + movl r2=IA64_PSR_IT|IA64_PSR_IC|IA64_PSR_DT|IA64_PSR_RT|IA64_PSR_DFH|IA64_PSR_BN mov r3=psr // get the current psr, minimum enabled at this point ;; @@ -708,8 +787,8 @@ ;; movl r3=IVirtual_Switch ;; - mov cr.iip=r3 // short return to set the appropriate bits - mov cr.ipsr=r2 // need to do an rfi to set appropriate bits + mov cr.iip=r3 // short return to set the appropriate bits + mov cr.ipsr=r2 // need to do an rfi to set appropriate bits ;; rfi ;; @@ -717,7 +796,7 @@ // // We should now be running virtual // - // Lets call the C handler to get the rest of the state info + // Let's call the C handler to get the rest of the state info // alloc r14=ar.pfs,0,0,1,0 // now it's safe (must be first in insn group!) ;; // diff -urN linux-2.4.18/arch/ia64/kernel/minstate.h lia64-2.4/arch/ia64/kernel/minstate.h --- linux-2.4.18/arch/ia64/kernel/minstate.h Tue Jul 31 10:30:08 2001 +++ lia64-2.4/arch/ia64/kernel/minstate.h Tue Apr 9 22:21:40 2002 @@ -92,7 +92,6 @@ * * Assumed state upon entry: * psr.ic: off - * psr.dt: off * r31: contains saved predicates (pr) * * Upon exit, the state is as follows: @@ -186,7 +185,6 @@ * * Assumed state upon entry: * psr.ic: on - * psr.dt: on * r2: points to &pt_regs.r16 * r3: points to &pt_regs.r17 */ diff -urN linux-2.4.18/arch/ia64/kernel/pal.S lia64-2.4/arch/ia64/kernel/pal.S --- linux-2.4.18/arch/ia64/kernel/pal.S Mon Nov 26 11:18:21 2001 +++ lia64-2.4/arch/ia64/kernel/pal.S Wed Apr 17 07:53:15 2002 @@ -114,7 +114,7 @@ ;; rsm psr.i mov b7 = loc2 - ;; + ;; br.call.sptk.many rp=b7 // now make the call .ret0: mov psr.l = loc3 mov ar.pfs = loc1 @@ -161,7 +161,7 @@ ;; mov loc3 = psr // save psr adds r8 = 1f-1b,r8 // calculate return address for call - ;; + ;; mov loc4=ar.rsc // save RSE configuration dep.z loc2=loc2,0,61 // convert pal entry point to physical dep.z r8=r8,0,61 // convert rp to physical @@ -216,7 +216,7 @@ mov out3 = in3 // copy arg3 ;; mov loc3 = psr // save psr - ;; + ;; mov loc4=ar.rsc // save RSE configuration dep.z loc2=loc2,0,61 // convert pal entry point to physical ;; diff -urN linux-2.4.18/arch/ia64/kernel/palinfo.c lia64-2.4/arch/ia64/kernel/palinfo.c --- linux-2.4.18/arch/ia64/kernel/palinfo.c Mon Nov 26 11:18:21 2001 +++ lia64-2.4/arch/ia64/kernel/palinfo.c Thu Jan 24 17:16:06 2002 @@ -724,7 +724,7 @@ status = ia64_pal_tr_read(j, i, tr_buffer, &tr_valid); if (status != 0) { - printk(__FUNCTION__ " pal call failed on tr[%d:%d]=%ld\n", i, j, status); + printk("palinfo: pal call failed on tr[%d:%d]=%ld\n", i, j, status); continue; } @@ -842,9 +842,8 @@ palinfo_smp_call(void *info) { palinfo_smp_data_t *data = (palinfo_smp_data_t *)info; - /* printk(__FUNCTION__" called on CPU %d\n", smp_processor_id());*/ if (data == NULL) { - printk(KERN_ERR __FUNCTION__" data pointer is NULL\n"); + printk("%s palinfo: data pointer is NULL\n", KERN_ERR); data->ret = 0; /* no output */ return; } @@ -868,11 +867,10 @@ ptr.page = page; ptr.ret = 0; /* just in case */ - /*printk(__FUNCTION__" calling CPU %d from CPU %d for function %d\n", f->req_cpu,smp_processor_id(), f->func_id);*/ /* will send IPI to other CPU and wait for completion of remote call */ if ((ret=smp_call_function_single(f->req_cpu, palinfo_smp_call, &ptr, 0, 1))) { - printk(__FUNCTION__" remote CPU call from %d to %d on function %d: error %d\n", smp_processor_id(), f->req_cpu, f->func_id, ret); + printk("palinfo: remote CPU call from %d to %d on function %d: error %d\n", smp_processor_id(), f->req_cpu, f->func_id, ret); return 0; } return ptr.ret; @@ -881,7 +879,7 @@ static int palinfo_handle_smp(pal_func_cpu_u_t *f, char *page) { - printk(__FUNCTION__" should not be called with non SMP kernel\n"); + printk("palinfo: should not be called with non SMP kernel\n"); return 0; } #endif /* CONFIG_SMP */ diff -urN linux-2.4.18/arch/ia64/kernel/pci.c lia64-2.4/arch/ia64/kernel/pci.c --- linux-2.4.18/arch/ia64/kernel/pci.c Wed Dec 26 16:58:36 2001 +++ lia64-2.4/arch/ia64/kernel/pci.c Mon Jul 15 18:03:52 2002 @@ -42,101 +42,183 @@ extern void ia64_mca_check_errors( void ); #endif +struct pci_fixup pcibios_fixups[1]; + +struct pci_ops *pci_root_ops; + +int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value); +int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value); + + /* - * This interrupt-safe spinlock protects all accesses to PCI - * configuration space. + * Low-level SAL-based PCI configuration access functions. Note that SAL + * calls are already serialized (via sal_lock), so we don't need another + * synchronization mechanism here. Not using segment number (yet). */ -static spinlock_t pci_lock = SPIN_LOCK_UNLOCKED; -struct pci_fixup pcibios_fixups[] = { - { 0 } -}; +#define PCI_SAL_ADDRESS(bus, dev, fn, reg) \ + ((u64)(bus << 16) | (u64)(dev << 11) | (u64)(fn << 8) | (u64)(reg)) -/* Macro to build a PCI configuration address to be passed as a parameter to SAL. */ +static int +pci_sal_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value) +{ + int result = 0; + u64 data = 0; + + if (!value || (bus > 255) || (dev > 31) || (fn > 7) || (reg > 255)) + return -EINVAL; + + result = ia64_sal_pci_config_read(PCI_SAL_ADDRESS(bus, dev, fn, reg), len, &data); -#define PCI_CONFIG_ADDRESS(dev, where) \ - (((u64) dev->bus->number << 16) | ((u64) (dev->devfn & 0xff) << 8) | (where & 0xff)) + *value = (u32) data; + + return result; +} static int -pci_conf_read_config_byte(struct pci_dev *dev, int where, u8 *value) +pci_sal_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value) { - s64 status; - u64 lval; + if ((bus > 255) || (dev > 31) || (fn > 7) || (reg > 255)) + return -EINVAL; - status = ia64_sal_pci_config_read(PCI_CONFIG_ADDRESS(dev, where), 1, &lval); - *value = lval; - return status; + return ia64_sal_pci_config_write(PCI_SAL_ADDRESS(bus, dev, fn, reg), len, value); } + static int -pci_conf_read_config_word(struct pci_dev *dev, int where, u16 *value) +pci_sal_read_config_byte (struct pci_dev *dev, int where, u8 *value) { - s64 status; - u64 lval; + int result = 0; + u32 data = 0; + + if (!value) + return -EINVAL; + + result = pci_sal_read(0, dev->bus->number, PCI_SLOT(dev->devfn), + PCI_FUNC(dev->devfn), where, 1, &data); - status = ia64_sal_pci_config_read(PCI_CONFIG_ADDRESS(dev, where), 2, &lval); - *value = lval; - return status; + *value = (u8) data; + + return result; } static int -pci_conf_read_config_dword(struct pci_dev *dev, int where, u32 *value) +pci_sal_read_config_word (struct pci_dev *dev, int where, u16 *value) { - s64 status; - u64 lval; + int result = 0; + u32 data = 0; + + if (!value) + return -EINVAL; + + result = pci_sal_read(0, dev->bus->number, PCI_SLOT(dev->devfn), + PCI_FUNC(dev->devfn), where, 2, &data); - status = ia64_sal_pci_config_read(PCI_CONFIG_ADDRESS(dev, where), 4, &lval); - *value = lval; - return status; + *value = (u16) data; + + return result; } static int -pci_conf_write_config_byte (struct pci_dev *dev, int where, u8 value) +pci_sal_read_config_dword (struct pci_dev *dev, int where, u32 *value) { - return ia64_sal_pci_config_write(PCI_CONFIG_ADDRESS(dev, where), 1, value); + if (!value) + return -EINVAL; + + return pci_sal_read(0, dev->bus->number, PCI_SLOT(dev->devfn), + PCI_FUNC(dev->devfn), where, 4, value); } static int -pci_conf_write_config_word (struct pci_dev *dev, int where, u16 value) +pci_sal_write_config_byte (struct pci_dev *dev, int where, u8 value) { - return ia64_sal_pci_config_write(PCI_CONFIG_ADDRESS(dev, where), 2, value); + return pci_sal_write(0, dev->bus->number, PCI_SLOT(dev->devfn), + PCI_FUNC(dev->devfn), where, 1, value); } static int -pci_conf_write_config_dword (struct pci_dev *dev, int where, u32 value) +pci_sal_write_config_word (struct pci_dev *dev, int where, u16 value) { - return ia64_sal_pci_config_write(PCI_CONFIG_ADDRESS(dev, where), 4, value); + return pci_sal_write(0, dev->bus->number, PCI_SLOT(dev->devfn), + PCI_FUNC(dev->devfn), where, 2, value); } -struct pci_ops pci_conf = { - pci_conf_read_config_byte, - pci_conf_read_config_word, - pci_conf_read_config_dword, - pci_conf_write_config_byte, - pci_conf_write_config_word, - pci_conf_write_config_dword +static int +pci_sal_write_config_dword (struct pci_dev *dev, int where, u32 value) +{ + return pci_sal_write(0, dev->bus->number, PCI_SLOT(dev->devfn), + PCI_FUNC(dev->devfn), where, 4, value); +} + +struct pci_ops pci_sal_ops = { + pci_sal_read_config_byte, + pci_sal_read_config_word, + pci_sal_read_config_dword, + pci_sal_write_config_byte, + pci_sal_write_config_word, + pci_sal_write_config_dword }; + /* * Initialization. Uses the SAL interface */ + +struct pci_bus * +pcibios_scan_root(int bus) +{ + struct list_head *list = NULL; + struct pci_bus *pci_bus = NULL; + + list_for_each(list, &pci_root_buses) { + pci_bus = pci_bus_b(list); + if (pci_bus->number == bus) { + /* Already scanned */ + printk("PCI: Bus (%02x) already probed\n", bus); + return pci_bus; + } + } + + printk("PCI: Probing PCI hardware on bus (%02x)\n", bus); + + return pci_scan_bus(bus, pci_root_ops, NULL); +} + +void __init +pcibios_config_init (void) +{ + if (pci_root_ops) + return; + + printk("PCI: Using SAL to access configuration space\n"); + + pci_root_ops = &pci_sal_ops; + pci_config_read = pci_sal_read; + pci_config_write = pci_sal_write; + + return; +} + void __init pcibios_init (void) { # define PCI_BUSES_TO_SCAN 255 - int i; + int i = 0; #ifdef CONFIG_IA64_MCA ia64_mca_check_errors(); /* For post-failure MCA error logging */ #endif - platform_pci_fixup(0); /* phase 0 initialization (before PCI bus has been scanned) */ + pcibios_config_init(); + + platform_pci_fixup(0); /* phase 0 fixups (before buses scanned) */ printk("PCI: Probing PCI hardware\n"); for (i = 0; i < PCI_BUSES_TO_SCAN; i++) - pci_scan_bus(i, &pci_conf, NULL); + pci_scan_bus(i, pci_root_ops, NULL); + + platform_pci_fixup(1); /* phase 1 fixups (after buses scanned) */ - platform_pci_fixup(1); /* phase 1 initialization (after PCI bus has been scanned) */ return; } @@ -186,7 +268,37 @@ int pcibios_enable_device (struct pci_dev *dev) { - /* Not needed, since we enable all devices at startup. */ + u16 cmd, old_cmd; + int idx; + struct resource *r; + + if (!dev) + return -EINVAL; + + pci_read_config_word(dev, PCI_COMMAND, &cmd); + old_cmd = cmd; + for (idx=0; idx<6; idx++) { + r = &dev->resource[idx]; + if (!r->start && r->end) { + printk(KERN_ERR + "PCI: Device %s not available because of resource collisions\n", + dev->slot_name); + return -EINVAL; + } + if (r->flags & IORESOURCE_IO) + cmd |= PCI_COMMAND_IO; + if (r->flags & IORESOURCE_MEM) + cmd |= PCI_COMMAND_MEMORY; + } + if (dev->resource[PCI_ROM_RESOURCE].start) + cmd |= PCI_COMMAND_MEMORY; + if (cmd != old_cmd) { + printk("PCI: Enabling device %s (%04x -> %04x)\n", dev->slot_name, old_cmd, cmd); + pci_write_config_word(dev, PCI_COMMAND, cmd); + } + + printk(KERN_INFO "PCI: Found IRQ %d for device %s\n", dev->irq, dev->slot_name); + return 0; } diff -urN linux-2.4.18/arch/ia64/kernel/perfmon.c lia64-2.4/arch/ia64/kernel/perfmon.c --- linux-2.4.18/arch/ia64/kernel/perfmon.c Mon Nov 26 11:18:21 2001 +++ lia64-2.4/arch/ia64/kernel/perfmon.c Mon Jul 8 14:20:01 2002 @@ -1,13 +1,16 @@ /* - * This file contains the code to configure and read/write the ia64 performance - * monitoring stuff. + * This file implements the perfmon subsystem which is used + * to program the IA-64 Performance Monitoring Unit (PMU). * * Originaly Written by Ganesh Venkitachalam, IBM Corp. - * Modifications by David Mosberger-Tang, Hewlett-Packard Co. - * Modifications by Stephane Eranian, Hewlett-Packard Co. * Copyright (C) 1999 Ganesh Venkitachalam - * Copyright (C) 1999 David Mosberger-Tang - * Copyright (C) 2000-2001 Stephane Eranian + * + * Modifications by Stephane Eranian, Hewlett-Packard Co. + * Modifications by David Mosberger-Tang, Hewlett-Packard Co. + * + * Copyright (C) 1999-2002 Hewlett Packard Co + * Stephane Eranian + * David Mosberger-Tang */ #include @@ -20,286 +23,428 @@ #include #include #include +#include #include -#include #include -#include #include #include #include -#include #include #include #include -#include #include #include /* for ia64_get_itc() */ #ifdef CONFIG_PERFMON -#define PFM_VERSION "0.3" -#define PFM_SMPL_HDR_VERSION 1 - -#define PMU_FIRST_COUNTER 4 /* first generic counter */ - -#define PFM_WRITE_PMCS 0xa0 -#define PFM_WRITE_PMDS 0xa1 -#define PFM_READ_PMDS 0xa2 -#define PFM_STOP 0xa3 -#define PFM_START 0xa4 -#define PFM_ENABLE 0xa5 /* unfreeze only */ -#define PFM_DISABLE 0xa6 /* freeze only */ -#define PFM_RESTART 0xcf -#define PFM_CREATE_CONTEXT 0xa7 -#define PFM_DESTROY_CONTEXT 0xa8 /* - * Those 2 are just meant for debugging. I considered using sysctl() for - * that but it is a little bit too pervasive. This solution is at least - * self-contained. + * For PMUs which rely on the debug registers for some features, you must + * you must enable the following flag to activate the support for + * accessing the registers via the perfmonctl() interface. */ -#define PFM_DEBUG_ON 0xe0 -#define PFM_DEBUG_OFF 0xe1 - -#define PFM_DEBUG_BASE PFM_DEBUG_ON - +#if defined(CONFIG_ITANIUM) || defined(CONFIG_MCKINLEY) +#define PFM_PMU_USES_DBR 1 +#endif /* - * perfmon API flags + * perfmon context states */ -#define PFM_FL_INHERIT_NONE 0x00 /* never inherit a context across fork (default) */ -#define PFM_FL_INHERIT_ONCE 0x01 /* clone pfm_context only once across fork() */ -#define PFM_FL_INHERIT_ALL 0x02 /* always clone pfm_context across fork() */ -#define PFM_FL_SMPL_OVFL_NOBLOCK 0x04 /* do not block on sampling buffer overflow */ -#define PFM_FL_SYSTEM_WIDE 0x08 /* create a system wide context */ -#define PFM_FL_EXCL_INTR 0x10 /* exclude interrupt from system wide monitoring */ +#define PFM_CTX_DISABLED 0 +#define PFM_CTX_ENABLED 1 /* - * PMC API flags + * Reset register flags */ -#define PFM_REGFL_OVFL_NOTIFY 1 /* send notification on overflow */ +#define PFM_RELOAD_LONG_RESET 1 +#define PFM_RELOAD_SHORT_RESET 2 /* - * Private flags and masks + * Misc macros and definitions */ +#define PMU_FIRST_COUNTER 4 + +#define PFM_IS_DISABLED() pmu_conf.pfm_is_disabled + +#define PMC_OVFL_NOTIFY(ctx, i) ((ctx)->ctx_soft_pmds[i].flags & PFM_REGFL_OVFL_NOTIFY) #define PFM_FL_INHERIT_MASK (PFM_FL_INHERIT_NONE|PFM_FL_INHERIT_ONCE|PFM_FL_INHERIT_ALL) +/* i assume unsigned */ +#define PMC_IS_IMPL(i) (i>6] & (1UL<< (i) %64)) +#define PMD_IS_IMPL(i) (i>6)] & (1UL<<(i) % 64)) + +/* XXX: these three assume that register i is implemented */ +#define PMD_IS_COUNTING(i) (pmu_conf.pmd_desc[i].type == PFM_REG_COUNTING) +#define PMC_IS_COUNTING(i) (pmu_conf.pmc_desc[i].type == PFM_REG_COUNTING) +#define PMC_IS_MONITOR(c) (pmu_conf.pmc_desc[i].type == PFM_REG_MONITOR) + +/* k assume unsigned */ +#define IBR_IS_IMPL(k) (kctx_flags.state == PFM_CTX_ENABLED) +#define CTX_OVFL_NOBLOCK(c) ((c)->ctx_fl_block == 0) +#define CTX_INHERIT_MODE(c) ((c)->ctx_fl_inherit) +#define CTX_HAS_SMPL(c) ((c)->ctx_psb != NULL) +/* XXX: does not support more than 64 PMDs */ +#define CTX_USED_PMD(ctx, mask) (ctx)->ctx_used_pmds[0] |= (mask) +#define CTX_IS_USED_PMD(ctx, c) (((ctx)->ctx_used_pmds[0] & (1UL << (c))) != 0UL) + + +#define CTX_USED_IBR(ctx,n) (ctx)->ctx_used_ibrs[(n)>>6] |= 1UL<< ((n) % 64) +#define CTX_USED_DBR(ctx,n) (ctx)->ctx_used_dbrs[(n)>>6] |= 1UL<< ((n) % 64) +#define CTX_USES_DBREGS(ctx) (((pfm_context_t *)(ctx))->ctx_fl_using_dbreg==1) + +#define LOCK_CTX(ctx) spin_lock(&(ctx)->ctx_lock) +#define UNLOCK_CTX(ctx) spin_unlock(&(ctx)->ctx_lock) + +#define SET_PMU_OWNER(t) do { pmu_owners[smp_processor_id()].owner = (t); } while(0) +#define PMU_OWNER() pmu_owners[smp_processor_id()].owner + +#define LOCK_PFS() spin_lock(&pfm_sessions.pfs_lock) +#define UNLOCK_PFS() spin_unlock(&pfm_sessions.pfs_lock) + +#define PFM_REG_RETFLAG_SET(flags, val) do { flags &= ~PFM_REG_RETFL_MASK; flags |= (val); } while(0) + #ifdef CONFIG_SMP #define cpu_is_online(i) (cpu_online_map & (1UL << i)) #else -#define cpu_is_online(i) 1 +#define cpu_is_online(i) (i==0) #endif -#define PMC_IS_IMPL(i) (i < pmu_conf.num_pmcs && pmu_conf.impl_regs[i>>6] & (1<< (i&~(64-1)))) -#define PMD_IS_IMPL(i) (i < pmu_conf.num_pmds && pmu_conf.impl_regs[4+(i>>6)] & (1<< (i&~(64-1)))) -#define PMD_IS_COUNTER(i) (i>=PMU_FIRST_COUNTER && i < (PMU_FIRST_COUNTER+pmu_conf.max_counters)) -#define PMC_IS_COUNTER(i) (i>=PMU_FIRST_COUNTER && i < (PMU_FIRST_COUNTER+pmu_conf.max_counters)) +/* + * debugging + */ +#define DBprintk(a) \ + do { \ + if (pfm_sysctl.debug >0) { printk("%s.%d: CPU%d ", __FUNCTION__, __LINE__, smp_processor_id()); printk a; } \ + } while (0) + +#define DBprintk_ovfl(a) \ + do { \ + if (pfm_sysctl.debug > 0 && pfm_sysctl.debug_ovfl >0) { printk("%s.%d: CPU%d ", __FUNCTION__, __LINE__, smp_processor_id()); printk a; } \ + } while (0) + -/* This is the Itanium-specific PMC layout for counter config */ + +/* + * Architected PMC structure + */ typedef struct { unsigned long pmc_plm:4; /* privilege level mask */ unsigned long pmc_ev:1; /* external visibility */ unsigned long pmc_oi:1; /* overflow interrupt */ unsigned long pmc_pm:1; /* privileged monitor */ unsigned long pmc_ig1:1; /* reserved */ - unsigned long pmc_es:7; /* event select */ - unsigned long pmc_ig2:1; /* reserved */ - unsigned long pmc_umask:4; /* unit mask */ - unsigned long pmc_thres:3; /* threshold */ - unsigned long pmc_ig3:1; /* reserved (missing from table on p6-17) */ - unsigned long pmc_ism:2; /* instruction set mask */ - unsigned long pmc_ig4:38; /* reserved */ -} pmc_counter_reg_t; - -/* test for EAR/BTB configuration */ -#define PMU_DEAR_EVENT 0x67 -#define PMU_IEAR_EVENT 0x23 -#define PMU_BTB_EVENT 0x11 - -#define PMC_IS_DEAR(a) (((pmc_counter_reg_t *)(a))->pmc_es == PMU_DEAR_EVENT) -#define PMC_IS_IEAR(a) (((pmc_counter_reg_t *)(a))->pmc_es == PMU_IEAR_EVENT) -#define PMC_IS_BTB(a) (((pmc_counter_reg_t *)(a))->pmc_es == PMU_BTB_EVENT) - -/* - * This header is at the beginning of the sampling buffer returned to the user. - * It is exported as Read-Only at this point. It is directly followed with the - * first record. - */ -typedef struct { - int hdr_version; /* could be used to differentiate formats */ - int hdr_reserved; - unsigned long hdr_entry_size; /* size of one entry in bytes */ - unsigned long hdr_count; /* how many valid entries */ - unsigned long hdr_pmds; /* which pmds are recorded */ -} perfmon_smpl_hdr_t; - -/* - * Header entry in the buffer as a header as follows. - * The header is directly followed with the PMDS to saved in increasing index order: - * PMD4, PMD5, .... How many PMDs are present is determined by the tool which must - * keep track of it when generating the final trace file. - */ -typedef struct { - int pid; /* identification of process */ - int cpu; /* which cpu was used */ - unsigned long rate; /* initial value of this counter */ - unsigned long stamp; /* timestamp */ - unsigned long ip; /* where did the overflow interrupt happened */ - unsigned long regs; /* which registers overflowed (up to 64)*/ -} perfmon_smpl_entry_t; + unsigned long pmc_es:8; /* event select */ + unsigned long pmc_ig2:48; /* reserved */ +} pfm_monitor_t; /* * There is one such data structure per perfmon context. It is used to describe the - * sampling buffer. It is to be shared among siblings whereas the pfm_context isn't. + * sampling buffer. It is to be shared among siblings whereas the pfm_context + * is not. * Therefore we maintain a refcnt which is incremented on fork(). - * This buffer is private to the kernel only the actual sampling buffer including its - * header are exposed to the user. This construct allows us to export the buffer read-write, - * if needed, without worrying about security problems. + * This buffer is private to the kernel only the actual sampling buffer + * including its header are exposed to the user. This construct allows us to + * export the buffer read-write, if needed, without worrying about security + * problems. */ -typedef struct { - atomic_t psb_refcnt; /* how many users for the buffer */ - int reserved; +typedef struct _pfm_smpl_buffer_desc { + spinlock_t psb_lock; /* protection lock */ + unsigned long psb_refcnt; /* how many users for the buffer */ + int psb_flags; /* bitvector of flags (not yet used) */ + void *psb_addr; /* points to location of first entry */ unsigned long psb_entries; /* maximum number of entries */ unsigned long psb_size; /* aligned size of buffer */ - unsigned long psb_index; /* next free entry slot */ + unsigned long psb_index; /* next free entry slot XXX: must use the one in buffer */ unsigned long psb_entry_size; /* size of each entry including entry header */ + perfmon_smpl_hdr_t *psb_hdr; /* points to sampling buffer header */ -} pfm_smpl_buffer_desc_t; + struct _pfm_smpl_buffer_desc *psb_next; /* next psb, used for rvfreeing of psb_hdr */ + +} pfm_smpl_buffer_desc_t; /* - * This structure is initialized at boot time and contains - * a description of the PMU main characteristic as indicated - * by PAL + * psb_flags */ -typedef struct { - unsigned long pfm_is_disabled; /* indicates if perfmon is working properly */ - unsigned long perf_ovfl_val; /* overflow value for generic counters */ - unsigned long max_counters; /* upper limit on counter pair (PMC/PMD) */ - unsigned long num_pmcs ; /* highest PMC implemented (may have holes) */ - unsigned long num_pmds; /* highest PMD implemented (may have holes) */ - unsigned long impl_regs[16]; /* buffer used to hold implememted PMC/PMD mask */ -} pmu_config_t; +#define PSB_HAS_VMA 0x1 /* a virtual mapping for the buffer exists */ + +#define LOCK_PSB(p) spin_lock(&(p)->psb_lock) +#define UNLOCK_PSB(p) spin_unlock(&(p)->psb_lock) -#define PERFMON_IS_DISABLED() pmu_conf.pfm_is_disabled +/* + * The possible type of a PMU register + */ +typedef enum { + PFM_REG_NOTIMPL, /* not implemented */ + PFM_REG_NONE, /* end marker */ + PFM_REG_MONITOR, /* a PMC with a pmc.pm field only */ + PFM_REG_COUNTING,/* a PMC with a pmc.pm AND pmc.oi, a PMD used as a counter */ + PFM_REG_CONTROL, /* PMU control register */ + PFM_REG_CONFIG, /* refine configuration */ + PFM_REG_BUFFER /* PMD used as buffer */ +} pfm_pmu_reg_type_t; +/* + * 64-bit software counter structure + */ typedef struct { - __u64 val; /* virtual 64bit counter value */ - __u64 ival; /* initial value from user */ - __u64 smpl_rval; /* reset value on sampling overflow */ - __u64 ovfl_rval; /* reset value on overflow */ - int flags; /* notify/do not notify */ + u64 val; /* virtual 64bit counter value */ + u64 ival; /* initial value from user */ + u64 long_reset; /* reset value on sampling overflow */ + u64 short_reset;/* reset value on overflow */ + u64 reset_pmds[4]; /* which other pmds to reset when this counter overflows */ + int flags; /* notify/do not notify */ } pfm_counter_t; -#define PMD_OVFL_NOTIFY(ctx, i) ((ctx)->ctx_pmds[i].flags & PFM_REGFL_OVFL_NOTIFY) /* - * perfmon context. One per process, is cloned on fork() depending on inheritance flags + * perfmon context. One per process, is cloned on fork() depending on + * inheritance flags */ typedef struct { - unsigned int inherit:2; /* inherit mode */ - unsigned int noblock:1; /* block/don't block on overflow with notification */ - unsigned int system:1; /* do system wide monitoring */ - unsigned int frozen:1; /* pmu must be kept frozen on ctxsw in */ - unsigned int exclintr:1;/* exlcude interrupts from system wide monitoring */ - unsigned int reserved:26; + unsigned int state:1; /* 0=disabled, 1=enabled */ + unsigned int inherit:2; /* inherit mode */ + unsigned int block:1; /* when 1, task will blocked on user notifications */ + unsigned int system:1; /* do system wide monitoring */ + unsigned int frozen:1; /* pmu must be kept frozen on ctxsw in */ + unsigned int protected:1; /* allow access to creator of context only */ + unsigned int using_dbreg:1; /* using range restrictions (debug registers) */ + unsigned int reserved:24; } pfm_context_flags_t; +/* + * perfmon context: encapsulates all the state of a monitoring session + * XXX: probably need to change layout + */ typedef struct pfm_context { + pfm_smpl_buffer_desc_t *ctx_psb; /* sampling buffer, if any */ + unsigned long ctx_smpl_vaddr; /* user level virtual address of smpl buffer */ - pfm_smpl_buffer_desc_t *ctx_smpl_buf; /* sampling buffer descriptor, if any */ - unsigned long ctx_dear_counter; /* which PMD holds D-EAR */ - unsigned long ctx_iear_counter; /* which PMD holds I-EAR */ - unsigned long ctx_btb_counter; /* which PMD holds BTB */ - - spinlock_t ctx_notify_lock; + spinlock_t ctx_lock; pfm_context_flags_t ctx_flags; /* block/noblock */ - int ctx_notify_sig; /* XXX: SIGPROF or other */ + struct task_struct *ctx_notify_task; /* who to notify on overflow */ - struct task_struct *ctx_creator; /* pid of creator (debug) */ + struct task_struct *ctx_owner; /* pid of creator (debug) */ - unsigned long ctx_ovfl_regs; /* which registers just overflowed (notification) */ - unsigned long ctx_smpl_regs; /* which registers to record on overflow */ + unsigned long ctx_ovfl_regs[4]; /* which registers overflowed (notification) */ + unsigned long ctx_smpl_regs[4]; /* which registers to record on overflow */ - struct semaphore ctx_restart_sem; /* use for blocking notification mode */ + struct semaphore ctx_restart_sem; /* use for blocking notification mode */ - unsigned long ctx_used_pmds[4]; /* bitmask of used PMD (speedup ctxsw) */ - unsigned long ctx_used_pmcs[4]; /* bitmask of used PMC (speedup ctxsw) */ + unsigned long ctx_used_pmds[4]; /* bitmask of PMD used */ + unsigned long ctx_reload_pmds[4]; /* bitmask of PMD to reload on ctxsw */ - pfm_counter_t ctx_pmds[IA64_NUM_PMD_COUNTERS]; /* XXX: size should be dynamic */ + unsigned long ctx_used_pmcs[4]; /* bitmask PMC used by context */ + unsigned long ctx_reload_pmcs[4]; /* bitmask of PMC to reload on ctxsw */ + unsigned long ctx_used_ibrs[4]; /* bitmask of used IBR (speedup ctxsw) */ + unsigned long ctx_used_dbrs[4]; /* bitmask of used DBR (speedup ctxsw) */ + + pfm_counter_t ctx_soft_pmds[IA64_NUM_PMD_REGS]; /* XXX: size should be dynamic */ + + u64 ctx_saved_psr; /* copy of psr used for lazy ctxsw */ + unsigned long ctx_saved_cpus_allowed; /* copy of the task cpus_allowed (system wide) */ + unsigned long ctx_cpu; /* cpu to which perfmon is applied (system wide) */ + + atomic_t ctx_saving_in_progress; /* flag indicating actual save in progress */ + atomic_t ctx_is_busy; /* context accessed by overflow handler */ + atomic_t ctx_last_cpu; /* CPU id of current or last CPU used */ } pfm_context_t; -#define CTX_USED_PMD(ctx,n) (ctx)->ctx_used_pmds[(n)>>6] |= 1<< ((n) % 64) -#define CTX_USED_PMC(ctx,n) (ctx)->ctx_used_pmcs[(n)>>6] |= 1<< ((n) % 64) +#define ctx_fl_inherit ctx_flags.inherit +#define ctx_fl_block ctx_flags.block +#define ctx_fl_system ctx_flags.system +#define ctx_fl_frozen ctx_flags.frozen +#define ctx_fl_protected ctx_flags.protected +#define ctx_fl_using_dbreg ctx_flags.using_dbreg -#define ctx_fl_inherit ctx_flags.inherit -#define ctx_fl_noblock ctx_flags.noblock -#define ctx_fl_system ctx_flags.system -#define ctx_fl_frozen ctx_flags.frozen -#define ctx_fl_exclintr ctx_flags.exclintr +/* + * global information about all sessions + * mostly used to synchronize between system wide and per-process + */ +typedef struct { + spinlock_t pfs_lock; /* lock the structure */ -#define CTX_OVFL_NOBLOCK(c) ((c)->ctx_fl_noblock == 1) -#define CTX_INHERIT_MODE(c) ((c)->ctx_fl_inherit) -#define CTX_HAS_SMPL(c) ((c)->ctx_smpl_buf != NULL) + unsigned long pfs_task_sessions; /* number of per task sessions */ + unsigned long pfs_sys_sessions; /* number of per system wide sessions */ + unsigned long pfs_sys_use_dbregs; /* incremented when a system wide session uses debug regs */ + unsigned long pfs_ptrace_use_dbregs; /* incremented when a process uses debug regs */ + struct task_struct *pfs_sys_session[NR_CPUS]; /* point to task owning a system-wide session */ +} pfm_session_t; -static pmu_config_t pmu_conf; +/* + * information about a PMC or PMD. + * dep_pmd[]: a bitmask of dependent PMD registers + * dep_pmc[]: a bitmask of dependent PMC registers + */ +typedef struct { + pfm_pmu_reg_type_t type; + int pm_pos; + int (*read_check)(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs); + int (*write_check)(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs); + unsigned long dep_pmd[4]; + unsigned long dep_pmc[4]; +} pfm_reg_desc_t; +/* assume cnum is a valid monitor */ +#define PMC_PM(cnum, val) (((val) >> (pmu_conf.pmc_desc[cnum].pm_pos)) & 0x1) +#define PMC_WR_FUNC(cnum) (pmu_conf.pmc_desc[cnum].write_check) +#define PMD_WR_FUNC(cnum) (pmu_conf.pmd_desc[cnum].write_check) +#define PMD_RD_FUNC(cnum) (pmu_conf.pmd_desc[cnum].read_check) -/* for debug only */ -static int pfm_debug=0; /* 0= nodebug, >0= debug output on */ +/* + * This structure is initialized at boot time and contains + * a description of the PMU main characteristic as indicated + * by PAL along with a list of inter-registers dependencies and configurations. + */ +typedef struct { + unsigned long pfm_is_disabled; /* indicates if perfmon is working properly */ + unsigned long perf_ovfl_val; /* overflow value for generic counters */ + unsigned long max_counters; /* upper limit on counter pair (PMC/PMD) */ + unsigned long num_pmcs ; /* highest PMC implemented (may have holes) */ + unsigned long num_pmds; /* highest PMD implemented (may have holes) */ + unsigned long impl_regs[16]; /* buffer used to hold implememted PMC/PMD mask */ + unsigned long num_ibrs; /* number of instruction debug registers */ + unsigned long num_dbrs; /* number of data debug registers */ + pfm_reg_desc_t *pmc_desc; /* detailed PMC register descriptions */ + pfm_reg_desc_t *pmd_desc; /* detailed PMD register descriptions */ +} pmu_config_t; -#define DBprintk(a) \ - do { \ - if (pfm_debug >0) { printk(__FUNCTION__" %d: ", __LINE__); printk a; } \ - } while (0); -static void ia64_reset_pmu(void); +/* + * structure used to pass argument to/from remote CPU + * using IPI to check and possibly save the PMU context on SMP systems. + * + * not used in UP kernels + */ +typedef struct { + struct task_struct *task; /* which task we are interested in */ + int retval; /* return value of the call: 0=you can proceed, 1=need to wait for completion */ +} pfm_smp_ipi_arg_t; /* - * structure used to pass information between the interrupt handler - * and the tasklet. + * perfmon command descriptions */ typedef struct { - pid_t to_pid; /* which process to notify */ - pid_t from_pid; /* which process is source of overflow */ - int sig; /* with which signal */ - unsigned long bitvect; /* which counters have overflowed */ -} notification_info_t; + int (*cmd_func)(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs); + int cmd_flags; + unsigned int cmd_narg; + size_t cmd_argsize; +} pfm_cmd_desc_t; + +#define PFM_CMD_PID 0x1 /* command requires pid argument */ +#define PFM_CMD_ARG_READ 0x2 /* command must read argument(s) */ +#define PFM_CMD_ARG_WRITE 0x4 /* command must write argument(s) */ +#define PFM_CMD_CTX 0x8 /* command needs a perfmon context */ +#define PFM_CMD_NOCHK 0x10 /* command does not need to check task's state */ + +#define PFM_CMD_IDX(cmd) (cmd) + +#define PFM_CMD_IS_VALID(cmd) ((PFM_CMD_IDX(cmd) >= 0) && (PFM_CMD_IDX(cmd) < PFM_CMD_COUNT) \ + && pfm_cmd_tab[PFM_CMD_IDX(cmd)].cmd_func != NULL) + +#define PFM_CMD_USE_PID(cmd) ((pfm_cmd_tab[PFM_CMD_IDX(cmd)].cmd_flags & PFM_CMD_PID) != 0) +#define PFM_CMD_READ_ARG(cmd) ((pfm_cmd_tab[PFM_CMD_IDX(cmd)].cmd_flags & PFM_CMD_ARG_READ) != 0) +#define PFM_CMD_WRITE_ARG(cmd) ((pfm_cmd_tab[PFM_CMD_IDX(cmd)].cmd_flags & PFM_CMD_ARG_WRITE) != 0) +#define PFM_CMD_USE_CTX(cmd) ((pfm_cmd_tab[PFM_CMD_IDX(cmd)].cmd_flags & PFM_CMD_CTX) != 0) +#define PFM_CMD_CHK(cmd) ((pfm_cmd_tab[PFM_CMD_IDX(cmd)].cmd_flags & PFM_CMD_NOCHK) == 0) + +#define PFM_CMD_ARG_MANY -1 /* cannot be zero */ +#define PFM_CMD_NARG(cmd) (pfm_cmd_tab[PFM_CMD_IDX(cmd)].cmd_narg) +#define PFM_CMD_ARG_SIZE(cmd) (pfm_cmd_tab[PFM_CMD_IDX(cmd)].cmd_argsize) +typedef struct { + int debug; /* turn on/off debugging via syslog */ + int debug_ovfl; /* turn on/off debug printk in overflow handler */ + int fastctxsw; /* turn on/off fast (unsecure) ctxsw */ +} pfm_sysctl_t; typedef struct { - unsigned long pfs_proc_sessions; - unsigned long pfs_sys_session; /* can only be 0/1 */ - unsigned long pfs_dfl_dcr; /* XXX: hack */ - unsigned int pfs_pp; -} pfm_session_t; + unsigned long pfm_spurious_ovfl_intr_count; /* keep track of spurious ovfl interrupts */ + unsigned long pfm_ovfl_intr_count; /* keep track of ovfl interrupts */ + unsigned long pfm_recorded_samples_count; + unsigned long pfm_full_smpl_buffer_count; /* how many times the sampling buffer was full */ +} pfm_stats_t; -struct { +/* + * perfmon internal variables + */ +static pmu_config_t pmu_conf; /* PMU configuration */ +static pfm_session_t pfm_sessions; /* global sessions information */ +static struct proc_dir_entry *perfmon_dir; /* for debug only */ +static pfm_stats_t pfm_stats; + +/* sysctl() controls */ +static pfm_sysctl_t pfm_sysctl; + +static ctl_table pfm_ctl_table[]={ + {1, "debug", &pfm_sysctl.debug, sizeof(int), 0666, NULL, &proc_dointvec, NULL,}, + {2, "debug_ovfl", &pfm_sysctl.debug_ovfl, sizeof(int), 0666, NULL, &proc_dointvec, NULL,}, + {3, "fastctxsw", &pfm_sysctl.fastctxsw, sizeof(int), 0600, NULL, &proc_dointvec, NULL,}, + { 0, }, +}; +static ctl_table pfm_sysctl_dir[] = { + {1, "perfmon", NULL, 0, 0755, pfm_ctl_table, }, + {0,}, +}; +static ctl_table pfm_sysctl_root[] = { + {1, "kernel", NULL, 0, 0755, pfm_sysctl_dir, }, + {0,}, +}; +static struct ctl_table_header *pfm_sysctl_header; + +static unsigned long reset_pmcs[IA64_NUM_PMC_REGS]; /* contains PAL reset values for PMCS */ + +static void pfm_vm_close(struct vm_area_struct * area); + +static struct vm_operations_struct pfm_vm_ops={ + close: pfm_vm_close +}; + +/* + * keep track of task owning the PMU per CPU. + */ +static struct { struct task_struct *owner; } ____cacheline_aligned pmu_owners[NR_CPUS]; -/* - * helper macros - */ -#define SET_PMU_OWNER(t) do { pmu_owners[smp_processor_id()].owner = (t); } while(0); -#define PMU_OWNER() pmu_owners[smp_processor_id()].owner +/* + * forward declarations + */ +static void ia64_reset_pmu(struct task_struct *); #ifdef CONFIG_SMP -#define PFM_CAN_DO_LAZY() (smp_num_cpus==1 && pfs_info.pfs_sys_session==0) -#else -#define PFM_CAN_DO_LAZY() (pfs_info.pfs_sys_session==0) +static void pfm_fetch_regs(int cpu, struct task_struct *task, pfm_context_t *ctx); #endif - static void pfm_lazy_save_regs (struct task_struct *ta); -/* for debug only */ -static struct proc_dir_entry *perfmon_dir; +#if defined(CONFIG_ITANIUM) +#include "perfmon_itanium.h" +#elif defined(CONFIG_MCKINLEY) +#include "perfmon_mckinley.h" +#else +#include "perfmon_generic.h" +#endif -/* - * XXX: hack to indicate that a system wide monitoring session is active - */ -static pfm_session_t pfs_info; +static inline unsigned long +pfm_read_soft_counter(pfm_context_t *ctx, int i) +{ + return ctx->ctx_soft_pmds[i].val + (ia64_get_pmd(i) & pmu_conf.perf_ovfl_val); +} + +static inline void +pfm_write_soft_counter(pfm_context_t *ctx, int i, unsigned long val) +{ + ctx->ctx_soft_pmds[i].val = val & ~pmu_conf.perf_ovfl_val; + /* + * writing to unimplemented part is ignore, so we do not need to + * mask off top part + */ + ia64_set_pmd(i, val & pmu_conf.perf_ovfl_val); +} /* * finds the number of PM(C|D) registers given @@ -324,10 +469,10 @@ * Generates a unique (per CPU) timestamp */ static inline unsigned long -perfmon_get_stamp(void) +pfm_get_stamp(void) { /* - * XXX: maybe find something more efficient + * XXX: must find something more efficient */ return ia64_get_itc(); } @@ -353,80 +498,178 @@ } } } - DBprintk(("uv2kva(%lx-->%lx)\n", adr, ret)); + DBprintk(("[%d] uv2kva(%lx-->%lx)\n", current->pid, adr, ret)); return ret; } - /* Here we want the physical address of the memory. * This is used when initializing the contents of the * area and marking the pages as reserved. */ static inline unsigned long -kvirt_to_pa(unsigned long adr) +pfm_kvirt_to_pa(unsigned long adr) { __u64 pa = ia64_tpa(adr); - DBprintk(("kv2pa(%lx-->%lx)\n", adr, pa)); + //DBprintk(("kv2pa(%lx-->%lx)\n", adr, pa)); return pa; } static void * -rvmalloc(unsigned long size) +pfm_rvmalloc(unsigned long size) { void *mem; unsigned long adr, page; - /* XXX: may have to revisit this part because - * vmalloc() does not necessarily return a page-aligned buffer. - * This maybe a security problem when mapped at user level - */ mem=vmalloc(size); if (mem) { + //printk("perfmon: CPU%d pfm_rvmalloc(%ld)=%p\n", smp_processor_id(), size, mem); memset(mem, 0, size); /* Clear the ram out, no junk to the user */ adr=(unsigned long) mem; while (size > 0) { - page = kvirt_to_pa(adr); + page = pfm_kvirt_to_pa(adr); mem_map_reserve(virt_to_page(__va(page))); - adr+=PAGE_SIZE; - size-=PAGE_SIZE; + adr += PAGE_SIZE; + size -= PAGE_SIZE; } } return mem; } static void -rvfree(void *mem, unsigned long size) +pfm_rvfree(void *mem, unsigned long size) { - unsigned long adr, page; + unsigned long adr, page = 0; if (mem) { adr=(unsigned long) mem; while (size > 0) { - page = kvirt_to_pa(adr); + page = pfm_kvirt_to_pa(adr); mem_map_unreserve(virt_to_page(__va(page))); adr+=PAGE_SIZE; size-=PAGE_SIZE; } vfree(mem); } + return; +} + +/* + * This function gets called from mm/mmap.c:exit_mmap() only when there is a sampling buffer + * attached to the context AND the current task has a mapping for it, i.e., it is the original + * creator of the context. + * + * This function is used to remember the fact that the vma describing the sampling buffer + * has now been removed. It can only be called when no other tasks share the same mm context. + * + */ +static void +pfm_vm_close(struct vm_area_struct *vma) +{ + pfm_smpl_buffer_desc_t *psb = (pfm_smpl_buffer_desc_t *)vma->vm_private_data; + + if (psb == NULL) { + printk("perfmon: psb is null in [%d]\n", current->pid); + return; + } + /* + * Add PSB to list of buffers to free on release_thread() when no more users + * + * This call is safe because, once the count is zero is cannot be modified anymore. + * This is not because there is no more user of the mm context, that the sampling + * buffer is not being used anymore outside of this task. In fact, it can still + * be accessed from within the kernel by another task (such as the monitored task). + * + * Therefore, we only move the psb into the list of buffers to free when we know + * nobody else is using it. + * The linked list if independent of the perfmon context, because in the case of + * multi-threaded processes, the last thread may not have been involved with + * monitoring however it will be the one removing the vma and it should therefore + * also remove the sampling buffer. This buffer cannot be removed until the vma + * is removed. + * + * This function cannot remove the buffer from here, because exit_mmap() must first + * complete. Given that there is no other vma related callback in the generic code, + * we have created our own with the linked list of sampling buffers to free. The list + * is part of the thread structure. In release_thread() we check if the list is + * empty. If not we call into perfmon to free the buffer and psb. That is the only + * way to ensure a safe deallocation of the sampling buffer which works when + * the buffer is shared between distinct processes or with multi-threaded programs. + * + * We need to lock the psb because the refcnt test and flag manipulation must + * looked like an atomic operation vis a vis pfm_context_exit() + */ + LOCK_PSB(psb); + + if (psb->psb_refcnt == 0) { + + psb->psb_next = current->thread.pfm_smpl_buf_list; + current->thread.pfm_smpl_buf_list = psb; + + DBprintk(("[%d] add smpl @%p size %lu to smpl_buf_list psb_flags=0x%x\n", + current->pid, psb->psb_hdr, psb->psb_size, psb->psb_flags)); + } + DBprintk(("[%d] clearing psb_flags=0x%x smpl @%p size %lu\n", + current->pid, psb->psb_flags, psb->psb_hdr, psb->psb_size)); + /* + * decrement the number vma for the buffer + */ + psb->psb_flags &= ~PSB_HAS_VMA; + + UNLOCK_PSB(psb); +} + +/* + * This function is called from pfm_destroy_context() and also from pfm_inherit() + * to explicitely remove the sampling buffer mapping from the user level address space. + */ +static int +pfm_remove_smpl_mapping(struct task_struct *task) +{ + pfm_context_t *ctx = task->thread.pfm_context; + pfm_smpl_buffer_desc_t *psb; + int r; + + /* + * some sanity checks first + */ + if (ctx == NULL || task->mm == NULL || ctx->ctx_smpl_vaddr == 0 || ctx->ctx_psb == NULL) { + printk("perfmon: invalid context mm=%p\n", task->mm); + return -1; + } + psb = ctx->ctx_psb; + + down_write(&task->mm->mmap_sem); + + r = do_munmap(task->mm, ctx->ctx_smpl_vaddr, psb->psb_size); + + up_write(&task->mm->mmap_sem); + if (r !=0) { + printk("perfmon: pid %d unable to unmap sampling buffer @0x%lx size=%ld\n", + task->pid, ctx->ctx_smpl_vaddr, psb->psb_size); + } + + DBprintk(("[%d] do_unmap(0x%lx, %ld)=%d refcnt=%lu psb_flags=0x%x\n", + task->pid, ctx->ctx_smpl_vaddr, psb->psb_size, r, psb->psb_refcnt, psb->psb_flags)); + + return 0; } static pfm_context_t * pfm_context_alloc(void) { - pfm_context_t *pfc; + pfm_context_t *ctx; /* allocate context descriptor */ - pfc = vmalloc(sizeof(*pfc)); - if (pfc) memset(pfc, 0, sizeof(*pfc)); - - return pfc; + ctx = kmalloc(sizeof(pfm_context_t), GFP_KERNEL); + if (ctx) memset(ctx, 0, sizeof(pfm_context_t)); + + return ctx; } static void -pfm_context_free(pfm_context_t *pfc) +pfm_context_free(pfm_context_t *ctx) { - if (pfc) vfree(pfc); + if (ctx) kfree(ctx); } static int @@ -434,11 +677,13 @@ { unsigned long page; - while (size > 0) { - page = kvirt_to_pa(buf); + DBprintk(("CPU%d buf=0x%lx addr=0x%lx size=%ld\n", smp_processor_id(), buf, addr, size)); - if (remap_page_range(addr, page, PAGE_SIZE, PAGE_SHARED)) return -ENOMEM; + while (size > 0) { + page = pfm_kvirt_to_pa(buf); + if (remap_page_range(addr, page, PAGE_SIZE, PAGE_READONLY)) return -ENOMEM; + addr += PAGE_SIZE; buf += PAGE_SIZE; size -= PAGE_SIZE; @@ -458,7 +703,7 @@ for (i=0; i < size; i++, which++) res += hweight64(*which); - DBprintk((" res=%ld\n", res)); + DBprintk(("weight=%ld\n", res)); return res; } @@ -467,223 +712,352 @@ * Allocates the sampling buffer and remaps it into caller's address space */ static int -pfm_smpl_buffer_alloc(pfm_context_t *ctx, unsigned long which_pmds, unsigned long entries, void **user_addr) +pfm_smpl_buffer_alloc(pfm_context_t *ctx, unsigned long *which_pmds, unsigned long entries, + void **user_vaddr) { struct mm_struct *mm = current->mm; - struct vm_area_struct *vma; - unsigned long addr, size, regcount; + struct vm_area_struct *vma = NULL; + unsigned long size, regcount; void *smpl_buf; pfm_smpl_buffer_desc_t *psb; - regcount = pfm_smpl_entry_size(&which_pmds, 1); /* note that regcount might be 0, in this case only the header for each * entry will be recorded. */ + regcount = pfm_smpl_entry_size(which_pmds, 1); + + if ((sizeof(perfmon_smpl_hdr_t)+ entries*sizeof(perfmon_smpl_entry_t)) <= entries) { + DBprintk(("requested entries %lu is too big\n", entries)); + return -EINVAL; + } /* * 1 buffer hdr and for each entry a header + regcount PMDs to save */ size = PAGE_ALIGN( sizeof(perfmon_smpl_hdr_t) + entries * (sizeof(perfmon_smpl_entry_t) + regcount*sizeof(u64))); + + DBprintk(("sampling buffer size=%lu bytes\n", size)); + /* * check requested size to avoid Denial-of-service attacks - * XXX: may have to refine this test + * XXX: may have to refine this test + * Check against address space limit. + * + * if ((mm->total_vm << PAGE_SHIFT) + len> current->rlim[RLIMIT_AS].rlim_cur) + * return -ENOMEM; */ if (size > current->rlim[RLIMIT_MEMLOCK].rlim_cur) return -EAGAIN; - /* find some free area in address space */ - addr = get_unmapped_area(NULL, 0, size, 0, MAP_PRIVATE); - if (!addr) goto no_addr; + /* + * We do the easy to undo allocations first. + * + * pfm_rvmalloc(), clears the buffer, so there is no leak + */ + smpl_buf = pfm_rvmalloc(size); + if (smpl_buf == NULL) { + DBprintk(("Can't allocate sampling buffer\n")); + return -ENOMEM; + } + + DBprintk(("smpl_buf @%p\n", smpl_buf)); - DBprintk((" entries=%ld aligned size=%ld, unmapped @0x%lx\n", entries, size, addr)); + /* allocate sampling buffer descriptor now */ + psb = kmalloc(sizeof(*psb), GFP_KERNEL); + if (psb == NULL) { + DBprintk(("Can't allocate sampling buffer descriptor\n")); + pfm_rvfree(smpl_buf, size); + return -ENOMEM; + } /* allocate vma */ vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); - if (!vma) goto no_vma; - - /* XXX: see rvmalloc() for page alignment problem */ - smpl_buf = rvmalloc(size); - if (smpl_buf == NULL) goto no_buffer; - - DBprintk((" smpl_buf @%p\n", smpl_buf)); - - if (pfm_remap_buffer((unsigned long)smpl_buf, addr, size)) goto cant_remap; - - /* allocate sampling buffer descriptor now */ - psb = vmalloc(sizeof(*psb)); - if (psb == NULL) goto no_buffer_desc; + if (!vma) { + DBprintk(("Cannot allocate vma\n")); + goto error; + } + /* + * partially initialize the vma for the sampling buffer + * + * The VM_DONTCOPY flag is very important as it ensures that the mapping + * will never be inherited for any child process (via fork()) which is always + * what we want. + */ + vma->vm_mm = mm; + vma->vm_flags = VM_READ| VM_MAYREAD |VM_RESERVED|VM_DONTCOPY; + vma->vm_page_prot = PAGE_READONLY; /* XXX may need to change */ + vma->vm_ops = &pfm_vm_ops; /* necesarry to get the close() callback */ + vma->vm_pgoff = 0; + vma->vm_file = NULL; + vma->vm_raend = 0; + vma->vm_private_data = psb; /* information needed by the pfm_vm_close() function */ - /* start with something clean */ - memset(smpl_buf, 0x0, size); + /* + * Now we have everything we need and we can initialize + * and connect all the data structures + */ psb->psb_hdr = smpl_buf; - psb->psb_addr = (char *)smpl_buf+sizeof(perfmon_smpl_hdr_t); /* first entry */ + psb->psb_addr = ((char *)smpl_buf)+sizeof(perfmon_smpl_hdr_t); /* first entry */ psb->psb_size = size; /* aligned size */ psb->psb_index = 0; psb->psb_entries = entries; + psb->psb_refcnt = 1; + psb->psb_flags = PSB_HAS_VMA; - atomic_set(&psb->psb_refcnt, 1); + spin_lock_init(&psb->psb_lock); + /* + * XXX: will need to do cacheline alignment to avoid false sharing in SMP mode and + * multitask monitoring. + */ psb->psb_entry_size = sizeof(perfmon_smpl_entry_t) + regcount*sizeof(u64); - DBprintk((" psb @%p entry_size=%ld hdr=%p addr=%p\n", (void *)psb,psb->psb_entry_size, (void *)psb->psb_hdr, (void *)psb->psb_addr)); - - /* initialize some of the fields of header */ - psb->psb_hdr->hdr_version = PFM_SMPL_HDR_VERSION; - psb->psb_hdr->hdr_entry_size = sizeof(perfmon_smpl_entry_t)+regcount*sizeof(u64); - psb->psb_hdr->hdr_pmds = which_pmds; + DBprintk(("psb @%p entry_size=%ld hdr=%p addr=%p refcnt=%lu psb_flags=0x%x\n", + (void *)psb,psb->psb_entry_size, (void *)psb->psb_hdr, + (void *)psb->psb_addr, psb->psb_refcnt, psb->psb_flags)); - /* store which PMDS to record */ - ctx->ctx_smpl_regs = which_pmds; - - /* link to perfmon context */ - ctx->ctx_smpl_buf = psb; + /* initialize some of the fields of user visible buffer header */ + psb->psb_hdr->hdr_version = PFM_SMPL_VERSION; + psb->psb_hdr->hdr_entry_size = psb->psb_entry_size; + psb->psb_hdr->hdr_pmds[0] = which_pmds[0]; /* - * initialize the vma for the sampling buffer + * Let's do the difficult operations next. + * + * now we atomically find some area in the address space and + * remap the buffer in it. */ - vma->vm_mm = mm; - vma->vm_start = addr; - vma->vm_end = addr + size; - vma->vm_flags = VM_READ|VM_MAYREAD; - vma->vm_page_prot = PAGE_READONLY; /* XXX may need to change */ - vma->vm_ops = NULL; - vma->vm_pgoff = 0; - vma->vm_file = NULL; - vma->vm_raend = 0; + down_write(¤t->mm->mmap_sem); - vma->vm_private_data = ctx; /* link to pfm_context(not yet used) */ + + /* find some free area in address space, must have mmap sem held */ + vma->vm_start = get_unmapped_area(NULL, 0, size, 0, MAP_PRIVATE|MAP_ANONYMOUS); + if (vma->vm_start == 0UL) { + DBprintk(("Cannot find unmapped area for size %ld\n", size)); + up_write(¤t->mm->mmap_sem); + goto error; + } + vma->vm_end = vma->vm_start + size; + + DBprintk(("entries=%ld aligned size=%ld, unmapped @0x%lx\n", entries, size, vma->vm_start)); + + /* can only be applied to current, need to have the mm semaphore held when called */ + if (pfm_remap_buffer((unsigned long)smpl_buf, vma->vm_start, size)) { + DBprintk(("Can't remap buffer\n")); + up_write(¤t->mm->mmap_sem); + goto error; + } /* - * now insert the vma in the vm list for the process + * now insert the vma in the vm list for the process, must be + * done with mmap lock held */ insert_vm_struct(mm, vma); mm->total_vm += size >> PAGE_SHIFT; + up_write(¤t->mm->mmap_sem); + + /* store which PMDS to record */ + ctx->ctx_smpl_regs[0] = which_pmds[0]; + + + /* link to perfmon context */ + ctx->ctx_psb = psb; + /* - * that's the address returned to the user + * keep track of user level virtual address */ - *user_addr = (void *)addr; + ctx->ctx_smpl_vaddr = *(unsigned long *)user_vaddr = vma->vm_start; return 0; - /* outlined error handling */ -no_addr: - DBprintk(("Cannot find unmapped area for size %ld\n", size)); - return -ENOMEM; -no_vma: - DBprintk(("Cannot allocate vma\n")); - return -ENOMEM; -cant_remap: - DBprintk(("Can't remap buffer\n")); - rvfree(smpl_buf, size); -no_buffer: - DBprintk(("Can't allocate sampling buffer\n")); - kmem_cache_free(vm_area_cachep, vma); - return -ENOMEM; -no_buffer_desc: - DBprintk(("Can't allocate sampling buffer descriptor\n")); - kmem_cache_free(vm_area_cachep, vma); - rvfree(smpl_buf, size); +error: + pfm_rvfree(smpl_buf, size); + kfree(psb); return -ENOMEM; } +/* + * XXX: do something better here + */ +static int +pfm_bad_permissions(struct task_struct *task) +{ + /* stolen from bad_signal() */ + return (current->session != task->session) + && (current->euid ^ task->suid) && (current->euid ^ task->uid) + && (current->uid ^ task->suid) && (current->uid ^ task->uid); +} + static int -pfx_is_sane(pfreq_context_t *pfx) +pfx_is_sane(struct task_struct *task, pfarg_context_t *pfx) { int ctx_flags; + int cpu; /* valid signal */ - //if (pfx->notify_sig < 1 || pfx->notify_sig >= _NSIG) return -EINVAL; - if (pfx->notify_sig !=0 && pfx->notify_sig != SIGPROF) return -EINVAL; /* cannot send to process 1, 0 means do not notify */ - if (pfx->notify_pid < 0 || pfx->notify_pid == 1) return -EINVAL; + if (pfx->ctx_notify_pid == 1) { + DBprintk(("invalid notify_pid %d\n", pfx->ctx_notify_pid)); + return -EINVAL; + } + ctx_flags = pfx->ctx_flags; - ctx_flags = pfx->flags; + if ((ctx_flags & PFM_FL_INHERIT_MASK) == (PFM_FL_INHERIT_ONCE|PFM_FL_INHERIT_ALL)) { + DBprintk(("invalid inherit mask 0x%x\n",ctx_flags & PFM_FL_INHERIT_MASK)); + return -EINVAL; + } if (ctx_flags & PFM_FL_SYSTEM_WIDE) { -#ifdef CONFIG_SMP - if (smp_num_cpus > 1) { - printk("perfmon: system wide monitoring on SMP not yet supported\n"); + DBprintk(("cpu_mask=0x%lx\n", pfx->ctx_cpu_mask)); + /* + * cannot block in this mode + */ + if (ctx_flags & PFM_FL_NOTIFY_BLOCK) { + DBprintk(("cannot use blocking mode when in system wide monitoring\n")); return -EINVAL; } -#endif - if ((ctx_flags & PFM_FL_SMPL_OVFL_NOBLOCK) == 0) { - printk("perfmon: system wide monitoring cannot use blocking notification mode\n"); + /* + * must only have one bit set in the CPU mask + */ + if (hweight64(pfx->ctx_cpu_mask) != 1UL) { + DBprintk(("invalid CPU mask specified\n")); + return -EINVAL; + } + /* + * and it must be a valid CPU + */ + cpu = ffz(~pfx->ctx_cpu_mask); + if (cpu_is_online(cpu) == 0) { + DBprintk(("CPU%d is not online\n", cpu)); + return -EINVAL; + } + /* + * check for pre-existing pinning, if conflicting reject + */ + if (task->cpus_allowed != ~0UL && (task->cpus_allowed & (1UL<pid, + task->cpus_allowed, cpu)); return -EINVAL; } - } - /* probably more to add here */ - - return 0; -} + + } else { + /* + * must provide a target for the signal in blocking mode even when + * no counter is configured with PFM_FL_REG_OVFL_NOTIFY + */ + if ((ctx_flags & PFM_FL_NOTIFY_BLOCK) && pfx->ctx_notify_pid == 0) { + DBprintk(("must have notify_pid when blocking for [%d]\n", task->pid)); + return -EINVAL; + } +#if 0 + if ((ctx_flags & PFM_FL_NOTIFY_BLOCK) && pfx->ctx_notify_pid == task->pid) { + DBprintk(("cannot notify self when blocking for [%d]\n", task->pid)); + return -EINVAL; + } +#endif + } + /* probably more to add here */ + + return 0; +} static int -pfm_context_create(int flags, perfmon_req_t *req) +pfm_context_create(struct task_struct *task, pfm_context_t *ctx, void *req, int count, + struct pt_regs *regs) { - pfm_context_t *ctx; - struct task_struct *task = NULL; - perfmon_req_t tmp; + pfarg_context_t tmp; void *uaddr = NULL; - int ret; + int ret, cpu = 0; int ctx_flags; - pid_t pid; + pid_t notify_pid; - /* to go away */ - if (flags) { - printk("perfmon: use context flags instead of perfmon() flags. Obsoleted API\n"); - } + /* a context has already been defined */ + if (ctx) return -EBUSY; + + /* + * not yet supported + */ + if (task != current) return -EINVAL; if (copy_from_user(&tmp, req, sizeof(tmp))) return -EFAULT; - ret = pfx_is_sane(&tmp.pfr_ctx); + ret = pfx_is_sane(task, &tmp); if (ret < 0) return ret; - ctx_flags = tmp.pfr_ctx.flags; + ctx_flags = tmp.ctx_flags; + + ret = -EBUSY; + + LOCK_PFS(); if (ctx_flags & PFM_FL_SYSTEM_WIDE) { + + /* at this point, we know there is at least one bit set */ + cpu = ffz(~tmp.ctx_cpu_mask); + + DBprintk(("requesting CPU%d currently on CPU%d\n",cpu, smp_processor_id())); + + if (pfm_sessions.pfs_task_sessions > 0) { + DBprintk(("system wide not possible, task_sessions=%ld\n", pfm_sessions.pfs_task_sessions)); + goto abort; + } + + if (pfm_sessions.pfs_sys_session[cpu]) { + DBprintk(("system wide not possible, conflicting session [%d] on CPU%d\n",pfm_sessions.pfs_sys_session[cpu]->pid, cpu)); + goto abort; + } + pfm_sessions.pfs_sys_session[cpu] = task; /* - * XXX: This is not AT ALL SMP safe + * count the number of system wide sessions */ - if (pfs_info.pfs_proc_sessions > 0) return -EBUSY; - if (pfs_info.pfs_sys_session > 0) return -EBUSY; - - pfs_info.pfs_sys_session = 1; + pfm_sessions.pfs_sys_sessions++; - } else if (pfs_info.pfs_sys_session >0) { + } else if (pfm_sessions.pfs_sys_sessions == 0) { + pfm_sessions.pfs_task_sessions++; + } else { /* no per-process monitoring while there is a system wide session */ - return -EBUSY; - } else - pfs_info.pfs_proc_sessions++; + goto abort; + } + + UNLOCK_PFS(); + + ret = -ENOMEM; ctx = pfm_context_alloc(); if (!ctx) goto error; - /* record the creator (debug only) */ - ctx->ctx_creator = current; + /* record the creator (important for inheritance) */ + ctx->ctx_owner = current; - pid = tmp.pfr_ctx.notify_pid; + notify_pid = tmp.ctx_notify_pid; - spin_lock_init(&ctx->ctx_notify_lock); + spin_lock_init(&ctx->ctx_lock); + + if (notify_pid == current->pid) { - if (pid == current->pid) { ctx->ctx_notify_task = task = current; current->thread.pfm_context = ctx; - atomic_set(¤t->thread.pfm_notifiers_check, 1); + } else if (notify_pid!=0) { + struct task_struct *notify_task; - } else if (pid!=0) { read_lock(&tasklist_lock); - task = find_task_by_pid(pid); - if (task) { + notify_task = find_task_by_pid(notify_pid); + + if (notify_task) { + + ret = -EPERM; + /* - * record who to notify - */ - ctx->ctx_notify_task = task; + * check if we can send this task a signal + */ + if (pfm_bad_permissions(notify_task)) goto buffer_error; /* * make visible @@ -702,7 +1076,9 @@ * task has been detached from the tasklist otherwise you are * exposed to race conditions. */ - atomic_add(1, &task->thread.pfm_notifiers_check); + atomic_add(1, &ctx->ctx_notify_task->thread.pfm_notifiers_check); + + ctx->ctx_notify_task = notify_task; } read_unlock(&tasklist_lock); } @@ -710,71 +1086,71 @@ /* * notification process does not exist */ - if (pid != 0 && task == NULL) { + if (notify_pid != 0 && ctx->ctx_notify_task == NULL) { ret = -EINVAL; goto buffer_error; } - ctx->ctx_notify_sig = SIGPROF; /* siginfo imposes a fixed signal */ - - if (tmp.pfr_ctx.smpl_entries) { - DBprintk((" sampling entries=%ld\n",tmp.pfr_ctx.smpl_entries)); + if (tmp.ctx_smpl_entries) { + DBprintk(("sampling entries=%lu\n",tmp.ctx_smpl_entries)); - ret = pfm_smpl_buffer_alloc(ctx, tmp.pfr_ctx.smpl_regs, - tmp.pfr_ctx.smpl_entries, &uaddr); + ret = pfm_smpl_buffer_alloc(ctx, tmp.ctx_smpl_regs, + tmp.ctx_smpl_entries, &uaddr); if (ret<0) goto buffer_error; - tmp.pfr_ctx.smpl_vaddr = uaddr; + tmp.ctx_smpl_vaddr = uaddr; } /* initialization of context's flags */ - ctx->ctx_fl_inherit = ctx_flags & PFM_FL_INHERIT_MASK; - ctx->ctx_fl_noblock = (ctx_flags & PFM_FL_SMPL_OVFL_NOBLOCK) ? 1 : 0; - ctx->ctx_fl_system = (ctx_flags & PFM_FL_SYSTEM_WIDE) ? 1: 0; - ctx->ctx_fl_exclintr = (ctx_flags & PFM_FL_EXCL_INTR) ? 1: 0; - ctx->ctx_fl_frozen = 0; - - /* - * Keep track of the pmds we want to sample - * XXX: may be we don't need to save/restore the DEAR/IEAR pmds - * but we do need the BTB for sure. This is because of a hardware - * buffer of 1 only for non-BTB pmds. - */ - ctx->ctx_used_pmds[0] = tmp.pfr_ctx.smpl_regs; - ctx->ctx_used_pmcs[0] = 1; /* always save/restore PMC[0] */ + ctx->ctx_fl_inherit = ctx_flags & PFM_FL_INHERIT_MASK; + ctx->ctx_fl_block = (ctx_flags & PFM_FL_NOTIFY_BLOCK) ? 1 : 0; + ctx->ctx_fl_system = (ctx_flags & PFM_FL_SYSTEM_WIDE) ? 1: 0; + ctx->ctx_fl_frozen = 0; + /* + * setting this flag to 0 here means, that the creator or the task that the + * context is being attached are granted access. Given that a context can only + * be created for the calling process this, in effect only allows the creator + * to access the context. See pfm_protect() for more. + */ + ctx->ctx_fl_protected = 0; + + /* for system wide mode only (only 1 bit set) */ + ctx->ctx_cpu = cpu; + + atomic_set(&ctx->ctx_last_cpu,-1); /* SMP only, means no CPU */ + + /* may be redudant with memset() but at least it's easier to remember */ + atomic_set(&ctx->ctx_saving_in_progress, 0); + atomic_set(&ctx->ctx_is_busy, 0); sema_init(&ctx->ctx_restart_sem, 0); /* init this semaphore to locked */ - if (copy_to_user(req, &tmp, sizeof(tmp))) { ret = -EFAULT; goto buffer_error; } - DBprintk((" context=%p, pid=%d notify_sig %d notify_task=%p\n",(void *)ctx, current->pid, ctx->ctx_notify_sig, ctx->ctx_notify_task)); - DBprintk((" context=%p, pid=%d flags=0x%x inherit=%d noblock=%d system=%d\n",(void *)ctx, current->pid, ctx_flags, ctx->ctx_fl_inherit, ctx->ctx_fl_noblock, ctx->ctx_fl_system)); + DBprintk(("context=%p, pid=%d notify_task=%p\n", + (void *)ctx, task->pid, ctx->ctx_notify_task)); + + DBprintk(("context=%p, pid=%d flags=0x%x inherit=%d block=%d system=%d\n", + (void *)ctx, task->pid, ctx_flags, ctx->ctx_fl_inherit, + ctx->ctx_fl_block, ctx->ctx_fl_system)); /* * when no notification is required, we can make this visible at the last moment */ - if (pid == 0) current->thread.pfm_context = ctx; - + if (notify_pid == 0) task->thread.pfm_context = ctx; /* - * by default, we always include interrupts for system wide - * DCR.pp is set by default to zero by kernel in cpu_init() + * pin task to CPU and force reschedule on exit to ensure + * that when back to user level the task runs on the designated + * CPU. */ if (ctx->ctx_fl_system) { - if (ctx->ctx_fl_exclintr == 0) { - unsigned long dcr = ia64_get_dcr(); - - ia64_set_dcr(dcr|IA64_DCR_PP); - /* - * keep track of the kernel default value - */ - pfs_info.pfs_dfl_dcr = dcr; - - DBprintk((" dcr.pp is set\n")); - } - } + ctx->ctx_saved_cpus_allowed = task->cpus_allowed; + task->cpus_allowed = 1UL << cpu; + task->need_resched = 1; + DBprintk(("[%d] rescheduled allowed=0x%lx\n", task->pid,task->cpus_allowed)); + } return 0; @@ -784,225 +1160,511 @@ /* * undo session reservation */ + LOCK_PFS(); + if (ctx_flags & PFM_FL_SYSTEM_WIDE) { - pfs_info.pfs_sys_session = 0; + pfm_sessions.pfs_sys_session[cpu] = NULL; + pfm_sessions.pfs_sys_sessions--; } else { - pfs_info.pfs_proc_sessions--; + pfm_sessions.pfs_task_sessions--; } +abort: + UNLOCK_PFS(); + return ret; } static void -pfm_reset_regs(pfm_context_t *ctx) +pfm_reset_regs(pfm_context_t *ctx, unsigned long *ovfl_regs, int flag) { - unsigned long mask = ctx->ctx_ovfl_regs; - int i, cnum; + unsigned long mask = ovfl_regs[0]; + unsigned long reset_others = 0UL; + unsigned long val; + int i; + + DBprintk(("masks=0x%lx\n", mask)); - DBprintk((" ovfl_regs=0x%lx\n", mask)); /* * now restore reset value on sampling overflowed counters */ - for(i=0, cnum=PMU_FIRST_COUNTER; i < pmu_conf.max_counters; i++, cnum++, mask >>= 1) { + mask >>= PMU_FIRST_COUNTER; + for(i = PMU_FIRST_COUNTER; mask; i++, mask >>= 1) { if (mask & 0x1) { - DBprintk((" reseting PMD[%d]=%lx\n", cnum, ctx->ctx_pmds[i].smpl_rval & pmu_conf.perf_ovfl_val)); + val = flag == PFM_RELOAD_LONG_RESET ? + ctx->ctx_soft_pmds[i].long_reset: + ctx->ctx_soft_pmds[i].short_reset; + + reset_others |= ctx->ctx_soft_pmds[i].reset_pmds[0]; + + DBprintk(("[%d] %s reset soft_pmd[%d]=%lx\n", + current->pid, + flag == PFM_RELOAD_LONG_RESET ? "long" : "short", i, val)); /* upper part is ignored on rval */ - ia64_set_pmd(cnum, ctx->ctx_pmds[i].smpl_rval); + pfm_write_soft_counter(ctx, i, val); + } + } - /* - * we must reset BTB index (clears pmd16.full to make - * sure we do not report the same branches twice. - * The non-blocking case in handled in update_counters() - */ - if (cnum == ctx->ctx_btb_counter) { - DBprintk(("reseting PMD16\n")); - ia64_set_pmd(16, 0); - } + /* + * Now take care of resetting the other registers + */ + for(i = 0; reset_others; i++, reset_others >>= 1) { + + if ((reset_others & 0x1) == 0) continue; + + val = flag == PFM_RELOAD_LONG_RESET ? + ctx->ctx_soft_pmds[i].long_reset: + ctx->ctx_soft_pmds[i].short_reset; + + if (PMD_IS_COUNTING(i)) { + pfm_write_soft_counter(ctx, i, val); + } else { + ia64_set_pmd(i, val); } + + DBprintk(("[%d] %s reset_others pmd[%d]=%lx\n", + current->pid, + flag == PFM_RELOAD_LONG_RESET ? "long" : "short", i, val)); } + ia64_srlz_d(); /* just in case ! */ - ctx->ctx_ovfl_regs = 0; + ctx->ctx_ovfl_regs[0] = 0UL; } static int -pfm_write_pmcs(struct task_struct *ta, perfmon_req_t *req, int count) +pfm_write_pmcs(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) { - struct thread_struct *th = &ta->thread; - pfm_context_t *ctx = th->pfm_context; - perfmon_req_t tmp; - unsigned long cnum; + struct thread_struct *th = &task->thread; + pfarg_reg_t tmp, *req = (pfarg_reg_t *)arg; + unsigned int cnum; int i; + int ret = 0, reg_retval = 0; + + /* we don't quite support this right now */ + if (task != current) return -EINVAL; + + if (!CTX_IS_ENABLED(ctx)) return -EINVAL; /* XXX: ctx locking may be required here */ for (i = 0; i < count; i++, req++) { + if (copy_from_user(&tmp, req, sizeof(tmp))) return -EFAULT; - cnum = tmp.pfr_reg.reg_num; + cnum = tmp.reg_num; - /* XXX needs to check validity of the data maybe */ - if (!PMC_IS_IMPL(cnum)) { - DBprintk((" invalid pmc[%ld]\n", cnum)); - return -EINVAL; + /* + * we reject all non implemented PMC as well + * as attempts to modify PMC[0-3] which are used + * as status registers by the PMU + */ + if (!PMC_IS_IMPL(cnum) || cnum < 4) { + DBprintk(("pmc[%u] is unimplemented or invalid\n", cnum)); + ret = -EINVAL; + goto abort_mission; } + /* + * A PMC used to configure monitors must be: + * - system-wide session: privileged monitor + * - per-task : user monitor + * any other configuration is rejected. + */ + if (PMC_IS_MONITOR(cnum) || PMC_IS_COUNTING(cnum)) { + DBprintk(("pmc[%u].pm=%ld\n", cnum, PMC_PM(cnum, tmp.reg_value))); - if (PMC_IS_COUNTER(cnum)) { + if (ctx->ctx_fl_system ^ PMC_PM(cnum, tmp.reg_value)) { + DBprintk(("pmc_pm=%ld fl_system=%d\n", PMC_PM(cnum, tmp.reg_value), ctx->ctx_fl_system)); + ret = -EINVAL; + goto abort_mission; + } + } + if (PMC_IS_COUNTING(cnum)) { + pfm_monitor_t *p = (pfm_monitor_t *)&tmp.reg_value; /* - * we keep track of EARS/BTB to speed up sampling later - */ - if (PMC_IS_DEAR(&tmp.pfr_reg.reg_value)) { - ctx->ctx_dear_counter = cnum; - } else if (PMC_IS_IEAR(&tmp.pfr_reg.reg_value)) { - ctx->ctx_iear_counter = cnum; - } else if (PMC_IS_BTB(&tmp.pfr_reg.reg_value)) { - ctx->ctx_btb_counter = cnum; + * enforce generation of overflow interrupt. Necessary on all + * CPUs. + */ + p->pmc_oi = 1; + + if (tmp.reg_flags & PFM_REGFL_OVFL_NOTIFY) { + /* + * must have a target for the signal + */ + if (ctx->ctx_notify_task == NULL) { + DBprintk(("no notify_task && PFM_REGFL_OVFL_NOTIFY\n")); + ret = -EINVAL; + goto abort_mission; + } + + ctx->ctx_soft_pmds[cnum].flags |= PFM_REGFL_OVFL_NOTIFY; } -#if 0 - if (tmp.pfr_reg.reg_flags & PFM_REGFL_OVFL_NOTIFY) - ctx->ctx_pmds[cnum - PMU_FIRST_COUNTER].flags |= PFM_REGFL_OVFL_NOTIFY; -#endif + /* + * copy reset vector + */ + ctx->ctx_soft_pmds[cnum].reset_pmds[0] = tmp.reg_reset_pmds[0]; + ctx->ctx_soft_pmds[cnum].reset_pmds[1] = tmp.reg_reset_pmds[1]; + ctx->ctx_soft_pmds[cnum].reset_pmds[2] = tmp.reg_reset_pmds[2]; + ctx->ctx_soft_pmds[cnum].reset_pmds[3] = tmp.reg_reset_pmds[3]; } - /* keep track of what we use */ - CTX_USED_PMC(ctx, cnum); - ia64_set_pmc(cnum, tmp.pfr_reg.reg_value); + /* + * execute write checker, if any + */ + if (PMC_WR_FUNC(cnum)) ret = PMC_WR_FUNC(cnum)(task, cnum, &tmp.reg_value, regs); +abort_mission: + if (ret == -EINVAL) reg_retval = PFM_REG_RETFL_EINVAL; - DBprintk((" setting PMC[%ld]=0x%lx flags=0x%x used_pmcs=0%lx\n", cnum, tmp.pfr_reg.reg_value, ctx->ctx_pmds[cnum - PMU_FIRST_COUNTER].flags, ctx->ctx_used_pmcs[0])); + PFM_REG_RETFLAG_SET(tmp.reg_flags, reg_retval); - } - /* - * we have to set this here event hough we haven't necessarily started monitoring - * because we may be context switched out - */ - if (ctx->ctx_fl_system==0) th->flags |= IA64_THREAD_PM_VALID; + /* + * update register return value, abort all if problem during copy. + */ + if (copy_to_user(req, &tmp, sizeof(tmp))) return -EFAULT; - return 0; + /* + * if there was something wrong on this register, don't touch + * the hardware at all and abort write request for others. + * + * On error, the user mut sequentially scan the table and the first + * entry which has a return flag set is the one that caused the error. + */ + if (ret != 0) { + DBprintk(("[%d] pmc[%u]=0x%lx error %d\n", + task->pid, cnum, tmp.reg_value, reg_retval)); + break; + } + + /* + * We can proceed with this register! + */ + + /* + * Needed in case the user does not initialize the equivalent + * PMD. Clearing is done in reset_pmu() so there is no possible + * leak here. + */ + CTX_USED_PMD(ctx, pmu_conf.pmc_desc[cnum].dep_pmd[0]); + + /* + * keep copy the pmc, used for register reload + */ + th->pmc[cnum] = tmp.reg_value; + + ia64_set_pmc(cnum, tmp.reg_value); + + DBprintk(("[%d] pmc[%u]=0x%lx flags=0x%x used_pmds=0x%lx\n", + task->pid, cnum, tmp.reg_value, + ctx->ctx_soft_pmds[cnum].flags, + ctx->ctx_used_pmds[0])); + + } + return ret; } static int -pfm_write_pmds(struct task_struct *ta, perfmon_req_t *req, int count) +pfm_write_pmds(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) { - struct thread_struct *th = &ta->thread; - pfm_context_t *ctx = th->pfm_context; - perfmon_req_t tmp; - unsigned long cnum; + pfarg_reg_t tmp, *req = (pfarg_reg_t *)arg; + unsigned int cnum; int i; + int ret = 0, reg_retval = 0; + + /* we don't quite support this right now */ + if (task != current) return -EINVAL; + + /* + * Cannot do anything before PMU is enabled + */ + if (!CTX_IS_ENABLED(ctx)) return -EINVAL; + /* XXX: ctx locking may be required here */ for (i = 0; i < count; i++, req++) { - int k; if (copy_from_user(&tmp, req, sizeof(tmp))) return -EFAULT; - cnum = tmp.pfr_reg.reg_num; + cnum = tmp.reg_num; + if (!PMD_IS_IMPL(cnum)) { + ret = -EINVAL; + goto abort_mission; + } + + /* update virtualized (64bits) counter */ + if (PMD_IS_COUNTING(cnum)) { + ctx->ctx_soft_pmds[cnum].ival = tmp.reg_value; + ctx->ctx_soft_pmds[cnum].val = tmp.reg_value & ~pmu_conf.perf_ovfl_val; + ctx->ctx_soft_pmds[cnum].long_reset = tmp.reg_long_reset; + ctx->ctx_soft_pmds[cnum].short_reset = tmp.reg_short_reset; - k = cnum - PMU_FIRST_COUNTER; + } + /* + * execute write checker, if any + */ + if (PMD_WR_FUNC(cnum)) ret = PMD_WR_FUNC(cnum)(task, cnum, &tmp.reg_value, regs); +abort_mission: + if (ret == -EINVAL) reg_retval = PFM_REG_RETFL_EINVAL; - if (!PMD_IS_IMPL(cnum)) return -EINVAL; + PFM_REG_RETFLAG_SET(tmp.reg_flags, reg_retval); - /* update virtualized (64bits) counter */ - if (PMD_IS_COUNTER(cnum)) { - ctx->ctx_pmds[k].ival = tmp.pfr_reg.reg_value; - ctx->ctx_pmds[k].val = tmp.pfr_reg.reg_value & ~pmu_conf.perf_ovfl_val; - ctx->ctx_pmds[k].smpl_rval = tmp.pfr_reg.reg_smpl_reset; - ctx->ctx_pmds[k].ovfl_rval = tmp.pfr_reg.reg_ovfl_reset; + if (copy_to_user(req, &tmp, sizeof(tmp))) return -EFAULT; - if (tmp.pfr_reg.reg_flags & PFM_REGFL_OVFL_NOTIFY) - ctx->ctx_pmds[cnum - PMU_FIRST_COUNTER].flags |= PFM_REGFL_OVFL_NOTIFY; + /* + * if there was something wrong on this register, don't touch + * the hardware at all and abort write request for others. + * + * On error, the user mut sequentially scan the table and the first + * entry which has a return flag set is the one that caused the error. + */ + if (ret != 0) { + DBprintk(("[%d] pmc[%u]=0x%lx error %d\n", + task->pid, cnum, tmp.reg_value, reg_retval)); + break; } + /* keep track of what we use */ - CTX_USED_PMD(ctx, cnum); + CTX_USED_PMD(ctx, pmu_conf.pmd_desc[(cnum)].dep_pmd[0]); + /* mark this register as used as well */ + CTX_USED_PMD(ctx, RDEP(cnum)); /* writes to unimplemented part is ignored, so this is safe */ - ia64_set_pmd(cnum, tmp.pfr_reg.reg_value); + ia64_set_pmd(cnum, tmp.reg_value & pmu_conf.perf_ovfl_val); /* to go away */ ia64_srlz_d(); - DBprintk((" setting PMD[%ld]: ovfl_notify=%d pmd.val=0x%lx pmd.ovfl_rval=0x%lx pmd.smpl_rval=0x%lx pmd=%lx used_pmds=0%lx\n", - cnum, - PMD_OVFL_NOTIFY(ctx, cnum - PMU_FIRST_COUNTER), - ctx->ctx_pmds[k].val, - ctx->ctx_pmds[k].ovfl_rval, - ctx->ctx_pmds[k].smpl_rval, - ia64_get_pmd(cnum) & pmu_conf.perf_ovfl_val, - ctx->ctx_used_pmds[0])); - } - /* - * we have to set this here event hough we haven't necessarily started monitoring - * because we may be context switched out - */ - if (ctx->ctx_fl_system==0) th->flags |= IA64_THREAD_PM_VALID; - return 0; + DBprintk(("[%d] pmd[%u]: soft_pmd=0x%lx short_reset=0x%lx " + "long_reset=0x%lx hw_pmd=%lx notify=%c used_pmds=0x%lx reset_pmds=0x%lx\n", + task->pid, cnum, + ctx->ctx_soft_pmds[cnum].val, + ctx->ctx_soft_pmds[cnum].short_reset, + ctx->ctx_soft_pmds[cnum].long_reset, + ia64_get_pmd(cnum) & pmu_conf.perf_ovfl_val, + PMC_OVFL_NOTIFY(ctx, cnum) ? 'Y':'N', + ctx->ctx_used_pmds[0], + ctx->ctx_soft_pmds[cnum].reset_pmds[0])); + } + return ret; } static int -pfm_read_pmds(struct task_struct *ta, perfmon_req_t *req, int count) +pfm_read_pmds(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) { - struct thread_struct *th = &ta->thread; - pfm_context_t *ctx = th->pfm_context; + struct thread_struct *th = &task->thread; unsigned long val=0; - perfmon_req_t tmp; - int i; + pfarg_reg_t tmp, *req = (pfarg_reg_t *)arg; + unsigned int cnum; + int i, ret = 0; + + if (!CTX_IS_ENABLED(ctx)) return -EINVAL; /* * XXX: MUST MAKE SURE WE DON"T HAVE ANY PENDING OVERFLOW BEFORE READING - * This is required when the monitoring has been stoppped by user of kernel. - * If ity is still going on, then that's fine because we a re not gauranteed - * to return an accurate value in this case + * This is required when the monitoring has been stoppped by user or kernel. + * If it is still going on, then that's fine because we a re not guaranteed + * to return an accurate value in this case. */ /* XXX: ctx locking may be required here */ + DBprintk(("ctx_last_cpu=%d for [%d]\n", atomic_read(&ctx->ctx_last_cpu), task->pid)); + for (i = 0; i < count; i++, req++) { - unsigned long reg_val = ~0, ctx_val = ~0; + unsigned long ctx_val = ~0UL; if (copy_from_user(&tmp, req, sizeof(tmp))) return -EFAULT; - if (!PMD_IS_IMPL(tmp.pfr_reg.reg_num)) return -EINVAL; + cnum = tmp.reg_num; + + if (!PMD_IS_IMPL(cnum)) goto abort_mission; + /* + * we can only read the register that we use. That includes + * the one we explicitely initialize AND the one we want included + * in the sampling buffer (smpl_regs). + * + * Having this restriction allows optimization in the ctxsw routine + * without compromising security (leaks) + */ + if (!CTX_IS_USED_PMD(ctx, cnum)) goto abort_mission; - if (PMD_IS_COUNTER(tmp.pfr_reg.reg_num)) { - if (ta == current){ - val = ia64_get_pmd(tmp.pfr_reg.reg_num); - } else { - val = reg_val = th->pmd[tmp.pfr_reg.reg_num]; + /* + * If the task is not the current one, then we check if the + * PMU state is still in the local live register due to lazy ctxsw. + * If true, then we read directly from the registers. + */ + if (atomic_read(&ctx->ctx_last_cpu) == smp_processor_id()){ + ia64_srlz_d(); + val = ia64_get_pmd(cnum); + DBprintk(("reading pmd[%u]=0x%lx from hw\n", cnum, val)); + } else { +#ifdef CONFIG_SMP + int cpu; + /* + * for SMP system, the context may still be live on another + * CPU so we need to fetch it before proceeding with the read + * This call we only be made once for the whole loop because + * of ctx_last_cpu becoming == -1. + * + * We cannot reuse ctx_last_cpu as it may change before we get to the + * actual IPI call. In this case, we will do the call for nothing but + * there is no way around it. The receiving side will simply do nothing. + */ + cpu = atomic_read(&ctx->ctx_last_cpu); + if (cpu != -1) { + DBprintk(("must fetch on CPU%d for [%d]\n", cpu, task->pid)); + pfm_fetch_regs(cpu, task, ctx); } - val &= pmu_conf.perf_ovfl_val; +#endif + /* context has been saved */ + val = th->pmd[cnum]; + } + if (PMD_IS_COUNTING(cnum)) { /* - * lower part of .val may not be zero, so we must be an addition because of - * residual count (see update_counters). + * XXX: need to check for overflow */ - val += ctx_val = ctx->ctx_pmds[tmp.pfr_reg.reg_num - PMU_FIRST_COUNTER].val; - } else { - /* for now */ - if (ta != current) return -EINVAL; - ia64_srlz_d(); - val = ia64_get_pmd(tmp.pfr_reg.reg_num); + val &= pmu_conf.perf_ovfl_val; + val += ctx_val = ctx->ctx_soft_pmds[cnum].val; + } + + tmp.reg_value = val; + + /* + * execute read checker, if any + */ + if (PMD_RD_FUNC(cnum)) { + ret = PMD_RD_FUNC(cnum)(task, cnum, &tmp.reg_value, regs); } - tmp.pfr_reg.reg_value = val; - DBprintk((" reading PMD[%ld]=0x%lx reg=0x%lx ctx_val=0x%lx pmc=0x%lx\n", - tmp.pfr_reg.reg_num, val, reg_val, ctx_val, ia64_get_pmc(tmp.pfr_reg.reg_num))); + PFM_REG_RETFLAG_SET(tmp.reg_flags, ret); + + DBprintk(("read pmd[%u] ret=%d value=0x%lx pmc=0x%lx\n", + cnum, ret, val, ia64_get_pmc(cnum))); if (copy_to_user(req, &tmp, sizeof(tmp))) return -EFAULT; } return 0; +abort_mission: + PFM_REG_RETFLAG_SET(tmp.reg_flags, PFM_REG_RETFL_EINVAL); + /* + * XXX: if this fails, we stick with the original failure, flag not updated! + */ + copy_to_user(req, &tmp, sizeof(tmp)); + return -EINVAL; + +} + +#ifdef PFM_PMU_USES_DBR +/* + * Only call this function when a process it trying to + * write the debug registers (reading is always allowed) + */ +int +pfm_use_debug_registers(struct task_struct *task) +{ + pfm_context_t *ctx = task->thread.pfm_context; + int ret = 0; + + DBprintk(("called for [%d]\n", task->pid)); + + /* + * do it only once + */ + if (task->thread.flags & IA64_THREAD_DBG_VALID) return 0; + + /* + * Even on SMP, we do not need to use an atomic here because + * the only way in is via ptrace() and this is possible only when the + * process is stopped. Even in the case where the ctxsw out is not totally + * completed by the time we come here, there is no way the 'stopped' process + * could be in the middle of fiddling with the pfm_write_ibr_dbr() routine. + * So this is always safe. + */ + if (ctx && ctx->ctx_fl_using_dbreg == 1) return -1; + + LOCK_PFS(); + + /* + * We cannot allow setting breakpoints when system wide monitoring + * sessions are using the debug registers. + */ + if (pfm_sessions.pfs_sys_use_dbregs> 0) + ret = -1; + else + pfm_sessions.pfs_ptrace_use_dbregs++; + + DBprintk(("ptrace_use_dbregs=%lu sys_use_dbregs=%lu by [%d] ret = %d\n", + pfm_sessions.pfs_ptrace_use_dbregs, + pfm_sessions.pfs_sys_use_dbregs, + task->pid, ret)); + + UNLOCK_PFS(); + + return ret; +} + +/* + * This function is called for every task that exits with the + * IA64_THREAD_DBG_VALID set. This indicates a task which was + * able to use the debug registers for debugging purposes via + * ptrace(). Therefore we know it was not using them for + * perfmormance monitoring, so we only decrement the number + * of "ptraced" debug register users to keep the count up to date + */ +int +pfm_release_debug_registers(struct task_struct *task) +{ + int ret; + + LOCK_PFS(); + if (pfm_sessions.pfs_ptrace_use_dbregs == 0) { + printk("perfmon: invalid release for [%d] ptrace_use_dbregs=0\n", task->pid); + ret = -1; + } else { + pfm_sessions.pfs_ptrace_use_dbregs--; + ret = 0; + } + UNLOCK_PFS(); + + return ret; +} +#else /* PFM_PMU_USES_DBR is true */ +/* + * in case, the PMU does not use the debug registers, these two functions are nops. + * The first function is called from arch/ia64/kernel/ptrace.c. + * The second function is called from arch/ia64/kernel/process.c. + */ +int +pfm_use_debug_registers(struct task_struct *task) +{ + return 0; +} + +int +pfm_release_debug_registers(struct task_struct *task) +{ + return 0; } +#endif /* PFM_PMU_USES_DBR */ static int -pfm_do_restart(struct task_struct *task) +pfm_restart(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, + struct pt_regs *regs) { - struct thread_struct *th = &task->thread; - pfm_context_t *ctx = th->pfm_context; void *sem = &ctx->ctx_restart_sem; + /* + * Cannot do anything before PMU is enabled + */ + if (!CTX_IS_ENABLED(ctx)) return -EINVAL; + if (task == current) { - DBprintk((" restarting self %d frozen=%d \n", current->pid, ctx->ctx_fl_frozen)); + DBprintk(("restarting self %d frozen=%d \n", current->pid, ctx->ctx_fl_frozen)); + + pfm_reset_regs(ctx, ctx->ctx_ovfl_regs, PFM_RELOAD_LONG_RESET); - pfm_reset_regs(ctx); + ctx->ctx_ovfl_regs[0] = 0UL; /* * We ignore block/don't block because we never block @@ -1011,26 +1673,36 @@ ctx->ctx_fl_frozen = 0; if (CTX_HAS_SMPL(ctx)) { - ctx->ctx_smpl_buf->psb_hdr->hdr_count = 0; - ctx->ctx_smpl_buf->psb_index = 0; + ctx->ctx_psb->psb_hdr->hdr_count = 0; + ctx->ctx_psb->psb_index = 0; } - /* pfm_reset_smpl_buffers(ctx,th->pfm_ovfl_regs);*/ - /* simply unfreeze */ ia64_set_pmc(0, 0); ia64_srlz_d(); return 0; - } + } + /* restart on another task */ - /* check if blocking */ + /* + * if blocking, then post the semaphore. + * if non-blocking, then we ensure that the task will go into + * pfm_overflow_must_block() before returning to user mode. + * We cannot explicitely reset another task, it MUST always + * be done by the task itself. This works for system wide because + * the tool that is controlling the session is doing "self-monitoring". + * + * XXX: what if the task never goes back to user? + * + */ if (CTX_OVFL_NOBLOCK(ctx) == 0) { - DBprintk((" unblocking %d \n", task->pid)); + DBprintk(("unblocking %d \n", task->pid)); up(sem); - return 0; + } else { + task->thread.pfm_ovfl_block_reset = 1; } - +#if 0 /* * in case of non blocking mode, then it's just a matter of * of reseting the sampling buffer (if any) index. The PMU @@ -1041,281 +1713,785 @@ * must reset the header count first */ if (CTX_HAS_SMPL(ctx)) { - DBprintk((" resetting sampling indexes for %d \n", task->pid)); - ctx->ctx_smpl_buf->psb_hdr->hdr_count = 0; - ctx->ctx_smpl_buf->psb_index = 0; + DBprintk(("resetting sampling indexes for %d \n", task->pid)); + ctx->ctx_psb->psb_hdr->hdr_count = 0; + ctx->ctx_psb->psb_index = 0; } - +#endif return 0; } +#ifndef CONFIG_SMP /* - * system-wide mode: propagate activation/desactivation throughout the tasklist - * - * XXX: does not work for SMP, of course + * On UP kernels, we do not need to constantly set the psr.pp bit + * when a task is scheduled. The psr.pp bit can only be changed in + * the kernel because of a user request. Given we are on a UP non preeemptive + * kernel we know that no other task is running, so we cna simply update their + * psr.pp from their saved state. There is this no impact on the context switch + * code compared to the SMP case. */ static void -pfm_process_tasklist(int cmd) +pfm_tasklist_toggle_pp(unsigned int val) { struct task_struct *p; struct pt_regs *regs; + DBprintk(("invoked by [%d] pp=%u\n", current->pid, val)); + + read_lock(&tasklist_lock); + for_each_task(p) { - regs = (struct pt_regs *)((unsigned long)p + IA64_STK_OFFSET); + regs = (struct pt_regs *)((unsigned long) p + IA64_STK_OFFSET); + + /* + * position on pt_regs saved on stack on 1st entry into the kernel + */ regs--; - ia64_psr(regs)->pp = cmd; + + /* + * update psr.pp + */ + ia64_psr(regs)->pp = val; } + read_unlock(&tasklist_lock); } +#endif -static int -do_perfmonctl (struct task_struct *task, int cmd, int flags, perfmon_req_t *req, int count, struct pt_regs *regs) + + +static int +pfm_stop(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, + struct pt_regs *regs) { - perfmon_req_t tmp; - struct thread_struct *th = &task->thread; - pfm_context_t *ctx = th->pfm_context; + /* we don't quite support this right now */ + if (task != current) return -EINVAL; - memset(&tmp, 0, sizeof(tmp)); + /* + * Cannot do anything before PMU is enabled + */ + if (!CTX_IS_ENABLED(ctx)) return -EINVAL; - if (ctx == NULL && cmd != PFM_CREATE_CONTEXT && cmd < PFM_DEBUG_BASE) { - DBprintk((" PFM_WRITE_PMCS: no context for task %d\n", task->pid)); - return -EINVAL; + DBprintk(("[%d] fl_system=%d owner=%p current=%p\n", + current->pid, + ctx->ctx_fl_system, PMU_OWNER(), + current)); + + /* simply stop monitoring but not the PMU */ + if (ctx->ctx_fl_system) { + + /* disable dcr pp */ + ia64_set_dcr(ia64_get_dcr() & ~IA64_DCR_PP); + + /* stop monitoring */ + __asm__ __volatile__ ("rsm psr.pp;;"::: "memory"); + + ia64_srlz_i(); + +#ifdef CONFIG_SMP + local_cpu_data->pfm_dcr_pp = 0; +#else + pfm_tasklist_toggle_pp(0); +#endif + ia64_psr(regs)->pp = 0; + + } else { + + /* stop monitoring */ + __asm__ __volatile__ ("rum psr.up;;"::: "memory"); + + ia64_srlz_i(); + + /* + * clear user level psr.up + */ + ia64_psr(regs)->up = 0; } + return 0; +} - switch (cmd) { - case PFM_CREATE_CONTEXT: - /* a context has already been defined */ - if (ctx) return -EBUSY; +static int +pfm_disable(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, + struct pt_regs *regs) +{ + /* we don't quite support this right now */ + if (task != current) return -EINVAL; - /* - * cannot directly create a context in another process - */ - if (task != current) return -EINVAL; + if (!CTX_IS_ENABLED(ctx)) return -EINVAL; - if (req == NULL || count != 1) return -EINVAL; + /* + * stop monitoring, freeze PMU, and save state in context + * this call will clear IA64_THREAD_PM_VALID for per-task sessions. + */ + pfm_flush_regs(task); - if (!access_ok(VERIFY_READ, req, sizeof(struct perfmon_req_t)*count)) return -EFAULT; + if (ctx->ctx_fl_system) { + ia64_psr(regs)->pp = 0; + } else { + ia64_psr(regs)->up = 0; + } + /* + * goes back to default behavior: no user level control + * no need to change live psr.sp because useless at the kernel level + */ + ia64_psr(regs)->sp = 1; - return pfm_context_create(flags, req); + DBprintk(("enabling psr.sp for [%d]\n", current->pid)); - case PFM_WRITE_PMCS: - /* we don't quite support this right now */ - if (task != current) return -EINVAL; + ctx->ctx_flags.state = PFM_CTX_DISABLED; - if (!access_ok(VERIFY_READ, req, sizeof(struct perfmon_req_t)*count)) return -EFAULT; + return 0; +} - return pfm_write_pmcs(task, req, count); +static int +pfm_context_destroy(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, + struct pt_regs *regs) +{ + /* we don't quite support this right now */ + if (task != current) return -EINVAL; - case PFM_WRITE_PMDS: - /* we don't quite support this right now */ - if (task != current) return -EINVAL; + /* + * if context was never enabled, then there is not much + * to do + */ + if (!CTX_IS_ENABLED(ctx)) goto skipped_stop; - if (!access_ok(VERIFY_READ, req, sizeof(struct perfmon_req_t)*count)) return -EFAULT; + /* + * Disable context: stop monitoring, flush regs to software state (useless here), + * and freeze PMU + * + * The IA64_THREAD_PM_VALID is cleared by pfm_flush_regs() called from pfm_disable() + */ + pfm_disable(task, ctx, arg, count, regs); - return pfm_write_pmds(task, req, count); + if (ctx->ctx_fl_system) { + ia64_psr(regs)->pp = 0; + } else { + ia64_psr(regs)->up = 0; + } - case PFM_START: - /* we don't quite support this right now */ - if (task != current) return -EINVAL; +skipped_stop: + /* + * remove sampling buffer mapping, if any + */ + if (ctx->ctx_smpl_vaddr) { + pfm_remove_smpl_mapping(task); + ctx->ctx_smpl_vaddr = 0UL; + } + /* now free context and related state */ + pfm_context_exit(task); - if (PMU_OWNER() && PMU_OWNER() != current && PFM_CAN_DO_LAZY()) pfm_lazy_save_regs(PMU_OWNER()); + return 0; +} - SET_PMU_OWNER(current); +/* + * does nothing at the moment + */ +static int +pfm_context_unprotect(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, + struct pt_regs *regs) +{ + return 0; +} - /* will start monitoring right after rfi */ - ia64_psr(regs)->up = 1; - ia64_psr(regs)->pp = 1; +static int +pfm_protect_context(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, + struct pt_regs *regs) +{ + DBprintk(("context from [%d] is protected\n", task->pid)); + /* + * from now on, only the creator of the context has access to it + */ + ctx->ctx_fl_protected = 1; - if (ctx->ctx_fl_system) { - pfm_process_tasklist(1); - pfs_info.pfs_pp = 1; + /* + * reinforce secure monitoring: cannot toggle psr.up + */ + ia64_psr(regs)->sp = 1; + + return 0; +} + +static int +pfm_debug(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, + struct pt_regs *regs) +{ + unsigned int mode = *(unsigned int *)arg; + + pfm_sysctl.debug = mode == 0 ? 0 : 1; + + printk("perfmon debugging %s\n", pfm_sysctl.debug ? "on" : "off"); + + return 0; +} + +#ifdef PFM_PMU_USES_DBR + +typedef struct { + unsigned long ibr_mask:56; + unsigned long ibr_plm:4; + unsigned long ibr_ig:3; + unsigned long ibr_x:1; +} ibr_mask_reg_t; + +typedef struct { + unsigned long dbr_mask:56; + unsigned long dbr_plm:4; + unsigned long dbr_ig:2; + unsigned long dbr_w:1; + unsigned long dbr_r:1; +} dbr_mask_reg_t; + +typedef union { + unsigned long val; + ibr_mask_reg_t ibr; + dbr_mask_reg_t dbr; +} dbreg_t; + + +static int +pfm_write_ibr_dbr(int mode, struct task_struct *task, void *arg, int count, struct pt_regs *regs) +{ + struct thread_struct *thread = &task->thread; + pfm_context_t *ctx = task->thread.pfm_context; + pfarg_dbreg_t tmp, *req = (pfarg_dbreg_t *)arg; + dbreg_t dbreg; + unsigned int rnum; + int first_time; + int i, ret = 0; + + /* + * for range restriction: psr.db must be cleared or the + * the PMU will ignore the debug registers. + * + * XXX: may need more in system wide mode, + * no task can have this bit set? + */ + if (ia64_psr(regs)->db == 1) return -EINVAL; + + + first_time = ctx->ctx_fl_using_dbreg == 0; + + /* + * check for debug registers in system wide mode + * + */ + LOCK_PFS(); + if (ctx->ctx_fl_system && first_time) { + if (pfm_sessions.pfs_ptrace_use_dbregs) + ret = -EBUSY; + else + pfm_sessions.pfs_sys_use_dbregs++; + } + UNLOCK_PFS(); + + if (ret != 0) return ret; + + if (ctx->ctx_fl_system) { + /* we mark ourselves as owner of the debug registers */ + ctx->ctx_fl_using_dbreg = 1; + DBprintk(("system-wide setting fl_using_dbreg for [%d]\n", task->pid)); + } else if (first_time) { + ret= -EBUSY; + if ((thread->flags & IA64_THREAD_DBG_VALID) != 0) { + DBprintk(("debug registers already in use for [%d]\n", task->pid)); + goto abort_mission; } + /* we mark ourselves as owner of the debug registers */ + ctx->ctx_fl_using_dbreg = 1; - /* - * mark the state as valid. - * this will trigger save/restore at context switch + DBprintk(("setting fl_using_dbreg for [%d]\n", task->pid)); + /* + * Given debug registers cannot be used for both debugging + * and performance monitoring at the same time, we reuse + * the storage area to save and restore the registers on ctxsw. */ - if (ctx->ctx_fl_system==0) th->flags |= IA64_THREAD_PM_VALID; + memset(task->thread.dbr, 0, sizeof(task->thread.dbr)); + memset(task->thread.ibr, 0, sizeof(task->thread.ibr)); + } - ia64_set_pmc(0, 0); - ia64_srlz_d(); + if (first_time) { + DBprintk(("[%d] clearing ibrs,dbrs\n", task->pid)); + /* + * clear hardware registers to make sure we don't + * pick up stale state. + * + * for a system wide session, we do not use + * thread.dbr, thread.ibr because this process + * never leaves the current CPU and the state + * is shared by all processes running on it + */ + for (i=0; i < pmu_conf.num_ibrs; i++) { + ia64_set_ibr(i, 0UL); + } + ia64_srlz_i(); + for (i=0; i < pmu_conf.num_dbrs; i++) { + ia64_set_dbr(i, 0UL); + } + ia64_srlz_d(); + } - break; + ret = -EFAULT; - case PFM_ENABLE: - /* we don't quite support this right now */ - if (task != current) return -EINVAL; + /* + * Now install the values into the registers + */ + for (i = 0; i < count; i++, req++) { - if (PMU_OWNER() && PMU_OWNER() != current && PFM_CAN_DO_LAZY()) pfm_lazy_save_regs(PMU_OWNER()); + + if (copy_from_user(&tmp, req, sizeof(tmp))) goto abort_mission; + + rnum = tmp.dbreg_num; + dbreg.val = tmp.dbreg_value; + + ret = -EINVAL; - /* reset all registers to stable quiet state */ - ia64_reset_pmu(); + if ((mode == 0 && !IBR_IS_IMPL(rnum)) || ((mode == 1) && !DBR_IS_IMPL(rnum))) { + DBprintk(("invalid register %u val=0x%lx mode=%d i=%d count=%d\n", + rnum, dbreg.val, mode, i, count)); - /* make sure nothing starts */ - ia64_psr(regs)->up = 0; - ia64_psr(regs)->pp = 0; + goto abort_mission; + } - /* do it on the live register as well */ - __asm__ __volatile__ ("rsm psr.pp|psr.pp;;"::: "memory"); + /* + * make sure we do not install enabled breakpoint + */ + if (rnum & 0x1) { + if (mode == 0) + dbreg.ibr.ibr_x = 0; + else + dbreg.dbr.dbr_r = dbreg.dbr.dbr_w = 0; + } - SET_PMU_OWNER(current); + /* + * clear return flags and copy back to user + * + * XXX: fix once EAGAIN is implemented + */ + ret = -EFAULT; - /* - * mark the state as valid. - * this will trigger save/restore at context switch - */ - if (ctx->ctx_fl_system==0) th->flags |= IA64_THREAD_PM_VALID; + PFM_REG_RETFLAG_SET(tmp.dbreg_flags, 0); - /* simply unfreeze */ - ia64_set_pmc(0, 0); - ia64_srlz_d(); - break; + if (copy_to_user(req, &tmp, sizeof(tmp))) goto abort_mission; - case PFM_DISABLE: - /* we don't quite support this right now */ - if (task != current) return -EINVAL; + /* + * Debug registers, just like PMC, can only be modified + * by a kernel call. Moreover, perfmon() access to those + * registers are centralized in this routine. The hardware + * does not modify the value of these registers, therefore, + * if we save them as they are written, we can avoid having + * to save them on context switch out. This is made possible + * by the fact that when perfmon uses debug registers, ptrace() + * won't be able to modify them concurrently. + */ + if (mode == 0) { + CTX_USED_IBR(ctx, rnum); - /* simply freeze */ - ia64_set_pmc(0, 1); + ia64_set_ibr(rnum, dbreg.val); + ia64_srlz_i(); + + thread->ibr[rnum] = dbreg.val; + + DBprintk(("write ibr%u=0x%lx used_ibrs=0x%lx\n", rnum, dbreg.val, ctx->ctx_used_ibrs[0])); + } else { + CTX_USED_DBR(ctx, rnum); + + ia64_set_dbr(rnum, dbreg.val); ia64_srlz_d(); - /* - * XXX: cannot really toggle IA64_THREAD_PM_VALID - * but context is still considered valid, so any - * read request would return something valid. Same - * thing when this task terminates (pfm_flush_regs()). - */ - break; - case PFM_READ_PMDS: - if (!access_ok(VERIFY_READ, req, sizeof(struct perfmon_req_t)*count)) return -EFAULT; - if (!access_ok(VERIFY_WRITE, req, sizeof(struct perfmon_req_t)*count)) return -EFAULT; - - return pfm_read_pmds(task, req, count); - - case PFM_STOP: - /* we don't quite support this right now */ - if (task != current) return -EINVAL; - - /* simply stop monitors, not PMU */ - ia64_psr(regs)->up = 0; - ia64_psr(regs)->pp = 0; - - if (ctx->ctx_fl_system) { - pfm_process_tasklist(0); - pfs_info.pfs_pp = 0; - } + thread->dbr[rnum] = dbreg.val; - break; + DBprintk(("write dbr%u=0x%lx used_dbrs=0x%lx\n", rnum, dbreg.val, ctx->ctx_used_dbrs[0])); + } + } - case PFM_RESTART: /* temporary, will most likely end up as a PFM_ENABLE */ + return 0; - if ((th->flags & IA64_THREAD_PM_VALID) == 0 && ctx->ctx_fl_system==0) { - printk(" PFM_RESTART not monitoring\n"); - return -EINVAL; - } - if (CTX_OVFL_NOBLOCK(ctx) == 0 && ctx->ctx_fl_frozen==0) { - printk("task %d without pmu_frozen set\n", task->pid); - return -EINVAL; - } +abort_mission: + /* + * in case it was our first attempt, we undo the global modifications + */ + if (first_time) { + LOCK_PFS(); + if (ctx->ctx_fl_system) { + pfm_sessions.pfs_sys_use_dbregs--; + } + UNLOCK_PFS(); + ctx->ctx_fl_using_dbreg = 0; + } + /* + * install error return flag + */ + if (ret != -EFAULT) { + /* + * XXX: for now we can only come here on EINVAL + */ + PFM_REG_RETFLAG_SET(tmp.dbreg_flags, PFM_REG_RETFL_EINVAL); + copy_to_user(req, &tmp, sizeof(tmp)); + } + return ret; +} - return pfm_do_restart(task); /* we only look at first entry */ +static int +pfm_write_ibrs(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, + struct pt_regs *regs) +{ + /* we don't quite support this right now */ + if (task != current) return -EINVAL; - case PFM_DESTROY_CONTEXT: - /* we don't quite support this right now */ - if (task != current) return -EINVAL; - - /* first stop monitors */ - ia64_psr(regs)->up = 0; - ia64_psr(regs)->pp = 0; + if (!CTX_IS_ENABLED(ctx)) return -EINVAL; - /* then freeze PMU */ - ia64_set_pmc(0, 1); - ia64_srlz_d(); + return pfm_write_ibr_dbr(0, task, arg, count, regs); +} - /* don't save/restore on context switch */ - if (ctx->ctx_fl_system ==0) task->thread.flags &= ~IA64_THREAD_PM_VALID; +static int +pfm_write_dbrs(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, + struct pt_regs *regs) +{ + /* we don't quite support this right now */ + if (task != current) return -EINVAL; - SET_PMU_OWNER(NULL); + if (!CTX_IS_ENABLED(ctx)) return -EINVAL; - /* now free context and related state */ - pfm_context_exit(task); - break; + return pfm_write_ibr_dbr(1, task, arg, count, regs); +} - case PFM_DEBUG_ON: - printk("perfmon debugging on\n"); - pfm_debug = 1; - break; +#endif /* PFM_PMU_USES_DBR */ - case PFM_DEBUG_OFF: - printk("perfmon debugging off\n"); - pfm_debug = 0; - break; +static int +pfm_get_features(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) +{ + pfarg_features_t tmp; + + memset(&tmp, 0, sizeof(tmp)); + + tmp.ft_version = PFM_VERSION; + tmp.ft_smpl_version = PFM_SMPL_VERSION; + + if (copy_to_user(arg, &tmp, sizeof(tmp))) return -EFAULT; + + return 0; +} + +static int +pfm_start(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, + struct pt_regs *regs) +{ + /* we don't quite support this right now */ + if (task != current) return -EINVAL; + + /* + * Cannot do anything before PMU is enabled + */ + if (!CTX_IS_ENABLED(ctx)) return -EINVAL; + + DBprintk(("[%d] fl_system=%d owner=%p current=%p\n", + current->pid, + ctx->ctx_fl_system, PMU_OWNER(), + current)); + + if (PMU_OWNER() != task) { + printk("perfmon: pfm_start task [%d] not pmu owner\n", task->pid); + return -EINVAL; + } + + if (ctx->ctx_fl_system) { + +#ifdef CONFIG_SMP + local_cpu_data->pfm_dcr_pp = 1; +#else + pfm_tasklist_toggle_pp(1); +#endif + /* set user level psr.pp */ + ia64_psr(regs)->pp = 1; + + /* start monitoring at kernel level */ + __asm__ __volatile__ ("ssm psr.pp;;"::: "memory"); + + /* enable dcr pp */ + ia64_set_dcr(ia64_get_dcr()|IA64_DCR_PP); - default: - DBprintk((" UNknown command 0x%x\n", cmd)); + ia64_srlz_i(); + + } else { + if ((task->thread.flags & IA64_THREAD_PM_VALID) == 0) { + printk("perfmon: pfm_start task flag not set for [%d]\n", task->pid); return -EINVAL; + } + /* set user level psr.up */ + ia64_psr(regs)->up = 1; + + /* start monitoring at kernel level */ + __asm__ __volatile__ ("sum psr.up;;"::: "memory"); + + ia64_srlz_i(); } + return 0; } +static int +pfm_enable(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, + struct pt_regs *regs) +{ + /* we don't quite support this right now */ + if (task != current) return -EINVAL; + + if (ctx->ctx_fl_system == 0 && PMU_OWNER() && PMU_OWNER() != current) + pfm_lazy_save_regs(PMU_OWNER()); + + /* reset all registers to stable quiet state */ + ia64_reset_pmu(task); + + /* make sure nothing starts */ + if (ctx->ctx_fl_system) { + ia64_psr(regs)->pp = 0; + ia64_psr(regs)->up = 0; /* just to make sure! */ + + /* make sure monitoring is stopped */ + __asm__ __volatile__ ("rsm psr.pp;;"::: "memory"); + ia64_srlz_i(); + +#ifdef CONFIG_SMP + local_cpu_data->pfm_syst_wide = 1; + local_cpu_data->pfm_dcr_pp = 0; +#endif + } else { + /* + * needed in case the task was a passive task during + * a system wide session and now wants to have its own + * session + */ + ia64_psr(regs)->pp = 0; /* just to make sure! */ + ia64_psr(regs)->up = 0; + + /* make sure monitoring is stopped */ + __asm__ __volatile__ ("rum psr.up;;"::: "memory"); + ia64_srlz_i(); + + DBprintk(("clearing psr.sp for [%d]\n", current->pid)); + + /* allow user level control */ + ia64_psr(regs)->sp = 0; + + /* PMU state will be saved/restored on ctxsw */ + task->thread.flags |= IA64_THREAD_PM_VALID; + } + + SET_PMU_OWNER(task); + + ctx->ctx_flags.state = PFM_CTX_ENABLED; + atomic_set(&ctx->ctx_last_cpu, smp_processor_id()); + + /* simply unfreeze */ + ia64_set_pmc(0, 0); + ia64_srlz_d(); + + return 0; +} + +static int +pfm_get_pmc_reset(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, + struct pt_regs *regs) +{ + pfarg_reg_t tmp, *req = (pfarg_reg_t *)arg; + unsigned int cnum; + int i; + + for (i = 0; i < count; i++, req++) { + + if (copy_from_user(&tmp, req, sizeof(tmp))) return -EFAULT; + + cnum = tmp.reg_num; + + if (!PMC_IS_IMPL(cnum)) goto abort_mission; + + tmp.reg_value = reset_pmcs[cnum]; + + PFM_REG_RETFLAG_SET(tmp.reg_flags, 0); + + DBprintk(("pmc_reset_val pmc[%u]=0x%lx\n", cnum, tmp.reg_value)); + + if (copy_to_user(req, &tmp, sizeof(tmp))) return -EFAULT; + } + return 0; +abort_mission: + PFM_REG_RETFLAG_SET(tmp.reg_flags, PFM_REG_RETFL_EINVAL); + /* + * XXX: if this fails, we stick with the original failure, flag not updated! + */ + copy_to_user(req, &tmp, sizeof(tmp)); + return -EINVAL; +} + /* - * XXX: do something better here + * functions MUST be listed in the increasing order of their index (see permfon.h) */ +static pfm_cmd_desc_t pfm_cmd_tab[]={ +/* 0 */{ NULL, 0, 0, 0}, /* not used */ +/* 1 */{ pfm_write_pmcs, PFM_CMD_PID|PFM_CMD_CTX|PFM_CMD_ARG_READ|PFM_CMD_ARG_WRITE, PFM_CMD_ARG_MANY, sizeof(pfarg_reg_t)}, +/* 2 */{ pfm_write_pmds, PFM_CMD_PID|PFM_CMD_CTX|PFM_CMD_ARG_READ, PFM_CMD_ARG_MANY, sizeof(pfarg_reg_t)}, +/* 3 */{ pfm_read_pmds,PFM_CMD_PID|PFM_CMD_CTX|PFM_CMD_ARG_READ|PFM_CMD_ARG_WRITE, PFM_CMD_ARG_MANY, sizeof(pfarg_reg_t)}, +/* 4 */{ pfm_stop, PFM_CMD_PID|PFM_CMD_CTX, 0, 0}, +/* 5 */{ pfm_start, PFM_CMD_PID|PFM_CMD_CTX, 0, 0}, +/* 6 */{ pfm_enable, PFM_CMD_PID|PFM_CMD_CTX, 0, 0}, +/* 7 */{ pfm_disable, PFM_CMD_PID|PFM_CMD_CTX, 0, 0}, +/* 8 */{ pfm_context_create, PFM_CMD_PID|PFM_CMD_ARG_READ|PFM_CMD_ARG_WRITE, 1, sizeof(pfarg_context_t)}, +/* 9 */{ pfm_context_destroy, PFM_CMD_PID|PFM_CMD_CTX, 0, 0}, +/* 10 */{ pfm_restart, PFM_CMD_PID|PFM_CMD_CTX|PFM_CMD_NOCHK, 0, 0}, +/* 11 */{ pfm_protect_context, PFM_CMD_PID|PFM_CMD_CTX, 0, 0}, +/* 12 */{ pfm_get_features, PFM_CMD_ARG_WRITE, 0, 0}, +/* 13 */{ pfm_debug, 0, 1, sizeof(unsigned int)}, +/* 14 */{ pfm_context_unprotect, PFM_CMD_PID|PFM_CMD_CTX, 0, 0}, +/* 15 */{ pfm_get_pmc_reset, PFM_CMD_ARG_READ|PFM_CMD_ARG_WRITE, PFM_CMD_ARG_MANY, sizeof(pfarg_reg_t)}, +/* 16 */{ NULL, 0, 0, 0}, /* not used */ +/* 17 */{ NULL, 0, 0, 0}, /* not used */ +/* 18 */{ NULL, 0, 0, 0}, /* not used */ +/* 19 */{ NULL, 0, 0, 0}, /* not used */ +/* 20 */{ NULL, 0, 0, 0}, /* not used */ +/* 21 */{ NULL, 0, 0, 0}, /* not used */ +/* 22 */{ NULL, 0, 0, 0}, /* not used */ +/* 23 */{ NULL, 0, 0, 0}, /* not used */ +/* 24 */{ NULL, 0, 0, 0}, /* not used */ +/* 25 */{ NULL, 0, 0, 0}, /* not used */ +/* 26 */{ NULL, 0, 0, 0}, /* not used */ +/* 27 */{ NULL, 0, 0, 0}, /* not used */ +/* 28 */{ NULL, 0, 0, 0}, /* not used */ +/* 29 */{ NULL, 0, 0, 0}, /* not used */ +/* 30 */{ NULL, 0, 0, 0}, /* not used */ +/* 31 */{ NULL, 0, 0, 0}, /* not used */ +#ifdef PFM_PMU_USES_DBR +/* 32 */{ pfm_write_ibrs, PFM_CMD_PID|PFM_CMD_CTX|PFM_CMD_ARG_READ|PFM_CMD_ARG_WRITE, PFM_CMD_ARG_MANY, sizeof(pfarg_dbreg_t)}, +/* 33 */{ pfm_write_dbrs, PFM_CMD_PID|PFM_CMD_CTX|PFM_CMD_ARG_READ|PFM_CMD_ARG_WRITE, PFM_CMD_ARG_MANY, sizeof(pfarg_dbreg_t)} +#endif +}; +#define PFM_CMD_COUNT (sizeof(pfm_cmd_tab)/sizeof(pfm_cmd_desc_t)) + static int -perfmon_bad_permissions(struct task_struct *task) +check_task_state(struct task_struct *task) { - /* stolen from bad_signal() */ - return (current->session != task->session) - && (current->euid ^ task->suid) && (current->euid ^ task->uid) - && (current->uid ^ task->suid) && (current->uid ^ task->uid); + int ret = 0; +#ifdef CONFIG_SMP + /* We must wait until the state has been completely + * saved. There can be situations where the reader arrives before + * after the task is marked as STOPPED but before pfm_save_regs() + * is completed. + */ + for (;;) { + + task_lock(task); + if (!task_has_cpu(task)) break; + task_unlock(task); + + do { + if (task->state != TASK_ZOMBIE && task->state != TASK_STOPPED) return -EBUSY; + barrier(); + cpu_relax(); + } while (task_has_cpu(task)); + } + task_unlock(task); +#else + if (task->state != TASK_ZOMBIE && task->state != TASK_STOPPED) { + DBprintk(("warning [%d] not in stable state %ld\n", task->pid, task->state)); + ret = -EBUSY; + } +#endif + return ret; } asmlinkage int -sys_perfmonctl (int pid, int cmd, int flags, perfmon_req_t *req, int count, long arg6, long arg7, long arg8, long stack) +sys_perfmonctl (pid_t pid, int cmd, void *arg, int count, long arg5, long arg6, long arg7, + long arg8, long stack) { - struct pt_regs *regs = (struct pt_regs *) &stack; - struct task_struct *child = current; - int ret = -ESRCH; + struct pt_regs *regs = (struct pt_regs *)&stack; + struct task_struct *task = current; + pfm_context_t *ctx; + size_t sz; + int ret, narg; - /* sanity check: - * - * ensures that we don't do bad things in case the OS - * does not have enough storage to save/restore PMC/PMD + /* + * reject any call if perfmon was disabled at initialization time */ - if (PERFMON_IS_DISABLED()) return -ENOSYS; + if (PFM_IS_DISABLED()) return -ENOSYS; - /* XXX: pid interface is going away in favor of pfm context */ - if (pid != current->pid) { - read_lock(&tasklist_lock); + DBprintk(("cmd=%d idx=%d valid=%d narg=0x%x\n", cmd, PFM_CMD_IDX(cmd), + PFM_CMD_IS_VALID(cmd), PFM_CMD_NARG(cmd))); - child = find_task_by_pid(pid); + if (PFM_CMD_IS_VALID(cmd) == 0) return -EINVAL; - if (!child) goto abort_call; + /* ingore arguments when command has none */ + narg = PFM_CMD_NARG(cmd); + if ((narg == PFM_CMD_ARG_MANY && count == 0) || (narg > 0 && narg != count)) return -EINVAL; - ret = -EPERM; + sz = PFM_CMD_ARG_SIZE(cmd); - if (perfmon_bad_permissions(child)) goto abort_call; + if (PFM_CMD_READ_ARG(cmd) && !access_ok(VERIFY_READ, arg, sz*count)) return -EFAULT; - /* - * XXX: need to do more checking here + if (PFM_CMD_WRITE_ARG(cmd) && !access_ok(VERIFY_WRITE, arg, sz*count)) return -EFAULT; + + if (PFM_CMD_USE_PID(cmd)) { + /* + * XXX: may need to fine tune this one */ - if (child->state != TASK_ZOMBIE && child->state != TASK_STOPPED) { - DBprintk((" warning process %d not in stable state %ld\n", pid, child->state)); - } + if (pid < 2) return -EPERM; + + if (pid != current->pid) { + + ret = -ESRCH; + + read_lock(&tasklist_lock); + + task = find_task_by_pid(pid); + + if (!task) goto abort_call; + + ret = -EPERM; + + if (pfm_bad_permissions(task)) goto abort_call; + + if (PFM_CMD_CHK(cmd)) { + ret = check_task_state(task); + if (ret != 0) goto abort_call; + } + } + } + + ctx = task->thread.pfm_context; + + if (PFM_CMD_USE_CTX(cmd)) { + ret = -EINVAL; + if (ctx == NULL) { + DBprintk(("no context for task %d\n", task->pid)); + goto abort_call; + } + ret = -EPERM; + /* + * we only grant access to the context if: + * - the caller is the creator of the context (ctx_owner) + * OR - the context is attached to the caller AND The context IS NOT + * in protected mode + */ + if (ctx->ctx_owner != current && (ctx->ctx_fl_protected || task != current)) { + DBprintk(("context protected, no access for [%d]\n", task->pid)); + goto abort_call; + } } - ret = do_perfmonctl(child, cmd, flags, req, count, regs); + + ret = (*pfm_cmd_tab[PFM_CMD_IDX(cmd)].cmd_func)(task, ctx, arg, count, regs); abort_call: - if (child != current) read_unlock(&tasklist_lock); + if (task != current) read_unlock(&tasklist_lock); return ret; } #if __GNUC__ >= 3 void asmlinkage -pfm_block_on_overflow(void) +pfm_ovfl_block_reset(u64 arg0, u64 arg1, u64 arg2, u64 arg3, u64 arg4, u64 arg5, + u64 arg6, u64 arg7, long info) #else void asmlinkage -pfm_block_on_overflow(u64 arg0, u64 arg1, u64 arg2, u64 arg3, u64 arg4, u64 arg5, u64 arg6, u64 arg7) +pfm_ovfl_block_reset(u64 arg0, u64 arg1, u64 arg2, u64 arg3, u64 arg4, u64 arg5, + u64 arg6, u64 arg7, long info) #endif { struct thread_struct *th = ¤t->thread; @@ -1323,32 +2499,22 @@ int ret; /* - * NO matter what notify_pid is, - * we clear overflow, won't notify again + * clear the flag, to make sure we won't get here + * again */ - th->pfm_must_block = 0; + th->pfm_ovfl_block_reset = 0; /* * do some sanity checks first */ if (!ctx) { - printk("perfmon: process %d has no PFM context\n", current->pid); - return; - } - if (ctx->ctx_notify_task == 0) { - printk("perfmon: process %d has no task to notify\n", current->pid); + printk("perfmon: [%d] has no PFM context\n", current->pid); return; } - DBprintk((" current=%d task=%d\n", current->pid, ctx->ctx_notify_task->pid)); + if (CTX_OVFL_NOBLOCK(ctx)) goto non_blocking; - /* should not happen */ - if (CTX_OVFL_NOBLOCK(ctx)) { - printk("perfmon: process %d non-blocking ctx should not be here\n", current->pid); - return; - } - - DBprintk((" CPU%d %d before sleep\n", smp_processor_id(), current->pid)); + DBprintk(("[%d] before sleeping\n", current->pid)); /* * may go through without blocking on SMP systems @@ -1356,12 +2522,14 @@ */ ret = down_interruptible(&ctx->ctx_restart_sem); - DBprintk((" CPU%d %d after sleep ret=%d\n", smp_processor_id(), current->pid, ret)); + DBprintk(("[%d] after sleeping ret=%d\n", current->pid, ret)); /* * in case of interruption of down() we don't restart anything */ if (ret >= 0) { + +non_blocking: /* we reactivate on context switch */ ctx->ctx_fl_frozen = 0; /* @@ -1369,19 +2537,19 @@ * use the local reference */ - pfm_reset_regs(ctx); + pfm_reset_regs(ctx, ctx->ctx_ovfl_regs, PFM_RELOAD_LONG_RESET); + + ctx->ctx_ovfl_regs[0] = 0UL; /* * Unlock sampling buffer and reset index atomically * XXX: not really needed when blocking */ if (CTX_HAS_SMPL(ctx)) { - ctx->ctx_smpl_buf->psb_hdr->hdr_count = 0; - ctx->ctx_smpl_buf->psb_index = 0; + ctx->ctx_psb->psb_hdr->hdr_count = 0; + ctx->ctx_psb->psb_index = 0; } - DBprintk((" CPU%d %d unfreeze PMU\n", smp_processor_id(), current->pid)); - ia64_set_pmc(0, 0); ia64_srlz_d(); @@ -1390,23 +2558,112 @@ } /* + * This function will record an entry in the sampling if it is not full already. + * Return: + * 0 : buffer is not full (did not BECOME full: still space or was already full) + * 1 : buffer is full (recorded the last entry) + */ +static int +pfm_record_sample(struct task_struct *task, pfm_context_t *ctx, unsigned long ovfl_mask, struct pt_regs *regs) +{ + pfm_smpl_buffer_desc_t *psb = ctx->ctx_psb; + unsigned long *e, m, idx; + perfmon_smpl_entry_t *h; + int j; + + + + idx = ia64_fetch_and_add(1, &psb->psb_index); + DBprintk_ovfl(("recording index=%ld entries=%ld\n", idx-1, psb->psb_entries)); + + /* + * XXX: there is a small chance that we could run out on index before resetting + * but index is unsigned long, so it will take some time..... + * We use > instead of == because fetch_and_add() is off by one (see below) + * + * This case can happen in non-blocking mode or with multiple processes. + * For non-blocking, we need to reload and continue. + */ + if (idx > psb->psb_entries) return 0; + + /* first entry is really entry 0, not 1 caused by fetch_and_add */ + idx--; + + h = (perfmon_smpl_entry_t *)(((char *)psb->psb_addr) + idx*(psb->psb_entry_size)); + + /* + * initialize entry header + */ + h->pid = current->pid; + h->cpu = smp_processor_id(); + h->rate = 0; /* XXX: add the sampling rate used here */ + h->ip = regs ? regs->cr_iip : 0x0; /* where did the fault happened */ + h->regs = ovfl_mask; /* which registers overflowed */ + + /* guaranteed to monotonically increase on each cpu */ + h->stamp = pfm_get_stamp(); + h->period = 0UL; /* not yet used */ + + /* position for first pmd */ + e = (unsigned long *)(h+1); + + /* + * selectively store PMDs in increasing index number + */ + m = ctx->ctx_smpl_regs[0]; + for (j=0; m; m >>=1, j++) { + + if ((m & 0x1) == 0) continue; + + if (PMD_IS_COUNTING(j)) { + *e = pfm_read_soft_counter(ctx, j); + /* check if this pmd overflowed as well */ + *e += ovfl_mask & (1UL<psb_hdr->hdr_count); + + DBprintk_ovfl(("index=%ld entries=%ld hdr_count=%ld\n", + idx, psb->psb_entries, psb->psb_hdr->hdr_count)); + /* + * sampling buffer full ? + */ + if (idx == (psb->psb_entries-1)) { + DBprintk_ovfl(("sampling buffer full\n")); + /* + * XXX: must reset buffer in blocking mode and lost notified + */ + pfm_stats.pfm_full_smpl_buffer_count++; + return 1; + } + return 0; +} + +/* * main overflow processing routine. * it can be called from the interrupt path or explicitely during the context switch code * Return: * new value of pmc[0]. if 0x0 then unfreeze, else keep frozen */ -unsigned long -update_counters (struct task_struct *task, u64 pmc0, struct pt_regs *regs) +static unsigned long +pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, struct pt_regs *regs) { - unsigned long mask, i, cnum; - struct thread_struct *th; - pfm_context_t *ctx; - unsigned long bv = 0; - int my_cpu = smp_processor_id(); - int ret = 1, buffer_is_full = 0; - int ovfl_has_long_recovery, can_notify, need_reset_pmd16=0; + unsigned long mask; + struct thread_struct *t; + unsigned long old_val; + unsigned long ovfl_notify = 0UL, ovfl_pmds = 0UL; + int i; + int ret = 1; struct siginfo si; - /* * It is never safe to access the task for which the overflow interrupt is destinated * using the current variable as the interrupt may occur in the middle of a context switch @@ -1420,234 +2677,141 @@ * valid one, i.e. the one that caused the interrupt. */ - if (task == NULL) { - DBprintk((" owners[%d]=NULL\n", my_cpu)); - return 0x1; - } - th = &task->thread; - ctx = th->pfm_context; + t = &task->thread; /* * XXX: debug test * Don't think this could happen given upfront tests */ - if ((th->flags & IA64_THREAD_PM_VALID) == 0 && ctx->ctx_fl_system == 0) { - printk("perfmon: Spurious overflow interrupt: process %d not using perfmon\n", task->pid); + if ((t->flags & IA64_THREAD_PM_VALID) == 0 && ctx->ctx_fl_system == 0) { + printk("perfmon: Spurious overflow interrupt: process %d not using perfmon\n", + task->pid); return 0x1; } - if (!ctx) { - printk("perfmon: Spurious overflow interrupt: process %d has no PFM context\n", task->pid); - return 0; - } - /* * sanity test. Should never happen */ - if ((pmc0 & 0x1 )== 0) { - printk("perfmon: pid %d pmc0=0x%lx assumption error for freeze bit\n", task->pid, pmc0); + if ((pmc0 & 0x1) == 0) { + printk("perfmon: pid %d pmc0=0x%lx assumption error for freeze bit\n", + task->pid, pmc0); return 0x0; } mask = pmc0 >> PMU_FIRST_COUNTER; - DBprintk(("pmc0=0x%lx pid=%d owner=%d iip=0x%lx, ctx is in %s mode used_pmds=0x%lx used_pmcs=0x%lx\n", - pmc0, task->pid, PMU_OWNER()->pid, regs->cr_iip, - CTX_OVFL_NOBLOCK(ctx) ? "NO-BLOCK" : "BLOCK", - ctx->ctx_used_pmds[0], - ctx->ctx_used_pmcs[0])); + DBprintk_ovfl(("pmc0=0x%lx pid=%d iip=0x%lx, %s" + " mode used_pmds=0x%lx used_pmcs=0x%lx reload_pmcs=0x%lx\n", + pmc0, task->pid, (regs ? regs->cr_iip : 0), + CTX_OVFL_NOBLOCK(ctx) ? "nonblocking" : "blocking", + ctx->ctx_used_pmds[0], + ctx->ctx_used_pmcs[0], + ctx->ctx_reload_pmcs[0])); /* - * XXX: need to record sample only when an EAR/BTB has overflowed + * First we update the virtual counters */ - if (CTX_HAS_SMPL(ctx)) { - pfm_smpl_buffer_desc_t *psb = ctx->ctx_smpl_buf; - unsigned long *e, m, idx=0; - perfmon_smpl_entry_t *h; - int j; - - idx = ia64_fetch_and_add(1, &psb->psb_index); - DBprintk((" recording index=%ld entries=%ld\n", idx, psb->psb_entries)); - - /* - * XXX: there is a small chance that we could run out on index before resetting - * but index is unsigned long, so it will take some time..... - * We use > instead of == because fetch_and_add() is off by one (see below) - * - * This case can happen in non-blocking mode or with multiple processes. - * For non-blocking, we need to reload and continue. - */ - if (idx > psb->psb_entries) { - buffer_is_full = 1; - goto reload_pmds; - } - - /* first entry is really entry 0, not 1 caused by fetch_and_add */ - idx--; - - h = (perfmon_smpl_entry_t *)(((char *)psb->psb_addr) + idx*(psb->psb_entry_size)); + for (i = PMU_FIRST_COUNTER; mask ; i++, mask >>= 1) { - h->pid = task->pid; - h->cpu = my_cpu; - h->rate = 0; - h->ip = regs ? regs->cr_iip : 0x0; /* where did the fault happened */ - h->regs = mask; /* which registers overflowed */ - - /* guaranteed to monotonically increase on each cpu */ - h->stamp = perfmon_get_stamp(); + /* skip pmd which did not overflow */ + if ((mask & 0x1) == 0) continue; - e = (unsigned long *)(h+1); + DBprintk_ovfl(("pmd[%d] overflowed hw_pmd=0x%lx soft_pmd=0x%lx\n", + i, ia64_get_pmd(i), ctx->ctx_soft_pmds[i].val)); /* - * selectively store PMDs in increasing index number + * Because we sometimes (EARS/BTB) reset to a specific value, we cannot simply use + * val to count the number of times we overflowed. Otherwise we would loose the + * current value in the PMD (which can be >0). So to make sure we don't loose + * the residual counts we set val to contain full 64bits value of the counter. */ - for (j=0, m = ctx->ctx_smpl_regs; m; m >>=1, j++) { - if (m & 0x1) { - if (PMD_IS_COUNTER(j)) - *e = ctx->ctx_pmds[j-PMU_FIRST_COUNTER].val - + (ia64_get_pmd(j) & pmu_conf.perf_ovfl_val); - else { - *e = ia64_get_pmd(j); /* slow */ - } - DBprintk((" e=%p pmd%d =0x%lx\n", (void *)e, j, *e)); - e++; - } - } + old_val = ctx->ctx_soft_pmds[i].val; + ctx->ctx_soft_pmds[i].val = 1 + pmu_conf.perf_ovfl_val + pfm_read_soft_counter(ctx, i); + + DBprintk_ovfl(("soft_pmd[%d].val=0x%lx old_val=0x%lx pmd=0x%lx\n", + i, ctx->ctx_soft_pmds[i].val, old_val, + ia64_get_pmd(i) & pmu_conf.perf_ovfl_val)); + /* - * make the new entry visible to user, needs to be atomic + * now that we have extracted the hardware counter, we can clear it to ensure + * that a subsequent PFM_READ_PMDS will not include it again. */ - ia64_fetch_and_add(1, &psb->psb_hdr->hdr_count); + ia64_set_pmd(i, 0UL); - DBprintk((" index=%ld entries=%ld hdr_count=%ld\n", idx, psb->psb_entries, psb->psb_hdr->hdr_count)); - /* - * sampling buffer full ? + /* + * check for overflow condition */ - if (idx == (psb->psb_entries-1)) { - /* - * will cause notification, cannot be 0 - */ - bv = mask << PMU_FIRST_COUNTER; + if (old_val > ctx->ctx_soft_pmds[i].val) { - buffer_is_full = 1; + ovfl_pmds |= 1UL << i; - DBprintk((" sampling buffer full must notify bv=0x%lx\n", bv)); + DBprintk_ovfl(("soft_pmd[%d] overflowed flags=0x%x, ovfl=0x%lx\n", i, ctx->ctx_soft_pmds[i].flags, ovfl_pmds)); - /* - * we do not reload here, when context is blocking - */ - if (!CTX_OVFL_NOBLOCK(ctx)) goto no_reload; - - /* - * here, we have a full buffer but we are in non-blocking mode - * so we need to reload overflowed PMDs with sampling reset values - * and restart right away. - */ + if (PMC_OVFL_NOTIFY(ctx, i)) { + ovfl_notify |= 1UL << i; + } } - /* FALL THROUGH */ } -reload_pmds: /* - * in the case of a non-blocking context, we reload - * with the ovfl_rval when no user notification is taking place (short recovery) - * otherwise when the buffer is full which requires user interaction) then we use - * smpl_rval which is the long_recovery path (disturbance introduce by user execution). + * check for sampling buffer * - * XXX: implies that when buffer is full then there is always notification. + * if present, record sample. We propagate notification ONLY when buffer + * becomes full. */ - ovfl_has_long_recovery = CTX_OVFL_NOBLOCK(ctx) && buffer_is_full; - - /* - * XXX: CTX_HAS_SMPL() should really be something like CTX_HAS_SMPL() and is activated,i.e., - * one of the PMC is configured for EAR/BTB. - * - * When sampling, we can only notify when the sampling buffer is full. - */ - can_notify = CTX_HAS_SMPL(ctx) == 0 && ctx->ctx_notify_task; - - DBprintk((" ovfl_has_long_recovery=%d can_notify=%d\n", ovfl_has_long_recovery, can_notify)); - - for (i = 0, cnum = PMU_FIRST_COUNTER; mask ; cnum++, i++, mask >>= 1) { - - if ((mask & 0x1) == 0) continue; - - DBprintk((" PMD[%ld] overflowed pmd=0x%lx pmod.val=0x%lx\n", cnum, ia64_get_pmd(cnum), ctx->ctx_pmds[i].val)); - - /* - * Because we sometimes (EARS/BTB) reset to a specific value, we cannot simply use - * val to count the number of times we overflowed. Otherwise we would loose the current value - * in the PMD (which can be >0). So to make sure we don't loose - * the residual counts we set val to contain full 64bits value of the counter. - * - * XXX: is this needed for EARS/BTB ? - */ - ctx->ctx_pmds[i].val += 1 + pmu_conf.perf_ovfl_val - + (ia64_get_pmd(cnum) & pmu_conf.perf_ovfl_val); /* slow */ - - DBprintk((" pmod[%ld].val=0x%lx pmd=0x%lx\n", i, ctx->ctx_pmds[i].val, ia64_get_pmd(cnum)&pmu_conf.perf_ovfl_val)); - - if (can_notify && PMD_OVFL_NOTIFY(ctx, i)) { - DBprintk((" CPU%d should notify task %p with signal %d\n", my_cpu, ctx->ctx_notify_task, ctx->ctx_notify_sig)); - bv |= 1 << i; - } else { - DBprintk((" CPU%d PMD[%ld] overflow, no notification\n", my_cpu, cnum)); + if(CTX_HAS_SMPL(ctx)) { + ret = pfm_record_sample(task, ctx, ovfl_pmds, regs); + if (ret == 1) { /* - * In case no notification is requested, we reload the reset value right away - * otherwise we wait until the notify_pid process has been called and has - * has finished processing data. Check out pfm_overflow_notify() + * Sampling buffer became full + * If no notication was requested, then we reset buffer index + * and reset registers (done below) and resume. + * If notification requested, then defer reset until pfm_restart() */ - - /* writes to upper part are ignored, so this is safe */ - if (ovfl_has_long_recovery) { - DBprintk((" CPU%d PMD[%ld] reload with smpl_val=%lx\n", my_cpu, cnum,ctx->ctx_pmds[i].smpl_rval)); - ia64_set_pmd(cnum, ctx->ctx_pmds[i].smpl_rval); - } else { - DBprintk((" CPU%d PMD[%ld] reload with ovfl_val=%lx\n", my_cpu, cnum,ctx->ctx_pmds[i].smpl_rval)); - ia64_set_pmd(cnum, ctx->ctx_pmds[i].ovfl_rval); + if (ovfl_notify == 0UL) { + ctx->ctx_psb->psb_hdr->hdr_count = 0UL; + ctx->ctx_psb->psb_index = 0UL; } + } else { + /* + * sample recorded in buffer, no need to notify user + */ + ovfl_notify = 0UL; } - if (cnum == ctx->ctx_btb_counter) need_reset_pmd16=1; - } - /* - * In case of BTB overflow we need to reset the BTB index. - */ - if (need_reset_pmd16) { - DBprintk(("reset PMD16\n")); - ia64_set_pmd(16, 0); } -no_reload: - /* - * some counters overflowed, but they did not require - * user notification, so after having reloaded them above - * we simply restart + * No overflow requiring a user level notification */ - if (!bv) return 0x0; + if (ovfl_notify == 0UL) { + if (ovfl_pmds) + pfm_reset_regs(ctx, &ovfl_pmds, PFM_RELOAD_SHORT_RESET); + return 0x0; + } - ctx->ctx_ovfl_regs = bv; /* keep track of what to reset when unblocking */ - /* - * Now we know that: - * - we have some counters which overflowed (contains in bv) - * - someone has asked to be notified on overflow. + /* + * keep track of what to reset when unblocking */ + ctx->ctx_ovfl_regs[0] = ovfl_pmds; - /* - * If the notification task is still present, then notify_task is non - * null. It is clean by that task if it ever exits before we do. + * we have come to this point because there was an overflow and that notification + * was requested. The notify_task may have disappeared, in which case notify_task + * is NULL. */ - if (ctx->ctx_notify_task) { si.si_errno = 0; si.si_addr = NULL; si.si_pid = task->pid; /* who is sending */ - si.si_signo = ctx->ctx_notify_sig; /* is SIGPROF */ - si.si_code = PROF_OVFL; /* goes to user */ - si.si_pfm_ovfl = bv; - - + si.si_signo = SIGPROF; + si.si_code = PROF_OVFL; /* indicates a perfmon SIGPROF signal */ + /* + * Shift the bitvector such that the user sees bit 4 for PMD4 and so on. + * We only use smpl_ovfl[0] for now. It should be fine for quite a while + * until we have more than 61 PMD available. + */ + si.si_pfm_ovfl[0] = ovfl_notify; /* * when the target of the signal is not ourself, we have to be more @@ -1659,15 +2823,29 @@ if (ctx->ctx_notify_task != current) { /* * grab the notification lock for this task + * This guarantees that the sequence: test + send_signal + * is atomic with regards to the ctx_notify_task field. + * + * We need a spinlock and not just an atomic variable for this. + * */ - spin_lock(&ctx->ctx_notify_lock); + spin_lock(&ctx->ctx_lock); /* * now notify_task cannot be modified until we're done * if NULL, they it got modified while we were in the handler */ if (ctx->ctx_notify_task == NULL) { - spin_unlock(&ctx->ctx_notify_lock); + + spin_unlock(&ctx->ctx_lock); + + /* + * If we've lost the notified task, then we will run + * to completion wbut keep the PMU frozen. Results + * will be incorrect anyway. We do not kill task + * to leave it possible to attach perfmon context + * to already running task. + */ goto lost_notify; } /* @@ -1681,20 +2859,23 @@ * necessarily go to the signal handler (if any) when it goes back to * user mode. */ - DBprintk((" %d sending %d notification to %d\n", task->pid, si.si_signo, ctx->ctx_notify_task->pid)); + DBprintk_ovfl(("[%d] sending notification to [%d]\n", + task->pid, ctx->ctx_notify_task->pid)); /* * this call is safe in an interrupt handler, so does read_lock() on tasklist_lock */ - ret = send_sig_info(ctx->ctx_notify_sig, &si, ctx->ctx_notify_task); - if (ret != 0) printk(" send_sig_info(process %d, SIGPROF)=%d\n", ctx->ctx_notify_task->pid, ret); + ret = send_sig_info(SIGPROF, &si, ctx->ctx_notify_task); + if (ret != 0) + printk("send_sig_info(process %d, SIGPROF)=%d\n", + ctx->ctx_notify_task->pid, ret); /* * now undo the protections in order */ if (ctx->ctx_notify_task != current) { read_unlock(&tasklist_lock); - spin_unlock(&ctx->ctx_notify_lock); + spin_unlock(&ctx->ctx_lock); } /* @@ -1711,35 +2892,41 @@ * before, changing it to NULL will still maintain this invariant. * Of course, when it is equal to current it cannot change at this point. */ - if (!CTX_OVFL_NOBLOCK(ctx) && ctx->ctx_notify_task != current) { - th->pfm_must_block = 1; /* will cause blocking */ + DBprintk_ovfl(("block=%d notify [%d] current [%d]\n", + ctx->ctx_fl_block, + ctx->ctx_notify_task ? ctx->ctx_notify_task->pid: -1, + current->pid )); + + if (!CTX_OVFL_NOBLOCK(ctx) && ctx->ctx_notify_task != task) { + t->pfm_ovfl_block_reset = 1; /* will cause blocking */ } } else { -lost_notify: - DBprintk((" notification task has disappeared !\n")); +lost_notify: /* XXX: more to do here, to convert to non-blocking (reset values) */ + + DBprintk_ovfl(("notification task has disappeared !\n")); /* - * for a non-blocking context, we make sure we do not fall into the pfm_overflow_notify() - * trap. Also in the case of a blocking context with lost notify process, then we do not - * want to block either (even though it is interruptible). In this case, the PMU will be kept - * frozen and the process will run to completion without monitoring enabled. + * for a non-blocking context, we make sure we do not fall into the + * pfm_overflow_notify() trap. Also in the case of a blocking context with lost + * notify process, then we do not want to block either (even though it is + * interruptible). In this case, the PMU will be kept frozen and the process will + * run to completion without monitoring enabled. * * Of course, we cannot loose notify process when self-monitoring. */ - th->pfm_must_block = 0; + t->pfm_ovfl_block_reset = 0; } /* - * if we block, we keep the PMU frozen. If non-blocking we restart. - * in the case of non-blocking were the notify process is lost, we also - * restart. + * If notification was successful, then we rely on the pfm_restart() + * call to unfreeze and reset (in both blocking or non-blocking mode). + * + * If notification failed, then we will keep the PMU frozen and run + * the task to completion */ - if (!CTX_OVFL_NOBLOCK(ctx)) - ctx->ctx_fl_frozen = 1; - else - ctx->ctx_fl_frozen = 0; + ctx->ctx_fl_frozen = 1; - DBprintk((" reload pmc0=0x%x must_block=%ld\n", - ctx->ctx_fl_frozen ? 0x1 : 0x0, th->pfm_must_block)); + DBprintk_ovfl(("return pmc0=0x%x must_block=%ld\n", + ctx->ctx_fl_frozen ? 0x1 : 0x0, t->pfm_ovfl_block_reset)); return ctx->ctx_fl_frozen ? 0x1 : 0x0; } @@ -1748,29 +2935,71 @@ perfmon_interrupt (int irq, void *arg, struct pt_regs *regs) { u64 pmc0; - struct task_struct *ta; + struct task_struct *task; + pfm_context_t *ctx; - pmc0 = ia64_get_pmc(0); /* slow */ + pfm_stats.pfm_ovfl_intr_count++; + + /* + * srlz.d done before arriving here + * + * This is slow + */ + pmc0 = ia64_get_pmc(0); /* * if we have some pending bits set * assumes : if any PM[0].bit[63-1] is set, then PMC[0].fr = 1 */ - if ((pmc0 & ~0x1) && (ta=PMU_OWNER())) { + if ((pmc0 & ~0x1UL)!=0UL && (task=PMU_OWNER())!= NULL) { + /* + * we assume that pmc0.fr is always set here + */ + ctx = task->thread.pfm_context; + + /* sanity check */ + if (!ctx) { + printk("perfmon: Spurious overflow interrupt: process %d has no PFM context\n", + task->pid); + return; + } +#ifdef CONFIG_SMP + /* + * Because an IPI has higher priority than the PMU overflow interrupt, it is + * possible that the handler be interrupted by a request from another CPU to fetch + * the PMU state of the currently active context. The task may have just been + * migrated to another CPU which is trying to restore the context. If there was + * a pending overflow interrupt when the task left this CPU, it is possible for + * the handler to get interrupt by the IPI. In which case, we fetch request + * MUST be postponed until the interrupt handler is done. The ctx_is_busy + * flag indicates such a condition. The other CPU must busy wait until it's cleared. + */ + atomic_set(&ctx->ctx_is_busy, 1); +#endif - /* assumes, PMC[0].fr = 1 at this point */ - pmc0 = update_counters(ta, pmc0, regs); + /* + * assume PMC[0].fr = 1 at this point + */ + pmc0 = pfm_overflow_handler(task, ctx, pmc0, regs); /* - * if pmu_frozen = 0 - * pmc0 = 0 and we resume monitoring right away - * else - * pmc0 = 0x1 frozen but all pending bits are cleared + * We always clear the overflow status bits and either unfreeze + * or keep the PMU frozen. */ ia64_set_pmc(0, pmc0); ia64_srlz_d(); + +#ifdef CONFIG_SMP + /* + * announce that we are doing with the context + */ + atomic_set(&ctx->ctx_is_busy, 0); +#endif } else { - printk("perfmon: Spurious PMU overflow interrupt: pmc0=0x%lx owner=%p\n", pmc0, (void *)PMU_OWNER()); + pfm_stats.pfm_spurious_ovfl_intr_count++; + + printk("perfmon: Spurious PMU overflow interrupt on CPU%d: pmc0=0x%lx owner=%p\n", + smp_processor_id(), pmc0, (void *)PMU_OWNER()); } } @@ -1779,120 +3008,105 @@ perfmon_proc_info(char *page) { char *p = page; - u64 pmc0 = ia64_get_pmc(0); int i; - p += sprintf(p, "CPU%d.pmc[0]=%lx\nPerfmon debug: %s\n", smp_processor_id(), pmc0, pfm_debug ? "On" : "Off"); - p += sprintf(p, "proc_sessions=%lu sys_sessions=%lu\n", - pfs_info.pfs_proc_sessions, - pfs_info.pfs_sys_session); + p += sprintf(p, "enabled : %s\n", pmu_conf.pfm_is_disabled ? "No": "Yes"); + p += sprintf(p, "fastctxsw : %s\n", pfm_sysctl.fastctxsw > 0 ? "Yes": "No"); + p += sprintf(p, "ovfl_mask : 0x%lx\n", pmu_conf.perf_ovfl_val); + p += sprintf(p, "overflow intrs : %lu\n", pfm_stats.pfm_ovfl_intr_count); + p += sprintf(p, "spurious intrs : %lu\n", pfm_stats.pfm_spurious_ovfl_intr_count); + p += sprintf(p, "recorded samples : %lu\n", pfm_stats.pfm_recorded_samples_count); + p += sprintf(p, "smpl buffer full : %lu\n", pfm_stats.pfm_full_smpl_buffer_count); + +#ifdef CONFIG_SMP + p += sprintf(p, "CPU%d syst_wide : %d\n" + "CPU%d dcr_pp : %d\n", + smp_processor_id(), + local_cpu_data->pfm_syst_wide, + smp_processor_id(), + local_cpu_data->pfm_dcr_pp); +#endif + + LOCK_PFS(); + p += sprintf(p, "proc_sessions : %lu\n" + "sys_sessions : %lu\n" + "sys_use_dbregs : %lu\n" + "ptrace_use_dbregs: %lu\n", + pfm_sessions.pfs_task_sessions, + pfm_sessions.pfs_sys_sessions, + pfm_sessions.pfs_sys_use_dbregs, + pfm_sessions.pfs_ptrace_use_dbregs); + + UNLOCK_PFS(); for(i=0; i < NR_CPUS; i++) { if (cpu_is_online(i)) { - p += sprintf(p, "CPU%d.pmu_owner: %-6d\n", + p += sprintf(p, "CPU%d owner : %-6d\n", i, pmu_owners[i].owner ? pmu_owners[i].owner->pid: -1); } } - return p - page; -} -/* for debug only */ -static int -perfmon_read_entry(char *page, char **start, off_t off, int count, int *eof, void *data) -{ - int len = perfmon_proc_info(page); - - if (len <= off+count) *eof = 1; - - *start = page + off; - len -= off; + for(i=0; pmd_desc[i].type != PFM_REG_NONE; i++) { + p += sprintf(p, "PMD%-2d: %d 0x%lx 0x%lx\n", + i, + pmd_desc[i].type, + pmd_desc[i].dep_pmd[0], + pmd_desc[i].dep_pmc[0]); + } - if (len>count) len = count; - if (len<0) len = 0; + for(i=0; pmc_desc[i].type != PFM_REG_NONE; i++) { + p += sprintf(p, "PMC%-2d: %d 0x%lx 0x%lx\n", + i, + pmc_desc[i].type, + pmc_desc[i].dep_pmd[0], + pmc_desc[i].dep_pmc[0]); + } - return len; + return p - page; } -static struct irqaction perfmon_irqaction = { - handler: perfmon_interrupt, - flags: SA_INTERRUPT, - name: "perfmon" -}; - -void __init -perfmon_init (void) -{ - pal_perf_mon_info_u_t pm_info; - s64 status; - - register_percpu_irq(IA64_PERFMON_VECTOR, &perfmon_irqaction); - - ia64_set_pmv(IA64_PERFMON_VECTOR); - ia64_srlz_d(); - - pmu_conf.pfm_is_disabled = 1; - - printk("perfmon: version %s (sampling format v%d)\n", PFM_VERSION, PFM_SMPL_HDR_VERSION); - printk("perfmon: Interrupt vectored to %u\n", IA64_PERFMON_VECTOR); - - if ((status=ia64_pal_perf_mon_info(pmu_conf.impl_regs, &pm_info)) != 0) { - printk("perfmon: PAL call failed (%ld)\n", status); - return; - } - pmu_conf.perf_ovfl_val = (1L << pm_info.pal_perf_mon_info_s.width) - 1; - pmu_conf.max_counters = pm_info.pal_perf_mon_info_s.generic; - pmu_conf.num_pmcs = find_num_pm_regs(pmu_conf.impl_regs); - pmu_conf.num_pmds = find_num_pm_regs(&pmu_conf.impl_regs[4]); +/* /proc interface, for debug only */ +static int +perfmon_read_entry(char *page, char **start, off_t off, int count, int *eof, void *data) +{ + int len = perfmon_proc_info(page); - printk("perfmon: %d bits counters (max value 0x%lx)\n", pm_info.pal_perf_mon_info_s.width, pmu_conf.perf_ovfl_val); - printk("perfmon: %ld PMC/PMD pairs, %ld PMCs, %ld PMDs\n", pmu_conf.max_counters, pmu_conf.num_pmcs, pmu_conf.num_pmds); + if (len <= off+count) *eof = 1; - /* sanity check */ - if (pmu_conf.num_pmds >= IA64_NUM_PMD_REGS || pmu_conf.num_pmcs >= IA64_NUM_PMC_REGS) { - printk(KERN_ERR "perfmon: ERROR not enough PMC/PMD storage in kernel, perfmon is DISABLED\n"); - return; /* no need to continue anyway */ - } - /* we are all set */ - pmu_conf.pfm_is_disabled = 0; + *start = page + off; + len -= off; - /* - * Insert the tasklet in the list. - * It is still disabled at this point, so it won't run - printk(__FUNCTION__" tasklet is %p state=%d, count=%d\n", &perfmon_tasklet, perfmon_tasklet.state, perfmon_tasklet.count); - */ + if (len>count) len = count; + if (len<0) len = 0; - /* - * for now here for debug purposes - */ - perfmon_dir = create_proc_read_entry ("perfmon", 0, 0, perfmon_read_entry, NULL); + return len; } +#ifdef CONFIG_SMP void -perfmon_init_percpu (void) +pfm_syst_wide_update_task(struct task_struct *task, int mode) { - ia64_set_pmv(IA64_PERFMON_VECTOR); - ia64_srlz_d(); + struct pt_regs *regs = (struct pt_regs *)((unsigned long) task + IA64_STK_OFFSET); + + regs--; + + /* + * propagate the value of the dcr_pp bit to the psr + */ + ia64_psr(regs)->pp = mode ? local_cpu_data->pfm_dcr_pp : 0; } +#endif + void -pfm_save_regs (struct task_struct *ta) +pfm_save_regs (struct task_struct *task) { - struct task_struct *owner; pfm_context_t *ctx; - struct thread_struct *t; - u64 pmc0, psr; - unsigned long mask; - int i; + u64 psr; - t = &ta->thread; - ctx = ta->thread.pfm_context; + ctx = task->thread.pfm_context; - /* - * We must make sure that we don't loose any potential overflow - * interrupt while saving PMU context. In this code, external - * interrupts are always enabled. - */ /* * save current PSR: needed because we modify it @@ -1901,66 +3115,59 @@ /* * stop monitoring: - * This is the only way to stop monitoring without destroying overflow - * information in PMC[0]. - * This is the last instruction which can cause overflow when monitoring - * in kernel. - * By now, we could still have an overflow interrupt in-flight. + * This is the last instruction which can generate an overflow + * + * We do not need to set psr.sp because, it is irrelevant in kernel. + * It will be restored from ipsr when going back to user level */ - __asm__ __volatile__ ("rsm psr.up|psr.pp;;"::: "memory"); + __asm__ __volatile__ ("rum psr.up;;"::: "memory"); + ia64_srlz_i(); - /* - * Mark the PMU as not owned - * This will cause the interrupt handler to do nothing in case an overflow - * interrupt was in-flight - * This also guarantees that pmc0 will contain the final state - * It virtually gives us full control over overflow processing from that point - * on. - * It must be an atomic operation. - */ - owner = PMU_OWNER(); - SET_PMU_OWNER(NULL); + ctx->ctx_saved_psr = psr; - /* - * read current overflow status: - * - * we are guaranteed to read the final stable state - */ - ia64_srlz_d(); - pmc0 = ia64_get_pmc(0); /* slow */ + //ctx->ctx_last_cpu = smp_processor_id(); - /* - * freeze PMU: - * - * This destroys the overflow information. This is required to make sure - * next process does not start with monitoring on if not requested - */ - ia64_set_pmc(0, 1); +} - /* - * Check for overflow bits and proceed manually if needed +static void +pfm_lazy_save_regs (struct task_struct *task) +{ + pfm_context_t *ctx; + struct thread_struct *t; + unsigned long mask; + int i; + + DBprintk(("on [%d] by [%d]\n", task->pid, current->pid)); + + t = &task->thread; + ctx = task->thread.pfm_context; + +#ifdef CONFIG_SMP + /* + * announce we are saving this PMU state + * This will cause other CPU, to wait until we're done + * before using the context.h * - * It is safe to call the interrupt handler now because it does - * not try to block the task right away. Instead it will set a - * flag and let the task proceed. The blocking will only occur - * next time the task exits from the kernel. - */ - if (pmc0 & ~0x1) { - update_counters(owner, pmc0, NULL); - /* we will save the updated version of pmc0 */ - } - /* - * restore PSR for context switch to save + * must be an atomic operation */ - __asm__ __volatile__ ("mov psr.l=%0;; srlz.i;;"::"r"(psr): "memory"); + atomic_set(&ctx->ctx_saving_in_progress, 1); + + /* + * if owner is NULL, it means that the other CPU won the race + * and the IPI has caused the context to be saved in pfm_handle_fectch_regs() + * instead of here. We have nothing to do + * + * note that this is safe, because the other CPU NEVER modifies saving_in_progress. + */ + if (PMU_OWNER() == NULL) goto do_nothing; +#endif /* - * we do not save registers if we can do lazy + * do not own the PMU */ - if (PFM_CAN_DO_LAZY()) { - SET_PMU_OWNER(owner); - return; - } + SET_PMU_OWNER(NULL); + + ia64_srlz_d(); /* * XXX needs further optimization. @@ -1971,116 +3178,395 @@ if (mask & 0x1) t->pmd[i] =ia64_get_pmd(i); } - /* skip PMC[0], we handle it separately */ - mask = ctx->ctx_used_pmcs[0]>>1; - for (i=1; mask; i++, mask>>=1) { - if (mask & 0x1) t->pmc[i] = ia64_get_pmc(i); - } + /* save pmc0 */ + t->pmc[0] = ia64_get_pmc(0); + + /* not owned by this CPU */ + atomic_set(&ctx->ctx_last_cpu, -1); + +#ifdef CONFIG_SMP +do_nothing: +#endif /* - * Throughout this code we could have gotten an overflow interrupt. It is transformed - * into a spurious interrupt as soon as we give up pmu ownership. + * declare we are done saving this context + * + * must be an atomic operation */ + atomic_set(&ctx->ctx_saving_in_progress,0); + } -static void -pfm_lazy_save_regs (struct task_struct *ta) +#ifdef CONFIG_SMP +/* + * Handles request coming from other CPUs + */ +static void +pfm_handle_fetch_regs(void *info) { - pfm_context_t *ctx; + pfm_smp_ipi_arg_t *arg = info; struct thread_struct *t; + pfm_context_t *ctx; unsigned long mask; int i; - DBprintk((" on [%d] by [%d]\n", ta->pid, current->pid)); + ctx = arg->task->thread.pfm_context; + t = &arg->task->thread; + + DBprintk(("task=%d owner=%d saving=%d\n", + arg->task->pid, + PMU_OWNER() ? PMU_OWNER()->pid: -1, + atomic_read(&ctx->ctx_saving_in_progress))); + + /* must wait until not busy before retrying whole request */ + if (atomic_read(&ctx->ctx_is_busy)) { + arg->retval = 2; + return; + } + + /* must wait if saving was interrupted */ + if (atomic_read(&ctx->ctx_saving_in_progress)) { + arg->retval = 1; + return; + } + + /* can proceed, done with context */ + if (PMU_OWNER() != arg->task) { + arg->retval = 0; + return; + } + + DBprintk(("saving state for [%d] used_pmcs=0x%lx reload_pmcs=0x%lx used_pmds=0x%lx\n", + arg->task->pid, + ctx->ctx_used_pmcs[0], + ctx->ctx_reload_pmcs[0], + ctx->ctx_used_pmds[0])); + + /* + * XXX: will be replaced with pure assembly call + */ + SET_PMU_OWNER(NULL); + + ia64_srlz_d(); - t = &ta->thread; - ctx = ta->thread.pfm_context; /* * XXX needs further optimization. - * Also must take holes into account */ mask = ctx->ctx_used_pmds[0]; for (i=0; mask; i++, mask>>=1) { - if (mask & 0x1) t->pmd[i] =ia64_get_pmd(i); + if (mask & 0x1) t->pmd[i] = ia64_get_pmd(i); } - - /* skip PMC[0], we handle it separately */ - mask = ctx->ctx_used_pmcs[0]>>1; - for (i=1; mask; i++, mask>>=1) { - if (mask & 0x1) t->pmc[i] = ia64_get_pmc(i); + + /* save pmc0 */ + t->pmc[0] = ia64_get_pmc(0); + + /* not owned by this CPU */ + atomic_set(&ctx->ctx_last_cpu, -1); + + /* can proceed */ + arg->retval = 0; +} + +/* + * Function call to fetch PMU state from another CPU identified by 'cpu'. + * If the context is being saved on the remote CPU, then we busy wait until + * the saving is done and then we return. In this case, non IPI is sent. + * Otherwise, we send an IPI to the remote CPU, potentially interrupting + * pfm_lazy_save_regs() over there. + * + * If the retval==1, then it means that we interrupted remote save and that we must + * wait until the saving is over before proceeding. + * Otherwise, we did the saving on the remote CPU, and it was done by the time we got there. + * in either case, we can proceed. + */ +static void +pfm_fetch_regs(int cpu, struct task_struct *task, pfm_context_t *ctx) +{ + pfm_smp_ipi_arg_t arg; + int ret; + + arg.task = task; + arg.retval = -1; + + if (atomic_read(&ctx->ctx_is_busy)) { +must_wait_busy: + while (atomic_read(&ctx->ctx_is_busy)); } - SET_PMU_OWNER(NULL); + + if (atomic_read(&ctx->ctx_saving_in_progress)) { + DBprintk(("no IPI, must wait for [%d] to be saved on [%d]\n", task->pid, cpu)); +must_wait_saving: + /* busy wait */ + while (atomic_read(&ctx->ctx_saving_in_progress)); + DBprintk(("done saving for [%d] on [%d]\n", task->pid, cpu)); + return; + } + DBprintk(("calling CPU %d from CPU %d\n", cpu, smp_processor_id())); + + if (cpu == -1) { + printk("refusing to use -1 for [%d]\n", task->pid); + return; + } + + /* will send IPI to other CPU and wait for completion of remote call */ + if ((ret=smp_call_function_single(cpu, pfm_handle_fetch_regs, &arg, 0, 1))) { + printk("perfmon: remote CPU call from %d to %d error %d\n", smp_processor_id(), cpu, ret); + return; + } + /* + * we must wait until saving is over on the other CPU + * This is the case, where we interrupted the saving which started just at the time we sent the + * IPI. + */ + if (arg.retval == 1) goto must_wait_saving; + if (arg.retval == 2) goto must_wait_busy; } +#endif /* CONFIG_SMP */ void -pfm_load_regs (struct task_struct *ta) +pfm_load_regs (struct task_struct *task) { - struct thread_struct *t = &ta->thread; - pfm_context_t *ctx = ta->thread.pfm_context; + struct thread_struct *t; + pfm_context_t *ctx; struct task_struct *owner; unsigned long mask; + u64 psr; int i; +#ifdef CONFIG_SMP + int cpu; +#endif owner = PMU_OWNER(); - if (owner == ta) goto skip_restore; + ctx = task->thread.pfm_context; + + /* + * if we were the last user, then nothing to do except restore psr + */ + if (owner == task) { + if (atomic_read(&ctx->ctx_last_cpu) != smp_processor_id()) + DBprintk(("invalid last_cpu=%d for [%d]\n", + atomic_read(&ctx->ctx_last_cpu), task->pid)); + + psr = ctx->ctx_saved_psr; + __asm__ __volatile__ ("mov psr.l=%0;; srlz.i;;"::"r"(psr): "memory"); + + return; + } + DBprintk(("load_regs: must reload for [%d] owner=%d\n", + task->pid, owner ? owner->pid : -1 )); + /* + * someone else is still using the PMU, first push it out and + * then we'll be able to install our stuff ! + */ if (owner) pfm_lazy_save_regs(owner); - SET_PMU_OWNER(ta); +#ifdef CONFIG_SMP + /* + * check if context on another CPU (-1 means saved) + * We MUST use the variable, as last_cpu may change behind our + * back. If it changes to -1 (not on a CPU anymore), then in cpu + * we have the last CPU the context was on. We may be sending the + * IPI for nothing, but we have no way of verifying this. + */ + cpu = atomic_read(&ctx->ctx_last_cpu); + if (cpu != -1) { + pfm_fetch_regs(cpu, task, ctx); + } +#endif + t = &task->thread; - mask = ctx->ctx_used_pmds[0]; + /* + * To avoid leaking information to the user level when psr.sp=0, + * we must reload ALL implemented pmds (even the ones we don't use). + * In the kernel we only allow PFM_READ_PMDS on registers which + * we initialized or requested (sampling) so there is no risk there. + * + * As an optimization, we will only reload the PMD that we use when + * the context is in protected mode, i.e. psr.sp=1 because then there + * is no leak possible. + */ + mask = pfm_sysctl.fastctxsw || ctx->ctx_fl_protected ? ctx->ctx_used_pmds[0] : ctx->ctx_reload_pmds[0]; for (i=0; mask; i++, mask>>=1) { - if (mask & 0x1) ia64_set_pmd(i, t->pmd[i]); + if (mask & 0x1) ia64_set_pmd(i, t->pmd[i] & pmu_conf.perf_ovfl_val); } - /* skip PMC[0] to avoid side effects */ - mask = ctx->ctx_used_pmcs[0]>>1; - for (i=1; mask; i++, mask>>=1) { + /* + * PMC0 is never set in the mask because it is always restored + * separately. + * + * ALL PMCs are systematically reloaded, unused registers + * get their default (PAL reset) values to avoid picking up + * stale configuration. + */ + mask = ctx->ctx_reload_pmcs[0]; + for (i=0; mask; i++, mask>>=1) { if (mask & 0x1) ia64_set_pmc(i, t->pmc[i]); } -skip_restore: + + /* + * we restore ALL the debug registers to avoid picking up + * stale state. + */ + if (ctx->ctx_fl_using_dbreg) { + for (i=0; i < pmu_conf.num_ibrs; i++) { + ia64_set_ibr(i, t->ibr[i]); + } + ia64_srlz_i(); + for (i=0; i < pmu_conf.num_dbrs; i++) { + ia64_set_dbr(i, t->dbr[i]); + } + } + ia64_srlz_d(); + + if (t->pmc[0] & ~0x1) { + pfm_overflow_handler(task, ctx, t->pmc[0], NULL); + } + /* - * unfreeze only when possible + * fl_frozen==1 when we are in blocking mode waiting for restart */ if (ctx->ctx_fl_frozen == 0) { ia64_set_pmc(0, 0); ia64_srlz_d(); - /* place where we potentially (kernel level) start monitoring again */ } + atomic_set(&ctx->ctx_last_cpu, smp_processor_id()); + + SET_PMU_OWNER(task); + + /* + * restore the psr we changed in pfm_save_regs() + */ + psr = ctx->ctx_saved_psr; + __asm__ __volatile__ ("mov psr.l=%0;; srlz.i;;"::"r"(psr): "memory"); + } +/* + * XXX: make this routine able to work with non current context + */ +static void +ia64_reset_pmu(struct task_struct *task) +{ + struct thread_struct *t = &task->thread; + pfm_context_t *ctx = t->pfm_context; + unsigned long mask; + int i; + + if (task != current) { + printk("perfmon: invalid task in ia64_reset_pmu()\n"); + return; + } + + /* Let's make sure the PMU is frozen */ + ia64_set_pmc(0,1); + + /* + * install reset values for PMC. We skip PMC0 (done above) + * XX: good up to 64 PMCS + */ + mask = pmu_conf.impl_regs[0] >> 1; + for(i=1; mask; mask>>=1, i++) { + if (mask & 0x1) { + ia64_set_pmc(i, reset_pmcs[i]); + /* + * When restoring context, we must restore ALL pmcs, even the ones + * that the task does not use to avoid leaks and possibly corruption + * of the sesion because of configuration conflicts. So here, we + * initialize the entire set used in the context switch restore routine. + */ + t->pmc[i] = reset_pmcs[i]; + DBprintk((" pmc[%d]=0x%lx\n", i, reset_pmcs[i])); + + } + } + /* + * clear reset values for PMD. + * XXX: good up to 64 PMDS. Suppose that zero is a valid value. + */ + mask = pmu_conf.impl_regs[4]; + for(i=0; mask; mask>>=1, i++) { + if (mask & 0x1) ia64_set_pmd(i, 0UL); + t->pmd[i] = 0UL; + } + + /* + * On context switched restore, we must restore ALL pmc and ALL pmd even + * when they are not actively used by the task. In UP, the incoming process + * may otherwise pick up left over PMC, PMD state from the previous process. + * As opposed to PMD, stale PMC can cause harm to the incoming + * process because they may change what is being measured. + * Therefore, we must systematically reinstall the entire + * PMC state. In SMP, the same thing is possible on the + * same CPU but also on between 2 CPUs. + * + * The problem with PMD is information leaking especially + * to user level when psr.sp=0 + * + * There is unfortunately no easy way to avoid this problem + * on either UP or SMP. This definitively slows down the + * pfm_load_regs() function. + */ + + /* + * We must include all the PMC in this mask to make sure we don't + * see any side effect of a stale state, such as opcode matching + * or range restrictions, for instance. + * + * We never directly restore PMC0 so we do not include it in the mask. + */ + ctx->ctx_reload_pmcs[0] = pmu_conf.impl_regs[0] & ~0x1; + /* + * We must include all the PMD in this mask to avoid picking + * up stale value and leak information, especially directly + * at the user level when psr.sp=0 + */ + ctx->ctx_reload_pmds[0] = pmu_conf.impl_regs[4]; + + /* + * Keep track of the pmds we want to sample + * XXX: may be we don't need to save/restore the DEAR/IEAR pmds + * but we do need the BTB for sure. This is because of a hardware + * buffer of 1 only for non-BTB pmds. + * + * We ignore the unimplemented pmds specified by the user + */ + ctx->ctx_used_pmds[0] = ctx->ctx_smpl_regs[0] & pmu_conf.impl_regs[4]; + ctx->ctx_used_pmcs[0] = 1; /* always save/restore PMC[0] */ + + /* + * useful in case of re-enable after disable + */ + ctx->ctx_used_ibrs[0] = 0UL; + ctx->ctx_used_dbrs[0] = 0UL; + + ia64_srlz_d(); +} /* * This function is called when a thread exits (from exit_thread()). * This is a simplified pfm_save_regs() that simply flushes the current * register state into the save area taking into account any pending - * overflow. This time no notification is sent because the taks is dying + * overflow. This time no notification is sent because the task is dying * anyway. The inline processing of overflows avoids loosing some counts. * The PMU is frozen on exit from this call and is to never be reenabled * again for this task. + * */ void -pfm_flush_regs (struct task_struct *ta) +pfm_flush_regs (struct task_struct *task) { pfm_context_t *ctx; - u64 pmc0, psr, mask; - int i,j; + u64 pmc0; + unsigned long mask2, val; + int i; - if (ta == NULL) { - panic(__FUNCTION__" task is NULL\n"); - } - ctx = ta->thread.pfm_context; - if (ctx == NULL) { - panic(__FUNCTION__" no PFM ctx is NULL\n"); - } - /* - * We must make sure that we don't loose any potential overflow - * interrupt while saving PMU context. In this code, external - * interrupts are always enabled. - */ + ctx = task->thread.pfm_context; - /* - * save current PSR: needed because we modify it + if (ctx == NULL) return; + + /* + * that's it if context already disabled */ - __asm__ __volatile__ ("mov %0=psr;;": "=r"(psr) :: "memory"); + if (ctx->ctx_flags.state == PFM_CTX_DISABLED) return; /* * stop monitoring: @@ -2090,7 +3576,33 @@ * in kernel. * By now, we could still have an overflow interrupt in-flight. */ - __asm__ __volatile__ ("rsm psr.up;;"::: "memory"); + if (ctx->ctx_fl_system) { + + + /* disable dcr pp */ + ia64_set_dcr(ia64_get_dcr() & ~IA64_DCR_PP); + + /* stop monitoring */ + __asm__ __volatile__ ("rsm psr.pp;;"::: "memory"); + + ia64_srlz_i(); + +#ifdef CONFIG_SMP + local_cpu_data->pfm_syst_wide = 0; + local_cpu_data->pfm_dcr_pp = 0; +#else + pfm_tasklist_toggle_pp(0); +#endif + } else { + + /* stop monitoring */ + __asm__ __volatile__ ("rum psr.up;;"::: "memory"); + + ia64_srlz_i(); + + /* no more save/restore on ctxsw */ + current->thread.flags &= ~IA64_THREAD_PM_VALID; + } /* * Mark the PMU as not owned @@ -2121,111 +3633,145 @@ ia64_srlz_d(); /* - * restore PSR for context switch to save + * We don't need to restore psr, because we are on our way out */ - __asm__ __volatile__ ("mov psr.l=%0;;srlz.i;"::"r"(psr): "memory"); /* * This loop flushes the PMD into the PFM context. - * IT also processes overflow inline. + * It also processes overflow inline. * * IMPORTANT: No notification is sent at this point as the process is dying. * The implicit notification will come from a SIGCHILD or a return from a * waitpid(). * - * XXX: must take holes into account */ - mask = pmc0 >> PMU_FIRST_COUNTER; - for (i=0,j=PMU_FIRST_COUNTER; i< pmu_conf.max_counters; i++,j++) { - - /* collect latest results */ - ctx->ctx_pmds[i].val += ia64_get_pmd(j) & pmu_conf.perf_ovfl_val; - - /* - * now everything is in ctx_pmds[] and we need - * to clear the saved context from save_regs() such that - * pfm_read_pmds() gets the correct value - */ - ta->thread.pmd[j] = 0; - - /* take care of overflow inline */ - if (mask & 0x1) { - ctx->ctx_pmds[i].val += 1 + pmu_conf.perf_ovfl_val; - DBprintk((" PMD[%d] overflowed pmd=0x%lx pmds.val=0x%lx\n", - j, ia64_get_pmd(j), ctx->ctx_pmds[i].val)); - } - mask >>=1; - } -} - -/* - * XXX: this routine is not very portable for PMCs - * XXX: make this routine able to work with non current context - */ -static void -ia64_reset_pmu(void) -{ - int i; - /* PMU is frozen, no pending overflow bits */ - ia64_set_pmc(0,1); + if (atomic_read(&ctx->ctx_last_cpu) != smp_processor_id()) + printk("perfmon: [%d] last_cpu=%d\n", task->pid, atomic_read(&ctx->ctx_last_cpu)); - /* extra overflow bits + counter configs cleared */ - for(i=1; i< PMU_FIRST_COUNTER + pmu_conf.max_counters ; i++) { - ia64_set_pmc(i,0); - } + /* + * we save all the used pmds + * we take care of overflows for pmds used as counters + */ + mask2 = ctx->ctx_used_pmds[0]; + for (i = 0; mask2; i++, mask2>>=1) { - /* opcode matcher set to all 1s */ - ia64_set_pmc(8,~0); - ia64_set_pmc(9,~0); + /* skip non used pmds */ + if ((mask2 & 0x1) == 0) continue; - /* I-EAR config cleared, plm=0 */ - ia64_set_pmc(10,0); + val = ia64_get_pmd(i); - /* D-EAR config cleared, PMC[11].pt must be 1 */ - ia64_set_pmc(11,1 << 28); + if (PMD_IS_COUNTING(i)) { + DBprintk(("[%d] pmd[%d] soft_pmd=0x%lx hw_pmd=0x%lx\n", task->pid, i, ctx->ctx_soft_pmds[i].val, val & pmu_conf.perf_ovfl_val)); - /* BTB config. plm=0 */ - ia64_set_pmc(12,0); + /* collect latest results */ + ctx->ctx_soft_pmds[i].val += val & pmu_conf.perf_ovfl_val; - /* Instruction address range, PMC[13].ta must be 1 */ - ia64_set_pmc(13,1); + /* + * now everything is in ctx_soft_pmds[] and we need + * to clear the saved context from save_regs() such that + * pfm_read_pmds() gets the correct value + */ + task->thread.pmd[i] = 0; - /* clears all PMD registers */ - for(i=0;i< pmu_conf.num_pmds; i++) { - if (PMD_IS_IMPL(i)) ia64_set_pmd(i,0); + /* + * take care of overflow inline + */ + if (pmc0 & (1UL << i)) { + ctx->ctx_soft_pmds[i].val += 1 + pmu_conf.perf_ovfl_val; + DBprintk(("[%d] pmd[%d] overflowed soft_pmd=0x%lx\n", + task->pid, i, ctx->ctx_soft_pmds[i].val)); + } + } else { + DBprintk(("[%d] pmd[%d] hw_pmd=0x%lx\n", task->pid, i, val)); + /* + * not a counter, just save value as is + */ + task->thread.pmd[i] = val; + } } - ia64_srlz_d(); + /* + * indicates that context has been saved + */ + atomic_set(&ctx->ctx_last_cpu, -1); + } + /* - * task is the newly created task + * task is the newly created task, pt_regs for new child */ int pfm_inherit(struct task_struct *task, struct pt_regs *regs) { - pfm_context_t *ctx = current->thread.pfm_context; + pfm_context_t *ctx; pfm_context_t *nctx; - struct thread_struct *th = &task->thread; - int i, cnum; + struct thread_struct *thread; + unsigned long m; + int i; /* - * bypass completely for system wide + * the new task was copied from parent and therefore points + * to the parent's context at this point */ - if (pfs_info.pfs_sys_session) { - DBprintk((" enabling psr.pp for %d\n", task->pid)); - ia64_psr(regs)->pp = pfs_info.pfs_pp; - return 0; + ctx = task->thread.pfm_context; + thread = &task->thread; + + /* + * make sure child cannot mess up the monitoring session + */ + ia64_psr(regs)->sp = 1; + DBprintk(("enabling psr.sp for [%d]\n", task->pid)); + + + /* + * if there was a virtual mapping for the sampling buffer + * the mapping is NOT inherited across fork() (see VM_DONTCOPY), + * so we don't have to explicitely remove it here. + * + * + * Part of the clearing of fields is also done in + * copy_thread() because the fiels are outside the + * pfm_context structure and can affect tasks not + * using perfmon. + */ + + /* clear pending notification */ + task->thread.pfm_ovfl_block_reset = 0; + + /* + * clear cpu pinning restriction for child + */ + if (ctx->ctx_fl_system) { + task->cpus_allowed = ctx->ctx_saved_cpus_allowed; + task->need_resched = 1; + + DBprintk(("setting cpus_allowed for [%d] to 0x%lx from 0x%lx\n", + task->pid, + ctx->ctx_saved_cpus_allowed, + current->cpus_allowed)); } /* * takes care of easiest case first */ if (CTX_INHERIT_MODE(ctx) == PFM_FL_INHERIT_NONE) { - DBprintk((" removing PFM context for %d\n", task->pid)); - task->thread.pfm_context = NULL; - task->thread.pfm_must_block = 0; - atomic_set(&task->thread.pfm_notifiers_check, 0); + + DBprintk(("removing PFM context for [%d]\n", task->pid)); + + task->thread.pfm_context = NULL; + + /* + * we must clear psr.up because the new child does + * not have a context and the PM_VALID flag is cleared + * in copy_thread(). + * + * we do not clear psr.pp because it is always + * controlled by the system wide logic and we should + * never be here when system wide is running anyway + */ + ia64_psr(regs)->up = 0; + /* copy_thread() clears IA64_THREAD_PM_VALID */ return 0; } @@ -2235,146 +3781,347 @@ /* copy content */ *nctx = *ctx; + if (CTX_INHERIT_MODE(ctx) == PFM_FL_INHERIT_ONCE) { nctx->ctx_fl_inherit = PFM_FL_INHERIT_NONE; - atomic_set(&task->thread.pfm_notifiers_check, 0); - DBprintk((" downgrading to INHERIT_NONE for %d\n", task->pid)); - pfs_info.pfs_proc_sessions++; + DBprintk(("downgrading to INHERIT_NONE for [%d]\n", task->pid)); } + /* + * task is not yet visible in the tasklist, so we do + * not need to lock the newly created context. + * However, we must grab the tasklist_lock to ensure + * that the ctx_owner or ctx_notify_task do not disappear + * while we increment their check counters. + */ + read_lock(&tasklist_lock); + + if (nctx->ctx_notify_task) + atomic_inc(&nctx->ctx_notify_task->thread.pfm_notifiers_check); + + if (nctx->ctx_owner) + atomic_inc(&nctx->ctx_owner->thread.pfm_owners_check); + + read_unlock(&tasklist_lock); + + + LOCK_PFS(); + pfm_sessions.pfs_task_sessions++; + UNLOCK_PFS(); /* initialize counters in new context */ - for(i=0, cnum= PMU_FIRST_COUNTER; i < pmu_conf.max_counters; cnum++, i++) { - nctx->ctx_pmds[i].val = nctx->ctx_pmds[i].ival & ~pmu_conf.perf_ovfl_val; - th->pmd[cnum] = nctx->ctx_pmds[i].ival & pmu_conf.perf_ovfl_val; + m = nctx->ctx_used_pmds[0] >> PMU_FIRST_COUNTER; + for(i = PMU_FIRST_COUNTER ; m ; m>>=1, i++) { + if ((m & 0x1) && pmu_conf.pmd_desc[i].type == PFM_REG_COUNTING) { + nctx->ctx_soft_pmds[i].val = nctx->ctx_soft_pmds[i].ival & ~pmu_conf.perf_ovfl_val; + thread->pmd[i] = nctx->ctx_soft_pmds[i].ival & pmu_conf.perf_ovfl_val; + } + /* what about the other pmds? zero or keep as is */ } - /* clear BTB index register */ - th->pmd[16] = 0; + /* + * clear BTB index register + * XXX: CPU-model specific knowledge! + */ + thread->pmd[16] = 0; + + + nctx->ctx_fl_frozen = 0; + nctx->ctx_ovfl_regs[0] = 0UL; + atomic_set(&nctx->ctx_last_cpu, -1); + + /* + * here nctx->ctx_psb == ctx->ctx_psb + * + * increment reference count to sampling + * buffer, if any. Note that this is independent + * from the virtual mapping. The latter is never + * inherited while the former will be if context + * is setup to something different from PFM_FL_INHERIT_NONE + */ + if (nctx->ctx_psb) { + LOCK_PSB(nctx->ctx_psb); + + nctx->ctx_psb->psb_refcnt++; + + DBprintk(("updated smpl @ %p refcnt=%lu psb_flags=0x%x\n", + ctx->ctx_psb->psb_hdr, + ctx->ctx_psb->psb_refcnt, + ctx->ctx_psb->psb_flags)); + + UNLOCK_PSB(nctx->ctx_psb); - /* if sampling then increment number of users of buffer */ - if (nctx->ctx_smpl_buf) { - atomic_inc(&nctx->ctx_smpl_buf->psb_refcnt); + /* + * remove any pointer to sampling buffer mapping + */ + nctx->ctx_smpl_vaddr = 0; } - nctx->ctx_fl_frozen = 0; - nctx->ctx_ovfl_regs = 0; sema_init(&nctx->ctx_restart_sem, 0); /* reset this semaphore to locked */ - /* clear pending notification */ - th->pfm_must_block = 0; - /* link with new task */ - th->pfm_context = nctx; + thread->pfm_context = nctx; - DBprintk((" nctx=%p for process %d\n", (void *)nctx, task->pid)); + DBprintk(("nctx=%p for process [%d]\n", (void *)nctx, task->pid)); /* * the copy_thread routine automatically clears * IA64_THREAD_PM_VALID, so we need to reenable it, if it was used by the caller */ if (current->thread.flags & IA64_THREAD_PM_VALID) { - DBprintk((" setting PM_VALID for %d\n", task->pid)); - th->flags |= IA64_THREAD_PM_VALID; + DBprintk(("setting PM_VALID for [%d]\n", task->pid)); + thread->flags |= IA64_THREAD_PM_VALID; } return 0; } /* - * called from release_thread(), at this point this task is not in the - * tasklist anymore + * + * We cannot touch any of the PMU registers at this point as we may + * not be running on the same CPU the task was last run on. Therefore + * it is assumed that the PMU has been stopped appropriately in + * pfm_flush_regs() called from exit_thread(). + * + * The function is called in the context of the parent via a release_thread() + * and wait4(). The task is not in the tasklist anymore. */ void pfm_context_exit(struct task_struct *task) { pfm_context_t *ctx = task->thread.pfm_context; - if (!ctx) { - DBprintk((" invalid context for %d\n", task->pid)); - return; - } + /* + * check sampling buffer + */ + if (ctx->ctx_psb) { + pfm_smpl_buffer_desc_t *psb = ctx->ctx_psb; + + LOCK_PSB(psb); + + DBprintk(("sampling buffer from [%d] @%p size %ld refcnt=%lu psb_flags=0x%x\n", + task->pid, + psb->psb_hdr, psb->psb_size, psb->psb_refcnt, psb->psb_flags)); + + /* + * in the case where we are the last user, we may be able to free + * the buffer + */ + psb->psb_refcnt--; + + if (psb->psb_refcnt == 0) { + + /* + * The flag is cleared in pfm_vm_close(). which gets + * called from do_exit() via exit_mm(). + * By the time we come here, the task has no more mm context. + * + * We can only free the psb and buffer here after the vm area + * describing the buffer has been removed. This normally happens + * as part of do_exit() but the entire mm context is ONLY removed + * once its reference counts goes to zero. This is typically + * the case except for multi-threaded (several tasks) processes. + * + * See pfm_vm_close() and pfm_cleanup_smpl_buf() for more details. + */ + if ((psb->psb_flags & PSB_HAS_VMA) == 0) { + + DBprintk(("cleaning sampling buffer from [%d] @%p size %ld\n", + task->pid, + psb->psb_hdr, psb->psb_size)); + + /* + * free the buffer and psb + */ + pfm_rvfree(psb->psb_hdr, psb->psb_size); + kfree(psb); + psb = NULL; + } + } + /* psb may have been deleted */ + if (psb) UNLOCK_PSB(psb); + } - /* check is we have a sampling buffer attached */ - if (ctx->ctx_smpl_buf) { - pfm_smpl_buffer_desc_t *psb = ctx->ctx_smpl_buf; - - /* if only user left, then remove */ - DBprintk((" [%d] [%d] psb->refcnt=%d\n", current->pid, task->pid, psb->psb_refcnt.counter)); - - if (atomic_dec_and_test(&psb->psb_refcnt) ) { - rvfree(psb->psb_hdr, psb->psb_size); - vfree(psb); - DBprintk((" [%d] cleaning [%d] sampling buffer\n", current->pid, task->pid )); - } - } - DBprintk((" [%d] cleaning [%d] pfm_context @%p\n", current->pid, task->pid, (void *)ctx)); - - /* - * To avoid getting the notified task scan the entire process list - * when it exits because it would have pfm_notifiers_check set, we - * decrease it by 1 to inform the task, that one less task is going - * to send it notification. each new notifer increases this field by - * 1 in pfm_context_create(). Of course, there is race condition between - * decreasing the value and the notified task exiting. The danger comes - * from the fact that we have a direct pointer to its task structure - * thereby bypassing the tasklist. We must make sure that if we have - * notify_task!= NULL, the target task is still somewhat present. It may - * already be detached from the tasklist but that's okay. Note that it is - * okay if we 'miss the deadline' and the task scans the list for nothing, - * it will affect performance but not correctness. The correctness is ensured - * by using the notify_lock whic prevents the notify_task from changing on us. - * Once holdhing this lock, if we see notify_task!= NULL, then it will stay like + DBprintk(("cleaning [%d] pfm_context @%p notify_task=%p check=%d mm=%p\n", + task->pid, ctx, + ctx->ctx_notify_task, + atomic_read(&task->thread.pfm_notifiers_check), task->mm)); + + /* + * To avoid getting the notified task or owner task scan the entire process + * list when they exit, we decrement notifiers_check and owners_check respectively. + * + * Of course, there is race condition between decreasing the value and the + * task exiting. The danger comes from the fact that, in both cases, we have a + * direct pointer to a task structure thereby bypassing the tasklist. + * We must make sure that, if we have task!= NULL, the target task is still + * present and is identical to the initial task specified + * during pfm_context_create(). It may already be detached from the tasklist but + * that's okay. Note that it is okay if we miss the deadline and the task scans + * the list for nothing, it will affect performance but not correctness. + * The correctness is ensured by using the ctx_lock which prevents the + * notify_task from changing the fields in our context. + * Once holdhing this lock, if we see task!= NULL, then it will stay like * that until we release the lock. If it is NULL already then we came too late. */ - spin_lock(&ctx->ctx_notify_lock); + LOCK_CTX(ctx); - if (ctx->ctx_notify_task) { - DBprintk((" [%d] [%d] atomic_sub on [%d] notifiers=%u\n", current->pid, task->pid, - ctx->ctx_notify_task->pid, - atomic_read(&ctx->ctx_notify_task->thread.pfm_notifiers_check))); + if (ctx->ctx_notify_task != NULL) { + DBprintk(("[%d], [%d] atomic_sub on [%d] notifiers=%u\n", current->pid, + task->pid, + ctx->ctx_notify_task->pid, + atomic_read(&ctx->ctx_notify_task->thread.pfm_notifiers_check))); - atomic_sub(1, &ctx->ctx_notify_task->thread.pfm_notifiers_check); + atomic_dec(&ctx->ctx_notify_task->thread.pfm_notifiers_check); } - spin_unlock(&ctx->ctx_notify_lock); + if (ctx->ctx_owner != NULL) { + DBprintk(("[%d], [%d] atomic_sub on [%d] owners=%u\n", + current->pid, + task->pid, + ctx->ctx_owner->pid, + atomic_read(&ctx->ctx_owner->thread.pfm_owners_check))); + + atomic_dec(&ctx->ctx_owner->thread.pfm_owners_check); + } + + UNLOCK_CTX(ctx); + + LOCK_PFS(); if (ctx->ctx_fl_system) { - /* - * if included interrupts (true by default), then reset - * to get default value - */ - if (ctx->ctx_fl_exclintr == 0) { - /* - * reload kernel default DCR value - */ - ia64_set_dcr(pfs_info.pfs_dfl_dcr); - DBprintk((" restored dcr to 0x%lx\n", pfs_info.pfs_dfl_dcr)); + + pfm_sessions.pfs_sys_session[ctx->ctx_cpu] = NULL; + pfm_sessions.pfs_sys_sessions--; + DBprintk(("freeing syswide session on CPU%ld\n", ctx->ctx_cpu)); + + /* update perfmon debug register usage counter */ + if (ctx->ctx_fl_using_dbreg) { + if (pfm_sessions.pfs_sys_use_dbregs == 0) { + printk("perfmon: invalid release for [%d] sys_use_dbregs=0\n", task->pid); + } else + pfm_sessions.pfs_sys_use_dbregs--; } - /* - * free system wide session slot - */ - pfs_info.pfs_sys_session = 0; + + /* + * remove any CPU pinning + */ + task->cpus_allowed = ctx->ctx_saved_cpus_allowed; + task->need_resched = 1; } else { - pfs_info.pfs_proc_sessions--; + pfm_sessions.pfs_task_sessions--; } + UNLOCK_PFS(); pfm_context_free(ctx); /* * clean pfm state in thread structure, */ - task->thread.pfm_context = NULL; - task->thread.pfm_must_block = 0; + task->thread.pfm_context = NULL; + task->thread.pfm_ovfl_block_reset = 0; + /* pfm_notifiers is cleaned in pfm_cleanup_notifiers() */ +} + +/* + * function invoked from release_thread when pfm_smpl_buf_list is not NULL + */ +int +pfm_cleanup_smpl_buf(struct task_struct *task) +{ + pfm_smpl_buffer_desc_t *tmp, *psb = task->thread.pfm_smpl_buf_list; + + if (psb == NULL) { + printk("perfmon: psb is null in [%d]\n", current->pid); + return -1; + } + /* + * Walk through the list and free the sampling buffer and psb + */ + while (psb) { + DBprintk(("[%d] freeing smpl @%p size %ld\n", current->pid, psb->psb_hdr, psb->psb_size)); + + pfm_rvfree(psb->psb_hdr, psb->psb_size); + tmp = psb->psb_next; + kfree(psb); + psb = tmp; + } + + /* just in case */ + task->thread.pfm_smpl_buf_list = NULL; + + return 0; +} + +/* + * function invoked from release_thread to make sure that the ctx_owner field does not + * point to an unexisting task. + */ +void +pfm_cleanup_owners(struct task_struct *task) +{ + struct task_struct *p; + pfm_context_t *ctx; + + DBprintk(("called by [%d] for [%d]\n", current->pid, task->pid)); + + read_lock(&tasklist_lock); + + for_each_task(p) { + /* + * It is safe to do the 2-step test here, because thread.ctx + * is cleaned up only in release_thread() and at that point + * the task has been detached from the tasklist which is an + * operation which uses the write_lock() on the tasklist_lock + * so it cannot run concurrently to this loop. So we have the + * guarantee that if we find p and it has a perfmon ctx then + * it is going to stay like this for the entire execution of this + * loop. + */ + ctx = p->thread.pfm_context; + + //DBprintk(("[%d] scanning task [%d] ctx=%p\n", task->pid, p->pid, ctx)); + + if (ctx && ctx->ctx_owner == task) { + DBprintk(("trying for owner [%d] in [%d]\n", task->pid, p->pid)); + /* + * the spinlock is required to take care of a race condition + * with the send_sig_info() call. We must make sure that + * either the send_sig_info() completes using a valid task, + * or the notify_task is cleared before the send_sig_info() + * can pick up a stale value. Note that by the time this + * function is executed the 'task' is already detached from the + * tasklist. The problem is that the notifiers have a direct + * pointer to it. It is okay to send a signal to a task in this + * stage, it simply will have no effect. But it is better than sending + * to a completely destroyed task or worse to a new task using the same + * task_struct address. + */ + LOCK_CTX(ctx); + + ctx->ctx_owner = NULL; + + UNLOCK_CTX(ctx); + + DBprintk(("done for notifier [%d] in [%d]\n", task->pid, p->pid)); + } + } + read_unlock(&tasklist_lock); + atomic_set(&task->thread.pfm_owners_check, 0); } + +/* + * function called from release_thread to make sure that the ctx_notify_task is not pointing + * to an unexisting task + */ void pfm_cleanup_notifiers(struct task_struct *task) { struct task_struct *p; pfm_context_t *ctx; - DBprintk((" [%d] called\n", task->pid)); + DBprintk(("called by [%d] for [%d]\n", current->pid, task->pid)); read_lock(&tasklist_lock); @@ -2391,10 +4138,10 @@ */ ctx = p->thread.pfm_context; - DBprintk((" [%d] scanning task [%d] ctx=%p\n", task->pid, p->pid, ctx)); + //DBprintk(("[%d] scanning task [%d] ctx=%p\n", task->pid, p->pid, ctx)); if (ctx && ctx->ctx_notify_task == task) { - DBprintk((" trying for notifier %d in %d\n", task->pid, p->pid)); + DBprintk(("trying for notifier [%d] in [%d]\n", task->pid, p->pid)); /* * the spinlock is required to take care of a race condition * with the send_sig_info() call. We must make sure that @@ -2408,23 +4155,142 @@ * to a completely destroyed task or worse to a new task using the same * task_struct address. */ - spin_lock(&ctx->ctx_notify_lock); + LOCK_CTX(ctx); ctx->ctx_notify_task = NULL; - spin_unlock(&ctx->ctx_notify_lock); + UNLOCK_CTX(ctx); - DBprintk((" done for notifier %d in %d\n", task->pid, p->pid)); + DBprintk(("done for notifier [%d] in [%d]\n", task->pid, p->pid)); } } read_unlock(&tasklist_lock); + atomic_set(&task->thread.pfm_notifiers_check, 0); +} + +static struct irqaction perfmon_irqaction = { + handler: perfmon_interrupt, + flags: SA_INTERRUPT, + name: "perfmon" +}; + + +static void +pfm_pmu_snapshot(void) +{ + int i; + + for (i=0; i < IA64_NUM_PMC_REGS; i++) { + if (i >= pmu_conf.num_pmcs) break; + if (PMC_IS_IMPL(i)) reset_pmcs[i] = ia64_get_pmc(i); + } +#ifdef CONFIG_MCKINLEY + /* + * set the 'stupid' enable bit to power the PMU! + */ + reset_pmcs[4] |= 1UL << 23; +#endif +} + +/* + * perfmon initialization routine, called from the initcall() table + */ +int __init +perfmon_init (void) +{ + pal_perf_mon_info_u_t pm_info; + s64 status; + + pmu_conf.pfm_is_disabled = 1; + + printk("perfmon: version %u.%u (sampling format v%u.%u) IRQ %u\n", + PFM_VERSION_MAJ, + PFM_VERSION_MIN, + PFM_SMPL_VERSION_MAJ, + PFM_SMPL_VERSION_MIN, + IA64_PERFMON_VECTOR); + + if ((status=ia64_pal_perf_mon_info(pmu_conf.impl_regs, &pm_info)) != 0) { + printk("perfmon: PAL call failed (%ld), perfmon disabled\n", status); + return -1; + } + + pmu_conf.perf_ovfl_val = (1UL << pm_info.pal_perf_mon_info_s.width) - 1; + pmu_conf.max_counters = pm_info.pal_perf_mon_info_s.generic; + pmu_conf.num_pmcs = find_num_pm_regs(pmu_conf.impl_regs); + pmu_conf.num_pmds = find_num_pm_regs(&pmu_conf.impl_regs[4]); + + printk("perfmon: %u bits counters\n", pm_info.pal_perf_mon_info_s.width); + + printk("perfmon: %lu PMC/PMD pairs, %lu PMCs, %lu PMDs\n", + pmu_conf.max_counters, pmu_conf.num_pmcs, pmu_conf.num_pmds); + + /* sanity check */ + if (pmu_conf.num_pmds >= IA64_NUM_PMD_REGS || pmu_conf.num_pmcs >= IA64_NUM_PMC_REGS) { + printk(KERN_ERR "perfmon: not enough pmc/pmd, perfmon is DISABLED\n"); + return -1; /* no need to continue anyway */ + } + + if (ia64_pal_debug_info(&pmu_conf.num_ibrs, &pmu_conf.num_dbrs)) { + printk(KERN_WARNING "perfmon: unable to get number of debug registers\n"); + pmu_conf.num_ibrs = pmu_conf.num_dbrs = 0; + } + /* PAL reports the number of pairs */ + pmu_conf.num_ibrs <<=1; + pmu_conf.num_dbrs <<=1; + + /* + * take a snapshot of all PMU registers. PAL is supposed + * to configure them with stable/safe values, i.e., not + * capturing anything. + * We take a snapshot now, before we make any modifications. This + * will become our master copy. Then we will reuse the snapshot + * to reset the PMU in pfm_enable(). Using this technique, perfmon + * does NOT have to know about the specific values to program for + * the PMC/PMD. The safe values may be different from one CPU model to + * the other. + */ + pfm_pmu_snapshot(); + + /* + * setup the register configuration descriptions for the CPU + */ + pmu_conf.pmc_desc = pmc_desc; + pmu_conf.pmd_desc = pmd_desc; + + /* we are all set */ + pmu_conf.pfm_is_disabled = 0; + + /* + * for now here for debug purposes + */ + perfmon_dir = create_proc_read_entry ("perfmon", 0, 0, perfmon_read_entry, NULL); + + pfm_sysctl_header = register_sysctl_table(pfm_sysctl_root, 0); + + spin_lock_init(&pfm_sessions.pfs_lock); + + return 0; +} + +__initcall(perfmon_init); + +void +perfmon_init_percpu (void) +{ + if (smp_processor_id() == 0) + register_percpu_irq(IA64_PERFMON_VECTOR, &perfmon_irqaction); + + ia64_set_pmv(IA64_PERFMON_VECTOR); + ia64_srlz_d(); } #else /* !CONFIG_PERFMON */ asmlinkage int -sys_perfmonctl (int pid, int cmd, int flags, perfmon_req_t *req, int count, long arg6, long arg7, long arg8, long stack) +sys_perfmonctl (int pid, int cmd, void *req, int count, long arg5, long arg6, + long arg7, long arg8, long stack) { return -ENOSYS; } diff -urN linux-2.4.18/arch/ia64/kernel/perfmon_generic.h lia64-2.4/arch/ia64/kernel/perfmon_generic.h --- linux-2.4.18/arch/ia64/kernel/perfmon_generic.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/kernel/perfmon_generic.h Fri Jul 19 23:20:15 2002 @@ -0,0 +1,29 @@ +#define RDEP(x) (1UL<<(x)) + +#ifdef CONFIG_ITANIUM +#error "This file should not be used when CONFIG_ITANIUM is defined" +#endif + +static pfm_reg_desc_t pmc_desc[256]={ +/* pmc0 */ { PFM_REG_CONTROL, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc1 */ { PFM_REG_CONTROL, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc2 */ { PFM_REG_CONTROL, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc3 */ { PFM_REG_CONTROL, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc4 */ { PFM_REG_COUNTING, 0, NULL, NULL, {RDEP(4),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc5 */ { PFM_REG_COUNTING, 0, NULL, NULL, {RDEP(5),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc6 */ { PFM_REG_COUNTING, 0, NULL, NULL, {RDEP(6),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc7 */ { PFM_REG_COUNTING, 0, NULL, NULL, {RDEP(7),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, + { PFM_REG_NONE, 0, NULL, NULL, {0,}, {0,}}, /* end marker */ +}; + +static pfm_reg_desc_t pmd_desc[256]={ +/* pmd0 */ { PFM_REG_NOTIMPL, 0, NULL, NULL, {0,}, {0,}}, +/* pmd1 */ { PFM_REG_NOTIMPL, 0, NULL, NULL, {0,}, {0,}}, +/* pmd2 */ { PFM_REG_NOTIMPL, 0, NULL, NULL, {0,}, {0,}}, +/* pmd3 */ { PFM_REG_NOTIMPL, 0, NULL, NULL, {0,}, {0,}}, +/* pmd4 */ { PFM_REG_COUNTING, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(4),0UL, 0UL, 0UL}}, +/* pmd5 */ { PFM_REG_COUNTING, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(5),0UL, 0UL, 0UL}}, +/* pmd6 */ { PFM_REG_COUNTING, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(6),0UL, 0UL, 0UL}}, +/* pmd7 */ { PFM_REG_COUNTING, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(7),0UL, 0UL, 0UL}}, + { PFM_REG_NONE, 0, NULL, NULL, {0,}, {0,}}, /* end marker */ +}; diff -urN linux-2.4.18/arch/ia64/kernel/perfmon_itanium.h lia64-2.4/arch/ia64/kernel/perfmon_itanium.h --- linux-2.4.18/arch/ia64/kernel/perfmon_itanium.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/kernel/perfmon_itanium.h Fri Jul 19 23:20:15 2002 @@ -0,0 +1,99 @@ +/* + * This file contains the Itanium PMU register description tables + * and pmc checker used by perfmon.c. + * + * Copyright (C) 2002 Hewlett Packard Co + * Stephane Eranian + */ + +#define RDEP(x) (1UL<<(x)) + +#ifndef CONFIG_ITANIUM +#error "This file is only valid when CONFIG_ITANIUM is defined" +#endif + +static int pfm_ita_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs); +static int pfm_write_ibr_dbr(int mode, struct task_struct *task, void *arg, int count, struct pt_regs *regs); + +static pfm_reg_desc_t pmc_desc[256]={ +/* pmc0 */ { PFM_REG_CONTROL, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc1 */ { PFM_REG_CONTROL, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc2 */ { PFM_REG_CONTROL, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc3 */ { PFM_REG_CONTROL, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc4 */ { PFM_REG_COUNTING, 6, NULL, NULL, {RDEP(4),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc5 */ { PFM_REG_COUNTING, 6, NULL, NULL, {RDEP(5),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc6 */ { PFM_REG_COUNTING, 6, NULL, NULL, {RDEP(6),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc7 */ { PFM_REG_COUNTING, 6, NULL, NULL, {RDEP(7),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc8 */ { PFM_REG_CONFIG, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc9 */ { PFM_REG_CONFIG, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc10 */ { PFM_REG_MONITOR, 6, NULL, NULL, {RDEP(0)|RDEP(1),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc11 */ { PFM_REG_MONITOR, 6, NULL, pfm_ita_pmc_check, {RDEP(2)|RDEP(3)|RDEP(17),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc12 */ { PFM_REG_MONITOR, 6, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc13 */ { PFM_REG_CONFIG, 0, NULL, pfm_ita_pmc_check, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, + { PFM_REG_NONE, 0, NULL, NULL, {0,}, {0,}}, /* end marker */ +}; + +static pfm_reg_desc_t pmd_desc[256]={ +/* pmd0 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(1),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}}, +/* pmd1 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(0),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}}, +/* pmd2 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(3)|RDEP(17),0UL, 0UL, 0UL}, {RDEP(11),0UL, 0UL, 0UL}}, +/* pmd3 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(2)|RDEP(17),0UL, 0UL, 0UL}, {RDEP(11),0UL, 0UL, 0UL}}, +/* pmd4 */ { PFM_REG_COUNTING, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(4),0UL, 0UL, 0UL}}, +/* pmd5 */ { PFM_REG_COUNTING, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(5),0UL, 0UL, 0UL}}, +/* pmd6 */ { PFM_REG_COUNTING, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(6),0UL, 0UL, 0UL}}, +/* pmd7 */ { PFM_REG_COUNTING, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(7),0UL, 0UL, 0UL}}, +/* pmd8 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(9)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd9 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd10 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd11 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd12 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(11)|RDEP(13)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd13 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd14 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd15 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd16 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(15),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd17 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(2)|RDEP(3),0UL, 0UL, 0UL}, {RDEP(11),0UL, 0UL, 0UL}}, + { PFM_REG_NONE, 0, NULL, NULL, {0,}, {0,}}, /* end marker */ +}; + +static int +pfm_ita_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs) +{ + pfm_context_t *ctx = task->thread.pfm_context; + int ret; + + /* + * we must clear the (instruction) debug registers if pmc13.ta bit is cleared + * before they are written (fl_using_dbreg==0) to avoid picking up stale information. + */ + if (cnum == 13 && ((*val & 0x1) == 0UL) && ctx->ctx_fl_using_dbreg == 0) { + + /* don't mix debug with perfmon */ + if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0) return -EINVAL; + + /* + * a count of 0 will mark the debug registers as in use and also + * ensure that they are properly cleared. + */ + ret = pfm_write_ibr_dbr(1, task, NULL, 0, regs); + if (ret) return ret; + } + + /* + * we must clear the (data) debug registers if pmc11.pt bit is cleared + * before they are written (fl_using_dbreg==0) to avoid picking up stale information. + */ + if (cnum == 11 && ((*val >> 28)& 0x1) == 0 && ctx->ctx_fl_using_dbreg == 0) { + + /* don't mix debug with perfmon */ + if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0) return -EINVAL; + + /* + * a count of 0 will mark the debug registers as in use and also + * ensure that they are properly cleared. + */ + ret = pfm_write_ibr_dbr(0, task, NULL, 0, regs); + if (ret) return ret; + } + return 0; +} + diff -urN linux-2.4.18/arch/ia64/kernel/perfmon_mckinley.h lia64-2.4/arch/ia64/kernel/perfmon_mckinley.h --- linux-2.4.18/arch/ia64/kernel/perfmon_mckinley.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/kernel/perfmon_mckinley.h Fri Jul 19 23:20:15 2002 @@ -0,0 +1,134 @@ +/* + * This file contains the McKinley PMU register description tables + * and pmc checker used by perfmon.c. + * + * Copyright (C) 2002 Hewlett Packard Co + * Stephane Eranian + */ + +#define RDEP(x) (1UL<<(x)) + +#ifndef CONFIG_MCKINLEY +#error "This file is only valid when CONFIG_MCKINLEY is defined" +#endif + +static int pfm_mck_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs); +static int pfm_write_ibr_dbr(int mode, struct task_struct *task, void *arg, int count, struct pt_regs *regs); + +static pfm_reg_desc_t pmc_desc[256]={ +/* pmc0 */ { PFM_REG_CONTROL, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc1 */ { PFM_REG_CONTROL, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc2 */ { PFM_REG_CONTROL, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc3 */ { PFM_REG_CONTROL, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc4 */ { PFM_REG_COUNTING, 6, NULL, pfm_mck_pmc_check, {RDEP(4),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc5 */ { PFM_REG_COUNTING, 6, NULL, NULL, {RDEP(5),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc6 */ { PFM_REG_COUNTING, 6, NULL, NULL, {RDEP(6),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc7 */ { PFM_REG_COUNTING, 6, NULL, NULL, {RDEP(7),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc8 */ { PFM_REG_CONFIG, 0, NULL, pfm_mck_pmc_check, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc9 */ { PFM_REG_CONFIG, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc10 */ { PFM_REG_MONITOR, 4, NULL, NULL, {RDEP(0)|RDEP(1),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc11 */ { PFM_REG_MONITOR, 6, NULL, NULL, {RDEP(2)|RDEP(3)|RDEP(17),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc12 */ { PFM_REG_MONITOR, 6, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc13 */ { PFM_REG_CONFIG, 0, NULL, pfm_mck_pmc_check, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc14 */ { PFM_REG_CONFIG, 0, NULL, pfm_mck_pmc_check, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, +/* pmc15 */ { PFM_REG_CONFIG, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, + { PFM_REG_NONE, 0, NULL, NULL, {0,}, {0,}}, /* end marker */ +}; + +static pfm_reg_desc_t pmd_desc[256]={ +/* pmd0 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(1),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}}, +/* pmd1 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(0),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}}, +/* pmd2 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(3)|RDEP(17),0UL, 0UL, 0UL}, {RDEP(11),0UL, 0UL, 0UL}}, +/* pmd3 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(2)|RDEP(17),0UL, 0UL, 0UL}, {RDEP(11),0UL, 0UL, 0UL}}, +/* pmd4 */ { PFM_REG_COUNTING, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(4),0UL, 0UL, 0UL}}, +/* pmd5 */ { PFM_REG_COUNTING, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(5),0UL, 0UL, 0UL}}, +/* pmd6 */ { PFM_REG_COUNTING, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(6),0UL, 0UL, 0UL}}, +/* pmd7 */ { PFM_REG_COUNTING, 0, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(7),0UL, 0UL, 0UL}}, +/* pmd8 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(9)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd9 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd10 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd11 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd12 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(11)|RDEP(13)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd13 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(14)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd14 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(15)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd15 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(16),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd16 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(8)|RDEP(9)|RDEP(10)|RDEP(11)|RDEP(12)|RDEP(13)|RDEP(14)|RDEP(15),0UL, 0UL, 0UL}, {RDEP(12),0UL, 0UL, 0UL}}, +/* pmd17 */ { PFM_REG_BUFFER, 0, NULL, NULL, {RDEP(2)|RDEP(3),0UL, 0UL, 0UL}, {RDEP(11),0UL, 0UL, 0UL}}, + { PFM_REG_NONE, 0, NULL, NULL, {0,}, {0,}}, /* end marker */ +}; + +static int +pfm_mck_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs) +{ + struct thread_struct *th = &task->thread; + pfm_context_t *ctx = task->thread.pfm_context; + int ret = 0, check_case1 = 0; + unsigned long val8 = 0, val14 = 0, val13 = 0; + + /* + * we must clear the debug registers if any pmc13.ena_dbrpX bit is enabled + * before they are written (fl_using_dbreg==0) to avoid picking up stale information. + */ + if (cnum == 13 && (*val & (0xfUL << 45)) && ctx->ctx_fl_using_dbreg == 0) { + + /* don't mix debug with perfmon */ + if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0) return -EINVAL; + + /* + * a count of 0 will mark the debug registers as in use and also + * ensure that they are properly cleared. + */ + ret = pfm_write_ibr_dbr(1, task, NULL, 0, regs); + if (ret) return ret; + } + /* + * we must clear the (instruction) debug registers if any pmc14.ibrpX bit is enabled + * before they are (fl_using_dbreg==0) to avoid picking up stale information. + */ + if (cnum == 14 && ((*val & 0x2222) != 0x2222) && ctx->ctx_fl_using_dbreg == 0) { + + /* don't mix debug with perfmon */ + if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0) return -EINVAL; + + /* + * a count of 0 will mark the debug registers as in use and also + * ensure that they are properly cleared. + */ + ret = pfm_write_ibr_dbr(0, task, NULL, 0, regs); + if (ret) return ret; + + } + + switch(cnum) { + case 4: *val |= 1UL << 23; /* force power enable bit */ + break; + case 8: val8 = *val; + val13 = th->pmc[13]; + val14 = th->pmc[14]; + check_case1 = 1; + break; + case 13: val8 = th->pmc[8]; + val13 = *val; + val14 = th->pmc[14]; + check_case1 = 1; + break; + case 14: val8 = th->pmc[13]; + val13 = th->pmc[13]; + val14 = *val; + check_case1 = 1; + break; + } + /* check illegal configuration which can produce inconsistencies in tagging + * i-side events in L1D and L2 caches + */ + if (check_case1) { + ret = ((val13 >> 45) & 0xf) == 0 + && ((val8 & 0x1) == 0) + && ((((val14>>1) & 0x3) == 0x2 || ((val14>>1) & 0x3) == 0x0) + ||(((val14>>4) & 0x3) == 0x2 || ((val14>>4) & 0x3) == 0x0)); + + if (ret) printk("perfmon: failure check_case1\n"); + } + + return ret ? -EINVAL : 0; +} diff -urN linux-2.4.18/arch/ia64/kernel/process.c lia64-2.4/arch/ia64/kernel/process.c --- linux-2.4.18/arch/ia64/kernel/process.c Mon Nov 26 11:18:21 2001 +++ lia64-2.4/arch/ia64/kernel/process.c Thu Jun 20 18:55:23 2002 @@ -1,8 +1,8 @@ /* * Architecture-specific setup. * - * Copyright (C) 1998-2001 Hewlett-Packard Co - * Copyright (C) 1998-2001 David Mosberger-Tang + * Copyright (C) 1998-2002 Hewlett-Packard Co + * David Mosberger-Tang */ #define __KERNEL_SYSCALLS__ /* see */ #include @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -28,6 +29,10 @@ #include #include +#ifdef CONFIG_IA64_SGI_SN +#include +#endif + static void do_show_stack (struct unw_frame_info *info, void *arg) { @@ -46,6 +51,15 @@ } void +show_trace_task (struct task_struct *task) +{ + struct unw_frame_info info; + + unw_init_from_blocked_task(&info, task); + do_show_stack(&info, 0); +} + +void show_stack (struct task_struct *task) { if (!task) @@ -90,8 +104,8 @@ printk("r26 : %016lx r27 : %016lx r28 : %016lx\n", regs->r26, regs->r27, regs->r28); printk("r29 : %016lx r30 : %016lx r31 : %016lx\n", regs->r29, regs->r30, regs->r31); - /* print the stacked registers if cr.ifs is valid: */ - if (regs->cr_ifs & 0x8000000000000000) { + if (user_mode(regs)) { + /* print the stacked registers */ unsigned long val, sof, *bsp, ndirty; int i, is_nat = 0; @@ -122,8 +136,18 @@ if (!current->need_resched) min_xtp(); #endif - while (!current->need_resched) + + while (!current->need_resched) { +#ifdef CONFIG_IA64_SGI_SN + snidle(); +#endif continue; + } + +#ifdef CONFIG_IA64_SGI_SN + snidleoff(); +#endif + #ifdef CONFIG_SMP normal_xtp(); #endif @@ -139,12 +163,21 @@ { if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0) ia64_save_debug_regs(&task->thread.dbr[0]); + #ifdef CONFIG_PERFMON if ((task->thread.flags & IA64_THREAD_PM_VALID) != 0) pfm_save_regs(task); + +# ifdef CONFIG_SMP + if (local_cpu_data->pfm_syst_wide) + pfm_syst_wide_update_task(task, 0); +# endif #endif + +#ifdef CONFIG_IA32_SUPPORT if (IS_IA32_PROCESS(ia64_task_regs(task))) ia32_save_state(task); +#endif } void @@ -152,12 +185,21 @@ { if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0) ia64_load_debug_regs(&task->thread.dbr[0]); + #ifdef CONFIG_PERFMON if ((task->thread.flags & IA64_THREAD_PM_VALID) != 0) pfm_load_regs(task); + +# ifdef CONFIG_SMP + if (local_cpu_data->pfm_syst_wide) + pfm_syst_wide_update_task(task, 1); +# endif #endif + +#ifdef CONFIG_IA32_SUPPORT if (IS_IA32_PROCESS(ia64_task_regs(task))) ia32_load_state(task); +#endif } /* @@ -235,7 +277,7 @@ if (user_mode(child_ptregs)) { if (user_stack_base) { - child_ptregs->r12 = user_stack_base + user_stack_size; + child_ptregs->r12 = user_stack_base + user_stack_size - 16; child_ptregs->ar_bspstore = user_stack_base; child_ptregs->ar_rnat = 0; child_ptregs->loadrs = 0; @@ -259,21 +301,24 @@ /* copy parts of thread_struct: */ p->thread.ksp = (unsigned long) child_stack - 16; + + /* stop some PSR bits from being inherited: */ + child_ptregs->cr_ipsr = ((child_ptregs->cr_ipsr | IA64_PSR_BITS_TO_SET) + & ~IA64_PSR_BITS_TO_CLEAR); + /* - * NOTE: The calling convention considers all floating point - * registers in the high partition (fph) to be scratch. Since - * the only way to get to this point is through a system call, - * we know that the values in fph are all dead. Hence, there - * is no need to inherit the fph state from the parent to the - * child and all we have to do is to make sure that - * IA64_THREAD_FPH_VALID is cleared in the child. + * NOTE: The calling convention considers all floating point registers in the high + * partition (fph) to be scratch. Since the only way to get to this point is + * through a system call, we know that the values in fph are all dead. Hence, + * there is no need to inherit the fph state from the parent to the child and all + * we have to do is to make sure that IA64_THREAD_FPH_VALID is cleared in the + * child. * - * XXX We could push this optimization a bit further by - * clearing IA64_THREAD_FPH_VALID on ANY system call. - * However, it's not clear this is worth doing. Also, it - * would be a slight deviation from the normal Linux system - * call behavior where scratch registers are preserved across - * system calls (unless used by the system call itself). + * XXX We could push this optimization a bit further by clearing + * IA64_THREAD_FPH_VALID on ANY system call. However, it's not clear this is + * worth doing. Also, it would be a slight deviation from the normal Linux system + * call behavior where scratch registers are preserved across system calls (unless + * used by the system call itself). */ # define THREAD_FLAGS_TO_CLEAR (IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID \ | IA64_THREAD_PM_VALID) @@ -288,8 +333,17 @@ if (IS_IA32_PROCESS(ia64_task_regs(current))) ia32_save_state(p); #endif + #ifdef CONFIG_PERFMON - if (p->thread.pfm_context) + /* + * reset notifiers and owner check (may not have a perfmon context) + */ + atomic_set(&p->thread.pfm_notifiers_check, 0); + atomic_set(&p->thread.pfm_owners_check, 0); + /* clear list of sampling buffer to free for new task */ + p->thread.pfm_smpl_buf_list = NULL; + + if (current->thread.pfm_context) retval = pfm_inherit(p, child_ptregs); #endif return retval; @@ -414,6 +468,16 @@ return error; } +void +ia64_set_personality (struct elf64_hdr *elf_ex, int ibcs2_interpreter) +{ + set_personality(PER_LINUX); + if (elf_ex->e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) + current->thread.flags |= IA64_THREAD_XSTACK; + else + current->thread.flags &= ~IA64_THREAD_XSTACK; +} + pid_t kernel_thread (int (*fn)(void *), void *arg, unsigned long flags) { @@ -445,15 +509,15 @@ #ifdef CONFIG_PERFMON /* - * By the time we get here, the task is detached from the tasklist. This is important - * because it means that no other tasks can ever find it as a notifiied task, therfore - * there is no race condition between this code and let's say a pfm_context_create(). - * Conversely, the pfm_cleanup_notifiers() cannot try to access a task's pfm context if - * this other task is in the middle of its own pfm_context_exit() because it would alreayd - * be out of the task list. Note that this case is very unlikely between a direct child - * and its parents (if it is the notified process) because of the way the exit is notified - * via SIGCHLD. + * by the time we get here, the task is detached from the tasklist. This is important + * because it means that no other tasks can ever find it as a notified task, therfore there + * is no race condition between this code and let's say a pfm_context_create(). + * Conversely, the pfm_cleanup_notifiers() cannot try to access a task's pfm context if this + * other task is in the middle of its own pfm_context_exit() because it would already be out of + * the task list. Note that this case is very unlikely between a direct child and its parents + * (if it is the notified process) because of the way the exit is notified via SIGCHLD. */ + void release_thread (struct task_struct *task) { @@ -462,6 +526,12 @@ if (atomic_read(&task->thread.pfm_notifiers_check) > 0) pfm_cleanup_notifiers(task); + + if (atomic_read(&task->thread.pfm_owners_check) > 0) + pfm_cleanup_owners(task); + + if (task->thread.pfm_smpl_buf_list) + pfm_cleanup_smpl_buf(task); } #endif @@ -478,21 +548,12 @@ #endif #ifdef CONFIG_PERFMON /* stop monitoring */ - if ((current->thread.flags & IA64_THREAD_PM_VALID) != 0) { - /* - * we cannot rely on switch_to() to save the PMU - * context for the last time. There is a possible race - * condition in SMP mode between the child and the - * parent. by explicitly saving the PMU context here - * we garantee no race. this call we also stop - * monitoring - */ + if (current->thread.pfm_context) pfm_flush_regs(current); - /* - * make sure that switch_to() will not save context again - */ - current->thread.flags &= ~IA64_THREAD_PM_VALID; - } + + /* free debug register resources */ + if (current->thread.flags & IA64_THREAD_DBG_VALID) + pfm_release_debug_registers(current); #endif } diff -urN linux-2.4.18/arch/ia64/kernel/ptrace.c lia64-2.4/arch/ia64/kernel/ptrace.c --- linux-2.4.18/arch/ia64/kernel/ptrace.c Mon Nov 26 11:18:21 2001 +++ lia64-2.4/arch/ia64/kernel/ptrace.c Fri Feb 22 16:40:10 2002 @@ -1,7 +1,7 @@ /* * Kernel support for the ptrace() and syscall tracing interfaces. * - * Copyright (C) 1999-2001 Hewlett-Packard Co + * Copyright (C) 1999-2002 Hewlett-Packard Co * David Mosberger-Tang * * Derived from the x86 and Alpha versions. Most of the code in here @@ -23,6 +23,9 @@ #include #include #include +#ifdef CONFIG_PERFMON +# include +#endif /* * Bits in the PSR that we allow ptrace() to change: @@ -755,11 +758,6 @@ } else { /* access debug registers */ - if (!(child->thread.flags & IA64_THREAD_DBG_VALID)) { - child->thread.flags |= IA64_THREAD_DBG_VALID; - memset(child->thread.dbr, 0, sizeof(child->thread.dbr)); - memset(child->thread.ibr, 0, sizeof(child->thread.ibr)); - } if (addr >= PT_IBR) { regnum = (addr - PT_IBR) >> 3; ptr = &child->thread.ibr[0]; @@ -772,6 +770,30 @@ dprintk("ptrace: rejecting access to register address 0x%lx\n", addr); return -1; } +#ifdef CONFIG_PERFMON + /* + * Check if debug registers are used by perfmon. This test must be done + * once we know that we can do the operation, i.e. the arguments are all + * valid, but before we start modifying the state. + * + * Perfmon needs to keep a count of how many processes are trying to + * modify the debug registers for system wide monitoring sessions. + * + * We also include read access here, because they may cause the + * PMU-installed debug register state (dbr[], ibr[]) to be reset. The two + * arrays are also used by perfmon, but we do not use + * IA64_THREAD_DBG_VALID. The registers are restored by the PMU context + * switch code. + */ + if (pfm_use_debug_registers(child)) + return -1; +#endif + + if (!(child->thread.flags & IA64_THREAD_DBG_VALID)) { + child->thread.flags |= IA64_THREAD_DBG_VALID; + memset(child->thread.dbr, 0, sizeof(child->thread.dbr)); + memset(child->thread.ibr, 0, sizeof(child->thread.ibr)); + } ptr += regnum; @@ -789,6 +811,260 @@ return 0; } +static long +ptrace_getregs (struct task_struct *child, struct pt_all_user_regs *ppr) +{ + struct switch_stack *sw; + struct pt_regs *pt; + long ret, retval; + struct unw_frame_info info; + char nat = 0; + int i; + + retval = verify_area(VERIFY_WRITE, ppr, sizeof(struct pt_all_user_regs)); + if (retval != 0) { + return -EIO; + } + + pt = ia64_task_regs(child); + sw = (struct switch_stack *) (child->thread.ksp + 16); + unw_init_from_blocked_task(&info, child); + if (unw_unwind_to_user(&info) < 0) { + return -EIO; + } + + if (((unsigned long) ppr & 0x7) != 0) { + dprintk("ptrace:unaligned register address %p\n", ppr); + return -EIO; + } + + retval = 0; + + /* control regs */ + + retval |= __put_user(pt->cr_iip, &ppr->cr_iip); + retval |= access_uarea(child, PT_CR_IPSR, &ppr->cr_ipsr, 0); + + /* app regs */ + + retval |= __put_user(pt->ar_pfs, &ppr->ar[PT_AUR_PFS]); + retval |= __put_user(pt->ar_rsc, &ppr->ar[PT_AUR_RSC]); + retval |= __put_user(pt->ar_bspstore, &ppr->ar[PT_AUR_BSPSTORE]); + retval |= __put_user(pt->ar_unat, &ppr->ar[PT_AUR_UNAT]); + retval |= __put_user(pt->ar_ccv, &ppr->ar[PT_AUR_CCV]); + retval |= __put_user(pt->ar_fpsr, &ppr->ar[PT_AUR_FPSR]); + + retval |= access_uarea(child, PT_AR_EC, &ppr->ar[PT_AUR_EC], 0); + retval |= access_uarea(child, PT_AR_LC, &ppr->ar[PT_AUR_LC], 0); + retval |= access_uarea(child, PT_AR_RNAT, &ppr->ar[PT_AUR_RNAT], 0); + retval |= access_uarea(child, PT_AR_BSP, &ppr->ar[PT_AUR_BSP], 0); + retval |= access_uarea(child, PT_CFM, &ppr->cfm, 0); + + /* gr1-gr3 */ + + retval |= __copy_to_user(&ppr->gr[1], &pt->r1, sizeof(long) * 3); + + /* gr4-gr7 */ + + for (i = 4; i < 8; i++) { + retval |= unw_access_gr(&info, i, &ppr->gr[i], &nat, 0); + } + + /* gr8-gr11 */ + + retval |= __copy_to_user(&ppr->gr[8], &pt->r8, sizeof(long) * 4); + + /* gr12-gr15 */ + + retval |= __copy_to_user(&ppr->gr[12], &pt->r12, sizeof(long) * 4); + + /* gr16-gr31 */ + + retval |= __copy_to_user(&ppr->gr[16], &pt->r16, sizeof(long) * 16); + + /* b0 */ + + retval |= __put_user(pt->b0, &ppr->br[0]); + + /* b1-b5 */ + + for (i = 1; i < 6; i++) { + retval |= unw_access_br(&info, i, &ppr->br[i], 0); + } + + /* b6-b7 */ + + retval |= __put_user(pt->b6, &ppr->br[6]); + retval |= __put_user(pt->b7, &ppr->br[7]); + + /* fr2-fr5 */ + + for (i = 2; i < 6; i++) { + retval |= access_fr(&info, i, 0, (unsigned long *) &ppr->fr[i], 0); + retval |= access_fr(&info, i, 1, (unsigned long *) &ppr->fr[i] + 1, 0); + } + + /* fr6-fr9 */ + + retval |= __copy_to_user(&ppr->fr[6], &pt->f6, sizeof(struct ia64_fpreg) * 4); + + /* fp scratch regs(10-15) */ + + retval |= __copy_to_user(&ppr->fr[10], &sw->f10, sizeof(struct ia64_fpreg) * 6); + + /* fr16-fr31 */ + + for (i = 16; i < 32; i++) { + retval |= access_fr(&info, i, 0, (unsigned long *) &ppr->fr[i], 0); + retval |= access_fr(&info, i, 1, (unsigned long *) &ppr->fr[i] + 1, 0); + } + + /* fph */ + + ia64_flush_fph(child); + retval |= __copy_to_user(&ppr->fr[32], &child->thread.fph, sizeof(ppr->fr[32]) * 96); + + /* preds */ + + retval |= __put_user(pt->pr, &ppr->pr); + + /* nat bits */ + + retval |= access_uarea(child, PT_NAT_BITS, &ppr->nat, 0); + + ret = retval ? -EIO : 0; + return ret; +} + +static long +ptrace_setregs (struct task_struct *child, struct pt_all_user_regs *ppr) +{ + struct switch_stack *sw; + struct pt_regs *pt; + long ret, retval; + struct unw_frame_info info; + char nat = 0; + int i; + + retval = verify_area(VERIFY_READ, ppr, sizeof(struct pt_all_user_regs)); + if (retval != 0) { + return -EIO; + } + + pt = ia64_task_regs(child); + sw = (struct switch_stack *) (child->thread.ksp + 16); + unw_init_from_blocked_task(&info, child); + if (unw_unwind_to_user(&info) < 0) { + return -EIO; + } + + if (((unsigned long) ppr & 0x7) != 0) { + dprintk("ptrace:unaligned register address %p\n", ppr); + return -EIO; + } + + retval = 0; + + /* control regs */ + + retval |= __get_user(pt->cr_iip, &ppr->cr_iip); + retval |= access_uarea(child, PT_CR_IPSR, &ppr->cr_ipsr, 1); + + /* app regs */ + + retval |= __get_user(pt->ar_pfs, &ppr->ar[PT_AUR_PFS]); + retval |= __get_user(pt->ar_rsc, &ppr->ar[PT_AUR_RSC]); + retval |= __get_user(pt->ar_bspstore, &ppr->ar[PT_AUR_BSPSTORE]); + retval |= __get_user(pt->ar_unat, &ppr->ar[PT_AUR_UNAT]); + retval |= __get_user(pt->ar_ccv, &ppr->ar[PT_AUR_CCV]); + retval |= __get_user(pt->ar_fpsr, &ppr->ar[PT_AUR_FPSR]); + + retval |= access_uarea(child, PT_AR_EC, &ppr->ar[PT_AUR_EC], 1); + retval |= access_uarea(child, PT_AR_LC, &ppr->ar[PT_AUR_LC], 1); + retval |= access_uarea(child, PT_AR_RNAT, &ppr->ar[PT_AUR_RNAT], 1); + retval |= access_uarea(child, PT_AR_BSP, &ppr->ar[PT_AUR_BSP], 1); + retval |= access_uarea(child, PT_CFM, &ppr->cfm, 1); + + /* gr1-gr3 */ + + retval |= __copy_from_user(&pt->r1, &ppr->gr[1], sizeof(long) * 3); + + /* gr4-gr7 */ + + for (i = 4; i < 8; i++) { + long ret = unw_get_gr(&info, i, &ppr->gr[i], &nat); + if (ret < 0) { + return ret; + } + retval |= unw_access_gr(&info, i, &ppr->gr[i], &nat, 1); + } + + /* gr8-gr11 */ + + retval |= __copy_from_user(&pt->r8, &ppr->gr[8], sizeof(long) * 4); + + /* gr12-gr15 */ + + retval |= __copy_from_user(&pt->r12, &ppr->gr[12], sizeof(long) * 4); + + /* gr16-gr31 */ + + retval |= __copy_from_user(&pt->r16, &ppr->gr[16], sizeof(long) * 16); + + /* b0 */ + + retval |= __get_user(pt->b0, &ppr->br[0]); + + /* b1-b5 */ + + for (i = 1; i < 6; i++) { + retval |= unw_access_br(&info, i, &ppr->br[i], 1); + } + + /* b6-b7 */ + + retval |= __get_user(pt->b6, &ppr->br[6]); + retval |= __get_user(pt->b7, &ppr->br[7]); + + /* fr2-fr5 */ + + for (i = 2; i < 6; i++) { + retval |= access_fr(&info, i, 0, (unsigned long *) &ppr->fr[i], 1); + retval |= access_fr(&info, i, 1, (unsigned long *) &ppr->fr[i] + 1, 1); + } + + /* fr6-fr9 */ + + retval |= __copy_from_user(&pt->f6, &ppr->fr[6], sizeof(ppr->fr[6]) * 4); + + /* fp scratch regs(10-15) */ + + retval |= __copy_from_user(&sw->f10, &ppr->fr[10], sizeof(ppr->fr[10]) * 6); + + /* fr16-fr31 */ + + for (i = 16; i < 32; i++) { + retval |= access_fr(&info, i, 0, (unsigned long *) &ppr->fr[i], 1); + retval |= access_fr(&info, i, 1, (unsigned long *) &ppr->fr[i] + 1, 1); + } + + /* fph */ + + ia64_sync_fph(child); + retval |= __copy_from_user(&child->thread.fph, &ppr->fr[32], sizeof(ppr->fr[32]) * 96); + + /* preds */ + + retval |= __get_user(pt->pr, &ppr->pr); + + /* nat bits */ + + retval |= access_uarea(child, PT_NAT_BITS, &ppr->nat, 1); + + ret = retval ? -EIO : 0; + return ret; +} + /* * Called by kernel/ptrace.c when detaching.. * @@ -977,6 +1253,14 @@ case PTRACE_DETACH: /* detach a process that was attached. */ ret = ptrace_detach(child, data); + goto out_tsk; + + case PTRACE_GETREGS: + ret = ptrace_getregs(child, (struct pt_all_user_regs*) data); + goto out_tsk; + + case PTRACE_SETREGS: + ret = ptrace_setregs(child, (struct pt_all_user_regs*) data); goto out_tsk; default: diff -urN linux-2.4.18/arch/ia64/kernel/sal.c lia64-2.4/arch/ia64/kernel/sal.c --- linux-2.4.18/arch/ia64/kernel/sal.c Mon Nov 26 11:18:21 2001 +++ lia64-2.4/arch/ia64/kernel/sal.c Fri Dec 14 15:50:57 2001 @@ -18,7 +18,8 @@ #include #include -spinlock_t sal_lock = SPIN_LOCK_UNLOCKED; +spinlock_t sal_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED; +unsigned long sal_platform_features; static struct { void *addr; /* function entry point */ @@ -76,7 +77,7 @@ return str; } -static void __init +static void __init ia64_sal_handler_init (void *entry_point, void *gpval) { /* fill in the SAL procedure descriptor and point ia64_sal to it: */ @@ -102,7 +103,7 @@ if (strncmp(systab->signature, "SST_", 4) != 0) printk("bad signature in system table!"); - /* + /* * revisions are coded in BCD, so %x does the job for us */ printk("SAL v%x.%02x: oem=%.32s, product=%.32s\n", @@ -152,12 +153,12 @@ case SAL_DESC_PLATFORM_FEATURE: { struct ia64_sal_desc_platform_feature *pf = (void *) p; + sal_platform_features = pf->feature_mask; printk("SAL: Platform features "); - if (pf->feature_mask & (1 << 0)) + if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_BUS_LOCK) printk("BusLock "); - - if (pf->feature_mask & (1 << 1)) { + if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT) { printk("IRQ_Redirection "); #ifdef CONFIG_SMP if (no_int_routing) @@ -166,15 +167,17 @@ smp_int_redirect |= SMP_IRQ_REDIRECTION; #endif } - if (pf->feature_mask & (1 << 2)) { + if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT) { printk("IPI_Redirection "); #ifdef CONFIG_SMP - if (no_int_routing) + if (no_int_routing) smp_int_redirect &= ~SMP_IPI_REDIRECTION; else smp_int_redirect |= SMP_IPI_REDIRECTION; #endif } + if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT) + printk("ITC_Drift "); printk("\n"); break; } diff -urN linux-2.4.18/arch/ia64/kernel/salinfo.c lia64-2.4/arch/ia64/kernel/salinfo.c --- linux-2.4.18/arch/ia64/kernel/salinfo.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/kernel/salinfo.c Tue Feb 26 14:36:07 2002 @@ -0,0 +1,105 @@ +/* + * salinfo.c + * + * Creates entries in /proc/sal for various system features. + * + * Copyright (c) 2001 Silicon Graphics, Inc. All rights reserved. + * + * 10/30/2001 jbarnes@sgi.com copied much of Stephane's palinfo + * code to create this file + */ + +#include +#include +#include + +#include + +MODULE_AUTHOR("Jesse Barnes "); +MODULE_DESCRIPTION("/proc interface to IA-64 SAL features"); +MODULE_LICENSE("GPL"); + +static int salinfo_read(char *page, char **start, off_t off, int count, int *eof, void *data); + +typedef struct { + const char *name; /* name of the proc entry */ + unsigned long feature; /* feature bit */ + struct proc_dir_entry *entry; /* registered entry (removal) */ +} salinfo_entry_t; + +/* + * List {name,feature} pairs for every entry in /proc/sal/ + * that this module exports + */ +static salinfo_entry_t salinfo_entries[]={ + { "bus_lock", IA64_SAL_PLATFORM_FEATURE_BUS_LOCK, }, + { "irq_redirection", IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT, }, + { "ipi_redirection", IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT, }, + { "itc_drift", IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT, }, +}; + +#define NR_SALINFO_ENTRIES (sizeof(salinfo_entries)/sizeof(salinfo_entry_t)) + +/* + * One for each feature and one more for the directory entry... + */ +static struct proc_dir_entry *salinfo_proc_entries[NR_SALINFO_ENTRIES + 1]; + +static int __init +salinfo_init(void) +{ + struct proc_dir_entry *salinfo_dir; /* /proc/sal dir entry */ + struct proc_dir_entry **sdir = salinfo_proc_entries; /* keeps track of every entry */ + int i; + + salinfo_dir = proc_mkdir("sal", NULL); + + for (i=0; i < NR_SALINFO_ENTRIES; i++) { + /* pass the feature bit in question as misc data */ + *sdir++ = create_proc_read_entry (salinfo_entries[i].name, 0, salinfo_dir, + salinfo_read, (void *)salinfo_entries[i].feature); + } + *sdir++ = salinfo_dir; + + return 0; +} + +static void __exit +salinfo_exit(void) +{ + int i = 0; + + for (i = 0; i < NR_SALINFO_ENTRIES ; i++) { + if (salinfo_proc_entries[i]) + remove_proc_entry (salinfo_proc_entries[i]->name, NULL); + } +} + +/* + * 'data' contains an integer that corresponds to the feature we're + * testing + */ +static int +salinfo_read(char *page, char **start, off_t off, int count, int *eof, void *data) +{ + int len = 0; + + MOD_INC_USE_COUNT; + + len = sprintf(page, (sal_platform_features & (unsigned long)data) ? "1\n" : "0\n"); + + if (len <= off+count) *eof = 1; + + *start = page + off; + len -= off; + + if (len>count) len = count; + if (len<0) len = 0; + + MOD_DEC_USE_COUNT; + + return len; +} + +module_init(salinfo_init); +module_exit(salinfo_exit); diff -urN linux-2.4.18/arch/ia64/kernel/setup.c lia64-2.4/arch/ia64/kernel/setup.c --- linux-2.4.18/arch/ia64/kernel/setup.c Mon Nov 26 11:18:24 2001 +++ lia64-2.4/arch/ia64/kernel/setup.c Fri Jul 19 23:09:31 2002 @@ -3,7 +3,7 @@ * * Copyright (C) 1998-2001 Hewlett-Packard Co * David Mosberger-Tang - * Copyright (C) 1998, 1999, 2001 Stephane Eranian + * Stephane Eranian * Copyright (C) 2000, Rohit Seth * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -29,7 +30,6 @@ #include #include -#include #include #include #include @@ -65,6 +65,8 @@ unsigned long ia64_iobase; /* virtual address for I/O accesses */ +unsigned char aux_device_present = 0xaa; /* XXX remove this when legacy I/O is gone */ + #define COMMAND_LINE_SIZE 512 char saved_command_line[COMMAND_LINE_SIZE]; /* used in proc filesystem */ @@ -147,6 +149,10 @@ } +/* + * Find a place to put the bootmap and return its starting address in bootmap_start. + * This address must be page-aligned. + */ static int find_bootmap_location (unsigned long start, unsigned long end, void *arg) { @@ -165,7 +171,7 @@ for (i = 0; i < num_rsvd_regions; i++) { range_start = MAX(start, free_start); - range_end = MIN(end, rsvd_region[i].start); + range_end = MIN(end, rsvd_region[i].start & PAGE_MASK); if (range_end <= range_start) continue; /* skip over empty range */ @@ -177,7 +183,7 @@ /* nothing more available in this segment */ if (range_end == end) return 0; - free_start = rsvd_region[i].end; + free_start = PAGE_ALIGN(rsvd_region[i].end); } return 0; } @@ -279,6 +285,7 @@ setup_arch (char **cmdline_p) { extern unsigned long ia64_iobase; + unsigned long phys_iobase; unw_init(); @@ -306,25 +313,28 @@ /* process SAL system table: */ ia64_sal_init(efi.sal_systab); +#ifdef CONFIG_IA64_GENERIC + machvec_init(acpi_get_sysname()); +#endif + /* - * Set `iobase' to the appropriate address in region 6 - * (uncached access range) + * Set `iobase' to the appropriate address in region 6 (uncached access range). * - * The EFI memory map is the "prefered" location to get the I/O port - * space base, rather the relying on AR.KR0. This should become more - * clear in future SAL specs. We'll fall back to getting it out of - * AR.KR0 if no appropriate entry is found in the memory map. + * The EFI memory map is the "preferred" location to get the I/O port space base, + * rather the relying on AR.KR0. This should become more clear in future SAL + * specs. We'll fall back to getting it out of AR.KR0 if no appropriate entry is + * found in the memory map. */ - ia64_iobase = efi_get_iobase(); - if (ia64_iobase) + phys_iobase = efi_get_iobase(); + if (phys_iobase) /* set AR.KR0 since this is all we use it for anyway */ - ia64_set_kr(IA64_KR_IO_BASE, ia64_iobase); + ia64_set_kr(IA64_KR_IO_BASE, phys_iobase); else { - ia64_iobase = ia64_get_kr(IA64_KR_IO_BASE); + phys_iobase = ia64_get_kr(IA64_KR_IO_BASE); printk("No I/O port range found in EFI memory map, falling back to AR.KR0\n"); - printk("I/O port base = 0x%lx\n", ia64_iobase); + printk("I/O port base = 0x%lx\n", phys_iobase); } - ia64_iobase = __IA64_UNCACHED_OFFSET | (ia64_iobase & ~PAGE_OFFSET); + ia64_iobase = (unsigned long) ioremap(phys_iobase, 0); #ifdef CONFIG_SMP cpu_physical_id(0) = hard_smp_processor_id(); @@ -332,24 +342,31 @@ cpu_init(); /* initialize the bootstrap CPU */ -#ifdef CONFIG_IA64_GENERIC - machvec_init(acpi_get_sysname()); +#ifdef CONFIG_ACPI_BOOT + acpi_boot_init(*cmdline_p); #endif +#ifdef CONFIG_SERIAL_HCDP + if (efi.hcdp) { + void setup_serial_hcdp(void *); - if (efi.acpi20) { - /* Parse the ACPI 2.0 tables */ - acpi20_parse(efi.acpi20); - } else if (efi.acpi) { - /* Parse the ACPI tables */ - acpi_parse(efi.acpi); + /* Setup the serial ports described by HCDP */ + setup_serial_hcdp(efi.hcdp); } - +#endif #ifdef CONFIG_VT -# if defined(CONFIG_VGA_CONSOLE) - conswitchp = &vga_con; -# elif defined(CONFIG_DUMMY_CONSOLE) +# if defined(CONFIG_DUMMY_CONSOLE) conswitchp = &dummy_con; # endif +# if defined(CONFIG_VGA_CONSOLE) + /* + * Non-legacy systems may route legacy VGA MMIO range to system + * memory. vga_con probes the MMIO hole, so memory looks like + * a VGA device to it. The EFI memory map can tell us if it's + * memory so we can avoid this problem. + */ + if (efi_mem_type(0xA0000) != EFI_CONVENTIONAL_MEMORY) + conswitchp = &vga_con; +# endif #endif #ifdef CONFIG_IA64_MCA @@ -371,23 +388,20 @@ { #ifdef CONFIG_SMP # define lpj c->loops_per_jiffy +# define cpu c->processor #else # define lpj loops_per_jiffy +# define cpu 0 #endif char family[32], features[128], *cp; struct cpuinfo_ia64 *c = v; - unsigned long mask, cpu = c - cpu_data(0); - -#ifdef CONFIG_SMP - if (!(cpu_online_map & (1 << cpu))) - return 0; -#endif + unsigned long mask; mask = c->features; switch (c->family) { case 0x07: memcpy(family, "Itanium", 8); break; - case 0x1f: memcpy(family, "McKinley", 9); break; + case 0x1f: memcpy(family, "Itanium 2", 10); break; default: sprintf(family, "%u", c->family); break; } @@ -403,7 +417,7 @@ sprintf(cp, " 0x%lx", mask); seq_printf(m, - "processor : %lu\n" + "processor : %d\n" "vendor : %s\n" "arch : IA-64\n" "family : %s\n" @@ -427,6 +441,10 @@ static void * c_start (struct seq_file *m, loff_t *pos) { +#ifdef CONFIG_SMP + while (*pos < NR_CPUS && !(cpu_online_map & (1 << *pos))) + ++*pos; +#endif return *pos < NR_CPUS ? cpu_data(*pos) : NULL; } @@ -483,6 +501,9 @@ cpuid.bits[i] = ia64_get_cpuid(i); memcpy(c->vendor, cpuid.field.vendor, 16); +#ifdef CONFIG_SMP + c->processor = smp_processor_id(); +#endif c->ppn = cpuid.field.ppn; c->number = cpuid.field.number; c->revision = cpuid.field.revision; @@ -534,7 +555,7 @@ = alloc_bootmem_pages_node(NODE_DATA(numa_node_id()), sizeof(struct cpuinfo_ia64)); for (cpu = 1; cpu < NR_CPUS; ++cpu) - memcpy(my_cpu_data->cpu_data[cpu]->cpu_data_ptrs, + memcpy(my_cpu_data->cpu_data[cpu]->cpu_data, my_cpu_data->cpu_data, sizeof(my_cpu_data->cpu_data)); } else { order = get_order(sizeof(struct cpuinfo_ia64)); @@ -558,6 +579,24 @@ */ identify_cpu(my_cpu_data); +#ifdef CONFIG_MCKINLEY + { +#define FEATURE_SET 16 + struct ia64_pal_retval iprv; + + if (my_cpu_data->family == 0x1f) { + + PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, FEATURE_SET, 0); + + if ((iprv.status == 0) && (iprv.v0 & 0x80) && (iprv.v2 & 0x80)) { + + PAL_CALL_PHYS(iprv, PAL_PROC_SET_FEATURES, + (iprv.v1 | 0x80), FEATURE_SET, 0); + } + } + } +#endif + /* Clear the stack memory reserved for pt_regs: */ memset(ia64_task_regs(current), 0, sizeof(struct pt_regs)); @@ -569,7 +608,7 @@ * shouldn't be affected by this (moral: keep your ia32 locks aligned and you'll * be fine). */ - ia64_set_dcr( IA64_DCR_DM | IA64_DCR_DP | IA64_DCR_DK | IA64_DCR_DX | IA64_DCR_DR + ia64_set_dcr( IA64_DCR_DP | IA64_DCR_DK | IA64_DCR_DX | IA64_DCR_DR | IA64_DCR_DA | IA64_DCR_DD | IA64_DCR_LC); #ifndef CONFIG_SMP ia64_set_fpu_owner(0); @@ -616,4 +655,6 @@ num_phys_stacked = 96; } local_cpu_data->phys_stacked_size_p8 = num_phys_stacked*8 + 8; + + platform_cpu_init(); } diff -urN linux-2.4.18/arch/ia64/kernel/signal.c lia64-2.4/arch/ia64/kernel/signal.c --- linux-2.4.18/arch/ia64/kernel/signal.c Mon Nov 26 11:18:24 2001 +++ lia64-2.4/arch/ia64/kernel/signal.c Wed Jun 5 20:17:16 2002 @@ -1,7 +1,7 @@ /* * Architecture-specific signal handling support. * - * Copyright (C) 1999-2001 Hewlett-Packard Co + * Copyright (C) 1999-2002 Hewlett-Packard Co * David Mosberger-Tang * * Derived from i386 and Alpha versions. @@ -143,9 +143,11 @@ { if (!access_ok(VERIFY_WRITE, to, sizeof(siginfo_t))) return -EFAULT; - if (from->si_code < 0) - return __copy_to_user(to, from, sizeof(siginfo_t)); - else { + if (from->si_code < 0) { + if (__copy_to_user(to, from, sizeof(siginfo_t))) + return -EFAULT; + return 0; + } else { int err; /* @@ -160,6 +162,7 @@ err |= __put_user((short)from->si_code, &to->si_code); switch (from->si_code >> 16) { case __SI_FAULT >> 16: + err |= __put_user(from->si_flags, &to->si_flags); err |= __put_user(from->si_isr, &to->si_isr); case __SI_POLL >> 16: err |= __put_user(from->si_addr, &to->si_addr); @@ -172,7 +175,12 @@ case __SI_PROF >> 16: err |= __put_user(from->si_uid, &to->si_uid); err |= __put_user(from->si_pid, &to->si_pid); - err |= __put_user(from->si_pfm_ovfl, &to->si_pfm_ovfl); + if (from->si_code == PROF_OVFL) { + err |= __put_user(from->si_pfm_ovfl[0], &to->si_pfm_ovfl[0]); + err |= __put_user(from->si_pfm_ovfl[1], &to->si_pfm_ovfl[1]); + err |= __put_user(from->si_pfm_ovfl[2], &to->si_pfm_ovfl[2]); + err |= __put_user(from->si_pfm_ovfl[3], &to->si_pfm_ovfl[3]); + } break; default: err |= __put_user(from->si_uid, &to->si_uid); @@ -553,7 +561,7 @@ continue; switch (signr) { - case SIGCONT: case SIGCHLD: case SIGWINCH: + case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG: continue; case SIGTSTP: case SIGTTIN: case SIGTTOU: diff -urN linux-2.4.18/arch/ia64/kernel/smp.c lia64-2.4/arch/ia64/kernel/smp.c --- linux-2.4.18/arch/ia64/kernel/smp.c Wed Dec 26 16:58:36 2001 +++ lia64-2.4/arch/ia64/kernel/smp.c Thu Jun 20 18:57:06 2002 @@ -90,7 +90,7 @@ handle_IPI (int irq, void *dev_id, struct pt_regs *regs) { int this_cpu = smp_processor_id(); - unsigned long *pending_ipis = &local_cpu_data->ipi_operation; + unsigned long *pending_ipis = &local_cpu_data->ipi.operation; unsigned long ops; /* Count this now; we may make a call that never returns. */ @@ -149,7 +149,7 @@ static inline void send_IPI_single (int dest_cpu, int op) { - set_bit(op, &cpu_data(dest_cpu)->ipi_operation); + set_bit(op, &cpu_data(dest_cpu)->ipi.operation); platform_send_ipi(dest_cpu, IA64_IPI_VECTOR, IA64_IPI_DM_INT, 0); } @@ -212,7 +212,7 @@ int cpus = 1; if (cpuid == smp_processor_id()) { - printk(__FUNCTION__" trying to call self\n"); + printk("%s: trying to call self\n", __FUNCTION__); return -EBUSY; } diff -urN linux-2.4.18/arch/ia64/kernel/smpboot.c lia64-2.4/arch/ia64/kernel/smpboot.c --- linux-2.4.18/arch/ia64/kernel/smpboot.c Mon Nov 26 11:18:24 2001 +++ lia64-2.4/arch/ia64/kernel/smpboot.c Tue May 28 17:53:59 2002 @@ -68,6 +68,7 @@ extern void __init calibrate_delay(void); extern void start_ap(void); +extern unsigned long ia64_iobase; int cpucount; @@ -344,6 +345,11 @@ */ ia64_init_itm(); + /* + * Set I/O port base per CPU + */ + ia64_set_kr(IA64_KR_IO_BASE, __pa(ia64_iobase)); + #ifdef CONFIG_IA64_MCA ia64_mca_cmc_vector_setup(); /* Setup vector on AP & enable */ ia64_mca_check_errors(); /* For post-failure MCA error logging */ @@ -416,9 +422,9 @@ if (!idle) panic("No idle process for CPU %d", cpu); - idle->processor = cpu; + task_set_cpu(idle, cpu); /* we schedule the first task manually */ + ia64_cpu_to_sapicid[cpu] = sapicid; - idle->cpus_runnable = 1 << cpu; /* we schedule the first task manually */ del_from_runqueue(idle); unhash_process(idle); @@ -528,7 +534,7 @@ printk("Before bogomips.\n"); if (!cpucount) { - printk(KERN_ERR "Error: only one processor found.\n"); + printk(KERN_WARNING "Warning: only one processor found.\n"); } else { unsigned long bogosum = 0; for (cpu = 0; cpu < NR_CPUS; cpu++) diff -urN linux-2.4.18/arch/ia64/kernel/sys_ia64.c lia64-2.4/arch/ia64/kernel/sys_ia64.c --- linux-2.4.18/arch/ia64/kernel/sys_ia64.c Mon Nov 26 11:18:24 2001 +++ lia64-2.4/arch/ia64/kernel/sys_ia64.c Fri Mar 1 15:18:04 2002 @@ -2,8 +2,8 @@ * This file contains various system calls that have different calling * conventions on different platforms. * - * Copyright (C) 1999-2000 Hewlett-Packard Co - * Copyright (C) 1999-2000 David Mosberger-Tang + * Copyright (C) 1999-2000, 2002 Hewlett-Packard Co + * David Mosberger-Tang */ #include #include @@ -201,15 +201,13 @@ if (len == 0) goto out; - /* don't permit mappings into unmapped space or the virtual page table of a region: */ + /* + * Don't permit mappings into unmapped space, the virtual page table of a region, + * or across a region boundary. Note: RGN_MAP_LIMIT is equal to 2^n-PAGE_SIZE + * (for some integer n <= 61) and len > 0. + */ roff = rgn_offset(addr); - if ((len | roff | (roff + len)) >= RGN_MAP_LIMIT) { - addr = -EINVAL; - goto out; - } - - /* don't permit mappings that would cross a region boundary: */ - if (rgn_index(addr) != rgn_index(addr + len)) { + if ((len > RGN_MAP_LIMIT) || (roff > (RGN_MAP_LIMIT - len))) { addr = -EINVAL; goto out; } diff -urN linux-2.4.18/arch/ia64/kernel/traps.c lia64-2.4/arch/ia64/kernel/traps.c --- linux-2.4.18/arch/ia64/kernel/traps.c Mon Nov 26 11:18:24 2001 +++ lia64-2.4/arch/ia64/kernel/traps.c Fri Jun 28 12:15:58 2002 @@ -1,7 +1,7 @@ /* * Architecture-specific trap handling. * - * Copyright (C) 1998-2001 Hewlett-Packard Co + * Copyright (C) 1998-2002 Hewlett-Packard Co * David Mosberger-Tang * * 05/12/00 grao : added isr in siginfo for SIGFPE @@ -133,6 +133,8 @@ /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */ siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri); siginfo.si_imm = break_num; + siginfo.si_flags = 0; /* clear __ISR_VALID */ + siginfo.si_isr = 0; switch (break_num) { case 0: /* unknown error */ @@ -183,6 +185,10 @@ sig = SIGSEGV; code = __SEGV_PSTKOVF; break; + case 0x3f000 ... 0x3ffff: /* bundle-update in progress */ + sig = SIGILL; code = __ILL_BNDMOD; + break; + default: if (break_num < 0x40000 || break_num > 0x100000) die_if_kernel("Bad break", regs, break_num); @@ -211,7 +217,8 @@ { struct pt_regs *regs = (struct pt_regs *) &stack; - printk("\n", regs->r15, arg0, arg1, arg2, arg3); + printk("%s(%d): \n", current->comm, current->pid, + regs->r15, arg0, arg1, arg2, arg3); return -ENOSYS; } @@ -352,6 +359,8 @@ siginfo.si_code = FPE_FLTDIV; } siginfo.si_isr = isr; + siginfo.si_flags = __ISR_VALID; + siginfo.si_imm = 0; force_sig_info(SIGFPE, &siginfo, current); } } else { @@ -372,6 +381,8 @@ siginfo.si_code = FPE_FLTRES; } siginfo.si_isr = isr; + siginfo.si_flags = __ISR_VALID; + siginfo.si_imm = 0; force_sig_info(SIGFPE, &siginfo, current); } } @@ -423,7 +434,7 @@ unsigned long code, error = isr; struct siginfo siginfo; char buf[128]; - int result; + int result, sig; static const char *reason[] = { "IA-64 Illegal Operation fault", "IA-64 Privileged Operation fault", @@ -435,30 +446,14 @@ "Unknown fault 13", "Unknown fault 14", "Unknown fault 15" }; -#if 0 - /* this is for minimal trust debugging; yeah this kind of stuff is useful at times... */ - - if (vector != 25) { - static unsigned long last_time; - static char count; - unsigned long n = vector; - char buf[32], *cp; - - if (jiffies - last_time > 5*HZ) - count = 0; - - if (count++ < 5) { - last_time = jiffies; - cp = buf + sizeof(buf); - *--cp = '\0'; - while (n) { - *--cp = "0123456789abcdef"[n & 0xf]; - n >>= 4; - } - printk("<0x%s>", cp); - } + if ((isr & IA64_ISR_NA) && ((isr & IA64_ISR_CODE_MASK) == IA64_ISR_CODE_LFETCH)) { + /* + * This fault was due to lfetch.fault, set "ed" bit in the psr to cancel + * the lfetch. + */ + ia64_psr(regs)->ed = 1; + return; } -#endif switch (vector) { case 24: /* General Exception */ @@ -483,6 +478,30 @@ break; case 26: /* NaT Consumption */ + if (user_mode(regs)) { + if (((isr >> 4) & 0xf) == 2) { + /* NaT page consumption */ + sig = SIGSEGV; + code = SEGV_ACCERR; + } else { + /* register NaT consumption */ + sig = SIGILL; + code = ILL_ILLOPN; + } + siginfo.si_signo = sig; + siginfo.si_code = code; + siginfo.si_errno = 0; + siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri); + siginfo.si_imm = vector; + siginfo.si_flags = __ISR_VALID; + siginfo.si_isr = isr; + force_sig_info(sig, &siginfo, current); + return; + } else if (done_with_exception(regs)) + return; + sprintf(buf, "NaT consumption"); + break; + case 31: /* Unsupported Data Reference */ if (user_mode(regs)) { siginfo.si_signo = SIGILL; @@ -490,10 +509,12 @@ siginfo.si_errno = 0; siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri); siginfo.si_imm = vector; + siginfo.si_flags = __ISR_VALID; + siginfo.si_isr = isr; force_sig_info(SIGILL, &siginfo, current); return; } - sprintf(buf, (vector == 26) ? "NaT consumption" : "Unsupported data reference"); + sprintf(buf, "Unsupported data reference"); break; case 29: /* Debug */ @@ -510,13 +531,16 @@ if (ia64_psr(regs)->is == 0) ifa = regs->cr_iip; #endif - siginfo.si_addr = (void *) ifa; break; - case 35: siginfo.si_code = TRAP_BRANCH; break; - case 36: siginfo.si_code = TRAP_TRACE; break; + case 35: siginfo.si_code = TRAP_BRANCH; ifa = 0; break; + case 36: siginfo.si_code = TRAP_TRACE; ifa = 0; break; } siginfo.si_signo = SIGTRAP; siginfo.si_errno = 0; + siginfo.si_flags = 0; + siginfo.si_isr = 0; + siginfo.si_addr = (void *) ifa; + siginfo.si_imm = 0; force_sig_info(SIGTRAP, &siginfo, current); return; @@ -528,6 +552,9 @@ siginfo.si_errno = 0; siginfo.si_code = FPE_FLTINV; siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri); + siginfo.si_flags = __ISR_VALID; + siginfo.si_isr = isr; + siginfo.si_imm = 0; force_sig_info(SIGFPE, &siginfo, current); } return; @@ -537,6 +564,9 @@ siginfo.si_signo = SIGILL; siginfo.si_code = ILL_BADIADDR; siginfo.si_errno = 0; + siginfo.si_flags = 0; + siginfo.si_isr = 0; + siginfo.si_imm = 0; siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri); force_sig_info(SIGILL, &siginfo, current); return; diff -urN linux-2.4.18/arch/ia64/kernel/unaligned.c lia64-2.4/arch/ia64/kernel/unaligned.c --- linux-2.4.18/arch/ia64/kernel/unaligned.c Mon Nov 26 11:18:24 2001 +++ lia64-2.4/arch/ia64/kernel/unaligned.c Wed Mar 13 22:47:14 2002 @@ -1,9 +1,9 @@ /* * Architecture-specific unaligned trap handling. * - * Copyright (C) 1999-2001 Hewlett-Packard Co - * Copyright (C) 1999-2000 Stephane Eranian - * Copyright (C) 2001 David Mosberger-Tang + * Copyright (C) 1999-2002 Hewlett-Packard Co + * Stephane Eranian + * David Mosberger-Tang * * 2001/10/11 Fix unaligned access to rotating registers in s/w pipelined loops. * 2001/08/13 Correct size of extended floats (float_fsz) from 16 to 10 bytes. @@ -23,7 +23,7 @@ #undef DEBUG_UNALIGNED_TRAP #ifdef DEBUG_UNALIGNED_TRAP -# define DPRINT(a...) do { printk("%s.%u: ", __FUNCTION__, __LINE__); printk (a); } while (0) +# define DPRINT(a...) do { printk("%s %u: ", __FUNCTION__, __LINE__); printk (a); } while (0) # define DDUMP(str,vp,len) dump(str, vp, len) static void @@ -650,7 +650,7 @@ * just in case. */ if (ld.x6_op == 1 || ld.x6_op == 3) { - printk(KERN_ERR __FUNCTION__": register update on speculative load, error\n"); + printk("%s %s: register update on speculative load, error\n", KERN_ERR, __FUNCTION__); die_if_kernel("unaligned reference on specualtive load with register update\n", regs, 30); } @@ -1080,8 +1080,8 @@ * For this reason we keep this sanity check */ if (ld.x6_op == 1 || ld.x6_op == 3) - printk(KERN_ERR __FUNCTION__": register update on speculative load pair, " - "error\n"); + printk("%s %s: register update on speculative load pair, " + "error\n",KERN_ERR, __FUNCTION__); setreg(ld.r3, ifa, 0, regs); } @@ -1304,11 +1304,7 @@ * handler into reading an arbitrary kernel addresses... */ if (!user_mode(regs)) { -#ifdef GAS_HAS_LOCAL_TAGS - fix = search_exception_table(regs->cr_iip + ia64_psr(regs)->ri); -#else - fix = search_exception_table(regs->cr_iip); -#endif + fix = SEARCH_EXCEPTION_TABLE(regs); } if (user_mode(regs) || fix.cont) { if ((current->thread.flags & IA64_THREAD_UAC_SIGBUS) != 0) @@ -1488,6 +1484,9 @@ si.si_errno = 0; si.si_code = BUS_ADRALN; si.si_addr = (void *) ifa; + si.si_flags = 0; + si.si_isr = 0; + si.si_imm = 0; force_sig_info(SIGBUS, &si, current); goto done; } diff -urN linux-2.4.18/arch/ia64/kernel/unwind.c lia64-2.4/arch/ia64/kernel/unwind.c --- linux-2.4.18/arch/ia64/kernel/unwind.c Mon Nov 26 11:18:24 2001 +++ lia64-2.4/arch/ia64/kernel/unwind.c Thu Jul 18 14:06:38 2002 @@ -1,6 +1,6 @@ /* - * Copyright (C) 1999-2001 Hewlett-Packard Co - * Copyright (C) 1999-2001 David Mosberger-Tang + * Copyright (C) 1999-2002 Hewlett-Packard Co + * David Mosberger-Tang */ /* * This file implements call frame unwind support for the Linux @@ -72,6 +72,8 @@ #define alloc_reg_state() kmalloc(sizeof(struct unw_state_record), GFP_ATOMIC) #define free_reg_state(usr) kfree(usr) +#define alloc_labeled_state() kmalloc(sizeof(struct unw_labeled_state), GFP_ATOMIC) +#define free_labeled_state(usr) kfree(usr) typedef unsigned long unw_word; typedef unsigned char unw_hash_index_t; @@ -521,7 +523,7 @@ } -/* Unwind decoder routines */ +/* Routines to manipulate the state stack. */ static inline void push (struct unw_state_record *sr) @@ -534,24 +536,60 @@ return; } memcpy(rs, &sr->curr, sizeof(*rs)); - rs->next = sr->stack; - sr->stack = rs; + sr->curr.next = rs; } static void pop (struct unw_state_record *sr) { - struct unw_reg_state *rs; + struct unw_reg_state *rs = sr->curr.next; - if (!sr->stack) { - printk ("unwind: stack underflow!\n"); + if (!rs) { + printk("unwind: stack underflow!\n"); return; } - rs = sr->stack; - sr->stack = rs->next; + memcpy(&sr->curr, rs, sizeof(*rs)); free_reg_state(rs); } +/* Make a copy of the state stack. Non-recursive to avoid stack overflows. */ +static struct unw_reg_state * +dup_state_stack (struct unw_reg_state *rs) +{ + struct unw_reg_state *copy, *prev = NULL, *first = NULL; + + while (rs) { + copy = alloc_reg_state(); + if (!copy) { + printk ("unwind.dup_state_stack: out of memory\n"); + return NULL; + } + memcpy(copy, rs, sizeof(*copy)); + if (first) + prev->next = copy; + else + first = copy; + rs = rs->next; + prev = copy; + } + return first; +} + +/* Free all stacked register states (but not RS itself). */ +static void +free_state_stack (struct unw_reg_state *rs) +{ + struct unw_reg_state *p, *next; + + for (p = rs->next; p != NULL; p = next) { + next = p->next; + free_reg_state(p); + } + rs->next = NULL; +} + +/* Unwind decoder routines */ + static enum unw_register_index __attribute__((const)) decode_abreg (unsigned char abreg, int memory) { @@ -596,8 +634,8 @@ for (reg = hi; reg >= lo; --reg) { if (reg->where == UNW_WHERE_SPILL_HOME) { reg->where = UNW_WHERE_PSPREL; - reg->val = 0x10 - *offp; - *offp += regsize; + *offp -= regsize; + reg->val = *offp; } } } @@ -689,7 +727,7 @@ sr->first_region = 0; /* check if we're done: */ - if (body && sr->when_target < sr->region_start + sr->region_len) { + if (sr->when_target < sr->region_start + sr->region_len) { sr->done = 1; return; } @@ -776,7 +814,8 @@ } for (i = 0; i < 20; ++i) { if ((frmask & 1) != 0) { - set_reg(sr->curr.reg + UNW_REG_F2 + i, UNW_WHERE_SPILL_HOME, + int base = (i < 4) ? UNW_REG_F2 : UNW_REG_F16 - 4; + set_reg(sr->curr.reg + base + i, UNW_WHERE_SPILL_HOME, sr->region_start + sr->region_len - 1, 0); sr->any_spills = 1; } @@ -902,31 +941,36 @@ static inline void desc_copy_state (unw_word label, struct unw_state_record *sr) { - struct unw_reg_state *rs; + struct unw_labeled_state *ls; - for (rs = sr->reg_state_list; rs; rs = rs->next) { - if (rs->label == label) { - memcpy (&sr->curr, rs, sizeof(sr->curr)); + for (ls = sr->labeled_states; ls; ls = ls->next) { + if (ls->label == label) { + free_state_stack(&sr->curr); + memcpy(&sr->curr, &ls->saved_state, sizeof(sr->curr)); + sr->curr.next = dup_state_stack(ls->saved_state.next); return; } } - printk("unwind: failed to find state labelled 0x%lx\n", label); + printk("unwind: failed to find state labeled 0x%lx\n", label); } static inline void desc_label_state (unw_word label, struct unw_state_record *sr) { - struct unw_reg_state *rs; + struct unw_labeled_state *ls; - rs = alloc_reg_state(); - if (!rs) { - printk("unwind: cannot stack!\n"); + ls = alloc_labeled_state(); + if (!ls) { + printk("unwind.desc_label_state(): out of memory\n"); return; } - memcpy(rs, &sr->curr, sizeof(*rs)); - rs->label = label; - rs->next = sr->reg_state_list; - sr->reg_state_list = rs; + ls->label = label; + memcpy(&ls->saved_state, &sr->curr, sizeof(ls->saved_state)); + ls->saved_state.next = dup_state_stack(sr->curr.next); + + /* insert into list of labeled states: */ + ls->next = sr->labeled_states; + sr->labeled_states = ls; } /* @@ -1378,6 +1422,8 @@ else break; } + if (rel_ip < e->start_offset || rel_ip >= e->end_offset) + return NULL; return e; } @@ -1388,9 +1434,9 @@ static inline struct unw_script * build_script (struct unw_frame_info *info) { - struct unw_reg_state *rs, *next; const struct unw_table_entry *e = 0; struct unw_script *script = 0; + struct unw_labeled_state *ls, *next; unsigned long ip = info->ip; struct unw_state_record sr; struct unw_table *table; @@ -1535,15 +1581,15 @@ for (i = UNW_REG_BSP; i < UNW_NUM_REGS; ++i) compile_reg(&sr, i, script); - /* free labelled register states & stack: */ + /* free labeled register states & stack: */ STAT(parse_start = ia64_get_itc()); - for (rs = sr.reg_state_list; rs; rs = next) { - next = rs->next; - free_reg_state(rs); + for (ls = sr.labeled_states; ls; ls = next) { + next = ls->next; + free_state_stack(&ls->saved_state); + free_labeled_state(ls); } - while (sr.stack) - pop(&sr); + free_state_stack(&sr.curr); STAT(unw.stat.script.parse_time += ia64_get_itc() - parse_start); script_finalize(script, &sr); diff -urN linux-2.4.18/arch/ia64/kernel/unwind_i.h lia64-2.4/arch/ia64/kernel/unwind_i.h --- linux-2.4.18/arch/ia64/kernel/unwind_i.h Tue Jul 31 10:30:08 2001 +++ lia64-2.4/arch/ia64/kernel/unwind_i.h Mon Apr 1 17:34:40 2002 @@ -1,6 +1,6 @@ /* - * Copyright (C) 2000 Hewlett-Packard Co - * Copyright (C) 2000 David Mosberger-Tang + * Copyright (C) 2000, 2002 Hewlett-Packard Co + * David Mosberger-Tang * * Kernel unwind support. */ @@ -85,6 +85,17 @@ int when; /* when the register gets saved */ }; +struct unw_reg_state { + struct unw_reg_state *next; /* next (outer) element on state stack */ + struct unw_reg_info reg[UNW_NUM_REGS]; /* register save locations */ +}; + +struct unw_labeled_state { + struct unw_labeled_state *next; /* next labeled state (or NULL) */ + unsigned long label; /* label for this state */ + struct unw_reg_state saved_state; +}; + struct unw_state_record { unsigned int first_region : 1; /* is this the first region? */ unsigned int done : 1; /* are we done scanning descriptors? */ @@ -92,7 +103,7 @@ unsigned int in_body : 1; /* are we inside a body (as opposed to a prologue)? */ unsigned long flags; /* see UNW_FLAG_* in unwind.h */ - u8 *imask; /* imask of of spill_mask record or NULL */ + u8 *imask; /* imask of spill_mask record or NULL */ unsigned long pr_val; /* predicate values */ unsigned long pr_mask; /* predicate mask */ long spill_offset; /* psp-relative offset for spill base */ @@ -105,11 +116,8 @@ u8 gr_save_loc; /* next general register to use for saving a register */ u8 return_link_reg; /* branch register in which the return link is passed */ - struct unw_reg_state { - struct unw_reg_state *next; - unsigned long label; /* label of this state record */ - struct unw_reg_info reg[UNW_NUM_REGS]; - } curr, *stack, *reg_state_list; + struct unw_labeled_state *labeled_states; /* list of all labeled states */ + struct unw_reg_state curr; /* current state */ }; enum unw_nat_type { diff -urN linux-2.4.18/arch/ia64/lib/Makefile lia64-2.4/arch/ia64/lib/Makefile --- linux-2.4.18/arch/ia64/lib/Makefile Tue Jul 31 10:30:08 2001 +++ lia64-2.4/arch/ia64/lib/Makefile Fri Jul 19 18:10:29 2002 @@ -11,10 +11,13 @@ obj-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \ __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o \ - checksum.o clear_page.o csum_partial_copy.o copy_page.o \ - copy_user.o clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \ - flush.o io.o do_csum.o \ - memcpy.o memset.o strlen.o swiotlb.o + checksum.o clear_page.o csum_partial_copy.o \ + clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \ + flush.o ip_fast_csum.o io.o do_csum.o \ + memset.o strlen.o swiotlb.o + +obj-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o +obj-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o IGNORE_FLAGS_OBJS = __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \ __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o diff -urN linux-2.4.18/arch/ia64/lib/checksum.c lia64-2.4/arch/ia64/lib/checksum.c --- linux-2.4.18/arch/ia64/lib/checksum.c Tue Jul 31 10:30:08 2001 +++ lia64-2.4/arch/ia64/lib/checksum.c Tue May 7 09:36:17 2002 @@ -66,15 +66,6 @@ extern unsigned long do_csum (const unsigned char *, long); /* - * This is a version of ip_compute_csum() optimized for IP headers, - * which always checksum on 4 octet boundaries. - */ -unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) -{ - return ~do_csum(iph, ihl*4); -} - -/* * computes the checksum of a memory block at buff, length len, * and adds in "sum" (32-bit) * diff -urN linux-2.4.18/arch/ia64/lib/clear_page.S lia64-2.4/arch/ia64/lib/clear_page.S --- linux-2.4.18/arch/ia64/lib/clear_page.S Mon Nov 26 11:18:24 2001 +++ lia64-2.4/arch/ia64/lib/clear_page.S Mon Mar 11 18:42:21 2002 @@ -1,51 +1,77 @@ /* - * - * Optimized function to clear a page of memory. - * - * Inputs: - * in0: address of page - * - * Output: - * none - * - * Copyright (C) 1999-2001 Hewlett-Packard Co - * Copyright (C) 1999 Stephane Eranian - * Copyright (C) 1999-2001 David Mosberger-Tang + * Copyright (C) 1999-2002 Hewlett-Packard Co + * Stephane Eranian + * David Mosberger-Tang + * Copyright (C) 2002 Ken Chen * * 1/06/01 davidm Tuned for Itanium. + * 2/12/02 kchen Tuned for both Itanium and McKinley + * 3/08/02 davidm Some more tweaking */ +#include + #include #include +#ifdef CONFIG_ITANIUM +# define L3_LINE_SIZE 64 // Itanium L3 line size +# define PREFETCH_LINES 9 // magic number +#else +# define L3_LINE_SIZE 128 // McKinley L3 line size +# define PREFETCH_LINES 12 // magic number +#endif + #define saved_lc r2 -#define dst0 in0 +#define dst_fetch r3 #define dst1 r8 #define dst2 r9 #define dst3 r10 -#define dst_fetch r11 +#define dst4 r11 + +#define dst_last r31 GLOBAL_ENTRY(clear_page) .prologue .regstk 1,0,0,0 - mov r16 = PAGE_SIZE/64-1 // -1 = repeat/until - ;; + mov r16 = PAGE_SIZE/L3_LINE_SIZE-1 // main loop count, -1=repeat/until .save ar.lc, saved_lc mov saved_lc = ar.lc + .body - mov ar.lc = r16 - adds dst1 = 16, dst0 - adds dst2 = 32, dst0 - adds dst3 = 48, dst0 - adds dst_fetch = 512, dst0 + mov ar.lc = (PREFETCH_LINES - 1) + mov dst_fetch = in0 + adds dst1 = 16, in0 + adds dst2 = 32, in0 + ;; +.fetch: stf.spill.nta [dst_fetch] = f0, L3_LINE_SIZE + adds dst3 = 48, in0 // executing this multiple times is harmless + br.cloop.sptk.few .fetch + ;; + addl dst_last = (PAGE_SIZE - PREFETCH_LINES*L3_LINE_SIZE), dst_fetch + mov ar.lc = r16 // one L3 line per iteration + adds dst4 = 64, in0 + ;; +#ifdef CONFIG_ITANIUM + // Optimized for Itanium +1: stf.spill.nta [dst1] = f0, 64 + stf.spill.nta [dst2] = f0, 64 + cmp.lt p8,p0=dst_fetch, dst_last + ;; +#else + // Optimized for McKinley +1: stf.spill.nta [dst1] = f0, 64 + stf.spill.nta [dst2] = f0, 64 + stf.spill.nta [dst3] = f0, 64 + stf.spill.nta [dst4] = f0, 128 + cmp.lt p8,p0=dst_fetch, dst_last ;; -1: stf.spill.nta [dst0] = f0, 64 stf.spill.nta [dst1] = f0, 64 stf.spill.nta [dst2] = f0, 64 +#endif stf.spill.nta [dst3] = f0, 64 - - lfetch [dst_fetch], 64 - br.cloop.dptk.few 1b +(p8) stf.spill.nta [dst_fetch] = f0, L3_LINE_SIZE + br.cloop.sptk.few 1b ;; - mov ar.lc = r2 // restore lc + mov ar.lc = saved_lc // restore lc br.ret.sptk.many rp END(clear_page) diff -urN linux-2.4.18/arch/ia64/lib/copy_page.S lia64-2.4/arch/ia64/lib/copy_page.S --- linux-2.4.18/arch/ia64/lib/copy_page.S Mon Nov 26 11:18:24 2001 +++ lia64-2.4/arch/ia64/lib/copy_page.S Fri Apr 19 14:00:02 2002 @@ -30,6 +30,7 @@ #define tgt2 r23 #define srcf r24 #define tgtf r25 +#define tgt_last r26 #define Nrot ((8*PIPE_DEPTH+7)&~7) @@ -55,18 +56,21 @@ mov src1=in1 adds src2=8,in1 + mov tgt_last = PAGE_SIZE ;; adds tgt2=8,in0 add srcf=512,in1 mov ar.lc=lcount mov tgt1=in0 add tgtf=512,in0 + add tgt_last = tgt_last, in0 ;; 1: (p[0]) ld8 t1[0]=[src1],16 (EPI) st8 [tgt1]=t1[PIPE_DEPTH-1],16 (p[0]) ld8 t2[0]=[src2],16 (EPI) st8 [tgt2]=t2[PIPE_DEPTH-1],16 + cmp.ltu p6,p0 = tgtf, tgt_last ;; (p[0]) ld8 t3[0]=[src1],16 (EPI) st8 [tgt1]=t3[PIPE_DEPTH-1],16 @@ -83,8 +87,8 @@ (p[0]) ld8 t8[0]=[src2],16 (EPI) st8 [tgt2]=t8[PIPE_DEPTH-1],16 - lfetch [srcf], 64 - lfetch [tgtf], 64 +(p6) lfetch [srcf], 64 +(p6) lfetch [tgtf], 64 br.ctop.sptk.few 1b ;; mov pr=saved_pr,0xffffffffffff0000 // restore predicates diff -urN linux-2.4.18/arch/ia64/lib/copy_page_mck.S lia64-2.4/arch/ia64/lib/copy_page_mck.S --- linux-2.4.18/arch/ia64/lib/copy_page_mck.S Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/lib/copy_page_mck.S Thu Apr 11 17:32:45 2002 @@ -0,0 +1,185 @@ +/* + * McKinley-optimized version of copy_page(). + * + * Copyright (C) 2002 Hewlett-Packard Co + * David Mosberger + * + * Inputs: + * in0: address of target page + * in1: address of source page + * Output: + * no return value + * + * General idea: + * - use regular loads and stores to prefetch data to avoid consuming M-slot just for + * lfetches => good for in-cache performance + * - avoid l2 bank-conflicts by not storing into the same 16-byte bank within a single + * cycle + * + * Principle of operation: + * First, note that L1 has a line-size of 64 bytes and L2 a line-size of 128 bytes. + * To avoid secondary misses in L2, we prefetch both source and destination with a line-size + * of 128 bytes. When both of these lines are in the L2 and the first half of the + * source line is in L1, we start copying the remaining words. The second half of the + * source line is prefetched in an earlier iteration, so that by the time we start + * accessing it, it's also present in the L1. + * + * We use a software-pipelined loop to control the overall operation. The pipeline + * has 2*PREFETCH_DIST+K stages. The first PREFETCH_DIST stages are used for prefetching + * source cache-lines. The second PREFETCH_DIST stages are used for prefetching destination + * cache-lines, the last K stages are used to copy the cache-line words not copied by + * the prefetches. The four relevant points in the pipelined are called A, B, C, D: + * p[A] is TRUE if a source-line should be prefetched, p[B] is TRUE if a destination-line + * should be prefetched, p[C] is TRUE if the second half of an L2 line should be brought + * into L1D and p[D] is TRUE if a cacheline needs to be copied. + * + * This all sounds very complicated, but thanks to the modulo-scheduled loop support, + * the resulting code is very regular and quite easy to follow (once you get the idea). + * + * As a secondary optimization, the first 2*PREFETCH_DIST iterations are implemented + * as the separate .prefetch_loop. Logically, this loop performs exactly like the + * main-loop (.line_copy), but has all known-to-be-predicated-off instructions removed, + * so that each loop iteration is faster (again, good for cached case). + * + * When reading the code, it helps to keep the following picture in mind: + * + * word 0 word 1 + * +------+------+--- + * | v[x] | t1 | ^ + * | t2 | t3 | | + * | t4 | t5 | | + * | t6 | t7 | | 128 bytes + * | n[y] | t9 | | (L2 cache line) + * | t10 | t11 | | + * | t12 | t13 | | + * | t14 | t15 | v + * +------+------+--- + * + * Here, v[x] is copied by the (memory) prefetch. n[y] is loaded at p[C] + * to fetch the second-half of the L2 cache line into L1, and the tX words are copied in + * an order that avoids bank conflicts. + */ +#include +#include + +#define PREFETCH_DIST 8 // McKinley sustains 16 outstanding L2 misses (8 ld, 8 st) + +#define src0 r2 +#define src1 r3 +#define dst0 r9 +#define dst1 r10 +#define src_pre_mem r11 +#define dst_pre_mem r14 +#define src_pre_l2 r15 +#define dst_pre_l2 r16 +#define t1 r17 +#define t2 r18 +#define t3 r19 +#define t4 r20 +#define t5 t1 // alias! +#define t6 t2 // alias! +#define t7 t3 // alias! +#define t9 t5 // alias! +#define t10 t4 // alias! +#define t11 t7 // alias! +#define t12 t6 // alias! +#define t14 t10 // alias! +#define t13 r21 +#define t15 r22 + +#define saved_lc r23 +#define saved_pr r24 + +#define A 0 +#define B (PREFETCH_DIST) +#define C (B + PREFETCH_DIST) +#define D (C + 3) +#define N (D + 1) +#define Nrot ((N + 7) & ~7) + +GLOBAL_ENTRY(copy_page) + .prologue + alloc r8 = ar.pfs, 2, Nrot-2, 0, Nrot + + .rotr v[2*PREFETCH_DIST], n[D-C+1] + .rotp p[N] + + .save ar.lc, saved_lc + mov saved_lc = ar.lc + .save pr, saved_pr + mov saved_pr = pr + .body + + mov src_pre_mem = in1 + mov pr.rot = 0x10000 + mov ar.ec = 1 // special unrolled loop + + mov dst_pre_mem = in0 + mov ar.lc = 2*PREFETCH_DIST - 1 + + add src_pre_l2 = 8*8, in1 + add dst_pre_l2 = 8*8, in0 + add src0 = 8, in1 // first t1 src + add src1 = 3*8, in1 // first t3 src + add dst0 = 8, in0 // first t1 dst + add dst1 = 3*8, in0 // first t3 dst + mov t1 = (PAGE_SIZE/128) - (2*PREFETCH_DIST) - 1 + nop.m 0 + nop.i 0 + ;; + // same as .line_copy loop, but with all predicated-off instructions removed: +.prefetch_loop: +(p[A]) ld8 v[A] = [src_pre_mem], 128 // M0 +(p[B]) st8 [dst_pre_mem] = v[B], 128 // M2 + br.ctop.sptk .prefetch_loop + ;; + cmp.eq p16, p0 = r0, r0 // reset p16 to 1 (br.ctop cleared it to zero) + mov ar.lc = t1 // with 64KB pages, t1 is too big to fit in 8 bits! + mov ar.ec = N // # of stages in pipeline + ;; +.line_copy: +(p[D]) ld8 t2 = [src0], 3*8 // M0 +(p[D]) ld8 t4 = [src1], 3*8 // M1 +(p[B]) st8 [dst_pre_mem] = v[B], 128 // M2 prefetch dst from memory +(p[D]) st8 [dst_pre_l2] = n[D-C], 128 // M3 prefetch dst from L2 + ;; +(p[A]) ld8 v[A] = [src_pre_mem], 128 // M0 prefetch src from memory +(p[C]) ld8 n[0] = [src_pre_l2], 128 // M1 prefetch src from L2 +(p[D]) st8 [dst0] = t1, 8 // M2 +(p[D]) st8 [dst1] = t3, 8 // M3 + ;; +(p[D]) ld8 t5 = [src0], 8 +(p[D]) ld8 t7 = [src1], 3*8 +(p[D]) st8 [dst0] = t2, 3*8 +(p[D]) st8 [dst1] = t4, 3*8 + ;; +(p[D]) ld8 t6 = [src0], 3*8 +(p[D]) ld8 t10 = [src1], 8 +(p[D]) st8 [dst0] = t5, 8 +(p[D]) st8 [dst1] = t7, 3*8 + ;; +(p[D]) ld8 t9 = [src0], 3*8 +(p[D]) ld8 t11 = [src1], 3*8 +(p[D]) st8 [dst0] = t6, 3*8 +(p[D]) st8 [dst1] = t10, 8 + ;; +(p[D]) ld8 t12 = [src0], 8 +(p[D]) ld8 t14 = [src1], 8 +(p[D]) st8 [dst0] = t9, 3*8 +(p[D]) st8 [dst1] = t11, 3*8 + ;; +(p[D]) ld8 t13 = [src0], 4*8 +(p[D]) ld8 t15 = [src1], 4*8 +(p[D]) st8 [dst0] = t12, 8 +(p[D]) st8 [dst1] = t14, 8 + ;; +(p[D-1])ld8 t1 = [src0], 8 +(p[D-1])ld8 t3 = [src1], 8 +(p[D]) st8 [dst0] = t13, 4*8 +(p[D]) st8 [dst1] = t15, 4*8 + br.ctop.sptk .line_copy + ;; + mov ar.lc = saved_lc + mov pr = saved_pr, -1 + br.ret.sptk.many rp +END(copy_page) diff -urN linux-2.4.18/arch/ia64/lib/do_csum.S lia64-2.4/arch/ia64/lib/do_csum.S --- linux-2.4.18/arch/ia64/lib/do_csum.S Mon Nov 26 11:18:24 2001 +++ lia64-2.4/arch/ia64/lib/do_csum.S Fri Apr 26 12:12:01 2002 @@ -8,9 +8,14 @@ * in0: address of buffer to checksum (char *) * in1: length of the buffer (int) * - * Copyright (C) 1999, 2001 Hewlett-Packard Co - * Copyright (C) 1999 Stephane Eranian + * Copyright (C) 1999, 2001-2002 Hewlett-Packard Co + * Stephane Eranian * + * 02/04/22 Ken Chen + * Data locality study on the checksum buffer. + * More optimization cleanup - remove excessive stop bits. + * 02/04/08 David Mosberger + * More cleanup and tuning. * 01/04/18 Jun Nakajima * Clean up and optimize and the software pipeline, loading two * back-to-back 8-byte words per loop. Clean up the initialization @@ -71,8 +76,6 @@ // calculating the Internet checksum. // // NOT YET DONE: -// - use the lfetch instruction to augment the chances of the data being in -// the cache when we need it. // - Maybe another algorithm which would take care of the folding at the // end in a different manner // - Work with people more knowledgeable than me on the network stack @@ -80,6 +83,12 @@ // type of packet or alignment we get. Like the ip_fast_csum() routine // where we know we have at least 20bytes worth of data to checksum. // - Do a better job of handling small packets. +// - Note on prefetching: it was found that under various load, i.e. ftp read/write, +// nfs read/write, the L1 cache hit rate is at 60% and L2 cache hit rate is at 99.8% +// on the data that buffer points to (partly because the checksum is often preceded by +// a copy_from_user()). This finding indiate that lfetch will not be beneficial since +// the data is already in the cache. +// #define saved_pfs r11 #define hmask r16 @@ -102,10 +111,6 @@ #define buf in0 #define len in1 -#ifndef CONFIG_IA64_LOAD_LATENCY -#define CONFIG_IA64_LOAD_LATENCY 2 -#endif - #define LOAD_LATENCY 2 // XXX fix me #if (LOAD_LATENCY != 1) && (LOAD_LATENCY != 2) @@ -121,69 +126,70 @@ GLOBAL_ENTRY(do_csum) .prologue .save ar.pfs, saved_pfs - alloc saved_pfs=ar.pfs,2,16,1,16 - .rotr word1[4], word2[4],result1[4],result2[4] - .rotp p[PIPE_DEPTH] + alloc saved_pfs=ar.pfs,2,16,0,16 + .rotr word1[4], word2[4],result1[LOAD_LATENCY+2],result2[LOAD_LATENCY+2] + .rotp p[PIPE_DEPTH], pC1[2], pC2[2] mov ret0=r0 // in case we have zero length cmp.lt p0,p6=r0,len // check for zero length or negative (32bit len) - ;; // avoid WAW on CFM - mov tmp3=0x7 // a temporary mask/value + ;; add tmp1=buf,len // last byte's address -(p6) br.ret.spnt.many rp // return if true (hope we can avoid that) + .save pr, saved_pr + mov saved_pr=pr // preserve predicates (rotation) +(p6) br.ret.spnt.many rp // return if zero or negative length - and firstoff=7,buf // how many bytes off for first1 element - tbit.nz p15,p0=buf,0 // is buf an odd address ? mov hmask=-1 // intialize head mask - ;; - andcm first1=buf,tmp3 // 8byte aligned down address of first1 element + tbit.nz p15,p0=buf,0 // is buf an odd address? + and first1=-8,buf // 8-byte align down address of first1 element + + and firstoff=7,buf // how many bytes off for first1 element mov tmask=-1 // initialize tail mask - adds tmp2=-1,tmp1 // last-1 + ;; + adds tmp2=-1,tmp1 // last-1 and lastoff=7,tmp1 // how many bytes off for last element - andcm last=tmp2,tmp3 // address of word containing last byte - .save pr, saved_pr - mov saved_pr=pr // preserve predicates (rotation) + ;; + sub tmp1=8,lastoff // complement to lastoff + and last=-8,tmp2 // address of word containing last byte ;; sub tmp3=last,first1 // tmp3=distance from first1 to last + .save ar.lc, saved_lc + mov saved_lc=ar.lc // save lc cmp.eq p8,p9=last,first1 // everything fits in one word ? - sub tmp1=8,lastoff // complement to lastoff - ld8 firstval=[first1],8 // load,ahead of time, "first1" word + + ld8 firstval=[first1],8 // load, ahead of time, "first1" word + and tmp1=7, tmp1 // make sure that if tmp1==8 -> tmp1=0 shl tmp2=firstoff,3 // number of bits ;; - and tmp1=7, tmp1 // make sure that if tmp1==8 -> tmp1=0 -(p9) ld8 lastval=[last] // load,ahead of time, "last" word, if needed +(p9) ld8 lastval=[last] // load, ahead of time, "last" word, if needed + shl tmp1=tmp1,3 // number of bits (p9) adds tmp3=-8,tmp3 // effectively loaded ;; (p8) mov lastval=r0 // we don't need lastval if first1==last - shl tmp1=tmp1,3 // number of bits shl hmask=hmask,tmp2 // build head mask, mask off [0,first1off[ - ;; shr.u tmask=tmask,tmp1 // build tail mask, mask off ]8,lastoff] - .save ar.lc, saved_lc - mov saved_lc=ar.lc // save lc ;; .body #define count tmp3 (p8) and hmask=hmask,tmask // apply tail mask to head mask if 1 word only (p9) and word2[0]=lastval,tmask // mask last it as appropriate - shr.u count=count,3 // we do 8 bytes per loop (count) + shr.u count=count,3 // how many 8-byte? ;; // If count is odd, finish this 8-byte word so that we can // load two back-to-back 8-byte words per loop thereafter. - tbit.nz p10,p11=count,0 // if (count is odd) and word1[0]=firstval,hmask // and mask it as appropriate + tbit.nz p10,p11=count,0 // if (count is odd) ;; (p8) mov result1[0]=word1[0] (p9) add result1[0]=word1[0],word2[0] ;; cmp.ltu p6,p0=result1[0],word1[0] // check the carry + cmp.eq.or.andcm p8,p0=0,count // exit if zero 8-byte ;; (p6) adds result1[0]=1,result1[0] (p8) br.cond.dptk .do_csum_exit // if (within an 8-byte word) - ;; (p11) br.cond.dptk .do_csum16 // if (count is even) - ;; + // Here count is odd. ld8 word1[1]=[first1],8 // load an 8-byte word cmp.eq p9,p10=1,count // if (count == 1) @@ -194,58 +200,43 @@ cmp.ltu p6,p0=result1[0],word1[1] ;; (p6) adds result1[0]=1,result1[0] - ;; (p9) br.cond.sptk .do_csum_exit // if (count == 1) exit // Fall through to caluculate the checksum, feeding result1[0] as // the initial value in result1[0]. - ;; // // Calculate the checksum loading two 8-byte words per loop. // .do_csum16: - mov saved_lc=ar.lc + add first2=8,first1 shr.u count=count,1 // we do 16 bytes per loop ;; - cmp.eq p9,p10=r0,count // if (count == 0) + adds count=-1,count + mov carry1=r0 + mov carry2=r0 brp.loop.imp 1f,2f ;; - adds count=-1,count mov ar.ec=PIPE_DEPTH - ;; mov ar.lc=count // set lc - ;; + mov pr.rot=1<<16 // result1[0] must be initialized in advance. mov result2[0]=r0 ;; - mov pr.rot=1<<16 - ;; - mov carry1=r0 - mov carry2=r0 - ;; - add first2=8,first1 - ;; -(p9) br.cond.sptk .do_csum_exit - ;; - nop.m 0 - nop.i 0 - ;; .align 32 1: -(ELD_1) cmp.ltu p31,p0=result1[LOAD_LATENCY],word1[LOAD_LATENCY+1] -(p32) adds carry1=1,carry1 -(ELD_1) cmp.ltu p47,p0=result2[LOAD_LATENCY],word2[LOAD_LATENCY+1] -(p48) adds carry2=1,carry2 +(ELD_1) cmp.ltu pC1[0],p0=result1[LOAD_LATENCY],word1[LOAD_LATENCY+1] +(pC1[1])adds carry1=1,carry1 +(ELD_1) cmp.ltu pC2[0],p0=result2[LOAD_LATENCY],word2[LOAD_LATENCY+1] +(pC2[1])adds carry2=1,carry2 (ELD) add result1[LOAD_LATENCY-1]=result1[LOAD_LATENCY],word1[LOAD_LATENCY] (ELD) add result2[LOAD_LATENCY-1]=result2[LOAD_LATENCY],word2[LOAD_LATENCY] 2: -(p16) ld8 word1[0]=[first1],16 -(p16) ld8 word2[0]=[first2],16 +(p[0]) ld8 word1[0]=[first1],16 +(p[0]) ld8 word2[0]=[first2],16 br.ctop.sptk 1b ;; - // Since len is a 32-bit value, carry cannot be larger than - // a 64-bit value. -(p32) adds carry1=1,carry1 // since we miss the last one -(p48) adds carry2=1,carry2 + // Since len is a 32-bit value, carry cannot be larger than a 64-bit value. +(pC1[1])adds carry1=1,carry1 // since we miss the last one +(pC2[1])adds carry2=1,carry2 ;; add result1[LOAD_LATENCY+1]=result1[LOAD_LATENCY+1],carry1 add result2[LOAD_LATENCY+1]=result2[LOAD_LATENCY+1],carry2 @@ -263,18 +254,15 @@ (p6) adds result1[0]=1,result1[0] ;; .do_csum_exit: - movl tmp3=0xffffffff - ;; - // XXX Fixme // // now fold 64 into 16 bits taking care of carry // that's not very good because it has lots of sequentiality // - and tmp1=result1[0],tmp3 + mov tmp3=0xffff + zxt4 tmp1=result1[0] shr.u tmp2=result1[0],32 ;; add result1[0]=tmp1,tmp2 - shr.u tmp3=tmp3,16 ;; and tmp1=result1[0],tmp3 shr.u tmp2=result1[0],16 diff -urN linux-2.4.18/arch/ia64/lib/ip_fast_csum.S lia64-2.4/arch/ia64/lib/ip_fast_csum.S --- linux-2.4.18/arch/ia64/lib/ip_fast_csum.S Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/lib/ip_fast_csum.S Thu Apr 25 16:38:25 2002 @@ -0,0 +1,90 @@ +/* + * Optmized version of the ip_fast_csum() function + * Used for calculating IP header checksum + * + * Return: 16bit checksum, complemented + * + * Inputs: + * in0: address of buffer to checksum (char *) + * in1: length of the buffer (int) + * + * Copyright (C) 2002 Intel Corp. + * Copyright (C) 2002 Ken Chen + */ + +#include + +/* + * Since we know that most likely this function is called with buf aligned + * on 4-byte boundary and 20 bytes in length, we can execution rather quickly + * versus calling generic version of do_csum, which has lots of overhead in + * handling various alignments and sizes. However, due to lack of constrains + * put on the function input argument, cases with alignment not on 4-byte or + * size not equal to 20 bytes will be handled by the generic do_csum function. + */ + +#define in0 r32 +#define in1 r33 +#define ret0 r8 + +GLOBAL_ENTRY(ip_fast_csum) + .prologue + .body + cmp.ne p6,p7=5,in1 // size other than 20 byte? + and r14=3,in0 // is it aligned on 4-byte? + add r15=4,in0 // second source pointer + ;; + cmp.ne.or.andcm p6,p7=r14,r0 + ;; +(p7) ld4 r20=[in0],8 +(p7) ld4 r21=[r15],8 +(p6) br.spnt .generic + ;; + ld4 r22=[in0],8 + ld4 r23=[r15],8 + ;; + ld4 r24=[in0] + add r20=r20,r21 + add r22=r22,r23 + ;; + add r20=r20,r22 + ;; + add r20=r20,r24 + ;; + shr.u ret0=r20,16 // now need to add the carry + zxt2 r20=r20 + ;; + add r20=ret0,r20 + ;; + shr.u ret0=r20,16 // add carry again + zxt2 r20=r20 + ;; + add r20=ret0,r20 + ;; + shr.u ret0=r20,16 + zxt2 r20=r20 + ;; + add r20=ret0,r20 + ;; + andcm ret0=-1,r20 + .restore sp // reset frame state + br.ret.sptk.many b0 + ;; + +.generic: + .prologue + .save ar.pfs, r35 + alloc r35=ar.pfs,2,2,2,0 + .save rp, r34 + mov r34=b0 + .body + dep.z out1=in1,2,30 + mov out0=in0 + ;; + br.call.sptk.many b0=do_csum + ;; + andcm ret0=-1,ret0 + mov ar.pfs=r35 + mov b0=r34 + br.ret.sptk.many b0 +END(ip_fast_csum) diff -urN linux-2.4.18/arch/ia64/lib/memcpy_mck.S lia64-2.4/arch/ia64/lib/memcpy_mck.S --- linux-2.4.18/arch/ia64/lib/memcpy_mck.S Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/lib/memcpy_mck.S Fri Jul 19 18:55:58 2002 @@ -0,0 +1,675 @@ +/* + * Itanium 2-optimized version of memcpy and copy_user function + * + * Inputs: + * in0: destination address + * in1: source address + * in2: number of bytes to copy + * Output: + * 0 if success, or number of byte NOT copied if error occurred. + * + * Copyright (C) 2002 Intel Corp. + * Copyright (C) 2002 Ken Chen + */ +#include +#include +#include + +#if __GNUC__ >= 3 +# define EK(y...) EX(y) +#else +# define EK(y,x...) x +#endif + +GLOBAL_ENTRY(bcopy) + .regstk 3,0,0,0 + mov r8=in0 + mov in0=in1 + ;; + mov in1=r8 + ;; +END(bcopy) + +/* McKinley specific optimization */ + +#define retval r8 +#define saved_pfs r31 +#define saved_lc r10 +#define saved_pr r11 +#define saved_in0 r14 +#define saved_in1 r15 +#define saved_in2 r16 + +#define src0 r2 +#define src1 r3 +#define dst0 r17 +#define dst1 r18 +#define cnt r9 + +/* r19-r30 are temp for each code section */ +#define PREFETCH_DIST 8 +#define src_pre_mem r19 +#define dst_pre_mem r20 +#define src_pre_l2 r21 +#define dst_pre_l2 r22 +#define t1 r23 +#define t2 r24 +#define t3 r25 +#define t4 r26 +#define t5 t1 // alias! +#define t6 t2 // alias! +#define t7 t3 // alias! +#define n8 r27 +#define t9 t5 // alias! +#define t10 t4 // alias! +#define t11 t7 // alias! +#define t12 t6 // alias! +#define t14 t10 // alias! +#define t13 r28 +#define t15 r29 +#define tmp r30 + +/* defines for long_copy block */ +#define A 0 +#define B (PREFETCH_DIST) +#define C (B + PREFETCH_DIST) +#define D (C + 1) +#define N (D + 1) +#define Nrot ((N + 7) & ~7) + +/* alias */ +#define in0 r32 +#define in1 r33 +#define in2 r34 + +GLOBAL_ENTRY(memcpy) + and r28=0x7,in0 + and r29=0x7,in1 + mov f6=f0 + br.cond.sptk .common_code + ;; +END(memcpy) +GLOBAL_ENTRY(__copy_user) + .prologue +// check dest alignment + and r28=0x7,in0 + and r29=0x7,in1 + mov f6=f1 + mov saved_in0=in0 // save dest pointer + mov saved_in1=in1 // save src pointer + mov saved_in2=in2 // save len + ;; +.common_code: + cmp.gt p15,p0=8,in2 // check for small size + cmp.ne p13,p0=0,r28 // check dest alignment + cmp.ne p14,p0=0,r29 // check src alignment + add src0=0,in1 + sub r30=8,r28 // for .align_dest + mov retval=r0 // initialize return value + ;; + add dst0=0,in0 + add dst1=1,in0 // dest odd index + cmp.le p6,p0 = 1,r30 // for .align_dest +(p15) br.cond.dpnt .memcpy_short +(p13) br.cond.dpnt .align_dest +(p14) br.cond.dpnt .unaligned_src + ;; + +// both dest and src are aligned on 8-byte boundary +.aligned_src: + .save ar.pfs, saved_pfs + alloc saved_pfs=ar.pfs,3,Nrot-3,0,Nrot + .save pr, saved_pr + mov saved_pr=pr + + shr.u cnt=in2,7 // this much cache line + ;; + cmp.lt p6,p0=2*PREFETCH_DIST,cnt + cmp.lt p7,p8=1,cnt + .save ar.lc, saved_lc + mov saved_lc=ar.lc + .body + add cnt=-1,cnt + add src_pre_mem=0,in1 // prefetch src pointer + add dst_pre_mem=0,in0 // prefetch dest pointer + ;; +(p7) mov ar.lc=cnt // prefetch count +(p8) mov ar.lc=r0 +(p6) br.cond.dpnt .long_copy + ;; + +.prefetch: + lfetch [src_pre_mem], 128 + lfetch.excl [dst_pre_mem], 128 + br.cloop.dptk.few .prefetch + ;; + +.medium_copy: + and tmp=31,in2 // copy length after iteration + shr.u r29=in2,5 // number of 32-byte iteration + add dst1=8,dst0 // 2nd dest pointer + ;; + add cnt=-1,r29 // ctop iteration adjustment + cmp.eq p10,p0=r29,r0 // do we really need to loop? + add src1=8,src0 // 2nd src pointer + cmp.le p6,p0=8,tmp + ;; + cmp.le p7,p0=16,tmp + mov ar.lc=cnt // loop setup + cmp.eq p16,p17 = r0,r0 + mov ar.ec=2 +(p10) br.dpnt.few .aligned_src_tail + ;; + .align 32 +1: +EX(.ex_handler, (p16) ld8 r34=[src0],16) +EK(.ex_handler, (p16) ld8 r38=[src1],16) +EX(.ex_handler, (p17) st8 [dst0]=r33,16) +EK(.ex_handler, (p17) st8 [dst1]=r37,16) + ;; +EX(.ex_handler, (p16) ld8 r32=[src0],16) +EK(.ex_handler, (p16) ld8 r36=[src1],16) +EX(.ex_handler, (p16) st8 [dst0]=r34,16) +EK(.ex_handler, (p16) st8 [dst1]=r38,16) + br.ctop.dptk.few 1b + ;; + +.aligned_src_tail: +EX(.ex_handler, (p6) ld8 t1=[src0]) + mov ar.lc=saved_lc + mov ar.pfs=saved_pfs +EX(.ex_hndlr_s, (p7) ld8 t2=[src1],8) + cmp.le p8,p0=24,tmp + and r21=-8,tmp + ;; +EX(.ex_hndlr_s, (p8) ld8 t3=[src1]) +EX(.ex_handler, (p6) st8 [dst0]=t1) // store byte 1 + and in2=7,tmp // remaining length +EX(.ex_hndlr_d, (p7) st8 [dst1]=t2,8) // store byte 2 + add src0=src0,r21 // setting up src pointer + add dst0=dst0,r21 // setting up dest pointer + ;; +EX(.ex_handler, (p8) st8 [dst1]=t3) // store byte 3 + mov pr=saved_pr,-1 + br.dptk.many .memcpy_short + ;; + +/* code taken from copy_page_mck */ +.long_copy: + .rotr v[2*PREFETCH_DIST] + .rotp p[N] + + mov src_pre_mem = src0 + mov pr.rot = 0x10000 + mov ar.ec = 1 // special unrolled loop + + mov dst_pre_mem = dst0 + + add src_pre_l2 = 8*8, src0 + add dst_pre_l2 = 8*8, dst0 + ;; + add src0 = 8, src_pre_mem // first t1 src + mov ar.lc = 2*PREFETCH_DIST - 1 + shr.u cnt=in2,7 // number of lines + add src1 = 3*8, src_pre_mem // first t3 src + add dst0 = 8, dst_pre_mem // first t1 dst + add dst1 = 3*8, dst_pre_mem // first t3 dst + ;; + and tmp=127,in2 // remaining bytes after this block + add cnt = -(2*PREFETCH_DIST) - 1, cnt + // same as .line_copy loop, but with all predicated-off instructions removed: +.prefetch_loop: +EX(.ex_hndlr_lcpy_1, (p[A]) ld8 v[A] = [src_pre_mem], 128) // M0 +EK(.ex_hndlr_lcpy_1, (p[B]) st8 [dst_pre_mem] = v[B], 128) // M2 + br.ctop.sptk .prefetch_loop + ;; + cmp.eq p16, p0 = r0, r0 // reset p16 to 1 + mov ar.lc = cnt + mov ar.ec = N // # of stages in pipeline + ;; +.line_copy: +EX(.ex_handler, (p[D]) ld8 t2 = [src0], 3*8) // M0 +EK(.ex_handler, (p[D]) ld8 t4 = [src1], 3*8) // M1 +EX(.ex_handler_lcpy, (p[B]) st8 [dst_pre_mem] = v[B], 128) // M2 prefetch dst from memory +EK(.ex_handler_lcpy, (p[D]) st8 [dst_pre_l2] = n8, 128) // M3 prefetch dst from L2 + ;; +EX(.ex_handler_lcpy, (p[A]) ld8 v[A] = [src_pre_mem], 128) // M0 prefetch src from memory +EK(.ex_handler_lcpy, (p[C]) ld8 n8 = [src_pre_l2], 128) // M1 prefetch src from L2 +EX(.ex_handler, (p[D]) st8 [dst0] = t1, 8) // M2 +EK(.ex_handler, (p[D]) st8 [dst1] = t3, 8) // M3 + ;; +EX(.ex_handler, (p[D]) ld8 t5 = [src0], 8) +EK(.ex_handler, (p[D]) ld8 t7 = [src1], 3*8) +EX(.ex_handler, (p[D]) st8 [dst0] = t2, 3*8) +EK(.ex_handler, (p[D]) st8 [dst1] = t4, 3*8) + ;; +EX(.ex_handler, (p[D]) ld8 t6 = [src0], 3*8) +EK(.ex_handler, (p[D]) ld8 t10 = [src1], 8) +EX(.ex_handler, (p[D]) st8 [dst0] = t5, 8) +EK(.ex_handler, (p[D]) st8 [dst1] = t7, 3*8) + ;; +EX(.ex_handler, (p[D]) ld8 t9 = [src0], 3*8) +EK(.ex_handler, (p[D]) ld8 t11 = [src1], 3*8) +EX(.ex_handler, (p[D]) st8 [dst0] = t6, 3*8) +EK(.ex_handler, (p[D]) st8 [dst1] = t10, 8) + ;; +EX(.ex_handler, (p[D]) ld8 t12 = [src0], 8) +EK(.ex_handler, (p[D]) ld8 t14 = [src1], 8) +EX(.ex_handler, (p[D]) st8 [dst0] = t9, 3*8) +EK(.ex_handler, (p[D]) st8 [dst1] = t11, 3*8) + ;; +EX(.ex_handler, (p[D]) ld8 t13 = [src0], 4*8) +EK(.ex_handler, (p[D]) ld8 t15 = [src1], 4*8) +EX(.ex_handler, (p[D]) st8 [dst0] = t12, 8) +EK(.ex_handler, (p[D]) st8 [dst1] = t14, 8) + ;; +EX(.ex_handler, (p[C]) ld8 t1 = [src0], 8) +EK(.ex_handler, (p[C]) ld8 t3 = [src1], 8) +EX(.ex_handler, (p[D]) st8 [dst0] = t13, 4*8) +EK(.ex_handler, (p[D]) st8 [dst1] = t15, 4*8) + br.ctop.sptk .line_copy + ;; + + add dst0=-8,dst0 + add src0=-8,src0 + mov in2=tmp + .restore sp + br.sptk.many .medium_copy + ;; + +#define BLOCK_SIZE 128*32 +#define blocksize r23 +#define curlen r24 + +// dest is on 8-byte boundary, src is not. We need to do +// ld8-ld8, shrp, then st8. Max 8 byte copy per cycle. +.unaligned_src: + .prologue + .save ar.pfs, saved_pfs + alloc saved_pfs=ar.pfs,3,5,0,8 + .save ar.lc, saved_lc + mov saved_lc=ar.lc + .save pr, saved_pr + mov saved_pr=pr + .body +.4k_block: + mov saved_in0=dst0 // need to save all input arguments + mov saved_in2=in2 + mov blocksize=BLOCK_SIZE + ;; + cmp.lt p6,p7=blocksize,in2 + mov saved_in1=src0 + ;; +(p6) mov in2=blocksize + ;; + shr.u r21=in2,7 // this much cache line + shr.u r22=in2,4 // number of 16-byte iteration + and curlen=15,in2 // copy length after iteration + and r30=7,src0 // source alignment + ;; + cmp.lt p7,p8=1,r21 + add cnt=-1,r21 + ;; + + add src_pre_mem=0,src0 // prefetch src pointer + add dst_pre_mem=0,dst0 // prefetch dest pointer + and src0=-8,src0 // 1st src pointer +(p7) mov ar.lc = r21 +(p8) mov ar.lc = r0 + ;; + .align 32 +1: lfetch [src_pre_mem], 128 + lfetch.excl [dst_pre_mem], 128 + br.cloop.dptk.few 1b + ;; + + shladd dst1=r22,3,dst0 // 2nd dest pointer + shladd src1=r22,3,src0 // 2nd src pointer + cmp.eq p8,p9=r22,r0 // do we really need to loop? + cmp.le p6,p7=8,curlen; // have at least 8 byte remaining? + add cnt=-1,r22 // ctop iteration adjustment + ;; +EX(.ex_handler, (p9) ld8 r33=[src0],8) // loop primer +EK(.ex_handler, (p9) ld8 r37=[src1],8) +(p8) br.dpnt.few .noloop + ;; + +// The jump address is calculated based on src alignment. The COPYU +// macro below need to confine its size to power of two, so an entry +// can be caulated using shl instead of an expensive multiply. The +// size is then hard coded by the following #define to match the +// actual size. This make it somewhat tedious when COPYU macro gets +// changed and this need to be adjusted to match. +#define LOOP_SIZE 6 +1: + mov r29=ip // jmp_table thread + mov ar.lc=cnt + ;; + add r29=.jump_table - 1b - (.jmp1-.jump_table), r29 + shl r28=r30, LOOP_SIZE // jmp_table thread + mov ar.ec=2 // loop setup + ;; + add r29=r29,r28 // jmp_table thread + cmp.eq p16,p17=r0,r0 + ;; + mov b6=r29 // jmp_table thread + ;; + br.cond.sptk.few b6 + +// for 8-15 byte case +// We will skip the loop, but need to replicate the side effect +// that the loop produces. +.noloop: +EX(.ex_handler, (p6) ld8 r37=[src1],8) + add src0=8,src0 +(p6) shl r25=r30,3 + ;; +EX(.ex_handler, (p6) ld8 r27=[src1]) +(p6) shr.u r28=r37,r25 +(p6) sub r26=64,r25 + ;; +(p6) shl r27=r27,r26 + ;; +(p6) or r21=r28,r27 + +.unaligned_src_tail: +/* check if we have more than blocksize to copy, if so go back */ + cmp.gt p8,p0=saved_in2,blocksize + ;; +(p8) add dst0=saved_in0,blocksize +(p8) add src0=saved_in1,blocksize +(p8) sub in2=saved_in2,blocksize +(p8) br.dpnt .4k_block + ;; + +/* we have up to 15 byte to copy in the tail. + * part of work is already done in the jump table code + * we are at the following state. + * src side: + * + * xxxxxx xx <----- r21 has xxxxxxxx already + * -------- -------- -------- + * 0 8 16 + * ^ + * | + * src1 + * + * dst + * -------- -------- -------- + * ^ + * | + * dst1 + */ +EX(.ex_handler, (p6) st8 [dst1]=r21,8) // more than 8 byte to copy +(p6) add curlen=-8,curlen // update length + mov ar.pfs=saved_pfs + ;; + mov ar.lc=saved_lc + mov pr=saved_pr,-1 + mov in2=curlen // remaining length + mov dst0=dst1 // dest pointer + add src0=src1,r30 // forward by src alignment + ;; + +// 7 byte or smaller. +.memcpy_short: + cmp.le p8,p9 = 1,in2 + cmp.le p10,p11 = 2,in2 + cmp.le p12,p13 = 3,in2 + cmp.le p14,p15 = 4,in2 + add src1=1,src0 // second src pointer + add dst1=1,dst0 // second dest pointer + ;; + +EX(.ex_handler_short, (p8) ld1 t1=[src0],2) +EK(.ex_handler_short, (p10) ld1 t2=[src1],2) +(p9) br.ret.dpnt rp // 0 byte copy + ;; + +EX(.ex_handler_short, (p8) st1 [dst0]=t1,2) +EK(.ex_handler_short, (p10) st1 [dst1]=t2,2) +(p11) br.ret.dpnt rp // 1 byte copy + +EX(.ex_handler_short, (p12) ld1 t3=[src0],2) +EK(.ex_handler_short, (p14) ld1 t4=[src1],2) +(p13) br.ret.dpnt rp // 2 byte copy + ;; + + cmp.le p6,p7 = 5,in2 + cmp.le p8,p9 = 6,in2 + cmp.le p10,p11 = 7,in2 + +EX(.ex_handler_short, (p12) st1 [dst0]=t3,2) +EK(.ex_handler_short, (p14) st1 [dst1]=t4,2) +(p15) br.ret.dpnt rp // 3 byte copy + ;; + +EX(.ex_handler_short, (p6) ld1 t5=[src0],2) +EK(.ex_handler_short, (p8) ld1 t6=[src1],2) +(p7) br.ret.dpnt rp // 4 byte copy + ;; + +EX(.ex_handler_short, (p6) st1 [dst0]=t5,2) +EK(.ex_handler_short, (p8) st1 [dst1]=t6,2) +(p9) br.ret.dptk rp // 5 byte copy + +EX(.ex_handler_short, (p10) ld1 t7=[src0],2) +(p11) br.ret.dptk rp // 6 byte copy + ;; + +EX(.ex_handler_short, (p10) st1 [dst0]=t7,2) + br.ret.dptk rp // done all cases + + +/* Align dest to nearest 8-byte boundary. We know we have at + * least 7 bytes to copy, enough to crawl to 8-byte boundary. + * Actual number of byte to crawl depend on the dest alignment. + * 7 byte or less is taken care at .memcpy_short + + * src0 - source even index + * src1 - source odd index + * dst0 - dest even index + * dst1 - dest odd index + * r30 - distance to 8-byte boundary + */ + +.align_dest: + add src1=1,in1 // source odd index + cmp.le p7,p0 = 2,r30 // for .align_dest + cmp.le p8,p0 = 3,r30 // for .align_dest +EX(.ex_handler_short, (p6) ld1 t1=[src0],2) + cmp.le p9,p0 = 4,r30 // for .align_dest + cmp.le p10,p0 = 5,r30 + ;; +EX(.ex_handler_short, (p7) ld1 t2=[src1],2) +EK(.ex_handler_short, (p8) ld1 t3=[src0],2) + cmp.le p11,p0 = 6,r30 +EX(.ex_handler_short, (p6) st1 [dst0] = t1,2) + cmp.le p12,p0 = 7,r30 + ;; +EX(.ex_handler_short, (p9) ld1 t4=[src1],2) +EK(.ex_handler_short, (p10) ld1 t5=[src0],2) +EX(.ex_handler_short, (p7) st1 [dst1] = t2,2) +EK(.ex_handler_short, (p8) st1 [dst0] = t3,2) + ;; +EX(.ex_handler_short, (p11) ld1 t6=[src1],2) +EK(.ex_handler_short, (p12) ld1 t7=[src0],2) + cmp.eq p6,p7=r28,r29 +EX(.ex_handler_short, (p9) st1 [dst1] = t4,2) +EK(.ex_handler_short, (p10) st1 [dst0] = t5,2) + sub in2=in2,r30 + ;; +EX(.ex_handler_short, (p11) st1 [dst1] = t6,2) +EK(.ex_handler_short, (p12) st1 [dst0] = t7) + add dst0=in0,r30 // setup arguments + add src0=in1,r30 +(p6) br.cond.dptk .aligned_src +(p7) br.cond.dpnt .unaligned_src + ;; + +/* main loop body in jump table format */ +#define COPYU(shift) \ +1: \ +EX(.ex_handler, (p16) ld8 r32=[src0],8); /* 1 */ \ +EK(.ex_handler, (p16) ld8 r36=[src1],8); \ + (p17) shrp r35=r33,r34,shift;; /* 1 */ \ +EX(.ex_handler, (p6) ld8 r22=[src1]); /* common, prime for tail section */ \ + nop.m 0; \ + (p16) shrp r38=r36,r37,shift; \ +EX(.ex_handler, (p17) st8 [dst0]=r35,8); /* 1 */ \ +EK(.ex_handler, (p17) st8 [dst1]=r39,8); \ + br.ctop.dptk.few 1b;; \ + (p7) add src1=-8,src1; /* back out for <8 byte case */ \ + shrp r21=r22,r38,shift; /* speculative work */ \ + br.sptk.few .unaligned_src_tail /* branch out of jump table */ \ + ;; + .align 32 +.jump_table: + COPYU(8) // unaligned cases +.jmp1: + COPYU(16) + COPYU(24) + COPYU(32) + COPYU(40) + COPYU(48) + COPYU(56) + +#undef A +#undef B +#undef C +#undef D +END(memcpy) + +/* + * Due to lack of local tag support in gcc 2.x assembler, it is not clear which + * instruction failed in the bundle. The exception algorithm is that we + * first figure out the faulting address, then detect if there is any + * progress made on the copy, if so, redo the copy from last known copied + * location up to the faulting address (exclusive). In the copy_from_user + * case, remaining byte in kernel buffer will be zeroed. + * + * Take copy_from_user as an example, in the code there are multiple loads + * in a bundle and those multiple loads could span over two pages, the + * faulting address is calculated as page_round_down(max(src0, src1)). + * This is based on knowledge that if we can access one byte in a page, we + * can access any byte in that page. + * + * predicate used in the exception handler: + * p6-p7: direction + * p10-p11: src faulting addr calculation + * p12-p13: dst faulting addr calculation + */ + +#define A r19 +#define B r20 +#define C r21 +#define D r22 +#define F r28 + +#define memset_arg0 r32 +#define memset_arg2 r33 + +#define saved_retval loc0 +#define saved_rtlink loc1 +#define saved_pfs_stack loc2 + +.ex_hndlr_s: + add src0=8,src0 + br.sptk .ex_handler + ;; +.ex_hndlr_d: + add dst0=8,dst0 + br.sptk .ex_handler + ;; +.ex_hndlr_lcpy_1: + mov src1=src_pre_mem + mov dst1=dst_pre_mem + cmp.gtu p10,p11=src_pre_mem,saved_in1 + cmp.gtu p12,p13=dst_pre_mem,saved_in0 + ;; +(p10) add src0=8,saved_in1 +(p11) mov src0=saved_in1 +(p12) add dst0=8,saved_in0 +(p13) mov dst0=saved_in0 + br.sptk .ex_handler +.ex_handler_lcpy: + // in line_copy block, the preload addresses should always ahead + // of the other two src/dst pointers. Furthermore, src1/dst1 should + // always ahead of src0/dst0. + mov src1=src_pre_mem + mov dst1=dst_pre_mem +.ex_handler: + mov pr=saved_pr,-1 // first restore pr, lc, and pfs + mov ar.lc=saved_lc + mov ar.pfs=saved_pfs + ;; +.ex_handler_short: // fault occurred in these sections didn't change pr, lc, pfs + cmp.ltu p6,p7=saved_in0, saved_in1 // get the copy direction + cmp.ltu p10,p11=src0,src1 + cmp.ltu p12,p13=dst0,dst1 + fcmp.eq p8,p0=f6,f0 // is it memcpy? + mov tmp = dst0 + ;; +(p11) mov src1 = src0 // pick the larger of the two +(p13) mov dst0 = dst1 // make dst0 the smaller one +(p13) mov dst1 = tmp // and dst1 the larger one + ;; +(p6) dep F = r0,dst1,0,PAGE_SHIFT // usr dst round down to page boundary +(p7) dep F = r0,src1,0,PAGE_SHIFT // usr src round down to page boundary + ;; +(p6) cmp.le p14,p0=dst0,saved_in0 // no progress has been made on store +(p7) cmp.le p14,p0=src0,saved_in1 // no progress has been made on load + mov retval=saved_in2 +(p8) ld1 tmp=[src1] // force an oops for memcpy call +(p8) st1 [dst1]=r0 // force an oops for memcpy call +(p14) br.ret.sptk.many rp + +/* + * The remaining byte to copy is calculated as: + * + * A = (faulting_addr - orig_src) -> len to faulting ld address + * or + * (faulting_addr - orig_dst) -> len to faulting st address + * B = (cur_dst - orig_dst) -> len copied so far + * C = A - B -> len need to be copied + * D = orig_len - A -> len need to be zeroed + */ +(p6) sub A = F, saved_in0 +(p7) sub A = F, saved_in1 + clrrrb + ;; + alloc saved_pfs_stack=ar.pfs,3,3,3,0 + sub B = dst0, saved_in0 // how many byte copied so far + ;; + sub C = A, B + sub D = saved_in2, A + ;; + cmp.gt p8,p0=C,r0 // more than 1 byte? + add memset_arg0=saved_in0, A +(p6) mov memset_arg2=0 // copy_to_user should not call memset +(p7) mov memset_arg2=D // copy_from_user need to have kbuf zeroed + mov r8=0 + mov saved_retval = D + mov saved_rtlink = b0 + + add out0=saved_in0, B + add out1=saved_in1, B + mov out2=C +(p8) br.call.sptk.few b0=__copy_user // recursive call + ;; + + add saved_retval=saved_retval,r8 // above might return non-zero value + cmp.gt p8,p0=memset_arg2,r0 // more than 1 byte? + mov out0=memset_arg0 // *s + mov out1=r0 // c + mov out2=memset_arg2 // n +(p8) br.call.sptk.few b0=memset + ;; + + mov retval=saved_retval + mov ar.pfs=saved_pfs_stack + mov b0=saved_rtlink + br.ret.sptk.many rp + +/* end of McKinley specific optimization */ +END(__copy_user) diff -urN linux-2.4.18/arch/ia64/lib/memset.S lia64-2.4/arch/ia64/lib/memset.S --- linux-2.4.18/arch/ia64/lib/memset.S Mon Nov 26 11:18:24 2001 +++ lia64-2.4/arch/ia64/lib/memset.S Thu Apr 25 18:23:52 2002 @@ -1,108 +1,362 @@ -/* - * - * Optimized version of the standard memset() function - * - * Return: none - * - * Inputs: - * in0: address of buffer - * in1: byte value to use for storing - * in2: length of the buffer - * - * Copyright (C) 1999, 2001 Hewlett-Packard Co - * Copyright (C) 1999 Stephane Eranian - */ +/* Optimized version of the standard memset() function. + + Copyright (c) 2002 Hewlett-Packard Co/CERN + Sverre Jarp + + Return: dest + + Inputs: + in0: dest + in1: value + in2: count + + The algorithm is fairly straightforward: set byte by byte until we + we get to a 16B-aligned address, then loop on 128 B chunks using an + early store as prefetching, then loop on 32B chucks, then clear remaining + words, finally clear remaining bytes. + Since a stf.spill f0 can store 16B in one go, we use this instruction + to get peak speed when value = 0. */ #include +#undef ret + +#define dest in0 +#define value in1 +#define cnt in2 -// arguments -// -#define buf r32 -#define val r33 -#define len r34 - -// -// local registers -// -#define saved_pfs r14 -#define cnt r18 -#define buf2 r19 -#define saved_lc r20 -#define tmp r21 +#define tmp r31 +#define save_lc r30 +#define ptr0 r29 +#define ptr1 r28 +#define ptr2 r27 +#define ptr3 r26 +#define ptr9 r24 +#define loopcnt r23 +#define linecnt r22 +#define bytecnt r21 + +#define fvalue f6 + +// This routine uses only scratch predicate registers (p6 - p15) +#define p_scr p6 // default register for same-cycle branches +#define p_nz p7 +#define p_zr p8 +#define p_unalgn p9 +#define p_y p11 +#define p_n p12 +#define p_yy p13 +#define p_nn p14 + +#define MIN1 15 +#define MIN1P1HALF 8 +#define LINE_SIZE 128 +#define LSIZE_SH 7 // shift amount +#define PREF_AHEAD 8 GLOBAL_ENTRY(memset) +{ .mmi .prologue - .save ar.pfs, saved_pfs - alloc saved_pfs=ar.pfs,3,0,0,0 // cnt is sink here - cmp.eq p8,p0=r0,len // check for zero length - .save ar.lc, saved_lc - mov saved_lc=ar.lc // preserve ar.lc (slow) - ;; - + alloc tmp = ar.pfs, 3, 0, 0, 0 .body + lfetch.nt1 [dest] // + .save ar.lc, save_lc + mov.i save_lc = ar.lc +} { .mmi + mov ret0 = dest // return value + cmp.ne p_nz, p_zr = value, r0 // use stf.spill if value is zero + cmp.eq p_scr, p0 = cnt, r0 +;; } +{ .mmi + and ptr2 = -(MIN1+1), dest // aligned address + and tmp = MIN1, dest // prepare to check for correct alignment + tbit.nz p_y, p_n = dest, 0 // Do we have an odd address? (M_B_U) +} { .mib + mov ptr1 = dest + mux1 value = value, @brcst // create 8 identical bytes in word +(p_scr) br.ret.dpnt.many rp // return immediately if count = 0 +;; } +{ .mib + cmp.ne p_unalgn, p0 = tmp, r0 // +} { .mib + sub bytecnt = (MIN1+1), tmp // NB: # of bytes to move is 1 higher than loopcnt + cmp.gt p_scr, p0 = 16, cnt // is it a minimalistic task? +(p_scr) br.cond.dptk.many .move_bytes_unaligned // go move just a few (M_B_U) +;; } +{ .mmi +(p_unalgn) add ptr1 = (MIN1+1), ptr2 // after alignment +(p_unalgn) add ptr2 = MIN1P1HALF, ptr2 // after alignment +(p_unalgn) tbit.nz.unc p_y, p_n = bytecnt, 3 // should we do a st8 ? +;; } +{ .mib +(p_y) add cnt = -8, cnt // +(p_unalgn) tbit.nz.unc p_yy, p_nn = bytecnt, 2 // should we do a st4 ? +} { .mib +(p_y) st8 [ptr2] = value,-4 // +(p_n) add ptr2 = 4, ptr2 // +;; } +{ .mib +(p_yy) add cnt = -4, cnt // +(p_unalgn) tbit.nz.unc p_y, p_n = bytecnt, 1 // should we do a st2 ? +} { .mib +(p_yy) st4 [ptr2] = value,-2 // +(p_nn) add ptr2 = 2, ptr2 // +;; } +{ .mmi + mov tmp = LINE_SIZE+1 // for compare +(p_y) add cnt = -2, cnt // +(p_unalgn) tbit.nz.unc p_yy, p_nn = bytecnt, 0 // should we do a st1 ? +} { .mmi + setf.sig fvalue=value // transfer value to FLP side +(p_y) st2 [ptr2] = value,-1 // +(p_n) add ptr2 = 1, ptr2 // +;; } + +{ .mmi +(p_yy) st1 [ptr2] = value // + cmp.gt p_scr, p0 = tmp, cnt // is it a minimalistic task? +} { .mbb +(p_yy) add cnt = -1, cnt // +(p_scr) br.cond.dpnt.many .fraction_of_line // go move just a few +;; } + +{ .mib + nop.m 0 + shr.u linecnt = cnt, LSIZE_SH +(p_zr) br.cond.dptk.many .l1b // Jump to use stf.spill +;; } + + .align 32 // -------------------------- // L1A: store ahead into cache lines; fill later +{ .mmi + and tmp = -(LINE_SIZE), cnt // compute end of range + mov ptr9 = ptr1 // used for prefetching + and cnt = (LINE_SIZE-1), cnt // remainder +} { .mmi + mov loopcnt = PREF_AHEAD-1 // default prefetch loop + cmp.gt p_scr, p0 = PREF_AHEAD, linecnt // check against actual value +;; } +{ .mmi +(p_scr) add loopcnt = -1, linecnt // + add ptr2 = 8, ptr1 // start of stores (beyond prefetch stores) + add ptr1 = tmp, ptr1 // first address beyond total range +;; } +{ .mmi + add tmp = -1, linecnt // next loop count + mov.i ar.lc = loopcnt // +;; } +.pref_l1a: +{ .mib + stf8 [ptr9] = fvalue, 128 // Do stores one cache line apart + nop.i 0 + br.cloop.dptk.few .pref_l1a +;; } +{ .mmi + add ptr0 = 16, ptr2 // Two stores in parallel + mov.i ar.lc = tmp // +;; } +.l1ax: + { .mmi + stf8 [ptr2] = fvalue, 8 + stf8 [ptr0] = fvalue, 8 + ;; } + { .mmi + stf8 [ptr2] = fvalue, 24 + stf8 [ptr0] = fvalue, 24 + ;; } + { .mmi + stf8 [ptr2] = fvalue, 8 + stf8 [ptr0] = fvalue, 8 + ;; } + { .mmi + stf8 [ptr2] = fvalue, 24 + stf8 [ptr0] = fvalue, 24 + ;; } + { .mmi + stf8 [ptr2] = fvalue, 8 + stf8 [ptr0] = fvalue, 8 + ;; } + { .mmi + stf8 [ptr2] = fvalue, 24 + stf8 [ptr0] = fvalue, 24 + ;; } + { .mmi + stf8 [ptr2] = fvalue, 8 + stf8 [ptr0] = fvalue, 32 + cmp.lt p_scr, p0 = ptr9, ptr1 // do we need more prefetching? + ;; } +{ .mmb + stf8 [ptr2] = fvalue, 24 +(p_scr) stf8 [ptr9] = fvalue, 128 + br.cloop.dptk.few .l1ax +;; } +{ .mbb + cmp.le p_scr, p0 = 8, cnt // just a few bytes left ? +(p_scr) br.cond.dpnt.many .fraction_of_line // Branch no. 2 + br.cond.dpnt.many .move_bytes_from_alignment // Branch no. 3 +;; } + + .align 32 +.l1b: // ------------------------------------ // L1B: store ahead into cache lines; fill later +{ .mmi + and tmp = -(LINE_SIZE), cnt // compute end of range + mov ptr9 = ptr1 // used for prefetching + and cnt = (LINE_SIZE-1), cnt // remainder +} { .mmi + mov loopcnt = PREF_AHEAD-1 // default prefetch loop + cmp.gt p_scr, p0 = PREF_AHEAD, linecnt // check against actual value +;; } +{ .mmi +(p_scr) add loopcnt = -1, linecnt + add ptr2 = 16, ptr1 // start of stores (beyond prefetch stores) + add ptr1 = tmp, ptr1 // first address beyond total range +;; } +{ .mmi + add tmp = -1, linecnt // next loop count + mov.i ar.lc = loopcnt +;; } +.pref_l1b: +{ .mib + stf.spill [ptr9] = f0, 128 // Do stores one cache line apart + nop.i 0 + br.cloop.dptk.few .pref_l1b +;; } +{ .mmi + add ptr0 = 16, ptr2 // Two stores in parallel + mov.i ar.lc = tmp +;; } +.l1bx: + { .mmi + stf.spill [ptr2] = f0, 32 + stf.spill [ptr0] = f0, 32 + ;; } + { .mmi + stf.spill [ptr2] = f0, 32 + stf.spill [ptr0] = f0, 32 + ;; } + { .mmi + stf.spill [ptr2] = f0, 32 + stf.spill [ptr0] = f0, 64 + cmp.lt p_scr, p0 = ptr9, ptr1 // do we need more prefetching? + ;; } +{ .mmb + stf.spill [ptr2] = f0, 32 +(p_scr) stf.spill [ptr9] = f0, 128 + br.cloop.dptk.few .l1bx +;; } +{ .mib + cmp.gt p_scr, p0 = 8, cnt // just a few bytes left ? +(p_scr) br.cond.dpnt.many .move_bytes_from_alignment // +;; } + +.fraction_of_line: +{ .mib + add ptr2 = 16, ptr1 + shr.u loopcnt = cnt, 5 // loopcnt = cnt / 32 +;; } +{ .mib + cmp.eq p_scr, p0 = loopcnt, r0 + add loopcnt = -1, loopcnt +(p_scr) br.cond.dpnt.many .store_words +;; } +{ .mib + and cnt = 0x1f, cnt // compute the remaining cnt + mov.i ar.lc = loopcnt +;; } + .align 32 +.l2: // ------------------------------------ // L2A: store 32B in 2 cycles +{ .mmb + stf8 [ptr1] = fvalue, 8 + stf8 [ptr2] = fvalue, 8 +;; } { .mmb + stf8 [ptr1] = fvalue, 24 + stf8 [ptr2] = fvalue, 24 + br.cloop.dptk.many .l2 +;; } +.store_words: +{ .mib + cmp.gt p_scr, p0 = 8, cnt // just a few bytes left ? +(p_scr) br.cond.dpnt.many .move_bytes_from_alignment // Branch +;; } + +{ .mmi + stf8 [ptr1] = fvalue, 8 // store + cmp.le p_y, p_n = 16, cnt + add cnt = -8, cnt // subtract +;; } +{ .mmi +(p_y) stf8 [ptr1] = fvalue, 8 // store +(p_y) cmp.le.unc p_yy, p_nn = 16, cnt +(p_y) add cnt = -8, cnt // subtract +;; } +{ .mmi // store +(p_yy) stf8 [ptr1] = fvalue, 8 +(p_yy) add cnt = -8, cnt // subtract +;; } + +.move_bytes_from_alignment: +{ .mib + cmp.eq p_scr, p0 = cnt, r0 + tbit.nz.unc p_y, p0 = cnt, 2 // should we terminate with a st4 ? +(p_scr) br.cond.dpnt.few .restore_and_exit +;; } +{ .mib +(p_y) st4 [ptr1] = value,4 + tbit.nz.unc p_yy, p0 = cnt, 1 // should we terminate with a st2 ? +;; } +{ .mib +(p_yy) st2 [ptr1] = value,2 + tbit.nz.unc p_y, p0 = cnt, 0 // should we terminate with a st1 ? +;; } + +{ .mib +(p_y) st1 [ptr1] = value +;; } +.restore_and_exit: +{ .mib + nop.m 0 + mov.i ar.lc = save_lc + br.ret.sptk.many rp +;; } - adds tmp=-1,len // br.ctop is repeat/until - tbit.nz p6,p0=buf,0 // odd alignment -(p8) br.ret.spnt.many rp - - cmp.lt p7,p0=16,len // if len > 16 then long memset - mux1 val=val,@brcst // prepare value -(p7) br.cond.dptk .long_memset - ;; - mov ar.lc=tmp // initialize lc for small count - ;; // avoid RAW and WAW on ar.lc -1: // worst case 15 cyles, avg 8 cycles - st1 [buf]=val,1 - br.cloop.dptk.few 1b - ;; // avoid RAW on ar.lc - mov ar.lc=saved_lc - mov ar.pfs=saved_pfs - br.ret.sptk.many rp // end of short memset - - // at this point we know we have more than 16 bytes to copy - // so we focus on alignment -.long_memset: -(p6) st1 [buf]=val,1 // 1-byte aligned -(p6) adds len=-1,len;; // sync because buf is modified - tbit.nz p6,p0=buf,1 - ;; -(p6) st2 [buf]=val,2 // 2-byte aligned -(p6) adds len=-2,len;; - tbit.nz p6,p0=buf,2 - ;; -(p6) st4 [buf]=val,4 // 4-byte aligned -(p6) adds len=-4,len;; - tbit.nz p6,p0=buf,3 - ;; -(p6) st8 [buf]=val,8 // 8-byte aligned -(p6) adds len=-8,len;; - shr.u cnt=len,4 // number of 128-bit (2x64bit) words - ;; - cmp.eq p6,p0=r0,cnt - adds tmp=-1,cnt -(p6) br.cond.dpnt .dotail // we have less than 16 bytes left - ;; - adds buf2=8,buf // setup second base pointer - mov ar.lc=tmp - ;; -2: // 16bytes/iteration - st8 [buf]=val,16 - st8 [buf2]=val,16 - br.cloop.dptk.few 2b - ;; -.dotail: // tail correction based on len only - tbit.nz p6,p0=len,3 - ;; -(p6) st8 [buf]=val,8 // at least 8 bytes - tbit.nz p6,p0=len,2 - ;; -(p6) st4 [buf]=val,4 // at least 4 bytes - tbit.nz p6,p0=len,1 - ;; -(p6) st2 [buf]=val,2 // at least 2 bytes - tbit.nz p6,p0=len,0 - mov ar.lc=saved_lc - ;; -(p6) st1 [buf]=val // only 1 byte left +.move_bytes_unaligned: +{ .mmi + .pred.rel "mutex",p_y, p_n + .pred.rel "mutex",p_yy, p_nn +(p_n) cmp.le p_yy, p_nn = 4, cnt +(p_y) cmp.le p_yy, p_nn = 5, cnt +(p_n) add ptr2 = 2, ptr1 +} { .mmi +(p_y) add ptr2 = 3, ptr1 +(p_y) st1 [ptr1] = value, 1 // fill 1 (odd-aligned) byte [15, 14 (or less) left] +(p_y) add cnt = -1, cnt +;; } +{ .mmi +(p_yy) cmp.le.unc p_y, p0 = 8, cnt + add ptr3 = ptr1, cnt // prepare last store + mov.i ar.lc = save_lc +} { .mmi +(p_yy) st2 [ptr1] = value, 4 // fill 2 (aligned) bytes +(p_yy) st2 [ptr2] = value, 4 // fill 2 (aligned) bytes [11, 10 (o less) left] +(p_yy) add cnt = -4, cnt +;; } +{ .mmi +(p_y) cmp.le.unc p_yy, p0 = 8, cnt + add ptr3 = -1, ptr3 // last store + tbit.nz p_scr, p0 = cnt, 1 // will there be a st2 at the end ? +} { .mmi +(p_y) st2 [ptr1] = value, 4 // fill 2 (aligned) bytes +(p_y) st2 [ptr2] = value, 4 // fill 2 (aligned) bytes [7, 6 (or less) left] +(p_y) add cnt = -4, cnt +;; } +{ .mmi +(p_yy) st2 [ptr1] = value, 4 // fill 2 (aligned) bytes +(p_yy) st2 [ptr2] = value, 4 // fill 2 (aligned) bytes [3, 2 (or less) left] + tbit.nz p_y, p0 = cnt, 0 // will there be a st1 at the end ? +} { .mmi +(p_yy) add cnt = -4, cnt +;; } +{ .mmb +(p_scr) st2 [ptr1] = value // fill 2 (aligned) bytes +(p_y) st1 [ptr3] = value // fill last byte (using ptr3) br.ret.sptk.many rp +} END(memset) diff -urN linux-2.4.18/arch/ia64/lib/swiotlb.c lia64-2.4/arch/ia64/lib/swiotlb.c --- linux-2.4.18/arch/ia64/lib/swiotlb.c Mon Nov 26 11:18:25 2001 +++ lia64-2.4/arch/ia64/lib/swiotlb.c Fri Apr 26 17:15:30 2002 @@ -27,11 +27,21 @@ #define ALIGN(val, align) ((unsigned long) \ (((unsigned long) (val) + ((align) - 1)) & ~((align) - 1))) +#define OFFSET(val,align) ((unsigned long) \ + ( (val) & ( (align) - 1))) + #define SG_ENT_VIRT_ADDRESS(sg) ((sg)->address ? (sg)->address \ : page_address((sg)->page) + (sg)->offset) #define SG_ENT_PHYS_ADDRESS(SG) virt_to_phys(SG_ENT_VIRT_ADDRESS(SG)) /* + * Maximum allowable number of contiguous slabs to map, + * must be a power of 2. What is the appropriate value ? + * The complexity of {map,unmap}_single is linearly dependent on this value. + */ +#define IO_TLB_SEGSIZE 128 + +/* * log of the size of each IO TLB slab. The number of slabs is command line controllable. */ #define IO_TLB_SHIFT 11 @@ -69,10 +79,15 @@ setup_io_tlb_npages (char *str) { io_tlb_nslabs = simple_strtoul(str, NULL, 0) << (PAGE_SHIFT - IO_TLB_SHIFT); + + /* avoid tail segment of size < IO_TLB_SEGSIZE */ + io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE); + return 1; } __setup("swiotlb=", setup_io_tlb_npages); + /* * Statically reserve bounce buffer space and initialize bounce buffer data structures for * the software IO TLB used to implement the PCI DMA API. @@ -92,12 +107,12 @@ /* * Allocate and initialize the free list array. This array is used - * to find contiguous free memory regions of size 2^IO_TLB_SHIFT between - * io_tlb_start and io_tlb_end. + * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE + * between io_tlb_start and io_tlb_end. */ io_tlb_list = alloc_bootmem(io_tlb_nslabs * sizeof(int)); for (i = 0; i < io_tlb_nslabs; i++) - io_tlb_list[i] = io_tlb_nslabs - i; + io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE); io_tlb_index = 0; io_tlb_orig_addr = alloc_bootmem(io_tlb_nslabs * sizeof(char *)); @@ -124,7 +139,7 @@ if (size > (1 << PAGE_SHIFT)) stride = (1 << (PAGE_SHIFT - IO_TLB_SHIFT)); else - stride = nslots; + stride = 1; if (!nslots) BUG(); @@ -151,7 +166,8 @@ for (i = index; i < index + nslots; i++) io_tlb_list[i] = 0; - for (i = index - 1; (i >= 0) && io_tlb_list[i]; i--) + for (i = index - 1; (OFFSET(i, IO_TLB_SEGSIZE) != IO_TLB_SEGSIZE -1) + && io_tlb_list[i]; i--) io_tlb_list[i] = ++count; dma_addr = io_tlb_start + (index << IO_TLB_SHIFT); @@ -217,7 +233,8 @@ */ spin_lock_irqsave(&io_tlb_lock, flags); { - int count = ((index + nslots) < io_tlb_nslabs ? io_tlb_list[index + nslots] : 0); + int count = ((index + nslots) < ALIGN(index + 1, IO_TLB_SEGSIZE) ? + io_tlb_list[index + nslots] : 0); /* * Step 1: return the slots to the free list, merging the slots with * superceeding slots @@ -228,7 +245,8 @@ * Step 2: merge the returned slots with the preceeding slots, if * available (non zero) */ - for (i = index - 1; (i >= 0) && io_tlb_list[i]; i--) + for (i = index - 1; (OFFSET(i, IO_TLB_SEGSIZE) != IO_TLB_SEGSIZE -1) && + io_tlb_list[i]; i--) io_tlb_list[i] = ++count; } spin_unlock_irqrestore(&io_tlb_lock, flags); @@ -259,8 +277,11 @@ int gfp = GFP_ATOMIC; void *ret; - if (!hwdev || hwdev->dma_mask <= 0xffffffff) - gfp |= GFP_DMA; /* XXX fix me: should change this to GFP_32BIT or ZONE_32BIT */ + /* + * Alloc_consistent() is defined to return memory < 4GB, no matter what the DMA + * mask says. + */ + gfp |= GFP_DMA; /* XXX fix me: should change this to GFP_32BIT or ZONE_32BIT */ ret = (void *)__get_free_pages(gfp, get_order(size)); if (!ret) return NULL; @@ -405,11 +426,13 @@ for (i = 0; i < nelems; i++, sg++) { sg->orig_address = SG_ENT_VIRT_ADDRESS(sg); if ((SG_ENT_PHYS_ADDRESS(sg) & ~hwdev->dma_mask) != 0) { - addr = map_single(hwdev, sg->address, sg->length, direction); + addr = map_single(hwdev, sg->orig_address, sg->length, direction); if (sg->address) sg->address = addr; - else + else { sg->page = virt_to_page(addr); + sg->offset = (u64) addr & ~PAGE_MASK; + } } } return nelems; @@ -432,10 +455,12 @@ unmap_single(hwdev, SG_ENT_VIRT_ADDRESS(sg), sg->length, direction); if (sg->address) sg->address = sg->orig_address; - else + else { sg->page = virt_to_page(sg->orig_address); + sg->offset = (u64) sg->orig_address & ~PAGE_MASK; + } } else if (direction == PCI_DMA_FROMDEVICE) - mark_clean(sg->address, sg->length); + mark_clean(SG_ENT_VIRT_ADDRESS(sg), sg->length); } /* @@ -464,6 +489,17 @@ return SG_ENT_PHYS_ADDRESS(sg); } +/* + * Return whether the given PCI device DMA address mask can be supported properly. For + * example, if your device can only drive the low 24-bits during PCI bus mastering, then + * you would pass 0x00ffffff as the mask to this function. + */ +int +swiotlb_pci_dma_supported (struct pci_dev *hwdev, u64 mask) +{ + return 1; +} + EXPORT_SYMBOL(swiotlb_init); EXPORT_SYMBOL(swiotlb_map_single); EXPORT_SYMBOL(swiotlb_unmap_single); @@ -474,3 +510,4 @@ EXPORT_SYMBOL(swiotlb_dma_address); EXPORT_SYMBOL(swiotlb_alloc_consistent); EXPORT_SYMBOL(swiotlb_free_consistent); +EXPORT_SYMBOL(swiotlb_pci_dma_supported); diff -urN linux-2.4.18/arch/ia64/mm/extable.c lia64-2.4/arch/ia64/mm/extable.c --- linux-2.4.18/arch/ia64/mm/extable.c Tue Jul 31 10:30:08 2001 +++ lia64-2.4/arch/ia64/mm/extable.c Wed Feb 20 14:50:46 2002 @@ -1,8 +1,8 @@ /* * Kernel exception handling table support. Derived from arch/alpha/mm/extable.c. * - * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co - * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang + * Copyright (C) 1998, 1999, 2001-2002 Hewlett-Packard Co + * David Mosberger-Tang */ #include @@ -55,10 +55,12 @@ struct module *mp; /* The kernel is the last "module" -- no need to treat it special. */ - for (mp = module_list; mp ; mp = mp->next) { + for (mp = module_list; mp; mp = mp->next) { if (!mp->ex_table_start) continue; archdata = (struct archdata *) mp->archdata_start; + if (!archdata) + continue; entry = search_one_table(mp->ex_table_start, mp->ex_table_end - 1, addr, (unsigned long) archdata->gp); if (entry) { diff -urN linux-2.4.18/arch/ia64/mm/fault.c lia64-2.4/arch/ia64/mm/fault.c --- linux-2.4.18/arch/ia64/mm/fault.c Mon Nov 26 11:18:25 2001 +++ lia64-2.4/arch/ia64/mm/fault.c Sat May 4 00:15:24 2002 @@ -1,7 +1,7 @@ /* * MMU fault handling support. * - * Copyright (C) 1998-2001 Hewlett-Packard Co + * Copyright (C) 1998-2002 Hewlett-Packard Co * David Mosberger-Tang */ #include @@ -49,7 +49,6 @@ int signal = SIGSEGV, code = SEGV_MAPERR; struct vm_area_struct *vma, *prev_vma; struct mm_struct *mm = current->mm; - struct exception_fixup fix; struct siginfo si; unsigned long mask; @@ -59,6 +58,17 @@ if (in_interrupt() || !mm) goto no_context; +#ifdef CONFIG_VIRTUAL_MEM_MAP + /* + * If fault is in region 5 and we are in the kernel, we may already + * have the mmap_sem (VALID_PAGE macro is called during mmap). There + * should be no vma for region 5 addr's anyway, so skip getting the + * semaphore and go directly to the code that handles a bad area. + */ + if ((REGION_NUMBER(address) == 5) && !user_mode(regs)) + goto bad_area_no_up; +#endif + down_read(&mm->mmap_sem); vma = find_vma_prev(mm, address, &prev_vma); @@ -96,7 +106,7 @@ * sure we exit gracefully rather than endlessly redo the * fault. */ - switch (handle_mm_fault(mm, vma, address, mask)) { + switch (handle_mm_fault(mm, vma, address, (mask & VM_WRITE) != 0)) { case 1: ++current->min_flt; break; @@ -138,10 +148,16 @@ bad_area: up_read(&mm->mmap_sem); - if (isr & IA64_ISR_SP) { +#ifdef CONFIG_VIRTUAL_MEM_MAP + bad_area_no_up: +#endif + if ((isr & IA64_ISR_SP) + || ((isr & IA64_ISR_NA) && (isr & IA64_ISR_CODE_MASK) == IA64_ISR_CODE_LFETCH)) + { /* - * This fault was due to a speculative load set the "ed" bit in the psr to - * ensure forward progress (target register will get a NaT). + * This fault was due to a speculative load or lfetch.fault, set the "ed" + * bit in the psr to ensure forward progress. (Target register will get a + * NaT for ld.s, lfetch will be canceled.) */ ia64_psr(regs)->ed = 1; return; @@ -151,6 +167,8 @@ si.si_errno = 0; si.si_code = code; si.si_addr = (void *) address; + si.si_isr = isr; + si.si_flags = __ISR_VALID; force_sig_info(signal, &si, current); return; } @@ -165,15 +183,8 @@ return; } -#ifdef GAS_HAS_LOCAL_TAGS - fix = search_exception_table(regs->cr_iip + ia64_psr(regs)->ri); -#else - fix = search_exception_table(regs->cr_iip); -#endif - if (fix.cont) { - handle_exception(regs, fix); + if (done_with_exception(regs)) return; - } /* * Oops. The kernel tried to access some bad page. We'll have to terminate things diff -urN linux-2.4.18/arch/ia64/mm/init.c lia64-2.4/arch/ia64/mm/init.c --- linux-2.4.18/arch/ia64/mm/init.c Mon Nov 26 11:18:25 2001 +++ lia64-2.4/arch/ia64/mm/init.c Fri Jul 19 23:09:38 2002 @@ -1,8 +1,8 @@ /* * Initialize MMU support. * - * Copyright (C) 1998-2001 Hewlett-Packard Co - * Copyright (C) 1998-2001 David Mosberger-Tang + * Copyright (C) 1998-2002 Hewlett-Packard Co + * David Mosberger-Tang */ #include #include @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -37,6 +38,13 @@ static unsigned long totalram_pages; +#ifdef CONFIG_VIRTUAL_MEM_MAP +unsigned long vmalloc_end = VMALLOC_END_INIT; + +static struct page *vmem_map; +static unsigned long num_dma_physpages; +#endif + int do_check_pgt_cache (int low, int high) { @@ -67,10 +75,9 @@ struct vm_area_struct *vma; /* - * If we're out of memory and kmem_cache_alloc() returns NULL, - * we simply ignore the problem. When the process attempts to - * write to the register backing store for the first time, it - * will get a SEGFAULT in this case. + * If we're out of memory and kmem_cache_alloc() returns NULL, we simply ignore + * the problem. When the process attempts to write to the register backing store + * for the first time, it will get a SEGFAULT in this case. */ vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); if (vma) { @@ -85,6 +92,19 @@ vma->vm_private_data = NULL; insert_vm_struct(current->mm, vma); } + + /* map NaT-page at address zero to speed up speculative dereferencing of NULL: */ + if (!(current->personality & MMAP_PAGE_ZERO)) { + vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); + if (vma) { + memset(vma, 0, sizeof(*vma)); + vma->vm_mm = current->mm; + vma->vm_end = PAGE_SIZE; + vma->vm_page_prot = __pgprot(pgprot_val(PAGE_READONLY) | _PAGE_MA_NAT); + vma->vm_flags = VM_READ | VM_MAYREAD | VM_IO | VM_RESERVED; + insert_vm_struct(current->mm, vma); + } + } } void @@ -204,6 +224,8 @@ printk("Free swap: %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); i = max_mapnr; while (i-- > 0) { + if (!VALID_PAGE(mem_map + i)) + continue; total++; if (PageReserved(mem_map+i)) reserved++; @@ -261,7 +283,7 @@ void __init ia64_mmu_init (void *my_cpu_data) { - unsigned long flags, rid, pta, impl_va_bits; + unsigned long psr, rid, pta, impl_va_bits; extern void __init tlb_init (void); #ifdef CONFIG_DISABLE_VHPT # define VHPT_ENABLE_BIT 0 @@ -273,7 +295,7 @@ * Set up the kernel identity mapping for regions 6 and 5. The mapping for region * 7 is setup up in _start(). */ - ia64_clear_ic(flags); + psr = ia64_clear_ic(); rid = ia64_rid(IA64_REGION_ID_KERNEL, __IA64_UNCACHED_OFFSET); ia64_set_rr(__IA64_UNCACHED_OFFSET, (rid << 8) | (IA64_GRANULE_SHIFT << 2)); @@ -287,7 +309,7 @@ ia64_itr(0x2, IA64_TR_PERCPU_DATA, PERCPU_ADDR, pte_val(mk_pte_phys(__pa(my_cpu_data), PAGE_KERNEL)), PAGE_SHIFT); - __restore_flags(flags); + ia64_set_psr(psr); ia64_srlz_i(); /* @@ -335,6 +357,158 @@ ia64_tlb_init(); } +#ifdef CONFIG_VIRTUAL_MEM_MAP + +#include + +static int +create_mem_map_page_table (u64 start, u64 end, void *arg) +{ + unsigned long address, start_page, end_page; + struct page *map_start, *map_end; + pgd_t *pgd; + pmd_t *pmd; + pte_t *pte; + + /* should we use platform_map_nr here? */ + + map_start = vmem_map + MAP_NR_DENSE(start); + map_end = vmem_map + MAP_NR_DENSE(end); + + start_page = (unsigned long) map_start & PAGE_MASK; + end_page = PAGE_ALIGN((unsigned long) map_end); + + for (address = start_page; address < end_page; address += PAGE_SIZE) { + pgd = pgd_offset_k(address); + if (pgd_none(*pgd)) + pgd_populate(&init_mm, pgd, alloc_bootmem_pages(PAGE_SIZE)); + pmd = pmd_offset(pgd, address); + + if (pmd_none(*pmd)) + pmd_populate(&init_mm, pmd, alloc_bootmem_pages(PAGE_SIZE)); + pte = pte_offset(pmd, address); + + if (pte_none(*pte)) + set_pte(pte, mk_pte_phys(__pa(alloc_bootmem_pages(PAGE_SIZE)), + PAGE_KERNEL)); + } + return 0; +} + +static int +virtual_memmap_init (u64 start, u64 end, void *arg) +{ + struct page *map_start, *map_end; + + /* Should we use platform_map_nr here? */ + + map_start = vmem_map + MAP_NR_DENSE(start); + map_end = vmem_map + MAP_NR_DENSE(end); + + /* + * We initialize "out of bounds" struct page elements that fit completely on the + * same pages that were allocated for the "in bounds" struct page elements. + */ + map_start -= ((unsigned long) map_start & (PAGE_SIZE - 1)) / sizeof(struct page); + map_end += ((PAGE_ALIGN((unsigned long) map_end) - (unsigned long) map_end) + / sizeof(struct page)); + + (*(memmap_init_callback_t *)arg)(map_start,map_end); + return 0; +} + +void +arch_memmap_init (memmap_init_callback_t *callback, struct page *start, struct page *end) +{ + if ((start != vmem_map) || (end != vmem_map + max_low_pfn)) + printk(KERN_WARNING "mem_map out of range!\n"); + + efi_memmap_walk(virtual_memmap_init, (void *) callback); +} + +struct zone_callback_data { + memmap_zone_callback_t *callback; + struct page *start; + struct page *end; + zone_t *zone; + unsigned long start_paddr; + int highmem_flag; +}; + +static int +zone_init (u64 start, u64 end, void *arg) +{ + struct page *map_start, *map_end; + struct zone_callback_data *cb_datap = (struct zone_callback_data *)arg; + unsigned long start_paddr; + + /* Should we use platform_map_nr here? */ + + map_start = vmem_map + MAP_NR_DENSE(start); + map_end = vmem_map + MAP_NR_DENSE(end); + + start_paddr = cb_datap->start_paddr; + if (map_start < cb_datap->start) + map_start = cb_datap->start; + else + start_paddr += ((map_start - cb_datap->start) << PAGE_SHIFT); + + if (map_end > cb_datap->end) + map_end = cb_datap->end; + + if (map_start < map_end) { + (*(cb_datap->callback))(map_start, map_end, cb_datap->zone, start_paddr, + cb_datap->highmem_flag); + } + + return 0; +} + +void +arch_memmap_zone_init (memmap_zone_callback_t *callback, struct page *start, struct page *end, + zone_t *zone, unsigned long start_paddr, int highmem_flag) +{ + struct zone_callback_data cb_data; + + cb_data.callback = callback; + cb_data.start = start; + cb_data.end = end; + cb_data.zone = zone; + cb_data.start_paddr = start_paddr; + cb_data.highmem_flag = highmem_flag; + + efi_memmap_walk(zone_init, &cb_data); +} + +static int +count_dma_pages (u64 start, u64 end, void *arg) +{ + unsigned long *count = arg; + + if (end <= MAX_DMA_ADDRESS) + *count += (end - start) >> PAGE_SHIFT; + return 0; +} + +int +ia64_page_valid (struct page *page) +{ + char byte; + + return __get_user(byte, (char *) page) == 0; +} + +#endif /* CONFIG_VIRTUAL_MEM_MAP */ + +static int +count_pages (u64 start, u64 end, void *arg) +{ + unsigned long *count = arg; + + *count += (end - start) >> PAGE_SHIFT; + return 0; +} + /* * Set up the page tables. */ @@ -343,13 +517,49 @@ { unsigned long max_dma, zones_size[MAX_NR_ZONES]; - clear_page((void *) ZERO_PAGE_ADDR); - /* initialize mem_map[] */ memset(zones_size, 0, sizeof(zones_size)); + num_physpages = 0; + efi_memmap_walk(count_pages, &num_physpages); + max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; + +#ifdef CONFIG_VIRTUAL_MEM_MAP + { + unsigned long zholes_size[MAX_NR_ZONES]; + unsigned long map_size; + + memset(zholes_size, 0, sizeof(zholes_size)); + + num_dma_physpages = 0; + efi_memmap_walk(count_dma_pages, &num_dma_physpages); + + if (max_low_pfn < max_dma) { + zones_size[ZONE_DMA] = max_low_pfn; + zholes_size[ZONE_DMA] = max_low_pfn - num_dma_physpages; + } else { + zones_size[ZONE_DMA] = max_dma; + zholes_size[ZONE_DMA] = max_dma - num_dma_physpages; + if (num_physpages > num_dma_physpages) { + zones_size[ZONE_NORMAL] = max_low_pfn - max_dma; + zholes_size[ZONE_NORMAL] = ((max_low_pfn - max_dma) + - (num_physpages - num_dma_physpages)); + } + } + + /* allocate virtual mem_map: */ + + map_size = PAGE_ALIGN(max_low_pfn*sizeof(struct page)); + vmalloc_end -= map_size; + vmem_map = (struct page *) vmalloc_end; + efi_memmap_walk(create_mem_map_page_table, 0); + + free_area_init_node(0, NULL, vmem_map, zones_size, 0, zholes_size); + printk("Virtual mem_map starts at %p\n",mem_map); + } +#else /* !CONFIG_VIRTUAL_MEM_MAP */ if (max_low_pfn < max_dma) zones_size[ZONE_DMA] = max_low_pfn; else { @@ -357,15 +567,7 @@ zones_size[ZONE_NORMAL] = max_low_pfn - max_dma; } free_area_init(zones_size); -} - -static int -count_pages (u64 start, u64 end, void *arg) -{ - unsigned long *count = arg; - - *count += (end - start) >> PAGE_SHIFT; - return 0; +#endif /* !CONFIG_VIRTUAL_MEM_MAP */ } static int @@ -401,9 +603,6 @@ if (!mem_map) BUG(); - num_physpages = 0; - efi_memmap_walk(count_pages, &num_physpages); - max_mapnr = max_low_pfn; high_memory = __va(max_low_pfn * PAGE_SIZE); @@ -418,8 +617,8 @@ printk("Memory: %luk/%luk available (%luk code, %luk reserved, %luk data, %luk init)\n", (unsigned long) nr_free_pages() << (PAGE_SHIFT - 10), - max_mapnr << (PAGE_SHIFT - 10), codesize >> 10, reserved_pages << (PAGE_SHIFT - 10), - datasize >> 10, initsize >> 10); + num_physpages << (PAGE_SHIFT - 10), codesize >> 10, + reserved_pages << (PAGE_SHIFT - 10), datasize >> 10, initsize >> 10); /* * Allow for enough (cached) page table pages so that we can map the entire memory diff -urN linux-2.4.18/arch/ia64/mm/tlb.c lia64-2.4/arch/ia64/mm/tlb.c --- linux-2.4.18/arch/ia64/mm/tlb.c Mon Nov 26 11:18:25 2001 +++ lia64-2.4/arch/ia64/mm/tlb.c Fri Apr 5 16:44:44 2002 @@ -79,7 +79,7 @@ flush_tlb_all(); } -static inline void +void ia64_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbits) { static spinlock_t ptcg_lock = SPIN_LOCK_UNLOCKED; diff -urN linux-2.4.18/arch/ia64/sn/Makefile lia64-2.4/arch/ia64/sn/Makefile --- linux-2.4.18/arch/ia64/sn/Makefile Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/Makefile Wed Dec 31 16:00:00 1969 @@ -1,19 +0,0 @@ -# -# ia64/sn/Makefile -# -# Copyright (C) 1999 Silicon Graphics, Inc. -# Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com) -# - -EXTRA_CFLAGS := -DSN -DLANGUAGE_C=1 -D_LANGUAGE_C=1 -I. -DBRINGUP \ - -DDIRECT_L1_CONSOLE -DNUMA_BASE -DSIMULATED_KLGRAPH \ - -DNUMA_MIGR_CONTROL -DLITTLE_ENDIAN -DREAL_HARDWARE \ - -DNEW_INTERRUPTS -all: sn.a - -O_TARGET = sn.a -obj-y = sn1/sn1.a - -clean:: - -include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-bigsur-mp lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-bigsur-mp --- linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-bigsur-mp Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-bigsur-mp Mon Nov 19 23:22:49 2001 @@ -0,0 +1,777 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_GENERIC is not set +CONFIG_IA64_DIG=y +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_SGI_SN1 is not set +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=6 +# CONFIG_NUMA is not set +# CONFIG_IA64_MCA is not set +CONFIG_PM=y +CONFIG_IA64_HAVE_SYNCRONIZED_ITC=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_DEBUG=y +CONFIG_KCORE_ELF=y +CONFIG_SMP=y +CONFIG_IA32_SUPPORT=y +CONFIG_PERFMON=y +CONFIG_IA64_PALINFO=y +# CONFIG_EFI_VARS is not set +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Networking options +# +# CONFIG_PACKET is not set +# CONFIG_NETLINK is not set +# CONFIG_NETFILTER is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_INET_ECN is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set +# CONFIG_ATM is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set +# CONFIG_PNPBIOS is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_IDECD=y +# CONFIG_BLK_DEV_IDETAPE is not set +CONFIG_BLK_DEV_IDEFLOPPY=y +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +CONFIG_BLK_DEV_IDEPCI=y +# CONFIG_IDEPCI_SHARE_IRQ is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_ADMA=y +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_IDEDMA_PCI_AUTO is not set +CONFIG_BLK_DEV_IDEDMA=y +# CONFIG_IDEDMA_PCI_WIP is not set +# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set +# CONFIG_BLK_DEV_AEC62XX is not set +# CONFIG_AEC62XX_TUNING is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_WDC_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_AMD74XX_OVERRIDE is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_HPT34X_AUTODMA is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_PIIX_TUNING is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_PDC202XX is not set +# CONFIG_PDC202XX_BURST is not set +# CONFIG_PDC202XX_FORCE is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_IDEDMA_IVB is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +# CONFIG_XSCSI is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_LOGGING=y + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +# CONFIG_SCSI_QLOGIC_FC is not set +CONFIG_SCSI_QLOGIC_1280=y +# CONFIG_SCSI_QLOGIC_QLA2100 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +CONFIG_DUMMY=y +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +# CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNLANCE is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +CONFIG_NET_PCI=y +# CONFIG_PCNET32 is not set +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_APRICOT is not set +# CONFIG_CS89x0 is not set +# CONFIG_TULIP is not set +# CONFIG_DE4X5 is not set +# CONFIG_DGRS is not set +# CONFIG_DM9102 is not set +CONFIG_EEPRO100=y +# CONFIG_LNE390 is not set +# CONFIG_FEALNX is not set +# CONFIG_NATSEMI is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_NE3210 is not set +# CONFIG_ES3210 is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO is not set +# CONFIG_8139TOO_PIO is not set +# CONFIG_8139TOO_TUNE_TWISTER is not set +# CONFIG_8139TOO_8129 is not set +# CONFIG_SIS900 is not set +# CONFIG_EPIC100 is not set +# CONFIG_SUNDANCE is not set +# CONFIG_TLAN is not set +# CONFIG_VIA_RHINE is not set +# CONFIG_WINBOND_840 is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_SK98LIN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_SERIAL_CONSOLE=y +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +CONFIG_MOUSE=y +CONFIG_PSMOUSE=y +# CONFIG_82C710_MOUSE is not set +# CONFIG_PC110_PAD is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_EFI_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +CONFIG_AUTOFS_FS=y +CONFIG_AUTOFS4_FS=y +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=y +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y +CONFIG_DEVFS_DEBUG=y +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_SUPPORT is not set + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_ROOT_NFS is not set +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Console drivers +# +CONFIG_VGA_CONSOLE=y + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Bluetooth support +# +# CONFIG_BLUEZ is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +CONFIG_KDB=y +CONFIG_KDB_MODULES=y +# CONFIG_KDB_OFF is not set + +# +# Load all symbols for debugging is required for KDB +# +CONFIG_KALLSYMS=y diff -urN linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-bigsur-sp lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-bigsur-sp --- linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-bigsur-sp Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-bigsur-sp Mon Nov 19 23:22:49 2001 @@ -0,0 +1,772 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_GENERIC is not set +CONFIG_IA64_DIG=y +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_SGI_SN1 is not set +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=6 +# CONFIG_NUMA is not set +# CONFIG_IA64_MCA is not set +CONFIG_PM=y +CONFIG_IA64_HAVE_SYNCRONIZED_ITC=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_DEBUG=y +CONFIG_KCORE_ELF=y +# CONFIG_SMP is not set +CONFIG_IA32_SUPPORT=y +CONFIG_PERFMON=y +CONFIG_IA64_PALINFO=y +# CONFIG_EFI_VARS is not set +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Networking options +# +# CONFIG_PACKET is not set +# CONFIG_NETLINK is not set +# CONFIG_NETFILTER is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_INET_ECN is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set +# CONFIG_ATM is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set +# CONFIG_PNPBIOS is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_IDECD=y +# CONFIG_BLK_DEV_IDETAPE is not set +CONFIG_BLK_DEV_IDEFLOPPY=y +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +CONFIG_BLK_DEV_IDEPCI=y +# CONFIG_IDEPCI_SHARE_IRQ is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_ADMA=y +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_IDEDMA_PCI_AUTO is not set +CONFIG_BLK_DEV_IDEDMA=y +# CONFIG_IDEDMA_PCI_WIP is not set +# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set +# CONFIG_BLK_DEV_AEC62XX is not set +# CONFIG_AEC62XX_TUNING is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_WDC_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_AMD74XX_OVERRIDE is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_HPT34X_AUTODMA is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_PIIX_TUNING is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_PDC202XX is not set +# CONFIG_PDC202XX_BURST is not set +# CONFIG_PDC202XX_FORCE is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_IDEDMA_IVB is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +# CONFIG_XSCSI is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_LOGGING=y + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +# CONFIG_SCSI_QLOGIC_FC is not set +CONFIG_SCSI_QLOGIC_1280=y +# CONFIG_SCSI_QLOGIC_QLA2100 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +CONFIG_DUMMY=y +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +# CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNLANCE is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +CONFIG_NET_PCI=y +# CONFIG_PCNET32 is not set +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_APRICOT is not set +# CONFIG_CS89x0 is not set +# CONFIG_TULIP is not set +# CONFIG_DE4X5 is not set +# CONFIG_DGRS is not set +# CONFIG_DM9102 is not set +CONFIG_EEPRO100=y +# CONFIG_LNE390 is not set +# CONFIG_FEALNX is not set +# CONFIG_NATSEMI is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_NE3210 is not set +# CONFIG_ES3210 is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO is not set +# CONFIG_8139TOO_PIO is not set +# CONFIG_8139TOO_TUNE_TWISTER is not set +# CONFIG_8139TOO_8129 is not set +# CONFIG_SIS900 is not set +# CONFIG_EPIC100 is not set +# CONFIG_SUNDANCE is not set +# CONFIG_TLAN is not set +# CONFIG_VIA_RHINE is not set +# CONFIG_WINBOND_840 is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_SK98LIN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_SERIAL_CONSOLE=y +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +CONFIG_MOUSE=y +CONFIG_PSMOUSE=y +# CONFIG_82C710_MOUSE is not set +# CONFIG_PC110_PAD is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_EFI_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +CONFIG_AUTOFS_FS=y +CONFIG_AUTOFS4_FS=y +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=y +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y +CONFIG_DEVFS_DEBUG=y +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_SUPPORT is not set + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_ROOT_NFS is not set +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Console drivers +# +CONFIG_VGA_CONSOLE=y + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Bluetooth support +# +# CONFIG_BLUEZ is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +# CONFIG_KALLSYMS is not set diff -urN linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-dig-mp lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-dig-mp --- linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-dig-mp Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-dig-mp Mon Nov 19 23:22:49 2001 @@ -0,0 +1,459 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_GENERIC is not set +CONFIG_IA64_DIG=y +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_SGI_SN1 is not set +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=6 +# CONFIG_NUMA is not set +# CONFIG_IA64_MCA is not set +CONFIG_PM=y +CONFIG_IA64_HAVE_SYNCRONIZED_ITC=y +# CONFIG_DEVFS_FS is not set +CONFIG_KCORE_ELF=y +CONFIG_SMP=y +# CONFIG_IA32_SUPPORT is not set +# CONFIG_PERFMON is not set +# CONFIG_IA64_PALINFO is not set +# CONFIG_EFI_VARS is not set +# CONFIG_NET is not set +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_SYSCTL is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +# CONFIG_XSCSI is not set + +# +# SCSI support +# +# CONFIG_SCSI is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +# CONFIG_SERIAL is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_EFI_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_SUPPORT is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_SMB_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# Console drivers +# +CONFIG_VGA_CONSOLE=y + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# + +# +# Networking support is needed for USB Networking device support +# + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +# CONFIG_KALLSYMS is not set diff -urN linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-dig-sp lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-dig-sp --- linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-dig-sp Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-dig-sp Mon Nov 19 23:22:49 2001 @@ -0,0 +1,459 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_GENERIC is not set +CONFIG_IA64_DIG=y +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_SGI_SN1 is not set +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=6 +# CONFIG_NUMA is not set +# CONFIG_IA64_MCA is not set +CONFIG_PM=y +CONFIG_IA64_HAVE_SYNCRONIZED_ITC=y +# CONFIG_DEVFS_FS is not set +CONFIG_KCORE_ELF=y +# CONFIG_SMP is not set +# CONFIG_IA32_SUPPORT is not set +# CONFIG_PERFMON is not set +# CONFIG_IA64_PALINFO is not set +# CONFIG_EFI_VARS is not set +# CONFIG_NET is not set +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_SYSCTL is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +# CONFIG_XSCSI is not set + +# +# SCSI support +# +# CONFIG_SCSI is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +# CONFIG_SERIAL is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_EFI_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_SUPPORT is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_SMB_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# Console drivers +# +CONFIG_VGA_CONSOLE=y + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# + +# +# Networking support is needed for USB Networking device support +# + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +# CONFIG_KALLSYMS is not set diff -urN linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-generic-mp lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-generic-mp --- linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-generic-mp Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-generic-mp Mon Nov 19 23:22:49 2001 @@ -0,0 +1,460 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +CONFIG_IA64_GENERIC=y +# CONFIG_IA64_DIG is not set +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_SGI_SN1 is not set +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=6 +CONFIG_KCORE_ELF=y +CONFIG_SMP=y +# CONFIG_IA32_SUPPORT is not set +CONFIG_PERFMON=y +CONFIG_IA64_PALINFO=y +# CONFIG_EFI_VARS is not set +# CONFIG_NET is not set +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_SYSCTL is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +# CONFIG_XSCSI is not set + +# +# SCSI support +# +# CONFIG_SCSI is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +# CONFIG_SERIAL is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_EFI_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_SUPPORT is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_SMB_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# Console drivers +# +CONFIG_VGA_CONSOLE=y + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# + +# +# Networking support is needed for USB Networking device support +# + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# Simulated drivers +# +# CONFIG_SIMETH is not set +# CONFIG_SIM_SERIAL is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +# CONFIG_KALLSYMS is not set diff -urN linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-generic-sp lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-generic-sp --- linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-generic-sp Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-generic-sp Mon Nov 19 23:22:49 2001 @@ -0,0 +1,460 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +CONFIG_IA64_GENERIC=y +# CONFIG_IA64_DIG is not set +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_SGI_SN1 is not set +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=6 +CONFIG_KCORE_ELF=y +# CONFIG_SMP is not set +# CONFIG_IA32_SUPPORT is not set +CONFIG_PERFMON=y +CONFIG_IA64_PALINFO=y +# CONFIG_EFI_VARS is not set +# CONFIG_NET is not set +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_SYSCTL is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +# CONFIG_XSCSI is not set + +# +# SCSI support +# +# CONFIG_SCSI is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +# CONFIG_SERIAL is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_EFI_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_SUPPORT is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_SMB_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# Console drivers +# +CONFIG_VGA_CONSOLE=y + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# + +# +# Networking support is needed for USB Networking device support +# + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# Simulated drivers +# +# CONFIG_SIMETH is not set +# CONFIG_SIM_SERIAL is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +# CONFIG_KALLSYMS is not set diff -urN linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-hp-sp lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-hp-sp --- linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-hp-sp Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-hp-sp Mon Nov 19 23:22:49 2001 @@ -0,0 +1,334 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_GENERIC is not set +# CONFIG_IA64_DIG is not set +CONFIG_IA64_HP_SIM=y +# CONFIG_IA64_SGI_SN1 is not set +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=6 +CONFIG_KCORE_ELF=y +# CONFIG_SMP is not set +# CONFIG_IA32_SUPPORT is not set +# CONFIG_PERFMON is not set +# CONFIG_IA64_PALINFO is not set +# CONFIG_EFI_VARS is not set +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set + +# +# Networking options +# +# CONFIG_PACKET is not set +# CONFIG_NETLINK is not set +# CONFIG_NETFILTER is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_INET_ECN is not set +# CONFIG_SYN_COOKIES is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +# CONFIG_XSCSI is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +CONFIG_SCSI_CONSTANTS=y +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_PPA is not set +# CONFIG_SCSI_IMM is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +# CONFIG_SERIAL is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 +# CONFIG_PRINTER is not set +# CONFIG_PPDEV is not set + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +CONFIG_EFI_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_SUPPORT is not set + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +# CONFIG_NFS_FS is not set +# CONFIG_NFS_V3 is not set +# CONFIG_ROOT_NFS is not set +# CONFIG_NFSD is not set +# CONFIG_NFSD_V3 is not set +# CONFIG_SUNRPC is not set +# CONFIG_LOCKD is not set +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# Console drivers +# +CONFIG_VGA_CONSOLE=y + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Simulated drivers +# +CONFIG_SIMETH=y +CONFIG_SIM_SERIAL=y +CONFIG_SCSI_SIM=y + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +# CONFIG_KALLSYMS is not set diff -urN linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-prom-medusa lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-prom-medusa --- linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-prom-medusa Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-prom-medusa Mon Nov 19 23:22:49 2001 @@ -0,0 +1,529 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_GENERIC is not set +# CONFIG_IA64_DIG is not set +# CONFIG_IA64_HP_SIM is not set +CONFIG_IA64_SGI_SN1=y +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=7 +CONFIG_IA64_SGI_SN=y +CONFIG_IA64_SGI_SN_DEBUG=y +CONFIG_IA64_SGI_SN_SIM=y +CONFIG_IA64_SGI_AUTOTEST=y +CONFIG_DEVFS_FS=y +# CONFIG_DEVFS_DEBUG is not set +CONFIG_SERIAL_SGI_L1_PROTOCOL=y +CONFIG_DISCONTIGMEM=y +CONFIG_IA64_MCA=y +CONFIG_NUMA=y +CONFIG_PERCPU_IRQ=y +CONFIG_PCIBA=y +CONFIG_KCORE_ELF=y +CONFIG_SMP=y +# CONFIG_IA32_SUPPORT is not set +CONFIG_PERFMON=y +CONFIG_IA64_PALINFO=y +# CONFIG_EFI_VARS is not set +# CONFIG_NET is not set +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set +# CONFIG_PNPBIOS is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +# CONFIG_XSCSI is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +CONFIG_SCSI_QLOGIC_FC=y +# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLOGIC_QLA2100 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +# CONFIG_VT is not set +CONFIG_SERIAL=y +# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_EFI_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +CONFIG_DEVFS_FS=y +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_SUPPORT is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_SMB_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# + +# +# Networking support is needed for USB Networking device support +# + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +# CONFIG_KALLSYMS is not set diff -urN linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-sn1-mp lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-sn1-mp --- linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-sn1-mp Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-sn1-mp Mon Nov 19 23:22:49 2001 @@ -0,0 +1,736 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_GENERIC is not set +# CONFIG_IA64_DIG is not set +# CONFIG_IA64_HP_SIM is not set +CONFIG_IA64_SGI_SN1=y +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=7 +CONFIG_IA64_SGI_SN=y +CONFIG_IA64_SGI_SN_DEBUG=y +CONFIG_IA64_SGI_SN_SIM=y +CONFIG_IA64_SGI_AUTOTEST=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_DEBUG=y +CONFIG_SERIAL_SGI_L1_PROTOCOL=y +CONFIG_DISCONTIGMEM=y +CONFIG_IA64_MCA=y +CONFIG_NUMA=y +CONFIG_PERCPU_IRQ=y +CONFIG_PCIBA=y +CONFIG_KCORE_ELF=y +CONFIG_SMP=y +CONFIG_IA32_SUPPORT=y +CONFIG_PERFMON=y +CONFIG_IA64_PALINFO=y +# CONFIG_EFI_VARS is not set +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_NETLINK=y +CONFIG_RTNETLINK=y +CONFIG_NETLINK_DEV=y +CONFIG_NETFILTER=y +CONFIG_NETFILTER_DEBUG=y +CONFIG_FILTER=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +CONFIG_SYN_COOKIES=y + +# +# IP: Netfilter Configuration +# +# CONFIG_IP_NF_CONNTRACK is not set +# CONFIG_IP_NF_QUEUE is not set +# CONFIG_IP_NF_IPTABLES is not set +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set +# CONFIG_IP_NF_COMPAT_IPFWADM is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set +# CONFIG_ATM is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set +# CONFIG_PNPBIOS is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +CONFIG_XSCSI=y + +# +# Alternate SCSI support +# +CONFIG_XSCSI_DKSC=y +# CONFIG_XSCSI_QLFC is not set +# CONFIG_XSCSI_QL is not set +# CONFIG_XSCSI_SBP2 is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +CONFIG_SCSI_QLOGIC_FC=y +# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLOGIC_QLA2100 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_SGI_IOC3_ETH=y +# CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNLANCE is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +# CONFIG_NET_PCI is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_SK98LIN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +# CONFIG_VT is not set +CONFIG_SERIAL=y +# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +CONFIG_EFI_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +CONFIG_QUOTA=y +CONFIG_AUTOFS_FS=y +CONFIG_AUTOFS4_FS=y +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=y +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +CONFIG_ISO9660_FS=y +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y +CONFIG_DEVFS_DEBUG=y +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +CONFIG_XFS_SUPPORT=y + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_ROOT_NFS is not set +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="n" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Bluetooth support +# +# CONFIG_BLUEZ is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +CONFIG_KDB=y +CONFIG_KDB_MODULES=y +# CONFIG_KDB_OFF is not set + +# +# Load all symbols for debugging is required for KDB +# +CONFIG_KALLSYMS=y diff -urN linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-modules lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-modules --- linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-modules Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-modules Mon Nov 19 23:22:49 2001 @@ -0,0 +1,738 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# Loadable module support +# +CONFIG_MODULES=y +# CONFIG_MODVERSIONS is not set +CONFIG_KMOD=y + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_GENERIC is not set +# CONFIG_IA64_DIG is not set +# CONFIG_IA64_HP_SIM is not set +CONFIG_IA64_SGI_SN1=y +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=7 +CONFIG_IA64_SGI_SN=y +CONFIG_IA64_SGI_SN_DEBUG=y +CONFIG_IA64_SGI_SN_SIM=y +CONFIG_IA64_SGI_AUTOTEST=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_DEBUG=y +CONFIG_SERIAL_SGI_L1_PROTOCOL=y +CONFIG_DISCONTIGMEM=y +CONFIG_IA64_MCA=y +CONFIG_NUMA=y +CONFIG_PERCPU_IRQ=y +CONFIG_PCIBA=y +CONFIG_KCORE_ELF=y +CONFIG_SMP=y +CONFIG_IA32_SUPPORT=y +CONFIG_PERFMON=y +CONFIG_IA64_PALINFO=y +# CONFIG_EFI_VARS is not set +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_NETLINK=y +CONFIG_RTNETLINK=y +CONFIG_NETLINK_DEV=y +CONFIG_NETFILTER=y +CONFIG_NETFILTER_DEBUG=y +CONFIG_FILTER=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +CONFIG_SYN_COOKIES=y + +# +# IP: Netfilter Configuration +# +# CONFIG_IP_NF_CONNTRACK is not set +# CONFIG_IP_NF_QUEUE is not set +# CONFIG_IP_NF_IPTABLES is not set +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set +# CONFIG_IP_NF_COMPAT_IPFWADM is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set +# CONFIG_ATM is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set +# CONFIG_PNPBIOS is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +CONFIG_XSCSI=y + +# +# Alternate SCSI support +# +CONFIG_XSCSI_DKSC=y +# CONFIG_XSCSI_QLFC is not set +# CONFIG_XSCSI_QL is not set +# CONFIG_XSCSI_SBP2 is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +CONFIG_SCSI_QLOGIC_FC=y +# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLOGIC_QLA2100 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_SGI_IOC3_ETH=y +# CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNLANCE is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +# CONFIG_NET_PCI is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_SK98LIN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +# CONFIG_VT is not set +CONFIG_SERIAL=y +# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +CONFIG_EFI_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +CONFIG_QUOTA=y +CONFIG_AUTOFS_FS=y +CONFIG_AUTOFS4_FS=y +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=y +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +CONFIG_ISO9660_FS=y +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y +CONFIG_DEVFS_DEBUG=y +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +CONFIG_XFS_SUPPORT=y + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_ROOT_NFS is not set +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="n" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Bluetooth support +# +# CONFIG_BLUEZ is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +CONFIG_KDB=y +CONFIG_KDB_MODULES=y +# CONFIG_KDB_OFF is not set + +# +# Load all symbols for debugging is required for KDB +# +CONFIG_KALLSYMS=y diff -urN linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-syn1-0 lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-syn1-0 --- linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-syn1-0 Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-syn1-0 Mon Nov 19 23:22:49 2001 @@ -0,0 +1,736 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_GENERIC is not set +# CONFIG_IA64_DIG is not set +# CONFIG_IA64_HP_SIM is not set +CONFIG_IA64_SGI_SN1=y +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=7 +CONFIG_IA64_SGI_SN=y +CONFIG_IA64_SGI_SN_DEBUG=y +CONFIG_IA64_SGI_SN_SIM=y +CONFIG_IA64_SGI_AUTOTEST=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_DEBUG=y +CONFIG_SERIAL_SGI_L1_PROTOCOL=y +CONFIG_DISCONTIGMEM=y +CONFIG_IA64_MCA=y +CONFIG_NUMA=y +CONFIG_PERCPU_IRQ=y +CONFIG_PCIBA=y +CONFIG_KCORE_ELF=y +CONFIG_SMP=y +CONFIG_IA32_SUPPORT=y +CONFIG_PERFMON=y +CONFIG_IA64_PALINFO=y +# CONFIG_EFI_VARS is not set +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_NETLINK=y +CONFIG_RTNETLINK=y +CONFIG_NETLINK_DEV=y +CONFIG_NETFILTER=y +CONFIG_NETFILTER_DEBUG=y +CONFIG_FILTER=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +CONFIG_SYN_COOKIES=y + +# +# IP: Netfilter Configuration +# +# CONFIG_IP_NF_CONNTRACK is not set +# CONFIG_IP_NF_QUEUE is not set +# CONFIG_IP_NF_IPTABLES is not set +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set +# CONFIG_IP_NF_COMPAT_IPFWADM is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set +# CONFIG_ATM is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set +# CONFIG_PNPBIOS is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +CONFIG_XSCSI=y + +# +# Alternate SCSI support +# +CONFIG_XSCSI_DKSC=y +# CONFIG_XSCSI_QLFC is not set +# CONFIG_XSCSI_QL is not set +# CONFIG_XSCSI_SBP2 is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +CONFIG_SCSI_QLOGIC_FC=y +# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLOGIC_QLA2100 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_SGI_IOC3_ETH=y +# CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNLANCE is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +# CONFIG_NET_PCI is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_SK98LIN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +# CONFIG_VT is not set +CONFIG_SERIAL=y +# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +CONFIG_EFI_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +CONFIG_QUOTA=y +CONFIG_AUTOFS_FS=y +CONFIG_AUTOFS4_FS=y +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=y +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +CONFIG_ISO9660_FS=y +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y +CONFIG_DEVFS_DEBUG=y +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +CONFIG_XFS_SUPPORT=y + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_ROOT_NFS is not set +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="n" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Bluetooth support +# +# CONFIG_BLUEZ is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +CONFIG_KDB=y +CONFIG_KDB_MODULES=y +# CONFIG_KDB_OFF is not set + +# +# Load all symbols for debugging is required for KDB +# +CONFIG_KALLSYMS=y diff -urN linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-sn1-sp lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-sn1-sp --- linux-2.4.18/arch/ia64/sn/configs/sn1/defconfig-sn1-sp Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn1/defconfig-sn1-sp Mon Nov 19 23:22:49 2001 @@ -0,0 +1,736 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_GENERIC is not set +# CONFIG_IA64_DIG is not set +# CONFIG_IA64_HP_SIM is not set +CONFIG_IA64_SGI_SN1=y +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=7 +CONFIG_IA64_SGI_SN=y +CONFIG_IA64_SGI_SN_DEBUG=y +CONFIG_IA64_SGI_SN_SIM=y +CONFIG_IA64_SGI_AUTOTEST=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_DEBUG=y +CONFIG_SERIAL_SGI_L1_PROTOCOL=y +CONFIG_DISCONTIGMEM=y +CONFIG_IA64_MCA=y +CONFIG_NUMA=y +CONFIG_PERCPU_IRQ=y +CONFIG_PCIBA=y +CONFIG_KCORE_ELF=y +# CONFIG_SMP is not set +CONFIG_IA32_SUPPORT=y +CONFIG_PERFMON=y +CONFIG_IA64_PALINFO=y +# CONFIG_EFI_VARS is not set +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_NETLINK=y +CONFIG_RTNETLINK=y +CONFIG_NETLINK_DEV=y +CONFIG_NETFILTER=y +CONFIG_NETFILTER_DEBUG=y +CONFIG_FILTER=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +CONFIG_SYN_COOKIES=y + +# +# IP: Netfilter Configuration +# +# CONFIG_IP_NF_CONNTRACK is not set +# CONFIG_IP_NF_QUEUE is not set +# CONFIG_IP_NF_IPTABLES is not set +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set +# CONFIG_IP_NF_COMPAT_IPFWADM is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set +# CONFIG_ATM is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set +# CONFIG_PNPBIOS is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +CONFIG_XSCSI=y + +# +# Alternate SCSI support +# +CONFIG_XSCSI_DKSC=y +# CONFIG_XSCSI_QLFC is not set +# CONFIG_XSCSI_QL is not set +# CONFIG_XSCSI_SBP2 is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +CONFIG_SCSI_QLOGIC_FC=y +# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLOGIC_QLA2100 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_SGI_IOC3_ETH=y +# CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNLANCE is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +# CONFIG_NET_PCI is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_SK98LIN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +# CONFIG_VT is not set +CONFIG_SERIAL=y +# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +CONFIG_EFI_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +CONFIG_QUOTA=y +CONFIG_AUTOFS_FS=y +CONFIG_AUTOFS4_FS=y +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=y +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +CONFIG_ISO9660_FS=y +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y +CONFIG_DEVFS_DEBUG=y +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +CONFIG_XFS_SUPPORT=y + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_ROOT_NFS is not set +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="n" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Bluetooth support +# +# CONFIG_BLUEZ is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +CONFIG_KDB=y +CONFIG_KDB_MODULES=y +# CONFIG_KDB_OFF is not set + +# +# Load all symbols for debugging is required for KDB +# +CONFIG_KALLSYMS=y diff -urN linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-dig-numa lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-dig-numa --- linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-dig-numa Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-dig-numa Mon Nov 19 23:22:49 2001 @@ -0,0 +1,460 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_GENERIC is not set +CONFIG_IA64_DIG=y +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_SGI_SN1 is not set +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=6 +CONFIG_NUMA=y +CONFIG_DISCONTIGMEM=y +# CONFIG_IA64_MCA is not set +CONFIG_PM=y +CONFIG_IA64_HAVE_SYNCRONIZED_ITC=y +# CONFIG_DEVFS_FS is not set +CONFIG_KCORE_ELF=y +CONFIG_SMP=y +# CONFIG_IA32_SUPPORT is not set +# CONFIG_PERFMON is not set +# CONFIG_IA64_PALINFO is not set +# CONFIG_EFI_VARS is not set +# CONFIG_NET is not set +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_SYSCTL is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +# CONFIG_XSCSI is not set + +# +# SCSI support +# +# CONFIG_SCSI is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +# CONFIG_SERIAL is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_EFI_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_SUPPORT is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_SMB_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# Console drivers +# +CONFIG_VGA_CONSOLE=y + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# + +# +# Networking support is needed for USB Networking device support +# + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +# CONFIG_KALLSYMS is not set diff -urN linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-mp lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-mp --- linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-mp Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-mp Mon Nov 19 23:22:49 2001 @@ -0,0 +1,459 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_GENERIC is not set +CONFIG_IA64_DIG=y +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_SGI_SN1 is not set +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=6 +# CONFIG_NUMA is not set +# CONFIG_IA64_MCA is not set +CONFIG_PM=y +CONFIG_IA64_HAVE_SYNCRONIZED_ITC=y +# CONFIG_DEVFS_FS is not set +CONFIG_KCORE_ELF=y +CONFIG_SMP=y +# CONFIG_IA32_SUPPORT is not set +# CONFIG_PERFMON is not set +# CONFIG_IA64_PALINFO is not set +# CONFIG_EFI_VARS is not set +# CONFIG_NET is not set +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_SYSCTL is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +# CONFIG_XSCSI is not set + +# +# SCSI support +# +# CONFIG_SCSI is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +# CONFIG_SERIAL is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_EFI_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_SUPPORT is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_SMB_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# Console drivers +# +CONFIG_VGA_CONSOLE=y + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# + +# +# Networking support is needed for USB Networking device support +# + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +# CONFIG_KALLSYMS is not set diff -urN linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-sp lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-sp --- linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-sp Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-sp Mon Nov 19 23:22:49 2001 @@ -0,0 +1,459 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_GENERIC is not set +CONFIG_IA64_DIG=y +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_SGI_SN1 is not set +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +CONFIG_ITANIUM_BSTEP_SPECIFIC=y +CONFIG_IA64_L1_CACHE_SHIFT=6 +# CONFIG_NUMA is not set +# CONFIG_IA64_MCA is not set +CONFIG_PM=y +CONFIG_IA64_HAVE_SYNCRONIZED_ITC=y +# CONFIG_DEVFS_FS is not set +CONFIG_KCORE_ELF=y +# CONFIG_SMP is not set +# CONFIG_IA32_SUPPORT is not set +# CONFIG_PERFMON is not set +# CONFIG_IA64_PALINFO is not set +# CONFIG_EFI_VARS is not set +# CONFIG_NET is not set +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_SYSCTL is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +# CONFIG_XSCSI is not set + +# +# SCSI support +# +# CONFIG_SCSI is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +# CONFIG_SERIAL is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_EFI_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_SUPPORT is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_SMB_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# Console drivers +# +CONFIG_VGA_CONSOLE=y + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# + +# +# Networking support is needed for USB Networking device support +# + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +# CONFIG_KALLSYMS is not set diff -urN linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-sn2-mp lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-sn2-mp --- linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-sn2-mp Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-sn2-mp Mon Nov 19 23:22:49 2001 @@ -0,0 +1,730 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +# CONFIG_ITANIUM is not set +CONFIG_MCKINLEY=y +# CONFIG_IA64_GENERIC is not set +# CONFIG_IA64_DIG is not set +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_SGI_SN1 is not set +CONFIG_IA64_SGI_SN2=y +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_L1_CACHE_SHIFT=7 +CONFIG_MCKINLEY_ASTEP_SPECIFIC=y +CONFIG_MCKINLEY_A0_SPECIFIC=y +CONFIG_IA64_SGI_SN=y +CONFIG_IA64_SGI_SN_DEBUG=y +CONFIG_IA64_SGI_SN_SIM=y +CONFIG_IA64_SGI_AUTOTEST=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_DEBUG=y +CONFIG_SERIAL_SGI_L1_PROTOCOL=y +CONFIG_DISCONTIGMEM=y +CONFIG_IA64_MCA=y +CONFIG_NUMA=y +CONFIG_PERCPU_IRQ=y +CONFIG_PCIBA=y +CONFIG_KCORE_ELF=y +CONFIG_SMP=y +CONFIG_IA32_SUPPORT=y +CONFIG_PERFMON=y +CONFIG_IA64_PALINFO=y +# CONFIG_EFI_VARS is not set +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_NETLINK=y +CONFIG_RTNETLINK=y +CONFIG_NETLINK_DEV=y +CONFIG_NETFILTER=y +CONFIG_NETFILTER_DEBUG=y +CONFIG_FILTER=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +CONFIG_SYN_COOKIES=y + +# +# IP: Netfilter Configuration +# +# CONFIG_IP_NF_CONNTRACK is not set +# CONFIG_IP_NF_QUEUE is not set +# CONFIG_IP_NF_IPTABLES is not set +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set +# CONFIG_IP_NF_COMPAT_IPFWADM is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set +# CONFIG_ATM is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set +# CONFIG_PNPBIOS is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +CONFIG_XSCSI=y + +# +# Alternate SCSI support +# +CONFIG_XSCSI_DKSC=y +# CONFIG_XSCSI_QLFC is not set +# CONFIG_XSCSI_QL is not set +# CONFIG_XSCSI_SBP2 is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +CONFIG_SCSI_QLOGIC_FC=y +# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLOGIC_QLA2100 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +# CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNLANCE is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +# CONFIG_NET_PCI is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_SK98LIN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +# CONFIG_VT is not set +CONFIG_SERIAL=y +# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +CONFIG_EFI_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +CONFIG_QUOTA=y +CONFIG_AUTOFS_FS=y +CONFIG_AUTOFS4_FS=y +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=y +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +CONFIG_ISO9660_FS=y +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y +CONFIG_DEVFS_DEBUG=y +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +CONFIG_XFS_SUPPORT=y + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_ROOT_NFS is not set +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="n" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Bluetooth support +# +# CONFIG_BLUEZ is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +CONFIG_KALLSYMS=y diff -urN linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-sn2-mp-modules lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-sn2-mp-modules --- linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-sn2-mp-modules Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-sn2-mp-modules Mon Nov 19 23:22:49 2001 @@ -0,0 +1,732 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# Loadable module support +# +CONFIG_MODULES=y +# CONFIG_MODVERSIONS is not set +CONFIG_KMOD=y + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +# CONFIG_ITANIUM is not set +CONFIG_MCKINLEY=y +# CONFIG_IA64_GENERIC is not set +# CONFIG_IA64_DIG is not set +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_SGI_SN1 is not set +CONFIG_IA64_SGI_SN2=y +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_L1_CACHE_SHIFT=7 +CONFIG_MCKINLEY_ASTEP_SPECIFIC=y +CONFIG_MCKINLEY_A0_SPECIFIC=y +CONFIG_IA64_SGI_SN=y +CONFIG_IA64_SGI_SN_DEBUG=y +CONFIG_IA64_SGI_SN_SIM=y +CONFIG_IA64_SGI_AUTOTEST=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_DEBUG=y +# CONFIG_SERIAL_SGI_L1_PROTOCOL is not set +CONFIG_DISCONTIGMEM=y +CONFIG_IA64_MCA=y +CONFIG_NUMA=y +CONFIG_PERCPU_IRQ=y +CONFIG_PCIBA=y +CONFIG_KCORE_ELF=y +CONFIG_SMP=y +CONFIG_IA32_SUPPORT=y +CONFIG_PERFMON=y +CONFIG_IA64_PALINFO=y +# CONFIG_EFI_VARS is not set +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_NETLINK=y +CONFIG_RTNETLINK=y +CONFIG_NETLINK_DEV=y +CONFIG_NETFILTER=y +CONFIG_NETFILTER_DEBUG=y +CONFIG_FILTER=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +CONFIG_SYN_COOKIES=y + +# +# IP: Netfilter Configuration +# +# CONFIG_IP_NF_CONNTRACK is not set +# CONFIG_IP_NF_QUEUE is not set +# CONFIG_IP_NF_IPTABLES is not set +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set +# CONFIG_IP_NF_COMPAT_IPFWADM is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set +# CONFIG_ATM is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set +# CONFIG_PNPBIOS is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +CONFIG_XSCSI=y + +# +# Alternate SCSI support +# +CONFIG_XSCSI_DKSC=y +# CONFIG_XSCSI_QLFC is not set +# CONFIG_XSCSI_QL is not set +# CONFIG_XSCSI_SBP2 is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +CONFIG_SCSI_QLOGIC_FC=y +# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLOGIC_QLA2100 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +# CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNLANCE is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +# CONFIG_NET_PCI is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_SK98LIN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +# CONFIG_VT is not set +CONFIG_SERIAL=y +# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +CONFIG_EFI_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +CONFIG_QUOTA=y +CONFIG_AUTOFS_FS=y +CONFIG_AUTOFS4_FS=y +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=y +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +CONFIG_ISO9660_FS=y +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y +CONFIG_DEVFS_DEBUG=y +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +CONFIG_XFS_SUPPORT=y + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_ROOT_NFS is not set +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="n" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Bluetooth support +# +# CONFIG_BLUEZ is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +CONFIG_KALLSYMS=y diff -urN linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-sn2-prom-medusa lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-sn2-prom-medusa --- linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-sn2-prom-medusa Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-sn2-prom-medusa Mon Nov 19 23:22:49 2001 @@ -0,0 +1,537 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +# CONFIG_ITANIUM is not set +CONFIG_MCKINLEY=y +# CONFIG_IA64_GENERIC is not set +# CONFIG_IA64_DIG is not set +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_SGI_SN1 is not set +CONFIG_IA64_SGI_SN2=y +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_L1_CACHE_SHIFT=7 +CONFIG_MCKINLEY_ASTEP_SPECIFIC=y +CONFIG_MCKINLEY_A0_SPECIFIC=y +CONFIG_IA64_SGI_SN=y +CONFIG_IA64_SGI_SN_DEBUG=y +CONFIG_IA64_SGI_SN_SIM=y +CONFIG_IA64_SGI_AUTOTEST=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_DEBUG=y +CONFIG_SERIAL_SGI_L1_PROTOCOL=y +CONFIG_DISCONTIGMEM=y +CONFIG_IA64_MCA=y +CONFIG_NUMA=y +CONFIG_PERCPU_IRQ=y +CONFIG_PCIBA=y +CONFIG_KCORE_ELF=y +CONFIG_SMP=y +# CONFIG_IA32_SUPPORT is not set +CONFIG_PERFMON=y +CONFIG_IA64_PALINFO=y +# CONFIG_EFI_VARS is not set +# CONFIG_NET is not set +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set +# CONFIG_PNPBIOS is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +CONFIG_XSCSI=y + +# +# Alternate SCSI support +# +CONFIG_XSCSI_DKSC=y +# CONFIG_XSCSI_QLFC is not set +# CONFIG_XSCSI_QL is not set +# CONFIG_XSCSI_SBP2 is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +CONFIG_SCSI_QLOGIC_FC=y +# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLOGIC_QLA2100 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +# CONFIG_VT is not set +CONFIG_SERIAL=y +# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_EFI_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y +CONFIG_DEVFS_DEBUG=y +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +CONFIG_XFS_SUPPORT=y +# CONFIG_NCPFS_NLS is not set +# CONFIG_SMB_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# + +# +# Networking support is needed for USB Networking device support +# + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +# CONFIG_KALLSYMS is not set diff -urN linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-sn2-sp lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-sn2-sp --- linux-2.4.18/arch/ia64/sn/configs/sn2/defconfig-sn2-sp Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/configs/sn2/defconfig-sn2-sp Mon Nov 19 23:22:49 2001 @@ -0,0 +1,730 @@ +# +# Automatically generated make config: don't edit +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# General setup +# +CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_MCA is not set +# CONFIG_SBUS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_ACPI=y +CONFIG_ACPI_EFI=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_KERNEL_CONFIG=y +# CONFIG_ITANIUM is not set +CONFIG_MCKINLEY=y +# CONFIG_IA64_GENERIC is not set +# CONFIG_IA64_DIG is not set +# CONFIG_IA64_HP_SIM is not set +# CONFIG_IA64_SGI_SN1 is not set +CONFIG_IA64_SGI_SN2=y +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_L1_CACHE_SHIFT=7 +CONFIG_MCKINLEY_ASTEP_SPECIFIC=y +CONFIG_MCKINLEY_A0_SPECIFIC=y +CONFIG_IA64_SGI_SN=y +CONFIG_IA64_SGI_SN_DEBUG=y +CONFIG_IA64_SGI_SN_SIM=y +CONFIG_IA64_SGI_AUTOTEST=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_DEBUG=y +CONFIG_SERIAL_SGI_L1_PROTOCOL=y +CONFIG_DISCONTIGMEM=y +CONFIG_IA64_MCA=y +CONFIG_NUMA=y +CONFIG_PERCPU_IRQ=y +CONFIG_PCIBA=y +CONFIG_KCORE_ELF=y +# CONFIG_SMP is not set +CONFIG_IA32_SUPPORT=y +CONFIG_PERFMON=y +CONFIG_IA64_PALINFO=y +# CONFIG_EFI_VARS is not set +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_BUSMGR is not set +# CONFIG_ACPI_SYS is not set +# CONFIG_ACPI_CPU is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_AC is not set +# CONFIG_ACPI_EC is not set +# CONFIG_ACPI_CMBATT is not set +# CONFIG_ACPI_THERMAL is not set +CONFIG_PCI=y +# CONFIG_PCI_NAMES is not set +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_NETLINK=y +CONFIG_RTNETLINK=y +CONFIG_NETLINK_DEV=y +CONFIG_NETFILTER=y +CONFIG_NETFILTER_DEBUG=y +CONFIG_FILTER=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +CONFIG_SYN_COOKIES=y + +# +# IP: Netfilter Configuration +# +# CONFIG_IP_NF_CONNTRACK is not set +# CONFIG_IP_NF_QUEUE is not set +# CONFIG_IP_NF_IPTABLES is not set +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set +# CONFIG_IP_NF_COMPAT_IPFWADM is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set +# CONFIG_ATM is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set +# CONFIG_PNPBIOS is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set + +# +# Alternate 1394 support +# +# CONFIG_X1394 is not set + +# +# Alternate SCSI support +# +CONFIG_XSCSI=y + +# +# Alternate SCSI support +# +CONFIG_XSCSI_DKSC=y +# CONFIG_XSCSI_QLFC is not set +# CONFIG_XSCSI_QL is not set +# CONFIG_XSCSI_SBP2 is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +CONFIG_SCSI_QLOGIC_FC=y +# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLOGIC_QLA2100 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +# CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNLANCE is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +# CONFIG_NET_PCI is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_SK98LIN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set + +# +# Character devices +# +# CONFIG_VT is not set +CONFIG_SERIAL=y +# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set + +# +# Input core support is needed for gameports +# + +# +# Input core support is needed for joysticks +# +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +CONFIG_EFI_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_MWAVE is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +CONFIG_QUOTA=y +CONFIG_AUTOFS_FS=y +CONFIG_AUTOFS4_FS=y +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=y +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +# CONFIG_RAMFS is not set +CONFIG_ISO9660_FS=y +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y +CONFIG_DEVFS_DEBUG=y +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +CONFIG_XFS_SUPPORT=y + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_ROOT_NFS is not set +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="n" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +# CONFIG_USB_OHCI is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# USB Human Interface Devices (HID) +# + +# +# Input core support is needed for USB HID +# + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_GENERIC is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Bluetooth support +# +# CONFIG_BLUEZ is not set + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_IA64_PRINT_HAZARDS=y +# CONFIG_DISABLE_VHPT is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_IA64_EARLY_PRINTK=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +# CONFIG_KDB is not set +# CONFIG_KDB_MODULES is not set +CONFIG_KALLSYMS=y diff -urN linux-2.4.18/arch/ia64/sn/fakeprom/Makefile lia64-2.4/arch/ia64/sn/fakeprom/Makefile --- linux-2.4.18/arch/ia64/sn/fakeprom/Makefile Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/fakeprom/Makefile Mon Nov 19 23:22:50 2001 @@ -0,0 +1,30 @@ +# +# This file is subject to the terms and conditions of the GNU General Public +# License. See the file "COPYING" in the main directory of this archive +# for more details. +# +# Copyright (c) 2000-2001 Silicon Graphics, Inc. All rights reserved. +# + +TOPDIR=../../../.. +HPATH = $(TOPDIR)/include + +LIB = ../../lib/lib.a + +OBJ=fpromasm.o main.o fw-emu.o fpmem.o klgraph_init.o +obj-y=fprom + +fprom: $(OBJ) + $(LD) -static -Tfprom.lds -o fprom $(OBJ) $(LIB) + +.S.o: + $(CC) -D__ASSEMBLY__ $(AFLAGS) $(AFLAGS_KERNEL) -c -o $*.o $< +.c.o: + $(CC) $(CFLAGS) $(CFLAGS_KERNEL) -c -o $*.o $< + +clean: + rm -f *.o fprom + + +include $(TOPDIR)/Rules.make + diff -urN linux-2.4.18/arch/ia64/sn/fakeprom/README lia64-2.4/arch/ia64/sn/fakeprom/README --- linux-2.4.18/arch/ia64/sn/fakeprom/README Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/fakeprom/README Mon Nov 19 23:22:50 2001 @@ -0,0 +1,85 @@ +This directory contains the files required to build +the fake PROM image that is currently being used to +boot IA64 kernels running under the SGI Medusa kernel. + +The FPROM currently provides the following functions: + + - PAL emulation for all PAL calls we've made so far. + - SAL emulation for all SAL calls we've made so far. + - EFI emulation for all EFI calls we've made so far. + - builds the "ia64_bootparam" structure that is + passed to the kernel from SAL. This structure + shows the cpu & memory configurations. + - supports medusa boottime options for changing + the number of cpus present + - supports medusa boottime options for changing + the memory configuration. + + + +At some point, this fake PROM will be replaced by the +real PROM. + + + + +To build a fake PROM, cd to this directory & type: + + make + +This will (or should) build a fake PROM named "fprom". + + + + +Use this fprom image when booting the Medusa simulator. The +control file used to boot Medusa should include the +following lines: + + load fprom + load vmlinux + sr pc 0x100000 + sr g 9
#(currently 0xe000000000520000) + +NOTE: There is a script "runsim" in this directory that can be used to +simplify setting up an environment for running under Medusa. + + + + +The following parameters may be passed to the fake PROM to +control the PAL/SAL/EFI parameters passed to the kernel: + + GR[8] = # of cpus + GR[9] = address of primary entry point into the kernel + GR[20] = memory configuration for node 0 + GR[21] = memory configuration for node 1 + GR[22] = memory configuration for node 2 + GR[23] = memory configuration for node 3 + + +Registers GR[20] - GR[23] contain information to specify the +amount of memory present on nodes 0-3. + + - if nothing is specified (all registers are 0), the configuration + defaults to 8 MB on node 0. + + - a mem config entry for node N is passed in GR[20+N] + + - a mem config entry consists of 8 hex digits. Each digit gives the + amount of physical memory available on the node starting at + 1GB*, where dn is the digit number. The amount of memory + is 8MB*2**. (If = 0, the memory size is 0). + + SN1 doesnt support dimms this small but small memory systems + boot faster on Medusa. + + + +An example helps a lot. The following specifies that node 0 has +physical memory 0 to 8MB and 1GB to 1GB+32MB, and that node 1 has +64MB starting at address 0 of the node which is 8GB. + + gr[20] = 0x21 # 0 to 8MB, 1GB to 1GB+32MB + gr[21] = 0x4 # 8GB to 8GB+64MB + diff -urN linux-2.4.18/arch/ia64/sn/fakeprom/fpmem.c lia64-2.4/arch/ia64/sn/fakeprom/fpmem.c --- linux-2.4.18/arch/ia64/sn/fakeprom/fpmem.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/fakeprom/fpmem.c Tue Feb 26 13:19:34 2002 @@ -0,0 +1,266 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + + + +/* + * FPROM EFI memory descriptor build routines + * + * - Routines to build the EFI memory descriptor map + * - Should also be usable by the SGI SN1 prom to convert + * klconfig to efi_memmap + */ + +#include +#include +#include "fpmem.h" + +/* + * args points to a layout in memory like this + * + * 32 bit 32 bit + * + * numnodes numcpus + * + * 16 bit 16 bit 32 bit + * nasid0 cpuconf membankdesc0 + * nasid1 cpuconf membankdesc1 + * . + * . + * . + * . + * . + */ + +sn_memmap_t *sn_memmap ; +sn_config_t *sn_config ; + +/* + * There is a hole in the node 0 address space. Dont put it + * in the memory map + */ +#define NODE0_HOLE_SIZE (20*MB) +#define NODE0_HOLE_END (4UL*GB) + +#define MB (1024*1024) +#define GB (1024*MB) +#define KERNEL_SIZE (4*MB) +#define PROMRESERVED_SIZE (1*MB) + +#ifdef CONFIG_IA64_SGI_SN1 +#define PHYS_ADDRESS(_n, _x) (((long)_n<<33L) | (long)_x) +#define MD_BANK_SHFT 30 +#else +#define PHYS_ADDRESS(_n, _x) (((long)_n<<38L) | (long)_x | 0x3000000000UL) +#define MD_BANK_SHFT 34 +#endif + +/* + * For SN, this may not take an arg and gets the numnodes from + * the prom variable or by traversing klcfg or promcfg + */ +int +GetNumNodes(void) +{ + return sn_config->nodes; +} + +int +GetNumCpus(void) +{ + return sn_config->cpus; +} + +/* For SN1, get the index th nasid */ + +int +GetNasid(int index) +{ + return sn_memmap[index].nasid ; +} + +node_memmap_t +GetMemBankInfo(int index) +{ + return sn_memmap[index].node_memmap ; +} + +int +IsCpuPresent(int cnode, int cpu) +{ + return sn_memmap[cnode].cpuconfig & (1<type = type; + md->phys_addr = paddr; + md->virt_addr = 0; + md->num_pages = numbytes >> 12; + md->attribute = EFI_MEMORY_WB; +} + +int +build_efi_memmap(void *md, int mdsize) +{ + int numnodes = GetNumNodes() ; + int cnode,bank ; + int nasid ; + node_memmap_t membank_info ; + int bsize; + int count = 0 ; + long paddr, hole, numbytes; + + + for (cnode=0;cnode + +/* + * Structure of the mem config of the node as a SN1 MI reg + * Medusa supports this reg config. + * + * BankSize nibble to bank size mapping + * + * 1 - 64 MB + * 2 - 128 MB + * 3 - 256 MB + * 4 - 512 MB + * 5 - 1024 MB (1GB) + */ + +#define MBSHIFT 20 + +#ifdef CONFIG_IA64_SGI_SN1 +typedef struct node_memmap_s +{ + unsigned int b0 :1, /* 0 bank 0 present */ + b1 :1, /* 1 bank 1 present */ + r01 :2, /* 2-3 reserved */ + b01size :4, /* 4-7 Size of bank 0 and 1 */ + b2 :1, /* 8 bank 2 present */ + b3 :1, /* 9 bank 3 present */ + r23 :2, /* 10-11 reserved */ + b23size :4, /* 12-15 Size of bank 2 and 3 */ + b4 :1, /* 16 bank 4 present */ + b5 :1, /* 17 bank 5 present */ + r45 :2, /* 18-19 reserved */ + b45size :4, /* 20-23 Size of bank 4 and 5 */ + b6 :1, /* 24 bank 6 present */ + b7 :1, /* 25 bank 7 present */ + r67 :2, /* 26-27 reserved */ + b67size :4; /* 28-31 Size of bank 6 and 7 */ +} node_memmap_t ; + +/* Support the medusa hack for 8M/16M/32M nodes */ +#define SN1_BANK_SIZE_SHIFT (MBSHIFT+6) /* 64 MB */ +#define BankSizeBytes(bsize) ((bsize<6) ? (1<<((bsize-1)+SN1_BANK_SIZE_SHIFT)) :\ + (1<<((bsize-9)+MBSHIFT))) +#else +typedef struct node_memmap_s +{ + unsigned int b0size :3, /* 0-2 bank 0 size */ + b0dou :1, /* 3 bank 0 is 2-sided */ + ena0 :1, /* 4 bank 0 enabled */ + r0 :3, /* 5-7 reserved */ + b1size :3, /* 8-10 bank 1 size */ + b1dou :1, /* 11 bank 1 is 2-sided */ + ena1 :1, /* 12 bank 1 enabled */ + r1 :3, /* 13-15 reserved */ + b2size :3, /* 16-18 bank 2 size */ + b2dou :1, /* 19 bank 1 is 2-sided */ + ena2 :1, /* 20 bank 2 enabled */ + r2 :3, /* 21-23 reserved */ + b3size :3, /* 24-26 bank 3 size */ + b3dou :1, /* 27 bank 3 is 2-sided */ + ena3 :1, /* 28 bank 3 enabled */ + r3 :3; /* 29-31 reserved */ +} node_memmap_t ; + +#define SN2_BANK_SIZE_SHIFT (MBSHIFT+6) /* 64 MB */ +#define BankPresent(bsize) (bsize<6) +#define BankSizeBytes(bsize) (BankPresent(bsize) ? 1UL<<((bsize)+SN2_BANK_SIZE_SHIFT) : 0) +#endif + +typedef struct sn_memmap_s +{ + short nasid ; + short cpuconfig; + node_memmap_t node_memmap ; +} sn_memmap_t ; + +typedef struct sn_config_s +{ + int cpus; + int nodes; + sn_memmap_t memmap[1]; /* start of array */ +} sn_config_t; + + + +extern void build_init(unsigned long); +extern int build_efi_memmap(void *, int); +extern int GetNumNodes(void); +extern int GetNumCpus(void); +extern int IsCpuPresent(int, int); +extern int GetNasid(int); diff -urN linux-2.4.18/arch/ia64/sn/fakeprom/fprom.lds lia64-2.4/arch/ia64/sn/fakeprom/fprom.lds --- linux-2.4.18/arch/ia64/sn/fakeprom/fprom.lds Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/fakeprom/fprom.lds Mon Nov 19 23:22:49 2001 @@ -0,0 +1,96 @@ + +OUTPUT_FORMAT("elf64-ia64-little") +OUTPUT_ARCH(ia64) +ENTRY(_start) +SECTIONS +{ + v = 0x0000000000000000 ; /* this symbol is here to make debugging with kdb easier... */ + + . = (0x000000000000000 + 0x100000) ; + + _text = .; + .text : AT(ADDR(.text) - 0x0000000000000000 ) + { + *(__ivt_section) + /* these are not really text pages, but the zero page needs to be in a fixed location: */ + *(__special_page_section) + __start_gate_section = .; + *(__gate_section) + __stop_gate_section = .; + *(.text) + } + + /* Global data */ + _data = .; + + .rodata : AT(ADDR(.rodata) - 0x0000000000000000 ) + { *(.rodata) *(.rodata.*) } + .opd : AT(ADDR(.opd) - 0x0000000000000000 ) + { *(.opd) } + .data : AT(ADDR(.data) - 0x0000000000000000 ) + { *(.data) *(.gnu.linkonce.d*) CONSTRUCTORS } + + __gp = ALIGN (8) + 0x200000; + + .got : AT(ADDR(.got) - 0x0000000000000000 ) + { *(.got.plt) *(.got) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : AT(ADDR(.sdata) - 0x0000000000000000 ) + { *(.sdata) } + _edata = .; + _bss = .; + .sbss : AT(ADDR(.sbss) - 0x0000000000000000 ) + { *(.sbss) *(.scommon) } + .bss : AT(ADDR(.bss) - 0x0000000000000000 ) + { *(.bss) *(COMMON) } + . = ALIGN(64 / 8); + _end = .; + + /* Sections to be discarded */ + /DISCARD/ : { + *(.text.exit) + *(.data.exit) + } + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ + /* Discard them for now since Intel SoftSDV cannot handle them. + .comment 0 : { *(.comment) } + .note 0 : { *(.note) } + */ + /DISCARD/ : { *(.comment) } + /DISCARD/ : { *(.note) } +} diff -urN linux-2.4.18/arch/ia64/sn/fakeprom/fpromasm.S lia64-2.4/arch/ia64/sn/fakeprom/fpromasm.S --- linux-2.4.18/arch/ia64/sn/fakeprom/fpromasm.S Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/fakeprom/fpromasm.S Mon Feb 4 17:48:56 2002 @@ -0,0 +1,403 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * (Code copied from or=ther files) + * Copyright (C) 1998-2000 Hewlett-Packard Co + * Copyright (C) 1998-2000 David Mosberger-Tang + * + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + + + +#define __ASSEMBLY__ 1 +#include +#include +#include +#include + +/* + * This file contains additional set up code that is needed to get going on + * Medusa. This code should disappear once real hw is available. + * + * On entry to this routine, the following register values are assumed: + * + * gr[8] - BSP cpu + * pr[9] - kernel entry address + * pr[10] - cpu number on the node + * + * NOTE: + * This FPROM may be loaded/executed at an address different from the + * address that it was linked at. The FPROM is linked to run on node 0 + * at address 0x100000. If the code in loaded into another node, it + * must be loaded at offset 0x100000 of the node. In addition, the + * FPROM does the following things: + * - determine the base address of the node it is loaded on + * - add the node base to _gp. + * - add the node base to all addresses derived from "movl" + * instructions. (I couldnt get GPREL addressing to work) + * (maybe newer versions of the tools will support this) + * - scan the .got section and add the node base to all + * pointers in this section. + * - add the node base to all physical addresses in the + * SAL/PAL/EFI table built by the C code. (This is done + * in the C code - not here) + * - add the node base to the TLB entries for vmlinux + */ + +#define KERNEL_BASE 0xe000000000000000 +#define BOOT_PARAM_ADDR 0x40000 + + +/* + * ar.k0 gets set to IOPB_PA value, on 460gx chipset it should + * be 0x00000ffffc000000, but on snia we use the (inverse swizzled) + * IOSPEC_BASE value + */ +#ifdef CONFIG_IA64_SGI_SN1 +#define IOPB_PA 0xc0000FFFFC000000 +#else +#define IOPB_PA 0xc000000fcc000000 +#endif + +#define RR_RID 8 + + + +// ==================================================================================== + .text + .align 16 + .global _start + .proc _start +_start: + +// Setup psr and rse for system init + mov psr.l = r0;; + srlz.d;; + invala + mov ar.rsc = r0;; + loadrs + ;; + +// Isolate node number we are running on. + mov r6 = ip;; +#ifdef CONFIG_IA64_SGI_SN1 + shr r5 = r6,33;; // r5 = node number + shl r6 = r5,33 // r6 = base memory address of node +#else + shr r5 = r6,38 // r5 = node number + dep r6 = 0,r6,0,36 // r6 = base memory address of node + +#endif + + +// Set & relocate gp. + movl r1= __gp;; // Add base memory address + or r1 = r1,r6 // Relocate to boot node + +// Lets figure out who we are & put it in the LID register. +#ifdef CONFIG_IA64_SGI_SN2 +// On SN2, we (currently) pass the cpu number in r10 at boot + and r25=3,r10;; + movl r16=0x8000008110000400 // Allow IPIs + mov r17=-1;; + st8 [r16]=r17 + movl r16=0x8000008110060580;; // SHUB_ID + ld8 r27=[r16];; + extr.u r27=r27,32,11;; + shl r26=r25,28;; // Align local cpu# to lid.eid + shl r27=r27,16;; // Align NASID to lid.id + or r26=r26,r27;; // build the LID +#else +// The BR_PI_SELF_CPU_NUM register gives us a value of 0-3. +// This identifies the cpu on the node. +// Merge the cpu number with the NASID to generate the LID. + movl r24=0x80000a0001000020;; // BR_PI_SELF_CPU_NUM + ld8 r25=[r24] // Fetch PI_SELF + movl r27=0x80000a0001600000;; // Fetch REVID to get local NASID + ld8 r27=[r27];; + extr.u r27=r27,32,8;; + shl r26=r25,16;; // Align local cpu# to lid.eid + shl r27=r27,24;; // Align NASID to lid.id + or r26=r26,r27;; // build the LID +#endif + mov cr.lid=r26 // Now put in in the LID register + + movl r2=FPSR_DEFAULT;; + mov ar.fpsr=r2 + movl sp = bootstacke-16;; + or sp = sp,r6 // Relocate to boot node + +// Save the NASID that we are loaded on. + movl r2=base_nasid;; // Save base_nasid for C code + or r2 = r2,r6;; // Relocate to boot node + st8 [r2]=r5 // Uncond st8 - same on all cpus + +// Save the kernel entry address. It is passed in r9 on one of +// the cpus. + movl r2=bsp_entry_pc + cmp.ne p6,p0=r9,r0;; + or r2 = r2,r6;; // Relocate to boot node +(p6) st8 [r2]=r9 // Uncond st8 - same on all cpus + + +// The following can ONLY be done by 1 cpu. Lets set a lock - the +// cpu that gets it does the initilization. The rest just spin waiting +// til initilization is complete. + movl r22 = initlock;; + or r22 = r22,r6 // Relocate to boot node + mov r23 = 1;; + xchg8 r23 = [r22],r23;; + cmp.eq p6,p0 = 0,r23 +(p6) br.cond.spnt.few init +1: ld4 r23 = [r22];; + cmp.eq p6,p0 = 1,r23 +(p6) br.cond.sptk 1b + br initx + +// Add base address of node memory to each pointer in the .got section. +init: movl r16 = _GLOBAL_OFFSET_TABLE_;; + or r16 = r16,r6;; // Relocate to boot node +1: ld8 r17 = [r16];; + cmp.eq p6,p7=0,r17 +(p6) br.cond.sptk.few.clr 2f;; + or r17 = r17,r6;; // Relocate to boot node + st8 [r16] = r17,8 + br 1b +2: + mov r23 = 2;; // All done, release the spinning cpus + st4 [r22] = r23 +initx: + +// +// I/O-port space base address: +// + movl r2 = IOPB_PA;; + mov ar.k0 = r2 + + +// Now call main & pass it the current LID value. + alloc r0=ar.pfs,0,0,2,0 + mov r32=r26 + mov r33=r8;; + br.call.sptk.few rp=fmain + +// Initialize Region Registers +// + mov r10 = r0 + mov r2 = (13<<2) + mov r3 = r0;; +1: cmp4.gtu p6,p7 = 7, r3 + dep r10 = r3, r10, 61, 3 + dep r2 = r3, r2, RR_RID, 4;; +(p7) dep r2 = 0, r2, 0, 1;; +(p6) dep r2 = -1, r2, 0, 1;; + mov rr[r10] = r2 + add r3 = 1, r3;; + srlz.d;; + cmp4.gtu p6,p0 = 8, r3 +(p6) br.cond.sptk.few.clr 1b + +// +// Return value indicates if we are the BSP or AP. +// 1 = BSP, 0 = AP + mov cr.tpr=r0;; + cmp.eq p6,p0=r8,r0 +(p6) br.cond.spnt slave + +// +// Go to kernel C startup routines +// Need to do a "rfi" in order set "it" and "ed" bits in the PSR. +// This is the only way to set them. + + movl r28=BOOT_PARAM_ADDR + movl r2=bsp_entry_pc;; + or r28 = r28,r6;; // Relocate to boot node + or r2 = r2,r6;; // Relocate to boot node + ld8 r2=[r2];; + or r2=r2,r6;; + dep r2=0,r2,61,3;; // convert to phys mode + +// +// Turn on address translation, interrupt collection, psr.ed, protection key. +// Interrupts (PSR.i) are still off here. +// + + movl r3 = ( IA64_PSR_BN | \ + IA64_PSR_AC | \ + IA64_PSR_DB | \ + IA64_PSR_DA | \ + IA64_PSR_IC \ + ) + ;; + mov cr.ipsr = r3 + +// +// Go to kernel C startup routines +// Need to do a "rfi" in order set "it" and "ed" bits in the PSR. +// This is the only way to set them. + + mov r8=r28;; + bsw.1 ;; + mov r28=r8;; + bsw.0 ;; + mov cr.iip = r2 + srlz.d;; + rfi;; + + .endp _start + + + +// Slave processors come here to spin til they get an interrupt. Then they launch themselves to +// the place ap_entry points. No initialization is necessary - the kernel makes no +// assumptions about state on this entry. +// Note: should verify that the interrupt we got was really the ap_wakeup +// interrupt but this should not be an issue on medusa +slave: + nop.i 0x8beef // Medusa - put cpu to sleep til interrupt occurs + mov r8=cr.irr0;; // Check for interrupt pending. + cmp.eq p6,p0=r8,r0 +(p6) br.cond.sptk slave;; + + mov r8=cr.ivr;; // Got one. Must read ivr to accept it + srlz.d;; + mov cr.eoi=r0;; // must write eoi to clear + movl r8=ap_entry;; // now jump to kernel entry + or r8 = r8,r6;; // Relocate to boot node + ld8 r9=[r8],8;; + ld8 r1=[r8] + mov b0=r9;; + br b0 + +// Here is the kernel stack used for the fake PROM + .bss + .align 16384 +bootstack: + .skip 16384 +bootstacke: +initlock: + data4 + + + +////////////////////////////////////////////////////////////////////////////////////////////////////////// +// This code emulates the PAL. Only essential interfaces are emulated. + + + .text + .global pal_emulator + .proc pal_emulator +pal_emulator: + mov r8=-1 + + mov r9=256 + ;; + cmp.gtu p6,p7=r9,r28 /* r28 <= 255? */ +(p6) br.cond.sptk.few static + ;; + mov r9=512 + ;; + cmp.gtu p6,p7=r9,r28 +(p6) br.cond.sptk.few stacked + ;; + +static: cmp.eq p6,p7=6,r28 /* PAL_PTCE_INFO */ +(p7) br.cond.sptk.few 1f + movl r8=0 /* status = 0 */ + movl r9=0x100000000 /* tc.base */ + movl r10=0x0000000200000003 /* count[0], count[1] */ + movl r11=0x1000000000002000 /* stride[0], stride[1] */ + ;; + +1: cmp.eq p6,p7=14,r28 /* PAL_FREQ_RATIOS */ +(p7) br.cond.sptk.few 1f + movl r8=0 /* status = 0 */ + movl r9 =0x100000064 /* proc_ratio (1/100) */ + movl r10=0x100000100 /* bus_ratio<<32 (1/256) */ + movl r11=0x10000000a /* itc_ratio<<32 (1/100) */ + ;; + +1: cmp.eq p6,p7=8,r28 /* PAL_VM_SUMMARY */ +(p7) br.cond.sptk.few 1f + movl r8=0 +#ifdef CONFIG_IA64_SGI_SN1 + movl r9=0x0203083001151059 + movl r10=0x1232 +#else + movl r9=0x0203083001151065 + movl r10=0x183f +#endif + movl r11=0 + ;; + +1: cmp.eq p6,p7=19,r28 /* PAL_RSE_INFO */ +(p7) br.cond.sptk.few 1f + movl r8=0 + movl r9=0x60 + movl r10=0x0 + movl r11=0 + ;; + +1: cmp.eq p6,p7=15,r28 /* PAL_PERF_MON_INFO */ +(p7) br.cond.sptk.few 1f + movl r8=0 + movl r9=0x08122004 + movl r10=0x0 + movl r11=0 + mov r2=ar.lc + mov r3=16;; + mov ar.lc=r3 + mov r3=r29;; +5: st8 [r3]=r0,8 + br.cloop.sptk.few 5b;; + mov ar.lc=r2 + mov r3=r29 + movl r2=0x1fff;; /* PMC regs */ + st8 [r3]=r2 + add r3=32,r3 + movl r2=0x3ffff;; /* PMD regs */ + st8 [r3]=r2 + add r3=32,r3 + movl r2=0xf0;; /* cycle regs */ + st8 [r3]=r2 + add r3=32,r3 + movl r2=0x10;; /* retired regs */ + st8 [r3]=r2 + ;; + +1: cmp.eq p6,p7=19,r28 /* PAL_RSE_INFO */ +(p7) br.cond.sptk.few 1f + movl r8=0 /* status = 0 */ + movl r9=96 /* num phys stacked */ + movl r10=0 /* hints */ + movl r11=0 + ;; + +1: cmp.eq p6,p7=1,r28 /* PAL_CACHE_FLUSH */ +(p7) br.cond.sptk.few 1f + mov r9=ar.lc + movl r8=524288 /* flush 512k million cache lines (16MB) */ + ;; + mov ar.lc=r8 + movl r8=0xe000000000000000 + ;; +.loop: fc r8 + add r8=32,r8 + br.cloop.sptk.few .loop + sync.i + ;; + srlz.i + ;; + mov ar.lc=r9 + mov r8=r0 +1: br.cond.sptk.few rp + +stacked: + br.ret.sptk.few rp + + .endp pal_emulator + diff -urN linux-2.4.18/arch/ia64/sn/fakeprom/fw-emu.c lia64-2.4/arch/ia64/sn/fakeprom/fw-emu.c --- linux-2.4.18/arch/ia64/sn/fakeprom/fw-emu.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/fakeprom/fw-emu.c Tue Feb 26 13:19:34 2002 @@ -0,0 +1,836 @@ +/* + * PAL & SAL emulation. + * + * Copyright (C) 1998-2000 Hewlett-Packard Co + * Copyright (C) 1998-2000 David Mosberger-Tang + * + * + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/NoticeExplan + */ +#include +#include +#include +#include +#include +#include +#include +#ifdef CONFIG_IA64_SGI_SN2 +#include +#include +#endif +#include +#include "fpmem.h" + +#define zzACPI_1_0 1 /* Include ACPI 1.0 tables */ + +#define OEMID "SGI" +#ifdef CONFIG_IA64_SGI_SN1 +#define PRODUCT "SN1" +#define PROXIMITY_DOMAIN(nasid) (nasid) +#else +#define PRODUCT "SN2" +#define PROXIMITY_DOMAIN(nasid) (((nasid)>>1) & 255) +#endif + +#define MB (1024*1024UL) +#define GB (MB*1024UL) +#define BOOT_PARAM_ADDR 0x40000 +#define MAX(i,j) ((i) > (j) ? (i) : (j)) +#define MIN(i,j) ((i) < (j) ? (i) : (j)) +#define ABS(i) ((i) > 0 ? (i) : -(i)) +#define ALIGN8(p) (((long)(p) +7) & ~7) + +#define FPROM_BUG() do {while (1);} while (0) +#define MAX_SN_NODES 128 +#define MAX_LSAPICS 512 +#define MAX_CPUS 512 +#define MAX_CPUS_NODE 4 +#define CPUS_PER_NODE 4 +#define CPUS_PER_FSB 2 +#define CPUS_PER_FSB_MASK (CPUS_PER_FSB-1) + +#ifdef ACPI_1_0 +#define NUM_EFI_DESCS 3 +#else +#define NUM_EFI_DESCS 2 +#endif + +#define RSDP_CHECKSUM_LENGTH 20 + +typedef union ia64_nasid_va { + struct { +#if defined(CONFIG_IA64_SGI_SN1) + unsigned long off : 33; /* intra-region offset */ + unsigned long nasid : 7; /* NASID */ + unsigned long off2 : 21; /* fill */ + unsigned long reg : 3; /* region number */ +#elif defined(CONFIG_IA64_SGI_SN2) + unsigned long off : 36; /* intra-region offset */ + unsigned long attr : 2; + unsigned long nasid : 11; /* NASID */ + unsigned long off2 : 12; /* fill */ + unsigned long reg : 3; /* region number */ +#endif + } f; + unsigned long l; + void *p; +} ia64_nasid_va; + +typedef struct { + unsigned long pc; + unsigned long gp; +} func_ptr_t; + +#define IS_VIRTUAL_MODE() ({struct ia64_psr psr; asm("mov %0=psr" : "=r"(psr)); psr.dt;}) +#define ADDR_OF(p) (IS_VIRTUAL_MODE() ? ((void*)((long)(p)+PAGE_OFFSET)) : ((void*) (p))) + +#if defined(CONFIG_IA64_SGI_SN1) +#define __fwtab_pa(n,x) ({ia64_nasid_va _v; _v.l = (long) (x); _v.f.nasid = (x) ? (n) : 0; _v.f.reg = 0; _v.l;}) +#elif defined(CONFIG_IA64_SGI_SN2) +#define __fwtab_pa(n,x) ({ia64_nasid_va _v; _v.l = (long) (x); _v.f.nasid = (x) ? (n) : 0; _v.f.reg = 0; _v.f.attr = 3; _v.l;}) +#endif + +/* + * The following variables are passed thru registersfrom the configuration file and + * are set via the _start function. + */ +long base_nasid; +long num_cpus; +long bsp_entry_pc=0; +long num_nodes; +long app_entry_pc; +int bsp_lid; +func_ptr_t ap_entry; + + +extern void pal_emulator(void); +static efi_runtime_services_t *efi_runtime_p; +static char fw_mem[( sizeof(efi_system_table_t) + + sizeof(efi_runtime_services_t) + + NUM_EFI_DESCS*sizeof(efi_config_table_t) + + sizeof(struct ia64_sal_systab) + + sizeof(struct ia64_sal_desc_entry_point) + + sizeof(struct ia64_sal_desc_ap_wakeup) +#ifdef ACPI_1_0 + + sizeof(acpi_rsdp_t) + + sizeof(acpi_rsdt_t) + + sizeof(acpi_sapic_t) + + MAX_LSAPICS*(sizeof(acpi_entry_lsapic_t)) +#endif + + sizeof(acpi20_rsdp_t) + + sizeof(acpi_xsdt_t) + + sizeof(acpi_slit_t) + + MAX_SN_NODES*MAX_SN_NODES+8 + + sizeof(acpi_madt_t) + + 16*MAX_CPUS + + (1+8*MAX_SN_NODES)*(sizeof(efi_memory_desc_t)) + + sizeof(acpi_srat_t) + + MAX_CPUS*sizeof(srat_cpu_affinity_t) + + MAX_SN_NODES*sizeof(srat_memory_affinity_t) + + sizeof(ia64_sal_desc_ptc_t) + + + MAX_SN_NODES*sizeof(ia64_sal_ptc_domain_info_t) + + + MAX_CPUS*sizeof(ia64_sal_ptc_domain_proc_entry_t) + + + 1024)] __attribute__ ((aligned (8))); + + +static efi_status_t +efi_get_time (efi_time_t *tm, efi_time_cap_t *tc) +{ + if (tm) { + memset(tm, 0, sizeof(*tm)); + tm->year = 2000; + tm->month = 2; + tm->day = 13; + tm->hour = 10; + tm->minute = 11; + tm->second = 12; + } + + if (tc) { + tc->resolution = 10; + tc->accuracy = 12; + tc->sets_to_zero = 1; + } + + return EFI_SUCCESS; +} + +static void +efi_reset_system (int reset_type, efi_status_t status, unsigned long data_size, efi_char16_t *data) +{ + while(1); /* Is there a pseudo-op to stop medusa */ +} + +static efi_status_t +efi_success (void) +{ + return EFI_SUCCESS; +} + +static efi_status_t +efi_unimplemented (void) +{ + return EFI_UNSUPPORTED; +} + +#ifdef CONFIG_IA64_SGI_SN2 + +#undef cpu_physical_id +#define cpu_physical_id(cpuid) ((ia64_get_lid() >> 16) & 0xffff) + +void +fprom_send_cpei(void) { + long *p, val; + long physid; + long nasid, slice; + + physid = cpu_physical_id(0); + nasid = cpu_physical_id_to_nasid(physid); + slice = cpu_physical_id_to_slice(physid); + + p = (long*)GLOBAL_MMR_ADDR(nasid, SH_IPI_INT); + val = (1UL<pc = in2; + fp->gp = in3; + } else if (in1 == SAL_VECTOR_OS_MCA || in1 == SAL_VECTOR_OS_INIT) { + } else { + status = -1; + } + ; + } else if (index == SAL_GET_STATE_INFO) { + ; + } else if (index == SAL_GET_STATE_INFO_SIZE) { + ; + } else if (index == SAL_CLEAR_STATE_INFO) { + ; + } else if (index == SAL_MC_RENDEZ) { + ; + } else if (index == SAL_MC_SET_PARAMS) { + ; + } else if (index == SAL_CACHE_FLUSH) { + ; + } else if (index == SAL_CACHE_INIT) { + ; + } else if (index == SAL_UPDATE_PAL) { + ; +#ifdef CONFIG_IA64_SGI_SN2 + } else if (index == SN_SAL_LOG_CE) { +#ifdef ajmtestcpei + fprom_send_cpei(); +#else /* ajmtestcpei */ + ; +#endif /* ajmtestcpei */ +#endif + } else if (index == SN_SAL_PROBE) { + r9 = 0UL; + if (in2 == 4) { + r9 = *(unsigned *)in1; + if (r9 == -1) { + status = 1; + } + } else if (in2 == 2) { + r9 = *(unsigned short *)in1; + if (r9 == -1) { + status = 1; + } + } else if (in2 == 1) { + r9 = *(unsigned char *)in1; + if (r9 == -1) { + status = 1; + } + } else if (in2 == 8) { + r9 = *(unsigned long *)in1; + if (r9 == -1) { + status = 1; + } + } else { + status = 2; + } + } else if (index == SN_SAL_GET_KLCONFIG_ADDR) { + r9 = 0x30000; + } else if (index == SN_SAL_CONSOLE_PUTC) { + status = -1; + } else if (index == SN_SAL_CONSOLE_GETC) { + status = -1; + } else if (index == SN_SAL_CONSOLE_POLL) { + status = -1; + } else { + status = -1; + } + + asm volatile ("" :: "r"(r9), "r"(r10), "r"(r11)); + return status; +} + + +/* + * This is here to work around a bug in egcs-1.1.1b that causes the + * compiler to crash (seems like a bug in the new alias analysis code. + */ +void * +id (long addr) +{ + return (void *) addr; +} + + +/* + * Fix the addresses in a function pointer by adding base node address + * to pc & gp. + */ +void +fix_function_pointer(void *fp) +{ + func_ptr_t *_fp; + + _fp = fp; + _fp->pc = __fwtab_pa(base_nasid, _fp->pc); + _fp->gp = __fwtab_pa(base_nasid, _fp->gp); +} + +void +fix_virt_function_pointer(void **fptr) +{ + func_ptr_t *fp; + long *p; + + p = (long*)fptr; + fp = *fptr; + fp->pc = fp->pc | PAGE_OFFSET; + fp->gp = fp->gp | PAGE_OFFSET; + *p |= PAGE_OFFSET; +} + + +int +efi_set_virtual_address_map(void) +{ + efi_runtime_services_t *runtime; + + runtime = efi_runtime_p; + fix_virt_function_pointer((void**)&runtime->get_time); + fix_virt_function_pointer((void**)&runtime->set_time); + fix_virt_function_pointer((void**)&runtime->get_wakeup_time); + fix_virt_function_pointer((void**)&runtime->set_wakeup_time); + fix_virt_function_pointer((void**)&runtime->set_virtual_address_map); + fix_virt_function_pointer((void**)&runtime->get_variable); + fix_virt_function_pointer((void**)&runtime->get_next_variable); + fix_virt_function_pointer((void**)&runtime->set_variable); + fix_virt_function_pointer((void**)&runtime->get_next_high_mono_count); + fix_virt_function_pointer((void**)&runtime->reset_system); + return EFI_SUCCESS;; +} + +void +acpi_table_init(acpi_desc_table_hdr_t *p, char *sig, int siglen, int revision, int oem_revision) +{ + memcpy(p->signature, sig, siglen); + memcpy(p->oem_id, OEMID, 6); + memcpy(p->oem_table_id, sig, 4); + memcpy(p->oem_table_id+4, PRODUCT, 4); + p->revision = revision; + p->oem_revision = (revision<<16) + oem_revision; + p->creator_id = 1; + p->creator_revision = 1; +} + +void +acpi_checksum(acpi_desc_table_hdr_t *p, int length) +{ + u8 *cp, *cpe, checksum; + + p->checksum = 0; + p->length = length; + checksum = 0; + for (cp=(u8*)p, cpe=cp+p->length; cpchecksum = -checksum; +} + +void +acpi_checksum_rsdp20(acpi20_rsdp_t *p, int length) +{ + u8 *cp, *cpe, checksum; + + p->checksum = 0; + p->length = length; + checksum = 0; + for (cp=(u8*)p, cpe=cp+RSDP_CHECKSUM_LENGTH; cpchecksum = -checksum; +} + +int +nasid_present(int nasid) +{ + int cnode; + for (cnode=0; cnode= 1024) + arglen = 1023; + memcpy(cmd_line, args, arglen); + } else { + arglen = 0; + } + cmd_line[arglen] = '\0'; + /* + * For now, just bring up bash. + * If you want to execute all the startup scripts, delete the "init=..". + * You can also edit this line to pass other arguments to the kernel. + * Note: disable kernel text replication. + */ + strcpy(cmd_line, "init=/bin/bash ktreplicate=0"); + + memset(efi_systab, 0, sizeof(efi_systab)); + efi_systab->hdr.signature = EFI_SYSTEM_TABLE_SIGNATURE; + efi_systab->hdr.revision = EFI_SYSTEM_TABLE_REVISION; + efi_systab->hdr.headersize = sizeof(efi_systab->hdr); + efi_systab->fw_vendor = __fwtab_pa(base_nasid, vendor); + efi_systab->fw_revision = 1; + efi_systab->runtime = __fwtab_pa(base_nasid, efi_runtime); + efi_systab->nr_tables = 2; + efi_systab->tables = __fwtab_pa(base_nasid, efi_tables); + memcpy(vendor, "S\0i\0l\0i\0c\0o\0n\0-\0G\0r\0a\0p\0h\0i\0c\0s\0\0", 40); + + efi_runtime->hdr.signature = EFI_RUNTIME_SERVICES_SIGNATURE; + efi_runtime->hdr.revision = EFI_RUNTIME_SERVICES_REVISION; + efi_runtime->hdr.headersize = sizeof(efi_runtime->hdr); + efi_runtime->get_time = __fwtab_pa(base_nasid, &efi_get_time); + efi_runtime->set_time = __fwtab_pa(base_nasid, &efi_unimplemented); + efi_runtime->get_wakeup_time = __fwtab_pa(base_nasid, &efi_unimplemented); + efi_runtime->set_wakeup_time = __fwtab_pa(base_nasid, &efi_unimplemented); + efi_runtime->set_virtual_address_map = __fwtab_pa(base_nasid, &efi_set_virtual_address_map); + efi_runtime->get_variable = __fwtab_pa(base_nasid, &efi_unimplemented); + efi_runtime->get_next_variable = __fwtab_pa(base_nasid, &efi_unimplemented); + efi_runtime->set_variable = __fwtab_pa(base_nasid, &efi_unimplemented); + efi_runtime->get_next_high_mono_count = __fwtab_pa(base_nasid, &efi_unimplemented); + efi_runtime->reset_system = __fwtab_pa(base_nasid, &efi_reset_system); + + efi_tables->guid = SAL_SYSTEM_TABLE_GUID; + efi_tables->table = __fwtab_pa(base_nasid, sal_systab); + efi_tables++; +#ifdef ACPI_1_0 + efi_tables->guid = ACPI_TABLE_GUID; + efi_tables->table = __fwtab_pa(base_nasid, acpi_rsdp); + efi_tables++; +#endif + efi_tables->guid = ACPI_20_TABLE_GUID; + efi_tables->table = __fwtab_pa(base_nasid, acpi20_rsdp); + efi_tables++; + + fix_function_pointer(&efi_unimplemented); + fix_function_pointer(&efi_get_time); + fix_function_pointer(&efi_success); + fix_function_pointer(&efi_reset_system); + fix_function_pointer(&efi_set_virtual_address_map); + +#ifdef ACPI_1_0 + /* fill in the ACPI system table - has a pointer to the ACPI table header */ + memcpy(acpi_rsdp->signature, "RSD PTR ", 8); + acpi_rsdp->rsdt = (struct acpi_rsdt*)__fwtab_pa(base_nasid, acpi_rsdt); + + acpi_table_init(&acpi_rsdt->header, ACPI_RSDT_SIG, ACPI_RSDT_SIG_LEN, 1, 1); + acpi_rsdt->header.length = sizeof(acpi_rsdt_t); + acpi_rsdt->entry_ptrs[0] = __fwtab_pa(base_nasid, acpi_sapic); + + memcpy(acpi_sapic->header.signature, "SPIC ", 4); + acpi_sapic->header.length = sizeof(acpi_sapic_t)+num_cpus*sizeof(acpi_entry_lsapic_t); + + for (cnode=0; cnodetype = ACPI_ENTRY_LOCAL_SAPIC; + acpi_lsapic->length = sizeof(acpi_entry_lsapic_t); + acpi_lsapic->acpi_processor_id = cnode*4+cpu; + acpi_lsapic->flags = LSAPIC_ENABLED|LSAPIC_PRESENT; +#if defined(CONFIG_IA64_SGI_SN1) + acpi_lsapic->eid = cpu; + acpi_lsapic->id = nasid; +#else + acpi_lsapic->eid = nasid&0xffff; + acpi_lsapic->id = (cpu<<4) | (nasid>>16); +#endif + acpi_lsapic++; + } + } +#endif + + + /* fill in the ACPI20 system table - has a pointer to the ACPI table header */ + memcpy(acpi20_rsdp->signature, "RSD PTR ", 8); + acpi20_rsdp->xsdt = (struct acpi_xsdt*)__fwtab_pa(base_nasid, acpi_xsdt); + acpi20_rsdp->revision = 2; + acpi_checksum_rsdp20(acpi20_rsdp, sizeof(acpi20_rsdp_t)); + + /* Set up the XSDT table - contains pointers to the other ACPI tables */ + acpi_table_init(&acpi_xsdt->header, ACPI_XSDT_SIG, ACPI_XSDT_SIG_LEN, 1, 1); + acpi_xsdt->entry_ptrs[0] = __fwtab_pa(base_nasid, acpi_madt); + acpi_xsdt->entry_ptrs[1] = __fwtab_pa(base_nasid, acpi_slit); + acpi_xsdt->entry_ptrs[2] = __fwtab_pa(base_nasid, acpi_srat); + acpi_checksum(&acpi_xsdt->header, sizeof(acpi_xsdt_t) + 16); + + /* Set up the MADT table */ + acpi_table_init(&acpi_madt->header, ACPI_MADT_SIG, ACPI_MADT_SIG_LEN, 1, 1); + lsapic20 = (acpi20_entry_lsapic_t*) (acpi_madt + 1); + for (cnode=0; cnodetype = ACPI20_ENTRY_LOCAL_SAPIC; + lsapic20->length = sizeof(acpi_entry_lsapic_t); + lsapic20->acpi_processor_id = cnode*4+cpu; + lsapic20->flags = LSAPIC_ENABLED|LSAPIC_PRESENT; +#if defined(CONFIG_IA64_SGI_SN1) + lsapic20->eid = cpu; + lsapic20->id = nasid; +#else + lsapic20->eid = nasid&0xffff; + lsapic20->id = (cpu<<4) | (nasid>>16); +#endif + lsapic20 = (acpi20_entry_lsapic_t*) ((long)lsapic20+sizeof(acpi_entry_lsapic_t)); + } + } + acpi_checksum(&acpi_madt->header, (char*)lsapic20 - (char*)acpi_madt); + + /* Set up the SRAT table */ + acpi_table_init(&acpi_srat->header, ACPI_SRAT_SIG, ACPI_SRAT_SIG_LEN, ACPI_SRAT_REVISION, 1); + ptr = acpi_srat+1; + for (cnode=0; cnodetype = SRAT_MEMORY_STRUCTURE; + srat_memory_affinity->length = sizeof(srat_memory_affinity_t); + srat_memory_affinity->proximity_domain = PROXIMITY_DOMAIN(nasid); + srat_memory_affinity->base_addr_lo = 0; + srat_memory_affinity->length_lo = 0; +#if defined(CONFIG_IA64_SGI_SN1) + srat_memory_affinity->base_addr_hi = nasid<<1; + srat_memory_affinity->length_hi = SN1_NODE_SIZE>>32; +#else + srat_memory_affinity->base_addr_hi = (nasid<<6) | (3<<4); + srat_memory_affinity->length_hi = SN2_NODE_SIZE>>32; +#endif + srat_memory_affinity->memory_type = ACPI_ADDRESS_RANGE_MEMORY; + srat_memory_affinity->flags = SRAT_MEMORY_FLAGS_ENABLED; + } + + for (cnode=0; cnodetype = SRAT_CPU_STRUCTURE; + srat_cpu_affinity->length = sizeof(srat_cpu_affinity_t); + srat_cpu_affinity->proximity_domain = PROXIMITY_DOMAIN(nasid); + srat_cpu_affinity->flags = SRAT_CPU_FLAGS_ENABLED; +#if defined(CONFIG_IA64_SGI_SN1) + srat_cpu_affinity->apic_id = nasid; + srat_cpu_affinity->local_sapic_eid = cpu; +#else + srat_cpu_affinity->local_sapic_eid = nasid&0xffff; + srat_cpu_affinity->apic_id = (cpu<<4) | (nasid>>16); +#endif + } + } + acpi_checksum(&acpi_srat->header, (char*)ptr - (char*)acpi_srat); + + + /* Set up the SLIT table */ + acpi_table_init(&acpi_slit->header, ACPI_SLIT_SIG, ACPI_SLIT_SIG_LEN, ACPI_SLIT_REVISION, 1); + acpi_slit->localities = PROXIMITY_DOMAIN(max_nasid)+1; + cp=acpi_slit->entries; + memset(cp, 255, acpi_slit->localities*acpi_slit->localities); + + for (i=0; i<=max_nasid; i++) + for (j=0; j<=max_nasid; j++) + if (nasid_present(i) && nasid_present(j)) + *(cp+PROXIMITY_DOMAIN(i)*acpi_slit->localities+PROXIMITY_DOMAIN(j)) = 10 + MIN(254, 5*ABS(i-j)); + + cp = acpi_slit->entries + acpi_slit->localities*acpi_slit->localities; + acpi_checksum(&acpi_slit->header, cp - (char*)acpi_slit); + + + /* fill in the SAL system table: */ + memcpy(sal_systab->signature, "SST_", 4); + sal_systab->size = sizeof(*sal_systab); + sal_systab->sal_rev_minor = 1; + sal_systab->sal_rev_major = 0; + sal_systab->entry_count = 3; + + strcpy(sal_systab->oem_id, "SGI"); + strcpy(sal_systab->product_id, "SN1"); + + /* fill in an entry point: */ + sal_ed->type = SAL_DESC_ENTRY_POINT; + sal_ed->pal_proc = __fwtab_pa(base_nasid, pal_desc[0]); + sal_ed->sal_proc = __fwtab_pa(base_nasid, sal_desc[0]); + sal_ed->gp = __fwtab_pa(base_nasid, sal_desc[1]); + + /* kludge the PTC domain info */ + sal_ptc->type = SAL_DESC_PTC; + sal_ptc->num_domains = 0; + sal_ptc->domain_info = __fwtab_pa(base_nasid, sal_ptcdi); + cpus_found = 0; + last_domain = -1; + sal_ptcdi--; + for (cnode=0; cnodenum_domains++; + sal_ptcdi++; + sal_ptcdi->proc_count = 0; + sal_ptcdi->proc_list = __fwtab_pa(base_nasid, sal_ptclid); + last_domain = domain; + } + sal_ptcdi->proc_count++; + sal_ptclid->id = nasid; + sal_ptclid->eid = cpu; + sal_ptclid++; + cpus_found++; + } + } + } + + if (cpus_found != num_cpus) + FPROM_BUG(); + + /* Make the AP WAKEUP entry */ + sal_apwake->type = SAL_DESC_AP_WAKEUP; + sal_apwake->mechanism = IA64_SAL_AP_EXTERNAL_INT; + sal_apwake->vector = 18; + + for (checksum=0, cp=(char*)sal_systab; cp < (char *)efi_memmap; ++cp) + checksum += *cp; + sal_systab->checksum = -checksum; + + /* If the checksum is correct, the kernel tries to use the + * table. We dont build enough table & the kernel aborts. + * Note that the PROM hasd thhhe same problem!! + */ +#ifdef DOESNT_WORK + for (checksum=0, cp=(char*)acpi_rsdp, cpe=cp+RSDP_CHECKSUM_LENGTH; cpchecksum = -checksum; +#endif + + md = &efi_memmap[0]; + num_memmd = build_efi_memmap((void *)md, mdsize) ; + + bp = (struct ia64_boot_param*) __fwtab_pa(base_nasid, BOOT_PARAM_ADDR); + bp->efi_systab = __fwtab_pa(base_nasid, &fw_mem); + bp->efi_memmap = __fwtab_pa(base_nasid, efi_memmap); + bp->efi_memmap_size = num_memmd*mdsize; + bp->efi_memdesc_size = mdsize; + bp->efi_memdesc_version = 0x101; + bp->command_line = __fwtab_pa(base_nasid, cmd_line); + bp->console_info.num_cols = 80; + bp->console_info.num_rows = 25; + bp->console_info.orig_x = 0; + bp->console_info.orig_y = 24; + bp->fpswa = 0; + + /* + * Now pick the BSP & store it LID value in + * a global variable. Note if BSP is greater than last cpu, + * pick the last cpu. + */ + for (cnode=0; cnode 0) + continue; + return; + } + } +} diff -urN linux-2.4.18/arch/ia64/sn/fakeprom/klgraph_init.c lia64-2.4/arch/ia64/sn/fakeprom/klgraph_init.c --- linux-2.4.18/arch/ia64/sn/fakeprom/klgraph_init.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/fakeprom/klgraph_init.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,287 @@ +/* $Id: klgraph_init.c,v 1.2 2001/12/05 16:58:41 jh Exp $ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All Rights Reserved. + */ + + +/* + * This is a temporary file that statically initializes the expected + * initial klgraph information that is normally provided by prom. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SYNERGY_WIDGET ((char *)0xc0000e0000000000) +#define SYNERGY_SWIZZLE ((char *)0xc0000e0000000400) +#define HUBREG ((char *)0xc0000a0001e00000) +#define WIDGET0 ((char *)0xc0000a0000000000) +#define WIDGET4 ((char *)0xc0000a0000000004) + +#define SYNERGY_WIDGET ((char *)0xc0000e0000000000) +#define SYNERGY_SWIZZLE ((char *)0xc0000e0000000400) +#define HUBREG ((char *)0xc0000a0001e00000) +#define WIDGET0 ((char *)0xc0000a0000000000) + +#define convert(a,b,c) temp = (u64 *)a; *temp = b; temp++; *temp = c +void +klgraph_init(void) +{ + + u64 *temp; + + /* + * Initialize some hub/xbow registers that allows access to + * Xbridge etc. These are normally done in PROM. + */ + + /* Write IOERR clear to clear the CRAZY bit in the status */ +#ifdef CONFIG_IA64_SGI_SN1 + *(volatile uint64_t *)0xc0000a0001c001f8 = (uint64_t)0xffffffff; + + /* set widget control register...setting bedrock widget id to b */ + *(volatile uint64_t *)0xc0000a0001c00020 = (uint64_t)0x801b; + + /* set io outbound widget access...allow all */ + *(volatile uint64_t *)0xc0000a0001c00110 = (uint64_t)0xff01; + + /* set io inbound widget access...allow all */ + *(volatile uint64_t *)0xc0000a0001c00118 = (uint64_t)0xff01; + + /* set io crb timeout to max */ + *(volatile uint64_t *)0xc0000a0001c003c0 = (uint64_t)0xffffff; + *(volatile uint64_t *)0xc0000a0001c003c0 = (uint64_t)0xffffff; + + /* set local block io permission...allow all */ + *(volatile uint64_t *)0xc0000a0001e04010 = (uint64_t)0xfffffffffffffff; + + /* clear any errors */ + /* clear_ii_error(); medusa should have cleared these */ + + /* set default read response buffers in bridge */ + *(volatile u32 *)0xc0000a000f000280L = 0xba98; + *(volatile u32 *)0xc0000a000f000288L = 0xba98; +#elif CONFIG_IA64_SGI_SN2 + *(volatile uint64_t *)0xc000000801c001f8 = (uint64_t)0xffffffff; + + /* set widget control register...setting bedrock widget id to a */ + *(volatile uint64_t *)0xc000000801c00020 = (uint64_t)0x801a; + + /* set io outbound widget access...allow all */ + *(volatile uint64_t *)0xc000000801c00110 = (uint64_t)0xff01; + + /* set io inbound widget access...allow all */ + *(volatile uint64_t *)0xc000000801c00118 = (uint64_t)0xff01; + + /* set io crb timeout to max */ + *(volatile uint64_t *)0xc000000801c003c0 = (uint64_t)0xffffff; + *(volatile uint64_t *)0xc000000801c003c0 = (uint64_t)0xffffff; + + /* set local block io permission...allow all */ +// [LB] *(volatile uint64_t *)0xc000000801e04010 = (uint64_t)0xfffffffffffffff; + + /* clear any errors */ + /* clear_ii_error(); medusa should have cleared these */ + + /* set default read response buffers in bridge */ +// [PI] *(volatile u32 *)0xc00000080f000280L = 0xba98; +// [PI] *(volatile u32 *)0xc00000080f000288L = 0xba98; +#endif /* CONFIG_IA64_SGI_SN1 */ + + /* + * kldir entries initialization - mankato + */ + convert(0x8000000000002000, 0x0000000000000000, 0x0000000000000000); + convert(0x8000000000002010, 0x0000000000000000, 0x0000000000000000); + convert(0x8000000000002020, 0x0000000000000000, 0x0000000000000000); + convert(0x8000000000002030, 0x0000000000000000, 0x0000000000000000); + convert(0x8000000000002040, 0x434d5f53505f5357, 0x0000000000030000); + convert(0x8000000000002050, 0x0000000000000000, 0x0000000000010000); + convert(0x8000000000002060, 0x0000000000000001, 0x0000000000000000); + convert(0x8000000000002070, 0x0000000000000000, 0x0000000000000000); + convert(0x8000000000002080, 0x0000000000000000, 0x0000000000000000); + convert(0x8000000000002090, 0x0000000000000000, 0x0000000000000000); + convert(0x80000000000020a0, 0x0000000000000000, 0x0000000000000000); + convert(0x80000000000020b0, 0x0000000000000000, 0x0000000000000000); + convert(0x80000000000020c0, 0x434d5f53505f5357, 0x0000000000000000); + convert(0x80000000000020d0, 0x0000000000002400, 0x0000000000000400); + convert(0x80000000000020e0, 0x0000000000000001, 0x0000000000000000); + convert(0x80000000000020f0, 0x0000000000000000, 0x0000000000000000); + convert(0x8000000000002100, 0x434d5f53505f5357, 0x0000000000040000); + convert(0x8000000000002110, 0x0000000000000000, 0xffffffffffffffff); + convert(0x8000000000002120, 0x0000000000000001, 0x0000000000000000); + convert(0x8000000000002130, 0x0000000000000000, 0x0000000000000000); + convert(0x8000000000002140, 0x0000000000000000, 0x0000000000000000); + convert(0x8000000000002150, 0x0000000000000000, 0x0000000000000000); + convert(0x8000000000002160, 0x0000000000000000, 0x0000000000000000); + convert(0x8000000000002170, 0x0000000000000000, 0x0000000000000000); + convert(0x8000000000002180, 0x434d5f53505f5357, 0x0000000000020000); + convert(0x8000000000002190, 0x0000000000000000, 0x0000000000010000); + convert(0x80000000000021a0, 0x0000000000000001, 0x0000000000000000); + + /* + * klconfig entries initialization - mankato + */ + convert(0x0000000000030000, 0x00000000beedbabe, 0x0000004800000000); + convert(0x0000000000030010, 0x0003007000000018, 0x800002000f820178); + convert(0x0000000000030020, 0x80000a000f024000, 0x800002000f800000); + convert(0x0000000000030030, 0x0300fafa00012580, 0x00000000040f0000); + convert(0x0000000000030040, 0x0000000000000000, 0x0003097000030070); + convert(0x0000000000030050, 0x00030970000303b0, 0x0003181000033f70); + convert(0x0000000000030060, 0x0003d51000037570, 0x0000000000038330); + convert(0x0000000000030070, 0x0203110100030140, 0x0001000000000101); + convert(0x0000000000030080, 0x0900000000000000, 0x000000004e465e67); + convert(0x0000000000030090, 0x0003097000000000, 0x00030b1000030a40); + convert(0x00000000000300a0, 0x00030cb000030be0, 0x000315a0000314d0); + convert(0x00000000000300b0, 0x0003174000031670, 0x0000000000000000); + convert(0x0000000000030100, 0x000000000000001a, 0x3350490000000000); + convert(0x0000000000030110, 0x0000000000000037, 0x0000000000000000); + convert(0x0000000000030140, 0x0002420100030210, 0x0001000000000101); + convert(0x0000000000030150, 0x0100000000000000, 0xffffffffffffffff); + convert(0x0000000000030160, 0x00030d8000000000, 0x0000000000030e50); + convert(0x00000000000301c0, 0x0000000000000000, 0x0000000000030070); + convert(0x00000000000301d0, 0x0000000000000025, 0x424f490000000000); + convert(0x00000000000301e0, 0x000000004b434952, 0x0000000000000000); + convert(0x0000000000030210, 0x00027101000302e0, 0x00010000000e4101); + convert(0x0000000000030220, 0x0200000000000000, 0xffffffffffffffff); + convert(0x0000000000030230, 0x00030f2000000000, 0x0000000000030ff0); + convert(0x0000000000030290, 0x0000000000000000, 0x0000000000030140); + convert(0x00000000000302a0, 0x0000000000000026, 0x7262490000000000); + convert(0x00000000000302b0, 0x00000000006b6369, 0x0000000000000000); + convert(0x00000000000302e0, 0x0002710100000000, 0x00010000000f3101); + convert(0x00000000000302f0, 0x0500000000000000, 0xffffffffffffffff); + convert(0x0000000000030300, 0x000310c000000000, 0x0003126000031190); + convert(0x0000000000030310, 0x0003140000031330, 0x0000000000000000); + convert(0x0000000000030360, 0x0000000000000000, 0x0000000000030140); + convert(0x0000000000030370, 0x0000000000000029, 0x7262490000000000); + convert(0x0000000000030380, 0x00000000006b6369, 0x0000000000000000); + convert(0x0000000000030970, 0x0000000002010102, 0x0000000000000000); + convert(0x0000000000030980, 0x000000004e465e67, 0xffffffff00000000); + /* convert(0x00000000000309a0, 0x0000000000037570, 0x0000000100000000); */ + convert(0x00000000000309a0, 0x0000000000037570, 0xffffffff00000000); + convert(0x00000000000309b0, 0x0000000000030070, 0x0000000000000000); + convert(0x00000000000309c0, 0x000000000003f420, 0x0000000000000000); + convert(0x0000000000030a40, 0x0000000002010125, 0x0000000000000000); + convert(0x0000000000030a50, 0xffffffffffffffff, 0xffffffff00000000); + convert(0x0000000000030a70, 0x0000000000037b78, 0x0000000000000000); + convert(0x0000000000030b10, 0x0000000002010125, 0x0000000000000000); + convert(0x0000000000030b20, 0xffffffffffffffff, 0xffffffff00000000); + convert(0x0000000000030b40, 0x0000000000037d30, 0x0000000000000001); + convert(0x0000000000030be0, 0x00000000ff010203, 0x0000000000000000); + convert(0x0000000000030bf0, 0xffffffffffffffff, 0xffffffff000000ff); + convert(0x0000000000030c10, 0x0000000000037ee8, 0x0100010000000200); + convert(0x0000000000030cb0, 0x00000000ff310111, 0x0000000000000000); + convert(0x0000000000030cc0, 0xffffffffffffffff, 0x0000000000000000); + convert(0x0000000000030d80, 0x0000000002010104, 0x0000000000000000); + convert(0x0000000000030d90, 0xffffffffffffffff, 0x00000000000000ff); + convert(0x0000000000030db0, 0x0000000000037f18, 0x0000000000000000); + convert(0x0000000000030dc0, 0x0000000000000000, 0x0003007000060000); + convert(0x0000000000030de0, 0x0000000000000000, 0x0003021000050000); + convert(0x0000000000030df0, 0x000302e000050000, 0x0000000000000000); + convert(0x0000000000030e30, 0x0000000000000000, 0x000000000000000a); + convert(0x0000000000030e50, 0x00000000ff00011a, 0x0000000000000000); + convert(0x0000000000030e60, 0xffffffffffffffff, 0x0000000000000000); + convert(0x0000000000030e80, 0x0000000000037fe0, 0x9e6e9e9e9e9e9e9e); + convert(0x0000000000030e90, 0x000000000000bc6e, 0x0000000000000000); + convert(0x0000000000030f20, 0x0000000002010205, 0x00000000d0020000); + convert(0x0000000000030f30, 0xffffffffffffffff, 0x0000000e0000000e); + convert(0x0000000000030f40, 0x000000000000000e, 0x0000000000000000); + convert(0x0000000000030f50, 0x0000000000038010, 0x00000000000007ff); + convert(0x0000000000030f70, 0x0000000000000000, 0x0000000022001077); + convert(0x0000000000030fa0, 0x0000000000000000, 0x000000000003f4a8); + convert(0x0000000000030ff0, 0x0000000000310120, 0x0000000000000000); + convert(0x0000000000031000, 0xffffffffffffffff, 0xffffffff00000002); + convert(0x0000000000031010, 0x000000000000000e, 0x0000000000000000); + convert(0x0000000000031020, 0x0000000000038088, 0x0000000000000000); + convert(0x00000000000310c0, 0x0000000002010205, 0x00000000d0020000); + convert(0x00000000000310d0, 0xffffffffffffffff, 0x0000000f0000000f); + convert(0x00000000000310e0, 0x000000000000000f, 0x0000000000000000); + convert(0x00000000000310f0, 0x00000000000380b8, 0x00000000000007ff); + convert(0x0000000000031120, 0x0000000022001077, 0x00000000000310a9); + convert(0x0000000000031130, 0x00000000580211c1, 0x000000008009104c); + convert(0x0000000000031140, 0x0000000000000000, 0x000000000003f4c0); + convert(0x0000000000031190, 0x0000000000310120, 0x0000000000000000); + convert(0x00000000000311a0, 0xffffffffffffffff, 0xffffffff00000003); + convert(0x00000000000311b0, 0x000000000000000f, 0x0000000000000000); + convert(0x00000000000311c0, 0x0000000000038130, 0x0000000000000000); + convert(0x0000000000031260, 0x0000000000110106, 0x0000000000000000); + convert(0x0000000000031270, 0xffffffffffffffff, 0xffffffff00000004); + convert(0x0000000000031280, 0x000000000000000f, 0x0000000000000000); + convert(0x00000000000312a0, 0x00000000ff110013, 0x0000000000000000); + convert(0x00000000000312b0, 0xffffffffffffffff, 0xffffffff00000000); + convert(0x00000000000312c0, 0x000000000000000f, 0x0000000000000000); + convert(0x00000000000312e0, 0x0000000000110012, 0x0000000000000000); + convert(0x00000000000312f0, 0xffffffffffffffff, 0xffffffff00000000); + convert(0x0000000000031300, 0x000000000000000f, 0x0000000000000000); + convert(0x0000000000031310, 0x0000000000038160, 0x0000000000000000); + convert(0x0000000000031330, 0x00000000ff310122, 0x0000000000000000); + convert(0x0000000000031340, 0xffffffffffffffff, 0xffffffff00000005); + convert(0x0000000000031350, 0x000000000000000f, 0x0000000000000000); + convert(0x0000000000031360, 0x0000000000038190, 0x0000000000000000); + convert(0x0000000000031400, 0x0000000000310121, 0x0000000000000000); + convert(0x0000000000031400, 0x0000000000310121, 0x0000000000000000); + convert(0x0000000000031410, 0xffffffffffffffff, 0xffffffff00000006); + convert(0x0000000000031420, 0x000000000000000f, 0x0000000000000000); + convert(0x0000000000031430, 0x00000000000381c0, 0x0000000000000000); + convert(0x00000000000314d0, 0x00000000ff010201, 0x0000000000000000); + convert(0x00000000000314e0, 0xffffffffffffffff, 0xffffffff00000000); + convert(0x0000000000031500, 0x00000000000381f0, 0x000030430000ffff); + convert(0x0000000000031510, 0x000000000000ffff, 0x0000000000000000); + convert(0x00000000000315a0, 0x00000020ff000201, 0x0000000000000000); + convert(0x00000000000315b0, 0xffffffffffffffff, 0xffffffff00000001); + convert(0x00000000000315d0, 0x0000000000038240, 0x00003f3f0000ffff); + convert(0x00000000000315e0, 0x000000000000ffff, 0x0000000000000000); + convert(0x0000000000031670, 0x00000000ff010201, 0x0000000000000000); + convert(0x0000000000031680, 0xffffffffffffffff, 0x0000000100000002); + convert(0x00000000000316a0, 0x0000000000038290, 0x000030430000ffff); + convert(0x00000000000316b0, 0x000000000000ffff, 0x0000000000000000); + convert(0x0000000000031740, 0x00000020ff000201, 0x0000000000000000); + convert(0x0000000000031750, 0xffffffffffffffff, 0x0000000500000003); + convert(0x0000000000031770, 0x00000000000382e0, 0x00003f3f0000ffff); + convert(0x0000000000031780, 0x000000000000ffff, 0x0000000000000000); + + /* + * GDA initialization - mankato + */ + convert(0x8000000000002400, 0x0000000258464552, 0x000000000ead0000); + convert(0x8000000000002480, 0xffffffff00010000, 0xffffffffffffffff); + convert(0x8000000000002490, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x80000000000024a0, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x80000000000024b0, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x80000000000024c0, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x80000000000024d0, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x80000000000024e0, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x80000000000024f0, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x8000000000002500, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x8000000000002510, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x8000000000002520, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x8000000000002530, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x8000000000002540, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x8000000000002550, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x8000000000002560, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x8000000000002570, 0xffffffffffffffff, 0xffffffffffffffff); + convert(0x8000000000002580, 0x000000000000ffff, 0x0000000000000000); + +} + diff -urN linux-2.4.18/arch/ia64/sn/fakeprom/main.c lia64-2.4/arch/ia64/sn/fakeprom/main.c --- linux-2.4.18/arch/ia64/sn/fakeprom/main.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/fakeprom/main.c Mon Nov 19 23:22:50 2001 @@ -0,0 +1,125 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2000-2001 Silicon Graphics, Inc. All rights reserved. + */ + + + +#include +#include +#include + +extern void klgraph_init(void); +void bedrock_init(int); +void synergy_init(int, int); +void sys_fw_init (const char *args, int arglen, int bsp); + +volatile int bootmaster=0; /* Used to pick bootmaster */ +volatile int nasidmaster[128]={0}; /* Used to pick node/synergy masters */ +int init_done=0; +extern int bsp_lid; + +#define get_bit(b,p) (((*p)>>(b))&1) + +int +fmain(int lid, int bsp) { + int syn, nasid, cpu; + + /* + * First lets figure out who we are. This is done from the + * LID passed to us. + */ + +#ifdef CONFIG_IA64_SGI_SN1 + nasid = (lid>>24); + syn = (lid>>17)&1; + cpu = (lid>>16)&1; + + /* + * Now pick a synergy master to initialize synergy registers. + */ + if (test_and_set_bit(syn, &nasidmaster[nasid]) == 0) { + synergy_init(nasid, syn); + test_and_set_bit(syn+2, &nasidmaster[nasid]); + } else + while (get_bit(syn+2, &nasidmaster[nasid]) == 0); +#else + nasid = (lid>>16)&0xfff; + cpu = (lid>>28)&3; + syn = 0; +#endif + + /* + * Now pick a nasid master to initialize Bedrock registers. + */ + if (test_and_set_bit(8, &nasidmaster[nasid]) == 0) { + bedrock_init(nasid); + test_and_set_bit(9, &nasidmaster[nasid]); + } else + while (get_bit(9, &nasidmaster[nasid]) == 0); + + + /* + * Now pick a BSP & finish init. + */ + if (test_and_set_bit(0, &bootmaster) == 0) { + sys_fw_init(0, 0, bsp); + test_and_set_bit(1, &bootmaster); + } else + while (get_bit(1, &bootmaster) == 0); + + return (lid == bsp_lid); +} + + +void +bedrock_init(int nasid) +{ + nasid = nasid; /* to quiet gcc */ +#if 0 + /* + * Undef if you need fprom to generate a 1 node klgraph + * information .. only works for 1 node for nasid 0. + */ + klgraph_init(); +#endif +} + + +void +synergy_init(int nasid, int syn) +{ + long *base; + long off; + + /* + * Enable all FSB flashed interrupts. + * ZZZ - I'd really like defines for this...... + */ + base = (long*)0x80000e0000000000LL; /* base of synergy regs */ + for (off = 0x2a0; off < 0x2e0; off+=8) /* offset for VEC_MASK_{0-3}_A/B */ + *(base+off/8) = -1LL; + + /* + * Set the NASID in the FSB_CONFIG register. + */ + base = (long*)0x80000e0000000450LL; + *base = (long)((nasid<<16)|(syn<<9)); +} + + +/* Why isnt there a bcopy/memcpy in lib64.a */ + +void* +memcpy(void * dest, const void *src, size_t count) +{ + char *s, *se, *d; + + for(d=dest, s=(char*)src, se=s+count; s] <-p> | <-k> [] + -p Create PROM control file & links + -k Create LINUX control file & links + -c Control file name [Default: cf] + Path to directory that contains the linux or PROM files. + The directory can be any of the following: + (linux simulations) + worktree + worktree/linux + any directory with vmlinux, vmlinux.sym & fprom files + (prom simulations) + worktree + worktree/stand/arcs/IP37prom/dev + any directory with fw.bin & fw.sim files + + Simulations: + sim [-X ] [-o ] [-M] [] + -c Control file name [Default: cf] + -M Pipe output thru fmtmedusa + -o Output filename (copy of all commands/output) [Default: simout] + -X Specifies number of instructions to execute [Default: 0] + (Used only in auto test mode - not described here) + +Examples: + sim -p # create control file (cf) & links for prom simulations + sim -k # create control file (cf) & links for linux simulations + sim -p -c cfprom # create a prom control file (cfprom) only. No links are made. + + sim # run medusa using previously created links & + # control file (cf). +END +exit 1 +} + +# ----------------------- create control file header -------------------- +create_cf_header() { +cat <>$CF +# +# Template for a control file for running linux kernels under medusa. +# You probably want to make mods here but this is a good starting point. +# + +# Preferences +setenv cpu_stepping A +setenv exceptionPrint off +setenv interrupt_messages off +setenv lastPCsize 100000 +setenv low_power_mode on +setenv partialIntelChipSet on +setenv printIntelMessages off +setenv prom_write_action halt +setenv prom_write_messages on +setenv step_quantum 100 +setenv swizzling on +setenv tsconsole on +setenv uart_echo on +symbols on + +# IDE disk params +setenv diskCylinders 611 +setenv bootDrive C +setenv diskHeads 16 +setenv diskPath idedisk +setenv diskPresent 1 +setenv diskSpt 63 + +# Hardware config +setenv coherency_type nasid +setenv cpu_cache_type default +setenv synergy_cache_type syn_cac_64m_8w +setenv l4_uc_snoop off + +# Numalink config +setenv route_enable on +setenv network_type router # Select [xbar|router] +setenv network_warning 0xff + +END +} + + +# ------------------ create control file entries for linux simulations ------------- +create_cf_linux() { +cat <>$CF +# Kernel specific options +setenv calias_size 0 +setenv mca_on_memory_failure off +setenv LOADPC 0x00100000 # FPROM load address/entry point (8 digits!) +setenv symbol_table vmlinux.sym +load fprom +load vmlinux + +# Useful breakpoints to always have set. Add more if desired. +break 0xe000000000505e00 all # dispatch_to_fault_handler +break panic all # stop on panic +break die_if_kernel all # may as well stop + +END +} + +# ------------------ create control file entries for prom simulations --------------- +create_cf_prom() { + SYM2="" + ADDR="0x80000000ff800000" + [ "$EMBEDDED_LINUX" != "0" ] || SYM2="setenv symbol_table2 vmlinux.sym" + [ "$SIZE" = "8MB" ] || ADDR="0x80000000ffc00000" + cat <>$CF +# PROM specific options +setenv mca_on_memory_failure on +setenv LOADPC 0x80000000ffffffb0 +setenv promFile fw.bin +setenv promAddr $ADDR +setenv symbol_table fw.sym +$SYM2 + +# Useful breakpoints to always have set. Add more if desired. +break ivt_gexx all +break ivt_brk all +break PROM_Panic_Spin all +break PROM_Panic all +break PROM_C_Panic all +break fled_die all +break ResetNow all +break zzzbkpt all + +END +} + + +# ------------------ create control file entries for memory configuration ------------- +create_cf_memory() { +cat <>$CF +# CPU/Memory map format: +# setenv nodeN_memory_config 0xBSBSBSBS +# B=banksize (0=unused, 1=64M, 2=128M, .., 5-1G, c=8M, d=16M, e=32M) +# S=bank enable (0=both disable, 3=both enable, 2=bank1 enable, 1=bank0 enable) +# rightmost digits are for bank 0, the lowest address. +# setenv nodeN_nasid +# specifies the NASID for the node. This is used ONLY if booting the kernel. +# On PROM configurations, set to 0 - PROM will change it later. +# setenv nodeN_cpu_config +# Set bit number N to 1 to enable cpu N. Ex., a value of 5 enables cpu 0 & 2. +# +# Repeat the above 3 commands for each node. +# +# For kernel, default to 32MB. Although this is not a valid hardware configuration, +# it runs faster on medusa. For PROM, 64MB is smallest allowed value. + +setenv node0_cpu_config 0x1 # Enable only cpu 0 on the node +END + +if [ $LINUX -eq 1 ] ; then +cat <>$CF +setenv node0_nasid 0 # cnode 0 has NASID 0 +setenv node0_memory_config 0xe1 # 32MB +END +else +cat <>$CF +setenv node0_memory_config 0x31 # 256MB +END +fi +} + +# -------------------- set links to linux files ------------------------- +set_linux_links() { + if [ -d $D/linux/arch ] ; then + D=$D/linux + elif [ -d $D/arch -o -e vmlinux.sym -o -e $D/vmlinux ] ; then + D=$D + else + err "cant determine directory for linux binaries" + fi + rm -rf vmlinux vmlinux.sym fprom + ln -s $D/vmlinux vmlinux + if [ -f $D/vmlinux.sym ] ; then + ln -s $D/vmlinux.sym vmlinux.sym + elif [ -f $D/System.map ] ; then + ln -s $D/System.map vmlinux.sym + fi + if [ -d $D/arch ] ; then + ln -s $D/arch/ia64/sn/fprom/fprom fprom + else + ln -s $D/fprom fprom + fi + echo " .. Created links to linux files" +} + +# -------------------- set links to prom files ------------------------- +set_prom_links() { + if [ -d $D/stand ] ; then + D=$D/stand/arcs/IP37prom/dev + elif [ -d $D/sal ] ; then + D=$D + else + err "cant determine directory for PROM binaries" + fi + SETUP="/tmp/tmp.$$" + rm -r -f $SETUP + sed 's/export/setenv/' < $D/../../../../.setup | sed 's/=/ /' >$SETUP + egrep -q '^ *setenv *PROMSIZE *8MB|^ *export' $SETUP + if [ $? -eq 0 ] ; then + SIZE="8MB" + else + SIZE="4MB" + fi + grep -q '^ *setenv *LAUNCH_VMLINUX' $SETUP + EMBEDDED_LINUX=$? + PRODUCT=`grep '^ *setenv *PRODUCT' $SETUP | cut -d" " -f3` + rm -f fw.bin fw.map fw.sym vmlinux vmlinux.sym fprom $SETUP + SDIR="${PRODUCT}${SIZE}.O" + BIN="${PRODUCT}ip37prom${SIZE}" + ln -s $D/$SDIR/$BIN.bin fw.bin + ln -s $D/$SDIR/$BIN.map fw.map + ln -s $D/$SDIR/$BIN.sym fw.sym + echo " .. Created links to $SIZE prom files" + if [ $EMBEDDED_LINUX -eq 0 ] ; then + ln -s $D/linux/vmlinux vmlinux + ln -s $D/linux/vmlinux.sym vmlinux.sym + if [ -d linux/arch ] ; then + ln -s $D/linux/arch/ia64/sn/fprom/fprom fprom + else + ln -s $D/linux/fprom fprom + fi + echo " .. Created links to embedded linux files in prom tree" + fi +} + +# --------------- start of shell script -------------------------------- +OUT="simout" +FMTMED=0 +STEPCNT=0 +PROM=0 +LINUX=0 +NCF="cf" +while getopts "HMX:c:o:pk" c ; do + case ${c} in + H) help;; + M) FMTMED=1;; + X) STEPCNT=${OPTARG};; + c) NCF=${OPTARG};; + k) PROM=0;LINUX=1;; + p) PROM=1;LINUX=0;; + o) OUT=${OPTARG};; + \?) exit 1;; + esac +done +shift `expr ${OPTIND} - 1` + +# Check if command is for creating control file and/or links to images. +if [ $PROM -eq 1 -o $LINUX -eq 1 ] ; then + CF=$NCF + [ ! -f $CF ] || err "wont overwrite an existing control file ($CF)" + if [ $# -gt 0 ] ; then + D=$1 + [ -d $D ] || err "cannot find directory $D" + [ $PROM -eq 0 ] || set_prom_links + [ $LINUX -eq 0 ] || set_linux_links + fi + create_cf_header + [ $PROM -eq 0 ] || create_cf_prom + [ $LINUX -eq 0 ] || create_cf_linux + [ ! -f ../idedisk ] || ln -s ../idedisk . + create_cf_memory + echo " .. Basic control file created (in $CF). You might want to edit" + echo " this file (at least, look at it)." + exit 0 +fi + +# Verify that the control file exists +CF=${1:-$NCF} +[ -f $CF ] || err "No control file exists. For help, type: $0 -H" + +# Build the .cf files from the user control file. The .cf file is +# identical except that the actual start & load addresses are inserted +# into the file. In addition, the FPROM commands for configuring memory +# and LIDs are generated. + +rm -f .cf .cf1 .cf2 +awk ' +function strtonum(n) { + if (substr(n,1,2) != "0x") + return int(n) + n = substr(n,3) + r=0 + while (length(n) > 0) { + r = r*16+(index("0123456789abcdef", substr(n,1,1))-1) + n = substr(n,2) + } + return r + } +/^#/ {next} +/^$/ {next} +/^setenv *LOADPC/ {loadpc = $3; next} +/^setenv *node.._cpu_config/ {n=int(substr($2,5,2)); cpuconf[n] = strtonum($3); print; next} +/^setenv *node.._memory_config/ {n=int(substr($2,5,2)); memconf[n] = strtonum($3); print; next} +/^setenv *node.._nasid/ {n=int(substr($2,5,2)); nasid[n] = strtonum($3); print; next} +/^setenv *node._cpu_config/ {n=int(substr($2,5,1)); cpuconf[n] = strtonum($3); print; next} +/^setenv *node._memory_config/ {n=int(substr($2,5,1)); memconf[n] = strtonum($3); print; next} +/^setenv *node._nasid/ {n=int(substr($2,5,1)); nasid[n] = strtonum($3); print; next} + {print} +END { + # Generate the memmap info that starts at the beginning of + # the node the kernel was loaded on. + loadnasid = nasid[0] + cnode = 0 + for (i=0; i<128; i++) { + if (memconf[i] != "") { + printf "sm 0x%x%08x 0x%x%04x%04x\n", + 2*loadnasid, 8*cnodes+8, memconf[i], cpuconf[i], nasid[i] + cnodes++ + cpus += substr("0112122312232334", cpuconf[i]+1,1) + } + } + printf "sm 0x%x00000000 0x%x%08x\n", 2*loadnasid, cnodes, cpus + printf "setenv number_of_nodes %d\n", cnodes + + # Now set the starting PC for each cpu. + cnode = 0 + lowcpu=-1 + for (i=0; i<128; i++) { + if (memconf[i] != "") { + printf "setnode %d\n", cnode + conf = cpuconf[i] + for (j=0; j<4; j++) { + if (conf != int(conf/2)*2) { + printf "setcpu %d\n", j + if (length(loadpc) == 18) + printf "sr pc %s\n", loadpc + else + printf "sr pc 0x%x%s\n", 2*loadnasid, substr(loadpc,3) + if (lowcpu == -1) + lowcpu = j + } + conf = int(conf/2) + } + cnode++ + } + } + printf "setnode 0\n" + printf "setcpu %d\n", lowcpu + } +' <$CF >.cf + +# Now build the .cf1 & .cf2 control files. +CF2_LINES="^sm |^break |^run |^si |^quit |^symbols " +egrep "$CF2_LINES" .cf >.cf2 +egrep -v "$CF2_LINES" .cf >.cf1 +if [ $STEPCNT -ne 0 ] ; then + echo "s $STEPCNT" >>.cf2 + echo "lastpc 1000" >>.cf2 + echo "q" >>.cf2 +fi +if [ -f vmlinux.sym ] ; then + awk '/ _start$/ {print "sr g 9 0x" $3}' < vmlinux.sym >> .cf2 +fi +echo "script-on $OUT" >>.cf2 + +# Now start medusa.... +if [ $FMTMED -ne 0 ] ; then + $MEDUSA -system mpsn1 -c .cf1 -i .cf2 | fmtmedusa +elif [ $STEPCNT -eq 0 ] ; then + $MEDUSA -system mpsn1 -c .cf1 -i .cf2 +else + $MEDUSA -system mpsn1 -c .cf1 -i .cf2 2>&1 +fi diff -urN linux-2.4.18/arch/ia64/sn/fprom/Makefile lia64-2.4/arch/ia64/sn/fprom/Makefile --- linux-2.4.18/arch/ia64/sn/fprom/Makefile Tue Feb 26 11:03:54 2002 +++ lia64-2.4/arch/ia64/sn/fprom/Makefile Wed Dec 31 16:00:00 1969 @@ -1,33 +0,0 @@ -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 2000 Silicon Graphics, Inc. -# Copyright (C) Jack Steiner (steiner@sgi.com) -# - -TOPDIR=../../../.. -HPATH = $(TOPDIR)/include - -LIB = ../../lib/lib.a - -OBJ=fpromasm.o main.o fw-emu.o fpmem.o -obj-y=fprom - -fprom: $(OBJ) - $(LD) -static -Tfprom.lds -o fprom $(OBJ) $(LIB) - -comma := , - -.S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) $(AFLAGS_KERNEL) -c -o $*.o $< -.c.o: - $(CC) $(CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(CFLAGS_KERNEL) -c -o $*.o $< - -clean: - rm -f *.o fprom - - -include $(TOPDIR)/Rules.make - diff -urN linux-2.4.18/arch/ia64/sn/fprom/README lia64-2.4/arch/ia64/sn/fprom/README --- linux-2.4.18/arch/ia64/sn/fprom/README Thu Jan 4 13:00:15 2001 +++ lia64-2.4/arch/ia64/sn/fprom/README Wed Dec 31 16:00:00 1969 @@ -1,85 +0,0 @@ -This directory contains the files required to build -the fake PROM image that is currently being used to -boot IA64 kernels running under the SGI Medusa kernel. - -The FPROM currently provides the following functions: - - - PAL emulation for all PAL calls we've made so far. - - SAL emulation for all SAL calls we've made so far. - - EFI emulation for all EFI calls we've made so far. - - builds the "ia64_bootparam" structure that is - passed to the kernel from SAL. This structure - shows the cpu & memory configurations. - - supports medusa boottime options for changing - the number of cpus present - - supports medusa boottime options for changing - the memory configuration. - - - -At some point, this fake PROM will be replaced by the -real PROM. - - - - -To build a fake PROM, cd to this directory & type: - - make - -This will (or should) build a fake PROM named "fprom". - - - - -Use this fprom image when booting the Medusa simulator. The -control file used to boot Medusa should include the -following lines: - - load fprom - load vmlinux - sr pc 0x100000 - sr g 9
#(currently 0xe000000000520000) - -NOTE: There is a script "runsim" in this directory that can be used to -simplify setting up an environment for running under Medusa. - - - - -The following parameters may be passed to the fake PROM to -control the PAL/SAL/EFI parameters passed to the kernel: - - GR[8] = # of cpus - GR[9] = address of primary entry point into the kernel - GR[20] = memory configuration for node 0 - GR[21] = memory configuration for node 1 - GR[22] = memory configuration for node 2 - GR[23] = memory configuration for node 3 - - -Registers GR[20] - GR[23] contain information to specify the -amount of memory present on nodes 0-3. - - - if nothing is specified (all registers are 0), the configuration - defaults to 8 MB on node 0. - - - a mem config entry for node N is passed in GR[20+N] - - - a mem config entry consists of 8 hex digits. Each digit gives the - amount of physical memory available on the node starting at - 1GB*, where dn is the digit number. The amount of memory - is 8MB*2**. (If = 0, the memory size is 0). - - SN1 doesnt support dimms this small but small memory systems - boot faster on Medusa. - - - -An example helps a lot. The following specifies that node 0 has -physical memory 0 to 8MB and 1GB to 1GB+32MB, and that node 1 has -64MB starting at address 0 of the node which is 8GB. - - gr[20] = 0x21 # 0 to 8MB, 1GB to 1GB+32MB - gr[21] = 0x4 # 8GB to 8GB+64MB - diff -urN linux-2.4.18/arch/ia64/sn/fprom/fpmem.c lia64-2.4/arch/ia64/sn/fprom/fpmem.c --- linux-2.4.18/arch/ia64/sn/fprom/fpmem.c Thu Jan 4 13:00:15 2001 +++ lia64-2.4/arch/ia64/sn/fprom/fpmem.c Wed Dec 31 16:00:00 1969 @@ -1,200 +0,0 @@ -/* - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Jack Steiner (steiner@sgi.com) - */ - - -/* - * FPROM EFI memory descriptor build routines - * - * - Routines to build the EFI memory descriptor map - * - Should also be usable by the SGI SN1 prom to convert - * klconfig to efi_memmap - */ - -#include -#include "fpmem.h" - -/* - * args points to a layout in memory like this - * - * 32 bit 32 bit - * - * numnodes numcpus - * - * 16 bit 16 bit 32 bit - * nasid0 cpuconf membankdesc0 - * nasid1 cpuconf membankdesc1 - * . - * . - * . - * . - * . - */ - -sn_memmap_t *sn_memmap ; -sn_config_t *sn_config ; - -/* - * There is a hole in the node 0 address space. Dont put it - * in the memory map - */ -#define NODE0_HOLE_SIZE (20*MB) -#define NODE0_HOLE_END (4UL*GB) - -#define MB (1024*1024) -#define GB (1024*MB) -#define KERNEL_SIZE (4*MB) -#define PROMRESERVED_SIZE (1*MB) -#define MD_BANK_SHFT 30 - -#define TO_NODE(_n, _x) (((long)_n<<33L) | (long)_x) - -/* - * For SN, this may not take an arg and gets the numnodes from - * the prom variable or by traversing klcfg or promcfg - */ -int -GetNumNodes(void) -{ - return sn_config->nodes; -} - -int -GetNumCpus(void) -{ - return sn_config->cpus; -} - -/* For SN1, get the index th nasid */ - -int -GetNasid(int index) -{ - return sn_memmap[index].nasid ; -} - -node_memmap_t -GetMemBankInfo(int index) -{ - return sn_memmap[index].node_memmap ; -} - -int -IsCpuPresent(int cnode, int cpu) -{ - return sn_memmap[cnode].cpuconfig & (1<type = type; - md->phys_addr = paddr; - md->virt_addr = 0; - md->num_pages = numbytes >> 12; - md->attribute = EFI_MEMORY_WB; -} - -int -build_efi_memmap(void *md, int mdsize) -{ - int numnodes = GetNumNodes() ; - int cnode,bank ; - int nasid ; - node_memmap_t membank_info ; - int bsize; - int count = 0 ; - long paddr, hole, numbytes; - - - for (cnode=0;cnode - -typedef struct sn_memmap_s -{ - short nasid ; - short cpuconfig; - node_memmap_t node_memmap ; -} sn_memmap_t ; - -typedef struct sn_config_s -{ - int cpus; - int nodes; - sn_memmap_t memmap[1]; /* start of array */ -} sn_config_t; - - -extern void build_init(unsigned long); -extern int build_efi_memmap(void *, int); -extern int GetNumNodes(void); -extern int GetNumCpus(void); -extern int IsCpuPresent(int, int); -extern int GetNasid(int); diff -urN linux-2.4.18/arch/ia64/sn/fprom/fprom.lds lia64-2.4/arch/ia64/sn/fprom/fprom.lds --- linux-2.4.18/arch/ia64/sn/fprom/fprom.lds Mon Jul 2 14:40:14 2001 +++ lia64-2.4/arch/ia64/sn/fprom/fprom.lds Wed Dec 31 16:00:00 1969 @@ -1,96 +0,0 @@ - -OUTPUT_FORMAT("elf64-ia64-little") -OUTPUT_ARCH(ia64) -ENTRY(_start) -SECTIONS -{ - v = 0x0000000000000000 ; /* this symbol is here to make debugging with kdb easier... */ - - . = (0x000000000000000 + 0x100000) ; - - _text = .; - .text : AT(ADDR(.text) - 0x0000000000000000 ) - { - *(__ivt_section) - /* these are not really text pages, but the zero page needs to be in a fixed location: */ - *(__special_page_section) - __start_gate_section = .; - *(__gate_section) - __stop_gate_section = .; - *(.text) - } - - /* Global data */ - _data = .; - - .rodata : AT(ADDR(.rodata) - 0x0000000000000000 ) - { *(.rodata) *(.rodata.*) } - .opd : AT(ADDR(.opd) - 0x0000000000000000 ) - { *(.opd) } - .data : AT(ADDR(.data) - 0x0000000000000000 ) - { *(.data) *(.gnu.linkonce.d*) CONSTRUCTORS } - - __gp = ALIGN (8) + 0x200000; - - .got : AT(ADDR(.got) - 0x0000000000000000 ) - { *(.got.plt) *(.got) } - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - .sdata : AT(ADDR(.sdata) - 0x0000000000000000 ) - { *(.sdata) } - _edata = .; - _bss = .; - .sbss : AT(ADDR(.sbss) - 0x0000000000000000 ) - { *(.sbss) *(.scommon) } - .bss : AT(ADDR(.bss) - 0x0000000000000000 ) - { *(.bss) *(COMMON) } - . = ALIGN(64 / 8); - _end = .; - - /* Sections to be discarded */ - /DISCARD/ : { - *(.text.exit) - *(.data.exit) - } - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /* These must appear regardless of . */ - /* Discard them for now since Intel SoftSDV cannot handle them. - .comment 0 : { *(.comment) } - .note 0 : { *(.note) } - */ - /DISCARD/ : { *(.comment) } - /DISCARD/ : { *(.note) } -} diff -urN linux-2.4.18/arch/ia64/sn/fprom/fpromasm.S lia64-2.4/arch/ia64/sn/fprom/fpromasm.S --- linux-2.4.18/arch/ia64/sn/fprom/fpromasm.S Thu Jan 4 13:00:15 2001 +++ lia64-2.4/arch/ia64/sn/fprom/fpromasm.S Wed Dec 31 16:00:00 1969 @@ -1,314 +0,0 @@ -/* - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * (Code copied from or=ther files) - * Copyright (C) 1998-2000 Hewlett-Packard Co - * Copyright (C) 1998-2000 David Mosberger-Tang - * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Jack Steiner (steiner@sgi.com) - */ - - - -#define __ASSEMBLY__ 1 -#include "asm/processor.h" - -/* - * This file contains additional set up code that is needed to get going on - * Medusa. This code should disappear once real hw is available. - * - * On entry to this routine, the following register values are assumed: - * - * gr[8] - BSP cpu - * pr[9] - kernel entry address - * - * NOTE: - * This FPROM may be loaded/executed at an address different from the - * address that it was linked at. The FPROM is linked to run on node 0 - * at address 0x100000. If the code in loaded into another node, it - * must be loaded at offset 0x100000 of the node. In addition, the - * FPROM does the following things: - * - determine the base address of the node it is loaded on - * - add the node base to _gp. - * - add the node base to all addresses derived from "movl" - * instructions. (I couldnt get GPREL addressing to work) - * (maybe newer versions of the tools will support this) - * - scan the .got section and add the node base to all - * pointers in this section. - * - add the node base to all physical addresses in the - * SAL/PAL/EFI table built by the C code. (This is done - * in the C code - not here) - * - add the node base to the TLB entries for vmlinux - */ - -#define KERNEL_BASE 0xe000000000000000 -#define PAGESIZE_256M 28 - -/* - * ar.k0 gets set to IOPB_PA value, on 460gx chipset it should - * be 0x00000ffffc000000, but on snia we use the (inverse swizzled) - * IOSPEC_BASE value - */ -#define IOPB_PA 0x00000a0000000000 /* inv swizzle IOSPEC_BASE */ - -#define RR_RID 8 - - - -// ==================================================================================== - .text - .align 16 - .global _start - .proc _start -_start: - -// Setup psr and rse for system init - mov psr.l = r0;; - srlz.d;; - invala - mov ar.rsc = r0;; - loadrs - ;; - -// Set CALIAS size to zero. We dont use it. - movl r24=0x80000a0001000028;; // BR_PI_CALIAS_SIZE - st8 [r24]=r0 - -// Isolate node number we are running on. - mov r6 = ip;; - shr r5 = r6,33;; // r5 = node number - shl r6 = r5,33 // r6 = base memory address of node - -// Set & relocate gp. - movl r1= __gp;; // Add base memory address - add r1 = r1,r6 // Relocate to boot node - -// Lets figure out who we are & put it in the LID register. -// The BR_PI_SELF_CPU_NUM register gives us a value of 0-3. -// This identifies the cpu on the node. -// Merge the cpu number with the NASID to generate the LID. - movl r24=0x80000a0001000020;; // BR_PI_SELF_CPU_NUM - ld8 r25=[r24] // Fetch PI_SELF - movl r27=0x80000a0001600000;; // Fetch REVID to get local NASID - ld8 r27=[r27];; - extr.u r27=r27,32,8 - shl r26=r25,16;; // Align local cpu# to lid.eid - shl r27=r27,24;; // Align NASID to lid.id - or r26=r26,r27;; // build the LID - mov cr.lid=r26 // Now put in in the LID register - - movl r2=FPSR_DEFAULT;; - mov ar.fpsr=r2 - movl sp = bootstacke-16;; - add sp = sp,r6 // Relocate to boot node - -// Save the NASID that we are loaded on. - movl r2=base_nasid;; // Save base_nasid for C code - add r2 = r2,r6;; // Relocate to boot node - st8 [r2]=r5 // Uncond st8 - same on all cpus - -// Save the kernel entry address. It is passed in r9 on one of -// the cpus. - movl r2=bsp_entry_pc - cmp.ne p6,p0=r9,r0;; - add r2 = r2,r6;; // Relocate to boot node -(p6) st8 [r2]=r9 // Uncond st8 - same on all cpus - - -// The following can ONLY be done by 1 cpu. Lets set a lock - the -// cpu that gets it does the initilization. The rest just spin waiting -// til initilization is complete. - movl r22 = initlock;; - add r22 = r22,r6 // Relocate to boot node - mov r23 = 1;; - xchg8 r23 = [r22],r23;; - cmp.eq p6,p0 = 0,r23 -(p6) br.cond.spnt.few init -1: ld4 r23 = [r22];; - cmp.eq p6,p0 = 1,r23 -(p6) br.cond.sptk 1b - br initx - -// Add base address of node memory to each pointer in the .got section. -init: movl r16 = _GLOBAL_OFFSET_TABLE_;; - add r16 = r16,r6;; // Relocate to boot node -1: ld8 r17 = [r16];; - cmp.eq p6,p7=0,r17 -(p6) br.cond.sptk.few.clr 2f;; - add r17 = r17,r6;; // Relocate to boot node - st8 [r16] = r17,8 - br 1b -2: - mov r23 = 2;; // All done, release the spinning cpus - st4 [r22] = r23 -initx: - -// -// I/O-port space base address: -// - movl r2 = IOPB_PA;; - mov ar.k0 = r2 - - -// Now call main & pass it the current LID value. - alloc r0=ar.pfs,0,0,2,0 - mov r32=r26 - mov r33=r8;; - br.call.sptk.few rp=fmain - -// Initialize Region Registers -// - mov r10 = r0 - mov r2 = (13<<2) - mov r3 = r0;; -1: cmp4.gtu p6,p7 = 7, r3 - dep r10 = r3, r10, 61, 3 - dep r2 = r3, r2, RR_RID, 4;; -(p7) dep r2 = 0, r2, 0, 1;; -(p6) dep r2 = -1, r2, 0, 1;; - mov rr[r10] = r2 - add r3 = 1, r3;; - srlz.d;; - cmp4.gtu p6,p0 = 8, r3 -(p6) br.cond.sptk.few.clr 1b - -// -// Return value indicates if we are the BSP or AP. -// 1 = BSP, 0 = AP - mov cr.tpr=r0;; - cmp.eq p6,p0=r8,r0 -(p6) br.cond.spnt slave - -// -// Initialize the protection key registers with only pkr[0] = valid. -// -// Should be initialized in accordance with the OS. -// - mov r2 = 1 - mov r3 = r0;; - mov pkr[r3] = r2;; - srlz.d;; - mov r2 = r0 - -1: add r3 = r3, r0, 1;; // increment PKR - cmp.gtu p6, p0 = 16, r3;; -(p6) mov pkr[r3] = r2 -(p6) br.cond.sptk.few.clr 1b - - mov ar.rnat = r0 // clear RNAT register - -// -// Setup system address translation for kernel -// -// Note: The setup of Kernel Virtual address space can be done by the -// C code of the boot loader. -// -// - -#define LINUX_PAGE_OFFSET 0xe000000000000000 -#define ITIR(key, ps) ((key<<8) | (ps<<2)) -#define ITRGR(ed,ar,ma) ((ed<<52) | (ar<<9) | (ma<<2) | 0x61) - -#define AR_RX 1 // RX permission -#define AR_RW 4 // RW permission -#define MA_WB 0 // WRITEBACK memory attribute - -#define TLB_PAGESIZE 28 // Use 256MB pages for now. - mov r16=r5 - -// -// text section -// - movl r2 = LINUX_PAGE_OFFSET;; // Set up IFA with VPN of linux - mov cr.ifa = r2 - movl r3 = ITIR(0,TLB_PAGESIZE);; // Set ITIR to default pagesize - mov cr.itir = r3 - - shl r4 = r16,33;; // physical addr of start of node - movl r5 = ITRGR(1,AR_RX,MA_WB);; // TLB attributes - or r10=r4,r5;; - - itr.i itr[r0] = r10;; // Dropin ITR entry - srlz.i;; - -// -// data section -// - movl r2 = LINUX_PAGE_OFFSET;; // Set up IFA with VPN of linux - mov cr.ifa = r2 - movl r3 = ITIR(0,TLB_PAGESIZE);; // Set ITIR to default pagesize - mov cr.itir = r3 - - shl r4 = r16,33;; // physical addr of start of node - movl r5 = ITRGR(1,AR_RW,MA_WB);; // TLB attributes - or r10=r4,r5;; - - itr.d dtr[r0] = r10;; // Dropin DTR entry - srlz.d;; - - - - -// -// Turn on address translation, interrupt collection, psr.ed, protection key. -// Interrupts (PSR.i) are still off here. -// - - movl r3 = ( IA64_PSR_BN | \ - IA64_PSR_AC | \ - IA64_PSR_IT | \ - IA64_PSR_DB | \ - IA64_PSR_DA | \ - IA64_PSR_RT | \ - IA64_PSR_DT | \ - IA64_PSR_IC \ - ) - ;; - mov cr.ipsr = r3 - -// -// Go to kernel C startup routines -// Need to do a "rfi" in order set "it" and "ed" bits in the PSR. -// This is the only way to set them. - - movl r2=bsp_entry_pc;; - add r2 = r2,r6;; // Relocate to boot node - ld8 r2=[r2];; - mov cr.iip = r2 - srlz.d;; - rfi;; - .endp _start - -// Slave processors come here to spin til they get an interrupt. Then they launch themselves to -// the place ap_entry points. No initialization is necessary - the kernel makes no -// assumptions about state on this entry. -// Note: should verify that the interrupt we got was really the ap_wakeup -// interrupt but this should not be an issue on medusa -slave: - nop.i 0x8beef // Medusa - put cpu to sleep til interrupt occurs - mov r8=cr.irr0;; // Check for interrupt pending. - cmp.eq p6,p0=r8,r0 -(p6) br.cond.sptk slave;; - - mov r8=cr.ivr;; // Got one. Must read ivr to accept it - srlz.d;; - mov cr.eoi=r0;; // must write eoi to clear - movl r8=ap_entry;; // now jump to kernel entry - add r8 = r8,r6;; // Relocate to boot node - ld8 r9=[r8],8;; - ld8 r1=[r8] - mov b0=r9;; - br b0 - -// Here is the kernel stack used for the fake PROM - .bss - .align 16384 -bootstack: - .skip 16384 -bootstacke: -initlock: - data4 diff -urN linux-2.4.18/arch/ia64/sn/fprom/fw-emu.c lia64-2.4/arch/ia64/sn/fprom/fw-emu.c --- linux-2.4.18/arch/ia64/sn/fprom/fw-emu.c Tue Jul 31 10:30:09 2001 +++ lia64-2.4/arch/ia64/sn/fprom/fw-emu.c Wed Dec 31 16:00:00 1969 @@ -1,524 +0,0 @@ -/* - * PAL & SAL emulation. - * - * Copyright (C) 1998-2000 Hewlett-Packard Co - * Copyright (C) 1998-2000 David Mosberger-Tang - * - * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Jack Steiner (steiner@sgi.com) - */ -#include -#include -#include -#include -#include -#include "fpmem.h" - -#define MB (1024*1024UL) -#define GB (MB*1024UL) - -#define FPROM_BUG() do {while (1);} while (0) -#define MAX_NODES 128 -#define MAX_LSAPICS 512 -#define MAX_CPUS 512 -#define MAX_CPUS_NODE 4 -#define CPUS_PER_NODE 4 -#define CPUS_PER_FSB 2 -#define CPUS_PER_FSB_MASK (CPUS_PER_FSB-1) - -#define NUM_EFI_DESCS 2 - -typedef union ia64_nasid_va { - struct { - unsigned long off : 33; /* intra-region offset */ - unsigned long nasid : 7; /* NASID */ - unsigned long off2 : 21; /* fill */ - unsigned long reg : 3; /* region number */ - } f; - unsigned long l; - void *p; -} ia64_nasid_va; - -typedef struct { - unsigned long pc; - unsigned long gp; -} func_ptr_t; - -#define IS_VIRTUAL_MODE() ({struct ia64_psr psr; asm("mov %0=psr" : "=r"(psr)); psr.dt;}) -#define ADDR_OF(p) (IS_VIRTUAL_MODE() ? ((void*)((long)(p)+PAGE_OFFSET)) : ((void*) (p))) -#define __fwtab_pa(n,x) ({ia64_nasid_va _v; _v.l = (long) (x); _v.f.nasid = (x) ? (n) : 0; _v.f.reg = 0; _v.l;}) - -/* - * The following variables are passed thru registersfrom the configuration file and - * are set via the _start function. - */ -long base_nasid; -long num_cpus; -long bsp_entry_pc=0; -long num_nodes; -long app_entry_pc; -int bsp_lid; -func_ptr_t ap_entry; - - -static efi_runtime_services_t *efi_runtime_p; -static char fw_mem[( sizeof(efi_system_table_t) - + sizeof(efi_runtime_services_t) - + NUM_EFI_DESCS*sizeof(efi_config_table_t) - + sizeof(struct ia64_sal_systab) - + sizeof(struct ia64_sal_desc_entry_point) - + sizeof(struct ia64_sal_desc_ap_wakeup) - + sizeof(acpi_rsdp_t) - + sizeof(acpi_rsdt_t) - + sizeof(acpi_sapic_t) - + MAX_LSAPICS*(sizeof(acpi_entry_lsapic_t)) - + (1+8*MAX_NODES)*(sizeof(efi_memory_desc_t)) - + sizeof(ia64_sal_desc_ptc_t) + - + MAX_NODES*sizeof(ia64_sal_ptc_domain_info_t) + - + MAX_CPUS*sizeof(ia64_sal_ptc_domain_proc_entry_t) + - + 1024)] __attribute__ ((aligned (8))); - -/* - * Very ugly, but we need this in the simulator only. Once we run on - * real hw, this can all go away. - */ -extern void pal_emulator_static (void); - -asm (" - .text - .proc pal_emulator_static -pal_emulator_static: - mov r8=-1;; - cmp.eq p6,p7=6,r28;; /* PAL_PTCE_INFO */ -(p7) br.cond.sptk.few 1f - ;; - mov r8=0 /* status = 0 */ - movl r9=0x500000000 /* tc.base */ - movl r10=0x0000000200000003 /* count[0], count[1] */ - movl r11=0x1000000000002000 /* stride[0], stride[1] */ - br.cond.sptk.few rp - -1: cmp.eq p6,p7=14,r28;; /* PAL_FREQ_RATIOS */ -(p7) br.cond.sptk.few 1f;; - mov r8=0 /* status = 0 */ - movl r9 =0x100000064 /* proc_ratio (1/100) */ - movl r10=0x100000100 /* bus_ratio<<32 (1/256) */ - movl r11=0x10000000a /* itc_ratio<<32 (1/100) */ - -1: cmp.eq p6,p7=22,r28;; /* PAL_MC_DRAIN */ -(p7) br.cond.sptk.few 1f;; - mov r8=0 - br.cond.sptk.few rp - -1: cmp.eq p6,p7=23,r28;; /* PAL_MC_EXPECTED */ -(p7) br.cond.sptk.few 1f;; - mov r8=0 - br.cond.sptk.few rp - -1: br.cond.sptk.few rp - .endp pal_emulator_static\n"); - - -static efi_status_t -efi_get_time (efi_time_t *tm, efi_time_cap_t *tc) -{ - if (tm) { - memset(tm, 0, sizeof(*tm)); - tm->year = 2000; - tm->month = 2; - tm->day = 13; - tm->hour = 10; - tm->minute = 11; - tm->second = 12; - } - - if (tc) { - tc->resolution = 10; - tc->accuracy = 12; - tc->sets_to_zero = 1; - } - - return EFI_SUCCESS; -} - -static void -efi_reset_system (int reset_type, efi_status_t status, unsigned long data_size, efi_char16_t *data) -{ - while(1); /* Is there a pseudo-op to stop medusa */ -} - -static efi_status_t -efi_success (void) -{ - return EFI_SUCCESS; -} - -static efi_status_t -efi_unimplemented (void) -{ - return EFI_UNSUPPORTED; -} - -static long -sal_emulator (long index, unsigned long in1, unsigned long in2, - unsigned long in3, unsigned long in4, unsigned long in5, - unsigned long in6, unsigned long in7) -{ - register long r9 asm ("r9") = 0; - register long r10 asm ("r10") = 0; - register long r11 asm ("r11") = 0; - long status; - - /* - * Don't do a "switch" here since that gives us code that - * isn't self-relocatable. - */ - status = 0; - if (index == SAL_FREQ_BASE) { - switch (in1) { - case SAL_FREQ_BASE_PLATFORM: - r9 = 500000000; - break; - - case SAL_FREQ_BASE_INTERVAL_TIMER: - /* - * Is this supposed to be the cr.itc frequency - * or something platform specific? The SAL - * doc ain't exactly clear on this... - */ - r9 = 700000000; - break; - - case SAL_FREQ_BASE_REALTIME_CLOCK: - r9 = 1; - break; - - default: - status = -1; - break; - } - } else if (index == SAL_SET_VECTORS) { - if (in1 == SAL_VECTOR_OS_BOOT_RENDEZ) { - func_ptr_t *fp; - fp = ADDR_OF(&ap_entry); - fp->pc = in2; - fp->gp = in3; - } else { - status = -1; - } - ; - } else if (index == SAL_GET_STATE_INFO) { - ; - } else if (index == SAL_GET_STATE_INFO_SIZE) { - ; - } else if (index == SAL_CLEAR_STATE_INFO) { - ; - } else if (index == SAL_MC_RENDEZ) { - ; - } else if (index == SAL_MC_SET_PARAMS) { - ; - } else if (index == SAL_CACHE_FLUSH) { - ; - } else if (index == SAL_CACHE_INIT) { - ; - } else if (index == SAL_UPDATE_PAL) { - ; - } else { - status = -1; - } - asm volatile ("" :: "r"(r9), "r"(r10), "r"(r11)); - return status; -} - - -/* - * This is here to work around a bug in egcs-1.1.1b that causes the - * compiler to crash (seems like a bug in the new alias analysis code. - */ -void * -id (long addr) -{ - return (void *) addr; -} - - -/* - * Fix the addresses in a function pointer by adding base node address - * to pc & gp. - */ -void -fix_function_pointer(void *fp) -{ - func_ptr_t *_fp; - - _fp = fp; - _fp->pc = __fwtab_pa(base_nasid, _fp->pc); - _fp->gp = __fwtab_pa(base_nasid, _fp->gp); -} - -void -fix_virt_function_pointer(void *fptr) -{ - func_ptr_t *fp; - - fp = fptr; - fp->pc = fp->pc | PAGE_OFFSET; - fp->gp = fp->gp | PAGE_OFFSET; -} - - -int -efi_set_virtual_address_map(void) -{ - efi_runtime_services_t *runtime; - - runtime = efi_runtime_p; - fix_virt_function_pointer((void*)runtime->get_time); - fix_virt_function_pointer((void*)runtime->set_time); - fix_virt_function_pointer((void*)runtime->get_wakeup_time); - fix_virt_function_pointer((void*)runtime->set_wakeup_time); - fix_virt_function_pointer((void*)runtime->set_virtual_address_map); - fix_virt_function_pointer((void*)runtime->get_variable); - fix_virt_function_pointer((void*)runtime->get_next_variable); - fix_virt_function_pointer((void*)runtime->set_variable); - fix_virt_function_pointer((void*)runtime->get_next_high_mono_count); - fix_virt_function_pointer((void*)runtime->reset_system); - return EFI_SUCCESS;; -} - - -void -sys_fw_init (const char *args, int arglen, int bsp) -{ - /* - * Use static variables to keep from overflowing the RSE stack - */ - static efi_system_table_t *efi_systab; - static efi_runtime_services_t *efi_runtime; - static efi_config_table_t *efi_tables; - static ia64_sal_desc_ptc_t *sal_ptc; - static ia64_sal_ptc_domain_info_t *sal_ptcdi; - static ia64_sal_ptc_domain_proc_entry_t *sal_ptclid; - static acpi_rsdp_t *acpi_systab; - static acpi_rsdt_t *acpi_rsdt; - static acpi_sapic_t *acpi_sapic; - static acpi_entry_lsapic_t *acpi_lsapic; - static struct ia64_sal_systab *sal_systab; - static efi_memory_desc_t *efi_memmap, *md; - static unsigned long *pal_desc, *sal_desc; - static struct ia64_sal_desc_entry_point *sal_ed; - static struct ia64_boot_param *bp; - static struct ia64_sal_desc_ap_wakeup *sal_apwake; - static unsigned char checksum = 0; - static char *cp, *cmd_line, *vendor; - static int mdsize, domain, last_domain ; - static int cnode, nasid, cpu, num_memmd, cpus_found; - - /* - * Pass the parameter base address to the build_efi_xxx routines. - */ - build_init(8LL*GB*base_nasid); - - num_nodes = GetNumNodes(); - num_cpus = GetNumCpus(); - - - memset(fw_mem, 0, sizeof(fw_mem)); - - pal_desc = (unsigned long *) &pal_emulator_static; - sal_desc = (unsigned long *) &sal_emulator; - fix_function_pointer(&pal_emulator_static); - fix_function_pointer(&sal_emulator); - - /* Align this to 16 bytes, probably EFI does this */ - mdsize = (sizeof(efi_memory_desc_t) + 15) & ~15 ; - - cp = fw_mem; - efi_systab = (void *) cp; cp += sizeof(*efi_systab); - efi_runtime_p = efi_runtime = (void *) cp; cp += sizeof(*efi_runtime); - efi_tables = (void *) cp; cp += NUM_EFI_DESCS*sizeof(*efi_tables); - sal_systab = (void *) cp; cp += sizeof(*sal_systab); - sal_ed = (void *) cp; cp += sizeof(*sal_ed); - sal_ptc = (void *) cp; cp += sizeof(*sal_ptc); - sal_apwake = (void *) cp; cp += sizeof(*sal_apwake); - acpi_systab = (void *) cp; cp += sizeof(*acpi_systab); - acpi_rsdt = (void *) cp; cp += sizeof(*acpi_rsdt); - acpi_sapic = (void *) cp; cp += sizeof(*acpi_sapic); - acpi_lsapic = (void *) cp; cp += num_cpus*sizeof(*acpi_lsapic); - vendor = (char *) cp; cp += 32; - efi_memmap = (void *) cp; cp += 8*32*sizeof(*efi_memmap); - sal_ptcdi = (void *) cp; cp += CPUS_PER_FSB*(1+num_nodes)*sizeof(*sal_ptcdi); - sal_ptclid = (void *) cp; cp += ((3+num_cpus)*sizeof(*sal_ptclid)+7)/8*8; - cmd_line = (void *) cp; - - if (args) { - if (arglen >= 1024) - arglen = 1023; - memcpy(cmd_line, args, arglen); - } else { - arglen = 0; - } - cmd_line[arglen] = '\0'; -#ifdef BRINGUP - /* for now, just bring up bash */ - strcpy(cmd_line, "init=/bin/bash"); -#else - strcpy(cmd_line, ""); -#endif - - memset(efi_systab, 0, sizeof(efi_systab)); - efi_systab->hdr.signature = EFI_SYSTEM_TABLE_SIGNATURE; - efi_systab->hdr.revision = EFI_SYSTEM_TABLE_REVISION; - efi_systab->hdr.headersize = sizeof(efi_systab->hdr); - efi_systab->fw_vendor = __fwtab_pa(base_nasid, vendor); - efi_systab->fw_revision = 1; - efi_systab->runtime = __fwtab_pa(base_nasid, efi_runtime); - efi_systab->nr_tables = 2; - efi_systab->tables = __fwtab_pa(base_nasid, efi_tables); - memcpy(vendor, "S\0i\0l\0i\0c\0o\0n\0-\0G\0r\0a\0p\0h\0i\0c\0s\0\0", 32); - - efi_runtime->hdr.signature = EFI_RUNTIME_SERVICES_SIGNATURE; - efi_runtime->hdr.revision = EFI_RUNTIME_SERVICES_REVISION; - efi_runtime->hdr.headersize = sizeof(efi_runtime->hdr); - efi_runtime->get_time = __fwtab_pa(base_nasid, &efi_get_time); - efi_runtime->set_time = __fwtab_pa(base_nasid, &efi_unimplemented); - efi_runtime->get_wakeup_time = __fwtab_pa(base_nasid, &efi_unimplemented); - efi_runtime->set_wakeup_time = __fwtab_pa(base_nasid, &efi_unimplemented); - efi_runtime->set_virtual_address_map = __fwtab_pa(base_nasid, &efi_set_virtual_address_map); - efi_runtime->get_variable = __fwtab_pa(base_nasid, &efi_unimplemented); - efi_runtime->get_next_variable = __fwtab_pa(base_nasid, &efi_unimplemented); - efi_runtime->set_variable = __fwtab_pa(base_nasid, &efi_unimplemented); - efi_runtime->get_next_high_mono_count = __fwtab_pa(base_nasid, &efi_unimplemented); - efi_runtime->reset_system = __fwtab_pa(base_nasid, &efi_reset_system); - - efi_tables->guid = SAL_SYSTEM_TABLE_GUID; - efi_tables->table = __fwtab_pa(base_nasid, sal_systab); - efi_tables++; - efi_tables->guid = ACPI_TABLE_GUID; - efi_tables->table = __fwtab_pa(base_nasid, acpi_systab); - fix_function_pointer(&efi_unimplemented); - fix_function_pointer(&efi_get_time); - fix_function_pointer(&efi_success); - fix_function_pointer(&efi_reset_system); - fix_function_pointer(&efi_set_virtual_address_map); - - /* fill in the ACPI system table: */ - memcpy(acpi_systab->signature, "RSD PTR ", 8); - acpi_systab->rsdt = (struct acpi_rsdt*)__fwtab_pa(base_nasid, acpi_rsdt); - - memcpy(acpi_rsdt->header.signature, "RSDT",4); - acpi_rsdt->header.length = sizeof(acpi_rsdt_t); - memcpy(acpi_rsdt->header.oem_id, "SGI", 3); - memcpy(acpi_rsdt->header.oem_table_id, "SN1", 3); - acpi_rsdt->header.oem_revision = 0x00010001; - acpi_rsdt->entry_ptrs[0] = __fwtab_pa(base_nasid, acpi_sapic); - - memcpy(acpi_sapic->header.signature, "SPIC ", 4); - acpi_sapic->header.length = sizeof(acpi_sapic_t)+num_cpus*sizeof(acpi_entry_lsapic_t); - for (cnode=0; cnodetype = ACPI_ENTRY_LOCAL_SAPIC; - acpi_lsapic->length = sizeof(acpi_entry_lsapic_t); - acpi_lsapic->acpi_processor_id = cnode*4+cpu; - acpi_lsapic->flags = LSAPIC_ENABLED|LSAPIC_PRESENT; - acpi_lsapic->eid = cpu; - acpi_lsapic->id = nasid; - acpi_lsapic++; - } - } - - - /* fill in the SAL system table: */ - memcpy(sal_systab->signature, "SST_", 4); - sal_systab->size = sizeof(*sal_systab); - sal_systab->sal_rev_minor = 1; - sal_systab->sal_rev_major = 0; - sal_systab->entry_count = 3; - - strcpy(sal_systab->oem_id, "SGI"); - strcpy(sal_systab->product_id, "SN1"); - - /* fill in an entry point: */ - sal_ed->type = SAL_DESC_ENTRY_POINT; - sal_ed->pal_proc = __fwtab_pa(base_nasid, pal_desc[0]); - sal_ed->sal_proc = __fwtab_pa(base_nasid, sal_desc[0]); - sal_ed->gp = __fwtab_pa(base_nasid, sal_desc[1]); - - /* kludge the PTC domain info */ - sal_ptc->type = SAL_DESC_PTC; - sal_ptc->num_domains = 0; - sal_ptc->domain_info = __fwtab_pa(base_nasid, sal_ptcdi); - cpus_found = 0; - last_domain = -1; - sal_ptcdi--; - for (cnode=0; cnodenum_domains++; - sal_ptcdi++; - sal_ptcdi->proc_count = 0; - sal_ptcdi->proc_list = __fwtab_pa(base_nasid, sal_ptclid); - last_domain = domain; - } - sal_ptcdi->proc_count++; - sal_ptclid->id = nasid; - sal_ptclid->eid = cpu; - sal_ptclid++; - cpus_found++; - } - } - } - - if (cpus_found != num_cpus) - FPROM_BUG(); - - /* Make the AP WAKEUP entry */ - sal_apwake->type = SAL_DESC_AP_WAKEUP; - sal_apwake->mechanism = IA64_SAL_AP_EXTERNAL_INT; - sal_apwake->vector = 18; - - for (cp = (char *) sal_systab; cp < (char *) efi_memmap; ++cp) - checksum += *cp; - - sal_systab->checksum = -checksum; - - md = &efi_memmap[0]; - num_memmd = build_efi_memmap((void *)md, mdsize) ; - - bp = id(ZERO_PAGE_ADDR + (((long)base_nasid)<<33)); - bp->efi_systab = __fwtab_pa(base_nasid, &fw_mem); - bp->efi_memmap = __fwtab_pa(base_nasid, efi_memmap); - bp->efi_memmap_size = num_memmd*mdsize; - bp->efi_memdesc_size = mdsize; - bp->efi_memdesc_version = 0x101; - bp->command_line = __fwtab_pa(base_nasid, cmd_line); - bp->console_info.num_cols = 80; - bp->console_info.num_rows = 25; - bp->console_info.orig_x = 0; - bp->console_info.orig_y = 24; - bp->num_pci_vectors = 0; - bp->fpswa = 0; - - /* - * Now pick the BSP & store it LID value in - * a global variable. Note if BSP is greater than last cpu, - * pick the last cpu. - */ - for (cnode=0; cnode 0) - continue; - return; - } - } -} diff -urN linux-2.4.18/arch/ia64/sn/fprom/main.c lia64-2.4/arch/ia64/sn/fprom/main.c --- linux-2.4.18/arch/ia64/sn/fprom/main.c Thu Jan 4 13:00:15 2001 +++ lia64-2.4/arch/ia64/sn/fprom/main.c Wed Dec 31 16:00:00 1969 @@ -1,110 +0,0 @@ -/* - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Jack Steiner (steiner@sgi.com) - */ - - - -#include -#include - -void bedrock_init(int); -void synergy_init(int, int); -void sys_fw_init (const char *args, int arglen, int bsp); - -volatile int bootmaster=0; /* Used to pick bootmaster */ -volatile int nasidmaster[128]={0}; /* Used to pick node/synergy masters */ -int init_done=0; -extern int bsp_lid; - -#define get_bit(b,p) (((*p)>>(b))&1) - -int -fmain(int lid, int bsp) { - int syn, nasid, cpu; - - /* - * First lets figure out who we are. This is done from the - * LID passed to us. - */ - nasid = (lid>>24); - syn = (lid>>17)&1; - cpu = (lid>>16)&1; - - /* - * Now pick a synergy master to initialize synergy registers. - */ - if (test_and_set_bit(syn, &nasidmaster[nasid]) == 0) { - synergy_init(nasid, syn); - test_and_set_bit(syn+2, &nasidmaster[nasid]); - } else - while (get_bit(syn+2, &nasidmaster[nasid]) == 0); - - /* - * Now pick a nasid master to initialize Bedrock registers. - */ - if (test_and_set_bit(8, &nasidmaster[nasid]) == 0) { - bedrock_init(nasid); - test_and_set_bit(9, &nasidmaster[nasid]); - } else - while (get_bit(9, &nasidmaster[nasid]) == 0); - - - /* - * Now pick a BSP & finish init. - */ - if (test_and_set_bit(0, &bootmaster) == 0) { - sys_fw_init(0, 0, bsp); - test_and_set_bit(1, &bootmaster); - } else - while (get_bit(1, &bootmaster) == 0); - - return (lid == bsp_lid); -} - - -void -bedrock_init(int nasid) -{ - nasid = nasid; /* to quiet gcc */ -} - - -void -synergy_init(int nasid, int syn) -{ - long *base; - long off; - - /* - * Enable all FSB flashed interrupts. - * ZZZ - I'd really like defines for this...... - */ - base = (long*)0x80000e0000000000LL; /* base of synergy regs */ - for (off = 0x2a0; off < 0x2e0; off+=8) /* offset for VEC_MASK_{0-3}_A/B */ - *(base+off/8) = -1LL; - - /* - * Set the NASID in the FSB_CONFIG register. - */ - base = (long*)0x80000e0000000450LL; - *base = (long)((nasid<<16)|(syn<<9)); -} - - -/* Why isnt there a bcopy/memcpy in lib64.a */ - -void* -memcpy(void * dest, const void *src, size_t count) -{ - char *s, *se, *d; - - for(d=dest, s=(char*)src, se=s+count; s] <-p> | <-k> [] - -p Create PROM control file & links - -k Create LINUX control file & links - -c Control file name [Default: cf] - Path to directory that contains the linux or PROM files. - The directory can be any of the following: - (linux simulations) - worktree - worktree/linux - any directory with vmlinux, vmlinux.sym & fprom files - (prom simulations) - worktree - worktree/stand/arcs/IP37prom/dev - any directory with fw.bin & fw.sim files - - Simulations: - sim [-X ] [-o ] [-M] [] - -c Control file name [Default: cf] - -M Pipe output thru fmtmedusa - -o Output filename (copy of all commands/output) [Default: simout] - -X Specifies number of instructions to execute [Default: 0] - (Used only in auto test mode - not described here) - -Examples: - sim -p # create control file (cf) & links for prom simulations - sim -k # create control file (cf) & links for linux simulations - sim -p -c cfprom # create a prom control file (cfprom) only. No links are made. - - sim # run medusa using previously created links & - # control file (cf). -END -exit 1 -} - -# ----------------------- create control file header -------------------- -create_cf_header() { -cat <>$CF -# -# Template for a control file for running linux kernels under medusa. -# You probably want to make mods here but this is a good starting point. -# - -# Preferences -setenv cpu_stepping A -setenv exceptionPrint off -setenv interrupt_messages off -setenv lastPCsize 100000 -setenv low_power_mode on -setenv partialIntelChipSet on -setenv printIntelMessages off -setenv prom_write_action halt -setenv prom_write_messages on -setenv step_quantum 100 -setenv swizzling on -setenv tsconsole on -setenv uart_echo on -symbols on - -# IDE disk params -setenv diskCylinders 611 -setenv bootDrive C -setenv diskHeads 16 -setenv diskPath idedisk -setenv diskPresent 1 -setenv diskSpt 63 - -# Hardware config -setenv coherency_type nasid -setenv cpu_cache_type default -setenv synergy_cache_type syn_cac_64m_8w - -# Numalink config -setenv route_enable on -setenv network_type xbar # Select [xbar|router] -setenv network_warning 0xff - -END -} - - -# ------------------ create control file entries for linux simulations ------------- -create_cf_linux() { -cat <>$CF -# Kernel specific options -setenv mca_on_memory_failure off -setenv LOADPC 0x00100000 # FPROM load address/entry point (8 digits!) -sr g 9 0xe000000000520000 # Kernel entry point -setenv symbol_table vmlinux.sym -load fprom -load vmlinux - -# Useful breakpoints to always have set. Add more if desired. -break 0xe000000000505e00 all # dispatch_to_fault_handler -break panic all # stop on panic -break die_if_kernel all # may as well stop - -END -} - -# ------------------ create control file entries for prom simulations --------------- -create_cf_prom() { - SYM2="" - ADDR="0x80000000ff800000" - [ "$EMBEDDED_LINUX" != "0" ] || SYM2="setenv symbol_table2 vmlinux.sym" - [ "$SIZE" = "8MB" ] || ADDR="0x80000000ffc00000" - cat <>$CF -# PROM specific options -setenv mca_on_memory_failure on -setenv LOADPC 0x80000000ffffffb0 -setenv promFile fw.bin -setenv promAddr $ADDR -setenv symbol_table fw.sym -$SYM2 - -# Useful breakpoints to always have set. Add more if desired. -break Pr_ivt_gexx all -break Pr_ivt_brk all -break Pr_PROM_Panic_Spin all -break Pr_PROM_Panic all -break Pr_PROM_C_Panic all -break Pr_fled_die all -break Pr_ResetNow all -break Pr_zzzbkpt all - -END -} - - -# ------------------ create control file entries for memory configuration ------------- -create_cf_memory() { -cat <>$CF -# CPU/Memory map format: -# setenv nodeN_memory_config 0xBSBSBSBS -# B=banksize (0=unused, 1=64M, 2=128M, .., 5-1G, c=8M, d=16M, e=32M) -# S=bank enable (0=both disable, 3=both enable, 2=bank1 enable, 1=bank0 enable) -# rightmost digits are for bank 0, the lowest address. -# setenv nodeN_nasid -# specifies the NASID for the node. This is used ONLY if booting the kernel. -# On PROM configurations, set to 0 - PROM will change it later. -# setenv nodeN_cpu_config -# Set bit number N to 1 to enable cpu N. Ex., a value of 5 enables cpu 0 & 2. -# -# Repeat the above 3 commands for each node. -# -# For kernel, default to 32MB. Although this is not a valid hardware configuration, -# it runs faster on medusa. For PROM, 64MB is smallest allowed value. - -setenv node0_cpu_config 0x1 # Enable only cpu 0 on the node -END - -if [ $LINUX -eq 1 ] ; then -cat <>$CF -setenv node0_nasid 0 # cnode 0 has NASID 0 -setenv node0_memory_config 0xe1 # 32MB -END -else -cat <>$CF -setenv node0_memory_config 0x11 # 64MB -END -fi -} - -# -------------------- set links to linux files ------------------------- -set_linux_links() { - if [ -d $D/linux/arch ] ; then - D=$D/linux - elif [ -d $D/arch -o -e vmlinux.sym ] ; then - D=$D - else - err "cant determine directory for linux binaries" - fi - rm -rf vmlinux vmlinux.sym fprom - ln -s $D/vmlinux vmlinux - ln -s $D/vmlinux.sym vmlinux.sym - if [ -d $D/arch ] ; then - ln -s $D/arch/ia64/sn/fprom/fprom fprom - else - ln -s $D/fprom fprom - fi - echo " .. Created links to linux files" -} - -# -------------------- set links to prom files ------------------------- -set_prom_links() { - if [ -d $D/stand ] ; then - D=$D/stand/arcs/IP37prom/dev - elif [ -d $D/sal ] ; then - D=$D - else - err "cant determine directory for PROM binaries" - fi - SETUP="$D/../../../../.setup" - grep -q '^ *setenv *PROMSIZE *8MB' $SETUP - if [ $? -eq 0 ] ; then - SIZE="8MB" - else - SIZE="4MB" - fi - grep -q '^ *setenv *LAUNCH_VMLINUX' $SETUP - EMBEDDED_LINUX=$? - rm -f fw.bin fw.map fw.sym vmlinux vmlinux.sym fprom - SDIR="SN1IA${SIZE}.O" - BIN="SN1IAip37prom${SIZE}" - ln -s $D/$SDIR/$BIN.bin fw.bin - ln -s $D/$SDIR/$BIN.map fw.map - ln -s $D/$SDIR/$BIN.sym fw.sym - echo " .. Created links to $SIZE prom files" - if [ $EMBEDDED_LINUX -eq 0 ] ; then - ln -s $D/linux/vmlinux vmlinux - ln -s $D/linux/vmlinux.sym vmlinux.sym - if [ -d linux/arch ] ; then - ln -s $D/linux/arch/ia64/sn/fprom/fprom fprom - else - ln -s $D/linux/fprom fprom - fi - echo " .. Created links to embedded linux files in prom tree" - fi -} - -# --------------- start of shell script -------------------------------- -OUT="simout" -FMTMED=0 -STEPCNT=0 -PROM=0 -LINUX=0 -NCF="cf" -while getopts "HMX:c:o:pk" c ; do - case ${c} in - H) help;; - M) FMTMED=1;; - X) STEPCNT=${OPTARG};; - c) NCF=${OPTARG};; - k) PROM=0;LINUX=1;; - p) PROM=1;LINUX=0;; - o) OUT=${OPTARG};; - \?) exit 1;; - esac -done -shift `expr ${OPTIND} - 1` - -# Check if command is for creating control file and/or links to images. -if [ $PROM -eq 1 -o $LINUX -eq 1 ] ; then - CF=$NCF - [ ! -f $CF ] || err "wont overwrite an existing control file ($CF)" - if [ $# -gt 0 ] ; then - D=$1 - [ -d $D ] || err "cannot find directory $D" - [ $PROM -eq 0 ] || set_prom_links - [ $LINUX -eq 0 ] || set_linux_links - fi - create_cf_header - [ $PROM -eq 0 ] || create_cf_prom - [ $LINUX -eq 0 ] || create_cf_linux - create_cf_memory - echo " .. Basic control file created (in $CF). You might want to edit" - echo " this file (at least, look at it)." - exit 0 -fi - -# Verify that the control file exists -CF=${1:-$NCF} -[ -f $CF ] || err "No control file exists. For help, type: $0 -H" - -# Build the .cf files from the user control file. The .cf file is -# identical except that the actual start & load addresses are inserted -# into the file. In addition, the FPROM commands for configuring memory -# and LIDs are generated. - -rm -f .cf .cf1 .cf2 -awk ' -function strtonum(n) { - if (substr(n,1,2) != "0x") - return int(n) - n = substr(n,3) - r=0 - while (length(n) > 0) { - r = r*16+(index("0123456789abcdef", substr(n,1,1))-1) - n = substr(n,2) - } - return r - } -/^#/ {next} -/^$/ {next} -/^setenv *LOADPC/ {loadpc = $3; next} -/^setenv *node._cpu_config/ {n=int(substr($2,5,1)); cpuconf[n] = strtonum($3); print; next} -/^setenv *node._memory_config/ {n=int(substr($2,5,1)); memconf[n] = strtonum($3); print; next} -/^setenv *node._nasid/ {n=int(substr($2,5,1)); nasid[n] = strtonum($3); print; next} - {print} -END { - # Generate the memmap info that starts at the beginning of - # the node the kernel was loaded on. - loadnasid = nasid[0] - cnode = 0 - for (i=0; i<128; i++) { - if (memconf[i] != "") { - printf "sm 0x%x%08x 0x%x%04x%04x\n", - 2*loadnasid, 8*cnodes+8, memconf[i], cpuconf[i], nasid[i] - cnodes++ - cpus += substr("0112122312232334", cpuconf[i]+1,1) - } - } - printf "sm 0x%x00000000 0x%x%08x\n", 2*loadnasid, cnodes, cpus - printf "setenv number_of_nodes %d\n", cnodes - - # Now set the starting PC for each cpu. - cnode = 0 - lowcpu=-1 - for (i=0; i<128; i++) { - if (memconf[i] != "") { - printf "setnode %d\n", cnode - conf = cpuconf[i] - for (j=0; j<4; j++) { - if (conf != int(conf/2)*2) { - printf "setcpu %d\n", j - if (length(loadpc) == 18) - printf "sr pc %s\n", loadpc - else - printf "sr pc 0x%x%s\n", 2*loadnasid, substr(loadpc,3) - if (lowcpu == -1) - lowcpu = j - } - conf = int(conf/2) - } - cnode++ - } - } - printf "setnode 0\n" - printf "setcpu %d\n", lowcpu - } -' <$CF >.cf - -# Now build the .cf1 & .cf2 control files. -CF2_LINES="^sm |^break |^run |^si |^quit |^symbols " -egrep "$CF2_LINES" .cf >.cf2 -egrep -v "$CF2_LINES" .cf >.cf1 -if [ $STEPCNT -ne 0 ] ; then - echo "s $STEPCNT" >>.cf2 - echo "lastpc 1000" >>.cf2 - echo "q" >>.cf2 -fi -echo "script-on $OUT" >>.cf2 - -# Now start medusa.... -if [ $FMTMED -ne 0 ] ; then - $MEDUSA -system mpsn1 -c .cf1 -i .cf2 | fmtmedusa -elif [ $STEPCNT -eq 0 ] ; then - $MEDUSA -system mpsn1 -c .cf1 -i .cf2 -else - $MEDUSA -system mpsn1 -c .cf1 -i .cf2 2>&1 -fi diff -urN linux-2.4.18/arch/ia64/sn/io/Makefile lia64-2.4/arch/ia64/sn/io/Makefile --- linux-2.4.18/arch/ia64/sn/io/Makefile Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/Makefile Fri Apr 26 17:15:30 2002 @@ -3,8 +3,7 @@ # License. See the file "COPYING" in the main directory of this archive # for more details. # -# Copyright (C) 2000 Silicon Graphics, Inc. -# Copyright (C) Jack Steiner (steiner@sgi.com) +# Copyright (C) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. # # # Makefile for the linux kernel. @@ -13,20 +12,34 @@ # removes any old dependencies. DON'T put your own dependencies here # unless it's something special (ie not a .c file). # -# Note 2! The CFLAGS definitions are now in the main makefile... -EXTRA_CFLAGS := -DSN -DLANGUAGE_C=1 -D_LANGUAGE_C=1 -I. -DBRINGUP \ - -DDIRECT_L1_CONSOLE -DNUMA_BASE -DSIMULATED_KLGRAPH \ - -DNUMA_MIGR_CONTROL -DLITTLE_ENDIAN -DREAL_HARDWARE \ - -DNEW_INTERRUPTS +EXTRA_CFLAGS := -DLITTLE_ENDIAN + O_TARGET := sgiio.o -obj-y := stubs.o sgi_if.o pciio.o pcibr.o xtalk.o xbow.o xswitch.o hubspc.o \ - klgraph_hack.o io.o hubdev.o huberror.o \ + +ifeq ($(CONFIG_MODULES),y) +export-objs = pciio.o hcl.o pci_dma.o +endif + +obj-y := stubs.o sgi_if.o pciio.o xtalk.o xbow.o xswitch.o klgraph_hack.o \ hcl.o labelcl.o invent.o klgraph.o klconflib.o sgi_io_sim.o \ module.o sgi_io_init.o klgraph_hack.o ml_SN_init.o \ - ml_SN_intr.o ip37.o pciba.o \ - ml_iograph.o hcl_util.o cdl.o \ - mem_refcnt.o devsupport.o alenlist.o pci_bus_cvlink.o \ - eeprom.o pci.o pci_dma.o l1.o l1_command.o ate_utils.o + ml_iograph.o hcl_util.o cdl.o hubdev.o hubspc.o \ + alenlist.o pci_bus_cvlink.o \ + eeprom.o pci.o pci_dma.o l1.o l1_command.o ate_utils.o \ + ifconfig_net.o efi-rtc.o io.o + +obj-$(CONFIG_IA64_SGI_SN1) += sn1/ml_SN_intr.o sn1/mem_refcnt.o sn1/hubcounters.o \ + sn1/ip37.o sn1/huberror.o sn1/hub_intr.o sn1/pcibr.o + +obj-$(CONFIG_IA64_SGI_SN2) += sn2/ml_SN_intr.o sn2/shub_intr.o sn2/shuberror.o \ + sn2/bte_error.o \ + sn2/pcibr/pcibr_dvr.o sn2/pcibr/pcibr_ate.o \ + sn2/pcibr/pcibr_config.o sn2/pcibr/pcibr_dvr.o \ + sn2/pcibr/pcibr_hints.o \ + sn2/pcibr/pcibr_idbg.o sn2/pcibr/pcibr_intr.o \ + sn2/pcibr/pcibr_rrb.o sn2/pcibr/pcibr_slot.o + +obj-$(CONFIG_PCIBA) += pciba.o include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ia64/sn/io/alenlist.c lia64-2.4/arch/ia64/sn/io/alenlist.c --- linux-2.4.18/arch/ia64/sn/io/alenlist.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/alenlist.c Mon Feb 4 17:48:56 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ /* Implementation of Address/Length Lists. */ @@ -13,9 +12,9 @@ #include #include +#include #include #include -#include /* * Logically, an Address/Length List is a list of Pairs, where each pair @@ -218,9 +217,9 @@ void alenlist_init(void) { - alenlist_zone = kmem_zone_init(sizeof(struct alenlist_s), "alenlist"); - alenlist_chunk_zone = kmem_zone_init(sizeof(struct alenlist_chunk_s), "alchunk"); - alenlist_cursor_zone = kmem_zone_init(sizeof(struct alenlist_cursor_s), "alcursor"); + alenlist_zone = snia_kmem_zone_init(sizeof(struct alenlist_s), "alenlist"); + alenlist_chunk_zone = snia_kmem_zone_init(sizeof(struct alenlist_chunk_s), "alchunk"); + alenlist_cursor_zone = snia_kmem_zone_init(sizeof(struct alenlist_cursor_s), "alcursor"); #if DEBUG idbg_addfunc("alenshow", alenlist_show); #endif /* DEBUG */ @@ -250,7 +249,7 @@ { alenlist_t alenlist; - alenlist = kmem_zone_alloc(alenlist_zone, flags & AL_NOSLEEP ? VM_NOSLEEP : 0); + alenlist = snia_kmem_zone_alloc(alenlist_zone, flags & AL_NOSLEEP ? VM_NOSLEEP : 0); if (alenlist) { INCR_COUNT(&alenlist_count); @@ -334,7 +333,7 @@ while (chunk) { freechunk = chunk; chunk = chunk->alc_next; - kmem_zone_free(alenlist_chunk_zone, freechunk); + snia_kmem_zone_free(alenlist_chunk_zone, freechunk); DECR_COUNT(&alenlist_chunk_count); } alenlist->al_actual_size = ALEN_CHUNK_SZ; @@ -407,7 +406,7 @@ alenlist_clear(alenlist); /* Now, free the alenlist itself */ - kmem_zone_free(alenlist_zone, alenlist); + snia_kmem_zone_free(alenlist_zone, alenlist); DECR_COUNT(&alenlist_count); } @@ -473,7 +472,7 @@ } else { alenlist_chunk_t new_chunk; - new_chunk = kmem_zone_alloc(alenlist_chunk_zone, + new_chunk = snia_kmem_zone_alloc(alenlist_chunk_zone, flags & AL_NOSLEEP ? VM_NOSLEEP : 0); if (new_chunk == NULL) @@ -656,7 +655,7 @@ alenlist_cursor_t cursorp; ASSERT(alenlist != NULL); - cursorp = kmem_zone_alloc(alenlist_cursor_zone, flags & AL_NOSLEEP ? VM_NOSLEEP : 0); + cursorp = snia_kmem_zone_alloc(alenlist_cursor_zone, flags & AL_NOSLEEP ? VM_NOSLEEP : 0); if (cursorp) { INCR_COUNT(&alenlist_cursor_count); alenlist_cursor_init(alenlist, 0, cursorp); @@ -671,7 +670,7 @@ alenlist_cursor_destroy(alenlist_cursor_t cursorp) { DECR_COUNT(&alenlist_cursor_count); - kmem_zone_free(alenlist_cursor_zone, cursorp); + snia_kmem_zone_free(alenlist_cursor_zone, cursorp); } @@ -752,7 +751,7 @@ maxlength -= ((alenp->al_addr + cursorp->al_bcount) & maxlen1); - length = MIN(maxlength, length); + length = min(maxlength, length); } /* Update the cursor, if desired. */ @@ -842,7 +841,7 @@ offset = poff(kvaddr); /* Handle first page */ - piece_length = MIN(NBPP - offset, length); + piece_length = min((size_t)(NBPP - offset), length); if (alenlist_append(alenlist, paddr, piece_length, flags) == ALENLIST_FAILURE) goto failure; length -= piece_length; diff -urN linux-2.4.18/arch/ia64/sn/io/ate_utils.c lia64-2.4/arch/ia64/sn/io/ate_utils.c --- linux-2.4.18/arch/ia64/sn/io/ate_utils.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/ate_utils.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,205 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* + * Allocate the map needed to allocate the ATE entries. + */ +struct map * +atemapalloc(ulong_t mapsiz) +{ + struct map *mp; + ulong_t size; + struct a { + spinlock_t lock; + sv_t sema; + } *sync; + + if (mapsiz == 0) + return(NULL); + size = sizeof(struct map) * (mapsiz + 2); + if ((mp = (struct map *) kmalloc(size, GFP_KERNEL)) == NULL) + return(NULL); + memset(mp, 0x0, size); + + sync = kmalloc(sizeof(struct a), GFP_KERNEL); + if (sync == NULL) { + kfree(mp); + return(NULL); + } + memset(sync, 0x0, sizeof(struct a)); + + mutex_spinlock_init(&sync->lock); + sv_init( &(sync->sema), &(sync->lock), SV_MON_SPIN | SV_ORDER_FIFO /*| SV_INTS*/); + mp[1].m_size = (unsigned long) &sync->lock; + mp[1].m_addr = (unsigned long) &sync->sema; + mapsize(mp) = mapsiz - 1; + return(mp); +} + +/* + * free a map structure previously allocated via rmallocmap(). + */ +void +atemapfree(struct map *mp) +{ + struct a { + spinlock_t lock; + sv_t sema; + }; + /* ASSERT(sv_waitq(mapout(mp)) == 0); */ + /* sv_destroy(mapout(mp)); */ + spin_lock_destroy(maplock(mp)); + kfree((void *)mp[1].m_size); + kfree(mp); +} + +/* + * Allocate 'size' units from the given map. + * Return the base of the allocated space. + * In a map, the addresses are increasing and the + * list is terminated by a 0 size. + * Algorithm is first-fit. + */ + +ulong_t +atealloc( + struct map *mp, + size_t size) +{ + register unsigned int a; + register struct map *bp; + register unsigned long s; + + ASSERT(size >= 0); + + if (size == 0) + return((ulong_t) NULL); + + s = mutex_spinlock(maplock(mp)); + + for (bp = mapstart(mp); bp->m_size; bp++) { + if (bp->m_size >= size) { + a = bp->m_addr; + bp->m_addr += size; + if ((bp->m_size -= size) == 0) { + do { + bp++; + (bp-1)->m_addr = bp->m_addr; + } while ((((bp-1)->m_size) = (bp->m_size))); + mapsize(mp)++; + } + + ASSERT(bp->m_size < 0x80000000); + mutex_spinunlock(maplock(mp), s); + return(a); + } + } + + /* + * We did not get what we need .. we cannot sleep .. + */ + mutex_spinunlock(maplock(mp), s); + return(0); +} + +/* + * Free the previously allocated space a of size units into the specified map. + * Sort ``a'' into map and combine on one or both ends if possible. + * Returns 0 on success, 1 on failure. + */ +void +atefree(struct map *mp, size_t size, ulong_t a) +{ + register struct map *bp; + register unsigned int t; + register unsigned long s; + + ASSERT(size >= 0); + + if (size == 0) + return; + + bp = mapstart(mp); + s = mutex_spinlock(maplock(mp)); + + for ( ; bp->m_addr<=a && bp->m_size!=0; bp++) + ; + if (bp>mapstart(mp) && (bp-1)->m_addr+(bp-1)->m_size == a) { + (bp-1)->m_size += size; + if (bp->m_addr) { + /* m_addr==0 end of map table */ + ASSERT(a+size <= bp->m_addr); + if (a+size == bp->m_addr) { + + /* compress adjacent map addr entries */ + (bp-1)->m_size += bp->m_size; + while (bp->m_size) { + bp++; + (bp-1)->m_addr = bp->m_addr; + (bp-1)->m_size = bp->m_size; + } + mapsize(mp)++; + } + } + } else { + if (a+size == bp->m_addr && bp->m_size) { + bp->m_addr -= size; + bp->m_size += size; + } else { + ASSERT(size); + if (mapsize(mp) == 0) { + mutex_spinunlock(maplock(mp), s); + printk("atefree : map overflow 0x%p Lost 0x%lx items at 0x%lx", + (void *)mp, size, a) ; + return ; + } + do { + t = bp->m_addr; + bp->m_addr = a; + a = t; + t = bp->m_size; + bp->m_size = size; + bp++; + } while ((size = t)); + mapsize(mp)--; + } + } + mutex_spinunlock(maplock(mp), s); + /* + * wake up everyone waiting for space + */ + if (mapout(mp)) + ; + /* sv_broadcast(mapout(mp)); */ +} diff -urN linux-2.4.18/arch/ia64/sn/io/cdl.c lia64-2.4/arch/ia64/sn/io/cdl.c --- linux-2.4.18/arch/ia64/sn/io/cdl.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/cdl.c Mon Feb 4 17:48:56 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ #include @@ -17,11 +16,9 @@ #include "asm/sn/ioerror_handling.h" #include -#ifdef BRINGUP /* these get called directly in cdl_add_connpt in fops bypass hack */ extern int pcibr_attach(devfs_handle_t); extern int xbow_attach(devfs_handle_t); -#endif /* BRINGUP */ /* * cdl: Connection and Driver List @@ -37,8 +34,6 @@ int mfg_num; int (*attach) (devfs_handle_t); } dummy_reg; - -typedef struct cdl *cdl_p; #define MAX_SGI_IO_INFRA_DRVR 4 struct cdl sgi_infrastructure_drivers[MAX_SGI_IO_INFRA_DRVR] = diff -urN linux-2.4.18/arch/ia64/sn/io/devsupport.c lia64-2.4/arch/ia64/sn/io/devsupport.c --- linux-2.4.18/arch/ia64/sn/io/devsupport.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/devsupport.c Wed Dec 31 16:00:00 1969 @@ -1,1289 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Interfaces in this file are all platform-independent AND IObus-independent. - * Be aware that there may be macro equivalents to each of these hiding in - * header files which supercede these functions. - */ - -/* =====Generic iobus support===== */ - -/* String table to hold names of interrupts. */ -#ifdef LATER -static struct string_table device_desc_string_table; -#endif - -/* One time initialization for device descriptor support. */ -static void -device_desc_init(void) -{ -#ifdef LATER - string_table_init(&device_desc_string_table); -#endif - FIXME("device_desc_init"); -} - - -/* Drivers use these interfaces to manage device descriptors */ -static device_desc_t -device_desc_alloc(void) -{ -#ifdef LATER - device_desc_t device_desc; - - device_desc = (device_desc_t)kmem_zalloc(sizeof(struct device_desc_s), 0); - device_desc->intr_target = GRAPH_VERTEX_NONE; - - ASSERT(device_desc->intr_policy == 0); - device_desc->intr_swlevel = -1; - ASSERT(device_desc->intr_name == NULL); - ASSERT(device_desc->flags == 0); - - ASSERT(!(device_desc->flags & D_IS_ASSOC)); - return(device_desc); -#else - FIXME("device_desc_alloc"); - return((device_desc_t)0); -#endif -} - -void -device_desc_free(device_desc_t device_desc) -{ -#ifdef LATER - if (!(device_desc->flags & D_IS_ASSOC)) /* sanity */ - kfree(device_desc); -#endif - FIXME("device_desc_free"); -} - -device_desc_t -device_desc_dup(devfs_handle_t dev) -{ -#ifdef LATER - device_desc_t orig_device_desc, new_device_desc; - - - new_device_desc = device_desc_alloc(); - orig_device_desc = device_desc_default_get(dev); - if (orig_device_desc) - *new_device_desc = *orig_device_desc;/* small structure copy */ - else { - device_driver_t driver; - ilvl_t pri; - /* - * Use the driver's thread priority in - * case the device thread priority has not - * been given. - */ - if (driver = device_driver_getbydev(dev)) { - pri = device_driver_thread_pri_get(driver); - device_desc_intr_swlevel_set(new_device_desc,pri); - } - } - new_device_desc->flags &= ~D_IS_ASSOC; - return(new_device_desc); -#else - FIXME("device_desc_dup"); - return((device_desc_t)0); -#endif -} - -device_desc_t -device_desc_default_get(devfs_handle_t dev) -{ -#ifdef LATER - graph_error_t rc; - device_desc_t device_desc; - - rc = hwgraph_info_get_LBL(dev, INFO_LBL_DEVICE_DESC, (arbitrary_info_t *)&device_desc); - - if (rc == GRAPH_SUCCESS) - return(device_desc); - else - return(NULL); -#else - FIXME("device_desc_default_get"); - return((device_desc_t)0); -#endif -} - -void -device_desc_default_set(devfs_handle_t dev, device_desc_t new_device_desc) -{ -#ifdef LATER - graph_error_t rc; - device_desc_t old_device_desc = NULL; - - if (new_device_desc) { - new_device_desc->flags |= D_IS_ASSOC; - rc = hwgraph_info_add_LBL(dev, INFO_LBL_DEVICE_DESC, - (arbitrary_info_t)new_device_desc); - if (rc == GRAPH_DUP) { - rc = hwgraph_info_replace_LBL(dev, INFO_LBL_DEVICE_DESC, - (arbitrary_info_t)new_device_desc, - (arbitrary_info_t *)&old_device_desc); - - ASSERT(rc == GRAPH_SUCCESS); - } - hwgraph_info_export_LBL(dev, INFO_LBL_DEVICE_DESC, - sizeof(struct device_desc_s)); - } else { - rc = hwgraph_info_remove_LBL(dev, INFO_LBL_DEVICE_DESC, - (arbitrary_info_t *)&old_device_desc); - } - - if (old_device_desc) { - ASSERT(old_device_desc->flags & D_IS_ASSOC); - old_device_desc->flags &= ~D_IS_ASSOC; - device_desc_free(old_device_desc); - } -#endif - FIXME("device_desc_default_set"); -} - -devfs_handle_t -device_desc_intr_target_get(device_desc_t device_desc) -{ -#ifdef LATER - return(device_desc->intr_target); -#else - FIXME("device_desc_intr_target_get"); - return((devfs_handle_t)0); -#endif -} - -int -device_desc_intr_policy_get(device_desc_t device_desc) -{ -#ifdef LATER - return(device_desc->intr_policy); -#else - FIXME("device_desc_intr_policy_get"); - return(0); -#endif -} - -ilvl_t -device_desc_intr_swlevel_get(device_desc_t device_desc) -{ -#ifdef LATER - return(device_desc->intr_swlevel); -#else - FIXME("device_desc_intr_swlevel_get"); - return((ilvl_t)0); -#endif -} - -char * -device_desc_intr_name_get(device_desc_t device_desc) -{ -#ifdef LATER - return(device_desc->intr_name); -#else - FIXME("device_desc_intr_name_get"); - return(NULL); -#endif -} - -int -device_desc_flags_get(device_desc_t device_desc) -{ -#ifdef LATER - return(device_desc->flags); -#else - FIXME("device_desc_flags_get"); - return(0); -#endif -} - -void -device_desc_intr_target_set(device_desc_t device_desc, devfs_handle_t target) -{ - if ( device_desc != (device_desc_t)0 ) - device_desc->intr_target = target; -} - -void -device_desc_intr_policy_set(device_desc_t device_desc, int policy) -{ - if ( device_desc != (device_desc_t)0 ) - device_desc->intr_policy = policy; -} - -void -device_desc_intr_swlevel_set(device_desc_t device_desc, ilvl_t swlevel) -{ - if ( device_desc != (device_desc_t)0 ) - device_desc->intr_swlevel = swlevel; -} - -void -device_desc_intr_name_set(device_desc_t device_desc, char *name) -{ -#ifdef LATER - if ( device_desc != (device_desc_t)0 ) - device_desc->intr_name = string_table_insert(&device_desc_string_table, name); -#else - FIXME("device_desc_intr_name_set"); -#endif -} - -void -device_desc_flags_set(device_desc_t device_desc, int flags) -{ - if ( device_desc != (device_desc_t)0 ) - device_desc->flags = flags; -} - - - -/*============= device admin registry routines ===================== */ - -/* Linked list of pairs */ -typedef struct dev_admin_list_s { - struct dev_admin_list_s *admin_next; /* next entry in the - * list - */ - char *admin_name; /* info label */ - char *admin_val; /* actual info */ -} dev_admin_list_t; - -/* Device/Driver administration registry */ -typedef struct dev_admin_registry_s { - mrlock_t reg_lock; /* To allow - * exclusive - * access - */ - dev_admin_list_t *reg_first; /* first entry in - * the list - */ - dev_admin_list_t **reg_last; /* pointer to the - * next to last entry - * in the last which - * is also the place - * where the new - * entry gets - * inserted - */ -} dev_admin_registry_t; - -/* -** device_driver_s associates a device driver prefix with device switch entries. -*/ -struct device_driver_s { - struct device_driver_s *dd_next; /* next element on hash chain */ - struct device_driver_s *dd_prev; /* previous element on hash chain */ - char *dd_prefix; /* driver prefix string */ - struct bdevsw *dd_bdevsw; /* driver's bdevsw */ - struct cdevsw *dd_cdevsw; /* driver's cdevsw */ - - /* driver administration specific data structures need to - * maintain the list of pairs - */ - dev_admin_registry_t dd_dev_admin_registry; - ilvl_t dd_thread_pri; /* default thread priority for - * all this driver's - * threads. - */ - -}; - -#define NEW(_p) (_p = kmalloc(sizeof(*_p), GFP_KERNEL)) -#define FREE(_p) (kmem_free(_p)) - -/* - * helpful lock macros - */ - -#define DEV_ADMIN_REGISTRY_INITLOCK(lockp,name) mrinit(lockp,name) -#define DEV_ADMIN_REGISTRY_RDLOCK(lockp) mraccess(lockp) -#define DEV_ADMIN_REGISTRY_WRLOCK(lockp) mrupdate(lockp) -#define DEV_ADMIN_REGISTRY_UNLOCK(lockp) mrunlock(lockp) - -/* Initialize the registry - */ -static void -dev_admin_registry_init(dev_admin_registry_t *registry) -{ -#ifdef LATER - if ( registry != (dev_admin_registry_t *)0 ) - DEV_ADMIN_REGISTRY_INITLOCK(®istry->reg_lock, - "dev_admin_registry_lock"); - registry->reg_first = NULL; - registry->reg_last = ®istry->reg_first; - } -#else - FIXME("dev_admin_registry_init"); -#endif -} - -/* - * add an entry to the dev admin registry. - * if the name already exists in the registry then change the - * value iff the new value differs from the old value. - * if the name doesn't exist a new list entry is created and put - * at the end. - */ -static void -dev_admin_registry_add(dev_admin_registry_t *registry, - char *name, - char *val) -{ -#ifdef LATER - dev_admin_list_t *reg_entry; - dev_admin_list_t *scan = 0; - - DEV_ADMIN_REGISTRY_WRLOCK(®istry->reg_lock); - - /* check if the name already exists in the registry */ - scan = registry->reg_first; - - while (scan) { - if (strcmp(scan->admin_name,name) == 0) { - /* name is there in the registry */ - if (strcmp(scan->admin_val,val)) { - /* old value != new value - * reallocate memory and copy the new value - */ - FREE(scan->admin_val); - scan->admin_val = - (char *)kern_calloc(1,strlen(val)+1); - strcpy(scan->admin_val,val); - goto out; - } - goto out; /* old value == new value */ - } - scan = scan->admin_next; - } - - /* name is not there in the registry. - * allocate memory for the new registry entry - */ - NEW(reg_entry); - - reg_entry->admin_next = 0; - reg_entry->admin_name = (char *)kern_calloc(1,strlen(name)+1); - strcpy(reg_entry->admin_name,name); - reg_entry->admin_val = (char *)kern_calloc(1,strlen(val)+1); - strcpy(reg_entry->admin_val,val); - - /* add the entry at the end of the registry */ - - *(registry->reg_last) = reg_entry; - registry->reg_last = ®_entry->admin_next; - -out: DEV_ADMIN_REGISTRY_UNLOCK(®istry->reg_lock); -#endif - FIXME("dev_admin_registry_add"); -} -/* - * check if there is an info corr. to a particular - * name starting from the cursor position in the - * registry - */ -static char * -dev_admin_registry_find(dev_admin_registry_t *registry,char *name) -{ -#ifdef LATER - dev_admin_list_t *scan = 0; - - DEV_ADMIN_REGISTRY_RDLOCK(®istry->reg_lock); - scan = registry->reg_first; - - while (scan) { - if (strcmp(scan->admin_name,name) == 0) { - DEV_ADMIN_REGISTRY_UNLOCK(®istry->reg_lock); - return scan->admin_val; - } - scan = scan->admin_next; - } - DEV_ADMIN_REGISTRY_UNLOCK(®istry->reg_lock); - return 0; -#else - FIXME("dev_admin_registry_find"); - return(NULL); -#endif -} -/*============= MAIN DEVICE/ DRIVER ADMINISTRATION INTERFACE================ */ -/* - * return any labelled info associated with a device. - * called by any kernel code including device drivers. - */ -char * -device_admin_info_get(devfs_handle_t dev_vhdl, - char *info_lbl) -{ -#ifdef LATER - char *info = 0; - - /* return value need not be GRAPH_SUCCESS as the labelled - * info may not be present - */ - (void)hwgraph_info_get_LBL(dev_vhdl,info_lbl, - (arbitrary_info_t *)&info); - - - return info; -#else - FIXME("device_admin_info_get"); - return(NULL); -#endif -} - -/* - * set labelled info associated with a device. - * called by hwgraph infrastructure . may also be called - * by device drivers etc. - */ -int -device_admin_info_set(devfs_handle_t dev_vhdl, - char *dev_info_lbl, - char *dev_info_val) -{ -#ifdef LATER - graph_error_t rv; - arbitrary_info_t old_info; - - /* Handle the labelled info - * intr_target - * sw_level - * in a special way. These are part of device_desc_t - * Right now this is the only case where we have - * a set of related device_admin attributes which - * are grouped together. - * In case there is a need for another set we need to - * take a more generic approach to solving this. - * Basically a registry should be implemented. This - * registry is initialized with the callbacks for the - * attributes which need to handled in a special way - * For example: - * Consider - * device_desc - * intr_target - * intr_swlevel - * register "do_intr_target" for intr_target - * register "do_intr_swlevel" for intr_swlevel. - * When the device_admin interface layer gets an pair - * it looks in the registry to see if there is a function registered to - * handle "attr. If not follow the default path of setting the - * as labelled information hanging off the vertex. - * In the above example: - * "do_intr_target" does what is being done below for the ADMIN_LBL_INTR_TARGET - * case - */ - if (!strcmp(dev_info_lbl,ADMIN_LBL_INTR_TARGET) || - !strcmp(dev_info_lbl,ADMIN_LBL_INTR_SWLEVEL)) { - - device_desc_t device_desc; - - /* Check if there is a default device descriptor - * information for this vertex. If not dup one . - */ - if (!(device_desc = device_desc_default_get(dev_vhdl))) { - device_desc = device_desc_dup(dev_vhdl); - device_desc_default_set(dev_vhdl,device_desc); - - } - if (!strcmp(dev_info_lbl,ADMIN_LBL_INTR_TARGET)) { - /* Check if a target cpu has been specified - * for this device by a device administration - * directive - */ -#ifdef DEBUG - printf(ADMIN_LBL_INTR_TARGET - " dev = 0x%x " - "dev_admin_info = %s" - " target = 0x%x\n", - dev_vhdl, - dev_info_lbl, - hwgraph_path_to_vertex(dev_info_val)); -#endif - - device_desc->intr_target = - hwgraph_path_to_vertex(dev_info_val); - } else if (!strcmp(dev_info_lbl,ADMIN_LBL_INTR_SWLEVEL)) { - /* Check if the ithread priority level has been - * specified for this device by a device administration - * directive - */ -#ifdef DEBUG - printf(ADMIN_LBL_INTR_SWLEVEL - " dev = 0x%x " - "dev_admin_info = %s" - " sw level = 0x%x\n", - dev_vhdl, - dev_info_lbl, - atoi(dev_info_val)); -#endif - device_desc->intr_swlevel = atoi(dev_info_val); - } - - } - if (!dev_info_val) - rv = hwgraph_info_remove_LBL(dev_vhdl, - dev_info_lbl, - &old_info); - else { - - rv = hwgraph_info_add_LBL(dev_vhdl, - dev_info_lbl, - (arbitrary_info_t)dev_info_val); - - if (rv == GRAPH_DUP) { - rv = hwgraph_info_replace_LBL(dev_vhdl, - dev_info_lbl, - (arbitrary_info_t)dev_info_val, - &old_info); - } - } - ASSERT(rv == GRAPH_SUCCESS); -#endif - FIXME("device_admin_info_set"); - return 0; -} - -/* - * return labelled info associated with a device driver - * called by kernel code including device drivers - */ -char * -device_driver_admin_info_get(char *driver_prefix, - char *driver_info_lbl) -{ -#ifdef LATER - device_driver_t driver; - - driver = device_driver_get(driver_prefix); - return (dev_admin_registry_find(&driver->dd_dev_admin_registry, - driver_info_lbl)); -#else - FIXME("device_driver_admin_info_get"); - return(NULL); -#endif -} - -/* - * set labelled info associated with a device driver. - * called by hwgraph infrastructure . may also be called - * from drivers etc. - */ -int -device_driver_admin_info_set(char *driver_prefix, - char *driver_info_lbl, - char *driver_info_val) -{ -#ifdef LATER - device_driver_t driver; - - driver = device_driver_get(driver_prefix); - dev_admin_registry_add(&driver->dd_dev_admin_registry, - driver_info_lbl, - driver_info_val); -#endif - FIXME("device_driver_admin_info_set"); - return 0; -} -/*================== device / driver admin support routines================*/ - -/* static tables created by lboot */ -extern dev_admin_info_t dev_admin_table[]; -extern dev_admin_info_t drv_admin_table[]; -extern int dev_admin_table_size; -extern int drv_admin_table_size; - -/* Extend the device admin table to allow the kernel startup code to - * provide some device specific administrative hints - */ -#define ADMIN_TABLE_CHUNK 100 -static dev_admin_info_t extended_dev_admin_table[ADMIN_TABLE_CHUNK]; -static int extended_dev_admin_table_size = 0; -static mrlock_t extended_dev_admin_table_lock; - -/* Initialize the extended device admin table */ -void -device_admin_table_init(void) -{ -#ifdef LATER - extended_dev_admin_table_size = 0; - mrinit(&extended_dev_admin_table_lock, - "extended_dev_admin_table_lock"); -#endif - FIXME("device_admin_table_init"); -} -/* Add triple to - * the extended device administration info table. This is helpful - * for kernel startup code to put some hints before the hwgraph - * is setup - */ -void -device_admin_table_update(char *name,char *label,char *value) -{ -#ifdef LATER - dev_admin_info_t *p; - - mrupdate(&extended_dev_admin_table_lock); - - /* Safety check that we haven't exceeded array limits */ - ASSERT(extended_dev_admin_table_size < ADMIN_TABLE_CHUNK); - - if (extended_dev_admin_table_size == ADMIN_TABLE_CHUNK) - goto out; - - /* Get the pointer to the entry in the table where we are - * going to put the new information - */ - p = &extended_dev_admin_table[extended_dev_admin_table_size++]; - - /* Allocate memory for the strings and copy them in */ - p->dai_name = (char *)kern_calloc(1,strlen(name)+1); - strcpy(p->dai_name,name); - p->dai_param_name = (char *)kern_calloc(1,strlen(label)+1); - strcpy(p->dai_param_name,label); - p->dai_param_val = (char *)kern_calloc(1,strlen(value)+1); - strcpy(p->dai_param_val,value); - -out: mrunlock(&extended_dev_admin_table_lock); -#endif - FIXME("device_admin_table_update"); -} -/* Extend the device driver admin table to allow the kernel startup code to - * provide some device driver specific administrative hints - */ - -static dev_admin_info_t extended_drv_admin_table[ADMIN_TABLE_CHUNK]; -static int extended_drv_admin_table_size = 0; -mrlock_t extended_drv_admin_table_lock; - -/* Initialize the extended device driver admin table */ -void -device_driver_admin_table_init(void) -{ -#ifdef LATER - extended_drv_admin_table_size = 0; - mrinit(&extended_drv_admin_table_lock, - "extended_drv_admin_table_lock"); -#endif - FIXME("device_driver_admin_table_init"); -} -/* Add triple to - * the extended device administration info table. This is helpful - * for kernel startup code to put some hints before the hwgraph - * is setup - */ -void -device_driver_admin_table_update(char *name,char *label,char *value) -{ -#ifdef LATER - dev_admin_info_t *p; - - mrupdate(&extended_dev_admin_table_lock); - - /* Safety check that we haven't exceeded array limits */ - ASSERT(extended_drv_admin_table_size < ADMIN_TABLE_CHUNK); - - if (extended_drv_admin_table_size == ADMIN_TABLE_CHUNK) - goto out; - - /* Get the pointer to the entry in the table where we are - * going to put the new information - */ - p = &extended_drv_admin_table[extended_drv_admin_table_size++]; - - /* Allocate memory for the strings and copy them in */ - p->dai_name = (char *)kern_calloc(1,strlen(name)+1); - strcpy(p->dai_name,name); - p->dai_param_name = (char *)kern_calloc(1,strlen(label)+1); - strcpy(p->dai_param_name,label); - p->dai_param_val = (char *)kern_calloc(1,strlen(value)+1); - strcpy(p->dai_param_val,value); - -out: mrunlock(&extended_drv_admin_table_lock); -#endif - FIXME("device_driver_admin_table_update"); -} -/* - * keeps on adding the labelled info for each new (lbl,value) pair - * that it finds in the static dev admin table ( created by lboot) - * and the extended dev admin table ( created if at all by the kernel startup - * code) corresponding to a device in the hardware graph. - */ -void -device_admin_info_update(devfs_handle_t dev_vhdl) -{ -#ifdef LATER - int i = 0; - dev_admin_info_t *scan; - devfs_handle_t scan_vhdl; - - /* Check the static device administration info table */ - scan = dev_admin_table; - while (i < dev_admin_table_size) { - - scan_vhdl = hwgraph_path_to_dev(scan->dai_name); - if (scan_vhdl == dev_vhdl) { - device_admin_info_set(dev_vhdl, - scan->dai_param_name, - scan->dai_param_val); - } - if (scan_vhdl != NODEV) - hwgraph_vertex_unref(scan_vhdl); - scan++;i++; - - } - i = 0; - /* Check the extended device administration info table */ - scan = extended_dev_admin_table; - while (i < extended_dev_admin_table_size) { - scan_vhdl = hwgraph_path_to_dev(scan->dai_name); - if (scan_vhdl == dev_vhdl) { - device_admin_info_set(dev_vhdl, - scan->dai_param_name, - scan->dai_param_val); - } - if (scan_vhdl != NODEV) - hwgraph_vertex_unref(scan_vhdl); - scan++;i++; - - } - - -#endif - FIXME("device_admin_info_update"); -} - -/* looks up the static drv admin table ( created by the lboot) and the extended - * drv admin table (created if at all by the kernel startup code) - * for this driver specific administration info and adds it to the admin info - * associated with this device driver's object - */ -void -device_driver_admin_info_update(device_driver_t driver) -{ -#ifdef LATER - int i = 0; - dev_admin_info_t *scan; - - /* Check the static device driver administration info table */ - scan = drv_admin_table; - while (i < drv_admin_table_size) { - - if (strcmp(scan->dai_name,driver->dd_prefix) == 0) { - dev_admin_registry_add(&driver->dd_dev_admin_registry, - scan->dai_param_name, - scan->dai_param_val); - } - scan++;i++; - } - i = 0; - /* Check the extended device driver administration info table */ - scan = extended_drv_admin_table; - while (i < extended_drv_admin_table_size) { - - if (strcmp(scan->dai_name,driver->dd_prefix) == 0) { - dev_admin_registry_add(&driver->dd_dev_admin_registry, - scan->dai_param_name, - scan->dai_param_val); - } - scan++;i++; - } -#endif - FIXME("device_driver_admin_info_update"); -} - -/* =====Device Driver Support===== */ - - - -/* -** Generic device driver support routines for use by kernel modules that -** deal with device drivers (but NOT for use by the drivers themselves). -** EVERY registered driver currently in the system -- static or loadable -- -** has an entry in the device_driver_hash table. A pointer to such an entry -** serves as a generic device driver handle. -*/ - -#define DEVICE_DRIVER_HASH_SIZE 32 -#ifdef LATER -lock_t device_driver_lock[DEVICE_DRIVER_HASH_SIZE]; -device_driver_t device_driver_hash[DEVICE_DRIVER_HASH_SIZE]; -static struct string_table driver_prefix_string_table; -#endif - -/* -** Initialize device driver infrastructure. -*/ -void -device_driver_init(void) -{ -#ifdef LATER - int i; - extern void alenlist_init(void); - extern void hwgraph_init(void); - extern void device_desc_init(void); - - ASSERT(DEVICE_DRIVER_NONE == NULL); - alenlist_init(); - hwgraph_init(); - device_desc_init(); - - string_table_init(&driver_prefix_string_table); - - for (i=0; isdd_prefix); - if (!driver) - driver = device_driver_alloc(desc->sdd_prefix); - pri = device_driver_sysgen_thread_pri_get(desc->sdd_prefix); - device_driver_thread_pri_set(driver, pri); - device_driver_devsw_put(driver, desc->sdd_bdevsw, desc->sdd_cdevsw); - } -#endif - FIXME("device_driver_init"); -} - -/* -** Hash a prefix string into a hash table chain. -*/ -static int -driver_prefix_hash(char *prefix) -{ -#ifdef LATER - int accum = 0; - char nextchar; - - while (nextchar = *prefix++) - accum = accum ^ nextchar; - - return(accum % DEVICE_DRIVER_HASH_SIZE); -#else - FIXME("driver_prefix_hash"); - return(0); -#endif -} - - -/* -** Allocate a driver handle. -** Returns the driver handle, or NULL if the driver prefix -** already has a handle. -** -** Upper layers prevent races among device_driver_alloc, -** device_driver_free, and device_driver_get*. -*/ -device_driver_t -device_driver_alloc(char *prefix) -{ -#ifdef LATER - int which_hash; - device_driver_t new_driver; - unsigned long s; - - which_hash = driver_prefix_hash(prefix); - - new_driver = kern_calloc(1, sizeof(*new_driver)); - ASSERT(new_driver != NULL); - new_driver->dd_prev = NULL; - new_driver->dd_prefix = string_table_insert(&driver_prefix_string_table, prefix); - new_driver->dd_bdevsw = NULL; - new_driver->dd_cdevsw = NULL; - - dev_admin_registry_init(&new_driver->dd_dev_admin_registry); - device_driver_admin_info_update(new_driver); - - s = mutex_spinlock(&device_driver_lock[which_hash]); - -#if DEBUG - { - device_driver_t drvscan; - - /* Make sure we haven't already added a driver with this prefix */ - drvscan = device_driver_hash[which_hash]; - while (drvscan && - strcmp(drvscan->dd_prefix, prefix)) { - drvscan = drvscan->dd_next; - } - - ASSERT(!drvscan); - } -#endif /* DEBUG */ - - - /* Add new_driver to front of hash chain. */ - new_driver->dd_next = device_driver_hash[which_hash]; - if (new_driver->dd_next) - new_driver->dd_next->dd_prev = new_driver; - device_driver_hash[which_hash] = new_driver; - - mutex_spinunlock(&device_driver_lock[which_hash], s); - - return(new_driver); -#else - FIXME("device_driver_alloc"); - return((device_driver_t)0); -#endif -} - -/* -** Free a driver handle. -** -** Statically loaded drivers should never device_driver_free. -** Dynamically loaded drivers device_driver_free when either an -** unloaded driver is unregistered, or when an unregistered driver -** is unloaded. -*/ -void -device_driver_free(device_driver_t driver) -{ -#ifdef LATER - int which_hash; - unsigned long s; - - if (!driver) - return; - - which_hash = driver_prefix_hash(driver->dd_prefix); - - s = mutex_spinlock(&device_driver_lock[which_hash]); - -#if DEBUG - { - device_driver_t drvscan; - - /* Make sure we're dealing with the right list */ - drvscan = device_driver_hash[which_hash]; - while (drvscan && (drvscan != driver)) - drvscan = drvscan->dd_next; - - ASSERT(drvscan); - } -#endif /* DEBUG */ - - if (driver->dd_next) - driver->dd_next->dd_prev = driver->dd_prev; - - if (driver->dd_prev) - driver->dd_prev->dd_next = driver->dd_next; - else - device_driver_hash[which_hash] = driver->dd_next; - - mutex_spinunlock(&device_driver_lock[which_hash], s); - - driver->dd_next = NULL; /* sanity */ - driver->dd_prev = NULL; /* sanity */ - driver->dd_prefix = NULL; /* sanity */ - - if (driver->dd_bdevsw) { - driver->dd_bdevsw->d_driver = NULL; - driver->dd_bdevsw = NULL; - } - - if (driver->dd_cdevsw) { - if (driver->dd_cdevsw->d_str) { - str_free_mux_node(driver); - } - driver->dd_cdevsw->d_driver = NULL; - driver->dd_cdevsw = NULL; - } - - kern_free(driver); -#endif - FIXME("device_driver_free"); -} - - -/* -** Given a device driver prefix, return a handle to the caller. -*/ -device_driver_t -device_driver_get(char *prefix) -{ -#ifdef LATER - int which_hash; - device_driver_t drvscan; - unsigned long s; - - if (prefix == NULL) - return(NULL); - - which_hash = driver_prefix_hash(prefix); - - s = mutex_spinlock(&device_driver_lock[which_hash]); - - drvscan = device_driver_hash[which_hash]; - while (drvscan && strcmp(drvscan->dd_prefix, prefix)) - drvscan = drvscan->dd_next; - - mutex_spinunlock(&device_driver_lock[which_hash], s); - - return(drvscan); -#else - FIXME("device_driver_get"); - return((device_driver_t)0); -#endif -} - - -/* -** Given a block or char special file devfs_handle_t, find the -** device driver that controls it. -*/ -device_driver_t -device_driver_getbydev(devfs_handle_t device) -{ -#ifdef LATER - struct bdevsw *my_bdevsw; - struct cdevsw *my_cdevsw; - - my_cdevsw = get_cdevsw(device); - if (my_cdevsw != NULL) - return(my_cdevsw->d_driver); - - my_bdevsw = get_bdevsw(device); - if (my_bdevsw != NULL) - return(my_bdevsw->d_driver); - -#endif - FIXME("device_driver_getbydev"); - return((device_driver_t)0); -} - - -/* -** Associate a driver with bdevsw/cdevsw pointers. -** -** Statically loaded drivers are permanently and automatically associated -** with the proper bdevsw/cdevsw. Dynamically loaded drivers associate -** themselves when the driver is registered, and disassociate when the -** driver unregisters. -** -** Returns 0 on success, -1 on failure (devsw already associated with driver) -*/ -int -device_driver_devsw_put(device_driver_t driver, - struct bdevsw *my_bdevsw, - struct cdevsw *my_cdevsw) -{ -#ifdef LATER - int i; - - if (!driver) - return(-1); - - /* Trying to re-register data? */ - if (((my_bdevsw != NULL) && (driver->dd_bdevsw != NULL)) || - ((my_cdevsw != NULL) && (driver->dd_cdevsw != NULL))) - return(-1); - - if (my_bdevsw != NULL) { - driver->dd_bdevsw = my_bdevsw; - my_bdevsw->d_driver = driver; - for (i = 0; i < bdevmax; i++) { - if (driver->dd_bdevsw->d_flags == bdevsw[i].d_flags) { - bdevsw[i].d_driver = driver; - break; - } - } - } - - if (my_cdevsw != NULL) { - driver->dd_cdevsw = my_cdevsw; - my_cdevsw->d_driver = driver; - for (i = 0; i < cdevmax; i++) { - if (driver->dd_cdevsw->d_flags == cdevsw[i].d_flags) { - cdevsw[i].d_driver = driver; - break; - } - } - } -#endif - FIXME("device_driver_devsw_put"); - return(0); -} - - -/* -** Given a driver, return the corresponding bdevsw and cdevsw pointers. -*/ -void -device_driver_devsw_get( device_driver_t driver, - struct bdevsw **bdevswp, - struct cdevsw **cdevswp) -{ - if (!driver) { - *bdevswp = NULL; - *cdevswp = NULL; - } else { - *bdevswp = driver->dd_bdevsw; - *cdevswp = driver->dd_cdevsw; - } -} - -/* - * device_driver_thread_pri_set - * Given a driver try to set its thread priority. - * Returns 0 on success , -1 on failure. - */ -int -device_driver_thread_pri_set(device_driver_t driver,ilvl_t pri) -{ - if (!driver) - return(-1); - driver->dd_thread_pri = pri; - return(0); -} -/* - * device_driver_thread_pri_get - * Given a driver return the driver thread priority. - * If the driver is NULL return invalid driver thread - * priority. - */ -ilvl_t -device_driver_thread_pri_get(device_driver_t driver) -{ - if (driver) - return(driver->dd_thread_pri); - else - return(DRIVER_THREAD_PRI_INVALID); -} -/* -** Given a device driver, return it's handle (prefix). -*/ -void -device_driver_name_get(device_driver_t driver, char *buffer, int length) -{ - if (driver == NULL) - return; - - strncpy(buffer, driver->dd_prefix, length); -} - - -/* -** Associate a pointer-sized piece of information with a device. -*/ -void -device_info_set(devfs_handle_t device, void *info) -{ -#ifdef LATER - hwgraph_fastinfo_set(device, (arbitrary_info_t)info); -#endif - FIXME("device_info_set"); -} - - -/* -** Retrieve a pointer-sized piece of information associated with a device. -*/ -void * -device_info_get(devfs_handle_t device) -{ -#ifdef LATER - return((void *)hwgraph_fastinfo_get(device)); -#else - FIXME("device_info_get"); - return(NULL); -#endif -} - -/* - * Find the thread priority for a device, from the various - * sysgen files. - */ -int -device_driver_sysgen_thread_pri_get(char *dev_prefix) -{ -#ifdef LATER - int pri; - char *pri_s; - char *class; - - extern default_intr_pri; - extern disk_intr_pri; - extern serial_intr_pri; - extern parallel_intr_pri; - extern tape_intr_pri; - extern graphics_intr_pri; - extern network_intr_pri; - extern scsi_intr_pri; - extern audio_intr_pri; - extern video_intr_pri; - extern external_intr_pri; - extern tserialio_intr_pri; - - /* Check if there is a thread priority specified for - * this driver's thread thru admin hints. If so - * use that value. Otherwise set it to its default - * class value, otherwise set it to the default - * value. - */ - - if (pri_s = device_driver_admin_info_get(dev_prefix, - ADMIN_LBL_THREAD_PRI)) { - pri = atoi(pri_s); - } else if (class = device_driver_admin_info_get(dev_prefix, - ADMIN_LBL_THREAD_CLASS)) { - if (strcmp(class, "disk") == 0) - pri = disk_intr_pri; - else if (strcmp(class, "serial") == 0) - pri = serial_intr_pri; - else if (strcmp(class, "parallel") == 0) - pri = parallel_intr_pri; - else if (strcmp(class, "tape") == 0) - pri = tape_intr_pri; - else if (strcmp(class, "graphics") == 0) - pri = graphics_intr_pri; - else if (strcmp(class, "network") == 0) - pri = network_intr_pri; - else if (strcmp(class, "scsi") == 0) - pri = scsi_intr_pri; - else if (strcmp(class, "audio") == 0) - pri = audio_intr_pri; - else if (strcmp(class, "video") == 0) - pri = video_intr_pri; - else if (strcmp(class, "external") == 0) - pri = external_intr_pri; - else if (strcmp(class, "tserialio") == 0) - pri = tserialio_intr_pri; - else - pri = default_intr_pri; - } else - pri = default_intr_pri; - - if (pri > 255) - pri = 255; - else if (pri < 0) - pri = 0; - return pri; -#else - FIXME("device_driver_sysgen_thread_pri_get"); - return(-1); -#endif -} diff -urN linux-2.4.18/arch/ia64/sn/io/eeprom.c lia64-2.4/arch/ia64/sn/io/eeprom.c --- linux-2.4.18/arch/ia64/sn/io/eeprom.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/eeprom.c Tue Feb 26 13:19:34 2002 @@ -1,14 +1,11 @@ /* - * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Jack Steiner (steiner@sgi.com) + * Copyright (C) 1999-2002 Silicon Graphics, Inc. All rights reserved. */ - /* * WARNING: There is more than one copy of this file in different isms. * All copies must be kept exactly in sync. @@ -28,37 +25,24 @@ * */ -/************************************************************************** - * * - * Copyright (C) 1999 Silicon Graphics, Inc. * - * * - * These coded instructions, statements, and computer programs contain * - * unpublished proprietary information of Silicon Graphics, Inc., and * - * are protected by Federal copyright law. They may not be disclosed * - * to third parties or copied or duplicated in any form, in whole or * - * in part, without the prior written consent of Silicon Graphics, Inc. * - * * - ************************************************************************** - */ - - #include #include #include #include +#include #include #include #include #include #include #include -#include -/* #include */ #include #include #include #include #include +#include +#include #if defined(EEPROM_DEBUG) #define db_printf(x) printk x @@ -384,9 +368,6 @@ int cbrick_uid_get( nasid_t nasid, uint64_t *uid ) { -#if !defined(CONFIG_SERIAL_SGI_L1_PROTOCOL) - return EEP_L1; -#else char uid_str[32]; char msg[BRL1_QSIZE]; int subch, len; @@ -421,7 +402,7 @@ } else { scp = ≻ - sc_init( &sc, nasid, BRL1_LOCALUART ); + sc_init( &sc, nasid, BRL1_LOCALHUB_UART ); } /* fill in msg with the opcode & params */ @@ -455,15 +436,11 @@ *uid = generate_unique_id( uid_str, strlen( uid_str ) ); return EEP_OK; -#endif /* CONFIG_SERIAL_SGI_L1_PROTOCOL */ } int rbrick_uid_get( nasid_t nasid, net_vec_t path, uint64_t *uid ) { -#if !defined(CONFIG_SERIAL_SGI_L1_PROTOCOL) - return EEP_L1; -#else char uid_str[32]; char msg[BRL1_QSIZE]; int subch, len; @@ -472,14 +449,12 @@ if ( IS_RUNNING_ON_SIMULATOR() ) return EEP_L1; -#ifdef BRINGUP #define FAIL \ { \ *uid = rtc_time(); \ printk( "rbrick_uid_get failed; using current time as uid\n" ); \ return EEP_OK; \ } -#endif /* BRINGUP */ ROUTER_LOCK(path); sc_init( &sc, nasid, path ); @@ -520,7 +495,6 @@ *uid = generate_unique_id( uid_str, strlen( uid_str ) ); return EEP_OK; -#endif /* CONFIG_SERIAL_SGI_L1_PROTOCOL */ } int iobrick_uid_get( nasid_t nasid, uint64_t *uid ) @@ -593,12 +567,10 @@ extern char *nic_vertex_info_get( devfs_handle_t ); extern void nic_vmc_check( devfs_handle_t, char * ); -#ifdef BRINGUP /* the following were lifted from nic.c - change later? */ #define MAX_INFO 2048 #define NEWSZ(ptr,sz) ((ptr) = kern_malloc((sz))) #define DEL(ptr) (kern_free((ptr))) -#endif /* BRINGUP */ char *eeprom_vertex_info_set( int component, int nasid, devfs_handle_t v, net_vec_t path ) @@ -884,9 +856,6 @@ int read_ia( l1sc_t *sc, int subch, int l1_compt, int ia_code, char *eep_record ) { -#if !defined(CONFIG_SERIAL_SGI_L1_PROTOCOL) - return EEP_L1; -#else char msg[BRL1_QSIZE]; /* message buffer */ int len; /* number of bytes used in message buffer */ int ia_len = EEPROM_CHUNKSIZE; /* remaining bytes in info area */ @@ -936,16 +905,12 @@ } return EEP_OK; -#endif /* CONFIG_SERIAL_SGI_L1_PROTOCOL */ } int read_spd( l1sc_t *sc, int subch, int l1_compt, eeprom_spd_u *spd ) { -#if !defined(CONFIG_SERIAL_SGI_L1_PROTOCOL) - return EEP_L1; -#else char msg[BRL1_QSIZE]; /* message buffer */ int len; /* number of bytes used in message buffer */ int resp; /* l1 response code */ @@ -1010,7 +975,6 @@ offset += EEPROM_CHUNKSIZE; } return EEP_OK; -#endif /* CONFIG_SERIAL_SGI_L1_PROTOCOL */ } @@ -1068,7 +1032,7 @@ if( (checksum & 0xff) != 0 ) { db_printf(( "read_chassis_ia: bad checksum\n" )); - db_printf(( "read_chassis_ia: target 0x%x uart 0x%x\n", + db_printf(( "read_chassis_ia: target 0x%x uart 0x%lx\n", sc->subch[subch].target, sc->uart )); return EEP_BAD_CHECKSUM; } @@ -1199,7 +1163,7 @@ if( (checksum & 0xff) != 0 ) { db_printf(( "read_board_ia: bad checksum\n" )); - db_printf(( "read_board_ia: target 0x%x uart 0x%x\n", + db_printf(( "read_board_ia: target 0x%x uart 0x%lx\n", sc->subch[subch].target, sc->uart )); return EEP_BAD_CHECKSUM; } @@ -1211,9 +1175,6 @@ int _cbrick_eeprom_read( eeprom_brd_record_t *buf, l1sc_t *scp, int component ) { -#if !defined(CONFIG_SERIAL_SGI_L1_PROTOCOL) - return EEP_L1; -#else int r; uint64_t uid = 0; #ifdef LOG_GETENV @@ -1290,16 +1251,12 @@ return fake_an_eeprom_record( buf, component, uid ); } return EEP_OK; -#endif /* CONFIG_SERIAL_SGI_L1_PROTOCOL */ } int cbrick_eeprom_read( eeprom_brd_record_t *buf, nasid_t nasid, int component ) { -#if !defined(CONFIG_SERIAL_SGI_L1_PROTOCOL) - return EEP_L1; -#else l1sc_t *scp; int local = (nasid == get_nasid()); @@ -1318,16 +1275,12 @@ } return _cbrick_eeprom_read( buf, scp, component ); -#endif /* CONFIG_SERIAL_SGI_L1_PROTOCOL */ } int iobrick_eeprom_read( eeprom_brd_record_t *buf, nasid_t nasid, int component ) { -#if !defined(CONFIG_SERIAL_SGI_L1_PROTOCOL) - return EEP_L1; -#else int r; int l1_compt, subch; l1sc_t *scp; @@ -1391,16 +1344,12 @@ return r; } return EEP_OK; -#endif /* CONFIG_SERIAL_SGI_L1_PROTOCOL */ } int vector_eeprom_read( eeprom_brd_record_t *buf, nasid_t nasid, net_vec_t path, int component ) { -#if !defined(CONFIG_SERIAL_SGI_L1_PROTOCOL) - return EEP_L1; -#else int r; uint64_t uid = 0; int l1_compt, subch; @@ -1470,5 +1419,4 @@ /* unsupported brick type */ return EEP_PARAM; } -#endif /* CONFIG_SERIAL_SGI_L1_PROTOCOL */ } diff -urN linux-2.4.18/arch/ia64/sn/io/efi-rtc.c lia64-2.4/arch/ia64/sn/io/efi-rtc.c --- linux-2.4.18/arch/ia64/sn/io/efi-rtc.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/efi-rtc.c Mon Nov 19 23:22:50 2001 @@ -0,0 +1,185 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001 Silicon Graphics, Inc. + * Copyright (C) 2001 by Ralf Baechle + */ +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * No locking necessary when this is called from efirtc which protects us + * from racing by efi_rtc_lock. + */ +#define __swizzle(addr) ((u8 *)((unsigned long)(addr) ^ 3)) +#define read_io_port(addr) (*(volatile u8 *) __swizzle(addr)) +#define write_io_port(addr, data) (*(volatile u8 *) __swizzle(addr) = (data)) + +#define TOD_SGS_M48T35 1 +#define TOD_DALLAS_DS1386 2 + +static unsigned long nvram_base = 0; +static int tod_chip_type; + +static int +get_tod_chip_type(void) +{ + unsigned char testval; + + write_io_port(RTC_DAL_CONTROL_ADDR, RTC_DAL_UPDATE_DISABLE); + write_io_port(RTC_DAL_DAY_ADDR, 0xff); + write_io_port(RTC_DAL_CONTROL_ADDR, RTC_DAL_UPDATE_ENABLE); + + testval = read_io_port(RTC_DAL_DAY_ADDR); + if (testval == 0xff) + return TOD_SGS_M48T35; + + return TOD_DALLAS_DS1386; +} + +efi_status_t +ioc3_get_time(efi_time_t *time, efi_time_cap_t *caps) +{ + if (!nvram_base) { + printk(KERN_CRIT "nvram_base is zero\n"); + return EFI_UNSUPPORTED; + } + + memset(time, 0, sizeof(*time)); + + switch (tod_chip_type) { + case TOD_SGS_M48T35: + write_io_port(RTC_SGS_CONTROL_ADDR, RTC_SGS_READ_PROTECT); + + time->year = BCD_TO_INT(read_io_port(RTC_SGS_YEAR_ADDR)) + YRREF; + time->month = BCD_TO_INT(read_io_port(RTC_SGS_MONTH_ADDR)); + time->day = BCD_TO_INT(read_io_port(RTC_SGS_DATE_ADDR)); + time->hour = BCD_TO_INT(read_io_port(RTC_SGS_HOUR_ADDR)); + time->minute = BCD_TO_INT(read_io_port(RTC_SGS_MIN_ADDR)); + time->second = BCD_TO_INT(read_io_port(RTC_SGS_SEC_ADDR)); + time->nanosecond = 0; + + write_io_port(RTC_SGS_CONTROL_ADDR, 0); + break; + + case TOD_DALLAS_DS1386: + write_io_port(RTC_DAL_CONTROL_ADDR, RTC_DAL_UPDATE_DISABLE); + + time->nanosecond = 0; + time->second = BCD_TO_INT(read_io_port(RTC_DAL_SEC_ADDR)); + time->minute = BCD_TO_INT(read_io_port(RTC_DAL_MIN_ADDR)); + time->hour = BCD_TO_INT(read_io_port(RTC_DAL_HOUR_ADDR)); + time->day = BCD_TO_INT(read_io_port(RTC_DAL_DATE_ADDR)); + time->month = BCD_TO_INT(read_io_port(RTC_DAL_MONTH_ADDR)); + time->year = BCD_TO_INT(read_io_port(RTC_DAL_YEAR_ADDR)) + YRREF; + + write_io_port(RTC_DAL_CONTROL_ADDR, RTC_DAL_UPDATE_ENABLE); + break; + + default: + break; + } + + if (caps) { + caps->resolution = 50000000; /* 50PPM */ + caps->accuracy = 1000; /* 1ms */ + caps->sets_to_zero = 0; + } + + return EFI_SUCCESS; +} + +static efi_status_t ioc3_set_time (efi_time_t *t) +{ + if (!nvram_base) { + printk(KERN_CRIT "nvram_base is zero\n"); + return EFI_UNSUPPORTED; + } + + switch (tod_chip_type) { + case TOD_SGS_M48T35: + write_io_port(RTC_SGS_CONTROL_ADDR, RTC_SGS_WRITE_ENABLE); + write_io_port(RTC_SGS_YEAR_ADDR, INT_TO_BCD((t->year - YRREF))); + write_io_port(RTC_SGS_MONTH_ADDR,INT_TO_BCD(t->month)); + write_io_port(RTC_SGS_DATE_ADDR, INT_TO_BCD(t->day)); + write_io_port(RTC_SGS_HOUR_ADDR, INT_TO_BCD(t->hour)); + write_io_port(RTC_SGS_MIN_ADDR, INT_TO_BCD(t->minute)); + write_io_port(RTC_SGS_SEC_ADDR, INT_TO_BCD(t->second)); + write_io_port(RTC_SGS_CONTROL_ADDR, 0); + break; + + case TOD_DALLAS_DS1386: + write_io_port(RTC_DAL_CONTROL_ADDR, RTC_DAL_UPDATE_DISABLE); + write_io_port(RTC_DAL_SEC_ADDR, INT_TO_BCD(t->second)); + write_io_port(RTC_DAL_MIN_ADDR, INT_TO_BCD(t->minute)); + write_io_port(RTC_DAL_HOUR_ADDR, INT_TO_BCD(t->hour)); + write_io_port(RTC_DAL_DATE_ADDR, INT_TO_BCD(t->day)); + write_io_port(RTC_DAL_MONTH_ADDR,INT_TO_BCD(t->month)); + write_io_port(RTC_DAL_YEAR_ADDR, INT_TO_BCD((t->year - YRREF))); + write_io_port(RTC_DAL_CONTROL_ADDR, RTC_DAL_UPDATE_ENABLE); + break; + + default: + break; + } + + return EFI_SUCCESS; +} + +/* The following two are not supported atm. */ +static efi_status_t +ioc3_get_wakeup_time (efi_bool_t *enabled, efi_bool_t *pending, efi_time_t *tm) +{ + return EFI_UNSUPPORTED; +} + +static efi_status_t +ioc3_set_wakeup_time (efi_bool_t enabled, efi_time_t *tm) +{ + return EFI_UNSUPPORTED; +} + +/* + * It looks like the master IOC3 is usually on bus 0, device 4. Hope + * that's right + */ +static __init int efi_ioc3_time_init(void) +{ + struct pci_dev *dev; + static struct ioc3 *ioc3; + + dev = pci_find_slot(0, PCI_DEVFN(4, 0)); + if (!dev) { + printk(KERN_CRIT "Couldn't find master IOC3\n"); + + return -ENODEV; + } + + ioc3 = ioremap(pci_resource_start(dev, 0), pci_resource_len(dev, 0)); + nvram_base = (unsigned long) ioc3 + IOC3_BYTEBUS_DEV0; + + tod_chip_type = get_tod_chip_type(); + if (tod_chip_type == 1) + printk(KERN_NOTICE "TOD type is SGS M48T35\n"); + else if (tod_chip_type == 2) + printk(KERN_NOTICE "TOD type is Dallas DS1386\n"); + else + printk(KERN_CRIT "No or unknown TOD\n"); + + efi.get_time = ioc3_get_time; + efi.set_time = ioc3_set_time; + efi.get_wakeup_time = ioc3_get_wakeup_time; + efi.set_wakeup_time = ioc3_set_wakeup_time; + + return 0; +} + +module_init(efi_ioc3_time_init); diff -urN linux-2.4.18/arch/ia64/sn/io/hcl.c lia64-2.4/arch/ia64/sn/io/hcl.c --- linux-2.4.18/arch/ia64/sn/io/hcl.c Wed Dec 26 16:58:36 2001 +++ lia64-2.4/arch/ia64/sn/io/hcl.c Wed Dec 26 16:53:32 2001 @@ -6,8 +6,7 @@ * * hcl - SGI's Hardware Graph compatibility layer. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ #include @@ -49,7 +48,6 @@ /* * Some Global definitions. */ -spinlock_t hcl_spinlock; devfs_handle_t hcl_handle = NULL; invplace_t invplace_none = { @@ -142,6 +140,7 @@ { extern void string_table_init(struct string_table *); extern struct string_table label_string_table; + extern int init_ifconfig_net(void); int rv = 0; #if defined(CONFIG_HCL_DEBUG) && !defined(MODULE) @@ -153,8 +152,6 @@ printk ("\n%s: boot_options: 0x%0x\n", HCL_NAME, boot_options); #endif - spin_lock_init(&hcl_spinlock); - /* * Create the hwgraph_root on devfs. */ @@ -192,6 +189,12 @@ return(0); } + /* + * Initialize the ifconfgi_net driver that does network devices + * Persistent Naming. + */ + init_ifconfig_net(); + return(0); } @@ -238,8 +241,7 @@ { if (hcl_debug) { - printk("HCL: hwgraph_fastinfo_set handle 0x%p fastinfo %ld\n", - de, fastinfo); + printk("HCL: hwgraph_fastinfo_set handle 0x%p fastinfo %ld\n", (void *)de, fastinfo); } labelcl_info_replace_IDX(de, HWGRAPH_FASTINFO, fastinfo, NULL); @@ -466,7 +468,7 @@ * We need to clean up! */ printk(KERN_WARNING "HCL: Unable to set the connect point to it's parent 0x%p\n", - new_devfs_handle); + (void *)new_devfs_handle); } /* @@ -1044,30 +1046,6 @@ } /* - * hwgraph_cdevsw_get - returns the fops of the given devfs entry. - */ -struct file_operations * -hwgraph_cdevsw_get(devfs_handle_t de) -{ - struct file_operations *fops = devfs_get_ops(de); - - devfs_put_ops(de); /* FIXME: this may need to be moved to callers */ - return(fops); -} - -/* - * hwgraph_bdevsw_get - returns the fops of the given devfs entry. -*/ -struct file_operations * /* FIXME: shouldn't this be a blkdev? */ -hwgraph_bdevsw_get(devfs_handle_t de) -{ - struct file_operations *fops = devfs_get_ops(de); - - devfs_put_ops(de); /* FIXME: this may need to be moved to callers */ - return(fops); -} - -/* ** Inventory is now associated with a vertex in the graph. For items that ** belong in the inventory but have no vertex ** (e.g. old non-graph-aware drivers), we create a bogus vertex under the @@ -1550,6 +1528,4 @@ EXPORT_SYMBOL(hwgraph_path_to_dev); EXPORT_SYMBOL(hwgraph_block_device_get); EXPORT_SYMBOL(hwgraph_char_device_get); -EXPORT_SYMBOL(hwgraph_cdevsw_get); -EXPORT_SYMBOL(hwgraph_bdevsw_get); EXPORT_SYMBOL(hwgraph_vertex_name_get); diff -urN linux-2.4.18/arch/ia64/sn/io/hcl_util.c lia64-2.4/arch/ia64/sn/io/hcl_util.c --- linux-2.4.18/arch/ia64/sn/io/hcl_util.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/hcl_util.c Mon Nov 19 23:22:50 2001 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ #include @@ -14,6 +13,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.4.18/arch/ia64/sn/io/hubdev.c lia64-2.4/arch/ia64/sn/io/hubdev.c --- linux-2.4.18/arch/ia64/sn/io/hubdev.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/hubdev.c Mon Nov 19 23:22:50 2001 @@ -4,13 +4,14 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ +#include #include #include #include +#include #include #include #include @@ -42,7 +43,7 @@ ASSERT(attach_method); - callout = (hubdev_callout_t *)kmem_zalloc(sizeof(hubdev_callout_t), KM_SLEEP); + callout = (hubdev_callout_t *)snia_kmem_zalloc(sizeof(hubdev_callout_t), KM_SLEEP); ASSERT(callout); mutex_lock(&hubdev_callout_mutex); @@ -104,6 +105,9 @@ * Given a hub vertex, return the base address of the Hspec space * for that hub. */ + +#if defined(CONFIG_IA64_SGI_SN1) + caddr_t hubdev_prombase_get(devfs_handle_t hub) { @@ -124,3 +128,5 @@ return hinfo->h_cnodeid; } + +#endif /* CONFIG_IA64_SGI_SN1 */ diff -urN linux-2.4.18/arch/ia64/sn/io/huberror.c lia64-2.4/arch/ia64/sn/io/huberror.c --- linux-2.4.18/arch/ia64/sn/io/huberror.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/huberror.c Wed Dec 31 16:00:00 1969 @@ -1,475 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Alan Mayer - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -extern void hubni_eint_init(cnodeid_t cnode); -extern void hubii_eint_init(cnodeid_t cnode); -extern void hubii_eint_handler (int irq, void *arg, struct pt_regs *ep); -extern void snia_error_intr_handler(int irq, void *devid, struct pt_regs *pt_regs); - -extern int maxcpus; - -#define HUB_ERROR_PERIOD (120 * HZ) /* 2 minutes */ - - -void -hub_error_clear(nasid_t nasid) -{ - int i; - hubreg_t idsr; - int sn; - - for(sn=0; snel_spool_cur_addr[0] = - SN0_ERROR_LOG(cnode)->el_spool_last_addr[0] = - REMOTE_HUB_PI_L(nasid, sn, PI_ERR_STACK_ADDR_A); - } - - if (REMOTE_HUB_PI_L(nasid, sn, PI_CPU_PRESENT_B)) { - SN0_ERROR_LOG(cnode)->el_spool_cur_addr[1] = - SN0_ERROR_LOG(cnode)->el_spool_last_addr[1] = - REMOTE_HUB_PI_L(nasid, sn, PI_ERR_STACK_ADDR_B); - } - } - - - PI_SPOOL_SIZE_BYTES = - ERR_STACK_SIZE_BYTES(REMOTE_HUB_L(nasid, PI_ERR_STACK_SIZE)); - -#ifdef BRINGUP -/* BRINGUP: The following code looks like a check to make sure -the prom set up the error spool correctly for 2 processors. I -don't think it is needed. */ - for(sn=0; snel_spool_cur_addr[1] = - SN0_ERROR_LOG(cnode)->el_spool_last_addr[1] = - REMOTE_HUB_PI_L(nasid, sn, PI_ERR_STACK_ADDR_B); - - } - } - } -#endif /* BRINGUP */ - - /* programming our own hub. Enable error_int_pend intr. - * If both present, CPU A takes CPU b's error interrupts and any - * generic ones. CPU B takes CPU A error ints. - */ - if (cause_intr_connect (SRB_ERR_IDX, - (intr_func_t)(hubpi_eint_handler), - SR_ALL_MASK|SR_IE)) { - cmn_err(ERR_WARN, - "hub_error_init: cause_intr_connect failed on %d", cnode); - } - } - else { - /* programming remote hub. The only valid reason that this - * is called will be on headless hubs. No interrupts - */ - for(sn=0; snhuberror_ticks = HUB_ERROR_PERIOD; - return; -} - -/* - * Function : hubii_eint_init - * Parameters : cnode - * Purpose : to initialize the hub iio error interrupt. - * Assumptions : Called once per hub, by the cpu which will ultimately - * handle this interrupt. - * Returns : None. - */ - - -void -hubii_eint_init(cnodeid_t cnode) -{ - int bit, rv; - ii_iidsr_u_t hubio_eint; - hubinfo_t hinfo; - cpuid_t intr_cpu; - devfs_handle_t hub_v; - ii_ilcsr_u_t ilcsr; - - hub_v = (devfs_handle_t)cnodeid_to_vertex(cnode); - ASSERT_ALWAYS(hub_v); - hubinfo_get(hub_v, &hinfo); - - ASSERT(hinfo); - ASSERT(hinfo->h_cnodeid == cnode); - - ilcsr.ii_ilcsr_regval = REMOTE_HUB_L(hinfo->h_nasid, IIO_ILCSR); - - if ((ilcsr.ii_ilcsr_fld_s.i_llp_stat & 0x2) == 0) { - /* - * HUB II link is not up. - * Just disable LLP, and don't connect any interrupts. - */ - ilcsr.ii_ilcsr_fld_s.i_llp_en = 0; - REMOTE_HUB_S(hinfo->h_nasid, IIO_ILCSR, ilcsr.ii_ilcsr_regval); - return; - } - /* Select a possible interrupt target where there is a free interrupt - * bit and also reserve the interrupt bit for this IO error interrupt - */ - intr_cpu = intr_heuristic(hub_v,0,INTRCONNECT_ANYBIT,II_ERRORINT,hub_v, - "HUB IO error interrupt",&bit); - if (intr_cpu == CPU_NONE) { - printk("hubii_eint_init: intr_reserve_level failed, cnode %d", cnode); - return; - } - - rv = intr_connect_level(intr_cpu, bit, 0,(intr_func_t)(NULL), - (void *)(long)hub_v, NULL); - synergy_intr_connect(bit, intr_cpu); - request_irq(bit_pos_to_irq(bit) + (intr_cpu << 8), hubii_eint_handler, 0, NULL, (void *)hub_v); - ASSERT_ALWAYS(rv >= 0); - hubio_eint.ii_iidsr_regval = 0; - hubio_eint.ii_iidsr_fld_s.i_enable = 1; - hubio_eint.ii_iidsr_fld_s.i_level = bit;/* Take the least significant bits*/ - hubio_eint.ii_iidsr_fld_s.i_node = COMPACT_TO_NASID_NODEID(cnode); - hubio_eint.ii_iidsr_fld_s.i_pi_id = cpuid_to_subnode(intr_cpu); - REMOTE_HUB_S(hinfo->h_nasid, IIO_IIDSR, hubio_eint.ii_iidsr_regval); - -} - -void -hubni_eint_init(cnodeid_t cnode) -{ - int intr_bit; - cpuid_t targ; - - - if ((targ = cnodeid_to_cpuid(cnode)) == CPU_NONE) - return; - - /* The prom chooses which cpu gets these interrupts, but we - * don't know which one it chose. We will register all of the - * cpus to be sure. This only costs us an irqaction per cpu. - */ - for (; targ < CPUS_PER_NODE; targ++) { - if (!cpu_enabled(targ) ) continue; - /* connect the INTEND1 bits. */ - for (intr_bit = XB_ERROR; intr_bit <= MSC_PANIC_INTR; intr_bit++) { - intr_connect_level(targ, intr_bit, II_ERRORINT, NULL, NULL, NULL); - } - request_irq(SGI_HUB_ERROR_IRQ + (targ << 8), snia_error_intr_handler, 0, NULL, NULL); - /* synergy masks are initialized in the prom to enable all interrupts. */ - /* We'll just leave them that way, here, for these interrupts. */ - } -} - - -/*ARGSUSED*/ -void -hubii_eint_handler (int irq, void *arg, struct pt_regs *ep) -{ - devfs_handle_t hub_v; - hubinfo_t hinfo; - ii_wstat_u_t wstat; - hubreg_t idsr; - - panic("Hubii interrupt\n"); -#ifdef ajm - /* - * If the NI has a problem, everyone has a problem. We shouldn't - * even attempt to handle other errors when an NI error is present. - */ - if (check_ni_errors()) { - hubni_error_handler("II interrupt", 1); - /* NOTREACHED */ - } - - /* two levels of casting avoids compiler warning.!! */ - hub_v = (devfs_handle_t)(long)(arg); - ASSERT(hub_v); - - hubinfo_get(hub_v, &hinfo); - - /* - * Identify the reason for error. - */ - wstat.ii_wstat_regval = REMOTE_HUB_L(hinfo->h_nasid, IIO_WSTAT); - - if (wstat.ii_wstat_fld_s.w_crazy) { - char *reason; - /* - * We can do a couple of things here. - * Look at the fields TX_MX_RTY/XT_TAIL_TO/XT_CRD_TO to check - * which of these caused the CRAZY bit to be set. - * You may be able to check if the Link is up really. - */ - if (wstat.ii_wstat_fld_s.w_tx_mx_rty) - reason = "Micro Packet Retry Timeout"; - else if (wstat.ii_wstat_fld_s.w_xt_tail_to) - reason = "Crosstalk Tail Timeout"; - else if (wstat.ii_wstat_fld_s.w_xt_crd_to) - reason = "Crosstalk Credit Timeout"; - else { - hubreg_t hubii_imem; - /* - * Check if widget 0 has been marked as shutdown, or - * if BTE 0/1 has been marked. - */ - hubii_imem = REMOTE_HUB_L(hinfo->h_nasid, IIO_IMEM); - if (hubii_imem & IIO_IMEM_W0ESD) - reason = "Hub Widget 0 has been Shutdown"; - else if (hubii_imem & IIO_IMEM_B0ESD) - reason = "BTE 0 has been shutdown"; - else if (hubii_imem & IIO_IMEM_B1ESD) - reason = "BTE 1 has been shutdown"; - else reason = "Unknown"; - - } - /* - * Note: we may never be able to print this, if the II talking - * to Xbow which hosts the console is dead. - */ - printk("Hub %d to Xtalk Link failed (II_ECRAZY) Reason: %s", - hinfo->h_cnodeid, reason); - } - - /* - * It's a toss as to which one among PRB/CRB to check first. - * Current decision is based on the severity of the errors. - * IO CRB errors tend to be more severe than PRB errors. - * - * It is possible for BTE errors to have been handled already, so we - * may not see any errors handled here. - */ - (void)hubiio_crb_error_handler(hub_v, hinfo); - (void)hubiio_prb_error_handler(hub_v, hinfo); - /* - * If we reach here, it indicates crb/prb handlers successfully - * handled the error. So, re-enable II to send more interrupt - * and return. - */ - REMOTE_HUB_S(hinfo->h_nasid, IIO_IECLR, 0xffffff); - idsr = REMOTE_HUB_L(hinfo->h_nasid, IIO_IIDSR) & ~IIO_IIDSR_SENT_MASK; - REMOTE_HUB_S(hinfo->h_nasid, IIO_IIDSR, idsr); -#endif /* ajm */ -} diff -urN linux-2.4.18/arch/ia64/sn/io/hubspc.c lia64-2.4/arch/ia64/sn/io/hubspc.c --- linux-2.4.18/arch/ia64/sn/io/hubspc.c Wed Dec 26 16:58:36 2001 +++ lia64-2.4/arch/ia64/sn/io/hubspc.c Tue Feb 26 13:19:34 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992-1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ /* @@ -19,6 +18,8 @@ #include #include #include +#include +#include #include #include #include @@ -26,18 +27,12 @@ #include #include #include -#include -#include +#include #include - - -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#include -#include +#include +#include #include -#endif - -#include +#include /* Uncomment the following line for tracing */ @@ -45,10 +40,6 @@ int hubspc_devflag = D_MP; -extern void *device_info_get(devfs_handle_t device); -extern void device_info_set(devfs_handle_t device, void *info); - - /***********************************************************************/ /* CPU Prom Space */ @@ -127,9 +118,8 @@ return 0; } -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) +#if defined(CONFIG_IA64_SGI_SN1) #define SN_PROMVERSION INV_IP35PROM -#endif /* Add "detailed" labelled inventory information to the * prom vertex @@ -159,7 +149,6 @@ cpuprom_inventory_info->im_rev = IP27CONFIG.pvers_rev; cpuprom_inventory_info->im_version = IP27CONFIG.pvers_vers; - /* Store this info as labelled information hanging off the * prom device vertex */ @@ -172,41 +161,17 @@ sizeof(invent_miscinfo_t)); } -int -cpuprom_attach(devfs_handle_t node) -{ - devfs_handle_t prom_dev; - - hwgraph_char_device_add(node, EDGE_LBL_PROM, "hubspc_", &prom_dev); -#ifdef HUBSPC_DEBUG - printf("hubspc: prom_attach hub: 0x%x prom: 0x%x\n", node, prom_dev); -#endif /* HUBSPC_DEBUG */ - device_inventory_add(prom_dev, INV_PROM, SN_PROMVERSION, - (major_t)0, (minor_t)0, 0); - - /* Add additional inventory info about the cpu prom like - * revision & version numbers etc. - */ - cpuprom_detailed_inventory_info_add(prom_dev,node); - device_info_set(prom_dev, (void*)(ulong)HUBSPC_PROM); - prominfo_add(node, prom_dev); - - return (0); -} - -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) #define FPROM_CONFIG_ADDR MD_JUNK_BUS_TIMING #define FPROM_ENABLE_MASK MJT_FPROM_ENABLE_MASK #define FPROM_ENABLE_SHFT MJT_FPROM_ENABLE_SHFT #define FPROM_SETUP_MASK MJT_FPROM_SETUP_MASK #define FPROM_SETUP_SHFT MJT_FPROM_SETUP_SHFT -#endif /*ARGSUSED*/ int cpuprom_map(devfs_handle_t dev, vhandl_t *vt, off_t addr, size_t len) { - int errcode; + int errcode = 0; caddr_t kvaddr; devfs_handle_t node; cnodeid_t cnode; @@ -220,7 +185,7 @@ kvaddr = hubdev_prombase_get(node); cnode = hubdev_cnodeid_get(node); #ifdef HUBSPC_DEBUG - printf("cpuprom_map: hubnode %d kvaddr 0x%x\n", node, kvaddr); + printk("cpuprom_map: hubnode %d kvaddr 0x%x\n", node, kvaddr); #endif if (len > RBOOT_SIZE) @@ -251,6 +216,7 @@ } return (errcode); } +#endif /* CONFIG_IA64_SGI_SN1 */ /*ARGSUSED*/ int @@ -263,8 +229,6 @@ /* Base Hub Space Driver */ /***********************************************************************/ -// extern int l1_attach( devfs_handle_t ); - /* * hubspc_init * Registration of the hubspc devices with the hub manager @@ -277,24 +241,19 @@ */ /* The reference counters */ +#if defined(CONFIG_IA64_SGI_SN1) hubdev_register(mem_refcnt_attach); +#endif - /* Prom space */ - hubdev_register(cpuprom_attach); - -#if defined(CONFIG_SERIAL_SGI_L1_PROTOCOL) /* L1 system controller link */ if ( !IS_RUNNING_ON_SIMULATOR() ) { /* initialize the L1 link */ - void l1_cons_init( l1sc_t *sc ); - elsc_t *get_elsc(void); - - l1_cons_init((l1sc_t *)get_elsc()); + extern void l1_init(void); + l1_init(); } -#endif #ifdef HUBSPC_DEBUG - printf("hubspc_init: Completed\n"); + printk("hubspc_init: Completed\n"); #endif /* HUBSPC_DEBUG */ /* Initialize spinlocks */ mutex_spinlock_init(&cpuprom_spinlock); @@ -304,26 +263,7 @@ int hubspc_open(devfs_handle_t *devp, mode_t oflag, int otyp, cred_t *crp) { - int errcode = 0; - - switch ((hubspc_subdevice_t)(ulong)device_info_get(*devp)) { - case HUBSPC_REFCOUNTERS: - errcode = mem_refcnt_open(devp, oflag, otyp, crp); - break; - - case HUBSPC_PROM: - break; - - default: - errcode = ENODEV; - } - -#ifdef HUBSPC_DEBUG - printf("hubspc_open: Completed open for type %d\n", - (hubspc_subdevice_t)(ulong)device_info_get(*devp)); -#endif /* HUBSPC_DEBUG */ - - return (errcode); + return (0); } @@ -331,25 +271,7 @@ int hubspc_close(devfs_handle_t dev, int oflag, int otyp, cred_t *crp) { - int errcode = 0; - - switch ((hubspc_subdevice_t)(ulong)device_info_get(dev)) { - case HUBSPC_REFCOUNTERS: - errcode = mem_refcnt_close(dev, oflag, otyp, crp); - break; - - case HUBSPC_PROM: - break; - default: - errcode = ENODEV; - } - -#ifdef HUBSPC_DEBUG - printf("hubspc_close: Completed close for type %d\n", - (hubspc_subdevice_t)(ulong)device_info_get(dev)); -#endif /* HUBSPC_DEBUG */ - - return (errcode); + return (0); } /* ARGSUSED */ @@ -357,7 +279,6 @@ hubspc_map(devfs_handle_t dev, vhandl_t *vt, off_t off, size_t len, uint prot) { /*REFERENCED*/ - hubspc_subdevice_t subdevice; int errcode = 0; /* check validity of request */ @@ -365,30 +286,6 @@ return ENXIO; } - subdevice = (hubspc_subdevice_t)(ulong)device_info_get(dev); - -#ifdef HUBSPC_DEBUG - printf("hubspc_map: subdevice: %d vaddr: 0x%x phyaddr: 0x%x len: 0x%x\n", - subdevice, v_getaddr(vt), off, len); -#endif /* HUBSPC_DEBUG */ - - switch ((hubspc_subdevice_t)(ulong)device_info_get(dev)) { - case HUBSPC_REFCOUNTERS: - errcode = mem_refcnt_mmap(dev, vt, off, len, prot); - break; - - case HUBSPC_PROM: - errcode = cpuprom_map(dev, vt, off, len); - break; - default: - errcode = ENODEV; - } - -#ifdef HUBSPC_DEBUG - printf("hubspc_map finished: spctype: %d vaddr: 0x%x len: 0x%x\n", - (hubspc_subdevice_t)(ulong)device_info_get(dev), v_getaddr(vt), len); -#endif /* HUBSPC_DEBUG */ - return errcode; } @@ -396,21 +293,7 @@ int hubspc_unmap(devfs_handle_t dev, vhandl_t *vt) { - int errcode = 0; - - switch ((hubspc_subdevice_t)(ulong)device_info_get(dev)) { - case HUBSPC_REFCOUNTERS: - errcode = mem_refcnt_unmap(dev, vt); - break; - - case HUBSPC_PROM: - errcode = cpuprom_unmap(dev, vt); - break; - - default: - errcode = ENODEV; - } - return errcode; + return (0); } @@ -423,19 +306,6 @@ cred_t *cred_p, int *rvalp) { - int errcode = 0; - - switch ((hubspc_subdevice_t)(ulong)device_info_get(dev)) { - case HUBSPC_REFCOUNTERS: - errcode = mem_refcnt_ioctl(dev, cmd, arg, mode, cred_p, rvalp); - break; - - case HUBSPC_PROM: - break; - - default: - errcode = ENODEV; - } - return errcode; + return (0); } diff -urN linux-2.4.18/arch/ia64/sn/io/ifconfig_net.c lia64-2.4/arch/ia64/sn/io/ifconfig_net.c --- linux-2.4.18/arch/ia64/sn/io/ifconfig_net.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/ifconfig_net.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,298 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * ifconfig_net - SGI's Persistent Network Device names. + * + * Copyright (C) 1992-1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SGI_IFCONFIG_NET "SGI-PERSISTENT NETWORK DEVICE NAME DRIVER" +#define SGI_IFCONFIG_NET_VERSION "1.0" + +/* + * Some Global definitions. + */ +devfs_handle_t ifconfig_net_handle = NULL; +unsigned long ifconfig_net_debug = 0; + +/* + * ifconfig_net_open - Opens the special device node "/devhw/.ifconfig_net". + */ +static int ifconfig_net_open(struct inode * inode, struct file * filp) +{ + if (ifconfig_net_debug) { + printk("ifconfig_net_open called.\n"); + } + + return(0); + +} + +/* + * ifconfig_net_close - Closes the special device node "/devhw/.ifconfig_net". + */ +static int ifconfig_net_close(struct inode * inode, struct file * filp) +{ + + if (ifconfig_net_debug) { + printk("ifconfig_net_close called.\n"); + } + + return(0); +} + +/* + * assign_ifname - Assign the next available interface name from the persistent list. + */ +void +assign_ifname(struct net_device *dev, + struct ifname_num *ifname_num) + +{ + + /* + * Handle eth devices. + */ + if ( (memcmp(dev->name, "eth", 3) == 0) ) { + if (ifname_num->next_eth != -1) { + /* + * Assign it the next available eth interface number. + */ + memset(dev->name, 0, strlen(dev->name)); + sprintf(dev->name, "eth%d", (int)ifname_num->next_eth); + ifname_num->next_eth++; + } + + return; + } + + /* + * Handle fddi devices. + */ + if ( (memcmp(dev->name, "fddi", 4) == 0) ) { + if (ifname_num->next_fddi != -1) { + /* + * Assign it the next available fddi interface number. + */ + memset(dev->name, 0, strlen(dev->name)); + sprintf(dev->name, "fddi%d", (int)ifname_num->next_fddi); + ifname_num->next_fddi++; + } + + return; + } + + /* + * Handle hip devices. + */ + if ( (memcmp(dev->name, "hip", 3) == 0) ) { + if (ifname_num->next_hip != -1) { + /* + * Assign it the next available hip interface number. + */ + memset(dev->name, 0, strlen(dev->name)); + sprintf(dev->name, "hip%d", (int)ifname_num->next_hip); + ifname_num->next_hip++; + } + + return; + } + + /* + * Handle tr devices. + */ + if ( (memcmp(dev->name, "tr", 2) == 0) ) { + if (ifname_num->next_tr != -1) { + /* + * Assign it the next available tr interface number. + */ + memset(dev->name, 0, strlen(dev->name)); + sprintf(dev->name, "tr%d", (int)ifname_num->next_tr); + ifname_num->next_tr++; + } + + return; + } + + /* + * Handle fc devices. + */ + if ( (memcmp(dev->name, "fc", 2) == 0) ) { + if (ifname_num->next_fc != -1) { + /* + * Assign it the next available fc interface number. + */ + memset(dev->name, 0, strlen(dev->name)); + sprintf(dev->name, "fc%d", (int)ifname_num->next_fc); + ifname_num->next_fc++; + } + + return; + } +} + +/* + * find_persistent_ifname: Returns the entry that was seen in previous boot. + */ +struct ifname_MAC * +find_persistent_ifname(struct net_device *dev, + struct ifname_MAC *ifname_MAC) + +{ + + while (ifname_MAC->addr_len) { + if (memcmp(dev->dev_addr, ifname_MAC->dev_addr, dev->addr_len) == 0) + return(ifname_MAC); + + ifname_MAC++; + } + + return(NULL); +} + +/* + * ifconfig_net_ioctl: ifconfig_net driver ioctl interface. + */ +static int ifconfig_net_ioctl(struct inode * inode, struct file * file, + unsigned int cmd, unsigned long arg) +{ + + extern struct net_device *__dev_get_by_name(const char *); +#ifdef CONFIG_NET + struct net_device *dev; + struct ifname_MAC *found; + char temp[64]; +#endif + struct ifname_MAC *ifname_MAC; + struct ifname_MAC *new_devices, *temp_new_devices; + struct ifname_num *ifname_num; + unsigned long size; + + + if (ifconfig_net_debug) { + printk("HCL: hcl_ioctl called.\n"); + } + + /* + * Read in the header and see how big of a buffer we really need to + * allocate. + */ + ifname_num = (struct ifname_num *) kmalloc(sizeof(struct ifname_num), + GFP_KERNEL); + copy_from_user( ifname_num, (char *) arg, sizeof(struct ifname_num)); + size = ifname_num->size; + kfree(ifname_num); + ifname_num = (struct ifname_num *) kmalloc(size, GFP_KERNEL); + ifname_MAC = (struct ifname_MAC *) ((char *)ifname_num + (sizeof(struct ifname_num)) ); + + copy_from_user( ifname_num, (char *) arg, size); + new_devices = kmalloc(size - sizeof(struct ifname_num), GFP_KERNEL); + temp_new_devices = new_devices; + + memset(new_devices, 0, size - sizeof(struct ifname_num)); + +#ifdef CONFIG_NET + /* + * Go through the net device entries and make them persistent! + */ + for (dev = dev_base; dev != NULL; dev = dev->next) { + /* + * Skip NULL entries or "lo" + */ + if ( (dev->addr_len == 0) || ( !strncmp(dev->name, "lo", strlen(dev->name))) ){ + continue; + } + + /* + * See if we have a persistent interface name for this device. + */ + found = NULL; + found = find_persistent_ifname(dev, ifname_MAC); + if (found) { + strcpy(dev->name, found->name); + } else { + /* Never seen this before .. */ + assign_ifname(dev, ifname_num); + + /* + * Save the information for the next boot. + */ + sprintf(temp,"%s %02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, + dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], + dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); + strcpy(temp_new_devices->name, dev->name); + temp_new_devices->addr_len = dev->addr_len; + memcpy(temp_new_devices->dev_addr, dev->dev_addr, dev->addr_len); + temp_new_devices++; + } + + } +#endif + + /* + * Copy back to the User Buffer area any new devices encountered. + */ + copy_to_user((char *)arg + (sizeof(struct ifname_num)), new_devices, + size - sizeof(struct ifname_num)); + + return(0); + +} + +struct file_operations ifconfig_net_fops = { + ioctl:ifconfig_net_ioctl, /* ioctl */ + open:ifconfig_net_open, /* open */ + release:ifconfig_net_close /* release */ +}; + + +/* + * init_ifconfig_net() - Boot time initialization. Ensure that it is called + * after devfs has been initialized. + * + */ +#ifdef MODULE +int init_module (void) +#else +int __init init_ifconfig_net(void) +#endif +{ + ifconfig_net_handle = NULL; + ifconfig_net_handle = hwgraph_register(hwgraph_root, ".ifconfig_net", + 0, DEVFS_FL_AUTO_DEVNUM, + 0, 0, + S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, 0, 0, + &ifconfig_net_fops, NULL); + + if (ifconfig_net_handle == NULL) { + panic("Unable to create SGI PERSISTENT NETWORK DEVICE Name Driver.\n"); + } + + return(0); + +} diff -urN linux-2.4.18/arch/ia64/sn/io/invent.c lia64-2.4/arch/ia64/sn/io/invent.c --- linux-2.4.18/arch/ia64/sn/io/invent.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/invent.c Mon Nov 19 23:22:50 2001 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ /* diff -urN linux-2.4.18/arch/ia64/sn/io/io.c lia64-2.4/arch/ia64/sn/io/io.c --- linux-2.4.18/arch/ia64/sn/io/io.c Thu Apr 12 12:16:35 2001 +++ lia64-2.4/arch/ia64/sn/io/io.c Mon Feb 4 17:48:56 2002 @@ -1,36 +1,50 @@ -/* $Id$ +/* $Id: io.c,v 1.2 2001/06/26 14:02:43 pfg Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992-1997, 2000-2002 Silicon Graphics, Inc. All Rights Reserved. */ #include -#include #include #include #include -#include +#include #include #include #include #include +#include #include #include #include #include #include -#include #include #include #include -#include #include extern xtalk_provider_t hub_provider; +extern void hub_intr_init(devfs_handle_t hubv); + + +/* + * hub_device_desc_update + * Update the passed in device descriptor with the actual the + * target cpu number and interrupt priority level. + * NOTE : These might be the same as the ones passed in thru + * the descriptor. + */ +void +hub_device_desc_update(device_desc_t dev_desc, + ilvl_t intr_swlevel, + cpuid_t cpu) +{ +} + /* * Perform any initializations needed to support hub-based I/O. @@ -63,7 +77,7 @@ /* * Setup pio structures needed for a particular hub. */ -static void +void hub_pio_init(devfs_handle_t hubv) { xwidgetnum_t widget; @@ -386,7 +400,7 @@ /* ARGSUSED */ -static void +void hub_dma_init(devfs_handle_t hubv) { } @@ -411,7 +425,7 @@ xwidgetnum_t widget = xwidget_info_id_get(widget_info); devfs_handle_t hubv = xwidget_info_master_get(widget_info); - dmamap = kern_malloc(sizeof(struct hub_dmamap_s)); + dmamap = kmalloc(sizeof(struct hub_dmamap_s), GFP_ATOMIC); dmamap->hdma_xtalk_info.xd_dev = dev; dmamap->hdma_xtalk_info.xd_target = widget; dmamap->hdma_hub = hubv; @@ -454,9 +468,9 @@ if (!(dmamap->hdma_flags & HUB_DMAMAP_IS_FIXED)) { vhdl = dmamap->hdma_xtalk_info.xd_dev; #if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING("%v: hub_dmamap_addr re-uses dmamap.\n",vhdl); + printk(KERN_WARNING "%v: hub_dmamap_addr re-uses dmamap.\n",vhdl); #else - PRINT_WARNING("0x%x: hub_dmamap_addr re-uses dmamap.\n", vhdl); + printk(KERN_WARNING "%p: hub_dmamap_addr re-uses dmamap.\n", (void *)vhdl); #endif } } else { @@ -487,9 +501,9 @@ if (!(hub_dmamap->hdma_flags & HUB_DMAMAP_IS_FIXED)) { vhdl = hub_dmamap->hdma_xtalk_info.xd_dev; #if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING("%v: hub_dmamap_list re-uses dmamap\n",vhdl); + printk(KERN_WARNING "%v: hub_dmamap_list re-uses dmamap\n",vhdl); #else - PRINT_WARNING("0x%x: hub_dmamap_list re-uses dmamap\n", vhdl); + printk(KERN_WARNING "%p: hub_dmamap_list re-uses dmamap\n", (void *)vhdl); #endif } } else { @@ -516,9 +530,9 @@ if (!(hub_dmamap->hdma_flags & HUB_DMAMAP_IS_FIXED)) { vhdl = hub_dmamap->hdma_xtalk_info.xd_dev; #if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING("%v: hub_dmamap_done already done with dmamap\n",vhdl); + printk(KERN_WARNING "%v: hub_dmamap_done already done with dmamap\n",vhdl); #else - PRINT_WARNING("0x%x: hub_dmamap_done already done with dmamap\n", vhdl); + printk(KERN_WARNING "%p: hub_dmamap_done already done with dmamap\n", (void *)vhdl); #endif } } @@ -581,329 +595,6 @@ -/* INTERRUPT MANAGEMENT */ - -/* ARGSUSED */ -static void -hub_intr_init(devfs_handle_t hubv) -{ -} - -/* - * hub_device_desc_update - * Update the passed in device descriptor with the actual the - * target cpu number and interrupt priority level. - * NOTE : These might be the same as the ones passed in thru - * the descriptor. - */ -static void -hub_device_desc_update(device_desc_t dev_desc, - ilvl_t intr_swlevel, - cpuid_t cpu) -{ - char cpuname[40]; - - /* Store the interrupt priority level in the device descriptor */ - device_desc_intr_swlevel_set(dev_desc, intr_swlevel); - - /* Convert the cpuid to the vertex handle in the hwgraph and - * save it in the device descriptor. - */ - sprintf(cpuname,"/hw/cpunum/%ld",cpu); - device_desc_intr_target_set(dev_desc, - hwgraph_path_to_dev(cpuname)); -} - -int allocate_my_bit = INTRCONNECT_ANYBIT; - -/* - * Allocate resources required for an interrupt as specified in dev_desc. - * Returns a hub interrupt handle on success, or 0 on failure. - */ -static hub_intr_t -do_hub_intr_alloc(devfs_handle_t dev, /* which crosstalk device */ - device_desc_t dev_desc, /* device descriptor */ - devfs_handle_t owner_dev, /* owner of this interrupt, if known */ - int uncond_nothread) /* unconditionally non-threaded */ -{ - cpuid_t cpu = (cpuid_t)0; /* cpu to receive interrupt */ - int cpupicked = 0; - int bit; /* interrupt vector */ - /*REFERENCED*/ - int intr_resflags = 0; - hub_intr_t intr_hdl; - cnodeid_t nodeid; /* node to receive interrupt */ - /*REFERENCED*/ - nasid_t nasid; /* nasid to receive interrupt */ - struct xtalk_intr_s *xtalk_info; - iopaddr_t xtalk_addr; /* xtalk addr on hub to set intr */ - xwidget_info_t xwidget_info; /* standard crosstalk widget info handle */ - char *intr_name = NULL; - ilvl_t intr_swlevel; - extern int default_intr_pri; -#ifdef CONFIG_IA64_SGI_SN1 - extern void synergy_intr_alloc(int, int); -#endif - - /* - * If caller didn't explicily specify a device descriptor, see if there's - * a default descriptor associated with the device. - */ - if (!dev_desc) - dev_desc = device_desc_default_get(dev); - - if (dev_desc) { - intr_name = device_desc_intr_name_get(dev_desc); - intr_swlevel = device_desc_intr_swlevel_get(dev_desc); - if (dev_desc->flags & D_INTR_ISERR) { - intr_resflags = II_ERRORINT; - } else if (!uncond_nothread && !(dev_desc->flags & D_INTR_NOTHREAD)) { - intr_resflags = II_THREADED; - } else { - /* Neither an error nor a thread. */ - intr_resflags = 0; - } - } else { - intr_swlevel = default_intr_pri; - if (!uncond_nothread) - intr_resflags = II_THREADED; - } - - /* XXX - Need to determine if the interrupt should be threaded. */ - - /* If the cpu has not been picked already then choose a candidate - * interrupt target and reserve the interrupt bit - */ -#if defined(NEW_INTERRUPTS) - if (!cpupicked) { - cpu = intr_heuristic(dev,dev_desc,allocate_my_bit, - intr_resflags,owner_dev, - intr_name,&bit); - } -#endif - - /* At this point we SHOULD have a valid cpu */ - if (cpu == CPU_NONE) { -#if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING("%v hub_intr_alloc could not allocate interrupt\n", - owner_dev); -#else - PRINT_WARNING("0x%x hub_intr_alloc could not allocate interrupt\n", - owner_dev); -#endif - return(0); - - } - - /* If the cpu has been picked already (due to the bridge data - * corruption bug) then try to reserve an interrupt bit . - */ -#if defined(NEW_INTERRUPTS) - if (cpupicked) { - bit = intr_reserve_level(cpu, allocate_my_bit, - intr_resflags, - owner_dev, intr_name); - if (bit < 0) { -#if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING("Could not reserve an interrupt bit for cpu " - " %d and dev %v\n", - cpu,owner_dev); -#else - PRINT_WARNING("Could not reserve an interrupt bit for cpu " - " %d and dev 0x%x\n", - cpu, owner_dev); -#endif - - return(0); - } - } -#endif /* NEW_INTERRUPTS */ - - nodeid = cpuid_to_cnodeid(cpu); - nasid = cpuid_to_nasid(cpu); - xtalk_addr = HUBREG_AS_XTALKADDR(nasid, PIREG(PI_INT_PEND_MOD, cpuid_to_subnode(cpu))); - - /* - * Allocate an interrupt handle, and fill it in. There are two - * pieces to an interrupt handle: the piece needed by generic - * xtalk code which is used by crosstalk device drivers, and - * the piece needed by low-level IP27 hardware code. - */ - intr_hdl = kmem_alloc_node(sizeof(struct hub_intr_s), KM_NOSLEEP, nodeid); - ASSERT_ALWAYS(intr_hdl); - - /* - * Fill in xtalk information for generic xtalk interfaces that - * operate on xtalk_intr_hdl's. - */ - xtalk_info = &intr_hdl->i_xtalk_info; - xtalk_info->xi_dev = dev; - xtalk_info->xi_vector = bit; - xtalk_info->xi_addr = xtalk_addr; - - /* - * Regardless of which CPU we ultimately interrupt, a given crosstalk - * widget always handles interrupts (and PIO and DMA) through its - * designated "master" crosstalk provider. - */ - xwidget_info = xwidget_info_get(dev); - if (xwidget_info) - xtalk_info->xi_target = xwidget_info_masterid_get(xwidget_info); - - /* Fill in low level hub information for hub_* interrupt interface */ - intr_hdl->i_swlevel = intr_swlevel; - intr_hdl->i_cpuid = cpu; - intr_hdl->i_bit = bit; - intr_hdl->i_flags = HUB_INTR_IS_ALLOCED; - - /* Store the actual interrupt priority level & interrupt target - * cpu back in the device descriptor. - */ - hub_device_desc_update(dev_desc, intr_swlevel, cpu); -#ifdef CONFIG_IA64_SGI_SN1 - synergy_intr_alloc((int)bit, (int)cpu); -#endif - return(intr_hdl); -} - -/* - * Allocate resources required for an interrupt as specified in dev_desc. - * Returns a hub interrupt handle on success, or 0 on failure. - */ -hub_intr_t -hub_intr_alloc( devfs_handle_t dev, /* which crosstalk device */ - device_desc_t dev_desc, /* device descriptor */ - devfs_handle_t owner_dev) /* owner of this interrupt, if known */ -{ - return(do_hub_intr_alloc(dev, dev_desc, owner_dev, 0)); -} - -/* - * Allocate resources required for an interrupt as specified in dev_desc. - * Uncondtionally request non-threaded, regardless of what the device - * descriptor might say. - * Returns a hub interrupt handle on success, or 0 on failure. - */ -hub_intr_t -hub_intr_alloc_nothd(devfs_handle_t dev, /* which crosstalk device */ - device_desc_t dev_desc, /* device descriptor */ - devfs_handle_t owner_dev) /* owner of this interrupt, if known */ -{ - return(do_hub_intr_alloc(dev, dev_desc, owner_dev, 1)); -} - -/* - * Free resources consumed by intr_alloc. - */ -void -hub_intr_free(hub_intr_t intr_hdl) -{ - cpuid_t cpu = intr_hdl->i_cpuid; - int bit = intr_hdl->i_bit; - xtalk_intr_t xtalk_info; - - if (intr_hdl->i_flags & HUB_INTR_IS_CONNECTED) { - /* Setting the following fields in the xtalk interrupt info - * clears the interrupt target register in the xtalk user - */ - xtalk_info = &intr_hdl->i_xtalk_info; - xtalk_info->xi_dev = NODEV; - xtalk_info->xi_vector = 0; - xtalk_info->xi_addr = 0; - hub_intr_disconnect(intr_hdl); - } - - if (intr_hdl->i_flags & HUB_INTR_IS_ALLOCED) - kfree(intr_hdl); - -#if defined(NEW_INTERRUPTS) - intr_unreserve_level(cpu, bit); -#endif -} - - -/* - * Associate resources allocated with a previous hub_intr_alloc call with the - * described handler, arg, name, etc. - */ -/*ARGSUSED*/ -int -hub_intr_connect( hub_intr_t intr_hdl, /* xtalk intr resource handle */ - intr_func_t intr_func, /* xtalk intr handler */ - void *intr_arg, /* arg to intr handler */ - xtalk_intr_setfunc_t setfunc, /* func to set intr hw */ - void *setfunc_arg, /* arg to setfunc */ - void *thread) /* intr thread to use */ -{ - int rv; - cpuid_t cpu = intr_hdl->i_cpuid; - int bit = intr_hdl->i_bit; -#ifdef CONFIG_IA64_SGI_SN1 - extern int synergy_intr_connect(int, int); -#endif - - ASSERT(intr_hdl->i_flags & HUB_INTR_IS_ALLOCED); - -#if defined(NEW_INTERRUPTS) - rv = intr_connect_level(cpu, bit, intr_hdl->i_swlevel, - intr_func, intr_arg, NULL); - if (rv < 0) - return(rv); - -#endif - intr_hdl->i_xtalk_info.xi_setfunc = setfunc; - intr_hdl->i_xtalk_info.xi_sfarg = setfunc_arg; - - if (setfunc) (*setfunc)((xtalk_intr_t)intr_hdl); - - intr_hdl->i_flags |= HUB_INTR_IS_CONNECTED; -#ifdef CONFIG_IA64_SGI_SN1 - return(synergy_intr_connect((int)bit, (int)cpu)); -#endif -} - - -/* - * Disassociate handler with the specified interrupt. - */ -void -hub_intr_disconnect(hub_intr_t intr_hdl) -{ - /*REFERENCED*/ - int rv; - cpuid_t cpu = intr_hdl->i_cpuid; - int bit = intr_hdl->i_bit; - xtalk_intr_setfunc_t setfunc; - - setfunc = intr_hdl->i_xtalk_info.xi_setfunc; - - /* TBD: send disconnected interrupts somewhere harmless */ - if (setfunc) (*setfunc)((xtalk_intr_t)intr_hdl); - -#if defined(NEW_INTERRUPTS) - rv = intr_disconnect_level(cpu, bit); - ASSERT(rv == 0); -#endif - - intr_hdl->i_flags &= ~HUB_INTR_IS_CONNECTED; -} - - -/* - * Return a hwgraph vertex that represents the CPU currently - * targeted by an interrupt. - */ -devfs_handle_t -hub_intr_cpu_get(hub_intr_t intr_hdl) -{ - cpuid_t cpuid = intr_hdl->i_cpuid; - ASSERT(cpuid != CPU_NONE); - - return(cpuid_to_vertex(cpuid)); -} - - - /* CONFIGURATION MANAGEMENT */ /* @@ -912,6 +603,9 @@ void hub_provider_startup(devfs_handle_t hubv) { + extern void hub_dma_init(devfs_handle_t hubv); + extern void hub_pio_init(devfs_handle_t hubv); + hub_pio_init(hubv); hub_dma_init(hubv); hub_intr_init(hubv); @@ -1170,58 +864,6 @@ return rv; } -#if ((defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC)) && defined(BRINGUP)) -/* BRINGUP: This ought to be useful for IP27 too but, for now, - * make it SN1 only because `ii_ixtt_u_t' is not in IP27/hubio.h - * (or anywhere else :-). - */ -int -hubii_ixtt_set(devfs_handle_t widget_vhdl, ii_ixtt_u_t *ixtt) -{ - xwidget_info_t widget_info = xwidget_info_get(widget_vhdl); - devfs_handle_t hub_vhdl = xwidget_info_master_get(widget_info); - hubinfo_t hub_info = 0; - nasid_t nasid; - unsigned long s; - - /* Use the nasid from the hub info hanging off the hub vertex - * and widget number from the widget vertex - */ - hubinfo_get(hub_vhdl, &hub_info); - /* Being over cautious by grabbing a lock */ - s = mutex_spinlock(&hub_info->h_bwlock); - nasid = hub_info->h_nasid; - - REMOTE_HUB_S(nasid, IIO_IXTT, ixtt->ii_ixtt_regval); - - mutex_spinunlock(&hub_info->h_bwlock, s); - return 0; -} - -int -hubii_ixtt_get(devfs_handle_t widget_vhdl, ii_ixtt_u_t *ixtt) -{ - xwidget_info_t widget_info = xwidget_info_get(widget_vhdl); - devfs_handle_t hub_vhdl = xwidget_info_master_get(widget_info); - hubinfo_t hub_info = 0; - nasid_t nasid; - unsigned long s; - - /* Use the nasid from the hub info hanging off the hub vertex - * and widget number from the widget vertex - */ - hubinfo_get(hub_vhdl, &hub_info); - /* Being over cautious by grabbing a lock */ - s = mutex_spinlock(&hub_info->h_bwlock); - nasid = hub_info->h_nasid; - - ixtt->ii_ixtt_regval = REMOTE_HUB_L(nasid, IIO_IXTT); - - mutex_spinunlock(&hub_info->h_bwlock, s); - return 0; -} -#endif /* CONFIG_IA64_SGI_SN1 */ - /* * hub_device_inquiry * Find out the xtalk widget related information stored in this @@ -1259,7 +901,7 @@ #if defined(SUPPORT_PRINTING_V_FORMAT) printk("Inquiry Info for %v\n", xconn); #else - printk("Inquiry Info for 0x%x\n", xconn); + printk("Inquiry Info for %p\n", (void *)xconn); #endif printk("\tDevices shutdown [ "); diff -urN linux-2.4.18/arch/ia64/sn/io/ip37.c lia64-2.4/arch/ia64/sn/io/ip37.c --- linux-2.4.18/arch/ia64/sn/io/ip37.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/ip37.c Wed Dec 31 16:00:00 1969 @@ -1,121 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ - -/* - * ip37.c - * Support for IP35/IP37 machines - */ - -#include -#include - -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#include -#include -#include -#include /* for bridge_t */ - - -xwidgetnum_t -hub_widget_id(nasid_t nasid) -{ - hubii_wcr_t ii_wcr; /* the control status register */ - - ii_wcr.wcr_reg_value = REMOTE_HUB_L(nasid,IIO_WCR); - - return ii_wcr.wcr_fields_s.wcr_widget_id; -} - -/* - * get_nasid() returns the physical node id number of the caller. - */ -nasid_t -get_nasid(void) -{ - return (nasid_t)((LOCAL_HUB_L(LB_REV_ID) & LRI_NODEID_MASK) >> LRI_NODEID_SHFT); -} - -int -get_slice(void) -{ - return LOCAL_HUB_L(PI_CPU_NUM); -} - -int -is_fine_dirmode(void) -{ - return (((LOCAL_HUB_L(LB_REV_ID) & LRI_SYSTEM_SIZE_MASK) - >> LRI_SYSTEM_SIZE_SHFT) == SYSTEM_SIZE_SMALL); - -} - -hubreg_t -get_hub_chiprev(nasid_t nasid) -{ - - return ((REMOTE_HUB_L(nasid, LB_REV_ID) & LRI_REV_MASK) - >> LRI_REV_SHFT); -} - -int -verify_snchip_rev(void) -{ - int hub_chip_rev; - int i; - static int min_hub_rev = 0; - nasid_t nasid; - static int first_time = 1; - extern int maxnodes; - - - if (first_time) { - for (i = 0; i < maxnodes; i++) { - nasid = COMPACT_TO_NASID_NODEID(i); - hub_chip_rev = get_hub_chiprev(nasid); - - if ((hub_chip_rev < min_hub_rev) || (i == 0)) - min_hub_rev = hub_chip_rev; - } - - - first_time = 0; - } - - return min_hub_rev; - -} - -#ifdef SN1_USE_POISON_BITS -int -hub_bte_poison_ok(void) -{ - /* - * For now, assume poisoning is ok. If it turns out there are chip - * bugs that prevent its use in early revs, there is some neat code - * to steal from the IP27 equivalent of this code. - */ - -#ifdef BRINGUP /* temp disable BTE poisoning - might be sw bugs in this area */ - return 0; -#else - return 1; -#endif -} -#endif /* SN1_USE_POISON_BITS */ - - -void -ni_reset_port(void) -{ - LOCAL_HUB_S(NI_RESET_ENABLE, NRE_RESETOK); - LOCAL_HUB_S(NI_PORT_RESET, NPR_PORTRESET | NPR_LOCALRESET); -} - -#endif /* CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 */ diff -urN linux-2.4.18/arch/ia64/sn/io/klconflib.c lia64-2.4/arch/ia64/sn/io/klconflib.c --- linux-2.4.18/arch/ia64/sn/io/klconflib.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/klconflib.c Tue Feb 26 13:19:34 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ @@ -13,12 +12,13 @@ #include #include #include +#include +#include +#include #include #include #include #include - -#include #include #include #include @@ -40,6 +40,9 @@ static void sort_nic_names(lboard_t *) ; +u64 klgraph_addr[MAX_COMPACT_NODES]; +int module_number = 0; + lboard_t * find_lboard(lboard_t *start, unsigned char brd_type) { @@ -213,14 +216,13 @@ { lboard_t *board; -#if CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 || CONFIG_IA64_GENERIC -/* BRINGUP: If this works then look for callers of is_master_baseio() +#if defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) +/* If this works then look for callers of is_master_baseio() * (e.g. iograph.c) and let them pass in a slot if they want */ board = find_lboard_module((lboard_t *)KL_CONFIG_INFO(nasid), module); #else - board = find_lboard_modslot((lboard_t *)KL_CONFIG_INFO(nasid), - module, slot); + board = find_lboard_modslot((lboard_t *)KL_CONFIG_INFO(nasid), module, slot); #endif #ifndef _STANDALONE @@ -228,7 +230,7 @@ cnodeid_t cnode = NASID_TO_COMPACT_NODEID(nasid); if (!board && (NODEPDA(cnode)->xbow_peer != INVALID_NASID)) -#if CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 || CONFIG_IA64_GENERIC +#if defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) board = find_lboard_module((lboard_t *) KL_CONFIG_INFO(NODEPDA(cnode)->xbow_peer), module); @@ -300,16 +302,6 @@ return(brd); } -int -get_cpu_slice(cpuid_t cpu) -{ - klcpu_t *acpu; - if ((acpu = get_cpuinfo(cpu)) == NULL) - return -1; - return acpu->cpu_info.physid; -} - - /* * get_actual_nasid * @@ -366,10 +358,6 @@ { moduleid_t modnum; char *board_name; -#if !defined(CONFIG_SGI_IP35) && !defined(CONFIG_IA64_SGI_SN1) && !defined(CONFIG_IA64_GENERIC) - slotid_t slot; - char slot_name[SLOTNUM_MAXLENGTH]; -#endif ASSERT(brd); @@ -410,7 +398,10 @@ modnum = brd->brd_module; - ASSERT(modnum != MODULE_UNKNOWN && modnum != INVALID_MODULE); + /* ASSERT(modnum != MODULE_UNKNOWN && modnum != INVALID_MODULE); */ +if ((modnum == MODULE_UNKNOWN) || (modnum == INVALID_MODULE)) { + modnum = ++module_number; +} #ifdef __ia64 { char buffer[16]; @@ -431,7 +422,7 @@ { lboard_t *brd; - brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IP27); + brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA); if (!brd) return INVALID_MODULE; @@ -569,8 +560,8 @@ if (component_serial_number_get(board, hub->hub_mfg_nic, serial_number, -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) - "IP35")) +#if defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) + "IP37")) #else "IP27")) /* Try with IP31 key if IP27 key fails */ @@ -578,7 +569,7 @@ hub->hub_mfg_nic, serial_number, "IP31")) -#endif /* CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 */ +#endif /* CONFIG_IA64_SGI_SN1 */ return(1); break; } @@ -875,10 +866,11 @@ } -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) char brick_types[MAX_BRICK_TYPES + 1] = "crikxdp789012345"; +#if defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) + /* * Format a module id for printing. */ @@ -1009,7 +1001,7 @@ return (int)(unsigned short)m; } -#else /* CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 */ +#else /* CONFIG_IA64_SGI_SN1 */ /* * Format a module id for printing. @@ -1038,8 +1030,8 @@ if (strstr(buffer, EDGE_LBL_MODULE "/") == buffer) buffer += strlen(EDGE_LBL_MODULE "/"); - m = 0; - while(c = *buffer++) { + for (m = 0; *buffer; buffer++) { + c = *buffer; if (!isdigit(c)) return -1; m = 10 * m + (c - '0'); @@ -1049,6 +1041,6 @@ return (int)(unsigned short)m; } -#endif /* CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 */ +#endif /* CONFIG_IA64_SGI_SN1 */ diff -urN linux-2.4.18/arch/ia64/sn/io/klgraph.c lia64-2.4/arch/ia64/sn/io/klgraph.c --- linux-2.4.18/arch/ia64/sn/io/klgraph.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/klgraph.c Tue Feb 26 13:19:34 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ /* @@ -18,12 +17,12 @@ #include #include #include +#include +#include #include #include #include #include - -#include #include #include #include @@ -43,8 +42,7 @@ #include extern char arg_maxnodes[]; -extern int maxnodes; - +extern u64 klgraph_addr[]; /* * Support for verbose inventory via hardware graph. @@ -139,193 +137,63 @@ void klhwg_add_hub(devfs_handle_t node_vertex, klhub_t *hub, cnodeid_t cnode) { +#if defined(CONFIG_IA64_SGI_SN1) devfs_handle_t myhubv; + devfs_handle_t hub_mon; + devfs_handle_t synergy; + devfs_handle_t fsb0; + devfs_handle_t fsb1; int rc; + extern struct file_operations hub_mon_fops; GRPRINTF(("klhwg_add_hub: adding %s\n", EDGE_LBL_HUB)); (void) hwgraph_path_add(node_vertex, EDGE_LBL_HUB, &myhubv); rc = device_master_set(myhubv, node_vertex); -#ifdef LATER /* - * Activate when we support hub stats. + * hub perf stats. */ rc = hwgraph_info_add_LBL(myhubv, INFO_LBL_HUB_INFO, (arbitrary_info_t)(&NODEPDA(cnode)->hubstats)); -#endif if (rc != GRAPH_SUCCESS) { - PRINT_WARNING("klhwg_add_hub: Can't add hub info label 0x%p, code %d", - myhubv, rc); + printk(KERN_WARNING "klhwg_add_hub: Can't add hub info label 0x%p, code %d", + (void *)myhubv, rc); } klhwg_hub_invent_info(myhubv, cnode, hub); -#ifndef BRINGUP + hub_mon = hwgraph_register(myhubv, EDGE_LBL_PERFMON, + 0, DEVFS_FL_AUTO_DEVNUM, + 0, 0, + S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, 0, 0, + &hub_mon_fops, + (void *)(long)cnode); + init_hub_stats(cnode, NODEPDA(cnode)); - sndrv_attach(myhubv); -#else + /* - * Need to call our driver to do the attach? + * synergy perf */ - FIXME("klhwg_add_hub: Need to add code to do the attach.\n"); -#endif -} - -#ifndef BRINGUP - -void -klhwg_add_rps(devfs_handle_t node_vertex, cnodeid_t cnode, int flag) -{ - devfs_handle_t myrpsv; - invent_rpsinfo_t *rps_invent; - int rc; - - if(cnode == CNODEID_NONE) - return; - - GRPRINTF(("klhwg_add_rps: adding %s to vertex 0x%x\n", EDGE_LBL_RPS, - node_vertex)); - - rc = hwgraph_path_add(node_vertex, EDGE_LBL_RPS, &myrpsv); - if (rc != GRAPH_SUCCESS) - return; - - device_master_set(myrpsv, node_vertex); - - rps_invent = (invent_rpsinfo_t *) - klhwg_invent_alloc(cnode, INV_RPS, sizeof(invent_rpsinfo_t)); - - if (!rps_invent) - return; - - rps_invent->ir_xbox = 0; /* not an xbox RPS */ - - if (flag) - rps_invent->ir_gen.ig_flag = INVENT_ENABLED; - else - rps_invent->ir_gen.ig_flag = 0x0; - - hwgraph_info_add_LBL(myrpsv, INFO_LBL_DETAIL_INVENT, - (arbitrary_info_t) rps_invent); - hwgraph_info_export_LBL(myrpsv, INFO_LBL_DETAIL_INVENT, - sizeof(invent_rpsinfo_t)); - -} - -/* - * klhwg_update_rps gets invoked when the system controller sends an - * interrupt indicating the power supply has lost/regained the redundancy. - * It's responsible for updating the Hardware graph information. - * rps_state = 0 -> if the rps lost the redundancy - * = 1 -> If it is redundant. - */ -void -klhwg_update_rps(cnodeid_t cnode, int rps_state) -{ - devfs_handle_t node_vertex; - devfs_handle_t rpsv; - invent_rpsinfo_t *rps_invent; - int rc; - if(cnode == CNODEID_NONE) - return; - - node_vertex = cnodeid_to_vertex(cnode); - rc = hwgraph_edge_get(node_vertex, EDGE_LBL_RPS, &rpsv); - if (rc != GRAPH_SUCCESS) { - return; - } - - rc = hwgraph_info_get_LBL(rpsv, INFO_LBL_DETAIL_INVENT, - (arbitrary_info_t *)&rps_invent); - if (rc != GRAPH_SUCCESS) { - return; - } - - if (rps_state == 0 ) - rps_invent->ir_gen.ig_flag = 0; - else - rps_invent->ir_gen.ig_flag = INVENT_ENABLED; -} - -void -klhwg_add_xbox_rps(devfs_handle_t node_vertex, cnodeid_t cnode, int flag) -{ - devfs_handle_t myrpsv; - invent_rpsinfo_t *rps_invent; - int rc; - - if(cnode == CNODEID_NONE) - return; - - GRPRINTF(("klhwg_add_rps: adding %s to vertex 0x%x\n", - EDGE_LBL_XBOX_RPS, node_vertex)); - - rc = hwgraph_path_add(node_vertex, EDGE_LBL_XBOX_RPS, &myrpsv); - if (rc != GRAPH_SUCCESS) - return; - - device_master_set(myrpsv, node_vertex); - - rps_invent = (invent_rpsinfo_t *) - klhwg_invent_alloc(cnode, INV_RPS, sizeof(invent_rpsinfo_t)); - - if (!rps_invent) - return; - - rps_invent->ir_xbox = 1; /* xbox RPS */ - - if (flag) - rps_invent->ir_gen.ig_flag = INVENT_ENABLED; - else - rps_invent->ir_gen.ig_flag = 0x0; - - hwgraph_info_add_LBL(myrpsv, INFO_LBL_DETAIL_INVENT, - (arbitrary_info_t) rps_invent); - hwgraph_info_export_LBL(myrpsv, INFO_LBL_DETAIL_INVENT, - sizeof(invent_rpsinfo_t)); - -} - -/* - * klhwg_update_xbox_rps gets invoked when the xbox system controller - * polls the status register and discovers that the power supply has - * lost/regained the redundancy. - * It's responsible for updating the Hardware graph information. - * rps_state = 0 -> if the rps lost the redundancy - * = 1 -> If it is redundant. - */ -void -klhwg_update_xbox_rps(cnodeid_t cnode, int rps_state) -{ - devfs_handle_t node_vertex; - devfs_handle_t rpsv; - invent_rpsinfo_t *rps_invent; - int rc; - if(cnode == CNODEID_NONE) - return; - - node_vertex = cnodeid_to_vertex(cnode); - rc = hwgraph_edge_get(node_vertex, EDGE_LBL_XBOX_RPS, &rpsv); - if (rc != GRAPH_SUCCESS) { - return; - } - - rc = hwgraph_info_get_LBL(rpsv, INFO_LBL_DETAIL_INVENT, - (arbitrary_info_t *)&rps_invent); - if (rc != GRAPH_SUCCESS) { - return; - } - - if (rps_state == 0 ) - rps_invent->ir_gen.ig_flag = 0; - else - rps_invent->ir_gen.ig_flag = INVENT_ENABLED; + (void) hwgraph_path_add(myhubv, EDGE_LBL_SYNERGY, &synergy); + (void) hwgraph_path_add(synergy, "0", &fsb0); + (void) hwgraph_path_add(synergy, "1", &fsb1); + + fsb0 = hwgraph_register(fsb0, EDGE_LBL_PERFMON, + 0, DEVFS_FL_AUTO_DEVNUM, + 0, 0, + S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, 0, 0, + &synergy_mon_fops, (void *)SYNERGY_PERF_INFO(cnode, 0)); + + fsb1 = hwgraph_register(fsb1, EDGE_LBL_PERFMON, + 0, DEVFS_FL_AUTO_DEVNUM, + 0, 0, + S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, 0, 0, + &synergy_mon_fops, (void *)SYNERGY_PERF_INFO(cnode, 1)); +#endif /* CONFIG_IA64_SGI_SN1 */ } -#endif /* BRINGUP */ - void klhwg_add_xbow(cnodeid_t cnode, nasid_t nasid) { @@ -338,11 +206,8 @@ /*REFERENCED*/ graph_error_t err; -#if CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 || defined(CONFIG_IA64_GENERIC) - if ((brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), - KLTYPE_IOBRICK_XBOW)) == NULL) + if ((brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IOBRICK_XBOW)) == NULL) return; -#endif if (KL_CONFIG_DUPLICATE_BOARD(brd)) return; @@ -372,7 +237,7 @@ hub_nasid = XBOW_PORT_NASID(xbow_p, widgetnum); if (hub_nasid == INVALID_NASID) { - PRINT_WARNING("hub widget %d, skipping xbow graph\n", widgetnum); + printk(KERN_WARNING "hub widget %d, skipping xbow graph\n", widgetnum); continue; } @@ -387,13 +252,13 @@ err = hwgraph_path_add(hubv, EDGE_LBL_XTALK, &xbow_v); if (err != GRAPH_SUCCESS) { if (err == GRAPH_DUP) - PRINT_WARNING("klhwg_add_xbow: Check for " + printk(KERN_WARNING "klhwg_add_xbow: Check for " "working routers and router links!"); PRINT_PANIC("klhwg_add_xbow: Failed to add " - "edge: vertex 0x%p (0x%p) to vertex 0x%p (0x%p)," + "edge: vertex 0x%p to vertex 0x%p," "error %d\n", - hubv, hubv, xbow_v, xbow_v, err); + (void *)hubv, (void *)xbow_v, err); } xswitch_vertex_init(xbow_v); @@ -416,7 +281,7 @@ err = hwgraph_edge_add(hubv, xbow_v, EDGE_LBL_XTALK); if (err != GRAPH_SUCCESS) { if (err == GRAPH_DUP) - PRINT_WARNING("klhwg_add_xbow: Check for " + printk(KERN_WARNING "klhwg_add_xbow: Check for " "working routers and router links!"); PRINT_PANIC("klhwg_add_xbow: Failed to add " @@ -443,7 +308,7 @@ int board_disabled = 0; nasid = COMPACT_TO_NASID_NODEID(cnode); - brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IP27); + brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA); GRPRINTF(("klhwg_add_node: Adding cnode %d, nasid %d, brd 0x%p\n", cnode, nasid, brd)); ASSERT(brd); @@ -495,7 +360,7 @@ brd = KLCF_NEXT(brd); if (brd) - brd = find_lboard(brd, KLTYPE_IP27); + brd = find_lboard(brd, KLTYPE_SNIA); else break; } while(brd); @@ -513,7 +378,7 @@ char path_buffer[100]; int rv; - for (cnode = 0; cnode < maxnodes; cnode++) { + for (cnode = 0; cnode < numnodes; cnode++) { nasid = COMPACT_TO_NASID_NODEID(cnode); GRPRINTF(("klhwg_add_all_routers: adding router on cnode %d\n", @@ -594,7 +459,7 @@ return; if (rc != GRAPH_SUCCESS) - PRINT_WARNING("Can't find router: %s", path_buffer); + printk(KERN_WARNING "Can't find router: %s", path_buffer); /* We don't know what to do with multiple router components */ if (brd->brd_numcompts != 1) { @@ -650,7 +515,7 @@ if (rc != GRAPH_SUCCESS && !is_specified(arg_maxnodes)) PRINT_PANIC("Can't create edge: %s/%s to vertex 0x%p error 0x%x\n", - path_buffer, dest_path, dest_hndl, rc); + path_buffer, dest_path, (void *)dest_hndl, rc); } } @@ -663,7 +528,7 @@ cnodeid_t cnode; lboard_t *brd; - for (cnode = 0; cnode < maxnodes; cnode++) { + for (cnode = 0; cnode < numnodes; cnode++) { nasid = COMPACT_TO_NASID_NODEID(cnode); GRPRINTF(("klhwg_connect_routers: Connecting routers on cnode %d\n", @@ -703,14 +568,13 @@ char dest_path[50]; graph_error_t rc; - for (cnode = 0; cnode < maxnodes; cnode++) { + for (cnode = 0; cnode < numnodes; cnode++) { nasid = COMPACT_TO_NASID_NODEID(cnode); GRPRINTF(("klhwg_connect_hubs: Connecting hubs on cnode %d\n", cnode)); - brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), - KLTYPE_IP27); + brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA); ASSERT(brd); hub = (klhub_t *)find_first_component(brd, KLSTRUCT_HUB); @@ -732,7 +596,7 @@ rc = hwgraph_traverse(hwgraph_root, path_buffer, &hub_hndl); if (rc != GRAPH_SUCCESS) - PRINT_WARNING("Can't find hub: %s", path_buffer); + printk(KERN_WARNING "Can't find hub: %s", path_buffer); dest_brd = (lboard_t *)NODE_OFFSET_TO_K0( hub->hub_port.port_nasid, @@ -757,7 +621,7 @@ if (rc != GRAPH_SUCCESS) PRINT_PANIC("Can't create edge: %s/%s to vertex 0x%p, error 0x%x\n", - path_buffer, dest_path, dest_hndl, rc); + path_buffer, dest_path, (void *)dest_hndl, rc); } } @@ -896,23 +760,14 @@ void klhwg_add_all_nodes(devfs_handle_t hwgraph_root) { - //gda_t *gdap = GDA; - gda_t *gdap; cnodeid_t cnode; - gdap = (gda_t *)0xe000000000002400; - - FIXME("klhwg_add_all_nodes: FIX GDA\n"); - for (cnode = 0; cnode < numnodes; cnode++) { - ASSERT(gdap->g_nasidtable[cnode] != INVALID_NASID); - klhwg_add_node(hwgraph_root, cnode, gdap); + klhwg_add_node(hwgraph_root, cnode, NULL); } for (cnode = 0; cnode < numnodes; cnode++) { - ASSERT(gdap->g_nasidtable[cnode] != INVALID_NASID); - - klhwg_add_xbow(cnode, gdap->g_nasidtable[cnode]); + klhwg_add_xbow(cnode, cnodeid_to_nasid(cnode)); } /* diff -urN linux-2.4.18/arch/ia64/sn/io/klgraph_hack.c lia64-2.4/arch/ia64/sn/io/klgraph_hack.c --- linux-2.4.18/arch/ia64/sn/io/klgraph_hack.c Thu Apr 12 12:16:35 2001 +++ lia64-2.4/arch/ia64/sn/io/klgraph_hack.c Mon Feb 4 17:48:56 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ @@ -18,6 +17,7 @@ #include #include #include +#include #include void * real_port; @@ -28,11 +28,11 @@ kl_config_hdr_t *linux_klcfg; -#ifdef BRINGUP +#ifdef DEFINE_DUMP_RTNS /* forward declarations */ -extern void dump_ii(void), dump_lb(void), dump_crossbow(void); -extern void clear_ii_error(void); -#endif /* BRINGUP */ +static void dump_ii(void), dump_crossbow(void); +static void clear_ii_error(void); +#endif /* DEFINE_DUMP_RTNS */ #define SYNERGY_WIDGET ((char *)0xc0000e0000000000) #define SYNERGY_SWIZZLE ((char *)0xc0000e0000000400) @@ -45,115 +45,10 @@ #define HUBREG ((char *)0xc0000a0001e00000) #define WIDGET0 ((char *)0xc0000a0000000000) -int test = 0; - -/* - * Hack to loop for test. - */ -void -test_io_regs(void) -{ - - uint32_t reg_32bits; - uint64_t reg_64bits; - - while (test) { - - reg_32bits = (uint32_t)(*(volatile uint32_t *) SYNERGY_WIDGET); - reg_64bits = (uint64_t) (*(volatile uint64_t *) SYNERGY_WIDGET); - - } - - printk("Synergy Widget Address = 0x%p, Value = 0x%lx\n", SYNERGY_WIDGET, (uint64_t)*(SYNERGY_WIDGET)); - - printk("Synergy swizzle Address = 0x%p, Value = 0x%lx\n", SYNERGY_SWIZZLE, (uint64_t)*(SYNERGY_SWIZZLE)); - printk("HUBREG Address = 0x%p, Value = 0x%lx\n", HUBREG, (uint64_t)*(HUBREG)); - printk("WIDGET0 Address = 0x%p, Value = 0x%lx\n", WIDGET0, (uint64_t)*(WIDGET0)); - printk("WIDGET4 Address = 0x%p, Value = 0x%x\n", WIDGET4, (uint32_t)*(WIDGET4)); - -} - void klgraph_hack_init(void) { - kl_config_hdr_t *kl_hdr_ptr; - lboard_t *lb_ptr; - lboard_t *temp_ptr; - klhub_t *klhub_ptr; - klioc3_t *klioc3_ptr; - klbri_t *klbri_ptr; - klxbow_t *klxbow_ptr; - klinfo_t *klinfo_ptr; - klcomp_t *klcomp_ptr; -#if 0 - uint64_t *tmp; - volatile u32 *tmp32; - - /* Preset some values */ - /* Write IOERR clear to clear the CRAZY bit in the status */ - tmp = (uint64_t *)0xc0000a0001c001f8; *tmp = (uint64_t)0xffffffff; - /* set widget control register...setting bedrock widget id to b */ - /* tmp = (uint64_t *)0xc0000a0001c00020; *tmp = (uint64_t)0x801b; */ - /* set io outbound widget access...allow all */ - tmp = (uint64_t *)0xc0000a0001c00110; *tmp = (uint64_t)0xff01; - /* set io inbound widget access...allow all */ - tmp = (uint64_t *)0xc0000a0001c00118; *tmp = (uint64_t)0xff01; - /* set io crb timeout to max */ - tmp = (uint64_t *)0xc0000a0001c003c0; *tmp = (uint64_t)0xffffff; - tmp = (uint64_t *)0xc0000a0001c003c0; *tmp = (uint64_t)0xffffff; - - /* set local block io permission...allow all */ - tmp = (uint64_t *)0xc0000a0001e04010; *tmp = (uint64_t)0xfffffffffffffff; - - /* clear any errors */ - clear_ii_error(); - - /* set default read response buffers in bridge */ - tmp32 = (volatile u32 *)0xc0000a000f000280L; - *tmp32 = 0xba98; - tmp32 = (volatile u32 *)0xc0000a000f000288L; - *tmp32 = 0xba98; - -printk("Widget ID Address 0x%p Value 0x%lx\n", (uint64_t *)0xc0000a0001e00000, *( (volatile uint64_t *)0xc0000a0001e00000) ); - -printk("Widget ID Address 0x%p Value 0x%lx\n", (uint64_t *)0xc0000a0001c00000, *( (volatile uint64_t *)0xc0000a0001c00000) ); - -printk("Widget ID Address 0x%p Value 0x%lx\n", (uint64_t *)0xc000020001e00000, *( (volatile uint64_t *)0xc000020001e00000) ); - - -printk("Widget ID Address 0x%p Value 0x%lx\n", (uint64_t *)0xc000020001c00000, *( (volatile uint64_t *)0xc000020001c00000) ); - -printk("Widget ID Address 0x%p Value 0x%lx\n", (uint64_t *)0xc0000a0001e00000, *( (volatile uint64_t *)0xc0000a0001e00000) ); - -printk("Xbow ID Address 0x%p Value 0x%x\n", (uint64_t *)0xc0000a0000000000, *( (volatile uint32_t *)0xc0000a0000000000) ); - -printk("Xbow ID Address 0x%p Value 0x%x\n", (uint64_t *)0xc000020000000004, *( (volatile uint32_t *)0xc000020000000004) ); - -#endif - - if ( test ) - test_io_regs(); - /* - * Klconfig header. - */ - kl_hdr_ptr = kmalloc(sizeof(kl_config_hdr_t), GFP_KERNEL); - kl_hdr_ptr->ch_magic = 0xbeedbabe; - kl_hdr_ptr->ch_version = 0x0; - kl_hdr_ptr->ch_malloc_hdr_off = 0x48; - kl_hdr_ptr->ch_cons_off = 0x18; - kl_hdr_ptr->ch_board_info = 0x0; - kl_hdr_ptr->ch_cons_info.uart_base = 0x920000000f820178; - kl_hdr_ptr->ch_cons_info.config_base = 0x920000000f024000; - kl_hdr_ptr->ch_cons_info.memory_base = 0x920000000f800000; - kl_hdr_ptr->ch_cons_info.baud = 0x2580; - kl_hdr_ptr->ch_cons_info.flag = 0x1; - kl_hdr_ptr->ch_cons_info.type = 0x300fafa; - kl_hdr_ptr->ch_cons_info.nasid = 0x0; - kl_hdr_ptr->ch_cons_info.wid = 0xf; - kl_hdr_ptr->ch_cons_info.npci = 0x4; - kl_hdr_ptr->ch_cons_info.baseio_nic = 0x0; - /* * We need to know whether we are booting from PROM or * boot from disk. @@ -162,520 +57,44 @@ if (linux_klcfg->ch_magic == 0xbeedbabe) { return; } else { - linux_klcfg = kl_hdr_ptr; + panic("klgraph_hack_init: Unable to locate KLCONFIG TABLE\n"); } - /* - * lboard KLTYPE_IP35 - */ - lb_ptr = kmalloc(sizeof(lboard_t), GFP_KERNEL); - kl_hdr_ptr->ch_board_info = (klconf_off_t) lb_ptr; - temp_ptr = lb_ptr; - printk("First Lboard = %p\n", temp_ptr); - - lb_ptr->brd_next = 0; - lb_ptr->struct_type = 0x1; - lb_ptr->brd_type = 0x11; - lb_ptr->brd_sversion = 0x3; - lb_ptr->brd_brevision = 0x1; - lb_ptr->brd_promver = 0x1; - lb_ptr->brd_promver = 0x1; - lb_ptr->brd_slot = 0x0; - lb_ptr->brd_debugsw = 0x0; - lb_ptr->brd_module = 0x145; - lb_ptr->brd_partition = 0x0; - lb_ptr->brd_diagval = 0x0; - lb_ptr->brd_diagparm = 0x0; - lb_ptr->brd_inventory = 0x0; - lb_ptr->brd_numcompts = 0x5; - lb_ptr->brd_nic = 0x2a0aed35; - lb_ptr->brd_nasid = 0x0; - lb_ptr->brd_errinfo = 0x0; - lb_ptr->brd_parent = 0x0; - lb_ptr->brd_graph_link = (devfs_handle_t)0x26; - lb_ptr->brd_owner = 0x0; - lb_ptr->brd_nic_flags = 0x0; - memcpy(&lb_ptr->brd_name[0], "IP35", 4); - - /* - * Hub Component - */ - klcomp_ptr = kmalloc(sizeof(klcomp_t), GFP_KERNEL); - klhub_ptr = (klhub_t *)klcomp_ptr; - klinfo_ptr = (klinfo_t *)klcomp_ptr; - lb_ptr->brd_compts[0] = (klconf_off_t)klcomp_ptr; - printk("hub info = %p lboard = %p\n", klhub_ptr, lb_ptr); - - klinfo_ptr = (klinfo_t *)klhub_ptr; - klinfo_ptr->struct_type = 0x2; - klinfo_ptr->struct_version = 0x1; - klinfo_ptr->flags = 0x1; - klinfo_ptr->revision = 0x1; - klinfo_ptr->diagval = 0x0; - klinfo_ptr->diagparm = 0x0; - klinfo_ptr->inventory = 0x0; - klinfo_ptr->partid = 0x0; - klinfo_ptr->nic = 0x2a0aed35; - klinfo_ptr->physid = 0x0; - klinfo_ptr->virtid = 0x0; - klinfo_ptr->widid = 0x0; - klinfo_ptr->nasid = 0x0; - - klhub_ptr->hub_flags = 0x0; - klhub_ptr->hub_port.port_nasid = (nasid_t)0x0ffffffff; - klhub_ptr->hub_port.port_flag = 0x0; - klhub_ptr->hub_port.port_offset = 0x0; - klhub_ptr->hub_box_nic = 0x0; - klhub_ptr->hub_mfg_nic = 0x3f420; - klhub_ptr->hub_speed = 0xbebc200; - - /* - * Memory Component - */ - klcomp_ptr = kmalloc(sizeof(klcomp_t), GFP_KERNEL); - klinfo_ptr = (klinfo_t *)klcomp_ptr; - lb_ptr->brd_compts[1] = (klconf_off_t)klcomp_ptr; - - klinfo_ptr->struct_type = 0x3; - klinfo_ptr->struct_version = 0x2; - klinfo_ptr->flags = 0x1; - klinfo_ptr->revision = 0xff; - klinfo_ptr->diagval = 0x0; - klinfo_ptr->diagparm = 0x0; - klinfo_ptr->inventory = 0x0; - klinfo_ptr->partid = 0x0; - klinfo_ptr->nic = 0xffffffffffffffff; - klinfo_ptr->physid = 0xff; - klinfo_ptr->virtid = 0xffffffff; - klinfo_ptr->widid = 0x0; - klinfo_ptr->nasid = 0x0; - - /* - * KLSTRUCT_HUB_UART Component - */ - klcomp_ptr = kmalloc(sizeof(klcomp_t), GFP_KERNEL); - klinfo_ptr = (klinfo_t *)klcomp_ptr; - lb_ptr->brd_compts[2] = (klconf_off_t)klcomp_ptr; - - klinfo_ptr->struct_type = 0x11; - klinfo_ptr->struct_version = 0x1; - klinfo_ptr->flags = 0x31; - klinfo_ptr->revision = 0xff; - klinfo_ptr->diagval = 0x0; - klinfo_ptr->diagparm = 0x0; - klinfo_ptr->inventory = 0x0; - klinfo_ptr->partid = 0x0; - klinfo_ptr->nic = 0xffffffffffffffff; - klinfo_ptr->physid = 0x0; - klinfo_ptr->virtid = 0x0; - klinfo_ptr->widid = 0x0; - klinfo_ptr->nasid = 0x0; - - /* - * KLSTRUCT_CPU Component - */ - klcomp_ptr = kmalloc(sizeof(klcomp_t), GFP_KERNEL); - klinfo_ptr = (klinfo_t *)klcomp_ptr; - lb_ptr->brd_compts[3] = (klconf_off_t)klcomp_ptr; - - klinfo_ptr->struct_type = 0x1; - klinfo_ptr->struct_version = 0x2; - klinfo_ptr->flags = 0x1; - klinfo_ptr->revision = 0xff; - klinfo_ptr->diagval = 0x0; - klinfo_ptr->diagparm = 0x0; - klinfo_ptr->inventory = 0x0; - klinfo_ptr->partid = 0x0; - klinfo_ptr->nic = 0xffffffffffffffff; - klinfo_ptr->physid = 0x0; - klinfo_ptr->virtid = 0x0; - klinfo_ptr->widid = 0x0; - klinfo_ptr->nasid = 0x0; - - /* - * KLSTRUCT_CPU Component - */ - klcomp_ptr = kmalloc(sizeof(klcomp_t), GFP_KERNEL); - klinfo_ptr = (klinfo_t *)klcomp_ptr; - lb_ptr->brd_compts[4] = (klconf_off_t)klcomp_ptr; - - klinfo_ptr->struct_type = 0x1; - klinfo_ptr->struct_version = 0x2; - klinfo_ptr->flags = 0x1; - klinfo_ptr->revision = 0xff; - klinfo_ptr->diagval = 0x0; - klinfo_ptr->diagparm = 0x0; - klinfo_ptr->inventory = 0x0; - klinfo_ptr->partid = 0x0; - klinfo_ptr->nic = 0xffffffffffffffff; - klinfo_ptr->physid = 0x1; - klinfo_ptr->virtid = 0x1; - klinfo_ptr->widid = 0x0; - klinfo_ptr->nasid = 0x0; - - lb_ptr->brd_compts[5] = 0; /* Set the next one to 0 .. end */ - lb_ptr->brd_numcompts = 5; /* 0 to 4 */ - - /* - * lboard(0x42) KLTYPE_PBRICK_XBOW - */ - lb_ptr = kmalloc(sizeof(lboard_t), GFP_KERNEL); - temp_ptr->brd_next = (klconf_off_t)lb_ptr; /* Let the previous point at the new .. */ - temp_ptr = lb_ptr; - printk("Second Lboard = %p\n", temp_ptr); - - lb_ptr->brd_next = 0; - lb_ptr->struct_type = 0x1; - lb_ptr->brd_type = 0x42; - lb_ptr->brd_sversion = 0x2; - lb_ptr->brd_brevision = 0x0; - lb_ptr->brd_promver = 0x1; - lb_ptr->brd_promver = 0x1; - lb_ptr->brd_slot = 0x0; - lb_ptr->brd_debugsw = 0x0; - lb_ptr->brd_module = 0x145; - lb_ptr->brd_partition = 0x1; - lb_ptr->brd_diagval = 0x0; - lb_ptr->brd_diagparm = 0x0; - lb_ptr->brd_inventory = 0x0; - lb_ptr->brd_numcompts = 0x1; - lb_ptr->brd_nic = 0xffffffffffffffff; - lb_ptr->brd_nasid = 0x0; - lb_ptr->brd_errinfo = 0x0; - lb_ptr->brd_parent = (struct lboard_s *)0x9600000000030070; - lb_ptr->brd_graph_link = (devfs_handle_t)0xffffffff; - lb_ptr->brd_owner = 0x0; - lb_ptr->brd_nic_flags = 0x0; - memcpy(&lb_ptr->brd_name[0], "IOBRICK", 7); - - /* - * KLSTRUCT_XBOW Component - */ - klcomp_ptr = kmalloc(sizeof(klcomp_t), GFP_KERNEL); - memset(klcomp_ptr, 0, sizeof(klcomp_t)); - klxbow_ptr = (klxbow_t *)klcomp_ptr; - klinfo_ptr = (klinfo_t *)klcomp_ptr; - lb_ptr->brd_compts[0] = (klconf_off_t)klcomp_ptr; - printk("xbow_p 0x%p\n", klcomp_ptr); - - klinfo_ptr->struct_type = 0x4; - klinfo_ptr->struct_version = 0x1; - klinfo_ptr->flags = 0x1; - klinfo_ptr->revision = 0x2; - klinfo_ptr->diagval = 0x0; - klinfo_ptr->diagparm = 0x0; - klinfo_ptr->inventory = 0x0; - klinfo_ptr->partid = 0x0; - klinfo_ptr->nic = 0xffffffffffffffff; - klinfo_ptr->physid = 0xff; - klinfo_ptr->virtid = 0x0; - klinfo_ptr->widid = 0x0; - klinfo_ptr->nasid = 0x0; - - klxbow_ptr->xbow_master_hub_link = 0xb; - klxbow_ptr->xbow_port_info[0].port_nasid = 0x0; - klxbow_ptr->xbow_port_info[0].port_flag = 0x0; - klxbow_ptr->xbow_port_info[0].port_offset = 0x0; - - klxbow_ptr->xbow_port_info[1].port_nasid = 0x401; - klxbow_ptr->xbow_port_info[1].port_flag = 0x0; - klxbow_ptr->xbow_port_info[1].port_offset = 0x0; - - klxbow_ptr->xbow_port_info[2].port_nasid = 0x0; - klxbow_ptr->xbow_port_info[2].port_flag = 0x0; - klxbow_ptr->xbow_port_info[2].port_offset = 0x0; - - klxbow_ptr->xbow_port_info[3].port_nasid = 0x0; /* ffffffff */ - klxbow_ptr->xbow_port_info[3].port_flag = 0x6; - klxbow_ptr->xbow_port_info[3].port_offset = 0x30070; - - klxbow_ptr->xbow_port_info[4].port_nasid = 0x0; /* ffffff00; */ - klxbow_ptr->xbow_port_info[4].port_flag = 0x0; - klxbow_ptr->xbow_port_info[4].port_offset = 0x0; - - klxbow_ptr->xbow_port_info[5].port_nasid = 0x0; - klxbow_ptr->xbow_port_info[5].port_flag = 0x0; - klxbow_ptr->xbow_port_info[5].port_offset = 0x0; - klxbow_ptr->xbow_port_info[6].port_nasid = 0x0; - klxbow_ptr->xbow_port_info[6].port_flag = 0x5; - klxbow_ptr->xbow_port_info[6].port_offset = 0x30210; - klxbow_ptr->xbow_port_info[7].port_nasid = 0x3; - klxbow_ptr->xbow_port_info[7].port_flag = 0x5; - klxbow_ptr->xbow_port_info[7].port_offset = 0x302e0; - - lb_ptr->brd_compts[1] = 0; - lb_ptr->brd_numcompts = 1; - - - /* - * lboard KLTYPE_PBRICK - */ - lb_ptr = kmalloc(sizeof(lboard_t), GFP_KERNEL); - temp_ptr->brd_next = (klconf_off_t)lb_ptr; /* Let the previous point at the new .. */ - temp_ptr = lb_ptr; - printk("Third Lboard %p\n", lb_ptr); - - lb_ptr->brd_next = 0; - lb_ptr->struct_type = 0x1; - lb_ptr->brd_type = 0x72; - lb_ptr->brd_sversion = 0x2; - lb_ptr->brd_brevision = 0x0; - lb_ptr->brd_promver = 0x1; - lb_ptr->brd_promver = 0x41; - lb_ptr->brd_slot = 0xe; - lb_ptr->brd_debugsw = 0x0; - lb_ptr->brd_module = 0x145; - lb_ptr->brd_partition = 0x1; - lb_ptr->brd_diagval = 0x0; - lb_ptr->brd_diagparm = 0x0; - lb_ptr->brd_inventory = 0x0; - lb_ptr->brd_numcompts = 0x1; - lb_ptr->brd_nic = 0x30e3fd; - lb_ptr->brd_nasid = 0x0; - lb_ptr->brd_errinfo = 0x0; - lb_ptr->brd_parent = (struct lboard_s *)0x9600000000030140; - lb_ptr->brd_graph_link = (devfs_handle_t)0xffffffff; - lb_ptr->brd_owner = 0x0; - lb_ptr->brd_nic_flags = 0x0; - memcpy(&lb_ptr->brd_name[0], "IP35", 4); - - /* - * KLSTRUCT_BRI Component - */ - klcomp_ptr = kmalloc(sizeof(klcomp_t), GFP_KERNEL); - klbri_ptr = (klbri_t *)klcomp_ptr; - klinfo_ptr = (klinfo_t *)klcomp_ptr; - lb_ptr->brd_compts[0] = (klconf_off_t)klcomp_ptr; - - klinfo_ptr->struct_type = 0x5; - klinfo_ptr->struct_version = 0x2; - klinfo_ptr->flags = 0x1; - klinfo_ptr->revision = 0x2; - klinfo_ptr->diagval = 0x0; - klinfo_ptr->diagparm = 0x0; - klinfo_ptr->inventory = 0x0; - klinfo_ptr->partid = 0xd002; - klinfo_ptr->nic = 0x30e3fd; - klinfo_ptr->physid = 0xe; - klinfo_ptr->virtid = 0xe; - klinfo_ptr->widid = 0xe; - klinfo_ptr->nasid = 0x0; - - klbri_ptr->bri_eprominfo = 0xff; - klbri_ptr->bri_bustype = 0x7; - klbri_ptr->bri_mfg_nic = 0x3f4a8; - - lb_ptr->brd_compts[1] = 0; - lb_ptr->brd_numcompts = 1; - - /* - * lboard KLTYPE_PBRICK - */ - lb_ptr = kmalloc(sizeof(lboard_t), GFP_KERNEL); - temp_ptr->brd_next = (klconf_off_t)lb_ptr; /* Let the previous point at the new .. */ - temp_ptr = lb_ptr; - printk("Fourth Lboard %p\n", lb_ptr); - - lb_ptr->brd_next = 0x0; - lb_ptr->struct_type = 0x1; - lb_ptr->brd_type = 0x72; - lb_ptr->brd_sversion = 0x2; - lb_ptr->brd_brevision = 0x0; - lb_ptr->brd_promver = 0x1; - lb_ptr->brd_promver = 0x31; - lb_ptr->brd_slot = 0xf; - lb_ptr->brd_debugsw = 0x0; - lb_ptr->brd_module = 0x145; - lb_ptr->brd_partition = 0x1; - lb_ptr->brd_diagval = 0x0; - lb_ptr->brd_diagparm = 0x0; - lb_ptr->brd_inventory = 0x0; - lb_ptr->brd_numcompts = 0x6; - lb_ptr->brd_nic = 0x30e3fd; - lb_ptr->brd_nasid = 0x0; - lb_ptr->brd_errinfo = 0x0; - lb_ptr->brd_parent = (struct lboard_s *)0x9600000000030140; - lb_ptr->brd_graph_link = (devfs_handle_t)0xffffffff; - lb_ptr->brd_owner = 0x0; - lb_ptr->brd_nic_flags = 0x0; - memcpy(&lb_ptr->brd_name[0], "IP35", 4); - - - /* - * KLSTRUCT_BRI Component - */ - klcomp_ptr = kmalloc(sizeof(klcomp_t), GFP_KERNEL); - klbri_ptr = (klbri_t *)klcomp_ptr; - klinfo_ptr = (klinfo_t *)klcomp_ptr; - lb_ptr->brd_compts[0] = (klconf_off_t)klcomp_ptr; - - klinfo_ptr->struct_type = 0x5; - klinfo_ptr->struct_version = 0x2; - klinfo_ptr->flags = 0x1; - klinfo_ptr->revision = 0x2; - klinfo_ptr->diagval = 0x0; - klinfo_ptr->diagparm = 0x0; - klinfo_ptr->inventory = 0x0; - klinfo_ptr->partid = 0xd002; - klinfo_ptr->nic = 0x30e3fd; - klinfo_ptr->physid = 0xf; - klinfo_ptr->virtid = 0xf; - klinfo_ptr->widid = 0xf; - klinfo_ptr->nasid = 0x0; - - klbri_ptr->bri_eprominfo = 0xff; - klbri_ptr->bri_bustype = 0x7; - klbri_ptr->bri_mfg_nic = 0x3f528; - - /* - * KLSTRUCT_SCSI component - */ - klcomp_ptr = kmalloc(sizeof(klcomp_t), GFP_KERNEL); - klinfo_ptr = (klinfo_t *)klcomp_ptr; - lb_ptr->brd_compts[1] = (klconf_off_t)klcomp_ptr; - - klinfo_ptr->struct_type = 0xb; - klinfo_ptr->struct_version = 0x1; - klinfo_ptr->flags = 0x31; - klinfo_ptr->revision = 0x5; - klinfo_ptr->diagval = 0x0; - klinfo_ptr->diagparm = 0x0; - klinfo_ptr->inventory = 0x0; - klinfo_ptr->partid = 0x0; - klinfo_ptr->nic = 0xffffffffffffffff; - klinfo_ptr->physid = 0x1; - klinfo_ptr->virtid = 0x0; - klinfo_ptr->widid = 0xf; - klinfo_ptr->nasid = 0x0; - - /* - * KLSTRUCT_IOC3 Component - */ - klcomp_ptr = kmalloc(sizeof(klcomp_t), GFP_KERNEL); - klioc3_ptr = (klioc3_t *)klcomp_ptr; - klinfo_ptr = (klinfo_t *)klcomp_ptr; - lb_ptr->brd_compts[2] = (klconf_off_t)klcomp_ptr; - - klinfo_ptr->struct_type = 0x6; - klinfo_ptr->struct_version = 0x1; - klinfo_ptr->flags = 0x31; - klinfo_ptr->revision = 0x1; - klinfo_ptr->diagval = 0x0; - klinfo_ptr->diagparm = 0x0; - klinfo_ptr->inventory = 0x0; - klinfo_ptr->partid = 0x0; - klinfo_ptr->nic = 0xffffffffffffffff; - klinfo_ptr->physid = 0x4; - klinfo_ptr->virtid = 0x0; - klinfo_ptr->widid = 0xf; - klinfo_ptr->nasid = 0x0; - - klioc3_ptr->ioc3_ssram = 0x0; - klioc3_ptr->ioc3_nvram = 0x0; - - /* - * KLSTRUCT_UNKNOWN Component - */ - klcomp_ptr = kmalloc(sizeof(klcomp_t), GFP_KERNEL); - klinfo_ptr = (klinfo_t *)klcomp_ptr; - lb_ptr->brd_compts[3] = (klconf_off_t)klcomp_ptr; - - klinfo_ptr->struct_type = 0x0; - klinfo_ptr->struct_version = 0x1; - klinfo_ptr->flags = 0x31; - klinfo_ptr->revision = 0xff; - klinfo_ptr->diagval = 0x0; - klinfo_ptr->diagparm = 0x0; - klinfo_ptr->inventory = 0x0; - klinfo_ptr->partid = 0x0; - klinfo_ptr->nic = 0xffffffffffffffff; - klinfo_ptr->physid = 0x5; - klinfo_ptr->virtid = 0x0; - klinfo_ptr->widid = 0xf; - klinfo_ptr->nasid = 0x0; - - /* - * KLSTRUCT_SCSI Component - */ - klcomp_ptr = kmalloc(sizeof(klcomp_t), GFP_KERNEL); - klinfo_ptr = (klinfo_t *)klcomp_ptr; - lb_ptr->brd_compts[4] = (klconf_off_t)klcomp_ptr; - - klinfo_ptr->struct_type = 0xb; - klinfo_ptr->struct_version = 0x1; - klinfo_ptr->flags = 0x31; - klinfo_ptr->revision = 0x1; - klinfo_ptr->diagval = 0x0; - klinfo_ptr->diagparm = 0x0; - klinfo_ptr->inventory = 0x0; - klinfo_ptr->partid = 0x0; - klinfo_ptr->nic = 0xffffffffffffffff; - klinfo_ptr->physid = 0x6; - klinfo_ptr->virtid = 0x5; - klinfo_ptr->widid = 0xf; - klinfo_ptr->nasid = 0x0; - - /* - * KLSTRUCT_UNKNOWN - */ - klcomp_ptr = kmalloc(sizeof(klcomp_t), GFP_KERNEL); - klinfo_ptr = (klinfo_t *)klcomp_ptr; - lb_ptr->brd_compts[5] = (klconf_off_t)klcomp_ptr; - - klinfo_ptr->struct_type = 0x0; - klinfo_ptr->struct_version = 0x1; - klinfo_ptr->flags = 0x31; - klinfo_ptr->revision = 0xff; - klinfo_ptr->diagval = 0x0; - klinfo_ptr->diagparm = 0x0; - klinfo_ptr->inventory = 0x0; - klinfo_ptr->partid = 0x0; - klinfo_ptr->nic = 0xffffffffffffffff; - klinfo_ptr->physid = 0x7; - klinfo_ptr->virtid = 0x0; - klinfo_ptr->widid = 0xf; - klinfo_ptr->nasid = 0x0; - - lb_ptr->brd_compts[6] = 0; - lb_ptr->brd_numcompts = 6; - } -#ifdef BRINGUP +#ifdef DEFINE_DUMP_RTNS /* * these were useful for printing out registers etc * during bringup */ -void +static void xdump(long long *addr, int count) { int ii; volatile long long *xx = addr; for ( ii = 0; ii < count; ii++, xx++ ) { - printk("0x%p : 0x%p\n", xx, *xx); + printk("0x%p : 0x%p\n", (void *)xx, (void *)*xx); } } -void +static void xdump32(unsigned int *addr, int count) { int ii; volatile unsigned int *xx = addr; for ( ii = 0; ii < count; ii++, xx++ ) { - printk("0x%p : 0x%0x\n", xx, *xx); + printk("0x%p : 0x%0x\n", (void *)xx, (int)*xx); } } - - -void +static void clear_ii_error(void) { volatile long long *tmp; @@ -716,8 +135,8 @@ } -void -dump_ii() +static void +dump_ii(void) { printk("===== Dump the II regs =====\n"); xdump((long long *)0xc0000a0001c00000, 2); @@ -746,23 +165,8 @@ xdump((long long *)0xc0000a000f000000, 1); } -void -dump_lb() -{ - printk("===== Dump the LB regs =====\n"); - xdump((long long *)0xc0000a0001e00000, 1); - xdump((long long *)0xc0000a0001e04000, 13); - xdump((long long *)0xc0000a0001e04100, 2); - xdump((long long *)0xc0000a0001e04200, 2); - xdump((long long *)0xc0000a0001e08000, 5); - xdump((long long *)0xc0000a0001e08040, 2); - xdump((long long *)0xc0000a0001e08050, 3); - xdump((long long *)0xc0000a0001e0c000, 3); - xdump((long long *)0xc0000a0001e0c020, 4); -} - -void -dump_crossbow() +static void +dump_crossbow(void) { printk("===== Dump the Crossbow regs =====\n"); clear_ii_error(); @@ -793,4 +197,4 @@ } -#endif /* BRINGUP */ +#endif /* DEFINE_DUMP_RTNS */ diff -urN linux-2.4.18/arch/ia64/sn/io/l1.c lia64-2.4/arch/ia64/sn/io/l1.c --- linux-2.4.18/arch/ia64/sn/io/l1.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/l1.c Tue Feb 26 13:19:34 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992-1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ /* In general, this file is organized in a hierarchy from lower-level @@ -16,18 +15,12 @@ * System controller "message" interface (allows multiplexing * of various kinds of requests and responses with * console I/O) - * Console interfaces (there are two): - * (1) "elscuart", used in the IP35prom and (maybe) some - * debugging situations elsewhere, and - * (2) "l1_cons", the glue that allows the L1 to act + * Console interface: + * "l1_cons", the glue that allows the L1 to act * as the system console for the stdio libraries * * Routines making use of the system controller "message"-style interface - * can be found in l1_command.c. Their names are leftover from early SN0, - * when the "module system controller" (msc) was known as the "entry level - * system controller" (elsc). The names and signatures of those functions - * remain unchanged in order to keep the SN0 -> SN1 system controller - * changes fairly localized. + * can be found in l1_command.c. */ @@ -35,45 +28,32 @@ #include #include #include +#include #include +#include #include #include #include #include #include #include -#include #include #include #include #include #include +#include +#include +#include +#include -#include - -/* - * Delete this when atomic_clear is part of atomic.h. - */ -static __inline__ int -atomic_clear (int i, atomic_t *v) -{ - __s32 old, new; - - do { - old = atomic_read(v); - new = old & ~i; - } while (ia64_cmpxchg("acq", v, old, new, sizeof(atomic_t)) != old); - return new; -} - -#if defined(EEPROM_DEBUG) -#define db_printf(x) printk x -#else -#define db_printf(x) +#if defined(CONFIG_IA64_SGI_SN2) +#define USE_SAL_CONSOLE_IO 1 /* DON'T un-def this for the simulator... */ #endif -// From irix/kern/sys/SN/SN1/bdrkhspecregs.h -#define HSPEC_UART_0 0x00000080 /* UART Registers */ +/* Make all console writes atomic */ +#define SYNC_CONSOLE_WRITE 1 + /********************************************************************* * Hardware-level (UART) driver routines. @@ -81,28 +61,33 @@ /* macros for reading/writing registers */ -#define LD(x) (*(volatile uint64_t *)(x)) -#define SD(x, v) (LD(x) = (uint64_t) (v)) +#define LD(x) (*(volatile uint64_t *)(x)) +#define SD(x, v) (LD(x) = (uint64_t) (v)) /* location of uart receive/xmit data register */ -#define L1_UART_BASE(n) ((ulong)REMOTE_HSPEC_ADDR((n), HSPEC_UART_0)) -#define LOCAL_HUB LOCAL_HUB_ADDR -#define LOCK_HUB REMOTE_HUB_ADDR - -#define ADDR_L1_REG(n, r) \ - (L1_UART_BASE(n) | ( (r) << 3 )) +#if defined(CONFIG_IA64_SGI_SN1) +#define L1_UART_BASE(n) ((ulong)REMOTE_HSPEC_ADDR((n), 0x00000080)) +#define LOCK_HUB REMOTE_HUB_ADDR +#elif defined(CONFIG_IA64_SGI_SN2) +#define L1_UART_BASE(n) ((ulong)REMOTE_HUB((n), SH_JUNK_BUS_UART0)) +#define LOCK_HUB REMOTE_HUB +typedef u64 rtc_time_t; +#endif -#define READ_L1_UART_REG(n, r) \ - ( LD(ADDR_L1_REG((n), (r))) ) -#define WRITE_L1_UART_REG(n, r, v) \ - ( SD(ADDR_L1_REG((n), (r)), (v)) ) +#define ADDR_L1_REG(n, r) ( L1_UART_BASE(n) | ( (r) << 3 ) ) +#define READ_L1_UART_REG(n, r) ( LD(ADDR_L1_REG((n), (r))) ) +#define WRITE_L1_UART_REG(n, r, v) ( SD(ADDR_L1_REG((n), (r)), (v)) ) + +/* upper layer interface calling methods */ +#define SERIAL_INTERRUPT_MODE 0 +#define SERIAL_POLLED_MODE 1 /* UART-related #defines */ #define UART_BAUD_RATE 57600 -#define UART_FIFO_DEPTH 0xf0 +#define UART_FIFO_DEPTH 16 #define UART_DELAY_SPAN 10 #define UART_PUTC_TIMEOUT 50000 #define UART_INIT_TIMEOUT 100000 @@ -114,17 +99,32 @@ #define UART_NO_CHAR (-3) #define UART_VECTOR (-4) -#ifdef BRINGUP -#define UART_DELAY(x) { int i; i = x * 1000; while (--i); } -#else -#define UART_DELAY(x) us_delay(x) -#endif +#define UART_DELAY(x) udelay(x) + +/* Some debug counters */ +#define L1C_INTERRUPTS 0 +#define L1C_OUR_R_INTERRUPTS 1 +#define L1C_OUR_X_INTERRUPTS 2 +#define L1C_SEND_CALLUPS 3 +#define L1C_RECEIVE_CALLUPS 4 +#define L1C_SET_BAUD 5 +#define L1C_ALREADY_LOCKED L1C_SET_BAUD +#define L1C_R_IRQ 6 +#define L1C_R_IRQ_RET 7 +#define L1C_LOCK_TIMEOUTS 8 +#define L1C_LOCK_COUNTER 9 +#define L1C_UNLOCK_COUNTER 10 +#define L1C_REC_STALLS 11 +#define L1C_CONNECT_CALLS 12 +#define L1C_SIZE L1C_CONNECT_CALLS /* Set to the last one */ + +uint64_t L1_collectibles[L1C_SIZE + 1]; + /* * Some macros for handling Endian-ness */ -#ifdef LITTLE_ENDIAN #define COPY_INT_TO_BUFFER(_b, _i, _n) \ { \ _b[_i++] = (_n >> 24) & 0xff; \ @@ -149,42 +149,64 @@ _xyz[1] = _b[_i++]; \ _xyz[0] = _b[_i++]; \ } -#else /* BIG_ENDIAN */ - -extern char *bcopy(const char * src, char * dest, int count); -#define COPY_INT_TO_BUFFER(_b, _i, _n) \ - { \ - bcopy((char *)&_n, _b, sizeof(_n)); \ - _i += sizeof(_n); \ - } +void snia_kmem_free(void *where, int size); -#define COPY_BUFFER_TO_INT(_b, _i, _n) \ - { \ - bcopy(&_b[_i], &_n, sizeof(_n)); \ - _i += sizeof(_n); \ - } +#define ALREADY_LOCKED 1 +#define NOT_LOCKED 0 +static int early_l1_serial_out(nasid_t, char *, int, int /* defines above*/ ); -#define COPY_BUFFER_TO_BUFFER(_b, _i, _bn) \ - { \ - bcopy(&(_b[_i]), _bn, sizeof(int)); \ - _i += sizeof(int); \ - } -#endif /* LITTLE_ENDIAN */ +#define BCOPY(x,y,z) memcpy(y,x,z) -void kmem_free(void *where, int size); +uint8_t L1_interrupts_connected; /* Non-zero when we are in interrupt mode */ -#define BCOPY(x,y,z) memcpy(y,x,z) /* * Console locking defines and functions. * */ -#ifdef BRINGUP -#define FORCE_CONSOLE_NASID +uint8_t L1_cons_is_inited = 0; /* non-zero when console is init'd */ +nasid_t Master_console_nasid = (nasid_t)-1; +extern nasid_t console_nasid; + +#if defined(CONFIG_IA64_SGI_SN1) +u64 ia64_sn_get_console_nasid(void); #endif +inline nasid_t +get_master_nasid(void) +{ +#if defined(CONFIG_IA64_SGI_SN1) + nasid_t nasid = Master_console_nasid; + + if ( nasid == (nasid_t)-1 ) { + nasid = (nasid_t)ia64_sn_get_console_nasid(); + if ( (nasid < 0) || (nasid >= MAX_NASIDS) ) { + /* Out of bounds, use local */ + console_nasid = nasid = get_nasid(); + } + else { + /* Got a valid nasid, set the console_nasid */ + char xx[100]; +/* zzzzzz - force nasid to 0 for now */ + sprintf(xx, "Master console is set to nasid %d (%d)\n", 0, (int)nasid); +nasid = 0; +/* end zzzzzz */ + xx[99] = (char)0; + early_l1_serial_out(nasid, xx, strlen(xx), NOT_LOCKED); + Master_console_nasid = console_nasid = nasid; + } + } + return(nasid); +#else + return((nasid_t)0); +#endif /* CONFIG_IA64_SGI_SN1 */ +} + + +#if defined(CONFIG_IA64_SGI_SN1) + #define HUB_LOCK 16 #define PRIMARY_LOCK_TIMEOUT 10000000 @@ -199,7 +221,6 @@ #define RTC_TIME_MAX ((rtc_time_t) ~0ULL) - /* * primary_lock * @@ -295,26 +316,37 @@ #define LOCK_TIMEOUT (0x1500000 * 1) /* 0x1500000 is ~30 sec */ -inline void +void lock_console(nasid_t nasid) { int ret; + /* If we already have it locked, just return */ + L1_collectibles[L1C_LOCK_COUNTER]++; + ret = hub_lock_timeout(nasid, HUB_LOCK, (rtc_time_t)LOCK_TIMEOUT); if ( ret != 0 ) { + L1_collectibles[L1C_LOCK_TIMEOUTS]++; /* timeout */ hub_unlock(nasid, HUB_LOCK); /* If the 2nd lock fails, just pile ahead.... */ hub_lock_timeout(nasid, HUB_LOCK, (rtc_time_t)LOCK_TIMEOUT); + L1_collectibles[L1C_LOCK_TIMEOUTS]++; } } inline void unlock_console(nasid_t nasid) { + L1_collectibles[L1C_UNLOCK_COUNTER]++; hub_unlock(nasid, HUB_LOCK); } +#else /* SN2 */ +inline void lock_console(nasid_t n) {} +inline void unlock_console(nasid_t n) {} + +#endif /* CONFIG_IA64_SGI_SN1 */ int get_L1_baud(void) @@ -325,27 +357,18 @@ /* uart driver functions */ -static void +static inline void uart_delay( rtc_time_t delay_span ) { UART_DELAY( delay_span ); } -#define UART_PUTC_READY(n) ( (READ_L1_UART_REG((n), REG_LSR) & LSR_XHRE) && (READ_L1_UART_REG((n), REG_MSR) & MSR_CTS) ) +#define UART_PUTC_READY(n) (READ_L1_UART_REG((n), REG_LSR) & LSR_XHRE) static int uart_putc( l1sc_t *sc ) { -#ifdef BRINGUP - /* need a delay to avoid dropping chars */ - UART_DELAY(57); -#endif -#ifdef FORCE_CONSOLE_NASID - /* We need this for the console write path _elscuart_flush() -> brl1_send() */ - sc->nasid = 0; -#endif - WRITE_L1_UART_REG( sc->nasid, REG_DAT, - sc->send[sc->sent] ); + WRITE_L1_UART_REG( sc->nasid, REG_DAT, sc->send[sc->sent] ); return UART_SUCCESS; } @@ -356,10 +379,6 @@ u_char lsr_reg = 0; nasid_t nasid = sc->nasid; -#ifdef FORCE_CONSOLE_NASID - nasid = sc->nasid = 0; -#endif - if( (lsr_reg = READ_L1_UART_REG( nasid, REG_LSR )) & (LSR_RCA | LSR_PARERR | LSR_FRMERR) ) { @@ -396,9 +415,10 @@ } } - if ( sc->uart == BRL1_LOCALUART ) + if ( sc->uart == BRL1_LOCALHUB_UART ) lock_console(nasid); + /* Setup for the proper baud rate */ WRITE_L1_UART_REG( nasid, REG_LCR, LCR_DLAB ); uart_delay( UART_DELAY_SPAN ); WRITE_L1_UART_REG( nasid, REG_DLH, (clkdiv >> 8) & 0xff ); @@ -407,6 +427,8 @@ uart_delay( UART_DELAY_SPAN ); /* set operating parameters and set DLAB to 0 */ + + /* 8bit, one stop, clear request to send, auto flow control */ WRITE_L1_UART_REG( nasid, REG_LCR, LCR_BITS8 | LCR_STOP1 ); uart_delay( UART_DELAY_SPAN ); WRITE_L1_UART_REG( nasid, REG_MCR, MCR_RTS | MCR_AFE ); @@ -416,23 +438,28 @@ WRITE_L1_UART_REG( nasid, REG_ICR, 0x0 ); uart_delay( UART_DELAY_SPAN ); - /* enable FIFO mode and reset both FIFOs */ + /* enable FIFO mode and reset both FIFOs, trigger on 1 */ WRITE_L1_UART_REG( nasid, REG_FCR, FCR_FIFOEN ); uart_delay( UART_DELAY_SPAN ); - WRITE_L1_UART_REG( nasid, REG_FCR, - FCR_FIFOEN | FCR_RxFIFO | FCR_TxFIFO ); + WRITE_L1_UART_REG( nasid, REG_FCR, FCR_FIFOEN | FCR_RxFIFO | FCR_TxFIFO | RxLVL0); - if ( sc->uart == BRL1_LOCALUART ) + if ( sc->uart == BRL1_LOCALHUB_UART ) unlock_console(nasid); } /* This requires the console lock */ + +#if defined(CONFIG_IA64_SGI_SN1) + static void uart_intr_enable( l1sc_t *sc, u_char mask ) { u_char lcr_reg, icr_reg; nasid_t nasid = sc->nasid; + if ( sc->uart == BRL1_LOCALHUB_UART ) + lock_console(nasid); + /* make sure that the DLAB bit in the LCR register is 0 */ lcr_reg = READ_L1_UART_REG( nasid, REG_LCR ); @@ -444,6 +471,9 @@ icr_reg = READ_L1_UART_REG( nasid, REG_ICR ); icr_reg |= mask; WRITE_L1_UART_REG( nasid, REG_ICR, icr_reg /*(ICR_RIEN | ICR_TIEN)*/ ); + + if ( sc->uart == BRL1_LOCALHUB_UART ) + unlock_console(nasid); } /* This requires the console lock */ @@ -453,6 +483,9 @@ u_char lcr_reg, icr_reg; nasid_t nasid = sc->nasid; + if ( sc->uart == BRL1_LOCALHUB_UART ) + lock_console(nasid); + /* make sure that the DLAB bit in the LCR register is 0 */ lcr_reg = READ_L1_UART_REG( nasid, REG_LCR ); @@ -464,7 +497,11 @@ icr_reg = READ_L1_UART_REG( nasid, REG_ICR ); icr_reg &= mask; WRITE_L1_UART_REG( nasid, REG_ICR, icr_reg /*(ICR_RIEN | ICR_TIEN)*/ ); + + if ( sc->uart == BRL1_LOCALHUB_UART ) + unlock_console(nasid); } +#endif /* CONFIG_IA64_SGI_SN1 */ #define uart_enable_xmit_intr(sc) \ uart_intr_enable((sc), ICR_TIEN) @@ -511,10 +548,6 @@ net_vec_t path = sc->uart; rtc_time_t expire = rtc_time() + RTR_UART_PUTC_TIMEOUT; -#ifdef FORCE_CONSOLE_NASID - /* We need this for the console write path _elscuart_flush() -> brl1_send() */ - nasid = sc->nasid = 0; -#endif c = (sc->send[sc->sent] & 0xffULL); while( 1 ) @@ -543,10 +576,6 @@ nasid_t nasid = sc->nasid; net_vec_t path = sc->uart; -#ifdef FORCE_CONSOLE_NASID - nasid = sc->nasid = 0; -#endif - READ_RTR_L1_UART_REG( path, nasid, REG_LSR, ®val ); if( regval & (LSR_RCA | LSR_PARERR | LSR_FRMERR) ) { @@ -617,6 +646,15 @@ return 0; } +/********************************************************************* + * locking macros + */ + +#define L1SC_SEND_LOCK(l,p) { if ((l)->uart == BRL1_LOCALHUB_UART) spin_lock_irqsave(&((l)->send_lock),p); } +#define L1SC_SEND_UNLOCK(l,p) { if ((l)->uart == BRL1_LOCALHUB_UART) spin_unlock_irqrestore(&((l)->send_lock), p); } +#define L1SC_RECV_LOCK(l,p) { if ((l)->uart == BRL1_LOCALHUB_UART) spin_lock_irqsave(&((l)->recv_lock), p); } +#define L1SC_RECV_UNLOCK(l,p) { if ((l)->uart == BRL1_LOCALHUB_UART) spin_unlock_irqrestore(&((l)->recv_lock), p); } + /********************************************************************* * subchannel manipulation @@ -626,31 +664,43 @@ * associated with particular subchannels (e.g., receive queues). * */ - -#ifdef SPINLOCKS_WORK -#define SUBCH_LOCK(sc) spin_lock_irq( &((sc)->subch_lock) ) -#define SUBCH_UNLOCK(sc) spin_unlock_irq( &((sc)->subch_lock) ) -#define SUBCH_DATA_LOCK(sbch) spin_lock_irq( &((sbch)->data_lock) ) -#define SUBCH_DATA_UNLOCK(sbch) spin_unlock_irq( &((sbch)->data_lock) ) -#else -#define SUBCH_LOCK(sc) -#define SUBCH_UNLOCK(sc) -#define SUBCH_DATA_LOCK(sbch) -#define SUBCH_DATA_UNLOCK(sbch) -#endif +#define SUBCH_LOCK(sc, p) spin_lock_irqsave( &((sc)->subch_lock), p ) +#define SUBCH_UNLOCK(sc, p) spin_unlock_irqrestore( &((sc)->subch_lock), p ) +#define SUBCH_DATA_LOCK(sbch, p) spin_lock_irqsave( &((sbch)->data_lock), p ) +#define SUBCH_DATA_UNLOCK(sbch, p) spin_unlock_irqrestore( &((sbch)->data_lock), p ) -/* get_myid is an internal function that reads the PI_CPU_NUM - * register of the local bedrock to determine which of the - * four possible CPU's "this" one is +/* + * set a function to be called for subchannel ch in the event of + * a transmission low-water interrupt from the uart */ -static int -get_myid( void ) +void +subch_set_tx_notify( l1sc_t *sc, int ch, brl1_notif_t func ) { - return( LD(LOCAL_HUB(PI_CPU_NUM)) ); + unsigned long pl = 0; + + L1SC_SEND_LOCK( sc, pl ); +#if !defined(SYNC_CONSOLE_WRITE) + if ( func && !sc->send_in_use ) + uart_enable_xmit_intr( sc ); +#endif + sc->subch[ch].tx_notify = func; + L1SC_SEND_UNLOCK(sc, pl ); } +/* + * set a function to be called for subchannel ch when data is received + */ +void +subch_set_rx_notify( l1sc_t *sc, int ch, brl1_notif_t func ) +{ + unsigned long pl = 0; + brl1_sch_t *subch = &(sc->subch[ch]); + SUBCH_DATA_LOCK( subch, pl ); + sc->subch[ch].rx_notify = func; + SUBCH_DATA_UNLOCK( subch, pl ); +} /********************************************************************* * Queue manipulation macros @@ -767,14 +817,16 @@ * brl1_discard_packet is a dummy "receive callback" used to get rid * of packets we don't want */ -void brl1_discard_packet( l1sc_t *sc, int ch ) +void brl1_discard_packet( int dummy0, void *dummy1, struct pt_regs *dummy2, l1sc_t *sc, int ch ) { + unsigned long pl = 0; brl1_sch_t *subch = &sc->subch[ch]; + sc_cq_t *q = subch->iqp; - SUBCH_DATA_LOCK( subch ); + SUBCH_DATA_LOCK( subch, pl ); q->opos = q->ipos; - atomic_clear( &(subch->packet_arrived), ~((unsigned)0) ); - SUBCH_DATA_UNLOCK( subch ); + atomic_set(&(subch->packet_arrived), 0); + SUBCH_DATA_UNLOCK( subch, pl ); } @@ -789,17 +841,15 @@ static int brl1_send_chars( l1sc_t *sc ) { - /* In the kernel, we track the depth of the C brick's UART's + /* We track the depth of the C brick's UART's * fifo in software, and only check if the UART is accepting * characters when our count indicates that the fifo should * be full. * - * For remote (router) UARTs, and also for the local (C brick) - * UART in the prom, we check with the UART before sending every + * For remote (router) UARTs, we check with the UART before sending every * character. */ - if( sc->uart == BRL1_LOCALUART ) - { + if( sc->uart == BRL1_LOCALHUB_UART ) { if( !(sc->fifo_space) && UART_PUTC_READY( sc->nasid ) ) sc->fifo_space = UART_FIFO_DEPTH; @@ -809,16 +859,10 @@ sc->sent++; } } + else { - else - - /* The following applies to all UARTs in the prom, and to remote - * (router) UARTs in the kernel... - */ - -#define TIMEOUT_RETRIES 30 + /* remote (router) UARTs */ - { int result; int tries = 0; @@ -831,7 +875,7 @@ if( result == UART_TIMEOUT ) { tries++; /* send this character in TIMEOUT_RETRIES... */ - if( tries < TIMEOUT_RETRIES ) { + if( tries < 30 /* TIMEOUT_RETRIES */ ) { continue; } /* ...or else... */ @@ -864,33 +908,39 @@ static int brl1_send( l1sc_t *sc, char *msg, int len, u_char type_and_subch, int wait ) { + unsigned long pl = 0; int index; int pkt_len = 0; unsigned short crc = INIT_CRC; char *send_ptr = sc->send; -#ifdef BRINGUP - /* We want to be sure that we are sending the entire packet before returning */ - wait = 1; -#endif - if ( sc->uart == BRL1_LOCALUART ) - lock_console(sc->nasid); - if( sc->send_in_use ) { - if( !wait ) { - if ( sc->uart == BRL1_LOCALUART ) - unlock_console(sc->nasid); - return 0; /* couldn't send anything; wait for buffer to drain */ - } - else { - /* buffer's in use, but we're synchronous I/O, so we're going - * to send whatever's in there right now and take the buffer - */ - while( sc->sent < sc->send_len ) + if( sc->send_in_use && !(wait) ) { + /* We are in the middle of sending, but can wait until done */ + return 0; + } + else if( sc->send_in_use ) { + /* buffer's in use, but we're synchronous I/O, so we're going + * to send whatever's in there right now and take the buffer + */ + int counter = 0; + + if ( sc->uart == BRL1_LOCALHUB_UART ) + lock_console(sc->nasid); + L1SC_SEND_LOCK(sc, pl); + while( sc->sent < sc->send_len ) { brl1_send_chars( sc ); + if ( counter++ > 0xfffff ) { + char *str = "Looping waiting for uart to clear (1)\n"; + early_l1_serial_out(sc->nasid, str, strlen(str), ALREADY_LOCKED); + break; + } } } else { + if ( sc->uart == BRL1_LOCALHUB_UART ) + lock_console(sc->nasid); + L1SC_SEND_LOCK(sc, pl); sc->send_in_use = 1; } *send_ptr++ = BRL1_FLAG_CH; @@ -948,23 +998,100 @@ sc->send_len = pkt_len; sc->sent = 0; - do { - brl1_send_chars( sc ); - } while( (sc->sent < sc->send_len) && wait ); + { + int counter = 0; + do { + brl1_send_chars( sc ); + if ( counter++ > 0xfffff ) { + char *str = "Looping waiting for uart to clear (2)\n"; + early_l1_serial_out(sc->nasid, str, strlen(str), ALREADY_LOCKED); + break; + } + } while( (sc->sent < sc->send_len) && wait ); + } + + if ( sc->uart == BRL1_LOCALHUB_UART ) + unlock_console(sc->nasid); if( sc->sent == sc->send_len ) { - /* success! release the send buffer */ + /* success! release the send buffer and call the callup */ +#if !defined(SYNC_CONSOLE_WRITE) + brl1_notif_t callup; +#endif + sc->send_in_use = 0; + /* call any upper layer that's asked for notification */ +#if defined(XX_SYNC_CONSOLE_WRITE) + /* + * This is probably not a good idea - since the l1_ write func can be called multiple + * time within the callup function. + */ + callup = subch->tx_notify; + if( callup && (SUBCH(type_and_subch) == SC_CONS_SYSTEM) ) { + L1_collectibles[L1C_SEND_CALLUPS]++; + (*callup)(sc->subch[SUBCH(type_and_subch)].irq_frame.bf_irq, + sc->subch[SUBCH(type_and_subch)].irq_frame.bf_dev_id, + sc->subch[SUBCH(type_and_subch)].irq_frame.bf_regs, sc, SUBCH(type_and_subch)); + } +#endif /* SYNC_CONSOLE_WRITE */ } - else if( !wait ) { +#if !defined(SYNC_CONSOLE_WRITE) + else if ( !wait ) { /* enable low-water interrupts so buffer will be drained */ uart_enable_xmit_intr(sc); } - if ( sc->uart == BRL1_LOCALUART ) - unlock_console(sc->nasid); +#endif + + L1SC_SEND_UNLOCK(sc, pl); + return len; } +/* brl1_send_cont is intended to be called as an interrupt service + * routine. It sends until the UART won't accept any more characters, + * or until an error is encountered (in which case we surrender the + * send buffer and give up trying to send the packet). Once the + * last character in the packet has been sent, this routine releases + * the send buffer and calls any previously-registered "low-water" + * output routines. + */ + +#if !defined(SYNC_CONSOLE_WRITE) + +int +brl1_send_cont( l1sc_t *sc ) +{ + unsigned long pl = 0; + int done = 0; + brl1_notif_t callups[BRL1_NUM_SUBCHANS]; + brl1_notif_t *callup; + brl1_sch_t *subch; + int index; + + /* + * I'm not sure how I think this is to be handled - whether the lock is held + * over the interrupt - but it seems like it is a bad idea.... + */ + + if ( sc->uart == BRL1_LOCALHUB_UART ) + lock_console(sc->nasid); + L1SC_SEND_LOCK(sc, pl); + brl1_send_chars( sc ); + done = (sc->sent == sc->send_len); + if( done ) { + sc->send_in_use = 0; +#if !defined(SYNC_CONSOLE_WRITE) + uart_disable_xmit_intr(sc); +#endif + } + if ( sc->uart == BRL1_LOCALHUB_UART ) + unlock_console(sc->nasid); + /* Release the lock */ + L1SC_SEND_UNLOCK(sc, pl); + + return 0; +} +#endif /* SYNC_CONSOLE_WRITE */ /* internal function -- used by brl1_receive to read a character * from the uart and check whether errors occurred in the process. @@ -1046,40 +1173,33 @@ * error (parity error, bad header, bad CRC, etc.). */ -#define STATE_SET(l,s) ((l)->brl1_state = (s)) -#define STATE_GET(l) ((l)->brl1_state) +#define STATE_SET(l,s) ((l)->brl1_state = (s)) +#define STATE_GET(l) ((l)->brl1_state) #define LAST_HDR_SET(l,h) ((l)->brl1_last_hdr = (h)) #define LAST_HDR_GET(l) ((l)->brl1_last_hdr) -#define SEQSTAMP_INCR(l) -#define SEQSTAMP_GET(l) - #define VALID_HDR(c) \ ( SUBCH((c)) <= SC_CONS_SYSTEM \ ? PKT_TYPE((c)) == BRL1_REQUEST \ : ( PKT_TYPE((c)) == BRL1_RESPONSE || \ PKT_TYPE((c)) == BRL1_EVENT ) ) -#define IS_TTY_PKT(l) \ - ( SUBCH(LAST_HDR_GET(l)) <= SC_CONS_SYSTEM ? 1 : 0 ) +#define IS_TTY_PKT(l) ( SUBCH(LAST_HDR_GET(l)) <= SC_CONS_SYSTEM ? 1 : 0 ) int -brl1_receive( l1sc_t *sc ) +brl1_receive( l1sc_t *sc, int mode ) { int result; /* value to be returned by brl1_receive */ int c; /* most-recently-read character */ int done; /* set done to break out of recv loop */ + unsigned long pl = 0, cpl = 0; sc_cq_t *q; /* pointer to queue we're working with */ result = BRL1_NO_MESSAGE; -#ifdef FORCE_CONSOLE_NASID - sc->nasid = 0; -#endif - if ( sc->uart == BRL1_LOCALUART ) - lock_console(sc->nasid); + L1SC_RECV_LOCK(sc, cpl); done = 0; while( !done ) @@ -1210,8 +1330,7 @@ * starting a new packet */ STATE_SET( sc, BRL1_FLAG ); - SEQSTAMP_INCR(sc); /* bump the packet sequence counter */ - + /* if the packet body has less than 2 characters, * it can't be a well-formed packet. Discard it. */ @@ -1258,7 +1377,7 @@ /* get the subchannel and lock it */ subch = &(sc->subch[SUBCH( LAST_HDR_GET(sc) )]); - SUBCH_DATA_LOCK( subch ); + SUBCH_DATA_LOCK( subch, pl ); /* if this isn't a console packet, we need to record * a length byte @@ -1276,14 +1395,16 @@ */ atomic_inc(&(subch->packet_arrived)); callup = subch->rx_notify; - SUBCH_DATA_UNLOCK( subch ); + SUBCH_DATA_UNLOCK( subch, pl ); - if( callup ) { - if ( sc->uart == BRL1_LOCALUART ) - unlock_console(sc->nasid); - (*callup)( sc, SUBCH(LAST_HDR_GET(sc)) ); - if ( sc->uart == BRL1_LOCALUART ) - lock_console(sc->nasid); + if( callup && (mode == SERIAL_INTERRUPT_MODE) ) { + L1SC_RECV_UNLOCK( sc, cpl ); + L1_collectibles[L1C_RECEIVE_CALLUPS]++; + (*callup)( sc->subch[SUBCH(LAST_HDR_GET(sc))].irq_frame.bf_irq, + sc->subch[SUBCH(LAST_HDR_GET(sc))].irq_frame.bf_dev_id, + sc->subch[SUBCH(LAST_HDR_GET(sc))].irq_frame.bf_regs, + sc, SUBCH(LAST_HDR_GET(sc)) ); + L1SC_RECV_LOCK( sc, cpl ); } continue; /* go back for more! */ } @@ -1351,9 +1472,8 @@ } /* end of switch( STATE_GET(sc) ) */ } /* end of while(!done) */ - - if ( sc->uart == BRL1_LOCALUART ) - unlock_console(sc->nasid); + + L1SC_RECV_UNLOCK( sc, cpl ); return result; } @@ -1370,13 +1490,10 @@ brl1_sch_t *subch; bzero( sc, sizeof( *sc ) ); -#ifdef FORCE_CONSOLE_NASID - nasid = (nasid_t)0; -#endif sc->nasid = nasid; sc->uart = uart; - sc->getc_f = (uart == BRL1_LOCALUART ? uart_getc : rtr_uart_getc); - sc->putc_f = (uart == BRL1_LOCALUART ? uart_putc : rtr_uart_putc); + sc->getc_f = (uart == BRL1_LOCALHUB_UART ? uart_getc : rtr_uart_getc); + sc->putc_f = (uart == BRL1_LOCALHUB_UART ? uart_putc : rtr_uart_putc); sc->sol = 1; subch = sc->subch; @@ -1403,9 +1520,8 @@ spin_lock_init( &(subch->data_lock) ); sv_init( &(subch->arrive_sv), &subch->data_lock, SV_MON_SPIN | SV_ORDER_FIFO /* | SV_INTS */ ); subch->tx_notify = NULL; - if( sc->uart == BRL1_LOCALUART ) { - subch->iqp = kmem_zalloc_node( sizeof(sc_cq_t), KM_NOSLEEP, - NASID_TO_COMPACT_NODEID(nasid) ); + if( sc->uart == BRL1_LOCALHUB_UART ) { + subch->iqp = snia_kmem_zalloc_node( sizeof(sc_cq_t), KM_NOSLEEP, NASID_TO_COMPACT_NODEID(nasid) ); ASSERT( subch->iqp ); cq_init( subch->iqp ); subch->rx_notify = NULL; @@ -1440,8 +1556,10 @@ /* initialize synchronization structures */ spin_lock_init( &(sc->subch_lock) ); + spin_lock_init( &(sc->send_lock) ); + spin_lock_init( &(sc->recv_lock) ); - if( sc->uart == BRL1_LOCALUART ) { + if( sc->uart == BRL1_LOCALHUB_UART ) { uart_init( sc, UART_BAUD_RATE ); } else { @@ -1461,93 +1579,574 @@ } } +/********************************************************************* + * These are interrupt-related functions used in the kernel to service + * the L1. + */ + +/* + * brl1_intrd is the function which is called on a console interrupt. + */ -/* These are functions to use from serial_in/out when in protocol - * mode to send and receive uart control regs. These are external - * interfaces into the protocol driver. +#if defined(CONFIG_IA64_SGI_SN1) + +static void +brl1_intrd(int irq, void *dev_id, struct pt_regs *stuff) +{ + u_char isr_reg; + l1sc_t *sc = get_elsc(); + int ret; + + L1_collectibles[L1C_INTERRUPTS]++; + isr_reg = READ_L1_UART_REG(sc->nasid, REG_ISR); + + /* Save for callup args in console */ + sc->subch[SC_CONS_SYSTEM].irq_frame.bf_irq = irq; + sc->subch[SC_CONS_SYSTEM].irq_frame.bf_dev_id = dev_id; + sc->subch[SC_CONS_SYSTEM].irq_frame.bf_regs = stuff; + +#if defined(SYNC_CONSOLE_WRITE) + while( isr_reg & ISR_RxRDY ) +#else + while( isr_reg & (ISR_RxRDY | ISR_TxRDY) ) +#endif + { + if( isr_reg & ISR_RxRDY ) { + L1_collectibles[L1C_OUR_R_INTERRUPTS]++; + ret = brl1_receive(sc, SERIAL_INTERRUPT_MODE); + if ( (ret != BRL1_VALID) && (ret != BRL1_NO_MESSAGE) && (ret != BRL1_PROTOCOL) && (ret != BRL1_CRC) ) + L1_collectibles[L1C_REC_STALLS] = ret; + } +#if !defined(SYNC_CONSOLE_WRITE) + if( (isr_reg & ISR_TxRDY) || (sc->send_in_use && UART_PUTC_READY(sc->nasid)) ) { + L1_collectibles[L1C_OUR_X_INTERRUPTS]++; + brl1_send_cont(sc); + } +#endif /* SYNC_CONSOLE_WRITE */ + isr_reg = READ_L1_UART_REG(sc->nasid, REG_ISR); + } +} +#endif /* CONFIG_IA64_SGI_SN1 */ + + +/* + * Install a callback function for the system console subchannel + * to allow an upper layer to be notified when the send buffer + * has been emptied. + */ +static inline void +l1_tx_notif( brl1_notif_t func ) +{ + subch_set_tx_notify( &NODEPDA(NASID_TO_COMPACT_NODEID(get_master_nasid()))->module->elsc, + SC_CONS_SYSTEM, func ); +} + + +/* + * Install a callback function for the system console subchannel + * to allow an upper layer to be notified when a packet has been + * received. + */ +static inline void +l1_rx_notif( brl1_notif_t func ) +{ + subch_set_rx_notify( &NODEPDA(NASID_TO_COMPACT_NODEID(get_master_nasid()))->module->elsc, + SC_CONS_SYSTEM, func ); +} + + +/* brl1_intr is called directly from the uart interrupt; after it runs, the + * interrupt "daemon" xthread is signalled to continue. */ void -l1_control_out(int offset, int value) +brl1_intr( void ) { - nasid_t nasid = 0; //(get_elsc())->nasid; - WRITE_L1_UART_REG(nasid, offset, value); } +#define BRL1_INTERRUPT_LEVEL 65 /* linux request_irq() value */ + +/* Return the current interrupt level */ + +//#define CONSOLE_POLLING_ALSO + int -l1_control_in(int offset) +l1_get_intr_value( void ) { - nasid_t nasid = 0; //(get_elsc())->nasid; - return(READ_L1_UART_REG(nasid, offset)); +#if defined(USE_SAL_CONSOLE_IO) + return(0); +#else +#if defined(CONSOLE_POLLING_ALSO) + return(0); +#else + return(BRL1_INTERRUPT_LEVEL); +#endif /* CONSOLE_POLLING_ALSO */ +#endif /* USE_SAL_CONSOLE_IO */ } -#define PUTCHAR(ch) \ - { \ - while( (!(READ_L1_UART_REG( nasid, REG_LSR ) & LSR_XHRE)) || \ - (!(READ_L1_UART_REG( nasid, REG_MSR ) & MSR_CTS)) ); \ - WRITE_L1_UART_REG( nasid, REG_DAT, (ch) ); \ - } +/* Disconnect the callup functions - throw away interrupts */ -int -l1_serial_out( char *str, int len ) +void +l1_unconnect_intr(void) { - int sent = len; - char crc_char; - unsigned short crc = INIT_CRC; - nasid_t nasid = 0; //(get_elsc())->nasid; +#if !defined(USE_SAL_CONSOLE_IO) + /* UnRegister the upper-level callup functions */ + l1_rx_notif((brl1_notif_t)NULL); + l1_tx_notif((brl1_notif_t)NULL); + /* We do NOT unregister the interrupts */ +#endif /* !USE_SAL_CONSOLE_IO */ +} - lock_console(nasid); +/* Set up uart interrupt handling for this node's uart */ - PUTCHAR( BRL1_FLAG_CH ); - PUTCHAR( BRL1_EVENT | SC_CONS_SYSTEM ); - crc = crc16_calc( crc, (BRL1_EVENT | SC_CONS_SYSTEM) ); +void +l1_connect_intr(void *rx_notify, void *tx_notify) +{ +#if defined(USE_SAL_CONSOLE_IO) +#if 0 + // Will need code here for sn2 - something like this + console_nodepda = NODEPDA(NASID_TO_COMPACT_NODEID(get_master_nasid()); + intr_connect_level(console_nodepda->node_first_cpu, + SGI_UART_VECTOR, INTPEND0_MAXMASK, + dummy_intr_func); + request_irq(SGI_UART_VECTOR | (console_nodepda->node_first_cpu << 8), + intr_func, SA_INTERRUPT | SA_SHIRQ, + "l1_protocol_driver", (void *)sc); +#endif +#else + l1sc_t *sc; + nasid_t nasid; +#if defined(CONFIG_IA64_SGI_SN1) + int tmp; +#endif + nodepda_t *console_nodepda; + int intr_connect_level(cpuid_t, int, ilvl_t, intr_func_t); - while( len ) { + if ( L1_interrupts_connected ) { + /* Interrupts are connected, so just register the callups */ + l1_rx_notif((brl1_notif_t)rx_notify); + l1_tx_notif((brl1_notif_t)tx_notify); - if( (*str == BRL1_FLAG_CH) || (*str == BRL1_ESC_CH) ) { - PUTCHAR( BRL1_ESC_CH ); - PUTCHAR( (*str) ^ BRL1_XOR_CH ); + L1_collectibles[L1C_CONNECT_CALLS]++; + return; + } + else + L1_interrupts_connected = 1; + + nasid = get_master_nasid(); + console_nodepda = NODEPDA(NASID_TO_COMPACT_NODEID(nasid)); + sc = &console_nodepda->module->elsc; + sc->intr_cpu = console_nodepda->node_first_cpu; + +#if defined(CONFIG_IA64_SGI_SN1) + if ( intr_connect_level(sc->intr_cpu, UART_INTR, INTPEND0_MAXMASK, (intr_func_t)brl1_intr) ) { + L1_interrupts_connected = 0; /* FAILS !! */ } else { - PUTCHAR( *str ); + void synergy_intr_connect(int, int); + + synergy_intr_connect(UART_INTR, sc->intr_cpu); + L1_collectibles[L1C_R_IRQ]++; + tmp = request_irq(BRL1_INTERRUPT_LEVEL, brl1_intrd, SA_INTERRUPT | SA_SHIRQ, "l1_protocol_driver", (void *)sc); + L1_collectibles[L1C_R_IRQ_RET] = (uint64_t)tmp; + if ( tmp ) { + L1_interrupts_connected = 0; /* FAILS !! */ + } + else { + /* Register the upper-level callup functions */ + l1_rx_notif((brl1_notif_t)rx_notify); + l1_tx_notif((brl1_notif_t)tx_notify); + + /* Set the uarts the way we like it */ + uart_enable_recv_intr( sc ); + uart_disable_xmit_intr( sc ); + } } - - crc = crc16_calc( crc, *str ); +#endif /* CONFIG_IA64_SGI_SN1 */ +#endif /* USE_SAL_CONSOLE_IO */ +} - str++; len--; - } - - crc ^= 0xffff; - crc_char = crc & 0xff; - if( (crc_char == BRL1_ESC_CH) || (crc_char == BRL1_FLAG_CH) ) { - crc_char ^= BRL1_XOR_CH; - PUTCHAR( BRL1_ESC_CH ); - } - PUTCHAR( crc_char ); - crc_char = (crc >> 8) & 0xff; - if( (crc_char == BRL1_ESC_CH) || (crc_char == BRL1_FLAG_CH) ) { - crc_char ^= BRL1_XOR_CH; - PUTCHAR( BRL1_ESC_CH ); - } - PUTCHAR( crc_char ); - PUTCHAR( BRL1_FLAG_CH ); - unlock_console(nasid); - return sent - len; +/* These are functions to use from serial_in/out when in protocol + * mode to send and receive uart control regs. These are external + * interfaces into the protocol driver. + */ + +void +l1_control_out(int offset, int value) +{ +#if defined(USE_SAL_CONSOLE_IO) + /* quietly ignore unless simulator */ + if ( IS_RUNNING_ON_SIMULATOR() ) { + extern u64 master_node_bedrock_address; + if ( master_node_bedrock_address != (u64)0 ) { + writeb(value, (unsigned long)master_node_bedrock_address + + (offset<< 3)); + } + return; + } +#else + nasid_t nasid = get_master_nasid(); + WRITE_L1_UART_REG(nasid, offset, value); +#endif } +/* Console input exported interface. Return a register value. */ + int -l1_serial_in(void) +l1_control_in_polled(int offset) { - static int l1_cons_getc( l1sc_t *sc ); + static int l1_control_in_local(int, int); - return(l1_cons_getc(get_elsc())); + return(l1_control_in_local(offset, SERIAL_POLLED_MODE)); } +int +l1_control_in(int offset) +{ + static int l1_control_in_local(int, int); -/********************************************************************* - * l1_cons functions - * - * These allow the L1 to act as the system console. They're intended + return(l1_control_in_local(offset, SERIAL_INTERRUPT_MODE)); +} + +static int +l1_control_in_local(int offset, int mode) +{ +#if defined(USE_SAL_CONSOLE_IO) + int sal_call_status = 0, input; + int ret = 0; + + if ( offset == REG_LSR ) { + ret = (LSR_XHRE | LSR_XSRE); /* can send anytime */ + sal_call_status = ia64_sn_console_check(&input); + if ( !sal_call_status && input ) { + /* input pending */ + ret |= LSR_RCA; + } + } + + /* If the sal call failed, do it the old-fashioned way */ + if ( sal_call_status ) { + if ( IS_RUNNING_ON_SIMULATOR() ) { + extern u64 master_node_bedrock_address; + ret = readb((unsigned long)master_node_bedrock_address + + (offset<< 3)); + } + else { +#endif /* USE_SAL_CONSOLE_IO */ + nasid_t nasid; + int ret, input; + static int l1_poll(l1sc_t *, int); + + nasid = get_master_nasid(); + ret = READ_L1_UART_REG(nasid, offset); + + if ( offset == REG_LSR ) { + ret |= (LSR_XHRE | LSR_XSRE); /* can send anytime */ + if ( L1_cons_is_inited ) { + if ( NODEPDA(NASID_TO_COMPACT_NODEID(nasid))->module != (module_t *)0 ) { + input = l1_poll(&NODEPDA(NASID_TO_COMPACT_NODEID(nasid))->module->elsc, mode); + if ( input ) { + ret |= LSR_RCA; + } + } + } + } +#if defined(USE_SAL_CONSOLE_IO) + } + } +#endif + return(ret); +} + +/* + * Console input exported interface. Return a character (if one is available) + */ + +int +l1_serial_in_polled(void) +{ + static int l1_serial_in_local(int mode); + + return(l1_serial_in_local(SERIAL_POLLED_MODE)); +} + +int +l1_serial_in(void) +{ + static int l1_serial_in_local(int mode); + + return(l1_serial_in_local(SERIAL_INTERRUPT_MODE)); +} + +static int +l1_serial_in_local(int mode) +{ +#if defined(USE_SAL_CONSOLE_IO) + int sal_call_status; + int ch; + + sal_call_status = ia64_sn_console_getc(&ch); + if ( !sal_call_status ) { + return(ch); + } + else { + /* If the sal called failed - do it the old-fashioned way */ + if ( IS_RUNNING_ON_SIMULATOR() ) { + extern u64 master_node_bedrock_address; + return(readb((unsigned long)master_node_bedrock_address + (REG_DAT<< 3))); + } + else { +#endif /* USE_SAL_CONSOLE_IO */ + nasid_t nasid; + l1sc_t *sc; + int value; + static int l1_getc( l1sc_t *, int ); + static inline l1sc_t *early_sc_init(nasid_t); + + nasid = get_master_nasid(); + sc = early_sc_init(nasid); + if ( L1_cons_is_inited ) { + if ( NODEPDA(NASID_TO_COMPACT_NODEID(nasid))->module != (module_t *)0 ) { + sc = &NODEPDA(NASID_TO_COMPACT_NODEID(nasid))->module->elsc; + } + } + value = l1_getc(sc, mode); + return(value); +#if defined(USE_SAL_CONSOLE_IO) + } + } +#endif +} + +/* Console output exported interface. Write message to the console. */ + +int +l1_serial_out( char *str, int len ) +{ +#if defined(USE_SAL_CONSOLE_IO) + int sal_call_status = 0; + int counter = len; + + /* Attempt to write things out thru the sal */ + while ( counter > 0 ) { + if ( (sal_call_status = ia64_sn_console_putc(*str)) ) { + break; + } + counter--; + str++; + } + if ( sal_call_status ) { + /* If the sal called failed - do it the old-fashioned way */ + if ( IS_RUNNING_ON_SIMULATOR() ) { + extern u64 master_node_bedrock_address; + if (!master_node_bedrock_address) + early_sn_setup(); + if ( master_node_bedrock_address != (u64)0 ) { +#ifdef FLAG_DIRECT_CONSOLE_WRITES + /* This is an easy way to pre-pend the output to know whether the output + * was done via sal or directly */ + writeb('[', (unsigned long)master_node_bedrock_address + (REG_DAT<< 3)); + writeb('+', (unsigned long)master_node_bedrock_address + (REG_DAT<< 3)); + writeb(']', (unsigned long)master_node_bedrock_address + (REG_DAT<< 3)); + writeb(' ', (unsigned long)master_node_bedrock_address + (REG_DAT<< 3)); +#endif /* FLAG_DIRECT_CONSOLE_WRITES */ + while ( counter > 0 ) { + writeb(*str, (unsigned long)master_node_bedrock_address + (REG_DAT<< 3)); + counter--; + str++; + } + } + } + else { +#endif /* USE_SAL_CONSOLE_IO */ + nasid_t nasid = get_master_nasid(); + int l1_write(l1sc_t *, char *, int, int); + + if ( L1_cons_is_inited ) { + if ( NODEPDA(NASID_TO_COMPACT_NODEID(nasid))->module != (module_t *)0 ) + return(l1_write(&NODEPDA(NASID_TO_COMPACT_NODEID(nasid))->module->elsc, str, len, +#if defined(SYNC_CONSOLE_WRITE) + 1 +#else + !L1_interrupts_connected +#endif + )); + } + return(early_l1_serial_out(nasid, str, len, NOT_LOCKED)); +#if defined(USE_SAL_CONSOLE_IO) + } + } + return((counter <= 0) ? 0 : (len - counter)); +#endif +} + + +/* + * These are the 'early' functions - when we need to do things before we have + * all the structs setup. + */ + + +static l1sc_t Early_console; /* fake l1sc_t */ +static int Early_console_inited = 0; + +static void +early_brl1_init( l1sc_t *sc, nasid_t nasid, net_vec_t uart ) +{ + int i; + brl1_sch_t *subch; + + bzero( sc, sizeof( *sc ) ); + sc->nasid = nasid; + sc->uart = uart; + sc->getc_f = (uart == BRL1_LOCALHUB_UART ? uart_getc : rtr_uart_getc); + sc->putc_f = (uart == BRL1_LOCALHUB_UART ? uart_putc : rtr_uart_putc); + sc->sol = 1; + subch = sc->subch; + + /* initialize L1 subchannels + */ + + /* assign processor TTY channels */ + for( i = 0; i < CPUS_PER_NODE; i++, subch++ ) { + subch->use = BRL1_SUBCH_RSVD; + subch->packet_arrived = ATOMIC_INIT(0); + subch->tx_notify = NULL; + subch->rx_notify = NULL; + subch->iqp = &sc->garbage_q; + } + + /* assign system TTY channel (first free subchannel after each + * processor's individual TTY channel has been assigned) + */ + subch->use = BRL1_SUBCH_RSVD; + subch->packet_arrived = ATOMIC_INIT(0); + subch->tx_notify = NULL; + subch->rx_notify = NULL; + if( sc->uart == BRL1_LOCALHUB_UART ) { + static sc_cq_t x_iqp; + + subch->iqp = &x_iqp; + ASSERT( subch->iqp ); + cq_init( subch->iqp ); + } + else { + /* we shouldn't be getting console input from remote UARTs */ + subch->iqp = &sc->garbage_q; + } + subch++; i++; + + /* "reserved" subchannels (0x05-0x0F); for now, throw away + * incoming packets + */ + for( ; i < 0x10; i++, subch++ ) { + subch->use = BRL1_SUBCH_FREE; + subch->packet_arrived = ATOMIC_INIT(0); + subch->tx_notify = NULL; + subch->rx_notify = NULL; + subch->iqp = &sc->garbage_q; + } + + /* remaining subchannels are free */ + for( ; i < BRL1_NUM_SUBCHANS; i++, subch++ ) { + subch->use = BRL1_SUBCH_FREE; + subch->packet_arrived = ATOMIC_INIT(0); + subch->tx_notify = NULL; + subch->rx_notify = NULL; + subch->iqp = &sc->garbage_q; + } +} + +static inline l1sc_t * +early_sc_init(nasid_t nasid) +{ + /* This is for early I/O */ + if ( Early_console_inited == 0 ) { + early_brl1_init(&Early_console, nasid, BRL1_LOCALHUB_UART); + Early_console_inited = 1; + } + return(&Early_console); +} + +#define PUTCHAR(ch) \ + { \ + while( (!(READ_L1_UART_REG( nasid, REG_LSR ) & LSR_XHRE)) || \ + (!(READ_L1_UART_REG( nasid, REG_MSR ) & MSR_CTS)) ); \ + WRITE_L1_UART_REG( nasid, REG_DAT, (ch) ); \ + } + +static int +early_l1_serial_out( nasid_t nasid, char *str, int len, int lock_state ) +{ + int ret, sent = 0; + char *msg = str; + static int early_l1_send( nasid_t nasid, char *str, int len, int lock_state ); + + while ( sent < len ) { + ret = early_l1_send(nasid, msg, len - sent, lock_state); + sent += ret; + msg += ret; + } + return(len); +} + +static inline int +early_l1_send( nasid_t nasid, char *str, int len, int lock_state ) +{ + int sent; + char crc_char; + unsigned short crc = INIT_CRC; + + if( len > (BRL1_QSIZE - 1) ) + len = (BRL1_QSIZE - 1); + + sent = len; + if ( lock_state == NOT_LOCKED ) + lock_console(nasid); + + PUTCHAR( BRL1_FLAG_CH ); + PUTCHAR( BRL1_EVENT | SC_CONS_SYSTEM ); + crc = crc16_calc( crc, (BRL1_EVENT | SC_CONS_SYSTEM) ); + + while( len ) { + + if( (*str == BRL1_FLAG_CH) || (*str == BRL1_ESC_CH) ) { + PUTCHAR( BRL1_ESC_CH ); + PUTCHAR( (*str) ^ BRL1_XOR_CH ); + } + else { + PUTCHAR( *str ); + } + + crc = crc16_calc( crc, *str ); + + str++; len--; + } + + crc ^= 0xffff; + crc_char = crc & 0xff; + if( (crc_char == BRL1_ESC_CH) || (crc_char == BRL1_FLAG_CH) ) { + crc_char ^= BRL1_XOR_CH; + PUTCHAR( BRL1_ESC_CH ); + } + PUTCHAR( crc_char ); + crc_char = (crc >> 8) & 0xff; + if( (crc_char == BRL1_ESC_CH) || (crc_char == BRL1_FLAG_CH) ) { + crc_char ^= BRL1_XOR_CH; + PUTCHAR( BRL1_ESC_CH ); + } + PUTCHAR( crc_char ); + PUTCHAR( BRL1_FLAG_CH ); + + if ( lock_state == NOT_LOCKED ) + unlock_console(nasid); + return sent; +} + +/********************************************************************* + * l1_cons functions + * + * These allow the L1 to act as the system console. They're intended * to abstract away most of the br/l1 internal details from the * _L1_cons_* functions (in the prom-- see "l1_console.c") and * l1_* functions (in the kernel-- see "sio_l1.c") that they support. @@ -1555,12 +2154,16 @@ */ static int -l1_cons_poll( l1sc_t *sc ) +l1_poll( l1sc_t *sc, int mode ) { + int ret; + /* in case this gets called before the l1sc_t structure for the module_t * struct for this node is initialized (i.e., if we're called with a * zero l1sc_t pointer)... */ + + if( !sc ) { return 0; } @@ -1569,7 +2172,9 @@ return 1; } - brl1_receive( sc ); + ret = brl1_receive( sc, mode ); + if ( (ret != BRL1_VALID) && (ret != BRL1_NO_MESSAGE) && (ret != BRL1_PROTOCOL) && (ret != BRL1_CRC) ) + L1_collectibles[L1C_REC_STALLS] = ret; if( atomic_read(&sc->subch[SC_CONS_SYSTEM].packet_arrived) ) { return 1; @@ -1581,43 +2186,65 @@ /* pull a character off of the system console queue (if one is available) */ static int -l1_cons_getc( l1sc_t *sc ) +l1_getc( l1sc_t *sc, int mode ) { + unsigned long pl = 0; int c; brl1_sch_t *subch = &(sc->subch[SC_CONS_SYSTEM]); sc_cq_t *q = subch->iqp; - if( !l1_cons_poll( sc ) ) { + if( !l1_poll( sc, mode ) ) { return 0; } - SUBCH_DATA_LOCK( subch ); + SUBCH_DATA_LOCK( subch, pl ); if( cq_empty( q ) ) { atomic_set(&subch->packet_arrived, 0); - SUBCH_DATA_UNLOCK( subch ); + SUBCH_DATA_UNLOCK( subch, pl ); return 0; } cq_rem( q, c ); if( cq_empty( q ) ) atomic_set(&subch->packet_arrived, 0); - SUBCH_DATA_UNLOCK( subch ); + SUBCH_DATA_UNLOCK( subch, pl ); return c; } +/* + * Write a message to the L1 on the system console subchannel. + * + * Danger: don't use a non-zero value for the wait parameter unless you're + * someone important (like a kernel error message). + */ + +int +l1_write( l1sc_t *sc, char *msg, int len, int wait ) +{ + int sent = 0, ret = 0; + + if ( wait ) { + while ( sent < len ) { + ret = brl1_send( sc, msg, len - sent, (SC_CONS_SYSTEM | BRL1_EVENT), wait ); + sent += ret; + msg += ret; + } + ret = len; + } + else { + ret = brl1_send( sc, msg, len, (SC_CONS_SYSTEM | BRL1_EVENT), wait ); + } + return(ret); +} /* initialize the system console subchannel */ void -l1_cons_init( l1sc_t *sc ) +l1_init(void) { - brl1_sch_t *subch = &(sc->subch[SC_CONS_SYSTEM]); - - SUBCH_DATA_LOCK( subch ); - atomic_set(&subch->packet_arrived, 0); - cq_init( subch->iqp ); - SUBCH_DATA_UNLOCK( subch ); + /* All we do now is remember that we have been called */ + L1_cons_is_inited = 1; } @@ -1637,16 +2264,18 @@ #define L1_DBG_PRF(x) #endif -/* sc_data_ready is called to signal threads that are blocked on - * l1 input. +/* + * sc_data_ready is called to signal threads that are blocked on l1 input. */ void -sc_data_ready( l1sc_t *sc, int ch ) +sc_data_ready( int dummy0, void *dummy1, struct pt_regs *dummy2, l1sc_t *sc, int ch ) { + unsigned long pl = 0; + brl1_sch_t *subch = &(sc->subch[ch]); - SUBCH_DATA_LOCK( subch ); + SUBCH_DATA_LOCK( subch, pl ); sv_signal( &(subch->arrive_sv) ); - SUBCH_DATA_UNLOCK( subch ); + SUBCH_DATA_UNLOCK( subch, pl ); } /* sc_open reserves a subchannel to send a request to the L1 (the @@ -1661,9 +2290,10 @@ * subchannel assignment. */ int ch; + unsigned long pl = 0; brl1_sch_t *subch; - SUBCH_LOCK( sc ); + SUBCH_LOCK( sc, pl ); /* Look for a free subchannel. Subchannels 0-15 are reserved * for other purposes. @@ -1676,12 +2306,12 @@ if( ch == BRL1_NUM_SUBCHANS ) { /* there were no subchannels available! */ - SUBCH_UNLOCK( sc ); + SUBCH_UNLOCK( sc, pl ); return SC_NSUBCH; } subch->use = BRL1_SUBCH_RSVD; - SUBCH_UNLOCK( sc ); + SUBCH_UNLOCK( sc, pl ); atomic_set(&subch->packet_arrived, 0); subch->target = target; @@ -1689,7 +2319,7 @@ sv_init( &(subch->arrive_sv), &(subch->data_lock), SV_MON_SPIN | SV_ORDER_FIFO /* | SV_INTS */); subch->tx_notify = NULL; subch->rx_notify = sc_data_ready; - subch->iqp = kmem_zalloc_node( sizeof(sc_cq_t), KM_NOSLEEP, + subch->iqp = snia_kmem_zalloc_node( sizeof(sc_cq_t), KM_NOSLEEP, NASID_TO_COMPACT_NODEID(sc->nasid) ); ASSERT( subch->iqp ); cq_init( subch->iqp ); @@ -1703,29 +2333,31 @@ int sc_close( l1sc_t *sc, int ch ) { + unsigned long pl = 0; brl1_sch_t *subch; - SUBCH_LOCK( sc ); + SUBCH_LOCK( sc, pl ); subch = &(sc->subch[ch]); if( subch->use != BRL1_SUBCH_RSVD ) { /* we're trying to close a subchannel that's not open */ + SUBCH_UNLOCK( sc, pl ); return SC_NOPEN; } atomic_set(&subch->packet_arrived, 0); subch->use = BRL1_SUBCH_FREE; - SUBCH_DATA_LOCK( subch ); sv_broadcast( &(subch->arrive_sv) ); sv_destroy( &(subch->arrive_sv) ); - SUBCH_DATA_UNLOCK( subch ); spin_lock_destroy( &(subch->data_lock) ); ASSERT( subch->iqp && (subch->iqp != &sc->garbage_q) ); - kmem_free( subch->iqp, sizeof(sc_cq_t) ); + snia_kmem_free( subch->iqp, sizeof(sc_cq_t) ); subch->iqp = &sc->garbage_q; + subch->tx_notify = NULL; + subch->rx_notify = brl1_discard_packet; - SUBCH_UNLOCK( sc ); + SUBCH_UNLOCK( sc, pl ); return SC_SUCCESS; } @@ -2003,9 +2635,6 @@ return 0; } - - - /* sc_send takes as arguments a system controller struct, a * buffer which contains a Bedrock<->L1 "request" message, * the message length, and the subchannel (presumably obtained @@ -2033,11 +2662,10 @@ /* Verify that this is an open subchannel */ - if( sc->subch[ch].use == BRL1_SUBCH_FREE ) - { + if( sc->subch[ch].use == BRL1_SUBCH_FREE ) { return SC_NOPEN; } - + type_and_subch = (BRL1_REQUEST | ((u_char)ch)); result = brl1_send( sc, msg, len, type_and_subch, wait ); @@ -2058,8 +2686,6 @@ return( result ); } - - /* subch_pull_msg pulls a message off the receive queue for subch * and places it the buffer pointed to by msg. This routine should only * be called when the caller already knows a message is available on the @@ -2115,6 +2741,7 @@ sc_recv_poll( l1sc_t *sc, int ch, char *msg, int *len, uint64_t block ) { int is_msg = 0; + unsigned long pl = 0; brl1_sch_t *subch = &(sc->subch[ch]); rtc_time_t exp_time = rtc_time() + block; @@ -2127,7 +2754,7 @@ /* kick the next lower layer and see if it pulls anything in */ - brl1_receive( sc ); + brl1_receive( sc, SERIAL_POLLED_MODE ); is_msg = atomic_read(&subch->packet_arrived); } while( block && !is_msg && (rtc_time() < exp_time) ); @@ -2137,9 +2764,9 @@ return( SC_NMSG ); } - SUBCH_DATA_LOCK( subch ); + SUBCH_DATA_LOCK( subch, pl ); subch_pull_msg( subch, msg, len ); - SUBCH_DATA_UNLOCK( subch ); + SUBCH_DATA_UNLOCK( subch, pl ); return( SC_SUCCESS ); } @@ -2156,10 +2783,11 @@ sc_recv_intr( l1sc_t *sc, int ch, char *msg, int *len, uint64_t block ) { int is_msg = 0; + unsigned long pl = 0; brl1_sch_t *subch = &(sc->subch[ch]); do { - SUBCH_DATA_LOCK(subch); + SUBCH_DATA_LOCK(subch, pl); is_msg = atomic_read(&subch->packet_arrived); if( !is_msg && block ) { /* wake me when you've got something */ @@ -2178,12 +2806,12 @@ if( !is_msg ) { /* no message and we didn't care to wait for one */ - SUBCH_DATA_UNLOCK( subch ); + SUBCH_DATA_UNLOCK( subch, pl ); return( SC_NMSG ); } subch_pull_msg( subch, msg, len ); - SUBCH_DATA_UNLOCK( subch ); + SUBCH_DATA_UNLOCK( subch, pl ); return( SC_SUCCESS ); } @@ -2206,16 +2834,13 @@ * rewriting of the L1 command interface anyway.) */ #define __RETRIES 50 -#define __WAIT_SEND ( sc->uart != BRL1_LOCALUART ) +#define __WAIT_SEND 1 // ( sc->uart != BRL1_LOCALHUB_UART ) #define __WAIT_RECV 10000000 int sc_command( l1sc_t *sc, int ch, char *cmd, char *resp, int *len ) { -#ifndef CONFIG_SERIAL_SGI_L1_PROTOCOL - return SC_NMSG; -#else int result; int retries; @@ -2237,16 +2862,12 @@ } /* block on sc_recv_* */ -#ifdef LATER - if( sc->uart == BRL1_LOCALUART ) { + if( (sc->uart == BRL1_LOCALHUB_UART) && L1_interrupts_connected ) { return( sc_recv_intr( sc, ch, resp, len, __WAIT_RECV ) ); } - else -#endif /* LATER */ - { + else { return( sc_recv_poll( sc, ch, resp, len, __WAIT_RECV ) ); } -#endif /* CONFIG_SERIAL_SGI_L1_PROTOCOL */ } /* sc_command_kern is a knuckle-dragging, no-patience version of sc_command @@ -2254,12 +2875,10 @@ * delayed until the send buffer clears. sc_command should be used instead * under most circumstances. */ + int sc_command_kern( l1sc_t *sc, int ch, char *cmd, char *resp, int *len ) { -#ifndef CONFIG_SERIAL_SGI_L1_PROTOCOL - return SC_NMSG; -#else int result; if ( IS_RUNNING_ON_SIMULATOR() ) @@ -2270,7 +2889,6 @@ } return( sc_recv_poll( sc, ch, resp, len, __WAIT_RECV ) ); -#endif /* CONFIG_SERIAL_SGI_L1_PROTOCOL */ } @@ -2282,6 +2900,7 @@ * Returns 1 if input is available on the given queue, * 0 otherwise. */ + int sc_poll( l1sc_t *sc, int ch ) { @@ -2290,7 +2909,7 @@ if( atomic_read(&subch->packet_arrived) ) return 1; - brl1_receive( sc ); + brl1_receive( sc, SERIAL_POLLED_MODE ); if( atomic_read(&subch->packet_arrived) ) return 1; @@ -2298,8 +2917,8 @@ return 0; } -/* for now, sc_init just calls brl1_init - */ +/* for now, sc_init just calls brl1_init */ + void sc_init( l1sc_t *sc, nasid_t nasid, net_vec_t uart ) { @@ -2311,7 +2930,7 @@ * network's environmental monitor tasks. */ -#ifdef LINUX_KERNEL_THREADS +#if defined(LINUX_KERNEL_THREADS) static void sc_dispatch_env_event( uint code, int argc, char *args, int maxlen ) @@ -2366,14 +2985,12 @@ i++ ); } } -#endif /* LINUX_KERNEL_THREADS */ /* sc_event waits for events to arrive from the system controller, and * prints appropriate messages to the syslog. */ -#ifdef LINUX_KERNEL_THREADS static void sc_event( l1sc_t *sc, int ch ) { @@ -2394,7 +3011,7 @@ */ result = sc_recv_intr( sc, ch, event, &event_len, 1 ); if( result != SC_SUCCESS ) { - PRINT_WARNING("Error receiving sysctl event on nasid %d\n", + printk(KERN_WARNING "Error receiving sysctl event on nasid %d\n", sc->nasid ); } else { @@ -2438,53 +3055,50 @@ } } -#endif /* LINUX_KERNEL_THREADS */ /* sc_listen sets up a service thread to listen for incoming events. */ + void sc_listen( l1sc_t *sc ) { int result; + unsigned long pl = 0; brl1_sch_t *subch; char msg[BRL1_QSIZE]; int len; /* length of message being sent */ int ch; /* system controller subchannel used */ -#ifdef LINUX_KERNEL_THREADS extern int msc_shutdown_pri; -#endif /* grab the designated "event subchannel" */ - SUBCH_LOCK( sc ); + SUBCH_LOCK( sc, pl ); subch = &(sc->subch[BRL1_EVENT_SUBCH]); if( subch->use != BRL1_SUBCH_FREE ) { - SUBCH_UNLOCK( sc ); - PRINT_WARNING("sysctl event subchannel in use! " + SUBCH_UNLOCK( sc, pl ); + printk(KERN_WARNING "sysctl event subchannel in use! " "Not monitoring sysctl events.\n" ); return; } subch->use = BRL1_SUBCH_RSVD; - SUBCH_UNLOCK( sc ); + SUBCH_UNLOCK( sc, pl ); atomic_set(&subch->packet_arrived, 0); - subch->target = BRL1_LOCALUART; + subch->target = BRL1_LOCALHUB_UART; spin_lock_init( &(subch->data_lock) ); sv_init( &(subch->arrive_sv), &(subch->data_lock), SV_MON_SPIN | SV_ORDER_FIFO /* | SV_INTS */); subch->tx_notify = NULL; subch->rx_notify = sc_data_ready; - subch->iqp = kmem_zalloc_node( sizeof(sc_cq_t), KM_NOSLEEP, + subch->iqp = snia_kmem_zalloc_node( sizeof(sc_cq_t), KM_NOSLEEP, NASID_TO_COMPACT_NODEID(sc->nasid) ); ASSERT( subch->iqp ); cq_init( subch->iqp ); -#ifdef LINUX_KERNEL_THREADS /* set up a thread to listen for events */ sthread_create( "sysctl event handler", 0, 0, 0, msc_shutdown_pri, KT_PS, (st_func_t *) sc_event, (void *)sc, (void *)(uint64_t)BRL1_EVENT_SUBCH, 0, 0 ); -#endif /* signal the L1 to begin sending events */ bzero( msg, BRL1_QSIZE ); @@ -2522,276 +3136,8 @@ err_return: /* there was a problem; complain */ - PRINT_WARNING("failed to set sysctl event-monitoring subchannel. " + printk(KERN_WARNING "failed to set sysctl event-monitoring subchannel. " "Sysctl events will not be monitored.\n" ); } - -/********************************************************************* - * elscuart functions. These provide a uart-like interface to the - * bedrock/l1 protocol console channels. They are similar in form - * and intent to the elscuart_* functions defined for SN0 in elsc.c. - * - */ - -int _elscuart_flush( l1sc_t *sc ); - -/* Leave room in queue for CR/LF */ -#define ELSCUART_LINE_MAX (BRL1_QSIZE - 2) - - -/* - * _elscuart_putc provides an entry point to the L1 interface driver; - * writes a single character to the output queue. Flushes at the - * end of each line, and translates newlines into CR/LF. - * - * The kernel should generally use l1_cons_write instead, since it assumes - * buffering, translation, prefixing, etc. are done at a higher - * level. - * - */ -int -_elscuart_putc( l1sc_t *sc, int c ) -{ - sc_cq_t *q; - - q = &(sc->oq[ MAP_OQ(L1_ELSCUART_SUBCH(get_myid())) ]); - - if( c != '\n' && c != '\r' && cq_used(q) >= ELSCUART_LINE_MAX ) { - cq_add( q, '\r' ); - cq_add( q, '\n' ); - _elscuart_flush( sc ); - sc->sol = 1; - } - - if( sc->sol && c != '\r' ) { - char prefix[16], *s; - - if( cq_room( q ) < 8 && _elscuart_flush(sc) < 0 ) - { - return -1; - } - - if( sc->verbose ) - { -#ifdef SUPPORT_PRINTING_M_FORMAT - sprintf( prefix, - "%c %d%d%d %M:", - 'A' + get_myid(), - sc->nasid / 100, - (sc->nasid / 10) % 10, - sc->nasid / 10, - sc->modid ); -#else - sprintf( prefix, - "%c %d%d%d 0x%x:", - 'A' + get_myid(), - sc->nasid / 100, - (sc->nasid / 10) % 10, - sc->nasid / 10, - sc->modid ); -#endif - - for( s = prefix; *s; s++ ) - cq_add( q, *s ); - } - sc->sol = 0; - - } - - if( cq_room( q ) < 2 && _elscuart_flush(sc) < 0 ) - { - return -1; - } - - if( c == '\n' ) { - cq_add( q, '\r' ); - sc->sol = 1; - } - - cq_add( q, (u_char) c ); - - if( c == '\n' ) { - /* flush buffered line */ - if( _elscuart_flush( sc ) < 0 ) - { - return -1; - } - } - - if( c== '\r' ) - { - sc->sol = 1; - } - - return 0; -} - - -/* - * _elscuart_getc reads a character from the input queue. This - * routine blocks. - */ -int -_elscuart_getc( l1sc_t *sc ) -{ - int r; - - while( (r = _elscuart_poll( sc )) == 0 ); - - if( r < 0 ) { - /* some error occurred */ - return r; - } - - return _elscuart_readc( sc ); -} - - - -/* - * _elscuart_poll returns 1 if characters are ready for the - * calling processor, 0 if they are not - */ -int -_elscuart_poll( l1sc_t *sc ) -{ - int result; - - if( sc->cons_listen ) { - result = l1_cons_poll( sc ); - if( result ) - return result; - } - - return sc_poll( sc, L1_ELSCUART_SUBCH(get_myid()) ); -} - - - -/* _elscuart_readc is to be used only when _elscuart_poll has - * indicated that a character is waiting. Pulls a character - * of this processor's console queue and returns it. - * - */ -int -_elscuart_readc( l1sc_t *sc ) -{ - int c; - sc_cq_t *q; - brl1_sch_t *subch; - - if( sc->cons_listen ) { - subch = &(sc->subch[ SC_CONS_SYSTEM ]); - q = subch->iqp; - - SUBCH_DATA_LOCK( subch ); - if( !cq_empty( q ) ) { - cq_rem( q, c ); - if( cq_empty( q ) ) { - atomic_set(&subch->packet_arrived, 0); - } - SUBCH_DATA_UNLOCK( subch ); - return c; - } - SUBCH_DATA_UNLOCK( subch ); - } - - subch = &(sc->subch[ L1_ELSCUART_SUBCH(get_myid()) ]); - q = subch->iqp; - - SUBCH_DATA_LOCK( subch ); - if( cq_empty( q ) ) { - SUBCH_DATA_UNLOCK( subch ); - return -1; - } - - cq_rem( q, c ); - if( cq_empty ( q ) ) { - atomic_set(&subch->packet_arrived, 0); - } - SUBCH_DATA_UNLOCK( subch ); - - return c; -} - - -/* - * _elscuart_flush flushes queued output to the L1. - * This routine blocks until the queue is flushed. - */ -int -_elscuart_flush( l1sc_t *sc ) -{ - int r, n; - char buf[BRL1_QSIZE]; - sc_cq_t *q = &(sc->oq[ MAP_OQ(L1_ELSCUART_SUBCH(get_myid())) ]); - - while( (n = cq_used(q)) ) { - - /* buffer queue contents */ - r = BRL1_QSIZE - q->opos; - - if( n > r ) { - BCOPY( q->buf + q->opos, buf, r ); - BCOPY( q->buf, buf + r, n - r ); - } else { - BCOPY( q->buf + q->opos, buf, n ); - } - - /* attempt to send buffer contents */ - r = brl1_send( sc, buf, cq_used( q ), - (BRL1_EVENT | L1_ELSCUART_SUBCH(get_myid())), 1 ); - - /* if no error, dequeue the sent characters; otherwise, - * return the error - */ - if( r >= SC_SUCCESS ) { - q->opos = (q->opos + r) % BRL1_QSIZE; - } - else { - return r; - } - } - - return 0; -} - - - -/* _elscuart_probe returns non-zero if the L1 (and - * consequently the elscuart) can be accessed - */ -int -_elscuart_probe( l1sc_t *sc ) -{ -#ifndef CONFIG_SERIAL_SGI_L1_PROTOCOL - return 0; -#else - char ver[BRL1_QSIZE]; - extern int elsc_version( l1sc_t *, char * ); - - if ( IS_RUNNING_ON_SIMULATOR() ) - return 0; - return( elsc_version(sc, ver) >= 0 ); -#endif /* CONFIG_SERIAL_SGI_L1_PROTOCOL */ -} - - - -/* _elscuart_init zeroes out the l1sc_t console - * queues for this processor's console subchannel. - */ -void -_elscuart_init( l1sc_t *sc ) -{ - brl1_sch_t *subch = &sc->subch[L1_ELSCUART_SUBCH(get_myid())]; - - SUBCH_DATA_LOCK(subch); - - atomic_set(&subch->packet_arrived, 0); - cq_init( subch->iqp ); - cq_init( &sc->oq[MAP_OQ(L1_ELSCUART_SUBCH(get_myid()))] ); - - SUBCH_DATA_UNLOCK(subch); -} +#endif /* LINUX_KERNEL_THREADS */ diff -urN linux-2.4.18/arch/ia64/sn/io/l1_command.c lia64-2.4/arch/ia64/sn/io/l1_command.c --- linux-2.4.18/arch/ia64/sn/io/l1_command.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/l1_command.c Mon Nov 19 23:22:51 2001 @@ -4,20 +4,20 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000 - 2001 Silicon Graphics, Inc. + * All rights reserved. */ #include #include #include +#include #include #include #include #include #include #include -#include #include #include #include @@ -27,7 +27,6 @@ #define ELSC_TIMEOUT 1000000 /* ELSC response timeout (usec) */ #define LOCK_TIMEOUT 5000000 /* Hub lock timeout (usec) */ -#define LOCAL_HUB LOCAL_HUB_ADDR #define LD(x) (*(volatile uint64_t *)(x)) #define SD(x, v) (LD(x) = (uint64_t) (v)) @@ -75,7 +74,7 @@ void elsc_init(elsc_t *e, nasid_t nasid) { - sc_init((l1sc_t *)e, nasid, BRL1_LOCALUART); + sc_init((l1sc_t *)e, nasid, BRL1_LOCALHUB_UART); } @@ -1376,85 +1375,4 @@ sprintf( result, "%d.%d.%d", major, minor, bugfix ); return 0; -} - - - -/* elscuart routines - * - * Most of the elscuart functionality is implemented in l1.c. The following - * is directly "recycled" from elsc.c. - */ - - -/* - * _elscuart_puts - */ - -int _elscuart_puts(elsc_t *e, char *s) -{ - int c; - - if (s == 0) - s = ""; - - while ((c = LBYTE(s)) != 0) { - if (_elscuart_putc(e, c) < 0) - return -1; - s++; - } - - return 0; -} - - -/* - * elscuart wrapper routines - * - * The following routines are similar to their counterparts in l1.c, - * except instead of taking an elsc_t pointer directly, they call - * a global routine "get_elsc" to obtain the pointer. - * This is useful when the elsc is employed for stdio. - */ - -int elscuart_probe(void) -{ - return _elscuart_probe(get_elsc()); -} - -void elscuart_init(void *init_data) -{ - _elscuart_init(get_elsc()); - /* dummy variable included for driver compatability */ - init_data = init_data; -} - -int elscuart_poll(void) -{ - return _elscuart_poll(get_elsc()); -} - -int elscuart_readc(void) -{ - return _elscuart_readc(get_elsc()); -} - -int elscuart_getc(void) -{ - return _elscuart_getc(get_elsc()); -} - -int elscuart_puts(char *s) -{ - return _elscuart_puts(get_elsc(), s); -} - -int elscuart_putc(int c) -{ - return _elscuart_putc(get_elsc(), c); -} - -int elscuart_flush(void) -{ - return _elscuart_flush(get_elsc()); } diff -urN linux-2.4.18/arch/ia64/sn/io/labelcl.c lia64-2.4/arch/ia64/sn/io/labelcl.c --- linux-2.4.18/arch/ia64/sn/io/labelcl.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/labelcl.c Mon Nov 19 23:22:51 2001 @@ -1,21 +1,10 @@ /* labelcl - SGI's Hwgraph Compatibility Layer. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - Colin Ngam may be reached by email at cngam@sgi.com - + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2001 Silicon Graphics, Inc. All rights reserved. */ #include @@ -286,7 +275,7 @@ if (!strcmp(info_name, old_label_list[i].name)) { /* Not allowed to add duplicate labelled info names. */ kfree(new_label_list); - printk(KERN_WARNING "labelcl_info_add_LBL: Duplicate label name %s for vertex 0x%p\n", info_name, de); + printk(KERN_WARNING "labelcl_info_add_LBL: Duplicate label name %s for vertex 0x%p\n", info_name, (void *)de); return(-1); } new_label_list[i] = old_label_list[i]; /* structure copy */ diff -urN linux-2.4.18/arch/ia64/sn/io/mem_refcnt.c lia64-2.4/arch/ia64/sn/io/mem_refcnt.c --- linux-2.4.18/arch/ia64/sn/io/mem_refcnt.c Thu Apr 12 12:16:35 2001 +++ lia64-2.4/arch/ia64/sn/io/mem_refcnt.c Wed Dec 31 16:00:00 1969 @@ -1,222 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// From numa_hw.h - -#define MIGR_COUNTER_MAX_GET(nodeid) \ - (NODEPDA_MCD((nodeid))->migr_system_kparms.migr_threshold_reference) -/* - * Get the Absolute Theshold - */ -#define MIGR_THRESHOLD_ABS_GET(nodeid) ( \ - MD_MIG_VALUE_THRESH_GET(COMPACT_TO_NASID_NODEID(nodeid))) -/* - * Get the current Differential Threshold - */ -#define MIGR_THRESHOLD_DIFF_GET(nodeid) \ - (NODEPDA_MCD(nodeid)->migr_as_kparms.migr_base_threshold) - -#define NUM_OF_HW_PAGES_PER_SW_PAGE() (NBPP / MD_PAGE_SIZE) - -// #include "migr_control.h" - -int -mem_refcnt_attach(devfs_handle_t hub) -{ - devfs_handle_t refcnt_dev; - - hwgraph_char_device_add(hub, - "refcnt", - "hubspc_", - &refcnt_dev); - device_info_set(refcnt_dev, (void*)(ulong)HUBSPC_REFCOUNTERS); - - return (0); -} - - -/*ARGSUSED*/ -int -mem_refcnt_open(devfs_handle_t *devp, mode_t oflag, int otyp, cred_t *crp) -{ - cnodeid_t node; - - ASSERT( (hubspc_subdevice_t)(ulong)device_info_get(*devp) == HUBSPC_REFCOUNTERS ); - - node = master_node_get(*devp); - - ASSERT( (node >= 0) && (node < numnodes) ); - - if (NODEPDA(node)->migr_refcnt_counterbuffer == NULL) { - return (ENODEV); - } - - ASSERT( NODEPDA(node)->migr_refcnt_counterbase != NULL ); - ASSERT( NODEPDA(node)->migr_refcnt_cbsize != (size_t)0 ); - - return (0); -} - -/*ARGSUSED*/ -int -mem_refcnt_close(devfs_handle_t dev, int oflag, int otyp, cred_t *crp) -{ - return 0; -} - -/*ARGSUSED*/ -int -mem_refcnt_mmap(devfs_handle_t dev, vhandl_t *vt, off_t off, size_t len, uint prot) -{ - cnodeid_t node; - int errcode; - char* buffer; - size_t blen; - - ASSERT( (hubspc_subdevice_t)(ulong)device_info_get(dev) == HUBSPC_REFCOUNTERS ); - - node = master_node_get(dev); - - ASSERT( (node >= 0) && (node < numnodes) ); - - ASSERT( NODEPDA(node)->migr_refcnt_counterbuffer != NULL); - ASSERT( NODEPDA(node)->migr_refcnt_counterbase != NULL ); - ASSERT( NODEPDA(node)->migr_refcnt_cbsize != 0 ); - - /* - * XXXX deal with prot's somewhere around here.... - */ - - buffer = NODEPDA(node)->migr_refcnt_counterbuffer; - blen = NODEPDA(node)->migr_refcnt_cbsize; - - /* - * Force offset to be a multiple of sizeof(refcnt_t) - * We round up. - */ - - off = (((off - 1)/sizeof(refcnt_t)) + 1) * sizeof(refcnt_t); - - if ( ((buffer + blen) - (buffer + off + len)) < 0 ) { - return (EPERM); - } - - errcode = v_mapphys(vt, - buffer + off, - len); - - return errcode; -} - -/*ARGSUSED*/ -int -mem_refcnt_unmap(devfs_handle_t dev, vhandl_t *vt) -{ - return 0; -} - -/* ARGSUSED */ -int -mem_refcnt_ioctl(devfs_handle_t dev, - int cmd, - void *arg, - int mode, - cred_t *cred_p, - int *rvalp) -{ - cnodeid_t node; - int errcode; - extern int numnodes; - - ASSERT( (hubspc_subdevice_t)(ulong)device_info_get(dev) == HUBSPC_REFCOUNTERS ); - - node = master_node_get(dev); - - ASSERT( (node >= 0) && (node < numnodes) ); - - ASSERT( NODEPDA(node)->migr_refcnt_counterbuffer != NULL); - ASSERT( NODEPDA(node)->migr_refcnt_counterbase != NULL ); - ASSERT( NODEPDA(node)->migr_refcnt_cbsize != 0 ); - - errcode = 0; - - switch (cmd) { - case RCB_INFO_GET: - { - rcb_info_t rcb; - - rcb.rcb_len = NODEPDA(node)->migr_refcnt_cbsize; - - rcb.rcb_sw_sets = NODEPDA(node)->migr_refcnt_numsets; - rcb.rcb_sw_counters_per_set = numnodes; - rcb.rcb_sw_counter_size = sizeof(refcnt_t); - - rcb.rcb_base_pages = NODEPDA(node)->migr_refcnt_numsets / - NUM_OF_HW_PAGES_PER_SW_PAGE(); - rcb.rcb_base_page_size = NBPP; - rcb.rcb_base_paddr = ctob(slot_getbasepfn(node, 0)); - - rcb.rcb_cnodeid = node; - rcb.rcb_granularity = MD_PAGE_SIZE; -#ifdef LATER - rcb.rcb_hw_counter_max = MIGR_COUNTER_MAX_GET(node); - rcb.rcb_diff_threshold = MIGR_THRESHOLD_DIFF_GET(node); -#endif - rcb.rcb_abs_threshold = MIGR_THRESHOLD_ABS_GET(node); - rcb.rcb_num_slots = node_getnumslots(node); - - if (COPYOUT(&rcb, arg, sizeof(rcb_info_t))) { - errcode = EFAULT; - } - - break; - } - case RCB_SLOT_GET: - { - rcb_slot_t slot[MAX_MEM_SLOTS]; - int s; - int nslots; - - nslots = node_getnumslots(node); - ASSERT(nslots <= MAX_MEM_SLOTS); - for (s = 0; s < nslots; s++) { - slot[s].base = (uint64_t)ctob(slot_getbasepfn(node, s)); -#ifdef LATER - slot[s].size = (uint64_t)ctob(slot_getsize(node, s)); -#else - slot[s].size = (uint64_t)1; -#endif - } - if (COPYOUT(&slot[0], arg, nslots * sizeof(rcb_slot_t))) { - errcode = EFAULT; - } - - *rvalp = nslots; - break; - } - - default: - errcode = EINVAL; - break; - - } - - return errcode; -} diff -urN linux-2.4.18/arch/ia64/sn/io/ml_SN_init.c lia64-2.4/arch/ia64/sn/io/ml_SN_init.c --- linux-2.4.18/arch/ia64/sn/io/ml_SN_init.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/ml_SN_init.c Mon Feb 4 17:48:56 2002 @@ -4,37 +4,30 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ #include #include #include +#include #include +#include #include #include #include #include -#include #include #include #include -#include - - -#if defined (CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#include -#include -#include -#endif /* CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 */ - +#include extern int numcpus; extern char arg_maxnodes[]; extern cpuid_t master_procid; -extern void * kmem_alloc_node(register size_t, register int , cnodeid_t); +#if defined(CONFIG_IA64_SGI_SN1) extern synergy_da_t *Synergy_da_indr[]; +#endif extern int hasmetarouter; @@ -45,18 +38,8 @@ extern xwidgetnum_t hub_widget_id(nasid_t); -static int fine_mode = 0; - -static cnodemask_t hub_init_mask; /* Mask of cpu in a node doing init */ -static volatile cnodemask_t hub_init_done_mask; - /* Node mask where we wait for - * per hub initialization - */ -spinlock_t hub_mask_lock; /* Lock for hub_init_mask above. */ - extern int valid_icache_reasons; /* Reasons to flush the icache */ extern int valid_dcache_reasons; /* Reasons to flush the dcache */ -extern int numnodes; extern u_char miniroot; extern volatile int need_utlbmiss_patch; extern void iograph_early_init(void); @@ -83,20 +66,6 @@ */ master_nasid = get_nasid(); set_master_bridge_base(); - FIXME("mlreset: Enable when we support ioc3 .."); -#ifdef LATER - if (get_console_nasid() == master_nasid) - /* Set up the IOC3 */ - ioc3_mlreset((ioc3_cfg_t *)KL_CONFIG_CH_CONS_INFO(master_nasid)->config_base, - (ioc3_mem_t *)KL_CONFIG_CH_CONS_INFO(master_nasid)->memory_base); - - /* - * Initialize Master nvram base. - */ - nvram_baseinit(); - - fine_mode = is_fine_dirmode(); -#endif /* LATER */ /* We're the master processor */ master_procid = smp_processor_id(); @@ -108,75 +77,12 @@ */ ASSERT_ALWAYS(master_nasid == get_nasid()); -#ifdef LATER - - /* - * Activate when calias is implemented. - */ - /* Set all nodes' calias sizes to 8k */ - for (i = 0; i < maxnodes; i++) { - nasid_t nasid; - int sn; - - nasid = COMPACT_TO_NASID_NODEID(i); - - /* - * Always have node 0 in the region mask, otherwise CALIAS accesses - * get exceptions since the hub thinks it is a node 0 address. - */ - for (sn=0; snpdinfo = (void *)hubinfo; hubinfo->h_nodepda = npda; hubinfo->h_cnodeid = node; @@ -230,92 +119,37 @@ hubinfo->h_widgetid = hub_widget_id(hubinfo->h_nasid); npda->xbow_peer = INVALID_NASID; - /* Initialize the linked list of + + /* + * Initialize the linked list of * router info pointers to the dependent routers */ npda->npda_rip_first = NULL; - /* npda_rip_last always points to the place + + /* + * npda_rip_last always points to the place * where the next element is to be inserted * into the list */ npda->npda_rip_last = &npda->npda_rip_first; - npda->dependent_routers = 0; npda->module_id = INVALID_MODULE; +#ifdef CONFIG_IA64_SGI_SN1 /* - * Initialize the subnodePDA. - */ + * Initialize the interrupts. + * On sn2, this is done at pci init time, + * because sn2 needs the cpus checked in + * when it initializes interrupts. This is + * so we don't see all the nodes as headless. + */ for (sn=0; snprof_count = 0; - SNPDA(npda,sn)->next_prof_timeout = 0; intr_init_vecblk(npda, node, sn); } +#endif /* CONFIG_IA64_SGI_SN1 */ - npda->vector_unit_busy = 0; - - spin_lock_init(&npda->vector_lock); mutex_init_locked(&npda->xbow_sema); /* init it locked? */ - spin_lock_init(&npda->fprom_lock); - spin_lock_init(&npda->node_utlbswitchlock); - npda->ni_error_print = 0; #ifdef LATER - if (need_utlbmiss_patch) { - npda->node_need_utlbmiss_patch = 1; - npda->node_utlbmiss_patched = 1; - } -#endif - - /* - * Clear out the nasid mask. - */ - for (i = 0; i < NASID_MASK_BYTES; i++) - npda->nasid_mask[i] = 0; - - for (i = 0; i < numnodes; i++) { - nasid_t nasid = COMPACT_TO_NASID_NODEID(i); - - /* Set my mask bit */ - npda->nasid_mask[nasid / 8] |= (1 << nasid % 8); - } - -#ifdef LATER - npda->node_first_cpu = get_cnode_cpu(node); -#endif - - if (npda->node_first_cpu != CPU_NONE) { - /* - * Count number of cpus only if first CPU is valid. - */ - numcpus_p = &npda->node_num_cpus; - *numcpus_p = 0; - for (i = npda->node_first_cpu; i < MAXCPUS; i++) { - if (CPUID_TO_COMPACT_NODEID(i) != node) - break; - else - (*numcpus_p)++; - } - } else { - npda->node_num_cpus = 0; - } - - /* Allocate memory for the dump stack on each node - * This is useful during nmi handling since we - * may not be guaranteed shared memory at that time - * which precludes depending on a global dump stack - */ -#ifdef LATER - npda->dump_stack = (uint64_t *)kmem_zalloc_node(DUMP_STACK_SIZE,VM_NOSLEEP, - node); - ASSERT_ALWAYS(npda->dump_stack); - ASSERT(npda->dump_stack); -#endif - /* Initialize the counter which prevents - * both the cpus on a node to proceed with nmi - * handling. - */ -#ifdef LATER - npda->dump_count = 0; /* Setup the (module,slot) --> nic mapping for all the routers * in the system. This is useful during error handling when @@ -325,17 +159,9 @@ /* Allocate memory for the per-node router traversal queue */ router_queue_init(npda,node); - npda->sbe_info = kmem_zalloc_node_hint(sizeof (sbe_info_t), 0, node); + npda->sbe_info = alloc_bootmem_node(NODE_DATA(node), sizeof (sbe_info_t)); ASSERT(npda->sbe_info); -#ifdef CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 || CONFIG_IA64_GENERIC - /* - * Initialize bte info pointers to NULL - */ - for (i = 0; i < BTES_PER_NODE; i++) { - npda->node_bte_info[i] = (bteinfo_t *)NULL; - } -#endif #endif /* LATER */ } @@ -345,260 +171,44 @@ * Must be done _after_ init_platform_nodepda(). * If we need a lock here, something else is wrong! */ -// void init_platform_pda(pda_t *ppda, cpuid_t cpu) void init_platform_pda(cpuid_t cpu) { +#if defined(CONFIG_IA64_SGI_SN1) hub_intmasks_t *intmasks; -#ifdef LATER - cpuinfo_t cpuinfo; -#endif - int i; + int i, subnode; cnodeid_t cnode; synergy_da_t *sda; int which_synergy; -#ifdef LATER - /* Allocate per-cpu platform-dependent data */ - cpuinfo = (cpuinfo_t)kmem_alloc_node(sizeof(struct cpuinfo_s), GFP_ATOMIC, cputocnode(cpu)); - ASSERT_ALWAYS(cpuinfo); - ppda->pdinfo = (void *)cpuinfo; - cpuinfo->ci_cpupda = ppda; - cpuinfo->ci_cpuid = cpu; -#endif cnode = cpuid_to_cnodeid(cpu); which_synergy = cpuid_to_synergy(cpu); + sda = Synergy_da_indr[(cnode * 2) + which_synergy]; - // intmasks = &ppda->p_intmasks; intmasks = &sda->s_intmasks; -#ifdef LATER - ASSERT_ALWAYS(&ppda->p_nodepda); -#endif - /* Clear INT_PEND0 masks. */ for (i = 0; i < N_INTPEND0_MASKS; i++) intmasks->intpend0_masks[i] = 0; /* Set up pointer to the vector block in the nodepda. */ /* (Cant use SUBNODEPDA - not working yet) */ - intmasks->dispatch0 = &Nodepdaindr[cnode]->snpda[cpuid_to_subnode(cpu)].intr_dispatch0; - intmasks->dispatch1 = &Nodepdaindr[cnode]->snpda[cpuid_to_subnode(cpu)].intr_dispatch1; + subnode = cpuid_to_subnode(cpu); + intmasks->dispatch0 = &NODEPDA(cnode)->snpda[cpuid_to_subnode(cpu)].intr_dispatch0; + intmasks->dispatch1 = &NODEPDA(cnode)->snpda[cpuid_to_subnode(cpu)].intr_dispatch1; + if (intmasks->dispatch0 != &SUBNODEPDA(cnode, subnode)->intr_dispatch0 || + intmasks->dispatch1 != &SUBNODEPDA(cnode, subnode)->intr_dispatch1) + panic("xxx"); + intmasks->dispatch0 = &SUBNODEPDA(cnode, subnode)->intr_dispatch0; + intmasks->dispatch1 = &SUBNODEPDA(cnode, subnode)->intr_dispatch1; /* Clear INT_PEND1 masks. */ for (i = 0; i < N_INTPEND1_MASKS; i++) intmasks->intpend1_masks[i] = 0; - - -#ifdef LATER - /* Don't read the routers unless we're the master. */ - ppda->p_routertick = 0; -#endif - +#endif /* CONFIG_IA64_SGI_SN1 */ } -#if (defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC)) && !defined(BRINGUP) /* protect low mem for IP35/7 */ -#error "need protect_hub_calias, protect_nmi_handler_data" -#endif - -#ifdef LATER -/* - * For now, just protect the first page (exception handlers). We - * may want to protect more stuff later. - */ void -protect_hub_calias(nasid_t nasid) -{ - paddr_t pa = NODE_OFFSET(nasid) + 0; /* page 0 on node nasid */ - int i; - - for (i = 0; i < MAX_REGIONS; i++) { - if (i == nasid_to_region(nasid)) - continue; - } -} - -/* - * Protect the page of low memory used to communicate with the NMI handler. - */ -void -protect_nmi_handler_data(nasid_t nasid, int slice) -{ - paddr_t pa = NODE_OFFSET(nasid) + NMI_OFFSET(nasid, slice); - int i; - - for (i = 0; i < MAX_REGIONS; i++) { - if (i == nasid_to_region(nasid)) - continue; - } -} -#endif /* LATER */ - - -#ifdef LATER -/* - * Protect areas of memory that we access uncached by marking them as - * poisoned so the T5 can't read them speculatively and erroneously - * mark them dirty in its cache only to write them back with old data - * later. - */ -static void -protect_low_memory(nasid_t nasid) -{ - /* Protect low memory directory */ - poison_state_alter_range(KLDIR_ADDR(nasid), KLDIR_SIZE, 1); - - /* Protect klconfig area */ - poison_state_alter_range(KLCONFIG_ADDR(nasid), KLCONFIG_SIZE(nasid), 1); - - /* Protect the PI error spool area. */ - poison_state_alter_range(PI_ERROR_ADDR(nasid), PI_ERROR_SIZE(nasid), 1); - - /* Protect CPU A's cache error eframe area. */ - poison_state_alter_range(TO_NODE_UNCAC(nasid, CACHE_ERR_EFRAME), - CACHE_ERR_AREA_SIZE, 1); - - /* Protect CPU B's area */ - poison_state_alter_range(TO_NODE_UNCAC(nasid, CACHE_ERR_EFRAME) - ^ UALIAS_FLIP_BIT, - CACHE_ERR_AREA_SIZE, 1); -#error "SN1 not handled correctly" -} -#endif /* LATER */ - -/* - * per_hub_init - * - * This code is executed once for each Hub chip. - */ -void -per_hub_init(cnodeid_t cnode) -{ - uint64_t done; - nasid_t nasid; - nodepda_t *npdap; -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) /* SN1 specific */ - ii_icmr_u_t ii_icmr; - ii_ibcr_u_t ii_ibcr; -#endif -#ifdef LATER - int i; -#endif - - nasid = COMPACT_TO_NASID_NODEID(cnode); - - ASSERT(nasid != INVALID_NASID); - ASSERT(NASID_TO_COMPACT_NODEID(nasid) == cnode); - - /* Grab the hub_mask lock. */ - spin_lock(&hub_mask_lock); - - /* Test our bit. */ - if (!(done = CNODEMASK_TSTB(hub_init_mask, cnode))) { - - /* Turn our bit on in the mask. */ - CNODEMASK_SETB(hub_init_mask, cnode); - } - -#if defined(SN0_HWDEBUG) - hub_config_setup(); -#endif - /* Release the hub_mask lock. */ - spin_unlock(&hub_mask_lock); - - /* - * Do the actual initialization if it hasn't been done yet. - * We don't need to hold a lock for this work. - */ - if (!done) { - npdap = NODEPDA(cnode); - -#if defined(CONFIG_IA64_SGI_SYNERGY_PERF) - /* initialize per-node synergy perf instrumentation */ - npdap->synergy_perf_enabled = 0; /* off by default */ - npdap->synergy_perf_lock = SPIN_LOCK_UNLOCKED; - npdap->synergy_perf_freq = SYNERGY_PERF_FREQ_DEFAULT; - npdap->synergy_inactive_intervals = 0; - npdap->synergy_active_intervals = 0; - npdap->synergy_perf_data = NULL; - npdap->synergy_perf_first = NULL; -#endif /* CONFIG_IA64_SGI_SYNERGY_PERF */ - - npdap->hub_chip_rev = get_hub_chiprev(nasid); - -#ifdef LATER - for (i = 0; i < CPUS_PER_NODE; i++) { - cpu = cnode_slice_to_cpuid(cnode, i); - if (!cpu_enabled(cpu)) - SET_CPU_LEDS(nasid, i, 0xf); - } -#endif /* LATER */ - -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) /* SN1 specific */ - - /* - * Set the total number of CRBs that can be used. - */ - ii_icmr.ii_icmr_regval= 0x0; - ii_icmr.ii_icmr_fld_s.i_c_cnt = 0xF; - REMOTE_HUB_S(nasid, IIO_ICMR, ii_icmr.ii_icmr_regval); - - /* - * Set the number of CRBs that both of the BTEs combined - * can use minus 1. - */ - ii_ibcr.ii_ibcr_regval= 0x0; - ii_ibcr.ii_ibcr_fld_s.i_count = 0x8; - REMOTE_HUB_S(nasid, IIO_IBCR, ii_ibcr.ii_ibcr_regval); - - /* - * Set CRB timeout to be 10ms. - */ - REMOTE_HUB_S(nasid, IIO_ICTP, 0x1000 ); - REMOTE_HUB_S(nasid, IIO_ICTO, 0xff); - -#endif /* SN0_HWDEBUG */ - - - - /* Reserve all of the hardwired interrupt levels. */ - intr_reserve_hardwired(cnode); - - /* Initialize error interrupts for this hub. */ - hub_error_init(cnode); - -#ifdef LATER - /* Set up correctable memory/directory ECC error interrupt. */ - install_eccintr(cnode); - - /* Protect our exception vectors from accidental corruption. */ - protect_hub_calias(nasid); - - /* Enable RT clock interrupts */ - hub_rtc_init(cnode); - hub_migrintr_init(cnode); /* Enable migration interrupt */ -#endif /* LATER */ - - spin_lock(&hub_mask_lock); - CNODEMASK_SETB(hub_init_done_mask, cnode); - spin_unlock(&hub_mask_lock); - - } else { - /* - * Wait for the other CPU to complete the initialization. - */ - while (CNODEMASK_TSTB(hub_init_done_mask, cnode) == 0) { - /* - * On SNIA64 we should never get here .. - */ - printk("WARNING: per_hub_init: Should NEVER get here!\n"); - /* LOOP */ - ; - } - } -} - -extern void update_node_information(cnodeid_t cnodeid) { nodepda_t *npda = NODEPDA(cnodeid); @@ -623,22 +233,3 @@ npda_rip = npda_rip->router_next; } } - -hubreg_t -get_region(cnodeid_t cnode) -{ - if (fine_mode) - return COMPACT_TO_NASID_NODEID(cnode) >> NASID_TO_FINEREG_SHFT; - else - return COMPACT_TO_NASID_NODEID(cnode) >> NASID_TO_COARSEREG_SHFT; -} - -hubreg_t -nasid_to_region(nasid_t nasid) -{ - if (fine_mode) - return nasid >> NASID_TO_FINEREG_SHFT; - else - return nasid >> NASID_TO_COARSEREG_SHFT; -} - diff -urN linux-2.4.18/arch/ia64/sn/io/ml_SN_intr.c lia64-2.4/arch/ia64/sn/io/ml_SN_intr.c --- linux-2.4.18/arch/ia64/sn/io/ml_SN_intr.c Tue Jul 31 10:30:09 2001 +++ lia64-2.4/arch/ia64/sn/io/ml_SN_intr.c Wed Dec 31 16:00:00 1969 @@ -1,1728 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Alan Mayer - */ - -/* - * intr.c- - * This file contains all of the routines necessary to set up and - * handle interrupts on an IP27 board. - */ - -#ident "$Revision: 1.167 $" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if DEBUG_INTR_TSTAMP_DEBUG -#include -#include -#include -void do_splx_log(int, int); -void spldebug_log_event(int); -#endif - -// FIXME - BRINGUP -#ifdef CONFIG_SMP -extern unsigned long cpu_online_map; -#endif -#define cpu_allows_intr(cpu) (1) -// If I understand what's going on with this, 32 should work. -// physmem_maxradius seems to be the maximum number of router -// hops to get from one end of the system to the other. With -// a maximally configured machine, with the dumbest possible -// topology, we would make 32 router hops. For what we're using -// it for, the dumbest possible should suffice. -#define physmem_maxradius() 32 - -#define SUBNODE_ANY -1 - -extern int nmied; -extern int hub_intr_wakeup_cnt; -extern synergy_da_t *Synergy_da_indr[]; -extern cpuid_t master_procid; - -extern cnodeid_t master_node_get(devfs_handle_t vhdl); - -extern snia_error_intr_handler(int irq, void *devid, struct pt_regs *pt_regs); - - -#define INTR_LOCK(vecblk) \ - (s = mutex_spinlock(&(vecblk)->vector_lock)) -#define INTR_UNLOCK(vecblk) \ - mutex_spinunlock(&(vecblk)->vector_lock, s) - -/* - * REACT/Pro - */ - - - -/* - * Find first bit set - * Used outside this file also - */ -int ms1bit(unsigned long x) -{ - int b; - - if (x >> 32) b = 32, x >>= 32; - else b = 0; - if (x >> 16) b += 16, x >>= 16; - if (x >> 8) b += 8, x >>= 8; - if (x >> 4) b += 4, x >>= 4; - if (x >> 2) b += 2, x >>= 2; - - return b + (int) (x >> 1); -} - -/* ARGSUSED */ -void -intr_stray(void *lvl) -{ - PRINT_WARNING("Stray Interrupt - level %ld to cpu %d", (long)lvl, cpuid()); -} - -#if defined(DEBUG) - -/* Infrastructure to gather the device - target cpu mapping info */ -#define MAX_DEVICES 1000 /* Reasonable large number . Need not be - * the exact maximum # devices possible. - */ -#define MAX_NAME 100 -typedef struct { - dev_t dev; /* device */ - cpuid_t cpuid; /* target cpu */ - cnodeid_t cnodeid;/* node on which the target cpu is present */ - int bit; /* intr bit reserved */ - char intr_name[MAX_NAME]; /* name of the interrupt */ -} intr_dev_targ_map_t; - -intr_dev_targ_map_t intr_dev_targ_map[MAX_DEVICES]; -uint64_t intr_dev_targ_map_size; -spinlock_t intr_dev_targ_map_lock; - -/* Print out the device - target cpu mapping. - * This routine is used only in the idbg command - * "intrmap" - */ -void -intr_dev_targ_map_print(cnodeid_t cnodeid) -{ - int i,j,size = 0; - int print_flag = 0,verbose = 0; - char node_name[10]; - - if (cnodeid != CNODEID_NONE) { - nodepda_t *npda; - - npda = NODEPDA(cnodeid); - for (j=0; jintr_dispatch0.info[i].ii_flags); - qprintf("\n INT_PEND1: "); - for(i = 0 ; i < N_INTPEND_BITS ; i++) - qprintf("%d",SNPDA(npda,j)->intr_dispatch1.info[i].ii_flags); - } - verbose = 1; - } - qprintf("\n Device - Target Map [Interrupts: %s Node%s]\n\n", - (verbose ? "All" : "Non-hardwired"), - (cnodeid == CNODEID_NONE) ? "s: All" : node_name); - - qprintf("Device\tCpu\tCnode\tIntr_bit\tIntr_name\n"); - for (i = 0 ; i < intr_dev_targ_map_size ; i++) { - - print_flag = 0; - if (verbose) { - if (cnodeid != CNODEID_NONE) { - if (cnodeid == intr_dev_targ_map[i].cnodeid) - print_flag = 1; - } else { - print_flag = 1; - } - } else { - if (intr_dev_targ_map[i].dev != 0) { - if (cnodeid != CNODEID_NONE) { - if (cnodeid == - intr_dev_targ_map[i].cnodeid) - print_flag = 1; - } else { - print_flag = 1; - } - } - } - if (print_flag) { - size++; - qprintf("%d\t%d\t%d\t%d\t%s\n", - intr_dev_targ_map[i].dev, - intr_dev_targ_map[i].cpuid, - intr_dev_targ_map[i].cnodeid, - intr_dev_targ_map[i].bit, - intr_dev_targ_map[i].intr_name); - } - - } - qprintf("\nTotal : %d\n",size); -} -#endif /* DEBUG */ - -/* - * The spinlocks have already been initialized. Now initialize the interrupt - * vectors. One processor on each hub does the work. - */ -void -intr_init_vecblk(nodepda_t *npda, cnodeid_t node, int sn) -{ - int i, ip=0; - intr_vecblk_t *vecblk; - subnode_pda_t *snpda; - - - snpda = SNPDA(npda,sn); - do { - if (ip == 0) { - vecblk = &snpda->intr_dispatch0; - } else { - vecblk = &snpda->intr_dispatch1; - } - - /* Initialize this vector. */ - for (i = 0; i < N_INTPEND_BITS; i++) { - vecblk->vectors[i].iv_func = intr_stray; - vecblk->vectors[i].iv_prefunc = NULL; - vecblk->vectors[i].iv_arg = (void *)(__psint_t)(ip * N_INTPEND_BITS + i); - - vecblk->info[i].ii_owner_dev = 0; - strcpy(vecblk->info[i].ii_name, "Unused"); - vecblk->info[i].ii_flags = 0; /* No flags */ - vecblk->vectors[i].iv_mustruncpu = -1; /* No CPU yet. */ - - } - - mutex_spinlock_init(&vecblk->vector_lock); - - vecblk->vector_count = 0; - for (i = 0; i < CPUS_PER_SUBNODE; i++) - vecblk->cpu_count[i] = 0; - - vecblk->vector_state = VECTOR_UNINITED; - - } while (++ip < 2); - -} - - -/* - * do_intr_reserve_level(cpuid_t cpu, int bit, int resflags, int reserve, - * devfs_handle_t owner_dev, char *name) - * Internal work routine to reserve or unreserve an interrupt level. - * cpu is the CPU to which the interrupt will be sent. - * bit is the level bit to reserve. -1 means any level - * resflags should include II_ERRORINT if this is an - * error interrupt, II_THREADED if the interrupt handler - * will be threaded, or 0 otherwise. - * reserve should be set to II_RESERVE or II_UNRESERVE - * to get or clear a reservation. - * owner_dev is the device that "owns" this interrupt, if supplied - * name is a human-readable name for this interrupt, if supplied - * intr_reserve_level returns the bit reserved or -1 to indicate an error - */ -static int -do_intr_reserve_level(cpuid_t cpu, int bit, int resflags, int reserve, - devfs_handle_t owner_dev, char *name) -{ - intr_vecblk_t *vecblk; - hub_intmasks_t *hub_intmasks; - unsigned long s; - int rv = 0; - int ip; - synergy_da_t *sda; - int which_synergy; - cnodeid_t cnode; - - ASSERT(bit < N_INTPEND_BITS * 2); - - cnode = cpuid_to_cnodeid(cpu); - which_synergy = cpuid_to_synergy(cpu); - sda = Synergy_da_indr[(cnode * 2) + which_synergy]; - hub_intmasks = &sda->s_intmasks; - // hub_intmasks = &pdaindr[cpu].pda->p_intmasks; - - // if (pdaindr[cpu].pda == NULL) return -1; - if ((bit < N_INTPEND_BITS) && !(resflags & II_ERRORINT)) { - vecblk = hub_intmasks->dispatch0; - ip = 0; - } else { - ASSERT((bit >= N_INTPEND_BITS) || (bit == -1)); - bit -= N_INTPEND_BITS; /* Get position relative to INT_PEND1 reg. */ - vecblk = hub_intmasks->dispatch1; - ip = 1; - } - - INTR_LOCK(vecblk); - - if (bit <= -1) { - bit = 0; - ASSERT(reserve == II_RESERVE); - /* Choose any available level */ - for (; bit < N_INTPEND_BITS; bit++) { - if (!(vecblk->info[bit].ii_flags & II_RESERVE)) { - rv = bit; - break; - } - } - - /* Return -1 if all interrupt levels int this register are taken. */ - if (bit == N_INTPEND_BITS) - rv = -1; - - } else { - /* Reserve a particular level if it's available. */ - if ((vecblk->info[bit].ii_flags & II_RESERVE) == reserve) { - /* Can't (un)reserve a level that's already (un)reserved. */ - rv = -1; - } else { - rv = bit; - } - } - - /* Reserve the level and bump the count. */ - if (rv != -1) { - if (reserve) { - int maxlen = sizeof(vecblk->info[bit].ii_name) - 1; - int namelen; - vecblk->info[bit].ii_flags |= (II_RESERVE | resflags); - vecblk->info[bit].ii_owner_dev = owner_dev; - /* Copy in the name. */ - namelen = name ? strlen(name) : 0; - strncpy(vecblk->info[bit].ii_name, name, MIN(namelen, maxlen)); - vecblk->info[bit].ii_name[maxlen] = '\0'; - vecblk->vector_count++; - } else { - vecblk->info[bit].ii_flags = 0; /* Clear all the flags */ - vecblk->info[bit].ii_owner_dev = 0; - /* Clear the name. */ - vecblk->info[bit].ii_name[0] = '\0'; - vecblk->vector_count--; - } - } - - INTR_UNLOCK(vecblk); - -#if defined(DEBUG) - if (rv >= 0) { - int namelen = name ? strlen(name) : 0; - /* Gather this device - target cpu mapping information - * in a table which can be used later by the idbg "intrmap" - * command - */ - s = mutex_spinlock(&intr_dev_targ_map_lock); - if (intr_dev_targ_map_size < MAX_DEVICES) { - intr_dev_targ_map_t *p; - - p = &intr_dev_targ_map[intr_dev_targ_map_size]; - p->dev = owner_dev; - p->cpuid = cpu; - p->cnodeid = cputocnode(cpu); - p->bit = ip * N_INTPEND_BITS + rv; - strncpy(p->intr_name, - name, - MIN(MAX_NAME,namelen)); - intr_dev_targ_map_size++; - } - mutex_spinunlock(&intr_dev_targ_map_lock,s); - } -#endif /* DEBUG */ - - return (((rv == -1) ? rv : (ip * N_INTPEND_BITS) + rv)) ; -} - - -/* - * WARNING: This routine should only be called from within ml/SN. - * Reserve an interrupt level. - */ -int -intr_reserve_level(cpuid_t cpu, int bit, int resflags, devfs_handle_t owner_dev, char *name) -{ - return(do_intr_reserve_level(cpu, bit, resflags, II_RESERVE, owner_dev, name)); -} - - -/* - * WARNING: This routine should only be called from within ml/SN. - * Unreserve an interrupt level. - */ -void -intr_unreserve_level(cpuid_t cpu, int bit) -{ - (void)do_intr_reserve_level(cpu, bit, 0, II_UNRESERVE, 0, NULL); -} - -/* - * Get values that vary depending on which CPU and bit we're operating on - */ -static hub_intmasks_t * -intr_get_ptrs(cpuid_t cpu, int bit, - int *new_bit, /* Bit relative to the register */ - hubreg_t **intpend_masks, /* Masks for this register */ - intr_vecblk_t **vecblk, /* Vecblock for this interrupt */ - int *ip) /* Which intpend register */ -{ - hub_intmasks_t *hub_intmasks; - synergy_da_t *sda; - int which_synergy; - cnodeid_t cnode; - - ASSERT(bit < N_INTPEND_BITS * 2); - - cnode = cpuid_to_cnodeid(cpu); - which_synergy = cpuid_to_synergy(cpu); - sda = Synergy_da_indr[(cnode * 2) + which_synergy]; - hub_intmasks = &sda->s_intmasks; - - // hub_intmasks = &pdaindr[cpu].pda->p_intmasks; - - if (bit < N_INTPEND_BITS) { - *intpend_masks = hub_intmasks->intpend0_masks; - *vecblk = hub_intmasks->dispatch0; - *ip = 0; - *new_bit = bit; - } else { - *intpend_masks = hub_intmasks->intpend1_masks; - *vecblk = hub_intmasks->dispatch1; - *ip = 1; - *new_bit = bit - N_INTPEND_BITS; - } - - return hub_intmasks; -} - - -/* - * intr_connect_level(cpuid_t cpu, int bit, ilvl_t intr_swlevel, - * intr_func_t intr_func, void *intr_arg); - * This is the lowest-level interface to the interrupt code. It shouldn't - * be called from outside the ml/SN directory. - * intr_connect_level hooks up an interrupt to a particular bit in - * the INT_PEND0/1 masks. Returns 0 on success. - * cpu is the CPU to which the interrupt will be sent. - * bit is the level bit to connect to - * intr_swlevel tells which software level to use - * intr_func is the interrupt handler - * intr_arg is an arbitrary argument interpreted by the handler - * intr_prefunc is a prologue function, to be called - * with interrupts disabled, to disable - * the interrupt at source. It is called - * with the same argument. Should be NULL for - * typical interrupts, which can be masked - * by the infrastructure at the level bit. - * intr_connect_level returns 0 on success or nonzero on an error - */ -/* ARGSUSED */ -int -intr_connect_level(cpuid_t cpu, int bit, ilvl_t intr_swlevel, - intr_func_t intr_func, void *intr_arg, - intr_func_t intr_prefunc) -{ - intr_vecblk_t *vecblk; - hubreg_t *intpend_masks; - int rv = 0; - int ip; - unsigned long s; - - ASSERT(bit < N_INTPEND_BITS * 2); - - (void)intr_get_ptrs(cpu, bit, &bit, &intpend_masks, - &vecblk, &ip); - - INTR_LOCK(vecblk); - - if ((vecblk->info[bit].ii_flags & II_INUSE) || - (!(vecblk->info[bit].ii_flags & II_RESERVE))) { - /* Can't assign to a level that's in use or isn't reserved. */ - rv = -1; - } else { - /* Stuff parameters into vector and info */ - vecblk->vectors[bit].iv_func = intr_func; - vecblk->vectors[bit].iv_prefunc = intr_prefunc; - vecblk->vectors[bit].iv_arg = intr_arg; - vecblk->info[bit].ii_flags |= II_INUSE; - } - - /* Now stuff the masks if everything's okay. */ - if (!rv) { - int lslice; - volatile hubreg_t *mask_reg; - // nasid_t nasid = COMPACT_TO_NASID_NODEID(cputocnode(cpu)); - nasid_t nasid = cpuid_to_nasid(cpu); - int subnode = cpuid_to_subnode(cpu); - - /* Make sure it's not already pending when we connect it. */ - REMOTE_HUB_PI_CLR_INTR(nasid, subnode, bit + ip * N_INTPEND_BITS); - - intpend_masks[0] |= (1ULL << (uint64_t)bit); - - lslice = cputolocalslice(cpu); - vecblk->cpu_count[lslice]++; -#if SN1 - /* - * On SN1, there are 8 interrupt mask registers per node: - * PI_0 MASK_0 A - * PI_0 MASK_1 A - * PI_0 MASK_0 B - * PI_0 MASK_1 B - * PI_1 MASK_0 A - * PI_1 MASK_1 A - * PI_1 MASK_0 B - * PI_1 MASK_1 B - */ -#endif - if (ip == 0) { - mask_reg = REMOTE_HUB_PI_ADDR(nasid, subnode, - PI_INT_MASK0_A + PI_INT_MASK_OFFSET * lslice); - } else { - mask_reg = REMOTE_HUB_PI_ADDR(nasid, subnode, - PI_INT_MASK1_A + PI_INT_MASK_OFFSET * lslice); - } - - HUB_S(mask_reg, intpend_masks[0]); - } - - INTR_UNLOCK(vecblk); - - return rv; -} - - -/* - * intr_disconnect_level(cpuid_t cpu, int bit) - * - * This is the lowest-level interface to the interrupt code. It should - * not be called from outside the ml/SN directory. - * intr_disconnect_level removes a particular bit from an interrupt in - * the INT_PEND0/1 masks. Returns 0 on success or nonzero on failure. - */ -int -intr_disconnect_level(cpuid_t cpu, int bit) -{ - intr_vecblk_t *vecblk; - hubreg_t *intpend_masks; - unsigned long s; - int rv = 0; - int ip; - - (void)intr_get_ptrs(cpu, bit, &bit, &intpend_masks, - &vecblk, &ip); - - INTR_LOCK(vecblk); - - if ((vecblk->info[bit].ii_flags & (II_RESERVE | II_INUSE)) != - ((II_RESERVE | II_INUSE))) { - /* Can't remove a level that's not in use or isn't reserved. */ - rv = -1; - } else { - /* Stuff parameters into vector and info */ - vecblk->vectors[bit].iv_func = (intr_func_t)NULL; - vecblk->vectors[bit].iv_prefunc = (intr_func_t)NULL; - vecblk->vectors[bit].iv_arg = 0; - vecblk->info[bit].ii_flags &= ~II_INUSE; -#ifdef BASE_ITHRTEAD - vecblk->vectors[bit].iv_mustruncpu = -1; /* No mustrun CPU any more. */ -#endif - } - - /* Now clear the masks if everything's okay. */ - if (!rv) { - int lslice; - volatile hubreg_t *mask_reg; - - intpend_masks[0] &= ~(1ULL << (uint64_t)bit); - lslice = cputolocalslice(cpu); - vecblk->cpu_count[lslice]--; - mask_reg = REMOTE_HUB_PI_ADDR(COMPACT_TO_NASID_NODEID(cputocnode(cpu)), - cpuid_to_subnode(cpu), - ip == 0 ? PI_INT_MASK0_A : PI_INT_MASK1_A); - mask_reg = (volatile hubreg_t *)((__psunsigned_t)mask_reg + - (PI_INT_MASK_OFFSET * lslice)); - *mask_reg = intpend_masks[0]; - } - - INTR_UNLOCK(vecblk); - - return rv; -} - -/* - * Actually block or unblock an interrupt - */ -void -do_intr_block_bit(cpuid_t cpu, int bit, int block) -{ - intr_vecblk_t *vecblk; - int ip; - unsigned long s; - hubreg_t *intpend_masks; - volatile hubreg_t mask_value; - volatile hubreg_t *mask_reg; - - intr_get_ptrs(cpu, bit, &bit, &intpend_masks, &vecblk, &ip); - - INTR_LOCK(vecblk); - - if (block) - /* Block */ - intpend_masks[0] &= ~(1ULL << (uint64_t)bit); - else - /* Unblock */ - intpend_masks[0] |= (1ULL << (uint64_t)bit); - - if (ip == 0) { - mask_reg = REMOTE_HUB_PI_ADDR(COMPACT_TO_NASID_NODEID(cputocnode(cpu)), - cpuid_to_subnode(cpu), PI_INT_MASK0_A); - } else { - mask_reg = REMOTE_HUB_PI_ADDR(COMPACT_TO_NASID_NODEID(cputocnode(cpu)), - cpuid_to_subnode(cpu), PI_INT_MASK1_A); - } - - HUB_S(mask_reg, intpend_masks[0]); - - /* - * Wait for it to take effect. (One read should suffice.) - * This is only necessary when blocking an interrupt - */ - if (block) - while ((mask_value = HUB_L(mask_reg)) != intpend_masks[0]) - ; - - INTR_UNLOCK(vecblk); -} - - -/* - * Block a particular interrupt (cpu/bit pair). - */ -/* ARGSUSED */ -void -intr_block_bit(cpuid_t cpu, int bit) -{ - do_intr_block_bit(cpu, bit, 1); -} - - -/* - * Unblock a particular interrupt (cpu/bit pair). - */ -/* ARGSUSED */ -void -intr_unblock_bit(cpuid_t cpu, int bit) -{ - do_intr_block_bit(cpu, bit, 0); -} - - -/* verifies that the specified CPUID is on the specified SUBNODE (if any) */ -#define cpu_on_subnode(cpuid, which_subnode) \ - (((which_subnode) == SUBNODE_ANY) || (cpuid_to_subnode(cpuid) == (which_subnode))) - - -/* - * Choose one of the CPUs on a specified node or subnode to receive - * interrupts. Don't pick a cpu which has been specified as a NOINTR cpu. - * - * Among all acceptable CPUs, the CPU that has the fewest total number - * of interrupts targetted towards it is chosen. Note that we never - * consider how frequent each of these interrupts might occur, so a rare - * hardware error interrupt is weighted equally with a disk interrupt. - */ -static cpuid_t -do_intr_cpu_choose(cnodeid_t cnode, int which_subnode) -{ - cpuid_t cpu, best_cpu = CPU_NONE; - int slice, min_count=1000; - - min_count = 1000; - for (slice=0; slice < CPUS_PER_NODE; slice++) { - intr_vecblk_t *vecblk0, *vecblk1; - int total_intrs_to_slice; - subnode_pda_t *snpda; - int local_cpu_num; - - cpu = cnode_slice_to_cpuid(cnode, slice); - if (cpu == CPU_NONE) - continue; - - /* If this cpu isn't enabled for interrupts, skip it */ - if (!cpu_enabled(cpu) || !cpu_allows_intr(cpu)) - continue; - - /* If this isn't the right subnode, skip it */ - if (!cpu_on_subnode(cpu, which_subnode)) - continue; - - /* OK, this one's a potential CPU for interrupts */ - snpda = SUBNODEPDA(cnode,SUBNODE(slice)); - vecblk0 = &snpda->intr_dispatch0; - vecblk1 = &snpda->intr_dispatch1; - local_cpu_num = LOCALCPU(slice); - total_intrs_to_slice = vecblk0->cpu_count[local_cpu_num] + - vecblk1->cpu_count[local_cpu_num]; - - if (min_count > total_intrs_to_slice) { - min_count = total_intrs_to_slice; - best_cpu = cpu; - } - } - return best_cpu; -} - -/* - * Choose an appropriate interrupt target CPU on a specified node. - * If which_subnode is SUBNODE_ANY, then subnode is not considered. - * Otherwise, the chosen CPU must be on the specified subnode. - */ -static cpuid_t -intr_cpu_choose_from_node(cnodeid_t cnode, int which_subnode) -{ - return(do_intr_cpu_choose(cnode, which_subnode)); -} - - -#ifdef LATER -/* - * Convert a subnode vertex into a (cnodeid, which_subnode) pair. - * Return 0 on success, non-zero on failure. - */ -static int -subnodevertex_to_subnode(devfs_handle_t vhdl, cnodeid_t *cnodeidp, int *which_subnodep) -{ - arbitrary_info_t which_subnode; - cnodeid_t cnodeid; - - /* Try to grab subnode information */ - if (hwgraph_info_get_LBL(vhdl, INFO_LBL_CPUBUS, &which_subnode) != GRAPH_SUCCESS) - return(-1); - - /* On which node? */ - cnodeid = master_node_get(vhdl); - if (cnodeid == CNODEID_NONE) - return(-1); - - *which_subnodep = (int)which_subnode; - *cnodeidp = cnodeid; - return(0); /* success */ -} - -#endif /* LATER */ - -/* Make it easy to identify subnode vertices in the hwgraph */ -void -mark_subnodevertex_as_subnode(devfs_handle_t vhdl, int which_subnode) -{ - graph_error_t rv; - - ASSERT(0 <= which_subnode); - ASSERT(which_subnode < NUM_SUBNODES); - - rv = hwgraph_info_add_LBL(vhdl, INFO_LBL_CPUBUS, (arbitrary_info_t)which_subnode); - ASSERT_ALWAYS(rv == GRAPH_SUCCESS); - - rv = hwgraph_info_export_LBL(vhdl, INFO_LBL_CPUBUS, sizeof(arbitrary_info_t)); - ASSERT_ALWAYS(rv == GRAPH_SUCCESS); -} - - -/* - * Given a device descriptor, extract interrupt target information and - * choose an appropriate CPU. Return CPU_NONE if we can't make sense - * out of the target information. - * TBD: Should this be considered platform-independent code? - */ - -#ifdef LATER -static cpuid_t -intr_target_from_desc(device_desc_t dev_desc, int favor_subnode) -{ - cpuid_t cpuid = CPU_NONE; - cnodeid_t cnodeid; - int which_subnode; - devfs_handle_t intr_target_dev; - - if ((intr_target_dev = device_desc_intr_target_get(dev_desc)) != GRAPH_VERTEX_NONE) { - /* - * A valid device was specified. If it's a particular - * CPU, then use that CPU as target. - */ - cpuid = cpuvertex_to_cpuid(intr_target_dev); - if (cpuid != CPU_NONE) - goto cpuchosen; - - /* If a subnode vertex was specified, pick a CPU on that subnode. */ - if (subnodevertex_to_subnode(intr_target_dev, &cnodeid, &which_subnode) == 0) { - cpuid = intr_cpu_choose_from_node(cnodeid, which_subnode); - goto cpuchosen; - } - - /* - * Otherwise, pick a CPU on the node that owns the - * specified target. Favor "favor_subnode", if specified. - */ - cnodeid = master_node_get(intr_target_dev); - if (cnodeid != CNODEID_NONE) { - cpuid = intr_cpu_choose_from_node(cnodeid, favor_subnode); - goto cpuchosen; - } - } - -cpuchosen: - return(cpuid); -} -#endif /* LATER */ - - -#ifdef LATER -/* - * Check if we had already visited this candidate cnode - */ -static void * -intr_cnode_seen(cnodeid_t candidate, - void *arg1, - void *arg2) -{ - int i; - cnodeid_t *visited_cnodes = (cnodeid_t *)arg1; - int *num_visited_cnodes = (int *)arg2; - - ASSERT(visited_cnodes); - ASSERT(*num_visited_cnodes <= numnodes); - for(i = 0 ; i < *num_visited_cnodes; i++) { - if (candidate == visited_cnodes[i]) - return(NULL); - } - return(visited_cnodes); -} - -#endif /* LATER */ - - - -/* - * intr_bit_reserve_test(cpuid,which_subnode,cnode,req_bit,intr_resflags, - * owner_dev,intr_name,*resp_bit) - * Either cpuid is not CPU_NONE or cnodeid not CNODE_NONE but - * not both. - * 1. If cpuid is specified, this routine tests if this cpu can be a valid - * interrupt target candidate. - * 2. If cnodeid is specified, this routine tests if there is a cpu on - * this node which can be a valid interrupt target candidate. - * 3. If a valid interrupt target cpu candidate is found then an attempt at - * reserving an interrupt bit on the corresponding cnode is made. - * - * If steps 1 & 2 both fail or step 3 fails then we are not able to get a valid - * interrupt target cpu then routine returns CPU_NONE (failure) - * Otherwise routine returns cpuid of interrupt target (success) - */ -static cpuid_t -intr_bit_reserve_test(cpuid_t cpuid, - int favor_subnode, - cnodeid_t cnodeid, - int req_bit, - int intr_resflags, - devfs_handle_t owner_dev, - char *intr_name, - int *resp_bit) -{ - - ASSERT((cpuid==CPU_NONE) || (cnodeid==CNODEID_NONE)); - - if (cnodeid != CNODEID_NONE) { - /* Try to choose a interrupt cpu candidate */ - cpuid = intr_cpu_choose_from_node(cnodeid, favor_subnode); - } - - if (cpuid != CPU_NONE) { - /* Try to reserve an interrupt bit on the hub - * corresponding to the canidate cnode. If we - * are successful then we got a cpu which can - * act as an interrupt target for the io device. - * Otherwise we need to continue the search - * further. - */ - *resp_bit = do_intr_reserve_level(cpuid, - req_bit, - intr_resflags, - II_RESERVE, - owner_dev, - intr_name); - - if (*resp_bit >= 0) - /* The interrupt target specified was fine */ - return(cpuid); - } - return(CPU_NONE); -} -/* - * intr_heuristic(dev_t dev,device_desc_t dev_desc, - * int req_bit,int intr_resflags,dev_t owner_dev, - * char *intr_name,int *resp_bit) - * - * Choose an interrupt destination for an interrupt. - * dev is the device for which the interrupt is being set up - * dev_desc is a description of hardware and policy that could - * help determine where this interrupt should go - * req_bit is the interrupt bit requested - * (can be INTRCONNECT_ANY_BIT in which the first available - * interrupt bit is used) - * intr_resflags indicates whether we want to (un)reserve bit - * owner_dev is the owner device - * intr_name is the readable interrupt name - * resp_bit indicates whether we succeeded in getting the required - * action { (un)reservation} done - * negative value indicates failure - * - */ -/* ARGSUSED */ -cpuid_t -intr_heuristic(devfs_handle_t dev, - device_desc_t dev_desc, - int req_bit, - int intr_resflags, - devfs_handle_t owner_dev, - char *intr_name, - int *resp_bit) -{ - cpuid_t cpuid; /* possible intr targ*/ - cnodeid_t candidate; /* possible canidate */ -#ifdef LATER - cnodeid_t visited_cnodes[MAX_NASIDS], /* nodes seen so far */ - center, /* node we are on */ - candidate; /* possible canidate */ - int num_visited_cnodes = 0; /* # nodes seen */ - - int radius = 1, /* start looking at the - * current node - */ - maxradius = physmem_maxradius(); - void *rv; -#endif /* LATER */ - int which_subnode = SUBNODE_ANY; - -/* SN1 + pcibr Addressing Limitation */ - { - devfs_handle_t pconn_vhdl; - pcibr_soft_t pcibr_soft; - - /* - * This combination of SN1 and Bridge hardware has an odd "limitation". - * Due to the choice of addresses for PI0 and PI1 registers on SN1 - * and historical limitations in Bridge, Bridge is unable to - * send interrupts to both PI0 CPUs and PI1 CPUs -- we have - * to choose one set or the other. That choice is implicitly - * made when Bridge first attaches its error interrupt. After - * that point, all subsequent interrupts are restricted to the - * same PI number (though it's possible to send interrupts to - * the same PI number on a different node). - * - * Since neither SN1 nor Bridge designers are willing to admit a - * bug, we can't really call this a "workaround". It's a permanent - * solution for an SN1-specific and Bridge-specific hardware - * limitation that won't ever be lifted. - */ - if ((hwgraph_edge_get(dev, EDGE_LBL_PCI, &pconn_vhdl) == GRAPH_SUCCESS) && - ((pcibr_soft = pcibr_soft_get(pconn_vhdl)) != NULL)) { - /* - * We "know" that the error interrupt is the first - * interrupt set up by pcibr_attach. Send all interrupts - * on this bridge to the same subnode number. - */ - if (pcibr_soft->bsi_err_intr) { - which_subnode = cpuid_to_subnode(((hub_intr_t) pcibr_soft->bsi_err_intr)->i_cpuid); - } - } - } - -#ifdef LATER - /* - * If an interrupt target was specified for this - * interrupt allocation, try to use it. - */ - if (dev_desc) { - - /* Try to see if the interrupt target specified in the - * device descriptor is a legal candidate. - */ - cpuid = intr_bit_reserve_test(intr_target_from_desc(dev_desc, which_subnode), - which_subnode, - CNODEID_NONE, - req_bit, - intr_resflags, - owner_dev, - intr_name, - resp_bit); - - if (cpuid != CPU_NONE) { - if (cpu_on_subnode(cpuid, which_subnode)) - return(cpuid); /* got a valid interrupt target */ - - printk("Override explicit interrupt targetting: %v (0x%x)\n", - owner_dev, owner_dev); - - intr_unreserve_level(cpuid, *resp_bit); - } - - /* Fall through on to the next step in the search for - * the interrupt candidate. - */ - - } -#endif /* LATER */ - - /* Check if we can find a valid interrupt target candidate on - * the master node for the device. - */ - cpuid = intr_bit_reserve_test(CPU_NONE, - which_subnode, - master_node_get(dev), - req_bit, - intr_resflags, - owner_dev, - intr_name, - resp_bit); - - if (cpuid != CPU_NONE) { - if (cpu_on_subnode(cpuid, which_subnode)) - return(cpuid); /* got a valid interrupt target */ - else - intr_unreserve_level(cpuid, *resp_bit); - } - - PRINT_WARNING("Cannot target interrupts to closest node(%d): %ld (0x%lx)\n", - master_node_get(dev),(long) owner_dev, (unsigned long)owner_dev); - - /* Fall through into the default algorithm - * (exhaustive-search-for-the-nearest-possible-interrupt-target) - * for finding the interrupt target - */ - -#ifndef BRINGUP - // Use of this algorithm is deferred until the supporting - // code has been implemented. - /* - * No valid interrupt specification exists. - * Try to find a node which is closest to the current node - * which can process interrupts from a device - */ - - center = cpuid_to_cnodeid(smp_processor_id()); - while (radius <= maxradius) { - - /* Try to find a node at the given radius and which - * we haven't seen already. - */ - rv = physmem_select_neighbor_node(center,radius,&candidate, - intr_cnode_seen, - (void *)visited_cnodes, - (void *)&num_visited_cnodes); - if (!rv) { - /* We have seen all the nodes at this particular radius - * Go on to the next radius level. - */ - radius++; - continue; - } - /* We are seeing this candidate cnode for the first time - */ - visited_cnodes[num_visited_cnodes++] = candidate; - - cpuid = intr_bit_reserve_test(CPU_NONE, - which_subnode, - candidate, - req_bit, - intr_resflags, - owner_dev, - intr_name, - resp_bit); - - if (cpuid != CPU_NONE) { - if (cpu_on_subnode(cpuid, which_subnode)) - return(cpuid); /* got a valid interrupt target */ - else - intr_unreserve_level(cpuid, *resp_bit); - } - } -#else /* BRINGUP */ - { - // Do a stupid round-robin assignment of the node. - static cnodeid_t last_node = -1; - - if (last_node >= numnodes) last_node = 0; - for (candidate = last_node + 1; candidate != last_node; candidate++) { - if (candidate == numnodes) candidate = 0; - cpuid = intr_bit_reserve_test(CPU_NONE, - which_subnode, - candidate, - req_bit, - intr_resflags, - owner_dev, - intr_name, - resp_bit); - - if (cpuid != CPU_NONE) { - if (cpu_on_subnode(cpuid, which_subnode)) { - last_node = candidate; - return(cpuid); /* got a valid interrupt target */ - } - else - intr_unreserve_level(cpuid, *resp_bit); - } - } - last_node = candidate; - } -#endif - - PRINT_WARNING("Cannot target interrupts to any close node: %ld (0x%lx)\n", - (long)owner_dev, (unsigned long)owner_dev); - - /* In the worst case try to allocate interrupt bits on the - * master processor's node. We may get here during error interrupt - * allocation phase when the topology matrix is not yet setup - * and hence cannot do an exhaustive search. - */ - ASSERT(cpu_allows_intr(master_procid)); - cpuid = intr_bit_reserve_test(master_procid, - which_subnode, - CNODEID_NONE, - req_bit, - intr_resflags, - owner_dev, - intr_name, - resp_bit); - - if (cpuid != CPU_NONE) { - if (cpu_on_subnode(cpuid, which_subnode)) - return(cpuid); - else - intr_unreserve_level(cpuid, *resp_bit); - } - - PRINT_WARNING("Cannot target interrupts: %ld (0x%lx)\n", - (long)owner_dev, (unsigned long)owner_dev); - - return(CPU_NONE); /* Should never get here */ -} - - - - -#ifndef BRINGUP -/* - * Should never receive an exception while running on the idle - * stack. It IS possible to handle *interrupts* while on the - * idle stack, but a non-interrupt *exception* is a problem. - */ -void -idle_err(inst_t *epc, uint cause, void *fep, void *sp) -{ - eframe_t *ep = (eframe_t *)fep; - - if ((cause & CAUSE_EXCMASK) == EXC_IBE || - (cause & CAUSE_EXCMASK) == EXC_DBE) { - (void)dobuserre((eframe_t *)ep, epc, 0); - } - - /* XXX - This will have to change to deal with various SN errors. */ - panic( "exception on IDLE stack " - "ep:0x%x epc:0x%x cause:0x%w32x sp:0x%x badvaddr:0x%x", - ep, epc, cause, sp, getbadvaddr()); - /* NOTREACHED */ -} - - -/* - * earlynofault - handle very early global faults - usually just while - * sizing memory - * Returns: 1 if should do nofault - * 0 if not - */ -/* ARGSUSED */ -int -earlynofault(eframe_t *ep, uint code) -{ - switch(code) { - case EXC_DBE: - return(1); - default: - return(0); - } -} - - - -/* ARGSUSED */ -static void -cpuintr(void *arg1, void *arg2) -{ -#if RTE - static int rte_intrdebug = 1; -#endif - /* - * Frame Scheduler - */ - LOG_TSTAMP_EVENT(RTMON_INTR, TSTAMP_EV_CPUINTR, NULL, NULL, - NULL, NULL); - - /* - * Hardware clears the IO interrupts, but we need to clear software- - * generated interrupts. - */ - LOCAL_HUB_CLR_INTR(CPU_ACTION_A + cputolocalslice(cpuid())); - -#if 0 - /* XXX - Handle error interrupts. */ - if (error_intr_reason) - error_intr(); -#endif /* 0 */ - - /* - * If we're headed for panicspin and it is due to a NMI, save the - * eframe in the NMI area - */ - if (private.p_va_panicspin && nmied) { - caddr_t nmi_save_area; - - nmi_save_area = (caddr_t) (TO_UNCAC(TO_NODE( - cputonasid(cpuid()), IP27_NMI_EFRAME_OFFSET)) + - cputoslice(cpuid()) * IP27_NMI_EFRAME_SIZE); - bcopy((caddr_t) arg2, nmi_save_area, sizeof(eframe_t)); - } - - doacvec(); -#if RTE - if (private.p_flags & PDAF_ISOLATED && !rte_intrdebug) - goto end_cpuintr; -#endif - doactions(); -#if RTE -end_cpuintr: -#endif - LOG_TSTAMP_EVENT(RTMON_INTR, TSTAMP_EV_INTREXIT, TSTAMP_EV_CPUINTR, NULL, NULL, NULL); -} - -void -install_cpuintr(cpuid_t cpu) -{ - int intr_bit = CPU_ACTION_A + cputolocalslice(cpu); - - if (intr_connect_level(cpu, intr_bit, INTPEND0_MAXMASK, - (intr_func_t) cpuintr, NULL, NULL)) - panic("install_cpuintr: Can't connect interrupt."); -} -#endif /* BRINGUP */ - -#ifdef DEBUG_INTR_TSTAMP -/* We allocate an array, but only use element number 64. This guarantees that - * the entry is in a cacheline by itself. - */ -#define DINTR_CNTIDX 32 -#define DINTR_TSTAMP1 48 -#define DINTR_TSTAMP2 64 -volatile long long dintr_tstamp_cnt[128]; -int dintr_debug_output=0; -extern void idbg_tstamp_debug(void); -#ifdef SPLDEBUG -extern void idbg_splx_log(int); -#endif -#if DEBUG_INTR_TSTAMP_DEBUG -int dintr_enter_symmon=1000; /* 1000 microseconds is 1 millisecond */ -#endif - -#ifndef BRINGUP -/* ARGSUSED */ -static void -cpulatintr(void *arg) -{ - /* - * Hardware only clears IO interrupts so we have to clear our level - * here. - */ - LOCAL_HUB_CLR_INTR(CPU_INTRLAT_A + cputolocalslice(cpuid())); - -#if DEBUG_INTR_TSTAMP_DEBUG - dintr_tstamp_cnt[DINTR_TSTAMP2] = GET_LOCAL_RTC; - if ((dintr_tstamp_cnt[DINTR_TSTAMP2] - dintr_tstamp_cnt[DINTR_TSTAMP1]) - > dintr_enter_symmon) { -#ifdef SPLDEBUG - extern int spldebug_log_off; - - spldebug_log_off = 1; -#endif /* SPLDEBUG */ - debug("ring"); -#ifdef SPLDEBUG - spldebug_log_off = 0; -#endif /* SPLDEBUG */ - } -#endif - dintr_tstamp_cnt[DINTR_CNTIDX]++; - - return; -} - -static int install_cpulat_first=0; - -void -install_cpulatintr(cpuid_t cpu) -{ - int intr_bit; - devfs_handle_t cpuv = cpuid_to_vertex(cpu); - - intr_bit = CPU_INTRLAT_A + cputolocalslice(cpu); - if (intr_bit != intr_reserve_level(cpu, intr_bit, II_THREADED, - cpuv, "intrlat")) - panic( "install_cpulatintr: Can't reserve interrupt."); - - if (intr_connect_level(cpu, intr_bit, INTPEND0_MAXMASK, - cpulatintr, NULL, NULL)) - panic( "install_cpulatintr: Can't connect interrupt."); - - if (!install_cpulat_first) { - install_cpulat_first++; - idbg_addfunc("tstamp_debug", (void (*)())idbg_tstamp_debug); -#if defined(SPLDEBUG) || defined(SPLDEBUG_CPU_EVENTS) - idbg_addfunc("splx_log", (void (*)())idbg_splx_log); -#endif /* SPLDEBUG || SPLDEBUG_CPU_EVENTS */ - } -} -#endif /* BRINGUP */ - -#endif /* DEBUG_INTR_TSTAMP */ - -#ifndef BRINGUP -/* ARGSUSED */ -static void -dbgintr(void *arg) -{ - /* - * Hardware only clears IO interrupts so we have to clear our level - * here. - */ - LOCAL_HUB_CLR_INTR(N_INTPEND_BITS + DEBUG_INTR_A + cputolocalslice(cpuid())); - - debug("zing"); - return; -} - - -void -install_dbgintr(cpuid_t cpu) -{ - int intr_bit; - devfs_handle_t cpuv = cpuid_to_vertex(cpu); - - intr_bit = N_INTPEND_BITS + DEBUG_INTR_A + cputolocalslice(cpu); - if (intr_bit != intr_reserve_level(cpu, intr_bit, 1, cpuv, "DEBUG")) - panic("install_dbgintr: Can't reserve interrupt. " - " intr_bit %d" ,intr_bit); - - if (intr_connect_level(cpu, intr_bit, INTPEND1_MAXMASK, - dbgintr, NULL, NULL)) - panic("install_dbgintr: Can't connect interrupt."); - -#ifdef DEBUG_INTR_TSTAMP - /* Set up my interrupt latency test interrupt */ - install_cpulatintr(cpu); -#endif -} - -/* ARGSUSED */ -static void -tlbintr(void *arg) -{ - extern void tlbflush_rand(void); - - /* - * Hardware only clears IO interrupts so we have to clear our level - * here. - */ - LOCAL_HUB_CLR_INTR(N_INTPEND_BITS + TLB_INTR_A + cputolocalslice(cpuid())); - - tlbflush_rand(); - return; -} - - -void -install_tlbintr(cpuid_t cpu) -{ - int intr_bit; - devfs_handle_t cpuv = cpuid_to_vertex(cpu); - - intr_bit = N_INTPEND_BITS + TLB_INTR_A + cputolocalslice(cpu); - if (intr_bit != intr_reserve_level(cpu, intr_bit, 1, cpuv, "DEBUG")) - panic("install_tlbintr: Can't reserve interrupt. " - " intr_bit %d" ,intr_bit); - - if (intr_connect_level(cpu, intr_bit, INTPEND1_MAXMASK, - tlbintr, NULL, NULL)) - panic("install_tlbintr: Can't connect interrupt."); - -} - - -/* - * Send an interrupt to all nodes. Don't panic if we get an error. - * Returns 1 if any exceptions occurred. - */ -int -protected_broadcast(hubreg_t intrbit) -{ - nodepda_t *npdap = private.p_nodepda; - int byte, bit, sn; - int error = 0; - - extern int _wbadaddr_val(volatile void *, int, volatile int *); - - /* Send rather than clear an interrupt. */ - intrbit |= 0x100; - - for (byte = 0; byte < NASID_MASK_BYTES; byte++) { - for (bit = 0; bit < 8; bit++) { - if (npdap->nasid_mask[byte] & (1 << bit)) { - nasid_t nasid = byte * 8 + bit; - for (sn=0; snii_name, - vector->iv_func, vector->iv_arg, vector->iv_prefunc); - pf(" vertex 0x%x %s%s", - info->ii_owner_dev, - ((info->ii_flags) & II_RESERVE) ? "R" : "U", - ((info->ii_flags) & II_INUSE) ? "C" : "-"); - pf("%s%s%s%s", - ip & value ? "P" : "-", - ima & value ? "A" : "-", - imb & value ? "B" : "-", - ((info->ii_flags) & II_ERRORINT) ? "E" : "-"); - pf("\n"); -} - - -/* - * Dump information about interrupt vector assignment. - */ -void -intr_dumpvec(cnodeid_t cnode, void (*pf)(char *, ...)) -{ - nodepda_t *npda; - int ip, sn, bit; - intr_vecblk_t *dispatch; - hubreg_t ipr, ima, imb; - nasid_t nasid; - - if ((cnode < 0) || (cnode >= numnodes)) { - pf("intr_dumpvec: cnodeid out of range: %d\n", cnode); - return ; - } - - nasid = COMPACT_TO_NASID_NODEID(cnode); - - if (nasid == INVALID_NASID) { - pf("intr_dumpvec: Bad cnodeid: %d\n", cnode); - return ; - } - - - npda = NODEPDA(cnode); - - for (sn = 0; sn < NUM_SUBNODES; sn++) { - for (ip = 0; ip < 2; ip++) { - dispatch = ip ? &(SNPDA(npda,sn)->intr_dispatch1) : &(SNPDA(npda,sn)->intr_dispatch0); - ipr = REMOTE_HUB_PI_L(nasid, sn, ip ? PI_INT_PEND1 : PI_INT_PEND0); - ima = REMOTE_HUB_PI_L(nasid, sn, ip ? PI_INT_MASK1_A : PI_INT_MASK0_A); - imb = REMOTE_HUB_PI_L(nasid, sn, ip ? PI_INT_MASK1_B : PI_INT_MASK0_B); - - pf("Node %d INT_PEND%d:\n", cnode, ip); - - if (dispatch->ithreads_enabled) - pf(" Ithreads enabled\n"); - else - pf(" Ithreads disabled\n"); - pf(" vector_count = %d, vector_state = %d\n", - dispatch->vector_count, - dispatch->vector_state); - pf(" CPU A count %d, CPU B count %d\n", - dispatch->cpu_count[0], - dispatch->cpu_count[1]); - pf(" &vector_lock = 0x%x\n", - &(dispatch->vector_lock)); - for (bit = 0; bit < N_INTPEND_BITS; bit++) { - if ((dispatch->info[bit].ii_flags & II_RESERVE) || - (ipr & (1L << bit))) { - dump_vector(&(dispatch->info[bit]), - &(dispatch->vectors[bit]), - bit, ipr, ima, imb, pf); - } - } - pf("\n"); - } - } -} - diff -urN linux-2.4.18/arch/ia64/sn/io/ml_iograph.c lia64-2.4/arch/ia64/sn/io/ml_iograph.c --- linux-2.4.18/arch/ia64/sn/io/ml_iograph.c Thu Apr 12 12:16:35 2001 +++ lia64-2.4/arch/ia64/sn/io/ml_iograph.c Mon Feb 4 17:48:56 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ #include @@ -13,6 +12,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -30,8 +32,6 @@ #include #include -extern int maxnodes; - /* #define IOGRAPH_DEBUG */ #ifdef IOGRAPH_DEBUG #define DBG(x...) printk(x) @@ -107,10 +107,10 @@ #ifdef LATER if (!is_headless_node_vertex(master)) { #if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING("volunteer for widgets: vertex %v has no info label", + printk(KERN_WARNING "volunteer for widgets: vertex %v has no info label", xswitch); #else - PRINT_WARNING("volunteer for widgets: vertex 0x%x has no info label", + printk(KERN_WARNING "volunteer for widgets: vertex 0x%x has no info label", xswitch); #endif } @@ -155,11 +155,11 @@ #ifdef LATER if (!is_headless_node_vertex(hubv)) { #if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING("assign_widgets_to_volunteers:vertex %v has " + printk(KERN_WARNING "assign_widgets_to_volunteers:vertex %v has " " no info label", xswitch); #else - PRINT_WARNING("assign_widgets_to_volunteers:vertex 0x%x has " + printk(KERN_WARNING "assign_widgets_to_volunteers:vertex 0x%x has " " no info label", xswitch); #endif @@ -184,9 +184,6 @@ */ for (widgetnum=HUB_WIDGET_ID_MIN; widgetnum <= HUB_WIDGET_ID_MAX; widgetnum++) { -#ifndef BRINGUP - int i; -#endif /* * Ignore disabled/empty ports. */ @@ -244,7 +241,7 @@ cnodeid_t cnode; nasid_t nasid; lboard_t *board; - + /* * Init. the board-to-hwgraph link early, so FRU analyzer * doesn't trip on leftover values if we panic early on. @@ -267,55 +264,6 @@ hubio_init(); } -#ifdef LATER -/* There is an identical definition of this in os/scheduler/runq.c */ -#define INIT_COOKIE(cookie) cookie.must_run = 0; cookie.cpu = PDA_RUNANYWHERE -/* - * These functions absolutely doesn't belong here. It's here, though, - * until the scheduler provides a platform-independent version - * that works the way it should. The interface will definitely change, - * too. Currently used only in this file and by io/cdl.c in order to - * bind various I/O threads to a CPU on the proper node. - */ -cpu_cookie_t -setnoderun(cnodeid_t cnodeid) -{ - int i; - cpuid_t cpunum; - cpu_cookie_t cookie; - - INIT_COOKIE(cookie); - if (cnodeid == CNODEID_NONE) - return(cookie); - - /* - * Do a setmustrun to one of the CPUs on the specified - * node. - */ - if ((cpunum = CNODE_TO_CPU_BASE(cnodeid)) == CPU_NONE) { - return(cookie); - } - - cpunum += CNODE_NUM_CPUS(cnodeid) - 1; - - for (i = 0; i < CNODE_NUM_CPUS(cnodeid); i++, cpunum--) { - - if (cpu_enabled(cpunum)) { - cookie = setmustrun(cpunum); - break; - } - } - - return(cookie); -} - -void -restorenoderun(cpu_cookie_t cookie) -{ - restoremustrun(cookie); -} -#endif /* LATER */ - #ifdef LINUX_KERNEL_THREADS static struct semaphore io_init_sema; #endif @@ -445,6 +393,7 @@ slotid_t slot; lboard_t *board = NULL; char buffer[16]; + slotid_t get_widget_slotnum(int xbow, int widget); DBG("\nio_xswitch_widget_init: hubv 0x%p, xswitchv 0x%p, widgetnum 0x%x\n", hubv, xswitchv, widgetnum); /* @@ -507,6 +456,7 @@ { lboard_t dummy; + if (board) { DBG("io_xswitch_widget_init: Found KLTYPE_IOBRICK Board 0x%p brd_type 0x%x\n", board, board->brd_type); } else { @@ -517,7 +467,6 @@ } /* - * BRINGUP * Make sure we really want to say xbrick, pbrick, * etc. rather than XIO, graphics, etc. */ @@ -534,14 +483,10 @@ "%cbrick" "/%s/%d", buffer, #endif -#ifdef BRINGUP (board->brd_type == KLTYPE_IBRICK) ? 'I' : (board->brd_type == KLTYPE_PBRICK) ? 'P' : (board->brd_type == KLTYPE_XBRICK) ? 'X' : '?', -#else - toupper(MODULE_GET_BTCHAR(NODEPDA(cnode)->module_id)), -#endif /* BRINGUP */ EDGE_LBL_XTALK, widgetnum); } @@ -563,11 +508,7 @@ */ if (is_master_baseio(nasid, NODEPDA(cnode)->module_id, -#ifdef BRINGUP get_widget_slotnum(0,widgetnum))) { -#else - <<< BOMB! >>> Need a new way to get slot numbers on IP35/IP37 -#endif extern void klhwg_baseio_inventory_add(devfs_handle_t, cnodeid_t); module = NODEPDA(cnode)->module_id; @@ -582,7 +523,6 @@ (lboard_t *)KL_CONFIG_INFO(nasid), module); /* - * BRINGUP * Change iobrick to correct i/o brick */ #ifdef SUPPORT_PRINTING_M_FORMAT @@ -594,11 +534,7 @@ NODEPDA(cnode)->module_id, EDGE_LBL_XTALK, widgetnum); } else { -#ifdef BRINGUP slot = get_widget_slotnum(0, widgetnum); -#else - <<< BOMB! Need a new way to get slot numbers on IP35/IP37 -#endif board = get_board_name(nasid, module, slot, new_name); /* @@ -729,41 +665,25 @@ GRAPH_SUCCESS) continue; -#if defined (CONFIG_SGI_IP35) || defined (CONFIG_IA64_SGI_SN1) || defined (CONFIG_IA64_GENERIC) board = find_lboard_module((lboard_t *)KL_CONFIG_INFO(nasid), NODEPDA(cnodeid)->module_id); -#else - { - slotid_t slot; - slot = get_widget_slotnum(xbow_num, widgetnum); - board = find_lboard_modslot((lboard_t *)KL_CONFIG_INFO(nasid), - NODEPDA(cnodeid)->module_id, slot); - } -#endif /* CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 */ if (board == NULL && peer_nasid != INVALID_NASID) { /* * Try to find the board on our peer */ -#if defined (CONFIG_SGI_IP35) || defined (CONFIG_IA64_SGI_SN1) || defined (CONFIG_IA64_GENERIC) board = find_lboard_module( (lboard_t *)KL_CONFIG_INFO(peer_nasid), NODEPDA(cnodeid)->module_id); - -#else - board = find_lboard_modslot((lboard_t *)KL_CONFIG_INFO(peer_nasid), - NODEPDA(cnodeid)->module_id, slot); - -#endif /* CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 */ } if (board == NULL) { #if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING("Could not find PROM info for vertex %v, " + printk(KERN_WARNING "Could not find PROM info for vertex %v, " "FRU analyzer may fail", vhdl); #else - PRINT_WARNING("Could not find PROM info for vertex 0x%x, " + printk(KERN_WARNING "Could not find PROM info for vertex 0x%p, " "FRU analyzer may fail", - vhdl); + (void *)vhdl); #endif return; } @@ -918,7 +838,6 @@ DBG("io_init_node: Found XBOW widget_partnum= 0x%x\n", widget_partnum); npdap->basew_id = 0; -#if defined(BRINGUP) } else if (widget_partnum == XG_WIDGET_PART_NUM) { /* * OK, WTF do we do here if we have an XG direct connected to a HUB/Bedrock??? @@ -926,11 +845,10 @@ */ npdap->basew_id = 0; npdap->basew_id = (((*(volatile int32_t *)(NODE_SWIN_BASE(COMPACT_TO_NASID_NODEID(cnodeid), 0) + BRIDGE_WID_CONTROL))) & WIDGET_WIDGET_ID); -#endif } else { npdap->basew_id = (((*(volatile int32_t *)(NODE_SWIN_BASE(COMPACT_TO_NASID_NODEID(cnodeid), 0) + BRIDGE_WID_CONTROL))) & WIDGET_WIDGET_ID); - panic(" ****io_init_node: Unknown Widget Part Number 0x%x Widgt ID 0x%x attached to Hubv 0x%p ****\n", widget_partnum, npdap->basew_id, hubv); + panic(" ****io_init_node: Unknown Widget Part Number 0x%x Widgt ID 0x%x attached to Hubv 0x%p ****\n", widget_partnum, npdap->basew_id, (void *)hubv); /*NOTREACHED*/ } @@ -1037,7 +955,7 @@ #define __DEVSTR3 "/lun/0/disk/partition/" #define __DEVSTR4 "/../ef" -#if CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 || CONFIG_IA64_GENERIC +#if defined(CONFIG_IA64_SGI_SN1) /* * Currently, we need to allow for 5 IBrick slots with 1 FC each * plus an internal 1394. @@ -1045,6 +963,8 @@ * ioconfig starts numbering SCSI's at NUM_BASE_IO_SCSI_CTLR. */ #define NUM_BASE_IO_SCSI_CTLR 6 +#else +#define NUM_BASE_IO_SCSI_CTLR 6 #endif /* * This tells ioconfig where it can start numbering scsi controllers. @@ -1072,7 +992,6 @@ for (i=0; i -extern devfs_handle_t ioc3_console_vhdl_get(void); devfs_handle_t sys_critical_graph_root = GRAPH_VERTEX_NONE; /* Define the system critical vertices and connect them through @@ -1251,6 +1166,7 @@ { char name[MAXDEVNAME]; devfs_handle_t console_vhdl, pci_vhdl, enet_vhdl; + devfs_handle_t ioc3_console_vhdl_get(void); DBG("baseio_ctlr_num_set; FIXME\n"); @@ -1335,7 +1251,7 @@ rtn_val = pcibr_alloc_all_rrbs(vhdl, 0, 4,1, 4,0, 0,0, 0,0); } if (rtn_val) - PRINT_WARNING("sn00_rrb_alloc: pcibr_alloc_all_rrbs failed"); + printk(KERN_WARNING "sn00_rrb_alloc: pcibr_alloc_all_rrbs failed"); if ((vendor_list[5] != PCIIO_VENDOR_ID_NONE) && (vendor_list[7] != PCIIO_VENDOR_ID_NONE)) { @@ -1355,7 +1271,7 @@ rtn_val = pcibr_alloc_all_rrbs(vhdl, 1, 4,1, 4,0, 0,0, 0,0); } if (rtn_val) - PRINT_WARNING("sn00_rrb_alloc: pcibr_alloc_all_rrbs failed"); + printk(KERN_WARNING "sn00_rrb_alloc: pcibr_alloc_all_rrbs failed"); } @@ -1379,7 +1295,7 @@ #endif active = 0; - for (cnodeid = 0; cnodeid < maxnodes; cnodeid++) { + for (cnodeid = 0; cnodeid < numnodes; cnodeid++) { #ifdef LINUX_KERNEL_THREADS char thread_name[16]; extern int io_init_pri; @@ -1428,7 +1344,7 @@ #endif /* LINUX_KERNEL_THREADS */ - for (cnodeid = 0; cnodeid < maxnodes; cnodeid++) + for (cnodeid = 0; cnodeid < numnodes; cnodeid++) /* * Update information generated by IO init. */ diff -urN linux-2.4.18/arch/ia64/sn/io/module.c lia64-2.4/arch/ia64/sn/io/module.c --- linux-2.4.18/arch/ia64/sn/io/module.c Thu Apr 12 12:16:35 2001 +++ lia64-2.4/arch/ia64/sn/io/module.c Mon Feb 4 17:48:56 2002 @@ -4,13 +4,14 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ #include #include #include +#include +#include #include #include #include @@ -25,7 +26,7 @@ #include -/* #define LDEBUG 1 */ +/* #define LDEBUG 1 */ #ifdef LDEBUG #define DPRINTF printk @@ -173,9 +174,35 @@ lboard_t *board; klmod_serial_num_t *comp; char * bcopy(const char * src, char * dest, int count); + char serial_number[16]; + + /* + * record brick serial number + */ + board = find_lboard((lboard_t *) KL_CONFIG_INFO(nasid), KLTYPE_SNIA); + + if (! board || KL_CONFIG_DUPLICATE_BOARD(board)) + { +#if LDEBUG + printf ("module_probe_snum: no IP35 board found!\n"); +#endif + return 0; + } + + board_serial_number_get( board, serial_number ); + if( serial_number[0] != '\0' ) { + encode_str_serial( serial_number, m->snum.snum_str ); + m->snum_valid = 1; + } +#if LDEBUG + else { + printf("module_probe_snum: brick serial number is null!\n"); + } + printf("module_probe_snum: brick serial number == %s\n", serial_number); +#endif /* DEBUG */ board = find_lboard((lboard_t *) KL_CONFIG_INFO(nasid), - KLTYPE_MIDPLANE8); + KLTYPE_IOBRICK_XBOW); if (! board || KL_CONFIG_DUPLICATE_BOARD(board)) return 0; @@ -196,13 +223,13 @@ if (comp->snum.snum_str[0] != '\0') { bcopy(comp->snum.snum_str, - m->snum.snum_str, + m->sys_snum, MAX_SERIAL_NUM_SIZE); - m->snum_valid = 1; + m->sys_snum_valid = 1; } } - if (m->snum_valid) + if (m->sys_snum_valid) return 1; else { DPRINTF("Invalid serial number for module %d, " @@ -227,8 +254,7 @@ for (node = 0; node < numnodes; node++) { nasid = COMPACT_TO_NASID_NODEID(node); - board = find_lboard((lboard_t *) KL_CONFIG_INFO(nasid), - KLTYPE_IP27); + board = find_lboard((lboard_t *) KL_CONFIG_INFO(nasid), KLTYPE_SNIA); ASSERT(board); m = module_add_node(board->brd_module, node); @@ -241,7 +267,7 @@ nserial); if (nserial == 0) - PRINT_WARNING("io_module_init: No serial number found.\n"); + printk(KERN_WARNING "io_module_init: No serial number found.\n"); } elsc_t *get_elsc(void) diff -urN linux-2.4.18/arch/ia64/sn/io/pci.c lia64-2.4/arch/ia64/sn/io/pci.c --- linux-2.4.18/arch/ia64/sn/io/pci.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/pci.c Tue Feb 26 13:19:34 2002 @@ -1,12 +1,12 @@ /* * + * SNI64 specific PCI support for SNI IO. + * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * SNI64 specific PCI support for SNI IO. - * - * Copyright (C) 1997, 1998, 2000 Colin Ngam + * Copyright (c) 1997, 1998, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ #include #include @@ -14,7 +14,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -227,7 +228,7 @@ * snia64_pci_find_bios - SNIA64 pci_find_bios() platform specific code. */ void __init -sn1_pci_find_bios(void) +sn_pci_find_bios(void) { extern struct pci_ops pci_conf; /* @@ -237,11 +238,7 @@ sgi_master_io_infr_init(); -#ifdef BRINGUP - if ( IS_RUNNING_ON_SIMULATOR() ) - return; -#endif - /* sn1_io_infrastructure_init(); */ + /* sn_io_infrastructure_init(); */ pci_conf = snia64_pci_ops; } @@ -251,8 +248,6 @@ int i; unsigned int size; - devfs_handle_t bridge_vhdl = pci_bus_to_vertex(d->bus->number); - /* IOC3 only decodes 0x20 bytes of the config space, reading * beyond that is relatively benign but writing beyond that * (especially the base address registers) will shut down the @@ -294,5 +289,12 @@ d->subsystem_device = 0; } + +#else +void sn_pci_find_bios(void) {} +void pci_fixup_ioc3(struct pci_dev *d) {} +struct list_head pci_root_buses; +struct list_head pci_root_buses; +struct list_head pci_devices; #endif /* CONFIG_PCI */ diff -urN linux-2.4.18/arch/ia64/sn/io/pci_bus_cvlink.c lia64-2.4/arch/ia64/sn/io/pci_bus_cvlink.c --- linux-2.4.18/arch/ia64/sn/io/pci_bus_cvlink.c Thu Apr 12 12:16:35 2001 +++ lia64-2.4/arch/ia64/sn/io/pci_bus_cvlink.c Tue Feb 26 13:19:34 2002 @@ -4,19 +4,21 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ +#include #include #include #include +#include #include #include #include #include #include -#include +#include +#include #include #include #include @@ -26,20 +28,19 @@ #include #include #include -#include #include #include #include -#include - +#include #include -// #include #include #include -extern int bridge_rev_b_data_check_disable; #include +#include +#include + +extern int bridge_rev_b_data_check_disable; -#define MAX_PCI_XWIDGET 256 devfs_handle_t busnum_to_pcibr_vhdl[MAX_PCI_XWIDGET]; nasid_t busnum_to_nid[MAX_PCI_XWIDGET]; void * busnum_to_atedmamaps[MAX_PCI_XWIDGET]; @@ -49,11 +50,13 @@ static int pci_bus_map_create(devfs_handle_t xtalk); devfs_handle_t devfn_to_vertex(unsigned char busnum, unsigned int devfn); -#define SN1_IOPORTS_UNIT 256 +#define SN_IOPORTS_UNIT 256 #define MAX_IOPORTS 0xffff -#define MAX_IOPORTS_CHUNKS (MAX_IOPORTS / SN1_IOPORTS_UNIT) +#define MAX_IOPORTS_CHUNKS (MAX_IOPORTS / SN_IOPORTS_UNIT) struct ioports_to_tlbs_s ioports_to_tlbs[MAX_IOPORTS_CHUNKS]; -unsigned long sn1_allocate_ioports(unsigned long pci_address); +unsigned long sn_allocate_ioports(unsigned long pci_address); + +extern void sn_init_irq_desc(void); @@ -104,7 +107,7 @@ int func = 0; char name[16]; devfs_handle_t pci_bus = NULL; - devfs_handle_t device_vertex = NULL; + devfs_handle_t device_vertex = (devfs_handle_t)NULL; /* * Go get the pci bus vertex. @@ -129,11 +132,25 @@ slot = PCI_SLOT(devfn); func = PCI_FUNC(devfn); - if (func == 0) + /* + * For a NON Multi-function card the name of the device looks like: + * ../pci/1, ../pci/2 .. + */ + if (func == 0) { sprintf(name, "%d", slot); - else - sprintf(name, "%d%c", slot, 'a'+func); - + if (hwgraph_traverse(pci_bus, name, &device_vertex) == + GRAPH_SUCCESS) { + if (device_vertex) { + return(device_vertex); + } + } + } + + /* + * This maybe a multifunction card. It's names look like: + * ../pci/1a, ../pci/1b, etc. + */ + sprintf(name, "%d%c", slot, 'a'+func); if (hwgraph_traverse(pci_bus, name, &device_vertex) != GRAPH_SUCCESS) { if (!device_vertex) { return(NULL); @@ -144,12 +161,42 @@ } /* + * For the given device, initialize the addresses for both the Device(x) Flush + * Write Buffer register and the Xbow Flush Register for the port the PCI bus + * is connected. + */ +static void +set_flush_addresses(struct pci_dev *device_dev, + struct sn_device_sysdata *device_sysdata) +{ + pciio_info_t pciio_info = pciio_info_get(device_sysdata->vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + bridge_t *bridge = pcibr_soft->bs_base; + + device_sysdata->dma_buf_sync = (volatile unsigned int *) + &(bridge->b_wr_req_buf[pciio_slot].reg); + device_sysdata->xbow_buf_sync = (volatile unsigned int *) + XBOW_PRIO_LINKREGS_PTR(NODE_SWIN_BASE(get_nasid(), 0), + pcibr_soft->bs_xid); +#ifdef DEBUG + + printk("set_flush_addresses: dma_buf_sync %p xbow_buf_sync %p\n", + device_sysdata->dma_buf_sync, device_sysdata->xbow_buf_sync); + + while((volatile unsigned int )*device_sysdata->dma_buf_sync); + while((volatile unsigned int )*device_sysdata->xbow_buf_sync); +#endif + +} + +/* * Most drivers currently do not properly tell the arch specific pci dma * interfaces whether they can handle A64. Here is where we privately * keep track of this. */ static void __init -set_sn1_pci64(struct pci_dev *dev) +set_sn_pci64(struct pci_dev *dev) { unsigned short vendor = dev->vendor; unsigned short device = dev->device; @@ -172,7 +219,7 @@ } /* - * sn1_allocate_ioports() - This routine provides the allocation and + * sn_allocate_ioports() - This routine provides the allocation and * mappings between Linux style IOPORTs management. * * For simplicity sake, SN1 will allocate IOPORTs in chunks of @@ -189,9 +236,9 @@ * Address. This address via the tlb entries generates the PCI Address * allocated by the SN1 IO Infrastructure Layer. */ -static unsigned long sn1_ioport_num = 0x100; /* Reserve room for Legacy stuff */ +static unsigned long sn_ioport_num = 0x1000; /* Reserve room for Legacy stuff */ unsigned long -sn1_allocate_ioports(unsigned long pci_address) +sn_allocate_ioports(unsigned long pci_address) { unsigned long ioport_index; @@ -199,8 +246,8 @@ /* * Just some idiot checking .. */ - if ( sn1_ioport_num > 0xffff ) { - printk("sn1_allocate_ioports: No more IO PORTS available\n"); + if ( sn_ioport_num > 0xffff ) { + printk("sn_allocate_ioports: No more IO PORTS available\n"); return(-1); } @@ -208,51 +255,64 @@ * See Section 4.1.1.5 of Intel IA-64 Acrchitecture Software Developer's * Manual for details. */ - ioport_index = sn1_ioport_num / SN1_IOPORTS_UNIT; - ioports_to_tlbs[ioport_index].ppn = pci_address; + ioport_index = sn_ioport_num / SN_IOPORTS_UNIT; + ioports_to_tlbs[ioport_index].p = 1; /* Present Bit */ - ioports_to_tlbs[ioport_index].ma = 5; /* Memory Attributes */ - ioports_to_tlbs[ioport_index].a = 0; /* Set Data Access Bit Fault */ - ioports_to_tlbs[ioport_index].d = 0; /* Dirty Bit */ - ioports_to_tlbs[ioport_index].pl = 3;/* Privilege Level - All levels can R/W*/ - ioports_to_tlbs[ioport_index].ar = 2; /* Access Rights - R/W only*/ + ioports_to_tlbs[ioport_index].rv_1 = 0; /* 1 Bit */ + ioports_to_tlbs[ioport_index].ma = 4; /* Memory Attributes 3 bits*/ + ioports_to_tlbs[ioport_index].a = 1; /* Set Data Access Bit Fault 1 Bit*/ + ioports_to_tlbs[ioport_index].d = 1; /* Dirty Bit */ + ioports_to_tlbs[ioport_index].pl = 0;/* Privilege Level - All levels can R/W*/ + ioports_to_tlbs[ioport_index].ar = 3; /* Access Rights - R/W only*/ + ioports_to_tlbs[ioport_index].ppn = pci_address >> 12; /* 4K page size */ ioports_to_tlbs[ioport_index].ed = 0; /* Exception Deferral Bit */ ioports_to_tlbs[ioport_index].ig = 0; /* Ignored */ - printk("sn1_allocate_ioports: ioport_index 0x%x ioports_to_tlbs 0x%p\n", ioport_index, ioports_to_tlbs[ioport_index].ppn); + /* printk("sn_allocate_ioports: ioport_index 0x%x ioports_to_tlbs 0x%p\n", ioport_index, ioports_to_tlbs[ioport_index]); */ - sn1_ioport_num += SN1_IOPORTS_UNIT; + sn_ioport_num += SN_IOPORTS_UNIT; - return(sn1_ioport_num - SN1_IOPORTS_UNIT); + return(sn_ioport_num - SN_IOPORTS_UNIT); } /* - * sn1_pci_fixup() - This routine is called when platform_pci_fixup() is + * sn_pci_fixup() - This routine is called when platform_pci_fixup() is * invoked at the end of pcibios_init() to link the Linux pci * infrastructure to SGI IO Infrasturcture - ia64/kernel/pci.c * * Other platform specific fixup can also be done here. */ void -sn1_pci_fixup(int arg) +sn_pci_fixup(int arg) { struct list_head *ln; struct pci_bus *pci_bus = NULL; struct pci_dev *device_dev = NULL; - struct sn1_widget_sysdata *widget_sysdata; - struct sn1_device_sysdata *device_sysdata; + struct sn_widget_sysdata *widget_sysdata; + struct sn_device_sysdata *device_sysdata; +#ifdef SN_IOPORTS unsigned long ioport; +#endif pciio_intr_t intr_handle; int cpuid, bit; - devfs_handle_t *device_vertex; + devfs_handle_t device_vertex; pciio_intr_line_t lines; - extern void sn1_pci_find_bios(void); - + extern void sn_pci_find_bios(void); +#ifdef CONFIG_IA64_SGI_SN2 + extern int numnodes; + int cnode; +#endif /* CONFIG_IA64_SGI_SN2 */ -unsigned long res; if (arg == 0) { - sn1_pci_find_bios(); + sn_init_irq_desc(); + sn_pci_find_bios(); +#ifdef CONFIG_IA64_SGI_SN2 + for (cnode = 0; cnode < numnodes; cnode++) { + extern void intr_init_vecblk(nodepda_t *npda, cnodeid_t, int); + intr_init_vecblk(NODEPDA(cnode), cnode, 0); + } +#endif /* CONFIG_IA64_SGI_SN2 */ return; } @@ -274,19 +334,12 @@ #endif done_probing = 1; - if ( IS_RUNNING_ON_SIMULATOR() ) { - printk("sn1_pci_fixup not supported on simulator.\n"); - return; - } - -#ifdef REAL_HARDWARE - /* * Initialize the pci bus vertex in the pci_bus struct. */ for( ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) { pci_bus = pci_bus_b(ln); - widget_sysdata = kmalloc(sizeof(struct sn1_widget_sysdata), + widget_sysdata = kmalloc(sizeof(struct sn_widget_sysdata), GFP_KERNEL); widget_sysdata->vhdl = pci_bus_to_vertex(pci_bus->number); pci_bus->sysdata = (void *)widget_sysdata; @@ -296,8 +349,35 @@ * set the root start and end so that drivers calling check_region() * won't see a conflict */ - ioport_resource.start |= IO_SWIZ_BASE; - ioport_resource.end |= (HSPEC_SWIZ_BASE-1); +#ifdef SN_IOPORTS + ioport_resource.start = sn_ioport_num; + ioport_resource.end = 0xffff; +#else +#if defined(CONFIG_IA64_SGI_SN1) + if ( IS_RUNNING_ON_SIMULATOR() ) { + /* + * IDE legacy IO PORTs are supported in Medusa. + * Just open up IO PORTs from 0 .. ioport_resource.end. + */ + ioport_resource.start = 0; + } else { + /* + * We do not support Legacy IO PORT numbers. + */ + ioport_resource.start |= IO_SWIZ_BASE | __IA64_UNCACHED_OFFSET; + } + ioport_resource.end |= (HSPEC_SWIZ_BASE-1) | __IA64_UNCACHED_OFFSET; +#else + // Need something here for sn2.... ZXZXZX +#endif +#endif + + /* + * Set the root start and end for Mem Resource. + */ + iomem_resource.start = 0; + iomem_resource.end = 0xffffffffffffffff; + /* * Initialize the device vertex in the pci_dev struct. */ @@ -307,6 +387,7 @@ u16 cmd; devfs_handle_t vhdl; unsigned long size; + extern int bit_pos_to_irq(int); if (device_dev->vendor == PCI_VENDOR_ID_SGI && device_dev->device == PCI_DEVICE_ID_SGI_IOC3) { @@ -316,12 +397,18 @@ /* Set the device vertex */ - device_sysdata = kmalloc(sizeof(struct sn1_device_sysdata), + device_sysdata = kmalloc(sizeof(struct sn_device_sysdata), GFP_KERNEL); device_sysdata->vhdl = devfn_to_vertex(device_dev->bus->number, device_dev->devfn); device_sysdata->isa64 = 0; + /* + * Set the xbridge Device(X) Write Buffer Flush and Xbow Flush + * register addresses. + */ + (void) set_flush_addresses(device_dev, device_sysdata); + device_dev->sysdata = (void *) device_sysdata; - set_sn1_pci64(device_dev); + set_sn_pci64(device_dev); pci_read_config_word(device_dev, PCI_COMMAND, &cmd); /* @@ -336,11 +423,8 @@ size = device_dev->resource[idx].end - device_dev->resource[idx].start; if (size) { - res = 0; - res = pciio_config_get(vhdl, (unsigned) PCI_BASE_ADDRESS_0 + idx, 4); device_dev->resource[idx].start = (unsigned long)pciio_pio_addr(vhdl, 0, PCIIO_SPACE_WIN(idx), 0, size, 0, PCIIO_BYTE_STREAM); - -/* printk("sn1_pci_fixup: Mapped Address = 0x%p size = 0x%x\n", device_dev->resource[idx].start, size); */ + device_dev->resource[idx].start |= __IA64_UNCACHED_OFFSET; } else continue; @@ -348,6 +432,7 @@ device_dev->resource[idx].end = device_dev->resource[idx].start + size; +#ifdef CONFIG_IA64_SGI_SN1 /* * Adjust the addresses to go to the SWIZZLE .. */ @@ -355,15 +440,25 @@ device_dev->resource[idx].start & 0xfffff7ffffffffff; device_dev->resource[idx].end = device_dev->resource[idx].end & 0xfffff7ffffffffff; - res = 0; - res = pciio_config_get(vhdl, (unsigned) PCI_BASE_ADDRESS_0 + idx, 4); +#endif + if (device_dev->resource[idx].flags & IORESOURCE_IO) { cmd |= PCI_COMMAND_IO; - ioport = sn1_allocate_ioports(device_dev->resource[idx].start); - /* device_dev->resource[idx].start = ioport; */ - /* device_dev->resource[idx].end = ioport + SN1_IOPORTS_UNIT */ +#ifdef SN_IOPORTS + ioport = sn_allocate_ioports(device_dev->resource[idx].start); + if (ioport < 0) { + printk("sn_pci_fixup: PCI Device 0x%x on PCI Bus %d not mapped to IO PORTs .. IO PORTs exhausted\n", device_dev->devfn, device_dev->bus->number); + continue; + } + pciio_config_set(vhdl, (unsigned) PCI_BASE_ADDRESS_0 + (idx * 4), 4, (res + (ioport & 0xfff))); + +printk("sn_pci_fixup: ioport number %d mapped to pci address 0x%lx\n", ioport, (res + (ioport & 0xfff))); + + device_dev->resource[idx].start = ioport; + device_dev->resource[idx].end = ioport + SN_IOPORTS_UNIT; +#endif } - else if (device_dev->resource[idx].flags & IORESOURCE_MEM) + if (device_dev->resource[idx].flags & IORESOURCE_MEM) cmd |= PCI_COMMAND_MEMORY; } /* @@ -371,17 +466,24 @@ */ size = device_dev->resource[PCI_ROM_RESOURCE].end - device_dev->resource[PCI_ROM_RESOURCE].start; - device_dev->resource[PCI_ROM_RESOURCE].start = + + if (size) { + device_dev->resource[PCI_ROM_RESOURCE].start = (unsigned long) pciio_pio_addr(vhdl, 0, PCIIO_SPACE_ROM, 0, size, 0, PCIIO_BYTE_STREAM); - device_dev->resource[PCI_ROM_RESOURCE].end = + device_dev->resource[PCI_ROM_RESOURCE].start |= __IA64_UNCACHED_OFFSET; + device_dev->resource[PCI_ROM_RESOURCE].end = device_dev->resource[PCI_ROM_RESOURCE].start + size; - /* - * go through synergy swizzled space - */ - device_dev->resource[PCI_ROM_RESOURCE].start &= 0xfffff7ffffffffffUL; - device_dev->resource[PCI_ROM_RESOURCE].end &= 0xfffff7ffffffffffUL; +#ifdef CONFIG_IA64_SGI_SN1 + /* + * go through synergy swizzled space + */ + device_dev->resource[PCI_ROM_RESOURCE].start &= 0xfffff7ffffffffffUL; + device_dev->resource[PCI_ROM_RESOURCE].end &= 0xfffff7ffffffffffUL; +#endif + + } /* * Update the Command Word on the Card. @@ -390,29 +492,46 @@ /* bit gets dropped .. no harm */ pci_write_config_word(device_dev, PCI_COMMAND, cmd); - pci_read_config_byte(device_dev, PCI_INTERRUPT_PIN, &lines); -#ifdef BRINGUP + pci_read_config_byte(device_dev, PCI_INTERRUPT_PIN, (unsigned char *)&lines); if (device_dev->vendor == PCI_VENDOR_ID_SGI && device_dev->device == PCI_DEVICE_ID_SGI_IOC3 ) { lines = 1; } - -#endif - device_sysdata = (struct sn1_device_sysdata *)device_dev->sysdata; + device_sysdata = (struct sn_device_sysdata *)device_dev->sysdata; device_vertex = device_sysdata->vhdl; intr_handle = pciio_intr_alloc(device_vertex, NULL, lines, device_vertex); bit = intr_handle->pi_irq; cpuid = intr_handle->pi_cpu; +#ifdef CONFIG_IA64_SGI_SN1 irq = bit_pos_to_irq(bit); +#else /* SN2 */ + irq = bit; +#endif irq = irq + (cpuid << 8); - pciio_intr_connect(intr_handle, NULL, NULL, NULL); + pciio_intr_connect(intr_handle); device_dev->irq = irq; +#ifdef ajmtestintr + { + int slot = PCI_SLOT(device_dev->devfn); + static int timer_set = 0; + pcibr_intr_t pcibr_intr = (pcibr_intr_t)intr_handle; + pcibr_soft_t pcibr_soft = pcibr_intr->bi_soft; + extern void intr_test_handle_intr(int, void*, struct pt_regs *); + + if (!timer_set) { + intr_test_set_timer(); + timer_set = 1; + } + intr_test_register_irq(irq, pcibr_soft, slot); + request_irq(irq, intr_test_handle_intr,0,NULL, NULL); + } +#endif } -#endif /* REAL_HARDWARE */ + #if 0 { @@ -430,6 +549,10 @@ printk("pci_fixup_ioc3: Devreg 6 0x%x\n", bridge->b_device[6].reg); printk("pci_fixup_ioc3: Devreg 7 0x%x\n", bridge->b_device[7].reg); } + +printk("testing Big Window: 0xC0000200c0000000 %p\n", *( (volatile uint64_t *)0xc0000200a0000000)); +printk("testing Big Window: 0xC0000200c0000008 %p\n", *( (volatile uint64_t *)0xc0000200a0000008)); + #endif } @@ -472,12 +595,14 @@ * Loop throught this vertex and get the Xwidgets .. */ for (widgetnum = HUB_WIDGET_ID_MAX; widgetnum >= HUB_WIDGET_ID_MIN; widgetnum--) { +#if 0 { int pos; char dname[256]; pos = devfs_generate_path(xtalk, dname, 256); printk("%s : path= %s\n", __FUNCTION__, &dname[pos]); } +#endif sprintf(pathname, "%d", widgetnum); xwidget = NULL; @@ -512,12 +637,12 @@ */ master_node_vertex = device_master_get(xwidget); if (!master_node_vertex) { - printk("WARNING: pci_bus_map_create: Unable to get .master for vertex 0x%p\n", xwidget); + printk("WARNING: pci_bus_map_create: Unable to get .master for vertex 0x%p\n", (void *)xwidget); } hubinfo_get(master_node_vertex, &hubinfo); if (!hubinfo) { - printk("WARNING: pci_bus_map_create: Unable to get hubinfo for master node vertex 0x%p\n", master_node_vertex); + printk("WARNING: pci_bus_map_create: Unable to get hubinfo for master node vertex 0x%p\n", (void *)master_node_vertex); return(1); } else { busnum_to_nid[num_bridges - 1] = hubinfo->h_nasid; @@ -527,12 +652,12 @@ * Pre assign DMA maps needed for 32 Bits Page Map DMA. */ busnum_to_atedmamaps[num_bridges - 1] = (void *) kmalloc( - sizeof(struct sn1_dma_maps_s) * 512, GFP_KERNEL); + sizeof(struct sn_dma_maps_s) * MAX_ATE_MAPS, GFP_KERNEL); if (!busnum_to_atedmamaps[num_bridges - 1]) - printk("WARNING: pci_bus_map_create: Unable to precreate ATE DMA Maps for busnum %d vertex 0x%p\n", num_bridges - 1, xwidget); + printk("WARNING: pci_bus_map_create: Unable to precreate ATE DMA Maps for busnum %d vertex 0x%p\n", num_bridges - 1, (void *)xwidget); memset(busnum_to_atedmamaps[num_bridges - 1], 0x0, - sizeof(struct sn1_dma_maps_s) * 512); + sizeof(struct sn_dma_maps_s) * MAX_ATE_MAPS); } @@ -552,14 +677,10 @@ { devfs_handle_t devfs_hdl = NULL; - devfs_handle_t module_comp = NULL; - devfs_handle_t node = NULL; devfs_handle_t xtalk = NULL; - graph_vertex_place_t placeptr = EDGE_PLACE_WANT_REAL_EDGES; int rv = 0; char name[256]; int master_iobrick; - moduleid_t iobrick_id; int i; /* @@ -619,66 +740,4 @@ } return(0); -} - -/* - * sgi_pci_intr_support - - */ -int -sgi_pci_intr_support (unsigned int requested_irq, device_desc_t *dev_desc, - devfs_handle_t *bus_vertex, pciio_intr_line_t *lines, - devfs_handle_t *device_vertex) - -{ - - unsigned int bus; - unsigned int devfn; - struct pci_dev *pci_dev; - unsigned char intr_pin = 0; - struct sn1_widget_sysdata *widget_sysdata; - struct sn1_device_sysdata *device_sysdata; - - if (!dev_desc || !bus_vertex || !device_vertex) { - printk("WARNING: sgi_pci_intr_support: Invalid parameter dev_desc 0x%p, bus_vertex 0x%p, device_vertex 0x%p\n", dev_desc, bus_vertex, device_vertex); - return(-1); - } - - devfn = (requested_irq >> 8) & 0xff; - bus = (requested_irq >> 16) & 0xffff; - pci_dev = pci_find_slot(bus, devfn); - widget_sysdata = (struct sn1_widget_sysdata *)pci_dev->bus->sysdata; - *bus_vertex = widget_sysdata->vhdl; - device_sysdata = (struct sn1_device_sysdata *)pci_dev->sysdata; - *device_vertex = device_sysdata->vhdl; -#if 0 - { - int pos; - char dname[256]; - pos = devfs_generate_path(*device_vertex, dname, 256); - printk("%s : path= %s pos %d\n", __FUNCTION__, &dname[pos], pos); - } -#endif /* BRINGUP */ - - - /* - * Get the Interrupt PIN. - */ - pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &intr_pin); - *lines = (pciio_intr_line_t)intr_pin; - -#ifdef BRINGUP - /* - * ioc3 can't decode the PCI_INTERRUPT_PIN field of its config - * space so we have to set it here - */ - if (pci_dev->vendor == PCI_VENDOR_ID_SGI && - pci_dev->device == PCI_DEVICE_ID_SGI_IOC3 ) { - *lines = 1; - } -#endif /* BRINGUP */ - - /* Not supported currently */ - *dev_desc = NULL; - return(0); - } diff -urN linux-2.4.18/arch/ia64/sn/io/pci_dma.c lia64-2.4/arch/ia64/sn/io/pci_dma.c --- linux-2.4.18/arch/ia64/sn/io/pci_dma.c Wed Oct 24 10:17:42 2001 +++ lia64-2.4/arch/ia64/sn/io/pci_dma.c Fri Apr 26 17:15:30 2002 @@ -3,235 +3,377 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Leo Dagum + * Copyright (C) 2000,2002 Silicon Graphics, Inc. All rights reserved. + * + * Routines for PCI DMA mapping. See Documentation/DMA-mapping.txt for + * a description of how these routines should be used. */ -#include #include #include #include #include #include #include +#include -#ifndef LANGUAGE_C -#define LANGUAGE_C 99 -#endif -#ifndef _LANGUAGE_C -#define _LANGUAGE_C 99 -#endif - +#include #include #include +#include #include #include #include #include -#include +#include #include #include #include +#include -/* - * this is REALLY ugly, blame it on gcc's lame inlining that we - * have to put procedures in header files - */ -#if LANGUAGE_C == 99 -#undef LANGUAGE_C -#endif -#if CONFIG_IA64_SGI_IO == 99 -#undef CONFIG_IA64_SGI_IO +/* DMA, PIO, and memory allocation flags */ +#ifdef CONFIG_IA64_SGI_SN1 +#define DMA_DATA_FLAGS ( PCIIO_BYTE_STREAM | PCIIO_DMA_DATA ) +#define DMA_CONTROL_FLAGS ( PCIIO_BYTE_STREAM | PCIBR_BARRIER | \ + PCIIO_DMA_CMD ) +#elif defined(CONFIG_IA64_SGI_SN2) +#define DMA_DATA_FLAGS ( PCIIO_DMA_DATA ) +#define DMA_CONTROL_FLAGS ( PCIBR_BARRIER | PCIIO_DMA_CMD ) +#else +#error need to define DMA mapping flags for this platform #endif +/* + * For ATE allocations + */ pciio_dmamap_t get_free_pciio_dmamap(devfs_handle_t); -struct sn1_dma_maps_s *find_sn1_dma_map(dma_addr_t, unsigned char); +void free_pciio_dmamap(pcibr_dmamap_t); +static struct sn_dma_maps_s *find_sn_dma_map(dma_addr_t, unsigned char); + +/* + * Toplogy stuff + */ extern devfs_handle_t busnum_to_pcibr_vhdl[]; extern nasid_t busnum_to_nid[]; extern void * busnum_to_atedmamaps[]; -/* - * Get a free pciio_dmamap_t entry. +/** + * get_free_pciio_dmamap - find and allocate an ATE + * @pci_bus: PCI bus to get an entry for + * + * Finds and allocates an ATE on the PCI bus specified + * by @pci_bus. */ pciio_dmamap_t get_free_pciio_dmamap(devfs_handle_t pci_bus) { int i; - struct sn1_dma_maps_s *sn1_dma_map = NULL; + struct sn_dma_maps_s *sn_dma_map = NULL; /* * Darn, we need to get the maps allocated for this bus. */ - for (i=0; i<512; i++) { + for (i = 0; i < MAX_PCI_XWIDGET; i++) { if (busnum_to_pcibr_vhdl[i] == pci_bus) { - sn1_dma_map = busnum_to_atedmamaps[i]; + sn_dma_map = busnum_to_atedmamaps[i]; } } /* * Now get a free dmamap entry from this list. */ - for (i=0; i<512; i++, sn1_dma_map++) { - if (!sn1_dma_map->dma_addr) { - sn1_dma_map->dma_addr = -1; - return( (pciio_dmamap_t) sn1_dma_map ); + for (i = 0; i < MAX_ATE_MAPS; i++, sn_dma_map++) { + if (!sn_dma_map->dma_addr) { + sn_dma_map->dma_addr = -1; + return( (pciio_dmamap_t) sn_dma_map ); } } -printk("get_pciio_dmamap: Unable to find a free dmamap\n"); - return(NULL); + return NULL; +} +/** + * free_pciio_dmamap - free an ATE + * @dma_map: ATE to free + * + * Frees the ATE specified by @dma_map. + */ +void +free_pciio_dmamap(pcibr_dmamap_t dma_map) +{ + struct sn_dma_maps_s *sn_dma_map; + + sn_dma_map = (struct sn_dma_maps_s *) dma_map; + sn_dma_map->dma_addr = 0; } -struct sn1_dma_maps_s * -find_sn1_dma_map(dma_addr_t dma_addr, unsigned char busnum) +/** + * find_sn_dma_map - find an ATE associated with @dma_addr and @busnum + * @dma_addr: DMA address to look for + * @busnum: PCI bus to look on + * + * Finds the ATE associated with @dma_addr and @busnum. + */ +static struct sn_dma_maps_s * +find_sn_dma_map(dma_addr_t dma_addr, unsigned char busnum) { - struct sn1_dma_maps_s *sn1_dma_map = NULL; + struct sn_dma_maps_s *sn_dma_map = NULL; int i; - sn1_dma_map = busnum_to_atedmamaps[busnum]; + sn_dma_map = busnum_to_atedmamaps[busnum]; - for (i=0; i<512; i++, sn1_dma_map++) { - if (sn1_dma_map->dma_addr == dma_addr) { - return( sn1_dma_map ); + for (i = 0; i < MAX_ATE_MAPS; i++, sn_dma_map++) { + if (sn_dma_map->dma_addr == dma_addr) { + return sn_dma_map; } } -printk("find_pciio_dmamap: Unable find the corresponding dma map\n"); - return(NULL); + printk(KERN_WARNING "find_sn_dma_map: Unable find the corresponding " + "dma map\n"); + return NULL; } -/* - * sn1 platform specific pci_alloc_consistent() +/** + * sn_dma_sync - try to flush DMA buffers into the coherence domain + * @hwdev: device to flush + * + * This routine flushes all DMA buffers for the device into the II of + * the destination hub. * - * this interface is meant for "command" streams, i.e. called only - * once for initializing a device, so we don't want prefetching or - * write gathering turned on, hence the PCIIO_DMA_CMD flag + * NOTE!: this does not mean that the data is in the "coherence domain", + * but it is very close. In other words, this routine *does not work* + * as advertised due to hardware bugs. That said, it should be good enough for + * most situations. */ -void * -sn1_pci_alloc_consistent (struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) +void +sn_dma_sync(struct pci_dev *hwdev) { - void *ret; - int gfp = GFP_ATOMIC; - devfs_handle_t vhdl; - struct sn1_device_sysdata *device_sysdata; - paddr_t temp_ptr; - *dma_handle = (dma_addr_t) NULL; + struct sn_device_sysdata *device_sysdata; + volatile unsigned long dummy; /* - * get vertex for the device + * It is expected that on an IA64 platform, a DMA sync ensures that + * all the DMA from a particular device is complete and coherent. We + * try to do this by + * 1. flushing the write wuffers from Bridge + * 2. flushing the Xbow port. + * Unfortunately, this only gets the DMA transactions 'very close' to + * the coherence domain, but not quite in it. */ - device_sysdata = (struct sn1_device_sysdata *) hwdev->sysdata; - vhdl = device_sysdata->vhdl; + device_sysdata = (struct sn_device_sysdata *)hwdev->sysdata; + dummy = (volatile unsigned long ) *device_sysdata->dma_buf_sync; - if ( (ret = (void *)__get_free_pages(gfp, get_order(size))) ) { - memset(ret, 0, size); - } else { - return(NULL); + /* + * For the Xbow port flush, we maybe denied the request because + * someone else may be flushing the port .. try again. + */ + while((volatile unsigned long ) *device_sysdata->xbow_buf_sync) { + udelay(2); } +} - temp_ptr = (paddr_t) __pa(ret); - if (IS_PCIA64(hwdev)) { +/** + * sn_pci_alloc_consistent - allocate memory for coherent DMA + * @hwdev: device to allocate for + * @size: size of the region + * @dma_handle: DMA (bus) address + * + * pci_alloc_consistent() returns a pointer to a memory region suitable for + * coherent DMA traffic to/from a PCI device. On SN platforms, this means + * that @dma_handle will have the PCIBR_BARRIER and PCIIO_DMA_CMD flags + * set. + * + * This interface is usually used for "command" streams (e.g. the command + * queue for a SCSI controller). See Documentation/DMA-mapping.txt for + * more information. Note that this routine should always put a 32 bit + * DMA address into @dma_handle. This is because most other platforms + * that are capable of 64 bit PCI DMA transactions can't do 64 bit _coherent_ + * DMAs, and unfortunately this interface has to cater to the LCD. Oh well. + * + * Also known as platform_pci_alloc_consistent() by the IA64 machvec code. + */ +void * +sn_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) +{ + void *cpuaddr; + devfs_handle_t vhdl; + struct sn_device_sysdata *device_sysdata; + unsigned long phys_addr; + pciio_dmamap_t dma_map = 0; + struct sn_dma_maps_s *sn_dma_map; + + *dma_handle = 0; + + /* We can't easily support < 32 bit devices */ + if (IS_PCI32L(hwdev)) + return NULL; - /* - * This device supports 64bits DMA addresses. - */ - *dma_handle = pciio_dmatrans_addr(vhdl, NULL, temp_ptr, size, - PCIBR_BARRIER | PCIIO_BYTE_STREAM | PCIIO_DMA_CMD - | PCIIO_DMA_A64 ); - return (ret); - } + /* + * Get hwgraph vertex for the device + */ + device_sysdata = (struct sn_device_sysdata *) hwdev->sysdata; + vhdl = device_sysdata->vhdl; /* - * Devices that supports 32 Bits upto 63 Bits DMA Address gets - * 32 Bits DMA addresses. - * - * First try to get 32 Bit Direct Map Support. + * Allocate the memory. FIXME: if we're allocating for + * two devices on the same bus, we should at least try to + * allocate memory in the same 2 GB window to avoid using + * ATEs for the translation. See the comment above about the + * 32 bit requirement for this function. */ - if (IS_PCI32G(hwdev)) { - *dma_handle = pciio_dmatrans_addr(vhdl, NULL, temp_ptr, size, - PCIBR_BARRIER | PCIIO_BYTE_STREAM | PCIIO_DMA_CMD); - if (dma_handle) { - return (ret); - } else { - /* - * We need to map this request by using ATEs. - */ - printk("sn1_pci_alloc_consistent: 32Bits DMA Page Map support not available yet!"); + if(!(cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size)))) + return NULL; + + memset(cpuaddr, 0, size); /* have to zero it out */ + + /* physical addr. of the memory we just got */ + phys_addr = __pa(cpuaddr); + + *dma_handle = pciio_dmatrans_addr(vhdl, NULL, phys_addr, size, + DMA_CONTROL_FLAGS); + /* + * It is a 32 bit card and we cannot do direct mapping, + * so we use an ATE. + */ + if (!(*dma_handle)) { + dma_map = pciio_dmamap_alloc(vhdl, NULL, size, + DMA_CONTROL_FLAGS | PCIIO_FIXED); + if (!dma_map) { + printk(KERN_ERR "sn_pci_alloc_consistent: Unable to " + "allocate anymore 32 bit page map entries.\n"); BUG(); } - } - - if (IS_PCI32L(hwdev)) { - /* - * SNIA64 cannot support DMA Addresses smaller than 32 bits. - */ - return (NULL); - } + *dma_handle = (dma_addr_t) pciio_dmamap_addr(dma_map,phys_addr, + size); + sn_dma_map = (struct sn_dma_maps_s *)dma_map; + sn_dma_map->dma_addr = *dma_handle; + printk(KERN_INFO "%s: PMU mapping: %p\n", __FUNCTION__, + (void *)*dma_handle); + } + else + printk(KERN_INFO "%s: direct mapping: %p\n", __FUNCTION__, + (void *)*dma_handle); + - return NULL; + return cpuaddr; } +/** + * sn_pci_free_consistent - free memory associated with coherent DMAable region + * @hwdev: device to free for + * @size: size to free + * @vaddr: kernel virtual address to free + * @dma_handle: DMA address associated with this region + * + * Frees the memory allocated by pci_alloc_consistent(). Also known + * as platform_pci_free_consistent() by the IA64 machvec code. + */ void -sn1_pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) +sn_pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) { + struct sn_dma_maps_s *sn_dma_map = NULL; + + /* + * Get the sn_dma_map entry. + */ + if (IS_PCI32_MAPPED(dma_handle)) + sn_dma_map = find_sn_dma_map(dma_handle, hwdev->bus->number); + + /* + * and free it if necessary... + */ + if (sn_dma_map) { + pciio_dmamap_done((pciio_dmamap_t)sn_dma_map); + pciio_dmamap_free((pciio_dmamap_t)sn_dma_map); + sn_dma_map->dma_addr = (dma_addr_t)NULL; + } free_pages((unsigned long) vaddr, get_order(size)); } -/* - * On sn1 we use the orig_address entry of the scatterlist to store - * the physical address corresponding to the given virtual address +/** + * sn_pci_map_sg - map a scatter-gather list for DMA + * @hwdev: device to map for + * @sg: scatterlist to map + * @nents: number of entries + * @direction: direction of the DMA transaction + * + * Maps each entry of @sg for DMA. Also known as platform_pci_map_sg by the + * IA64 machvec code. */ int -sn1_pci_map_sg (struct pci_dev *hwdev, - struct scatterlist *sg, int nents, int direction) +sn_pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) { int i; - devfs_handle_t vhdl; + devfs_handle_t vhdl; dma_addr_t dma_addr; - paddr_t temp_ptr; - struct sn1_device_sysdata *device_sysdata; + unsigned long phys_addr; + struct sn_device_sysdata *device_sysdata; pciio_dmamap_t dma_map; - - + /* can't go anywhere w/o a direction in life */ if (direction == PCI_DMA_NONE) BUG(); /* - * Handle 64 bit cards. + * Get the hwgraph vertex for the device */ - device_sysdata = (struct sn1_device_sysdata *) hwdev->sysdata; + device_sysdata = (struct sn_device_sysdata *) hwdev->sysdata; vhdl = device_sysdata->vhdl; + + /* + * Setup a DMA address for each entry in the + * scatterlist. + */ for (i = 0; i < nents; i++, sg++) { - sg->orig_address = (char *)NULL; + /* this catches incorrectly written drivers that + attempt to map scatterlists that they have + previously mapped. we print a warning and + continue, but the driver should be fixed */ + switch (((u64)sg->address) >> 60) { + case 0xa: + case 0xb: +#ifdef DEBUG +/* This needs to be cleaned up at some point. */ + NAG("A PCI driver (for device at%8s) has attempted to " + "map a scatterlist that was previously mapped at " + "%p - this is currently being worked around.\n", + hwdev->slot_name, (void *)sg->address); +#endif + phys_addr = (u64)sg->address & TO_PHYS_MASK; + break; + default: /* not previously mapped, get the phys. addr */ + phys_addr = __pa(sg->address); + break; + } + sg->page = NULL; dma_addr = 0; - temp_ptr = (paddr_t) __pa(sg->address); /* - * Handle the most common case 64Bit cards. + * Handle the most common case: 64 bit cards. This + * call should always succeed. */ if (IS_PCIA64(hwdev)) { - dma_addr = (dma_addr_t) pciio_dmatrans_addr(vhdl, NULL, - temp_ptr, sg->length, - PCIBR_BARRIER | PCIIO_BYTE_STREAM | - PCIIO_DMA_CMD | PCIIO_DMA_A64 ); + dma_addr = pciio_dmatrans_addr(vhdl, NULL, phys_addr, + sg->length, + DMA_DATA_FLAGS | PCIIO_DMA_A64 ); sg->address = (char *)dma_addr; continue; } /* - * Handle 32Bits and greater cards. + * Handle 32-63 bit cards via direct mapping */ if (IS_PCI32G(hwdev)) { - dma_addr = (dma_addr_t) pciio_dmatrans_addr(vhdl, NULL, - temp_ptr, sg->length, - PCIBR_BARRIER | PCIIO_BYTE_STREAM | - PCIIO_DMA_CMD); + dma_addr = pciio_dmatrans_addr(vhdl, NULL, phys_addr, + sg->length, + DMA_DATA_FLAGS); + /* + * See if we got a direct map entry + */ if (dma_addr) { sg->address = (char *)dma_addr; continue; @@ -240,21 +382,20 @@ } /* - * It is a 32bit card and we cannot do Direct mapping. - * Let's 32Bit Page map the request. + * It is a 32 bit card and we cannot do direct mapping, + * so we use an ATE. */ - dma_map = NULL; - dma_map = pciio_dmamap_alloc(vhdl, NULL, sg->length, - PCIBR_BARRIER | PCIIO_BYTE_STREAM | - PCIIO_DMA_CMD); + dma_map = 0; + dma_map = pciio_dmamap_alloc(vhdl, NULL, sg->length, + DMA_DATA_FLAGS); if (!dma_map) { - printk("pci_map_sg: Unable to allocate anymore 32Bits Page Map entries.\n"); + printk(KERN_ERR "sn_pci_map_sg: Unable to allocate " + "anymore 32 bit page map entries.\n"); BUG(); } - dma_addr = (dma_addr_t)pciio_dmamap_addr(dma_map, temp_ptr, sg->length); - /* printk("pci_map_sg: dma_map 0x%p Phys Addr 0x%p dma_addr 0x%p\n", dma_map, temp_ptr, dma_addr); */ + dma_addr = pciio_dmamap_addr(dma_map, phys_addr, sg->length); sg->address = (char *)dma_addr; - sg->orig_address = (char *)dma_map; + sg->page = (char *)dma_map; } @@ -262,39 +403,54 @@ } -/* - * Unmap a set of streaming mode DMA translations. - * Again, cpu read rules concerning calls here are the same as for - * pci_unmap_single() above. +/** + * sn_pci_unmap_sg - unmap a scatter-gather list + * @hwdev: device to unmap + * @sg: scatterlist to unmap + * @nents: number of scatterlist entries + * @direction: DMA direction + * + * Unmap a set of streaming mode DMA translations. Again, cpu read rules + * concerning calls here are the same as for pci_unmap_single() below. Also + * known as sn_pci_unmap_sg() by the IA64 machvec code. */ void -sn1_pci_unmap_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction) +sn_pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) { int i; - struct sn1_dma_maps_s *sn1_dma_map; - + struct sn_dma_maps_s *sn_dma_map; + /* can't go anywhere w/o a direction in life */ if (direction == PCI_DMA_NONE) BUG(); - for (i = 0; i < nelems; i++, sg++) - if (sg->orig_address) { + for (i = 0; i < nents; i++, sg++) + if (sg->page) { /* - * We maintain the DMA Map pointer in sg->orig_address if + * We maintain the DMA Map pointer in sg->page if * it is ever allocated. */ - /* phys_to_virt((dma_addr_t)sg->address | ~0x80000000); */ - /* sg->address = sg->orig_address; */ - sg->address = (char *)-1; - sn1_dma_map = (struct sn1_dma_maps_s *)sg->orig_address; - pciio_dmamap_done((pciio_dmamap_t)sn1_dma_map); - pciio_dmamap_free((pciio_dmamap_t)sn1_dma_map); - sn1_dma_map->dma_addr = 0; - sg->orig_address = 0; + sg->address = 0; + sn_dma_map = (struct sn_dma_maps_s *)sg->page; + pciio_dmamap_done((pciio_dmamap_t)sn_dma_map); + pciio_dmamap_free((pciio_dmamap_t)sn_dma_map); + sn_dma_map->dma_addr = 0; + sg->page = 0; } + } -/* +/** + * sn_pci_map_single - map a single region for DMA + * @hwdev: device to map for + * @ptr: kernel virtual address of the region to map + * @size: size of the region + * @direction: DMA direction + * + * Map the region pointed to by @ptr for DMA and return the + * DMA address. Also known as platform_pci_map_single() by + * the IA64 machvec code. + * * We map this to the one step pciio_dmamap_trans interface rather than * the two step pciio_dmamap_alloc/pciio_dmamap_addr because we have * no way of saving the dmamap handle from the alloc to later free @@ -304,129 +460,191 @@ * get rid of dev_desc and vhdl (seems redundant given a pci_dev); * figure out how to save dmamap handle so can use two step. */ -dma_addr_t sn1_pci_map_single (struct pci_dev *hwdev, - void *ptr, size_t size, int direction) +dma_addr_t +sn_pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) { - devfs_handle_t vhdl; + devfs_handle_t vhdl; dma_addr_t dma_addr; - paddr_t temp_ptr; - struct sn1_device_sysdata *device_sysdata; + unsigned long phys_addr; + struct sn_device_sysdata *device_sysdata; pciio_dmamap_t dma_map = NULL; - struct sn1_dma_maps_s *sn1_dma_map; - + struct sn_dma_maps_s *sn_dma_map; if (direction == PCI_DMA_NONE) BUG(); + /* SN cannot support DMA addresses smaller than 32 bits. */ + if (IS_PCI32L(hwdev)) return 0; /* * find vertex for the device */ - device_sysdata = (struct sn1_device_sysdata *)hwdev->sysdata; + device_sysdata = (struct sn_device_sysdata *)hwdev->sysdata; vhdl = device_sysdata->vhdl; /* * Call our dmamap interface */ dma_addr = 0; - temp_ptr = (paddr_t) __pa(ptr); + phys_addr = __pa(ptr); if (IS_PCIA64(hwdev)) { /* - * This device supports 64bits DMA addresses. + * This device supports 64 bit DMA addresses. */ - dma_addr = (dma_addr_t) pciio_dmatrans_addr(vhdl, NULL, - temp_ptr, size, - PCIBR_BARRIER | PCIIO_BYTE_STREAM | PCIIO_DMA_CMD - | PCIIO_DMA_A64 ); - return (dma_addr); + dma_addr = pciio_dmatrans_addr(vhdl, NULL, phys_addr, size, + DMA_DATA_FLAGS | PCIIO_DMA_A64); + return dma_addr; } /* - * Devices that supports 32 Bits upto 63 Bits DMA Address gets - * 32 Bits DMA addresses. + * Devices that supports 32 bit to 63 bit DMA addresses get + * 32 bit DMA addresses. * - * First try to get 32 Bit Direct Map Support. + * First try to get a 32 bit direct map register. */ if (IS_PCI32G(hwdev)) { - dma_addr = (dma_addr_t) pciio_dmatrans_addr(vhdl, NULL, - temp_ptr, size, - PCIBR_BARRIER | PCIIO_BYTE_STREAM | PCIIO_DMA_CMD); - if (dma_addr) { - return (dma_addr); - } + dma_addr = pciio_dmatrans_addr(vhdl, NULL, phys_addr, size, + DMA_DATA_FLAGS); + if (dma_addr) + return dma_addr; } - if (IS_PCI32L(hwdev)) { - /* - * SNIA64 cannot support DMA Addresses smaller than 32 bits. - */ - return ((dma_addr_t) NULL); - } - /* - * It is a 32bit card and we cannot do Direct mapping. - * Let's 32Bit Page map the request. + * It's a 32 bit card and we cannot do direct mapping so + * let's use the PMU instead. */ dma_map = NULL; - dma_map = pciio_dmamap_alloc(vhdl, NULL, size, PCIBR_BARRIER | - PCIIO_BYTE_STREAM | PCIIO_DMA_CMD); + dma_map = pciio_dmamap_alloc(vhdl, NULL, size, DMA_DATA_FLAGS); + if (!dma_map) { - printk("pci_map_single: Unable to allocate anymore 32Bits Page Map entries.\n"); + printk(KERN_ERR "pci_map_single: Unable to allocate anymore " + "32 bits page map entries.\n"); BUG(); } - dma_addr = (dma_addr_t) pciio_dmamap_addr(dma_map, temp_ptr, size); - /* printk("pci_map_single: dma_map 0x%p Phys Addr 0x%p dma_addr 0x%p\n", dma_map, - temp_ptr, dma_addr); */ - sn1_dma_map = (struct sn1_dma_maps_s *)dma_map; - sn1_dma_map->dma_addr = dma_addr; + dma_addr = (dma_addr_t) pciio_dmamap_addr(dma_map, phys_addr, size); + sn_dma_map = (struct sn_dma_maps_s *)dma_map; + sn_dma_map->dma_addr = dma_addr; return ((dma_addr_t)dma_addr); } +/** + * sn_pci_unmap_single - unmap a region used for DMA + * @hwdev: device to unmap + * @dma_addr: DMA address to unmap + * @size: size of region + * @direction: DMA direction + * + * Unmaps the region pointed to by @dma_addr. Also known as + * platform_pci_unmap_single() by the IA64 machvec code. + */ void -sn1_pci_unmap_single (struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction) +sn_pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction) { - - struct sn1_dma_maps_s *sn1_dma_map = NULL; + struct sn_dma_maps_s *sn_dma_map = NULL; if (direction == PCI_DMA_NONE) BUG(); /* - * Get the sn1_dma_map entry. + * Get the sn_dma_map entry. */ if (IS_PCI32_MAPPED(dma_addr)) - sn1_dma_map = find_sn1_dma_map(dma_addr, hwdev->bus->number); + sn_dma_map = find_sn_dma_map(dma_addr, hwdev->bus->number); - if (sn1_dma_map) { - pciio_dmamap_done((pciio_dmamap_t)sn1_dma_map); - pciio_dmamap_free((pciio_dmamap_t)sn1_dma_map); - sn1_dma_map->dma_addr = (dma_addr_t)NULL; + /* + * and free it if necessary... + */ + if (sn_dma_map) { + pciio_dmamap_done((pciio_dmamap_t)sn_dma_map); + pciio_dmamap_free((pciio_dmamap_t)sn_dma_map); + sn_dma_map->dma_addr = (dma_addr_t)NULL; } - } +/** + * sn_pci_dma_sync_single - make sure all DMAs have completed + * @hwdev: device to sync + * @dma_handle: DMA address to sync + * @size: size of region + * @direction: DMA direction + * + * This routine is supposed to sync the DMA region specified + * by @dma_handle into the 'coherence domain'. See sn_dma_sync() + * above for more information. Also known as + * platform_pci_dma_sync_single() by the IA64 machvec code. + */ void -sn1_pci_dma_sync_single (struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction) +sn_pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction) { - - if (direction == PCI_DMA_NONE) + if (direction == PCI_DMA_NONE) BUG(); - /* Nothing to do */ + + sn_dma_sync(hwdev); } +/** + * sn_pci_dma_sync_sg - make sure all DMAs have completed + * @hwdev: device to sync + * @sg: scatterlist to sync + * @nents: number of entries in the scatterlist + * @direction: DMA direction + * + * This routine is supposed to sync the DMA regions specified + * by @sg into the 'coherence domain'. See sn_dma_sync() + * above for more information. Also known as + * platform_pci_dma_sync_sg() by the IA64 machvec code. + */ void -sn1_pci_dma_sync_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction) +sn_pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) { if (direction == PCI_DMA_NONE) BUG(); - /* Nothing to do */ + + sn_dma_sync(hwdev); } +/** + * sn_dma_address - get the DMA address for the first entry of a scatterlist + * @sg: sg to look at + * + * Gets the DMA address for the scatterlist @sg. Also known as + * platform_dma_address() by the IA64 machvec code. + */ unsigned long -sn1_dma_address (struct scatterlist *sg) +sn_dma_address(struct scatterlist *sg) { return ((unsigned long)sg->address); } + +/** + * sn_dma_supported - test a DMA mask + * @hwdev: device to test + * @mask: DMA mask to test + * + * Return whether the given PCI device DMA address mask can be supported + * properly. For example, if your device can only drive the low 24-bits + * during PCI bus mastering, then you would pass 0x00ffffff as the mask to + * this function. Of course, SN only supports devices that have 32 or more + * address bits. + */ +int +sn_pci_dma_supported(struct pci_dev *hwdev, u64 mask) +{ + if (mask < 0xffffffff) + return 0; + return 1; +} + +EXPORT_SYMBOL(sn_pci_unmap_single); +EXPORT_SYMBOL(sn_pci_map_single); +EXPORT_SYMBOL(sn_pci_dma_sync_single); +EXPORT_SYMBOL(sn_pci_map_sg); +EXPORT_SYMBOL(sn_pci_unmap_sg); +EXPORT_SYMBOL(sn_pci_alloc_consistent); +EXPORT_SYMBOL(sn_pci_free_consistent); +EXPORT_SYMBOL(sn_dma_address); +EXPORT_SYMBOL(sn_pci_dma_supported); + diff -urN linux-2.4.18/arch/ia64/sn/io/pciba.c lia64-2.4/arch/ia64/sn/io/pciba.c --- linux-2.4.18/arch/ia64/sn/io/pciba.c Thu Apr 12 12:16:35 2001 +++ lia64-2.4/arch/ia64/sn/io/pciba.c Mon Feb 4 17:48:56 2002 @@ -1,1716 +1,958 @@ -/* $Id$ +/* + * arch/ia64/sn/io/pciba.c * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. + * IRIX PCIBA-inspired user mode PCI interface * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * requires: devfs + * + * device nodes show up in /dev/pci/BB/SS.F (where BB is the bus the + * device is on, SS is the slot the device is in, and F is the + * device's function on a multi-function card). + * + * when compiled into the kernel, it will only be initialized by the + * sgi sn1 specific initialization code. in this case, device nodes + * are under /dev/hw/..../ + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file "COPYING" in the main directory of + * this archive for more details. + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved. + * + * 03262001 - Initial version by Chad Talbott */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#include -#include -#endif -#define copyin(_a, _b, _c) copy_from_user(_b, _a, _c) +/* jesse's beefs: + + register_pci_device should be documented + + grossness with do_swap should be documented + + big, gross union'ized node_data should be replaced with independent + structures + + replace global list of nodes with global lists of resources. could + use object oriented approach of allocating and cleaning up + resources. + +*/ + -#ifndef DEBUG_PCIBA -#define DEBUG_PCIBA 0 +#include +#ifndef CONFIG_DEVFS_FS +# error PCIBA requires devfs #endif -/* v_mapphys does not percolate page offset back. */ -#define PCIBA_ALIGN_CHECK 1 +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include #include -/* grab an unused space code for "User DMA" space */ -#ifndef PCIBA_SPACE_UDMA -#define PCIBA_SPACE_UDMA (14) + +MODULE_DESCRIPTION("User mode PCI interface"); +MODULE_AUTHOR("Chad Talbott"); + + +#undef DEBUG_PCIBA +/* #define DEBUG_PCIBA */ + +#undef TRACE_PCIBA +/* #define TRACE_PCIBA */ + +#if defined(DEBUG_PCIBA) +# define DPRINTF(x...) printk(KERN_DEBUG x) +#else +# define DPRINTF(x...) #endif -#if DEBUG_REFCT -extern int hwgraph_vertex_refct(vertex_hdl_t); +#if defined(TRACE_PCIBA) +# if defined(__GNUC__) +# define TRACE() printk(KERN_DEBUG "%s:%d:%s\n", \ + __FILE__, __LINE__, __FUNCTION__) +# else +# define TRACE() printk(KERN_DEBUG "%s:%d\n", __LINE__, __FILE__) +# endif +#else +# define TRACE() #endif -extern int pci_user_dma_max_pages; -#define NEW(ptr) (ptr = kmem_zalloc(sizeof (*(ptr)), KM_SLEEP)) -#define DEL(ptr) (kfree(ptr)) -/* Oops -- no standard "pci address" type! */ -typedef uint64_t pciaddr_t; +typedef enum { failure, success } status; +typedef enum { false, true } boolean; -/* ================================================================ - * driver types - */ -typedef struct pciba_slot_s *pciba_slot_t; -typedef struct pciba_comm_s *pciba_comm_t; -typedef struct pciba_soft_s *pciba_soft_t; -typedef struct pciba_map_s *pciba_map_t, **pciba_map_h; -typedef struct pciba_dma_s *pciba_dma_t, **pciba_dma_h; -typedef struct pciba_bus_s *pciba_bus_t; - -#define TRACKED_SPACES 16 -struct pciba_comm_s { - devfs_handle_t conn; - pciba_bus_t bus; - int refct; - pciba_soft_t soft[TRACKED_SPACES][2]; - struct semaphore lock; - pciba_dma_t dmap; + +/* major data structures: + + struct node_data - + + one for each file registered with devfs. contains everything + that any file's fops would need to know about. + + struct dma_allocation - + + a single DMA allocation. only the 'dma' nodes care about + these. they are there primarily to allow the driver to look + up the kernel virtual address of dma buffers allocated by + pci_alloc_consistent, as the application is only given the + physical address (to program the device's dma, presumably) and + cannot supply the kernel virtual address when freeing the + buffer. + + it's also useful to maintain a list of buffers allocated + through a specific node to allow some sanity checking by this + driver. this prevents (for example) a broken application from + freeing buffers that it didn't allocate, or buffers allocated + on another node. + + global_node_list - + + a list of all nodes allocated. this allows the driver to free + all the memory it has 'kmalloc'd in case of an error, or on + module removal. + + global_dma_list - + + a list of all dma buffers allocated by this driver. this + allows the driver to 'pci_free_consistent' all buffers on + module removal or error. + +*/ + + +struct node_data { + /* flat list of all the device nodes. makes it easy to free + them all when we're unregistered */ + struct list_head global_node_list; + devfs_handle_t devfs_handle; + + void (* cleanup)(struct node_data *); + + union { + struct { + struct pci_dev * dev; + struct list_head dma_allocs; + boolean mmapped; + } dma; + struct { + struct pci_dev * dev; + u32 saved_rom_base_reg; + boolean mmapped; + } rom; + struct { + struct resource * res; + } base; + struct { + struct pci_dev * dev; + } config; + } u; }; -/* pciba_soft: device_info() for all openables */ -struct pciba_soft_s { - pciba_comm_t comm; - devfs_handle_t vhdl; - int refct; - pciio_space_t space; - size_t size; - pciio_space_t iomem; - pciaddr_t base; - unsigned flags; +struct dma_allocation { + struct list_head list; + + dma_addr_t handle; + void * va; + size_t size; }; -#define pciba_soft_get(v) (pciba_soft_t)hwgraph_fastinfo_get(v) -#define pciba_soft_set(v,i) hwgraph_fastinfo_set(v,(arbitrary_info_t)(i)) -#define pciba_soft_lock(soft) down(&soft->comm->lock) -#define pciba_soft_unlock(soft) up(&soft->comm->lock) +static LIST_HEAD(global_node_list); +static LIST_HEAD(global_dma_list); -/* pciba_map: data describing a mapping. - * (ie. a user mmap request) - */ -struct pciba_map_s { - pciba_map_t next; -#ifdef LATER - uthread_t *uthread; -#endif - __psunsigned_t handle; - uvaddr_t uvaddr; - size_t size; - pciio_piomap_t map; - pciio_space_t space; - pciaddr_t base; - unsigned flags; -}; -/* pciba_dma: data describing a DMA mapping. - */ -struct pciba_dma_s { - pciba_dma_t next; - iopaddr_t paddr; /* starting phys addr */ - caddr_t kaddr; /* starting kern addr */ - pciio_dmamap_t map; /* mapping resources (ugh!) */ - pciaddr_t daddr; /* starting pci addr */ - size_t pages; /* size of block in pages */ - size_t bytes; /* size of block in bytes */ - __psunsigned_t handle; /* mapping handle */ +/* module entry points */ +int __init pciba_init(void); +void __exit pciba_exit(void); + +static status __init register_with_devfs(void); +static void __exit unregister_with_devfs(void); + +static status __init register_pci_device(devfs_handle_t device_dir_handle, + struct pci_dev * dev); + +/* file operations */ +static int generic_open(struct inode * inode, struct file * file); +static int rom_mmap(struct file * file, struct vm_area_struct * vma); +static int rom_release(struct inode * inode, struct file * file); +static int base_mmap(struct file * file, struct vm_area_struct * vma); +static int config_ioctl(struct inode * inode, struct file * file, + unsigned int cmd, + unsigned long arg); +static int dma_ioctl(struct inode * inode, struct file * file, + unsigned int cmd, + unsigned long arg); +static int dma_mmap(struct file * file, struct vm_area_struct * vma); + +/* support routines */ +static int mmap_pci_address(struct vm_area_struct * vma, unsigned long pci_va); +static int mmap_kernel_address(struct vm_area_struct * vma, void * kernel_va); + +#ifdef DEBUG_PCIBA +static void dump_nodes(struct list_head * nodes); +static void dump_allocations(struct list_head * dalp); +#endif + +/* file operations for each type of node */ +static struct file_operations rom_fops = { + owner: THIS_MODULE, + mmap: rom_mmap, + open: generic_open, + release: rom_release }; + -/* pciba_bus: common bus info for all openables - * descended from the same master vertex. - */ -struct pciba_bus_s { - struct semaphore lock; - pciba_map_t maps; /* stack of mappings */ - int refct; +static struct file_operations base_fops = { + owner: THIS_MODULE, + mmap: base_mmap, + open: generic_open }; -#define pciba_bus_lock(bus) down(&bus->lock) -#define pciba_bus_unlock(bus) up(&bus->lock) -typedef union ioctl_arg_buffer_u { - char data[IOCPARM_MASK + 1]; - uint8_t uc; - uint16_t us; - uint32_t ui; - uint64_t ud; - caddr_t ca; -#if ULI - struct uliargs uli; - struct uliargs32 uli32; -#endif -} ioctl_arg_buffer_t; +static struct file_operations config_fops = { + owner: THIS_MODULE, + ioctl: config_ioctl, + open: generic_open +}; -/* ================================================================ - * driver variables - */ -char *pciba_mversion = "mload version 7.0"; -int pciba_devflag = 0x1 | - 0x200 | - 0x400; +static struct file_operations dma_fops = { + owner: THIS_MODULE, + ioctl: dma_ioctl, + mmap: dma_mmap, + open: generic_open +}; -/* this counts the reasons why we can not - * currently unload this driver. - */ -atomic_t pciba_prevent_unload = ATOMIC_INIT(0); -#if DEBUG_PCIBA -static struct reg_values space_v[] = -{ - {PCIIO_SPACE_NONE, "none"}, - {PCIIO_SPACE_ROM, "ROM"}, - {PCIIO_SPACE_IO, "I/O"}, - {PCIIO_SPACE_MEM, "MEM"}, - {PCIIO_SPACE_MEM32, "MEM(32)"}, - {PCIIO_SPACE_MEM64, "MEM(64)"}, - {PCIIO_SPACE_CFG, "CFG"}, - {PCIIO_SPACE_WIN(0), "WIN(0)"}, - {PCIIO_SPACE_WIN(1), "WIN(1)"}, - {PCIIO_SPACE_WIN(2), "WIN(2)"}, - {PCIIO_SPACE_WIN(3), "WIN(3)"}, - {PCIIO_SPACE_WIN(4), "WIN(4)"}, - {PCIIO_SPACE_WIN(5), "WIN(5)"}, - {PCIBA_SPACE_UDMA, "UDMA"}, - {PCIIO_SPACE_BAD, "BAD"}, - {0} -}; +module_init(pciba_init); +module_exit(pciba_exit); + -static struct reg_desc space_desc[] = +int __init +pciba_init(void) { - {0xFF, 0, "space", 0, space_v}, - {0} -}; -#endif + TRACE(); -char pciba_edge_lbl_base[] = "base"; -char pciba_edge_lbl_cfg[] = "config"; -char pciba_edge_lbl_dma[] = "dma"; -char pciba_edge_lbl_intr[] = "intr"; -char pciba_edge_lbl_io[] = "io"; -char pciba_edge_lbl_mem[] = "mem"; -char pciba_edge_lbl_rom[] = "rom"; -char *pciba_edge_lbl_win[6] = -{"0", "1", "2", "3", "4", "5"}; - -#define PCIBA_EDGE_LBL_BASE pciba_edge_lbl_base -#define PCIBA_EDGE_LBL_CFG pciba_edge_lbl_cfg -#define PCIBA_EDGE_LBL_DMA pciba_edge_lbl_dma -#define PCIBA_EDGE_LBL_INTR pciba_edge_lbl_intr -#define PCIBA_EDGE_LBL_IO pciba_edge_lbl_io -#define PCIBA_EDGE_LBL_MEM pciba_edge_lbl_mem -#define PCIBA_EDGE_LBL_ROM pciba_edge_lbl_rom -#define PCIBA_EDGE_LBL_WIN(n) pciba_edge_lbl_win[n] - -#define PCIBA_EDGE_LBL_FLIP pciba_edge_lbl_flip - -static char pciba_info_lbl_bus[] = "pciba_bus"; - -#define PCIBA_INFO_LBL_BUS pciba_info_lbl_bus - -struct file_operations pciba_fops = { - owner: THIS_MODULE, - llseek: NULL, - read: NULL, - write: NULL, - readdir: NULL, - poll: NULL, - ioctl: NULL, - mmap: NULL, - open: NULL, - flush: NULL, - release: NULL, - fsync: NULL, - fasync: NULL, - lock: NULL, - readv: NULL, - writev: NULL -}; - -/* ================================================================ - * function table of contents - */ + if (register_with_devfs() == failure) + return 1; /* failure */ -void pciba_init(void); -int pciba_attach(devfs_handle_t); + printk("PCIBA (a user mode PCI interface) initialized.\n"); -static void pciba_sub_attach(pciba_comm_t, - pciio_space_t, pciio_space_t, pciaddr_t, - devfs_handle_t, devfs_handle_t, char *); - -static pciba_bus_t pciba_find_bus(devfs_handle_t, int); -#ifdef LATER -static void pciba_map_push(pciba_bus_t, pciba_map_t); -static pciba_map_t pciba_map_pop_hdl(pciba_bus_t, __psunsigned_t); -static void pciba_sub_detach(devfs_handle_t, char *); -static pciio_iter_f pciba_unload_me; -#endif + return 0; /* success */ +} -int pciba_unload(void); -int pciba_unreg(void); -int pciba_detach(devfs_handle_t); - -int pciba_open(dev_t *, int, int, struct cred *); -int pciba_close(dev_t); -int pciba_read(dev_t, cred_t *); -int pciba_write(dev_t, cred_t *); -int pciba_ioctl(dev_t, int, void *, int, cred_t *, int *); - -int pciba_map(dev_t, vhandl_t *, off_t, size_t, uint32_t); -int pciba_unmap(dev_t, vhandl_t *); - -#if ULI -void pciba_clearuli(struct uli *); -static intr_func_f pciba_intr; -#endif /* Undef as it gets implemented */ -/* ================================================================ - * driver load, register, and setup - */ -void -pciba_init(void) +void __exit +pciba_exit(void) { + TRACE(); - /* - * What do we need to do here? - */ -#if DEBUG_PCIBA - printk("pciba_init()\n"); -#endif + /* FIXME: should also free all that memory that we allocated + ;) */ + unregister_with_devfs(); } -#ifdef LATER -#if HWG_PERF_CHECK && IP30 && !DEBUG -void -pciba_timeout(void *arg1, void *arg2) -{ - struct semaphore *semap = (sema_t *) arg1; - unsigned long *cvalp = (unsigned long *) arg2; - - if (cvalp) - cvalp[0] = RAW_COUNT(); - if (semap) - up(semap); -} - -volatile unsigned long cNval[1]; -struct semaphore tsema; - -void -pciba_timeout_test(void) -{ - unsigned long c0val, cval; - toid_t tid; - - extern void hwg_hprint(unsigned long, char *); - - sema_init(&tsema, 0); - - cNval[0] = 0; - c0val = RAW_COUNT(); - tid = timeout((void (*)()) pciba_timeout, (void *) 0, 1, (void *) cNval); - DELAY(1000000); - cval = cNval[0]; - if (cval == 0) { - untimeout(tid); - PRINT_ALERT("pciba: one-tick timeout did not happen in a second\n"); - return; - } - cval = cval - c0val; - hwg_hprint(cval, "timeout(1)"); - - cNval[0] = 0; - c0val = RAW_COUNT(); - tid = timeout((void (*)()) pciba_timeout, (void *) &tsema, 2, (void *) cNval); - - /* FIXME : this probably needs to be down_interruptible() */ - - if (down(&tsema) < 0) { /* wait for the pciba_timeout */ - untimeout(tid); - PRINT_WARNING("pciba: timeout(2) time check aborted\n"); - return; - } - cval = cNval[0]; - if (cval == 0) { - untimeout(tid); - PRINT_WARNING("pciba: timeout(2) time not logged\n"); - return; - } - cval = cval - c0val; - hwg_hprint(cval, "timeout(2)"); - - cNval[0] = 0; - c0val = RAW_COUNT(); - tid = timeout((void (*)()) pciba_timeout, (void *) &tsema, HZ, (void *) cNval); - - /* FIXME : this probably needs to be down_interruptible() */ - - if (down(&tsema) < 0) { /* wait for the pciba_timeout */ - untimeout(tid); - PRINT_WARNING("pciba: timeout(HZ) time check aborted\n"); - return; - } - cval = cNval[0]; - if (cval == 0) { - untimeout(tid); - PRINT_WARNING("pciba: timeout(HZ) time not logged\n"); - return; - } - cval = cval - c0val; - hwg_hprint(cval, "timeout(HZ)"); - - printk("verifying untimeout() cancells ...\n"); - cNval[0] = 0; - tid = timeout((void (*)()) pciba_timeout, (void *) 0, 2, (void *) cNval); - untimeout(tid); - DELAY(1000000); - cval = cNval[0]; - if (cval != 0) { - PRINT_ALERT("pciba: unable to cancel two-tick timeout\n"); - cval -= c0val; - hwg_hprint(cval, "CANCELLED timeout(2)"); - } -} -#endif -int -pciba_reg(void) +# if 0 +static void __exit +free_nodes(void) { -#if DEBUG_PCIBA - printk("pciba_reg()\n"); -#endif - pciio_driver_register(-1, -1, "pciba_", 0); - -#if HWG_PERF_CHECK && IP30 && !DEBUG - printk("%s %d\n", __FUNCTION__, __LINE__); -pciba_timeout_test(); -#endif + struct node_data * nd; + + TRACE(); -#if DEBUG_REFCT - { - char *cname = "pciba"; - char *dname = "ptv"; - char *cpath0 = "node/xtalk/15"; - char *uname0 = "0"; - char *cpath1 = "node/xtalk/13"; - char *uname1 = "1"; - devfs_handle_t conn; - devfs_handle_t conv; - devfs_handle_t vhdl; - int ret; - - printk("pciba refct tests:\n"); - -#define SHOWREF(vhdl,func) printk("ref=%d\t%s\t(%d) %v\n", hwgraph_vertex_refct(vhdl), #func, vhdl, vhdl); - - if (GRAPH_SUCCESS != (ret = hwgraph_path_add(hwgraph_root, cname, &conv))) - printk("\tunable to create conv (ret=%d)\n", ret); - else { SHOWREF(conv, hwgraph_path_add); - if (GRAPH_SUCCESS != (ret = hwgraph_traverse(hwgraph_root, cpath0, &conn))) - printk("\tunable to find %s (ret=%d)\n", cpath0, ret); - else { SHOWREF(conn, hwgraph_traverse); - if (GRAPH_SUCCESS != (ret = hwgraph_char_device_add(conn, dname, "pciba_", &vhdl))) - printk("unable to create %v/%s (ret=%d)\n", conn, dname, ret); - else { SHOWREF(vhdl, hwgraph_char_device_add); - hwgraph_chmod(vhdl, 0666); SHOWREF(vhdl, hwgraph_chmod); - if (GRAPH_SUCCESS != (ret = hwgraph_edge_add(conv, vhdl, uname0))) - printk("unable to create %v/%s (ret=%d)\n", conn, uname0, vhdl, ret); - else SHOWREF(vhdl, hwgraph_edge_add); - if (GRAPH_SUCCESS != (ret = hwgraph_vertex_unref(vhdl))) - printk("unable to unref %v\n", vhdl); - else SHOWREF(vhdl, hwgraph_vertex_unref); - } - if (GRAPH_SUCCESS != (ret = hwgraph_vertex_unref(conn))) - printk("unable to unref %v\n", conn); - else SHOWREF(conn, hwgraph_vertex_unref); - } - - if (GRAPH_SUCCESS != (ret = hwgraph_traverse(hwgraph_root, cpath1, &conn))) - printk("\tunable to find %s (ret=%d)\n", cpath1, ret); - else { SHOWREF(conn, hwgraph_traverse); - if (GRAPH_SUCCESS != (ret = hwgraph_char_device_add(conn, dname, "pciba_", &vhdl))) - printk("unable to create %v/%s (ret=%d)\n", conn, dname, ret); - else { SHOWREF(vhdl, hwgraph_char_device_add); - hwgraph_chmod(vhdl, 0666); SHOWREF(vhdl, hwgraph_chmod); - if (GRAPH_SUCCESS != (ret = hwgraph_edge_add(conv, vhdl, uname1))) - printk("unable to create %v/%s (ret=%d)\n", conn, uname1, vhdl, ret); - else SHOWREF(vhdl, hwgraph_edge_add); - if (GRAPH_SUCCESS != (ret = hwgraph_vertex_unref(vhdl))) - printk("unable to unref %v\n", vhdl); - else SHOWREF(vhdl, hwgraph_vertex_unref); - } - if (GRAPH_SUCCESS != (ret = hwgraph_vertex_unref(conn))) - printk("unable to unref %v\n", conn); - else SHOWREF(conn, hwgraph_vertex_unref); - } - - if (GRAPH_SUCCESS != (ret = hwgraph_traverse(hwgraph_root, cpath0, &conn))) - printk("\tunable to find %s (ret=%d)\n", cpath0, ret); - else { SHOWREF(conn, hwgraph_traverse); - if (GRAPH_SUCCESS != (ret = hwgraph_traverse(conn, dname, &vhdl))) - printk("\tunable to find %v/%s (ret=%d)\n", conn, dname, ret); - else { SHOWREF(vhdl, hwgraph_traverse); - if (GRAPH_SUCCESS != (ret = hwgraph_edge_remove(conv, uname0, NULL))) - printk("\tunable to remove edge %v/%s (ret=%d)\n", conv, uname0, ret); - else SHOWREF(vhdl, hwgraph_edge_remove); - if (GRAPH_SUCCESS != (ret = hwgraph_edge_remove(conn, dname, NULL))) - printk("\tunable to remove edge %v/%s (ret=%d)\n", conn, dname, ret); - else SHOWREF(vhdl, hwgraph_edge_remove); - if (GRAPH_SUCCESS != (ret = hwgraph_vertex_unref(vhdl))) - printk("unable to unref %v\n", vhdl); - else SHOWREF(vhdl, hwgraph_vertex_unref); - if (GRAPH_SUCCESS == (ret = hwgraph_vertex_destroy(vhdl))) - printk("\tvertex %d destroyed OK\n", vhdl); - else SHOWREF(vhdl, hwgraph_vertex_destroy); - } - if (GRAPH_SUCCESS != (ret = hwgraph_vertex_unref(conn))) - printk("unable to unref %v\n", conn); - else SHOWREF(conn, hwgraph_vertex_unref); - } - - if (GRAPH_SUCCESS != (ret = hwgraph_traverse(hwgraph_root, cpath1, &conn))) - printk("\tunable to find %s (ret=%d)\n", cpath1, ret); - else { SHOWREF(conn, hwgraph_traverse); - if (GRAPH_SUCCESS != (ret = hwgraph_traverse(conn, dname, &vhdl))) - printk("\tunable to find %v/%s (ret=%d)\n", conn, dname, ret); - else { SHOWREF(vhdl, hwgraph_traverse); - if (GRAPH_SUCCESS != (ret = hwgraph_edge_remove(conv, uname1, NULL))) - printk("\tunable to remove edge %v/%s (ret=%d)\n", conv, uname1, ret); - else SHOWREF(vhdl, hwgraph_edge_remove); - if (GRAPH_SUCCESS != (ret = hwgraph_edge_remove(conn, dname, NULL))) - printk("\tunable to remove edge %v/%s (ret=%d)\n", conn, dname, ret); - else SHOWREF(vhdl, hwgraph_edge_remove); - if (GRAPH_SUCCESS != (ret = hwgraph_vertex_unref(vhdl))) - printk("unable to unref %v\n", vhdl); - else SHOWREF(vhdl, hwgraph_vertex_unref); - if (GRAPH_SUCCESS == (ret = hwgraph_vertex_destroy(vhdl))) - printk("\tvertex %d destroyed OK\n", vhdl); - else SHOWREF(vhdl, hwgraph_vertex_destroy); - } - if (GRAPH_SUCCESS != (ret = hwgraph_vertex_unref(conn))) - printk("unable to unref %v\n", conn); - else SHOWREF(conn, hwgraph_vertex_unref); - } - - if (GRAPH_SUCCESS != (ret = hwgraph_edge_remove(hwgraph_root, cname, NULL))) - printk("\tunable to remove edge %v/%s (ret=%d)\n", hwgraph_root, cname, ret); - else SHOWREF(conv, hwgraph_edge_remove); - if (GRAPH_SUCCESS != (ret = hwgraph_vertex_unref(conv))) - printk("unable to unref %v\n", conv); - else SHOWREF(conv, hwgraph_vertex_unref); - if (GRAPH_SUCCESS == (ret = hwgraph_vertex_destroy(conv))) - printk("\tvertex %d destroyed OK\n", conv); - else SHOWREF(conv, hwgraph_vertex_destroy); + list_for_each(nd, &node_list) { + kfree(list_entry(nd, struct nd, node_list)); } - } -#endif - - return 0; } - -#endif -int -pciba_attach(devfs_handle_t hconn) -{ -#if defined(PCIIO_SLOT_NONE) - pciio_info_t info = pciio_info_get(hconn); - pciio_slot_t slot = pciio_info_slot_get(info); #endif - pciba_comm_t comm; - pciba_bus_t bus; - int ht; - devfs_handle_t hbase; - devfs_handle_t gconn; - devfs_handle_t gbase; - int win; - int wins; - pciio_space_t space; - pciaddr_t base; - int iwins; - int mwins; -#if DEBUG_PCIBA - printk("pciba_attach(%p)\n", hconn); -#endif +static devfs_handle_t pciba_devfs_handle; - /* Pick up "dualslot guest" vertex, - * which gets all functionality except - * config space access. - */ - if ((GRAPH_SUCCESS != - hwgraph_traverse(hconn, ".guest", &gconn)) || - (hconn == gconn)) - gconn = GRAPH_VERTEX_NONE; - - bus = pciba_find_bus(hconn, 1); - bus->refct ++; - - /* set up data common to all pciba openables - * on this connection point. - */ - NEW(comm); - comm->conn = hconn; - comm->bus = bus; - comm->refct = 0; - sema_init(&comm->lock, 1); -#if !defined(PCIIO_SLOT_NONE) - if (bus->refct == 1) -#else - if (slot == PCIIO_SLOT_NONE) -#endif - { - pciio_info_t pciio_info; - devfs_handle_t master; - - pciio_info = pciio_info_get(hconn); - master = pciio_info_master_get(pciio_info); - - pciba_sub_attach(comm, PCIIO_SPACE_IO, PCIIO_SPACE_IO, 0, master, master, PCIBA_EDGE_LBL_IO); - pciba_sub_attach(comm, PCIIO_SPACE_MEM, PCIIO_SPACE_MEM, 0, master, master, PCIBA_EDGE_LBL_MEM); -#if defined(PCIIO_SLOT_NONE) - return 0; -#endif - } +#if !defined(CONFIG_IA64_SGI_SN1) - ht = 0x7F & pciio_config_get(hconn, PCI_CFG_HEADER_TYPE, 1); +static status __init +register_with_devfs(void) +{ + struct pci_dev * dev; + devfs_handle_t device_dir_handle; + char devfs_path[40]; - wins = ((ht == 0x00) ? 6 : - (ht == 0x01) ? 2 : - 0); - - mwins = iwins = 0; - - hbase = GRAPH_VERTEX_NONE; - gbase = GRAPH_VERTEX_NONE; - - for (win = 0; win < wins; win++) { - - base = pciio_config_get(hconn, PCI_CFG_BASE_ADDR(win), 4); - if (base & 1) { - space = PCIIO_SPACE_IO; - base &= 0xFFFFFFFC; - } else if ((base & 7) == 4) { - space = PCIIO_SPACE_MEM; - base &= 0xFFFFFFF0; - base |= ((pciaddr_t) pciio_config_get(hconn, PCI_CFG_BASE_ADDR(win + 1), 4)) << 32; - } else { - space = PCIIO_SPACE_MEM; - base &= 0xFFFFFFF0; - } + TRACE(); - if (!base) - break; + pciba_devfs_handle = devfs_mk_dir(NULL, "pci", NULL); + if (pciba_devfs_handle == NULL) + return failure; -#if PCIBA_ALIGN_CHECK - if (base & (_PAGESZ - 1)) { -#if DEBUG_PCIBA - PRINT_WARNING("%p pciba: BASE%d not page aligned!\n" - "\tmmap this window at offset 0x%x via \".../pci/%s\"\n", - hconn, win, base, - (space == PCIIO_SPACE_IO) ? "io" : "mem"); -#endif - continue; /* next window */ - } -#endif + /* FIXME: don't forget /dev/pci/mem & /dev/pci/io */ + + pci_for_each_dev(dev) { + sprintf(devfs_path, "%02x/%02x.%x", + dev->bus->number, + PCI_SLOT(dev->devfn), + PCI_FUNC(dev->devfn)); + + device_dir_handle = + devfs_mk_dir(pciba_devfs_handle, devfs_path, NULL); + if (device_dir_handle == NULL) + return failure; - if ((hbase == GRAPH_VERTEX_NONE) && - ((GRAPH_SUCCESS != - hwgraph_path_add(hconn, PCIBA_EDGE_LBL_BASE, &hbase)) || - (hbase == GRAPH_VERTEX_NONE))) - break; /* no base vertex, no more windows. */ - - if ((gconn != GRAPH_VERTEX_NONE) && - (gbase == GRAPH_VERTEX_NONE) && - ((GRAPH_SUCCESS != - hwgraph_path_add(gconn, PCIBA_EDGE_LBL_BASE, &gbase)) || - (gbase == GRAPH_VERTEX_NONE))) - break; /* no base vertex, no more windows. */ - - pciba_sub_attach(comm, PCIIO_SPACE_WIN(win), space, base, hbase, gbase, PCIBA_EDGE_LBL_WIN(win)); - - if (space == PCIIO_SPACE_IO) { - if (!iwins++) { - pciba_sub_attach(comm, PCIIO_SPACE_WIN(win), space, base, hconn, gconn, PCIBA_EDGE_LBL_IO); - } - } else { - if (!mwins++) { - pciba_sub_attach(comm, PCIIO_SPACE_WIN(win), space, base, hconn, gconn, PCIBA_EDGE_LBL_MEM); - } + if (register_pci_device(device_dir_handle, dev) == failure) { + devfs_unregister(pciba_devfs_handle); + return failure; + } } - if ((base & 7) == 4) - win++; - } - - pciba_sub_attach(comm, PCIIO_SPACE_CFG, PCIIO_SPACE_NONE, 0, hconn, gconn, PCIBA_EDGE_LBL_CFG); - pciba_sub_attach(comm, PCIBA_SPACE_UDMA, PCIIO_SPACE_NONE, 0, hconn, gconn, PCIBA_EDGE_LBL_DMA); -#if ULI - pciba_sub_attach(comm, PCIIO_SPACE_NONE, PCIIO_SPACE_NONE, 0, hconn, gconn, PCIBA_EDGE_LBL_INTR); -#endif + return success; +} - /* XXX should ignore if device is an IOC3 */ - if (ht == 0x01) - base = pciio_config_get(hconn, PCI_EXPANSION_ROM+8, 4); - else - base = pciio_config_get(hconn, PCI_EXPANSION_ROM, 4); - - base &= 0xFFFFF000; - - if (base) { - if (base & (_PAGESZ - 1)) -#if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING("%v pciba: ROM is 0x%x\n" - "\tnot page aligned, mmap will be difficult\n", - hconn, base); #else - PRINT_WARNING("0x%x pciba: ROM is 0x%x\n" - "\tnot page aligned, mmap will be difficult\n", - hconn, base); -#endif - pciba_sub_attach(comm, PCIIO_SPACE_ROM, PCIIO_SPACE_MEM, base, hconn, gconn, PCIBA_EDGE_LBL_ROM); - } -#if !FICUS /* FICUS shorts the refct by one on path_add */ - if (hbase != GRAPH_VERTEX_NONE) - hwgraph_vertex_unref(hbase); +extern devfs_handle_t +devfn_to_vertex(unsigned char busnum, unsigned int devfn); - if (gbase != GRAPH_VERTEX_NONE) - hwgraph_vertex_unref(gbase); -#endif +static status __init +register_with_devfs(void) +{ + struct pci_dev * dev; + devfs_handle_t device_dir_handle; - return 0; -} + TRACE(); -static void -pciba_sub_attach2(pciba_comm_t comm, - pciio_space_t space, - pciio_space_t iomem, - pciaddr_t base, - devfs_handle_t from, - char *name, - char *suf, - unsigned bigend) -{ - char nbuf[128]; - pciba_soft_t soft; - devfs_handle_t handle = NULL; - - if (suf && *suf) { - strcpy(nbuf, name); - name = nbuf; - strcat(name, suf); - } - -#if DEBUG_PCIBA - printk("pciba_sub_attach2 %p/%s %p at %p[%x]\n", - from, name, space, space_desc, iomem, space_desc, base, from, name); -#endif + /* FIXME: don't forget /dev/.../pci/mem & /dev/.../pci/io */ - if (space < TRACKED_SPACES) - if ((soft = comm->soft[space][bigend]) != NULL) { - soft->refct ++; - hwgraph_edge_add(from, soft->vhdl, name); - return; + pci_for_each_dev(dev) { + device_dir_handle = devfn_to_vertex(dev->bus->number, + dev->devfn); + if (device_dir_handle == NULL) + return failure; + + if (register_pci_device(device_dir_handle, dev) == failure) { + devfs_unregister(pciba_devfs_handle); + return failure; + } } - NEW(soft); - if (!soft) - return; - - soft->comm = comm; - soft->space = space; - soft->size = 0; - soft->iomem = iomem; - soft->base = base; - soft->refct = 1; - - if (space == PCIIO_SPACE_NONE) - soft->flags = 0; - else if (bigend) - soft->flags = PCIIO_BYTE_STREAM; - else - soft->flags = PCIIO_WORD_VALUES; - - handle = hwgraph_register(from, name, - 0, DEVFS_FL_AUTO_DEVNUM, - 0, 0, - S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, 0, 0, - &pciba_fops, NULL); - soft->vhdl = handle; - pciba_soft_set(soft->vhdl, soft); - if (space < TRACKED_SPACES) - comm->soft[space][bigend] = soft; - comm->refct ++; + return success; } -static void -pciba_sub_attach1(pciba_comm_t comm, - pciio_space_t space, - pciio_space_t iomem, - pciaddr_t base, - devfs_handle_t hfrom, - devfs_handle_t gfrom, - char *name, - char *suf, - unsigned bigend) -{ - pciba_sub_attach2(comm, space, iomem, base, hfrom, name, suf, bigend); - if ((gfrom != GRAPH_VERTEX_NONE) && (gfrom != hfrom)) - pciba_sub_attach2(comm, space, iomem, base, gfrom, name, suf, bigend); -} +#endif /* CONFIG_IA64_SGI_SN1 */ + + +static void __exit +unregister_with_devfs(void) +{ + struct list_head * lhp; + struct node_data * nd; + + TRACE(); + + list_for_each(lhp, &global_node_list) { + nd = list_entry(lhp, struct node_data, global_node_list); + devfs_unregister(nd->devfs_handle); + } -static void -pciba_sub_attach(pciba_comm_t comm, - pciio_space_t space, - pciio_space_t iomem, - pciaddr_t base, - devfs_handle_t hfrom, - devfs_handle_t gfrom, - char *name) -{ - pciba_sub_attach1(comm, space, iomem, base, hfrom, gfrom, name, NULL, 0); - if (iomem != PCIIO_SPACE_NONE) { - pciba_sub_attach1(comm, space, iomem, base, hfrom, gfrom, name, "_le", 0); - pciba_sub_attach1(comm, space, iomem, base, hfrom, gfrom, name, "_be", 1); - } } -#ifdef LATER -static void -pciba_reload_me(devfs_handle_t pconn_vhdl) + +struct node_data * new_node(void) { - devfs_handle_t vhdl; + struct node_data * node; + + TRACE(); + + node = kmalloc(sizeof(struct node_data), GFP_KERNEL); + if (node == NULL) + return NULL; + list_add(&node->global_node_list, &global_node_list); + return node; +} -#if DEBUG_PCIBA - printf("pciba_reload_me(%v)\n", pconn_vhdl); -#endif - if (GRAPH_SUCCESS != - hwgraph_traverse(pconn_vhdl, PCIBA_EDGE_LBL_CFG, &vhdl)) - return; +void dma_cleanup(struct node_data * dma_node) +{ + TRACE(); - hwgraph_vertex_unref(vhdl); + /* FIXME: should free these allocations */ +#ifdef DEBUG_PCIBA + dump_allocations(&dma_node->u.dma.dma_allocs); +#endif + devfs_unregister(dma_node->devfs_handle); } -#endif /* LATER */ -static pciba_bus_t -pciba_find_bus(devfs_handle_t pconn, int cflag) + +void init_dma_node(struct node_data * node, + struct pci_dev * dev, devfs_handle_t dh) { - pciio_info_t pciio_info; - devfs_handle_t master; - arbitrary_info_t ainfo; - pciba_bus_t bus; + TRACE(); - pciio_info = pciio_info_get(pconn); - master = pciio_info_master_get(pciio_info); + node->devfs_handle = dh; + node->u.dma.dev = dev; + node->cleanup = dma_cleanup; + INIT_LIST_HEAD(&node->u.dma.dma_allocs); +} - if (GRAPH_SUCCESS == - hwgraph_info_get_LBL(master, PCIBA_INFO_LBL_BUS, &ainfo)) - return (pciba_bus_t) ainfo; - if (!cflag) - return 0; +void rom_cleanup(struct node_data * rom_node) +{ + TRACE(); - NEW(bus); - if (!bus) - return 0; + if (rom_node->u.rom.mmapped) + pci_write_config_dword(rom_node->u.rom.dev, + PCI_ROM_ADDRESS, + rom_node->u.rom.saved_rom_base_reg); + devfs_unregister(rom_node->devfs_handle); +} - sema_init(&bus->lock, 1); - ainfo = (arbitrary_info_t) bus; - hwgraph_info_add_LBL(master, PCIBA_INFO_LBL_BUS, ainfo); - hwgraph_info_get_LBL(master, PCIBA_INFO_LBL_BUS, &ainfo); - if ((pciba_bus_t) ainfo != bus) - DEL(bus); -#if DEBUG_PCIBA - else - printk("pcbia_find_bus: new bus at %p\n", master); -#endif +void init_rom_node(struct node_data * node, + struct pci_dev * dev, devfs_handle_t dh) +{ + TRACE(); - return (pciba_bus_t) ainfo; + node->devfs_handle = dh; + node->u.rom.dev = dev; + node->cleanup = rom_cleanup; + node->u.rom.mmapped = false; } -#ifdef LATER -static void -pciba_map_push(pciba_bus_t bus, pciba_map_t map) + +static status __init +register_pci_device(devfs_handle_t device_dir_handle, struct pci_dev * dev) { -#if DEBUG_PCIBA - printk("pciba_map_push(bus=0x%x, map=0x%x, hdl=0x%x\n", - bus, map, map->handle); -#endif - pciba_bus_lock(bus); - map->next = bus->maps; - bus->maps = map; - pciba_bus_unlock(bus); -} - -static pciba_map_t -pciba_map_pop_hdl(pciba_bus_t bus, __psunsigned_t handle) -{ - pciba_map_h hdl; - pciba_map_t map; - - pciba_bus_lock(bus); - for (hdl = &bus->maps; map = *hdl; hdl = &map->next) - if (map->handle == handle) { - *hdl = map->next; - break; + struct node_data * nd; + char devfs_path[20]; + devfs_handle_t node_devfs_handle; + int ri; + + TRACE(); + + + /* register nodes for all the device's base address registers */ + for (ri = 0; ri < PCI_ROM_RESOURCE; ri++) { + if (pci_resource_len(dev, ri) != 0) { + sprintf(devfs_path, "base/%d", ri); + if (devfs_register(device_dir_handle, devfs_path, + DEVFS_FL_NONE, + 0, 0, + S_IFREG | S_IRUSR | S_IWUSR, + &base_fops, + &dev->resource[ri]) == NULL) + return failure; + } } - pciba_bus_unlock(bus); -#if DEBUG_PCIBA - printk("pciba_map_pop_va(bus=0x%x, handle=0x%x) returns map=0x%x\n", - bus, handle, map); + + /* register a node corresponding to the first MEM resource on + the device */ + for (ri = 0; ri < PCI_ROM_RESOURCE; ri++) { + if (dev->resource[ri].flags & IORESOURCE_MEM && + pci_resource_len(dev, ri) != 0) { + if (devfs_register(device_dir_handle, "mem", + DEVFS_FL_NONE, 0, 0, + S_IFREG | S_IRUSR | S_IWUSR, + &base_fops, + &dev->resource[ri]) == NULL) + return failure; + break; + } + } + + /* also register a node corresponding to the first IO resource + on the device */ + for (ri = 0; ri < PCI_ROM_RESOURCE; ri++) { + if (dev->resource[ri].flags & IORESOURCE_IO && + pci_resource_len(dev, ri) != 0) { + if (devfs_register(device_dir_handle, "io", + DEVFS_FL_NONE, 0, 0, + S_IFREG | S_IRUSR | S_IWUSR, + &base_fops, + &dev->resource[ri]) == NULL) + return failure; + break; + } + } + + /* register a node corresponding to the device's ROM resource, + if present */ + if (pci_resource_len(dev, PCI_ROM_RESOURCE) != 0) { + nd = new_node(); + if (nd == NULL) + return failure; + node_devfs_handle = devfs_register(device_dir_handle, "rom", + DEVFS_FL_NONE, 0, 0, + S_IFREG | S_IRUSR, + &rom_fops, nd); + if (node_devfs_handle == NULL) + return failure; + init_rom_node(nd, dev, node_devfs_handle); + } + + /* register a node that allows ioctl's to read and write to + the device's config space */ + if (devfs_register(device_dir_handle, "config", DEVFS_FL_NONE, + 0, 0, S_IFREG | S_IRUSR | S_IWUSR, + &config_fops, dev) == NULL) + return failure; + + + /* finally, register a node that allows ioctl's to allocate + and free DMA buffers, as well as memory map those + buffers. */ + nd = new_node(); + if (nd == NULL) + return failure; + node_devfs_handle = + devfs_register(device_dir_handle, "dma", DEVFS_FL_NONE, + 0, 0, S_IFREG | S_IRUSR | S_IWUSR, + &dma_fops, nd); + if (node_devfs_handle == NULL) + return failure; + init_dma_node(nd, dev, node_devfs_handle); + +#ifdef DEBUG_PCIBA + dump_nodes(&global_node_list); #endif - return map; + + return success; } -/* ================================================================ - * driver teardown, unregister and unload - */ -int -pciba_unload(void) -{ -#if DEBUG_PCIBA - printk("pciba_unload()\n"); -#endif - if (atomic_read(&pciba_prevent_unload)) - return -1; +static int +generic_open(struct inode * inode, struct file * file) +{ + TRACE(); - pciio_iterate("pciba_", pciba_unload_me); + /* FIXME: should check that they're not trying to open the ROM + writable */ - return 0; + return 0; /* success */ } -int -pciba_unreg(void) + +static int +rom_mmap(struct file * file, struct vm_area_struct * vma) { + unsigned long pci_pa; + struct node_data * nd; -#if DEBUG_PCIBA - printf("pciba_unreg()\n"); -#endif + TRACE(); - if (atomic_read(&pciba_prevent_unload)) - return -1; + nd = (struct node_data * )file->private_data; - pciio_driver_unregister("pciba_"); - return 0; + pci_pa = pci_resource_start(nd->u.rom.dev, PCI_ROM_RESOURCE); + + if (!nd->u.rom.mmapped) { + nd->u.rom.mmapped = true; + DPRINTF("Enabling ROM address decoder.\n"); + DPRINTF( +"rom_mmap: FIXME: some cards do not allow both ROM and memory addresses to\n" +"rom_mmap: FIXME: be enabled simultaneously, as they share a decoder.\n"); + pci_read_config_dword(nd->u.rom.dev, PCI_ROM_ADDRESS, + &nd->u.rom.saved_rom_base_reg); + DPRINTF("ROM base address contains %x\n", + nd->u.rom.saved_rom_base_reg); + pci_write_config_dword(nd->u.rom.dev, PCI_ROM_ADDRESS, + nd->u.rom.saved_rom_base_reg | + PCI_ROM_ADDRESS_ENABLE); + } + + return mmap_pci_address(vma, pci_pa); } -int -pciba_detach(devfs_handle_t conn) + +static int +rom_release(struct inode * inode, struct file * file) { - devfs_handle_t base; - pciba_bus_t bus; - devfs_handle_t gconn; - devfs_handle_t gbase; + struct node_data * nd; - pciio_info_t pciio_info; - devfs_handle_t master; - arbitrary_info_t ainfo; - int ret; + TRACE(); -#if DEBUG_PCIBA - printf("pciba_detach(%v)\n", conn); -#endif + nd = (struct node_data * )file->private_data; - if ((GRAPH_SUCCESS != - hwgraph_traverse(conn, ".guest", &gconn)) || - (conn == gconn)) - gconn = GRAPH_VERTEX_NONE; - - if (gconn != GRAPH_VERTEX_NONE) { - pciba_sub_detach(gconn, PCIBA_EDGE_LBL_CFG); - pciba_sub_detach(gconn, PCIBA_EDGE_LBL_DMA); - pciba_sub_detach(gconn, PCIBA_EDGE_LBL_ROM); -#if ULI - pciba_sub_detach(gconn, PCIBA_EDGE_LBL_INTR); -#endif - if (GRAPH_SUCCESS == hwgraph_edge_remove(conn, PCIBA_EDGE_LBL_BASE, &gbase)) { - pciba_sub_detach(gconn, PCIBA_EDGE_LBL_MEM); - pciba_sub_detach(gconn, PCIBA_EDGE_LBL_IO); - pciba_sub_detach(gbase, "0"); - pciba_sub_detach(gbase, "1"); - pciba_sub_detach(gbase, "2"); - pciba_sub_detach(gbase, "3"); - pciba_sub_detach(gbase, "4"); - pciba_sub_detach(gbase, "5"); - hwgraph_vertex_unref(gbase); - if (GRAPH_SUCCESS != (ret = hwgraph_vertex_destroy(gbase))) { -#if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING("pciba: hwgraph_vertex_destroy(%v/base) failed (%d)", - conn, ret); -#else - PRINT_WARNING("pciba: hwgraph_vertex_destroy(0x%x/base) failed (%d)", - conn, ret); -#endif -#if DEBUG_REFCT - printk("\tretained refct %d\n", hwgraph_vertex_refct(gbase)); -#endif - } + if (nd->u.rom.mmapped) { + nd->u.rom.mmapped = false; + DPRINTF("Disabling ROM address decoder.\n"); + pci_write_config_dword(nd->u.rom.dev, PCI_ROM_ADDRESS, + nd->u.rom.saved_rom_base_reg); } - } + return 0; /* indicate success */ +} - pciba_sub_detach(conn, PCIBA_EDGE_LBL_CFG); - pciba_sub_detach(conn, PCIBA_EDGE_LBL_DMA); - pciba_sub_detach(conn, PCIBA_EDGE_LBL_ROM); -#if ULI - pciba_sub_detach(conn, PCIBA_EDGE_LBL_INTR); -#endif - if (GRAPH_SUCCESS == hwgraph_edge_remove(conn, PCIBA_EDGE_LBL_BASE, &base)) { - pciba_sub_detach(conn, PCIBA_EDGE_LBL_MEM); - pciba_sub_detach(conn, PCIBA_EDGE_LBL_IO); - pciba_sub_detach(base, "0"); - pciba_sub_detach(base, "1"); - pciba_sub_detach(base, "2"); - pciba_sub_detach(base, "3"); - pciba_sub_detach(base, "4"); - pciba_sub_detach(base, "5"); - hwgraph_vertex_unref(base); - if (GRAPH_SUCCESS != (ret = hwgraph_vertex_destroy(base))) { -#if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING(CE_WARN, "pciba: hwgraph_vertex_destroy(%v/base) failed (%d)", - conn, ret); -#else - PRINT_WARNING(CE_WARN, "pciba: hwgraph_vertex_destroy(0x%x/base) failed (%d)", - conn, ret); -#endif -#if DEBUG_REFCT - printk("\tretained refct %d\n", hwgraph_vertex_refct(base)); -#endif - } - } +static int +base_mmap(struct file * file, struct vm_area_struct * vma) +{ + struct resource * resource; - bus = pciba_find_bus(conn, 0); - if (bus && !--(bus->refct)) { + TRACE(); - pciio_info = pciio_info_get(conn); + resource = (struct resource *)file->private_data; - master = pciio_info_master_get(pciio_info); + return mmap_pci_address(vma, resource->start); +} - pciba_sub_detach(master, PCIBA_EDGE_LBL_IO); - pciba_sub_detach(master, PCIBA_EDGE_LBL_MEM); - pciba_sub_detach(master, PCIBA_EDGE_LBL_CFG); - hwgraph_info_remove_LBL(master, PCIBA_INFO_LBL_BUS, &ainfo); -#if DEBUG_PCIBA - printf("pcbia_detach: DEL(bus) at %v\n", master); -#endif - DEL(bus); - } +static int +config_ioctl(struct inode * inode, struct file * file, + unsigned int cmd, + unsigned long arg) +{ + struct pci_dev * dev; - return 0; -} + union cfg_data { + uint8_t byte; + uint16_t word; + uint32_t dword; + } read_data, write_data; -static void -pciba_sub_detach1(devfs_handle_t conn, - char *name, - char *suf) -{ - devfs_handle_t vhdl; - pciba_soft_t soft; - pciba_comm_t comm; - int ret; - char nbuf[128]; - - if (suf && *suf) { - strcpy(nbuf, name); - name = nbuf; - strcat(name, suf); - } - - if ((GRAPH_SUCCESS == hwgraph_edge_remove(conn, name, &vhdl)) && - ((soft = pciba_soft_get(vhdl)) != NULL)) { -#if DEBUG_PCIBA -#if defined(SUPPORT_PRINTING_V_FORMAT) - prink("pciba_sub_detach(%v,%s)\n", conn, name); -#else - prink("pciba_sub_detach(0x%x,%s)\n", conn, name); -#endif -#endif + int dir, size, offset; - hwgraph_vertex_unref(soft->vhdl); -#if DEBUG_REFCT - printk("\tadjusted refct %d (soft ref: %d)\n", - hwgraph_vertex_refct(vhdl), - soft->refct); -#endif - if (!--(soft->refct)) { - comm = soft->comm; - if (!--(comm->refct)) { - DEL(comm); - } - pciba_soft_set(vhdl, 0); - DEL(soft); - - hwgraph_vertex_unref(vhdl); - if (GRAPH_SUCCESS != (ret = hwgraph_vertex_destroy(vhdl))) { -#if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING("pciba: hwgraph_vertex_destroy(0x%x/%s) failed (%d)", - conn, name, ret); -#else - PRINT_WARNING("pciba: hwgraph_vertex_destroy(%v/%s) failed (%d)", - conn, name, ret); -#endif -#if DEBUG_REFCT - printk("\tretained refct %d\n", hwgraph_vertex_refct(vhdl)); -#endif - } - } - } -} + TRACE(); -static void -pciba_sub_detach(devfs_handle_t conn, - char *name) -{ - pciba_sub_detach1(conn, name, ""); - pciba_sub_detach1(conn, name, "_le"); - pciba_sub_detach1(conn, name, "_be"); -} + DPRINTF("cmd = %x (DIR = %x, TYPE = %x, NR = %x, SIZE = %x)\n", + cmd, + _IOC_DIR(cmd), _IOC_TYPE(cmd), _IOC_NR(cmd), _IOC_SIZE(cmd)); + DPRINTF("arg = %lx\n", arg); -static void -pciba_unload_me(devfs_handle_t pconn_vhdl) -{ - devfs_handle_t c_vhdl; + dev = (struct pci_dev *)file->private_data; -#if DEBUG_PCIBA - printf("pciba_unload_me(%v)\n", pconn_vhdl); -#endif + /* PCIIOCCFG{RD,WR}: read and/or write PCI configuration + space. If both, the read happens first (this becomes a swap + operation, atomic with respect to other updates through + this path). */ - if (GRAPH_SUCCESS != - hwgraph_traverse(pconn_vhdl, PCIBA_EDGE_LBL_CFG, &c_vhdl)) - return; + dir = _IOC_DIR(cmd); - hwgraph_vertex_unref(c_vhdl); -} +#define do_swap(suffix, type) \ + do { \ + if (dir & _IOC_READ) { \ + pci_read_config_##suffix(dev, _IOC_NR(cmd), \ + &read_data.suffix); \ + } \ + if (dir & _IOC_WRITE) { \ + get_user(write_data.suffix, (type)arg); \ + pci_write_config_##suffix(dev, _IOC_NR(cmd), \ + write_data.suffix); \ + } \ + if (dir & _IOC_READ) { \ + put_user(read_data.suffix, (type)arg); \ + } \ + } while (0) -/* ================================================================ - * standard unix entry points - */ + size = _IOC_SIZE(cmd); + offset = _IOC_NR(cmd); -/*ARGSUSED */ -int -pciba_open(dev_t *devp, int flag, int otyp, struct cred *crp) -{ + DPRINTF("sanity check\n"); + if (((size > 0) || (size <= 4)) && + ((offset + size) <= 256) && + (dir & (_IOC_READ | _IOC_WRITE))) { -#if DEBUG_PCIBA - printf("pciba_open(%V)\n", *devp); -#endif - return 0; + switch (size) + { + case 1: + do_swap(byte, uint8_t *); + break; + case 2: + do_swap(word, uint16_t *); + break; + case 4: + do_swap(dword, uint32_t *); + break; + default: + DPRINTF("invalid ioctl\n"); + return -EINVAL; + } + } else + return -EINVAL; + + return 0; } -/*ARGSUSED */ -int -pciba_close(dev_t dev) -{ - devfs_handle_t vhdl = dev_to_vhdl(dev); - pciba_soft_t soft = pciba_soft_get(vhdl); - -#if DEBUG_PCIBA - printf("pciba_close(%V)\n", dev); -#endif - /* if there is pending DMA for this device, hit the - * device over the head with a baseball bat and - * release the system memory resources. - */ - if (soft && soft->comm->dmap) { - pciba_dma_t next; - pciba_dma_t dmap; - - pciba_soft_lock(soft); - if (dmap = soft->comm->dmap) { - soft->comm->dmap = 0; - - pciio_reset(soft->comm->conn); - - do { - if (!dmap->kaddr) - break; - if (!dmap->paddr) - break; - if (dmap->bytes < NBPP) - break; - next = dmap->next; - kvpfree(dmap->kaddr, dmap->bytes / NBPP); - dmap->paddr = 0; - dmap->bytes = 0; - DEL(dmap); - } while (dmap = next); +#ifdef DEBUG_PCIBA +static void +dump_allocations(struct list_head * dalp) +{ + struct dma_allocation * dap; + struct list_head * p; + + printk("{\n"); + list_for_each(p, dalp) { + dap = list_entry(p, struct dma_allocation, + list); + printk(" handle = %lx, va = %p\n", + dap->handle, dap->va); } - pciba_soft_unlock(soft); - } - return 0; + printk("}\n"); } -/* ARGSUSED */ -int -pciba_read(dev_t dev, cred_t *crp) +static void +dump_nodes(struct list_head * nodes) { -#if DEBUG_PCIBA - printf("pciba_read(%V)\n", dev); -#endif - - return EINVAL; + struct node_data * ndp; + struct list_head * p; + + printk("{\n"); + list_for_each(p, nodes) { + ndp = list_entry(p, struct node_data, + global_node_list); + printk(" %p\n", (void *)ndp); + } + printk("}\n"); } -/* ARGSUSED */ -int -pciba_write(dev_t dev, cred_t *crp) + +#if 0 +#define NEW(ptr) (ptr = kmalloc(sizeof (*(ptr)), GFP_KERNEL)) + +static void +test_list(void) { -#if DEBUG_PCIBA - printf("pciba_write(%V)\n", dev); -#endif + u64 i; + LIST_HEAD(the_list); - return EINVAL; + for (i = 0; i < 5; i++) { + struct dma_allocation * new_alloc; + NEW(new_alloc); + new_alloc->va = (void *)i; + new_alloc->handle = 5*i; + printk("%d - the_list->next = %lx\n", i, the_list.next); + list_add(&new_alloc->list, &the_list); + } + dump_allocations(&the_list); } - -/*ARGSUSED */ -int -pciba_ioctl(dev_t dev, int cmd, void *uarg, int mode, cred_t *crp, int *rvalp) -{ - devfs_handle_t vhdl; - pciba_soft_t soft; - pciio_space_t space; - ioctl_arg_buffer_t arg; - int psize; - int err = 0; - -#if ULI - char abi = get_current_abi(); - pciio_intr_t intr=0; - device_desc_t desc; - cpuid_t intrcpu; - unsigned lines; - struct uli *uli = 0; #endif - unsigned flags; - void *kaddr = 0; - iopaddr_t paddr; - pciba_dma_h dmah; - pciba_dma_t dmap = 0; - pciio_dmamap_t dmamap = 0; - size_t bytes; - int pages; - pciaddr_t daddr; - -#if DEBUG_PCIBA - printf("pciba_ioctl(%V,0x%x)\n", dev, cmd); #endif - psize = (cmd >> 16) & IOCPARM_MASK; - -#if ULI - ASSERT(sizeof(struct uliargs) > 8); /* prevent CFG access conflict */ - ASSERT(sizeof(struct uliargs) <= IOCPARM_MASK); -#endif - arg.ca = uarg; +static LIST_HEAD(dma_buffer_list); - if ((psize > 0) && (cmd & (IOC_OUT | IOC_IN))) { - if (psize > sizeof(arg)) - err = EINVAL; /* "bad parameter size */ - else { - if (cmd & IOC_OUT) - bzero(arg.data, psize); - if ((cmd & IOC_IN) && - (copyin(uarg, arg.data, psize) < 0)) - err = EFAULT; /* "parameter copyin failed" */ - } - } - vhdl = dev_to_vhdl(dev); - soft = pciba_soft_get(vhdl); - space = soft->space; - - if (err == 0) { - err = EINVAL; /* "invalid ioctl for this vertex" */ - switch (space) { -#if ULI - case PCIIO_SPACE_NONE: /* the "intr" vertex */ - /* PCIIOCSETULI: set up user interrupts. - */ - lines = cmd & 15; - if (ABI_IS_64BIT(abi)) { - if (cmd != PCIIOCSETULI(lines)) { - err = EINVAL; /* "invalid ioctl for this vertex" */ - break; - } - } - else { - struct uliargs uliargs; - - if (cmd != PCIIOCSETULI32(lines)) { - err = EINVAL; /* "invalid ioctl for this vertex" */ - break; - } - - uliargs32_to_uliargs(&arg.uli32, &uliargs); - arg.uli = uliargs; - } - desc = device_desc_dup(soft->comm->conn); - device_desc_flags_set(desc, (device_desc_flags_get(desc) | - D_INTR_NOTHREAD)); - device_desc_intr_swlevel_set(desc, INTR_SWLEVEL_NOTHREAD_DEFAULT); - device_desc_intr_name_set(desc, "PCIBA"); - device_desc_default_set(soft->comm->conn, desc); - - /* When designating interrupts, the slot number - * is taken from the connection point. - * Bits 0..3 are used to select INTA..INTD; more - * than one bit can be specified. These should - * be constructed using PCIIO_INTR_LINE_[ABCD]. - */ - intr = pciio_intr_alloc - (soft->comm->conn, desc, lines, soft->vhdl); - if (intr == 0) { - err = ENOMEM; /* "insufficient resources" */ - break; - } - intrcpu = cpuvertex_to_cpuid(pciio_intr_cpu_get(intr)); - if (err = new_uli(&arg.uli, &uli, intrcpu)) { - break; /* "unable to set up ULI" */ - } - atomic_inc(&pciba_prevent_unload); - - pciio_intr_connect(intr, pciba_intr, uli, (void *) 0); - - /* NOTE: don't set the teardown function - * until the interrupt is connected. - */ - uli->teardownarg1 = (__psint_t) intr; - uli->teardown = pciba_clearuli; - - arg.uli.id = uli->index; - - if (!ABI_IS_64BIT(abi)) { - struct uliargs32 uliargs32; - uliargs_to_uliargs32(&arg.uli, &uliargs32); - arg.uli32 = uliargs32; - } +static int +dma_ioctl(struct inode * inode, struct file * file, + unsigned int cmd, + unsigned long arg) +{ + struct node_data * nd; + uint64_t argv; + int result; + struct dma_allocation * dma_alloc; + struct list_head * iterp; - err = 0; - break; -#endif + TRACE(); - case PCIBA_SPACE_UDMA: /* the "dma" vertex */ + DPRINTF("cmd = %x\n", cmd); + DPRINTF("arg = %lx\n", arg); - switch (cmd) { + nd = (struct node_data *)file->private_data; - case PCIIOCDMAALLOC: - /* PCIIOCDMAALLOC: allocate a chunk of physical - * memory and set it up for DMA. Return the - * PCI address that gets to it. - * NOTE: this allocates memory local to the - * CPU doing the ioctl, not local to the - * device that will be doing the DMA. - */ - - if (!_CAP_ABLE(CAP_DEVICE_MGT)) { - err = EPERM; - break; - } - /* separate the halves of the incoming parameter */ - flags = arg.ud >> 32; - bytes = arg.ud & 0xFFFFFFFF; - -#if DEBUG_PCIBA - printf("pciba: user wants 0x%x bytes of DMA, flags 0x%x\n", - bytes, flags); +#ifdef DEBUG_PCIBA + DPRINTF("at dma_ioctl entry\n"); + dump_allocations(&nd->u.dma.dma_allocs); #endif - /* round up the requested size to the next highest page */ - pages = (bytes + NBPP - 1) / NBPP; - - /* make sure the requested size is something reasonable */ - if (pages > pci_user_dma_max_pages) { -#if DEBUG_PCIBA - printf("pciba: request for too much buffer space\n"); + switch (cmd) { + case PCIIOCDMAALLOC: + /* PCIIOCDMAALLOC: allocate a chunk of physical memory + and set it up for DMA. Return the PCI address that + gets to it. */ + DPRINTF("case PCIIOCDMAALLOC (%lx)\n", PCIIOCDMAALLOC); + + if ( (result = get_user(argv, (uint64_t *)arg)) ) + return result; + DPRINTF("argv (size of buffer) = %lx\n", argv); + + dma_alloc = (struct dma_allocation *) + kmalloc(sizeof(struct dma_allocation), GFP_KERNEL); + if (dma_alloc == NULL) + return -ENOMEM; + + dma_alloc->size = (size_t)argv; + dma_alloc->va = pci_alloc_consistent(nd->u.dma.dev, + dma_alloc->size, + &dma_alloc->handle); + DPRINTF("dma_alloc->va = %p, dma_alloc->handle = %lx\n", + dma_alloc->va, dma_alloc->handle); + if (dma_alloc->va == NULL) { + kfree(dma_alloc); + return -ENOMEM; + } + + list_add(&dma_alloc->list, &nd->u.dma.dma_allocs); + if ( (result = put_user((uint64_t)dma_alloc->handle, + (uint64_t *)arg)) ) { + DPRINTF("put_user failed\n"); + pci_free_consistent(nd->u.dma.dev, (size_t)argv, + dma_alloc->va, dma_alloc->handle); + kfree(dma_alloc); + return result; + } + +#ifdef DEBUG_PCIBA + DPRINTF("after insertion\n"); + dump_allocations(&nd->u.dma.dma_allocs); #endif - err = EINVAL; - break; /* "request for too much buffer space" */ - } - /* "correct" number of bytes */ - bytes = pages * NBPP; + break; - /* allocate the space */ - /* XXX- force to same node as the device? */ - /* XXX- someday, we want to handle user buffers, - * and noncontiguous pages, but this will - * require either fancy mapping or handing - * a list of blocks back to the user. For - * now, just tell users to allocate a lot of - * individual single-pages and manage their - * scatter-gather manually. - */ - kaddr = kvpalloc(pages, VM_DIRECT | KM_NOSLEEP, 0); - if (kaddr == 0) { -#if DEBUG_PCIBA - printf("pciba: unable to get %d contiguous pages\n", pages); -#endif - err = EAGAIN; /* "insufficient resources, try again later" */ - break; - } -#if DEBUG_PCIBA - printf("pciba: kaddr is 0x%x\n", kaddr); -#endif - paddr = kvtophys(kaddr); + case PCIIOCDMAFREE: + DPRINTF("case PCIIOCDMAFREE (%lx)\n", PCIIOCDMAFREE); - daddr = pciio_dmatrans_addr - (soft->comm->conn, 0, paddr, bytes, flags); - if (daddr == 0) { /* "no direct path available" */ -#if DEBUG_PCIBA - printf("pciba: dmatrans failed, trying dmamap\n"); -#endif - dmamap = pciio_dmamap_alloc - (soft->comm->conn, 0, bytes, flags); - if (dmamap == 0) { -#if DEBUG_PCIBA - printf("pciba: unable to allocate dmamap\n"); -#endif - err = ENOMEM; - break; /* "out of mapping resources" */ - } - daddr = pciio_dmamap_addr - (dmamap, paddr, bytes); - if (daddr == 0) { -#if DEBUG_PCIBA - printf("pciba: dmamap_addr failed\n"); -#endif - err = EINVAL; - break; /* "can't get there from here" */ - } - } -#if DEBUG_PCIBA - printf("pciba: daddr is 0x%x\n", daddr); + if ( (result = get_user(argv, (uint64_t *)arg)) ) { + DPRINTF("get_user failed\n"); + return result; + } + + DPRINTF("argv (physical address of DMA buffer) = %lx\n", argv); + list_for_each(iterp, &nd->u.dma.dma_allocs) { + struct dma_allocation * da = + list_entry(iterp, struct dma_allocation, list); + if (da->handle == argv) { + pci_free_consistent(nd->u.dma.dev, da->size, + da->va, da->handle); + list_del(&da->list); + kfree(da); +#ifdef DEBUG_PCIBA + DPRINTF("after deletion\n"); + dump_allocations(&nd->u.dma.dma_allocs); #endif - NEW(dmap); - if (!dmap) { - err = ENOMEM; - break; /* "no memory available" */ + return 0; /* success */ + } } - dmap->bytes = bytes; - dmap->pages = pages; - dmap->paddr = paddr; - dmap->kaddr = kaddr; - dmap->map = dmamap; - dmap->daddr = daddr; - dmap->handle = 0; - -#if DEBUG_PCIBA - printf("pciba: dmap 0x%x contains va 0x%x bytes 0x%x pa 0x%x pages 0x%x daddr 0x%x\n", - dmap, kaddr, bytes, paddr, pages, daddr); -#endif + /* previously allocated dma buffer wasn't found */ + DPRINTF("attempt to free invalid dma handle\n"); + return -EINVAL; - arg.ud = dmap->daddr; + default: + DPRINTF("undefined ioctl\n"); + return -EINVAL; + } - err = 0; - break; + DPRINTF("success\n"); + return 0; +} + - case PCIIOCDMAFREE: - /* PCIIOCDMAFREE: Find the chunk of - * User DMA memory, and release its - * resources back to the system. - */ - - if (!_CAP_ABLE(CAP_DEVICE_MGT)) { - err = EPERM; /* "you can't do that" */ - break; - } - if (soft->comm->dmap == NULL) { - err = EINVAL; /* "no User DMA to free" */ - break; - } - /* find the request. */ - daddr = arg.ud; - err = EINVAL; /* "block not found" */ - pciba_soft_lock(soft); - for (dmah = &soft->comm->dmap; dmap = *dmah; dmah = &dmap->next) { - if (dmap->daddr == daddr) { - if (dmap->handle != 0) { - dmap = 0; /* don't DEL this dmap! */ - err = EINVAL; /* "please unmap first" */ - break; /* break outa for loop. */ - } - *dmah = dmap->next; +static int +dma_mmap(struct file * file, struct vm_area_struct * vma) +{ + struct node_data * nd; + struct list_head * iterp; + int result; + + TRACE(); - if (dmamap = dmap->map) { - pciio_dmamap_free(dmamap); - dmamap = 0; /* don't free it twice! */ + nd = (struct node_data *)file->private_data; + + DPRINTF("vma->vm_start is %lx\n", vma->vm_start); + DPRINTF("vma->vm_end is %lx\n", vma->vm_end); + DPRINTF("offset = %lx\n", vma->vm_pgoff); + + /* get kernel virtual address for the dma buffer (necessary + * for the mmap). */ + list_for_each(iterp, &nd->u.dma.dma_allocs) { + struct dma_allocation * da = + list_entry(iterp, struct dma_allocation, list); + /* why does mmap shift its offset argument? */ + if (da->handle == vma->vm_pgoff << PAGE_SHIFT) { + DPRINTF("found dma handle\n"); + if ( (result = mmap_kernel_address(vma, + da->va)) ) { + return result; /* failure */ + } else { + /* it seems like at least one of these + should show up in user land.... + I'm missing something */ + *(char *)da->va = 0xaa; + strncpy(da->va, " Toastie!", da->size); + if (put_user(0x18badbeeful, + (u64 *)vma->vm_start)) + DPRINTF("put_user failed?!\n"); + return 0; /* success */ } - kvpfree(dmap->kaddr, dmap->bytes / NBPP); - DEL(dmap); - dmap = 0; /* don't link this back into the list! */ - err = 0; /* "all done" */ - break; /* break outa for loop. */ - } - } - pciba_soft_unlock(soft); - break; /* break outa case PCIIOCDMAFREE: */ - } - break; /* break outa case PCIBA_SPACE_UDMA: */ - - case PCIIO_SPACE_CFG: - - /* PCIIOCCFG{RD,WR}: read and/or write - * PCI configuration space. If both, - * the read happens first (this becomes - * a swap operation, atomic with respect - * to other updates through this path). - * - * Should be *last* IOCTl command checked, - * so other patterns can nip useless codes - * out of the space this decodes. - */ - err = EINVAL; - if ((psize > 0) || (psize <= 8) && - (((cmd & 0xFF) + psize) <= 256) && - (cmd & (IOC_IN | IOC_OUT))) { - - uint64_t rdata; - uint64_t wdata; - int shft; - - shft = 64 - (8 * psize); - - wdata = arg.ud >> shft; - - pciba_soft_lock(soft); - - if (cmd & IOC_OUT) - rdata = pciio_config_get(soft->comm->conn, cmd & 0xFFFF, psize); - if (cmd & IOC_IN) - pciio_config_set(soft->comm->conn, cmd & 0xFFFF, psize, wdata); - - pciba_soft_unlock(soft); - arg.ud = rdata << shft; - err = 0; - break; - } - break; - } - } - /* done: come here if all went OK. - */ - if ((err == 0) && - ((cmd & IOC_OUT) && (psize > 0)) && - copyout(arg.data, uarg, psize)) - err = EFAULT; - - /* This gets delayed until after the copyout so we - * do not free the dmap on a copyout error, or - * alternately end up with a dangling allocated - * buffer that the user never got back. - */ - if ((err == 0) && dmap) { - pciba_soft_lock(soft); - dmap->next = soft->comm->dmap; - soft->comm->dmap = dmap; - pciba_soft_unlock(soft); - } - if (err) { - /* Things went badly. Clean up. - */ -#if ULI - if (intr) { - pciio_intr_disconnect(intr); - pciio_intr_free(intr); - } - if (uli) - free_uli(uli); -#endif - if (dmap) { - if (dmap->map && (dmap->map != dmamap)) - pciio_dmamap_free(dmap->map); - DEL(dmap); + } } - if (dmamap) - pciio_dmamap_free(dmamap); - if (kaddr) - kvpfree(kaddr, pages); - } - return *rvalp = err; + DPRINTF("attempt to mmap an invalid dma handle\n"); + return -EINVAL; } -/* ================================================================ - * mapping support - */ - -/*ARGSUSED */ -int -pciba_map(dev_t dev, vhandl_t *vt, - off_t off, size_t len, uint32_t prot) -{ - devfs_handle_t vhdl = dev_to_vhdl(dev); - pciba_soft_t soft = pciba_soft_get(vhdl); - devfs_handle_t conn = soft->comm->conn; - pciio_space_t space = soft->space; - size_t pages = (len + NBPP - 1) / NBPP; - pciio_piomap_t pciio_piomap = 0; - caddr_t kaddr; - pciba_map_t map; - pciba_dma_t dmap; -#if DEBUG_PCIBA - printf("pciba_map(%V,vt=0x%x)\n", dev, vt); -#endif +static int +mmap_pci_address(struct vm_area_struct * vma, unsigned long pci_va) +{ + unsigned long pci_pa; - if (space == PCIBA_SPACE_UDMA) { - pciba_soft_lock(soft); + TRACE(); - for (dmap = soft->comm->dmap; dmap != NULL; dmap = dmap->next) { - if (off == dmap->daddr) { - if (pages != dmap->pages) { - pciba_soft_unlock(soft); - return EINVAL; /* "size mismatch" */ - } - v_mapphys(vt, dmap->kaddr, dmap->bytes); - dmap->handle = v_gethandle(vt); - pciba_soft_unlock(soft); -#if DEBUG_PCIBA - printf("pciba: mapped dma at kaddr 0x%x via handle 0x%x\n", - dmap->kaddr, dmap->handle); -#endif - return 0; - } - } - pciba_soft_unlock(soft); - return EINVAL; /* "block not found" */ - } - if (soft->iomem == PCIIO_SPACE_NONE) - return EINVAL; /* "mmap not supported" */ - - kaddr = (caddr_t) pciio_pio_addr - (conn, 0, space, off, len, &pciio_piomap, soft->flags | PCIIO_FIXED ); - -#if DEBUG_PCIBA - printf("pciba: mapped %R[0x%x..0x%x] via map 0x%x to kaddr 0x%x\n", - space, space_desc, off, off + len - 1, pciio_piomap, kaddr); -#endif + DPRINTF("vma->vm_start is %lx\n", vma->vm_start); + DPRINTF("vma->vm_end is %lx\n", vma->vm_end); - if (kaddr == NULL) - return EINVAL; /* "you can't get there from here" */ + /* the size of the vma doesn't necessarily correspond to the + size specified in the mmap call. So we can't really do any + kind of sanity check here. This is a dangerous driver, and + it's very easy for a user process to kill the machine. */ - NEW(map); - if (map == NULL) { - if (pciio_piomap) - pciio_piomap_free(pciio_piomap); - return ENOMEM; /* "unable to get memory resources */ - } -#ifdef LATER - map->uthread = curuthread; -#endif - map->handle = v_gethandle(vt); - map->uvaddr = v_getaddr(vt); - map->map = pciio_piomap; - map->space = soft->iomem; - map->base = soft->base + off; - map->size = len; - pciba_map_push(soft->comm->bus, map); - - /* Inform the system of the correct - * kvaddr corresponding to the thing - * that is being mapped. - */ - v_mapphys(vt, kaddr, len); - - return 0; -} - -/*ARGSUSED */ -int -pciba_unmap(dev_t dev, vhandl_t *vt) -{ - devfs_handle_t vhdl = dev_to_vhdl(dev); - pciba_soft_t soft = pciba_soft_get(vhdl); - pciba_bus_t bus = soft->comm->bus; - pciba_map_t map; - __psunsigned_t handle = v_gethandle(vt); + DPRINTF("PCI base at virtual address %lx\n", pci_va); + /* the __pa macro is intended for region 7 on IA64, so it + doesn't work for region 6 */ + /* pci_pa = __pa(pci_va); */ + /* should be replaced by __tpa or equivalent (preferably a + generic equivalent) */ + pci_pa = pci_va & ~0xe000000000000000ul; + DPRINTF("PCI base at physical address %lx\n", pci_pa); -#if DEBUG_PCIBA - printf("pciba_unmap(%V,vt=%x)\n", dev, vt); -#endif + /* there are various arch-specific versions of this function + defined in linux/drivers/char/mem.c, but it would be nice + if all architectures put it in pgtable.h. it's defined + there for ia64.... */ + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); - /* If this is a userDMA buffer, - * make a note that it has been unmapped - * so it can be released. - */ - if (soft->comm->dmap) { - pciba_dma_t dmap; - - pciba_soft_lock(soft); - for (dmap = soft->comm->dmap; dmap != NULL; dmap = dmap->next) - if (handle == dmap->handle) { - dmap->handle = 0; - pciba_soft_unlock(soft); -#if DEBUG_PCIBA - printf("pciba: unmapped dma at kaddr 0x%x via handle 0x%x\n", - dmap->kaddr, handle); -#endif - return 0; /* found userPCI */ - } - pciba_soft_unlock(soft); - } - map = pciba_map_pop_hdl(bus, handle); - if (map == NULL) - return EINVAL; /* no match */ + vma->vm_flags |= VM_NONCACHED | VM_RESERVED | VM_IO; - if (map->map) - pciio_piomap_free(map->map); - DEL(map); - - return (0); /* all done OK */ + return io_remap_page_range(vma->vm_start, pci_pa, + vma->vm_end-vma->vm_start, + vma->vm_page_prot); } -#if ULI -void -pciba_clearuli(struct uli *uli) + +static int +mmap_kernel_address(struct vm_area_struct * vma, void * kernel_va) { - pciio_intr_t intr = (pciio_intr_t) uli->teardownarg1; + unsigned long kernel_pa; -#if DEBUG_PCIBA - printf("pciba_clearuli(0x%x)\n", uli); -#endif + TRACE(); - pciio_intr_disconnect(intr); - pciio_intr_free(intr); - atomic_dec(&pciba_prevent_unload); -} + DPRINTF("vma->vm_start is %lx\n", vma->vm_start); + DPRINTF("vma->vm_end is %lx\n", vma->vm_end); -void -pciba_intr(intr_arg_t arg) -{ - struct uli *uli = (struct uli *) arg; - int ulinum = uli->index; + /* the size of the vma doesn't necessarily correspond to the + size specified in the mmap call. So we can't really do any + kind of sanity check here. This is a dangerous driver, and + it's very easy for a user process to kill the machine. */ - extern void frs_handle_uli(void); + DPRINTF("mapping virtual address %p\n", kernel_va); + kernel_pa = __pa(kernel_va); + DPRINTF("mapping physical address %lx\n", kernel_pa); - if (ulinum >= 0 && ulinum < MAX_ULIS) { - uli_callup(ulinum); + vma->vm_flags |= VM_NONCACHED | VM_RESERVED | VM_IO; - if (private.p_frs_flags) - frs_handle_uli(); - } -} -#endif -#endif /* LATER - undef as we implement each routine */ + return remap_page_range(vma->vm_start, kernel_pa, + vma->vm_end-vma->vm_start, + vma->vm_page_prot); +} diff -urN linux-2.4.18/arch/ia64/sn/io/pcibr.c lia64-2.4/arch/ia64/sn/io/pcibr.c --- linux-2.4.18/arch/ia64/sn/io/pcibr.c Thu Apr 12 12:16:35 2001 +++ lia64-2.4/arch/ia64/sn/io/pcibr.c Wed Dec 31 16:00:00 1969 @@ -1,9824 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ - -#ifdef BRINGUP -int NeedXbridgeSwap = 0; -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#include -#include -#endif - -#ifdef __ia64 -#define rmallocmap atemapalloc -#define rmfreemap atemapfree -#define rmfree atefree -#define rmalloc atealloc -#endif - -#undef PCIBR_ATE_DEBUG -#if defined(BRINGUP) -#if 0 -#define DEBUG 1 /* To avoid lots of bad printk() formats leave off */ -#endif -#define PCI_DEBUG 1 -#define ATTACH_DEBUG 1 -#define PCIBR_SOFT_LIST 1 -#endif - -#ifndef LOCAL -#define LOCAL static -#endif - -/* - * Macros related to the Lucent USS 302/312 usb timeout workaround. It - * appears that if the lucent part can get into a retry loop if it sees a - * DAC on the bus during a pio read retry. The loop is broken after about - * 1ms, so we need to set up bridges holding this part to allow at least - * 1ms for pio. - */ - -#define USS302_TIMEOUT_WAR - -#ifdef USS302_TIMEOUT_WAR -#include -#define LUCENT_USBHC_VENDOR_ID_NUM 0x11c1 -#define LUCENT_USBHC302_DEVICE_ID_NUM 0x5801 -#define LUCENT_USBHC312_DEVICE_ID_NUM 0x5802 -#define USS302_BRIDGE_TIMEOUT_HLD 4 -#endif - -#define PCIBR_LLP_CONTROL_WAR -#if defined (PCIBR_LLP_CONTROL_WAR) -int pcibr_llp_control_war_cnt; -#endif /* PCIBR_LLP_CONTROL_WAR */ - -#define NEWAf(ptr,n,f) (ptr = kmem_zalloc((n)*sizeof (*(ptr)), (f&PCIIO_NOSLEEP)?KM_NOSLEEP:KM_SLEEP)) -#define NEWA(ptr,n) (ptr = kmem_zalloc((n)*sizeof (*(ptr)), KM_SLEEP)) -#define DELA(ptr,n) (kfree(ptr)) - -#define NEWf(ptr,f) NEWAf(ptr,1,f) -#define NEW(ptr) NEWA(ptr,1) -#define DEL(ptr) DELA(ptr,1) - -int pcibr_devflag = D_MP; - -#ifdef LATER -#define F(s,n) { 1l<<(s),-(s), n } - -struct reg_desc bridge_int_status_desc[] = -{ - F(31, "MULTI_ERR"), - F(30, "PMU_ESIZE_EFAULT"), - F(29, "UNEXPECTED_RESP"), - F(28, "BAD_XRESP_PACKET"), - F(27, "BAD_XREQ_PACKET"), - F(26, "RESP_XTALK_ERROR"), - F(25, "REQ_XTALK_ERROR"), - F(24, "INVALID_ADDRESS"), - F(23, "UNSUPPORTED_XOP"), - F(22, "XREQ_FIFO_OFLOW"), - F(21, "LLP_REC_SNERROR"), - F(20, "LLP_REC_CBERROR"), - F(19, "LLP_RCTY"), - F(18, "LLP_TX_RETRY"), - F(17, "LLP_TCTY"), - F(16, "SSRAM_PERR"), - F(15, "PCI_ABORT"), - F(14, "PCI_PARITY"), - F(13, "PCI_SERR"), - F(12, "PCI_PERR"), - F(11, "PCI_MASTER_TOUT"), - F(10, "PCI_RETRY_CNT"), - F(9, "XREAD_REQ_TOUT"), - F(8, "GIO_BENABLE_ERR"), - F(7, "INT7"), - F(6, "INT6"), - F(5, "INT5"), - F(4, "INT4"), - F(3, "INT3"), - F(2, "INT2"), - F(1, "INT1"), - F(0, "INT0"), - {0} -}; - -struct reg_values space_v[] = -{ - {PCIIO_SPACE_NONE, "none"}, - {PCIIO_SPACE_ROM, "ROM"}, - {PCIIO_SPACE_IO, "I/O"}, - {PCIIO_SPACE_MEM, "MEM"}, - {PCIIO_SPACE_MEM32, "MEM(32)"}, - {PCIIO_SPACE_MEM64, "MEM(64)"}, - {PCIIO_SPACE_CFG, "CFG"}, - {PCIIO_SPACE_WIN(0), "WIN(0)"}, - {PCIIO_SPACE_WIN(1), "WIN(1)"}, - {PCIIO_SPACE_WIN(2), "WIN(2)"}, - {PCIIO_SPACE_WIN(3), "WIN(3)"}, - {PCIIO_SPACE_WIN(4), "WIN(4)"}, - {PCIIO_SPACE_WIN(5), "WIN(5)"}, - {PCIIO_SPACE_BAD, "BAD"}, - {0} -}; - -struct reg_desc space_desc[] = -{ - {0xFF, 0, "space", 0, space_v}, - {0} -}; - -#if DEBUG -#define device_desc device_bits -LOCAL struct reg_desc device_bits[] = -{ - {BRIDGE_DEV_ERR_LOCK_EN, 0, "ERR_LOCK_EN"}, - {BRIDGE_DEV_PAGE_CHK_DIS, 0, "PAGE_CHK_DIS"}, - {BRIDGE_DEV_FORCE_PCI_PAR, 0, "FORCE_PCI_PAR"}, - {BRIDGE_DEV_VIRTUAL_EN, 0, "VIRTUAL_EN"}, - {BRIDGE_DEV_PMU_WRGA_EN, 0, "PMU_WRGA_EN"}, - {BRIDGE_DEV_DIR_WRGA_EN, 0, "DIR_WRGA_EN"}, - {BRIDGE_DEV_DEV_SIZE, 0, "DEV_SIZE"}, - {BRIDGE_DEV_RT, 0, "RT"}, - {BRIDGE_DEV_SWAP_PMU, 0, "SWAP_PMU"}, - {BRIDGE_DEV_SWAP_DIR, 0, "SWAP_DIR"}, - {BRIDGE_DEV_PREF, 0, "PREF"}, - {BRIDGE_DEV_PRECISE, 0, "PRECISE"}, - {BRIDGE_DEV_COH, 0, "COH"}, - {BRIDGE_DEV_BARRIER, 0, "BARRIER"}, - {BRIDGE_DEV_GBR, 0, "GBR"}, - {BRIDGE_DEV_DEV_SWAP, 0, "DEV_SWAP"}, - {BRIDGE_DEV_DEV_IO_MEM, 0, "DEV_IO_MEM"}, - {BRIDGE_DEV_OFF_MASK, BRIDGE_DEV_OFF_ADDR_SHFT, "DEV_OFF", "%x"}, - {0} -}; -#endif /* DEBUG */ - -#ifdef SUPPORT_PRINTING_R_FORMAT -LOCAL struct reg_values xio_cmd_pactyp[] = -{ - {0x0, "RdReq"}, - {0x1, "RdResp"}, - {0x2, "WrReqWithResp"}, - {0x3, "WrResp"}, - {0x4, "WrReqNoResp"}, - {0x5, "Reserved(5)"}, - {0x6, "FetchAndOp"}, - {0x7, "Reserved(7)"}, - {0x8, "StoreAndOp"}, - {0x9, "Reserved(9)"}, - {0xa, "Reserved(a)"}, - {0xb, "Reserved(b)"}, - {0xc, "Reserved(c)"}, - {0xd, "Reserved(d)"}, - {0xe, "SpecialReq"}, - {0xf, "SpecialResp"}, - {0} -}; - -LOCAL struct reg_desc xio_cmd_bits[] = -{ - {WIDGET_DIDN, -28, "DIDN", "%x"}, - {WIDGET_SIDN, -24, "SIDN", "%x"}, - {WIDGET_PACTYP, -20, "PACTYP", 0, xio_cmd_pactyp}, - {WIDGET_TNUM, -15, "TNUM", "%x"}, - {WIDGET_COHERENT, 0, "COHERENT"}, - {WIDGET_DS, 0, "DS"}, - {WIDGET_GBR, 0, "GBR"}, - {WIDGET_VBPM, 0, "VBPM"}, - {WIDGET_ERROR, 0, "ERROR"}, - {WIDGET_BARRIER, 0, "BARRIER"}, - {0} -}; -#endif /* SUPPORT_PRINTING_R_FORMAT */ - -#if PCIBR_FREEZE_TIME || PCIBR_ATE_DEBUG -LOCAL struct reg_desc ate_bits[] = -{ - {0xFFFF000000000000ull, -48, "RMF", "%x"}, - {~(IOPGSIZE - 1) & /* may trim off some low bits */ - 0x0000FFFFFFFFF000ull, 0, "XIO", "%x"}, - {0x0000000000000F00ull, -8, "port", "%x"}, - {0x0000000000000010ull, 0, "Barrier"}, - {0x0000000000000008ull, 0, "Prefetch"}, - {0x0000000000000004ull, 0, "Precise"}, - {0x0000000000000002ull, 0, "Coherent"}, - {0x0000000000000001ull, 0, "Valid"}, - {0} -}; -#endif - -#if PCIBR_ATE_DEBUG -LOCAL struct reg_values ssram_sizes[] = -{ - {BRIDGE_CTRL_SSRAM_512K, "512k"}, - {BRIDGE_CTRL_SSRAM_128K, "128k"}, - {BRIDGE_CTRL_SSRAM_64K, "64k"}, - {BRIDGE_CTRL_SSRAM_1K, "1k"}, - {0} -}; - -LOCAL struct reg_desc control_bits[] = -{ - {BRIDGE_CTRL_FLASH_WR_EN, 0, "FLASH_WR_EN"}, - {BRIDGE_CTRL_EN_CLK50, 0, "EN_CLK50"}, - {BRIDGE_CTRL_EN_CLK40, 0, "EN_CLK40"}, - {BRIDGE_CTRL_EN_CLK33, 0, "EN_CLK33"}, - {BRIDGE_CTRL_RST_MASK, -24, "RST", "%x"}, - {BRIDGE_CTRL_IO_SWAP, 0, "IO_SWAP"}, - {BRIDGE_CTRL_MEM_SWAP, 0, "MEM_SWAP"}, - {BRIDGE_CTRL_PAGE_SIZE, 0, "PAGE_SIZE"}, - {BRIDGE_CTRL_SS_PAR_BAD, 0, "SS_PAR_BAD"}, - {BRIDGE_CTRL_SS_PAR_EN, 0, "SS_PAR_EN"}, - {BRIDGE_CTRL_SSRAM_SIZE_MASK, 0, "SSRAM_SIZE", 0, ssram_sizes}, - {BRIDGE_CTRL_F_BAD_PKT, 0, "F_BAD_PKT"}, - {BRIDGE_CTRL_LLP_XBAR_CRD_MASK, -12, "LLP_XBAR_CRD", "%d"}, - {BRIDGE_CTRL_CLR_RLLP_CNT, 0, "CLR_RLLP_CNT"}, - {BRIDGE_CTRL_CLR_TLLP_CNT, 0, "CLR_TLLP_CNT"}, - {BRIDGE_CTRL_SYS_END, 0, "SYS_END"}, - {BRIDGE_CTRL_MAX_TRANS_MASK, -4, "MAX_TRANS", "%d"}, - {BRIDGE_CTRL_WIDGET_ID_MASK, 0, "WIDGET_ID", "%x"}, - {0} -}; -#endif -#endif /* LATER */ - -/* kbrick widgetnum-to-bus layout */ -int p_busnum[MAX_PORT_NUM] = { /* widget# */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x0 - 0x7 */ - 2, /* 0x8 */ - 1, /* 0x9 */ - 0, 0, /* 0xa - 0xb */ - 5, /* 0xc */ - 6, /* 0xd */ - 4, /* 0xe */ - 3, /* 0xf */ -}; - -/* - * Additional PIO spaces per slot are - * recorded in this structure. - */ -struct pciio_piospace_s { - pciio_piospace_t next; /* another space for this device */ - char free; /* 1 if free, 0 if in use */ - pciio_space_t space; /* Which space is in use */ - iopaddr_t start; /* Starting address of the PIO space */ - size_t count; /* size of PIO space */ -}; - -/* Use io spin locks. This ensures that all the PIO writes from a particular - * CPU to a particular IO device are synched before the start of the next - * set of PIO operations to the same device. - */ -#define pcibr_lock(pcibr_soft) io_splock(&pcibr_soft->bs_lock) -#define pcibr_unlock(pcibr_soft,s) io_spunlock(&pcibr_soft->bs_lock,s) - -#if PCIBR_SOFT_LIST -typedef struct pcibr_list_s *pcibr_list_p; -struct pcibr_list_s { - pcibr_list_p bl_next; - pcibr_soft_t bl_soft; - devfs_handle_t bl_vhdl; -}; -pcibr_list_p pcibr_list = 0; -#endif - -typedef volatile unsigned *cfg_p; -typedef volatile bridgereg_t *reg_p; - -#define INFO_LBL_PCIBR_ASIC_REV "_pcibr_asic_rev" - -#define PCIBR_D64_BASE_UNSET (0xFFFFFFFFFFFFFFFF) -#define PCIBR_D32_BASE_UNSET (0xFFFFFFFF) - -#define PCIBR_VALID_SLOT(s) (s < 8) - -#ifdef SN_XXX -extern int hub_device_flags_set(devfs_handle_t widget_dev, - hub_widget_flags_t flags); -#endif -extern pciio_dmamap_t get_free_pciio_dmamap(devfs_handle_t); - -/* - * This is the file operation table for the pcibr driver. - * As each of the functions are implemented, put the - * appropriate function name below. - */ -struct file_operations pcibr_fops = { - owner: THIS_MODULE, - llseek: NULL, - read: NULL, - write: NULL, - readdir: NULL, - poll: NULL, - ioctl: NULL, - mmap: NULL, - open: NULL, - flush: NULL, - release: NULL, - fsync: NULL, - fasync: NULL, - lock: NULL, - readv: NULL, - writev: NULL -}; - -extern devfs_handle_t hwgraph_root; -extern graph_error_t hwgraph_vertex_unref(devfs_handle_t vhdl); -extern int cap_able(uint64_t x); -extern uint64_t rmalloc(struct map *mp, size_t size); -extern void rmfree(struct map *mp, size_t size, uint64_t a); -extern int hwgraph_vertex_name_get(devfs_handle_t vhdl, char *buf, uint buflen); -extern long atoi(register char *p); -extern void *swap_ptr(void **loc, void *new); -extern char *dev_to_name(devfs_handle_t dev, char *buf, uint buflen); -extern cnodeid_t nodevertex_to_cnodeid(devfs_handle_t vhdl); -extern graph_error_t hwgraph_edge_remove(devfs_handle_t from, char *name, devfs_handle_t *toptr); -extern struct map *rmallocmap(uint64_t mapsiz); -extern void rmfreemap(struct map *mp); -extern int compare_and_swap_ptr(void **location, void *old_ptr, void *new_ptr); -extern int io_path_map_widget(devfs_handle_t vertex); - - - -/* ===================================================================== - * Function Table of Contents - * - * The order of functions in this file has stopped - * making much sense. We might want to take a look - * at it some time and bring back some sanity, or - * perhaps bust this file into smaller chunks. - */ - -LOCAL void do_pcibr_rrb_clear(bridge_t *, int); -LOCAL void do_pcibr_rrb_flush(bridge_t *, int); -LOCAL int do_pcibr_rrb_count_valid(bridge_t *, pciio_slot_t); -LOCAL int do_pcibr_rrb_count_avail(bridge_t *, pciio_slot_t); -LOCAL int do_pcibr_rrb_alloc(bridge_t *, pciio_slot_t, int); -LOCAL int do_pcibr_rrb_free(bridge_t *, pciio_slot_t, int); - -LOCAL void do_pcibr_rrb_autoalloc(pcibr_soft_t, int, int); - -int pcibr_wrb_flush(devfs_handle_t); -int pcibr_rrb_alloc(devfs_handle_t, int *, int *); -int pcibr_rrb_check(devfs_handle_t, int *, int *, int *, int *); -int pcibr_alloc_all_rrbs(devfs_handle_t, int, int, int, int, int, int, int, int, int); -void pcibr_rrb_flush(devfs_handle_t); - -LOCAL int pcibr_try_set_device(pcibr_soft_t, pciio_slot_t, unsigned, bridgereg_t); -void pcibr_release_device(pcibr_soft_t, pciio_slot_t, bridgereg_t); - -LOCAL void pcibr_clearwidint(bridge_t *); -LOCAL void pcibr_setwidint(xtalk_intr_t); -LOCAL int pcibr_probe_slot(bridge_t *, cfg_p, unsigned *); - -void pcibr_init(void); -int pcibr_attach(devfs_handle_t); -int pcibr_detach(devfs_handle_t); -int pcibr_open(devfs_handle_t *, int, int, cred_t *); -int pcibr_close(devfs_handle_t, int, int, cred_t *); -int pcibr_map(devfs_handle_t, vhandl_t *, off_t, size_t, uint); -int pcibr_unmap(devfs_handle_t, vhandl_t *); -int pcibr_ioctl(devfs_handle_t, int, void *, int, struct cred *, int *); - -void pcibr_freeblock_sub(iopaddr_t *, iopaddr_t *, iopaddr_t, size_t); - -LOCAL int pcibr_init_ext_ate_ram(bridge_t *); -LOCAL int pcibr_ate_alloc(pcibr_soft_t, int); -LOCAL void pcibr_ate_free(pcibr_soft_t, int, int); - -LOCAL pcibr_info_t pcibr_info_get(devfs_handle_t); -LOCAL pcibr_info_t pcibr_device_info_new(pcibr_soft_t, pciio_slot_t, pciio_function_t, pciio_vendor_id_t, pciio_device_id_t); -LOCAL void pcibr_device_info_free(devfs_handle_t, pciio_slot_t); -LOCAL iopaddr_t pcibr_addr_pci_to_xio(devfs_handle_t, pciio_slot_t, pciio_space_t, iopaddr_t, size_t, unsigned); - -pcibr_piomap_t pcibr_piomap_alloc(devfs_handle_t, device_desc_t, pciio_space_t, iopaddr_t, size_t, size_t, unsigned); -void pcibr_piomap_free(pcibr_piomap_t); -caddr_t pcibr_piomap_addr(pcibr_piomap_t, iopaddr_t, size_t); -void pcibr_piomap_done(pcibr_piomap_t); -caddr_t pcibr_piotrans_addr(devfs_handle_t, device_desc_t, pciio_space_t, iopaddr_t, size_t, unsigned); -iopaddr_t pcibr_piospace_alloc(devfs_handle_t, device_desc_t, pciio_space_t, size_t, size_t); -void pcibr_piospace_free(devfs_handle_t, pciio_space_t, iopaddr_t, size_t); - -LOCAL iopaddr_t pcibr_flags_to_d64(unsigned, pcibr_soft_t); -LOCAL bridge_ate_t pcibr_flags_to_ate(unsigned); - -pcibr_dmamap_t pcibr_dmamap_alloc(devfs_handle_t, device_desc_t, size_t, unsigned); -void pcibr_dmamap_free(pcibr_dmamap_t); -LOCAL bridge_ate_p pcibr_ate_addr(pcibr_soft_t, int); -LOCAL iopaddr_t pcibr_addr_xio_to_pci(pcibr_soft_t, iopaddr_t, size_t); -iopaddr_t pcibr_dmamap_addr(pcibr_dmamap_t, paddr_t, size_t); -alenlist_t pcibr_dmamap_list(pcibr_dmamap_t, alenlist_t, unsigned); -void pcibr_dmamap_done(pcibr_dmamap_t); -cnodeid_t pcibr_get_dmatrans_node(devfs_handle_t); -iopaddr_t pcibr_dmatrans_addr(devfs_handle_t, device_desc_t, paddr_t, size_t, unsigned); -alenlist_t pcibr_dmatrans_list(devfs_handle_t, device_desc_t, alenlist_t, unsigned); -void pcibr_dmamap_drain(pcibr_dmamap_t); -void pcibr_dmaaddr_drain(devfs_handle_t, paddr_t, size_t); -void pcibr_dmalist_drain(devfs_handle_t, alenlist_t); -iopaddr_t pcibr_dmamap_pciaddr_get(pcibr_dmamap_t); - -static unsigned pcibr_intr_bits(pciio_info_t info, pciio_intr_line_t lines); -pcibr_intr_t pcibr_intr_alloc(devfs_handle_t, device_desc_t, pciio_intr_line_t, devfs_handle_t); -void pcibr_intr_free(pcibr_intr_t); -LOCAL void pcibr_setpciint(xtalk_intr_t); -int pcibr_intr_connect(pcibr_intr_t, intr_func_t, intr_arg_t, void *); -void pcibr_intr_disconnect(pcibr_intr_t); - -devfs_handle_t pcibr_intr_cpu_get(pcibr_intr_t); -void pcibr_xintr_preset(void *, int, xwidgetnum_t, iopaddr_t, xtalk_intr_vector_t); -void pcibr_intr_func(intr_arg_t); - -LOCAL void print_bridge_errcmd(uint32_t, char *); - -void pcibr_error_dump(pcibr_soft_t); -uint32_t pcibr_errintr_group(uint32_t); -LOCAL void pcibr_pioerr_check(pcibr_soft_t); -LOCAL void pcibr_error_intr_handler(intr_arg_t); - -LOCAL int pcibr_addr_toslot(pcibr_soft_t, iopaddr_t, pciio_space_t *, iopaddr_t *, pciio_function_t *); -LOCAL void pcibr_error_cleanup(pcibr_soft_t, int); -void pcibr_device_disable(pcibr_soft_t, int); -LOCAL int pcibr_pioerror(pcibr_soft_t, int, ioerror_mode_t, ioerror_t *); -int pcibr_dmard_error(pcibr_soft_t, int, ioerror_mode_t, ioerror_t *); -int pcibr_dmawr_error(pcibr_soft_t, int, ioerror_mode_t, ioerror_t *); -LOCAL int pcibr_error_handler(error_handler_arg_t, int, ioerror_mode_t, ioerror_t *); -int pcibr_error_devenable(devfs_handle_t, int); - -void pcibr_provider_startup(devfs_handle_t); -void pcibr_provider_shutdown(devfs_handle_t); - -int pcibr_reset(devfs_handle_t); -pciio_endian_t pcibr_endian_set(devfs_handle_t, pciio_endian_t, pciio_endian_t); -int pcibr_priority_bits_set(pcibr_soft_t, pciio_slot_t, pciio_priority_t); -pciio_priority_t pcibr_priority_set(devfs_handle_t, pciio_priority_t); -int pcibr_device_flags_set(devfs_handle_t, pcibr_device_flags_t); - -LOCAL cfg_p pcibr_config_addr(devfs_handle_t, unsigned); -uint64_t pcibr_config_get(devfs_handle_t, unsigned, unsigned); -LOCAL uint64_t do_pcibr_config_get(cfg_p, unsigned, unsigned); -void pcibr_config_set(devfs_handle_t, unsigned, unsigned, uint64_t); -LOCAL void do_pcibr_config_set(cfg_p, unsigned, unsigned, uint64_t); - -LOCAL pcibr_hints_t pcibr_hints_get(devfs_handle_t, int); -void pcibr_hints_fix_rrbs(devfs_handle_t); -void pcibr_hints_dualslot(devfs_handle_t, pciio_slot_t, pciio_slot_t); -void pcibr_hints_intr_bits(devfs_handle_t, pcibr_intr_bits_f *); -void pcibr_set_rrb_callback(devfs_handle_t, rrb_alloc_funct_t); -void pcibr_hints_handsoff(devfs_handle_t); -void pcibr_hints_subdevs(devfs_handle_t, pciio_slot_t, ulong); - -LOCAL int pcibr_slot_info_init(devfs_handle_t,pciio_slot_t); -LOCAL int pcibr_slot_info_free(devfs_handle_t,pciio_slot_t); - -#ifdef LATER -LOCAL int pcibr_slot_info_return(pcibr_soft_t, pciio_slot_t, - pcibr_slot_info_resp_t); -LOCAL void pcibr_slot_func_info_return(pcibr_info_h, int, - pcibr_slot_func_info_resp_t); -#endif /* LATER */ - -LOCAL int pcibr_slot_addr_space_init(devfs_handle_t,pciio_slot_t); -LOCAL int pcibr_slot_device_init(devfs_handle_t, pciio_slot_t); -LOCAL int pcibr_slot_guest_info_init(devfs_handle_t,pciio_slot_t); -LOCAL int pcibr_slot_initial_rrb_alloc(devfs_handle_t,pciio_slot_t); -LOCAL int pcibr_slot_call_device_attach(devfs_handle_t, - pciio_slot_t, int); -LOCAL int pcibr_slot_call_device_detach(devfs_handle_t, - pciio_slot_t, int); - -LOCAL int pcibr_slot_detach(devfs_handle_t, pciio_slot_t, int); -LOCAL int pcibr_is_slot_sys_critical(devfs_handle_t, pciio_slot_t); -#ifdef LATER -LOCAL int pcibr_slot_query(devfs_handle_t, pcibr_slot_info_req_t); -#endif - -/* ===================================================================== - * RRB management - */ - -#define LSBIT(word) ((word) &~ ((word)-1)) - -#define PCIBR_RRB_SLOT_VIRTUAL 8 - -LOCAL void -do_pcibr_rrb_clear(bridge_t *bridge, int rrb) -{ - bridgereg_t status; - - /* bridge_lock must be held; - * this RRB must be disabled. - */ - - /* wait until RRB has no outstanduing XIO packets. */ - while ((status = bridge->b_resp_status) & BRIDGE_RRB_INUSE(rrb)) { - ; /* XXX- beats on bridge. bad idea? */ - } - - /* if the RRB has data, drain it. */ - if (status & BRIDGE_RRB_VALID(rrb)) { - bridge->b_resp_clear = BRIDGE_RRB_CLEAR(rrb); - - /* wait until RRB is no longer valid. */ - while ((status = bridge->b_resp_status) & BRIDGE_RRB_VALID(rrb)) { - ; /* XXX- beats on bridge. bad idea? */ - } - } -} - -LOCAL void -do_pcibr_rrb_flush(bridge_t *bridge, int rrbn) -{ - reg_p rrbp = &bridge->b_rrb_map[rrbn & 1].reg; - bridgereg_t rrbv; - int shft = 4 * (rrbn >> 1); - unsigned ebit = BRIDGE_RRB_EN << shft; - - rrbv = *rrbp; - if (rrbv & ebit) - *rrbp = rrbv & ~ebit; - - do_pcibr_rrb_clear(bridge, rrbn); - - if (rrbv & ebit) - *rrbp = rrbv; -} - -/* - * pcibr_rrb_count_valid: count how many RRBs are - * marked valid for the specified PCI slot on this - * bridge. - * - * NOTE: The "slot" parameter for all pcibr_rrb - * management routines must include the "virtual" - * bit; when manageing both the normal and the - * virtual channel, separate calls to these - * routines must be made. To denote the virtual - * channel, add PCIBR_RRB_SLOT_VIRTUAL to the slot - * number. - * - * IMPL NOTE: The obvious algorithm is to iterate - * through the RRB fields, incrementing a count if - * the RRB is valid and matches the slot. However, - * it is much simpler to use an algorithm derived - * from the "partitioned add" idea. First, XOR in a - * pattern such that the fields that match this - * slot come up "all ones" and all other fields - * have zeros in the mismatching bits. Then AND - * together the bits in the field, so we end up - * with one bit turned on for each field that - * matched. Now we need to count these bits. This - * can be done either with a series of shift/add - * instructions or by using "tmp % 15"; I expect - * that the cascaded shift/add will be faster. - */ - -LOCAL int -do_pcibr_rrb_count_valid(bridge_t *bridge, - pciio_slot_t slot) -{ - bridgereg_t tmp; - - tmp = bridge->b_rrb_map[slot & 1].reg; - tmp ^= 0x11111111 * (7 - slot / 2); - tmp &= (0xCCCCCCCC & tmp) >> 2; - tmp &= (0x22222222 & tmp) >> 1; - tmp += tmp >> 4; - tmp += tmp >> 8; - tmp += tmp >> 16; - return tmp & 15; -} - -/* - * do_pcibr_rrb_count_avail: count how many RRBs are - * available to be allocated for the specified slot. - * - * IMPL NOTE: similar to the above, except we are - * just counting how many fields have the valid bit - * turned off. - */ -LOCAL int -do_pcibr_rrb_count_avail(bridge_t *bridge, - pciio_slot_t slot) -{ - bridgereg_t tmp; - - tmp = bridge->b_rrb_map[slot & 1].reg; - tmp = (0x88888888 & ~tmp) >> 3; - tmp += tmp >> 4; - tmp += tmp >> 8; - tmp += tmp >> 16; - return tmp & 15; -} - -/* - * do_pcibr_rrb_alloc: allocate some additional RRBs - * for the specified slot. Returns -1 if there were - * insufficient free RRBs to satisfy the request, - * or 0 if the request was fulfilled. - * - * Note that if a request can be partially filled, - * it will be, even if we return failure. - * - * IMPL NOTE: again we avoid iterating across all - * the RRBs; instead, we form up a word containing - * one bit for each free RRB, then peel the bits - * off from the low end. - */ -LOCAL int -do_pcibr_rrb_alloc(bridge_t *bridge, - pciio_slot_t slot, - int more) -{ - int rv = 0; - bridgereg_t reg, tmp, bit; - - reg = bridge->b_rrb_map[slot & 1].reg; - tmp = (0x88888888 & ~reg) >> 3; - while (more-- > 0) { - bit = LSBIT(tmp); - if (!bit) { - rv = -1; - break; - } - tmp &= ~bit; - reg = ((reg & ~(bit * 15)) | (bit * (8 + slot / 2))); - } - bridge->b_rrb_map[slot & 1].reg = reg; - return rv; -} - -/* - * do_pcibr_rrb_free: release some of the RRBs that - * have been allocated for the specified - * slot. Returns zero for success, or negative if - * it was unable to free that many RRBs. - * - * IMPL NOTE: We form up a bit for each RRB - * allocated to the slot, aligned with the VALID - * bitfield this time; then we peel bits off one at - * a time, releasing the corresponding RRB. - */ -LOCAL int -do_pcibr_rrb_free(bridge_t *bridge, - pciio_slot_t slot, - int less) -{ - int rv = 0; - bridgereg_t reg, tmp, clr, bit; - int i; - - clr = 0; - reg = bridge->b_rrb_map[slot & 1].reg; - - /* This needs to be done otherwise the rrb's on the virtual channel - * for this slot won't be freed !! - */ - tmp = reg & 0xbbbbbbbb; - - tmp ^= (0x11111111 * (7 - slot / 2)); - tmp &= (0x33333333 & tmp) << 2; - tmp &= (0x44444444 & tmp) << 1; - while (less-- > 0) { - bit = LSBIT(tmp); - if (!bit) { - rv = -1; - break; - } - tmp &= ~bit; - reg &= ~bit; - clr |= bit; - } - bridge->b_rrb_map[slot & 1].reg = reg; - - for (i = 0; i < 8; i++) - if (clr & (8 << (4 * i))) - do_pcibr_rrb_clear(bridge, (2 * i) + (slot & 1)); - - return rv; -} - -LOCAL void -do_pcibr_rrb_autoalloc(pcibr_soft_t pcibr_soft, - int slot, - int more_rrbs) -{ - bridge_t *bridge = pcibr_soft->bs_base; - int got; - - for (got = 0; got < more_rrbs; ++got) { - if (pcibr_soft->bs_rrb_res[slot & 7] > 0) - pcibr_soft->bs_rrb_res[slot & 7]--; - else if (pcibr_soft->bs_rrb_avail[slot & 1] > 0) - pcibr_soft->bs_rrb_avail[slot & 1]--; - else - break; - if (do_pcibr_rrb_alloc(bridge, slot, 1) < 0) - break; -#if PCIBR_RRB_DEBUG - printk( "do_pcibr_rrb_autoalloc: add one to slot %d%s\n", - slot & 7, slot & 8 ? "v" : ""); -#endif - pcibr_soft->bs_rrb_valid[slot]++; - } -#if PCIBR_RRB_DEBUG - printk("%s: %d+%d free RRBs. Allocation list:\n", pcibr_soft->bs_name, - pcibr_soft->bs_rrb_avail[0], - pcibr_soft->bs_rrb_avail[1]); - for (slot = 0; slot < 8; ++slot) - printk("\t%d+%d+%d", - 0xFFF & pcibr_soft->bs_rrb_valid[slot], - 0xFFF & pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL], - pcibr_soft->bs_rrb_res[slot]); - printk("\n"); -#endif -} - -/* - * Device driver interface to flush the write buffers for a specified - * device hanging off the bridge. - */ -int -pcibr_wrb_flush(devfs_handle_t pconn_vhdl) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - bridge_t *bridge = pcibr_soft->bs_base; - volatile bridgereg_t *wrb_flush; - - wrb_flush = &(bridge->b_wr_req_buf[pciio_slot].reg); - while (*wrb_flush); - - return(0); -} -/* - * Device driver interface to request RRBs for a specified device - * hanging off a Bridge. The driver requests the total number of - * RRBs it would like for the normal channel (vchan0) and for the - * "virtual channel" (vchan1). The actual number allocated to each - * channel is returned. - * - * If we cannot allocate at least one RRB to a channel that needs - * at least one, return -1 (failure). Otherwise, satisfy the request - * as best we can and return 0. - */ -int -pcibr_rrb_alloc(devfs_handle_t pconn_vhdl, - int *count_vchan0, - int *count_vchan1) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - bridge_t *bridge = pcibr_soft->bs_base; - int desired_vchan0; - int desired_vchan1; - int orig_vchan0; - int orig_vchan1; - int delta_vchan0; - int delta_vchan1; - int final_vchan0; - int final_vchan1; - int avail_rrbs; - unsigned long s; - int error; - - /* - * TBD: temper request with admin info about RRB allocation, - * and according to demand from other devices on this Bridge. - * - * One way of doing this would be to allocate two RRBs - * for each device on the bus, before any drivers start - * asking for extras. This has the weakness that one - * driver might not give back an "extra" RRB until after - * another driver has already failed to get one that - * it wanted. - */ - - s = pcibr_lock(pcibr_soft); - - /* How many RRBs do we own? */ - orig_vchan0 = pcibr_soft->bs_rrb_valid[pciio_slot]; - orig_vchan1 = pcibr_soft->bs_rrb_valid[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL]; - - /* How many RRBs do we want? */ - desired_vchan0 = count_vchan0 ? *count_vchan0 : orig_vchan0; - desired_vchan1 = count_vchan1 ? *count_vchan1 : orig_vchan1; - - /* How many RRBs are free? */ - avail_rrbs = pcibr_soft->bs_rrb_avail[pciio_slot & 1] - + pcibr_soft->bs_rrb_res[pciio_slot]; - - /* Figure desired deltas */ - delta_vchan0 = desired_vchan0 - orig_vchan0; - delta_vchan1 = desired_vchan1 - orig_vchan1; - - /* Trim back deltas to something - * that we can actually meet, by - * decreasing the ending allocation - * for whichever channel wants - * more RRBs. If both want the same - * number, cut the second channel. - * NOTE: do not change the allocation for - * a channel that was passed as NULL. - */ - while ((delta_vchan0 + delta_vchan1) > avail_rrbs) { - if (count_vchan0 && - (!count_vchan1 || - ((orig_vchan0 + delta_vchan0) > - (orig_vchan1 + delta_vchan1)))) - delta_vchan0--; - else - delta_vchan1--; - } - - /* Figure final RRB allocations - */ - final_vchan0 = orig_vchan0 + delta_vchan0; - final_vchan1 = orig_vchan1 + delta_vchan1; - - /* If either channel wants RRBs but our actions - * would leave it with none, declare an error, - * but DO NOT change any RRB allocations. - */ - if ((desired_vchan0 && !final_vchan0) || - (desired_vchan1 && !final_vchan1)) { - - error = -1; - - } else { - - /* Commit the allocations: free, then alloc. - */ - if (delta_vchan0 < 0) - (void) do_pcibr_rrb_free(bridge, pciio_slot, -delta_vchan0); - if (delta_vchan1 < 0) - (void) do_pcibr_rrb_free(bridge, PCIBR_RRB_SLOT_VIRTUAL + pciio_slot, -delta_vchan1); - - if (delta_vchan0 > 0) - (void) do_pcibr_rrb_alloc(bridge, pciio_slot, delta_vchan0); - if (delta_vchan1 > 0) - (void) do_pcibr_rrb_alloc(bridge, PCIBR_RRB_SLOT_VIRTUAL + pciio_slot, delta_vchan1); - - /* Return final values to caller. - */ - if (count_vchan0) - *count_vchan0 = final_vchan0; - if (count_vchan1) - *count_vchan1 = final_vchan1; - - /* prevent automatic changes to this slot's RRBs - */ - pcibr_soft->bs_rrb_fixed |= 1 << pciio_slot; - - /* Track the actual allocations, release - * any further reservations, and update the - * number of available RRBs. - */ - - pcibr_soft->bs_rrb_valid[pciio_slot] = final_vchan0; - pcibr_soft->bs_rrb_valid[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL] = final_vchan1; - pcibr_soft->bs_rrb_avail[pciio_slot & 1] = - pcibr_soft->bs_rrb_avail[pciio_slot & 1] - + pcibr_soft->bs_rrb_res[pciio_slot] - - delta_vchan0 - - delta_vchan1; - pcibr_soft->bs_rrb_res[pciio_slot] = 0; - -#if PCIBR_RRB_DEBUG - printk("pcibr_rrb_alloc: slot %d set to %d+%d; %d+%d free\n", - pciio_slot, final_vchan0, final_vchan1, - pcibr_soft->bs_rrb_avail[0], - pcibr_soft->bs_rrb_avail[1]); - for (pciio_slot = 0; pciio_slot < 8; ++pciio_slot) - printk("\t%d+%d+%d", - 0xFFF & pcibr_soft->bs_rrb_valid[pciio_slot], - 0xFFF & pcibr_soft->bs_rrb_valid[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL], - pcibr_soft->bs_rrb_res[pciio_slot]); - printk("\n"); -#endif - - error = 0; - } - - pcibr_unlock(pcibr_soft, s); - return error; -} - -/* - * Device driver interface to check the current state - * of the RRB allocations. - * - * pconn_vhdl is your PCI connection point (specifies which - * PCI bus and which slot). - * - * count_vchan0 points to where to return the number of RRBs - * assigned to the primary DMA channel, used by all DMA - * that does not explicitly ask for the alternate virtual - * channel. - * - * count_vchan1 points to where to return the number of RRBs - * assigned to the secondary DMA channel, used when - * PCIBR_VCHAN1 and PCIIO_DMA_A64 are specified. - * - * count_reserved points to where to return the number of RRBs - * that have been automatically reserved for your device at - * startup, but which have not been assigned to a - * channel. RRBs must be assigned to a channel to be used; - * this can be done either with an explicit pcibr_rrb_alloc - * call, or automatically by the infrastructure when a DMA - * translation is constructed. Any call to pcibr_rrb_alloc - * will release any unassigned reserved RRBs back to the - * free pool. - * - * count_pool points to where to return the number of RRBs - * that are currently unassigned and unreserved. This - * number can (and will) change as other drivers make calls - * to pcibr_rrb_alloc, or automatically allocate RRBs for - * DMA beyond their initial reservation. - * - * NULL may be passed for any of the return value pointers - * the caller is not interested in. - * - * The return value is "0" if all went well, or "-1" if - * there is a problem. Additionally, if the wrong vertex - * is passed in, one of the subsidiary support functions - * could panic with a "bad pciio fingerprint." - */ - -int -pcibr_rrb_check(devfs_handle_t pconn_vhdl, - int *count_vchan0, - int *count_vchan1, - int *count_reserved, - int *count_pool) -{ - pciio_info_t pciio_info; - pciio_slot_t pciio_slot; - pcibr_soft_t pcibr_soft; - unsigned long s; - int error = -1; - - if ((pciio_info = pciio_info_get(pconn_vhdl)) && - (pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info)) && - ((pciio_slot = pciio_info_slot_get(pciio_info)) < 8)) { - - s = pcibr_lock(pcibr_soft); - - if (count_vchan0) - *count_vchan0 = - pcibr_soft->bs_rrb_valid[pciio_slot]; - - if (count_vchan1) - *count_vchan1 = - pcibr_soft->bs_rrb_valid[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL]; - - if (count_reserved) - *count_reserved = - pcibr_soft->bs_rrb_res[pciio_slot]; - - if (count_pool) - *count_pool = - pcibr_soft->bs_rrb_avail[pciio_slot & 1]; - - error = 0; - - pcibr_unlock(pcibr_soft, s); - } - return error; -} - -/* pcibr_alloc_all_rrbs allocates all the rrbs available in the quantities - * requested for each of the devies. The evn_odd argument indicates whether - * allcoation for the odd or even rrbs is requested and next group of four pairse - * are the amount to assign to each device (they should sum to <= 8) and - * whether to set the viritual bit for that device (1 indictaes yes, 0 indicates no) - * the devices in order are either 0, 2, 4, 6 or 1, 3, 5, 7 - * if even_odd is even we alloc even rrbs else we allocate odd rrbs - * returns 0 if no errors else returns -1 - */ - -int -pcibr_alloc_all_rrbs(devfs_handle_t vhdl, int even_odd, - int dev_1_rrbs, int virt1, int dev_2_rrbs, int virt2, - int dev_3_rrbs, int virt3, int dev_4_rrbs, int virt4) -{ - devfs_handle_t pcibr_vhdl; - pcibr_soft_t pcibr_soft = NULL; - bridge_t *bridge = NULL; - - uint32_t rrb_setting = 0; - int rrb_shift = 7; - uint32_t cur_rrb; - int dev_rrbs[4]; - int virt[4]; - int i, j; - unsigned long s; - - if (GRAPH_SUCCESS == - hwgraph_traverse(vhdl, EDGE_LBL_PCI, &pcibr_vhdl)) { - pcibr_soft = pcibr_soft_get(pcibr_vhdl); - if (pcibr_soft) - bridge = pcibr_soft->bs_base; - hwgraph_vertex_unref(pcibr_vhdl); - } - if (bridge == NULL) - bridge = (bridge_t *) xtalk_piotrans_addr - (vhdl, NULL, 0, sizeof(bridge_t), 0); - - even_odd &= 1; - - dev_rrbs[0] = dev_1_rrbs; - dev_rrbs[1] = dev_2_rrbs; - dev_rrbs[2] = dev_3_rrbs; - dev_rrbs[3] = dev_4_rrbs; - - virt[0] = virt1; - virt[1] = virt2; - virt[2] = virt3; - virt[3] = virt4; - - if ((dev_1_rrbs + dev_2_rrbs + dev_3_rrbs + dev_4_rrbs) > 8) { - return -1; - } - if ((dev_1_rrbs < 0) || (dev_2_rrbs < 0) || (dev_3_rrbs < 0) || (dev_4_rrbs < 0)) { - return -1; - } - /* walk through rrbs */ - for (i = 0; i < 4; i++) { - if (virt[i]) { - cur_rrb = i | 0xc; - cur_rrb = cur_rrb << (rrb_shift * 4); - rrb_shift--; - rrb_setting = rrb_setting | cur_rrb; - dev_rrbs[i] = dev_rrbs[i] - 1; - } - for (j = 0; j < dev_rrbs[i]; j++) { - cur_rrb = i | 0x8; - cur_rrb = cur_rrb << (rrb_shift * 4); - rrb_shift--; - rrb_setting = rrb_setting | cur_rrb; - } - } - - if (pcibr_soft) - s = pcibr_lock(pcibr_soft); - - bridge->b_rrb_map[even_odd].reg = rrb_setting; - - if (pcibr_soft) { - - pcibr_soft->bs_rrb_fixed |= 0x55 << even_odd; - - /* since we've "FIXED" the allocations - * for these slots, we probably can dispense - * with tracking avail/res/valid data, but - * keeping it up to date helps debugging. - */ - - pcibr_soft->bs_rrb_avail[even_odd] = - 8 - (dev_1_rrbs + dev_2_rrbs + dev_3_rrbs + dev_4_rrbs); - - pcibr_soft->bs_rrb_res[even_odd + 0] = 0; - pcibr_soft->bs_rrb_res[even_odd + 2] = 0; - pcibr_soft->bs_rrb_res[even_odd + 4] = 0; - pcibr_soft->bs_rrb_res[even_odd + 6] = 0; - - pcibr_soft->bs_rrb_valid[even_odd + 0] = dev_1_rrbs - virt1; - pcibr_soft->bs_rrb_valid[even_odd + 2] = dev_2_rrbs - virt2; - pcibr_soft->bs_rrb_valid[even_odd + 4] = dev_3_rrbs - virt3; - pcibr_soft->bs_rrb_valid[even_odd + 6] = dev_4_rrbs - virt4; - - pcibr_soft->bs_rrb_valid[even_odd + 0 + PCIBR_RRB_SLOT_VIRTUAL] = virt1; - pcibr_soft->bs_rrb_valid[even_odd + 2 + PCIBR_RRB_SLOT_VIRTUAL] = virt2; - pcibr_soft->bs_rrb_valid[even_odd + 4 + PCIBR_RRB_SLOT_VIRTUAL] = virt3; - pcibr_soft->bs_rrb_valid[even_odd + 6 + PCIBR_RRB_SLOT_VIRTUAL] = virt4; - - pcibr_unlock(pcibr_soft, s); - } - return 0; -} - -/* - * pcibr_rrb_flush: chase down all the RRBs assigned - * to the specified connection point, and flush - * them. - */ -void -pcibr_rrb_flush(devfs_handle_t pconn_vhdl) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); - bridge_t *bridge = pcibr_soft->bs_base; - unsigned long s; - reg_p rrbp; - unsigned rrbm; - int i; - int rrbn; - unsigned sval; - unsigned mask; - - sval = BRIDGE_RRB_EN | (pciio_slot >> 1); - mask = BRIDGE_RRB_EN | BRIDGE_RRB_PDEV; - rrbn = pciio_slot & 1; - rrbp = &bridge->b_rrb_map[rrbn].reg; - - s = pcibr_lock(pcibr_soft); - rrbm = *rrbp; - for (i = 0; i < 8; ++i) { - if ((rrbm & mask) == sval) - do_pcibr_rrb_flush(bridge, rrbn); - rrbm >>= 4; - rrbn += 2; - } - pcibr_unlock(pcibr_soft, s); -} - -/* ===================================================================== - * Device(x) register management - */ - -/* pcibr_try_set_device: attempt to modify Device(x) - * for the specified slot on the specified bridge - * as requested in flags, limited to the specified - * bits. Returns which BRIDGE bits were in conflict, - * or ZERO if everything went OK. - * - * Caller MUST hold pcibr_lock when calling this function. - */ -LOCAL int -pcibr_try_set_device(pcibr_soft_t pcibr_soft, - pciio_slot_t slot, - unsigned flags, - bridgereg_t mask) -{ - bridge_t *bridge; - pcibr_soft_slot_t slotp; - bridgereg_t old; - bridgereg_t new; - bridgereg_t chg; - bridgereg_t bad; - bridgereg_t badpmu; - bridgereg_t badd32; - bridgereg_t badd64; - bridgereg_t fix; - unsigned long s; - bridgereg_t xmask; - - xmask = mask; - if (pcibr_soft->bs_xbridge) { - if (mask == BRIDGE_DEV_PMU_BITS) - xmask = XBRIDGE_DEV_PMU_BITS; - if (mask == BRIDGE_DEV_D64_BITS) - xmask = XBRIDGE_DEV_D64_BITS; - } - - slotp = &pcibr_soft->bs_slot[slot]; - - s = pcibr_lock(pcibr_soft); - - bridge = pcibr_soft->bs_base; - - old = slotp->bss_device; - - /* figure out what the desired - * Device(x) bits are based on - * the flags specified. - */ - - new = old; - - /* Currently, we inherit anything that - * the new caller has not specified in - * one way or another, unless we take - * action here to not inherit. - * - * This is needed for the "swap" stuff, - * since it could have been set via - * pcibr_endian_set -- altho note that - * any explicit PCIBR_BYTE_STREAM or - * PCIBR_WORD_VALUES will freely override - * the effect of that call (and vice - * versa, no protection either way). - * - * I want to get rid of pcibr_endian_set - * in favor of tracking DMA endianness - * using the flags specified when DMA - * channels are created. - */ - -#define BRIDGE_DEV_WRGA_BITS (BRIDGE_DEV_PMU_WRGA_EN | BRIDGE_DEV_DIR_WRGA_EN) -#define BRIDGE_DEV_SWAP_BITS (BRIDGE_DEV_SWAP_PMU | BRIDGE_DEV_SWAP_DIR) - - /* Do not use Barrier, Write Gather, - * or Prefetch unless asked. - * Leave everything else as it - * was from the last time. - */ - new = new - & ~BRIDGE_DEV_BARRIER - & ~BRIDGE_DEV_WRGA_BITS - & ~BRIDGE_DEV_PREF - ; - - /* Generic macro flags - */ - if (flags & PCIIO_DMA_DATA) { - new = (new - & ~BRIDGE_DEV_BARRIER) /* barrier off */ - | BRIDGE_DEV_PREF; /* prefetch on */ - - } - if (flags & PCIIO_DMA_CMD) { - new = ((new - & ~BRIDGE_DEV_PREF) /* prefetch off */ - & ~BRIDGE_DEV_WRGA_BITS) /* write gather off */ - | BRIDGE_DEV_BARRIER; /* barrier on */ - } - /* Generic detail flags - */ - if (flags & PCIIO_WRITE_GATHER) - new |= BRIDGE_DEV_WRGA_BITS; - if (flags & PCIIO_NOWRITE_GATHER) - new &= ~BRIDGE_DEV_WRGA_BITS; - - if (flags & PCIIO_PREFETCH) - new |= BRIDGE_DEV_PREF; - if (flags & PCIIO_NOPREFETCH) - new &= ~BRIDGE_DEV_PREF; - - if (flags & PCIBR_WRITE_GATHER) - new |= BRIDGE_DEV_WRGA_BITS; - if (flags & PCIBR_NOWRITE_GATHER) - new &= ~BRIDGE_DEV_WRGA_BITS; - - if (flags & PCIIO_BYTE_STREAM) - new |= (pcibr_soft->bs_xbridge) ? - BRIDGE_DEV_SWAP_DIR : BRIDGE_DEV_SWAP_BITS; - if (flags & PCIIO_WORD_VALUES) - new &= (pcibr_soft->bs_xbridge) ? - ~BRIDGE_DEV_SWAP_DIR : ~BRIDGE_DEV_SWAP_BITS; - - /* Provider-specific flags - */ - if (flags & PCIBR_PREFETCH) - new |= BRIDGE_DEV_PREF; - if (flags & PCIBR_NOPREFETCH) - new &= ~BRIDGE_DEV_PREF; - - if (flags & PCIBR_PRECISE) - new |= BRIDGE_DEV_PRECISE; - if (flags & PCIBR_NOPRECISE) - new &= ~BRIDGE_DEV_PRECISE; - - if (flags & PCIBR_BARRIER) - new |= BRIDGE_DEV_BARRIER; - if (flags & PCIBR_NOBARRIER) - new &= ~BRIDGE_DEV_BARRIER; - - if (flags & PCIBR_64BIT) - new |= BRIDGE_DEV_DEV_SIZE; - if (flags & PCIBR_NO64BIT) - new &= ~BRIDGE_DEV_DEV_SIZE; - - chg = old ^ new; /* what are we changing, */ - chg &= xmask; /* of the interesting bits */ - - if (chg) { - - badd32 = slotp->bss_d32_uctr ? (BRIDGE_DEV_D32_BITS & chg) : 0; - if (pcibr_soft->bs_xbridge) { - badpmu = slotp->bss_pmu_uctr ? (XBRIDGE_DEV_PMU_BITS & chg) : 0; - badd64 = slotp->bss_d64_uctr ? (XBRIDGE_DEV_D64_BITS & chg) : 0; - } else { - badpmu = slotp->bss_pmu_uctr ? (BRIDGE_DEV_PMU_BITS & chg) : 0; - badd64 = slotp->bss_d64_uctr ? (BRIDGE_DEV_D64_BITS & chg) : 0; - } - bad = badpmu | badd32 | badd64; - - if (bad) { - - /* some conflicts can be resolved by - * forcing the bit on. this may cause - * some performance degredation in - * the stream(s) that want the bit off, - * but the alternative is not allowing - * the new stream at all. - */ - if ( (fix = bad & (BRIDGE_DEV_PRECISE | - BRIDGE_DEV_BARRIER)) ){ - bad &= ~fix; - /* don't change these bits if - * they are already set in "old" - */ - chg &= ~(fix & old); - } - /* some conflicts can be resolved by - * forcing the bit off. this may cause - * some performance degredation in - * the stream(s) that want the bit on, - * but the alternative is not allowing - * the new stream at all. - */ - if ( (fix = bad & (BRIDGE_DEV_WRGA_BITS | - BRIDGE_DEV_PREF)) ) { - bad &= ~fix; - /* don't change these bits if - * we wanted to turn them on. - */ - chg &= ~(fix & new); - } - /* conflicts in other bits mean - * we can not establish this DMA - * channel while the other(s) are - * still present. - */ - if (bad) { - pcibr_unlock(pcibr_soft, s); -#if (DEBUG && PCIBR_DEV_DEBUG) - printk("pcibr_try_set_device: mod blocked by %R\n", bad, device_bits); -#endif - return bad; - } - } - } - if (mask == BRIDGE_DEV_PMU_BITS) - slotp->bss_pmu_uctr++; - if (mask == BRIDGE_DEV_D32_BITS) - slotp->bss_d32_uctr++; - if (mask == BRIDGE_DEV_D64_BITS) - slotp->bss_d64_uctr++; - - /* the value we want to write is the - * original value, with the bits for - * our selected changes flipped, and - * with any disabled features turned off. - */ - new = old ^ chg; /* only change what we want to change */ - - if (slotp->bss_device == new) { - pcibr_unlock(pcibr_soft, s); - return 0; - } - bridge->b_device[slot].reg = new; - slotp->bss_device = new; - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - pcibr_unlock(pcibr_soft, s); -#if DEBUG && PCIBR_DEV_DEBUG - printk("pcibr Device(%d): 0x%p\n", slot, bridge->b_device[slot].reg); -#endif - - return 0; -} - -void -pcibr_release_device(pcibr_soft_t pcibr_soft, - pciio_slot_t slot, - bridgereg_t mask) -{ - pcibr_soft_slot_t slotp; - unsigned long s; - - slotp = &pcibr_soft->bs_slot[slot]; - - s = pcibr_lock(pcibr_soft); - - if (mask == BRIDGE_DEV_PMU_BITS) - slotp->bss_pmu_uctr--; - if (mask == BRIDGE_DEV_D32_BITS) - slotp->bss_d32_uctr--; - if (mask == BRIDGE_DEV_D64_BITS) - slotp->bss_d64_uctr--; - - pcibr_unlock(pcibr_soft, s); -} - -/* - * flush write gather buffer for slot - */ -LOCAL void -pcibr_device_write_gather_flush(pcibr_soft_t pcibr_soft, - pciio_slot_t slot) -{ - bridge_t *bridge; - unsigned long s; - volatile uint32_t wrf; - s = pcibr_lock(pcibr_soft); - bridge = pcibr_soft->bs_base; - wrf = bridge->b_wr_req_buf[slot].reg; - pcibr_unlock(pcibr_soft, s); -} - -/* ===================================================================== - * Bridge (pcibr) "Device Driver" entry points - */ - -/* - * pcibr_probe_slot: read a config space word - * while trapping any errors; reutrn zero if - * all went OK, or nonzero if there was an error. - * The value read, if any, is passed back - * through the valp parameter. - */ -LOCAL int -pcibr_probe_slot(bridge_t *bridge, - cfg_p cfg, - unsigned *valp) -{ - int rv; - bridgereg_t old_enable, new_enable; - int badaddr_val(volatile void *, int, volatile void *); - - - old_enable = bridge->b_int_enable; - new_enable = old_enable & ~BRIDGE_IMR_PCI_MST_TIMEOUT; - - bridge->b_int_enable = new_enable; - - /* - * The xbridge doesn't clear b_err_int_view unless - * multi-err is cleared... - */ - if (is_xbridge(bridge)) - if (bridge->b_err_int_view & BRIDGE_ISR_PCI_MST_TIMEOUT) { - bridge->b_int_rst_stat = BRIDGE_IRR_MULTI_CLR; - } - - if (bridge->b_int_status & BRIDGE_IRR_PCI_GRP) { - bridge->b_int_rst_stat = BRIDGE_IRR_PCI_GRP_CLR; - (void) bridge->b_wid_tflush; /* flushbus */ - } - rv = badaddr_val((void *) cfg, 4, valp); - - /* - * The xbridge doesn't set master timeout in b_int_status - * here. Fortunately it's in error_interrupt_view. - */ - if (is_xbridge(bridge)) - if (bridge->b_err_int_view & BRIDGE_ISR_PCI_MST_TIMEOUT) { - bridge->b_int_rst_stat = BRIDGE_IRR_MULTI_CLR; - rv = 1; /* unoccupied slot */ - } - - bridge->b_int_enable = old_enable; - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - - return rv; -} - -/* - * pcibr_init: called once during system startup or - * when a loadable driver is loaded. - * - * The driver_register function should normally - * be in _reg, not _init. But the pcibr driver is - * required by devinit before the _reg routines - * are called, so this is an exception. - */ -void -pcibr_init(void) -{ -#if DEBUG && ATTACH_DEBUG - printk("pcibr_init\n"); -#endif - - xwidget_driver_register(XBRIDGE_WIDGET_PART_NUM, - XBRIDGE_WIDGET_MFGR_NUM, - "pcibr_", - 0); - xwidget_driver_register(BRIDGE_WIDGET_PART_NUM, - BRIDGE_WIDGET_MFGR_NUM, - "pcibr_", - 0); -} - -/* - * open/close mmap/munmap interface would be used by processes - * that plan to map the PCI bridge, and muck around with the - * registers. This is dangerous to do, and will be allowed - * to a select brand of programs. Typically these are - * diagnostics programs, or some user level commands we may - * write to do some weird things. - * To start with expect them to have root priveleges. - * We will ask for more later. - */ -/* ARGSUSED */ -int -pcibr_open(devfs_handle_t *devp, int oflag, int otyp, cred_t *credp) -{ - return 0; -} - -/*ARGSUSED */ -int -pcibr_close(devfs_handle_t dev, int oflag, int otyp, cred_t *crp) -{ - return 0; -} - -/*ARGSUSED */ -int -pcibr_map(devfs_handle_t dev, vhandl_t *vt, off_t off, size_t len, uint prot) -{ - int error; - devfs_handle_t vhdl = dev_to_vhdl(dev); - devfs_handle_t pcibr_vhdl = hwgraph_connectpt_get(vhdl); - pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); - bridge_t *bridge = pcibr_soft->bs_base; - - hwgraph_vertex_unref(pcibr_vhdl); - - ASSERT(pcibr_soft); - len = ctob(btoc(len)); /* Make len page aligned */ - error = v_mapphys(vt, (void *) ((__psunsigned_t) bridge + off), len); - - /* - * If the offset being mapped corresponds to the flash prom - * base, and if the mapping succeeds, and if the user - * has requested the protections to be WRITE, enable the - * flash prom to be written. - * - * XXX- deprecate this in favor of using the - * real flash driver ... - */ - if (!error && - ((off == BRIDGE_EXTERNAL_FLASH) || - (len > BRIDGE_EXTERNAL_FLASH))) { - int s; - - /* - * ensure that we write and read without any interruption. - * The read following the write is required for the Bridge war - */ - s = splhi(); - bridge->b_wid_control |= BRIDGE_CTRL_FLASH_WR_EN; - bridge->b_wid_control; /* inval addr bug war */ - splx(s); - } - return error; -} - -/*ARGSUSED */ -int -pcibr_unmap(devfs_handle_t dev, vhandl_t *vt) -{ - devfs_handle_t pcibr_vhdl = hwgraph_connectpt_get((devfs_handle_t) dev); - pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); - bridge_t *bridge = pcibr_soft->bs_base; - - hwgraph_vertex_unref(pcibr_vhdl); - - /* - * If flashprom write was enabled, disable it, as - * this is the last unmap. - */ - if (bridge->b_wid_control & BRIDGE_CTRL_FLASH_WR_EN) { - int s; - - /* - * ensure that we write and read without any interruption. - * The read following the write is required for the Bridge war - */ - s = splhi(); - bridge->b_wid_control &= ~BRIDGE_CTRL_FLASH_WR_EN; - bridge->b_wid_control; /* inval addr bug war */ - splx(s); - } - return 0; -} - -/* This is special case code used by grio. There are plans to make - * this a bit more general in the future, but till then this should - * be sufficient. - */ -pciio_slot_t -pcibr_device_slot_get(devfs_handle_t dev_vhdl) -{ - char devname[MAXDEVNAME]; - devfs_handle_t tdev; - pciio_info_t pciio_info; - pciio_slot_t slot = PCIIO_SLOT_NONE; - - vertex_to_name(dev_vhdl, devname, MAXDEVNAME); - - /* run back along the canonical path - * until we find a PCI connection point. - */ - tdev = hwgraph_connectpt_get(dev_vhdl); - while (tdev != GRAPH_VERTEX_NONE) { - pciio_info = pciio_info_chk(tdev); - if (pciio_info) { - slot = pciio_info_slot_get(pciio_info); - break; - } - hwgraph_vertex_unref(tdev); - tdev = hwgraph_connectpt_get(tdev); - } - hwgraph_vertex_unref(tdev); - - return slot; -} - -/*========================================================================== - * BRIDGE PCI SLOT RELATED IOCTLs - */ -char *pci_space_name[] = {"NONE", - "ROM", - "IO", - "", - "MEM", - "MEM32", - "MEM64", - "CFG", - "WIN0", - "WIN1", - "WIN2", - "WIN3", - "WIN4", - "WIN5", - "", - "BAD"}; - - -#ifdef LATER - -void -pcibr_slot_func_info_return(pcibr_info_h pcibr_infoh, - int func, - pcibr_slot_func_info_resp_t funcp) -{ - pcibr_info_t pcibr_info = pcibr_infoh[func]; - int win; - - funcp->resp_f_status = 0; - - if (!pcibr_info) { - return; - } - - funcp->resp_f_status |= FUNC_IS_VALID; -#ifdef SUPPORT_PRINTING_V_FORMAT - sprintf(funcp->resp_f_slot_name, "%v", pcibr_info->f_vertex); -#else - sprintf(funcp->resp_f_slot_name, "%x", pcibr_info->f_vertex); -#endif - - if(is_sys_critical_vertex(pcibr_info->f_vertex)) { - funcp->resp_f_status |= FUNC_IS_SYS_CRITICAL; - } - - funcp->resp_f_bus = pcibr_info->f_bus; - funcp->resp_f_slot = pcibr_info->f_slot; - funcp->resp_f_func = pcibr_info->f_func; -#ifdef SUPPORT_PRINTING_V_FORMAT - sprintf(funcp->resp_f_master_name, "%v", pcibr_info->f_master); -#else - sprintf(funcp->resp_f_master_name, "%x", pcibr_info->f_master); -#endif - funcp->resp_f_pops = pcibr_info->f_pops; - funcp->resp_f_efunc = pcibr_info->f_efunc; - funcp->resp_f_einfo = pcibr_info->f_einfo; - - funcp->resp_f_vendor = pcibr_info->f_vendor; - funcp->resp_f_device = pcibr_info->f_device; - - for(win = 0 ; win < 6 ; win++) { - funcp->resp_f_window[win].resp_w_base = - pcibr_info->f_window[win].w_base; - funcp->resp_f_window[win].resp_w_size = - pcibr_info->f_window[win].w_size; - sprintf(funcp->resp_f_window[win].resp_w_space, - "%s", - pci_space_name[pcibr_info->f_window[win].w_space]); - } - - funcp->resp_f_rbase = pcibr_info->f_rbase; - funcp->resp_f_rsize = pcibr_info->f_rsize; - - for (win = 0 ; win < 4; win++) { - funcp->resp_f_ibit[win] = pcibr_info->f_ibit[win]; - } - - funcp->resp_f_att_det_error = pcibr_info->f_att_det_error; - -} - -int -pcibr_slot_info_return(pcibr_soft_t pcibr_soft, - pciio_slot_t slot, - pcibr_slot_info_resp_t respp) -{ - pcibr_soft_slot_t pss; - int func; - bridge_t *bridge = pcibr_soft->bs_base; - reg_p b_respp; - pcibr_slot_info_resp_t slotp; - pcibr_slot_func_info_resp_t funcp; - - slotp = kmem_zalloc(sizeof(*slotp), KM_SLEEP); - if (slotp == NULL) { - return(ENOMEM); - } - - pss = &pcibr_soft->bs_slot[slot]; - - printk("\nPCI INFRASTRUCTURAL INFO FOR SLOT %d\n\n", slot); - - slotp->resp_has_host = pss->has_host; - slotp->resp_host_slot = pss->host_slot; -#ifdef SUPPORT_PRINTING_V_FORMAT - sprintf(slotp->resp_slot_conn_name, "%v", pss->slot_conn); -#else - sprintf(slotp->resp_slot_conn_name, "%x", pss->slot_conn); -#endif - slotp->resp_slot_status = pss->slot_status; - slotp->resp_l1_bus_num = io_path_map_widget(pcibr_soft->bs_vhdl); - - if (is_sys_critical_vertex(pss->slot_conn)) { - slotp->resp_slot_status |= SLOT_IS_SYS_CRITICAL; - } - - slotp->resp_bss_ninfo = pss->bss_ninfo; - - for (func = 0; func < pss->bss_ninfo; func++) { - funcp = &(slotp->resp_func[func]); - pcibr_slot_func_info_return(pss->bss_infos, func, funcp); - } - - sprintf(slotp->resp_bss_devio_bssd_space, "%s", - pci_space_name[pss->bss_devio.bssd_space]); - slotp->resp_bss_devio_bssd_base = pss->bss_devio.bssd_base; - slotp->resp_bss_device = pss->bss_device; - - slotp->resp_bss_pmu_uctr = pss->bss_pmu_uctr; - slotp->resp_bss_d32_uctr = pss->bss_d32_uctr; - slotp->resp_bss_d64_uctr = pss->bss_d64_uctr; - - slotp->resp_bss_d64_base = pss->bss_d64_base; - slotp->resp_bss_d64_flags = pss->bss_d64_flags; - slotp->resp_bss_d32_base = pss->bss_d32_base; - slotp->resp_bss_d32_flags = pss->bss_d32_flags; - - slotp->resp_bss_ext_ates_active = atomic_read(&pss->bss_ext_ates_active); - - slotp->resp_bss_cmd_pointer = pss->bss_cmd_pointer; - slotp->resp_bss_cmd_shadow = pss->bss_cmd_shadow; - - slotp->resp_bs_rrb_valid = pcibr_soft->bs_rrb_valid[slot]; - slotp->resp_bs_rrb_valid_v = pcibr_soft->bs_rrb_valid[slot + - PCIBR_RRB_SLOT_VIRTUAL]; - slotp->resp_bs_rrb_res = pcibr_soft->bs_rrb_res[slot]; - - if (slot & 1) { - b_respp = &bridge->b_odd_resp; - } else { - b_respp = &bridge->b_even_resp; - } - - slotp->resp_b_resp = *b_respp; - - slotp->resp_b_int_device = bridge->b_int_device; - slotp->resp_b_int_enable = bridge->b_int_enable; - slotp->resp_b_int_host = bridge->b_int_addr[slot].addr; - - if (COPYOUT(slotp, respp, sizeof(*respp))) { - return(EFAULT); - } - - kmem_free(slotp, sizeof(*slotp)); - - return(0); -} - -/* - * pcibr_slot_query - * Return information about the PCI slot maintained by the infrastructure. - * Information is requested in the request structure. - * - * Information returned in the response structure: - * Slot hwgraph name - * Vendor/Device info - * Base register info - * Interrupt mapping from device pins to the bridge pins - * Devio register - * Software RRB info - * RRB register info - * Host/Gues info - * PCI Bus #,slot #, function # - * Slot provider hwgraph name - * Provider Functions - * Error handler - * DMA mapping usage counters - * DMA direct translation info - * External SSRAM workaround info - */ -int -pcibr_slot_query(devfs_handle_t pcibr_vhdl, pcibr_slot_info_req_t reqp) -{ - pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); - pciio_slot_t slot = reqp->req_slot; - pciio_slot_t tmp_slot; - pcibr_slot_info_resp_t respp = (pcibr_slot_info_resp_t) reqp->req_respp; - int size = reqp->req_size; - int error; - - /* Make sure that we are dealing with a bridge device vertex */ - if (!pcibr_soft) { - return(EINVAL); - } - - /* Make sure that we have a valid PCI slot number or PCIIO_SLOT_NONE */ - if ((!PCIBR_VALID_SLOT(slot)) && (slot != PCIIO_SLOT_NONE)) { - return(EINVAL); - } - -#ifdef LATER - /* Do not allow a query of a slot in a shoehorn */ - if(nic_vertex_info_match(pcibr_soft->bs_conn, XTALK_PCI_PART_NUM)) { - return(EPERM); - } -#endif - - /* Return information for the requested PCI slot */ - if (slot != PCIIO_SLOT_NONE) { - if (size < sizeof(*respp)) { - return(EINVAL); - } - - /* Acquire read access to the slot */ - mrlock(pcibr_soft->bs_slot[slot].slot_lock, MR_ACCESS, PZERO); - - error = pcibr_slot_info_return(pcibr_soft, slot, respp); - - /* Release the slot lock */ - mrunlock(pcibr_soft->bs_slot[slot].slot_lock); - - return(error); - } - - /* Return information for all the slots */ - for (tmp_slot = 0; tmp_slot < 8; tmp_slot++) { - - if (size < sizeof(*respp)) { - return(EINVAL); - } - - /* Acquire read access to the slot */ - mrlock(pcibr_soft->bs_slot[tmp_slot].slot_lock, MR_ACCESS, PZERO); - - error = pcibr_slot_info_return(pcibr_soft, tmp_slot, respp); - - /* Release the slot lock */ - mrunlock(pcibr_soft->bs_slot[tmp_slot].slot_lock); - - if (error) { - return(error); - } - - ++respp; - size -= sizeof(*respp); - } - - return(error); -} -#endif /* LATER */ - - -/*ARGSUSED */ -int -pcibr_ioctl(devfs_handle_t dev, - int cmd, - void *arg, - int flag, - struct cred *cr, - int *rvalp) -{ - devfs_handle_t pcibr_vhdl = hwgraph_connectpt_get((devfs_handle_t)dev); -#ifdef LATER - pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); -#endif - int error = 0; - - hwgraph_vertex_unref(pcibr_vhdl); - - switch (cmd) { -#ifdef LATER - case GIOCSETBW: - { - grio_ioctl_info_t info; - pciio_slot_t slot = 0; - - if (!cap_able((uint64_t)CAP_DEVICE_MGT)) { - error = EPERM; - break; - } - if (COPYIN(arg, &info, sizeof(grio_ioctl_info_t))) { - error = EFAULT; - break; - } -#ifdef GRIO_DEBUG - printk("pcibr:: prev_vhdl: %d reqbw: %lld\n", - info.prev_vhdl, info.reqbw); -#endif /* GRIO_DEBUG */ - - if ((slot = pcibr_device_slot_get(info.prev_vhdl)) == - PCIIO_SLOT_NONE) { - error = EIO; - break; - } - if (info.reqbw) - pcibr_priority_bits_set(pcibr_soft, slot, PCI_PRIO_HIGH); - break; - } - - case GIOCRELEASEBW: - { - grio_ioctl_info_t info; - pciio_slot_t slot = 0; - - if (!cap_able(CAP_DEVICE_MGT)) { - error = EPERM; - break; - } - if (COPYIN(arg, &info, sizeof(grio_ioctl_info_t))) { - error = EFAULT; - break; - } -#ifdef GRIO_DEBUG - printk("pcibr:: prev_vhdl: %d reqbw: %lld\n", - info.prev_vhdl, info.reqbw); -#endif /* GRIO_DEBUG */ - - if ((slot = pcibr_device_slot_get(info.prev_vhdl)) == - PCIIO_SLOT_NONE) { - error = EIO; - break; - } - if (info.reqbw) - pcibr_priority_bits_set(pcibr_soft, slot, PCI_PRIO_LOW); - break; - } - - case PCIBR_SLOT_POWERUP: - { - pciio_slot_t slot; - - if (!cap_able(CAP_DEVICE_MGT)) { - error = EPERM; - break; - } - - slot = (pciio_slot_t)(uint64_t)arg; - error = pcibr_slot_powerup(pcibr_vhdl,slot); - break; - } - case PCIBR_SLOT_SHUTDOWN: - if (!cap_able(CAP_DEVICE_MGT)) { - error = EPERM; - break; - } - - slot = (pciio_slot_t)(uint64_t)arg; - error = pcibr_slot_powerup(pcibr_vhdl,slot); - break; - } - case PCIBR_SLOT_QUERY: - { - struct pcibr_slot_info_req_s req; - - if (!cap_able(CAP_DEVICE_MGT)) { - error = EPERM; - break; - } - - if (COPYIN(arg, &req, sizeof(req))) { - error = EFAULT; - break; - } - - error = pcibr_slot_query(pcibr_vhdl, &req); - break; - } -#endif /* LATER */ - default: - break; - - } - - return error; -} - -void -pcibr_freeblock_sub(iopaddr_t *free_basep, - iopaddr_t *free_lastp, - iopaddr_t base, - size_t size) -{ - iopaddr_t free_base = *free_basep; - iopaddr_t free_last = *free_lastp; - iopaddr_t last = base + size - 1; - - if ((last < free_base) || (base > free_last)); /* free block outside arena */ - - else if ((base <= free_base) && (last >= free_last)) - /* free block contains entire arena */ - *free_basep = *free_lastp = 0; - - else if (base <= free_base) - /* free block is head of arena */ - *free_basep = last + 1; - - else if (last >= free_last) - /* free block is tail of arena */ - *free_lastp = base - 1; - - /* - * We are left with two regions: the free area - * in the arena "below" the block, and the free - * area in the arena "above" the block. Keep - * the one that is bigger. - */ - - else if ((base - free_base) > (free_last - last)) - *free_lastp = base - 1; /* keep lower chunk */ - else - *free_basep = last + 1; /* keep upper chunk */ -} - -/* Convert from ssram_bits in control register to number of SSRAM entries */ -#define ATE_NUM_ENTRIES(n) _ate_info[n] - -/* Possible choices for number of ATE entries in Bridge's SSRAM */ -LOCAL int _ate_info[] = -{ - 0, /* 0 entries */ - 8 * 1024, /* 8K entries */ - 16 * 1024, /* 16K entries */ - 64 * 1024 /* 64K entries */ -}; - -#define ATE_NUM_SIZES (sizeof(_ate_info) / sizeof(int)) -#define ATE_PROBE_VALUE 0x0123456789abcdefULL - -/* - * Determine the size of this bridge's external mapping SSRAM, and set - * the control register appropriately to reflect this size, and initialize - * the external SSRAM. - */ -LOCAL int -pcibr_init_ext_ate_ram(bridge_t *bridge) -{ - int largest_working_size = 0; - int num_entries, entry; - int i, j; - bridgereg_t old_enable, new_enable; - int s; - - /* Probe SSRAM to determine its size. */ - old_enable = bridge->b_int_enable; - new_enable = old_enable & ~BRIDGE_IMR_PCI_MST_TIMEOUT; - bridge->b_int_enable = new_enable; - - for (i = 1; i < ATE_NUM_SIZES; i++) { - /* Try writing a value */ - bridge->b_ext_ate_ram[ATE_NUM_ENTRIES(i) - 1] = ATE_PROBE_VALUE; - - /* Guard against wrap */ - for (j = 1; j < i; j++) - bridge->b_ext_ate_ram[ATE_NUM_ENTRIES(j) - 1] = 0; - - /* See if value was written */ - if (bridge->b_ext_ate_ram[ATE_NUM_ENTRIES(i) - 1] == ATE_PROBE_VALUE) - largest_working_size = i; - } - bridge->b_int_enable = old_enable; - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - - /* - * ensure that we write and read without any interruption. - * The read following the write is required for the Bridge war - */ - - s = splhi(); - bridge->b_wid_control = (bridge->b_wid_control - & ~BRIDGE_CTRL_SSRAM_SIZE_MASK) - | BRIDGE_CTRL_SSRAM_SIZE(largest_working_size); - bridge->b_wid_control; /* inval addr bug war */ - splx(s); - - num_entries = ATE_NUM_ENTRIES(largest_working_size); - -#if PCIBR_ATE_DEBUG - if (num_entries) - printk("bridge at 0x%x: clearing %d external ATEs\n", bridge, num_entries); - else - printk("bridge at 0x%x: no externa9422l ATE RAM found\n", bridge); -#endif - - /* Initialize external mapping entries */ - for (entry = 0; entry < num_entries; entry++) - bridge->b_ext_ate_ram[entry] = 0; - - return (num_entries); -} - -/* - * Allocate "count" contiguous Bridge Address Translation Entries - * on the specified bridge to be used for PCI to XTALK mappings. - * Indices in rm map range from 1..num_entries. Indicies returned - * to caller range from 0..num_entries-1. - * - * Return the start index on success, -1 on failure. - */ -LOCAL int -pcibr_ate_alloc(pcibr_soft_t pcibr_soft, int count) -{ - int index = 0; - - index = (int) rmalloc(pcibr_soft->bs_int_ate_map, (size_t) count); -/* printk("Colin: pcibr_ate_alloc - index %d count %d \n", index, count); */ - - if (!index && pcibr_soft->bs_ext_ate_map) - index = (int) rmalloc(pcibr_soft->bs_ext_ate_map, (size_t) count); - - /* rmalloc manages resources in the 1..n - * range, with 0 being failure. - * pcibr_ate_alloc manages resources - * in the 0..n-1 range, with -1 being failure. - */ - return index - 1; -} - -LOCAL void -pcibr_ate_free(pcibr_soft_t pcibr_soft, int index, int count) -/* Who says there's no such thing as a free meal? :-) */ -{ - /* note the "+1" since rmalloc handles 1..n but - * we start counting ATEs at zero. - */ -/* printk("Colin: pcibr_ate_free - index %d count %d\n", index, count); */ - - rmfree((index < pcibr_soft->bs_int_ate_size) - ? pcibr_soft->bs_int_ate_map - : pcibr_soft->bs_ext_ate_map, - count, index + 1); -} - -LOCAL pcibr_info_t -pcibr_info_get(devfs_handle_t vhdl) -{ - return (pcibr_info_t) pciio_info_get(vhdl); -} - -pcibr_info_t -pcibr_device_info_new( - pcibr_soft_t pcibr_soft, - pciio_slot_t slot, - pciio_function_t rfunc, - pciio_vendor_id_t vendor, - pciio_device_id_t device) -{ - pcibr_info_t pcibr_info; - pciio_function_t func; - int ibit; - - func = (rfunc == PCIIO_FUNC_NONE) ? 0 : rfunc; - - NEW(pcibr_info); - pciio_device_info_new(&pcibr_info->f_c, - pcibr_soft->bs_vhdl, - slot, rfunc, - vendor, device); - - if (slot != PCIIO_SLOT_NONE) { - - /* - * Currently favored mapping from PCI - * slot number and INTA/B/C/D to Bridge - * PCI Interrupt Bit Number: - * - * SLOT A B C D - * 0 0 4 0 4 - * 1 1 5 1 5 - * 2 2 6 2 6 - * 3 3 7 3 7 - * 4 4 0 4 0 - * 5 5 1 5 1 - * 6 6 2 6 2 - * 7 7 3 7 3 - * - * XXX- allow pcibr_hints to override default - * XXX- allow ADMIN to override pcibr_hints - */ - for (ibit = 0; ibit < 4; ++ibit) - pcibr_info->f_ibit[ibit] = - (slot + 4 * ibit) & 7; - - /* - * Record the info in the sparse func info space. - */ - if (func < pcibr_soft->bs_slot[slot].bss_ninfo) - pcibr_soft->bs_slot[slot].bss_infos[func] = pcibr_info; - } - return pcibr_info; -} - -void -pcibr_device_info_free(devfs_handle_t pcibr_vhdl, pciio_slot_t slot) -{ - pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); - pcibr_info_t pcibr_info; - pciio_function_t func; - pcibr_soft_slot_t slotp = &pcibr_soft->bs_slot[slot]; - int nfunc = slotp->bss_ninfo; - - - for (func = 0; func < nfunc; func++) { - pcibr_info = slotp->bss_infos[func]; - - if (!pcibr_info) - continue; - - slotp->bss_infos[func] = 0; - pciio_device_info_unregister(pcibr_vhdl, &pcibr_info->f_c); - pciio_device_info_free(&pcibr_info->f_c); - DEL(pcibr_info); - } - - /* Clear the DEVIO(x) for this slot */ - slotp->bss_devio.bssd_space = PCIIO_SPACE_NONE; - slotp->bss_devio.bssd_base = PCIBR_D32_BASE_UNSET; - slotp->bss_device = 0; - - - /* Reset the mapping usage counters */ - slotp->bss_pmu_uctr = 0; - slotp->bss_d32_uctr = 0; - slotp->bss_d64_uctr = 0; - - /* Clear the Direct translation info */ - slotp->bss_d64_base = PCIBR_D64_BASE_UNSET; - slotp->bss_d64_flags = 0; - slotp->bss_d32_base = PCIBR_D32_BASE_UNSET; - slotp->bss_d32_flags = 0; - - /* Clear out shadow info necessary for the external SSRAM workaround */ - slotp->bss_ext_ates_active = ATOMIC_INIT(0); - slotp->bss_cmd_pointer = 0; - slotp->bss_cmd_shadow = 0; - -} - -/* - * PCI_ADDR_SPACE_LIMITS_LOAD - * Gets the current values of - * pci io base, - * pci io last, - * pci low memory base, - * pci low memory last, - * pci high memory base, - * pci high memory last - */ -#define PCI_ADDR_SPACE_LIMITS_LOAD() \ - pci_io_fb = pcibr_soft->bs_spinfo.pci_io_base; \ - pci_io_fl = pcibr_soft->bs_spinfo.pci_io_last; \ - pci_lo_fb = pcibr_soft->bs_spinfo.pci_swin_base; \ - pci_lo_fl = pcibr_soft->bs_spinfo.pci_swin_last; \ - pci_hi_fb = pcibr_soft->bs_spinfo.pci_mem_base; \ - pci_hi_fl = pcibr_soft->bs_spinfo.pci_mem_last; -/* - * PCI_ADDR_SPACE_LIMITS_STORE - * Sets the current values of - * pci io base, - * pci io last, - * pci low memory base, - * pci low memory last, - * pci high memory base, - * pci high memory last - */ -#define PCI_ADDR_SPACE_LIMITS_STORE() \ - pcibr_soft->bs_spinfo.pci_io_base = pci_io_fb; \ - pcibr_soft->bs_spinfo.pci_io_last = pci_io_fl; \ - pcibr_soft->bs_spinfo.pci_swin_base = pci_lo_fb; \ - pcibr_soft->bs_spinfo.pci_swin_last = pci_lo_fl; \ - pcibr_soft->bs_spinfo.pci_mem_base = pci_hi_fb; \ - pcibr_soft->bs_spinfo.pci_mem_last = pci_hi_fl; - -#define PCI_ADDR_SPACE_LIMITS_PRINT() \ - printf("+++++++++++++++++++++++\n" \ - "IO base 0x%x last 0x%x\n" \ - "SWIN base 0x%x last 0x%x\n" \ - "MEM base 0x%x last 0x%x\n" \ - "+++++++++++++++++++++++\n", \ - pcibr_soft->bs_spinfo.pci_io_base, \ - pcibr_soft->bs_spinfo.pci_io_last, \ - pcibr_soft->bs_spinfo.pci_swin_base, \ - pcibr_soft->bs_spinfo.pci_swin_last, \ - pcibr_soft->bs_spinfo.pci_mem_base, \ - pcibr_soft->bs_spinfo.pci_mem_last); - -/* - * pcibr_slot_info_init - * Probe for this slot and see if it is populated. - * If it is populated initialize the generic PCI infrastructural - * information associated with this particular PCI device. - */ -int -pcibr_slot_info_init(devfs_handle_t pcibr_vhdl, - pciio_slot_t slot) -{ - pcibr_soft_t pcibr_soft; - pcibr_info_h pcibr_infoh; - pcibr_info_t pcibr_info; - bridge_t *bridge; - cfg_p cfgw; - unsigned idword; - unsigned pfail; - unsigned idwords[8]; - pciio_vendor_id_t vendor; - pciio_device_id_t device; - unsigned htype; -#if !defined(CONFIG_IA64_SGI_SN1) - int nbars; -#endif - cfg_p wptr; - int win; - pciio_space_t space; - iopaddr_t pci_io_fb, pci_io_fl; - iopaddr_t pci_lo_fb, pci_lo_fl; - iopaddr_t pci_hi_fb, pci_hi_fl; - int nfunc; - pciio_function_t rfunc; - int func; - devfs_handle_t conn_vhdl; - pcibr_soft_slot_t slotp; - - /* Get the basic software information required to proceed */ - pcibr_soft = pcibr_soft_get(pcibr_vhdl); - if (!pcibr_soft) - return(EINVAL); - - bridge = pcibr_soft->bs_base; - if (!PCIBR_VALID_SLOT(slot)) - return(EINVAL); - - /* If we have a host slot (eg:- IOC3 has 2 PCI slots and the initialization - * is done by the host slot then we are done. - */ - if (pcibr_soft->bs_slot[slot].has_host) { - return(0); - } - - /* Check for a slot with any system critical functions */ - if (pcibr_is_slot_sys_critical(pcibr_vhdl, slot)) - return(EPERM); - - /* Load the current values of allocated PCI address spaces */ - PCI_ADDR_SPACE_LIMITS_LOAD(); - - /* Try to read the device-id/vendor-id from the config space */ - cfgw = bridge->b_type0_cfg_dev[slot].l; - - if (pcibr_probe_slot(bridge, cfgw, &idword)) - return(ENODEV); - - slotp = &pcibr_soft->bs_slot[slot]; - slotp->slot_status |= SLOT_POWER_UP; - - vendor = 0xFFFF & idword; - /* If the vendor id is not valid then the slot is not populated - * and we are done. - */ - if (vendor == 0xFFFF) - return(ENODEV); - - device = 0xFFFF & (idword >> 16); - htype = do_pcibr_config_get(cfgw, PCI_CFG_HEADER_TYPE, 1); - - nfunc = 1; - rfunc = PCIIO_FUNC_NONE; - pfail = 0; - - /* NOTE: if a card claims to be multifunction - * but only responds to config space 0, treat - * it as a unifunction card. - */ - - if (htype & 0x80) { /* MULTIFUNCTION */ - for (func = 1; func < 8; ++func) { - cfgw = bridge->b_type0_cfg_dev[slot].f[func].l; - if (pcibr_probe_slot(bridge, cfgw, &idwords[func])) { - pfail |= 1 << func; - continue; - } - vendor = 0xFFFF & idwords[func]; - if (vendor == 0xFFFF) { - pfail |= 1 << func; - continue; - } - nfunc = func + 1; - rfunc = 0; - } - cfgw = bridge->b_type0_cfg_dev[slot].l; - } - NEWA(pcibr_infoh, nfunc); - - pcibr_soft->bs_slot[slot].bss_ninfo = nfunc; - pcibr_soft->bs_slot[slot].bss_infos = pcibr_infoh; - - for (func = 0; func < nfunc; ++func) { - unsigned cmd_reg; - - if (func) { - if (pfail & (1 << func)) - continue; - - idword = idwords[func]; - cfgw = bridge->b_type0_cfg_dev[slot].f[func].l; - - device = 0xFFFF & (idword >> 16); - htype = do_pcibr_config_get(cfgw, PCI_CFG_HEADER_TYPE, 1); - rfunc = func; - } - htype &= 0x7f; - if (htype != 0x00) { - PRINT_WARNING("%s pcibr: pci slot %d func %d has strange header type 0x%x\n", - pcibr_soft->bs_name, slot, func, htype); -#if defined(CONFIG_IA64_SGI_SN1) - continue; -#else - nbars = 2; - } else { - nbars = PCI_CFG_BASE_ADDRS; -#endif - } -#if DEBUG && ATTACH_DEBUG - PRINT_NOTICE( - "%s pcibr: pci slot %d func %d: vendor 0x%x device 0x%x", - pcibr_soft->bs_name, slot, func, vendor, device); -#endif - - pcibr_info = pcibr_device_info_new - (pcibr_soft, slot, rfunc, vendor, device); - conn_vhdl = pciio_device_info_register(pcibr_vhdl, &pcibr_info->f_c); - if (func == 0) - slotp->slot_conn = conn_vhdl; - - cmd_reg = cfgw[PCI_CFG_COMMAND / 4]; - - wptr = cfgw + PCI_CFG_BASE_ADDR_0 / 4; - -#if defined(CONFIG_IA64_SGI_SN1) - for (win = 0; win < PCI_CFG_BASE_ADDRS; ++win) -#else - for (win = 0; win < nbars; ++win) -#endif - { - iopaddr_t base, mask, code; - size_t size; - - /* - * GET THE BASE & SIZE OF THIS WINDOW: - * - * The low two or four bits of the BASE register - * determines which address space we are in; the - * rest is a base address. BASE registers - * determine windows that are power-of-two sized - * and naturally aligned, so we can get the size - * of a window by writing all-ones to the - * register, reading it back, and seeing which - * bits are used for decode; the least - * significant nonzero bit is also the size of - * the window. - * - * WARNING: someone may already have allocated - * some PCI space to this window, and in fact - * PIO may be in process at this very moment - * from another processor (or even from this - * one, if we get interrupted)! So, if the BASE - * already has a nonzero address, be generous - * and use the LSBit of that address as the - * size; this could overstate the window size. - * Usually, when one card is set up, all are set - * up; so, since we don't bitch about - * overlapping windows, we are ok. - * - * UNFORTUNATELY, some cards do not clear their - * BASE registers on reset. I have two heuristics - * that can detect such cards: first, if the - * decode enable is turned off for the space - * that the window uses, we can disregard the - * initial value. second, if the address is - * outside the range that we use, we can disregard - * it as well. - * - * This is looking very PCI generic. Except for - * knowing how many slots and where their config - * spaces are, this window loop and the next one - * could probably be shared with other PCI host - * adapters. It would be interesting to see if - * this could be pushed up into pciio, when we - * start supporting more PCI providers. - */ -#ifdef LITTLE_ENDIAN - base = wptr[((win*4)^4)/4]; -#else - base = wptr[win]; -#endif - - if (base & PCI_BA_IO_SPACE) { - /* BASE is in I/O space. */ - space = PCIIO_SPACE_IO; - mask = -4; - code = base & 3; - base = base & mask; - if (base == 0) { - ; /* not assigned */ - } else if (!(cmd_reg & PCI_CMD_IO_SPACE)) { - base = 0; /* decode not enabled */ - } - } else { - /* BASE is in MEM space. */ - space = PCIIO_SPACE_MEM; - mask = -16; - code = base & PCI_BA_MEM_LOCATION; /* extract BAR type */ - base = base & mask; - if (base == 0) { - ; /* not assigned */ - } else if (!(cmd_reg & PCI_CMD_MEM_SPACE)) { - base = 0; /* decode not enabled */ - } else if (base & 0xC0000000) { - base = 0; /* outside permissable range */ - } else if ((code == PCI_BA_MEM_64BIT) && -#ifdef LITTLE_ENDIAN - (wptr[(((win + 1)*4)^4)/4] != 0)) { -#else - (wptr[win + 1] != 0)) { -#endif /* LITTLE_ENDIAN */ - base = 0; /* outside permissable range */ - } - } - - if (base != 0) { /* estimate size */ - size = base & -base; - } else { /* calculate size */ -#ifdef LITTLE_ENDIAN - wptr[((win*4)^4)/4] = ~0; /* turn on all bits */ - size = wptr[((win*4)^4)/4]; /* get stored bits */ -#else - wptr[win] = ~0; /* turn on all bits */ - size = wptr[win]; /* get stored bits */ -#endif /* LITTLE_ENDIAN */ - size &= mask; /* keep addr */ - size &= -size; /* keep lsbit */ - if (size == 0) - continue; - } - - pcibr_info->f_window[win].w_space = space; - pcibr_info->f_window[win].w_base = base; - pcibr_info->f_window[win].w_size = size; - - /* - * If this window already has PCI space - * allocated for it, "subtract" that space from - * our running freeblocks. Don't worry about - * overlaps in existing allocated windows; we - * may be overstating their sizes anyway. - */ - - if (base && size) { - if (space == PCIIO_SPACE_IO) { - pcibr_freeblock_sub(&pci_io_fb, - &pci_io_fl, - base, size); - } else { - pcibr_freeblock_sub(&pci_lo_fb, - &pci_lo_fl, - base, size); - pcibr_freeblock_sub(&pci_hi_fb, - &pci_hi_fl, - base, size); - } - } -#if defined(IOC3_VENDOR_ID_NUM) && defined(IOC3_DEVICE_ID_NUM) - /* - * IOC3 BASE_ADDR* BUG WORKAROUND - * - - * If we write to BASE1 on the IOC3, the - * data in BASE0 is replaced. The - * original workaround was to remember - * the value of BASE0 and restore it - * when we ran off the end of the BASE - * registers; however, a later - * workaround was added (I think it was - * rev 1.44) to avoid setting up - * anything but BASE0, with the comment - * that writing all ones to BASE1 set - * the enable-parity-error test feature - * in IOC3's SCR bit 14. - * - * So, unless we defer doing any PCI - * space allocation until drivers - * attach, and set up a way for drivers - * (the IOC3 in paricular) to tell us - * generically to keep our hands off - * BASE registers, we gotta "know" about - * the IOC3 here. - * - * Too bad the PCI folks didn't reserve the - * all-zero value for 'no BASE here' (it is a - * valid code for an uninitialized BASE in - * 32-bit PCI memory space). - */ - - if ((vendor == IOC3_VENDOR_ID_NUM) && - (device == IOC3_DEVICE_ID_NUM)) - break; -#endif - if (code == PCI_BA_MEM_64BIT) { - win++; /* skip upper half */ -#ifdef LITTLE_ENDIAN - wptr[((win*4)^4)/4] = 0; /* which must be zero */ -#else - wptr[win] = 0; /* which must be zero */ -#endif /* LITTLE_ENDIAN */ - } - } /* next win */ - } /* next func */ - - /* Store back the values for allocated PCI address spaces */ - PCI_ADDR_SPACE_LIMITS_STORE(); - return(0); -} - -/* - * pcibr_slot_info_free - * Remove all the PCI infrastructural information associated - * with a particular PCI device. - */ -int -pcibr_slot_info_free(devfs_handle_t pcibr_vhdl, - pciio_slot_t slot) -{ - pcibr_soft_t pcibr_soft; - pcibr_info_h pcibr_infoh; - int nfunc; - - pcibr_soft = pcibr_soft_get(pcibr_vhdl); - - if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) - return(EINVAL); - -#if !defined(CONFIG_IA64_SGI_SN1) - /* Clean out all the base registers */ - bridge = pcibr_soft->bs_base; - cfgw = bridge->b_type0_cfg_dev[slot].l; - wptr = cfgw + PCI_CFG_BASE_ADDR_0 / 4; - - for (win = 0; win < PCI_CFG_BASE_ADDRS; ++win) -#ifdef LITTLE_ENDIAN - wptr[((win*4)^4)/4] = 0; -#else - wptr[win] = 0; -#endif /* LITTLE_ENDIAN */ -#endif /* !CONFIG_IA64_SGI_SN1 */ - - nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; - - pcibr_device_info_free(pcibr_vhdl, slot); - - pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; - DELA(pcibr_infoh,nfunc); - pcibr_soft->bs_slot[slot].bss_ninfo = 0; - - return(0); -} - -int as_debug = 0; -/* - * pcibr_slot_addr_space_init - * Reserve chunks of PCI address space as required by - * the base registers in the card. - */ -int -pcibr_slot_addr_space_init(devfs_handle_t pcibr_vhdl, - pciio_slot_t slot) -{ - pcibr_soft_t pcibr_soft; - pcibr_info_h pcibr_infoh; - pcibr_info_t pcibr_info; - bridge_t *bridge; - iopaddr_t pci_io_fb, pci_io_fl; - iopaddr_t pci_lo_fb, pci_lo_fl; - iopaddr_t pci_hi_fb, pci_hi_fl; - size_t align; - iopaddr_t mask; - int nbars; - int nfunc; - int func; - int win; - - pcibr_soft = pcibr_soft_get(pcibr_vhdl); - - if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) - return(EINVAL); - - bridge = pcibr_soft->bs_base; - - /* Get the current values for the allocated PCI address spaces */ - PCI_ADDR_SPACE_LIMITS_LOAD(); - - if (as_debug) -#ifdef LATER - PCI_ADDR_SPACE_LIMITS_PRINT(); -#endif - /* allocate address space, - * for windows that have not been - * previously assigned. - */ - if (pcibr_soft->bs_slot[slot].has_host) { - return(0); - } - - nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; - if (nfunc < 1) - return(EINVAL); - - pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; - if (!pcibr_infoh) - return(EINVAL); - - /* - * Try to make the DevIO windows not - * overlap by pushing the "io" and "hi" - * allocation areas up to the next one - * or two megabyte bound. This also - * keeps them from being zero. - * - * DO NOT do this with "pci_lo" since - * the entire "lo" area is only a - * megabyte, total ... - */ - align = (slot < 2) ? 0x200000 : 0x100000; - mask = -align; - pci_io_fb = (pci_io_fb + align - 1) & mask; - pci_hi_fb = (pci_hi_fb + align - 1) & mask; - - for (func = 0; func < nfunc; ++func) { - cfg_p cfgw; - cfg_p wptr; - pciio_space_t space; - iopaddr_t base; - size_t size; - cfg_p pci_cfg_cmd_reg_p; - unsigned pci_cfg_cmd_reg; - unsigned pci_cfg_cmd_reg_add = 0; - - pcibr_info = pcibr_infoh[func]; - - if (!pcibr_info) - continue; - - if (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) - continue; - - cfgw = bridge->b_type0_cfg_dev[slot].f[func].l; - wptr = cfgw + PCI_CFG_BASE_ADDR_0 / 4; - -#if defined(CONFIG_IA64_SGI_SN1) - nbars = PCI_CFG_BASE_ADDRS; -#else - if ((do_pcibr_config_get(cfgw, PCI_CFG_HEADER_TYPE, 1) & 0x7f) != 0) - nbars = 2; - else - nbars = PCI_CFG_BASE_ADDRS; -#endif - - for (win = 0; win < nbars; ++win) { - - space = pcibr_info->f_window[win].w_space; - base = pcibr_info->f_window[win].w_base; - size = pcibr_info->f_window[win].w_size; - - if (size < 1) - continue; - - if (base >= size) { -#if DEBUG && PCI_DEBUG - printk("pcibr: slot %d func %d window %d is in %d[0x%x..0x%x], alloc by prom\n", - slot, func, win, space, base, base + size - 1); -#endif - continue; /* already allocated */ - } - align = size; /* ie. 0x00001000 */ - if (align < _PAGESZ) - align = _PAGESZ; /* ie. 0x00004000 */ - mask = -align; /* ie. 0xFFFFC000 */ - - switch (space) { - case PCIIO_SPACE_IO: - base = (pci_io_fb + align - 1) & mask; - if ((base + size) > pci_io_fl) { - base = 0; - break; - } - pci_io_fb = base + size; - break; - - case PCIIO_SPACE_MEM: -#ifdef LITTLE_ENDIAN - if ((wptr[((win*4)^4)/4] & PCI_BA_MEM_LOCATION) == -#else - if ((wptr[win] & PCI_BA_MEM_LOCATION) == -#endif /* LITTLE_ENDIAN */ - PCI_BA_MEM_1MEG) { - /* allocate from 20-bit PCI space */ - base = (pci_lo_fb + align - 1) & mask; - if ((base + size) > pci_lo_fl) { - base = 0; - break; - } - pci_lo_fb = base + size; - } else { - /* allocate from 32-bit or 64-bit PCI space */ - base = (pci_hi_fb + align - 1) & mask; - if ((base + size) > pci_hi_fl) { - base = 0; - break; - } - pci_hi_fb = base + size; - } - break; - - default: - base = 0; -#if DEBUG && PCI_DEBUG - printk("pcibr: slot %d window %d had bad space code %d\n", - slot, win, space); -#endif - } - pcibr_info->f_window[win].w_base = base; -#ifdef LITTLE_ENDIAN - wptr[((win*4)^4)/4] = base; -#if DEBUG && PCI_DEBUG - printk("Setting base address 0x%p base 0x%x\n", &(wptr[((win*4)^4)/4]), base); -#endif -#else - wptr[win] = base; -#endif /* LITTLE_ENDIAN */ - -#if DEBUG && PCI_DEBUG - if (base >= size) - printk("pcibr: slot %d func %d window %d is in %d [0x%x..0x%x], alloc by pcibr\n", - slot, func, win, space, base, base + size - 1); - else - printk("pcibr: slot %d func %d window %d, unable to alloc 0x%x in 0x%p\n", - slot, func, win, size, space); -#endif - } /* next base */ - - /* - * Allocate space for the EXPANSION ROM - * NOTE: DO NOT DO THIS ON AN IOC3, - * as it blows the system away. - */ - base = size = 0; - if ((pcibr_soft->bs_slot[slot].bss_vendor_id != IOC3_VENDOR_ID_NUM) || - (pcibr_soft->bs_slot[slot].bss_device_id != IOC3_DEVICE_ID_NUM)) { - - wptr = cfgw + PCI_EXPANSION_ROM / 4; -#ifdef LITTLE_ENDIAN - wptr[1] = 0xFFFFF000; - mask = wptr[1]; -#else - *wptr = 0xFFFFF000; - mask = *wptr; -#endif /* LITTLE_ENDIAN */ - if (mask & 0xFFFFF000) { - size = mask & -mask; - align = size; - if (align < _PAGESZ) - align = _PAGESZ; - mask = -align; - base = (pci_hi_fb + align - 1) & mask; - if ((base + size) > pci_hi_fl) - base = size = 0; - else { - pci_hi_fb = base + size; -#ifdef LITTLE_ENDIAN - wptr[1] = base; -#else - *wptr = base; -#endif /* LITTLE_ENDIAN */ -#if DEBUG && PCI_DEBUG - printk("%s/%d ROM in 0x%lx..0x%lx (alloc by pcibr)\n", - pcibr_soft->bs_name, slot, - base, base + size - 1); -#endif - } - } - } - pcibr_info->f_rbase = base; - pcibr_info->f_rsize = size; - - /* - * if necessary, update the board's - * command register to enable decoding - * in the windows we added. - * - * There are some bits we always want to - * be sure are set. - */ - pci_cfg_cmd_reg_add |= PCI_CMD_IO_SPACE; - - /* - * The Adaptec 1160 FC Controller WAR #767995: - * The part incorrectly ignores the upper 32 bits of a 64 bit - * address when decoding references to it's registers so to - * keep it from responding to a bus cycle that it shouldn't - * we only use I/O space to get at it's registers. Don't - * enable memory space accesses on that PCI device. - */ - #define FCADP_VENDID 0x9004 /* Adaptec Vendor ID from fcadp.h */ - #define FCADP_DEVID 0x1160 /* Adaptec 1160 Device ID from fcadp.h */ - - if ((pcibr_info->f_vendor != FCADP_VENDID) || - (pcibr_info->f_device != FCADP_DEVID)) - pci_cfg_cmd_reg_add |= PCI_CMD_MEM_SPACE; - - pci_cfg_cmd_reg_add |= PCI_CMD_BUS_MASTER; - - pci_cfg_cmd_reg_p = cfgw + PCI_CFG_COMMAND / 4; - pci_cfg_cmd_reg = *pci_cfg_cmd_reg_p; -#if PCI_FBBE /* XXX- check here to see if dev can do fast-back-to-back */ - if (!((pci_cfg_cmd_reg >> 16) & PCI_STAT_F_BK_BK_CAP)) - fast_back_to_back_enable = 0; -#endif - pci_cfg_cmd_reg &= 0xFFFF; - if (pci_cfg_cmd_reg_add & ~pci_cfg_cmd_reg) - *pci_cfg_cmd_reg_p = pci_cfg_cmd_reg | pci_cfg_cmd_reg_add; - - } /* next func */ - - /* Now that we have allocated new chunks of PCI address spaces to this - * card we need to update the bookkeeping values which indicate - * the current PCI address space allocations. - */ - PCI_ADDR_SPACE_LIMITS_STORE(); - return(0); -} - -/* - * pcibr_slot_device_init - * Setup the device register in the bridge for this PCI slot. - */ -int -pcibr_slot_device_init(devfs_handle_t pcibr_vhdl, - pciio_slot_t slot) -{ - pcibr_soft_t pcibr_soft; - bridge_t *bridge; - bridgereg_t devreg; - - pcibr_soft = pcibr_soft_get(pcibr_vhdl); - - if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) - return(EINVAL); - - bridge = pcibr_soft->bs_base; - - /* - * Adjustments to Device(x) - * and init of bss_device shadow - */ - devreg = bridge->b_device[slot].reg; - devreg &= ~BRIDGE_DEV_PAGE_CHK_DIS; - devreg |= BRIDGE_DEV_COH | BRIDGE_DEV_VIRTUAL_EN; -#ifdef LITTLE_ENDIAN - devreg |= BRIDGE_DEV_DEV_SWAP; -#endif - pcibr_soft->bs_slot[slot].bss_device = devreg; - bridge->b_device[slot].reg = devreg; - -#if DEBUG && PCI_DEBUG - printk("pcibr Device(%d): 0x%lx\n", slot, bridge->b_device[slot].reg); -#endif - -#if DEBUG && PCI_DEBUG - printk("pcibr: PCI space allocation done.\n"); -#endif - - return(0); -} - -/* - * pcibr_slot_guest_info_init - * Setup the host/guest relations for a PCI slot. - */ -int -pcibr_slot_guest_info_init(devfs_handle_t pcibr_vhdl, - pciio_slot_t slot) -{ - pcibr_soft_t pcibr_soft; - pcibr_info_h pcibr_infoh; - pcibr_info_t pcibr_info; - pcibr_soft_slot_t slotp; - - pcibr_soft = pcibr_soft_get(pcibr_vhdl); - - if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) - return(EINVAL); - - slotp = &pcibr_soft->bs_slot[slot]; - - /* create info and verticies for guest slots; - * for compatibilitiy macros, create info - * for even unpopulated slots (but do not - * build verticies for them). - */ - if (pcibr_soft->bs_slot[slot].bss_ninfo < 1) { - NEWA(pcibr_infoh, 1); - pcibr_soft->bs_slot[slot].bss_ninfo = 1; - pcibr_soft->bs_slot[slot].bss_infos = pcibr_infoh; - - pcibr_info = pcibr_device_info_new - (pcibr_soft, slot, PCIIO_FUNC_NONE, - PCIIO_VENDOR_ID_NONE, PCIIO_DEVICE_ID_NONE); - - if (pcibr_soft->bs_slot[slot].has_host) { - slotp->slot_conn = pciio_device_info_register - (pcibr_vhdl, &pcibr_info->f_c); - } - } - - /* generate host/guest relations - */ - if (pcibr_soft->bs_slot[slot].has_host) { - int host = pcibr_soft->bs_slot[slot].host_slot; - pcibr_soft_slot_t host_slotp = &pcibr_soft->bs_slot[host]; - - hwgraph_edge_add(slotp->slot_conn, - host_slotp->slot_conn, - EDGE_LBL_HOST); - - /* XXX- only gives us one guest edge per - * host. If/when we have a host with more than - * one guest, we will need to figure out how - * the host finds all its guests, and sorts - * out which one is which. - */ - hwgraph_edge_add(host_slotp->slot_conn, - slotp->slot_conn, - EDGE_LBL_GUEST); - } - - return(0); -} - -/* - * pcibr_slot_initial_rrb_alloc - * Allocate a default number of rrbs for this slot on - * the two channels. This is dictated by the rrb allocation - * strategy routine defined per platform. - */ - -int -pcibr_slot_initial_rrb_alloc(devfs_handle_t pcibr_vhdl, - pciio_slot_t slot) -{ - pcibr_soft_t pcibr_soft; - pcibr_info_h pcibr_infoh; - pcibr_info_t pcibr_info; - bridge_t *bridge; - int c0, c1; - int r; - - pcibr_soft = pcibr_soft_get(pcibr_vhdl); - - if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) - return(EINVAL); - - bridge = pcibr_soft->bs_base; - - /* How may RRBs are on this slot? - */ - c0 = do_pcibr_rrb_count_valid(bridge, slot); - c1 = do_pcibr_rrb_count_valid(bridge, slot + PCIBR_RRB_SLOT_VIRTUAL); - -#if PCIBR_RRB_DEBUG - printk("pcibr_attach: slot %d started with %d+%d\n", slot, c0, c1); -#endif - - /* Do we really need any? - */ - pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; - pcibr_info = pcibr_infoh[0]; - if ((pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) && - !pcibr_soft->bs_slot[slot].has_host) { - if (c0 > 0) - do_pcibr_rrb_free(bridge, slot, c0); - if (c1 > 0) - do_pcibr_rrb_free(bridge, slot + PCIBR_RRB_SLOT_VIRTUAL, c1); - pcibr_soft->bs_rrb_valid[slot] = 0x1000; - pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL] = 0x1000; - return(ENODEV); - } - - pcibr_soft->bs_rrb_avail[slot & 1] -= c0 + c1; - pcibr_soft->bs_rrb_valid[slot] = c0; - pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL] = c1; - - pcibr_soft->bs_rrb_avail[0] = do_pcibr_rrb_count_avail(bridge, 0); - pcibr_soft->bs_rrb_avail[1] = do_pcibr_rrb_count_avail(bridge, 1); - - r = 3 - (c0 + c1); - - if (r > 0) { - pcibr_soft->bs_rrb_res[slot] = r; - pcibr_soft->bs_rrb_avail[slot & 1] -= r; - } - -#if PCIBR_RRB_DEBUG - printk("\t%d+%d+%d", - 0xFFF & pcibr_soft->bs_rrb_valid[slot], - 0xFFF & pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL], - pcibr_soft->bs_rrb_res[slot]); - printk("\n"); -#endif - - return(0); -} - -/* - * pcibr_slot_call_device_attach - * This calls the associated driver attach routine for the PCI - * card in this slot. - */ -int -pcibr_slot_call_device_attach(devfs_handle_t pcibr_vhdl, - pciio_slot_t slot, - int drv_flags) -{ - pcibr_soft_t pcibr_soft; - pcibr_info_h pcibr_infoh; - pcibr_info_t pcibr_info; - async_attach_t aa = NULL; - int func; - devfs_handle_t xconn_vhdl,conn_vhdl; - int nfunc; - int error_func; - int error_slot = 0; - int error = ENODEV; - - pcibr_soft = pcibr_soft_get(pcibr_vhdl); - - if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) - return(EINVAL); - - - if (pcibr_soft->bs_slot[slot].has_host) { - return(EPERM); - } - - xconn_vhdl = pcibr_soft->bs_conn; - aa = async_attach_get_info(xconn_vhdl); - - nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; - pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; - - for (func = 0; func < nfunc; ++func) { - - pcibr_info = pcibr_infoh[func]; - - if (!pcibr_info) - continue; - - if (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) - continue; - - conn_vhdl = pcibr_info->f_vertex; - - /* If the PCI device has been disabled in the prom, - * do not set it up for driver attach. NOTE: usrpci - * and pciba will not "see" this connection point! - */ - if (device_admin_info_get(conn_vhdl, ADMIN_LBL_DISABLED)) { -#ifdef SUPPORT_PRINTING_V_FORMAT - PRINT_WARNING("pcibr_slot_call_device_attach: %v disabled\n", - conn_vhdl); -#endif - continue; - } -#ifdef LATER - /* - * Activate if and when we support cdl. - */ - if (aa) - async_attach_add_info(conn_vhdl, aa); -#endif /* LATER */ - - error_func = pciio_device_attach(conn_vhdl, drv_flags); - - pcibr_info->f_att_det_error = error_func; - - if (error_func) - error_slot = error_func; - - error = error_slot; - - } /* next func */ - - if (error) { - if ((error != ENODEV) && (error != EUNATCH)) - pcibr_soft->bs_slot[slot].slot_status |= SLOT_STARTUP_INCMPLT; - } else { - pcibr_soft->bs_slot[slot].slot_status |= SLOT_STARTUP_CMPLT; - } - - return(error); -} - -/* - * pcibr_slot_call_device_detach - * This calls the associated driver detach routine for the PCI - * card in this slot. - */ -int -pcibr_slot_call_device_detach(devfs_handle_t pcibr_vhdl, - pciio_slot_t slot, - int drv_flags) -{ - pcibr_soft_t pcibr_soft; - pcibr_info_h pcibr_infoh; - pcibr_info_t pcibr_info; - int func; - devfs_handle_t conn_vhdl = GRAPH_VERTEX_NONE; - int nfunc; - int error_func; - int error_slot = 0; - int error = ENODEV; - - pcibr_soft = pcibr_soft_get(pcibr_vhdl); - - if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) - return(EINVAL); - - if (pcibr_soft->bs_slot[slot].has_host) - return(EPERM); - - /* Make sure that we do not detach a system critical function vertex */ - if(pcibr_is_slot_sys_critical(pcibr_vhdl, slot)) - return(EPERM); - - nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; - pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; - - for (func = 0; func < nfunc; ++func) { - - pcibr_info = pcibr_infoh[func]; - - if (!pcibr_info) - continue; - - if (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) - continue; - - conn_vhdl = pcibr_info->f_vertex; - - error_func = pciio_device_detach(conn_vhdl, drv_flags); - - pcibr_info->f_att_det_error = error_func; - - if (error_func) - error_slot = error_func; - - error = error_slot; - - } /* next func */ - - pcibr_soft->bs_slot[slot].slot_status &= ~SLOT_STATUS_MASK; - - if (error) { - if ((error != ENODEV) && (error != EUNATCH)) - pcibr_soft->bs_slot[slot].slot_status |= SLOT_SHUTDOWN_INCMPLT; - } else { - if (conn_vhdl != GRAPH_VERTEX_NONE) - pcibr_device_unregister(conn_vhdl); - pcibr_soft->bs_slot[slot].slot_status |= SLOT_SHUTDOWN_CMPLT; - } - - return(error); -} - -/* - * pcibr_slot_detach - * This is a place holder routine to keep track of all the - * slot-specific freeing that needs to be done. - */ -int -pcibr_slot_detach(devfs_handle_t pcibr_vhdl, - pciio_slot_t slot, - int drv_flags) -{ - int error; - - /* Call the device detach function */ - error = (pcibr_slot_call_device_detach(pcibr_vhdl, slot, drv_flags)); - return (error); - -} - -/* - * pcibr_is_slot_sys_critical - * Check slot for any functions that are system critical. - * Return 1 if any are system critical or 0 otherwise. - * - * This function will always return 0 when called by - * pcibr_attach() because the system critical vertices - * have not yet been set in the hwgraph. - */ -int -pcibr_is_slot_sys_critical(devfs_handle_t pcibr_vhdl, - pciio_slot_t slot) -{ - pcibr_soft_t pcibr_soft; - pcibr_info_h pcibr_infoh; - pcibr_info_t pcibr_info; - devfs_handle_t conn_vhdl = GRAPH_VERTEX_NONE; - int nfunc; - int func; - - pcibr_soft = pcibr_soft_get(pcibr_vhdl); - if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) - return(0); - - nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; - pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; - - for (func = 0; func < nfunc; ++func) { - - pcibr_info = pcibr_infoh[func]; - if (!pcibr_info) - continue; - - if (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) - continue; - - conn_vhdl = pcibr_info->f_vertex; - if (is_sys_critical_vertex(conn_vhdl)) { -#if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING("%v is a system critical device vertex\n", conn_vhdl); -#else - PRINT_WARNING("%p is a system critical device vertex\n", conn_vhdl); -#endif - return(1); - } - - } - - return(0); -} - -/* - * pcibr_device_unregister - * This frees up any hardware resources reserved for this PCI device - * and removes any PCI infrastructural information setup for it. - * This is usually used at the time of shutting down of the PCI card. - */ -int -pcibr_device_unregister(devfs_handle_t pconn_vhdl) -{ - pciio_info_t pciio_info; - devfs_handle_t pcibr_vhdl; - pciio_slot_t slot; - pcibr_soft_t pcibr_soft; - bridge_t *bridge; - int error_call; - int error = 0; - - pciio_info = pciio_info_get(pconn_vhdl); - - pcibr_vhdl = pciio_info_master_get(pciio_info); - slot = pciio_info_slot_get(pciio_info); - - pcibr_soft = pcibr_soft_get(pcibr_vhdl); - bridge = pcibr_soft->bs_base; - - /* Clear all the hardware xtalk resources for this device */ - xtalk_widgetdev_shutdown(pcibr_soft->bs_conn, slot); - - /* Flush all the rrbs */ - pcibr_rrb_flush(pconn_vhdl); - - /* Free the rrbs allocated to this slot */ - error_call = do_pcibr_rrb_free(bridge, slot, - pcibr_soft->bs_rrb_valid[slot] + - pcibr_soft->bs_rrb_valid[slot + - PCIBR_RRB_SLOT_VIRTUAL]); - - if (error_call) - error = ERANGE; - - pcibr_soft->bs_rrb_valid[slot] = 0; - pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL] = 0; - pcibr_soft->bs_rrb_res[slot] = 0; - - /* Flush the write buffers !! */ - error_call = pcibr_wrb_flush(pconn_vhdl); - - if (error_call) - error = error_call; - - /* Clear the information specific to the slot */ - error_call = pcibr_slot_info_free(pcibr_vhdl, slot); - - if (error_call) - error = error_call; - - return(error); - -} - -/* - * build a convenience link path in the - * form of "...//bus/" - * - * returns 1 on success, 0 otherwise - * - * depends on hwgraph separator == '/' - */ -int -pcibr_bus_cnvlink(devfs_handle_t f_c, int slot) -{ - char dst[MAXDEVNAME]; - char *dp = dst; - char *cp, *xp; - int widgetnum; - char pcibus[8]; - devfs_handle_t nvtx, svtx; - int rv; - -#if DEBUG - printk("pcibr_bus_cnvlink: slot= %d f_c= %p\n", - slot, f_c); - { - int pos; - char dname[256]; - pos = devfs_generate_path(f_c, dname, 256); - printk("%s : path= %s\n", __FUNCTION__, &dname[pos]); - } -#endif - - if (GRAPH_SUCCESS != hwgraph_vertex_name_get(f_c, dst, MAXDEVNAME)) - return 0; - - /* dst example == /hw/module/001c02/Pbrick/xtalk/8/pci/direct */ - - /* find the widget number */ - xp = strstr(dst, "/"EDGE_LBL_XTALK"/"); - if (xp == NULL) - return 0; - widgetnum = atoi(xp+7); - if (widgetnum < XBOW_PORT_8 || widgetnum > XBOW_PORT_F) - return 0; - - /* remove "/pci/direct" from path */ - cp = strstr(dst, "/" EDGE_LBL_PCI "/" "direct"); - if (cp == NULL) - return 0; - *cp = (char)NULL; - - /* get the vertex for the widget */ - if (GRAPH_SUCCESS != hwgraph_traverse(NULL, dp, &svtx)) - return 0; - - *xp = (char)NULL; /* remove "/xtalk/..." from path */ - - /* dst example now == /hw/module/001c02/Pbrick */ - - /* get the bus number */ - strcat(dst, "/bus"); - sprintf(pcibus, "%d", p_busnum[widgetnum]); - - /* link to bus to widget */ - rv = hwgraph_path_add(NULL, dp, &nvtx); - if (GRAPH_SUCCESS == rv) - rv = hwgraph_edge_add(nvtx, svtx, pcibus); - - return (rv == GRAPH_SUCCESS); -} - - -/* - * pcibr_attach: called every time the crosstalk - * infrastructure is asked to initialize a widget - * that matches the part number we handed to the - * registration routine above. - */ -/*ARGSUSED */ -int -pcibr_attach(devfs_handle_t xconn_vhdl) -{ - /* REFERENCED */ - graph_error_t rc; - devfs_handle_t pcibr_vhdl; - devfs_handle_t ctlr_vhdl; - bridge_t *bridge = NULL; - bridgereg_t id; - int rev; - pcibr_soft_t pcibr_soft; - pcibr_info_t pcibr_info; - xwidget_info_t info; - xtalk_intr_t xtalk_intr; - device_desc_t dev_desc; - int slot; - int ibit; - devfs_handle_t noslot_conn; - char devnm[MAXDEVNAME], *s; - pcibr_hints_t pcibr_hints; - bridgereg_t b_int_enable; - unsigned rrb_fixed = 0; - - iopaddr_t pci_io_fb, pci_io_fl; - iopaddr_t pci_lo_fb, pci_lo_fl; - iopaddr_t pci_hi_fb, pci_hi_fl; - - int spl_level; -#ifdef LATER - char *nicinfo = (char *)0; -#endif - -#if PCI_FBBE - int fast_back_to_back_enable; -#endif - l1sc_t *scp; - nasid_t nasid; - - async_attach_t aa = NULL; - - aa = async_attach_get_info(xconn_vhdl); - -#if DEBUG && ATTACH_DEBUG - printk("pcibr_attach: xconn_vhdl= %p\n", xconn_vhdl); - { - int pos; - char dname[256]; - pos = devfs_generate_path(xconn_vhdl, dname, 256); - printk("%s : path= %s \n", __FUNCTION__, &dname[pos]); - } -#endif - - /* Setup the PRB for the bridge in CONVEYOR BELT - * mode. PRBs are setup in default FIRE-AND-FORGET - * mode during the initialization. - */ - hub_device_flags_set(xconn_vhdl, HUB_PIO_CONVEYOR); - - bridge = (bridge_t *) - xtalk_piotrans_addr(xconn_vhdl, NULL, - 0, sizeof(bridge_t), 0); - -#ifndef MEDUSA_HACK - if ((bridge->b_wid_stat & BRIDGE_STAT_PCI_GIO_N) == 0) - return -1; /* someone else handles GIO bridges. */ -#endif - -#ifdef BRINGUP - if (XWIDGET_PART_REV_NUM(bridge->b_wid_id) == XBRIDGE_PART_REV_A) - NeedXbridgeSwap = 1; -#endif - - /* - * Create the vertex for the PCI bus, which we - * will also use to hold the pcibr_soft and - * which will be the "master" vertex for all the - * pciio connection points we will hang off it. - * This needs to happen before we call nic_bridge_vertex_info - * as we are some of the *_vmc functions need access to the edges. - * - * Opening this vertex will provide access to - * the Bridge registers themselves. - */ - rc = hwgraph_path_add(xconn_vhdl, EDGE_LBL_PCI, &pcibr_vhdl); - ASSERT(rc == GRAPH_SUCCESS); - - ctlr_vhdl = NULL; - ctlr_vhdl = hwgraph_register(pcibr_vhdl, EDGE_LBL_CONTROLLER, - 0, DEVFS_FL_AUTO_DEVNUM, - 0, 0, - S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, 0, 0, - &pcibr_fops, NULL); - - ASSERT(ctlr_vhdl != NULL); - - /* - * decode the nic, and hang its stuff off our - * connection point where other drivers can get - * at it. - */ -#ifdef LATER - nicinfo = BRIDGE_VERTEX_MFG_INFO(xconn_vhdl, (nic_data_t) & bridge->b_nic); -#endif - - /* - * Get the hint structure; if some NIC callback - * marked this vertex as "hands-off" then we - * just return here, before doing anything else. - */ - pcibr_hints = pcibr_hints_get(xconn_vhdl, 0); - - if (pcibr_hints && pcibr_hints->ph_hands_off) - return -1; /* generic operations disabled */ - - id = bridge->b_wid_id; - rev = XWIDGET_PART_REV_NUM(id); - - hwgraph_info_add_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, (arbitrary_info_t) rev); - - /* - * allocate soft state structure, fill in some - * fields, and hook it up to our vertex. - */ - NEW(pcibr_soft); - BZERO(pcibr_soft, sizeof *pcibr_soft); - pcibr_soft_set(pcibr_vhdl, pcibr_soft); - - pcibr_soft->bs_conn = xconn_vhdl; - pcibr_soft->bs_vhdl = pcibr_vhdl; - pcibr_soft->bs_base = bridge; - pcibr_soft->bs_rev_num = rev; - pcibr_soft->bs_intr_bits = pcibr_intr_bits; - if (is_xbridge(bridge)) { - pcibr_soft->bs_int_ate_size = XBRIDGE_INTERNAL_ATES; - pcibr_soft->bs_xbridge = 1; - } else { - pcibr_soft->bs_int_ate_size = BRIDGE_INTERNAL_ATES; - pcibr_soft->bs_xbridge = 0; - } - - nasid = NASID_GET(bridge); - scp = &NODEPDA( NASID_TO_COMPACT_NODEID(nasid) )->module->elsc; - pcibr_soft->bs_l1sc = scp; - pcibr_soft->bs_moduleid = iobrick_module_get(scp); - pcibr_soft->bsi_err_intr = 0; - - /* Bridges up through REV C - * are unable to set the direct - * byteswappers to BYTE_STREAM. - */ - if (pcibr_soft->bs_rev_num <= BRIDGE_PART_REV_C) { - pcibr_soft->bs_pio_end_io = PCIIO_WORD_VALUES; - pcibr_soft->bs_pio_end_mem = PCIIO_WORD_VALUES; - } -#if PCIBR_SOFT_LIST - { - pcibr_list_p self; - - NEW(self); - self->bl_soft = pcibr_soft; - self->bl_vhdl = pcibr_vhdl; - self->bl_next = pcibr_list; - self->bl_next = swap_ptr((void **) &pcibr_list, (void *)self); - } -#endif - - /* - * get the name of this bridge vertex and keep the info. Use this - * only where it is really needed now: like error interrupts. - */ - s = dev_to_name(pcibr_vhdl, devnm, MAXDEVNAME); - pcibr_soft->bs_name = kmalloc(strlen(s) + 1, GFP_KERNEL); - strcpy(pcibr_soft->bs_name, s); - -#if SHOW_REVS || DEBUG -#if !DEBUG - if (kdebug) -#endif - printk("%sBridge ASIC: rev %s (code=0x%x) at %s\n", - is_xbridge(bridge) ? "X" : "", - (rev == BRIDGE_PART_REV_A) ? "A" : - (rev == BRIDGE_PART_REV_B) ? "B" : - (rev == BRIDGE_PART_REV_C) ? "C" : - (rev == BRIDGE_PART_REV_D) ? "D" : - (rev == XBRIDGE_PART_REV_A) ? "A" : - (rev == XBRIDGE_PART_REV_B) ? "B" : - "unknown", - rev, pcibr_soft->bs_name); -#endif - - info = xwidget_info_get(xconn_vhdl); - pcibr_soft->bs_xid = xwidget_info_id_get(info); - pcibr_soft->bs_master = xwidget_info_master_get(info); - pcibr_soft->bs_mxid = xwidget_info_masterid_get(info); - - /* - * Init bridge lock. - */ - spin_lock_init(&pcibr_soft->bs_lock); - - /* - * If we have one, process the hints structure. - */ - if (pcibr_hints) { - rrb_fixed = pcibr_hints->ph_rrb_fixed; - - pcibr_soft->bs_rrb_fixed = rrb_fixed; - - if (pcibr_hints->ph_intr_bits) - pcibr_soft->bs_intr_bits = pcibr_hints->ph_intr_bits; - - for (slot = 0; slot < 8; ++slot) { - int hslot = pcibr_hints->ph_host_slot[slot] - 1; - - if (hslot < 0) { - pcibr_soft->bs_slot[slot].host_slot = slot; - } else { - pcibr_soft->bs_slot[slot].has_host = 1; - pcibr_soft->bs_slot[slot].host_slot = hslot; - } - } - } - /* - * set up initial values for state fields - */ - for (slot = 0; slot < 8; ++slot) { - pcibr_soft->bs_slot[slot].bss_devio.bssd_space = PCIIO_SPACE_NONE; - pcibr_soft->bs_slot[slot].bss_d64_base = PCIBR_D64_BASE_UNSET; - pcibr_soft->bs_slot[slot].bss_d32_base = PCIBR_D32_BASE_UNSET; - pcibr_soft->bs_slot[slot].bss_ext_ates_active = ATOMIC_INIT(0); - } - - for (ibit = 0; ibit < 8; ++ibit) { - pcibr_soft->bs_intr[ibit].bsi_xtalk_intr = 0; - pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_soft = pcibr_soft; - pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_list = NULL; - pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_stat = - &(bridge->b_int_status); - pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_hdlrcnt = 0; - pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_shared = 0; - pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_connected = 0; - } - - /* - * connect up our error handler - */ - xwidget_error_register(xconn_vhdl, pcibr_error_handler, pcibr_soft); - - /* - * Initialize various Bridge registers. - */ - - /* - * On pre-Rev.D bridges, set the PCI_RETRY_CNT - * to zero to avoid dropping stores. (#475347) - */ - if (rev < BRIDGE_PART_REV_D) - bridge->b_bus_timeout &= ~BRIDGE_BUS_PCI_RETRY_MASK; - - /* - * Clear all pending interrupts. - */ - bridge->b_int_rst_stat = (BRIDGE_IRR_ALL_CLR); - - /* - * Until otherwise set up, - * assume all interrupts are - * from slot 7. - */ - bridge->b_int_device = (uint32_t) 0xffffffff; - - { - bridgereg_t dirmap; - paddr_t paddr; - iopaddr_t xbase; - xwidgetnum_t xport; - iopaddr_t offset; - int num_entries = 0; - int entry; - cnodeid_t cnodeid; - nasid_t nasid; - char *node_val; - devfs_handle_t node_vhdl; - char vname[MAXDEVNAME]; - - /* Set the Bridge's 32-bit PCI to XTalk - * Direct Map register to the most useful - * value we can determine. Note that we - * must use a single xid for all of: - * direct-mapped 32-bit DMA accesses - * direct-mapped 64-bit DMA accesses - * DMA accesses through the PMU - * interrupts - * This is the only way to guarantee that - * completion interrupts will reach a CPU - * after all DMA data has reached memory. - * (Of course, there may be a few special - * drivers/controllers that explicitly manage - * this ordering problem.) - */ - - cnodeid = 0; /* default node id */ - /* - * Determine the base address node id to be used for all 32-bit - * Direct Mapping I/O. The default is node 0, but this can be changed - * via a DEVICE_ADMIN directive and the PCIBUS_DMATRANS_NODE - * attribute in the irix.sm config file. A device driver can obtain - * this node value via a call to pcibr_get_dmatrans_node(). - */ - node_val = device_admin_info_get(pcibr_vhdl, ADMIN_LBL_DMATRANS_NODE); - if (node_val != NULL) { - node_vhdl = hwgraph_path_to_vertex(node_val); - if (node_vhdl != GRAPH_VERTEX_NONE) { - cnodeid = nodevertex_to_cnodeid(node_vhdl); - } - if ((node_vhdl == GRAPH_VERTEX_NONE) || (cnodeid == CNODEID_NONE)) { - cnodeid = 0; - vertex_to_name(pcibr_vhdl, vname, sizeof(vname)); - PRINT_WARNING( "Invalid hwgraph node path specified:\n DEVICE_ADMIN: %s %s=%s\n", - vname, ADMIN_LBL_DMATRANS_NODE, node_val); - } - } - nasid = COMPACT_TO_NASID_NODEID(cnodeid); - paddr = NODE_OFFSET(nasid) + 0; - - /* currently, we just assume that if we ask - * for a DMA mapping to "zero" the XIO - * host will transmute this into a request - * for the lowest hunk of memory. - */ - xbase = xtalk_dmatrans_addr(xconn_vhdl, 0, - paddr, _PAGESZ, 0); - - if (xbase != XIO_NOWHERE) { - if (XIO_PACKED(xbase)) { - xport = XIO_PORT(xbase); - xbase = XIO_ADDR(xbase); - } else - xport = pcibr_soft->bs_mxid; - - offset = xbase & ((1ull << BRIDGE_DIRMAP_OFF_ADDRSHFT) - 1ull); - xbase >>= BRIDGE_DIRMAP_OFF_ADDRSHFT; - - dirmap = xport << BRIDGE_DIRMAP_W_ID_SHFT; - - if (xbase) - dirmap |= BRIDGE_DIRMAP_OFF & xbase; - else if (offset >= (512 << 20)) - dirmap |= BRIDGE_DIRMAP_ADD512; - - bridge->b_dir_map = dirmap; - } - /* - * Set bridge's idea of page size according to the system's - * idea of "IO page size". TBD: The idea of IO page size - * should really go away. - */ - /* - * ensure that we write and read without any interruption. - * The read following the write is required for the Bridge war - */ - spl_level = splhi(); -#if IOPGSIZE == 4096 - bridge->b_wid_control &= ~BRIDGE_CTRL_PAGE_SIZE; -#elif IOPGSIZE == 16384 - bridge->b_wid_control |= BRIDGE_CTRL_PAGE_SIZE; -#else - <<>>; -#endif - bridge->b_wid_control; /* inval addr bug war */ - splx(spl_level); - - /* Initialize internal mapping entries */ - for (entry = 0; entry < pcibr_soft->bs_int_ate_size; entry++) - bridge->b_int_ate_ram[entry].wr = 0; - - /* - * Determine if there's external mapping SSRAM on this - * bridge. Set up Bridge control register appropriately, - * inititlize SSRAM, and set software up to manage RAM - * entries as an allocatable resource. - * - * Currently, we just use the rm* routines to manage ATE - * allocation. We should probably replace this with a - * Best Fit allocator. - * - * For now, if we have external SSRAM, avoid using - * the internal ssram: we can't turn PREFETCH on - * when we use the internal SSRAM; and besides, - * this also guarantees that no allocation will - * straddle the internal/external line, so we - * can increment ATE write addresses rather than - * recomparing against BRIDGE_INTERNAL_ATES every - * time. - */ - if (is_xbridge(bridge)) - num_entries = 0; - else - num_entries = pcibr_init_ext_ate_ram(bridge); - - /* we always have 128 ATEs (512 for Xbridge) inside the chip - * even if disabled for debugging. - */ - pcibr_soft->bs_int_ate_map = rmallocmap(pcibr_soft->bs_int_ate_size); - pcibr_ate_free(pcibr_soft, 0, pcibr_soft->bs_int_ate_size); -#if PCIBR_ATE_DEBUG - printk("pcibr_attach: %d INTERNAL ATEs\n", pcibr_soft->bs_int_ate_size); -#endif - - if (num_entries > pcibr_soft->bs_int_ate_size) { -#if PCIBR_ATE_NOTBOTH /* for debug -- forces us to use external ates */ - printk("pcibr_attach: disabling internal ATEs.\n"); - pcibr_ate_alloc(pcibr_soft, pcibr_soft->bs_int_ate_size); -#endif - pcibr_soft->bs_ext_ate_map = rmallocmap(num_entries); - pcibr_ate_free(pcibr_soft, pcibr_soft->bs_int_ate_size, - num_entries - pcibr_soft->bs_int_ate_size); -#if PCIBR_ATE_DEBUG - printk("pcibr_attach: %d EXTERNAL ATEs\n", - num_entries - pcibr_soft->bs_int_ate_size); -#endif - } - } - - { - bridgereg_t dirmap; - iopaddr_t xbase; - - /* - * now figure the *real* xtalk base address - * that dirmap sends us to. - */ - dirmap = bridge->b_dir_map; - if (dirmap & BRIDGE_DIRMAP_OFF) - xbase = (iopaddr_t)(dirmap & BRIDGE_DIRMAP_OFF) - << BRIDGE_DIRMAP_OFF_ADDRSHFT; - else if (dirmap & BRIDGE_DIRMAP_ADD512) - xbase = 512 << 20; - else - xbase = 0; - - pcibr_soft->bs_dir_xbase = xbase; - - /* it is entirely possible that we may, at this - * point, have our dirmap pointing somewhere - * other than our "master" port. - */ - pcibr_soft->bs_dir_xport = - (dirmap & BRIDGE_DIRMAP_W_ID) >> BRIDGE_DIRMAP_W_ID_SHFT; - } - - /* pcibr sources an error interrupt; - * figure out where to send it. - * - * If any interrupts are enabled in bridge, - * then the prom set us up and our interrupt - * has already been reconnected in mlreset - * above. - * - * Need to set the D_INTR_ISERR flag - * in the dev_desc used for allocating the - * error interrupt, so our interrupt will - * be properly routed and prioritized. - * - * If our crosstalk provider wants to - * fix widget error interrupts to specific - * destinations, D_INTR_ISERR is how it - * knows to do this. - */ - - dev_desc = device_desc_dup(pcibr_vhdl); - device_desc_flags_set(dev_desc, - device_desc_flags_get(dev_desc) | D_INTR_ISERR); - device_desc_intr_name_set(dev_desc, "Bridge error"); - - xtalk_intr = xtalk_intr_alloc(xconn_vhdl, dev_desc, pcibr_vhdl); - ASSERT(xtalk_intr != NULL); - - device_desc_free(dev_desc); - - pcibr_soft->bsi_err_intr = xtalk_intr; - - /* - * On IP35 with XBridge, we do some extra checks in pcibr_setwidint - * in order to work around some addressing limitations. In order - * for that fire wall to work properly, we need to make sure we - * start from a known clean state. - */ - pcibr_clearwidint(bridge); - - xtalk_intr_connect(xtalk_intr, - (intr_func_t) pcibr_error_intr_handler, - (intr_arg_t) pcibr_soft, - (xtalk_intr_setfunc_t) pcibr_setwidint, - (void *) bridge, - (void *) 0); - - /* - * now we can start handling error interrupts; - * enable all of them. - * NOTE: some PCI ints may already be enabled. - */ - b_int_enable = bridge->b_int_enable | BRIDGE_ISR_ERRORS; - - - bridge->b_int_enable = b_int_enable; - bridge->b_int_mode = 0; /* do not send "clear interrupt" packets */ - - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - - /* - * Depending on the rev of bridge, disable certain features. - * Easiest way seems to be to force the PCIBR_NOwhatever - * flag to be on for all DMA calls, which overrides any - * PCIBR_whatever flag or even the setting of whatever - * from the PCIIO_DMA_class flags (or even from the other - * PCIBR flags, since NO overrides YES). - */ - pcibr_soft->bs_dma_flags = 0; - - /* PREFETCH: - * Always completely disabled for REV.A; - * at "pcibr_prefetch_enable_rev", anyone - * asking for PCIIO_PREFETCH gets it. - * Between these two points, you have to ask - * for PCIBR_PREFETCH, which promises that - * your driver knows about known Bridge WARs. - */ - if (pcibr_soft->bs_rev_num < BRIDGE_PART_REV_B) - pcibr_soft->bs_dma_flags |= PCIBR_NOPREFETCH; - else if (pcibr_soft->bs_rev_num < - (BRIDGE_WIDGET_PART_NUM << 4 | pcibr_prefetch_enable_rev)) - pcibr_soft->bs_dma_flags |= PCIIO_NOPREFETCH; - - /* WRITE_GATHER: - * Disabled up to but not including the - * rev number in pcibr_wg_enable_rev. There - * is no "WAR range" as with prefetch. - */ - if (pcibr_soft->bs_rev_num < - (BRIDGE_WIDGET_PART_NUM << 4 | pcibr_wg_enable_rev)) - pcibr_soft->bs_dma_flags |= PCIBR_NOWRITE_GATHER; - - pciio_provider_register(pcibr_vhdl, &pcibr_provider); - pciio_provider_startup(pcibr_vhdl); - - pci_io_fb = 0x00000004; /* I/O FreeBlock Base */ - pci_io_fl = 0xFFFFFFFF; /* I/O FreeBlock Last */ - - pci_lo_fb = 0x00000010; /* Low Memory FreeBlock Base */ - pci_lo_fl = 0x001FFFFF; /* Low Memory FreeBlock Last */ - - pci_hi_fb = 0x00200000; /* High Memory FreeBlock Base */ - pci_hi_fl = 0x3FFFFFFF; /* High Memory FreeBlock Last */ - - - PCI_ADDR_SPACE_LIMITS_STORE(); - - /* build "no-slot" connection point - */ - pcibr_info = pcibr_device_info_new - (pcibr_soft, PCIIO_SLOT_NONE, PCIIO_FUNC_NONE, - PCIIO_VENDOR_ID_NONE, PCIIO_DEVICE_ID_NONE); - noslot_conn = pciio_device_info_register - (pcibr_vhdl, &pcibr_info->f_c); - - /* Remember the no slot connection point info for tearing it - * down during detach. - */ - pcibr_soft->bs_noslot_conn = noslot_conn; - pcibr_soft->bs_noslot_info = pcibr_info; -#if PCI_FBBE - fast_back_to_back_enable = 1; -#endif - -#if PCI_FBBE - if (fast_back_to_back_enable) { - /* - * All devices on the bus are capable of fast back to back, so - * we need to set the fast back to back bit in all devices on - * the bus that are capable of doing such accesses. - */ - } -#endif - -#ifdef LATER - /* If the bridge has been reset then there is no need to reset - * the individual PCI slots. - */ - for (slot = 0; slot < 8; ++slot) - /* Reset all the slots */ - (void)pcibr_slot_reset(pcibr_vhdl, slot); -#endif - - for (slot = 0; slot < 8; ++slot) - /* Find out what is out there */ - (void)pcibr_slot_info_init(pcibr_vhdl,slot); - - for (slot = 0; slot < 8; ++slot) - /* Set up the address space for this slot in the pci land */ - (void)pcibr_slot_addr_space_init(pcibr_vhdl,slot); - - for (slot = 0; slot < 8; ++slot) - /* Setup the device register */ - (void)pcibr_slot_device_init(pcibr_vhdl, slot); - -#ifndef __ia64 -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) - for (slot = 0; slot < 8; ++slot) - /* Set up convenience links */ - if (is_xbridge(bridge)) - if (pcibr_soft->bs_slot[slot].bss_ninfo > 0) /* if occupied */ - pcibr_bus_cnvlink(pcibr_info->f_vertex, slot); -#endif -#endif - - for (slot = 0; slot < 8; ++slot) - /* Setup host/guest relations */ - (void)pcibr_slot_guest_info_init(pcibr_vhdl,slot); - - for (slot = 0; slot < 8; ++slot) - /* Initial RRB management */ - (void)pcibr_slot_initial_rrb_alloc(pcibr_vhdl,slot); - - /* driver attach routines should be called out from generic linux code */ - for (slot = 0; slot < 8; ++slot) - /* Call the device attach */ - (void)pcibr_slot_call_device_attach(pcibr_vhdl, slot, 0); - - /* - * Each Pbrick PCI bus only has slots 1 and 2. Similarly for - * widget 0xe on Ibricks. Allocate RRB's accordingly. - */ - if (pcibr_soft->bs_moduleid > 0) { - switch (MODULE_GET_BTCHAR(pcibr_soft->bs_moduleid)) { - case 'p': /* Pbrick */ - do_pcibr_rrb_autoalloc(pcibr_soft, 1, 8); - do_pcibr_rrb_autoalloc(pcibr_soft, 2, 8); - break; - case 'i': /* Ibrick */ - /* port 0xe on the Ibrick only has slots 1 and 2 */ - if (pcibr_soft->bs_xid == 0xe) { - do_pcibr_rrb_autoalloc(pcibr_soft, 1, 8); - do_pcibr_rrb_autoalloc(pcibr_soft, 2, 8); - } - else { - /* allocate one RRB for the serial port */ - do_pcibr_rrb_autoalloc(pcibr_soft, 0, 1); - } - break; - } /* switch */ - } - -#ifdef LATER - if (strstr(nicinfo, XTALK_PCI_PART_NUM)) { - do_pcibr_rrb_autoalloc(pcibr_soft, 1, 8); -#if PCIBR_RRB_DEBUG - printf("\n\nFound XTALK_PCI (030-1275) at %v\n", xconn_vhdl); - - printf("pcibr_attach: %v Shoebox RRB MANAGEMENT: %d+%d free\n", - pcibr_vhdl, - pcibr_soft->bs_rrb_avail[0], - pcibr_soft->bs_rrb_avail[1]); - - for (slot = 0; slot < 8; ++slot) - printf("\t%d+%d+%d", - 0xFFF & pcibr_soft->bs_rrb_valid[slot], - 0xFFF & pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL], - pcibr_soft->bs_rrb_res[slot]); - - printf("\n"); -#endif - } -#else - FIXME("pcibr_attach: Call do_pcibr_rrb_autoalloc nicinfo\n"); -#endif - - if (aa) - async_attach_add_info(noslot_conn, aa); - - pciio_device_attach(noslot_conn, 0); - - - /* - * Tear down pointer to async attach info -- async threads for - * bridge's descendants may be running but the bridge's work is done. - */ - if (aa) - async_attach_del_info(xconn_vhdl); - - return 0; -} -/* - * pcibr_detach: - * Detach the bridge device from the hwgraph after cleaning out all the - * underlying vertices. - */ -int -pcibr_detach(devfs_handle_t xconn) -{ - pciio_slot_t slot; - devfs_handle_t pcibr_vhdl; - pcibr_soft_t pcibr_soft; - bridge_t *bridge; - - /* Get the bridge vertex from its xtalk connection point */ - if (hwgraph_traverse(xconn, EDGE_LBL_PCI, &pcibr_vhdl) != GRAPH_SUCCESS) - return(1); - - pcibr_soft = pcibr_soft_get(pcibr_vhdl); - bridge = pcibr_soft->bs_base; - - /* Disable the interrupts from the bridge */ - bridge->b_int_enable = 0; - - /* Detach all the PCI devices talking to this bridge */ - for(slot = 0; slot < 8; slot++) { -#ifdef DEBUG - printk("pcibr_device_detach called for %p/%d\n", - pcibr_vhdl,slot); -#endif - pcibr_slot_detach(pcibr_vhdl, slot, 0); - } - - /* Unregister the no-slot connection point */ - pciio_device_info_unregister(pcibr_vhdl, - &(pcibr_soft->bs_noslot_info->f_c)); - - spin_lock_destroy(&pcibr_soft->bs_lock); - kfree(pcibr_soft->bs_name); - - /* Error handler gets unregistered when the widget info is - * cleaned - */ - /* Free the soft ATE maps */ - if (pcibr_soft->bs_int_ate_map) - rmfreemap(pcibr_soft->bs_int_ate_map); - if (pcibr_soft->bs_ext_ate_map) - rmfreemap(pcibr_soft->bs_ext_ate_map); - - /* Disconnect the error interrupt and free the xtalk resources - * associated with it. - */ - xtalk_intr_disconnect(pcibr_soft->bsi_err_intr); - xtalk_intr_free(pcibr_soft->bsi_err_intr); - - /* Clear the software state maintained by the bridge driver for this - * bridge. - */ - DEL(pcibr_soft); - /* Remove the Bridge revision labelled info */ - (void)hwgraph_info_remove_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, NULL); - /* Remove the character device associated with this bridge */ - (void)hwgraph_edge_remove(pcibr_vhdl, EDGE_LBL_CONTROLLER, NULL); - /* Remove the PCI bridge vertex */ - (void)hwgraph_edge_remove(xconn, EDGE_LBL_PCI, NULL); - - return(0); -} - -int -pcibr_asic_rev(devfs_handle_t pconn_vhdl) -{ - devfs_handle_t pcibr_vhdl; - arbitrary_info_t ainfo; - - if (GRAPH_SUCCESS != - hwgraph_traverse(pconn_vhdl, EDGE_LBL_MASTER, &pcibr_vhdl)) - return -1; - - if (GRAPH_SUCCESS != - hwgraph_info_get_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, &ainfo)) - return -1; - - return (int) ainfo; -} - -int -pcibr_write_gather_flush(devfs_handle_t pconn_vhdl) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - pciio_slot_t slot; - slot = pciio_info_slot_get(pciio_info); - pcibr_device_write_gather_flush(pcibr_soft, slot); - return 0; -} - -/* ===================================================================== - * PIO MANAGEMENT - */ - -LOCAL iopaddr_t -pcibr_addr_pci_to_xio(devfs_handle_t pconn_vhdl, - pciio_slot_t slot, - pciio_space_t space, - iopaddr_t pci_addr, - size_t req_size, - unsigned flags) -{ - pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); - pciio_info_t pciio_info = &pcibr_info->f_c; - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - bridge_t *bridge = pcibr_soft->bs_base; - - unsigned bar; /* which BASE reg on device is decoding */ - iopaddr_t xio_addr = XIO_NOWHERE; - - pciio_space_t wspace; /* which space device is decoding */ - iopaddr_t wbase; /* base of device decode on PCI */ - size_t wsize; /* size of device decode on PCI */ - - int try; /* DevIO(x) window scanning order control */ - int win; /* which DevIO(x) window is being used */ - pciio_space_t mspace; /* target space for devio(x) register */ - iopaddr_t mbase; /* base of devio(x) mapped area on PCI */ - size_t msize; /* size of devio(x) mapped area on PCI */ - size_t mmask; /* addr bits stored in Device(x) */ - - unsigned long s; - - s = pcibr_lock(pcibr_soft); - - if (pcibr_soft->bs_slot[slot].has_host) { - slot = pcibr_soft->bs_slot[slot].host_slot; - pcibr_info = pcibr_soft->bs_slot[slot].bss_infos[0]; - } - if (space == PCIIO_SPACE_NONE) - goto done; - - if (space == PCIIO_SPACE_CFG) { - /* - * Usually, the first mapping - * established to a PCI device - * is to its config space. - * - * In any case, we definitely - * do NOT need to worry about - * PCI BASE registers, and - * MUST NOT attempt to point - * the DevIO(x) window at - * this access ... - */ - if (((flags & PCIIO_BYTE_STREAM) == 0) && - ((pci_addr + req_size) <= BRIDGE_TYPE0_CFG_FUNC_OFF)) - xio_addr = pci_addr + BRIDGE_TYPE0_CFG_DEV(slot); - - goto done; - } - if (space == PCIIO_SPACE_ROM) { - /* PIO to the Expansion Rom. - * Driver is responsible for - * enabling and disabling - * decodes properly. - */ - wbase = pcibr_info->f_rbase; - wsize = pcibr_info->f_rsize; - - /* - * While the driver should know better - * than to attempt to map more space - * than the device is decoding, he might - * do it; better to bail out here. - */ - if ((pci_addr + req_size) > wsize) - goto done; - - pci_addr += wbase; - space = PCIIO_SPACE_MEM; - } - /* - * reduce window mappings to raw - * space mappings (maybe allocating - * windows), and try for DevIO(x) - * usage (setting it if it is available). - */ - bar = space - PCIIO_SPACE_WIN0; - if (bar < 6) { - wspace = pcibr_info->f_window[bar].w_space; - if (wspace == PCIIO_SPACE_NONE) - goto done; - - /* get PCI base and size */ - wbase = pcibr_info->f_window[bar].w_base; - wsize = pcibr_info->f_window[bar].w_size; - - /* - * While the driver should know better - * than to attempt to map more space - * than the device is decoding, he might - * do it; better to bail out here. - */ - if ((pci_addr + req_size) > wsize) - goto done; - - /* shift from window relative to - * decoded space relative. - */ - pci_addr += wbase; - space = wspace; - } else - bar = -1; - - /* Scan all the DevIO(x) windows twice looking for one - * that can satisfy our request. The first time through, - * only look at assigned windows; the second time, also - * look at PCIIO_SPACE_NONE windows. Arrange the order - * so we always look at our own window first. - * - * We will not attempt to satisfy a single request - * by concatinating multiple windows. - */ - for (try = 0; try < 16; ++try) { - bridgereg_t devreg; - unsigned offset; - - win = (try + slot) % 8; - - /* If this DevIO(x) mapping area can provide - * a mapping to this address, use it. - */ - msize = (win < 2) ? 0x200000 : 0x100000; - mmask = -msize; - if (space != PCIIO_SPACE_IO) - mmask &= 0x3FFFFFFF; - - offset = pci_addr & (msize - 1); - - /* If this window can't possibly handle that request, - * go on to the next window. - */ - if (((pci_addr & (msize - 1)) + req_size) > msize) - continue; - - devreg = pcibr_soft->bs_slot[win].bss_device; - - /* Is this window "nailed down"? - * If not, maybe we can use it. - * (only check this the second time through) - */ - mspace = pcibr_soft->bs_slot[win].bss_devio.bssd_space; - if ((try > 7) && (mspace == PCIIO_SPACE_NONE)) { - - /* If this is the primary DevIO(x) window - * for some other device, skip it. - */ - if ((win != slot) && - (PCIIO_VENDOR_ID_NONE != - pcibr_soft->bs_slot[win].bss_vendor_id)) - continue; - - /* It's a free window, and we fit in it. - * Set up Device(win) to our taste. - */ - mbase = pci_addr & mmask; - - /* check that we would really get from - * here to there. - */ - if ((mbase | offset) != pci_addr) - continue; - - devreg &= ~BRIDGE_DEV_OFF_MASK; - if (space != PCIIO_SPACE_IO) - devreg |= BRIDGE_DEV_DEV_IO_MEM; - else - devreg &= ~BRIDGE_DEV_DEV_IO_MEM; - devreg |= (mbase >> 20) & BRIDGE_DEV_OFF_MASK; - - /* default is WORD_VALUES. - * if you specify both, - * operation is undefined. - */ - if (flags & PCIIO_BYTE_STREAM) - devreg |= BRIDGE_DEV_DEV_SWAP; - else - devreg &= ~BRIDGE_DEV_DEV_SWAP; - - if (pcibr_soft->bs_slot[win].bss_device != devreg) { - bridge->b_device[win].reg = devreg; - pcibr_soft->bs_slot[win].bss_device = devreg; - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - -#if DEBUG && PCI_DEBUG - printk("pcibr Device(%d): 0x%lx\n", win, bridge->b_device[win].reg); -#endif - } - pcibr_soft->bs_slot[win].bss_devio.bssd_space = space; - pcibr_soft->bs_slot[win].bss_devio.bssd_base = mbase; - xio_addr = BRIDGE_DEVIO(win) + (pci_addr - mbase); - -#if DEBUG && PCI_DEBUG - printk("%s LINE %d map to space %d space desc 0x%x[%lx..%lx] for slot %d allocates DevIO(%d) devreg 0x%x\n", - __FUNCTION__, __LINE__, space, space_desc, - pci_addr, pci_addr + req_size - 1, - slot, win, devreg); -#endif - - goto done; - } /* endif DevIO(x) not pointed */ - mbase = pcibr_soft->bs_slot[win].bss_devio.bssd_base; - - /* Now check for request incompat with DevIO(x) - */ - if ((mspace != space) || - (pci_addr < mbase) || - ((pci_addr + req_size) > (mbase + msize)) || - ((flags & PCIIO_BYTE_STREAM) && !(devreg & BRIDGE_DEV_DEV_SWAP)) || - (!(flags & PCIIO_BYTE_STREAM) && (devreg & BRIDGE_DEV_DEV_SWAP))) - continue; - - /* DevIO(x) window is pointed at PCI space - * that includes our target. Calculate the - * final XIO address, release the lock and - * return. - */ - xio_addr = BRIDGE_DEVIO(win) + (pci_addr - mbase); - -#if DEBUG && PCI_DEBUG - printk("%s LINE %d map to space %d [0x%p..0x%p] for slot %d uses DevIO(%d)\n", - __FUNCTION__, __LINE__, space, pci_addr, pci_addr + req_size - 1, slot, win); -#endif - goto done; - } - - switch (space) { - /* - * Accesses to device decode - * areas that do a not fit - * within the DevIO(x) space are - * modified to be accesses via - * the direct mapping areas. - * - * If necessary, drivers can - * explicitly ask for mappings - * into these address spaces, - * but this should never be needed. - */ - case PCIIO_SPACE_MEM: /* "mem space" */ - case PCIIO_SPACE_MEM32: /* "mem, use 32-bit-wide bus" */ - if ((pci_addr + BRIDGE_PCI_MEM32_BASE + req_size - 1) <= - BRIDGE_PCI_MEM32_LIMIT) - xio_addr = pci_addr + BRIDGE_PCI_MEM32_BASE; - break; - - case PCIIO_SPACE_MEM64: /* "mem, use 64-bit-wide bus" */ - if ((pci_addr + BRIDGE_PCI_MEM64_BASE + req_size - 1) <= - BRIDGE_PCI_MEM64_LIMIT) - xio_addr = pci_addr + BRIDGE_PCI_MEM64_BASE; - break; - - case PCIIO_SPACE_IO: /* "i/o space" */ - /* Bridge Hardware Bug WAR #482741: - * The 4G area that maps directly from - * XIO space to PCI I/O space is busted - * until Bridge Rev D. - */ - if ((pcibr_soft->bs_rev_num > BRIDGE_PART_REV_C) && - ((pci_addr + BRIDGE_PCI_IO_BASE + req_size - 1) <= - BRIDGE_PCI_IO_LIMIT)) - xio_addr = pci_addr + BRIDGE_PCI_IO_BASE; - break; - } - - /* Check that "Direct PIO" byteswapping matches, - * try to change it if it does not. - */ - if (xio_addr != XIO_NOWHERE) { - unsigned bst; /* nonzero to set bytestream */ - unsigned *bfp; /* addr of record of how swapper is set */ - unsigned swb; /* which control bit to mung */ - unsigned bfo; /* current swapper setting */ - unsigned bfn; /* desired swapper setting */ - - bfp = ((space == PCIIO_SPACE_IO) - ? (&pcibr_soft->bs_pio_end_io) - : (&pcibr_soft->bs_pio_end_mem)); - - bfo = *bfp; - - bst = flags & PCIIO_BYTE_STREAM; - - bfn = bst ? PCIIO_BYTE_STREAM : PCIIO_WORD_VALUES; - - if (bfn == bfo) { /* we already match. */ - ; - } else if (bfo != 0) { /* we have a conflict. */ -#if DEBUG && PCI_DEBUG - printk("pcibr_addr_pci_to_xio: swap conflict in space %d , was%s%s, want%s%s\n", - space, - bfo & PCIIO_BYTE_STREAM ? " BYTE_STREAM" : "", - bfo & PCIIO_WORD_VALUES ? " WORD_VALUES" : "", - bfn & PCIIO_BYTE_STREAM ? " BYTE_STREAM" : "", - bfn & PCIIO_WORD_VALUES ? " WORD_VALUES" : ""); -#endif - xio_addr = XIO_NOWHERE; - } else { /* OK to make the change. */ - bridgereg_t octl, nctl; - - swb = (space == PCIIO_SPACE_IO) ? BRIDGE_CTRL_IO_SWAP : BRIDGE_CTRL_MEM_SWAP; - octl = bridge->b_wid_control; - nctl = bst ? octl | swb : octl & ~swb; - - if (octl != nctl) /* make the change if any */ - bridge->b_wid_control = nctl; - - *bfp = bfn; /* record the assignment */ - -#if DEBUG && PCI_DEBUG - printk("pcibr_addr_pci_to_xio: swap for space %d set to%s%s\n", - space, - bfn & PCIIO_BYTE_STREAM ? " BYTE_STREAM" : "", - bfn & PCIIO_WORD_VALUES ? " WORD_VALUES" : ""); -#endif - } - } - done: - pcibr_unlock(pcibr_soft, s); - return xio_addr; -} - -/*ARGSUSED6 */ -pcibr_piomap_t -pcibr_piomap_alloc(devfs_handle_t pconn_vhdl, - device_desc_t dev_desc, - pciio_space_t space, - iopaddr_t pci_addr, - size_t req_size, - size_t req_size_max, - unsigned flags) -{ - pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); - pciio_info_t pciio_info = &pcibr_info->f_c; - pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; - - pcibr_piomap_t *mapptr; - pcibr_piomap_t maplist; - pcibr_piomap_t pcibr_piomap; - iopaddr_t xio_addr; - xtalk_piomap_t xtalk_piomap; - unsigned long s; - - /* Make sure that the req sizes are non-zero */ - if ((req_size < 1) || (req_size_max < 1)) - return NULL; - - /* - * Code to translate slot/space/addr - * into xio_addr is common between - * this routine and pcibr_piotrans_addr. - */ - xio_addr = pcibr_addr_pci_to_xio(pconn_vhdl, pciio_slot, space, pci_addr, req_size, flags); - - if (xio_addr == XIO_NOWHERE) - return NULL; - - /* Check the piomap list to see if there is already an allocated - * piomap entry but not in use. If so use that one. Otherwise - * allocate a new piomap entry and add it to the piomap list - */ - mapptr = &(pcibr_info->f_piomap); - - s = pcibr_lock(pcibr_soft); - for (pcibr_piomap = *mapptr; - pcibr_piomap != NULL; - pcibr_piomap = pcibr_piomap->bp_next) { - if (pcibr_piomap->bp_mapsz == 0) - break; - } - - if (pcibr_piomap) - mapptr = NULL; - else { - pcibr_unlock(pcibr_soft, s); - NEW(pcibr_piomap); - } - - pcibr_piomap->bp_dev = pconn_vhdl; - pcibr_piomap->bp_slot = pciio_slot; - pcibr_piomap->bp_flags = flags; - pcibr_piomap->bp_space = space; - pcibr_piomap->bp_pciaddr = pci_addr; - pcibr_piomap->bp_mapsz = req_size; - pcibr_piomap->bp_soft = pcibr_soft; - pcibr_piomap->bp_toc[0] = ATOMIC_INIT(0); - - if (mapptr) { - s = pcibr_lock(pcibr_soft); - maplist = *mapptr; - pcibr_piomap->bp_next = maplist; - *mapptr = pcibr_piomap; - } - pcibr_unlock(pcibr_soft, s); - - - if (pcibr_piomap) { - xtalk_piomap = - xtalk_piomap_alloc(xconn_vhdl, 0, - xio_addr, - req_size, req_size_max, - flags & PIOMAP_FLAGS); - if (xtalk_piomap) { - pcibr_piomap->bp_xtalk_addr = xio_addr; - pcibr_piomap->bp_xtalk_pio = xtalk_piomap; - } else { - pcibr_piomap->bp_mapsz = 0; - pcibr_piomap = 0; - } - } - return pcibr_piomap; -} - -/*ARGSUSED */ -void -pcibr_piomap_free(pcibr_piomap_t pcibr_piomap) -{ - xtalk_piomap_free(pcibr_piomap->bp_xtalk_pio); - pcibr_piomap->bp_xtalk_pio = 0; - pcibr_piomap->bp_mapsz = 0; -} - -/*ARGSUSED */ -caddr_t -pcibr_piomap_addr(pcibr_piomap_t pcibr_piomap, - iopaddr_t pci_addr, - size_t req_size) -{ - return xtalk_piomap_addr(pcibr_piomap->bp_xtalk_pio, - pcibr_piomap->bp_xtalk_addr + - pci_addr - pcibr_piomap->bp_pciaddr, - req_size); -} - -/*ARGSUSED */ -void -pcibr_piomap_done(pcibr_piomap_t pcibr_piomap) -{ - xtalk_piomap_done(pcibr_piomap->bp_xtalk_pio); -} - -/*ARGSUSED */ -caddr_t -pcibr_piotrans_addr(devfs_handle_t pconn_vhdl, - device_desc_t dev_desc, - pciio_space_t space, - iopaddr_t pci_addr, - size_t req_size, - unsigned flags) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; - - iopaddr_t xio_addr; - - xio_addr = pcibr_addr_pci_to_xio(pconn_vhdl, pciio_slot, space, pci_addr, req_size, flags); - - if (xio_addr == XIO_NOWHERE) - return NULL; - - return xtalk_piotrans_addr(xconn_vhdl, 0, xio_addr, req_size, flags & PIOMAP_FLAGS); -} - -/* - * PIO Space allocation and management. - * Allocate and Manage the PCI PIO space (mem and io space) - * This routine is pretty simplistic at this time, and - * does pretty trivial management of allocation and freeing.. - * The current scheme is prone for fragmentation.. - * Change the scheme to use bitmaps. - */ - -/*ARGSUSED */ -iopaddr_t -pcibr_piospace_alloc(devfs_handle_t pconn_vhdl, - device_desc_t dev_desc, - pciio_space_t space, - size_t req_size, - size_t alignment) -{ - pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); - pciio_info_t pciio_info = &pcibr_info->f_c; - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - - pciio_piospace_t piosp; - unsigned long s; - - iopaddr_t *pciaddr, *pcilast; - iopaddr_t start_addr; - size_t align_mask; - - /* - * Check for proper alignment - */ - ASSERT(alignment >= NBPP); - ASSERT((alignment & (alignment - 1)) == 0); - - align_mask = alignment - 1; - s = pcibr_lock(pcibr_soft); - - /* - * First look if a previously allocated chunk exists. - */ - if ((piosp = pcibr_info->f_piospace)) { - /* - * Look through the list for a right sized free chunk. - */ - do { - if (piosp->free && - (piosp->space == space) && - (piosp->count >= req_size) && - !(piosp->start & align_mask)) { - piosp->free = 0; - pcibr_unlock(pcibr_soft, s); - return piosp->start; - } - piosp = piosp->next; - } while (piosp); - } - ASSERT(!piosp); - - switch (space) { - case PCIIO_SPACE_IO: - pciaddr = &pcibr_soft->bs_spinfo.pci_io_base; - pcilast = &pcibr_soft->bs_spinfo.pci_io_last; - break; - case PCIIO_SPACE_MEM: - case PCIIO_SPACE_MEM32: - pciaddr = &pcibr_soft->bs_spinfo.pci_mem_base; - pcilast = &pcibr_soft->bs_spinfo.pci_mem_last; - break; - default: - ASSERT(0); - pcibr_unlock(pcibr_soft, s); - return 0; - } - - start_addr = *pciaddr; - - /* - * Align start_addr. - */ - if (start_addr & align_mask) - start_addr = (start_addr + align_mask) & ~align_mask; - - if ((start_addr + req_size) > *pcilast) { - /* - * If too big a request, reject it. - */ - pcibr_unlock(pcibr_soft, s); - return 0; - } - *pciaddr = (start_addr + req_size); - - NEW(piosp); - piosp->free = 0; - piosp->space = space; - piosp->start = start_addr; - piosp->count = req_size; - piosp->next = pcibr_info->f_piospace; - pcibr_info->f_piospace = piosp; - - pcibr_unlock(pcibr_soft, s); - return start_addr; -} - -/*ARGSUSED */ -void -pcibr_piospace_free(devfs_handle_t pconn_vhdl, - pciio_space_t space, - iopaddr_t pciaddr, - size_t req_size) -{ - pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pcibr_info->f_mfast; - - pciio_piospace_t piosp; - unsigned long s; - char name[1024]; - - /* - * Look through the bridge data structures for the pciio_piospace_t - * structure corresponding to 'pciaddr' - */ - s = pcibr_lock(pcibr_soft); - piosp = pcibr_info->f_piospace; - while (piosp) { - /* - * Piospace free can only be for the complete - * chunk and not parts of it.. - */ - if (piosp->start == pciaddr) { - if (piosp->count == req_size) - break; - /* - * Improper size passed for freeing.. - * Print a message and break; - */ - hwgraph_vertex_name_get(pconn_vhdl, name, 1024); - PRINT_WARNING("pcibr_piospace_free: error"); - PRINT_WARNING("Device %s freeing size (0x%lx) different than allocated (0x%lx)", - name, req_size, piosp->count); - PRINT_WARNING("Freeing 0x%lx instead", piosp->count); - break; - } - piosp = piosp->next; - } - - if (!piosp) { - PRINT_WARNING( - "pcibr_piospace_free: Address 0x%lx size 0x%lx - No match\n", - pciaddr, req_size); - pcibr_unlock(pcibr_soft, s); - return; - } - piosp->free = 1; - pcibr_unlock(pcibr_soft, s); - return; -} - -/* ===================================================================== - * DMA MANAGEMENT - * - * The Bridge ASIC provides three methods of doing - * DMA: via a "direct map" register available in - * 32-bit PCI space (which selects a contiguous 2G - * address space on some other widget), via - * "direct" addressing via 64-bit PCI space (all - * destination information comes from the PCI - * address, including transfer attributes), and via - * a "mapped" region that allows a bunch of - * different small mappings to be established with - * the PMU. - * - * For efficiency, we most prefer to use the 32-bit - * direct mapping facility, since it requires no - * resource allocations. The advantage of using the - * PMU over the 64-bit direct is that single-cycle - * PCI addressing can be used; the advantage of - * using 64-bit direct over PMU addressing is that - * we do not have to allocate entries in the PMU. - */ - -/* - * Convert PCI-generic software flags and Bridge-specific software flags - * into Bridge-specific Direct Map attribute bits. - */ -LOCAL iopaddr_t -pcibr_flags_to_d64(unsigned flags, pcibr_soft_t pcibr_soft) -{ - iopaddr_t attributes = 0; - - /* Sanity check: Bridge only allows use of VCHAN1 via 64-bit addrs */ -#ifdef LATER - ASSERT_ALWAYS(!(flags & PCIBR_VCHAN1) || (flags & PCIIO_DMA_A64)); -#endif - - /* Generic macro flags - */ - if (flags & PCIIO_DMA_DATA) { /* standard data channel */ - attributes &= ~PCI64_ATTR_BAR; /* no barrier bit */ - attributes |= PCI64_ATTR_PREF; /* prefetch on */ - } - if (flags & PCIIO_DMA_CMD) { /* standard command channel */ - attributes |= PCI64_ATTR_BAR; /* barrier bit on */ - attributes &= ~PCI64_ATTR_PREF; /* disable prefetch */ - } - /* Generic detail flags - */ - if (flags & PCIIO_PREFETCH) - attributes |= PCI64_ATTR_PREF; - if (flags & PCIIO_NOPREFETCH) - attributes &= ~PCI64_ATTR_PREF; - - /* the swap bit is in the address attributes for xbridge */ - if (pcibr_soft->bs_xbridge) { - if (flags & PCIIO_BYTE_STREAM) - attributes |= PCI64_ATTR_SWAP; - if (flags & PCIIO_WORD_VALUES) - attributes &= ~PCI64_ATTR_SWAP; - } - - /* Provider-specific flags - */ - if (flags & PCIBR_BARRIER) - attributes |= PCI64_ATTR_BAR; - if (flags & PCIBR_NOBARRIER) - attributes &= ~PCI64_ATTR_BAR; - - if (flags & PCIBR_PREFETCH) - attributes |= PCI64_ATTR_PREF; - if (flags & PCIBR_NOPREFETCH) - attributes &= ~PCI64_ATTR_PREF; - - if (flags & PCIBR_PRECISE) - attributes |= PCI64_ATTR_PREC; - if (flags & PCIBR_NOPRECISE) - attributes &= ~PCI64_ATTR_PREC; - - if (flags & PCIBR_VCHAN1) - attributes |= PCI64_ATTR_VIRTUAL; - if (flags & PCIBR_VCHAN0) - attributes &= ~PCI64_ATTR_VIRTUAL; - - return (attributes); -} - -/* - * Convert PCI-generic software flags and Bridge-specific software flags - * into Bridge-specific Address Translation Entry attribute bits. - */ -LOCAL bridge_ate_t -pcibr_flags_to_ate(unsigned flags) -{ - bridge_ate_t attributes; - - /* default if nothing specified: - * NOBARRIER - * NOPREFETCH - * NOPRECISE - * COHERENT - * Plus the valid bit - */ - attributes = ATE_CO | ATE_V; - - /* Generic macro flags - */ - if (flags & PCIIO_DMA_DATA) { /* standard data channel */ - attributes &= ~ATE_BAR; /* no barrier */ - attributes |= ATE_PREF; /* prefetch on */ - } - if (flags & PCIIO_DMA_CMD) { /* standard command channel */ - attributes |= ATE_BAR; /* barrier bit on */ - attributes &= ~ATE_PREF; /* disable prefetch */ - } - /* Generic detail flags - */ - if (flags & PCIIO_PREFETCH) - attributes |= ATE_PREF; - if (flags & PCIIO_NOPREFETCH) - attributes &= ~ATE_PREF; - - /* Provider-specific flags - */ - if (flags & PCIBR_BARRIER) - attributes |= ATE_BAR; - if (flags & PCIBR_NOBARRIER) - attributes &= ~ATE_BAR; - - if (flags & PCIBR_PREFETCH) - attributes |= ATE_PREF; - if (flags & PCIBR_NOPREFETCH) - attributes &= ~ATE_PREF; - - if (flags & PCIBR_PRECISE) - attributes |= ATE_PREC; - if (flags & PCIBR_NOPRECISE) - attributes &= ~ATE_PREC; - - return (attributes); -} - -/*ARGSUSED */ -pcibr_dmamap_t -pcibr_dmamap_alloc(devfs_handle_t pconn_vhdl, - device_desc_t dev_desc, - size_t req_size_max, - unsigned flags) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; - pciio_slot_t slot; - xwidgetnum_t xio_port; - - xtalk_dmamap_t xtalk_dmamap; - pcibr_dmamap_t pcibr_dmamap; - int ate_count; - int ate_index; - - /* merge in forced flags */ - flags |= pcibr_soft->bs_dma_flags; - -#ifdef IRIX - NEWf(pcibr_dmamap, flags); -#else - /* - * On SNIA64, these maps are pre-allocated because pcibr_dmamap_alloc() - * can be called within an interrupt thread. - */ - pcibr_dmamap = (pcibr_dmamap_t)get_free_pciio_dmamap(pcibr_soft->bs_vhdl); -#endif - - if (!pcibr_dmamap) - return 0; - - xtalk_dmamap = xtalk_dmamap_alloc(xconn_vhdl, dev_desc, req_size_max, - flags & DMAMAP_FLAGS); - if (!xtalk_dmamap) { -#if PCIBR_ATE_DEBUG - printk("pcibr_attach: xtalk_dmamap_alloc failed\n"); -#endif - DEL(pcibr_dmamap); - return 0; - } - xio_port = pcibr_soft->bs_mxid; - slot = pciio_info_slot_get(pciio_info); - - pcibr_dmamap->bd_dev = pconn_vhdl; - pcibr_dmamap->bd_slot = slot; - pcibr_dmamap->bd_soft = pcibr_soft; - pcibr_dmamap->bd_xtalk = xtalk_dmamap; - pcibr_dmamap->bd_max_size = req_size_max; - pcibr_dmamap->bd_xio_port = xio_port; - - if (flags & PCIIO_DMA_A64) { - if (!pcibr_try_set_device(pcibr_soft, slot, flags, BRIDGE_DEV_D64_BITS)) { - iopaddr_t pci_addr; - int have_rrbs; - int min_rrbs; - - /* Device is capable of A64 operations, - * and the attributes of the DMA are - * consistant with any previous DMA - * mappings using shared resources. - */ - - pci_addr = pcibr_flags_to_d64(flags, pcibr_soft); - - pcibr_dmamap->bd_flags = flags; - pcibr_dmamap->bd_xio_addr = 0; - pcibr_dmamap->bd_pci_addr = pci_addr; - - /* Make sure we have an RRB (or two). - */ - if (!(pcibr_soft->bs_rrb_fixed & (1 << slot))) { - if (flags & PCIBR_VCHAN1) - slot += PCIBR_RRB_SLOT_VIRTUAL; - have_rrbs = pcibr_soft->bs_rrb_valid[slot]; - if (have_rrbs < 2) { - if (pci_addr & PCI64_ATTR_PREF) - min_rrbs = 2; - else - min_rrbs = 1; - if (have_rrbs < min_rrbs) - do_pcibr_rrb_autoalloc(pcibr_soft, slot, min_rrbs - have_rrbs); - } - } -#if PCIBR_ATE_DEBUG - printk("pcibr_dmamap_alloc: using direct64\n"); -#endif - return pcibr_dmamap; - } -#if PCIBR_ATE_DEBUG - printk("pcibr_dmamap_alloc: unable to use direct64\n"); -#endif - flags &= ~PCIIO_DMA_A64; - } - if (flags & PCIIO_FIXED) { - /* warning: mappings may fail later, - * if direct32 can't get to the address. - */ - if (!pcibr_try_set_device(pcibr_soft, slot, flags, BRIDGE_DEV_D32_BITS)) { - /* User desires DIRECT A32 operations, - * and the attributes of the DMA are - * consistant with any previous DMA - * mappings using shared resources. - * Mapping calls may fail if target - * is outside the direct32 range. - */ -#if PCIBR_ATE_DEBUG - printk("pcibr_dmamap_alloc: using direct32\n"); -#endif - pcibr_dmamap->bd_flags = flags; - pcibr_dmamap->bd_xio_addr = pcibr_soft->bs_dir_xbase; - pcibr_dmamap->bd_pci_addr = PCI32_DIRECT_BASE; - return pcibr_dmamap; - } -#if PCIBR_ATE_DEBUG - printk("pcibr_dmamap_alloc: unable to use direct32\n"); -#endif - /* If the user demands FIXED and we can't - * give it to him, fail. - */ - xtalk_dmamap_free(xtalk_dmamap); - DEL(pcibr_dmamap); - return 0; - } - /* - * Allocate Address Translation Entries from the mapping RAM. - * Unless the PCIBR_NO_ATE_ROUNDUP flag is specified, - * the maximum number of ATEs is based on the worst-case - * scenario, where the requested target is in the - * last byte of an ATE; thus, mapping IOPGSIZE+2 - * does end up requiring three ATEs. - */ - if (!(flags & PCIBR_NO_ATE_ROUNDUP)) { - ate_count = IOPG((IOPGSIZE - 1) /* worst case start offset */ - +req_size_max /* max mapping bytes */ - - 1) + 1; /* round UP */ - } else { /* assume requested target is page aligned */ - ate_count = IOPG(req_size_max /* max mapping bytes */ - - 1) + 1; /* round UP */ - } - - ate_index = pcibr_ate_alloc(pcibr_soft, ate_count); - - if (ate_index != -1) { - if (!pcibr_try_set_device(pcibr_soft, slot, flags, BRIDGE_DEV_PMU_BITS)) { - bridge_ate_t ate_proto; - int have_rrbs; - int min_rrbs; - -#if PCIBR_ATE_DEBUG - printk("pcibr_dmamap_alloc: using PMU\n"); -#endif - - ate_proto = pcibr_flags_to_ate(flags); - - pcibr_dmamap->bd_flags = flags; - pcibr_dmamap->bd_pci_addr = - PCI32_MAPPED_BASE + IOPGSIZE * ate_index; - /* - * for xbridge the byte-swap bit == bit 29 of PCI address - */ - if (pcibr_soft->bs_xbridge) { - if (flags & PCIIO_BYTE_STREAM) - ATE_SWAP_ON(pcibr_dmamap->bd_pci_addr); - /* - * If swap was set in bss_device in pcibr_endian_set() - * we need to change the address bit. - */ - if (pcibr_soft->bs_slot[slot].bss_device & - BRIDGE_DEV_SWAP_PMU) - ATE_SWAP_ON(pcibr_dmamap->bd_pci_addr); - if (flags & PCIIO_WORD_VALUES) - ATE_SWAP_OFF(pcibr_dmamap->bd_pci_addr); - } - pcibr_dmamap->bd_xio_addr = 0; - pcibr_dmamap->bd_ate_ptr = pcibr_ate_addr(pcibr_soft, ate_index); - pcibr_dmamap->bd_ate_index = ate_index; - pcibr_dmamap->bd_ate_count = ate_count; - pcibr_dmamap->bd_ate_proto = ate_proto; - - /* Make sure we have an RRB (or two). - */ - if (!(pcibr_soft->bs_rrb_fixed & (1 << slot))) { - have_rrbs = pcibr_soft->bs_rrb_valid[slot]; - if (have_rrbs < 2) { - if (ate_proto & ATE_PREF) - min_rrbs = 2; - else - min_rrbs = 1; - if (have_rrbs < min_rrbs) - do_pcibr_rrb_autoalloc(pcibr_soft, slot, min_rrbs - have_rrbs); - } - } - if (ate_index >= pcibr_soft->bs_int_ate_size && - !pcibr_soft->bs_xbridge) { - bridge_t *bridge = pcibr_soft->bs_base; - volatile unsigned *cmd_regp; - unsigned cmd_reg; - unsigned long s; - - pcibr_dmamap->bd_flags |= PCIBR_DMAMAP_SSRAM; - - s = pcibr_lock(pcibr_soft); - cmd_regp = &(bridge-> - b_type0_cfg_dev[slot]. - l[PCI_CFG_COMMAND / 4]); - cmd_reg = *cmd_regp; - pcibr_soft->bs_slot[slot].bss_cmd_pointer = cmd_regp; - pcibr_soft->bs_slot[slot].bss_cmd_shadow = cmd_reg; - pcibr_unlock(pcibr_soft, s); - } - return pcibr_dmamap; - } -#if PCIBR_ATE_DEBUG - printk("pcibr_dmamap_alloc: unable to use PMU\n"); -#endif - pcibr_ate_free(pcibr_soft, ate_index, ate_count); - } - /* total failure: sorry, you just can't - * get from here to there that way. - */ -#if PCIBR_ATE_DEBUG - printk("pcibr_dmamap_alloc: complete failure.\n"); -#endif - xtalk_dmamap_free(xtalk_dmamap); - DEL(pcibr_dmamap); - return 0; -} - -/*ARGSUSED */ -void -pcibr_dmamap_free(pcibr_dmamap_t pcibr_dmamap) -{ - pcibr_soft_t pcibr_soft = pcibr_dmamap->bd_soft; - pciio_slot_t slot = pcibr_dmamap->bd_slot; - - unsigned flags = pcibr_dmamap->bd_flags; - - /* Make sure that bss_ext_ates_active - * is properly kept up to date. - */ - - if (PCIBR_DMAMAP_BUSY & flags) - if (PCIBR_DMAMAP_SSRAM & flags) - atomic_dec(&(pcibr_soft->bs_slot[slot]. bss_ext_ates_active)); - - xtalk_dmamap_free(pcibr_dmamap->bd_xtalk); - - if (pcibr_dmamap->bd_flags & PCIIO_DMA_A64) { - pcibr_release_device(pcibr_soft, slot, BRIDGE_DEV_D64_BITS); - } - if (pcibr_dmamap->bd_ate_count) { - pcibr_ate_free(pcibr_dmamap->bd_soft, - pcibr_dmamap->bd_ate_index, - pcibr_dmamap->bd_ate_count); - pcibr_release_device(pcibr_soft, slot, BRIDGE_DEV_PMU_BITS); - } -#ifdef IRIX - DEL(pcibr_dmamap); -#endif -} - -/* - * Setup an Address Translation Entry as specified. Use either the Bridge - * internal maps or the external map RAM, as appropriate. - */ -LOCAL bridge_ate_p -pcibr_ate_addr(pcibr_soft_t pcibr_soft, - int ate_index) -{ - bridge_t *bridge = pcibr_soft->bs_base; - - return (ate_index < pcibr_soft->bs_int_ate_size) - ? &(bridge->b_int_ate_ram[ate_index].wr) - : &(bridge->b_ext_ate_ram[ate_index]); -} - -/* - * pcibr_addr_xio_to_pci: given a PIO range, hand - * back the corresponding base PCI MEM address; - * this is used to short-circuit DMA requests that - * loop back onto this PCI bus. - */ -LOCAL iopaddr_t -pcibr_addr_xio_to_pci(pcibr_soft_t soft, - iopaddr_t xio_addr, - size_t req_size) -{ - iopaddr_t xio_lim = xio_addr + req_size - 1; - iopaddr_t pci_addr; - pciio_slot_t slot; - - if ((xio_addr >= BRIDGE_PCI_MEM32_BASE) && - (xio_lim <= BRIDGE_PCI_MEM32_LIMIT)) { - pci_addr = xio_addr - BRIDGE_PCI_MEM32_BASE; - return pci_addr; - } - if ((xio_addr >= BRIDGE_PCI_MEM64_BASE) && - (xio_lim <= BRIDGE_PCI_MEM64_LIMIT)) { - pci_addr = xio_addr - BRIDGE_PCI_MEM64_BASE; - return pci_addr; - } - for (slot = 0; slot < 8; ++slot) - if ((xio_addr >= BRIDGE_DEVIO(slot)) && - (xio_lim < BRIDGE_DEVIO(slot + 1))) { - bridgereg_t dev; - - dev = soft->bs_slot[slot].bss_device; - pci_addr = dev & BRIDGE_DEV_OFF_MASK; - pci_addr <<= BRIDGE_DEV_OFF_ADDR_SHFT; - pci_addr += xio_addr - BRIDGE_DEVIO(slot); - return (dev & BRIDGE_DEV_DEV_IO_MEM) ? pci_addr : PCI_NOWHERE; - } - return 0; -} - -/* We are starting to get more complexity - * surrounding writing ATEs, so pull - * the writing code into this new function. - */ - -#if PCIBR_FREEZE_TIME -#define ATE_FREEZE() s = ate_freeze(pcibr_dmamap, &freeze_time, cmd_regs) -#else -#define ATE_FREEZE() s = ate_freeze(pcibr_dmamap, cmd_regs) -#endif - -LOCAL unsigned -ate_freeze(pcibr_dmamap_t pcibr_dmamap, -#if PCIBR_FREEZE_TIME - unsigned *freeze_time_ptr, -#endif - unsigned *cmd_regs) -{ - pcibr_soft_t pcibr_soft = pcibr_dmamap->bd_soft; -#ifdef LATER - int dma_slot = pcibr_dmamap->bd_slot; -#endif - int ext_ates = pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM; - int slot; - - unsigned long s; - unsigned cmd_reg; - volatile unsigned *cmd_lwa; - unsigned cmd_lwd; - - if (!ext_ates) - return 0; - - /* Bridge Hardware Bug WAR #484930: - * Bridge can't handle updating External ATEs - * while DMA is occuring that uses External ATEs, - * even if the particular ATEs involved are disjoint. - */ - - /* need to prevent anyone else from - * unfreezing the grant while we - * are working; also need to prevent - * this thread from being interrupted - * to keep PCI grant freeze time - * at an absolute minimum. - */ - s = pcibr_lock(pcibr_soft); - -#ifdef LATER - /* just in case pcibr_dmamap_done was not called */ - if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_BUSY) { - pcibr_dmamap->bd_flags &= ~PCIBR_DMAMAP_BUSY; - if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM) - atomic_dec(&(pcibr_soft->bs_slot[dma_slot]. bss_ext_ates_active)); - xtalk_dmamap_done(pcibr_dmamap->bd_xtalk); - } -#endif /* LATER */ -#if PCIBR_FREEZE_TIME - *freeze_time_ptr = get_timestamp(); -#endif - - cmd_lwa = 0; - for (slot = 0; slot < 8; ++slot) - if (atomic_read(&pcibr_soft->bs_slot[slot].bss_ext_ates_active)) { - cmd_reg = pcibr_soft-> - bs_slot[slot]. - bss_cmd_shadow; - if (cmd_reg & PCI_CMD_BUS_MASTER) { - cmd_lwa = pcibr_soft-> - bs_slot[slot]. - bss_cmd_pointer; - cmd_lwd = cmd_reg ^ PCI_CMD_BUS_MASTER; - cmd_lwa[0] = cmd_lwd; - } - cmd_regs[slot] = cmd_reg; - } else - cmd_regs[slot] = 0; - - if (cmd_lwa) { - bridge_t *bridge = pcibr_soft->bs_base; - - /* Read the last master bit that has been cleared. This PIO read - * on the PCI bus is to ensure the completion of any DMAs that - * are due to bus requests issued by PCI devices before the - * clearing of master bits. - */ - cmd_lwa[0]; - - /* Flush all the write buffers in the bridge */ - for (slot = 0; slot < 8; ++slot) - if (atomic_read(&pcibr_soft->bs_slot[slot].bss_ext_ates_active)) { - /* Flush the write buffer associated with this - * PCI device which might be using dma map RAM. - */ - bridge->b_wr_req_buf[slot].reg; - } - } - return s; -} - -#define ATE_WRITE() ate_write(ate_ptr, ate_count, ate) - -LOCAL void -ate_write(bridge_ate_p ate_ptr, - int ate_count, - bridge_ate_t ate) -{ - while (ate_count-- > 0) { - *ate_ptr++ = ate; - ate += IOPGSIZE; - } -} - - -#if PCIBR_FREEZE_TIME -#define ATE_THAW() ate_thaw(pcibr_dmamap, ate_index, ate, ate_total, freeze_time, cmd_regs, s) -#else -#define ATE_THAW() ate_thaw(pcibr_dmamap, ate_index, cmd_regs, s) -#endif - -LOCAL void -ate_thaw(pcibr_dmamap_t pcibr_dmamap, - int ate_index, -#if PCIBR_FREEZE_TIME - bridge_ate_t ate, - int ate_total, - unsigned freeze_time_start, -#endif - unsigned *cmd_regs, - unsigned s) -{ - pcibr_soft_t pcibr_soft = pcibr_dmamap->bd_soft; - int dma_slot = pcibr_dmamap->bd_slot; - int slot; - bridge_t *bridge = pcibr_soft->bs_base; - int ext_ates = pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM; - - unsigned cmd_reg; - -#if PCIBR_FREEZE_TIME - unsigned freeze_time; - static unsigned max_freeze_time = 0; - static unsigned max_ate_total; -#endif - - if (!ext_ates) - return; - - /* restore cmd regs */ - for (slot = 0; slot < 8; ++slot) - if ((cmd_reg = cmd_regs[slot]) & PCI_CMD_BUS_MASTER) - bridge->b_type0_cfg_dev[slot].l[PCI_CFG_COMMAND / 4] = cmd_reg; - - pcibr_dmamap->bd_flags |= PCIBR_DMAMAP_BUSY; - atomic_inc(&(pcibr_soft->bs_slot[dma_slot]. bss_ext_ates_active)); - -#if PCIBR_FREEZE_TIME - freeze_time = get_timestamp() - freeze_time_start; - - if ((max_freeze_time < freeze_time) || - (max_ate_total < ate_total)) { - if (max_freeze_time < freeze_time) - max_freeze_time = freeze_time; - if (max_ate_total < ate_total) - max_ate_total = ate_total; - pcibr_unlock(pcibr_soft, s); - printk("%s: pci freeze time %d usec for %d ATEs\n" - "\tfirst ate: %R\n", - pcibr_soft->bs_name, - freeze_time * 1000 / 1250, - ate_total, - ate, ate_bits); - } else -#endif - pcibr_unlock(pcibr_soft, s); -} - -/*ARGSUSED */ -iopaddr_t -pcibr_dmamap_addr(pcibr_dmamap_t pcibr_dmamap, - paddr_t paddr, - size_t req_size) -{ - pcibr_soft_t pcibr_soft; - iopaddr_t xio_addr; - xwidgetnum_t xio_port; - iopaddr_t pci_addr; - unsigned flags; - - ASSERT(pcibr_dmamap != NULL); - ASSERT(req_size > 0); - ASSERT(req_size <= pcibr_dmamap->bd_max_size); - - pcibr_soft = pcibr_dmamap->bd_soft; - - flags = pcibr_dmamap->bd_flags; - - xio_addr = xtalk_dmamap_addr(pcibr_dmamap->bd_xtalk, paddr, req_size); - if (XIO_PACKED(xio_addr)) { - xio_port = XIO_PORT(xio_addr); - xio_addr = XIO_ADDR(xio_addr); - } else - xio_port = pcibr_dmamap->bd_xio_port; - - /* If this DMA is to an address that - * refers back to this Bridge chip, - * reduce it back to the correct - * PCI MEM address. - */ - if (xio_port == pcibr_soft->bs_xid) { - pci_addr = pcibr_addr_xio_to_pci(pcibr_soft, xio_addr, req_size); - } else if (flags & PCIIO_DMA_A64) { - /* A64 DMA: - * always use 64-bit direct mapping, - * which always works. - * Device(x) was set up during - * dmamap allocation. - */ - - /* attributes are already bundled up into bd_pci_addr. - */ - pci_addr = pcibr_dmamap->bd_pci_addr - | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT) - | xio_addr; - - /* Bridge Hardware WAR #482836: - * If the transfer is not cache aligned - * and the Bridge Rev is <= B, force - * prefetch to be off. - */ - if (flags & PCIBR_NOPREFETCH) - pci_addr &= ~PCI64_ATTR_PREF; - -#if DEBUG && PCIBR_DMA_DEBUG - printk("pcibr_dmamap_addr (direct64):\n" - "\twanted paddr [0x%x..0x%x]\n" - "\tXIO port 0x%x offset 0x%x\n" - "\treturning PCI 0x%x\n", - paddr, paddr + req_size - 1, - xio_port, xio_addr, pci_addr); -#endif - } else if (flags & PCIIO_FIXED) { - /* A32 direct DMA: - * always use 32-bit direct mapping, - * which may fail. - * Device(x) was set up during - * dmamap allocation. - */ - - if (xio_port != pcibr_soft->bs_dir_xport) - pci_addr = 0; /* wrong DIDN */ - else if (xio_addr < pcibr_dmamap->bd_xio_addr) - pci_addr = 0; /* out of range */ - else if ((xio_addr + req_size) > - (pcibr_dmamap->bd_xio_addr + BRIDGE_DMA_DIRECT_SIZE)) - pci_addr = 0; /* out of range */ - else - pci_addr = pcibr_dmamap->bd_pci_addr + - xio_addr - pcibr_dmamap->bd_xio_addr; - -#if DEBUG && PCIBR_DMA_DEBUG - printk("pcibr_dmamap_addr (direct32):\n" - "\twanted paddr [0x%x..0x%x]\n" - "\tXIO port 0x%x offset 0x%x\n" - "\treturning PCI 0x%x\n", - paddr, paddr + req_size - 1, - xio_port, xio_addr, pci_addr); -#endif - } else { - bridge_t *bridge = pcibr_soft->bs_base; - iopaddr_t offset = IOPGOFF(xio_addr); - bridge_ate_t ate_proto = pcibr_dmamap->bd_ate_proto; - int ate_count = IOPG(offset + req_size - 1) + 1; - - int ate_index = pcibr_dmamap->bd_ate_index; - unsigned cmd_regs[8]; - unsigned s; - -#if PCIBR_FREEZE_TIME - int ate_total = ate_count; - unsigned freeze_time; -#endif - -#if PCIBR_ATE_DEBUG - bridge_ate_t ate_cmp; - bridge_ate_p ate_cptr; - unsigned ate_lo, ate_hi; - int ate_bad = 0; - int ate_rbc = 0; -#endif - bridge_ate_p ate_ptr = pcibr_dmamap->bd_ate_ptr; - bridge_ate_t ate; - - /* Bridge Hardware WAR #482836: - * If the transfer is not cache aligned - * and the Bridge Rev is <= B, force - * prefetch to be off. - */ - if (flags & PCIBR_NOPREFETCH) - ate_proto &= ~ATE_PREF; - - ate = ate_proto - | (xio_port << ATE_TIDSHIFT) - | (xio_addr - offset); - - pci_addr = pcibr_dmamap->bd_pci_addr + offset; - - /* Fill in our mapping registers - * with the appropriate xtalk data, - * and hand back the PCI address. - */ - - ASSERT(ate_count > 0); - if (ate_count <= pcibr_dmamap->bd_ate_count) { - ATE_FREEZE(); - ATE_WRITE(); - ATE_THAW(); - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - } else { - /* The number of ATE's required is greater than the number - * allocated for this map. One way this can happen is if - * pcibr_dmamap_alloc() was called with the PCIBR_NO_ATE_ROUNDUP - * flag, and then when that map is used (right now), the - * target address tells us we really did need to roundup. - * The other possibility is that the map is just plain too - * small to handle the requested target area. - */ -#if PCIBR_ATE_DEBUG - PRINT_WARNING( "pcibr_dmamap_addr :\n" - "\twanted paddr [0x%x..0x%x]\n" - "\tate_count 0x%x bd_ate_count 0x%x\n" - "\tATE's required > number allocated\n", - paddr, paddr + req_size - 1, - ate_count, pcibr_dmamap->bd_ate_count); -#endif - pci_addr = 0; - } - - } - return pci_addr; -} - -/*ARGSUSED */ -alenlist_t -pcibr_dmamap_list(pcibr_dmamap_t pcibr_dmamap, - alenlist_t palenlist, - unsigned flags) -{ - pcibr_soft_t pcibr_soft; - bridge_t *bridge=NULL; - - unsigned al_flags = (flags & PCIIO_NOSLEEP) ? AL_NOSLEEP : 0; - int inplace = flags & PCIIO_INPLACE; - - alenlist_t pciio_alenlist = 0; - alenlist_t xtalk_alenlist; - size_t length; - iopaddr_t offset; - unsigned direct64; - int ate_index = 0; - int ate_count = 0; - int ate_total = 0; - bridge_ate_p ate_ptr = (bridge_ate_p)0; - bridge_ate_t ate_proto = (bridge_ate_t)0; - bridge_ate_t ate_prev; - bridge_ate_t ate; - alenaddr_t xio_addr; - xwidgetnum_t xio_port; - iopaddr_t pci_addr; - alenaddr_t new_addr; - - unsigned cmd_regs[8]; - unsigned s = 0; - -#if PCIBR_FREEZE_TIME - unsigned freeze_time; -#endif - int ate_freeze_done = 0; /* To pair ATE_THAW - * with an ATE_FREEZE - */ - - pcibr_soft = pcibr_dmamap->bd_soft; - - xtalk_alenlist = xtalk_dmamap_list(pcibr_dmamap->bd_xtalk, palenlist, - flags & DMAMAP_FLAGS); - if (!xtalk_alenlist) - goto fail; - - alenlist_cursor_init(xtalk_alenlist, 0, NULL); - - if (inplace) { - pciio_alenlist = xtalk_alenlist; - } else { - pciio_alenlist = alenlist_create(al_flags); - if (!pciio_alenlist) - goto fail; - } - - direct64 = pcibr_dmamap->bd_flags & PCIIO_DMA_A64; - if (!direct64) { - bridge = pcibr_soft->bs_base; - ate_ptr = pcibr_dmamap->bd_ate_ptr; - ate_index = pcibr_dmamap->bd_ate_index; - ate_proto = pcibr_dmamap->bd_ate_proto; - ATE_FREEZE(); - ate_freeze_done = 1; /* Remember that we need to do an ATE_THAW */ - } - pci_addr = pcibr_dmamap->bd_pci_addr; - - ate_prev = 0; /* matches no valid ATEs */ - while (ALENLIST_SUCCESS == - alenlist_get(xtalk_alenlist, NULL, 0, - &xio_addr, &length, al_flags)) { - if (XIO_PACKED(xio_addr)) { - xio_port = XIO_PORT(xio_addr); - xio_addr = XIO_ADDR(xio_addr); - } else - xio_port = pcibr_dmamap->bd_xio_port; - - if (xio_port == pcibr_soft->bs_xid) { - new_addr = pcibr_addr_xio_to_pci(pcibr_soft, xio_addr, length); - if (new_addr == PCI_NOWHERE) - goto fail; - } else if (direct64) { - new_addr = pci_addr | xio_addr - | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); - - /* Bridge Hardware WAR #482836: - * If the transfer is not cache aligned - * and the Bridge Rev is <= B, force - * prefetch to be off. - */ - if (flags & PCIBR_NOPREFETCH) - new_addr &= ~PCI64_ATTR_PREF; - - } else { - /* calculate the ate value for - * the first address. If it - * matches the previous - * ATE written (ie. we had - * multiple blocks in the - * same IOPG), then back up - * and reuse that ATE. - * - * We are NOT going to - * aggressively try to - * reuse any other ATEs. - */ - offset = IOPGOFF(xio_addr); - ate = ate_proto - | (xio_port << ATE_TIDSHIFT) - | (xio_addr - offset); - if (ate == ate_prev) { -#if PCIBR_ATE_DEBUG - printk("pcibr_dmamap_list: ATE share\n"); -#endif - ate_ptr--; - ate_index--; - pci_addr -= IOPGSIZE; - } - new_addr = pci_addr + offset; - - /* Fill in the hardware ATEs - * that contain this block. - */ - ate_count = IOPG(offset + length - 1) + 1; - ate_total += ate_count; - - /* Ensure that this map contains enough ATE's */ - if (ate_total > pcibr_dmamap->bd_ate_count) { -#if PCIBR_ATE_DEBUG - PRINT_WARNING( "pcibr_dmamap_list :\n" - "\twanted xio_addr [0x%x..0x%x]\n" - "\tate_total 0x%x bd_ate_count 0x%x\n" - "\tATE's required > number allocated\n", - xio_addr, xio_addr + length - 1, - ate_total, pcibr_dmamap->bd_ate_count); -#endif - goto fail; - } - - ATE_WRITE(); - - ate_index += ate_count; - ate_ptr += ate_count; - - ate_count <<= IOPFNSHIFT; - ate += ate_count; - pci_addr += ate_count; - } - - /* write the PCI DMA address - * out to the scatter-gather list. - */ - if (inplace) { - if (ALENLIST_SUCCESS != - alenlist_replace(pciio_alenlist, NULL, - &new_addr, &length, al_flags)) - goto fail; - } else { - if (ALENLIST_SUCCESS != - alenlist_append(pciio_alenlist, - new_addr, length, al_flags)) - goto fail; - } - } - if (!inplace) - alenlist_done(xtalk_alenlist); - - /* Reset the internal cursor of the alenlist to be returned back - * to the caller. - */ - alenlist_cursor_init(pciio_alenlist, 0, NULL); - - - /* In case an ATE_FREEZE was done do the ATE_THAW to unroll all the - * changes that ATE_FREEZE has done to implement the external SSRAM - * bug workaround. - */ - if (ate_freeze_done) { - ATE_THAW(); - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - } - return pciio_alenlist; - - fail: - /* There are various points of failure after doing an ATE_FREEZE - * We need to do an ATE_THAW. Otherwise the ATEs are locked forever. - * The decision to do an ATE_THAW needs to be based on whether a - * an ATE_FREEZE was done before. - */ - if (ate_freeze_done) { - ATE_THAW(); - bridge->b_wid_tflush; - } - if (pciio_alenlist && !inplace) - alenlist_destroy(pciio_alenlist); - return 0; -} - -/*ARGSUSED */ -void -pcibr_dmamap_done(pcibr_dmamap_t pcibr_dmamap) -{ - /* - * We could go through and invalidate ATEs here; - * for performance reasons, we don't. - * We also don't enforce the strict alternation - * between _addr/_list and _done, but Hub does. - */ - - if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_BUSY) { - pcibr_dmamap->bd_flags &= ~PCIBR_DMAMAP_BUSY; - - if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM) - atomic_dec(&(pcibr_dmamap->bd_soft->bs_slot[pcibr_dmamap->bd_slot]. bss_ext_ates_active)); - } - - xtalk_dmamap_done(pcibr_dmamap->bd_xtalk); -} - - -/* - * For each bridge, the DIR_OFF value in the Direct Mapping Register - * determines the PCI to Crosstalk memory mapping to be used for all - * 32-bit Direct Mapping memory accesses. This mapping can be to any - * node in the system. This function will return that compact node id. - */ - -/*ARGSUSED */ -cnodeid_t -pcibr_get_dmatrans_node(devfs_handle_t pconn_vhdl) -{ - - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - - return(NASID_TO_COMPACT_NODEID(NASID_GET(pcibr_soft->bs_dir_xbase))); -} - -/*ARGSUSED */ -iopaddr_t -pcibr_dmatrans_addr(devfs_handle_t pconn_vhdl, - device_desc_t dev_desc, - paddr_t paddr, - size_t req_size, - unsigned flags) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; - pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); - pcibr_soft_slot_t slotp = &pcibr_soft->bs_slot[pciio_slot]; - - xwidgetnum_t xio_port; - iopaddr_t xio_addr; - iopaddr_t pci_addr; - - int have_rrbs; - int min_rrbs; - - /* merge in forced flags */ - flags |= pcibr_soft->bs_dma_flags; - - xio_addr = xtalk_dmatrans_addr(xconn_vhdl, 0, paddr, req_size, - flags & DMAMAP_FLAGS); - - if (!xio_addr) { -#if PCIBR_DMA_DEBUG - printk("pcibr_dmatrans_addr:\n" - "\tpciio connection point %v\n" - "\txtalk connection point %v\n" - "\twanted paddr [0x%x..0x%x]\n" - "\txtalk_dmatrans_addr returned 0x%x\n", - pconn_vhdl, xconn_vhdl, - paddr, paddr + req_size - 1, - xio_addr); -#endif - return 0; - } - /* - * find which XIO port this goes to. - */ - if (XIO_PACKED(xio_addr)) { - if (xio_addr == XIO_NOWHERE) { -#if PCIBR_DMA_DEBUG - printk("pcibr_dmatrans_addr:\n" - "\tpciio connection point %v\n" - "\txtalk connection point %v\n" - "\twanted paddr [0x%x..0x%x]\n" - "\txtalk_dmatrans_addr returned 0x%x\n", - pconn_vhdl, xconn_vhdl, - paddr, paddr + req_size - 1, - xio_addr); -#endif - return 0; - } - xio_port = XIO_PORT(xio_addr); - xio_addr = XIO_ADDR(xio_addr); - - } else - xio_port = pcibr_soft->bs_mxid; - - /* - * If this DMA comes back to us, - * return the PCI MEM address on - * which it would land, or NULL - * if the target is something - * on bridge other than PCI MEM. - */ - if (xio_port == pcibr_soft->bs_xid) { - pci_addr = pcibr_addr_xio_to_pci(pcibr_soft, xio_addr, req_size); - return pci_addr; - } - /* If the caller can use A64, try to - * satisfy the request with the 64-bit - * direct map. This can fail if the - * configuration bits in Device(x) - * conflict with our flags. - */ - - if (flags & PCIIO_DMA_A64) { - pci_addr = slotp->bss_d64_base; - if (!(flags & PCIBR_VCHAN1)) - flags |= PCIBR_VCHAN0; - if ((pci_addr != PCIBR_D64_BASE_UNSET) && - (flags == slotp->bss_d64_flags)) { - - pci_addr |= xio_addr - | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); - -#if DEBUG && PCIBR_DMA_DEBUG -#if HWG_PERF_CHECK - if (xio_addr != 0x20000000) -#endif - printk("pcibr_dmatrans_addr: [reuse]\n" - "\tpciio connection point %v\n" - "\txtalk connection point %v\n" - "\twanted paddr [0x%x..0x%x]\n" - "\txtalk_dmatrans_addr returned 0x%x\n" - "\tdirect 64bit address is 0x%x\n", - pconn_vhdl, xconn_vhdl, - paddr, paddr + req_size - 1, - xio_addr, pci_addr); -#endif - return (pci_addr); - } - if (!pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D64_BITS)) { - pci_addr = pcibr_flags_to_d64(flags, pcibr_soft); - slotp->bss_d64_flags = flags; - slotp->bss_d64_base = pci_addr; - pci_addr |= xio_addr - | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); - - /* Make sure we have an RRB (or two). - */ - if (!(pcibr_soft->bs_rrb_fixed & (1 << pciio_slot))) { - if (flags & PCIBR_VCHAN1) - pciio_slot += PCIBR_RRB_SLOT_VIRTUAL; - have_rrbs = pcibr_soft->bs_rrb_valid[pciio_slot]; - if (have_rrbs < 2) { - if (pci_addr & PCI64_ATTR_PREF) - min_rrbs = 2; - else - min_rrbs = 1; - if (have_rrbs < min_rrbs) - do_pcibr_rrb_autoalloc(pcibr_soft, pciio_slot, min_rrbs - have_rrbs); - } - } -#if PCIBR_DMA_DEBUG -#if HWG_PERF_CHECK - if (xio_addr != 0x20000000) -#endif - printk("pcibr_dmatrans_addr:\n" - "\tpciio connection point %v\n" - "\txtalk connection point %v\n" - "\twanted paddr [0x%x..0x%x]\n" - "\txtalk_dmatrans_addr returned 0x%x\n" - "\tdirect 64bit address is 0x%x\n" - "\tnew flags: 0x%x\n", - pconn_vhdl, xconn_vhdl, - paddr, paddr + req_size - 1, - xio_addr, pci_addr, (uint64_t) flags); -#endif - return (pci_addr); - } - /* our flags conflict with Device(x). - */ - flags = flags - & ~PCIIO_DMA_A64 - & ~PCIBR_VCHAN0 - ; - -#if PCIBR_DMA_DEBUG - printk("pcibr_dmatrans_addr:\n" - "\tpciio connection point %v\n" - "\txtalk connection point %v\n" - "\twanted paddr [0x%x..0x%x]\n" - "\txtalk_dmatrans_addr returned 0x%x\n" - "\tUnable to set Device(x) bits for Direct-64\n", - pconn_vhdl, xconn_vhdl, - paddr, paddr + req_size - 1, - xio_addr); -#endif - } - /* Try to satisfy the request with the 32-bit direct - * map. This can fail if the configuration bits in - * Device(x) conflict with our flags, or if the - * target address is outside where DIR_OFF points. - */ - { - size_t map_size = 1ULL << 31; - iopaddr_t xio_base = pcibr_soft->bs_dir_xbase; - iopaddr_t offset = xio_addr - xio_base; - iopaddr_t endoff = req_size + offset; - - if ((req_size > map_size) || - (xio_addr < xio_base) || - (xio_port != pcibr_soft->bs_dir_xport) || - (endoff > map_size)) { -#if PCIBR_DMA_DEBUG - printk("pcibr_dmatrans_addr:\n" - "\tpciio connection point %v\n" - "\txtalk connection point %v\n" - "\twanted paddr [0x%x..0x%x]\n" - "\txtalk_dmatrans_addr returned 0x%x\n" - "\txio region outside direct32 target\n", - pconn_vhdl, xconn_vhdl, - paddr, paddr + req_size - 1, - xio_addr); -#endif - } else { - pci_addr = slotp->bss_d32_base; - if ((pci_addr != PCIBR_D32_BASE_UNSET) && - (flags == slotp->bss_d32_flags)) { - - pci_addr |= offset; - -#if DEBUG && PCIBR_DMA_DEBUG - printk("pcibr_dmatrans_addr: [reuse]\n" - "\tpciio connection point %v\n" - "\txtalk connection point %v\n" - "\twanted paddr [0x%x..0x%x]\n" - "\txtalk_dmatrans_addr returned 0x%x\n" - "\tmapped via direct32 offset 0x%x\n" - "\twill DMA via pci addr 0x%x\n", - pconn_vhdl, xconn_vhdl, - paddr, paddr + req_size - 1, - xio_addr, offset, pci_addr); -#endif - return (pci_addr); - } - if (!pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D32_BITS)) { - - pci_addr = PCI32_DIRECT_BASE; - slotp->bss_d32_flags = flags; - slotp->bss_d32_base = pci_addr; - pci_addr |= offset; - - /* Make sure we have an RRB (or two). - */ - if (!(pcibr_soft->bs_rrb_fixed & (1 << pciio_slot))) { - have_rrbs = pcibr_soft->bs_rrb_valid[pciio_slot]; - if (have_rrbs < 2) { - if (slotp->bss_device & BRIDGE_DEV_PREF) - min_rrbs = 2; - else - min_rrbs = 1; - if (have_rrbs < min_rrbs) - do_pcibr_rrb_autoalloc(pcibr_soft, pciio_slot, min_rrbs - have_rrbs); - } - } -#if PCIBR_DMA_DEBUG -#if HWG_PERF_CHECK - if (xio_addr != 0x20000000) -#endif - printk("pcibr_dmatrans_addr:\n" - "\tpciio connection point %v\n" - "\txtalk connection point %v\n" - "\twanted paddr [0x%x..0x%x]\n" - "\txtalk_dmatrans_addr returned 0x%x\n" - "\tmapped via direct32 offset 0x%x\n" - "\twill DMA via pci addr 0x%x\n" - "\tnew flags: 0x%x\n", - pconn_vhdl, xconn_vhdl, - paddr, paddr + req_size - 1, - xio_addr, offset, pci_addr, (uint64_t) flags); -#endif - return (pci_addr); - } - /* our flags conflict with Device(x). - */ -#if PCIBR_DMA_DEBUG - printk("pcibr_dmatrans_addr:\n" - "\tpciio connection point %v\n" - "\txtalk connection point %v\n" - "\twanted paddr [0x%x..0x%x]\n" - "\txtalk_dmatrans_addr returned 0x%x\n" - "\tUnable to set Device(x) bits for Direct-32\n", - pconn_vhdl, xconn_vhdl, - paddr, paddr + req_size - 1, - xio_addr); -#endif - } - } - -#if PCIBR_DMA_DEBUG - printk("pcibr_dmatrans_addr:\n" - "\tpciio connection point %v\n" - "\txtalk connection point %v\n" - "\twanted paddr [0x%x..0x%x]\n" - "\txtalk_dmatrans_addr returned 0x%x\n" - "\tno acceptable PCI address found or constructable\n", - pconn_vhdl, xconn_vhdl, - paddr, paddr + req_size - 1, - xio_addr); -#endif - - return 0; -} - -/*ARGSUSED */ -alenlist_t -pcibr_dmatrans_list(devfs_handle_t pconn_vhdl, - device_desc_t dev_desc, - alenlist_t palenlist, - unsigned flags) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; - pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); - pcibr_soft_slot_t slotp = &pcibr_soft->bs_slot[pciio_slot]; - xwidgetnum_t xio_port; - - alenlist_t pciio_alenlist = 0; - alenlist_t xtalk_alenlist = 0; - - int inplace; - unsigned direct64; - unsigned al_flags; - - iopaddr_t xio_base; - alenaddr_t xio_addr; - size_t xio_size; - - size_t map_size; - iopaddr_t pci_base; - alenaddr_t pci_addr; - - unsigned relbits = 0; - - /* merge in forced flags */ - flags |= pcibr_soft->bs_dma_flags; - - inplace = flags & PCIIO_INPLACE; - direct64 = flags & PCIIO_DMA_A64; - al_flags = (flags & PCIIO_NOSLEEP) ? AL_NOSLEEP : 0; - - if (direct64) { - map_size = 1ull << 48; - xio_base = 0; - pci_base = slotp->bss_d64_base; - if ((pci_base != PCIBR_D64_BASE_UNSET) && - (flags == slotp->bss_d64_flags)) { - /* reuse previous base info */ - } else if (pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D64_BITS) < 0) { - /* DMA configuration conflict */ - goto fail; - } else { - relbits = BRIDGE_DEV_D64_BITS; - pci_base = - pcibr_flags_to_d64(flags, pcibr_soft); - } - } else { - xio_base = pcibr_soft->bs_dir_xbase; - map_size = 1ull << 31; - pci_base = slotp->bss_d32_base; - if ((pci_base != PCIBR_D32_BASE_UNSET) && - (flags == slotp->bss_d32_flags)) { - /* reuse previous base info */ - } else if (pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D32_BITS) < 0) { - /* DMA configuration conflict */ - goto fail; - } else { - relbits = BRIDGE_DEV_D32_BITS; - pci_base = PCI32_DIRECT_BASE; - } - } - - xtalk_alenlist = xtalk_dmatrans_list(xconn_vhdl, 0, palenlist, - flags & DMAMAP_FLAGS); - if (!xtalk_alenlist) - goto fail; - - alenlist_cursor_init(xtalk_alenlist, 0, NULL); - - if (inplace) { - pciio_alenlist = xtalk_alenlist; - } else { - pciio_alenlist = alenlist_create(al_flags); - if (!pciio_alenlist) - goto fail; - } - - while (ALENLIST_SUCCESS == - alenlist_get(xtalk_alenlist, NULL, 0, - &xio_addr, &xio_size, al_flags)) { - - /* - * find which XIO port this goes to. - */ - if (XIO_PACKED(xio_addr)) { - if (xio_addr == XIO_NOWHERE) { -#if PCIBR_DMA_DEBUG - printk("pcibr_dmatrans_addr:\n" - "\tpciio connection point %v\n" - "\txtalk connection point %v\n" - "\twanted paddr [0x%x..0x%x]\n" - "\txtalk_dmatrans_addr returned 0x%x\n", - pconn_vhdl, xconn_vhdl, - paddr, paddr + req_size - 1, - xio_addr); -#endif - return 0; - } - xio_port = XIO_PORT(xio_addr); - xio_addr = XIO_ADDR(xio_addr); - } else - xio_port = pcibr_soft->bs_mxid; - - /* - * If this DMA comes back to us, - * return the PCI MEM address on - * which it would land, or NULL - * if the target is something - * on bridge other than PCI MEM. - */ - if (xio_port == pcibr_soft->bs_xid) { - pci_addr = pcibr_addr_xio_to_pci(pcibr_soft, xio_addr, xio_size); - if ( (pci_addr == (alenaddr_t)NULL) ) - goto fail; - } else if (direct64) { - ASSERT(xio_port != 0); - pci_addr = pci_base | xio_addr - | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); - } else { - iopaddr_t offset = xio_addr - xio_base; - iopaddr_t endoff = xio_size + offset; - - if ((xio_size > map_size) || - (xio_addr < xio_base) || - (xio_port != pcibr_soft->bs_dir_xport) || - (endoff > map_size)) - goto fail; - - pci_addr = pci_base + (xio_addr - xio_base); - } - - /* write the PCI DMA address - * out to the scatter-gather list. - */ - if (inplace) { - if (ALENLIST_SUCCESS != - alenlist_replace(pciio_alenlist, NULL, - &pci_addr, &xio_size, al_flags)) - goto fail; - } else { - if (ALENLIST_SUCCESS != - alenlist_append(pciio_alenlist, - pci_addr, xio_size, al_flags)) - goto fail; - } - } - - if (relbits) { - if (direct64) { - slotp->bss_d64_flags = flags; - slotp->bss_d64_base = pci_base; - } else { - slotp->bss_d32_flags = flags; - slotp->bss_d32_base = pci_base; - } - } - if (!inplace) - alenlist_done(xtalk_alenlist); - - /* Reset the internal cursor of the alenlist to be returned back - * to the caller. - */ - alenlist_cursor_init(pciio_alenlist, 0, NULL); - return pciio_alenlist; - - fail: - if (relbits) - pcibr_release_device(pcibr_soft, pciio_slot, relbits); - if (pciio_alenlist && !inplace) - alenlist_destroy(pciio_alenlist); - return 0; -} - -void -pcibr_dmamap_drain(pcibr_dmamap_t map) -{ - xtalk_dmamap_drain(map->bd_xtalk); -} - -void -pcibr_dmaaddr_drain(devfs_handle_t pconn_vhdl, - paddr_t paddr, - size_t bytes) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; - - xtalk_dmaaddr_drain(xconn_vhdl, paddr, bytes); -} - -void -pcibr_dmalist_drain(devfs_handle_t pconn_vhdl, - alenlist_t list) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; - - xtalk_dmalist_drain(xconn_vhdl, list); -} - -/* - * Get the starting PCIbus address out of the given DMA map. - * This function is supposed to be used by a close friend of PCI bridge - * since it relies on the fact that the starting address of the map is fixed at - * the allocation time in the current implementation of PCI bridge. - */ -iopaddr_t -pcibr_dmamap_pciaddr_get(pcibr_dmamap_t pcibr_dmamap) -{ - return (pcibr_dmamap->bd_pci_addr); -} - -/* ===================================================================== - * INTERRUPT MANAGEMENT - */ - -static unsigned -pcibr_intr_bits(pciio_info_t info, - pciio_intr_line_t lines) -{ - pciio_slot_t slot = pciio_info_slot_get(info); - unsigned bbits = 0; - - /* - * Currently favored mapping from PCI - * slot number and INTA/B/C/D to Bridge - * PCI Interrupt Bit Number: - * - * SLOT A B C D - * 0 0 4 0 4 - * 1 1 5 1 5 - * 2 2 6 2 6 - * 3 3 7 3 7 - * 4 4 0 4 0 - * 5 5 1 5 1 - * 6 6 2 6 2 - * 7 7 3 7 3 - */ - - if (slot < 8) { - if (lines & (PCIIO_INTR_LINE_A| PCIIO_INTR_LINE_C)) - bbits |= 1 << slot; - if (lines & (PCIIO_INTR_LINE_B| PCIIO_INTR_LINE_D)) - bbits |= 1 << (slot ^ 4); - } - return bbits; -} - - -/* - * Get the next wrapper pointer queued in the interrupt circular buffer. - */ -#ifdef KERNEL_THREADS -pcibr_intr_wrap_t -pcibr_wrap_get(pcibr_intr_cbuf_t cbuf) -{ - pcibr_intr_wrap_t wrap; - - if (cbuf->ib_in == cbuf->ib_out) - PRINT_PANIC("pcibr intr circular buffer empty, cbuf=0x%x, ib_in=ib_out=%d\n", - cbuf, cbuf->ib_out); - - wrap = cbuf->ib_cbuf[cbuf->ib_out++]; - cbuf->ib_out = cbuf->ib_out % IBUFSIZE; - return(wrap); -} - -/* - * Queue a wrapper pointer in the interrupt circular buffer. - */ -void -pcibr_wrap_put(pcibr_intr_wrap_t wrap, pcibr_intr_cbuf_t cbuf) -{ - int in; - unsigned long s; - - /* - * Multiple CPUs could be executing this code simultaneously - * if a handler has registered multiple interrupt lines and - * the interrupts are directed to different CPUs. - */ - s = mutex_spinlock(&cbuf->ib_lock); - in = (cbuf->ib_in + 1) % IBUFSIZE; - if (in == cbuf->ib_out) - PRINT_PANIC("pcibr intr circular buffer full, cbuf=0x%x, ib_in=%d\n", - cbuf, cbuf->ib_in); - - cbuf->ib_cbuf[cbuf->ib_in] = wrap; - cbuf->ib_in = in; - mutex_spinunlock(&cbuf->ib_lock, s); - return; -} -#endif /* KERNEL_THREADS */ - -/* - * There are end cases where a deadlock can occur if interrupt - * processing completes and the Bridge b_int_status bit is still set. - * - * One scenerio is if a second PCI interrupt occurs within 60ns of - * the previous interrupt being cleared. In this case the Bridge - * does not detect the transition, the Bridge b_int_status bit - * remains set, and because no transition was detected no interrupt - * packet is sent to the Hub/Heart. - * - * A second scenerio is possible when a b_int_status bit is being - * shared by multiple devices: - * Device #1 generates interrupt - * Bridge b_int_status bit set - * Device #2 generates interrupt - * interrupt processing begins - * ISR for device #1 runs and - * clears interrupt - * Device #1 generates interrupt - * ISR for device #2 runs and - * clears interrupt - * (b_int_status bit still set) - * interrupt processing completes - * - * Interrupt processing is now complete, but an interrupt is still - * outstanding for Device #1. But because there was no transition of - * the b_int_status bit, no interrupt packet will be generated and - * a deadlock will occur. - * - * To avoid these deadlock situations, this function is used - * to check if a specific Bridge b_int_status bit is set, and if so, - * cause the setting of the corresponding interrupt bit. - * - * On a XBridge (IP35), we do this by writing the appropriate Bridge Force - * Interrupt register. - */ -void -pcibr_force_interrupt(pcibr_intr_wrap_t wrap) -{ - unsigned bit; - pcibr_soft_t pcibr_soft = wrap->iw_soft; - bridge_t *bridge = pcibr_soft->bs_base; - cpuid_t cpuvertex_to_cpuid(devfs_handle_t vhdl); - - bit = wrap->iw_intr; - - if (pcibr_soft->bs_xbridge) { - bridge->b_force_pin[bit].intr = 1; - } else if ((1 << bit) & *wrap->iw_stat) { - cpuid_t cpu; - unsigned intr_bit; - xtalk_intr_t xtalk_intr = - pcibr_soft->bs_intr[bit].bsi_xtalk_intr; - - intr_bit = (short) xtalk_intr_vector_get(xtalk_intr); - cpu = cpuvertex_to_cpuid(xtalk_intr_cpu_get(xtalk_intr)); - REMOTE_CPU_SEND_INTR(cpu, intr_bit); - } -} - -/* Wrapper for pcibr interrupt threads. */ -#ifdef KERNEL_THREADS -static void -pcibr_intrd(pcibr_intr_t intr) -{ - pcibr_intr_wrap_t wrap; - - /* Called on each restart */ - ASSERT(cpuid() == intr->bi_mustruncpu); - -#ifdef ITHREAD_LATENCY - xthread_update_latstats(intr->bi_tinfo.thd_latstats); -#endif /* ITHREAD_LATENCY */ - - ASSERT(intr->bi_func != NULL); - intr->bi_func(intr->bi_arg); /* Invoke the interrupt handler */ - - /* - * The pcibr_intrd thread needs access to the wrapper struct - * specific to the current interrupt it is processing. Because - * multiple calls/wakeups to the thread could be queued, each - * potentially from a different interrupt line (PCIIO_INTR_LINE_A, - * etc), multiple wrapper struct pointers need to be queued. This - * is done via a circular buffer of wrapper struct pointers. - */ - wrap = pcibr_wrap_get(&intr->bi_ibuf); - - /* - * The interrupt handler has completed. Now decrement the running - * count tracking the number of handlers still running for this line. - * If this was the last handler to complete (i.e., iw_hdlrcnt == 0), - * avoid a potential deadlock condition and ensure that another - * interrupt will occur if the Bridge b_int_status bit is still - * set. - */ - atomicAddInt(&(wrap->iw_hdlrcnt), -1); - if (wrap->iw_hdlrcnt == 0) - pcibr_force_interrupt(wrap); - - ipsema(&intr->bi_tinfo.thd_isync); /* Sleep 'till next interrupt */ - /* NOTREACHED */ -} - -static void -pcibr_intrd_start(pcibr_intr_t intr) -{ - ASSERT(intr->bi_mustruncpu >= 0); - setmustrun(intr->bi_mustruncpu); - - xthread_set_func(KT_TO_XT(curthreadp), (xt_func_t *)pcibr_intrd, (void *)intr); - atomicSetInt(&intr->bi_tinfo.thd_flags, THD_INIT); - ipsema(&intr->bi_tinfo.thd_isync); /* Comes out in pcibr_intrd */ - /* NOTREACHED */ -} - - -static void -pcibr_thread_setup(pcibr_intr_t intr, int bridge_levels, ilvl_t intr_swlevel) -{ - char thread_name[32]; - - sprintf(thread_name, "pcibr_intrd[0x%x]", bridge_levels); - thread_name[IT_NAMELEN-1] = '\0'; - - /* XXX need to adjust priority whenever an interrupt is connected */ - intr->bi_tinfo.thd_pri = intr_swlevel; - atomicSetInt(&intr->bi_tinfo.thd_flags, THD_ISTHREAD | THD_REG); - xthread_setup(thread_name, intr_swlevel, &intr->bi_tinfo, - (xt_func_t *)pcibr_intrd_start, - (void *)intr); -} -#endif /* KERNEL_THREADS */ - - - -/*ARGSUSED */ -pcibr_intr_t -pcibr_intr_alloc(devfs_handle_t pconn_vhdl, - device_desc_t dev_desc, - pciio_intr_line_t lines, - devfs_handle_t owner_dev) -{ - pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); - pciio_slot_t pciio_slot = pcibr_info->f_slot; - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pcibr_info->f_mfast; - devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; - bridge_t *bridge = pcibr_soft->bs_base; - int is_threaded = 0; -#ifdef KERNEL_THREADS - cpuid_t mustruncpu = CPU_NONE; - cpuid_t old_intrcpu = CPU_NONE; -#endif - int thread_swlevel; - - xtalk_intr_t *xtalk_intr_p; - pcibr_intr_t *pcibr_intr_p; - pcibr_intr_list_t *intr_list_p; - - unsigned pcibr_int_bits; - unsigned pcibr_int_bit; - xtalk_intr_t xtalk_intr = (xtalk_intr_t)0; - hub_intr_t hub_intr; - pcibr_intr_t pcibr_intr; - pcibr_intr_list_t intr_entry; - pcibr_intr_list_t intr_list; - bridgereg_t int_dev; - -#if DEBUG && INTR_DEBUG - printk("%v: pcibr_intr_alloc\n" - "%v:%s%s%s%s%s\n", - owner_dev, pconn_vhdl, - !(lines & 15) ? " No INTs?" : "", - lines & 1 ? " INTA" : "", - lines & 2 ? " INTB" : "", - lines & 4 ? " INTC" : "", - lines & 8 ? " INTD" : ""); -#endif - - NEW(pcibr_intr); - if (!pcibr_intr) - return NULL; - - if (dev_desc) { - cpuid_t intr_target_from_desc(device_desc_t, int); - -#ifdef KERNEL_THREADS - is_threaded = !(device_desc_flags_get(dev_desc) & D_INTR_NOTHREAD); - if (is_threaded) { - /* - * If the device descriptor contains interrupt target info, - * save the CPU requested. This is the CPU the pcibr_intrd - * thread will be set to run on. - * - * We need to get the interrupt target info at this time, because - * the original intr_target value can be overwritten, as part of - * the xtalk_intr_alloc_nothd() call, with the actual interrupt CPU. - * This can be different than the requested CPU if the lower layers - * could not direct the hardware interrupt to the requested CPU. - * Regardless of which CPU processes the hardware interrupt, the - * ISR thread will still be setup to run on the CPU originally - * requested. - */ - mustruncpu = intr_target_from_desc(dev_desc, SUBNODE_ANY); - thread_swlevel = device_desc_intr_swlevel_get(dev_desc); - } -#endif /* KERNEL_THREADS */ - } else { - extern int default_intr_pri; - - is_threaded = 1; /* PCI interrupts are threaded, by default */ - thread_swlevel = default_intr_pri; - } - - pcibr_intr->bi_dev = pconn_vhdl; - pcibr_intr->bi_lines = lines; - pcibr_intr->bi_soft = pcibr_soft; - pcibr_intr->bi_ibits = 0; /* bits will be added below */ - pcibr_intr->bi_func = 0; /* unset until connect */ - pcibr_intr->bi_arg = 0; /* unset until connect */ - pcibr_intr->bi_flags = is_threaded ? 0 : PCIIO_INTR_NOTHREAD; - pcibr_intr->bi_mustruncpu = CPU_NONE; -#ifdef KERNEL_THREADS - pcibr_intr->bi_ibuf.ib_in = 0; - pcibr_intr->bi_ibuf.ib_out = 0; -#endif - mutex_spinlock_init(&pcibr_intr->bi_ibuf.ib_lock); - - pcibr_int_bits = pcibr_soft->bs_intr_bits((pciio_info_t)pcibr_info, lines); - - - /* - * For each PCI interrupt line requested, figure - * out which Bridge PCI Interrupt Line it maps - * to, and make sure there are xtalk resources - * allocated for it. - */ -#if DEBUG && INTR_DEBUG - printk("pcibr_int_bits: 0x%X\n", pcibr_int_bits); -#endif - for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit ++) { - if (pcibr_int_bits & (1 << pcibr_int_bit)) { - xtalk_intr_p = &pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr; - - xtalk_intr = *xtalk_intr_p; - - if (xtalk_intr == NULL) { - /* - * This xtalk_intr_alloc is constrained for two reasons: - * 1) Normal interrupts and error interrupts need to be delivered - * through a single xtalk target widget so that there aren't any - * ordering problems with DMA, completion interrupts, and error - * interrupts. (Use of xconn_vhdl forces this.) - * - * 2) On IP35, addressing constraints on IP35 and Bridge force - * us to use a single PI number for all interrupts from a - * single Bridge. (IP35-specific code forces this, and we - * verify in pcibr_setwidint.) - */ - - /* - * All code dealing with threaded PCI interrupt handlers - * is located at the pcibr level. Because of this, - * we always want the lower layers (hub/heart_intr_alloc, - * intr_level_connect) to treat us as non-threaded so we - * don't set up a duplicate threaded environment. We make - * this happen by calling a special xtalk interface. - */ - xtalk_intr = xtalk_intr_alloc_nothd(xconn_vhdl, dev_desc, - owner_dev); -#if DEBUG && INTR_DEBUG - printk("%v: xtalk_intr=0x%X\n", xconn_vhdl, xtalk_intr); -#endif - - /* both an assert and a runtime check on this: - * we need to check in non-DEBUG kernels, and - * the ASSERT gets us more information when - * we use DEBUG kernels. - */ - ASSERT(xtalk_intr != NULL); - if (xtalk_intr == NULL) { - /* it is quite possible that our - * xtalk_intr_alloc failed because - * someone else got there first, - * and we can find their results - * in xtalk_intr_p. - */ - if (!*xtalk_intr_p) { -#ifdef SUPPORT_PRINTING_V_FORMAT - PRINT_ALERT( - "pcibr_intr_alloc %v: unable to get xtalk interrupt resources", - xconn_vhdl); -#endif - /* yes, we leak resources here. */ - return 0; - } - } else if (compare_and_swap_ptr((void **) xtalk_intr_p, NULL, xtalk_intr)) { - /* - * now tell the bridge which slot is - * using this interrupt line. - */ - int_dev = bridge->b_int_device; - int_dev &= ~BRIDGE_INT_DEV_MASK(pcibr_int_bit); - int_dev |= pciio_slot << BRIDGE_INT_DEV_SHFT(pcibr_int_bit); - bridge->b_int_device = int_dev; /* XXXMP */ - -#if DEBUG && INTR_DEBUG - printk("%v: bridge intr bit %d clears my wrb\n", - pconn_vhdl, pcibr_int_bit); -#endif - } else { - /* someone else got one allocated first; - * free the one we just created, and - * retrieve the one they allocated. - */ - xtalk_intr_free(xtalk_intr); - xtalk_intr = *xtalk_intr_p; -#if PARANOID - /* once xtalk_intr is set, we never clear it, - * so if the CAS fails above, this condition - * can "never happen" ... - */ - if (!xtalk_intr) { - PRINT_ALERT( - "pcibr_intr_alloc %v: unable to set xtalk interrupt resources", - xconn_vhdl); - /* yes, we leak resources here. */ - return 0; - } -#endif - } - } - -#ifdef KERNEL_THREADS - if (is_threaded) { - cpuid_t intrcpu = cpuvertex_to_cpuid(xtalk_intr_cpu_get(xtalk_intr)); - - /* - * It is possible that 2 (or more) interrupts originating on a - * single Bridge and used by a single device were assigned to - * different CPUs. If this occurs issue a warning message for - * this sub-optimal configuration. There are two ways this - * could happen: - * - * - There were insufficient xtalk interrupt resources to - * allow all interrupts to be assigned to the same CPU. - * This is an unlikely case, but could happen if someone - * tries to target a lot of interrupts to a single CPU. - * - * - If there is no device descriptor associated with this - * device, the xtalk/hub/heart layers will not know to - * assign the same CPU to any additional interrupts this - * driver has specified, and will perform the normal load - * leveling of interrupts across CPUs. - * (The lower layers store the CPU assigned to the first - * interrupt in the device desc, if present, and then when - * called again for additional interrupts for the same device, - * use this information to assign the same CPU to these - * interrupts.) - */ - if ((old_intrcpu != CPU_NONE) && (old_intrcpu != intrcpu)) { -#if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_WARNING("Conflict on where to schedule interrupts for %v\n", pconn_vhdl); -#else - PRINT_WARNING("Conflict on where to schedule interrupts for 0x%x\n", pconn_vhdl); -#endif - PRINT_WARNING("(on cpu %d or on cpu %d), cpu %d used\n", old_intrcpu, intrcpu, intrcpu); - } - if (old_intrcpu == CPU_NONE) - old_intrcpu = intrcpu; - /* - * For threaded drivers, set the interrupt thread to run wherever - * the interrupt is targeted, or where requested in the dev_desc. - */ - if (mustruncpu != CPU_NONE) { - pcibr_intr->bi_mustruncpu = mustruncpu; - if (mustruncpu != intrcpu) { - PRINT_WARNING("Request to target PCI interrupts to CPU %d could not\n" - " be satisfied, CPU %d used. However, interrupt thread\n" - " pcibr_intrd will run on CPU %d as requested.\n" - " %v (0x%x)\n", - mustruncpu, intrcpu, mustruncpu, owner_dev, - owner_dev); - } - } else { - pcibr_intr->bi_mustruncpu = intrcpu; - } - ASSERT(pcibr_intr->bi_mustruncpu >= 0); - - } -#endif /* KERNEL_THREADS */ - - pcibr_intr->bi_ibits |= 1 << pcibr_int_bit; - - NEW(intr_entry); - intr_entry->il_next = NULL; - intr_entry->il_intr = pcibr_intr; - intr_entry->il_wrbf = &(bridge->b_wr_req_buf[pciio_slot].reg); - intr_list_p = - &pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_list; -#if DEBUG && INTR_DEBUG -#if defined(SUPPORT_PRINTING_V_FORMAT) - printk("0x%x: Bridge bit %d wrap=0x%x\n", - pconn_vhdl, pcibr_int_bit, - pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap); -#else - printk("%v: Bridge bit %d wrap=0x%x\n", - pconn_vhdl, pcibr_int_bit, - pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap); -#endif -#endif - - if (compare_and_swap_ptr((void **) intr_list_p, NULL, intr_entry)) { - /* we are the first interrupt on this bridge bit. - */ -#if DEBUG && INTR_DEBUG - printk("%v INT 0x%x (bridge bit %d) allocated [FIRST]\n", - pconn_vhdl, pcibr_int_bits, pcibr_int_bit); -#endif - continue; - } - intr_list = *intr_list_p; - pcibr_intr_p = &intr_list->il_intr; - if (compare_and_swap_ptr((void **) pcibr_intr_p, NULL, pcibr_intr)) { - /* first entry on list was erased, - * and we replaced it, so we - * don't need our intr_entry. - */ - DEL(intr_entry); -#if DEBUG && INTR_DEBUG - printk("%v INT 0x%x (bridge bit %d) replaces erased first\n", - pconn_vhdl, pcibr_int_bits, pcibr_int_bit); -#endif - continue; - } - intr_list_p = &intr_list->il_next; - if (compare_and_swap_ptr((void **) intr_list_p, NULL, intr_entry)) { - /* we are the new second interrupt on this bit. - */ - pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared = 1; -#if DEBUG && INTR_DEBUG - printk("%v INT 0x%x (bridge bit %d) is new SECOND\n", - pconn_vhdl, pcibr_int_bits, pcibr_int_bit); -#endif - continue; - } - while (1) { - pcibr_intr_p = &intr_list->il_intr; - if (compare_and_swap_ptr((void **) pcibr_intr_p, NULL, pcibr_intr)) { - /* an entry on list was erased, - * and we replaced it, so we - * don't need our intr_entry. - */ - DEL(intr_entry); -#if DEBUG && INTR_DEBUG - printk("%v INT 0x%x (bridge bit %d) replaces erased Nth\n", - pconn_vhdl, pcibr_int_bits, pcibr_int_bit); -#endif - break; - } - intr_list_p = &intr_list->il_next; - if (compare_and_swap_ptr((void **) intr_list_p, NULL, intr_entry)) { - /* entry appended to share list - */ -#if DEBUG && INTR_DEBUG - printk("%v INT 0x%x (bridge bit %d) is new Nth\n", - pconn_vhdl, pcibr_int_bits, pcibr_int_bit); -#endif - break; - } - /* step to next record in chain - */ - intr_list = *intr_list_p; - } - } - } - -#ifdef KERNEL_THREADS - if (is_threaded) { - /* Set pcibr_intr->bi_tinfo */ - pcibr_thread_setup(pcibr_intr, pcibr_int_bits, thread_swlevel); - ASSERT(!(pcibr_intr->bi_flags & PCIIO_INTR_CONNECTED)); - } -#endif /* KERNEL_THREADS */ - -#if DEBUG && INTR_DEBUG - printk("%v pcibr_intr_alloc complete\n", pconn_vhdl); -#endif - hub_intr = (hub_intr_t)xtalk_intr; - pcibr_intr->bi_irq = hub_intr->i_bit; - pcibr_intr->bi_cpu = hub_intr->i_cpuid; - return pcibr_intr; -} - -/*ARGSUSED */ -void -pcibr_intr_free(pcibr_intr_t pcibr_intr) -{ - unsigned pcibr_int_bits = pcibr_intr->bi_ibits; - pcibr_soft_t pcibr_soft = pcibr_intr->bi_soft; - unsigned pcibr_int_bit; - pcibr_intr_list_t intr_list; - int intr_shared; - xtalk_intr_t *xtalk_intrp; - - for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) { - if (pcibr_int_bits & (1 << pcibr_int_bit)) { - for (intr_list = - pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_list; - intr_list != NULL; - intr_list = intr_list->il_next) - if (compare_and_swap_ptr((void **) &intr_list->il_intr, - pcibr_intr, - NULL)) { -#if DEBUG && INTR_DEBUG - printk("%s: cleared a handler from bit %d\n", - pcibr_soft->bs_name, pcibr_int_bit); -#endif - } - /* If this interrupt line is not being shared between multiple - * devices release the xtalk interrupt resources. - */ - intr_shared = - pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared; - xtalk_intrp = &pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr; - - if ((!intr_shared) && (*xtalk_intrp)) { - - bridge_t *bridge = pcibr_soft->bs_base; - bridgereg_t int_dev; - - xtalk_intr_free(*xtalk_intrp); - *xtalk_intrp = 0; - - /* Clear the PCI device interrupt to bridge interrupt pin - * mapping. - */ - int_dev = bridge->b_int_device; - int_dev &= ~BRIDGE_INT_DEV_MASK(pcibr_int_bit); - bridge->b_int_device = int_dev; - - } - } - } - DEL(pcibr_intr); -} - -LOCAL void -pcibr_setpciint(xtalk_intr_t xtalk_intr) -{ - iopaddr_t addr = xtalk_intr_addr_get(xtalk_intr); - xtalk_intr_vector_t vect = xtalk_intr_vector_get(xtalk_intr); - bridgereg_t *int_addr = (bridgereg_t *) - xtalk_intr_sfarg_get(xtalk_intr); - - *int_addr = ((BRIDGE_INT_ADDR_HOST & (addr >> 30)) | - (BRIDGE_INT_ADDR_FLD & vect)); -} - -/*ARGSUSED */ -int -pcibr_intr_connect(pcibr_intr_t pcibr_intr, - intr_func_t intr_func, - intr_arg_t intr_arg, - void *thread) -{ - pcibr_soft_t pcibr_soft = pcibr_intr->bi_soft; - bridge_t *bridge = pcibr_soft->bs_base; - unsigned pcibr_int_bits = pcibr_intr->bi_ibits; - unsigned pcibr_int_bit; - bridgereg_t b_int_enable; - unsigned long s; - - if (pcibr_intr == NULL) - return -1; - -#if DEBUG && INTR_DEBUG - printk("%v: pcibr_intr_connect 0x%X(0x%X)\n", - pcibr_intr->bi_dev, intr_func, intr_arg); -#endif - - pcibr_intr->bi_func = intr_func; - pcibr_intr->bi_arg = intr_arg; - *((volatile unsigned *)&pcibr_intr->bi_flags) |= PCIIO_INTR_CONNECTED; - - /* - * For each PCI interrupt line requested, figure - * out which Bridge PCI Interrupt Line it maps - * to, and make sure there are xtalk resources - * allocated for it. - */ - for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) - if (pcibr_int_bits & (1 << pcibr_int_bit)) { - pcibr_intr_wrap_t intr_wrap; - xtalk_intr_t xtalk_intr; - - xtalk_intr = pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr; - - intr_wrap = &pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap; - /* - * If this interrupt line is being shared and the connect has - * already been done, no need to do it again. - */ - if (pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_connected) - continue; - - - /* - * Use the pcibr wrapper function to handle all Bridge interrupts - * regardless of whether the interrupt line is shared or not. - */ - xtalk_intr_connect(xtalk_intr, - pcibr_intr_func, - (intr_arg_t) intr_wrap, - (xtalk_intr_setfunc_t) pcibr_setpciint, - (void *) &(bridge->b_int_addr[pcibr_int_bit].addr), - 0); - pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_connected = 1; - -#if DEBUG && INTR_DEBUG - printk("%v bridge bit %d wrapper connected\n", - pcibr_intr->bi_dev, pcibr_int_bit); -#endif - } - s = pcibr_lock(pcibr_soft); - b_int_enable = bridge->b_int_enable; - b_int_enable |= pcibr_int_bits; - bridge->b_int_enable = b_int_enable; - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - pcibr_unlock(pcibr_soft, s); - - return 0; -} - -/*ARGSUSED */ -void -pcibr_intr_disconnect(pcibr_intr_t pcibr_intr) -{ - pcibr_soft_t pcibr_soft = pcibr_intr->bi_soft; - bridge_t *bridge = pcibr_soft->bs_base; - unsigned pcibr_int_bits = pcibr_intr->bi_ibits; - unsigned pcibr_int_bit; - pcibr_intr_wrap_t intr_wrap; - bridgereg_t b_int_enable; - unsigned long s; - - /* Stop calling the function. Now. - */ - *((volatile unsigned *)&pcibr_intr->bi_flags) &= ~PCIIO_INTR_CONNECTED; - pcibr_intr->bi_func = 0; - pcibr_intr->bi_arg = 0; - /* - * For each PCI interrupt line requested, figure - * out which Bridge PCI Interrupt Line it maps - * to, and disconnect the interrupt. - */ - - /* don't disable interrupts for lines that - * are shared between devices. - */ - for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) - if ((pcibr_int_bits & (1 << pcibr_int_bit)) && - (pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared)) - pcibr_int_bits &= ~(1 << pcibr_int_bit); - if (!pcibr_int_bits) - return; - - s = pcibr_lock(pcibr_soft); - b_int_enable = bridge->b_int_enable; - b_int_enable &= ~pcibr_int_bits; - bridge->b_int_enable = b_int_enable; - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - pcibr_unlock(pcibr_soft, s); - - for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) - if (pcibr_int_bits & (1 << pcibr_int_bit)) { - /* if the interrupt line is now shared, - * do not disconnect it. - */ - if (pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared) - continue; - - xtalk_intr_disconnect(pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr); - pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_connected = 0; - -#if DEBUG && INTR_DEBUG - printk("%s: xtalk disconnect done for Bridge bit %d\n", - pcibr_soft->bs_name, pcibr_int_bit); -#endif - - /* if we are sharing the interrupt line, - * connect us up; this closes the hole - * where the another pcibr_intr_alloc() - * was in progress as we disconnected. - */ - intr_wrap = &pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap; - if (!pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared) - continue; - - - xtalk_intr_connect(pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr, - pcibr_intr_func, - (intr_arg_t) intr_wrap, - (xtalk_intr_setfunc_t) pcibr_setpciint, - (void *) &(bridge->b_int_addr[pcibr_int_bit].addr), - 0); - } -} - -/*ARGSUSED */ -devfs_handle_t -pcibr_intr_cpu_get(pcibr_intr_t pcibr_intr) -{ - pcibr_soft_t pcibr_soft = pcibr_intr->bi_soft; - unsigned pcibr_int_bits = pcibr_intr->bi_ibits; - unsigned pcibr_int_bit; - - for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) - if (pcibr_int_bits & (1 << pcibr_int_bit)) - return xtalk_intr_cpu_get(pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr); - return 0; -} - -/* ===================================================================== - * INTERRUPT HANDLING - */ -LOCAL void -pcibr_clearwidint(bridge_t *bridge) -{ - bridge->b_wid_int_upper = 0; - bridge->b_wid_int_lower = 0; -} - - -LOCAL void -pcibr_setwidint(xtalk_intr_t intr) -{ - xwidgetnum_t targ = xtalk_intr_target_get(intr); - iopaddr_t addr = xtalk_intr_addr_get(intr); - xtalk_intr_vector_t vect = xtalk_intr_vector_get(intr); - widgetreg_t NEW_b_wid_int_upper, NEW_b_wid_int_lower; - widgetreg_t OLD_b_wid_int_upper, OLD_b_wid_int_lower; - - bridge_t *bridge = (bridge_t *)xtalk_intr_sfarg_get(intr); - - NEW_b_wid_int_upper = ( (0x000F0000 & (targ << 16)) | - XTALK_ADDR_TO_UPPER(addr)); - NEW_b_wid_int_lower = XTALK_ADDR_TO_LOWER(addr); - - OLD_b_wid_int_upper = bridge->b_wid_int_upper; - OLD_b_wid_int_lower = bridge->b_wid_int_lower; - -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) - /* Verify that all interrupts from this Bridge are using a single PI */ - if ((OLD_b_wid_int_upper != 0) && (OLD_b_wid_int_lower != 0)) { - /* - * Once set, these registers shouldn't change; they should - * be set multiple times with the same values. - * - * If we're attempting to change these registers, it means - * that our heuristics for allocating interrupts in a way - * appropriate for IP35 have failed, and the admin needs to - * explicitly direct some interrupts (or we need to make the - * heuristics more clever). - * - * In practice, we hope this doesn't happen very often, if - * at all. - */ - if ((OLD_b_wid_int_upper != NEW_b_wid_int_upper) || - (OLD_b_wid_int_lower != NEW_b_wid_int_lower)) { - PRINT_WARNING("Interrupt allocation is too complex.\n"); - PRINT_WARNING("Use explicit administrative interrupt targetting.\n"); - PRINT_WARNING("bridge=0x%lx targ=0x%x\n", (unsigned long)bridge, targ); - PRINT_WARNING("NEW=0x%x/0x%x OLD=0x%x/0x%x\n", - NEW_b_wid_int_upper, NEW_b_wid_int_lower, - OLD_b_wid_int_upper, OLD_b_wid_int_lower); - PRINT_PANIC("PCI Bridge interrupt targetting error\n"); - } - } -#endif /* CONFIG_SGI_IP35 */ - - bridge->b_wid_int_upper = NEW_b_wid_int_upper; - bridge->b_wid_int_lower = NEW_b_wid_int_lower; - bridge->b_int_host_err = vect; -} - -/* - * pcibr_intr_preset: called during mlreset time - * if the platform specific code needs to route - * one of the Bridge's xtalk interrupts before the - * xtalk infrastructure is available. - */ -void -pcibr_xintr_preset(void *which_widget, - int which_widget_intr, - xwidgetnum_t targ, - iopaddr_t addr, - xtalk_intr_vector_t vect) -{ - bridge_t *bridge = (bridge_t *) which_widget; - - if (which_widget_intr == -1) { - /* bridge widget error interrupt */ - bridge->b_wid_int_upper = ( (0x000F0000 & (targ << 16)) | - XTALK_ADDR_TO_UPPER(addr)); - bridge->b_wid_int_lower = XTALK_ADDR_TO_LOWER(addr); - bridge->b_int_host_err = vect; - - /* turn on all interrupts except - * the PCI interrupt requests, - * at least at heart. - */ - bridge->b_int_enable |= ~BRIDGE_IMR_INT_MSK; - - } else { - /* routing a PCI device interrupt. - * targ and low 38 bits of addr must - * be the same as the already set - * value for the widget error interrupt. - */ - bridge->b_int_addr[which_widget_intr].addr = - ((BRIDGE_INT_ADDR_HOST & (addr >> 30)) | - (BRIDGE_INT_ADDR_FLD & vect)); - /* - * now bridge can let it through; - * NB: still should be blocked at - * xtalk provider end, until the service - * function is set. - */ - bridge->b_int_enable |= 1 << vect; - } - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ -} - - -/* - * pcibr_intr_func() - * - * This is the pcibr interrupt "wrapper" function that is called, - * in interrupt context, to initiate the interrupt handler(s) registered - * (via pcibr_intr_alloc/connect) for the occuring interrupt. Non-threaded - * handlers will be called directly, and threaded handlers will have their - * thread woken up. - */ -void -pcibr_intr_func(intr_arg_t arg) -{ - pcibr_intr_wrap_t wrap = (pcibr_intr_wrap_t) arg; - reg_p wrbf; - intr_func_t func; - pcibr_intr_t intr; - pcibr_intr_list_t list; - int clearit; -#ifdef KERNEL_THREADS - int do_nonthreaded = 0; - int do_threaded = 1; - int is_threaded = 0; -#else - int do_nonthreaded = 1; - int do_threaded = 0; - int is_threaded = 0; -#endif - int nonthreaded_count = 0; - int x = 0; - - /* - * If any handler is still running from a previous interrupt - * just return. If there's a need to call the handler(s) again, - * another interrupt will be generated either by the device or by - * pcibr_force_interrupt(). - */ - - if (wrap->iw_hdlrcnt) { - return; - } - - /* - * Call all interrupt handlers registered. - * First, the pcibr_intrd threads for any threaded handlers will be - * awoken, then any non-threaded handlers will be called sequentially. - */ - - clearit = 1; - while (do_threaded || do_nonthreaded) { - for (list = wrap->iw_list; list != NULL; list = list->il_next) { - if ((intr = list->il_intr) && - (intr->bi_flags & PCIIO_INTR_CONNECTED)) { - - ASSERT(intr->bi_func); - - /* - * This device may have initiated write - * requests since the bridge last saw - * an edge on this interrupt input; flushing - * the buffer prior to invoking the handler - * should help but may not be sufficient if we - * get more requests after the flush, followed - * by the card deciding it wants service, before - * the interrupt handler checks to see if things need - * to be done. - * - * There is a similar race condition if - * an interrupt handler loops around and - * notices further service is requred. - * Perhaps we need to have an explicit - * call that interrupt handlers need to - * do between noticing that DMA to memory - * has completed, but before observing the - * contents of memory? - */ - -#ifdef KERNEL_THREADS - is_threaded = !(intr->bi_flags & PCIIO_INTR_NOTHREAD); - if (!is_threaded) { - nonthreaded_count++; - } - - if ((do_threaded) && (is_threaded)) { - /* Only need to flush write buffers if sharing */ - - if ((wrap->iw_shared) && (wrbf = list->il_wrbf)) { - if (x = *wrbf) /* write request buffer flush */ -#ifdef SUPPORT_PRINTING_V_FORMAT - PRINT_ALERT("pcibr_intr_func %v: \n" - "write buffer flush failed, wrbf=0x%x\n", - list->il_intr->bi_dev, wrbf); -#else - PRINT_ALERT("pcibr_intr_func 0x%x: \n" - "write buffer flush failed, wrbf=0x%x\n", - list->il_intr->bi_dev, wrbf); -#endif - } - - /* - * Keep a running count of the number of interrupt - * handlers that have yet to complete. - */ - atomicAddInt(&(wrap->iw_hdlrcnt), 1); - - /* - * Prior to waking up pcibr_intrd, a pointer to the - * wrapper struct corresponding to the interrupt taken - * needs to be queued in the interrupt circular buffer. - * The pcibr_intrd thread needs the wrapper pointer in - * order to decrement the handler count (iw_hdlrcnt). - */ - pcibr_wrap_put(wrap, &intr->bi_ibuf); -#ifdef ITHREAD_LATENCY - xthread_set_istamp(intr->bi_tinfo.thd_latstats); -#endif /* ITHREAD_LATENCY */ - up(&intr->bi_tinfo.thd_isync); - } else -#endif /* KERNEL_THREADS */ - if ((do_nonthreaded) && (!is_threaded)) { - /* Non-threaded. - * Call the interrupt handler at interrupt level - */ - - /* Only need to flush write buffers if sharing */ - - if ((wrap->iw_shared) && (wrbf = list->il_wrbf)) { - if ((x = *wrbf)) /* write request buffer flush */ -#ifdef SUPPORT_PRINTING_V_FORMAT - PRINT_ALERT("pcibr_intr_func %v: \n" - "write buffer flush failed, wrbf=0x%x\n", - list->il_intr->bi_dev, wrbf); -#else - PRINT_ALERT("pcibr_intr_func %p: \n" - "write buffer flush failed, wrbf=0x%x\n", - list->il_intr->bi_dev, wrbf); -#endif - } - - func = intr->bi_func; - func(intr->bi_arg); - } - - clearit = 0; - } - } - - if (do_threaded) { - /* - * All threaded handlers have been called; - * next do non-threaded, if any. - */ - do_threaded = 0; - - if (nonthreaded_count) - do_nonthreaded = 1; - } else { - do_nonthreaded = 0; - /* - * If the non-threaded handler was the last to complete, - * (i.e., no threaded handlers still running) force an - * interrupt to avoid a potential deadlock situation. - */ - if (wrap->iw_hdlrcnt == 0) { - pcibr_force_interrupt(wrap); - } - } - } - - /* If there were no handlers, - * disable the interrupt and return. - * It will get enabled again after - * a handler is connected. - * If we don't do this, we would - * sit here and spin through the - * list forever. - */ - if (clearit) { - pcibr_soft_t pcibr_soft = wrap->iw_soft; - bridge_t *bridge = pcibr_soft->bs_base; - bridgereg_t b_int_enable; - bridgereg_t mask = 1 << wrap->iw_intr; - unsigned long s; - - s = pcibr_lock(pcibr_soft); - b_int_enable = bridge->b_int_enable; - b_int_enable &= ~mask; - bridge->b_int_enable = b_int_enable; - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - pcibr_unlock(pcibr_soft, s); - return; - } -} - -/* ===================================================================== - * ERROR HANDLING - */ - -#ifdef DEBUG -#ifdef ERROR_DEBUG -#define BRIDGE_PIOERR_TIMEOUT 100 /* Timeout with ERROR_DEBUG defined */ -#else -#define BRIDGE_PIOERR_TIMEOUT 40 /* Timeout in debug mode */ -#endif -#else -#define BRIDGE_PIOERR_TIMEOUT 1 /* Timeout in non-debug mode */ -#endif - -LOCAL void -print_bridge_errcmd(uint32_t cmdword, char *errtype) -{ -#ifdef SUPPORT_PRINTING_R_FORMAT - PRINT_WARNING( - " Bridge %s error command word register %R", - errtype, cmdword, xio_cmd_bits); -#else - PRINT_WARNING( - " Bridge %s error command word register 0x%x", - errtype, cmdword); -#endif -} - -LOCAL char *pcibr_isr_errs[] = -{ - "", "", "", "", "", "", "", "", - "08: GIO non-contiguous byte enable in crosstalk packet", - "09: PCI to Crosstalk read request timeout", - "10: PCI retry operation count exhausted.", - "11: PCI bus device select timeout", - "12: PCI device reported parity error", - "13: PCI Address/Cmd parity error ", - "14: PCI Bridge detected parity error", - "15: PCI abort condition", - "16: SSRAM parity error", - "17: LLP Transmitter Retry count wrapped", - "18: LLP Transmitter side required Retry", - "19: LLP Receiver retry count wrapped", - "20: LLP Receiver check bit error", - "21: LLP Receiver sequence number error", - "22: Request packet overflow", - "23: Request operation not supported by bridge", - "24: Request packet has invalid address for bridge widget", - "25: Incoming request xtalk command word error bit set or invalid sideband", - "26: Incoming response xtalk command word error bit set or invalid sideband", - "27: Framing error, request cmd data size does not match actual", - "28: Framing error, response cmd data size does not match actual", - "29: Unexpected response arrived", - "30: Access to SSRAM beyond device limits", - "31: Multiple errors occurred", -}; - -/* - * PCI Bridge Error interrupt handling. - * This routine gets invoked from system interrupt dispatcher - * and is responsible for invoking appropriate error handler, - * depending on the type of error. - * This IS a duplicate of bridge_errintr defined specfic to IP30. - * There are some minor differences in terms of the return value and - * parameters passed. One of these two should be removed at some point - * of time. - */ -/*ARGSUSED */ -void -pcibr_error_dump(pcibr_soft_t pcibr_soft) -{ - bridge_t *bridge = pcibr_soft->bs_base; - bridgereg_t int_status; - int i; - - int_status = (bridge->b_int_status & ~BRIDGE_ISR_INT_MSK); - - PRINT_ALERT( "%s PCI BRIDGE ERROR: int_status is 0x%X", - pcibr_soft->bs_name, int_status); - - for (i = PCIBR_ISR_ERR_START; i < PCIBR_ISR_MAX_ERRS; i++) { - if (int_status & (1 << i)) { - PRINT_WARNING( "%s", pcibr_isr_errs[i]); - } - } - - if (int_status & BRIDGE_ISR_XTALK_ERROR) { - print_bridge_errcmd(bridge->b_wid_err_cmdword, ""); - - PRINT_WARNING(" Bridge error address 0x%lx", - (((uint64_t) bridge->b_wid_err_upper << 32) | - bridge->b_wid_err_lower)); - - print_bridge_errcmd(bridge->b_wid_aux_err, "Aux"); - - if (int_status & (BRIDGE_ISR_BAD_XRESP_PKT | BRIDGE_ISR_RESP_XTLK_ERR)) { - PRINT_WARNING(" Bridge response buffer: dev-num %d buff-num %d addr 0x%lx\n", - ((bridge->b_wid_resp_upper >> 20) & 0x3), - ((bridge->b_wid_resp_upper >> 16) & 0xF), - (((uint64_t) (bridge->b_wid_resp_upper & 0xFFFF) << 32) | - bridge->b_wid_resp_lower)); - } - } - if (int_status & BRIDGE_ISR_SSRAM_PERR) - PRINT_WARNING(" Bridge SSRAM parity error register 0x%x", - bridge->b_ram_perr); - - if (int_status & BRIDGE_ISR_PCIBUS_ERROR) { - PRINT_WARNING(" PCI/GIO error upper address register 0x%x", - bridge->b_pci_err_upper); - - PRINT_WARNING(" PCI/GIO error lower address register 0x%x", - bridge->b_pci_err_lower); - } - if (int_status & BRIDGE_ISR_ERROR_FATAL) { - PRINT_PANIC("PCI Bridge Error interrupt killed the system"); - /*NOTREACHED */ - } else { - PRINT_ALERT( "Non-fatal Error in Bridge.."); - } -} - -#define PCIBR_ERRINTR_GROUP(error) \ - (( error & (BRIDGE_IRR_PCI_GRP|BRIDGE_IRR_GIO_GRP) - -uint32_t -pcibr_errintr_group(uint32_t error) -{ - uint32_t group = BRIDGE_IRR_MULTI_CLR; - - if (error & BRIDGE_IRR_PCI_GRP) - group |= BRIDGE_IRR_PCI_GRP_CLR; - if (error & BRIDGE_IRR_SSRAM_GRP) - group |= BRIDGE_IRR_SSRAM_GRP_CLR; - if (error & BRIDGE_IRR_LLP_GRP) - group |= BRIDGE_IRR_LLP_GRP_CLR; - if (error & BRIDGE_IRR_REQ_DSP_GRP) - group |= BRIDGE_IRR_REQ_DSP_GRP_CLR; - if (error & BRIDGE_IRR_RESP_BUF_GRP) - group |= BRIDGE_IRR_RESP_BUF_GRP_CLR; - if (error & BRIDGE_IRR_CRP_GRP) - group |= BRIDGE_IRR_CRP_GRP_CLR; - - return group; - -} - - -/* pcibr_pioerr_check(): - * Check to see if this pcibr has a PCI PIO - * TIMEOUT error; if so, clear it and bump - * the timeout-count on any piomaps that - * could cover the address. - */ -static void -pcibr_pioerr_check(pcibr_soft_t soft) -{ - bridge_t *bridge; - bridgereg_t b_int_status; - bridgereg_t b_pci_err_lower; - bridgereg_t b_pci_err_upper; - iopaddr_t pci_addr; - pciio_slot_t slot; - pcibr_piomap_t map; - iopaddr_t base; - size_t size; - unsigned win; - int func; - - bridge = soft->bs_base; - b_int_status = bridge->b_int_status; - if (b_int_status & BRIDGE_ISR_PCIBUS_PIOERR) { - b_pci_err_lower = bridge->b_pci_err_lower; - b_pci_err_upper = bridge->b_pci_err_upper; - b_int_status = bridge->b_int_status; - if (b_int_status & BRIDGE_ISR_PCIBUS_PIOERR) { - bridge->b_int_rst_stat = (BRIDGE_IRR_PCI_GRP_CLR| - BRIDGE_IRR_MULTI_CLR); - - pci_addr = b_pci_err_upper & BRIDGE_ERRUPPR_ADDRMASK; - pci_addr = (pci_addr << 32) | b_pci_err_lower; - - slot = 8; - while (slot-- > 0) { - int nfunc = soft->bs_slot[slot].bss_ninfo; - pcibr_info_h pcibr_infoh = soft->bs_slot[slot].bss_infos; - - for (func = 0; func < nfunc; func++) { - pcibr_info_t pcibr_info = pcibr_infoh[func]; - - if (!pcibr_info) - continue; - - for (map = pcibr_info->f_piomap; - map != NULL; map = map->bp_next) { - base = map->bp_pciaddr; - size = map->bp_mapsz; - win = map->bp_space - PCIIO_SPACE_WIN(0); - if (win < 6) - base += - soft->bs_slot[slot].bss_window[win].bssw_base; - else if (map->bp_space == PCIIO_SPACE_ROM) - base += pcibr_info->f_rbase; - if ((pci_addr >= base) && (pci_addr < (base + size))) - atomic_inc(map->bp_toc); - } - } - } - } - } -} - -/* - * PCI Bridge Error interrupt handler. - * This gets invoked, whenever a PCI bridge sends an error interrupt. - * Primarily this servers two purposes. - * - If an error can be handled (typically a PIO read/write - * error, we try to do it silently. - * - If an error cannot be handled, we die violently. - * Interrupt due to PIO errors: - * - Bridge sends an interrupt, whenever a PCI operation - * done by the bridge as the master fails. Operations could - * be either a PIO read or a PIO write. - * PIO Read operation also triggers a bus error, and it's - * We primarily ignore this interrupt in that context.. - * For PIO write errors, this is the only indication. - * and we have to handle with the info from here. - * - * So, there is no way to distinguish if an interrupt is - * due to read or write error!. - */ - - -LOCAL void -pcibr_error_intr_handler(intr_arg_t arg) -{ - pcibr_soft_t pcibr_soft; - bridge_t *bridge; - bridgereg_t int_status; - bridgereg_t err_status; - int i; - - /* REFERENCED */ - bridgereg_t disable_errintr_mask = 0; - -#if PCIBR_SOFT_LIST - /* IP27 seems to be handing us junk. - */ - { - pcibr_list_p entry; - - entry = pcibr_list; - while (1) { - if (entry == NULL) { - printk("pcibr_error_intr_handler:\n" - "\tparameter (0x%p) is not a pcibr_soft!", - arg); - PRINT_PANIC("Invalid parameter to pcibr_error_intr_handler"); - } - if ((intr_arg_t) entry->bl_soft == arg) - break; - entry = entry->bl_next; - } - } -#endif - pcibr_soft = (pcibr_soft_t) arg; - bridge = pcibr_soft->bs_base; - - /* - * pcibr_error_intr_handler gets invoked whenever bridge encounters - * an error situation, and the interrupt for that error is enabled. - * This routine decides if the error is fatal or not, and takes - * action accordingly. - * - * In one case there is a need for special action. - * In case of PIO read/write timeouts due to user level, we do - * get an error interrupt. In this case, way to handle would - * be to start a timeout. If the error was due to "read", bus - * error handling code takes care of it. If error is due to write, - * it's handled at timeout - */ - - /* int_status is which bits we have to clear; - * err_status is the bits we haven't handled yet. - */ - - int_status = bridge->b_int_status & ~BRIDGE_ISR_INT_MSK; - err_status = int_status & ~BRIDGE_ISR_MULTI_ERR; - - if (!(int_status & ~BRIDGE_ISR_INT_MSK)) { - /* - * No error bit set!!. - */ - return; - } - /* If we have a PCIBUS_PIOERR, - * hand it to the logger but otherwise - * ignore the event. - */ - if (int_status & BRIDGE_ISR_PCIBUS_PIOERR) { - pcibr_pioerr_check(pcibr_soft); - err_status &= ~BRIDGE_ISR_PCIBUS_PIOERR; - int_status &= ~BRIDGE_ISR_PCIBUS_PIOERR; - } - - - if (err_status) { - struct bs_errintr_stat_s *bs_estat = pcibr_soft->bs_errintr_stat; - - for (i = PCIBR_ISR_ERR_START; i < PCIBR_ISR_MAX_ERRS; i++, bs_estat++) { - if (err_status & (1 << i)) { - uint32_t errrate = 0; - uint32_t errcount = 0; - uint32_t errinterval = 0, current_tick = 0; - int panic_on_llp_tx_retry = 0; - int is_llp_tx_retry_intr = 0; - - bs_estat->bs_errcount_total++; - -#ifdef LATER - current_tick = lbolt; -#else - current_tick = 0; -#endif - errinterval = (current_tick - bs_estat->bs_lasterr_timestamp); - errcount = (bs_estat->bs_errcount_total - - bs_estat->bs_lasterr_snapshot); - - is_llp_tx_retry_intr = (BRIDGE_ISR_LLP_TX_RETRY == (1 << i)); - - /* On a non-zero error rate (which is equivalent to - * to 100 errors /sec at least) for the LLP transmitter - * retry interrupt we need to panic the system - * to prevent potential data corruption . - * NOTE : errcount is being compared to PCIBR_ERRTIME_THRESHOLD - * to make sure that we are not seing cases like x error - * interrupts per y ticks for very low x ,y (x > y ) which - * makes error rate be > 100 /sec. - */ - - /* Check for the divide by zero condition while - * calculating the error rates. - */ - - if (errinterval) { - errrate = errcount / errinterval; - /* If able to calculate error rate - * on a LLP transmitter retry interrupt check - * if the error rate is nonzero and we have seen - * a certain minimum number of errors. - */ - if (is_llp_tx_retry_intr && - errrate && - (errcount >= PCIBR_ERRTIME_THRESHOLD)) { - panic_on_llp_tx_retry = 1; - } - } else { - errrate = 0; - /* Since we are not able to calculate the - * error rate check if we exceeded a certain - * minimum number of errors for LLP transmitter - * retries. Note that this can only happen - * within the first tick after the last snapshot. - */ - if (is_llp_tx_retry_intr && - (errcount >= PCIBR_ERRINTR_DISABLE_LEVEL)) { - panic_on_llp_tx_retry = 1; - } - } - if (panic_on_llp_tx_retry) { - static uint32_t last_printed_rate; - - if (errrate > last_printed_rate) { - last_printed_rate = errrate; - /* Print the warning only if the error rate - * for the transmitter retry interrupt - * exceeded the previously printed rate. - */ - PRINT_WARNING( - "%s: %s, Excessive error interrupts : %d/tick\n", - pcibr_soft->bs_name, - pcibr_isr_errs[i], - errrate); - - } - /* - * Update snapshot, and time - */ - bs_estat->bs_lasterr_timestamp = current_tick; - bs_estat->bs_lasterr_snapshot = - bs_estat->bs_errcount_total; - - } - /* - * If the error rate is high enough, print the error rate. - */ - if (errinterval > PCIBR_ERRTIME_THRESHOLD) { - - if (errrate > PCIBR_ERRRATE_THRESHOLD) { - PRINT_NOTICE( "%s: %s, Error rate %d/tick", - pcibr_soft->bs_name, - pcibr_isr_errs[i], - errrate); - /* - * Update snapshot, and time - */ - bs_estat->bs_lasterr_timestamp = current_tick; - bs_estat->bs_lasterr_snapshot = - bs_estat->bs_errcount_total; - } - } - if (bs_estat->bs_errcount_total > PCIBR_ERRINTR_DISABLE_LEVEL) { - /* - * We have seen a fairly large number of errors of - * this type. Let's disable the interrupt. But flash - * a message about the interrupt being disabled. - */ - PRINT_NOTICE( - "%s Disabling error interrupt type %s. Error count %d", - pcibr_soft->bs_name, - pcibr_isr_errs[i], - bs_estat->bs_errcount_total); - disable_errintr_mask |= (1 << i); - } - } - } - } - - if (disable_errintr_mask) { - /* - * Disable some high frequency errors as they - * could eat up too much cpu time. - */ - bridge->b_int_enable &= ~disable_errintr_mask; - } - /* - * If we leave the PROM cacheable, T5 might - * try to do a cache line sized writeback to it, - * which will cause a BRIDGE_ISR_INVLD_ADDR. - */ - if ((err_status & BRIDGE_ISR_INVLD_ADDR) && - (0x00000000 == bridge->b_wid_err_upper) && - (0x00C00000 == (0xFFC00000 & bridge->b_wid_err_lower)) && - (0x00402000 == (0x00F07F00 & bridge->b_wid_err_cmdword))) { - err_status &= ~BRIDGE_ISR_INVLD_ADDR; - } -#if defined (PCIBR_LLP_CONTROL_WAR) - /* - * The bridge bug, where the llp_config or control registers - * need to be read back after being written, affects an MP - * system since there could be small windows between writing - * the register and reading it back on one cpu while another - * cpu is fielding an interrupt. If we run into this scenario, - * workaround the problem by ignoring the error. (bug 454474) - * pcibr_llp_control_war_cnt keeps an approximate number of - * times we saw this problem on a system. - */ - - if ((err_status & BRIDGE_ISR_INVLD_ADDR) && - ((((uint64_t) bridge->b_wid_err_upper << 32) | (bridge->b_wid_err_lower)) - == (BRIDGE_INT_RST_STAT & 0xff0))) { -#ifdef LATER - if (kdebug) - PRINT_NOTICE( "%s bridge: ignoring llp/control address interrupt", - pcibr_soft->bs_name); -#endif - pcibr_llp_control_war_cnt++; - err_status &= ~BRIDGE_ISR_INVLD_ADDR; - } -#endif /* PCIBR_LLP_CONTROL_WAR */ - -#ifdef DEBUG - if (err_status & BRIDGE_ISR_ERROR_DUMP) - pcibr_error_dump(pcibr_soft); -#else - if (err_status & BRIDGE_ISR_ERROR_FATAL) { - printk("BRIDGE ERR STATUS 0x%x\n", err_status); - pcibr_error_dump(pcibr_soft); - } -#endif - - /* - * We can't return without re-enabling the interrupt, since - * it would cause problems for devices like IOC3 (Lost - * interrupts ?.). So, just cleanup the interrupt, and - * use saved values later.. - */ - bridge->b_int_rst_stat = pcibr_errintr_group(int_status); -} - -/* - * pcibr_addr_toslot - * Given the 'pciaddr' find out which slot this address is - * allocated to, and return the slot number. - * While we have the info handy, construct the - * function number, space code and offset as well. - * - * NOTE: if this routine is called, we don't know whether - * the address is in CFG, MEM, or I/O space. We have to guess. - * This will be the case on PIO stores, where the only way - * we have of getting the address is to check the Bridge, which - * stores the PCI address but not the space and not the xtalk - * address (from which we could get it). - */ -LOCAL int -pcibr_addr_toslot(pcibr_soft_t pcibr_soft, - iopaddr_t pciaddr, - pciio_space_t *spacep, - iopaddr_t *offsetp, - pciio_function_t *funcp) -{ - int s, f=0, w; - iopaddr_t base; - size_t size; - pciio_piospace_t piosp; - - /* - * Check if the address is in config space - */ - - if ((pciaddr >= BRIDGE_CONFIG_BASE) && (pciaddr < BRIDGE_CONFIG_END)) { - - if (pciaddr >= BRIDGE_CONFIG1_BASE) - pciaddr -= BRIDGE_CONFIG1_BASE; - else - pciaddr -= BRIDGE_CONFIG_BASE; - - s = pciaddr / BRIDGE_CONFIG_SLOT_SIZE; - pciaddr %= BRIDGE_CONFIG_SLOT_SIZE; - - if (funcp) { - f = pciaddr / 0x100; - pciaddr %= 0x100; - } - if (spacep) - *spacep = PCIIO_SPACE_CFG; - if (offsetp) - *offsetp = pciaddr; - if (funcp) - *funcp = f; - - return s; - } - for (s = 0; s < 8; s++) { - int nf = pcibr_soft->bs_slot[s].bss_ninfo; - pcibr_info_h pcibr_infoh = pcibr_soft->bs_slot[s].bss_infos; - - for (f = 0; f < nf; f++) { - pcibr_info_t pcibr_info = pcibr_infoh[f]; - - if (!pcibr_info) - continue; - for (w = 0; w < 6; w++) { - if (pcibr_info->f_window[w].w_space - == PCIIO_SPACE_NONE) { - continue; - } - base = pcibr_info->f_window[w].w_base; - size = pcibr_info->f_window[w].w_size; - - if ((pciaddr >= base) && (pciaddr < (base + size))) { - if (spacep) - *spacep = PCIIO_SPACE_WIN(w); - if (offsetp) - *offsetp = pciaddr - base; - if (funcp) - *funcp = f; - return s; - } /* endif match */ - } /* next window */ - } /* next func */ - } /* next slot */ - - /* - * Check if the address was allocated as part of the - * pcibr_piospace_alloc calls. - */ - for (s = 0; s < 8; s++) { - int nf = pcibr_soft->bs_slot[s].bss_ninfo; - pcibr_info_h pcibr_infoh = pcibr_soft->bs_slot[s].bss_infos; - - for (f = 0; f < nf; f++) { - pcibr_info_t pcibr_info = pcibr_infoh[f]; - - if (!pcibr_info) - continue; - piosp = pcibr_info->f_piospace; - while (piosp) { - if ((piosp->start <= pciaddr) && - ((piosp->count + piosp->start) > pciaddr)) { - if (spacep) - *spacep = piosp->space; - if (offsetp) - *offsetp = pciaddr - piosp->start; - return s; - } /* endif match */ - piosp = piosp->next; - } /* next piosp */ - } /* next func */ - } /* next slot */ - - /* - * Some other random address on the PCI bus ... - * we have no way of knowing whether this was - * a MEM or I/O access; so, for now, we just - * assume that the low 1G is MEM, the next - * 3G is I/O, and anything above the 4G limit - * is obviously MEM. - */ - - if (spacep) - *spacep = ((pciaddr < (1ul << 30)) ? PCIIO_SPACE_MEM : - (pciaddr < (4ul << 30)) ? PCIIO_SPACE_IO : - PCIIO_SPACE_MEM); - if (offsetp) - *offsetp = pciaddr; - - return PCIIO_SLOT_NONE; - -} - -LOCAL void -pcibr_error_cleanup(pcibr_soft_t pcibr_soft, int error_code) -{ - bridge_t *bridge = pcibr_soft->bs_base; - - ASSERT(error_code & IOECODE_PIO); - error_code = error_code; - - bridge->b_int_rst_stat = - (BRIDGE_IRR_PCI_GRP_CLR | BRIDGE_IRR_MULTI_CLR); - (void) bridge->b_wid_tflush; /* flushbus */ -} - -/* - * pcibr_error_extract - * Given the 'pcibr vertex handle' find out which slot - * the bridge status error address (from pcibr_soft info - * hanging off the vertex) - * allocated to, and return the slot number. - * While we have the info handy, construct the - * space code and offset as well. - * - * NOTE: if this routine is called, we don't know whether - * the address is in CFG, MEM, or I/O space. We have to guess. - * This will be the case on PIO stores, where the only way - * we have of getting the address is to check the Bridge, which - * stores the PCI address but not the space and not the xtalk - * address (from which we could get it). - * - * XXX- this interface has no way to return the function - * number on a multifunction card, even though that data - * is available. - */ - -pciio_slot_t -pcibr_error_extract(devfs_handle_t pcibr_vhdl, - pciio_space_t *spacep, - iopaddr_t *offsetp) -{ - pcibr_soft_t pcibr_soft = 0; - iopaddr_t bserr_addr; - bridge_t *bridge; - pciio_slot_t slot = PCIIO_SLOT_NONE; - arbitrary_info_t rev; - - /* Do a sanity check as to whether we really got a - * bridge vertex handle. - */ - if (hwgraph_info_get_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, &rev) != - GRAPH_SUCCESS) - return(slot); - - pcibr_soft = pcibr_soft_get(pcibr_vhdl); - if (pcibr_soft) { - bridge = pcibr_soft->bs_base; - bserr_addr = - bridge->b_pci_err_lower | - ((uint64_t) (bridge->b_pci_err_upper & - BRIDGE_ERRUPPR_ADDRMASK) << 32); - - slot = pcibr_addr_toslot(pcibr_soft, bserr_addr, - spacep, offsetp, NULL); - } - return slot; -} - -/*ARGSUSED */ -void -pcibr_device_disable(pcibr_soft_t pcibr_soft, int devnum) -{ - /* - * XXX - * Device failed to handle error. Take steps to - * disable this device ? HOW TO DO IT ? - * - * If there are any Read response buffers associated - * with this device, it's time to get them back!! - * - * We can disassociate any interrupt level associated - * with this device, and disable that interrupt level - * - * For now it's just a place holder - */ -} - -/* - * pcibr_pioerror - * Handle PIO error that happened at the bridge pointed by pcibr_soft. - * - * Queries the Bus interface attached to see if the device driver - * mapping the device-number that caused error can handle the - * situation. If so, it will clean up any error, and return - * indicating the error was handled. If the device driver is unable - * to handle the error, it expects the bus-interface to disable that - * device, and takes any steps needed here to take away any resources - * associated with this device. - */ - -#define BEM_ADD_STR(s) printk("%s", (s)) -#ifdef SUPPORT_SGI_CMN_ERR_STUFF -#define BEM_ADD_VAR(v) printk("\t%20s: 0x%x\n", #v, (v)) -#define BEM_ADD_REG(r) printk("\t%20s: %R\n", #r, (r), r ## _desc) - -#define BEM_ADD_NSPC(n,s) printk("\t%20s: %R\n", n, s, space_desc) -#else -#define BEM_ADD_VAR(v) -#define BEM_ADD_REG(r) -#define BEM_ADD_NSPC(n,s) -#endif -#define BEM_ADD_SPC(s) BEM_ADD_NSPC(#s, s) - -/* BEM_ADD_IOE doesn't dump the whole ioerror, it just - * decodes the PCI specific portions -- we count on our - * callers to dump the raw IOE data. - */ -#ifdef LATER -#define BEM_ADD_IOE(ioe) \ - do { \ - if (IOERROR_FIELDVALID(ioe, busspace)) { \ - unsigned spc; \ - unsigned win; \ - \ - spc = IOERROR_GETVALUE(ioe, busspace); \ - win = spc - PCIIO_SPACE_WIN(0); \ - \ - switch (spc) { \ - case PCIIO_SPACE_CFG: \ - printk("\tPCI Slot %d Func %d CFG space Offset 0x%x\n", \ - pciio_widgetdev_slot_get(IOERROR_GETVALUE(ioe, widgetdev)), \ - pciio_widgetdev_func_get(IOERROR_GETVALUE(ioe, widgetdev)), \ - IOERROR_GETVALUE(ioe, busaddr)); \ - break; \ - case PCIIO_SPACE_IO: \ - printk("\tPCI I/O space Offset 0x%x\n", \ - IOERROR_GETVALUE(ioe, busaddr)); \ - break; \ - case PCIIO_SPACE_MEM: \ - case PCIIO_SPACE_MEM32: \ - case PCIIO_SPACE_MEM64: \ - printk("\tPCI MEM space Offset 0x%x\n", \ - IOERROR_GETVALUE(ioe, busaddr)); \ - break; \ - default: \ - if (win < 6) { \ - printk("\tPCI Slot %d Func %d Window %d Offset 0x%x\n",\ - pciio_widgetdev_slot_get(IOERROR_GETVALUE(ioe, widgetdev)), \ - pciio_widgetdev_func_get(IOERROR_GETVALUE(ioe, widgetdev)), \ - win, \ - IOERROR_GETVALUE(ioe, busaddr)); \ - } \ - break; \ - } \ - } \ - } while (0) -#else -#define BEM_ADD_IOE(ioe) -#endif - -/*ARGSUSED */ -LOCAL int -pcibr_pioerror( - pcibr_soft_t pcibr_soft, - int error_code, - ioerror_mode_t mode, - ioerror_t *ioe) -{ - int retval = IOERROR_HANDLED; - - devfs_handle_t pcibr_vhdl = pcibr_soft->bs_vhdl; - bridge_t *bridge = pcibr_soft->bs_base; - - bridgereg_t bridge_int_status; - bridgereg_t bridge_pci_err_lower; - bridgereg_t bridge_pci_err_upper; - bridgereg_t bridge_pci_err_addr; - - iopaddr_t bad_xaddr; - - pciio_space_t raw_space; /* raw PCI space */ - iopaddr_t raw_paddr; /* raw PCI address */ - - pciio_space_t space; /* final PCI space */ - pciio_slot_t slot; /* final PCI slot, if appropriate */ - pciio_function_t func; /* final PCI func, if appropriate */ - iopaddr_t offset; /* final PCI offset */ - - int cs, cw, cf; - pciio_space_t wx; - iopaddr_t wb; - size_t ws; - iopaddr_t wl; - - - /* - * We expect to have an "xtalkaddr" coming in, - * and need to construct the slot/space/offset. - */ - -#ifdef LATER - bad_xaddr = IOERROR_GETVALUE(ioe, xtalkaddr); -#else - bad_xaddr = -1; -#endif - - slot = PCIIO_SLOT_NONE; - func = PCIIO_FUNC_NONE; - raw_space = PCIIO_SPACE_NONE; - raw_paddr = 0; - - if ((bad_xaddr >= BRIDGE_TYPE0_CFG_DEV0) && - (bad_xaddr < BRIDGE_TYPE1_CFG)) { - raw_paddr = bad_xaddr - BRIDGE_TYPE0_CFG_DEV0; - slot = raw_paddr / BRIDGE_TYPE0_CFG_SLOT_OFF; - raw_paddr = raw_paddr % BRIDGE_TYPE0_CFG_SLOT_OFF; - raw_space = PCIIO_SPACE_CFG; - } - if ((bad_xaddr >= BRIDGE_TYPE1_CFG) && - (bad_xaddr < (BRIDGE_TYPE1_CFG + 0x1000))) { - /* Type 1 config space: - * slot and function numbers not known. - * Perhaps we can read them back? - */ - raw_paddr = bad_xaddr - BRIDGE_TYPE1_CFG; - raw_space = PCIIO_SPACE_CFG; - } - if ((bad_xaddr >= BRIDGE_DEVIO0) && - (bad_xaddr < BRIDGE_DEVIO(BRIDGE_DEV_CNT))) { - int x; - - raw_paddr = bad_xaddr - BRIDGE_DEVIO0; - x = raw_paddr / BRIDGE_DEVIO_OFF; - raw_paddr %= BRIDGE_DEVIO_OFF; - /* first two devio windows are double-sized */ - if ((x == 1) || (x == 3)) - raw_paddr += BRIDGE_DEVIO_OFF; - if (x > 0) - x--; - if (x > 1) - x--; - /* x is which devio reg; no guarantee - * PCI slot x will be responding. - * still need to figure out who decodes - * space/offset on the bus. - */ - raw_space = pcibr_soft->bs_slot[x].bss_devio.bssd_space; - if (raw_space == PCIIO_SPACE_NONE) { - /* Someone got an error because they - * accessed the PCI bus via a DevIO(x) - * window that pcibr has not yet assigned - * to any specific PCI address. It is - * quite possible that the Device(x) - * register has been changed since they - * made their access, but we will give it - * our best decode shot. - */ - raw_space = pcibr_soft->bs_slot[x].bss_device - & BRIDGE_DEV_DEV_IO_MEM - ? PCIIO_SPACE_MEM - : PCIIO_SPACE_IO; - raw_paddr += - (pcibr_soft->bs_slot[x].bss_device & - BRIDGE_DEV_OFF_MASK) << - BRIDGE_DEV_OFF_ADDR_SHFT; - } else - raw_paddr += pcibr_soft->bs_slot[x].bss_devio.bssd_base; - } - if ((bad_xaddr >= BRIDGE_PCI_MEM32_BASE) && - (bad_xaddr <= BRIDGE_PCI_MEM32_LIMIT)) { - raw_space = PCIIO_SPACE_MEM32; - raw_paddr = bad_xaddr - BRIDGE_PCI_MEM32_BASE; - } - if ((bad_xaddr >= BRIDGE_PCI_MEM64_BASE) && - (bad_xaddr <= BRIDGE_PCI_MEM64_LIMIT)) { - raw_space = PCIIO_SPACE_MEM64; - raw_paddr = bad_xaddr - BRIDGE_PCI_MEM64_BASE; - } - if ((bad_xaddr >= BRIDGE_PCI_IO_BASE) && - (bad_xaddr <= BRIDGE_PCI_IO_LIMIT)) { - raw_space = PCIIO_SPACE_IO; - raw_paddr = bad_xaddr - BRIDGE_PCI_IO_BASE; - } - space = raw_space; - offset = raw_paddr; - - if ((slot == PCIIO_SLOT_NONE) && (space != PCIIO_SPACE_NONE)) { - /* we've got a space/offset but not which - * PCI slot decodes it. Check through our - * notions of which devices decode where. - * - * Yes, this "duplicates" some logic in - * pcibr_addr_toslot; the difference is, - * this code knows which space we are in, - * and can really really tell what is - * going on (no guessing). - */ - - for (cs = 0; (cs < 8) && (slot == PCIIO_SLOT_NONE); cs++) { - int nf = pcibr_soft->bs_slot[cs].bss_ninfo; - pcibr_info_h pcibr_infoh = pcibr_soft->bs_slot[cs].bss_infos; - - for (cf = 0; (cf < nf) && (slot == PCIIO_SLOT_NONE); cf++) { - pcibr_info_t pcibr_info = pcibr_infoh[cf]; - - if (!pcibr_info) - continue; - for (cw = 0; (cw < 6) && (slot == PCIIO_SLOT_NONE); ++cw) { - if (((wx = pcibr_info->f_window[cw].w_space) != PCIIO_SPACE_NONE) && - ((wb = pcibr_info->f_window[cw].w_base) != 0) && - ((ws = pcibr_info->f_window[cw].w_size) != 0) && - ((wl = wb + ws) > wb) && - ((wb <= offset) && (wl > offset))) { - /* MEM, MEM32 and MEM64 need to - * compare as equal ... - */ - if ((wx == space) || - (((wx == PCIIO_SPACE_MEM) || - (wx == PCIIO_SPACE_MEM32) || - (wx == PCIIO_SPACE_MEM64)) && - ((space == PCIIO_SPACE_MEM) || - (space == PCIIO_SPACE_MEM32) || - (space == PCIIO_SPACE_MEM64)))) { - slot = cs; - func = cf; - space = PCIIO_SPACE_WIN(cw); - offset -= wb; - } /* endif window space match */ - } /* endif window valid and addr match */ - } /* next window unless slot set */ - } /* next func unless slot set */ - } /* next slot unless slot set */ - /* XXX- if slot is still -1, no PCI devices are - * decoding here using their standard PCI BASE - * registers. This would be a really good place - * to cross-coordinate with the pciio PCI - * address space allocation routines, to find - * out if this address is "allocated" by any of - * our subsidiary devices. - */ - } - /* Scan all piomap records on this PCI bus to update - * the TimeOut Counters on all matching maps. If we - * don't already know the slot number, take it from - * the first matching piomap. Note that we have to - * compare maps against raw_space and raw_paddr - * since space and offset could already be - * window-relative. - * - * There is a chance that one CPU could update - * through this path, and another CPU could also - * update due to an interrupt. Closing this hole - * would only result in the possibility of some - * errors never getting logged at all, and since the - * use for bp_toc is as a logical test rather than a - * strict count, the excess counts are not a - * problem. - */ - for (cs = 0; cs < 8; ++cs) { - int nf = pcibr_soft->bs_slot[cs].bss_ninfo; - pcibr_info_h pcibr_infoh = pcibr_soft->bs_slot[cs].bss_infos; - - for (cf = 0; cf < nf; cf++) { - pcibr_info_t pcibr_info = pcibr_infoh[cf]; - pcibr_piomap_t map; - - if (!pcibr_info) - continue; - - for (map = pcibr_info->f_piomap; - map != NULL; map = map->bp_next) { - wx = map->bp_space; - wb = map->bp_pciaddr; - ws = map->bp_mapsz; - cw = wx - PCIIO_SPACE_WIN(0); - if (cw < 6) { - wb += pcibr_soft->bs_slot[cs].bss_window[cw].bssw_base; - wx = pcibr_soft->bs_slot[cs].bss_window[cw].bssw_space; - } - if (wx == PCIIO_SPACE_ROM) { - wb += pcibr_info->f_rbase; - wx = PCIIO_SPACE_MEM; - } - if ((wx == PCIIO_SPACE_MEM32) || - (wx == PCIIO_SPACE_MEM64)) - wx = PCIIO_SPACE_MEM; - wl = wb + ws; - if ((wx == raw_space) && (raw_paddr >= wb) && (raw_paddr < wl)) { - atomic_inc(map->bp_toc); - if (slot == PCIIO_SLOT_NONE) { - slot = cs; - space = map->bp_space; - if (cw < 6) - offset -= pcibr_soft->bs_slot[cs].bss_window[cw].bssw_base; - } - } - } - } - } - - if (space != PCIIO_SPACE_NONE) { - if (slot != PCIIO_SLOT_NONE) { -#ifdef LATER - if (func != PCIIO_FUNC_NONE) - IOERROR_SETVALUE(ioe, widgetdev, - pciio_widgetdev_create(slot,func)); - else - IOERROR_SETVALUE(ioe, widgetdev, - pciio_widgetdev_create(slot,0)); -#else - if (func != PCIIO_FUNC_NONE) { - IOERROR_SETVALUE(ioe, widgetdev, - pciio_widgetdev_create(slot,func)); - } else { - IOERROR_SETVALUE(ioe, widgetdev, - pciio_widgetdev_create(slot,0)); - } -#endif - } - - IOERROR_SETVALUE(ioe, busspace, space); - IOERROR_SETVALUE(ioe, busaddr, offset); - } - if (mode == MODE_DEVPROBE) { - /* - * During probing, we don't really care what the - * error is. Clean up the error in Bridge, notify - * subsidiary devices, and return success. - */ - pcibr_error_cleanup(pcibr_soft, error_code); - - /* if appropriate, give the error handler for this slot - * a shot at this probe access as well. - */ - return (slot == PCIIO_SLOT_NONE) ? IOERROR_HANDLED : - pciio_error_handler(pcibr_vhdl, error_code, mode, ioe); - } - /* - * If we don't know what "PCI SPACE" the access - * was targeting, we may have problems at the - * Bridge itself. Don't touch any bridge registers, - * and do complain loudly. - */ - - if (space == PCIIO_SPACE_NONE) { - printk("XIO Bus Error at %s\n" - "\taccess to XIO bus offset 0x%lx\n" - "\tdoes not correspond to any PCI address\n", - pcibr_soft->bs_name, bad_xaddr); - - /* caller will dump contents of ioe struct */ - return IOERROR_XTALKLEVEL; - } - /* - * Read the PCI Bridge error log registers. - */ - bridge_int_status = bridge->b_int_status; - bridge_pci_err_upper = bridge->b_pci_err_upper; - bridge_pci_err_lower = bridge->b_pci_err_lower; - - bridge_pci_err_addr = - bridge_pci_err_lower - | (((iopaddr_t) bridge_pci_err_upper - & BRIDGE_ERRUPPR_ADDRMASK) << 32); - - /* - * Actual PCI Error handling situation. - * Typically happens when a user level process accesses - * PCI space, and it causes some error. - * - * Due to PCI Bridge implementation, we get two indication - * for a read error: an interrupt and a Bus error. - * We like to handle read error in the bus error context. - * But the interrupt comes and goes before bus error - * could make much progress. (NOTE: interrupd does - * come in _after_ bus error processing starts. But it's - * completed by the time bus error code reaches PCI PIO - * error handling. - * Similarly write error results in just an interrupt, - * and error handling has to be done at interrupt level. - * There is no way to distinguish at interrupt time, if an - * error interrupt is due to read/write error.. - */ - - /* We know the xtalk addr, the raw PCI bus space, - * the raw PCI bus address, the decoded PCI bus - * space, the offset within that space, and the - * decoded PCI slot (which may be "PCIIO_SLOT_NONE" if no slot - * is known to be involved). - */ - - /* - * Hand the error off to the handler registered - * for the slot that should have decoded the error, - * or to generic PCI handling (if pciio decides that - * such is appropriate). - */ - retval = pciio_error_handler(pcibr_vhdl, error_code, mode, ioe); - - if (retval != IOERROR_HANDLED) { - - /* Generate a generic message for IOERROR_UNHANDLED - * since the subsidiary handlers were silent, and - * did no recovery. - */ - if (retval == IOERROR_UNHANDLED) { - retval = IOERROR_PANIC; - - /* we may or may not want to print some of this, - * depending on debug level and which error code. - */ - - PRINT_ALERT( - "PIO Error on PCI Bus %s", - pcibr_soft->bs_name); - /* this decodes part of the ioe; our caller - * will dump the raw details in DEBUG and - * kdebug kernels. - */ - BEM_ADD_IOE(ioe); - } -#if defined(FORCE_ERRORS) - if (0) { -#elif !DEBUG - if (kdebug) { -#endif - /* - * dump raw data from bridge - */ - - BEM_ADD_STR("DEBUG DATA -- raw info from Bridge ASIC:\n"); - BEM_ADD_REG(bridge_int_status); - BEM_ADD_VAR(bridge_pci_err_upper); - BEM_ADD_VAR(bridge_pci_err_lower); - BEM_ADD_VAR(bridge_pci_err_addr); - BEM_ADD_SPC(raw_space); - BEM_ADD_VAR(raw_paddr); - if (IOERROR_FIELDVALID(ioe, widgetdev)) { - -#ifdef LATER - slot = pciio_widgetdev_slot_get(IOERROR_GETVALUE(ioe, - widgetdev)); - func = pciio_widgetdev_func_get(IOERROR_GETVALUE(ioe, - widgetdev)); -#else - slot = -1; - func = -1; -#endif - if (slot < 8) { -#ifdef SUPPORT_SGI_CMN_ERR_STUFF - bridgereg_t device = bridge->b_device[slot].reg; -#endif - - BEM_ADD_VAR(slot); - BEM_ADD_VAR(func); - BEM_ADD_REG(device); - } - } -#if !DEBUG || defined(FORCE_ERRORS) - } -#endif - - /* - * Since error could not be handled at lower level, - * error data logged has not been cleared. - * Clean up errors, and - * re-enable bridge to interrupt on error conditions. - * NOTE: Wheather we get the interrupt on PCI_ABORT or not is - * dependent on INT_ENABLE register. This write just makes sure - * that if the interrupt was enabled, we do get the interrupt. - * - * CAUTION: Resetting bit BRIDGE_IRR_PCI_GRP_CLR, acknowledges - * a group of interrupts. If while handling this error, - * some other error has occurred, that would be - * implicitly cleared by this write. - * Need a way to ensure we don't inadvertently clear some - * other errors. - */ -#ifdef LATER - if (IOERROR_FIELDVALID(ioe, widgetdev)) - pcibr_device_disable(pcibr_soft, - pciio_widgetdev_slot_get( - IOERROR_GETVALUE(ioe, widgetdev))); -#endif - - if (mode == MODE_DEVUSERERROR) - pcibr_error_cleanup(pcibr_soft, error_code); - } - return retval; -} - -/* - * bridge_dmaerror - * Some error was identified in a DMA transaction. - * This routine will identify the that caused the error, - * and try to invoke the appropriate bus service to handle this. - */ - -#define BRIDGE_DMA_READ_ERROR (BRIDGE_ISR_RESP_XTLK_ERR|BRIDGE_ISR_XREAD_REQ_TIMEOUT) - -int -pcibr_dmard_error( - pcibr_soft_t pcibr_soft, - int error_code, - ioerror_mode_t mode, - ioerror_t *ioe) -{ - devfs_handle_t pcibr_vhdl = pcibr_soft->bs_vhdl; - bridge_t *bridge = pcibr_soft->bs_base; - bridgereg_t bus_lowaddr, bus_uppraddr; - int retval = 0; - int bufnum; - - /* - * In case of DMA errors, bridge should have logged the - * address that caused the error. - * Look up the address, in the bridge error registers, and - * take appropriate action - */ -#ifdef LATER - ASSERT(IOERROR_GETVALUE(ioe, widgetnum) == pcibr_soft->bs_xid); - ASSERT(bridge); -#endif - - /* - * read error log registers - */ - bus_lowaddr = bridge->b_wid_resp_lower; - bus_uppraddr = bridge->b_wid_resp_upper; - - bufnum = BRIDGE_RESP_ERRUPPR_BUFNUM(bus_uppraddr); - IOERROR_SETVALUE(ioe, widgetdev, - pciio_widgetdev_create( - BRIDGE_RESP_ERRUPPR_DEVICE(bus_uppraddr), - 0)); - IOERROR_SETVALUE(ioe, busaddr, - (bus_lowaddr | - ((iopaddr_t) - (bus_uppraddr & - BRIDGE_ERRUPPR_ADDRMASK) << 32))); - - /* - * need to ensure that the xtalk address in ioe - * maps to PCI error address read from bridge. - * How to convert PCI address back to Xtalk address ? - * (better idea: convert XTalk address to PCI address - * and then do the compare!) - */ - - retval = pciio_error_handler(pcibr_vhdl, error_code, mode, ioe); - if (retval != IOERROR_HANDLED) -#ifdef LATER - pcibr_device_disable(pcibr_soft, - pciio_widgetdev_slot_get( - IOERROR_GETVALUE(ioe,widgetdev))); -#else - pcibr_device_disable(pcibr_soft, - pciio_widgetdev_slot_get(-1)); -#endif - - /* - * Re-enable bridge to interrupt on BRIDGE_IRR_RESP_BUF_GRP_CLR - * NOTE: Wheather we get the interrupt on BRIDGE_IRR_RESP_BUF_GRP_CLR or - * not is dependent on INT_ENABLE register. This write just makes sure - * that if the interrupt was enabled, we do get the interrupt. - */ - bridge->b_int_rst_stat = BRIDGE_IRR_RESP_BUF_GRP_CLR; - - /* - * Also, release the "bufnum" back to buffer pool that could be re-used. - * This is done by "disabling" the buffer for a moment, then restoring - * the original assignment. - */ - - { - reg_p regp; - bridgereg_t regv; - bridgereg_t mask; - - regp = (bufnum & 1) - ? &bridge->b_odd_resp - : &bridge->b_even_resp; - - mask = 0xF << ((bufnum >> 1) * 4); - - regv = *regp; - *regp = regv & ~mask; - *regp = regv; - } - - return retval; -} - -/* - * pcibr_dmawr_error: - * Handle a dma write error caused by a device attached to this bridge. - * - * ioe has the widgetnum, widgetdev, and memaddr fields updated - * But we don't know the PCI address that corresponds to "memaddr" - * nor do we know which device driver is generating this address. - * - * There is no easy way to find out the PCI address(es) that map - * to a specific system memory address. Bus handling code is also - * of not much help, since they don't keep track of the DMA mapping - * that have been handed out. - * So it's a dead-end at this time. - * - * If translation is available, we could invoke the error handling - * interface of the device driver. - */ -/*ARGSUSED */ -int -pcibr_dmawr_error( - pcibr_soft_t pcibr_soft, - int error_code, - ioerror_mode_t mode, - ioerror_t *ioe) -{ - devfs_handle_t pcibr_vhdl = pcibr_soft->bs_vhdl; - int retval; - - retval = pciio_error_handler(pcibr_vhdl, error_code, mode, ioe); - -#ifdef LATER - if (retval != IOERROR_HANDLED) { - pcibr_device_disable(pcibr_soft, - pciio_widgetdev_slot_get( - IOERROR_GETVALUE(ioe, widgetdev))); - - } -#endif - return retval; -} - -/* - * Bridge error handler. - * Interface to handle all errors that involve bridge in some way. - * - * This normally gets called from xtalk error handler. - * ioe has different set of fields set depending on the error that - * was encountered. So, we have a bit field indicating which of the - * fields are valid. - * - * NOTE: This routine could be operating in interrupt context. So, - * don't try to sleep here (till interrupt threads work!!) - */ -LOCAL int -pcibr_error_handler( - error_handler_arg_t einfo, - int error_code, - ioerror_mode_t mode, - ioerror_t *ioe) -{ - pcibr_soft_t pcibr_soft; - int retval = IOERROR_BADERRORCODE; - - pcibr_soft = (pcibr_soft_t) einfo; - - /* If we are in the action handling phase clean out the error state - * on the xswitch. - */ -#if defined(CONFIG_SGI_IO_ERROR_HANDLING) - if (e_state == ERROR_STATE_ACTION) - (void)error_state_set(xconn_vhdl, ERROR_STATE_NONE); -#endif - -#if DEBUG && ERROR_DEBUG - printk("%s: pcibr_error_handler\n", pcibr_soft->bs_name); -#endif - - ASSERT(pcibr_soft != NULL); - - if (error_code & IOECODE_PIO) - retval = pcibr_pioerror(pcibr_soft, error_code, mode, ioe); - - if (error_code & IOECODE_DMA) { - if (error_code & IOECODE_READ) { - /* - * DMA read error occurs when a device attached to the bridge - * tries to read some data from system memory, and this - * either results in a timeout or access error. - * First case is indicated by the bit "XREAD_REQ_TOUT" - * and second case by "RESP_XTALK_ERROR" bit in bridge error - * interrupt status register. - * - * pcibr_error_intr_handler would get invoked first, and it has - * the responsibility of calling pcibr_error_handler with - * suitable parameters. - */ - - retval = pcibr_dmard_error(pcibr_soft, error_code, MODE_DEVERROR, ioe); - } - if (error_code & IOECODE_WRITE) { - /* - * A device attached to this bridge has been generating - * bad DMA writes. Find out the device attached, and - * slap on it's wrist. - */ - - retval = pcibr_dmawr_error(pcibr_soft, error_code, MODE_DEVERROR, ioe); - } - } - return retval; - -} - -/* - * Reenable a device after handling the error. - * This is called by the lower layers when they wish to be reenabled - * after an error. - * Note that each layer would be calling the previous layer to reenable - * first, before going ahead with their own re-enabling. - */ - -int -pcibr_error_devenable(devfs_handle_t pconn_vhdl, int error_code) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - - ASSERT(error_code & IOECODE_PIO); - - /* If the error is not known to be a write, - * we have to call devenable. - * write errors are isolated to the bridge. - */ - if (!(error_code & IOECODE_WRITE)) { - devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; - int rc; - - rc = xtalk_error_devenable(xconn_vhdl, pciio_slot, error_code); - if (rc != IOERROR_HANDLED) - return rc; - } - pcibr_error_cleanup(pcibr_soft, error_code); - return IOERROR_HANDLED; -} - -/* ===================================================================== - * CONFIGURATION MANAGEMENT - */ -/*ARGSUSED */ -void -pcibr_provider_startup(devfs_handle_t pcibr) -{ -} - -/*ARGSUSED */ -void -pcibr_provider_shutdown(devfs_handle_t pcibr) -{ -} - -int -pcibr_reset(devfs_handle_t conn) -{ - pciio_info_t pciio_info = pciio_info_get(conn); - pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - bridge_t *bridge = pcibr_soft->bs_base; - bridgereg_t ctlreg; - unsigned cfgctl[8]; - unsigned long s; - int f, nf; - pcibr_info_h pcibr_infoh; - pcibr_info_t pcibr_info; - int win; - - if (pcibr_soft->bs_slot[pciio_slot].has_host) { - pciio_slot = pcibr_soft->bs_slot[pciio_slot].host_slot; - pcibr_info = pcibr_soft->bs_slot[pciio_slot].bss_infos[0]; - } - if (pciio_slot < 4) { - s = pcibr_lock(pcibr_soft); - nf = pcibr_soft->bs_slot[pciio_slot].bss_ninfo; - pcibr_infoh = pcibr_soft->bs_slot[pciio_slot].bss_infos; - for (f = 0; f < nf; ++f) - if (pcibr_infoh[f]) - cfgctl[f] = bridge->b_type0_cfg_dev[pciio_slot].f[f].l[PCI_CFG_COMMAND / 4]; - - ctlreg = bridge->b_wid_control; - bridge->b_wid_control = ctlreg | BRIDGE_CTRL_RST(pciio_slot); - /* XXX delay? */ - bridge->b_wid_control = ctlreg; - /* XXX delay? */ - - for (f = 0; f < nf; ++f) - if ((pcibr_info = pcibr_infoh[f])) - for (win = 0; win < 6; ++win) - if (pcibr_info->f_window[win].w_base != 0) - bridge->b_type0_cfg_dev[pciio_slot].f[f].l[PCI_CFG_BASE_ADDR(win) / 4] = - pcibr_info->f_window[win].w_base; - for (f = 0; f < nf; ++f) - if (pcibr_infoh[f]) - bridge->b_type0_cfg_dev[pciio_slot].f[f].l[PCI_CFG_COMMAND / 4] = cfgctl[f]; - pcibr_unlock(pcibr_soft, s); - - return 0; - } -#ifdef SUPPORT_PRINTING_V_FORMAT - PRINT_WARNING( "%v: pcibr_reset unimplemented for slot %d\n", - conn, pciio_slot); -#endif - return -1; -} - -pciio_endian_t -pcibr_endian_set(devfs_handle_t pconn_vhdl, - pciio_endian_t device_end, - pciio_endian_t desired_end) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - bridgereg_t devreg; - unsigned long s; - - /* - * Bridge supports hardware swapping; so we can always - * arrange for the caller's desired endianness. - */ - - s = pcibr_lock(pcibr_soft); - devreg = pcibr_soft->bs_slot[pciio_slot].bss_device; - if (device_end != desired_end) - devreg |= BRIDGE_DEV_SWAP_BITS; - else - devreg &= ~BRIDGE_DEV_SWAP_BITS; - - /* NOTE- if we ever put SWAP bits - * onto the disabled list, we will - * have to change the logic here. - */ - if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) { - bridge_t *bridge = pcibr_soft->bs_base; - - bridge->b_device[pciio_slot].reg = devreg; - pcibr_soft->bs_slot[pciio_slot].bss_device = devreg; - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - } - pcibr_unlock(pcibr_soft, s); - -#if DEBUG && PCIBR_DEV_DEBUG - printk("pcibr Device(%d): 0x%p\n", pciio_slot, bridge->b_device[pciio_slot].reg); -#endif - - return desired_end; -} - -/* This (re)sets the GBR and REALTIME bits and also keeps track of how - * many sets are outstanding. Reset succeeds only if the number of outstanding - * sets == 1. - */ -int -pcibr_priority_bits_set(pcibr_soft_t pcibr_soft, - pciio_slot_t pciio_slot, - pciio_priority_t device_prio) -{ - unsigned long s; - int *counter; - bridgereg_t rtbits = 0; - bridgereg_t devreg; - int rc = PRIO_SUCCESS; - - /* in dual-slot configurations, the host and the - * guest have separate DMA resources, so they - * have separate requirements for priority bits. - */ - - counter = &(pcibr_soft->bs_slot[pciio_slot].bss_pri_uctr); - - /* - * Bridge supports PCI notions of LOW and HIGH priority - * arbitration rings via a "REAL_TIME" bit in the per-device - * Bridge register. The "GBR" bit controls access to the GBR - * ring on the xbow. These two bits are (re)set together. - * - * XXX- Bug in Rev B Bridge Si: - * Symptom: Prefetcher starts operating incorrectly. This happens - * due to corruption of the address storage ram in the prefetcher - * when a non-real time PCI request is pulled and a real-time one is - * put in it's place. Workaround: Use only a single arbitration ring - * on PCI bus. GBR and RR can still be uniquely used per - * device. NETLIST MERGE DONE, WILL BE FIXED IN REV C. - */ - - if (pcibr_soft->bs_rev_num != BRIDGE_PART_REV_B) - rtbits |= BRIDGE_DEV_RT; - - /* NOTE- if we ever put DEV_RT or DEV_GBR on - * the disabled list, we will have to take - * it into account here. - */ - - s = pcibr_lock(pcibr_soft); - devreg = pcibr_soft->bs_slot[pciio_slot].bss_device; - if (device_prio == PCI_PRIO_HIGH) { - if ((++*counter == 1)) { - if (rtbits) - devreg |= rtbits; - else - rc = PRIO_FAIL; - } - } else if (device_prio == PCI_PRIO_LOW) { - if (*counter <= 0) - rc = PRIO_FAIL; - else if (--*counter == 0) - if (rtbits) - devreg &= ~rtbits; - } - if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) { - bridge_t *bridge = pcibr_soft->bs_base; - - bridge->b_device[pciio_slot].reg = devreg; - pcibr_soft->bs_slot[pciio_slot].bss_device = devreg; - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - } - pcibr_unlock(pcibr_soft, s); - - return rc; -} - -pciio_priority_t -pcibr_priority_set(devfs_handle_t pconn_vhdl, - pciio_priority_t device_prio) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - - (void) pcibr_priority_bits_set(pcibr_soft, pciio_slot, device_prio); - - return device_prio; -} - -/* - * Interfaces to allow special (e.g. SGI) drivers to set/clear - * Bridge-specific device flags. Many flags are modified through - * PCI-generic interfaces; we don't allow them to be directly - * manipulated here. Only flags that at this point seem pretty - * Bridge-specific can be set through these special interfaces. - * We may add more flags as the need arises, or remove flags and - * create PCI-generic interfaces as the need arises. - * - * Returns 0 on failure, 1 on success - */ -int -pcibr_device_flags_set(devfs_handle_t pconn_vhdl, - pcibr_device_flags_t flags) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - bridgereg_t set = 0; - bridgereg_t clr = 0; - - ASSERT((flags & PCIBR_DEVICE_FLAGS) == flags); - - if (flags & PCIBR_WRITE_GATHER) - set |= BRIDGE_DEV_PMU_WRGA_EN; - if (flags & PCIBR_NOWRITE_GATHER) - clr |= BRIDGE_DEV_PMU_WRGA_EN; - - if (flags & PCIBR_WRITE_GATHER) - set |= BRIDGE_DEV_DIR_WRGA_EN; - if (flags & PCIBR_NOWRITE_GATHER) - clr |= BRIDGE_DEV_DIR_WRGA_EN; - - if (flags & PCIBR_PREFETCH) - set |= BRIDGE_DEV_PREF; - if (flags & PCIBR_NOPREFETCH) - clr |= BRIDGE_DEV_PREF; - - if (flags & PCIBR_PRECISE) - set |= BRIDGE_DEV_PRECISE; - if (flags & PCIBR_NOPRECISE) - clr |= BRIDGE_DEV_PRECISE; - - if (flags & PCIBR_BARRIER) - set |= BRIDGE_DEV_BARRIER; - if (flags & PCIBR_NOBARRIER) - clr |= BRIDGE_DEV_BARRIER; - - if (flags & PCIBR_64BIT) - set |= BRIDGE_DEV_DEV_SIZE; - if (flags & PCIBR_NO64BIT) - clr |= BRIDGE_DEV_DEV_SIZE; - - if (set || clr) { - bridgereg_t devreg; - unsigned long s; - - s = pcibr_lock(pcibr_soft); - devreg = pcibr_soft->bs_slot[pciio_slot].bss_device; - devreg = (devreg & ~clr) | set; - if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) { - bridge_t *bridge = pcibr_soft->bs_base; - - bridge->b_device[pciio_slot].reg = devreg; - pcibr_soft->bs_slot[pciio_slot].bss_device = devreg; - bridge->b_wid_tflush; /* wait until Bridge PIO complete */ - } - pcibr_unlock(pcibr_soft, s); -#if DEBUG && PCIBR_DEV_DEBUG - printk("pcibr Device(%d): %R\n", pciio_slot, bridge->b_device[pciio_slot].regbridge->b_device[pciio_slot].reg, device_bits); -#endif - } - return (1); -} - -#ifdef LITTLE_ENDIAN -/* - * on sn-ia we need to twiddle the addresses going out - * the pci bus because we use the unswizzled synergy space - * (the alternative is to use the swizzled synergy space - * and byte swap the data) - */ -#define CB(b,r) (((volatile uint8_t *) b)[((r)^4)]) -#define CS(b,r) (((volatile uint16_t *) b)[((r^4)/2)]) -#define CW(b,r) (((volatile uint32_t *) b)[((r^4)/4)]) -#else -#define CB(b,r) (((volatile uint8_t *) cfgbase)[(r)^3]) -#define CS(b,r) (((volatile uint16_t *) cfgbase)[((r)/2)^1]) -#define CW(b,r) (((volatile uint32_t *) cfgbase)[(r)/4]) -#endif /* LITTLE_ENDIAN */ - - -LOCAL cfg_p -pcibr_config_addr(devfs_handle_t conn, - unsigned reg) -{ - pcibr_info_t pcibr_info; - pciio_slot_t pciio_slot; - pciio_function_t pciio_func; - pcibr_soft_t pcibr_soft; - bridge_t *bridge; - cfg_p cfgbase = (cfg_p)0; - - pcibr_info = pcibr_info_get(conn); - - pciio_slot = pcibr_info->f_slot; - if (pciio_slot == PCIIO_SLOT_NONE) - pciio_slot = PCI_TYPE1_SLOT(reg); - - pciio_func = pcibr_info->f_func; - if (pciio_func == PCIIO_FUNC_NONE) - pciio_func = PCI_TYPE1_FUNC(reg); - - pcibr_soft = (pcibr_soft_t) pcibr_info->f_mfast; - - bridge = pcibr_soft->bs_base; - - cfgbase = bridge->b_type0_cfg_dev[pciio_slot].f[pciio_func].l; - - return cfgbase; -} - -uint64_t -pcibr_config_get(devfs_handle_t conn, - unsigned reg, - unsigned size) -{ - return do_pcibr_config_get(pcibr_config_addr(conn, reg), - PCI_TYPE1_REG(reg), size); -} - -LOCAL uint64_t -do_pcibr_config_get( - cfg_p cfgbase, - unsigned reg, - unsigned size) -{ - unsigned value; - - - value = CW(cfgbase, reg); - - if (reg & 3) - value >>= 8 * (reg & 3); - if (size < 4) - value &= (1 << (8 * size)) - 1; - - return value; -} - -void -pcibr_config_set(devfs_handle_t conn, - unsigned reg, - unsigned size, - uint64_t value) -{ - do_pcibr_config_set(pcibr_config_addr(conn, reg), - PCI_TYPE1_REG(reg), size, value); -} - -LOCAL void -do_pcibr_config_set(cfg_p cfgbase, - unsigned reg, - unsigned size, - uint64_t value) -{ - switch (size) { - case 1: - CB(cfgbase, reg) = value; - break; - case 2: - if (reg & 1) { - CB(cfgbase, reg) = value; - CB(cfgbase, reg + 1) = value >> 8; - } else - CS(cfgbase, reg) = value; - break; - case 3: - if (reg & 1) { - CB(cfgbase, reg) = value; - CS(cfgbase, (reg + 1)) = value >> 8; - } else { - CS(cfgbase, reg) = value; - CB(cfgbase, reg + 2) = value >> 16; - } - break; - - case 4: - CW(cfgbase, reg) = value; - break; - } -} - -pciio_provider_t pcibr_provider = -{ - (pciio_piomap_alloc_f *) pcibr_piomap_alloc, - (pciio_piomap_free_f *) pcibr_piomap_free, - (pciio_piomap_addr_f *) pcibr_piomap_addr, - (pciio_piomap_done_f *) pcibr_piomap_done, - (pciio_piotrans_addr_f *) pcibr_piotrans_addr, - (pciio_piospace_alloc_f *) pcibr_piospace_alloc, - (pciio_piospace_free_f *) pcibr_piospace_free, - - (pciio_dmamap_alloc_f *) pcibr_dmamap_alloc, - (pciio_dmamap_free_f *) pcibr_dmamap_free, - (pciio_dmamap_addr_f *) pcibr_dmamap_addr, - (pciio_dmamap_list_f *) pcibr_dmamap_list, - (pciio_dmamap_done_f *) pcibr_dmamap_done, - (pciio_dmatrans_addr_f *) pcibr_dmatrans_addr, - (pciio_dmatrans_list_f *) pcibr_dmatrans_list, - (pciio_dmamap_drain_f *) pcibr_dmamap_drain, - (pciio_dmaaddr_drain_f *) pcibr_dmaaddr_drain, - (pciio_dmalist_drain_f *) pcibr_dmalist_drain, - - (pciio_intr_alloc_f *) pcibr_intr_alloc, - (pciio_intr_free_f *) pcibr_intr_free, - (pciio_intr_connect_f *) pcibr_intr_connect, - (pciio_intr_disconnect_f *) pcibr_intr_disconnect, - (pciio_intr_cpu_get_f *) pcibr_intr_cpu_get, - - (pciio_provider_startup_f *) pcibr_provider_startup, - (pciio_provider_shutdown_f *) pcibr_provider_shutdown, - (pciio_reset_f *) pcibr_reset, - (pciio_write_gather_flush_f *) pcibr_write_gather_flush, - (pciio_endian_set_f *) pcibr_endian_set, - (pciio_priority_set_f *) pcibr_priority_set, - (pciio_config_get_f *) pcibr_config_get, - (pciio_config_set_f *) pcibr_config_set, - - (pciio_error_devenable_f *) pcibr_error_devenable, - (pciio_error_extract_f *) pcibr_error_extract, - -#ifdef LATER - (pciio_driver_reg_callback_f *) pcibr_driver_reg_callback, - (pciio_driver_unreg_callback_f *) pcibr_driver_unreg_callback, -#else - (pciio_driver_reg_callback_f *) 0, - (pciio_driver_unreg_callback_f *) 0, -#endif - (pciio_device_unregister_f *) pcibr_device_unregister, - (pciio_dma_enabled_f *) pcibr_dma_enabled, -}; - -LOCAL pcibr_hints_t -pcibr_hints_get(devfs_handle_t xconn_vhdl, int alloc) -{ - arbitrary_info_t ainfo = 0; - graph_error_t rv; - pcibr_hints_t hint; - - rv = hwgraph_info_get_LBL(xconn_vhdl, INFO_LBL_PCIBR_HINTS, &ainfo); - - if (alloc && (rv != GRAPH_SUCCESS)) { - - NEW(hint); - hint->rrb_alloc_funct = NULL; - hint->ph_intr_bits = NULL; - rv = hwgraph_info_add_LBL(xconn_vhdl, - INFO_LBL_PCIBR_HINTS, - (arbitrary_info_t) hint); - if (rv != GRAPH_SUCCESS) - goto abnormal_exit; - - rv = hwgraph_info_get_LBL(xconn_vhdl, INFO_LBL_PCIBR_HINTS, &ainfo); - - if (rv != GRAPH_SUCCESS) - goto abnormal_exit; - - if (ainfo != (arbitrary_info_t) hint) - goto abnormal_exit; - } - return (pcibr_hints_t) ainfo; - -abnormal_exit: -#ifdef LATER - printf("SHOULD NOT BE HERE\n"); -#endif - DEL(hint); - return(NULL); - -} - -void -pcibr_hints_fix_some_rrbs(devfs_handle_t xconn_vhdl, unsigned mask) -{ - pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); - - if (hint) - hint->ph_rrb_fixed = mask; -#if DEBUG - else - printk("pcibr_hints_fix_rrbs: pcibr_hints_get failed at\n" - "\t%p\n", xconn_vhdl); -#endif -} - -void -pcibr_hints_fix_rrbs(devfs_handle_t xconn_vhdl) -{ - pcibr_hints_fix_some_rrbs(xconn_vhdl, 0xFF); -} - -void -pcibr_hints_dualslot(devfs_handle_t xconn_vhdl, - pciio_slot_t host, - pciio_slot_t guest) -{ - pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); - - if (hint) - hint->ph_host_slot[guest] = host + 1; -#if DEBUG - else - printk("pcibr_hints_dualslot: pcibr_hints_get failed at\n" - "\t%p\n", xconn_vhdl); -#endif -} - -void -pcibr_hints_intr_bits(devfs_handle_t xconn_vhdl, - pcibr_intr_bits_f *xxx_intr_bits) -{ - pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); - - if (hint) - hint->ph_intr_bits = xxx_intr_bits; -#if DEBUG - else - printk("pcibr_hints_intr_bits: pcibr_hints_get failed at\n" - "\t%p\n", xconn_vhdl); -#endif -} - -void -pcibr_set_rrb_callback(devfs_handle_t xconn_vhdl, rrb_alloc_funct_t rrb_alloc_funct) -{ - pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); - - if (hint) - hint->rrb_alloc_funct = rrb_alloc_funct; -} - -void -pcibr_hints_handsoff(devfs_handle_t xconn_vhdl) -{ - pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); - - if (hint) - hint->ph_hands_off = 1; -#if DEBUG - else - printk("pcibr_hints_handsoff: pcibr_hints_get failed at\n" - "\t%p\n", xconn_vhdl); -#endif -} - -void -pcibr_hints_subdevs(devfs_handle_t xconn_vhdl, - pciio_slot_t slot, - uint64_t subdevs) -{ - arbitrary_info_t ainfo = 0; - char sdname[16]; - devfs_handle_t pconn_vhdl = GRAPH_VERTEX_NONE; - - sprintf(sdname, "pci/%d", slot); - (void) hwgraph_path_add(xconn_vhdl, sdname, &pconn_vhdl); - if (pconn_vhdl == GRAPH_VERTEX_NONE) { -#if DEBUG - printk("pcibr_hints_subdevs: hwgraph_path_create failed at\n" - "\t%p (seeking %s)\n", xconn_vhdl, sdname); -#endif - return; - } - hwgraph_info_get_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, &ainfo); - if (ainfo == 0) { - uint64_t *subdevp; - - NEW(subdevp); - if (!subdevp) { -#if DEBUG - printk("pcibr_hints_subdevs: subdev ptr alloc failed at\n" - "\t%p\n", pconn_vhdl); -#endif - return; - } - *subdevp = subdevs; - hwgraph_info_add_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, (arbitrary_info_t) subdevp); - hwgraph_info_get_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, &ainfo); - if (ainfo == (arbitrary_info_t) subdevp) - return; - DEL(subdevp); - if (ainfo == (arbitrary_info_t) NULL) { -#if DEBUG - printk("pcibr_hints_subdevs: null subdevs ptr at\n" - "\t%p\n", pconn_vhdl); -#endif - return; - } -#if DEBUG - printk("pcibr_subdevs_get: dup subdev add_LBL at\n" - "\t%p\n", pconn_vhdl); -#endif - } - *(uint64_t *) ainfo = subdevs; -} - - -#ifdef LATER - -#include -#include - -char *pci_space[] = {"NONE", - "ROM", - "IO", - "", - "MEM", - "MEM32", - "MEM64", - "CFG", - "WIN0", - "WIN1", - "WIN2", - "WIN3", - "WIN4", - "WIN5", - "", - "BAD"}; - -void -idbg_pss_func(pcibr_info_h pcibr_infoh, int func) -{ - pcibr_info_t pcibr_info = pcibr_infoh[func]; - char name[MAXDEVNAME]; - int win; - - if (!pcibr_info) - return; - qprintf("Per-slot Function Info\n"); -#ifdef SUPPORT_PRINTING_V_FORMAT - sprintf(name, "%v", pcibr_info->f_vertex); -#endif - qprintf("\tSlot Name : %s\n",name); - qprintf("\tPCI Bus : %d ",pcibr_info->f_bus); - qprintf("Slot : %d ", pcibr_info->f_slot); - qprintf("Function : %d ", pcibr_info->f_func); - qprintf("VendorId : 0x%x " , pcibr_info->f_vendor); - qprintf("DeviceId : 0x%x\n", pcibr_info->f_device); -#ifdef SUPPORT_PRINTING_V_FORMAT - sprintf(name, "%v", pcibr_info->f_master); -#endif - qprintf("\tBus provider : %s\n",name); - qprintf("\tProvider Fns : 0x%x ", pcibr_info->f_pops); - qprintf("Error Handler : 0x%x Arg 0x%x\n", - pcibr_info->f_efunc,pcibr_info->f_einfo); - for(win = 0 ; win < 6 ; win++) - qprintf("\tBase Reg #%d space %s base 0x%x size 0x%x\n", - win,pci_space[pcibr_info->f_window[win].w_space], - pcibr_info->f_window[win].w_base, - pcibr_info->f_window[win].w_size); - - qprintf("\tRom base 0x%x size 0x%x\n", - pcibr_info->f_rbase,pcibr_info->f_rsize); - - qprintf("\tInterrupt Bit Map\n"); - qprintf("\t\tPCI Int#\tBridge Pin#\n"); - for (win = 0 ; win < 4; win++) - qprintf("\t\tINT%c\t\t%d\n",win+'A',pcibr_info->f_ibit[win]); - qprintf("\n"); -} - - -void -idbg_pss_info(pcibr_soft_t pcibr_soft, pciio_slot_t slot) -{ - pcibr_soft_slot_t pss; - char slot_conn_name[MAXDEVNAME]; - int func; - - pss = &pcibr_soft->bs_slot[slot]; - qprintf("PCI INFRASTRUCTURAL INFO FOR SLOT %d\n", slot); - qprintf("\tHost Present ? %s ", pss->has_host ? "yes" : "no"); - qprintf("\tHost Slot : %d\n",pss->host_slot); - sprintf(slot_conn_name, "%v", pss->slot_conn); - qprintf("\tSlot Conn : %s\n",slot_conn_name); - qprintf("\t#Functions : %d\n",pss->bss_ninfo); - for (func = 0; func < pss->bss_ninfo; func++) - idbg_pss_func(pss->bss_infos,func); - qprintf("\tSpace : %s ",pci_space[pss->bss_devio.bssd_space]); - qprintf("\tBase : 0x%x ", pss->bss_devio.bssd_base); - qprintf("\tShadow Devreg : 0x%x\n", pss->bss_device); - qprintf("\tUsage counts : pmu %d d32 %d d64 %d\n", - pss->bss_pmu_uctr,pss->bss_d32_uctr,pss->bss_d64_uctr); - - qprintf("\tDirect Trans Info : d64_base 0x%x d64_flags 0x%x" - "d32_base 0x%x d32_flags 0x%x\n", - pss->bss_d64_base, pss->bss_d64_flags, - pss->bss_d32_base, pss->bss_d32_flags); - - qprintf("\tExt ATEs active ? %s", - atomic_read(&pss->bss_ext_ates_active) ? "yes" : "no"); - qprintf(" Command register : 0x%x ", pss->bss_cmd_pointer); - qprintf(" Shadow command val : 0x%x\n", pss->bss_cmd_shadow); - - qprintf("\tRRB Info : Valid %d+%d Reserved %d\n", - pcibr_soft->bs_rrb_valid[slot], - pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL], - pcibr_soft->bs_rrb_res[slot]); - -} - -int ips = 0; - -void -idbg_pss(pcibr_soft_t pcibr_soft) -{ - pciio_slot_t slot; - - - if (ips >= 0 && ips < 8) - idbg_pss_info(pcibr_soft,ips); - else if (ips < 0) - for (slot = 0; slot < 8; slot++) - idbg_pss_info(pcibr_soft,slot); - else - qprintf("Invalid ips %d\n",ips); -} - -#endif /* LATER */ - -int -pcibr_dma_enabled(devfs_handle_t pconn_vhdl) -{ - pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); - pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); - - - return xtalk_dma_enabled(pcibr_soft->bs_conn); -} diff -urN linux-2.4.18/arch/ia64/sn/io/pciio.c lia64-2.4/arch/ia64/sn/io/pciio.c --- linux-2.4.18/arch/ia64/sn/io/pciio.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/pciio.c Tue Feb 26 13:19:35 2002 @@ -4,14 +4,18 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ #define USRPCI 0 +#include #include #include +#include +#include +#include +#include #include #include #include /* Must be before iograph.h to get MAX_PORT_NUM */ @@ -25,13 +29,16 @@ #include #include #include +#include +#include +#include #define DEBUG_PCIIO #undef DEBUG_PCIIO /* turn this on for yet more console output */ -#define NEW(ptr) (ptr = kmalloc(sizeof (*(ptr)), GFP_KERNEL)) -#define DEL(ptr) (kfree(ptr)) +#define GET_NEW(ptr) (ptr = kmalloc(sizeof (*(ptr)), GFP_KERNEL)) +#define DO_DEL(ptr) (kfree(ptr)) char pciio_info_fingerprint[] = "pciio_info"; @@ -45,7 +52,11 @@ switch (len) { case 4: +#ifdef CONFIG_IA64_SGI_SN1 new_addr = (void *)(((u64) addr)^4); +#else + new_addr = (void *) addr; +#endif ret = ia64_sn_probe_io_slot((long)new_addr, len, (void *)ptr); break; default: @@ -63,6 +74,14 @@ get_console_nasid(void) { extern nasid_t console_nasid; + if (console_nasid < 0) { + console_nasid = ia64_sn_get_console_nasid(); + if (console_nasid < 0) { +// ZZZ What do we do if we don't get a console nasid on the hardware???? + if (IS_RUNNING_ON_SIMULATOR() ) + console_nasid = master_nasid; + } + } return console_nasid; } @@ -105,7 +124,7 @@ * completely disappear. */ -#if CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 || CONFIG_IA64_GENERIC +#if defined(CONFIG_IA64_SGI_SN1) /* * For the moment, we will assume that IP27 * only use Bridge ASICs to provide PCI support. @@ -115,7 +134,7 @@ #define CAST_PIOMAP(x) ((pcibr_piomap_t)(x)) #define CAST_DMAMAP(x) ((pcibr_dmamap_t)(x)) #define CAST_INTR(x) ((pcibr_intr_t)(x)) -#endif /* CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 */ +#endif /* CONFIG_IA64_SGI_SN1 */ /* ===================================================================== * Function Table of Contents @@ -150,14 +169,11 @@ pciio_intr_t pciio_intr_alloc(devfs_handle_t, device_desc_t, pciio_intr_line_t, devfs_handle_t); void pciio_intr_free(pciio_intr_t); -int pciio_intr_connect(pciio_intr_t, intr_func_t, intr_arg_t, void *thread); +int pciio_intr_connect(pciio_intr_t); void pciio_intr_disconnect(pciio_intr_t); devfs_handle_t pciio_intr_cpu_get(pciio_intr_t); void pciio_slot_func_to_name(char *, pciio_slot_t, pciio_function_t); -static pciio_info_t pciio_cardinfo_get(devfs_handle_t, pciio_slot_t); -int pciio_error_handler(devfs_handle_t, int, ioerror_mode_t, ioerror_t *); -int pciio_error_devenable(devfs_handle_t, int); void pciio_provider_startup(devfs_handle_t); void pciio_provider_shutdown(devfs_handle_t); @@ -257,7 +273,7 @@ #if defined(SUPPORT_PRINTING_V_FORMAT) PRINT_PANIC("%v: provider_fns == NULL", dev); #else - PRINT_PANIC("0x%x: provider_fns == NULL", dev); + PRINT_PANIC("0x%p: provider_fns == NULL", (void *)dev); #endif return provider_fns; @@ -575,13 +591,10 @@ * Returns 0 on success, returns <0 on failure. */ int -pciio_intr_connect(pciio_intr_t intr_hdl, /* pciio intr resource handle */ - intr_func_t intr_func, /* pciio intr handler */ - intr_arg_t intr_arg, /* arg to intr handler */ - void *thread) -{ /* intr thread to use */ +pciio_intr_connect(pciio_intr_t intr_hdl) /* pciio intr resource handle */ +{ return INTR_FUNC(intr_hdl, intr_connect) - (CAST_INTR(intr_hdl), intr_func, intr_arg, thread); + (CAST_INTR(intr_hdl)); } /* @@ -605,10 +618,6 @@ (CAST_INTR(intr_hdl)); } -/* ===================================================================== - * ERROR MANAGEMENT - */ - void pciio_slot_func_to_name(char *name, pciio_slot_t slot, @@ -630,193 +639,6 @@ sprintf(name, "%d%c", slot, 'a'+func); } -/* - * pciio_cardinfo_get - * - * Get the pciio info structure corresponding to the - * specified PCI "slot" (we like it when the same index - * number is used for the PCI IDSEL, the REQ/GNT pair, - * and the interrupt line being used for INTA. We like - * it so much we call it the slot number). - */ -static pciio_info_t -pciio_cardinfo_get( - devfs_handle_t pciio_vhdl, - pciio_slot_t pci_slot) -{ - char namebuf[16]; - pciio_info_t info = 0; - devfs_handle_t conn; - - pciio_slot_func_to_name(namebuf, pci_slot, PCIIO_FUNC_NONE); - if (GRAPH_SUCCESS == - hwgraph_traverse(pciio_vhdl, namebuf, &conn)) { - info = pciio_info_chk(conn); - hwgraph_vertex_unref(conn); - } - - return info; -} - -/* - * pciio_error_handler: - * dispatch an error to the appropriate - * pciio connection point, or process - * it as a generic pci error. - * Yes, the first parameter is the - * provider vertex at the middle of - * the bus; we get to the pciio connect - * point using the ioerror widgetdev field. - * - * This function is called by the - * specific PCI provider, after it has figured - * out where on the PCI bus (including which slot, - * if it can tell) the error came from. - */ -/*ARGSUSED */ -int -pciio_error_handler( - devfs_handle_t pciio_vhdl, - int error_code, - ioerror_mode_t mode, - ioerror_t *ioerror) -{ - pciio_info_t pciio_info; - devfs_handle_t pconn_vhdl; -#if USRPCI - devfs_handle_t usrpci_v; -#endif - pciio_slot_t slot; - - int retval; -#if defined(CONFIG_SGI_IO_ERROR_HANDLING) - error_state_t e_state; -#endif - -#if DEBUG && ERROR_DEBUG -#if defined(SUPPORT_PRINTING_V_FORMAT) - printk("%v: pciio_error_handler\n", pciio_vhdl); -#else - printk("0x%x: pciio_error_handler\n", pciio_vhdl); -#endif -#endif - -#if defined(SUPPORT_PRINTING_V_FORMAT) - IOERR_PRINTF(printk("%v: PCI Bus Error: Error code: %d Error mode: %d\n", - pciio_vhdl, error_code, mode)); -#else - IOERR_PRINTF(printk("0x%x: PCI Bus Error: Error code: %d Error mode: %d\n", - pciio_vhdl, error_code, mode)); -#endif - - /* If there is an error handler sitting on - * the "no-slot" connection point, give it - * first crack at the error. NOTE: it is - * quite possible that this function may - * do further refining of the ioerror. - */ - pciio_info = pciio_cardinfo_get(pciio_vhdl, PCIIO_SLOT_NONE); - if (pciio_info && pciio_info->c_efunc) { - pconn_vhdl = pciio_info_dev_get(pciio_info); -#if defined(CONFIG_SGI_IO_ERROR_HANDLING) - e_state = error_state_get(pciio_vhdl); - - if (e_state == ERROR_STATE_ACTION) - (void)error_state_set(pciio_vhdl, ERROR_STATE_NONE); - - if (error_state_set(pconn_vhdl,e_state) == - ERROR_RETURN_CODE_CANNOT_SET_STATE) - return(IOERROR_UNHANDLED); -#endif - retval = pciio_info->c_efunc - (pciio_info->c_einfo, error_code, mode, ioerror); - if (retval != IOERROR_UNHANDLED) - return retval; - } - - /* Is the error associated with a particular slot? - */ - if (IOERROR_FIELDVALID(ioerror, widgetdev)) { - /* - * NOTE : - * widgetdev is a 4byte value encoded as slot in the higher order - * 2 bytes and function in the lower order 2 bytes. - */ -#ifdef LATER - slot = pciio_widgetdev_slot_get(IOERROR_GETVALUE(ioerror, widgetdev)); -#else - slot = 0; -#endif - - /* If this slot has an error handler, - * deliver the error to it. - */ - pciio_info = pciio_cardinfo_get(pciio_vhdl, slot); - if (pciio_info != NULL) { - if (pciio_info->c_efunc != NULL) { - - pconn_vhdl = pciio_info_dev_get(pciio_info); -#if defined(CONFIG_SGI_IO_ERROR_HANDLING) - e_state = error_state_get(pciio_vhdl); - - - if (e_state == ERROR_STATE_ACTION) - (void)error_state_set(pciio_vhdl, ERROR_STATE_NONE); - - - - if (error_state_set(pconn_vhdl,e_state) == - ERROR_RETURN_CODE_CANNOT_SET_STATE) - return(IOERROR_UNHANDLED); -#endif - retval = pciio_info->c_efunc - (pciio_info->c_einfo, error_code, mode, ioerror); - if (retval != IOERROR_UNHANDLED) - return retval; - } - -#if USRPCI - /* If the USRPCI driver is available and - * knows about this connection point, - * deliver the error to it. - * - * OK to use pconn_vhdl here, even though we - * have already UNREF'd it, since we know that - * it is not going away. - */ - pconn_vhdl = pciio_info_dev_get(pciio_info); - if (GRAPH_SUCCESS == - hwgraph_traverse(pconn_vhdl, EDGE_LBL_USRPCI, &usrpci_v)) { - retval = usrpci_error_handler - (usrpci_v, error_code, IOERROR_GETVALUE(ioerror, busaddr)); - hwgraph_vertex_unref(usrpci_v); - if (retval != IOERROR_UNHANDLED) { - /* - * This unref is not needed. If this code is called often enough, - * the system will crash, due to vertex reference count reaching 0, - * causing vertex to be unallocated. -jeremy - * hwgraph_vertex_unref(pconn_vhdl); - */ - return retval; - } - } -#endif - } - } - - return (mode == MODE_DEVPROBE) - ? IOERROR_HANDLED /* probes are OK */ - : IOERROR_UNHANDLED; /* otherwise, foo! */ -} - -int -pciio_error_devenable(devfs_handle_t pconn_vhdl, int error_code) -{ - return DEV_FUNC(pconn_vhdl, error_devenable) - (pconn_vhdl, error_code); - /* no cleanup specific to this layer. */ -} - /* ===================================================================== * CONFIGURATION MANAGEMENT */ @@ -856,12 +678,12 @@ #if DEBUG #if defined(SUPPORT_PRINTING_V_FORMAT) - PRINT_ALERT("%v: pciio_endian_set is going away.\n" + printk(KERN_ALERT "%v: pciio_endian_set is going away.\n" "\tplease use PCIIO_BYTE_STREAM or PCIIO_WORD_VALUES in your\n" "\tpciio_dmamap_alloc and pciio_dmatrans calls instead.\n", dev); #else - PRINT_ALERT("0x%x: pciio_endian_set is going away.\n" + printk(KERN_ALERT "0x%x: pciio_endian_set is going away.\n" "\tplease use PCIIO_BYTE_STREAM or PCIIO_WORD_VALUES in your\n" "\tpciio_dmamap_alloc and pciio_dmatrans calls instead.\n", dev); @@ -944,14 +766,6 @@ /* ===================================================================== * GENERIC PCI SUPPORT FUNCTIONS */ -pciio_slot_t -pciio_error_extract(devfs_handle_t dev, - pciio_space_t *space, - iopaddr_t *offset) -{ - ASSERT(dev != NODEV); - return DEV_FUNC(dev,error_extract)(dev,space,offset); -} /* * Issue a hardware reset to a card. @@ -1054,14 +868,9 @@ } #endif /* DEBUG_PCIIO */ -#ifdef BRINGUP if ((pciio_info != NULL) && (pciio_info->c_fingerprint != pciio_info_fingerprint) && (pciio_info->c_fingerprint != NULL)) { -#else - if ((pciio_info != NULL) && - (pciio_info->c_fingerprint != pciio_info_fingerprint)) { -#endif /* BRINGUP */ return((pciio_info_t)-1); /* Should panic .. */ } @@ -1388,7 +1197,7 @@ pciio_device_id_t device_id) { if (!pciio_info) - NEW(pciio_info); + GET_NEW(pciio_info); ASSERT(pciio_info != NULL); pciio_info->c_slot = slot; @@ -1420,6 +1229,7 @@ { char name[32]; devfs_handle_t pconn; + int device_master_set(devfs_handle_t, devfs_handle_t); pciio_slot_func_to_name(name, pciio_info->c_slot, @@ -1431,16 +1241,14 @@ pciio_info->c_vertex = pconn; pciio_info_set(pconn, pciio_info); -#ifdef BRINGUP +#ifdef DEBUG_PCIIO { int pos; char dname[256]; pos = devfs_generate_path(pconn, dname, 256); -#ifdef DEBUG_PCIIO printk("%s : pconn path= %s \n", __FUNCTION__, &dname[pos]); -#endif } -#endif /* BRINGUP */ +#endif /* DEBUG_PCIIO */ /* * create link to our pci provider @@ -1520,7 +1328,6 @@ pciio_info_t pciio_info; pciio_vendor_id_t vendor_id; pciio_device_id_t device_id; - int pciba_attach(devfs_handle_t); pciio_device_inventory_add(pconn); @@ -1536,11 +1343,6 @@ */ ASSERT(pciio_registry != NULL); - /* - * Since pciba is not called from cdl routines .. call it here. - */ - pciba_attach(pconn); - return(cdl_add_connpt(pciio_registry, vendor_id, device_id, pconn, drv_flags)); } @@ -1625,3 +1427,85 @@ { return DEV_FUNC(pconn_vhdl, dma_enabled)(pconn_vhdl); } + +/* + * These are complementary Linux interfaces that takes in a pci_dev * as the + * first arguement instead of devfs_handle_t. + */ +iopaddr_t snia_pciio_dmatrans_addr(struct pci_dev *, device_desc_t, paddr_t, size_t, unsigned); +pciio_dmamap_t snia_pciio_dmamap_alloc(struct pci_dev *, device_desc_t, size_t, unsigned); +void snia_pciio_dmamap_free(pciio_dmamap_t); +iopaddr_t snia_pciio_dmamap_addr(pciio_dmamap_t, paddr_t, size_t); +void snia_pciio_dmamap_done(pciio_dmamap_t); +pciio_endian_t snia_pciio_endian_set(struct pci_dev *pci_dev, pciio_endian_t device_end, + pciio_endian_t desired_end); + +#include +EXPORT_SYMBOL(snia_pciio_dmatrans_addr); +EXPORT_SYMBOL(snia_pciio_dmamap_alloc); +EXPORT_SYMBOL(snia_pciio_dmamap_free); +EXPORT_SYMBOL(snia_pciio_dmamap_addr); +EXPORT_SYMBOL(snia_pciio_dmamap_done); +EXPORT_SYMBOL(snia_pciio_endian_set); + +pciio_endian_t +snia_pciio_endian_set(struct pci_dev *pci_dev, + pciio_endian_t device_end, + pciio_endian_t desired_end) +{ + devfs_handle_t dev = PCIDEV_VERTEX(pci_dev); + + return DEV_FUNC(dev, endian_set) + (dev, device_end, desired_end); +} + +iopaddr_t +snia_pciio_dmatrans_addr(struct pci_dev *pci_dev, /* translate for this device */ + device_desc_t dev_desc, /* device descriptor */ + paddr_t paddr, /* system physical address */ + size_t byte_count, /* length */ + unsigned flags) +{ /* defined in dma.h */ + + devfs_handle_t dev = PCIDEV_VERTEX(pci_dev); + + return DEV_FUNC(dev, dmatrans_addr) + (dev, dev_desc, paddr, byte_count, flags); +} + +pciio_dmamap_t +snia_pciio_dmamap_alloc(struct pci_dev *pci_dev, /* set up mappings for this device */ + device_desc_t dev_desc, /* device descriptor */ + size_t byte_count_max, /* max size of a mapping */ + unsigned flags) +{ /* defined in dma.h */ + + devfs_handle_t dev = PCIDEV_VERTEX(pci_dev); + + return (pciio_dmamap_t) DEV_FUNC(dev, dmamap_alloc) + (dev, dev_desc, byte_count_max, flags); +} + +void +snia_pciio_dmamap_free(pciio_dmamap_t pciio_dmamap) +{ + DMAMAP_FUNC(pciio_dmamap, dmamap_free) + (CAST_DMAMAP(pciio_dmamap)); +} + +iopaddr_t +snia_pciio_dmamap_addr(pciio_dmamap_t pciio_dmamap, /* use these mapping resources */ + paddr_t paddr, /* map for this address */ + size_t byte_count) +{ /* map this many bytes */ + return DMAMAP_FUNC(pciio_dmamap, dmamap_addr) + (CAST_DMAMAP(pciio_dmamap), paddr, byte_count); +} + +void +snia_pciio_dmamap_done(pciio_dmamap_t pciio_dmamap) +{ + DMAMAP_FUNC(pciio_dmamap, dmamap_done) + (CAST_DMAMAP(pciio_dmamap)); +} + diff -urN linux-2.4.18/arch/ia64/sn/io/sgi_if.c lia64-2.4/arch/ia64/sn/io/sgi_if.c --- linux-2.4.18/arch/ia64/sn/io/sgi_if.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/sgi_if.c Mon Nov 19 23:22:52 2001 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ #include @@ -22,7 +21,7 @@ #include void * -kmem_zalloc(size_t size, int flag) +snia_kmem_zalloc(size_t size, int flag) { void *ptr = kmalloc(size, GFP_KERNEL); BZERO(ptr, size); diff -urN linux-2.4.18/arch/ia64/sn/io/sgi_io_init.c lia64-2.4/arch/ia64/sn/io/sgi_io_init.c --- linux-2.4.18/arch/ia64/sn/io/sgi_io_init.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/sgi_io_init.c Tue Feb 26 13:19:35 2002 @@ -4,26 +4,24 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ #include #include #include #include -#include +#include +#include #include #include -#include +#include #include extern void mlreset(int ); extern int init_hcl(void); extern void klgraph_hack_init(void); -extern void per_hub_init(cnodeid_t); extern void hubspc_init(void); -extern void pciba_init(void); extern void pciio_init(void); extern void pcibr_init(void); extern void xtalk_init(void); @@ -33,23 +31,21 @@ extern void usrpci_init(void); extern void ioc3_init(void); extern void initialize_io(void); -extern void init_platform_nodepda(nodepda_t *, cnodeid_t ); +#if defined(CONFIG_IA64_SGI_SN1) extern void intr_clear_all(nasid_t); +#endif extern void klhwg_add_all_modules(devfs_handle_t); extern void klhwg_add_all_nodes(devfs_handle_t); void sn_mp_setup(void); extern devfs_handle_t hwgraph_root; extern void io_module_init(void); -extern cnodeid_t nasid_to_compact_node[]; extern void pci_bus_cvlink_init(void); extern void temp_hack(void); -extern void init_platform_pda(cpuid_t cpu); extern int pci_bus_to_hcl_cvlink(void); -extern synergy_da_t *Synergy_da_indr[]; -#define DEBUG_IO_INIT +/* #define DEBUG_IO_INIT 1 */ #ifdef DEBUG_IO_INIT #define DBG(x...) printk(x) #else @@ -57,20 +53,73 @@ #endif /* DEBUG_IO_INIT */ /* - * kern/ml/csu.s calls mlsetup - * mlsetup calls mlreset(master) - kern/os/startup.c - * j main - * - - * SN/slave.s start_slave_loop calls slave_entry - * SN/slave.s slave_entry calls slave_loop - * SN/slave.s slave_loop calls bootstrap - * bootstrap in SN1/SN1asm.s calls cboot - * cboot calls mlreset(slave) - ml/SN/mp.c + * per_hub_init * - * sgi_io_infrastructure_init() gets called right before pci_init() - * in Linux mainline. This routine actually mirrors the IO Infrastructure - * call sequence in IRIX, ofcourse, nicely modified for Linux. + * This code is executed once for each Hub chip. + */ +static void +per_hub_init(cnodeid_t cnode) +{ + nasid_t nasid; + nodepda_t *npdap; + ii_icmr_u_t ii_icmr; + ii_ibcr_u_t ii_ibcr; + + nasid = COMPACT_TO_NASID_NODEID(cnode); + + ASSERT(nasid != INVALID_NASID); + ASSERT(NASID_TO_COMPACT_NODEID(nasid) == cnode); + + npdap = NODEPDA(cnode); + +#if defined(CONFIG_IA64_SGI_SN1) + /* initialize per-node synergy perf instrumentation */ + npdap->synergy_perf_enabled = 0; /* off by default */ + npdap->synergy_perf_lock = SPIN_LOCK_UNLOCKED; + npdap->synergy_perf_freq = SYNERGY_PERF_FREQ_DEFAULT; + npdap->synergy_inactive_intervals = 0; + npdap->synergy_active_intervals = 0; + npdap->synergy_perf_data = NULL; + npdap->synergy_perf_first = NULL; +#endif /* CONFIG_IA64_SGI_SN1 */ + + + /* + * Set the total number of CRBs that can be used. + */ + ii_icmr.ii_icmr_regval= 0x0; + ii_icmr.ii_icmr_fld_s.i_c_cnt = 0xF; + REMOTE_HUB_S(nasid, IIO_ICMR, ii_icmr.ii_icmr_regval); + + /* + * Set the number of CRBs that both of the BTEs combined + * can use minus 1. + */ + ii_ibcr.ii_ibcr_regval= 0x0; + ii_ibcr.ii_ibcr_fld_s.i_count = 0x8; + REMOTE_HUB_S(nasid, IIO_IBCR, ii_ibcr.ii_ibcr_regval); + + /* + * Set CRB timeout to be 10ms. + */ + REMOTE_HUB_S(nasid, IIO_ICTP, 0x1000 ); + REMOTE_HUB_S(nasid, IIO_ICTO, 0xff); + + +#if defined(CONFIG_IA64_SGI_SN1) + /* Reserve all of the hardwired interrupt levels. */ + intr_reserve_hardwired(cnode); +#endif + + /* Initialize error interrupts for this hub. */ + hub_error_init(cnode); +} + +/* + * This routine is responsible for the setup of all the IRIX hwgraph style + * stuff that's been pulled into linux. It's called by sn_pci_find_bios which + * is called just before the generic Linux PCI layer does its probing (by + * platform_pci_fixup aka sn_pci_fixup). * * It is very IMPORTANT that this call is only made by the Master CPU! * @@ -80,7 +129,6 @@ sgi_master_io_infr_init(void) { int cnode; - extern int maxnodes; /* * Do any early init stuff .. einit_tbl[] etc. @@ -88,17 +136,49 @@ DBG("--> sgi_master_io_infr_init: calling init_hcl().\n"); init_hcl(); /* Sets up the hwgraph compatibility layer with devfs */ +#ifdef Colin + +printk("Testing out Xbridge Access .. if it hangs Xbridge is not init yet.\n"); +printk(" Reading Xbridge WID at address 0xc00000080f000000 0x%p\n", (* (volatile uint32_t *)(0xc00000080f000000))); + +printk("Testing out PCI Address Space Accesses\n"); +printk(" Testing PCI Config Read Byte: address 0xc00000080f020000 value 0x%x\n",(* (volatile uint8_t *)(0xc00000080f020000))); + +printk(" Testing PCI Config Read Byte: address 0xc00000080f020001 value 0x%x\n",(* (volatile uint8_t *)(0xc00000080f020001))); + +printk(" Testing PCI Config Read Byte: address 0xc00000080f020002 value 0x%x\n",(* (volatile uint8_t *)(0xc00000080f020002))); + +printk(" Testing PCI Config Read Byte: address 0xc00000080f020003 value 0x%x\n",(* (volatile uint8_t *)(0xc00000080f020003))); + +printk(" Testing PCI Config Read Byte: address 0xc00000080f020004 value 0x%x\n",(* (volatile uint8_t *)(0xc00000080f020004))); + +printk(" Testing PCI Config Read Byte: address 0xc00000080f020005 value 0x%x\n",(* (volatile uint8_t *)(0xc00000080f020005))); + +printk(" Testing PCI Config Read Byte: address 0xc00000080f020006 value 0x%x\n",(* (volatile uint8_t *)(0xc00000080f020006))); + +printk(" Testing PCI Config Read Byte: address 0xc00000080f020007 value 0x%x\n",(* (volatile uint8_t *)(0xc00000080f020007))); + +printk(" Testing PCI Config Word: address 0xc00000080f020004 value 0x%x\n",(* (volatile uint32_t *)(0xc00000080f020004))); + +printk(" Testing PCI Config Word: address 0xc00000080f020008 value 0x%x\n",(* (volatile uint32_t *)(0xc00000080f020008))); + +#endif + /* * initialize the Linux PCI to xwidget vertexes .. */ DBG("--> sgi_master_io_infr_init: calling pci_bus_cvlink_init().\n"); pci_bus_cvlink_init(); +#ifdef BRINGUP +#ifdef CONFIG_IA64_SGI_SN1 /* * Hack to provide statically initialzed klgraph entries. */ DBG("--> sgi_master_io_infr_init: calling klgraph_hack_init()\n"); klgraph_hack_init(); +#endif /* CONFIG_IA64_SGI_SN1 */ +#endif /* BRINGUP */ /* * This is the Master CPU. Emulate mlsetup and main.c in Irix. @@ -117,7 +197,7 @@ sn_mp_setup(); DBG("--> sgi_master_io_infr_init: calling per_hub_init(0).\n"); - for (cnode = 0; cnode < maxnodes; cnode++) { + for (cnode = 0; cnode < numnodes; cnode++) { per_hub_init(cnode); } @@ -133,9 +213,6 @@ DBG("--> sgi_master_io_infr_init: calling hubspc_init()\n"); hubspc_init(); - DBG("--> sgi_master_io_infr_init: calling pciba_init()\n"); - pciba_init(); - DBG("--> sgi_master_io_infr_init: calling pciio_init()\n"); pciio_init(); @@ -172,6 +249,11 @@ DBG("--> sgi_master_io_infr_init: Setting up SGI IO Links for Linux PCI\n"); pci_bus_to_hcl_cvlink(); +#ifdef CONFIG_PCIBA + DBG("--> sgi_master_io_infr_init: calling pciba_init()\n"); + pciba_init(); +#endif + DBG("--> Leave sgi_master_io_infr_init: DONE setting up SGI Links for PCI\n"); } @@ -199,76 +281,15 @@ sn_mp_setup(void) { cnodeid_t cnode; - extern int maxnodes; cpuid_t cpu; - DBG("sn_mp_setup: Entered.\n"); - /* - * NODEPDA(x) Macro depends on nodepda - * subnodepda is also statically set to calias space which we - * do not currently support yet .. just a hack for now. - */ -#ifdef NUMA_BASE - maxnodes = numnodes; - DBG("sn_mp_setup(): maxnodes= %d numnodes= %d\n", maxnodes,numnodes); - printk("sn_mp_setup(): Allocating backing store for *Nodepdaindr[%2d] \n", - maxnodes); - - /* - * Initialize Nodpdaindr and per-node nodepdaindr array - */ - *Nodepdaindr = (nodepda_t *) kmalloc(sizeof(nodepda_t *)*numnodes, GFP_KERNEL); - for (cnode=0; cnodepernode_pdaindr = Nodepdaindr; - subnodepda = &Nodepdaindr[cnode]->snpda[cnode]; - } - nodepda = Nodepdaindr[0]; -#else - Nodepdaindr = (nodepda_t *) kmalloc(sizeof(struct nodepda_s), GFP_KERNEL); - nodepda = Nodepdaindr[0]; - subnodepda = &Nodepdaindr[0]->snpda[0]; - -#endif /* NUMA_BASE */ - - /* - * Before we let the other processors run, set up the platform specific - * stuff in the nodepda. - * - * ???? maxnodes set in mlreset .. who sets it now ???? - * ???? cpu_node_probe() called in mlreset to set up the following: - * compact_to_nasid_node[] - cnode id gives nasid - * nasid_to_compact_node[] - nasid gives cnode id - * - * do_cpumask() sets the following: - * cpuid_to_compact_node[] - cpuid gives cnode id - * - * nasid comes from gdap->g_nasidtable[] - * ml/SN/promif.c - */ - -#ifdef CONFIG_IA64_SGI_SN1 for (cpu = 0; cpu < smp_num_cpus; cpu++) { /* Skip holes in CPU space */ if (cpu_enabled(cpu)) { init_platform_pda(cpu); } } -#endif - for (cnode = 0; cnode < maxnodes; cnode++) { - /* - * Set up platform-dependent nodepda fields. - * The following routine actually sets up the hubinfo struct - * in nodepda. - */ - DBG("sn_mp_io_setup: calling init_platform_nodepda(%2d)\n",cnode); - init_platform_nodepda(Nodepdaindr[cnode], cnode); - } + /* * Initialize platform-dependent vertices in the hwgraph: * module @@ -290,24 +311,26 @@ klhwg_add_all_nodes(hwgraph_root); - for (cnode = 0; cnode < maxnodes; cnode++) { + for (cnode = 0; cnode < numnodes; cnode++) { /* * This routine clears the Hub's Interrupt registers. */ -#ifdef CONFIG_IA64_SGI_SN1 /* * We need to move this intr_clear_all() routine * from SN/intr.c to a more appropriate file. * Talk to Al Mayer. */ +#if defined(CONFIG_IA64_SGI_SN1) intr_clear_all(COMPACT_TO_NASID_NODEID(cnode)); +#endif /* now init the hub */ // per_hub_init(cnode); -#endif + } -#if defined(CONFIG_IA64_SGI_SYNERGY_PERF) +#if defined(CONFIG_IA64_SGI_SN1) synergy_perf_init(); -#endif /* CONFIG_IA64_SGI_SYNERGY_PERF */ +#endif + } diff -urN linux-2.4.18/arch/ia64/sn/io/sgi_io_sim.c lia64-2.4/arch/ia64/sn/io/sgi_io_sim.c --- linux-2.4.18/arch/ia64/sn/io/sgi_io_sim.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/sgi_io_sim.c Mon Nov 19 23:22:52 2001 @@ -4,31 +4,28 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ +#include #include #include -#include +#include +#include +#include #include #include #include #include -#include cpuid_t master_procid = 0; -int maxnodes; char arg_maxnodes[4]; -nodepda_t *Nodepdaindr[MAX_COMPACT_NODES]; -nodepda_t *nodepda; -subnode_pda_t *subnodepda; - -synergy_da_t *Synergy_da_indr[MAX_COMPACT_NODES * 2]; - extern void init_all_devices(void); +#if defined(CONFIG_IA64_SGI_SN1) +synergy_da_t *Synergy_da_indr[MAX_COMPACT_NODES * 2]; +#endif /* * Return non-zero if the given variable was specified @@ -73,27 +70,23 @@ * Routines provided by ml/SN/promif.c. */ static __psunsigned_t master_bridge_base = (__psunsigned_t)NULL; -nasid_t console_nasid; +nasid_t console_nasid = (nasid_t)-1; static char console_wid; static char console_pcislot; void set_master_bridge_base(void) { - - console_nasid = KL_CONFIG_CH_CONS_INFO(master_nasid)->nasid; console_wid = WIDGETID_GET(KL_CONFIG_CH_CONS_INFO(master_nasid)->memory_base); console_pcislot = KL_CONFIG_CH_CONS_INFO(master_nasid)->npci; - master_bridge_base = (__psunsigned_t)NODE_SWIN_BASE(console_nasid, - console_wid); - FIXME("WARNING: set_master_bridge_base: NON NASID 0 DOES NOT WORK\n"); + master_bridge_base = (__psunsigned_t)NODE_SWIN_BASE(console_nasid, console_wid); + // FIXME("WARNING: set_master_bridge_base: NON NASID 0 DOES NOT WORK\n"); } int check_nasid_equiv(nasid_t nasida, nasid_t nasidb) { - if ((nasida == nasidb) || - (nasida == NODEPDA(NASID_TO_COMPACT_NODEID(nasidb))->xbow_peer)) + if ((nasida == nasidb) || (nasida == NODEPDA(NASID_TO_COMPACT_NODEID(nasidb))->xbow_peer)) return 1; else return 0; diff -urN linux-2.4.18/arch/ia64/sn/io/sn1/hub_intr.c lia64-2.4/arch/ia64/sn/io/sn1/hub_intr.c --- linux-2.4.18/arch/ia64/sn/io/sn1/hub_intr.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn1/hub_intr.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,307 @@ +/* $Id: io.c,v 1.2 2001/06/26 14:02:43 pfg Exp $ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992-1997, 2000-2002 Silicon Graphics, Inc. All Rights Reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern xtalk_provider_t hub_provider; + +/* ARGSUSED */ +void +hub_intr_init(devfs_handle_t hubv) +{ +} + +/* + * hub_device_desc_update + * Update the passed in device descriptor with the actual the + * target cpu number and interrupt priority level. + * NOTE : These might be the same as the ones passed in thru + * the descriptor. + */ +static void +hub_device_desc_update(device_desc_t dev_desc, + ilvl_t intr_swlevel, + cpuid_t cpu) +{ +} + +int allocate_my_bit = INTRCONNECT_ANYBIT; + +/* + * Allocate resources required for an interrupt as specified in dev_desc. + * Returns a hub interrupt handle on success, or 0 on failure. + */ +static hub_intr_t +do_hub_intr_alloc(devfs_handle_t dev, /* which crosstalk device */ + device_desc_t dev_desc, /* device descriptor */ + devfs_handle_t owner_dev, /* owner of this interrupt, if known */ + int uncond_nothread) /* unconditionally non-threaded */ +{ + cpuid_t cpu = (cpuid_t)0; /* cpu to receive interrupt */ + int cpupicked = 0; + int bit; /* interrupt vector */ + /*REFERENCED*/ + int intr_resflags = 0; + hub_intr_t intr_hdl; + cnodeid_t nodeid; /* node to receive interrupt */ + /*REFERENCED*/ + nasid_t nasid; /* nasid to receive interrupt */ + struct xtalk_intr_s *xtalk_info; + iopaddr_t xtalk_addr; /* xtalk addr on hub to set intr */ + xwidget_info_t xwidget_info; /* standard crosstalk widget info handle */ + char *intr_name = NULL; + ilvl_t intr_swlevel = (ilvl_t)0; + extern int default_intr_pri; + extern void synergy_intr_alloc(int, int); + + + if (dev_desc) { + if (dev_desc->flags & D_INTR_ISERR) { + intr_resflags = II_ERRORINT; + } else if (!uncond_nothread && !(dev_desc->flags & D_INTR_NOTHREAD)) { + intr_resflags = II_THREADED; + } else { + /* Neither an error nor a thread. */ + intr_resflags = 0; + } + } else { + intr_swlevel = default_intr_pri; + if (!uncond_nothread) + intr_resflags = II_THREADED; + } + + /* XXX - Need to determine if the interrupt should be threaded. */ + + /* If the cpu has not been picked already then choose a candidate + * interrupt target and reserve the interrupt bit + */ + if (!cpupicked) { + cpu = intr_heuristic(dev,dev_desc,allocate_my_bit, + intr_resflags,owner_dev, + intr_name,&bit); + } + + /* At this point we SHOULD have a valid cpu */ + if (cpu == CPU_NONE) { +#if defined(SUPPORT_PRINTING_V_FORMAT) + printk(KERN_WARNING "%v hub_intr_alloc could not allocate interrupt\n", + owner_dev); +#else + printk(KERN_WARNING "%p hub_intr_alloc could not allocate interrupt\n", + (void *)owner_dev); +#endif + return(0); + + } + + /* If the cpu has been picked already (due to the bridge data + * corruption bug) then try to reserve an interrupt bit . + */ + if (cpupicked) { + bit = intr_reserve_level(cpu, allocate_my_bit, + intr_resflags, + owner_dev, intr_name); + if (bit < 0) { +#if defined(SUPPORT_PRINTING_V_FORMAT) + printk(KERN_WARNING "Could not reserve an interrupt bit for cpu " + " %d and dev %v\n", + cpu,owner_dev); +#else + printk(KERN_WARNING "Could not reserve an interrupt bit for cpu " + " %d and dev %p\n", + (int)cpu, (void *)owner_dev); +#endif + + return(0); + } + } + + nodeid = cpuid_to_cnodeid(cpu); + nasid = cpuid_to_nasid(cpu); + xtalk_addr = HUBREG_AS_XTALKADDR(nasid, PIREG(PI_INT_PEND_MOD, cpuid_to_subnode(cpu))); + + /* + * Allocate an interrupt handle, and fill it in. There are two + * pieces to an interrupt handle: the piece needed by generic + * xtalk code which is used by crosstalk device drivers, and + * the piece needed by low-level IP27 hardware code. + */ + intr_hdl = snia_kmem_alloc_node(sizeof(struct hub_intr_s), KM_NOSLEEP, nodeid); + ASSERT_ALWAYS(intr_hdl); + + /* + * Fill in xtalk information for generic xtalk interfaces that + * operate on xtalk_intr_hdl's. + */ + xtalk_info = &intr_hdl->i_xtalk_info; + xtalk_info->xi_dev = dev; + xtalk_info->xi_vector = bit; + xtalk_info->xi_addr = xtalk_addr; + + /* + * Regardless of which CPU we ultimately interrupt, a given crosstalk + * widget always handles interrupts (and PIO and DMA) through its + * designated "master" crosstalk provider. + */ + xwidget_info = xwidget_info_get(dev); + if (xwidget_info) + xtalk_info->xi_target = xwidget_info_masterid_get(xwidget_info); + + /* Fill in low level hub information for hub_* interrupt interface */ + intr_hdl->i_swlevel = intr_swlevel; + intr_hdl->i_cpuid = cpu; + intr_hdl->i_bit = bit; + intr_hdl->i_flags = HUB_INTR_IS_ALLOCED; + + /* Store the actual interrupt priority level & interrupt target + * cpu back in the device descriptor. + */ + hub_device_desc_update(dev_desc, intr_swlevel, cpu); + synergy_intr_alloc((int)bit, (int)cpu); + return(intr_hdl); +} + +/* + * Allocate resources required for an interrupt as specified in dev_desc. + * Returns a hub interrupt handle on success, or 0 on failure. + */ +hub_intr_t +hub_intr_alloc( devfs_handle_t dev, /* which crosstalk device */ + device_desc_t dev_desc, /* device descriptor */ + devfs_handle_t owner_dev) /* owner of this interrupt, if known */ +{ + return(do_hub_intr_alloc(dev, dev_desc, owner_dev, 0)); +} + +/* + * Allocate resources required for an interrupt as specified in dev_desc. + * Uncondtionally request non-threaded, regardless of what the device + * descriptor might say. + * Returns a hub interrupt handle on success, or 0 on failure. + */ +hub_intr_t +hub_intr_alloc_nothd(devfs_handle_t dev, /* which crosstalk device */ + device_desc_t dev_desc, /* device descriptor */ + devfs_handle_t owner_dev) /* owner of this interrupt, if known */ +{ + return(do_hub_intr_alloc(dev, dev_desc, owner_dev, 1)); +} + +/* + * Free resources consumed by intr_alloc. + */ +void +hub_intr_free(hub_intr_t intr_hdl) +{ + cpuid_t cpu = intr_hdl->i_cpuid; + int bit = intr_hdl->i_bit; + xtalk_intr_t xtalk_info; + + if (intr_hdl->i_flags & HUB_INTR_IS_CONNECTED) { + /* Setting the following fields in the xtalk interrupt info + * clears the interrupt target register in the xtalk user + */ + xtalk_info = &intr_hdl->i_xtalk_info; + xtalk_info->xi_dev = NODEV; + xtalk_info->xi_vector = 0; + xtalk_info->xi_addr = 0; + hub_intr_disconnect(intr_hdl); + } + + if (intr_hdl->i_flags & HUB_INTR_IS_ALLOCED) + kfree(intr_hdl); + + intr_unreserve_level(cpu, bit); +} + + +/* + * Associate resources allocated with a previous hub_intr_alloc call with the + * described handler, arg, name, etc. + */ +/*ARGSUSED*/ +int +hub_intr_connect( hub_intr_t intr_hdl, /* xtalk intr resource handle */ + xtalk_intr_setfunc_t setfunc, /* func to set intr hw */ + void *setfunc_arg) /* arg to setfunc */ +{ + int rv; + cpuid_t cpu = intr_hdl->i_cpuid; + int bit = intr_hdl->i_bit; + extern int synergy_intr_connect(int, int); + + ASSERT(intr_hdl->i_flags & HUB_INTR_IS_ALLOCED); + + rv = intr_connect_level(cpu, bit, intr_hdl->i_swlevel, NULL); + if (rv < 0) + return(rv); + + intr_hdl->i_xtalk_info.xi_setfunc = setfunc; + intr_hdl->i_xtalk_info.xi_sfarg = setfunc_arg; + + if (setfunc) (*setfunc)((xtalk_intr_t)intr_hdl); + + intr_hdl->i_flags |= HUB_INTR_IS_CONNECTED; + return(synergy_intr_connect((int)bit, (int)cpu)); +} + + +/* + * Disassociate handler with the specified interrupt. + */ +void +hub_intr_disconnect(hub_intr_t intr_hdl) +{ + /*REFERENCED*/ + int rv; + cpuid_t cpu = intr_hdl->i_cpuid; + int bit = intr_hdl->i_bit; + xtalk_intr_setfunc_t setfunc; + + setfunc = intr_hdl->i_xtalk_info.xi_setfunc; + + /* TBD: send disconnected interrupts somewhere harmless */ + if (setfunc) (*setfunc)((xtalk_intr_t)intr_hdl); + + rv = intr_disconnect_level(cpu, bit); + ASSERT(rv == 0); + intr_hdl->i_flags &= ~HUB_INTR_IS_CONNECTED; +} + + +/* + * Return a hwgraph vertex that represents the CPU currently + * targeted by an interrupt. + */ +devfs_handle_t +hub_intr_cpu_get(hub_intr_t intr_hdl) +{ + cpuid_t cpuid = intr_hdl->i_cpuid; + ASSERT(cpuid != CPU_NONE); + + return(cpuid_to_vertex(cpuid)); +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn1/hubcounters.c lia64-2.4/arch/ia64/sn/io/sn1/hubcounters.c --- linux-2.4.18/arch/ia64/sn/io/sn1/hubcounters.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn1/hubcounters.c Mon Nov 19 23:22:52 2001 @@ -0,0 +1,283 @@ +/* $Id:$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000 - 2001 Silicon Graphics, Inc. + * All rights reserved. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern void hubni_error_handler(char *, int); /* huberror.c */ + +static int hubstats_ioctl(struct inode *, struct file *, unsigned int, unsigned long); +struct file_operations hub_mon_fops = { + ioctl: hubstats_ioctl, +}; + +#define HUB_CAPTURE_TICKS (2 * HZ) + +#define HUB_ERR_THRESH 500 +#define USEC_PER_SEC 1000000 +#define NSEC_PER_SEC USEC_PER_SEC*1000 + +volatile int hub_print_usecs = 600 * USEC_PER_SEC; + +/* Return success if the hub's crosstalk link is working */ +int +hub_xtalk_link_up(nasid_t nasid) +{ + hubreg_t llp_csr_reg; + + /* Read the IO LLP control status register */ + llp_csr_reg = REMOTE_HUB_L(nasid, IIO_LLP_CSR); + + /* Check if the xtalk link is working */ + if (llp_csr_reg & IIO_LLP_CSR_IS_UP) + return(1); + + return(0); + + +} + +static char *error_flag_to_type(unsigned char error_flag) +{ + switch(error_flag) { + case 0x1: return ("NI retries"); + case 0x2: return ("NI SN errors"); + case 0x4: return ("NI CB errors"); + case 0x8: return ("II CB errors"); + case 0x10: return ("II SN errors"); + default: return ("Errors"); + } +} + +int +print_hub_error(hubstat_t *hsp, hubreg_t reg, + int64_t delta, unsigned char error_flag) +{ + int64_t rate; + + reg *= hsp->hs_per_minute; /* Convert to minutes */ + rate = reg / delta; + + if (rate > HUB_ERR_THRESH) { + + if(hsp->hs_maint & error_flag) + { + printk( "Excessive %s (%ld/min) on %s", + error_flag_to_type(error_flag), rate, hsp->hs_name); + } + else + { + hsp->hs_maint |= error_flag; + printk( "Excessive %s (%ld/min) on %s", + error_flag_to_type(error_flag), rate, hsp->hs_name); + } + return 1; + } else { + return 0; + } +} + + +int +check_hub_error_rates(hubstat_t *hsp) +{ + int64_t delta = hsp->hs_timestamp - hsp->hs_timebase; + int printed = 0; + + printed += print_hub_error(hsp, hsp->hs_ni_retry_errors, + delta, 0x1); + +#if 0 + printed += print_hub_error(hsp, hsp->hs_ni_sn_errors, + delta, 0x2); +#endif + + printed += print_hub_error(hsp, hsp->hs_ni_cb_errors, + delta, 0x4); + + + /* If the hub's xtalk link is not working there is + * no need to print the "Excessive..." warning + * messages + */ + if (!hub_xtalk_link_up(hsp->hs_nasid)) + return(printed); + + + printed += print_hub_error(hsp, hsp->hs_ii_cb_errors, + delta, 0x8); + + printed += print_hub_error(hsp, hsp->hs_ii_sn_errors, + delta, 0x10); + + return printed; +} + + +void +capture_hub_stats(cnodeid_t cnodeid, struct nodepda_s *npda) +{ + nasid_t nasid; + hubstat_t *hsp = &(npda->hubstats); + hubreg_t port_error; + ii_illr_u_t illr; + int count; + int overflow = 0; + + /* + * If our link wasn't up at boot time, don't worry about error rates. + */ + if (!(hsp->hs_ni_port_status & NPS_LINKUP_MASK)) { + printk("capture_hub_stats: cnode=%d hs_ni_port_status=0x%016lx : link is not up\n", + cnodeid, hsp->hs_ni_port_status); + return; + } + + nasid = COMPACT_TO_NASID_NODEID(cnodeid); + + hsp->hs_timestamp = GET_RTC_COUNTER(); + + port_error = REMOTE_HUB_L(nasid, NI_PORT_ERROR_CLEAR); + count = ((port_error & NPE_RETRYCOUNT_MASK) >> NPE_RETRYCOUNT_SHFT); + hsp->hs_ni_retry_errors += count; + if (count == NPE_COUNT_MAX) + overflow = 1; + count = ((port_error & NPE_SNERRCOUNT_MASK) >> NPE_SNERRCOUNT_SHFT); + hsp->hs_ni_sn_errors += count; + if (count == NPE_COUNT_MAX) + overflow = 1; + count = ((port_error & NPE_CBERRCOUNT_MASK) >> NPE_CBERRCOUNT_SHFT); + hsp->hs_ni_cb_errors += count; + if (overflow || count == NPE_COUNT_MAX) + hsp->hs_ni_overflows++; + + if (port_error & NPE_FATAL_ERRORS) { +#ifdef ajm + hubni_error_handler("capture_hub_stats", 1); +#else + printk("Error: hubni_error_handler in capture_hub_stats"); +#endif + } + + illr.ii_illr_regval = REMOTE_HUB_L(nasid, IIO_LLP_LOG); + REMOTE_HUB_S(nasid, IIO_LLP_LOG, 0); + + hsp->hs_ii_sn_errors += illr.ii_illr_fld_s.i_sn_cnt; + hsp->hs_ii_cb_errors += illr.ii_illr_fld_s.i_cb_cnt; + if ((illr.ii_illr_fld_s.i_sn_cnt == IIO_LLP_SN_MAX) || + (illr.ii_illr_fld_s.i_cb_cnt == IIO_LLP_CB_MAX)) + hsp->hs_ii_overflows++; + + if (hsp->hs_print) { + if (check_hub_error_rates(hsp)) { + hsp->hs_last_print = GET_RTC_COUNTER(); + hsp->hs_print = 0; + } + } else { + if ((GET_RTC_COUNTER() - + hsp->hs_last_print) > hub_print_usecs) + hsp->hs_print = 1; + } + + npda->hubticks = HUB_CAPTURE_TICKS; +} + + +void +init_hub_stats(cnodeid_t cnodeid, struct nodepda_s *npda) +{ + hubstat_t *hsp = &(npda->hubstats); + nasid_t nasid = cnodeid_to_nasid(cnodeid); + bzero(&(npda->hubstats), sizeof(hubstat_t)); + + hsp->hs_version = HUBSTAT_VERSION; + hsp->hs_cnode = cnodeid; + hsp->hs_nasid = nasid; + hsp->hs_timebase = GET_RTC_COUNTER(); + hsp->hs_ni_port_status = REMOTE_HUB_L(nasid, NI_PORT_STATUS); + + /* Clear the II error counts. */ + REMOTE_HUB_S(nasid, IIO_LLP_LOG, 0); + + /* Clear the NI counts. */ + REMOTE_HUB_L(nasid, NI_PORT_ERROR_CLEAR); + + hsp->hs_per_minute = (long long)RTC_CYCLES_PER_SEC * 60LL; + + npda->hubticks = HUB_CAPTURE_TICKS; + + /* XX should use kmem_alloc_node */ + hsp->hs_name = (char *)kmalloc(MAX_HUB_PATH, GFP_KERNEL); + ASSERT_ALWAYS(hsp->hs_name); + + sprintf(hsp->hs_name, "/dev/hw/" EDGE_LBL_MODULE "/%03d/" + EDGE_LBL_NODE "/" EDGE_LBL_HUB, + npda->module_id); + + hsp->hs_last_print = 0; + hsp->hs_print = 1; + + hub_print_usecs = hub_print_usecs; + +#if 0 + printk("init_hub_stats: cnode=%d nasid=%d hs_version=%d hs_ni_port_status=0x%016lx\n", + cnodeid, nasid, hsp->hs_version, hsp->hs_ni_port_status); +#endif +} + +static int +hubstats_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + cnodeid_t cnode; + nodepda_t *npdap; + uint64_t longarg; + devfs_handle_t d; + + if ((d = devfs_get_handle_from_inode(inode)) == NULL) + return -ENODEV; + cnode = (cnodeid_t)hwgraph_fastinfo_get(d); + npdap = NODEPDA(cnode); + + if (npdap->hubstats.hs_version != HUBSTAT_VERSION) { + init_hub_stats(cnode, npdap); + } + + switch (cmd) { + case SNDRV_GET_INFOSIZE: + longarg = sizeof(hubstat_t); + if (copy_to_user((void *)arg, &longarg, sizeof(longarg))) { + return -EFAULT; + } + break; + + case SNDRV_GET_HUBINFO: + /* refresh npda->hubstats */ + capture_hub_stats(cnode, npdap); + if (copy_to_user((void *)arg, &npdap->hubstats, sizeof(hubstat_t))) { + return -EFAULT; + } + break; + + default: + return -EINVAL; + } + + return 0; +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn1/huberror.c lia64-2.4/arch/ia64/sn/io/sn1/huberror.c --- linux-2.4.18/arch/ia64/sn/io/sn1/huberror.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn1/huberror.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,228 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern void hubni_eint_init(cnodeid_t cnode); +extern void hubii_eint_init(cnodeid_t cnode); +extern void hubii_eint_handler (int irq, void *arg, struct pt_regs *ep); +extern void snia_error_intr_handler(int irq, void *devid, struct pt_regs *pt_regs); + +extern int maxcpus; + +#define HUB_ERROR_PERIOD (120 * HZ) /* 2 minutes */ + + +void +hub_error_clear(nasid_t nasid) +{ + int i; + hubreg_t idsr; + int sn; + + for(sn=0; snh_cnodeid == cnode); + + ilcsr.ii_ilcsr_regval = REMOTE_HUB_L(hinfo->h_nasid, IIO_ILCSR); + + if ((ilcsr.ii_ilcsr_fld_s.i_llp_stat & 0x2) == 0) { + /* + * HUB II link is not up. + * Just disable LLP, and don't connect any interrupts. + */ + ilcsr.ii_ilcsr_fld_s.i_llp_en = 0; + REMOTE_HUB_S(hinfo->h_nasid, IIO_ILCSR, ilcsr.ii_ilcsr_regval); + return; + } + /* Select a possible interrupt target where there is a free interrupt + * bit and also reserve the interrupt bit for this IO error interrupt + */ + intr_cpu = intr_heuristic(hub_v,0,INTRCONNECT_ANYBIT,II_ERRORINT,hub_v, + "HUB IO error interrupt",&bit); + if (intr_cpu == CPU_NONE) { + printk("hubii_eint_init: intr_reserve_level failed, cnode %d", cnode); + return; + } + + rv = intr_connect_level(intr_cpu, bit, 0, NULL); + synergy_intr_connect(bit, intr_cpu); + request_irq(bit_pos_to_irq(bit) + (intr_cpu << 8), hubii_eint_handler, 0, "SN hub error", (void *)hub_v); + ASSERT_ALWAYS(rv >= 0); + hubio_eint.ii_iidsr_regval = 0; + hubio_eint.ii_iidsr_fld_s.i_enable = 1; + hubio_eint.ii_iidsr_fld_s.i_level = bit;/* Take the least significant bits*/ + hubio_eint.ii_iidsr_fld_s.i_node = COMPACT_TO_NASID_NODEID(cnode); + hubio_eint.ii_iidsr_fld_s.i_pi_id = cpuid_to_subnode(intr_cpu); + REMOTE_HUB_S(hinfo->h_nasid, IIO_IIDSR, hubio_eint.ii_iidsr_regval); + +} + +void +hubni_eint_init(cnodeid_t cnode) +{ + int intr_bit; + cpuid_t targ; + + + if ((targ = cnodeid_to_cpuid(cnode)) == CPU_NONE) + return; + + /* The prom chooses which cpu gets these interrupts, but we + * don't know which one it chose. We will register all of the + * cpus to be sure. This only costs us an irqaction per cpu. + */ + for (; targ < CPUS_PER_NODE; targ++) { + if (!cpu_enabled(targ) ) continue; + /* connect the INTEND1 bits. */ + for (intr_bit = XB_ERROR; intr_bit <= MSC_PANIC_INTR; intr_bit++) { + intr_connect_level(targ, intr_bit, II_ERRORINT, NULL); + } + request_irq(SGI_HUB_ERROR_IRQ + (targ << 8), snia_error_intr_handler, 0, "SN hub error", NULL); + /* synergy masks are initialized in the prom to enable all interrupts. */ + /* We'll just leave them that way, here, for these interrupts. */ + } +} + + +/*ARGSUSED*/ +void +hubii_eint_handler (int irq, void *arg, struct pt_regs *ep) +{ + + panic("Hubii interrupt\n"); +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn1/ip37.c lia64-2.4/arch/ia64/sn/io/sn1/ip37.c --- linux-2.4.18/arch/ia64/sn/io/sn1/ip37.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn1/ip37.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,47 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +/* + * ip37.c + * Support for IP35/IP37 machines + */ + +#include + +#include +#include +#include +#include /* for bridge_t */ + + +xwidgetnum_t +hub_widget_id(nasid_t nasid) +{ + hubii_wcr_t ii_wcr; /* the control status register */ + + ii_wcr.wcr_reg_value = REMOTE_HUB_L(nasid,IIO_WCR); + + return ii_wcr.wcr_fields_s.wcr_widget_id; +} + +int +is_fine_dirmode(void) +{ + return (((LOCAL_HUB_L(LB_REV_ID) & LRI_SYSTEM_SIZE_MASK) + >> LRI_SYSTEM_SIZE_SHFT) == SYSTEM_SIZE_SMALL); + +} + + +void +ni_reset_port(void) +{ + LOCAL_HUB_S(NI_RESET_ENABLE, NRE_RESETOK); + LOCAL_HUB_S(NI_PORT_RESET, NPR_PORTRESET | NPR_LOCALRESET); +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn1/mem_refcnt.c lia64-2.4/arch/ia64/sn/io/sn1/mem_refcnt.c --- linux-2.4.18/arch/ia64/sn/io/sn1/mem_refcnt.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn1/mem_refcnt.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,221 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// From numa_hw.h + +#define MIGR_COUNTER_MAX_GET(nodeid) \ + (NODEPDA_MCD((nodeid))->migr_system_kparms.migr_threshold_reference) +/* + * Get the Absolute Theshold + */ +#define MIGR_THRESHOLD_ABS_GET(nodeid) ( \ + MD_MIG_VALUE_THRESH_GET(COMPACT_TO_NASID_NODEID(nodeid))) +/* + * Get the current Differential Threshold + */ +#define MIGR_THRESHOLD_DIFF_GET(nodeid) \ + (NODEPDA_MCD(nodeid)->migr_as_kparms.migr_base_threshold) + +#define NUM_OF_HW_PAGES_PER_SW_PAGE() (NBPP / MD_PAGE_SIZE) + +// #include "migr_control.h" + +int +mem_refcnt_attach(devfs_handle_t hub) +{ +#ifndef CONFIG_IA64_SGI_SN + devfs_handle_t refcnt_dev; + + hwgraph_char_device_add(hub, + "refcnt", + "hubspc_", + &refcnt_dev); + device_info_set(refcnt_dev, (void*)(ulong)HUBSPC_REFCOUNTERS); +#endif + + return (0); +} + + +/*ARGSUSED*/ +int +mem_refcnt_open(devfs_handle_t *devp, mode_t oflag, int otyp, cred_t *crp) +{ + cnodeid_t node; + + node = master_node_get(*devp); + + ASSERT( (node >= 0) && (node < numnodes) ); + + if (NODEPDA(node)->migr_refcnt_counterbuffer == NULL) { + return (ENODEV); + } + + ASSERT( NODEPDA(node)->migr_refcnt_counterbase != NULL ); + ASSERT( NODEPDA(node)->migr_refcnt_cbsize != (size_t)0 ); + + return (0); +} + +/*ARGSUSED*/ +int +mem_refcnt_close(devfs_handle_t dev, int oflag, int otyp, cred_t *crp) +{ + return 0; +} + +/*ARGSUSED*/ +int +mem_refcnt_mmap(devfs_handle_t dev, vhandl_t *vt, off_t off, size_t len, uint prot) +{ + cnodeid_t node; + int errcode; + char* buffer; + size_t blen; + + node = master_node_get(dev); + + ASSERT( (node >= 0) && (node < numnodes) ); + + ASSERT( NODEPDA(node)->migr_refcnt_counterbuffer != NULL); + ASSERT( NODEPDA(node)->migr_refcnt_counterbase != NULL ); + ASSERT( NODEPDA(node)->migr_refcnt_cbsize != 0 ); + + /* + * XXXX deal with prot's somewhere around here.... + */ + + buffer = NODEPDA(node)->migr_refcnt_counterbuffer; + blen = NODEPDA(node)->migr_refcnt_cbsize; + + /* + * Force offset to be a multiple of sizeof(refcnt_t) + * We round up. + */ + + off = (((off - 1)/sizeof(refcnt_t)) + 1) * sizeof(refcnt_t); + + if ( ((buffer + blen) - (buffer + off + len)) < 0 ) { + return (EPERM); + } + + errcode = v_mapphys(vt, + buffer + off, + len); + + return errcode; +} + +/*ARGSUSED*/ +int +mem_refcnt_unmap(devfs_handle_t dev, vhandl_t *vt) +{ + return 0; +} + +/* ARGSUSED */ +int +mem_refcnt_ioctl(devfs_handle_t dev, + int cmd, + void *arg, + int mode, + cred_t *cred_p, + int *rvalp) +{ + cnodeid_t node; + int errcode; + extern int numnodes; + + node = master_node_get(dev); + + ASSERT( (node >= 0) && (node < numnodes) ); + + ASSERT( NODEPDA(node)->migr_refcnt_counterbuffer != NULL); + ASSERT( NODEPDA(node)->migr_refcnt_counterbase != NULL ); + ASSERT( NODEPDA(node)->migr_refcnt_cbsize != 0 ); + + errcode = 0; + + switch (cmd) { + case RCB_INFO_GET: + { + rcb_info_t rcb; + + rcb.rcb_len = NODEPDA(node)->migr_refcnt_cbsize; + + rcb.rcb_sw_sets = NODEPDA(node)->migr_refcnt_numsets; + rcb.rcb_sw_counters_per_set = numnodes; + rcb.rcb_sw_counter_size = sizeof(refcnt_t); + + rcb.rcb_base_pages = NODEPDA(node)->migr_refcnt_numsets / + NUM_OF_HW_PAGES_PER_SW_PAGE(); + rcb.rcb_base_page_size = NBPP; + rcb.rcb_base_paddr = ctob(slot_getbasepfn(node, 0)); + + rcb.rcb_cnodeid = node; + rcb.rcb_granularity = MD_PAGE_SIZE; +#ifdef LATER + rcb.rcb_hw_counter_max = MIGR_COUNTER_MAX_GET(node); + rcb.rcb_diff_threshold = MIGR_THRESHOLD_DIFF_GET(node); +#endif + rcb.rcb_abs_threshold = MIGR_THRESHOLD_ABS_GET(node); + rcb.rcb_num_slots = MAX_MEM_SLOTS; + + if (COPYOUT(&rcb, arg, sizeof(rcb_info_t))) { + errcode = EFAULT; + } + + break; + } + case RCB_SLOT_GET: + { + rcb_slot_t slot[MAX_MEM_SLOTS]; + int s; + int nslots; + + nslots = MAX_MEM_SLOTS; + ASSERT(nslots <= MAX_MEM_SLOTS); + for (s = 0; s < nslots; s++) { + slot[s].base = (uint64_t)ctob(slot_getbasepfn(node, s)); +#ifdef LATER + slot[s].size = (uint64_t)ctob(slot_getsize(node, s)); +#else + slot[s].size = (uint64_t)1; +#endif + } + if (COPYOUT(&slot[0], arg, nslots * sizeof(rcb_slot_t))) { + errcode = EFAULT; + } + + *rvalp = nslots; + break; + } + + default: + errcode = EINVAL; + break; + + } + + return errcode; +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn1/ml_SN_intr.c lia64-2.4/arch/ia64/sn/io/sn1/ml_SN_intr.c --- linux-2.4.18/arch/ia64/sn/io/sn1/ml_SN_intr.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn1/ml_SN_intr.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,1154 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +/* + * intr.c- + * This file contains all of the routines necessary to set up and + * handle interrupts on an IP27 board. + */ + +#ident "$Revision: 1.167 $" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#if DEBUG_INTR_TSTAMP_DEBUG +#include +#include +#include +void do_splx_log(int, int); +void spldebug_log_event(int); +#endif + +#ifdef CONFIG_SMP +extern unsigned long cpu_online_map; +#endif +#define cpu_allows_intr(cpu) (1) +// If I understand what's going on with this, 32 should work. +// physmem_maxradius seems to be the maximum number of router +// hops to get from one end of the system to the other. With +// a maximally configured machine, with the dumbest possible +// topology, we would make 32 router hops. For what we're using +// it for, the dumbest possible should suffice. +#define physmem_maxradius() 32 + +#define SUBNODE_ANY (-1) + +extern int nmied; +extern int hub_intr_wakeup_cnt; +extern synergy_da_t *Synergy_da_indr[]; +extern cpuid_t master_procid; + +extern cnodeid_t master_node_get(devfs_handle_t vhdl); + +extern void snia_error_intr_handler(int irq, void *devid, struct pt_regs *pt_regs); + + +#define INTR_LOCK(vecblk) \ + (s = mutex_spinlock(&(vecblk)->vector_lock)) +#define INTR_UNLOCK(vecblk) \ + mutex_spinunlock(&(vecblk)->vector_lock, s) + +/* + * REACT/Pro + */ + + + +/* + * Find first bit set + * Used outside this file also + */ +int ms1bit(unsigned long x) +{ + int b; + + if (x >> 32) b = 32, x >>= 32; + else b = 0; + if (x >> 16) b += 16, x >>= 16; + if (x >> 8) b += 8, x >>= 8; + if (x >> 4) b += 4, x >>= 4; + if (x >> 2) b += 2, x >>= 2; + + return b + (int) (x >> 1); +} + +/* ARGSUSED */ +void +intr_stray(void *lvl) +{ + printk(KERN_WARNING "Stray Interrupt - level %ld to cpu %d", (long)lvl, smp_processor_id()); +} + +#if defined(DEBUG) + +/* Infrastructure to gather the device - target cpu mapping info */ +#define MAX_DEVICES 1000 /* Reasonable large number . Need not be + * the exact maximum # devices possible. + */ +#define MAX_NAME 100 +typedef struct { + dev_t dev; /* device */ + cpuid_t cpuid; /* target cpu */ + cnodeid_t cnodeid;/* node on which the target cpu is present */ + int bit; /* intr bit reserved */ + char intr_name[MAX_NAME]; /* name of the interrupt */ +} intr_dev_targ_map_t; + +intr_dev_targ_map_t intr_dev_targ_map[MAX_DEVICES]; +uint64_t intr_dev_targ_map_size; +spinlock_t intr_dev_targ_map_lock; + +/* Print out the device - target cpu mapping. + * This routine is used only in the idbg command + * "intrmap" + */ +void +intr_dev_targ_map_print(cnodeid_t cnodeid) +{ + int i,j,size = 0; + int print_flag = 0,verbose = 0; + char node_name[10]; + + if (cnodeid != CNODEID_NONE) { + nodepda_t *npda; + + npda = NODEPDA(cnodeid); + for (j=0; jintr_dispatch0.info[i].ii_flags); + qprintf("\n INT_PEND1: "); + for(i = 0 ; i < N_INTPEND_BITS ; i++) + qprintf("%d",SNPDA(npda,j)->intr_dispatch1.info[i].ii_flags); + } + verbose = 1; + } + qprintf("\n Device - Target Map [Interrupts: %s Node%s]\n\n", + (verbose ? "All" : "Non-hardwired"), + (cnodeid == CNODEID_NONE) ? "s: All" : node_name); + + qprintf("Device\tCpu\tCnode\tIntr_bit\tIntr_name\n"); + for (i = 0 ; i < intr_dev_targ_map_size ; i++) { + + print_flag = 0; + if (verbose) { + if (cnodeid != CNODEID_NONE) { + if (cnodeid == intr_dev_targ_map[i].cnodeid) + print_flag = 1; + } else { + print_flag = 1; + } + } else { + if (intr_dev_targ_map[i].dev != 0) { + if (cnodeid != CNODEID_NONE) { + if (cnodeid == + intr_dev_targ_map[i].cnodeid) + print_flag = 1; + } else { + print_flag = 1; + } + } + } + if (print_flag) { + size++; + qprintf("%d\t%d\t%d\t%d\t%s\n", + intr_dev_targ_map[i].dev, + intr_dev_targ_map[i].cpuid, + intr_dev_targ_map[i].cnodeid, + intr_dev_targ_map[i].bit, + intr_dev_targ_map[i].intr_name); + } + + } + qprintf("\nTotal : %d\n",size); +} +#endif /* DEBUG */ + +/* + * The spinlocks have already been initialized. Now initialize the interrupt + * vectors. One processor on each hub does the work. + */ +void +intr_init_vecblk(nodepda_t *npda, cnodeid_t node, int sn) +{ + int i, ip=0; + intr_vecblk_t *vecblk; + subnode_pda_t *snpda; + + + snpda = SNPDA(npda,sn); + do { + if (ip == 0) { + vecblk = &snpda->intr_dispatch0; + } else { + vecblk = &snpda->intr_dispatch1; + } + + /* Initialize this vector. */ + for (i = 0; i < N_INTPEND_BITS; i++) { + vecblk->vectors[i].iv_func = intr_stray; + vecblk->vectors[i].iv_prefunc = NULL; + vecblk->vectors[i].iv_arg = (void *)(__psint_t)(ip * N_INTPEND_BITS + i); + + vecblk->info[i].ii_owner_dev = 0; + strcpy(vecblk->info[i].ii_name, "Unused"); + vecblk->info[i].ii_flags = 0; /* No flags */ + vecblk->vectors[i].iv_mustruncpu = -1; /* No CPU yet. */ + + } + + mutex_spinlock_init(&vecblk->vector_lock); + + vecblk->vector_count = 0; + for (i = 0; i < CPUS_PER_SUBNODE; i++) + vecblk->cpu_count[i] = 0; + + vecblk->vector_state = VECTOR_UNINITED; + + } while (++ip < 2); + +} + + +/* + * do_intr_reserve_level(cpuid_t cpu, int bit, int resflags, int reserve, + * devfs_handle_t owner_dev, char *name) + * Internal work routine to reserve or unreserve an interrupt level. + * cpu is the CPU to which the interrupt will be sent. + * bit is the level bit to reserve. -1 means any level + * resflags should include II_ERRORINT if this is an + * error interrupt, II_THREADED if the interrupt handler + * will be threaded, or 0 otherwise. + * reserve should be set to II_RESERVE or II_UNRESERVE + * to get or clear a reservation. + * owner_dev is the device that "owns" this interrupt, if supplied + * name is a human-readable name for this interrupt, if supplied + * intr_reserve_level returns the bit reserved or -1 to indicate an error + */ +static int +do_intr_reserve_level(cpuid_t cpu, int bit, int resflags, int reserve, + devfs_handle_t owner_dev, char *name) +{ + intr_vecblk_t *vecblk; + hub_intmasks_t *hub_intmasks; + unsigned long s; + int rv = 0; + int ip; + synergy_da_t *sda; + int which_synergy; + cnodeid_t cnode; + + ASSERT(bit < N_INTPEND_BITS * 2); + + cnode = cpuid_to_cnodeid(cpu); + which_synergy = cpuid_to_synergy(cpu); + sda = Synergy_da_indr[(cnode * 2) + which_synergy]; + hub_intmasks = &sda->s_intmasks; + // hub_intmasks = &pdaindr[cpu].pda->p_intmasks; + + // if (pdaindr[cpu].pda == NULL) return -1; + if ((bit < N_INTPEND_BITS) && !(resflags & II_ERRORINT)) { + vecblk = hub_intmasks->dispatch0; + ip = 0; + } else { + ASSERT((bit >= N_INTPEND_BITS) || (bit == -1)); + bit -= N_INTPEND_BITS; /* Get position relative to INT_PEND1 reg. */ + vecblk = hub_intmasks->dispatch1; + ip = 1; + } + + INTR_LOCK(vecblk); + + if (bit <= -1) { + bit = 0; + ASSERT(reserve == II_RESERVE); + /* Choose any available level */ + for (; bit < N_INTPEND_BITS; bit++) { + if (!(vecblk->info[bit].ii_flags & II_RESERVE)) { + rv = bit; + break; + } + } + + /* Return -1 if all interrupt levels int this register are taken. */ + if (bit == N_INTPEND_BITS) + rv = -1; + + } else { + /* Reserve a particular level if it's available. */ + if ((vecblk->info[bit].ii_flags & II_RESERVE) == reserve) { + /* Can't (un)reserve a level that's already (un)reserved. */ + rv = -1; + } else { + rv = bit; + } + } + + /* Reserve the level and bump the count. */ + if (rv != -1) { + if (reserve) { + int maxlen = sizeof(vecblk->info[bit].ii_name) - 1; + int namelen; + vecblk->info[bit].ii_flags |= (II_RESERVE | resflags); + vecblk->info[bit].ii_owner_dev = owner_dev; + /* Copy in the name. */ + namelen = name ? strlen(name) : 0; + strncpy(vecblk->info[bit].ii_name, name, min(namelen, maxlen)); + vecblk->info[bit].ii_name[maxlen] = '\0'; + vecblk->vector_count++; + } else { + vecblk->info[bit].ii_flags = 0; /* Clear all the flags */ + vecblk->info[bit].ii_owner_dev = 0; + /* Clear the name. */ + vecblk->info[bit].ii_name[0] = '\0'; + vecblk->vector_count--; + } + } + + INTR_UNLOCK(vecblk); + +#if defined(DEBUG) + if (rv >= 0) { + int namelen = name ? strlen(name) : 0; + /* Gather this device - target cpu mapping information + * in a table which can be used later by the idbg "intrmap" + * command + */ + s = mutex_spinlock(&intr_dev_targ_map_lock); + if (intr_dev_targ_map_size < MAX_DEVICES) { + intr_dev_targ_map_t *p; + + p = &intr_dev_targ_map[intr_dev_targ_map_size]; + p->dev = owner_dev; + p->cpuid = cpu; + p->cnodeid = cpuid_to_cnodeid(cpu); + p->bit = ip * N_INTPEND_BITS + rv; + strncpy(p->intr_name, + name, + min(MAX_NAME,namelen)); + intr_dev_targ_map_size++; + } + mutex_spinunlock(&intr_dev_targ_map_lock,s); + } +#endif /* DEBUG */ + + return (((rv == -1) ? rv : (ip * N_INTPEND_BITS) + rv)) ; +} + + +/* + * WARNING: This routine should only be called from within ml/SN. + * Reserve an interrupt level. + */ +int +intr_reserve_level(cpuid_t cpu, int bit, int resflags, devfs_handle_t owner_dev, char *name) +{ + return(do_intr_reserve_level(cpu, bit, resflags, II_RESERVE, owner_dev, name)); +} + + +/* + * WARNING: This routine should only be called from within ml/SN. + * Unreserve an interrupt level. + */ +void +intr_unreserve_level(cpuid_t cpu, int bit) +{ + (void)do_intr_reserve_level(cpu, bit, 0, II_UNRESERVE, 0, NULL); +} + +/* + * Get values that vary depending on which CPU and bit we're operating on + */ +static hub_intmasks_t * +intr_get_ptrs(cpuid_t cpu, int bit, + int *new_bit, /* Bit relative to the register */ + hubreg_t **intpend_masks, /* Masks for this register */ + intr_vecblk_t **vecblk, /* Vecblock for this interrupt */ + int *ip) /* Which intpend register */ +{ + hub_intmasks_t *hub_intmasks; + synergy_da_t *sda; + int which_synergy; + cnodeid_t cnode; + + ASSERT(bit < N_INTPEND_BITS * 2); + + cnode = cpuid_to_cnodeid(cpu); + which_synergy = cpuid_to_synergy(cpu); + sda = Synergy_da_indr[(cnode * 2) + which_synergy]; + hub_intmasks = &sda->s_intmasks; + + // hub_intmasks = &pdaindr[cpu].pda->p_intmasks; + + if (bit < N_INTPEND_BITS) { + *intpend_masks = hub_intmasks->intpend0_masks; + *vecblk = hub_intmasks->dispatch0; + *ip = 0; + *new_bit = bit; + } else { + *intpend_masks = hub_intmasks->intpend1_masks; + *vecblk = hub_intmasks->dispatch1; + *ip = 1; + *new_bit = bit - N_INTPEND_BITS; + } + + return hub_intmasks; +} + + +/* + * intr_connect_level(cpuid_t cpu, int bit, ilvl_t intr_swlevel, + * intr_func_t intr_func, void *intr_arg); + * This is the lowest-level interface to the interrupt code. It shouldn't + * be called from outside the ml/SN directory. + * intr_connect_level hooks up an interrupt to a particular bit in + * the INT_PEND0/1 masks. Returns 0 on success. + * cpu is the CPU to which the interrupt will be sent. + * bit is the level bit to connect to + * intr_swlevel tells which software level to use + * intr_func is the interrupt handler + * intr_arg is an arbitrary argument interpreted by the handler + * intr_prefunc is a prologue function, to be called + * with interrupts disabled, to disable + * the interrupt at source. It is called + * with the same argument. Should be NULL for + * typical interrupts, which can be masked + * by the infrastructure at the level bit. + * intr_connect_level returns 0 on success or nonzero on an error + */ +/* ARGSUSED */ +int +intr_connect_level(cpuid_t cpu, int bit, ilvl_t intr_swlevel, intr_func_t intr_prefunc) +{ + intr_vecblk_t *vecblk; + hubreg_t *intpend_masks; + int rv = 0; + int ip; + unsigned long s; + + ASSERT(bit < N_INTPEND_BITS * 2); + + (void)intr_get_ptrs(cpu, bit, &bit, &intpend_masks, + &vecblk, &ip); + + INTR_LOCK(vecblk); + + if ((vecblk->info[bit].ii_flags & II_INUSE) || + (!(vecblk->info[bit].ii_flags & II_RESERVE))) { + /* Can't assign to a level that's in use or isn't reserved. */ + rv = -1; + } else { + /* Stuff parameters into vector and info */ + vecblk->vectors[bit].iv_prefunc = intr_prefunc; + vecblk->info[bit].ii_flags |= II_INUSE; + } + + /* Now stuff the masks if everything's okay. */ + if (!rv) { + int lslice; + volatile hubreg_t *mask_reg; + // nasid_t nasid = COMPACT_TO_NASID_NODEID(cpuid_to_cnodeid(cpu)); + nasid_t nasid = cpuid_to_nasid(cpu); + int subnode = cpuid_to_subnode(cpu); + + /* Make sure it's not already pending when we connect it. */ + REMOTE_HUB_PI_CLR_INTR(nasid, subnode, bit + ip * N_INTPEND_BITS); + + if (bit >= GFX_INTR_A && bit <= CC_PEND_B) { + intpend_masks[0] |= (1ULL << (uint64_t)bit); + } + + lslice = cpuid_to_localslice(cpu); + vecblk->cpu_count[lslice]++; +#if SN1 + /* + * On SN1, there are 8 interrupt mask registers per node: + * PI_0 MASK_0 A + * PI_0 MASK_1 A + * PI_0 MASK_0 B + * PI_0 MASK_1 B + * PI_1 MASK_0 A + * PI_1 MASK_1 A + * PI_1 MASK_0 B + * PI_1 MASK_1 B + */ +#endif + if (ip == 0) { + mask_reg = REMOTE_HUB_PI_ADDR(nasid, subnode, + PI_INT_MASK0_A + PI_INT_MASK_OFFSET * lslice); + } else { + mask_reg = REMOTE_HUB_PI_ADDR(nasid, subnode, + PI_INT_MASK1_A + PI_INT_MASK_OFFSET * lslice); + } + + HUB_S(mask_reg, intpend_masks[0]); + } + + INTR_UNLOCK(vecblk); + + return rv; +} + + +/* + * intr_disconnect_level(cpuid_t cpu, int bit) + * + * This is the lowest-level interface to the interrupt code. It should + * not be called from outside the ml/SN directory. + * intr_disconnect_level removes a particular bit from an interrupt in + * the INT_PEND0/1 masks. Returns 0 on success or nonzero on failure. + */ +int +intr_disconnect_level(cpuid_t cpu, int bit) +{ + intr_vecblk_t *vecblk; + hubreg_t *intpend_masks; + unsigned long s; + int rv = 0; + int ip; + + (void)intr_get_ptrs(cpu, bit, &bit, &intpend_masks, + &vecblk, &ip); + + INTR_LOCK(vecblk); + + if ((vecblk->info[bit].ii_flags & (II_RESERVE | II_INUSE)) != + ((II_RESERVE | II_INUSE))) { + /* Can't remove a level that's not in use or isn't reserved. */ + rv = -1; + } else { + /* Stuff parameters into vector and info */ + vecblk->vectors[bit].iv_func = (intr_func_t)NULL; + vecblk->vectors[bit].iv_prefunc = (intr_func_t)NULL; + vecblk->vectors[bit].iv_arg = 0; + vecblk->info[bit].ii_flags &= ~II_INUSE; +#ifdef BASE_ITHRTEAD + vecblk->vectors[bit].iv_mustruncpu = -1; /* No mustrun CPU any more. */ +#endif + } + + /* Now clear the masks if everything's okay. */ + if (!rv) { + int lslice; + volatile hubreg_t *mask_reg; + + intpend_masks[0] &= ~(1ULL << (uint64_t)bit); + lslice = cpuid_to_localslice(cpu); + vecblk->cpu_count[lslice]--; + mask_reg = REMOTE_HUB_PI_ADDR(COMPACT_TO_NASID_NODEID(cpuid_to_cnodeid(cpu)), + cpuid_to_subnode(cpu), + ip == 0 ? PI_INT_MASK0_A : PI_INT_MASK1_A); + mask_reg = (volatile hubreg_t *)((__psunsigned_t)mask_reg + + (PI_INT_MASK_OFFSET * lslice)); + *mask_reg = intpend_masks[0]; + } + + INTR_UNLOCK(vecblk); + + return rv; +} + +/* + * Actually block or unblock an interrupt + */ +void +do_intr_block_bit(cpuid_t cpu, int bit, int block) +{ + intr_vecblk_t *vecblk; + int ip; + unsigned long s; + hubreg_t *intpend_masks; + volatile hubreg_t mask_value; + volatile hubreg_t *mask_reg; + + intr_get_ptrs(cpu, bit, &bit, &intpend_masks, &vecblk, &ip); + + INTR_LOCK(vecblk); + + if (block) + /* Block */ + intpend_masks[0] &= ~(1ULL << (uint64_t)bit); + else + /* Unblock */ + intpend_masks[0] |= (1ULL << (uint64_t)bit); + + if (ip == 0) { + mask_reg = REMOTE_HUB_PI_ADDR(COMPACT_TO_NASID_NODEID(cpuid_to_cnodeid(cpu)), + cpuid_to_subnode(cpu), PI_INT_MASK0_A); + } else { + mask_reg = REMOTE_HUB_PI_ADDR(COMPACT_TO_NASID_NODEID(cpuid_to_cnodeid(cpu)), + cpuid_to_subnode(cpu), PI_INT_MASK1_A); + } + + HUB_S(mask_reg, intpend_masks[0]); + + /* + * Wait for it to take effect. (One read should suffice.) + * This is only necessary when blocking an interrupt + */ + if (block) + while ((mask_value = HUB_L(mask_reg)) != intpend_masks[0]) + ; + + INTR_UNLOCK(vecblk); +} + + +/* + * Block a particular interrupt (cpu/bit pair). + */ +/* ARGSUSED */ +void +intr_block_bit(cpuid_t cpu, int bit) +{ + do_intr_block_bit(cpu, bit, 1); +} + + +/* + * Unblock a particular interrupt (cpu/bit pair). + */ +/* ARGSUSED */ +void +intr_unblock_bit(cpuid_t cpu, int bit) +{ + do_intr_block_bit(cpu, bit, 0); +} + + +/* verifies that the specified CPUID is on the specified SUBNODE (if any) */ +#define cpu_on_subnode(cpuid, which_subnode) \ + (((which_subnode) == SUBNODE_ANY) || (cpuid_to_subnode(cpuid) == (which_subnode))) + + +/* + * Choose one of the CPUs on a specified node or subnode to receive + * interrupts. Don't pick a cpu which has been specified as a NOINTR cpu. + * + * Among all acceptable CPUs, the CPU that has the fewest total number + * of interrupts targetted towards it is chosen. Note that we never + * consider how frequent each of these interrupts might occur, so a rare + * hardware error interrupt is weighted equally with a disk interrupt. + */ +static cpuid_t +do_intr_cpu_choose(cnodeid_t cnode, int which_subnode) +{ + cpuid_t cpu, best_cpu = CPU_NONE; + int slice, min_count=1000; + + min_count = 1000; + for (slice=0; slice < CPUS_PER_NODE; slice++) { + intr_vecblk_t *vecblk0, *vecblk1; + int total_intrs_to_slice; + subnode_pda_t *snpda; + int local_cpu_num; + + cpu = cnode_slice_to_cpuid(cnode, slice); + if (cpu == CPU_NONE) + continue; + + /* If this cpu isn't enabled for interrupts, skip it */ + if (!cpu_enabled(cpu) || !cpu_allows_intr(cpu)) + continue; + + /* If this isn't the right subnode, skip it */ + if (!cpu_on_subnode(cpu, which_subnode)) + continue; + + /* OK, this one's a potential CPU for interrupts */ + snpda = SUBNODEPDA(cnode,SUBNODE(slice)); + vecblk0 = &snpda->intr_dispatch0; + vecblk1 = &snpda->intr_dispatch1; + local_cpu_num = LOCALCPU(slice); + total_intrs_to_slice = vecblk0->cpu_count[local_cpu_num] + + vecblk1->cpu_count[local_cpu_num]; + + if (min_count > total_intrs_to_slice) { + min_count = total_intrs_to_slice; + best_cpu = cpu; + } + } + return best_cpu; +} + +/* + * Choose an appropriate interrupt target CPU on a specified node. + * If which_subnode is SUBNODE_ANY, then subnode is not considered. + * Otherwise, the chosen CPU must be on the specified subnode. + */ +static cpuid_t +intr_cpu_choose_from_node(cnodeid_t cnode, int which_subnode) +{ + return(do_intr_cpu_choose(cnode, which_subnode)); +} + + +/* Make it easy to identify subnode vertices in the hwgraph */ +void +mark_subnodevertex_as_subnode(devfs_handle_t vhdl, int which_subnode) +{ + graph_error_t rv; + + ASSERT(0 <= which_subnode); + ASSERT(which_subnode < NUM_SUBNODES); + + rv = hwgraph_info_add_LBL(vhdl, INFO_LBL_CPUBUS, (arbitrary_info_t)which_subnode); + ASSERT_ALWAYS(rv == GRAPH_SUCCESS); + + rv = hwgraph_info_export_LBL(vhdl, INFO_LBL_CPUBUS, sizeof(arbitrary_info_t)); + ASSERT_ALWAYS(rv == GRAPH_SUCCESS); +} + + +/* + * Given a device descriptor, extract interrupt target information and + * choose an appropriate CPU. Return CPU_NONE if we can't make sense + * out of the target information. + * TBD: Should this be considered platform-independent code? + */ + + +/* + * intr_bit_reserve_test(cpuid,which_subnode,cnode,req_bit,intr_resflags, + * owner_dev,intr_name,*resp_bit) + * Either cpuid is not CPU_NONE or cnodeid not CNODE_NONE but + * not both. + * 1. If cpuid is specified, this routine tests if this cpu can be a valid + * interrupt target candidate. + * 2. If cnodeid is specified, this routine tests if there is a cpu on + * this node which can be a valid interrupt target candidate. + * 3. If a valid interrupt target cpu candidate is found then an attempt at + * reserving an interrupt bit on the corresponding cnode is made. + * + * If steps 1 & 2 both fail or step 3 fails then we are not able to get a valid + * interrupt target cpu then routine returns CPU_NONE (failure) + * Otherwise routine returns cpuid of interrupt target (success) + */ +static cpuid_t +intr_bit_reserve_test(cpuid_t cpuid, + int favor_subnode, + cnodeid_t cnodeid, + int req_bit, + int intr_resflags, + devfs_handle_t owner_dev, + char *intr_name, + int *resp_bit) +{ + + ASSERT((cpuid==CPU_NONE) || (cnodeid==CNODEID_NONE)); + + if (cnodeid != CNODEID_NONE) { + /* Try to choose a interrupt cpu candidate */ + cpuid = intr_cpu_choose_from_node(cnodeid, favor_subnode); + } + + if (cpuid != CPU_NONE) { + /* Try to reserve an interrupt bit on the hub + * corresponding to the canidate cnode. If we + * are successful then we got a cpu which can + * act as an interrupt target for the io device. + * Otherwise we need to continue the search + * further. + */ + *resp_bit = do_intr_reserve_level(cpuid, + req_bit, + intr_resflags, + II_RESERVE, + owner_dev, + intr_name); + + if (*resp_bit >= 0) + /* The interrupt target specified was fine */ + return(cpuid); + } + return(CPU_NONE); +} +/* + * intr_heuristic(dev_t dev,device_desc_t dev_desc, + * int req_bit,int intr_resflags,dev_t owner_dev, + * char *intr_name,int *resp_bit) + * + * Choose an interrupt destination for an interrupt. + * dev is the device for which the interrupt is being set up + * dev_desc is a description of hardware and policy that could + * help determine where this interrupt should go + * req_bit is the interrupt bit requested + * (can be INTRCONNECT_ANY_BIT in which the first available + * interrupt bit is used) + * intr_resflags indicates whether we want to (un)reserve bit + * owner_dev is the owner device + * intr_name is the readable interrupt name + * resp_bit indicates whether we succeeded in getting the required + * action { (un)reservation} done + * negative value indicates failure + * + */ +/* ARGSUSED */ +cpuid_t +intr_heuristic(devfs_handle_t dev, + device_desc_t dev_desc, + int req_bit, + int intr_resflags, + devfs_handle_t owner_dev, + char *intr_name, + int *resp_bit) +{ + cpuid_t cpuid; /* possible intr targ*/ + cnodeid_t candidate; /* possible canidate */ + int which_subnode = SUBNODE_ANY; + +/* SN1 + pcibr Addressing Limitation */ + { + devfs_handle_t pconn_vhdl; + pcibr_soft_t pcibr_soft; + + /* + * This combination of SN1 and Bridge hardware has an odd "limitation". + * Due to the choice of addresses for PI0 and PI1 registers on SN1 + * and historical limitations in Bridge, Bridge is unable to + * send interrupts to both PI0 CPUs and PI1 CPUs -- we have + * to choose one set or the other. That choice is implicitly + * made when Bridge first attaches its error interrupt. After + * that point, all subsequent interrupts are restricted to the + * same PI number (though it's possible to send interrupts to + * the same PI number on a different node). + * + * Since neither SN1 nor Bridge designers are willing to admit a + * bug, we can't really call this a "workaround". It's a permanent + * solution for an SN1-specific and Bridge-specific hardware + * limitation that won't ever be lifted. + */ + if ((hwgraph_edge_get(dev, EDGE_LBL_PCI, &pconn_vhdl) == GRAPH_SUCCESS) && + ((pcibr_soft = pcibr_soft_get(pconn_vhdl)) != NULL)) { + /* + * We "know" that the error interrupt is the first + * interrupt set up by pcibr_attach. Send all interrupts + * on this bridge to the same subnode number. + */ + if (pcibr_soft->bsi_err_intr) { + which_subnode = cpuid_to_subnode(((hub_intr_t) pcibr_soft->bsi_err_intr)->i_cpuid); + } + } + } + + /* Check if we can find a valid interrupt target candidate on + * the master node for the device. + */ + cpuid = intr_bit_reserve_test(CPU_NONE, + which_subnode, + master_node_get(dev), + req_bit, + intr_resflags, + owner_dev, + intr_name, + resp_bit); + + if (cpuid != CPU_NONE) { + if (cpu_on_subnode(cpuid, which_subnode)) + return(cpuid); /* got a valid interrupt target */ + else + intr_unreserve_level(cpuid, *resp_bit); + } + + printk(KERN_WARNING "Cannot target interrupts to closest node(%d): (0x%lx)\n", + master_node_get(dev),(unsigned long)owner_dev); + + /* Fall through into the default algorithm + * (exhaustive-search-for-the-nearest-possible-interrupt-target) + * for finding the interrupt target + */ + + { + /* + * Do a stupid round-robin assignment of the node. + * (Should do a "nearest neighbor" but not for SN1. + */ + static cnodeid_t last_node = -1; + + if (last_node >= numnodes) last_node = 0; + for (candidate = last_node + 1; candidate != last_node; candidate++) { + if (candidate == numnodes) candidate = 0; + cpuid = intr_bit_reserve_test(CPU_NONE, + which_subnode, + candidate, + req_bit, + intr_resflags, + owner_dev, + intr_name, + resp_bit); + + if (cpuid != CPU_NONE) { + if (cpu_on_subnode(cpuid, which_subnode)) { + last_node = candidate; + return(cpuid); /* got a valid interrupt target */ + } + else + intr_unreserve_level(cpuid, *resp_bit); + } + } + last_node = candidate; + } + + printk(KERN_WARNING "Cannot target interrupts to any close node: %ld (0x%lx)\n", + (long)owner_dev, (unsigned long)owner_dev); + + /* In the worst case try to allocate interrupt bits on the + * master processor's node. We may get here during error interrupt + * allocation phase when the topology matrix is not yet setup + * and hence cannot do an exhaustive search. + */ + ASSERT(cpu_allows_intr(master_procid)); + cpuid = intr_bit_reserve_test(master_procid, + which_subnode, + CNODEID_NONE, + req_bit, + intr_resflags, + owner_dev, + intr_name, + resp_bit); + + if (cpuid != CPU_NONE) { + if (cpu_on_subnode(cpuid, which_subnode)) + return(cpuid); + else + intr_unreserve_level(cpuid, *resp_bit); + } + + printk(KERN_WARNING "Cannot target interrupts: (0x%lx)\n", + (unsigned long)owner_dev); + + return(CPU_NONE); /* Should never get here */ +} + +struct hardwired_intr_s { + signed char level; + int flags; + char *name; +} const hardwired_intr[] = { + { INT_PEND0_BASELVL + RESERVED_INTR, 0, "Reserved" }, + { INT_PEND0_BASELVL + GFX_INTR_A, 0, "Gfx A" }, + { INT_PEND0_BASELVL + GFX_INTR_B, 0, "Gfx B" }, + { INT_PEND0_BASELVL + PG_MIG_INTR, II_THREADED, "Migration" }, + { INT_PEND0_BASELVL + UART_INTR, II_THREADED, "Bedrock/L1" }, + { INT_PEND0_BASELVL + CC_PEND_A, 0, "Crosscall A" }, + { INT_PEND0_BASELVL + CC_PEND_B, 0, "Crosscall B" }, + { INT_PEND1_BASELVL + CLK_ERR_INTR, II_ERRORINT, "Clock Error" }, + { INT_PEND1_BASELVL + COR_ERR_INTR_A, II_ERRORINT, "Correctable Error A" }, + { INT_PEND1_BASELVL + COR_ERR_INTR_B, II_ERRORINT, "Correctable Error B" }, + { INT_PEND1_BASELVL + MD_COR_ERR_INTR, II_ERRORINT, "MD Correct. Error" }, + { INT_PEND1_BASELVL + NI_ERROR_INTR, II_ERRORINT, "NI Error" }, + { INT_PEND1_BASELVL + NI_BRDCAST_ERR_A, II_ERRORINT, "Remote NI Error"}, + { INT_PEND1_BASELVL + NI_BRDCAST_ERR_B, II_ERRORINT, "Remote NI Error"}, + { INT_PEND1_BASELVL + MSC_PANIC_INTR, II_ERRORINT, "MSC Panic" }, + { INT_PEND1_BASELVL + LLP_PFAIL_INTR_A, II_ERRORINT, "LLP Pfail WAR" }, + { INT_PEND1_BASELVL + LLP_PFAIL_INTR_B, II_ERRORINT, "LLP Pfail WAR" }, + { INT_PEND1_BASELVL + NACK_INT_A, 0, "CPU A Nack count == NACK_CMP" }, + { INT_PEND1_BASELVL + NACK_INT_B, 0, "CPU B Nack count == NACK_CMP" }, + { INT_PEND1_BASELVL + LB_ERROR, 0, "Local Block Error" }, + { INT_PEND1_BASELVL + XB_ERROR, 0, "Local XBar Error" }, + { -1, 0, (char *)NULL}, +}; + +/* + * Reserve all of the hardwired interrupt levels so they're not used as + * general purpose bits later. + */ +void +intr_reserve_hardwired(cnodeid_t cnode) +{ + cpuid_t cpu; + int level; + int i; + char subnode_done[NUM_SUBNODES]; + + // cpu = cnodetocpu(cnode); + for (cpu = 0; cpu < smp_num_cpus; cpu++) { + if (cpuid_to_cnodeid(cpu) == cnode) { + break; + } + } + if (cpu == smp_num_cpus) cpu = CPU_NONE; + if (cpu == CPU_NONE) { + printk("Node %d has no CPUs", cnode); + return; + } + + for (i=0; iii_name, + vector->iv_func, vector->iv_arg, vector->iv_prefunc); + pf(" vertex 0x%x %s%s", + info->ii_owner_dev, + ((info->ii_flags) & II_RESERVE) ? "R" : "U", + ((info->ii_flags) & II_INUSE) ? "C" : "-"); + pf("%s%s%s%s", + ip & value ? "P" : "-", + ima & value ? "A" : "-", + imb & value ? "B" : "-", + ((info->ii_flags) & II_ERRORINT) ? "E" : "-"); + pf("\n"); +} + + +/* + * Dump information about interrupt vector assignment. + */ +void +intr_dumpvec(cnodeid_t cnode, void (*pf)(char *, ...)) +{ + nodepda_t *npda; + int ip, sn, bit; + intr_vecblk_t *dispatch; + hubreg_t ipr, ima, imb; + nasid_t nasid; + + if ((cnode < 0) || (cnode >= numnodes)) { + pf("intr_dumpvec: cnodeid out of range: %d\n", cnode); + return ; + } + + nasid = COMPACT_TO_NASID_NODEID(cnode); + + if (nasid == INVALID_NASID) { + pf("intr_dumpvec: Bad cnodeid: %d\n", cnode); + return ; + } + + + npda = NODEPDA(cnode); + + for (sn = 0; sn < NUM_SUBNODES; sn++) { + for (ip = 0; ip < 2; ip++) { + dispatch = ip ? &(SNPDA(npda,sn)->intr_dispatch1) : &(SNPDA(npda,sn)->intr_dispatch0); + ipr = REMOTE_HUB_PI_L(nasid, sn, ip ? PI_INT_PEND1 : PI_INT_PEND0); + ima = REMOTE_HUB_PI_L(nasid, sn, ip ? PI_INT_MASK1_A : PI_INT_MASK0_A); + imb = REMOTE_HUB_PI_L(nasid, sn, ip ? PI_INT_MASK1_B : PI_INT_MASK0_B); + + pf("Node %d INT_PEND%d:\n", cnode, ip); + + if (dispatch->ithreads_enabled) + pf(" Ithreads enabled\n"); + else + pf(" Ithreads disabled\n"); + pf(" vector_count = %d, vector_state = %d\n", + dispatch->vector_count, + dispatch->vector_state); + pf(" CPU A count %d, CPU B count %d\n", + dispatch->cpu_count[0], + dispatch->cpu_count[1]); + pf(" &vector_lock = 0x%x\n", + &(dispatch->vector_lock)); + for (bit = 0; bit < N_INTPEND_BITS; bit++) { + if ((dispatch->info[bit].ii_flags & II_RESERVE) || + (ipr & (1L << bit))) { + dump_vector(&(dispatch->info[bit]), + &(dispatch->vectors[bit]), + bit, ipr, ima, imb, pf); + } + } + pf("\n"); + } + } +} + diff -urN linux-2.4.18/arch/ia64/sn/io/sn1/pcibr.c lia64-2.4/arch/ia64/sn/io/sn1/pcibr.c --- linux-2.4.18/arch/ia64/sn/io/sn1/pcibr.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn1/pcibr.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,7950 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +int NeedXbridgeSwap = 0; + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __ia64 +#define rmallocmap atemapalloc +#define rmfreemap atemapfree +#define rmfree atefree +#define rmalloc atealloc +#endif + +extern boolean_t is_sys_critical_vertex(devfs_handle_t); + +#undef PCIBR_ATE_DEBUG + +#if 0 +#define DEBUG 1 /* To avoid lots of bad printk() formats leave off */ +#endif +#define PCI_DEBUG 1 +#define ATTACH_DEBUG 1 +#define PCIBR_SOFT_LIST 1 + +#ifndef LOCAL +#define LOCAL static +#endif + +/* + * Macros related to the Lucent USS 302/312 usb timeout workaround. It + * appears that if the lucent part can get into a retry loop if it sees a + * DAC on the bus during a pio read retry. The loop is broken after about + * 1ms, so we need to set up bridges holding this part to allow at least + * 1ms for pio. + */ + +#define USS302_TIMEOUT_WAR + +#ifdef USS302_TIMEOUT_WAR +#define LUCENT_USBHC_VENDOR_ID_NUM 0x11c1 +#define LUCENT_USBHC302_DEVICE_ID_NUM 0x5801 +#define LUCENT_USBHC312_DEVICE_ID_NUM 0x5802 +#define USS302_BRIDGE_TIMEOUT_HLD 4 +#endif + +#define PCIBR_LLP_CONTROL_WAR +#if defined (PCIBR_LLP_CONTROL_WAR) +int pcibr_llp_control_war_cnt; +#endif /* PCIBR_LLP_CONTROL_WAR */ + +int pcibr_devflag = D_MP; + +#ifdef LATER +#define F(s,n) { 1l<<(s),-(s), n } + +struct reg_desc bridge_int_status_desc[] = +{ + F(31, "MULTI_ERR"), + F(30, "PMU_ESIZE_EFAULT"), + F(29, "UNEXPECTED_RESP"), + F(28, "BAD_XRESP_PACKET"), + F(27, "BAD_XREQ_PACKET"), + F(26, "RESP_XTALK_ERROR"), + F(25, "REQ_XTALK_ERROR"), + F(24, "INVALID_ADDRESS"), + F(23, "UNSUPPORTED_XOP"), + F(22, "XREQ_FIFO_OFLOW"), + F(21, "LLP_REC_SNERROR"), + F(20, "LLP_REC_CBERROR"), + F(19, "LLP_RCTY"), + F(18, "LLP_TX_RETRY"), + F(17, "LLP_TCTY"), + F(16, "SSRAM_PERR"), + F(15, "PCI_ABORT"), + F(14, "PCI_PARITY"), + F(13, "PCI_SERR"), + F(12, "PCI_PERR"), + F(11, "PCI_MASTER_TOUT"), + F(10, "PCI_RETRY_CNT"), + F(9, "XREAD_REQ_TOUT"), + F(8, "GIO_BENABLE_ERR"), + F(7, "INT7"), + F(6, "INT6"), + F(5, "INT5"), + F(4, "INT4"), + F(3, "INT3"), + F(2, "INT2"), + F(1, "INT1"), + F(0, "INT0"), + {0} +}; + +struct reg_values space_v[] = +{ + {PCIIO_SPACE_NONE, "none"}, + {PCIIO_SPACE_ROM, "ROM"}, + {PCIIO_SPACE_IO, "I/O"}, + {PCIIO_SPACE_MEM, "MEM"}, + {PCIIO_SPACE_MEM32, "MEM(32)"}, + {PCIIO_SPACE_MEM64, "MEM(64)"}, + {PCIIO_SPACE_CFG, "CFG"}, + {PCIIO_SPACE_WIN(0), "WIN(0)"}, + {PCIIO_SPACE_WIN(1), "WIN(1)"}, + {PCIIO_SPACE_WIN(2), "WIN(2)"}, + {PCIIO_SPACE_WIN(3), "WIN(3)"}, + {PCIIO_SPACE_WIN(4), "WIN(4)"}, + {PCIIO_SPACE_WIN(5), "WIN(5)"}, + {PCIIO_SPACE_BAD, "BAD"}, + {0} +}; + +struct reg_desc space_desc[] = +{ + {0xFF, 0, "space", 0, space_v}, + {0} +}; + +#if DEBUG +#define device_desc device_bits +LOCAL struct reg_desc device_bits[] = +{ + {BRIDGE_DEV_ERR_LOCK_EN, 0, "ERR_LOCK_EN"}, + {BRIDGE_DEV_PAGE_CHK_DIS, 0, "PAGE_CHK_DIS"}, + {BRIDGE_DEV_FORCE_PCI_PAR, 0, "FORCE_PCI_PAR"}, + {BRIDGE_DEV_VIRTUAL_EN, 0, "VIRTUAL_EN"}, + {BRIDGE_DEV_PMU_WRGA_EN, 0, "PMU_WRGA_EN"}, + {BRIDGE_DEV_DIR_WRGA_EN, 0, "DIR_WRGA_EN"}, + {BRIDGE_DEV_DEV_SIZE, 0, "DEV_SIZE"}, + {BRIDGE_DEV_RT, 0, "RT"}, + {BRIDGE_DEV_SWAP_PMU, 0, "SWAP_PMU"}, + {BRIDGE_DEV_SWAP_DIR, 0, "SWAP_DIR"}, + {BRIDGE_DEV_PREF, 0, "PREF"}, + {BRIDGE_DEV_PRECISE, 0, "PRECISE"}, + {BRIDGE_DEV_COH, 0, "COH"}, + {BRIDGE_DEV_BARRIER, 0, "BARRIER"}, + {BRIDGE_DEV_GBR, 0, "GBR"}, + {BRIDGE_DEV_DEV_SWAP, 0, "DEV_SWAP"}, + {BRIDGE_DEV_DEV_IO_MEM, 0, "DEV_IO_MEM"}, + {BRIDGE_DEV_OFF_MASK, BRIDGE_DEV_OFF_ADDR_SHFT, "DEV_OFF", "%x"}, + {0} +}; +#endif /* DEBUG */ + +#ifdef SUPPORT_PRINTING_R_FORMAT +LOCAL struct reg_values xio_cmd_pactyp[] = +{ + {0x0, "RdReq"}, + {0x1, "RdResp"}, + {0x2, "WrReqWithResp"}, + {0x3, "WrResp"}, + {0x4, "WrReqNoResp"}, + {0x5, "Reserved(5)"}, + {0x6, "FetchAndOp"}, + {0x7, "Reserved(7)"}, + {0x8, "StoreAndOp"}, + {0x9, "Reserved(9)"}, + {0xa, "Reserved(a)"}, + {0xb, "Reserved(b)"}, + {0xc, "Reserved(c)"}, + {0xd, "Reserved(d)"}, + {0xe, "SpecialReq"}, + {0xf, "SpecialResp"}, + {0} +}; + +LOCAL struct reg_desc xio_cmd_bits[] = +{ + {WIDGET_DIDN, -28, "DIDN", "%x"}, + {WIDGET_SIDN, -24, "SIDN", "%x"}, + {WIDGET_PACTYP, -20, "PACTYP", 0, xio_cmd_pactyp}, + {WIDGET_TNUM, -15, "TNUM", "%x"}, + {WIDGET_COHERENT, 0, "COHERENT"}, + {WIDGET_DS, 0, "DS"}, + {WIDGET_GBR, 0, "GBR"}, + {WIDGET_VBPM, 0, "VBPM"}, + {WIDGET_ERROR, 0, "ERROR"}, + {WIDGET_BARRIER, 0, "BARRIER"}, + {0} +}; +#endif /* SUPPORT_PRINTING_R_FORMAT */ + +#if PCIBR_FREEZE_TIME || PCIBR_ATE_DEBUG +LOCAL struct reg_desc ate_bits[] = +{ + {0xFFFF000000000000ull, -48, "RMF", "%x"}, + {~(IOPGSIZE - 1) & /* may trim off some low bits */ + 0x0000FFFFFFFFF000ull, 0, "XIO", "%x"}, + {0x0000000000000F00ull, -8, "port", "%x"}, + {0x0000000000000010ull, 0, "Barrier"}, + {0x0000000000000008ull, 0, "Prefetch"}, + {0x0000000000000004ull, 0, "Precise"}, + {0x0000000000000002ull, 0, "Coherent"}, + {0x0000000000000001ull, 0, "Valid"}, + {0} +}; +#endif + +#if PCIBR_ATE_DEBUG +LOCAL struct reg_values ssram_sizes[] = +{ + {BRIDGE_CTRL_SSRAM_512K, "512k"}, + {BRIDGE_CTRL_SSRAM_128K, "128k"}, + {BRIDGE_CTRL_SSRAM_64K, "64k"}, + {BRIDGE_CTRL_SSRAM_1K, "1k"}, + {0} +}; + +LOCAL struct reg_desc control_bits[] = +{ + {BRIDGE_CTRL_FLASH_WR_EN, 0, "FLASH_WR_EN"}, + {BRIDGE_CTRL_EN_CLK50, 0, "EN_CLK50"}, + {BRIDGE_CTRL_EN_CLK40, 0, "EN_CLK40"}, + {BRIDGE_CTRL_EN_CLK33, 0, "EN_CLK33"}, + {BRIDGE_CTRL_RST_MASK, -24, "RST", "%x"}, + {BRIDGE_CTRL_IO_SWAP, 0, "IO_SWAP"}, + {BRIDGE_CTRL_MEM_SWAP, 0, "MEM_SWAP"}, + {BRIDGE_CTRL_PAGE_SIZE, 0, "PAGE_SIZE"}, + {BRIDGE_CTRL_SS_PAR_BAD, 0, "SS_PAR_BAD"}, + {BRIDGE_CTRL_SS_PAR_EN, 0, "SS_PAR_EN"}, + {BRIDGE_CTRL_SSRAM_SIZE_MASK, 0, "SSRAM_SIZE", 0, ssram_sizes}, + {BRIDGE_CTRL_F_BAD_PKT, 0, "F_BAD_PKT"}, + {BRIDGE_CTRL_LLP_XBAR_CRD_MASK, -12, "LLP_XBAR_CRD", "%d"}, + {BRIDGE_CTRL_CLR_RLLP_CNT, 0, "CLR_RLLP_CNT"}, + {BRIDGE_CTRL_CLR_TLLP_CNT, 0, "CLR_TLLP_CNT"}, + {BRIDGE_CTRL_SYS_END, 0, "SYS_END"}, + {BRIDGE_CTRL_MAX_TRANS_MASK, -4, "MAX_TRANS", "%d"}, + {BRIDGE_CTRL_WIDGET_ID_MASK, 0, "WIDGET_ID", "%x"}, + {0} +}; +#endif +#endif /* LATER */ + +/* kbrick widgetnum-to-bus layout */ +int p_busnum[MAX_PORT_NUM] = { /* widget# */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x0 - 0x7 */ + 2, /* 0x8 */ + 1, /* 0x9 */ + 0, 0, /* 0xa - 0xb */ + 5, /* 0xc */ + 6, /* 0xd */ + 4, /* 0xe */ + 3, /* 0xf */ +}; + +/* + * Additional PIO spaces per slot are + * recorded in this structure. + */ +struct pciio_piospace_s { + pciio_piospace_t next; /* another space for this device */ + char free; /* 1 if free, 0 if in use */ + pciio_space_t space; /* Which space is in use */ + iopaddr_t start; /* Starting address of the PIO space */ + size_t count; /* size of PIO space */ +}; + +#if PCIBR_SOFT_LIST +pcibr_list_p pcibr_list = 0; +#endif + +#define INFO_LBL_PCIBR_ASIC_REV "_pcibr_asic_rev" + +#define PCIBR_D64_BASE_UNSET (0xFFFFFFFFFFFFFFFF) +#define PCIBR_D32_BASE_UNSET (0xFFFFFFFF) + +#define PCIBR_VALID_SLOT(s) (s < 8) + +#ifdef SN_XXX +extern int hub_device_flags_set(devfs_handle_t widget_dev, + hub_widget_flags_t flags); +#endif +extern pciio_dmamap_t get_free_pciio_dmamap(devfs_handle_t); +extern void free_pciio_dmamap(pcibr_dmamap_t); + +/* + * This is the file operation table for the pcibr driver. + * As each of the functions are implemented, put the + * appropriate function name below. + */ +struct file_operations pcibr_fops = { + owner: THIS_MODULE, + llseek: NULL, + read: NULL, + write: NULL, + readdir: NULL, + poll: NULL, + ioctl: NULL, + mmap: NULL, + open: NULL, + flush: NULL, + release: NULL, + fsync: NULL, + fasync: NULL, + lock: NULL, + readv: NULL, + writev: NULL +}; + +extern devfs_handle_t hwgraph_root; +extern graph_error_t hwgraph_vertex_unref(devfs_handle_t vhdl); +extern int cap_able(uint64_t x); +extern uint64_t rmalloc(struct map *mp, size_t size); +extern void rmfree(struct map *mp, size_t size, uint64_t a); +extern int hwgraph_vertex_name_get(devfs_handle_t vhdl, char *buf, uint buflen); +extern long atoi(register char *p); +extern void *swap_ptr(void **loc, void *new); +extern char *dev_to_name(devfs_handle_t dev, char *buf, uint buflen); +extern cnodeid_t nodevertex_to_cnodeid(devfs_handle_t vhdl); +extern graph_error_t hwgraph_edge_remove(devfs_handle_t from, char *name, devfs_handle_t *toptr); +extern struct map *rmallocmap(uint64_t mapsiz); +extern void rmfreemap(struct map *mp); +extern int compare_and_swap_ptr(void **location, void *old_ptr, void *new_ptr); +extern int io_path_map_widget(devfs_handle_t vertex); + + + +/* ===================================================================== + * Function Table of Contents + * + * The order of functions in this file has stopped + * making much sense. We might want to take a look + * at it some time and bring back some sanity, or + * perhaps bust this file into smaller chunks. + */ + +LOCAL void do_pcibr_rrb_clear(bridge_t *, int); +LOCAL void do_pcibr_rrb_flush(bridge_t *, int); +LOCAL int do_pcibr_rrb_count_valid(bridge_t *, pciio_slot_t); +LOCAL int do_pcibr_rrb_count_avail(bridge_t *, pciio_slot_t); +LOCAL int do_pcibr_rrb_alloc(bridge_t *, pciio_slot_t, int); +LOCAL int do_pcibr_rrb_free(bridge_t *, pciio_slot_t, int); + +LOCAL void do_pcibr_rrb_autoalloc(pcibr_soft_t, int, int); + +int pcibr_wrb_flush(devfs_handle_t); +int pcibr_rrb_alloc(devfs_handle_t, int *, int *); +int pcibr_rrb_check(devfs_handle_t, int *, int *, int *, int *); +int pcibr_alloc_all_rrbs(devfs_handle_t, int, int, int, int, int, int, int, int, int); +void pcibr_rrb_flush(devfs_handle_t); + +LOCAL int pcibr_try_set_device(pcibr_soft_t, pciio_slot_t, unsigned, bridgereg_t); +void pcibr_release_device(pcibr_soft_t, pciio_slot_t, bridgereg_t); + +LOCAL void pcibr_clearwidint(bridge_t *); +LOCAL void pcibr_setwidint(xtalk_intr_t); +LOCAL int pcibr_probe_slot(bridge_t *, cfg_p, unsigned *); + +void pcibr_init(void); +int pcibr_attach(devfs_handle_t); +int pcibr_detach(devfs_handle_t); +int pcibr_open(devfs_handle_t *, int, int, cred_t *); +int pcibr_close(devfs_handle_t, int, int, cred_t *); +int pcibr_map(devfs_handle_t, vhandl_t *, off_t, size_t, uint); +int pcibr_unmap(devfs_handle_t, vhandl_t *); +int pcibr_ioctl(devfs_handle_t, int, void *, int, struct cred *, int *); + +void pcibr_freeblock_sub(iopaddr_t *, iopaddr_t *, iopaddr_t, size_t); + +LOCAL int pcibr_init_ext_ate_ram(bridge_t *); +LOCAL int pcibr_ate_alloc(pcibr_soft_t, int); +LOCAL void pcibr_ate_free(pcibr_soft_t, int, int); + +LOCAL pcibr_info_t pcibr_info_get(devfs_handle_t); +LOCAL pcibr_info_t pcibr_device_info_new(pcibr_soft_t, pciio_slot_t, pciio_function_t, pciio_vendor_id_t, pciio_device_id_t); +LOCAL void pcibr_device_info_free(devfs_handle_t, pciio_slot_t); +LOCAL iopaddr_t pcibr_addr_pci_to_xio(devfs_handle_t, pciio_slot_t, pciio_space_t, iopaddr_t, size_t, unsigned); + +pcibr_piomap_t pcibr_piomap_alloc(devfs_handle_t, device_desc_t, pciio_space_t, iopaddr_t, size_t, size_t, unsigned); +void pcibr_piomap_free(pcibr_piomap_t); +caddr_t pcibr_piomap_addr(pcibr_piomap_t, iopaddr_t, size_t); +void pcibr_piomap_done(pcibr_piomap_t); +caddr_t pcibr_piotrans_addr(devfs_handle_t, device_desc_t, pciio_space_t, iopaddr_t, size_t, unsigned); +iopaddr_t pcibr_piospace_alloc(devfs_handle_t, device_desc_t, pciio_space_t, size_t, size_t); +void pcibr_piospace_free(devfs_handle_t, pciio_space_t, iopaddr_t, size_t); + +LOCAL iopaddr_t pcibr_flags_to_d64(unsigned, pcibr_soft_t); +LOCAL bridge_ate_t pcibr_flags_to_ate(unsigned); + +pcibr_dmamap_t pcibr_dmamap_alloc(devfs_handle_t, device_desc_t, size_t, unsigned); +void pcibr_dmamap_free(pcibr_dmamap_t); +LOCAL bridge_ate_p pcibr_ate_addr(pcibr_soft_t, int); +LOCAL iopaddr_t pcibr_addr_xio_to_pci(pcibr_soft_t, iopaddr_t, size_t); +iopaddr_t pcibr_dmamap_addr(pcibr_dmamap_t, paddr_t, size_t); +alenlist_t pcibr_dmamap_list(pcibr_dmamap_t, alenlist_t, unsigned); +void pcibr_dmamap_done(pcibr_dmamap_t); +cnodeid_t pcibr_get_dmatrans_node(devfs_handle_t); +iopaddr_t pcibr_dmatrans_addr(devfs_handle_t, device_desc_t, paddr_t, size_t, unsigned); +alenlist_t pcibr_dmatrans_list(devfs_handle_t, device_desc_t, alenlist_t, unsigned); +void pcibr_dmamap_drain(pcibr_dmamap_t); +void pcibr_dmaaddr_drain(devfs_handle_t, paddr_t, size_t); +void pcibr_dmalist_drain(devfs_handle_t, alenlist_t); +iopaddr_t pcibr_dmamap_pciaddr_get(pcibr_dmamap_t); + +static unsigned pcibr_intr_bits(pciio_info_t info, pciio_intr_line_t lines); +pcibr_intr_t pcibr_intr_alloc(devfs_handle_t, device_desc_t, pciio_intr_line_t, devfs_handle_t); +void pcibr_intr_free(pcibr_intr_t); +LOCAL void pcibr_setpciint(xtalk_intr_t); +int pcibr_intr_connect(pcibr_intr_t); +void pcibr_intr_disconnect(pcibr_intr_t); + +devfs_handle_t pcibr_intr_cpu_get(pcibr_intr_t); +void pcibr_xintr_preset(void *, int, xwidgetnum_t, iopaddr_t, xtalk_intr_vector_t); +void pcibr_intr_func(intr_arg_t); + +void pcibr_provider_startup(devfs_handle_t); +void pcibr_provider_shutdown(devfs_handle_t); + +int pcibr_reset(devfs_handle_t); +pciio_endian_t pcibr_endian_set(devfs_handle_t, pciio_endian_t, pciio_endian_t); +int pcibr_priority_bits_set(pcibr_soft_t, pciio_slot_t, pciio_priority_t); +pciio_priority_t pcibr_priority_set(devfs_handle_t, pciio_priority_t); +int pcibr_device_flags_set(devfs_handle_t, pcibr_device_flags_t); + +LOCAL cfg_p pcibr_config_addr(devfs_handle_t, unsigned); +uint64_t pcibr_config_get(devfs_handle_t, unsigned, unsigned); +LOCAL uint64_t do_pcibr_config_get(cfg_p, unsigned, unsigned); +void pcibr_config_set(devfs_handle_t, unsigned, unsigned, uint64_t); +LOCAL void do_pcibr_config_set(cfg_p, unsigned, unsigned, uint64_t); + +LOCAL pcibr_hints_t pcibr_hints_get(devfs_handle_t, int); +void pcibr_hints_fix_rrbs(devfs_handle_t); +void pcibr_hints_dualslot(devfs_handle_t, pciio_slot_t, pciio_slot_t); +void pcibr_hints_intr_bits(devfs_handle_t, pcibr_intr_bits_f *); +void pcibr_set_rrb_callback(devfs_handle_t, rrb_alloc_funct_t); +void pcibr_hints_handsoff(devfs_handle_t); +void pcibr_hints_subdevs(devfs_handle_t, pciio_slot_t, ulong); + +LOCAL int pcibr_slot_info_init(devfs_handle_t,pciio_slot_t); +LOCAL int pcibr_slot_info_free(devfs_handle_t,pciio_slot_t); + +#ifdef LATER +LOCAL int pcibr_slot_info_return(pcibr_soft_t, pciio_slot_t, + pcibr_slot_info_resp_t); +LOCAL void pcibr_slot_func_info_return(pcibr_info_h, int, + pcibr_slot_func_info_resp_t); +#endif /* LATER */ + +LOCAL int pcibr_slot_addr_space_init(devfs_handle_t,pciio_slot_t); +LOCAL int pcibr_slot_device_init(devfs_handle_t, pciio_slot_t); +LOCAL int pcibr_slot_guest_info_init(devfs_handle_t,pciio_slot_t); +LOCAL int pcibr_slot_initial_rrb_alloc(devfs_handle_t,pciio_slot_t); +LOCAL int pcibr_slot_call_device_attach(devfs_handle_t, + pciio_slot_t, int); +LOCAL int pcibr_slot_call_device_detach(devfs_handle_t, + pciio_slot_t, int); + +LOCAL int pcibr_slot_detach(devfs_handle_t, pciio_slot_t, int); +LOCAL int pcibr_is_slot_sys_critical(devfs_handle_t, pciio_slot_t); +#ifdef LATER +LOCAL int pcibr_slot_query(devfs_handle_t, pcibr_slot_info_req_t); +#endif + +/* ===================================================================== + * RRB management + */ + +#define LSBIT(word) ((word) &~ ((word)-1)) + +#define PCIBR_RRB_SLOT_VIRTUAL 8 + +LOCAL void +do_pcibr_rrb_clear(bridge_t *bridge, int rrb) +{ + bridgereg_t status; + + /* bridge_lock must be held; + * this RRB must be disabled. + */ + + /* wait until RRB has no outstanduing XIO packets. */ + while ((status = bridge->b_resp_status) & BRIDGE_RRB_INUSE(rrb)) { + ; /* XXX- beats on bridge. bad idea? */ + } + + /* if the RRB has data, drain it. */ + if (status & BRIDGE_RRB_VALID(rrb)) { + bridge->b_resp_clear = BRIDGE_RRB_CLEAR(rrb); + + /* wait until RRB is no longer valid. */ + while ((status = bridge->b_resp_status) & BRIDGE_RRB_VALID(rrb)) { + ; /* XXX- beats on bridge. bad idea? */ + } + } +} + +LOCAL void +do_pcibr_rrb_flush(bridge_t *bridge, int rrbn) +{ + reg_p rrbp = &bridge->b_rrb_map[rrbn & 1].reg; + bridgereg_t rrbv; + int shft = 4 * (rrbn >> 1); + unsigned ebit = BRIDGE_RRB_EN << shft; + + rrbv = *rrbp; + if (rrbv & ebit) + *rrbp = rrbv & ~ebit; + + do_pcibr_rrb_clear(bridge, rrbn); + + if (rrbv & ebit) + *rrbp = rrbv; +} + +/* + * pcibr_rrb_count_valid: count how many RRBs are + * marked valid for the specified PCI slot on this + * bridge. + * + * NOTE: The "slot" parameter for all pcibr_rrb + * management routines must include the "virtual" + * bit; when manageing both the normal and the + * virtual channel, separate calls to these + * routines must be made. To denote the virtual + * channel, add PCIBR_RRB_SLOT_VIRTUAL to the slot + * number. + * + * IMPL NOTE: The obvious algorithm is to iterate + * through the RRB fields, incrementing a count if + * the RRB is valid and matches the slot. However, + * it is much simpler to use an algorithm derived + * from the "partitioned add" idea. First, XOR in a + * pattern such that the fields that match this + * slot come up "all ones" and all other fields + * have zeros in the mismatching bits. Then AND + * together the bits in the field, so we end up + * with one bit turned on for each field that + * matched. Now we need to count these bits. This + * can be done either with a series of shift/add + * instructions or by using "tmp % 15"; I expect + * that the cascaded shift/add will be faster. + */ + +LOCAL int +do_pcibr_rrb_count_valid(bridge_t *bridge, + pciio_slot_t slot) +{ + bridgereg_t tmp; + + tmp = bridge->b_rrb_map[slot & 1].reg; + tmp ^= 0x11111111 * (7 - slot / 2); + tmp &= (0xCCCCCCCC & tmp) >> 2; + tmp &= (0x22222222 & tmp) >> 1; + tmp += tmp >> 4; + tmp += tmp >> 8; + tmp += tmp >> 16; + return tmp & 15; +} + +/* + * do_pcibr_rrb_count_avail: count how many RRBs are + * available to be allocated for the specified slot. + * + * IMPL NOTE: similar to the above, except we are + * just counting how many fields have the valid bit + * turned off. + */ +LOCAL int +do_pcibr_rrb_count_avail(bridge_t *bridge, + pciio_slot_t slot) +{ + bridgereg_t tmp; + + tmp = bridge->b_rrb_map[slot & 1].reg; + tmp = (0x88888888 & ~tmp) >> 3; + tmp += tmp >> 4; + tmp += tmp >> 8; + tmp += tmp >> 16; + return tmp & 15; +} + +/* + * do_pcibr_rrb_alloc: allocate some additional RRBs + * for the specified slot. Returns -1 if there were + * insufficient free RRBs to satisfy the request, + * or 0 if the request was fulfilled. + * + * Note that if a request can be partially filled, + * it will be, even if we return failure. + * + * IMPL NOTE: again we avoid iterating across all + * the RRBs; instead, we form up a word containing + * one bit for each free RRB, then peel the bits + * off from the low end. + */ +LOCAL int +do_pcibr_rrb_alloc(bridge_t *bridge, + pciio_slot_t slot, + int more) +{ + int rv = 0; + bridgereg_t reg, tmp, bit; + + reg = bridge->b_rrb_map[slot & 1].reg; + tmp = (0x88888888 & ~reg) >> 3; + while (more-- > 0) { + bit = LSBIT(tmp); + if (!bit) { + rv = -1; + break; + } + tmp &= ~bit; + reg = ((reg & ~(bit * 15)) | (bit * (8 + slot / 2))); + } + bridge->b_rrb_map[slot & 1].reg = reg; + return rv; +} + +/* + * do_pcibr_rrb_free: release some of the RRBs that + * have been allocated for the specified + * slot. Returns zero for success, or negative if + * it was unable to free that many RRBs. + * + * IMPL NOTE: We form up a bit for each RRB + * allocated to the slot, aligned with the VALID + * bitfield this time; then we peel bits off one at + * a time, releasing the corresponding RRB. + */ +LOCAL int +do_pcibr_rrb_free(bridge_t *bridge, + pciio_slot_t slot, + int less) +{ + int rv = 0; + bridgereg_t reg, tmp, clr, bit; + int i; + + clr = 0; + reg = bridge->b_rrb_map[slot & 1].reg; + + /* This needs to be done otherwise the rrb's on the virtual channel + * for this slot won't be freed !! + */ + tmp = reg & 0xbbbbbbbb; + + tmp ^= (0x11111111 * (7 - slot / 2)); + tmp &= (0x33333333 & tmp) << 2; + tmp &= (0x44444444 & tmp) << 1; + while (less-- > 0) { + bit = LSBIT(tmp); + if (!bit) { + rv = -1; + break; + } + tmp &= ~bit; + reg &= ~bit; + clr |= bit; + } + bridge->b_rrb_map[slot & 1].reg = reg; + + for (i = 0; i < 8; i++) + if (clr & (8 << (4 * i))) + do_pcibr_rrb_clear(bridge, (2 * i) + (slot & 1)); + + return rv; +} + +LOCAL void +do_pcibr_rrb_autoalloc(pcibr_soft_t pcibr_soft, + int slot, + int more_rrbs) +{ + bridge_t *bridge = pcibr_soft->bs_base; + int got; + + for (got = 0; got < more_rrbs; ++got) { + if (pcibr_soft->bs_rrb_res[slot & 7] > 0) + pcibr_soft->bs_rrb_res[slot & 7]--; + else if (pcibr_soft->bs_rrb_avail[slot & 1] > 0) + pcibr_soft->bs_rrb_avail[slot & 1]--; + else + break; + if (do_pcibr_rrb_alloc(bridge, slot, 1) < 0) + break; +#if PCIBR_RRB_DEBUG + printk( "do_pcibr_rrb_autoalloc: add one to slot %d%s\n", + slot & 7, slot & 8 ? "v" : ""); +#endif + pcibr_soft->bs_rrb_valid[slot]++; + } +#if PCIBR_RRB_DEBUG + printk("%s: %d+%d free RRBs. Allocation list:\n", pcibr_soft->bs_name, + pcibr_soft->bs_rrb_avail[0], + pcibr_soft->bs_rrb_avail[1]); + for (slot = 0; slot < 8; ++slot) + printk("\t%d+%d+%d", + 0xFFF & pcibr_soft->bs_rrb_valid[slot], + 0xFFF & pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL], + pcibr_soft->bs_rrb_res[slot]); + printk("\n"); +#endif +} + +/* + * Device driver interface to flush the write buffers for a specified + * device hanging off the bridge. + */ +int +pcibr_wrb_flush(devfs_handle_t pconn_vhdl) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + bridge_t *bridge = pcibr_soft->bs_base; + volatile bridgereg_t *wrb_flush; + + wrb_flush = &(bridge->b_wr_req_buf[pciio_slot].reg); + while (*wrb_flush); + + return(0); +} +/* + * Device driver interface to request RRBs for a specified device + * hanging off a Bridge. The driver requests the total number of + * RRBs it would like for the normal channel (vchan0) and for the + * "virtual channel" (vchan1). The actual number allocated to each + * channel is returned. + * + * If we cannot allocate at least one RRB to a channel that needs + * at least one, return -1 (failure). Otherwise, satisfy the request + * as best we can and return 0. + */ +int +pcibr_rrb_alloc(devfs_handle_t pconn_vhdl, + int *count_vchan0, + int *count_vchan1) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + bridge_t *bridge = pcibr_soft->bs_base; + int desired_vchan0; + int desired_vchan1; + int orig_vchan0; + int orig_vchan1; + int delta_vchan0; + int delta_vchan1; + int final_vchan0; + int final_vchan1; + int avail_rrbs; + unsigned long s; + int error; + + /* + * TBD: temper request with admin info about RRB allocation, + * and according to demand from other devices on this Bridge. + * + * One way of doing this would be to allocate two RRBs + * for each device on the bus, before any drivers start + * asking for extras. This has the weakness that one + * driver might not give back an "extra" RRB until after + * another driver has already failed to get one that + * it wanted. + */ + + s = pcibr_lock(pcibr_soft); + + /* How many RRBs do we own? */ + orig_vchan0 = pcibr_soft->bs_rrb_valid[pciio_slot]; + orig_vchan1 = pcibr_soft->bs_rrb_valid[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL]; + + /* How many RRBs do we want? */ + desired_vchan0 = count_vchan0 ? *count_vchan0 : orig_vchan0; + desired_vchan1 = count_vchan1 ? *count_vchan1 : orig_vchan1; + + /* How many RRBs are free? */ + avail_rrbs = pcibr_soft->bs_rrb_avail[pciio_slot & 1] + + pcibr_soft->bs_rrb_res[pciio_slot]; + + /* Figure desired deltas */ + delta_vchan0 = desired_vchan0 - orig_vchan0; + delta_vchan1 = desired_vchan1 - orig_vchan1; + + /* Trim back deltas to something + * that we can actually meet, by + * decreasing the ending allocation + * for whichever channel wants + * more RRBs. If both want the same + * number, cut the second channel. + * NOTE: do not change the allocation for + * a channel that was passed as NULL. + */ + while ((delta_vchan0 + delta_vchan1) > avail_rrbs) { + if (count_vchan0 && + (!count_vchan1 || + ((orig_vchan0 + delta_vchan0) > + (orig_vchan1 + delta_vchan1)))) + delta_vchan0--; + else + delta_vchan1--; + } + + /* Figure final RRB allocations + */ + final_vchan0 = orig_vchan0 + delta_vchan0; + final_vchan1 = orig_vchan1 + delta_vchan1; + + /* If either channel wants RRBs but our actions + * would leave it with none, declare an error, + * but DO NOT change any RRB allocations. + */ + if ((desired_vchan0 && !final_vchan0) || + (desired_vchan1 && !final_vchan1)) { + + error = -1; + + } else { + + /* Commit the allocations: free, then alloc. + */ + if (delta_vchan0 < 0) + (void) do_pcibr_rrb_free(bridge, pciio_slot, -delta_vchan0); + if (delta_vchan1 < 0) + (void) do_pcibr_rrb_free(bridge, PCIBR_RRB_SLOT_VIRTUAL + pciio_slot, -delta_vchan1); + + if (delta_vchan0 > 0) + (void) do_pcibr_rrb_alloc(bridge, pciio_slot, delta_vchan0); + if (delta_vchan1 > 0) + (void) do_pcibr_rrb_alloc(bridge, PCIBR_RRB_SLOT_VIRTUAL + pciio_slot, delta_vchan1); + + /* Return final values to caller. + */ + if (count_vchan0) + *count_vchan0 = final_vchan0; + if (count_vchan1) + *count_vchan1 = final_vchan1; + + /* prevent automatic changes to this slot's RRBs + */ + pcibr_soft->bs_rrb_fixed |= 1 << pciio_slot; + + /* Track the actual allocations, release + * any further reservations, and update the + * number of available RRBs. + */ + + pcibr_soft->bs_rrb_valid[pciio_slot] = final_vchan0; + pcibr_soft->bs_rrb_valid[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL] = final_vchan1; + pcibr_soft->bs_rrb_avail[pciio_slot & 1] = + pcibr_soft->bs_rrb_avail[pciio_slot & 1] + + pcibr_soft->bs_rrb_res[pciio_slot] + - delta_vchan0 + - delta_vchan1; + pcibr_soft->bs_rrb_res[pciio_slot] = 0; + +#if PCIBR_RRB_DEBUG + printk("pcibr_rrb_alloc: slot %d set to %d+%d; %d+%d free\n", + pciio_slot, final_vchan0, final_vchan1, + pcibr_soft->bs_rrb_avail[0], + pcibr_soft->bs_rrb_avail[1]); + for (pciio_slot = 0; pciio_slot < 8; ++pciio_slot) + printk("\t%d+%d+%d", + 0xFFF & pcibr_soft->bs_rrb_valid[pciio_slot], + 0xFFF & pcibr_soft->bs_rrb_valid[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL], + pcibr_soft->bs_rrb_res[pciio_slot]); + printk("\n"); +#endif + + error = 0; + } + + pcibr_unlock(pcibr_soft, s); + return error; +} + +/* + * Device driver interface to check the current state + * of the RRB allocations. + * + * pconn_vhdl is your PCI connection point (specifies which + * PCI bus and which slot). + * + * count_vchan0 points to where to return the number of RRBs + * assigned to the primary DMA channel, used by all DMA + * that does not explicitly ask for the alternate virtual + * channel. + * + * count_vchan1 points to where to return the number of RRBs + * assigned to the secondary DMA channel, used when + * PCIBR_VCHAN1 and PCIIO_DMA_A64 are specified. + * + * count_reserved points to where to return the number of RRBs + * that have been automatically reserved for your device at + * startup, but which have not been assigned to a + * channel. RRBs must be assigned to a channel to be used; + * this can be done either with an explicit pcibr_rrb_alloc + * call, or automatically by the infrastructure when a DMA + * translation is constructed. Any call to pcibr_rrb_alloc + * will release any unassigned reserved RRBs back to the + * free pool. + * + * count_pool points to where to return the number of RRBs + * that are currently unassigned and unreserved. This + * number can (and will) change as other drivers make calls + * to pcibr_rrb_alloc, or automatically allocate RRBs for + * DMA beyond their initial reservation. + * + * NULL may be passed for any of the return value pointers + * the caller is not interested in. + * + * The return value is "0" if all went well, or "-1" if + * there is a problem. Additionally, if the wrong vertex + * is passed in, one of the subsidiary support functions + * could panic with a "bad pciio fingerprint." + */ + +int +pcibr_rrb_check(devfs_handle_t pconn_vhdl, + int *count_vchan0, + int *count_vchan1, + int *count_reserved, + int *count_pool) +{ + pciio_info_t pciio_info; + pciio_slot_t pciio_slot; + pcibr_soft_t pcibr_soft; + unsigned long s; + int error = -1; + + if ((pciio_info = pciio_info_get(pconn_vhdl)) && + (pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info)) && + ((pciio_slot = pciio_info_slot_get(pciio_info)) < 8)) { + + s = pcibr_lock(pcibr_soft); + + if (count_vchan0) + *count_vchan0 = + pcibr_soft->bs_rrb_valid[pciio_slot]; + + if (count_vchan1) + *count_vchan1 = + pcibr_soft->bs_rrb_valid[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL]; + + if (count_reserved) + *count_reserved = + pcibr_soft->bs_rrb_res[pciio_slot]; + + if (count_pool) + *count_pool = + pcibr_soft->bs_rrb_avail[pciio_slot & 1]; + + error = 0; + + pcibr_unlock(pcibr_soft, s); + } + return error; +} + +/* pcibr_alloc_all_rrbs allocates all the rrbs available in the quantities + * requested for each of the devies. The evn_odd argument indicates whether + * allcoation for the odd or even rrbs is requested and next group of four pairse + * are the amount to assign to each device (they should sum to <= 8) and + * whether to set the viritual bit for that device (1 indictaes yes, 0 indicates no) + * the devices in order are either 0, 2, 4, 6 or 1, 3, 5, 7 + * if even_odd is even we alloc even rrbs else we allocate odd rrbs + * returns 0 if no errors else returns -1 + */ + +int +pcibr_alloc_all_rrbs(devfs_handle_t vhdl, int even_odd, + int dev_1_rrbs, int virt1, int dev_2_rrbs, int virt2, + int dev_3_rrbs, int virt3, int dev_4_rrbs, int virt4) +{ + devfs_handle_t pcibr_vhdl; + pcibr_soft_t pcibr_soft = NULL; + bridge_t *bridge = NULL; + + uint32_t rrb_setting = 0; + int rrb_shift = 7; + uint32_t cur_rrb; + int dev_rrbs[4]; + int virt[4]; + int i, j; + unsigned long s; + + if (GRAPH_SUCCESS == + hwgraph_traverse(vhdl, EDGE_LBL_PCI, &pcibr_vhdl)) { + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + if (pcibr_soft) + bridge = pcibr_soft->bs_base; + hwgraph_vertex_unref(pcibr_vhdl); + } + if (bridge == NULL) + bridge = (bridge_t *) xtalk_piotrans_addr + (vhdl, NULL, 0, sizeof(bridge_t), 0); + + even_odd &= 1; + + dev_rrbs[0] = dev_1_rrbs; + dev_rrbs[1] = dev_2_rrbs; + dev_rrbs[2] = dev_3_rrbs; + dev_rrbs[3] = dev_4_rrbs; + + virt[0] = virt1; + virt[1] = virt2; + virt[2] = virt3; + virt[3] = virt4; + + if ((dev_1_rrbs + dev_2_rrbs + dev_3_rrbs + dev_4_rrbs) > 8) { + return -1; + } + if ((dev_1_rrbs < 0) || (dev_2_rrbs < 0) || (dev_3_rrbs < 0) || (dev_4_rrbs < 0)) { + return -1; + } + /* walk through rrbs */ + for (i = 0; i < 4; i++) { + if (virt[i]) { + cur_rrb = i | 0xc; + cur_rrb = cur_rrb << (rrb_shift * 4); + rrb_shift--; + rrb_setting = rrb_setting | cur_rrb; + dev_rrbs[i] = dev_rrbs[i] - 1; + } + for (j = 0; j < dev_rrbs[i]; j++) { + cur_rrb = i | 0x8; + cur_rrb = cur_rrb << (rrb_shift * 4); + rrb_shift--; + rrb_setting = rrb_setting | cur_rrb; + } + } + + if (pcibr_soft) + s = pcibr_lock(pcibr_soft); + + bridge->b_rrb_map[even_odd].reg = rrb_setting; + + if (pcibr_soft) { + + pcibr_soft->bs_rrb_fixed |= 0x55 << even_odd; + + /* since we've "FIXED" the allocations + * for these slots, we probably can dispense + * with tracking avail/res/valid data, but + * keeping it up to date helps debugging. + */ + + pcibr_soft->bs_rrb_avail[even_odd] = + 8 - (dev_1_rrbs + dev_2_rrbs + dev_3_rrbs + dev_4_rrbs); + + pcibr_soft->bs_rrb_res[even_odd + 0] = 0; + pcibr_soft->bs_rrb_res[even_odd + 2] = 0; + pcibr_soft->bs_rrb_res[even_odd + 4] = 0; + pcibr_soft->bs_rrb_res[even_odd + 6] = 0; + + pcibr_soft->bs_rrb_valid[even_odd + 0] = dev_1_rrbs - virt1; + pcibr_soft->bs_rrb_valid[even_odd + 2] = dev_2_rrbs - virt2; + pcibr_soft->bs_rrb_valid[even_odd + 4] = dev_3_rrbs - virt3; + pcibr_soft->bs_rrb_valid[even_odd + 6] = dev_4_rrbs - virt4; + + pcibr_soft->bs_rrb_valid[even_odd + 0 + PCIBR_RRB_SLOT_VIRTUAL] = virt1; + pcibr_soft->bs_rrb_valid[even_odd + 2 + PCIBR_RRB_SLOT_VIRTUAL] = virt2; + pcibr_soft->bs_rrb_valid[even_odd + 4 + PCIBR_RRB_SLOT_VIRTUAL] = virt3; + pcibr_soft->bs_rrb_valid[even_odd + 6 + PCIBR_RRB_SLOT_VIRTUAL] = virt4; + + pcibr_unlock(pcibr_soft, s); + } + return 0; +} + +/* + * pcibr_rrb_flush: chase down all the RRBs assigned + * to the specified connection point, and flush + * them. + */ +void +pcibr_rrb_flush(devfs_handle_t pconn_vhdl) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + bridge_t *bridge = pcibr_soft->bs_base; + unsigned long s; + reg_p rrbp; + unsigned rrbm; + int i; + int rrbn; + unsigned sval; + unsigned mask; + + sval = BRIDGE_RRB_EN | (pciio_slot >> 1); + mask = BRIDGE_RRB_EN | BRIDGE_RRB_PDEV; + rrbn = pciio_slot & 1; + rrbp = &bridge->b_rrb_map[rrbn].reg; + + s = pcibr_lock(pcibr_soft); + rrbm = *rrbp; + for (i = 0; i < 8; ++i) { + if ((rrbm & mask) == sval) + do_pcibr_rrb_flush(bridge, rrbn); + rrbm >>= 4; + rrbn += 2; + } + pcibr_unlock(pcibr_soft, s); +} + +/* ===================================================================== + * Device(x) register management + */ + +/* pcibr_try_set_device: attempt to modify Device(x) + * for the specified slot on the specified bridge + * as requested in flags, limited to the specified + * bits. Returns which BRIDGE bits were in conflict, + * or ZERO if everything went OK. + * + * Caller MUST hold pcibr_lock when calling this function. + */ +LOCAL int +pcibr_try_set_device(pcibr_soft_t pcibr_soft, + pciio_slot_t slot, + unsigned flags, + bridgereg_t mask) +{ + bridge_t *bridge; + pcibr_soft_slot_t slotp; + bridgereg_t old; + bridgereg_t new; + bridgereg_t chg; + bridgereg_t bad; + bridgereg_t badpmu; + bridgereg_t badd32; + bridgereg_t badd64; + bridgereg_t fix; + unsigned long s; + bridgereg_t xmask; + + xmask = mask; + if (pcibr_soft->bs_xbridge) { + if (mask == BRIDGE_DEV_PMU_BITS) + xmask = XBRIDGE_DEV_PMU_BITS; + if (mask == BRIDGE_DEV_D64_BITS) + xmask = XBRIDGE_DEV_D64_BITS; + } + + slotp = &pcibr_soft->bs_slot[slot]; + + s = pcibr_lock(pcibr_soft); + + bridge = pcibr_soft->bs_base; + + old = slotp->bss_device; + + /* figure out what the desired + * Device(x) bits are based on + * the flags specified. + */ + + new = old; + + /* Currently, we inherit anything that + * the new caller has not specified in + * one way or another, unless we take + * action here to not inherit. + * + * This is needed for the "swap" stuff, + * since it could have been set via + * pcibr_endian_set -- altho note that + * any explicit PCIBR_BYTE_STREAM or + * PCIBR_WORD_VALUES will freely override + * the effect of that call (and vice + * versa, no protection either way). + * + * I want to get rid of pcibr_endian_set + * in favor of tracking DMA endianness + * using the flags specified when DMA + * channels are created. + */ + +#define BRIDGE_DEV_WRGA_BITS (BRIDGE_DEV_PMU_WRGA_EN | BRIDGE_DEV_DIR_WRGA_EN) +#define BRIDGE_DEV_SWAP_BITS (BRIDGE_DEV_SWAP_PMU | BRIDGE_DEV_SWAP_DIR) + + /* Do not use Barrier, Write Gather, + * or Prefetch unless asked. + * Leave everything else as it + * was from the last time. + */ + new = new + & ~BRIDGE_DEV_BARRIER + & ~BRIDGE_DEV_WRGA_BITS + & ~BRIDGE_DEV_PREF + ; + + /* Generic macro flags + */ + if (flags & PCIIO_DMA_DATA) { + new = (new + & ~BRIDGE_DEV_BARRIER) /* barrier off */ + | BRIDGE_DEV_PREF; /* prefetch on */ + + } + if (flags & PCIIO_DMA_CMD) { + new = ((new + & ~BRIDGE_DEV_PREF) /* prefetch off */ + & ~BRIDGE_DEV_WRGA_BITS) /* write gather off */ + | BRIDGE_DEV_BARRIER; /* barrier on */ + } + /* Generic detail flags + */ + if (flags & PCIIO_WRITE_GATHER) + new |= BRIDGE_DEV_WRGA_BITS; + if (flags & PCIIO_NOWRITE_GATHER) + new &= ~BRIDGE_DEV_WRGA_BITS; + + if (flags & PCIIO_PREFETCH) + new |= BRIDGE_DEV_PREF; + if (flags & PCIIO_NOPREFETCH) + new &= ~BRIDGE_DEV_PREF; + + if (flags & PCIBR_WRITE_GATHER) + new |= BRIDGE_DEV_WRGA_BITS; + if (flags & PCIBR_NOWRITE_GATHER) + new &= ~BRIDGE_DEV_WRGA_BITS; + + if (flags & PCIIO_BYTE_STREAM) + new |= (pcibr_soft->bs_xbridge) ? + BRIDGE_DEV_SWAP_DIR : BRIDGE_DEV_SWAP_BITS; + if (flags & PCIIO_WORD_VALUES) + new &= (pcibr_soft->bs_xbridge) ? + ~BRIDGE_DEV_SWAP_DIR : ~BRIDGE_DEV_SWAP_BITS; + + /* Provider-specific flags + */ + if (flags & PCIBR_PREFETCH) + new |= BRIDGE_DEV_PREF; + if (flags & PCIBR_NOPREFETCH) + new &= ~BRIDGE_DEV_PREF; + + if (flags & PCIBR_PRECISE) + new |= BRIDGE_DEV_PRECISE; + if (flags & PCIBR_NOPRECISE) + new &= ~BRIDGE_DEV_PRECISE; + + if (flags & PCIBR_BARRIER) + new |= BRIDGE_DEV_BARRIER; + if (flags & PCIBR_NOBARRIER) + new &= ~BRIDGE_DEV_BARRIER; + + if (flags & PCIBR_64BIT) + new |= BRIDGE_DEV_DEV_SIZE; + if (flags & PCIBR_NO64BIT) + new &= ~BRIDGE_DEV_DEV_SIZE; + + chg = old ^ new; /* what are we changing, */ + chg &= xmask; /* of the interesting bits */ + + if (chg) { + + badd32 = slotp->bss_d32_uctr ? (BRIDGE_DEV_D32_BITS & chg) : 0; + if (pcibr_soft->bs_xbridge) { + badpmu = slotp->bss_pmu_uctr ? (XBRIDGE_DEV_PMU_BITS & chg) : 0; + badd64 = slotp->bss_d64_uctr ? (XBRIDGE_DEV_D64_BITS & chg) : 0; + } else { + badpmu = slotp->bss_pmu_uctr ? (BRIDGE_DEV_PMU_BITS & chg) : 0; + badd64 = slotp->bss_d64_uctr ? (BRIDGE_DEV_D64_BITS & chg) : 0; + } + bad = badpmu | badd32 | badd64; + + if (bad) { + + /* some conflicts can be resolved by + * forcing the bit on. this may cause + * some performance degredation in + * the stream(s) that want the bit off, + * but the alternative is not allowing + * the new stream at all. + */ + if ( (fix = bad & (BRIDGE_DEV_PRECISE | + BRIDGE_DEV_BARRIER)) ){ + bad &= ~fix; + /* don't change these bits if + * they are already set in "old" + */ + chg &= ~(fix & old); + } + /* some conflicts can be resolved by + * forcing the bit off. this may cause + * some performance degredation in + * the stream(s) that want the bit on, + * but the alternative is not allowing + * the new stream at all. + */ + if ( (fix = bad & (BRIDGE_DEV_WRGA_BITS | + BRIDGE_DEV_PREF)) ) { + bad &= ~fix; + /* don't change these bits if + * we wanted to turn them on. + */ + chg &= ~(fix & new); + } + /* conflicts in other bits mean + * we can not establish this DMA + * channel while the other(s) are + * still present. + */ + if (bad) { + pcibr_unlock(pcibr_soft, s); +#if (DEBUG && PCIBR_DEV_DEBUG) + printk("pcibr_try_set_device: mod blocked by %R\n", bad, device_bits); +#endif + return bad; + } + } + } + if (mask == BRIDGE_DEV_PMU_BITS) + slotp->bss_pmu_uctr++; + if (mask == BRIDGE_DEV_D32_BITS) + slotp->bss_d32_uctr++; + if (mask == BRIDGE_DEV_D64_BITS) + slotp->bss_d64_uctr++; + + /* the value we want to write is the + * original value, with the bits for + * our selected changes flipped, and + * with any disabled features turned off. + */ + new = old ^ chg; /* only change what we want to change */ + + if (slotp->bss_device == new) { + pcibr_unlock(pcibr_soft, s); + return 0; + } + bridge->b_device[slot].reg = new; + slotp->bss_device = new; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + pcibr_unlock(pcibr_soft, s); +#if DEBUG && PCIBR_DEV_DEBUG + printk("pcibr Device(%d): 0x%p\n", slot, bridge->b_device[slot].reg); +#endif + + return 0; +} + +void +pcibr_release_device(pcibr_soft_t pcibr_soft, + pciio_slot_t slot, + bridgereg_t mask) +{ + pcibr_soft_slot_t slotp; + unsigned long s; + + slotp = &pcibr_soft->bs_slot[slot]; + + s = pcibr_lock(pcibr_soft); + + if (mask == BRIDGE_DEV_PMU_BITS) + slotp->bss_pmu_uctr--; + if (mask == BRIDGE_DEV_D32_BITS) + slotp->bss_d32_uctr--; + if (mask == BRIDGE_DEV_D64_BITS) + slotp->bss_d64_uctr--; + + pcibr_unlock(pcibr_soft, s); +} + +/* + * flush write gather buffer for slot + */ +LOCAL void +pcibr_device_write_gather_flush(pcibr_soft_t pcibr_soft, + pciio_slot_t slot) +{ + bridge_t *bridge; + unsigned long s; + volatile uint32_t wrf; + s = pcibr_lock(pcibr_soft); + bridge = pcibr_soft->bs_base; + wrf = bridge->b_wr_req_buf[slot].reg; + pcibr_unlock(pcibr_soft, s); +} + +/* ===================================================================== + * Bridge (pcibr) "Device Driver" entry points + */ + +/* + * pcibr_probe_slot: read a config space word + * while trapping any errors; reutrn zero if + * all went OK, or nonzero if there was an error. + * The value read, if any, is passed back + * through the valp parameter. + */ +LOCAL int +pcibr_probe_slot(bridge_t *bridge, + cfg_p cfg, + unsigned *valp) +{ + int rv; + bridgereg_t old_enable, new_enable; + int badaddr_val(volatile void *, int, volatile void *); + + + old_enable = bridge->b_int_enable; + new_enable = old_enable & ~BRIDGE_IMR_PCI_MST_TIMEOUT; + + bridge->b_int_enable = new_enable; + + /* + * The xbridge doesn't clear b_err_int_view unless + * multi-err is cleared... + */ + if (is_xbridge(bridge)) + if (bridge->b_err_int_view & BRIDGE_ISR_PCI_MST_TIMEOUT) { + bridge->b_int_rst_stat = BRIDGE_IRR_MULTI_CLR; + } + + if (bridge->b_int_status & BRIDGE_IRR_PCI_GRP) { + bridge->b_int_rst_stat = BRIDGE_IRR_PCI_GRP_CLR; + (void) bridge->b_wid_tflush; /* flushbus */ + } + rv = badaddr_val((void *) cfg, 4, valp); + + /* + * The xbridge doesn't set master timeout in b_int_status + * here. Fortunately it's in error_interrupt_view. + */ + if (is_xbridge(bridge)) + if (bridge->b_err_int_view & BRIDGE_ISR_PCI_MST_TIMEOUT) { + bridge->b_int_rst_stat = BRIDGE_IRR_MULTI_CLR; + rv = 1; /* unoccupied slot */ + } + + bridge->b_int_enable = old_enable; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + + return rv; +} + +/* + * pcibr_init: called once during system startup or + * when a loadable driver is loaded. + * + * The driver_register function should normally + * be in _reg, not _init. But the pcibr driver is + * required by devinit before the _reg routines + * are called, so this is an exception. + */ +void +pcibr_init(void) +{ +#if DEBUG && ATTACH_DEBUG + printk("pcibr_init\n"); +#endif + + xwidget_driver_register(XBRIDGE_WIDGET_PART_NUM, + XBRIDGE_WIDGET_MFGR_NUM, + "pcibr_", + 0); + xwidget_driver_register(BRIDGE_WIDGET_PART_NUM, + BRIDGE_WIDGET_MFGR_NUM, + "pcibr_", + 0); +} + +/* + * open/close mmap/munmap interface would be used by processes + * that plan to map the PCI bridge, and muck around with the + * registers. This is dangerous to do, and will be allowed + * to a select brand of programs. Typically these are + * diagnostics programs, or some user level commands we may + * write to do some weird things. + * To start with expect them to have root priveleges. + * We will ask for more later. + */ +/* ARGSUSED */ +int +pcibr_open(devfs_handle_t *devp, int oflag, int otyp, cred_t *credp) +{ + return 0; +} + +/*ARGSUSED */ +int +pcibr_close(devfs_handle_t dev, int oflag, int otyp, cred_t *crp) +{ + return 0; +} + +/*ARGSUSED */ +int +pcibr_map(devfs_handle_t dev, vhandl_t *vt, off_t off, size_t len, uint prot) +{ + int error; + devfs_handle_t vhdl = dev_to_vhdl(dev); + devfs_handle_t pcibr_vhdl = hwgraph_connectpt_get(vhdl); + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); + bridge_t *bridge = pcibr_soft->bs_base; + + hwgraph_vertex_unref(pcibr_vhdl); + + ASSERT(pcibr_soft); + len = ctob(btoc(len)); /* Make len page aligned */ + error = v_mapphys(vt, (void *) ((__psunsigned_t) bridge + off), len); + + /* + * If the offset being mapped corresponds to the flash prom + * base, and if the mapping succeeds, and if the user + * has requested the protections to be WRITE, enable the + * flash prom to be written. + * + * XXX- deprecate this in favor of using the + * real flash driver ... + */ + if (!error && + ((off == BRIDGE_EXTERNAL_FLASH) || + (len > BRIDGE_EXTERNAL_FLASH))) { + int s; + + /* + * ensure that we write and read without any interruption. + * The read following the write is required for the Bridge war + */ + s = splhi(); + bridge->b_wid_control |= BRIDGE_CTRL_FLASH_WR_EN; + bridge->b_wid_control; /* inval addr bug war */ + splx(s); + } + return error; +} + +/*ARGSUSED */ +int +pcibr_unmap(devfs_handle_t dev, vhandl_t *vt) +{ + devfs_handle_t pcibr_vhdl = hwgraph_connectpt_get((devfs_handle_t) dev); + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); + bridge_t *bridge = pcibr_soft->bs_base; + + hwgraph_vertex_unref(pcibr_vhdl); + + /* + * If flashprom write was enabled, disable it, as + * this is the last unmap. + */ + if (bridge->b_wid_control & BRIDGE_CTRL_FLASH_WR_EN) { + int s; + + /* + * ensure that we write and read without any interruption. + * The read following the write is required for the Bridge war + */ + s = splhi(); + bridge->b_wid_control &= ~BRIDGE_CTRL_FLASH_WR_EN; + bridge->b_wid_control; /* inval addr bug war */ + splx(s); + } + return 0; +} + +/* This is special case code used by grio. There are plans to make + * this a bit more general in the future, but till then this should + * be sufficient. + */ +pciio_slot_t +pcibr_device_slot_get(devfs_handle_t dev_vhdl) +{ + char devname[MAXDEVNAME]; + devfs_handle_t tdev; + pciio_info_t pciio_info; + pciio_slot_t slot = PCIIO_SLOT_NONE; + + vertex_to_name(dev_vhdl, devname, MAXDEVNAME); + + /* run back along the canonical path + * until we find a PCI connection point. + */ + tdev = hwgraph_connectpt_get(dev_vhdl); + while (tdev != GRAPH_VERTEX_NONE) { + pciio_info = pciio_info_chk(tdev); + if (pciio_info) { + slot = pciio_info_slot_get(pciio_info); + break; + } + hwgraph_vertex_unref(tdev); + tdev = hwgraph_connectpt_get(tdev); + } + hwgraph_vertex_unref(tdev); + + return slot; +} + +/*========================================================================== + * BRIDGE PCI SLOT RELATED IOCTLs + */ +char *pci_space_name[] = {"NONE", + "ROM", + "IO", + "", + "MEM", + "MEM32", + "MEM64", + "CFG", + "WIN0", + "WIN1", + "WIN2", + "WIN3", + "WIN4", + "WIN5", + "", + "BAD"}; + + +#ifdef LATER + +void +pcibr_slot_func_info_return(pcibr_info_h pcibr_infoh, + int func, + pcibr_slot_func_info_resp_t funcp) +{ + pcibr_info_t pcibr_info = pcibr_infoh[func]; + int win; + + funcp->resp_f_status = 0; + + if (!pcibr_info) { + return; + } + + funcp->resp_f_status |= FUNC_IS_VALID; +#ifdef SUPPORT_PRINTING_V_FORMAT + sprintf(funcp->resp_f_slot_name, "%v", pcibr_info->f_vertex); +#else + sprintf(funcp->resp_f_slot_name, "%x", pcibr_info->f_vertex); +#endif + + if(is_sys_critical_vertex(pcibr_info->f_vertex)) { + funcp->resp_f_status |= FUNC_IS_SYS_CRITICAL; + } + + funcp->resp_f_bus = pcibr_info->f_bus; + funcp->resp_f_slot = pcibr_info->f_slot; + funcp->resp_f_func = pcibr_info->f_func; +#ifdef SUPPORT_PRINTING_V_FORMAT + sprintf(funcp->resp_f_master_name, "%v", pcibr_info->f_master); +#else + sprintf(funcp->resp_f_master_name, "%x", pcibr_info->f_master); +#endif + funcp->resp_f_pops = pcibr_info->f_pops; + funcp->resp_f_efunc = pcibr_info->f_efunc; + funcp->resp_f_einfo = pcibr_info->f_einfo; + + funcp->resp_f_vendor = pcibr_info->f_vendor; + funcp->resp_f_device = pcibr_info->f_device; + + for(win = 0 ; win < 6 ; win++) { + funcp->resp_f_window[win].resp_w_base = + pcibr_info->f_window[win].w_base; + funcp->resp_f_window[win].resp_w_size = + pcibr_info->f_window[win].w_size; + sprintf(funcp->resp_f_window[win].resp_w_space, + "%s", + pci_space_name[pcibr_info->f_window[win].w_space]); + } + + funcp->resp_f_rbase = pcibr_info->f_rbase; + funcp->resp_f_rsize = pcibr_info->f_rsize; + + for (win = 0 ; win < 4; win++) { + funcp->resp_f_ibit[win] = pcibr_info->f_ibit[win]; + } + + funcp->resp_f_att_det_error = pcibr_info->f_att_det_error; + +} + +int +pcibr_slot_info_return(pcibr_soft_t pcibr_soft, + pciio_slot_t slot, + pcibr_slot_info_resp_t respp) +{ + pcibr_soft_slot_t pss; + int func; + bridge_t *bridge = pcibr_soft->bs_base; + reg_p b_respp; + pcibr_slot_info_resp_t slotp; + pcibr_slot_func_info_resp_t funcp; + + slotp = snia_kmem_zalloc(sizeof(*slotp), KM_SLEEP); + if (slotp == NULL) { + return(ENOMEM); + } + + pss = &pcibr_soft->bs_slot[slot]; + + printk("\nPCI INFRASTRUCTURAL INFO FOR SLOT %d\n\n", slot); + + slotp->resp_has_host = pss->has_host; + slotp->resp_host_slot = pss->host_slot; +#ifdef SUPPORT_PRINTING_V_FORMAT + sprintf(slotp->resp_slot_conn_name, "%v", pss->slot_conn); +#else + sprintf(slotp->resp_slot_conn_name, "%x", pss->slot_conn); +#endif + slotp->resp_slot_status = pss->slot_status; + slotp->resp_l1_bus_num = io_path_map_widget(pcibr_soft->bs_vhdl); + + if (is_sys_critical_vertex(pss->slot_conn)) { + slotp->resp_slot_status |= SLOT_IS_SYS_CRITICAL; + } + + slotp->resp_bss_ninfo = pss->bss_ninfo; + + for (func = 0; func < pss->bss_ninfo; func++) { + funcp = &(slotp->resp_func[func]); + pcibr_slot_func_info_return(pss->bss_infos, func, funcp); + } + + sprintf(slotp->resp_bss_devio_bssd_space, "%s", + pci_space_name[pss->bss_devio.bssd_space]); + slotp->resp_bss_devio_bssd_base = pss->bss_devio.bssd_base; + slotp->resp_bss_device = pss->bss_device; + + slotp->resp_bss_pmu_uctr = pss->bss_pmu_uctr; + slotp->resp_bss_d32_uctr = pss->bss_d32_uctr; + slotp->resp_bss_d64_uctr = pss->bss_d64_uctr; + + slotp->resp_bss_d64_base = pss->bss_d64_base; + slotp->resp_bss_d64_flags = pss->bss_d64_flags; + slotp->resp_bss_d32_base = pss->bss_d32_base; + slotp->resp_bss_d32_flags = pss->bss_d32_flags; + + slotp->resp_bss_ext_ates_active = atomic_read(&pss->bss_ext_ates_active); + + slotp->resp_bss_cmd_pointer = pss->bss_cmd_pointer; + slotp->resp_bss_cmd_shadow = pss->bss_cmd_shadow; + + slotp->resp_bs_rrb_valid = pcibr_soft->bs_rrb_valid[slot]; + slotp->resp_bs_rrb_valid_v = pcibr_soft->bs_rrb_valid[slot + + PCIBR_RRB_SLOT_VIRTUAL]; + slotp->resp_bs_rrb_res = pcibr_soft->bs_rrb_res[slot]; + + if (slot & 1) { + b_respp = &bridge->b_odd_resp; + } else { + b_respp = &bridge->b_even_resp; + } + + slotp->resp_b_resp = *b_respp; + + slotp->resp_b_int_device = bridge->b_int_device; + slotp->resp_b_int_enable = bridge->b_int_enable; + slotp->resp_b_int_host = bridge->b_int_addr[slot].addr; + + if (COPYOUT(slotp, respp, sizeof(*respp))) { + return(EFAULT); + } + + snia_kmem_free(slotp, sizeof(*slotp)); + + return(0); +} + +/* + * pcibr_slot_query + * Return information about the PCI slot maintained by the infrastructure. + * Information is requested in the request structure. + * + * Information returned in the response structure: + * Slot hwgraph name + * Vendor/Device info + * Base register info + * Interrupt mapping from device pins to the bridge pins + * Devio register + * Software RRB info + * RRB register info + * Host/Gues info + * PCI Bus #,slot #, function # + * Slot provider hwgraph name + * Provider Functions + * Error handler + * DMA mapping usage counters + * DMA direct translation info + * External SSRAM workaround info + */ +int +pcibr_slot_query(devfs_handle_t pcibr_vhdl, pcibr_slot_info_req_t reqp) +{ + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); + pciio_slot_t slot = reqp->req_slot; + pciio_slot_t tmp_slot; + pcibr_slot_info_resp_t respp = (pcibr_slot_info_resp_t) reqp->req_respp; + int size = reqp->req_size; + int error; + + /* Make sure that we are dealing with a bridge device vertex */ + if (!pcibr_soft) { + return(EINVAL); + } + + /* Make sure that we have a valid PCI slot number or PCIIO_SLOT_NONE */ + if ((!PCIBR_VALID_SLOT(slot)) && (slot != PCIIO_SLOT_NONE)) { + return(EINVAL); + } + + /* Return information for the requested PCI slot */ + if (slot != PCIIO_SLOT_NONE) { + if (size < sizeof(*respp)) { + return(EINVAL); + } + + /* Acquire read access to the slot */ + mrlock(pcibr_soft->bs_slot[slot].slot_lock, MR_ACCESS, PZERO); + + error = pcibr_slot_info_return(pcibr_soft, slot, respp); + + /* Release the slot lock */ + mrunlock(pcibr_soft->bs_slot[slot].slot_lock); + + return(error); + } + + /* Return information for all the slots */ + for (tmp_slot = 0; tmp_slot < 8; tmp_slot++) { + + if (size < sizeof(*respp)) { + return(EINVAL); + } + + /* Acquire read access to the slot */ + mrlock(pcibr_soft->bs_slot[tmp_slot].slot_lock, MR_ACCESS, PZERO); + + error = pcibr_slot_info_return(pcibr_soft, tmp_slot, respp); + + /* Release the slot lock */ + mrunlock(pcibr_soft->bs_slot[tmp_slot].slot_lock); + + if (error) { + return(error); + } + + ++respp; + size -= sizeof(*respp); + } + + return(error); +} +#endif /* LATER */ + + +/*ARGSUSED */ +int +pcibr_ioctl(devfs_handle_t dev, + int cmd, + void *arg, + int flag, + struct cred *cr, + int *rvalp) +{ + devfs_handle_t pcibr_vhdl = hwgraph_connectpt_get((devfs_handle_t)dev); +#ifdef LATER + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); +#endif + int error = 0; + + hwgraph_vertex_unref(pcibr_vhdl); + + switch (cmd) { +#ifdef LATER + case GIOCSETBW: + { + grio_ioctl_info_t info; + pciio_slot_t slot = 0; + + if (!cap_able((uint64_t)CAP_DEVICE_MGT)) { + error = EPERM; + break; + } + if (COPYIN(arg, &info, sizeof(grio_ioctl_info_t))) { + error = EFAULT; + break; + } +#ifdef GRIO_DEBUG + printk("pcibr:: prev_vhdl: %d reqbw: %lld\n", + info.prev_vhdl, info.reqbw); +#endif /* GRIO_DEBUG */ + + if ((slot = pcibr_device_slot_get(info.prev_vhdl)) == + PCIIO_SLOT_NONE) { + error = EIO; + break; + } + if (info.reqbw) + pcibr_priority_bits_set(pcibr_soft, slot, PCI_PRIO_HIGH); + break; + } + + case GIOCRELEASEBW: + { + grio_ioctl_info_t info; + pciio_slot_t slot = 0; + + if (!cap_able(CAP_DEVICE_MGT)) { + error = EPERM; + break; + } + if (COPYIN(arg, &info, sizeof(grio_ioctl_info_t))) { + error = EFAULT; + break; + } +#ifdef GRIO_DEBUG + printk("pcibr:: prev_vhdl: %d reqbw: %lld\n", + info.prev_vhdl, info.reqbw); +#endif /* GRIO_DEBUG */ + + if ((slot = pcibr_device_slot_get(info.prev_vhdl)) == + PCIIO_SLOT_NONE) { + error = EIO; + break; + } + if (info.reqbw) + pcibr_priority_bits_set(pcibr_soft, slot, PCI_PRIO_LOW); + break; + } + + case PCIBR_SLOT_POWERUP: + { + pciio_slot_t slot; + + if (!cap_able(CAP_DEVICE_MGT)) { + error = EPERM; + break; + } + + slot = (pciio_slot_t)(uint64_t)arg; + error = pcibr_slot_powerup(pcibr_vhdl,slot); + break; + } + case PCIBR_SLOT_SHUTDOWN: + if (!cap_able(CAP_DEVICE_MGT)) { + error = EPERM; + break; + } + + slot = (pciio_slot_t)(uint64_t)arg; + error = pcibr_slot_powerup(pcibr_vhdl,slot); + break; + } + case PCIBR_SLOT_QUERY: + { + struct pcibr_slot_info_req_s req; + + if (!cap_able(CAP_DEVICE_MGT)) { + error = EPERM; + break; + } + + if (COPYIN(arg, &req, sizeof(req))) { + error = EFAULT; + break; + } + + error = pcibr_slot_query(pcibr_vhdl, &req); + break; + } +#endif /* LATER */ + default: + break; + + } + + return error; +} + +void +pcibr_freeblock_sub(iopaddr_t *free_basep, + iopaddr_t *free_lastp, + iopaddr_t base, + size_t size) +{ + iopaddr_t free_base = *free_basep; + iopaddr_t free_last = *free_lastp; + iopaddr_t last = base + size - 1; + + if ((last < free_base) || (base > free_last)); /* free block outside arena */ + + else if ((base <= free_base) && (last >= free_last)) + /* free block contains entire arena */ + *free_basep = *free_lastp = 0; + + else if (base <= free_base) + /* free block is head of arena */ + *free_basep = last + 1; + + else if (last >= free_last) + /* free block is tail of arena */ + *free_lastp = base - 1; + + /* + * We are left with two regions: the free area + * in the arena "below" the block, and the free + * area in the arena "above" the block. Keep + * the one that is bigger. + */ + + else if ((base - free_base) > (free_last - last)) + *free_lastp = base - 1; /* keep lower chunk */ + else + *free_basep = last + 1; /* keep upper chunk */ +} + +/* Convert from ssram_bits in control register to number of SSRAM entries */ +#define ATE_NUM_ENTRIES(n) _ate_info[n] + +/* Possible choices for number of ATE entries in Bridge's SSRAM */ +LOCAL int _ate_info[] = +{ + 0, /* 0 entries */ + 8 * 1024, /* 8K entries */ + 16 * 1024, /* 16K entries */ + 64 * 1024 /* 64K entries */ +}; + +#define ATE_NUM_SIZES (sizeof(_ate_info) / sizeof(int)) +#define ATE_PROBE_VALUE 0x0123456789abcdefULL + +/* + * Determine the size of this bridge's external mapping SSRAM, and set + * the control register appropriately to reflect this size, and initialize + * the external SSRAM. + */ +LOCAL int +pcibr_init_ext_ate_ram(bridge_t *bridge) +{ + int largest_working_size = 0; + int num_entries, entry; + int i, j; + bridgereg_t old_enable, new_enable; + int s; + + /* Probe SSRAM to determine its size. */ + old_enable = bridge->b_int_enable; + new_enable = old_enable & ~BRIDGE_IMR_PCI_MST_TIMEOUT; + bridge->b_int_enable = new_enable; + + for (i = 1; i < ATE_NUM_SIZES; i++) { + /* Try writing a value */ + bridge->b_ext_ate_ram[ATE_NUM_ENTRIES(i) - 1] = ATE_PROBE_VALUE; + + /* Guard against wrap */ + for (j = 1; j < i; j++) + bridge->b_ext_ate_ram[ATE_NUM_ENTRIES(j) - 1] = 0; + + /* See if value was written */ + if (bridge->b_ext_ate_ram[ATE_NUM_ENTRIES(i) - 1] == ATE_PROBE_VALUE) + largest_working_size = i; + } + bridge->b_int_enable = old_enable; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + + /* + * ensure that we write and read without any interruption. + * The read following the write is required for the Bridge war + */ + + s = splhi(); + bridge->b_wid_control = (bridge->b_wid_control + & ~BRIDGE_CTRL_SSRAM_SIZE_MASK) + | BRIDGE_CTRL_SSRAM_SIZE(largest_working_size); + bridge->b_wid_control; /* inval addr bug war */ + splx(s); + + num_entries = ATE_NUM_ENTRIES(largest_working_size); + +#if PCIBR_ATE_DEBUG + if (num_entries) + printk("bridge at 0x%x: clearing %d external ATEs\n", bridge, num_entries); + else + printk("bridge at 0x%x: no externa9422l ATE RAM found\n", bridge); +#endif + + /* Initialize external mapping entries */ + for (entry = 0; entry < num_entries; entry++) + bridge->b_ext_ate_ram[entry] = 0; + + return (num_entries); +} + +/* + * Allocate "count" contiguous Bridge Address Translation Entries + * on the specified bridge to be used for PCI to XTALK mappings. + * Indices in rm map range from 1..num_entries. Indicies returned + * to caller range from 0..num_entries-1. + * + * Return the start index on success, -1 on failure. + */ +LOCAL int +pcibr_ate_alloc(pcibr_soft_t pcibr_soft, int count) +{ + int index = 0; + + index = (int) rmalloc(pcibr_soft->bs_int_ate_map, (size_t) count); +/* printk("Colin: pcibr_ate_alloc - index %d count %d \n", index, count); */ + + if (!index && pcibr_soft->bs_ext_ate_map) + index = (int) rmalloc(pcibr_soft->bs_ext_ate_map, (size_t) count); + + /* rmalloc manages resources in the 1..n + * range, with 0 being failure. + * pcibr_ate_alloc manages resources + * in the 0..n-1 range, with -1 being failure. + */ + return index - 1; +} + +LOCAL void +pcibr_ate_free(pcibr_soft_t pcibr_soft, int index, int count) +/* Who says there's no such thing as a free meal? :-) */ +{ + /* note the "+1" since rmalloc handles 1..n but + * we start counting ATEs at zero. + */ +/* printk("Colin: pcibr_ate_free - index %d count %d\n", index, count); */ + + rmfree((index < pcibr_soft->bs_int_ate_size) + ? pcibr_soft->bs_int_ate_map + : pcibr_soft->bs_ext_ate_map, + count, index + 1); +} + +LOCAL pcibr_info_t +pcibr_info_get(devfs_handle_t vhdl) +{ + return (pcibr_info_t) pciio_info_get(vhdl); +} + +pcibr_info_t +pcibr_device_info_new( + pcibr_soft_t pcibr_soft, + pciio_slot_t slot, + pciio_function_t rfunc, + pciio_vendor_id_t vendor, + pciio_device_id_t device) +{ + pcibr_info_t pcibr_info; + pciio_function_t func; + int ibit; + + func = (rfunc == PCIIO_FUNC_NONE) ? 0 : rfunc; + + NEW(pcibr_info); + pciio_device_info_new(&pcibr_info->f_c, + pcibr_soft->bs_vhdl, + slot, rfunc, + vendor, device); + + if (slot != PCIIO_SLOT_NONE) { + + /* + * Currently favored mapping from PCI + * slot number and INTA/B/C/D to Bridge + * PCI Interrupt Bit Number: + * + * SLOT A B C D + * 0 0 4 0 4 + * 1 1 5 1 5 + * 2 2 6 2 6 + * 3 3 7 3 7 + * 4 4 0 4 0 + * 5 5 1 5 1 + * 6 6 2 6 2 + * 7 7 3 7 3 + * + * XXX- allow pcibr_hints to override default + * XXX- allow ADMIN to override pcibr_hints + */ + for (ibit = 0; ibit < 4; ++ibit) + pcibr_info->f_ibit[ibit] = + (slot + 4 * ibit) & 7; + + /* + * Record the info in the sparse func info space. + */ + if (func < pcibr_soft->bs_slot[slot].bss_ninfo) + pcibr_soft->bs_slot[slot].bss_infos[func] = pcibr_info; + } + return pcibr_info; +} + +void +pcibr_device_info_free(devfs_handle_t pcibr_vhdl, pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); + pcibr_info_t pcibr_info; + pciio_function_t func; + pcibr_soft_slot_t slotp = &pcibr_soft->bs_slot[slot]; + int nfunc = slotp->bss_ninfo; + + + for (func = 0; func < nfunc; func++) { + pcibr_info = slotp->bss_infos[func]; + + if (!pcibr_info) + continue; + + slotp->bss_infos[func] = 0; + pciio_device_info_unregister(pcibr_vhdl, &pcibr_info->f_c); + pciio_device_info_free(&pcibr_info->f_c); + DEL(pcibr_info); + } + + /* Clear the DEVIO(x) for this slot */ + slotp->bss_devio.bssd_space = PCIIO_SPACE_NONE; + slotp->bss_devio.bssd_base = PCIBR_D32_BASE_UNSET; + slotp->bss_device = 0; + + + /* Reset the mapping usage counters */ + slotp->bss_pmu_uctr = 0; + slotp->bss_d32_uctr = 0; + slotp->bss_d64_uctr = 0; + + /* Clear the Direct translation info */ + slotp->bss_d64_base = PCIBR_D64_BASE_UNSET; + slotp->bss_d64_flags = 0; + slotp->bss_d32_base = PCIBR_D32_BASE_UNSET; + slotp->bss_d32_flags = 0; + + /* Clear out shadow info necessary for the external SSRAM workaround */ + slotp->bss_ext_ates_active = ATOMIC_INIT(0); + slotp->bss_cmd_pointer = 0; + slotp->bss_cmd_shadow = 0; + +} + +/* + * PCI_ADDR_SPACE_LIMITS_LOAD + * Gets the current values of + * pci io base, + * pci io last, + * pci low memory base, + * pci low memory last, + * pci high memory base, + * pci high memory last + */ +#define PCI_ADDR_SPACE_LIMITS_LOAD() \ + pci_io_fb = pcibr_soft->bs_spinfo.pci_io_base; \ + pci_io_fl = pcibr_soft->bs_spinfo.pci_io_last; \ + pci_lo_fb = pcibr_soft->bs_spinfo.pci_swin_base; \ + pci_lo_fl = pcibr_soft->bs_spinfo.pci_swin_last; \ + pci_hi_fb = pcibr_soft->bs_spinfo.pci_mem_base; \ + pci_hi_fl = pcibr_soft->bs_spinfo.pci_mem_last; +/* + * PCI_ADDR_SPACE_LIMITS_STORE + * Sets the current values of + * pci io base, + * pci io last, + * pci low memory base, + * pci low memory last, + * pci high memory base, + * pci high memory last + */ +#define PCI_ADDR_SPACE_LIMITS_STORE() \ + pcibr_soft->bs_spinfo.pci_io_base = pci_io_fb; \ + pcibr_soft->bs_spinfo.pci_io_last = pci_io_fl; \ + pcibr_soft->bs_spinfo.pci_swin_base = pci_lo_fb; \ + pcibr_soft->bs_spinfo.pci_swin_last = pci_lo_fl; \ + pcibr_soft->bs_spinfo.pci_mem_base = pci_hi_fb; \ + pcibr_soft->bs_spinfo.pci_mem_last = pci_hi_fl; + +#define PCI_ADDR_SPACE_LIMITS_PRINT() \ + printf("+++++++++++++++++++++++\n" \ + "IO base 0x%x last 0x%x\n" \ + "SWIN base 0x%x last 0x%x\n" \ + "MEM base 0x%x last 0x%x\n" \ + "+++++++++++++++++++++++\n", \ + pcibr_soft->bs_spinfo.pci_io_base, \ + pcibr_soft->bs_spinfo.pci_io_last, \ + pcibr_soft->bs_spinfo.pci_swin_base, \ + pcibr_soft->bs_spinfo.pci_swin_last, \ + pcibr_soft->bs_spinfo.pci_mem_base, \ + pcibr_soft->bs_spinfo.pci_mem_last); + +/* + * pcibr_slot_info_init + * Probe for this slot and see if it is populated. + * If it is populated initialize the generic PCI infrastructural + * information associated with this particular PCI device. + */ +int +pcibr_slot_info_init(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + bridge_t *bridge; + cfg_p cfgw; + unsigned idword; + unsigned pfail; + unsigned idwords[8]; + pciio_vendor_id_t vendor; + pciio_device_id_t device; + unsigned htype; + cfg_p wptr; + int win; + pciio_space_t space; + iopaddr_t pci_io_fb, pci_io_fl; + iopaddr_t pci_lo_fb, pci_lo_fl; + iopaddr_t pci_hi_fb, pci_hi_fl; + int nfunc; + pciio_function_t rfunc; + int func; + devfs_handle_t conn_vhdl; + pcibr_soft_slot_t slotp; + + /* Get the basic software information required to proceed */ + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + if (!pcibr_soft) + return(EINVAL); + + bridge = pcibr_soft->bs_base; + if (!PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + /* If we have a host slot (eg:- IOC3 has 2 PCI slots and the initialization + * is done by the host slot then we are done. + */ + if (pcibr_soft->bs_slot[slot].has_host) { + return(0); + } + + /* Check for a slot with any system critical functions */ + if (pcibr_is_slot_sys_critical(pcibr_vhdl, slot)) + return(EPERM); + + /* Load the current values of allocated PCI address spaces */ + PCI_ADDR_SPACE_LIMITS_LOAD(); + + /* Try to read the device-id/vendor-id from the config space */ + cfgw = bridge->b_type0_cfg_dev[slot].l; + + if (pcibr_probe_slot(bridge, cfgw, &idword)) + return(ENODEV); + + slotp = &pcibr_soft->bs_slot[slot]; + slotp->slot_status |= SLOT_POWER_UP; + + vendor = 0xFFFF & idword; + /* If the vendor id is not valid then the slot is not populated + * and we are done. + */ + if (vendor == 0xFFFF) + return(ENODEV); + + device = 0xFFFF & (idword >> 16); + htype = do_pcibr_config_get(cfgw, PCI_CFG_HEADER_TYPE, 1); + + nfunc = 1; + rfunc = PCIIO_FUNC_NONE; + pfail = 0; + + /* NOTE: if a card claims to be multifunction + * but only responds to config space 0, treat + * it as a unifunction card. + */ + + if (htype & 0x80) { /* MULTIFUNCTION */ + for (func = 1; func < 8; ++func) { + cfgw = bridge->b_type0_cfg_dev[slot].f[func].l; + if (pcibr_probe_slot(bridge, cfgw, &idwords[func])) { + pfail |= 1 << func; + continue; + } + vendor = 0xFFFF & idwords[func]; + if (vendor == 0xFFFF) { + pfail |= 1 << func; + continue; + } + nfunc = func + 1; + rfunc = 0; + } + cfgw = bridge->b_type0_cfg_dev[slot].l; + } + NEWA(pcibr_infoh, nfunc); + + pcibr_soft->bs_slot[slot].bss_ninfo = nfunc; + pcibr_soft->bs_slot[slot].bss_infos = pcibr_infoh; + + for (func = 0; func < nfunc; ++func) { + unsigned cmd_reg; + + if (func) { + if (pfail & (1 << func)) + continue; + + idword = idwords[func]; + cfgw = bridge->b_type0_cfg_dev[slot].f[func].l; + + device = 0xFFFF & (idword >> 16); + htype = do_pcibr_config_get(cfgw, PCI_CFG_HEADER_TYPE, 1); + rfunc = func; + } + htype &= 0x7f; + if (htype != 0x00) { + printk(KERN_WARNING "%s pcibr: pci slot %d func %d has strange header type 0x%x\n", + pcibr_soft->bs_name, slot, func, htype); + continue; + } +#if DEBUG && ATTACH_DEBUG + printk(KERN_NOTICE + "%s pcibr: pci slot %d func %d: vendor 0x%x device 0x%x", + pcibr_soft->bs_name, slot, func, vendor, device); +#endif + + pcibr_info = pcibr_device_info_new + (pcibr_soft, slot, rfunc, vendor, device); + conn_vhdl = pciio_device_info_register(pcibr_vhdl, &pcibr_info->f_c); + if (func == 0) + slotp->slot_conn = conn_vhdl; + +#ifdef LITTLE_ENDIAN + cmd_reg = cfgw[(PCI_CFG_COMMAND ^ 4) / 4]; +#else + cmd_reg = cfgw[PCI_CFG_COMMAND / 4]; +#endif + + wptr = cfgw + PCI_CFG_BASE_ADDR_0 / 4; + + for (win = 0; win < PCI_CFG_BASE_ADDRS; ++win) { + iopaddr_t base, mask, code; + size_t size; + + /* + * GET THE BASE & SIZE OF THIS WINDOW: + * + * The low two or four bits of the BASE register + * determines which address space we are in; the + * rest is a base address. BASE registers + * determine windows that are power-of-two sized + * and naturally aligned, so we can get the size + * of a window by writing all-ones to the + * register, reading it back, and seeing which + * bits are used for decode; the least + * significant nonzero bit is also the size of + * the window. + * + * WARNING: someone may already have allocated + * some PCI space to this window, and in fact + * PIO may be in process at this very moment + * from another processor (or even from this + * one, if we get interrupted)! So, if the BASE + * already has a nonzero address, be generous + * and use the LSBit of that address as the + * size; this could overstate the window size. + * Usually, when one card is set up, all are set + * up; so, since we don't bitch about + * overlapping windows, we are ok. + * + * UNFORTUNATELY, some cards do not clear their + * BASE registers on reset. I have two heuristics + * that can detect such cards: first, if the + * decode enable is turned off for the space + * that the window uses, we can disregard the + * initial value. second, if the address is + * outside the range that we use, we can disregard + * it as well. + * + * This is looking very PCI generic. Except for + * knowing how many slots and where their config + * spaces are, this window loop and the next one + * could probably be shared with other PCI host + * adapters. It would be interesting to see if + * this could be pushed up into pciio, when we + * start supporting more PCI providers. + */ +#ifdef LITTLE_ENDIAN + base = wptr[((win*4)^4)/4]; +#else + base = wptr[win]; +#endif + + if (base & PCI_BA_IO_SPACE) { + /* BASE is in I/O space. */ + space = PCIIO_SPACE_IO; + mask = -4; + code = base & 3; + base = base & mask; + if (base == 0) { + ; /* not assigned */ + } else if (!(cmd_reg & PCI_CMD_IO_SPACE)) { + base = 0; /* decode not enabled */ + } + } else { + /* BASE is in MEM space. */ + space = PCIIO_SPACE_MEM; + mask = -16; + code = base & PCI_BA_MEM_LOCATION; /* extract BAR type */ + base = base & mask; + if (base == 0) { + ; /* not assigned */ + } else if (!(cmd_reg & PCI_CMD_MEM_SPACE)) { + base = 0; /* decode not enabled */ + } else if (base & 0xC0000000) { + base = 0; /* outside permissable range */ + } else if ((code == PCI_BA_MEM_64BIT) && +#ifdef LITTLE_ENDIAN + (wptr[(((win + 1)*4)^4)/4] != 0)) { +#else + (wptr[win + 1] != 0)) { +#endif /* LITTLE_ENDIAN */ + base = 0; /* outside permissable range */ + } + } + + if (base != 0) { /* estimate size */ + size = base & -base; + } else { /* calculate size */ +#ifdef LITTLE_ENDIAN + wptr[((win*4)^4)/4] = ~0; /* turn on all bits */ + size = wptr[((win*4)^4)/4]; /* get stored bits */ +#else + wptr[win] = ~0; /* turn on all bits */ + size = wptr[win]; /* get stored bits */ +#endif /* LITTLE_ENDIAN */ + size &= mask; /* keep addr */ + size &= -size; /* keep lsbit */ + if (size == 0) + continue; + } + + pcibr_info->f_window[win].w_space = space; + pcibr_info->f_window[win].w_base = base; + pcibr_info->f_window[win].w_size = size; + + /* + * If this window already has PCI space + * allocated for it, "subtract" that space from + * our running freeblocks. Don't worry about + * overlaps in existing allocated windows; we + * may be overstating their sizes anyway. + */ + + if (base && size) { + if (space == PCIIO_SPACE_IO) { + pcibr_freeblock_sub(&pci_io_fb, + &pci_io_fl, + base, size); + } else { + pcibr_freeblock_sub(&pci_lo_fb, + &pci_lo_fl, + base, size); + pcibr_freeblock_sub(&pci_hi_fb, + &pci_hi_fl, + base, size); + } + } +#if defined(IOC3_VENDOR_ID_NUM) && defined(IOC3_DEVICE_ID_NUM) + /* + * IOC3 BASE_ADDR* BUG WORKAROUND + * + + * If we write to BASE1 on the IOC3, the + * data in BASE0 is replaced. The + * original workaround was to remember + * the value of BASE0 and restore it + * when we ran off the end of the BASE + * registers; however, a later + * workaround was added (I think it was + * rev 1.44) to avoid setting up + * anything but BASE0, with the comment + * that writing all ones to BASE1 set + * the enable-parity-error test feature + * in IOC3's SCR bit 14. + * + * So, unless we defer doing any PCI + * space allocation until drivers + * attach, and set up a way for drivers + * (the IOC3 in paricular) to tell us + * generically to keep our hands off + * BASE registers, we gotta "know" about + * the IOC3 here. + * + * Too bad the PCI folks didn't reserve the + * all-zero value for 'no BASE here' (it is a + * valid code for an uninitialized BASE in + * 32-bit PCI memory space). + */ + + if ((vendor == IOC3_VENDOR_ID_NUM) && + (device == IOC3_DEVICE_ID_NUM)) + break; +#endif + if (code == PCI_BA_MEM_64BIT) { + win++; /* skip upper half */ +#ifdef LITTLE_ENDIAN + wptr[((win*4)^4)/4] = 0; /* which must be zero */ +#else + wptr[win] = 0; /* which must be zero */ +#endif /* LITTLE_ENDIAN */ + } + } /* next win */ + } /* next func */ + + /* Store back the values for allocated PCI address spaces */ + PCI_ADDR_SPACE_LIMITS_STORE(); + return(0); +} + +/* + * pcibr_slot_info_free + * Remove all the PCI infrastructural information associated + * with a particular PCI device. + */ +int +pcibr_slot_info_free(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + int nfunc; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; + + pcibr_device_info_free(pcibr_vhdl, slot); + + pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; + DELA(pcibr_infoh,nfunc); + pcibr_soft->bs_slot[slot].bss_ninfo = 0; + + return(0); +} + +int as_debug = 0; +/* + * pcibr_slot_addr_space_init + * Reserve chunks of PCI address space as required by + * the base registers in the card. + */ +int +pcibr_slot_addr_space_init(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + bridge_t *bridge; + iopaddr_t pci_io_fb, pci_io_fl; + iopaddr_t pci_lo_fb, pci_lo_fl; + iopaddr_t pci_hi_fb, pci_hi_fl; + size_t align; + iopaddr_t mask; + int nbars; + int nfunc; + int func; + int win; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + bridge = pcibr_soft->bs_base; + + /* Get the current values for the allocated PCI address spaces */ + PCI_ADDR_SPACE_LIMITS_LOAD(); + + if (as_debug) +#ifdef LATER + PCI_ADDR_SPACE_LIMITS_PRINT(); +#endif + /* allocate address space, + * for windows that have not been + * previously assigned. + */ + if (pcibr_soft->bs_slot[slot].has_host) { + return(0); + } + + nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; + if (nfunc < 1) + return(EINVAL); + + pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; + if (!pcibr_infoh) + return(EINVAL); + + /* + * Try to make the DevIO windows not + * overlap by pushing the "io" and "hi" + * allocation areas up to the next one + * or two megabyte bound. This also + * keeps them from being zero. + * + * DO NOT do this with "pci_lo" since + * the entire "lo" area is only a + * megabyte, total ... + */ + align = (slot < 2) ? 0x200000 : 0x100000; + mask = -align; + pci_io_fb = (pci_io_fb + align - 1) & mask; + pci_hi_fb = (pci_hi_fb + align - 1) & mask; + + for (func = 0; func < nfunc; ++func) { + cfg_p cfgw; + cfg_p wptr; + pciio_space_t space; + iopaddr_t base; + size_t size; + cfg_p pci_cfg_cmd_reg_p; + unsigned pci_cfg_cmd_reg; + unsigned pci_cfg_cmd_reg_add = 0; + + pcibr_info = pcibr_infoh[func]; + + if (!pcibr_info) + continue; + + if (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) + continue; + + cfgw = bridge->b_type0_cfg_dev[slot].f[func].l; + wptr = cfgw + PCI_CFG_BASE_ADDR_0 / 4; + + nbars = PCI_CFG_BASE_ADDRS; + + for (win = 0; win < nbars; ++win) { + + space = pcibr_info->f_window[win].w_space; + base = pcibr_info->f_window[win].w_base; + size = pcibr_info->f_window[win].w_size; + + if (size < 1) + continue; + + if (base >= size) { +#if DEBUG && PCI_DEBUG + printk("pcibr: slot %d func %d window %d is in %d[0x%x..0x%x], alloc by prom\n", + slot, func, win, space, base, base + size - 1); +#endif + continue; /* already allocated */ + } + align = size; /* ie. 0x00001000 */ + if (align < _PAGESZ) + align = _PAGESZ; /* ie. 0x00004000 */ + mask = -align; /* ie. 0xFFFFC000 */ + + switch (space) { + case PCIIO_SPACE_IO: + base = (pci_io_fb + align - 1) & mask; + if ((base + size) > pci_io_fl) { + base = 0; + break; + } + pci_io_fb = base + size; + break; + + case PCIIO_SPACE_MEM: +#ifdef LITTLE_ENDIAN + if ((wptr[((win*4)^4)/4] & PCI_BA_MEM_LOCATION) == +#else + if ((wptr[win] & PCI_BA_MEM_LOCATION) == +#endif /* LITTLE_ENDIAN */ + PCI_BA_MEM_1MEG) { + /* allocate from 20-bit PCI space */ + base = (pci_lo_fb + align - 1) & mask; + if ((base + size) > pci_lo_fl) { + base = 0; + break; + } + pci_lo_fb = base + size; + } else { + /* allocate from 32-bit or 64-bit PCI space */ + base = (pci_hi_fb + align - 1) & mask; + if ((base + size) > pci_hi_fl) { + base = 0; + break; + } + pci_hi_fb = base + size; + } + break; + + default: + base = 0; +#if DEBUG && PCI_DEBUG + printk("pcibr: slot %d window %d had bad space code %d\n", + slot, win, space); +#endif + } + pcibr_info->f_window[win].w_base = base; +#ifdef LITTLE_ENDIAN + wptr[((win*4)^4)/4] = base; +#if DEBUG && PCI_DEBUG + printk("Setting base address 0x%p base 0x%x\n", &(wptr[((win*4)^4)/4]), base); +#endif +#else + wptr[win] = base; +#endif /* LITTLE_ENDIAN */ + +#if DEBUG && PCI_DEBUG + if (base >= size) + printk("pcibr: slot %d func %d window %d is in %d [0x%x..0x%x], alloc by pcibr\n", + slot, func, win, space, base, base + size - 1); + else + printk("pcibr: slot %d func %d window %d, unable to alloc 0x%x in 0x%p\n", + slot, func, win, size, space); +#endif + } /* next base */ + + /* + * Allocate space for the EXPANSION ROM + * NOTE: DO NOT DO THIS ON AN IOC3, + * as it blows the system away. + */ + base = size = 0; + if ((pcibr_soft->bs_slot[slot].bss_vendor_id != IOC3_VENDOR_ID_NUM) || + (pcibr_soft->bs_slot[slot].bss_device_id != IOC3_DEVICE_ID_NUM)) { + + wptr = cfgw + PCI_EXPANSION_ROM / 4; +#ifdef LITTLE_ENDIAN + wptr[1] = 0xFFFFF000; + mask = wptr[1]; +#else + *wptr = 0xFFFFF000; + mask = *wptr; +#endif /* LITTLE_ENDIAN */ + if (mask & 0xFFFFF000) { + size = mask & -mask; + align = size; + if (align < _PAGESZ) + align = _PAGESZ; + mask = -align; + base = (pci_hi_fb + align - 1) & mask; + if ((base + size) > pci_hi_fl) + base = size = 0; + else { + pci_hi_fb = base + size; +#ifdef LITTLE_ENDIAN + wptr[1] = base; +#else + *wptr = base; +#endif /* LITTLE_ENDIAN */ +#if DEBUG && PCI_DEBUG + printk("%s/%d ROM in 0x%lx..0x%lx (alloc by pcibr)\n", + pcibr_soft->bs_name, slot, + base, base + size - 1); +#endif + } + } + } + pcibr_info->f_rbase = base; + pcibr_info->f_rsize = size; + + /* + * if necessary, update the board's + * command register to enable decoding + * in the windows we added. + * + * There are some bits we always want to + * be sure are set. + */ + pci_cfg_cmd_reg_add |= PCI_CMD_IO_SPACE; + + /* + * The Adaptec 1160 FC Controller WAR #767995: + * The part incorrectly ignores the upper 32 bits of a 64 bit + * address when decoding references to it's registers so to + * keep it from responding to a bus cycle that it shouldn't + * we only use I/O space to get at it's registers. Don't + * enable memory space accesses on that PCI device. + */ + #define FCADP_VENDID 0x9004 /* Adaptec Vendor ID from fcadp.h */ + #define FCADP_DEVID 0x1160 /* Adaptec 1160 Device ID from fcadp.h */ + + if ((pcibr_info->f_vendor != FCADP_VENDID) || + (pcibr_info->f_device != FCADP_DEVID)) + pci_cfg_cmd_reg_add |= PCI_CMD_MEM_SPACE; + + pci_cfg_cmd_reg_add |= PCI_CMD_BUS_MASTER; + + pci_cfg_cmd_reg_p = cfgw + PCI_CFG_COMMAND / 4; + pci_cfg_cmd_reg = *pci_cfg_cmd_reg_p; +#if PCI_FBBE /* XXX- check here to see if dev can do fast-back-to-back */ + if (!((pci_cfg_cmd_reg >> 16) & PCI_STAT_F_BK_BK_CAP)) + fast_back_to_back_enable = 0; +#endif + pci_cfg_cmd_reg &= 0xFFFF; + if (pci_cfg_cmd_reg_add & ~pci_cfg_cmd_reg) + *pci_cfg_cmd_reg_p = pci_cfg_cmd_reg | pci_cfg_cmd_reg_add; + + } /* next func */ + + /* Now that we have allocated new chunks of PCI address spaces to this + * card we need to update the bookkeeping values which indicate + * the current PCI address space allocations. + */ + PCI_ADDR_SPACE_LIMITS_STORE(); + return(0); +} + +/* + * pcibr_slot_device_init + * Setup the device register in the bridge for this PCI slot. + */ +int +pcibr_slot_device_init(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + bridge_t *bridge; + bridgereg_t devreg; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + bridge = pcibr_soft->bs_base; + + /* + * Adjustments to Device(x) + * and init of bss_device shadow + */ + devreg = bridge->b_device[slot].reg; + devreg &= ~BRIDGE_DEV_PAGE_CHK_DIS; + devreg |= BRIDGE_DEV_COH | BRIDGE_DEV_VIRTUAL_EN; +#ifdef LITTLE_ENDIAN + devreg |= BRIDGE_DEV_DEV_SWAP; +#endif + pcibr_soft->bs_slot[slot].bss_device = devreg; + bridge->b_device[slot].reg = devreg; + +#if DEBUG && PCI_DEBUG + printk("pcibr Device(%d): 0x%lx\n", slot, bridge->b_device[slot].reg); +#endif + +#if DEBUG && PCI_DEBUG + printk("pcibr: PCI space allocation done.\n"); +#endif + + return(0); +} + +/* + * pcibr_slot_guest_info_init + * Setup the host/guest relations for a PCI slot. + */ +int +pcibr_slot_guest_info_init(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + pcibr_soft_slot_t slotp; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + slotp = &pcibr_soft->bs_slot[slot]; + + /* create info and verticies for guest slots; + * for compatibilitiy macros, create info + * for even unpopulated slots (but do not + * build verticies for them). + */ + if (pcibr_soft->bs_slot[slot].bss_ninfo < 1) { + NEWA(pcibr_infoh, 1); + pcibr_soft->bs_slot[slot].bss_ninfo = 1; + pcibr_soft->bs_slot[slot].bss_infos = pcibr_infoh; + + pcibr_info = pcibr_device_info_new + (pcibr_soft, slot, PCIIO_FUNC_NONE, + PCIIO_VENDOR_ID_NONE, PCIIO_DEVICE_ID_NONE); + + if (pcibr_soft->bs_slot[slot].has_host) { + slotp->slot_conn = pciio_device_info_register + (pcibr_vhdl, &pcibr_info->f_c); + } + } + + /* generate host/guest relations + */ + if (pcibr_soft->bs_slot[slot].has_host) { + int host = pcibr_soft->bs_slot[slot].host_slot; + pcibr_soft_slot_t host_slotp = &pcibr_soft->bs_slot[host]; + + hwgraph_edge_add(slotp->slot_conn, + host_slotp->slot_conn, + EDGE_LBL_HOST); + + /* XXX- only gives us one guest edge per + * host. If/when we have a host with more than + * one guest, we will need to figure out how + * the host finds all its guests, and sorts + * out which one is which. + */ + hwgraph_edge_add(host_slotp->slot_conn, + slotp->slot_conn, + EDGE_LBL_GUEST); + } + + return(0); +} + +/* + * pcibr_slot_initial_rrb_alloc + * Allocate a default number of rrbs for this slot on + * the two channels. This is dictated by the rrb allocation + * strategy routine defined per platform. + */ + +int +pcibr_slot_initial_rrb_alloc(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + bridge_t *bridge; + int c0, c1; + int r; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + bridge = pcibr_soft->bs_base; + + /* How may RRBs are on this slot? + */ + c0 = do_pcibr_rrb_count_valid(bridge, slot); + c1 = do_pcibr_rrb_count_valid(bridge, slot + PCIBR_RRB_SLOT_VIRTUAL); + +#if PCIBR_RRB_DEBUG + printk("pcibr_attach: slot %d started with %d+%d\n", slot, c0, c1); +#endif + + /* Do we really need any? + */ + pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; + pcibr_info = pcibr_infoh[0]; + if ((pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) && + !pcibr_soft->bs_slot[slot].has_host) { + if (c0 > 0) + do_pcibr_rrb_free(bridge, slot, c0); + if (c1 > 0) + do_pcibr_rrb_free(bridge, slot + PCIBR_RRB_SLOT_VIRTUAL, c1); + pcibr_soft->bs_rrb_valid[slot] = 0x1000; + pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL] = 0x1000; + return(ENODEV); + } + + pcibr_soft->bs_rrb_avail[slot & 1] -= c0 + c1; + pcibr_soft->bs_rrb_valid[slot] = c0; + pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL] = c1; + + pcibr_soft->bs_rrb_avail[0] = do_pcibr_rrb_count_avail(bridge, 0); + pcibr_soft->bs_rrb_avail[1] = do_pcibr_rrb_count_avail(bridge, 1); + + r = 3 - (c0 + c1); + + if (r > 0) { + pcibr_soft->bs_rrb_res[slot] = r; + pcibr_soft->bs_rrb_avail[slot & 1] -= r; + } + +#if PCIBR_RRB_DEBUG + printk("\t%d+%d+%d", + 0xFFF & pcibr_soft->bs_rrb_valid[slot], + 0xFFF & pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL], + pcibr_soft->bs_rrb_res[slot]); + printk("\n"); +#endif + + return(0); +} + +/* + * pcibr_slot_call_device_attach + * This calls the associated driver attach routine for the PCI + * card in this slot. + */ +int +pcibr_slot_call_device_attach(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot, + int drv_flags) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + async_attach_t aa = NULL; + int func; + devfs_handle_t xconn_vhdl,conn_vhdl; + int nfunc; + int error_func; + int error_slot = 0; + int error = ENODEV; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + + if (pcibr_soft->bs_slot[slot].has_host) { + return(EPERM); + } + + xconn_vhdl = pcibr_soft->bs_conn; + aa = async_attach_get_info(xconn_vhdl); + + nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; + pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; + + for (func = 0; func < nfunc; ++func) { + + pcibr_info = pcibr_infoh[func]; + + if (!pcibr_info) + continue; + + if (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) + continue; + + conn_vhdl = pcibr_info->f_vertex; + +#ifdef LATER + /* + * Activate if and when we support cdl. + */ + if (aa) + async_attach_add_info(conn_vhdl, aa); +#endif /* LATER */ + + error_func = pciio_device_attach(conn_vhdl, drv_flags); + + pcibr_info->f_att_det_error = error_func; + + if (error_func) + error_slot = error_func; + + error = error_slot; + + } /* next func */ + + if (error) { + if ((error != ENODEV) && (error != EUNATCH)) + pcibr_soft->bs_slot[slot].slot_status |= SLOT_STARTUP_INCMPLT; + } else { + pcibr_soft->bs_slot[slot].slot_status |= SLOT_STARTUP_CMPLT; + } + + return(error); +} + +/* + * pcibr_slot_call_device_detach + * This calls the associated driver detach routine for the PCI + * card in this slot. + */ +int +pcibr_slot_call_device_detach(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot, + int drv_flags) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + int func; + devfs_handle_t conn_vhdl = GRAPH_VERTEX_NONE; + int nfunc; + int error_func; + int error_slot = 0; + int error = ENODEV; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + if (pcibr_soft->bs_slot[slot].has_host) + return(EPERM); + + /* Make sure that we do not detach a system critical function vertex */ + if(pcibr_is_slot_sys_critical(pcibr_vhdl, slot)) + return(EPERM); + + nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; + pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; + + for (func = 0; func < nfunc; ++func) { + + pcibr_info = pcibr_infoh[func]; + + if (!pcibr_info) + continue; + + if (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) + continue; + + conn_vhdl = pcibr_info->f_vertex; + + error_func = pciio_device_detach(conn_vhdl, drv_flags); + + pcibr_info->f_att_det_error = error_func; + + if (error_func) + error_slot = error_func; + + error = error_slot; + + } /* next func */ + + pcibr_soft->bs_slot[slot].slot_status &= ~SLOT_STATUS_MASK; + + if (error) { + if ((error != ENODEV) && (error != EUNATCH)) + pcibr_soft->bs_slot[slot].slot_status |= SLOT_SHUTDOWN_INCMPLT; + } else { + if (conn_vhdl != GRAPH_VERTEX_NONE) + pcibr_device_unregister(conn_vhdl); + pcibr_soft->bs_slot[slot].slot_status |= SLOT_SHUTDOWN_CMPLT; + } + + return(error); +} + +/* + * pcibr_slot_detach + * This is a place holder routine to keep track of all the + * slot-specific freeing that needs to be done. + */ +int +pcibr_slot_detach(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot, + int drv_flags) +{ + int error; + + /* Call the device detach function */ + error = (pcibr_slot_call_device_detach(pcibr_vhdl, slot, drv_flags)); + return (error); + +} + +/* + * pcibr_is_slot_sys_critical + * Check slot for any functions that are system critical. + * Return 1 if any are system critical or 0 otherwise. + * + * This function will always return 0 when called by + * pcibr_attach() because the system critical vertices + * have not yet been set in the hwgraph. + */ +int +pcibr_is_slot_sys_critical(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + devfs_handle_t conn_vhdl = GRAPH_VERTEX_NONE; + int nfunc; + int func; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(0); + + nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; + pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; + + for (func = 0; func < nfunc; ++func) { + + pcibr_info = pcibr_infoh[func]; + if (!pcibr_info) + continue; + + if (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) + continue; + + conn_vhdl = pcibr_info->f_vertex; + if (is_sys_critical_vertex(conn_vhdl)) { +#if defined(SUPPORT_PRINTING_V_FORMAT) + printk(KERN_WARNING "%v is a system critical device vertex\n", conn_vhdl); +#else + printk(KERN_WARNING "%p is a system critical device vertex\n", (void *)conn_vhdl); +#endif + return(1); + } + + } + + return(0); +} + +/* + * pcibr_device_unregister + * This frees up any hardware resources reserved for this PCI device + * and removes any PCI infrastructural information setup for it. + * This is usually used at the time of shutting down of the PCI card. + */ +int +pcibr_device_unregister(devfs_handle_t pconn_vhdl) +{ + pciio_info_t pciio_info; + devfs_handle_t pcibr_vhdl; + pciio_slot_t slot; + pcibr_soft_t pcibr_soft; + bridge_t *bridge; + int error_call; + int error = 0; + + pciio_info = pciio_info_get(pconn_vhdl); + + pcibr_vhdl = pciio_info_master_get(pciio_info); + slot = pciio_info_slot_get(pciio_info); + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + bridge = pcibr_soft->bs_base; + + /* Clear all the hardware xtalk resources for this device */ + xtalk_widgetdev_shutdown(pcibr_soft->bs_conn, slot); + + /* Flush all the rrbs */ + pcibr_rrb_flush(pconn_vhdl); + + /* Free the rrbs allocated to this slot */ + error_call = do_pcibr_rrb_free(bridge, slot, + pcibr_soft->bs_rrb_valid[slot] + + pcibr_soft->bs_rrb_valid[slot + + PCIBR_RRB_SLOT_VIRTUAL]); + + if (error_call) + error = ERANGE; + + pcibr_soft->bs_rrb_valid[slot] = 0; + pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL] = 0; + pcibr_soft->bs_rrb_res[slot] = 0; + + /* Flush the write buffers !! */ + error_call = pcibr_wrb_flush(pconn_vhdl); + + if (error_call) + error = error_call; + + /* Clear the information specific to the slot */ + error_call = pcibr_slot_info_free(pcibr_vhdl, slot); + + if (error_call) + error = error_call; + + return(error); + +} + +/* + * build a convenience link path in the + * form of "...//bus/" + * + * returns 1 on success, 0 otherwise + * + * depends on hwgraph separator == '/' + */ +int +pcibr_bus_cnvlink(devfs_handle_t f_c, int slot) +{ + char dst[MAXDEVNAME]; + char *dp = dst; + char *cp, *xp; + int widgetnum; + char pcibus[8]; + devfs_handle_t nvtx, svtx; + int rv; + +#if DEBUG + printk("pcibr_bus_cnvlink: slot= %d f_c= %p\n", + slot, f_c); + { + int pos; + char dname[256]; + pos = devfs_generate_path(f_c, dname, 256); + printk("%s : path= %s\n", __FUNCTION__, &dname[pos]); + } +#endif + + if (GRAPH_SUCCESS != hwgraph_vertex_name_get(f_c, dst, MAXDEVNAME)) + return 0; + + /* dst example == /hw/module/001c02/Pbrick/xtalk/8/pci/direct */ + + /* find the widget number */ + xp = strstr(dst, "/"EDGE_LBL_XTALK"/"); + if (xp == NULL) + return 0; + widgetnum = atoi(xp+7); + if (widgetnum < XBOW_PORT_8 || widgetnum > XBOW_PORT_F) + return 0; + + /* remove "/pci/direct" from path */ + cp = strstr(dst, "/" EDGE_LBL_PCI "/" "direct"); + if (cp == NULL) + return 0; + *cp = (char)NULL; + + /* get the vertex for the widget */ + if (GRAPH_SUCCESS != hwgraph_traverse(NULL, dp, &svtx)) + return 0; + + *xp = (char)NULL; /* remove "/xtalk/..." from path */ + + /* dst example now == /hw/module/001c02/Pbrick */ + + /* get the bus number */ + strcat(dst, "/bus"); + sprintf(pcibus, "%d", p_busnum[widgetnum]); + + /* link to bus to widget */ + rv = hwgraph_path_add(NULL, dp, &nvtx); + if (GRAPH_SUCCESS == rv) + rv = hwgraph_edge_add(nvtx, svtx, pcibus); + + return (rv == GRAPH_SUCCESS); +} + + +/* + * pcibr_attach: called every time the crosstalk + * infrastructure is asked to initialize a widget + * that matches the part number we handed to the + * registration routine above. + */ +/*ARGSUSED */ +int +pcibr_attach(devfs_handle_t xconn_vhdl) +{ + /* REFERENCED */ + graph_error_t rc; + devfs_handle_t pcibr_vhdl; + devfs_handle_t ctlr_vhdl; + bridge_t *bridge = NULL; + bridgereg_t id; + int rev; + pcibr_soft_t pcibr_soft; + pcibr_info_t pcibr_info; + xwidget_info_t info; + xtalk_intr_t xtalk_intr; + device_desc_t dev_desc = (device_desc_t)0; + int slot; + int ibit; + devfs_handle_t noslot_conn; + char devnm[MAXDEVNAME], *s; + pcibr_hints_t pcibr_hints; + bridgereg_t b_int_enable; + unsigned rrb_fixed = 0; + + iopaddr_t pci_io_fb, pci_io_fl; + iopaddr_t pci_lo_fb, pci_lo_fl; + iopaddr_t pci_hi_fb, pci_hi_fl; + + int spl_level; +#ifdef LATER + char *nicinfo = (char *)0; +#endif + +#if PCI_FBBE + int fast_back_to_back_enable; +#endif + l1sc_t *scp; + nasid_t nasid; + + async_attach_t aa = NULL; + + aa = async_attach_get_info(xconn_vhdl); + +#if DEBUG && ATTACH_DEBUG + printk("pcibr_attach: xconn_vhdl= %p\n", xconn_vhdl); + { + int pos; + char dname[256]; + pos = devfs_generate_path(xconn_vhdl, dname, 256); + printk("%s : path= %s \n", __FUNCTION__, &dname[pos]); + } +#endif + + /* Setup the PRB for the bridge in CONVEYOR BELT + * mode. PRBs are setup in default FIRE-AND-FORGET + * mode during the initialization. + */ + hub_device_flags_set(xconn_vhdl, HUB_PIO_CONVEYOR); + + bridge = (bridge_t *) + xtalk_piotrans_addr(xconn_vhdl, NULL, + 0, sizeof(bridge_t), 0); + +#ifndef MEDUSA_HACK + if ((bridge->b_wid_stat & BRIDGE_STAT_PCI_GIO_N) == 0) + return -1; /* someone else handles GIO bridges. */ +#endif + + if (XWIDGET_PART_REV_NUM(bridge->b_wid_id) == XBRIDGE_PART_REV_A) + NeedXbridgeSwap = 1; + + /* + * Create the vertex for the PCI bus, which we + * will also use to hold the pcibr_soft and + * which will be the "master" vertex for all the + * pciio connection points we will hang off it. + * This needs to happen before we call nic_bridge_vertex_info + * as we are some of the *_vmc functions need access to the edges. + * + * Opening this vertex will provide access to + * the Bridge registers themselves. + */ + rc = hwgraph_path_add(xconn_vhdl, EDGE_LBL_PCI, &pcibr_vhdl); + ASSERT(rc == GRAPH_SUCCESS); + + ctlr_vhdl = NULL; + ctlr_vhdl = hwgraph_register(pcibr_vhdl, EDGE_LBL_CONTROLLER, + 0, DEVFS_FL_AUTO_DEVNUM, + 0, 0, + S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, 0, 0, + &pcibr_fops, NULL); + + ASSERT(ctlr_vhdl != NULL); + + /* + * decode the nic, and hang its stuff off our + * connection point where other drivers can get + * at it. + */ +#ifdef LATER + nicinfo = BRIDGE_VERTEX_MFG_INFO(xconn_vhdl, (nic_data_t) & bridge->b_nic); +#endif + + /* + * Get the hint structure; if some NIC callback + * marked this vertex as "hands-off" then we + * just return here, before doing anything else. + */ + pcibr_hints = pcibr_hints_get(xconn_vhdl, 0); + + if (pcibr_hints && pcibr_hints->ph_hands_off) + return -1; /* generic operations disabled */ + + id = bridge->b_wid_id; + rev = XWIDGET_PART_REV_NUM(id); + + hwgraph_info_add_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, (arbitrary_info_t) rev); + + /* + * allocate soft state structure, fill in some + * fields, and hook it up to our vertex. + */ + NEW(pcibr_soft); + BZERO(pcibr_soft, sizeof *pcibr_soft); + pcibr_soft_set(pcibr_vhdl, pcibr_soft); + + pcibr_soft->bs_conn = xconn_vhdl; + pcibr_soft->bs_vhdl = pcibr_vhdl; + pcibr_soft->bs_base = bridge; + pcibr_soft->bs_rev_num = rev; + pcibr_soft->bs_intr_bits = pcibr_intr_bits; + if (is_xbridge(bridge)) { + pcibr_soft->bs_int_ate_size = XBRIDGE_INTERNAL_ATES; + pcibr_soft->bs_xbridge = 1; + } else { + pcibr_soft->bs_int_ate_size = BRIDGE_INTERNAL_ATES; + pcibr_soft->bs_xbridge = 0; + } + + nasid = NASID_GET(bridge); + scp = &NODEPDA( NASID_TO_COMPACT_NODEID(nasid) )->module->elsc; + pcibr_soft->bs_l1sc = scp; + pcibr_soft->bs_moduleid = iobrick_module_get(scp); + pcibr_soft->bsi_err_intr = 0; + + /* Bridges up through REV C + * are unable to set the direct + * byteswappers to BYTE_STREAM. + */ + if (pcibr_soft->bs_rev_num <= BRIDGE_PART_REV_C) { + pcibr_soft->bs_pio_end_io = PCIIO_WORD_VALUES; + pcibr_soft->bs_pio_end_mem = PCIIO_WORD_VALUES; + } +#if PCIBR_SOFT_LIST + { + pcibr_list_p self; + + NEW(self); + self->bl_soft = pcibr_soft; + self->bl_vhdl = pcibr_vhdl; + self->bl_next = pcibr_list; + self->bl_next = swap_ptr((void **) &pcibr_list, (void *)self); + } +#endif + + /* + * get the name of this bridge vertex and keep the info. Use this + * only where it is really needed now: like error interrupts. + */ + s = dev_to_name(pcibr_vhdl, devnm, MAXDEVNAME); + pcibr_soft->bs_name = kmalloc(strlen(s) + 1, GFP_KERNEL); + strcpy(pcibr_soft->bs_name, s); + +#if SHOW_REVS || DEBUG +#if !DEBUG + if (kdebug) +#endif + printk("%sBridge ASIC: rev %s (code=0x%x) at %s\n", + is_xbridge(bridge) ? "X" : "", + (rev == BRIDGE_PART_REV_A) ? "A" : + (rev == BRIDGE_PART_REV_B) ? "B" : + (rev == BRIDGE_PART_REV_C) ? "C" : + (rev == BRIDGE_PART_REV_D) ? "D" : + (rev == XBRIDGE_PART_REV_A) ? "A" : + (rev == XBRIDGE_PART_REV_B) ? "B" : + "unknown", + rev, pcibr_soft->bs_name); +#endif + + info = xwidget_info_get(xconn_vhdl); + pcibr_soft->bs_xid = xwidget_info_id_get(info); + pcibr_soft->bs_master = xwidget_info_master_get(info); + pcibr_soft->bs_mxid = xwidget_info_masterid_get(info); + + /* + * Init bridge lock. + */ + spin_lock_init(&pcibr_soft->bs_lock); + + /* + * If we have one, process the hints structure. + */ + if (pcibr_hints) { + rrb_fixed = pcibr_hints->ph_rrb_fixed; + + pcibr_soft->bs_rrb_fixed = rrb_fixed; + + if (pcibr_hints->ph_intr_bits) + pcibr_soft->bs_intr_bits = pcibr_hints->ph_intr_bits; + + for (slot = 0; slot < 8; ++slot) { + int hslot = pcibr_hints->ph_host_slot[slot] - 1; + + if (hslot < 0) { + pcibr_soft->bs_slot[slot].host_slot = slot; + } else { + pcibr_soft->bs_slot[slot].has_host = 1; + pcibr_soft->bs_slot[slot].host_slot = hslot; + } + } + } + /* + * set up initial values for state fields + */ + for (slot = 0; slot < 8; ++slot) { + pcibr_soft->bs_slot[slot].bss_devio.bssd_space = PCIIO_SPACE_NONE; + pcibr_soft->bs_slot[slot].bss_d64_base = PCIBR_D64_BASE_UNSET; + pcibr_soft->bs_slot[slot].bss_d32_base = PCIBR_D32_BASE_UNSET; + pcibr_soft->bs_slot[slot].bss_ext_ates_active = ATOMIC_INIT(0); + } + + for (ibit = 0; ibit < 8; ++ibit) { + pcibr_soft->bs_intr[ibit].bsi_xtalk_intr = 0; + pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_soft = pcibr_soft; + pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_list = NULL; + pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_stat = + &(bridge->b_int_status); + pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_hdlrcnt = 0; + pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_shared = 0; + pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_connected = 0; + } + + /* + * Initialize various Bridge registers. + */ + + /* + * On pre-Rev.D bridges, set the PCI_RETRY_CNT + * to zero to avoid dropping stores. (#475347) + */ + if (rev < BRIDGE_PART_REV_D) + bridge->b_bus_timeout &= ~BRIDGE_BUS_PCI_RETRY_MASK; + + /* + * Clear all pending interrupts. + */ + bridge->b_int_rst_stat = (BRIDGE_IRR_ALL_CLR); + + /* + * Until otherwise set up, + * assume all interrupts are + * from slot 7. + */ + bridge->b_int_device = (uint32_t) 0xffffffff; + + { + bridgereg_t dirmap; + paddr_t paddr; + iopaddr_t xbase; + xwidgetnum_t xport; + iopaddr_t offset; + int num_entries = 0; + int entry; + cnodeid_t cnodeid; + nasid_t nasid; + + /* Set the Bridge's 32-bit PCI to XTalk + * Direct Map register to the most useful + * value we can determine. Note that we + * must use a single xid for all of: + * direct-mapped 32-bit DMA accesses + * direct-mapped 64-bit DMA accesses + * DMA accesses through the PMU + * interrupts + * This is the only way to guarantee that + * completion interrupts will reach a CPU + * after all DMA data has reached memory. + * (Of course, there may be a few special + * drivers/controlers that explicitly manage + * this ordering problem.) + */ + + cnodeid = 0; /* default node id */ + /* + * Determine the base address node id to be used for all 32-bit + * Direct Mapping I/O. The default is node 0, but this can be changed + * via a DEVICE_ADMIN directive and the PCIBUS_DMATRANS_NODE + * attribute in the irix.sm config file. A device driver can obtain + * this node value via a call to pcibr_get_dmatrans_node(). + */ + nasid = COMPACT_TO_NASID_NODEID(cnodeid); + paddr = NODE_OFFSET(nasid) + 0; + + /* currently, we just assume that if we ask + * for a DMA mapping to "zero" the XIO + * host will transmute this into a request + * for the lowest hunk of memory. + */ + xbase = xtalk_dmatrans_addr(xconn_vhdl, 0, + paddr, _PAGESZ, 0); + + if (xbase != XIO_NOWHERE) { + if (XIO_PACKED(xbase)) { + xport = XIO_PORT(xbase); + xbase = XIO_ADDR(xbase); + } else + xport = pcibr_soft->bs_mxid; + + offset = xbase & ((1ull << BRIDGE_DIRMAP_OFF_ADDRSHFT) - 1ull); + xbase >>= BRIDGE_DIRMAP_OFF_ADDRSHFT; + + dirmap = xport << BRIDGE_DIRMAP_W_ID_SHFT; + + if (xbase) + dirmap |= BRIDGE_DIRMAP_OFF & xbase; + else if (offset >= (512 << 20)) + dirmap |= BRIDGE_DIRMAP_ADD512; + + bridge->b_dir_map = dirmap; + } + /* + * Set bridge's idea of page size according to the system's + * idea of "IO page size". TBD: The idea of IO page size + * should really go away. + */ + /* + * ensure that we write and read without any interruption. + * The read following the write is required for the Bridge war + */ + spl_level = splhi(); +#if IOPGSIZE == 4096 + bridge->b_wid_control &= ~BRIDGE_CTRL_PAGE_SIZE; +#elif IOPGSIZE == 16384 + bridge->b_wid_control |= BRIDGE_CTRL_PAGE_SIZE; +#else + <<>>; +#endif + bridge->b_wid_control; /* inval addr bug war */ + splx(spl_level); + + /* Initialize internal mapping entries */ + for (entry = 0; entry < pcibr_soft->bs_int_ate_size; entry++) + bridge->b_int_ate_ram[entry].wr = 0; + + /* + * Determine if there's external mapping SSRAM on this + * bridge. Set up Bridge control register appropriately, + * inititlize SSRAM, and set software up to manage RAM + * entries as an allocatable resource. + * + * Currently, we just use the rm* routines to manage ATE + * allocation. We should probably replace this with a + * Best Fit allocator. + * + * For now, if we have external SSRAM, avoid using + * the internal ssram: we can't turn PREFETCH on + * when we use the internal SSRAM; and besides, + * this also guarantees that no allocation will + * straddle the internal/external line, so we + * can increment ATE write addresses rather than + * recomparing against BRIDGE_INTERNAL_ATES every + * time. + */ + if (is_xbridge(bridge)) + num_entries = 0; + else + num_entries = pcibr_init_ext_ate_ram(bridge); + + /* we always have 128 ATEs (512 for Xbridge) inside the chip + * even if disabled for debugging. + */ + pcibr_soft->bs_int_ate_map = rmallocmap(pcibr_soft->bs_int_ate_size); + pcibr_ate_free(pcibr_soft, 0, pcibr_soft->bs_int_ate_size); +#if PCIBR_ATE_DEBUG + printk("pcibr_attach: %d INTERNAL ATEs\n", pcibr_soft->bs_int_ate_size); +#endif + + if (num_entries > pcibr_soft->bs_int_ate_size) { +#if PCIBR_ATE_NOTBOTH /* for debug -- forces us to use external ates */ + printk("pcibr_attach: disabling internal ATEs.\n"); + pcibr_ate_alloc(pcibr_soft, pcibr_soft->bs_int_ate_size); +#endif + pcibr_soft->bs_ext_ate_map = rmallocmap(num_entries); + pcibr_ate_free(pcibr_soft, pcibr_soft->bs_int_ate_size, + num_entries - pcibr_soft->bs_int_ate_size); +#if PCIBR_ATE_DEBUG + printk("pcibr_attach: %d EXTERNAL ATEs\n", + num_entries - pcibr_soft->bs_int_ate_size); +#endif + } + } + + { + bridgereg_t dirmap; + iopaddr_t xbase; + + /* + * now figure the *real* xtalk base address + * that dirmap sends us to. + */ + dirmap = bridge->b_dir_map; + if (dirmap & BRIDGE_DIRMAP_OFF) + xbase = (iopaddr_t)(dirmap & BRIDGE_DIRMAP_OFF) + << BRIDGE_DIRMAP_OFF_ADDRSHFT; + else if (dirmap & BRIDGE_DIRMAP_ADD512) + xbase = 512 << 20; + else + xbase = 0; + + pcibr_soft->bs_dir_xbase = xbase; + + /* it is entirely possible that we may, at this + * point, have our dirmap pointing somewhere + * other than our "master" port. + */ + pcibr_soft->bs_dir_xport = + (dirmap & BRIDGE_DIRMAP_W_ID) >> BRIDGE_DIRMAP_W_ID_SHFT; + } + + /* pcibr sources an error interrupt; + * figure out where to send it. + * + * If any interrupts are enabled in bridge, + * then the prom set us up and our interrupt + * has already been reconnected in mlreset + * above. + * + * Need to set the D_INTR_ISERR flag + * in the dev_desc used for allocating the + * error interrupt, so our interrupt will + * be properly routed and prioritized. + * + * If our crosstalk provider wants to + * fix widget error interrupts to specific + * destinations, D_INTR_ISERR is how it + * knows to do this. + */ + + xtalk_intr = xtalk_intr_alloc(xconn_vhdl, dev_desc, pcibr_vhdl); + ASSERT(xtalk_intr != NULL); + + pcibr_soft->bsi_err_intr = xtalk_intr; + + /* + * On IP35 with XBridge, we do some extra checks in pcibr_setwidint + * in order to work around some addressing limitations. In order + * for that fire wall to work properly, we need to make sure we + * start from a known clean state. + */ + pcibr_clearwidint(bridge); + + xtalk_intr_connect(xtalk_intr, (xtalk_intr_setfunc_t)pcibr_setwidint, (void *)bridge); + + /* + * now we can start handling error interrupts; + * enable all of them. + * NOTE: some PCI ints may already be enabled. + */ + b_int_enable = bridge->b_int_enable | BRIDGE_ISR_ERRORS; + + + bridge->b_int_enable = b_int_enable; + bridge->b_int_mode = 0; /* do not send "clear interrupt" packets */ + + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + + /* + * Depending on the rev of bridge, disable certain features. + * Easiest way seems to be to force the PCIBR_NOwhatever + * flag to be on for all DMA calls, which overrides any + * PCIBR_whatever flag or even the setting of whatever + * from the PCIIO_DMA_class flags (or even from the other + * PCIBR flags, since NO overrides YES). + */ + pcibr_soft->bs_dma_flags = 0; + + /* PREFETCH: + * Always completely disabled for REV.A; + * at "pcibr_prefetch_enable_rev", anyone + * asking for PCIIO_PREFETCH gets it. + * Between these two points, you have to ask + * for PCIBR_PREFETCH, which promises that + * your driver knows about known Bridge WARs. + */ + if (pcibr_soft->bs_rev_num < BRIDGE_PART_REV_B) + pcibr_soft->bs_dma_flags |= PCIBR_NOPREFETCH; + else if (pcibr_soft->bs_rev_num < + (BRIDGE_WIDGET_PART_NUM << 4 | pcibr_prefetch_enable_rev)) + pcibr_soft->bs_dma_flags |= PCIIO_NOPREFETCH; + + /* WRITE_GATHER: + * Disabled up to but not including the + * rev number in pcibr_wg_enable_rev. There + * is no "WAR range" as with prefetch. + */ + if (pcibr_soft->bs_rev_num < + (BRIDGE_WIDGET_PART_NUM << 4 | pcibr_wg_enable_rev)) + pcibr_soft->bs_dma_flags |= PCIBR_NOWRITE_GATHER; + + pciio_provider_register(pcibr_vhdl, &pcibr_provider); + pciio_provider_startup(pcibr_vhdl); + + pci_io_fb = 0x00000004; /* I/O FreeBlock Base */ + pci_io_fl = 0xFFFFFFFF; /* I/O FreeBlock Last */ + + pci_lo_fb = 0x00000010; /* Low Memory FreeBlock Base */ + pci_lo_fl = 0x001FFFFF; /* Low Memory FreeBlock Last */ + + pci_hi_fb = 0x00200000; /* High Memory FreeBlock Base */ + pci_hi_fl = 0x3FFFFFFF; /* High Memory FreeBlock Last */ + + + PCI_ADDR_SPACE_LIMITS_STORE(); + + /* build "no-slot" connection point + */ + pcibr_info = pcibr_device_info_new + (pcibr_soft, PCIIO_SLOT_NONE, PCIIO_FUNC_NONE, + PCIIO_VENDOR_ID_NONE, PCIIO_DEVICE_ID_NONE); + noslot_conn = pciio_device_info_register + (pcibr_vhdl, &pcibr_info->f_c); + + /* Remember the no slot connection point info for tearing it + * down during detach. + */ + pcibr_soft->bs_noslot_conn = noslot_conn; + pcibr_soft->bs_noslot_info = pcibr_info; +#if PCI_FBBE + fast_back_to_back_enable = 1; +#endif + +#if PCI_FBBE + if (fast_back_to_back_enable) { + /* + * All devices on the bus are capable of fast back to back, so + * we need to set the fast back to back bit in all devices on + * the bus that are capable of doing such accesses. + */ + } +#endif + +#ifdef LATER + /* If the bridge has been reset then there is no need to reset + * the individual PCI slots. + */ + for (slot = 0; slot < 8; ++slot) + /* Reset all the slots */ + (void)pcibr_slot_reset(pcibr_vhdl, slot); +#endif + + for (slot = 0; slot < 8; ++slot) + /* Find out what is out there */ + (void)pcibr_slot_info_init(pcibr_vhdl,slot); + + for (slot = 0; slot < 8; ++slot) + /* Set up the address space for this slot in the pci land */ + (void)pcibr_slot_addr_space_init(pcibr_vhdl,slot); + + for (slot = 0; slot < 8; ++slot) + /* Setup the device register */ + (void)pcibr_slot_device_init(pcibr_vhdl, slot); + +#ifndef __ia64 + for (slot = 0; slot < 8; ++slot) + /* Set up convenience links */ + if (is_xbridge(bridge)) + if (pcibr_soft->bs_slot[slot].bss_ninfo > 0) /* if occupied */ + pcibr_bus_cnvlink(pcibr_info->f_vertex, slot); +#endif + + for (slot = 0; slot < 8; ++slot) + /* Setup host/guest relations */ + (void)pcibr_slot_guest_info_init(pcibr_vhdl,slot); + + for (slot = 0; slot < 8; ++slot) + /* Initial RRB management */ + (void)pcibr_slot_initial_rrb_alloc(pcibr_vhdl,slot); + + /* driver attach routines should be called out from generic linux code */ + for (slot = 0; slot < 8; ++slot) + /* Call the device attach */ + (void)pcibr_slot_call_device_attach(pcibr_vhdl, slot, 0); + + /* + * Each Pbrick PCI bus only has slots 1 and 2. Similarly for + * widget 0xe on Ibricks. Allocate RRB's accordingly. + */ + if (pcibr_soft->bs_moduleid > 0) { + switch (MODULE_GET_BTCHAR(pcibr_soft->bs_moduleid)) { + case 'p': /* Pbrick */ + do_pcibr_rrb_autoalloc(pcibr_soft, 1, 8); + do_pcibr_rrb_autoalloc(pcibr_soft, 2, 8); + break; + case 'i': /* Ibrick */ + /* port 0xe on the Ibrick only has slots 1 and 2 */ + if (pcibr_soft->bs_xid == 0xe) { + do_pcibr_rrb_autoalloc(pcibr_soft, 1, 8); + do_pcibr_rrb_autoalloc(pcibr_soft, 2, 8); + } + else { + /* allocate one RRB for the serial port */ + do_pcibr_rrb_autoalloc(pcibr_soft, 0, 1); + } + break; + } /* switch */ + } + +#ifdef LATER + if (strstr(nicinfo, XTALK_PCI_PART_NUM)) { + do_pcibr_rrb_autoalloc(pcibr_soft, 1, 8); +#if PCIBR_RRB_DEBUG + printf("\n\nFound XTALK_PCI (030-1275) at %v\n", xconn_vhdl); + + printf("pcibr_attach: %v Shoebox RRB MANAGEMENT: %d+%d free\n", + pcibr_vhdl, + pcibr_soft->bs_rrb_avail[0], + pcibr_soft->bs_rrb_avail[1]); + + for (slot = 0; slot < 8; ++slot) + printf("\t%d+%d+%d", + 0xFFF & pcibr_soft->bs_rrb_valid[slot], + 0xFFF & pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL], + pcibr_soft->bs_rrb_res[slot]); + + printf("\n"); +#endif + } +#else + FIXME("pcibr_attach: Call do_pcibr_rrb_autoalloc nicinfo\n"); +#endif + + if (aa) + async_attach_add_info(noslot_conn, aa); + + pciio_device_attach(noslot_conn, 0); + + + /* + * Tear down pointer to async attach info -- async threads for + * bridge's descendants may be running but the bridge's work is done. + */ + if (aa) + async_attach_del_info(xconn_vhdl); + + return 0; +} +/* + * pcibr_detach: + * Detach the bridge device from the hwgraph after cleaning out all the + * underlying vertices. + */ +int +pcibr_detach(devfs_handle_t xconn) +{ + pciio_slot_t slot; + devfs_handle_t pcibr_vhdl; + pcibr_soft_t pcibr_soft; + bridge_t *bridge; + + /* Get the bridge vertex from its xtalk connection point */ + if (hwgraph_traverse(xconn, EDGE_LBL_PCI, &pcibr_vhdl) != GRAPH_SUCCESS) + return(1); + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + bridge = pcibr_soft->bs_base; + + /* Disable the interrupts from the bridge */ + bridge->b_int_enable = 0; + + /* Detach all the PCI devices talking to this bridge */ + for(slot = 0; slot < 8; slot++) { +#ifdef DEBUG + printk("pcibr_device_detach called for %p/%d\n", + pcibr_vhdl,slot); +#endif + pcibr_slot_detach(pcibr_vhdl, slot, 0); + } + + /* Unregister the no-slot connection point */ + pciio_device_info_unregister(pcibr_vhdl, + &(pcibr_soft->bs_noslot_info->f_c)); + + spin_lock_destroy(&pcibr_soft->bs_lock); + kfree(pcibr_soft->bs_name); + + /* Error handler gets unregistered when the widget info is + * cleaned + */ + /* Free the soft ATE maps */ + if (pcibr_soft->bs_int_ate_map) + rmfreemap(pcibr_soft->bs_int_ate_map); + if (pcibr_soft->bs_ext_ate_map) + rmfreemap(pcibr_soft->bs_ext_ate_map); + + /* Disconnect the error interrupt and free the xtalk resources + * associated with it. + */ + xtalk_intr_disconnect(pcibr_soft->bsi_err_intr); + xtalk_intr_free(pcibr_soft->bsi_err_intr); + + /* Clear the software state maintained by the bridge driver for this + * bridge. + */ + DEL(pcibr_soft); + /* Remove the Bridge revision labelled info */ + (void)hwgraph_info_remove_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, NULL); + /* Remove the character device associated with this bridge */ + (void)hwgraph_edge_remove(pcibr_vhdl, EDGE_LBL_CONTROLLER, NULL); + /* Remove the PCI bridge vertex */ + (void)hwgraph_edge_remove(xconn, EDGE_LBL_PCI, NULL); + + return(0); +} + +int +pcibr_asic_rev(devfs_handle_t pconn_vhdl) +{ + devfs_handle_t pcibr_vhdl; + arbitrary_info_t ainfo; + + if (GRAPH_SUCCESS != + hwgraph_traverse(pconn_vhdl, EDGE_LBL_MASTER, &pcibr_vhdl)) + return -1; + + if (GRAPH_SUCCESS != + hwgraph_info_get_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, &ainfo)) + return -1; + + return (int) ainfo; +} + +int +pcibr_write_gather_flush(devfs_handle_t pconn_vhdl) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + pciio_slot_t slot; + slot = pciio_info_slot_get(pciio_info); + pcibr_device_write_gather_flush(pcibr_soft, slot); + return 0; +} + +/* ===================================================================== + * PIO MANAGEMENT + */ + +LOCAL iopaddr_t +pcibr_addr_pci_to_xio(devfs_handle_t pconn_vhdl, + pciio_slot_t slot, + pciio_space_t space, + iopaddr_t pci_addr, + size_t req_size, + unsigned flags) +{ + pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); + pciio_info_t pciio_info = &pcibr_info->f_c; + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + bridge_t *bridge = pcibr_soft->bs_base; + + unsigned bar; /* which BASE reg on device is decoding */ + iopaddr_t xio_addr = XIO_NOWHERE; + + pciio_space_t wspace; /* which space device is decoding */ + iopaddr_t wbase; /* base of device decode on PCI */ + size_t wsize; /* size of device decode on PCI */ + + int try; /* DevIO(x) window scanning order control */ + int win; /* which DevIO(x) window is being used */ + pciio_space_t mspace; /* target space for devio(x) register */ + iopaddr_t mbase; /* base of devio(x) mapped area on PCI */ + size_t msize; /* size of devio(x) mapped area on PCI */ + size_t mmask; /* addr bits stored in Device(x) */ + + unsigned long s; + + s = pcibr_lock(pcibr_soft); + + if (pcibr_soft->bs_slot[slot].has_host) { + slot = pcibr_soft->bs_slot[slot].host_slot; + pcibr_info = pcibr_soft->bs_slot[slot].bss_infos[0]; + } + if (space == PCIIO_SPACE_NONE) + goto done; + + if (space == PCIIO_SPACE_CFG) { + /* + * Usually, the first mapping + * established to a PCI device + * is to its config space. + * + * In any case, we definitely + * do NOT need to worry about + * PCI BASE registers, and + * MUST NOT attempt to point + * the DevIO(x) window at + * this access ... + */ + if (((flags & PCIIO_BYTE_STREAM) == 0) && + ((pci_addr + req_size) <= BRIDGE_TYPE0_CFG_FUNC_OFF)) + xio_addr = pci_addr + BRIDGE_TYPE0_CFG_DEV(slot); + + goto done; + } + if (space == PCIIO_SPACE_ROM) { + /* PIO to the Expansion Rom. + * Driver is responsible for + * enabling and disabling + * decodes properly. + */ + wbase = pcibr_info->f_rbase; + wsize = pcibr_info->f_rsize; + + /* + * While the driver should know better + * than to attempt to map more space + * than the device is decoding, he might + * do it; better to bail out here. + */ + if ((pci_addr + req_size) > wsize) + goto done; + + pci_addr += wbase; + space = PCIIO_SPACE_MEM; + } + /* + * reduce window mappings to raw + * space mappings (maybe allocating + * windows), and try for DevIO(x) + * usage (setting it if it is available). + */ + bar = space - PCIIO_SPACE_WIN0; + if (bar < 6) { + wspace = pcibr_info->f_window[bar].w_space; + if (wspace == PCIIO_SPACE_NONE) + goto done; + + /* get PCI base and size */ + wbase = pcibr_info->f_window[bar].w_base; + wsize = pcibr_info->f_window[bar].w_size; + + /* + * While the driver should know better + * than to attempt to map more space + * than the device is decoding, he might + * do it; better to bail out here. + */ + if ((pci_addr + req_size) > wsize) + goto done; + + /* shift from window relative to + * decoded space relative. + */ + pci_addr += wbase; + space = wspace; + } else + bar = -1; + + /* Scan all the DevIO(x) windows twice looking for one + * that can satisfy our request. The first time through, + * only look at assigned windows; the second time, also + * look at PCIIO_SPACE_NONE windows. Arrange the order + * so we always look at our own window first. + * + * We will not attempt to satisfy a single request + * by concatinating multiple windows. + */ + for (try = 0; try < 16; ++try) { + bridgereg_t devreg; + unsigned offset; + + win = (try + slot) % 8; + + /* If this DevIO(x) mapping area can provide + * a mapping to this address, use it. + */ + msize = (win < 2) ? 0x200000 : 0x100000; + mmask = -msize; + if (space != PCIIO_SPACE_IO) + mmask &= 0x3FFFFFFF; + + offset = pci_addr & (msize - 1); + + /* If this window can't possibly handle that request, + * go on to the next window. + */ + if (((pci_addr & (msize - 1)) + req_size) > msize) + continue; + + devreg = pcibr_soft->bs_slot[win].bss_device; + + /* Is this window "nailed down"? + * If not, maybe we can use it. + * (only check this the second time through) + */ + mspace = pcibr_soft->bs_slot[win].bss_devio.bssd_space; + if ((try > 7) && (mspace == PCIIO_SPACE_NONE)) { + + /* If this is the primary DevIO(x) window + * for some other device, skip it. + */ + if ((win != slot) && + (PCIIO_VENDOR_ID_NONE != + pcibr_soft->bs_slot[win].bss_vendor_id)) + continue; + + /* It's a free window, and we fit in it. + * Set up Device(win) to our taste. + */ + mbase = pci_addr & mmask; + + /* check that we would really get from + * here to there. + */ + if ((mbase | offset) != pci_addr) + continue; + + devreg &= ~BRIDGE_DEV_OFF_MASK; + if (space != PCIIO_SPACE_IO) + devreg |= BRIDGE_DEV_DEV_IO_MEM; + else + devreg &= ~BRIDGE_DEV_DEV_IO_MEM; + devreg |= (mbase >> 20) & BRIDGE_DEV_OFF_MASK; + + /* default is WORD_VALUES. + * if you specify both, + * operation is undefined. + */ + if (flags & PCIIO_BYTE_STREAM) + devreg |= BRIDGE_DEV_DEV_SWAP; + else + devreg &= ~BRIDGE_DEV_DEV_SWAP; + + if (pcibr_soft->bs_slot[win].bss_device != devreg) { + bridge->b_device[win].reg = devreg; + pcibr_soft->bs_slot[win].bss_device = devreg; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + +#if DEBUG && PCI_DEBUG + printk("pcibr Device(%d): 0x%lx\n", win, bridge->b_device[win].reg); +#endif + } + pcibr_soft->bs_slot[win].bss_devio.bssd_space = space; + pcibr_soft->bs_slot[win].bss_devio.bssd_base = mbase; + xio_addr = BRIDGE_DEVIO(win) + (pci_addr - mbase); + +#if DEBUG && PCI_DEBUG + printk("%s LINE %d map to space %d space desc 0x%x[%lx..%lx] for slot %d allocates DevIO(%d) devreg 0x%x\n", + __FUNCTION__, __LINE__, space, space_desc, + pci_addr, pci_addr + req_size - 1, + slot, win, devreg); +#endif + + goto done; + } /* endif DevIO(x) not pointed */ + mbase = pcibr_soft->bs_slot[win].bss_devio.bssd_base; + + /* Now check for request incompat with DevIO(x) + */ + if ((mspace != space) || + (pci_addr < mbase) || + ((pci_addr + req_size) > (mbase + msize)) || + ((flags & PCIIO_BYTE_STREAM) && !(devreg & BRIDGE_DEV_DEV_SWAP)) || + (!(flags & PCIIO_BYTE_STREAM) && (devreg & BRIDGE_DEV_DEV_SWAP))) + continue; + + /* DevIO(x) window is pointed at PCI space + * that includes our target. Calculate the + * final XIO address, release the lock and + * return. + */ + xio_addr = BRIDGE_DEVIO(win) + (pci_addr - mbase); + +#if DEBUG && PCI_DEBUG + printk("%s LINE %d map to space %d [0x%p..0x%p] for slot %d uses DevIO(%d)\n", + __FUNCTION__, __LINE__, space, pci_addr, pci_addr + req_size - 1, slot, win); +#endif + goto done; + } + + switch (space) { + /* + * Accesses to device decode + * areas that do a not fit + * within the DevIO(x) space are + * modified to be accesses via + * the direct mapping areas. + * + * If necessary, drivers can + * explicitly ask for mappings + * into these address spaces, + * but this should never be needed. + */ + case PCIIO_SPACE_MEM: /* "mem space" */ + case PCIIO_SPACE_MEM32: /* "mem, use 32-bit-wide bus" */ + if ((pci_addr + BRIDGE_PCI_MEM32_BASE + req_size - 1) <= + BRIDGE_PCI_MEM32_LIMIT) + xio_addr = pci_addr + BRIDGE_PCI_MEM32_BASE; + break; + + case PCIIO_SPACE_MEM64: /* "mem, use 64-bit-wide bus" */ + if ((pci_addr + BRIDGE_PCI_MEM64_BASE + req_size - 1) <= + BRIDGE_PCI_MEM64_LIMIT) + xio_addr = pci_addr + BRIDGE_PCI_MEM64_BASE; + break; + + case PCIIO_SPACE_IO: /* "i/o space" */ + /* Bridge Hardware Bug WAR #482741: + * The 4G area that maps directly from + * XIO space to PCI I/O space is busted + * until Bridge Rev D. + */ + if ((pcibr_soft->bs_rev_num > BRIDGE_PART_REV_C) && + ((pci_addr + BRIDGE_PCI_IO_BASE + req_size - 1) <= + BRIDGE_PCI_IO_LIMIT)) + xio_addr = pci_addr + BRIDGE_PCI_IO_BASE; + break; + } + + /* Check that "Direct PIO" byteswapping matches, + * try to change it if it does not. + */ + if (xio_addr != XIO_NOWHERE) { + unsigned bst; /* nonzero to set bytestream */ + unsigned *bfp; /* addr of record of how swapper is set */ + unsigned swb; /* which control bit to mung */ + unsigned bfo; /* current swapper setting */ + unsigned bfn; /* desired swapper setting */ + + bfp = ((space == PCIIO_SPACE_IO) + ? (&pcibr_soft->bs_pio_end_io) + : (&pcibr_soft->bs_pio_end_mem)); + + bfo = *bfp; + + bst = flags & PCIIO_BYTE_STREAM; + + bfn = bst ? PCIIO_BYTE_STREAM : PCIIO_WORD_VALUES; + + if (bfn == bfo) { /* we already match. */ + ; + } else if (bfo != 0) { /* we have a conflict. */ +#if DEBUG && PCI_DEBUG + printk("pcibr_addr_pci_to_xio: swap conflict in space %d , was%s%s, want%s%s\n", + space, + bfo & PCIIO_BYTE_STREAM ? " BYTE_STREAM" : "", + bfo & PCIIO_WORD_VALUES ? " WORD_VALUES" : "", + bfn & PCIIO_BYTE_STREAM ? " BYTE_STREAM" : "", + bfn & PCIIO_WORD_VALUES ? " WORD_VALUES" : ""); +#endif + xio_addr = XIO_NOWHERE; + } else { /* OK to make the change. */ + bridgereg_t octl, nctl; + + swb = (space == PCIIO_SPACE_IO) ? BRIDGE_CTRL_IO_SWAP : BRIDGE_CTRL_MEM_SWAP; + octl = bridge->b_wid_control; + nctl = bst ? octl | swb : octl & ~swb; + + if (octl != nctl) /* make the change if any */ + bridge->b_wid_control = nctl; + + *bfp = bfn; /* record the assignment */ + +#if DEBUG && PCI_DEBUG + printk("pcibr_addr_pci_to_xio: swap for space %d set to%s%s\n", + space, + bfn & PCIIO_BYTE_STREAM ? " BYTE_STREAM" : "", + bfn & PCIIO_WORD_VALUES ? " WORD_VALUES" : ""); +#endif + } + } + done: + pcibr_unlock(pcibr_soft, s); + return xio_addr; +} + +/*ARGSUSED6 */ +pcibr_piomap_t +pcibr_piomap_alloc(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + pciio_space_t space, + iopaddr_t pci_addr, + size_t req_size, + size_t req_size_max, + unsigned flags) +{ + pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); + pciio_info_t pciio_info = &pcibr_info->f_c; + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + + pcibr_piomap_t *mapptr; + pcibr_piomap_t maplist; + pcibr_piomap_t pcibr_piomap; + iopaddr_t xio_addr; + xtalk_piomap_t xtalk_piomap; + unsigned long s; + + /* Make sure that the req sizes are non-zero */ + if ((req_size < 1) || (req_size_max < 1)) + return NULL; + + /* + * Code to translate slot/space/addr + * into xio_addr is common between + * this routine and pcibr_piotrans_addr. + */ + xio_addr = pcibr_addr_pci_to_xio(pconn_vhdl, pciio_slot, space, pci_addr, req_size, flags); + + if (xio_addr == XIO_NOWHERE) + return NULL; + + /* Check the piomap list to see if there is already an allocated + * piomap entry but not in use. If so use that one. Otherwise + * allocate a new piomap entry and add it to the piomap list + */ + mapptr = &(pcibr_info->f_piomap); + + s = pcibr_lock(pcibr_soft); + for (pcibr_piomap = *mapptr; + pcibr_piomap != NULL; + pcibr_piomap = pcibr_piomap->bp_next) { + if (pcibr_piomap->bp_mapsz == 0) + break; + } + + if (pcibr_piomap) + mapptr = NULL; + else { + pcibr_unlock(pcibr_soft, s); + NEW(pcibr_piomap); + } + + pcibr_piomap->bp_dev = pconn_vhdl; + pcibr_piomap->bp_slot = pciio_slot; + pcibr_piomap->bp_flags = flags; + pcibr_piomap->bp_space = space; + pcibr_piomap->bp_pciaddr = pci_addr; + pcibr_piomap->bp_mapsz = req_size; + pcibr_piomap->bp_soft = pcibr_soft; + pcibr_piomap->bp_toc[0] = ATOMIC_INIT(0); + + if (mapptr) { + s = pcibr_lock(pcibr_soft); + maplist = *mapptr; + pcibr_piomap->bp_next = maplist; + *mapptr = pcibr_piomap; + } + pcibr_unlock(pcibr_soft, s); + + + if (pcibr_piomap) { + xtalk_piomap = + xtalk_piomap_alloc(xconn_vhdl, 0, + xio_addr, + req_size, req_size_max, + flags & PIOMAP_FLAGS); + if (xtalk_piomap) { + pcibr_piomap->bp_xtalk_addr = xio_addr; + pcibr_piomap->bp_xtalk_pio = xtalk_piomap; + } else { + pcibr_piomap->bp_mapsz = 0; + pcibr_piomap = 0; + } + } + return pcibr_piomap; +} + +/*ARGSUSED */ +void +pcibr_piomap_free(pcibr_piomap_t pcibr_piomap) +{ + xtalk_piomap_free(pcibr_piomap->bp_xtalk_pio); + pcibr_piomap->bp_xtalk_pio = 0; + pcibr_piomap->bp_mapsz = 0; +} + +/*ARGSUSED */ +caddr_t +pcibr_piomap_addr(pcibr_piomap_t pcibr_piomap, + iopaddr_t pci_addr, + size_t req_size) +{ + return xtalk_piomap_addr(pcibr_piomap->bp_xtalk_pio, + pcibr_piomap->bp_xtalk_addr + + pci_addr - pcibr_piomap->bp_pciaddr, + req_size); +} + +/*ARGSUSED */ +void +pcibr_piomap_done(pcibr_piomap_t pcibr_piomap) +{ + xtalk_piomap_done(pcibr_piomap->bp_xtalk_pio); +} + +/*ARGSUSED */ +caddr_t +pcibr_piotrans_addr(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + pciio_space_t space, + iopaddr_t pci_addr, + size_t req_size, + unsigned flags) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + + iopaddr_t xio_addr; + + xio_addr = pcibr_addr_pci_to_xio(pconn_vhdl, pciio_slot, space, pci_addr, req_size, flags); + + if (xio_addr == XIO_NOWHERE) + return NULL; + + return xtalk_piotrans_addr(xconn_vhdl, 0, xio_addr, req_size, flags & PIOMAP_FLAGS); +} + +/* + * PIO Space allocation and management. + * Allocate and Manage the PCI PIO space (mem and io space) + * This routine is pretty simplistic at this time, and + * does pretty trivial management of allocation and freeing.. + * The current scheme is prone for fragmentation.. + * Change the scheme to use bitmaps. + */ + +/*ARGSUSED */ +iopaddr_t +pcibr_piospace_alloc(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + pciio_space_t space, + size_t req_size, + size_t alignment) +{ + pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); + pciio_info_t pciio_info = &pcibr_info->f_c; + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + + pciio_piospace_t piosp; + unsigned long s; + + iopaddr_t *pciaddr, *pcilast; + iopaddr_t start_addr; + size_t align_mask; + + /* + * Check for proper alignment + */ + ASSERT(alignment >= NBPP); + ASSERT((alignment & (alignment - 1)) == 0); + + align_mask = alignment - 1; + s = pcibr_lock(pcibr_soft); + + /* + * First look if a previously allocated chunk exists. + */ + if ((piosp = pcibr_info->f_piospace)) { + /* + * Look through the list for a right sized free chunk. + */ + do { + if (piosp->free && + (piosp->space == space) && + (piosp->count >= req_size) && + !(piosp->start & align_mask)) { + piosp->free = 0; + pcibr_unlock(pcibr_soft, s); + return piosp->start; + } + piosp = piosp->next; + } while (piosp); + } + ASSERT(!piosp); + + switch (space) { + case PCIIO_SPACE_IO: + pciaddr = &pcibr_soft->bs_spinfo.pci_io_base; + pcilast = &pcibr_soft->bs_spinfo.pci_io_last; + break; + case PCIIO_SPACE_MEM: + case PCIIO_SPACE_MEM32: + pciaddr = &pcibr_soft->bs_spinfo.pci_mem_base; + pcilast = &pcibr_soft->bs_spinfo.pci_mem_last; + break; + default: + ASSERT(0); + pcibr_unlock(pcibr_soft, s); + return 0; + } + + start_addr = *pciaddr; + + /* + * Align start_addr. + */ + if (start_addr & align_mask) + start_addr = (start_addr + align_mask) & ~align_mask; + + if ((start_addr + req_size) > *pcilast) { + /* + * If too big a request, reject it. + */ + pcibr_unlock(pcibr_soft, s); + return 0; + } + *pciaddr = (start_addr + req_size); + + NEW(piosp); + piosp->free = 0; + piosp->space = space; + piosp->start = start_addr; + piosp->count = req_size; + piosp->next = pcibr_info->f_piospace; + pcibr_info->f_piospace = piosp; + + pcibr_unlock(pcibr_soft, s); + return start_addr; +} + +/*ARGSUSED */ +void +pcibr_piospace_free(devfs_handle_t pconn_vhdl, + pciio_space_t space, + iopaddr_t pciaddr, + size_t req_size) +{ + pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pcibr_info->f_mfast; + + pciio_piospace_t piosp; + unsigned long s; + char name[1024]; + + /* + * Look through the bridge data structures for the pciio_piospace_t + * structure corresponding to 'pciaddr' + */ + s = pcibr_lock(pcibr_soft); + piosp = pcibr_info->f_piospace; + while (piosp) { + /* + * Piospace free can only be for the complete + * chunk and not parts of it.. + */ + if (piosp->start == pciaddr) { + if (piosp->count == req_size) + break; + /* + * Improper size passed for freeing.. + * Print a message and break; + */ + hwgraph_vertex_name_get(pconn_vhdl, name, 1024); + printk(KERN_WARNING "pcibr_piospace_free: error"); + printk(KERN_WARNING "Device %s freeing size (0x%lx) different than allocated (0x%lx)", + name, req_size, piosp->count); + printk(KERN_WARNING "Freeing 0x%lx instead", piosp->count); + break; + } + piosp = piosp->next; + } + + if (!piosp) { + printk(KERN_WARNING + "pcibr_piospace_free: Address 0x%lx size 0x%lx - No match\n", + pciaddr, req_size); + pcibr_unlock(pcibr_soft, s); + return; + } + piosp->free = 1; + pcibr_unlock(pcibr_soft, s); + return; +} + +/* ===================================================================== + * DMA MANAGEMENT + * + * The Bridge ASIC provides three methods of doing + * DMA: via a "direct map" register available in + * 32-bit PCI space (which selects a contiguous 2G + * address space on some other widget), via + * "direct" addressing via 64-bit PCI space (all + * destination information comes from the PCI + * address, including transfer attributes), and via + * a "mapped" region that allows a bunch of + * different small mappings to be established with + * the PMU. + * + * For efficiency, we most prefer to use the 32-bit + * direct mapping facility, since it requires no + * resource allocations. The advantage of using the + * PMU over the 64-bit direct is that single-cycle + * PCI addressing can be used; the advantage of + * using 64-bit direct over PMU addressing is that + * we do not have to allocate entries in the PMU. + */ + +/* + * Convert PCI-generic software flags and Bridge-specific software flags + * into Bridge-specific Direct Map attribute bits. + */ +LOCAL iopaddr_t +pcibr_flags_to_d64(unsigned flags, pcibr_soft_t pcibr_soft) +{ + iopaddr_t attributes = 0; + + /* Sanity check: Bridge only allows use of VCHAN1 via 64-bit addrs */ +#ifdef LATER + ASSERT_ALWAYS(!(flags & PCIBR_VCHAN1) || (flags & PCIIO_DMA_A64)); +#endif + + /* Generic macro flags + */ + if (flags & PCIIO_DMA_DATA) { /* standard data channel */ + attributes &= ~PCI64_ATTR_BAR; /* no barrier bit */ + attributes |= PCI64_ATTR_PREF; /* prefetch on */ + } + if (flags & PCIIO_DMA_CMD) { /* standard command channel */ + attributes |= PCI64_ATTR_BAR; /* barrier bit on */ + attributes &= ~PCI64_ATTR_PREF; /* disable prefetch */ + } + /* Generic detail flags + */ + if (flags & PCIIO_PREFETCH) + attributes |= PCI64_ATTR_PREF; + if (flags & PCIIO_NOPREFETCH) + attributes &= ~PCI64_ATTR_PREF; + + /* the swap bit is in the address attributes for xbridge */ + if (pcibr_soft->bs_xbridge) { + if (flags & PCIIO_BYTE_STREAM) + attributes |= PCI64_ATTR_SWAP; + if (flags & PCIIO_WORD_VALUES) + attributes &= ~PCI64_ATTR_SWAP; + } + + /* Provider-specific flags + */ + if (flags & PCIBR_BARRIER) + attributes |= PCI64_ATTR_BAR; + if (flags & PCIBR_NOBARRIER) + attributes &= ~PCI64_ATTR_BAR; + + if (flags & PCIBR_PREFETCH) + attributes |= PCI64_ATTR_PREF; + if (flags & PCIBR_NOPREFETCH) + attributes &= ~PCI64_ATTR_PREF; + + if (flags & PCIBR_PRECISE) + attributes |= PCI64_ATTR_PREC; + if (flags & PCIBR_NOPRECISE) + attributes &= ~PCI64_ATTR_PREC; + + if (flags & PCIBR_VCHAN1) + attributes |= PCI64_ATTR_VIRTUAL; + if (flags & PCIBR_VCHAN0) + attributes &= ~PCI64_ATTR_VIRTUAL; + + return (attributes); +} + +/* + * Convert PCI-generic software flags and Bridge-specific software flags + * into Bridge-specific Address Translation Entry attribute bits. + */ +LOCAL bridge_ate_t +pcibr_flags_to_ate(unsigned flags) +{ + bridge_ate_t attributes; + + /* default if nothing specified: + * NOBARRIER + * NOPREFETCH + * NOPRECISE + * COHERENT + * Plus the valid bit + */ + attributes = ATE_CO | ATE_V; + + /* Generic macro flags + */ + if (flags & PCIIO_DMA_DATA) { /* standard data channel */ + attributes &= ~ATE_BAR; /* no barrier */ + attributes |= ATE_PREF; /* prefetch on */ + } + if (flags & PCIIO_DMA_CMD) { /* standard command channel */ + attributes |= ATE_BAR; /* barrier bit on */ + attributes &= ~ATE_PREF; /* disable prefetch */ + } + /* Generic detail flags + */ + if (flags & PCIIO_PREFETCH) + attributes |= ATE_PREF; + if (flags & PCIIO_NOPREFETCH) + attributes &= ~ATE_PREF; + + /* Provider-specific flags + */ + if (flags & PCIBR_BARRIER) + attributes |= ATE_BAR; + if (flags & PCIBR_NOBARRIER) + attributes &= ~ATE_BAR; + + if (flags & PCIBR_PREFETCH) + attributes |= ATE_PREF; + if (flags & PCIBR_NOPREFETCH) + attributes &= ~ATE_PREF; + + if (flags & PCIBR_PRECISE) + attributes |= ATE_PREC; + if (flags & PCIBR_NOPRECISE) + attributes &= ~ATE_PREC; + + return (attributes); +} + +/*ARGSUSED */ +pcibr_dmamap_t +pcibr_dmamap_alloc(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + size_t req_size_max, + unsigned flags) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + pciio_slot_t slot; + xwidgetnum_t xio_port; + + xtalk_dmamap_t xtalk_dmamap; + pcibr_dmamap_t pcibr_dmamap; + int ate_count; + int ate_index; + + /* merge in forced flags */ + flags |= pcibr_soft->bs_dma_flags; + +#ifdef IRIX + NEWf(pcibr_dmamap, flags); +#else + /* + * On SNIA64, these maps are pre-allocated because pcibr_dmamap_alloc() + * can be called within an interrupt thread. + */ + pcibr_dmamap = (pcibr_dmamap_t)get_free_pciio_dmamap(pcibr_soft->bs_vhdl); +#endif + + if (!pcibr_dmamap) + return 0; + + xtalk_dmamap = xtalk_dmamap_alloc(xconn_vhdl, dev_desc, req_size_max, + flags & DMAMAP_FLAGS); + if (!xtalk_dmamap) { +#if PCIBR_ATE_DEBUG + printk("pcibr_attach: xtalk_dmamap_alloc failed\n"); +#endif +#ifdef IRIX + DEL(pcibr_dmamap); +#else + free_pciio_dmamap(pcibr_dmamap); +#endif + return 0; + } + xio_port = pcibr_soft->bs_mxid; + slot = pciio_info_slot_get(pciio_info); + + pcibr_dmamap->bd_dev = pconn_vhdl; + pcibr_dmamap->bd_slot = slot; + pcibr_dmamap->bd_soft = pcibr_soft; + pcibr_dmamap->bd_xtalk = xtalk_dmamap; + pcibr_dmamap->bd_max_size = req_size_max; + pcibr_dmamap->bd_xio_port = xio_port; + + if (flags & PCIIO_DMA_A64) { + if (!pcibr_try_set_device(pcibr_soft, slot, flags, BRIDGE_DEV_D64_BITS)) { + iopaddr_t pci_addr; + int have_rrbs; + int min_rrbs; + + /* Device is capable of A64 operations, + * and the attributes of the DMA are + * consistant with any previous DMA + * mappings using shared resources. + */ + + pci_addr = pcibr_flags_to_d64(flags, pcibr_soft); + + pcibr_dmamap->bd_flags = flags; + pcibr_dmamap->bd_xio_addr = 0; + pcibr_dmamap->bd_pci_addr = pci_addr; + + /* Make sure we have an RRB (or two). + */ + if (!(pcibr_soft->bs_rrb_fixed & (1 << slot))) { + if (flags & PCIBR_VCHAN1) + slot += PCIBR_RRB_SLOT_VIRTUAL; + have_rrbs = pcibr_soft->bs_rrb_valid[slot]; + if (have_rrbs < 2) { + if (pci_addr & PCI64_ATTR_PREF) + min_rrbs = 2; + else + min_rrbs = 1; + if (have_rrbs < min_rrbs) + do_pcibr_rrb_autoalloc(pcibr_soft, slot, min_rrbs - have_rrbs); + } + } +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: using direct64\n"); +#endif + return pcibr_dmamap; + } +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: unable to use direct64\n"); +#endif + flags &= ~PCIIO_DMA_A64; + } + if (flags & PCIIO_FIXED) { + /* warning: mappings may fail later, + * if direct32 can't get to the address. + */ + if (!pcibr_try_set_device(pcibr_soft, slot, flags, BRIDGE_DEV_D32_BITS)) { + /* User desires DIRECT A32 operations, + * and the attributes of the DMA are + * consistant with any previous DMA + * mappings using shared resources. + * Mapping calls may fail if target + * is outside the direct32 range. + */ +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: using direct32\n"); +#endif + pcibr_dmamap->bd_flags = flags; + pcibr_dmamap->bd_xio_addr = pcibr_soft->bs_dir_xbase; + pcibr_dmamap->bd_pci_addr = PCI32_DIRECT_BASE; + return pcibr_dmamap; + } +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: unable to use direct32\n"); +#endif + /* If the user demands FIXED and we can't + * give it to him, fail. + */ + xtalk_dmamap_free(xtalk_dmamap); +#ifdef IRIX + DEL(pcibr_dmamap); +#else + free_pciio_dmamap(pcibr_dmamap); +#endif + return 0; + } + /* + * Allocate Address Translation Entries from the mapping RAM. + * Unless the PCIBR_NO_ATE_ROUNDUP flag is specified, + * the maximum number of ATEs is based on the worst-case + * scenario, where the requested target is in the + * last byte of an ATE; thus, mapping IOPGSIZE+2 + * does end up requiring three ATEs. + */ + if (!(flags & PCIBR_NO_ATE_ROUNDUP)) { + ate_count = IOPG((IOPGSIZE - 1) /* worst case start offset */ + +req_size_max /* max mapping bytes */ + - 1) + 1; /* round UP */ + } else { /* assume requested target is page aligned */ + ate_count = IOPG(req_size_max /* max mapping bytes */ + - 1) + 1; /* round UP */ + } + + ate_index = pcibr_ate_alloc(pcibr_soft, ate_count); + + if (ate_index != -1) { + if (!pcibr_try_set_device(pcibr_soft, slot, flags, BRIDGE_DEV_PMU_BITS)) { + bridge_ate_t ate_proto; + int have_rrbs; + int min_rrbs; + +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: using PMU\n"); +#endif + + ate_proto = pcibr_flags_to_ate(flags); + + pcibr_dmamap->bd_flags = flags; + pcibr_dmamap->bd_pci_addr = + PCI32_MAPPED_BASE + IOPGSIZE * ate_index; + /* + * for xbridge the byte-swap bit == bit 29 of PCI address + */ + if (pcibr_soft->bs_xbridge) { + if (flags & PCIIO_BYTE_STREAM) + ATE_SWAP_ON(pcibr_dmamap->bd_pci_addr); + /* + * If swap was set in bss_device in pcibr_endian_set() + * we need to change the address bit. + */ + if (pcibr_soft->bs_slot[slot].bss_device & + BRIDGE_DEV_SWAP_PMU) + ATE_SWAP_ON(pcibr_dmamap->bd_pci_addr); + if (flags & PCIIO_WORD_VALUES) + ATE_SWAP_OFF(pcibr_dmamap->bd_pci_addr); + } + pcibr_dmamap->bd_xio_addr = 0; + pcibr_dmamap->bd_ate_ptr = pcibr_ate_addr(pcibr_soft, ate_index); + pcibr_dmamap->bd_ate_index = ate_index; + pcibr_dmamap->bd_ate_count = ate_count; + pcibr_dmamap->bd_ate_proto = ate_proto; + + /* Make sure we have an RRB (or two). + */ + if (!(pcibr_soft->bs_rrb_fixed & (1 << slot))) { + have_rrbs = pcibr_soft->bs_rrb_valid[slot]; + if (have_rrbs < 2) { + if (ate_proto & ATE_PREF) + min_rrbs = 2; + else + min_rrbs = 1; + if (have_rrbs < min_rrbs) + do_pcibr_rrb_autoalloc(pcibr_soft, slot, min_rrbs - have_rrbs); + } + } + if (ate_index >= pcibr_soft->bs_int_ate_size && + !pcibr_soft->bs_xbridge) { + bridge_t *bridge = pcibr_soft->bs_base; + volatile unsigned *cmd_regp; + unsigned cmd_reg; + unsigned long s; + + pcibr_dmamap->bd_flags |= PCIBR_DMAMAP_SSRAM; + + s = pcibr_lock(pcibr_soft); + cmd_regp = &(bridge-> + b_type0_cfg_dev[slot]. + l[PCI_CFG_COMMAND / 4]); + cmd_reg = *cmd_regp; + pcibr_soft->bs_slot[slot].bss_cmd_pointer = cmd_regp; + pcibr_soft->bs_slot[slot].bss_cmd_shadow = cmd_reg; + pcibr_unlock(pcibr_soft, s); + } + return pcibr_dmamap; + } +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: unable to use PMU\n"); +#endif + pcibr_ate_free(pcibr_soft, ate_index, ate_count); + } + /* total failure: sorry, you just can't + * get from here to there that way. + */ +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: complete failure.\n"); +#endif + xtalk_dmamap_free(xtalk_dmamap); +#ifdef IRIX + DEL(pcibr_dmamap); +#else + free_pciio_dmamap(pcibr_dmamap); +#endif + return 0; +} + +/*ARGSUSED */ +void +pcibr_dmamap_free(pcibr_dmamap_t pcibr_dmamap) +{ + pcibr_soft_t pcibr_soft = pcibr_dmamap->bd_soft; + pciio_slot_t slot = pcibr_dmamap->bd_slot; + + unsigned flags = pcibr_dmamap->bd_flags; + + /* Make sure that bss_ext_ates_active + * is properly kept up to date. + */ + + if (PCIBR_DMAMAP_BUSY & flags) + if (PCIBR_DMAMAP_SSRAM & flags) + atomic_dec(&(pcibr_soft->bs_slot[slot]. bss_ext_ates_active)); + + xtalk_dmamap_free(pcibr_dmamap->bd_xtalk); + + if (pcibr_dmamap->bd_flags & PCIIO_DMA_A64) { + pcibr_release_device(pcibr_soft, slot, BRIDGE_DEV_D64_BITS); + } + if (pcibr_dmamap->bd_ate_count) { + pcibr_ate_free(pcibr_dmamap->bd_soft, + pcibr_dmamap->bd_ate_index, + pcibr_dmamap->bd_ate_count); + pcibr_release_device(pcibr_soft, slot, BRIDGE_DEV_PMU_BITS); + } +#ifdef IRIX + DEL(pcibr_dmamap); +#else + free_pciio_dmamap(pcibr_dmamap); +#endif +} + +/* + * Setup an Address Translation Entry as specified. Use either the Bridge + * internal maps or the external map RAM, as appropriate. + */ +LOCAL bridge_ate_p +pcibr_ate_addr(pcibr_soft_t pcibr_soft, + int ate_index) +{ + bridge_t *bridge = pcibr_soft->bs_base; + + return (ate_index < pcibr_soft->bs_int_ate_size) + ? &(bridge->b_int_ate_ram[ate_index].wr) + : &(bridge->b_ext_ate_ram[ate_index]); +} + +/* + * pcibr_addr_xio_to_pci: given a PIO range, hand + * back the corresponding base PCI MEM address; + * this is used to short-circuit DMA requests that + * loop back onto this PCI bus. + */ +LOCAL iopaddr_t +pcibr_addr_xio_to_pci(pcibr_soft_t soft, + iopaddr_t xio_addr, + size_t req_size) +{ + iopaddr_t xio_lim = xio_addr + req_size - 1; + iopaddr_t pci_addr; + pciio_slot_t slot; + + if ((xio_addr >= BRIDGE_PCI_MEM32_BASE) && + (xio_lim <= BRIDGE_PCI_MEM32_LIMIT)) { + pci_addr = xio_addr - BRIDGE_PCI_MEM32_BASE; + return pci_addr; + } + if ((xio_addr >= BRIDGE_PCI_MEM64_BASE) && + (xio_lim <= BRIDGE_PCI_MEM64_LIMIT)) { + pci_addr = xio_addr - BRIDGE_PCI_MEM64_BASE; + return pci_addr; + } + for (slot = 0; slot < 8; ++slot) + if ((xio_addr >= BRIDGE_DEVIO(slot)) && + (xio_lim < BRIDGE_DEVIO(slot + 1))) { + bridgereg_t dev; + + dev = soft->bs_slot[slot].bss_device; + pci_addr = dev & BRIDGE_DEV_OFF_MASK; + pci_addr <<= BRIDGE_DEV_OFF_ADDR_SHFT; + pci_addr += xio_addr - BRIDGE_DEVIO(slot); + return (dev & BRIDGE_DEV_DEV_IO_MEM) ? pci_addr : PCI_NOWHERE; + } + return 0; +} + +/* We are starting to get more complexity + * surrounding writing ATEs, so pull + * the writing code into this new function. + */ + +#if PCIBR_FREEZE_TIME +#define ATE_FREEZE() s = ate_freeze(pcibr_dmamap, &freeze_time, cmd_regs) +#else +#define ATE_FREEZE() s = ate_freeze(pcibr_dmamap, cmd_regs) +#endif + +LOCAL unsigned +ate_freeze(pcibr_dmamap_t pcibr_dmamap, +#if PCIBR_FREEZE_TIME + unsigned *freeze_time_ptr, +#endif + unsigned *cmd_regs) +{ + pcibr_soft_t pcibr_soft = pcibr_dmamap->bd_soft; +#ifdef LATER + int dma_slot = pcibr_dmamap->bd_slot; +#endif + int ext_ates = pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM; + int slot; + + unsigned long s; + unsigned cmd_reg; + volatile unsigned *cmd_lwa; + unsigned cmd_lwd; + + if (!ext_ates) + return 0; + + /* Bridge Hardware Bug WAR #484930: + * Bridge can't handle updating External ATEs + * while DMA is occuring that uses External ATEs, + * even if the particular ATEs involved are disjoint. + */ + + /* need to prevent anyone else from + * unfreezing the grant while we + * are working; also need to prevent + * this thread from being interrupted + * to keep PCI grant freeze time + * at an absolute minimum. + */ + s = pcibr_lock(pcibr_soft); + +#ifdef LATER + /* just in case pcibr_dmamap_done was not called */ + if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_BUSY) { + pcibr_dmamap->bd_flags &= ~PCIBR_DMAMAP_BUSY; + if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM) + atomic_dec(&(pcibr_soft->bs_slot[dma_slot]. bss_ext_ates_active)); + xtalk_dmamap_done(pcibr_dmamap->bd_xtalk); + } +#endif /* LATER */ +#if PCIBR_FREEZE_TIME + *freeze_time_ptr = get_timestamp(); +#endif + + cmd_lwa = 0; + for (slot = 0; slot < 8; ++slot) + if (atomic_read(&pcibr_soft->bs_slot[slot].bss_ext_ates_active)) { + cmd_reg = pcibr_soft-> + bs_slot[slot]. + bss_cmd_shadow; + if (cmd_reg & PCI_CMD_BUS_MASTER) { + cmd_lwa = pcibr_soft-> + bs_slot[slot]. + bss_cmd_pointer; + cmd_lwd = cmd_reg ^ PCI_CMD_BUS_MASTER; + cmd_lwa[0] = cmd_lwd; + } + cmd_regs[slot] = cmd_reg; + } else + cmd_regs[slot] = 0; + + if (cmd_lwa) { + bridge_t *bridge = pcibr_soft->bs_base; + + /* Read the last master bit that has been cleared. This PIO read + * on the PCI bus is to ensure the completion of any DMAs that + * are due to bus requests issued by PCI devices before the + * clearing of master bits. + */ + cmd_lwa[0]; + + /* Flush all the write buffers in the bridge */ + for (slot = 0; slot < 8; ++slot) + if (atomic_read(&pcibr_soft->bs_slot[slot].bss_ext_ates_active)) { + /* Flush the write buffer associated with this + * PCI device which might be using dma map RAM. + */ + bridge->b_wr_req_buf[slot].reg; + } + } + return s; +} + +#define ATE_WRITE() ate_write(ate_ptr, ate_count, ate) + +LOCAL void +ate_write(bridge_ate_p ate_ptr, + int ate_count, + bridge_ate_t ate) +{ + while (ate_count-- > 0) { + *ate_ptr++ = ate; + ate += IOPGSIZE; + } +} + + +#if PCIBR_FREEZE_TIME +#define ATE_THAW() ate_thaw(pcibr_dmamap, ate_index, ate, ate_total, freeze_time, cmd_regs, s) +#else +#define ATE_THAW() ate_thaw(pcibr_dmamap, ate_index, cmd_regs, s) +#endif + +LOCAL void +ate_thaw(pcibr_dmamap_t pcibr_dmamap, + int ate_index, +#if PCIBR_FREEZE_TIME + bridge_ate_t ate, + int ate_total, + unsigned freeze_time_start, +#endif + unsigned *cmd_regs, + unsigned s) +{ + pcibr_soft_t pcibr_soft = pcibr_dmamap->bd_soft; + int dma_slot = pcibr_dmamap->bd_slot; + int slot; + bridge_t *bridge = pcibr_soft->bs_base; + int ext_ates = pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM; + + unsigned cmd_reg; + +#if PCIBR_FREEZE_TIME + unsigned freeze_time; + static unsigned max_freeze_time = 0; + static unsigned max_ate_total; +#endif + + if (!ext_ates) + return; + + /* restore cmd regs */ + for (slot = 0; slot < 8; ++slot) + if ((cmd_reg = cmd_regs[slot]) & PCI_CMD_BUS_MASTER) + bridge->b_type0_cfg_dev[slot].l[PCI_CFG_COMMAND / 4] = cmd_reg; + + pcibr_dmamap->bd_flags |= PCIBR_DMAMAP_BUSY; + atomic_inc(&(pcibr_soft->bs_slot[dma_slot]. bss_ext_ates_active)); + +#if PCIBR_FREEZE_TIME + freeze_time = get_timestamp() - freeze_time_start; + + if ((max_freeze_time < freeze_time) || + (max_ate_total < ate_total)) { + if (max_freeze_time < freeze_time) + max_freeze_time = freeze_time; + if (max_ate_total < ate_total) + max_ate_total = ate_total; + pcibr_unlock(pcibr_soft, s); + printk("%s: pci freeze time %d usec for %d ATEs\n" + "\tfirst ate: %R\n", + pcibr_soft->bs_name, + freeze_time * 1000 / 1250, + ate_total, + ate, ate_bits); + } else +#endif + pcibr_unlock(pcibr_soft, s); +} + +/*ARGSUSED */ +iopaddr_t +pcibr_dmamap_addr(pcibr_dmamap_t pcibr_dmamap, + paddr_t paddr, + size_t req_size) +{ + pcibr_soft_t pcibr_soft; + iopaddr_t xio_addr; + xwidgetnum_t xio_port; + iopaddr_t pci_addr; + unsigned flags; + + ASSERT(pcibr_dmamap != NULL); + ASSERT(req_size > 0); + ASSERT(req_size <= pcibr_dmamap->bd_max_size); + + pcibr_soft = pcibr_dmamap->bd_soft; + + flags = pcibr_dmamap->bd_flags; + + xio_addr = xtalk_dmamap_addr(pcibr_dmamap->bd_xtalk, paddr, req_size); + if (XIO_PACKED(xio_addr)) { + xio_port = XIO_PORT(xio_addr); + xio_addr = XIO_ADDR(xio_addr); + } else + xio_port = pcibr_dmamap->bd_xio_port; + + /* If this DMA is to an address that + * refers back to this Bridge chip, + * reduce it back to the correct + * PCI MEM address. + */ + if (xio_port == pcibr_soft->bs_xid) { + pci_addr = pcibr_addr_xio_to_pci(pcibr_soft, xio_addr, req_size); + } else if (flags & PCIIO_DMA_A64) { + /* A64 DMA: + * always use 64-bit direct mapping, + * which always works. + * Device(x) was set up during + * dmamap allocation. + */ + + /* attributes are already bundled up into bd_pci_addr. + */ + pci_addr = pcibr_dmamap->bd_pci_addr + | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT) + | xio_addr; + + /* Bridge Hardware WAR #482836: + * If the transfer is not cache aligned + * and the Bridge Rev is <= B, force + * prefetch to be off. + */ + if (flags & PCIBR_NOPREFETCH) + pci_addr &= ~PCI64_ATTR_PREF; + +#if DEBUG && PCIBR_DMA_DEBUG + printk("pcibr_dmamap_addr (direct64):\n" + "\twanted paddr [0x%x..0x%x]\n" + "\tXIO port 0x%x offset 0x%x\n" + "\treturning PCI 0x%x\n", + paddr, paddr + req_size - 1, + xio_port, xio_addr, pci_addr); +#endif + } else if (flags & PCIIO_FIXED) { + /* A32 direct DMA: + * always use 32-bit direct mapping, + * which may fail. + * Device(x) was set up during + * dmamap allocation. + */ + + if (xio_port != pcibr_soft->bs_dir_xport) + pci_addr = 0; /* wrong DIDN */ + else if (xio_addr < pcibr_dmamap->bd_xio_addr) + pci_addr = 0; /* out of range */ + else if ((xio_addr + req_size) > + (pcibr_dmamap->bd_xio_addr + BRIDGE_DMA_DIRECT_SIZE)) + pci_addr = 0; /* out of range */ + else + pci_addr = pcibr_dmamap->bd_pci_addr + + xio_addr - pcibr_dmamap->bd_xio_addr; + +#if DEBUG && PCIBR_DMA_DEBUG + printk("pcibr_dmamap_addr (direct32):\n" + "\twanted paddr [0x%x..0x%x]\n" + "\tXIO port 0x%x offset 0x%x\n" + "\treturning PCI 0x%x\n", + paddr, paddr + req_size - 1, + xio_port, xio_addr, pci_addr); +#endif + } else { + bridge_t *bridge = pcibr_soft->bs_base; + iopaddr_t offset = IOPGOFF(xio_addr); + bridge_ate_t ate_proto = pcibr_dmamap->bd_ate_proto; + int ate_count = IOPG(offset + req_size - 1) + 1; + + int ate_index = pcibr_dmamap->bd_ate_index; + unsigned cmd_regs[8]; + unsigned s; + +#if PCIBR_FREEZE_TIME + int ate_total = ate_count; + unsigned freeze_time; +#endif + +#if PCIBR_ATE_DEBUG + bridge_ate_t ate_cmp; + bridge_ate_p ate_cptr; + unsigned ate_lo, ate_hi; + int ate_bad = 0; + int ate_rbc = 0; +#endif + bridge_ate_p ate_ptr = pcibr_dmamap->bd_ate_ptr; + bridge_ate_t ate; + + /* Bridge Hardware WAR #482836: + * If the transfer is not cache aligned + * and the Bridge Rev is <= B, force + * prefetch to be off. + */ + if (flags & PCIBR_NOPREFETCH) + ate_proto &= ~ATE_PREF; + + ate = ate_proto + | (xio_port << ATE_TIDSHIFT) + | (xio_addr - offset); + + pci_addr = pcibr_dmamap->bd_pci_addr + offset; + + /* Fill in our mapping registers + * with the appropriate xtalk data, + * and hand back the PCI address. + */ + + ASSERT(ate_count > 0); + if (ate_count <= pcibr_dmamap->bd_ate_count) { + ATE_FREEZE(); + ATE_WRITE(); + ATE_THAW(); + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + } else { + /* The number of ATE's required is greater than the number + * allocated for this map. One way this can happen is if + * pcibr_dmamap_alloc() was called with the PCIBR_NO_ATE_ROUNDUP + * flag, and then when that map is used (right now), the + * target address tells us we really did need to roundup. + * The other possibility is that the map is just plain too + * small to handle the requested target area. + */ +#if PCIBR_ATE_DEBUG + printk(KERN_WARNING "pcibr_dmamap_addr :\n" + "\twanted paddr [0x%x..0x%x]\n" + "\tate_count 0x%x bd_ate_count 0x%x\n" + "\tATE's required > number allocated\n", + paddr, paddr + req_size - 1, + ate_count, pcibr_dmamap->bd_ate_count); +#endif + pci_addr = 0; + } + + } + return pci_addr; +} + +/*ARGSUSED */ +alenlist_t +pcibr_dmamap_list(pcibr_dmamap_t pcibr_dmamap, + alenlist_t palenlist, + unsigned flags) +{ + pcibr_soft_t pcibr_soft; + bridge_t *bridge=NULL; + + unsigned al_flags = (flags & PCIIO_NOSLEEP) ? AL_NOSLEEP : 0; + int inplace = flags & PCIIO_INPLACE; + + alenlist_t pciio_alenlist = 0; + alenlist_t xtalk_alenlist; + size_t length; + iopaddr_t offset; + unsigned direct64; + int ate_index = 0; + int ate_count = 0; + int ate_total = 0; + bridge_ate_p ate_ptr = (bridge_ate_p)0; + bridge_ate_t ate_proto = (bridge_ate_t)0; + bridge_ate_t ate_prev; + bridge_ate_t ate; + alenaddr_t xio_addr; + xwidgetnum_t xio_port; + iopaddr_t pci_addr; + alenaddr_t new_addr; + + unsigned cmd_regs[8]; + unsigned s = 0; + +#if PCIBR_FREEZE_TIME + unsigned freeze_time; +#endif + int ate_freeze_done = 0; /* To pair ATE_THAW + * with an ATE_FREEZE + */ + + pcibr_soft = pcibr_dmamap->bd_soft; + + xtalk_alenlist = xtalk_dmamap_list(pcibr_dmamap->bd_xtalk, palenlist, + flags & DMAMAP_FLAGS); + if (!xtalk_alenlist) + goto fail; + + alenlist_cursor_init(xtalk_alenlist, 0, NULL); + + if (inplace) { + pciio_alenlist = xtalk_alenlist; + } else { + pciio_alenlist = alenlist_create(al_flags); + if (!pciio_alenlist) + goto fail; + } + + direct64 = pcibr_dmamap->bd_flags & PCIIO_DMA_A64; + if (!direct64) { + bridge = pcibr_soft->bs_base; + ate_ptr = pcibr_dmamap->bd_ate_ptr; + ate_index = pcibr_dmamap->bd_ate_index; + ate_proto = pcibr_dmamap->bd_ate_proto; + ATE_FREEZE(); + ate_freeze_done = 1; /* Remember that we need to do an ATE_THAW */ + } + pci_addr = pcibr_dmamap->bd_pci_addr; + + ate_prev = 0; /* matches no valid ATEs */ + while (ALENLIST_SUCCESS == + alenlist_get(xtalk_alenlist, NULL, 0, + &xio_addr, &length, al_flags)) { + if (XIO_PACKED(xio_addr)) { + xio_port = XIO_PORT(xio_addr); + xio_addr = XIO_ADDR(xio_addr); + } else + xio_port = pcibr_dmamap->bd_xio_port; + + if (xio_port == pcibr_soft->bs_xid) { + new_addr = pcibr_addr_xio_to_pci(pcibr_soft, xio_addr, length); + if (new_addr == PCI_NOWHERE) + goto fail; + } else if (direct64) { + new_addr = pci_addr | xio_addr + | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); + + /* Bridge Hardware WAR #482836: + * If the transfer is not cache aligned + * and the Bridge Rev is <= B, force + * prefetch to be off. + */ + if (flags & PCIBR_NOPREFETCH) + new_addr &= ~PCI64_ATTR_PREF; + + } else { + /* calculate the ate value for + * the first address. If it + * matches the previous + * ATE written (ie. we had + * multiple blocks in the + * same IOPG), then back up + * and reuse that ATE. + * + * We are NOT going to + * aggressively try to + * reuse any other ATEs. + */ + offset = IOPGOFF(xio_addr); + ate = ate_proto + | (xio_port << ATE_TIDSHIFT) + | (xio_addr - offset); + if (ate == ate_prev) { +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_list: ATE share\n"); +#endif + ate_ptr--; + ate_index--; + pci_addr -= IOPGSIZE; + } + new_addr = pci_addr + offset; + + /* Fill in the hardware ATEs + * that contain this block. + */ + ate_count = IOPG(offset + length - 1) + 1; + ate_total += ate_count; + + /* Ensure that this map contains enough ATE's */ + if (ate_total > pcibr_dmamap->bd_ate_count) { +#if PCIBR_ATE_DEBUG + printk(KERN_WARNING "pcibr_dmamap_list :\n" + "\twanted xio_addr [0x%x..0x%x]\n" + "\tate_total 0x%x bd_ate_count 0x%x\n" + "\tATE's required > number allocated\n", + xio_addr, xio_addr + length - 1, + ate_total, pcibr_dmamap->bd_ate_count); +#endif + goto fail; + } + + ATE_WRITE(); + + ate_index += ate_count; + ate_ptr += ate_count; + + ate_count <<= IOPFNSHIFT; + ate += ate_count; + pci_addr += ate_count; + } + + /* write the PCI DMA address + * out to the scatter-gather list. + */ + if (inplace) { + if (ALENLIST_SUCCESS != + alenlist_replace(pciio_alenlist, NULL, + &new_addr, &length, al_flags)) + goto fail; + } else { + if (ALENLIST_SUCCESS != + alenlist_append(pciio_alenlist, + new_addr, length, al_flags)) + goto fail; + } + } + if (!inplace) + alenlist_done(xtalk_alenlist); + + /* Reset the internal cursor of the alenlist to be returned back + * to the caller. + */ + alenlist_cursor_init(pciio_alenlist, 0, NULL); + + + /* In case an ATE_FREEZE was done do the ATE_THAW to unroll all the + * changes that ATE_FREEZE has done to implement the external SSRAM + * bug workaround. + */ + if (ate_freeze_done) { + ATE_THAW(); + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + } + return pciio_alenlist; + + fail: + /* There are various points of failure after doing an ATE_FREEZE + * We need to do an ATE_THAW. Otherwise the ATEs are locked forever. + * The decision to do an ATE_THAW needs to be based on whether a + * an ATE_FREEZE was done before. + */ + if (ate_freeze_done) { + ATE_THAW(); + bridge->b_wid_tflush; + } + if (pciio_alenlist && !inplace) + alenlist_destroy(pciio_alenlist); + return 0; +} + +/*ARGSUSED */ +void +pcibr_dmamap_done(pcibr_dmamap_t pcibr_dmamap) +{ + /* + * We could go through and invalidate ATEs here; + * for performance reasons, we don't. + * We also don't enforce the strict alternation + * between _addr/_list and _done, but Hub does. + */ + + if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_BUSY) { + pcibr_dmamap->bd_flags &= ~PCIBR_DMAMAP_BUSY; + + if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM) + atomic_dec(&(pcibr_dmamap->bd_soft->bs_slot[pcibr_dmamap->bd_slot]. bss_ext_ates_active)); + } + + xtalk_dmamap_done(pcibr_dmamap->bd_xtalk); +} + + +/* + * For each bridge, the DIR_OFF value in the Direct Mapping Register + * determines the PCI to Crosstalk memory mapping to be used for all + * 32-bit Direct Mapping memory accesses. This mapping can be to any + * node in the system. This function will return that compact node id. + */ + +/*ARGSUSED */ +cnodeid_t +pcibr_get_dmatrans_node(devfs_handle_t pconn_vhdl) +{ + + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + + return(NASID_TO_COMPACT_NODEID(NASID_GET(pcibr_soft->bs_dir_xbase))); +} + +/*ARGSUSED */ +iopaddr_t +pcibr_dmatrans_addr(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + paddr_t paddr, + size_t req_size, + unsigned flags) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_slot_t slotp = &pcibr_soft->bs_slot[pciio_slot]; + + xwidgetnum_t xio_port; + iopaddr_t xio_addr; + iopaddr_t pci_addr; + + int have_rrbs; + int min_rrbs; + + /* merge in forced flags */ + flags |= pcibr_soft->bs_dma_flags; + + xio_addr = xtalk_dmatrans_addr(xconn_vhdl, 0, paddr, req_size, + flags & DMAMAP_FLAGS); + + if (!xio_addr) { +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + return 0; + } + /* + * find which XIO port this goes to. + */ + if (XIO_PACKED(xio_addr)) { + if (xio_addr == XIO_NOWHERE) { +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + return 0; + } + xio_port = XIO_PORT(xio_addr); + xio_addr = XIO_ADDR(xio_addr); + + } else + xio_port = pcibr_soft->bs_mxid; + + /* + * If this DMA comes back to us, + * return the PCI MEM address on + * which it would land, or NULL + * if the target is something + * on bridge other than PCI MEM. + */ + if (xio_port == pcibr_soft->bs_xid) { + pci_addr = pcibr_addr_xio_to_pci(pcibr_soft, xio_addr, req_size); + return pci_addr; + } + /* If the caller can use A64, try to + * satisfy the request with the 64-bit + * direct map. This can fail if the + * configuration bits in Device(x) + * conflict with our flags. + */ + + if (flags & PCIIO_DMA_A64) { + pci_addr = slotp->bss_d64_base; + if (!(flags & PCIBR_VCHAN1)) + flags |= PCIBR_VCHAN0; + if ((pci_addr != PCIBR_D64_BASE_UNSET) && + (flags == slotp->bss_d64_flags)) { + + pci_addr |= xio_addr + | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); + +#if DEBUG && PCIBR_DMA_DEBUG +#if HWG_PERF_CHECK + if (xio_addr != 0x20000000) +#endif + printk("pcibr_dmatrans_addr: [reuse]\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tdirect 64bit address is 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr, pci_addr); +#endif + return (pci_addr); + } + if (!pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D64_BITS)) { + pci_addr = pcibr_flags_to_d64(flags, pcibr_soft); + slotp->bss_d64_flags = flags; + slotp->bss_d64_base = pci_addr; + pci_addr |= xio_addr + | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); + + /* Make sure we have an RRB (or two). + */ + if (!(pcibr_soft->bs_rrb_fixed & (1 << pciio_slot))) { + if (flags & PCIBR_VCHAN1) + pciio_slot += PCIBR_RRB_SLOT_VIRTUAL; + have_rrbs = pcibr_soft->bs_rrb_valid[pciio_slot]; + if (have_rrbs < 2) { + if (pci_addr & PCI64_ATTR_PREF) + min_rrbs = 2; + else + min_rrbs = 1; + if (have_rrbs < min_rrbs) + do_pcibr_rrb_autoalloc(pcibr_soft, pciio_slot, min_rrbs - have_rrbs); + } + } +#if PCIBR_DMA_DEBUG +#if HWG_PERF_CHECK + if (xio_addr != 0x20000000) +#endif + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tdirect 64bit address is 0x%x\n" + "\tnew flags: 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr, pci_addr, (uint64_t) flags); +#endif + return (pci_addr); + } + /* our flags conflict with Device(x). + */ + flags = flags + & ~PCIIO_DMA_A64 + & ~PCIBR_VCHAN0 + ; + +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tUnable to set Device(x) bits for Direct-64\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + } + /* Try to satisfy the request with the 32-bit direct + * map. This can fail if the configuration bits in + * Device(x) conflict with our flags, or if the + * target address is outside where DIR_OFF points. + */ + { + size_t map_size = 1ULL << 31; + iopaddr_t xio_base = pcibr_soft->bs_dir_xbase; + iopaddr_t offset = xio_addr - xio_base; + iopaddr_t endoff = req_size + offset; + + if ((req_size > map_size) || + (xio_addr < xio_base) || + (xio_port != pcibr_soft->bs_dir_xport) || + (endoff > map_size)) { +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\txio region outside direct32 target\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + } else { + pci_addr = slotp->bss_d32_base; + if ((pci_addr != PCIBR_D32_BASE_UNSET) && + (flags == slotp->bss_d32_flags)) { + + pci_addr |= offset; + +#if DEBUG && PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr: [reuse]\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tmapped via direct32 offset 0x%x\n" + "\twill DMA via pci addr 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr, offset, pci_addr); +#endif + return (pci_addr); + } + if (!pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D32_BITS)) { + + pci_addr = PCI32_DIRECT_BASE; + slotp->bss_d32_flags = flags; + slotp->bss_d32_base = pci_addr; + pci_addr |= offset; + + /* Make sure we have an RRB (or two). + */ + if (!(pcibr_soft->bs_rrb_fixed & (1 << pciio_slot))) { + have_rrbs = pcibr_soft->bs_rrb_valid[pciio_slot]; + if (have_rrbs < 2) { + if (slotp->bss_device & BRIDGE_DEV_PREF) + min_rrbs = 2; + else + min_rrbs = 1; + if (have_rrbs < min_rrbs) + do_pcibr_rrb_autoalloc(pcibr_soft, pciio_slot, min_rrbs - have_rrbs); + } + } +#if PCIBR_DMA_DEBUG +#if HWG_PERF_CHECK + if (xio_addr != 0x20000000) +#endif + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tmapped via direct32 offset 0x%x\n" + "\twill DMA via pci addr 0x%x\n" + "\tnew flags: 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr, offset, pci_addr, (uint64_t) flags); +#endif + return (pci_addr); + } + /* our flags conflict with Device(x). + */ +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tUnable to set Device(x) bits for Direct-32\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + } + } + +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tno acceptable PCI address found or constructable\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + + return 0; +} + +/*ARGSUSED */ +alenlist_t +pcibr_dmatrans_list(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + alenlist_t palenlist, + unsigned flags) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_slot_t slotp = &pcibr_soft->bs_slot[pciio_slot]; + xwidgetnum_t xio_port; + + alenlist_t pciio_alenlist = 0; + alenlist_t xtalk_alenlist = 0; + + int inplace; + unsigned direct64; + unsigned al_flags; + + iopaddr_t xio_base; + alenaddr_t xio_addr; + size_t xio_size; + + size_t map_size; + iopaddr_t pci_base; + alenaddr_t pci_addr; + + unsigned relbits = 0; + + /* merge in forced flags */ + flags |= pcibr_soft->bs_dma_flags; + + inplace = flags & PCIIO_INPLACE; + direct64 = flags & PCIIO_DMA_A64; + al_flags = (flags & PCIIO_NOSLEEP) ? AL_NOSLEEP : 0; + + if (direct64) { + map_size = 1ull << 48; + xio_base = 0; + pci_base = slotp->bss_d64_base; + if ((pci_base != PCIBR_D64_BASE_UNSET) && + (flags == slotp->bss_d64_flags)) { + /* reuse previous base info */ + } else if (pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D64_BITS) < 0) { + /* DMA configuration conflict */ + goto fail; + } else { + relbits = BRIDGE_DEV_D64_BITS; + pci_base = + pcibr_flags_to_d64(flags, pcibr_soft); + } + } else { + xio_base = pcibr_soft->bs_dir_xbase; + map_size = 1ull << 31; + pci_base = slotp->bss_d32_base; + if ((pci_base != PCIBR_D32_BASE_UNSET) && + (flags == slotp->bss_d32_flags)) { + /* reuse previous base info */ + } else if (pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D32_BITS) < 0) { + /* DMA configuration conflict */ + goto fail; + } else { + relbits = BRIDGE_DEV_D32_BITS; + pci_base = PCI32_DIRECT_BASE; + } + } + + xtalk_alenlist = xtalk_dmatrans_list(xconn_vhdl, 0, palenlist, + flags & DMAMAP_FLAGS); + if (!xtalk_alenlist) + goto fail; + + alenlist_cursor_init(xtalk_alenlist, 0, NULL); + + if (inplace) { + pciio_alenlist = xtalk_alenlist; + } else { + pciio_alenlist = alenlist_create(al_flags); + if (!pciio_alenlist) + goto fail; + } + + while (ALENLIST_SUCCESS == + alenlist_get(xtalk_alenlist, NULL, 0, + &xio_addr, &xio_size, al_flags)) { + + /* + * find which XIO port this goes to. + */ + if (XIO_PACKED(xio_addr)) { + if (xio_addr == XIO_NOWHERE) { +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + return 0; + } + xio_port = XIO_PORT(xio_addr); + xio_addr = XIO_ADDR(xio_addr); + } else + xio_port = pcibr_soft->bs_mxid; + + /* + * If this DMA comes back to us, + * return the PCI MEM address on + * which it would land, or NULL + * if the target is something + * on bridge other than PCI MEM. + */ + if (xio_port == pcibr_soft->bs_xid) { + pci_addr = pcibr_addr_xio_to_pci(pcibr_soft, xio_addr, xio_size); + if ( (pci_addr == (alenaddr_t)NULL) ) + goto fail; + } else if (direct64) { + ASSERT(xio_port != 0); + pci_addr = pci_base | xio_addr + | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); + } else { + iopaddr_t offset = xio_addr - xio_base; + iopaddr_t endoff = xio_size + offset; + + if ((xio_size > map_size) || + (xio_addr < xio_base) || + (xio_port != pcibr_soft->bs_dir_xport) || + (endoff > map_size)) + goto fail; + + pci_addr = pci_base + (xio_addr - xio_base); + } + + /* write the PCI DMA address + * out to the scatter-gather list. + */ + if (inplace) { + if (ALENLIST_SUCCESS != + alenlist_replace(pciio_alenlist, NULL, + &pci_addr, &xio_size, al_flags)) + goto fail; + } else { + if (ALENLIST_SUCCESS != + alenlist_append(pciio_alenlist, + pci_addr, xio_size, al_flags)) + goto fail; + } + } + + if (relbits) { + if (direct64) { + slotp->bss_d64_flags = flags; + slotp->bss_d64_base = pci_base; + } else { + slotp->bss_d32_flags = flags; + slotp->bss_d32_base = pci_base; + } + } + if (!inplace) + alenlist_done(xtalk_alenlist); + + /* Reset the internal cursor of the alenlist to be returned back + * to the caller. + */ + alenlist_cursor_init(pciio_alenlist, 0, NULL); + return pciio_alenlist; + + fail: + if (relbits) + pcibr_release_device(pcibr_soft, pciio_slot, relbits); + if (pciio_alenlist && !inplace) + alenlist_destroy(pciio_alenlist); + return 0; +} + +void +pcibr_dmamap_drain(pcibr_dmamap_t map) +{ + xtalk_dmamap_drain(map->bd_xtalk); +} + +void +pcibr_dmaaddr_drain(devfs_handle_t pconn_vhdl, + paddr_t paddr, + size_t bytes) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + + xtalk_dmaaddr_drain(xconn_vhdl, paddr, bytes); +} + +void +pcibr_dmalist_drain(devfs_handle_t pconn_vhdl, + alenlist_t list) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + + xtalk_dmalist_drain(xconn_vhdl, list); +} + +/* + * Get the starting PCIbus address out of the given DMA map. + * This function is supposed to be used by a close friend of PCI bridge + * since it relies on the fact that the starting address of the map is fixed at + * the allocation time in the current implementation of PCI bridge. + */ +iopaddr_t +pcibr_dmamap_pciaddr_get(pcibr_dmamap_t pcibr_dmamap) +{ + return (pcibr_dmamap->bd_pci_addr); +} + +/* + * There are end cases where a deadlock can occur if interrupt + * processing completes and the Bridge b_int_status bit is still set. + * + * One scenerio is if a second PCI interrupt occurs within 60ns of + * the previous interrupt being cleared. In this case the Bridge + * does not detect the transition, the Bridge b_int_status bit + * remains set, and because no transition was detected no interrupt + * packet is sent to the Hub/Heart. + * + * A second scenerio is possible when a b_int_status bit is being + * shared by multiple devices: + * Device #1 generates interrupt + * Bridge b_int_status bit set + * Device #2 generates interrupt + * interrupt processing begins + * ISR for device #1 runs and + * clears interrupt + * Device #1 generates interrupt + * ISR for device #2 runs and + * clears interrupt + * (b_int_status bit still set) + * interrupt processing completes + * + * Interrupt processing is now complete, but an interrupt is still + * outstanding for Device #1. But because there was no transition of + * the b_int_status bit, no interrupt packet will be generated and + * a deadlock will occur. + * + * To avoid these deadlock situations, this function is used + * to check if a specific Bridge b_int_status bit is set, and if so, + * cause the setting of the corresponding interrupt bit. + * + * On a XBridge (IP35), we do this by writing the appropriate Bridge Force + * Interrupt register. + */ +void +pcibr_force_interrupt(pcibr_intr_wrap_t wrap) +{ + unsigned bit; + pcibr_soft_t pcibr_soft = wrap->iw_soft; + bridge_t *bridge = pcibr_soft->bs_base; + cpuid_t cpuvertex_to_cpuid(devfs_handle_t vhdl); + + bit = wrap->iw_intr; + + if (pcibr_soft->bs_xbridge) { + bridge->b_force_pin[bit].intr = 1; + } else if ((1 << bit) & *wrap->iw_stat) { + cpuid_t cpu; + unsigned intr_bit; + xtalk_intr_t xtalk_intr = + pcibr_soft->bs_intr[bit].bsi_xtalk_intr; + + intr_bit = (short) xtalk_intr_vector_get(xtalk_intr); + cpu = cpuvertex_to_cpuid(xtalk_intr_cpu_get(xtalk_intr)); +#if defined(CONFIG_IA64_SGI_SN1) + REMOTE_CPU_SEND_INTR(cpu, intr_bit); +#endif + } +} + +/* ===================================================================== + * INTERRUPT MANAGEMENT + */ + +static unsigned +pcibr_intr_bits(pciio_info_t info, + pciio_intr_line_t lines) +{ + pciio_slot_t slot = pciio_info_slot_get(info); + unsigned bbits = 0; + + /* + * Currently favored mapping from PCI + * slot number and INTA/B/C/D to Bridge + * PCI Interrupt Bit Number: + * + * SLOT A B C D + * 0 0 4 0 4 + * 1 1 5 1 5 + * 2 2 6 2 6 + * 3 3 7 3 7 + * 4 4 0 4 0 + * 5 5 1 5 1 + * 6 6 2 6 2 + * 7 7 3 7 3 + */ + + if (slot < 8) { + if (lines & (PCIIO_INTR_LINE_A| PCIIO_INTR_LINE_C)) + bbits |= 1 << slot; + if (lines & (PCIIO_INTR_LINE_B| PCIIO_INTR_LINE_D)) + bbits |= 1 << (slot ^ 4); + } + return bbits; +} + + +/*ARGSUSED */ +pcibr_intr_t +pcibr_intr_alloc(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + pciio_intr_line_t lines, + devfs_handle_t owner_dev) +{ + pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pcibr_info->f_slot; + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pcibr_info->f_mfast; + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + bridge_t *bridge = pcibr_soft->bs_base; + int is_threaded = 0; + int thread_swlevel; + + xtalk_intr_t *xtalk_intr_p; + pcibr_intr_t *pcibr_intr_p; + pcibr_intr_list_t *intr_list_p; + + unsigned pcibr_int_bits; + unsigned pcibr_int_bit; + xtalk_intr_t xtalk_intr = (xtalk_intr_t)0; + hub_intr_t hub_intr; + pcibr_intr_t pcibr_intr; + pcibr_intr_list_t intr_entry; + pcibr_intr_list_t intr_list; + bridgereg_t int_dev; + +#if DEBUG && INTR_DEBUG + printk("%v: pcibr_intr_alloc\n" + "%v:%s%s%s%s%s\n", + owner_dev, pconn_vhdl, + !(lines & 15) ? " No INTs?" : "", + lines & 1 ? " INTA" : "", + lines & 2 ? " INTB" : "", + lines & 4 ? " INTC" : "", + lines & 8 ? " INTD" : ""); +#endif + + NEW(pcibr_intr); + if (!pcibr_intr) + return NULL; + + if (dev_desc) { + cpuid_t intr_target_from_desc(device_desc_t, int); + } else { + extern int default_intr_pri; + + is_threaded = 1; /* PCI interrupts are threaded, by default */ + thread_swlevel = default_intr_pri; + } + + pcibr_intr->bi_dev = pconn_vhdl; + pcibr_intr->bi_lines = lines; + pcibr_intr->bi_soft = pcibr_soft; + pcibr_intr->bi_ibits = 0; /* bits will be added below */ + pcibr_intr->bi_flags = is_threaded ? 0 : PCIIO_INTR_NOTHREAD; + pcibr_intr->bi_mustruncpu = CPU_NONE; + mutex_spinlock_init(&pcibr_intr->bi_ibuf.ib_lock); + + pcibr_int_bits = pcibr_soft->bs_intr_bits((pciio_info_t)pcibr_info, lines); + + + /* + * For each PCI interrupt line requested, figure + * out which Bridge PCI Interrupt Line it maps + * to, and make sure there are xtalk resources + * allocated for it. + */ +#if DEBUG && INTR_DEBUG + printk("pcibr_int_bits: 0x%X\n", pcibr_int_bits); +#endif + for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit ++) { + if (pcibr_int_bits & (1 << pcibr_int_bit)) { + xtalk_intr_p = &pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr; + + xtalk_intr = *xtalk_intr_p; + + if (xtalk_intr == NULL) { + /* + * This xtalk_intr_alloc is constrained for two reasons: + * 1) Normal interrupts and error interrupts need to be delivered + * through a single xtalk target widget so that there aren't any + * ordering problems with DMA, completion interrupts, and error + * interrupts. (Use of xconn_vhdl forces this.) + * + * 2) On IP35, addressing constraints on IP35 and Bridge force + * us to use a single PI number for all interrupts from a + * single Bridge. (IP35-specific code forces this, and we + * verify in pcibr_setwidint.) + */ + + /* + * All code dealing with threaded PCI interrupt handlers + * is located at the pcibr level. Because of this, + * we always want the lower layers (hub/heart_intr_alloc, + * intr_level_connect) to treat us as non-threaded so we + * don't set up a duplicate threaded environment. We make + * this happen by calling a special xtalk interface. + */ + xtalk_intr = xtalk_intr_alloc_nothd(xconn_vhdl, dev_desc, + owner_dev); +#if DEBUG && INTR_DEBUG + printk("%v: xtalk_intr=0x%X\n", xconn_vhdl, xtalk_intr); +#endif + + /* both an assert and a runtime check on this: + * we need to check in non-DEBUG kernels, and + * the ASSERT gets us more information when + * we use DEBUG kernels. + */ + ASSERT(xtalk_intr != NULL); + if (xtalk_intr == NULL) { + /* it is quite possible that our + * xtalk_intr_alloc failed because + * someone else got there first, + * and we can find their results + * in xtalk_intr_p. + */ + if (!*xtalk_intr_p) { +#ifdef SUPPORT_PRINTING_V_FORMAT + printk(KERN_ALERT + "pcibr_intr_alloc %v: unable to get xtalk interrupt resources", + xconn_vhdl); +#else + printk(KERN_ALERT + "pcibr_intr_alloc 0x%p: unable to get xtalk interrupt resources", + (void *)xconn_vhdl); +#endif + /* yes, we leak resources here. */ + return 0; + } + } else if (compare_and_swap_ptr((void **) xtalk_intr_p, NULL, xtalk_intr)) { + /* + * now tell the bridge which slot is + * using this interrupt line. + */ + int_dev = bridge->b_int_device; + int_dev &= ~BRIDGE_INT_DEV_MASK(pcibr_int_bit); + int_dev |= pciio_slot << BRIDGE_INT_DEV_SHFT(pcibr_int_bit); + bridge->b_int_device = int_dev; /* XXXMP */ + +#if DEBUG && INTR_DEBUG + printk("%v: bridge intr bit %d clears my wrb\n", + pconn_vhdl, pcibr_int_bit); +#endif + } else { + /* someone else got one allocated first; + * free the one we just created, and + * retrieve the one they allocated. + */ + xtalk_intr_free(xtalk_intr); + xtalk_intr = *xtalk_intr_p; +#if PARANOID + /* once xtalk_intr is set, we never clear it, + * so if the CAS fails above, this condition + * can "never happen" ... + */ + if (!xtalk_intr) { + printk(KERN_ALERT + "pcibr_intr_alloc %v: unable to set xtalk interrupt resources", + xconn_vhdl); + /* yes, we leak resources here. */ + return 0; + } +#endif + } + } + + pcibr_intr->bi_ibits |= 1 << pcibr_int_bit; + + NEW(intr_entry); + intr_entry->il_next = NULL; + intr_entry->il_intr = pcibr_intr; + intr_entry->il_wrbf = &(bridge->b_wr_req_buf[pciio_slot].reg); + intr_list_p = + &pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_list; +#if DEBUG && INTR_DEBUG +#if defined(SUPPORT_PRINTING_V_FORMAT) + printk("0x%x: Bridge bit %d wrap=0x%x\n", + pconn_vhdl, pcibr_int_bit, + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap); +#else + printk("%v: Bridge bit %d wrap=0x%x\n", + pconn_vhdl, pcibr_int_bit, + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap); +#endif +#endif + + if (compare_and_swap_ptr((void **) intr_list_p, NULL, intr_entry)) { + /* we are the first interrupt on this bridge bit. + */ +#if DEBUG && INTR_DEBUG + printk("%v INT 0x%x (bridge bit %d) allocated [FIRST]\n", + pconn_vhdl, pcibr_int_bits, pcibr_int_bit); +#endif + continue; + } + intr_list = *intr_list_p; + pcibr_intr_p = &intr_list->il_intr; + if (compare_and_swap_ptr((void **) pcibr_intr_p, NULL, pcibr_intr)) { + /* first entry on list was erased, + * and we replaced it, so we + * don't need our intr_entry. + */ + DEL(intr_entry); +#if DEBUG && INTR_DEBUG + printk("%v INT 0x%x (bridge bit %d) replaces erased first\n", + pconn_vhdl, pcibr_int_bits, pcibr_int_bit); +#endif + continue; + } + intr_list_p = &intr_list->il_next; + if (compare_and_swap_ptr((void **) intr_list_p, NULL, intr_entry)) { + /* we are the new second interrupt on this bit. + */ + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared = 1; +#if DEBUG && INTR_DEBUG + printk("%v INT 0x%x (bridge bit %d) is new SECOND\n", + pconn_vhdl, pcibr_int_bits, pcibr_int_bit); +#endif + continue; + } + while (1) { + pcibr_intr_p = &intr_list->il_intr; + if (compare_and_swap_ptr((void **) pcibr_intr_p, NULL, pcibr_intr)) { + /* an entry on list was erased, + * and we replaced it, so we + * don't need our intr_entry. + */ + DEL(intr_entry); +#if DEBUG && INTR_DEBUG + printk("%v INT 0x%x (bridge bit %d) replaces erased Nth\n", + pconn_vhdl, pcibr_int_bits, pcibr_int_bit); +#endif + break; + } + intr_list_p = &intr_list->il_next; + if (compare_and_swap_ptr((void **) intr_list_p, NULL, intr_entry)) { + /* entry appended to share list + */ +#if DEBUG && INTR_DEBUG + printk("%v INT 0x%x (bridge bit %d) is new Nth\n", + pconn_vhdl, pcibr_int_bits, pcibr_int_bit); +#endif + break; + } + /* step to next record in chain + */ + intr_list = *intr_list_p; + } + } + } + +#if DEBUG && INTR_DEBUG + printk("%v pcibr_intr_alloc complete\n", pconn_vhdl); +#endif + hub_intr = (hub_intr_t)xtalk_intr; + pcibr_intr->bi_irq = hub_intr->i_bit; + pcibr_intr->bi_cpu = hub_intr->i_cpuid; + return pcibr_intr; +} + +/*ARGSUSED */ +void +pcibr_intr_free(pcibr_intr_t pcibr_intr) +{ + unsigned pcibr_int_bits = pcibr_intr->bi_ibits; + pcibr_soft_t pcibr_soft = pcibr_intr->bi_soft; + unsigned pcibr_int_bit; + pcibr_intr_list_t intr_list; + int intr_shared; + xtalk_intr_t *xtalk_intrp; + + for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) { + if (pcibr_int_bits & (1 << pcibr_int_bit)) { + for (intr_list = + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_list; + intr_list != NULL; + intr_list = intr_list->il_next) + if (compare_and_swap_ptr((void **) &intr_list->il_intr, + pcibr_intr, + NULL)) { +#if DEBUG && INTR_DEBUG + printk("%s: cleared a handler from bit %d\n", + pcibr_soft->bs_name, pcibr_int_bit); +#endif + } + /* If this interrupt line is not being shared between multiple + * devices release the xtalk interrupt resources. + */ + intr_shared = + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared; + xtalk_intrp = &pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr; + + if ((!intr_shared) && (*xtalk_intrp)) { + + bridge_t *bridge = pcibr_soft->bs_base; + bridgereg_t int_dev; + + xtalk_intr_free(*xtalk_intrp); + *xtalk_intrp = 0; + + /* Clear the PCI device interrupt to bridge interrupt pin + * mapping. + */ + int_dev = bridge->b_int_device; + int_dev &= ~BRIDGE_INT_DEV_MASK(pcibr_int_bit); + bridge->b_int_device = int_dev; + + } + } + } + DEL(pcibr_intr); +} + +LOCAL void +pcibr_setpciint(xtalk_intr_t xtalk_intr) +{ + iopaddr_t addr = xtalk_intr_addr_get(xtalk_intr); + xtalk_intr_vector_t vect = xtalk_intr_vector_get(xtalk_intr); + bridgereg_t *int_addr = (bridgereg_t *) + xtalk_intr_sfarg_get(xtalk_intr); + +#ifdef CONFIG_IA64_SGI_SN2 + *int_addr = ((BRIDGE_INT_ADDR_HOST & (addr >> 26)) | + (BRIDGE_INT_ADDR_FLD & vect)); +#elif CONFIG_IA64_SGI_SN1 + *int_addr = ((BRIDGE_INT_ADDR_HOST & (addr >> 30)) | + (BRIDGE_INT_ADDR_FLD & vect)); +#endif +} + +/*ARGSUSED */ +int +pcibr_intr_connect(pcibr_intr_t pcibr_intr) +{ + pcibr_soft_t pcibr_soft = pcibr_intr->bi_soft; + bridge_t *bridge = pcibr_soft->bs_base; + unsigned pcibr_int_bits = pcibr_intr->bi_ibits; + unsigned pcibr_int_bit; + bridgereg_t b_int_enable; + unsigned long s; + + if (pcibr_intr == NULL) + return -1; + +#if DEBUG && INTR_DEBUG + printk("%v: pcibr_intr_connect\n", + pcibr_intr->bi_dev); +#endif + + *((volatile unsigned *)&pcibr_intr->bi_flags) |= PCIIO_INTR_CONNECTED; + + /* + * For each PCI interrupt line requested, figure + * out which Bridge PCI Interrupt Line it maps + * to, and make sure there are xtalk resources + * allocated for it. + */ + for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) + if (pcibr_int_bits & (1 << pcibr_int_bit)) { + xtalk_intr_t xtalk_intr; + + xtalk_intr = pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr; + + /* + * If this interrupt line is being shared and the connect has + * already been done, no need to do it again. + */ + if (pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_connected) + continue; + + + /* + * Use the pcibr wrapper function to handle all Bridge interrupts + * regardless of whether the interrupt line is shared or not. + */ + xtalk_intr_connect(xtalk_intr, (xtalk_intr_setfunc_t) pcibr_setpciint, + (void *)&(bridge->b_int_addr[pcibr_int_bit].addr)); + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_connected = 1; + +#if DEBUG && INTR_DEBUG + printk("%v bridge bit %d wrapper connected\n", + pcibr_intr->bi_dev, pcibr_int_bit); +#endif + } + s = pcibr_lock(pcibr_soft); + b_int_enable = bridge->b_int_enable; + b_int_enable |= pcibr_int_bits; + bridge->b_int_enable = b_int_enable; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + pcibr_unlock(pcibr_soft, s); + + return 0; +} + +/*ARGSUSED */ +void +pcibr_intr_disconnect(pcibr_intr_t pcibr_intr) +{ + pcibr_soft_t pcibr_soft = pcibr_intr->bi_soft; + bridge_t *bridge = pcibr_soft->bs_base; + unsigned pcibr_int_bits = pcibr_intr->bi_ibits; + unsigned pcibr_int_bit; + bridgereg_t b_int_enable; + unsigned long s; + + /* Stop calling the function. Now. + */ + *((volatile unsigned *)&pcibr_intr->bi_flags) &= ~PCIIO_INTR_CONNECTED; + /* + * For each PCI interrupt line requested, figure + * out which Bridge PCI Interrupt Line it maps + * to, and disconnect the interrupt. + */ + + /* don't disable interrupts for lines that + * are shared between devices. + */ + for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) + if ((pcibr_int_bits & (1 << pcibr_int_bit)) && + (pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared)) + pcibr_int_bits &= ~(1 << pcibr_int_bit); + if (!pcibr_int_bits) + return; + + s = pcibr_lock(pcibr_soft); + b_int_enable = bridge->b_int_enable; + b_int_enable &= ~pcibr_int_bits; + bridge->b_int_enable = b_int_enable; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + pcibr_unlock(pcibr_soft, s); + + for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) + if (pcibr_int_bits & (1 << pcibr_int_bit)) { + /* if the interrupt line is now shared, + * do not disconnect it. + */ + if (pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared) + continue; + + xtalk_intr_disconnect(pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr); + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_connected = 0; + +#if DEBUG && INTR_DEBUG + printk("%s: xtalk disconnect done for Bridge bit %d\n", + pcibr_soft->bs_name, pcibr_int_bit); +#endif + + /* if we are sharing the interrupt line, + * connect us up; this closes the hole + * where the another pcibr_intr_alloc() + * was in progress as we disconnected. + */ + if (!pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared) + continue; + + xtalk_intr_connect(pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr, + (xtalk_intr_setfunc_t)pcibr_setpciint, + (void *) &(bridge->b_int_addr[pcibr_int_bit].addr)); + } +} + +/*ARGSUSED */ +devfs_handle_t +pcibr_intr_cpu_get(pcibr_intr_t pcibr_intr) +{ + pcibr_soft_t pcibr_soft = pcibr_intr->bi_soft; + unsigned pcibr_int_bits = pcibr_intr->bi_ibits; + unsigned pcibr_int_bit; + + for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) + if (pcibr_int_bits & (1 << pcibr_int_bit)) + return xtalk_intr_cpu_get(pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr); + return 0; +} + +/* ===================================================================== + * INTERRUPT HANDLING + */ +LOCAL void +pcibr_clearwidint(bridge_t *bridge) +{ + bridge->b_wid_int_upper = 0; + bridge->b_wid_int_lower = 0; +} + +LOCAL void +pcibr_setwidint(xtalk_intr_t intr) +{ + xwidgetnum_t targ = xtalk_intr_target_get(intr); + iopaddr_t addr = xtalk_intr_addr_get(intr); + xtalk_intr_vector_t vect = xtalk_intr_vector_get(intr); + widgetreg_t NEW_b_wid_int_upper, NEW_b_wid_int_lower; + widgetreg_t OLD_b_wid_int_upper, OLD_b_wid_int_lower; + + bridge_t *bridge = (bridge_t *)xtalk_intr_sfarg_get(intr); + + NEW_b_wid_int_upper = ( (0x000F0000 & (targ << 16)) | + XTALK_ADDR_TO_UPPER(addr)); + NEW_b_wid_int_lower = XTALK_ADDR_TO_LOWER(addr); + + OLD_b_wid_int_upper = bridge->b_wid_int_upper; + OLD_b_wid_int_lower = bridge->b_wid_int_lower; + + /* Verify that all interrupts from this Bridge are using a single PI */ + if ((OLD_b_wid_int_upper != 0) && (OLD_b_wid_int_lower != 0)) { + /* + * Once set, these registers shouldn't change; they should + * be set multiple times with the same values. + * + * If we're attempting to change these registers, it means + * that our heuristics for allocating interrupts in a way + * appropriate for IP35 have failed, and the admin needs to + * explicitly direct some interrupts (or we need to make the + * heuristics more clever). + * + * In practice, we hope this doesn't happen very often, if + * at all. + */ + if ((OLD_b_wid_int_upper != NEW_b_wid_int_upper) || + (OLD_b_wid_int_lower != NEW_b_wid_int_lower)) { + printk(KERN_WARNING "Interrupt allocation is too complex.\n"); + printk(KERN_WARNING "Use explicit administrative interrupt targetting.\n"); + printk(KERN_WARNING "bridge=0x%lx targ=0x%x\n", (unsigned long)bridge, targ); + printk(KERN_WARNING "NEW=0x%x/0x%x OLD=0x%x/0x%x\n", + NEW_b_wid_int_upper, NEW_b_wid_int_lower, + OLD_b_wid_int_upper, OLD_b_wid_int_lower); + PRINT_PANIC("PCI Bridge interrupt targetting error\n"); + } + } + + bridge->b_wid_int_upper = NEW_b_wid_int_upper; + bridge->b_wid_int_lower = NEW_b_wid_int_lower; + bridge->b_int_host_err = vect; +} + +/* + * pcibr_intr_preset: called during mlreset time + * if the platform specific code needs to route + * one of the Bridge's xtalk interrupts before the + * xtalk infrastructure is available. + */ +void +pcibr_xintr_preset(void *which_widget, + int which_widget_intr, + xwidgetnum_t targ, + iopaddr_t addr, + xtalk_intr_vector_t vect) +{ + bridge_t *bridge = (bridge_t *) which_widget; + + if (which_widget_intr == -1) { + /* bridge widget error interrupt */ + bridge->b_wid_int_upper = ( (0x000F0000 & (targ << 16)) | + XTALK_ADDR_TO_UPPER(addr)); + bridge->b_wid_int_lower = XTALK_ADDR_TO_LOWER(addr); + bridge->b_int_host_err = vect; + + /* turn on all interrupts except + * the PCI interrupt requests, + * at least at heart. + */ + bridge->b_int_enable |= ~BRIDGE_IMR_INT_MSK; + + } else { + /* routing a PCI device interrupt. + * targ and low 38 bits of addr must + * be the same as the already set + * value for the widget error interrupt. + */ + bridge->b_int_addr[which_widget_intr].addr = + ((BRIDGE_INT_ADDR_HOST & (addr >> 30)) | + (BRIDGE_INT_ADDR_FLD & vect)); + /* + * now bridge can let it through; + * NB: still should be blocked at + * xtalk provider end, until the service + * function is set. + */ + bridge->b_int_enable |= 1 << vect; + } + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ +} + + +/* + * pcibr_intr_func() + * + * This is the pcibr interrupt "wrapper" function that is called, + * in interrupt context, to initiate the interrupt handler(s) registered + * (via pcibr_intr_alloc/connect) for the occuring interrupt. Non-threaded + * handlers will be called directly, and threaded handlers will have their + * thread woken up. + */ +void +pcibr_intr_func(intr_arg_t arg) +{ + pcibr_intr_wrap_t wrap = (pcibr_intr_wrap_t) arg; + reg_p wrbf; + pcibr_intr_t intr; + pcibr_intr_list_t list; + int clearit; + int do_nonthreaded = 1; + int is_threaded = 0; + int x = 0; + + /* + * If any handler is still running from a previous interrupt + * just return. If there's a need to call the handler(s) again, + * another interrupt will be generated either by the device or by + * pcibr_force_interrupt(). + */ + + if (wrap->iw_hdlrcnt) { + return; + } + + /* + * Call all interrupt handlers registered. + * First, the pcibr_intrd threads for any threaded handlers will be + * awoken, then any non-threaded handlers will be called sequentially. + */ + + clearit = 1; + while (do_nonthreaded) { + for (list = wrap->iw_list; list != NULL; list = list->il_next) { + if ((intr = list->il_intr) && + (intr->bi_flags & PCIIO_INTR_CONNECTED)) { + + /* + * This device may have initiated write + * requests since the bridge last saw + * an edge on this interrupt input; flushing + * the buffer prior to invoking the handler + * should help but may not be sufficient if we + * get more requests after the flush, followed + * by the card deciding it wants service, before + * the interrupt handler checks to see if things need + * to be done. + * + * There is a similar race condition if + * an interrupt handler loops around and + * notices further service is required. + * Perhaps we need to have an explicit + * call that interrupt handlers need to + * do between noticing that DMA to memory + * has completed, but before observing the + * contents of memory? + */ + + if ((do_nonthreaded) && (!is_threaded)) { + /* Non-threaded. + * Call the interrupt handler at interrupt level + */ + + /* Only need to flush write buffers if sharing */ + + if ((wrap->iw_shared) && (wrbf = list->il_wrbf)) { + if ((x = *wrbf)) /* write request buffer flush */ +#ifdef SUPPORT_PRINTING_V_FORMAT + printk(KERN_ALERT "pcibr_intr_func %v: \n" + "write buffer flush failed, wrbf=0x%x\n", + list->il_intr->bi_dev, wrbf); +#else + printk(KERN_ALERT "pcibr_intr_func %p: \n" + "write buffer flush failed, wrbf=0x%lx\n", + (void *)list->il_intr->bi_dev, (long) wrbf); +#endif + } + } + + clearit = 0; + } + } + + do_nonthreaded = 0; + /* + * If the non-threaded handler was the last to complete, + * (i.e., no threaded handlers still running) force an + * interrupt to avoid a potential deadlock situation. + */ + if (wrap->iw_hdlrcnt == 0) { + pcibr_force_interrupt(wrap); + } + } + + /* If there were no handlers, + * disable the interrupt and return. + * It will get enabled again after + * a handler is connected. + * If we don't do this, we would + * sit here and spin through the + * list forever. + */ + if (clearit) { + pcibr_soft_t pcibr_soft = wrap->iw_soft; + bridge_t *bridge = pcibr_soft->bs_base; + bridgereg_t b_int_enable; + bridgereg_t mask = 1 << wrap->iw_intr; + unsigned long s; + + s = pcibr_lock(pcibr_soft); + b_int_enable = bridge->b_int_enable; + b_int_enable &= ~mask; + bridge->b_int_enable = b_int_enable; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + pcibr_unlock(pcibr_soft, s); + return; + } +} + +/* ===================================================================== + * CONFIGURATION MANAGEMENT + */ +/*ARGSUSED */ +void +pcibr_provider_startup(devfs_handle_t pcibr) +{ +} + +/*ARGSUSED */ +void +pcibr_provider_shutdown(devfs_handle_t pcibr) +{ +} + +int +pcibr_reset(devfs_handle_t conn) +{ + pciio_info_t pciio_info = pciio_info_get(conn); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + bridge_t *bridge = pcibr_soft->bs_base; + bridgereg_t ctlreg; + unsigned cfgctl[8]; + unsigned long s; + int f, nf; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + int win; + + if (pcibr_soft->bs_slot[pciio_slot].has_host) { + pciio_slot = pcibr_soft->bs_slot[pciio_slot].host_slot; + pcibr_info = pcibr_soft->bs_slot[pciio_slot].bss_infos[0]; + } + if (pciio_slot < 4) { + s = pcibr_lock(pcibr_soft); + nf = pcibr_soft->bs_slot[pciio_slot].bss_ninfo; + pcibr_infoh = pcibr_soft->bs_slot[pciio_slot].bss_infos; + for (f = 0; f < nf; ++f) + if (pcibr_infoh[f]) + cfgctl[f] = bridge->b_type0_cfg_dev[pciio_slot].f[f].l[PCI_CFG_COMMAND / 4]; + + ctlreg = bridge->b_wid_control; + bridge->b_wid_control = ctlreg | BRIDGE_CTRL_RST(pciio_slot); + /* XXX delay? */ + bridge->b_wid_control = ctlreg; + /* XXX delay? */ + + for (f = 0; f < nf; ++f) + if ((pcibr_info = pcibr_infoh[f])) + for (win = 0; win < 6; ++win) + if (pcibr_info->f_window[win].w_base != 0) + bridge->b_type0_cfg_dev[pciio_slot].f[f].l[PCI_CFG_BASE_ADDR(win) / 4] = + pcibr_info->f_window[win].w_base; + for (f = 0; f < nf; ++f) + if (pcibr_infoh[f]) + bridge->b_type0_cfg_dev[pciio_slot].f[f].l[PCI_CFG_COMMAND / 4] = cfgctl[f]; + pcibr_unlock(pcibr_soft, s); + + return 0; + } +#ifdef SUPPORT_PRINTING_V_FORMAT + printk(KERN_WARNING "%v: pcibr_reset unimplemented for slot %d\n", + conn, pciio_slot); +#endif + return -1; +} + +pciio_endian_t +pcibr_endian_set(devfs_handle_t pconn_vhdl, + pciio_endian_t device_end, + pciio_endian_t desired_end) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + bridgereg_t devreg; + unsigned long s; + + /* + * Bridge supports hardware swapping; so we can always + * arrange for the caller's desired endianness. + */ + + s = pcibr_lock(pcibr_soft); + devreg = pcibr_soft->bs_slot[pciio_slot].bss_device; + if (device_end != desired_end) + devreg |= BRIDGE_DEV_SWAP_BITS; + else + devreg &= ~BRIDGE_DEV_SWAP_BITS; + + /* NOTE- if we ever put SWAP bits + * onto the disabled list, we will + * have to change the logic here. + */ + if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) { + bridge_t *bridge = pcibr_soft->bs_base; + + bridge->b_device[pciio_slot].reg = devreg; + pcibr_soft->bs_slot[pciio_slot].bss_device = devreg; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + } + pcibr_unlock(pcibr_soft, s); + +#if DEBUG && PCIBR_DEV_DEBUG + printk("pcibr Device(%d): 0x%p\n", pciio_slot, bridge->b_device[pciio_slot].reg); +#endif + + return desired_end; +} + +/* This (re)sets the GBR and REALTIME bits and also keeps track of how + * many sets are outstanding. Reset succeeds only if the number of outstanding + * sets == 1. + */ +int +pcibr_priority_bits_set(pcibr_soft_t pcibr_soft, + pciio_slot_t pciio_slot, + pciio_priority_t device_prio) +{ + unsigned long s; + int *counter; + bridgereg_t rtbits = 0; + bridgereg_t devreg; + int rc = PRIO_SUCCESS; + + /* in dual-slot configurations, the host and the + * guest have separate DMA resources, so they + * have separate requirements for priority bits. + */ + + counter = &(pcibr_soft->bs_slot[pciio_slot].bss_pri_uctr); + + /* + * Bridge supports PCI notions of LOW and HIGH priority + * arbitration rings via a "REAL_TIME" bit in the per-device + * Bridge register. The "GBR" bit controls access to the GBR + * ring on the xbow. These two bits are (re)set together. + * + * XXX- Bug in Rev B Bridge Si: + * Symptom: Prefetcher starts operating incorrectly. This happens + * due to corruption of the address storage ram in the prefetcher + * when a non-real time PCI request is pulled and a real-time one is + * put in it's place. Workaround: Use only a single arbitration ring + * on PCI bus. GBR and RR can still be uniquely used per + * device. NETLIST MERGE DONE, WILL BE FIXED IN REV C. + */ + + if (pcibr_soft->bs_rev_num != BRIDGE_PART_REV_B) + rtbits |= BRIDGE_DEV_RT; + + /* NOTE- if we ever put DEV_RT or DEV_GBR on + * the disabled list, we will have to take + * it into account here. + */ + + s = pcibr_lock(pcibr_soft); + devreg = pcibr_soft->bs_slot[pciio_slot].bss_device; + if (device_prio == PCI_PRIO_HIGH) { + if ((++*counter == 1)) { + if (rtbits) + devreg |= rtbits; + else + rc = PRIO_FAIL; + } + } else if (device_prio == PCI_PRIO_LOW) { + if (*counter <= 0) + rc = PRIO_FAIL; + else if (--*counter == 0) + if (rtbits) + devreg &= ~rtbits; + } + if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) { + bridge_t *bridge = pcibr_soft->bs_base; + + bridge->b_device[pciio_slot].reg = devreg; + pcibr_soft->bs_slot[pciio_slot].bss_device = devreg; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + } + pcibr_unlock(pcibr_soft, s); + + return rc; +} + +pciio_priority_t +pcibr_priority_set(devfs_handle_t pconn_vhdl, + pciio_priority_t device_prio) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + + (void) pcibr_priority_bits_set(pcibr_soft, pciio_slot, device_prio); + + return device_prio; +} + +/* + * Interfaces to allow special (e.g. SGI) drivers to set/clear + * Bridge-specific device flags. Many flags are modified through + * PCI-generic interfaces; we don't allow them to be directly + * manipulated here. Only flags that at this point seem pretty + * Bridge-specific can be set through these special interfaces. + * We may add more flags as the need arises, or remove flags and + * create PCI-generic interfaces as the need arises. + * + * Returns 0 on failure, 1 on success + */ +int +pcibr_device_flags_set(devfs_handle_t pconn_vhdl, + pcibr_device_flags_t flags) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + bridgereg_t set = 0; + bridgereg_t clr = 0; + + ASSERT((flags & PCIBR_DEVICE_FLAGS) == flags); + + if (flags & PCIBR_WRITE_GATHER) + set |= BRIDGE_DEV_PMU_WRGA_EN; + if (flags & PCIBR_NOWRITE_GATHER) + clr |= BRIDGE_DEV_PMU_WRGA_EN; + + if (flags & PCIBR_WRITE_GATHER) + set |= BRIDGE_DEV_DIR_WRGA_EN; + if (flags & PCIBR_NOWRITE_GATHER) + clr |= BRIDGE_DEV_DIR_WRGA_EN; + + if (flags & PCIBR_PREFETCH) + set |= BRIDGE_DEV_PREF; + if (flags & PCIBR_NOPREFETCH) + clr |= BRIDGE_DEV_PREF; + + if (flags & PCIBR_PRECISE) + set |= BRIDGE_DEV_PRECISE; + if (flags & PCIBR_NOPRECISE) + clr |= BRIDGE_DEV_PRECISE; + + if (flags & PCIBR_BARRIER) + set |= BRIDGE_DEV_BARRIER; + if (flags & PCIBR_NOBARRIER) + clr |= BRIDGE_DEV_BARRIER; + + if (flags & PCIBR_64BIT) + set |= BRIDGE_DEV_DEV_SIZE; + if (flags & PCIBR_NO64BIT) + clr |= BRIDGE_DEV_DEV_SIZE; + + if (set || clr) { + bridgereg_t devreg; + unsigned long s; + + s = pcibr_lock(pcibr_soft); + devreg = pcibr_soft->bs_slot[pciio_slot].bss_device; + devreg = (devreg & ~clr) | set; + if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) { + bridge_t *bridge = pcibr_soft->bs_base; + + bridge->b_device[pciio_slot].reg = devreg; + pcibr_soft->bs_slot[pciio_slot].bss_device = devreg; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + } + pcibr_unlock(pcibr_soft, s); +#if DEBUG && PCIBR_DEV_DEBUG + printk("pcibr Device(%d): %R\n", pciio_slot, bridge->b_device[pciio_slot].regbridge->b_device[pciio_slot].reg, device_bits); +#endif + } + return (1); +} + +#ifdef LITTLE_ENDIAN +/* + * on sn-ia we need to twiddle the the addresses going out + * the pci bus because we use the unswizzled synergy space + * (the alternative is to use the swizzled synergy space + * and byte swap the data) + */ +#define CB(b,r) (((volatile uint8_t *) b)[((r)^4)]) +#define CS(b,r) (((volatile uint16_t *) b)[((r^4)/2)]) +#define CW(b,r) (((volatile uint32_t *) b)[((r^4)/4)]) +#else +#define CB(b,r) (((volatile uint8_t *) cfgbase)[(r)^3]) +#define CS(b,r) (((volatile uint16_t *) cfgbase)[((r)/2)^1]) +#define CW(b,r) (((volatile uint32_t *) cfgbase)[(r)/4]) +#endif /* LITTLE_ENDIAN */ + + +LOCAL cfg_p +pcibr_config_addr(devfs_handle_t conn, + unsigned reg) +{ + pcibr_info_t pcibr_info; + pciio_slot_t pciio_slot; + pciio_function_t pciio_func; + pcibr_soft_t pcibr_soft; + bridge_t *bridge; + cfg_p cfgbase = (cfg_p)0; + + pcibr_info = pcibr_info_get(conn); + + pciio_slot = pcibr_info->f_slot; + if (pciio_slot == PCIIO_SLOT_NONE) + pciio_slot = PCI_TYPE1_SLOT(reg); + + pciio_func = pcibr_info->f_func; + if (pciio_func == PCIIO_FUNC_NONE) + pciio_func = PCI_TYPE1_FUNC(reg); + + pcibr_soft = (pcibr_soft_t) pcibr_info->f_mfast; + + bridge = pcibr_soft->bs_base; + + cfgbase = bridge->b_type0_cfg_dev[pciio_slot].f[pciio_func].l; + + return cfgbase; +} + +uint64_t +pcibr_config_get(devfs_handle_t conn, + unsigned reg, + unsigned size) +{ + return do_pcibr_config_get(pcibr_config_addr(conn, reg), + PCI_TYPE1_REG(reg), size); +} + +LOCAL uint64_t +do_pcibr_config_get( + cfg_p cfgbase, + unsigned reg, + unsigned size) +{ + unsigned value; + + + value = CW(cfgbase, reg); + + if (reg & 3) + value >>= 8 * (reg & 3); + if (size < 4) + value &= (1 << (8 * size)) - 1; + + return value; +} + +void +pcibr_config_set(devfs_handle_t conn, + unsigned reg, + unsigned size, + uint64_t value) +{ + do_pcibr_config_set(pcibr_config_addr(conn, reg), + PCI_TYPE1_REG(reg), size, value); +} + +LOCAL void +do_pcibr_config_set(cfg_p cfgbase, + unsigned reg, + unsigned size, + uint64_t value) +{ + switch (size) { + case 1: + CB(cfgbase, reg) = value; + break; + case 2: + if (reg & 1) { + CB(cfgbase, reg) = value; + CB(cfgbase, reg + 1) = value >> 8; + } else + CS(cfgbase, reg) = value; + break; + case 3: + if (reg & 1) { + CB(cfgbase, reg) = value; + CS(cfgbase, (reg + 1)) = value >> 8; + } else { + CS(cfgbase, reg) = value; + CB(cfgbase, reg + 2) = value >> 16; + } + break; + + case 4: + CW(cfgbase, reg) = value; + break; + } +} + +pciio_provider_t pcibr_provider = +{ + (pciio_piomap_alloc_f *) pcibr_piomap_alloc, + (pciio_piomap_free_f *) pcibr_piomap_free, + (pciio_piomap_addr_f *) pcibr_piomap_addr, + (pciio_piomap_done_f *) pcibr_piomap_done, + (pciio_piotrans_addr_f *) pcibr_piotrans_addr, + (pciio_piospace_alloc_f *) pcibr_piospace_alloc, + (pciio_piospace_free_f *) pcibr_piospace_free, + + (pciio_dmamap_alloc_f *) pcibr_dmamap_alloc, + (pciio_dmamap_free_f *) pcibr_dmamap_free, + (pciio_dmamap_addr_f *) pcibr_dmamap_addr, + (pciio_dmamap_list_f *) pcibr_dmamap_list, + (pciio_dmamap_done_f *) pcibr_dmamap_done, + (pciio_dmatrans_addr_f *) pcibr_dmatrans_addr, + (pciio_dmatrans_list_f *) pcibr_dmatrans_list, + (pciio_dmamap_drain_f *) pcibr_dmamap_drain, + (pciio_dmaaddr_drain_f *) pcibr_dmaaddr_drain, + (pciio_dmalist_drain_f *) pcibr_dmalist_drain, + + (pciio_intr_alloc_f *) pcibr_intr_alloc, + (pciio_intr_free_f *) pcibr_intr_free, + (pciio_intr_connect_f *) pcibr_intr_connect, + (pciio_intr_disconnect_f *) pcibr_intr_disconnect, + (pciio_intr_cpu_get_f *) pcibr_intr_cpu_get, + + (pciio_provider_startup_f *) pcibr_provider_startup, + (pciio_provider_shutdown_f *) pcibr_provider_shutdown, + (pciio_reset_f *) pcibr_reset, + (pciio_write_gather_flush_f *) pcibr_write_gather_flush, + (pciio_endian_set_f *) pcibr_endian_set, + (pciio_priority_set_f *) pcibr_priority_set, + (pciio_config_get_f *) pcibr_config_get, + (pciio_config_set_f *) pcibr_config_set, + + (pciio_error_devenable_f *) 0, + (pciio_error_extract_f *) 0, + +#ifdef LATER + (pciio_driver_reg_callback_f *) pcibr_driver_reg_callback, + (pciio_driver_unreg_callback_f *) pcibr_driver_unreg_callback, +#else + (pciio_driver_reg_callback_f *) 0, + (pciio_driver_unreg_callback_f *) 0, +#endif + (pciio_device_unregister_f *) pcibr_device_unregister, + (pciio_dma_enabled_f *) pcibr_dma_enabled, +}; + +LOCAL pcibr_hints_t +pcibr_hints_get(devfs_handle_t xconn_vhdl, int alloc) +{ + arbitrary_info_t ainfo = 0; + graph_error_t rv; + pcibr_hints_t hint; + + rv = hwgraph_info_get_LBL(xconn_vhdl, INFO_LBL_PCIBR_HINTS, &ainfo); + + if (alloc && (rv != GRAPH_SUCCESS)) { + + NEW(hint); + hint->rrb_alloc_funct = NULL; + hint->ph_intr_bits = NULL; + rv = hwgraph_info_add_LBL(xconn_vhdl, + INFO_LBL_PCIBR_HINTS, + (arbitrary_info_t) hint); + if (rv != GRAPH_SUCCESS) + goto abnormal_exit; + + rv = hwgraph_info_get_LBL(xconn_vhdl, INFO_LBL_PCIBR_HINTS, &ainfo); + + if (rv != GRAPH_SUCCESS) + goto abnormal_exit; + + if (ainfo != (arbitrary_info_t) hint) + goto abnormal_exit; + } + return (pcibr_hints_t) ainfo; + +abnormal_exit: +#ifdef LATER + printf("SHOULD NOT BE HERE\n"); +#endif + DEL(hint); + return(NULL); + +} + +void +pcibr_hints_fix_some_rrbs(devfs_handle_t xconn_vhdl, unsigned mask) +{ + pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); + + if (hint) + hint->ph_rrb_fixed = mask; +#if DEBUG + else + printk("pcibr_hints_fix_rrbs: pcibr_hints_get failed at\n" + "\t%p\n", xconn_vhdl); +#endif +} + +void +pcibr_hints_fix_rrbs(devfs_handle_t xconn_vhdl) +{ + pcibr_hints_fix_some_rrbs(xconn_vhdl, 0xFF); +} + +void +pcibr_hints_dualslot(devfs_handle_t xconn_vhdl, + pciio_slot_t host, + pciio_slot_t guest) +{ + pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); + + if (hint) + hint->ph_host_slot[guest] = host + 1; +#if DEBUG + else + printk("pcibr_hints_dualslot: pcibr_hints_get failed at\n" + "\t%p\n", xconn_vhdl); +#endif +} + +void +pcibr_hints_intr_bits(devfs_handle_t xconn_vhdl, + pcibr_intr_bits_f *xxx_intr_bits) +{ + pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); + + if (hint) + hint->ph_intr_bits = xxx_intr_bits; +#if DEBUG + else + printk("pcibr_hints_intr_bits: pcibr_hints_get failed at\n" + "\t%p\n", xconn_vhdl); +#endif +} + +void +pcibr_set_rrb_callback(devfs_handle_t xconn_vhdl, rrb_alloc_funct_t rrb_alloc_funct) +{ + pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); + + if (hint) + hint->rrb_alloc_funct = rrb_alloc_funct; +} + +void +pcibr_hints_handsoff(devfs_handle_t xconn_vhdl) +{ + pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); + + if (hint) + hint->ph_hands_off = 1; +#if DEBUG + else + printk("pcibr_hints_handsoff: pcibr_hints_get failed at\n" + "\t%p\n", xconn_vhdl); +#endif +} + +void +pcibr_hints_subdevs(devfs_handle_t xconn_vhdl, + pciio_slot_t slot, + uint64_t subdevs) +{ + arbitrary_info_t ainfo = 0; + char sdname[16]; + devfs_handle_t pconn_vhdl = GRAPH_VERTEX_NONE; + + sprintf(sdname, "pci/%d", slot); + (void) hwgraph_path_add(xconn_vhdl, sdname, &pconn_vhdl); + if (pconn_vhdl == GRAPH_VERTEX_NONE) { +#if DEBUG + printk("pcibr_hints_subdevs: hwgraph_path_create failed at\n" + "\t%p (seeking %s)\n", xconn_vhdl, sdname); +#endif + return; + } + hwgraph_info_get_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, &ainfo); + if (ainfo == 0) { + uint64_t *subdevp; + + NEW(subdevp); + if (!subdevp) { +#if DEBUG + printk("pcibr_hints_subdevs: subdev ptr alloc failed at\n" + "\t%p\n", pconn_vhdl); +#endif + return; + } + *subdevp = subdevs; + hwgraph_info_add_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, (arbitrary_info_t) subdevp); + hwgraph_info_get_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, &ainfo); + if (ainfo == (arbitrary_info_t) subdevp) + return; + DEL(subdevp); + if (ainfo == (arbitrary_info_t) NULL) { +#if DEBUG + printk("pcibr_hints_subdevs: null subdevs ptr at\n" + "\t%p\n", pconn_vhdl); +#endif + return; + } +#if DEBUG + printk("pcibr_subdevs_get: dup subdev add_LBL at\n" + "\t%p\n", pconn_vhdl); +#endif + } + *(uint64_t *) ainfo = subdevs; +} + + +#ifdef LATER + +#include +#include + +char *pci_space[] = {"NONE", + "ROM", + "IO", + "", + "MEM", + "MEM32", + "MEM64", + "CFG", + "WIN0", + "WIN1", + "WIN2", + "WIN3", + "WIN4", + "WIN5", + "", + "BAD"}; + +void +idbg_pss_func(pcibr_info_h pcibr_infoh, int func) +{ + pcibr_info_t pcibr_info = pcibr_infoh[func]; + char name[MAXDEVNAME]; + int win; + + if (!pcibr_info) + return; + qprintf("Per-slot Function Info\n"); +#ifdef SUPPORT_PRINTING_V_FORMAT + sprintf(name, "%v", pcibr_info->f_vertex); +#endif + qprintf("\tSlot Name : %s\n",name); + qprintf("\tPCI Bus : %d ",pcibr_info->f_bus); + qprintf("Slot : %d ", pcibr_info->f_slot); + qprintf("Function : %d ", pcibr_info->f_func); + qprintf("VendorId : 0x%x " , pcibr_info->f_vendor); + qprintf("DeviceId : 0x%x\n", pcibr_info->f_device); +#ifdef SUPPORT_PRINTING_V_FORMAT + sprintf(name, "%v", pcibr_info->f_master); +#endif + qprintf("\tBus provider : %s\n",name); + qprintf("\tProvider Fns : 0x%x ", pcibr_info->f_pops); + qprintf("Error Handler : 0x%x Arg 0x%x\n", + pcibr_info->f_efunc,pcibr_info->f_einfo); + for(win = 0 ; win < 6 ; win++) + qprintf("\tBase Reg #%d space %s base 0x%x size 0x%x\n", + win,pci_space[pcibr_info->f_window[win].w_space], + pcibr_info->f_window[win].w_base, + pcibr_info->f_window[win].w_size); + + qprintf("\tRom base 0x%x size 0x%x\n", + pcibr_info->f_rbase,pcibr_info->f_rsize); + + qprintf("\tInterrupt Bit Map\n"); + qprintf("\t\tPCI Int#\tBridge Pin#\n"); + for (win = 0 ; win < 4; win++) + qprintf("\t\tINT%c\t\t%d\n",win+'A',pcibr_info->f_ibit[win]); + qprintf("\n"); +} + + +void +idbg_pss_info(pcibr_soft_t pcibr_soft, pciio_slot_t slot) +{ + pcibr_soft_slot_t pss; + char slot_conn_name[MAXDEVNAME]; + int func; + + pss = &pcibr_soft->bs_slot[slot]; + qprintf("PCI INFRASTRUCTURAL INFO FOR SLOT %d\n", slot); + qprintf("\tHost Present ? %s ", pss->has_host ? "yes" : "no"); + qprintf("\tHost Slot : %d\n",pss->host_slot); + sprintf(slot_conn_name, "%v", pss->slot_conn); + qprintf("\tSlot Conn : %s\n",slot_conn_name); + qprintf("\t#Functions : %d\n",pss->bss_ninfo); + for (func = 0; func < pss->bss_ninfo; func++) + idbg_pss_func(pss->bss_infos,func); + qprintf("\tSpace : %s ",pci_space[pss->bss_devio.bssd_space]); + qprintf("\tBase : 0x%x ", pss->bss_devio.bssd_base); + qprintf("\tShadow Devreg : 0x%x\n", pss->bss_device); + qprintf("\tUsage counts : pmu %d d32 %d d64 %d\n", + pss->bss_pmu_uctr,pss->bss_d32_uctr,pss->bss_d64_uctr); + + qprintf("\tDirect Trans Info : d64_base 0x%x d64_flags 0x%x" + "d32_base 0x%x d32_flags 0x%x\n", + pss->bss_d64_base, pss->bss_d64_flags, + pss->bss_d32_base, pss->bss_d32_flags); + + qprintf("\tExt ATEs active ? %s", + atomic_read(&pss->bss_ext_ates_active) ? "yes" : "no"); + qprintf(" Command register : 0x%x ", pss->bss_cmd_pointer); + qprintf(" Shadow command val : 0x%x\n", pss->bss_cmd_shadow); + + qprintf("\tRRB Info : Valid %d+%d Reserved %d\n", + pcibr_soft->bs_rrb_valid[slot], + pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL], + pcibr_soft->bs_rrb_res[slot]); + +} + +int ips = 0; + +void +idbg_pss(pcibr_soft_t pcibr_soft) +{ + pciio_slot_t slot; + + + if (ips >= 0 && ips < 8) + idbg_pss_info(pcibr_soft,ips); + else if (ips < 0) + for (slot = 0; slot < 8; slot++) + idbg_pss_info(pcibr_soft,slot); + else + qprintf("Invalid ips %d\n",ips); +} + +#endif /* LATER */ + +int +pcibr_dma_enabled(devfs_handle_t pconn_vhdl) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + + + return xtalk_dma_enabled(pcibr_soft->bs_conn); +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn2/bte_error.c lia64-2.4/arch/ia64/sn/io/sn2/bte_error.c --- linux-2.4.18/arch/ia64/sn/io/sn2/bte_error.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn2/bte_error.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,190 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000,2002 Silicon Graphics, Inc. All rights reserved. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/************************************************************************ + * * + * BTE ERROR RECOVERY * + * * + * Given a BTE error, the node causing the error must do the following: * + * a) Clear all crbs relating to that BTE * + * 1) Read CRBA value for crb in question * + * 2) Mark CRB as VALID, store local physical * + * address known to be good in the address field * + * (bte_notification_targ is a known good local * + * address). * + * 3) Write CRBA * + * 4) Using ICCR, FLUSH the CRB, and wait for it to * + * complete. * + * ... BTE BUSY bit should now be clear (or at least * + * should be after ALL CRBs associated with the * + * transfer are complete. * + * * + * b) Re-enable BTE * + * 1) Write IMEM with BTE Enable + XXX bits + * 2) Write IECLR with BTE clear bits + * 3) Clear IIDSR INT_SENT bits. + * * + ************************************************************************/ + +#ifdef BTE_ERROR +// This routine is not called. Yet. It may be someday. It probably +// *should* be someday. Until then, ifdef it out. +bte_result_t +bte_error_handler(bte_handle_t *bh) +/* + * Function: bte_error_handler + * Purpose: Process a BTE error after a transfer has failed. + * Parameters: bh - bte handle of bte that failed. + * Returns: The BTE error type. + * Notes: + */ +{ + devfs_handle_t hub_v; + hubinfo_t hinfo; + int il; + hubreg_t iidsr, imem, ieclr; + hubreg_t bte_status; + + bh->bh_bte->bte_error_count++; + + /* + * Process any CRB logs - we know that the bte_context contains + * the BTE completion status, but to avoid a race with error + * processing, we force a call to pick up any CRB errors pending. + * After this call, we know that we have any CRB errors related to + * this BTE transfer in the context. + */ + hub_v = cnodeid_to_vertex(bh->bh_bte->bte_cnode); + hubinfo_get(hub_v, &hinfo); + (void)hubiio_crb_error_handler(hub_v, hinfo); + + /* Be sure BTE is stopped */ + + (void)BTE_LOAD(bh->bh_bte->bte_base, BTEOFF_CTRL); + + /* + * Now clear up the rest of the error - be sure to hold crblock + * to avoid race with other cpu on this node. + */ + imem = REMOTE_HUB_L(hinfo->h_nasid, IIO_IMEM); + ieclr = REMOTE_HUB_L(hinfo->h_nasid, IIO_IECLR); + if (bh->bh_bte->bte_num == 0) { + imem |= IIO_IMEM_W0ESD | IIO_IMEM_B0ESD; + ieclr|= IECLR_BTE0; + } else { + imem |= IIO_IMEM_W0ESD | IIO_IMEM_B1ESD; + ieclr|= IECLR_BTE1; + } + + REMOTE_HUB_S(hinfo->h_nasid, IIO_IMEM, imem); + REMOTE_HUB_S(hinfo->h_nasid, IIO_IECLR, ieclr); + + iidsr = REMOTE_HUB_L(hinfo->h_nasid, IIO_IIDSR); + iidsr &= ~IIO_IIDSR_SENT_MASK; + iidsr |= IIO_IIDSR_ENB_MASK; + REMOTE_HUB_S(hinfo->h_nasid, IIO_IIDSR, iidsr); + mutex_spinunlock(&hinfo->h_crblock, il); + + bte_status = BTE_LOAD(bh->bh_bte->bte_base, BTEOFF_STAT); + BTE_STORE(bh->bh_bte->bte_base, BTEOFF_STAT, bte_status & ~IBLS_BUSY); + ASSERT(!BTE_IS_BUSY(BTE_LOAD(bh->bh_bte->bte_base, BTEOFF_STAT))); + + switch(bh->bh_error) { + case IIO_ICRB_ECODE_PERR: + return(BTEFAIL_POISON); + case IIO_ICRB_ECODE_WERR: + return(BTEFAIL_PROT); + case IIO_ICRB_ECODE_AERR: + return(BTEFAIL_ACCESS); + case IIO_ICRB_ECODE_TOUT: + return(BTEFAIL_TOUT); + case IIO_ICRB_ECODE_XTERR: + return(BTEFAIL_ERROR); + case IIO_ICRB_ECODE_DERR: + return(BTEFAIL_DIR); + case IIO_ICRB_ECODE_PWERR: + case IIO_ICRB_ECODE_PRERR: + /* NO BREAK */ + default: + printk("BTE failure (%d) unexpected\n", + bh->bh_error); + return(BTEFAIL_ERROR); + } +} +#endif // BTE_ERROR + +void +bte_crb_error_handler(devfs_handle_t hub_v, int btenum, + int crbnum, ioerror_t *ioe) +/* + * Function: bte_crb_error_handler + * Purpose: Process a CRB for a specific HUB/BTE + * Parameters: hub_v - vertex of hub in HW graph + * btenum - bte number on hub (0 == a, 1 == b) + * crbnum - crb number being processed + * Notes: + * This routine assumes serialization at a higher level. A CRB + * should not be processed more than once. The error recovery + * follows the following sequence - if you change this, be real + * sure about what you are doing. + * + */ +{ + hubinfo_t hinfo; + icrba_t crba; + icrbb_t crbb; + nasid_t n; + + hubinfo_get(hub_v, &hinfo); + + + n = hinfo->h_nasid; + + /* Step 1 */ + crba.ii_icrb0_a_regval = REMOTE_HUB_L(n, IIO_ICRB_A(crbnum)); + crbb.ii_icrb0_b_regval = REMOTE_HUB_L(n, IIO_ICRB_B(crbnum)); + + + /* Zero error and error code to prevent error_dump complaining + * about these CRBs. + */ + crbb.b_error=0; + crbb.b_ecode=0; + + /* Step 2 */ + REMOTE_HUB_S(n, IIO_ICRB_A(crbnum), crba.ii_icrb0_a_regval); + /* Step 3 */ + REMOTE_HUB_S(n, IIO_ICCR, + IIO_ICCR_PENDING | IIO_ICCR_CMD_FLUSH | crbnum); + while (REMOTE_HUB_L(n, IIO_ICCR) & IIO_ICCR_PENDING) + ; +} + diff -urN linux-2.4.18/arch/ia64/sn/io/sn2/ml_SN_intr.c lia64-2.4/arch/ia64/sn/io/sn2/ml_SN_intr.c --- linux-2.4.18/arch/ia64/sn/io/sn2/ml_SN_intr.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn2/ml_SN_intr.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,469 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992-1997, 2000-2002 Silicon Graphics, Inc. All Rights Reserved. + */ + +/* + * intr.c- + * This file contains all of the routines necessary to set up and + * handle interrupts on an IPXX board. + */ + +#ident "$Revision: 1.167 $" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern irqpda_t *irqpdaindr[]; +extern cnodeid_t master_node_get(devfs_handle_t vhdl); +extern nasid_t master_nasid; + +// Initialize some shub registers for interrupts, both IO and error. + +void +intr_init_vecblk( nodepda_t *npda, + cnodeid_t node, + int sn) +{ + int nasid = cnodeid_to_nasid(node); + nasid_t console_nasid; + sh_ii_int0_config_u_t ii_int_config; + cpuid_t cpu; + cpuid_t cpu0, cpu1; + nodepda_t *lnodepda; + sh_ii_int0_enable_u_t ii_int_enable; + sh_local_int0_config_u_t local_int_config; + sh_local_int0_enable_u_t local_int_enable; + sh_fsb_system_agent_config_u_t fsb_system_agent; + sh_int_node_id_config_u_t node_id_config; + int is_console; + + console_nasid = get_console_nasid(); + if (console_nasid < 0) { + console_nasid = master_nasid; + } + + is_console = nasid == console_nasid; + + if (is_headless_node(node) ) { + int cnode; + struct ia64_sal_retval ret_stuff; + + // retarget all interrupts on this node to the master node. + node_id_config.sh_int_node_id_config_regval = 0; + node_id_config.sh_int_node_id_config_s.node_id = master_nasid; + node_id_config.sh_int_node_id_config_s.id_sel = 1; + HUB_S( (unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_INT_NODE_ID_CONFIG), + node_id_config.sh_int_node_id_config_regval); + cnode = nasid_to_cnodeid(master_nasid); + lnodepda = NODEPDA(cnode); + cpu = lnodepda->node_first_cpu; + cpu = cpu_physical_id(cpu); + SAL_CALL(ret_stuff, SN_SAL_REGISTER_CE, nasid, cpu, master_nasid,0,0,0,0); + if (ret_stuff.status < 0) { + printk("%s: SN_SAL_REGISTER_CE SAL_CALL failed\n",__FUNCTION__); + } + } else { + lnodepda = NODEPDA(node); + cpu = lnodepda->node_first_cpu; + cpu = cpu_physical_id(cpu); + } + + // Get the physical id's of the cpu's on this node. + cpu0 = id_eid_to_cpu_physical_id(nasid, 0); + cpu1 = id_eid_to_cpu_physical_id(nasid, 1); + + HUB_S( (unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_PI_ERROR_MASK), 0); + HUB_S( (unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_PI_CRBP_ERROR_MASK), 0); + + // The II_INT_CONFIG register for cpu 0. + ii_int_config.sh_ii_int0_config_s.type = 0; + ii_int_config.sh_ii_int0_config_s.agt = 0; + ii_int_config.sh_ii_int0_config_s.pid = cpu0; + ii_int_config.sh_ii_int0_config_s.base = 0; + + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_II_INT0_CONFIG), + ii_int_config.sh_ii_int0_config_regval); + + // The II_INT_CONFIG register for cpu 1. + ii_int_config.sh_ii_int0_config_s.type = 0; + ii_int_config.sh_ii_int0_config_s.agt = 0; + ii_int_config.sh_ii_int0_config_s.pid = cpu1; + ii_int_config.sh_ii_int0_config_s.base = 0; + + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_II_INT1_CONFIG), + ii_int_config.sh_ii_int0_config_regval); + + // Enable interrupts for II_INT0 and 1. + ii_int_enable.sh_ii_int0_enable_s.ii_enable = 1; + + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_II_INT0_ENABLE), + ii_int_enable.sh_ii_int0_enable_regval); + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_II_INT1_ENABLE), + ii_int_enable.sh_ii_int0_enable_regval); + + // init error regs + // LOCAL_INT0 is for the UART only. + + local_int_config.sh_local_int0_config_s.type = 0; + local_int_config.sh_local_int0_config_s.agt = 0; + local_int_config.sh_local_int0_config_s.pid = cpu; + local_int_config.sh_local_int0_config_s.base = 0; + local_int_config.sh_local_int0_config_s.idx = SGI_UART_VECTOR; + + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_LOCAL_INT0_CONFIG), + local_int_config.sh_local_int0_config_regval); + + // LOCAL_INT1 is for all hardware errors. + // It will send a BERR, which will result in an MCA. + local_int_config.sh_local_int0_config_s.idx = 0; + + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_LOCAL_INT1_CONFIG), + local_int_config.sh_local_int0_config_regval); + + // Clear the LOCAL_INT_ENABLE register. + local_int_enable.sh_local_int0_enable_regval = 0; + + if (is_console) { + // Enable the UART interrupt. Only applies to the console nasid. + local_int_enable.sh_local_int0_enable_s.uart_int = 1; + + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_LOCAL_INT0_ENABLE), + local_int_enable.sh_local_int0_enable_regval); + } + + // Enable all the error interrupts. + local_int_enable.sh_local_int0_enable_s.uart_int = 0; + local_int_enable.sh_local_int0_enable_s.pi_hw_int = 1; + local_int_enable.sh_local_int0_enable_s.md_hw_int = 1; + local_int_enable.sh_local_int0_enable_s.xn_hw_int = 1; + local_int_enable.sh_local_int0_enable_s.lb_hw_int = 1; + local_int_enable.sh_local_int0_enable_s.ii_hw_int = 1; + local_int_enable.sh_local_int0_enable_s.pi_uce_int = 1; + local_int_enable.sh_local_int0_enable_s.md_uce_int = 1; + local_int_enable.sh_local_int0_enable_s.xn_uce_int = 1; + local_int_enable.sh_local_int0_enable_s.system_shutdown_int = 1; + local_int_enable.sh_local_int0_enable_s.l1_nmi_int = 1; + local_int_enable.sh_local_int0_enable_s.stop_clock = 1; + + + // Send BERR, rather than an interrupt, for shub errors. + local_int_config.sh_local_int0_config_s.agt = 1; + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_LOCAL_INT1_CONFIG), + local_int_config.sh_local_int0_config_regval); + + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_LOCAL_INT1_ENABLE), + local_int_enable.sh_local_int0_enable_regval); + + // Make sure BERR is enabled. + fsb_system_agent.sh_fsb_system_agent_config_regval = + HUB_L( (unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_FSB_SYSTEM_AGENT_CONFIG) ); + fsb_system_agent.sh_fsb_system_agent_config_s.berr_assert_en = 1; + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_FSB_SYSTEM_AGENT_CONFIG), + fsb_system_agent.sh_fsb_system_agent_config_regval); + + // Set LOCAL_INT2 to field CEs + + local_int_enable.sh_local_int0_enable_regval = 0; + + local_int_config.sh_local_int0_config_s.agt = 0; + local_int_config.sh_local_int0_config_s.idx = SGI_SHUB_ERROR_VECTOR; + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_LOCAL_INT2_CONFIG), + local_int_config.sh_local_int0_config_regval); + + local_int_enable.sh_local_int0_enable_s.pi_ce_int = 1; + local_int_enable.sh_local_int0_enable_s.md_ce_int = 1; + local_int_enable.sh_local_int0_enable_s.xn_ce_int = 1; + + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_LOCAL_INT2_ENABLE), + local_int_enable.sh_local_int0_enable_regval); + + // Make sure all the rest of the LOCAL_INT regs are disabled. + local_int_enable.sh_local_int0_enable_regval = 0; + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_LOCAL_INT3_ENABLE), + local_int_enable.sh_local_int0_enable_regval); + + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_LOCAL_INT4_ENABLE), + local_int_enable.sh_local_int0_enable_regval); + + HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_LOCAL_INT5_ENABLE), + local_int_enable.sh_local_int0_enable_regval); + +} + +// (Un)Reserve an irq on this cpu. + +static int +do_intr_reserve_level(cpuid_t cpu, + int bit, + int reserve) +{ + int i; + irqpda_t *irqs = irqpdaindr[cpu]; + + if (reserve) { + if (bit < 0) { + for (i = IA64_SN2_FIRST_DEVICE_VECTOR; i <= IA64_SN2_LAST_DEVICE_VECTOR; i++) { + if (irqs->irq_flags[i] == 0) { + bit = i; + break; + } + } + } + if (bit < 0) { + return -1; + } + if (irqs->irq_flags[bit] & SN2_IRQ_RESERVED) { + return -1; + } else { + irqs->num_irq_used++; + irqs->irq_flags[bit] |= SN2_IRQ_RESERVED; + return bit; + } + } else { + if (irqs->irq_flags[bit] & SN2_IRQ_RESERVED) { + irqs->num_irq_used--; + irqs->irq_flags[bit] &= ~SN2_IRQ_RESERVED; + return bit; + } else { + return -1; + } + } +} + +int +intr_reserve_level(cpuid_t cpu, + int bit, + int resflags, + devfs_handle_t owner_dev, + char *name) +{ + return(do_intr_reserve_level(cpu, bit, 1)); +} + +void +intr_unreserve_level(cpuid_t cpu, + int bit) +{ + (void)do_intr_reserve_level(cpu, bit, 0); +} + +// Mark an irq on this cpu as (dis)connected. + +static int +do_intr_connect_level(cpuid_t cpu, + int bit, + int connect) +{ + irqpda_t *irqs = irqpdaindr[cpu]; + + if (connect) { + if (irqs->irq_flags[bit] & SN2_IRQ_CONNECTED) { + return -1; + } else { + irqs->irq_flags[bit] |= SN2_IRQ_CONNECTED; + return bit; + } + } else { + if (irqs->irq_flags[bit] & SN2_IRQ_CONNECTED) { + irqs->irq_flags[bit] &= ~SN2_IRQ_CONNECTED; + return bit; + } else { + return -1; + } + } + return(bit); +} + +int +intr_connect_level(cpuid_t cpu, + int bit, + ilvl_t is, + intr_func_t intr_prefunc) +{ + return(do_intr_connect_level(cpu, bit, 1)); +} + +int +intr_disconnect_level(cpuid_t cpu, + int bit) +{ + return(do_intr_connect_level(cpu, bit, 0)); +} + +// Choose a cpu on this node. +// We choose the one with the least number of int's assigned to it. + +static cpuid_t +do_intr_cpu_choose(cnodeid_t cnode) { + cpuid_t cpu, best_cpu = CPU_NONE; + int slice, min_count = 1000; + irqpda_t *irqs; + + for (slice = 0; slice < CPUS_PER_NODE; slice++) { + int intrs; + + cpu = cnode_slice_to_cpuid(cnode, slice); + if (cpu == CPU_NONE) { + continue; + } + + if (!cpu_enabled(cpu)) { + continue; + } + + irqs = irqpdaindr[cpu]; + intrs = irqs->num_irq_used; + + if (min_count > intrs) { + min_count = intrs; + best_cpu = cpu; + } + } + return best_cpu; +} + +static cpuid_t +intr_cpu_choose_from_node(cnodeid_t cnode) +{ + return(do_intr_cpu_choose(cnode)); +} + +// See if we can use this cpu/vect. + +static cpuid_t +intr_bit_reserve_test(cpuid_t cpu, + int favor_subnode, + cnodeid_t cnode, + int req_bit, + int resflags, + devfs_handle_t owner_dev, + char *name, + int *resp_bit) +{ + ASSERT( (cpu == CPU_NONE) || (cnode == CNODEID_NONE) ); + + if (cnode != CNODEID_NONE) { + cpu = intr_cpu_choose_from_node(cnode); + } + + if (cpu != CPU_NONE) { + *resp_bit = do_intr_reserve_level(cpu, req_bit, 1); + if (*resp_bit >= 0) { + return(cpu); + } + } + return CPU_NONE; +} + +// Find the node to assign for this interrupt. + +cpuid_t +intr_heuristic(devfs_handle_t dev, + device_desc_t dev_desc, + int req_bit, + int resflags, + devfs_handle_t owner_dev, + char *name, + int *resp_bit) +{ + cpuid_t cpuid; + cnodeid_t candidate = -1; + devfs_handle_t pconn_vhdl; + pcibr_soft_t pcibr_soft; + +/* SN2 + pcibr addressing limitation */ +/* Due to this limitation, all interrupts from a given bridge must go to the name node.*/ +/* This limitation does not exist on PIC. */ + + if ( (hwgraph_edge_get(dev, EDGE_LBL_PCI, &pconn_vhdl) == GRAPH_SUCCESS) && + ( (pcibr_soft = pcibr_soft_get(pconn_vhdl) ) != NULL) ) { + if (pcibr_soft->bsi_err_intr) { + candidate = cpuid_to_cnodeid( ((hub_intr_t)pcibr_soft->bsi_err_intr)->i_cpuid); + } + } + + if (candidate >= 0) { + // The node was chosen already when we assigned the error interrupt. + cpuid = intr_bit_reserve_test(CPU_NONE, + 0, + candidate, + req_bit, + 0, + owner_dev, + name, + resp_bit); + } else { + // Need to choose one. Try the controlling c-brick first. + cpuid = intr_bit_reserve_test(CPU_NONE, + 0, + master_node_get(dev), + req_bit, + 0, + owner_dev, + name, + resp_bit); + } + + if (cpuid != CPU_NONE) { + return cpuid; + } + + if (candidate >= 0) { + printk("Cannot target interrupt to target node (%d).\n",candidate); + return CPU_NONE; + } else { + printk("Cannot target interrupt to closest node (%d) 0x%p\n", + master_node_get(dev), (void *)owner_dev); + } + + // We couldn't put it on the closest node. Try to find another one. + // Do a stupid round-robin assignment of the node. + + { + static cnodeid_t last_node = -1; + if (last_node >= numnodes) last_node = 0; + for (candidate = last_node + 1; candidate != last_node; candidate++) { + if (candidate == numnodes) candidate = 0; + cpuid = intr_bit_reserve_test(CPU_NONE, + 0, + candidate, + req_bit, + 0, + owner_dev, + name, + resp_bit); + if (cpuid != CPU_NONE) { + return cpuid; + } + } + } + + printk("cannot target interrupt: 0x%p\n",(void *)owner_dev); + return CPU_NONE; +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c --- linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,454 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __ia64 +uint64_t atealloc(struct map *mp, size_t size); +void atefree(struct map *mp, size_t size, uint64_t a); +void atemapfree(struct map *mp); +struct map *atemapalloc(uint64_t mapsiz); + +#define rmallocmap atemapalloc +#define rmfreemap atemapfree +#define rmfree atefree +#define rmalloc atealloc +#endif + + +#ifdef LATER +#if (PCIBR_FREEZE_TIME) || PCIBR_ATE_DEBUG +LOCAL struct reg_desc ate_bits[] = +{ + {0xFFFF000000000000ull, -48, "RMF", "%x"}, + {~(IOPGSIZE - 1) & /* may trim off some low bits */ + 0x0000FFFFFFFFF000ull, 0, "XIO", "%x"}, + {0x0000000000000F00ull, -8, "port", "%x"}, + {0x0000000000000010ull, 0, "Barrier"}, + {0x0000000000000008ull, 0, "Prefetch"}, + {0x0000000000000004ull, 0, "Precise"}, + {0x0000000000000002ull, 0, "Coherent"}, + {0x0000000000000001ull, 0, "Valid"}, + {0} +}; +#endif +#endif /* LATER */ + +#ifndef LOCAL +#define LOCAL static +#endif + +/* + * functions + */ +int pcibr_init_ext_ate_ram(bridge_t *); +int pcibr_ate_alloc(pcibr_soft_t, int); +void pcibr_ate_free(pcibr_soft_t, int, int); +bridge_ate_t pcibr_flags_to_ate(unsigned); +bridge_ate_p pcibr_ate_addr(pcibr_soft_t, int); +unsigned ate_freeze(pcibr_dmamap_t pcibr_dmamap, +#if PCIBR_FREEZE_TIME + unsigned *freeze_time_ptr, +#endif + unsigned *cmd_regs); +void ate_write(bridge_ate_p ate_ptr, int ate_count, bridge_ate_t ate); +void ate_thaw(pcibr_dmamap_t pcibr_dmamap, + int ate_index, +#if PCIBR_FREEZE_TIME + bridge_ate_t ate, + int ate_total, + unsigned freeze_time_start, +#endif + unsigned *cmd_regs, + unsigned s); + + +/* Convert from ssram_bits in control register to number of SSRAM entries */ +#define ATE_NUM_ENTRIES(n) _ate_info[n] + +/* Possible choices for number of ATE entries in Bridge's SSRAM */ +LOCAL int _ate_info[] = +{ + 0, /* 0 entries */ + 8 * 1024, /* 8K entries */ + 16 * 1024, /* 16K entries */ + 64 * 1024 /* 64K entries */ +}; + +#define ATE_NUM_SIZES (sizeof(_ate_info) / sizeof(int)) +#define ATE_PROBE_VALUE 0x0123456789abcdefULL + +/* + * Determine the size of this bridge's external mapping SSRAM, and set + * the control register appropriately to reflect this size, and initialize + * the external SSRAM. + */ +int +pcibr_init_ext_ate_ram(bridge_t *bridge) +{ + int largest_working_size = 0; + int num_entries, entry; + int i, j; + bridgereg_t old_enable, new_enable; + int s; + + /* Probe SSRAM to determine its size. */ + old_enable = bridge->b_int_enable; + new_enable = old_enable & ~BRIDGE_IMR_PCI_MST_TIMEOUT; + bridge->b_int_enable = new_enable; + + for (i = 1; i < ATE_NUM_SIZES; i++) { + /* Try writing a value */ + bridge->b_ext_ate_ram[ATE_NUM_ENTRIES(i) - 1] = ATE_PROBE_VALUE; + + /* Guard against wrap */ + for (j = 1; j < i; j++) + bridge->b_ext_ate_ram[ATE_NUM_ENTRIES(j) - 1] = 0; + + /* See if value was written */ + if (bridge->b_ext_ate_ram[ATE_NUM_ENTRIES(i) - 1] == ATE_PROBE_VALUE) + largest_working_size = i; + } + bridge->b_int_enable = old_enable; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + + /* + * ensure that we write and read without any interruption. + * The read following the write is required for the Bridge war + */ + + s = splhi(); + bridge->b_wid_control = (bridge->b_wid_control + & ~BRIDGE_CTRL_SSRAM_SIZE_MASK) + | BRIDGE_CTRL_SSRAM_SIZE(largest_working_size); + bridge->b_wid_control; /* inval addr bug war */ + splx(s); + + num_entries = ATE_NUM_ENTRIES(largest_working_size); + +#if PCIBR_ATE_DEBUG + if (num_entries) + printk("bridge at 0x%x: clearing %d external ATEs\n", bridge, num_entries); + else + printk("bridge at 0x%x: no external ATE RAM found\n", bridge); +#endif + + /* Initialize external mapping entries */ + for (entry = 0; entry < num_entries; entry++) + bridge->b_ext_ate_ram[entry] = 0; + + return (num_entries); +} + +/* + * Allocate "count" contiguous Bridge Address Translation Entries + * on the specified bridge to be used for PCI to XTALK mappings. + * Indices in rm map range from 1..num_entries. Indicies returned + * to caller range from 0..num_entries-1. + * + * Return the start index on success, -1 on failure. + */ +int +pcibr_ate_alloc(pcibr_soft_t pcibr_soft, int count) +{ + int index = 0; + + index = (int) rmalloc(pcibr_soft->bs_int_ate_map, (size_t) count); + + if (!index && pcibr_soft->bs_ext_ate_map) + index = (int) rmalloc(pcibr_soft->bs_ext_ate_map, (size_t) count); + + /* rmalloc manages resources in the 1..n + * range, with 0 being failure. + * pcibr_ate_alloc manages resources + * in the 0..n-1 range, with -1 being failure. + */ + return index - 1; +} + +void +pcibr_ate_free(pcibr_soft_t pcibr_soft, int index, int count) +/* Who says there's no such thing as a free meal? :-) */ +{ + /* note the "+1" since rmalloc handles 1..n but + * we start counting ATEs at zero. + */ + rmfree((index < pcibr_soft->bs_int_ate_size) + ? pcibr_soft->bs_int_ate_map + : pcibr_soft->bs_ext_ate_map, + count, index + 1); +} + +/* + * Convert PCI-generic software flags and Bridge-specific software flags + * into Bridge-specific Address Translation Entry attribute bits. + */ +bridge_ate_t +pcibr_flags_to_ate(unsigned flags) +{ + bridge_ate_t attributes; + + /* default if nothing specified: + * NOBARRIER + * NOPREFETCH + * NOPRECISE + * COHERENT + * Plus the valid bit + */ + attributes = ATE_CO | ATE_V; + + /* Generic macro flags + */ + if (flags & PCIIO_DMA_DATA) { /* standard data channel */ + attributes &= ~ATE_BAR; /* no barrier */ + attributes |= ATE_PREF; /* prefetch on */ + } + if (flags & PCIIO_DMA_CMD) { /* standard command channel */ + attributes |= ATE_BAR; /* barrier bit on */ + attributes &= ~ATE_PREF; /* disable prefetch */ + } + /* Generic detail flags + */ + if (flags & PCIIO_PREFETCH) + attributes |= ATE_PREF; + if (flags & PCIIO_NOPREFETCH) + attributes &= ~ATE_PREF; + + /* Provider-specific flags + */ + if (flags & PCIBR_BARRIER) + attributes |= ATE_BAR; + if (flags & PCIBR_NOBARRIER) + attributes &= ~ATE_BAR; + + if (flags & PCIBR_PREFETCH) + attributes |= ATE_PREF; + if (flags & PCIBR_NOPREFETCH) + attributes &= ~ATE_PREF; + + if (flags & PCIBR_PRECISE) + attributes |= ATE_PREC; + if (flags & PCIBR_NOPRECISE) + attributes &= ~ATE_PREC; + + return (attributes); +} + +/* + * Setup an Address Translation Entry as specified. Use either the Bridge + * internal maps or the external map RAM, as appropriate. + */ +bridge_ate_p +pcibr_ate_addr(pcibr_soft_t pcibr_soft, + int ate_index) +{ + bridge_t *bridge = pcibr_soft->bs_base; + + return (ate_index < pcibr_soft->bs_int_ate_size) + ? &(bridge->b_int_ate_ram[ate_index].wr) + : &(bridge->b_ext_ate_ram[ate_index]); +} + +/* We are starting to get more complexity + * surrounding writing ATEs, so pull + * the writing code into this new function. + */ + +#if PCIBR_FREEZE_TIME +#define ATE_FREEZE() s = ate_freeze(pcibr_dmamap, &freeze_time, cmd_regs) +#else +#define ATE_FREEZE() s = ate_freeze(pcibr_dmamap, cmd_regs) +#endif + +unsigned +ate_freeze(pcibr_dmamap_t pcibr_dmamap, +#if PCIBR_FREEZE_TIME + unsigned *freeze_time_ptr, +#endif + unsigned *cmd_regs) +{ + pcibr_soft_t pcibr_soft = pcibr_dmamap->bd_soft; +#ifdef LATER + int dma_slot = pcibr_dmamap->bd_slot; +#endif + int ext_ates = pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM; + int slot; + + unsigned long s; + unsigned cmd_reg; + volatile unsigned *cmd_lwa; + unsigned cmd_lwd; + + if (!ext_ates) + return 0; + + /* Bridge Hardware Bug WAR #484930: + * Bridge can't handle updating External ATEs + * while DMA is occuring that uses External ATEs, + * even if the particular ATEs involved are disjoint. + */ + + /* need to prevent anyone else from + * unfreezing the grant while we + * are working; also need to prevent + * this thread from being interrupted + * to keep PCI grant freeze time + * at an absolute minimum. + */ + s = pcibr_lock(pcibr_soft); + +#ifdef LATER + /* just in case pcibr_dmamap_done was not called */ + if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_BUSY) { + pcibr_dmamap->bd_flags &= ~PCIBR_DMAMAP_BUSY; + if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM) + atomic_dec(&(pcibr_soft->bs_slot[dma_slot]. bss_ext_ates_active)); + xtalk_dmamap_done(pcibr_dmamap->bd_xtalk); + } +#endif /* LATER */ +#if PCIBR_FREEZE_TIME + *freeze_time_ptr = get_timestamp(); +#endif + + cmd_lwa = 0; + for (slot = 0; slot < 8; ++slot) + if (atomic_read(&pcibr_soft->bs_slot[slot].bss_ext_ates_active)) { + cmd_reg = pcibr_soft-> + bs_slot[slot]. + bss_cmd_shadow; + if (cmd_reg & PCI_CMD_BUS_MASTER) { + cmd_lwa = pcibr_soft-> + bs_slot[slot]. + bss_cmd_pointer; + cmd_lwd = cmd_reg ^ PCI_CMD_BUS_MASTER; + cmd_lwa[0] = cmd_lwd; + } + cmd_regs[slot] = cmd_reg; + } else + cmd_regs[slot] = 0; + + if (cmd_lwa) { + bridge_t *bridge = pcibr_soft->bs_base; + + /* Read the last master bit that has been cleared. This PIO read + * on the PCI bus is to ensure the completion of any DMAs that + * are due to bus requests issued by PCI devices before the + * clearing of master bits. + */ + cmd_lwa[0]; + + /* Flush all the write buffers in the bridge */ + for (slot = 0; slot < 8; ++slot) + if (atomic_read(&pcibr_soft->bs_slot[slot].bss_ext_ates_active)) { + /* Flush the write buffer associated with this + * PCI device which might be using dma map RAM. + */ + bridge->b_wr_req_buf[slot].reg; + } + } + return s; +} + +#define ATE_WRITE() ate_write(ate_ptr, ate_count, ate) + +void +ate_write(bridge_ate_p ate_ptr, + int ate_count, + bridge_ate_t ate) +{ + while (ate_count-- > 0) { + *ate_ptr++ = ate; + ate += IOPGSIZE; + } +} + +#if PCIBR_FREEZE_TIME +#define ATE_THAW() ate_thaw(pcibr_dmamap, ate_index, ate, ate_total, freeze_time, cmd_regs, s) +#else +#define ATE_THAW() ate_thaw(pcibr_dmamap, ate_index, cmd_regs, s) +#endif + +void +ate_thaw(pcibr_dmamap_t pcibr_dmamap, + int ate_index, +#if PCIBR_FREEZE_TIME + bridge_ate_t ate, + int ate_total, + unsigned freeze_time_start, +#endif + unsigned *cmd_regs, + unsigned s) +{ + pcibr_soft_t pcibr_soft = pcibr_dmamap->bd_soft; + int dma_slot = pcibr_dmamap->bd_slot; + int slot; + bridge_t *bridge = pcibr_soft->bs_base; + int ext_ates = pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM; + + unsigned cmd_reg; + +#if PCIBR_FREEZE_TIME + unsigned freeze_time; + static unsigned max_freeze_time = 0; + static unsigned max_ate_total; +#endif + + if (!ext_ates) + return; + + /* restore cmd regs */ + for (slot = 0; slot < 8; ++slot) + if ((cmd_reg = cmd_regs[slot]) & PCI_CMD_BUS_MASTER) + bridge->b_type0_cfg_dev[slot].l[PCI_CFG_COMMAND / 4] = cmd_reg; + + pcibr_dmamap->bd_flags |= PCIBR_DMAMAP_BUSY; + atomic_inc(&(pcibr_soft->bs_slot[dma_slot]. bss_ext_ates_active)); + +#if PCIBR_FREEZE_TIME + freeze_time = get_timestamp() - freeze_time_start; + + if ((max_freeze_time < freeze_time) || + (max_ate_total < ate_total)) { + if (max_freeze_time < freeze_time) + max_freeze_time = freeze_time; + if (max_ate_total < ate_total) + max_ate_total = ate_total; + pcibr_unlock(pcibr_soft, s); + printk("%s: pci freeze time %d usec for %d ATEs\n" + "\tfirst ate: %R\n", + pcibr_soft->bs_name, + freeze_time * 1000 / 1250, + ate_total, + ate, ate_bits); + } else +#endif + pcibr_unlock(pcibr_soft, s); +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_config.c lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_config.c --- linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_config.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_config.c Tue Feb 26 13:19:35 2002 @@ -0,0 +1,167 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern pcibr_info_t pcibr_info_get(devfs_handle_t); + +uint64_t pcibr_config_get(devfs_handle_t, unsigned, unsigned); +uint64_t do_pcibr_config_get(cfg_p, unsigned, unsigned); +void pcibr_config_set(devfs_handle_t, unsigned, unsigned, uint64_t); +void do_pcibr_config_set(cfg_p, unsigned, unsigned, uint64_t); + +#ifdef LITTLE_ENDIAN +#ifdef CONFIG_IA64_SGI_SN1 +/* + * on sn-ia we need to twiddle the the addresses going out + * the pci bus because we use the unswizzled synergy space + * (the alternative is to use the swizzled synergy space + * and byte swap the data) + */ +#define CB(b,r) (((volatile uint8_t *) b)[((r)^4)]) +#define CS(b,r) (((volatile uint16_t *) b)[((r^4)/2)]) +#define CW(b,r) (((volatile uint32_t *) b)[((r^4)/4)]) +#else +#ifdef CONFIG_IA64_SGI_SN2 +/* + * On sn-ia sn2 everything is little endian. No swizzling + * or byte swapping of addresses required. + */ +#define CB(b,r) (((volatile uint8_t *) b)[(r)]) +#define CS(b,r) (((volatile uint16_t *) b)[(r)/2]) +#define CW(b,r) (((volatile uint32_t *) b)[(r)/4]) +#endif +#endif +#else +#define CB(b,r) (((volatile uint8_t *) cfgbase)[(r)^3]) +#define CS(b,r) (((volatile uint16_t *) cfgbase)[((r)/2)^1]) +#define CW(b,r) (((volatile uint32_t *) cfgbase)[(r)/4]) +#endif + + +cfg_p +pcibr_config_addr(devfs_handle_t conn, + unsigned reg) +{ + pcibr_info_t pcibr_info; + pciio_slot_t pciio_slot; + pciio_function_t pciio_func; + pcibr_soft_t pcibr_soft; + bridge_t *bridge; + cfg_p cfgbase = (cfg_p)0; + + pcibr_info = pcibr_info_get(conn); + + pciio_slot = pcibr_info->f_slot; + if (pciio_slot == PCIIO_SLOT_NONE) + pciio_slot = PCI_TYPE1_SLOT(reg); + + pciio_func = pcibr_info->f_func; + if (pciio_func == PCIIO_FUNC_NONE) + pciio_func = PCI_TYPE1_FUNC(reg); + + pcibr_soft = (pcibr_soft_t) pcibr_info->f_mfast; + + bridge = pcibr_soft->bs_base; + + cfgbase = bridge->b_type0_cfg_dev[pciio_slot].f[pciio_func].l; + + return cfgbase; +} + +uint64_t +pcibr_config_get(devfs_handle_t conn, + unsigned reg, + unsigned size) +{ + return do_pcibr_config_get(pcibr_config_addr(conn, reg), + PCI_TYPE1_REG(reg), size); +} + +uint64_t +do_pcibr_config_get( + cfg_p cfgbase, + unsigned reg, + unsigned size) +{ + unsigned value; + + value = CW(cfgbase, reg); + + if (reg & 3) + value >>= 8 * (reg & 3); + if (size < 4) + value &= (1 << (8 * size)) - 1; + return value; +} + +void +pcibr_config_set(devfs_handle_t conn, + unsigned reg, + unsigned size, + uint64_t value) +{ + do_pcibr_config_set(pcibr_config_addr(conn, reg), + PCI_TYPE1_REG(reg), size, value); +} + +void +do_pcibr_config_set(cfg_p cfgbase, + unsigned reg, + unsigned size, + uint64_t value) +{ + switch (size) { + case 1: + CB(cfgbase, reg) = value; + break; + case 2: + if (reg & 1) { + CB(cfgbase, reg) = value; + CB(cfgbase, reg + 1) = value >> 8; + } else + CS(cfgbase, reg) = value; + break; + case 3: + if (reg & 1) { + CB(cfgbase, reg) = value; + CS(cfgbase, (reg + 1)) = value >> 8; + } else { + CS(cfgbase, reg) = value; + CB(cfgbase, reg + 2) = value >> 16; + } + break; + + case 4: + CW(cfgbase, reg) = value; + break; + } +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c --- linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c Tue Feb 26 13:19:35 2002 @@ -0,0 +1,4288 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __ia64 +#define rmallocmap atemapalloc +#define rmfreemap atemapfree +#define rmfree atefree +#define rmalloc atealloc +#endif + +/* + * Macros related to the Lucent USS 302/312 usb timeout workaround. It + * appears that if the lucent part can get into a retry loop if it sees a + * DAC on the bus during a pio read retry. The loop is broken after about + * 1ms, so we need to set up bridges holding this part to allow at least + * 1ms for pio. + */ + +#define USS302_TIMEOUT_WAR + +#ifdef USS302_TIMEOUT_WAR +#define LUCENT_USBHC_VENDOR_ID_NUM 0x11c1 +#define LUCENT_USBHC302_DEVICE_ID_NUM 0x5801 +#define LUCENT_USBHC312_DEVICE_ID_NUM 0x5802 +#define USS302_BRIDGE_TIMEOUT_HLD 4 +#endif + +int pcibr_devflag = D_MP; + +/* + * This is the file operation table for the pcibr driver. + * As each of the functions are implemented, put the + * appropriate function name below. + */ +struct file_operations pcibr_fops = { + owner: THIS_MODULE, + llseek: NULL, + read: NULL, + write: NULL, + readdir: NULL, + poll: NULL, + ioctl: NULL, + mmap: NULL, + open: NULL, + flush: NULL, + release: NULL, + fsync: NULL, + fasync: NULL, + lock: NULL, + readv: NULL, + writev: NULL +}; + +#ifdef LATER + +#if PCIBR_ATE_DEBUG +static struct reg_values ssram_sizes[] = +{ + {BRIDGE_CTRL_SSRAM_512K, "512k"}, + {BRIDGE_CTRL_SSRAM_128K, "128k"}, + {BRIDGE_CTRL_SSRAM_64K, "64k"}, + {BRIDGE_CTRL_SSRAM_1K, "1k"}, + {0} +}; + +static struct reg_desc control_bits[] = +{ + {BRIDGE_CTRL_FLASH_WR_EN, 0, "FLASH_WR_EN"}, + {BRIDGE_CTRL_EN_CLK50, 0, "EN_CLK50"}, + {BRIDGE_CTRL_EN_CLK40, 0, "EN_CLK40"}, + {BRIDGE_CTRL_EN_CLK33, 0, "EN_CLK33"}, + {BRIDGE_CTRL_RST_MASK, -24, "RST", "%x"}, + {BRIDGE_CTRL_IO_SWAP, 0, "IO_SWAP"}, + {BRIDGE_CTRL_MEM_SWAP, 0, "MEM_SWAP"}, + {BRIDGE_CTRL_PAGE_SIZE, 0, "PAGE_SIZE"}, + {BRIDGE_CTRL_SS_PAR_BAD, 0, "SS_PAR_BAD"}, + {BRIDGE_CTRL_SS_PAR_EN, 0, "SS_PAR_EN"}, + {BRIDGE_CTRL_SSRAM_SIZE_MASK, 0, "SSRAM_SIZE", 0, ssram_sizes}, + {BRIDGE_CTRL_F_BAD_PKT, 0, "F_BAD_PKT"}, + {BRIDGE_CTRL_LLP_XBAR_CRD_MASK, -12, "LLP_XBAR_CRD", "%d"}, + {BRIDGE_CTRL_CLR_RLLP_CNT, 0, "CLR_RLLP_CNT"}, + {BRIDGE_CTRL_CLR_TLLP_CNT, 0, "CLR_TLLP_CNT"}, + {BRIDGE_CTRL_SYS_END, 0, "SYS_END"}, + + {BRIDGE_CTRL_BUS_SPEED_MASK, -4, "BUS_SPEED", "%d"}, + {BRIDGE_CTRL_WIDGET_ID_MASK, 0, "WIDGET_ID", "%x"}, + {0} +}; +#endif +#endif /* LATER */ + +/* kbrick widgetnum-to-bus layout */ +int p_busnum[MAX_PORT_NUM] = { /* widget# */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x0 - 0x7 */ + 2, /* 0x8 */ + 1, /* 0x9 */ + 0, 0, /* 0xa - 0xb */ + 5, /* 0xc */ + 6, /* 0xd */ + 4, /* 0xe */ + 3, /* 0xf */ +}; + +/* + * Additional PIO spaces per slot are + * recorded in this structure. + */ +struct pciio_piospace_s { + pciio_piospace_t next; /* another space for this device */ + char free; /* 1 if free, 0 if in use */ + pciio_space_t space; /* Which space is in use */ + iopaddr_t start; /* Starting address of the PIO space */ + size_t count; /* size of PIO space */ +}; + +#if PCIBR_SOFT_LIST +pcibr_list_p pcibr_list = 0; +#endif + +extern int hwgraph_vertex_name_get(devfs_handle_t vhdl, char *buf, uint buflen); +extern int hub_device_flags_set(devfs_handle_t widget_dev, hub_widget_flags_t flags); +extern long atoi(register char *p); +extern cnodeid_t nodevertex_to_cnodeid(devfs_handle_t vhdl); +extern void *swap_ptr(void **loc, void *new); +extern char *dev_to_name(devfs_handle_t dev, char *buf, uint buflen); +extern struct map *atemapalloc(uint64_t); +extern void atefree(struct map *, size_t, uint64_t); +extern void atemapfree(struct map *); +extern pciio_dmamap_t get_free_pciio_dmamap(devfs_handle_t); +extern void free_pciio_dmamap(pcibr_dmamap_t); + +#define ATE_WRITE() ate_write(ate_ptr, ate_count, ate) +#if PCIBR_FREEZE_TIME +#define ATE_FREEZE() s = ate_freeze(pcibr_dmamap, &freeze_time, cmd_regs) +#else +#define ATE_FREEZE() s = ate_freeze(pcibr_dmamap, cmd_regs) +#endif /* PCIBR_FREEZE_TIME */ + +#if PCIBR_FREEZE_TIME +#define ATE_THAW() ate_thaw(pcibr_dmamap, ate_index, ate, ate_total, freeze_time, cmd_regs, s) +#else +#define ATE_THAW() ate_thaw(pcibr_dmamap, ate_index, cmd_regs, s) +#endif + + +/* ===================================================================== + * Function Table of Contents + * + * The order of functions in this file has stopped + * making much sense. We might want to take a look + * at it some time and bring back some sanity, or + * perhaps bust this file into smaller chunks. + */ + +extern void do_pcibr_rrb_clear(bridge_t *, int); +extern void do_pcibr_rrb_flush(bridge_t *, int); +extern int do_pcibr_rrb_count_valid(bridge_t *, pciio_slot_t); +extern int do_pcibr_rrb_count_avail(bridge_t *, pciio_slot_t); +extern int do_pcibr_rrb_alloc(bridge_t *, pciio_slot_t, int); +extern int do_pcibr_rrb_free(bridge_t *, pciio_slot_t, int); + +extern void do_pcibr_rrb_autoalloc(pcibr_soft_t, int, int); + +extern int pcibr_wrb_flush(devfs_handle_t); +extern int pcibr_rrb_alloc(devfs_handle_t, int *, int *); +extern int pcibr_rrb_check(devfs_handle_t, int *, int *, int *, int *); +extern int pcibr_alloc_all_rrbs(devfs_handle_t, int, int, int, int, int, int, int, int, int); +extern void pcibr_rrb_flush(devfs_handle_t); + +static int pcibr_try_set_device(pcibr_soft_t, pciio_slot_t, unsigned, bridgereg_t); +void pcibr_release_device(pcibr_soft_t, pciio_slot_t, bridgereg_t); + +extern void pcibr_clearwidint(bridge_t *); +extern void pcibr_setwidint(xtalk_intr_t); + +void pcibr_init(void); +int pcibr_attach(devfs_handle_t); +int pcibr_detach(devfs_handle_t); +int pcibr_open(devfs_handle_t *, int, int, cred_t *); +int pcibr_close(devfs_handle_t, int, int, cred_t *); +int pcibr_map(devfs_handle_t, vhandl_t *, off_t, size_t, uint); +int pcibr_unmap(devfs_handle_t, vhandl_t *); +int pcibr_ioctl(devfs_handle_t, int, void *, int, struct cred *, int *); + +void pcibr_freeblock_sub(iopaddr_t *, iopaddr_t *, iopaddr_t, size_t); + +extern int pcibr_init_ext_ate_ram(bridge_t *); +extern int pcibr_ate_alloc(pcibr_soft_t, int); +extern void pcibr_ate_free(pcibr_soft_t, int, int); + +extern unsigned ate_freeze(pcibr_dmamap_t pcibr_dmamap, +#if PCIBR_FREEZE_TIME + unsigned *freeze_time_ptr, +#endif + unsigned *cmd_regs); +extern void ate_write(bridge_ate_p ate_ptr, int ate_count, bridge_ate_t ate); +extern void ate_thaw(pcibr_dmamap_t pcibr_dmamap, int ate_index, +#if PCIBR_FREEZE_TIME + bridge_ate_t ate, + int ate_total, + unsigned freeze_time_start, +#endif + unsigned *cmd_regs, + unsigned s); + +pcibr_info_t pcibr_info_get(devfs_handle_t); + +static iopaddr_t pcibr_addr_pci_to_xio(devfs_handle_t, pciio_slot_t, pciio_space_t, iopaddr_t, size_t, unsigned); + +pcibr_piomap_t pcibr_piomap_alloc(devfs_handle_t, device_desc_t, pciio_space_t, iopaddr_t, size_t, size_t, unsigned); +void pcibr_piomap_free(pcibr_piomap_t); +caddr_t pcibr_piomap_addr(pcibr_piomap_t, iopaddr_t, size_t); +void pcibr_piomap_done(pcibr_piomap_t); +caddr_t pcibr_piotrans_addr(devfs_handle_t, device_desc_t, pciio_space_t, iopaddr_t, size_t, unsigned); +iopaddr_t pcibr_piospace_alloc(devfs_handle_t, device_desc_t, pciio_space_t, size_t, size_t); +void pcibr_piospace_free(devfs_handle_t, pciio_space_t, iopaddr_t, size_t); + +static iopaddr_t pcibr_flags_to_d64(unsigned, pcibr_soft_t); +extern bridge_ate_t pcibr_flags_to_ate(unsigned); + +pcibr_dmamap_t pcibr_dmamap_alloc(devfs_handle_t, device_desc_t, size_t, unsigned); +void pcibr_dmamap_free(pcibr_dmamap_t); +extern bridge_ate_p pcibr_ate_addr(pcibr_soft_t, int); +static iopaddr_t pcibr_addr_xio_to_pci(pcibr_soft_t, iopaddr_t, size_t); +iopaddr_t pcibr_dmamap_addr(pcibr_dmamap_t, paddr_t, size_t); +alenlist_t pcibr_dmamap_list(pcibr_dmamap_t, alenlist_t, unsigned); +void pcibr_dmamap_done(pcibr_dmamap_t); +cnodeid_t pcibr_get_dmatrans_node(devfs_handle_t); +iopaddr_t pcibr_dmatrans_addr(devfs_handle_t, device_desc_t, paddr_t, size_t, unsigned); +alenlist_t pcibr_dmatrans_list(devfs_handle_t, device_desc_t, alenlist_t, unsigned); +void pcibr_dmamap_drain(pcibr_dmamap_t); +void pcibr_dmaaddr_drain(devfs_handle_t, paddr_t, size_t); +void pcibr_dmalist_drain(devfs_handle_t, alenlist_t); +iopaddr_t pcibr_dmamap_pciaddr_get(pcibr_dmamap_t); + +extern unsigned pcibr_intr_bits(pciio_info_t info, pciio_intr_line_t lines); +extern pcibr_intr_t pcibr_intr_alloc(devfs_handle_t, device_desc_t, pciio_intr_line_t, devfs_handle_t); +extern void pcibr_intr_free(pcibr_intr_t); +extern void pcibr_setpciint(xtalk_intr_t); +extern int pcibr_intr_connect(pcibr_intr_t); +extern void pcibr_intr_disconnect(pcibr_intr_t); + +extern devfs_handle_t pcibr_intr_cpu_get(pcibr_intr_t); +extern void pcibr_xintr_preset(void *, int, xwidgetnum_t, iopaddr_t, xtalk_intr_vector_t); +extern void pcibr_intr_func(intr_arg_t); + +extern void print_bridge_errcmd(uint32_t, char *); + +extern void pcibr_error_dump(pcibr_soft_t); +extern uint32_t pcibr_errintr_group(uint32_t); +extern void pcibr_pioerr_check(pcibr_soft_t); +extern void pcibr_error_intr_handler(intr_arg_t); + +extern int pcibr_addr_toslot(pcibr_soft_t, iopaddr_t, pciio_space_t *, iopaddr_t *, pciio_function_t *); +extern void pcibr_error_cleanup(pcibr_soft_t, int); +extern void pcibr_device_disable(pcibr_soft_t, int); +extern int pcibr_pioerror(pcibr_soft_t, int, ioerror_mode_t, ioerror_t *); +extern int pcibr_dmard_error(pcibr_soft_t, int, ioerror_mode_t, ioerror_t *); +extern int pcibr_dmawr_error(pcibr_soft_t, int, ioerror_mode_t, ioerror_t *); +extern int pcibr_error_handler(error_handler_arg_t, int, ioerror_mode_t, ioerror_t *); +extern int pcibr_error_devenable(devfs_handle_t, int); + +void pcibr_provider_startup(devfs_handle_t); +void pcibr_provider_shutdown(devfs_handle_t); + +int pcibr_reset(devfs_handle_t); +pciio_endian_t pcibr_endian_set(devfs_handle_t, pciio_endian_t, pciio_endian_t); +int pcibr_priority_bits_set(pcibr_soft_t, pciio_slot_t, pciio_priority_t); +pciio_priority_t pcibr_priority_set(devfs_handle_t, pciio_priority_t); +int pcibr_device_flags_set(devfs_handle_t, pcibr_device_flags_t); + +extern cfg_p pcibr_config_addr(devfs_handle_t, unsigned); +extern uint64_t pcibr_config_get(devfs_handle_t, unsigned, unsigned); +extern void pcibr_config_set(devfs_handle_t, unsigned, unsigned, uint64_t); +extern void do_pcibr_config_set(cfg_p, unsigned, unsigned, uint64_t); + +extern pcibr_hints_t pcibr_hints_get(devfs_handle_t, int); +extern void pcibr_hints_fix_rrbs(devfs_handle_t); +extern void pcibr_hints_dualslot(devfs_handle_t, pciio_slot_t, pciio_slot_t); +extern void pcibr_hints_intr_bits(devfs_handle_t, pcibr_intr_bits_f *); +extern void pcibr_set_rrb_callback(devfs_handle_t, rrb_alloc_funct_t); +extern void pcibr_hints_handsoff(devfs_handle_t); +extern void pcibr_hints_subdevs(devfs_handle_t, pciio_slot_t, uint64_t); + +#ifdef BRIDGE_B_DATACORR_WAR +extern int ql_bridge_rev_b_war(devfs_handle_t); +extern int bridge_rev_b_data_check_disable; +char *rev_b_datacorr_warning = +"***************************** WARNING! ******************************\n"; +char *rev_b_datacorr_mesg = +"UNRECOVERABLE IO LINK ERROR. CONTACT SERVICE PROVIDER\n"; +#endif + +extern int pcibr_slot_reset(devfs_handle_t,pciio_slot_t); +extern int pcibr_slot_info_init(devfs_handle_t,pciio_slot_t); +extern int pcibr_slot_info_free(devfs_handle_t,pciio_slot_t); +extern int pcibr_slot_addr_space_init(devfs_handle_t,pciio_slot_t); +extern int pcibr_slot_device_init(devfs_handle_t, pciio_slot_t); +extern int pcibr_slot_guest_info_init(devfs_handle_t,pciio_slot_t); +extern int pcibr_slot_call_device_attach(devfs_handle_t, pciio_slot_t, int); +extern int pcibr_slot_call_device_detach(devfs_handle_t, pciio_slot_t, int); +extern int pcibr_slot_attach(devfs_handle_t, pciio_slot_t, int, char *, int *); +extern int pcibr_slot_detach(devfs_handle_t, pciio_slot_t, int); +extern int pcibr_is_slot_sys_critical(devfs_handle_t, pciio_slot_t); + +#ifdef LATER +extern int pcibr_slot_startup(devfs_handle_t, pcibr_slot_req_t); +extern int pcibr_slot_shutdown(devfs_handle_t, pcibr_slot_req_t); +extern int pcibr_slot_query(devfs_handle_t, pcibr_slot_req_t); +#endif + +extern int pcibr_slot_initial_rrb_alloc(devfs_handle_t, pciio_slot_t); +extern int pcibr_initial_rrb(devfs_handle_t, pciio_slot_t, pciio_slot_t); + + + +/* ===================================================================== + * Device(x) register management + */ + +/* pcibr_try_set_device: attempt to modify Device(x) + * for the specified slot on the specified bridge + * as requested in flags, limited to the specified + * bits. Returns which BRIDGE bits were in conflict, + * or ZERO if everything went OK. + * + * Caller MUST hold pcibr_lock when calling this function. + */ +static int +pcibr_try_set_device(pcibr_soft_t pcibr_soft, + pciio_slot_t slot, + unsigned flags, + bridgereg_t mask) +{ + bridge_t *bridge; + pcibr_soft_slot_t slotp; + bridgereg_t old; + bridgereg_t new; + bridgereg_t chg; + bridgereg_t bad; + bridgereg_t badpmu; + bridgereg_t badd32; + bridgereg_t badd64; + bridgereg_t fix; + unsigned long s; + bridgereg_t xmask; + + xmask = mask; + if (pcibr_soft->bs_xbridge) { + if (mask == BRIDGE_DEV_PMU_BITS) + xmask = XBRIDGE_DEV_PMU_BITS; + if (mask == BRIDGE_DEV_D64_BITS) + xmask = XBRIDGE_DEV_D64_BITS; + } + + slotp = &pcibr_soft->bs_slot[slot]; + + s = pcibr_lock(pcibr_soft); + + bridge = pcibr_soft->bs_base; + + old = slotp->bss_device; + + /* figure out what the desired + * Device(x) bits are based on + * the flags specified. + */ + + new = old; + + /* Currently, we inherit anything that + * the new caller has not specified in + * one way or another, unless we take + * action here to not inherit. + * + * This is needed for the "swap" stuff, + * since it could have been set via + * pcibr_endian_set -- altho note that + * any explicit PCIBR_BYTE_STREAM or + * PCIBR_WORD_VALUES will freely override + * the effect of that call (and vice + * versa, no protection either way). + * + * I want to get rid of pcibr_endian_set + * in favor of tracking DMA endianness + * using the flags specified when DMA + * channels are created. + */ + +#define BRIDGE_DEV_WRGA_BITS (BRIDGE_DEV_PMU_WRGA_EN | BRIDGE_DEV_DIR_WRGA_EN) +#define BRIDGE_DEV_SWAP_BITS (BRIDGE_DEV_SWAP_PMU | BRIDGE_DEV_SWAP_DIR) + + /* Do not use Barrier, Write Gather, + * or Prefetch unless asked. + * Leave everything else as it + * was from the last time. + */ + new = new + & ~BRIDGE_DEV_BARRIER + & ~BRIDGE_DEV_WRGA_BITS + & ~BRIDGE_DEV_PREF + ; + + /* Generic macro flags + */ + if (flags & PCIIO_DMA_DATA) { + new = (new + & ~BRIDGE_DEV_BARRIER) /* barrier off */ + | BRIDGE_DEV_PREF; /* prefetch on */ + + } + if (flags & PCIIO_DMA_CMD) { + new = ((new + & ~BRIDGE_DEV_PREF) /* prefetch off */ + & ~BRIDGE_DEV_WRGA_BITS) /* write gather off */ + | BRIDGE_DEV_BARRIER; /* barrier on */ + } + /* Generic detail flags + */ + if (flags & PCIIO_WRITE_GATHER) + new |= BRIDGE_DEV_WRGA_BITS; + if (flags & PCIIO_NOWRITE_GATHER) + new &= ~BRIDGE_DEV_WRGA_BITS; + + if (flags & PCIIO_PREFETCH) + new |= BRIDGE_DEV_PREF; + if (flags & PCIIO_NOPREFETCH) + new &= ~BRIDGE_DEV_PREF; + + if (flags & PCIBR_WRITE_GATHER) + new |= BRIDGE_DEV_WRGA_BITS; + if (flags & PCIBR_NOWRITE_GATHER) + new &= ~BRIDGE_DEV_WRGA_BITS; + + if (flags & PCIIO_BYTE_STREAM) + new |= (pcibr_soft->bs_xbridge) ? + BRIDGE_DEV_SWAP_DIR : BRIDGE_DEV_SWAP_BITS; + if (flags & PCIIO_WORD_VALUES) + new &= (pcibr_soft->bs_xbridge) ? + ~BRIDGE_DEV_SWAP_DIR : ~BRIDGE_DEV_SWAP_BITS; + + /* Provider-specific flags + */ + if (flags & PCIBR_PREFETCH) + new |= BRIDGE_DEV_PREF; + if (flags & PCIBR_NOPREFETCH) + new &= ~BRIDGE_DEV_PREF; + + if (flags & PCIBR_PRECISE) + new |= BRIDGE_DEV_PRECISE; + if (flags & PCIBR_NOPRECISE) + new &= ~BRIDGE_DEV_PRECISE; + + if (flags & PCIBR_BARRIER) + new |= BRIDGE_DEV_BARRIER; + if (flags & PCIBR_NOBARRIER) + new &= ~BRIDGE_DEV_BARRIER; + + if (flags & PCIBR_64BIT) + new |= BRIDGE_DEV_DEV_SIZE; + if (flags & PCIBR_NO64BIT) + new &= ~BRIDGE_DEV_DEV_SIZE; + + chg = old ^ new; /* what are we changing, */ + chg &= xmask; /* of the interesting bits */ + + if (chg) { + + badd32 = slotp->bss_d32_uctr ? (BRIDGE_DEV_D32_BITS & chg) : 0; + if (pcibr_soft->bs_xbridge) { + badpmu = slotp->bss_pmu_uctr ? (XBRIDGE_DEV_PMU_BITS & chg) : 0; + badd64 = slotp->bss_d64_uctr ? (XBRIDGE_DEV_D64_BITS & chg) : 0; + } else { + badpmu = slotp->bss_pmu_uctr ? (BRIDGE_DEV_PMU_BITS & chg) : 0; + badd64 = slotp->bss_d64_uctr ? (BRIDGE_DEV_D64_BITS & chg) : 0; + } + bad = badpmu | badd32 | badd64; + + if (bad) { + + /* some conflicts can be resolved by + * forcing the bit on. this may cause + * some performance degredation in + * the stream(s) that want the bit off, + * but the alternative is not allowing + * the new stream at all. + */ + if ( (fix = bad & (BRIDGE_DEV_PRECISE | + BRIDGE_DEV_BARRIER)) ){ + bad &= ~fix; + /* don't change these bits if + * they are already set in "old" + */ + chg &= ~(fix & old); + } + /* some conflicts can be resolved by + * forcing the bit off. this may cause + * some performance degredation in + * the stream(s) that want the bit on, + * but the alternative is not allowing + * the new stream at all. + */ + if ( (fix = bad & (BRIDGE_DEV_WRGA_BITS | + BRIDGE_DEV_PREF)) ) { + bad &= ~fix; + /* don't change these bits if + * we wanted to turn them on. + */ + chg &= ~(fix & new); + } + /* conflicts in other bits mean + * we can not establish this DMA + * channel while the other(s) are + * still present. + */ + if (bad) { + pcibr_unlock(pcibr_soft, s); +#if (DEBUG && PCIBR_DEV_DEBUG) + printk("pcibr_try_set_device: mod blocked by %R\n", bad, device_bits); +#endif + return bad; + } + } + } + if (mask == BRIDGE_DEV_PMU_BITS) + slotp->bss_pmu_uctr++; + if (mask == BRIDGE_DEV_D32_BITS) + slotp->bss_d32_uctr++; + if (mask == BRIDGE_DEV_D64_BITS) + slotp->bss_d64_uctr++; + + /* the value we want to write is the + * original value, with the bits for + * our selected changes flipped, and + * with any disabled features turned off. + */ + new = old ^ chg; /* only change what we want to change */ + + if (slotp->bss_device == new) { + pcibr_unlock(pcibr_soft, s); + return 0; + } + bridge->b_device[slot].reg = new; + slotp->bss_device = new; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + pcibr_unlock(pcibr_soft, s); +#if DEBUG && PCIBR_DEV_DEBUG + printk("pcibr Device(%d): 0x%p\n", slot, bridge->b_device[slot].reg); +#endif + + return 0; +} + +void +pcibr_release_device(pcibr_soft_t pcibr_soft, + pciio_slot_t slot, + bridgereg_t mask) +{ + pcibr_soft_slot_t slotp; + unsigned long s; + + slotp = &pcibr_soft->bs_slot[slot]; + + s = pcibr_lock(pcibr_soft); + + if (mask == BRIDGE_DEV_PMU_BITS) + slotp->bss_pmu_uctr--; + if (mask == BRIDGE_DEV_D32_BITS) + slotp->bss_d32_uctr--; + if (mask == BRIDGE_DEV_D64_BITS) + slotp->bss_d64_uctr--; + + pcibr_unlock(pcibr_soft, s); +} + +/* + * flush write gather buffer for slot + */ +static void +pcibr_device_write_gather_flush(pcibr_soft_t pcibr_soft, + pciio_slot_t slot) +{ + bridge_t *bridge; + unsigned long s; + volatile uint32_t wrf; + s = pcibr_lock(pcibr_soft); + bridge = pcibr_soft->bs_base; + wrf = bridge->b_wr_req_buf[slot].reg; + pcibr_unlock(pcibr_soft, s); +} + +/* ===================================================================== + * Bridge (pcibr) "Device Driver" entry points + */ + + +/* + * pcibr_init: called once during system startup or + * when a loadable driver is loaded. + * + * The driver_register function should normally + * be in _reg, not _init. But the pcibr driver is + * required by devinit before the _reg routines + * are called, so this is an exception. + */ +void +pcibr_init(void) +{ +#if DEBUG && ATTACH_DEBUG + printk("pcibr_init\n"); +#endif + + xwidget_driver_register(XBRIDGE_WIDGET_PART_NUM, + XBRIDGE_WIDGET_MFGR_NUM, + "pcibr_", + 0); + xwidget_driver_register(BRIDGE_WIDGET_PART_NUM, + BRIDGE_WIDGET_MFGR_NUM, + "pcibr_", + 0); +} + +/* + * open/close mmap/munmap interface would be used by processes + * that plan to map the PCI bridge, and muck around with the + * registers. This is dangerous to do, and will be allowed + * to a select brand of programs. Typically these are + * diagnostics programs, or some user level commands we may + * write to do some weird things. + * To start with expect them to have root priveleges. + * We will ask for more later. + */ +/* ARGSUSED */ +int +pcibr_open(devfs_handle_t *devp, int oflag, int otyp, cred_t *credp) +{ + return 0; +} + +/*ARGSUSED */ +int +pcibr_close(devfs_handle_t dev, int oflag, int otyp, cred_t *crp) +{ + return 0; +} + +/*ARGSUSED */ +int +pcibr_map(devfs_handle_t dev, vhandl_t *vt, off_t off, size_t len, uint prot) +{ + int error; + devfs_handle_t vhdl = dev_to_vhdl(dev); + devfs_handle_t pcibr_vhdl = hwgraph_connectpt_get(vhdl); + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); + bridge_t *bridge = pcibr_soft->bs_base; + + hwgraph_vertex_unref(pcibr_vhdl); + + ASSERT(pcibr_soft); + len = ctob(btoc(len)); /* Make len page aligned */ + error = v_mapphys(vt, (void *) ((__psunsigned_t) bridge + off), len); + + /* + * If the offset being mapped corresponds to the flash prom + * base, and if the mapping succeeds, and if the user + * has requested the protections to be WRITE, enable the + * flash prom to be written. + * + * XXX- deprecate this in favor of using the + * real flash driver ... + */ + if (!error && + ((off == BRIDGE_EXTERNAL_FLASH) || + (len > BRIDGE_EXTERNAL_FLASH))) { + int s; + + /* + * ensure that we write and read without any interruption. + * The read following the write is required for the Bridge war + */ + s = splhi(); + bridge->b_wid_control |= BRIDGE_CTRL_FLASH_WR_EN; + bridge->b_wid_control; /* inval addr bug war */ + splx(s); + } + + return error; +} + +/*ARGSUSED */ +int +pcibr_unmap(devfs_handle_t dev, vhandl_t *vt) +{ + devfs_handle_t pcibr_vhdl = hwgraph_connectpt_get((devfs_handle_t) dev); + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); + bridge_t *bridge = pcibr_soft->bs_base; + + hwgraph_vertex_unref(pcibr_vhdl); + + /* + * If flashprom write was enabled, disable it, as + * this is the last unmap. + */ + if (bridge->b_wid_control & BRIDGE_CTRL_FLASH_WR_EN) { + int s; + + /* + * ensure that we write and read without any interruption. + * The read following the write is required for the Bridge war + */ + s = splhi(); + bridge->b_wid_control &= ~BRIDGE_CTRL_FLASH_WR_EN; + bridge->b_wid_control; /* inval addr bug war */ + splx(s); + } + return 0; +} + +/* This is special case code used by grio. There are plans to make + * this a bit more general in the future, but till then this should + * be sufficient. + */ +pciio_slot_t +pcibr_device_slot_get(devfs_handle_t dev_vhdl) +{ + char devname[MAXDEVNAME]; + devfs_handle_t tdev; + pciio_info_t pciio_info; + pciio_slot_t slot = PCIIO_SLOT_NONE; + + vertex_to_name(dev_vhdl, devname, MAXDEVNAME); + + /* run back along the canonical path + * until we find a PCI connection point. + */ + tdev = hwgraph_connectpt_get(dev_vhdl); + while (tdev != GRAPH_VERTEX_NONE) { + pciio_info = pciio_info_chk(tdev); + if (pciio_info) { + slot = pciio_info_slot_get(pciio_info); + break; + } + hwgraph_vertex_unref(tdev); + tdev = hwgraph_connectpt_get(tdev); + } + hwgraph_vertex_unref(tdev); + + return slot; +} + +/*ARGSUSED */ +int +pcibr_ioctl(devfs_handle_t dev, + int cmd, + void *arg, + int flag, + struct cred *cr, + int *rvalp) +{ + devfs_handle_t pcibr_vhdl = hwgraph_connectpt_get((devfs_handle_t)dev); +#ifdef LATER + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); +#endif + int error = 0; + + hwgraph_vertex_unref(pcibr_vhdl); + + switch (cmd) { +#ifdef LATER + case GIOCSETBW: + { + grio_ioctl_info_t info; + pciio_slot_t slot = 0; + + if (!cap_able((uint64_t)CAP_DEVICE_MGT)) { + error = EPERM; + break; + } + if (COPYIN(arg, &info, sizeof(grio_ioctl_info_t))) { + error = EFAULT; + break; + } +#ifdef GRIO_DEBUG + printk("pcibr:: prev_vhdl: %d reqbw: %lld\n", + info.prev_vhdl, info.reqbw); +#endif /* GRIO_DEBUG */ + + if ((slot = pcibr_device_slot_get(info.prev_vhdl)) == + PCIIO_SLOT_NONE) { + error = EIO; + break; + } + if (info.reqbw) + pcibr_priority_bits_set(pcibr_soft, slot, PCI_PRIO_HIGH); + break; + } + + case GIOCRELEASEBW: + { + grio_ioctl_info_t info; + pciio_slot_t slot = 0; + + if (!cap_able(CAP_DEVICE_MGT)) { + error = EPERM; + break; + } + if (COPYIN(arg, &info, sizeof(grio_ioctl_info_t))) { + error = EFAULT; + break; + } +#ifdef GRIO_DEBUG + printk("pcibr:: prev_vhdl: %d reqbw: %lld\n", + info.prev_vhdl, info.reqbw); +#endif /* GRIO_DEBUG */ + + if ((slot = pcibr_device_slot_get(info.prev_vhdl)) == + PCIIO_SLOT_NONE) { + error = EIO; + break; + } + if (info.reqbw) + pcibr_priority_bits_set(pcibr_soft, slot, PCI_PRIO_LOW); + break; + } + + case PCIBR_SLOT_STARTUP: + { + struct pcibr_slot_req_s req; + + if (!cap_able(CAP_DEVICE_MGT)) { + error = EPERM; + break; + } + + if (COPYIN(arg, &req, sizeof(req))) { + error = EFAULT; + break; + } + + error = pcibr_slot_startup(pcibr_vhdl, &req); + break; + } + case PCIBR_SLOT_SHUTDOWN: + { + struct pcibr_slot_req_s req; + + if (!cap_able(CAP_DEVICE_MGT)) { + error = EPERM; + break; + } + + if (COPYIN(arg, &req, sizeof(req))) { + error = EFAULT; + break; + } + + error = pcibr_slot_shutdown(pcibr_vhdl, &req); + break; + } + case PCIBR_SLOT_QUERY: + { + struct pcibr_slot_req_s req; + + if (!cap_able(CAP_DEVICE_MGT)) { + error = EPERM; + break; + } + + if (COPYIN(arg, &req, sizeof(req))) { + error = EFAULT; + break; + } + + error = pcibr_slot_query(pcibr_vhdl, &req); + break; + } +#endif /* LATER */ + default: + break; + + } + + return error; +} + +void +pcibr_freeblock_sub(iopaddr_t *free_basep, + iopaddr_t *free_lastp, + iopaddr_t base, + size_t size) +{ + iopaddr_t free_base = *free_basep; + iopaddr_t free_last = *free_lastp; + iopaddr_t last = base + size - 1; + + if ((last < free_base) || (base > free_last)); /* free block outside arena */ + + else if ((base <= free_base) && (last >= free_last)) + /* free block contains entire arena */ + *free_basep = *free_lastp = 0; + + else if (base <= free_base) + /* free block is head of arena */ + *free_basep = last + 1; + + else if (last >= free_last) + /* free block is tail of arena */ + *free_lastp = base - 1; + + /* + * We are left with two regions: the free area + * in the arena "below" the block, and the free + * area in the arena "above" the block. Keep + * the one that is bigger. + */ + + else if ((base - free_base) > (free_last - last)) + *free_lastp = base - 1; /* keep lower chunk */ + else + *free_basep = last + 1; /* keep upper chunk */ +} + +pcibr_info_t +pcibr_info_get(devfs_handle_t vhdl) +{ + return (pcibr_info_t) pciio_info_get(vhdl); +} + +pcibr_info_t +pcibr_device_info_new( + pcibr_soft_t pcibr_soft, + pciio_slot_t slot, + pciio_function_t rfunc, + pciio_vendor_id_t vendor, + pciio_device_id_t device) +{ + pcibr_info_t pcibr_info; + pciio_function_t func; + int ibit; + + func = (rfunc == PCIIO_FUNC_NONE) ? 0 : rfunc; + + NEW(pcibr_info); + + pciio_device_info_new(&pcibr_info->f_c, + pcibr_soft->bs_vhdl, + slot, rfunc, + vendor, device); + +/* pfg - this is new ..... */ + /* Set PCI bus number */ + pcibr_info->f_bus = io_path_map_widget(pcibr_soft->bs_vhdl); + + if (slot != PCIIO_SLOT_NONE) { + + /* + * Currently favored mapping from PCI + * slot number and INTA/B/C/D to Bridge + * PCI Interrupt Bit Number: + * + * SLOT A B C D + * 0 0 4 0 4 + * 1 1 5 1 5 + * 2 2 6 2 6 + * 3 3 7 3 7 + * 4 4 0 4 0 + * 5 5 1 5 1 + * 6 6 2 6 2 + * 7 7 3 7 3 + * + * XXX- allow pcibr_hints to override default + * XXX- allow ADMIN to override pcibr_hints + */ + for (ibit = 0; ibit < 4; ++ibit) + pcibr_info->f_ibit[ibit] = + (slot + 4 * ibit) & 7; + + /* + * Record the info in the sparse func info space. + */ + if (func < pcibr_soft->bs_slot[slot].bss_ninfo) + pcibr_soft->bs_slot[slot].bss_infos[func] = pcibr_info; + } + return pcibr_info; +} + + +/* FIXME: for now this is needed by both pcibr.c and + * pcibr_slot.c. Need to find a better way, the least + * of which would be to move it to pcibr_private.h + */ + +/* + * PCI_ADDR_SPACE_LIMITS_STORE + * Sets the current values of + * pci io base, + * pci io last, + * pci low memory base, + * pci low memory last, + * pci high memory base, + * pci high memory last + */ +#define PCI_ADDR_SPACE_LIMITS_STORE() \ + pcibr_soft->bs_spinfo.pci_io_base = pci_io_fb; \ + pcibr_soft->bs_spinfo.pci_io_last = pci_io_fl; \ + pcibr_soft->bs_spinfo.pci_swin_base = pci_lo_fb; \ + pcibr_soft->bs_spinfo.pci_swin_last = pci_lo_fl; \ + pcibr_soft->bs_spinfo.pci_mem_base = pci_hi_fb; \ + pcibr_soft->bs_spinfo.pci_mem_last = pci_hi_fl; + + +/* + * pcibr_device_unregister + * This frees up any hardware resources reserved for this PCI device + * and removes any PCI infrastructural information setup for it. + * This is usually used at the time of shutting down of the PCI card. + */ +int +pcibr_device_unregister(devfs_handle_t pconn_vhdl) +{ + pciio_info_t pciio_info; + devfs_handle_t pcibr_vhdl; + pciio_slot_t slot; + pcibr_soft_t pcibr_soft; + bridge_t *bridge; + int count_vchan0, count_vchan1; + unsigned s; + int error_call; + int error = 0; + + pciio_info = pciio_info_get(pconn_vhdl); + + pcibr_vhdl = pciio_info_master_get(pciio_info); + slot = pciio_info_slot_get(pciio_info); + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + bridge = pcibr_soft->bs_base; + + /* Clear all the hardware xtalk resources for this device */ + xtalk_widgetdev_shutdown(pcibr_soft->bs_conn, slot); + + /* Flush all the rrbs */ + pcibr_rrb_flush(pconn_vhdl); + + /* + * If the RRB configuration for this slot has changed, set it + * back to the boot-time default + */ + if (pcibr_soft->bs_rrb_valid_dflt[slot] >= 0) { + + s = pcibr_lock(pcibr_soft); + + /* Free the rrbs allocated to this slot */ + error_call = do_pcibr_rrb_free(bridge, slot, + pcibr_soft->bs_rrb_valid[slot] + + pcibr_soft->bs_rrb_valid[slot + + PCIBR_RRB_SLOT_VIRTUAL]); + + if (error_call) + error = ERANGE; + + pcibr_soft->bs_rrb_res[slot] = pcibr_soft->bs_rrb_res[slot] + + pcibr_soft->bs_rrb_valid[slot] + + pcibr_soft->bs_rrb_valid[slot + + PCIBR_RRB_SLOT_VIRTUAL]; + + count_vchan0 = pcibr_soft->bs_rrb_valid_dflt[slot]; + count_vchan1 = pcibr_soft->bs_rrb_valid_dflt[slot + + PCIBR_RRB_SLOT_VIRTUAL]; + + pcibr_unlock(pcibr_soft, s); + + pcibr_rrb_alloc(pconn_vhdl, &count_vchan0, &count_vchan1); + + } + + /* Flush the write buffers !! */ + error_call = pcibr_wrb_flush(pconn_vhdl); + + if (error_call) + error = error_call; + + /* Clear the information specific to the slot */ + error_call = pcibr_slot_info_free(pcibr_vhdl, slot); + + if (error_call) + error = error_call; + + return(error); + +} + +/* + * pcibr_driver_reg_callback + * CDL will call this function for each device found in the PCI + * registry that matches the vendor/device IDs supported by + * the driver being registered. The device's connection vertex + * and the driver's attach function return status enable the + * slot's device status to be set. + */ +void +pcibr_driver_reg_callback(devfs_handle_t pconn_vhdl, + int key1, int key2, int error) +{ + pciio_info_t pciio_info; + pcibr_info_t pcibr_info; + devfs_handle_t pcibr_vhdl; + pciio_slot_t slot; + pcibr_soft_t pcibr_soft; + + /* Do not set slot status for vendor/device ID wildcard drivers */ + if ((key1 == -1) || (key2 == -1)) + return; + + pciio_info = pciio_info_get(pconn_vhdl); + pcibr_info = pcibr_info_get(pconn_vhdl); + + pcibr_vhdl = pciio_info_master_get(pciio_info); + slot = pciio_info_slot_get(pciio_info); + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + /* This may be a loadable driver so lock out any pciconfig actions */ + mrlock(pcibr_soft->bs_bus_lock, MR_UPDATE, PZERO); + + pcibr_info->f_att_det_error = error; + + pcibr_soft->bs_slot[slot].slot_status &= ~SLOT_STATUS_MASK; + + if (error) { + pcibr_soft->bs_slot[slot].slot_status |= SLOT_STARTUP_INCMPLT; + } else { + pcibr_soft->bs_slot[slot].slot_status |= SLOT_STARTUP_CMPLT; + } + + /* Release the bus lock */ + mrunlock(pcibr_soft->bs_bus_lock); + +} + +/* + * pcibr_driver_unreg_callback + * CDL will call this function for each device found in the PCI + * registry that matches the vendor/device IDs supported by + * the driver being unregistered. The device's connection vertex + * and the driver's detach function return status enable the + * slot's device status to be set. + */ +void +pcibr_driver_unreg_callback(devfs_handle_t pconn_vhdl, + int key1, int key2, int error) +{ + pciio_info_t pciio_info; + pcibr_info_t pcibr_info; + devfs_handle_t pcibr_vhdl; + pciio_slot_t slot; + pcibr_soft_t pcibr_soft; + + /* Do not set slot status for vendor/device ID wildcard drivers */ + if ((key1 == -1) || (key2 == -1)) + return; + + pciio_info = pciio_info_get(pconn_vhdl); + pcibr_info = pcibr_info_get(pconn_vhdl); + + pcibr_vhdl = pciio_info_master_get(pciio_info); + slot = pciio_info_slot_get(pciio_info); + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + /* This may be a loadable driver so lock out any pciconfig actions */ + mrlock(pcibr_soft->bs_bus_lock, MR_UPDATE, PZERO); + + pcibr_info->f_att_det_error = error; + + pcibr_soft->bs_slot[slot].slot_status &= ~SLOT_STATUS_MASK; + + if (error) { + pcibr_soft->bs_slot[slot].slot_status |= SLOT_SHUTDOWN_INCMPLT; + } else { + pcibr_soft->bs_slot[slot].slot_status |= SLOT_SHUTDOWN_CMPLT; + } + + /* Release the bus lock */ + mrunlock(pcibr_soft->bs_bus_lock); + +} + +/* + * build a convenience link path in the + * form of "...//bus/" + * + * returns 1 on success, 0 otherwise + * + * depends on hwgraph separator == '/' + */ +int +pcibr_bus_cnvlink(devfs_handle_t f_c, int slot) +{ + char dst[MAXDEVNAME]; + char *dp = dst; + char *cp, *xp; + int widgetnum; + char pcibus[8]; + devfs_handle_t nvtx, svtx; + int rv; + +#if DEBUG + printk("pcibr_bus_cnvlink: slot= %d f_c= %p\n", + slot, f_c); + { + int pos; + char dname[256]; + pos = devfs_generate_path(f_c, dname, 256); + printk("%s : path= %s\n", __FUNCTION__, &dname[pos]); + } +#endif + + if (GRAPH_SUCCESS != hwgraph_vertex_name_get(f_c, dst, MAXDEVNAME)) + return 0; + + /* dst example == /hw/module/001c02/Pbrick/xtalk/8/pci/direct */ + + /* find the widget number */ + xp = strstr(dst, "/"EDGE_LBL_XTALK"/"); + if (xp == NULL) + return 0; + widgetnum = atoi(xp+7); + if (widgetnum < XBOW_PORT_8 || widgetnum > XBOW_PORT_F) + return 0; + + /* remove "/pci/direct" from path */ + cp = strstr(dst, "/" EDGE_LBL_PCI "/" "direct"); + if (cp == NULL) + return 0; + *cp = (char)NULL; + + /* get the vertex for the widget */ + if (GRAPH_SUCCESS != hwgraph_traverse(NULL, dp, &svtx)) + return 0; + + *xp = (char)NULL; /* remove "/xtalk/..." from path */ + + /* dst example now == /hw/module/001c02/Pbrick */ + + /* get the bus number */ + strcat(dst, "/bus"); + sprintf(pcibus, "%d", p_busnum[widgetnum]); + + /* link to bus to widget */ + rv = hwgraph_path_add(NULL, dp, &nvtx); + if (GRAPH_SUCCESS == rv) + rv = hwgraph_edge_add(nvtx, svtx, pcibus); + + return (rv == GRAPH_SUCCESS); +} + + +/* + * pcibr_attach: called every time the crosstalk + * infrastructure is asked to initialize a widget + * that matches the part number we handed to the + * registration routine above. + */ +/*ARGSUSED */ +int +pcibr_attach(devfs_handle_t xconn_vhdl) +{ + /* REFERENCED */ + graph_error_t rc; + devfs_handle_t pcibr_vhdl; + devfs_handle_t ctlr_vhdl; + bridge_t *bridge = NULL; + bridgereg_t id; + int rev; + pcibr_soft_t pcibr_soft; + pcibr_info_t pcibr_info; + xwidget_info_t info; + xtalk_intr_t xtalk_intr; + device_desc_t dev_desc = (device_desc_t)0; + int slot; + int ibit; + devfs_handle_t noslot_conn; + char devnm[MAXDEVNAME], *s; + pcibr_hints_t pcibr_hints; + bridgereg_t b_int_enable; + unsigned rrb_fixed = 0; + + iopaddr_t pci_io_fb, pci_io_fl; + iopaddr_t pci_lo_fb, pci_lo_fl; + iopaddr_t pci_hi_fb, pci_hi_fl; + + int spl_level; +#ifdef LATER + char *nicinfo = (char *)0; +#endif + +#if PCI_FBBE + int fast_back_to_back_enable; +#endif + l1sc_t *scp; + nasid_t nasid; + + async_attach_t aa = NULL; + + aa = async_attach_get_info(xconn_vhdl); + +#if DEBUG && ATTACH_DEBUG + printk("pcibr_attach: xconn_vhdl= %p\n", xconn_vhdl); + { + int pos; + char dname[256]; + pos = devfs_generate_path(xconn_vhdl, dname, 256); + printk("%s : path= %s \n", __FUNCTION__, &dname[pos]); + } +#endif + + /* Setup the PRB for the bridge in CONVEYOR BELT + * mode. PRBs are setup in default FIRE-AND-FORGET + * mode during the initialization. + */ + hub_device_flags_set(xconn_vhdl, HUB_PIO_CONVEYOR); + + bridge = (bridge_t *) + xtalk_piotrans_addr(xconn_vhdl, NULL, + 0, sizeof(bridge_t), 0); + + /* + * Create the vertex for the PCI bus, which we + * will also use to hold the pcibr_soft and + * which will be the "master" vertex for all the + * pciio connection points we will hang off it. + * This needs to happen before we call nic_bridge_vertex_info + * as we are some of the *_vmc functions need access to the edges. + * + * Opening this vertex will provide access to + * the Bridge registers themselves. + */ + rc = hwgraph_path_add(xconn_vhdl, EDGE_LBL_PCI, &pcibr_vhdl); + ASSERT(rc == GRAPH_SUCCESS); + + ctlr_vhdl = NULL; + ctlr_vhdl = hwgraph_register(pcibr_vhdl, EDGE_LBL_CONTROLLER, + 0, DEVFS_FL_AUTO_DEVNUM, + 0, 0, + S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, 0, 0, + &pcibr_fops, NULL); + + ASSERT(ctlr_vhdl != NULL); + + /* + * decode the nic, and hang its stuff off our + * connection point where other drivers can get + * at it. + */ +#ifdef LATER + nicinfo = BRIDGE_VERTEX_MFG_INFO(xconn_vhdl, (nic_data_t) & bridge->b_nic); +#endif + + /* + * Get the hint structure; if some NIC callback + * marked this vertex as "hands-off" then we + * just return here, before doing anything else. + */ + pcibr_hints = pcibr_hints_get(xconn_vhdl, 0); + + if (pcibr_hints && pcibr_hints->ph_hands_off) + return -1; /* generic operations disabled */ + + id = bridge->b_wid_id; + rev = XWIDGET_PART_REV_NUM(id); + + hwgraph_info_add_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, (arbitrary_info_t) rev); + + /* + * allocate soft state structure, fill in some + * fields, and hook it up to our vertex. + */ + NEW(pcibr_soft); + BZERO(pcibr_soft, sizeof *pcibr_soft); + pcibr_soft_set(pcibr_vhdl, pcibr_soft); + + pcibr_soft->bs_conn = xconn_vhdl; + pcibr_soft->bs_vhdl = pcibr_vhdl; + pcibr_soft->bs_base = bridge; + pcibr_soft->bs_rev_num = rev; + pcibr_soft->bs_intr_bits = pcibr_intr_bits; + if (is_xbridge(bridge)) { + pcibr_soft->bs_int_ate_size = XBRIDGE_INTERNAL_ATES; + pcibr_soft->bs_xbridge = 1; + } else { + pcibr_soft->bs_int_ate_size = BRIDGE_INTERNAL_ATES; + pcibr_soft->bs_xbridge = 0; + } + + nasid = NASID_GET(bridge); + scp = &NODEPDA( NASID_TO_COMPACT_NODEID(nasid) )->module->elsc; + pcibr_soft->bs_l1sc = scp; + pcibr_soft->bs_moduleid = iobrick_module_get(scp); + pcibr_soft->bsi_err_intr = 0; + + /* Bridges up through REV C + * are unable to set the direct + * byteswappers to BYTE_STREAM. + */ + if (pcibr_soft->bs_rev_num <= BRIDGE_PART_REV_C) { + pcibr_soft->bs_pio_end_io = PCIIO_WORD_VALUES; + pcibr_soft->bs_pio_end_mem = PCIIO_WORD_VALUES; + } +#if PCIBR_SOFT_LIST + { + pcibr_list_p self; + + NEW(self); + self->bl_soft = pcibr_soft; + self->bl_vhdl = pcibr_vhdl; + self->bl_next = pcibr_list; + self->bl_next = swap_ptr((void **) &pcibr_list, (void *)self); + } +#endif + + /* + * get the name of this bridge vertex and keep the info. Use this + * only where it is really needed now: like error interrupts. + */ + s = dev_to_name(pcibr_vhdl, devnm, MAXDEVNAME); + pcibr_soft->bs_name = kmalloc(strlen(s) + 1, GFP_KERNEL); + strcpy(pcibr_soft->bs_name, s); + +#if SHOW_REVS || DEBUG +#if !DEBUG + if (kdebug) +#endif + printk("%sBridge ASIC: rev %s (code=0x%x) at %s\n", + is_xbridge(bridge) ? "X" : "", + (rev == BRIDGE_PART_REV_A) ? "A" : + (rev == BRIDGE_PART_REV_B) ? "B" : + (rev == BRIDGE_PART_REV_C) ? "C" : + (rev == BRIDGE_PART_REV_D) ? "D" : + (rev == XBRIDGE_PART_REV_A) ? "A" : + (rev == XBRIDGE_PART_REV_B) ? "B" : + "unknown", + rev, pcibr_soft->bs_name); +#endif + + info = xwidget_info_get(xconn_vhdl); + pcibr_soft->bs_xid = xwidget_info_id_get(info); + pcibr_soft->bs_master = xwidget_info_master_get(info); + pcibr_soft->bs_mxid = xwidget_info_masterid_get(info); + + /* + * Init bridge lock. + */ + spin_lock_init(&pcibr_soft->bs_lock); + + /* + * If we have one, process the hints structure. + */ + if (pcibr_hints) { + rrb_fixed = pcibr_hints->ph_rrb_fixed; + + pcibr_soft->bs_rrb_fixed = rrb_fixed; + + if (pcibr_hints->ph_intr_bits) + pcibr_soft->bs_intr_bits = pcibr_hints->ph_intr_bits; + + for (slot = 0; slot < 8; ++slot) { + int hslot = pcibr_hints->ph_host_slot[slot] - 1; + + if (hslot < 0) { + pcibr_soft->bs_slot[slot].host_slot = slot; + } else { + pcibr_soft->bs_slot[slot].has_host = 1; + pcibr_soft->bs_slot[slot].host_slot = hslot; + } + } + } + /* + * set up initial values for state fields + */ + for (slot = 0; slot < 8; ++slot) { + pcibr_soft->bs_slot[slot].bss_devio.bssd_space = PCIIO_SPACE_NONE; + pcibr_soft->bs_slot[slot].bss_d64_base = PCIBR_D64_BASE_UNSET; + pcibr_soft->bs_slot[slot].bss_d32_base = PCIBR_D32_BASE_UNSET; + pcibr_soft->bs_slot[slot].bss_ext_ates_active = ATOMIC_INIT(0); + } + + for (ibit = 0; ibit < 8; ++ibit) { + pcibr_soft->bs_intr[ibit].bsi_xtalk_intr = 0; + pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_soft = pcibr_soft; + pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_list = NULL; + pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_stat = + &(bridge->b_int_status); + pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_hdlrcnt = 0; + pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_shared = 0; + pcibr_soft->bs_intr[ibit].bsi_pcibr_intr_wrap.iw_connected = 0; + } + + /* + * Initialize various Bridge registers. + */ + + /* + * On pre-Rev.D bridges, set the PCI_RETRY_CNT + * to zero to avoid dropping stores. (#475347) + */ + if (rev < BRIDGE_PART_REV_D) + bridge->b_bus_timeout &= ~BRIDGE_BUS_PCI_RETRY_MASK; + + /* + * Clear all pending interrupts. + */ + bridge->b_int_rst_stat = (BRIDGE_IRR_ALL_CLR); + + /* + * Until otherwise set up, + * assume all interrupts are + * from slot 7. + */ + bridge->b_int_device = (uint32_t) 0xffffffff; + + { + bridgereg_t dirmap; + paddr_t paddr; + iopaddr_t xbase; + xwidgetnum_t xport; + iopaddr_t offset; + int num_entries = 0; + int entry; + cnodeid_t cnodeid; + nasid_t nasid; + + /* Set the Bridge's 32-bit PCI to XTalk + * Direct Map register to the most useful + * value we can determine. Note that we + * must use a single xid for all of: + * direct-mapped 32-bit DMA accesses + * direct-mapped 64-bit DMA accesses + * DMA accesses through the PMU + * interrupts + * This is the only way to guarantee that + * completion interrupts will reach a CPU + * after all DMA data has reached memory. + * (Of course, there may be a few special + * drivers/controlers that explicitly manage + * this ordering problem.) + */ + + cnodeid = 0; /* default node id */ + nasid = COMPACT_TO_NASID_NODEID(cnodeid); + paddr = NODE_OFFSET(nasid) + 0; + + /* currently, we just assume that if we ask + * for a DMA mapping to "zero" the XIO + * host will transmute this into a request + * for the lowest hunk of memory. + */ + xbase = xtalk_dmatrans_addr(xconn_vhdl, 0, + paddr, _PAGESZ, 0); + + if (xbase != XIO_NOWHERE) { + if (XIO_PACKED(xbase)) { + xport = XIO_PORT(xbase); + xbase = XIO_ADDR(xbase); + } else + xport = pcibr_soft->bs_mxid; + + offset = xbase & ((1ull << BRIDGE_DIRMAP_OFF_ADDRSHFT) - 1ull); + xbase >>= BRIDGE_DIRMAP_OFF_ADDRSHFT; + + dirmap = xport << BRIDGE_DIRMAP_W_ID_SHFT; + + if (xbase) + dirmap |= BRIDGE_DIRMAP_OFF & xbase; + else if (offset >= (512 << 20)) + dirmap |= BRIDGE_DIRMAP_ADD512; + + bridge->b_dir_map = dirmap; + } + /* + * Set bridge's idea of page size according to the system's + * idea of "IO page size". TBD: The idea of IO page size + * should really go away. + */ + /* + * ensure that we write and read without any interruption. + * The read following the write is required for the Bridge war + */ + spl_level = splhi(); +#if IOPGSIZE == 4096 + bridge->b_wid_control &= ~BRIDGE_CTRL_PAGE_SIZE; +#elif IOPGSIZE == 16384 + bridge->b_wid_control |= BRIDGE_CTRL_PAGE_SIZE; +#else + <<>>; +#endif + bridge->b_wid_control; /* inval addr bug war */ + splx(spl_level); + + /* Initialize internal mapping entries */ + for (entry = 0; entry < pcibr_soft->bs_int_ate_size; entry++) { + bridge->b_int_ate_ram[entry].wr = 0; + } + + /* + * Determine if there's external mapping SSRAM on this + * bridge. Set up Bridge control register appropriately, + * inititlize SSRAM, and set software up to manage RAM + * entries as an allocatable resource. + * + * Currently, we just use the rm* routines to manage ATE + * allocation. We should probably replace this with a + * Best Fit allocator. + * + * For now, if we have external SSRAM, avoid using + * the internal ssram: we can't turn PREFETCH on + * when we use the internal SSRAM; and besides, + * this also guarantees that no allocation will + * straddle the internal/external line, so we + * can increment ATE write addresses rather than + * recomparing against BRIDGE_INTERNAL_ATES every + * time. + */ + if (is_xbridge(bridge)) + num_entries = 0; + else + num_entries = pcibr_init_ext_ate_ram(bridge); + + /* we always have 128 ATEs (512 for Xbridge) inside the chip + * even if disabled for debugging. + */ + pcibr_soft->bs_int_ate_map = rmallocmap(pcibr_soft->bs_int_ate_size); + pcibr_ate_free(pcibr_soft, 0, pcibr_soft->bs_int_ate_size); +#if PCIBR_ATE_DEBUG + printk("pcibr_attach: %d INTERNAL ATEs\n", pcibr_soft->bs_int_ate_size); +#endif + + if (num_entries > pcibr_soft->bs_int_ate_size) { +#if PCIBR_ATE_NOTBOTH /* for debug -- forces us to use external ates */ + printk("pcibr_attach: disabling internal ATEs.\n"); + pcibr_ate_alloc(pcibr_soft, pcibr_soft->bs_int_ate_size); +#endif + pcibr_soft->bs_ext_ate_map = rmallocmap(num_entries); + pcibr_ate_free(pcibr_soft, pcibr_soft->bs_int_ate_size, + num_entries - pcibr_soft->bs_int_ate_size); +#if PCIBR_ATE_DEBUG + printk("pcibr_attach: %d EXTERNAL ATEs\n", + num_entries - pcibr_soft->bs_int_ate_size); +#endif + } + } + + { + bridgereg_t dirmap; + iopaddr_t xbase; + + /* + * now figure the *real* xtalk base address + * that dirmap sends us to. + */ + dirmap = bridge->b_dir_map; + if (dirmap & BRIDGE_DIRMAP_OFF) + xbase = (iopaddr_t)(dirmap & BRIDGE_DIRMAP_OFF) + << BRIDGE_DIRMAP_OFF_ADDRSHFT; + else if (dirmap & BRIDGE_DIRMAP_ADD512) + xbase = 512 << 20; + else + xbase = 0; + + pcibr_soft->bs_dir_xbase = xbase; + + /* it is entirely possible that we may, at this + * point, have our dirmap pointing somewhere + * other than our "master" port. + */ + pcibr_soft->bs_dir_xport = + (dirmap & BRIDGE_DIRMAP_W_ID) >> BRIDGE_DIRMAP_W_ID_SHFT; + } + + /* pcibr sources an error interrupt; + * figure out where to send it. + * + * If any interrupts are enabled in bridge, + * then the prom set us up and our interrupt + * has already been reconnected in mlreset + * above. + * + * Need to set the D_INTR_ISERR flag + * in the dev_desc used for allocating the + * error interrupt, so our interrupt will + * be properly routed and prioritized. + * + * If our crosstalk provider wants to + * fix widget error interrupts to specific + * destinations, D_INTR_ISERR is how it + * knows to do this. + */ + + xtalk_intr = xtalk_intr_alloc(xconn_vhdl, dev_desc, pcibr_vhdl); + ASSERT(xtalk_intr != NULL); + + pcibr_soft->bsi_err_intr = xtalk_intr; + + /* + * On IP35 with XBridge, we do some extra checks in pcibr_setwidint + * in order to work around some addressing limitations. In order + * for that fire wall to work properly, we need to make sure we + * start from a known clean state. + */ + pcibr_clearwidint(bridge); + + xtalk_intr_connect(xtalk_intr, (xtalk_intr_setfunc_t)pcibr_setwidint, (void *)bridge); + + /* + * now we can start handling error interrupts; + * enable all of them. + * NOTE: some PCI ints may already be enabled. + */ + b_int_enable = bridge->b_int_enable | BRIDGE_ISR_ERRORS; + + + bridge->b_int_enable = b_int_enable; + bridge->b_int_mode = 0; /* do not send "clear interrupt" packets */ + + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + + /* + * Depending on the rev of bridge, disable certain features. + * Easiest way seems to be to force the PCIBR_NOwhatever + * flag to be on for all DMA calls, which overrides any + * PCIBR_whatever flag or even the setting of whatever + * from the PCIIO_DMA_class flags (or even from the other + * PCIBR flags, since NO overrides YES). + */ + pcibr_soft->bs_dma_flags = 0; + + /* PREFETCH: + * Always completely disabled for REV.A; + * at "pcibr_prefetch_enable_rev", anyone + * asking for PCIIO_PREFETCH gets it. + * Between these two points, you have to ask + * for PCIBR_PREFETCH, which promises that + * your driver knows about known Bridge WARs. + */ + if (pcibr_soft->bs_rev_num < BRIDGE_PART_REV_B) + pcibr_soft->bs_dma_flags |= PCIBR_NOPREFETCH; + else if (pcibr_soft->bs_rev_num < + (BRIDGE_WIDGET_PART_NUM << 4 | pcibr_prefetch_enable_rev)) + pcibr_soft->bs_dma_flags |= PCIIO_NOPREFETCH; + + /* WRITE_GATHER: + * Disabled up to but not including the + * rev number in pcibr_wg_enable_rev. There + * is no "WAR range" as with prefetch. + */ + if (pcibr_soft->bs_rev_num < + (BRIDGE_WIDGET_PART_NUM << 4 | pcibr_wg_enable_rev)) + pcibr_soft->bs_dma_flags |= PCIBR_NOWRITE_GATHER; + + pciio_provider_register(pcibr_vhdl, &pcibr_provider); + pciio_provider_startup(pcibr_vhdl); + + pci_io_fb = 0x00000004; /* I/O FreeBlock Base */ + pci_io_fl = 0xFFFFFFFF; /* I/O FreeBlock Last */ + + pci_lo_fb = 0x00000010; /* Low Memory FreeBlock Base */ + pci_lo_fl = 0x001FFFFF; /* Low Memory FreeBlock Last */ + + pci_hi_fb = 0x00200000; /* High Memory FreeBlock Base */ + pci_hi_fl = 0x3FFFFFFF; /* High Memory FreeBlock Last */ + + + PCI_ADDR_SPACE_LIMITS_STORE(); + + /* build "no-slot" connection point + */ + pcibr_info = pcibr_device_info_new + (pcibr_soft, PCIIO_SLOT_NONE, PCIIO_FUNC_NONE, + PCIIO_VENDOR_ID_NONE, PCIIO_DEVICE_ID_NONE); + noslot_conn = pciio_device_info_register + (pcibr_vhdl, &pcibr_info->f_c); + + /* Remember the no slot connection point info for tearing it + * down during detach. + */ + pcibr_soft->bs_noslot_conn = noslot_conn; + pcibr_soft->bs_noslot_info = pcibr_info; +#if PCI_FBBE + fast_back_to_back_enable = 1; +#endif + +#if PCI_FBBE + if (fast_back_to_back_enable) { + /* + * All devices on the bus are capable of fast back to back, so + * we need to set the fast back to back bit in all devices on + * the bus that are capable of doing such accesses. + */ + } +#endif + +#ifdef LATER + /* If the bridge has been reset then there is no need to reset + * the individual PCI slots. + */ + for (slot = 0; slot < 8; ++slot) + /* Reset all the slots */ + (void)pcibr_slot_reset(pcibr_vhdl, slot); +#endif + + for (slot = 0; slot < 8; ++slot) + /* Find out what is out there */ + (void)pcibr_slot_info_init(pcibr_vhdl,slot); + + for (slot = 0; slot < 8; ++slot) + /* Set up the address space for this slot in the pci land */ + (void)pcibr_slot_addr_space_init(pcibr_vhdl,slot); + + for (slot = 0; slot < 8; ++slot) + /* Setup the device register */ + (void)pcibr_slot_device_init(pcibr_vhdl, slot); + + for (slot = 0; slot < 8; ++slot) + /* Setup host/guest relations */ + (void)pcibr_slot_guest_info_init(pcibr_vhdl,slot); + + for (slot = 0; slot < 8; ++slot) + /* Initial RRB management */ + (void)pcibr_slot_initial_rrb_alloc(pcibr_vhdl,slot); + + /* driver attach routines should be called out from generic linux code */ + for (slot = 0; slot < 8; ++slot) + /* Call the device attach */ + (void)pcibr_slot_call_device_attach(pcibr_vhdl, slot, 0); + + /* + * Each Pbrick PCI bus only has slots 1 and 2. Similarly for + * widget 0xe on Ibricks. Allocate RRB's accordingly. + */ + if (pcibr_soft->bs_moduleid > 0) { + switch (MODULE_GET_BTCHAR(pcibr_soft->bs_moduleid)) { + case 'p': /* Pbrick */ + do_pcibr_rrb_autoalloc(pcibr_soft, 1, 8); + do_pcibr_rrb_autoalloc(pcibr_soft, 2, 8); + break; + case 'i': /* Ibrick */ + /* port 0xe on the Ibrick only has slots 1 and 2 */ + if (pcibr_soft->bs_xid == 0xe) { + do_pcibr_rrb_autoalloc(pcibr_soft, 1, 8); + do_pcibr_rrb_autoalloc(pcibr_soft, 2, 8); + } + else { + /* allocate one RRB for the serial port */ + do_pcibr_rrb_autoalloc(pcibr_soft, 0, 1); + } + break; + } /* switch */ + } + +#ifdef LATER + if (strstr(nicinfo, XTALK_PCI_PART_NUM)) { + do_pcibr_rrb_autoalloc(pcibr_soft, 1, 8); +#if PCIBR_RRB_DEBUG + printf("\n\nFound XTALK_PCI (030-1275) at %v\n", xconn_vhdl); + + printf("pcibr_attach: %v Shoebox RRB MANAGEMENT: %d+%d free\n", + pcibr_vhdl, + pcibr_soft->bs_rrb_avail[0], + pcibr_soft->bs_rrb_avail[1]); + + for (slot = 0; slot < 8; ++slot) + printf("\t%d+%d+%d", + 0xFFF & pcibr_soft->bs_rrb_valid[slot], + 0xFFF & pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL], + pcibr_soft->bs_rrb_res[slot]); + + printf("\n"); +#endif + } +#else + FIXME("pcibr_attach: Call do_pcibr_rrb_autoalloc nicinfo\n"); +#endif + + if (aa) + async_attach_add_info(noslot_conn, aa); + + pciio_device_attach(noslot_conn, 0); + + + /* + * Tear down pointer to async attach info -- async threads for + * bridge's descendants may be running but the bridge's work is done. + */ + if (aa) + async_attach_del_info(xconn_vhdl); + + return 0; +} +/* + * pcibr_detach: + * Detach the bridge device from the hwgraph after cleaning out all the + * underlying vertices. + */ +int +pcibr_detach(devfs_handle_t xconn) +{ + pciio_slot_t slot; + devfs_handle_t pcibr_vhdl; + pcibr_soft_t pcibr_soft; + bridge_t *bridge; + + /* Get the bridge vertex from its xtalk connection point */ + if (hwgraph_traverse(xconn, EDGE_LBL_PCI, &pcibr_vhdl) != GRAPH_SUCCESS) + return(1); + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + bridge = pcibr_soft->bs_base; + + /* Disable the interrupts from the bridge */ + bridge->b_int_enable = 0; + + /* Detach all the PCI devices talking to this bridge */ + for(slot = 0; slot < 8; slot++) { +#ifdef DEBUG + printk("pcibr_device_detach called for %p/%d\n", + pcibr_vhdl,slot); +#endif + pcibr_slot_detach(pcibr_vhdl, slot, 0); + } + + /* Unregister the no-slot connection point */ + pciio_device_info_unregister(pcibr_vhdl, + &(pcibr_soft->bs_noslot_info->f_c)); + + spin_lock_destroy(&pcibr_soft->bs_lock); + kfree(pcibr_soft->bs_name); + + /* Error handler gets unregistered when the widget info is + * cleaned + */ + /* Free the soft ATE maps */ + if (pcibr_soft->bs_int_ate_map) + rmfreemap(pcibr_soft->bs_int_ate_map); + if (pcibr_soft->bs_ext_ate_map) + rmfreemap(pcibr_soft->bs_ext_ate_map); + + /* Disconnect the error interrupt and free the xtalk resources + * associated with it. + */ + xtalk_intr_disconnect(pcibr_soft->bsi_err_intr); + xtalk_intr_free(pcibr_soft->bsi_err_intr); + + /* Clear the software state maintained by the bridge driver for this + * bridge. + */ + DEL(pcibr_soft); + /* Remove the Bridge revision labelled info */ + (void)hwgraph_info_remove_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, NULL); + /* Remove the character device associated with this bridge */ + (void)hwgraph_edge_remove(pcibr_vhdl, EDGE_LBL_CONTROLLER, NULL); + /* Remove the PCI bridge vertex */ + (void)hwgraph_edge_remove(xconn, EDGE_LBL_PCI, NULL); + + return(0); +} + +int +pcibr_asic_rev(devfs_handle_t pconn_vhdl) +{ + devfs_handle_t pcibr_vhdl; + arbitrary_info_t ainfo; + + if (GRAPH_SUCCESS != + hwgraph_traverse(pconn_vhdl, EDGE_LBL_MASTER, &pcibr_vhdl)) + return -1; + + if (GRAPH_SUCCESS != + hwgraph_info_get_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, &ainfo)) + return -1; + + return (int) ainfo; +} + +int +pcibr_write_gather_flush(devfs_handle_t pconn_vhdl) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + pciio_slot_t slot; + slot = pciio_info_slot_get(pciio_info); + pcibr_device_write_gather_flush(pcibr_soft, slot); + return 0; +} + +/* ===================================================================== + * PIO MANAGEMENT + */ + +static iopaddr_t +pcibr_addr_pci_to_xio(devfs_handle_t pconn_vhdl, + pciio_slot_t slot, + pciio_space_t space, + iopaddr_t pci_addr, + size_t req_size, + unsigned flags) +{ + pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); + pciio_info_t pciio_info = &pcibr_info->f_c; + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + bridge_t *bridge = pcibr_soft->bs_base; + + unsigned bar; /* which BASE reg on device is decoding */ + iopaddr_t xio_addr = XIO_NOWHERE; + + pciio_space_t wspace; /* which space device is decoding */ + iopaddr_t wbase; /* base of device decode on PCI */ + size_t wsize; /* size of device decode on PCI */ + + int try; /* DevIO(x) window scanning order control */ + int win; /* which DevIO(x) window is being used */ + pciio_space_t mspace; /* target space for devio(x) register */ + iopaddr_t mbase; /* base of devio(x) mapped area on PCI */ + size_t msize; /* size of devio(x) mapped area on PCI */ + size_t mmask; /* addr bits stored in Device(x) */ + + unsigned long s; + + s = pcibr_lock(pcibr_soft); + + if (pcibr_soft->bs_slot[slot].has_host) { + slot = pcibr_soft->bs_slot[slot].host_slot; + pcibr_info = pcibr_soft->bs_slot[slot].bss_infos[0]; + } + if (space == PCIIO_SPACE_NONE) + goto done; + + if (space == PCIIO_SPACE_CFG) { + /* + * Usually, the first mapping + * established to a PCI device + * is to its config space. + * + * In any case, we definitely + * do NOT need to worry about + * PCI BASE registers, and + * MUST NOT attempt to point + * the DevIO(x) window at + * this access ... + */ + if (((flags & PCIIO_BYTE_STREAM) == 0) && + ((pci_addr + req_size) <= BRIDGE_TYPE0_CFG_FUNC_OFF)) + xio_addr = pci_addr + BRIDGE_TYPE0_CFG_DEV(slot); + + goto done; + } + if (space == PCIIO_SPACE_ROM) { + /* PIO to the Expansion Rom. + * Driver is responsible for + * enabling and disabling + * decodes properly. + */ + wbase = pcibr_info->f_rbase; + wsize = pcibr_info->f_rsize; + + /* + * While the driver should know better + * than to attempt to map more space + * than the device is decoding, he might + * do it; better to bail out here. + */ + if ((pci_addr + req_size) > wsize) + goto done; + + pci_addr += wbase; + space = PCIIO_SPACE_MEM; + } + /* + * reduce window mappings to raw + * space mappings (maybe allocating + * windows), and try for DevIO(x) + * usage (setting it if it is available). + */ + bar = space - PCIIO_SPACE_WIN0; + if (bar < 6) { + wspace = pcibr_info->f_window[bar].w_space; + if (wspace == PCIIO_SPACE_NONE) + goto done; + + /* get PCI base and size */ + wbase = pcibr_info->f_window[bar].w_base; + wsize = pcibr_info->f_window[bar].w_size; + + /* + * While the driver should know better + * than to attempt to map more space + * than the device is decoding, he might + * do it; better to bail out here. + */ + if ((pci_addr + req_size) > wsize) + goto done; + + /* shift from window relative to + * decoded space relative. + */ + pci_addr += wbase; + space = wspace; + } else + bar = -1; + + /* Scan all the DevIO(x) windows twice looking for one + * that can satisfy our request. The first time through, + * only look at assigned windows; the second time, also + * look at PCIIO_SPACE_NONE windows. Arrange the order + * so we always look at our own window first. + * + * We will not attempt to satisfy a single request + * by concatinating multiple windows. + */ + for (try = 0; try < 16; ++try) { + bridgereg_t devreg; + unsigned offset; + + win = (try + slot) % 8; + + /* If this DevIO(x) mapping area can provide + * a mapping to this address, use it. + */ + msize = (win < 2) ? 0x200000 : 0x100000; + mmask = -msize; + if (space != PCIIO_SPACE_IO) + mmask &= 0x3FFFFFFF; + + offset = pci_addr & (msize - 1); + + /* If this window can't possibly handle that request, + * go on to the next window. + */ + if (((pci_addr & (msize - 1)) + req_size) > msize) + continue; + + devreg = pcibr_soft->bs_slot[win].bss_device; + + /* Is this window "nailed down"? + * If not, maybe we can use it. + * (only check this the second time through) + */ + mspace = pcibr_soft->bs_slot[win].bss_devio.bssd_space; + if ((try > 7) && (mspace == PCIIO_SPACE_NONE)) { + + /* If this is the primary DevIO(x) window + * for some other device, skip it. + */ + if ((win != slot) && + (PCIIO_VENDOR_ID_NONE != + pcibr_soft->bs_slot[win].bss_vendor_id)) + continue; + + /* It's a free window, and we fit in it. + * Set up Device(win) to our taste. + */ + mbase = pci_addr & mmask; + + /* check that we would really get from + * here to there. + */ + if ((mbase | offset) != pci_addr) + continue; + + devreg &= ~BRIDGE_DEV_OFF_MASK; + if (space != PCIIO_SPACE_IO) + devreg |= BRIDGE_DEV_DEV_IO_MEM; + else + devreg &= ~BRIDGE_DEV_DEV_IO_MEM; + devreg |= (mbase >> 20) & BRIDGE_DEV_OFF_MASK; + + /* default is WORD_VALUES. + * if you specify both, + * operation is undefined. + */ + if (flags & PCIIO_BYTE_STREAM) + devreg |= BRIDGE_DEV_DEV_SWAP; + else + devreg &= ~BRIDGE_DEV_DEV_SWAP; + + if (pcibr_soft->bs_slot[win].bss_device != devreg) { + bridge->b_device[win].reg = devreg; + pcibr_soft->bs_slot[win].bss_device = devreg; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + +#if DEBUG && PCI_DEBUG + printk("pcibr Device(%d): 0x%lx\n", win, bridge->b_device[win].reg); +#endif + } + pcibr_soft->bs_slot[win].bss_devio.bssd_space = space; + pcibr_soft->bs_slot[win].bss_devio.bssd_base = mbase; + xio_addr = BRIDGE_DEVIO(win) + (pci_addr - mbase); + +#if DEBUG && PCI_DEBUG + printk("%s LINE %d map to space %d space desc 0x%x[%lx..%lx] for slot %d allocates DevIO(%d) devreg 0x%x\n", + __FUNCTION__, __LINE__, space, space_desc, + pci_addr, pci_addr + req_size - 1, + slot, win, devreg); +#endif + + goto done; + } /* endif DevIO(x) not pointed */ + mbase = pcibr_soft->bs_slot[win].bss_devio.bssd_base; + + /* Now check for request incompat with DevIO(x) + */ + if ((mspace != space) || + (pci_addr < mbase) || + ((pci_addr + req_size) > (mbase + msize)) || + ((flags & PCIIO_BYTE_STREAM) && !(devreg & BRIDGE_DEV_DEV_SWAP)) || + (!(flags & PCIIO_BYTE_STREAM) && (devreg & BRIDGE_DEV_DEV_SWAP))) + continue; + + /* DevIO(x) window is pointed at PCI space + * that includes our target. Calculate the + * final XIO address, release the lock and + * return. + */ + xio_addr = BRIDGE_DEVIO(win) + (pci_addr - mbase); + +#if DEBUG && PCI_DEBUG + printk("%s LINE %d map to space %d [0x%p..0x%p] for slot %d uses DevIO(%d)\n", + __FUNCTION__, __LINE__, space, pci_addr, pci_addr + req_size - 1, slot, win); +#endif + goto done; + } + + switch (space) { + /* + * Accesses to device decode + * areas that do a not fit + * within the DevIO(x) space are + * modified to be accesses via + * the direct mapping areas. + * + * If necessary, drivers can + * explicitly ask for mappings + * into these address spaces, + * but this should never be needed. + */ + case PCIIO_SPACE_MEM: /* "mem space" */ + case PCIIO_SPACE_MEM32: /* "mem, use 32-bit-wide bus" */ + if ((pci_addr + BRIDGE_PCI_MEM32_BASE + req_size - 1) <= + BRIDGE_PCI_MEM32_LIMIT) + xio_addr = pci_addr + BRIDGE_PCI_MEM32_BASE; + break; + + case PCIIO_SPACE_MEM64: /* "mem, use 64-bit-wide bus" */ + if ((pci_addr + BRIDGE_PCI_MEM64_BASE + req_size - 1) <= + BRIDGE_PCI_MEM64_LIMIT) + xio_addr = pci_addr + BRIDGE_PCI_MEM64_BASE; + break; + + case PCIIO_SPACE_IO: /* "i/o space" */ + /* Bridge Hardware Bug WAR #482741: + * The 4G area that maps directly from + * XIO space to PCI I/O space is busted + * until Bridge Rev D. + */ + if ((pcibr_soft->bs_rev_num > BRIDGE_PART_REV_C) && + ((pci_addr + BRIDGE_PCI_IO_BASE + req_size - 1) <= + BRIDGE_PCI_IO_LIMIT)) + xio_addr = pci_addr + BRIDGE_PCI_IO_BASE; + break; + } + + /* Check that "Direct PIO" byteswapping matches, + * try to change it if it does not. + */ + if (xio_addr != XIO_NOWHERE) { + unsigned bst; /* nonzero to set bytestream */ + unsigned *bfp; /* addr of record of how swapper is set */ + unsigned swb; /* which control bit to mung */ + unsigned bfo; /* current swapper setting */ + unsigned bfn; /* desired swapper setting */ + + bfp = ((space == PCIIO_SPACE_IO) + ? (&pcibr_soft->bs_pio_end_io) + : (&pcibr_soft->bs_pio_end_mem)); + + bfo = *bfp; + + bst = flags & PCIIO_BYTE_STREAM; + + bfn = bst ? PCIIO_BYTE_STREAM : PCIIO_WORD_VALUES; + + if (bfn == bfo) { /* we already match. */ + ; + } else if (bfo != 0) { /* we have a conflict. */ +#if DEBUG && PCI_DEBUG + printk("pcibr_addr_pci_to_xio: swap conflict in space %d , was%s%s, want%s%s\n", + space, + bfo & PCIIO_BYTE_STREAM ? " BYTE_STREAM" : "", + bfo & PCIIO_WORD_VALUES ? " WORD_VALUES" : "", + bfn & PCIIO_BYTE_STREAM ? " BYTE_STREAM" : "", + bfn & PCIIO_WORD_VALUES ? " WORD_VALUES" : ""); +#endif + xio_addr = XIO_NOWHERE; + } else { /* OK to make the change. */ + bridgereg_t octl, nctl; + + swb = (space == PCIIO_SPACE_IO) ? BRIDGE_CTRL_IO_SWAP : BRIDGE_CTRL_MEM_SWAP; + octl = bridge->b_wid_control; + nctl = bst ? octl | swb : octl & ~swb; + + if (octl != nctl) /* make the change if any */ + bridge->b_wid_control = nctl; + + *bfp = bfn; /* record the assignment */ + +#if DEBUG && PCI_DEBUG + printk("pcibr_addr_pci_to_xio: swap for space %d set to%s%s\n", + space, + bfn & PCIIO_BYTE_STREAM ? " BYTE_STREAM" : "", + bfn & PCIIO_WORD_VALUES ? " WORD_VALUES" : ""); +#endif + } + } + done: + pcibr_unlock(pcibr_soft, s); + return xio_addr; +} + +/*ARGSUSED6 */ +pcibr_piomap_t +pcibr_piomap_alloc(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + pciio_space_t space, + iopaddr_t pci_addr, + size_t req_size, + size_t req_size_max, + unsigned flags) +{ + pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); + pciio_info_t pciio_info = &pcibr_info->f_c; + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + + pcibr_piomap_t *mapptr; + pcibr_piomap_t maplist; + pcibr_piomap_t pcibr_piomap; + iopaddr_t xio_addr; + xtalk_piomap_t xtalk_piomap; + unsigned long s; + + /* Make sure that the req sizes are non-zero */ + if ((req_size < 1) || (req_size_max < 1)) + return NULL; + + /* + * Code to translate slot/space/addr + * into xio_addr is common between + * this routine and pcibr_piotrans_addr. + */ + xio_addr = pcibr_addr_pci_to_xio(pconn_vhdl, pciio_slot, space, pci_addr, req_size, flags); + + if (xio_addr == XIO_NOWHERE) + return NULL; + + /* Check the piomap list to see if there is already an allocated + * piomap entry but not in use. If so use that one. Otherwise + * allocate a new piomap entry and add it to the piomap list + */ + mapptr = &(pcibr_info->f_piomap); + + s = pcibr_lock(pcibr_soft); + for (pcibr_piomap = *mapptr; + pcibr_piomap != NULL; + pcibr_piomap = pcibr_piomap->bp_next) { + if (pcibr_piomap->bp_mapsz == 0) + break; + } + + if (pcibr_piomap) + mapptr = NULL; + else { + pcibr_unlock(pcibr_soft, s); + NEW(pcibr_piomap); + } + + pcibr_piomap->bp_dev = pconn_vhdl; + pcibr_piomap->bp_slot = pciio_slot; + pcibr_piomap->bp_flags = flags; + pcibr_piomap->bp_space = space; + pcibr_piomap->bp_pciaddr = pci_addr; + pcibr_piomap->bp_mapsz = req_size; + pcibr_piomap->bp_soft = pcibr_soft; + pcibr_piomap->bp_toc[0] = ATOMIC_INIT(0); + + if (mapptr) { + s = pcibr_lock(pcibr_soft); + maplist = *mapptr; + pcibr_piomap->bp_next = maplist; + *mapptr = pcibr_piomap; + } + pcibr_unlock(pcibr_soft, s); + + + if (pcibr_piomap) { + xtalk_piomap = + xtalk_piomap_alloc(xconn_vhdl, 0, + xio_addr, + req_size, req_size_max, + flags & PIOMAP_FLAGS); + if (xtalk_piomap) { + pcibr_piomap->bp_xtalk_addr = xio_addr; + pcibr_piomap->bp_xtalk_pio = xtalk_piomap; + } else { + pcibr_piomap->bp_mapsz = 0; + pcibr_piomap = 0; + } + } + return pcibr_piomap; +} + +/*ARGSUSED */ +void +pcibr_piomap_free(pcibr_piomap_t pcibr_piomap) +{ + xtalk_piomap_free(pcibr_piomap->bp_xtalk_pio); + pcibr_piomap->bp_xtalk_pio = 0; + pcibr_piomap->bp_mapsz = 0; +} + +/*ARGSUSED */ +caddr_t +pcibr_piomap_addr(pcibr_piomap_t pcibr_piomap, + iopaddr_t pci_addr, + size_t req_size) +{ + return xtalk_piomap_addr(pcibr_piomap->bp_xtalk_pio, + pcibr_piomap->bp_xtalk_addr + + pci_addr - pcibr_piomap->bp_pciaddr, + req_size); +} + +/*ARGSUSED */ +void +pcibr_piomap_done(pcibr_piomap_t pcibr_piomap) +{ + xtalk_piomap_done(pcibr_piomap->bp_xtalk_pio); +} + +/*ARGSUSED */ +caddr_t +pcibr_piotrans_addr(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + pciio_space_t space, + iopaddr_t pci_addr, + size_t req_size, + unsigned flags) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + + iopaddr_t xio_addr; + + xio_addr = pcibr_addr_pci_to_xio(pconn_vhdl, pciio_slot, space, pci_addr, req_size, flags); + + if (xio_addr == XIO_NOWHERE) + return NULL; + + return xtalk_piotrans_addr(xconn_vhdl, 0, xio_addr, req_size, flags & PIOMAP_FLAGS); +} + +/* + * PIO Space allocation and management. + * Allocate and Manage the PCI PIO space (mem and io space) + * This routine is pretty simplistic at this time, and + * does pretty trivial management of allocation and freeing.. + * The current scheme is prone for fragmentation.. + * Change the scheme to use bitmaps. + */ + +/*ARGSUSED */ +iopaddr_t +pcibr_piospace_alloc(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + pciio_space_t space, + size_t req_size, + size_t alignment) +{ + pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); + pciio_info_t pciio_info = &pcibr_info->f_c; + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + + pciio_piospace_t piosp; + unsigned long s; + + iopaddr_t *pciaddr, *pcilast; + iopaddr_t start_addr; + size_t align_mask; + + /* + * Check for proper alignment + */ + ASSERT(alignment >= NBPP); + ASSERT((alignment & (alignment - 1)) == 0); + + align_mask = alignment - 1; + s = pcibr_lock(pcibr_soft); + + /* + * First look if a previously allocated chunk exists. + */ + if ((piosp = pcibr_info->f_piospace)) { + /* + * Look through the list for a right sized free chunk. + */ + do { + if (piosp->free && + (piosp->space == space) && + (piosp->count >= req_size) && + !(piosp->start & align_mask)) { + piosp->free = 0; + pcibr_unlock(pcibr_soft, s); + return piosp->start; + } + piosp = piosp->next; + } while (piosp); + } + ASSERT(!piosp); + + switch (space) { + case PCIIO_SPACE_IO: + pciaddr = &pcibr_soft->bs_spinfo.pci_io_base; + pcilast = &pcibr_soft->bs_spinfo.pci_io_last; + break; + case PCIIO_SPACE_MEM: + case PCIIO_SPACE_MEM32: + pciaddr = &pcibr_soft->bs_spinfo.pci_mem_base; + pcilast = &pcibr_soft->bs_spinfo.pci_mem_last; + break; + default: + ASSERT(0); + pcibr_unlock(pcibr_soft, s); + return 0; + } + + start_addr = *pciaddr; + + /* + * Align start_addr. + */ + if (start_addr & align_mask) + start_addr = (start_addr + align_mask) & ~align_mask; + + if ((start_addr + req_size) > *pcilast) { + /* + * If too big a request, reject it. + */ + pcibr_unlock(pcibr_soft, s); + return 0; + } + *pciaddr = (start_addr + req_size); + + NEW(piosp); + piosp->free = 0; + piosp->space = space; + piosp->start = start_addr; + piosp->count = req_size; + piosp->next = pcibr_info->f_piospace; + pcibr_info->f_piospace = piosp; + + pcibr_unlock(pcibr_soft, s); + return start_addr; +} + +/*ARGSUSED */ +void +pcibr_piospace_free(devfs_handle_t pconn_vhdl, + pciio_space_t space, + iopaddr_t pciaddr, + size_t req_size) +{ + pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pcibr_info->f_mfast; + + pciio_piospace_t piosp; + unsigned long s; + char name[1024]; + + /* + * Look through the bridge data structures for the pciio_piospace_t + * structure corresponding to 'pciaddr' + */ + s = pcibr_lock(pcibr_soft); + piosp = pcibr_info->f_piospace; + while (piosp) { + /* + * Piospace free can only be for the complete + * chunk and not parts of it.. + */ + if (piosp->start == pciaddr) { + if (piosp->count == req_size) + break; + /* + * Improper size passed for freeing.. + * Print a message and break; + */ + hwgraph_vertex_name_get(pconn_vhdl, name, 1024); + printk(KERN_WARNING "pcibr_piospace_free: error"); + printk(KERN_WARNING "Device %s freeing size (0x%lx) different than allocated (0x%lx)", + name, req_size, piosp->count); + printk(KERN_WARNING "Freeing 0x%lx instead", piosp->count); + break; + } + piosp = piosp->next; + } + + if (!piosp) { + printk(KERN_WARNING + "pcibr_piospace_free: Address 0x%lx size 0x%lx - No match\n", + pciaddr, req_size); + pcibr_unlock(pcibr_soft, s); + return; + } + piosp->free = 1; + pcibr_unlock(pcibr_soft, s); + return; +} + +/* ===================================================================== + * DMA MANAGEMENT + * + * The Bridge ASIC provides three methods of doing + * DMA: via a "direct map" register available in + * 32-bit PCI space (which selects a contiguous 2G + * address space on some other widget), via + * "direct" addressing via 64-bit PCI space (all + * destination information comes from the PCI + * address, including transfer attributes), and via + * a "mapped" region that allows a bunch of + * different small mappings to be established with + * the PMU. + * + * For efficiency, we most prefer to use the 32-bit + * direct mapping facility, since it requires no + * resource allocations. The advantage of using the + * PMU over the 64-bit direct is that single-cycle + * PCI addressing can be used; the advantage of + * using 64-bit direct over PMU addressing is that + * we do not have to allocate entries in the PMU. + */ + +/* + * Convert PCI-generic software flags and Bridge-specific software flags + * into Bridge-specific Direct Map attribute bits. + */ +static iopaddr_t +pcibr_flags_to_d64(unsigned flags, pcibr_soft_t pcibr_soft) +{ + iopaddr_t attributes = 0; + + /* Sanity check: Bridge only allows use of VCHAN1 via 64-bit addrs */ +#ifdef LATER + ASSERT_ALWAYS(!(flags & PCIBR_VCHAN1) || (flags & PCIIO_DMA_A64)); +#endif + + /* Generic macro flags + */ + if (flags & PCIIO_DMA_DATA) { /* standard data channel */ + attributes &= ~PCI64_ATTR_BAR; /* no barrier bit */ + attributes |= PCI64_ATTR_PREF; /* prefetch on */ + } + if (flags & PCIIO_DMA_CMD) { /* standard command channel */ + attributes |= PCI64_ATTR_BAR; /* barrier bit on */ + attributes &= ~PCI64_ATTR_PREF; /* disable prefetch */ + } + /* Generic detail flags + */ + if (flags & PCIIO_PREFETCH) + attributes |= PCI64_ATTR_PREF; + if (flags & PCIIO_NOPREFETCH) + attributes &= ~PCI64_ATTR_PREF; + + /* the swap bit is in the address attributes for xbridge */ + if (pcibr_soft->bs_xbridge) { + if (flags & PCIIO_BYTE_STREAM) + attributes |= PCI64_ATTR_SWAP; + if (flags & PCIIO_WORD_VALUES) + attributes &= ~PCI64_ATTR_SWAP; + } + + /* Provider-specific flags + */ + if (flags & PCIBR_BARRIER) + attributes |= PCI64_ATTR_BAR; + if (flags & PCIBR_NOBARRIER) + attributes &= ~PCI64_ATTR_BAR; + + if (flags & PCIBR_PREFETCH) + attributes |= PCI64_ATTR_PREF; + if (flags & PCIBR_NOPREFETCH) + attributes &= ~PCI64_ATTR_PREF; + + if (flags & PCIBR_PRECISE) + attributes |= PCI64_ATTR_PREC; + if (flags & PCIBR_NOPRECISE) + attributes &= ~PCI64_ATTR_PREC; + + if (flags & PCIBR_VCHAN1) + attributes |= PCI64_ATTR_VIRTUAL; + if (flags & PCIBR_VCHAN0) + attributes &= ~PCI64_ATTR_VIRTUAL; + + return (attributes); +} + +/*ARGSUSED */ +pcibr_dmamap_t +pcibr_dmamap_alloc(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + size_t req_size_max, + unsigned flags) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + pciio_slot_t slot; + xwidgetnum_t xio_port; + + xtalk_dmamap_t xtalk_dmamap; + pcibr_dmamap_t pcibr_dmamap; + int ate_count; + int ate_index; + + /* merge in forced flags */ + flags |= pcibr_soft->bs_dma_flags; + + /* + * On SNIA64, these maps are pre-allocated because pcibr_dmamap_alloc() + * can be called within an interrupt thread. + */ + pcibr_dmamap = (pcibr_dmamap_t)get_free_pciio_dmamap(pcibr_soft->bs_vhdl); + + if (!pcibr_dmamap) + return 0; + + xtalk_dmamap = xtalk_dmamap_alloc(xconn_vhdl, dev_desc, req_size_max, + flags & DMAMAP_FLAGS); + if (!xtalk_dmamap) { +#if PCIBR_ATE_DEBUG + printk("pcibr_attach: xtalk_dmamap_alloc failed\n"); +#endif + free_pciio_dmamap(pcibr_dmamap); + return 0; + } + xio_port = pcibr_soft->bs_mxid; + slot = pciio_info_slot_get(pciio_info); + + pcibr_dmamap->bd_dev = pconn_vhdl; + pcibr_dmamap->bd_slot = slot; + pcibr_dmamap->bd_soft = pcibr_soft; + pcibr_dmamap->bd_xtalk = xtalk_dmamap; + pcibr_dmamap->bd_max_size = req_size_max; + pcibr_dmamap->bd_xio_port = xio_port; + + if (flags & PCIIO_DMA_A64) { + if (!pcibr_try_set_device(pcibr_soft, slot, flags, BRIDGE_DEV_D64_BITS)) { + iopaddr_t pci_addr; + int have_rrbs; + int min_rrbs; + + /* Device is capable of A64 operations, + * and the attributes of the DMA are + * consistant with any previous DMA + * mappings using shared resources. + */ + + pci_addr = pcibr_flags_to_d64(flags, pcibr_soft); + + pcibr_dmamap->bd_flags = flags; + pcibr_dmamap->bd_xio_addr = 0; + pcibr_dmamap->bd_pci_addr = pci_addr; + + /* Make sure we have an RRB (or two). + */ + if (!(pcibr_soft->bs_rrb_fixed & (1 << slot))) { + if (flags & PCIBR_VCHAN1) + slot += PCIBR_RRB_SLOT_VIRTUAL; + have_rrbs = pcibr_soft->bs_rrb_valid[slot]; + if (have_rrbs < 2) { + if (pci_addr & PCI64_ATTR_PREF) + min_rrbs = 2; + else + min_rrbs = 1; + if (have_rrbs < min_rrbs) + do_pcibr_rrb_autoalloc(pcibr_soft, slot, min_rrbs - have_rrbs); + } + } +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: using direct64\n"); +#endif + return pcibr_dmamap; + } +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: unable to use direct64\n"); +#endif + flags &= ~PCIIO_DMA_A64; + } + if (flags & PCIIO_FIXED) { + /* warning: mappings may fail later, + * if direct32 can't get to the address. + */ + if (!pcibr_try_set_device(pcibr_soft, slot, flags, BRIDGE_DEV_D32_BITS)) { + /* User desires DIRECT A32 operations, + * and the attributes of the DMA are + * consistant with any previous DMA + * mappings using shared resources. + * Mapping calls may fail if target + * is outside the direct32 range. + */ +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: using direct32\n"); +#endif + pcibr_dmamap->bd_flags = flags; + pcibr_dmamap->bd_xio_addr = pcibr_soft->bs_dir_xbase; + pcibr_dmamap->bd_pci_addr = PCI32_DIRECT_BASE; + return pcibr_dmamap; + } +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: unable to use direct32\n"); +#endif + /* If the user demands FIXED and we can't + * give it to him, fail. + */ + xtalk_dmamap_free(xtalk_dmamap); + free_pciio_dmamap(pcibr_dmamap); + return 0; + } + /* + * Allocate Address Translation Entries from the mapping RAM. + * Unless the PCIBR_NO_ATE_ROUNDUP flag is specified, + * the maximum number of ATEs is based on the worst-case + * scenario, where the requested target is in the + * last byte of an ATE; thus, mapping IOPGSIZE+2 + * does end up requiring three ATEs. + */ + if (!(flags & PCIBR_NO_ATE_ROUNDUP)) { + ate_count = IOPG((IOPGSIZE - 1) /* worst case start offset */ + +req_size_max /* max mapping bytes */ + - 1) + 1; /* round UP */ + } else { /* assume requested target is page aligned */ + ate_count = IOPG(req_size_max /* max mapping bytes */ + - 1) + 1; /* round UP */ + } + + ate_index = pcibr_ate_alloc(pcibr_soft, ate_count); + + if (ate_index != -1) { + if (!pcibr_try_set_device(pcibr_soft, slot, flags, BRIDGE_DEV_PMU_BITS)) { + bridge_ate_t ate_proto; + int have_rrbs; + int min_rrbs; + +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: using PMU\n"); +#endif + + ate_proto = pcibr_flags_to_ate(flags); + + pcibr_dmamap->bd_flags = flags; + pcibr_dmamap->bd_pci_addr = + PCI32_MAPPED_BASE + IOPGSIZE * ate_index; + /* + * for xbridge the byte-swap bit == bit 29 of PCI address + */ + if (pcibr_soft->bs_xbridge) { + if (flags & PCIIO_BYTE_STREAM) + ATE_SWAP_ON(pcibr_dmamap->bd_pci_addr); + /* + * If swap was set in bss_device in pcibr_endian_set() + * we need to change the address bit. + */ + if (pcibr_soft->bs_slot[slot].bss_device & + BRIDGE_DEV_SWAP_PMU) + ATE_SWAP_ON(pcibr_dmamap->bd_pci_addr); + if (flags & PCIIO_WORD_VALUES) + ATE_SWAP_OFF(pcibr_dmamap->bd_pci_addr); + } + pcibr_dmamap->bd_xio_addr = 0; + pcibr_dmamap->bd_ate_ptr = pcibr_ate_addr(pcibr_soft, ate_index); + pcibr_dmamap->bd_ate_index = ate_index; + pcibr_dmamap->bd_ate_count = ate_count; + pcibr_dmamap->bd_ate_proto = ate_proto; + + /* Make sure we have an RRB (or two). + */ + if (!(pcibr_soft->bs_rrb_fixed & (1 << slot))) { + have_rrbs = pcibr_soft->bs_rrb_valid[slot]; + if (have_rrbs < 2) { + if (ate_proto & ATE_PREF) + min_rrbs = 2; + else + min_rrbs = 1; + if (have_rrbs < min_rrbs) + do_pcibr_rrb_autoalloc(pcibr_soft, slot, min_rrbs - have_rrbs); + } + } + if (ate_index >= pcibr_soft->bs_int_ate_size && + !pcibr_soft->bs_xbridge) { + bridge_t *bridge = pcibr_soft->bs_base; + volatile unsigned *cmd_regp; + unsigned cmd_reg; + unsigned long s; + + pcibr_dmamap->bd_flags |= PCIBR_DMAMAP_SSRAM; + + s = pcibr_lock(pcibr_soft); + cmd_regp = &(bridge-> + b_type0_cfg_dev[slot]. + l[PCI_CFG_COMMAND / 4]); + cmd_reg = *cmd_regp; + pcibr_soft->bs_slot[slot].bss_cmd_pointer = cmd_regp; + pcibr_soft->bs_slot[slot].bss_cmd_shadow = cmd_reg; + pcibr_unlock(pcibr_soft, s); + } + return pcibr_dmamap; + } +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: unable to use PMU\n"); +#endif + pcibr_ate_free(pcibr_soft, ate_index, ate_count); + } + /* total failure: sorry, you just can't + * get from here to there that way. + */ +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_alloc: complete failure.\n"); +#endif + xtalk_dmamap_free(xtalk_dmamap); + free_pciio_dmamap(pcibr_dmamap); + return 0; +} + +/*ARGSUSED */ +void +pcibr_dmamap_free(pcibr_dmamap_t pcibr_dmamap) +{ + pcibr_soft_t pcibr_soft = pcibr_dmamap->bd_soft; + pciio_slot_t slot = pcibr_dmamap->bd_slot; + + unsigned flags = pcibr_dmamap->bd_flags; + + /* Make sure that bss_ext_ates_active + * is properly kept up to date. + */ + + if (PCIBR_DMAMAP_BUSY & flags) + if (PCIBR_DMAMAP_SSRAM & flags) + atomic_dec(&(pcibr_soft->bs_slot[slot]. bss_ext_ates_active)); + + xtalk_dmamap_free(pcibr_dmamap->bd_xtalk); + + if (pcibr_dmamap->bd_flags & PCIIO_DMA_A64) { + pcibr_release_device(pcibr_soft, slot, BRIDGE_DEV_D64_BITS); + } + if (pcibr_dmamap->bd_ate_count) { + pcibr_ate_free(pcibr_dmamap->bd_soft, + pcibr_dmamap->bd_ate_index, + pcibr_dmamap->bd_ate_count); + pcibr_release_device(pcibr_soft, slot, BRIDGE_DEV_PMU_BITS); + } + + free_pciio_dmamap(pcibr_dmamap); +} + +/* + * pcibr_addr_xio_to_pci: given a PIO range, hand + * back the corresponding base PCI MEM address; + * this is used to short-circuit DMA requests that + * loop back onto this PCI bus. + */ +static iopaddr_t +pcibr_addr_xio_to_pci(pcibr_soft_t soft, + iopaddr_t xio_addr, + size_t req_size) +{ + iopaddr_t xio_lim = xio_addr + req_size - 1; + iopaddr_t pci_addr; + pciio_slot_t slot; + + if ((xio_addr >= BRIDGE_PCI_MEM32_BASE) && + (xio_lim <= BRIDGE_PCI_MEM32_LIMIT)) { + pci_addr = xio_addr - BRIDGE_PCI_MEM32_BASE; + return pci_addr; + } + if ((xio_addr >= BRIDGE_PCI_MEM64_BASE) && + (xio_lim <= BRIDGE_PCI_MEM64_LIMIT)) { + pci_addr = xio_addr - BRIDGE_PCI_MEM64_BASE; + return pci_addr; + } + for (slot = 0; slot < 8; ++slot) + if ((xio_addr >= BRIDGE_DEVIO(slot)) && + (xio_lim < BRIDGE_DEVIO(slot + 1))) { + bridgereg_t dev; + + dev = soft->bs_slot[slot].bss_device; + pci_addr = dev & BRIDGE_DEV_OFF_MASK; + pci_addr <<= BRIDGE_DEV_OFF_ADDR_SHFT; + pci_addr += xio_addr - BRIDGE_DEVIO(slot); + return (dev & BRIDGE_DEV_DEV_IO_MEM) ? pci_addr : PCI_NOWHERE; + } + return 0; +} + +/*ARGSUSED */ +iopaddr_t +pcibr_dmamap_addr(pcibr_dmamap_t pcibr_dmamap, + paddr_t paddr, + size_t req_size) +{ + pcibr_soft_t pcibr_soft; + iopaddr_t xio_addr; + xwidgetnum_t xio_port; + iopaddr_t pci_addr; + unsigned flags; + + ASSERT(pcibr_dmamap != NULL); + ASSERT(req_size > 0); + ASSERT(req_size <= pcibr_dmamap->bd_max_size); + + pcibr_soft = pcibr_dmamap->bd_soft; + + flags = pcibr_dmamap->bd_flags; + + xio_addr = xtalk_dmamap_addr(pcibr_dmamap->bd_xtalk, paddr, req_size); + if (XIO_PACKED(xio_addr)) { + xio_port = XIO_PORT(xio_addr); + xio_addr = XIO_ADDR(xio_addr); + } else + xio_port = pcibr_dmamap->bd_xio_port; + + /* If this DMA is to an address that + * refers back to this Bridge chip, + * reduce it back to the correct + * PCI MEM address. + */ + if (xio_port == pcibr_soft->bs_xid) { + pci_addr = pcibr_addr_xio_to_pci(pcibr_soft, xio_addr, req_size); + } else if (flags & PCIIO_DMA_A64) { + /* A64 DMA: + * always use 64-bit direct mapping, + * which always works. + * Device(x) was set up during + * dmamap allocation. + */ + + /* attributes are already bundled up into bd_pci_addr. + */ + pci_addr = pcibr_dmamap->bd_pci_addr + | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT) + | xio_addr; + + /* Bridge Hardware WAR #482836: + * If the transfer is not cache aligned + * and the Bridge Rev is <= B, force + * prefetch to be off. + */ + if (flags & PCIBR_NOPREFETCH) + pci_addr &= ~PCI64_ATTR_PREF; + +#if DEBUG && PCIBR_DMA_DEBUG + printk("pcibr_dmamap_addr (direct64):\n" + "\twanted paddr [0x%x..0x%x]\n" + "\tXIO port 0x%x offset 0x%x\n" + "\treturning PCI 0x%x\n", + paddr, paddr + req_size - 1, + xio_port, xio_addr, pci_addr); +#endif + } else if (flags & PCIIO_FIXED) { + /* A32 direct DMA: + * always use 32-bit direct mapping, + * which may fail. + * Device(x) was set up during + * dmamap allocation. + */ + + if (xio_port != pcibr_soft->bs_dir_xport) + pci_addr = 0; /* wrong DIDN */ + else if (xio_addr < pcibr_dmamap->bd_xio_addr) + pci_addr = 0; /* out of range */ + else if ((xio_addr + req_size) > + (pcibr_dmamap->bd_xio_addr + BRIDGE_DMA_DIRECT_SIZE)) + pci_addr = 0; /* out of range */ + else + pci_addr = pcibr_dmamap->bd_pci_addr + + xio_addr - pcibr_dmamap->bd_xio_addr; + +#if DEBUG && PCIBR_DMA_DEBUG + printk("pcibr_dmamap_addr (direct32):\n" + "\twanted paddr [0x%x..0x%x]\n" + "\tXIO port 0x%x offset 0x%x\n" + "\treturning PCI 0x%x\n", + paddr, paddr + req_size - 1, + xio_port, xio_addr, pci_addr); +#endif + } else { + bridge_t *bridge = pcibr_soft->bs_base; + iopaddr_t offset = IOPGOFF(xio_addr); + bridge_ate_t ate_proto = pcibr_dmamap->bd_ate_proto; + int ate_count = IOPG(offset + req_size - 1) + 1; + + int ate_index = pcibr_dmamap->bd_ate_index; + unsigned cmd_regs[8]; + unsigned s; + +#if PCIBR_FREEZE_TIME + int ate_total = ate_count; + unsigned freeze_time; +#endif + +#if PCIBR_ATE_DEBUG + bridge_ate_t ate_cmp; + bridge_ate_p ate_cptr; + unsigned ate_lo, ate_hi; + int ate_bad = 0; + int ate_rbc = 0; +#endif + bridge_ate_p ate_ptr = pcibr_dmamap->bd_ate_ptr; + bridge_ate_t ate; + + /* Bridge Hardware WAR #482836: + * If the transfer is not cache aligned + * and the Bridge Rev is <= B, force + * prefetch to be off. + */ + if (flags & PCIBR_NOPREFETCH) + ate_proto &= ~ATE_PREF; + + ate = ate_proto + | (xio_port << ATE_TIDSHIFT) + | (xio_addr - offset); + + pci_addr = pcibr_dmamap->bd_pci_addr + offset; + + /* Fill in our mapping registers + * with the appropriate xtalk data, + * and hand back the PCI address. + */ + + ASSERT(ate_count > 0); + if (ate_count <= pcibr_dmamap->bd_ate_count) { + ATE_FREEZE(); + ATE_WRITE(); + ATE_THAW(); + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + } else { + /* The number of ATE's required is greater than the number + * allocated for this map. One way this can happen is if + * pcibr_dmamap_alloc() was called with the PCIBR_NO_ATE_ROUNDUP + * flag, and then when that map is used (right now), the + * target address tells us we really did need to roundup. + * The other possibility is that the map is just plain too + * small to handle the requested target area. + */ +#if PCIBR_ATE_DEBUG + printk(KERN_WARNING "pcibr_dmamap_addr :\n" + "\twanted paddr [0x%x..0x%x]\n" + "\tate_count 0x%x bd_ate_count 0x%x\n" + "\tATE's required > number allocated\n", + paddr, paddr + req_size - 1, + ate_count, pcibr_dmamap->bd_ate_count); +#endif + pci_addr = 0; + } + + } + return pci_addr; +} + +/*ARGSUSED */ +alenlist_t +pcibr_dmamap_list(pcibr_dmamap_t pcibr_dmamap, + alenlist_t palenlist, + unsigned flags) +{ + pcibr_soft_t pcibr_soft; + bridge_t *bridge=NULL; + + unsigned al_flags = (flags & PCIIO_NOSLEEP) ? AL_NOSLEEP : 0; + int inplace = flags & PCIIO_INPLACE; + + alenlist_t pciio_alenlist = 0; + alenlist_t xtalk_alenlist; + size_t length; + iopaddr_t offset; + unsigned direct64; + int ate_index = 0; + int ate_count = 0; + int ate_total = 0; + bridge_ate_p ate_ptr = (bridge_ate_p)0; + bridge_ate_t ate_proto = (bridge_ate_t)0; + bridge_ate_t ate_prev; + bridge_ate_t ate; + alenaddr_t xio_addr; + xwidgetnum_t xio_port; + iopaddr_t pci_addr; + alenaddr_t new_addr; + unsigned cmd_regs[8]; + unsigned s = 0; + +#if PCIBR_FREEZE_TIME + unsigned freeze_time; +#endif + int ate_freeze_done = 0; /* To pair ATE_THAW + * with an ATE_FREEZE + */ + + pcibr_soft = pcibr_dmamap->bd_soft; + + xtalk_alenlist = xtalk_dmamap_list(pcibr_dmamap->bd_xtalk, palenlist, + flags & DMAMAP_FLAGS); + if (!xtalk_alenlist) + goto fail; + + alenlist_cursor_init(xtalk_alenlist, 0, NULL); + + if (inplace) { + pciio_alenlist = xtalk_alenlist; + } else { + pciio_alenlist = alenlist_create(al_flags); + if (!pciio_alenlist) + goto fail; + } + + direct64 = pcibr_dmamap->bd_flags & PCIIO_DMA_A64; + if (!direct64) { + bridge = pcibr_soft->bs_base; + ate_ptr = pcibr_dmamap->bd_ate_ptr; + ate_index = pcibr_dmamap->bd_ate_index; + ate_proto = pcibr_dmamap->bd_ate_proto; + ATE_FREEZE(); + ate_freeze_done = 1; /* Remember that we need to do an ATE_THAW */ + } + pci_addr = pcibr_dmamap->bd_pci_addr; + + ate_prev = 0; /* matches no valid ATEs */ + while (ALENLIST_SUCCESS == + alenlist_get(xtalk_alenlist, NULL, 0, + &xio_addr, &length, al_flags)) { + if (XIO_PACKED(xio_addr)) { + xio_port = XIO_PORT(xio_addr); + xio_addr = XIO_ADDR(xio_addr); + } else + xio_port = pcibr_dmamap->bd_xio_port; + + if (xio_port == pcibr_soft->bs_xid) { + new_addr = pcibr_addr_xio_to_pci(pcibr_soft, xio_addr, length); + if (new_addr == PCI_NOWHERE) + goto fail; + } else if (direct64) { + new_addr = pci_addr | xio_addr + | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); + + /* Bridge Hardware WAR #482836: + * If the transfer is not cache aligned + * and the Bridge Rev is <= B, force + * prefetch to be off. + */ + if (flags & PCIBR_NOPREFETCH) + new_addr &= ~PCI64_ATTR_PREF; + + } else { + /* calculate the ate value for + * the first address. If it + * matches the previous + * ATE written (ie. we had + * multiple blocks in the + * same IOPG), then back up + * and reuse that ATE. + * + * We are NOT going to + * aggressively try to + * reuse any other ATEs. + */ + offset = IOPGOFF(xio_addr); + ate = ate_proto + | (xio_port << ATE_TIDSHIFT) + | (xio_addr - offset); + if (ate == ate_prev) { +#if PCIBR_ATE_DEBUG + printk("pcibr_dmamap_list: ATE share\n"); +#endif + ate_ptr--; + ate_index--; + pci_addr -= IOPGSIZE; + } + new_addr = pci_addr + offset; + + /* Fill in the hardware ATEs + * that contain this block. + */ + ate_count = IOPG(offset + length - 1) + 1; + ate_total += ate_count; + + /* Ensure that this map contains enough ATE's */ + if (ate_total > pcibr_dmamap->bd_ate_count) { +#if PCIBR_ATE_DEBUG + printk(KERN_WARNING "pcibr_dmamap_list :\n" + "\twanted xio_addr [0x%x..0x%x]\n" + "\tate_total 0x%x bd_ate_count 0x%x\n" + "\tATE's required > number allocated\n", + xio_addr, xio_addr + length - 1, + ate_total, pcibr_dmamap->bd_ate_count); +#endif + goto fail; + } + + ATE_WRITE(); + + ate_index += ate_count; + ate_ptr += ate_count; + + ate_count <<= IOPFNSHIFT; + ate += ate_count; + pci_addr += ate_count; + } + + /* write the PCI DMA address + * out to the scatter-gather list. + */ + if (inplace) { + if (ALENLIST_SUCCESS != + alenlist_replace(pciio_alenlist, NULL, + &new_addr, &length, al_flags)) + goto fail; + } else { + if (ALENLIST_SUCCESS != + alenlist_append(pciio_alenlist, + new_addr, length, al_flags)) + goto fail; + } + } + if (!inplace) + alenlist_done(xtalk_alenlist); + + /* Reset the internal cursor of the alenlist to be returned back + * to the caller. + */ + alenlist_cursor_init(pciio_alenlist, 0, NULL); + + + /* In case an ATE_FREEZE was done do the ATE_THAW to unroll all the + * changes that ATE_FREEZE has done to implement the external SSRAM + * bug workaround. + */ + if (ate_freeze_done) { + ATE_THAW(); + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + } + return pciio_alenlist; + + fail: + /* There are various points of failure after doing an ATE_FREEZE + * We need to do an ATE_THAW. Otherwise the ATEs are locked forever. + * The decision to do an ATE_THAW needs to be based on whether a + * an ATE_FREEZE was done before. + */ + if (ate_freeze_done) { + ATE_THAW(); + bridge->b_wid_tflush; + } + if (pciio_alenlist && !inplace) + alenlist_destroy(pciio_alenlist); + return 0; +} + +/*ARGSUSED */ +void +pcibr_dmamap_done(pcibr_dmamap_t pcibr_dmamap) +{ + /* + * We could go through and invalidate ATEs here; + * for performance reasons, we don't. + * We also don't enforce the strict alternation + * between _addr/_list and _done, but Hub does. + */ + + if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_BUSY) { + pcibr_dmamap->bd_flags &= ~PCIBR_DMAMAP_BUSY; + + if (pcibr_dmamap->bd_flags & PCIBR_DMAMAP_SSRAM) + atomic_dec(&(pcibr_dmamap->bd_soft->bs_slot[pcibr_dmamap->bd_slot]. bss_ext_ates_active)); + } + xtalk_dmamap_done(pcibr_dmamap->bd_xtalk); +} + + +/* + * For each bridge, the DIR_OFF value in the Direct Mapping Register + * determines the PCI to Crosstalk memory mapping to be used for all + * 32-bit Direct Mapping memory accesses. This mapping can be to any + * node in the system. This function will return that compact node id. + */ + +/*ARGSUSED */ +cnodeid_t +pcibr_get_dmatrans_node(devfs_handle_t pconn_vhdl) +{ + + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + + return(NASID_TO_COMPACT_NODEID(NASID_GET(pcibr_soft->bs_dir_xbase))); +} + +/*ARGSUSED */ +iopaddr_t +pcibr_dmatrans_addr(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + paddr_t paddr, + size_t req_size, + unsigned flags) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_slot_t slotp = &pcibr_soft->bs_slot[pciio_slot]; + + xwidgetnum_t xio_port; + iopaddr_t xio_addr; + iopaddr_t pci_addr; + + int have_rrbs; + int min_rrbs; + + /* merge in forced flags */ + flags |= pcibr_soft->bs_dma_flags; + + xio_addr = xtalk_dmatrans_addr(xconn_vhdl, 0, paddr, req_size, + flags & DMAMAP_FLAGS); + if (!xio_addr) { +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + return 0; + } + /* + * find which XIO port this goes to. + */ + if (XIO_PACKED(xio_addr)) { + if (xio_addr == XIO_NOWHERE) { +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + return 0; + } + xio_port = XIO_PORT(xio_addr); + xio_addr = XIO_ADDR(xio_addr); + + } else + xio_port = pcibr_soft->bs_mxid; + + /* + * If this DMA comes back to us, + * return the PCI MEM address on + * which it would land, or NULL + * if the target is something + * on bridge other than PCI MEM. + */ + if (xio_port == pcibr_soft->bs_xid) { + pci_addr = pcibr_addr_xio_to_pci(pcibr_soft, xio_addr, req_size); + return pci_addr; + } + /* If the caller can use A64, try to + * satisfy the request with the 64-bit + * direct map. This can fail if the + * configuration bits in Device(x) + * conflict with our flags. + */ + + if (flags & PCIIO_DMA_A64) { + pci_addr = slotp->bss_d64_base; + if (!(flags & PCIBR_VCHAN1)) + flags |= PCIBR_VCHAN0; + if ((pci_addr != PCIBR_D64_BASE_UNSET) && + (flags == slotp->bss_d64_flags)) { + +#ifdef CONFIG_IA64_SGI_SN2 + pci_addr |= (PHYS_TO_DMA(xio_addr)) + | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); +#else + pci_addr |= xio_addr + | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); +#endif + +#if DEBUG && PCIBR_DMA_DEBUG +#if HWG_PERF_CHECK + if (xio_addr != 0x20000000) +#endif + printk("pcibr_dmatrans_addr: [reuse]\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tdirect 64bit address is 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr, pci_addr); +#endif + return (pci_addr); + } + if (!pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D64_BITS)) { + pci_addr = pcibr_flags_to_d64(flags, pcibr_soft); + slotp->bss_d64_flags = flags; + slotp->bss_d64_base = pci_addr; +#ifdef CONFIG_IA64_SGI_SN2 + pci_addr |= (PHYS_TO_DMA(xio_addr)) + | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); +#else + pci_addr |= xio_addr + | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); +#endif + + /* Make sure we have an RRB (or two). + */ + if (!(pcibr_soft->bs_rrb_fixed & (1 << pciio_slot))) { + if (flags & PCIBR_VCHAN1) + pciio_slot += PCIBR_RRB_SLOT_VIRTUAL; + have_rrbs = pcibr_soft->bs_rrb_valid[pciio_slot]; + if (have_rrbs < 2) { + if (pci_addr & PCI64_ATTR_PREF) + min_rrbs = 2; + else + min_rrbs = 1; + if (have_rrbs < min_rrbs) + do_pcibr_rrb_autoalloc(pcibr_soft, pciio_slot, min_rrbs - have_rrbs); + } + } +#if PCIBR_DMA_DEBUG +#if HWG_PERF_CHECK + if (xio_addr != 0x20000000) +#endif + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tdirect 64bit address is 0x%x\n" + "\tnew flags: 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr, pci_addr, (uint64_t) flags); +#endif + return (pci_addr); + } + /* our flags conflict with Device(x). + */ + flags = flags + & ~PCIIO_DMA_A64 + & ~PCIBR_VCHAN0 + ; + +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tUnable to set Device(x) bits for Direct-64\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + } + /* Try to satisfy the request with the 32-bit direct + * map. This can fail if the configuration bits in + * Device(x) conflict with our flags, or if the + * target address is outside where DIR_OFF points. + */ + { + size_t map_size = 1ULL << 31; + iopaddr_t xio_base = pcibr_soft->bs_dir_xbase; + iopaddr_t offset = xio_addr - xio_base; + iopaddr_t endoff = req_size + offset; + + if ((req_size > map_size) || + (xio_addr < xio_base) || + (xio_port != pcibr_soft->bs_dir_xport) || + (endoff > map_size)) { +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\txio region outside direct32 target\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + } else { + pci_addr = slotp->bss_d32_base; + if ((pci_addr != PCIBR_D32_BASE_UNSET) && + (flags == slotp->bss_d32_flags)) { + + pci_addr |= offset; + +#if DEBUG && PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr: [reuse]\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tmapped via direct32 offset 0x%x\n" + "\twill DMA via pci addr 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr, offset, pci_addr); +#endif + return (pci_addr); + } + if (!pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D32_BITS)) { + + pci_addr = PCI32_DIRECT_BASE; + slotp->bss_d32_flags = flags; + slotp->bss_d32_base = pci_addr; + pci_addr |= offset; + + /* Make sure we have an RRB (or two). + */ + if (!(pcibr_soft->bs_rrb_fixed & (1 << pciio_slot))) { + have_rrbs = pcibr_soft->bs_rrb_valid[pciio_slot]; + if (have_rrbs < 2) { + if (slotp->bss_device & BRIDGE_DEV_PREF) + min_rrbs = 2; + else + min_rrbs = 1; + if (have_rrbs < min_rrbs) + do_pcibr_rrb_autoalloc(pcibr_soft, pciio_slot, min_rrbs - have_rrbs); + } + } +#if PCIBR_DMA_DEBUG +#if HWG_PERF_CHECK + if (xio_addr != 0x20000000) +#endif + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tmapped via direct32 offset 0x%x\n" + "\twill DMA via pci addr 0x%x\n" + "\tnew flags: 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr, offset, pci_addr, (uint64_t) flags); +#endif + return (pci_addr); + } + /* our flags conflict with Device(x). + */ +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tUnable to set Device(x) bits for Direct-32\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + } + } + +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n" + "\tno acceptable PCI address found or constructable\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + + return 0; +} + +/*ARGSUSED */ +alenlist_t +pcibr_dmatrans_list(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + alenlist_t palenlist, + unsigned flags) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_slot_t slotp = &pcibr_soft->bs_slot[pciio_slot]; + xwidgetnum_t xio_port; + + alenlist_t pciio_alenlist = 0; + alenlist_t xtalk_alenlist = 0; + + int inplace; + unsigned direct64; + unsigned al_flags; + + iopaddr_t xio_base; + alenaddr_t xio_addr; + size_t xio_size; + + size_t map_size; + iopaddr_t pci_base; + alenaddr_t pci_addr; + + unsigned relbits = 0; + + /* merge in forced flags */ + flags |= pcibr_soft->bs_dma_flags; + + inplace = flags & PCIIO_INPLACE; + direct64 = flags & PCIIO_DMA_A64; + al_flags = (flags & PCIIO_NOSLEEP) ? AL_NOSLEEP : 0; + + if (direct64) { + map_size = 1ull << 48; + xio_base = 0; + pci_base = slotp->bss_d64_base; + if ((pci_base != PCIBR_D64_BASE_UNSET) && + (flags == slotp->bss_d64_flags)) { + /* reuse previous base info */ + } else if (pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D64_BITS) < 0) { + /* DMA configuration conflict */ + goto fail; + } else { + relbits = BRIDGE_DEV_D64_BITS; + pci_base = + pcibr_flags_to_d64(flags, pcibr_soft); + } + } else { + xio_base = pcibr_soft->bs_dir_xbase; + map_size = 1ull << 31; + pci_base = slotp->bss_d32_base; + if ((pci_base != PCIBR_D32_BASE_UNSET) && + (flags == slotp->bss_d32_flags)) { + /* reuse previous base info */ + } else if (pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D32_BITS) < 0) { + /* DMA configuration conflict */ + goto fail; + } else { + relbits = BRIDGE_DEV_D32_BITS; + pci_base = PCI32_DIRECT_BASE; + } + } + + xtalk_alenlist = xtalk_dmatrans_list(xconn_vhdl, 0, palenlist, + flags & DMAMAP_FLAGS); + if (!xtalk_alenlist) + goto fail; + + alenlist_cursor_init(xtalk_alenlist, 0, NULL); + + if (inplace) { + pciio_alenlist = xtalk_alenlist; + } else { + pciio_alenlist = alenlist_create(al_flags); + if (!pciio_alenlist) + goto fail; + } + + while (ALENLIST_SUCCESS == + alenlist_get(xtalk_alenlist, NULL, 0, + &xio_addr, &xio_size, al_flags)) { + + /* + * find which XIO port this goes to. + */ + if (XIO_PACKED(xio_addr)) { + if (xio_addr == XIO_NOWHERE) { +#if PCIBR_DMA_DEBUG + printk("pcibr_dmatrans_addr:\n" + "\tpciio connection point %v\n" + "\txtalk connection point %v\n" + "\twanted paddr [0x%x..0x%x]\n" + "\txtalk_dmatrans_addr returned 0x%x\n", + pconn_vhdl, xconn_vhdl, + paddr, paddr + req_size - 1, + xio_addr); +#endif + return 0; + } + xio_port = XIO_PORT(xio_addr); + xio_addr = XIO_ADDR(xio_addr); + } else + xio_port = pcibr_soft->bs_mxid; + + /* + * If this DMA comes back to us, + * return the PCI MEM address on + * which it would land, or NULL + * if the target is something + * on bridge other than PCI MEM. + */ + if (xio_port == pcibr_soft->bs_xid) { + pci_addr = pcibr_addr_xio_to_pci(pcibr_soft, xio_addr, xio_size); + if ( (pci_addr == (alenaddr_t)NULL) ) + goto fail; + } else if (direct64) { + ASSERT(xio_port != 0); + pci_addr = pci_base | xio_addr + | ((uint64_t) xio_port << PCI64_ATTR_TARG_SHFT); + } else { + iopaddr_t offset = xio_addr - xio_base; + iopaddr_t endoff = xio_size + offset; + + if ((xio_size > map_size) || + (xio_addr < xio_base) || + (xio_port != pcibr_soft->bs_dir_xport) || + (endoff > map_size)) + goto fail; + + pci_addr = pci_base + (xio_addr - xio_base); + } + + /* write the PCI DMA address + * out to the scatter-gather list. + */ + if (inplace) { + if (ALENLIST_SUCCESS != + alenlist_replace(pciio_alenlist, NULL, + &pci_addr, &xio_size, al_flags)) + goto fail; + } else { + if (ALENLIST_SUCCESS != + alenlist_append(pciio_alenlist, + pci_addr, xio_size, al_flags)) + goto fail; + } + } + + if (relbits) { + if (direct64) { + slotp->bss_d64_flags = flags; + slotp->bss_d64_base = pci_base; + } else { + slotp->bss_d32_flags = flags; + slotp->bss_d32_base = pci_base; + } + } + if (!inplace) + alenlist_done(xtalk_alenlist); + + /* Reset the internal cursor of the alenlist to be returned back + * to the caller. + */ + alenlist_cursor_init(pciio_alenlist, 0, NULL); + return pciio_alenlist; + + fail: + if (relbits) + pcibr_release_device(pcibr_soft, pciio_slot, relbits); + if (pciio_alenlist && !inplace) + alenlist_destroy(pciio_alenlist); + return 0; +} + +void +pcibr_dmamap_drain(pcibr_dmamap_t map) +{ + xtalk_dmamap_drain(map->bd_xtalk); +} + +void +pcibr_dmaaddr_drain(devfs_handle_t pconn_vhdl, + paddr_t paddr, + size_t bytes) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + + xtalk_dmaaddr_drain(xconn_vhdl, paddr, bytes); +} + +void +pcibr_dmalist_drain(devfs_handle_t pconn_vhdl, + alenlist_t list) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + + xtalk_dmalist_drain(xconn_vhdl, list); +} + +/* + * Get the starting PCIbus address out of the given DMA map. + * This function is supposed to be used by a close friend of PCI bridge + * since it relies on the fact that the starting address of the map is fixed at + * the allocation time in the current implementation of PCI bridge. + */ +iopaddr_t +pcibr_dmamap_pciaddr_get(pcibr_dmamap_t pcibr_dmamap) +{ + return (pcibr_dmamap->bd_pci_addr); +} + +/* ===================================================================== + * CONFIGURATION MANAGEMENT + */ +/*ARGSUSED */ +void +pcibr_provider_startup(devfs_handle_t pcibr) +{ +} + +/*ARGSUSED */ +void +pcibr_provider_shutdown(devfs_handle_t pcibr) +{ +} + +int +pcibr_reset(devfs_handle_t conn) +{ + pciio_info_t pciio_info = pciio_info_get(conn); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + bridge_t *bridge = pcibr_soft->bs_base; + bridgereg_t ctlreg; + unsigned cfgctl[8]; + unsigned long s; + int f, nf; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + int win; + + if (pcibr_soft->bs_slot[pciio_slot].has_host) { + pciio_slot = pcibr_soft->bs_slot[pciio_slot].host_slot; + pcibr_info = pcibr_soft->bs_slot[pciio_slot].bss_infos[0]; + } + if (pciio_slot < 4) { + s = pcibr_lock(pcibr_soft); + nf = pcibr_soft->bs_slot[pciio_slot].bss_ninfo; + pcibr_infoh = pcibr_soft->bs_slot[pciio_slot].bss_infos; + for (f = 0; f < nf; ++f) + if (pcibr_infoh[f]) + cfgctl[f] = bridge->b_type0_cfg_dev[pciio_slot].f[f].l[PCI_CFG_COMMAND / 4]; + + ctlreg = bridge->b_wid_control; + bridge->b_wid_control = ctlreg | BRIDGE_CTRL_RST(pciio_slot); + /* XXX delay? */ + bridge->b_wid_control = ctlreg; + /* XXX delay? */ + + for (f = 0; f < nf; ++f) + if ((pcibr_info = pcibr_infoh[f])) + for (win = 0; win < 6; ++win) + if (pcibr_info->f_window[win].w_base != 0) + bridge->b_type0_cfg_dev[pciio_slot].f[f].l[PCI_CFG_BASE_ADDR(win) / 4] = + pcibr_info->f_window[win].w_base; + for (f = 0; f < nf; ++f) + if (pcibr_infoh[f]) + bridge->b_type0_cfg_dev[pciio_slot].f[f].l[PCI_CFG_COMMAND / 4] = cfgctl[f]; + pcibr_unlock(pcibr_soft, s); + + return 0; + } +#ifdef SUPPORT_PRINTING_V_FORMAT + printk(KERN_WARNING "%v: pcibr_reset unimplemented for slot %d\n", + conn, pciio_slot); +#endif + return -1; +} + +pciio_endian_t +pcibr_endian_set(devfs_handle_t pconn_vhdl, + pciio_endian_t device_end, + pciio_endian_t desired_end) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + bridgereg_t devreg; + unsigned long s; + + /* + * Bridge supports hardware swapping; so we can always + * arrange for the caller's desired endianness. + */ + + s = pcibr_lock(pcibr_soft); + devreg = pcibr_soft->bs_slot[pciio_slot].bss_device; + if (device_end != desired_end) + devreg |= BRIDGE_DEV_SWAP_BITS; + else + devreg &= ~BRIDGE_DEV_SWAP_BITS; + + /* NOTE- if we ever put SWAP bits + * onto the disabled list, we will + * have to change the logic here. + */ + if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) { + bridge_t *bridge = pcibr_soft->bs_base; + + bridge->b_device[pciio_slot].reg = devreg; + pcibr_soft->bs_slot[pciio_slot].bss_device = devreg; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + } + pcibr_unlock(pcibr_soft, s); + +#if DEBUG && PCIBR_DEV_DEBUG + printk("pcibr Device(%d): 0x%p\n", pciio_slot, bridge->b_device[pciio_slot].reg); +#endif + + return desired_end; +} + +/* This (re)sets the GBR and REALTIME bits and also keeps track of how + * many sets are outstanding. Reset succeeds only if the number of outstanding + * sets == 1. + */ +int +pcibr_priority_bits_set(pcibr_soft_t pcibr_soft, + pciio_slot_t pciio_slot, + pciio_priority_t device_prio) +{ + unsigned long s; + int *counter; + bridgereg_t rtbits = 0; + bridgereg_t devreg; + int rc = PRIO_SUCCESS; + + /* in dual-slot configurations, the host and the + * guest have separate DMA resources, so they + * have separate requirements for priority bits. + */ + + counter = &(pcibr_soft->bs_slot[pciio_slot].bss_pri_uctr); + + /* + * Bridge supports PCI notions of LOW and HIGH priority + * arbitration rings via a "REAL_TIME" bit in the per-device + * Bridge register. The "GBR" bit controls access to the GBR + * ring on the xbow. These two bits are (re)set together. + * + * XXX- Bug in Rev B Bridge Si: + * Symptom: Prefetcher starts operating incorrectly. This happens + * due to corruption of the address storage ram in the prefetcher + * when a non-real time PCI request is pulled and a real-time one is + * put in it's place. Workaround: Use only a single arbitration ring + * on PCI bus. GBR and RR can still be uniquely used per + * device. NETLIST MERGE DONE, WILL BE FIXED IN REV C. + */ + + if (pcibr_soft->bs_rev_num != BRIDGE_PART_REV_B) + rtbits |= BRIDGE_DEV_RT; + + /* NOTE- if we ever put DEV_RT or DEV_GBR on + * the disabled list, we will have to take + * it into account here. + */ + + s = pcibr_lock(pcibr_soft); + devreg = pcibr_soft->bs_slot[pciio_slot].bss_device; + if (device_prio == PCI_PRIO_HIGH) { + if ((++*counter == 1)) { + if (rtbits) + devreg |= rtbits; + else + rc = PRIO_FAIL; + } + } else if (device_prio == PCI_PRIO_LOW) { + if (*counter <= 0) + rc = PRIO_FAIL; + else if (--*counter == 0) + if (rtbits) + devreg &= ~rtbits; + } + if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) { + bridge_t *bridge = pcibr_soft->bs_base; + + bridge->b_device[pciio_slot].reg = devreg; + pcibr_soft->bs_slot[pciio_slot].bss_device = devreg; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + } + pcibr_unlock(pcibr_soft, s); + + return rc; +} + +pciio_priority_t +pcibr_priority_set(devfs_handle_t pconn_vhdl, + pciio_priority_t device_prio) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + + (void) pcibr_priority_bits_set(pcibr_soft, pciio_slot, device_prio); + + return device_prio; +} + +/* + * Interfaces to allow special (e.g. SGI) drivers to set/clear + * Bridge-specific device flags. Many flags are modified through + * PCI-generic interfaces; we don't allow them to be directly + * manipulated here. Only flags that at this point seem pretty + * Bridge-specific can be set through these special interfaces. + * We may add more flags as the need arises, or remove flags and + * create PCI-generic interfaces as the need arises. + * + * Returns 0 on failure, 1 on success + */ +int +pcibr_device_flags_set(devfs_handle_t pconn_vhdl, + pcibr_device_flags_t flags) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + bridgereg_t set = 0; + bridgereg_t clr = 0; + + ASSERT((flags & PCIBR_DEVICE_FLAGS) == flags); + + if (flags & PCIBR_WRITE_GATHER) + set |= BRIDGE_DEV_PMU_WRGA_EN; + if (flags & PCIBR_NOWRITE_GATHER) + clr |= BRIDGE_DEV_PMU_WRGA_EN; + + if (flags & PCIBR_WRITE_GATHER) + set |= BRIDGE_DEV_DIR_WRGA_EN; + if (flags & PCIBR_NOWRITE_GATHER) + clr |= BRIDGE_DEV_DIR_WRGA_EN; + + if (flags & PCIBR_PREFETCH) + set |= BRIDGE_DEV_PREF; + if (flags & PCIBR_NOPREFETCH) + clr |= BRIDGE_DEV_PREF; + + if (flags & PCIBR_PRECISE) + set |= BRIDGE_DEV_PRECISE; + if (flags & PCIBR_NOPRECISE) + clr |= BRIDGE_DEV_PRECISE; + + if (flags & PCIBR_BARRIER) + set |= BRIDGE_DEV_BARRIER; + if (flags & PCIBR_NOBARRIER) + clr |= BRIDGE_DEV_BARRIER; + + if (flags & PCIBR_64BIT) + set |= BRIDGE_DEV_DEV_SIZE; + if (flags & PCIBR_NO64BIT) + clr |= BRIDGE_DEV_DEV_SIZE; + + if (set || clr) { + bridgereg_t devreg; + unsigned long s; + + s = pcibr_lock(pcibr_soft); + devreg = pcibr_soft->bs_slot[pciio_slot].bss_device; + devreg = (devreg & ~clr) | set; + if (pcibr_soft->bs_slot[pciio_slot].bss_device != devreg) { + bridge_t *bridge = pcibr_soft->bs_base; + + bridge->b_device[pciio_slot].reg = devreg; + pcibr_soft->bs_slot[pciio_slot].bss_device = devreg; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + } + pcibr_unlock(pcibr_soft, s); +#if DEBUG && PCIBR_DEV_DEBUG + printk("pcibr Device(%d): %R\n", pciio_slot, bridge->b_device[pciio_slot].regbridge->b_device[pciio_slot].reg, device_bits); +#endif + } + return (1); +} + +pciio_provider_t pcibr_provider = +{ + (pciio_piomap_alloc_f *) pcibr_piomap_alloc, + (pciio_piomap_free_f *) pcibr_piomap_free, + (pciio_piomap_addr_f *) pcibr_piomap_addr, + (pciio_piomap_done_f *) pcibr_piomap_done, + (pciio_piotrans_addr_f *) pcibr_piotrans_addr, + (pciio_piospace_alloc_f *) pcibr_piospace_alloc, + (pciio_piospace_free_f *) pcibr_piospace_free, + + (pciio_dmamap_alloc_f *) pcibr_dmamap_alloc, + (pciio_dmamap_free_f *) pcibr_dmamap_free, + (pciio_dmamap_addr_f *) pcibr_dmamap_addr, + (pciio_dmamap_list_f *) pcibr_dmamap_list, + (pciio_dmamap_done_f *) pcibr_dmamap_done, + (pciio_dmatrans_addr_f *) pcibr_dmatrans_addr, + (pciio_dmatrans_list_f *) pcibr_dmatrans_list, + (pciio_dmamap_drain_f *) pcibr_dmamap_drain, + (pciio_dmaaddr_drain_f *) pcibr_dmaaddr_drain, + (pciio_dmalist_drain_f *) pcibr_dmalist_drain, + + (pciio_intr_alloc_f *) pcibr_intr_alloc, + (pciio_intr_free_f *) pcibr_intr_free, + (pciio_intr_connect_f *) pcibr_intr_connect, + (pciio_intr_disconnect_f *) pcibr_intr_disconnect, + (pciio_intr_cpu_get_f *) pcibr_intr_cpu_get, + + (pciio_provider_startup_f *) pcibr_provider_startup, + (pciio_provider_shutdown_f *) pcibr_provider_shutdown, + (pciio_reset_f *) pcibr_reset, + (pciio_write_gather_flush_f *) pcibr_write_gather_flush, + (pciio_endian_set_f *) pcibr_endian_set, + (pciio_priority_set_f *) pcibr_priority_set, + (pciio_config_get_f *) pcibr_config_get, + (pciio_config_set_f *) pcibr_config_set, + + (pciio_error_devenable_f *) 0, + (pciio_error_extract_f *) 0, + +#ifdef LATER + (pciio_driver_reg_callback_f *) pcibr_driver_reg_callback, + (pciio_driver_unreg_callback_f *) pcibr_driver_unreg_callback, +#else + (pciio_driver_reg_callback_f *) 0, + (pciio_driver_unreg_callback_f *) 0, +#endif + (pciio_device_unregister_f *) pcibr_device_unregister, + (pciio_dma_enabled_f *) pcibr_dma_enabled, +}; + +int +pcibr_dma_enabled(devfs_handle_t pconn_vhdl) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + + + return xtalk_dma_enabled(pcibr_soft->bs_conn); +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c --- linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,1737 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __ia64 +#define rmallocmap atemapalloc +#define rmfreemap atemapfree +#define rmfree atefree +#define rmalloc atealloc +#endif + +extern int hubii_check_widget_disabled(nasid_t, int); + +/* ===================================================================== + * ERROR HANDLING + */ + +#ifdef DEBUG +#ifdef ERROR_DEBUG +#define BRIDGE_PIOERR_TIMEOUT 100 /* Timeout with ERROR_DEBUG defined */ +#else +#define BRIDGE_PIOERR_TIMEOUT 40 /* Timeout in debug mode */ +#endif +#else +#define BRIDGE_PIOERR_TIMEOUT 1 /* Timeout in non-debug mode */ +#endif + +#ifdef DEBUG +#ifdef ERROR_DEBUG +bridgereg_t bridge_errors_to_dump = ~BRIDGE_ISR_INT_MSK; +#else +bridgereg_t bridge_errors_to_dump = BRIDGE_ISR_ERROR_DUMP; +#endif +#else +bridgereg_t bridge_errors_to_dump = BRIDGE_ISR_ERROR_FATAL | + BRIDGE_ISR_PCIBUS_PIOERR; +#endif + +#if defined (PCIBR_LLP_CONTROL_WAR) +int pcibr_llp_control_war_cnt; +#endif /* PCIBR_LLP_CONTROL_WAR */ + +/* FIXME: can these arrays be local ? */ + +#ifdef LATER + +struct reg_values xio_cmd_pactyp[] = +{ + {0x0, "RdReq"}, + {0x1, "RdResp"}, + {0x2, "WrReqWithResp"}, + {0x3, "WrResp"}, + {0x4, "WrReqNoResp"}, + {0x5, "Reserved(5)"}, + {0x6, "FetchAndOp"}, + {0x7, "Reserved(7)"}, + {0x8, "StoreAndOp"}, + {0x9, "Reserved(9)"}, + {0xa, "Reserved(a)"}, + {0xb, "Reserved(b)"}, + {0xc, "Reserved(c)"}, + {0xd, "Reserved(d)"}, + {0xe, "SpecialReq"}, + {0xf, "SpecialResp"}, + {0} +}; + +struct reg_desc xio_cmd_bits[] = +{ + {WIDGET_DIDN, -28, "DIDN", "%x"}, + {WIDGET_SIDN, -24, "SIDN", "%x"}, + {WIDGET_PACTYP, -20, "PACTYP", 0, xio_cmd_pactyp}, + {WIDGET_TNUM, -15, "TNUM", "%x"}, + {WIDGET_COHERENT, 0, "COHERENT"}, + {WIDGET_DS, 0, "DS"}, + {WIDGET_GBR, 0, "GBR"}, + {WIDGET_VBPM, 0, "VBPM"}, + {WIDGET_ERROR, 0, "ERROR"}, + {WIDGET_BARRIER, 0, "BARRIER"}, + {0} +}; + +#define F(s,n) { 1l<<(s),-(s), n } + +struct reg_desc bridge_int_status_desc[] = +{ + F(31, "MULTI_ERR"), + F(30, "PMU_ESIZE_EFAULT"), + F(29, "UNEXPECTED_RESP"), + F(28, "BAD_XRESP_PACKET"), + F(27, "BAD_XREQ_PACKET"), + F(26, "RESP_XTALK_ERROR"), + F(25, "REQ_XTALK_ERROR"), + F(24, "INVALID_ADDRESS"), + F(23, "UNSUPPORTED_XOP"), + F(22, "XREQ_FIFO_OFLOW"), + F(21, "LLP_REC_SNERROR"), + F(20, "LLP_REC_CBERROR"), + F(19, "LLP_RCTY"), + F(18, "LLP_TX_RETRY"), + F(17, "LLP_TCTY"), + F(16, "SSRAM_PERR"), + F(15, "PCI_ABORT"), + F(14, "PCI_PARITY"), + F(13, "PCI_SERR"), + F(12, "PCI_PERR"), + F(11, "PCI_MASTER_TOUT"), + F(10, "PCI_RETRY_CNT"), + F(9, "XREAD_REQ_TOUT"), + F(8, "GIO_BENABLE_ERR"), + F(7, "INT7"), + F(6, "INT6"), + F(5, "INT5"), + F(4, "INT4"), + F(3, "INT3"), + F(2, "INT2"), + F(1, "INT1"), + F(0, "INT0"), + {0} +}; + +struct reg_values space_v[] = +{ + {PCIIO_SPACE_NONE, "none"}, + {PCIIO_SPACE_ROM, "ROM"}, + {PCIIO_SPACE_IO, "I/O"}, + {PCIIO_SPACE_MEM, "MEM"}, + {PCIIO_SPACE_MEM32, "MEM(32)"}, + {PCIIO_SPACE_MEM64, "MEM(64)"}, + {PCIIO_SPACE_CFG, "CFG"}, + {PCIIO_SPACE_WIN(0), "WIN(0)"}, + {PCIIO_SPACE_WIN(1), "WIN(1)"}, + {PCIIO_SPACE_WIN(2), "WIN(2)"}, + {PCIIO_SPACE_WIN(3), "WIN(3)"}, + {PCIIO_SPACE_WIN(4), "WIN(4)"}, + {PCIIO_SPACE_WIN(5), "WIN(5)"}, + {PCIIO_SPACE_BAD, "BAD"}, + {0} +}; +struct reg_desc space_desc[] = +{ + {0xFF, 0, "space", 0, space_v}, + {0} +}; +#define device_desc device_bits +struct reg_desc device_bits[] = +{ + {BRIDGE_DEV_ERR_LOCK_EN, 0, "ERR_LOCK_EN"}, + {BRIDGE_DEV_PAGE_CHK_DIS, 0, "PAGE_CHK_DIS"}, + {BRIDGE_DEV_FORCE_PCI_PAR, 0, "FORCE_PCI_PAR"}, + {BRIDGE_DEV_VIRTUAL_EN, 0, "VIRTUAL_EN"}, + {BRIDGE_DEV_PMU_WRGA_EN, 0, "PMU_WRGA_EN"}, + {BRIDGE_DEV_DIR_WRGA_EN, 0, "DIR_WRGA_EN"}, + {BRIDGE_DEV_DEV_SIZE, 0, "DEV_SIZE"}, + {BRIDGE_DEV_RT, 0, "RT"}, + {BRIDGE_DEV_SWAP_PMU, 0, "SWAP_PMU"}, + {BRIDGE_DEV_SWAP_DIR, 0, "SWAP_DIR"}, + {BRIDGE_DEV_PREF, 0, "PREF"}, + {BRIDGE_DEV_PRECISE, 0, "PRECISE"}, + {BRIDGE_DEV_COH, 0, "COH"}, + {BRIDGE_DEV_BARRIER, 0, "BARRIER"}, + {BRIDGE_DEV_GBR, 0, "GBR"}, + {BRIDGE_DEV_DEV_SWAP, 0, "DEV_SWAP"}, + {BRIDGE_DEV_DEV_IO_MEM, 0, "DEV_IO_MEM"}, + {BRIDGE_DEV_OFF_MASK, BRIDGE_DEV_OFF_ADDR_SHFT, "DEV_OFF", "%x"}, + {0} +}; + +#endif /* LATER */ + +void +print_bridge_errcmd(uint32_t cmdword, char *errtype) +{ + printk( + "\t Bridge %s Error Command Word Register %R\n", + errtype, cmdword, xio_cmd_bits); +} + +char *pcibr_isr_errs[] = +{ + "", "", "", "", "", "", "", "", + "08: GIO non-contiguous byte enable in crosstalk packet", + "09: PCI to Crosstalk read request timeout", + "10: PCI retry operation count exhausted.", + "11: PCI bus device select timeout", + "12: PCI device reported parity error", + "13: PCI Address/Cmd parity error ", + "14: PCI Bridge detected parity error", + "15: PCI abort condition", + "16: SSRAM parity error", + "17: LLP Transmitter Retry count wrapped", + "18: LLP Transmitter side required Retry", + "19: LLP Receiver retry count wrapped", + "20: LLP Receiver check bit error", + "21: LLP Receiver sequence number error", + "22: Request packet overflow", + "23: Request operation not supported by bridge", + "24: Request packet has invalid address for bridge widget", + "25: Incoming request xtalk command word error bit set or invalid sideband", + "26: Incoming response xtalk command word error bit set or invalid sideband", + "27: Framing error, request cmd data size does not match actual", + "28: Framing error, response cmd data size does not match actual", + "29: Unexpected response arrived", + "30: PMU Access Fault", + "31: Multiple errors occurred", +}; + +#define BEM_ADD_STR(s) printk("%s", (s)) +#define BEM_ADD_VAR(v) printk("\t%20s: 0x%x\n", #v, (v)) +#define BEM_ADD_REG(r) printk("\t%20s: %R\n", #r, (r), r ## _desc) +#define BEM_ADD_NSPC(n,s) printk("\t%20s: %R\n", n, s, space_desc) +#define BEM_ADD_SPC(s) BEM_ADD_NSPC(#s, s) + +/* + * display memory directory state + */ +void +pcibr_show_dir_state(paddr_t paddr, char *prefix) +{ + int state; + uint64_t vec_ptr; + hubreg_t elo; + extern char *dir_state_str[]; + extern void get_dir_ent(paddr_t, int *, uint64_t *, hubreg_t *); + + get_dir_ent(paddr, &state, &vec_ptr, &elo); + + printf("%saddr 0x%x: state 0x%x owner 0x%x (%s)\n", + prefix, paddr, state, vec_ptr, dir_state_str[state]); +} + + +/* + * Dump relevant error information for Bridge error interrupts. + */ +/*ARGSUSED */ +void +pcibr_error_dump(pcibr_soft_t pcibr_soft) +{ + bridge_t *bridge = pcibr_soft->bs_base; + bridgereg_t int_status; + bridgereg_t mult_int; + int bit; + int i; + char *reg_desc; + paddr_t addr; + + int_status = (bridge->b_int_status & ~BRIDGE_ISR_INT_MSK); + if (!int_status) { + /* No error bits set */ + return; + } + + /* Check if dumping the same error information multiple times */ + if (test_and_set_int((int *) &pcibr_soft->bs_errinfo.bserr_intstat, + int_status) == int_status) { + return; + } + + printk(KERN_ALERT "PCI BRIDGE ERROR: int_status is 0x%X for %s\n" + " Dumping relevant %sBridge registers for each bit set...\n", + int_status, pcibr_soft->bs_name, + (is_xbridge(bridge) ? "X" : "")); + + for (i = PCIBR_ISR_ERR_START; i < PCIBR_ISR_MAX_ERRS; i++) { + bit = 1 << i; + + /* + * A number of int_status bits are only defined for Bridge. + * Ignore them in the case of an XBridge. + */ + if (is_xbridge(bridge) && ((bit == BRIDGE_ISR_MULTI_ERR) || + (bit == BRIDGE_ISR_SSRAM_PERR) || + (bit == BRIDGE_ISR_GIO_B_ENBL_ERR))) { + continue; + } + + if (int_status & bit) { + printk("\t%s\n", pcibr_isr_errs[i]); + + switch (bit) { + case BRIDGE_ISR_PAGE_FAULT: /* PMU_PAGE_FAULT (XBridge) */ +/* case BRIDGE_ISR_PMU_ESIZE_FAULT: PMU_ESIZE_FAULT (Bridge) */ + if (is_xbridge(bridge)) + reg_desc = "Map Fault Address"; + else + reg_desc = "SSRAM Parity Error"; + + printk("\t %s Register: 0x%x\n", reg_desc, + bridge->b_ram_perr_or_map_fault); + break; + + case BRIDGE_ISR_UNEXP_RESP: /* UNEXPECTED_RESP */ + print_bridge_errcmd(bridge->b_wid_aux_err, "Aux"); + break; + + case BRIDGE_ISR_BAD_XRESP_PKT: /* BAD_RESP_PACKET */ + case BRIDGE_ISR_RESP_XTLK_ERR: /* RESP_XTALK_ERROR */ + case BRIDGE_ISR_XREAD_REQ_TIMEOUT: /* XREAD_REQ_TOUT */ + + addr = (((uint64_t) (bridge->b_wid_resp_upper & 0xFFFF) << 32) + | bridge->b_wid_resp_lower); + printk( + "\t Bridge Response Buffer Error Upper Address Register: 0x%x\n" + "\t Bridge Response Buffer Error Lower Address Register: 0x%x\n" + "\t dev-num %d buff-num %d addr 0x%x\n", + bridge->b_wid_resp_upper, bridge->b_wid_resp_lower, + ((bridge->b_wid_resp_upper >> 20) & 0x3), + ((bridge->b_wid_resp_upper >> 16) & 0xF), + addr); + if (bit == BRIDGE_ISR_RESP_XTLK_ERR) { + /* display memory directory associated with cacheline */ + pcibr_show_dir_state(addr, "\t "); + } + break; + + case BRIDGE_ISR_BAD_XREQ_PKT: /* BAD_XREQ_PACKET */ + case BRIDGE_ISR_REQ_XTLK_ERR: /* REQ_XTALK_ERROR */ + case BRIDGE_ISR_INVLD_ADDR: /* INVALID_ADDRESS */ + case BRIDGE_ISR_UNSUPPORTED_XOP: /* UNSUPPORTED_XOP */ + print_bridge_errcmd(bridge->b_wid_aux_err, ""); + printk("\t Bridge Error Upper Address Register: 0x%x\n" + "\t Bridge Error Lower Address Register: 0x%x\n" + "\t Bridge Error Address: 0x%x\n", + (uint64_t) bridge->b_wid_err_upper, + (uint64_t) bridge->b_wid_err_lower, + (((uint64_t) bridge->b_wid_err_upper << 32) | + bridge->b_wid_err_lower)); + break; + + case BRIDGE_ISR_SSRAM_PERR: /* SSRAM_PERR */ + if (!is_xbridge(bridge)) { /* only defined on Bridge */ + printk( + "\t Bridge SSRAM Parity Error Register: 0x%x\n", + bridge->b_ram_perr); + } + break; + + case BRIDGE_ISR_PCI_ABORT: /* PCI_ABORT */ + case BRIDGE_ISR_PCI_PARITY: /* PCI_PARITY */ + case BRIDGE_ISR_PCI_SERR: /* PCI_SERR */ + case BRIDGE_ISR_PCI_PERR: /* PCI_PERR */ + case BRIDGE_ISR_PCI_MST_TIMEOUT: /* PCI_MASTER_TOUT */ + case BRIDGE_ISR_PCI_RETRY_CNT: /* PCI_RETRY_CNT */ + case BRIDGE_ISR_GIO_B_ENBL_ERR: /* GIO BENABLE_ERR */ + printk("\t PCI Error Upper Address Register: 0x%x\n" + "\t PCI Error Lower Address Register: 0x%x\n" + "\t PCI Error Address: 0x%x\n", + (uint64_t) bridge->b_pci_err_upper, + (uint64_t) bridge->b_pci_err_lower, + (((uint64_t) bridge->b_pci_err_upper << 32) | + bridge->b_pci_err_lower)); + break; + } + } + } + + if (is_xbridge(bridge) && (bridge->b_mult_int & ~BRIDGE_ISR_INT_MSK)) { + mult_int = bridge->b_mult_int; + printk(" XBridge Multiple Interrupt Register is 0x%x\n", + mult_int); + for (i = PCIBR_ISR_ERR_START; i < PCIBR_ISR_MAX_ERRS; i++) { + if (mult_int & (1 << i)) + printk("\t%s\n", pcibr_isr_errs[i]); + } + } +} + +#define PCIBR_ERRINTR_GROUP(error) \ + (( error & (BRIDGE_IRR_PCI_GRP|BRIDGE_IRR_GIO_GRP) + +uint32_t +pcibr_errintr_group(uint32_t error) +{ + uint32_t group = BRIDGE_IRR_MULTI_CLR; + + if (error & BRIDGE_IRR_PCI_GRP) + group |= BRIDGE_IRR_PCI_GRP_CLR; + if (error & BRIDGE_IRR_SSRAM_GRP) + group |= BRIDGE_IRR_SSRAM_GRP_CLR; + if (error & BRIDGE_IRR_LLP_GRP) + group |= BRIDGE_IRR_LLP_GRP_CLR; + if (error & BRIDGE_IRR_REQ_DSP_GRP) + group |= BRIDGE_IRR_REQ_DSP_GRP_CLR; + if (error & BRIDGE_IRR_RESP_BUF_GRP) + group |= BRIDGE_IRR_RESP_BUF_GRP_CLR; + if (error & BRIDGE_IRR_CRP_GRP) + group |= BRIDGE_IRR_CRP_GRP_CLR; + + return group; + +} + + +/* pcibr_pioerr_check(): + * Check to see if this pcibr has a PCI PIO + * TIMEOUT error; if so, bump the timeout-count + * on any piomaps that could cover the address. + */ +static void +pcibr_pioerr_check(pcibr_soft_t soft) +{ + bridge_t *bridge; + bridgereg_t b_int_status; + bridgereg_t b_pci_err_lower; + bridgereg_t b_pci_err_upper; + iopaddr_t pci_addr; + pciio_slot_t slot; + pcibr_piomap_t map; + iopaddr_t base; + size_t size; + unsigned win; + int func; + + bridge = soft->bs_base; + b_int_status = bridge->b_int_status; + if (b_int_status & BRIDGE_ISR_PCIBUS_PIOERR) { + b_pci_err_lower = bridge->b_pci_err_lower; + b_pci_err_upper = bridge->b_pci_err_upper; + b_int_status = bridge->b_int_status; + if (b_int_status & BRIDGE_ISR_PCIBUS_PIOERR) { + + pci_addr = b_pci_err_upper & BRIDGE_ERRUPPR_ADDRMASK; + pci_addr = (pci_addr << 32) | b_pci_err_lower; + + slot = 8; + while (slot-- > 0) { + int nfunc = soft->bs_slot[slot].bss_ninfo; + pcibr_info_h pcibr_infoh = soft->bs_slot[slot].bss_infos; + + for (func = 0; func < nfunc; func++) { + pcibr_info_t pcibr_info = pcibr_infoh[func]; + + if (!pcibr_info) + continue; + + for (map = pcibr_info->f_piomap; + map != NULL; map = map->bp_next) { + base = map->bp_pciaddr; + size = map->bp_mapsz; + win = map->bp_space - PCIIO_SPACE_WIN(0); + if (win < 6) + base += + soft->bs_slot[slot].bss_window[win].bssw_base; + else if (map->bp_space == PCIIO_SPACE_ROM) + base += pcibr_info->f_rbase; + if ((pci_addr >= base) && (pci_addr < (base + size))) + atomicAddInt(map->bp_toc, 1); + } + } + } + } + } +} + +/* + * PCI Bridge Error interrupt handler. + * This gets invoked, whenever a PCI bridge sends an error interrupt. + * Primarily this servers two purposes. + * - If an error can be handled (typically a PIO read/write + * error, we try to do it silently. + * - If an error cannot be handled, we die violently. + * Interrupt due to PIO errors: + * - Bridge sends an interrupt, whenever a PCI operation + * done by the bridge as the master fails. Operations could + * be either a PIO read or a PIO write. + * PIO Read operation also triggers a bus error, and it's + * We primarily ignore this interrupt in that context.. + * For PIO write errors, this is the only indication. + * and we have to handle with the info from here. + * + * So, there is no way to distinguish if an interrupt is + * due to read or write error!. + */ + + +void +pcibr_error_intr_handler(intr_arg_t arg) +{ + pcibr_soft_t pcibr_soft; + bridge_t *bridge; + bridgereg_t int_status; + bridgereg_t err_status; + int i; + + /* REFERENCED */ + bridgereg_t disable_errintr_mask = 0; + int rv; + int error_code = IOECODE_DMA | IOECODE_READ; + ioerror_mode_t mode = MODE_DEVERROR; + ioerror_t ioe; + nasid_t nasid; + +#if PCIBR_SOFT_LIST + { + extern pcibr_list_p pcibr_list; + pcibr_list_p entry; + + entry = pcibr_list; + while (1) { + if (entry == NULL) { + PRINT_PANIC( + "pcibr_error_intr_handler:\n" + "\tmy parameter (0x%x) is not a pcibr_soft!", + arg); + } + if ((intr_arg_t) entry->bl_soft == arg) + break; + entry = entry->bl_next; + } + } +#endif + pcibr_soft = (pcibr_soft_t) arg; + bridge = pcibr_soft->bs_base; + + /* + * pcibr_error_intr_handler gets invoked whenever bridge encounters + * an error situation, and the interrupt for that error is enabled. + * This routine decides if the error is fatal or not, and takes + * action accordingly. + * + * In the case of PIO read/write timeouts, there is no way + * to know if it was a read or write request that timed out. + * If the error was due to a "read", a bus error will also occur + * and the bus error handling code takes care of it. + * If the error is due to a "write", the error is currently logged + * by this routine. For SN1 and SN0, if fire-and-forget mode is + * disabled, a write error response xtalk packet will be sent to + * the II, which will cause an II error interrupt. No write error + * recovery actions of any kind currently take place at the pcibr + * layer! (e.g., no panic on unrecovered write error) + * + * Prior to reading the Bridge int_status register we need to ensure + * that there are no error bits set in the lower layers (hubii) + * that have disabled PIO access to the widget. If so, there is nothing + * we can do until the bits clear, so we setup a timeout and try again + * later. + */ + + nasid = NASID_GET(bridge); + if (hubii_check_widget_disabled(nasid, pcibr_soft->bs_xid)) { + timeout(pcibr_error_intr_handler, pcibr_soft, BRIDGE_PIOERR_TIMEOUT); + pcibr_soft->bs_errinfo.bserr_toutcnt++; + return; + } + + /* int_status is which bits we have to clear; + * err_status is the bits we haven't handled yet. + */ + + int_status = bridge->b_int_status & ~BRIDGE_ISR_INT_MSK; + err_status = int_status & ~BRIDGE_ISR_MULTI_ERR; + + if (!(int_status & ~BRIDGE_ISR_INT_MSK)) { + /* + * No error bit set!!. + */ + return; + } + /* + * If we have a PCIBUS_PIOERR, hand it to the logger. + */ + if (int_status & BRIDGE_ISR_PCIBUS_PIOERR) { + pcibr_pioerr_check(pcibr_soft); + } + + if (err_status) { + struct bs_errintr_stat_s *bs_estat = pcibr_soft->bs_errintr_stat; + + for (i = PCIBR_ISR_ERR_START; i < PCIBR_ISR_MAX_ERRS; i++, bs_estat++) { + if (err_status & (1 << i)) { + uint32_t errrate = 0; + uint32_t errcount = 0; + uint32_t errinterval = 0, current_tick = 0; + int llp_tx_retry_errors = 0; + int is_llp_tx_retry_intr = 0; + + bs_estat->bs_errcount_total++; + + current_tick = lbolt; + errinterval = (current_tick - bs_estat->bs_lasterr_timestamp); + errcount = (bs_estat->bs_errcount_total - + bs_estat->bs_lasterr_snapshot); + + is_llp_tx_retry_intr = (BRIDGE_ISR_LLP_TX_RETRY == (1 << i)); + + /* Check for the divide by zero condition while + * calculating the error rates. + */ + + if (errinterval) { + errrate = errcount / errinterval; + /* If able to calculate error rate + * on a LLP transmitter retry interrupt, check + * if the error rate is nonzero and we have seen + * a certain minimum number of errors. + * + * NOTE : errcount is being compared to + * PCIBR_ERRTIME_THRESHOLD to make sure that we are not + * seeing cases like x error interrupts per y ticks for + * very low x ,y (x > y ) which could result in a + * rate > 100/tick. + */ + if (is_llp_tx_retry_intr && + errrate && + (errcount >= PCIBR_ERRTIME_THRESHOLD)) { + llp_tx_retry_errors = 1; + } + } else { + errrate = 0; + /* Since we are not able to calculate the + * error rate check if we exceeded a certain + * minimum number of errors for LLP transmitter + * retries. Note that this can only happen + * within the first tick after the last snapshot. + */ + if (is_llp_tx_retry_intr && + (errcount >= PCIBR_ERRINTR_DISABLE_LEVEL)) { + llp_tx_retry_errors = 1; + } + } + + /* + * If a non-zero error rate (which is equivalent to + * to 100 errors/tick at least) for the LLP transmitter + * retry interrupt was seen, check if we should print + * a warning message. + */ + + if (llp_tx_retry_errors) { + static uint32_t last_printed_rate; + + if (errrate > last_printed_rate) { + last_printed_rate = errrate; + /* Print the warning only if the error rate + * for the transmitter retry interrupt + * exceeded the previously printed rate. + */ + printk(KERN_WARNING + "%s: %s, Excessive error interrupts : %d/tick\n", + pcibr_soft->bs_name, + pcibr_isr_errs[i], + errrate); + + } + /* + * Update snapshot, and time + */ + bs_estat->bs_lasterr_timestamp = current_tick; + bs_estat->bs_lasterr_snapshot = + bs_estat->bs_errcount_total; + + } + /* + * If the error rate is high enough, print the error rate. + */ + if (errinterval > PCIBR_ERRTIME_THRESHOLD) { + + if (errrate > PCIBR_ERRRATE_THRESHOLD) { + printk(KERN_NOTICE "%s: %s, Error rate %d/tick", + pcibr_soft->bs_name, + pcibr_isr_errs[i], + errrate); + /* + * Update snapshot, and time + */ + bs_estat->bs_lasterr_timestamp = current_tick; + bs_estat->bs_lasterr_snapshot = + bs_estat->bs_errcount_total; + } + } + if (bs_estat->bs_errcount_total > PCIBR_ERRINTR_DISABLE_LEVEL) { + /* + * We have seen a fairly large number of errors of + * this type. Let's disable the interrupt. But flash + * a message about the interrupt being disabled. + */ + printk(KERN_NOTICE + "%s Disabling error interrupt type %s. Error count %d", + pcibr_soft->bs_name, + pcibr_isr_errs[i], + bs_estat->bs_errcount_total); + disable_errintr_mask |= (1 << i); + } + } + } + } + + if (disable_errintr_mask) { + /* + * Disable some high frequency errors as they + * could eat up too much cpu time. + */ + bridge->b_int_enable &= ~disable_errintr_mask; + } + /* + * If we leave the PROM cacheable, T5 might + * try to do a cache line sized writeback to it, + * which will cause a BRIDGE_ISR_INVLD_ADDR. + */ + if ((err_status & BRIDGE_ISR_INVLD_ADDR) && + (0x00000000 == bridge->b_wid_err_upper) && + (0x00C00000 == (0xFFC00000 & bridge->b_wid_err_lower)) && + (0x00402000 == (0x00F07F00 & bridge->b_wid_err_cmdword))) { + err_status &= ~BRIDGE_ISR_INVLD_ADDR; + } +#if defined (PCIBR_LLP_CONTROL_WAR) + /* + * The bridge bug, where the llp_config or control registers + * need to be read back after being written, affects an MP + * system since there could be small windows between writing + * the register and reading it back on one cpu while another + * cpu is fielding an interrupt. If we run into this scenario, + * workaround the problem by ignoring the error. (bug 454474) + * pcibr_llp_control_war_cnt keeps an approximate number of + * times we saw this problem on a system. + */ + + if ((err_status & BRIDGE_ISR_INVLD_ADDR) && + ((((uint64_t) bridge->b_wid_err_upper << 32) | (bridge->b_wid_err_lower)) + == (BRIDGE_INT_RST_STAT & 0xff0))) { +#if 0 + if (kdebug) + printk(KERN_NOTICE "%s bridge: ignoring llp/control address interrupt", + pcibr_soft->bs_name); +#endif + pcibr_llp_control_war_cnt++; + err_status &= ~BRIDGE_ISR_INVLD_ADDR; + } +#endif /* PCIBR_LLP_CONTROL_WAR */ + +#ifdef EHE_ENABLE + /* Check if this is the RESP_XTALK_ERROR interrupt. + * This can happen due to a failed DMA READ operation. + */ + if (err_status & BRIDGE_ISR_RESP_XTLK_ERR) { + /* Phase 1 : Look at the error state in the bridge and further + * down in the device layers. + */ + (void)error_state_set(pcibr_soft->bs_conn, ERROR_STATE_LOOKUP); + IOERROR_SETVALUE(&ioe, widgetnum, pcibr_soft->bs_xid); + (void)pcibr_error_handler((error_handler_arg_t)pcibr_soft, + error_code, + mode, + &ioe); + /* Phase 2 : Perform the action agreed upon in phase 1. + */ + (void)error_state_set(pcibr_soft->bs_conn, ERROR_STATE_ACTION); + rv = pcibr_error_handler((error_handler_arg_t)pcibr_soft, + error_code, + mode, + &ioe); + } + if (rv != IOERROR_HANDLED) { +#endif /* EHE_ENABLE */ + + /* Dump/Log Bridge error interrupt info */ + if (err_status & bridge_errors_to_dump) { + printk("BRIDGE ERR_STATUS 0x%x\n", err_status); + pcibr_error_dump(pcibr_soft); + } + + if (err_status & BRIDGE_ISR_ERROR_FATAL) { + machine_error_dump(""); + cmn_err_tag(14, CE_PANIC, "PCI Bridge Error interrupt killed the system"); + /*NOTREACHED */ + } + +#ifdef EHE_ENABLE + } +#endif + + /* + * We can't return without re-enabling the interrupt, since + * it would cause problems for devices like IOC3 (Lost + * interrupts ?.). So, just cleanup the interrupt, and + * use saved values later.. + */ + bridge->b_int_rst_stat = pcibr_errintr_group(int_status); + + /* Zero out bserr_intstat field */ + test_and_set_int((int *) &pcibr_soft->bs_errinfo.bserr_intstat, 0); +} + +/* + * pcibr_addr_toslot + * Given the 'pciaddr' find out which slot this address is + * allocated to, and return the slot number. + * While we have the info handy, construct the + * function number, space code and offset as well. + * + * NOTE: if this routine is called, we don't know whether + * the address is in CFG, MEM, or I/O space. We have to guess. + * This will be the case on PIO stores, where the only way + * we have of getting the address is to check the Bridge, which + * stores the PCI address but not the space and not the xtalk + * address (from which we could get it). + */ +int +pcibr_addr_toslot(pcibr_soft_t pcibr_soft, + iopaddr_t pciaddr, + pciio_space_t *spacep, + iopaddr_t *offsetp, + pciio_function_t *funcp) +{ + int s, f, w; + iopaddr_t base; + size_t size; + pciio_piospace_t piosp; + + /* + * Check if the address is in config space + */ + + if ((pciaddr >= BRIDGE_CONFIG_BASE) && (pciaddr < BRIDGE_CONFIG_END)) { + + if (pciaddr >= BRIDGE_CONFIG1_BASE) + pciaddr -= BRIDGE_CONFIG1_BASE; + else + pciaddr -= BRIDGE_CONFIG_BASE; + + s = pciaddr / BRIDGE_CONFIG_SLOT_SIZE; + pciaddr %= BRIDGE_CONFIG_SLOT_SIZE; + + if (funcp) { + f = pciaddr / 0x100; + pciaddr %= 0x100; + } + if (spacep) + *spacep = PCIIO_SPACE_CFG; + if (offsetp) + *offsetp = pciaddr; + if (funcp) + *funcp = f; + + return s; + } + for (s = 0; s < 8; s++) { + int nf = pcibr_soft->bs_slot[s].bss_ninfo; + pcibr_info_h pcibr_infoh = pcibr_soft->bs_slot[s].bss_infos; + + for (f = 0; f < nf; f++) { + pcibr_info_t pcibr_info = pcibr_infoh[f]; + + if (!pcibr_info) + continue; + for (w = 0; w < 6; w++) { + if (pcibr_info->f_window[w].w_space + == PCIIO_SPACE_NONE) { + continue; + } + base = pcibr_info->f_window[w].w_base; + size = pcibr_info->f_window[w].w_size; + + if ((pciaddr >= base) && (pciaddr < (base + size))) { + if (spacep) + *spacep = PCIIO_SPACE_WIN(w); + if (offsetp) + *offsetp = pciaddr - base; + if (funcp) + *funcp = f; + return s; + } /* endif match */ + } /* next window */ + } /* next func */ + } /* next slot */ + + /* + * Check if the address was allocated as part of the + * pcibr_piospace_alloc calls. + */ + for (s = 0; s < 8; s++) { + int nf = pcibr_soft->bs_slot[s].bss_ninfo; + pcibr_info_h pcibr_infoh = pcibr_soft->bs_slot[s].bss_infos; + + for (f = 0; f < nf; f++) { + pcibr_info_t pcibr_info = pcibr_infoh[f]; + + if (!pcibr_info) + continue; + piosp = pcibr_info->f_piospace; + while (piosp) { + if ((piosp->start <= pciaddr) && + ((piosp->count + piosp->start) > pciaddr)) { + if (spacep) + *spacep = piosp->space; + if (offsetp) + *offsetp = pciaddr - piosp->start; + return s; + } /* endif match */ + piosp = piosp->next; + } /* next piosp */ + } /* next func */ + } /* next slot */ + + /* + * Some other random address on the PCI bus ... + * we have no way of knowing whether this was + * a MEM or I/O access; so, for now, we just + * assume that the low 1G is MEM, the next + * 3G is I/O, and anything above the 4G limit + * is obviously MEM. + */ + + if (spacep) + *spacep = ((pciaddr < (1ul << 30)) ? PCIIO_SPACE_MEM : + (pciaddr < (4ul << 30)) ? PCIIO_SPACE_IO : + PCIIO_SPACE_MEM); + if (offsetp) + *offsetp = pciaddr; + + return PCIIO_SLOT_NONE; + +} + +void +pcibr_error_cleanup(pcibr_soft_t pcibr_soft, int error_code) +{ + bridge_t *bridge = pcibr_soft->bs_base; + + ASSERT(error_code & IOECODE_PIO); + error_code = error_code; + + bridge->b_int_rst_stat = + (BRIDGE_IRR_PCI_GRP_CLR | BRIDGE_IRR_MULTI_CLR); + (void) bridge->b_wid_tflush; /* flushbus */ +} + +/* + * pcibr_error_extract + * Given the 'pcibr vertex handle' find out which slot + * the bridge status error address (from pcibr_soft info + * hanging off the vertex) + * allocated to, and return the slot number. + * While we have the info handy, construct the + * space code and offset as well. + * + * NOTE: if this routine is called, we don't know whether + * the address is in CFG, MEM, or I/O space. We have to guess. + * This will be the case on PIO stores, where the only way + * we have of getting the address is to check the Bridge, which + * stores the PCI address but not the space and not the xtalk + * address (from which we could get it). + * + * XXX- this interface has no way to return the function + * number on a multifunction card, even though that data + * is available. + */ + +pciio_slot_t +pcibr_error_extract(devfs_handle_t pcibr_vhdl, + pciio_space_t *spacep, + iopaddr_t *offsetp) +{ + pcibr_soft_t pcibr_soft = 0; + iopaddr_t bserr_addr; + bridge_t *bridge; + pciio_slot_t slot = PCIIO_SLOT_NONE; + arbitrary_info_t rev; + + /* Do a sanity check as to whether we really got a + * bridge vertex handle. + */ + if (hwgraph_info_get_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, &rev) != + GRAPH_SUCCESS) + return(slot); + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + if (pcibr_soft) { + bridge = pcibr_soft->bs_base; + bserr_addr = + bridge->b_pci_err_lower | + ((uint64_t) (bridge->b_pci_err_upper & + BRIDGE_ERRUPPR_ADDRMASK) << 32); + + slot = pcibr_addr_toslot(pcibr_soft, bserr_addr, + spacep, offsetp, NULL); + } + return slot; +} + +/*ARGSUSED */ +void +pcibr_device_disable(pcibr_soft_t pcibr_soft, int devnum) +{ + /* + * XXX + * Device failed to handle error. Take steps to + * disable this device ? HOW TO DO IT ? + * + * If there are any Read response buffers associated + * with this device, it's time to get them back!! + * + * We can disassociate any interrupt level associated + * with this device, and disable that interrupt level + * + * For now it's just a place holder + */ +} + +/* + * pcibr_pioerror + * Handle PIO error that happened at the bridge pointed by pcibr_soft. + * + * Queries the Bus interface attached to see if the device driver + * mapping the device-number that caused error can handle the + * situation. If so, it will clean up any error, and return + * indicating the error was handled. If the device driver is unable + * to handle the error, it expects the bus-interface to disable that + * device, and takes any steps needed here to take away any resources + * associated with this device. + */ + +#define BEM_ADD_STR(s) printk("%s", (s)) +#define BEM_ADD_VAR(v) printk("\t%20s: 0x%x\n", #v, (v)) +#define BEM_ADD_REG(r) printk("\t%20s: %R\n", #r, (r), r ## _desc) + +#define BEM_ADD_NSPC(n,s) printk("\t%20s: %R\n", n, s, space_desc) +#define BEM_ADD_SPC(s) BEM_ADD_NSPC(#s, s) + +/* BEM_ADD_IOE doesn't dump the whole ioerror, it just + * decodes the PCI specific portions -- we count on our + * callers to dump the raw IOE data. + */ +#define BEM_ADD_IOE(ioe) \ + do { \ + if (IOERROR_FIELDVALID(ioe, busspace)) { \ + unsigned spc; \ + unsigned win; \ + \ + spc = IOERROR_GETVALUE(ioe, busspace); \ + win = spc - PCIIO_SPACE_WIN(0); \ + \ + switch (spc) { \ + case PCIIO_SPACE_CFG: \ + printk( \ + "\tPCI Slot %d Func %d CFG space Offset 0x%x\n", \ + pciio_widgetdev_slot_get(IOERROR_GETVALUE(ioe, widgetdev)), \ + pciio_widgetdev_func_get(IOERROR_GETVALUE(ioe, widgetdev)), \ + IOERROR_GETVALUE(ioe, busaddr)); \ + break; \ + case PCIIO_SPACE_IO: \ + printk( \ + "\tPCI I/O space Offset 0x%x\n", \ + IOERROR_GETVALUE(ioe, busaddr)); \ + break; \ + case PCIIO_SPACE_MEM: \ + case PCIIO_SPACE_MEM32: \ + case PCIIO_SPACE_MEM64: \ + printk( \ + "\tPCI MEM space Offset 0x%x\n", \ + IOERROR_GETVALUE(ioe, busaddr)); \ + break; \ + default: \ + if (win < 6) { \ + printk( \ + "\tPCI Slot %d Func %d Window %d Offset 0x%x\n",\ + pciio_widgetdev_slot_get(IOERROR_GETVALUE(ioe, widgetdev)), \ + pciio_widgetdev_func_get(IOERROR_GETVALUE(ioe, widgetdev)), \ + win, \ + IOERROR_GETVALUE(ioe, busaddr)); \ + } \ + break; \ + } \ + } \ + } while (0) + +/*ARGSUSED */ +int +pcibr_pioerror( + pcibr_soft_t pcibr_soft, + int error_code, + ioerror_mode_t mode, + ioerror_t *ioe) +{ + int retval = IOERROR_HANDLED; + + devfs_handle_t pcibr_vhdl = pcibr_soft->bs_vhdl; + bridge_t *bridge = pcibr_soft->bs_base; + + iopaddr_t bad_xaddr; + + pciio_space_t raw_space; /* raw PCI space */ + iopaddr_t raw_paddr; /* raw PCI address */ + + pciio_space_t space; /* final PCI space */ + pciio_slot_t slot; /* final PCI slot, if appropriate */ + pciio_function_t func; /* final PCI func, if appropriate */ + iopaddr_t offset; /* final PCI offset */ + + int cs, cw, cf; + pciio_space_t wx; + iopaddr_t wb; + size_t ws; + iopaddr_t wl; + + + /* + * We expect to have an "xtalkaddr" coming in, + * and need to construct the slot/space/offset. + */ + + bad_xaddr = IOERROR_GETVALUE(ioe, xtalkaddr); + + slot = PCIIO_SLOT_NONE; + func = PCIIO_FUNC_NONE; + raw_space = PCIIO_SPACE_NONE; + raw_paddr = 0; + + if ((bad_xaddr >= BRIDGE_TYPE0_CFG_DEV0) && + (bad_xaddr < BRIDGE_TYPE1_CFG)) { + raw_paddr = bad_xaddr - BRIDGE_TYPE0_CFG_DEV0; + slot = raw_paddr / BRIDGE_TYPE0_CFG_SLOT_OFF; + raw_paddr = raw_paddr % BRIDGE_TYPE0_CFG_SLOT_OFF; + raw_space = PCIIO_SPACE_CFG; + } + if ((bad_xaddr >= BRIDGE_TYPE1_CFG) && + (bad_xaddr < (BRIDGE_TYPE1_CFG + 0x1000))) { + /* Type 1 config space: + * slot and function numbers not known. + * Perhaps we can read them back? + */ + raw_paddr = bad_xaddr - BRIDGE_TYPE1_CFG; + raw_space = PCIIO_SPACE_CFG; + } + if ((bad_xaddr >= BRIDGE_DEVIO0) && + (bad_xaddr < BRIDGE_DEVIO(BRIDGE_DEV_CNT))) { + int x; + + raw_paddr = bad_xaddr - BRIDGE_DEVIO0; + x = raw_paddr / BRIDGE_DEVIO_OFF; + raw_paddr %= BRIDGE_DEVIO_OFF; + /* first two devio windows are double-sized */ + if ((x == 1) || (x == 3)) + raw_paddr += BRIDGE_DEVIO_OFF; + if (x > 0) + x--; + if (x > 1) + x--; + /* x is which devio reg; no guarantee + * PCI slot x will be responding. + * still need to figure out who decodes + * space/offset on the bus. + */ + raw_space = pcibr_soft->bs_slot[x].bss_devio.bssd_space; + if (raw_space == PCIIO_SPACE_NONE) { + /* Someone got an error because they + * accessed the PCI bus via a DevIO(x) + * window that pcibr has not yet assigned + * to any specific PCI address. It is + * quite possible that the Device(x) + * register has been changed since they + * made their access, but we will give it + * our best decode shot. + */ + raw_space = pcibr_soft->bs_slot[x].bss_device + & BRIDGE_DEV_DEV_IO_MEM + ? PCIIO_SPACE_MEM + : PCIIO_SPACE_IO; + raw_paddr += + (pcibr_soft->bs_slot[x].bss_device & + BRIDGE_DEV_OFF_MASK) << + BRIDGE_DEV_OFF_ADDR_SHFT; + } else + raw_paddr += pcibr_soft->bs_slot[x].bss_devio.bssd_base; + } + if ((bad_xaddr >= BRIDGE_PCI_MEM32_BASE) && + (bad_xaddr <= BRIDGE_PCI_MEM32_LIMIT)) { + raw_space = PCIIO_SPACE_MEM32; + raw_paddr = bad_xaddr - BRIDGE_PCI_MEM32_BASE; + } + if ((bad_xaddr >= BRIDGE_PCI_MEM64_BASE) && + (bad_xaddr <= BRIDGE_PCI_MEM64_LIMIT)) { + raw_space = PCIIO_SPACE_MEM64; + raw_paddr = bad_xaddr - BRIDGE_PCI_MEM64_BASE; + } + if ((bad_xaddr >= BRIDGE_PCI_IO_BASE) && + (bad_xaddr <= BRIDGE_PCI_IO_LIMIT)) { + raw_space = PCIIO_SPACE_IO; + raw_paddr = bad_xaddr - BRIDGE_PCI_IO_BASE; + } + space = raw_space; + offset = raw_paddr; + + if ((slot == PCIIO_SLOT_NONE) && (space != PCIIO_SPACE_NONE)) { + /* we've got a space/offset but not which + * PCI slot decodes it. Check through our + * notions of which devices decode where. + * + * Yes, this "duplicates" some logic in + * pcibr_addr_toslot; the difference is, + * this code knows which space we are in, + * and can really really tell what is + * going on (no guessing). + */ + + for (cs = 0; (cs < 8) && (slot == PCIIO_SLOT_NONE); cs++) { + int nf = pcibr_soft->bs_slot[cs].bss_ninfo; + pcibr_info_h pcibr_infoh = pcibr_soft->bs_slot[cs].bss_infos; + + for (cf = 0; (cf < nf) && (slot == PCIIO_SLOT_NONE); cf++) { + pcibr_info_t pcibr_info = pcibr_infoh[cf]; + + if (!pcibr_info) + continue; + for (cw = 0; (cw < 6) && (slot == PCIIO_SLOT_NONE); ++cw) { + if (((wx = pcibr_info->f_window[cw].w_space) != PCIIO_SPACE_NONE) && + ((wb = pcibr_info->f_window[cw].w_base) != 0) && + ((ws = pcibr_info->f_window[cw].w_size) != 0) && + ((wl = wb + ws) > wb) && + ((wb <= offset) && (wl > offset))) { + /* MEM, MEM32 and MEM64 need to + * compare as equal ... + */ + if ((wx == space) || + (((wx == PCIIO_SPACE_MEM) || + (wx == PCIIO_SPACE_MEM32) || + (wx == PCIIO_SPACE_MEM64)) && + ((space == PCIIO_SPACE_MEM) || + (space == PCIIO_SPACE_MEM32) || + (space == PCIIO_SPACE_MEM64)))) { + slot = cs; + func = cf; + space = PCIIO_SPACE_WIN(cw); + offset -= wb; + } /* endif window space match */ + } /* endif window valid and addr match */ + } /* next window unless slot set */ + } /* next func unless slot set */ + } /* next slot unless slot set */ + /* XXX- if slot is still -1, no PCI devices are + * decoding here using their standard PCI BASE + * registers. This would be a really good place + * to cross-coordinate with the pciio PCI + * address space allocation routines, to find + * out if this address is "allocated" by any of + * our subsidiary devices. + */ + } + /* Scan all piomap records on this PCI bus to update + * the TimeOut Counters on all matching maps. If we + * don't already know the slot number, take it from + * the first matching piomap. Note that we have to + * compare maps against raw_space and raw_paddr + * since space and offset could already be + * window-relative. + * + * There is a chance that one CPU could update + * through this path, and another CPU could also + * update due to an interrupt. Closing this hole + * would only result in the possibility of some + * errors never getting logged at all, and since the + * use for bp_toc is as a logical test rather than a + * strict count, the excess counts are not a + * problem. + */ + for (cs = 0; cs < 8; ++cs) { + int nf = pcibr_soft->bs_slot[cs].bss_ninfo; + pcibr_info_h pcibr_infoh = pcibr_soft->bs_slot[cs].bss_infos; + + for (cf = 0; cf < nf; cf++) { + pcibr_info_t pcibr_info = pcibr_infoh[cf]; + pcibr_piomap_t map; + + if (!pcibr_info) + continue; + + for (map = pcibr_info->f_piomap; + map != NULL; map = map->bp_next) { + wx = map->bp_space; + wb = map->bp_pciaddr; + ws = map->bp_mapsz; + cw = wx - PCIIO_SPACE_WIN(0); + if (cw < 6) { + wb += pcibr_soft->bs_slot[cs].bss_window[cw].bssw_base; + wx = pcibr_soft->bs_slot[cs].bss_window[cw].bssw_space; + } + if (wx == PCIIO_SPACE_ROM) { + wb += pcibr_info->f_rbase; + wx = PCIIO_SPACE_MEM; + } + if ((wx == PCIIO_SPACE_MEM32) || + (wx == PCIIO_SPACE_MEM64)) + wx = PCIIO_SPACE_MEM; + wl = wb + ws; + if ((wx == raw_space) && (raw_paddr >= wb) && (raw_paddr < wl)) { + atomicAddInt(map->bp_toc, 1); + if (slot == PCIIO_SLOT_NONE) { + slot = cs; + space = map->bp_space; + if (cw < 6) + offset -= pcibr_soft->bs_slot[cs].bss_window[cw].bssw_base; + } + } + } + } + } + + if (space != PCIIO_SPACE_NONE) { + if (slot != PCIIO_SLOT_NONE) + if (func != PCIIO_FUNC_NONE) + IOERROR_SETVALUE(ioe, widgetdev, + pciio_widgetdev_create(slot,func)); + else + IOERROR_SETVALUE(ioe, widgetdev, + pciio_widgetdev_create(slot,0)); + + IOERROR_SETVALUE(ioe, busspace, space); + IOERROR_SETVALUE(ioe, busaddr, offset); + } + if (mode == MODE_DEVPROBE) { + /* + * During probing, we don't really care what the + * error is. Clean up the error in Bridge, notify + * subsidiary devices, and return success. + */ + pcibr_error_cleanup(pcibr_soft, error_code); + + /* if appropriate, give the error handler for this slot + * a shot at this probe access as well. + */ + return (slot == PCIIO_SLOT_NONE) ? IOERROR_HANDLED : + pciio_error_handler(pcibr_vhdl, error_code, mode, ioe); + } + /* + * If we don't know what "PCI SPACE" the access + * was targeting, we may have problems at the + * Bridge itself. Don't touch any bridge registers, + * and do complain loudly. + */ + + if (space == PCIIO_SPACE_NONE) { + printk("XIO Bus Error at %s\n" + "\taccess to XIO bus offset 0x%x\n" + "\tdoes not correspond to any PCI address\n", + pcibr_soft->bs_name, bad_xaddr); + + /* caller will dump contents of ioe struct */ + return IOERROR_XTALKLEVEL; + } + + /* + * Actual PCI Error handling situation. + * Typically happens when a user level process accesses + * PCI space, and it causes some error. + * + * Due to PCI Bridge implementation, we get two indication + * for a read error: an interrupt and a Bus error. + * We like to handle read error in the bus error context. + * But the interrupt comes and goes before bus error + * could make much progress. (NOTE: interrupd does + * come in _after_ bus error processing starts. But it's + * completed by the time bus error code reaches PCI PIO + * error handling. + * Similarly write error results in just an interrupt, + * and error handling has to be done at interrupt level. + * There is no way to distinguish at interrupt time, if an + * error interrupt is due to read/write error.. + */ + + /* We know the xtalk addr, the raw PCI bus space, + * the raw PCI bus address, the decoded PCI bus + * space, the offset within that space, and the + * decoded PCI slot (which may be "PCIIO_SLOT_NONE" if no slot + * is known to be involved). + */ + + /* + * Hand the error off to the handler registered + * for the slot that should have decoded the error, + * or to generic PCI handling (if pciio decides that + * such is appropriate). + */ + retval = pciio_error_handler(pcibr_vhdl, error_code, mode, ioe); + + if (retval != IOERROR_HANDLED) { + + /* Generate a generic message for IOERROR_UNHANDLED + * since the subsidiary handlers were silent, and + * did no recovery. + */ + if (retval == IOERROR_UNHANDLED) { + retval = IOERROR_PANIC; + + /* we may or may not want to print some of this, + * depending on debug level and which error code. + */ + + printk(KERN_ALERT + "PIO Error on PCI Bus %s", + pcibr_soft->bs_name); + /* this decodes part of the ioe; our caller + * will dump the raw details in DEBUG and + * kdebug kernels. + */ + BEM_ADD_IOE(ioe); + } +#if defined(FORCE_ERRORS) + if (0) { +#elif !DEBUG + if (kdebug) { +#endif + /* + * Dump raw data from Bridge/PCI layer. + */ + + BEM_ADD_STR("Raw info from Bridge/PCI layer:\n"); + if (bridge->b_int_status & BRIDGE_ISR_PCIBUS_PIOERR) + pcibr_error_dump(pcibr_soft); + BEM_ADD_SPC(raw_space); + BEM_ADD_VAR(raw_paddr); + if (IOERROR_FIELDVALID(ioe, widgetdev)) { + + slot = pciio_widgetdev_slot_get(IOERROR_GETVALUE(ioe, + widgetdev)); + func = pciio_widgetdev_func_get(IOERROR_GETVALUE(ioe, + widgetdev)); + if (slot < 8) { + bridgereg_t device = bridge->b_device[slot].reg; + + BEM_ADD_VAR(slot); + BEM_ADD_VAR(func); + BEM_ADD_REG(device); + } + } +#if !DEBUG || defined(FORCE_ERRORS) + } +#endif + + /* + * Since error could not be handled at lower level, + * error data logged has not been cleared. + * Clean up errors, and + * re-enable bridge to interrupt on error conditions. + * NOTE: Wheather we get the interrupt on PCI_ABORT or not is + * dependent on INT_ENABLE register. This write just makes sure + * that if the interrupt was enabled, we do get the interrupt. + * + * CAUTION: Resetting bit BRIDGE_IRR_PCI_GRP_CLR, acknowledges + * a group of interrupts. If while handling this error, + * some other error has occured, that would be + * implicitly cleared by this write. + * Need a way to ensure we don't inadvertently clear some + * other errors. + */ + if (IOERROR_FIELDVALID(ioe, widgetdev)) + pcibr_device_disable(pcibr_soft, + pciio_widgetdev_slot_get( + IOERROR_GETVALUE(ioe, widgetdev))); + + if (mode == MODE_DEVUSERERROR) + pcibr_error_cleanup(pcibr_soft, error_code); + } + return retval; +} + +/* + * bridge_dmaerror + * Some error was identified in a DMA transaction. + * This routine will identify the that caused the error, + * and try to invoke the appropriate bus service to handle this. + */ + +#define BRIDGE_DMA_READ_ERROR (BRIDGE_ISR_RESP_XTLK_ERR|BRIDGE_ISR_XREAD_REQ_TIMEOUT) + +int +pcibr_dmard_error( + pcibr_soft_t pcibr_soft, + int error_code, + ioerror_mode_t mode, + ioerror_t *ioe) +{ + devfs_handle_t pcibr_vhdl = pcibr_soft->bs_vhdl; + bridge_t *bridge = pcibr_soft->bs_base; + bridgereg_t bus_lowaddr, bus_uppraddr; + int retval = 0; + int bufnum; + + /* + * In case of DMA errors, bridge should have logged the + * address that caused the error. + * Look up the address, in the bridge error registers, and + * take appropriate action + */ + ASSERT(IOERROR_GETVALUE(ioe, widgetnum) == pcibr_soft->bs_xid); + ASSERT(bridge); + + /* + * read error log registers + */ + bus_lowaddr = bridge->b_wid_resp_lower; + bus_uppraddr = bridge->b_wid_resp_upper; + + bufnum = BRIDGE_RESP_ERRUPPR_BUFNUM(bus_uppraddr); + IOERROR_SETVALUE(ioe, widgetdev, + pciio_widgetdev_create( + BRIDGE_RESP_ERRUPPR_DEVICE(bus_uppraddr), + 0)); + IOERROR_SETVALUE(ioe, busaddr, + (bus_lowaddr | + ((iopaddr_t) + (bus_uppraddr & + BRIDGE_ERRUPPR_ADDRMASK) << 32))); + + /* + * need to ensure that the xtalk adress in ioe + * maps to PCI error address read from bridge. + * How to convert PCI address back to Xtalk address ? + * (better idea: convert XTalk address to PCI address + * and then do the compare!) + */ + + retval = pciio_error_handler(pcibr_vhdl, error_code, mode, ioe); + if (retval != IOERROR_HANDLED) + pcibr_device_disable(pcibr_soft, + pciio_widgetdev_slot_get( + IOERROR_GETVALUE(ioe,widgetdev))); + + /* + * Re-enable bridge to interrupt on BRIDGE_IRR_RESP_BUF_GRP_CLR + * NOTE: Wheather we get the interrupt on BRIDGE_IRR_RESP_BUF_GRP_CLR or + * not is dependent on INT_ENABLE register. This write just makes sure + * that if the interrupt was enabled, we do get the interrupt. + */ + bridge->b_int_rst_stat = BRIDGE_IRR_RESP_BUF_GRP_CLR; + + /* + * Also, release the "bufnum" back to buffer pool that could be re-used. + * This is done by "disabling" the buffer for a moment, then restoring + * the original assignment. + */ + + { + reg_p regp; + bridgereg_t regv; + bridgereg_t mask; + + regp = (bufnum & 1) + ? &bridge->b_odd_resp + : &bridge->b_even_resp; + + mask = 0xF << ((bufnum >> 1) * 4); + + regv = *regp; + *regp = regv & ~mask; + *regp = regv; + } + + return retval; +} + +/* + * pcibr_dmawr_error: + * Handle a dma write error caused by a device attached to this bridge. + * + * ioe has the widgetnum, widgetdev, and memaddr fields updated + * But we don't know the PCI address that corresponds to "memaddr" + * nor do we know which device driver is generating this address. + * + * There is no easy way to find out the PCI address(es) that map + * to a specific system memory address. Bus handling code is also + * of not much help, since they don't keep track of the DMA mapping + * that have been handed out. + * So it's a dead-end at this time. + * + * If translation is available, we could invoke the error handling + * interface of the device driver. + */ +/*ARGSUSED */ +int +pcibr_dmawr_error( + pcibr_soft_t pcibr_soft, + int error_code, + ioerror_mode_t mode, + ioerror_t *ioe) +{ + devfs_handle_t pcibr_vhdl = pcibr_soft->bs_vhdl; + int retval; + + retval = pciio_error_handler(pcibr_vhdl, error_code, mode, ioe); + + if (retval != IOERROR_HANDLED) { + pcibr_device_disable(pcibr_soft, + pciio_widgetdev_slot_get( + IOERROR_GETVALUE(ioe, widgetdev))); + + } + return retval; +} + +/* + * Bridge error handler. + * Interface to handle all errors that involve bridge in some way. + * + * This normally gets called from xtalk error handler. + * ioe has different set of fields set depending on the error that + * was encountered. So, we have a bit field indicating which of the + * fields are valid. + * + * NOTE: This routine could be operating in interrupt context. So, + * don't try to sleep here (till interrupt threads work!!) + */ +int +pcibr_error_handler( + error_handler_arg_t einfo, + int error_code, + ioerror_mode_t mode, + ioerror_t *ioe) +{ + pcibr_soft_t pcibr_soft; + int retval = IOERROR_BADERRORCODE; + +#ifdef EHE_ENABLE + devfs_handle_t xconn_vhdl,pcibr_vhdl; + error_state_t e_state; +#endif /* EHE_ENABLE */ + + pcibr_soft = (pcibr_soft_t) einfo; + +#ifdef EHE_ENABLE + xconn_vhdl = pcibr_soft->bs_conn; + pcibr_vhdl = pcibr_soft->bs_vhdl; + + e_state = error_state_get(xconn_vhdl); + + if (error_state_set(pcibr_vhdl, e_state) == + ERROR_RETURN_CODE_CANNOT_SET_STATE) + return(IOERROR_UNHANDLED); + + /* If we are in the action handling phase clean out the error state + * on the xswitch. + */ + if (e_state == ERROR_STATE_ACTION) + (void)error_state_set(xconn_vhdl, ERROR_STATE_NONE); +#endif /* EHE_ENABLE */ + +#if DEBUG && ERROR_DEBUG + printk("%s: pcibr_error_handler\n", pcibr_soft->bs_name); +#endif + + ASSERT(pcibr_soft != NULL); + + if (error_code & IOECODE_PIO) + retval = pcibr_pioerror(pcibr_soft, error_code, mode, ioe); + + if (error_code & IOECODE_DMA) { + if (error_code & IOECODE_READ) { + /* + * DMA read error occurs when a device attached to the bridge + * tries to read some data from system memory, and this + * either results in a timeout or access error. + * First case is indicated by the bit "XREAD_REQ_TOUT" + * and second case by "RESP_XTALK_ERROR" bit in bridge error + * interrupt status register. + * + * pcibr_error_intr_handler would get invoked first, and it has + * the responsibility of calling pcibr_error_handler with + * suitable parameters. + */ + + retval = pcibr_dmard_error(pcibr_soft, error_code, MODE_DEVERROR, ioe); + } + if (error_code & IOECODE_WRITE) { + /* + * A device attached to this bridge has been generating + * bad DMA writes. Find out the device attached, and + * slap on it's wrist. + */ + + retval = pcibr_dmawr_error(pcibr_soft, error_code, MODE_DEVERROR, ioe); + } + } + return retval; + +} + +/* + * Reenable a device after handling the error. + * This is called by the lower layers when they wish to be reenabled + * after an error. + * Note that each layer would be calling the previous layer to reenable + * first, before going ahead with their own re-enabling. + */ + +int +pcibr_error_devenable(devfs_handle_t pconn_vhdl, int error_code) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + + ASSERT(error_code & IOECODE_PIO); + + /* If the error is not known to be a write, + * we have to call devenable. + * write errors are isolated to the bridge. + */ + if (!(error_code & IOECODE_WRITE)) { + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + int rc; + + rc = xtalk_error_devenable(xconn_vhdl, pciio_slot, error_code); + if (rc != IOERROR_HANDLED) + return rc; + } + pcibr_error_cleanup(pcibr_soft, error_code); + return IOERROR_HANDLED; +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_hints.c lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_hints.c --- linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_hints.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_hints.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,204 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +pcibr_hints_t pcibr_hints_get(devfs_handle_t, int); +void pcibr_hints_fix_rrbs(devfs_handle_t); +void pcibr_hints_dualslot(devfs_handle_t, pciio_slot_t, pciio_slot_t); +void pcibr_hints_intr_bits(devfs_handle_t, pcibr_intr_bits_f *); +void pcibr_set_rrb_callback(devfs_handle_t, rrb_alloc_funct_t); +void pcibr_hints_handsoff(devfs_handle_t); +void pcibr_hints_subdevs(devfs_handle_t, pciio_slot_t, uint64_t); + +pcibr_hints_t +pcibr_hints_get(devfs_handle_t xconn_vhdl, int alloc) +{ + arbitrary_info_t ainfo = 0; + graph_error_t rv; + pcibr_hints_t hint; + + rv = hwgraph_info_get_LBL(xconn_vhdl, INFO_LBL_PCIBR_HINTS, &ainfo); + + if (alloc && (rv != GRAPH_SUCCESS)) { + + NEW(hint); + hint->rrb_alloc_funct = NULL; + hint->ph_intr_bits = NULL; + rv = hwgraph_info_add_LBL(xconn_vhdl, + INFO_LBL_PCIBR_HINTS, + (arbitrary_info_t) hint); + if (rv != GRAPH_SUCCESS) + goto abnormal_exit; + + rv = hwgraph_info_get_LBL(xconn_vhdl, INFO_LBL_PCIBR_HINTS, &ainfo); + + if (rv != GRAPH_SUCCESS) + goto abnormal_exit; + + if (ainfo != (arbitrary_info_t) hint) + goto abnormal_exit; + } + return (pcibr_hints_t) ainfo; + +abnormal_exit: +#ifdef LATER + printf("SHOULD NOT BE HERE\n"); +#endif + DEL(hint); + return(NULL); + +} + +void +pcibr_hints_fix_some_rrbs(devfs_handle_t xconn_vhdl, unsigned mask) +{ + pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); + + if (hint) + hint->ph_rrb_fixed = mask; +#if DEBUG + else + printk("pcibr_hints_fix_rrbs: pcibr_hints_get failed at\n" + "\t%p\n", xconn_vhdl); +#endif +} + +void +pcibr_hints_fix_rrbs(devfs_handle_t xconn_vhdl) +{ + pcibr_hints_fix_some_rrbs(xconn_vhdl, 0xFF); +} + +void +pcibr_hints_dualslot(devfs_handle_t xconn_vhdl, + pciio_slot_t host, + pciio_slot_t guest) +{ + pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); + + if (hint) + hint->ph_host_slot[guest] = host + 1; +#if DEBUG + else + printk("pcibr_hints_dualslot: pcibr_hints_get failed at\n" + "\t%p\n", xconn_vhdl); +#endif +} + +void +pcibr_hints_intr_bits(devfs_handle_t xconn_vhdl, + pcibr_intr_bits_f *xxx_intr_bits) +{ + pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); + + if (hint) + hint->ph_intr_bits = xxx_intr_bits; +#if DEBUG + else + printk("pcibr_hints_intr_bits: pcibr_hints_get failed at\n" + "\t%p\n", xconn_vhdl); +#endif +} + +void +pcibr_set_rrb_callback(devfs_handle_t xconn_vhdl, rrb_alloc_funct_t rrb_alloc_funct) +{ + pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); + + if (hint) + hint->rrb_alloc_funct = rrb_alloc_funct; +} + +void +pcibr_hints_handsoff(devfs_handle_t xconn_vhdl) +{ + pcibr_hints_t hint = pcibr_hints_get(xconn_vhdl, 1); + + if (hint) + hint->ph_hands_off = 1; +#if DEBUG + else + printk("pcibr_hints_handsoff: pcibr_hints_get failed at\n" + "\t%p\n", xconn_vhdl); +#endif +} + +void +pcibr_hints_subdevs(devfs_handle_t xconn_vhdl, + pciio_slot_t slot, + uint64_t subdevs) +{ + arbitrary_info_t ainfo = 0; + char sdname[16]; + devfs_handle_t pconn_vhdl = GRAPH_VERTEX_NONE; + + sprintf(sdname, "pci/%d", slot); + (void) hwgraph_path_add(xconn_vhdl, sdname, &pconn_vhdl); + if (pconn_vhdl == GRAPH_VERTEX_NONE) { +#if DEBUG + printk("pcibr_hints_subdevs: hwgraph_path_create failed at\n" + "\t%p (seeking %s)\n", xconn_vhdl, sdname); +#endif + return; + } + hwgraph_info_get_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, &ainfo); + if (ainfo == 0) { + uint64_t *subdevp; + + NEW(subdevp); + if (!subdevp) { +#if DEBUG + printk("pcibr_hints_subdevs: subdev ptr alloc failed at\n" + "\t%p\n", pconn_vhdl); +#endif + return; + } + *subdevp = subdevs; + hwgraph_info_add_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, (arbitrary_info_t) subdevp); + hwgraph_info_get_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, &ainfo); + if (ainfo == (arbitrary_info_t) subdevp) + return; + DEL(subdevp); + if (ainfo == (arbitrary_info_t) NULL) { +#if DEBUG + printk("pcibr_hints_subdevs: null subdevs ptr at\n" + "\t%p\n", pconn_vhdl); +#endif + return; + } +#if DEBUG + printk("pcibr_subdevs_get: dup subdev add_LBL at\n" + "\t%p\n", pconn_vhdl); +#endif + } + *(uint64_t *) ainfo = subdevs; +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_idbg.c lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_idbg.c --- linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_idbg.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_idbg.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,147 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef LATER + +char *pci_space[] = {"NONE", + "ROM", + "IO", + "", + "MEM", + "MEM32", + "MEM64", + "CFG", + "WIN0", + "WIN1", + "WIN2", + "WIN3", + "WIN4", + "WIN5", + "", + "BAD"}; + +void +idbg_pss_func(pcibr_info_h pcibr_infoh, int func) +{ + pcibr_info_t pcibr_info = pcibr_infoh[func]; + char name[MAXDEVNAME]; + int win; + + if (!pcibr_info) + return; + qprintf("Per-slot Function Info\n"); + sprintf(name, "%v", pcibr_info->f_vertex); + qprintf("\tSlot Name : %s\n",name); + qprintf("\tPCI Bus : %d ",pcibr_info->f_bus); + qprintf("Slot : %d ", pcibr_info->f_slot); + qprintf("Function : %d ", pcibr_info->f_func); + qprintf("VendorId : 0x%x " , pcibr_info->f_vendor); + qprintf("DeviceId : 0x%x\n", pcibr_info->f_device); + sprintf(name, "%v", pcibr_info->f_master); + qprintf("\tBus provider : %s\n",name); + qprintf("\tProvider Fns : 0x%x ", pcibr_info->f_pops); + qprintf("Error Handler : 0x%x Arg 0x%x\n", + pcibr_info->f_efunc,pcibr_info->f_einfo); + for(win = 0 ; win < 6 ; win++) + qprintf("\tBase Reg #%d space %s base 0x%x size 0x%x\n", + win,pci_space[pcibr_info->f_window[win].w_space], + pcibr_info->f_window[win].w_base, + pcibr_info->f_window[win].w_size); + + qprintf("\tRom base 0x%x size 0x%x\n", + pcibr_info->f_rbase,pcibr_info->f_rsize); + + qprintf("\tInterrupt Bit Map\n"); + qprintf("\t\tPCI Int#\tBridge Pin#\n"); + for (win = 0 ; win < 4; win++) + qprintf("\t\tINT%c\t\t%d\n",win+'A',pcibr_info->f_ibit[win]); + qprintf("\n"); +} + + +void +idbg_pss_info(pcibr_soft_t pcibr_soft, pciio_slot_t slot) +{ + pcibr_soft_slot_t pss; + char slot_conn_name[MAXDEVNAME]; + int func; + + pss = &pcibr_soft->bs_slot[slot]; + qprintf("PCI INFRASTRUCTURAL INFO FOR SLOT %d\n", slot); + qprintf("\tHost Present ? %s ", pss->has_host ? "yes" : "no"); + qprintf("\tHost Slot : %d\n",pss->host_slot); + sprintf(slot_conn_name, "%v", pss->slot_conn); + qprintf("\tSlot Conn : %s\n",slot_conn_name); + qprintf("\t#Functions : %d\n",pss->bss_ninfo); + for (func = 0; func < pss->bss_ninfo; func++) + idbg_pss_func(pss->bss_infos,func); + qprintf("\tSpace : %s ",pci_space[pss->bss_devio.bssd_space]); + qprintf("\tBase : 0x%x ", pss->bss_devio.bssd_base); + qprintf("\tShadow Devreg : 0x%x\n", pss->bss_device); + qprintf("\tUsage counts : pmu %d d32 %d d64 %d\n", + pss->bss_pmu_uctr,pss->bss_d32_uctr,pss->bss_d64_uctr); + + qprintf("\tDirect Trans Info : d64_base 0x%x d64_flags 0x%x" + "d32_base 0x%x d32_flags 0x%x\n", + pss->bss_d64_base, pss->bss_d64_flags, + pss->bss_d32_base, pss->bss_d32_flags); + + qprintf("\tExt ATEs active ? %s", + pss->bss_ext_ates_active ? "yes" : "no"); + qprintf(" Command register : 0x%x ", pss->bss_cmd_pointer); + qprintf(" Shadow command val : 0x%x\n", pss->bss_cmd_shadow); + + qprintf("\tRRB Info : Valid %d+%d Reserved %d\n", + pcibr_soft->bs_rrb_valid[slot], + pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL], + pcibr_soft->bs_rrb_res[slot]); + +} + +int ips = 0; + +void +idbg_pss(pcibr_soft_t pcibr_soft) +{ + pciio_slot_t slot; + + + if (ips >= 0 && ips < 8) + idbg_pss_info(pcibr_soft,ips); + else if (ips < 0) + for (slot = 0; slot < 8; slot++) + idbg_pss_info(pcibr_soft,slot); + else + qprintf("Invalid ips %d\n",ips); +} +#endif /* LATER */ diff -urN linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c --- linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c Mon Nov 19 23:22:52 2001 @@ -0,0 +1,907 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __ia64 +#define rmallocmap atemapalloc +#define rmfreemap atemapfree +#define rmfree atefree +#define rmalloc atealloc +#endif + +unsigned pcibr_intr_bits(pciio_info_t info, pciio_intr_line_t lines); +pcibr_intr_t pcibr_intr_alloc(devfs_handle_t, device_desc_t, pciio_intr_line_t, devfs_handle_t); +void pcibr_intr_free(pcibr_intr_t); +void pcibr_setpciint(xtalk_intr_t); +int pcibr_intr_connect(pcibr_intr_t); +void pcibr_intr_disconnect(pcibr_intr_t); + +devfs_handle_t pcibr_intr_cpu_get(pcibr_intr_t); +void pcibr_xintr_preset(void *, int, xwidgetnum_t, iopaddr_t, xtalk_intr_vector_t); +void pcibr_intr_func(intr_arg_t); + +extern pcibr_info_t pcibr_info_get(devfs_handle_t); + +/* ===================================================================== + * INTERRUPT MANAGEMENT + */ + +unsigned +pcibr_intr_bits(pciio_info_t info, + pciio_intr_line_t lines) +{ + pciio_slot_t slot = pciio_info_slot_get(info); + unsigned bbits = 0; + + /* + * Currently favored mapping from PCI + * slot number and INTA/B/C/D to Bridge + * PCI Interrupt Bit Number: + * + * SLOT A B C D + * 0 0 4 0 4 + * 1 1 5 1 5 + * 2 2 6 2 6 + * 3 3 7 3 7 + * 4 4 0 4 0 + * 5 5 1 5 1 + * 6 6 2 6 2 + * 7 7 3 7 3 + */ + + if (slot < 8) { + if (lines & (PCIIO_INTR_LINE_A| PCIIO_INTR_LINE_C)) + bbits |= 1 << slot; + if (lines & (PCIIO_INTR_LINE_B| PCIIO_INTR_LINE_D)) + bbits |= 1 << (slot ^ 4); + } + return bbits; +} + + +/* + * Get the next wrapper pointer queued in the interrupt circular buffer. + */ +pcibr_intr_wrap_t +pcibr_wrap_get(pcibr_intr_cbuf_t cbuf) +{ + pcibr_intr_wrap_t wrap; + + if (cbuf->ib_in == cbuf->ib_out) + PRINT_PANIC( "pcibr intr circular buffer empty, cbuf=0x%p, ib_in=ib_out=%d\n", + (void *)cbuf, cbuf->ib_out); + + wrap = cbuf->ib_cbuf[cbuf->ib_out++]; + cbuf->ib_out = cbuf->ib_out % IBUFSIZE; + return(wrap); +} + +/* + * Queue a wrapper pointer in the interrupt circular buffer. + */ +void +pcibr_wrap_put(pcibr_intr_wrap_t wrap, pcibr_intr_cbuf_t cbuf) +{ + int in; + int s; + + /* + * Multiple CPUs could be executing this code simultaneously + * if a handler has registered multiple interrupt lines and + * the interrupts are directed to different CPUs. + */ + s = mutex_spinlock(&cbuf->ib_lock); + in = (cbuf->ib_in + 1) % IBUFSIZE; + if (in == cbuf->ib_out) + PRINT_PANIC( "pcibr intr circular buffer full, cbuf=0x%p, ib_in=%d\n", + (void *)cbuf, cbuf->ib_in); + + cbuf->ib_cbuf[cbuf->ib_in] = wrap; + cbuf->ib_in = in; + mutex_spinunlock(&cbuf->ib_lock, s); + return; +} + +/* + * There are end cases where a deadlock can occur if interrupt + * processing completes and the Bridge b_int_status bit is still set. + * + * One scenerio is if a second PCI interrupt occurs within 60ns of + * the previous interrupt being cleared. In this case the Bridge + * does not detect the transition, the Bridge b_int_status bit + * remains set, and because no transition was detected no interrupt + * packet is sent to the Hub/Heart. + * + * A second scenerio is possible when a b_int_status bit is being + * shared by multiple devices: + * Device #1 generates interrupt + * Bridge b_int_status bit set + * Device #2 generates interrupt + * interrupt processing begins + * ISR for device #1 runs and + * clears interrupt + * Device #1 generates interrupt + * ISR for device #2 runs and + * clears interrupt + * (b_int_status bit still set) + * interrupt processing completes + * + * Interrupt processing is now complete, but an interrupt is still + * outstanding for Device #1. But because there was no transition of + * the b_int_status bit, no interrupt packet will be generated and + * a deadlock will occur. + * + * To avoid these deadlock situations, this function is used + * to check if a specific Bridge b_int_status bit is set, and if so, + * cause the setting of the corresponding interrupt bit. + * + * On a XBridge (IP35), we do this by writing the appropriate Bridge Force + * Interrupt register. + */ +void +pcibr_force_interrupt(pcibr_intr_wrap_t wrap) +{ + unsigned bit; + pcibr_soft_t pcibr_soft = wrap->iw_soft; + bridge_t *bridge = pcibr_soft->bs_base; + cpuid_t cpuvertex_to_cpuid(devfs_handle_t vhdl); + + bit = wrap->iw_intr; + + if (pcibr_soft->bs_xbridge) { + bridge->b_force_pin[bit].intr = 1; + } else if ((1 << bit) & *wrap->iw_stat) { + cpuid_t cpu; + unsigned intr_bit; + xtalk_intr_t xtalk_intr = + pcibr_soft->bs_intr[bit].bsi_xtalk_intr; + + intr_bit = (short) xtalk_intr_vector_get(xtalk_intr); + cpu = cpuvertex_to_cpuid(xtalk_intr_cpu_get(xtalk_intr)); +#if defined(CONFIG_IA64_SGI_SN1) + REMOTE_CPU_SEND_INTR(cpu, intr_bit); +#endif + } +} + +/*ARGSUSED */ +pcibr_intr_t +pcibr_intr_alloc(devfs_handle_t pconn_vhdl, + device_desc_t dev_desc, + pciio_intr_line_t lines, + devfs_handle_t owner_dev) +{ + pcibr_info_t pcibr_info = pcibr_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pcibr_info->f_slot; + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pcibr_info->f_mfast; + devfs_handle_t xconn_vhdl = pcibr_soft->bs_conn; + bridge_t *bridge = pcibr_soft->bs_base; + int is_threaded = 0; + int thread_swlevel; + + xtalk_intr_t *xtalk_intr_p; + pcibr_intr_t *pcibr_intr_p; + pcibr_intr_list_t *intr_list_p; + + unsigned pcibr_int_bits; + unsigned pcibr_int_bit; + xtalk_intr_t xtalk_intr = (xtalk_intr_t)0; + hub_intr_t hub_intr; + pcibr_intr_t pcibr_intr; + pcibr_intr_list_t intr_entry; + pcibr_intr_list_t intr_list; + bridgereg_t int_dev; + +#if DEBUG && INTR_DEBUG + printk("%v: pcibr_intr_alloc\n" + "%v:%s%s%s%s%s\n", + owner_dev, pconn_vhdl, + !(lines & 15) ? " No INTs?" : "", + lines & 1 ? " INTA" : "", + lines & 2 ? " INTB" : "", + lines & 4 ? " INTC" : "", + lines & 8 ? " INTD" : ""); +#endif + + NEW(pcibr_intr); + if (!pcibr_intr) + return NULL; + + if (dev_desc) { + cpuid_t intr_target_from_desc(device_desc_t, int); + } else { + extern int default_intr_pri; + + is_threaded = 1; /* PCI interrupts are threaded, by default */ + thread_swlevel = default_intr_pri; + } + + pcibr_intr->bi_dev = pconn_vhdl; + pcibr_intr->bi_lines = lines; + pcibr_intr->bi_soft = pcibr_soft; + pcibr_intr->bi_ibits = 0; /* bits will be added below */ + pcibr_intr->bi_flags = is_threaded ? 0 : PCIIO_INTR_NOTHREAD; + pcibr_intr->bi_mustruncpu = CPU_NONE; + pcibr_intr->bi_ibuf.ib_in = 0; + pcibr_intr->bi_ibuf.ib_out = 0; + mutex_spinlock_init(&pcibr_intr->bi_ibuf.ib_lock); + + pcibr_int_bits = pcibr_soft->bs_intr_bits((pciio_info_t)pcibr_info, lines); + + + /* + * For each PCI interrupt line requested, figure + * out which Bridge PCI Interrupt Line it maps + * to, and make sure there are xtalk resources + * allocated for it. + */ +#if DEBUG && INTR_DEBUG + printk("pcibr_int_bits: 0x%X\n", pcibr_int_bits); +#endif + for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit ++) { + if (pcibr_int_bits & (1 << pcibr_int_bit)) { + xtalk_intr_p = &pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr; + + xtalk_intr = *xtalk_intr_p; + + if (xtalk_intr == NULL) { + /* + * This xtalk_intr_alloc is constrained for two reasons: + * 1) Normal interrupts and error interrupts need to be delivered + * through a single xtalk target widget so that there aren't any + * ordering problems with DMA, completion interrupts, and error + * interrupts. (Use of xconn_vhdl forces this.) + * + * 2) On IP35, addressing constraints on IP35 and Bridge force + * us to use a single PI number for all interrupts from a + * single Bridge. (IP35-specific code forces this, and we + * verify in pcibr_setwidint.) + */ + + /* + * All code dealing with threaded PCI interrupt handlers + * is located at the pcibr level. Because of this, + * we always want the lower layers (hub/heart_intr_alloc, + * intr_level_connect) to treat us as non-threaded so we + * don't set up a duplicate threaded environment. We make + * this happen by calling a special xtalk interface. + */ + xtalk_intr = xtalk_intr_alloc_nothd(xconn_vhdl, dev_desc, + owner_dev); +#if DEBUG && INTR_DEBUG + printk("%v: xtalk_intr=0x%X\n", xconn_vhdl, xtalk_intr); +#endif + + /* both an assert and a runtime check on this: + * we need to check in non-DEBUG kernels, and + * the ASSERT gets us more information when + * we use DEBUG kernels. + */ + ASSERT(xtalk_intr != NULL); + if (xtalk_intr == NULL) { + /* it is quite possible that our + * xtalk_intr_alloc failed because + * someone else got there first, + * and we can find their results + * in xtalk_intr_p. + */ + if (!*xtalk_intr_p) { +#ifdef SUPPORT_PRINTING_V_FORMAT + printk(KERN_ALERT + "pcibr_intr_alloc %v: unable to get xtalk interrupt resources", + xconn_vhdl); +#else + printk(KERN_ALERT + "pcibr_intr_alloc 0x%p: unable to get xtalk interrupt resources", + (void *)xconn_vhdl); +#endif + /* yes, we leak resources here. */ + return 0; + } + } else if (compare_and_swap_ptr((void **) xtalk_intr_p, NULL, xtalk_intr)) { + /* + * now tell the bridge which slot is + * using this interrupt line. + */ + int_dev = bridge->b_int_device; + int_dev &= ~BRIDGE_INT_DEV_MASK(pcibr_int_bit); + int_dev |= pciio_slot << BRIDGE_INT_DEV_SHFT(pcibr_int_bit); + bridge->b_int_device = int_dev; /* XXXMP */ + +#if DEBUG && INTR_DEBUG + printk("%v: bridge intr bit %d clears my wrb\n", + pconn_vhdl, pcibr_int_bit); +#endif + } else { + /* someone else got one allocated first; + * free the one we just created, and + * retrieve the one they allocated. + */ + xtalk_intr_free(xtalk_intr); + xtalk_intr = *xtalk_intr_p; +#if PARANOID + /* once xtalk_intr is set, we never clear it, + * so if the CAS fails above, this condition + * can "never happen" ... + */ + if (!xtalk_intr) { + printk(KERN_ALERT + "pcibr_intr_alloc %v: unable to set xtalk interrupt resources", + xconn_vhdl); + /* yes, we leak resources here. */ + return 0; + } +#endif + } + } + + pcibr_intr->bi_ibits |= 1 << pcibr_int_bit; + + NEW(intr_entry); + intr_entry->il_next = NULL; + intr_entry->il_intr = pcibr_intr; + intr_entry->il_wrbf = &(bridge->b_wr_req_buf[pciio_slot].reg); + intr_list_p = + &pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_list; +#if DEBUG && INTR_DEBUG +#if defined(SUPPORT_PRINTING_V_FORMAT) + printk("0x%x: Bridge bit %d wrap=0x%x\n", + pconn_vhdl, pcibr_int_bit, + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap); +#else + printk("%v: Bridge bit %d wrap=0x%x\n", + pconn_vhdl, pcibr_int_bit, + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap); +#endif +#endif + + if (compare_and_swap_ptr((void **) intr_list_p, NULL, intr_entry)) { + /* we are the first interrupt on this bridge bit. + */ +#if DEBUG && INTR_DEBUG + printk("%v INT 0x%x (bridge bit %d) allocated [FIRST]\n", + pconn_vhdl, pcibr_int_bits, pcibr_int_bit); +#endif + continue; + } + intr_list = *intr_list_p; + pcibr_intr_p = &intr_list->il_intr; + if (compare_and_swap_ptr((void **) pcibr_intr_p, NULL, pcibr_intr)) { + /* first entry on list was erased, + * and we replaced it, so we + * don't need our intr_entry. + */ + DEL(intr_entry); +#if DEBUG && INTR_DEBUG + printk("%v INT 0x%x (bridge bit %d) replaces erased first\n", + pconn_vhdl, pcibr_int_bits, pcibr_int_bit); +#endif + continue; + } + intr_list_p = &intr_list->il_next; + if (compare_and_swap_ptr((void **) intr_list_p, NULL, intr_entry)) { + /* we are the new second interrupt on this bit. + */ + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared = 1; +#if DEBUG && INTR_DEBUG + printk("%v INT 0x%x (bridge bit %d) is new SECOND\n", + pconn_vhdl, pcibr_int_bits, pcibr_int_bit); +#endif + continue; + } + while (1) { + pcibr_intr_p = &intr_list->il_intr; + if (compare_and_swap_ptr((void **) pcibr_intr_p, NULL, pcibr_intr)) { + /* an entry on list was erased, + * and we replaced it, so we + * don't need our intr_entry. + */ + DEL(intr_entry); +#if DEBUG && INTR_DEBUG + printk("%v INT 0x%x (bridge bit %d) replaces erased Nth\n", + pconn_vhdl, pcibr_int_bits, pcibr_int_bit); +#endif + break; + } + intr_list_p = &intr_list->il_next; + if (compare_and_swap_ptr((void **) intr_list_p, NULL, intr_entry)) { + /* entry appended to share list + */ +#if DEBUG && INTR_DEBUG + printk("%v INT 0x%x (bridge bit %d) is new Nth\n", + pconn_vhdl, pcibr_int_bits, pcibr_int_bit); +#endif + break; + } + /* step to next record in chain + */ + intr_list = *intr_list_p; + } + } + } + +#if DEBUG && INTR_DEBUG + printk("%v pcibr_intr_alloc complete\n", pconn_vhdl); +#endif + hub_intr = (hub_intr_t)xtalk_intr; + pcibr_intr->bi_irq = hub_intr->i_bit; + pcibr_intr->bi_cpu = hub_intr->i_cpuid; + return pcibr_intr; +} + +/*ARGSUSED */ +void +pcibr_intr_free(pcibr_intr_t pcibr_intr) +{ + unsigned pcibr_int_bits = pcibr_intr->bi_ibits; + pcibr_soft_t pcibr_soft = pcibr_intr->bi_soft; + unsigned pcibr_int_bit; + pcibr_intr_list_t intr_list; + int intr_shared; + xtalk_intr_t *xtalk_intrp; + + for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) { + if (pcibr_int_bits & (1 << pcibr_int_bit)) { + for (intr_list = + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_list; + intr_list != NULL; + intr_list = intr_list->il_next) + if (compare_and_swap_ptr((void **) &intr_list->il_intr, + pcibr_intr, + NULL)) { +#if DEBUG && INTR_DEBUG + printk("%s: cleared a handler from bit %d\n", + pcibr_soft->bs_name, pcibr_int_bit); +#endif + } + /* If this interrupt line is not being shared between multiple + * devices release the xtalk interrupt resources. + */ + intr_shared = + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared; + xtalk_intrp = &pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr; + + if ((!intr_shared) && (*xtalk_intrp)) { + + bridge_t *bridge = pcibr_soft->bs_base; + bridgereg_t int_dev; + + xtalk_intr_free(*xtalk_intrp); + *xtalk_intrp = 0; + + /* Clear the PCI device interrupt to bridge interrupt pin + * mapping. + */ + int_dev = bridge->b_int_device; + int_dev &= ~BRIDGE_INT_DEV_MASK(pcibr_int_bit); + bridge->b_int_device = int_dev; + + } + } + } + DEL(pcibr_intr); +} + +void +pcibr_setpciint(xtalk_intr_t xtalk_intr) +{ + iopaddr_t addr = xtalk_intr_addr_get(xtalk_intr); + xtalk_intr_vector_t vect = xtalk_intr_vector_get(xtalk_intr); + bridgereg_t *int_addr = (bridgereg_t *) + xtalk_intr_sfarg_get(xtalk_intr); + + *int_addr = ((BRIDGE_INT_ADDR_HOST & (addr >> 30)) | + (BRIDGE_INT_ADDR_FLD & vect)); +} + +/*ARGSUSED */ +int +pcibr_intr_connect(pcibr_intr_t pcibr_intr) +{ + pcibr_soft_t pcibr_soft = pcibr_intr->bi_soft; + bridge_t *bridge = pcibr_soft->bs_base; + unsigned pcibr_int_bits = pcibr_intr->bi_ibits; + unsigned pcibr_int_bit; + bridgereg_t b_int_enable; + unsigned long s; + + if (pcibr_intr == NULL) + return -1; + +#if DEBUG && INTR_DEBUG + printk("%v: pcibr_intr_connect\n", + pcibr_intr->bi_dev); +#endif + + *((volatile unsigned *)&pcibr_intr->bi_flags) |= PCIIO_INTR_CONNECTED; + + /* + * For each PCI interrupt line requested, figure + * out which Bridge PCI Interrupt Line it maps + * to, and make sure there are xtalk resources + * allocated for it. + */ + for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) + if (pcibr_int_bits & (1 << pcibr_int_bit)) { + xtalk_intr_t xtalk_intr; + + xtalk_intr = pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr; + + /* + * If this interrupt line is being shared and the connect has + * already been done, no need to do it again. + */ + if (pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_connected) + continue; + + + /* + * Use the pcibr wrapper function to handle all Bridge interrupts + * regardless of whether the interrupt line is shared or not. + */ + xtalk_intr_connect(xtalk_intr, (xtalk_intr_setfunc_t) pcibr_setpciint, + (void *)&(bridge->b_int_addr[pcibr_int_bit].addr)); + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_connected = 1; + +#if DEBUG && INTR_DEBUG + printk("%v bridge bit %d wrapper connected\n", + pcibr_intr->bi_dev, pcibr_int_bit); +#endif + } + s = pcibr_lock(pcibr_soft); + b_int_enable = bridge->b_int_enable; + b_int_enable |= pcibr_int_bits; + bridge->b_int_enable = b_int_enable; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + pcibr_unlock(pcibr_soft, s); + + return 0; +} + +/*ARGSUSED */ +void +pcibr_intr_disconnect(pcibr_intr_t pcibr_intr) +{ + pcibr_soft_t pcibr_soft = pcibr_intr->bi_soft; + bridge_t *bridge = pcibr_soft->bs_base; + unsigned pcibr_int_bits = pcibr_intr->bi_ibits; + unsigned pcibr_int_bit; + bridgereg_t b_int_enable; + unsigned long s; + + /* Stop calling the function. Now. + */ + *((volatile unsigned *)&pcibr_intr->bi_flags) &= ~PCIIO_INTR_CONNECTED; + + /* + * For each PCI interrupt line requested, figure + * out which Bridge PCI Interrupt Line it maps + * to, and disconnect the interrupt. + */ + + /* don't disable interrupts for lines that + * are shared between devices. + */ + for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) + if ((pcibr_int_bits & (1 << pcibr_int_bit)) && + (pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared)) + pcibr_int_bits &= ~(1 << pcibr_int_bit); + if (!pcibr_int_bits) + return; + + s = pcibr_lock(pcibr_soft); + b_int_enable = bridge->b_int_enable; + b_int_enable &= ~pcibr_int_bits; + bridge->b_int_enable = b_int_enable; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + pcibr_unlock(pcibr_soft, s); + + for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) + if (pcibr_int_bits & (1 << pcibr_int_bit)) { + /* if the interrupt line is now shared, + * do not disconnect it. + */ + if (pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared) + continue; + + xtalk_intr_disconnect(pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr); + pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_connected = 0; + +#if DEBUG && INTR_DEBUG + printk("%s: xtalk disconnect done for Bridge bit %d\n", + pcibr_soft->bs_name, pcibr_int_bit); +#endif + + /* if we are sharing the interrupt line, + * connect us up; this closes the hole + * where the another pcibr_intr_alloc() + * was in progress as we disconnected. + */ + if (!pcibr_soft->bs_intr[pcibr_int_bit].bsi_pcibr_intr_wrap.iw_shared) + continue; + + xtalk_intr_connect(pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr, + (xtalk_intr_setfunc_t)pcibr_setpciint, + (void *) &(bridge->b_int_addr[pcibr_int_bit].addr)); + } +} + +/*ARGSUSED */ +devfs_handle_t +pcibr_intr_cpu_get(pcibr_intr_t pcibr_intr) +{ + pcibr_soft_t pcibr_soft = pcibr_intr->bi_soft; + unsigned pcibr_int_bits = pcibr_intr->bi_ibits; + unsigned pcibr_int_bit; + + for (pcibr_int_bit = 0; pcibr_int_bit < 8; pcibr_int_bit++) + if (pcibr_int_bits & (1 << pcibr_int_bit)) + return xtalk_intr_cpu_get(pcibr_soft->bs_intr[pcibr_int_bit].bsi_xtalk_intr); + return 0; +} + +/* ===================================================================== + * INTERRUPT HANDLING + */ +void +pcibr_clearwidint(bridge_t *bridge) +{ + bridge->b_wid_int_upper = 0; + bridge->b_wid_int_lower = 0; +} + + +void +pcibr_setwidint(xtalk_intr_t intr) +{ + xwidgetnum_t targ = xtalk_intr_target_get(intr); + iopaddr_t addr = xtalk_intr_addr_get(intr); + xtalk_intr_vector_t vect = xtalk_intr_vector_get(intr); + widgetreg_t NEW_b_wid_int_upper, NEW_b_wid_int_lower; + widgetreg_t OLD_b_wid_int_upper, OLD_b_wid_int_lower; + + bridge_t *bridge = (bridge_t *)xtalk_intr_sfarg_get(intr); + + NEW_b_wid_int_upper = ( (0x000F0000 & (targ << 16)) | + XTALK_ADDR_TO_UPPER(addr)); + NEW_b_wid_int_lower = XTALK_ADDR_TO_LOWER(addr); + + OLD_b_wid_int_upper = bridge->b_wid_int_upper; + OLD_b_wid_int_lower = bridge->b_wid_int_lower; + + /* Verify that all interrupts from this Bridge are using a single PI */ + if ((OLD_b_wid_int_upper != 0) && (OLD_b_wid_int_lower != 0)) { + /* + * Once set, these registers shouldn't change; they should + * be set multiple times with the same values. + * + * If we're attempting to change these registers, it means + * that our heuristics for allocating interrupts in a way + * appropriate for IP35 have failed, and the admin needs to + * explicitly direct some interrupts (or we need to make the + * heuristics more clever). + * + * In practice, we hope this doesn't happen very often, if + * at all. + */ + if ((OLD_b_wid_int_upper != NEW_b_wid_int_upper) || + (OLD_b_wid_int_lower != NEW_b_wid_int_lower)) { + printk(KERN_WARNING "Interrupt allocation is too complex.\n"); + printk(KERN_WARNING "Use explicit administrative interrupt targetting.\n"); + printk(KERN_WARNING "bridge=0x%lx targ=0x%x\n", (unsigned long)bridge, targ); + printk(KERN_WARNING "NEW=0x%x/0x%x OLD=0x%x/0x%x\n", + NEW_b_wid_int_upper, NEW_b_wid_int_lower, + OLD_b_wid_int_upper, OLD_b_wid_int_lower); + PRINT_PANIC("PCI Bridge interrupt targetting error\n"); + } + } + + bridge->b_wid_int_upper = NEW_b_wid_int_upper; + bridge->b_wid_int_lower = NEW_b_wid_int_lower; + bridge->b_int_host_err = vect; +} + +/* + * pcibr_intr_preset: called during mlreset time + * if the platform specific code needs to route + * one of the Bridge's xtalk interrupts before the + * xtalk infrastructure is available. + */ +void +pcibr_xintr_preset(void *which_widget, + int which_widget_intr, + xwidgetnum_t targ, + iopaddr_t addr, + xtalk_intr_vector_t vect) +{ + bridge_t *bridge = (bridge_t *) which_widget; + + if (which_widget_intr == -1) { + /* bridge widget error interrupt */ + bridge->b_wid_int_upper = ( (0x000F0000 & (targ << 16)) | + XTALK_ADDR_TO_UPPER(addr)); + bridge->b_wid_int_lower = XTALK_ADDR_TO_LOWER(addr); + bridge->b_int_host_err = vect; + + /* turn on all interrupts except + * the PCI interrupt requests, + * at least at heart. + */ + bridge->b_int_enable |= ~BRIDGE_IMR_INT_MSK; + + } else { + /* routing a PCI device interrupt. + * targ and low 38 bits of addr must + * be the same as the already set + * value for the widget error interrupt. + */ + bridge->b_int_addr[which_widget_intr].addr = + ((BRIDGE_INT_ADDR_HOST & (addr >> 30)) | + (BRIDGE_INT_ADDR_FLD & vect)); + /* + * now bridge can let it through; + * NB: still should be blocked at + * xtalk provider end, until the service + * function is set. + */ + bridge->b_int_enable |= 1 << vect; + } + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ +} + + +/* + * pcibr_intr_func() + * + * This is the pcibr interrupt "wrapper" function that is called, + * in interrupt context, to initiate the interrupt handler(s) registered + * (via pcibr_intr_alloc/connect) for the occuring interrupt. Non-threaded + * handlers will be called directly, and threaded handlers will have their + * thread woken up. + */ +void +pcibr_intr_func(intr_arg_t arg) +{ + pcibr_intr_wrap_t wrap = (pcibr_intr_wrap_t) arg; + reg_p wrbf; + pcibr_intr_t intr; + pcibr_intr_list_t list; + int clearit; + int do_nonthreaded = 1; + int is_threaded = 0; + int x = 0; + + /* + * If any handler is still running from a previous interrupt + * just return. If there's a need to call the handler(s) again, + * another interrupt will be generated either by the device or by + * pcibr_force_interrupt(). + */ + + if (wrap->iw_hdlrcnt) { + return; + } + + /* + * Call all interrupt handlers registered. + * First, the pcibr_intrd threads for any threaded handlers will be + * awoken, then any non-threaded handlers will be called sequentially. + */ + + clearit = 1; + while (do_nonthreaded) { + for (list = wrap->iw_list; list != NULL; list = list->il_next) { + if ((intr = list->il_intr) && + (intr->bi_flags & PCIIO_INTR_CONNECTED)) { + + /* + * This device may have initiated write + * requests since the bridge last saw + * an edge on this interrupt input; flushing + * the buffer prior to invoking the handler + * should help but may not be sufficient if we + * get more requests after the flush, followed + * by the card deciding it wants service, before + * the interrupt handler checks to see if things need + * to be done. + * + * There is a similar race condition if + * an interrupt handler loops around and + * notices further service is required. + * Perhaps we need to have an explicit + * call that interrupt handlers need to + * do between noticing that DMA to memory + * has completed, but before observing the + * contents of memory? + */ + + if ((do_nonthreaded) && (!is_threaded)) { + /* Non-threaded. + * Call the interrupt handler at interrupt level + */ + + /* Only need to flush write buffers if sharing */ + + if ((wrap->iw_shared) && (wrbf = list->il_wrbf)) { + if ((x = *wrbf)) /* write request buffer flush */ +#ifdef SUPPORT_PRINTING_V_FORMAT + printk(KERN_ALERT "pcibr_intr_func %v: \n" + "write buffer flush failed, wrbf=0x%x\n", + list->il_intr->bi_dev, wrbf); +#else + printk(KERN_ALERT "pcibr_intr_func %p: \n" + "write buffer flush failed, wrbf=0x%lx\n", + (void *)list->il_intr->bi_dev, (long) wrbf); +#endif + } + } + + clearit = 0; + } + } + + do_nonthreaded = 0; + /* + * If the non-threaded handler was the last to complete, + * (i.e., no threaded handlers still running) force an + * interrupt to avoid a potential deadlock situation. + */ + if (wrap->iw_hdlrcnt == 0) { + pcibr_force_interrupt(wrap); + } + } + + /* If there were no handlers, + * disable the interrupt and return. + * It will get enabled again after + * a handler is connected. + * If we don't do this, we would + * sit here and spin through the + * list forever. + */ + if (clearit) { + pcibr_soft_t pcibr_soft = wrap->iw_soft; + bridge_t *bridge = pcibr_soft->bs_base; + bridgereg_t b_int_enable; + bridgereg_t mask = 1 << wrap->iw_intr; + unsigned long s; + + s = pcibr_lock(pcibr_soft); + b_int_enable = bridge->b_int_enable; + b_int_enable &= ~mask; + bridge->b_int_enable = b_int_enable; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + pcibr_unlock(pcibr_soft, s); + return; + } +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_rrb.c lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_rrb.c --- linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_rrb.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_rrb.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,896 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void do_pcibr_rrb_clear(bridge_t *, int); +void do_pcibr_rrb_flush(bridge_t *, int); +int do_pcibr_rrb_count_valid(bridge_t *, pciio_slot_t); +int do_pcibr_rrb_count_avail(bridge_t *, pciio_slot_t); +int do_pcibr_rrb_alloc(bridge_t *, pciio_slot_t, int); +int do_pcibr_rrb_free(bridge_t *, pciio_slot_t, int); + +void do_pcibr_rrb_autoalloc(pcibr_soft_t, int, int); + +int pcibr_wrb_flush(devfs_handle_t); +int pcibr_rrb_alloc(devfs_handle_t, int *, int *); +int pcibr_rrb_check(devfs_handle_t, int *, int *, int *, int *); +int pcibr_alloc_all_rrbs(devfs_handle_t, int, int, int, int, int, int, int, int, int); +void pcibr_rrb_flush(devfs_handle_t); +int pcibr_slot_initial_rrb_alloc(devfs_handle_t,pciio_slot_t); + +/* + * RRB Management + */ + +#define LSBIT(word) ((word) &~ ((word)-1)) + +void +do_pcibr_rrb_clear(bridge_t *bridge, int rrb) +{ + bridgereg_t status; + + /* bridge_lock must be held; + * this RRB must be disabled. + */ + + /* wait until RRB has no outstanduing XIO packets. */ + while ((status = bridge->b_resp_status) & BRIDGE_RRB_INUSE(rrb)) { + ; /* XXX- beats on bridge. bad idea? */ + } + + /* if the RRB has data, drain it. */ + if (status & BRIDGE_RRB_VALID(rrb)) { + bridge->b_resp_clear = BRIDGE_RRB_CLEAR(rrb); + + /* wait until RRB is no longer valid. */ + while ((status = bridge->b_resp_status) & BRIDGE_RRB_VALID(rrb)) { + ; /* XXX- beats on bridge. bad idea? */ + } + } +} + +void +do_pcibr_rrb_flush(bridge_t *bridge, int rrbn) +{ + reg_p rrbp = &bridge->b_rrb_map[rrbn & 1].reg; + bridgereg_t rrbv; + int shft = 4 * (rrbn >> 1); + unsigned ebit = BRIDGE_RRB_EN << shft; + + rrbv = *rrbp; + if (rrbv & ebit) + *rrbp = rrbv & ~ebit; + + do_pcibr_rrb_clear(bridge, rrbn); + + if (rrbv & ebit) + *rrbp = rrbv; +} + +/* + * pcibr_rrb_count_valid: count how many RRBs are + * marked valid for the specified PCI slot on this + * bridge. + * + * NOTE: The "slot" parameter for all pcibr_rrb + * management routines must include the "virtual" + * bit; when manageing both the normal and the + * virtual channel, separate calls to these + * routines must be made. To denote the virtual + * channel, add PCIBR_RRB_SLOT_VIRTUAL to the slot + * number. + * + * IMPL NOTE: The obvious algorithm is to iterate + * through the RRB fields, incrementing a count if + * the RRB is valid and matches the slot. However, + * it is much simpler to use an algorithm derived + * from the "partitioned add" idea. First, XOR in a + * pattern such that the fields that match this + * slot come up "all ones" and all other fields + * have zeros in the mismatching bits. Then AND + * together the bits in the field, so we end up + * with one bit turned on for each field that + * matched. Now we need to count these bits. This + * can be done either with a series of shift/add + * instructions or by using "tmp % 15"; I expect + * that the cascaded shift/add will be faster. + */ + +int +do_pcibr_rrb_count_valid(bridge_t *bridge, + pciio_slot_t slot) +{ + bridgereg_t tmp; + + tmp = bridge->b_rrb_map[slot & 1].reg; + tmp ^= 0x11111111 * (7 - slot / 2); + tmp &= (0xCCCCCCCC & tmp) >> 2; + tmp &= (0x22222222 & tmp) >> 1; + tmp += tmp >> 4; + tmp += tmp >> 8; + tmp += tmp >> 16; + return tmp & 15; +} + +/* + * do_pcibr_rrb_count_avail: count how many RRBs are + * available to be allocated for the specified slot. + * + * IMPL NOTE: similar to the above, except we are + * just counting how many fields have the valid bit + * turned off. + */ +int +do_pcibr_rrb_count_avail(bridge_t *bridge, + pciio_slot_t slot) +{ + bridgereg_t tmp; + + tmp = bridge->b_rrb_map[slot & 1].reg; + tmp = (0x88888888 & ~tmp) >> 3; + tmp += tmp >> 4; + tmp += tmp >> 8; + tmp += tmp >> 16; + return tmp & 15; +} + +/* + * do_pcibr_rrb_alloc: allocate some additional RRBs + * for the specified slot. Returns -1 if there were + * insufficient free RRBs to satisfy the request, + * or 0 if the request was fulfilled. + * + * Note that if a request can be partially filled, + * it will be, even if we return failure. + * + * IMPL NOTE: again we avoid iterating across all + * the RRBs; instead, we form up a word containing + * one bit for each free RRB, then peel the bits + * off from the low end. + */ +int +do_pcibr_rrb_alloc(bridge_t *bridge, + pciio_slot_t slot, + int more) +{ + int rv = 0; + bridgereg_t reg, tmp, bit; + + reg = bridge->b_rrb_map[slot & 1].reg; + tmp = (0x88888888 & ~reg) >> 3; + while (more-- > 0) { + bit = LSBIT(tmp); + if (!bit) { + rv = -1; + break; + } + tmp &= ~bit; + reg = ((reg & ~(bit * 15)) | (bit * (8 + slot / 2))); + } + bridge->b_rrb_map[slot & 1].reg = reg; + return rv; +} + +/* + * do_pcibr_rrb_free: release some of the RRBs that + * have been allocated for the specified + * slot. Returns zero for success, or negative if + * it was unable to free that many RRBs. + * + * IMPL NOTE: We form up a bit for each RRB + * allocated to the slot, aligned with the VALID + * bitfield this time; then we peel bits off one at + * a time, releasing the corresponding RRB. + */ +int +do_pcibr_rrb_free(bridge_t *bridge, + pciio_slot_t slot, + int less) +{ + int rv = 0; + bridgereg_t reg, tmp, clr, bit; + int i; + + clr = 0; + reg = bridge->b_rrb_map[slot & 1].reg; + + /* This needs to be done otherwise the rrb's on the virtual channel + * for this slot won't be freed !! + */ + tmp = reg & 0xbbbbbbbb; + + tmp ^= (0x11111111 * (7 - slot / 2)); + tmp &= (0x33333333 & tmp) << 2; + tmp &= (0x44444444 & tmp) << 1; + while (less-- > 0) { + bit = LSBIT(tmp); + if (!bit) { + rv = -1; + break; + } + tmp &= ~bit; + reg &= ~bit; + clr |= bit; + } + bridge->b_rrb_map[slot & 1].reg = reg; + + for (i = 0; i < 8; i++) + if (clr & (8 << (4 * i))) + do_pcibr_rrb_clear(bridge, (2 * i) + (slot & 1)); + + return rv; +} + +void +do_pcibr_rrb_autoalloc(pcibr_soft_t pcibr_soft, + int slot, + int more_rrbs) +{ + bridge_t *bridge = pcibr_soft->bs_base; + int got; + + for (got = 0; got < more_rrbs; ++got) { + if (pcibr_soft->bs_rrb_res[slot & 7] > 0) + pcibr_soft->bs_rrb_res[slot & 7]--; + else if (pcibr_soft->bs_rrb_avail[slot & 1] > 0) + pcibr_soft->bs_rrb_avail[slot & 1]--; + else + break; + if (do_pcibr_rrb_alloc(bridge, slot, 1) < 0) + break; +#if PCIBR_RRB_DEBUG + printk("do_pcibr_rrb_autoalloc: add one to slot %d%s\n", + slot & 7, slot & 8 ? "v" : ""); +#endif + pcibr_soft->bs_rrb_valid[slot]++; + } +#if PCIBR_RRB_DEBUG + printk("%s: %d+%d free RRBs. Allocation list:\n", pcibr_soft->bs_name, + pcibr_soft->bs_rrb_avail[0], + pcibr_soft->bs_rrb_avail[1]); + for (slot = 0; slot < 8; ++slot) + printk("\t%d+%d+%d", + 0xFFF & pcibr_soft->bs_rrb_valid[slot], + 0xFFF & pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL], + pcibr_soft->bs_rrb_res[slot]); + printk("\n"); +#endif +} + +/* + * Device driver interface to flush the write buffers for a specified + * device hanging off the bridge. + */ +int +pcibr_wrb_flush(devfs_handle_t pconn_vhdl) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + bridge_t *bridge = pcibr_soft->bs_base; + volatile bridgereg_t *wrb_flush; + + wrb_flush = &(bridge->b_wr_req_buf[pciio_slot].reg); + while (*wrb_flush); + + return(0); +} + +/* + * Device driver interface to request RRBs for a specified device + * hanging off a Bridge. The driver requests the total number of + * RRBs it would like for the normal channel (vchan0) and for the + * "virtual channel" (vchan1). The actual number allocated to each + * channel is returned. + * + * If we cannot allocate at least one RRB to a channel that needs + * at least one, return -1 (failure). Otherwise, satisfy the request + * as best we can and return 0. + */ +int +pcibr_rrb_alloc(devfs_handle_t pconn_vhdl, + int *count_vchan0, + int *count_vchan1) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + bridge_t *bridge = pcibr_soft->bs_base; + int desired_vchan0; + int desired_vchan1; + int orig_vchan0; + int orig_vchan1; + int delta_vchan0; + int delta_vchan1; + int final_vchan0; + int final_vchan1; + int avail_rrbs; + int res_rrbs; + unsigned long s; + int error; + + /* + * TBD: temper request with admin info about RRB allocation, + * and according to demand from other devices on this Bridge. + * + * One way of doing this would be to allocate two RRBs + * for each device on the bus, before any drivers start + * asking for extras. This has the weakness that one + * driver might not give back an "extra" RRB until after + * another driver has already failed to get one that + * it wanted. + */ + + s = pcibr_lock(pcibr_soft); + + /* Save the boot-time RRB configuration for this slot */ + if (pcibr_soft->bs_rrb_valid_dflt[pciio_slot] < 0) { + pcibr_soft->bs_rrb_valid_dflt[pciio_slot] = + pcibr_soft->bs_rrb_valid[pciio_slot]; + pcibr_soft->bs_rrb_valid_dflt[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL] = + pcibr_soft->bs_rrb_valid[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL]; + pcibr_soft->bs_rrb_res_dflt[pciio_slot] = + pcibr_soft->bs_rrb_res[pciio_slot]; + + } + + /* How many RRBs do we own? */ + orig_vchan0 = pcibr_soft->bs_rrb_valid[pciio_slot]; + orig_vchan1 = pcibr_soft->bs_rrb_valid[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL]; + + /* How many RRBs do we want? */ + desired_vchan0 = count_vchan0 ? *count_vchan0 : orig_vchan0; + desired_vchan1 = count_vchan1 ? *count_vchan1 : orig_vchan1; + + /* How many RRBs are free? */ + avail_rrbs = pcibr_soft->bs_rrb_avail[pciio_slot & 1] + + pcibr_soft->bs_rrb_res[pciio_slot]; + + /* Figure desired deltas */ + delta_vchan0 = desired_vchan0 - orig_vchan0; + delta_vchan1 = desired_vchan1 - orig_vchan1; + + /* Trim back deltas to something + * that we can actually meet, by + * decreasing the ending allocation + * for whichever channel wants + * more RRBs. If both want the same + * number, cut the second channel. + * NOTE: do not change the allocation for + * a channel that was passed as NULL. + */ + while ((delta_vchan0 + delta_vchan1) > avail_rrbs) { + if (count_vchan0 && + (!count_vchan1 || + ((orig_vchan0 + delta_vchan0) > + (orig_vchan1 + delta_vchan1)))) + delta_vchan0--; + else + delta_vchan1--; + } + + /* Figure final RRB allocations + */ + final_vchan0 = orig_vchan0 + delta_vchan0; + final_vchan1 = orig_vchan1 + delta_vchan1; + + /* If either channel wants RRBs but our actions + * would leave it with none, declare an error, + * but DO NOT change any RRB allocations. + */ + if ((desired_vchan0 && !final_vchan0) || + (desired_vchan1 && !final_vchan1)) { + + error = -1; + + } else { + + /* Commit the allocations: free, then alloc. + */ + if (delta_vchan0 < 0) + (void) do_pcibr_rrb_free(bridge, pciio_slot, -delta_vchan0); + if (delta_vchan1 < 0) + (void) do_pcibr_rrb_free(bridge, PCIBR_RRB_SLOT_VIRTUAL + pciio_slot, -delta_vchan1); + + if (delta_vchan0 > 0) + (void) do_pcibr_rrb_alloc(bridge, pciio_slot, delta_vchan0); + if (delta_vchan1 > 0) + (void) do_pcibr_rrb_alloc(bridge, PCIBR_RRB_SLOT_VIRTUAL + pciio_slot, delta_vchan1); + + /* Return final values to caller. + */ + if (count_vchan0) + *count_vchan0 = final_vchan0; + if (count_vchan1) + *count_vchan1 = final_vchan1; + + /* prevent automatic changes to this slot's RRBs + */ + pcibr_soft->bs_rrb_fixed |= 1 << pciio_slot; + + /* Track the actual allocations, release + * any further reservations, and update the + * number of available RRBs. + */ + + pcibr_soft->bs_rrb_valid[pciio_slot] = final_vchan0; + pcibr_soft->bs_rrb_valid[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL] = final_vchan1; + pcibr_soft->bs_rrb_avail[pciio_slot & 1] = + pcibr_soft->bs_rrb_avail[pciio_slot & 1] + + pcibr_soft->bs_rrb_res[pciio_slot] + - delta_vchan0 + - delta_vchan1; + pcibr_soft->bs_rrb_res[pciio_slot] = 0; + + /* + * Reserve enough RRBs so this slot's RRB configuration can be + * reset to its boot-time default following a hot-plug shut-down + */ + res_rrbs = (pcibr_soft->bs_rrb_valid_dflt[pciio_slot] - + pcibr_soft->bs_rrb_valid[pciio_slot]) + + (pcibr_soft->bs_rrb_valid_dflt[pciio_slot + + PCIBR_RRB_SLOT_VIRTUAL] - + pcibr_soft->bs_rrb_valid[pciio_slot + + PCIBR_RRB_SLOT_VIRTUAL]) + + (pcibr_soft->bs_rrb_res_dflt[pciio_slot] - + pcibr_soft->bs_rrb_res[pciio_slot]); + + if (res_rrbs > 0) { + pcibr_soft->bs_rrb_res[pciio_slot] = res_rrbs; + pcibr_soft->bs_rrb_avail[pciio_slot & 1] = + pcibr_soft->bs_rrb_avail[pciio_slot & 1] + - res_rrbs; + } + +#if PCIBR_RRB_DEBUG + printk("pcibr_rrb_alloc: slot %d set to %d+%d; %d+%d free\n", + pciio_slot, final_vchan0, final_vchan1, + pcibr_soft->bs_rrb_avail[0], + pcibr_soft->bs_rrb_avail[1]); + for (pciio_slot = 0; pciio_slot < 8; ++pciio_slot) + printk("\t%d+%d+%d", + 0xFFF & pcibr_soft->bs_rrb_valid[pciio_slot], + 0xFFF & pcibr_soft->bs_rrb_valid[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL], + pcibr_soft->bs_rrb_res[pciio_slot]); + printk("\n"); +#endif + + error = 0; + } + + pcibr_unlock(pcibr_soft, s); + + return error; +} + +/* + * Device driver interface to check the current state + * of the RRB allocations. + * + * pconn_vhdl is your PCI connection point (specifies which + * PCI bus and which slot). + * + * count_vchan0 points to where to return the number of RRBs + * assigned to the primary DMA channel, used by all DMA + * that does not explicitly ask for the alternate virtual + * channel. + * + * count_vchan1 points to where to return the number of RRBs + * assigned to the secondary DMA channel, used when + * PCIBR_VCHAN1 and PCIIO_DMA_A64 are specified. + * + * count_reserved points to where to return the number of RRBs + * that have been automatically reserved for your device at + * startup, but which have not been assigned to a + * channel. RRBs must be assigned to a channel to be used; + * this can be done either with an explicit pcibr_rrb_alloc + * call, or automatically by the infrastructure when a DMA + * translation is constructed. Any call to pcibr_rrb_alloc + * will release any unassigned reserved RRBs back to the + * free pool. + * + * count_pool points to where to return the number of RRBs + * that are currently unassigned and unreserved. This + * number can (and will) change as other drivers make calls + * to pcibr_rrb_alloc, or automatically allocate RRBs for + * DMA beyond their initial reservation. + * + * NULL may be passed for any of the return value pointers + * the caller is not interested in. + * + * The return value is "0" if all went well, or "-1" if + * there is a problem. Additionally, if the wrong vertex + * is passed in, one of the subsidiary support functions + * could panic with a "bad pciio fingerprint." + */ + +int +pcibr_rrb_check(devfs_handle_t pconn_vhdl, + int *count_vchan0, + int *count_vchan1, + int *count_reserved, + int *count_pool) +{ + pciio_info_t pciio_info; + pciio_slot_t pciio_slot; + pcibr_soft_t pcibr_soft; + unsigned long s; + int error = -1; + + if ((pciio_info = pciio_info_get(pconn_vhdl)) && + (pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info)) && + ((pciio_slot = pciio_info_slot_get(pciio_info)) < 8)) { + + s = pcibr_lock(pcibr_soft); + + if (count_vchan0) + *count_vchan0 = + pcibr_soft->bs_rrb_valid[pciio_slot]; + + if (count_vchan1) + *count_vchan1 = + pcibr_soft->bs_rrb_valid[pciio_slot + PCIBR_RRB_SLOT_VIRTUAL]; + + if (count_reserved) + *count_reserved = + pcibr_soft->bs_rrb_res[pciio_slot]; + + if (count_pool) + *count_pool = + pcibr_soft->bs_rrb_avail[pciio_slot & 1]; + + error = 0; + + pcibr_unlock(pcibr_soft, s); + } + return error; +} + +/* pcibr_alloc_all_rrbs allocates all the rrbs available in the quantities + * requested for each of the devices. The evn_odd argument indicates whether + * allocation is for the odd or even rrbs. The next group of four argument + * pairs indicate the amount of rrbs to be assigned to each device. The first + * argument of each pair indicate the total number of rrbs to allocate for that + * device. The second argument of each pair indicates how many rrb's from the + * first argument should be assigned to the virtual channel. The total of all + * of the first arguments should be <= 8. The second argument should be <= the + * first argument. + * if even_odd = 0 the devices in order are 0, 2, 4, 6 + * if even_odd = 1 the devices in order are 1, 3, 5, 7 + * returns 0 if no errors else returns -1 + */ + +int +pcibr_alloc_all_rrbs(devfs_handle_t vhdl, int even_odd, + int dev_1_rrbs, int virt1, int dev_2_rrbs, int virt2, + int dev_3_rrbs, int virt3, int dev_4_rrbs, int virt4) +{ + devfs_handle_t pcibr_vhdl; + pcibr_soft_t pcibr_soft = (pcibr_soft_t)0; + bridge_t *bridge = NULL; + + uint32_t rrb_setting = 0; + int rrb_shift = 7; + uint32_t cur_rrb; + int dev_rrbs[4]; + int virt[4]; + int i, j; + unsigned long s; + + if (GRAPH_SUCCESS == + hwgraph_traverse(vhdl, EDGE_LBL_PCI, &pcibr_vhdl)) { + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + if (pcibr_soft) + bridge = pcibr_soft->bs_base; + hwgraph_vertex_unref(pcibr_vhdl); + } + if (bridge == NULL) + bridge = (bridge_t *) xtalk_piotrans_addr + (vhdl, NULL, 0, sizeof(bridge_t), 0); + + even_odd &= 1; + + dev_rrbs[0] = dev_1_rrbs; + dev_rrbs[1] = dev_2_rrbs; + dev_rrbs[2] = dev_3_rrbs; + dev_rrbs[3] = dev_4_rrbs; + + virt[0] = virt1; + virt[1] = virt2; + virt[2] = virt3; + virt[3] = virt4; + + if ((dev_1_rrbs + dev_2_rrbs + dev_3_rrbs + dev_4_rrbs) > 8) { + return -1; + } + if ((dev_1_rrbs < 0) || (dev_2_rrbs < 0) || (dev_3_rrbs < 0) || (dev_4_rrbs < 0)) { + return -1; + } + /* walk through rrbs */ + for (i = 0; i < 4; i++) { + if (virt[i]) { + for( j = 0; j < virt[i]; j++) { + cur_rrb = i | 0xc; + cur_rrb = cur_rrb << (rrb_shift * 4); + rrb_shift--; + rrb_setting = rrb_setting | cur_rrb; + dev_rrbs[i] = dev_rrbs[i] - 1; + } + } + for (j = 0; j < dev_rrbs[i]; j++) { + cur_rrb = i | 0x8; + cur_rrb = cur_rrb << (rrb_shift * 4); + rrb_shift--; + rrb_setting = rrb_setting | cur_rrb; + } + } + + if (pcibr_soft) + s = pcibr_lock(pcibr_soft); + + bridge->b_rrb_map[even_odd].reg = rrb_setting; + + if (pcibr_soft) { + + pcibr_soft->bs_rrb_fixed |= 0x55 << even_odd; + + /* since we've "FIXED" the allocations + * for these slots, we probably can dispense + * with tracking avail/res/valid data, but + * keeping it up to date helps debugging. + */ + + pcibr_soft->bs_rrb_avail[even_odd] = + 8 - (dev_1_rrbs + dev_2_rrbs + dev_3_rrbs + dev_4_rrbs); + + pcibr_soft->bs_rrb_res[even_odd + 0] = 0; + pcibr_soft->bs_rrb_res[even_odd + 2] = 0; + pcibr_soft->bs_rrb_res[even_odd + 4] = 0; + pcibr_soft->bs_rrb_res[even_odd + 6] = 0; + + pcibr_soft->bs_rrb_valid[even_odd + 0] = dev_1_rrbs - virt1; + pcibr_soft->bs_rrb_valid[even_odd + 2] = dev_2_rrbs - virt2; + pcibr_soft->bs_rrb_valid[even_odd + 4] = dev_3_rrbs - virt3; + pcibr_soft->bs_rrb_valid[even_odd + 6] = dev_4_rrbs - virt4; + + pcibr_soft->bs_rrb_valid[even_odd + 0 + PCIBR_RRB_SLOT_VIRTUAL] = virt1; + pcibr_soft->bs_rrb_valid[even_odd + 2 + PCIBR_RRB_SLOT_VIRTUAL] = virt2; + pcibr_soft->bs_rrb_valid[even_odd + 4 + PCIBR_RRB_SLOT_VIRTUAL] = virt3; + pcibr_soft->bs_rrb_valid[even_odd + 6 + PCIBR_RRB_SLOT_VIRTUAL] = virt4; + + pcibr_unlock(pcibr_soft, s); + } + return 0; +} + +/* + * pcibr_rrb_flush: chase down all the RRBs assigned + * to the specified connection point, and flush + * them. + */ +void +pcibr_rrb_flush(devfs_handle_t pconn_vhdl) +{ + pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); + pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); + pciio_slot_t pciio_slot = pciio_info_slot_get(pciio_info); + bridge_t *bridge = pcibr_soft->bs_base; + unsigned long s; + reg_p rrbp; + unsigned rrbm; + int i; + int rrbn; + unsigned sval; + unsigned mask; + + sval = BRIDGE_RRB_EN | (pciio_slot >> 1); + mask = BRIDGE_RRB_EN | BRIDGE_RRB_PDEV; + rrbn = pciio_slot & 1; + rrbp = &bridge->b_rrb_map[rrbn].reg; + + s = pcibr_lock(pcibr_soft); + rrbm = *rrbp; + for (i = 0; i < 8; ++i) { + if ((rrbm & mask) == sval) + do_pcibr_rrb_flush(bridge, rrbn); + rrbm >>= 4; + rrbn += 2; + } + pcibr_unlock(pcibr_soft, s); +} + +/* + * pcibr_slot_initial_rrb_alloc + * Allocate a default number of rrbs for this slot on + * the two channels. This is dictated by the rrb allocation + * strategy routine defined per platform. + */ + +int +pcibr_slot_initial_rrb_alloc(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + bridge_t *bridge; + int c0, c1, r; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + bridge = pcibr_soft->bs_base; + + /* How may RRBs are on this slot? + */ + c0 = do_pcibr_rrb_count_valid(bridge, slot); + c1 = do_pcibr_rrb_count_valid(bridge, slot + PCIBR_RRB_SLOT_VIRTUAL); + +#if PCIBR_RRB_DEBUG + printk( + "pcibr_slot_initial_rrb_alloc: slot %d started with %d+%d\n", + slot, c0, c1); +#endif + + /* Do we really need any? + */ + pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; + pcibr_info = pcibr_infoh[0]; + if ((pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) && + !pcibr_soft->bs_slot[slot].has_host) { + if (c0 > 0) + do_pcibr_rrb_free(bridge, slot, c0); + if (c1 > 0) + do_pcibr_rrb_free(bridge, slot + PCIBR_RRB_SLOT_VIRTUAL, c1); + pcibr_soft->bs_rrb_valid[slot] = 0x1000; + pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL] = 0x1000; + return(ENODEV); + } + + pcibr_soft->bs_rrb_avail[slot & 1] -= c0 + c1; + pcibr_soft->bs_rrb_valid[slot] = c0; + pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL] = c1; + + pcibr_soft->bs_rrb_avail[0] = do_pcibr_rrb_count_avail(bridge, 0); + pcibr_soft->bs_rrb_avail[1] = do_pcibr_rrb_count_avail(bridge, 1); + + r = 3 - (c0 + c1); + + if (r > 0) { + pcibr_soft->bs_rrb_res[slot] = r; + pcibr_soft->bs_rrb_avail[slot & 1] -= r; + } + +#if PCIBR_RRB_DEBUG + printk("\t%d+%d+%d", + 0xFFF & pcibr_soft->bs_rrb_valid[slot], + 0xFFF & pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL], + pcibr_soft->bs_rrb_res[slot]); + printk("\n"); +#endif + + return(0); +} + +/* + * pcibr_initial_rrb + * Assign an equal total number of RRBs to all candidate slots, + * where the total is the sum of the number of RRBs assigned to + * the normal channel, the number of RRBs assigned to the virtual + * channel, and the number of RRBs assigned as reserved. + * + * A candidate slot is a populated slot on a non-SN1 system or + * any existing (populated or empty) slot on an SN1 system. + * Empty SN1 slots need RRBs to support hot-plug operations. + */ + +int +pcibr_initial_rrb(devfs_handle_t pcibr_vhdl, + pciio_slot_t first, pciio_slot_t last) +{ + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); + bridge_t *bridge = pcibr_soft->bs_base; + pciio_slot_t slot; + int c0, c1; + int have[2][3]; + int res[2]; + int eo; + + have[0][0] = have[0][1] = have[0][2] = 0; + have[1][0] = have[1][1] = have[1][2] = 0; + res[0] = res[1] = 0; + + for (slot = 0; slot < 8; ++slot) { + /* Initial RRB management; give back RRBs in all non-existent slots */ + (void) pcibr_slot_initial_rrb_alloc(pcibr_vhdl, slot); + + /* Base calculations only on existing slots */ + if ((slot >= first) && (slot <= last)) { + c0 = pcibr_soft->bs_rrb_valid[slot]; + c1 = pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL]; + if ((c0 + c1) < 3) + have[slot & 1][c0 + c1]++; + } + } + + /* Initialize even/odd slot available RRB counts */ + pcibr_soft->bs_rrb_avail[0] = do_pcibr_rrb_count_avail(bridge, 0); + pcibr_soft->bs_rrb_avail[1] = do_pcibr_rrb_count_avail(bridge, 1); + + /* + * Calculate reserved RRBs for slots based on current RRB usage + */ + for (eo = 0; eo < 2; eo++) { + if ((3 * have[eo][0] + 2 * have[eo][1] + have[eo][2]) <= pcibr_soft->bs_rrb_avail[eo]) + res[eo] = 3; + else if ((2 * have[eo][0] + have[eo][1]) <= pcibr_soft->bs_rrb_avail[eo]) + res[eo] = 2; + else if (have[eo][0] <= pcibr_soft->bs_rrb_avail[eo]) + res[eo] = 1; + else + res[eo] = 0; + + } + + /* Assign reserved RRBs to existing slots */ + for (slot = first; slot <= last; ++slot) { + int r; + + c0 = pcibr_soft->bs_rrb_valid[slot]; + c1 = pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL]; + r = res[slot & 1] - (c0 + c1); + + if (r > 0) { + pcibr_soft->bs_rrb_res[slot] = r; + pcibr_soft->bs_rrb_avail[slot & 1] -= r; + } + } + +#if PCIBR_RRB_DEBUG + printk("%v RRB MANAGEMENT: %d+%d free\n", + pcibr_vhdl, + pcibr_soft->bs_rrb_avail[0], + pcibr_soft->bs_rrb_avail[1]); + for (slot = first; slot <= last; ++slot) + printk("\tslot %d: %d+%d+%d", slot, + 0xFFF & pcibr_soft->bs_rrb_valid[slot], + 0xFFF & pcibr_soft->bs_rrb_valid[slot + PCIBR_RRB_SLOT_VIRTUAL], + pcibr_soft->bs_rrb_res[slot]); + printk("\n"); +#endif + + return 0; + +} + diff -urN linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c --- linux-2.4.18/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c Tue Feb 26 13:19:35 2002 @@ -0,0 +1,1692 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern pcibr_info_t pcibr_info_get(devfs_handle_t); +extern int pcibr_widget_to_bus(int); +extern pcibr_info_t pcibr_device_info_new(pcibr_soft_t, pciio_slot_t, pciio_function_t, pciio_vendor_id_t, pciio_device_id_t); +extern void pcibr_freeblock_sub(iopaddr_t *, iopaddr_t *, iopaddr_t, size_t); +extern int pcibr_slot_initial_rrb_alloc(devfs_handle_t,pciio_slot_t); +#if 0 +int pcibr_slot_reset(devfs_handle_t pcibr_vhdl, pciio_slot_t slot); +#endif + +int pcibr_slot_info_init(devfs_handle_t pcibr_vhdl, pciio_slot_t slot); +int pcibr_slot_info_free(devfs_handle_t pcibr_vhdl, pciio_slot_t slot); +int pcibr_slot_addr_space_init(devfs_handle_t pcibr_vhdl, pciio_slot_t slot); +int pcibr_slot_device_init(devfs_handle_t pcibr_vhdl, pciio_slot_t slot); +int pcibr_slot_guest_info_init(devfs_handle_t pcibr_vhdl, pciio_slot_t slot); +int pcibr_slot_call_device_attach(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot, int drv_flags); +int pcibr_slot_call_device_detach(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot, int drv_flags); +int pcibr_slot_detach(devfs_handle_t pcibr_vhdl, pciio_slot_t slot, int drv_flags); +int pcibr_is_slot_sys_critical(devfs_handle_t pcibr_vhdl, pciio_slot_t slot); +int pcibr_probe_slot(bridge_t *, cfg_p, unsigned int *); +void pcibr_device_info_free(devfs_handle_t, pciio_slot_t); +extern uint64_t do_pcibr_config_get(cfg_p, unsigned, unsigned); + +#ifdef LATER +int pcibr_slot_attach(devfs_handle_t pcibr_vhdl, pciio_slot_t slot, + int drv_flags, char *l1_msg, int *sub_errorp); +int pcibr_slot_pwr(devfs_handle_t, pciio_slot_t, int, char *); +int pcibr_slot_startup(devfs_handle_t, pcibr_slot_req_t); +int pcibr_slot_shutdown(devfs_handle_t, pcibr_slot_req_t); +void pcibr_slot_func_info_return(pcibr_info_h pcibr_infoh, int func, + pcibr_slot_func_info_resp_t funcp); +int pcibr_slot_info_return(pcibr_soft_t pcibr_soft, pciio_slot_t slot, + pcibr_slot_info_resp_t respp); +int pcibr_slot_query(devfs_handle_t, pcibr_slot_req_t); +#endif /* LATER */ + +extern devfs_handle_t baseio_pci_vhdl; +int scsi_ctlr_nums_add(devfs_handle_t, devfs_handle_t); + +/* For now .... */ +/* + * PCI Hot-Plug Capability Flags + */ +#define D_PCI_HOT_PLUG_ATTACH 0x200 /* Driver supports PCI hot-plug attach */ +#define D_PCI_HOT_PLUG_DETACH 0x400 /* Driver supports PCI hot-plug detach */ + + +/*========================================================================== + * BRIDGE PCI SLOT RELATED IOCTLs + */ + +#ifdef LATER + +/* + * pcibr_slot_startup + * Software start-up the PCI slot. + */ +int +pcibr_slot_startup(devfs_handle_t pcibr_vhdl, pcibr_slot_req_t reqp) +{ + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); + pciio_slot_t slot = reqp->req_slot; + int error = 0; + char l1_msg[BRL1_QSIZE+1]; + struct pcibr_slot_up_resp_s tmp_up_resp; + + /* Make sure that we are dealing with a bridge device vertex */ + if (!pcibr_soft) { + return(PCI_NOT_A_BRIDGE); + } + + /* Do not allow start-up of a slot in a shoehorn */ + if(nic_vertex_info_match(pcibr_soft->bs_conn, XTALK_PCI_PART_NUM)) { + return(PCI_SLOT_IN_SHOEHORN); + } + + /* Check for the valid slot */ + if (!PCIBR_VALID_SLOT(slot)) + return(PCI_NOT_A_SLOT); + + /* Acquire update access to the bus */ + mrlock(pcibr_soft->bs_bus_lock, MR_UPDATE, PZERO); + + if (pcibr_soft->bs_slot[slot].slot_status & SLOT_STARTUP_CMPLT) { + error = PCI_SLOT_ALREADY_UP; + goto startup_unlock; + } + + error = pcibr_slot_attach(pcibr_vhdl, slot, D_PCI_HOT_PLUG_ATTACH, + l1_msg, &tmp_up_resp.resp_sub_errno); + + strncpy(tmp_up_resp.resp_l1_msg, l1_msg, L1_QSIZE); + tmp_up_resp.resp_l1_msg[L1_QSIZE] = '\0'; + + if (COPYOUT(&tmp_up_resp, reqp->req_respp.up, reqp->req_size)) { + return(EFAULT); + } + + startup_unlock: + + /* Release the bus lock */ + mrunlock(pcibr_soft->bs_bus_lock); + + return(error); +} + +/* + * pcibr_slot_shutdown + * Software shut-down the PCI slot + */ +int +pcibr_slot_shutdown(devfs_handle_t pcibr_vhdl, pcibr_slot_req_t reqp) +{ + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); + bridge_t *bridge; + pciio_slot_t slot = reqp->req_slot; + int error = 0; + char l1_msg[BRL1_QSIZE+1]; + struct pcibr_slot_down_resp_s tmp_down_resp; + pciio_slot_t tmp_slot; + + /* Make sure that we are dealing with a bridge device vertex */ + if (!pcibr_soft) { + return(PCI_NOT_A_BRIDGE); + } + + bridge = pcibr_soft->bs_base; + + /* Check for valid slot */ + if (!PCIBR_VALID_SLOT(slot)) + return(PCI_NOT_A_SLOT); + + /* Do not allow shut-down of a slot in a shoehorn */ + if(nic_vertex_info_match(pcibr_soft->bs_conn, XTALK_PCI_PART_NUM)) { + return(PCI_SLOT_IN_SHOEHORN); + } + + /* Acquire update access to the bus */ + mrlock(pcibr_soft->bs_bus_lock, MR_UPDATE, PZERO); + + if ((pcibr_soft->bs_slot[slot].slot_status & SLOT_SHUTDOWN_CMPLT) || + ((pcibr_soft->bs_slot[slot].slot_status & SLOT_STATUS_MASK) == 0)) { + error = PCI_SLOT_ALREADY_DOWN; + /* + * RJR - Should we invoke an L1 slot power-down command just in case + * a previous shut-down failed to power-down the slot? + */ + goto shutdown_unlock; + } + + /* Do not allow the last 33 MHz card to be removed */ + if ((bridge->b_wid_control & BRIDGE_CTRL_BUS_SPEED_MASK) == + BRIDGE_CTRL_BUS_SPEED_33) { + for (tmp_slot = pcibr_soft->bs_first_slot; + tmp_slot <= pcibr_soft->bs_last_slot; tmp_slot++) + if (tmp_slot != slot) + if (pcibr_soft->bs_slot[tmp_slot].slot_status & SLOT_POWER_UP) { + error++; + break; + } + if (!error) { + error = PCI_EMPTY_33MHZ; + goto shutdown_unlock; + } + } + + error = pcibr_slot_detach(pcibr_vhdl, slot, D_PCI_HOT_PLUG_DETACH, + l1_msg, &tmp_down_resp.resp_sub_errno); + + strncpy(tmp_down_resp.resp_l1_msg, l1_msg, L1_QSIZE); + tmp_down_resp.resp_l1_msg[L1_QSIZE] = '\0'; + + if (COPYOUT(&tmp_down_resp, reqp->req_respp.down, reqp->req_size)) { + return(EFAULT); + } + + shutdown_unlock: + + /* Release the bus lock */ + mrunlock(pcibr_soft->bs_bus_lock); + + return(error); +} + +char *pci_space_name[] = {"NONE", + "ROM", + "IO", + "", + "MEM", + "MEM32", + "MEM64", + "CFG", + "WIN0", + "WIN1", + "WIN2", + "WIN3", + "WIN4", + "WIN5", + "", + "BAD"}; + +void +pcibr_slot_func_info_return(pcibr_info_h pcibr_infoh, + int func, + pcibr_slot_func_info_resp_t funcp) +{ + pcibr_info_t pcibr_info = pcibr_infoh[func]; + int win; + + funcp->resp_f_status = 0; + + if (!pcibr_info) { + return; + } + + funcp->resp_f_status |= FUNC_IS_VALID; + sprintf(funcp->resp_f_slot_name, "%v", pcibr_info->f_vertex); + + if(is_sys_critical_vertex(pcibr_info->f_vertex)) { + funcp->resp_f_status |= FUNC_IS_SYS_CRITICAL; + } + + funcp->resp_f_bus = pcibr_info->f_bus; + funcp->resp_f_slot = pcibr_info->f_slot; + funcp->resp_f_func = pcibr_info->f_func; + sprintf(funcp->resp_f_master_name, "%v", pcibr_info->f_master); + funcp->resp_f_pops = pcibr_info->f_pops; + funcp->resp_f_efunc = pcibr_info->f_efunc; + funcp->resp_f_einfo = pcibr_info->f_einfo; + + funcp->resp_f_vendor = pcibr_info->f_vendor; + funcp->resp_f_device = pcibr_info->f_device; + + for(win = 0 ; win < 6 ; win++) { + funcp->resp_f_window[win].resp_w_base = + pcibr_info->f_window[win].w_base; + funcp->resp_f_window[win].resp_w_size = + pcibr_info->f_window[win].w_size; + sprintf(funcp->resp_f_window[win].resp_w_space, + "%s", + pci_space_name[pcibr_info->f_window[win].w_space]); + } + + funcp->resp_f_rbase = pcibr_info->f_rbase; + funcp->resp_f_rsize = pcibr_info->f_rsize; + + for (win = 0 ; win < 4; win++) { + funcp->resp_f_ibit[win] = pcibr_info->f_ibit[win]; + } + + funcp->resp_f_att_det_error = pcibr_info->f_att_det_error; + +} + +int +pcibr_slot_info_return(pcibr_soft_t pcibr_soft, + pciio_slot_t slot, + pcibr_slot_info_resp_t respp) +{ + pcibr_soft_slot_t pss; + int func; + bridge_t *bridge = pcibr_soft->bs_base; + reg_p b_respp; + pcibr_slot_info_resp_t slotp; + pcibr_slot_func_info_resp_t funcp; + + slotp = kmem_zalloc(sizeof(*slotp), KM_SLEEP); + if (slotp == NULL) { + return(ENOMEM); + } + + pss = &pcibr_soft->bs_slot[slot]; + + slotp->resp_has_host = pss->has_host; + slotp->resp_host_slot = pss->host_slot; + sprintf(slotp->resp_slot_conn_name, "%v", pss->slot_conn); + slotp->resp_slot_status = pss->slot_status; + + slotp->resp_l1_bus_num = io_path_map_widget(pcibr_soft->bs_vhdl); + + if (is_sys_critical_vertex(pss->slot_conn)) { + slotp->resp_slot_status |= SLOT_IS_SYS_CRITICAL; + } + + slotp->resp_bss_ninfo = pss->bss_ninfo; + + for (func = 0; func < pss->bss_ninfo; func++) { + funcp = &(slotp->resp_func[func]); + pcibr_slot_func_info_return(pss->bss_infos, func, funcp); + } + + sprintf(slotp->resp_bss_devio_bssd_space, "%s", + pci_space_name[pss->bss_devio.bssd_space]); + slotp->resp_bss_devio_bssd_base = pss->bss_devio.bssd_base; + slotp->resp_bss_device = pss->bss_device; + + slotp->resp_bss_pmu_uctr = pss->bss_pmu_uctr; + slotp->resp_bss_d32_uctr = pss->bss_d32_uctr; + slotp->resp_bss_d64_uctr = pss->bss_d64_uctr; + + slotp->resp_bss_d64_base = pss->bss_d64_base; + slotp->resp_bss_d64_flags = pss->bss_d64_flags; + slotp->resp_bss_d32_base = pss->bss_d32_base; + slotp->resp_bss_d32_flags = pss->bss_d32_flags; + + slotp->resp_bss_ext_ates_active = pss->bss_ext_ates_active; + + slotp->resp_bss_cmd_pointer = pss->bss_cmd_pointer; + slotp->resp_bss_cmd_shadow = pss->bss_cmd_shadow; + + slotp->resp_bs_rrb_valid = pcibr_soft->bs_rrb_valid[slot]; + slotp->resp_bs_rrb_valid_v = pcibr_soft->bs_rrb_valid[slot + + PCIBR_RRB_SLOT_VIRTUAL]; + slotp->resp_bs_rrb_res = pcibr_soft->bs_rrb_res[slot]; + + if (slot & 1) { + b_respp = &bridge->b_odd_resp; + } else { + b_respp = &bridge->b_even_resp; + } + + slotp->resp_b_resp = *b_respp; + + slotp->resp_b_wid_control = bridge->b_wid_control; + slotp->resp_b_int_device = bridge->b_int_device; + slotp->resp_b_int_enable = bridge->b_int_enable; + slotp->resp_b_int_host = bridge->b_int_addr[slot].addr; + + if (COPYOUT(slotp, respp, sizeof(*respp))) { + return(EFAULT); + } + + kmem_free(slotp, sizeof(*slotp)); + + return(0); +} + +/* + * pcibr_slot_query + * Return information about the PCI slot maintained by the infrastructure. + * Information is requested in the request structure. + * + * Information returned in the response structure: + * Slot hwgraph name + * Vendor/Device info + * Base register info + * Interrupt mapping from device pins to the bridge pins + * Devio register + * Software RRB info + * RRB register info + * Host/Gues info + * PCI Bus #,slot #, function # + * Slot provider hwgraph name + * Provider Functions + * Error handler + * DMA mapping usage counters + * DMA direct translation info + * External SSRAM workaround info + */ +int +pcibr_slot_query(devfs_handle_t pcibr_vhdl, pcibr_slot_req_t reqp) +{ + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); + pciio_slot_t slot = reqp->req_slot; + pciio_slot_t tmp_slot; + pcibr_slot_info_resp_t respp = reqp->req_respp.query; + int size = reqp->req_size; + int error; + + /* Make sure that we are dealing with a bridge device vertex */ + if (!pcibr_soft) { + return(PCI_NOT_A_BRIDGE); + } + + /* Make sure that we have a valid PCI slot number or PCIIO_SLOT_NONE */ + if ((!PCIBR_VALID_SLOT(slot)) && (slot != PCIIO_SLOT_NONE)) { + return(PCI_NOT_A_SLOT); + } + + /* Do not allow a query of a slot in a shoehorn */ + if(nic_vertex_info_match(pcibr_soft->bs_conn, XTALK_PCI_PART_NUM)) { + return(PCI_SLOT_IN_SHOEHORN); + } + + /* Return information for the requested PCI slot */ + if (slot != PCIIO_SLOT_NONE) { + if (size < sizeof(*respp)) { + return(PCI_RESP_AREA_TOO_SMALL); + } + + /* Acquire read access to the bus */ + mrlock(pcibr_soft->bs_bus_lock, MR_ACCESS, PZERO); + + error = pcibr_slot_info_return(pcibr_soft, slot, respp); + + /* Release the bus lock */ + mrunlock(pcibr_soft->bs_bus_lock); + + return(error); + } + + /* Return information for all the slots */ + for (tmp_slot = 0; tmp_slot < 8; tmp_slot++) { + + if (size < sizeof(*respp)) { + return(PCI_RESP_AREA_TOO_SMALL); + } + + /* Acquire read access to the bus */ + mrlock(pcibr_soft->bs_bus_lock, MR_ACCESS, PZERO); + + error = pcibr_slot_info_return(pcibr_soft, tmp_slot, respp); + + /* Release the bus lock */ + mrunlock(pcibr_soft->bs_bus_lock); + + if (error) { + return(error); + } + + ++respp; + size -= sizeof(*respp); + } + + return(error); +} +#endif /* LATER */ + +/* FIXME: there should be a better way to do this. + * pcibr_attach() needs PCI_ADDR_SPACE_LIMITS_STORE + */ + +/* + * PCI_ADDR_SPACE_LIMITS_LOAD + * Gets the current values of + * pci io base, + * pci io last, + * pci low memory base, + * pci low memory last, + * pci high memory base, + * pci high memory last + */ +#define PCI_ADDR_SPACE_LIMITS_LOAD() \ + pci_io_fb = pcibr_soft->bs_spinfo.pci_io_base; \ + pci_io_fl = pcibr_soft->bs_spinfo.pci_io_last; \ + pci_lo_fb = pcibr_soft->bs_spinfo.pci_swin_base; \ + pci_lo_fl = pcibr_soft->bs_spinfo.pci_swin_last; \ + pci_hi_fb = pcibr_soft->bs_spinfo.pci_mem_base; \ + pci_hi_fl = pcibr_soft->bs_spinfo.pci_mem_last; +/* + * PCI_ADDR_SPACE_LIMITS_STORE + * Sets the current values of + * pci io base, + * pci io last, + * pci low memory base, + * pci low memory last, + * pci high memory base, + * pci high memory last + */ +#define PCI_ADDR_SPACE_LIMITS_STORE() \ + pcibr_soft->bs_spinfo.pci_io_base = pci_io_fb; \ + pcibr_soft->bs_spinfo.pci_io_last = pci_io_fl; \ + pcibr_soft->bs_spinfo.pci_swin_base = pci_lo_fb; \ + pcibr_soft->bs_spinfo.pci_swin_last = pci_lo_fl; \ + pcibr_soft->bs_spinfo.pci_mem_base = pci_hi_fb; \ + pcibr_soft->bs_spinfo.pci_mem_last = pci_hi_fl; + +#define PCI_ADDR_SPACE_LIMITS_PRINT() \ + printf("+++++++++++++++++++++++\n" \ + "IO base 0x%x last 0x%x\n" \ + "SWIN base 0x%x last 0x%x\n" \ + "MEM base 0x%x last 0x%x\n" \ + "+++++++++++++++++++++++\n", \ + pcibr_soft->bs_spinfo.pci_io_base, \ + pcibr_soft->bs_spinfo.pci_io_last, \ + pcibr_soft->bs_spinfo.pci_swin_base, \ + pcibr_soft->bs_spinfo.pci_swin_last, \ + pcibr_soft->bs_spinfo.pci_mem_base, \ + pcibr_soft->bs_spinfo.pci_mem_last); + + +/* + * pcibr_slot_info_init + * Probe for this slot and see if it is populated. + * If it is populated initialize the generic PCI infrastructural + * information associated with this particular PCI device. + */ +int +pcibr_slot_info_init(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + bridge_t *bridge; + cfg_p cfgw; + unsigned idword; + unsigned pfail; + unsigned idwords[8]; + pciio_vendor_id_t vendor; + pciio_device_id_t device; + unsigned htype; + cfg_p wptr; + int win; + pciio_space_t space; + iopaddr_t pci_io_fb, pci_io_fl; + iopaddr_t pci_lo_fb, pci_lo_fl; + iopaddr_t pci_hi_fb, pci_hi_fl; + int nfunc; + pciio_function_t rfunc; + int func; + devfs_handle_t conn_vhdl; + pcibr_soft_slot_t slotp; + + /* Get the basic software information required to proceed */ + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + if (!pcibr_soft) + return(EINVAL); + + bridge = pcibr_soft->bs_base; + if (!PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + /* If we have a host slot (eg:- IOC3 has 2 PCI slots and the initialization + * is done by the host slot then we are done. + */ + if (pcibr_soft->bs_slot[slot].has_host) { + return(0); + } + + /* Check for a slot with any system critical functions */ + if (pcibr_is_slot_sys_critical(pcibr_vhdl, slot)) + return(EPERM); + + /* Load the current values of allocated PCI address spaces */ + PCI_ADDR_SPACE_LIMITS_LOAD(); + + /* Try to read the device-id/vendor-id from the config space */ + cfgw = bridge->b_type0_cfg_dev[slot].l; + + if (pcibr_probe_slot(bridge, cfgw, &idword)) + return(ENODEV); + + slotp = &pcibr_soft->bs_slot[slot]; + slotp->slot_status |= SLOT_POWER_UP; + + vendor = 0xFFFF & idword; + /* If the vendor id is not valid then the slot is not populated + * and we are done. + */ + if (vendor == 0xFFFF) + return(ENODEV); + + device = 0xFFFF & (idword >> 16); + htype = do_pcibr_config_get(cfgw, PCI_CFG_HEADER_TYPE, 1); + + nfunc = 1; + rfunc = PCIIO_FUNC_NONE; + pfail = 0; + + /* NOTE: if a card claims to be multifunction + * but only responds to config space 0, treat + * it as a unifunction card. + */ + + if (htype & 0x80) { /* MULTIFUNCTION */ + for (func = 1; func < 8; ++func) { + cfgw = bridge->b_type0_cfg_dev[slot].f[func].l; + if (pcibr_probe_slot(bridge, cfgw, &idwords[func])) { + pfail |= 1 << func; + continue; + } + vendor = 0xFFFF & idwords[func]; + if (vendor == 0xFFFF) { + pfail |= 1 << func; + continue; + } + nfunc = func + 1; + rfunc = 0; + } + cfgw = bridge->b_type0_cfg_dev[slot].l; + } + NEWA(pcibr_infoh, nfunc); + + pcibr_soft->bs_slot[slot].bss_ninfo = nfunc; + pcibr_soft->bs_slot[slot].bss_infos = pcibr_infoh; + + for (func = 0; func < nfunc; ++func) { + unsigned cmd_reg; + + if (func) { + if (pfail & (1 << func)) + continue; + + idword = idwords[func]; + cfgw = bridge->b_type0_cfg_dev[slot].f[func].l; + + device = 0xFFFF & (idword >> 16); + htype = do_pcibr_config_get(cfgw, PCI_CFG_HEADER_TYPE, 1); + rfunc = func; + } + htype &= 0x7f; + if (htype != 0x00) { + printk(KERN_WARNING "%s pcibr: pci slot %d func %d has strange header type 0x%x\n", + pcibr_soft->bs_name, slot, func, htype); + continue; + } +#if DEBUG && ATTACH_DEBUG + printk(KERN_NOTICE + "%s pcibr: pci slot %d func %d: vendor 0x%x device 0x%x", + pcibr_soft->bs_name, slot, func, vendor, device); +#endif + + pcibr_info = pcibr_device_info_new + (pcibr_soft, slot, rfunc, vendor, device); + conn_vhdl = pciio_device_info_register(pcibr_vhdl, &pcibr_info->f_c); + if (func == 0) + slotp->slot_conn = conn_vhdl; + +#ifdef SN1_LITTLE_ENDIAN + cmd_reg = cfgw[(PCI_CFG_COMMAND ^ 4) / 4]; +#else + cmd_reg = cfgw[PCI_CFG_COMMAND / 4]; +#endif + + wptr = cfgw + PCI_CFG_BASE_ADDR_0 / 4; + + for (win = 0; win < PCI_CFG_BASE_ADDRS; ++win) { + iopaddr_t base, mask, code; + size_t size; + + /* + * GET THE BASE & SIZE OF THIS WINDOW: + * + * The low two or four bits of the BASE register + * determines which address space we are in; the + * rest is a base address. BASE registers + * determine windows that are power-of-two sized + * and naturally aligned, so we can get the size + * of a window by writing all-ones to the + * register, reading it back, and seeing which + * bits are used for decode; the least + * significant nonzero bit is also the size of + * the window. + * + * WARNING: someone may already have allocated + * some PCI space to this window, and in fact + * PIO may be in process at this very moment + * from another processor (or even from this + * one, if we get interrupted)! So, if the BASE + * already has a nonzero address, be generous + * and use the LSBit of that address as the + * size; this could overstate the window size. + * Usually, when one card is set up, all are set + * up; so, since we don't bitch about + * overlapping windows, we are ok. + * + * UNFORTUNATELY, some cards do not clear their + * BASE registers on reset. I have two heuristics + * that can detect such cards: first, if the + * decode enable is turned off for the space + * that the window uses, we can disregard the + * initial value. second, if the address is + * outside the range that we use, we can disregard + * it as well. + * + * This is looking very PCI generic. Except for + * knowing how many slots and where their config + * spaces are, this window loop and the next one + * could probably be shared with other PCI host + * adapters. It would be interesting to see if + * this could be pushed up into pciio, when we + * start supporting more PCI providers. + */ +#ifdef SN1_LITTLE_ENDIAN + base = wptr[((win*4)^4)/4]; +#else + base = wptr[win]; +#endif + + if (base & PCI_BA_IO_SPACE) { + /* BASE is in I/O space. */ + space = PCIIO_SPACE_IO; + mask = -4; + code = base & 3; + base = base & mask; + if (base == 0) { + ; /* not assigned */ + } else if (!(cmd_reg & PCI_CMD_IO_SPACE)) { + base = 0; /* decode not enabled */ + } + } else { + /* BASE is in MEM space. */ + space = PCIIO_SPACE_MEM; + mask = -16; + code = base & PCI_BA_MEM_LOCATION; /* extract BAR type */ + base = base & mask; + if (base == 0) { + ; /* not assigned */ + } else if (!(cmd_reg & PCI_CMD_MEM_SPACE)) { + base = 0; /* decode not enabled */ + } else if (base & 0xC0000000) { + base = 0; /* outside permissable range */ + } else if ((code == PCI_BA_MEM_64BIT) && +#ifdef SN1_LITTLE_ENDIAN + (wptr[(((win + 1)*4)^4)/4] != 0)) { +#else + (wptr[win + 1] != 0)) { +#endif /* LITTLE_ENDIAN */ + base = 0; /* outside permissable range */ + } + } + + if (base != 0) { /* estimate size */ + size = base & -base; + } else { /* calculate size */ +#ifdef SN1_LITTLE_ENDIAN + wptr[((win*4)^4)/4] = ~0; /* turn on all bits */ + size = wptr[((win*4)^4)/4]; /* get stored bits */ +#else + wptr[win] = ~0; /* turn on all bits */ + size = wptr[win]; /* get stored bits */ +#endif /* LITTLE_ENDIAN */ + size &= mask; /* keep addr */ + size &= -size; /* keep lsbit */ + if (size == 0) + continue; + } + + pcibr_info->f_window[win].w_space = space; + pcibr_info->f_window[win].w_base = base; + pcibr_info->f_window[win].w_size = size; + + /* + * If this window already has PCI space + * allocated for it, "subtract" that space from + * our running freeblocks. Don't worry about + * overlaps in existing allocated windows; we + * may be overstating their sizes anyway. + */ + + if (base && size) { + if (space == PCIIO_SPACE_IO) { + pcibr_freeblock_sub(&pci_io_fb, + &pci_io_fl, + base, size); + } else { + pcibr_freeblock_sub(&pci_lo_fb, + &pci_lo_fl, + base, size); + pcibr_freeblock_sub(&pci_hi_fb, + &pci_hi_fl, + base, size); + } + } +#if defined(IOC3_VENDOR_ID_NUM) && defined(IOC3_DEVICE_ID_NUM) + /* + * IOC3 BASE_ADDR* BUG WORKAROUND + * + + * If we write to BASE1 on the IOC3, the + * data in BASE0 is replaced. The + * original workaround was to remember + * the value of BASE0 and restore it + * when we ran off the end of the BASE + * registers; however, a later + * workaround was added (I think it was + * rev 1.44) to avoid setting up + * anything but BASE0, with the comment + * that writing all ones to BASE1 set + * the enable-parity-error test feature + * in IOC3's SCR bit 14. + * + * So, unless we defer doing any PCI + * space allocation until drivers + * attach, and set up a way for drivers + * (the IOC3 in paricular) to tell us + * generically to keep our hands off + * BASE registers, we gotta "know" about + * the IOC3 here. + * + * Too bad the PCI folks didn't reserve the + * all-zero value for 'no BASE here' (it is a + * valid code for an uninitialized BASE in + * 32-bit PCI memory space). + */ + + if ((vendor == IOC3_VENDOR_ID_NUM) && + (device == IOC3_DEVICE_ID_NUM)) + break; +#endif + if (code == PCI_BA_MEM_64BIT) { + win++; /* skip upper half */ +#ifdef SN1_LITTLE_ENDIAN + wptr[((win*4)^4)/4] = 0; /* which must be zero */ +#else + wptr[win] = 0; /* which must be zero */ +#endif /* LITTLE_ENDIAN */ + } + } /* next win */ + } /* next func */ + + /* Store back the values for allocated PCI address spaces */ + PCI_ADDR_SPACE_LIMITS_STORE(); + return(0); +} + +/* + * pcibr_slot_info_free + * Remove all the PCI infrastructural information associated + * with a particular PCI device. + */ +int +pcibr_slot_info_free(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + int nfunc; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; + + pcibr_device_info_free(pcibr_vhdl, slot); + + pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; + DELA(pcibr_infoh,nfunc); + pcibr_soft->bs_slot[slot].bss_ninfo = 0; + + return(0); +} + +int as_debug = 0; +/* + * pcibr_slot_addr_space_init + * Reserve chunks of PCI address space as required by + * the base registers in the card. + */ +int +pcibr_slot_addr_space_init(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + bridge_t *bridge; + iopaddr_t pci_io_fb, pci_io_fl; + iopaddr_t pci_lo_fb, pci_lo_fl; + iopaddr_t pci_hi_fb, pci_hi_fl; + size_t align; + iopaddr_t mask; + int nbars; + int nfunc; + int func; + int win; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + bridge = pcibr_soft->bs_base; + + /* Get the current values for the allocated PCI address spaces */ + PCI_ADDR_SPACE_LIMITS_LOAD(); + + if (as_debug) +#ifdef LATER + PCI_ADDR_SPACE_LIMITS_PRINT(); +#endif + + /* allocate address space, + * for windows that have not been + * previously assigned. + */ + if (pcibr_soft->bs_slot[slot].has_host) { + return(0); + } + + nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; + if (nfunc < 1) + return(EINVAL); + + pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; + if (!pcibr_infoh) + return(EINVAL); + + /* + * Try to make the DevIO windows not + * overlap by pushing the "io" and "hi" + * allocation areas up to the next one + * or two megabyte bound. This also + * keeps them from being zero. + * + * DO NOT do this with "pci_lo" since + * the entire "lo" area is only a + * megabyte, total ... + */ + align = (slot < 2) ? 0x200000 : 0x100000; + mask = -align; + pci_io_fb = (pci_io_fb + align - 1) & mask; + pci_hi_fb = (pci_hi_fb + align - 1) & mask; + + for (func = 0; func < nfunc; ++func) { + cfg_p cfgw; + cfg_p wptr; + pciio_space_t space; + iopaddr_t base; + size_t size; + cfg_p pci_cfg_cmd_reg_p; + unsigned pci_cfg_cmd_reg; + unsigned pci_cfg_cmd_reg_add = 0; + + pcibr_info = pcibr_infoh[func]; + + if (!pcibr_info) + continue; + + if (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) + continue; + + cfgw = bridge->b_type0_cfg_dev[slot].f[func].l; + wptr = cfgw + PCI_CFG_BASE_ADDR_0 / 4; + + nbars = PCI_CFG_BASE_ADDRS; + + for (win = 0; win < nbars; ++win) { + + space = pcibr_info->f_window[win].w_space; + base = pcibr_info->f_window[win].w_base; + size = pcibr_info->f_window[win].w_size; + + if (size < 1) + continue; + + if (base >= size) { +#if DEBUG && PCI_DEBUG + printk("pcibr: slot %d func %d window %d is in %d[0x%x..0x%x], alloc by prom\n", + slot, func, win, space, base, base + size - 1); +#endif + continue; /* already allocated */ + } + align = size; /* ie. 0x00001000 */ + if (align < _PAGESZ) + align = _PAGESZ; /* ie. 0x00004000 */ + mask = -align; /* ie. 0xFFFFC000 */ + + switch (space) { + case PCIIO_SPACE_IO: + base = (pci_io_fb + align - 1) & mask; + if ((base + size) > pci_io_fl) { + base = 0; + break; + } + pci_io_fb = base + size; + break; + + case PCIIO_SPACE_MEM: +#ifdef SN1_LITTLE_ENDIAN + if ((wptr[((win*4)^4)/4] & PCI_BA_MEM_LOCATION) == +#else + if ((wptr[win] & PCI_BA_MEM_LOCATION) == +#endif /* LITTLE_ENDIAN */ + PCI_BA_MEM_1MEG) { + /* allocate from 20-bit PCI space */ + base = (pci_lo_fb + align - 1) & mask; + if ((base + size) > pci_lo_fl) { + base = 0; + break; + } + pci_lo_fb = base + size; + } else { + /* allocate from 32-bit or 64-bit PCI space */ + base = (pci_hi_fb + align - 1) & mask; + if ((base + size) > pci_hi_fl) { + base = 0; + break; + } + pci_hi_fb = base + size; + } + break; + + default: + base = 0; +#if DEBUG && PCI_DEBUG + printk("pcibr: slot %d window %d had bad space code %d\n", + slot, win, space); +#endif + } + pcibr_info->f_window[win].w_base = base; +#ifdef SN1_LITTLE_ENDIAN + wptr[((win*4)^4)/4] = base; +#if DEBUG && PCI_DEBUG + printk("Setting base address 0x%p base 0x%x\n", &(wptr[((win*4)^4)/4]), base); +#endif +#else + wptr[win] = base; +#endif /* LITTLE_ENDIAN */ + +#if DEBUG && PCI_DEBUG + if (base >= size) + printk("pcibr: slot %d func %d window %d is in %d [0x%x..0x%x], alloc by pcibr\n", + slot, func, win, space, base, base + size - 1); + else + printk("pcibr: slot %d func %d window %d, unable to alloc 0x%x in 0x%p\n", + slot, func, win, size, space); +#endif + } /* next base */ + + /* + * Allocate space for the EXPANSION ROM + * NOTE: DO NOT DO THIS ON AN IOC3, + * as it blows the system away. + */ + base = size = 0; + if ((pcibr_soft->bs_slot[slot].bss_vendor_id != IOC3_VENDOR_ID_NUM) || + (pcibr_soft->bs_slot[slot].bss_device_id != IOC3_DEVICE_ID_NUM)) { + + wptr = cfgw + PCI_EXPANSION_ROM / 4; +#ifdef SN1_LITTLE_ENDIAN + wptr[1] = 0xFFFFF000; + mask = wptr[1]; +#else + *wptr = 0xFFFFF000; + mask = *wptr; +#endif /* LITTLE_ENDIAN */ + if (mask & 0xFFFFF000) { + size = mask & -mask; + align = size; + if (align < _PAGESZ) + align = _PAGESZ; + mask = -align; + base = (pci_hi_fb + align - 1) & mask; + if ((base + size) > pci_hi_fl) + base = size = 0; + else { + pci_hi_fb = base + size; +#ifdef SN1_LITTLE_ENDIAN + wptr[1] = base; +#else + *wptr = base; +#endif /* LITTLE_ENDIAN */ +#if DEBUG && PCI_DEBUG + printk("%s/%d ROM in 0x%lx..0x%lx (alloc by pcibr)\n", + pcibr_soft->bs_name, slot, + base, base + size - 1); +#endif + } + } + } + pcibr_info->f_rbase = base; + pcibr_info->f_rsize = size; + + /* + * if necessary, update the board's + * command register to enable decoding + * in the windows we added. + * + * There are some bits we always want to + * be sure are set. + */ + pci_cfg_cmd_reg_add |= PCI_CMD_IO_SPACE; + + /* + * The Adaptec 1160 FC Controller WAR #767995: + * The part incorrectly ignores the upper 32 bits of a 64 bit + * address when decoding references to it's registers so to + * keep it from responding to a bus cycle that it shouldn't + * we only use I/O space to get at it's registers. Don't + * enable memory space accesses on that PCI device. + */ + #define FCADP_VENDID 0x9004 /* Adaptec Vendor ID from fcadp.h */ + #define FCADP_DEVID 0x1160 /* Adaptec 1160 Device ID from fcadp.h */ + + if ((pcibr_info->f_vendor != FCADP_VENDID) || + (pcibr_info->f_device != FCADP_DEVID)) + pci_cfg_cmd_reg_add |= PCI_CMD_MEM_SPACE; + + pci_cfg_cmd_reg_add |= PCI_CMD_BUS_MASTER; + + pci_cfg_cmd_reg_p = cfgw + PCI_CFG_COMMAND / 4; + pci_cfg_cmd_reg = *pci_cfg_cmd_reg_p; +#if PCI_FBBE /* XXX- check here to see if dev can do fast-back-to-back */ + if (!((pci_cfg_cmd_reg >> 16) & PCI_STAT_F_BK_BK_CAP)) + fast_back_to_back_enable = 0; +#endif + pci_cfg_cmd_reg &= 0xFFFF; + if (pci_cfg_cmd_reg_add & ~pci_cfg_cmd_reg) + *pci_cfg_cmd_reg_p = pci_cfg_cmd_reg | pci_cfg_cmd_reg_add; + + } /* next func */ + + /* Now that we have allocated new chunks of PCI address spaces to this + * card we need to update the bookkeeping values which indicate + * the current PCI address space allocations. + */ + PCI_ADDR_SPACE_LIMITS_STORE(); + return(0); +} + +/* + * pcibr_slot_device_init + * Setup the device register in the bridge for this PCI slot. + */ +int +pcibr_slot_device_init(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + bridge_t *bridge; + bridgereg_t devreg; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + bridge = pcibr_soft->bs_base; + + /* + * Adjustments to Device(x) + * and init of bss_device shadow + */ + devreg = bridge->b_device[slot].reg; + devreg &= ~BRIDGE_DEV_PAGE_CHK_DIS; + devreg |= BRIDGE_DEV_COH | BRIDGE_DEV_VIRTUAL_EN; +#ifdef LITTLE_ENDIAN + devreg |= BRIDGE_DEV_DEV_SWAP; +#endif + pcibr_soft->bs_slot[slot].bss_device = devreg; + bridge->b_device[slot].reg = devreg; + +#if DEBUG && PCI_DEBUG + printk("pcibr Device(%d): 0x%lx\n", slot, bridge->b_device[slot].reg); +#endif + +#if DEBUG && PCI_DEBUG + printk("pcibr: PCI space allocation done.\n"); +#endif + + return(0); +} + +/* + * pcibr_slot_guest_info_init + * Setup the host/guest relations for a PCI slot. + */ +int +pcibr_slot_guest_info_init(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + pcibr_soft_slot_t slotp; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + slotp = &pcibr_soft->bs_slot[slot]; + + /* create info and verticies for guest slots; + * for compatibilitiy macros, create info + * for even unpopulated slots (but do not + * build verticies for them). + */ + if (pcibr_soft->bs_slot[slot].bss_ninfo < 1) { + NEWA(pcibr_infoh, 1); + pcibr_soft->bs_slot[slot].bss_ninfo = 1; + pcibr_soft->bs_slot[slot].bss_infos = pcibr_infoh; + + pcibr_info = pcibr_device_info_new + (pcibr_soft, slot, PCIIO_FUNC_NONE, + PCIIO_VENDOR_ID_NONE, PCIIO_DEVICE_ID_NONE); + + if (pcibr_soft->bs_slot[slot].has_host) { + slotp->slot_conn = pciio_device_info_register + (pcibr_vhdl, &pcibr_info->f_c); + } + } + + /* generate host/guest relations + */ + if (pcibr_soft->bs_slot[slot].has_host) { + int host = pcibr_soft->bs_slot[slot].host_slot; + pcibr_soft_slot_t host_slotp = &pcibr_soft->bs_slot[host]; + + hwgraph_edge_add(slotp->slot_conn, + host_slotp->slot_conn, + EDGE_LBL_HOST); + + /* XXX- only gives us one guest edge per + * host. If/when we have a host with more than + * one guest, we will need to figure out how + * the host finds all its guests, and sorts + * out which one is which. + */ + hwgraph_edge_add(host_slotp->slot_conn, + slotp->slot_conn, + EDGE_LBL_GUEST); + } + + return(0); +} + + +/* + * pcibr_slot_call_device_attach + * This calls the associated driver attach routine for the PCI + * card in this slot. + */ +int +pcibr_slot_call_device_attach(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot, + int drv_flags) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + async_attach_t aa = NULL; + int func; + devfs_handle_t xconn_vhdl,conn_vhdl; + int nfunc; + int error_func; + int error_slot = 0; + int error = ENODEV; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + + if (pcibr_soft->bs_slot[slot].has_host) { + return(EPERM); + } + + xconn_vhdl = pcibr_soft->bs_conn; + aa = async_attach_get_info(xconn_vhdl); + + nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; + pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; + + for (func = 0; func < nfunc; ++func) { + + pcibr_info = pcibr_infoh[func]; + + if (!pcibr_info) + continue; + + if (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) + continue; + + conn_vhdl = pcibr_info->f_vertex; + +#ifdef LATER + /* + * Activate if and when we support cdl. + */ + if (aa) + async_attach_add_info(conn_vhdl, aa); +#endif /* LATER */ + + error_func = pciio_device_attach(conn_vhdl, drv_flags); + + pcibr_info->f_att_det_error = error_func; + + if (error_func) + error_slot = error_func; + + error = error_slot; + + } /* next func */ + + if (error) { + if ((error != ENODEV) && (error != EUNATCH)) + pcibr_soft->bs_slot[slot].slot_status |= SLOT_STARTUP_INCMPLT; + } else { + pcibr_soft->bs_slot[slot].slot_status |= SLOT_STARTUP_CMPLT; + } + + return(error); +} + +/* + * pcibr_slot_call_device_detach + * This calls the associated driver detach routine for the PCI + * card in this slot. + */ +int +pcibr_slot_call_device_detach(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot, + int drv_flags) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + int func; + devfs_handle_t conn_vhdl = GRAPH_VERTEX_NONE; + int nfunc; + int error_func; + int error_slot = 0; + int error = ENODEV; + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(EINVAL); + + if (pcibr_soft->bs_slot[slot].has_host) + return(EPERM); + + /* Make sure that we do not detach a system critical function vertex */ + if(pcibr_is_slot_sys_critical(pcibr_vhdl, slot)) + return(EPERM); + + nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; + pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; + + for (func = 0; func < nfunc; ++func) { + + pcibr_info = pcibr_infoh[func]; + + if (!pcibr_info) + continue; + + if (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) + continue; + + conn_vhdl = pcibr_info->f_vertex; + + error_func = pciio_device_detach(conn_vhdl, drv_flags); + + pcibr_info->f_att_det_error = error_func; + + if (error_func) + error_slot = error_func; + + error = error_slot; + + } /* next func */ + + pcibr_soft->bs_slot[slot].slot_status &= ~SLOT_STATUS_MASK; + + if (error) { + if ((error != ENODEV) && (error != EUNATCH)) + pcibr_soft->bs_slot[slot].slot_status |= SLOT_SHUTDOWN_INCMPLT; + } else { + if (conn_vhdl != GRAPH_VERTEX_NONE) + pcibr_device_unregister(conn_vhdl); + pcibr_soft->bs_slot[slot].slot_status |= SLOT_SHUTDOWN_CMPLT; + } + + return(error); +} + +#ifdef LATER + +/* + * pcibr_slot_attach + * This is a place holder routine to keep track of all the + * slot-specific initialization that needs to be done. + * This is usually called when we want to initialize a new + * PCI card on the bus. + */ +int +pcibr_slot_attach(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot, + int drv_flags, + char *l1_msg, + int *sub_errorp) +{ + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); + timespec_t ts; + int error; + + if (!(pcibr_soft->bs_slot[slot].slot_status & SLOT_POWER_UP)) { + /* Power-up the slot */ + error = pcibr_slot_pwr(pcibr_vhdl, slot, L1_REQ_PCI_UP, l1_msg); + if (error) { + if (sub_errorp) + *sub_errorp = error; + return(PCI_L1_ERR); + } else { + pcibr_soft->bs_slot[slot].slot_status &= ~SLOT_POWER_MASK; + pcibr_soft->bs_slot[slot].slot_status |= SLOT_POWER_UP; + } + +#ifdef LATER + /* + * Allow cards like the Alteon Gigabit Ethernet Adapter to complete + * on-card initialization following the slot reset + */ + ts.tv_sec = 0; /* 0 secs */ + ts.tv_nsec = 500 * (1000 * 1000); /* 500 msecs */ + nano_delay(&ts); +#else +#endif +#if 0 + /* Reset the slot */ + error = pcibr_slot_reset(pcibr_vhdl, slot) + if (error) { + if (sub_errorp) + *sub_errorp = error; + return(PCI_SLOT_RESET_ERR); + } +#endif + + /* Find out what is out there */ + error = pcibr_slot_info_init(pcibr_vhdl, slot); + if (error) { + if (sub_errorp) + *sub_errorp = error; + return(PCI_SLOT_INFO_INIT_ERR); + } + + /* Set up the address space for this slot in the PCI land */ + error = pcibr_slot_addr_space_init(pcibr_vhdl, slot); + if (error) { + if (sub_errorp) + *sub_errorp = error; + return(PCI_SLOT_ADDR_INIT_ERR); + } + + /* Setup the device register */ + error = pcibr_slot_device_init(pcibr_vhdl, slot); + if (error) { + if (sub_errorp) + *sub_errorp = error; + return(PCI_SLOT_DEV_INIT_ERR); + } + + /* Setup host/guest relations */ + error = pcibr_slot_guest_info_init(pcibr_vhdl, slot); + if (error) { + if (sub_errorp) + *sub_errorp = error; + return(PCI_SLOT_GUEST_INIT_ERR); + } + + /* Initial RRB management */ + error = pcibr_slot_initial_rrb_alloc(pcibr_vhdl, slot); + if (error) { + if (sub_errorp) + *sub_errorp = error; + return(PCI_SLOT_RRB_ALLOC_ERR); + } + + } + + /* Call the device attach */ + error = pcibr_slot_call_device_attach(pcibr_vhdl, slot, drv_flags); + if (error) { + if (sub_errorp) + *sub_errorp = error; + if (error == EUNATCH) + return(PCI_NO_DRIVER); + else + return(PCI_SLOT_DRV_ATTACH_ERR); + } + + return(0); +} +#endif /* LATER */ + +/* + * pcibr_slot_detach + * This is a place holder routine to keep track of all the + * slot-specific freeing that needs to be done. + */ +int +pcibr_slot_detach(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot, + int drv_flags) +{ + int error; + + /* Call the device detach function */ + error = (pcibr_slot_call_device_detach(pcibr_vhdl, slot, drv_flags)); + return (error); + +} + +/* + * pcibr_is_slot_sys_critical + * Check slot for any functions that are system critical. + * Return 1 if any are system critical or 0 otherwise. + * + * This function will always return 0 when called by + * pcibr_attach() because the system critical vertices + * have not yet been set in the hwgraph. + */ +int +pcibr_is_slot_sys_critical(devfs_handle_t pcibr_vhdl, + pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft; + pcibr_info_h pcibr_infoh; + pcibr_info_t pcibr_info; + devfs_handle_t conn_vhdl = GRAPH_VERTEX_NONE; + int nfunc; + int func; + boolean_t is_sys_critical_vertex(devfs_handle_t); + + pcibr_soft = pcibr_soft_get(pcibr_vhdl); + if (!pcibr_soft || !PCIBR_VALID_SLOT(slot)) + return(0); + + nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; + pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; + + for (func = 0; func < nfunc; ++func) { + + pcibr_info = pcibr_infoh[func]; + if (!pcibr_info) + continue; + + if (pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) + continue; + + conn_vhdl = pcibr_info->f_vertex; + if (is_sys_critical_vertex(conn_vhdl)) { +#if defined(SUPPORT_PRINTING_V_FORMAT) + printk(KERN_WARNING "%v is a system critical device vertex\n", conn_vhdl); +#else + printk(KERN_WARNING "%p is a system critical device vertex\n", (void *)conn_vhdl); +#endif + return(1); + } + + } + + return(0); +} + +/* + * pcibr_probe_slot: read a config space word + * while trapping any errors; reutrn zero if + * all went OK, or nonzero if there was an error. + * The value read, if any, is passed back + * through the valp parameter. + */ +int +pcibr_probe_slot(bridge_t *bridge, + cfg_p cfg, + unsigned *valp) +{ + int rv; + bridgereg_t old_enable, new_enable; + int badaddr_val(volatile void *, int, volatile void *); + + old_enable = bridge->b_int_enable; + new_enable = old_enable & ~BRIDGE_IMR_PCI_MST_TIMEOUT; + + bridge->b_int_enable = new_enable; + + /* + * The xbridge doesn't clear b_err_int_view unless + * multi-err is cleared... + */ + if (is_xbridge(bridge)) + if (bridge->b_err_int_view & BRIDGE_ISR_PCI_MST_TIMEOUT) { + bridge->b_int_rst_stat = BRIDGE_IRR_MULTI_CLR; + } + + if (bridge->b_int_status & BRIDGE_IRR_PCI_GRP) { + bridge->b_int_rst_stat = BRIDGE_IRR_PCI_GRP_CLR; + (void) bridge->b_wid_tflush; /* flushbus */ + } + rv = badaddr_val((void *) cfg, 4, valp); + + /* + * The xbridge doesn't set master timeout in b_int_status + * here. Fortunately it's in error_interrupt_view. + */ + if (is_xbridge(bridge)) + if (bridge->b_err_int_view & BRIDGE_ISR_PCI_MST_TIMEOUT) { + bridge->b_int_rst_stat = BRIDGE_IRR_MULTI_CLR; + rv = 1; /* unoccupied slot */ + } + + bridge->b_int_enable = old_enable; + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + + return rv; +} + +void +pcibr_device_info_free(devfs_handle_t pcibr_vhdl, pciio_slot_t slot) +{ + pcibr_soft_t pcibr_soft = pcibr_soft_get(pcibr_vhdl); + pcibr_info_t pcibr_info; + pciio_function_t func; + pcibr_soft_slot_t slotp = &pcibr_soft->bs_slot[slot]; + int nfunc = slotp->bss_ninfo; + int bar; + int devio_index; + int s; + + + for (func = 0; func < nfunc; func++) { + pcibr_info = slotp->bss_infos[func]; + + if (!pcibr_info) + continue; + + s = pcibr_lock(pcibr_soft); + + for (bar = 0; bar < PCI_CFG_BASE_ADDRS; bar++) { + if (pcibr_info->f_window[bar].w_space == PCIIO_SPACE_NONE) + continue; + + /* Get index of the DevIO(x) register used to access this BAR */ + devio_index = pcibr_info->f_window[bar].w_devio_index; + + + /* On last use, clear the DevIO(x) used to access this BAR */ + if (! --pcibr_soft->bs_slot[devio_index].bss_devio.bssd_ref_cnt) { + pcibr_soft->bs_slot[devio_index].bss_devio.bssd_space = + PCIIO_SPACE_NONE; + pcibr_soft->bs_slot[devio_index].bss_devio.bssd_base = + PCIBR_D32_BASE_UNSET; + pcibr_soft->bs_slot[devio_index].bss_device = 0; + } + } + + pcibr_unlock(pcibr_soft, s); + + slotp->bss_infos[func] = 0; + pciio_device_info_unregister(pcibr_vhdl, &pcibr_info->f_c); + pciio_device_info_free(&pcibr_info->f_c); + + DEL(pcibr_info); + } + + /* Reset the mapping usage counters */ + slotp->bss_pmu_uctr = 0; + slotp->bss_d32_uctr = 0; + slotp->bss_d64_uctr = 0; + + /* Clear the Direct translation info */ + slotp->bss_d64_base = PCIBR_D64_BASE_UNSET; + slotp->bss_d64_flags = 0; + slotp->bss_d32_base = PCIBR_D32_BASE_UNSET; + slotp->bss_d32_flags = 0; + + /* Clear out shadow info necessary for the external SSRAM workaround */ + slotp->bss_ext_ates_active = ATOMIC_INIT(0); + slotp->bss_cmd_pointer = 0; + slotp->bss_cmd_shadow = 0; + +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn2/shub_intr.c lia64-2.4/arch/ia64/sn/io/sn2/shub_intr.c --- linux-2.4.18/arch/ia64/sn/io/sn2/shub_intr.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn2/shub_intr.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,215 @@ +/* $Id: shub_intr.c,v 1.2 2001/06/26 14:02:43 pfg Exp $ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992-1997, 2000-2002 Silicon Graphics, Inc. All Rights Reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern void hub_device_desc_update(device_desc_t, ilvl_t, cpuid_t); + +/* ARGSUSED */ +void +hub_intr_init(devfs_handle_t hubv) +{ + extern void sn_cpei_handler(int, void *, struct pt_regs *); + extern void sn_init_cpei_timer(void); + + if (request_irq(SGI_SHUB_ERROR_VECTOR, sn_cpei_handler, 0, "SN hub error", NULL) ) { + printk("hub_intr_init: Couldn't register SGI_SHUB_ERROR_VECTOR = %x\n",SGI_SHUB_ERROR_VECTOR); + } + sn_init_cpei_timer(); +} + +xwidgetnum_t +hub_widget_id(nasid_t nasid) +{ + hubii_wcr_t ii_wcr; /* the control status register */ + + ii_wcr.wcr_reg_value = REMOTE_HUB_L(nasid,IIO_WCR); + + return ii_wcr.wcr_fields_s.wcr_widget_id; +} + +static hub_intr_t +do_hub_intr_alloc(devfs_handle_t dev, + device_desc_t dev_desc, + devfs_handle_t owner_dev, + int uncond_nothread) +{ + cpuid_t cpu = 0; + int vector; + hub_intr_t intr_hdl; + cnodeid_t cnode; + int cpuphys, slice; + int nasid; + iopaddr_t xtalk_addr; + struct xtalk_intr_s *xtalk_info; + xwidget_info_t xwidget_info; + ilvl_t intr_swlevel = 0; + + cpu = intr_heuristic(dev, dev_desc, -1, 0, owner_dev, NULL, &vector); + + if (cpu == CPU_NONE) { + printk("Unable to allocate interrupt for 0x%p\n", (void *)owner_dev); + return(0); + } + + cpuphys = cpu_physical_id(cpu); + slice = cpu_physical_id_to_slice(cpuphys); + nasid = cpu_physical_id_to_nasid(cpuphys); + cnode = cpuid_to_cnodeid(cpu); + + if (slice) { + xtalk_addr = SH_II_INT1 | GLOBAL_MMR_SPACE | + ((unsigned long)nasid << 36) | (1UL << 47); + } else { + xtalk_addr = SH_II_INT0 | GLOBAL_MMR_SPACE | + ((unsigned long)nasid << 36) | (1UL << 47); + } + + intr_hdl = snia_kmem_alloc_node(sizeof(struct hub_intr_s), KM_NOSLEEP, cnode); + ASSERT_ALWAYS(intr_hdl); + + xtalk_info = &intr_hdl->i_xtalk_info; + xtalk_info->xi_dev = dev; + xtalk_info->xi_vector = vector; + xtalk_info->xi_addr = xtalk_addr; + + xwidget_info = xwidget_info_get(dev); + if (xwidget_info) { + xtalk_info->xi_target = xwidget_info_masterid_get(xwidget_info); + } + + intr_hdl->i_swlevel = intr_swlevel; + intr_hdl->i_cpuid = cpu; + intr_hdl->i_bit = vector; + intr_hdl->i_flags |= HUB_INTR_IS_ALLOCED; + + hub_device_desc_update(dev_desc, intr_swlevel, cpu); + return(intr_hdl); +} + +hub_intr_t +hub_intr_alloc(devfs_handle_t dev, + device_desc_t dev_desc, + devfs_handle_t owner_dev) +{ + return(do_hub_intr_alloc(dev, dev_desc, owner_dev, 0)); +} + +hub_intr_t +hub_intr_alloc_nothd(devfs_handle_t dev, + device_desc_t dev_desc, + devfs_handle_t owner_dev) +{ + return(do_hub_intr_alloc(dev, dev_desc, owner_dev, 1)); +} + +void +hub_intr_free(hub_intr_t intr_hdl) +{ + cpuid_t cpu = intr_hdl->i_cpuid; + int vector = intr_hdl->i_bit; + xtalk_intr_t xtalk_info; + + if (intr_hdl->i_flags & HUB_INTR_IS_CONNECTED) { + xtalk_info = &intr_hdl->i_xtalk_info; + xtalk_info->xi_dev = NODEV; + xtalk_info->xi_vector = 0; + xtalk_info->xi_addr = 0; + hub_intr_disconnect(intr_hdl); + } + + if (intr_hdl->i_flags & HUB_INTR_IS_ALLOCED) { + kfree(intr_hdl); + } + intr_unreserve_level(cpu, vector); +} + +int +hub_intr_connect(hub_intr_t intr_hdl, + xtalk_intr_setfunc_t setfunc, + void *setfunc_arg) +{ + int rv; + cpuid_t cpu = intr_hdl->i_cpuid; + int vector = intr_hdl->i_bit; + + ASSERT(intr_hdl->i_flags & HUB_INTR_IS_ALLOCED); + + rv = intr_connect_level(cpu, vector, intr_hdl->i_swlevel, NULL); + + if (rv < 0) { + return rv; + } + + intr_hdl->i_xtalk_info.xi_setfunc = setfunc; + intr_hdl->i_xtalk_info.xi_sfarg = setfunc_arg; + + if (setfunc) { + (*setfunc)((xtalk_intr_t)intr_hdl); + } + + intr_hdl->i_flags |= HUB_INTR_IS_CONNECTED; + + return 0; +} + +/* + * Disassociate handler with the specified interrupt. + */ +void +hub_intr_disconnect(hub_intr_t intr_hdl) +{ + /*REFERENCED*/ + int rv; + cpuid_t cpu = intr_hdl->i_cpuid; + int bit = intr_hdl->i_bit; + xtalk_intr_setfunc_t setfunc; + + setfunc = intr_hdl->i_xtalk_info.xi_setfunc; + + /* TBD: send disconnected interrupts somewhere harmless */ + if (setfunc) (*setfunc)((xtalk_intr_t)intr_hdl); + + rv = intr_disconnect_level(cpu, bit); + ASSERT(rv == 0); + intr_hdl->i_flags &= ~HUB_INTR_IS_CONNECTED; +} + + +/* + * Return a hwgraph vertex that represents the CPU currently + * targeted by an interrupt. + */ +devfs_handle_t +hub_intr_cpu_get(hub_intr_t intr_hdl) +{ + cpuid_t cpuid = intr_hdl->i_cpuid; + + ASSERT(cpuid != CPU_NONE); + + return(cpuid_to_vertex(cpuid)); +} diff -urN linux-2.4.18/arch/ia64/sn/io/sn2/shuberror.c lia64-2.4/arch/ia64/sn/io/sn2/shuberror.c --- linux-2.4.18/arch/ia64/sn/io/sn2/shuberror.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/io/sn2/shuberror.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,478 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000,2002 Silicon Graphics, Inc. All rights reserved. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern void hubni_eint_init(cnodeid_t cnode); +extern void hubii_eint_init(cnodeid_t cnode); +extern void hubii_eint_handler (int irq, void *arg, struct pt_regs *ep); +int hubiio_crb_error_handler(devfs_handle_t hub_v, hubinfo_t hinfo); +int hubiio_prb_error_handler(devfs_handle_t hub_v, hubinfo_t hinfo); +extern void bte_crb_error_handler(devfs_handle_t hub_v, int btenum, int crbnum, ioerror_t *ioe); + +extern int maxcpus; + +#define HUB_ERROR_PERIOD (120 * HZ) /* 2 minutes */ + + +void +hub_error_clear(nasid_t nasid) +{ + int i; + hubreg_t idsr; + + /* + * Make sure spurious write response errors are cleared + * (values are from hub_set_prb()) + */ + for (i = 0; i <= HUB_WIDGET_ID_MAX - HUB_WIDGET_ID_MIN + 1; i++) { + iprb_t prb; + + prb.iprb_regval = REMOTE_HUB_L(nasid, IIO_IOPRB_0 + (i * sizeof(hubreg_t))); + + /* Clear out some fields */ + prb.iprb_ovflow = 1; + prb.iprb_bnakctr = 0; + prb.iprb_anakctr = 0; + + prb.iprb_xtalkctr = 3; /* approx. PIO credits for the widget */ + + REMOTE_HUB_S(nasid, IIO_IOPRB_0 + (i * sizeof(hubreg_t)), prb.iprb_regval); + } + + REMOTE_HUB_S(nasid, IIO_IO_ERR_CLR, -1); + idsr = REMOTE_HUB_L(nasid, IIO_IIDSR); + REMOTE_HUB_S(nasid, IIO_IIDSR, (idsr & ~(IIO_IIDSR_SENT_MASK))); + +} + + +/* + * Function : hub_error_init + * Purpose : initialize the error handling requirements for a given hub. + * Parameters : cnode, the compact nodeid. + * Assumptions : Called only once per hub, either by a local cpu. Or by a + * remote cpu, when this hub is headless.(cpuless) + * Returns : None + */ + +void +hub_error_init(cnodeid_t cnode) +{ + nasid_t nasid; + + nasid = cnodeid_to_nasid(cnode); + hub_error_clear(nasid); + + + /* + * Now setup the hub ii error interrupt handler. + */ + + hubii_eint_init(cnode); + + return; +} + +/* + * Function : hubii_eint_init + * Parameters : cnode + * Purpose : to initialize the hub iio error interrupt. + * Assumptions : Called once per hub, by the cpu which will ultimately + * handle this interrupt. + * Returns : None. + */ + + +void +hubii_eint_init(cnodeid_t cnode) +{ + int bit, rv; + ii_iidsr_u_t hubio_eint; + hubinfo_t hinfo; + cpuid_t intr_cpu; + devfs_handle_t hub_v; + ii_ilcsr_u_t ilcsr; + int bit_pos_to_irq(int bit); + int synergy_intr_connect(int bit, int cpuid); + + + hub_v = (devfs_handle_t)cnodeid_to_vertex(cnode); + ASSERT_ALWAYS(hub_v); + hubinfo_get(hub_v, &hinfo); + + ASSERT(hinfo); + ASSERT(hinfo->h_cnodeid == cnode); + + ilcsr.ii_ilcsr_regval = REMOTE_HUB_L(hinfo->h_nasid, IIO_ILCSR); + + if ((ilcsr.ii_ilcsr_fld_s.i_llp_stat & 0x2) == 0) { + /* + * HUB II link is not up. + * Just disable LLP, and don't connect any interrupts. + */ + ilcsr.ii_ilcsr_fld_s.i_llp_en = 0; + REMOTE_HUB_S(hinfo->h_nasid, IIO_ILCSR, ilcsr.ii_ilcsr_regval); + return; + } + /* Select a possible interrupt target where there is a free interrupt + * bit and also reserve the interrupt bit for this IO error interrupt + */ + intr_cpu = intr_heuristic(hub_v,0,-1,0,hub_v, + "HUB IO error interrupt",&bit); + if (intr_cpu == CPU_NONE) { + printk("hubii_eint_init: intr_reserve_level failed, cnode %d", cnode); + return; + } + + rv = intr_connect_level(intr_cpu, bit, 0, NULL); + request_irq(bit + (intr_cpu << 8), hubii_eint_handler, 0, "SN hub error", (void *)hub_v); + ASSERT_ALWAYS(rv >= 0); + hubio_eint.ii_iidsr_regval = 0; + hubio_eint.ii_iidsr_fld_s.i_enable = 1; + hubio_eint.ii_iidsr_fld_s.i_level = bit;/* Take the least significant bits*/ + hubio_eint.ii_iidsr_fld_s.i_node = COMPACT_TO_NASID_NODEID(cnode); + hubio_eint.ii_iidsr_fld_s.i_pi_id = cpuid_to_subnode(intr_cpu); + REMOTE_HUB_S(hinfo->h_nasid, IIO_IIDSR, hubio_eint.ii_iidsr_regval); + +} + + +/*ARGSUSED*/ +void +hubii_eint_handler (int irq, void *arg, struct pt_regs *ep) +{ + devfs_handle_t hub_v; + hubinfo_t hinfo; + ii_wstat_u_t wstat; + hubreg_t idsr; + + + /* two levels of casting avoids compiler warning.!! */ + hub_v = (devfs_handle_t)(long)(arg); + ASSERT(hub_v); + + hubinfo_get(hub_v, &hinfo); + + /* + * Identify the reason for error. + */ + wstat.ii_wstat_regval = REMOTE_HUB_L(hinfo->h_nasid, IIO_WSTAT); + + if (wstat.ii_wstat_fld_s.w_crazy) { + char *reason; + /* + * We can do a couple of things here. + * Look at the fields TX_MX_RTY/XT_TAIL_TO/XT_CRD_TO to check + * which of these caused the CRAZY bit to be set. + * You may be able to check if the Link is up really. + */ + if (wstat.ii_wstat_fld_s.w_tx_mx_rty) + reason = "Micro Packet Retry Timeout"; + else if (wstat.ii_wstat_fld_s.w_xt_tail_to) + reason = "Crosstalk Tail Timeout"; + else if (wstat.ii_wstat_fld_s.w_xt_crd_to) + reason = "Crosstalk Credit Timeout"; + else { + hubreg_t hubii_imem; + /* + * Check if widget 0 has been marked as shutdown, or + * if BTE 0/1 has been marked. + */ + hubii_imem = REMOTE_HUB_L(hinfo->h_nasid, IIO_IMEM); + if (hubii_imem & IIO_IMEM_W0ESD) + reason = "Hub Widget 0 has been Shutdown"; + else if (hubii_imem & IIO_IMEM_B0ESD) + reason = "BTE 0 has been shutdown"; + else if (hubii_imem & IIO_IMEM_B1ESD) + reason = "BTE 1 has been shutdown"; + else reason = "Unknown"; + + } + /* + * Note: we may never be able to print this, if the II talking + * to Xbow which hosts the console is dead. + */ + printk("Hub %d to Xtalk Link failed (II_ECRAZY) Reason: %s", + hinfo->h_cnodeid, reason); + } + + /* + * It's a toss as to which one among PRB/CRB to check first. + * Current decision is based on the severity of the errors. + * IO CRB errors tend to be more severe than PRB errors. + * + * It is possible for BTE errors to have been handled already, so we + * may not see any errors handled here. + */ + (void)hubiio_crb_error_handler(hub_v, hinfo); + (void)hubiio_prb_error_handler(hub_v, hinfo); + /* + * If we reach here, it indicates crb/prb handlers successfully + * handled the error. So, re-enable II to send more interrupt + * and return. + */ + REMOTE_HUB_S(hinfo->h_nasid, IIO_IECLR, 0xffffff); + idsr = REMOTE_HUB_L(hinfo->h_nasid, IIO_IIDSR) & ~IIO_IIDSR_SENT_MASK; + REMOTE_HUB_S(hinfo->h_nasid, IIO_IIDSR, idsr); +} + +/* + * Free the hub CRB "crbnum" which encountered an error. + * Assumption is, error handling was successfully done, + * and we now want to return the CRB back to Hub for normal usage. + * + * In order to free the CRB, all that's needed is to de-allocate it + * + * Assumption: + * No other processor is mucking around with the hub control register. + * So, upper layer has to single thread this. + */ +void +hubiio_crb_free(hubinfo_t hinfo, int crbnum) +{ + ii_icrb0_a_u_t icrba; + + /* + * The hardware does NOT clear the mark bit, so it must get cleared + * here to be sure the error is not processed twice. + */ + icrba.ii_icrb0_a_regval = REMOTE_HUB_L(hinfo->h_nasid, IIO_ICRB_A(crbnum)); + icrba.a_valid = 0; + REMOTE_HUB_S(hinfo->h_nasid, IIO_ICRB_A(crbnum), icrba.ii_icrb0_a_regval); + /* + * Deallocate the register. + */ + + REMOTE_HUB_S(hinfo->h_nasid, IIO_ICDR, (IIO_ICDR_PND | crbnum)); + + /* + * Wait till hub indicates it's done. + */ + while (REMOTE_HUB_L(hinfo->h_nasid, IIO_ICDR) & IIO_ICDR_PND) + us_delay(1); + +} + + +/* + * Array of error names that get logged in CRBs + */ +char *hubiio_crb_errors[] = { + "Directory Error", + "CRB Poison Error", + "I/O Write Error", + "I/O Access Error", + "I/O Partial Write Error", + "I/O Partial Read Error", + "I/O Timeout Error", + "Xtalk Error Packet" +}; + +/* + * hubiio_crb_error_handler + * + * This routine gets invoked when a hub gets an error + * interrupt. So, the routine is running in interrupt context + * at error interrupt level. + * Action: + * It's responsible for identifying ALL the CRBs that are marked + * with error, and process them. + * + * If you find the CRB that's marked with error, map this to the + * reason it caused error, and invoke appropriate error handler. + * + * XXX Be aware of the information in the context register. + * + * NOTE: + * Use REMOTE_HUB_* macro instead of LOCAL_HUB_* so that the interrupt + * handler can be run on any node. (not necessarily the node + * corresponding to the hub that encountered error). + */ + +int +hubiio_crb_error_handler(devfs_handle_t hub_v, hubinfo_t hinfo) +{ + cnodeid_t cnode; + nasid_t nasid; + ii_icrb0_a_u_t icrba; /* II CRB Register A */ + ii_icrb0_b_u_t icrbb; /* II CRB Register B */ + ii_icrb0_c_u_t icrbc; /* II CRB Register C */ + ii_icrb0_d_u_t icrbd; /* II CRB Register D */ + int i; + int num_errors = 0; /* Num of errors handled */ + ioerror_t ioerror; + + nasid = hinfo->h_nasid; + cnode = NASID_TO_COMPACT_NODEID(nasid); + + /* + * Scan through all CRBs in the Hub, and handle the errors + * in any of the CRBs marked. + */ + for (i = 0; i < IIO_NUM_CRBS; i++) { + icrba.ii_icrb0_a_regval = REMOTE_HUB_L(nasid, IIO_ICRB_A(i)); + + IOERROR_INIT(&ioerror); + + /* read other CRB error registers. */ + icrbb.ii_icrb0_b_regval = REMOTE_HUB_L(nasid, IIO_ICRB_B(i)); + icrbc.ii_icrb0_c_regval = REMOTE_HUB_L(nasid, IIO_ICRB_C(i)); + icrbd.ii_icrb0_d_regval = REMOTE_HUB_L(nasid, IIO_ICRB_D(i)); + + IOERROR_SETVALUE(&ioerror,errortype,icrbb.b_ecode); + /* Check if this error is due to BTE operation, + * and handle it separately. + */ + if (icrbd.d_bteop || + ((icrbb.b_initiator == IIO_ICRB_INIT_BTE0 || + icrbb.b_initiator == IIO_ICRB_INIT_BTE1) && + (icrbb.b_imsgtype == IIO_ICRB_IMSGT_BTE || + icrbb.b_imsgtype == IIO_ICRB_IMSGT_SN1NET))){ + + int bte_num; + + if (icrbd.d_bteop) + bte_num = icrbc.c_btenum; + else /* b_initiator bit 2 gives BTE number */ + bte_num = (icrbb.b_initiator & 0x4) >> 2; + + bte_crb_error_handler(hub_v, bte_num, + i, &ioerror); + hubiio_crb_free(hinfo, i); + num_errors++; + continue; + } + + /* + * XXX + * Assuming the only other error that would reach here is + * crosstalk errors. + * If CRB times out on a message from Xtalk, it changes + * the message type to CRB. + * + * If we get here due to other errors (SN0net/CRB) + * what's the action ? + */ + + /* + * Pick out the useful fields in CRB, and + * tuck them away into ioerror structure. + */ + IOERROR_SETVALUE(&ioerror,xtalkaddr,icrba.a_addr << IIO_ICRB_ADDR_SHFT); + IOERROR_SETVALUE(&ioerror,widgetnum,icrba.a_sidn); + + + if (icrba.a_iow){ + /* + * XXX We shouldn't really have BRIDGE-specific code + * here, but alas.... + * + * The BRIDGE (or XBRIDGE) sets the upper bit of TNUM + * to indicate a WRITE operation. It sets the next + * bit to indicate an INTERRUPT operation. The bottom + * 3 bits of TNUM indicate which device was responsible. + */ + IOERROR_SETVALUE(&ioerror,widgetdev, + TNUM_TO_WIDGET_DEV(icrba.a_tnum)); + + } + + } + return num_errors; +} + +/*ARGSUSED*/ +/* + * hubii_prb_handler + * Handle the error reported in the PRB for wiget number wnum. + * This typically happens on a PIO write error. + * There is nothing much we can do in this interrupt context for + * PIO write errors. For e.g. QL scsi controller has the + * habit of flaking out on PIO writes. + * Print a message and try to continue for now + * Cleanup involes freeing the PRB register + */ +static void +hubii_prb_handler(devfs_handle_t hub_v, hubinfo_t hinfo, int wnum) +{ + nasid_t nasid; + + nasid = hinfo->h_nasid; + /* + * Clear error bit by writing to IECLR register. + */ + REMOTE_HUB_S(nasid, IIO_IO_ERR_CLR, (1 << wnum)); + /* + * PIO Write to Widget 'i' got into an error. + * Invoke hubiio_error_handler with this information. + */ + printk( "Hub nasid %d got a PIO Write error from widget %d, cleaning up and continuing", + nasid, wnum); + /* + * XXX + * It may be necessary to adjust IO PRB counter + * to account for any lost credits. + */ +} + +int +hubiio_prb_error_handler(devfs_handle_t hub_v, hubinfo_t hinfo) +{ + int wnum; + nasid_t nasid; + int num_errors = 0; + iprb_t iprb; + + nasid = hinfo->h_nasid; + /* + * Check if IPRB0 has any error first. + */ + iprb.iprb_regval = REMOTE_HUB_L(nasid, IIO_IOPRB(0)); + if (iprb.iprb_error) { + num_errors++; + hubii_prb_handler(hub_v, hinfo, 0); + } + /* + * Look through PRBs 8 - F to see if any of them has error bit set. + * If true, invoke hub iio error handler for this widget. + */ + for (wnum = HUB_WIDGET_ID_MIN; wnum <= HUB_WIDGET_ID_MAX; wnum++) { + iprb.iprb_regval = REMOTE_HUB_L(nasid, IIO_IOPRB(wnum)); + + if (!iprb.iprb_error) + continue; + + num_errors++; + hubii_prb_handler(hub_v, hinfo, wnum); + } + + return num_errors; +} + diff -urN linux-2.4.18/arch/ia64/sn/io/stubs.c lia64-2.4/arch/ia64/sn/io/stubs.c --- linux-2.4.18/arch/ia64/sn/io/stubs.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/stubs.c Mon Feb 4 17:48:56 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ #include @@ -21,6 +20,7 @@ #include #include #include +#include /****** ****** hack defines ...... @@ -61,45 +61,45 @@ } void * -kmem_alloc_node(register size_t size, register int flags, cnodeid_t node) +snia_kmem_alloc_node(register size_t size, register int flags, cnodeid_t node) { /* Allocates on node 'node' */ - FIXME("kmem_alloc_node : use kmalloc"); + FIXME("snia_kmem_alloc_node : use kmalloc"); return(kmalloc(size, GFP_KERNEL)); } void * -kmem_zalloc_node(register size_t size, register int flags, cnodeid_t node) +snia_kmem_zalloc_node(register size_t size, register int flags, cnodeid_t node) { - FIXME("kmem_zalloc_node : use kmalloc"); + FIXME("snia_kmem_zalloc_node : use kmalloc"); return(kmalloc(size, GFP_KERNEL)); } void -kmem_free(void *where, int size) +snia_kmem_free(void *where, int size) { - FIXME("kmem_free : use kfree"); + FIXME("snia_kmem_free : use kfree"); return(kfree(where)); } void * -kmem_zone_alloc(register zone_t *zone, int flags) +snia_kmem_zone_alloc(register zone_t *zone, int flags) { - FIXME("kmem_zone_alloc : return null"); + FIXME("snia_kmem_zone_alloc : return null"); return((void *)0); } void -kmem_zone_free(register zone_t *zone, void *ptr) +snia_kmem_zone_free(register zone_t *zone, void *ptr) { - FIXME("kmem_zone_free : no-op"); + FIXME("snia_kmem_zone_free : no-op"); } zone_t * -kmem_zone_init(register int size, char *zone_name) +snia_kmem_zone_init(register int size, char *zone_name) { - FIXME("kmem_zone_free : returns NULL"); + FIXME("snia_kmem_zone_free : returns NULL"); return((zone_t *)0); } diff -urN linux-2.4.18/arch/ia64/sn/io/xbow.c lia64-2.4/arch/ia64/sn/io/xbow.c --- linux-2.4.18/arch/ia64/sn/io/xbow.c Thu Apr 12 12:16:35 2001 +++ lia64-2.4/arch/ia64/sn/io/xbow.c Mon Nov 19 23:22:53 2001 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ #include @@ -19,6 +18,7 @@ #include #include #include +#include /* #define DEBUG 1 */ /* #define XBOW_DEBUG 1 */ @@ -102,7 +102,6 @@ #ifdef LATER static void xbow_setwidint(xtalk_intr_t); static void xbow_errintr_handler(intr_arg_t); -static error_handler_f xbow_error_handler; #endif void xbow_intr_preset(void *, int, xwidgetnum_t, iopaddr_t, xtalk_intr_vector_t); @@ -281,7 +280,7 @@ /* &hcl_fops */ (void *)&vhdl, NULL); if (!vhdl) { printk(KERN_WARNING "xbow_attach: Unable to create char device for xbow conn %p\n", - conn); + (void *)conn); } /* @@ -306,7 +305,7 @@ /* * get the name of this xbow vertex and keep the info. - * This is needed during errors and interrupts, but as + * This is needed during errors and interupts, but as * long as we have it, we can use it elsewhere. */ s = dev_to_name(vhdl, devnm, MAXDEVNAME); @@ -371,36 +370,9 @@ } /* - * attach the crossbow error interrupt. - */ -#ifdef LATER - dev_desc = device_desc_dup(vhdl); - device_desc_flags_set(dev_desc, - device_desc_flags_get(dev_desc) | D_INTR_ISERR); - device_desc_intr_name_set(dev_desc, "Crossbow error"); - - intr_hdl = xtalk_intr_alloc(conn, dev_desc, vhdl); - ASSERT(intr_hdl != NULL); - - xtalk_intr_connect(intr_hdl, - (intr_func_t) xbow_errintr_handler, - (intr_arg_t) soft, - (xtalk_intr_setfunc_t) xbow_setwidint, - (void *) xbow, - (void *) 0); - device_desc_free(dev_desc); - - xwidget_error_register(conn, xbow_error_handler, soft); - -#else - FIXME("xbow_attach: Fixme: we bypassed attaching xbow error interrupt.\n"); -#endif /* LATER */ - - /* * Enable xbow error interrupts */ - xbow->xb_wid_control = (XB_WID_CTRL_REG_ACC_IE | - XB_WID_CTRL_XTALK_IE); + xbow->xb_wid_control = (XB_WID_CTRL_REG_ACC_IE | XB_WID_CTRL_XTALK_IE); /* * take a census of the widgets present, @@ -918,460 +890,6 @@ return 1; } -/* - * xbow_errintr_handler will be called if the xbow - * sends an interrupt request to report an error. - */ - -#ifdef LATER -static void -xbow_errintr_handler(intr_arg_t arg) -{ - ioerror_t ioe[1]; - xbow_soft_t soft = (xbow_soft_t) arg; - xbow_t *xbow = soft->base; - xbowreg_t wid_control; - xbowreg_t wid_stat; - xbowreg_t wid_err_cmdword; - xbowreg_t wid_err_upper; - xbowreg_t wid_err_lower; - w_err_cmd_word_u wid_err; - uint64_t wid_err_addr; - - int fatal = 0; - int dump_ioe = 0; - - wid_control = xbow->xb_wid_control; - wid_stat = xbow->xb_wid_stat_clr; - wid_err_cmdword = xbow->xb_wid_err_cmdword; - wid_err_upper = xbow->xb_wid_err_upper; - wid_err_lower = xbow->xb_wid_err_lower; - xbow->xb_wid_err_cmdword = 0; - - wid_err_addr = - wid_err_lower - | (((iopaddr_t) wid_err_upper - & WIDGET_ERR_UPPER_ADDR_ONLY) - << 32); - - if (wid_stat & XB_WID_STAT_LINK_INTR_MASK) { - int port; - - wid_err.r = wid_err_cmdword; - - for (port = MAX_PORT_NUM - MAX_XBOW_PORTS; - port < MAX_PORT_NUM; port++) { - if (wid_stat & XB_WID_STAT_LINK_INTR(port)) { - xb_linkregs_t *link = &(xbow->xb_link(port)); - xbowreg_t link_control = link->link_control; - xbowreg_t link_status = link->link_status_clr; - xbowreg_t link_aux_status = link->link_aux_status; - xbowreg_t link_pend; - - link_pend = link_status & link_control & - (XB_STAT_ILLEGAL_DST_ERR - | XB_STAT_OALLOC_IBUF_ERR - | XB_STAT_RCV_CNT_OFLOW_ERR - | XB_STAT_XMT_CNT_OFLOW_ERR - | XB_STAT_XMT_MAX_RTRY_ERR - | XB_STAT_RCV_ERR - | XB_STAT_XMT_RTRY_ERR - | XB_STAT_MAXREQ_TOUT_ERR - | XB_STAT_SRC_TOUT_ERR - ); - - if (link_pend & XB_STAT_ILLEGAL_DST_ERR) { - if (wid_err.f.sidn == port) { - IOERROR_INIT(ioe); - IOERROR_SETVALUE(ioe, widgetnum, port); - IOERROR_SETVALUE(ioe, xtalkaddr, wid_err_addr); - if (IOERROR_HANDLED == - xbow_error_handler(soft, - IOECODE_DMA, - MODE_DEVERROR, - ioe)) { - link_pend &= ~XB_STAT_ILLEGAL_DST_ERR; - } else { - dump_ioe++; - } - } - } - /* Xbow/Bridge WAR: - * if the bridge signals an LLP Transmitter Retry, - * rewrite its control register. - * If someone else triggers this interrupt, - * ignore (and disable) the interrupt. - */ - if (link_pend & XB_STAT_XMT_RTRY_ERR) { - if (!xbow_xmit_retry_error(soft, port)) { - link_control &= ~XB_CTRL_XMT_RTRY_IE; - link->link_control = link_control; - link->link_control; /* stall until written */ - } - link_pend &= ~XB_STAT_XMT_RTRY_ERR; - } - if (link_pend) { - devfs_handle_t xwidget_vhdl; - char *xwidget_name; - - /* Get the widget name corresponding to the current - * xbow link. - */ - xwidget_vhdl = xbow_widget_lookup(soft->busv,port); - xwidget_name = xwidget_name_get(xwidget_vhdl); - -#ifdef LATER - printk("%s port %X[%s] XIO Bus Error", - soft->name, port, xwidget_name); - if (link_status & XB_STAT_MULTI_ERR) - XEM_ADD_STR("\tMultiple Errors\n"); - if (link_status & XB_STAT_ILLEGAL_DST_ERR) - XEM_ADD_STR("\tInvalid Packet Destination\n"); - if (link_status & XB_STAT_OALLOC_IBUF_ERR) - XEM_ADD_STR("\tInput Overallocation Error\n"); - if (link_status & XB_STAT_RCV_CNT_OFLOW_ERR) - XEM_ADD_STR("\tLLP receive error counter overflow\n"); - if (link_status & XB_STAT_XMT_CNT_OFLOW_ERR) - XEM_ADD_STR("\tLLP transmit retry counter overflow\n"); - if (link_status & XB_STAT_XMT_MAX_RTRY_ERR) - XEM_ADD_STR("\tLLP Max Transmitter Retry\n"); - if (link_status & XB_STAT_RCV_ERR) - XEM_ADD_STR("\tLLP Receiver error\n"); - if (link_status & XB_STAT_XMT_RTRY_ERR) - XEM_ADD_STR("\tLLP Transmitter Retry\n"); - if (link_status & XB_STAT_MAXREQ_TOUT_ERR) - XEM_ADD_STR("\tMaximum Request Timeout\n"); - if (link_status & XB_STAT_SRC_TOUT_ERR) - XEM_ADD_STR("\tSource Timeout Error\n"); -#endif /* LATER */ - { - int other_port; - - for (other_port = 8; other_port < 16; ++other_port) { - if (link_aux_status & (1 << other_port)) { - /* XXX- need to go to "other_port" - * and clean up after the timeout? - */ - XEM_ADD_VAR(other_port); - } - } - } - -#if !DEBUG - if (kdebug) { -#endif - XEM_ADD_VAR(link_control); - XEM_ADD_VAR(link_status); - XEM_ADD_VAR(link_aux_status); - - if (dump_ioe) { - XEM_ADD_IOE(); - dump_ioe = 0; - } -#if !DEBUG - } -#endif - fatal++; - } - } - } - } - if (wid_stat & wid_control & XB_WID_STAT_WIDGET0_INTR) { - /* we have a "widget zero" problem */ - - if (wid_stat & (XB_WID_STAT_MULTI_ERR - | XB_WID_STAT_XTALK_ERR - | XB_WID_STAT_REG_ACC_ERR)) { - - printk("%s Port 0 XIO Bus Error", - soft->name); - if (wid_stat & XB_WID_STAT_MULTI_ERR) - XEM_ADD_STR("\tMultiple Error\n"); - if (wid_stat & XB_WID_STAT_XTALK_ERR) - XEM_ADD_STR("\tXIO Error\n"); - if (wid_stat & XB_WID_STAT_REG_ACC_ERR) - XEM_ADD_STR("\tRegister Access Error\n"); - - fatal++; - } - } - if (fatal) { - XEM_ADD_VAR(wid_stat); - XEM_ADD_VAR(wid_control); - XEM_ADD_VAR(wid_err_cmdword); - XEM_ADD_VAR(wid_err_upper); - XEM_ADD_VAR(wid_err_lower); - XEM_ADD_VAR(wid_err_addr); - PRINT_PANIC("XIO Bus Error"); - } -} -#endif /* LATER */ - -/* - * XBOW ERROR Handling routines. - * These get invoked as part of walking down the error handling path - * from hub/heart towards the I/O device that caused the error. - */ - -/* - * xbow_error_handler - * XBow error handling dispatch routine. - * This is the primary interface used by external world to invoke - * in case of an error related to a xbow. - * Only functionality in this layer is to identify the widget handle - * given the widgetnum. Otherwise, xbow does not gathers any error - * data. - */ - -#ifdef LATER -static int -xbow_error_handler( - void *einfo, - int error_code, - ioerror_mode_t mode, - ioerror_t *ioerror) -{ - int retval = IOERROR_WIDGETLEVEL; - - xbow_soft_t soft = (xbow_soft_t) einfo; - int port; - devfs_handle_t conn; - devfs_handle_t busv; - - xbow_t *xbow = soft->base; - xbowreg_t wid_stat; - xbowreg_t wid_err_cmdword; - xbowreg_t wid_err_upper; - xbowreg_t wid_err_lower; - uint64_t wid_err_addr; - - xb_linkregs_t *link; - xbowreg_t link_control; - xbowreg_t link_status; - xbowreg_t link_aux_status; - - ASSERT(soft != 0); - busv = soft->busv; - -#if DEBUG && ERROR_DEBUG - printk("%s: xbow_error_handler\n", soft->name, busv); -#endif - - port = IOERROR_GETVALUE(ioerror, widgetnum); - - if (port == 0) { - /* error during access to xbow: - * do NOT attempt to access xbow regs. - */ - if (mode == MODE_DEVPROBE) - return IOERROR_HANDLED; - - if (error_code & IOECODE_DMA) { - PRINT_ALERT("DMA error blamed on Crossbow at %s\n" - "\tbut Crosbow never initiates DMA!", - soft->name); - } - if (error_code & IOECODE_PIO) { - PRINT_ALERt("PIO Error on XIO Bus %s\n" - "\tattempting to access XIO controller\n" - "\twith offset 0x%X", - soft->name, - IOERROR_GETVALUE(ioerror, xtalkaddr)); - } - /* caller will dump contents of ioerror - * in DEBUG and kdebug kernels. - */ - - return retval; - } - /* - * error not on port zero: - * safe to read xbow registers. - */ - wid_stat = xbow->xb_wid_stat; - wid_err_cmdword = xbow->xb_wid_err_cmdword; - wid_err_upper = xbow->xb_wid_err_upper; - wid_err_lower = xbow->xb_wid_err_lower; - - wid_err_addr = - wid_err_lower - | (((iopaddr_t) wid_err_upper - & WIDGET_ERR_UPPER_ADDR_ONLY) - << 32); - - if ((port < BASE_XBOW_PORT) || - (port >= MAX_PORT_NUM)) { - - if (mode == MODE_DEVPROBE) - return IOERROR_HANDLED; - - if (error_code & IOECODE_DMA) { - PRINT_ALERT("DMA error blamed on XIO port at %s/%d\n" - "\tbut Crossbow does not support that port", - soft->name, port); - } - if (error_code & IOECODE_PIO) { - PRINT_ALERT("PIO Error on XIO Bus %s\n" - "\tattempting to access XIO port %d\n" - "\t(which Crossbow does not support)" - "\twith offset 0x%X", - soft->name, port, - IOERROR_GETVALUE(ioerror, xtalkaddr)); - } -#if !DEBUG - if (kdebug) { -#endif - XEM_ADD_STR("Raw status values for Crossbow:\n"); - XEM_ADD_VAR(wid_stat); - XEM_ADD_VAR(wid_err_cmdword); - XEM_ADD_VAR(wid_err_upper); - XEM_ADD_VAR(wid_err_lower); - XEM_ADD_VAR(wid_err_addr); -#if !DEBUG - } -#endif - - /* caller will dump contents of ioerror - * in DEBUG and kdebug kernels. - */ - - return retval; - } - /* access to valid port: - * ok to check port status. - */ - - link = &(xbow->xb_link(port)); - link_control = link->link_control; - link_status = link->link_status; - link_aux_status = link->link_aux_status; - - /* Check that there is something present - * in that XIO port. - */ - if (!(link_aux_status & XB_AUX_STAT_PRESENT)) { - /* nobody connected. */ - if (mode == MODE_DEVPROBE) - return IOERROR_HANDLED; - - if (error_code & IOECODE_DMA) { - PRINT_ALERT("DMA error blamed on XIO port at %s/%d\n" - "\tbut there is no device connected there.", - soft->name, port); - } - if (error_code & IOECODE_PIO) { - PRINT_ALERT("PIO Error on XIO Bus %s\n" - "\tattempting to access XIO port %d\n" - "\t(which has no device connected)" - "\twith offset 0x%X", - soft->name, port, - IOERROR_GETVALUE(ioerror, xtalkaddr)); - } -#if !DEBUG - if (kdebug) { -#endif - XEM_ADD_STR("Raw status values for Crossbow:\n"); - XEM_ADD_VAR(wid_stat); - XEM_ADD_VAR(wid_err_cmdword); - XEM_ADD_VAR(wid_err_upper); - XEM_ADD_VAR(wid_err_lower); - XEM_ADD_VAR(wid_err_addr); - XEM_ADD_VAR(port); - XEM_ADD_VAR(link_control); - XEM_ADD_VAR(link_status); - XEM_ADD_VAR(link_aux_status); -#if !DEBUG - } -#endif - return retval; - - } - /* Check that the link is alive. - */ - if (!(link_status & XB_STAT_LINKALIVE)) { - /* nobody connected. */ - if (mode == MODE_DEVPROBE) - return IOERROR_HANDLED; - - PRINT_ALERT("%s%sError on XIO Bus %s port %d", - (error_code & IOECODE_DMA) ? "DMA " : "", - (error_code & IOECODE_PIO) ? "PIO " : "", - soft->name, port); - - if ((error_code & IOECODE_PIO) && - (IOERROR_FIELDVALID(ioerror, xtalkaddr))) { - printk("\tAccess attempted to offset 0x%X\n", - IOERROR_GETVALUE(ioerror, xtalkaddr)); - } - if (link_aux_status & XB_AUX_LINKFAIL_RST_BAD) - XEM_ADD_STR("\tLink never came out of reset\n"); - else - XEM_ADD_STR("\tLink failed while transferring data\n"); - - } - /* get the connection point for the widget - * involved in this error; if it exists and - * is not our connectpoint, cycle back through - * xtalk_error_handler to deliver control to - * the proper handler (or to report a generic - * crosstalk error). - * - * If the downstream handler won't handle - * the problem, we let our upstream caller - * deal with it, after (in DEBUG and kdebug - * kernels) dumping the xbow state for this - * port. - */ - conn = xbow_widget_lookup(busv, port); - if ((conn != GRAPH_VERTEX_NONE) && - (conn != soft->conn)) { - retval = xtalk_error_handler(conn, error_code, mode, ioerror); - if (retval == IOERROR_HANDLED) - return IOERROR_HANDLED; - } - if (mode == MODE_DEVPROBE) - return IOERROR_HANDLED; - - if (retval == IOERROR_UNHANDLED) { - retval = IOERROR_PANIC; - - PRINT_ALERT("%s%sError on XIO Bus %s port %d", - (error_code & IOECODE_DMA) ? "DMA " : "", - (error_code & IOECODE_PIO) ? "PIO " : "", - soft->name, port); - - if ((error_code & IOECODE_PIO) && - (IOERROR_FIELDVALID(ioerror, xtalkaddr))) { - printk("\tAccess attempted to offset 0x%X\n", - IOERROR_GETVALUE(ioerror, xtalkaddr)); - } - } - -#if !DEBUG - if (kdebug) { -#endif - XEM_ADD_STR("Raw status values for Crossbow:\n"); - XEM_ADD_VAR(wid_stat); - XEM_ADD_VAR(wid_err_cmdword); - XEM_ADD_VAR(wid_err_upper); - XEM_ADD_VAR(wid_err_lower); - XEM_ADD_VAR(wid_err_addr); - XEM_ADD_VAR(port); - XEM_ADD_VAR(link_control); - XEM_ADD_VAR(link_status); - XEM_ADD_VAR(link_aux_status); -#if !DEBUG - } -#endif - /* caller will dump raw ioerror data - * in DEBUG and kdebug kernels. - */ - - return retval; -} - -#endif /* LATER */ - void xbow_update_perf_counters(devfs_handle_t vhdl) { @@ -1520,7 +1038,7 @@ if (lnk_sts.linkstatus & ~(XB_STAT_RCV_ERR | XB_STAT_XMT_RTRY_ERR | XB_STAT_LINKALIVE)) { #ifdef LATER - PRINT_WARNING("link %d[%s]: bad status 0x%x\n", + printk(KERN_WARNING "link %d[%s]: bad status 0x%x\n", link, xwidget_name, lnk_sts.linkstatus); #endif } diff -urN linux-2.4.18/arch/ia64/sn/io/xswitch.c lia64-2.4/arch/ia64/sn/io/xswitch.c --- linux-2.4.18/arch/ia64/sn/io/xswitch.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/io/xswitch.c Mon Nov 19 23:22:53 2001 @@ -4,14 +4,13 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ #include #include #include -#include +#include #include #include #include diff -urN linux-2.4.18/arch/ia64/sn/io/xtalk.c lia64-2.4/arch/ia64/sn/io/xtalk.c --- linux-2.4.18/arch/ia64/sn/io/xtalk.c Thu Apr 12 12:16:35 2001 +++ lia64-2.4/arch/ia64/sn/io/xtalk.c Mon Nov 19 23:22:53 2001 @@ -4,24 +4,22 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ #include #include #include -#include +#include +#include #include #include #include #include #include - #include #include #include - #include /* @@ -41,7 +39,6 @@ cdl_p xtalk_registry = NULL; -#include #define DEV_FUNC(dev,func) hub_##func #define CAST_PIOMAP(x) ((hub_piomap_t)(x)) #define CAST_DMAMAP(x) ((hub_dmamap_t)(x)) @@ -72,7 +69,7 @@ xtalk_intr_t xtalk_intr_alloc(devfs_handle_t, device_desc_t, devfs_handle_t); xtalk_intr_t xtalk_intr_alloc_nothd(devfs_handle_t, device_desc_t, devfs_handle_t); void xtalk_intr_free(xtalk_intr_t); -int xtalk_intr_connect(xtalk_intr_t, intr_func_t, intr_arg_t, xtalk_intr_setfunc_t, void *, void *); +int xtalk_intr_connect(xtalk_intr_t, xtalk_intr_setfunc_t, void *); void xtalk_intr_disconnect(xtalk_intr_t); devfs_handle_t xtalk_intr_cpu_get(xtalk_intr_t); int xtalk_error_handler(devfs_handle_t, int, ioerror_mode_t, ioerror_t *); @@ -113,8 +110,6 @@ xwidgetnum_t, devfs_handle_t, xwidgetnum_t, async_attach_t); int xwidget_unregister(devfs_handle_t); -void xwidget_error_register(devfs_handle_t, error_handler_f *, - error_handler_arg_t); void xwidget_reset(devfs_handle_t); char *xwidget_name_get(devfs_handle_t); #if !defined(DEV_FUNC) @@ -472,14 +467,11 @@ */ int xtalk_intr_connect(xtalk_intr_t intr_hdl, /* xtalk intr resource handle */ - intr_func_t intr_func, /* xtalk intr handler */ - intr_arg_t intr_arg, /* arg to intr handler */ xtalk_intr_setfunc_t setfunc, /* func to set intr hw */ - void *setfunc_arg, /* arg to setfunc */ - void *thread) -{ /* intr thread to use */ + void *setfunc_arg) /* arg to setfunc */ +{ return INTR_FUNC(intr_hdl, intr_connect) - (CAST_INTR(intr_hdl), intr_func, intr_arg, setfunc, setfunc_arg, thread); + (CAST_INTR(intr_hdl), setfunc, setfunc_arg); } @@ -506,85 +498,6 @@ } -/* - * ===================================================================== - * ERROR MANAGEMENT - */ - -/* - * xtalk_error_handler: - * pass this error on to the handler registered - * at the specified xtalk connecdtion point, - * or complain about it here if there is no handler. - * - * This routine plays two roles during error delivery - * to most widgets: first, the external agent (heart, - * hub, or whatever) calls in with the error and the - * connect point representing the crosstalk switch, - * or whatever crosstalk device is directly connected - * to the agent. - * - * If there is a switch, it will generally look at the - * widget number stashed in the ioerror structure; and, - * if the error came from some widget other than the - * switch, it will call back into xtalk_error_handler - * with the connection point of the offending port. - */ -int -xtalk_error_handler( - devfs_handle_t xconn, - int error_code, - ioerror_mode_t mode, - ioerror_t *ioerror) -{ - xwidget_info_t xwidget_info; - -#if DEBUG && ERROR_DEBUG -#ifdef SUPPORT_PRINTING_V_FORMAT - printk("%v: xtalk_error_handler\n", xconn); -#else - printk("%x: xtalk_error_handler\n", xconn); -#endif -#endif - - xwidget_info = xwidget_info_get(xconn); - /* Make sure that xwidget_info is a valid pointer before derefencing it. - * We could come in here during very early initialization. - */ - if (xwidget_info && xwidget_info->w_efunc) - return xwidget_info->w_efunc - (xwidget_info->w_einfo, - error_code, mode, ioerror); - /* - * no error handler registered for - * the offending port. it's not clear - * what needs to be done, but reporting - * it would be a good thing, unless it - * is a mode that requires nothing. - */ - if ((mode == MODE_DEVPROBE) || (mode == MODE_DEVUSERERROR) || - (mode == MODE_DEVREENABLE)) - return IOERROR_HANDLED; - -#ifdef LATER -#ifdef SUPPORT_PRINTING_V_FORMAT - PRINT_WARNING("Xbow at %v encountered Fatal error", xconn); -#else - PRINT_WARNING("Xbow at %x encountered Fatal error", xconn); -#endif -#endif /* LATER */ - ioerror_dump("xtalk", error_code, mode, ioerror); - - return IOERROR_UNHANDLED; -} - -int -xtalk_error_devenable(devfs_handle_t xconn_vhdl, int devnum, int error_code) -{ - return DEV_FUNC(xconn_vhdl, error_devenable) (xconn_vhdl, devnum, error_code); -} - - /* ===================================================================== * CONFIGURATION MANAGEMENT */ @@ -977,7 +890,7 @@ widget_info->w_einfo = 0; /* * get the name of this xwidget vertex and keep the info. - * This is needed during errors and interrupts, but as + * This is needed during errors and interupts, but as * long as we have it, we can use it elsewhere. */ s = dev_to_name(widget,devnm,MAXDEVNAME); @@ -1038,19 +951,6 @@ return(0); } -void -xwidget_error_register(devfs_handle_t xwidget, - error_handler_f *efunc, - error_handler_arg_t einfo) -{ - xwidget_info_t xwidget_info; - - xwidget_info = xwidget_info_get(xwidget); - ASSERT(xwidget_info != NULL); - xwidget_info->w_efunc = efunc; - xwidget_info->w_einfo = einfo; -} - /* * Issue a link reset to a widget. */ @@ -1120,17 +1020,5 @@ xwidget_unregister(widget_vhdl); - return(0); -} -/* - * xtalk_device_inquiry - * Find out hardware information about the xtalk widget. - */ -int -xtalk_device_inquiry(devfs_handle_t xbus_vhdl, xwidgetnum_t widget) -{ - - extern void hub_device_inquiry(devfs_handle_t, xwidgetnum_t); - hub_device_inquiry(xbus_vhdl, widget); return(0); } diff -urN linux-2.4.18/arch/ia64/sn/kernel/Makefile lia64-2.4/arch/ia64/sn/kernel/Makefile --- linux-2.4.18/arch/ia64/sn/kernel/Makefile Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/Makefile Tue Feb 26 13:19:35 2002 @@ -0,0 +1,62 @@ +# arch/ia64/sn/Makefile +# +# Copyright (C) 1999,2001-2002 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/NoticeExplan +# + +EXTRA_CFLAGS := -DLITTLE_ENDIAN + +.S.s: + $(CPP) $(AFLAGS) $(AFLAGS_KERNEL) -o $*.s $< +.S.o: + $(CC) $(AFLAGS) $(AFLAGS_KERNEL) -c -o $*.o $< + +O_TARGET = sn.o + +ifeq ($(CONFIG_MODULES),y) +export-objs = sn_ksyms.o +endif + +subdir-$(CONFIG_IA64_SGI_SN1) = sn1 +subdir-$(CONFIG_IA64_SGI_SN2) = sn2 + +obj-y = probe.o setup.o sn_asm.o sv.o bte.o iomv.o +obj-$(CONFIG_IA64_SGI_SN1) += irq.o mca.o +obj-$(CONFIG_IA64_SGI_SN2) += irq.o mca.o + +obj-$(CONFIG_IA64_SGI_SN1) += sn1/sn1.a +obj-$(CONFIG_IA64_SGI_SN2) += sn2/sn2.a + +obj-$(CONFIG_IA64_SGI_AUTOTEST) += llsc4.o misctest.o +obj-$(CONFIG_IA64_GENERIC) += machvec.o +obj-$(CONFIG_MODULES) += sn_ksyms.o + + +include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ia64/sn/kernel/bte.c lia64-2.4/arch/ia64/sn/kernel/bte.c --- linux-2.4.18/arch/ia64/sn/kernel/bte.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/bte.c Tue Feb 26 13:19:35 2002 @@ -0,0 +1,263 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +int bte_offsets[] = { IIO_IBLS0, IIO_IBLS1 }; + +/* + * bte_init_node(nodepda, cnode, cmdline_p) + * + * Initialize the nodepda structure with BTE base addresses and + * spinlocks. + * + */ +void +bte_init_node(nodepda_t * mynodepda, cnodeid_t cnode, char **cmdline_p) +{ + int bteTestMode = 0; + int cmdoffset = 0; + int i; + +#ifdef ZZZ + if (!cmdoffset) { + for (;cmdline_p[cmdoffset]; cmdoffset++) { + if (strstr(cmdline_p[cmdoffset], "btetest")) { + bteTestMode = 1; + break; + } + } + } +#endif + + /* + * Indicate that all the block transfer engines on this node + * are available. + */ + for (i = 0; i < BTES_PER_NODE; i++) { +#ifdef CONFIG_IA64_SGI_SN2 + /* >>> Don't know why the 0x1800000L is here. Robin */ + mynodepda->node_bte_info[i].bte_base_addr = + (char *)LOCAL_MMR_ADDR(bte_offsets[i] | 0x1800000L); +#elif CONFIG_IA64_SGI_SN1 + mynodepda->node_bte_info[i].bte_base_addr = + (char *)LOCAL_HUB_ADDR(bte_offsets[i]); +#else +#error BTE Not defined for this hardware platform. +#endif + +#ifdef CONFIG_IA64_SGI_BTE_LOCKING + /* Initialize the notification and spinlock */ + /* so the first transfer can occur. */ + mynodepda->node_bte_info[i].mostRecentNotification = + &(mynodepda->node_bte_info[i].notify); + mynodepda->node_bte_info[i].notify = 0L; + spin_lock_init(&mynodepda->node_bte_info[i].spinlock); +#endif /* CONFIG_IA64_SGI_BTE_LOCKING */ + + if (bteTestMode) { + mynodepda->node_bte_info[i].bteTestBuf = + alloc_bootmem_node(NODE_DATA(cnode), + BTE_MAX_XFER); + } + } +} + +/* + * bte_init_cpu() + * + * Initialize the cpupda structure with pointers to the + * nodepda bte blocks. + * + */ +void +bte_init_cpu(void) +{ + /* Called by setup.c as each cpu is being added to the nodepda */ + if (local_node_data->active_cpu_count & 0x1) { + pda.cpubte[0] = &(nodepda->node_bte_info[0]); + pda.cpubte[1] = &(nodepda->node_bte_info[1]); + } else { + pda.cpubte[0] = &(nodepda->node_bte_info[1]); + pda.cpubte[1] = &(nodepda->node_bte_info[0]); + } +} + + +/* + * bte_unaligned_copy(src, dest, len, mode) + * + * use the block transfer engine to move kernel + * memory from src to dest using the assigned mode. + * + * Paramaters: + * src - physical address of the transfer source. + * dest - physical address of the transfer destination. + * len - number of bytes to transfer from source to dest. + * mode - hardware defined. See reference information + * for IBCT0/1 in the SGI documentation. + * bteBlock - kernel virtual address of a temporary + * buffer used during unaligned transfers. + * + * NOTE: If the source, dest, and len are all cache line aligned, + * then it would be _FAR_ preferrable to use bte_copy instead. + */ +bte_result_t +bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode, char *bteBlock) +{ + int destFirstCacheOffset; + u64 headBteSource; + u64 headBteLen; + u64 headBcopySrcOffset; + u64 headBcopyDest; + u64 headBcopyLen; + u64 footBteSource; + u64 footBteLen; + u64 footBcopyDest; + u64 footBcopyLen; + bte_result_t rv; + + if (len == 0) { + return (BTE_SUCCESS); + } + + headBcopySrcOffset = src & L1_CACHE_MASK; + destFirstCacheOffset = dest & L1_CACHE_MASK; + + /* + * At this point, the transfer is broken into + * (up to) three sections. The first section is + * from the start address to the first physical + * cache line, the second is from the first physical + * cache line to the last complete cache line, + * and the third is from the last cache line to the + * end of the buffer. The first and third sections + * are handled by bte copying into a temporary buffer + * and then bcopy'ing the necessary section into the + * final location. The middle section is handled with + * a standard bte copy. + * + * One nasty exception to the above rule is when the + * source and destination are not symetrically + * mis-aligned. If the source offset from the first + * cache line is different from the destination offset, + * we make the first section be the entire transfer + * and the bcopy the entire block into place. + */ + if (headBcopySrcOffset == destFirstCacheOffset) { + + /* + * Both the source and destination are the same + * distance from a cache line boundary so we can + * use the bte to transfer the bulk of the + * data. + */ + headBteSource = src & ~L1_CACHE_MASK; + headBcopyDest = dest; + if (headBcopySrcOffset) { + headBcopyLen = + (len > + (L1_CACHE_BYTES - + headBcopySrcOffset) ? L1_CACHE_BYTES + - headBcopySrcOffset : len); + headBteLen = L1_CACHE_BYTES; + } else { + headBcopyLen = 0; + headBteLen = 0; + } + + if (len > headBcopyLen) { + footBcopyLen = + (len - headBcopyLen) & L1_CACHE_MASK; + footBteLen = L1_CACHE_BYTES; + + footBteSource = src + len - footBcopyLen; + footBcopyDest = dest + len - footBcopyLen; + + if (footBcopyDest == + (headBcopyDest + headBcopyLen)) { + /* + * We have two contigous bcopy + * blocks. Merge them. + */ + headBcopyLen += footBcopyLen; + headBteLen += footBteLen; + } else if (footBcopyLen > 0) { + rv = bte_copy(footBteSource, + __pa(bteBlock), + footBteLen, mode, NULL); + if (rv != BTE_SUCCESS) { + return (rv); + } + + + memcpy(__va(footBcopyDest), + (char *)bteBlock, footBcopyLen); + } + } else { + footBcopyLen = 0; + footBteLen = 0; + } + + if (len > (headBcopyLen + footBcopyLen)) { + /* now transfer the middle. */ + rv = bte_copy((src + headBcopyLen), + (dest + + headBcopyLen), + (len - headBcopyLen - + footBcopyLen), mode, NULL); + if (rv != BTE_SUCCESS) { + return (rv); + } + + } + } else { + + + /* + * The transfer is not symetric, we will + * allocate a buffer large enough for all the + * data, bte_copy into that buffer and then + * bcopy to the destination. + */ + + /* Add the leader from source */ + headBteLen = len + (src & L1_CACHE_MASK); + /* Add the trailing bytes from footer. */ + headBteLen += + L1_CACHE_BYTES - (headBteLen & L1_CACHE_MASK); + headBteSource = src & ~L1_CACHE_MASK; + headBcopySrcOffset = src & L1_CACHE_MASK; + headBcopyDest = dest; + headBcopyLen = len; + } + + if (headBcopyLen > 0) { + rv = bte_copy(headBteSource, + __pa(bteBlock), headBteLen, mode, NULL); + if (rv != BTE_SUCCESS) { + return (rv); + } + + memcpy(__va(headBcopyDest), ((char *)bteBlock + + headBcopySrcOffset), + headBcopyLen); + } + return (BTE_SUCCESS); +} diff -urN linux-2.4.18/arch/ia64/sn/kernel/iomv.c lia64-2.4/arch/ia64/sn/kernel/iomv.c --- linux-2.4.18/arch/ia64/sn/kernel/iomv.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/iomv.c Tue Feb 26 13:19:36 2002 @@ -0,0 +1,119 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include + +#if 1 /* ##jh */ +#ifdef CONFIG_IA64_SGI_SN1 +#define mmiob sn1_mmiob +#else +#define mmiob sn2_mmiob +#endif +extern void mmiob(void); +#endif /* ##jh */ + +extern void * sn_io_addr(unsigned long port); /* defined in sn[12]/iomv.c */ + +/** + * sn_inb - read a byte from a port + * @port: port to read from + * + * Reads a byte from @port and returns it to the caller. + */ +unsigned int +sn_inb (unsigned long port) +{ + volatile unsigned char *addr = sn_io_addr(port); + unsigned char ret; + + ret = *addr; + __ia64_mf_a(); + return ret; +} + +/** + * sn_inw - read a word from a port + * @port: port to read from + * + * Reads a word from @port and returns it to the caller. + */ +unsigned int +sn_inw (unsigned long port) +{ + volatile unsigned short *addr = sn_io_addr(port); + unsigned short ret; + + ret = *addr; + __ia64_mf_a(); + return ret; +} + +/** + * sn_inl - read a word from a port + * @port: port to read from + * + * Reads a word from @port and returns it to the caller. + */ +unsigned int +sn_inl (unsigned long port) +{ + volatile unsigned int *addr = sn_io_addr(port); + unsigned int ret; + + ret = *addr; + __ia64_mf_a(); + return ret; +} + +/** + * sn_outb - write a byte to a port + * @port: port to write to + * @val: value to write + * + * Writes @val to @port. + */ +void +sn_outb (unsigned char val, unsigned long port) +{ + volatile unsigned char *addr = sn_io_addr(port); + + *addr = val; + mmiob(); +} + +/** + * sn_outw - write a word to a port + * @port: port to write to + * @val: value to write + * + * Writes @val to @port. + */ +void +sn_outw (unsigned short val, unsigned long port) +{ + volatile unsigned short *addr = sn_io_addr(port); + + *addr = val; + mmiob(); +} + +/** + * sn_outl - write a word to a port + * @port: port to write to + * @val: value to write + * + * Writes @val to @port. + */ +void +sn_outl (unsigned int val, unsigned long port) +{ + volatile unsigned int *addr = sn_io_addr(port); + + *addr = val; + mmiob(); +} diff -urN linux-2.4.18/arch/ia64/sn/kernel/irq.c lia64-2.4/arch/ia64/sn/kernel/irq.c --- linux-2.4.18/arch/ia64/sn/kernel/irq.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/irq.c Tue Feb 26 13:19:35 2002 @@ -0,0 +1,343 @@ +/* + * Platform dependent support for SGI SN1 + * + * Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/NoticeExplan + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef ajmtestintr +#include +#include +#endif /* ajmtestintr */ +#include +#include +#include +#include +#include +#include + +int irq_to_bit_pos(int irq); + + + +static unsigned int +sn_startup_irq(unsigned int irq) +{ + return(0); +} + +static void +sn_shutdown_irq(unsigned int irq) +{ +} + +static void +sn_disable_irq(unsigned int irq) +{ +} + +static void +sn_enable_irq(unsigned int irq) +{ +} + +static void +sn_ack_irq(unsigned int irq) +{ +#ifdef CONFIG_IA64_SGI_SN1 + int bit = -1; + unsigned long long intpend_val; + int subnode; +#endif +#ifdef CONFIG_IA64_SGI_SN2 + unsigned long event_occurred, mask = 0; +#endif + int nasid; + + irq = irq & 0xff; + nasid = smp_physical_node_id(); +#ifdef CONFIG_IA64_SGI_SN1 + subnode = cpuid_to_subnode(smp_processor_id()); + if (irq == SGI_UART_IRQ) { + intpend_val = REMOTE_HUB_PI_L(nasid, subnode, PI_INT_PEND0); + if (intpend_val & (1L<> 8; + + irq = irq & 0xff; + + return(_sn_irq_desc[cpu] + irq); +} + +u8 +sn_irq_to_vector(u8 irq) { + return(irq & 0xff); +} + +unsigned int +sn_local_vector_to_irq(u8 vector) { + return (CPU_VECTOR_TO_IRQ(smp_processor_id(), vector)); +} + +int +sn_valid_irq(u8 irq) { + + return( ((irq & 0xff) < NR_IRQS) && ((irq >> 8) < NR_CPUS) ); +} + +void *kmalloc(size_t, int); + +void +sn_irq_init (void) +{ + int i; + irq_desc_t *base_desc = _irq_desc; + + for (i=IA64_FIRST_DEVICE_VECTOR; i 118) bit = 118; + +#ifdef CONFIG_IA64_SGI_SN1 + if (bit >= GFX_INTR_A && bit <= CC_PEND_B) { + return SGI_UART_IRQ; + } +#endif + + return bit + BIT_TO_IRQ; +} + +int +irq_to_bit_pos(int irq) { +#define IRQ_TO_BIT 64 + int bit = irq - IRQ_TO_BIT; + + return bit; +} + +#ifdef ajmtestintr + +#include +struct timer_list intr_test_timer; +int intr_test_icount[NR_IRQS]; +struct intr_test_reg_struct { + pcibr_soft_t pcibr_soft; + int slot; +}; +struct intr_test_reg_struct intr_test_registered[NR_IRQS]; + +void +intr_test_handle_timer(unsigned long data) { + int i; + bridge_t *bridge; + + for (i=0;ibs_intr[intr_test_registered[i].slot].bsi_xtalk_intr; + /* send interrupt */ + bridge = pcibr_soft->bs_base; + bridge->b_force_always[intr_test_registered[i].slot].intr = 1; + } + } + del_timer(&intr_test_timer); + intr_test_timer.expires = jiffies + HZ/100; + add_timer(&intr_test_timer); +} + +void +intr_test_set_timer(void) { + intr_test_timer.expires = jiffies + HZ/100; + intr_test_timer.function = intr_test_handle_timer; + add_timer(&intr_test_timer); +} + +void +intr_test_register_irq(int irq, pcibr_soft_t pcibr_soft, int slot) { + irq = irq & 0xff; + intr_test_registered[irq].pcibr_soft = pcibr_soft; + intr_test_registered[irq].slot = slot; +} + +void +intr_test_handle_intr(int irq, void *junk, struct pt_regs *morejunk) { + intr_test_icount[irq]++; + printk("RECEIVED %d INTERRUPTS ON IRQ %d\n",intr_test_icount[irq], irq); +} +#endif /* ajmtestintr */ diff -urN linux-2.4.18/arch/ia64/sn/kernel/llsc4.c lia64-2.4/arch/ia64/sn/kernel/llsc4.c --- linux-2.4.18/arch/ia64/sn/kernel/llsc4.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/llsc4.c Tue Feb 26 13:19:35 2002 @@ -0,0 +1,1044 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "llsc4.h" + + +#ifdef STANDALONE +#include "lock.h" +#endif + +#ifdef INTTEST +static int inttest=0; +#endif + +#ifdef IA64_SEMFIX_INSN +#undef IA64_SEMFIX_INSN +#endif +#ifdef IA64_SEMFIX +#undef IA64_SEMFIX +#endif +# define IA64_SEMFIX_INSN +# define IA64_SEMFIX "" + +#define NOLOCK 0xdead +#define BGUARD(linei) (0xbbbb0000 | (linei)); +#define EGUARD(linei) (0xeeee0000 | (linei)); +#define GUARDLINE(v) ((v)&0xffff) + +/* + * Test parameter table for AUTOTEST + */ +typedef struct { + int passes; + int linecount; + int linepad; +} autotest_table_t; + +autotest_table_t autotest_table[] = { + {50000000, 2, 0x2b4 }, + {50000000, 16, 0, }, + {50000000, 16, 4, }, + {50000000, 128, 0x44 }, + {50000000, 128, 0x84 }, + {50000000, 128, 0x200 }, + {50000000, 128, 0x204 }, + {50000000, 128, 0x2b4 }, + {50000000, 2, 8*MB+0x2b4 }, + {50000000, 16, 8*MB+0 }, + {50000000, 16, 8*MB+4 }, + {50000000, 128, 8*MB+0x44 }, + {50000000, 128, 8*MB+0x84 }, + {50000000, 128, 8*MB+0x200 }, + {50000000, 128, 8*MB+0x204 }, + {50000000, 128, 8*MB+0x2b4 }, + {0}}; + +/* + * Array of virtual addresses available for test purposes. + */ + +typedef struct { + long vstart; + long vend; + long nextaddr; + long nextinit; + int wrapcount; +} memmap_t; + +#define MAPCHUNKS 128 +memmap_t memmap[MAPCHUNKS]; +int memmapx=0; + +typedef struct { + void *addr; + long data[16]; + long data_fc[16]; +} capture_line_t; + +typedef struct { + int size; + void *blockaddr; + void *shadaddr; + long blockdata[48]; + long shaddata[48]; + long blockdata_fc[48]; + long shaddata_fc[48]; + long synerr; +} capture_t; + +/* + * PORTING NOTE: revisit this statement. On hardware we put mbase at 0 and + * the rest of the tables have to start at 1MB to skip PROM tables. + */ +#define THREADPRIVATESZ() ((sizeof(threadprivate_t)+511)/512*512) +#define THREADPRIVATE(t) ((threadprivate_t*)(((long)mbase)+4096+t*THREADPRIVATESZ())) + +#define k_capture mbase->sk_capture +#define k_go mbase->sk_go +#define k_linecount mbase->sk_linecount +#define k_passes mbase->sk_passes +#define k_napticks mbase->sk_napticks +#define k_stop_on_error mbase->sk_stop_on_error +#define k_verbose mbase->sk_verbose +#define k_threadprivate mbase->sk_threadprivate +#define k_blocks mbase->sk_blocks +#define k_iter_msg mbase->sk_iter_msg +#define k_vv mbase->sk_vv +#define k_linepad mbase->sk_linepad +#define k_options mbase->sk_options +#define k_testnumber mbase->sk_testnumber +#define k_currentpass mbase->sk_currentpass + +static long blocks[MAX_LINECOUNT]; /* addresses of data blocks */ +static control_t *mbase; +static vint initialized=0; + +static unsigned int ran_conf_llsc(int); +static int rerr(capture_t *, char *, void *, void *, int, int, int, int, int, int); +static void dumpline(void *, char *, char *, void *, void *, int); +static int checkstop(int, int, uint); +static void spin(int); +static void capturedata(capture_t *, uint, void *, void *, int); +static int randn(uint max, uint *seed); +static uint zrandom (uint *zranseed); +static int set_lock(uint *, uint); +static int clr_lock(uint *, uint); +static void Speedo(void); + +int autotest_enabled=0; +static int llsctest_number=-1; +static int errstop_enabled=0; +static int fail_enabled=0; +static int l4_opt=0; +static int selective_trigger=0; +static int dump_block_addrs_opt=0; +static lock_t errlock=NOLOCK; +static private_t init_private[LLSC_MAXCPUS]; + +static int __init autotest_enable(char *str) +{ + autotest_enabled = 1; + return 1; +} +static int __init set_llscblkadr(char *str) +{ + dump_block_addrs_opt = 1; + return 1; +} +static int __init set_llscselt(char *str) +{ + selective_trigger = 1; + return 1; +} +static int __init set_llsctest(char *str) +{ + llsctest_number = simple_strtol(str, &str, 10); + if (llsctest_number < 0 || llsctest_number > 15) + llsctest_number = -1; + return 1; +} +static int __init set_llscerrstop(char *str) +{ + errstop_enabled = 1; + return 1; +} +static int __init set_llscfail(char *str) +{ + fail_enabled = 8; + return 1; +} +static int __init set_llscl4(char *str) +{ + l4_opt = 1; + return 1; +} + +static void print_params(void) +{ + printk ("********* Enter AUTOTEST facility on master cpu *************\n"); + printk (" Test options:\n"); + printk (" llsctest=\t%d\tTest number to run (all = -1)\n", llsctest_number); + printk (" llscerrstop \t%s\tStop on error\n", errstop_enabled ? "on" : "off"); + printk (" llscfail \t%s\tForce a failure to test the trigger & error messages\n", fail_enabled ? "on" : "off"); + printk (" llscselt \t%s\tSelective triger on failures\n", selective_trigger ? "on" : "off"); + printk (" llscblkadr \t%s\tDump data block addresses\n", dump_block_addrs_opt ? "on" : "off"); + printk (" llscl4 \t%s\tRun only tests that evict from L4\n", l4_opt ? "on" : "off"); + printk (" SEMFIX: %s\n", IA64_SEMFIX); + printk ("\n"); +} +__setup("autotest", autotest_enable); +__setup("llsctest=", set_llsctest); +__setup("llscerrstop", set_llscerrstop); +__setup("llscfail", set_llscfail); +__setup("llscselt", set_llscselt); +__setup("llscblkadr", set_llscblkadr); +__setup("llscl4", set_llscl4); + + + +static inline int +set_lock(uint *lock, uint id) +{ + uint old; + old = cmpxchg_acq(lock, NOLOCK, id); + return (old == NOLOCK); +} + +static inline int +clr_lock(uint *lock, uint id) +{ + uint old; + old = cmpxchg_rel(lock, id, NOLOCK); + return (old == id); +} + +static inline void +init_lock(uint *lock) +{ + *lock = NOLOCK; +} + +/*------------------------------------------------------------------------+ +| Routine : ran_conf_llsc - ll/sc shared data test | +| Description: This test checks the coherency of shared data | ++------------------------------------------------------------------------*/ +static unsigned int +ran_conf_llsc(int thread) +{ + private_t pval; + share_t sval, sval2; + uint vv, linei, slinei, sharei, pass; + long t; + lock_t lockpat; + share_t *sharecopy; + long verbose, napticks, passes, linecount, lcount; + dataline_t *linep, *slinep; + int s, seed; + threadprivate_t *tp; + uint iter_msg, iter_msg_i=0; + int vv_mask; + int correct_errors; + int errs=0; + int stillbad; + capture_t capdata; + private_t *privp; + share_t *sharep; + + + linecount = k_linecount; + napticks = k_napticks; + verbose = k_verbose; + passes = k_passes; + iter_msg = k_iter_msg; + seed = (thread + 1) * 647; + tp = THREADPRIVATE(thread); + vv_mask = (k_vv>>((thread%16)*4)) & 0xf; + correct_errors = k_options&0xff; + + memset (&capdata, 0, sizeof(capdata)); + for (linei=0; lineiprivate[linei] = thread; + + for (pass = 1; passes == 0 || pass < passes; pass++) { + lockpat = (pass & 0x0fffffff) + (thread <<28); + if (lockpat == NOLOCK) + continue; + tp->threadpasses = pass; + if (checkstop(thread, pass, lockpat)) + return 0; + iter_msg_i++; + if (iter_msg && iter_msg_i > iter_msg) { + printk("Thread %d, Pass %d\n", thread, pass); + iter_msg_i = 0; + } + lcount = 0; + + /* + * Select line to perform operations on. + */ + linei = randn(linecount, &seed); + sharei = randn(2, &seed); + slinei = (linei + (linecount/2))%linecount; /* I dont like this - fix later */ + + linep = (dataline_t *)blocks[linei]; + slinep = (dataline_t *)blocks[slinei]; + if (sharei == 0) + sharecopy = &slinep->share0; + else + sharecopy = &slinep->share1; + + + vv = randn(4, &seed); + if ((vv_mask & (1<private[thread]; + sharep = &linep->share[sharei]; + + switch(vv) { + case 0: + /* Read and verify private count on line. */ + pval = *privp; + if (verbose) + printk("Line:%3d, Thread:%d:%d. Val: %x\n", linei, thread, vv, tp->private[linei]); + if (pval != tp->private[linei]) { + capturedata(&capdata, pass, privp, NULL, sizeof(*privp)); + stillbad = (*privp != tp->private[linei]); + if (rerr(&capdata, "Private count", linep, slinep, thread, pass, linei, tp->private[linei], pval, stillbad)) { + return 1; + } + if (correct_errors) { + tp->private[linei] = *privp; + } + errs++; + } + break; + + case 1: + /* Read, verify, and increment private count on line. */ + pval = *privp; + if (verbose) + printk("Line:%3d, Thread:%d:%d. Val: %x\n", linei, thread, vv, tp->private[linei]); + if (pval != tp->private[linei]) { + capturedata(&capdata, pass, privp, NULL, sizeof(*privp)); + stillbad = (*privp != tp->private[linei]); + if (rerr(&capdata, "Private count & inc", linep, slinep, thread, pass, linei, tp->private[linei], pval, stillbad)) { + return 1; + } + errs++; + } + pval = (pval==255) ? 0 : pval+1; + *privp = pval; + tp->private[linei] = pval; + break; + + case 2: + /* Lock line, read and verify shared data. */ + if (verbose) + printk("Line:%3d, Thread:%d:%d. Val: %x\n", linei, thread, vv, *sharecopy); + lcount = 0; + while (LOCK(sharei) != 1) { + if (checkstop(thread, pass, lockpat)) + return 0; + if (lcount++>1000000) { + capturedata(&capdata, pass, LOCKADDR(sharei), NULL, sizeof(lock_t)); + stillbad = (GETLOCK(sharei) != 0); + rerr(&capdata, "Shared data lock", linep, slinep, thread, pass, linei, 0, GETLOCK(sharei), stillbad); + return 1; + } + if ((lcount&0x3fff) == 0) + udelay(1000); + } + + sval = *sharep; + sval2 = *sharecopy; + if (pass > 12 && thread == 0 && fail_enabled == 1) + sval++; + if (sval != sval2) { + capturedata(&capdata, pass, sharep, sharecopy, sizeof(*sharecopy)); + stillbad = (*sharep != *sharecopy); + if (!stillbad && *sharep != sval && *sharecopy == sval2) + stillbad = 2; + if (rerr(&capdata, "Shared data", linep, slinep, thread, pass, linei, sval2, sval, stillbad)) { + return 1; + } + if (correct_errors) + *sharep = *sharecopy; + errs++; + } + + + if ( (s=UNLOCK(sharei)) != 1) { + capturedata(&capdata, pass, LOCKADDR(sharei), NULL, 4); + stillbad = (GETLOCK(sharei) != lockpat); + if (rerr(&capdata, "Shared data unlock", linep, slinep, thread, pass, linei, lockpat, GETLOCK(sharei), stillbad)) + return 1; + if (correct_errors) + ZEROLOCK(sharei); + errs++; + } + break; + + case 3: + /* Lock line, read and verify shared data, modify shared data. */ + if (verbose) + printk("Line:%3d, Thread:%d:%d. Val: %x\n", linei, thread, vv, *sharecopy); + lcount = 0; + while (LOCK(sharei) != 1) { + if (checkstop(thread, pass, lockpat)) + return 0; + if (lcount++>1000000) { + capturedata(&capdata, pass, LOCKADDR(sharei), NULL, sizeof(lock_t)); + stillbad = (GETLOCK(sharei) != 0); + rerr(&capdata, "Shared data lock & inc", linep, slinep, thread, pass, linei, 0, GETLOCK(sharei), stillbad); + return 1; + } + if ((lcount&0x3fff) == 0) + udelay(1000); + } + sval = *sharep; + sval2 = *sharecopy; + if (sval != sval2) { + capturedata(&capdata, pass, sharep, sharecopy, sizeof(*sharecopy)); + stillbad = (*sharep != *sharecopy); + if (!stillbad && *sharep != sval && *sharecopy == sval2) + stillbad = 2; + if (rerr(&capdata, "Shared data & inc", linep, slinep, thread, pass, linei, sval2, sval, stillbad)) { + return 1; + } + errs++; + } + + *sharep = lockpat; + *sharecopy = lockpat; + + + if ( (s=UNLOCK(sharei)) != 1) { + capturedata(&capdata, pass, LOCKADDR(sharei), NULL, 4); + stillbad = (GETLOCK(sharei) != lockpat); + if (rerr(&capdata, "Shared data & inc unlock", linep, slinep, thread, pass, linei, thread, GETLOCK(sharei), stillbad)) + return 1; + if (correct_errors) + ZEROLOCK(sharei); + errs++; + } + break; + } + } + + return (errs > 0); +} + +static void +trigger_la(long val) +{ + long *p; + + p = (long*)0xc0000a0001000020L; /* PI_CPU_NUM */ + *p = val; +} + +static long +getsynerr(void) +{ + long err, *errp; + + errp = (long*)0xc0000e0000000340L; /* SYN_ERR */ + err = *errp; + if (err) + *errp = -1L; + return (err & ~0x60); +} + +static int +rerr(capture_t *cap, char *msg, void *lp, void *slp, int thread, int pass, int badlinei, int exp, int found, int stillbad) +{ + int cpu, i, linei; + long synerr; + int selt; + + + selt = selective_trigger && stillbad > 1 && + memcmp(cap->blockdata, cap->blockdata_fc, 128) != 0 && + memcmp(cap->shaddata, cap->shaddata_fc, 128) == 0; + if (selt) { + trigger_la(pass); + } else if (selective_trigger) { + k_go = ST_STOP; + return k_stop_on_error;; + } + + spin(1); + i = 100; + while (i && set_lock(&errlock, 1) != 1) { + spin(1); + i--; + } + printk ("\nDataError!: %-20s, test %ld, thread %d, line:%d, pass %d (0x%x), time %ld expected:%x, found:%x\n", + msg, k_testnumber, thread, badlinei, pass, pass, jiffies, exp, found); + + dumpline (lp, "Corrupted data", "D ", cap->blockaddr, cap->blockdata, cap->size); +#ifdef ZZZ + if (memcmp(cap->blockdata, cap->blockdata_fc, 128)) + dumpline (lp, "Corrupted data", "DF", cap->blockaddr, cap->blockdata_fc, cap->size); +#endif + + if (cap->shadaddr) { + dumpline (slp, "Shadow data", "S ", cap->shadaddr, cap->shaddata, cap->size); +#ifdef ZZZ + if (memcmp(cap->shaddata, cap->shaddata_fc, 128)) + dumpline (slp, "Shadow data", "SF", cap->shadaddr, cap->shaddata_fc, cap->size); +#endif + } + + printk("Threadpasses: "); + for (cpu=0,i=0; cputhreadpasses) { + if (i && (i%8) == 0) + printk("\n : "); + printk(" %d:0x%x", cpu, k_threadprivate[cpu]->threadpasses); + i++; + } + printk("\n"); + + for (linei=0; lineiguard1); + g2linei = GUARDLINE(linep->guard2); + g1err = (g1linei != linei); + g2err = (g2linei != linei); + sh0err = (linep->share[0] != slinep->share0); + sh1err = (linep->share[1] != slinep->share1); + + if (g1err || g2err || sh0err || sh1err) { + printk("Line 0x%lx (%03d), %sG1 0x%lx (%03d), %sG2 0x%lx (%03d), %sSH0 %08x (%08x), %sSH1 %08x (%08x)\n", + blocks[linei], linei, + g1err ? "*" : " ", blocks[g1linei], g1linei, + g2err ? "*" : " ", blocks[g2linei], g2linei, + sh0err ? "*" : " ", linep->share[0], slinep->share0, + sh1err ? "*" : " ", linep->share[1], slinep->share1); + + + } + } + + printk("\nData was %sfixed by flushcache\n", (stillbad == 1 ? "**** NOT **** " : " ")); + synerr = getsynerr(); + if (synerr) + printk("SYNERR: Thread %d, Synerr: 0x%lx\n", thread, synerr); + spin(2); + printk("\n\n"); + clr_lock(&errlock, 1); + + if (errstop_enabled) { + local_irq_disable(); + while(1); + } + return k_stop_on_error; +} + + +static void +dumpline(void *lp, char *str1, char *str2, void *addr, void *data, int size) +{ + long *p; + int i, off; + + printk("%s at 0x%lx, size %d, block starts at 0x%lx\n", str1, (long)addr, size, (long)lp); + p = (long*) data; + for (i=0; i<48; i++, p++) { + if (i%8 == 0) printk("%2s", i==16 ? str2 : " "); + printk(" %016lx", *p); + if ((i&7)==7) printk("\n"); + } + printk(" "); + off = (((long)addr) ^ size) & 63L; + for (i=0; i=off) ? "--" : " "); + if ((i%8) == 7) + printk(" "); + } + + off = ((long)addr) & 127; + printk(" (line %d)\n", 2+off/64+1); +} + + +static int +randn(uint max, uint *seedp) +{ + if (max == 1) + return(0); + else + return((int)(zrandom(seedp)>>10) % max); +} + + +static int +checkstop(int thread, int pass, uint lockpat) +{ + long synerr; + + if (k_go == ST_RUN) + return 0; + if (k_go == ST_STOP) + return 1; + + if (errstop_enabled) { + local_irq_disable(); + while(1); + } + synerr = getsynerr(); + spin(2); + if (k_go == ST_STOP) + return 1; + if (synerr) + printk("SYNERR: Thread %d, Synerr: 0x%lx\n", thread, synerr); + return 1; +} + + +static void +spin(int j) +{ + udelay(j * 500000); +} + +static void +capturedata(capture_t *cap, uint pass, void *blockaddr, void *shadaddr, int size) +{ + + if (!selective_trigger) + trigger_la (pass); + + memcpy (cap->blockdata, CACHEALIGN(blockaddr)-128, 3*128); + if (shadaddr) + memcpy (cap->shaddata, CACHEALIGN(shadaddr)-128, 3*128); + + if (k_stop_on_error) { + k_go = ST_ERRSTOP; + } + + cap->size = size; + cap->blockaddr = blockaddr; + cap->shadaddr = shadaddr; + + asm volatile ("fc %0" :: "r"(blockaddr) : "memory"); + ia64_sync_i(); + ia64_srlz_d(); + memcpy (cap->blockdata_fc, CACHEALIGN(blockaddr)-128, 3*128); + + if (shadaddr) { + asm volatile ("fc %0" :: "r"(shadaddr) : "memory"); + ia64_sync_i(); + ia64_srlz_d(); + memcpy (cap->shaddata_fc, CACHEALIGN(shadaddr)-128, 3*128); + } +} + +int zranmult = 0x48c27395; + +static uint +zrandom (uint *seedp) +{ + *seedp = (*seedp * zranmult) & 0x7fffffff; + return (*seedp); +} + + +void +set_autotest_params(void) +{ + static int testnumber=-1; + + if (llsctest_number >= 0) { + testnumber = llsctest_number; + } else { + testnumber++; + if (autotest_table[testnumber].passes == 0) { + testnumber = 0; + dump_block_addrs_opt = 0; + } + } + if (testnumber == 0 && l4_opt) testnumber = 9; + + k_passes = autotest_table[testnumber].passes; + k_linepad = autotest_table[testnumber].linepad; + k_linecount = autotest_table[testnumber].linecount; + k_testnumber = testnumber; + + if (IS_RUNNING_ON_SIMULATOR()) { + printk ("llsc start test %ld\n", k_testnumber); + k_passes = 1000; + } +} + + +static void +set_leds(int errs) +{ + unsigned char leds=0; + + /* + * Leds are: + * ppppeee- + * where + * pppp = test number + * eee = error count but top bit is stick + */ + + leds = ((errs&7)<<1) | ((k_testnumber&15)<<4) | (errs ? 0x08 : 0); + set_led_bits(leds, LED_MASK_AUTOTEST); +} + +static void +setup_block_addresses(void) +{ + int i, stride, memmapi; + dataline_t *dp; + long *ip, *ipe; + + + stride = k_linepad + sizeof(dataline_t); + memmapi = 0; + for (i=0; i= memmap[memmapi].vend) { + memmap[memmapi].wrapcount++; + memmap[memmapi].nextaddr = memmap[memmapi].vstart + + memmap[memmapi].wrapcount * sizeof(dataline_t); + } + + ip = (long*)((memmap[memmapi].nextinit+7)&~7); + ipe = (long*)(memmap[memmapi].nextaddr+2*sizeof(dataline_t)+8); + while(ip <= ipe && ip < ((long*)memmap[memmapi].vend-8)) + *ip++ = (long)ip; + memmap[memmapi].nextinit = (long) ipe; + dp->guard1 = BGUARD(i); + dp->guard2 = EGUARD(i); + dp->lock[0] = dp->lock[1] = NOLOCK; + dp->share[0] = dp->share0 = 0x1111; + dp->share[1] = dp->share1 = 0x2222; + memcpy(dp->private, init_private, LLSC_MAXCPUS*sizeof(private_t)); + + + if (stride > 16384) { + memmapi++; + if (memmapi == memmapx) + memmapi = 0; + } + } + +} + +static void +dump_block_addrs(void) +{ + int i; + + printk("LLSC TestNumber %ld\n", k_testnumber); + + for (i=0; ithreadstate == TS_KILLED) { + set_led_bits(LED_MASK_AUTOTEST, LED_MASK_AUTOTEST); + while(1); + } + k_threadprivate[cpuid]->threadstate = state; +} + +#define MINBLK (16*1024*1024) +static int +build_mem_map(unsigned long start, unsigned long end, void *arg) +{ + long lstart, lend; + long align = 8*MB; + + printk ("LLSC memmap: start 0x%lx, end 0x%lx, (0x%lx - 0x%lx)\n", + start, end, (long) virt_to_page(start), (long) virt_to_page(end-PAGE_SIZE)); + + if (memmapx >= MAPCHUNKS || (end-start) < MINBLK) + return 0; + + /* + * Start in the middle of the range & find the first non-free page in both directions + * from the midpoint. This is likely to be the bigest free block. + */ + lend = lstart = start + (end-start)/2; + while (lend < end && !PageReserved(virt_to_page(lend)) && virt_to_page(lend)->count.counter == 0) + lend += PAGE_SIZE; + lend -= PAGE_SIZE; + + while (lstart >= start && !PageReserved(virt_to_page(lstart)) && virt_to_page(lstart)->count.counter == 0) + lstart -= PAGE_SIZE; + lstart += PAGE_SIZE; + + lstart = (lstart + align -1) /align * align; + end = end / align * align; + if (lstart >= end) + return 0; + printk (" memmap: start 0x%lx, end 0x%lx\n", lstart, end); + + memmap[memmapx].vstart = lstart; + memmap[memmapx].vend = end; + memmapx++; + return 0; +} + +void int_test(void); + +int +llsc_main (int cpuid) +{ + int i, cpu, is_master, repeatcnt=0; + unsigned int preverr=0, errs=0, pass=0; + int automode=0; + +#ifdef INTTEST + if (inttest) + int_test(); +#endif + + if (!autotest_enabled) + return 0; + +#ifdef CONFIG_SMP + is_master = !smp_processor_id(); +#else + is_master = 1; +#endif + + + if (is_master) { + mbase = (control_t*) __get_free_pages(GFP_KERNEL, get_order(4096+THREADPRIVATESZ()*LLSC_MAXCPUS)); + printk("LLSC: mbase 0x%lx\n", (long)mbase); + print_params(); + if(!IS_RUNNING_ON_SIMULATOR()) + spin(10); + k_currentpass = 0; + k_go = ST_IDLE; + k_passes = DEF_PASSES; + k_napticks = DEF_NAPTICKS; + k_stop_on_error = DEF_STOP_ON_ERROR; + k_verbose = DEF_VERBOSE; + k_linecount = DEF_LINECOUNT; + k_iter_msg = DEF_ITER_MSG; + k_vv = DEF_VV; + k_linepad = DEF_LINEPAD; + k_blocks = (void*)blocks; + efi_memmap_walk(build_mem_map, 0); + +#ifdef CONFIG_IA64_SGI_AUTOTEST + automode = 1; +#endif + + for (i=0; i 5) { + set_autotest_params(); + repeatcnt = 0; + } + } else { + while (k_go == ST_IDLE); + } + + k_go = ST_INIT; + if (k_linecount > MAX_LINECOUNT) k_linecount = MAX_LINECOUNT; + k_linecount = k_linecount & ~1; + setup_block_addresses(); + if (!preverr && dump_block_addrs_opt) + dump_block_addrs(); + + k_currentpass = pass++; + k_go = ST_RUN; + if (fail_enabled) + fail_enabled--; + + } else { + while (k_go != ST_RUN || k_currentpass != pass); + pass++; + } + + + set_leds(errs); + set_thread_state(cpuid, TS_RUNNING); + + errs += ran_conf_llsc(cpuid); + preverr = (k_go == ST_ERRSTOP); + + set_leds(errs); + set_thread_state(cpuid, TS_STOPPED); + + if (is_master) { + Speedo(); + for (i=0, cpu=0; cputhreadstate == TS_RUNNING) { + i++; + if (i == 10000) { + k_go = ST_STOP; + printk (" llsc master stopping test number %ld\n", k_testnumber); + } + if (i > 100000) { + k_threadprivate[cpu]->threadstate = TS_KILLED; + printk (" llsc: master killing cpuid %d, running test number %ld\n", + cpu, k_testnumber); + } + udelay(1000); + } + } + } + + goto loop; +} + + +static void +Speedo(void) +{ + static int i = 0; + + switch (++i%4) { + case 0: + printk("|\b"); + break; + case 1: + printk("\\\b"); + break; + case 2: + printk("-\b"); + break; + case 3: + printk("/\b"); + break; + } +} + +#ifdef INTTEST + +/* ======================================================================================================== + * + * Some test code to verify that interrupts work + * + * Add the following to the arch/ia64/kernel/smp.c after the comment "Reschedule callback" + * if (zzzprint_resched) printk(" cpu %d got interrupt\n", smp_processor_id()); + * + * Enable the code in arch/ia64/sn/sn1/smp.c to print sending IPIs. + * + */ + +static int __init set_inttest(char *str) +{ + inttest = 1; + autotest_enabled = 1; + + return 1; +} + +__setup("inttest=", set_inttest); + +int zzzprint_resched=0; + +void +int_test() { + int mycpu, cpu; + static volatile int control_cpu=0; + + mycpu = smp_processor_id(); + zzzprint_resched = 2; + + printk("Testing cross interrupts\n"); + + while (control_cpu != smp_num_cpus) { + if (mycpu == cpu_logical_map(control_cpu)) { + for (cpu=0; cpulock[(i)] +#define LOCK(i) set_lock(LOCKADDR(i), lockpat) +#define UNLOCK(i) clr_lock(LOCKADDR(i), lockpat) +#define GETLOCK(i) *LOCKADDR(i) +#define ZEROLOCK(i) init_lock(LOCKADDR(i)) + +#define CACHEALIGN(a) ((char*)((long)(a) & ~127L)) + +typedef uint guard_t; +typedef uint lock_t; +typedef uint share_t; +typedef uchar private_t; + +typedef struct { + guard_t guard1; + lock_t lock[2]; + share_t share[2]; + private_t private[LLSC_MAXCPUS]; + share_t share0; + share_t share1; + guard_t guard2; +} dataline_t ; + + +#define LINEPAD k_linepad +#define LINESTRIDE (((sizeof(dataline_t)+CACHELINE-1)/CACHELINE)*CACHELINE + LINEPAD) + + +typedef struct { + vint threadstate; + uint threadpasses; + private_t private[MAX_LINECOUNT]; +} threadprivate_t; + +typedef struct { + vlong sk_go; /* 0=idle, 1=init, 2=run */ + long sk_linecount; + long sk_passes; + long sk_napticks; + long sk_stop_on_error; + long sk_verbose; + long sk_iter_msg; + long sk_vv; + long sk_linepad; + long sk_options; + long sk_testnumber; + vlong sk_currentpass; + void *sk_blocks; + threadprivate_t *sk_threadprivate[LLSC_MAXCPUS]; +} control_t; + +/* Run state (k_go) constants */ +#define ST_IDLE 0 +#define ST_INIT 1 +#define ST_RUN 2 +#define ST_STOP 3 +#define ST_ERRSTOP 4 + + +/* Threadstate constants */ +#define TS_STOPPED 0 +#define TS_RUNNING 1 +#define TS_KILLED 2 + + + +int llsc_main (int cpuid); + diff -urN linux-2.4.18/arch/ia64/sn/kernel/machvec.c lia64-2.4/arch/ia64/sn/kernel/machvec.c --- linux-2.4.18/arch/ia64/sn/kernel/machvec.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/machvec.c Tue Feb 26 13:19:35 2002 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/NoticeExplan + */ + +#include + +#ifdef CONFIG_IA64_SGI_SN1 +#define MACHVEC_PLATFORM_NAME sn1 +#else CONFIG_IA64_SGI_SN1 +#define MACHVEC_PLATFORM_NAME sn2 +#else +#error "unknown platform" +#endif + +#include +#include +#include +void* +sn_mk_io_addr_MACRO + +dma_addr_t +sn_pci_map_single_MACRO + +int +sn_pci_map_sg_MACRO + +unsigned long +sn_virt_to_phys_MACRO + +void * +sn_phys_to_virt_MACRO diff -urN linux-2.4.18/arch/ia64/sn/kernel/mca.c lia64-2.4/arch/ia64/sn/kernel/mca.c --- linux-2.4.18/arch/ia64/sn/kernel/mca.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/mca.c Mon Feb 4 17:50:55 2002 @@ -0,0 +1,280 @@ +/* + * File: mca.c + * Purpose: SN specific MCA code. + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/NoticeExplan + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +static char *shub_mmr_names[] = { + "sh_event_occurred", + "sh_first_error", + "sh_event_overflow", + +/* PI */ + "sh_pi_first_error", + "sh_pi_error_summary", + "sh_pi_error_overflow", + +/* PI HW */ + "sh_pi_error_detail_1", + "sh_pi_error_detail_2", + "sh_pi_hw_time_stamp", + +/* PI UCE */ + "sh_pi_uncorrected_detail_1", + "sh_pi_uncorrected_detail_2", + "sh_pi_uncorrected_detail_3", + "sh_pi_uncorrected_detail_4", + "sh_pi_uncor_time_stamp", + +/* PI CE */ + "sh_pi_corrected_detail_1", + "sh_pi_corrected_detail_2", + "sh_pi_corrected_detail_3", + "sh_pi_corrected_detail_4", + "sh_pi_cor_time_stamp", + +/* MD */ + "sh_mem_error_summary", + "sh_mem_error_overflow", +/* MD HW */ + "sh_misc_err_hdr_upper", + "sh_misc_err_hdr_lower", + "sh_md_dqlp_mmr_xperr_val", + "sh_md_dqlp_mmr_yperr_val", + "sh_md_dqrp_mmr_xperr_val", + "sh_md_dqrp_mmr_yperr_val", + "sh_md_hw_time_stamp", + +/* MD UCE */ + "sh_dir_uc_err_hdr_lower", + "sh_dir_uc_err_hdr_upper", + "sh_md_dqlp_mmr_xuerr1", + "sh_md_dqlp_mmr_xuerr2", + "sh_md_dqlp_mmr_yuerr1", + "sh_md_dqlp_mmr_yuerr2", + "sh_md_dqrp_mmr_xuerr1", + "sh_md_dqrp_mmr_xuerr2", + "sh_md_dqrp_mmr_yuerr1", + "sh_md_dqrp_mmr_yuerr2", + "sh_md_uncor_time_stamp", + +/* MD CE */ + "sh_dir_cor_err_hdr_lower", + "sh_dir_cor_err_hdr_upper", + "sh_md_dqlp_mmr_xcerr1", + "sh_md_dqlp_mmr_xcerr2", + "sh_md_dqlp_mmr_ycerr1", + "sh_md_dqlp_mmr_ycerr2", + "sh_md_dqrp_mmr_xcerr1", + "sh_md_dqrp_mmr_xcerr2", + "sh_md_dqrp_mmr_ycerr1", + "sh_md_dqrp_mmr_ycerr2", + "sh_md_cor_time_stamp", + +/* MD CE, UCE */ + "sh_md_dqls_mmr_xamopw_err", + "sh_md_dqrs_mmr_yamopw_err", + +/* XN */ + "sh_xn_error_summary", + "sh_xn_first_error", + "sh_xn_error_overflow", + +/* XN HW */ + "sh_xniilb_error_summary", + "sh_xniilb_first_error", + "sh_xniilb_error_overflow", + "sh_xniilb_error_detail_1", + "sh_xniilb_error_detail_2", + "sh_xniilb_error_detail_3", + + "sh_ni0_error_summary_1", + "sh_ni0_first_error_1", + "sh_ni0_error_overflow_1", + + "sh_ni0_error_summary_2", + "sh_ni0_first_error_2", + "sh_ni0_error_overflow_2", + "sh_ni0_error_detail_1", + "sh_ni0_error_detail_2", + "sh_ni0_error_detail_3", + + "sh_ni1_error_summary_1", + "sh_ni1_first_error_1", + "sh_ni1_error_overflow_1", + + "sh_ni1_error_summary_2", + "sh_ni1_first_error_2", + "sh_ni1_error_overflow_2", + + "sh_ni1_error_detail_1", + "sh_ni1_error_detail_2", + "sh_ni1_error_detail_3", + + "sh_xn_hw_time_stamp", + +/* XN HW & UCE & SBE */ + "sh_xnpi_error_summary", + "sh_xnpi_first_error", + "sh_xnpi_error_overflow", + "sh_xnpi_error_detail_1", + + "sh_xnmd_error_summary", + "sh_xnmd_first_error", + "sh_xnmd_error_overflow", + "sh_xnmd_ecc_err_report", + "sh_xnmd_error_detail_1", + +/* XN UCE */ + "sh_xn_uncorrected_detail_1", + "sh_xn_uncorrected_detail_2", + "sh_xn_uncorrected_detail_3", + "sh_xn_uncorrected_detail_4", + "sh_xn_uncor_time_stamp", + +/* XN CE */ + "sh_xn_corrected_detail_1", + "sh_xn_corrected_detail_2", + "sh_xn_corrected_detail_3", + "sh_xn_corrected_detail_4", + "sh_xn_cor_time_stamp", + +/* LB HW */ + "sh_lb_error_summary", + "sh_lb_first_error", + "sh_lb_error_overflow", + "sh_lb_error_detail_1", + "sh_lb_error_detail_2", + "sh_lb_error_detail_3", + "sh_lb_error_detail_4", + "sh_lb_error_detail_5", + "sh_junk_error_status", +}; + +void +sal_log_plat_print(int header_len, int sect_len, u8 *p_data, prfunc_t prfunc) +{ + sal_log_plat_info_t *sh_info = (sal_log_plat_info_t *) p_data; + u64 *mmr_val = (u64 *)&(sh_info->shub_state); + char **mmr_name = shub_mmr_names; + int mmr_count = sizeof(sal_log_shub_state_t)>>3; + + while(mmr_count) { + if(*mmr_val) { + prfunc("%-40s: %#016lx\n",*mmr_name, *mmr_val); + } + mmr_name++; + mmr_val++; + mmr_count--; + } + +} + +sn_cpei_handler(int irq, void *devid, struct pt_regs *regs) +{ + struct ia64_sal_retval isrv; + + /* + * this function's sole purpose is to call SAL when we receive + * a CE interrupt from SHUB or when the timer routine decides + * we need to call SAL to check for CEs. + */ + + /* CALL SAL_LOG_CE */ + SAL_CALL(isrv, SN_SAL_LOG_CE, irq, 0, 0, 0, 0, 0, 0); +} + +#include + +#define CPEI_INTERVAL (HZ/100) +struct timer_list sn_cpei_timer; +void sn_init_cpei_timer(void); + +void +sn_cpei_timer_handler(unsigned long dummy) { + sn_cpei_handler(-1, NULL, NULL); + del_timer(&sn_cpei_timer); + sn_cpei_timer.expires = jiffies + CPEI_INTERVAL; + add_timer(&sn_cpei_timer); +} + +void +sn_init_cpei_timer() { + sn_cpei_timer.expires = jiffies + CPEI_INTERVAL; + sn_cpei_timer.function = sn_cpei_timer_handler; + add_timer(&sn_cpei_timer); +} + +#ifdef ajmtestceintr + +struct timer_list sn_ce_timer; + +void +sn_ce_timer_handler(long dummy) { + unsigned long *pi_ce_error_inject_reg = 0xc00000092fffff00; + + *pi_ce_error_inject_reg = 0x0000000000000100; + del_timer(&sn_ce_timer); + sn_ce_timer.expires = jiffies + CPEI_INTERVAL; + add_timer(&sn_ce_timer); +} + +sn_init_ce_timer() { + sn_ce_timer.expires = jiffies + CPEI_INTERVAL; + sn_ce_timer.function = sn_ce_timer_handler; + add_timer(&sn_ce_timer); +} +#endif /* ajmtestceintr */ diff -urN linux-2.4.18/arch/ia64/sn/kernel/misctest.c lia64-2.4/arch/ia64/sn/kernel/misctest.c --- linux-2.4.18/arch/ia64/sn/kernel/misctest.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/misctest.c Fri May 3 11:16:24 2002 @@ -0,0 +1,122 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2000-2001 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include + + +extern int autotest_enabled; +int mcatest=0; + + + +/* + * mcatest + * 1 = expected MCA + * 2 = unexpected MCA + * 3 = expected MCA + unexpected MCA + * 4 = INIT + * 5 = speculative load to garbage memory address + * 6 = speculative load with ld8.s (needs poison hack in PROM) + * 7 = speculative load from mis-predicted branch (needs poison hack in PROM) + */ +static int __init set_mcatest(char *str) +{ + get_option(&str, &mcatest); + return 1; +} + +__setup("mcatest=", set_mcatest); + +void +sgi_mcatest(void) +{ + if (mcatest == 1 || mcatest == 3) { + long *p, result, adrs[] = {0xc0000a000f021004UL, 0xc0000a000f026004UL, 0x800000000, 0x500000, 0}; + long size[] = {1,2,4,8}; + int r, i, j; + p = (long*)0xc000000000000000UL; + ia64_fc(p); + *p = 0x0123456789abcdefL; + for (i=0; i<5; i++) { + for (j=0; j<4; j++) { + printk("Probing 0x%lx, size %ld\n", adrs[i], size[j]); + result = -1; + r = ia64_sn_probe_io_slot (adrs[i], size[j], &result); + printk(" status %d, val 0x%lx\n", r, result); + } + } + } + if (mcatest == 2 || mcatest == 3) { + void zzzmca(int, int, int); + printk("About to cause unexpected MCA\n"); + zzzmca(mcatest, 0x32dead, 0x33dead); + } + if (mcatest == 4) { + long *p; + int delivery_mode = 5; + printk("About to try to cause an INIT on cpu 0\n"); + p = (long*)((0xc0000a0000000000LL | ((long)get_nasid())<<33) | 0x1800080); + *p = (delivery_mode << 8); + udelay(10000); + printk("Returned from INIT\n"); + } + if (mcatest == 5) { + int zzzspec(long); + int i; + long psr, dcr, res, val, addr=0xff00000000UL; + + dcr = ia64_get_dcr(); + for (i=0; i<5; i++) { + printk("Default DCR: 0x%lx\n", ia64_get_dcr()); + printk("zzzspec: 0x%x\n", zzzspec(addr)); + ia64_set_dcr(0); + printk("New DCR: 0x%lx\n", ia64_get_dcr()); + printk("zzzspec: 0x%x\n", zzzspec(addr)); + ia64_set_dcr(dcr); + res = ia64_sn_probe_io_slot(0xff00000000UL, 8, &val); + printk("zzzspec: probe %ld, 0x%lx\n", res, val); + psr = ia64_clear_ic(); + ia64_itc(0x2, 0xe00000ff00000000UL, + pte_val(mk_pte_phys(0xff00000000UL, + __pgprot(__DIRTY_BITS|_PAGE_PL_0|_PAGE_AR_RW))), _PAGE_SIZE_256M); + ia64_set_psr(psr); + ia64_srlz_i (); + } + + } + if (mcatest == 6) { + int zzzspec(long); + int i; + long dcr, addr=0xe000000008000000UL; + + dcr = ia64_get_dcr(); + for (i=0; i<5; i++) { + printk("zzzspec: 0x%x\n", zzzspec(addr)); + ia64_set_dcr(0); + } + ia64_set_dcr(dcr); + } + if (mcatest == 7) { + int zzzspec2(long, long); + int i; + long addr=0xe000000008000000UL; + long addr2=0xe000000007000000UL; + + for (i=0; i<5; i++) { + printk("zzzspec2\n"); + zzzspec2(addr, addr2); + } + } +} diff -urN linux-2.4.18/arch/ia64/sn/kernel/probe.c lia64-2.4/arch/ia64/sn/kernel/probe.c --- linux-2.4.18/arch/ia64/sn/kernel/probe.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/probe.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,81 @@ +/* + * Platform dependent support for IO probing. + * + * Copyright (c) 2000-2002 Silicon Graphics, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/NoticeExplan + */ + +#include + +/** + * ia64_sn_probe_io_slot - test a memory location for readability + * @paddr: physical address to probe + * @size: number bytes to read (1,2,4,8) + * @data_ptr: address to store value read by probe (-1 returned if probe fails) + * + * This function will probe a physical address to determine if + * the address can be read. If reading the address causes a BUS + * error, an error is returned. If the probe succeeds, the contents + * of the memory location is returned. + * + * Return values: + * 0 - probe successful + * 1 - probe failed (generated MCA) + * 2 - Bad arg + * <0 - PAL error + */ +u64 +ia64_sn_probe_io_slot(long paddr, long size, void *data_ptr) +{ + struct ia64_sal_retval isrv; + + SAL_CALL(isrv, SN_SAL_PROBE, paddr, size, 0, 0, 0, 0, 0); + + if (data_ptr) { + switch (size) { + case 1: + *((u8*)data_ptr) = (u8)isrv.v0; + break; + case 2: + *((u16*)data_ptr) = (u16)isrv.v0; + break; + case 4: + *((u32*)data_ptr) = (u32)isrv.v0; + break; + case 8: + *((u64*)data_ptr) = (u64)isrv.v0; + break; + default: + isrv.status = 2; + } + } + + return isrv.status; +} diff -urN linux-2.4.18/arch/ia64/sn/kernel/setup.c lia64-2.4/arch/ia64/sn/kernel/setup.c --- linux-2.4.18/arch/ia64/sn/kernel/setup.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/setup.c Tue Feb 26 13:19:35 2002 @@ -0,0 +1,415 @@ +/* + * Copyright (C) 1999,2001-2002 Silicon Graphics, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/NoticeExplan + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#ifdef CONFIG_IA64_MCA +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_IA64_SGI_SN2 +#include +#endif + +extern void bte_init_node (nodepda_t *, cnodeid_t, char **); +extern void bte_init_cpu (void); + +long sn_rtc_cycles_per_second; + +/* + * This is the address of the RRegs in the HSpace of the global + * master. It is used by a hack in serial.c (serial_[in|out], + * printk.c (early_printk), and kdb_io.c to put console output on that + * node's Bedrock UART. It is initialized here to 0, so that + * early_printk won't try to access the UART before + * master_node_bedrock_address is properly calculated. + */ +u64 master_node_bedrock_address = 0UL; + +static void sn_init_pdas(char **); + +extern struct irq_desc *_sn_irq_desc[]; + +#if defined(CONFIG_IA64_SGI_SN1) +extern synergy_da_t *Synergy_da_indr[]; +#endif + +static nodepda_t *nodepdaindr[MAX_COMPACT_NODES]; + +#ifdef CONFIG_IA64_SGI_SN2 +irqpda_t *irqpdaindr[NR_CPUS]; +#endif /* CONFIG_IA64_SGI_SN2 */ + + +/* + * The format of "screen_info" is strange, and due to early i386-setup + * code. This is just enough to make the console code think we're on a + * VGA color display. + */ +struct screen_info sn_screen_info = { + orig_x: 0, + orig_y: 0, + orig_video_mode: 3, + orig_video_cols: 80, + orig_video_ega_bx: 3, + orig_video_lines: 25, + orig_video_isVGA: 1, + orig_video_points: 16 +}; + +/* + * This is here so we can use the CMOS detection in ide-probe.c to + * determine what drives are present. In theory, we don't need this + * as the auto-detection could be done via ide-probe.c:do_probe() but + * in practice that would be much slower, which is painful when + * running in the simulator. Note that passing zeroes in DRIVE_INFO + * is sufficient (the IDE driver will autodetect the drive geometry). + */ +char drive_info[4*16]; + +/** + * sn_map_nr - return the mem_map entry for a given kernel address + * @addr: kernel address to query + * + * Finds the mem_map entry for the kernel address given. Used by + * virt_to_page() (asm-ia64/page.h), among other things. + */ +unsigned long +sn_map_nr (unsigned long addr) +{ + return MAP_NR_DISCONTIG(addr); +} + +/** + * early_sn_setup - early setup routine for SN platforms + * + * Sets up an intial console to aid debugging. Intended primarily + * for bringup, it's only called if %BRINGUP and %CONFIG_IA64_EARLY_PRINTK + * are turned on. See start_kernel() in init/main.c. + */ +#if defined(CONFIG_IA64_EARLY_PRINTK) && defined(CONFIG_IA64_SGI_SN) +void __init +early_sn_setup(void) +{ + if ( IS_RUNNING_ON_SIMULATOR() ) { +#if defined(CONFIG_IA64_SGI_SN1) + master_node_bedrock_address = (u64)REMOTE_HSPEC_ADDR(get_nasid(), 0); +#else + master_node_bedrock_address = (u64)REMOTE_HUB(get_nasid(), SH_JUNK_BUS_UART0); +#endif + printk(KERN_DEBUG "early_sn_setup: setting master_node_bedrock_address to 0x%lx\n", master_node_bedrock_address); + } +} +#endif /* CONFIG_IA64_EARLY_PRINTK && CONFIG_IA64_SGI_SN */ + +#ifdef NOT_YET_CONFIG_IA64_MCA +extern void ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs); +static struct irqaction mca_cpe_irqaction = { + handler: ia64_mca_cpe_int_handler, + flags: SA_INTERRUPT, + name: "cpe_hndlr" +}; +#endif +#ifdef CONFIG_IA64_MCA +extern int platform_irq_list[]; +#endif + +extern nasid_t master_nasid; + +/** + * sn_setup - SN platform setup routine + * @cmdline_p: kernel command line + * + * Handles platform setup for SN machines. This includes determining + * the RTC frequency (via a SAL call), initializing secondary CPUs, and + * setting up per-node data areas. The console is also initialized here. + */ +void __init +sn_setup(char **cmdline_p) +{ + long status, ticks_per_sec, drift; + int i; + + master_nasid = get_nasid(); + (void)get_console_nasid(); + + status = ia64_sal_freq_base(SAL_FREQ_BASE_REALTIME_CLOCK, &ticks_per_sec, &drift); + if (status != 0 || ticks_per_sec < 100000) + printk(KERN_WARNING "unable to determine platform RTC clock frequency\n"); + else + sn_rtc_cycles_per_second = ticks_per_sec; + + for (i=0;ithread.flags |= IA64_THREAD_FPEMU_NOPRINT; +} + +/** + * sn_init_pdas - setup node data areas + * + * One time setup for Node Data Area. Called by sn_setup(). + */ +void +sn_init_pdas(char **cmdline_p) +{ + cnodeid_t cnode; + + /* + * Make sure that the PDA fits entirely in the same page as the + * cpu_data area. + */ + if ((PDAADDR&~PAGE_MASK)+sizeof(pda_t) > PAGE_SIZE) + panic("overflow of cpu_data page"); + + /* + * Allocate & initalize the nodepda for each node. + */ + for (cnode=0; cnode < numnodes; cnode++) { + nodepdaindr[cnode] = alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t)); + memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); + +#if defined(CONFIG_IA64_SGI_SN1) + Synergy_da_indr[cnode * 2] = (synergy_da_t *) alloc_bootmem_node(NODE_DATA(cnode), sizeof(synergy_da_t)); + Synergy_da_indr[cnode * 2 + 1] = (synergy_da_t *) alloc_bootmem_node(NODE_DATA(cnode), sizeof(synergy_da_t)); + memset(Synergy_da_indr[cnode * 2], 0, sizeof(synergy_da_t)); + memset(Synergy_da_indr[cnode * 2 + 1], 0, sizeof(synergy_da_t)); +#endif + } + + /* + * Now copy the array of nodepda pointers to each nodepda. + */ + for (cnode=0; cnode < numnodes; cnode++) + memcpy(nodepdaindr[cnode]->pernode_pdaindr, nodepdaindr, sizeof(nodepdaindr)); + + + /* + * Set up IO related platform-dependent nodepda fields. + * The following routine actually sets up the hubinfo struct + * in nodepda. + */ + for (cnode = 0; cnode < numnodes; cnode++) { + init_platform_nodepda(nodepdaindr[cnode], cnode); + bte_init_node (nodepdaindr[cnode], cnode, cmdline_p); + } +} + +/** + * sn_cpu_init - initialize per-cpu data areas + * @cpuid: cpuid of the caller + * + * Called during cpu initialization on each cpu as it starts. + * Currently, initializes the per-cpu data area for SNIA. + * Also sets up a few fields in the nodepda. Also known as + * platform_cpu_init() by the ia64 machvec code. + */ +void __init +sn_cpu_init(void) +{ + int cpuid; + int cpuphyid; + int nasid; + int slice; + int cnode; + + /* + * The boot cpu makes this call again after platform initialization is + * complete. + */ + if (nodepdaindr[0] == NULL) + return; + + cpuid = smp_processor_id(); + cpuphyid = ((ia64_get_lid() >> 16) & 0xffff); + nasid = cpu_physical_id_to_nasid(cpuphyid); + cnode = nasid_to_cnodeid(nasid); + slice = cpu_physical_id_to_slice(cpuphyid); + + pda.p_nodepda = nodepdaindr[cnode]; + pda.led_address = (long*) (LED0 + (slice<active_cpu_count == 1) + nodepda->node_first_cpu = cpuid; + +#ifdef CONFIG_IA64_SGI_SN1 + { + int synergy; + synergy = cpu_physical_id_to_synergy(cpuphyid); + pda.p_subnodepda = &nodepdaindr[cnode]->snpda[synergy]; + } +#endif + +#ifdef CONFIG_IA64_SGI_SN2 + + /* + * We must use different memory allocators for first cpu (bootmem + * allocator) than for the other cpus (regular allocator). + */ + if (cpuid == 0) + irqpdaindr[cpuid] = alloc_bootmem_node(NODE_DATA(cpuid_to_cnodeid(cpuid)),sizeof(irqpda_t)); + else + irqpdaindr[cpuid] = page_address(alloc_pages_node(local_cnodeid(), GFP_KERNEL, get_order(sizeof(irqpda_t)))); + memset(irqpdaindr[cpuid], 0, sizeof(irqpda_t)); + pda.p_irqpda = irqpdaindr[cpuid]; + pda.pio_write_status_addr = (volatile unsigned long *)LOCAL_MMR_ADDR((slice < 2 ? SH_PIO_WRITE_STATUS_0 : SH_PIO_WRITE_STATUS_1 ) ); +#endif + +#ifdef CONFIG_IA64_SGI_SN1 + pda.bedrock_rev_id = (volatile unsigned long *) LOCAL_HUB(LB_REV_ID); + if (cpuid_to_synergy(cpuid)) + /* CPU B */ + pda.pio_write_status_addr = (volatile unsigned long *) GBL_PERF_B_ADDR; + else + /* CPU A */ + pda.pio_write_status_addr = (volatile unsigned long *) GBL_PERF_A_ADDR; +#endif + + + bte_init_cpu(); +} + + +/** + * cnodeid_to_cpuid - convert a cnode to a cpuid of a cpu on the node. + * @cnode: node to get a cpuid from + * + * Returns -1 if no cpus exist on the node. + * NOTE:BRINGUP ZZZ This is NOT a good way to find cpus on the node. + * Need a better way!! + */ +int +cnodeid_to_cpuid(int cnode) { + int cpu; + + for (cpu = 0; cpu < smp_num_cpus; cpu++) + if (cpuid_to_cnodeid(cpu) == cnode) + break; + + if (cpu == smp_num_cpus) + cpu = -1; + + return cpu; +} + +#if 0 /* ##jh */ +/** + * get_cycles - return a non-decreasing timestamp + * + * On SN, we use an RTC read for this function + */ +cycles_t +get_cycles (void) +{ + return GET_RTC_COUNTER(); +} +#endif diff -urN linux-2.4.18/arch/ia64/sn/kernel/sn1/Makefile lia64-2.4/arch/ia64/sn/kernel/sn1/Makefile --- linux-2.4.18/arch/ia64/sn/kernel/sn1/Makefile Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/sn1/Makefile Mon Feb 4 17:48:56 2002 @@ -0,0 +1,51 @@ +# +# ia64/platform/sn/sn1/Makefile +# +# Copyright (C) 1999,2001-2002 Silicon Graphics, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/NoticeExplan +# + + +EXTRA_CFLAGS := -DLITTLE_ENDIAN + +.S.s: + $(CPP) $(AFLAGS) $(AFLAGS_KERNEL) -o $*.s $< +.S.o: + $(CC) $(AFLAGS) $(AFLAGS_KERNEL) -c -o $*.o $< + +all: sn1.a + +O_TARGET = sn1.a + +obj-y = cache.o error.o iomv.o synergy.o sn1_smp.o + +clean:: + +include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ia64/sn/kernel/sn1/cache.c lia64-2.4/arch/ia64/sn/kernel/sn1/cache.c --- linux-2.4.18/arch/ia64/sn/kernel/sn1/cache.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/sn1/cache.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,81 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved. + * + */ + +#include +#include +#include +#include +#include +#include + +#ifndef MB +#define MB (1024*1024) +#endif + +/* + * Lock for protecting SYN_TAG_DISABLE_WAY. + * Consider making this a per-FSB lock. + */ +static spinlock_t flush_lock = SPIN_LOCK_UNLOCKED; + +/** + * sn_flush_all_caches - flush a range of addresses from all caches (incl. L4) + * @flush_addr: identity mapped region 7 address to start flushing + * @bytes: number of bytes to flush + * + * Flush a range of addresses from all caches including L4. All addresses + * fully or partially contained within @flush_addr to @flush_addr + @bytes + * are flushed from the all caches. + */ +void +sn_flush_all_caches(long flush_addr, long bytes) +{ + ulong addr, baddr, eaddr, bitbucket; + int way, alias; + + /* + * Because of the way synergy implements "fc", this flushes the + * data from all caches on all cpus & L4's on OTHER FSBs. It also + * flushes both cpus on the local FSB. It does NOT flush it from + * the local FSB. + */ + flush_icache_range(flush_addr, flush_addr+bytes); + + /* + * Memory DIMMs are a minimum of 256MB and start on 256MB + * boundaries. Convert the start address to an address + * that is between +0MB & +128 of the same DIMM. + * Then add 8MB to skip the uncached MinState areas if the address + * is on the master node. + */ + if (bytes > SYNERGY_L4_BYTES_PER_WAY) + bytes = SYNERGY_L4_BYTES_PER_WAY; + baddr = TO_NODE(smp_physical_node_id(), PAGE_OFFSET + (flush_addr & (128*MB-1)) + 8*MB); + eaddr = (baddr+bytes+SYNERGY_BLOCK_SIZE-1) & ~(SYNERGY_BLOCK_SIZE-1); + baddr = baddr & ~(SYNERGY_BLOCK_SIZE-1); + + /* + * Now flush the local synergy. + */ + spin_lock(&flush_lock); + for(way=0; way +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/** + * snia_error_intr_handler - handle SN specific error interrupts + * @irq: error interrupt received + * @devid: device causing the interrupt + * @pt_regs: saved register state + * + * This routine is called when certain interrupts occur on SN systems. + * It will either recover from the situations that caused the interrupt + * or panic. + */ +void +snia_error_intr_handler(int irq, void *devid, struct pt_regs *pt_regs) +{ + unsigned long long intpend_val; + unsigned long long bit; + + switch (irq) { + case SGI_UART_IRQ: + /* + * This isn't really an error interrupt. We're just + * here because we have to do something with them. + * This is probably wrong, and this code will be + * removed. + */ + intpend_val = LOCAL_HUB_L(PI_INT_PEND0); + if ( (bit = ~(1L< +#include +#include +#include +#include + +/** + * sn_io_addr - convert an in/out port to an i/o address + * @port: port to convert + * + * Legacy in/out instructions are converted to ld/st instructions + * on IA64. This routine will convert a port number into a valid + * SN i/o address. Used by sn_in*() and sn_out*(). + */ +void * +sn_io_addr(unsigned long port) +{ + if (!IS_RUNNING_ON_SIMULATOR()) { + return( (void *) (port | __IA64_UNCACHED_OFFSET)); + } else { + unsigned long io_base; + unsigned long addr; + + /* + * word align port, but need more than 10 bits + * for accessing registers in bedrock local block + * (so we don't do port&0xfff) + */ + if ((port >= 0x1f0 && port <= 0x1f7) || + port == 0x3f6 || port == 0x3f7) { + io_base = __IA64_UNCACHED_OFFSET | 0x00000FFFFC000000; + addr = io_base | ((port >> 2) << 12) | (port & 0xfff); + } else { + addr = __ia64_get_io_port_base() | ((port >> 2) << 2); + } + return(void *) addr; + } +} + +/** + * sn1_mmiob - I/O space memory barrier + * + * Acts as a memory mapped I/O barrier for platforms that queue writes to + * I/O space. This ensures that subsequent writes to I/O space arrive after + * all previous writes. For most ia64 platforms, this is a simple + * 'mf.a' instruction. For other platforms, mmiob() may have to read + * a chipset register to ensure ordering. + * + * On SN1, we wait for the PIO_WRITE_STATUS Bedrock register to clear. + */ +void +sn1_mmiob (void) +{ + (volatile unsigned long) (*pda.bedrock_rev_id); + while (!(volatile unsigned long) (*pda.pio_write_status_addr)) + udelay(5); +} diff -urN linux-2.4.18/arch/ia64/sn/kernel/sn1/sn1_smp.c lia64-2.4/arch/ia64/sn/kernel/sn1/sn1_smp.c --- linux-2.4.18/arch/ia64/sn/kernel/sn1/sn1_smp.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/sn1/sn1_smp.c Tue Feb 26 13:19:35 2002 @@ -0,0 +1,474 @@ +/* + * SN1 Platform specific SMP Support + * + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/NoticeExplan + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * The following structure is used to pass params thru smp_call_function + * to other cpus for flushing TLB ranges. + */ +typedef struct { + unsigned long start; + unsigned long end; + unsigned long nbits; + unsigned int rid; + atomic_t unfinished_count; +} ptc_params_t; + +#define NUMPTC 512 + +static ptc_params_t ptcParamArray[NUMPTC] __attribute__((__aligned__(128))); + +/* use separate cache lines on ptcParamsNextByCpu to avoid false sharing */ +static ptc_params_t *ptcParamsNextByCpu[NR_CPUS*16] __attribute__((__aligned__(128))); +static volatile ptc_params_t *ptcParamsEmpty __cacheline_aligned; + +/*REFERENCED*/ +static spinlock_t ptcParamsLock __cacheline_aligned = SPIN_LOCK_UNLOCKED; + +static int ptcInit = 0; +#ifdef PTCDEBUG +static int ptcParamsAllBusy = 0; /* debugging/statistics */ +static int ptcCountBacklog = 0; +static int ptcBacklog[NUMPTC+1]; +static char ptcParamsCounts[NR_CPUS][NUMPTC] __attribute__((__aligned__(128))); +static char ptcParamsResults[NR_CPUS][NUMPTC] __attribute__((__aligned__(128))); +#endif + +/* + * Make smp_send_flush_tlbsmp_send_flush_tlb() a weak reference, + * so that we get a clean compile with the ia64 patch without the + * actual SN1 specific code in arch/ia64/kernel/smp.c. + */ +extern void smp_send_flush_tlb (void) __attribute((weak)); + +/* + * The following table/struct is for remembering PTC coherency domains. It + * is also used to translate sapicid into cpuids. We dont want to start + * cpus unless we know their cache domain. + */ +#ifdef PTC_NOTYET +sn_sapicid_info_t sn_sapicid_info[NR_CPUS]; +#endif + +/** + * sn1_ptc_l_range - purge local translation cache + * @start: start of virtual address range + * @end: end of virtual address range + * @nbits: specifies number of bytes to purge per instruction (num = 1<<(nbits & 0xfc)) + * + * Purges the range specified from the local processor's translation cache + * (as opposed to the translation registers). Note that more than the specified + * range *may* be cleared from the cache by some processors. + * + * This is probably not good enough, but I don't want to try to make it better + * until I get some statistics on a running system. At a minimum, we should only + * send IPIs to 1 processor in each TLB domain & have it issue a ptc.g on it's + * own FSB. Also, we only have to serialize per FSB, not globally. + * + * More likely, we will have to do some work to reduce the frequency of calls to + * this routine. + */ +static inline void +sn1_ptc_l_range(unsigned long start, unsigned long end, unsigned long nbits) +{ + do { + __asm__ __volatile__ ("ptc.l %0,%1" :: "r"(start), "r"(nbits<<2) : "memory"); + start += (1UL << nbits); + } while (start < end); + ia64_srlz_d(); +} + +/** + * sn1_received_flush_tlb - cpu tlb flush routine + * + * Flushes the TLB of a given processor. + */ +void +sn1_received_flush_tlb(void) +{ + unsigned long start, end, nbits; + unsigned int rid, saved_rid; + int cpu = smp_processor_id(); + int result; + ptc_params_t *ptcParams; + + ptcParams = ptcParamsNextByCpu[cpu*16]; + if (ptcParams == ptcParamsEmpty) + return; + + do { + start = ptcParams->start; + saved_rid = (unsigned int) ia64_get_rr(start); + end = ptcParams->end; + nbits = ptcParams->nbits; + rid = ptcParams->rid; + + if (saved_rid != rid) { + ia64_set_rr(start, (unsigned long)rid); + ia64_srlz_d(); + } + + sn1_ptc_l_range(start, end, nbits); + + if (saved_rid != rid) + ia64_set_rr(start, (unsigned long)saved_rid); + + ia64_srlz_i(); + + result = atomic_dec(&ptcParams->unfinished_count); +#ifdef PTCDEBUG + { + int i = ptcParams-&ptcParamArray[0]; + ptcParamsResults[cpu][i] = (char) result; + ptcParamsCounts[cpu][i]++; + } +#endif /* PTCDEBUG */ + + if (++ptcParams == &ptcParamArray[NUMPTC]) + ptcParams = &ptcParamArray[0]; + + } while (ptcParams != ptcParamsEmpty); + + ptcParamsNextByCpu[cpu*16] = ptcParams; +} + +/** + * sn1_global_tlb_purge - flush a translation cache range on all processors + * @start: start of virtual address range to flush + * @end: end of virtual address range + * @nbits: specifies number of bytes to purge per instruction (num = 1<<(nbits & 0xfc)) + * + * Flushes the translation cache of all processors from @start to @end. + */ +void +sn1_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbits) +{ + ptc_params_t *params; + ptc_params_t *next; + unsigned long irqflags; +#ifdef PTCDEBUG + ptc_params_t *nextnext; + int backlog = 0; +#endif + + if (smp_num_cpus == 1) { + sn1_ptc_l_range(start, end, nbits); + return; + } + + if (in_interrupt()) { + /* + * If at interrupt level and cannot get spinlock, + * then do something useful by flushing own tlbflush queue + * so as to avoid a possible deadlock. + */ + while (!spin_trylock(&ptcParamsLock)) { + local_irq_save(irqflags); + sn1_received_flush_tlb(); + local_irq_restore(irqflags); + udelay(10); /* take it easier on the bus */ + } + } else { + spin_lock(&ptcParamsLock); + } + + if (!ptcInit) { + int cpu; + ptcInit = 1; + memset(ptcParamArray, 0, sizeof(ptcParamArray)); + ptcParamsEmpty = &ptcParamArray[0]; + for (cpu=0; cpu= &ptcParamArray[0]) { + if (atomic_read(&ptr->unfinished_count) == 0) + break; + ++backlog; + } + + if (backlog) { + /* check the end of the array */ + ptr = &ptcParamArray[NUMPTC]; + while (--ptr > params) { + if (atomic_read(&ptr->unfinished_count) == 0) + break; + ++backlog; + } + } + ptcBacklog[backlog]++; + } +#endif /* PTCDEBUG */ + + /* wait for the next entry to clear...should be rare */ + if (atomic_read(&next->unfinished_count) > 0) { +#ifdef PTCDEBUG + ptcParamsAllBusy++; + + if (atomic_read(&nextnext->unfinished_count) == 0) { + if (atomic_read(&next->unfinished_count) > 0) { + panic("\nnonzero next zero nextnext %lx %lx\n", + (long)next, (long)nextnext); + } + } +#endif + + /* it could be this cpu that is behind */ + local_irq_save(irqflags); + sn1_received_flush_tlb(); + local_irq_restore(irqflags); + + /* now we know it's not this cpu, so just wait */ + while (atomic_read(&next->unfinished_count) > 0) { + barrier(); + } + } + + params->start = start; + params->end = end; + params->nbits = nbits; + params->rid = (unsigned int) ia64_get_rr(start); + atomic_set(¶ms->unfinished_count, smp_num_cpus); + + /* The atomic_set above can hit memory *after* the update + * to ptcParamsEmpty below, which opens a timing window + * that other cpus can squeeze into! + */ + mb(); + + /* everything is ready to process: + * -- global lock is held + * -- new entry + 1 is free + * -- new entry is set up + * so now: + * -- update the global next pointer + * -- unlock the global lock + * -- send IPI to notify other cpus + * -- process the data ourselves + */ + ptcParamsEmpty = next; + spin_unlock(&ptcParamsLock); + smp_send_flush_tlb(); + + local_irq_save(irqflags); + sn1_received_flush_tlb(); + local_irq_restore(irqflags); + + /* Currently we don't think global TLB purges need to be atomic. + * All CPUs get sent IPIs, so if they haven't done the purge, + * they're busy with interrupts that are at the IPI level, which is + * priority 15. We're asserting that any code at that level + * shouldn't be using user TLB entries. To change this to wait + * for all the flushes to complete, enable the following code. + */ +#ifdef SN1_SYNCHRONOUS_GLOBAL_TLB_PURGE + /* this code is not tested */ + /* wait for the flush to complete */ + while (atomic_read(¶ms.unfinished_count) > 1) + barrier(); + + atomic_set(¶ms->unfinished_count, 0); +#endif +} + +/** + * sn_send_IPI_phys - send an IPI to a Nasid and slice + * @physid: physical cpuid to receive the interrupt. + * @vector: command to send + * @delivery_mode: delivery mechanism + * + * Sends an IPI (interprocessor interrupt) to the processor specified by + * @physid + * + * @delivery_mode can be one of the following + * + * %IA64_IPI_DM_INT - pend an interrupt + * %IA64_IPI_DM_PMI - pend a PMI + * %IA64_IPI_DM_NMI - pend an NMI + * %IA64_IPI_DM_INIT - pend an INIT interrupt + */ +void +sn_send_IPI_phys(long physid, int vector, int delivery_mode) +{ + long *p; + long nasid, slice; + + static int off[4] = {0x1800080, 0x1800088, 0x1a00080, 0x1a00088}; + + nasid = cpu_physical_id_to_nasid(physid); + slice = cpu_physical_id_to_slice(physid); + + p = (long*)(0xc0000a0000000000LL | (nasid<<33) | off[slice]); + +#if defined(ZZZBRINGUP) + { + static int count=0; + if (count++ < 10) printk("ZZ sendIPI 0x%x vec %d, nasid 0x%lx, slice %ld, adr 0x%lx\n", + smp_processor_id(), vector, nasid, slice, (long)p); + } +#endif + mb(); + *p = (delivery_mode << 8) | (vector & 0xff); +} + + +/** + * sn1_send_IPI - send an IPI to a processor + * @cpuid: target of the IPI + * @vector: command to send + * @delivery_mode: delivery mechanism + * @redirect: redirect the IPI? + * + * Sends an IPI (interprocessor interrupt) to the processor specified by + * @cpuid. @delivery_mode can be one of the following + * + * %IA64_IPI_DM_INT - pend an interrupt + * %IA64_IPI_DM_PMI - pend a PMI + * %IA64_IPI_DM_NMI - pend an NMI + * %IA64_IPI_DM_INIT - pend an INIT interrupt + */ +void +sn1_send_IPI(int cpuid, int vector, int delivery_mode, int redirect) +{ + long physid; + + physid = cpu_physical_id(cpuid); + + sn_send_IPI_phys(physid, vector, delivery_mode); +} +#ifdef CONFIG_SMP + +#ifdef PTC_NOTYET +static void __init +process_sal_ptc_domain_info(ia64_sal_ptc_domain_info_t *di, int domain) +{ + ia64_sal_ptc_domain_proc_entry_t *pe; + int i, sapicid, cpuid; + + pe = __va(di->proc_list); + for (i=0; iproc_count; i++, pe++) { + sapicid = id_eid_to_sapicid(pe->id, pe->eid); + cpuid = cpu_logical_id(sapicid); + sn_sapicid_info[cpuid].domain = domain; + sn_sapicid_info[cpuid].sapicid = sapicid; + } +} + + +static void __init +process_sal_desc_ptc(ia64_sal_desc_ptc_t *ptc) +{ + ia64_sal_ptc_domain_info_t *di; + int i; + + di = __va(ptc->domain_info); + for (i=0; inum_domains; i++, di++) { + process_sal_ptc_domain_info(di, i); + } +} +#endif /* PTC_NOTYET */ + +/** + * init_sn1_smp_config - setup PTC domains per processor + */ +void __init +init_sn1_smp_config(void) +{ + if (!ia64_ptc_domain_info) { + printk("SMP: Can't find PTC domain info. Forcing UP mode\n"); + smp_num_cpus = 1; + return; + } + +#ifdef PTC_NOTYET + memset (sn_sapicid_info, -1, sizeof(sn_sapicid_info)); + process_sal_desc_ptc(ia64_ptc_domain_info); +#endif +} + +#else /* CONFIG_SMP */ + +void __init +init_sn1_smp_config(void) +{ + +#ifdef PTC_NOTYET + sn_sapicid_info[0].sapicid = hard_smp_processor_id(); +#endif +} + +#endif /* CONFIG_SMP */ diff -urN linux-2.4.18/arch/ia64/sn/kernel/sn1/synergy.c lia64-2.4/arch/ia64/sn/kernel/sn1/synergy.c --- linux-2.4.18/arch/ia64/sn/kernel/sn1/synergy.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/sn1/synergy.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,532 @@ +/* + * SN1 Platform specific synergy Support + * + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/NoticeExplan + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int bit_pos_to_irq(int bit); +void setclear_mask_b(int irq, int cpuid, int set); +void setclear_mask_a(int irq, int cpuid, int set); +void * kmalloc(size_t size, int flags); + +static int synergy_perf_initialized = 0; + +void +synergy_intr_alloc(int bit, int cpuid) { + return; +} + +int +synergy_intr_connect(int bit, + int cpuid) +{ + int irq; + unsigned is_b; + + irq = bit_pos_to_irq(bit); + + is_b = (cpuid_to_slice(cpuid)) & 1; + if (is_b) { + setclear_mask_b(irq,cpuid,1); + setclear_mask_a(irq,cpuid, 0); + } else { + setclear_mask_a(irq, cpuid, 1); + setclear_mask_b(irq, cpuid, 0); + } + return 0; +} +void +setclear_mask_a(int irq, int cpuid, int set) +{ + int synergy; + int nasid; + int reg_num; + unsigned long mask; + unsigned long addr; + unsigned long reg; + unsigned long val; + int my_cnode, my_synergy; + int target_cnode, target_synergy; + + /* + * Perform some idiot checks .. + */ + if ( (irq < 0) || (irq > 255) || + (cpuid < 0) || (cpuid > 512) ) { + printk("clear_mask_a: Invalid parameter irq %d cpuid %d\n", irq, cpuid); + return; + } + + target_cnode = cpuid_to_cnodeid(cpuid); + target_synergy = cpuid_to_synergy(cpuid); + my_cnode = cpuid_to_cnodeid(smp_processor_id()); + my_synergy = cpuid_to_synergy(smp_processor_id()); + + reg_num = irq / 64; + mask = 1; + mask <<= (irq % 64); + switch (reg_num) { + case 0: + reg = VEC_MASK0A; + addr = VEC_MASK0A_ADDR; + break; + case 1: + reg = VEC_MASK1A; + addr = VEC_MASK1A_ADDR; + break; + case 2: + reg = VEC_MASK2A; + addr = VEC_MASK2A_ADDR; + break; + case 3: + reg = VEC_MASK3A; + addr = VEC_MASK3A_ADDR; + break; + default: + reg = addr = 0; + break; + } + if (my_cnode == target_cnode && my_synergy == target_synergy) { + // local synergy + val = READ_LOCAL_SYNERGY_REG(addr); + if (set) { + val |= mask; + } else { + val &= ~mask; + } + WRITE_LOCAL_SYNERGY_REG(addr, val); + val = READ_LOCAL_SYNERGY_REG(addr); + } else { /* remote synergy */ + synergy = cpuid_to_synergy(cpuid); + nasid = cpuid_to_nasid(cpuid); + val = REMOTE_SYNERGY_LOAD(nasid, synergy, reg); + if (set) { + val |= mask; + } else { + val &= ~mask; + } + REMOTE_SYNERGY_STORE(nasid, synergy, reg, val); + } +} + +void +setclear_mask_b(int irq, int cpuid, int set) +{ + int synergy; + int nasid; + int reg_num; + unsigned long mask; + unsigned long addr; + unsigned long reg; + unsigned long val; + int my_cnode, my_synergy; + int target_cnode, target_synergy; + + /* + * Perform some idiot checks .. + */ + if ( (irq < 0) || (irq > 255) || + (cpuid < 0) || (cpuid > 512) ) { + printk("clear_mask_b: Invalid parameter irq %d cpuid %d\n", irq, cpuid); + return; + } + + target_cnode = cpuid_to_cnodeid(cpuid); + target_synergy = cpuid_to_synergy(cpuid); + my_cnode = cpuid_to_cnodeid(smp_processor_id()); + my_synergy = cpuid_to_synergy(smp_processor_id()); + + reg_num = irq / 64; + mask = 1; + mask <<= (irq % 64); + switch (reg_num) { + case 0: + reg = VEC_MASK0B; + addr = VEC_MASK0B_ADDR; + break; + case 1: + reg = VEC_MASK1B; + addr = VEC_MASK1B_ADDR; + break; + case 2: + reg = VEC_MASK2B; + addr = VEC_MASK2B_ADDR; + break; + case 3: + reg = VEC_MASK3B; + addr = VEC_MASK3B_ADDR; + break; + default: + reg = addr = 0; + break; + } + if (my_cnode == target_cnode && my_synergy == target_synergy) { + // local synergy + val = READ_LOCAL_SYNERGY_REG(addr); + if (set) { + val |= mask; + } else { + val &= ~mask; + } + WRITE_LOCAL_SYNERGY_REG(addr, val); + val = READ_LOCAL_SYNERGY_REG(addr); + } else { /* remote synergy */ + synergy = cpuid_to_synergy(cpuid); + nasid = cpuid_to_nasid(cpuid); + val = REMOTE_SYNERGY_LOAD(nasid, synergy, reg); + if (set) { + val |= mask; + } else { + val &= ~mask; + } + REMOTE_SYNERGY_STORE(nasid, synergy, reg, val); + } +} + +/* + * Synergy perf stats. Multiplexed via timer_interrupt. + */ + +static int +synergy_perf_append(uint64_t modesel) +{ + int cnode; + nodepda_t *npdap; + synergy_perf_t *p; + int checked = 0; + int err = 0; + + /* bit 45 is enable */ + modesel |= (1UL << 45); + + for (cnode=0; cnode < numnodes; cnode++) { + /* for each node, insert a new synergy_perf entry */ + if ((npdap = NODEPDA(cnode)) == NULL) { + printk("synergy_perf_append: cnode=%d NODEPDA(cnode)==NULL, nodepda=%p\n", cnode, (void *)nodepda); + continue; + } + + if (npdap->synergy_perf_enabled) { + /* user must disable counting to append new events */ + err = -EBUSY; + break; + } + + if (!checked && npdap->synergy_perf_data != NULL) { + checked = 1; + for (p = npdap->synergy_perf_first; ;) { + if (p->modesel == modesel) + return 0; /* event already registered */ + if ((p = p->next) == npdap->synergy_perf_first) + break; + } + } + + /* XX use kmem_alloc_node() when it is implemented */ + p = (synergy_perf_t *)kmalloc(sizeof(synergy_perf_t), GFP_KERNEL); + if ((((uint64_t)p) & 7UL) != 0) + BUG(); /* bad alignment */ + if (p == NULL) { + err = -ENOMEM; + break; + } + else { + memset(p, 0, sizeof(synergy_perf_t)); + p->modesel = modesel; + + spin_lock_irq(&npdap->synergy_perf_lock); + if (npdap->synergy_perf_data == NULL) { + /* circular list */ + p->next = p; + npdap->synergy_perf_first = p; + npdap->synergy_perf_data = p; + } + else { + p->next = npdap->synergy_perf_data->next; + npdap->synergy_perf_data->next = p; + } + spin_unlock_irq(&npdap->synergy_perf_lock); + } + } + + return err; +} + +static void +synergy_perf_set_freq(int freq) +{ + int cnode; + nodepda_t *npdap; + + for (cnode=0; cnode < numnodes; cnode++) { + if ((npdap = NODEPDA(cnode)) != NULL) + npdap->synergy_perf_freq = freq; + } +} + +static void +synergy_perf_set_enable(int enable) +{ + int cnode; + nodepda_t *npdap; + + for (cnode=0; cnode < numnodes; cnode++) { + if ((npdap = NODEPDA(cnode)) != NULL) + npdap->synergy_perf_enabled = enable; + } + printk("NOTICE: synergy perf counting %sabled on all nodes\n", enable ? "en" : "dis"); +} + +static int +synergy_perf_size(nodepda_t *npdap) +{ + synergy_perf_t *p; + int n; + + if (npdap->synergy_perf_enabled == 0) { + /* no stats to return */ + return 0; + } + + spin_lock_irq(&npdap->synergy_perf_lock); + for (n=0, p = npdap->synergy_perf_first; p;) { + n++; + p = p->next; + if (p == npdap->synergy_perf_first) + break; + } + spin_unlock_irq(&npdap->synergy_perf_lock); + + /* bytes == n pairs of {event,counter} */ + return n * 2 * sizeof(uint64_t); +} + +static int +synergy_perf_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + int cnode; + nodepda_t *npdap; + synergy_perf_t *p; + int intarg; + int fsb; + uint64_t longarg; + uint64_t *stats; + int n; + devfs_handle_t d; + arbitrary_info_t info; + + if ((d = devfs_get_handle_from_inode(inode)) == NULL) + return -ENODEV; + info = hwgraph_fastinfo_get(d); + + cnode = SYNERGY_PERF_INFO_CNODE(info); + fsb = SYNERGY_PERF_INFO_FSB(info); + npdap = NODEPDA(cnode); + + switch (cmd) { + case SNDRV_GET_SYNERGY_VERSION: + /* return int, version of data structure for SNDRV_GET_SYNERGYINFO */ + intarg = 1; /* version 1 */ + if (copy_to_user((void *)arg, &intarg, sizeof(intarg))) + return -EFAULT; + break; + + case SNDRV_GET_INFOSIZE: + /* return int, sizeof buf needed for SYNERGY_PERF_GET_STATS */ + intarg = synergy_perf_size(npdap); + if (copy_to_user((void *)arg, &intarg, sizeof(intarg))) + return -EFAULT; + break; + + case SNDRV_GET_SYNERGYINFO: + /* return array of event/value pairs, this node only */ + if ((intarg = synergy_perf_size(npdap)) <= 0) + return -ENODATA; + if ((stats = (uint64_t *)kmalloc(intarg, GFP_KERNEL)) == NULL) + return -ENOMEM; + spin_lock_irq(&npdap->synergy_perf_lock); + for (n=0, p = npdap->synergy_perf_first; p;) { + stats[n++] = p->modesel; + if (p->intervals > 0) + stats[n++] = p->counts[fsb] * p->total_intervals / p->intervals; + else + stats[n++] = 0; + p = p->next; + if (p == npdap->synergy_perf_first) + break; + } + spin_unlock_irq(&npdap->synergy_perf_lock); + + if (copy_to_user((void *)arg, stats, intarg)) { + kfree(stats); + return -EFAULT; + } + + kfree(stats); + break; + + case SNDRV_SYNERGY_APPEND: + /* reads 64bit event, append synergy perf event to all nodes */ + if (copy_from_user(&longarg, (void *)arg, sizeof(longarg))) + return -EFAULT; + return synergy_perf_append(longarg); + break; + + case SNDRV_GET_SYNERGY_STATUS: + /* return int, 1 if enabled else 0 */ + intarg = npdap->synergy_perf_enabled; + if (copy_to_user((void *)arg, &intarg, sizeof(intarg))) + return -EFAULT; + break; + + case SNDRV_SYNERGY_ENABLE: + /* read int, if true enable counting else disable */ + if (copy_from_user(&intarg, (void *)arg, sizeof(intarg))) + return -EFAULT; + synergy_perf_set_enable(intarg); + break; + + case SNDRV_SYNERGY_FREQ: + /* read int, set jiffies per update */ + if (copy_from_user(&intarg, (void *)arg, sizeof(intarg))) + return -EFAULT; + if (intarg < 0 || intarg >= HZ) + return -EINVAL; + synergy_perf_set_freq(intarg); + break; + + default: + printk("Warning: invalid ioctl %d on synergy mon for cnode=%d fsb=%d\n", cmd, cnode, fsb); + return -EINVAL; + } + return(0); +} + +struct file_operations synergy_mon_fops = { + ioctl: synergy_perf_ioctl, +}; + +void +synergy_perf_update(int cpu) +{ + nasid_t nasid; + cnodeid_t cnode; + struct nodepda_s *npdap; + + /* + * synergy_perf_initialized is set by synergy_perf_init() + * which is called last thing by sn_mp_setup(), i.e. well + * after nodepda has been initialized. + */ + if (!synergy_perf_initialized) + return; + + cnode = cpuid_to_cnodeid(cpu); + npdap = NODEPDA(cnode); + + if (npdap == NULL || cnode < 0 || cnode >= numnodes) + /* this should not happen: still in early io init */ + return; + +#if 0 + /* use this to check nodepda initialization */ + if (((uint64_t)npdap) & 0x7) { + printk("\nERROR on cpu %d : cnode=%d, npdap == %p, not aligned\n", cpu, cnode, npdap); + BUG(); + } +#endif + + if (npdap->synergy_perf_enabled == 0 || npdap->synergy_perf_data == NULL) { + /* Not enabled, or no events to monitor */ + return; + } + + if (npdap->synergy_inactive_intervals++ % npdap->synergy_perf_freq != 0) { + /* don't multiplex on every timer interrupt */ + return; + } + + /* + * Read registers for last interval and increment counters. + * Hold the per-node synergy_perf_lock so concurrent readers get + * consistent values. + */ + spin_lock_irq(&npdap->synergy_perf_lock); + + nasid = cpuid_to_nasid(cpu); + npdap->synergy_active_intervals++; + npdap->synergy_perf_data->intervals++; + npdap->synergy_perf_data->total_intervals = npdap->synergy_active_intervals; + + npdap->synergy_perf_data->counts[0] += 0xffffffffffUL & + REMOTE_SYNERGY_LOAD(nasid, 0, PERF_CNTR0_A); + + npdap->synergy_perf_data->counts[1] += 0xffffffffffUL & + REMOTE_SYNERGY_LOAD(nasid, 1, PERF_CNTR0_B); + + /* skip to next in circular list */ + npdap->synergy_perf_data = npdap->synergy_perf_data->next; + + spin_unlock_irq(&npdap->synergy_perf_lock); + + /* set the counter 0 selection modes for both A and B */ + REMOTE_SYNERGY_STORE(nasid, 0, PERF_CNTL0_A, npdap->synergy_perf_data->modesel); + REMOTE_SYNERGY_STORE(nasid, 1, PERF_CNTL0_B, npdap->synergy_perf_data->modesel); + + /* and reset the counter registers to zero */ + REMOTE_SYNERGY_STORE(nasid, 0, PERF_CNTR0_A, 0UL); + REMOTE_SYNERGY_STORE(nasid, 1, PERF_CNTR0_B, 0UL); +} + +void +synergy_perf_init(void) +{ + printk("synergy_perf_init(), counting is initially disabled\n"); + synergy_perf_initialized++; +} diff -urN linux-2.4.18/arch/ia64/sn/kernel/sn2/Makefile lia64-2.4/arch/ia64/sn/kernel/sn2/Makefile --- linux-2.4.18/arch/ia64/sn/kernel/sn2/Makefile Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/sn2/Makefile Mon Feb 4 17:48:56 2002 @@ -0,0 +1,51 @@ +# +# ia64/platform/sn/sn1/Makefile +# +# Copyright (C) 1999,2001-2002 Silicon Graphics, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/NoticeExplan +# + + +EXTRA_CFLAGS := -DLITTLE_ENDIAN + +.S.s: + $(CPP) $(AFLAGS) $(AFLAGS_KERNEL) -o $*.s $< +.S.o: + $(CC) $(AFLAGS) $(AFLAGS_KERNEL) -c -o $*.o $< + +all: sn2.a + +O_TARGET = sn2.a + +obj-y = cache.o iomv.o sn2_smp.o + +clean:: + +include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ia64/sn/kernel/sn2/cache.c lia64-2.4/arch/ia64/sn/kernel/sn2/cache.c --- linux-2.4.18/arch/ia64/sn/kernel/sn2/cache.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/sn2/cache.c Mon Feb 4 17:48:56 2002 @@ -0,0 +1,29 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved. + * + */ + +#include + +/** + * sn_flush_all_caches - flush a range of address from all caches (incl. L4) + * @flush_addr: identity mapped region 7 address to start flushing + * @bytes: number of bytes to flush + * + * Flush a range of addresses from all caches including L4. + * All addresses fully or partially contained within + * @flush_addr to @flush_addr + @bytes are flushed + * from the all caches. + */ +void +sn_flush_all_caches(long flush_addr, long bytes) +{ + flush_icache_range(flush_addr, flush_addr+bytes); +} + + diff -urN linux-2.4.18/arch/ia64/sn/kernel/sn2/iomv.c lia64-2.4/arch/ia64/sn/kernel/sn2/iomv.c --- linux-2.4.18/arch/ia64/sn/kernel/sn2/iomv.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/sn2/iomv.c Tue Feb 26 13:19:35 2002 @@ -0,0 +1,65 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include + +/** + * sn_io_addr - convert an in/out port to an i/o address + * @port: port to convert + * + * Legacy in/out instructions are converted to ld/st instructions + * on IA64. This routine will convert a port number into a valid + * SN i/o address. Used by sn_in*() and sn_out*(). + */ +void * +sn_io_addr(unsigned long port) +{ + if (!IS_RUNNING_ON_SIMULATOR()) { + return( (void *) (port | __IA64_UNCACHED_OFFSET)); + } else { + unsigned long io_base; + unsigned long addr; + + /* + * word align port, but need more than 10 bits + * for accessing registers in bedrock local block + * (so we don't do port&0xfff) + */ + if ((port >= 0x1f0 && port <= 0x1f7) || + port == 0x3f6 || port == 0x3f7) { + io_base = (0xc000000fcc000000 | ((unsigned long)get_nasid() << 38)); + addr = io_base | ((port >> 2) << 12) | (port & 0xfff); + } else { + addr = __ia64_get_io_port_base() | ((port >> 2) << 2); + } + return(void *) addr; + } +} + +/** + * sn2_mmiob - I/O space memory barrier + * + * Acts as a memory mapped I/O barrier for platforms that queue writes to + * I/O space. This ensures that subsequent writes to I/O space arrive after + * all previous writes. For most ia64 platforms, this is a simple + * 'mf.a' instruction. For other platforms, mmiob() may have to read + * a chipset register to ensure ordering. + * + * On SN2, we wait for the PIO_WRITE_STATUS SHub register to clear. + */ +void +sn2_mmiob (void) +{ + while ( !((volatile unsigned long) (*pda.pio_write_status_addr)) & 0x8000000000000000) + udelay(5); +} diff -urN linux-2.4.18/arch/ia64/sn/kernel/sn2/sn2_smp.c lia64-2.4/arch/ia64/sn/kernel/sn2/sn2_smp.c --- linux-2.4.18/arch/ia64/sn/kernel/sn2/sn2_smp.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/sn2/sn2_smp.c Tue Feb 26 13:19:35 2002 @@ -0,0 +1,184 @@ +/* + * SN2 Platform specific SMP Support + * + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/NoticeExplan + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * sn2_global_tlb_purge - globally purge translation cache of virtual address range + * @start: start of virtual address range + * @end: end of virtual address range + * @nbits: specifies number of bytes to purge per instruction (num = 1<<(nbits & 0xfc)) + * + * Purges the translation caches of all processors of the given virtual address + * range. + */ +void +sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbits) +{ + int cnode, nasid; + volatile long *ptc0, *ptc1, *piows; + unsigned long ws, next, data0, data1; + + piows = (long*)LOCAL_MMR_ADDR(get_slice() ? SH_PIO_WRITE_STATUS_1 : SH_PIO_WRITE_STATUS_0); + data0 = (1UL<>8)< +#ifdef CONFIG_IA64_SGI_AUTOTEST + +// Testing only. +// Routine will cause MCAs +// zzzmsa(n) +// n=0 MCA via duplicate TLB dropin +// n=0 MCA via read of garbage address +// + +#define ITIR(key, ps) ((key<<8) | (ps<<2)) +#define TLB_PAGESIZE 28 // Use 256MB pages for now. + + .global zzzmca + .proc zzzmca +zzzmca: + alloc loc4 = ar.pfs,2,8,1,0;; + cmp.ne p6,p0=r32,r0;; + movl r2=0x2dead + movl r3=0x3dead + movl r15=0x15dead + movl r16=0x16dead + movl r31=0x31dead + movl loc0=0x34beef + movl loc1=0x35beef + movl loc2=0x36beef + movl loc3=0x37beef + movl out0=0x42beef + + movl r20=0x32feed;; + mov ar32=r20 + movl r20=0x36feed;; + mov ar36=r20 + movl r20=0x65feed;; + mov ar65=r20 + movl r20=0x66feed;; + mov ar66=r20 + +(p6) br.cond.sptk 1f + + rsm 0x2000;; + srlz.d; + mov r11 = 1 + mov r3 = ITIR(0,TLB_PAGESIZE);; + mov cr.itir = r3 + mov r10 = 0;; + itr.d dtr[r11] = r10;; + mov r11 = 2 + + itr.d dtr[r11] = r10;; + br 9f + +1: movl r8=0xfe00000048;; + ld8 r9=[r8];; + mf + mf.a + srlz.d + +9: mov ar.pfs=loc4 + br.ret.sptk rp + + .endp zzzmca + + .global zzzspec + .proc zzzspec +zzzspec: + mov r8=r32 + movl r9=0xe000000000000000 + movl r10=0x4000;; + ld8.s r16=[r8];; + ld8.s r17=[r9];; + add r8=r8,r10;; + ld8.s r18=[r8];; + add r8=r8,r10;; + ld8.s r19=[r8];; + add r8=r8,r10;; + ld8.s r20=[r8];; + mov r8=r0 + tnat.nz p6,p0=r16 + tnat.nz p7,p0=r17 + tnat.nz p8,p0=r18 + tnat.nz p9,p0=r19 + tnat.nz p10,p0=r20;; + (p6) dep r8=-1,r8,0,1;; + (p7) dep r8=-1,r8,1,1;; + (p8) dep r8=-1,r8,2,1;; + (p9) dep r8=-1,r8,3,1;; + (p10) dep r8=-1,r8,4,1;; + br.ret.sptk rp + .endp zzzspec + + .global zzzspec2 + .proc zzzspec2 +zzzspec2: + cmp.eq p6,p7=r2,r2 + movl r16=0xc0000a0001000020 + ;; + mf + ;; + ld8 r9=[r16] + (p6) br.spnt 1f + ld8 r10=[r32] + ;; + 1: mf.a + mf + + ld8 r9=[r16];; + cmp.ne p6,p7=r9,r16 + (p6) br.spnt 1f + ld8 r10=[r32] + ;; + 1: mf.a + mf + + ld8 r9=[r33];; + cmp.ne p6,p7=r9,r33 + (p6) br.spnt 1f + ld8 r10=[r32] + ;; + 1: mf.a + mf + + tpa r23=r32 + add r20=512,r33 + add r21=1024,r33;; + ld8 r9=[r20] + ld8 r10=[r21];; + nop.i 0 + { .mib + nop.m 0 + cmp.ne p6,p7=r10,r33 + (p6) br.spnt 1f + } + ld8 r10=[r32] + ;; + 1: mf.a + mf + br.ret.sptk rp + + .endp zzzspec + +#endif + diff -urN linux-2.4.18/arch/ia64/sn/kernel/sn_ksyms.c lia64-2.4/arch/ia64/sn/kernel/sn_ksyms.c --- linux-2.4.18/arch/ia64/sn/kernel/sn_ksyms.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/sn_ksyms.c Fri Apr 26 17:15:30 2002 @@ -0,0 +1,56 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + + +/* + * Architecture-specific kernel symbols + */ + +#include +#include + +#include +#include + +#include +#include +extern devfs_handle_t base_io_scsi_ctlr_vhdl[]; +#include +extern cnodeid_t master_node_get(devfs_handle_t vhdl); +#include +EXPORT_SYMBOL(base_io_scsi_ctlr_vhdl); +EXPORT_SYMBOL(master_node_get); + + +/* + * symbols referenced by the PCIBA module + */ +#include +#include +#include +#include + +devfs_handle_t +devfn_to_vertex(unsigned char busnum, unsigned int devfn); +EXPORT_SYMBOL(devfn_to_vertex); +EXPORT_SYMBOL(hwgraph_vertex_unref); +EXPORT_SYMBOL(pciio_config_get); +EXPORT_SYMBOL(pciio_info_slot_get); +EXPORT_SYMBOL(hwgraph_edge_add); +EXPORT_SYMBOL(pciio_info_master_get); +EXPORT_SYMBOL(pciio_info_get); +#ifdef CONFIG_IA64_SGI_SN_DEBUG +EXPORT_SYMBOL(__pa_debug); +EXPORT_SYMBOL(__va_debug); +#endif + +/* Support IPIs for loaded modules. */ +EXPORT_SYMBOL(sn_send_IPI_phys); + +#include + diff -urN linux-2.4.18/arch/ia64/sn/kernel/sv.c lia64-2.4/arch/ia64/sn/kernel/sv.c --- linux-2.4.18/arch/ia64/sn/kernel/sv.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/arch/ia64/sn/kernel/sv.c Mon Nov 19 23:22:53 2001 @@ -0,0 +1,552 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2000-2001 Silicon Graphics, Inc. All rights reserved + * + * This implemenation of synchronization variables is heavily based on + * one done by Steve Lord + * + * Paul Cassella + */ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +/* Define this to have sv_test() run some simple tests. + kernel_thread() must behave as expected when this is called. */ +#undef RUN_SV_TEST + +#define DEBUG + +/* Set up some macros so sv_wait(), sv_signal(), and sv_broadcast() + can sanity check interrupt state on architectures where we know + how. */ +#ifdef DEBUG + #define SV_DEBUG_INTERRUPT_STATE + #ifdef __mips64 + #define SV_TEST_INTERRUPTS_ENABLED(flags) ((flags & 0x1) != 0) + #define SV_TEST_INTERRUPTS_DISABLED(flags) ((flags & 0x1) == 0) + #define SV_INTERRUPT_TEST_WORKERS 31 + #elif defined(__ia64) + #define SV_TEST_INTERRUPTS_ENABLED(flags) ((flags & 0x4000) != 0) + #define SV_TEST_INTERRUPTS_DISABLED(flags) ((flags & 0x4000) == 0) + #define SV_INTERRUPT_TEST_WORKERS 4 /* simulator's slow */ + #else + #undef SV_DEBUG_INTERRUPT_STATE + #define SV_INTERRUPT_TEST_WORKERS 4 /* reasonable? default. */ + #endif /* __mips64 */ +#endif /* DEBUG */ + + +/* XXX FIXME hack hack hack. Our mips64 tree is from before the + switch to WQ_FLAG_EXCLUSIVE, and our ia64 tree is from after it. */ +#ifdef TASK_EXCLUSIVE + #undef EXCLUSIVE_IN_QUEUE +#else + #define EXCLUSIVE_IN_QUEUE + #define TASK_EXCLUSIVE 0 /* for the set_current_state() in sv_wait() */ +#endif + + +static inline void sv_lock(sv_t *sv) { + spin_lock(&sv->sv_lock); +} + +static inline void sv_unlock(sv_t *sv) { + spin_unlock(&sv->sv_lock); +} + +/* up() is "extern inline", so we can't pass its address to sv_wait. + Use this function's address instead. */ +static void up_wrapper(struct semaphore *sem) { + up(sem); +} + +/* spin_unlock() is sometimes a macro. */ +static void spin_unlock_wrapper(spinlock_t *s) { + spin_unlock(s); +} + +/* XXX Perhaps sv_wait() should do the switch() each time and avoid + the extra indirection and the need for the _wrapper functions? */ + +static inline void sv_set_mon_type(sv_t *sv, int type) { + switch (type) { + case SV_MON_SPIN: + sv->sv_mon_unlock_func = + (sv_mon_unlock_func_t)spin_unlock_wrapper; + break; + case SV_MON_SEMA: + sv->sv_mon_unlock_func = + (sv_mon_unlock_func_t)up_wrapper; + if(sv->sv_flags & SV_INTS) { + printk(KERN_ERR "sv_set_mon_type: The monitor lock " + "cannot be shared with interrupts if it is a " + "semaphore!\n"); + BUG(); + } + if(sv->sv_flags & SV_BHS) { + printk(KERN_ERR "sv_set_mon_type: The monitor lock " + "cannot be shared with bottom-halves if it is " + "a semaphore!\n"); + BUG(); + } + break; +#if 0 + /* + * If needed, and will need to think about interrupts. This + * may be needed, for example, if someone wants to use sv's + * with something like dev_base; writers need to hold two + * locks. + */ + case SV_MON_CUSTOM: + { + struct sv_mon_custom *c = lock; + sv->sv_mon_unlock_func = c->sv_mon_unlock_func; + sv->sv_mon_lock = c->sv_mon_lock; + break; + } +#endif + + default: + printk(KERN_ERR "sv_set_mon_type: unknown type %d (0x%x)! " + "(flags 0x%x)\n", type, type, sv->sv_flags); + BUG(); + break; + } + sv->sv_flags |= type; +} + +static inline void sv_set_ord(sv_t *sv, int ord) { + if (!ord) + ord = SV_ORDER_DEFAULT; + + if (ord != SV_ORDER_FIFO && ord != SV_ORDER_LIFO) { + printk(KERN_EMERG "sv_set_ord: unknown order %d (0x%x)! ", + ord, ord); + BUG(); + } + + sv->sv_flags |= ord; +} + +void sv_init(sv_t *sv, sv_mon_lock_t *lock, int flags) +{ + int ord = flags & SV_ORDER_MASK; + int type = flags & SV_MON_MASK; + + /* Copy all non-order, non-type flags */ + sv->sv_flags = (flags & ~(SV_ORDER_MASK | SV_MON_MASK)); + + if((sv->sv_flags & (SV_INTS | SV_BHS)) == (SV_INTS | SV_BHS)) { + printk(KERN_ERR "sv_init: do not set both SV_INTS and SV_BHS, only SV_INTS.\n"); + BUG(); + } + + sv_set_ord(sv, ord); + sv_set_mon_type(sv, type); + + /* If lock is NULL, we'll get it from sv_wait_compat() (and + ignore it in sv_signal() and sv_broadcast()). */ + sv->sv_mon_lock = lock; + + spin_lock_init(&sv->sv_lock); + init_waitqueue_head(&sv->sv_waiters); +} + +/* + * The associated lock must be locked on entry. It is unlocked on return. + * + * Return values: + * + * n < 0 : interrupted, -n jiffies remaining on timeout, or -1 if timeout == 0 + * n = 0 : timeout expired + * n > 0 : sv_signal()'d, n jiffies remaining on timeout, or 1 if timeout == 0 + */ +signed long sv_wait(sv_t *sv, int sv_wait_flags, unsigned long timeout) +{ + DECLARE_WAITQUEUE( wait, current ); + unsigned long flags; + signed long ret = 0; + +#ifdef SV_DEBUG_INTERRUPT_STATE + { + unsigned long flags; + __save_flags(flags); + + if(sv->sv_flags & SV_INTS) { + if(SV_TEST_INTERRUPTS_ENABLED(flags)) { + printk(KERN_ERR "sv_wait: SV_INTS and interrupts " + "enabled (flags: 0x%lx)\n", flags); + BUG(); + } + } else { + if (SV_TEST_INTERRUPTS_DISABLED(flags)) { + printk(KERN_WARNING "sv_wait: !SV_INTS and interrupts " + "disabled! (flags: 0x%lx)\n", flags); + } + } + } +#endif /* SV_DEBUG_INTERRUPT_STATE */ + + sv_lock(sv); + + sv->sv_mon_unlock_func(sv->sv_mon_lock); + + /* Add ourselves to the wait queue and set the state before + * releasing the sv_lock so as to avoid racing with the + * wake_up() in sv_signal() and sv_broadcast(). + */ + + /* don't need the _irqsave part, but there is no wq_write_lock() */ + wq_write_lock_irqsave(&sv->sv_waiters.lock, flags); + +#ifdef EXCLUSIVE_IN_QUEUE + wait.flags |= WQ_FLAG_EXCLUSIVE; +#endif + + switch(sv->sv_flags & SV_ORDER_MASK) { + case SV_ORDER_FIFO: + __add_wait_queue_tail(&sv->sv_waiters, &wait); + break; + case SV_ORDER_FILO: + __add_wait_queue(&sv->sv_waiters, &wait); + break; + default: + printk(KERN_ERR "sv_wait: unknown order! (sv: 0x%p, flags: 0x%x)\n", + (void *)sv, sv->sv_flags); + BUG(); + } + wq_write_unlock_irqrestore(&sv->sv_waiters.lock, flags); + + if(sv_wait_flags & SV_WAIT_SIG) + set_current_state(TASK_EXCLUSIVE | TASK_INTERRUPTIBLE ); + else + set_current_state(TASK_EXCLUSIVE | TASK_UNINTERRUPTIBLE); + + spin_unlock(&sv->sv_lock); + + if(sv->sv_flags & SV_INTS) + local_irq_enable(); + else if(sv->sv_flags & SV_BHS) + local_bh_enable(); + + if (timeout) + ret = schedule_timeout(timeout); + else + schedule(); + + if(current->state != TASK_RUNNING) /* XXX Is this possible? */ { + printk(KERN_ERR "sv_wait: state not TASK_RUNNING after " + "schedule().\n"); + set_current_state(TASK_RUNNING); + } + + remove_wait_queue(&sv->sv_waiters, &wait); + + /* Return cases: + - woken by a sv_signal/sv_broadcast + - woken by a signal + - woken by timeout expiring + */ + + /* XXX This isn't really accurate; we may have been woken + before the signal anyway.... */ + if(signal_pending(current)) + return timeout ? -ret : -1; + return timeout ? ret : 1; +} + + +void sv_signal(sv_t *sv) +{ + /* If interrupts can acquire this lock, they can also acquire the + sv_mon_lock, which we must already have to have called this, so + interrupts must be disabled already. If interrupts cannot + contend for this lock, we don't have to worry about it. */ + +#ifdef SV_DEBUG_INTERRUPT_STATE + if(sv->sv_flags & SV_INTS) { + unsigned long flags; + __save_flags(flags); + if(SV_TEST_INTERRUPTS_ENABLED(flags)) + printk(KERN_ERR "sv_signal: SV_INTS and " + "interrupts enabled! (flags: 0x%lx)\n", flags); + } +#endif /* SV_DEBUG_INTERRUPT_STATE */ + + sv_lock(sv); + wake_up(&sv->sv_waiters); + sv_unlock(sv); +} + +void sv_broadcast(sv_t *sv) +{ +#ifdef SV_DEBUG_INTERRUPT_STATE + if(sv->sv_flags & SV_INTS) { + unsigned long flags; + __save_flags(flags); + if(SV_TEST_INTERRUPTS_ENABLED(flags)) + printk(KERN_ERR "sv_broadcast: SV_INTS and " + "interrupts enabled! (flags: 0x%lx)\n", flags); + } +#endif /* SV_DEBUG_INTERRUPT_STATE */ + + sv_lock(sv); + wake_up_all(&sv->sv_waiters); + sv_unlock(sv); +} + +void sv_destroy(sv_t *sv) +{ + if(!spin_trylock(&sv->sv_lock)) { + printk(KERN_ERR "sv_destroy: someone else has sv 0x%p locked!\n", (void *)sv); + BUG(); + } + + /* XXX Check that the waitqueue is empty? + Mark the sv destroyed? + */ +} + + +#ifdef RUN_SV_TEST + +static DECLARE_MUTEX_LOCKED(talkback); +static DECLARE_MUTEX_LOCKED(sem); +sv_t sv; +sv_t sv_filo; + +static int sv_test_1_w(void *arg) +{ + printk("sv_test_1_w: acquiring spinlock 0x%p...\n", arg); + + spin_lock((spinlock_t*)arg); + printk("sv_test_1_w: spinlock acquired, waking sv_test_1_s.\n"); + + up(&sem); + + printk("sv_test_1_w: sv_spin_wait()'ing.\n"); + + sv_spin_wait(&sv, arg); + + printk("sv_test_1_w: talkback.\n"); + up(&talkback); + + printk("sv_test_1_w: exiting.\n"); + return 0; +} + +static int sv_test_1_s(void *arg) +{ + printk("sv_test_1_s: waiting for semaphore.\n"); + down(&sem); + printk("sv_test_1_s: semaphore acquired. Acquiring spinlock.\n"); + spin_lock((spinlock_t*)arg); + printk("sv_test_1_s: spinlock acquired. sv_signaling.\n"); + sv_signal(&sv); + printk("sv_test_1_s: talkback.\n"); + up(&talkback); + printk("sv_test_1_s: exiting.\n"); + return 0; + +} + +static int count; +static DECLARE_MUTEX(monitor); + +static int sv_test_2_w(void *arg) +{ + int dummy = count++; + sv_t *sv = (sv_t *)arg; + + down(&monitor); + up(&talkback); + printk("sv_test_2_w: thread %d started, sv_waiting.\n", dummy); + sv_sema_wait(sv, &monitor); + printk("sv_test_2_w: thread %d woken, exiting.\n", dummy); + up(&sem); + return 0; +} + +static int sv_test_2_s_1(void *arg) +{ + int i; + sv_t *sv = (sv_t *)arg; + + down(&monitor); + for(i = 0; i < 3; i++) { + printk("sv_test_2_s_1: waking one thread.\n"); + sv_signal(sv); + down(&sem); + } + + printk("sv_test_2_s_1: signaling and broadcasting again. Nothing should happen.\n"); + sv_signal(sv); + sv_broadcast(sv); + sv_signal(sv); + sv_broadcast(sv); + + printk("sv_test_2_s_1: talkbacking.\n"); + up(&talkback); + up(&monitor); + return 0; +} + +static int sv_test_2_s(void *arg) +{ + int i; + sv_t *sv = (sv_t *)arg; + + down(&monitor); + for(i = 0; i < 3; i++) { + printk("sv_test_2_s: waking one thread (should be %d.)\n", i); + sv_signal(sv); + down(&sem); + } + + printk("sv_test_3_s: waking remaining threads with broadcast.\n"); + sv_broadcast(sv); + for(; i < 10; i++) + down(&sem); + + printk("sv_test_3_s: sending talkback.\n"); + up(&talkback); + + printk("sv_test_3_s: exiting.\n"); + up(&monitor); + return 0; +} + + +static void big_test(sv_t *sv) +{ + int i; + + count = 0; + + for(i = 0; i < 3; i++) { + printk("big_test: spawning thread %d.\n", i); + kernel_thread(sv_test_2_w, sv, 0); + down(&talkback); + } + + printk("big_test: spawning first wake-up thread.\n"); + kernel_thread(sv_test_2_s_1, sv, 0); + + down(&talkback); + printk("big_test: talkback happened.\n"); + + + for(i = 3; i < 13; i++) { + printk("big_test: spawning thread %d.\n", i); + kernel_thread(sv_test_2_w, sv, 0); + down(&talkback); + } + + printk("big_test: spawning wake-up thread.\n"); + kernel_thread(sv_test_2_s, sv, 0); + + down(&talkback); +} + +sv_t int_test_sv; +spinlock_t int_test_spin = SPIN_LOCK_UNLOCKED; +int int_test_ready; +static int irqtestcount; + +static int interrupt_test_worker(void *unused) +{ + int id = ++irqtestcount; + int it = 0; + unsigned long flags, flags2; + + printk("ITW: thread %d started.\n", id); + + while(1) { + __save_flags(flags2); + if(jiffies % 3) { + printk("ITW %2d %5d: irqsaving (%lx)\n", id, it, flags2); + spin_lock_irqsave(&int_test_spin, flags); + } else { + printk("ITW %2d %5d: spin_lock_irqing (%lx)\n", id, it, flags2); + spin_lock_irq(&int_test_spin); + } + + __save_flags(flags2); + printk("ITW %2d %5d: locked, sv_waiting (%lx).\n", id, it, flags2); + sv_wait(&int_test_sv, 0, 0); + + __save_flags(flags2); + printk("ITW %2d %5d: wait finished (%lx), pausing\n", id, it, flags2); + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(jiffies & 0xf); + if(current->state != TASK_RUNNING) + printk("ITW: current->state isn't RUNNING after schedule!\n"); + it++; + } +} + +static void interrupt_test(void) +{ + int i; + + printk("interrupt_test: initing sv.\n"); + sv_init(&int_test_sv, &int_test_spin, SV_MON_SPIN | SV_INTS); + + for(i = 0; i < SV_INTERRUPT_TEST_WORKERS; i++) { + printk("interrupt_test: starting test thread %d.\n", i); + kernel_thread(interrupt_test_worker, 0, 0); + } + printk("interrupt_test: done with init part.\n"); + int_test_ready = 1; +} + +int sv_test(void) +{ + spinlock_t s = SPIN_LOCK_UNLOCKED; + + sv_init(&sv, &s, SV_MON_SPIN); + printk("sv_test: starting sv_test_1_w.\n"); + kernel_thread(sv_test_1_w, &s, 0); + printk("sv_test: starting sv_test_1_s.\n"); + kernel_thread(sv_test_1_s, &s, 0); + + printk("sv_test: waiting for talkback.\n"); + down(&talkback); down(&talkback); + printk("sv_test: talkback happened, sv_destroying.\n"); + sv_destroy(&sv); + + count = 0; + + printk("sv_test: beginning big_test on sv.\n"); + + sv_init(&sv, &monitor, SV_MON_SEMA); + big_test(&sv); + sv_destroy(&sv); + + printk("sv_test: beginning big_test on sv_filo.\n"); + sv_init(&sv_filo, &monitor, SV_MON_SEMA | SV_ORDER_FILO); + big_test(&sv_filo); + sv_destroy(&sv_filo); + + interrupt_test(); + + printk("sv_test: done.\n"); + return 0; +} + +__initcall(sv_test); + +#endif /* RUN_SV_TEST */ diff -urN linux-2.4.18/arch/ia64/sn/sn1/Makefile lia64-2.4/arch/ia64/sn/sn1/Makefile --- linux-2.4.18/arch/ia64/sn/sn1/Makefile Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/sn1/Makefile Wed Dec 31 16:00:00 1969 @@ -1,31 +0,0 @@ -# -# ia64/platform/sn/sn1/Makefile -# -# Copyright (C) 1999 Silicon Graphics, Inc. -# Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com) -# - -EXTRA_CFLAGS := -DSN -DLANGUAGE_C=1 -D_LANGUAGE_C=1 -I. -DBRINGUP \ - -DDIRECT_L1_CONSOLE -DNUMA_BASE -DSIMULATED_KLGRAPH \ - -DNUMA_MIGR_CONTROL -DLITTLE_ENDIAN -DREAL_HARDWARE \ - -DNEW_INTERRUPTS - -.S.s: - $(CPP) $(AFLAGS) $(AFLAGS_KERNEL) -o $*.s $< -.S.o: - $(CC) $(AFLAGS) $(AFLAGS_KERNEL) -c -o $*.o $< - -all: sn1.a - -O_TARGET = sn1.a - -obj-y = irq.o setup.o iomv.o mm.o smp.o synergy.o sn1_asm.o \ - discontig.o probe.o error.o sv.o - -obj-$(CONFIG_IA64_SGI_AUTOTEST) += llsc4.o -obj-$(CONFIG_IA64_GENERIC) += machvec.o -obj-$(CONFIG_MODULES) += sn1_ksyms.o - -clean:: - -include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ia64/sn/sn1/discontig.c lia64-2.4/arch/ia64/sn/sn1/discontig.c --- linux-2.4.18/arch/ia64/sn/sn1/discontig.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/sn1/discontig.c Wed Dec 31 16:00:00 1969 @@ -1,159 +0,0 @@ -/* - * Copyright 2000, Silicon Graphics, sprasad@engr.sgi.com - * Copyright 2000, Kanoj Sarcar, kanoj@sgi.com - */ - -/* - * Contains common definitions and globals for NUMA platform - * support. For now, SN-IA64 and SN-MIPS are the NUMA platforms. - */ - -#include -#include -#include -#include -#include -#include - -extern int numnodes ; - -plat_pg_data_t plat_node_data[MAXNODES]; -bootmem_data_t bdata[MAXNODES]; -int chunktonid[MAXCHUNKS]; -int nasid_map[MAXNASIDS]; - -void __init -init_chunktonid(void) -{ - memset(chunktonid, -1, sizeof(chunktonid)) ; -} - -void __init -init_nodeidmap(void) -{ - memset(nasid_map, -1, sizeof(nasid_map)) ; -} - -int cnodeid_map[MAXNODES] ; -void __init -init_cnodeidmap(void) -{ - memset(cnodeid_map, -1, sizeof(cnodeid_map)) ; -} - -int -numa_debug(void) -{ - panic("NUMA debug\n"); - return(0); -} - -int __init -build_cnodeid_map(void) -{ - int i,j ; - - for (i=0,j=0;i= 0) - cnodeid_map[j++] = i ; - } - return j ; -} - -/* - * Since efi_memmap_walk merges contiguous banks, this code will need - * to find all the nasids covered by the input memory descriptor. - */ -static int __init -build_nasid_map(unsigned long start, unsigned long end, void *arg) -{ - unsigned long vaddr = start; - int nasid = GetNasId(__pa(vaddr)); - - while (vaddr < end) { - if (nasid < MAXNASIDS) - nasid_map[nasid] = 0; - else - panic("build_nasid_map"); - vaddr = (unsigned long)__va((unsigned long)(++nasid) << - SN1_NODE_ADDR_SHIFT); - } - return 0; -} - -void __init -fix_nasid_map(void) -{ - int i ; - int j ; - - /* For every nasid */ - for (j=0;jbdata ; - printk("%d 0x%016lx 0x%016lx 0x%016lx\n", i, - bdata->node_boot_start, bdata->node_low_pfn, - (unsigned long)bdata->node_bootmem_map) ; - } -} - -void __init -discontig_mem_init(void) -{ - extern void setup_sn1_bootmem(int); - int maxnodes ; - - init_chunktonid() ; - init_nodeidmap() ; - init_cnodeidmap() ; - efi_memmap_walk(build_nasid_map, 0) ; - maxnodes = build_cnodeid_map() ; - fix_nasid_map() ; -#ifdef CONFIG_DISCONTIGMEM - setup_sn1_bootmem(maxnodes) ; -#endif - numnodes = maxnodes; - dump_bootmem_info() ; -} - -void -dump_node_data(void) -{ - int i; - - printk("NODE DATA ....\n") ; - printk("Node, Start, Size, MemMap, BitMap, StartP, Mapnr, Size, Id\n") ; - for (i=0;ivalid_addr_bitmap, - NODE_DATA(i)->node_start_paddr, - NODE_DATA(i)->node_start_mapnr, - NODE_DATA(i)->node_size, - NODE_DATA(i)->node_id) ; - } -} - diff -urN linux-2.4.18/arch/ia64/sn/sn1/error.c lia64-2.4/arch/ia64/sn/sn1/error.c --- linux-2.4.18/arch/ia64/sn/sn1/error.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/sn1/error.c Wed Dec 31 16:00:00 1969 @@ -1,149 +0,0 @@ - - -/* - * SN1 Platform specific error Support - * - * Copyright (C) 2001 Silicon Graphics, Inc. - * Copyright (C) 2001 Alan Mayer (ajm@sgi.com) - */ - - - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -void -snia_error_intr_handler(int irq, void *devid, struct pt_regs *pt_regs) { - unsigned long long intpend_val; - unsigned long long bit; - - switch (irq) { - case SGI_UART_IRQ: - // This isn't really an error interrupt. We're just - // here because we have to do something with them. - // This is probably wrong, and this code will be - // removed. - intpend_val = LOCAL_HUB_L(PI_INT_PEND0); - if ( (bit = ~(1L< -#include - -static inline void * -sn1_io_addr(unsigned long port) -{ - if (!IS_RUNNING_ON_SIMULATOR()) { - return( (void *) (port | __IA64_UNCACHED_OFFSET)); - } else { - unsigned long io_base; - unsigned long addr; - - /* - * word align port, but need more than 10 bits - * for accessing registers in bedrock local block - * (so we don't do port&0xfff) - */ - if (port >= 0x1f0 && port <= 0x1f7 || - port == 0x3f6 || port == 0x3f7) { - io_base = __IA64_UNCACHED_OFFSET | 0x00000FFFFC000000; - addr = io_base | ((port >> 2) << 12) | (port & 0xfff); - } else { - addr = __ia64_get_io_port_base() | ((port >> 2) << 2); - } - return(void *) addr; - } -} - -unsigned int -sn1_inb (unsigned long port) -{ - volatile unsigned char *addr = sn1_io_addr(port); - unsigned char ret; - - ret = *addr; - __ia64_mf_a(); - return ret; -} - -unsigned int -sn1_inw (unsigned long port) -{ - volatile unsigned short *addr = sn1_io_addr(port); - unsigned short ret; - - ret = *addr; - __ia64_mf_a(); - return ret; -} - -unsigned int -sn1_inl (unsigned long port) -{ - volatile unsigned int *addr = sn1_io_addr(port); - unsigned int ret; - - ret = *addr; - __ia64_mf_a(); - return ret; -} - -void -sn1_outb (unsigned char val, unsigned long port) -{ - volatile unsigned char *addr = sn1_io_addr(port); - - *addr = val; - __ia64_mf_a(); -} - -void -sn1_outw (unsigned short val, unsigned long port) -{ - volatile unsigned short *addr = sn1_io_addr(port); - - *addr = val; - __ia64_mf_a(); -} - -void -sn1_outl (unsigned int val, unsigned long port) -{ - volatile unsigned int *addr = sn1_io_addr(port); - - *addr = val; - __ia64_mf_a(); -} diff -urN linux-2.4.18/arch/ia64/sn/sn1/irq.c lia64-2.4/arch/ia64/sn/sn1/irq.c --- linux-2.4.18/arch/ia64/sn/sn1/irq.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/sn1/irq.c Wed Dec 31 16:00:00 1969 @@ -1,183 +0,0 @@ -/* - * Platform dependent support for SGI SN1 - * - * Copyright (C) 2000 Silicon Graphics - * Copyright (C) 2000 Jack Steiner (steiner@sgi.com) - * Copyright (C) 2000 Alan Mayer (ajm@sgi.com) - * Copyright (C) 2000 Kanoj Sarcar (kanoj@sgi.com) - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define IRQ_BIT_OFFSET 64 - -int bit_pos_to_irq(int bit) -{ - if (bit > 118) - bit = 118; - return (bit + IRQ_BIT_OFFSET); -} - -static inline int irq_to_bit_pos(int irq) -{ - int bit = irq - IRQ_BIT_OFFSET; - - if (bit > 63) - bit -= 64; - return bit; -} - -static unsigned int -sn1_startup_irq(unsigned int irq) -{ - return(0); -} - -static void -sn1_shutdown_irq(unsigned int irq) -{ -} - -static void -sn1_disable_irq(unsigned int irq) -{ -} - -static void -sn1_enable_irq(unsigned int irq) -{ -} - -static void -sn1_ack_irq(unsigned int irq) -{ -} - -static void -sn1_end_irq(unsigned int irq) -{ - int bit; - - bit = irq_to_bit_pos(irq); - LOCAL_HUB_CLR_INTR(bit); -} - -static void -sn1_set_affinity_irq(unsigned int irq, unsigned long mask) -{ -} - -struct hw_interrupt_type irq_type_sn1 = { - "sn1_irq", - sn1_startup_irq, - sn1_shutdown_irq, - sn1_enable_irq, - sn1_disable_irq, - sn1_ack_irq, - sn1_end_irq, - sn1_set_affinity_irq -}; - - -void -sn1_irq_init (void) -{ - int i; - - for (i = 0; i <= NR_IRQS; ++i) { - if (idesc_from_vector(i)->handler == &no_irq_type) { - idesc_from_vector(i)->handler = &irq_type_sn1; - } - } -} - - - -#if !defined(CONFIG_IA64_SGI_SN1) -void -sn1_pci_fixup(int arg) -{ -} -#endif - -#ifdef CONFIG_PERCPU_IRQ - -extern irq_desc_t irq_descX[NR_IRQS]; -irq_desc_t *irq_desc_ptr[NR_CPUS] = { irq_descX }; - -/* - * Each slave AP allocates its own irq table. - */ -int __init cpu_irq_init(void) -{ - irq_desc_ptr[smp_processor_id()] = (irq_desc_t *)kmalloc(sizeof(irq_descX), GFP_KERNEL); - if (irq_desc_ptr[smp_processor_id()] == 0) - return(-1); - memcpy(irq_desc_ptr[smp_processor_id()], irq_desc_ptr[0], - sizeof(irq_descX)); - return(0); -} - -/* - * This can also allocate the irq tables for the other cpus, specifically - * on their nodes. - */ -int __init master_irq_init(void) -{ - return(0); -} - -/* - * The input is an ivt level. - */ -irq_desc_t *idesc_from_vector(unsigned int ivnum) -{ - return(irq_desc_ptr[smp_processor_id()] + ivnum); -} - -/* - * The input is a "soft" level, that we encoded in. - */ -irq_desc_t *idesc_from_irq(unsigned int irq) -{ - return(irq_desc_ptr[irq >> 8] + (irq & 0xff)); -} - -unsigned int ivector_from_irq(unsigned int irq) -{ - return(irq & 0xff); -} - -/* - * This should return the Linux irq # for the i/p vector on the - * i/p cpu. We currently do not track this. - */ -unsigned int irq_from_cpuvector(int cpunum, unsigned int vector) -{ - return (vector); -} - -#endif /* CONFIG_PERCPU_IRQ */ diff -urN linux-2.4.18/arch/ia64/sn/sn1/llsc4.c lia64-2.4/arch/ia64/sn/sn1/llsc4.c --- linux-2.4.18/arch/ia64/sn/sn1/llsc4.c Mon Nov 26 11:18:25 2001 +++ lia64-2.4/arch/ia64/sn/sn1/llsc4.c Wed Dec 31 16:00:00 1969 @@ -1,952 +0,0 @@ -/* - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Jack Steiner (steiner@sgi.com) - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -extern void bringup_set_led_bits(u8 bits, u8 mask); - -#include "llsc4.h" - - -#ifdef STANDALONE -#include "lock.h" -#endif - -#ifdef INTTEST -static int inttest=0; -#endif - -/* - * Test parameter table for AUTOTEST - */ -typedef struct { - int passes; - int linecount; - int linepad; -} autotest_table_t; - -autotest_table_t autotest_table[] = { - {5000000, 2, 0x2b4 }, - {5000000, 16, 0, }, - {5000000, 16, 4, }, - {5000000, 128, 0x44 }, - {5000000, 128, 0x84 }, - {5000000, 128, 0x200 }, - {5000000, 128, 0x204 }, - {5000000, 128, 0x2b4 }, - {5000000, 2, 8*MB+0x2b4 }, - {5000000, 16, 8*MB+0 }, - {5000000, 16, 8*MB+4 }, - {5000000, 128, 8*MB+0x44 }, - {5000000, 128, 8*MB+0x84 }, - {5000000, 128, 8*MB+0x200 }, - {5000000, 128, 8*MB+0x204 }, - {5000000, 128, 8*MB+0x2b4 }, - {0}}; - -/* - * Array of virtual addresses available for test purposes. - */ - -typedef struct { - long vstart; - long vend; - long nextaddr; - int wrapcount; -} memmap_t; - -memmap_t memmap[MAXCHUNKS]; -int memmapx=0; - -typedef struct { - void *addr; - long data[16]; - long data_fc[16]; -} capture_line_t; - -typedef struct { - int size; - void *blockaddr; - void *shadaddr; - long blockdata[16]; - long shaddata[16]; - long blockdata_fc[16]; - long shaddata_fc[16]; - long synerr; -} capture_t; - -/* - * PORTING NOTE: revisit this statement. On hardware we put mbase at 0 and - * the rest of the tables have to start at 1MB to skip PROM tables. - */ -#define THREADPRIVATE(t) ((threadprivate_t*)(((long)mbase)+1024*1024+t*((sizeof(threadprivate_t)+511)/512*512))) - -#define k_capture mbase->sk_capture -#define k_go mbase->sk_go -#define k_linecount mbase->sk_linecount -#define k_passes mbase->sk_passes -#define k_napticks mbase->sk_napticks -#define k_stop_on_error mbase->sk_stop_on_error -#define k_verbose mbase->sk_verbose -#define k_threadprivate mbase->sk_threadprivate -#define k_blocks mbase->sk_blocks -#define k_iter_msg mbase->sk_iter_msg -#define k_vv mbase->sk_vv -#define k_linepad mbase->sk_linepad -#define k_options mbase->sk_options -#define k_testnumber mbase->sk_testnumber -#define k_currentpass mbase->sk_currentpass - -static long blocks[MAX_LINECOUNT]; /* addresses of data blocks */ -static control_t *mbase; -static vint initialized=0; - -static unsigned int ran_conf_llsc(int); -static int rerr(capture_t *, char *, void *, void *, int, int, int, int, int, int); -static void dumpline(void *, char *, char *, void *, void *, int); -static int checkstop(int, int, uint); -static void spin(int); -static void capturedata(capture_t *, uint, void *, void *, int); -static int randn(uint max, uint *seed); -static uint zrandom (uint *zranseed); -static int set_lock(uint *, uint); -static int clr_lock(uint *, uint); -static void Speedo(void); - -int autotest_enabled=0; -static int llsctest_number=-1; -static int errstop_enabled=0; -static int fail_enabled=0; -static int selective_trigger=0; -static int dump_block_addrs_opt=0; -static uint errlock=0; - -static int __init autotest_enable(char *str) -{ - autotest_enabled = 1; - return 1; -} -static int __init set_llscblkadr(char *str) -{ - dump_block_addrs_opt = 1; - return 1; -} -static int __init set_llscselt(char *str) -{ - selective_trigger = 1; - return 1; -} -static int __init set_llsctest(char *str) -{ - llsctest_number = simple_strtol(str, &str, 10); - if (llsctest_number < 0 || llsctest_number > 15) - llsctest_number = -1; - return 1; -} -static int __init set_llscerrstop(char *str) -{ - errstop_enabled = 1; - return 1; -} -static int __init set_llscfail(char *str) -{ - fail_enabled = 8; - return 1; -} - -static void print_params(void) -{ - printk ("********* Enter AUTOTEST facility on master cpu *************\n"); - printk (" Test options:\n"); - printk (" llsctest=\t%d\tTest number to run (all = -1)\n", llsctest_number); - printk (" llscerrstop \t%s\tStop on error\n", errstop_enabled ? "on" : "off"); - printk (" llscfail \t%s\tForce a failure to test the trigger & error messages\n", fail_enabled ? "on" : "off"); - printk (" llscselt \t%s\tSelective triger on failures\n", selective_trigger ? "on" : "off"); - printk (" llscblkadr \t%s\tDump data block addresses\n", dump_block_addrs_opt ? "on" : "off"); - printk ("\n"); -} -__setup("autotest", autotest_enable); -__setup("llsctest=", set_llsctest); -__setup("llscerrstop", set_llscerrstop); -__setup("llscfail", set_llscfail); -__setup("llscselt", set_llscselt); -__setup("llscblkadr", set_llscblkadr); - - -extern inline int -set_lock(uint *lock, uint id) -{ - uint old; - old = cmpxchg_acq(lock, 0, id); - return (old == 0); -} - -extern inline int -clr_lock(uint *lock, uint id) -{ - uint old; - old = cmpxchg_rel(lock, id, 0); - return (old == id); -} - -extern inline void -zero_lock(uint *lock) -{ - *lock = 0; -} - -/*------------------------------------------------------------------------+ -| Routine : ran_conf_llsc - ll/sc shared data test | -| Description: This test checks the coherency of shared data | -+------------------------------------------------------------------------*/ -static unsigned int -ran_conf_llsc(int thread) -{ - private_t pval; - share_t sval, sval2; - uint vv, linei, slinei, sharei, pass; - long t; - lock_t lockpat; - share_t *sharecopy; - long verbose, napticks, passes, linecount, lcount; - dataline_t *linep, *slinep; - int s, seed; - threadprivate_t *tp; - uint iter_msg, iter_msg_i=0; - int vv_mask; - int correct_errors; - int errs=0; - int stillbad; - capture_t capdata; - private_t *privp; - share_t *sharep; - - - linecount = k_linecount; - napticks = k_napticks; - verbose = k_verbose; - passes = k_passes; - iter_msg = k_iter_msg; - seed = (thread + 1) * 647; - tp = THREADPRIVATE(thread); - vv_mask = (k_vv>>((thread%16)*4)) & 0xf; - correct_errors = k_options&0xff; - - memset (&tp->private, 0, sizeof(tp->private)); - memset (&capdata, 0, sizeof(capdata)); - - for (pass = 1; passes == 0 || pass < passes; pass++) { - lockpat = (pass & 0x0fffffff) + (thread <<28); - tp->threadpasses = pass; - if (checkstop(thread, pass, lockpat)) - return 0; - iter_msg_i++; - if (iter_msg && iter_msg_i > iter_msg) { - printk("Thread %d, Pass %d\n", thread, pass); - iter_msg_i = 0; - } - lcount = 0; - - /* - * Select line to perform operations on. - */ - linei = randn(linecount, &seed); - sharei = randn(2, &seed); - slinei = (linei + (linecount/2))%linecount; /* I dont like this - fix later */ - - linep = (dataline_t *)blocks[linei]; - slinep = (dataline_t *)blocks[slinei]; - if (sharei == 0) - sharecopy = &slinep->share0; - else - sharecopy = &slinep->share1; - - - vv = randn(4, &seed); - if ((vv_mask & (1<private[thread]; - sharep = &linep->share[sharei]; - - switch(vv) { - case 0: - /* Read and verify private count on line. */ - pval = *privp; - if (verbose) - printk("Line:%3d, Thread:%d:%d. Val: %x\n", linei, thread, vv, tp->private[linei]); - if (pval != tp->private[linei]) { - capturedata(&capdata, pass, privp, NULL, sizeof(*privp)); - stillbad = (*privp != tp->private[linei]); - if (rerr(&capdata, "Private count", linep, slinep, thread, pass, linei, tp->private[linei], pval, stillbad)) { - return 1; - } - if (correct_errors) { - tp->private[linei] = *privp; - } - errs++; - } - break; - - case 1: - /* Read, verify, and increment private count on line. */ - pval = *privp; - if (verbose) - printk("Line:%3d, Thread:%d:%d. Val: %x\n", linei, thread, vv, tp->private[linei]); - if (pval != tp->private[linei]) { - capturedata(&capdata, pass, privp, NULL, sizeof(*privp)); - stillbad = (*privp != tp->private[linei]); - if (rerr(&capdata, "Private count & inc", linep, slinep, thread, pass, linei, tp->private[linei], pval, stillbad)) { - return 1; - } - errs++; - } - pval++; - *privp = pval; - tp->private[linei] = pval; - break; - - case 2: - /* Lock line, read and verify shared data. */ - if (verbose) - printk("Line:%3d, Thread:%d:%d. Val: %x\n", linei, thread, vv, *sharecopy); - lcount = 0; - while (LOCK(sharei) != 1) { - if (checkstop(thread, pass, lockpat)) - return 0; - if (lcount++>1000000) { - capturedata(&capdata, pass, LOCKADDR(sharei), NULL, sizeof(lock_t)); - stillbad = (GETLOCK(sharei) != 0); - rerr(&capdata, "Shared data lock", linep, slinep, thread, pass, linei, 0, GETLOCK(sharei), stillbad); - return 1; - } - if ((lcount&0x3fff) == 0) - udelay(1000); - } - - sval = *sharep; - sval2 = *sharecopy; - if (pass > 12 && thread == 0 && fail_enabled == 1) - sval++; - if (sval != sval2) { - capturedata(&capdata, pass, sharep, sharecopy, sizeof(*sharecopy)); - stillbad = (*sharep != *sharecopy); - if (!stillbad && *sharep != sval && *sharecopy == sval2) - stillbad = 2; - if (rerr(&capdata, "Shared data", linep, slinep, thread, pass, linei, sval2, sval, stillbad)) { - return 1; - } - if (correct_errors) - *sharep = *sharecopy; - errs++; - } - - - if ( (s=UNLOCK(sharei)) != 1) { - capturedata(&capdata, pass, LOCKADDR(sharei), NULL, 4); - stillbad = (GETLOCK(sharei) != lockpat); - if (rerr(&capdata, "Shared data unlock", linep, slinep, thread, pass, linei, lockpat, GETLOCK(sharei), stillbad)) - return 1; - if (correct_errors) - ZEROLOCK(sharei); - errs++; - } - break; - - case 3: - /* Lock line, read and verify shared data, modify shared data. */ - if (verbose) - printk("Line:%3d, Thread:%d:%d. Val: %x\n", linei, thread, vv, *sharecopy); - lcount = 0; - while (LOCK(sharei) != 1) { - if (checkstop(thread, pass, lockpat)) - return 0; - if (lcount++>1000000) { - capturedata(&capdata, pass, LOCKADDR(sharei), NULL, sizeof(lock_t)); - stillbad = (GETLOCK(sharei) != 0); - rerr(&capdata, "Shared data lock & inc", linep, slinep, thread, pass, linei, 0, GETLOCK(sharei), stillbad); - return 1; - } - if ((lcount&0x3fff) == 0) - udelay(1000); - } - sval = *sharep; - sval2 = *sharecopy; - if (sval != sval2) { - capturedata(&capdata, pass, sharep, sharecopy, sizeof(*sharecopy)); - stillbad = (*sharep != *sharecopy); - if (!stillbad && *sharep != sval && *sharecopy == sval2) - stillbad = 2; - if (rerr(&capdata, "Shared data & inc", linep, slinep, thread, pass, linei, sval2, sval, stillbad)) { - return 1; - } - errs++; - } - - *sharep = lockpat; - *sharecopy = lockpat; - - - if ( (s=UNLOCK(sharei)) != 1) { - capturedata(&capdata, pass, LOCKADDR(sharei), NULL, 4); - stillbad = (GETLOCK(sharei) != lockpat); - if (rerr(&capdata, "Shared data & inc unlock", linep, slinep, thread, pass, linei, thread, GETLOCK(sharei), stillbad)) - return 1; - if (correct_errors) - ZEROLOCK(sharei); - errs++; - } - break; - } - } - - return (errs > 0); -} - -static void -trigger_la(long val) -{ - long *p; - - p = (long*)0xc0000a0001000020L; /* PI_CPU_NUM */ - *p = val; -} - -static long -getsynerr(void) -{ - long err, *errp; - - errp = (long*)0xc0000e0000000340L; /* SYN_ERR */ - err = *errp; - if (err) - *errp = -1L; - return (err & ~0x60); -} - -static int -rerr(capture_t *cap, char *msg, void *lp, void *slp, int thread, int pass, int linei, int exp, int found, int stillbad) -{ - int cpu, i; - long synerr; - int selt; - - - selt = selective_trigger && stillbad > 1 && - memcmp(cap->blockdata, cap->blockdata_fc, 128) != 0 && - memcmp(cap->shaddata, cap->shaddata_fc, 128) == 0; - if (selt) { - trigger_la(pass); - } else if (selective_trigger) { - k_go = ST_STOP; - return k_stop_on_error;; - } - - spin(1); - i = 100; - while (i && set_lock(&errlock, 1) != 1) { - spin(1); - i--; - } - printk ("\nDataError!: %-20s, test %ld, thread %d, line:%d, pass %d (0x%x), time %ld expected:%x, found:%x\n", - msg, k_testnumber, thread, linei, pass, pass, jiffies, exp, found); - - dumpline (lp, "Corrupted data", "D ", cap->blockaddr, cap->blockdata, cap->size); - if (memcmp(cap->blockdata, cap->blockdata_fc, 128)) - dumpline (lp, "Corrupted data", "DF", cap->blockaddr, cap->blockdata_fc, cap->size); - - if (cap->shadaddr) { - dumpline (slp, "Shadow data", "S ", cap->shadaddr, cap->shaddata, cap->size); - if (memcmp(cap->shaddata, cap->shaddata_fc, 128)) - dumpline (slp, "Shadow data", "SF", cap->shadaddr, cap->shaddata_fc, cap->size); - } - - printk("Threadpasses: "); - for (cpu=0; cputhreadpasses) - printk(" %d:0x%x", cpu, k_threadprivate[cpu]->threadpasses); - - - printk("\nData was %sfixed by flushcache\n", (stillbad == 1 ? "**** NOT **** " : " ")); - synerr = getsynerr(); - if (synerr) - printk("SYNERR: Thread %d, Synerr: 0x%lx\n", thread, synerr); - spin(2); - printk("\n\n"); - clr_lock(&errlock, 1); - - if (errstop_enabled) { - local_irq_disable(); - while(1); - } - return k_stop_on_error; -} - - -static void -dumpline(void *lp, char *str1, char *str2, void *addr, void *data, int size) -{ - long *p; - int i, off; - - printk("%s at 0x%lx, size %d, block starts at 0x%lx\n", str1, (long)addr, size, (long)lp); - p = (long*) data; - for (i=0; i<16; i++, p++) { - if (i==0) printk("%2s", str2); - if (i==8) printk(" "); - printk(" %016lx", *p); - if ((i&7)==7) printk("\n"); - } - printk(" "); - off = (((long)addr) ^ size) & 63L; - for (i=0; i=off) ? "--" : " "); - if ((i%8) == 7) - printk(" "); - } - - off = ((long)addr) & 127; - printk(" (line %d)\n", off/64+1); -} - - -static int -randn(uint max, uint *seedp) -{ - if (max == 1) - return(0); - else - return((int)(zrandom(seedp)>>10) % max); -} - - -static int -checkstop(int thread, int pass, uint lockpat) -{ - long synerr; - - if (k_go == ST_RUN) - return 0; - if (k_go == ST_STOP) - return 1; - - if (errstop_enabled) { - local_irq_disable(); - while(1); - } - synerr = getsynerr(); - spin(2); - if (k_go == ST_STOP) - return 1; - if (synerr) - printk("SYNERR: Thread %d, Synerr: 0x%lx\n", thread, synerr); - return 1; -} - - -static void -spin(int j) -{ - udelay(j * 500000); -} - -static void -capturedata(capture_t *cap, uint pass, void *blockaddr, void *shadaddr, int size) -{ - - if (!selective_trigger) - trigger_la (pass); - - memcpy (cap->blockdata, CACHEALIGN(blockaddr), 128); - if (shadaddr) - memcpy (cap->shaddata, CACHEALIGN(shadaddr), 128); - - if (k_stop_on_error) { - k_go = ST_ERRSTOP; - } - - cap->size = size; - cap->blockaddr = blockaddr; - cap->shadaddr = shadaddr; - - asm volatile ("fc %0" :: "r"(blockaddr) : "memory"); - ia64_sync_i(); - ia64_srlz_d(); - memcpy (cap->blockdata_fc, CACHEALIGN(blockaddr), 128); - - if (shadaddr) { - asm volatile ("fc %0" :: "r"(shadaddr) : "memory"); - ia64_sync_i(); - ia64_srlz_d(); - memcpy (cap->shaddata_fc, CACHEALIGN(shadaddr), 128); - } -} - -int zranmult = 0x48c27395; - -static uint -zrandom (uint *seedp) -{ - *seedp = (*seedp * zranmult) & 0x7fffffff; - return (*seedp); -} - - -void -set_autotest_params(void) -{ - static int testnumber=-1; - - if (llsctest_number >= 0) { - testnumber = llsctest_number; - } else { - testnumber++; - if (autotest_table[testnumber].passes == 0) { - testnumber = 0; - dump_block_addrs_opt = 0; - } - } - k_passes = autotest_table[testnumber].passes; - k_linepad = autotest_table[testnumber].linepad; - k_linecount = autotest_table[testnumber].linecount; - k_testnumber = testnumber; - - if (IS_RUNNING_ON_SIMULATOR()) { - printk ("llsc start test %ld\n", k_testnumber); - k_passes = 1000; - } -} - - -static void -set_leds(int errs) -{ - unsigned char leds=0; - - /* - * Leds are: - * ppppeee- - * where - * pppp = test number - * eee = error count but top bit is stick - */ - - leds = ((errs&7)<<1) | ((k_testnumber&15)<<4) | (errs ? 0x08 : 0); - bringup_set_led_bits(leds, 0xfe); -} - -static void -setup_block_addresses(void) -{ - int i, stride, memmapi; - - stride = LINESTRIDE; - memmapi = 0; - for (i=0; i= memmap[memmapi].vend) { - memmap[memmapi].wrapcount++; - memmap[memmapi].nextaddr = memmap[memmapi].vstart + - memmap[memmapi].wrapcount * sizeof(dataline_t); - } - - memset((void*)blocks[i], 0, sizeof(dataline_t)); - - if (stride > 16384) { - memmapi++; - if (memmapi == memmapx) - memmapi = 0; - } - } - -} - -static void -dump_block_addrs(void) -{ - int i; - - printk("LLSC TestNumber %ld\n", k_testnumber); - - for (i=0; ithreadstate == TS_KILLED) { - bringup_set_led_bits(0xfe, 0xfe); - while(1); - } - k_threadprivate[cpuid]->threadstate = state; -} - -static int -build_mem_map(unsigned long start, unsigned long end, void *arg) -{ - long lstart; - long align = 8*MB; - /* - * HACK - skip the kernel on the first node - */ - - printk ("LLSC memmap: start 0x%lx, end 0x%lx, (0x%lx - 0x%lx)\n", - start, end, (long) virt_to_page(start), (long) virt_to_page(end-PAGE_SIZE)); - - while (end > start && (PageReserved(virt_to_page(end-PAGE_SIZE)) || virt_to_page(end-PAGE_SIZE)->count.counter > 0)) - end -= PAGE_SIZE; - - lstart = end; - while (lstart > start && (!PageReserved(virt_to_page(lstart-PAGE_SIZE)) && virt_to_page(lstart-PAGE_SIZE)->count.counter == 0)) - lstart -= PAGE_SIZE; - - lstart = (lstart + align -1) /align * align; - end = end / align * align; - if (lstart >= end) - return 0; - printk (" memmap: start 0x%lx, end 0x%lx\n", lstart, end); - - memmap[memmapx].vstart = lstart; - memmap[memmapx].vend = end; - memmapx++; - return 0; -} - -void int_test(void); - -int -llsc_main (int cpuid, long mbasex) -{ - int i, cpu, is_master, repeatcnt=0; - unsigned int preverr=0, errs=0, pass=0; - int automode=0; - -#ifdef INTTEST - if (inttest) - int_test(); -#endif - - if (!autotest_enabled) - return 0; - -#ifdef CONFIG_SMP - is_master = !smp_processor_id(); -#else - is_master = 1; -#endif - - - if (is_master) { - print_params(); - if(!IS_RUNNING_ON_SIMULATOR()) - spin(10); - mbase = (control_t*)mbasex; - k_currentpass = 0; - k_go = ST_IDLE; - k_passes = DEF_PASSES; - k_napticks = DEF_NAPTICKS; - k_stop_on_error = DEF_STOP_ON_ERROR; - k_verbose = DEF_VERBOSE; - k_linecount = DEF_LINECOUNT; - k_iter_msg = DEF_ITER_MSG; - k_vv = DEF_VV; - k_linepad = DEF_LINEPAD; - k_blocks = (void*)blocks; - efi_memmap_walk(build_mem_map, 0); - -#ifdef CONFIG_IA64_SGI_AUTOTEST - automode = 1; -#endif - - for (i=0; i 5) { - set_autotest_params(); - repeatcnt = 0; - } - } else { - while (k_go == ST_IDLE); - } - - k_go = ST_INIT; - if (k_linecount > MAX_LINECOUNT) k_linecount = MAX_LINECOUNT; - k_linecount = k_linecount & ~1; - setup_block_addresses(); - if (dump_block_addrs_opt) - dump_block_addrs(); - - k_currentpass = pass++; - k_go = ST_RUN; - if (fail_enabled) - fail_enabled--; - - } else { - while (k_go != ST_RUN || k_currentpass != pass); - pass++; - } - - - set_leds(errs); - set_thread_state(cpuid, TS_RUNNING); - - errs += ran_conf_llsc(cpuid); - preverr = (k_go == ST_ERRSTOP); - - set_leds(errs); - set_thread_state(cpuid, TS_STOPPED); - - if (is_master) { - Speedo(); - for (i=0, cpu=0; cputhreadstate == TS_RUNNING) { - i++; - if (i == 10000) { - k_go = ST_STOP; - printk (" llsc master stopping test number %ld\n", k_testnumber); - } - if (i > 100000) { - k_threadprivate[cpu]->threadstate = TS_KILLED; - printk (" llsc: master killing cpuid %d, running test number %ld\n", - cpu, k_testnumber); - } - udelay(1000); - } - } - } - - goto loop; -} - - -static void -Speedo(void) -{ - static int i = 0; - - switch (++i%4) { - case 0: - printk("|\b"); - break; - case 1: - printk("\\\b"); - break; - case 2: - printk("-\b"); - break; - case 3: - printk("/\b"); - break; - } -} - -#ifdef INTTEST - -/* ======================================================================================================== - * - * Some test code to verify that interrupts work - * - * Add the following to the arch/ia64/kernel/smp.c after the comment "Reschedule callback" - * if (zzzprint_resched) printk(" cpu %d got interrupt\n", smp_processor_id()); - * - * Enable the code in arch/ia64/sn/sn1/smp.c to print sending IPIs. - * - */ - -static int __init set_inttest(char *str) -{ - inttest = 1; - autotest_enabled = 1; - - return 1; -} - -__setup("inttest=", set_inttest); - -int zzzprint_resched=0; - -void -int_test() { - int mycpu, cpu; - static volatile int control_cpu=0; - - mycpu = smp_processor_id(); - zzzprint_resched = 2; - - printk("Testing cross interrupts\n"); - - while (control_cpu != smp_num_cpus) { - if (mycpu == cpu_logical_map(control_cpu)) { - for (cpu=0; cpulock[(i)] -#define LOCK(i) set_lock(LOCKADDR(i), lockpat) -#define UNLOCK(i) clr_lock(LOCKADDR(i), lockpat) -#define GETLOCK(i) *LOCKADDR(i) -#define ZEROLOCK(i) zero_lock(LOCKADDR(i)) - -#define CACHEALIGN(a) ((void*)((long)(a) & ~127L)) - -typedef uint lock_t; -typedef uint share_t; -typedef uint private_t; - -typedef struct { - lock_t lock[2]; - share_t share[2]; - private_t private[MAXCPUS]; - share_t share0; - share_t share1; -} dataline_t ; - - -#define LINEPAD k_linepad -#define LINESTRIDE (((sizeof(dataline_t)+CACHELINE-1)/CACHELINE)*CACHELINE + LINEPAD) - - -typedef struct { - vint threadstate; - uint threadpasses; - private_t private[MAX_LINECOUNT]; -} threadprivate_t; - -typedef struct { - vlong sk_go; /* 0=idle, 1=init, 2=run */ - long sk_linecount; - long sk_passes; - long sk_napticks; - long sk_stop_on_error; - long sk_verbose; - long sk_iter_msg; - long sk_vv; - long sk_linepad; - long sk_options; - long sk_testnumber; - vlong sk_currentpass; - void *sk_blocks; - threadprivate_t *sk_threadprivate[MAXCPUS]; -} control_t; - -/* Run state (k_go) constants */ -#define ST_IDLE 0 -#define ST_INIT 1 -#define ST_RUN 2 -#define ST_STOP 3 -#define ST_ERRSTOP 4 - - -/* Threadstate constants */ -#define TS_STOPPED 0 -#define TS_RUNNING 1 -#define TS_KILLED 2 - - - -int llsc_main (int cpuid, long mbasex); - diff -urN linux-2.4.18/arch/ia64/sn/sn1/machvec.c lia64-2.4/arch/ia64/sn/sn1/machvec.c --- linux-2.4.18/arch/ia64/sn/sn1/machvec.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/sn1/machvec.c Wed Dec 31 16:00:00 1969 @@ -1,18 +0,0 @@ -#define MACHVEC_PLATFORM_NAME sn1 -#include -#include -#include -void* -sn1_mk_io_addr_MACRO - -dma_addr_t -sn1_pci_map_single_MACRO - -int -sn1_pci_map_sg_MACRO - -unsigned long -sn1_virt_to_phys_MACRO - -void * -sn1_phys_to_virt_MACRO diff -urN linux-2.4.18/arch/ia64/sn/sn1/mm.c lia64-2.4/arch/ia64/sn/sn1/mm.c --- linux-2.4.18/arch/ia64/sn/sn1/mm.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/sn1/mm.c Wed Dec 31 16:00:00 1969 @@ -1,394 +0,0 @@ -/* - * Copyright, 2000-2001, Silicon Graphics. - * Copyright Srinivasa Thirumalachar (sprasad@engr.sgi.com) - * Copyright 2000-2001 Kanoj Sarcar (kanoj@sgi.com) - */ - -#include -#include -#include -#include -#include -#include - -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#define MAX(a,b) ((a) > (b) ? (a) : (b)) - -#define DONE_NOTHING 0 -#define DONE_FINDING 1 -#define DONE_BUILDING 2 - -struct nodemem_s { - u64 start; /* start of kernel usable memory */ - u64 end; /* end of kernel usable memory */ - u64 mtot; /* total kernel usable memory */ - u64 done; /* state of bootmem initialization */ - u64 bstart; /* where should the bootmem area be */ - u64 bsize; /* bootmap size */ - u64 hole[SN1_MAX_BANK_PER_NODE]; -} nodemem[MAXNODES]; - -static int nodemem_valid = 0; - -static int __init -free_unused_memmap_hole(int nid, unsigned long start, unsigned long end) -{ - struct page * page, *pageend; - unsigned long count = 0; - - if (start >= end) - return 0; - - /* - * Get the memmap ptrs to the start and end of the holes. - * virt_to_page(start) will panic, if start is in hole. - * Can we do virt_to_page(end), if end is on the next node? - */ - - page = virt_to_page(start - 1); - page++; - pageend = virt_to_page(end); - - printk("hpage=0x%lx, hpageend=0x%lx\n", (u64)page, (u64)pageend) ; - free_bootmem_node(NODE_DATA(nid), __pa(page), (u64)pageend - (u64)page); - - return count; -} - -static void __init -free_unused_memmap_node(int nid) -{ - u64 i = 0; - u64 holestart = -1; - u64 start = nodemem[nid].start; - - start = ((start >> SN1_NODE_ADDR_SHIFT) << SN1_NODE_ADDR_SHIFT); - do { - holestart = nodemem[nid].hole[i]; - i++; - while ((i < SN1_MAX_BANK_PER_NODE) && - (nodemem[nid].hole[i] == (u64)-1)) - i++; - if (i < SN1_MAX_BANK_PER_NODE) - free_unused_memmap_hole(nid, holestart, - start + (i<> SN1_NODE_ADDR_SHIFT) << SN1_NODE_ADDR_SHIFT); - - nodesize = nodemem[nid].end - start ; - numpfn = nodesize >> PAGE_SHIFT; - - bank0size = nodemem[nid].hole[0] - start ; - /* If nid == master node && no kernel text replication */ - bank0size -= 0xA00000 ; /* Kernel text + stuff */ - bank0size -= ((numpfn + 7) >> 3); - - if ((numpfn * sizeof(mem_map_t)) > bank0size) { - printk("nid = %d, ns=0x%lx, npfn=0x%lx, bank0size=0x%lx\n", - nid, nodesize, numpfn, bank0size) ; - return 0 ; - } - - return 1 ; -} - -static void __init -check_pgtbl_size(int nid) -{ - int bank = SN1_MAX_BANK_PER_NODE - 1 ; - - /* Find highest bank with valid memory */ - while ((nodemem[nid].hole[bank] == -1) && (bank)) - bank-- ; - - while (!pgtbl_size_ok(nid)) { - /* Remove that bank of memory */ - /* Collect some numbers later */ - printk("Ignoring node %d bank %d\n", nid, bank) ; - nodemem[nid].hole[bank--] = -1 ; - /* Get to the next populated bank */ - while ((nodemem[nid].hole[bank] == -1) && (bank)) - bank-- ; - printk("Using only upto bank %d on node %d\n", bank,nid) ; - nodemem[nid].end = nodemem[nid].hole[bank] ; - if (!bank) break ; - } -} - -void dump_nodemem_map(int) ; - -#ifdef CONFIG_DISCONTIGMEM - -extern bootmem_data_t bdata[]; - -/* - * This assumes there will be a hole in kernel-usable memory between nodes - * (due to prom). The memory descriptors invoked via efi_memmap_walk are - * in increasing order. It tries to identify first suitable free area to - * put the bootmem for the node in. When presented with the md holding - * the kernel, it only searches at the end of the kernel area. - */ -static int __init -find_node_bootmem(unsigned long start, unsigned long end, void *arg) -{ - int nasid = GetNasId(__pa(start)); - int cnodeid = NASID_TO_CNODEID(nasid); - unsigned long nodesize; - extern char _end; - unsigned long kaddr = (unsigned long)&_end; - - /* - * Track memory available to kernel. - */ - nodemem[cnodeid].mtot += ((end - start) >> PAGE_SHIFT); - if (nodemem[cnodeid].done != DONE_NOTHING) - return(0); - nodesize = nodemem[cnodeid].end - ((nodemem[cnodeid].start >> - SN1_NODE_ADDR_SHIFT) << SN1_NODE_ADDR_SHIFT); - nodesize >>= PAGE_SHIFT; - - /* - * Adjust limits for the md holding the kernel. - */ - if ((start < kaddr) && (end > kaddr)) - start = PAGE_ALIGN(kaddr); - - /* - * We need space for mem_map, bootmem map plus a few more pages - * to satisfy alloc_bootmems out of node 0. - */ - if ((end - start) > ((nodesize * sizeof(struct page)) + (nodesize/8) - + (10 * PAGE_SIZE))) { - nodemem[cnodeid].bstart = start; - nodemem[cnodeid].done = DONE_FINDING; - } - return(0); -} - -/* - * This assumes there will be a hole in kernel-usable memory between nodes - * (due to prom). The memory descriptors invoked via efi_memmap_walk are - * in increasing order. - */ -static int __init -build_node_bootmem(unsigned long start, unsigned long end, void *arg) -{ - int nasid = GetNasId(__pa(start)); - int curnodeid = NASID_TO_CNODEID(nasid); - int i; - unsigned long pstart, pend; - extern char _end, _stext; - unsigned long kaddr = (unsigned long)&_end; - - if (nodemem[curnodeid].done == DONE_FINDING) { - /* - * This is where we come to know the node is present. - * Do node wide tasks. - */ - nodemem[curnodeid].done = DONE_BUILDING; - NODE_DATA(curnodeid)->bdata = &(bdata[curnodeid]); - - /* - * Update the chunktonid array as a node wide task. There - * are too many smalls mds on first node to do this per md. - */ - pstart = __pa(nodemem[curnodeid].start); - pend = __pa(nodemem[curnodeid].end); - pstart &= CHUNKMASK; - pend = (pend + CHUNKSZ - 1) & CHUNKMASK; - /* Possible check point to enforce minimum node size */ - if (nodemem[curnodeid].bstart == -1) { - printk("No valid bootmem area on node %d\n", curnodeid); - while(1); - } - for (i = PCHUNKNUM(pstart); i <= PCHUNKNUM(pend - 1); i++) - chunktonid[i] = curnodeid; - if ((CHUNKTONID(PCHUNKNUM(pend)) > MAXCHUNKS) || - (PCHUNKNUM(pstart) >= PCHUNKNUM(pend))) { - printk("Ign 0x%lx-0x%lx, ", __pa(start), __pa(end)); - return(0); - } - - /* - * NODE_START and NODE_SIZE determine the physical range - * on the node that mem_map array needs to be set up for. - */ - NODE_START(curnodeid) = ((nodemem[curnodeid].start >> - SN1_NODE_ADDR_SHIFT) << SN1_NODE_ADDR_SHIFT); - NODE_SIZE(curnodeid) = (nodemem[curnodeid].end - - NODE_START(curnodeid)); - - nodemem[curnodeid].bsize = - init_bootmem_node(NODE_DATA(curnodeid), - (__pa(nodemem[curnodeid].bstart) >> PAGE_SHIFT), - (__pa((nodemem[curnodeid].start >> SN1_NODE_ADDR_SHIFT) - << SN1_NODE_ADDR_SHIFT) >> PAGE_SHIFT), - (__pa(nodemem[curnodeid].end) >> PAGE_SHIFT)); - - } else if (nodemem[curnodeid].done == DONE_NOTHING) { - printk("build_node_bootmem: node %d weirdness\n", curnodeid); - while(1); /* Paranoia */ - } - - /* - * Free the entire md. - */ - free_bootmem_node(NODE_DATA(curnodeid), __pa(start), (end - start)); - - /* - * Reclaim back the bootmap and kernel areas. - */ - if ((start <= nodemem[curnodeid].bstart) && (end > - nodemem[curnodeid].bstart)) - reserve_bootmem_node(NODE_DATA(curnodeid), - __pa(nodemem[curnodeid].bstart), nodemem[curnodeid].bsize); - if ((start <= kaddr) && (end > kaddr)) - reserve_bootmem_node(NODE_DATA(curnodeid), - __pa(&_stext), (&_end - &_stext)); - - return(0); -} - -void __init -setup_sn1_bootmem(int maxnodes) -{ - int i; - - for (i = 0; i < MAXNODES; i++) { - nodemem[i].start = nodemem[i].bstart = -1; - nodemem[i].end = nodemem[i].bsize = nodemem[i].mtot = 0; - nodemem[i].done = DONE_NOTHING; - memset(&nodemem[i].hole, -1, sizeof(nodemem[i].hole)); - } - efi_memmap_walk(build_nodemem_map, 0); - - nodemem_valid = 1; - - /* - * After building the nodemem map, check if the node memmap - * will fit in the first bank of each node. If not change - * the node end addr till it fits. - */ - - for (i = 0; i < maxnodes; i++) - check_pgtbl_size(i); - - dump_nodemem_map(maxnodes); - - efi_memmap_walk(find_node_bootmem, 0); - efi_memmap_walk(build_node_bootmem, 0); -} -#endif - -void __init -discontig_paging_init(void) -{ - int i; - unsigned long max_dma, zones_size[MAX_NR_ZONES], holes_size[MAX_NR_ZONES]; - extern void dump_node_data(void); - - max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; - for (i = 0; i < numnodes; i++) { - unsigned long startpfn = __pa((void *)NODE_START(i)) >> PAGE_SHIFT; - unsigned long numpfn = NODE_SIZE(i) >> PAGE_SHIFT; - memset(zones_size, 0, sizeof(zones_size)); - memset(holes_size, 0, sizeof(holes_size)); - holes_size[ZONE_DMA] = numpfn - nodemem[i].mtot; - - if ((startpfn + numpfn) < max_dma) { - zones_size[ZONE_DMA] = numpfn; - } else if (startpfn > max_dma) { - zones_size[ZONE_NORMAL] = numpfn; - panic("discontig_paging_init: %d\n", i); - } else { - zones_size[ZONE_DMA] = (max_dma - startpfn); - zones_size[ZONE_NORMAL] = numpfn - zones_size[ZONE_DMA]; - panic("discontig_paging_init: %d\n", i); - } - free_area_init_node(i, NODE_DATA(i), NULL, zones_size, startpfn< ") ; - for (j=0;j - -/* - * ia64_sn_probe_io_slot - * This function will probe a physical address to determine if - * the address can be read. If reading the address causes a BUS - * error, an error is returned. If the probe succeeds, the contents - * of the memory location is returned. - * - * Calling sequence: - * ia64_probe_io_slot(paddr, size, data_ptr) - * - * Input: - * paddr Physical address to probe - * size Number bytes to read (1,2,4,8) - * data_ptr Address to store value read by probe - * (-1 returned if probe fails) - * - * Output: - * Status - * 0 - probe successful - * 1 - probe failed (generated MCA) - * 2 - Bad arg - * <0 - PAL error - */ - - -u64 -ia64_sn_probe_io_slot(long paddr, long size, void *data_ptr) -{ - struct ia64_sal_retval isrv; - - SAL_CALL(isrv, SN_SAL_PROBE, paddr, size, 0, 0, 0, 0, 0); - - if (data_ptr) { - switch (size) { - case 1: - *((u8*)data_ptr) = (u8)isrv.v0; - break; - case 2: - *((u16*)data_ptr) = (u16)isrv.v0; - break; - case 4: - *((u32*)data_ptr) = (u32)isrv.v0; - break; - case 8: - *((u64*)data_ptr) = (u64)isrv.v0; - break; - default: - isrv.status = 2; - } - } - - return isrv.status; -} diff -urN linux-2.4.18/arch/ia64/sn/sn1/setup.c lia64-2.4/arch/ia64/sn/sn1/setup.c --- linux-2.4.18/arch/ia64/sn/sn1/setup.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/sn1/setup.c Wed Dec 31 16:00:00 1969 @@ -1,254 +0,0 @@ -/* - * - * Copyright (C) 1999 Silicon Graphics, Inc. - * Copyright (C) Vijay Chander(vijay@engr.sgi.com) - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - - -/* - * This is the address of the RRegs in the HSpace of the global - * master. It is used by a hack in serial.c (serial_[in|out], - * printk.c (early_printk), and kdb_io.c to put console output on that - * node's Bedrock UART. It is initialized here to 0, so that - * early_printk won't try to access the UART before - * master_node_bedrock_address is properly calculated. - */ -u64 master_node_bedrock_address = 0UL; - -static void sn_fix_ivt_for_partitioned_system(void); - - -/* - * The format of "screen_info" is strange, and due to early i386-setup - * code. This is just enough to make the console code think we're on a - * VGA color display. - */ -struct screen_info sn1_screen_info = { - orig_x: 0, - orig_y: 0, - orig_video_mode: 3, - orig_video_cols: 80, - orig_video_ega_bx: 3, - orig_video_lines: 25, - orig_video_isVGA: 1, - orig_video_points: 16 -}; - -/* - * This is here so we can use the CMOS detection in ide-probe.c to - * determine what drives are present. In theory, we don't need this - * as the auto-detection could be done via ide-probe.c:do_probe() but - * in practice that would be much slower, which is painful when - * running in the simulator. Note that passing zeroes in DRIVE_INFO - * is sufficient (the IDE driver will autodetect the drive geometry). - */ -char drive_info[4*16]; - -unsigned long -sn1_map_nr (unsigned long addr) -{ -#ifdef CONFIG_DISCONTIGMEM - return MAP_NR_SN1(addr); -#else - return MAP_NR_DENSE(addr); -#endif -} - -#if defined(BRINGUP) && defined(CONFIG_IA64_EARLY_PRINTK) -void __init -early_sn1_setup(void) -{ - master_node_bedrock_address = - (u64)REMOTE_HSPEC_ADDR(get_nasid(), 0); - printk("early_sn1_setup: setting master_node_bedrock_address to 0x%lx\n", master_node_bedrock_address); -} -#endif /* BRINGUP && CONFIG_IA64_EARLY_PRINTK */ - -void __init -sn1_setup(char **cmdline_p) -{ -#if defined(CONFIG_SERIAL) && !defined(CONFIG_SERIAL_SGI_L1_PROTOCOL) - struct serial_struct req; -#endif - - MAX_DMA_ADDRESS = PAGE_OFFSET + 0x10000000000UL; - master_node_bedrock_address = - (u64)REMOTE_HSPEC_ADDR(get_nasid(), 0); - printk("sn1_setup: setting master_node_bedrock_address to 0x%lx\n", - master_node_bedrock_address); - -#if defined(CONFIG_SERIAL) && !defined(CONFIG_SERIAL_SGI_L1_PROTOCOL) - /* - * We do early_serial_setup() to clean out the rs-table[] from the - * statically compiled in version. - */ - memset(&req, 0, sizeof(struct serial_struct)); - req.line = 0; - req.baud_base = 124800; - req.port = 0; - req.port_high = 0; - req.irq = 0; - req.flags = (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST); - req.io_type = SERIAL_IO_MEM; - req.hub6 = 0; - req.iomem_base = (u8 *)(master_node_bedrock_address + 0x80); - req.iomem_reg_shift = 3; - req.type = 0; - req.xmit_fifo_size = 0; - req.custom_divisor = 0; - req.closing_wait = 0; - early_serial_setup(&req); -#endif /* CONFIG_SERIAL && !CONFIG_SERIAL_SGI_L1_PROTOCOL */ - - ROOT_DEV = to_kdev_t(0x0301); /* default to first IDE drive */ - sn_fix_ivt_for_partitioned_system(); - -#ifdef CONFIG_SMP - init_smp_config(); -#endif - screen_info = sn1_screen_info; -} - - -/* - * sn_fix_ivt_for_partitioned_system - * - * This is an ugly hack that is needed for partitioned systems. - * - * On a partitioned system, most partitions do NOT have a physical address 0. - * Unfortunately, the exception handling code in ivt.S has a couple of physical - * addresses of kernel structures hardcoded into "movl" instructions. - * These addresses are correct on partition 0 only. On all other partitions, - * the addresses must be changed to reference the correct address. - * - * This routine scans the ivt code and replaces the hardcoded addresses with - * the correct address. - * - * Note that we could have made the ivt.S code dynamically determine the correct - * address but this would add code to performance critical pathes. This option - * was rejected. - */ - -#define TEMP_mlx 4 /* template type that contains movl instruction */ -#define TEMP_mlX 5 /* template type that contains movl instruction */ - -typedef union { /* Instruction encoding for movl instruction */ - struct { - unsigned long qp:6; - unsigned long r1:7; - unsigned long imm7b:7; - unsigned long vc:1; - unsigned long ic:1; - unsigned long imm5c:5; - unsigned long imm9d:9; - unsigned long i:1; - unsigned long op:4; - unsigned long fill:23; - } b; - unsigned long l; -} movl_instruction_t; - -#define MOVL_OPCODE 6 -#define MOVL_ARG(a,b) (((long)a.i<<63) | ((long)b<<22) | ((long)a.ic<<21) | \ - ((long)a.imm5c<<16) | ((long)a.imm9d<<7) | ((long)a.imm7b)) - -typedef struct { /* Instruction bundle */ - unsigned long template:5; - unsigned long ins2:41; - unsigned long ins1l:18; - unsigned long ins1u:23; - unsigned long ins0:41; -} instruction_bundle_t; - - -static void __init -sn_fix_ivt_for_partitioned_system(void) -{ - extern int ia64_ivt; - instruction_bundle_t *p, *pend; - movl_instruction_t ins0, ins1, ins2; - long new_ins1, phys_offset; - unsigned long val; - - /* - * Setup to scan the ivt code. - */ - p = (instruction_bundle_t*)&ia64_ivt; - pend = p + 0x8000/sizeof(instruction_bundle_t); - phys_offset = __pa(p) & ~0x1ffffffffUL; - - /* - * Hunt for movl instructions that contain the node 0 physical address - * of "SWAPPER_PGD_ADDR". These addresses must be relocated to reference the - * actual node that the kernel is loaded on. - */ - for (; p < pend; p++) { - if (p->template != TEMP_mlx && p->template != TEMP_mlX) - continue; - ins0.l = p->ins0; - if (ins0.b.op != MOVL_OPCODE) - continue; - ins1.l = ((long)p->ins1u<<18) | p->ins1l; - ins2.l = p->ins2; - val = MOVL_ARG(ins0.b, ins1.l); - - /* - * Test for correct address. SWAPPER_PGD_ADDR will - * always be a node 0 virtual address. Note that we cant - * use the __pa or __va macros here since they may contain - * debug code that gets fooled here. - */ - if ((PAGE_OFFSET | val) != SWAPPER_PGD_ADDR) - continue; - - /* - * We found an instruction that needs to be fixed. The following - * inserts the NASID of the ivt into the movl instruction. - */ - new_ins1 = ins1.l | (phys_offset>>22); - p->ins1l = new_ins1 & 0x3ffff; - p->ins1u = (new_ins1>>18) & 0x7fffff; - ia64_fc(p); - } - - /* - * Do necessary serialization. - */ - ia64_sync_i(); - ia64_srlz_i(); - -} - -int -IS_RUNNING_ON_SIMULATOR(void) -{ -#ifdef CONFIG_IA64_SGI_SN1_SIM - long sn; - asm("mov %0=cpuid[%1]" : "=r"(sn) : "r"(2)); - return(sn == SNMAGIC); -#else - return(0); -#endif -} diff -urN linux-2.4.18/arch/ia64/sn/sn1/smp.c lia64-2.4/arch/ia64/sn/sn1/smp.c --- linux-2.4.18/arch/ia64/sn/sn1/smp.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/sn1/smp.c Wed Dec 31 16:00:00 1969 @@ -1,186 +0,0 @@ -/* - * SN1 Platform specific SMP Support - * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 Jack Steiner - */ - - - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - - - - -/* - * The following structure is used to pass params thru smp_call_function - * to other cpus for flushing TLB ranges. - */ -typedef struct { - unsigned long start; - unsigned long end; - unsigned long nbits; -} ptc_params_t; - - -/* - * The following table/struct is for remembering PTC coherency domains. It - * is also used to translate sapicid into cpuids. We dont want to start - * cpus unless we know their cache domain. - */ -#ifdef PTC_NOTYET -sn_sapicid_info_t sn_sapicid_info[NR_CPUS]; -#endif - - - -#ifdef PTC_NOTYET -/* - * NOTE: This is probably not good enough, but I dont want to try to make - * it better until I get some statistics on a running system. - * At a minimum, we should only send IPIs to 1 processor in each TLB domain - * & have it issue a ptc.g on it's own FSB. Also, serialize per FSB, not - * globally. - * - * More likely, we will have to do some work to reduce the frequency of calls to - * this routine. - */ - -static void -sn1_ptc_local(void *arg) -{ - ptc_params_t *params = arg; - unsigned long start, end, nbits; - - start = params->start; - end = params->end; - nbits = params->nbits; - - do { - __asm__ __volatile__ ("ptc.l %0,%1" :: "r"(start), "r"(nbits<<2) : "memory"); - start += (1UL << nbits); - } while (start < end); -} - - -void -sn1_ptc_global (unsigned long start, unsigned long end, unsigned long nbits) -{ - ptc_params_t params; - - params.start = start; - params.end = end; - params.nbits = nbits; - - if (smp_call_function(sn1_ptc_local, ¶ms, 1, 0) != 0) - panic("Unable to do ptc_global - timed out"); - - sn1_ptc_local(¶ms); -} -#endif - - - - -void -sn1_send_IPI(int cpuid, int vector, int delivery_mode, int redirect) -{ - long *p, nasid, slice; - static int off[4] = {0x1800080, 0x1800088, 0x1a00080, 0x1a00088}; - - /* - * ZZZ - Replace with standard macros when available. - */ - nasid = cpuid_to_nasid(cpuid); - slice = cpuid_to_slice(cpuid); - p = (long*)(0xc0000a0000000000LL | (nasid<<33) | off[slice]); - -#if defined(ZZZBRINGUP) - { - static int count=0; - if (count++ < 10) printk("ZZ sendIPI 0x%x->0x%x, vec %d, nasid 0x%lx, slice %ld, adr 0x%lx\n", - smp_processor_id(), cpuid, vector, nasid, slice, (long)p); - } -#endif - mb(); - *p = (delivery_mode << 8) | (vector & 0xff); - -} - - -#ifdef CONFIG_SMP - -#ifdef PTC_NOTYET -static void __init -process_sal_ptc_domain_info(ia64_sal_ptc_domain_info_t *di, int domain) -{ - ia64_sal_ptc_domain_proc_entry_t *pe; - int i, sapicid, cpuid; - - pe = __va(di->proc_list); - for (i=0; iproc_count; i++, pe++) { - sapicid = id_eid_to_sapicid(pe->id, pe->eid); - cpuid = cpu_logical_id(sapicid); - sn_sapicid_info[cpuid].domain = domain; - sn_sapicid_info[cpuid].sapicid = sapicid; - } -} - - -static void __init -process_sal_desc_ptc(ia64_sal_desc_ptc_t *ptc) -{ - ia64_sal_ptc_domain_info_t *di; - int i; - - di = __va(ptc->domain_info); - for (i=0; inum_domains; i++, di++) { - process_sal_ptc_domain_info(di, i); - } -} -#endif - - -void __init -init_sn1_smp_config(void) -{ - - if (!ia64_ptc_domain_info) { - printk("SMP: Can't find PTC domain info. Forcing UP mode\n"); - smp_num_cpus = 1; - return; - } - -#ifdef PTC_NOTYET - memset (sn_sapicid_info, -1, sizeof(sn_sapicid_info)); - process_sal_desc_ptc(ia64_ptc_domain_info); -#endif - -} - -#else /* CONFIG_SMP */ - -void __init -init_sn1_smp_config(void) -{ - -#ifdef PTC_NOTYET - sn_sapicid_info[0].sapicid = hard_smp_processor_id(); -#endif -} - -#endif /* CONFIG_SMP */ diff -urN linux-2.4.18/arch/ia64/sn/sn1/sn1_asm.S lia64-2.4/arch/ia64/sn/sn1/sn1_asm.S --- linux-2.4.18/arch/ia64/sn/sn1/sn1_asm.S Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/sn1/sn1_asm.S Wed Dec 31 16:00:00 1969 @@ -1,149 +0,0 @@ - -/* - * Copyright (C) 2000 Silicon Graphics - * Copyright (C) 2000 Jack Steiner (steiner@sgi.com) - */ - -#include -#ifdef CONFIG_IA64_SGI_AUTOTEST - -// Testing only. -// Routine will cause MCAs -// zzzmsa(n) -// n=0 MCA via duplicate TLB dropin -// n=0 MCA via read of garbage address -// - -#define ITIR(key, ps) ((key<<8) | (ps<<2)) -#define TLB_PAGESIZE 28 // Use 256MB pages for now. - - .global zzzmca - .proc zzzmca -zzzmca: - alloc loc4 = ar.pfs,2,8,1,0;; - cmp.ne p6,p0=r32,r0;; - movl r2=0x2dead - movl r3=0x3dead - movl r15=0x15dead - movl r16=0x16dead - movl r31=0x31dead - movl loc0=0x34beef - movl loc1=0x35beef - movl loc2=0x36beef - movl loc3=0x37beef - movl out0=0x42beef - - movl r20=0x32feed;; - mov ar32=r20 - movl r20=0x36feed;; - mov ar36=r20 - movl r20=0x65feed;; - mov ar65=r20 - movl r20=0x66feed;; - mov ar66=r20 - -(p6) br.cond.sptk 1f - - rsm 0x2000;; - srlz.d; - mov r11 = 1 - mov r3 = ITIR(0,TLB_PAGESIZE);; - mov cr.itir = r3 - mov r10 = 0;; - itr.d dtr[r11] = r10;; - mov r11 = 2 - - itr.d dtr[r11] = r10;; - br 9f - -1: movl r8=0xfe00000048;; - ld8 r9=[r8];; - mf - mf.a - srlz.d - -9: mov ar.pfs=loc4 - br.ret.sptk rp - - .endp zzzmca - - .global zzzspec - .proc zzzspec -zzzspec: - mov r8=r32 - movl r9=0xe000000000000000 - movl r10=0x4000;; - ld8.s r16=[r8];; - ld8.s r17=[r9];; - add r8=r8,r10;; - ld8.s r18=[r8];; - add r8=r8,r10;; - ld8.s r19=[r8];; - add r8=r8,r10;; - ld8.s r20=[r8];; - mov r8=r0 - tnat.nz p6,p0=r16 - tnat.nz p7,p0=r17 - tnat.nz p8,p0=r18 - tnat.nz p9,p0=r19 - tnat.nz p10,p0=r20;; - (p6) dep r8=-1,r8,0,1;; - (p7) dep r8=-1,r8,1,1;; - (p8) dep r8=-1,r8,2,1;; - (p9) dep r8=-1,r8,3,1;; - (p10) dep r8=-1,r8,4,1;; - br.ret.sptk rp - .endp zzzspec - - .global zzzspec2 - .proc zzzspec2 -zzzspec2: - cmp.eq p6,p7=r2,r2 - movl r16=0xc0000a0001000020 - ;; - mf - ;; - ld8 r9=[r16] - (p6) br.spnt 1f - ld8 r10=[r32] - ;; - 1: mf.a - mf - - ld8 r9=[r16];; - cmp.ne p6,p7=r9,r16 - (p6) br.spnt 1f - ld8 r10=[r32] - ;; - 1: mf.a - mf - - ld8 r9=[r33];; - cmp.ne p6,p7=r9,r33 - (p6) br.spnt 1f - ld8 r10=[r32] - ;; - 1: mf.a - mf - - tpa r23=r32 - add r20=512,r33 - add r21=1024,r33;; - ld8 r9=[r20] - ld8 r10=[r21];; - nop.i 0 - { .mib - nop.m 0 - cmp.ne p6,p7=r10,r33 - (p6) br.spnt 1f - } - ld8 r10=[r32] - ;; - 1: mf.a - mf - br.ret.sptk rp - - .endp zzzspec - -#endif - diff -urN linux-2.4.18/arch/ia64/sn/sn1/sn1_ksyms.c lia64-2.4/arch/ia64/sn/sn1/sn1_ksyms.c --- linux-2.4.18/arch/ia64/sn/sn1/sn1_ksyms.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/sn1/sn1_ksyms.c Wed Dec 31 16:00:00 1969 @@ -1,39 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 Jesse Barnes (jbarnes@sgi.com) - */ - - -/* - * Architecture-specific kernel symbols - */ - -#include - -#include - -/* - * I/O routines - */ -EXPORT_SYMBOL(sn1_outb); -EXPORT_SYMBOL(sn1_outl); -EXPORT_SYMBOL(sn1_outw); -EXPORT_SYMBOL(sn1_inw); -EXPORT_SYMBOL(sn1_inb); -EXPORT_SYMBOL(sn1_inl); - -/* - * other stuff (more to be added later, cleanup then) - */ -EXPORT_SYMBOL(sn1_pci_map_sg); -EXPORT_SYMBOL(sn1_pci_unmap_sg); -EXPORT_SYMBOL(sn1_pci_alloc_consistent); -EXPORT_SYMBOL(sn1_pci_free_consistent); -EXPORT_SYMBOL(sn1_dma_address); - -#include -EXPORT_SYMBOL(alloc_pages); diff -urN linux-2.4.18/arch/ia64/sn/sn1/sv.c lia64-2.4/arch/ia64/sn/sn1/sv.c --- linux-2.4.18/arch/ia64/sn/sn1/sv.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/sn1/sv.c Wed Dec 31 16:00:00 1969 @@ -1,551 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2000 Silicon Graphics, Inc. All rights reserved - * - * This implemenation of synchronization variables is heavily based on - * one done by Steve Lord - * - * Paul Cassella - */ - -#include -#include -#include - -#include -#include -#include -#include - -#include - -/* Define this to have sv_test() run some simple tests. - kernel_thread() must behave as expected when this is called. */ -#undef RUN_SV_TEST - -#define DEBUG - -/* Set up some macros so sv_wait(), sv_signal(), and sv_broadcast() - can sanity check interrupt state on architectures where we know - how. */ -#ifdef DEBUG - #define SV_DEBUG_INTERRUPT_STATE - #ifdef __mips64 - #define SV_TEST_INTERRUPTS_ENABLED(flags) ((flags & 0x1) != 0) - #define SV_TEST_INTERRUPTS_DISABLED(flags) ((flags & 0x1) == 0) - #define SV_INTERRUPT_TEST_WORKERS 31 - #elif defined(__ia64) - #define SV_TEST_INTERRUPTS_ENABLED(flags) ((flags & 0x4000) != 0) - #define SV_TEST_INTERRUPTS_DISABLED(flags) ((flags & 0x4000) == 0) - #define SV_INTERRUPT_TEST_WORKERS 4 /* simulator's slow */ - #else - #undef SV_DEBUG_INTERRUPT_STATE - #define SV_INTERRUPT_TEST_WORKERS 4 /* reasonable? default. */ - #endif /* __mips64 */ -#endif /* DEBUG */ - - -/* XXX FIXME hack hack hack. Our mips64 tree is from before the - switch to WQ_FLAG_EXCLUSIVE, and our ia64 tree is from after it. */ -#ifdef TASK_EXCLUSIVE - #undef EXCLUSIVE_IN_QUEUE -#else - #define EXCLUSIVE_IN_QUEUE - #define TASK_EXCLUSIVE 0 /* for the set_current_state() in sv_wait() */ -#endif - - -static inline void sv_lock(sv_t *sv) { - spin_lock(&sv->sv_lock); -} - -static inline void sv_unlock(sv_t *sv) { - spin_unlock(&sv->sv_lock); -} - -/* up() is "extern inline", so we can't pass its address to sv_wait. - Use this function's address instead. */ -static void up_wrapper(struct semaphore *sem) { - up(sem); -} - -/* spin_unlock() is sometimes a macro. */ -static void spin_unlock_wrapper(spinlock_t *s) { - spin_unlock(s); -} - -/* XXX Perhaps sv_wait() should do the switch() each time and avoid - the extra indirection and the need for the _wrapper functions? */ - -static inline void sv_set_mon_type(sv_t *sv, int type) { - switch (type) { - case SV_MON_SPIN: - sv->sv_mon_unlock_func = - (sv_mon_unlock_func_t)spin_unlock_wrapper; - break; - case SV_MON_SEMA: - sv->sv_mon_unlock_func = - (sv_mon_unlock_func_t)up_wrapper; - if(sv->sv_flags & SV_INTS) { - printk(KERN_ERR "sv_set_mon_type: The monitor lock " - "cannot be shared with interrupts if it is a " - "semaphore!\n"); - BUG(); - } - if(sv->sv_flags & SV_BHS) { - printk(KERN_ERR "sv_set_mon_type: The monitor lock " - "cannot be shared with bottom-halves if it is " - "a semaphore!\n"); - BUG(); - } - break; -#if 0 - /* - * If needed, and will need to think about interrupts. This - * may be needed, for example, if someone wants to use sv's - * with something like dev_base; writers need to hold two - * locks. - */ - case SV_MON_CUSTOM: - { - struct sv_mon_custom *c = lock; - sv->sv_mon_unlock_func = c->sv_mon_unlock_func; - sv->sv_mon_lock = c->sv_mon_lock; - break; - } -#endif - - default: - printk(KERN_ERR "sv_set_mon_type: unknown type %d (0x%x)! " - "(flags 0x%x)\n", type, type, sv->sv_flags); - BUG(); - break; - } - sv->sv_flags |= type; -} - -static inline void sv_set_ord(sv_t *sv, int ord) { - if (!ord) - ord = SV_ORDER_DEFAULT; - - if (ord != SV_ORDER_FIFO && ord != SV_ORDER_LIFO) { - printk(KERN_EMERG "sv_set_ord: unknown order %d (0x%x)! ", - ord, ord); - BUG(); - } - - sv->sv_flags |= ord; -} - -void sv_init(sv_t *sv, sv_mon_lock_t *lock, int flags) -{ - int ord = flags & SV_ORDER_MASK; - int type = flags & SV_MON_MASK; - - /* Copy all non-order, non-type flags */ - sv->sv_flags = (flags & ~(SV_ORDER_MASK | SV_MON_MASK)); - - if((sv->sv_flags & (SV_INTS | SV_BHS)) == (SV_INTS | SV_BHS)) { - printk(KERN_ERR "sv_init: do not set both SV_INTS and SV_BHS, only SV_INTS.\n"); - BUG(); - } - - sv_set_ord(sv, ord); - sv_set_mon_type(sv, type); - - /* If lock is NULL, we'll get it from sv_wait_compat() (and - ignore it in sv_signal() and sv_broadcast()). */ - sv->sv_mon_lock = lock; - - spin_lock_init(&sv->sv_lock); - init_waitqueue_head(&sv->sv_waiters); -} - -/* - * The associated lock must be locked on entry. It is unlocked on return. - * - * Return values: - * - * n < 0 : interrupted, -n jiffies remaining on timeout, or -1 if timeout == 0 - * n = 0 : timeout expired - * n > 0 : sv_signal()'d, n jiffies remaining on timeout, or 1 if timeout == 0 - */ -signed long sv_wait(sv_t *sv, int sv_wait_flags, unsigned long timeout) -{ - DECLARE_WAITQUEUE( wait, current ); - unsigned long flags; - signed long ret = 0; - -#ifdef SV_DEBUG_INTERRUPT_STATE - { - unsigned long flags; - __save_flags(flags); - - if(sv->sv_flags & SV_INTS) { - if(SV_TEST_INTERRUPTS_ENABLED(flags)) { - printk(KERN_ERR "sv_wait: SV_INTS and interrupts " - "enabled (flags: 0x%lx)\n", flags); - BUG(); - } - } else { - if (SV_TEST_INTERRUPTS_DISABLED(flags)) { - printk(KERN_WARNING "sv_wait: !SV_INTS and interrupts " - "disabled! (flags: 0x%lx)\n", flags); - } - } - } -#endif /* SV_DEBUG_INTERRUPT_STATE */ - - sv_lock(sv); - - sv->sv_mon_unlock_func(sv->sv_mon_lock); - - /* Add ourselves to the wait queue and set the state before - * releasing the sv_lock so as to avoid racing with the - * wake_up() in sv_signal() and sv_broadcast(). - */ - - /* don't need the _irqsave part, but there is no wq_write_lock() */ - wq_write_lock_irqsave(&sv->sv_waiters.lock, flags); - -#ifdef EXCLUSIVE_IN_QUEUE - wait.flags |= WQ_FLAG_EXCLUSIVE; -#endif - - switch(sv->sv_flags & SV_ORDER_MASK) { - case SV_ORDER_FIFO: - __add_wait_queue_tail(&sv->sv_waiters, &wait); - break; - case SV_ORDER_FILO: - __add_wait_queue(&sv->sv_waiters, &wait); - break; - default: - printk(KERN_ERR "sv_wait: unknown order! (sv: 0x%p, flags: 0x%x)\n", - sv, sv->sv_flags); - BUG(); - } - wq_write_unlock_irqrestore(&sv->sv_waiters.lock, flags); - - if(sv_wait_flags & SV_WAIT_SIG) - set_current_state(TASK_EXCLUSIVE | TASK_INTERRUPTIBLE ); - else - set_current_state(TASK_EXCLUSIVE | TASK_UNINTERRUPTIBLE); - - spin_unlock(&sv->sv_lock); - - if(sv->sv_flags & SV_INTS) - local_irq_enable(); - else if(sv->sv_flags & SV_BHS) - local_bh_enable(); - - if (timeout) - ret = schedule_timeout(timeout); - else - schedule(); - - if(current->state != TASK_RUNNING) /* XXX Is this possible? */ { - printk(KERN_ERR "sv_wait: state not TASK_RUNNING after " - "schedule().\n"); - set_current_state(TASK_RUNNING); - } - - remove_wait_queue(&sv->sv_waiters, &wait); - - /* Return cases: - - woken by a sv_signal/sv_broadcast - - woken by a signal - - woken by timeout expiring - */ - - /* XXX This isn't really accurate; we may have been woken - before the signal anyway.... */ - if(signal_pending(current)) - return timeout ? -ret : -1; - return timeout ? ret : 1; -} - - -void sv_signal(sv_t *sv) -{ - /* If interrupts can acquire this lock, they can also acquire the - sv_mon_lock, which we must already have to have called this, so - interrupts must be disabled already. If interrupts cannot - contend for this lock, we don't have to worry about it. */ - -#ifdef SV_DEBUG_INTERRUPT_STATE - if(sv->sv_flags & SV_INTS) { - unsigned long flags; - __save_flags(flags); - if(SV_TEST_INTERRUPTS_ENABLED(flags)) - printk(KERN_ERR "sv_signal: SV_INTS and " - "interrupts enabled! (flags: 0x%lx)\n", flags); - } -#endif /* SV_DEBUG_INTERRUPT_STATE */ - - sv_lock(sv); - wake_up(&sv->sv_waiters); - sv_unlock(sv); -} - -void sv_broadcast(sv_t *sv) -{ -#ifdef SV_DEBUG_INTERRUPT_STATE - if(sv->sv_flags & SV_INTS) { - unsigned long flags; - __save_flags(flags); - if(SV_TEST_INTERRUPTS_ENABLED(flags)) - printk(KERN_ERR "sv_broadcast: SV_INTS and " - "interrupts enabled! (flags: 0x%lx)\n", flags); - } -#endif /* SV_DEBUG_INTERRUPT_STATE */ - - sv_lock(sv); - wake_up_all(&sv->sv_waiters); - sv_unlock(sv); -} - -void sv_destroy(sv_t *sv) -{ - if(!spin_trylock(&sv->sv_lock)) { - printk(KERN_ERR "sv_destroy: someone else has sv 0x%p locked!\n", sv); - BUG(); - } - - /* XXX Check that the waitqueue is empty? - Mark the sv destroyed? - */ -} - - -#ifdef RUN_SV_TEST - -static DECLARE_MUTEX_LOCKED(talkback); -static DECLARE_MUTEX_LOCKED(sem); -sv_t sv; -sv_t sv_filo; - -static int sv_test_1_w(void *arg) -{ - printk("sv_test_1_w: acquiring spinlock 0x%p...\n", arg); - - spin_lock((spinlock_t*)arg); - printk("sv_test_1_w: spinlock acquired, waking sv_test_1_s.\n"); - - up(&sem); - - printk("sv_test_1_w: sv_spin_wait()'ing.\n"); - - sv_spin_wait(&sv, arg); - - printk("sv_test_1_w: talkback.\n"); - up(&talkback); - - printk("sv_test_1_w: exiting.\n"); - return 0; -} - -static int sv_test_1_s(void *arg) -{ - printk("sv_test_1_s: waiting for semaphore.\n"); - down(&sem); - printk("sv_test_1_s: semaphore acquired. Acquiring spinlock.\n"); - spin_lock((spinlock_t*)arg); - printk("sv_test_1_s: spinlock acquired. sv_signaling.\n"); - sv_signal(&sv); - printk("sv_test_1_s: talkback.\n"); - up(&talkback); - printk("sv_test_1_s: exiting.\n"); - return 0; - -} - -static int count; -static DECLARE_MUTEX(monitor); - -static int sv_test_2_w(void *arg) -{ - int dummy = count++; - sv_t *sv = (sv_t *)arg; - - down(&monitor); - up(&talkback); - printk("sv_test_2_w: thread %d started, sv_waiting.\n", dummy); - sv_sema_wait(sv, &monitor); - printk("sv_test_2_w: thread %d woken, exiting.\n", dummy); - up(&sem); - return 0; -} - -static int sv_test_2_s_1(void *arg) -{ - int i; - sv_t *sv = (sv_t *)arg; - - down(&monitor); - for(i = 0; i < 3; i++) { - printk("sv_test_2_s_1: waking one thread.\n"); - sv_signal(sv); - down(&sem); - } - - printk("sv_test_2_s_1: signaling and broadcasting again. Nothing should happen.\n"); - sv_signal(sv); - sv_broadcast(sv); - sv_signal(sv); - sv_broadcast(sv); - - printk("sv_test_2_s_1: talkbacking.\n"); - up(&talkback); - up(&monitor); - return 0; -} - -static int sv_test_2_s(void *arg) -{ - int i; - sv_t *sv = (sv_t *)arg; - - down(&monitor); - for(i = 0; i < 3; i++) { - printk("sv_test_2_s: waking one thread (should be %d.)\n", i); - sv_signal(sv); - down(&sem); - } - - printk("sv_test_3_s: waking remaining threads with broadcast.\n"); - sv_broadcast(sv); - for(; i < 10; i++) - down(&sem); - - printk("sv_test_3_s: sending talkback.\n"); - up(&talkback); - - printk("sv_test_3_s: exiting.\n"); - up(&monitor); - return 0; -} - - -static void big_test(sv_t *sv) -{ - int i; - - count = 0; - - for(i = 0; i < 3; i++) { - printk("big_test: spawning thread %d.\n", i); - kernel_thread(sv_test_2_w, sv, 0); - down(&talkback); - } - - printk("big_test: spawning first wake-up thread.\n"); - kernel_thread(sv_test_2_s_1, sv, 0); - - down(&talkback); - printk("big_test: talkback happened.\n"); - - - for(i = 3; i < 13; i++) { - printk("big_test: spawning thread %d.\n", i); - kernel_thread(sv_test_2_w, sv, 0); - down(&talkback); - } - - printk("big_test: spawning wake-up thread.\n"); - kernel_thread(sv_test_2_s, sv, 0); - - down(&talkback); -} - -sv_t int_test_sv; -spinlock_t int_test_spin = SPIN_LOCK_UNLOCKED; -int int_test_ready; -static int irqtestcount; - -static int interrupt_test_worker(void *unused) -{ - int id = ++irqtestcount; - int it = 0; - unsigned long flags, flags2; - - printk("ITW: thread %d started.\n", id); - - while(1) { - __save_flags(flags2); - if(jiffies % 3) { - printk("ITW %2d %5d: irqsaving (%lx)\n", id, it, flags2); - spin_lock_irqsave(&int_test_spin, flags); - } else { - printk("ITW %2d %5d: spin_lock_irqing (%lx)\n", id, it, flags2); - spin_lock_irq(&int_test_spin); - } - - __save_flags(flags2); - printk("ITW %2d %5d: locked, sv_waiting (%lx).\n", id, it, flags2); - sv_wait(&int_test_sv, 0, 0); - - __save_flags(flags2); - printk("ITW %2d %5d: wait finished (%lx), pausing\n", id, it, flags2); - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(jiffies & 0xf); - if(current->state != TASK_RUNNING) - printk("ITW: current->state isn't RUNNING after schedule!\n"); - it++; - } -} - -static void interrupt_test(void) -{ - int i; - - printk("interrupt_test: initing sv.\n"); - sv_init(&int_test_sv, &int_test_spin, SV_MON_SPIN | SV_INTS); - - for(i = 0; i < SV_INTERRUPT_TEST_WORKERS; i++) { - printk("interrupt_test: starting test thread %d.\n", i); - kernel_thread(interrupt_test_worker, 0, 0); - } - printk("interrupt_test: done with init part.\n"); - int_test_ready = 1; -} - -int sv_test(void) -{ - spinlock_t s = SPIN_LOCK_UNLOCKED; - - sv_init(&sv, &s, SV_MON_SPIN); - printk("sv_test: starting sv_test_1_w.\n"); - kernel_thread(sv_test_1_w, &s, 0); - printk("sv_test: starting sv_test_1_s.\n"); - kernel_thread(sv_test_1_s, &s, 0); - - printk("sv_test: waiting for talkback.\n"); - down(&talkback); down(&talkback); - printk("sv_test: talkback happened, sv_destroying.\n"); - sv_destroy(&sv); - - count = 0; - - printk("sv_test: beginning big_test on sv.\n"); - - sv_init(&sv, &monitor, SV_MON_SEMA); - big_test(&sv); - sv_destroy(&sv); - - printk("sv_test: beginning big_test on sv_filo.\n"); - sv_init(&sv_filo, &monitor, SV_MON_SEMA | SV_ORDER_FILO); - big_test(&sv_filo); - sv_destroy(&sv_filo); - - interrupt_test(); - - printk("sv_test: done.\n"); - return 0; -} - -__initcall(sv_test); - -#endif /* RUN_SV_TEST */ diff -urN linux-2.4.18/arch/ia64/sn/sn1/synergy.c lia64-2.4/arch/ia64/sn/sn1/synergy.c --- linux-2.4.18/arch/ia64/sn/sn1/synergy.c Thu Apr 5 12:51:47 2001 +++ lia64-2.4/arch/ia64/sn/sn1/synergy.c Wed Dec 31 16:00:00 1969 @@ -1,429 +0,0 @@ - -/* - * SN1 Platform specific synergy Support - * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 Alan Mayer (ajm@sgi.com) - */ - - - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -int bit_pos_to_irq(int bit); -void setclear_mask_b(int irq, int cpuid, int set); -void setclear_mask_a(int irq, int cpuid, int set); -void * kmalloc(size_t size, int flags); - - -void -synergy_intr_alloc(int bit, int cpuid) { - return; -} - -int -synergy_intr_connect(int bit, - int cpuid) -{ - int irq; - unsigned is_b; - - irq = bit_pos_to_irq(bit); - - is_b = (cpuid_to_slice(cpuid)) & 1; - if (is_b) { - setclear_mask_b(irq,cpuid,1); - setclear_mask_a(irq,cpuid, 0); - } else { - setclear_mask_a(irq, cpuid, 1); - setclear_mask_b(irq, cpuid, 0); - } - return 0; -} -void -setclear_mask_a(int irq, int cpuid, int set) -{ - int synergy; - int nasid; - int reg_num; - unsigned long mask; - unsigned long addr; - unsigned long reg; - unsigned long val; - int my_cnode, my_synergy; - int target_cnode, target_synergy; - - /* - * Perform some idiot checks .. - */ - if ( (irq < 0) || (irq > 255) || - (cpuid < 0) || (cpuid > 512) ) { - printk("clear_mask_a: Invalid parameter irq %d cpuid %d\n", irq, cpuid); - return; - } - - target_cnode = cpuid_to_cnodeid(cpuid); - target_synergy = cpuid_to_synergy(cpuid); - my_cnode = cpuid_to_cnodeid(smp_processor_id()); - my_synergy = cpuid_to_synergy(smp_processor_id()); - - reg_num = irq / 64; - mask = 1; - mask <<= (irq % 64); - switch (reg_num) { - case 0: - reg = VEC_MASK0A; - addr = VEC_MASK0A_ADDR; - break; - case 1: - reg = VEC_MASK1A; - addr = VEC_MASK1A_ADDR; - break; - case 2: - reg = VEC_MASK2A; - addr = VEC_MASK2A_ADDR; - break; - case 3: - reg = VEC_MASK3A; - addr = VEC_MASK3A_ADDR; - break; - default: - reg = addr = 0; - break; - } - if (my_cnode == target_cnode && my_synergy == target_synergy) { - // local synergy - val = READ_LOCAL_SYNERGY_REG(addr); - if (set) { - val |= mask; - } else { - val &= ~mask; - } - WRITE_LOCAL_SYNERGY_REG(addr, val); - val = READ_LOCAL_SYNERGY_REG(addr); - } else { /* remote synergy */ - synergy = cpuid_to_synergy(cpuid); - nasid = cpuid_to_nasid(cpuid); - val = REMOTE_SYNERGY_LOAD(nasid, synergy, reg); - if (set) { - val |= mask; - } else { - val &= ~mask; - } - REMOTE_SYNERGY_STORE(nasid, synergy, reg, val); - } -} - -void -setclear_mask_b(int irq, int cpuid, int set) -{ - int synergy; - int nasid; - int reg_num; - unsigned long mask; - unsigned long addr; - unsigned long reg; - unsigned long val; - int my_cnode, my_synergy; - int target_cnode, target_synergy; - - /* - * Perform some idiot checks .. - */ - if ( (irq < 0) || (irq > 255) || - (cpuid < 0) || (cpuid > 512) ) { - printk("clear_mask_b: Invalid parameter irq %d cpuid %d\n", irq, cpuid); - return; - } - - target_cnode = cpuid_to_cnodeid(cpuid); - target_synergy = cpuid_to_synergy(cpuid); - my_cnode = cpuid_to_cnodeid(smp_processor_id()); - my_synergy = cpuid_to_synergy(smp_processor_id()); - - reg_num = irq / 64; - mask = 1; - mask <<= (irq % 64); - switch (reg_num) { - case 0: - reg = VEC_MASK0B; - addr = VEC_MASK0B_ADDR; - break; - case 1: - reg = VEC_MASK1B; - addr = VEC_MASK1B_ADDR; - break; - case 2: - reg = VEC_MASK2B; - addr = VEC_MASK2B_ADDR; - break; - case 3: - reg = VEC_MASK3B; - addr = VEC_MASK3B_ADDR; - break; - default: - reg = addr = 0; - break; - } - if (my_cnode == target_cnode && my_synergy == target_synergy) { - // local synergy - val = READ_LOCAL_SYNERGY_REG(addr); - if (set) { - val |= mask; - } else { - val &= ~mask; - } - WRITE_LOCAL_SYNERGY_REG(addr, val); - val = READ_LOCAL_SYNERGY_REG(addr); - } else { /* remote synergy */ - synergy = cpuid_to_synergy(cpuid); - nasid = cpuid_to_nasid(cpuid); - val = REMOTE_SYNERGY_LOAD(nasid, synergy, reg); - if (set) { - val |= mask; - } else { - val &= ~mask; - } - REMOTE_SYNERGY_STORE(nasid, synergy, reg, val); - } -} - -#if defined(CONFIG_IA64_SGI_SYNERGY_PERF) - -/* - * Synergy perf registers. Multiplexed via timer_interrupt - */ -static struct proc_dir_entry *synergy_perf_proc = NULL; - -/* - * read handler for /proc/synergy - */ -static int -synergy_perf_read_proc (char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - cnodeid_t cnode; - nodepda_t *npdap; - synergy_perf_t *p; - int len = 0; - - len += sprintf(page+len, "# cnode module slot event synergy-A synergy-B\n"); - - /* walk the event list for each node */ - for (cnode=0; cnode < numnodes; cnode++) { - npdap = NODEPDA(cnode); - if (npdap->synergy_perf_enabled == 0) { - len += sprintf(page+len, "# DISABLED\n"); - break; - } - - spin_lock_irq(&npdap->synergy_perf_lock); - for (p = npdap->synergy_perf_first; p;) { - uint64_t cnt_a=0, cnt_b=0; - - if (p->intervals > 0) { - cnt_a = p->counts[0] * npdap->synergy_active_intervals / p->intervals; - cnt_b = p->counts[1] * npdap->synergy_active_intervals / p->intervals; - } - - len += sprintf(page+len, "%d %d %d %12lx %lu %lu\n", - (int)cnode, (int)npdap->module_id, (int)npdap->slotdesc, - p->modesel, cnt_a, cnt_b); - - p = p->next; - if (p == npdap->synergy_perf_first) - break; - } - spin_unlock_irq(&npdap->synergy_perf_lock); - } - - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - - return len; -} - -static int -synergy_perf_append(uint64_t modesel) -{ - int cnode; - nodepda_t *npdap; - synergy_perf_t *p; - int err = 0; - - /* bit 45 is enable */ - modesel |= (1UL << 45); - - for (cnode=0; cnode < numnodes; cnode++) { - /* for each node, insert a new synergy_perf entry */ - if ((npdap = NODEPDA(cnode)) == NULL) { - printk("synergy_perf_append: cnode=%d NODEPDA(cnode)==NULL, nodepda=%p\n", cnode, nodepda); - continue; - } - - /* XX use kmem_alloc_node() when it is implemented */ - p = (synergy_perf_t *)kmalloc(sizeof(synergy_perf_t), GFP_KERNEL); - if (p == NULL) - err = -ENOMEM; - else { - memset(p, 0, sizeof(synergy_perf_t)); - p->modesel = modesel; - if (npdap->synergy_perf_data == NULL) { - /* circular list */ - p->next = p; - npdap->synergy_perf_data = p; - npdap->synergy_perf_first = p; - } - else { - /* - * Jumble up the insertion order so we get better sampling. - * Once the list is complete, "first" stays the same so the - * reporting order is consistent. - */ - p->next = npdap->synergy_perf_first->next; - npdap->synergy_perf_first->next = p; - npdap->synergy_perf_first = p->next; - } - } - } - - return err; -} - -static int -synergy_perf_write_proc (struct file *file, const char *buffer, - unsigned long count, void *data) -{ - int cnode; - nodepda_t *npdap; - uint64_t modesel; - char cmd[64]; - extern long atoi(char *); - - if (count == sizeof(uint64_t)) { - if (copy_from_user(&modesel, buffer, sizeof(uint64_t))) - return -EFAULT; - synergy_perf_append(modesel); - } - else { - if (copy_from_user(cmd, buffer, count < sizeof(cmd) ? count : sizeof(cmd))) - return -EFAULT; - if (strncmp(cmd, "enable", 6) == 0) { - /* enable counting */ - for (cnode=0; cnode < numnodes; cnode++) { - npdap = NODEPDA(cnode); - npdap->synergy_perf_enabled = 1; - } - printk("NOTICE: synergy perf counting enabled\n"); - } - else - if (strncmp(cmd, "disable", 7) == 0) { - /* disable counting */ - for (cnode=0; cnode < numnodes; cnode++) { - npdap = NODEPDA(cnode); - npdap->synergy_perf_enabled = 0; - } - printk("NOTICE: synergy perf counting disabled\n"); - } - else - if (strncmp(cmd, "frequency", 9) == 0) { - /* set the update frequency (timer-interrupts per update) */ - int freq; - - if (count < 12) - return -EINVAL; - freq = atoi(cmd + 10); - if (freq <= 0 || freq > 100) - return -EINVAL; - for (cnode=0; cnode < numnodes; cnode++) { - npdap = NODEPDA(cnode); - npdap->synergy_perf_freq = (uint64_t)freq; - } - printk("NOTICE: synergy perf freq set to %d\n", freq); - } - else - return -EINVAL; - } - - return count; -} - -void -synergy_perf_update(int cpu) -{ - nasid_t nasid; - cnodeid_t cnode = cpuid_to_cnodeid(cpu); - struct nodepda_s *npdap; - extern struct nodepda_s *nodepda; - - if (nodepda == NULL || (npdap=NODEPDA(cnode)) == NULL || npdap->synergy_perf_enabled == 0 || - npdap->synergy_perf_data == NULL) { - /* I/O not initialized, or not enabled, or no events to monitor */ - return; - } - - if (npdap->synergy_inactive_intervals++ % npdap->synergy_perf_freq != 0) { - /* don't multiplex on every timer interrupt */ - return; - } - - /* - * Read registers for last interval and increment counters. - * Hold the per-node synergy_perf_lock so concurrent readers get - * consistent values. - */ - spin_lock_irq(&npdap->synergy_perf_lock); - - nasid = cpuid_to_nasid(cpu); - npdap->synergy_active_intervals++; - npdap->synergy_perf_data->intervals++; - - npdap->synergy_perf_data->counts[0] += 0xffffffffffUL & - REMOTE_SYNERGY_LOAD(nasid, 0, PERF_CNTR0_A); - - npdap->synergy_perf_data->counts[1] += 0xffffffffffUL & - REMOTE_SYNERGY_LOAD(nasid, 1, PERF_CNTR0_B); - - /* skip to next in circular list */ - npdap->synergy_perf_data = npdap->synergy_perf_data->next; - - spin_unlock_irq(&npdap->synergy_perf_lock); - - /* set the counter 0 selection modes for both A and B */ - REMOTE_SYNERGY_STORE(nasid, 0, PERF_CNTL0_A, npdap->synergy_perf_data->modesel); - REMOTE_SYNERGY_STORE(nasid, 1, PERF_CNTL0_B, npdap->synergy_perf_data->modesel); - - /* and reset the counter registers to zero */ - REMOTE_SYNERGY_STORE(nasid, 0, PERF_CNTR0_A, 0UL); - REMOTE_SYNERGY_STORE(nasid, 1, PERF_CNTR0_B, 0UL); -} - -void -synergy_perf_init(void) -{ - if ((synergy_perf_proc = create_proc_entry("synergy", 0644, NULL)) != NULL) { - synergy_perf_proc->read_proc = synergy_perf_read_proc; - synergy_perf_proc->write_proc = synergy_perf_write_proc; - printk("markgw: synergy_perf_init()\n"); - } -} - -#endif /* CONFIG_IA64_SGI_SYNERGY_PERF */ - diff -urN linux-2.4.18/arch/ia64/sn/tools/make_textsym lia64-2.4/arch/ia64/sn/tools/make_textsym --- linux-2.4.18/arch/ia64/sn/tools/make_textsym Thu Jan 4 13:00:15 2001 +++ lia64-2.4/arch/ia64/sn/tools/make_textsym Mon Feb 4 17:48:56 2002 @@ -1,5 +1,14 @@ #!/bin/sh +# # Build a textsym file for use in the Arium ITP probe. +# +# +# This file is subject to the terms and conditions of the GNU General Public +# License. See the file "COPYING" in the main directory of this archive +# for more details. +# +# Copyright (c) 2001-2002 Silicon Graphics, Inc. All rights reserved. +# help() { cat < $TMPSYM +SN1=`egrep "dig_setup|Synergy_da_indr" $TMPSYM|wc -l` + +# Dataprefix and textprefix correspond to the VGLOBAL_BASE and VPERNODE_BASE. +# Eventually, these values should be: +# dataprefix ffffffff +# textprefix fffffffe +# but right now they're still changing, so make them dynamic. +dataprefix=`awk ' / \.data / { print substr($1, 0, 8) ; exit ; }' $TMPSYM` +textprefix=`awk ' / \.text / { print substr($1, 0, 8) ; exit ; }' $TMPSYM` # pipe everything thru sort echo "TEXTSYM V1.0" (cat < 0) { + n = n*16 + substr(s,1,1) + s = substr(s,2) + } + printf "GLOBAL | %s | DATA | %s | %d\n", $1, $NF, n + } } if($NF == "_end") exit } -' ) | egrep -v " __device| __vendor" | awk ' +' $TMPSYM ) | egrep -v " __device| __vendor" | awk -v sn1="$SN1" ' /GLOBAL/ { print $0 - print substr($0,1,9) substr($0,18,18) "Phy_" substr($0,36) + if (sn1 != 0) { + /* 32 bits of sn1 physical addrs, */ + print substr($0,1,9) substr($0,18,18) "Phy_" substr($0,36) + } else { + /* 38 bits of sn2 physical addrs, need addr space bits */ + print substr($0,1,9) "30" substr($0,18,18) "Phy_" substr($0,36) + } } ' | sort -k3 - - N=`wc -l $TEXTSYM|awk '{print $1}'` echo "Generated TEXTSYM file" >&2 diff -urN linux-2.4.18/arch/ia64/tools/print_offsets.c lia64-2.4/arch/ia64/tools/print_offsets.c --- linux-2.4.18/arch/ia64/tools/print_offsets.c Mon Nov 26 11:18:25 2001 +++ lia64-2.4/arch/ia64/tools/print_offsets.c Mon May 6 17:49:12 2002 @@ -2,7 +2,7 @@ * Utility to generate asm-ia64/offsets.h. * * Copyright (C) 1999-2001 Hewlett-Packard Co - * Copyright (C) 1999-2001 David Mosberger-Tang + * David Mosberger-Tang * * Note that this file has dual use: when building the kernel * natively, the file is translated into a binary and executed. When @@ -58,7 +58,8 @@ { "IA64_TASK_THREAD_OFFSET", offsetof (struct task_struct, thread) }, { "IA64_TASK_THREAD_KSP_OFFSET", offsetof (struct task_struct, thread.ksp) }, #ifdef CONFIG_PERFMON - { "IA64_TASK_PFM_MUST_BLOCK_OFFSET",offsetof(struct task_struct, thread.pfm_must_block) }, + { "IA64_TASK_PFM_OVFL_BLOCK_RESET_OFFSET", + offsetof(struct task_struct, thread.pfm_ovfl_block_reset) }, #endif { "IA64_TASK_PID_OFFSET", offsetof (struct task_struct, pid) }, { "IA64_TASK_MM_OFFSET", offsetof (struct task_struct, mm) }, @@ -152,6 +153,7 @@ { "IA64_SWITCH_STACK_AR_RNAT_OFFSET", offsetof (struct switch_stack, ar_rnat) }, { "IA64_SWITCH_STACK_AR_BSPSTORE_OFFSET", offsetof (struct switch_stack, ar_bspstore) }, { "IA64_SWITCH_STACK_PR_OFFSET", offsetof (struct switch_stack, pr) }, + { "IA64_SIGCONTEXT_IP_OFFSET", offsetof (struct sigcontext, sc_ip) }, { "IA64_SIGCONTEXT_AR_BSP_OFFSET", offsetof (struct sigcontext, sc_ar_bsp) }, { "IA64_SIGCONTEXT_AR_FPSR_OFFSET", offsetof (struct sigcontext, sc_ar_fpsr) }, { "IA64_SIGCONTEXT_AR_RNAT_OFFSET", offsetof (struct sigcontext, sc_ar_rnat) }, diff -urN linux-2.4.18/arch/ia64/vmlinux.lds.S lia64-2.4/arch/ia64/vmlinux.lds.S --- linux-2.4.18/arch/ia64/vmlinux.lds.S Tue Jul 31 10:30:09 2001 +++ lia64-2.4/arch/ia64/vmlinux.lds.S Thu May 9 18:49:18 2002 @@ -1,5 +1,6 @@ #include +#include #include #include @@ -13,6 +14,8 @@ *(.text.exit) *(.data.exit) *(.exitcall.exit) + *(.IA_64.unwind.text.exit) + *(.IA_64.unwind_info.text.exit) } v = PAGE_OFFSET; /* this symbol is here to make debugging easier... */ @@ -25,11 +28,6 @@ .text : AT(ADDR(.text) - PAGE_OFFSET) { *(.text.ivt) - /* these are not really text pages, but they need to be page aligned: */ - *(__special_page_section) - __start_gate_section = .; - *(.text.gate) - __stop_gate_section = .; *(.text) } .text2 : AT(ADDR(.text2) - PAGE_OFFSET) @@ -42,8 +40,6 @@ /* Read-only data */ - __gp = ALIGN(16) + 0x200000; /* gp must be 16-byte aligned for exc. table */ - /* Global data */ _data = .; @@ -115,9 +111,13 @@ { *(init_task) } .data.page_aligned : AT(ADDR(.data.page_aligned) - PAGE_OFFSET) - { *(.data.idt) } + { *(__special_page_section) + __start_gate_section = .; + *(.text.gate) + __stop_gate_section = .; + } - . = ALIGN(64); + . = ALIGN(SMP_CACHE_BYTES); .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - PAGE_OFFSET) { *(.data.cacheline_aligned) } @@ -127,6 +127,10 @@ .data : AT(ADDR(.data) - PAGE_OFFSET) { *(.data) *(.gnu.linkonce.d*) CONSTRUCTORS } + + + . = ALIGN(16); + __gp = . + 0x200000; /* gp must be 16-byte aligned for exc. table */ .got : AT(ADDR(.got) - PAGE_OFFSET) { *(.got.plt) *(.got) } diff -urN linux-2.4.18/drivers/acpi/Config.help lia64-2.4/drivers/acpi/Config.help --- linux-2.4.18/drivers/acpi/Config.help Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/Config.help Tue Jun 11 14:24:21 2002 @@ -0,0 +1,93 @@ +CONFIG_ACPI_ENABLE + Advanced Configuration and Power Interface (ACPI) support for + Linux requires an ACPI compliant platform (hardware/firmware), + and assumes the presence of OS-directed configuration and power + management (OSPM) software. This option will enlarge your + kernel by about 70K. + + Linux ACPI provides a robust functional replacement for several + legacy configuration and power management intefaces, including + the Plug-and-Play BIOS specification (PnP BIOS), the + MultiProcessor Specification (MPS), and the Advanced Power + Management (APM) specification. If both ACPI and APM support + are configured, whichever is loaded first shall be used. + + Add "acpi=off" to the kernel command line to disable this feature. + (Try "man bootparam" or see the documentation of your boot loader + about how to pass options to the kernel at boot time.) + + Add "acpi=ht-only" to the kernel command line to limit ACPI + support to processor enumeration only (see CONFIG_ACPI_HT_ONLY). + + ---------- + + The ACPI SourceForge project contains the latest source code, + documentation, tools, mailing list subscription, and other + information. This project is available at: + + + Linux support for ACPI is based on Intel Corporation's ACPI + Component Architecture (ACPI CA). For more information see: + + + ACPI is an open industry specification co-developed by Compaq, + Intel, Microsoft, Phoenix, and Toshiba. The specification is + available at: + + +CONFIG_ACPI_HT_ONLY + This option enables limited ACPI support -- just enough to + enumerate processors from the ACPI Multiple APIC Description + Table (MADT). Note that ACPI supports both logical (e.g. Hyper- + Threading) and physical processors, where the MultiProcessor + Specification (MPS) table only supports physical processors. + + Full ACPI support (CONFIG_ACPI) is preferred. Use this option + only if you wish to limit ACPI's role to processor enumeration. + +CONFIG_ACPI_AC + This driver adds support for the AC Adapter object, which indicates + whether a system is on AC, or not. Typically, only mobile systems + have this object, since desktops are always on AC. + +CONFIG_ACPI_BATTERY + This driver adds support for battery information through + /proc/acpi/battery. If you have a mobile system with a battery, + say Y. + +CONFIG_ACPI_BUTTON + This driver registers for events based on buttons, such as the + power, sleep, and lid switch. In the future, a daemon will read + /proc/acpi/event and perform user-defined actions such as shutting + down the system. Until then, you can cat it, and see output when + a button is pressed. + +CONFIG_ACPI_EC + This driver is required on some systems for the proper operation of + the battery and thermal drivers. If you are compiling for a + mobile system, say Y. + +CONFIG_ACPI_PROCESSOR + This driver installs ACPI as the idle handler for Linux, and uses + ACPI C2 and C3 processor states to save power, on systems that + support it. + +CONFIG_ACPI_THERMAL + This driver adds support for ACPI thermal zones. Most mobile and + some desktop systems support ACPI thermal zones. It is HIGHLY + recommended that this option be enabled, as your processor(s) + may be damaged without it. + +CONFIG_ACPI_FAN + This driver adds support for ACPI fan devices, allowing user-mode + applications to perform basic fan control (on, off, status). + +CONFIG_ACPI_SYSTEM + This driver will enable your system to shut down using ACPI, and + dump your ACPI DSDT table using /proc/acpi/dsdt. + +CONFIG_ACPI_DEBUG + The ACPI driver can optionally report errors with a great deal + of verbosity. Saying Y enables these statements. This will increase + your kernel size by around 50K. + diff -urN linux-2.4.18/drivers/acpi/Config.in lia64-2.4/drivers/acpi/Config.in --- linux-2.4.18/drivers/acpi/Config.in Wed Jun 20 17:47:39 2001 +++ lia64-2.4/drivers/acpi/Config.in Tue Jun 11 14:24:21 2002 @@ -1,17 +1,126 @@ # -# ACPI configuration +# ACPI Configuration # -#mainmenu_option next_comment -#comment 'ACPI Configuration' -dep_bool ' ACPI Debug Statements' CONFIG_ACPI_DEBUG $CONFIG_ACPI -dep_tristate ' ACPI Bus Manager' CONFIG_ACPI_BUSMGR $CONFIG_ACPI +if [ "$CONFIG_X86" = "y" ]; then -dep_tristate ' System' CONFIG_ACPI_SYS $CONFIG_ACPI_BUSMGR $CONFIG_ACPI -dep_tristate ' Processor' CONFIG_ACPI_CPU $CONFIG_ACPI_BUSMGR $CONFIG_ACPI -dep_tristate ' Button' CONFIG_ACPI_BUTTON $CONFIG_ACPI_BUSMGR $CONFIG_ACPI -dep_tristate ' AC Adapter' CONFIG_ACPI_AC $CONFIG_ACPI_BUSMGR $CONFIG_ACPI -dep_tristate ' Embedded Controller' CONFIG_ACPI_EC $CONFIG_ACPI_BUSMGR $CONFIG_ACPI -dep_tristate ' Control Method Battery' CONFIG_ACPI_CMBATT $CONFIG_ACPI_BUSMGR $CONFIG_ACPI $CONFIG_ACPI_EC -dep_tristate ' Thermal' CONFIG_ACPI_THERMAL $CONFIG_ACPI_BUSMGR $CONFIG_ACPI $CONFIG_ACPI_EC -#endmenu + mainmenu_option next_comment + comment 'ACPI Support' + + if [ "$CONFIG_X86_LOCAL_APIC" = "y" ]; then + choice 'ACPI Support' \ + "Enable CONFIG_ACPI_ENABLE \ + HyperThreading-Only CONFIG_ACPI_HT_ONLY \ + Disable CONFIG_ACPI_DISABLE" Disable + else + choice 'ACPI Support' \ + "Enable CONFIG_ACPI_ENABLE \ + Disable CONFIG_ACPI_DISABLE" Disable + fi + + if [ "$CONFIG_ACPI_ENABLE" = "y" ]; then + define_bool CONFIG_ACPI y + define_bool CONFIG_ACPI_BOOT y + define_bool CONFIG_ACPI_BUS y + define_bool CONFIG_ACPI_INTERPRETER y + define_bool CONFIG_ACPI_EC y + define_bool CONFIG_ACPI_POWER y + if [ "$CONFIG_PCI" = "y" ]; then + define_bool CONFIG_ACPI_PCI y + fi + define_bool CONFIG_ACPI_SLEEP y + define_bool CONFIG_ACPI_SYSTEM y + tristate ' AC Adapter' CONFIG_ACPI_AC + tristate ' Battery' CONFIG_ACPI_BATTERY + tristate ' Button' CONFIG_ACPI_BUTTON + tristate ' Fan' CONFIG_ACPI_FAN + tristate ' Processor' CONFIG_ACPI_PROCESSOR + dep_tristate ' Thermal Zone' CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR + bool ' Debug Statements' CONFIG_ACPI_DEBUG + fi + + if [ "$CONFIG_ACPI_HT_ONLY" = "y" ]; then + define_bool CONFIG_ACPI y + define_bool CONFIG_ACPI_BOOT y + define_bool CONFIG_ACPI_BUS n + define_bool CONFIG_ACPI_INTERPRETER n + define_bool CONFIG_ACPI_EC n + define_bool CONFIG_ACPI_PCI n + define_bool CONFIG_ACPI_POWER n + define_bool CONFIG_ACPI_SYSTEM n + define_bool CONFIG_ACPI_SLEEP n + define_bool CONFIG_ACPI_AC n + define_bool CONFIG_ACPI_BATTERY n + define_bool CONFIG_ACPI_BUTTON n + define_bool CONFIG_ACPI_FAN n + define_bool CONFIG_ACPI_PROCESSOR n + define_bool CONFIG_ACPI_THERMAL n + define_bool CONFIG_ACPI_DEBUG n + fi + + if [ "$CONFIG_ACPI_DISABLE" = "y" ]; then + define_bool CONFIG_ACPI n + define_bool CONFIG_ACPI_BOOT n + define_bool CONFIG_ACPI_BUS n + define_bool CONFIG_ACPI_INTERPRETER n + define_bool CONFIG_ACPI_EC n + define_bool CONFIG_ACPI_PCI n + define_bool CONFIG_ACPI_POWER n + define_bool CONFIG_ACPI_SYSTEM n + define_bool CONFIG_ACPI_SLEEP n + define_bool CONFIG_ACPI_AC n + define_bool CONFIG_ACPI_BATTERY n + define_bool CONFIG_ACPI_BUTTON n + define_bool CONFIG_ACPI_FAN n + define_bool CONFIG_ACPI_PROCESSOR n + define_bool CONFIG_ACPI_THERMAL n + define_bool CONFIG_ACPI_DEBUG n + fi + + endmenu + +fi + + +if [ "$CONFIG_IA64" = "y" ]; then + + if [ "$CONFIG_IA64_SGI_SN" = "y" ]; then + mainmenu_option next_comment + comment 'ACPI Support' + define_bool CONFIG_ACPI y + define_bool CONFIG_ACPI_EFI y + define_bool CONFIG_ACPI_BOOT y + define_bool CONFIG_ACPI_BUS n + define_bool CONFIG_ACPI_INTERPRETER n + define_bool CONFIG_ACPI_PCI n + define_bool CONFIG_ACPI_POWER n + define_bool CONFIG_ACPI_SYSTEM n + define_bool CONFIG_ACPI_BUTTON n + define_bool CONFIG_ACPI_FAN n + define_bool CONFIG_ACPI_PROCESSOR n + define_bool CONFIG_ACPI_THERMAL n + endmenu + fi + + if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then + mainmenu_option next_comment + comment 'ACPI Support' + if [ "$CONFIG_PCI" = "y" ]; then + define_bool CONFIG_ACPI_PCI y + fi + define_bool CONFIG_ACPI y + define_bool CONFIG_ACPI_EFI y + define_bool CONFIG_ACPI_BOOT y + define_bool CONFIG_ACPI_BUS y + define_bool CONFIG_ACPI_INTERPRETER y + define_bool CONFIG_ACPI_POWER y + define_bool CONFIG_ACPI_SYSTEM y + tristate ' Button' CONFIG_ACPI_BUTTON + tristate ' Fan' CONFIG_ACPI_FAN + tristate ' Processor' CONFIG_ACPI_PROCESSOR + dep_tristate ' Thermal Zone' CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR + bool ' Debug Statements' CONFIG_ACPI_DEBUG + endmenu + fi + +fi diff -urN linux-2.4.18/drivers/acpi/Makefile lia64-2.4/drivers/acpi/Makefile --- linux-2.4.18/drivers/acpi/Makefile Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/Makefile Tue Jun 11 14:24:21 2002 @@ -4,51 +4,52 @@ O_TARGET := acpi.o -export-objs := acpi_ksyms.o - export ACPI_CFLAGS -ACPI_CFLAGS := -D_LINUX -I$(CURDIR)/include - -# -# CONFIG_ACPI_KERNEL_CONFIG is currently only IA64 -# -ifdef CONFIG_ACPI_KERNEL_CONFIG - ACPI_CFLAGS += -DCONFIG_ACPI_KERNEL_CONFIG_ONLY -endif - -acpi-subdirs := utilities dispatcher events hardware \ - executer namespace parser resources tables +ACPI_CFLAGS := -D_LINUX -I$(CURDIR)/include ifdef CONFIG_ACPI_DEBUG - ACPI_CFLAGS += -DACPI_DEBUG -Wno-unused -endif - -ifdef CONFIG_ACPI_DEBUGGER - ACPI_CFLAGS += -DENABLE_DEBUGGER - acpi-subdirs += debugger + ACPI_CFLAGS += -DACPI_DEBUG endif -EXTRA_CFLAGS += $(ACPI_CFLAGS) +EXTRA_CFLAGS += $(ACPI_CFLAGS) -mod-subdirs := ospm +export-objs := acpi_ksyms.o -subdir-$(CONFIG_ACPI) += $(acpi-subdirs) -subdir-$(CONFIG_ACPI_BUSMGR) += ospm +obj-y := acpi_ksyms.o -obj-$(CONFIG_ACPI) += driver.o os.o acpi_ksyms.o -obj-$(CONFIG_ACPI) += $(foreach dir,$(acpi-subdirs),$(dir)/$(dir).o) -ifdef CONFIG_ACPI_KERNEL_CONFIG - obj-$(CONFIG_ACPI) += acpiconf.o osconf.o +# +# ACPI Boot-Time Table Parsing +# +ifeq ($(CONFIG_ACPI_BOOT),y) + obj-y += tables.o endif -ifeq ($(CONFIG_ACPI_BUSMGR),y) - obj-y += ospm/ospm.o +# +# ACPI Core Subsystem (Interpreter) +# +ifeq ($(CONFIG_ACPI_INTERPRETER),y) + obj-y += osl.o utils.o + subdir-y += dispatcher events executer hardware namespace parser \ + resources tables utilities + obj-y += $(foreach dir,$(subdir-y),$(dir)/$(dir).o) endif -# commented out until we distribute it -ASG -#ifeq ($(CONFIG_KDB),y) -# obj-m += kdb/kdbm_acpi.o -#endif +# +# ACPI Bus and Device Drivers +# +ifeq ($(CONFIG_ACPI_BUS),y) + obj-y += bus.o + obj-$(CONFIG_ACPI_AC) += ac.o + obj-$(CONFIG_ACPI_BATTERY) += battery.o + obj-$(CONFIG_ACPI_BUTTON) += button.o + obj-$(CONFIG_ACPI_EC) += ec.o + obj-$(CONFIG_ACPI_FAN) += fan.o + obj-$(CONFIG_ACPI_PCI) += pci_root.o pci_link.o pci_irq.o pci_bind.o + obj-$(CONFIG_ACPI_POWER) += power.o + obj-$(CONFIG_ACPI_PROCESSOR) += processor.o + obj-$(CONFIG_ACPI_THERMAL) += thermal.o + obj-$(CONFIG_ACPI_SYSTEM) += system.o +endif include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/drivers/acpi/ac.c lia64-2.4/drivers/acpi/ac.c --- linux-2.4.18/drivers/acpi/ac.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/ac.c Tue Jun 11 14:24:21 2002 @@ -0,0 +1,352 @@ +/* + * acpi_ac.c - ACPI AC Adapter Driver ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include +#include +#include +#include "acpi_bus.h" +#include "acpi_drivers.h" + + +#define _COMPONENT ACPI_AC_COMPONENT +ACPI_MODULE_NAME ("acpi_ac") + +MODULE_AUTHOR("Paul Diefenbaugh"); +MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME); +MODULE_LICENSE("GPL"); + +#define PREFIX "ACPI: " + + +int acpi_ac_add (struct acpi_device *device); +int acpi_ac_remove (struct acpi_device *device, int type); + +static struct acpi_driver acpi_ac_driver = { + name: ACPI_AC_DRIVER_NAME, + class: ACPI_AC_CLASS, + ids: ACPI_AC_HID, + ops: { + add: acpi_ac_add, + remove: acpi_ac_remove, + }, +}; + +struct acpi_ac { + acpi_handle handle; + unsigned long state; +}; + + +/* -------------------------------------------------------------------------- + AC Adapter Management + -------------------------------------------------------------------------- */ + +static int +acpi_ac_get_state ( + struct acpi_ac *ac) +{ + acpi_status status = AE_OK; + + ACPI_FUNCTION_TRACE("acpi_ac_get_state"); + + if (!ac) + return_VALUE(-EINVAL); + + status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error reading AC Adapter state\n")); + ac->state = ACPI_AC_STATUS_UNKNOWN; + return_VALUE(-ENODEV); + } + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + FS Interface (/proc) + -------------------------------------------------------------------------- */ + +#include +#include + +struct proc_dir_entry *acpi_ac_dir = NULL; + +static int +acpi_ac_read_state ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_ac *ac = (struct acpi_ac *) data; + char *p = page; + int len = 0; + + ACPI_FUNCTION_TRACE("acpi_ac_read_state"); + + if (!ac || (off != 0)) + goto end; + + if (0 != acpi_ac_get_state(ac)) { + p += sprintf(p, "ERROR: Unable to read AC Adapter state\n"); + goto end; + } + + p += sprintf(p, "state: "); + switch (ac->state) { + case ACPI_AC_STATUS_OFFLINE: + p += sprintf(p, "off-line\n"); + break; + case ACPI_AC_STATUS_ONLINE: + p += sprintf(p, "on-line\n"); + break; + default: + p += sprintf(p, "unknown\n"); + break; + } + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_ac_add_fs ( + struct acpi_device *device) +{ + struct proc_dir_entry *entry = NULL; + + ACPI_FUNCTION_TRACE("acpi_ac_add_fs"); + + if (!acpi_ac_dir) { + acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir); + if (!acpi_ac_dir) + return_VALUE(-ENODEV); + } + + if (!acpi_device_dir(device)) { + acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), + acpi_ac_dir); + if (!acpi_device_dir(device)) + return_VALUE(-ENODEV); + } + + /* 'state' [R] */ + entry = create_proc_entry(ACPI_AC_FILE_STATE, + S_IRUGO, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_AC_FILE_STATE)); + else { + entry->read_proc = acpi_ac_read_state; + entry->data = acpi_driver_data(device); + } + + return_VALUE(0); +} + + +static int +acpi_ac_remove_fs ( + struct acpi_device *device) +{ + ACPI_FUNCTION_TRACE("acpi_ac_remove_fs"); + + if (!acpi_ac_dir) + return_VALUE(-ENODEV); + + if (acpi_device_dir(device)) + remove_proc_entry(acpi_device_bid(device), acpi_ac_dir); + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Driver Model + -------------------------------------------------------------------------- */ + +void +acpi_ac_notify ( + acpi_handle handle, + u32 event, + void *data) +{ + struct acpi_ac *ac = (struct acpi_ac *) data; + struct acpi_device *device = NULL; + + ACPI_FUNCTION_TRACE("acpi_ac_notify"); + + if (!ac) + return; + + if (0 != acpi_bus_get_device(ac->handle, &device)) + return_VOID; + + switch (event) { + case ACPI_AC_NOTIFY_STATUS: + acpi_ac_get_state(ac); + acpi_bus_generate_event(device, event, (u32) ac->state); + break; + default: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Unsupported event [0x%x]\n", event)); + break; + } + + return_VOID; +} + + +int +acpi_ac_add ( + struct acpi_device *device) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_ac *ac = NULL; + + ACPI_FUNCTION_TRACE("acpi_ac_add"); + + if (!device) + return_VALUE(-EINVAL); + + ac = kmalloc(sizeof(struct acpi_ac), GFP_KERNEL); + if (!ac) + return_VALUE(-ENOMEM); + memset(ac, 0, sizeof(struct acpi_ac)); + + ac->handle = device->handle; + sprintf(acpi_device_name(device), "%s", ACPI_AC_DEVICE_NAME); + sprintf(acpi_device_class(device), "%s", ACPI_AC_CLASS); + acpi_driver_data(device) = ac; + + result = acpi_ac_get_state(ac); + if (0 != result) + goto end; + + result = acpi_ac_add_fs(device); + if (0 != result) + goto end; + + status = acpi_install_notify_handler(ac->handle, + ACPI_DEVICE_NOTIFY, acpi_ac_notify, ac); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error installing notify handler\n")); + result = -ENODEV; + goto end; + } + + printk(KERN_INFO PREFIX "%s [%s] (%s)\n", + acpi_device_name(device), acpi_device_bid(device), + ac->state?"on-line":"off-line"); + +end: + if (0 != result) { + acpi_ac_remove_fs(device); + kfree(ac); + } + + return_VALUE(result); +} + + +int +acpi_ac_remove ( + struct acpi_device *device, + int type) +{ + acpi_status status = AE_OK; + struct acpi_ac *ac = NULL; + + ACPI_FUNCTION_TRACE("acpi_ac_remove"); + + if (!device || !acpi_driver_data(device)) + return_VALUE(-EINVAL); + + ac = (struct acpi_ac *) acpi_driver_data(device); + + status = acpi_remove_notify_handler(ac->handle, + ACPI_DEVICE_NOTIFY, acpi_ac_notify); + if (ACPI_FAILURE(status)) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); + + acpi_ac_remove_fs(device); + + kfree(ac); + + return_VALUE(0); +} + + +int __init +acpi_ac_init (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_ac_init"); + + result = acpi_bus_register_driver(&acpi_ac_driver); + if (0 > result) { + remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); + return_VALUE(-ENODEV); + } + + return_VALUE(0); +} + + +void __exit +acpi_ac_exit (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_ac_exit"); + + result = acpi_bus_unregister_driver(&acpi_ac_driver); + if (0 == result) + remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); + + return_VOID; +} + + +module_init(acpi_ac_init); +module_exit(acpi_ac_exit); diff -urN linux-2.4.18/drivers/acpi/acpi_bus.h lia64-2.4/drivers/acpi/acpi_bus.h --- linux-2.4.18/drivers/acpi/acpi_bus.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/acpi_bus.h Fri Jul 19 18:25:38 2002 @@ -0,0 +1,321 @@ +/* + * acpi_bus.h - ACPI Bus Driver ($Revision: 21 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#ifndef __ACPI_BUS_H__ +#define __ACPI_BUS_H__ + +#include + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,4)) +#include +#define CONFIG_LDM +#endif + +#include "include/acpi.h" + + +/* TBD: Make dynamic */ +#define ACPI_MAX_HANDLES 10 +struct acpi_handle_list { + u32 count; + acpi_handle handles[ACPI_MAX_HANDLES]; +}; + + +/* acpi_utils.h */ +acpi_status acpi_extract_package (acpi_object *, acpi_buffer *, acpi_buffer *); +acpi_status acpi_evaluate (acpi_handle, acpi_string, acpi_object_list *, acpi_buffer *); +acpi_status acpi_evaluate_integer (acpi_handle, acpi_string, acpi_object_list *, unsigned long *); +acpi_status acpi_evaluate_reference (acpi_handle, acpi_string, acpi_object_list *, struct acpi_handle_list *); + + +#ifdef CONFIG_ACPI_BUS + +#include + +#define ACPI_BUS_FILE_ROOT "acpi" +extern struct proc_dir_entry *acpi_root_dir; +extern FADT_DESCRIPTOR acpi_fadt; + +enum acpi_bus_removal_type { + ACPI_BUS_REMOVAL_NORMAL = 0, + ACPI_BUS_REMOVAL_EJECT, + ACPI_BUS_REMOVAL_SUPRISE, + ACPI_BUS_REMOVAL_TYPE_COUNT +}; + +enum acpi_bus_device_type { + ACPI_BUS_TYPE_DEVICE = 0, + ACPI_BUS_TYPE_POWER, + ACPI_BUS_TYPE_PROCESSOR, + ACPI_BUS_TYPE_THERMAL, + ACPI_BUS_TYPE_SYSTEM, + ACPI_BUS_TYPE_POWER_BUTTON, + ACPI_BUS_TYPE_SLEEP_BUTTON, + ACPI_BUS_DEVICE_TYPE_COUNT +}; + +struct acpi_driver; +struct acpi_device; + + +/* + * ACPI Driver + * ----------- + */ + +typedef int (*acpi_op_add) (struct acpi_device *device); +typedef int (*acpi_op_remove) (struct acpi_device *device, int type); +typedef int (*acpi_op_lock) (struct acpi_device *device, int type); +typedef int (*acpi_op_start) (struct acpi_device *device); +typedef int (*acpi_op_stop) (struct acpi_device *device, int type); +typedef int (*acpi_op_suspend) (struct acpi_device *device, int state); +typedef int (*acpi_op_resume) (struct acpi_device *device, int state); +typedef int (*acpi_op_scan) (struct acpi_device *device); +typedef int (*acpi_op_bind) (struct acpi_device *device); + +struct acpi_device_ops { + acpi_op_add add; + acpi_op_remove remove; + acpi_op_lock lock; + acpi_op_start start; + acpi_op_stop stop; + acpi_op_suspend suspend; + acpi_op_resume resume; + acpi_op_scan scan; + acpi_op_bind bind; +}; + +struct acpi_driver { + struct list_head node; + char name[80]; + char class[80]; + int references; + char *ids; /* Supported Hardware IDs */ + struct acpi_device_ops ops; +}; + +enum acpi_blacklist_predicates +{ + all_versions, + less_than_or_equal, + equal, + greater_than_or_equal, +}; + +struct acpi_blacklist_item +{ + char oem_id[7]; + char oem_table_id[9]; + u32 oem_revision; + acpi_table_type table; + enum acpi_blacklist_predicates oem_revision_predicate; + char *reason; + u32 is_critical_error; +}; + + +/* + * ACPI Device + * ----------- + */ + +/* Status (_STA) */ + +struct acpi_device_status { + u32 present:1; + u32 enabled:1; + u32 show_in_ui:1; + u32 functional:1; + u32 battery_present:1; + u32 reserved:27; +}; + + +/* Flags */ + +struct acpi_device_flags { + u32 dynamic_status:1; + u32 hardware_id:1; + u32 compatible_ids:1; + u32 bus_address:1; + u32 unique_id:1; + u32 removable:1; + u32 ejectable:1; + u32 lockable:1; + u32 suprise_removal_ok:1; + u32 power_manageable:1; + u32 performance_manageable:1; + u32 reserved:21; +}; + + +/* File System */ + +struct acpi_device_dir { + struct proc_dir_entry *entry; +}; + +#define acpi_device_dir(d) ((d)->dir.entry) + + +/* Plug and Play */ + +typedef char acpi_bus_id[5]; +typedef unsigned long acpi_bus_address; +typedef char acpi_hardware_id[9]; +typedef char acpi_unique_id[9]; +typedef char acpi_device_name[40]; +typedef char acpi_device_class[20]; + +struct acpi_device_pnp { + acpi_bus_id bus_id; /* Object name */ + acpi_bus_address bus_address; /* _ADR */ + acpi_hardware_id hardware_id; /* _HID */ + acpi_unique_id unique_id; /* _UID */ + acpi_device_name device_name; /* Driver-determined */ + acpi_device_class device_class; /* " */ +}; + +#define acpi_device_bid(d) ((d)->pnp.bus_id) +#define acpi_device_adr(d) ((d)->pnp.bus_address) +#define acpi_device_hid(d) ((d)->pnp.hardware_id) +#define acpi_device_uid(d) ((d)->pnp.unique_id) +#define acpi_device_name(d) ((d)->pnp.device_name) +#define acpi_device_class(d) ((d)->pnp.device_class) + + +/* Power Management */ + +struct acpi_device_power_flags { + u32 explicit_get:1; /* _PSC present? */ + u32 power_resources:1; /* Power resources */ + u32 inrush_current:1; /* Serialize Dx->D0 */ + u32 wake_capable:1; /* Wakeup supported? */ + u32 wake_enabled:1; /* Enabled for wakeup */ + u32 power_removed:1; /* Optimize Dx->D0 */ + u32 reserved:26; +}; + +struct acpi_device_power_state { + struct { + u8 valid:1; + u8 explicit_set:1; /* _PSx present? */ + u8 reserved:6; + } flags; + int power; /* % Power (compared to D0) */ + int latency; /* Dx->D0 time (microseconds) */ + struct acpi_handle_list resources; /* Power resources referenced */ +}; + +struct acpi_device_power { + int state; /* Current state */ + struct acpi_device_power_flags flags; + struct acpi_device_power_state states[4]; /* Power states (D0-D3) */ +}; + + +/* Performance Management */ + +struct acpi_device_perf_flags { + u8 reserved:8; +}; + +struct acpi_device_perf_state { + struct { + u8 valid:1; + u8 reserved:7; + } flags; + u8 power; /* % Power (compared to P0) */ + u8 performance; /* % Performance ( " ) */ + int latency; /* Px->P0 time (microseconds) */ +}; + +struct acpi_device_perf { + int state; + struct acpi_device_perf_flags flags; + int state_count; + struct acpi_device_perf_state *states; +}; + + +/* Device */ + +struct acpi_device { + acpi_handle handle; + struct acpi_device *parent; + struct list_head children; + struct list_head node; + struct acpi_device_status status; + struct acpi_device_flags flags; + struct acpi_device_pnp pnp; + struct acpi_device_power power; + struct acpi_device_perf performance; + struct acpi_device_dir dir; + struct acpi_device_ops ops; + struct acpi_driver *driver; + void *driver_data; +#ifdef CONFIG_LDM + struct device dev; +#endif +}; + +#define acpi_driver_data(d) ((d)->driver_data) + + +/* + * Events + * ------ + */ + +struct acpi_bus_event { + struct list_head node; + acpi_device_class device_class; + acpi_bus_id bus_id; + u32 type; + u32 data; +}; + + +/* + * External Functions + */ + +int acpi_bus_get_device(acpi_handle, struct acpi_device **device); +int acpi_bus_get_status (struct acpi_device *device); +int acpi_bus_get_power (acpi_handle handle, int *state); +int acpi_bus_set_power (acpi_handle handle, int state); +int acpi_bus_generate_event (struct acpi_device *device, u8 type, int data); +int acpi_bus_receive_event (struct acpi_bus_event *event); +int acpi_bus_register_driver (struct acpi_driver *driver); +int acpi_bus_unregister_driver (struct acpi_driver *driver); +int acpi_bus_scan (struct acpi_device *device); +int acpi_init (void); +void acpi_exit (void); + + +#endif /*CONFIG_ACPI_BUS*/ + +#endif /*__ACPI_BUS_H__*/ diff -urN linux-2.4.18/drivers/acpi/acpi_drivers.h lia64-2.4/drivers/acpi/acpi_drivers.h --- linux-2.4.18/drivers/acpi/acpi_drivers.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/acpi_drivers.h Fri Jul 19 18:25:44 2002 @@ -0,0 +1,345 @@ +/* + * acpi_drivers.h ($Revision: 29 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#ifndef __ACPI_DRIVERS_H__ +#define __ACPI_DRIVERS_H__ + +#include +#include "acpi_bus.h" + + +#define ACPI_MAX_STRING 80 + + +/* -------------------------------------------------------------------------- + ACPI Bus + -------------------------------------------------------------------------- */ + +#define ACPI_BUS_COMPONENT 0x00010000 +#define ACPI_BUS_CLASS "system_bus" +#define ACPI_BUS_HID "ACPI_BUS" +#define ACPI_BUS_DRIVER_NAME "ACPI Bus Driver" +#define ACPI_BUS_DEVICE_NAME "System Bus" + + +/* -------------------------------------------------------------------------- + AC Adapter + -------------------------------------------------------------------------- */ + +#define ACPI_AC_COMPONENT 0x00020000 +#define ACPI_AC_CLASS "ac_adapter" +#define ACPI_AC_HID "ACPI0003" +#define ACPI_AC_DRIVER_NAME "ACPI AC Adapter Driver" +#define ACPI_AC_DEVICE_NAME "AC Adapter" +#define ACPI_AC_FILE_STATE "state" +#define ACPI_AC_NOTIFY_STATUS 0x80 +#define ACPI_AC_STATUS_OFFLINE 0x00 +#define ACPI_AC_STATUS_ONLINE 0x01 +#define ACPI_AC_STATUS_UNKNOWN 0xFF + + +/* -------------------------------------------------------------------------- + Battery + -------------------------------------------------------------------------- */ + +#define ACPI_BATTERY_COMPONENT 0x00040000 +#define ACPI_BATTERY_CLASS "battery" +#define ACPI_BATTERY_HID "PNP0C0A" +#define ACPI_BATTERY_DRIVER_NAME "ACPI Battery Driver" +#define ACPI_BATTERY_DEVICE_NAME "Battery" +#define ACPI_BATTERY_FILE_INFO "info" +#define ACPI_BATTERY_FILE_STATUS "state" +#define ACPI_BATTERY_FILE_ALARM "alarm" +#define ACPI_BATTERY_NOTIFY_STATUS 0x80 +#define ACPI_BATTERY_NOTIFY_INFO 0x81 +#define ACPI_BATTERY_UNITS_WATTS "mW" +#define ACPI_BATTERY_UNITS_AMPS "mA" + + +/* -------------------------------------------------------------------------- + Button + -------------------------------------------------------------------------- */ + +#define ACPI_BUTTON_COMPONENT 0x00080000 +#define ACPI_BUTTON_DRIVER_NAME "ACPI Button Driver" +#define ACPI_BUTTON_CLASS "button" +#define ACPI_BUTTON_FILE_INFO "info" +#define ACPI_BUTTON_TYPE_UNKNOWN 0x00 +#define ACPI_BUTTON_NOTIFY_STATUS 0x80 + +#define ACPI_BUTTON_SUBCLASS_POWER "power" +#define ACPI_BUTTON_HID_POWER "PNP0C0C" +#define ACPI_BUTTON_HID_POWERF "ACPI_FPB" +#define ACPI_BUTTON_DEVICE_NAME_POWER "Power Button (CM)" +#define ACPI_BUTTON_DEVICE_NAME_POWERF "Power Button (FF)" +#define ACPI_BUTTON_TYPE_POWER 0x01 +#define ACPI_BUTTON_TYPE_POWERF 0x02 + +#define ACPI_BUTTON_SUBCLASS_SLEEP "sleep" +#define ACPI_BUTTON_HID_SLEEP "PNP0C0E" +#define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB" +#define ACPI_BUTTON_DEVICE_NAME_SLEEP "Sleep Button (CM)" +#define ACPI_BUTTON_DEVICE_NAME_SLEEPF "Sleep Button (FF)" +#define ACPI_BUTTON_TYPE_SLEEP 0x03 +#define ACPI_BUTTON_TYPE_SLEEPF 0x04 + +#define ACPI_BUTTON_SUBCLASS_LID "lid" +#define ACPI_BUTTON_HID_LID "PNP0C0D" +#define ACPI_BUTTON_DEVICE_NAME_LID "Lid Switch" +#define ACPI_BUTTON_TYPE_LID 0x05 + + +/* -------------------------------------------------------------------------- + Embedded Controller + -------------------------------------------------------------------------- */ + +#define ACPI_EC_COMPONENT 0x00100000 +#define ACPI_EC_CLASS "embedded_controller" +#define ACPI_EC_HID "PNP0C09" +#define ACPI_EC_DRIVER_NAME "ACPI Embedded Controller Driver" +#define ACPI_EC_DEVICE_NAME "Embedded Controller" +#define ACPI_EC_FILE_INFO "info" + +#ifdef CONFIG_ACPI_EC + +int acpi_ec_init (void); +void acpi_ec_exit (void); + +#endif + + +/* -------------------------------------------------------------------------- + Fan + -------------------------------------------------------------------------- */ + +#define ACPI_FAN_COMPONENT 0x00200000 +#define ACPI_FAN_CLASS "fan" +#define ACPI_FAN_HID "PNP0C0B" +#define ACPI_FAN_DRIVER_NAME "ACPI Fan Driver" +#define ACPI_FAN_DEVICE_NAME "Fan" +#define ACPI_FAN_FILE_STATE "state" +#define ACPI_FAN_NOTIFY_STATUS 0x80 + + +/* -------------------------------------------------------------------------- + PCI + -------------------------------------------------------------------------- */ + +#ifdef CONFIG_ACPI_PCI + +#define ACPI_PCI_COMPONENT 0x00400000 + +/* ACPI PCI Root Bridge (pci_root.c) */ + +#define ACPI_PCI_ROOT_CLASS "pci_bridge" +#define ACPI_PCI_ROOT_HID "PNP0A03" +#define ACPI_PCI_ROOT_DRIVER_NAME "ACPI PCI Root Bridge Driver" +#define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" + +int acpi_pci_root_init (void); +void acpi_pci_root_exit (void); + +/* ACPI PCI Interrupt Link (pci_link.c) */ + +#define ACPI_PCI_LINK_CLASS "pci_irq_routing" +#define ACPI_PCI_LINK_HID "PNP0C0F" +#define ACPI_PCI_LINK_DRIVER_NAME "ACPI PCI Interrupt Link Driver" +#define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link" +#define ACPI_PCI_LINK_FILE_INFO "info" +#define ACPI_PCI_LINK_FILE_STATUS "state" + +int acpi_pci_link_check (void); +int acpi_pci_link_get_irq (acpi_handle handle, int index); +int acpi_pci_link_init (void); +void acpi_pci_link_exit (void); + +/* ACPI PCI Interrupt Routing (pci_irq.c) */ + +int acpi_pci_irq_add_prt (acpi_handle handle, int segment, int bus); + +/* ACPI PCI Device Binding (pci_bind.c) */ + +struct pci_bus; + +int acpi_pci_bind (struct acpi_device *device); +int acpi_pci_bind_root (struct acpi_device *device, acpi_pci_id *id, struct pci_bus *bus); + +#endif /*CONFIG_ACPI_PCI*/ + + +/* -------------------------------------------------------------------------- + Power Resource + -------------------------------------------------------------------------- */ + +#define ACPI_POWER_COMPONENT 0x00800000 +#define ACPI_POWER_CLASS "power_resource" +#define ACPI_POWER_HID "ACPI_PWR" +#define ACPI_POWER_DRIVER_NAME "ACPI Power Resource Driver" +#define ACPI_POWER_DEVICE_NAME "Power Resource" +#define ACPI_POWER_FILE_INFO "info" +#define ACPI_POWER_FILE_STATUS "state" +#define ACPI_POWER_RESOURCE_STATE_OFF 0x00 +#define ACPI_POWER_RESOURCE_STATE_ON 0x01 +#define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF + +#ifdef CONFIG_ACPI_POWER + +int acpi_power_get_inferred_state (struct acpi_device *device); +int acpi_power_transition (struct acpi_device *device, int state); +int acpi_power_init (void); +void acpi_power_exit (void); + +#endif + + +/* -------------------------------------------------------------------------- + Processor + -------------------------------------------------------------------------- */ + +#define ACPI_PROCESSOR_COMPONENT 0x01000000 +#define ACPI_PROCESSOR_CLASS "processor" +#define ACPI_PROCESSOR_HID "ACPI_CPU" +#define ACPI_PROCESSOR_DRIVER_NAME "ACPI Processor Driver" +#define ACPI_PROCESSOR_DEVICE_NAME "Processor" +#define ACPI_PROCESSOR_FILE_INFO "info" +#define ACPI_PROCESSOR_FILE_POWER "power" +#define ACPI_PROCESSOR_FILE_PERFORMANCE "performance" +#define ACPI_PROCESSOR_FILE_THROTTLING "throttling" +#define ACPI_PROCESSOR_FILE_LIMIT "limit" +#define ACPI_PROCESSOR_NOTIFY_PERFORMANCE 0x80 +#define ACPI_PROCESSOR_NOTIFY_POWER 0x81 +#define ACPI_PROCESSOR_LIMIT_NONE 0x00 +#define ACPI_PROCESSOR_LIMIT_INCREMENT 0x01 +#define ACPI_PROCESSOR_LIMIT_DECREMENT 0x02 + +int acpi_processor_set_thermal_limit(acpi_handle handle, int type); + + +/* -------------------------------------------------------------------------- + System + -------------------------------------------------------------------------- */ + +#define ACPI_SYSTEM_COMPONENT 0x02000000 +#define ACPI_SYSTEM_CLASS "system" +#define ACPI_SYSTEM_HID "ACPI_SYS" +#define ACPI_SYSTEM_DRIVER_NAME "ACPI System Driver" +#define ACPI_SYSTEM_DEVICE_NAME "System" +#define ACPI_SYSTEM_FILE_INFO "info" +#define ACPI_SYSTEM_FILE_EVENT "event" +#define ACPI_SYSTEM_FILE_ALARM "alarm" +#define ACPI_SYSTEM_FILE_DSDT "dsdt" +#define ACPI_SYSTEM_FILE_FADT "fadt" +#define ACPI_SYSTEM_FILE_SLEEP "sleep" +#define ACPI_SYSTEM_FILE_DEBUG_LAYER "debug_layer" +#define ACPI_SYSTEM_FILE_DEBUG_LEVEL "debug_level" + +#ifdef CONFIG_ACPI_SYSTEM + +int acpi_system_init (void); +void acpi_system_exit (void); + +#endif + + +/* -------------------------------------------------------------------------- + Thermal Zone + -------------------------------------------------------------------------- */ + +#define ACPI_THERMAL_COMPONENT 0x04000000 +#define ACPI_THERMAL_CLASS "thermal_zone" +#define ACPI_THERMAL_HID "ACPI_THM" +#define ACPI_THERMAL_DRIVER_NAME "ACPI Thermal Zone Driver" +#define ACPI_THERMAL_DEVICE_NAME "Thermal Zone" +#define ACPI_THERMAL_FILE_STATE "state" +#define ACPI_THERMAL_FILE_TEMPERATURE "temperature" +#define ACPI_THERMAL_FILE_TRIP_POINTS "trip_points" +#define ACPI_THERMAL_FILE_COOLING_MODE "cooling_mode" +#define ACPI_THERMAL_FILE_POLLING_FREQ "polling_frequency" +#define ACPI_THERMAL_NOTIFY_TEMPERATURE 0x80 +#define ACPI_THERMAL_NOTIFY_THRESHOLDS 0x81 +#define ACPI_THERMAL_NOTIFY_DEVICES 0x82 +#define ACPI_THERMAL_NOTIFY_CRITICAL 0xF0 +#define ACPI_THERMAL_NOTIFY_HOT 0xF1 +#define ACPI_THERMAL_MODE_ACTIVE 0x00 +#define ACPI_THERMAL_MODE_PASSIVE 0x01 +#define ACPI_THERMAL_PATH_POWEROFF "/sbin/poweroff" + + +/* -------------------------------------------------------------------------- + Debug Support + -------------------------------------------------------------------------- */ + +#define ACPI_DEBUG_RESTORE 0 +#define ACPI_DEBUG_LOW 1 +#define ACPI_DEBUG_MEDIUM 2 +#define ACPI_DEBUG_HIGH 3 +#define ACPI_DEBUG_DRIVERS 4 + +extern u32 acpi_dbg_level; +extern u32 acpi_dbg_layer; + +static inline void +acpi_set_debug ( + u32 flag) +{ + static u32 layer_save; + static u32 level_save; + + switch (flag) { + case ACPI_DEBUG_RESTORE: + acpi_dbg_layer = layer_save; + acpi_dbg_level = level_save; + break; + case ACPI_DEBUG_LOW: + case ACPI_DEBUG_MEDIUM: + case ACPI_DEBUG_HIGH: + case ACPI_DEBUG_DRIVERS: + layer_save = acpi_dbg_layer; + level_save = acpi_dbg_level; + break; + } + + switch (flag) { + case ACPI_DEBUG_LOW: + acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS; + acpi_dbg_level = DEBUG_DEFAULT; + break; + case ACPI_DEBUG_MEDIUM: + acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS; + acpi_dbg_level = ACPI_LV_FUNCTIONS | ACPI_LV_ALL_EXCEPTIONS; + break; + case ACPI_DEBUG_HIGH: + acpi_dbg_layer = 0xFFFFFFFF; + acpi_dbg_level = 0xFFFFFFFF; + break; + case ACPI_DEBUG_DRIVERS: + acpi_dbg_layer = ACPI_ALL_DRIVERS; + acpi_dbg_level = 0xFFFFFFFF; + break; + } +} + + +#endif /*__ACPI_DRIVERS_H__*/ diff -urN linux-2.4.18/drivers/acpi/acpi_ksyms.c lia64-2.4/drivers/acpi/acpi_ksyms.c --- linux-2.4.18/drivers/acpi/acpi_ksyms.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/acpi_ksyms.c Tue Jun 11 14:24:21 2002 @@ -1,64 +1,58 @@ /* - * ksyms.c - ACPI exported symbols + * acpi_ksyms.c - ACPI Kernel Symbols ($Revision: 14 $) * - * Copyright (C) 2000 Andrew Grover + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#include #include -#include -#include -#include -#include -#include "acpi.h" -#include "acdebug.h" +#include "include/acpi.h" +#include "acpi_bus.h" -extern int acpi_in_debugger; -extern FADT_DESCRIPTOR acpi_fadt; -#define _COMPONENT OS_DEPENDENT - MODULE_NAME ("symbols") +#ifdef CONFIG_ACPI_INTERPRETER + +/* ACPI Debugger */ #ifdef ENABLE_DEBUGGER + +extern int acpi_in_debugger; + EXPORT_SYMBOL(acpi_in_debugger); EXPORT_SYMBOL(acpi_db_user_commands); -#endif + +#endif /* ENABLE_DEBUGGER */ + +/* ACPI Core Subsystem */ #ifdef ACPI_DEBUG +EXPORT_SYMBOL(acpi_dbg_layer); +EXPORT_SYMBOL(acpi_dbg_level); EXPORT_SYMBOL(acpi_ut_debug_print_raw); EXPORT_SYMBOL(acpi_ut_debug_print); EXPORT_SYMBOL(acpi_ut_status_exit); +EXPORT_SYMBOL(acpi_ut_value_exit); EXPORT_SYMBOL(acpi_ut_exit); EXPORT_SYMBOL(acpi_ut_trace); -#endif - -EXPORT_SYMBOL(acpi_gbl_FADT); - -EXPORT_SYMBOL(acpi_os_free); -EXPORT_SYMBOL(acpi_os_printf); -EXPORT_SYMBOL(acpi_os_callocate); -EXPORT_SYMBOL(acpi_os_sleep); -EXPORT_SYMBOL(acpi_os_stall); -EXPORT_SYMBOL(acpi_os_queue_for_execution); - -EXPORT_SYMBOL(acpi_dbg_layer); -EXPORT_SYMBOL(acpi_dbg_level); - -EXPORT_SYMBOL(acpi_format_exception); +#endif /*ACPI_DEBUG*/ EXPORT_SYMBOL(acpi_get_handle); EXPORT_SYMBOL(acpi_get_parent); @@ -68,7 +62,6 @@ EXPORT_SYMBOL(acpi_get_next_object); EXPORT_SYMBOL(acpi_evaluate_object); EXPORT_SYMBOL(acpi_get_table); - EXPORT_SYMBOL(acpi_install_notify_handler); EXPORT_SYMBOL(acpi_remove_notify_handler); EXPORT_SYMBOL(acpi_install_gpe_handler); @@ -77,39 +70,61 @@ EXPORT_SYMBOL(acpi_remove_address_space_handler); EXPORT_SYMBOL(acpi_install_fixed_event_handler); EXPORT_SYMBOL(acpi_remove_fixed_event_handler); - EXPORT_SYMBOL(acpi_acquire_global_lock); EXPORT_SYMBOL(acpi_release_global_lock); - EXPORT_SYMBOL(acpi_get_current_resources); EXPORT_SYMBOL(acpi_get_possible_resources); EXPORT_SYMBOL(acpi_set_current_resources); - EXPORT_SYMBOL(acpi_enable_event); EXPORT_SYMBOL(acpi_disable_event); EXPORT_SYMBOL(acpi_clear_event); - EXPORT_SYMBOL(acpi_get_timer_duration); EXPORT_SYMBOL(acpi_get_timer); +EXPORT_SYMBOL(acpi_get_sleep_type_data); +EXPORT_SYMBOL(acpi_get_register); +EXPORT_SYMBOL(acpi_set_register); +EXPORT_SYMBOL(acpi_enter_sleep_state); +EXPORT_SYMBOL(acpi_get_system_info); +/* ACPI OS Services Layer (acpi_osl.c) */ + +EXPORT_SYMBOL(acpi_os_free); +EXPORT_SYMBOL(acpi_os_printf); +EXPORT_SYMBOL(acpi_os_sleep); +EXPORT_SYMBOL(acpi_os_stall); +EXPORT_SYMBOL(acpi_os_signal); +EXPORT_SYMBOL(acpi_os_queue_for_execution); EXPORT_SYMBOL(acpi_os_signal_semaphore); EXPORT_SYMBOL(acpi_os_create_semaphore); EXPORT_SYMBOL(acpi_os_delete_semaphore); EXPORT_SYMBOL(acpi_os_wait_semaphore); -EXPORT_SYMBOL(acpi_os_read_port); -EXPORT_SYMBOL(acpi_os_write_port); +/* ACPI Utilities (acpi_utils.c) */ + +EXPORT_SYMBOL(acpi_extract_package); +EXPORT_SYMBOL(acpi_evaluate); +EXPORT_SYMBOL(acpi_evaluate_integer); +EXPORT_SYMBOL(acpi_evaluate_reference); + +#endif /*CONFIG_ACPI_INTERPRETER*/ + + +/* ACPI Bus Driver (acpi_bus.c) */ + +#ifdef CONFIG_ACPI_BUS EXPORT_SYMBOL(acpi_fadt); -EXPORT_SYMBOL(acpi_hw_register_bit_access); -EXPORT_SYMBOL(acpi_hw_obtain_sleep_type_register_data); -EXPORT_SYMBOL(acpi_enter_sleep_state); -EXPORT_SYMBOL(acpi_get_system_info); -EXPORT_SYMBOL(acpi_leave_sleep_state); -/*EXPORT_SYMBOL(acpi_save_state_mem);*/ -/*EXPORT_SYMBOL(acpi_save_state_disk);*/ -EXPORT_SYMBOL(acpi_hw_register_read); -EXPORT_SYMBOL(acpi_set_firmware_waking_vector); -EXPORT_SYMBOL(acpi_subsystem_status); +EXPORT_SYMBOL(acpi_root_dir); +EXPORT_SYMBOL(acpi_bus_get_device); +EXPORT_SYMBOL(acpi_bus_get_status); +EXPORT_SYMBOL(acpi_bus_get_power); +EXPORT_SYMBOL(acpi_bus_set_power); +EXPORT_SYMBOL(acpi_bus_generate_event); +EXPORT_SYMBOL(acpi_bus_receive_event); +EXPORT_SYMBOL(acpi_bus_register_driver); +EXPORT_SYMBOL(acpi_bus_unregister_driver); +EXPORT_SYMBOL(acpi_bus_scan); +EXPORT_SYMBOL(acpi_init); + +#endif /*CONFIG_ACPI_BUS*/ -EXPORT_SYMBOL(acpi_os_signal); diff -urN linux-2.4.18/drivers/acpi/battery.c lia64-2.4/drivers/acpi/battery.c --- linux-2.4.18/drivers/acpi/battery.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/battery.c Tue Jun 11 14:24:22 2002 @@ -0,0 +1,831 @@ +/* + * acpi_battery.c - ACPI Battery Driver ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include +#include +#include +#include "acpi_bus.h" +#include "acpi_drivers.h" + + +#define _COMPONENT ACPI_BATTERY_COMPONENT +ACPI_MODULE_NAME ("acpi_battery") + +MODULE_AUTHOR("Paul Diefenbaugh"); +MODULE_DESCRIPTION(ACPI_BATTERY_DRIVER_NAME); +MODULE_LICENSE("GPL"); + +#define PREFIX "ACPI: " + + +#define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF + +#define ACPI_BATTERY_FORMAT_BIF "NNNNNNNNNSSSS" +#define ACPI_BATTERY_FORMAT_BST "NNNN" + +static int acpi_battery_add (struct acpi_device *device); +static int acpi_battery_remove (struct acpi_device *device, int type); + +static struct acpi_driver acpi_battery_driver = { + name: ACPI_BATTERY_DRIVER_NAME, + class: ACPI_BATTERY_CLASS, + ids: ACPI_BATTERY_HID, + ops: { + add: acpi_battery_add, + remove: acpi_battery_remove, + }, +}; + +struct acpi_battery_status { + acpi_integer state; + acpi_integer present_rate; + acpi_integer remaining_capacity; + acpi_integer present_voltage; +}; + +struct acpi_battery_info { + acpi_integer power_unit; + acpi_integer design_capacity; + acpi_integer last_full_capacity; + acpi_integer battery_technology; + acpi_integer design_voltage; + acpi_integer design_capacity_warning; + acpi_integer design_capacity_low; + acpi_integer battery_capacity_granularity_1; + acpi_integer battery_capacity_granularity_2; + acpi_string model_number; + acpi_string serial_number; + acpi_string battery_type; + acpi_string oem_info; +}; + +struct acpi_battery_flags { + u8 present:1; /* Bay occupied? */ + u8 power_unit:1; /* 0=watts, 1=apms */ + u8 alarm:1; /* _BTP present? */ + u8 reserved:5; +}; + +struct acpi_battery_trips { + unsigned long warning; + unsigned long low; +}; + +struct acpi_battery { + acpi_handle handle; + struct acpi_battery_flags flags; + struct acpi_battery_trips trips; + unsigned long alarm; + struct acpi_battery_info *info; +}; + + +/* -------------------------------------------------------------------------- + Battery Management + -------------------------------------------------------------------------- */ + +static int +acpi_battery_get_info ( + struct acpi_battery *battery, + struct acpi_battery_info **bif) +{ + int result = 0; + acpi_status status = 0; + acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + acpi_buffer format = {sizeof(ACPI_BATTERY_FORMAT_BIF), + ACPI_BATTERY_FORMAT_BIF}; + acpi_buffer data = {0, NULL}; + acpi_object *package = NULL; + + ACPI_FUNCTION_TRACE("acpi_battery_get_info"); + + if (!battery || !bif) + return_VALUE(-EINVAL); + + /* Evalute _BIF */ + + status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BIF\n")); + return_VALUE(-ENODEV); + } + + package = (acpi_object *) buffer.pointer; + + /* Extract Package Data */ + + status = acpi_extract_package(package, &format, &data); + if (status != AE_BUFFER_OVERFLOW) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n")); + result = -ENODEV; + goto end; + } + + data.pointer = kmalloc(data.length, GFP_KERNEL); + if (!data.pointer) { + result = -ENOMEM; + goto end; + } + memset(data.pointer, 0, data.length); + + status = acpi_extract_package(package, &format, &data); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n")); + kfree(data.pointer); + result = -ENODEV; + goto end; + } + +end: + kfree(buffer.pointer); + + if (0 == result) + (*bif) = (struct acpi_battery_info *) data.pointer; + + return_VALUE(result); +} + +static int +acpi_battery_get_status ( + struct acpi_battery *battery, + struct acpi_battery_status **bst) +{ + int result = 0; + acpi_status status = 0; + acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + acpi_buffer format = {sizeof(ACPI_BATTERY_FORMAT_BST), + ACPI_BATTERY_FORMAT_BST}; + acpi_buffer data = {0, NULL}; + acpi_object *package = NULL; + + ACPI_FUNCTION_TRACE("acpi_battery_get_status"); + + if (!battery || !bst) + return_VALUE(-EINVAL); + + /* Evalute _BST */ + + status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BST\n")); + return_VALUE(-ENODEV); + } + + package = (acpi_object *) buffer.pointer; + + /* Extract Package Data */ + + status = acpi_extract_package(package, &format, &data); + if (status != AE_BUFFER_OVERFLOW) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n")); + result = -ENODEV; + goto end; + } + + data.pointer = kmalloc(data.length, GFP_KERNEL); + if (!data.pointer) { + result = -ENOMEM; + goto end; + } + memset(data.pointer, 0, data.length); + + status = acpi_extract_package(package, &format, &data); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n")); + kfree(data.pointer); + result = -ENODEV; + goto end; + } + +end: + kfree(buffer.pointer); + + if (0 == result) + (*bst) = (struct acpi_battery_status *) data.pointer; + + return_VALUE(result); +} + + +static int +acpi_battery_set_alarm ( + struct acpi_battery *battery, + unsigned long alarm) +{ + acpi_status status = 0; + acpi_object arg0 = {ACPI_TYPE_INTEGER}; + acpi_object_list arg_list = {1, &arg0}; + + ACPI_FUNCTION_TRACE("acpi_battery_set_alarm"); + + if (!battery) + return_VALUE(-EINVAL); + + if (!battery->flags.alarm) + return_VALUE(-ENODEV); + + arg0.integer.value = alarm; + + status = acpi_evaluate(battery->handle, "_BTP", &arg_list, NULL); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Alarm set to %d\n", (u32) alarm)); + + battery->alarm = alarm; + + return_VALUE(0); +} + + +static int +acpi_battery_check ( + struct acpi_battery *battery) +{ + int result = 0; + acpi_status status = AE_OK; + acpi_handle handle = NULL; + struct acpi_device *device = NULL; + struct acpi_battery_info *bif = NULL; + + ACPI_FUNCTION_TRACE("acpi_battery_check"); + + if (!battery) + return_VALUE(-EINVAL); + + result = acpi_bus_get_device(battery->handle, &device); + if (0 != result) + return_VALUE(result); + + result = acpi_bus_get_status(device); + if (0 != result) + return_VALUE(result); + + /* Insertion? */ + + if (!battery->flags.present && device->status.battery_present) { + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Battery inserted\n")); + + /* Evalute _BIF to get certain static information */ + + result = acpi_battery_get_info(battery, &bif); + if (0 != result) + return_VALUE(result); + + battery->flags.power_unit = bif->power_unit; + battery->trips.warning = bif->design_capacity_warning; + battery->trips.low = bif->design_capacity_low; + kfree(bif); + + /* See if alarms are supported, and if so, set default */ + + status = acpi_get_handle(battery->handle, "_BTP", &handle); + if (ACPI_SUCCESS(status)) { + battery->flags.alarm = 1; + acpi_battery_set_alarm(battery, battery->trips.warning); + } + } + + /* Removal? */ + + else if (battery->flags.present && !device->status.battery_present) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Battery removed\n")); + } + + battery->flags.present = device->status.battery_present; + + return_VALUE(result); +} + + +/* -------------------------------------------------------------------------- + FS Interface (/proc) + -------------------------------------------------------------------------- */ + +#include +#include + +struct proc_dir_entry *acpi_battery_dir = NULL; + +static int +acpi_battery_read_info ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + int result = 0; + struct acpi_battery *battery = (struct acpi_battery *) data; + struct acpi_battery_info *bif = NULL; + char *units = "?"; + char *p = page; + int len = 0; + + ACPI_FUNCTION_TRACE("acpi_battery_read_info"); + + if (!battery) + goto end; + + if (battery->flags.present) + p += sprintf(p, "present: yes\n"); + else { + p += sprintf(p, "present: no\n"); + goto end; + } + + /* Battery Info (_BIF) */ + + result = acpi_battery_get_info(battery, &bif); + if ((0 != result) || !bif) { + p += sprintf(p, "ERROR: Unable to read battery information\n"); + goto end; + } + + units = bif->power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS; + + if (bif->design_capacity == ACPI_BATTERY_VALUE_UNKNOWN) + p += sprintf(p, "design capacity: unknown\n"); + else + p += sprintf(p, "design capacity: %d %sh\n", + (u32) bif->design_capacity, units); + + if (bif->last_full_capacity == ACPI_BATTERY_VALUE_UNKNOWN) + p += sprintf(p, "last full capacity: unknown\n"); + else + p += sprintf(p, "last full capacity: %d %sh\n", + (u32) bif->last_full_capacity, units); + + switch ((u32) bif->battery_technology) { + case 0: + p += sprintf(p, "battery technology: non-rechargeable\n"); + break; + case 1: + p += sprintf(p, "battery technology: rechargeable\n"); + break; + default: + p += sprintf(p, "battery technology: unknown\n"); + break; + } + + if (bif->design_voltage == ACPI_BATTERY_VALUE_UNKNOWN) + p += sprintf(p, "design voltage: unknown\n"); + else + p += sprintf(p, "design voltage: %d mV\n", + (u32) bif->design_voltage); + + p += sprintf(p, "design capacity warning: %d %sh\n", + (u32) bif->design_capacity_warning, units); + p += sprintf(p, "design capacity low: %d %sh\n", + (u32) bif->design_capacity_low, units); + p += sprintf(p, "capacity granularity 1: %d %sh\n", + (u32) bif->battery_capacity_granularity_1, units); + p += sprintf(p, "capacity granularity 2: %d %sh\n", + (u32) bif->battery_capacity_granularity_2, units); + p += sprintf(p, "model number: %s\n", + bif->model_number); + p += sprintf(p, "serial number: %s\n", + bif->serial_number); + p += sprintf(p, "battery type: %s\n", + bif->battery_type); + p += sprintf(p, "OEM info: %s\n", + bif->oem_info); + +end: + kfree(bif); + + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_battery_read_state ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + int result = 0; + struct acpi_battery *battery = (struct acpi_battery *) data; + struct acpi_battery_status *bst = NULL; + char *units = "?"; + char *p = page; + int len = 0; + + ACPI_FUNCTION_TRACE("acpi_battery_read_state"); + + if (!battery) + goto end; + + if (battery->flags.present) + p += sprintf(p, "present: yes\n"); + else { + p += sprintf(p, "present: no\n"); + goto end; + } + + /* Battery Units */ + + units = battery->flags.power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS; + + /* Battery Status (_BST) */ + + result = acpi_battery_get_status(battery, &bst); + if ((0 != result) || !bst) { + p += sprintf(p, "ERROR: Unable to read battery status\n"); + goto end; + } + + if (!(bst->state & 0x04)) + p += sprintf(p, "capacity state: ok\n"); + else + p += sprintf(p, "capacity state: critical\n"); + + if ((bst->state & 0x01) && (bst->state & 0x02)) + p += sprintf(p, "charging state: charging/discharging\n"); + else if (bst->state & 0x01) + p += sprintf(p, "charging state: discharging\n"); + else if (bst->state & 0x02) + p += sprintf(p, "charging state: charging\n"); + else + p += sprintf(p, "charging state: unknown\n"); + + if (bst->present_rate == ACPI_BATTERY_VALUE_UNKNOWN) + p += sprintf(p, "present rate: unknown\n"); + else + p += sprintf(p, "present rate: %d %s\n", + (u32) bst->present_rate, units); + + if (bst->remaining_capacity == ACPI_BATTERY_VALUE_UNKNOWN) + p += sprintf(p, "remaining capacity: unknown\n"); + else + p += sprintf(p, "remaining capacity: %d %sh\n", + (u32) bst->remaining_capacity, units); + + if (bst->present_voltage == ACPI_BATTERY_VALUE_UNKNOWN) + p += sprintf(p, "present voltage: unknown\n"); + else + p += sprintf(p, "present voltage: %d mV\n", + (u32) bst->present_voltage); + +end: + kfree(bst); + + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_battery_read_alarm ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_battery *battery = (struct acpi_battery *) data; + char *units = "?"; + char *p = page; + int len = 0; + + ACPI_FUNCTION_TRACE("acpi_battery_read_alarm"); + + if (!battery) + goto end; + + if (!battery->flags.present) { + p += sprintf(p, "present: no\n"); + goto end; + } + + /* Battery Units */ + + units = battery->flags.power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS; + + /* Battery Alarm */ + + p += sprintf(p, "alarm: "); + if (!battery->alarm) + p += sprintf(p, "unsupported\n"); + else + p += sprintf(p, "%d %sh\n", (u32) battery->alarm, units); + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_battery_write_alarm ( + struct file *file, + const char *buffer, + unsigned long count, + void *data) +{ + int result = 0; + struct acpi_battery *battery = (struct acpi_battery *) data; + char alarm_string[12] = {'\0'}; + + ACPI_FUNCTION_TRACE("acpi_battery_write_alarm"); + + if (!battery || (count > sizeof(alarm_string) - 1)) + return_VALUE(-EINVAL); + + if (!battery->flags.present) + return_VALUE(-ENODEV); + + if (copy_from_user(alarm_string, buffer, count)) + return_VALUE(-EFAULT); + + alarm_string[count] = '\0'; + + result = acpi_battery_set_alarm(battery, + simple_strtoul(alarm_string, NULL, 0)); + if (0 != result) + return_VALUE(result); + + return_VALUE(count); +} + + +static int +acpi_battery_add_fs ( + struct acpi_device *device) +{ + struct proc_dir_entry *entry = NULL; + + ACPI_FUNCTION_TRACE("acpi_battery_add_fs"); + + if (!acpi_battery_dir) { + acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir); + if (!acpi_battery_dir) + return_VALUE(-ENODEV); + } + + if (!acpi_device_dir(device)) { + acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), + acpi_battery_dir); + if (!acpi_device_dir(device)) + return_VALUE(-ENODEV); + } + + /* 'info' [R] */ + entry = create_proc_entry(ACPI_BATTERY_FILE_INFO, + S_IRUGO, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_BATTERY_FILE_INFO)); + else { + entry->read_proc = acpi_battery_read_info; + entry->data = acpi_driver_data(device); + } + + /* 'status' [R] */ + entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS, + S_IRUGO, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_BATTERY_FILE_STATUS)); + else { + entry->read_proc = acpi_battery_read_state; + entry->data = acpi_driver_data(device); + } + + /* 'alarm' [R/W] */ + entry = create_proc_entry(ACPI_BATTERY_FILE_ALARM, + S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_BATTERY_FILE_ALARM)); + else { + entry->read_proc = acpi_battery_read_alarm; + entry->write_proc = acpi_battery_write_alarm; + entry->data = acpi_driver_data(device); + } + + return_VALUE(0); +} + + +static int +acpi_battery_remove_fs ( + struct acpi_device *device) +{ + ACPI_FUNCTION_TRACE("acpi_battery_remove_fs"); + + if (!acpi_battery_dir) + return_VALUE(-ENODEV); + + if (acpi_device_dir(device)) + remove_proc_entry(acpi_device_bid(device), acpi_battery_dir); + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Driver Interface + -------------------------------------------------------------------------- */ + +static void +acpi_battery_notify ( + acpi_handle handle, + u32 event, + void *data) +{ + struct acpi_battery *battery = (struct acpi_battery *) data; + struct acpi_device *device = NULL; + + ACPI_FUNCTION_TRACE("acpi_battery_notify"); + + if (!battery) + return_VOID; + + if (0 != acpi_bus_get_device(handle, &device)) + return_VOID; + + switch (event) { + case ACPI_BATTERY_NOTIFY_STATUS: + case ACPI_BATTERY_NOTIFY_INFO: + acpi_battery_check(battery); + acpi_bus_generate_event(device, event, battery->flags.present); + break; + default: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Unsupported event [0x%x]\n", event)); + break; + } + + return_VOID; +} + + +static int +acpi_battery_add ( + struct acpi_device *device) +{ + int result = 0; + acpi_status status = 0; + struct acpi_battery *battery = NULL; + + ACPI_FUNCTION_TRACE("acpi_battery_add"); + + if (!device) + return_VALUE(-EINVAL); + + battery = kmalloc(sizeof(struct acpi_battery), GFP_KERNEL); + if (!battery) + return_VALUE(-ENOMEM); + memset(battery, 0, sizeof(struct acpi_battery)); + + battery->handle = device->handle; + sprintf(acpi_device_name(device), "%s", ACPI_BATTERY_DEVICE_NAME); + sprintf(acpi_device_class(device), "%s", ACPI_BATTERY_CLASS); + acpi_driver_data(device) = battery; + + result = acpi_battery_check(battery); + if (0 != result) + goto end; + + result = acpi_battery_add_fs(device); + if (0 != result) + goto end; + + status = acpi_install_notify_handler(battery->handle, + ACPI_DEVICE_NOTIFY, acpi_battery_notify, battery); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error installing notify handler\n")); + result = -ENODEV; + goto end; + } + + printk(KERN_INFO PREFIX "%s Slot [%s] (battery %s)\n", + ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device), + device->status.battery_present?"present":"absent"); + +end: + if (0 != result) { + acpi_battery_remove_fs(device); + kfree(battery); + } + + return_VALUE(result); +} + + +static int +acpi_battery_remove ( + struct acpi_device *device, + int type) +{ + acpi_status status = 0; + struct acpi_battery *battery = NULL; + + ACPI_FUNCTION_TRACE("acpi_battery_remove"); + + if (!device || !acpi_driver_data(device)) + return_VALUE(-EINVAL); + + battery = (struct acpi_battery *) acpi_driver_data(device); + + status = acpi_remove_notify_handler(battery->handle, + ACPI_DEVICE_NOTIFY, acpi_battery_notify); + if (ACPI_FAILURE(status)) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); + + acpi_battery_remove_fs(device); + + kfree(battery); + + return_VALUE(0); +} + + +static int __init +acpi_battery_init (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_battery_init"); + + result = acpi_bus_register_driver(&acpi_battery_driver); + if (0 > result) { + remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); + return_VALUE(-ENODEV); + } + + return_VALUE(0); +} + + +static void __exit +acpi_battery_exit (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_battery_exit"); + + result = acpi_bus_unregister_driver(&acpi_battery_driver); + if (0 == result) + remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); + + return_VOID; +} + + +module_init(acpi_battery_init); +module_exit(acpi_battery_exit); diff -urN linux-2.4.18/drivers/acpi/bus.c lia64-2.4/drivers/acpi/bus.c --- linux-2.4.18/drivers/acpi/bus.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/bus.c Tue Jun 11 14:24:22 2002 @@ -0,0 +1,2200 @@ +/* + * acpi_bus.c - ACPI Bus Driver ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "acpi_bus.h" +#include "acpi_drivers.h" +#include "include/acinterp.h" /* for acpi_ex_eisa_id_to_string() */ + + +#define _COMPONENT ACPI_BUS_COMPONENT +ACPI_MODULE_NAME ("acpi_bus") + +MODULE_AUTHOR("Paul Diefenbaugh"); +MODULE_DESCRIPTION(ACPI_BUS_DRIVER_NAME); +MODULE_LICENSE("GPL"); + +#define PREFIX "ACPI: " + +FADT_DESCRIPTOR acpi_fadt; +static u8 acpi_disabled; +struct acpi_device *acpi_root; +struct proc_dir_entry *acpi_root_dir; + +#define STRUCT_TO_INT(s) (*((int*)&s)) + +/* + * POLICY: If *anything* doesn't work, put it on the blacklist. + * If they are critical errors, mark it critical, and abort driver load. + */ +static struct acpi_blacklist_item acpi_blacklist[] __initdata = +{ + /* Portege 7020, BIOS 8.10 */ + {"TOSHIB", "7020CT ", 0x19991112, ACPI_TABLE_DSDT, all_versions, "Implicit Return", 0}, + /* Portege 4030 */ + {"TOSHIB", "4030 ", 0x19991112, ACPI_TABLE_DSDT, all_versions, "Implicit Return", 0}, + /* Portege 310/320, BIOS 7.1 */ + {"TOSHIB", "310 ", 0x19990511, ACPI_TABLE_DSDT, all_versions, "Implicit Return", 0}, + /* Seattle 2, old bios rev. */ + {"INTEL ", "440BX ", 0x00001000, ACPI_TABLE_DSDT, less_than_or_equal, "Field beyond end of region", 0}, + /* ASUS K7M */ + {"ASUS ", "K7M ", 0x00001000, ACPI_TABLE_DSDT, less_than_or_equal, "Field beyond end of region", 0}, + /* Intel 810 Motherboard? */ + {"MNTRAL", "MO81010A", 0x00000012, ACPI_TABLE_DSDT, less_than_or_equal, "Field beyond end of region", 0}, + /* Compaq Presario 1700 */ + {"PTLTD ", " DSDT ", 0x06040000, ACPI_TABLE_DSDT, less_than_or_equal, "Multiple problems", 1}, + /* Sony FX120, FX140, FX150? */ + {"SONY ", "U0 ", 0x20010313, ACPI_TABLE_DSDT, less_than_or_equal, "ACPI driver problem", 1}, + /* Compaq Presario 800, Insyde BIOS */ + {"INT440", "SYSFexxx", 0x00001001, ACPI_TABLE_DSDT, less_than_or_equal, "Does not use _REG to protect EC OpRegions", 1}, + /* IBM 600E - _ADR should return 7, but it returns 1 */ + {"IBM ", "TP600E ", 0x00000105, ACPI_TABLE_DSDT, less_than_or_equal, "Incorrect _ADR", 1}, + {""} +}; + + +/* -------------------------------------------------------------------------- + Linux Driver Model (LDM) Support + -------------------------------------------------------------------------- */ + +#ifdef CONFIG_LDM + +static int acpi_device_probe(struct device *dev); +static int acpi_device_remove(struct device *dev, u32 flags); +static int acpi_device_suspend(struct device *dev, u32 state, u32 stage); +static int acpi_device_resume(struct device *dev, u32 stage); + +static struct device_driver acpi_bus_driver = { + probe: acpi_device_probe, + remove: acpi_device_remove, + suspend: acpi_device_suspend, + resume: acpi_device_resume, +}; + + +static int +acpi_device_probe ( + struct device *dev) +{ + ACPI_FUNCTION_TRACE("acpi_device_probe"); + + if (!dev) + return_VALUE(-EINVAL); + + /* TBD */ + + return_VALUE(0); +} + + +static int +acpi_device_remove ( + struct device *dev, + u32 flags) +{ + ACPI_FUNCTION_TRACE("acpi_device_remove"); + + if (!dev) + return_VALUE(-EINVAL); + + /* TBD */ + + return_VALUE(0); +} + + +static int +acpi_device_suspend ( + struct device *dev, + u32 state, + u32 stage) +{ + ACPI_FUNCTION_TRACE("acpi_device_suspend"); + + if (!dev) + return_VALUE(-EINVAL); + + /* TBD */ + + return_VALUE(0); +} + + +static int +acpi_device_resume ( + struct device *dev, + u32 stage) +{ + ACPI_FUNCTION_TRACE("acpi_device_resume"); + + if (!dev) + return_VALUE(-EINVAL); + + /* TBD */ + + return_VALUE(0); +} + +#if 0 /* not used ATM */ +static int +acpi_platform_add ( + struct device *dev) +{ + ACPI_FUNCTION_TRACE("acpi_platform_add"); + + if (!dev) + return -EINVAL; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device %s (%s) added\n", + dev->name, dev->bus_id)); + + /* TBD */ + + return_VALUE(0); +} + + +static int +acpi_platform_remove ( + struct device *dev) +{ + ACPI_FUNCTION_TRACE("acpi_platform_add"); + + if (!dev) + return -EINVAL; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device %s (%s) removed\n", + dev->name, dev->bus_id)); + + /* TBD */ + + return_VALUE(0); +} +#endif /* unused */ + + +#endif /*CONFIG_LDM*/ + + +static int +acpi_device_register ( + struct acpi_device *device, + struct acpi_device *parent) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_device_register"); + + if (!device) + return_VALUE(-EINVAL); + +#ifdef CONFIG_LDM + sprintf(device->dev.name, "ACPI device %s:%s", + device->pnp.hardware_id, device->pnp.unique_id); + strncpy(device->dev.bus_id, device->pnp.bus_id, sizeof(acpi_bus_id)); + if (parent) + device->dev.parent = &parent->dev; + device->dev.driver = &acpi_bus_driver; + + result = device_register(&device->dev); +#endif /*CONFIG_LDM*/ + + return_VALUE(result); +} + + +static int +acpi_device_unregister ( + struct acpi_device *device) +{ + ACPI_FUNCTION_TRACE("acpi_device_unregister"); + + if (!device) + return_VALUE(-EINVAL); + +#ifdef CONFIG_LDM + put_device(&device->dev); +#endif /*CONFIG_LDM*/ + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Device Management + -------------------------------------------------------------------------- */ + +static void +acpi_bus_data_handler ( + acpi_handle handle, + u32 function, + void *context) +{ + ACPI_FUNCTION_TRACE("acpi_bus_data_handler"); + + /* TBD */ + + return_VOID; +} + + +int +acpi_bus_get_device ( + acpi_handle handle, + struct acpi_device **device) +{ + acpi_status status = AE_OK; + + ACPI_FUNCTION_TRACE("acpi_bus_get_device"); + + if (!device) + return_VALUE(-EINVAL); + + /* TBD: Support fixed-feature devices */ + + status = acpi_get_data(handle, acpi_bus_data_handler, (void**) device); + if (ACPI_FAILURE(status) || !*device) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error getting context for object [%p]\n", + handle)); + return_VALUE(-ENODEV); + } + + return_VALUE(0); +} + +int +acpi_bus_get_status ( + struct acpi_device *device) +{ + acpi_status status = AE_OK; + unsigned long sta = 0; + + ACPI_FUNCTION_TRACE("acpi_bus_get_status"); + + if (!device) + return_VALUE(-EINVAL); + + /* + * Evaluate _STA if present. + */ + if (device->flags.dynamic_status) { + status = acpi_evaluate_integer(device->handle, "_STA", NULL, &sta); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + STRUCT_TO_INT(device->status) = (int) sta; + } + + /* + * Otherwise we assume the status of our parent (unless we don't + * have one, in which case status is implied). + */ + else if (device->parent) + device->status = device->parent->status; + else + STRUCT_TO_INT(device->status) = 0x0F; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]\n", + device->pnp.bus_id, (u32) STRUCT_TO_INT(device->status))); + + return_VALUE(0); +} + + +/* +static int +acpi_bus_create_device_fs (struct device *device) +{ + ACPI_FUNCTION_TRACE("acpi_bus_create_device_fs"); + + if (!device) + return_VALUE(-EINVAL); + + if (device->dir.entry) + return_VALUE(-EEXIST); + + if (!device->parent) + device->dir.entry = proc_mkdir(device->pnp.bus_id, NULL); + else + device->dir.entry = proc_mkdir(device->pnp.bus_id, + device->parent->fs.entry); + + if (!device->dir.entry) { + printk(KERN_ERR PREFIX "Unable to create fs entry '%s'\n", + device->pnp.bus_id); + return_VALUE(-ENODEV); + } + + return_VALUE(0); +} + + +static int +acpi_bus_remove_device_fs (struct device *device) +{ + ACPI_FUNCTION_TRACE("acpi_bus_create_device_fs"); + + if (!device) + return_VALUE(-EINVAL); + + if (!device->dir.entry) + return_VALUE(-ENODEV); + + if (!device->parent) + remove_proc_entry(device->pnp_bus_id, NULL); + else + remove_proc_entry(device->pnp.bus_id, device->parent->fs.entry); + + device->dir.entry = NULL; + + return_VALUE(0); +} +*/ + + +/* -------------------------------------------------------------------------- + Power Management + -------------------------------------------------------------------------- */ + +int +acpi_bus_get_power ( + acpi_handle handle, + int *state) +{ + int result = 0; + acpi_status status = 0; + struct acpi_device *device = NULL; + unsigned long psc = 0; + + ACPI_FUNCTION_TRACE("acpi_bus_get_power"); + + result = acpi_bus_get_device(handle, &device); + if (0 != result) + return_VALUE(result); + + *state = ACPI_STATE_UNKNOWN; + + if (!device->flags.power_manageable) { + /* TBD: Non-recursive algorithm for walking up hierarchy */ + if (device->parent) + *state = device->parent->power.state; + else + *state = ACPI_STATE_D0; + } + else { + /* + * Get the device's power state either directly (via _PSC) or + * indirectly (via power resources). + */ + if (device->power.flags.explicit_get) { + status = acpi_evaluate_integer(device->handle, "_PSC", + NULL, &psc); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + device->power.state = (int) psc; + } + else if (device->power.flags.power_resources) { + result = acpi_power_get_inferred_state(device); + if (0 != result) + return_VALUE(result); + } + + *state = device->power.state; + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is D%d\n", + device->pnp.bus_id, device->power.state)); + + return_VALUE(0); +} + + +int +acpi_bus_set_power ( + acpi_handle handle, + int state) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_device *device = NULL; + char object_name[5] = {'_','P','S','0'+state,'\0'}; + + ACPI_FUNCTION_TRACE("acpi_bus_set_power"); + + result = acpi_bus_get_device(handle, &device); + if (0 != result) + return_VALUE(result); + + if ((state < ACPI_STATE_D0) || (state > ACPI_STATE_D3)) + return_VALUE(-EINVAL); + + /* Make sure this is a valid target state */ + + if (!device->flags.power_manageable) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device is not power manageable\n")); + return_VALUE(-ENODEV); + } + if (state == device->power.state) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", state)); + return_VALUE(0); + } + if (!device->power.states[state].flags.valid) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device does not support D%d\n", state)); + return_VALUE(-ENODEV); + } + if (device->parent && (state < device->parent->power.state)) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Cannot set device to a higher-powered state than parent\n")); + return_VALUE(-ENODEV); + } + + /* + * Transition Power + * ---------------- + * On transitions to a high-powered state we first apply power (via + * power resources) then evalute _PSx. Conversly for transitions to + * a lower-powered state. + */ + if (state < device->power.state) { + if (device->power.flags.power_resources) { + result = acpi_power_transition(device, state); + if (0 != result) + goto end; + } + if (device->power.states[state].flags.explicit_set) { + status = acpi_evaluate_object(device->handle, + object_name, NULL, NULL); + if (ACPI_FAILURE(status)) { + result = -ENODEV; + goto end; + } + } + } + else { + if (device->power.states[state].flags.explicit_set) { + status = acpi_evaluate_object(device->handle, + object_name, NULL, NULL); + if (ACPI_FAILURE(status)) { + result = -ENODEV; + goto end; + } + } + if (device->power.flags.power_resources) { + result = acpi_power_transition(device, state); + if (0 != result) + goto end; + } + } + +end: + if (0 != result) + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error transitioning device [%s] to D%d\n", + device->pnp.bus_id, state)); + else + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] transitioned to D%d\n", + device->pnp.bus_id, state)); + + return_VALUE(result); +} + + +static int +acpi_bus_get_power_flags ( + struct acpi_device *device) +{ + acpi_status status = 0; + acpi_handle handle = 0; + u32 i = 0; + + ACPI_FUNCTION_TRACE("acpi_bus_get_power_flags"); + + if (!device) + return -ENODEV; + + /* + * Power Management Flags + */ + status = acpi_get_handle(device->handle, "_PSC", &handle); + if (ACPI_SUCCESS(status)) + device->power.flags.explicit_get = 1; + status = acpi_get_handle(device->handle, "_IRC", &handle); + if (ACPI_SUCCESS(status)) + device->power.flags.inrush_current = 1; + status = acpi_get_handle(device->handle, "_PRW", &handle); + if (ACPI_SUCCESS(status)) + device->power.flags.wake_capable = 1; + + /* + * Enumerate supported power management states + */ + for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3; i++) { + struct acpi_device_power_state *ps = &device->power.states[i]; + char object_name[5] = {'_','P','R','0'+i,'\0'}; + + /* Evaluate "_PRx" to se if power resources are referenced */ + acpi_evaluate_reference(device->handle, object_name, NULL, + &ps->resources); + if (ps->resources.count) { + device->power.flags.power_resources = 1; + ps->flags.valid = 1; + } + + /* Evaluate "_PSx" to see if we can do explicit sets */ + object_name[2] = 'S'; + status = acpi_get_handle(device->handle, object_name, &handle); + if (ACPI_SUCCESS(status)) { + ps->flags.explicit_set = 1; + ps->flags.valid = 1; + } + + /* State is valid if we have some power control */ + if (ps->resources.count || ps->flags.explicit_set) + ps->flags.valid = 1; + + ps->power = -1; /* Unknown - driver assigned */ + ps->latency = -1; /* Unknown - driver assigned */ + } + + /* Set defaults for D0 and D3 states (always valid) */ + device->power.states[ACPI_STATE_D0].flags.valid = 1; + device->power.states[ACPI_STATE_D0].power = 100; + device->power.states[ACPI_STATE_D3].flags.valid = 1; + device->power.states[ACPI_STATE_D3].power = 0; + + /* + * System Power States + * ------------------- + */ + /* TBD: S1-S4 power state support and resource requirements. */ + /* + for (i=ACPI_STATE_S1; ihandle, name, NULL, + &state); + if (ACPI_FAILURE(status)) + continue; + } + */ + + /* TBD: System wake support and resource requirements. */ + + device->power.state = ACPI_STATE_UNKNOWN; + + return 0; +} + + +/* -------------------------------------------------------------------------- + Performance Management + -------------------------------------------------------------------------- */ + +static int +acpi_bus_get_perf_flags ( + struct acpi_device *device) +{ + ACPI_FUNCTION_TRACE("acpi_bus_get_perf_flags"); + + if (!device) + return -ENODEV; + + device->performance.state = ACPI_STATE_UNKNOWN; + + return 0; +} + + +/* -------------------------------------------------------------------------- + Event Management + -------------------------------------------------------------------------- */ + +static spinlock_t acpi_bus_event_lock = SPIN_LOCK_UNLOCKED; + +LIST_HEAD(acpi_bus_event_list); +DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue); + +extern int event_is_open; + +int +acpi_bus_generate_event ( + struct acpi_device *device, + u8 type, + int data) +{ + struct acpi_bus_event *event = NULL; + u32 flags = 0; + + ACPI_FUNCTION_TRACE("acpi_bus_generate_event"); + + if (!device) + return_VALUE(-EINVAL); + + /* drop event on the floor if no one's listening */ + if (!event_is_open) + return_VALUE(0); + + event = kmalloc(sizeof(struct acpi_bus_event), GFP_KERNEL); + if (!event) + return_VALUE(-ENOMEM); + + sprintf(event->device_class, "%s", device->pnp.device_class); + sprintf(event->bus_id, "%s", device->pnp.bus_id); + event->type = type; + event->data = data; + + spin_lock_irqsave(&acpi_bus_event_lock, flags); + list_add_tail(&event->node, &acpi_bus_event_list); + spin_unlock_irqrestore(&acpi_bus_event_lock, flags); + + wake_up_interruptible(&acpi_bus_event_queue); + + return_VALUE(0); +} + +int +acpi_bus_receive_event ( + struct acpi_bus_event *event) +{ + u32 flags = 0; + struct acpi_bus_event *entry = NULL; + + DECLARE_WAITQUEUE(wait, current); + + ACPI_FUNCTION_TRACE("acpi_bus_receive_event"); + + if (!event) + return -EINVAL; + + if (list_empty(&acpi_bus_event_list)) { + + set_current_state(TASK_INTERRUPTIBLE); + add_wait_queue(&acpi_bus_event_queue, &wait); + + if (list_empty(&acpi_bus_event_list)) + schedule(); + + remove_wait_queue(&acpi_bus_event_queue, &wait); + set_current_state(TASK_RUNNING); + + if (signal_pending(current)) + return_VALUE(-ERESTARTSYS); + } + + spin_lock_irqsave(&acpi_bus_event_lock, flags); + entry = list_entry(acpi_bus_event_list.next, struct acpi_bus_event, node); + if (entry) + list_del(&entry->node); + spin_unlock_irqrestore(&acpi_bus_event_lock, flags); + + if (!entry) + return_VALUE(-ENODEV); + + memcpy(event, entry, sizeof(struct acpi_bus_event)); + + kfree(entry); + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Namespace Management + -------------------------------------------------------------------------- */ + +#define WALK_UP 0 +#define WALK_DOWN 1 + +typedef int (*acpi_bus_walk_callback)(struct acpi_device*, int, void*); + +#define HAS_CHILDREN(d) ((d)->children.next != &((d)->children)) +#define HAS_SIBLINGS(d) (((d)->parent) && ((d)->node.next != &(d)->parent->children)) +#define NODE_TO_DEVICE(n) (list_entry(n, struct acpi_device, node)) + + +/** + * acpi_bus_walk + * ------------- + * Used to walk the ACPI Bus's device namespace. Can walk down (depth-first) + * or up. Able to parse starting at any node in the namespace. Note that a + * callback return value of -ELOOP will terminate the walk. + * + * @start: starting point + * callback: function to call for every device encountered while parsing + * direction: direction to parse (up or down) + * @data: context for this search operation + */ +static int +acpi_bus_walk ( + struct acpi_device *start, + acpi_bus_walk_callback callback, + int direction, + void *data) +{ + int result = 0; + int level = 0; + struct acpi_device *device = NULL; + + if (!start || !callback) + return -EINVAL; + + device = start; + + /* + * Parse Namespace + * --------------- + * Parse a given subtree (specified by start) in the given direction. + * Walking 'up' simply means that we execute the callback on leaf + * devices prior to their parents (useful for things like removing + * or powering down a subtree). + */ + + while (device) { + + if (direction == WALK_DOWN) + if (-ELOOP == callback(device, level, data)) + break; + + /* Depth First */ + + if (HAS_CHILDREN(device)) { + device = NODE_TO_DEVICE(device->children.next); + ++level; + continue; + } + + if (direction == WALK_UP) + if (-ELOOP == callback(device, level, data)) + break; + + /* Now Breadth */ + + if (HAS_SIBLINGS(device)) { + device = NODE_TO_DEVICE(device->node.next); + continue; + } + + /* Scope Exhausted - Find Next */ + + while ((device = device->parent)) { + --level; + if (HAS_SIBLINGS(device)) { + device = NODE_TO_DEVICE(device->node.next); + break; + } + } + } + + if ((direction == WALK_UP) && (result == 0)) + callback(start, level, data); + + return result; +} + + +/* -------------------------------------------------------------------------- + Notification Handling + -------------------------------------------------------------------------- */ + +static int +acpi_bus_check_device ( + struct acpi_device *device, + int *status_changed) +{ + acpi_status status = 0; + struct acpi_device_status old_status; + + ACPI_FUNCTION_TRACE("acpi_bus_check_device"); + + if (!device) + return_VALUE(-EINVAL); + + if (status_changed) + *status_changed = 0; + + old_status = device->status; + + /* + * Make sure this device's parent is present before we go about + * messing with the device. + */ + if (device->parent && !device->parent->status.present) { + device->status = device->parent->status; + if (STRUCT_TO_INT(old_status) != STRUCT_TO_INT(device->status)) { + if (status_changed) + *status_changed = 1; + } + return_VALUE(0); + } + + status = acpi_bus_get_status(device); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + if (STRUCT_TO_INT(old_status) == STRUCT_TO_INT(device->status)) + return_VALUE(0); + + if (status_changed) + *status_changed = 1; + + /* + * Device Insertion/Removal + */ + if ((device->status.present) && !(old_status.present)) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device insertion detected\n")); + /* TBD: Handle device insertion */ + } + else if (!(device->status.present) && (old_status.present)) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device removal detected\n")); + /* TBD: Handle device removal */ + } + + return_VALUE(0); +} + + +static int +acpi_bus_check_scope ( + struct acpi_device *device) +{ + int result = 0; + int status_changed = 0; + + ACPI_FUNCTION_TRACE("acpi_bus_check_scope"); + + if (!device) + return_VALUE(-EINVAL); + + /* Status Change? */ + result = acpi_bus_check_device(device, &status_changed); + if (0 != result) + return_VALUE(result); + + if (!status_changed) + return_VALUE(0); + + /* + * TBD: Enumerate child devices within this device's scope and + * run acpi_bus_check_device()'s on them. + */ + + return_VALUE(0); +} + + +/** + * acpi_bus_notify + * --------------- + * Callback for all 'system-level' device notifications (values 0x00-0x7F). + */ +static void +acpi_bus_notify ( + acpi_handle handle, + u32 type, + void *data) +{ + int result = 0; + struct acpi_device *device = NULL; + + ACPI_FUNCTION_TRACE("acpi_bus_notify"); + + if (0 != acpi_bus_get_device(handle, &device)) + return_VOID; + + switch (type) { + + case ACPI_NOTIFY_BUS_CHECK: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received BUS CHECK notification for device [%s]\n", + device->pnp.bus_id)); + result = acpi_bus_check_scope(device); + /* + * TBD: We'll need to outsource certain events to non-ACPI + * drivers via the device manager (device.c). + */ + break; + + case ACPI_NOTIFY_DEVICE_CHECK: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received DEVICE CHECK notification for device [%s]\n", + device->pnp.bus_id)); + result = acpi_bus_check_device(device, NULL); + /* + * TBD: We'll need to outsource certain events to non-ACPI + * drivers via the device manager (device.c). + */ + break; + + case ACPI_NOTIFY_DEVICE_WAKE: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received DEVICE WAKE notification for device [%s]\n", + device->pnp.bus_id)); + /* TBD */ + break; + + case ACPI_NOTIFY_EJECT_REQUEST: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received EJECT REQUEST notification for device [%s]\n", + device->pnp.bus_id)); + /* TBD */ + break; + + case ACPI_NOTIFY_DEVICE_CHECK_LIGHT: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received DEVICE CHECK LIGHT notification for device [%s]\n", + device->pnp.bus_id)); + /* TBD: Exactly what does 'light' mean? */ + break; + + case ACPI_NOTIFY_FREQUENCY_MISMATCH: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received FREQUENCY MISMATCH notification for device [%s]\n", + device->pnp.bus_id)); + /* TBD */ + break; + + case ACPI_NOTIFY_BUS_MODE_MISMATCH: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received BUS MODE MISMATCH notification for device [%s]\n", + device->pnp.bus_id)); + /* TBD */ + break; + + case ACPI_NOTIFY_POWER_FAULT: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received POWER FAULT notification for device [%s]\n", + device->pnp.bus_id)); + /* TBD */ + break; + + default: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received unknown/unsupported notification [%08x]\n", + type)); + break; + } + + return_VOID; +} + + +/* -------------------------------------------------------------------------- + Driver Management + -------------------------------------------------------------------------- */ + +static LIST_HEAD(acpi_bus_drivers); +static DECLARE_MUTEX(acpi_bus_drivers_lock); + + +/** + * acpi_bus_match + * -------------- + * Checks the device's hardware (_HID) or compatible (_CID) ids to see if it + * matches the specified driver's criteria. + */ +static int +acpi_bus_match ( + struct acpi_device *device, + struct acpi_driver *driver) +{ + + if (!device || !driver) + return -EINVAL; + + if (device->flags.hardware_id) { + if (0 != strstr(driver->ids, device->pnp.hardware_id)) + return 0; + } + + if (device->flags.compatible_ids) { + acpi_status status = AE_OK; + acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + acpi_object *object = NULL; + char cid[256]; + + memset(cid, 0, sizeof(cid)); + + status = acpi_evaluate_object(device->handle, "_CID", NULL, + &buffer); + if (ACPI_FAILURE(status) || !buffer.pointer) + return -ENOENT; + + object = (acpi_object *) buffer.pointer; + + switch (object->type) { + case ACPI_TYPE_INTEGER: + acpi_ex_eisa_id_to_string((u32) object->integer.value, + cid); + break; + case ACPI_TYPE_STRING: + strncpy(cid, object->string.pointer, sizeof(cid) - 1); + break; + case ACPI_TYPE_PACKAGE: + /* TBD: Support CID packages */ + break; + } + + if (!cid[0]) + return -ENOENT; + + if (0 != strstr(driver->ids, cid)) + return 0; + } + + return -ENOENT; +} + + +/** + * acpi_bus_driver_init + * -------------------- + * Used to initialize a device via its device driver. Called whenever a + * driver is bound to a device. Invokes the driver's add() and start() ops. + */ +static int +acpi_bus_driver_init ( + struct acpi_device *device, + struct acpi_driver *driver) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_bus_driver_init"); + + if (!device || !driver) + return_VALUE(-EINVAL); + + if (!driver->ops.add) + return_VALUE(-ENOSYS); + + result = driver->ops.add(device); + if (0 != result) { + device->driver = NULL; + acpi_driver_data(device) = NULL; + return_VALUE(result); + } + + /* + * TBD - Configuration Management: Assign resources to device based + * upon possible configuration and currently allocated resources. + */ + + if (driver->ops.start) { + result = driver->ops.start(device); + if ((0 != result) && (driver->ops.remove)) + driver->ops.remove(device, ACPI_BUS_REMOVAL_NORMAL); + return_VALUE(result); + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Driver successfully bound to device\n")); + +#ifdef CONFIG_LDM + /* + * Update the device information (in the global device hierarchy) now + * that there's a driver bound to it. + */ + strncpy(device->dev.name, device->pnp.device_name, + sizeof(device->dev.name)); +#endif + + if (driver->ops.scan) { + driver->ops.scan(device); + } + + return_VALUE(0); +} + + +/** + * acpi_bus_attach + * ------------- + * Callback for acpi_bus_walk() used to find devices that match a specific + * driver's criteria and then attach the driver. + */ +static int +acpi_bus_attach ( + struct acpi_device *device, + int level, + void *data) +{ + int result = 0; + struct acpi_driver *driver = NULL; + + ACPI_FUNCTION_TRACE("acpi_bus_attach"); + + if (!device || !data) + return_VALUE(-EINVAL); + + driver = (struct acpi_driver *) data; + + if (device->driver) + return_VALUE(-EEXIST); + + if (!device->status.present) + return_VALUE(-ENODEV); + + result = acpi_bus_match(device, driver); + if (0 != result) + return_VALUE(result); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found driver [%s] for device [%s]\n", + driver->name, device->pnp.bus_id)); + + result = acpi_bus_driver_init(device, driver); + if (0 != result) + return_VALUE(result); + + down(&acpi_bus_drivers_lock); + ++driver->references; + up(&acpi_bus_drivers_lock); + + return_VALUE(0); +} + + +/** + * acpi_bus_unattach + * ----------------- + * Callback for acpi_bus_walk() used to find devices that match a specific + * driver's criteria and unattach the driver. + */ +static int +acpi_bus_unattach ( + struct acpi_device *device, + int level, + void *data) +{ + int result = 0; + struct acpi_driver *driver = (struct acpi_driver *) data; + + ACPI_FUNCTION_TRACE("acpi_bus_unattach"); + + if (!device || !driver) + return_VALUE(-EINVAL); + + if (device->driver != driver) + return_VALUE(-ENOENT); + + if (!driver->ops.remove) + return_VALUE(-ENOSYS); + + result = driver->ops.remove(device, ACPI_BUS_REMOVAL_NORMAL); + if (0 != result) + return_VALUE(result); + + device->driver = NULL; + acpi_driver_data(device) = NULL; + + down(&acpi_bus_drivers_lock); + driver->references--; + up(&acpi_bus_drivers_lock); + + return_VALUE(0); +} + + +/** + * acpi_bus_find_driver + * -------------------- + * Parses the list of registered drivers looking for a driver applicable for + * the specified device. + */ +static int +acpi_bus_find_driver ( + struct acpi_device *device) +{ + int result = -ENODEV; + struct list_head *entry = NULL; + struct acpi_driver *driver = NULL; + + ACPI_FUNCTION_TRACE("acpi_bus_find_driver"); + + if (!device || device->driver) + return_VALUE(-EINVAL); + + down(&acpi_bus_drivers_lock); + + list_for_each(entry, &acpi_bus_drivers) { + + driver = list_entry(entry, struct acpi_driver, node); + + if (0 != acpi_bus_match(device, driver)) + continue; + + result = acpi_bus_driver_init(device, driver); + if (0 == result) + ++driver->references; + + break; + } + + up(&acpi_bus_drivers_lock); + + return_VALUE(result); +} + + +/** + * acpi_bus_register_driver + * ------------------------ + * Registers a driver with the ACPI bus. Searches the namespace for all + * devices that match the driver's criteria and binds. + */ +int +acpi_bus_register_driver ( + struct acpi_driver *driver) +{ + ACPI_FUNCTION_TRACE("acpi_bus_register_driver"); + + if (!driver) + return_VALUE(-EINVAL); + + down(&acpi_bus_drivers_lock); + list_add_tail(&driver->node, &acpi_bus_drivers); + up(&acpi_bus_drivers_lock); + + acpi_bus_walk(acpi_root, acpi_bus_attach, + WALK_DOWN, driver); + + return_VALUE(driver->references); +} + + +/** + * acpi_bus_unregister_driver + * -------------------------- + * Unregisters a driver with the ACPI bus. Searches the namespace for all + * devices that match the driver's criteria and unbinds. + */ +int +acpi_bus_unregister_driver ( + struct acpi_driver *driver) +{ + ACPI_FUNCTION_TRACE("acpi_bus_unregister_driver"); + + if (!driver) + return_VALUE(-EINVAL); + + acpi_bus_walk(acpi_root, acpi_bus_unattach, WALK_UP, driver); + + if (driver->references) + return_VALUE(driver->references); + + down(&acpi_bus_drivers_lock); + list_del(&driver->node); + up(&acpi_bus_drivers_lock); + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Device Enumeration + -------------------------------------------------------------------------- */ + +static int +acpi_bus_get_flags ( + struct acpi_device *device) +{ + acpi_status status = AE_OK; + acpi_handle temp = NULL; + + ACPI_FUNCTION_TRACE("acpi_bus_get_flags"); + + /* Presence of _STA indicates 'dynamic_status' */ + status = acpi_get_handle(device->handle, "_STA", &temp); + if (ACPI_SUCCESS(status)) + device->flags.dynamic_status = 1; + + /* Presence of _CID indicates 'compatible_ids' */ + status = acpi_get_handle(device->handle, "_CID", &temp); + if (ACPI_SUCCESS(status)) + device->flags.compatible_ids = 1; + + /* Presence of _RMV indicates 'removable' */ + status = acpi_get_handle(device->handle, "_RMV", &temp); + if (ACPI_SUCCESS(status)) + device->flags.removable = 1; + + /* Presence of _EJD|_EJ0 indicates 'ejectable' */ + status = acpi_get_handle(device->handle, "_EJD", &temp); + if (ACPI_SUCCESS(status)) + device->flags.ejectable = 1; + else { + status = acpi_get_handle(device->handle, "_EJ0", &temp); + if (ACPI_SUCCESS(status)) + device->flags.ejectable = 1; + } + + /* Presence of _LCK indicates 'lockable' */ + status = acpi_get_handle(device->handle, "_LCK", &temp); + if (ACPI_SUCCESS(status)) + device->flags.lockable = 1; + + /* Presence of _PS0|_PR0 indicates 'power manageable' */ + status = acpi_get_handle(device->handle, "_PS0", &temp); + if (ACPI_FAILURE(status)) + status = acpi_get_handle(device->handle, "_PR0", &temp); + if (ACPI_SUCCESS(status)) + device->flags.power_manageable = 1; + + /* TBD: Peformance management */ + + return_VALUE(0); +} + + +static int +acpi_bus_add ( + struct acpi_device **child, + struct acpi_device *parent, + acpi_handle handle, + int type) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_device *device = NULL; + char bus_id[5] = {'?',0}; + acpi_buffer buffer = {sizeof(bus_id), bus_id}; + acpi_device_info info; + char *hid = NULL; + char *uid = NULL; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_bus_add"); + + if (!child) + return_VALUE(-EINVAL); + + device = kmalloc(sizeof(struct acpi_device), GFP_KERNEL); + if (!device) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Memory allocation error\n")); + return_VALUE(-ENOMEM); + } + memset(device, 0, sizeof(struct acpi_device)); + + device->handle = handle; + device->parent = parent; + + memset(&info, 0, sizeof(acpi_device_info)); + + /* + * Bus ID + * ------ + * The device's Bus ID is simply the object name. + * TBD: Shouldn't this value be unique (within the ACPI namespace)? + */ + switch (type) { + case ACPI_BUS_TYPE_SYSTEM: + sprintf(device->pnp.bus_id, "%s", "ACPI"); + break; + case ACPI_BUS_TYPE_POWER_BUTTON: + sprintf(device->pnp.bus_id, "%s", "PWRF"); + break; + case ACPI_BUS_TYPE_SLEEP_BUTTON: + sprintf(device->pnp.bus_id, "%s", "SLPF"); + break; + default: + acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer); + /* Clean up trailing underscores (if any) */ + for (i = 3; i > 1; i--) { + if (bus_id[i] == '_') + bus_id[i] = '\0'; + else + break; + } + sprintf(device->pnp.bus_id, "%s", bus_id); + break; + } + + /* + * Flags + * ----- + * Get prior to calling acpi_bus_get_status() so we know whether + * or not _STA is present. Note that we only look for object + * handles -- cannot evaluate objects until we know the device is + * present and properly initialized. + */ + result = acpi_bus_get_flags(device); + if (0 != result) + goto end; + + /* + * Status + * ------ + * See if the device is present. We always assume that non-Device() + * objects (e.g. thermal zones, power resources, processors, etc.) are + * present, functioning, etc. (at least when parent object is present). + * Note that _STA has a different meaning for some objects (e.g. + * power resources) so we need to be careful how we use it. + */ + switch (type) { + case ACPI_BUS_TYPE_DEVICE: + result = acpi_bus_get_status(device); + if (0 != result) + goto end; + break; + default: + STRUCT_TO_INT(device->status) = 0x0F; + break; + } + if (!device->status.present) { + result = -ENOENT; + goto end; + } + + /* + * Initialize Device + * ----------------- + * TBD: Synch with Core's enumeration/initialization process. + */ + + /* + * Hardware ID, Unique ID, & Bus Address + * ------------------------------------- + */ + switch (type) { + case ACPI_BUS_TYPE_DEVICE: + status = acpi_get_object_info(handle, &info); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error reading device info\n")); + result = -ENODEV; + goto end; + } + /* Clean up info strings (not NULL terminated) */ + info.hardware_id[sizeof(info.hardware_id)-1] = '\0'; + info.unique_id[sizeof(info.unique_id)-1] = '\0'; + if (info.valid & ACPI_VALID_HID) + hid = info.hardware_id; + if (info.valid & ACPI_VALID_UID) + uid = info.unique_id; + if (info.valid & ACPI_VALID_ADR) { + device->pnp.bus_address = info.address; + device->flags.bus_address = 1; + } + break; + case ACPI_BUS_TYPE_POWER: + hid = ACPI_POWER_HID; + break; + case ACPI_BUS_TYPE_PROCESSOR: + hid = ACPI_PROCESSOR_HID; + break; + case ACPI_BUS_TYPE_SYSTEM: + hid = ACPI_SYSTEM_HID; + break; + case ACPI_BUS_TYPE_THERMAL: + hid = ACPI_THERMAL_HID; + break; + case ACPI_BUS_TYPE_POWER_BUTTON: + hid = ACPI_BUTTON_HID_POWERF; + break; + case ACPI_BUS_TYPE_SLEEP_BUTTON: + hid = ACPI_BUTTON_HID_SLEEPF; + break; + } + + /* + * \_SB + * ---- + * Fix for the system root bus device -- the only root-level device. + */ + if ((parent == ACPI_ROOT_OBJECT) && (type == ACPI_BUS_TYPE_DEVICE)) { + hid = ACPI_BUS_HID; + sprintf(device->pnp.device_name, "%s", ACPI_BUS_DEVICE_NAME); + sprintf(device->pnp.device_class, "%s", ACPI_BUS_CLASS); + } + + if (hid) { + sprintf(device->pnp.hardware_id, "%s", hid); + device->flags.hardware_id = 1; + } + if (uid) { + sprintf(device->pnp.unique_id, "%s", uid); + device->flags.unique_id = 1; + } + + /* + * Power Management + * ---------------- + */ + if (device->flags.power_manageable) { + result = acpi_bus_get_power_flags(device); + if (0 != result) + goto end; + } + + /* + * Performance Management + * ---------------------- + */ + if (device->flags.performance_manageable) { + result = acpi_bus_get_perf_flags(device); + if (0 != result) + goto end; + } + + /* + * Context + * ------- + * Attach this 'struct acpi_device' to the ACPI object. This makes + * resolutions from handle->device very efficient. Note that we need + * to be careful with fixed-feature devices as they all attach to the + * root object. + */ + switch (type) { + case ACPI_BUS_TYPE_POWER_BUTTON: + case ACPI_BUS_TYPE_SLEEP_BUTTON: + break; + default: + status = acpi_attach_data(device->handle, + acpi_bus_data_handler, device); + break; + } + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error attaching device data\n")); + result = -ENODEV; + goto end; + } + + /* + * Linkage + * ------- + * Link this device to its parent and siblings. + */ + INIT_LIST_HEAD(&device->children); + if (!device->parent) + INIT_LIST_HEAD(&device->node); + else + list_add_tail(&device->node, &device->parent->children); + +#ifdef CONFIG_ACPI_DEBUG + { + char *type_string = NULL; + char name[80] = {'?','\0'}; + acpi_buffer buffer = {sizeof(name), name}; + + acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); + + switch (type) { + case ACPI_BUS_TYPE_DEVICE: + type_string = "Device"; + break; + case ACPI_BUS_TYPE_POWER: + type_string = "Power Resource"; + break; + case ACPI_BUS_TYPE_PROCESSOR: + type_string = "Processor"; + break; + case ACPI_BUS_TYPE_SYSTEM: + type_string = "System"; + break; + case ACPI_BUS_TYPE_THERMAL: + type_string = "Thermal Zone"; + break; + case ACPI_BUS_TYPE_POWER_BUTTON: + type_string = "Power Button"; + sprintf(name, "PWRB"); + break; + case ACPI_BUS_TYPE_SLEEP_BUTTON: + type_string = "Sleep Button"; + sprintf(name, "SLPB"); + break; + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %s %s [%p]\n", + type_string, name, handle)); + } +#endif /*CONFIG_ACPI_DEBUG*/ + + /* + * Global Device Hierarchy: + * ------------------------ + * Register this device with the global device hierarchy. + */ + acpi_device_register(device, parent); + + /* + * Bind _ADR-Based Devices + * ----------------------- + * If there's a a bus address (_ADR) then we utilize the parent's + * 'bind' function (if exists) to bind the ACPI- and natively- + * enumerated device representations. + */ + if (device->flags.bus_address) { + if (device->parent && device->parent->ops.bind) + device->parent->ops.bind(device); + } + + /* + * Locate & Attach Driver + * ---------------------- + * If there's a hardware id (_HID) or compatible ids (_CID) we check + * to see if there's a driver installed for this kind of device. Note + * that drivers can install before or after a device in enumerated. + * + * TBD: Assumes LDM provides driver hot-plug capability. + */ + if (device->flags.hardware_id || device->flags.compatible_ids) + acpi_bus_find_driver(device); + +end: + if (0 != result) { + kfree(device); + return_VALUE(result); + } + + *child = device; + + return_VALUE(0); +} + + +static int +acpi_bus_remove ( + struct acpi_device *device, + int type) +{ + ACPI_FUNCTION_TRACE("acpi_bus_remove"); + + if (!device) + return_VALUE(-ENODEV); + + acpi_device_unregister(device); + + kfree(device); + + return_VALUE(0); +} + + +int +acpi_bus_scan ( + struct acpi_device *start) +{ + acpi_status status = AE_OK; + struct acpi_device *parent = NULL; + struct acpi_device *child = NULL; + acpi_handle phandle = 0; + acpi_handle chandle = 0; + acpi_object_type type = 0; + u32 level = 1; + + ACPI_FUNCTION_TRACE("acpi_bus_scan"); + + if (!start) + return_VALUE(-EINVAL); + + parent = start; + phandle = start->handle; + + /* + * Parse through the ACPI namespace, identify all 'devices', and + * create a new 'struct acpi_device' for each. + */ + while ((level > 0) && parent) { + + status = acpi_get_next_object(ACPI_TYPE_ANY, phandle, + chandle, &chandle); + + /* + * If this scope is exhausted then move our way back up. + */ + if (ACPI_FAILURE(status)) { + level--; + chandle = phandle; + acpi_get_parent(phandle, &phandle); + if (parent->parent) + parent = parent->parent; + continue; + } + + status = acpi_get_type(chandle, &type); + if (ACPI_FAILURE(status)) + continue; + + /* + * If this is a scope object then parse it (depth-first). + */ + if (type == ACPI_TYPE_ANY) { + /* Hack to get around scope identity problem */ + status = acpi_get_next_object(ACPI_TYPE_ANY, chandle, 0, NULL); + if (ACPI_SUCCESS(status)) { + level++; + phandle = chandle; + chandle = 0; + } + continue; + } + + /* + * We're only interested in objects that we consider 'devices'. + */ + switch (type) { + case ACPI_TYPE_DEVICE: + type = ACPI_BUS_TYPE_DEVICE; + break; + case ACPI_TYPE_PROCESSOR: + type = ACPI_BUS_TYPE_PROCESSOR; + break; + case ACPI_TYPE_THERMAL: + type = ACPI_BUS_TYPE_THERMAL; + break; + case ACPI_TYPE_POWER: + type = ACPI_BUS_TYPE_POWER; + break; + default: + continue; + } + + status = acpi_bus_add(&child, parent, chandle, type); + if (ACPI_FAILURE(status)) + continue; + + /* + * If the device is present, enabled, and functioning then + * parse its scope (depth-first). Note that we need to + * represent absent devices to facilitate PnP notifications + * -- but only the subtree head (not all of its children, + * which will be enumerated when the parent is inserted). + * + * TBD: Need notifications and other detection mechanisms + * in place before we can fully implement this. + */ + if (child->status.present) { + status = acpi_get_next_object(ACPI_TYPE_ANY, chandle, + 0, NULL); + if (ACPI_SUCCESS(status)) { + level++; + phandle = chandle; + chandle = 0; + parent = child; + } + } + } + + return_VALUE(0); +} + + +static int +acpi_bus_scan_fixed ( + struct acpi_device *root) +{ + int result = 0; + struct acpi_device *device = NULL; + + ACPI_FUNCTION_TRACE("acpi_bus_scan"); + + if (!root) + return_VALUE(-ENODEV); + + /* + * Enumerate all fixed-feature devices. + */ + if (acpi_fadt.pwr_button == 0) + result = acpi_bus_add(&device, acpi_root, + ACPI_ROOT_OBJECT, ACPI_BUS_TYPE_POWER_BUTTON); + + if (acpi_fadt.sleep_button == 0) + result = acpi_bus_add(&device, acpi_root, + ACPI_ROOT_OBJECT, ACPI_BUS_TYPE_SLEEP_BUTTON); + + return_VALUE(result); +} + + +/* -------------------------------------------------------------------------- + Initialization/Cleanup + -------------------------------------------------------------------------- */ + +int __init +acpi_blacklisted(void) +{ + int i = 0; + int blacklisted = 0; + acpi_table_header table_header; + + while (acpi_blacklist[i].oem_id[0] != '\0') + { + if (!ACPI_SUCCESS(acpi_get_table_header(acpi_blacklist[i].table, 1, &table_header))) { + i++; + continue; + } + + if (strncmp(acpi_blacklist[i].oem_id, table_header.oem_id, 6)) { + i++; + continue; + } + + if (strncmp(acpi_blacklist[i].oem_table_id, table_header.oem_table_id, 8)) { + i++; + continue; + } + + if ((acpi_blacklist[i].oem_revision_predicate == all_versions) + || (acpi_blacklist[i].oem_revision_predicate == less_than_or_equal + && table_header.oem_revision <= acpi_blacklist[i].oem_revision) + || (acpi_blacklist[i].oem_revision_predicate == greater_than_or_equal + && table_header.oem_revision >= acpi_blacklist[i].oem_revision) + || (acpi_blacklist[i].oem_revision_predicate == equal + && table_header.oem_revision == acpi_blacklist[i].oem_revision)) { + + printk(KERN_ERR PREFIX "Vendor \"%6.6s\" System \"%8.8s\" " + "Revision 0x%x has a known ACPI BIOS problem.\n", + acpi_blacklist[i].oem_id, + acpi_blacklist[i].oem_table_id, + acpi_blacklist[i].oem_revision); + + printk(KERN_ERR PREFIX "Reason: %s. This is a %s error\n", + acpi_blacklist[i].reason, + (acpi_blacklist[i].is_critical_error ? "non-recoverable" : "recoverable")); + + blacklisted = acpi_blacklist[i].is_critical_error; + break; + } + else { + i++; + } + } + + return blacklisted; +} + +static int __init +acpi_bus_init_irq (void) +{ + acpi_status status = AE_OK; + acpi_object arg = {ACPI_TYPE_INTEGER}; + acpi_object_list arg_list = {1, &arg}; + char *message = NULL; + + ACPI_FUNCTION_TRACE("acpi_bus_init_irq"); + + /* + * Let the system know what interrupt model we are using by + * evaluating the \_PIC object, if exists. + */ + + switch (acpi_irq_model) { + case ACPI_IRQ_MODEL_PIC: + message = "PIC"; + break; + case ACPI_IRQ_MODEL_IOAPIC: + message = "IOAPIC"; + break; + case ACPI_IRQ_MODEL_IOSAPIC: + message = "IOSAPIC"; + break; + default: + printk(KERN_WARNING PREFIX "Unknown interrupt routing model\n"); + return_VALUE(-ENODEV); + } + + printk(KERN_INFO PREFIX "Using %s for interrupt routing\n", message); + + arg.integer.value = acpi_irq_model; + + status = acpi_evaluate_object(NULL, "\\_PIC", &arg_list, NULL); + if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PIC\n")); + return_VALUE(-ENODEV); + } + + return_VALUE(0); +} + + +static int __init +acpi_bus_init (void) +{ + int result = 0; + acpi_status status = AE_OK; + acpi_buffer buffer = {sizeof(acpi_fadt), &acpi_fadt}; + int progress = 0; + + ACPI_FUNCTION_TRACE("acpi_bus_init"); + + /* + * [0] Initailize the ACPI Core Subsystem. + */ + status = acpi_initialize_subsystem(); + if (ACPI_FAILURE(status)) { + printk(KERN_ERR PREFIX "Unable to initialize the ACPI Interpreter\n"); + result = -ENODEV; + goto end; + } + + progress++; + + /* + * [1] Load the ACPI tables. + */ + status = acpi_load_tables(); + if (ACPI_FAILURE(status)) { + printk(KERN_ERR PREFIX "Unable to load the System Description Tables\n"); + result = -ENODEV; + goto end; + } + + progress++; + + /* + * [2] Check the blacklist + */ + if (acpi_blacklisted()) { + result = -ENODEV; + goto end; + } + + progress++; + + /* + * [3] Get a separate copy of the FADT for use by other drivers. + */ + status = acpi_get_table(ACPI_TABLE_FADT, 1, &buffer); + if (ACPI_FAILURE(status)) { + printk(KERN_ERR PREFIX "Unable to get the FADT\n"); + result = -ENODEV; + goto end; + } + + progress++; + + /* + * [4] Enable the ACPI Core Subsystem. + */ + status = acpi_enable_subsystem(ACPI_FULL_INITIALIZATION); + if (ACPI_FAILURE(status)) { + printk(KERN_ERR PREFIX "Unable to start the ACPI Interpreter\n"); + result = -ENODEV; + goto end; + } + + printk(KERN_INFO PREFIX "Interpreter enabled\n"); + + progress++; + + /* + * [5] Get the system interrupt model and evaluate \_PIC. + */ + result = acpi_bus_init_irq(); + if (0 != result) + goto end; + + progress++; + + /* + * [6] Register for all standard device notifications. + */ + status = acpi_install_notify_handler(ACPI_ROOT_OBJECT, ACPI_SYSTEM_NOTIFY, &acpi_bus_notify, NULL); + if (ACPI_FAILURE(status)) { + printk(KERN_ERR PREFIX "Unable to register for device notifications\n"); + result = -ENODEV; + goto end; + } + + progress++; + + /* + * [7] Create the root device. + */ + result = acpi_bus_add(&acpi_root, NULL, ACPI_ROOT_OBJECT, + ACPI_BUS_TYPE_SYSTEM); + if (0 != result) + goto end; + + progress++; + + /* + * [8] Create the root file system. + */ + acpi_device_dir(acpi_root) = proc_mkdir(ACPI_BUS_FILE_ROOT, NULL); + if (!acpi_root) { + result = -ENODEV; + goto end; + } + acpi_root_dir = acpi_device_dir(acpi_root); + + progress++; + + /* + * [9] Install drivers required for proper enumeration of the + * ACPI namespace. + */ + acpi_system_init(); /* ACPI System */ + acpi_power_init(); /* ACPI Bus Power Management */ +#ifdef CONFIG_ACPI_EC + acpi_ec_init(); /* ACPI Embedded Controller */ +#endif +#ifdef CONFIG_ACPI_PCI + acpi_pci_link_init(); /* ACPI PCI Interrupt Link */ + acpi_pci_root_init(); /* ACPI PCI Root Bridge */ +#endif + progress++; + + /* + * [10] Enumerate devices in the ACPI namespace. + */ + result = acpi_bus_scan_fixed(acpi_root); + if (0 != result) + goto end; + result = acpi_bus_scan(acpi_root); + if (0 != result) + goto end; + +end: + /* + * Clean up if anything went awry. + */ + if (0 != result) { + switch (progress) { + case 10: + case 9: remove_proc_entry("ACPI", NULL); + case 8: acpi_bus_remove(acpi_root, ACPI_BUS_REMOVAL_NORMAL); + case 7: acpi_remove_notify_handler(ACPI_ROOT_OBJECT, + ACPI_SYSTEM_NOTIFY, &acpi_bus_notify); + case 6: + case 5: + case 4: + case 3: + case 2: acpi_terminate(); + case 1: + case 0: + default: return_VALUE(-ENODEV); + } + } + + return_VALUE(0); +} + + +static void __exit +acpi_bus_exit (void) +{ + acpi_status status = AE_OK; + + ACPI_FUNCTION_TRACE("acpi_bus_exit"); + + status = acpi_remove_notify_handler(ACPI_ROOT_OBJECT, + ACPI_SYSTEM_NOTIFY, acpi_bus_notify); + if (ACPI_FAILURE(status)) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); + +#ifdef CONFIG_ACPI_PCI + acpi_pci_root_exit(); + acpi_pci_link_exit(); +#endif +#ifdef CONFIG_ACPI_EC + acpi_ec_exit(); +#endif + acpi_power_exit(); + acpi_system_exit(); + + acpi_bus_remove(acpi_root, ACPI_BUS_REMOVAL_NORMAL); + + remove_proc_entry(ACPI_BUS_FILE_ROOT, NULL); + + status = acpi_terminate(); + if (ACPI_FAILURE(status)) + printk(KERN_ERR PREFIX "Unable to terminate the ACPI Interpreter\n"); + else + printk(KERN_ERR PREFIX "Interpreter disabled\n"); + + return_VOID; +} + + +int __init +acpi_init (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_init"); + acpi_dbg_level = NORMAL_DEFAULT; + + memset(&acpi_fadt, 0, sizeof(FADT_DESCRIPTOR)); + + printk(KERN_INFO PREFIX "Subsystem revision %08x\n", + ACPI_CA_VERSION); + + /* Initial core debug level excludes drivers, so include them now */ + acpi_set_debug(ACPI_DEBUG_LOW); + + if (acpi_disabled) { + printk(KERN_INFO PREFIX "Disabled via command line (acpi=off)\n"); + return -ENODEV; + } + +#ifdef CONFIG_PM + if (PM_IS_ACTIVE()) { + printk(KERN_INFO PREFIX "APM is already active, exiting\n"); + return -ENODEV; + } +#endif + + result = acpi_bus_init(); + if (0 != result) + return_VALUE(result); + +#ifdef CONFIG_PM + pm_active = 1; +#endif + + return_VALUE(0); +} + + +void __exit +acpi_exit (void) +{ + ACPI_FUNCTION_TRACE("acpi_exit"); + +#ifdef CONFIG_PM + pm_active = 0; +#endif + + acpi_bus_exit(); + + return_VOID; +} + + +int __init +acpi_setup(char *str) +{ + while (str && *str) { + if (strncmp(str, "off", 3) == 0) + acpi_disabled = 1; + str = strchr(str, ','); + if (str) + str += strspn(str, ", \t"); + } + return 1; +} + + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) +subsys_initcall(acpi_init); +#endif + +__setup("acpi=", acpi_setup); + diff -urN linux-2.4.18/drivers/acpi/button.c lia64-2.4/drivers/acpi/button.c --- linux-2.4.18/drivers/acpi/button.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/button.c Tue Jun 11 14:24:22 2002 @@ -0,0 +1,420 @@ +/* + * acpi_button.c - ACPI Button Driver ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include +#include +#include +#include "acpi_bus.h" +#include "acpi_drivers.h" + + +#define _COMPONENT ACPI_BUTTON_COMPONENT +ACPI_MODULE_NAME ("acpi_button") + +MODULE_AUTHOR("Paul Diefenbaugh"); +MODULE_DESCRIPTION(ACPI_BUTTON_DRIVER_NAME); +MODULE_LICENSE("GPL"); + +#define PREFIX "ACPI: " + + +int acpi_button_add (struct acpi_device *device); +int acpi_button_remove (struct acpi_device *device, int type); + +static struct acpi_driver acpi_button_driver = { + name: ACPI_BUTTON_DRIVER_NAME, + class: ACPI_BUTTON_CLASS, + ids: "ACPI_FPB,ACPI_FSB,PNP0C0D,PNP0C0C,PNP0C0E", + ops: { + add: acpi_button_add, + remove: acpi_button_remove, + }, +}; + +struct acpi_button { + acpi_handle handle; + struct acpi_device *device; /* Fixed button kludge */ + u8 type; + unsigned long pushed; +}; + + +/* -------------------------------------------------------------------------- + FS Interface (/proc) + -------------------------------------------------------------------------- */ + +#include +#include + +static struct proc_dir_entry *acpi_button_dir = NULL; + + +static int +acpi_button_read_info ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_button *button = (struct acpi_button *) data; + char *p = page; + int len = 0; + + ACPI_FUNCTION_TRACE("acpi_button_read_info"); + + if (!button || !button->device) + goto end; + + p += sprintf(p, "type: %s\n", + acpi_device_name(button->device)); + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_button_add_fs ( + struct acpi_device *device) +{ + static struct proc_dir_entry *power_entry; + static struct proc_dir_entry *sleep_entry; + static struct proc_dir_entry *lid_entry; + struct proc_dir_entry *entry = NULL; + struct acpi_button *button = NULL; + + ACPI_FUNCTION_TRACE("acpi_button_add_fs"); + + if (!device || !acpi_driver_data(device)) + return_VALUE(-EINVAL); + + button = acpi_driver_data(device); + + if (!acpi_button_dir) { + acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir); + if (!acpi_button_dir) + return_VALUE(-ENODEV); + } + + switch (button->type) { + case ACPI_BUTTON_TYPE_POWER: + case ACPI_BUTTON_TYPE_POWERF: + if (!power_entry) + power_entry = proc_mkdir(ACPI_BUTTON_SUBCLASS_POWER, + acpi_button_dir); + entry = power_entry; + break; + case ACPI_BUTTON_TYPE_SLEEP: + case ACPI_BUTTON_TYPE_SLEEPF: + if (!sleep_entry) + sleep_entry = proc_mkdir(ACPI_BUTTON_SUBCLASS_SLEEP, + acpi_button_dir); + entry = sleep_entry; + break; + case ACPI_BUTTON_TYPE_LID: + if (!lid_entry) + lid_entry = proc_mkdir(ACPI_BUTTON_SUBCLASS_LID, + acpi_button_dir); + entry = lid_entry; + break; + } + + acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry); + if (!acpi_device_dir(device)) + return_VALUE(-ENODEV); + + /* 'info' [R] */ + entry = create_proc_entry(ACPI_BUTTON_FILE_INFO, + S_IRUGO, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_BUTTON_FILE_INFO)); + else { + entry->read_proc = acpi_button_read_info; + entry->data = acpi_driver_data(device); + } + + return_VALUE(0); +} + + +static int +acpi_button_remove_fs ( + struct acpi_device *device) +{ + ACPI_FUNCTION_TRACE("acpi_button_remove_fs"); + + if (!acpi_button_dir) + return_VALUE(-ENODEV); + + if (acpi_device_dir(device)) + remove_proc_entry(acpi_device_bid(device), acpi_button_dir); + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Driver Interface + -------------------------------------------------------------------------- */ + +void +acpi_button_notify ( + acpi_handle handle, + u32 event, + void *data) +{ + struct acpi_button *button = (struct acpi_button *) data; + + ACPI_FUNCTION_TRACE("acpi_button_notify"); + + if (!button || !button->device) + return_VOID; + + switch (event) { + case ACPI_BUTTON_NOTIFY_STATUS: + acpi_bus_generate_event(button->device, event, ++button->pushed); + break; + default: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Unsupported event [0x%x]\n", event)); + break; + } + + return_VOID; +} + + +acpi_status +acpi_button_notify_fixed ( + void *data) +{ + struct acpi_button *button = (struct acpi_button *) data; + + ACPI_FUNCTION_TRACE("acpi_button_notify_fixed"); + + if (!button) + return_ACPI_STATUS(AE_BAD_PARAMETER); + + acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button); + + return_ACPI_STATUS(AE_OK); +} + + +int +acpi_button_add ( + struct acpi_device *device) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_button *button = NULL; + + ACPI_FUNCTION_TRACE("acpi_button_add"); + + if (!device) + return_VALUE(-EINVAL); + + button = kmalloc(sizeof(struct acpi_button), GFP_KERNEL); + if (!button) + return_VALUE(-ENOMEM); + memset(button, 0, sizeof(struct acpi_button)); + + button->device = device; + button->handle = device->handle; + acpi_driver_data(device) = button; + + /* + * Determine the button type (via hid), as fixed-feature buttons + * need to be handled a bit differently than generic-space. + */ + if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWER)) { + button->type = ACPI_BUTTON_TYPE_POWER; + sprintf(acpi_device_name(device), "%s", + ACPI_BUTTON_DEVICE_NAME_POWER); + sprintf(acpi_device_class(device), "%s/%s", + ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER); + } + else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWERF)) { + button->type = ACPI_BUTTON_TYPE_POWERF; + sprintf(acpi_device_name(device), "%s", + ACPI_BUTTON_DEVICE_NAME_POWERF); + sprintf(acpi_device_class(device), "%s/%s", + ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER); + } + else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEP)) { + button->type = ACPI_BUTTON_TYPE_SLEEP; + sprintf(acpi_device_name(device), "%s", + ACPI_BUTTON_DEVICE_NAME_SLEEP); + sprintf(acpi_device_class(device), "%s/%s", + ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP); + } + else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEPF)) { + button->type = ACPI_BUTTON_TYPE_SLEEPF; + sprintf(acpi_device_name(device), "%s", + ACPI_BUTTON_DEVICE_NAME_SLEEPF); + sprintf(acpi_device_class(device), "%s/%s", + ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP); + } + else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_LID)) { + button->type = ACPI_BUTTON_TYPE_LID; + sprintf(acpi_device_name(device), "%s", + ACPI_BUTTON_DEVICE_NAME_LID); + sprintf(acpi_device_class(device), "%s/%s", + ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID); + } + else { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unsupported hid [%s]\n", + acpi_device_hid(device))); + result = -ENODEV; + goto end; + } + + result = acpi_button_add_fs(device); + if (0 != result) + goto end; + + switch (button->type) { + case ACPI_BUTTON_TYPE_POWERF: + status = acpi_install_fixed_event_handler ( + ACPI_EVENT_POWER_BUTTON, + acpi_button_notify_fixed, + button); + break; + case ACPI_BUTTON_TYPE_SLEEPF: + status = acpi_install_fixed_event_handler ( + ACPI_EVENT_SLEEP_BUTTON, + acpi_button_notify_fixed, + button); + break; + default: + status = acpi_install_notify_handler ( + button->handle, + ACPI_DEVICE_NOTIFY, + acpi_button_notify, + button); + break; + } + + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error installing notify handler\n")); + result = -ENODEV; + goto end; + } + + printk(KERN_INFO PREFIX "%s [%s]\n", + acpi_device_name(device), acpi_device_bid(device)); + +end: + if (0 != result) { + acpi_button_remove_fs(device); + kfree(button); + } + + return_VALUE(result); +} + + +int +acpi_button_remove (struct acpi_device *device, int type) +{ + acpi_status status = 0; + struct acpi_button *button = NULL; + + ACPI_FUNCTION_TRACE("acpi_button_remove"); + + if (!device || !acpi_driver_data(device)) + return_VALUE(-EINVAL); + + button = acpi_driver_data(device); + + /* Unregister for device notifications. */ + switch (button->type) { + case ACPI_BUTTON_TYPE_POWERF: + status = acpi_remove_fixed_event_handler( + ACPI_EVENT_POWER_BUTTON, acpi_button_notify_fixed); + break; + case ACPI_BUTTON_TYPE_SLEEPF: + status = acpi_remove_fixed_event_handler( + ACPI_EVENT_SLEEP_BUTTON, acpi_button_notify_fixed); + break; + default: + status = acpi_remove_notify_handler(button->handle, + ACPI_DEVICE_NOTIFY, acpi_button_notify); + break; + } + + if (ACPI_FAILURE(status)) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); + + acpi_button_remove_fs(device); + + kfree(button); + + return_VALUE(0); +} + + +static int __init +acpi_button_init (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_button_init"); + + result = acpi_bus_register_driver(&acpi_button_driver); + if (0 > result) + return_VALUE(-ENODEV); + + return_VALUE(0); +} + + +static void __exit +acpi_button_exit (void) +{ + ACPI_FUNCTION_TRACE("acpi_button_exit"); + + acpi_bus_unregister_driver(&acpi_button_driver); + + return_VOID; +} + + +module_init(acpi_button_init); +module_exit(acpi_button_exit); diff -urN linux-2.4.18/drivers/acpi/debugger/Makefile lia64-2.4/drivers/acpi/debugger/Makefile --- linux-2.4.18/drivers/acpi/debugger/Makefile Mon Sep 24 15:06:37 2001 +++ lia64-2.4/drivers/acpi/debugger/Makefile Tue Apr 9 15:46:58 2002 @@ -1,11 +1,10 @@ # # Makefile for all Linux ACPI interpreter subdirectories -# EXCEPT for the ospm directory # O_TARGET := $(notdir $(CURDIR)).o -obj-$(CONFIG_ACPI) := $(patsubst %.c,%.o,$(wildcard *.c)) +obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c)) EXTRA_CFLAGS += $(ACPI_CFLAGS) diff -urN linux-2.4.18/drivers/acpi/debugger/dbcmds.c lia64-2.4/drivers/acpi/debugger/dbcmds.c --- linux-2.4.18/drivers/acpi/debugger/dbcmds.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/debugger/dbcmds.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: dbcmds - debug commands and output routines - * $Revision: 66 $ + * $Revision: 83 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,21 +25,17 @@ #include "acpi.h" -#include "acparser.h" #include "acdispat.h" #include "amlcode.h" #include "acnamesp.h" -#include "acparser.h" #include "acevents.h" -#include "acinterp.h" #include "acdebug.h" -#include "actables.h" #include "acresrc.h" #ifdef ENABLE_DEBUGGER #define _COMPONENT ACPI_DEBUGGER - MODULE_NAME ("dbcmds") + ACPI_MODULE_NAME ("dbcmds") /* @@ -47,7 +43,7 @@ * These object types map directly to the ACPI_TYPES */ -ARGUMENT_INFO acpi_db_object_types [] = +static ARGUMENT_INFO acpi_db_object_types [] = { {"ANY"}, {"NUMBERS"}, {"STRINGS"}, @@ -79,6 +75,8 @@ * DESCRIPTION: Check if this namespace object refers to the target object * that is passed in as the context value. * + * Note: Currently doesn't check subobjects within the Node's object + * ******************************************************************************/ acpi_status @@ -95,20 +93,13 @@ /* Check for match against the namespace node itself */ if (node == (void *) obj_desc) { - acpi_os_printf ("Object is a Node [%4.4s]\n", &node->name); + acpi_os_printf ("Object is a Node [%4.4s]\n", node->name.ascii); } /* Check for match against the object attached to the node */ - if (node->object == obj_desc) { - acpi_os_printf ("Reference at Node->Object %p [%4.4s]\n", node, &node->name); - } - - /* Check first child for a match */ - /* TBD: [Investigate] probably now obsolete with new datastructure */ - - if (node->child == (void *) obj_desc) { - acpi_os_printf ("Reference at Node->Child %p [%4.4s]\n", node, &node->name); + if (acpi_ns_get_attached_object (node) == obj_desc) { + acpi_os_printf ("Reference at Node->Object %p [%4.4s]\n", node, node->name.ascii); } return (AE_OK); @@ -136,11 +127,11 @@ /* Convert string to object pointer */ - obj_desc = (acpi_operand_object *) STRTOUL (object_arg, NULL, 16); + obj_desc = ACPI_TO_POINTER (ACPI_STRTOUL (object_arg, NULL, 16)); /* Search all nodes in namespace */ - acpi_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, + (void) acpi_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, acpi_db_walk_for_references, (void *) obj_desc, NULL); } @@ -227,7 +218,7 @@ /* Search all tables for the target type */ for (i = 0; i < NUM_ACPI_TABLES; i++) { - if (!STRNCMP (table_arg, acpi_gbl_acpi_table_data[i].signature, + if (!ACPI_STRNCMP (table_arg, acpi_gbl_acpi_table_data[i].signature, acpi_gbl_acpi_table_data[i].sig_length)) { /* Found the table, unload it */ @@ -279,14 +270,14 @@ /* Get and verify the breakpoint address */ - address = STRTOUL (location, NULL, 16); - if (address <= op->aml_offset) { - acpi_os_printf ("Breakpoint %X is beyond current address %X\n", address, op->aml_offset); + address = ACPI_STRTOUL (location, NULL, 16); + if (address <= op->common.aml_offset) { + acpi_os_printf ("Breakpoint %X is beyond current address %X\n", address, op->common.aml_offset); } /* Save breakpoint in current walk */ - walk_state->method_breakpoint = address; + walk_state->user_breakpoint = address; acpi_os_printf ("Breakpoint set at AML offset %X\n", address); } @@ -348,10 +339,9 @@ } if (statements) { - num_statements = STRTOUL (statements, NULL, 0); + num_statements = ACPI_STRTOUL (statements, NULL, 0); } - acpi_db_display_op (NULL, op, num_statements); } @@ -385,13 +375,13 @@ /* Check if numeric argument, must be a Node */ if ((start_arg[0] >= 0x30) && (start_arg[0] <= 0x39)) { - subtree_entry = (acpi_handle) STRTOUL (start_arg, NULL, 16); + subtree_entry = ACPI_TO_POINTER (ACPI_STRTOUL (start_arg, NULL, 16)); if (!acpi_os_readable (subtree_entry, sizeof (acpi_namespace_node))) { acpi_os_printf ("Address %p is invalid in this address space\n", subtree_entry); return; } - if (!VALID_DESCRIPTOR_TYPE ((subtree_entry), ACPI_DESC_TYPE_NAMED)) { + if (ACPI_GET_DESCRIPTOR_TYPE (subtree_entry) != ACPI_DESC_TYPE_NAMED) { acpi_os_printf ("Address %p is not a valid Named object\n", subtree_entry); return; } @@ -411,19 +401,18 @@ /* Now we can check for the depth argument */ if (depth_arg) { - max_depth = STRTOUL (depth_arg, NULL, 0); + max_depth = ACPI_STRTOUL (depth_arg, NULL, 0); } } - - acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_DUPLICATE_OUTPUT); acpi_os_printf ("ACPI Namespace (from %p subtree):\n", subtree_entry); /* Display the subtree */ - acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_REDIRECTABLE_OUTPUT); acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, max_depth, ACPI_UINT32_MAX, subtree_entry); - acpi_db_set_output_destination (DB_CONSOLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_CONSOLE_OUTPUT); } @@ -450,24 +439,22 @@ u16 owner_id; - owner_id = (u16) STRTOUL (owner_arg, NULL, 0); - + owner_id = (u16) ACPI_STRTOUL (owner_arg, NULL, 0); /* Now we can check for the depth argument */ if (depth_arg) { - max_depth = STRTOUL (depth_arg, NULL, 0); + max_depth = ACPI_STRTOUL (depth_arg, NULL, 0); } - - acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_DUPLICATE_OUTPUT); acpi_os_printf ("ACPI Namespace by owner %X:\n", owner_id); /* Display the subtree */ - acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_REDIRECTABLE_OUTPUT); acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, max_depth, owner_id, subtree_entry); - acpi_db_set_output_destination (DB_CONSOLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_CONSOLE_OUTPUT); } @@ -491,6 +478,7 @@ u32 value) { acpi_namespace_node *node; + acpi_status status; /* Translate name to an Named object */ @@ -508,7 +496,10 @@ /* Send the notify */ - acpi_ev_queue_notify_request (node, value); + status = acpi_ev_queue_notify_request (node, value); + if (ACPI_FAILURE (status)) { + acpi_os_printf ("Could not queue notify\n"); + } break; default: @@ -545,11 +536,12 @@ u32 value; acpi_walk_state *walk_state; acpi_operand_object *obj_desc; + acpi_status status; /* Validate Type_arg */ - STRUPR (type_arg); + ACPI_STRUPR (type_arg); type = type_arg[0]; if ((type != 'L') && (type != 'A')) { @@ -559,8 +551,8 @@ /* Get the index and value */ - index = STRTOUL (index_arg, NULL, 16); - value = STRTOUL (value_arg, NULL, 16); + index = ACPI_STRTOUL (index_arg, NULL, 16); + value = ACPI_STRTOUL (value_arg, NULL, 16); walk_state = acpi_ds_get_current_walk_state (acpi_gbl_current_walk_list); if (!walk_state) { @@ -587,12 +579,16 @@ /* Set a method argument */ - if (index > MTH_NUM_ARGS) { + if (index > MTH_MAX_ARG) { acpi_os_printf ("Arg%d - Invalid argument name\n", index); return; } - acpi_ds_store_object_to_local (AML_ARG_OP, index, obj_desc, walk_state); + status = acpi_ds_store_object_to_local (AML_ARG_OP, index, obj_desc, walk_state); + if (ACPI_FAILURE (status)) { + return; + } + obj_desc = walk_state->arguments[index].object; acpi_os_printf ("Arg%d: ", index); @@ -603,12 +599,16 @@ /* Set a method local */ - if (index > MTH_NUM_LOCALS) { + if (index > MTH_MAX_LOCAL) { acpi_os_printf ("Local%d - Invalid local variable name\n", index); return; } - acpi_ds_store_object_to_local (AML_LOCAL_OP, index, obj_desc, walk_state); + status = acpi_ds_store_object_to_local (AML_LOCAL_OP, index, obj_desc, walk_state); + if (ACPI_FAILURE (status)) { + return; + } + obj_desc = walk_state->local_variables[index].object; acpi_os_printf ("Local%d: ", index); @@ -642,23 +642,22 @@ { acpi_operand_object *obj_desc; acpi_status status; - u32 buf_size; - NATIVE_CHAR buffer[64]; + acpi_buffer buffer; - obj_desc = ((acpi_namespace_node *)obj_handle)->object; - buf_size = sizeof (buffer) / sizeof (*buffer); + obj_desc = acpi_ns_get_attached_object ((acpi_namespace_node *) obj_handle); /* Get and display the full pathname to this object */ - status = acpi_ns_handle_to_pathname (obj_handle, &buf_size, buffer); - + buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; + status = acpi_ns_handle_to_pathname (obj_handle, &buffer); if (ACPI_FAILURE (status)) { acpi_os_printf ("Could Not get pathname for object %p\n", obj_handle); return (AE_OK); } - acpi_os_printf ("%32s", buffer); + acpi_os_printf ("%32s", buffer.pointer); + ACPI_MEM_FREE (buffer.pointer); /* Display short information about the object */ @@ -688,6 +687,10 @@ case ACPI_TYPE_BUFFER: acpi_os_printf (" Length %X", obj_desc->buffer.length); break; + + default: + /* Ignore other object types */ + break; } } @@ -714,7 +717,7 @@ NATIVE_CHAR *obj_type_arg, NATIVE_CHAR *display_count_arg) { - acpi_object_type8 type; + acpi_object_type type; /* Get the object type */ @@ -725,17 +728,17 @@ return (AE_OK); } - acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_DUPLICATE_OUTPUT); acpi_os_printf ("Objects of type [%s] defined in the current ACPI Namespace: \n", acpi_ut_get_type_name (type)); - acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_REDIRECTABLE_OUTPUT); /* Walk the namespace from the root */ - acpi_walk_namespace (type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, + (void) acpi_walk_namespace (type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, acpi_db_walk_for_specific_objects, (void *) &type, NULL); - acpi_db_set_output_destination (DB_CONSOLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_CONSOLE_OUTPUT); return (AE_OK); } @@ -763,8 +766,7 @@ acpi_status status; NATIVE_CHAR *requested_name = (NATIVE_CHAR *) context; u32 i; - u32 buf_size; - NATIVE_CHAR buffer[96]; + acpi_buffer buffer; /* Check for a name match */ @@ -773,7 +775,7 @@ /* Wildcard support */ if ((requested_name[i] != '?') && - (requested_name[i] != ((NATIVE_CHAR *) (&((acpi_namespace_node *) obj_handle)->name))[i])) { + (requested_name[i] != ((acpi_namespace_node *) obj_handle)->name.ascii[i])) { /* No match, just exit */ return (AE_OK); @@ -783,16 +785,15 @@ /* Get the full pathname to this object */ - buf_size = sizeof (buffer) / sizeof (*buffer); - - status = acpi_ns_handle_to_pathname (obj_handle, &buf_size, buffer); + buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; + status = acpi_ns_handle_to_pathname (obj_handle, &buffer); if (ACPI_FAILURE (status)) { acpi_os_printf ("Could Not get pathname for object %p\n", obj_handle); } - else { - acpi_os_printf ("%32s (%p) - %s\n", buffer, obj_handle, + acpi_os_printf ("%32s (%p) - %s\n", buffer.pointer, obj_handle, acpi_ut_get_type_name (((acpi_namespace_node *) obj_handle)->type)); + ACPI_MEM_FREE (buffer.pointer); } return (AE_OK); @@ -817,17 +818,17 @@ NATIVE_CHAR *name_arg) { - if (STRLEN (name_arg) > 4) { + if (ACPI_STRLEN (name_arg) > 4) { acpi_os_printf ("Name must be no longer than 4 characters\n"); return (AE_OK); } /* Walk the namespace from the root */ - acpi_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, + (void) acpi_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, acpi_db_walk_and_match_name, name_arg, NULL); - acpi_db_set_output_destination (DB_CONSOLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_CONSOLE_OUTPUT); return (AE_OK); } @@ -849,6 +850,9 @@ acpi_db_set_scope ( NATIVE_CHAR *name) { + acpi_status status; + acpi_namespace_node *node; + if (!name || name[0] == 0) { acpi_os_printf ("Current scope: %s\n", acpi_gbl_db_scope_buf); @@ -857,19 +861,38 @@ acpi_db_prep_namestring (name); - /* TBD: [Future] Validate scope here */ if (name[0] == '\\') { - STRCPY (acpi_gbl_db_scope_buf, name); - STRCAT (acpi_gbl_db_scope_buf, "\\"); - } + /* Validate new scope from the root */ + + status = acpi_ns_get_node_by_path (name, acpi_gbl_root_node, ACPI_NS_NO_UPSEARCH, &node); + if (ACPI_FAILURE (status)) { + goto error_exit; + } + ACPI_STRCPY (acpi_gbl_db_scope_buf, name); + ACPI_STRCAT (acpi_gbl_db_scope_buf, "\\"); + } else { - STRCAT (acpi_gbl_db_scope_buf, name); - STRCAT (acpi_gbl_db_scope_buf, "\\"); + /* Validate new scope relative to old scope */ + + status = acpi_ns_get_node_by_path (name, acpi_gbl_db_scope_node, ACPI_NS_NO_UPSEARCH, &node); + if (ACPI_FAILURE (status)) { + goto error_exit; + } + + ACPI_STRCAT (acpi_gbl_db_scope_buf, name); + ACPI_STRCAT (acpi_gbl_db_scope_buf, "\\"); } + acpi_gbl_db_scope_node = node; acpi_os_printf ("New scope: %s\n", acpi_gbl_db_scope_buf); + return; + + +error_exit: + + acpi_os_printf ("Could not attach scope: %s, %s\n", name, acpi_format_exception (status)); } @@ -889,24 +912,25 @@ acpi_db_display_resources ( NATIVE_CHAR *object_arg) { -#ifndef _IA16 +#if ACPI_MACHINE_WIDTH != 16 + acpi_operand_object *obj_desc; acpi_status status; acpi_buffer return_obj; - acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_REDIRECTABLE_OUTPUT); + acpi_dbg_level |= ACPI_LV_RESOURCES; /* Convert string to object pointer */ - obj_desc = (acpi_operand_object *) STRTOUL (object_arg, NULL, 16); + obj_desc = ACPI_TO_POINTER (ACPI_STRTOUL (object_arg, NULL, 16)); /* Prepare for a return object of arbitrary size */ return_obj.pointer = acpi_gbl_db_buffer; return_obj.length = ACPI_DEBUG_BUFFER_SIZE; - /* _PRT */ acpi_os_printf ("Evaluating _PRT\n"); @@ -950,10 +974,17 @@ status = acpi_get_current_resources (obj_desc, &return_obj); if (ACPI_FAILURE (status)) { acpi_os_printf ("Acpi_get_current_resources failed: %s\n", acpi_format_exception (status)); + goto get_prs; } else { - acpi_rs_dump_resource_list ((acpi_resource *) acpi_gbl_db_buffer); + acpi_rs_dump_resource_list (ACPI_CAST_PTR (acpi_resource, acpi_gbl_db_buffer)); + } + + status = acpi_set_current_resources (obj_desc, &return_obj); + if (ACPI_FAILURE (status)) { + acpi_os_printf ("Acpi_set_current_resources failed: %s\n", acpi_format_exception (status)); + goto get_prs; } @@ -980,17 +1011,102 @@ } else { - acpi_rs_dump_resource_list ((acpi_resource *) acpi_gbl_db_buffer); + acpi_rs_dump_resource_list (ACPI_CAST_PTR (acpi_resource, acpi_gbl_db_buffer)); } cleanup: - acpi_db_set_output_destination (DB_CONSOLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_CONSOLE_OUTPUT); return; #endif } + +typedef struct +{ + u32 nodes; + u32 objects; +} ACPI_INTEGRITY_INFO; + +/******************************************************************************* + * + * FUNCTION: Acpi_db_integrity_walk + * + * PARAMETERS: Callback from Walk_namespace + * + * RETURN: Status + * + * DESCRIPTION: Examine one NS node for valid values. + * + ******************************************************************************/ + +acpi_status +acpi_db_integrity_walk ( + acpi_handle obj_handle, + u32 nesting_level, + void *context, + void **return_value) +{ + ACPI_INTEGRITY_INFO *info = (ACPI_INTEGRITY_INFO *) context; + acpi_namespace_node *node = (acpi_namespace_node *) obj_handle; + acpi_operand_object *object; + + + info->nodes++; + if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) { + acpi_os_printf ("Invalid Descriptor Type for Node %p, Type = %X\n", + node, ACPI_GET_DESCRIPTOR_TYPE (node)); + } + + if (node->type > INTERNAL_TYPE_MAX) { + acpi_os_printf ("Invalid Object Type for Node %p, Type = %X\n", + node, node->type); + } + + if (!acpi_ut_valid_acpi_name (node->name.integer)) { + acpi_os_printf ("Invalid Acpi_name for Node %p\n", node); + } + + object = acpi_ns_get_attached_object (node); + if (object) { + info->objects++; + if (ACPI_GET_DESCRIPTOR_TYPE (object) != ACPI_DESC_TYPE_OPERAND) { + acpi_os_printf ("Invalid Descriptor Type for Object %p, Type = %X\n", + object, ACPI_GET_DESCRIPTOR_TYPE (object)); + } + } + + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_db_check_integrity + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Check entire namespace for data structure integrity + * + ******************************************************************************/ + +void +acpi_db_check_integrity (void) +{ + ACPI_INTEGRITY_INFO info = {0,0}; + + /* Search all nodes in namespace */ + + (void) acpi_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, + acpi_db_integrity_walk, (void *) &info, NULL); + + acpi_os_printf ("Verified %d namespace nodes with %d Objects\n", info.nodes, info.objects); + +} #endif /* ENABLE_DEBUGGER */ diff -urN linux-2.4.18/drivers/acpi/debugger/dbdisasm.c lia64-2.4/drivers/acpi/debugger/dbdisasm.c --- linux-2.4.18/drivers/acpi/debugger/dbdisasm.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/debugger/dbdisasm.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: dbdisasm - parser op tree display routines - * $Revision: 50 $ + * $Revision: 66 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,14 +34,13 @@ #ifdef ENABLE_DEBUGGER #define _COMPONENT ACPI_DEBUGGER - MODULE_NAME ("dbdisasm") + ACPI_MODULE_NAME ("dbdisasm") -#define MAX_SHOW_ENTRY 128 #define BLOCK_PAREN 1 #define BLOCK_BRACE 2 #define DB_NO_OP_INFO " [%2.2d] " -#define DB_FULL_OP_INFO "%5.5X #%4.4X [%2.2d] " +#define DB_FULL_OP_INFO "%5.5X #%4.4hX [%2.2d] " NATIVE_CHAR *acpi_gbl_db_disasm_indent = "...."; @@ -64,17 +63,15 @@ acpi_parse_object *op) { - switch (op->opcode) { + switch (op->common.aml_opcode) { case AML_METHOD_OP: return (BLOCK_BRACE); - break; default: break; } return (BLOCK_PAREN); - } @@ -101,11 +98,23 @@ acpi_parse_object *op) { acpi_parse_object *target_op; + char *name; + if (op->common.flags & ACPI_PARSEOP_GENERIC) { + name = op->common.value.name; + if (name[0] == '\\') { + acpi_os_printf (" (Fully Qualified Pathname)"); + return (AE_OK); + } + } + else { + name = (char *) &op->named.name; + } + /* Search parent tree up to the root if necessary */ - target_op = acpi_ps_find (op, op->value.name, 0, 0); + target_op = acpi_ps_find (op, name, 0, 0); if (!target_op) { /* * Didn't find the name in the parse tree. This may be @@ -115,7 +124,6 @@ */ acpi_os_printf (" **** Path not found in parse tree"); } - else { /* The target was found, print the name and complete path */ @@ -136,8 +144,7 @@ { acpi_status status; acpi_namespace_node *node; - NATIVE_CHAR buffer[MAX_SHOW_ENTRY]; - u32 buffer_size = MAX_SHOW_ENTRY; + acpi_buffer buffer; u32 debug_level; @@ -148,12 +155,12 @@ /* Just get the Node out of the Op object */ - node = op->node; + node = op->common.node; if (!node) { /* Node not defined in this scope, look it up */ - status = acpi_ns_lookup (walk_state->scope_info, op->value.string, ACPI_TYPE_ANY, - IMODE_EXECUTE, NS_SEARCH_PARENT, walk_state, &(node)); + status = acpi_ns_lookup (walk_state->scope_info, op->common.value.string, ACPI_TYPE_ANY, + ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node)); if (ACPI_FAILURE (status)) { /* @@ -167,18 +174,20 @@ /* Save it for next time. */ - op->node = node; + op->common.node = node; } /* Convert Named_desc/handle to a full pathname */ - status = acpi_ns_handle_to_pathname (node, &buffer_size, buffer); + buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; + status = acpi_ns_handle_to_pathname (node, &buffer); if (ACPI_FAILURE (status)) { acpi_os_printf ("****Could not get pathname****)"); goto exit; } - acpi_os_printf (" (Path %s)", buffer); + acpi_os_printf (" (Path %s)", buffer.pointer); + ACPI_MEM_FREE (buffer.pointer); exit: @@ -219,118 +228,116 @@ u32 j; - if (op) { - while (op) { - /* indentation */ - - depth_count = 0; - if (!acpi_gbl_db_opt_verbose) { - depth_count++; + if (!op) { + acpi_db_display_opcode (walk_state, op); + return; + } + + + while (op) { + /* Indentation */ + + depth_count = 0; + if (!acpi_gbl_db_opt_verbose) { + depth_count++; + } + + /* Determine the nesting depth of this argument */ + + for (depth = op->common.parent; depth; depth = depth->common.parent) { + arg = acpi_ps_get_arg (depth, 0); + while (arg && arg != origin) { + arg = arg->common.next; } - /* Determine the nesting depth of this argument */ + if (arg) { + break; + } - for (depth = op->parent; depth; depth = depth->parent) { - arg = acpi_ps_get_arg (depth, 0); - while (arg && arg != origin) { - arg = arg->next; - } + depth_count++; + } - if (arg) { - break; - } + /* Open a new block if we are nested further than last time */ - depth_count++; + if (depth_count > last_depth) { + VERBOSE_PRINT ((DB_NO_OP_INFO, last_depth)); + for (i = 0; i < last_depth; i++) { + acpi_os_printf ("%s", acpi_gbl_db_disasm_indent); } + if (acpi_db_block_type (op) == BLOCK_PAREN) { + acpi_os_printf ("(\n"); + } + else { + acpi_os_printf ("{\n"); + } + } - /* Open a new block if we are nested further than last time */ + /* Close a block if we are nested less than last time */ - if (depth_count > last_depth) { - VERBOSE_PRINT ((DB_NO_OP_INFO, last_depth)); - for (i = 0; i < last_depth; i++) { + else if (depth_count < last_depth) { + for (j = last_depth; j >= (depth_count + 1); j--) { + VERBOSE_PRINT ((DB_NO_OP_INFO, (j - 1))); + for (i = 1; i < j; i++) { acpi_os_printf ("%s", acpi_gbl_db_disasm_indent); } if (acpi_db_block_type (op) == BLOCK_PAREN) { - acpi_os_printf ("(\n"); + acpi_os_printf (")\n"); } else { - acpi_os_printf ("{\n"); + acpi_os_printf ("}\n"); } } + } - /* Close a block if we are nested less than last time */ - - else if (depth_count < last_depth) { - for (j = 0; j < (last_depth - depth_count); j++) { - VERBOSE_PRINT ((DB_NO_OP_INFO, last_depth - j)); - for (i = 0; i < (last_depth - j - 1); i++) { - acpi_os_printf ("%s", acpi_gbl_db_disasm_indent); - } - - if (acpi_db_block_type (op) == BLOCK_PAREN) { - acpi_os_printf (")\n"); - } - else { - acpi_os_printf ("}\n"); - } - } - } - - /* In verbose mode, print the AML offset, opcode and depth count */ - - VERBOSE_PRINT ((DB_FULL_OP_INFO, (unsigned) op->aml_offset, op->opcode, depth_count)); + /* In verbose mode, print the AML offset, opcode and depth count */ + VERBOSE_PRINT ((DB_FULL_OP_INFO, (u32) op->common.aml_offset, + op->common.aml_opcode, depth_count)); - /* Indent the output according to the depth count */ - for (i = 0; i < depth_count; i++) { - acpi_os_printf ("%s", acpi_gbl_db_disasm_indent); - } + /* Indent the output according to the depth count */ + for (i = 0; i < depth_count; i++) { + acpi_os_printf ("%s", acpi_gbl_db_disasm_indent); + } - /* Now print the opcode */ + /* Now print the opcode */ - acpi_db_display_opcode (walk_state, op); + acpi_db_display_opcode (walk_state, op); - /* Resolve a name reference */ + /* Resolve a name reference */ - if ((op->opcode == AML_INT_NAMEPATH_OP && op->value.name) && - (op->parent) && - (acpi_gbl_db_opt_verbose)) { - acpi_ps_display_object_pathname (walk_state, op); - } + if ((op->common.aml_opcode == AML_INT_NAMEPATH_OP && op->common.value.name) && + (op->common.parent) && + (acpi_gbl_db_opt_verbose)) { + (void) acpi_ps_display_object_pathname (walk_state, op); + } - acpi_os_printf ("\n"); + acpi_os_printf ("\n"); - /* Get the next node in the tree */ + /* Get the next node in the tree */ - op = acpi_ps_get_depth_next (origin, op); - last_depth = depth_count; + op = acpi_ps_get_depth_next (origin, op); + last_depth = depth_count; - num_opcodes--; - if (!num_opcodes) { - op = NULL; - } + num_opcodes--; + if (!num_opcodes) { + op = NULL; } + } - /* Close the last block(s) */ + /* Close the last block(s) */ - depth_count = last_depth -1; - for (i = 0; i < last_depth; i++) { - VERBOSE_PRINT ((DB_NO_OP_INFO, last_depth - i)); - for (j = 0; j < depth_count; j++) { - acpi_os_printf ("%s", acpi_gbl_db_disasm_indent); - } - acpi_os_printf ("}\n"); - depth_count--; + depth_count = last_depth -1; + for (i = 0; i < last_depth; i++) { + VERBOSE_PRINT ((DB_NO_OP_INFO, last_depth - i)); + for (j = 0; j < depth_count; j++) { + acpi_os_printf ("%s", acpi_gbl_db_disasm_indent); } - - } - - else { - acpi_db_display_opcode (walk_state, op); + acpi_os_printf ("}\n"); + depth_count--; } } @@ -352,7 +359,6 @@ NATIVE_CHAR *name) { u32 seg_count; - u8 do_dot = FALSE; if (!name) { @@ -360,21 +366,27 @@ return; } - if (acpi_ps_is_prefix_char (GET8 (name))) { - /* append prefix character */ + /* Handle all Scope Prefix operators */ + + while (acpi_ps_is_prefix_char (ACPI_GET8 (name))) { + /* Append prefix character */ - acpi_os_printf ("%1c", GET8 (name)); + acpi_os_printf ("%1c", ACPI_GET8 (name)); name++; } - switch (GET8 (name)) { + switch (ACPI_GET8 (name)) { + case 0: + seg_count = 0; + break; + case AML_DUAL_NAME_PREFIX: seg_count = 2; name++; break; case AML_MULTI_NAME_PREFIX_OP: - seg_count = (u32) GET8 (name + 1); + seg_count = (u32) ACPI_GET8 (name + 1); name += 2; break; @@ -383,19 +395,18 @@ break; } - while (seg_count--) { - /* append Name segment */ + while (seg_count) { + /* Append Name segment */ + + acpi_os_printf ("%4.4s", name); - if (do_dot) { - /* append dot */ + seg_count--; + if (seg_count) { + /* Not last name, append dot separator */ acpi_os_printf ("."); } - - acpi_os_printf ("%4.4s", name); - do_dot = TRUE; - - name += 4; + name += ACPI_NAME_SIZE; } } @@ -428,16 +439,15 @@ /* We are only interested in named objects */ - op_info = acpi_ps_get_opcode_info (op->opcode); + op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); if (!(op_info->flags & AML_NSNODE)) { return; } - if (op_info->flags & AML_CREATE) { /* Field creation - check for a fully qualified namepath */ - if (op->opcode == AML_CREATE_FIELD_OP) { + if (op->common.aml_opcode == AML_CREATE_FIELD_OP) { name_path = acpi_ps_get_arg (op, 3); } else { @@ -445,9 +455,9 @@ } if ((name_path) && - (name_path->value.string) && - (name_path->value.string[0] == '\\')) { - acpi_db_display_namestring (name_path->value.string); + (name_path->common.value.string) && + (name_path->common.value.string[0] == '\\')) { + acpi_db_display_namestring (name_path->common.value.string); return; } } @@ -459,17 +469,17 @@ search = op; for (; ;) { - if (search->parent == prev) { + if (search->common.parent == prev) { break; } /* Go up one level */ - search = search->parent; + search = search->common.parent; } if (prev) { - op_info = acpi_ps_get_opcode_info (search->opcode); + op_info = acpi_ps_get_opcode_info (search->common.aml_opcode); if (!(op_info->flags & AML_FIELD)) { /* below root scope, append scope name */ @@ -480,7 +490,7 @@ } if (op_info->flags & AML_CREATE) { - if (op->opcode == AML_CREATE_FIELD_OP) { + if (op->common.aml_opcode == AML_CREATE_FIELD_OP) { name_path = acpi_ps_get_arg (op, 3); } else { @@ -488,11 +498,10 @@ } if ((name_path) && - (name_path->value.string)) { - acpi_os_printf ("%4.4s", name_path->value.string); + (name_path->common.value.string)) { + acpi_os_printf ("%4.4s", name_path->common.value.string); } } - else { name = acpi_ps_get_name (search); acpi_os_printf ("%4.4s", &name); @@ -536,134 +545,119 @@ if (!op) { acpi_os_printf (""); + return; } - /* op and arguments */ - switch (op->opcode) { - + switch (op->common.aml_opcode) { case AML_BYTE_OP: if (acpi_gbl_db_opt_verbose) { - acpi_os_printf ("(u8) 0x%2.2X", op->value.integer8); + acpi_os_printf ("(u8) 0x%2.2hX", op->common.value.integer8); } - else { - acpi_os_printf ("0x%2.2X", op->value.integer8); + acpi_os_printf ("0x%2.2hX", op->common.value.integer8); } - break; case AML_WORD_OP: if (acpi_gbl_db_opt_verbose) { - acpi_os_printf ("(u16) 0x%4.4X", op->value.integer16); + acpi_os_printf ("(u16) 0x%4.4hX", op->common.value.integer16); } - else { - acpi_os_printf ("0x%4.4X", op->value.integer16); + acpi_os_printf ("0x%4.4hX", op->common.value.integer16); } - break; case AML_DWORD_OP: if (acpi_gbl_db_opt_verbose) { - acpi_os_printf ("(u32) 0x%8.8X", op->value.integer32); + acpi_os_printf ("(u32) 0x%8.8X", op->common.value.integer32); } - else { - acpi_os_printf ("0x%8.8X", op->value.integer32); + acpi_os_printf ("0x%8.8X", op->common.value.integer32); } - break; case AML_QWORD_OP: if (acpi_gbl_db_opt_verbose) { - acpi_os_printf ("(u64) 0x%8.8X%8.8X", op->value.integer64.hi, - op->value.integer64.lo); + acpi_os_printf ("(u64) 0x%8.8X%8.8X", op->common.value.integer64.hi, + op->common.value.integer64.lo); } - else { - acpi_os_printf ("0x%8.8X%8.8X", op->value.integer64.hi, - op->value.integer64.lo); + acpi_os_printf ("0x%8.8X%8.8X", op->common.value.integer64.hi, + op->common.value.integer64.lo); } - break; case AML_STRING_OP: - if (op->value.string) { - acpi_os_printf ("\"%s\"", op->value.string); + if (op->common.value.string) { + acpi_os_printf ("\"%s\"", op->common.value.string); } - else { acpi_os_printf ("<\"NULL STRING PTR\">"); } - break; case AML_INT_STATICSTRING_OP: - if (op->value.string) { - acpi_os_printf ("\"%s\"", op->value.string); + if (op->common.value.string) { + acpi_os_printf ("\"%s\"", op->common.value.string); } - else { acpi_os_printf ("\"\""); } - break; case AML_INT_NAMEPATH_OP: - acpi_db_display_namestring (op->value.name); + acpi_db_display_namestring (op->common.value.name); break; case AML_INT_NAMEDFIELD_OP: - acpi_os_printf ("Named_field (Length 0x%8.8X) ", op->value.integer32); + acpi_os_printf ("Named_field (Length 0x%8.8X) ", op->common.value.integer32); break; case AML_INT_RESERVEDFIELD_OP: - acpi_os_printf ("Reserved_field (Length 0x%8.8X) ", op->value.integer32); + acpi_os_printf ("Reserved_field (Length 0x%8.8X) ", op->common.value.integer32); break; case AML_INT_ACCESSFIELD_OP: - acpi_os_printf ("Access_field (Length 0x%8.8X) ", op->value.integer32); + acpi_os_printf ("Access_field (Length 0x%8.8X) ", op->common.value.integer32); break; case AML_INT_BYTELIST_OP: if (acpi_gbl_db_opt_verbose) { - acpi_os_printf ("Byte_list (Length 0x%8.8X) ", op->value.integer32); + acpi_os_printf ("Byte_list (Length 0x%8.8X) ", op->common.value.integer32); } - else { - acpi_os_printf ("0x%2.2X", op->value.integer32); + acpi_os_printf ("0x%2.2X", op->common.value.integer32); - byte_count = op->value.integer32; - byte_data = ((acpi_parse2_object *) op)->data; + byte_count = op->common.value.integer32; + byte_data = op->named.data; for (i = 0; i < byte_count; i++) { acpi_os_printf (", 0x%2.2X", byte_data[i]); } } - break; @@ -671,25 +665,25 @@ /* Just get the opcode name and print it */ - op_info = acpi_ps_get_opcode_info (op->opcode); + op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); acpi_os_printf ("%s", op_info->name); #ifndef PARSER_ONLY - if ((op->opcode == AML_INT_RETURN_VALUE_OP) && + if ((op->common.aml_opcode == AML_INT_RETURN_VALUE_OP) && + (walk_state) && (walk_state->results) && (walk_state->results->results.num_results)) { acpi_db_decode_internal_object (walk_state->results->results.obj_desc [walk_state->results->results.num_results-1]); } #endif - break; } if (!op_info) { /* If there is another element in the list, add a comma */ - if (op->next) { + if (op->common.next) { acpi_os_printf (","); } } @@ -697,19 +691,16 @@ /* * If this is a named opcode, print the associated name value */ - op_info = acpi_ps_get_opcode_info (op->opcode); + op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); if (op && (op_info->flags & AML_NAMED)) { name = acpi_ps_get_name (op); acpi_os_printf (" %4.4s", &name); - if (acpi_gbl_db_opt_verbose) { - acpi_os_printf (" (Path \\"); - acpi_db_display_path (op); - acpi_os_printf (")"); + if ((acpi_gbl_db_opt_verbose) && (op->common.aml_opcode != AML_INT_NAMEDFIELD_OP)) { + (void) acpi_ps_display_object_pathname (walk_state, op); } } } - #endif /* ENABLE_DEBUGGER */ diff -urN linux-2.4.18/drivers/acpi/debugger/dbdisply.c lia64-2.4/drivers/acpi/debugger/dbdisply.c --- linux-2.4.18/drivers/acpi/debugger/dbdisply.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/debugger/dbdisply.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: dbdisply - debug display commands - * $Revision: 57 $ + * $Revision: 73 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,12 +25,10 @@ #include "acpi.h" -#include "acparser.h" #include "amlcode.h" #include "acdispat.h" #include "acnamesp.h" #include "acparser.h" -#include "acevents.h" #include "acinterp.h" #include "acdebug.h" @@ -39,7 +37,7 @@ #define _COMPONENT ACPI_DEBUGGER - MODULE_NAME ("dbdisply") + ACPI_MODULE_NAME ("dbdisply") /****************************************************************************** @@ -61,7 +59,7 @@ void *obj_ptr; -#ifdef _IA16 +#if ACPI_MACHINE_WIDTH == 16 #include /* Have to handle 16-bit pointers of the form segment:offset */ @@ -75,8 +73,7 @@ /* Simple flat pointer */ - obj_ptr = (void *) STRTOUL (target, NULL, 16); - + obj_ptr = ACPI_TO_POINTER (ACPI_STRTOUL (target, NULL, 16)); #endif return (obj_ptr); @@ -102,16 +99,16 @@ const acpi_opcode_info *info; - info = acpi_ps_get_opcode_info (op->opcode); + info = acpi_ps_get_opcode_info (op->common.aml_opcode); acpi_os_printf ("Parser Op Descriptor:\n"); - acpi_os_printf ("%20.20s : %4.4X\n", "Opcode", op->opcode); + acpi_os_printf ("%20.20s : %4.4X\n", "Opcode", op->common.aml_opcode); - DEBUG_ONLY_MEMBERS (acpi_os_printf ("%20.20s : %s\n", "Opcode Name", info->name)); + ACPI_DEBUG_ONLY_MEMBERS (acpi_os_printf ("%20.20s : %s\n", "Opcode Name", info->name)); - acpi_os_printf ("%20.20s : %p\n", "Value/Arg_list", op->value); - acpi_os_printf ("%20.20s : %p\n", "Parent", op->parent); - acpi_os_printf ("%20.20s : %p\n", "Next_op", op->next); + acpi_os_printf ("%20.20s : %p\n", "Value/Arg_list", op->common.value.arg); + acpi_os_printf ("%20.20s : %p\n", "Parent", op->common.parent); + acpi_os_printf ("%20.20s : %p\n", "Next_op", op->common.next); } @@ -136,6 +133,7 @@ { void *obj_ptr; acpi_namespace_node *node; + acpi_operand_object *obj_desc; u32 display = DB_BYTE_DISPLAY; NATIVE_CHAR buffer[80]; acpi_buffer ret_buf; @@ -150,7 +148,7 @@ /* Decode the output type */ if (output_type) { - STRUPR (output_type); + ACPI_STRUPR (output_type); if (output_type[0] == 'W') { display = DB_WORD_DISPLAY; } @@ -162,7 +160,6 @@ } } - ret_buf.length = sizeof (buffer); ret_buf.pointer = buffer; @@ -177,8 +174,10 @@ /* Decode the object type */ - if (VALID_DESCRIPTOR_TYPE ((obj_ptr), ACPI_DESC_TYPE_NAMED)) { - /* This is a Node */ + switch (ACPI_GET_DESCRIPTOR_TYPE (obj_ptr)) { + case ACPI_DESC_TYPE_NAMED: + + /* This is a namespace Node */ if (!acpi_os_readable (obj_ptr, sizeof (acpi_namespace_node))) { acpi_os_printf ("Cannot read entire Named object at address %p\n", obj_ptr); @@ -187,10 +186,11 @@ node = obj_ptr; goto dump_nte; - } - else if (VALID_DESCRIPTOR_TYPE ((obj_ptr), ACPI_DESC_TYPE_INTERNAL)) { - /* This is an ACPI OBJECT */ + + case ACPI_DESC_TYPE_OPERAND: + + /* This is a ACPI OPERAND OBJECT */ if (!acpi_os_readable (obj_ptr, sizeof (acpi_operand_object))) { acpi_os_printf ("Cannot read entire ACPI object at address %p\n", obj_ptr); @@ -199,22 +199,27 @@ acpi_ut_dump_buffer (obj_ptr, sizeof (acpi_operand_object), display, ACPI_UINT32_MAX); acpi_ex_dump_object_descriptor (obj_ptr, 1); - } + break; - else if (VALID_DESCRIPTOR_TYPE ((obj_ptr), ACPI_DESC_TYPE_PARSER)) { - /* This is an Parser Op object */ + + case ACPI_DESC_TYPE_PARSER: + + /* This is a Parser Op object */ if (!acpi_os_readable (obj_ptr, sizeof (acpi_parse_object))) { acpi_os_printf ("Cannot read entire Parser object at address %p\n", obj_ptr); return; } - acpi_ut_dump_buffer (obj_ptr, sizeof (acpi_parse_object), display, ACPI_UINT32_MAX); acpi_db_dump_parser_descriptor ((acpi_parse_object *) obj_ptr); - } + break; + + + default: + + /* Is not a recognizeable object */ - else { size = 16; if (acpi_os_readable (obj_ptr, 64)) { size = 64; @@ -223,12 +228,12 @@ /* Just dump some memory */ acpi_ut_dump_buffer (obj_ptr, size, display, ACPI_UINT32_MAX); + break; } return; } - /* The parameter is a name string that must be resolved to a Named obj */ node = acpi_db_local_ns_lookup (target); @@ -257,15 +262,16 @@ acpi_ut_dump_buffer ((void *) node, sizeof (acpi_namespace_node), display, ACPI_UINT32_MAX); acpi_ex_dump_node (node, 1); - if (node->object) { - acpi_os_printf ("\n_attached Object (%p):\n", node->object); - if (!acpi_os_readable (node->object, sizeof (acpi_operand_object))) { - acpi_os_printf ("Invalid internal ACPI Object at address %p\n", node->object); + obj_desc = acpi_ns_get_attached_object (node); + if (obj_desc) { + acpi_os_printf ("\n_attached Object (%p):\n", obj_desc); + if (!acpi_os_readable (obj_desc, sizeof (acpi_operand_object))) { + acpi_os_printf ("Invalid internal ACPI Object at address %p\n", obj_desc); return; } - acpi_ut_dump_buffer ((void *) node->object, sizeof (acpi_operand_object), display, ACPI_UINT32_MAX); - acpi_ex_dump_object_descriptor (node->object, 1); + acpi_ut_dump_buffer ((void *) obj_desc, sizeof (acpi_operand_object), display, ACPI_UINT32_MAX); + acpi_ex_dump_object_descriptor (obj_desc, 1); } } @@ -290,6 +296,7 @@ if (!obj_desc) { + acpi_os_printf (" Uninitialized\n"); return; } @@ -298,8 +305,8 @@ switch (obj_desc->common.type) { case ACPI_TYPE_INTEGER: - acpi_os_printf (" %.8X%.8X", HIDWORD (obj_desc->integer.value), - LODWORD (obj_desc->integer.value)); + acpi_os_printf (" %8.8X%8.8X", ACPI_HIDWORD (obj_desc->integer.value), + ACPI_LODWORD (obj_desc->integer.value)); break; @@ -326,6 +333,11 @@ acpi_os_printf (" %2.2X", obj_desc->buffer.pointer[i]); } break; + + + default: + /* No additional display for other types */ + break; } } @@ -358,29 +370,35 @@ return; } - /* Decode the object type */ - else if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_PARSER)) { + switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) { + case ACPI_DESC_TYPE_PARSER: + acpi_os_printf (" "); - } + break; + + + case ACPI_DESC_TYPE_NAMED: - else if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) { acpi_os_printf (" Name %4.4s Type-%s", - &((acpi_namespace_node *)obj_desc)->name, + ((acpi_namespace_node *)obj_desc)->name.ascii, acpi_ut_get_type_name (((acpi_namespace_node *) obj_desc)->type)); + if (((acpi_namespace_node *) obj_desc)->flags & ANOBJ_METHOD_ARG) { acpi_os_printf (" [Method Arg]"); } if (((acpi_namespace_node *) obj_desc)->flags & ANOBJ_METHOD_LOCAL) { acpi_os_printf (" [Method Local]"); } - } + break; + + + case ACPI_DESC_TYPE_OPERAND: - else if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_INTERNAL)) { type = obj_desc->common.type; if (type > INTERNAL_TYPE_MAX) { - acpi_os_printf (" Type %x [Invalid Type]", type); + acpi_os_printf (" Type %hX [Invalid Type]", type); return; } @@ -406,10 +424,10 @@ break; case AML_LOCAL_OP: - acpi_os_printf ("[Local%d]", obj_desc->reference.offset); + acpi_os_printf ("[Local%d] ", obj_desc->reference.offset); if (walk_state) { obj_desc = walk_state->local_variables[obj_desc->reference.offset].object; - acpi_os_printf (" %p", obj_desc); + acpi_os_printf ("%p", obj_desc); acpi_db_decode_internal_object (obj_desc); } break; @@ -418,7 +436,7 @@ acpi_os_printf ("[Arg%d] ", obj_desc->reference.offset); if (walk_state) { obj_desc = walk_state->arguments[obj_desc->reference.offset].object; - acpi_os_printf (" %p", obj_desc); + acpi_os_printf ("%p", obj_desc); acpi_db_decode_internal_object (obj_desc); } break; @@ -428,7 +446,7 @@ break; case AML_INDEX_OP: - acpi_os_printf ("[Index] "); + acpi_os_printf ("[Index] "); acpi_db_decode_internal_object (obj_desc->reference.object); break; @@ -444,10 +462,13 @@ acpi_db_decode_internal_object (obj_desc); break; } - } + break; + + + default: - else { acpi_os_printf (" "); + break; } acpi_os_printf ("\n"); @@ -494,18 +515,18 @@ } obj_desc = walk_state->method_desc; - node = walk_state->method_node; + node = walk_state->method_node; - num_args = obj_desc->method.param_count; + num_args = obj_desc->method.param_count; concurrency = obj_desc->method.concurrency; - acpi_os_printf ("Currently executing control method is [%4.4s]\n", &node->name); + acpi_os_printf ("Currently executing control method is [%4.4s]\n", node->name.ascii); acpi_os_printf ("%X arguments, max concurrency = %X\n", num_args, concurrency); root_op = start_op; - while (root_op->parent) { - root_op = root_op->parent; + while (root_op->common.parent) { + root_op = root_op->common.parent; } op = root_op; @@ -522,7 +543,7 @@ /* Decode the opcode */ - op_info = acpi_ps_get_opcode_info (op->opcode); + op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); switch (op_info->class) { case AML_CLASS_ARGUMENT: if (count_remaining) { @@ -546,7 +567,6 @@ break; } - op = acpi_ps_get_depth_next (start_op, op); } @@ -587,9 +607,7 @@ obj_desc = walk_state->method_desc; node = walk_state->method_node; - - - acpi_os_printf ("Local Variables for method [%4.4s]:\n", &node->name); + acpi_os_printf ("Local Variables for method [%4.4s]:\n", node->name.ascii); for (i = 0; i < MTH_NUM_LOCALS; i++) { obj_desc = walk_state->local_variables[i].object; @@ -629,12 +647,13 @@ } obj_desc = walk_state->method_desc; - node = walk_state->method_node; + node = walk_state->method_node; - num_args = obj_desc->method.param_count; + num_args = obj_desc->method.param_count; concurrency = obj_desc->method.concurrency; - acpi_os_printf ("Method [%4.4s] has %X arguments, max concurrency = %X\n", &node->name, num_args, concurrency); + acpi_os_printf ("Method [%4.4s] has %X arguments, max concurrency = %X\n", + node->name.ascii, num_args, concurrency); for (i = 0; i < num_args; i++) { obj_desc = walk_state->arguments[i].object; @@ -679,7 +698,8 @@ num_results = walk_state->results->results.num_results; } - acpi_os_printf ("Method [%4.4s] has %X stacked result objects\n", &node->name, num_results); + acpi_os_printf ("Method [%4.4s] has %X stacked result objects\n", + node->name.ascii, num_results); for (i = 0; i < num_results; i++) { obj_desc = walk_state->results->results.obj_desc[i]; @@ -704,7 +724,6 @@ void acpi_db_display_calling_tree (void) { - u32 i; acpi_walk_state *walk_state; acpi_namespace_node *node; @@ -716,13 +735,12 @@ } node = walk_state->method_node; - acpi_os_printf ("Current Control Method Call Tree\n"); - for (i = 0; walk_state; i++) { + while (walk_state) { node = walk_state->method_node; - acpi_os_printf (" [%4.4s]\n", &node->name); + acpi_os_printf (" [%4.4s]\n", node->name.ascii); walk_state = walk_state->next; } @@ -740,6 +758,10 @@ * * DESCRIPTION: Display the result of an AML opcode * + * Note: Curently only displays the result object if we are single stepping. + * However, this output may be useful in other contexts and could be enabled + * to do so if needed. + * ******************************************************************************/ void @@ -748,10 +770,8 @@ acpi_walk_state *walk_state) { - /* TBD: [Future] We don't always want to display the result. - * For now, only display if single stepping - * however, this output is very useful in other contexts also - */ + /* Only display if single stepping */ + if (!acpi_gbl_cm_single_step) { return; } @@ -780,7 +800,6 @@ acpi_operand_object *obj_desc, acpi_walk_state *walk_state) { - if (!acpi_gbl_cm_single_step) { return; diff -urN linux-2.4.18/drivers/acpi/debugger/dbexec.c lia64-2.4/drivers/acpi/debugger/dbexec.c --- linux-2.4.18/drivers/acpi/debugger/dbexec.c Mon Sep 24 15:06:38 2001 +++ lia64-2.4/drivers/acpi/debugger/dbexec.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: dbexec - debugger control method execution - * $Revision: 34 $ + * $Revision: 41 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,23 +25,15 @@ #include "acpi.h" -#include "acparser.h" -#include "acdispat.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "acparser.h" -#include "acevents.h" -#include "acinterp.h" #include "acdebug.h" -#include "actables.h" #ifdef ENABLE_DEBUGGER #define _COMPONENT ACPI_DEBUGGER - MODULE_NAME ("dbexec") + ACPI_MODULE_NAME ("dbexec") -db_method_info acpi_gbl_db_method_info; +static acpi_db_method_info acpi_gbl_db_method_info; /******************************************************************************* @@ -59,7 +51,7 @@ acpi_status acpi_db_execute_method ( - db_method_info *info, + acpi_db_method_info *info, acpi_buffer *return_obj) { acpi_status status; @@ -77,13 +69,12 @@ if (info->args && info->args[0]) { for (i = 0; info->args[i] && i < MTH_NUM_ARGS; i++) { params[i].type = ACPI_TYPE_INTEGER; - params[i].integer.value = STRTOUL (info->args[i], NULL, 16); + params[i].integer.value = ACPI_STRTOUL (info->args[i], NULL, 16); } param_objects.pointer = params; param_objects.count = i; } - else { /* Setup default parameters */ @@ -103,7 +94,6 @@ return_obj->pointer = acpi_gbl_db_buffer; return_obj->length = ACPI_DEBUG_BUFFER_SIZE; - /* Do the actual method execution */ status = acpi_evaluate_object (NULL, info->pathname, ¶m_objects, return_obj); @@ -129,7 +119,7 @@ void acpi_db_execute_setup ( - db_method_info *info) + acpi_db_method_info *info) { /* Catenate the current scope to the supplied name */ @@ -137,24 +127,24 @@ info->pathname[0] = 0; if ((info->name[0] != '\\') && (info->name[0] != '/')) { - STRCAT (info->pathname, acpi_gbl_db_scope_buf); + ACPI_STRCAT (info->pathname, acpi_gbl_db_scope_buf); } - STRCAT (info->pathname, info->name); + ACPI_STRCAT (info->pathname, info->name); acpi_db_prep_namestring (info->pathname); - acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_DUPLICATE_OUTPUT); acpi_os_printf ("Executing %s\n", info->pathname); if (info->flags & EX_SINGLE_STEP) { acpi_gbl_cm_single_step = TRUE; - acpi_db_set_output_destination (DB_CONSOLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_CONSOLE_OUTPUT); } else { /* No single step, allow redirection to a file */ - acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_REDIRECTABLE_OUTPUT); } } @@ -174,13 +164,14 @@ ******************************************************************************/ u32 -acpi_db_get_outstanding_allocations (void) +acpi_db_get_outstanding_allocations ( + void) { - u32 i; u32 outstanding = 0; - #ifdef ACPI_DBG_TRACK_ALLOCATIONS + u32 i; + for (i = ACPI_MEM_LIST_FIRST_CACHE_LIST; i < ACPI_NUM_MEM_LISTS; i++) { outstanding += (acpi_gbl_memory_lists[i].total_allocated - @@ -248,7 +239,7 @@ allocations = acpi_db_get_outstanding_allocations () - previous_allocations; - acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_DUPLICATE_OUTPUT); if (allocations > 0) { acpi_os_printf ("Outstanding: %ld allocations after execution\n", @@ -271,7 +262,7 @@ } } - acpi_db_set_output_destination (DB_CONSOLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_CONSOLE_OUTPUT); } @@ -288,12 +279,12 @@ * ******************************************************************************/ -void +void ACPI_SYSTEM_XFACE acpi_db_method_thread ( void *context) { acpi_status status; - db_method_info *info = context; + acpi_db_method_info *info = context; u32 i; acpi_buffer return_obj; @@ -311,7 +302,10 @@ /* Signal our completion */ - acpi_os_signal_semaphore (info->thread_gate, 1); + status = acpi_os_signal_semaphore (info->thread_gate, 1); + if (ACPI_FAILURE (status)) { + acpi_os_printf ("Could not signal debugger semaphore\n"); + } } @@ -344,15 +338,14 @@ /* Get the arguments */ - num_threads = STRTOUL (num_threads_arg, NULL, 0); - num_loops = STRTOUL (num_loops_arg, NULL, 0); + num_threads = ACPI_STRTOUL (num_threads_arg, NULL, 0); + num_loops = ACPI_STRTOUL (num_loops_arg, NULL, 0); if (!num_threads || !num_loops) { acpi_os_printf ("Bad argument: Threads %X, Loops %X\n", num_threads, num_loops); return; } - /* Create the synchronization semaphore */ status = acpi_os_create_semaphore (1, 0, &thread_gate); @@ -371,16 +364,17 @@ acpi_db_execute_setup (&acpi_gbl_db_method_info); - /* Create the threads */ acpi_os_printf ("Creating %X threads to execute %X times each\n", num_threads, num_loops); for (i = 0; i < (num_threads); i++) { - acpi_os_queue_for_execution (OSD_PRIORITY_MED, acpi_db_method_thread, &acpi_gbl_db_method_info); + status = acpi_os_queue_for_execution (OSD_PRIORITY_MED, acpi_db_method_thread, &acpi_gbl_db_method_info); + if (ACPI_FAILURE (status)) { + break; + } } - /* Wait for all threads to complete */ i = num_threads; @@ -391,11 +385,11 @@ /* Cleanup and exit */ - acpi_os_delete_semaphore (thread_gate); + (void) acpi_os_delete_semaphore (thread_gate); - acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_DUPLICATE_OUTPUT); acpi_os_printf ("All threads (%X) have completed\n", num_threads); - acpi_db_set_output_destination (DB_CONSOLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_CONSOLE_OUTPUT); } diff -urN linux-2.4.18/drivers/acpi/debugger/dbfileio.c lia64-2.4/drivers/acpi/debugger/dbfileio.c --- linux-2.4.18/drivers/acpi/debugger/dbfileio.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/debugger/dbfileio.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ * * Module Name: dbfileio - Debugger file I/O commands. These can't usually * be used when running the debugger in Ring 0 (Kernel mode) - * $Revision: 53 $ + * $Revision: 63 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,14 +28,12 @@ #include "acpi.h" #include "acdebug.h" #include "acnamesp.h" -#include "acparser.h" -#include "acevents.h" #include "actables.h" #ifdef ENABLE_DEBUGGER #define _COMPONENT ACPI_DEBUGGER - MODULE_NAME ("dbfileio") + ACPI_MODULE_NAME ("dbfileio") /* @@ -64,7 +62,7 @@ * ******************************************************************************/ -acpi_object_type8 +acpi_object_type acpi_db_match_argument ( NATIVE_CHAR *user_argument, ARGUMENT_INFO *arguments) @@ -77,8 +75,8 @@ } for (i = 0; arguments[i].name; i++) { - if (STRSTR (arguments[i].name, user_argument) == arguments[i].name) { - return ((acpi_object_type8) i); + if (ACPI_STRSTR (arguments[i].name, user_argument) == arguments[i].name) { + return (i); } } @@ -141,7 +139,7 @@ acpi_gbl_debug_file = fopen (name, "w+"); if (acpi_gbl_debug_file) { acpi_os_printf ("Debug output file %s opened\n", name); - STRCPY (acpi_gbl_db_debug_filename, name); + ACPI_STRCPY (acpi_gbl_db_debug_filename, name); acpi_gbl_db_output_to_file = TRUE; } else { @@ -167,7 +165,7 @@ * ******************************************************************************/ -acpi_status +static acpi_status acpi_db_load_table( FILE *fp, acpi_table_header **table_ptr, @@ -200,11 +198,11 @@ /* We only support a limited number of table types */ - if (STRNCMP ((char *) table_header.signature, DSDT_SIG, 4) && - STRNCMP ((char *) table_header.signature, PSDT_SIG, 4) && - STRNCMP ((char *) table_header.signature, SSDT_SIG, 4)) { + if (ACPI_STRNCMP ((char *) table_header.signature, DSDT_SIG, 4) && + ACPI_STRNCMP ((char *) table_header.signature, PSDT_SIG, 4) && + ACPI_STRNCMP ((char *) table_header.signature, SSDT_SIG, 4)) { acpi_os_printf ("Table signature is invalid\n"); - DUMP_BUFFER (&table_header, sizeof (acpi_table_header)); + ACPI_DUMP_BUFFER (&table_header, sizeof (acpi_table_header)); return (AE_ERROR); } @@ -224,7 +222,7 @@ /* Copy the header to the buffer */ - MEMCPY (*table_ptr, &table_header, sizeof (table_header)); + ACPI_MEMCPY (*table_ptr, &table_header, sizeof (table_header)); /* Get the rest of the table */ @@ -275,7 +273,7 @@ acpi_table_desc table_info; - FUNCTION_TRACE ("Ae_local_load_table"); + ACPI_FUNCTION_TRACE ("Ae_local_load_table"); if (!table_ptr) { return_ACPI_STATUS (AE_BAD_PARAMETER); @@ -285,7 +283,7 @@ table_info.pointer = table_ptr; - status = acpi_tb_install_table (NULL, &table_info); + status = acpi_tb_install_table (&table_info); if (ACPI_FAILURE (status)) { /* Free table allocated by Acpi_tb_get_table */ @@ -308,27 +306,14 @@ } -/******************************************************************************* - * - * FUNCTION: Acpi_db_load_acpi_table - * - * PARAMETERS: Filname - File where table is located - * - * RETURN: Status - * - * DESCRIPTION: Load an ACPI table from a file - * - ******************************************************************************/ - +#ifdef ACPI_APPLICATION acpi_status -acpi_db_load_acpi_table ( +acpi_db_get_acpi_table ( NATIVE_CHAR *filename) { -#ifdef ACPI_APPLICATION FILE *fp; - acpi_status status; u32 table_length; - + acpi_status status; /* Open the file */ @@ -350,25 +335,52 @@ return (status); } - /* Attempt to recognize and install the table */ + return (AE_OK); + } +#endif + +/******************************************************************************* + * + * FUNCTION: Acpi_db_load_acpi_table + * + * PARAMETERS: Filname - File where table is located + * + * RETURN: Status + * + * DESCRIPTION: Load an ACPI table from a file + * + ******************************************************************************/ + +acpi_status +acpi_db_load_acpi_table ( + NATIVE_CHAR *filename) { +#ifdef ACPI_APPLICATION + acpi_status status; + + + status = acpi_db_get_acpi_table (filename); + if (ACPI_FAILURE (status)) { + return (status); + } + + /* Attempt to recognize and install the table */ status = ae_local_load_table (acpi_gbl_db_table_ptr); if (ACPI_FAILURE (status)) { - if (status == AE_EXIST) { + if (status == AE_ALREADY_EXISTS) { acpi_os_printf ("Table %4.4s is already installed\n", - &acpi_gbl_db_table_ptr->signature); + acpi_gbl_db_table_ptr->signature); } else { acpi_os_printf ("Could not install table, %s\n", acpi_format_exception (status)); } - acpi_os_free (acpi_gbl_db_table_ptr); return (status); } acpi_os_printf ("%4.4s at %p successfully installed and loaded\n", - &acpi_gbl_db_table_ptr->signature, acpi_gbl_db_table_ptr); + acpi_gbl_db_table_ptr->signature, acpi_gbl_db_table_ptr); acpi_gbl_acpi_hardware_present = FALSE; diff -urN linux-2.4.18/drivers/acpi/debugger/dbhistry.c lia64-2.4/drivers/acpi/debugger/dbhistry.c --- linux-2.4.18/drivers/acpi/debugger/dbhistry.c Mon Sep 24 15:06:38 2001 +++ lia64-2.4/drivers/acpi/debugger/dbhistry.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: dbhistry - debugger HISTORY command - * $Revision: 19 $ + * $Revision: 24 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,20 +25,12 @@ #include "acpi.h" -#include "acparser.h" -#include "acdispat.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "acparser.h" -#include "acevents.h" -#include "acinterp.h" #include "acdebug.h" -#include "actables.h" #ifdef ENABLE_DEBUGGER #define _COMPONENT ACPI_DEBUGGER - MODULE_NAME ("dbhistry") + ACPI_MODULE_NAME ("dbhistry") #define HI_NO_HISTORY 0 @@ -54,11 +46,11 @@ } HISTORY_INFO; -HISTORY_INFO acpi_gbl_history_buffer[HISTORY_SIZE]; -u16 acpi_gbl_lo_history = 0; -u16 acpi_gbl_num_history = 0; -u16 acpi_gbl_next_history_index = 0; -u32 acpi_gbl_next_cmd_num = 1; +static HISTORY_INFO acpi_gbl_history_buffer[HISTORY_SIZE]; +static u16 acpi_gbl_lo_history = 0; +static u16 acpi_gbl_num_history = 0; +static u16 acpi_gbl_next_history_index = 0; +static u32 acpi_gbl_next_cmd_num = 1; /******************************************************************************* @@ -78,10 +70,9 @@ NATIVE_CHAR *command_line) { - /* Put command into the next available slot */ - STRCPY (acpi_gbl_history_buffer[acpi_gbl_next_history_index].command, command_line); + ACPI_STRCPY (acpi_gbl_history_buffer[acpi_gbl_next_history_index].command, command_line); acpi_gbl_history_buffer[acpi_gbl_next_history_index].cmd_num = acpi_gbl_next_cmd_num; @@ -100,12 +91,10 @@ acpi_gbl_next_history_index = 0; } - acpi_gbl_next_cmd_num++; if (acpi_gbl_num_history < HISTORY_SIZE) { acpi_gbl_num_history++; } - } @@ -171,9 +160,8 @@ } else { - cmd_num = STRTOUL (command_num_arg, NULL, 0); + cmd_num = ACPI_STRTOUL (command_num_arg, NULL, 0); } - /* Search history buffer */ diff -urN linux-2.4.18/drivers/acpi/debugger/dbinput.c lia64-2.4/drivers/acpi/debugger/dbinput.c --- linux-2.4.18/drivers/acpi/debugger/dbinput.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/debugger/dbinput.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: dbinput - user front-end to the AML debugger - * $Revision: 72 $ + * $Revision: 86 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,66 +25,20 @@ #include "acpi.h" -#include "acparser.h" -#include "actables.h" -#include "acnamesp.h" -#include "acinterp.h" #include "acdebug.h" #ifdef ENABLE_DEBUGGER #define _COMPONENT ACPI_DEBUGGER - MODULE_NAME ("dbinput") + ACPI_MODULE_NAME ("dbinput") /* - * Globals that are specific to the debugger - */ - -NATIVE_CHAR acpi_gbl_db_line_buf[80]; -NATIVE_CHAR acpi_gbl_db_parsed_buf[80]; -NATIVE_CHAR acpi_gbl_db_scope_buf[40]; -NATIVE_CHAR acpi_gbl_db_debug_filename[40]; -NATIVE_CHAR *acpi_gbl_db_args[DB_MAX_ARGS]; -NATIVE_CHAR *acpi_gbl_db_buffer = NULL; -NATIVE_CHAR *acpi_gbl_db_filename = NULL; -u8 acpi_gbl_db_output_to_file = FALSE; - -u32 acpi_gbl_db_debug_level = ACPI_LV_VERBOSITY2; -u32 acpi_gbl_db_console_debug_level = NORMAL_DEFAULT | ACPI_LV_TABLES; -u8 acpi_gbl_db_output_flags = DB_CONSOLE_OUTPUT; - - -u8 acpi_gbl_db_opt_tables = FALSE; -u8 acpi_gbl_db_opt_disasm = FALSE; -u8 acpi_gbl_db_opt_stats = FALSE; -u8 acpi_gbl_db_opt_parse_jit = FALSE; -u8 acpi_gbl_db_opt_verbose = TRUE; -u8 acpi_gbl_db_opt_ini_methods = TRUE; - -/* - * Statistic globals - */ -u16 acpi_gbl_obj_type_count[INTERNAL_TYPE_NODE_MAX+1]; -u16 acpi_gbl_node_type_count[INTERNAL_TYPE_NODE_MAX+1]; -u16 acpi_gbl_obj_type_count_misc; -u16 acpi_gbl_node_type_count_misc; -u32 acpi_gbl_num_nodes; -u32 acpi_gbl_num_objects; - - -u32 acpi_gbl_size_of_parse_tree; -u32 acpi_gbl_size_of_method_trees; -u32 acpi_gbl_size_of_node_entries; -u32 acpi_gbl_size_of_acpi_objects; - -/* * Top-level debugger commands. * * This list of commands must match the string table below it */ - enum acpi_ex_debugger_commands { CMD_NOT_FOUND = 0, @@ -109,6 +63,7 @@ CMD_HISTORY_EXE, CMD_HISTORY_LAST, CMD_INFORMATION, + CMD_INTEGRITY, CMD_INTO, CMD_LEVEL, CMD_LIST, @@ -139,7 +94,7 @@ #define CMD_FIRST_VALID 2 -const COMMAND_INFO acpi_gbl_db_commands[] = +static const COMMAND_INFO acpi_gbl_db_commands[] = { {"", 0}, {"", 0}, {"ALLOCATIONS", 0}, @@ -162,6 +117,7 @@ {"!", 1}, {"!!", 0}, {"INFORMATION", 0}, + {"INTEGRITY", 0}, {"INTO", 0}, {"LEVEL", 0}, {"LIST", 0}, @@ -224,13 +180,11 @@ } - /* * Parameter is the command class * * The idea here is to keep each class of commands smaller than a screenful */ - switch (help_type[0]) { case 'G': @@ -295,7 +249,7 @@ return; default: - acpi_os_printf ("Unrecognized Command Class: %x\n", help_type); + acpi_os_printf ("Unrecognized Command Class: %X\n", help_type); return; } } @@ -321,6 +275,7 @@ { NATIVE_CHAR *start; + /* At end of buffer? */ if (!string || !(*string)) @@ -328,7 +283,6 @@ return (NULL); } - /* Get rid of any spaces at the beginning */ if (*string == ' ') @@ -353,12 +307,10 @@ string++; } - if (!(*string)) { *next = NULL; } - else { *string = 0; @@ -392,11 +344,11 @@ NATIVE_CHAR *this; - STRCPY (acpi_gbl_db_parsed_buf, input_buffer); - STRUPR (acpi_gbl_db_parsed_buf); + ACPI_STRCPY (acpi_gbl_db_parsed_buf, input_buffer); + ACPI_STRUPR (acpi_gbl_db_parsed_buf); this = acpi_gbl_db_parsed_buf; - for (i = 0; i < DB_MAX_ARGS; i++) + for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++) { acpi_gbl_db_args[i] = acpi_db_get_next_token (this, &next); if (!acpi_gbl_db_args[i]) @@ -407,12 +359,11 @@ this = next; } - /* Uppercase the actual command */ if (acpi_gbl_db_args[0]) { - STRUPR (acpi_gbl_db_args[0]); + ACPI_STRUPR (acpi_gbl_db_args[0]); } count = i; @@ -451,7 +402,8 @@ for (i = CMD_FIRST_VALID; acpi_gbl_db_commands[i].name; i++) { - if (STRSTR (acpi_gbl_db_commands[i].name, user_command) == acpi_gbl_db_commands[i].name) + if (ACPI_STRSTR (acpi_gbl_db_commands[i].name, user_command) == + acpi_gbl_db_commands[i].name) { return (i); } @@ -572,7 +524,7 @@ break; case CMD_FIND: - acpi_db_find_name_in_namespace (acpi_gbl_db_args[1]); + status = acpi_db_find_name_in_namespace (acpi_gbl_db_args[1]); break; case CMD_GO: @@ -601,7 +553,6 @@ status = AE_CTRL_TRUE; } return (status); - break; case CMD_HISTORY_LAST: command_line = acpi_db_get_from_history (NULL); @@ -621,13 +572,14 @@ acpi_db_display_method_info (op); break; + case CMD_INTEGRITY: + acpi_db_check_integrity (); + break; + case CMD_INTO: if (op) { acpi_gbl_cm_single_step = TRUE; - -/* TBD: Must get current walk state */ - /* Acpi_gbl_Method_breakpoint = 0; */ return (AE_OK); } break; @@ -641,13 +593,13 @@ else if (param_count == 2) { temp = acpi_gbl_db_console_debug_level; - acpi_gbl_db_console_debug_level = STRTOUL (acpi_gbl_db_args[1], NULL, 16); + acpi_gbl_db_console_debug_level = ACPI_STRTOUL (acpi_gbl_db_args[1], NULL, 16); acpi_os_printf ("Debug Level for console output was %8.8lX, now %8.8lX\n", temp, acpi_gbl_db_console_debug_level); } else { temp = acpi_gbl_db_debug_level; - acpi_gbl_db_debug_level = STRTOUL (acpi_gbl_db_args[1], NULL, 16); + acpi_gbl_db_debug_level = ACPI_STRTOUL (acpi_gbl_db_args[1], NULL, 16); acpi_os_printf ("Debug Level for file output was %8.8lX, now %8.8lX\n", temp, acpi_gbl_db_debug_level); } break; @@ -673,7 +625,7 @@ break; case CMD_METHODS: - acpi_db_display_objects ("METHOD", acpi_gbl_db_args[1]); + status = acpi_db_display_objects ("METHOD", acpi_gbl_db_args[1]); break; case CMD_NAMESPACE: @@ -681,12 +633,13 @@ break; case CMD_NOTIFY: - temp = STRTOUL (acpi_gbl_db_args[2], NULL, 0); + temp = ACPI_STRTOUL (acpi_gbl_db_args[2], NULL, 0); acpi_db_send_notify (acpi_gbl_db_args[1], temp); break; case CMD_OBJECT: - acpi_db_display_objects (STRUPR (acpi_gbl_db_args[1]), acpi_gbl_db_args[2]); + ACPI_STRUPR (acpi_gbl_db_args[1]); + status = acpi_db_display_objects (acpi_gbl_db_args[1], acpi_gbl_db_args[2]); break; case CMD_OPEN: @@ -718,19 +671,18 @@ break; case CMD_STATS: - acpi_db_display_statistics (acpi_gbl_db_args[1]); + status = acpi_db_display_statistics (acpi_gbl_db_args[1]); break; case CMD_STOP: - return (AE_AML_ERROR); - break; + return (AE_NOT_IMPLEMENTED); case CMD_TABLES: acpi_db_display_table_info (acpi_gbl_db_args[1]); break; case CMD_TERMINATE: - acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_REDIRECTABLE_OUTPUT); acpi_ut_subsystem_shutdown (); /* TBD: [Restructure] Need some way to re-initialize without re-creating the semaphores! */ @@ -773,6 +725,7 @@ return (AE_CTRL_TERMINATE); case CMD_NOT_FOUND: + default: acpi_os_printf ("Unknown Command\n"); return (AE_CTRL_TRUE); } @@ -798,11 +751,12 @@ * ******************************************************************************/ -void +void ACPI_SYSTEM_XFACE acpi_db_execute_thread ( void *context) { acpi_status status = AE_OK; + acpi_status Mstatus; while (status != AE_CTRL_TERMINATE) @@ -810,9 +764,19 @@ acpi_gbl_method_executing = FALSE; acpi_gbl_step_to_next_call = FALSE; - acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_READY); + Mstatus = acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_READY); + if (ACPI_FAILURE (Mstatus)) + { + return; + } + status = acpi_db_command_dispatch (acpi_gbl_db_line_buf, NULL, NULL); - acpi_ut_release_mutex (ACPI_MTX_DEBUG_CMD_COMPLETE); + + Mstatus = acpi_ut_release_mutex (ACPI_MTX_DEBUG_CMD_COMPLETE); + if (ACPI_FAILURE (Mstatus)) + { + return; + } } } @@ -834,13 +798,11 @@ acpi_db_single_thread ( void) { - acpi_status status = AE_OK; - acpi_gbl_method_executing = FALSE; acpi_gbl_step_to_next_call = FALSE; - status = acpi_db_command_dispatch (acpi_gbl_db_line_buf, NULL, NULL); + (void) acpi_db_command_dispatch (acpi_gbl_db_line_buf, NULL, NULL); } @@ -872,23 +834,22 @@ { /* Force output to console until a command is entered */ - acpi_db_set_output_destination (DB_CONSOLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_CONSOLE_OUTPUT); /* Different prompt if method is executing */ if (!acpi_gbl_method_executing) { - acpi_os_printf ("%1c ", DB_COMMAND_PROMPT); + acpi_os_printf ("%1c ", ACPI_DEBUGGER_COMMAND_PROMPT); } else { - acpi_os_printf ("%1c ", DB_EXECUTE_PROMPT); + acpi_os_printf ("%1c ", ACPI_DEBUGGER_EXECUTE_PROMPT); } /* Get the user input line */ - acpi_os_get_line (acpi_gbl_db_line_buf); - + (void) acpi_os_get_line (acpi_gbl_db_line_buf); /* Check for single or multithreaded debug */ @@ -898,10 +859,18 @@ * Signal the debug thread that we have a command to execute, * and wait for the command to complete. */ - acpi_ut_release_mutex (ACPI_MTX_DEBUG_CMD_READY); - acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_COMPLETE); + status = acpi_ut_release_mutex (ACPI_MTX_DEBUG_CMD_READY); + if (ACPI_FAILURE (status)) + { + return (status); + } + + status = acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_COMPLETE); + if (ACPI_FAILURE (status)) + { + return (status); + } } - else { /* Just call to the command line interpreter */ @@ -910,12 +879,11 @@ } } - /* * Only this thread (the original thread) should actually terminate the subsystem, * because all the semaphores are deleted during termination */ - acpi_terminate (); + status = acpi_terminate (); return (status); } diff -urN linux-2.4.18/drivers/acpi/debugger/dbstats.c lia64-2.4/drivers/acpi/debugger/dbstats.c --- linux-2.4.18/drivers/acpi/debugger/dbstats.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/debugger/dbstats.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: dbstats - Generation and display of ACPI table statistics - * $Revision: 47 $ + * $Revision: 59 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,19 +26,17 @@ #include #include -#include -#include #include #ifdef ENABLE_DEBUGGER #define _COMPONENT ACPI_DEBUGGER - MODULE_NAME ("dbstats") + ACPI_MODULE_NAME ("dbstats") /* * Statistics subcommands */ -ARGUMENT_INFO acpi_db_stat_types [] = +static ARGUMENT_INFO acpi_db_stat_types [] = { {"ALLOCATIONS"}, {"OBJECTS"}, {"MEMORY"}, @@ -49,13 +47,13 @@ {NULL} /* Must be null terminated */ }; -#define CMD_ALLOCATIONS 0 -#define CMD_OBJECTS 1 -#define CMD_MEMORY 2 -#define CMD_MISC 3 -#define CMD_TABLES 4 -#define CMD_SIZES 5 -#define CMD_STACK 6 +#define CMD_STAT_ALLOCATIONS 0 +#define CMD_STAT_OBJECTS 1 +#define CMD_STAT_MEMORY 2 +#define CMD_STAT_MISC 3 +#define CMD_STAT_TABLES 4 +#define CMD_STAT_SIZES 5 +#define CMD_STAT_STACK 6 /******************************************************************************* @@ -67,9 +65,8 @@ * RETURN: None * * DESCRIPTION: Add this object to the global counts, by object type. - * Recursively handles subobjects and packages. - * - * [TBD] Restructure - remove recursion. + * Limited recursion handles subobjects and packages, and this + * is probably acceptable within the AML debugger only. * ******************************************************************************/ @@ -77,7 +74,6 @@ acpi_db_enumerate_object ( acpi_operand_object *obj_desc) { - u32 type; u32 i; @@ -91,22 +87,21 @@ acpi_gbl_num_objects++; - type = obj_desc->common.type; - if (type > INTERNAL_TYPE_NODE_MAX) + if (obj_desc->common.type > INTERNAL_TYPE_NODE_MAX) { acpi_gbl_obj_type_count_misc++; } else { - acpi_gbl_obj_type_count [type]++; + acpi_gbl_obj_type_count [obj_desc->common.type]++; } /* Count the sub-objects */ - switch (type) + switch (obj_desc->common.type) { case ACPI_TYPE_PACKAGE: - for (i = 0; i< obj_desc->package.count; i++) + for (i = 0; i < obj_desc->package.count; i++) { acpi_db_enumerate_object (obj_desc->package.elements[i]); } @@ -118,7 +113,15 @@ acpi_db_enumerate_object (obj_desc->device.addr_handler); break; + case ACPI_TYPE_BUFFER_FIELD: + if (acpi_ns_get_secondary_object (obj_desc)) + { + acpi_gbl_obj_type_count [ACPI_TYPE_BUFFER_FIELD]++; + } + break; + case ACPI_TYPE_REGION: + acpi_gbl_obj_type_count [INTERNAL_TYPE_REGION_FIELD ]++; acpi_db_enumerate_object (obj_desc->region.addr_handler); break; @@ -138,6 +141,9 @@ acpi_db_enumerate_object (obj_desc->thermal_zone.drv_handler); acpi_db_enumerate_object (obj_desc->thermal_zone.addr_handler); break; + + default: + break; } } @@ -172,7 +178,7 @@ acpi_gbl_num_nodes++; node = (acpi_namespace_node *) obj_handle; - obj_desc = ((acpi_namespace_node *) obj_handle)->object; + obj_desc = acpi_ns_get_attached_object (node); acpi_db_enumerate_object (obj_desc); @@ -227,7 +233,7 @@ * ******************************************************************************/ -acpi_status +void acpi_db_count_namespace_objects ( void) { @@ -244,10 +250,8 @@ acpi_gbl_node_type_count [i] = 0; } - acpi_ns_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, + (void) acpi_ns_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, FALSE, acpi_db_classify_one_object, NULL, NULL); - - return (AE_OK); } #endif @@ -271,8 +275,10 @@ { u32 i; u32 type; - u32 outstanding; u32 size; +#ifdef ACPI_DBG_TRACK_ALLOCATIONS + u32 outstanding; +#endif if (!acpi_gbl_DSDT) @@ -286,7 +292,7 @@ return (AE_OK); } - STRUPR (type_arg); + ACPI_STRUPR (type_arg); type = acpi_db_match_argument (type_arg, acpi_db_stat_types); if (type == (u32) -1) { @@ -298,14 +304,14 @@ switch (type) { #ifndef PARSER_ONLY - case CMD_ALLOCATIONS: + case CMD_STAT_ALLOCATIONS: #ifdef ACPI_DBG_TRACK_ALLOCATIONS acpi_ut_dump_allocation_info (); #endif break; #endif - case CMD_TABLES: + case CMD_STAT_TABLES: acpi_os_printf ("ACPI Table Information:\n\n"); if (acpi_gbl_DSDT) @@ -314,7 +320,7 @@ } break; - case CMD_OBJECTS: + case CMD_STAT_OBJECTS: #ifndef PARSER_ONLY @@ -338,7 +344,7 @@ #endif break; - case CMD_MEMORY: + case CMD_STAT_MEMORY: #ifdef ACPI_DBG_TRACK_ALLOCATIONS acpi_os_printf ("\n----Object and Cache Statistics---------------------------------------------\n"); @@ -368,11 +374,11 @@ if (acpi_gbl_memory_lists[i].object_size) { - size = ROUND_UP_TO_1K (outstanding * acpi_gbl_memory_lists[i].object_size); + size = ACPI_ROUND_UP_TO_1K (outstanding * acpi_gbl_memory_lists[i].object_size); } else { - size = ROUND_UP_TO_1K (acpi_gbl_memory_lists[i].current_total_size); + size = ACPI_ROUND_UP_TO_1K (acpi_gbl_memory_lists[i].current_total_size); } acpi_os_printf (" Mem: [Alloc Free Outstanding Size] % 7d % 7d % 7d % 7d Kb\n", @@ -384,7 +390,7 @@ break; - case CMD_MISC: + case CMD_STAT_MISC: acpi_os_printf ("\n_miscellaneous Statistics:\n\n"); acpi_os_printf ("Calls to Acpi_ps_find:.. ........% 7ld\n", acpi_gbl_ps_find_count); @@ -400,7 +406,7 @@ break; - case CMD_SIZES: + case CMD_STAT_SIZES: acpi_os_printf ("\n_internal object sizes:\n\n"); @@ -425,26 +431,33 @@ acpi_os_printf ("Notify_handler %3d\n", sizeof (ACPI_OBJECT_NOTIFY_HANDLER)); acpi_os_printf ("Addr_handler %3d\n", sizeof (ACPI_OBJECT_ADDR_HANDLER)); acpi_os_printf ("Extra %3d\n", sizeof (ACPI_OBJECT_EXTRA)); + acpi_os_printf ("Data %3d\n", sizeof (ACPI_OBJECT_DATA)); acpi_os_printf ("\n"); - acpi_os_printf ("Parse_object %3d\n", sizeof (acpi_parse_object)); - acpi_os_printf ("Parse2_object %3d\n", sizeof (acpi_parse2_object)); + acpi_os_printf ("Parse_object %3d\n", sizeof (ACPI_PARSE_OBJ_COMMON)); + acpi_os_printf ("Parse_object_named %3d\n", sizeof (ACPI_PARSE_OBJ_NAMED)); + acpi_os_printf ("Parse_object_asl %3d\n", sizeof (ACPI_PARSE_OBJ_ASL)); acpi_os_printf ("Operand_object %3d\n", sizeof (acpi_operand_object)); acpi_os_printf ("Namespace_node %3d\n", sizeof (acpi_namespace_node)); break; - case CMD_STACK: + case CMD_STAT_STACK: +#if defined(ACPI_DEBUG) - size = acpi_gbl_entry_stack_pointer - acpi_gbl_lowest_stack_pointer; + size = (u32) (acpi_gbl_entry_stack_pointer - acpi_gbl_lowest_stack_pointer); acpi_os_printf ("\n_subsystem Stack Usage:\n\n"); acpi_os_printf ("Entry Stack Pointer %X\n", acpi_gbl_entry_stack_pointer); acpi_os_printf ("Lowest Stack Pointer %X\n", acpi_gbl_lowest_stack_pointer); acpi_os_printf ("Stack Use %X (%d)\n", size, size); acpi_os_printf ("Deepest Procedure Nesting %d\n", acpi_gbl_deepest_nesting); +#endif + break; + + default: break; } diff -urN linux-2.4.18/drivers/acpi/debugger/dbutils.c lia64-2.4/drivers/acpi/debugger/dbutils.c --- linux-2.4.18/drivers/acpi/debugger/dbutils.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/debugger/dbutils.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: dbutils - AML debugger utilities - * $Revision: 45 $ + * $Revision: 55 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,9 +28,6 @@ #include "acparser.h" #include "amlcode.h" #include "acnamesp.h" -#include "acparser.h" -#include "acevents.h" -#include "acinterp.h" #include "acdebug.h" #include "acdispat.h" @@ -38,7 +35,7 @@ #ifdef ENABLE_DEBUGGER #define _COMPONENT ACPI_DEBUGGER - MODULE_NAME ("dbutils") + ACPI_MODULE_NAME ("dbutils") /******************************************************************************* @@ -61,10 +58,8 @@ acpi_gbl_db_output_flags = (u8) output_flags; - if (output_flags & DB_REDIRECTABLE_OUTPUT) { - if (acpi_gbl_db_output_to_file) { - acpi_dbg_level = acpi_gbl_db_debug_level; - } + if ((output_flags & ACPI_DB_REDIRECTABLE_OUTPUT) && acpi_gbl_db_output_to_file) { + acpi_dbg_level = acpi_gbl_db_debug_level; } else { acpi_dbg_level = acpi_gbl_db_console_debug_level; @@ -92,7 +87,7 @@ acpi_os_printf ("\n_location %X:\n", address); acpi_dbg_level |= ACPI_LV_TABLES; - acpi_ut_dump_buffer ((u8 *) address, 64, DB_BYTE_DISPLAY, ACPI_UINT32_MAX); + acpi_ut_dump_buffer (ACPI_TO_POINTER (address), 64, DB_BYTE_DISPLAY, ACPI_UINT32_MAX); } @@ -135,8 +130,9 @@ case ACPI_TYPE_INTEGER: - acpi_os_printf ("[Integer] = %8.8X%8.8X\n", HIDWORD (obj_desc->integer.value), - LODWORD (obj_desc->integer.value)); + acpi_os_printf ("[Integer] = %8.8X%8.8X\n", + ACPI_HIDWORD (obj_desc->integer.value), + ACPI_LODWORD (obj_desc->integer.value)); break; @@ -152,7 +148,7 @@ case ACPI_TYPE_BUFFER: - acpi_os_printf ("[Buffer] = "); + acpi_os_printf ("[Buffer] Length %.2X = ", obj_desc->buffer.length); acpi_ut_dump_buffer ((u8 *) obj_desc->buffer.pointer, obj_desc->buffer.length, DB_DWORD_DISPLAY, _COMPONENT); break; @@ -215,7 +211,7 @@ return; } - STRUPR (name); + ACPI_STRUPR (name); /* Convert a leading forward slash to a backslash */ @@ -260,7 +256,7 @@ acpi_parse_object *root) { acpi_parse_object *op = root; - acpi_parse2_object *method; + acpi_parse_object *method; acpi_parse_object *search_op; acpi_parse_object *start_op; acpi_status status = AE_OK; @@ -268,15 +264,16 @@ acpi_walk_state *walk_state; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("Pass two parse ....\n"); - while (op) { - if (op->opcode == AML_METHOD_OP) { - method = (acpi_parse2_object *) op; + if (op->common.aml_opcode == AML_METHOD_OP) { + method = op; + + /* Create a new walk state for the parse */ walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, NULL, NULL, NULL); @@ -284,32 +281,32 @@ return (AE_NO_MEMORY); } + /* Init the Walk State */ walk_state->parser_state.aml = - walk_state->parser_state.aml_start = method->data; + walk_state->parser_state.aml_start = method->named.data; walk_state->parser_state.aml_end = - walk_state->parser_state.pkg_end = method->data + method->length; + walk_state->parser_state.pkg_end = method->named.data + method->named.length; walk_state->parser_state.start_scope = op; walk_state->descending_callback = acpi_ds_load1_begin_op; walk_state->ascending_callback = acpi_ds_load1_end_op; + /* Perform the AML parse */ status = acpi_ps_parse_aml (walk_state); - - base_aml_offset = (method->value.arg)->aml_offset + 1; - start_op = (method->value.arg)->next; + base_aml_offset = (method->common.value.arg)->common.aml_offset + 1; + start_op = (method->common.value.arg)->common.next; search_op = start_op; while (search_op) { - search_op->aml_offset += base_aml_offset; + search_op->common.aml_offset += base_aml_offset; search_op = acpi_ps_get_depth_next (start_op, search_op); } - } - if (op->opcode == AML_REGION_OP) { + if (op->common.aml_opcode == AML_REGION_OP) { /* TBD: [Investigate] this isn't quite the right thing to do! */ /* * @@ -339,6 +336,9 @@ * * DESCRIPTION: Lookup a name in the ACPI namespace * + * Note: Currently begins search from the root. Could be enhanced to use + * the current prefix (scope) node as the search beginning point. + * ******************************************************************************/ acpi_namespace_node * @@ -360,21 +360,17 @@ return (NULL); } - /* Lookup the name */ - - /* TBD: [Investigate] what scope do we use? */ - /* Use the root scope for the start of the search */ - - status = acpi_ns_lookup (NULL, internal_path, ACPI_TYPE_ANY, IMODE_EXECUTE, - NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE, NULL, &node); - + /* + * Lookup the name. + * (Uses root node as the search starting point) + */ + status = acpi_ns_lookup (NULL, internal_path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, + ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, NULL, &node); if (ACPI_FAILURE (status)) { acpi_os_printf ("Could not locate name: %s %s\n", name, acpi_format_exception (status)); } - ACPI_MEM_FREE (internal_path); - return (node); } diff -urN linux-2.4.18/drivers/acpi/debugger/dbxface.c lia64-2.4/drivers/acpi/debugger/dbxface.c --- linux-2.4.18/drivers/acpi/debugger/dbxface.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/debugger/dbxface.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: dbxface - AML Debugger external interfaces - * $Revision: 45 $ + * $Revision: 59 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,19 +25,14 @@ #include "acpi.h" -#include "acparser.h" #include "amlcode.h" -#include "acnamesp.h" -#include "acparser.h" -#include "acevents.h" -#include "acinterp.h" #include "acdebug.h" #ifdef ENABLE_DEBUGGER #define _COMPONENT ACPI_DEBUGGER - MODULE_NAME ("dbxface") + ACPI_MODULE_NAME ("dbxface") /******************************************************************************* @@ -64,30 +59,40 @@ acpi_status status = AE_OK; u32 original_debug_level; acpi_parse_object *display_op; + acpi_parse_object *parent_op; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); - /* Is there a breakpoint set? */ + /* Check for single-step breakpoint */ - if (walk_state->method_breakpoint) { + if (walk_state->method_breakpoint && + (walk_state->method_breakpoint <= op->common.aml_offset)) { /* Check if the breakpoint has been reached or passed */ + /* Hit the breakpoint, resume single step, reset breakpoint */ - if (walk_state->method_breakpoint <= op->aml_offset) { - /* Hit the breakpoint, resume single step, reset breakpoint */ + acpi_os_printf ("***Break*** at AML offset %X\n", op->common.aml_offset); + acpi_gbl_cm_single_step = TRUE; + acpi_gbl_step_to_next_call = FALSE; + walk_state->method_breakpoint = 0; + } - acpi_os_printf ("***Break*** at AML offset %X\n", op->aml_offset); - acpi_gbl_cm_single_step = TRUE; - acpi_gbl_step_to_next_call = FALSE; - walk_state->method_breakpoint = 0; - } + /* Check for user breakpoint (Must be on exact Aml offset) */ + + else if (walk_state->user_breakpoint && + (walk_state->user_breakpoint == op->common.aml_offset)) { + acpi_os_printf ("***User_breakpoint*** at AML offset %X\n", op->common.aml_offset); + acpi_gbl_cm_single_step = TRUE; + acpi_gbl_step_to_next_call = FALSE; + walk_state->method_breakpoint = 0; } + /* * Check if this is an opcode that we are interested in -- * namely, opcodes that have arguments */ - if (op->opcode == AML_INT_NAMEDFIELD_OP) { + if (op->common.aml_opcode == AML_INT_NAMEDFIELD_OP) { return (AE_OK); } @@ -95,6 +100,9 @@ case AML_CLASS_UNKNOWN: case AML_CLASS_ARGUMENT: /* constants, literals, etc. do nothing */ return (AE_OK); + + default: + /* All other opcodes -- continue */ break; } @@ -116,15 +124,41 @@ */ original_debug_level = acpi_dbg_level; acpi_dbg_level &= ~(ACPI_LV_PARSE | ACPI_LV_FUNCTIONS); - next = op->next; - op->next = NULL; + next = op->common.next; + op->common.next = NULL; display_op = op; - if (op->parent) { - if ((op->parent->opcode == AML_IF_OP) || - (op->parent->opcode == AML_WHILE_OP)) { - display_op = op->parent; + parent_op = op->common.parent; + if (parent_op) { + if ((walk_state->control_state) && + (walk_state->control_state->common.state == ACPI_CONTROL_PREDICATE_EXECUTING)) { + /* + * We are executing the predicate of an IF or WHILE statement + * Search upwards for the containing IF or WHILE so that the + * entire predicate can be displayed. + */ + while (parent_op) { + if ((parent_op->common.aml_opcode == AML_IF_OP) || + (parent_op->common.aml_opcode == AML_WHILE_OP)) { + display_op = parent_op; + break; + } + parent_op = parent_op->common.parent; + } + } + else { + while (parent_op) { + if ((parent_op->common.aml_opcode == AML_IF_OP) || + (parent_op->common.aml_opcode == AML_ELSE_OP) || + (parent_op->common.aml_opcode == AML_SCOPE_OP) || + (parent_op->common.aml_opcode == AML_METHOD_OP) || + (parent_op->common.aml_opcode == AML_WHILE_OP)) { + break; + } + display_op = parent_op; + parent_op = parent_op->common.parent; + } } } @@ -132,23 +166,23 @@ acpi_db_display_op (walk_state, display_op, ACPI_UINT32_MAX); - if ((op->opcode == AML_IF_OP) || - (op->opcode == AML_WHILE_OP)) { + if ((op->common.aml_opcode == AML_IF_OP) || + (op->common.aml_opcode == AML_WHILE_OP)) { if (walk_state->control_state->common.value) { - acpi_os_printf ("Predicate was TRUE, executed block\n"); + acpi_os_printf ("Predicate = [True], IF block was executed\n"); } else { - acpi_os_printf ("Predicate is FALSE, skipping block\n"); + acpi_os_printf ("Predicate = [False], Skipping IF block\n"); } } - else if (op->opcode == AML_ELSE_OP) { - /* TBD */ + else if (op->common.aml_opcode == AML_ELSE_OP) { + acpi_os_printf ("Predicate = [False], ELSE block was executed\n"); } /* Restore everything */ - op->next = next; + op->common.next = next; acpi_os_printf ("\n"); acpi_dbg_level = original_debug_level; } @@ -159,13 +193,12 @@ return (AE_OK); } - /* * If we are executing a step-to-call command, * Check if this is a method call. */ if (acpi_gbl_step_to_next_call) { - if (op->opcode != AML_INT_METHODCALL_OP) { + if (op->common.aml_opcode != AML_INT_METHODCALL_OP) { /* Not a method call, just keep executing */ return (AE_OK); @@ -176,19 +209,16 @@ acpi_gbl_step_to_next_call = FALSE; } - /* * If the next opcode is a method call, we will "step over" it * by default. */ - if (op->opcode == AML_INT_METHODCALL_OP) { + if (op->common.aml_opcode == AML_INT_METHODCALL_OP) { acpi_gbl_cm_single_step = FALSE; /* No more single step while executing called method */ - /* Set the breakpoint on the call, it will stop execution as soon as we return */ - - /* TBD: [Future] don't kill the user breakpoint! */ + /* Set the breakpoint on/before the call, it will stop execution as soon as we return */ - walk_state->method_breakpoint = /* Op->Aml_offset + */ 1; /* Must be non-zero! */ + walk_state->method_breakpoint = 1; /* Must be non-zero! */ } @@ -204,8 +234,14 @@ if (acpi_gbl_debugger_configuration == DEBUGGER_MULTI_THREADED) { /* Handshake with the front-end that gets user command lines */ - acpi_ut_release_mutex (ACPI_MTX_DEBUG_CMD_COMPLETE); - acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_READY); + status = acpi_ut_release_mutex (ACPI_MTX_DEBUG_CMD_COMPLETE); + if (ACPI_FAILURE (status)) { + return (status); + } + status = acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_READY); + if (ACPI_FAILURE (status)) { + return (status); + } } else { @@ -213,20 +249,20 @@ /* Force output to console until a command is entered */ - acpi_db_set_output_destination (DB_CONSOLE_OUTPUT); + acpi_db_set_output_destination (ACPI_DB_CONSOLE_OUTPUT); /* Different prompt if method is executing */ if (!acpi_gbl_method_executing) { - acpi_os_printf ("%1c ", DB_COMMAND_PROMPT); + acpi_os_printf ("%1c ", ACPI_DEBUGGER_COMMAND_PROMPT); } else { - acpi_os_printf ("%1c ", DB_EXECUTE_PROMPT); + acpi_os_printf ("%1c ", ACPI_DEBUGGER_EXECUTE_PROMPT); } /* Get the user input line */ - acpi_os_get_line (acpi_gbl_db_line_buf); + (void) acpi_os_get_line (acpi_gbl_db_line_buf); } status = acpi_db_command_dispatch (acpi_gbl_db_line_buf, walk_state, op); @@ -252,20 +288,39 @@ * ******************************************************************************/ -int +acpi_status acpi_db_initialize (void) { + acpi_status status; /* Init globals */ - acpi_gbl_db_buffer = acpi_os_callocate (ACPI_DEBUG_BUFFER_SIZE); + acpi_gbl_db_buffer = NULL; + acpi_gbl_db_filename = NULL; + acpi_gbl_db_output_to_file = FALSE; + + acpi_gbl_db_debug_level = ACPI_LV_VERBOSITY2; + acpi_gbl_db_console_debug_level = NORMAL_DEFAULT | ACPI_LV_TABLES; + acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT; + + acpi_gbl_db_opt_tables = FALSE; + acpi_gbl_db_opt_disasm = FALSE; + acpi_gbl_db_opt_stats = FALSE; + acpi_gbl_db_opt_verbose = TRUE; + acpi_gbl_db_opt_ini_methods = TRUE; + + acpi_gbl_db_buffer = acpi_os_allocate (ACPI_DEBUG_BUFFER_SIZE); + if (!acpi_gbl_db_buffer) { + return (AE_NO_MEMORY); + } + ACPI_MEMSET (acpi_gbl_db_buffer, 0, ACPI_DEBUG_BUFFER_SIZE); /* Initial scope is the root */ acpi_gbl_db_scope_buf [0] = '\\'; acpi_gbl_db_scope_buf [1] = 0; - + acpi_gbl_db_scope_node = acpi_gbl_root_node; /* * If configured for multi-thread support, the debug executor runs in @@ -275,12 +330,24 @@ if (acpi_gbl_debugger_configuration & DEBUGGER_MULTI_THREADED) { /* These were created with one unit, grab it */ - acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_COMPLETE); - acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_READY); + status = acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_COMPLETE); + if (ACPI_FAILURE (status)) { + acpi_os_printf ("Could not get debugger mutex\n"); + return (status); + } + status = acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_READY); + if (ACPI_FAILURE (status)) { + acpi_os_printf ("Could not get debugger mutex\n"); + return (status); + } /* Create the debug execution thread to execute commands */ - acpi_os_queue_for_execution (0, acpi_db_execute_thread, NULL); + status = acpi_os_queue_for_execution (0, acpi_db_execute_thread, NULL); + if (ACPI_FAILURE (status)) { + acpi_os_printf ("Could not start debugger thread\n"); + return (status); + } } if (!acpi_gbl_db_opt_verbose) { @@ -289,7 +356,7 @@ acpi_gbl_db_opt_stats = FALSE; } - return (0); + return (AE_OK); } diff -urN linux-2.4.18/drivers/acpi/dispatcher/Makefile lia64-2.4/drivers/acpi/dispatcher/Makefile --- linux-2.4.18/drivers/acpi/dispatcher/Makefile Wed Jun 20 17:47:39 2001 +++ lia64-2.4/drivers/acpi/dispatcher/Makefile Tue Apr 9 15:46:58 2002 @@ -1,11 +1,10 @@ # # Makefile for all Linux ACPI interpreter subdirectories -# EXCEPT for the ospm directory # O_TARGET := $(notdir $(CURDIR)).o -obj-$(CONFIG_ACPI) := $(patsubst %.c,%.o,$(wildcard *.c)) +obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c)) EXTRA_CFLAGS += $(ACPI_CFLAGS) diff -urN linux-2.4.18/drivers/acpi/dispatcher/dsfield.c lia64-2.4/drivers/acpi/dispatcher/dsfield.c --- linux-2.4.18/drivers/acpi/dispatcher/dsfield.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/dispatcher/dsfield.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: dsfield - Dispatcher field routines - * $Revision: 46 $ + * $Revision: 65 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ #define _COMPONENT ACPI_DISPATCHER - MODULE_NAME ("dsfield") + ACPI_MODULE_NAME ("dsfield") /******************************************************************************* @@ -65,14 +65,16 @@ acpi_namespace_node *node; acpi_status status; acpi_operand_object *obj_desc; + acpi_operand_object *second_desc = NULL; + u32 flags; - FUNCTION_TRACE ("Ds_create_buffer_field"); + ACPI_FUNCTION_TRACE ("Ds_create_buffer_field"); /* Get the Name_string argument */ - if (op->opcode == AML_CREATE_FIELD_OP) { + if (op->common.aml_opcode == AML_CREATE_FIELD_OP) { arg = acpi_ps_get_arg (op, 3); } else { @@ -86,12 +88,23 @@ } /* + * During the load phase, we want to enter the name of the field into + * the namespace. During the execute phase (when we evaluate the size + * operand), we want to lookup the name + */ + if (walk_state->parse_flags & ACPI_PARSE_EXECUTE) { + flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE; + } + else { + flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND; + } + + /* * Enter the Name_string into the namespace */ - status = acpi_ns_lookup (walk_state->scope_info, arg->value.string, - INTERNAL_TYPE_DEF_ANY, IMODE_LOAD_PASS1, - NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE, - walk_state, &(node)); + status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, + INTERNAL_TYPE_DEF_ANY, ACPI_IMODE_LOAD_PASS1, + flags, walk_state, &(node)); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -100,14 +113,15 @@ * for now, we will put it in the "op" object that the parser uses, so we * can get it again at the end of this scope */ - op->node = node; + op->common.node = node; /* * If there is no object attached to the node, this node was just created and * we need to create the field object. Otherwise, this was a lookup of an * existing node and we don't want to create the field object again. */ - if (node->object) { + obj_desc = acpi_ns_get_attached_object (node); + if (obj_desc) { return_ACPI_STATUS (AE_OK); } @@ -125,27 +139,21 @@ } /* - * Allocate a method object for this field unit - */ - obj_desc->buffer_field.extra = acpi_ut_create_internal_object ( - INTERNAL_TYPE_EXTRA); - if (!obj_desc->buffer_field.extra) { - status = AE_NO_MEMORY; - goto cleanup; - } - - /* * Remember location in AML stream of the field unit * opcode and operands -- since the buffer and index * operands must be evaluated. */ - obj_desc->buffer_field.extra->extra.aml_start = ((acpi_parse2_object *) op)->data; - obj_desc->buffer_field.extra->extra.aml_length = ((acpi_parse2_object *) op)->length; + second_desc = obj_desc->common.next_object; + second_desc->extra.aml_start = op->named.data; + second_desc->extra.aml_length = op->named.length; obj_desc->buffer_field.node = node; - /* Attach constructed field descriptor to parent node */ + /* Attach constructed field descriptors to parent node */ status = acpi_ns_attach_object (node, obj_desc, ACPI_TYPE_BUFFER_FIELD); + if (ACPI_FAILURE (status)) { + goto cleanup; + } cleanup: @@ -179,9 +187,10 @@ acpi_parse_object *arg) { acpi_status status; + acpi_integer position; - FUNCTION_TRACE_U32 ("Ds_get_field_names", info); + ACPI_FUNCTION_TRACE_PTR ("Ds_get_field_names", info); /* First field starts at bit zero */ @@ -197,48 +206,75 @@ * 2) Access_as - changes the access mode * 3) Name - Enters a new named field into the namespace */ - switch (arg->opcode) { + switch (arg->common.aml_opcode) { case AML_INT_RESERVEDFIELD_OP: - info->field_bit_position += arg->value.size; + position = (acpi_integer) info->field_bit_position + + (acpi_integer) arg->common.value.size; + + if (position > ACPI_UINT32_MAX) { + ACPI_REPORT_ERROR (("Bit offset within field too large (> 0xFFFFFFFF)\n")); + return_ACPI_STATUS (AE_SUPPORT); + } + + info->field_bit_position = (u32) position; break; case AML_INT_ACCESSFIELD_OP: /* - * Get a new Access_type and Access_attribute for all - * entries (until end or another Access_as keyword) + * Get a new Access_type and Access_attribute -- to be used for all + * field units that follow, until field end or another Access_as keyword. + * + * In Field_flags, preserve the flag bits other than the ACCESS_TYPE bits */ - info->field_flags = (u8) ((info->field_flags & FIELD_ACCESS_TYPE_MASK) || - ((u8) (arg->value.integer >> 8))); + info->field_flags = (u8) ((info->field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) | + ((u8) (arg->common.value.integer32 >> 8))); + + info->attribute = (u8) (arg->common.value.integer32); break; case AML_INT_NAMEDFIELD_OP: - /* Enter a new field name into the namespace */ + /* Lookup the name */ status = acpi_ns_lookup (walk_state->scope_info, - (NATIVE_CHAR *) &((acpi_parse2_object *)arg)->name, - info->field_type, IMODE_LOAD_PASS1, - NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE, - NULL, &info->field_node); + (NATIVE_CHAR *) &arg->named.name, + info->field_type, ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE, + walk_state, &info->field_node); if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + if (status != AE_ALREADY_EXISTS) { + return_ACPI_STATUS (status); + } + + ACPI_REPORT_ERROR (("Field name [%4.4s] already exists in current scope\n", + &arg->named.name)); + } + else { + arg->common.node = info->field_node; + info->field_bit_length = arg->common.value.size; + + /* Create and initialize an object for the new Field Node */ + + status = acpi_ex_prep_field_value (info); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } } - /* Create and initialize an object for the new Field Node */ + /* Keep track of bit position for the next field */ - info->field_bit_length = arg->value.size; + position = (acpi_integer) info->field_bit_position + + (acpi_integer) arg->common.value.size; - status = acpi_ex_prep_field_value (info); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + if (position > ACPI_UINT32_MAX) { + ACPI_REPORT_ERROR (("Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n", + &info->field_node->name)); + return_ACPI_STATUS (AE_SUPPORT); } - /* Keep track of bit position for the next field */ - info->field_bit_position += info->field_bit_length; break; @@ -246,12 +282,11 @@ default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid opcode in field list: %X\n", - arg->opcode)); - return_ACPI_STATUS (AE_AML_ERROR); - break; + arg->common.aml_opcode)); + return_ACPI_STATUS (AE_AML_BAD_OPCODE); } - arg = arg->next; + arg = arg->common.next; } return_ACPI_STATUS (AE_OK); @@ -278,21 +313,21 @@ acpi_namespace_node *region_node, acpi_walk_state *walk_state) { - acpi_status status = AE_AML_ERROR; + acpi_status status; acpi_parse_object *arg; ACPI_CREATE_FIELD_INFO info; - FUNCTION_TRACE_PTR ("Ds_create_field", op); + ACPI_FUNCTION_TRACE_PTR ("Ds_create_field", op); /* First arg is the name of the parent Op_region (must already exist) */ - arg = op->value.arg; + arg = op->common.value.arg; if (!region_node) { - status = acpi_ns_lookup (walk_state->scope_info, arg->value.name, - ACPI_TYPE_REGION, IMODE_EXECUTE, - NS_SEARCH_PARENT, walk_state, ®ion_node); + status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.name, + ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, + ACPI_NS_SEARCH_PARENT, walk_state, ®ion_node); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -300,15 +335,16 @@ /* Second arg is the field flags */ - arg = arg->next; - info.field_flags = arg->value.integer8; + arg = arg->common.next; + info.field_flags = arg->common.value.integer8; + info.attribute = 0; /* Each remaining arg is a Named Field */ info.field_type = INTERNAL_TYPE_REGION_FIELD; info.region_node = region_node; - status = acpi_ds_get_field_names (&info, walk_state, arg->next); + status = acpi_ds_get_field_names (&info, walk_state, arg->common.next); return_ACPI_STATUS (status); } @@ -316,6 +352,92 @@ /******************************************************************************* * + * FUNCTION: Acpi_ds_init_field_objects + * + * PARAMETERS: Op - Op containing the Field definition and args + * ` Walk_state - Current method state + * + * RETURN: Status + * + * DESCRIPTION: For each "Field Unit" name in the argument list that is + * part of the field declaration, enter the name into the + * namespace. + * + ******************************************************************************/ + +acpi_status +acpi_ds_init_field_objects ( + acpi_parse_object *op, + acpi_walk_state *walk_state) +{ + acpi_status status; + acpi_parse_object *arg = NULL; + acpi_namespace_node *node; + u8 type = 0; + + + ACPI_FUNCTION_TRACE_PTR ("Ds_init_field_objects", op); + + + switch (walk_state->opcode) { + case AML_FIELD_OP: + arg = acpi_ps_get_arg (op, 2); + type = INTERNAL_TYPE_REGION_FIELD; + break; + + case AML_BANK_FIELD_OP: + arg = acpi_ps_get_arg (op, 4); + type = INTERNAL_TYPE_BANK_FIELD; + break; + + case AML_INDEX_FIELD_OP: + arg = acpi_ps_get_arg (op, 3); + type = INTERNAL_TYPE_INDEX_FIELD; + break; + + default: + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + /* + * Walk the list of entries in the Field_list + */ + while (arg) { + /* Ignore OFFSET and ACCESSAS terms here */ + + if (arg->common.aml_opcode == AML_INT_NAMEDFIELD_OP) { + status = acpi_ns_lookup (walk_state->scope_info, + (NATIVE_CHAR *) &arg->named.name, + type, ACPI_IMODE_LOAD_PASS1, + ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND, + walk_state, &node); + if (ACPI_FAILURE (status)) { + if (status != AE_ALREADY_EXISTS) { + return_ACPI_STATUS (status); + } + + ACPI_REPORT_ERROR (("Field name [%4.4s] already exists in current scope\n", + &arg->named.name)); + + /* Name already exists, just ignore this error */ + + status = AE_OK; + } + + arg->common.node = node; + } + + /* Move to next field in the list */ + + arg = arg->common.next; + } + + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: Acpi_ds_create_bank_field * * PARAMETERS: Op - Op containing the Field definition and args @@ -334,21 +456,21 @@ acpi_namespace_node *region_node, acpi_walk_state *walk_state) { - acpi_status status = AE_AML_ERROR; + acpi_status status; acpi_parse_object *arg; ACPI_CREATE_FIELD_INFO info; - FUNCTION_TRACE_PTR ("Ds_create_bank_field", op); + ACPI_FUNCTION_TRACE_PTR ("Ds_create_bank_field", op); /* First arg is the name of the parent Op_region (must already exist) */ - arg = op->value.arg; + arg = op->common.value.arg; if (!region_node) { - status = acpi_ns_lookup (walk_state->scope_info, arg->value.name, - ACPI_TYPE_REGION, IMODE_EXECUTE, - NS_SEARCH_PARENT, walk_state, ®ion_node); + status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.name, + ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, + ACPI_NS_SEARCH_PARENT, walk_state, ®ion_node); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -356,30 +478,30 @@ /* Second arg is the Bank Register (must already exist) */ - arg = arg->next; - status = acpi_ns_lookup (walk_state->scope_info, arg->value.string, - INTERNAL_TYPE_BANK_FIELD_DEFN, IMODE_EXECUTE, - NS_SEARCH_PARENT, walk_state, &info.register_node); + arg = arg->common.next; + status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, + INTERNAL_TYPE_BANK_FIELD_DEFN, ACPI_IMODE_EXECUTE, + ACPI_NS_SEARCH_PARENT, walk_state, &info.register_node); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } /* Third arg is the Bank_value */ - arg = arg->next; - info.bank_value = arg->value.integer32; + arg = arg->common.next; + info.bank_value = arg->common.value.integer32; /* Fourth arg is the field flags */ - arg = arg->next; - info.field_flags = arg->value.integer8; + arg = arg->common.next; + info.field_flags = arg->common.value.integer8; /* Each remaining arg is a Named Field */ info.field_type = INTERNAL_TYPE_BANK_FIELD; info.region_node = region_node; - status = acpi_ds_get_field_names (&info, walk_state, arg->next); + status = acpi_ds_get_field_names (&info, walk_state, arg->common.next); return_ACPI_STATUS (status); } @@ -410,33 +532,33 @@ ACPI_CREATE_FIELD_INFO info; - FUNCTION_TRACE_PTR ("Ds_create_index_field", op); + ACPI_FUNCTION_TRACE_PTR ("Ds_create_index_field", op); /* First arg is the name of the Index register (must already exist) */ - arg = op->value.arg; - status = acpi_ns_lookup (walk_state->scope_info, arg->value.string, - ACPI_TYPE_ANY, IMODE_EXECUTE, - NS_SEARCH_PARENT, walk_state, &info.register_node); + arg = op->common.value.arg; + status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, + ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, + ACPI_NS_SEARCH_PARENT, walk_state, &info.register_node); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } /* Second arg is the data register (must already exist) */ - arg = arg->next; - status = acpi_ns_lookup (walk_state->scope_info, arg->value.string, - INTERNAL_TYPE_INDEX_FIELD_DEFN, IMODE_EXECUTE, - NS_SEARCH_PARENT, walk_state, &info.data_register_node); + arg = arg->common.next; + status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, + INTERNAL_TYPE_INDEX_FIELD_DEFN, ACPI_IMODE_EXECUTE, + ACPI_NS_SEARCH_PARENT, walk_state, &info.data_register_node); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } /* Next arg is the field flags */ - arg = arg->next; - info.field_flags = arg->value.integer8; + arg = arg->common.next; + info.field_flags = arg->common.value.integer8; /* Each remaining arg is a Named Field */ @@ -444,7 +566,7 @@ info.field_type = INTERNAL_TYPE_INDEX_FIELD; info.region_node = region_node; - status = acpi_ds_get_field_names (&info, walk_state, arg->next); + status = acpi_ds_get_field_names (&info, walk_state, arg->common.next); return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/dispatcher/dsmethod.c lia64-2.4/drivers/acpi/dispatcher/dsmethod.c --- linux-2.4.18/drivers/acpi/dispatcher/dsmethod.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/dispatcher/dsmethod.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: dsmethod - Parser/Interpreter interface - control method parsing - * $Revision: 69 $ + * $Revision: 86 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,12 +30,10 @@ #include "acdispat.h" #include "acinterp.h" #include "acnamesp.h" -#include "actables.h" -#include "acdebug.h" #define _COMPONENT ACPI_DISPATCHER - MODULE_NAME ("dsmethod") + ACPI_MODULE_NAME ("dsmethod") /******************************************************************************* @@ -68,7 +66,7 @@ acpi_walk_state *walk_state; - FUNCTION_TRACE_PTR ("Ds_parse_method", obj_handle); + ACPI_FUNCTION_TRACE_PTR ("Ds_parse_method", obj_handle); /* Parameter Validation */ @@ -77,14 +75,13 @@ return_ACPI_STATUS (AE_NULL_ENTRY); } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Parsing [%4.4s] **** Named_obj=%p\n", - (char*)&((acpi_namespace_node *)obj_handle)->name, obj_handle)); - + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** Named_obj=%p\n", + ((acpi_namespace_node *) obj_handle)->name.ascii, obj_handle)); /* Extract the method object from the method Node */ node = (acpi_namespace_node *) obj_handle; - obj_desc = node->object; + obj_desc = acpi_ns_get_attached_object (node); if (!obj_desc) { return_ACPI_STATUS (AE_NULL_OBJECT); } @@ -112,13 +109,20 @@ /* Init new op with the method name and pointer back to the Node */ - acpi_ps_set_name (op, node->name); - op->node = node; + acpi_ps_set_name (op, node->name.integer); + op->common.node = node; + + /* + * Get a new Owner_id for objects created by this method. Namespace + * objects (such as Operation Regions) can be created during the + * first pass parse. + */ + owner_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD); + obj_desc->method.owning_id = owner_id; /* Create and initialize a new walk state */ - walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, - NULL, NULL, NULL); + walk_state = acpi_ds_create_walk_state (owner_id, NULL, NULL, NULL); if (!walk_state) { return_ACPI_STATUS (AE_NO_MEMORY); } @@ -126,7 +130,7 @@ status = acpi_ds_init_aml_walk (walk_state, op, node, obj_desc->method.aml_start, obj_desc->method.aml_length, NULL, NULL, 1); if (ACPI_FAILURE (status)) { - /* TBD: delete walk state */ + acpi_ds_delete_walk_state (walk_state); return_ACPI_STATUS (status); } @@ -145,16 +149,11 @@ return_ACPI_STATUS (status); } - /* Get a new Owner_id for objects created by this method */ - - owner_id = acpi_ut_allocate_owner_id (OWNER_TYPE_METHOD); - obj_desc->method.owning_id = owner_id; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** [%4.4s] Parsed **** Named_obj=%p Op=%p\n", - (char*)&((acpi_namespace_node *)obj_handle)->name, obj_handle, op)); + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, + "**** [%4.4s] Parsed **** Named_obj=%p Op=%p\n", + ((acpi_namespace_node *) obj_handle)->name.ascii, obj_handle, op)); acpi_ps_delete_parse_tree (op); - return_ACPI_STATUS (status); } @@ -186,14 +185,13 @@ acpi_status status = AE_OK; - FUNCTION_TRACE_PTR ("Ds_begin_method_execution", method_node); + ACPI_FUNCTION_TRACE_PTR ("Ds_begin_method_execution", method_node); if (!method_node) { return_ACPI_STATUS (AE_NULL_ENTRY); } - /* * If there is a concurrency limit on this method, we need to * obtain a unit from the method semaphore. @@ -221,13 +219,11 @@ WAIT_FOREVER); } - /* * Increment the method parse tree thread count since it has been * reentered one more time (even if it is the same thread) */ obj_desc->method.thread_count++; - return_ACPI_STATUS (status); } @@ -247,9 +243,9 @@ acpi_status acpi_ds_call_control_method ( - acpi_walk_list *walk_list, + ACPI_THREAD_STATE *thread, acpi_walk_state *this_walk_state, - acpi_parse_object *op) /* TBD: This operand is obsolete */ + acpi_parse_object *op) { acpi_status status; acpi_namespace_node *method_node; @@ -258,7 +254,7 @@ u32 i; - FUNCTION_TRACE_PTR ("Ds_call_control_method", this_walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ds_call_control_method", this_walk_state); ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Execute method %p, currentstate=%p\n", this_walk_state->prev_op, this_walk_state)); @@ -284,14 +280,12 @@ return_ACPI_STATUS (status); } - /* 1) Parse: Create a new walk state for the preempting walk */ next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id, op, obj_desc, NULL); if (!next_walk_state) { return_ACPI_STATUS (AE_NO_MEMORY); - goto cleanup; } /* Create and init a Root Node */ @@ -306,7 +300,7 @@ obj_desc->method.aml_start, obj_desc->method.aml_length, NULL, NULL, 1); if (ACPI_FAILURE (status)) { - /* TBD: delete walk state */ + acpi_ds_delete_walk_state (next_walk_state); goto cleanup; } @@ -315,11 +309,10 @@ status = acpi_ps_parse_aml (next_walk_state); acpi_ps_delete_parse_tree (op); - /* 2) Execute: Create a new state for the preempting walk */ next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id, - NULL, obj_desc, walk_list); + NULL, obj_desc, thread); if (!next_walk_state) { status = AE_NO_MEMORY; goto cleanup; @@ -353,8 +346,8 @@ this_walk_state->num_operands = 0; - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Starting nested execution, newstate=%p\n", - next_walk_state)); + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, + "Starting nested execution, newstate=%p\n", next_walk_state)); return_ACPI_STATUS (AE_OK); @@ -362,7 +355,7 @@ /* On error, we must delete the new walk state */ cleanup: - acpi_ds_terminate_control_method (next_walk_state); + (void) acpi_ds_terminate_control_method (next_walk_state); acpi_ds_delete_walk_state (next_walk_state); return_ACPI_STATUS (status); @@ -390,7 +383,7 @@ acpi_status status; - FUNCTION_TRACE_PTR ("Ds_restart_control_method", walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ds_restart_control_method", walk_state); if (return_desc) { @@ -405,7 +398,6 @@ return_ACPI_STATUS (status); } } - else { /* * Delete the return value if it will not be used by the @@ -413,7 +405,6 @@ */ acpi_ut_remove_reference (return_desc); } - } ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, @@ -421,7 +412,6 @@ walk_state->method_call_op, return_desc, walk_state->return_used, walk_state->results, walk_state)); - return_ACPI_STATUS (AE_OK); } @@ -446,12 +436,17 @@ { acpi_operand_object *obj_desc; acpi_namespace_node *method_node; + acpi_status status; - FUNCTION_TRACE_PTR ("Ds_terminate_control_method", walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ds_terminate_control_method", walk_state); - /* The method object should be stored in the walk state */ + if (!walk_state) { + return (AE_BAD_PARAMETER); + } + + /* The current method object was saved in the walk state */ obj_desc = walk_state->method_desc; if (!obj_desc) { @@ -467,14 +462,22 @@ * If this is the last thread executing the method, * we have additional cleanup to perform */ - acpi_ut_acquire_mutex (ACPI_MTX_PARSER); - + status = acpi_ut_acquire_mutex (ACPI_MTX_PARSER); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* Signal completion of the execution of this method if necessary */ if (walk_state->method_desc->method.semaphore) { - acpi_os_signal_semaphore ( - walk_state->method_desc->method.semaphore, 1); + status = acpi_os_signal_semaphore ( + walk_state->method_desc->method.semaphore, 1); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not signal method semaphore\n")); + status = AE_OK; + + /* Ignore error and continue cleanup */ + } } /* Decrement the thread count on the method parse tree */ @@ -493,7 +496,11 @@ * Delete any namespace entries created immediately underneath * the method */ - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + if (method_node->child) { acpi_ns_delete_namespace_subtree (method_node); } @@ -503,11 +510,14 @@ * the namespace */ acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owning_id); - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } } - acpi_ut_release_mutex (ACPI_MTX_PARSER); - return_ACPI_STATUS (AE_OK); + status = acpi_ut_release_mutex (ACPI_MTX_PARSER); + return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/dispatcher/dsmthdat.c lia64-2.4/drivers/acpi/dispatcher/dsmthdat.c --- linux-2.4.18/drivers/acpi/dispatcher/dsmthdat.c Mon Sep 24 15:06:38 2001 +++ lia64-2.4/drivers/acpi/dispatcher/dsmthdat.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: dsmthdat - control method arguments and local variables - * $Revision: 49 $ + * $Revision: 61 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,15 +25,13 @@ #include "acpi.h" -#include "acparser.h" #include "acdispat.h" -#include "acinterp.h" #include "amlcode.h" #include "acnamesp.h" #define _COMPONENT ACPI_DISPATCHER - MODULE_NAME ("dsmthdat") + ACPI_MODULE_NAME ("dsmthdat") /******************************************************************************* @@ -49,49 +47,48 @@ * This allows Ref_of and De_ref_of to work properly for these * special data types. * + * NOTES: Walk_state fields are initialized to zero by the + * ACPI_MEM_CALLOCATE(). + * + * A pseudo-Namespace Node is assigned to each argument and local + * so that Ref_of() can return a pointer to the Node. + * ******************************************************************************/ -acpi_status +void acpi_ds_method_data_init ( acpi_walk_state *walk_state) { u32 i; - FUNCTION_TRACE ("Ds_method_data_init"); + ACPI_FUNCTION_TRACE ("Ds_method_data_init"); - /* - * Walk_state fields are initialized to zero by the - * ACPI_MEM_CALLOCATE(). - * - * An Node is assigned to each argument and local so - * that Ref_of() can return a pointer to the Node. - */ /* Init the method arguments */ for (i = 0; i < MTH_NUM_ARGS; i++) { - MOVE_UNALIGNED32_TO_32 (&walk_state->arguments[i].name, + ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->arguments[i].name, NAMEOF_ARG_NTE); - walk_state->arguments[i].name |= (i << 24); - walk_state->arguments[i].data_type = ACPI_DESC_TYPE_NAMED; - walk_state->arguments[i].type = ACPI_TYPE_ANY; - walk_state->arguments[i].flags = ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_ARG; + walk_state->arguments[i].name.integer |= (i << 24); + walk_state->arguments[i].descriptor = ACPI_DESC_TYPE_NAMED; + walk_state->arguments[i].type = ACPI_TYPE_ANY; + walk_state->arguments[i].flags = ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_ARG; } /* Init the method locals */ for (i = 0; i < MTH_NUM_LOCALS; i++) { - MOVE_UNALIGNED32_TO_32 (&walk_state->local_variables[i].name, + ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->local_variables[i].name, NAMEOF_LOCAL_NTE); - walk_state->local_variables[i].name |= (i << 24); - walk_state->local_variables[i].data_type = ACPI_DESC_TYPE_NAMED; - walk_state->local_variables[i].type = ACPI_TYPE_ANY; - walk_state->local_variables[i].flags = ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_LOCAL; + walk_state->local_variables[i].name.integer |= (i << 24); + walk_state->local_variables[i].descriptor = ACPI_DESC_TYPE_NAMED; + walk_state->local_variables[i].type = ACPI_TYPE_ANY; + walk_state->local_variables[i].flags = ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_LOCAL; } - return_ACPI_STATUS (AE_OK); + return_VOID; } @@ -101,64 +98,50 @@ * * PARAMETERS: Walk_state - Current walk state object * - * RETURN: Status + * RETURN: None * * DESCRIPTION: Delete method locals and arguments. Arguments are only * deleted if this method was called from another method. * ******************************************************************************/ -acpi_status +void acpi_ds_method_data_delete_all ( acpi_walk_state *walk_state) { u32 index; - acpi_operand_object *object; - FUNCTION_TRACE ("Ds_method_data_delete_all"); + ACPI_FUNCTION_TRACE ("Ds_method_data_delete_all"); - /* Delete the locals */ - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting local variables in %p\n", walk_state)); + /* Detach the locals */ for (index = 0; index < MTH_NUM_LOCALS; index++) { - object = walk_state->local_variables[index].object; - if (object) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%d=%p\n", index, object)); - - /* Remove first */ + if (walk_state->local_variables[index].object) { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%d=%p\n", + index, walk_state->local_variables[index].object)); - walk_state->local_variables[index].object = NULL; + /* Detach object (if present) and remove a reference */ - /* Was given a ref when stored */ - - acpi_ut_remove_reference (object); - } + acpi_ns_detach_object (&walk_state->local_variables[index]); + } } - - /* Delete the arguments */ - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting arguments in %p\n", walk_state)); + /* Detach the arguments */ for (index = 0; index < MTH_NUM_ARGS; index++) { - object = walk_state->arguments[index].object; - if (object) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%d=%p\n", index, object)); - - /* Remove first */ - - walk_state->arguments[index].object = NULL; + if (walk_state->arguments[index].object) { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%d=%p\n", + index, walk_state->arguments[index].object)); - /* Was given a ref when stored */ + /* Detach object (if present) and remove a reference */ - acpi_ut_remove_reference (object); + acpi_ns_detach_object (&walk_state->arguments[index]); } } - return_ACPI_STATUS (AE_OK); + return_VOID; } @@ -172,7 +155,9 @@ * * RETURN: Status * - * DESCRIPTION: Initialize arguments for a method + * DESCRIPTION: Initialize arguments for a method. The parameter list is a list + * of ACPI operand objects, either null terminated or whose length + * is defined by Max_param_count. * ******************************************************************************/ @@ -183,11 +168,10 @@ acpi_walk_state *walk_state) { acpi_status status; - u32 mindex; - u32 pindex; + u32 index = 0; - FUNCTION_TRACE_PTR ("Ds_method_data_init_args", params); + ACPI_FUNCTION_TRACE_PTR ("Ds_method_data_init_args", params); if (!params) { @@ -197,106 +181,90 @@ /* Copy passed parameters into the new method stack frame */ - for (pindex = mindex = 0; - (mindex < MTH_NUM_ARGS) && (pindex < max_param_count); - mindex++) { - if (params[pindex]) { - /* - * A valid parameter. - * Set the current method argument to the - * Params[Pindex++] argument object descriptor - */ - status = acpi_ds_store_object_to_local (AML_ARG_OP, mindex, - params[pindex], walk_state); - if (ACPI_FAILURE (status)) { - break; - } - - pindex++; + while ((index < MTH_NUM_ARGS) && (index < max_param_count) && params[index]) { + /* + * A valid parameter. + * Store the argument in the method/walk descriptor + */ + status = acpi_ds_store_object_to_local (AML_ARG_OP, index, params[index], + walk_state); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } - else { - break; - } + index++; } - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%d args passed to method\n", pindex)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%d args passed to method\n", index)); return_ACPI_STATUS (AE_OK); } /******************************************************************************* * - * FUNCTION: Acpi_ds_method_data_get_entry + * FUNCTION: Acpi_ds_method_data_get_node * * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP - * Index - Which local_var or argument to get - * Entry - Pointer to where a pointer to the stack - * entry is returned. + * Index - Which local_var or argument whose type + * to get * Walk_state - Current walk state object * - * RETURN: Status - * - * DESCRIPTION: Get the address of the object entry given by Opcode:Index + * RETURN: Get the Node associated with a local or arg. * ******************************************************************************/ acpi_status -acpi_ds_method_data_get_entry ( +acpi_ds_method_data_get_node ( u16 opcode, u32 index, acpi_walk_state *walk_state, - acpi_operand_object ***entry) + acpi_namespace_node **node) { - - FUNCTION_TRACE_U32 ("Ds_method_data_get_entry", index); + ACPI_FUNCTION_TRACE ("Ds_method_data_get_node"); /* - * Get the requested object. - * The stack "Opcode" is either a Local_variable or an Argument + * Method Locals and Arguments are supported */ switch (opcode) { - case AML_LOCAL_OP: if (index > MTH_MAX_LOCAL) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Local_var index %d is invalid (max %d)\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Local index %d is invalid (max %d)\n", index, MTH_MAX_LOCAL)); - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_AML_INVALID_INDEX); } - *entry = (acpi_operand_object **) - &walk_state->local_variables[index].object; - break; + /* Return a pointer to the pseudo-node */ + *node = &walk_state->local_variables[index]; + break; case AML_ARG_OP: if (index > MTH_MAX_ARG) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Arg index %d is invalid (max %d)\n", index, MTH_MAX_ARG)); - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_AML_INVALID_INDEX); } - *entry = (acpi_operand_object **) - &walk_state->arguments[index].object; - break; + /* Return a pointer to the pseudo-node */ + *node = &walk_state->arguments[index]; + break; default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Opcode %d is invalid\n", opcode)); - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_AML_BAD_OPCODE); } - return_ACPI_STATUS (AE_OK); } /******************************************************************************* * - * FUNCTION: Acpi_ds_method_data_set_entry + * FUNCTION: Acpi_ds_method_data_set_value * * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP * Index - Which local_var or argument to get @@ -310,22 +278,22 @@ ******************************************************************************/ acpi_status -acpi_ds_method_data_set_entry ( +acpi_ds_method_data_set_value ( u16 opcode, u32 index, acpi_operand_object *object, acpi_walk_state *walk_state) { acpi_status status; - acpi_operand_object **entry; + acpi_namespace_node *node; - FUNCTION_TRACE ("Ds_method_data_set_entry"); + ACPI_FUNCTION_TRACE ("Ds_method_data_set_value"); - /* Get a pointer to the stack entry to set */ + /* Get the namespace node for the arg/local */ - status = acpi_ds_method_data_get_entry (opcode, index, walk_state, &entry); + status = acpi_ds_method_data_get_node (opcode, index, walk_state, &node); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -336,8 +304,7 @@ /* Install the object into the stack entry */ - *entry = object; - + node->object = object; return_ACPI_STATUS (AE_OK); } @@ -351,105 +318,43 @@ * to get * Walk_state - Current walk state object * - * RETURN: Data type of selected Arg or Local - * Used only in Exec_monadic2()/Type_op. + * RETURN: Data type of current value of the selected Arg or Local * ******************************************************************************/ -acpi_object_type8 +acpi_object_type acpi_ds_method_data_get_type ( u16 opcode, u32 index, acpi_walk_state *walk_state) { acpi_status status; - acpi_operand_object **entry; + acpi_namespace_node *node; acpi_operand_object *object; - FUNCTION_TRACE ("Ds_method_data_get_type"); + ACPI_FUNCTION_TRACE ("Ds_method_data_get_type"); - /* Get a pointer to the requested stack entry */ + /* Get the namespace node for the arg/local */ - status = acpi_ds_method_data_get_entry (opcode, index, walk_state, &entry); + status = acpi_ds_method_data_get_node (opcode, index, walk_state, &node); if (ACPI_FAILURE (status)) { return_VALUE ((ACPI_TYPE_NOT_FOUND)); } - /* Get the object from the method stack */ - - object = *entry; - - /* Get the object type */ + /* Get the object */ + object = acpi_ns_get_attached_object (node); if (!object) { - /* Any == 0 => "uninitialized" -- see spec 15.2.3.5.2.28 */ - return_VALUE (ACPI_TYPE_ANY); - } - - return_VALUE (object->common.type); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_ds_method_data_get_node - * - * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP - * Index - Which local_var or argument whose type - * to get - * Walk_state - Current walk state object - * - * RETURN: Get the Node associated with a local or arg. - * - ******************************************************************************/ + /* Uninitialized local/arg, return TYPE_ANY */ -acpi_namespace_node * -acpi_ds_method_data_get_node ( - u16 opcode, - u32 index, - acpi_walk_state *walk_state) -{ - acpi_namespace_node *node = NULL; - - - FUNCTION_TRACE ("Ds_method_data_get_node"); - - - switch (opcode) { - - case AML_LOCAL_OP: - - if (index > MTH_MAX_LOCAL) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Local index %d is invalid (max %d)\n", - index, MTH_MAX_LOCAL)); - return_PTR (node); - } - - node = &walk_state->local_variables[index]; - break; - - - case AML_ARG_OP: - - if (index > MTH_MAX_ARG) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Arg index %d is invalid (max %d)\n", - index, MTH_MAX_ARG)); - return_PTR (node); - } - - node = &walk_state->arguments[index]; - break; - - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Opcode %d is invalid\n", opcode)); - break; + return_VALUE (ACPI_TYPE_ANY); } + /* Get the object type */ - return_PTR (node); + return_VALUE (object->common.type); } @@ -479,11 +384,11 @@ acpi_operand_object **dest_desc) { acpi_status status; - acpi_operand_object **entry; + acpi_namespace_node *node; acpi_operand_object *object; - FUNCTION_TRACE ("Ds_method_data_get_value"); + ACPI_FUNCTION_TRACE ("Ds_method_data_get_value"); /* Validate the object descriptor */ @@ -493,24 +398,22 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* Get the namespace node for the arg/local */ - /* Get a pointer to the requested method stack entry */ - - status = acpi_ds_method_data_get_entry (opcode, index, walk_state, &entry); + status = acpi_ds_method_data_get_node (opcode, index, walk_state, &node); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } - /* Get the object from the method stack */ - - object = *entry; + /* Get the object from the node */ + object = node->object; /* Examine the returned object, it must be valid. */ if (!object) { /* - * Index points to uninitialized object stack value. + * Index points to uninitialized object. * This means that either 1) The expected argument was * not passed to the method, or 2) A local variable * was referenced by the method (via the ASL) @@ -519,25 +422,25 @@ switch (opcode) { case AML_ARG_OP: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Arg[%d] at entry %p\n", - index, entry)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Arg[%d] at node %p\n", + index, node)); return_ACPI_STATUS (AE_AML_UNINITIALIZED_ARG); - break; case AML_LOCAL_OP: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Local[%d] at entry %p\n", - index, entry)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Local[%d] at node %p\n", + index, node)); return_ACPI_STATUS (AE_AML_UNINITIALIZED_LOCAL); - break; + + default: + return_ACPI_STATUS (AE_AML_INTERNAL); } } - /* - * Index points to initialized and valid object stack value. + * The Index points to an initialized and valid object. * Return an additional reference to the object */ *dest_desc = object; @@ -555,56 +458,56 @@ * Index - Which local_var or argument to delete * Walk_state - Current walk state object * - * RETURN: Status + * RETURN: None * * DESCRIPTION: Delete the entry at Opcode:Index on the method stack. Inserts * a null into the stack slot after the object is deleted. * ******************************************************************************/ -acpi_status +void acpi_ds_method_data_delete_value ( u16 opcode, u32 index, acpi_walk_state *walk_state) { acpi_status status; - acpi_operand_object **entry; + acpi_namespace_node *node; acpi_operand_object *object; - FUNCTION_TRACE ("Ds_method_data_delete_value"); + ACPI_FUNCTION_TRACE ("Ds_method_data_delete_value"); - /* Get a pointer to the requested entry */ + /* Get the namespace node for the arg/local */ - status = acpi_ds_method_data_get_entry (opcode, index, walk_state, &entry); + status = acpi_ds_method_data_get_node (opcode, index, walk_state, &node); if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + return_VOID; } - /* Get the current entry in this slot k */ + /* Get the associated object */ - object = *entry; + object = acpi_ns_get_attached_object (node); /* * Undefine the Arg or Local by setting its descriptor * pointer to NULL. Locals/Args can contain both * ACPI_OPERAND_OBJECTS and ACPI_NAMESPACE_NODEs */ - *entry = NULL; + node->object = NULL; if ((object) && - (VALID_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_INTERNAL))) { + (ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_OPERAND)) { /* - * There is a valid object in this slot + * There is a valid object. * Decrement the reference count by one to balance the - * increment when the object was stored in the slot. + * increment when the object was stored. */ acpi_ut_remove_reference (object); } - return_ACPI_STATUS (AE_OK); + return_VOID; } @@ -614,14 +517,14 @@ * * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP * Index - Which local_var or argument to set - * Src_desc - Value to be stored + * Obj_desc - Value to be stored * Walk_state - Current walk state * * RETURN: Status * - * DESCRIPTION: Store a value in an Arg or Local. The Src_desc is installed + * DESCRIPTION: Store a value in an Arg or Local. The Obj_desc is installed * as the new value for the Arg or Local and the reference count - * for Src_desc is incremented. + * for Obj_desc is incremented. * ******************************************************************************/ @@ -629,45 +532,45 @@ acpi_ds_store_object_to_local ( u16 opcode, u32 index, - acpi_operand_object *src_desc, + acpi_operand_object *obj_desc, acpi_walk_state *walk_state) { acpi_status status; - acpi_operand_object **entry; + acpi_namespace_node *node; + acpi_operand_object *current_obj_desc; - FUNCTION_TRACE ("Ds_method_data_set_value"); + ACPI_FUNCTION_TRACE ("Ds_store_object_to_local"); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode=%d Idx=%d Obj=%p\n", - opcode, index, src_desc)); + opcode, index, obj_desc)); /* Parameter validation */ - if (!src_desc) { + if (!obj_desc) { return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* Get the namespace node for the arg/local */ - /* Get a pointer to the requested method stack entry */ - - status = acpi_ds_method_data_get_entry (opcode, index, walk_state, &entry); + status = acpi_ds_method_data_get_node (opcode, index, walk_state, &node); if (ACPI_FAILURE (status)) { - goto cleanup; + return_ACPI_STATUS (status); } - if (*entry == src_desc) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p already installed!\n", src_desc)); - goto cleanup; + current_obj_desc = acpi_ns_get_attached_object (node); + if (current_obj_desc == obj_desc) { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p already installed!\n", obj_desc)); + return_ACPI_STATUS (status); } - /* * If there is an object already in this slot, we either * have to delete it, or if this is an argument and there * is an object reference stored there, we have to do * an indirect store! */ - if (*entry) { + if (current_obj_desc) { /* * Check for an indirect store if an argument * contains an object reference (stored as an Node). @@ -685,36 +588,24 @@ * Weird, but true. */ if ((opcode == AML_ARG_OP) && - (VALID_DESCRIPTOR_TYPE (*entry, ACPI_DESC_TYPE_NAMED))) { + (ACPI_GET_DESCRIPTOR_TYPE (current_obj_desc) == ACPI_DESC_TYPE_NAMED)) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Arg (%p) is an Obj_ref(Node), storing in %p\n", - src_desc, *entry)); + "Arg (%p) is an Obj_ref(Node), storing in node %p\n", + obj_desc, current_obj_desc)); /* Detach an existing object from the Node */ - acpi_ns_detach_object ((acpi_namespace_node *) *entry); + acpi_ns_detach_object ((acpi_namespace_node *) current_obj_desc); /* * Store this object into the Node - * (do the indirect store) + * (perform the indirect store) */ - status = acpi_ns_attach_object ((acpi_namespace_node *) *entry, src_desc, - src_desc->common.type); + status = acpi_ns_attach_object ((acpi_namespace_node *) current_obj_desc, + obj_desc, obj_desc->common.type); return_ACPI_STATUS (status); } - -#ifdef ACPI_ENABLE_IMPLICIT_CONVERSION - /* - * Perform "Implicit conversion" of the new object to the type of the - * existing object - */ - status = acpi_ex_convert_to_target_type ((*entry)->common.type, &src_desc, walk_state); - if (ACPI_FAILURE (status)) { - goto cleanup; - } -#endif - /* * Delete the existing object * before storing the new one @@ -722,27 +613,14 @@ acpi_ds_method_data_delete_value (opcode, index, walk_state); } - /* - * Install the Obj_stack descriptor (*Src_desc) into + * Install the Obj_stack descriptor (*Obj_desc) into * the descriptor for the Arg or Local. * Install the new object in the stack entry * (increments the object reference count by one) */ - status = acpi_ds_method_data_set_entry (opcode, index, src_desc, walk_state); - if (ACPI_FAILURE (status)) { - goto cleanup; - } - - /* Normal exit */ - - return_ACPI_STATUS (AE_OK); - - - /* Error exit */ - -cleanup: - + status = acpi_ds_method_data_set_value (opcode, index, obj_desc, walk_state); return_ACPI_STATUS (status); } + diff -urN linux-2.4.18/drivers/acpi/dispatcher/dsobject.c lia64-2.4/drivers/acpi/dispatcher/dsobject.c --- linux-2.4.18/drivers/acpi/dispatcher/dsobject.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/dispatcher/dsobject.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: dsobject - Dispatcher object management routines - * $Revision: 81 $ + * $Revision: 99 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,11 +28,10 @@ #include "acparser.h" #include "amlcode.h" #include "acdispat.h" -#include "acinterp.h" #include "acnamesp.h" #define _COMPONENT ACPI_DISPATCHER - MODULE_NAME ("dsobject") + ACPI_MODULE_NAME ("dsobject") /******************************************************************************* @@ -47,11 +46,11 @@ * RETURN: Status * * DESCRIPTION: Callback from Acpi_walk_namespace. Invoked for every object - * within the namespace. + * within the namespace. * * Currently, the only objects that require initialization are: * 1) Methods - * 2) Op Regions + * 2) Operation Regions * ******************************************************************************/ @@ -62,18 +61,14 @@ void *context, void **return_value) { - acpi_object_type8 type; + acpi_object_type type; acpi_status status; acpi_init_walk_info *info = (acpi_init_walk_info *) context; - u8 table_revision; - PROC_NAME ("Ds_init_one_object"); + ACPI_FUNCTION_NAME ("Ds_init_one_object"); - info->object_count++; - table_revision = info->table_desc->pointer->revision; - /* * We are only interested in objects owned by the table that * was just loaded @@ -83,16 +78,21 @@ return (AE_OK); } + info->object_count++; /* And even then, we are only interested in a few object types */ type = acpi_ns_get_type (obj_handle); switch (type) { - case ACPI_TYPE_REGION: - acpi_ds_initialize_region (obj_handle); + status = acpi_ds_initialize_region (obj_handle); + if (ACPI_FAILURE (status)) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %p [%4.4s] - Init failure, %s\n", + obj_handle, ((acpi_namespace_node *) obj_handle)->name.ascii, + acpi_format_exception (status))); + } info->op_region_count++; break; @@ -109,9 +109,11 @@ /* * Set the execution data width (32 or 64) based upon the * revision number of the parent ACPI table. + * TBD: This is really for possible future support of integer width + * on a per-table basis. Currently, we just use a global for the width. */ - if (table_revision == 1) { - ((acpi_namespace_node *)obj_handle)->flags |= ANOBJ_DATA_WIDTH_32; + if (info->table_desc->pointer->revision == 1) { + ((acpi_namespace_node *) obj_handle)->flags |= ANOBJ_DATA_WIDTH_32; } /* @@ -121,7 +123,7 @@ status = acpi_ds_parse_method (obj_handle); if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] - parse failure, %s\n", - obj_handle, (char*)&((acpi_namespace_node *)obj_handle)->name, + obj_handle, ((acpi_namespace_node *) obj_handle)->name.ascii, acpi_format_exception (status))); /* This parse failed, but we will continue parsing more methods */ @@ -134,8 +136,16 @@ * for every execution since there isn't much overhead */ acpi_ns_delete_namespace_subtree (obj_handle); + acpi_ns_delete_namespace_by_owner (((acpi_namespace_node *) obj_handle)->object->method.owning_id); + break; + + + case ACPI_TYPE_DEVICE: + + info->device_count++; break; + default: break; } @@ -152,12 +162,13 @@ * * FUNCTION: Acpi_ds_initialize_objects * - * PARAMETERS: None + * PARAMETERS: Table_desc - Descriptor for parent ACPI table + * Start_node - Root of subtree to be initialized. * * RETURN: Status * - * DESCRIPTION: Walk the entire namespace and perform any necessary - * initialization on the objects found therein + * DESCRIPTION: Walk the namespace starting at "Start_node" and perform any + * necessary initialization on the objects found therein * ******************************************************************************/ @@ -170,35 +181,35 @@ acpi_init_walk_info info; - FUNCTION_TRACE ("Ds_initialize_objects"); + ACPI_FUNCTION_TRACE ("Ds_initialize_objects"); ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "**** Starting initialization of namespace objects ****\n")); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Parsing Methods:")); - info.method_count = 0; info.op_region_count = 0; info.object_count = 0; + info.device_count = 0; info.table_desc = table_desc; - /* Walk entire namespace from the supplied root */ status = acpi_walk_namespace (ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX, acpi_ds_init_one_object, &info, NULL); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Walk_namespace failed! %x\n", status)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Walk_namespace failed, %s\n", + acpi_format_exception (status))); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - "\n%d Control Methods found and parsed (%d nodes total)\n", - info.method_count, info.object_count)); - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "%d Control Methods found\n", info.method_count)); + "\n_table [%4.4s] - %hd Objects with %hd Devices %hd Methods %hd Regions\n", + table_desc->pointer->signature, info.object_count, + info.device_count, info.method_count, info.op_region_count)); + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "%d Op Regions found\n", info.op_region_count)); + "%hd Methods, %hd Regions\n", info.method_count, info.op_region_count)); return_ACPI_STATUS (AE_OK); } @@ -208,9 +219,10 @@ * * FUNCTION: Acpi_ds_init_object_from_op * - * PARAMETERS: Op - Parser op used to init the internal object + * PARAMETERS: Walk_state - Current walk state + * Op - Parser op used to init the internal object * Opcode - AML opcode associated with the object - * Obj_desc - Namespace object to be initialized + * Ret_obj_desc - Namespace object to be initialized * * RETURN: Status * @@ -227,15 +239,11 @@ u16 opcode, acpi_operand_object **ret_obj_desc) { - acpi_status status; - acpi_parse_object *arg; - acpi_parse2_object *byte_list; - acpi_operand_object *arg_desc; const acpi_opcode_info *op_info; acpi_operand_object *obj_desc; - PROC_NAME ("Ds_init_object_from_op"); + ACPI_FUNCTION_NAME ("Ds_init_object_from_op"); obj_desc = *ret_obj_desc; @@ -246,100 +254,41 @@ return (AE_TYPE); } - - /* Get and prepare the first argument */ + /* Perform per-object initialization */ switch (obj_desc->common.type) { case ACPI_TYPE_BUFFER: - /* First arg is a number */ - - acpi_ds_create_operand (walk_state, op->value.arg, 0); - arg_desc = walk_state->operands [walk_state->num_operands - 1]; - acpi_ds_obj_stack_pop (1, walk_state); - - /* Resolve the object (could be an arg or local) */ - - status = acpi_ex_resolve_to_value (&arg_desc, walk_state); - if (ACPI_FAILURE (status)) { - acpi_ut_remove_reference (arg_desc); - return (status); - } - - /* We are expecting a number */ - - if (arg_desc->common.type != ACPI_TYPE_INTEGER) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Expecting number, got obj: %p type %X\n", - arg_desc, arg_desc->common.type)); - acpi_ut_remove_reference (arg_desc); - return (AE_TYPE); - } - - /* Get the value, delete the internal object */ - - obj_desc->buffer.length = (u32) arg_desc->integer.value; - acpi_ut_remove_reference (arg_desc); - - /* Allocate the buffer */ - - if (obj_desc->buffer.length == 0) { - obj_desc->buffer.pointer = NULL; - REPORT_WARNING (("Buffer created with zero length in AML\n")); - break; - } - - else { - obj_desc->buffer.pointer = ACPI_MEM_CALLOCATE ( - obj_desc->buffer.length); - - if (!obj_desc->buffer.pointer) { - return (AE_NO_MEMORY); - } - } - /* - * Second arg is the buffer data (optional) Byte_list can be either - * individual bytes or a string initializer. + * Defer evaluation of Buffer Term_arg operand */ - arg = op->value.arg; /* skip first arg */ - - byte_list = (acpi_parse2_object *) arg->next; - if (byte_list) { - if (byte_list->opcode != AML_INT_BYTELIST_OP) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Expecting bytelist, got: %p\n", - byte_list)); - return (AE_TYPE); - } - - MEMCPY (obj_desc->buffer.pointer, byte_list->data, - obj_desc->buffer.length); - } - + obj_desc->buffer.node = (acpi_namespace_node *) walk_state->operands[0]; + obj_desc->buffer.aml_start = op->named.data; + obj_desc->buffer.aml_length = op->named.length; break; case ACPI_TYPE_PACKAGE: /* - * When called, an internal package object has already been built and - * is pointed to by Obj_desc. Acpi_ds_build_internal_object builds another - * internal package object, so remove reference to the original so - * that it is deleted. Error checking is done within the remove - * reference function. + * Defer evaluation of Package Term_arg operand */ - acpi_ut_remove_reference (obj_desc); - status = acpi_ds_build_internal_object (walk_state, op, ret_obj_desc); + obj_desc->package.node = (acpi_namespace_node *) walk_state->operands[0]; + obj_desc->package.aml_start = op->named.data; + obj_desc->package.aml_length = op->named.length; break; + case ACPI_TYPE_INTEGER: - obj_desc->integer.value = op->value.integer; + + obj_desc->integer.value = op->common.value.integer; break; case ACPI_TYPE_STRING: - obj_desc->string.pointer = op->value.string; - obj_desc->string.length = STRLEN (op->value.string); + + obj_desc->string.pointer = op->common.value.string; + obj_desc->string.length = ACPI_STRLEN (op->common.value.string); /* * The string is contained in the ACPI table, don't ever try @@ -376,22 +325,21 @@ default: /* Constants, Literals, etc.. */ - if (op->opcode == AML_INT_NAMEPATH_OP) { + if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) { /* Node was saved in Op */ - obj_desc->reference.node = op->node; + obj_desc->reference.node = op->common.node; } obj_desc->reference.opcode = opcode; break; } - break; default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unimplemented data type: %x\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unimplemented data type: %X\n", obj_desc->common.type)); break; @@ -403,9 +351,10 @@ /***************************************************************************** * - * FUNCTION: Acpi_ds_build_internal_simple_obj + * FUNCTION: Acpi_ds_build_internal_object * - * PARAMETERS: Op - Parser object to be translated + * PARAMETERS: Walk_state - Current walk state + * Op - Parser object to be translated * Obj_desc_ptr - Where the ACPI internal object is returned * * RETURN: Status @@ -415,96 +364,76 @@ * ****************************************************************************/ -static acpi_status -acpi_ds_build_internal_simple_obj ( +acpi_status +acpi_ds_build_internal_object ( acpi_walk_state *walk_state, acpi_parse_object *op, acpi_operand_object **obj_desc_ptr) { acpi_operand_object *obj_desc; - acpi_object_type8 type; acpi_status status; - u32 length; char *name; - FUNCTION_TRACE ("Ds_build_internal_simple_obj"); + ACPI_FUNCTION_TRACE ("Ds_build_internal_object"); - if (op->opcode == AML_INT_NAMEPATH_OP) { + if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) { /* - * This is an object reference. If The name was - * previously looked up in the NS, it is stored in this op. + * This is an object reference. If this name was + * previously looked up in the namespace, it was stored in this op. * Otherwise, go ahead and look it up now */ - if (!op->node) { - status = acpi_ns_lookup (walk_state->scope_info, - op->value.string, ACPI_TYPE_ANY, - IMODE_EXECUTE, - NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE, - NULL, - (acpi_namespace_node **)&(op->node)); + if (!op->common.node) { + status = acpi_ns_lookup (walk_state->scope_info, op->common.value.string, + ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, + ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, + (acpi_namespace_node **) &(op->common.node)); if (ACPI_FAILURE (status)) { if (status == AE_NOT_FOUND) { name = NULL; - acpi_ns_externalize_name (ACPI_UINT32_MAX, op->value.string, &length, &name); - - if (name) { - REPORT_WARNING (("Reference %s at AML %X not found\n", - name, op->aml_offset)); + status = acpi_ns_externalize_name (ACPI_UINT32_MAX, op->common.value.string, NULL, &name); + if (ACPI_SUCCESS (status)) { + ACPI_REPORT_WARNING (("Reference %s at AML %X not found\n", + name, op->common.aml_offset)); ACPI_MEM_FREE (name); } - else { - REPORT_WARNING (("Reference %s at AML %X not found\n", - op->value.string, op->aml_offset)); + ACPI_REPORT_WARNING (("Reference %s at AML %X not found\n", + op->common.value.string, op->common.aml_offset)); } *obj_desc_ptr = NULL; } - else { return_ACPI_STATUS (status); } } } - - /* - * The reference will be a Reference - * TBD: [Restructure] unless we really need a separate - * type of INTERNAL_TYPE_REFERENCE change - * Acpi_ds_map_opcode_to_data_type to handle this case - */ - type = INTERNAL_TYPE_REFERENCE; - } - else { - type = acpi_ds_map_opcode_to_data_type (op->opcode, NULL); } - /* Create and init the internal ACPI object */ - obj_desc = acpi_ut_create_internal_object (type); + obj_desc = acpi_ut_create_internal_object ((acpi_ps_get_opcode_info (op->common.aml_opcode))->object_type); if (!obj_desc) { return_ACPI_STATUS (AE_NO_MEMORY); } - status = acpi_ds_init_object_from_op (walk_state, op, op->opcode, &obj_desc); + status = acpi_ds_init_object_from_op (walk_state, op, op->common.aml_opcode, &obj_desc); if (ACPI_FAILURE (status)) { acpi_ut_remove_reference (obj_desc); return_ACPI_STATUS (status); } *obj_desc_ptr = obj_desc; - return_ACPI_STATUS (AE_OK); } /***************************************************************************** * - * FUNCTION: Acpi_ds_build_internal_package_obj + * FUNCTION: Acpi_ds_build_internal_buffer_obj * * PARAMETERS: Op - Parser object to be translated * Obj_desc_ptr - Where the ACPI internal object is returned @@ -517,114 +446,211 @@ ****************************************************************************/ acpi_status -acpi_ds_build_internal_package_obj ( +acpi_ds_build_internal_buffer_obj ( acpi_walk_state *walk_state, acpi_parse_object *op, + u32 buffer_length, acpi_operand_object **obj_desc_ptr) { acpi_parse_object *arg; acpi_operand_object *obj_desc; - acpi_status status = AE_OK; + acpi_parse_object *byte_list; + u32 byte_list_length = 0; - FUNCTION_TRACE ("Ds_build_internal_package_obj"); + ACPI_FUNCTION_TRACE ("Ds_build_internal_buffer_obj"); - obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_PACKAGE); - *obj_desc_ptr = obj_desc; - if (!obj_desc) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - if (op->opcode == AML_VAR_PACKAGE_OP) { + obj_desc = *obj_desc_ptr; + if (obj_desc) { /* - * Variable length package parameters are evaluated JIT + * We are evaluating a Named buffer object "Name (xxxx, Buffer)". + * The buffer object already exists (from the NS node) */ - return_ACPI_STATUS (AE_OK); } + else { + /* Create a new buffer object */ - /* The first argument must be the package length */ - - arg = op->value.arg; - obj_desc->package.count = arg->value.integer32; + obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER); + *obj_desc_ptr = obj_desc; + if (!obj_desc) { + return_ACPI_STATUS (AE_NO_MEMORY); + } + } /* - * Allocate the array of pointers (ptrs to the - * individual objects) Add an extra pointer slot so - * that the list is always null terminated. + * Second arg is the buffer data (optional) Byte_list can be either + * individual bytes or a string initializer. In either case, a + * Byte_list appears in the AML. */ - obj_desc->package.elements = ACPI_MEM_CALLOCATE ( - (obj_desc->package.count + 1) * sizeof (void *)); + arg = op->common.value.arg; /* skip first arg */ - if (!obj_desc->package.elements) { - acpi_ut_delete_object_desc (obj_desc); - return_ACPI_STATUS (AE_NO_MEMORY); - } + byte_list = arg->named.next; + if (byte_list) { + if (byte_list->common.aml_opcode != AML_INT_BYTELIST_OP) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Expecting bytelist, got AML opcode %X in op %p\n", + byte_list->common.aml_opcode, byte_list)); - obj_desc->package.next_element = obj_desc->package.elements; + acpi_ut_remove_reference (obj_desc); + return (AE_TYPE); + } + + byte_list_length = byte_list->common.value.integer32; + } /* - * Now init the elements of the package + * The buffer length (number of bytes) will be the larger of: + * 1) The specified buffer length and + * 2) The length of the initializer byte list */ - arg = arg->next; - while (arg) { - if (arg->opcode == AML_PACKAGE_OP) { - status = acpi_ds_build_internal_package_obj (walk_state, arg, - obj_desc->package.next_element); - } + obj_desc->buffer.length = buffer_length; + if (byte_list_length > buffer_length) { + obj_desc->buffer.length = byte_list_length; + } - else { - status = acpi_ds_build_internal_simple_obj (walk_state, arg, - obj_desc->package.next_element); - } + /* Allocate the buffer */ - obj_desc->package.next_element++; - arg = arg->next; + if (obj_desc->buffer.length == 0) { + obj_desc->buffer.pointer = NULL; + ACPI_REPORT_WARNING (("Buffer created with zero length in AML\n")); + return_ACPI_STATUS (AE_OK); } - obj_desc->package.flags |= AOPOBJ_DATA_VALID; - return_ACPI_STATUS (status); + obj_desc->buffer.pointer = ACPI_MEM_CALLOCATE ( + obj_desc->buffer.length); + if (!obj_desc->buffer.pointer) { + acpi_ut_delete_object_desc (obj_desc); + return_ACPI_STATUS (AE_NO_MEMORY); + } + + /* Initialize buffer from the Byte_list (if present) */ + + if (byte_list) { + ACPI_MEMCPY (obj_desc->buffer.pointer, byte_list->named.data, + byte_list_length); + } + + obj_desc->buffer.flags |= AOPOBJ_DATA_VALID; + op->common.node = (acpi_namespace_node *) obj_desc; + return_ACPI_STATUS (AE_OK); } /***************************************************************************** * - * FUNCTION: Acpi_ds_build_internal_object + * FUNCTION: Acpi_ds_build_internal_package_obj * * PARAMETERS: Op - Parser object to be translated * Obj_desc_ptr - Where the ACPI internal object is returned * * RETURN: Status * - * DESCRIPTION: Translate a parser Op object to the equivalent namespace - * object + * DESCRIPTION: Translate a parser Op package object to the equivalent + * namespace object * ****************************************************************************/ acpi_status -acpi_ds_build_internal_object ( +acpi_ds_build_internal_package_obj ( acpi_walk_state *walk_state, acpi_parse_object *op, + u32 package_length, acpi_operand_object **obj_desc_ptr) { - acpi_status status; + acpi_parse_object *arg; + acpi_parse_object *parent; + acpi_operand_object *obj_desc = NULL; + u32 package_list_length; + acpi_status status = AE_OK; + u32 i; - switch (op->opcode) { - case AML_PACKAGE_OP: - case AML_VAR_PACKAGE_OP: + ACPI_FUNCTION_TRACE ("Ds_build_internal_package_obj"); - status = acpi_ds_build_internal_package_obj (walk_state, op, obj_desc_ptr); - break; + /* Find the parent of a possibly nested package */ - default: + parent = op->common.parent; + while ((parent->common.aml_opcode == AML_PACKAGE_OP) || + (parent->common.aml_opcode == AML_VAR_PACKAGE_OP)) { + parent = parent->common.parent; + } - status = acpi_ds_build_internal_simple_obj (walk_state, op, obj_desc_ptr); - break; + obj_desc = *obj_desc_ptr; + if (obj_desc) { + /* + * We are evaluating a Named package object "Name (xxxx, Package)". + * Get the existing package object from the NS node + */ + } + else { + obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_PACKAGE); + *obj_desc_ptr = obj_desc; + if (!obj_desc) { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + obj_desc->package.node = parent->common.node; + } + + obj_desc->package.count = package_length; + + /* Count the number of items in the package list */ + + package_list_length = 0; + arg = op->common.value.arg; + arg = arg->common.next; + while (arg) { + package_list_length++; + arg = arg->common.next; + } + + /* + * The package length (number of elements) will be the greater + * of the specified length and the length of the initializer list + */ + if (package_list_length > package_length) { + obj_desc->package.count = package_list_length; } - return (status); + /* + * Allocate the pointer array (array of pointers to the + * individual objects). Add an extra pointer slot so + * that the list is always null terminated. + */ + obj_desc->package.elements = ACPI_MEM_CALLOCATE ( + ((ACPI_SIZE) obj_desc->package.count + 1) * sizeof (void *)); + + if (!obj_desc->package.elements) { + acpi_ut_delete_object_desc (obj_desc); + return_ACPI_STATUS (AE_NO_MEMORY); + } + + /* + * Now init the elements of the package + */ + i = 0; + arg = op->common.value.arg; + arg = arg->common.next; + while (arg) { + if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) { + /* Object (package or buffer) is already built */ + + obj_desc->package.elements[i] = ACPI_CAST_PTR (acpi_operand_object, arg->common.node); + } + else { + status = acpi_ds_build_internal_object (walk_state, arg, + &obj_desc->package.elements[i]); + } + + i++; + arg = arg->common.next; + } + + obj_desc->package.flags |= AOPOBJ_DATA_VALID; + op->common.node = (acpi_namespace_node *) obj_desc; + return_ACPI_STATUS (status); } @@ -651,7 +677,7 @@ acpi_operand_object *obj_desc; - FUNCTION_TRACE_PTR ("Ds_create_node", op); + ACPI_FUNCTION_TRACE_PTR ("Ds_create_node", op); /* @@ -659,11 +685,11 @@ * parts of the table, we can arrive here twice. Only init * the named object node the first time through */ - if (node->object) { + if (acpi_ns_get_attached_object (node)) { return_ACPI_STATUS (AE_OK); } - if (!op->value.arg) { + if (!op->common.value.arg) { /* No arguments, there is nothing to do */ return_ACPI_STATUS (AE_OK); @@ -671,7 +697,7 @@ /* Build an internal object for the argument(s) */ - status = acpi_ds_build_internal_object (walk_state, op->value.arg, &obj_desc); + status = acpi_ds_build_internal_object (walk_state, op->common.value.arg, &obj_desc); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -680,9 +706,9 @@ node->type = obj_desc->common.type; - /* Init obj */ + /* Attach obj to node */ - status = acpi_ns_attach_object (node, obj_desc, (u8) node->type); + status = acpi_ns_attach_object (node, obj_desc, node->type); /* Remove local reference to the object */ diff -urN linux-2.4.18/drivers/acpi/dispatcher/dsopcode.c lia64-2.4/drivers/acpi/dispatcher/dsopcode.c --- linux-2.4.18/drivers/acpi/dispatcher/dsopcode.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/dispatcher/dsopcode.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ * * Module Name: dsopcode - Dispatcher Op Region support and handling of * "control" opcodes - * $Revision: 56 $ + * $Revision: 79 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,96 +32,70 @@ #include "acinterp.h" #include "acnamesp.h" #include "acevents.h" -#include "actables.h" #define _COMPONENT ACPI_DISPATCHER - MODULE_NAME ("dsopcode") + ACPI_MODULE_NAME ("dsopcode") /***************************************************************************** * - * FUNCTION: Acpi_ds_get_buffer_field_arguments + * FUNCTION: Acpi_ds_execute_arguments * - * PARAMETERS: Obj_desc - A valid Buffer_field object + * PARAMETERS: Node - Parent NS node + * Aml_length - Length of executable AML + * Aml_start - Pointer to the AML * * RETURN: Status. * - * DESCRIPTION: Get Buffer_field Buffer and Index. This implements the late - * evaluation of these field attributes. + * DESCRIPTION: Late execution of region or field arguments * ****************************************************************************/ acpi_status -acpi_ds_get_buffer_field_arguments ( - acpi_operand_object *obj_desc) +acpi_ds_execute_arguments ( + acpi_namespace_node *node, + acpi_namespace_node *scope_node, + u32 aml_length, + u8 *aml_start) { - acpi_operand_object *extra_desc; - acpi_namespace_node *node; - acpi_parse_object *op; - acpi_parse_object *field_op; acpi_status status; - acpi_table_desc *table_desc; + acpi_parse_object *op; acpi_walk_state *walk_state; + acpi_parse_object *arg; - FUNCTION_TRACE_PTR ("Ds_get_buffer_field_arguments", obj_desc); - - - if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { - return_ACPI_STATUS (AE_OK); - } - - - /* Get the AML pointer (method object) and Buffer_field node */ - - extra_desc = obj_desc->buffer_field.extra; - node = obj_desc->buffer_field.node; - - DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Field]")); - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Buffer_field JIT Init\n", - (char*)&node->name)); + ACPI_FUNCTION_TRACE ("Acpi_ds_execute_arguments"); /* - * Allocate a new parser op to be the root of the parsed - * Op_region tree + * Allocate a new parser op to be the root of the parsed tree */ - op = acpi_ps_alloc_op (AML_SCOPE_OP); + op = acpi_ps_alloc_op (AML_INT_EVAL_SUBTREE_OP); if (!op) { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } /* Save the Node for use in Acpi_ps_parse_aml */ - op->node = acpi_ns_get_parent_object (node); - - /* Get a handle to the parent ACPI table */ - - status = acpi_tb_handle_to_object (node->owner_id, &table_desc); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } + op->common.node = scope_node; /* Create and initialize a new parser state */ - walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, - NULL, NULL, NULL); + walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, NULL, NULL, NULL); if (!walk_state) { return_ACPI_STATUS (AE_NO_MEMORY); } - status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start, - extra_desc->extra.aml_length, NULL, NULL, 1); + status = acpi_ds_init_aml_walk (walk_state, op, NULL, aml_start, + aml_length, NULL, NULL, 1); if (ACPI_FAILURE (status)) { - /* TBD: delete walk state */ + acpi_ds_delete_walk_state (walk_state); return_ACPI_STATUS (status); } - /* TBD: No Walk flags?? */ - walk_state->parse_flags = 0; - /* Pass1: Parse the entire Buffer_field declaration */ + /* Pass1: Parse the entire declaration */ status = acpi_ps_parse_aml (walk_state); if (ACPI_FAILURE (status)) { @@ -129,182 +103,228 @@ return_ACPI_STATUS (status); } - /* Get and init the actual Field_unit Op created above */ - - field_op = op->value.arg; - op->node = node; - + /* Get and init the Op created above */ - field_op = op->value.arg; - field_op->node = node; + arg = op->common.value.arg; + op->common.node = node; + arg->common.node = node; acpi_ps_delete_parse_tree (op); - /* Evaluate the address and length arguments for the Op_region */ + /* Evaluate the address and length arguments for the Buffer Field */ - op = acpi_ps_alloc_op (AML_SCOPE_OP); + op = acpi_ps_alloc_op (AML_INT_EVAL_SUBTREE_OP); if (!op) { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } - op->node = acpi_ns_get_parent_object (node); + op->common.node = scope_node; /* Create and initialize a new parser state */ - walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, - NULL, NULL, NULL); + walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, NULL, NULL, NULL); if (!walk_state) { return_ACPI_STATUS (AE_NO_MEMORY); } - status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start, - extra_desc->extra.aml_length, NULL, NULL, 3); + status = acpi_ds_init_aml_walk (walk_state, op, NULL, aml_start, + aml_length, NULL, NULL, 3); if (ACPI_FAILURE (status)) { - /* TBD: delete walk state */ + acpi_ds_delete_walk_state (walk_state); return_ACPI_STATUS (status); } status = acpi_ps_parse_aml (walk_state); acpi_ps_delete_parse_tree (op); - - /* - * The pseudo-method object is no longer needed since the region is - * now initialized - */ - acpi_ut_remove_reference (obj_desc->buffer_field.extra); - obj_desc->buffer_field.extra = NULL; - return_ACPI_STATUS (status); } /***************************************************************************** * - * FUNCTION: Acpi_ds_get_region_arguments + * FUNCTION: Acpi_ds_get_buffer_field_arguments * - * PARAMETERS: Obj_desc - A valid region object + * PARAMETERS: Obj_desc - A valid Buffer_field object * * RETURN: Status. * - * DESCRIPTION: Get region address and length. This implements the late - * evaluation of these region attributes. + * DESCRIPTION: Get Buffer_field Buffer and Index. This implements the late + * evaluation of these field attributes. * ****************************************************************************/ acpi_status -acpi_ds_get_region_arguments ( +acpi_ds_get_buffer_field_arguments ( acpi_operand_object *obj_desc) { - acpi_operand_object *extra_desc = NULL; + acpi_operand_object *extra_desc; acpi_namespace_node *node; - acpi_parse_object *op; - acpi_parse_object *region_op; acpi_status status; - acpi_table_desc *table_desc; - acpi_walk_state *walk_state; - FUNCTION_TRACE_PTR ("Ds_get_region_arguments", obj_desc); + ACPI_FUNCTION_TRACE_PTR ("Ds_get_buffer_field_arguments", obj_desc); - if (obj_desc->region.flags & AOPOBJ_DATA_VALID) { + if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { return_ACPI_STATUS (AE_OK); } + /* Get the AML pointer (method object) and Buffer_field node */ - /* Get the AML pointer (method object) and region node */ + extra_desc = acpi_ns_get_secondary_object (obj_desc); + node = obj_desc->buffer_field.node; - extra_desc = obj_desc->region.extra; - node = obj_desc->region.node; + ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Field]")); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Buffer_field JIT Init\n", + node->name.ascii)); - DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Operation Region]")); + /* Execute the AML code for the Term_arg arguments */ - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Op_region Init at AML %p\n", - (char*)&node->name, extra_desc->extra.aml_start)); + status = acpi_ds_execute_arguments (node, acpi_ns_get_parent_node (node), + extra_desc->extra.aml_length, extra_desc->extra.aml_start); + return_ACPI_STATUS (status); +} - /* - * Allocate a new parser op to be the root of the parsed - * Op_region tree - */ - op = acpi_ps_alloc_op (AML_SCOPE_OP); - if (!op) { - return (AE_NO_MEMORY); - } - /* Save the Node for use in Acpi_ps_parse_aml */ +/***************************************************************************** + * + * FUNCTION: Acpi_ds_get_buffer_arguments + * + * PARAMETERS: Obj_desc - A valid Bufferobject + * + * RETURN: Status. + * + * DESCRIPTION: Get Buffer length and initializer byte list. This implements + * the late evaluation of these attributes. + * + ****************************************************************************/ - op->node = acpi_ns_get_parent_object (node); +acpi_status +acpi_ds_get_buffer_arguments ( + acpi_operand_object *obj_desc) +{ + acpi_namespace_node *node; + acpi_status status; - /* Get a handle to the parent ACPI table */ - status = acpi_tb_handle_to_object (node->owner_id, &table_desc); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } + ACPI_FUNCTION_TRACE_PTR ("Ds_get_buffer_arguments", obj_desc); - /* Create and initialize a new parser state */ - walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, - op, NULL, NULL); - if (!walk_state) { - return_ACPI_STATUS (AE_NO_MEMORY); + if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { + return_ACPI_STATUS (AE_OK); } - status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start, - extra_desc->extra.aml_length, NULL, NULL, 1); - if (ACPI_FAILURE (status)) { - /* TBD: delete walk state */ - return_ACPI_STATUS (status); + /* Get the Buffer node */ + + node = obj_desc->buffer.node; + if (!node) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "No pointer back to NS node in buffer %p\n", obj_desc)); + return_ACPI_STATUS (AE_AML_INTERNAL); } - /* TBD: No Walk flags?? */ + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer JIT Init\n")); - walk_state->parse_flags = 0; + /* Execute the AML code for the Term_arg arguments */ - /* Parse the entire Op_region declaration, creating a parse tree */ + status = acpi_ds_execute_arguments (node, node, + obj_desc->buffer.aml_length, obj_desc->buffer.aml_start); + return_ACPI_STATUS (status); +} - status = acpi_ps_parse_aml (walk_state); - if (ACPI_FAILURE (status)) { - acpi_ps_delete_parse_tree (op); - return_ACPI_STATUS (status); - } - /* Get and init the actual Region_op created above */ +/***************************************************************************** + * + * FUNCTION: Acpi_ds_get_package_arguments + * + * PARAMETERS: Obj_desc - A valid Packageobject + * + * RETURN: Status. + * + * DESCRIPTION: Get Package length and initializer byte list. This implements + * the late evaluation of these attributes. + * + ****************************************************************************/ - region_op = op->value.arg; - op->node = node; +acpi_status +acpi_ds_get_package_arguments ( + acpi_operand_object *obj_desc) +{ + acpi_namespace_node *node; + acpi_status status; - region_op = op->value.arg; - region_op->node = node; - acpi_ps_delete_parse_tree (op); + ACPI_FUNCTION_TRACE_PTR ("Ds_get_package_arguments", obj_desc); - /* Evaluate the address and length arguments for the Op_region */ - op = acpi_ps_alloc_op (AML_SCOPE_OP); - if (!op) { - return (AE_NO_MEMORY); + if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { + return_ACPI_STATUS (AE_OK); } - op->node = acpi_ns_get_parent_object (node); + /* Get the Package node */ - /* Create and initialize a new parser state */ + node = obj_desc->package.node; + if (!node) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "No pointer back to NS node in package %p\n", obj_desc)); + return_ACPI_STATUS (AE_AML_INTERNAL); + } - walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, - op, NULL, NULL); - if (!walk_state) { - return_ACPI_STATUS (AE_NO_MEMORY); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package JIT Init\n")); + + /* Execute the AML code for the Term_arg arguments */ + + status = acpi_ds_execute_arguments (node, node, + obj_desc->package.aml_length, obj_desc->package.aml_start); + return_ACPI_STATUS (status); +} + + +/***************************************************************************** + * + * FUNCTION: Acpi_ds_get_region_arguments + * + * PARAMETERS: Obj_desc - A valid region object + * + * RETURN: Status. + * + * DESCRIPTION: Get region address and length. This implements the late + * evaluation of these region attributes. + * + ****************************************************************************/ + +acpi_status +acpi_ds_get_region_arguments ( + acpi_operand_object *obj_desc) +{ + acpi_namespace_node *node; + acpi_status status; + acpi_operand_object *extra_desc; + + + ACPI_FUNCTION_TRACE_PTR ("Ds_get_region_arguments", obj_desc); + + + if (obj_desc->region.flags & AOPOBJ_DATA_VALID) { + return_ACPI_STATUS (AE_OK); } - status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start, - extra_desc->extra.aml_length, NULL, NULL, 3); - if (ACPI_FAILURE (status)) { - /* TBD: delete walk state */ - return_ACPI_STATUS (status); + extra_desc = acpi_ns_get_secondary_object (obj_desc); + if (!extra_desc) { + return_ACPI_STATUS (AE_NOT_EXIST); } - status = acpi_ps_parse_aml (walk_state); - acpi_ps_delete_parse_tree (op); + /* Get the Region node */ + + node = obj_desc->region.node; + + ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Operation Region]")); + + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Op_region Init at AML %p\n", + node->name.ascii, extra_desc->extra.aml_start)); + + status = acpi_ds_execute_arguments (node, acpi_ns_get_parent_node (node), + extra_desc->extra.aml_length, extra_desc->extra.aml_start); return_ACPI_STATUS (status); } @@ -317,7 +337,7 @@ * * RETURN: Status * - * DESCRIPTION: + * DESCRIPTION: Front end to Ev_initialize_region * ****************************************************************************/ @@ -334,301 +354,276 @@ /* Namespace is NOT locked */ status = acpi_ev_initialize_region (obj_desc, FALSE); - return (status); } /***************************************************************************** * - * FUNCTION: Acpi_ds_eval_buffer_field_operands + * FUNCTION: Acpi_ds_init_buffer_field * - * PARAMETERS: Op - A valid Buffer_field Op object + * PARAMETERS: Aml_opcode - Create_xxx_field + * Obj_desc - Buffer_field object + * Buffer_desc - Host Buffer + * Offset_desc - Offset into buffer + * Length - Length of field (CREATE_FIELD_OP only) + * Result - Where to store the result * * RETURN: Status * - * DESCRIPTION: Get Buffer_field Buffer and Index - * Called from Acpi_ds_exec_end_op during Buffer_field parse tree walk - * - * ACPI SPECIFICATION REFERENCES: - * Each of the Buffer Field opcodes is defined as specified in in-line - * comments below. For each one, use the following definitions. - * - * Def_bit_field := Bit_field_op Src_buf Bit_idx Destination - * Def_byte_field := Byte_field_op Src_buf Byte_idx Destination - * Def_create_field := Create_field_op Src_buf Bit_idx Num_bits Name_string - * Def_dWord_field := DWord_field_op Src_buf Byte_idx Destination - * Def_word_field := Word_field_op Src_buf Byte_idx Destination - * Bit_index := Term_arg=>Integer - * Byte_index := Term_arg=>Integer - * Destination := Name_string - * Num_bits := Term_arg=>Integer - * Source_buf := Term_arg=>Buffer + * DESCRIPTION: Perform actual initialization of a buffer field * ****************************************************************************/ acpi_status -acpi_ds_eval_buffer_field_operands ( - acpi_walk_state *walk_state, - acpi_parse_object *op) +acpi_ds_init_buffer_field ( + u16 aml_opcode, + acpi_operand_object *obj_desc, + acpi_operand_object *buffer_desc, + acpi_operand_object *offset_desc, + acpi_operand_object *length_desc, + acpi_operand_object *result_desc) { - acpi_status status; - acpi_operand_object *obj_desc; - acpi_namespace_node *node; - acpi_parse_object *next_op; u32 offset; u32 bit_offset; u32 bit_count; u8 field_flags; - acpi_operand_object *res_desc = NULL; - acpi_operand_object *cnt_desc = NULL; - acpi_operand_object *off_desc = NULL; - acpi_operand_object *src_desc = NULL; - - - FUNCTION_TRACE_PTR ("Ds_eval_buffer_field_operands", op); - - - /* - * This is where we evaluate the address and length fields of the - * Create_xxx_field declaration - */ - node = op->node; - - /* Next_op points to the op that holds the Buffer */ - - next_op = op->value.arg; - - /* Acpi_evaluate/create the address and length operands */ + acpi_status status; - status = acpi_ds_create_operands (walk_state, next_op); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - obj_desc = acpi_ns_get_attached_object (node); - if (!obj_desc) { - return_ACPI_STATUS (AE_NOT_EXIST); - } + ACPI_FUNCTION_TRACE_PTR ("Ds_init_buffer_field", obj_desc); - /* Resolve the operands */ + /* Host object must be a Buffer */ - status = acpi_ex_resolve_operands (op->opcode, WALK_OPERANDS, walk_state); - DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, acpi_ps_get_opcode_name (op->opcode), - walk_state->num_operands, "after Acpi_ex_resolve_operands"); - - if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) bad operand(s) (%X)\n", - acpi_ps_get_opcode_name (op->opcode), status)); + if (buffer_desc->common.type != ACPI_TYPE_BUFFER) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Target of Create Field is not a Buffer object - %s\n", + acpi_ut_get_type_name (buffer_desc->common.type))); + status = AE_AML_OPERAND_TYPE; goto cleanup; } - /* Get the operands */ - - if (AML_CREATE_FIELD_OP == op->opcode) { - res_desc = walk_state->operands[3]; - cnt_desc = walk_state->operands[2]; - } - else { - res_desc = walk_state->operands[2]; - } - - off_desc = walk_state->operands[1]; - src_desc = walk_state->operands[0]; - - - offset = (u32) off_desc->integer.value; - /* - * If Res_desc is a Name, it will be a direct name pointer after - * Acpi_ex_resolve_operands() + * The last parameter to all of these opcodes (Result_desc) started + * out as a Name_string, and should therefore now be a NS node + * after resolution in Acpi_ex_resolve_operands(). */ - if (!VALID_DESCRIPTOR_TYPE (res_desc, ACPI_DESC_TYPE_NAMED)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination must be a Node\n", - acpi_ps_get_opcode_name (op->opcode))); + if (ACPI_GET_DESCRIPTOR_TYPE (result_desc) != ACPI_DESC_TYPE_NAMED) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination must be a NS Node\n", + acpi_ps_get_opcode_name (aml_opcode))); status = AE_AML_OPERAND_TYPE; goto cleanup; } + offset = (u32) offset_desc->integer.value; + /* * Setup the Bit offsets and counts, according to the opcode */ - switch (op->opcode) { - - /* Def_create_field */ - + switch (aml_opcode) { case AML_CREATE_FIELD_OP: /* Offset is in bits, count is in bits */ - bit_offset = offset; - bit_count = (u32) cnt_desc->integer.value; - field_flags = ACCESS_BYTE_ACC; + bit_offset = offset; + bit_count = (u32) length_desc->integer.value; + field_flags = AML_FIELD_ACCESS_BYTE; break; - - /* Def_create_bit_field */ - case AML_CREATE_BIT_FIELD_OP: /* Offset is in bits, Field is one bit */ - bit_offset = offset; - bit_count = 1; - field_flags = ACCESS_BYTE_ACC; + bit_offset = offset; + bit_count = 1; + field_flags = AML_FIELD_ACCESS_BYTE; break; - - /* Def_create_byte_field */ - case AML_CREATE_BYTE_FIELD_OP: /* Offset is in bytes, field is one byte */ - bit_offset = 8 * offset; - bit_count = 8; - field_flags = ACCESS_BYTE_ACC; + bit_offset = 8 * offset; + bit_count = 8; + field_flags = AML_FIELD_ACCESS_BYTE; break; - - /* Def_create_word_field */ - case AML_CREATE_WORD_FIELD_OP: /* Offset is in bytes, field is one word */ - bit_offset = 8 * offset; - bit_count = 16; - field_flags = ACCESS_WORD_ACC; + bit_offset = 8 * offset; + bit_count = 16; + field_flags = AML_FIELD_ACCESS_WORD; break; - - /* Def_create_dWord_field */ - case AML_CREATE_DWORD_FIELD_OP: /* Offset is in bytes, field is one dword */ - bit_offset = 8 * offset; - bit_count = 32; - field_flags = ACCESS_DWORD_ACC; + bit_offset = 8 * offset; + bit_count = 32; + field_flags = AML_FIELD_ACCESS_DWORD; break; - - /* Def_create_qWord_field */ - case AML_CREATE_QWORD_FIELD_OP: /* Offset is in bytes, field is one qword */ - bit_offset = 8 * offset; - bit_count = 64; - field_flags = ACCESS_QWORD_ACC; + bit_offset = 8 * offset; + bit_count = 64; + field_flags = AML_FIELD_ACCESS_QWORD; break; - default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Internal error - unknown field creation opcode %02x\n", - op->opcode)); + "Unknown field creation opcode %02x\n", + aml_opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; } + /* Entire field must fit within the current length of the buffer */ + + if ((bit_offset + bit_count) > + (8 * (u32) buffer_desc->buffer.length)) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Field size %d exceeds Buffer size %d (bits)\n", + bit_offset + bit_count, 8 * (u32) buffer_desc->buffer.length)); + status = AE_AML_BUFFER_LIMIT; + goto cleanup; + } + /* - * Setup field according to the object type + * Initialize areas of the field object that are common to all fields + * For Field_flags, use LOCK_RULE = 0 (NO_LOCK), UPDATE_RULE = 0 (UPDATE_PRESERVE) */ - switch (src_desc->common.type) { + status = acpi_ex_prep_common_field_object (obj_desc, field_flags, 0, + bit_offset, bit_count); + if (ACPI_FAILURE (status)) { + goto cleanup; + } - /* Source_buff := Term_arg=>Buffer */ + obj_desc->buffer_field.buffer_obj = buffer_desc; - case ACPI_TYPE_BUFFER: + /* Reference count for Buffer_desc inherits Obj_desc count */ - if ((bit_offset + bit_count) > - (8 * (u32) src_desc->buffer.length)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Field size %d exceeds Buffer size %d (bits)\n", - bit_offset + bit_count, 8 * (u32) src_desc->buffer.length)); - status = AE_AML_BUFFER_LIMIT; - goto cleanup; - } + buffer_desc->common.reference_count = (u16) (buffer_desc->common.reference_count + + obj_desc->common.reference_count); - /* - * Initialize areas of the field object that are common to all fields - * For Field_flags, use LOCK_RULE = 0 (NO_LOCK), UPDATE_RULE = 0 (UPDATE_PRESERVE) - */ - status = acpi_ex_prep_common_field_object (obj_desc, field_flags, - bit_offset, bit_count); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } +cleanup: - obj_desc->buffer_field.buffer_obj = src_desc; + /* Always delete the operands */ - /* Reference count for Src_desc inherits Obj_desc count */ + acpi_ut_remove_reference (offset_desc); + acpi_ut_remove_reference (buffer_desc); - src_desc->common.reference_count = (u16) (src_desc->common.reference_count + - obj_desc->common.reference_count); + if (aml_opcode == AML_CREATE_FIELD_OP) { + acpi_ut_remove_reference (length_desc); + } - break; + /* On failure, delete the result descriptor */ + if (ACPI_FAILURE (status)) { + acpi_ut_remove_reference (result_desc); /* Result descriptor */ + } + else { + /* Now the address and length are valid for this Buffer_field */ - /* Improper object type */ + obj_desc->buffer_field.flags |= AOPOBJ_DATA_VALID; + } - default: + return_ACPI_STATUS (status); +} - if ((src_desc->common.type > (u8) INTERNAL_TYPE_REFERENCE) || !acpi_ut_valid_object_type (src_desc->common.type)) /* TBD: This line MUST be a single line until Acpi_src can handle it (block deletion) */ { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Tried to create field in invalid object type %X\n", - src_desc->common.type)); - } - else { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Tried to create field in improper object type - %s\n", - acpi_ut_get_type_name (src_desc->common.type))); - } +/***************************************************************************** + * + * FUNCTION: Acpi_ds_eval_buffer_field_operands + * + * PARAMETERS: Walk_state - Current walk + * Op - A valid Buffer_field Op object + * + * RETURN: Status + * + * DESCRIPTION: Get Buffer_field Buffer and Index + * Called from Acpi_ds_exec_end_op during Buffer_field parse tree walk + * + ****************************************************************************/ - status = AE_AML_OPERAND_TYPE; - goto cleanup; - } +acpi_status +acpi_ds_eval_buffer_field_operands ( + acpi_walk_state *walk_state, + acpi_parse_object *op) +{ + acpi_status status; + acpi_operand_object *obj_desc; + acpi_namespace_node *node; + acpi_parse_object *next_op; - if (AML_CREATE_FIELD_OP == op->opcode) { - /* Delete object descriptor unique to Create_field */ + ACPI_FUNCTION_TRACE_PTR ("Ds_eval_buffer_field_operands", op); - acpi_ut_remove_reference (cnt_desc); - cnt_desc = NULL; - } + /* + * This is where we evaluate the address and length fields of the + * Create_xxx_field declaration + */ + node = op->common.node; + + /* Next_op points to the op that holds the Buffer */ -cleanup: + next_op = op->common.value.arg; - /* Always delete the operands */ + /* Evaluate/create the address and length operands */ - acpi_ut_remove_reference (off_desc); - acpi_ut_remove_reference (src_desc); + status = acpi_ds_create_operands (walk_state, next_op); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - if (AML_CREATE_FIELD_OP == op->opcode) { - acpi_ut_remove_reference (cnt_desc); + obj_desc = acpi_ns_get_attached_object (node); + if (!obj_desc) { + return_ACPI_STATUS (AE_NOT_EXIST); } - /* On failure, delete the result descriptor */ + /* Resolve the operands */ + + status = acpi_ex_resolve_operands (op->common.aml_opcode, + ACPI_WALK_OPERANDS, walk_state); + + ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE, + acpi_ps_get_opcode_name (op->common.aml_opcode), + walk_state->num_operands, "after Acpi_ex_resolve_operands"); if (ACPI_FAILURE (status)) { - acpi_ut_remove_reference (res_desc); /* Result descriptor */ + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) bad operand(s) (%X)\n", + acpi_ps_get_opcode_name (op->common.aml_opcode), status)); + + return_ACPI_STATUS (status); } + /* Initialize the Buffer Field */ + + if (op->common.aml_opcode == AML_CREATE_FIELD_OP) { + /* NOTE: Slightly different operands for this opcode */ + + status = acpi_ds_init_buffer_field (op->common.aml_opcode, obj_desc, + walk_state->operands[0], walk_state->operands[1], + walk_state->operands[2], walk_state->operands[3]); + } else { - /* Now the address and length are valid for this Buffer_field */ + /* All other, Create_xxx_field opcodes */ - obj_desc->buffer_field.flags |= AOPOBJ_DATA_VALID; + status = acpi_ds_init_buffer_field (op->common.aml_opcode, obj_desc, + walk_state->operands[0], walk_state->operands[1], + NULL, walk_state->operands[2]); } return_ACPI_STATUS (status); @@ -639,7 +634,8 @@ * * FUNCTION: Acpi_ds_eval_region_operands * - * PARAMETERS: Op - A valid region Op object + * PARAMETERS: Walk_state - Current walk + * Op - A valid region Op object * * RETURN: Status * @@ -660,23 +656,23 @@ acpi_parse_object *next_op; - FUNCTION_TRACE_PTR ("Ds_eval_region_operands", op); + ACPI_FUNCTION_TRACE_PTR ("Ds_eval_region_operands", op); /* * This is where we evaluate the address and length fields of the Op_region declaration */ - node = op->node; + node = op->common.node; /* Next_op points to the op that holds the Space_iD */ - next_op = op->value.arg; + next_op = op->common.value.arg; /* Next_op points to address op */ - next_op = next_op->next; + next_op = next_op->common.next; - /* Acpi_evaluate/create the address and length operands */ + /* Evaluate/create the address and length operands */ status = acpi_ds_create_operands (walk_state, next_op); if (ACPI_FAILURE (status)) { @@ -685,16 +681,15 @@ /* Resolve the length and address operands to numbers */ - status = acpi_ex_resolve_operands (op->opcode, WALK_OPERANDS, walk_state); + status = acpi_ex_resolve_operands (op->common.aml_opcode, ACPI_WALK_OPERANDS, walk_state); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } - DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, - acpi_ps_get_opcode_name (op->opcode), + ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE, + acpi_ps_get_opcode_name (op->common.aml_opcode), 1, "after Acpi_ex_resolve_operands"); - obj_desc = acpi_ns_get_attached_object (node); if (!obj_desc) { return_ACPI_STATUS (AE_NOT_EXIST); @@ -718,9 +713,9 @@ obj_desc->region.address = (ACPI_PHYSICAL_ADDRESS) operand_desc->integer.value; acpi_ut_remove_reference (operand_desc); - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Rgn_obj %p Addr %8.8X%8.8X Len %X\n", - obj_desc, HIDWORD(obj_desc->region.address), LODWORD(obj_desc->region.address), + obj_desc, + ACPI_HIDWORD (obj_desc->region.address), ACPI_LODWORD (obj_desc->region.address), obj_desc->region.length)); /* Now the address and length are valid for this opregion */ @@ -731,6 +726,101 @@ } +/***************************************************************************** + * + * FUNCTION: Acpi_ds_eval_data_object_operands + * + * PARAMETERS: Walk_state - Current walk + * Op - A valid Data_object Op object + * Obj_desc - Data_object + * + * RETURN: Status + * + * DESCRIPTION: Get the operands and complete the following data objec types: + * Buffer + * Package + * + ****************************************************************************/ + +acpi_status +acpi_ds_eval_data_object_operands ( + acpi_walk_state *walk_state, + acpi_parse_object *op, + acpi_operand_object *obj_desc) +{ + acpi_status status; + acpi_operand_object *arg_desc; + u32 length; + + + ACPI_FUNCTION_TRACE ("Ds_eval_data_object_operands"); + + + /* The first operand (for all of these data objects) is the length */ + + status = acpi_ds_create_operand (walk_state, op->common.value.arg, 1); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + status = acpi_ex_resolve_operands (walk_state->opcode, + &(walk_state->operands [walk_state->num_operands -1]), + walk_state); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + /* Extract length operand */ + + arg_desc = walk_state->operands [walk_state->num_operands - 1]; + length = (u32) arg_desc->integer.value; + + /* Cleanup for length operand */ + + status = acpi_ds_obj_stack_pop (1, walk_state); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + acpi_ut_remove_reference (arg_desc); + + /* + * Create the actual data object + */ + switch (op->common.aml_opcode) { + case AML_BUFFER_OP: + + status = acpi_ds_build_internal_buffer_obj (walk_state, op, length, &obj_desc); + break; + + case AML_PACKAGE_OP: + case AML_VAR_PACKAGE_OP: + + status = acpi_ds_build_internal_package_obj (walk_state, op, length, &obj_desc); + break; + + default: + return_ACPI_STATUS (AE_AML_BAD_OPCODE); + } + + if (ACPI_SUCCESS (status)) { + /* + * Return the object in the Walk_state, unless the parent is a package -- + * in this case, the return object will be stored in the parse tree + * for the package. + */ + if ((!op->common.parent) || + ((op->common.parent->common.aml_opcode != AML_PACKAGE_OP) && + (op->common.parent->common.aml_opcode != AML_VAR_PACKAGE_OP) && + (op->common.parent->common.aml_opcode != AML_NAME_OP))) { + walk_state->result_obj = obj_desc; + } + } + + return_ACPI_STATUS (status); +} + + /******************************************************************************* * * FUNCTION: Acpi_ds_exec_begin_control_op @@ -754,13 +844,13 @@ acpi_generic_state *control_state; - PROC_NAME ("Ds_exec_begin_control_op"); + ACPI_FUNCTION_NAME ("Ds_exec_begin_control_op"); ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p Opcode=%2.2X State=%p\n", op, - op->opcode, walk_state)); + op->common.aml_opcode, walk_state)); - switch (op->opcode) { + switch (op->common.aml_opcode) { case AML_IF_OP: case AML_WHILE_OP: @@ -774,19 +864,19 @@ status = AE_NO_MEMORY; break; } - - acpi_ut_push_generic_state (&walk_state->control_state, control_state); - /* * Save a pointer to the predicate for multiple executions * of a loop */ - walk_state->control_state->control.aml_predicate_start = - walk_state->parser_state.aml - 1; - /* TBD: can this be removed? */ - /*Acpi_ps_pkg_length_encoding_size (GET8 (Walk_state->Parser_state->Aml));*/ - break; + control_state->control.aml_predicate_start = walk_state->parser_state.aml - 1; + control_state->control.package_end = walk_state->parser_state.pkg_end; + control_state->control.opcode = op->common.aml_opcode; + + + /* Push the control state on this walk's control stack */ + acpi_ut_push_generic_state (&walk_state->control_state, control_state); + break; case AML_ELSE_OP: @@ -799,12 +889,10 @@ break; - case AML_RETURN_OP: break; - default: break; } @@ -825,7 +913,6 @@ * DESCRIPTION: Handles all control ops encountered during control method * execution. * - * ******************************************************************************/ acpi_status @@ -837,10 +924,10 @@ acpi_generic_state *control_state; - PROC_NAME ("Ds_exec_end_control_op"); + ACPI_FUNCTION_NAME ("Ds_exec_end_control_op"); - switch (op->opcode) { + switch (op->common.aml_opcode) { case AML_IF_OP: ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[IF_OP] Op=%p\n", op)); @@ -890,17 +977,17 @@ case AML_RETURN_OP: ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "[RETURN_OP] Op=%p Arg=%p\n",op, op->value.arg)); + "[RETURN_OP] Op=%p Arg=%p\n",op, op->common.value.arg)); /* * One optional operand -- the return value * It can be either an immediate operand or a result that * has been bubbled up the tree */ - if (op->value.arg) { + if (op->common.value.arg) { /* Return statement has an immediate operand */ - status = acpi_ds_create_operands (walk_state, op->value.arg); + status = acpi_ds_create_operands (walk_state, op->common.value.arg); if (ACPI_FAILURE (status)) { return (status); } @@ -922,7 +1009,6 @@ */ walk_state->return_desc = walk_state->operands[0]; } - else if ((walk_state->results) && (walk_state->results->results.num_results > 0)) { /* @@ -934,18 +1020,17 @@ * * Allow references created by the Index operator to return unchanged. */ - if (VALID_DESCRIPTOR_TYPE (walk_state->results->results.obj_desc [0], ACPI_DESC_TYPE_INTERNAL) && + if ((ACPI_GET_DESCRIPTOR_TYPE (walk_state->results->results.obj_desc[0]) == ACPI_DESC_TYPE_OPERAND) && ((walk_state->results->results.obj_desc [0])->common.type == INTERNAL_TYPE_REFERENCE) && ((walk_state->results->results.obj_desc [0])->reference.opcode != AML_INDEX_OP)) { - status = acpi_ex_resolve_to_value (&walk_state->results->results.obj_desc [0], walk_state); - if (ACPI_FAILURE (status)) { - return (status); - } + status = acpi_ex_resolve_to_value (&walk_state->results->results.obj_desc [0], walk_state); + if (ACPI_FAILURE (status)) { + return (status); + } } walk_state->return_desc = walk_state->results->results.obj_desc [0]; } - else { /* No return operand */ @@ -979,7 +1064,7 @@ /* Call up to the OS service layer to handle this */ - acpi_os_signal (ACPI_SIGNAL_BREAKPOINT, "Executed AML Breakpoint opcode"); + status = acpi_os_signal (ACPI_SIGNAL_BREAKPOINT, "Executed AML Breakpoint opcode"); /* If and when it returns, all done. */ @@ -987,42 +1072,46 @@ case AML_BREAK_OP: + case AML_CONTINUE_OP: /* ACPI 2.0 */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Break to end of current package, Op=%p\n", op)); - /* TBD: update behavior for ACPI 2.0 */ + /* Pop and delete control states until we find a while */ - /* - * As per the ACPI specification: - * "The break operation causes the current package - * execution to complete" - * "Break -- Stop executing the current code package - * at this point" - * - * Returning AE_FALSE here will cause termination of - * the current package, and execution will continue one - * level up, starting with the completion of the parent Op. - */ - status = AE_CTRL_FALSE; - break; + while (walk_state->control_state && + (walk_state->control_state->control.opcode != AML_WHILE_OP)) { + control_state = acpi_ut_pop_generic_state (&walk_state->control_state); + acpi_ut_delete_generic_state (control_state); + } + /* No while found? */ - case AML_CONTINUE_OP: /* ACPI 2.0 */ + if (!walk_state->control_state) { + return (AE_AML_NO_WHILE); + } + + /* Was: Walk_state->Aml_last_while = Walk_state->Control_state->Control.Aml_predicate_start; */ - status = AE_NOT_IMPLEMENTED; + walk_state->aml_last_while = walk_state->control_state->control.package_end; + + /* Return status depending on opcode */ + + if (op->common.aml_opcode == AML_BREAK_OP) { + status = AE_CTRL_BREAK; + } + else { + status = AE_CTRL_CONTINUE; + } break; default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown control opcode=%X Op=%p\n", - op->opcode, op)); + op->common.aml_opcode, op)); status = AE_AML_BAD_OPCODE; break; } - return (status); } diff -urN linux-2.4.18/drivers/acpi/dispatcher/dsutils.c lia64-2.4/drivers/acpi/dispatcher/dsutils.c --- linux-2.4.18/drivers/acpi/dispatcher/dsutils.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/dispatcher/dsutils.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: dsutils - Dispatcher utilities - * $Revision: 80 $ + * $Revision: 92 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ #include "acdebug.h" #define _COMPONENT ACPI_DISPATCHER - MODULE_NAME ("dsutils") + ACPI_MODULE_NAME ("dsutils") /******************************************************************************* @@ -58,7 +58,7 @@ const acpi_opcode_info *parent_info; - FUNCTION_TRACE_PTR ("Ds_is_result_used", op); + ACPI_FUNCTION_TRACE_PTR ("Ds_is_result_used", op); /* Must have both an Op and a Result Object */ @@ -68,29 +68,25 @@ return_VALUE (TRUE); } - /* * If there is no parent, the result can't possibly be used! * (An executing method typically has no parent, since each * method is parsed separately) However, a method that is * invoked from another method has a parent. */ - if (!op->parent) { + if (!op->common.parent) { return_VALUE (FALSE); } - /* * Get info on the parent. The root Op is AML_SCOPE */ - - parent_info = acpi_ps_get_opcode_info (op->parent->opcode); + parent_info = acpi_ps_get_opcode_info (op->common.parent->common.aml_opcode); if (parent_info->class == AML_CLASS_UNKNOWN) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown parent opcode. Op=%p\n", op)); return_VALUE (FALSE); } - /* * Decide what to do with the result based on the parent. If * the parent opcode will not use the result, delete the object. @@ -98,78 +94,90 @@ * as an operand later. */ switch (parent_info->class) { - /* - * In these cases, the parent will never use the return object - */ - case AML_CLASS_CONTROL: /* IF, ELSE, WHILE only */ + case AML_CLASS_CONTROL: - switch (op->parent->opcode) { + switch (op->common.parent->common.aml_opcode) { case AML_RETURN_OP: /* Never delete the return value associated with a return opcode */ - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Result used, [RETURN] opcode=%X Op=%p\n", op->opcode, op)); - return_VALUE (TRUE); - break; + goto result_used; case AML_IF_OP: case AML_WHILE_OP: /* * If we are executing the predicate AND this is the predicate op, - * we will use the return value! + * we will use the return value */ - if ((walk_state->control_state->common.state == CONTROL_PREDICATE_EXECUTING) && + if ((walk_state->control_state->common.state == ACPI_CONTROL_PREDICATE_EXECUTING) && (walk_state->control_state->control.predicate_op == op)) { - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Result used as a predicate, [IF/WHILE] opcode=%X Op=%p\n", - op->opcode, op)); - return_VALUE (TRUE); + goto result_used; } + break; + default: + /* Ignore other control opcodes */ break; } + /* The general control opcode returns no result */ - /* Fall through to not used case below */ + goto result_not_used; - case AML_CLASS_NAMED_OBJECT: /* Scope, method, etc. */ case AML_CLASS_CREATE: /* * These opcodes allow Term_arg(s) as operands and therefore - * method calls. The result is used. + * the operands can be method calls. The result is used. */ - if ((op->parent->opcode == AML_REGION_OP) || - (op->parent->opcode == AML_CREATE_FIELD_OP) || - (op->parent->opcode == AML_CREATE_BIT_FIELD_OP) || - (op->parent->opcode == AML_CREATE_BYTE_FIELD_OP) || - (op->parent->opcode == AML_CREATE_WORD_FIELD_OP) || - (op->parent->opcode == AML_CREATE_DWORD_FIELD_OP) || - (op->parent->opcode == AML_CREATE_QWORD_FIELD_OP)) { - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Result used, [Region or Create_field] opcode=%X Op=%p\n", - op->opcode, op)); - return_VALUE (TRUE); + goto result_used; + + + case AML_CLASS_NAMED_OBJECT: + + if ((op->common.parent->common.aml_opcode == AML_REGION_OP) || + (op->common.parent->common.aml_opcode == AML_DATA_REGION_OP) || + (op->common.parent->common.aml_opcode == AML_PACKAGE_OP) || + (op->common.parent->common.aml_opcode == AML_VAR_PACKAGE_OP) || + (op->common.parent->common.aml_opcode == AML_BUFFER_OP) || + (op->common.parent->common.aml_opcode == AML_INT_EVAL_SUBTREE_OP)) { + /* + * These opcodes allow Term_arg(s) as operands and therefore + * the operands can be method calls. The result is used. + */ + goto result_used; } - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Result not used, Parent opcode=%X Op=%p\n", op->opcode, op)); + goto result_not_used; - return_VALUE (FALSE); - break; - /* - * In all other cases. the parent will actually use the return - * object, so keep it. - */ default: - break; + + /* + * In all other cases. the parent will actually use the return + * object, so keep it. + */ + goto result_used; } + +result_used: + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Result of [%s] used by Parent [%s] Op=%p\n", + acpi_ps_get_opcode_name (op->common.aml_opcode), + acpi_ps_get_opcode_name (op->common.parent->common.aml_opcode), op)); + return_VALUE (TRUE); + + +result_not_used: + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Result of [%s] not used by Parent [%s] Op=%p\n", + acpi_ps_get_opcode_name (op->common.aml_opcode), + acpi_ps_get_opcode_name (op->common.parent->common.aml_opcode), op)); + + return_VALUE (FALSE); + } @@ -200,7 +208,7 @@ acpi_status status; - FUNCTION_TRACE_PTR ("Ds_delete_result_if_not_used", result_obj); + ACPI_FUNCTION_TRACE_PTR ("Ds_delete_result_if_not_used", result_obj); if (!op) { @@ -250,29 +258,29 @@ u32 arg_index) { acpi_status status = AE_OK; + acpi_status status2; NATIVE_CHAR *name_string; u32 name_length; - acpi_object_type8 data_type; acpi_operand_object *obj_desc; acpi_parse_object *parent_op; u16 opcode; - u32 flags; - operating_mode interpreter_mode; + acpi_interpreter_mode interpreter_mode; const acpi_opcode_info *op_info; + char *name; - FUNCTION_TRACE_PTR ("Ds_create_operand", arg); + ACPI_FUNCTION_TRACE_PTR ("Ds_create_operand", arg); /* A valid name must be looked up in the namespace */ - if ((arg->opcode == AML_INT_NAMEPATH_OP) && - (arg->value.string)) { + if ((arg->common.aml_opcode == AML_INT_NAMEPATH_OP) && + (arg->common.value.string)) { ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Getting a name: Arg=%p\n", arg)); /* Get the entire name string from the AML stream */ - status = acpi_ex_get_name_string (ACPI_TYPE_ANY, arg->value.buffer, + status = acpi_ex_get_name_string (ACPI_TYPE_ANY, arg->common.value.buffer, &name_string, &name_length); if (ACPI_FAILURE (status)) { @@ -290,46 +298,41 @@ * IMODE_EXECUTE) in order to support the creation of * namespace objects during the execution of control methods. */ - parent_op = arg->parent; - op_info = acpi_ps_get_opcode_info (parent_op->opcode); + parent_op = arg->common.parent; + op_info = acpi_ps_get_opcode_info (parent_op->common.aml_opcode); if ((op_info->flags & AML_NSNODE) && - (parent_op->opcode != AML_INT_METHODCALL_OP) && - (parent_op->opcode != AML_REGION_OP) && - (parent_op->opcode != AML_INT_NAMEPATH_OP)) { + (parent_op->common.aml_opcode != AML_INT_METHODCALL_OP) && + (parent_op->common.aml_opcode != AML_REGION_OP) && + (parent_op->common.aml_opcode != AML_INT_NAMEPATH_OP)) { /* Enter name into namespace if not found */ - interpreter_mode = IMODE_LOAD_PASS2; + interpreter_mode = ACPI_IMODE_LOAD_PASS2; } else { /* Return a failure if name not found */ - interpreter_mode = IMODE_EXECUTE; + interpreter_mode = ACPI_IMODE_EXECUTE; } status = acpi_ns_lookup (walk_state->scope_info, name_string, ACPI_TYPE_ANY, interpreter_mode, - NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE, + ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, walk_state, - (acpi_namespace_node **) &obj_desc); - - /* Free the namestring created above */ - - ACPI_MEM_FREE (name_string); - + ACPI_CAST_INDIRECT_PTR (acpi_namespace_node, &obj_desc)); /* * The only case where we pass through (ignore) a NOT_FOUND * error is for the Cond_ref_of opcode. */ if (status == AE_NOT_FOUND) { - if (parent_op->opcode == AML_COND_REF_OF_OP) { + if (parent_op->common.aml_opcode == AML_COND_REF_OF_OP) { /* * For the Conditional Reference op, it's OK if * the name is not found; We just need a way to * indicate this to the interpreter, set the * object to the root */ - obj_desc = (acpi_operand_object *) acpi_gbl_root_node; + obj_desc = ACPI_CAST_PTR (acpi_operand_object, acpi_gbl_root_node); status = AE_OK; } @@ -340,13 +343,20 @@ */ status = AE_AML_NAME_NOT_FOUND; - /* TBD: Externalize Name_string and print */ - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Object name was not found in namespace\n")); + name = NULL; + status2 = acpi_ns_externalize_name (ACPI_UINT32_MAX, name_string, NULL, &name); + if (ACPI_SUCCESS (status2)) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Object name [%s] was not found in namespace\n", name)); + ACPI_MEM_FREE (name); + } } } + /* Free the namestring created above */ + + ACPI_MEM_FREE (name_string); + /* Check status from the lookup */ if (ACPI_FAILURE (status)) { @@ -359,14 +369,14 @@ if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } - DEBUGGER_EXEC (acpi_db_display_argument_object (obj_desc, walk_state)); + ACPI_DEBUGGER_EXEC (acpi_db_display_argument_object (obj_desc, walk_state)); } else { /* Check for null name case */ - if (arg->opcode == AML_INT_NAMEPATH_OP) { + if (arg->common.aml_opcode == AML_INT_NAMEPATH_OP) { /* * If the name is null, this means that this is an * optional result parameter that was not specified @@ -376,30 +386,25 @@ opcode = AML_ZERO_OP; /* Has no arguments! */ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Null namepath: Arg=%p\n", arg)); - - /* - * TBD: [Investigate] anything else needed for the - * zero op lvalue? - */ } else { - opcode = arg->opcode; + opcode = arg->common.aml_opcode; } + /* Get the object type of the argument */ - /* Get the data type of the argument */ - - data_type = acpi_ds_map_opcode_to_data_type (opcode, &flags); - if (data_type == INTERNAL_TYPE_INVALID) { + op_info = acpi_ps_get_opcode_info (opcode); + if (op_info->object_type == INTERNAL_TYPE_INVALID) { return_ACPI_STATUS (AE_NOT_IMPLEMENTED); } - if (flags & OP_HAS_RETURN_VALUE) { + if (op_info->flags & AML_HAS_RETVAL) { ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Argument previously created, already stacked \n")); - DEBUGGER_EXEC (acpi_db_display_argument_object (walk_state->operands [walk_state->num_operands - 1], walk_state)); + ACPI_DEBUGGER_EXEC (acpi_db_display_argument_object ( + walk_state->operands [walk_state->num_operands - 1], walk_state)); /* * Use value that was already previously returned @@ -415,13 +420,11 @@ acpi_format_exception (status))); return_ACPI_STATUS (status); } - } - else { /* Create an ACPI_INTERNAL_OBJECT for the argument */ - obj_desc = acpi_ut_create_internal_object (data_type); + obj_desc = acpi_ut_create_internal_object (op_info->object_type); if (!obj_desc) { return_ACPI_STATUS (AE_NO_MEMORY); } @@ -434,7 +437,7 @@ acpi_ut_delete_object_desc (obj_desc); return_ACPI_STATUS (status); } - } + } /* Put the operand object on the object stack */ @@ -443,7 +446,7 @@ return_ACPI_STATUS (status); } - DEBUGGER_EXEC (acpi_db_display_argument_object (obj_desc, walk_state)); + ACPI_DEBUGGER_EXEC (acpi_db_display_argument_object (obj_desc, walk_state)); } return_ACPI_STATUS (AE_OK); @@ -474,7 +477,7 @@ u32 arg_count = 0; - FUNCTION_TRACE_PTR ("Ds_create_operands", first_arg); + ACPI_FUNCTION_TRACE_PTR ("Ds_create_operands", first_arg); /* For all arguments in the list... */ @@ -491,7 +494,7 @@ /* Move on to next argument, if any */ - arg = arg->next; + arg = arg->common.next; arg_count++; } @@ -504,7 +507,7 @@ * pop everything off of the operand stack and delete those * objects */ - acpi_ds_obj_stack_pop_and_delete (arg_count, walk_state); + (void) acpi_ds_obj_stack_pop_and_delete (arg_count, walk_state); ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "While creating Arg %d - %s\n", (arg_count + 1), acpi_format_exception (status))); @@ -534,18 +537,13 @@ acpi_status status = AE_OK; - FUNCTION_TRACE_PTR ("Ds_resolve_operands", walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ds_resolve_operands", walk_state); /* * Attempt to resolve each of the valid operands * Method arguments are passed by value, not by reference */ - - /* - * TBD: [Investigate] Note from previous parser: - * Ref_of problem with Acpi_ex_resolve_to_value() conversion. - */ for (i = 0; i < walk_state->num_operands; i++) { status = acpi_ex_resolve_to_value (&walk_state->operands[i], walk_state); if (ACPI_FAILURE (status)) { @@ -555,264 +553,4 @@ return_ACPI_STATUS (status); } - - -/******************************************************************************* - * - * FUNCTION: Acpi_ds_map_opcode_to_data_type - * - * PARAMETERS: Opcode - AML opcode to map - * Out_flags - Additional info about the opcode - * - * RETURN: The ACPI type associated with the opcode - * - * DESCRIPTION: Convert a raw AML opcode to the associated ACPI data type, - * if any. If the opcode returns a value as part of the - * intepreter execution, a flag is returned in Out_flags. - * - ******************************************************************************/ - -acpi_object_type8 -acpi_ds_map_opcode_to_data_type ( - u16 opcode, - u32 *out_flags) -{ - acpi_object_type8 data_type = INTERNAL_TYPE_INVALID; - const acpi_opcode_info *op_info; - u32 flags = 0; - - - PROC_NAME ("Ds_map_opcode_to_data_type"); - - - op_info = acpi_ps_get_opcode_info (opcode); - if (op_info->class == AML_CLASS_UNKNOWN) { - /* Unknown opcode */ - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown AML opcode: %x\n", opcode)); - return (data_type); - } - - -/* - * TBD: Use op class - */ - - switch (op_info->type) { - - case AML_TYPE_LITERAL: - - switch (opcode) { - case AML_BYTE_OP: - case AML_WORD_OP: - case AML_DWORD_OP: - case AML_QWORD_OP: - - data_type = ACPI_TYPE_INTEGER; - break; - - - case AML_STRING_OP: - - data_type = ACPI_TYPE_STRING; - break; - - case AML_INT_NAMEPATH_OP: - data_type = INTERNAL_TYPE_REFERENCE; - break; - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Unknown (type LITERAL) AML opcode: %x\n", opcode)); - break; - } - break; - - - case AML_TYPE_DATA_TERM: - - switch (opcode) { - case AML_BUFFER_OP: - - data_type = ACPI_TYPE_BUFFER; - break; - - case AML_PACKAGE_OP: - case AML_VAR_PACKAGE_OP: - - data_type = ACPI_TYPE_PACKAGE; - break; - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Unknown (type DATA_TERM) AML opcode: %x\n", opcode)); - break; - } - break; - - - case AML_TYPE_CONSTANT: - case AML_TYPE_METHOD_ARGUMENT: - case AML_TYPE_LOCAL_VARIABLE: - - data_type = INTERNAL_TYPE_REFERENCE; - break; - - - case AML_TYPE_EXEC_1A_0T_1R: - case AML_TYPE_EXEC_1A_1T_1R: - case AML_TYPE_EXEC_2A_0T_1R: - case AML_TYPE_EXEC_2A_1T_1R: - case AML_TYPE_EXEC_2A_2T_1R: - case AML_TYPE_EXEC_3A_1T_1R: - case AML_TYPE_EXEC_6A_0T_1R: - case AML_TYPE_RETURN: - - flags = OP_HAS_RETURN_VALUE; - data_type = ACPI_TYPE_ANY; - break; - - - case AML_TYPE_METHOD_CALL: - - flags = OP_HAS_RETURN_VALUE; - data_type = ACPI_TYPE_METHOD; - break; - - - case AML_TYPE_NAMED_FIELD: - case AML_TYPE_NAMED_SIMPLE: - case AML_TYPE_NAMED_COMPLEX: - case AML_TYPE_NAMED_NO_OBJ: - - data_type = acpi_ds_map_named_opcode_to_data_type (opcode); - break; - - - case AML_TYPE_EXEC_1A_0T_0R: - case AML_TYPE_EXEC_2A_0T_0R: - case AML_TYPE_EXEC_3A_0T_0R: - case AML_TYPE_EXEC_1A_1T_0R: - case AML_TYPE_CONTROL: - - /* No mapping needed at this time */ - - break; - - - default: - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Unimplemented data type opcode: %x\n", opcode)); - break; - } - - /* Return flags to caller if requested */ - - if (out_flags) { - *out_flags = flags; - } - - return (data_type); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_ds_map_named_opcode_to_data_type - * - * PARAMETERS: Opcode - The Named AML opcode to map - * - * RETURN: The ACPI type associated with the named opcode - * - * DESCRIPTION: Convert a raw Named AML opcode to the associated data type. - * Named opcodes are a subsystem of the AML opcodes. - * - ******************************************************************************/ - -acpi_object_type8 -acpi_ds_map_named_opcode_to_data_type ( - u16 opcode) -{ - acpi_object_type8 data_type; - - - FUNCTION_ENTRY (); - - - /* Decode Opcode */ - - switch (opcode) { - case AML_SCOPE_OP: - data_type = INTERNAL_TYPE_SCOPE; - break; - - case AML_DEVICE_OP: - data_type = ACPI_TYPE_DEVICE; - break; - - case AML_THERMAL_ZONE_OP: - data_type = ACPI_TYPE_THERMAL; - break; - - case AML_METHOD_OP: - data_type = ACPI_TYPE_METHOD; - break; - - case AML_POWER_RES_OP: - data_type = ACPI_TYPE_POWER; - break; - - case AML_PROCESSOR_OP: - data_type = ACPI_TYPE_PROCESSOR; - break; - - case AML_FIELD_OP: /* Field_op */ - data_type = INTERNAL_TYPE_FIELD_DEFN; - break; - - case AML_INDEX_FIELD_OP: /* Index_field_op */ - data_type = INTERNAL_TYPE_INDEX_FIELD_DEFN; - break; - - case AML_BANK_FIELD_OP: /* Bank_field_op */ - data_type = INTERNAL_TYPE_BANK_FIELD_DEFN; - break; - - case AML_INT_NAMEDFIELD_OP: /* NO CASE IN ORIGINAL */ - data_type = ACPI_TYPE_ANY; - break; - - case AML_NAME_OP: /* Name_op - special code in original */ - case AML_INT_NAMEPATH_OP: - data_type = ACPI_TYPE_ANY; - break; - - case AML_ALIAS_OP: - data_type = INTERNAL_TYPE_ALIAS; - break; - - case AML_MUTEX_OP: - data_type = ACPI_TYPE_MUTEX; - break; - - case AML_EVENT_OP: - data_type = ACPI_TYPE_EVENT; - break; - - case AML_DATA_REGION_OP: - case AML_REGION_OP: - data_type = ACPI_TYPE_REGION; - break; - - - default: - data_type = ACPI_TYPE_ANY; - break; - - } - - return (data_type); -} - diff -urN linux-2.4.18/drivers/acpi/dispatcher/dswexec.c lia64-2.4/drivers/acpi/dispatcher/dswexec.c --- linux-2.4.18/drivers/acpi/dispatcher/dswexec.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/dispatcher/dswexec.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ * * Module Name: dswexec - Dispatcher method execution callbacks; * dispatch to interpreter. - * $Revision: 79 $ + * $Revision: 92 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,12 +35,12 @@ #define _COMPONENT ACPI_DISPATCHER - MODULE_NAME ("dswexec") + ACPI_MODULE_NAME ("dswexec") /* - * Dispatch tables for opcode classes + * Dispatch table for opcode classes */ -ACPI_EXECUTE_OP acpi_gbl_op_type_dispatch [] = { +static ACPI_EXECUTE_OP acpi_gbl_op_type_dispatch [] = { acpi_ex_opcode_1A_0T_0R, acpi_ex_opcode_1A_0T_1R, acpi_ex_opcode_1A_1T_0R, @@ -68,17 +68,17 @@ acpi_status acpi_ds_get_predicate_value ( acpi_walk_state *walk_state, - u32 has_result_obj) { + acpi_operand_object *result_obj) { acpi_status status = AE_OK; acpi_operand_object *obj_desc; - FUNCTION_TRACE_PTR ("Ds_get_predicate_value", walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ds_get_predicate_value", walk_state); walk_state->control_state->common.state = 0; - if (has_result_obj) { + if (result_obj) { status = acpi_ds_result_pop (&obj_desc, walk_state); if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, @@ -88,7 +88,6 @@ return_ACPI_STATUS (status); } } - else { status = acpi_ds_create_operand (walk_state, walk_state->op, 0); if (ACPI_FAILURE (status)) { @@ -110,7 +109,6 @@ return_ACPI_STATUS (AE_AML_NO_OPERAND); } - /* * Result of predicate evaluation currently must * be a number @@ -124,7 +122,6 @@ goto cleanup; } - /* Truncate the predicate to 32-bits if necessary */ acpi_ex_truncate_for32bit_table (obj_desc, walk_state); @@ -136,7 +133,6 @@ if (obj_desc->integer.value) { walk_state->control_state->common.value = TRUE; } - else { /* * Predicate is FALSE, we will just toss the @@ -149,12 +145,12 @@ cleanup: - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%pn", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n", walk_state->control_state->common.value, walk_state->op)); /* Break to debugger to display result */ - DEBUGGER_EXEC (acpi_db_display_result_object (obj_desc, walk_state)); + ACPI_DEBUGGER_EXEC (acpi_db_display_result_object (obj_desc, walk_state)); /* * Delete the predicate result object (we know that @@ -162,7 +158,7 @@ */ acpi_ut_remove_reference (obj_desc); - walk_state->control_state->common.state = CONTROL_NORMAL; + walk_state->control_state->common.state = ACPI_CONTROL_NORMAL; return_ACPI_STATUS (status); } @@ -192,7 +188,7 @@ u32 opcode_class; - FUNCTION_TRACE_PTR ("Ds_exec_begin_op", walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ds_exec_begin_op", walk_state); op = walk_state->op; @@ -204,8 +200,18 @@ op = *out_op; walk_state->op = op; - walk_state->op_info = acpi_ps_get_opcode_info (op->opcode); - walk_state->opcode = op->opcode; + walk_state->opcode = op->common.aml_opcode; + walk_state->op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); + + if (acpi_ns_opens_scope (walk_state->op_info->object_type)) { + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n", + acpi_ut_get_type_name (walk_state->op_info->object_type), op)); + + status = acpi_ds_scope_stack_pop (walk_state); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + } } if (op == walk_state->origin) { @@ -223,11 +229,11 @@ */ if ((walk_state->control_state) && (walk_state->control_state->common.state == - CONTROL_CONDITIONAL_EXECUTING)) { + ACPI_CONTROL_CONDITIONAL_EXECUTING)) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%p State=%p\n", op, walk_state)); - walk_state->control_state->common.state = CONTROL_PREDICATE_EXECUTING; + walk_state->control_state->common.state = ACPI_CONTROL_PREDICATE_EXECUTING; /* Save start of predicate */ @@ -239,7 +245,7 @@ /* We want to send namepaths to the load code */ - if (op->opcode == AML_INT_NAMEPATH_OP) { + if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) { opcode_class = AML_CLASS_NAMED_OBJECT; } @@ -260,7 +266,7 @@ case AML_CLASS_NAMED_OBJECT: - if (walk_state->walk_type == WALK_METHOD) { + if (walk_state->walk_type == ACPI_WALK_METHOD) { /* * Found a named object declaration during method * execution; we must enter this object into the @@ -271,19 +277,16 @@ status = acpi_ds_load2_begin_op (walk_state, NULL); } - - if (op->opcode == AML_REGION_OP) { + if (op->common.aml_opcode == AML_REGION_OP) { status = acpi_ds_result_stack_push (walk_state); } - break; - /* most operators with arguments */ - case AML_CLASS_EXECUTE: case AML_CLASS_CREATE: + /* most operators with arguments */ /* Start a new result/operand state */ status = acpi_ds_result_stack_push (walk_state); @@ -329,7 +332,7 @@ u32 i; - FUNCTION_TRACE_PTR ("Ds_exec_end_op", walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ds_exec_end_op", walk_state); op = walk_state->op; @@ -337,11 +340,11 @@ op_class = walk_state->op_info->class; if (op_class == AML_CLASS_UNKNOWN) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode %X\n", op->opcode)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode %X\n", op->common.aml_opcode)); return_ACPI_STATUS (AE_NOT_IMPLEMENTED); } - first_arg = op->value.arg; + first_arg = op->common.value.arg; /* Init the walk state */ @@ -349,22 +352,19 @@ walk_state->return_desc = NULL; walk_state->result_obj = NULL; - /* Call debugger for single step support (DEBUG build only) */ - DEBUGGER_EXEC (status = acpi_db_single_step (walk_state, op, op_class)); - DEBUGGER_EXEC (if (ACPI_FAILURE (status)) {return_ACPI_STATUS (status);}); - + ACPI_DEBUGGER_EXEC (status = acpi_db_single_step (walk_state, op, op_class)); + ACPI_DEBUGGER_EXEC (if (ACPI_FAILURE (status)) {return_ACPI_STATUS (status);}); - switch (op_class) { /* Decode the Opcode Class */ - case AML_CLASS_ARGUMENT: /* constants, literals, etc. do nothing */ + switch (op_class) { + case AML_CLASS_ARGUMENT: /* constants, literals, etc. -- do nothing */ break; - /* most operators with arguments */ - case AML_CLASS_EXECUTE: + case AML_CLASS_EXECUTE: /* most operators with arguments */ /* Build resolved operand stack */ @@ -385,37 +385,26 @@ status = acpi_ex_resolve_operands (walk_state->opcode, &(walk_state->operands [walk_state->num_operands -1]), walk_state); - if (ACPI_FAILURE (status)) { - /* TBD: must pop and delete operands */ - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "[%s]: Could not resolve operands, %s\n", - acpi_ps_get_opcode_name (walk_state->opcode), acpi_format_exception (status))); + if (ACPI_SUCCESS (status)) { + ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE, + acpi_ps_get_opcode_name (walk_state->opcode), + walk_state->num_operands, "after Ex_resolve_operands"); /* - * On error, we must delete all the operands and clear the - * operand stack + * Dispatch the request to the appropriate interpreter handler + * routine. There is one routine per opcode "type" based upon the + * number of opcode arguments and return type. */ - for (i = 0; i < walk_state->num_operands; i++) { - acpi_ut_remove_reference (walk_state->operands[i]); - walk_state->operands[i] = NULL; - } - - walk_state->num_operands = 0; - goto cleanup; + status = acpi_gbl_op_type_dispatch [op_type] (walk_state); + } + else { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "[%s]: Could not resolve operands, %s\n", + acpi_ps_get_opcode_name (walk_state->opcode), + acpi_format_exception (status))); } - DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, acpi_ps_get_opcode_name (walk_state->opcode), - walk_state->num_operands, "after Ex_resolve_operands"); - - /* - * Dispatch the request to the appropriate interpreter handler - * routine. There is one routine per opcode "type" based upon the - * number of opcode arguments and return type. - */ - status = acpi_gbl_op_type_dispatch [op_type] (walk_state); - - - /* Delete argument objects and clear the operand stack */ + /* Always delete the argument objects and clear the operand stack */ for (i = 0; i < walk_state->num_operands; i++) { /* @@ -425,7 +414,6 @@ acpi_ut_remove_reference (walk_state->operands[i]); walk_state->operands[i] = NULL; } - walk_state->num_operands = 0; /* @@ -448,8 +436,11 @@ /* 1 Operand, 0 External_result, 0 Internal_result */ status = acpi_ds_exec_end_control_op (walk_state, op); + if (ACPI_FAILURE (status)) { + break; + } - acpi_ds_result_stack_pop (walk_state); + status = acpi_ds_result_stack_pop (walk_state); break; @@ -467,7 +458,7 @@ /* Next_op points to first argument op */ - next_op = next_op->next; + next_op = next_op->common.next; /* * Get the method's arguments and put them on the operand stack @@ -478,10 +469,9 @@ } /* - * Since the operands will be passed to another - * control method, we must resolve all local - * references here (Local variables, arguments - * to *this* method, etc.) + * Since the operands will be passed to another control method, + * we must resolve all local references here (Local variables, + * arguments to *this* method, etc.) */ status = acpi_ds_resolve_operands (walk_state); if (ACPI_FAILURE (status)) { @@ -499,7 +489,6 @@ * especially the operand count! */ return_ACPI_STATUS (status); - break; case AML_TYPE_CREATE_FIELD: @@ -516,16 +505,63 @@ break; + case AML_TYPE_CREATE_OBJECT: + + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "Executing Create_object (Buffer/Package) Op=%p\n", op)); + + switch (op->common.parent->common.aml_opcode) { + case AML_NAME_OP: + + /* + * Put the Node on the object stack (Contains the ACPI Name of + * this object) + */ + walk_state->operands[0] = (void *) op->common.parent->common.node; + walk_state->num_operands = 1; + + status = acpi_ds_create_node (walk_state, op->common.parent->common.node, op->common.parent); + if (ACPI_FAILURE (status)) { + break; + } + + /* Fall through */ + /*lint -fallthrough */ + + case AML_INT_EVAL_SUBTREE_OP: + + status = acpi_ds_eval_data_object_operands (walk_state, op, + acpi_ns_get_attached_object (op->common.parent->common.node)); + break; + + default: + + status = acpi_ds_eval_data_object_operands (walk_state, op, NULL); + break; + } + + /* + * If a result object was returned from above, push it on the + * current result stack + */ + if (ACPI_SUCCESS (status) && + walk_state->result_obj) { + status = acpi_ds_result_push (walk_state->result_obj, walk_state); + } + break; + + case AML_TYPE_NAMED_FIELD: case AML_TYPE_NAMED_COMPLEX: case AML_TYPE_NAMED_SIMPLE: + case AML_TYPE_NAMED_NO_OBJ: status = acpi_ds_load2_end_op (walk_state); if (ACPI_FAILURE (status)) { break; } - if (op->opcode == AML_REGION_OP) { + if (op->common.aml_opcode == AML_REGION_OP) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Executing Op_region Address/Length Op=%p\n", op)); @@ -539,23 +575,26 @@ break; + case AML_TYPE_UNDEFINED: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Undefined opcode type Op=%p\n", op)); return_ACPI_STATUS (AE_NOT_IMPLEMENTED); - break; case AML_TYPE_BOGUS: - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Internal opcode=%X type Op=%p\n", + + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, + "Internal opcode=%X type Op=%p\n", walk_state->opcode, op)); break; + default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p\n", - op_class, op_type, op->opcode, op)); + op_class, op_type, op->common.aml_opcode, op)); status = AE_NOT_IMPLEMENTED; break; @@ -563,8 +602,8 @@ } /* - * ACPI 2.0 support for 64-bit integers: - * Truncate numeric result value if we are executing from a 32-bit ACPI table + * ACPI 2.0 support for 64-bit integers: Truncate numeric + * result value if we are executing from a 32-bit ACPI table */ acpi_ex_truncate_for32bit_table (walk_state->result_obj, walk_state); @@ -575,9 +614,9 @@ if ((walk_state->control_state) && (walk_state->control_state->common.state == - CONTROL_PREDICATE_EXECUTING) && + ACPI_CONTROL_PREDICATE_EXECUTING) && (walk_state->control_state->control.predicate_op == op)) { - status = acpi_ds_get_predicate_value (walk_state, (u32) walk_state->result_obj); + status = acpi_ds_get_predicate_value (walk_state, walk_state->result_obj); walk_state->result_obj = NULL; } @@ -586,7 +625,7 @@ if (walk_state->result_obj) { /* Break to debugger to display result */ - DEBUGGER_EXEC (acpi_db_display_result_object (walk_state->result_obj, walk_state)); + ACPI_DEBUGGER_EXEC (acpi_db_display_result_object (walk_state->result_obj, walk_state)); /* * Delete the result op if and only if: @@ -598,10 +637,7 @@ /* Always clear the object stack */ - /* TBD: [Investigate] Clear stack of return value, - but don't delete it */ walk_state->num_operands = 0; - return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/dispatcher/dswload.c lia64-2.4/drivers/acpi/dispatcher/dswload.c --- linux-2.4.18/drivers/acpi/dispatcher/dswload.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/dispatcher/dswload.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: dswload - Dispatcher namespace load callbacks - * $Revision: 50 $ + * $Revision: 66 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ #define _COMPONENT ACPI_DISPATCHER - MODULE_NAME ("dswload") + ACPI_MODULE_NAME ("dswload") /******************************************************************************* @@ -77,7 +77,6 @@ default: return (AE_BAD_PARAMETER); - break; } return (AE_OK); @@ -106,27 +105,31 @@ acpi_parse_object *op; acpi_namespace_node *node; acpi_status status; - acpi_object_type8 data_type; + acpi_object_type object_type; NATIVE_CHAR *path; - PROC_NAME ("Ds_load1_begin_op"); + ACPI_FUNCTION_NAME ("Ds_load1_begin_op"); op = walk_state->op; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state)); + if (op && (op->common.aml_opcode == AML_INT_NAMEDFIELD_OP)) { + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state)); + } + /* We are only interested in opcodes that have an associated name */ - if (walk_state->op) { - if (!(walk_state->op_info->flags & AML_NAMED)) { + if (op) { + if (!(walk_state->op_info->flags & AML_NAMED)) { *out_op = op; return (AE_OK); } /* Check if this object has already been installed in the namespace */ - if (op->node) { + if (op->common.node) { *out_op = op; return (AE_OK); } @@ -136,25 +139,18 @@ /* Map the raw opcode into an internal object type */ - data_type = acpi_ds_map_named_opcode_to_data_type (walk_state->opcode); - + object_type = walk_state->op_info->object_type; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "State=%p Op=%p Type=%x\n", walk_state, op, data_type)); - - - if (walk_state->opcode == AML_SCOPE_OP) { - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "State=%p Op=%p Type=%x\n", walk_state, op, data_type)); - } + "State=%p Op=%p Type=%X\n", walk_state, op, object_type)); /* * Enter the named type into the internal namespace. We enter the name * as we go downward in the parse tree. Any necessary subobjects that involve * arguments to the opcode must be created as we go back up the parse tree later. */ - status = acpi_ns_lookup (walk_state->scope_info, path, data_type, - IMODE_LOAD_PASS1, NS_NO_UPSEARCH, walk_state, &(node)); + status = acpi_ns_lookup (walk_state->scope_info, path, object_type, + ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH, walk_state, &(node)); if (ACPI_FAILURE (status)) { return (status); @@ -171,13 +167,13 @@ /* Initialize */ - ((acpi_parse2_object *)op)->name = node->name; + op->named.name = node->name.integer; /* * Put the Node in the "op" object that the parser uses, so we * can get it again quickly when this scope is closed */ - op->node = node; + op->common.node = node; acpi_ps_append_arg (acpi_ps_get_parent_scope (&walk_state->parser_state), op); *out_op = op; @@ -205,10 +201,11 @@ acpi_walk_state *walk_state) { acpi_parse_object *op; - acpi_object_type8 data_type; + acpi_object_type object_type; + acpi_status status = AE_OK; - PROC_NAME ("Ds_load1_end_op"); + ACPI_FUNCTION_NAME ("Ds_load1_end_op"); op = walk_state->op; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state)); @@ -216,35 +213,51 @@ /* We are only interested in opcodes that have an associated name */ - if (!(walk_state->op_info->flags & AML_NAMED)) { + if (!(walk_state->op_info->flags & (AML_NAMED | AML_FIELD))) { return (AE_OK); } - /* Get the type to determine if we should pop the scope */ + /* Get the object type to determine if we should pop the scope */ + + object_type = walk_state->op_info->object_type; - data_type = acpi_ds_map_named_opcode_to_data_type (op->opcode); + if (walk_state->op_info->flags & AML_FIELD) { + if (walk_state->opcode == AML_FIELD_OP || + walk_state->opcode == AML_BANK_FIELD_OP || + walk_state->opcode == AML_INDEX_FIELD_OP) { + status = acpi_ds_init_field_objects (op, walk_state); + } + return (status); + } + + + if (op->common.aml_opcode == AML_REGION_OP) { + status = acpi_ex_create_region (op->named.data, op->named.length, + (ACPI_ADR_SPACE_TYPE) ((op->common.value.arg)->common.value.integer), walk_state); + if (ACPI_FAILURE (status)) { + return (status); + } + } - if (op->opcode == AML_NAME_OP) { - /* For Name opcode, check the argument */ + if (op->common.aml_opcode == AML_NAME_OP) { + /* For Name opcode, get the object type from the argument */ - if (op->value.arg) { - data_type = acpi_ds_map_opcode_to_data_type ( - (op->value.arg)->opcode, NULL); - ((acpi_namespace_node *)op->node)->type = - (u8) data_type; + if (op->common.value.arg) { + object_type = (acpi_ps_get_opcode_info ((op->common.value.arg)->common.aml_opcode))->object_type; + op->common.node->type = (u8) object_type; } } /* Pop the scope stack */ - if (acpi_ns_opens_scope (data_type)) { + if (acpi_ns_opens_scope (object_type)) { ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op %p\n", - acpi_ut_get_type_name (data_type), op)); + acpi_ut_get_type_name (object_type), op)); - acpi_ds_scope_stack_pop (walk_state); + status = acpi_ds_scope_stack_pop (walk_state); } - return (AE_OK); + return (status); } @@ -270,28 +283,21 @@ acpi_parse_object *op; acpi_namespace_node *node; acpi_status status; - acpi_object_type8 data_type; + acpi_object_type object_type; NATIVE_CHAR *buffer_ptr; - void *original = NULL; - PROC_NAME ("Ds_load2_begin_op"); + ACPI_FUNCTION_NAME ("Ds_load2_begin_op"); + op = walk_state->op; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state)); - if (op) { /* We only care about Namespace opcodes here */ - if (!(walk_state->op_info->flags & AML_NSOPCODE) && - walk_state->opcode != AML_INT_NAMEPATH_OP) { - return (AE_OK); - } - - /* TBD: [Restructure] Temp! same code as in psparse */ - - if (!(walk_state->op_info->flags & AML_NAMED)) { + if ((!(walk_state->op_info->flags & AML_NSOPCODE) && (walk_state->opcode != AML_INT_NAMEPATH_OP)) || + (!(walk_state->op_info->flags & AML_NAMED))) { return (AE_OK); } @@ -301,7 +307,7 @@ if (walk_state->opcode == AML_INT_NAMEPATH_OP) { /* For Namepath op, get the path string */ - buffer_ptr = op->value.string; + buffer_ptr = op->common.value.string; if (!buffer_ptr) { /* No name, just exit */ @@ -311,20 +317,21 @@ else { /* Get name from the op */ - buffer_ptr = (NATIVE_CHAR *) &((acpi_parse2_object *)op)->name; + buffer_ptr = (NATIVE_CHAR *) &op->named.name; } } else { + /* Get the namestring from the raw AML */ + buffer_ptr = acpi_ps_get_next_namestring (&walk_state->parser_state); } + /* Map the opcode into an internal object type */ - /* Map the raw opcode into an internal object type */ - - data_type = acpi_ds_map_named_opcode_to_data_type (walk_state->opcode); + object_type = walk_state->op_info->object_type; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "State=%p Op=%p Type=%x\n", walk_state, op, data_type)); + "State=%p Op=%p Type=%X\n", walk_state, op, object_type)); if (walk_state->opcode == AML_FIELD_OP || @@ -333,23 +340,24 @@ node = NULL; status = AE_OK; } - else if (walk_state->opcode == AML_INT_NAMEPATH_OP) { /* * The Name_path is an object reference to an existing object. Don't enter the * name into the namespace, but look it up for use later */ - status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, data_type, - IMODE_EXECUTE, NS_SEARCH_PARENT, walk_state, &(node)); + status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type, + ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node)); } - else { - if (op && op->node) { - original = op->node; - node = op->node; + /* All other opcodes */ + + if (op && op->common.node) { + /* This op/node was previously entered into the namespace */ + + node = op->common.node; - if (acpi_ns_opens_scope (data_type)) { - status = acpi_ds_scope_stack_push (node, data_type, walk_state); + if (acpi_ns_opens_scope (object_type)) { + status = acpi_ds_scope_stack_push (node, object_type, walk_state); if (ACPI_FAILURE (status)) { return (status); } @@ -363,8 +371,8 @@ * as we go downward in the parse tree. Any necessary subobjects that involve * arguments to the opcode must be created as we go back up the parse tree later. */ - status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, data_type, - IMODE_EXECUTE, NS_NO_UPSEARCH, walk_state, &(node)); + status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type, + ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, walk_state, &(node)); } if (ACPI_SUCCESS (status)) { @@ -376,26 +384,21 @@ return (AE_NO_MEMORY); } - /* Initialize */ + /* Initialize the new op */ - ((acpi_parse2_object *)op)->name = node->name; - *out_op = op; + if (node) { + op->named.name = node->name.integer; + } + if (out_op) { + *out_op = op; + } } /* * Put the Node in the "op" object that the parser uses, so we * can get it again quickly when this scope is closed */ - op->node = node; - - if (original) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "old %p new %p\n", original, node)); - - if (original != node) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Lookup match error: old %p new %p\n", original, node)); - } - } + op->common.node = node; } return (status); @@ -423,18 +426,18 @@ { acpi_parse_object *op; acpi_status status = AE_OK; - acpi_object_type8 data_type; + acpi_object_type object_type; acpi_namespace_node *node; acpi_parse_object *arg; acpi_namespace_node *new_node; u32 i; - PROC_NAME ("Ds_load2_end_op"); + ACPI_FUNCTION_NAME ("Ds_load2_end_op"); op = walk_state->op; - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state)); - + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n", + walk_state->op_info->name, op, walk_state)); /* Only interested in opcodes that have namespace objects */ @@ -442,11 +445,11 @@ return (AE_OK); } - if (op->opcode == AML_SCOPE_OP) { + if (op->common.aml_opcode == AML_SCOPE_OP) { ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Ending scope Op=%p State=%p\n", op, walk_state)); - if (((acpi_parse2_object *)op)->name == -1) { + if (op->named.name == ACPI_UINT16_MAX) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unnamed scope! Op=%p State=%p\n", op, walk_state)); return (AE_OK); @@ -454,13 +457,13 @@ } - data_type = acpi_ds_map_named_opcode_to_data_type (op->opcode); + object_type = walk_state->op_info->object_type; /* * Get the Node/name from the earlier lookup * (It was saved in the *op structure) */ - node = op->node; + node = op->common.node; /* * Put the Node on the object stack (Contains the ACPI Name of @@ -471,11 +474,14 @@ /* Pop the scope stack */ - if (acpi_ns_opens_scope (data_type)) { - + if (acpi_ns_opens_scope (object_type)) { ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n", - acpi_ut_get_type_name (data_type), op)); - acpi_ds_scope_stack_pop (walk_state); + acpi_ut_get_type_name (object_type), op)); + + status = acpi_ds_scope_stack_pop (walk_state); + if (ACPI_FAILURE (status)) { + return (status); + } } /* @@ -508,11 +514,11 @@ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Create-Load [%s] State=%p Op=%p Named_obj=%p\n", - acpi_ps_get_opcode_name (op->opcode), walk_state, op, node)); + acpi_ps_get_opcode_name (op->common.aml_opcode), walk_state, op, node)); /* Decode the opcode */ - arg = op->value.arg; + arg = op->common.value.arg; switch (walk_state->op_info->type) { case AML_TYPE_CREATE_FIELD: @@ -527,24 +533,25 @@ case AML_TYPE_NAMED_FIELD: - arg = op->value.arg; - switch (op->opcode) { + switch (op->common.aml_opcode) { case AML_INDEX_FIELD_OP: - status = acpi_ds_create_index_field (op, (acpi_handle) arg->node, + status = acpi_ds_create_index_field (op, (acpi_handle) arg->common.node, walk_state); break; - case AML_BANK_FIELD_OP: - status = acpi_ds_create_bank_field (op, arg->node, walk_state); + status = acpi_ds_create_bank_field (op, arg->common.node, walk_state); break; - case AML_FIELD_OP: - status = acpi_ds_create_field (op, arg->node, walk_state); + status = acpi_ds_create_field (op, arg->common.node, walk_state); + break; + + default: + /* All NAMED_FIELD opcodes must be handled above */ break; } break; @@ -557,31 +564,27 @@ goto cleanup; } - switch (op->opcode) { + switch (op->common.aml_opcode) { case AML_PROCESSOR_OP: status = acpi_ex_create_processor (walk_state); break; - case AML_POWER_RES_OP: status = acpi_ex_create_power_resource (walk_state); break; - case AML_MUTEX_OP: status = acpi_ex_create_mutex (walk_state); break; - case AML_EVENT_OP: status = acpi_ex_create_event (walk_state); break; - case AML_DATA_REGION_OP: status = acpi_ex_create_table_region (walk_state); @@ -597,7 +600,6 @@ status = AE_OK; goto cleanup; - break; } /* Delete operands */ @@ -612,24 +614,23 @@ case AML_TYPE_NAMED_COMPLEX: - switch (op->opcode) { + switch (op->common.aml_opcode) { case AML_METHOD_OP: /* - * Method_op Pkg_length Names_string Method_flags Term_list + * Method_op Pkg_length Name_string Method_flags Term_list */ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "LOADING-Method: State=%p Op=%p Named_obj=%p\n", walk_state, op, node)); - if (!node->object) { + if (!acpi_ns_get_attached_object (node)) { status = acpi_ds_create_operands (walk_state, arg); if (ACPI_FAILURE (status)) { goto cleanup; } - status = acpi_ex_create_method (((acpi_parse2_object *) op)->data, - ((acpi_parse2_object *) op)->length, - walk_state); + status = acpi_ex_create_method (op->named.data, + op->named.length, walk_state); } break; @@ -639,9 +640,21 @@ * The Op_region is not fully parsed at this time. Only valid argument is the Space_id. * (We must save the address of the AML of the address and length operands) */ - status = acpi_ex_create_region (((acpi_parse2_object *) op)->data, - ((acpi_parse2_object *) op)->length, - (ACPI_ADR_SPACE_TYPE) arg->value.integer, walk_state); + /* + * If we have a valid region, initialize it + * Namespace is NOT locked at this point. + */ + status = acpi_ev_initialize_region (acpi_ns_get_attached_object (node), FALSE); + if (ACPI_FAILURE (status)) { + /* + * If AE_NOT_EXIST is returned, it is not fatal + * because many regions get created before a handler + * is installed for said region. + */ + if (AE_NOT_EXIST == status) { + status = AE_OK; + } + } break; @@ -649,6 +662,11 @@ status = acpi_ds_create_node (walk_state, node, op); break; + + + default: + /* All NAMED_COMPLEX opcodes must be handled above */ + break; } break; @@ -668,21 +686,24 @@ /* * Lookup the method name and save the Node */ - status = acpi_ns_lookup (walk_state->scope_info, arg->value.string, - ACPI_TYPE_ANY, IMODE_LOAD_PASS2, - NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE, + status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, + ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2, + ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, walk_state, &(new_node)); if (ACPI_SUCCESS (status)) { - /* TBD: has name already been resolved by here ??*/ - - /* TBD: [Restructure] Make sure that what we found is indeed a method! */ - /* We didn't search for a method on purpose, to see if the name would resolve! */ + /* + * Make sure that what we found is indeed a method + * We didn't search for a method on purpose, to see if the name would resolve + */ + if (new_node->type != ACPI_TYPE_METHOD) { + status = AE_AML_OPERAND_TYPE; + } /* We could put the returned object (Node) on the object stack for later, but * for now, we will put it in the "op" object that the parser uses, so we * can get it again at the end of this scope */ - op->node = new_node; + op->common.node = new_node; } break; diff -urN linux-2.4.18/drivers/acpi/dispatcher/dswscope.c lia64-2.4/drivers/acpi/dispatcher/dswscope.c --- linux-2.4.18/drivers/acpi/dispatcher/dswscope.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/dispatcher/dswscope.c Tue Apr 9 15:46:58 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: dswscope - Scope stack manipulation - * $Revision: 49 $ + * $Revision: 52 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ #define _COMPONENT ACPI_DISPATCHER - MODULE_NAME ("dswscope") + ACPI_MODULE_NAME ("dswscope") #define STACK_POP(head) head @@ -53,7 +53,7 @@ { acpi_generic_state *scope_info; - PROC_NAME ("Ds_scope_stack_clear"); + ACPI_FUNCTION_NAME ("Ds_scope_stack_clear"); while (walk_state->scope_info) { @@ -84,26 +84,26 @@ acpi_status acpi_ds_scope_stack_push ( acpi_namespace_node *node, - acpi_object_type8 type, + acpi_object_type type, acpi_walk_state *walk_state) { acpi_generic_state *scope_info; - FUNCTION_TRACE ("Ds_scope_stack_push"); + ACPI_FUNCTION_TRACE ("Ds_scope_stack_push"); if (!node) { /* Invalid scope */ - REPORT_ERROR (("Ds_scope_stack_push: null scope passed\n")); + ACPI_REPORT_ERROR (("Ds_scope_stack_push: null scope passed\n")); return_ACPI_STATUS (AE_BAD_PARAMETER); } /* Make sure object type is valid */ if (!acpi_ex_validate_object_type (type)) { - REPORT_WARNING (("Ds_scope_stack_push: type code out of range\n")); + ACPI_REPORT_WARNING (("Ds_scope_stack_push: type code out of range\n")); } @@ -152,7 +152,7 @@ acpi_generic_state *scope_info; - FUNCTION_TRACE ("Ds_scope_stack_pop"); + ACPI_FUNCTION_TRACE ("Ds_scope_stack_pop"); /* diff -urN linux-2.4.18/drivers/acpi/dispatcher/dswstate.c lia64-2.4/drivers/acpi/dispatcher/dswstate.c --- linux-2.4.18/drivers/acpi/dispatcher/dswstate.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/dispatcher/dswstate.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: dswstate - Dispatcher parse tree walk management routines - * $Revision: 54 $ + * $Revision: 64 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,14 +25,12 @@ #include "acpi.h" -#include "amlcode.h" #include "acparser.h" #include "acdispat.h" #include "acnamesp.h" -#include "acinterp.h" #define _COMPONENT ACPI_DISPATCHER - MODULE_NAME ("dswstate") + ACPI_MODULE_NAME ("dswstate") /******************************************************************************* @@ -57,7 +55,7 @@ acpi_generic_state *state; - PROC_NAME ("Ds_result_insert"); + ACPI_FUNCTION_NAME ("Ds_result_insert"); state = walk_state->results; @@ -116,7 +114,7 @@ acpi_generic_state *state; - PROC_NAME ("Ds_result_remove"); + ACPI_FUNCTION_NAME ("Ds_result_remove"); state = walk_state->results; @@ -126,13 +124,12 @@ return (AE_NOT_EXIST); } - if (index >= OBJ_NUM_OPERANDS) { + if (index >= OBJ_MAX_OPERAND) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index out of range: %X State=%p Num=%X\n", index, walk_state, state->results.num_results)); } - /* Check for a valid result object */ if (!state->results.obj_desc [index]) { @@ -181,7 +178,7 @@ acpi_generic_state *state; - PROC_NAME ("Ds_result_pop"); + ACPI_FUNCTION_NAME ("Ds_result_pop"); state = walk_state->results; @@ -237,11 +234,11 @@ acpi_operand_object **object, acpi_walk_state *walk_state) { - u32 index; + NATIVE_UINT index; acpi_generic_state *state; - PROC_NAME ("Ds_result_pop_from_bottom"); + ACPI_FUNCTION_NAME ("Ds_result_pop_from_bottom"); state = walk_state->results; @@ -251,7 +248,6 @@ return (AE_NOT_EXIST); } - if (!state->results.num_results) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result objects! State=%p\n", walk_state)); return (AE_AML_NO_RETURN_VALUE); @@ -273,7 +269,7 @@ if (!*object) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null operand! State=%p #Ops=%X, Index=%X\n", - walk_state, state->results.num_results, index)); + walk_state, state->results.num_results, (u32) index)); return (AE_AML_NO_RETURN_VALUE); } @@ -307,7 +303,7 @@ acpi_generic_state *state; - PROC_NAME ("Ds_result_push"); + ACPI_FUNCTION_NAME ("Ds_result_push"); state = walk_state->results; @@ -329,7 +325,6 @@ return (AE_BAD_PARAMETER); } - state->results.obj_desc [state->results.num_results] = object; state->results.num_results++; @@ -360,7 +355,7 @@ { acpi_generic_state *state; - PROC_NAME ("Ds_result_stack_push"); + ACPI_FUNCTION_NAME ("Ds_result_stack_push"); state = acpi_ut_create_generic_state (); @@ -396,7 +391,7 @@ { acpi_generic_state *state; - PROC_NAME ("Ds_result_stack_pop"); + ACPI_FUNCTION_NAME ("Ds_result_stack_pop"); /* Check for stack underflow */ @@ -440,7 +435,7 @@ u32 i; - FUNCTION_TRACE_PTR ("Ds_obj_stack_delete_all", walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ds_obj_stack_delete_all", walk_state); /* The stack size is configurable, but fixed */ @@ -474,7 +469,7 @@ void *object, acpi_walk_state *walk_state) { - PROC_NAME ("Ds_obj_stack_push"); + ACPI_FUNCTION_NAME ("Ds_obj_stack_push"); /* Check for stack overflow */ @@ -519,7 +514,7 @@ acpi_operand_object **object, acpi_walk_state *walk_state) { - PROC_NAME ("Ds_obj_stack_pop_object"); + ACPI_FUNCTION_NAME ("Ds_obj_stack_pop_object"); /* Check for stack underflow */ @@ -580,7 +575,7 @@ { u32 i; - PROC_NAME ("Ds_obj_stack_pop"); + ACPI_FUNCTION_NAME ("Ds_obj_stack_pop"); for (i = 0; i < pop_count; i++) { @@ -628,7 +623,7 @@ u32 i; acpi_operand_object *obj_desc; - PROC_NAME ("Ds_obj_stack_pop_and_delete"); + ACPI_FUNCTION_NAME ("Ds_obj_stack_pop_and_delete"); for (i = 0; i < pop_count; i++) { @@ -679,7 +674,7 @@ acpi_walk_state *walk_state) { - FUNCTION_TRACE_PTR ("Ds_obj_stack_get_value", walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ds_obj_stack_get_value", walk_state); /* Can't do it if the stack is empty */ @@ -694,7 +689,6 @@ return_PTR (NULL); } - return_PTR (walk_state->operands[(NATIVE_UINT)(walk_state->num_operands - 1) - index]); } @@ -704,31 +698,31 @@ * * FUNCTION: Acpi_ds_get_current_walk_state * - * PARAMETERS: Walk_list - Get current active state for this walk list + * PARAMETERS: Thread - Get current active state for this Thread * * RETURN: Pointer to the current walk state * * DESCRIPTION: Get the walk state that is at the head of the list (the "current" - * walk state. + * walk state.) * ******************************************************************************/ acpi_walk_state * acpi_ds_get_current_walk_state ( - acpi_walk_list *walk_list) + ACPI_THREAD_STATE *thread) { - PROC_NAME ("Ds_get_current_walk_state"); + ACPI_FUNCTION_NAME ("Ds_get_current_walk_state"); - ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Ds_get_current_walk_state, =%p\n", - walk_list->walk_state)); - - if (!walk_list) { + if (!thread) { return (NULL); } - return (walk_list->walk_state); + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Ds_get_current_walk_state, =%p\n", + thread->walk_state_list)); + + return (thread->walk_state_list); } @@ -748,13 +742,13 @@ void acpi_ds_push_walk_state ( acpi_walk_state *walk_state, - acpi_walk_list *walk_list) + ACPI_THREAD_STATE *thread) { - FUNCTION_TRACE ("Ds_push_walk_state"); + ACPI_FUNCTION_TRACE ("Ds_push_walk_state"); - walk_state->next = walk_list->walk_state; - walk_list->walk_state = walk_state; + walk_state->next = thread->walk_state_list; + thread->walk_state_list = walk_state; return_VOID; } @@ -776,25 +770,25 @@ acpi_walk_state * acpi_ds_pop_walk_state ( - acpi_walk_list *walk_list) + ACPI_THREAD_STATE *thread) { acpi_walk_state *walk_state; - FUNCTION_TRACE ("Ds_pop_walk_state"); + ACPI_FUNCTION_TRACE ("Ds_pop_walk_state"); - walk_state = walk_list->walk_state; + walk_state = thread->walk_state_list; if (walk_state) { /* Next walk state becomes the current walk state */ - walk_list->walk_state = walk_state->next; + thread->walk_state_list = walk_state->next; /* * Don't clear the NEXT field, this serves as an indicator * that there is a parent WALK STATE - * Walk_state->Next = NULL; + * NO: Walk_state->Next = NULL; */ } @@ -807,12 +801,12 @@ * FUNCTION: Acpi_ds_create_walk_state * * PARAMETERS: Origin - Starting point for this walk - * Walk_list - Owning walk list + * Thread - Current thread state * * RETURN: Pointer to the new walk state. * - * DESCRIPTION: Allocate and initialize a new walk state. The current walk state - * is set to this new state. + * DESCRIPTION: Allocate and initialize a new walk state. The current walk + * state is set to this new state. * ******************************************************************************/ @@ -821,13 +815,13 @@ acpi_owner_id owner_id, acpi_parse_object *origin, acpi_operand_object *mth_desc, - acpi_walk_list *walk_list) + ACPI_THREAD_STATE *thread) { acpi_walk_state *walk_state; acpi_status status; - FUNCTION_TRACE ("Ds_create_walk_state"); + ACPI_FUNCTION_TRACE ("Ds_create_walk_state"); walk_state = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_WALK); @@ -839,7 +833,7 @@ walk_state->owner_id = owner_id; walk_state->origin = origin; walk_state->method_desc = mth_desc; - walk_state->walk_list = walk_list; + walk_state->thread = thread; /* Init the method args/local */ @@ -856,8 +850,8 @@ /* Put the new state at the head of the walk list */ - if (walk_list) { - acpi_ds_push_walk_state (walk_state, walk_list); + if (thread) { + acpi_ds_push_walk_state (walk_state, thread); } return_PTR (walk_state); @@ -892,7 +886,7 @@ acpi_parse_state *parser_state = &walk_state->parser_state; - FUNCTION_TRACE ("Ds_init_aml_walk"); + ACPI_FUNCTION_TRACE ("Ds_init_aml_walk"); walk_state->parser_state.aml = @@ -901,7 +895,6 @@ walk_state->parser_state.pkg_end = aml_start + aml_length; /* The Next_op of the Next_walk will be the beginning of the method */ - /* TBD: [Restructure] -- obsolete? */ walk_state->next_op = NULL; walk_state->params = params; @@ -914,11 +907,10 @@ if (method_node) { walk_state->parser_state.start_node = method_node; - walk_state->walk_type = WALK_METHOD; + walk_state->walk_type = ACPI_WALK_METHOD; walk_state->method_node = method_node; walk_state->method_desc = acpi_ns_get_attached_object (method_node); - /* Push start scope on scope stack and make it current */ status = acpi_ds_scope_stack_push (method_node, ACPI_TYPE_METHOD, walk_state); @@ -928,13 +920,15 @@ /* Init the method arguments */ - acpi_ds_method_data_init_args (params, MTH_NUM_ARGS, walk_state); + status = acpi_ds_method_data_init_args (params, MTH_NUM_ARGS, walk_state); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } } - else { /* Setup the current scope */ - parser_state->start_node = parser_state->start_op->node; + parser_state->start_node = parser_state->start_op->common.node; if (parser_state->start_node) { /* Push start scope on scope stack and make it current */ @@ -946,9 +940,8 @@ } } - acpi_ds_init_callbacks (walk_state, pass_number); - - return_ACPI_STATUS (AE_OK); + status = acpi_ds_init_callbacks (walk_state, pass_number); + return_ACPI_STATUS (status); } #endif @@ -972,7 +965,7 @@ acpi_generic_state *state; - FUNCTION_TRACE_PTR ("Ds_delete_walk_state", walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ds_delete_walk_state", walk_state); if (!walk_state) { @@ -984,7 +977,6 @@ return; } - if (walk_state->parser_state.scope) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p walk still has a scope list\n", walk_state)); } @@ -1038,7 +1030,7 @@ acpi_ds_delete_walk_state_cache ( void) { - FUNCTION_TRACE ("Ds_delete_walk_state_cache"); + ACPI_FUNCTION_TRACE ("Ds_delete_walk_state_cache"); acpi_ut_delete_generic_cache (ACPI_MEM_LIST_WALK); diff -urN linux-2.4.18/drivers/acpi/driver.c lia64-2.4/drivers/acpi/driver.c --- linux-2.4.18/drivers/acpi/driver.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/driver.c Wed Dec 31 16:00:00 1969 @@ -1,217 +0,0 @@ -/* - * driver.c - ACPI driver - * - * Copyright (C) 2000 Andrew Henroid - * Copyright (C) 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -/* - * Changes - * David Woodhouse 2000-12-6 - * - Fix interruptible_sleep_on() races - * Andrew Grover 2001-2-28 - * - Major revamping - * Peter Breuer 2001-5-20 - * - parse boot time params. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "acpi.h" - - -#define _COMPONENT OS_DEPENDENT - MODULE_NAME ("driver") - -FADT_DESCRIPTOR acpi_fadt; - -static int acpi_disabled = 0; - -enum acpi_blacklist_predicates -{ - all_versions, - less_than_or_equal, - equal, - greater_than_or_equal, -}; - -struct acpi_blacklist_item -{ - char oem_id[7]; - char oem_table_id[9]; - u32 oem_revision; - enum acpi_blacklist_predicates oem_revision_predicate; -}; - -/* - * Currently, this blacklists based on items in the FADT. We may want to - * expand this to using other ACPI tables in the future, too. - */ -static struct acpi_blacklist_item acpi_blacklist[] __initdata = -{ - {"TOSHIB", "750 ", 0x970814, less_than_or_equal}, /* Portege 7020, BIOS 8.10 */ - {""} -}; - -int -acpi_blacklisted(FADT_DESCRIPTOR *fadt) -{ - int i = 0; - - while (acpi_blacklist[i].oem_id[0] != '\0') - { - if (strncmp(acpi_blacklist[i].oem_id, fadt->header.oem_id, 6)) { - i++; - continue; - } - - if (strncmp(acpi_blacklist[i].oem_table_id, fadt->header.oem_table_id, 8)) { - i++; - continue; - } - - if (acpi_blacklist[i].oem_revision_predicate == all_versions) - return TRUE; - - if (acpi_blacklist[i].oem_revision_predicate == less_than_or_equal - && fadt->header.oem_revision <= acpi_blacklist[i].oem_revision) - return TRUE; - - if (acpi_blacklist[i].oem_revision_predicate == greater_than_or_equal - && fadt->header.oem_revision >= acpi_blacklist[i].oem_revision) - return TRUE; - - if (acpi_blacklist[i].oem_revision_predicate == equal - && fadt->header.oem_revision == acpi_blacklist[i].oem_revision) - return TRUE; - - i++; - } - - return FALSE; -} - -/* - * Start the interpreter - */ -int -acpi_init(void) -{ - acpi_buffer buffer; - acpi_system_info sys_info; - - if (PM_IS_ACTIVE()) { - printk(KERN_NOTICE "ACPI: APM is already active, exiting\n"); - return -ENODEV; - } - - if (acpi_disabled) { - printk(KERN_NOTICE "ACPI: disabled by cmdline, exiting\n"); - return -ENODEV; - } - - if (!ACPI_SUCCESS(acpi_initialize_subsystem())) { - printk(KERN_ERR "ACPI: Driver initialization failed\n"); - return -ENODEV; - } - - /* from this point on, on error we must call acpi_terminate() */ - if (!ACPI_SUCCESS(acpi_load_tables())) { - printk(KERN_ERR "ACPI: System description table load failed\n"); - acpi_terminate(); - return -ENODEV; - } - - /* get a separate copy of the FADT for use by other drivers */ - memset(&acpi_fadt, 0, sizeof(acpi_fadt)); - buffer.pointer = &acpi_fadt; - buffer.length = sizeof(acpi_fadt); - - if (!ACPI_SUCCESS(acpi_get_table(ACPI_TABLE_FADT, 1, &buffer))) { - printk(KERN_ERR "ACPI: Could not get FADT\n"); - acpi_terminate(); - return -ENODEV; - } - - if (acpi_blacklisted(&acpi_fadt)) { - printk(KERN_ERR "ACPI: On blacklist -- BIOS not fully ACPI compliant\n"); - acpi_terminate(); - return -ENODEV; - } - - buffer.length = sizeof(sys_info); - buffer.pointer = &sys_info; - - if (!ACPI_SUCCESS (acpi_get_system_info(&buffer))) { - printk(KERN_ERR "ACPI: Could not get system info\n"); - acpi_terminate(); - return -ENODEV; - } - - printk(KERN_INFO "ACPI: Core Subsystem version [%x]\n", sys_info.acpi_ca_version); - - if (!ACPI_SUCCESS(acpi_enable_subsystem(ACPI_FULL_INITIALIZATION))) { - printk(KERN_ERR "ACPI: Subsystem enable failed\n"); - acpi_terminate(); - return -ENODEV; - } - - printk(KERN_INFO "ACPI: Subsystem enabled\n"); - - pm_active = 1; - - return 0; -} - -/* - * Terminate the interpreter - */ -void -acpi_exit(void) -{ - acpi_terminate(); - - pm_active = 0; - - printk(KERN_ERR "ACPI: Subsystem disabled\n"); -} - -module_init(acpi_init); -module_exit(acpi_exit); - -#ifndef MODULE -static int __init acpi_setup(char *str) { - while (str && *str) { - if (strncmp(str, "off", 3) == 0) - acpi_disabled = 1; - str = strchr(str, ','); - if (str) - str += strspn(str, ", \t"); - } - return 1; -} - -__setup("acpi=", acpi_setup); -#endif diff -urN linux-2.4.18/drivers/acpi/ec.c lia64-2.4/drivers/acpi/ec.c --- linux-2.4.18/drivers/acpi/ec.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/ec.c Tue Jun 11 14:24:22 2002 @@ -0,0 +1,736 @@ +/* + * acpi_ec.c - ACPI Embedded Controller Driver ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include +#include +#include +#include +#include +#include "acpi_bus.h" +#include "acpi_drivers.h" + + +#define _COMPONENT ACPI_EC_COMPONENT +ACPI_MODULE_NAME ("acpi_ec") + +#define PREFIX "ACPI: " + + +#define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */ +#define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */ +#define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */ + +#define ACPI_EC_EVENT_OBF 0x01 /* Output buffer full */ +#define ACPI_EC_EVENT_IBE 0x02 /* Input buffer empty */ + +#define ACPI_EC_UDELAY 100 /* Poll @ 100us increments */ +#define ACPI_EC_UDELAY_COUNT 1000 /* Wait 10ms max. during EC ops */ +#define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */ + +#define ACPI_EC_COMMAND_READ 0x80 +#define ACPI_EC_COMMAND_WRITE 0x81 +#define ACPI_EC_COMMAND_QUERY 0x84 + +static int acpi_ec_add (struct acpi_device *device); +static int acpi_ec_remove (struct acpi_device *device, int type); +static int acpi_ec_start (struct acpi_device *device); +static int acpi_ec_stop (struct acpi_device *device, int type); + +static struct acpi_driver acpi_ec_driver = { + name: ACPI_EC_DRIVER_NAME, + class: ACPI_EC_CLASS, + ids: ACPI_EC_HID, + ops: { + add: acpi_ec_add, + remove: acpi_ec_remove, + start: acpi_ec_start, + stop: acpi_ec_stop, + }, +}; + +struct acpi_ec { + acpi_handle handle; + unsigned long gpe_bit; + unsigned long status_port; + unsigned long command_port; + unsigned long data_port; + unsigned long global_lock; + spinlock_t lock; +}; + + +/* -------------------------------------------------------------------------- + Transaction Management + -------------------------------------------------------------------------- */ + +static int +acpi_ec_wait ( + struct acpi_ec *ec, + u8 event) +{ + u8 acpi_ec_status = 0; + u32 i = ACPI_EC_UDELAY_COUNT; + + if (!ec) + return -EINVAL; + + /* Poll the EC status register waiting for the event to occur. */ + switch (event) { + case ACPI_EC_EVENT_OBF: + do { + acpi_ec_status = inb(ec->status_port); + if (acpi_ec_status & ACPI_EC_FLAG_OBF) + return 0; + udelay(ACPI_EC_UDELAY); + } while (--i>0); + break; + case ACPI_EC_EVENT_IBE: + do { + acpi_ec_status = inb(ec->status_port); + if (!(acpi_ec_status & ACPI_EC_FLAG_IBF)) + return 0; + udelay(ACPI_EC_UDELAY); + } while (--i>0); + break; + default: + return -EINVAL; + } + + return -ETIME; +} + + +static int +acpi_ec_read ( + struct acpi_ec *ec, + u8 address, + u8 *data) +{ + acpi_status status = AE_OK; + int result = 0; + unsigned long flags = 0; + u32 glk = 0; + + ACPI_FUNCTION_TRACE("acpi_ec_read"); + + if (!ec || !data) + return_VALUE(-EINVAL); + + *data = 0; + + if (ec->global_lock) { + status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + } + + spin_lock_irqsave(&ec->lock, flags); + + outb(ACPI_EC_COMMAND_READ, ec->command_port); + result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); + if (0 != result) + goto end; + + outb(address, ec->data_port); + result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); + if (0 != result) + goto end; + + *data = inb(ec->data_port); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Read [%02x] from address [%02x]\n", + *data, address)); + +end: + spin_unlock_irqrestore(&ec->lock, flags); + + if (ec->global_lock) + acpi_release_global_lock(glk); + + return_VALUE(result); +} + + +static int +acpi_ec_write ( + struct acpi_ec *ec, + u8 address, + u8 data) +{ + int result = 0; + acpi_status status = AE_OK; + unsigned long flags = 0; + u32 glk = 0; + + ACPI_FUNCTION_TRACE("acpi_ec_write"); + + if (!ec) + return_VALUE(-EINVAL); + + if (ec->global_lock) { + status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + } + + spin_lock_irqsave(&ec->lock, flags); + + outb(ACPI_EC_COMMAND_WRITE, ec->command_port); + result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); + if (0 != result) + goto end; + + outb(address, ec->data_port); + result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); + if (0 != result) + goto end; + + outb(data, ec->data_port); + result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); + if (0 != result) + goto end; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Wrote [%02x] to address [%02x]\n", + data, address)); + +end: + spin_unlock_irqrestore(&ec->lock, flags); + + if (ec->global_lock) + acpi_release_global_lock(glk); + + return_VALUE(result); +} + + +static int +acpi_ec_query ( + struct acpi_ec *ec, + u8 *data) +{ + int result = 0; + acpi_status status = AE_OK; + unsigned long flags = 0; + u32 glk = 0; + + ACPI_FUNCTION_TRACE("acpi_ec_query"); + + if (!ec || !data) + return_VALUE(-EINVAL); + + *data = 0; + + if (ec->global_lock) { + status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + } + + /* + * Query the EC to find out which _Qxx method we need to evaluate. + * Note that successful completion of the query causes the ACPI_EC_SCI + * bit to be cleared (and thus clearing the interrupt source). + */ + + spin_lock_irqsave(&ec->lock, flags); + + outb(ACPI_EC_COMMAND_QUERY, ec->command_port); + result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); + if (0 != result) + goto end; + + *data = inb(ec->data_port); + if (!*data) + result = -ENODATA; + +end: + spin_unlock_irqrestore(&ec->lock, flags); + + if (ec->global_lock) + acpi_release_global_lock(glk); + + return_VALUE(result); +} + + +/* -------------------------------------------------------------------------- + Event Management + -------------------------------------------------------------------------- */ + +struct acpi_ec_query_data { + acpi_handle handle; + u8 data; +}; + + +static void +acpi_ec_gpe_query ( + void *data) +{ + struct acpi_ec_query_data *query_data = NULL; + static char object_name[5] = {'_','Q','0','0','\0'}; + const char hex[] = {'0','1','2','3','4','5','6','7', + '8','9','A','B','C','D','E','F'}; + + ACPI_FUNCTION_TRACE("acpi_ec_gpe_query"); + + if (!data) + return; + + query_data = (struct acpi_ec_query_data *) data; + + object_name[2] = hex[((query_data->data >> 4) & 0x0F)]; + object_name[3] = hex[(query_data->data & 0x0F)]; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s\n", object_name)); + + acpi_evaluate(query_data->handle, object_name, NULL, NULL); + + kfree(query_data); + + return; +} + + +static void +acpi_ec_gpe_handler ( + void *data) +{ + acpi_status status = AE_OK; + struct acpi_ec *ec = (struct acpi_ec *) data; + u8 value = 0; + unsigned long flags = 0; + struct acpi_ec_query_data *query_data = NULL; + + if (!ec) + return; + + spin_lock_irqsave(&ec->lock, flags); + value = inb(ec->command_port); + spin_unlock_irqrestore(&ec->lock, flags); + + /* TBD: Implement asynch events! + * NOTE: All we care about are EC-SCI's. Other EC events are + * handled via polling (yuck!). This is because some systems + * treat EC-SCIs as level (versus EDGE!) triggered, preventing + * a purely interrupt-driven approach (grumble, grumble). + */ + + if (!(value & ACPI_EC_FLAG_SCI)) + return; + + if (0 != acpi_ec_query(ec, &value)) + return; + + query_data = kmalloc(sizeof(struct acpi_ec_query_data), GFP_ATOMIC); + if (!query_data) + return; + query_data->handle = ec->handle; + query_data->data = value; + + status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE, + acpi_ec_gpe_query, query_data); + if (ACPI_FAILURE(status)) + kfree(query_data); + + return; +} + + +/* -------------------------------------------------------------------------- + Address Space Management + -------------------------------------------------------------------------- */ + +static acpi_status +acpi_ec_space_setup ( + acpi_handle region_handle, + u32 function, + void *handler_context, + void **return_context) +{ + /* + * The EC object is in the handler context and is needed + * when calling the acpi_ec_space_handler. + */ + *return_context = handler_context; + + return AE_OK; +} + + +static acpi_status +acpi_ec_space_handler ( + u32 function, + ACPI_PHYSICAL_ADDRESS address, + u32 bit_width, + acpi_integer *value, + void *handler_context, + void *region_context) +{ + int result = 0; + struct acpi_ec *ec = NULL; + + ACPI_FUNCTION_TRACE("acpi_ec_space_handler"); + + if ((address > 0xFF) || (bit_width != 8) || !value || !handler_context) + return_VALUE(AE_BAD_PARAMETER); + + ec = (struct acpi_ec *) handler_context; + + switch (function) { + case ACPI_READ: + result = acpi_ec_read(ec, (u8) address, (u8*) value); + break; + case ACPI_WRITE: + result = acpi_ec_write(ec, (u8) address, (u8) *value); + break; + default: + result = -EINVAL; + break; + } + + switch (result) { + case -EINVAL: + return_VALUE(AE_BAD_PARAMETER); + break; + case -ENODEV: + return_VALUE(AE_NOT_FOUND); + break; + case -ETIME: + return_VALUE(AE_TIME); + break; + default: + return_VALUE(AE_OK); + } + +} + + +/* -------------------------------------------------------------------------- + FS Interface (/proc) + -------------------------------------------------------------------------- */ + +#include +#include + +struct proc_dir_entry *acpi_ec_dir = NULL; + + +static int +acpi_ec_read_info ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_ec *ec = (struct acpi_ec *) data; + char *p = page; + int len = 0; + + ACPI_FUNCTION_TRACE("acpi_ec_read_info"); + + if (!ec || (off != 0)) + goto end; + + p += sprintf(p, "gpe bit: 0x%02x\n", + (u32) ec->gpe_bit); + p += sprintf(p, "ports: 0x%02x, 0x%02x\n", + (u32) ec->status_port, (u32) ec->data_port); + p += sprintf(p, "use global lock: %s\n", + ec->global_lock?"yes":"no"); + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_ec_add_fs ( + struct acpi_device *device) +{ + struct proc_dir_entry *entry = NULL; + + ACPI_FUNCTION_TRACE("acpi_ec_add_fs"); + + if (!acpi_ec_dir) { + acpi_ec_dir = proc_mkdir(ACPI_EC_CLASS, acpi_root_dir); + if (!acpi_ec_dir) + return_VALUE(-ENODEV); + } + + if (!acpi_device_dir(device)) { + acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), + acpi_ec_dir); + if (!acpi_device_dir(device)) + return_VALUE(-ENODEV); + } + + entry = create_proc_read_entry(ACPI_EC_FILE_INFO, S_IRUGO, + acpi_device_dir(device), acpi_ec_read_info, + acpi_driver_data(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Unable to create '%s' fs entry\n", + ACPI_EC_FILE_INFO)); + + return_VALUE(0); +} + + +static int +acpi_ec_remove_fs ( + struct acpi_device *device) +{ + ACPI_FUNCTION_TRACE("acpi_ec_remove_fs"); + + if (!acpi_ec_dir) + return_VALUE(-ENODEV); + + if (acpi_device_dir(device)) + remove_proc_entry(acpi_device_bid(device), acpi_ec_dir); + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Driver Interface + -------------------------------------------------------------------------- */ + +static int +acpi_ec_add ( + struct acpi_device *device) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_ec *ec = NULL; + + ACPI_FUNCTION_TRACE("acpi_ec_add"); + + if (!device) + return_VALUE(-EINVAL); + + ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); + if (!ec) + return_VALUE(-ENOMEM); + memset(ec, 0, sizeof(struct acpi_ec)); + + ec->handle = device->handle; + ec->lock = SPIN_LOCK_UNLOCKED; + sprintf(acpi_device_name(device), "%s", ACPI_EC_DEVICE_NAME); + sprintf(acpi_device_class(device), "%s", ACPI_EC_CLASS); + acpi_driver_data(device) = ec; + + /* Use the global lock for all EC transactions? */ + acpi_evaluate_integer(ec->handle, "_GLK", NULL, &ec->global_lock); + + /* Get GPE bit assignment (EC events). */ + status = acpi_evaluate_integer(ec->handle, "_GPE", NULL, &ec->gpe_bit); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error obtaining GPE bit assignment\n")); + result = -ENODEV; + goto end; + } + + result = acpi_ec_add_fs(device); + if (0 != result) + goto end; + + printk(KERN_INFO PREFIX "%s [%s] (gpe %d)\n", + acpi_device_name(device), acpi_device_bid(device), + (u32) ec->gpe_bit); + +end: + if (0 != result) + kfree(ec); + + return_VALUE(result); +} + + +static int +acpi_ec_remove ( + struct acpi_device *device, + int type) +{ + struct acpi_ec *ec = NULL; + + ACPI_FUNCTION_TRACE("acpi_ec_remove"); + + if (!device) + return_VALUE(-EINVAL); + + ec = (struct acpi_ec *) acpi_driver_data(device); + + acpi_ec_remove_fs(device); + + kfree(ec); + + return_VALUE(0); +} + + +static int +acpi_ec_start ( + struct acpi_device *device) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_ec *ec = NULL; + acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + acpi_resource *resource = NULL; + + ACPI_FUNCTION_TRACE("acpi_ec_start"); + + if (!device) + return_VALUE(-EINVAL); + + ec = (struct acpi_ec *) acpi_driver_data(device); + + if (!ec) + return_VALUE(-EINVAL); + + /* + * Get I/O port addresses + */ + + status = acpi_get_current_resources(ec->handle, &buffer); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error getting I/O port addresses")); + return_VALUE(-ENODEV); + } + + resource = (acpi_resource *) buffer.pointer; + if (!resource || (resource->id != ACPI_RSTYPE_IO)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid or missing resource\n")); + result = -ENODEV; + goto end; + } + ec->data_port = resource->data.io.min_base_address; + + resource = ACPI_NEXT_RESOURCE(resource); + if (!resource || (resource->id != ACPI_RSTYPE_IO)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid or missing resource\n")); + result = -ENODEV; + goto end; + } + ec->command_port = ec->status_port = resource->data.io.min_base_address; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "gpe=0x%02x, ports=0x%2x,0x%2x\n", + (u32) ec->gpe_bit, (u32) ec->command_port, (u32) ec->data_port)); + + /* + * Install GPE handler + */ + + status = acpi_install_gpe_handler(ec->gpe_bit, + ACPI_EVENT_EDGE_TRIGGERED, &acpi_ec_gpe_handler, ec); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + status = acpi_install_address_space_handler (ec->handle, + ACPI_ADR_SPACE_EC, &acpi_ec_space_handler, + &acpi_ec_space_setup, ec); + if (ACPI_FAILURE(status)) { + acpi_remove_address_space_handler(ec->handle, + ACPI_ADR_SPACE_EC, &acpi_ec_space_handler); + return_VALUE(-ENODEV); + } +end: + kfree(buffer.pointer); + + return_VALUE(result); +} + + +static int +acpi_ec_stop ( + struct acpi_device *device, + int type) +{ + acpi_status status = AE_OK; + struct acpi_ec *ec = NULL; + + ACPI_FUNCTION_TRACE("acpi_ec_stop"); + + if (!device) + return_VALUE(-EINVAL); + + ec = (struct acpi_ec *) acpi_driver_data(device); + + status = acpi_remove_address_space_handler(ec->handle, + ACPI_ADR_SPACE_EC, &acpi_ec_space_handler); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + status = acpi_remove_gpe_handler(ec->gpe_bit, &acpi_ec_gpe_handler); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + return_VALUE(0); +} + + +int __init +acpi_ec_init (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_ec_init"); + + result = acpi_bus_register_driver(&acpi_ec_driver); + if (0 > result) { + remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir); + return_VALUE(-ENODEV); + } + + return_VALUE(0); +} + + +void __exit +acpi_ec_exit (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_ec_exit"); + + result = acpi_bus_unregister_driver(&acpi_ec_driver); + if (0 == result) + remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir); + + return_VOID; +} diff -urN linux-2.4.18/drivers/acpi/events/Makefile lia64-2.4/drivers/acpi/events/Makefile --- linux-2.4.18/drivers/acpi/events/Makefile Wed Jun 20 17:47:39 2001 +++ lia64-2.4/drivers/acpi/events/Makefile Tue Apr 9 15:46:58 2002 @@ -1,11 +1,10 @@ # # Makefile for all Linux ACPI interpreter subdirectories -# EXCEPT for the ospm directory # O_TARGET := $(notdir $(CURDIR)).o -obj-$(CONFIG_ACPI) := $(patsubst %.c,%.o,$(wildcard *.c)) +obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c)) EXTRA_CFLAGS += $(ACPI_CFLAGS) diff -urN linux-2.4.18/drivers/acpi/events/evevent.c lia64-2.4/drivers/acpi/events/evevent.c --- linux-2.4.18/drivers/acpi/events/evevent.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/events/evevent.c Tue Jun 11 14:24:22 2002 @@ -1,13 +1,12 @@ /****************************************************************************** * - * Module Name: evevent - Fixed and General Purpose Acpi_event - * handling and dispatch - * $Revision: 51 $ + * Module Name: evevent - Fixed and General Purpose Even handling and dispatch + * $Revision: 88 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,12 +24,11 @@ */ #include "acpi.h" -#include "achware.h" #include "acevents.h" #include "acnamesp.h" #define _COMPONENT ACPI_EVENTS - MODULE_NAME ("evevent") + ACPI_MODULE_NAME ("evevent") /******************************************************************************* @@ -41,9 +39,7 @@ * * RETURN: Status * - * DESCRIPTION: Ensures that the system control interrupt (SCI) is properly - * configured, disables SCI event sources, installs the SCI - * handler + * DESCRIPTION: Initialize global data structures for events. * ******************************************************************************/ @@ -54,7 +50,7 @@ acpi_status status; - FUNCTION_TRACE ("Ev_initialize"); + ACPI_FUNCTION_TRACE ("Ev_initialize"); /* Make sure we have ACPI tables */ @@ -64,17 +60,6 @@ return_ACPI_STATUS (AE_NO_ACPI_TABLES); } - - /* Make sure the BIOS supports ACPI mode */ - - if (SYS_MODE_LEGACY == acpi_hw_get_mode_capabilities()) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "ACPI Mode is not supported!\n")); - return_ACPI_STATUS (AE_ERROR); - } - - - acpi_gbl_original_mode = acpi_hw_get_mode(); - /* * Initialize the Fixed and General Purpose Acpi_events prior. This is * done prior to enabling SCIs to prevent interrupts from occuring @@ -82,30 +67,63 @@ */ status = acpi_ev_fixed_event_initialize (); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to initialize fixed events.\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, + "Unable to initialize fixed events, %s\n", + acpi_format_exception (status))); return_ACPI_STATUS (status); } status = acpi_ev_gpe_initialize (); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to initialize general purpose events.\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, + "Unable to initialize general purpose events, %s\n", + acpi_format_exception (status))); return_ACPI_STATUS (status); } + return_ACPI_STATUS (status); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ev_handler_initialize + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Install handlers for the SCI, Global Lock, and GPEs. + * + ******************************************************************************/ + +acpi_status +acpi_ev_handler_initialize ( + void) +{ + acpi_status status; + + + ACPI_FUNCTION_TRACE ("Ev_initialize"); + + /* Install the SCI handler */ status = acpi_ev_install_sci_handler (); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to install System Control Interrupt Handler\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, + "Unable to install System Control Interrupt Handler, %s\n", + acpi_format_exception (status))); return_ACPI_STATUS (status); } - /* Install handlers for control method GPE handlers (_Lxx, _Exx) */ status = acpi_ev_init_gpe_control_methods (); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to initialize Gpe control methods\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, + "Unable to initialize GPE control methods, %s\n", + acpi_format_exception (status))); return_ACPI_STATUS (status); } @@ -113,11 +131,12 @@ status = acpi_ev_init_global_lock_handler (); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to initialize Global Lock handler\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, + "Unable to initialize Global Lock handler, %s\n", + acpi_format_exception (status))); return_ACPI_STATUS (status); } - return_ACPI_STATUS (status); } @@ -130,27 +149,36 @@ * * RETURN: Status * - * DESCRIPTION: Initialize the Fixed Acpi_event data structures + * DESCRIPTION: Install the fixed event handlers and enable the fixed events. * ******************************************************************************/ acpi_status -acpi_ev_fixed_event_initialize(void) +acpi_ev_fixed_event_initialize ( + void) { - int i = 0; + NATIVE_UINT i; + acpi_status status; - /* Initialize the structure that keeps track of fixed event handlers */ + /* + * Initialize the structure that keeps track of fixed event handlers + * and enable the fixed events. + */ for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { acpi_gbl_fixed_event_handlers[i].handler = NULL; acpi_gbl_fixed_event_handlers[i].context = NULL; - } - acpi_hw_register_bit_access (ACPI_WRITE, ACPI_MTX_LOCK, TMR_EN, 0); - acpi_hw_register_bit_access (ACPI_WRITE, ACPI_MTX_LOCK, GBL_EN, 0); - acpi_hw_register_bit_access (ACPI_WRITE, ACPI_MTX_LOCK, PWRBTN_EN, 0); - acpi_hw_register_bit_access (ACPI_WRITE, ACPI_MTX_LOCK, SLPBTN_EN, 0); - acpi_hw_register_bit_access (ACPI_WRITE, ACPI_MTX_LOCK, RTC_EN, 0); + /* Enable the fixed event */ + + if (acpi_gbl_fixed_event_info[i].enable_register_id != 0xFF) { + status = acpi_set_register (acpi_gbl_fixed_event_info[i].enable_register_id, + 0, ACPI_MTX_LOCK); + if (ACPI_FAILURE (status)) { + return (status); + } + } + } return (AE_OK); } @@ -169,54 +197,41 @@ ******************************************************************************/ u32 -acpi_ev_fixed_event_detect (void) +acpi_ev_fixed_event_detect ( + void) { - u32 int_status = INTERRUPT_NOT_HANDLED; - u32 status_register; - u32 enable_register; + u32 int_status = ACPI_INTERRUPT_NOT_HANDLED; + u32 gpe_status; + u32 gpe_enable; + NATIVE_UINT_MAX32 i; - PROC_NAME ("Ev_fixed_event_detect"); + ACPI_FUNCTION_NAME ("Ev_fixed_event_detect"); /* * Read the fixed feature status and enable registers, as all the cases - * depend on their values. + * depend on their values. Ignore errors here. */ - status_register = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, PM1_STS); - enable_register = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, PM1_EN); + (void) acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS, &gpe_status); + (void) acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_ENABLE, &gpe_enable); ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, "Fixed Acpi_event Block: Enable %08X Status %08X\n", - enable_register, status_register)); - - - /* power management timer roll over */ - - if ((status_register & ACPI_STATUS_PMTIMER) && - (enable_register & ACPI_ENABLE_PMTIMER)) { - int_status |= acpi_ev_fixed_event_dispatch (ACPI_EVENT_PMTIMER); - } - - /* global event (BIOS wants the global lock) */ + gpe_enable, gpe_status)); - if ((status_register & ACPI_STATUS_GLOBAL) && - (enable_register & ACPI_ENABLE_GLOBAL)) { - int_status |= acpi_ev_fixed_event_dispatch (ACPI_EVENT_GLOBAL); - } - - /* power button event */ - - if ((status_register & ACPI_STATUS_POWER_BUTTON) && - (enable_register & ACPI_ENABLE_POWER_BUTTON)) { - int_status |= acpi_ev_fixed_event_dispatch (ACPI_EVENT_POWER_BUTTON); - } + /* + * Check for all possible Fixed Events and dispatch those that are active + */ + for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { + /* Both the status and enable bits must be on for this event */ - /* sleep button event */ + if ((gpe_status & acpi_gbl_fixed_event_info[i].status_bit_mask) && + (gpe_enable & acpi_gbl_fixed_event_info[i].enable_bit_mask)) { + /* Found an active (signalled) event */ - if ((status_register & ACPI_STATUS_SLEEP_BUTTON) && - (enable_register & ACPI_ENABLE_SLEEP_BUTTON)) { - int_status |= acpi_ev_fixed_event_dispatch (ACPI_EVENT_SLEEP_BUTTON); + int_status |= acpi_ev_fixed_event_dispatch (i); + } } return (int_status); @@ -240,60 +255,32 @@ acpi_ev_fixed_event_dispatch ( u32 event) { - u32 register_id; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* Clear the status bit */ - switch (event) { - case ACPI_EVENT_PMTIMER: - register_id = TMR_STS; - break; - - case ACPI_EVENT_GLOBAL: - register_id = GBL_STS; - break; - - case ACPI_EVENT_POWER_BUTTON: - register_id = PWRBTN_STS; - break; - - case ACPI_EVENT_SLEEP_BUTTON: - register_id = SLPBTN_STS; - break; - - case ACPI_EVENT_RTC: - register_id = RTC_STS; - break; - - default: - return 0; - break; - } - - acpi_hw_register_bit_access (ACPI_WRITE, ACPI_MTX_DO_NOT_LOCK, register_id, 1); + (void) acpi_set_register (acpi_gbl_fixed_event_info[event].status_register_id, + 1, ACPI_MTX_DO_NOT_LOCK); /* * Make sure we've got a handler. If not, report an error. * The event is disabled to prevent further interrupts. */ if (NULL == acpi_gbl_fixed_event_handlers[event].handler) { - register_id = (PM1_EN | REGISTER_BIT_ID(register_id)); - - acpi_hw_register_bit_access (ACPI_WRITE, ACPI_MTX_DO_NOT_LOCK, - register_id, 0); + (void) acpi_set_register (acpi_gbl_fixed_event_info[event].enable_register_id, + 0, ACPI_MTX_DO_NOT_LOCK); - REPORT_ERROR ( + ACPI_REPORT_ERROR ( ("Ev_gpe_dispatch: No installed handler for fixed event [%08X]\n", event)); - return (INTERRUPT_NOT_HANDLED); + return (ACPI_INTERRUPT_NOT_HANDLED); } - /* Invoke the handler */ + /* Invoke the Fixed Event handler */ return ((acpi_gbl_fixed_event_handlers[event].handler)( acpi_gbl_fixed_event_handlers[event].context)); @@ -315,138 +302,209 @@ acpi_status acpi_ev_gpe_initialize (void) { - u32 i; - u32 j; - u32 register_index; + NATIVE_UINT_MAX32 i; + NATIVE_UINT_MAX32 j; + u32 gpe_block; + u32 gpe_register; + u32 gpe_number_index; u32 gpe_number; - u16 gpe0register_count; - u16 gpe1_register_count; + ACPI_GPE_REGISTER_INFO *gpe_register_info; + acpi_status status; - FUNCTION_TRACE ("Ev_gpe_initialize"); + ACPI_FUNCTION_TRACE ("Ev_gpe_initialize"); + /* - * Set up various GPE counts + * Initialize the GPE Block globals * - * You may ask,why are the GPE register block lengths divided by 2? - * From the ACPI 2.0 Spec, section, 4.7.1.6 General-Purpose Event - * Registers, we have, + * Why the GPE register block lengths divided by 2: From the ACPI Spec, + * section "General-Purpose Event Registers", we have: * * "Each register block contains two registers of equal length - * GPEx_STS and GPEx_EN (where x is 0 or 1). The length of the - * GPE0_STS and GPE0_EN registers is equal to half the GPE0_LEN - * The length of the GPE1_STS and GPE1_EN registers is equal to - * half the GPE1_LEN. If a generic register block is not supported - * then its respective block pointer and block length values in the - * FADT table contain zeros. The GPE0_LEN and GPE1_LEN do not need - * to be the same size." - */ - gpe0register_count = (u16) DIV_2 (acpi_gbl_FADT->gpe0blk_len); - gpe1_register_count = (u16) DIV_2 (acpi_gbl_FADT->gpe1_blk_len); - acpi_gbl_gpe_register_count = gpe0register_count + gpe1_register_count; + * GPEx_STS and GPEx_EN (where x is 0 or 1). The length of the + * GPE0_STS and GPE0_EN registers is equal to half the GPE0_LEN + * The length of the GPE1_STS and GPE1_EN registers is equal to + * half the GPE1_LEN. If a generic register block is not supported + * then its respective block pointer and block length values in the + * FADT table contain zeros. The GPE0_LEN and GPE1_LEN do not need + * to be the same size." + */ + acpi_gbl_gpe_block_info[0].address_space_id = acpi_gbl_FADT->Xgpe0_blk.address_space_id; + acpi_gbl_gpe_block_info[1].address_space_id = acpi_gbl_FADT->Xgpe1_blk.address_space_id; + + acpi_gbl_gpe_block_info[0].register_count = (u16) ACPI_DIV_16 (acpi_gbl_FADT->Xgpe0_blk.register_bit_width); + acpi_gbl_gpe_block_info[1].register_count = (u16) ACPI_DIV_16 (acpi_gbl_FADT->Xgpe1_blk.register_bit_width); + if (acpi_gbl_gpe_block_info[0].register_count == 0) + acpi_gbl_gpe_block_info[0].register_count = 1; + if (acpi_gbl_gpe_block_info[1].register_count == 0) + acpi_gbl_gpe_block_info[1].register_count = 1; + + acpi_gbl_gpe_block_info[0].block_address = &acpi_gbl_FADT->Xgpe0_blk; + acpi_gbl_gpe_block_info[1].block_address = &acpi_gbl_FADT->Xgpe1_blk; + + acpi_gbl_gpe_block_info[0].block_base_number = 0; + acpi_gbl_gpe_block_info[1].block_base_number = acpi_gbl_FADT->gpe1_base; + acpi_gbl_gpe_register_count = acpi_gbl_gpe_block_info[0].register_count + + acpi_gbl_gpe_block_info[1].register_count; if (!acpi_gbl_gpe_register_count) { - REPORT_WARNING (("Zero GPEs are defined in the FADT\n")); + ACPI_REPORT_WARNING (("Zero GPEs are defined in the FADT\n")); return_ACPI_STATUS (AE_OK); } + /* Determine the maximum GPE number for this machine */ + + acpi_gbl_gpe_number_max = ACPI_MUL_8 (acpi_gbl_gpe_block_info[0].register_count) - 1; + + if (acpi_gbl_gpe_block_info[1].register_count) { + /* Check for GPE0/GPE1 overlap */ + + if (acpi_gbl_gpe_number_max >= acpi_gbl_FADT->gpe1_base) { + ACPI_REPORT_ERROR (("GPE0 block overlaps the GPE1 block\n")); + return_ACPI_STATUS (AE_BAD_VALUE); + } + + /* GPE0 and GPE1 do not have to be contiguous in the GPE number space */ + + acpi_gbl_gpe_number_max = acpi_gbl_FADT->gpe1_base + (ACPI_MUL_8 (acpi_gbl_gpe_block_info[1].register_count) - 1); + } + + /* Check for Max GPE number out-of-range */ + + if (acpi_gbl_gpe_number_max > ACPI_GPE_MAX) { + ACPI_REPORT_ERROR (("Maximum GPE number from FADT is too large: 0x%X\n", acpi_gbl_gpe_number_max)); + return_ACPI_STATUS (AE_BAD_VALUE); + } + /* - * Allocate the Gpe information block + * Allocate the GPE number-to-index translation table */ - acpi_gbl_gpe_registers = ACPI_MEM_CALLOCATE (acpi_gbl_gpe_register_count * - sizeof (acpi_gpe_registers)); - if (!acpi_gbl_gpe_registers) { + acpi_gbl_gpe_number_to_index = ACPI_MEM_CALLOCATE ( + sizeof (ACPI_GPE_INDEX_INFO) * + ((ACPI_SIZE) acpi_gbl_gpe_number_max + 1)); + if (!acpi_gbl_gpe_number_to_index) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Could not allocate the Gpe_registers block\n")); + "Could not allocate the Gpe_number_to_index table\n")); return_ACPI_STATUS (AE_NO_MEMORY); } + /* Set the Gpe index table to GPE_INVALID */ + + ACPI_MEMSET (acpi_gbl_gpe_number_to_index, (int) ACPI_GPE_INVALID, + sizeof (ACPI_GPE_INDEX_INFO) * ((ACPI_SIZE) acpi_gbl_gpe_number_max + 1)); + /* - * Allocate the Gpe dispatch handler block - * There are eight distinct GP events per register. - * Initialization to zeros is sufficient - */ - acpi_gbl_gpe_info = ACPI_MEM_CALLOCATE (MUL_8 (acpi_gbl_gpe_register_count) * - sizeof (acpi_gpe_level_info)); - if (!acpi_gbl_gpe_info) { - ACPI_MEM_FREE (acpi_gbl_gpe_registers); - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not allocate the Gpe_info block\n")); - return_ACPI_STATUS (AE_NO_MEMORY); + * Allocate the GPE register information block + */ + acpi_gbl_gpe_register_info = ACPI_MEM_CALLOCATE ( + (ACPI_SIZE) acpi_gbl_gpe_register_count * + sizeof (ACPI_GPE_REGISTER_INFO)); + if (!acpi_gbl_gpe_register_info) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Could not allocate the Gpe_register_info table\n")); + goto error_exit1; } - /* Set the Gpe validation table to GPE_INVALID */ - - MEMSET (acpi_gbl_gpe_valid, (int) ACPI_GPE_INVALID, ACPI_NUM_GPE); + /* + * Allocate the GPE dispatch handler block. There are eight distinct GPEs + * per register. Initialization to zeros is sufficient. + */ + acpi_gbl_gpe_number_info = ACPI_MEM_CALLOCATE ( + (ACPI_SIZE) ACPI_MUL_8 (acpi_gbl_gpe_register_count) * + sizeof (ACPI_GPE_NUMBER_INFO)); + if (!acpi_gbl_gpe_number_info) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not allocate the Gpe_number_info table\n")); + goto error_exit2; + } /* - * Initialize the Gpe information and validation blocks. A goal of these - * blocks is to hide the fact that there are two separate GPE register sets - * In a given block, the status registers occupy the first half, and - * the enable registers occupy the second half. + * Initialize the GPE information and validation tables. A goal of these + * tables is to hide the fact that there are two separate GPE register sets + * in a given gpe hardware block, the status registers occupy the first half, + * and the enable registers occupy the second half. Another goal is to hide + * the fact that there may be multiple GPE hardware blocks. */ + gpe_register = 0; + gpe_number_index = 0; - /* GPE Block 0 */ + for (gpe_block = 0; gpe_block < ACPI_MAX_GPE_BLOCKS; gpe_block++) { + for (i = 0; i < acpi_gbl_gpe_block_info[gpe_block].register_count; i++) { + gpe_register_info = &acpi_gbl_gpe_register_info[gpe_register]; - register_index = 0; + /* Init the Register info for this entire GPE register (8 GPEs) */ - for (i = 0; i < gpe0register_count; i++) { - acpi_gbl_gpe_registers[register_index].status_addr = - (u16) (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe0blk.address) + i); + gpe_register_info->base_gpe_number = (u8) (acpi_gbl_gpe_block_info[gpe_block].block_base_number + + (ACPI_MUL_8 (i))); - acpi_gbl_gpe_registers[register_index].enable_addr = - (u16) (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe0blk.address) + i + gpe0register_count); + ACPI_STORE_ADDRESS (gpe_register_info->status_address.address, + (ACPI_GET_ADDRESS (acpi_gbl_gpe_block_info[gpe_block].block_address->address) + + i)); - acpi_gbl_gpe_registers[register_index].gpe_base = (u8) MUL_8 (i); + ACPI_STORE_ADDRESS (gpe_register_info->enable_address.address, + (ACPI_GET_ADDRESS (acpi_gbl_gpe_block_info[gpe_block].block_address->address) + + i + + acpi_gbl_gpe_block_info[gpe_block].register_count)); - for (j = 0; j < 8; j++) { - gpe_number = acpi_gbl_gpe_registers[register_index].gpe_base + j; - acpi_gbl_gpe_valid[gpe_number] = (u8) register_index; - } + gpe_register_info->status_address.address_space_id = acpi_gbl_gpe_block_info[gpe_block].address_space_id; + gpe_register_info->enable_address.address_space_id = acpi_gbl_gpe_block_info[gpe_block].address_space_id; + gpe_register_info->status_address.register_bit_width = 8; + gpe_register_info->enable_address.register_bit_width = 8; + gpe_register_info->status_address.register_bit_offset = 8; + gpe_register_info->enable_address.register_bit_offset = 8; - /* - * Clear the status/enable registers. Note that status registers - * are cleared by writing a '1', while enable registers are cleared - * by writing a '0'. - */ - acpi_os_write_port (acpi_gbl_gpe_registers[register_index].enable_addr, 0x00, 8); - acpi_os_write_port (acpi_gbl_gpe_registers[register_index].status_addr, 0xFF, 8); + /* Init the Index mapping info for each GPE number within this register */ - register_index++; - } + for (j = 0; j < 8; j++) { + gpe_number = gpe_register_info->base_gpe_number + j; + acpi_gbl_gpe_number_to_index[gpe_number].number_index = (u8) gpe_number_index; - /* GPE Block 1 */ + acpi_gbl_gpe_number_info[gpe_number_index].bit_mask = acpi_gbl_decode_to8bit[j]; + gpe_number_index++; + } - for (i = 0; i < gpe1_register_count; i++) { - acpi_gbl_gpe_registers[register_index].status_addr = - (u16) (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe1_blk.address) + i); + /* + * Clear the status/enable registers. Note that status registers + * are cleared by writing a '1', while enable registers are cleared + * by writing a '0'. + */ - acpi_gbl_gpe_registers[register_index].enable_addr = - (u16) (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe1_blk.address) + i + gpe1_register_count); + status = acpi_hw_low_level_write (8, 0x00, &gpe_register_info->enable_address, 0); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - acpi_gbl_gpe_registers[register_index].gpe_base = - (u8) (acpi_gbl_FADT->gpe1_base + MUL_8 (i)); + status = acpi_hw_low_level_write (8, 0xFF, &gpe_register_info->status_address, 0); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - for (j = 0; j < 8; j++) { - gpe_number = acpi_gbl_gpe_registers[register_index].gpe_base + j; - acpi_gbl_gpe_valid[gpe_number] = (u8) register_index; + gpe_register++; } - /* - * Clear the status/enable registers. Note that status registers - * are cleared by writing a '1', while enable registers are cleared - * by writing a '0'. - */ - acpi_os_write_port (acpi_gbl_gpe_registers[register_index].enable_addr, 0x00, 8); - acpi_os_write_port (acpi_gbl_gpe_registers[register_index].status_addr, 0xFF, 8); - - register_index++; + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE Block%d: %X registers at %8.8X%8.8X\n", + (s32) gpe_block, acpi_gbl_gpe_block_info[0].register_count, + ACPI_HIDWORD (ACPI_GET_ADDRESS (acpi_gbl_gpe_block_info[gpe_block].block_address->address)), + ACPI_LODWORD (ACPI_GET_ADDRESS (acpi_gbl_gpe_block_info[gpe_block].block_address->address)))); + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE Block%d Range GPE #%2.2X to GPE #%2.2X\n", + (s32) gpe_block, + acpi_gbl_gpe_block_info[gpe_block].block_base_number, + acpi_gbl_gpe_block_info[gpe_block].block_base_number + + ((acpi_gbl_gpe_block_info[gpe_block].register_count * 8) -1))); } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE registers: %X@%8.8X%8.8X (Blk0) %X@%8.8X%8.8X (Blk1)\n", - gpe0register_count, HIDWORD(acpi_gbl_FADT->Xgpe0blk.address), LODWORD(acpi_gbl_FADT->Xgpe0blk.address), - gpe1_register_count, HIDWORD(acpi_gbl_FADT->Xgpe1_blk.address), LODWORD(acpi_gbl_FADT->Xgpe1_blk.address))); - return_ACPI_STATUS (AE_OK); + + + /* Error cleanup */ + +error_exit2: + ACPI_MEM_FREE (acpi_gbl_gpe_register_info); + +error_exit1: + ACPI_MEM_FREE (acpi_gbl_gpe_number_to_index); + return_ACPI_STATUS (AE_NO_MEMORY); } @@ -468,7 +526,7 @@ * Where: * L - means that the GPE is level triggered * E - means that the GPE is edge triggered - * nn - is the GPE number + * nn - is the GPE number [in HEX] * ******************************************************************************/ @@ -480,28 +538,34 @@ void **return_value) { u32 gpe_number; + u32 gpe_number_index; NATIVE_CHAR name[ACPI_NAME_SIZE + 1]; u8 type; + acpi_status status; - PROC_NAME ("Ev_save_method_info"); + ACPI_FUNCTION_NAME ("Ev_save_method_info"); /* Extract the name from the object and convert to a string */ - MOVE_UNALIGNED32_TO_32 (name, &((acpi_namespace_node *) obj_handle)->name); + ACPI_MOVE_UNALIGNED32_TO_32 (name, + &((acpi_namespace_node *) obj_handle)->name.integer); name[ACPI_NAME_SIZE] = 0; /* - * Edge/Level determination is based on the 2nd s8 of the method name + * Edge/Level determination is based on the 2nd character of the method name */ - if (name[1] == 'L') { + switch (name[1]) { + case 'L': type = ACPI_EVENT_LEVEL_TRIGGERED; - } - else if (name[1] == 'E') { + break; + + case 'E': type = ACPI_EVENT_EDGE_TRIGGERED; - } - else { + break; + + default: /* Unknown method type, just ignore it! */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, @@ -510,9 +574,9 @@ return (AE_OK); } - /* Convert the last two characters of the name to the Gpe Number */ + /* Convert the last two characters of the name to the GPE Number */ - gpe_number = STRTOUL (&name[2], NULL, 16); + gpe_number = ACPI_STRTOUL (&name[2], NULL, 16); if (gpe_number == ACPI_UINT32_MAX) { /* Conversion failed; invalid method, just ignore it */ @@ -522,9 +586,10 @@ return (AE_OK); } - /* Ensure that we have a valid GPE number */ + /* Get GPE index and ensure that we have a valid GPE number */ - if (acpi_gbl_gpe_valid[gpe_number] == ACPI_GPE_INVALID) { + gpe_number_index = acpi_ev_get_gpe_number_index (gpe_number); + if (gpe_number_index == ACPI_GPE_INVALID) { /* Not valid, all we can do here is ignore it */ return (AE_OK); @@ -534,14 +599,16 @@ * Now we can add this information to the Gpe_info block * for use during dispatch of this GPE. */ - acpi_gbl_gpe_info [gpe_number].type = type; - acpi_gbl_gpe_info [gpe_number].method_handle = obj_handle; - + acpi_gbl_gpe_number_info [gpe_number_index].type = type; + acpi_gbl_gpe_number_info [gpe_number_index].method_handle = obj_handle; /* * Enable the GPE (SCIs should be disabled at this point) */ - acpi_hw_enable_gpe (gpe_number); + status = acpi_hw_enable_gpe (gpe_number); + if (ACPI_FAILURE (status)) { + return (status); + } ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Registered GPE method %s as GPE number %X\n", name, gpe_number)); @@ -555,10 +622,9 @@ * * PARAMETERS: None * - * RETURN: None + * RETURN: Status * * DESCRIPTION: Obtain the control methods associated with the GPEs. - * * NOTE: Must be called AFTER namespace initialization! * ******************************************************************************/ @@ -569,7 +635,7 @@ acpi_status status; - FUNCTION_TRACE ("Ev_init_gpe_control_methods"); + ACPI_FUNCTION_TRACE ("Ev_init_gpe_control_methods"); /* Get a permanent handle to the _GPE object */ @@ -597,21 +663,25 @@ * * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED * - * DESCRIPTION: Detect if any GP events have occurred + * DESCRIPTION: Detect if any GP events have occurred. This function is + * executed at interrupt level. * ******************************************************************************/ u32 acpi_ev_gpe_detect (void) { - u32 int_status = INTERRUPT_NOT_HANDLED; + u32 int_status = ACPI_INTERRUPT_NOT_HANDLED; u32 i; u32 j; u8 enabled_status_byte; u8 bit_mask; + ACPI_GPE_REGISTER_INFO *gpe_register_info; + u32 in_value; + acpi_status status; - PROC_NAME ("Ev_gpe_detect"); + ACPI_FUNCTION_NAME ("Ev_gpe_detect"); /* @@ -620,23 +690,31 @@ * Find all currently active GP events. */ for (i = 0; i < acpi_gbl_gpe_register_count; i++) { - acpi_os_read_port (acpi_gbl_gpe_registers[i].status_addr, - &acpi_gbl_gpe_registers[i].status, 8); + gpe_register_info = &acpi_gbl_gpe_register_info[i]; - acpi_os_read_port (acpi_gbl_gpe_registers[i].enable_addr, - &acpi_gbl_gpe_registers[i].enable, 8); + status = acpi_hw_low_level_read (8, &in_value, &gpe_register_info->status_address, 0); + gpe_register_info->status = (u8) in_value; + if (ACPI_FAILURE (status)) { + return (ACPI_INTERRUPT_NOT_HANDLED); + } + + status = acpi_hw_low_level_read (8, &in_value, &gpe_register_info->enable_address, 0); + gpe_register_info->enable = (u8) in_value; + if (ACPI_FAILURE (status)) { + return (ACPI_INTERRUPT_NOT_HANDLED); + } ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, - "GPE block at %X - Enable %08X Status %08X\n", - acpi_gbl_gpe_registers[i].enable_addr, - acpi_gbl_gpe_registers[i].status, - acpi_gbl_gpe_registers[i].enable)); + "GPE block at %8.8X%8.8X - Values: Enable %02X Status %02X\n", + ACPI_HIDWORD (ACPI_GET_ADDRESS (gpe_register_info->enable_address.address)), + ACPI_LODWORD (ACPI_GET_ADDRESS (gpe_register_info->enable_address.address)), + gpe_register_info->enable, + gpe_register_info->status)); /* First check if there is anything active at all in this register */ - enabled_status_byte = (u8) (acpi_gbl_gpe_registers[i].status & - acpi_gbl_gpe_registers[i].enable); - + enabled_status_byte = (u8) (gpe_register_info->status & + gpe_register_info->enable); if (!enabled_status_byte) { /* No active GPEs in this register, move on */ @@ -654,7 +732,7 @@ * or method. */ int_status |= acpi_ev_gpe_dispatch ( - acpi_gbl_gpe_registers[i].gpe_base + j); + gpe_register_info->base_gpe_number + j); } } } @@ -667,7 +745,7 @@ * * FUNCTION: Acpi_ev_asynch_execute_gpe_method * - * PARAMETERS: Gpe_number - The 0-based Gpe number + * PARAMETERS: Gpe_number - The 0-based GPE number * * RETURN: None * @@ -679,46 +757,66 @@ * ******************************************************************************/ -static void +static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method ( void *context) { - u32 gpe_number = (u32) context; - acpi_gpe_level_info gpe_info; + u32 gpe_number = (u32) ACPI_TO_INTEGER (context); + u32 gpe_number_index; + ACPI_GPE_NUMBER_INFO gpe_info; + acpi_status status; - FUNCTION_TRACE ("Ev_asynch_execute_gpe_method"); + ACPI_FUNCTION_TRACE ("Ev_asynch_execute_gpe_method"); - /* - * Take a snapshot of the GPE info for this level - */ - acpi_ut_acquire_mutex (ACPI_MTX_EVENTS); - gpe_info = acpi_gbl_gpe_info [gpe_number]; - acpi_ut_release_mutex (ACPI_MTX_EVENTS); + + gpe_number_index = acpi_ev_get_gpe_number_index (gpe_number); + if (gpe_number_index == ACPI_GPE_INVALID) { + return_VOID; + } /* - * Method Handler (_Lxx, _Exx): - * ---------------------------- - * Evaluate the _Lxx/_Exx control method that corresponds to this GPE. + * Take a snapshot of the GPE info for this level - we copy the + * info to prevent a race condition with Remove_handler. */ + status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS); + if (ACPI_FAILURE (status)) { + return_VOID; + } + + gpe_info = acpi_gbl_gpe_number_info [gpe_number_index]; + status = acpi_ut_release_mutex (ACPI_MTX_EVENTS); + if (ACPI_FAILURE (status)) { + return_VOID; + } + if (gpe_info.method_handle) { - acpi_ns_evaluate_by_handle (gpe_info.method_handle, NULL, NULL); + /* + * Invoke the GPE Method (_Lxx, _Exx): + * (Evaluate the _Lxx/_Exx control method that corresponds to this GPE.) + */ + status = acpi_ns_evaluate_by_handle (gpe_info.method_handle, NULL, NULL); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("%s while evaluated GPE%X method\n", + acpi_format_exception (status), gpe_number)); + } } - /* - * Level-Triggered? - * ---------------- - * If level-triggered we clear the GPE status bit after handling the event. - */ if (gpe_info.type & ACPI_EVENT_LEVEL_TRIGGERED) { - acpi_hw_clear_gpe (gpe_number); + /* + * GPE is level-triggered, we clear the GPE status bit after handling + * the event. + */ + status = acpi_hw_clear_gpe (gpe_number); + if (ACPI_FAILURE (status)) { + return_VOID; + } } /* * Enable the GPE. */ - acpi_hw_enable_gpe (gpe_number); - + (void) acpi_hw_enable_gpe (gpe_number); return_VOID; } @@ -727,18 +825,13 @@ * * FUNCTION: Acpi_ev_gpe_dispatch * - * PARAMETERS: Gpe_number - The 0-based Gpe number + * PARAMETERS: Gpe_number - The 0-based GPE number * * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED * - * DESCRIPTION: Handle and dispatch a General Purpose Acpi_event. - * Clears the status bit for the requested event. - * - * TBD: [Investigate] is this still valid or necessary: - * The Gpe handler differs from the fixed events in that it clears the enable - * bit rather than the status bit to clear the interrupt. This allows - * software outside of interrupt context to determine what caused the SCI and - * dispatch the correct AML. + * DESCRIPTION: Dispatch a General Purpose Event to either a function (e.g. EC) + * or method (e.g. _Lxx/_Exx) handler. This function executes + * at interrupt level. * ******************************************************************************/ @@ -746,82 +839,96 @@ acpi_ev_gpe_dispatch ( u32 gpe_number) { - acpi_gpe_level_info gpe_info; + u32 gpe_number_index; + ACPI_GPE_NUMBER_INFO *gpe_info; + acpi_status status; - FUNCTION_TRACE ("Ev_gpe_dispatch"); + ACPI_FUNCTION_TRACE ("Ev_gpe_dispatch"); - /* - * Valid GPE number? - */ - if (acpi_gbl_gpe_valid[gpe_number] == ACPI_GPE_INVALID) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid GPE bit [%X].\n", gpe_number)); - return_VALUE (INTERRUPT_NOT_HANDLED); + gpe_number_index = acpi_ev_get_gpe_number_index (gpe_number); + if (gpe_number_index == ACPI_GPE_INVALID) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid event, GPE[%X].\n", gpe_number)); + return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } /* - * Disable the GPE. + * We don't have to worry about mutex on Gpe_info because we are + * executing at interrupt level. */ - acpi_hw_disable_gpe (gpe_number); - - gpe_info = acpi_gbl_gpe_info [gpe_number]; + gpe_info = &acpi_gbl_gpe_number_info [gpe_number_index]; /* - * Edge-Triggered? - * --------------- * If edge-triggered, clear the GPE status bit now. Note that * level-triggered events are cleared after the GPE is serviced. */ - if (gpe_info.type & ACPI_EVENT_EDGE_TRIGGERED) { - acpi_hw_clear_gpe (gpe_number); + if (gpe_info->type & ACPI_EVENT_EDGE_TRIGGERED) { + status = acpi_hw_clear_gpe (gpe_number); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to clear GPE[%X]\n", gpe_number)); + return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); + } } - /* - * Function Handler (e.g. EC)? - */ - if (gpe_info.handler) { - /* Invoke function handler (at interrupt level). */ - - gpe_info.handler (gpe_info.context); - /* Level-Triggered? */ + /* + * Dispatch the GPE to either an installed handler, or the control + * method associated with this GPE (_Lxx or _Exx). + * If a handler exists, we invoke it and do not attempt to run the method. + * If there is neither a handler nor a method, we disable the level to + * prevent further events from coming in here. + */ + if (gpe_info->handler) { + /* Invoke the installed handler (at interrupt level) */ - if (gpe_info.type & ACPI_EVENT_LEVEL_TRIGGERED) { - acpi_hw_clear_gpe (gpe_number); + gpe_info->handler (gpe_info->context); + } + else if (gpe_info->method_handle) { + /* + * Disable GPE, so it doesn't keep firing before the method has a + * chance to run. + */ + status = acpi_hw_disable_gpe (gpe_number); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to disable GPE[%X]\n", gpe_number)); + return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } - /* Enable GPE */ - - acpi_hw_enable_gpe (gpe_number); + /* + * Execute the method associated with the GPE. + */ + if (ACPI_FAILURE (acpi_os_queue_for_execution (OSD_PRIORITY_GPE, + acpi_ev_asynch_execute_gpe_method, + ACPI_TO_POINTER (gpe_number)))) { + ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to queue handler for GPE[%X], event is disabled\n", gpe_number)); + } } + else { + /* No handler or method to run! */ - /* - * Method Handler (e.g. _Exx/_Lxx)? - */ - else if (gpe_info.method_handle) { - if (ACPI_FAILURE(acpi_os_queue_for_execution (OSD_PRIORITY_GPE, - acpi_ev_asynch_execute_gpe_method, (void*) gpe_number))) { - /* - * Shoudn't occur, but if it does report an error. Note that - * the GPE will remain disabled until the ACPI Core Subsystem - * is restarted, or the handler is removed/reinstalled. - */ - REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to queue handler for GPE bit [%X]\n", gpe_number)); + ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: No handler or method for GPE[%X], disabling event\n", gpe_number)); + + /* + * Disable the GPE. The GPE will remain disabled until the ACPI + * Core Subsystem is restarted, or the handler is reinstalled. + */ + status = acpi_hw_disable_gpe (gpe_number); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to disable GPE[%X]\n", gpe_number)); + return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } } /* - * No Handler? Report an error and leave the GPE disabled. + * It is now safe to clear level-triggered evnets. */ - else { - REPORT_ERROR (("Acpi_ev_gpe_dispatch: No installed handler for GPE [%X]\n", gpe_number)); - - /* Level-Triggered? */ - - if (gpe_info.type & ACPI_EVENT_LEVEL_TRIGGERED) { - acpi_hw_clear_gpe (gpe_number); + if (gpe_info->type & ACPI_EVENT_LEVEL_TRIGGERED) { + status = acpi_hw_clear_gpe (gpe_number); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to clear GPE[%X]\n", gpe_number)); + return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } } - return_VALUE (INTERRUPT_HANDLED); + return_VALUE (ACPI_INTERRUPT_HANDLED); } diff -urN linux-2.4.18/drivers/acpi/events/evmisc.c lia64-2.4/drivers/acpi/events/evmisc.c --- linux-2.4.18/drivers/acpi/events/evmisc.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/events/evmisc.c Tue Jun 11 14:24:22 2002 @@ -1,13 +1,12 @@ /****************************************************************************** * - * Module Name: evmisc - ACPI device notification handler dispatch - * and ACPI Global Lock support - * $Revision: 35 $ + * Module Name: evmisc - Miscellaneous event manager support functions + * $Revision: 53 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,10 +27,95 @@ #include "acevents.h" #include "acnamesp.h" #include "acinterp.h" -#include "achware.h" #define _COMPONENT ACPI_EVENTS - MODULE_NAME ("evmisc") + ACPI_MODULE_NAME ("evmisc") + + +/******************************************************************************* + * + * FUNCTION: Acpi_ev_is_notify_object + * + * PARAMETERS: Node - Node to check + * + * RETURN: TRUE if notifies allowed on this object + * + * DESCRIPTION: Check type of node for a object that supports notifies. + * + * TBD: This could be replaced by a flag bit in the node. + * + ******************************************************************************/ + +u8 +acpi_ev_is_notify_object ( + acpi_namespace_node *node) +{ + switch (node->type) { + case ACPI_TYPE_DEVICE: + case ACPI_TYPE_PROCESSOR: + case ACPI_TYPE_POWER: + case ACPI_TYPE_THERMAL: + /* + * These are the ONLY objects that can receive ACPI notifications + */ + return (TRUE); + + default: + return (FALSE); + } +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ev_get_gpe_register_index + * + * PARAMETERS: Gpe_number - Raw GPE number + * + * RETURN: None. + * + * DESCRIPTION: Returns the register index (index into the GPE register info + * table) associated with this GPE. + * + ******************************************************************************/ + +u32 +acpi_ev_get_gpe_register_index ( + u32 gpe_number) +{ + + if (gpe_number > acpi_gbl_gpe_number_max) { + return (ACPI_GPE_INVALID); + } + + return (ACPI_DIV_8 (acpi_gbl_gpe_number_to_index[gpe_number].number_index)); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ev_get_gpe_number_index + * + * PARAMETERS: Gpe_number - Raw GPE number + * + * RETURN: None. + * + * DESCRIPTION: Returns the number index (index into the GPE number info table) + * associated with this GPE. + * + ******************************************************************************/ + +u32 +acpi_ev_get_gpe_number_index ( + u32 gpe_number) +{ + + if (gpe_number > acpi_gbl_gpe_number_max) { + return (ACPI_GPE_INVALID); + } + + return (acpi_gbl_gpe_number_to_index[gpe_number].number_index); +} /******************************************************************************* @@ -58,7 +142,7 @@ acpi_status status = AE_OK; - PROC_NAME ("Ev_queue_notify_request"); + ACPI_FUNCTION_NAME ("Ev_queue_notify_request"); /* @@ -92,43 +176,38 @@ break; } - /* - * Get the notify object attached to the device Node + * Get the notify object attached to the NS Node */ obj_desc = acpi_ns_get_attached_object (node); if (obj_desc) { - /* We have the notify object, Get the right handler */ switch (node->type) { case ACPI_TYPE_DEVICE: - if (notify_value <= MAX_SYS_NOTIFY) { - handler_obj = obj_desc->device.sys_handler; - } - else { - handler_obj = obj_desc->device.drv_handler; - } - break; - case ACPI_TYPE_THERMAL: - if (notify_value <= MAX_SYS_NOTIFY) { - handler_obj = obj_desc->thermal_zone.sys_handler; + case ACPI_TYPE_PROCESSOR: + case ACPI_TYPE_POWER: + + if (notify_value <= ACPI_MAX_SYS_NOTIFY) { + handler_obj = obj_desc->common_notify.sys_handler; } else { - handler_obj = obj_desc->thermal_zone.drv_handler; + handler_obj = obj_desc->common_notify.drv_handler; } break; + + default: + /* All other types are not supported */ + return (AE_TYPE); } } - /* If there is any handler to run, schedule the dispatcher */ - if ((acpi_gbl_sys_notify.handler && (notify_value <= MAX_SYS_NOTIFY)) || - (acpi_gbl_drv_notify.handler && (notify_value > MAX_SYS_NOTIFY)) || + if ((acpi_gbl_sys_notify.handler && (notify_value <= ACPI_MAX_SYS_NOTIFY)) || + (acpi_gbl_drv_notify.handler && (notify_value > ACPI_MAX_SYS_NOTIFY)) || handler_obj) { - notify_info = acpi_ut_create_generic_state (); if (!notify_info) { return (AE_NO_MEMORY); @@ -169,7 +248,7 @@ * ******************************************************************************/ -void +void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch ( void *context) { @@ -179,14 +258,14 @@ acpi_operand_object *handler_obj; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* * We will invoke a global notify handler if installed. * This is done _before_ we invoke the per-device handler attached to the device. */ - if (notify_info->notify.value <= MAX_SYS_NOTIFY) { + if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) { /* Global system notification handler */ if (acpi_gbl_sys_notify.handler) { @@ -194,7 +273,6 @@ global_context = acpi_gbl_sys_notify.context; } } - else { /* Global driver notification handler */ @@ -204,7 +282,6 @@ } } - /* Invoke the system handler first, if present */ if (global_handler) { @@ -237,18 +314,23 @@ * ******************************************************************************/ -static void +static void ACPI_SYSTEM_XFACE acpi_ev_global_lock_thread ( void *context) { + acpi_status status; + /* Signal threads that are waiting for the lock */ if (acpi_gbl_global_lock_thread_count) { /* Send sufficient units to the semaphore */ - acpi_os_signal_semaphore (acpi_gbl_global_lock_semaphore, + status = acpi_os_signal_semaphore (acpi_gbl_global_lock_semaphore, acpi_gbl_global_lock_thread_count); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not signal Global Lock semaphore\n")); + } } } @@ -270,7 +352,7 @@ void *context) { u8 acquired = FALSE; - void *global_lock; + acpi_status status; /* @@ -278,8 +360,7 @@ * If we don't get it now, it will be marked pending and we will * take another interrupt when it becomes free. */ - global_lock = acpi_gbl_FACS->global_lock; - ACPI_ACQUIRE_GLOBAL_LOCK (global_lock, acquired); + ACPI_ACQUIRE_GLOBAL_LOCK (acpi_gbl_common_fACS.global_lock, acquired); if (acquired) { /* Got the lock, now wake all threads waiting for it */ @@ -287,11 +368,17 @@ /* Run the Global Lock thread which will signal all waiting threads */ - acpi_os_queue_for_execution (OSD_PRIORITY_HIGH, acpi_ev_global_lock_thread, - context); + status = acpi_os_queue_for_execution (OSD_PRIORITY_HIGH, + acpi_ev_global_lock_thread, context); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not queue Global Lock thread, %s\n", + acpi_format_exception (status))); + + return (ACPI_INTERRUPT_NOT_HANDLED); + } } - return (INTERRUPT_HANDLED); + return (ACPI_INTERRUPT_HANDLED); } @@ -311,7 +398,7 @@ acpi_status status; - FUNCTION_TRACE ("Ev_init_global_lock_handler"); + ACPI_FUNCTION_TRACE ("Ev_init_global_lock_handler"); acpi_gbl_global_lock_present = TRUE; @@ -320,7 +407,7 @@ /* * If the global lock does not exist on this platform, the attempt - * to enable GBL_STS will fail (the GBL_EN bit will not stick) + * to enable GBL_STATUS will fail (the GBL_ENABLE bit will not stick) * Map to AE_OK, but mark global lock as not present. * Any attempt to actually use the global lock will be flagged * with an error. @@ -345,14 +432,15 @@ *****************************************************************************/ acpi_status -acpi_ev_acquire_global_lock(void) +acpi_ev_acquire_global_lock ( + u32 timeout) { acpi_status status = AE_OK; u8 acquired = FALSE; - void *global_lock; - FUNCTION_TRACE ("Ev_acquire_global_lock"); + ACPI_FUNCTION_TRACE ("Ev_acquire_global_lock"); + /* Make sure that we actually have a global lock */ @@ -364,46 +452,36 @@ acpi_gbl_global_lock_thread_count++; - - /* If we (OS side) have the hardware lock already, we are done */ + /* If we (OS side vs. BIOS side) have the hardware lock already, we are done */ if (acpi_gbl_global_lock_acquired) { return_ACPI_STATUS (AE_OK); } - /* Only if the FACS is valid */ - - if (!acpi_gbl_FACS) { - return_ACPI_STATUS (AE_OK); - } - - /* We must acquire the actual hardware lock */ - global_lock = acpi_gbl_FACS->global_lock; - ACPI_ACQUIRE_GLOBAL_LOCK (global_lock, acquired); + ACPI_ACQUIRE_GLOBAL_LOCK (acpi_gbl_common_fACS.global_lock, acquired); if (acquired) { /* We got the lock */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Acquired the Global Lock\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Acquired the HW Global Lock\n")); acpi_gbl_global_lock_acquired = TRUE; return_ACPI_STATUS (AE_OK); } - /* * Did not get the lock. The pending bit was set above, and we must now * wait until we get the global lock released interrupt. */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Waiting for the HW Global Lock\n")); - /* - * Acquire the global lock semaphore first. - * Since this wait will block, we must release the interpreter - */ + /* + * Acquire the global lock semaphore first. + * Since this wait will block, we must release the interpreter + */ status = acpi_ex_system_wait_semaphore (acpi_gbl_global_lock_semaphore, - ACPI_UINT32_MAX); + timeout); return_ACPI_STATUS (status); } @@ -416,45 +494,86 @@ * ******************************************************************************/ -void +acpi_status acpi_ev_release_global_lock (void) { u8 pending = FALSE; - void *global_lock; + acpi_status status = AE_OK; - FUNCTION_TRACE ("Ev_release_global_lock"); + ACPI_FUNCTION_TRACE ("Ev_release_global_lock"); if (!acpi_gbl_global_lock_thread_count) { - REPORT_WARNING(("Global Lock has not be acquired, cannot release\n")); - return_VOID; + ACPI_REPORT_WARNING(("Cannot release HW Global Lock, it has not been acquired\n")); + return_ACPI_STATUS (AE_NOT_ACQUIRED); } - /* One fewer thread has the global lock */ + /* One fewer thread has the global lock */ acpi_gbl_global_lock_thread_count--; + if (acpi_gbl_global_lock_thread_count) { + /* There are still some threads holding the lock, cannot release */ - /* Have all threads released the lock? */ + return_ACPI_STATUS (AE_OK); + } - if (!acpi_gbl_global_lock_thread_count) { - /* - * No more threads holding lock, we can do the actual hardware - * release - */ - global_lock = acpi_gbl_FACS->global_lock; - ACPI_RELEASE_GLOBAL_LOCK (global_lock, pending); - acpi_gbl_global_lock_acquired = FALSE; + /* + * No more threads holding lock, we can do the actual hardware + * release + */ + ACPI_RELEASE_GLOBAL_LOCK (acpi_gbl_common_fACS.global_lock, pending); + acpi_gbl_global_lock_acquired = FALSE; - /* - * If the pending bit was set, we must write GBL_RLS to the control - * register - */ - if (pending) { - acpi_hw_register_bit_access (ACPI_WRITE, ACPI_MTX_LOCK, - GBL_RLS, 1); - } + /* + * If the pending bit was set, we must write GBL_RLS to the control + * register + */ + if (pending) { + status = acpi_set_register (ACPI_BITREG_GLOBAL_LOCK_RELEASE, 1, ACPI_MTX_LOCK); + } + + return_ACPI_STATUS (status); +} + + +/****************************************************************************** + * + * FUNCTION: Acpi_ev_terminate + * + * PARAMETERS: none + * + * RETURN: none + * + * DESCRIPTION: free memory allocated for table storage. + * + ******************************************************************************/ + +void +acpi_ev_terminate (void) +{ + + ACPI_FUNCTION_TRACE ("Ev_terminate"); + + + /* + * Free global tables, etc. + */ + if (acpi_gbl_gpe_register_info) { + ACPI_MEM_FREE (acpi_gbl_gpe_register_info); + acpi_gbl_gpe_register_info = NULL; + } + + if (acpi_gbl_gpe_number_info) { + ACPI_MEM_FREE (acpi_gbl_gpe_number_info); + acpi_gbl_gpe_number_info = NULL; + } + + if (acpi_gbl_gpe_number_to_index) { + ACPI_MEM_FREE (acpi_gbl_gpe_number_to_index); + acpi_gbl_gpe_number_to_index = NULL; } return_VOID; } + diff -urN linux-2.4.18/drivers/acpi/events/evregion.c lia64-2.4/drivers/acpi/events/evregion.c --- linux-2.4.18/drivers/acpi/events/evregion.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/events/evregion.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: evregion - ACPI Address_space (Op_region) handler dispatch - * $Revision: 113 $ + * $Revision: 133 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,15 +28,14 @@ #include "acevents.h" #include "acnamesp.h" #include "acinterp.h" -#include "amlcode.h" #define _COMPONENT ACPI_EVENTS - MODULE_NAME ("evregion") + ACPI_MODULE_NAME ("evregion") /******************************************************************************* * - * FUNCTION: Acpi_ev_install_default_address_space_handlers + * FUNCTION: Acpi_ev_init_address_spaces * * PARAMETERS: * @@ -47,13 +46,13 @@ ******************************************************************************/ acpi_status -acpi_ev_install_default_address_space_handlers ( +acpi_ev_init_address_spaces ( void) { acpi_status status; - FUNCTION_TRACE ("Ev_install_default_address_space_handlers"); + ACPI_FUNCTION_TRACE ("Ev_init_address_spaces"); /* @@ -68,40 +67,46 @@ * space must be always available -- even though we are nowhere * near ready to find the PCI root buses at this point. * - * NOTE: We ignore AE_EXIST because this means that a handler has - * already been installed (via Acpi_install_address_space_handler) + * NOTE: We ignore AE_ALREADY_EXISTS because this means that a handler + * has already been installed (via Acpi_install_address_space_handler) */ - status = acpi_install_address_space_handler (acpi_gbl_root_node, + + status = acpi_install_address_space_handler ((acpi_handle) acpi_gbl_root_node, ACPI_ADR_SPACE_SYSTEM_MEMORY, ACPI_DEFAULT_HANDLER, NULL, NULL); if ((ACPI_FAILURE (status)) && - (status != AE_EXIST)) { + (status != AE_ALREADY_EXISTS)) { return_ACPI_STATUS (status); } - status = acpi_install_address_space_handler (acpi_gbl_root_node, + status = acpi_install_address_space_handler ((acpi_handle) acpi_gbl_root_node, ACPI_ADR_SPACE_SYSTEM_IO, ACPI_DEFAULT_HANDLER, NULL, NULL); if ((ACPI_FAILURE (status)) && - (status != AE_EXIST)) { + (status != AE_ALREADY_EXISTS)) { return_ACPI_STATUS (status); } - status = acpi_install_address_space_handler (acpi_gbl_root_node, + status = acpi_install_address_space_handler ((acpi_handle) acpi_gbl_root_node, ACPI_ADR_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL); if ((ACPI_FAILURE (status)) && - (status != AE_EXIST)) { + (status != AE_ALREADY_EXISTS)) { return_ACPI_STATUS (status); } + status = acpi_install_address_space_handler ((acpi_handle) acpi_gbl_root_node, + ACPI_ADR_SPACE_DATA_TABLE, + ACPI_DEFAULT_HANDLER, NULL, NULL); + if ((ACPI_FAILURE (status)) && + (status != AE_ALREADY_EXISTS)) { + return_ACPI_STATUS (status); + } return_ACPI_STATUS (AE_OK); } -/* TBD: [Restructure] Move elsewhere */ - /******************************************************************************* * * FUNCTION: Acpi_ev_execute_reg_method @@ -121,13 +126,19 @@ u32 function) { acpi_operand_object *params[3]; + acpi_operand_object *region_obj2; acpi_status status; - FUNCTION_TRACE ("Ev_execute_reg_method"); + ACPI_FUNCTION_TRACE ("Ev_execute_reg_method"); - if (region_obj->region.extra->extra.method_REG == NULL) { + region_obj2 = acpi_ns_get_secondary_object (region_obj); + if (!region_obj2) { + return_ACPI_STATUS (AE_NOT_EXIST); + } + + if (region_obj2->extra.method_REG == NULL) { return_ACPI_STATUS (AE_OK); } @@ -154,15 +165,15 @@ /* * Set up the parameter objects */ - params[0]->integer.value = region_obj->region.space_id; + params[0]->integer.value = region_obj->region.space_id; params[1]->integer.value = function; params[2] = NULL; /* * Execute the method, no return value */ - DEBUG_EXEC(acpi_ut_display_init_pathname (region_obj->region.extra->extra.method_REG, " [Method]")); - status = acpi_ns_evaluate_by_handle (region_obj->region.extra->extra.method_REG, params, NULL); + ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (region_obj2->extra.method_REG, " [Method]")); + status = acpi_ns_evaluate_by_handle (region_obj2->extra.method_REG, params, NULL); acpi_ut_remove_reference (params[1]); @@ -181,7 +192,7 @@ * Space_id - ID of the address space (0-255) * Function - Read or Write operation * Address - Where in the space to read or write - * Bit_width - Field width in bits (8, 16, or 32) + * Bit_width - Field width in bits (8, 16, 32, or 64) * Value - Pointer to in or out value * * RETURN: Status @@ -197,18 +208,25 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value) + void *value) { acpi_status status; + acpi_status status2; acpi_adr_space_handler handler; acpi_adr_space_setup region_setup; acpi_operand_object *handler_desc; + acpi_operand_object *region_obj2; void *region_context = NULL; - FUNCTION_TRACE ("Ev_address_space_dispatch"); + ACPI_FUNCTION_TRACE ("Ev_address_space_dispatch"); + region_obj2 = acpi_ns_get_secondary_object (region_obj); + if (!region_obj2) { + return_ACPI_STATUS (AE_NOT_EXIST); + } + /* * Ensure that there is a handler associated with this region */ @@ -217,14 +235,14 @@ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "no handler for region(%p) [%s]\n", region_obj, acpi_ut_get_region_name (region_obj->region.space_id))); - return_ACPI_STATUS(AE_NOT_EXIST); + return_ACPI_STATUS (AE_NOT_EXIST); } /* * It may be the case that the region has never been initialized * Some types of regions require special init code */ - if (!(region_obj->region.flags & AOPOBJ_INITIALIZED)) { + if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) { /* * This region has not been initialized yet, do it */ @@ -249,7 +267,10 @@ /* Re-enter the interpreter */ - acpi_ex_enter_interpreter (); + status2 = acpi_ex_enter_interpreter (); + if (ACPI_FAILURE (status2)) { + return_ACPI_STATUS (status2); + } /* * Init routine may fail @@ -258,16 +279,16 @@ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region Init: %s [%s]\n", acpi_format_exception (status), acpi_ut_get_region_name (region_obj->region.space_id))); - return_ACPI_STATUS(status); + return_ACPI_STATUS (status); } - region_obj->region.flags |= AOPOBJ_INITIALIZED; + region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE; /* * Save the returned context for use in all accesses to * this particular region. */ - region_obj->region.extra->extra.region_context = region_context; + region_obj2->extra.region_context = region_context; } /* @@ -277,10 +298,10 @@ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Addrhandler %p (%p), Address %8.8X%8.8X\n", - ®ion_obj->region.addr_handler->addr_handler, handler, HIDWORD(address), - LODWORD(address))); + ®ion_obj->region.addr_handler->addr_handler, handler, + ACPI_HIDWORD (address), ACPI_LODWORD (address))); - if (!(handler_desc->addr_handler.flags & ADDR_HANDLER_DEFAULT_INSTALLED)) { + if (!(handler_desc->addr_handler.flags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) { /* * For handlers other than the default (supplied) handlers, we must * exit the interpreter because the handler *might* block -- we don't @@ -294,20 +315,23 @@ */ status = handler (function, address, bit_width, value, handler_desc->addr_handler.context, - region_obj->region.extra->extra.region_context); + region_obj2->extra.region_context); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region handler: %s [%s]\n", - acpi_format_exception (status), - acpi_ut_get_region_name (region_obj->region.space_id))); + ACPI_REPORT_ERROR (("Handler for [%s] returned %s\n", + acpi_ut_get_region_name (region_obj->region.space_id), + acpi_format_exception (status))); } - if (!(handler_desc->addr_handler.flags & ADDR_HANDLER_DEFAULT_INSTALLED)) { + if (!(handler_desc->addr_handler.flags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) { /* * We just returned from a non-default handler, we must re-enter the * interpreter */ - acpi_ex_enter_interpreter (); + status2 = acpi_ex_enter_interpreter (); + if (ACPI_FAILURE (status2)) { + return_ACPI_STATUS (status2); + } } return_ACPI_STATUS (status); @@ -315,7 +339,7 @@ /******************************************************************************* * - * FUNCTION: Acpi_ev_disassociate_region_from_handler + * FUNCTION: Acpi_ev_detach_region * * PARAMETERS: Region_obj - Region Object * Acpi_ns_is_locked - Namespace Region Already Locked? @@ -328,7 +352,7 @@ ******************************************************************************/ void -acpi_ev_disassociate_region_from_handler( +acpi_ev_detach_region( acpi_operand_object *region_obj, u8 acpi_ns_is_locked) { @@ -337,13 +361,18 @@ acpi_operand_object **last_obj_ptr; acpi_adr_space_setup region_setup; void *region_context; + acpi_operand_object *region_obj2; acpi_status status; - FUNCTION_TRACE ("Ev_disassociate_region_from_handler"); + ACPI_FUNCTION_TRACE ("Ev_detach_region"); - region_context = region_obj->region.extra->extra.region_context; + region_obj2 = acpi_ns_get_secondary_object (region_obj); + if (!region_obj2) { + return_VOID; + } + region_context = region_obj2->extra.region_context; /* * Get the address handler from the region object @@ -378,16 +407,27 @@ obj_desc->region.next = NULL; /* Must clear field */ if (acpi_ns_is_locked) { - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_VOID; + } } /* * Now stop region accesses by executing the _REG method */ - acpi_ev_execute_reg_method (region_obj, 0); + status = acpi_ev_execute_reg_method (region_obj, 0); + if (ACPI_FAILURE (status)) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s from region _REG, [%s]\n", + acpi_format_exception (status), + acpi_ut_get_region_name (region_obj->region.space_id))); + } if (acpi_ns_is_locked) { - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_VOID; + } } /* @@ -406,7 +446,7 @@ acpi_ut_get_region_name (region_obj->region.space_id))); } - region_obj->region.flags &= ~(AOPOBJ_INITIALIZED); + region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE); /* * Remove handler reference in the region @@ -444,7 +484,7 @@ /******************************************************************************* * - * FUNCTION: Acpi_ev_associate_region_and_handler + * FUNCTION: Acpi_ev_attach_region * * PARAMETERS: Handler_obj - Handler Object * Region_obj - Region Object @@ -458,15 +498,16 @@ ******************************************************************************/ acpi_status -acpi_ev_associate_region_and_handler ( +acpi_ev_attach_region ( acpi_operand_object *handler_obj, acpi_operand_object *region_obj, u8 acpi_ns_is_locked) { - acpi_status status; + acpi_status status; + acpi_status status2; - FUNCTION_TRACE ("Ev_associate_region_and_handler"); + ACPI_FUNCTION_TRACE ("Ev_attach_region"); ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, @@ -475,27 +516,34 @@ /* - * Link this region to the front of the handler's list + * Link this region to the front of the handler's list */ region_obj->region.next = handler_obj->addr_handler.region_list; handler_obj->addr_handler.region_list = region_obj; /* - * set the region's handler + * Set the region's handler */ region_obj->region.addr_handler = handler_obj; /* - * Last thing, tell all users that this region is usable + * Tell all users that this region is usable by running the _REG + * method */ if (acpi_ns_is_locked) { - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + status2 = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status2)) { + return_ACPI_STATUS (status2); + } } status = acpi_ev_execute_reg_method (region_obj, 1); if (acpi_ns_is_locked) { - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status2 = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status2)) { + return_ACPI_STATUS (status2); + } } return_ACPI_STATUS (status); @@ -510,8 +558,8 @@ * Level - Nesting level of the handle * Context - Passed into Acpi_ns_walk_namespace * - * DESCRIPTION: This routine checks to see if the object is a Region if it - * is then the address handler is installed in it. + * DESCRIPTION: This routine installs an address handler into objects that are + * of type Region. * * If the Object is a Device, and the device has a handler of * the same type then the search is terminated in that branch. @@ -535,7 +583,7 @@ acpi_status status; - PROC_NAME ("Ev_addr_handler_helper"); + ACPI_FUNCTION_NAME ("Ev_addr_handler_helper"); handler_obj = (acpi_operand_object *) context; @@ -576,7 +624,7 @@ /* * Devices are handled different than regions */ - if (IS_THIS_OBJECT_TYPE (obj_desc, ACPI_TYPE_DEVICE)) { + if (obj_desc->common.type == ACPI_TYPE_DEVICE) { /* * See if this guy has any handlers */ @@ -635,12 +683,12 @@ * * First disconnect region for any previous handler (if any) */ - acpi_ev_disassociate_region_from_handler (obj_desc, FALSE); + acpi_ev_detach_region (obj_desc, FALSE); /* * Then connect the region to the new handler */ - status = acpi_ev_associate_region_and_handler (handler_obj, obj_desc, FALSE); + status = acpi_ev_attach_region (handler_obj, obj_desc, FALSE); return (status); } diff -urN linux-2.4.18/drivers/acpi/events/evrgnini.c lia64-2.4/drivers/acpi/events/evrgnini.c --- linux-2.4.18/drivers/acpi/events/evrgnini.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/events/evrgnini.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: evrgnini- ACPI Address_space (Op_region) init - * $Revision: 48 $ + * $Revision: 61 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,11 +27,9 @@ #include "acpi.h" #include "acevents.h" #include "acnamesp.h" -#include "acinterp.h" -#include "amlcode.h" #define _COMPONENT ACPI_EVENTS - MODULE_NAME ("evrgnini") + ACPI_MODULE_NAME ("evrgnini") /******************************************************************************* @@ -56,7 +54,10 @@ void *handler_context, void **region_context) { - FUNCTION_TRACE ("Ev_system_memory_region_setup"); + acpi_operand_object *region_desc = (acpi_operand_object *) handle; + acpi_mem_space_context *local_region_context; + + ACPI_FUNCTION_TRACE ("Ev_system_memory_region_setup"); if (function == ACPI_REGION_DEACTIVATE) { @@ -70,11 +71,17 @@ /* Activate. Create a new context */ - *region_context = ACPI_MEM_CALLOCATE (sizeof (acpi_mem_space_context)); - if (!(*region_context)) { + local_region_context = ACPI_MEM_CALLOCATE (sizeof (acpi_mem_space_context)); + if (!(local_region_context)) { return_ACPI_STATUS (AE_NO_MEMORY); } + /* Save the region length and address for use in the handler */ + + local_region_context->length = region_desc->region.length; + local_region_context->address = region_desc->region.address; + + *region_context = local_region_context; return_ACPI_STATUS (AE_OK); } @@ -101,7 +108,7 @@ void *handler_context, void **region_context) { - FUNCTION_TRACE ("Ev_io_space_region_setup"); + ACPI_FUNCTION_TRACE ("Ev_io_space_region_setup"); if (function == ACPI_REGION_DEACTIVATE) { @@ -148,7 +155,7 @@ acpi_device_id object_hID; - FUNCTION_TRACE ("Ev_pci_config_region_setup"); + ACPI_FUNCTION_TRACE ("Ev_pci_config_region_setup"); handler_obj = region_obj->region.addr_handler; @@ -188,7 +195,7 @@ * First get device and function numbers from the _ADR object * in the parent's scope. */ - node = acpi_ns_get_parent_object (region_obj->region.node); + node = acpi_ns_get_parent_node (region_obj->region.node); /* Acpi_evaluate the _ADR object */ @@ -196,12 +203,12 @@ status = acpi_ut_evaluate_numeric_object (METHOD_NAME__ADR, node, &temp); /* - * The default is zero, since the allocation above zeroed the data, just - * do nothing on failures. + * The default is zero, and since the allocation above zeroed + * the data, just do nothing on failure. */ if (ACPI_SUCCESS (status)) { - pci_id->device = HIWORD (temp); - pci_id->function = LOWORD (temp); + pci_id->device = ACPI_HIWORD (ACPI_LODWORD (temp)); + pci_id->function = ACPI_LOWORD (ACPI_LODWORD (temp)); } /* @@ -224,16 +231,20 @@ while (node != acpi_gbl_root_node) { status = acpi_ut_execute_HID (node, &object_hID); if (ACPI_SUCCESS (status)) { - if (!(STRNCMP (object_hID.buffer, PCI_ROOT_HID_STRING, + if (!(ACPI_STRNCMP (object_hID.buffer, PCI_ROOT_HID_STRING, sizeof (PCI_ROOT_HID_STRING)))) { - acpi_install_address_space_handler (node, + status = acpi_install_address_space_handler ((acpi_handle) node, ACPI_ADR_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not install handler for %4.4s, %s\n", + node->name.ascii, acpi_format_exception (status))); + } break; } } - node = acpi_ns_get_parent_object (node); + node = acpi_ns_get_parent_node (node); } } else { @@ -245,7 +256,7 @@ */ status = acpi_ut_evaluate_numeric_object (METHOD_NAME__SEG, node, &temp); if (ACPI_SUCCESS (status)) { - pci_id->segment = LOWORD (temp); + pci_id->segment = ACPI_LOWORD (temp); } /* @@ -253,7 +264,7 @@ */ status = acpi_ut_evaluate_numeric_object (METHOD_NAME__BBN, node, &temp); if (ACPI_SUCCESS (status)) { - pci_id->bus = LOWORD (temp); + pci_id->bus = ACPI_LOWORD (temp); } *region_context = pci_id; @@ -286,7 +297,7 @@ void **region_context) { - FUNCTION_TRACE ("Ev_pci_bar_region_setup"); + ACPI_FUNCTION_TRACE ("Ev_pci_bar_region_setup"); return_ACPI_STATUS (AE_OK); @@ -318,7 +329,7 @@ void **region_context) { - FUNCTION_TRACE ("Ev_cmos_region_setup"); + ACPI_FUNCTION_TRACE ("Ev_cmos_region_setup"); return_ACPI_STATUS (AE_OK); @@ -347,7 +358,7 @@ void *handler_context, void **region_context) { - FUNCTION_TRACE ("Ev_default_region_setup"); + ACPI_FUNCTION_TRACE ("Ev_default_region_setup"); if (function == ACPI_REGION_DEACTIVATE) { @@ -394,21 +405,33 @@ acpi_status status; acpi_namespace_node *method_node; acpi_name *reg_name_ptr = (acpi_name *) METHOD_NAME__REG; + acpi_operand_object *region_obj2; - FUNCTION_TRACE_U32 ("Ev_initialize_region", acpi_ns_locked); + ACPI_FUNCTION_TRACE_U32 ("Ev_initialize_region", acpi_ns_locked); if (!region_obj) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - node = acpi_ns_get_parent_object (region_obj->region.node); + if (region_obj->common.flags & AOPOBJ_OBJECT_INITIALIZED) { + return_ACPI_STATUS (AE_OK); + } + + region_obj2 = acpi_ns_get_secondary_object (region_obj); + if (!region_obj2) { + return_ACPI_STATUS (AE_NOT_EXIST); + } + node = acpi_ns_get_parent_node (region_obj->region.node); + + space_id = region_obj->region.space_id; region_obj->region.addr_handler = NULL; - region_obj->region.extra->extra.method_REG = NULL; - region_obj->region.flags &= ~(AOPOBJ_INITIALIZED); + region_obj2->extra.method_REG = NULL; + region_obj->common.flags &= ~(AOPOBJ_SETUP_COMPLETE); + region_obj->common.flags |= AOPOBJ_OBJECT_INITIALIZED; /* * Find any "_REG" associated with this region definition @@ -421,7 +444,7 @@ * definition. This will be executed when the handler is attached * or removed */ - region_obj->region.extra->extra.method_REG = method_node; + region_obj2->extra.method_REG = method_node; } /* @@ -436,7 +459,7 @@ obj_desc = acpi_ns_get_attached_object (node); if (obj_desc) { /* - * can only be a handler if the object exists + * Can only be a handler if the object exists */ switch (node->type) { case ACPI_TYPE_DEVICE: @@ -453,6 +476,10 @@ handler_obj = obj_desc->thermal_zone.addr_handler; break; + + default: + /* Ignore other objects */ + break; } while (handler_obj) { @@ -468,8 +495,9 @@ /* * Found it! Now update the region and the handler */ - acpi_ev_associate_region_and_handler (handler_obj, region_obj, - acpi_ns_locked); + status = acpi_ev_attach_region (handler_obj, region_obj, + acpi_ns_locked); + return_ACPI_STATUS (AE_OK); } @@ -482,7 +510,7 @@ * This one does not have the handler we need * Pop up one level */ - node = acpi_ns_get_parent_object (node); + node = acpi_ns_get_parent_node (node); } /* while Node != ROOT */ diff -urN linux-2.4.18/drivers/acpi/events/evsci.c lia64-2.4/drivers/acpi/events/evsci.c --- linux-2.4.18/drivers/acpi/events/evsci.c Mon Sep 24 15:06:40 2001 +++ lia64-2.4/drivers/acpi/events/evsci.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ * * Module Name: evsci - System Control Interrupt configuration and * legacy to ACPI mode state transition functions - * $Revision: 74 $ + * $Revision: 86 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,23 +25,11 @@ */ #include "acpi.h" -#include "acnamesp.h" -#include "achware.h" #include "acevents.h" #define _COMPONENT ACPI_EVENTS - MODULE_NAME ("evsci") - - -/* - * Elements correspond to counts for TMR, NOT_USED, GBL, PWR_BTN, SLP_BTN, RTC, - * and GENERAL respectively. These counts are modified by the ACPI interrupt - * handler. - * - * TBD: [Investigate] Note that GENERAL should probably be split out into - * one element for each bit in the GPE registers - */ + ACPI_MODULE_NAME ("evsci") /******************************************************************************* @@ -58,23 +46,31 @@ * ******************************************************************************/ -static u32 -acpi_ev_sci_handler (void *context) +static u32 ACPI_SYSTEM_XFACE +acpi_ev_sci_handler ( + void *context) { - u32 interrupt_handled = INTERRUPT_NOT_HANDLED; + u32 interrupt_handled = ACPI_INTERRUPT_NOT_HANDLED; + u32 value; + acpi_status status; - FUNCTION_TRACE("Ev_sci_handler"); + ACPI_FUNCTION_TRACE("Ev_sci_handler"); /* * Make sure that ACPI is enabled by checking SCI_EN. Note that we are * required to treat the SCI interrupt as sharable, level, active low. */ - if (!acpi_hw_register_bit_access (ACPI_READ, ACPI_MTX_DO_NOT_LOCK, SCI_EN)) { + status = acpi_get_register (ACPI_BITREG_SCI_ENABLE, &value, ACPI_MTX_DO_NOT_LOCK); + if (ACPI_FAILURE (status)) { + return (ACPI_INTERRUPT_NOT_HANDLED); + } + + if (!value) { /* ACPI is not enabled; this interrupt cannot be for us */ - return_VALUE (INTERRUPT_NOT_HANDLED); + return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } /* @@ -113,7 +109,7 @@ u32 status = AE_OK; - FUNCTION_TRACE ("Ev_install_sci_handler"); + ACPI_FUNCTION_TRACE ("Ev_install_sci_handler"); status = acpi_os_install_interrupt_handler ((u32) acpi_gbl_FADT->sci_int, @@ -123,7 +119,6 @@ /****************************************************************************** - * * FUNCTION: Acpi_ev_remove_sci_handler * @@ -132,151 +127,31 @@ * RETURN: E_OK if handler uninstalled OK, E_ERROR if handler was not * installed to begin with * - * DESCRIPTION: Restores original status of all fixed event enable bits and - * removes SCI handler. + * DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be + * taken. + * + * Note: It doesn't seem important to disable all events or set the event + * enable registers to their original values. The OS should disable + * the SCI interrupt level when the handler is removed, so no more + * events will come in. * ******************************************************************************/ acpi_status acpi_ev_remove_sci_handler (void) { - FUNCTION_TRACE ("Ev_remove_sci_handler"); + acpi_status status; -#if 0 - /* TBD:[Investigate] Figure this out!! Disable all events first ??? */ - - if (original_fixed_enable_bit_status ^ 1 << acpi_event_index (TMR_FIXED_EVENT)) { - acpi_event_disable_event (TMR_FIXED_EVENT); - } - - if (original_fixed_enable_bit_status ^ 1 << acpi_event_index (GBL_FIXED_EVENT)) { - acpi_event_disable_event (GBL_FIXED_EVENT); - } - - if (original_fixed_enable_bit_status ^ 1 << acpi_event_index (PWR_BTN_FIXED_EVENT)) { - acpi_event_disable_event (PWR_BTN_FIXED_EVENT); - } - - if (original_fixed_enable_bit_status ^ 1 << acpi_event_index (SLP_BTN_FIXED_EVENT)) { - acpi_event_disable_event (SLP_BTN_FIXED_EVENT); - } - - if (original_fixed_enable_bit_status ^ 1 << acpi_event_index (RTC_FIXED_EVENT)) { - acpi_event_disable_event (RTC_FIXED_EVENT); - } + ACPI_FUNCTION_TRACE ("Ev_remove_sci_handler"); - original_fixed_enable_bit_status = 0; -#endif + /* Just let the OS remove the handler and disable the level */ - acpi_os_remove_interrupt_handler ((u32) acpi_gbl_FADT->sci_int, + status = acpi_os_remove_interrupt_handler ((u32) acpi_gbl_FADT->sci_int, acpi_ev_sci_handler); - return_ACPI_STATUS (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_ev_restore_acpi_state - * - * PARAMETERS: none - * - * RETURN: none - * - * DESCRIPTION: Restore the original ACPI state of the machine - * - ******************************************************************************/ - -void -acpi_ev_restore_acpi_state (void) -{ - u32 index; - - - FUNCTION_TRACE ("Ev_restore_acpi_state"); - - - /* Restore the state of the chipset enable bits. */ - - if (acpi_gbl_restore_acpi_chipset == TRUE) { - /* Restore the fixed events */ - - if (acpi_hw_register_read (ACPI_MTX_LOCK, PM1_EN) != - acpi_gbl_pm1_enable_register_save) { - acpi_hw_register_write (ACPI_MTX_LOCK, PM1_EN, - acpi_gbl_pm1_enable_register_save); - } - - - /* Ensure that all status bits are clear */ - - acpi_hw_clear_acpi_status (); - - - /* Now restore the GPEs */ - - for (index = 0; index < DIV_2 (acpi_gbl_FADT->gpe0blk_len); index++) { - if (acpi_hw_register_read (ACPI_MTX_LOCK, GPE0_EN_BLOCK | index) != - acpi_gbl_gpe0enable_register_save[index]) { - acpi_hw_register_write (ACPI_MTX_LOCK, GPE0_EN_BLOCK | index, - acpi_gbl_gpe0enable_register_save[index]); - } - } - - /* GPE 1 present? */ - - if (acpi_gbl_FADT->gpe1_blk_len) { - for (index = 0; index < DIV_2 (acpi_gbl_FADT->gpe1_blk_len); index++) { - if (acpi_hw_register_read (ACPI_MTX_LOCK, GPE1_EN_BLOCK | index) != - acpi_gbl_gpe1_enable_register_save[index]) { - acpi_hw_register_write (ACPI_MTX_LOCK, GPE1_EN_BLOCK | index, - acpi_gbl_gpe1_enable_register_save[index]); - } - } - } - - if (acpi_hw_get_mode() != acpi_gbl_original_mode) { - acpi_hw_set_mode (acpi_gbl_original_mode); - } - } - - return_VOID; -} - - -/****************************************************************************** - * - * FUNCTION: Acpi_ev_terminate - * - * PARAMETERS: none - * - * RETURN: none - * - * DESCRIPTION: free memory allocated for table storage. - * - ******************************************************************************/ - -void -acpi_ev_terminate (void) -{ - - FUNCTION_TRACE ("Ev_terminate"); - - - /* - * Free global tables, etc. - */ - if (acpi_gbl_gpe_registers) { - ACPI_MEM_FREE (acpi_gbl_gpe_registers); - } - - if (acpi_gbl_gpe_info) { - ACPI_MEM_FREE (acpi_gbl_gpe_info); - } - - return_VOID; + return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/events/evxface.c lia64-2.4/drivers/acpi/events/evxface.c --- linux-2.4.18/drivers/acpi/events/evxface.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/events/evxface.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: evxface - External interfaces for ACPI events - * $Revision: 116 $ + * $Revision: 128 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,14 +25,12 @@ #include "acpi.h" -#include "achware.h" #include "acnamesp.h" #include "acevents.h" -#include "amlcode.h" #include "acinterp.h" #define _COMPONENT ACPI_EVENTS - MODULE_NAME ("evxface") + ACPI_MODULE_NAME ("evxface") /******************************************************************************* @@ -60,7 +58,7 @@ acpi_status status; - FUNCTION_TRACE ("Acpi_install_fixed_event_handler"); + ACPI_FUNCTION_TRACE ("Acpi_install_fixed_event_handler"); /* Parameter validation */ @@ -69,12 +67,15 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } - acpi_ut_acquire_mutex (ACPI_MTX_EVENTS); + status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* Don't allow two handlers. */ if (NULL != acpi_gbl_fixed_event_handlers[event].handler) { - status = AE_EXIST; + status = AE_ALREADY_EXISTS; goto cleanup; } @@ -85,7 +86,7 @@ acpi_gbl_fixed_event_handlers[event].context = context; status = acpi_enable_event (event, ACPI_EVENT_FIXED, 0); - if (!ACPI_SUCCESS (status)) { + if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Could not enable fixed event.\n")); /* Remove the handler */ @@ -93,7 +94,6 @@ acpi_gbl_fixed_event_handlers[event].handler = NULL; acpi_gbl_fixed_event_handlers[event].context = NULL; } - else { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Enabled fixed event %X, Handler=%p\n", event, handler)); @@ -101,7 +101,7 @@ cleanup: - acpi_ut_release_mutex (ACPI_MTX_EVENTS); + (void) acpi_ut_release_mutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (status); } @@ -127,7 +127,7 @@ acpi_status status = AE_OK; - FUNCTION_TRACE ("Acpi_remove_fixed_event_handler"); + ACPI_FUNCTION_TRACE ("Acpi_remove_fixed_event_handler"); /* Parameter validation */ @@ -136,7 +136,10 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } - acpi_ut_acquire_mutex (ACPI_MTX_EVENTS); + status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* Disable the event before removing the handler */ @@ -147,7 +150,7 @@ acpi_gbl_fixed_event_handlers[event].handler = NULL; acpi_gbl_fixed_event_handlers[event].context = NULL; - if (!ACPI_SUCCESS (status)) { + if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Could not write to fixed event enable register.\n")); } @@ -155,7 +158,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Disabled fixed event %X.\n", event)); } - acpi_ut_release_mutex (ACPI_MTX_EVENTS); + (void) acpi_ut_release_mutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (status); } @@ -186,26 +189,30 @@ { acpi_operand_object *obj_desc; acpi_operand_object *notify_obj; - acpi_namespace_node *device_node; - acpi_status status = AE_OK; + acpi_namespace_node *node; + acpi_status status; - FUNCTION_TRACE ("Acpi_install_notify_handler"); + ACPI_FUNCTION_TRACE ("Acpi_install_notify_handler"); /* Parameter validation */ - if ((!handler) || + if ((!device) || + (!handler) || (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* Convert and validate the device handle */ - device_node = acpi_ns_map_handle_to_node (device); - if (!device_node) { + node = acpi_ns_map_handle_to_node (device); + if (!node) { status = AE_BAD_PARAMETER; goto unlock_and_exit; } @@ -223,17 +230,17 @@ acpi_gbl_sys_notify.handler) || ((handler_type == ACPI_DEVICE_NOTIFY) && acpi_gbl_drv_notify.handler)) { - status = AE_EXIST; + status = AE_ALREADY_EXISTS; goto unlock_and_exit; } if (handler_type == ACPI_SYSTEM_NOTIFY) { - acpi_gbl_sys_notify.node = device_node; + acpi_gbl_sys_notify.node = node; acpi_gbl_sys_notify.handler = handler; acpi_gbl_sys_notify.context = context; } else /* ACPI_DEVICE_NOTIFY */ { - acpi_gbl_drv_notify.node = device_node; + acpi_gbl_drv_notify.node = node; acpi_gbl_drv_notify.handler = handler; acpi_gbl_drv_notify.context = context; } @@ -247,37 +254,32 @@ * Note that only certain object types can receive notifications. */ else { - /* - * These are the ONLY objects that can receive ACPI notifications - */ - if ((device_node->type != ACPI_TYPE_DEVICE) && - (device_node->type != ACPI_TYPE_PROCESSOR) && - (device_node->type != ACPI_TYPE_POWER) && - (device_node->type != ACPI_TYPE_THERMAL)) { - status = AE_BAD_PARAMETER; + /* Notifies allowed on this object? */ + + if (!acpi_ev_is_notify_object (node)) { + status = AE_TYPE; goto unlock_and_exit; } /* Check for an existing internal object */ - obj_desc = acpi_ns_get_attached_object (device_node); + obj_desc = acpi_ns_get_attached_object (node); if (obj_desc) { /* Object exists - make sure there's no handler */ if (((handler_type == ACPI_SYSTEM_NOTIFY) && - obj_desc->device.sys_handler) || + obj_desc->common_notify.sys_handler) || ((handler_type == ACPI_DEVICE_NOTIFY) && - obj_desc->device.drv_handler)) { - status = AE_EXIST; + obj_desc->common_notify.drv_handler)) { + status = AE_ALREADY_EXISTS; goto unlock_and_exit; } } - else { /* Create a new object */ - obj_desc = acpi_ut_create_internal_object (device_node->type); + obj_desc = acpi_ut_create_internal_object (node->type); if (!obj_desc) { status = AE_NO_MEMORY; goto unlock_and_exit; @@ -285,7 +287,7 @@ /* Attach new object to the Node */ - status = acpi_ns_attach_object (device, obj_desc, (u8) device_node->type); + status = acpi_ns_attach_object (device, obj_desc, node->type); if (ACPI_FAILURE (status)) { goto unlock_and_exit; } @@ -299,23 +301,21 @@ goto unlock_and_exit; } - notify_obj->notify_handler.node = device_node; + notify_obj->notify_handler.node = node; notify_obj->notify_handler.handler = handler; notify_obj->notify_handler.context = context; - if (handler_type == ACPI_SYSTEM_NOTIFY) { - obj_desc->device.sys_handler = notify_obj; + obj_desc->common_notify.sys_handler = notify_obj; } - else /* ACPI_DEVICE_NOTIFY */ { - obj_desc->device.drv_handler = notify_obj; + obj_desc->common_notify.drv_handler = notify_obj; } } unlock_and_exit: - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } @@ -343,26 +343,30 @@ { acpi_operand_object *notify_obj; acpi_operand_object *obj_desc; - acpi_namespace_node *device_node; - acpi_status status = AE_OK; + acpi_namespace_node *node; + acpi_status status; - FUNCTION_TRACE ("Acpi_remove_notify_handler"); + ACPI_FUNCTION_TRACE ("Acpi_remove_notify_handler"); /* Parameter validation */ - if ((!handler) || + if ((!device) || + (!handler) || (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* Convert and validate the device handle */ - device_node = acpi_ns_map_handle_to_node (device); - if (!device_node) { + node = acpi_ns_map_handle_to_node (device); + if (!node) { status = AE_BAD_PARAMETER; goto unlock_and_exit; } @@ -397,20 +401,16 @@ * All Other Objects */ else { - /* - * These are the ONLY objects that can receive ACPI notifications - */ - if ((device_node->type != ACPI_TYPE_DEVICE) && - (device_node->type != ACPI_TYPE_PROCESSOR) && - (device_node->type != ACPI_TYPE_POWER) && - (device_node->type != ACPI_TYPE_THERMAL)) { - status = AE_BAD_PARAMETER; + /* Notifies allowed on this object? */ + + if (!acpi_ev_is_notify_object (node)) { + status = AE_TYPE; goto unlock_and_exit; } /* Check for an existing internal object */ - obj_desc = acpi_ns_get_attached_object (device_node); + obj_desc = acpi_ns_get_attached_object (node); if (!obj_desc) { status = AE_NOT_EXIST; goto unlock_and_exit; @@ -419,10 +419,10 @@ /* Object exists - make sure there's an existing handler */ if (handler_type == ACPI_SYSTEM_NOTIFY) { - notify_obj = obj_desc->device.sys_handler; + notify_obj = obj_desc->common_notify.sys_handler; } else { - notify_obj = obj_desc->device.drv_handler; + notify_obj = obj_desc->common_notify.drv_handler; } if ((!notify_obj) || @@ -434,10 +434,10 @@ /* Remove the handler */ if (handler_type == ACPI_SYSTEM_NOTIFY) { - obj_desc->device.sys_handler = NULL; + obj_desc->common_notify.sys_handler = NULL; } else { - obj_desc->device.drv_handler = NULL; + obj_desc->common_notify.drv_handler = NULL; } acpi_ut_remove_reference (notify_obj); @@ -445,7 +445,7 @@ unlock_and_exit: - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } @@ -474,47 +474,56 @@ acpi_gpe_handler handler, void *context) { - acpi_status status = AE_OK; + acpi_status status; + u32 gpe_number_index; - FUNCTION_TRACE ("Acpi_install_gpe_handler"); + ACPI_FUNCTION_TRACE ("Acpi_install_gpe_handler"); /* Parameter validation */ - if (!handler || (gpe_number > ACPI_GPE_MAX)) { + if (!handler) { return_ACPI_STATUS (AE_BAD_PARAMETER); } /* Ensure that we have a valid GPE number */ - if (acpi_gbl_gpe_valid[gpe_number] == ACPI_GPE_INVALID) { + gpe_number_index = acpi_ev_get_gpe_number_index (gpe_number); + if (gpe_number_index == ACPI_GPE_INVALID) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - acpi_ut_acquire_mutex (ACPI_MTX_EVENTS); + status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* Make sure that there isn't a handler there already */ - if (acpi_gbl_gpe_info[gpe_number].handler) { - status = AE_EXIST; + if (acpi_gbl_gpe_number_info[gpe_number_index].handler) { + status = AE_ALREADY_EXISTS; goto cleanup; } /* Install the handler */ - acpi_gbl_gpe_info[gpe_number].handler = handler; - acpi_gbl_gpe_info[gpe_number].context = context; - acpi_gbl_gpe_info[gpe_number].type = (u8) type; + acpi_gbl_gpe_number_info[gpe_number_index].handler = handler; + acpi_gbl_gpe_number_info[gpe_number_index].context = context; + acpi_gbl_gpe_number_info[gpe_number_index].type = (u8) type; /* Clear the GPE (of stale events), the enable it */ - acpi_hw_clear_gpe (gpe_number); - acpi_hw_enable_gpe (gpe_number); + status = acpi_hw_clear_gpe (gpe_number); + if (ACPI_FAILURE (status)) { + goto cleanup; + } + + status = acpi_hw_enable_gpe (gpe_number); cleanup: - acpi_ut_release_mutex (ACPI_MTX_EVENTS); + (void) acpi_ut_release_mutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (status); } @@ -537,46 +546,54 @@ u32 gpe_number, acpi_gpe_handler handler) { - acpi_status status = AE_OK; + acpi_status status; + u32 gpe_number_index; - FUNCTION_TRACE ("Acpi_remove_gpe_handler"); + ACPI_FUNCTION_TRACE ("Acpi_remove_gpe_handler"); /* Parameter validation */ - if (!handler || (gpe_number > ACPI_GPE_MAX)) { + if (!handler) { return_ACPI_STATUS (AE_BAD_PARAMETER); } /* Ensure that we have a valid GPE number */ - if (acpi_gbl_gpe_valid[gpe_number] == ACPI_GPE_INVALID) { + gpe_number_index = acpi_ev_get_gpe_number_index (gpe_number); + if (gpe_number_index == ACPI_GPE_INVALID) { return_ACPI_STATUS (AE_BAD_PARAMETER); } /* Disable the GPE before removing the handler */ - acpi_hw_disable_gpe (gpe_number); + status = acpi_hw_disable_gpe (gpe_number); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - acpi_ut_acquire_mutex (ACPI_MTX_EVENTS); + status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* Make sure that the installed handler is the same */ - if (acpi_gbl_gpe_info[gpe_number].handler != handler) { - acpi_hw_enable_gpe (gpe_number); + if (acpi_gbl_gpe_number_info[gpe_number_index].handler != handler) { + (void) acpi_hw_enable_gpe (gpe_number); status = AE_BAD_PARAMETER; goto cleanup; } /* Remove the handler */ - acpi_gbl_gpe_info[gpe_number].handler = NULL; - acpi_gbl_gpe_info[gpe_number].context = NULL; + acpi_gbl_gpe_number_info[gpe_number_index].handler = NULL; + acpi_gbl_gpe_number_info[gpe_number_index].context = NULL; cleanup: - acpi_ut_release_mutex (ACPI_MTX_EVENTS); + (void) acpi_ut_release_mutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (status); } @@ -596,23 +613,29 @@ acpi_status acpi_acquire_global_lock ( - void) + u32 timeout, + u32 *handle) { acpi_status status; + if (!handle) { + return (AE_BAD_PARAMETER); + } + status = acpi_ex_enter_interpreter (); if (ACPI_FAILURE (status)) { return (status); } - /* - * TBD: [Restructure] add timeout param to internal interface, and - * perhaps INTERPRETER_LOCKED - */ - status = acpi_ev_acquire_global_lock (); + status = acpi_ev_acquire_global_lock (timeout); acpi_ex_exit_interpreter (); + if (ACPI_SUCCESS (status)) { + acpi_gbl_global_lock_handle++; + *handle = acpi_gbl_global_lock_handle; + } + return (status); } @@ -631,11 +654,17 @@ acpi_status acpi_release_global_lock ( - void) + u32 handle) { + acpi_status status; + - acpi_ev_release_global_lock (); - return (AE_OK); + if (handle != acpi_gbl_global_lock_handle) { + return (AE_NOT_ACQUIRED); + } + + status = acpi_ev_release_global_lock (); + return (status); } diff -urN linux-2.4.18/drivers/acpi/events/evxfevnt.c lia64-2.4/drivers/acpi/events/evxfevnt.c --- linux-2.4.18/drivers/acpi/events/evxfevnt.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/events/evxfevnt.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable - * $Revision: 38 $ + * $Revision: 55 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,14 +25,10 @@ #include "acpi.h" -#include "achware.h" -#include "acnamesp.h" #include "acevents.h" -#include "amlcode.h" -#include "acinterp.h" #define _COMPONENT ACPI_EVENTS - MODULE_NAME ("evxfevnt") + ACPI_MODULE_NAME ("evxfevnt") /******************************************************************************* @@ -50,36 +46,36 @@ acpi_status acpi_enable (void) { - acpi_status status; + acpi_status status = AE_OK; - FUNCTION_TRACE ("Acpi_enable"); + ACPI_FUNCTION_TRACE ("Acpi_enable"); - /* Make sure we've got ACPI tables */ + /* Make sure we have ACPI tables */ if (!acpi_gbl_DSDT) { ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "No ACPI tables present!\n")); return_ACPI_STATUS (AE_NO_ACPI_TABLES); } - /* Make sure the BIOS supports ACPI mode */ + acpi_gbl_original_mode = acpi_hw_get_mode (); - if (SYS_MODE_LEGACY == acpi_hw_get_mode_capabilities()) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Only legacy mode supported!\n")); - return_ACPI_STATUS (AE_ERROR); + if (acpi_gbl_original_mode == ACPI_SYS_MODE_ACPI) { + ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Already in ACPI mode.\n")); } + else { + /* Transition to ACPI mode */ - /* Transition to ACPI mode */ + status = acpi_hw_set_mode (ACPI_SYS_MODE_ACPI); + if (ACPI_FAILURE (status)) { + ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Could not transition to ACPI mode.\n")); + return_ACPI_STATUS (status); + } - status = acpi_hw_set_mode (SYS_MODE_ACPI); - if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Could not transition to ACPI mode.\n")); - return_ACPI_STATUS (status); + ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Transition to ACPI mode successful\n")); } - ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Transition to ACPI mode successful\n")); - return_ACPI_STATUS (status); } @@ -100,25 +96,25 @@ acpi_status acpi_disable (void) { - acpi_status status; + acpi_status status = AE_OK; - FUNCTION_TRACE ("Acpi_disable"); + ACPI_FUNCTION_TRACE ("Acpi_disable"); - /* Restore original mode */ + if (acpi_hw_get_mode () != acpi_gbl_original_mode) { + /* Restore original mode */ - status = acpi_hw_set_mode (acpi_gbl_original_mode); - if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to transition to original mode")); - return_ACPI_STATUS (status); + status = acpi_hw_set_mode (acpi_gbl_original_mode); + if (ACPI_FAILURE (status)) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to transition to original mode")); + return_ACPI_STATUS (status); + } } /* Unload the SCI interrupt handler */ - acpi_ev_remove_sci_handler (); - acpi_ev_restore_acpi_state (); - + status = acpi_ev_remove_sci_handler (); return_ACPI_STATUS (status); } @@ -144,58 +140,46 @@ u32 flags) { acpi_status status = AE_OK; - u32 register_id; + u32 value; - FUNCTION_TRACE ("Acpi_enable_event"); + ACPI_FUNCTION_TRACE ("Acpi_enable_event"); - /* The Type must be either Fixed Acpi_event or GPE */ + /* The Type must be either Fixed Event or GPE */ switch (type) { - case ACPI_EVENT_FIXED: - /* Decode the Fixed Acpi_event */ + /* Decode the Fixed Event */ - switch (event) { - case ACPI_EVENT_PMTIMER: - register_id = TMR_EN; - break; - - case ACPI_EVENT_GLOBAL: - register_id = GBL_EN; - break; - - case ACPI_EVENT_POWER_BUTTON: - register_id = PWRBTN_EN; - break; - - case ACPI_EVENT_SLEEP_BUTTON: - register_id = SLPBTN_EN; - break; - - case ACPI_EVENT_RTC: - register_id = RTC_EN; - break; - - default: + if (event > ACPI_EVENT_MAX) { return_ACPI_STATUS (AE_BAD_PARAMETER); - break; } /* * Enable the requested fixed event (by writing a one to the * enable register bit) */ - acpi_hw_register_bit_access (ACPI_WRITE, ACPI_MTX_LOCK, register_id, 1); + status = acpi_set_register (acpi_gbl_fixed_event_info[event].enable_register_id, + 1, ACPI_MTX_LOCK); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - if (1 != acpi_hw_register_bit_access(ACPI_READ, ACPI_MTX_LOCK, register_id)) { + /* Make sure that the hardware responded */ + + status = acpi_get_register (acpi_gbl_fixed_event_info[event].enable_register_id, + &value, ACPI_MTX_LOCK); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + if (value != 1) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Fixed event bit clear when it should be set\n")); + "Could not enable %s event\n", acpi_ut_get_event_name (event))); return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE); } - break; @@ -203,21 +187,20 @@ /* Ensure that we have a valid GPE number */ - if ((event > ACPI_GPE_MAX) || - (acpi_gbl_gpe_valid[event] == ACPI_GPE_INVALID)) { + if (acpi_ev_get_gpe_number_index (event) == ACPI_GPE_INVALID) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Enable the requested GPE number */ - if (flags & ACPI_EVENT_ENABLE) { - acpi_hw_enable_gpe (event); + status = acpi_hw_enable_gpe (event); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } + if (flags & ACPI_EVENT_WAKE_ENABLE) { acpi_hw_enable_gpe_for_wakeup (event); } - break; @@ -226,7 +209,6 @@ status = AE_BAD_PARAMETER; } - return_ACPI_STATUS (status); } @@ -252,58 +234,44 @@ u32 flags) { acpi_status status = AE_OK; - u32 register_id; + u32 value; - FUNCTION_TRACE ("Acpi_disable_event"); + ACPI_FUNCTION_TRACE ("Acpi_disable_event"); - /* The Type must be either Fixed Acpi_event or GPE */ + /* The Type must be either Fixed Event or GPE */ switch (type) { - case ACPI_EVENT_FIXED: - /* Decode the Fixed Acpi_event */ - - switch (event) { - case ACPI_EVENT_PMTIMER: - register_id = TMR_EN; - break; - - case ACPI_EVENT_GLOBAL: - register_id = GBL_EN; - break; - - case ACPI_EVENT_POWER_BUTTON: - register_id = PWRBTN_EN; - break; - - case ACPI_EVENT_SLEEP_BUTTON: - register_id = SLPBTN_EN; - break; - - case ACPI_EVENT_RTC: - register_id = RTC_EN; - break; + /* Decode the Fixed Event */ - default: + if (event > ACPI_EVENT_MAX) { return_ACPI_STATUS (AE_BAD_PARAMETER); - break; } /* * Disable the requested fixed event (by writing a zero to the * enable register bit) */ - acpi_hw_register_bit_access (ACPI_WRITE, ACPI_MTX_LOCK, register_id, 0); + status = acpi_set_register (acpi_gbl_fixed_event_info[event].enable_register_id, + 0, ACPI_MTX_LOCK); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + status = acpi_get_register (acpi_gbl_fixed_event_info[event].enable_register_id, + &value, ACPI_MTX_LOCK); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - if (0 != acpi_hw_register_bit_access(ACPI_READ, ACPI_MTX_LOCK, register_id)) { + if (value != 0) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Fixed event bit set when it should be clear,\n")); + "Could not disable %s events\n", acpi_ut_get_event_name (event))); return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE); } - break; @@ -311,20 +279,21 @@ /* Ensure that we have a valid GPE number */ - if ((event > ACPI_GPE_MAX) || - (acpi_gbl_gpe_valid[event] == ACPI_GPE_INVALID)) { + if (acpi_ev_get_gpe_number_index (event) == ACPI_GPE_INVALID) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Disable the requested GPE number */ + /* + * Only disable the requested GPE number for wake if specified. + * Otherwise, turn it totally off + */ - if (flags & ACPI_EVENT_DISABLE) { - acpi_hw_disable_gpe (event); - } if (flags & ACPI_EVENT_WAKE_DISABLE) { acpi_hw_disable_gpe_for_wakeup (event); } - + else { + status = acpi_hw_disable_gpe (event); + } break; @@ -355,51 +324,28 @@ u32 type) { acpi_status status = AE_OK; - u32 register_id; - FUNCTION_TRACE ("Acpi_clear_event"); + ACPI_FUNCTION_TRACE ("Acpi_clear_event"); - /* The Type must be either Fixed Acpi_event or GPE */ + /* The Type must be either Fixed Event or GPE */ switch (type) { - case ACPI_EVENT_FIXED: - /* Decode the Fixed Acpi_event */ - - switch (event) { - case ACPI_EVENT_PMTIMER: - register_id = TMR_STS; - break; - - case ACPI_EVENT_GLOBAL: - register_id = GBL_STS; - break; - - case ACPI_EVENT_POWER_BUTTON: - register_id = PWRBTN_STS; - break; - - case ACPI_EVENT_SLEEP_BUTTON: - register_id = SLPBTN_STS; - break; - - case ACPI_EVENT_RTC: - register_id = RTC_STS; - break; + /* Decode the Fixed Event */ - default: + if (event > ACPI_EVENT_MAX) { return_ACPI_STATUS (AE_BAD_PARAMETER); - break; } /* * Clear the requested fixed event (By writing a one to the * status register bit) */ - acpi_hw_register_bit_access (ACPI_WRITE, ACPI_MTX_LOCK, register_id, 1); + status = acpi_set_register (acpi_gbl_fixed_event_info[event].status_register_id, + 1, ACPI_MTX_LOCK); break; @@ -407,13 +353,11 @@ /* Ensure that we have a valid GPE number */ - if ((event > ACPI_GPE_MAX) || - (acpi_gbl_gpe_valid[event] == ACPI_GPE_INVALID)) { + if (acpi_ev_get_gpe_number_index (event) == ACPI_GPE_INVALID) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - - acpi_hw_clear_gpe (event); + status = acpi_hw_clear_gpe (event); break; @@ -449,10 +393,9 @@ acpi_event_status *event_status) { acpi_status status = AE_OK; - u32 register_id; - FUNCTION_TRACE ("Acpi_get_event_status"); + ACPI_FUNCTION_TRACE ("Acpi_get_event_status"); if (!event_status) { @@ -460,43 +403,21 @@ } - /* The Type must be either Fixed Acpi_event or GPE */ + /* The Type must be either Fixed Event or GPE */ switch (type) { - case ACPI_EVENT_FIXED: - /* Decode the Fixed Acpi_event */ + /* Decode the Fixed Event */ - switch (event) { - case ACPI_EVENT_PMTIMER: - register_id = TMR_STS; - break; - - case ACPI_EVENT_GLOBAL: - register_id = GBL_STS; - break; - - case ACPI_EVENT_POWER_BUTTON: - register_id = PWRBTN_STS; - break; - - case ACPI_EVENT_SLEEP_BUTTON: - register_id = SLPBTN_STS; - break; - - case ACPI_EVENT_RTC: - register_id = RTC_STS; - break; - - default: + if (event > ACPI_EVENT_MAX) { return_ACPI_STATUS (AE_BAD_PARAMETER); - break; } /* Get the status of the requested fixed event */ - *event_status = acpi_hw_register_bit_access (ACPI_READ, ACPI_MTX_LOCK, register_id); + status = acpi_get_register (acpi_gbl_fixed_event_info[event].status_register_id, + event_status, ACPI_MTX_LOCK); break; @@ -504,15 +425,13 @@ /* Ensure that we have a valid GPE number */ - if ((event > ACPI_GPE_MAX) || - (acpi_gbl_gpe_valid[event] == ACPI_GPE_INVALID)) { + if (acpi_ev_get_gpe_number_index (event) == ACPI_GPE_INVALID) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Obtain status on the requested GPE number */ - acpi_hw_get_gpe_status (event, event_status); + status = acpi_hw_get_gpe_status (event, event_status); break; diff -urN linux-2.4.18/drivers/acpi/events/evxfregn.c lia64-2.4/drivers/acpi/events/evxfregn.c --- linux-2.4.18/drivers/acpi/events/evxfregn.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/events/evxfregn.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ * * Module Name: evxfregn - External Interfaces, ACPI Operation Regions and * Address Spaces. - * $Revision: 40 $ + * $Revision: 50 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,14 +26,12 @@ #include "acpi.h" -#include "achware.h" #include "acnamesp.h" #include "acevents.h" -#include "amlcode.h" #include "acinterp.h" #define _COMPONENT ACPI_EVENTS - MODULE_NAME ("evxfregn") + ACPI_MODULE_NAME ("evxfregn") /******************************************************************************* @@ -63,23 +61,24 @@ acpi_operand_object *obj_desc; acpi_operand_object *handler_obj; acpi_namespace_node *node; - acpi_status status = AE_OK; - acpi_object_type8 type; + acpi_status status; + acpi_object_type type; u16 flags = 0; - FUNCTION_TRACE ("Acpi_install_address_space_handler"); + ACPI_FUNCTION_TRACE ("Acpi_install_address_space_handler"); /* Parameter validation */ - if ((!device) || - ((!handler) && (handler != ACPI_DEFAULT_HANDLER)) || - (space_id > ACPI_MAX_ADDRESS_SPACE)) { + if (!device) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* Convert and validate the device handle */ @@ -103,7 +102,7 @@ } if (handler == ACPI_DEFAULT_HANDLER) { - flags = ADDR_HANDLER_DEFAULT_INSTALLED; + flags = ACPI_ADDR_HANDLER_DEFAULT_INSTALLED; switch (space_id) { case ACPI_ADR_SPACE_SYSTEM_MEMORY: @@ -131,10 +130,14 @@ setup = acpi_ev_pci_bar_region_setup; break; + case ACPI_ADR_SPACE_DATA_TABLE: + handler = acpi_ex_data_table_space_handler; + setup = NULL; + break; + default: status = AE_NOT_EXIST; goto unlock_and_exit; - break; } } @@ -164,7 +167,7 @@ * address space. */ if(handler_obj->addr_handler.space_id == space_id) { - status = AE_EXIST; + status = AE_ALREADY_EXISTS; goto unlock_and_exit; } @@ -174,7 +177,6 @@ handler_obj = handler_obj->addr_handler.next; } } - else { ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Creating object on Device %p while installing handler\n", node)); @@ -200,7 +202,7 @@ /* Attach the new object to the Node */ - status = acpi_ns_attach_object (node, obj_desc, (u8) type); + status = acpi_ns_attach_object (node, obj_desc, type); if (ACPI_FAILURE (status)) { acpi_ut_remove_reference (obj_desc); goto unlock_and_exit; @@ -246,7 +248,7 @@ * of the branch */ status = acpi_ns_walk_namespace (ACPI_TYPE_ANY, device, - ACPI_UINT32_MAX, NS_WALK_UNLOCK, + ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK, acpi_ev_addr_handler_helper, handler_obj, NULL); @@ -260,7 +262,7 @@ unlock_and_exit: - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } @@ -289,21 +291,22 @@ acpi_operand_object *region_obj; acpi_operand_object **last_obj_ptr; acpi_namespace_node *node; - acpi_status status = AE_OK; + acpi_status status; - FUNCTION_TRACE ("Acpi_remove_address_space_handler"); + ACPI_FUNCTION_TRACE ("Acpi_remove_address_space_handler"); /* Parameter validation */ - if ((!device) || - ((!handler) && (handler != ACPI_DEFAULT_HANDLER)) || - (space_id > ACPI_MAX_ADDRESS_SPACE)) { + if (!device) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* Convert and validate the device handle */ @@ -313,7 +316,6 @@ goto unlock_and_exit; } - /* Make sure the internal object exists */ obj_desc = acpi_ns_get_attached_object (node); @@ -352,7 +354,7 @@ * The region is just inaccessible as indicated to * the _REG method */ - acpi_ev_disassociate_region_from_handler(region_obj, TRUE); + acpi_ev_detach_region (region_obj, TRUE); /* * Walk the list, since we took the first region and it @@ -396,7 +398,7 @@ unlock_and_exit: - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/executer/Makefile lia64-2.4/drivers/acpi/executer/Makefile --- linux-2.4.18/drivers/acpi/executer/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/executer/Makefile Tue Apr 9 15:46:59 2002 @@ -1,11 +1,10 @@ # # Makefile for all Linux ACPI interpreter subdirectories -# EXCEPT for the ospm directory # O_TARGET := $(notdir $(CURDIR)).o -obj-$(CONFIG_ACPI) := $(patsubst %.c,%.o,$(wildcard *.c)) +obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c)) EXTRA_CFLAGS += $(ACPI_CFLAGS) diff -urN linux-2.4.18/drivers/acpi/executer/exconfig.c lia64-2.4/drivers/acpi/executer/exconfig.c --- linux-2.4.18/drivers/acpi/executer/exconfig.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exconfig.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes) - * $Revision: 44 $ + * $Revision: 65 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,161 +25,365 @@ #include "acpi.h" -#include "acparser.h" #include "acinterp.h" #include "amlcode.h" #include "acnamesp.h" #include "acevents.h" #include "actables.h" -#include "acdispat.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exconfig") + ACPI_MODULE_NAME ("exconfig") -/***************************************************************************** +/******************************************************************************* + * + * FUNCTION: Acpi_ex_add_table + * + * PARAMETERS: Table - Pointer to raw table + * Parent_node - Where to load the table (scope) + * Ddb_handle - Where to return the table handle. + * + * RETURN: Status + * + * DESCRIPTION: Common function to Install and Load an ACPI table with a + * returned table handle. + * + ******************************************************************************/ + +acpi_status +acpi_ex_add_table ( + acpi_table_header *table, + acpi_namespace_node *parent_node, + acpi_operand_object **ddb_handle) +{ + acpi_status status; + acpi_table_desc table_info; + acpi_operand_object *obj_desc; + + + ACPI_FUNCTION_TRACE ("Ex_add_table"); + + + /* Create an object to be the table handle */ + + obj_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_REFERENCE); + if (!obj_desc) { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + /* Install the new table into the local data structures */ + + table_info.pointer = table; + table_info.length = (ACPI_SIZE) table->length; + table_info.allocation = ACPI_MEM_ALLOCATED; + table_info.base_pointer = table; + + status = acpi_tb_install_table (&table_info); + if (ACPI_FAILURE (status)) { + goto cleanup; + } + + /* Add the table to the namespace */ + + status = acpi_ns_load_table (table_info.installed_desc, parent_node); + if (ACPI_FAILURE (status)) { + /* Uninstall table on error */ + + (void) acpi_tb_uninstall_table (table_info.installed_desc); + goto cleanup; + } + + /* Init the table handle */ + + obj_desc->reference.opcode = AML_LOAD_OP; + obj_desc->reference.object = table_info.installed_desc; + *ddb_handle = obj_desc; + return_ACPI_STATUS (AE_OK); + + +cleanup: + acpi_ut_remove_reference (obj_desc); + return_ACPI_STATUS (status); +} + + +/******************************************************************************* * * FUNCTION: Acpi_ex_load_table_op * - * PARAMETERS: Rgn_desc - Op region where the table will be obtained - * Ddb_handle - Where a handle to the table will be returned + * PARAMETERS: Walk_state - Current state with operands + * Return_desc - Where to store the return object * * RETURN: Status * * DESCRIPTION: Load an ACPI table * - ****************************************************************************/ + ******************************************************************************/ acpi_status -acpi_ex_load_op ( - acpi_operand_object *rgn_desc, - acpi_operand_object *ddb_handle) +acpi_ex_load_table_op ( + acpi_walk_state *walk_state, + acpi_operand_object **return_desc) { acpi_status status; - acpi_operand_object *table_desc = NULL; - u8 *table_ptr; - u8 *table_data_ptr; - acpi_table_header table_header; - acpi_table_desc table_info; - u32 i; + acpi_operand_object **operand = &walk_state->operands[0]; + acpi_table_header *table; + acpi_namespace_node *parent_node; + acpi_namespace_node *start_node; + acpi_namespace_node *parameter_node = NULL; + acpi_operand_object *ddb_handle; + + + ACPI_FUNCTION_TRACE ("Ex_load_table_op"); + + + /* + * Make sure that the signature does not match one of the tables that + * is already loaded. + */ + status = acpi_tb_match_signature (operand[0]->string.pointer, NULL); + if (status == AE_OK) { + /* Signature matched -- don't allow override */ + + return_ACPI_STATUS (AE_ALREADY_EXISTS); + } + + /* Find the ACPI table */ + + status = acpi_tb_find_table (operand[0]->string.pointer, + operand[1]->string.pointer, + operand[2]->string.pointer, &table); + if (ACPI_FAILURE (status)) { + if (status != AE_NOT_FOUND) { + return_ACPI_STATUS (status); + } + /* Not found, return an Integer=0 and AE_OK */ - FUNCTION_TRACE ("Ex_load_op"); + ddb_handle = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); + if (!ddb_handle) { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + ddb_handle->integer.value = 0; + *return_desc = ddb_handle; - /* TBD: [Unhandled] Object can be either a field or an opregion */ + return_ACPI_STATUS (AE_OK); + } + /* Default nodes */ - /* Get the table header */ + start_node = walk_state->scope_info->scope.node; + parent_node = acpi_gbl_root_node; - table_header.length = 0; - for (i = 0; i < sizeof (acpi_table_header); i++) { - status = acpi_ev_address_space_dispatch (rgn_desc, ACPI_READ_ADR_SPACE, - (ACPI_PHYSICAL_ADDRESS) i, 8, - (u32 *) ((u8 *) &table_header + i)); + /* Root_path (optional parameter) */ + + if (operand[3]->string.length > 0) { + /* + * Find the node referenced by the Root_path_string. This is the + * location within the namespace where the table will be loaded. + */ + status = acpi_ns_get_node_by_path (operand[3]->string.pointer, start_node, + ACPI_NS_SEARCH_PARENT, &parent_node); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } } - /* Allocate a buffer for the entire table */ + /* Parameter_path (optional parameter) */ - table_ptr = ACPI_MEM_ALLOCATE (table_header.length); - if (!table_ptr) { - return_ACPI_STATUS (AE_NO_MEMORY); + if (operand[4]->string.length > 0) { + if ((operand[4]->string.pointer[0] != '\\') && + (operand[4]->string.pointer[0] != '^')) { + /* + * Path is not absolute, so it will be relative to the node + * referenced by the Root_path_string (or the NS root if omitted) + */ + start_node = parent_node; + } + + /* + * Find the node referenced by the Parameter_path_string + */ + status = acpi_ns_get_node_by_path (operand[4]->string.pointer, start_node, + ACPI_NS_SEARCH_PARENT, ¶meter_node); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } } - /* Copy the header to the buffer */ + /* Load the table into the namespace */ - MEMCPY (table_ptr, &table_header, sizeof (acpi_table_header)); - table_data_ptr = table_ptr + sizeof (acpi_table_header); + status = acpi_ex_add_table (table, parent_node, &ddb_handle); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + /* Parameter Data (optional) */ - /* Get the table from the op region */ + if (parameter_node) { + /* Store the parameter data into the optional parameter object */ - for (i = 0; i < table_header.length; i++) { - status = acpi_ev_address_space_dispatch (rgn_desc, ACPI_READ_ADR_SPACE, - (ACPI_PHYSICAL_ADDRESS) i, 8, - (u32 *) (table_data_ptr + i)); + status = acpi_ex_store (operand[5], ACPI_CAST_PTR (acpi_operand_object, parameter_node), + walk_state); if (ACPI_FAILURE (status)) { - goto cleanup; + (void) acpi_ex_unload_table (ddb_handle); } } + return_ACPI_STATUS (status); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ex_load_op + * + * PARAMETERS: Obj_desc - Region or Field where the table will be + * obtained + * Target - Where a handle to the table will be stored + * Walk_state - Current state + * + * RETURN: Status + * + * DESCRIPTION: Load an ACPI table from a field or operation region + * + ******************************************************************************/ + +acpi_status +acpi_ex_load_op ( + acpi_operand_object *obj_desc, + acpi_operand_object *target, + acpi_walk_state *walk_state) +{ + acpi_status status; + acpi_operand_object *ddb_handle; + acpi_operand_object *buffer_desc = NULL; + acpi_table_header *table_ptr = NULL; + u8 *table_data_ptr; + acpi_table_header table_header; + u32 i; + + ACPI_FUNCTION_TRACE ("Ex_load_op"); + + + /* Object can be either an Op_region or a Field */ + + switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { + case ACPI_TYPE_REGION: + + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Load from Region %p %s\n", + obj_desc, acpi_ut_get_type_name (obj_desc->common.type))); - /* Table must be either an SSDT or a PSDT */ + /* Get the table header */ - if ((!STRNCMP (table_header.signature, + table_header.length = 0; + for (i = 0; i < sizeof (acpi_table_header); i++) { + status = acpi_ev_address_space_dispatch (obj_desc, ACPI_READ, + (ACPI_PHYSICAL_ADDRESS) i, 8, + ((u8 *) &table_header) + i); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + } + + /* Allocate a buffer for the entire table */ + + table_ptr = ACPI_MEM_ALLOCATE (table_header.length); + if (!table_ptr) { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + /* Copy the header to the buffer */ + + ACPI_MEMCPY (table_ptr, &table_header, sizeof (acpi_table_header)); + table_data_ptr = ACPI_PTR_ADD (u8, table_ptr, sizeof (acpi_table_header)); + + /* Get the table from the op region */ + + for (i = 0; i < table_header.length; i++) { + status = acpi_ev_address_space_dispatch (obj_desc, ACPI_READ, + (ACPI_PHYSICAL_ADDRESS) i, 8, + ((u8 *) table_data_ptr + i)); + if (ACPI_FAILURE (status)) { + goto cleanup; + } + } + break; + + + case ACPI_TYPE_BUFFER_FIELD: + case INTERNAL_TYPE_REGION_FIELD: + case INTERNAL_TYPE_BANK_FIELD: + case INTERNAL_TYPE_INDEX_FIELD: + + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Load from Field %p %s\n", + obj_desc, acpi_ut_get_type_name (obj_desc->common.type))); + + /* + * The length of the field must be at least as large as the table. + * Read the entire field and thus the entire table. Buffer is + * allocated during the read. + */ + status = acpi_ex_read_data_from_field (walk_state, obj_desc, &buffer_desc); + if (ACPI_FAILURE (status)) { + goto cleanup; + } + + table_ptr = ACPI_CAST_PTR (acpi_table_header, buffer_desc->buffer.pointer); + break; + + + default: + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); + } + + /* The table must be either an SSDT or a PSDT */ + + if ((!ACPI_STRNCMP (table_ptr->signature, acpi_gbl_acpi_table_data[ACPI_TABLE_PSDT].signature, acpi_gbl_acpi_table_data[ACPI_TABLE_PSDT].sig_length)) && - (!STRNCMP (table_header.signature, + (!ACPI_STRNCMP (table_ptr->signature, acpi_gbl_acpi_table_data[ACPI_TABLE_SSDT].signature, acpi_gbl_acpi_table_data[ACPI_TABLE_SSDT].sig_length))) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Table has invalid signature [%4.4s], must be SSDT or PSDT\n", - (char*)table_header.signature)); + table_ptr->signature)); status = AE_BAD_SIGNATURE; goto cleanup; } - /* Create an object to be the table handle */ - - table_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_REFERENCE); - if (!table_desc) { - status = AE_NO_MEMORY; - goto cleanup; - } - - /* Install the new table into the local data structures */ - table_info.pointer = (acpi_table_header *) table_ptr; - table_info.length = table_header.length; - table_info.allocation = ACPI_MEM_ALLOCATED; - table_info.base_pointer = table_ptr; - - status = acpi_tb_install_table (NULL, &table_info); + status = acpi_ex_add_table (table_ptr, acpi_gbl_root_node, &ddb_handle); if (ACPI_FAILURE (status)) { goto cleanup; } - /* Add the table to the namespace */ + /* Store the Ddb_handle into the Target operand */ - /* TBD: [Restructure] - change to whatever new interface is appropriate */ -/* - Status = Acpi_load_namespace (); - if (ACPI_FAILURE (Status)) - { -*/ - /* TBD: [Errors] Unload the table on failure ? */ -/* - goto Cleanup; + status = acpi_ex_store (ddb_handle, target, walk_state); + if (ACPI_FAILURE (status)) { + (void) acpi_ex_unload_table (ddb_handle); } -*/ - - - /* TBD: [Investigate] we need a pointer to the table desc */ - - /* Init the table handle */ - - table_desc->reference.opcode = AML_LOAD_OP; - table_desc->reference.object = table_info.installed_desc; - - /* TBD: store the tabledesc into the Ddb_handle target */ - /* Ddb_handle = Table_desc; */ return_ACPI_STATUS (status); cleanup: - ACPI_MEM_FREE (table_desc); - ACPI_MEM_FREE (table_ptr); + if (buffer_desc) { + acpi_ut_remove_reference (buffer_desc); + } + else { + ACPI_MEM_FREE (table_ptr); + } return_ACPI_STATUS (status); } -/***************************************************************************** +/******************************************************************************* * * FUNCTION: Acpi_ex_unload_table * @@ -189,7 +393,7 @@ * * DESCRIPTION: Unload an ACPI table * - ****************************************************************************/ + ******************************************************************************/ acpi_status acpi_ex_unload_table ( @@ -200,7 +404,7 @@ acpi_table_desc *table_info; - FUNCTION_TRACE ("Ex_unload_table"); + ACPI_FUNCTION_TRACE ("Ex_unload_table"); /* @@ -210,7 +414,7 @@ * validated here. */ if ((!ddb_handle) || - (!VALID_DESCRIPTOR_TYPE (ddb_handle, ACPI_DESC_TYPE_INTERNAL)) || + (ACPI_GET_DESCRIPTOR_TYPE (ddb_handle) != ACPI_DESC_TYPE_OPERAND) || (((acpi_operand_object *)ddb_handle)->common.type != INTERNAL_TYPE_REFERENCE)) { return_ACPI_STATUS (AE_BAD_PARAMETER); @@ -224,19 +428,15 @@ * Delete the entire namespace under this table Node * (Offset contains the Table_id) */ - status = acpi_ns_delete_namespace_by_owner (table_info->table_id); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } + acpi_ns_delete_namespace_by_owner (table_info->table_id); /* Delete the table itself */ - acpi_tb_uninstall_table (table_info->installed_desc); + (void) acpi_tb_uninstall_table (table_info->installed_desc); /* Delete the table descriptor (Ddb_handle) */ acpi_ut_remove_reference (table_desc); - return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/executer/exconvrt.c lia64-2.4/drivers/acpi/executer/exconvrt.c --- linux-2.4.18/drivers/acpi/executer/exconvrt.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exconvrt.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: exconvrt - Object conversion routines - * $Revision: 24 $ + * $Revision: 36 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,16 +25,12 @@ #include "acpi.h" -#include "acparser.h" -#include "acnamesp.h" #include "acinterp.h" -#include "acevents.h" #include "amlcode.h" -#include "acdispat.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exconvrt") + ACPI_MODULE_NAME ("exconvrt") /******************************************************************************* @@ -60,53 +56,33 @@ u32 i; acpi_operand_object *ret_desc; u32 count; - char *pointer; + u8 *pointer; acpi_integer result; - u32 integer_size = sizeof (acpi_integer); + acpi_status status; - FUNCTION_ENTRY (); + ACPI_FUNCTION_TRACE_PTR ("Ex_convert_to_integer", obj_desc); switch (obj_desc->common.type) { case ACPI_TYPE_INTEGER: *result_desc = obj_desc; - return (AE_OK); + return_ACPI_STATUS (AE_OK); case ACPI_TYPE_STRING: - pointer = obj_desc->string.pointer; + pointer = (u8 *) obj_desc->string.pointer; count = obj_desc->string.length; break; case ACPI_TYPE_BUFFER: - pointer = (char *) obj_desc->buffer.pointer; + pointer = obj_desc->buffer.pointer; count = obj_desc->buffer.length; break; default: - return (AE_TYPE); - } - - /* - * Create a new integer - */ - ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); - if (!ret_desc) { - return (AE_NO_MEMORY); - } - - - /* Handle both ACPI 1.0 and ACPI 2.0 Integer widths */ - - if (walk_state->method_node->flags & ANOBJ_DATA_WIDTH_32) { - /* - * We are running a method that exists in a 32-bit ACPI table. - * Truncate the value to 32 bits by zeroing out the upper 32-bit field - */ - integer_size = sizeof (u32); + return_ACPI_STATUS (AE_TYPE); } - /* * Convert the buffer/string to an integer. Note that both buffers and * strings are treated as raw data - we don't convert ascii to hex for @@ -120,8 +96,8 @@ /* Transfer no more than an integer's worth of data */ - if (count > integer_size) { - count = integer_size; + if (count > acpi_gbl_integer_byte_width) { + count = acpi_gbl_integer_byte_width; } /* @@ -130,13 +106,14 @@ switch (obj_desc->common.type) { case ACPI_TYPE_STRING: - /* TBD: Need to use 64-bit STRTOUL */ - /* * Convert string to an integer * String must be hexadecimal as per the ACPI specification */ - result = STRTOUL (pointer, NULL, 16); + status = acpi_ut_strtoul64 ((char *) pointer, 16, &result); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } break; @@ -154,10 +131,22 @@ */ result |= (((acpi_integer) pointer[i]) << (i * 8)); } + break; + + default: + /* No other types can get here */ break; } + /* + * Create a new integer + */ + ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); + if (!ret_desc) { + return_ACPI_STATUS (AE_NO_MEMORY); + } + /* Save the Result, delete original descriptor, store new descriptor */ ret_desc->integer.value = result; @@ -169,7 +158,7 @@ } *result_desc = ret_desc; - return (AE_OK); + return_ACPI_STATUS (AE_OK); } @@ -195,61 +184,47 @@ { acpi_operand_object *ret_desc; u32 i; - u32 integer_size = sizeof (acpi_integer); u8 *new_buf; - FUNCTION_ENTRY (); + ACPI_FUNCTION_TRACE_PTR ("Ex_convert_to_buffer", obj_desc); switch (obj_desc->common.type) { case ACPI_TYPE_INTEGER: /* - * Create a new Buffer + * Create a new Buffer object */ ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER); if (!ret_desc) { - return (AE_NO_MEMORY); - } - - /* Handle both ACPI 1.0 and ACPI 2.0 Integer widths */ - - if (walk_state->method_node->flags & ANOBJ_DATA_WIDTH_32) { - /* - * We are running a method that exists in a 32-bit ACPI table. - * Truncate the value to 32 bits by zeroing out the upper - * 32-bit field - */ - integer_size = sizeof (u32); + return_ACPI_STATUS (AE_NO_MEMORY); } - /* Need enough space for one integers */ + /* Need enough space for one integer */ - ret_desc->buffer.length = integer_size; - new_buf = ACPI_MEM_CALLOCATE (integer_size); + new_buf = ACPI_MEM_CALLOCATE (acpi_gbl_integer_byte_width); if (!new_buf) { - REPORT_ERROR + ACPI_REPORT_ERROR (("Ex_convert_to_buffer: Buffer allocation failure\n")); acpi_ut_remove_reference (ret_desc); - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } /* Copy the integer to the buffer */ - for (i = 0; i < integer_size; i++) { + for (i = 0; i < acpi_gbl_integer_byte_width; i++) { new_buf[i] = (u8) (obj_desc->integer.value >> (i * 8)); } + + /* Complete buffer object initialization */ + + ret_desc->buffer.flags |= AOPOBJ_DATA_VALID; ret_desc->buffer.pointer = new_buf; + ret_desc->buffer.length = acpi_gbl_integer_byte_width; /* Return the new buffer descriptor */ - if (*result_desc == obj_desc) { - if (walk_state->opcode != AML_STORE_OP) { - acpi_ut_remove_reference (obj_desc); - } - } - *result_desc = ret_desc; break; @@ -265,11 +240,13 @@ default: - return (AE_TYPE); - break; - } + return_ACPI_STATUS (AE_TYPE); + } + + /* Mark buffer initialized */ - return (AE_OK); + (*result_desc)->common.flags |= AOPOBJ_DATA_VALID; + return_ACPI_STATUS (AE_OK); } @@ -294,14 +271,14 @@ u32 i; u32 j; u32 k = 0; - u8 hex_digit; + char hex_digit; acpi_integer digit; u32 remainder; u32 length = sizeof (acpi_integer); u8 leading_zero = TRUE; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); switch (base) { @@ -313,7 +290,7 @@ digit = integer; for (j = 1; j < i; j++) { - acpi_ut_short_divide (&digit, 10, &digit, &remainder); + (void) acpi_ut_short_divide (&digit, 10, &digit, &remainder); } /* Create the decimal digit */ @@ -323,7 +300,7 @@ } if (!leading_zero) { - string[k] = (u8) (ASCII_ZERO + remainder); + string[k] = (u8) (ACPI_ASCII_ZERO + remainder); k++; } } @@ -336,12 +313,12 @@ for (i = 0, j = ((length * 2) -1); i < (length * 2); i++, j--) { hex_digit = acpi_ut_hex_to_ascii_char (integer, (j * 4)); - if (hex_digit != ASCII_ZERO) { + if (hex_digit != ACPI_ASCII_ZERO) { leading_zero = FALSE; } if (!leading_zero) { - string[k] = hex_digit; + string[k] = (u8) hex_digit; k++; } } @@ -358,7 +335,7 @@ * Finally, null terminate the string and return the length */ if (!k) { - string [0] = ASCII_ZERO; + string [0] = ACPI_ASCII_ZERO; k = 1; } string [k] = 0; @@ -393,29 +370,17 @@ u32 i; u32 index; u32 string_length; - u32 integer_size = sizeof (acpi_integer); u8 *new_buf; u8 *pointer; - FUNCTION_ENTRY (); + ACPI_FUNCTION_TRACE_PTR ("Ex_convert_to_string", obj_desc); switch (obj_desc->common.type) { case ACPI_TYPE_INTEGER: - /* Handle both ACPI 1.0 and ACPI 2.0 Integer widths */ - - if (walk_state->method_node->flags & ANOBJ_DATA_WIDTH_32) { - /* - * We are running a method that exists in a 32-bit ACPI table. - * Truncate the value to 32 bits by zeroing out the upper - * 32-bit field - */ - integer_size = sizeof (u32); - } - - string_length = integer_size * 2; + string_length = acpi_gbl_integer_byte_width * 2; if (base == 10) { string_length = ACPI_MAX_DECIMAL_DIGITS; } @@ -425,20 +390,19 @@ */ ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_STRING); if (!ret_desc) { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } /* Need enough space for one ASCII integer plus null terminator */ - new_buf = ACPI_MEM_CALLOCATE (string_length + 1); + new_buf = ACPI_MEM_CALLOCATE ((ACPI_SIZE) string_length + 1); if (!new_buf) { - REPORT_ERROR + ACPI_REPORT_ERROR (("Ex_convert_to_string: Buffer allocation failure\n")); acpi_ut_remove_reference (ret_desc); - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } - /* Convert */ i = acpi_ex_convert_to_ascii (obj_desc->integer.value, base, new_buf); @@ -477,7 +441,7 @@ if (max_length > ACPI_MAX_STRING_CONVERSION) { if (string_length > ACPI_MAX_STRING_CONVERSION) { - return (AE_AML_STRING_LIMIT); + return_ACPI_STATUS (AE_AML_STRING_LIMIT); } } @@ -486,7 +450,7 @@ */ ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_STRING); if (!ret_desc) { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } /* String length is the lesser of the Max or the actual length */ @@ -495,12 +459,12 @@ string_length = max_length; } - new_buf = ACPI_MEM_CALLOCATE (string_length + 1); + new_buf = ACPI_MEM_CALLOCATE ((ACPI_SIZE) string_length + 1); if (!new_buf) { - REPORT_ERROR + ACPI_REPORT_ERROR (("Ex_convert_to_string: Buffer allocation failure\n")); acpi_ut_remove_reference (ret_desc); - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } /* @@ -509,7 +473,7 @@ pointer = obj_desc->buffer.pointer; index = 0; for (i = 0, index = 0; i < obj_desc->buffer.length; i++) { - index = acpi_ex_convert_to_ascii (pointer[i], base, &new_buf[index]); + index = acpi_ex_convert_to_ascii ((acpi_integer) pointer[i], base, &new_buf[index]); new_buf[index] = ' '; index++; @@ -519,8 +483,7 @@ new_buf [index-1] = 0; ret_desc->buffer.pointer = new_buf; - ret_desc->string.length = STRLEN ((char *) new_buf); - + ret_desc->string.length = ACPI_STRLEN ((char *) new_buf); /* Return the new buffer descriptor */ @@ -543,17 +506,16 @@ else { /* Must copy the string first and then truncate it */ - return (AE_NOT_IMPLEMENTED); + return_ACPI_STATUS (AE_NOT_IMPLEMENTED); } break; default: - return (AE_TYPE); - break; - } + return_ACPI_STATUS (AE_TYPE); + } - return (AE_OK); + return_ACPI_STATUS (AE_OK); } @@ -561,26 +523,32 @@ * * FUNCTION: Acpi_ex_convert_to_target_type * - * PARAMETERS: *Obj_desc - Object to be converted. - * Walk_state - Current method state + * PARAMETERS: Destination_type - Current type of the destination + * Source_desc - Source object to be converted. + * Walk_state - Current method state * * RETURN: Status * - * DESCRIPTION: + * DESCRIPTION: Implements "implicit conversion" rules for storing an object. * ******************************************************************************/ acpi_status acpi_ex_convert_to_target_type ( - acpi_object_type8 destination_type, - acpi_operand_object **obj_desc, + acpi_object_type destination_type, + acpi_operand_object *source_desc, + acpi_operand_object **result_desc, acpi_walk_state *walk_state) { acpi_status status = AE_OK; - FUNCTION_TRACE ("Ex_convert_to_target_type"); + ACPI_FUNCTION_TRACE ("Ex_convert_to_target_type"); + + /* Default behavior */ + + *result_desc = source_desc; /* * If required by the target, @@ -601,10 +569,10 @@ default: /* No conversion allowed for these types */ - if (destination_type != (*obj_desc)->common.type) { + if (destination_type != source_desc->common.type) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Target does not allow conversion of type %s to %s\n", - acpi_ut_get_type_name ((*obj_desc)->common.type), + acpi_ut_get_type_name ((source_desc)->common.type), acpi_ut_get_type_name (destination_type))); status = AE_TYPE; } @@ -623,7 +591,7 @@ * These types require an Integer operand. We can convert * a Buffer or a String to an Integer if necessary. */ - status = acpi_ex_convert_to_integer (*obj_desc, obj_desc, walk_state); + status = acpi_ex_convert_to_integer (source_desc, result_desc, walk_state); break; @@ -633,17 +601,22 @@ * The operand must be a String. We can convert an * Integer or Buffer if necessary */ - status = acpi_ex_convert_to_string (*obj_desc, obj_desc, 16, ACPI_UINT32_MAX, walk_state); + status = acpi_ex_convert_to_string (source_desc, result_desc, 16, ACPI_UINT32_MAX, walk_state); break; case ACPI_TYPE_BUFFER: /* - * The operand must be a String. We can convert an - * Integer or Buffer if necessary + * The operand must be a Buffer. We can convert an + * Integer or String if necessary */ - status = acpi_ex_convert_to_buffer (*obj_desc, obj_desc, walk_state); + status = acpi_ex_convert_to_buffer (source_desc, result_desc, walk_state); + break; + + + default: + status = AE_AML_INTERNAL; break; } break; @@ -664,7 +637,6 @@ status = AE_AML_INTERNAL; } - /* * Source-to-Target conversion semantics: diff -urN linux-2.4.18/drivers/acpi/executer/excreate.c lia64-2.4/drivers/acpi/executer/excreate.c --- linux-2.4.18/drivers/acpi/executer/excreate.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/excreate.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: excreate - Named object creation - * $Revision: 71 $ + * $Revision: 91 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,16 +25,15 @@ #include "acpi.h" -#include "acparser.h" #include "acinterp.h" #include "amlcode.h" #include "acnamesp.h" #include "acevents.h" -#include "acdispat.h" +#include "actables.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("excreate") + ACPI_MODULE_NAME ("excreate") /***************************************************************************** @@ -58,7 +57,7 @@ acpi_status status; - FUNCTION_TRACE ("Ex_create_alias"); + ACPI_FUNCTION_TRACE ("Ex_create_alias"); /* Get the source/alias operands (both namespace nodes) */ @@ -69,7 +68,7 @@ /* Attach the original source object to the new Alias Node */ status = acpi_ns_attach_object ((acpi_namespace_node *) walk_state->operands[0], - source_node->object, + acpi_ns_get_attached_object (source_node), source_node->type); /* @@ -105,7 +104,7 @@ acpi_operand_object *obj_desc; - FUNCTION_TRACE ("Ex_create_event"); + ACPI_FUNCTION_TRACE ("Ex_create_event"); obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_EVENT); @@ -114,11 +113,11 @@ goto cleanup; } - /* Create the actual OS semaphore */ - - /* TBD: [Investigate] should be created with 0 or 1 units? */ - - status = acpi_os_create_semaphore (ACPI_NO_UNIT_LIMIT, 1, + /* + * Create the actual OS semaphore, with zero initial units -- meaning + * that the event is created in an unsignalled state + */ + status = acpi_os_create_semaphore (ACPI_NO_UNIT_LIMIT, 0, &obj_desc->event.semaphore); if (ACPI_FAILURE (status)) { goto cleanup; @@ -127,7 +126,7 @@ /* Attach object to the Node */ status = acpi_ns_attach_object ((acpi_namespace_node *) walk_state->operands[0], - obj_desc, (u8) ACPI_TYPE_EVENT); + obj_desc, ACPI_TYPE_EVENT); cleanup: /* @@ -161,7 +160,7 @@ acpi_operand_object *obj_desc; - FUNCTION_TRACE_PTR ("Ex_create_mutex", WALK_OPERANDS); + ACPI_FUNCTION_TRACE_PTR ("Ex_create_mutex", ACPI_WALK_OPERANDS); /* Create the new mutex object */ @@ -172,8 +171,11 @@ goto cleanup; } - /* Create the actual OS semaphore */ - + /* + * Create the actual OS semaphore. + * One unit max to make it a mutex, with one initial unit to allow + * the mutex to be acquired. + */ status = acpi_os_create_semaphore (1, 1, &obj_desc->mutex.semaphore); if (ACPI_FAILURE (status)) { goto cleanup; @@ -184,7 +186,7 @@ obj_desc->mutex.sync_level = (u8) walk_state->operands[1]->integer.value; status = acpi_ns_attach_object ((acpi_namespace_node *) walk_state->operands[0], - obj_desc, (u8) ACPI_TYPE_MUTEX); + obj_desc, ACPI_TYPE_MUTEX); cleanup: @@ -222,20 +224,21 @@ acpi_status status; acpi_operand_object *obj_desc; acpi_namespace_node *node; + acpi_operand_object *region_obj2; - FUNCTION_TRACE ("Ex_create_region"); + ACPI_FUNCTION_TRACE ("Ex_create_region"); /* Get the Node from the object stack */ - node = (acpi_namespace_node *) walk_state->operands[0]; + node = walk_state->op->common.node; /* * If the region object is already attached to this node, * just return */ - if (node->object) { + if (acpi_ns_get_attached_object (node)) { return_ACPI_STATUS (AE_OK); } @@ -243,9 +246,9 @@ * Space ID must be one of the predefined IDs, or in the user-defined * range */ - if ((region_space >= NUM_REGION_TYPES) && - (region_space < USER_REGION_BEGIN)) { - REPORT_ERROR (("Invalid Address_space type %X\n", region_space)); + if ((region_space >= ACPI_NUM_PREDEFINED_REGIONS) && + (region_space < ACPI_USER_REGION_BEGIN)) { + ACPI_REPORT_ERROR (("Invalid Address_space type %X\n", region_space)); return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); } @@ -261,21 +264,13 @@ goto cleanup; } - /* Allocate a method object for this region */ - - obj_desc->region.extra = acpi_ut_create_internal_object ( - INTERNAL_TYPE_EXTRA); - if (!obj_desc->region.extra) { - status = AE_NO_MEMORY; - goto cleanup; - } - /* * Remember location in AML stream of address & length * operands since they need to be evaluated at run time. */ - obj_desc->region.extra->extra.aml_start = aml_start; - obj_desc->region.extra->extra.aml_length = aml_length; + region_obj2 = obj_desc->common.next_object; + region_obj2->extra.aml_start = aml_start; + region_obj2->extra.aml_length = aml_length; /* Init the region from the operands */ @@ -286,34 +281,14 @@ /* Install the new region object in the parent Node */ - status = acpi_ns_attach_object (node, obj_desc, - (u8) ACPI_TYPE_REGION); - if (ACPI_FAILURE (status)) { - goto cleanup; - } + status = acpi_ns_attach_object (node, obj_desc, ACPI_TYPE_REGION); - /* - * If we have a valid region, initialize it - * Namespace is NOT locked at this point. - */ - status = acpi_ev_initialize_region (obj_desc, FALSE); - if (ACPI_FAILURE (status)) { - /* - * If AE_NOT_EXIST is returned, it is not fatal - * because many regions get created before a handler - * is installed for said region. - */ - if (AE_NOT_EXIST == status) { - status = AE_OK; - } - } cleanup: /* Remove local reference to the object */ acpi_ut_remove_reference (obj_desc); - return_ACPI_STATUS (status); } @@ -334,24 +309,81 @@ acpi_ex_create_table_region ( acpi_walk_state *walk_state) { - acpi_status status = AE_OK; + acpi_status status; + acpi_operand_object **operand = &walk_state->operands[0]; + acpi_operand_object *obj_desc; + acpi_namespace_node *node; + acpi_table_header *table; + acpi_operand_object *region_obj2; - FUNCTION_TRACE ("Ex_create_table_region"); + ACPI_FUNCTION_TRACE ("Ex_create_table_region"); -/* - acpi_operand_object *Obj_desc; - Obj_desc = Acpi_ut_create_internal_object (ACPI_TYPE_REGION); - if (!Obj_desc) - { - Status = AE_NO_MEMORY; - goto Cleanup; + /* Get the Node from the object stack */ + + node = walk_state->op->common.node; + + /* + * If the region object is already attached to this node, + * just return + */ + if (acpi_ns_get_attached_object (node)) { + return_ACPI_STATUS (AE_OK); + } + + /* Find the ACPI table */ + + status = acpi_tb_find_table (operand[1]->string.pointer, + operand[2]->string.pointer, + operand[3]->string.pointer, &table); + + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } + /* Create the region descriptor */ -Cleanup: -*/ + obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_REGION); + if (!obj_desc) { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + region_obj2 = obj_desc->common.next_object; + region_obj2->extra.region_context = NULL; + + /* Init the region from the operands */ + + obj_desc->region.space_id = REGION_DATA_TABLE; + obj_desc->region.address = (ACPI_PHYSICAL_ADDRESS) ACPI_TO_INTEGER (table); + obj_desc->region.length = table->length; + obj_desc->region.node = node; + obj_desc->region.flags = AOPOBJ_DATA_VALID; + + /* Install the new region object in the parent Node */ + status = acpi_ns_attach_object (node, obj_desc, ACPI_TYPE_REGION); + if (ACPI_FAILURE (status)) { + goto cleanup; + } + + status = acpi_ev_initialize_region (obj_desc, FALSE); + if (ACPI_FAILURE (status)) { + if (status == AE_NOT_EXIST) { + status = AE_OK; + } + else { + goto cleanup; + } + } + + obj_desc->region.flags |= AOPOBJ_SETUP_COMPLETE; + + +cleanup: + + /* Remove local reference to the object */ + + acpi_ut_remove_reference (obj_desc); return_ACPI_STATUS (status); } @@ -381,7 +413,7 @@ acpi_status status; - FUNCTION_TRACE_PTR ("Ex_create_processor", walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ex_create_processor", walk_state); /* Create the processor object */ @@ -401,7 +433,7 @@ /* Install the processor object in the parent Node */ status = acpi_ns_attach_object ((acpi_namespace_node *) operand[0], - obj_desc, (u8) ACPI_TYPE_PROCESSOR); + obj_desc, ACPI_TYPE_PROCESSOR); /* Remove local reference to the object */ @@ -436,7 +468,7 @@ acpi_operand_object *obj_desc; - FUNCTION_TRACE_PTR ("Ex_create_power_resource", walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ex_create_power_resource", walk_state); /* Create the power resource object */ @@ -454,7 +486,7 @@ /* Install the power resource object in the parent Node */ status = acpi_ns_attach_object ((acpi_namespace_node *) operand[0], - obj_desc, (u8) ACPI_TYPE_POWER); + obj_desc, ACPI_TYPE_POWER); /* Remove local reference to the object */ @@ -491,7 +523,7 @@ u8 method_flags; - FUNCTION_TRACE_PTR ("Ex_create_method", walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ex_create_method", walk_state); /* Create a new method object */ @@ -533,7 +565,7 @@ /* Attach the new object to the method Node */ status = acpi_ns_attach_object ((acpi_namespace_node *) operand[0], - obj_desc, (u8) ACPI_TYPE_METHOD); + obj_desc, ACPI_TYPE_METHOD); /* Remove local reference to the object */ diff -urN linux-2.4.18/drivers/acpi/executer/exdump.c lia64-2.4/drivers/acpi/executer/exdump.c --- linux-2.4.18/drivers/acpi/executer/exdump.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exdump.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: exdump - Interpreter debug output routines - * $Revision: 126 $ + * $Revision: 153 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,11 +28,10 @@ #include "acinterp.h" #include "amlcode.h" #include "acnamesp.h" -#include "actables.h" #include "acparser.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exdump") + ACPI_MODULE_NAME ("exdump") /* @@ -43,229 +42,155 @@ /***************************************************************************** * - * FUNCTION: Acpi_ex_show_hex_value - * - * PARAMETERS: Byte_count - Number of bytes to print (1, 2, or 4) - * *Aml_start - Address in AML stream of bytes to print - * Interpreter_mode - Current running mode (load1/Load2/Exec) - * Lead_space - # of spaces to print ahead of value - * 0 => none ahead but one behind - * - * DESCRIPTION: Print Byte_count byte(s) starting at Aml_start as a single - * value, in hex. If Byte_count > 1 or the value printed is > 9, also - * print in decimal. - * - ****************************************************************************/ - -void -acpi_ex_show_hex_value ( - u32 byte_count, - u8 *aml_start, - u32 lead_space) -{ - u32 value; /* Value retrieved from AML stream */ - u32 show_decimal_value; - u32 length; /* Length of printed field */ - u8 *current_aml_ptr = NULL; /* Pointer to current byte of AML value */ - - - FUNCTION_TRACE ("Ex_show_hex_value"); - - - if (!aml_start) { - REPORT_ERROR (("Ex_show_hex_value: null pointer\n")); - } - - /* - * AML numbers are always stored little-endian, - * even if the processor is big-endian. - */ - for (current_aml_ptr = aml_start + byte_count, - value = 0; - current_aml_ptr > aml_start; ) { - value = (value << 8) + (u32)* --current_aml_ptr; - } - - length = lead_space * byte_count + 2; - if (byte_count > 1) { - length += (byte_count - 1); - } - - show_decimal_value = (byte_count > 1 || value > 9); - if (show_decimal_value) { - length += 3 + acpi_ex_digits_needed (value, 10); - } - - for (length = lead_space; length; --length ) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " ")); - } - - while (byte_count--) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, "%02x", *aml_start++)); - - if (byte_count) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " ")); - } - } - - if (show_decimal_value) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " [%d]", value)); - } - - if (0 == lead_space) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " ")); - } - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, "\n")); - return_VOID; -} - - -/***************************************************************************** - * * FUNCTION: Acpi_ex_dump_operand * - * PARAMETERS: *Entry_desc - Pointer to entry to be dumped + * PARAMETERS: *Obj_desc - Pointer to entry to be dumped * * RETURN: Status * - * DESCRIPTION: Dump a stack entry + * DESCRIPTION: Dump an operand object * ****************************************************************************/ -acpi_status +void acpi_ex_dump_operand ( - acpi_operand_object *entry_desc) + acpi_operand_object *obj_desc) { u8 *buf = NULL; u32 length; u32 i; + acpi_operand_object **element; + u16 element_index; + + ACPI_FUNCTION_NAME ("Ex_dump_operand") - PROC_NAME ("Ex_dump_operand") + if (!((ACPI_LV_EXEC & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) { + return; + } - if (!entry_desc) { + if (!obj_desc) { /* * This usually indicates that something serious is wrong -- * since most (if not all) * code that dumps the stack expects something to be there! */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null stack entry ptr\n")); - return (AE_OK); + acpi_os_printf ("Null stack entry ptr\n"); + return; } - if (VALID_DESCRIPTOR_TYPE (entry_desc, ACPI_DESC_TYPE_NAMED)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p NS Node: ", entry_desc)); - DUMP_ENTRY (entry_desc, ACPI_LV_INFO); - return (AE_OK); + if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p NS Node: ", obj_desc)); + ACPI_DUMP_ENTRY (obj_desc, ACPI_LV_EXEC); + return; } - if (!VALID_DESCRIPTOR_TYPE (entry_desc, ACPI_DESC_TYPE_INTERNAL)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p Is not a local object \n", entry_desc)); - DUMP_BUFFER (entry_desc, sizeof (acpi_operand_object)); - return (AE_OK); + if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is not a local object\n", obj_desc)); + ACPI_DUMP_BUFFER (obj_desc, sizeof (acpi_operand_object)); + return; } - /* Entry_desc is a valid object */ + /* Obj_desc is a valid object */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p ", entry_desc)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc)); - switch (entry_desc->common.type) { + switch (obj_desc->common.type) { case INTERNAL_TYPE_REFERENCE: - switch (entry_desc->reference.opcode) { + switch (obj_desc->reference.opcode) { case AML_ZERO_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Zero\n")); + acpi_os_printf ("Reference: Zero\n"); break; case AML_ONE_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: One\n")); + acpi_os_printf ("Reference: One\n"); break; case AML_ONES_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Ones\n")); + acpi_os_printf ("Reference: Ones\n"); break; case AML_REVISION_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Revision\n")); + acpi_os_printf ("Reference: Revision\n"); break; case AML_DEBUG_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Debug\n")); + acpi_os_printf ("Reference: Debug\n"); break; case AML_NAME_OP: - DUMP_PATHNAME (entry_desc->reference.object, "Reference: Name: ", + ACPI_DUMP_PATHNAME (obj_desc->reference.object, "Reference: Name: ", ACPI_LV_INFO, _COMPONENT); - DUMP_ENTRY (entry_desc->reference.object, ACPI_LV_INFO); + ACPI_DUMP_ENTRY (obj_desc->reference.object, ACPI_LV_INFO); break; case AML_INDEX_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Index %p\n", - entry_desc->reference.object)); + acpi_os_printf ("Reference: Index %p\n", + obj_desc->reference.object); break; case AML_ARG_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Arg%d", - entry_desc->reference.offset)); + acpi_os_printf ("Reference: Arg%d", + obj_desc->reference.offset); - if (ACPI_TYPE_INTEGER == entry_desc->common.type) { + if (ACPI_TYPE_INTEGER == obj_desc->common.type) { /* Value is a Number */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%8.8X%8.8x]", - HIDWORD(entry_desc->integer.value), - LODWORD(entry_desc->integer.value))); + acpi_os_printf (" value is [%8.8X%8.8x]", + ACPI_HIDWORD(obj_desc->integer.value), + ACPI_LODWORD(obj_desc->integer.value)); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); + acpi_os_printf ("\n"); break; case AML_LOCAL_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Local%d", - entry_desc->reference.offset)); + acpi_os_printf ("Reference: Local%d", + obj_desc->reference.offset); - if (ACPI_TYPE_INTEGER == entry_desc->common.type) { + if (ACPI_TYPE_INTEGER == obj_desc->common.type) { /* Value is a Number */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%8.8X%8.8x]", - HIDWORD(entry_desc->integer.value), - LODWORD(entry_desc->integer.value))); + acpi_os_printf (" value is [%8.8X%8.8x]", + ACPI_HIDWORD(obj_desc->integer.value), + ACPI_LODWORD(obj_desc->integer.value)); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); + acpi_os_printf ("\n"); break; case AML_INT_NAMEPATH_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference.Node->Name %X\n", - entry_desc->reference.node->name)); + acpi_os_printf ("Reference.Node->Name %X\n", + obj_desc->reference.node->name.integer); break; default: /* unknown opcode */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Unknown opcode=%X\n", - entry_desc->reference.opcode)); + acpi_os_printf ("Unknown opcode=%X\n", + obj_desc->reference.opcode); break; } @@ -275,11 +200,11 @@ case ACPI_TYPE_BUFFER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Buffer len %X @ %p \n", - entry_desc->buffer.length, - entry_desc->buffer.pointer)); + acpi_os_printf ("Buffer len %X @ %p \n", + obj_desc->buffer.length, + obj_desc->buffer.pointer); - length = entry_desc->buffer.length; + length = obj_desc->buffer.length; if (length > 64) { length = 64; @@ -287,13 +212,13 @@ /* Debug only -- dump the buffer contents */ - if (entry_desc->buffer.pointer) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Buffer Contents: ")); + if (obj_desc->buffer.pointer) { + acpi_os_printf ("Buffer Contents: "); - for (buf = entry_desc->buffer.pointer; length--; ++buf) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " %02x", *buf)); + for (buf = obj_desc->buffer.pointer; length--; ++buf) { + acpi_os_printf (" %02x", *buf); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,"\n")); + acpi_os_printf ("\n"); } break; @@ -301,135 +226,128 @@ case ACPI_TYPE_INTEGER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Integer %8.8X%8.8X\n", - HIDWORD (entry_desc->integer.value), - LODWORD (entry_desc->integer.value))); + acpi_os_printf ("Integer %8.8X%8.8X\n", + ACPI_HIDWORD (obj_desc->integer.value), + ACPI_LODWORD (obj_desc->integer.value)); break; case INTERNAL_TYPE_IF: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "If [Integer] %8.8X%8.8X\n", - HIDWORD (entry_desc->integer.value), - LODWORD (entry_desc->integer.value))); + acpi_os_printf ("If [Integer] %8.8X%8.8X\n", + ACPI_HIDWORD (obj_desc->integer.value), + ACPI_LODWORD (obj_desc->integer.value)); break; case INTERNAL_TYPE_WHILE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "While [Integer] %8.8X%8.8X\n", - HIDWORD (entry_desc->integer.value), - LODWORD (entry_desc->integer.value))); + acpi_os_printf ("While [Integer] %8.8X%8.8X\n", + ACPI_HIDWORD (obj_desc->integer.value), + ACPI_LODWORD (obj_desc->integer.value)); break; case ACPI_TYPE_PACKAGE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Package count %X @ %p\n", - entry_desc->package.count, entry_desc->package.elements)); + acpi_os_printf ("Package count %X @ %p\n", + obj_desc->package.count, obj_desc->package.elements); /* * If elements exist, package vector pointer is valid, * and debug_level exceeds 1, dump package's elements. */ - if (entry_desc->package.count && - entry_desc->package.elements && + if (obj_desc->package.count && + obj_desc->package.elements && acpi_dbg_level > 1) { - acpi_operand_object**element; - u16 element_index; - - for (element_index = 0, element = entry_desc->package.elements; - element_index < entry_desc->package.count; + for (element_index = 0, element = obj_desc->package.elements; + element_index < obj_desc->package.count; ++element_index, ++element) { acpi_ex_dump_operand (*element); } } - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); - + acpi_os_printf ("\n"); break; case ACPI_TYPE_REGION: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Region %s (%X)", - acpi_ut_get_region_name (entry_desc->region.space_id), - entry_desc->region.space_id)); + acpi_os_printf ("Region %s (%X)", + acpi_ut_get_region_name (obj_desc->region.space_id), + obj_desc->region.space_id); /* * If the address and length have not been evaluated, * don't print them. */ - if (!(entry_desc->region.flags & AOPOBJ_DATA_VALID)) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); + if (!(obj_desc->region.flags & AOPOBJ_DATA_VALID)) { + acpi_os_printf ("\n"); } else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " base %8.8X%8.8X Length %X\n", - HIDWORD(entry_desc->region.address), - LODWORD(entry_desc->region.address), - entry_desc->region.length)); + acpi_os_printf (" base %8.8X%8.8X Length %X\n", + ACPI_HIDWORD (obj_desc->region.address), + ACPI_LODWORD (obj_desc->region.address), + obj_desc->region.length); } break; case ACPI_TYPE_STRING: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "String length %X @ %p \"", - entry_desc->string.length, entry_desc->string.pointer)); + acpi_os_printf ("String length %X @ %p \"", + obj_desc->string.length, obj_desc->string.pointer); - for (i = 0; i < entry_desc->string.length; i++) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "%c", - entry_desc->string.pointer[i])); + for (i = 0; i < obj_desc->string.length; i++) { + acpi_os_printf ("%c", + obj_desc->string.pointer[i]); } - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\"\n")); + acpi_os_printf ("\"\n"); break; case INTERNAL_TYPE_BANK_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Bank_field\n")); + acpi_os_printf ("Bank_field\n"); break; case INTERNAL_TYPE_REGION_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, - "Region_field: bits=%X bitaccwidth=%X lock=%X update=%X at byte=%X bit=%X of below:\n", - entry_desc->field.bit_length, entry_desc->field.access_bit_width, - entry_desc->field.lock_rule, entry_desc->field.update_rule, - entry_desc->field.base_byte_offset, entry_desc->field.start_field_bit_offset)); - DUMP_STACK_ENTRY (entry_desc->field.region_obj); + acpi_os_printf ( + "Region_field: Bits=%X Acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n", + obj_desc->field.bit_length, obj_desc->field.access_byte_width, + obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK, + obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK, + obj_desc->field.base_byte_offset, obj_desc->field.start_field_bit_offset); + ACPI_DUMP_STACK_ENTRY (obj_desc->field.region_obj); break; case INTERNAL_TYPE_INDEX_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Index_field\n")); + acpi_os_printf ("Index_field\n"); break; case ACPI_TYPE_BUFFER_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, + acpi_os_printf ( "Buffer_field: %X bits at byte %X bit %X of \n", - entry_desc->buffer_field.bit_length, entry_desc->buffer_field.base_byte_offset, - entry_desc->buffer_field.start_field_bit_offset)); + obj_desc->buffer_field.bit_length, obj_desc->buffer_field.base_byte_offset, + obj_desc->buffer_field.start_field_bit_offset); - if (!entry_desc->buffer_field.buffer_obj) + if (!obj_desc->buffer_field.buffer_obj) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "*NULL* \n")); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n")); } - else if (ACPI_TYPE_BUFFER != - entry_desc->buffer_field.buffer_obj->common.type) + obj_desc->buffer_field.buffer_obj->common.type) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "*not a Buffer* \n")); + acpi_os_printf ("*not a Buffer* \n"); } - else { - DUMP_STACK_ENTRY (entry_desc->buffer_field.buffer_obj); + ACPI_DUMP_STACK_ENTRY (obj_desc->buffer_field.buffer_obj); } break; @@ -437,71 +355,57 @@ case ACPI_TYPE_EVENT: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Event\n")); + acpi_os_printf ("Event\n"); break; case ACPI_TYPE_METHOD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, + acpi_os_printf ( "Method(%X) @ %p:%X\n", - entry_desc->method.param_count, - entry_desc->method.aml_start, entry_desc->method.aml_length)); + obj_desc->method.param_count, + obj_desc->method.aml_start, obj_desc->method.aml_length); break; case ACPI_TYPE_MUTEX: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Mutex\n")); + acpi_os_printf ("Mutex\n"); break; case ACPI_TYPE_DEVICE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Device\n")); + acpi_os_printf ("Device\n"); break; case ACPI_TYPE_POWER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Power\n")); + acpi_os_printf ("Power\n"); break; case ACPI_TYPE_PROCESSOR: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Processor\n")); + acpi_os_printf ("Processor\n"); break; case ACPI_TYPE_THERMAL: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Thermal\n")); + acpi_os_printf ("Thermal\n"); break; default: - /* unknown Entry_desc->Common.Type value */ - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Unknown Type %X\n", - entry_desc->common.type)); - - /* Back up to previous entry */ - - entry_desc--; + /* Unknown Obj_desc->Common.Type value */ - - /* TBD: [Restructure] Change to use dump object routine !! */ - /* What is all of this?? */ - - DUMP_BUFFER (entry_desc, sizeof (acpi_operand_object)); - DUMP_BUFFER (++entry_desc, sizeof (acpi_operand_object)); - DUMP_BUFFER (++entry_desc, sizeof (acpi_operand_object)); + acpi_os_printf ("Unknown Type %X\n", obj_desc->common.type); break; - } - return (AE_OK); + return; } @@ -521,7 +425,7 @@ void acpi_ex_dump_operands ( acpi_operand_object **operands, - operating_mode interpreter_mode, + acpi_interpreter_mode interpreter_mode, NATIVE_CHAR *ident, u32 num_levels, NATIVE_CHAR *note, @@ -529,10 +433,10 @@ u32 line_number) { NATIVE_UINT i; - acpi_operand_object **entry_desc; + acpi_operand_object **obj_desc; - PROC_NAME ("Ex_dump_operands"); + ACPI_FUNCTION_NAME ("Ex_dump_operands"); if (!ident) @@ -545,8 +449,7 @@ note = "?"; } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "************* Operand Stack Contents (Opcode [%s], %d Operands)\n", ident, num_levels)); @@ -555,19 +458,15 @@ num_levels = 1; } - /* Dump the stack starting at the top, working down */ + /* Dump the operand stack starting at the top */ for (i = 0; num_levels > 0; i--, num_levels--) { - entry_desc = &operands[i]; - - if (ACPI_FAILURE (acpi_ex_dump_operand (*entry_desc))) - { - break; - } + obj_desc = &operands[i]; + acpi_ex_dump_operand (*obj_desc); } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "************* Stack dump from %s(%d), %s\n", module_name, line_number, note)); return; @@ -576,6 +475,58 @@ /***************************************************************************** * + * FUNCTION: Acpi_ex_out* + * + * PARAMETERS: Title - Descriptive text + * Value - Value to be displayed + * + * DESCRIPTION: Object dump output formatting functions. These functions + * reduce the number of format strings required and keeps them + * all in one place for easy modification. + * + ****************************************************************************/ + +void +acpi_ex_out_string ( + char *title, + char *value) +{ + acpi_os_printf ("%20s : %s\n", title, value); +} + +void +acpi_ex_out_pointer ( + char *title, + void *value) +{ + acpi_os_printf ("%20s : %p\n", title, value); +} + +void +acpi_ex_out_integer ( + char *title, + u32 value) +{ + acpi_os_printf ("%20s : %X\n", title, value); +} + +void +acpi_ex_out_address ( + char *title, + ACPI_PHYSICAL_ADDRESS value) +{ + +#if ACPI_MACHINE_WIDTH == 16 + acpi_os_printf ("%20s : %p\n", title, value); +#else + acpi_os_printf ("%20s : %8.8X%8.8X\n", title, + ACPI_HIDWORD (value), ACPI_LODWORD (value)); +#endif +} + + +/***************************************************************************** + * * FUNCTION: Acpi_ex_dump_node * * PARAMETERS: *Node - Descriptor to dump @@ -591,7 +542,7 @@ u32 flags) { - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); if (!flags) @@ -602,16 +553,15 @@ } } - - acpi_os_printf ("%20s : %4.4s\n", "Name", (char*)&node->name); - acpi_os_printf ("%20s : %s\n", "Type", acpi_ut_get_type_name (node->type)); - acpi_os_printf ("%20s : %X\n", "Flags", node->flags); - acpi_os_printf ("%20s : %X\n", "Owner Id", node->owner_id); - acpi_os_printf ("%20s : %X\n", "Reference Count", node->reference_count); - acpi_os_printf ("%20s : %p\n", "Attached Object", node->object); - acpi_os_printf ("%20s : %p\n", "Child_list", node->child); - acpi_os_printf ("%20s : %p\n", "Next_peer", node->peer); - acpi_os_printf ("%20s : %p\n", "Parent", acpi_ns_get_parent_object (node)); + acpi_os_printf ("%20s : %4.4s\n", "Name", node->name.ascii); + acpi_ex_out_string ("Type", acpi_ut_get_type_name (node->type)); + acpi_ex_out_integer ("Flags", node->flags); + acpi_ex_out_integer ("Owner Id", node->owner_id); + acpi_ex_out_integer ("Reference Count", node->reference_count); + acpi_ex_out_pointer ("Attached Object", acpi_ns_get_attached_object (node)); + acpi_ex_out_pointer ("Child_list", node->child); + acpi_ex_out_pointer ("Next_peer", node->peer); + acpi_ex_out_pointer ("Parent", acpi_ns_get_parent_node (node)); } @@ -631,10 +581,10 @@ acpi_operand_object *obj_desc, u32 flags) { - const acpi_opcode_info *op_info; + u32 i; - FUNCTION_TRACE ("Ex_dump_object_descriptor"); + ACPI_FUNCTION_TRACE ("Ex_dump_object_descriptor"); if (!flags) @@ -645,16 +595,17 @@ } } - if (!(VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_INTERNAL))) + if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) { - acpi_os_printf ("%p is not a valid ACPI object\n", obj_desc); + acpi_os_printf ("Ex_dump_object_descriptor: %p is not a valid ACPI object\n", obj_desc); return; } /* Common Fields */ - acpi_os_printf ("%20s : %X\n", "Reference Count", obj_desc->common.reference_count); - acpi_os_printf ("%20s : %X\n", "Flags", obj_desc->common.flags); + acpi_ex_out_string ("Type", acpi_ut_get_type_name (obj_desc->common.type)); + acpi_ex_out_integer ("Reference Count", obj_desc->common.reference_count); + acpi_ex_out_integer ("Flags", obj_desc->common.flags); /* Object-specific Fields */ @@ -662,198 +613,192 @@ { case ACPI_TYPE_INTEGER: - acpi_os_printf ("%20s : %s\n", "Type", "Integer"); - acpi_os_printf ("%20s : %X%8.8X\n", "Value", HIDWORD (obj_desc->integer.value), - LODWORD (obj_desc->integer.value)); + acpi_os_printf ("%20s : %8.8X%8.8X\n", "Value", + ACPI_HIDWORD (obj_desc->integer.value), + ACPI_LODWORD (obj_desc->integer.value)); break; case ACPI_TYPE_STRING: - acpi_os_printf ("%20s : %s\n", "Type", "String"); - acpi_os_printf ("%20s : %X\n", "Length", obj_desc->string.length); - acpi_os_printf ("%20s : %p\n", "Pointer", obj_desc->string.pointer); + acpi_ex_out_integer ("Length", obj_desc->string.length); + acpi_ex_out_pointer ("Pointer", obj_desc->string.pointer); break; case ACPI_TYPE_BUFFER: - acpi_os_printf ("%20s : %s\n", "Type", "Buffer"); - acpi_os_printf ("%20s : %X\n", "Length", obj_desc->buffer.length); - acpi_os_printf ("%20s : %p\n", "Pointer", obj_desc->buffer.pointer); + acpi_ex_out_integer ("Length", obj_desc->buffer.length); + acpi_ex_out_pointer ("Pointer", obj_desc->buffer.pointer); break; case ACPI_TYPE_PACKAGE: - acpi_os_printf ("%20s : %s\n", "Type", "Package"); - acpi_os_printf ("%20s : %X\n", "Flags", obj_desc->package.flags); - acpi_os_printf ("%20s : %X\n", "Count", obj_desc->package.count); - acpi_os_printf ("%20s : %p\n", "Elements", obj_desc->package.elements); - acpi_os_printf ("%20s : %p\n", "Next_element", obj_desc->package.next_element); - break; + acpi_ex_out_integer ("Flags", obj_desc->package.flags); + acpi_ex_out_integer ("Count", obj_desc->package.count); + acpi_ex_out_pointer ("Elements", obj_desc->package.elements); + /* Dump the package contents */ - case ACPI_TYPE_BUFFER_FIELD: - - acpi_os_printf ("%20s : %s\n", "Type", "Buffer_field"); - acpi_os_printf ("%20s : %X\n", "Bit_length", obj_desc->buffer_field.bit_length); - acpi_os_printf ("%20s : %X\n", "Bit_offset", obj_desc->buffer_field.start_field_bit_offset); - acpi_os_printf ("%20s : %X\n", "Base_byte_offset",obj_desc->buffer_field.base_byte_offset); - acpi_os_printf ("%20s : %p\n", "Buffer_obj", obj_desc->buffer_field.buffer_obj); + if (obj_desc->package.count > 0) + { + acpi_os_printf ("\n_package Contents:\n"); + for (i = 0; i < obj_desc->package.count; i++) + { + acpi_os_printf ("[%.3d] %p", i, obj_desc->package.elements[i]); + if (obj_desc->package.elements[i]) + { + acpi_os_printf (" %s", acpi_ut_get_type_name ((obj_desc->package.elements[i])->common.type)); + } + acpi_os_printf ("\n"); + } + } break; case ACPI_TYPE_DEVICE: - acpi_os_printf ("%20s : %s\n", "Type", "Device"); - acpi_os_printf ("%20s : %p\n", "Addr_handler", obj_desc->device.addr_handler); - acpi_os_printf ("%20s : %p\n", "Sys_handler", obj_desc->device.sys_handler); - acpi_os_printf ("%20s : %p\n", "Drv_handler", obj_desc->device.drv_handler); + acpi_ex_out_pointer ("Addr_handler", obj_desc->device.addr_handler); + acpi_ex_out_pointer ("Sys_handler", obj_desc->device.sys_handler); + acpi_ex_out_pointer ("Drv_handler", obj_desc->device.drv_handler); break; + case ACPI_TYPE_EVENT: - acpi_os_printf ("%20s : %s\n", "Type", "Event"); - acpi_os_printf ("%20s : %X\n", "Semaphore", obj_desc->event.semaphore); + acpi_ex_out_pointer ("Semaphore", obj_desc->event.semaphore); break; case ACPI_TYPE_METHOD: - acpi_os_printf ("%20s : %s\n", "Type", "Method"); - acpi_os_printf ("%20s : %X\n", "Param_count", obj_desc->method.param_count); - acpi_os_printf ("%20s : %X\n", "Concurrency", obj_desc->method.concurrency); - acpi_os_printf ("%20s : %p\n", "Semaphore", obj_desc->method.semaphore); - acpi_os_printf ("%20s : %X\n", "Aml_length", obj_desc->method.aml_length); - acpi_os_printf ("%20s : %X\n", "Aml_start", obj_desc->method.aml_start); + acpi_ex_out_integer ("Param_count", obj_desc->method.param_count); + acpi_ex_out_integer ("Concurrency", obj_desc->method.concurrency); + acpi_ex_out_pointer ("Semaphore", obj_desc->method.semaphore); + acpi_ex_out_integer ("Owning_id", obj_desc->method.owning_id); + acpi_ex_out_integer ("Aml_length", obj_desc->method.aml_length); + acpi_ex_out_pointer ("Aml_start", obj_desc->method.aml_start); break; case ACPI_TYPE_MUTEX: - acpi_os_printf ("%20s : %s\n", "Type", "Mutex"); - acpi_os_printf ("%20s : %X\n", "Sync_level", obj_desc->mutex.sync_level); - acpi_os_printf ("%20s : %p\n", "Owner", obj_desc->mutex.owner); - acpi_os_printf ("%20s : %X\n", "Acquisition_depth", obj_desc->mutex.acquisition_depth); - acpi_os_printf ("%20s : %p\n", "Semaphore", obj_desc->mutex.semaphore); + acpi_ex_out_integer ("Sync_level", obj_desc->mutex.sync_level); + acpi_ex_out_pointer ("Owner_thread", obj_desc->mutex.owner_thread); + acpi_ex_out_integer ("Acquisition_depth",obj_desc->mutex.acquisition_depth); + acpi_ex_out_pointer ("Semaphore", obj_desc->mutex.semaphore); break; case ACPI_TYPE_REGION: - acpi_os_printf ("%20s : %s\n", "Type", "Region"); - acpi_os_printf ("%20s : %X\n", "Space_id", obj_desc->region.space_id); - acpi_os_printf ("%20s : %X\n", "Flags", obj_desc->region.flags); - acpi_os_printf ("%20s : %X\n", "Address", obj_desc->region.address); - acpi_os_printf ("%20s : %X\n", "Length", obj_desc->region.length); - acpi_os_printf ("%20s : %p\n", "Addr_handler", obj_desc->region.addr_handler); - acpi_os_printf ("%20s : %p\n", "Next", obj_desc->region.next); + acpi_ex_out_integer ("Space_id", obj_desc->region.space_id); + acpi_ex_out_integer ("Flags", obj_desc->region.flags); + acpi_ex_out_address ("Address", obj_desc->region.address); + acpi_ex_out_integer ("Length", obj_desc->region.length); + acpi_ex_out_pointer ("Addr_handler", obj_desc->region.addr_handler); + acpi_ex_out_pointer ("Next", obj_desc->region.next); break; case ACPI_TYPE_POWER: - acpi_os_printf ("%20s : %s\n", "Type", "Power_resource"); - acpi_os_printf ("%20s : %X\n", "System_level", obj_desc->power_resource.system_level); - acpi_os_printf ("%20s : %X\n", "Resource_order", obj_desc->power_resource.resource_order); - acpi_os_printf ("%20s : %p\n", "Sys_handler", obj_desc->power_resource.sys_handler); - acpi_os_printf ("%20s : %p\n", "Drv_handler", obj_desc->power_resource.drv_handler); + acpi_ex_out_integer ("System_level", obj_desc->power_resource.system_level); + acpi_ex_out_integer ("Resource_order", obj_desc->power_resource.resource_order); + acpi_ex_out_pointer ("Sys_handler", obj_desc->power_resource.sys_handler); + acpi_ex_out_pointer ("Drv_handler", obj_desc->power_resource.drv_handler); break; case ACPI_TYPE_PROCESSOR: - acpi_os_printf ("%20s : %s\n", "Type", "Processor"); - acpi_os_printf ("%20s : %X\n", "Processor ID", obj_desc->processor.proc_id); - acpi_os_printf ("%20s : %X\n", "Length", obj_desc->processor.length); - acpi_os_printf ("%20s : %X\n", "Address", obj_desc->processor.address); - acpi_os_printf ("%20s : %p\n", "Sys_handler", obj_desc->processor.sys_handler); - acpi_os_printf ("%20s : %p\n", "Drv_handler", obj_desc->processor.drv_handler); - acpi_os_printf ("%20s : %p\n", "Addr_handler", obj_desc->processor.addr_handler); + acpi_ex_out_integer ("Processor ID", obj_desc->processor.proc_id); + acpi_ex_out_integer ("Length", obj_desc->processor.length); + acpi_ex_out_address ("Address", (ACPI_PHYSICAL_ADDRESS) obj_desc->processor.address); + acpi_ex_out_pointer ("Sys_handler", obj_desc->processor.sys_handler); + acpi_ex_out_pointer ("Drv_handler", obj_desc->processor.drv_handler); + acpi_ex_out_pointer ("Addr_handler", obj_desc->processor.addr_handler); break; case ACPI_TYPE_THERMAL: - acpi_os_printf ("%20s : %s\n", "Type", "Thermal_zone"); - acpi_os_printf ("%20s : %p\n", "Sys_handler", obj_desc->thermal_zone.sys_handler); - acpi_os_printf ("%20s : %p\n", "Drv_handler", obj_desc->thermal_zone.drv_handler); - acpi_os_printf ("%20s : %p\n", "Addr_handler", obj_desc->thermal_zone.addr_handler); + acpi_ex_out_pointer ("Sys_handler", obj_desc->thermal_zone.sys_handler); + acpi_ex_out_pointer ("Drv_handler", obj_desc->thermal_zone.drv_handler); + acpi_ex_out_pointer ("Addr_handler", obj_desc->thermal_zone.addr_handler); break; + case ACPI_TYPE_BUFFER_FIELD: case INTERNAL_TYPE_REGION_FIELD: + case INTERNAL_TYPE_BANK_FIELD: + case INTERNAL_TYPE_INDEX_FIELD: - acpi_os_printf ("%20s : %p\n", "Access_bit_width", obj_desc->field.access_bit_width); - acpi_os_printf ("%20s : %p\n", "Bit_length", obj_desc->field.bit_length); - acpi_os_printf ("%20s : %p\n", "Base_byte_offset",obj_desc->field.base_byte_offset); - acpi_os_printf ("%20s : %p\n", "Bit_offset", obj_desc->field.start_field_bit_offset); - acpi_os_printf ("%20s : %p\n", "Region_obj", obj_desc->field.region_obj); - break; - + acpi_ex_out_integer ("Field_flags", obj_desc->common_field.field_flags); + acpi_ex_out_integer ("Access_byte_width", obj_desc->common_field.access_byte_width); + acpi_ex_out_integer ("Bit_length", obj_desc->common_field.bit_length); + acpi_ex_out_integer ("Fld_bit_offset", obj_desc->common_field.start_field_bit_offset); + acpi_ex_out_integer ("Base_byte_offset", obj_desc->common_field.base_byte_offset); + acpi_ex_out_integer ("Datum_valid_bits", obj_desc->common_field.datum_valid_bits); + acpi_ex_out_integer ("End_fld_valid_bits", obj_desc->common_field.end_field_valid_bits); + acpi_ex_out_integer ("End_buf_valid_bits", obj_desc->common_field.end_buffer_valid_bits); + acpi_ex_out_pointer ("Parent_node", obj_desc->common_field.node); - case INTERNAL_TYPE_BANK_FIELD: + switch (obj_desc->common.type) + { + case ACPI_TYPE_BUFFER_FIELD: + acpi_ex_out_pointer ("Buffer_obj", obj_desc->buffer_field.buffer_obj); + break; - acpi_os_printf ("%20s : %s\n", "Type", "Bank_field"); - acpi_os_printf ("%20s : %X\n", "Access_bit_width", obj_desc->bank_field.access_bit_width); - acpi_os_printf ("%20s : %X\n", "Lock_rule", obj_desc->bank_field.lock_rule); - acpi_os_printf ("%20s : %X\n", "Update_rule", obj_desc->bank_field.update_rule); - acpi_os_printf ("%20s : %X\n", "Bit_length", obj_desc->bank_field.bit_length); - acpi_os_printf ("%20s : %X\n", "Bit_offset", obj_desc->bank_field.start_field_bit_offset); - acpi_os_printf ("%20s : %X\n", "Base_byte_offset", obj_desc->bank_field.base_byte_offset); - acpi_os_printf ("%20s : %X\n", "Value", obj_desc->bank_field.value); - acpi_os_printf ("%20s : %p\n", "Region_obj", obj_desc->bank_field.region_obj); - acpi_os_printf ("%20s : %X\n", "Bank_register_obj", obj_desc->bank_field.bank_register_obj); - break; + case INTERNAL_TYPE_REGION_FIELD: + acpi_ex_out_pointer ("Region_obj", obj_desc->field.region_obj); + break; + case INTERNAL_TYPE_BANK_FIELD: + acpi_ex_out_integer ("Value", obj_desc->bank_field.value); + acpi_ex_out_pointer ("Region_obj", obj_desc->bank_field.region_obj); + acpi_ex_out_pointer ("Bank_obj", obj_desc->bank_field.bank_obj); + break; - case INTERNAL_TYPE_INDEX_FIELD: + case INTERNAL_TYPE_INDEX_FIELD: + acpi_ex_out_integer ("Value", obj_desc->index_field.value); + acpi_ex_out_pointer ("Index", obj_desc->index_field.index_obj); + acpi_ex_out_pointer ("Data", obj_desc->index_field.data_obj); + break; - acpi_os_printf ("%20s : %s\n", "Type", "Index_field"); - acpi_os_printf ("%20s : %X\n", "Access_bit_width", obj_desc->index_field.access_bit_width); - acpi_os_printf ("%20s : %X\n", "Lock_rule", obj_desc->index_field.lock_rule); - acpi_os_printf ("%20s : %X\n", "Update_rule", obj_desc->index_field.update_rule); - acpi_os_printf ("%20s : %X\n", "Bit_length", obj_desc->index_field.bit_length); - acpi_os_printf ("%20s : %X\n", "Bit_offset", obj_desc->index_field.start_field_bit_offset); - acpi_os_printf ("%20s : %X\n", "Value", obj_desc->index_field.value); - acpi_os_printf ("%20s : %X\n", "Index", obj_desc->index_field.index_obj); - acpi_os_printf ("%20s : %X\n", "Data", obj_desc->index_field.data_obj); + default: + /* All object types covered above */ + break; + } break; case INTERNAL_TYPE_REFERENCE: - op_info = acpi_ps_get_opcode_info (obj_desc->reference.opcode); - - acpi_os_printf ("%20s : %s\n", "Type", "Reference"); - acpi_os_printf ("%20s : %X\n", "Target_type", obj_desc->reference.target_type); - acpi_os_printf ("%20s : %s\n", "Opcode", op_info->name); - acpi_os_printf ("%20s : %X\n", "Offset", obj_desc->reference.offset); - acpi_os_printf ("%20s : %p\n", "Obj_desc", obj_desc->reference.object); - acpi_os_printf ("%20s : %p\n", "Node", obj_desc->reference.node); - acpi_os_printf ("%20s : %p\n", "Where", obj_desc->reference.where); + acpi_ex_out_integer ("Target_type", obj_desc->reference.target_type); + acpi_ex_out_string ("Opcode", (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name); + acpi_ex_out_integer ("Offset", obj_desc->reference.offset); + acpi_ex_out_pointer ("Obj_desc", obj_desc->reference.object); + acpi_ex_out_pointer ("Node", obj_desc->reference.node); + acpi_ex_out_pointer ("Where", obj_desc->reference.where); break; case INTERNAL_TYPE_ADDRESS_HANDLER: - acpi_os_printf ("%20s : %s\n", "Type", "Address Handler"); - acpi_os_printf ("%20s : %X\n", "Space_id", obj_desc->addr_handler.space_id); - acpi_os_printf ("%20s : %p\n", "Next", obj_desc->addr_handler.next); - acpi_os_printf ("%20s : %p\n", "Region_list", obj_desc->addr_handler.region_list); - acpi_os_printf ("%20s : %p\n", "Node", obj_desc->addr_handler.node); - acpi_os_printf ("%20s : %p\n", "Handler", obj_desc->addr_handler.handler); - acpi_os_printf ("%20s : %p\n", "Context", obj_desc->addr_handler.context); + acpi_ex_out_integer ("Space_id", obj_desc->addr_handler.space_id); + acpi_ex_out_pointer ("Next", obj_desc->addr_handler.next); + acpi_ex_out_pointer ("Region_list", obj_desc->addr_handler.region_list); + acpi_ex_out_pointer ("Node", obj_desc->addr_handler.node); + acpi_ex_out_pointer ("Context", obj_desc->addr_handler.context); break; case INTERNAL_TYPE_NOTIFY: - acpi_os_printf ("%20s : %s\n", "Type", "Notify Handler"); - acpi_os_printf ("%20s : %p\n", "Node", obj_desc->notify_handler.node); - acpi_os_printf ("%20s : %p\n", "Handler", obj_desc->notify_handler.handler); - acpi_os_printf ("%20s : %p\n", "Context", obj_desc->notify_handler.context); + acpi_ex_out_pointer ("Node", obj_desc->notify_handler.node); + acpi_ex_out_pointer ("Context", obj_desc->notify_handler.context); break; @@ -866,15 +811,17 @@ case INTERNAL_TYPE_WHILE: case INTERNAL_TYPE_SCOPE: case INTERNAL_TYPE_DEF_ANY: + case INTERNAL_TYPE_EXTRA: + case INTERNAL_TYPE_DATA: - acpi_os_printf ("*** Structure display not implemented for type %X! ***\n", + acpi_os_printf ("Ex_dump_object_descriptor: Display not implemented for object type %X\n", obj_desc->common.type); break; default: - acpi_os_printf ("*** Cannot display unknown type %X! ***\n", obj_desc->common.type); + acpi_os_printf ("Ex_dump_object_descriptor: Unknown object type %X\n", obj_desc->common.type); break; } diff -urN linux-2.4.18/drivers/acpi/executer/exfield.c lia64-2.4/drivers/acpi/executer/exfield.c --- linux-2.4.18/drivers/acpi/executer/exfield.c Mon Sep 24 15:06:41 2001 +++ lia64-2.4/drivers/acpi/executer/exfield.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: exfield - ACPI AML (p-code) execution - field manipulation - * $Revision: 95 $ + * $Revision: 110 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,33 +27,30 @@ #include "acpi.h" #include "acdispat.h" #include "acinterp.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "achware.h" -#include "acevents.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exfield") + ACPI_MODULE_NAME ("exfield") /******************************************************************************* * * FUNCTION: Acpi_ex_read_data_from_field * - * PARAMETERS: Mode - ACPI_READ or ACPI_WRITE - * *Field_node - Parent node for field to be accessed - * *Buffer - Value(s) to be read or written - * Buffer_length - Number of bytes to transfer + * PARAMETERS: Walk_state - Current execution state + * Obj_desc - The named field + * Ret_buffer_desc - Where the return data object is stored * - * RETURN: Status3 + * RETURN: Status * - * DESCRIPTION: Read or write a named field + * DESCRIPTION: Read from a named field. Returns either an Integer or a + * Buffer, depending on the size of the field. * ******************************************************************************/ acpi_status acpi_ex_read_data_from_field ( + acpi_walk_state *walk_state, acpi_operand_object *obj_desc, acpi_operand_object **ret_buffer_desc) { @@ -61,9 +58,10 @@ acpi_operand_object *buffer_desc; u32 length; void *buffer; + u8 locked; - FUNCTION_TRACE_PTR ("Ex_read_data_from_field", obj_desc); + ACPI_FUNCTION_TRACE_PTR ("Ex_read_data_from_field", obj_desc); /* Parameter validation */ @@ -72,6 +70,19 @@ return_ACPI_STATUS (AE_AML_NO_OPERAND); } + if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) { + /* + * If the Buffer_field arguments have not been previously evaluated, + * evaluate them now and save the results. + */ + if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) { + status = acpi_ds_get_buffer_field_arguments (obj_desc); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + } + } + /* * Allocate a buffer for the contents of the field. * @@ -82,9 +93,8 @@ * * Note: Field.length is in bits. */ - length = ROUND_BITS_UP_TO_BYTES (obj_desc->field.bit_length); - - if (length > sizeof (acpi_integer)) { + length = ACPI_ROUND_BITS_UP_TO_BYTES (obj_desc->field.bit_length); + if (length > acpi_gbl_integer_byte_width) { /* Field is too large for an Integer, create a Buffer instead */ buffer_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER); @@ -100,10 +110,10 @@ return_ACPI_STATUS (AE_NO_MEMORY); } + buffer_desc->common.flags = AOPOBJ_DATA_VALID; buffer_desc->buffer.length = length; buffer = buffer_desc->buffer.pointer; } - else { /* Field will fit within an Integer (normal case) */ @@ -112,39 +122,34 @@ return_ACPI_STATUS (AE_NO_MEMORY); } - length = sizeof (buffer_desc->integer.value); + length = acpi_gbl_integer_byte_width; + buffer_desc->integer.value = 0; buffer = &buffer_desc->integer.value; } + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Obj=%p Type=%X Buf=%p Len=%X\n", + obj_desc, obj_desc->common.type, buffer, length)); + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Field_write: Bit_len=%X Bit_off=%X Byte_off=%X\n", + obj_desc->common_field.bit_length, + obj_desc->common_field.start_field_bit_offset, + obj_desc->common_field.base_byte_offset)); - /* Read from the appropriate field */ - - switch (obj_desc->common.type) { - case ACPI_TYPE_BUFFER_FIELD: - status = acpi_ex_access_buffer_field (ACPI_READ, obj_desc, buffer, length); - break; - - case INTERNAL_TYPE_REGION_FIELD: - status = acpi_ex_access_region_field (ACPI_READ, obj_desc, buffer, length); - break; - - case INTERNAL_TYPE_BANK_FIELD: - status = acpi_ex_access_bank_field (ACPI_READ, obj_desc, buffer, length); - break; + locked = acpi_ex_acquire_global_lock (obj_desc->common_field.field_flags); - case INTERNAL_TYPE_INDEX_FIELD: - status = acpi_ex_access_index_field (ACPI_READ, obj_desc, buffer, length); - break; + /* Read from the field */ - default: - status = AE_AML_INTERNAL; - } + status = acpi_ex_extract_from_field (obj_desc, buffer, length); + /* + * Release global lock if we acquired it earlier + */ + acpi_ex_release_global_lock (locked); if (ACPI_FAILURE (status)) { acpi_ut_remove_reference (buffer_desc); } - else if (ret_buffer_desc) { *ret_buffer_desc = buffer_desc; } @@ -157,18 +162,15 @@ * * FUNCTION: Acpi_ex_write_data_to_field * - * PARAMETERS: Mode - ACPI_READ or ACPI_WRITE - * *Field_node - Parent node for field to be accessed - * *Buffer - Value(s) to be read or written - * Buffer_length - Number of bytes to transfer + * PARAMETERS: Source_desc - Contains data to write + * Obj_desc - The named field * * RETURN: Status * - * DESCRIPTION: Read or write a named field + * DESCRIPTION: Write to a named field * ******************************************************************************/ - acpi_status acpi_ex_write_data_to_field ( acpi_operand_object *source_desc, @@ -176,10 +178,13 @@ { acpi_status status; u32 length; + u32 required_length; void *buffer; + void *new_buffer; + u8 locked; - FUNCTION_TRACE_PTR ("Ex_write_data_to_field", obj_desc); + ACPI_FUNCTION_TRACE_PTR ("Ex_write_data_to_field", obj_desc); /* Parameter validation */ @@ -188,6 +193,18 @@ return_ACPI_STATUS (AE_AML_NO_OPERAND); } + if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) { + /* + * If the Buffer_field arguments have not been previously evaluated, + * evaluate them now and save the results. + */ + if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) { + status = acpi_ds_get_buffer_field_arguments (obj_desc); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + } + } /* * Get a pointer to the data to be written @@ -212,315 +229,61 @@ return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } - /* - * Decode the type of field to be written + * We must have a buffer that is at least as long as the field + * we are writing to. This is because individual fields are + * indivisible and partial writes are not supported -- as per + * the ACPI specification. */ - switch (obj_desc->common.type) { - case ACPI_TYPE_BUFFER_FIELD: - status = acpi_ex_access_buffer_field (ACPI_WRITE, obj_desc, buffer, length); - break; - - case INTERNAL_TYPE_REGION_FIELD: - status = acpi_ex_access_region_field (ACPI_WRITE, obj_desc, buffer, length); - break; - - case INTERNAL_TYPE_BANK_FIELD: - status = acpi_ex_access_bank_field (ACPI_WRITE, obj_desc, buffer, length); - break; - - case INTERNAL_TYPE_INDEX_FIELD: - status = acpi_ex_access_index_field (ACPI_WRITE, obj_desc, buffer, length); - break; - - default: - return_ACPI_STATUS (AE_AML_INTERNAL); - } - - - return_ACPI_STATUS (status); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_ex_access_buffer_field - * - * PARAMETERS: Mode - ACPI_READ or ACPI_WRITE - * *Field_node - Parent node for field to be accessed - * *Buffer - Value(s) to be read or written - * Buffer_length - Number of bytes to transfer - * - * RETURN: Status - * - * DESCRIPTION: Read or write a named field - * - ******************************************************************************/ - -acpi_status -acpi_ex_access_buffer_field ( - u32 mode, - acpi_operand_object *obj_desc, - void *buffer, - u32 buffer_length) -{ - acpi_status status; - + new_buffer = NULL; + required_length = ACPI_ROUND_BITS_UP_TO_BYTES (obj_desc->common_field.bit_length); - FUNCTION_TRACE_PTR ("Ex_access_buffer_field", obj_desc); + if (length < required_length) { + /* We need to create a new buffer */ - - /* - * If the Buffer_field arguments have not been previously evaluated, - * evaluate them now and save the results. - */ - if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) { - status = acpi_ds_get_buffer_field_arguments (obj_desc); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + new_buffer = ACPI_MEM_CALLOCATE (required_length); + if (!new_buffer) { + return_ACPI_STATUS (AE_NO_MEMORY); } - } - - status = acpi_ex_common_access_field (mode, obj_desc, buffer, buffer_length); - - return_ACPI_STATUS (status); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_ex_access_region_field - * - * PARAMETERS: Mode - ACPI_READ or ACPI_WRITE - * *Field_node - Parent node for field to be accessed - * *Buffer - Value(s) to be read or written - * Buffer_length - Number of bytes to transfer - * - * RETURN: Status - * - * DESCRIPTION: Read or write a named field - * - ******************************************************************************/ - -acpi_status -acpi_ex_access_region_field ( - u32 mode, - acpi_operand_object *obj_desc, - void *buffer, - u32 buffer_length) -{ - acpi_status status; - u8 locked; - - - FUNCTION_TRACE_PTR ("Ex_access_region_field", obj_desc); - - - /* - * Get the global lock if needed - */ - locked = acpi_ex_acquire_global_lock (obj_desc->field.lock_rule); - - status = acpi_ex_common_access_field (mode, obj_desc, buffer, buffer_length); - - - /* - * Release global lock if we acquired it earlier - */ - acpi_ex_release_global_lock (locked); - - return_ACPI_STATUS (status); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_ex_access_bank_field - * - * PARAMETERS: Mode - ACPI_READ or ACPI_WRITE - * *Field_node - Parent node for field to be accessed - * *Buffer - Value(s) to be read or written - * Buffer_length - Number of bytes to transfer - * - * RETURN: Status - * - * DESCRIPTION: Read or write a Bank Field - * - ******************************************************************************/ - -acpi_status -acpi_ex_access_bank_field ( - u32 mode, - acpi_operand_object *obj_desc, - void *buffer, - u32 buffer_length) -{ - acpi_status status; - u8 locked; - - - FUNCTION_TRACE_PTR ("Ex_access_bank_field", obj_desc); - - - /* - * Get the global lock if needed - */ - locked = acpi_ex_acquire_global_lock (obj_desc->bank_field.lock_rule); + /* + * Copy the original data to the new buffer, starting + * at Byte zero. All unused (upper) bytes of the + * buffer will be 0. + */ + ACPI_MEMCPY ((char *) new_buffer, (char *) buffer, length); + buffer = new_buffer; + length = required_length; + } + + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Obj=%p Type=%X Buf=%p Len=%X\n", + obj_desc, obj_desc->common.type, buffer, length)); + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Field_read: Bit_len=%X Bit_off=%X Byte_off=%X\n", + obj_desc->common_field.bit_length, + obj_desc->common_field.start_field_bit_offset, + obj_desc->common_field.base_byte_offset)); + locked = acpi_ex_acquire_global_lock (obj_desc->common_field.field_flags); /* - * Write the Bank_value to the Bank_register to select the bank. - * The Bank_value for this Bank_field is specified in the - * Bank_field ASL declaration. The Bank_register is always a Field in - * an operation region. + * Write to the field */ - status = acpi_ex_common_access_field (ACPI_WRITE, - obj_desc->bank_field.bank_register_obj, - &obj_desc->bank_field.value, - sizeof (obj_desc->bank_field.value)); - if (ACPI_FAILURE (status)) { - goto cleanup; - } + status = acpi_ex_insert_into_field (obj_desc, buffer, length); /* - * The bank was successfully selected, now read or write the actual - * data. - */ - status = acpi_ex_common_access_field (mode, obj_desc, buffer, buffer_length); - - -cleanup: - /* * Release global lock if we acquired it earlier */ acpi_ex_release_global_lock (locked); - return_ACPI_STATUS (status); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_ex_access_index_field - * - * PARAMETERS: Mode - ACPI_READ or ACPI_WRITE - * *Field_node - Parent node for field to be accessed - * *Buffer - Value(s) to be read or written - * Buffer_length - Number of bytes to transfer - * - * RETURN: Status - * - * DESCRIPTION: Read or write a Index Field - * - ******************************************************************************/ - -acpi_status -acpi_ex_access_index_field ( - u32 mode, - acpi_operand_object *obj_desc, - void *buffer, - u32 buffer_length) -{ - acpi_status status; - u8 locked; - - - FUNCTION_TRACE_PTR ("Ex_access_index_field", obj_desc); - - - /* - * Get the global lock if needed - */ - locked = acpi_ex_acquire_global_lock (obj_desc->index_field.lock_rule); + /* Free temporary buffer if we used one */ - - /* - * Set Index value to select proper Data register - */ - status = acpi_ex_common_access_field (ACPI_WRITE, - obj_desc->index_field.index_obj, - &obj_desc->index_field.value, - sizeof (obj_desc->index_field.value)); - if (ACPI_FAILURE (status)) { - goto cleanup; + if (new_buffer) { + ACPI_MEM_FREE (new_buffer); } - /* Now read/write the data register */ - - status = acpi_ex_common_access_field (mode, obj_desc->index_field.data_obj, - buffer, buffer_length); - -cleanup: - /* - * Release global lock if we acquired it earlier - */ - acpi_ex_release_global_lock (locked); - return_ACPI_STATUS (status); } - -/******************************************************************************* - * - * FUNCTION: Acpi_ex_common_access_field - * - * PARAMETERS: Mode - ACPI_READ or ACPI_WRITE - * *Field_node - Parent node for field to be accessed - * *Buffer - Value(s) to be read or written - * Buffer_length - Size of buffer, in bytes. Must be large - * enough for all bits of the field. - * - * RETURN: Status - * - * DESCRIPTION: Read or write a named field - * - ******************************************************************************/ - -acpi_status -acpi_ex_common_access_field ( - u32 mode, - acpi_operand_object *obj_desc, - void *buffer, - u32 buffer_length) -{ - acpi_status status; - - - FUNCTION_TRACE_PTR ("Ex_common_access_field", obj_desc); - - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Obj=%p Type=%X Buf=%p Len=%X\n", - obj_desc, obj_desc->common.type, buffer, buffer_length)); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode=%d Bit_len=%X Bit_off=%X Byte_off=%X\n", - mode, obj_desc->common_field.bit_length, - obj_desc->common_field.start_field_bit_offset, - obj_desc->common_field.base_byte_offset)); - - - /* Perform the actual read or write of the field */ - - switch (mode) { - case ACPI_READ: - - status = acpi_ex_extract_from_field (obj_desc, buffer, buffer_length); - break; - - - case ACPI_WRITE: - - status = acpi_ex_insert_into_field (obj_desc, buffer, buffer_length); - break; - - - default: - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown I/O Mode: %X\n", mode)); - status = AE_BAD_PARAMETER; - break; - } - - - return_ACPI_STATUS (status); -} diff -urN linux-2.4.18/drivers/acpi/executer/exfldio.c lia64-2.4/drivers/acpi/executer/exfldio.c --- linux-2.4.18/drivers/acpi/executer/exfldio.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exfldio.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: exfldio - Aml Field I/O - * $Revision: 66 $ + * $Revision: 86 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,32 +27,31 @@ #include "acpi.h" #include "acinterp.h" #include "amlcode.h" -#include "acnamesp.h" -#include "achware.h" #include "acevents.h" #include "acdispat.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exfldio") + ACPI_MODULE_NAME ("exfldio") /******************************************************************************* * - * FUNCTION: Acpi_ex_setup_field + * FUNCTION: Acpi_ex_setup_region * - * PARAMETERS: *Obj_desc - Field to be read or written - * Field_datum_byte_offset - Current offset into the field + * PARAMETERS: *Obj_desc - Field to be read or written + * Field_datum_byte_offset - Byte offset of this datum within the + * parent field * * RETURN: Status * * DESCRIPTION: Common processing for Acpi_ex_extract_from_field and - * Acpi_ex_insert_into_field + * Acpi_ex_insert_into_field. Initialize the * ******************************************************************************/ acpi_status -acpi_ex_setup_field ( +acpi_ex_setup_region ( acpi_operand_object *obj_desc, u32 field_datum_byte_offset) { @@ -60,13 +59,13 @@ acpi_operand_object *rgn_desc; - FUNCTION_TRACE_U32 ("Ex_setup_field", field_datum_byte_offset); + ACPI_FUNCTION_TRACE_U32 ("Ex_setup_region", field_datum_byte_offset); rgn_desc = obj_desc->common_field.region_obj; if (ACPI_TYPE_REGION != rgn_desc->common.type) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %x %s\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %X (%s)\n", rgn_desc->common.type, acpi_ut_get_type_name (rgn_desc->common.type))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -76,7 +75,6 @@ * evaluate them now and save the results. */ if (!(rgn_desc->region.flags & AOPOBJ_DATA_VALID)) { - status = acpi_ds_get_region_arguments (rgn_desc); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); @@ -88,9 +86,9 @@ * length of one field datum (access width) must fit within the region. * (Region length is specified in bytes) */ - if (rgn_desc->region.length < (obj_desc->common_field.base_byte_offset + - field_datum_byte_offset + - obj_desc->common_field.access_byte_width)) { + if (rgn_desc->region.length < (obj_desc->common_field.base_byte_offset + + field_datum_byte_offset + + obj_desc->common_field.access_byte_width)) { if (rgn_desc->region.length < obj_desc->common_field.access_byte_width) { /* * This is the case where the Access_type (Acc_word, etc.) is wider @@ -98,8 +96,9 @@ * byte, and a field with Dword access specified. */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Field access width (%d bytes) too large for region size (%X)\n", - obj_desc->common_field.access_byte_width, rgn_desc->region.length)); + "Field [%4.4s] access width (%d bytes) too large for region [%4.4s] (length %X)\n", + obj_desc->common_field.node->name.ascii, obj_desc->common_field.access_byte_width, + rgn_desc->region.node->name.ascii, rgn_desc->region.length)); } /* @@ -107,10 +106,10 @@ * exceeds region length, indicate an error */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Field base+offset+width %X+%X+%X exceeds region size (%X bytes) field=%p region=%p\n", - obj_desc->common_field.base_byte_offset, field_datum_byte_offset, - obj_desc->common_field.access_byte_width, - rgn_desc->region.length, obj_desc, rgn_desc)); + "Field [%4.4s] Base+Offset+Width %X+%X+%X is beyond end of region [%4.4s] (length %X)\n", + obj_desc->common_field.node->name.ascii, obj_desc->common_field.base_byte_offset, + field_datum_byte_offset, obj_desc->common_field.access_byte_width, + rgn_desc->region.node->name.ascii, rgn_desc->region.length)); return_ACPI_STATUS (AE_AML_REGION_LIMIT); } @@ -121,116 +120,410 @@ /******************************************************************************* * - * FUNCTION: Acpi_ex_read_field_datum + * FUNCTION: Acpi_ex_access_region * - * PARAMETERS: *Obj_desc - Field to be read - * *Value - Where to store value (must be 32 bits) + * PARAMETERS: *Obj_desc - Field to be read + * Field_datum_byte_offset - Byte offset of this datum within the + * parent field + * *Value - Where to store value (must be 32 bits) + * Read_write - Read or Write flag * * RETURN: Status * - * DESCRIPTION: Retrieve the value of the given field + * DESCRIPTION: Read or Write a single field datum to an Operation Region. * ******************************************************************************/ acpi_status -acpi_ex_read_field_datum ( +acpi_ex_access_region ( acpi_operand_object *obj_desc, u32 field_datum_byte_offset, - u32 *value) + acpi_integer *value, + u32 read_write) { acpi_status status; acpi_operand_object *rgn_desc; ACPI_PHYSICAL_ADDRESS address; - u32 local_value; - FUNCTION_TRACE_U32 ("Ex_read_field_datum", field_datum_byte_offset); + ACPI_FUNCTION_TRACE ("Ex_access_region"); + + + /* + * The physical address of this field datum is: + * + * 1) The base of the region, plus + * 2) The base offset of the field, plus + * 3) The current offset into the field + */ + rgn_desc = obj_desc->common_field.region_obj; + address = rgn_desc->region.address + + obj_desc->common_field.base_byte_offset + + field_datum_byte_offset; + + if (read_write == ACPI_READ) { + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "[READ]")); + } + else { + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "[WRITE]")); + } + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_BFIELD, + " Region[%s-%X] Access %X Base:Off %X:%X at %8.8X%8.8X\n", + acpi_ut_get_region_name (rgn_desc->region.space_id), + rgn_desc->region.space_id, + obj_desc->common_field.access_byte_width, + obj_desc->common_field.base_byte_offset, + field_datum_byte_offset, + ACPI_HIDWORD (address), ACPI_LODWORD (address))); + + /* Invoke the appropriate Address_space/Op_region handler */ + + status = acpi_ev_address_space_dispatch (rgn_desc, read_write, + address, ACPI_MUL_8 (obj_desc->common_field.access_byte_width), value); + + if (ACPI_FAILURE (status)) { + if (status == AE_NOT_IMPLEMENTED) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Region %s(%X) not implemented\n", + acpi_ut_get_region_name (rgn_desc->region.space_id), + rgn_desc->region.space_id)); + } + + else if (status == AE_NOT_EXIST) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Region %s(%X) has no handler\n", + acpi_ut_get_region_name (rgn_desc->region.space_id), + rgn_desc->region.space_id)); + } + } + + return_ACPI_STATUS (status); +} + +/******************************************************************************* + * + * FUNCTION: Acpi_ex_register_overflow + * + * PARAMETERS: *Obj_desc - Register(Field) to be written + * Value - Value to be stored + * + * RETURN: TRUE if value overflows the field, FALSE otherwise + * + * DESCRIPTION: Check if a value is out of range of the field being written. + * Used to check if the values written to Index and Bank registers + * are out of range. Normally, the value is simply truncated + * to fit the field, but this case is most likely a serious + * coding error in the ASL. + * + ******************************************************************************/ + +u8 +acpi_ex_register_overflow ( + acpi_operand_object *obj_desc, + acpi_integer value) +{ - if (!value) { - local_value = 0; - value = &local_value; /* support reads without saving value */ + if (obj_desc->common_field.bit_length >= ACPI_INTEGER_BIT_SIZE) { + /* + * The field is large enough to hold the maximum integer, so we can + * never overflow it. + */ + return (FALSE); } - /* Clear the entire return buffer first, [Very Important!] */ + if (value >= ((acpi_integer) 1 << obj_desc->common_field.bit_length)) { + /* + * The Value is larger than the maximum value that can fit into + * the register. + */ + return (TRUE); + } + + /* The Value will fit into the field with no truncation */ + + return (FALSE); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ex_field_datum_io + * + * PARAMETERS: *Obj_desc - Field to be read + * Field_datum_byte_offset - Byte offset of this datum within the + * parent field + * *Value - Where to store value (must be 64 bits) + * Read_write - Read or Write flag + * + * RETURN: Status + * + * DESCRIPTION: Read or Write a single datum of a field. The Field_type is + * demultiplexed here to handle the different types of fields + * (Buffer_field, Region_field, Index_field, Bank_field) + * + ******************************************************************************/ + +acpi_status +acpi_ex_field_datum_io ( + acpi_operand_object *obj_desc, + u32 field_datum_byte_offset, + acpi_integer *value, + u32 read_write) +{ + acpi_status status; + acpi_integer local_value; + + + ACPI_FUNCTION_TRACE_U32 ("Ex_field_datum_io", field_datum_byte_offset); + + + if (read_write == ACPI_READ) { + if (!value) { + local_value = 0; + value = &local_value; /* To support reads without saving return value */ + } + + /* Clear the entire return buffer first, [Very Important!] */ - *value = 0; + *value = 0; + } /* - * Buffer_fields - Read from a Buffer - * Other Fields - Read from a Operation Region. + * The four types of fields are: + * + * Buffer_fields - Read/write from/to a Buffer + * Region_fields - Read/write from/to a Operation Region. + * Bank_fields - Write to a Bank Register, then read/write from/to an Op_region + * Index_fields - Write to an Index Register, then read/write from/to a Data Register */ switch (obj_desc->common.type) { case ACPI_TYPE_BUFFER_FIELD: - /* - * For Buffer_fields, we only need to copy the data from the - * source buffer. Length is the field width in bytes. + * If the Buffer_field arguments have not been previously evaluated, + * evaluate them now and save the results. */ - MEMCPY (value, (obj_desc->buffer_field.buffer_obj)->buffer.pointer - + obj_desc->buffer_field.base_byte_offset + field_datum_byte_offset, - obj_desc->common_field.access_byte_width); + if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) { + status = acpi_ds_get_buffer_field_arguments (obj_desc); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + } + + if (read_write == ACPI_READ) { + /* + * Copy the data from the source buffer. + * Length is the field width in bytes. + */ + ACPI_MEMCPY (value, (obj_desc->buffer_field.buffer_obj)->buffer.pointer + + obj_desc->buffer_field.base_byte_offset + + field_datum_byte_offset, + obj_desc->common_field.access_byte_width); + } + else { + /* + * Copy the data to the target buffer. + * Length is the field width in bytes. + */ + ACPI_MEMCPY ((obj_desc->buffer_field.buffer_obj)->buffer.pointer + + obj_desc->buffer_field.base_byte_offset + + field_datum_byte_offset, + value, obj_desc->common_field.access_byte_width); + } + status = AE_OK; break; - case INTERNAL_TYPE_REGION_FIELD: case INTERNAL_TYPE_BANK_FIELD: + /* Ensure that the Bank_value is not beyond the capacity of the register */ + + if (acpi_ex_register_overflow (obj_desc->bank_field.bank_obj, + (acpi_integer) obj_desc->bank_field.value)) { + return_ACPI_STATUS (AE_AML_REGISTER_LIMIT); + } + /* - * For other fields, we need to go through an Operation Region - * (Only types that will get here are Region_fields and Bank_fields) + * For Bank_fields, we must write the Bank_value to the Bank_register + * (itself a Region_field) before we can access the data. */ - status = acpi_ex_setup_field (obj_desc, field_datum_byte_offset); + status = acpi_ex_insert_into_field (obj_desc->bank_field.bank_obj, + &obj_desc->bank_field.value, + sizeof (obj_desc->bank_field.value)); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } /* - * The physical address of this field datum is: - * - * 1) The base of the region, plus - * 2) The base offset of the field, plus - * 3) The current offset into the field - */ - rgn_desc = obj_desc->common_field.region_obj; - address = rgn_desc->region.address + obj_desc->common_field.base_byte_offset + - field_datum_byte_offset; - - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Region %s(%X) width %X base:off %X:%X at %8.8X%8.8X\n", - acpi_ut_get_region_name (rgn_desc->region.space_id), - rgn_desc->region.space_id, obj_desc->common_field.access_bit_width, - obj_desc->common_field.base_byte_offset, field_datum_byte_offset, - HIDWORD(address), LODWORD(address))); + * Now that the Bank has been selected, fall through to the + * Region_field case and write the datum to the Operation Region + */ - /* Invoke the appropriate Address_space/Op_region handler */ + /*lint -fallthrough */ - status = acpi_ev_address_space_dispatch (rgn_desc, ACPI_READ_ADR_SPACE, - address, obj_desc->common_field.access_bit_width, value); - if (status == AE_NOT_IMPLEMENTED) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %s(%X) not implemented\n", - acpi_ut_get_region_name (rgn_desc->region.space_id), - rgn_desc->region.space_id)); + + case INTERNAL_TYPE_REGION_FIELD: + /* + * For simple Region_fields, we just directly access the owning + * Operation Region. + */ + status = acpi_ex_setup_region (obj_desc, field_datum_byte_offset); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } - else if (status == AE_NOT_EXIST) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %s(%X) has no handler\n", - acpi_ut_get_region_name (rgn_desc->region.space_id), - rgn_desc->region.space_id)); + status = acpi_ex_access_region (obj_desc, field_datum_byte_offset, value, + read_write); + break; + + + case INTERNAL_TYPE_INDEX_FIELD: + + + /* Ensure that the Index_value is not beyond the capacity of the register */ + + if (acpi_ex_register_overflow (obj_desc->index_field.index_obj, + (acpi_integer) obj_desc->index_field.value)) { + return_ACPI_STATUS (AE_AML_REGISTER_LIMIT); + } + + /* Write the index value to the Index_register (itself a Region_field) */ + + status = acpi_ex_insert_into_field (obj_desc->index_field.index_obj, + &obj_desc->index_field.value, + sizeof (obj_desc->index_field.value)); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + if (read_write == ACPI_READ) { + /* Read the datum from the Data_register */ + + status = acpi_ex_extract_from_field (obj_desc->index_field.data_obj, + value, obj_desc->common_field.access_byte_width); + } + else { + /* Write the datum to the Data register */ + + status = acpi_ex_insert_into_field (obj_desc->index_field.data_obj, + value, obj_desc->common_field.access_byte_width); } break; default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p, wrong source type - %s\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p, Wrong object type - %s\n", obj_desc, acpi_ut_get_type_name (obj_desc->common.type))); status = AE_AML_INTERNAL; break; } + if (ACPI_SUCCESS (status)) { + if (read_write == ACPI_READ) { + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Read=%8.8X%8.8X\n", + ACPI_HIDWORD (*value), ACPI_LODWORD (*value))); + } + else { + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Written=%8.8X%8.8X\n", + ACPI_HIDWORD (*value), ACPI_LODWORD (*value))); + } + } + + return_ACPI_STATUS (status); +} - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Returned value=%08X \n", *value)); + +/******************************************************************************* + * + * FUNCTION: Acpi_ex_write_with_update_rule + * + * PARAMETERS: *Obj_desc - Field to be set + * Value - Value to store + * + * RETURN: Status + * + * DESCRIPTION: Apply the field update rule to a field write + * + ******************************************************************************/ + +acpi_status +acpi_ex_write_with_update_rule ( + acpi_operand_object *obj_desc, + acpi_integer mask, + acpi_integer field_value, + u32 field_datum_byte_offset) +{ + acpi_status status = AE_OK; + acpi_integer merged_value; + acpi_integer current_value; + + + ACPI_FUNCTION_TRACE_U32 ("Ex_write_with_update_rule", mask); + + + /* Start with the new bits */ + + merged_value = field_value; + + /* If the mask is all ones, we don't need to worry about the update rule */ + + if (mask != ACPI_INTEGER_MAX) { + /* Decode the update rule */ + + switch (obj_desc->common_field.field_flags & AML_FIELD_UPDATE_RULE_MASK) { + case AML_FIELD_UPDATE_PRESERVE: + /* + * Check if update rule needs to be applied (not if mask is all + * ones) The left shift drops the bits we want to ignore. + */ + if ((~mask << (ACPI_MUL_8 (sizeof (mask)) - + ACPI_MUL_8 (obj_desc->common_field.access_byte_width))) != 0) { + /* + * Read the current contents of the byte/word/dword containing + * the field, and merge with the new field value. + */ + status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset, + ¤t_value, ACPI_READ); + merged_value |= (current_value & ~mask); + } + break; + + case AML_FIELD_UPDATE_WRITE_AS_ONES: + + /* Set positions outside the field to all ones */ + + merged_value |= ~mask; + break; + + case AML_FIELD_UPDATE_WRITE_AS_ZEROS: + + /* Set positions outside the field to all zeros */ + + merged_value &= mask; + break; + + default: + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Write_with_update_rule: Unknown Update_rule setting: %X\n", + (obj_desc->common_field.field_flags & AML_FIELD_UPDATE_RULE_MASK))); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); + } + } + + /* Write the merged value */ + + status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset, + &merged_value, ACPI_WRITE); + + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Mask %8.8X%8.8X Datum_offset %X Value %8.8X%8.8X, Merged_value %8.8X%8.8X\n", + ACPI_HIDWORD (mask), ACPI_LODWORD (mask), + field_datum_byte_offset, + ACPI_HIDWORD (field_value), ACPI_LODWORD (field_value), + ACPI_HIDWORD (merged_value),ACPI_LODWORD (merged_value))); return_ACPI_STATUS (status); } @@ -240,41 +533,53 @@ * * FUNCTION: Acpi_ex_get_buffer_datum * - * PARAMETERS: Merged_datum - Value to store - * Buffer - Receiving buffer - * Byte_granularity - 1/2/4 Granularity of the field + * PARAMETERS: Datum - Where the Datum is returned + * Buffer - Raw field buffer + * Byte_granularity - 1/2/4/8 Granularity of the field * (aka Datum Size) * Offset - Datum offset into the buffer * * RETURN: none * - * DESCRIPTION: Store the merged datum to the buffer according to the + * DESCRIPTION: Get a datum from the buffer according to the buffer field * byte granularity * ******************************************************************************/ -static void +void acpi_ex_get_buffer_datum( - u32 *datum, + acpi_integer *datum, void *buffer, u32 byte_granularity, u32 offset) { - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); switch (byte_granularity) { case ACPI_FIELD_BYTE_GRANULARITY: + *datum = ((u8 *) buffer) [offset]; break; case ACPI_FIELD_WORD_GRANULARITY: - MOVE_UNALIGNED16_TO_32 (datum, &(((u16 *) buffer) [offset])); + + ACPI_MOVE_UNALIGNED16_TO_32 (datum, &(((u16 *) buffer) [offset])); break; case ACPI_FIELD_DWORD_GRANULARITY: - MOVE_UNALIGNED32_TO_32 (datum, &(((u32 *) buffer) [offset])); + + ACPI_MOVE_UNALIGNED32_TO_32 (datum, &(((u32 *) buffer) [offset])); + break; + + case ACPI_FIELD_QWORD_GRANULARITY: + + ACPI_MOVE_UNALIGNED64_TO_64 (datum, &(((u64 *) buffer) [offset])); + break; + + default: + /* Should not get here */ break; } } @@ -286,7 +591,7 @@ * * PARAMETERS: Merged_datum - Value to store * Buffer - Receiving buffer - * Byte_granularity - 1/2/4 Granularity of the field + * Byte_granularity - 1/2/4/8 Granularity of the field * (aka Datum Size) * Offset - Datum offset into the buffer * @@ -297,28 +602,40 @@ * ******************************************************************************/ -static void +void acpi_ex_set_buffer_datum ( - u32 merged_datum, + acpi_integer merged_datum, void *buffer, u32 byte_granularity, u32 offset) { - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); switch (byte_granularity) { case ACPI_FIELD_BYTE_GRANULARITY: + ((u8 *) buffer) [offset] = (u8) merged_datum; break; case ACPI_FIELD_WORD_GRANULARITY: - MOVE_UNALIGNED16_TO_16 (&(((u16 *) buffer)[offset]), &merged_datum); + + ACPI_MOVE_UNALIGNED16_TO_16 (&(((u16 *) buffer)[offset]), &merged_datum); break; case ACPI_FIELD_DWORD_GRANULARITY: - MOVE_UNALIGNED32_TO_32 (&(((u32 *) buffer)[offset]), &merged_datum); + + ACPI_MOVE_UNALIGNED32_TO_32 (&(((u32 *) buffer)[offset]), &merged_datum); + break; + + case ACPI_FIELD_QWORD_GRANULARITY: + + ACPI_MOVE_UNALIGNED64_TO_64 (&(((u64 *) buffer)[offset]), &merged_datum); + break; + + default: + /* Should not get here */ break; } } @@ -346,22 +663,23 @@ acpi_status status; u32 field_datum_byte_offset; u32 datum_offset; - u32 previous_raw_datum; - u32 this_raw_datum = 0; - u32 merged_datum = 0; + acpi_integer previous_raw_datum; + acpi_integer this_raw_datum = 0; + acpi_integer merged_datum = 0; u32 byte_field_length; u32 datum_count; - FUNCTION_TRACE ("Ex_extract_from_field"); + ACPI_FUNCTION_TRACE ("Ex_extract_from_field"); /* * The field must fit within the caller's buffer */ - byte_field_length = ROUND_BITS_UP_TO_BYTES (obj_desc->common_field.bit_length); + byte_field_length = ACPI_ROUND_BITS_UP_TO_BYTES (obj_desc->common_field.bit_length); if (byte_field_length > buffer_length) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Field size %X (bytes) too large for buffer (%X)\n", + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Field size %X (bytes) too large for buffer (%X)\n", byte_field_length, buffer_length)); return_ACPI_STATUS (AE_BUFFER_OVERFLOW); @@ -369,26 +687,27 @@ /* Convert field byte count to datum count, round up if necessary */ - datum_count = ROUND_UP_TO (byte_field_length, obj_desc->common_field.access_byte_width); + datum_count = ACPI_ROUND_UP_TO (byte_field_length, + obj_desc->common_field.access_byte_width); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Byte_len=%x, Datum_len=%x, Bit_gran=%x, Byte_gran=%x\n", - byte_field_length, datum_count, obj_desc->common_field.access_bit_width, - obj_desc->common_field.access_byte_width)); + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Byte_len=%X, Datum_len=%X, Byte_gran=%X\n", + byte_field_length, datum_count,obj_desc->common_field.access_byte_width)); /* * Clear the caller's buffer (the whole buffer length as given) * This is very important, especially in the cases where a byte is read, * but the buffer is really a u32 (4 bytes). */ - MEMSET (buffer, 0, buffer_length); + ACPI_MEMSET (buffer, 0, buffer_length); /* Read the first raw datum to prime the loop */ field_datum_byte_offset = 0; datum_offset= 0; - status = acpi_ex_read_field_datum (obj_desc, field_datum_byte_offset, &previous_raw_datum); + status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset, + &previous_raw_datum, ACPI_READ); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -397,7 +716,7 @@ /* We might actually be done if the request fits in one datum */ if ((datum_count == 1) && - (obj_desc->common_field.access_flags & AFIELD_SINGLE_DATUM)) { + (obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM)) { /* 1) Shift the valid data bits down to start at bit 0 */ merged_datum = (previous_raw_datum >> obj_desc->common_field.start_field_bit_offset); @@ -405,7 +724,7 @@ /* 2) Mask off any upper unused bits (bits not part of the field) */ if (obj_desc->common_field.end_buffer_valid_bits) { - merged_datum &= MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits); + merged_datum &= ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits); } /* Store the datum to the caller buffer */ @@ -427,17 +746,18 @@ * to perform a final read, since this would potentially read * past the end of the region. * - * TBD: [Investigate] It may make more sense to just split the aligned - * and non-aligned cases since the aligned case is so very simple, + * We could just split the aligned and non-aligned cases since the + * aligned case is so very simple, but this would require more code. */ - if ((obj_desc->common_field.start_field_bit_offset != 0) || + if ((obj_desc->common_field.start_field_bit_offset != 0) || ((obj_desc->common_field.start_field_bit_offset == 0) && (datum_offset < (datum_count -1)))) { /* * Get the next raw datum, it contains some or all bits * of the current field datum */ - status = acpi_ex_read_field_datum (obj_desc, field_datum_byte_offset, &this_raw_datum); + status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset, + &this_raw_datum, ACPI_READ); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -451,7 +771,6 @@ merged_datum = previous_raw_datum; } - else { /* * Put together the appropriate bits of the two raw data to make a @@ -474,7 +793,7 @@ */ if (obj_desc->common_field.end_buffer_valid_bits) { merged_datum &= - MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits); + ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits); } } } @@ -483,8 +802,8 @@ * Store the merged field datum in the caller's buffer, according to * the granularity of the field (size of each datum). */ - acpi_ex_set_buffer_datum (merged_datum, buffer, obj_desc->common_field.access_byte_width, - datum_offset); + acpi_ex_set_buffer_datum (merged_datum, buffer, + obj_desc->common_field.access_byte_width, datum_offset); /* * Save the raw datum that was just acquired since it may contain bits @@ -500,211 +819,6 @@ /******************************************************************************* * - * FUNCTION: Acpi_ex_write_field_datum - * - * PARAMETERS: *Obj_desc - Field to be set - * Value - Value to store - * - * RETURN: Status - * - * DESCRIPTION: Store the value into the given field - * - ******************************************************************************/ - -static acpi_status -acpi_ex_write_field_datum ( - acpi_operand_object *obj_desc, - u32 field_datum_byte_offset, - u32 value) -{ - acpi_status status = AE_OK; - acpi_operand_object *rgn_desc = NULL; - ACPI_PHYSICAL_ADDRESS address; - - - FUNCTION_TRACE_U32 ("Ex_write_field_datum", field_datum_byte_offset); - - - /* - * Buffer_fields - Read from a Buffer - * Other Fields - Read from a Operation Region. - */ - switch (obj_desc->common.type) { - case ACPI_TYPE_BUFFER_FIELD: - - /* - * For Buffer_fields, we only need to copy the data to the - * target buffer. Length is the field width in bytes. - */ - MEMCPY ((obj_desc->buffer_field.buffer_obj)->buffer.pointer - + obj_desc->buffer_field.base_byte_offset + field_datum_byte_offset, - &value, obj_desc->common_field.access_byte_width); - status = AE_OK; - break; - - - case INTERNAL_TYPE_REGION_FIELD: - case INTERNAL_TYPE_BANK_FIELD: - - /* - * For other fields, we need to go through an Operation Region - * (Only types that will get here are Region_fields and Bank_fields) - */ - status = acpi_ex_setup_field (obj_desc, field_datum_byte_offset); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - - /* - * The physical address of this field datum is: - * - * 1) The base of the region, plus - * 2) The base offset of the field, plus - * 3) The current offset into the field - */ - rgn_desc = obj_desc->common_field.region_obj; - address = rgn_desc->region.address + - obj_desc->common_field.base_byte_offset + - field_datum_byte_offset; - - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "Store %X in Region %s(%X) at %8.8X%8.8X width %X\n", - value, acpi_ut_get_region_name (rgn_desc->region.space_id), - rgn_desc->region.space_id, HIDWORD(address), LODWORD(address), - obj_desc->common_field.access_bit_width)); - - /* Invoke the appropriate Address_space/Op_region handler */ - - status = acpi_ev_address_space_dispatch (rgn_desc, ACPI_WRITE_ADR_SPACE, - address, obj_desc->common_field.access_bit_width, &value); - - if (status == AE_NOT_IMPLEMENTED) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "**** Region type %s(%X) not implemented\n", - acpi_ut_get_region_name (rgn_desc->region.space_id), - rgn_desc->region.space_id)); - } - - else if (status == AE_NOT_EXIST) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "**** Region type %s(%X) does not have a handler\n", - acpi_ut_get_region_name (rgn_desc->region.space_id), - rgn_desc->region.space_id)); - } - - break; - - - default: - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p, wrong source type - %s\n", - obj_desc, acpi_ut_get_type_name (obj_desc->common.type))); - status = AE_AML_INTERNAL; - break; - } - - - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value written=%08X \n", value)); - return_ACPI_STATUS (status); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_ex_write_field_datum_with_update_rule - * - * PARAMETERS: *Obj_desc - Field to be set - * Value - Value to store - * - * RETURN: Status - * - * DESCRIPTION: Apply the field update rule to a field write - * - ******************************************************************************/ - -static acpi_status -acpi_ex_write_field_datum_with_update_rule ( - acpi_operand_object *obj_desc, - u32 mask, - u32 field_value, - u32 field_datum_byte_offset) -{ - acpi_status status = AE_OK; - u32 merged_value; - u32 current_value; - - - FUNCTION_TRACE ("Ex_write_field_datum_with_update_rule"); - - - /* Start with the new bits */ - - merged_value = field_value; - - /* If the mask is all ones, we don't need to worry about the update rule */ - - if (mask != ACPI_UINT32_MAX) { - /* Decode the update rule */ - - switch (obj_desc->common_field.update_rule) { - case UPDATE_PRESERVE: - /* - * Check if update rule needs to be applied (not if mask is all - * ones) The left shift drops the bits we want to ignore. - */ - if ((~mask << (sizeof (mask) * 8 - - obj_desc->common_field.access_bit_width)) != 0) { - /* - * Read the current contents of the byte/word/dword containing - * the field, and merge with the new field value. - */ - status = acpi_ex_read_field_datum (obj_desc, field_datum_byte_offset, - ¤t_value); - merged_value |= (current_value & ~mask); - } - break; - - - case UPDATE_WRITE_AS_ONES: - - /* Set positions outside the field to all ones */ - - merged_value |= ~mask; - break; - - - case UPDATE_WRITE_AS_ZEROS: - - /* Set positions outside the field to all zeros */ - - merged_value &= mask; - break; - - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Write_with_update_rule: Unknown Update_rule setting: %x\n", - obj_desc->common_field.update_rule)); - return_ACPI_STATUS (AE_AML_OPERAND_VALUE); - break; - } - } - - - /* Write the merged value */ - - status = acpi_ex_write_field_datum (obj_desc, field_datum_byte_offset, - merged_value); - - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Mask %X Datum_offset %X Value %X, Merged_value %X\n", - mask, field_datum_byte_offset, field_value, merged_value)); - - return_ACPI_STATUS (status); -} - - -/******************************************************************************* - * * FUNCTION: Acpi_ex_insert_into_field * * PARAMETERS: *Obj_desc - Field to be set @@ -725,15 +839,15 @@ acpi_status status; u32 field_datum_byte_offset; u32 datum_offset; - u32 mask; - u32 merged_datum; - u32 previous_raw_datum; - u32 this_raw_datum; + acpi_integer mask; + acpi_integer merged_datum; + acpi_integer previous_raw_datum; + acpi_integer this_raw_datum; u32 byte_field_length; u32 datum_count; - FUNCTION_TRACE ("Ex_insert_into_field"); + ACPI_FUNCTION_TRACE ("Ex_insert_into_field"); /* @@ -742,24 +856,21 @@ * larger than the field, this typically happens when an integer is * written to a field that is actually smaller than an integer. */ - byte_field_length = ROUND_BITS_UP_TO_BYTES (obj_desc->common_field.bit_length); + byte_field_length = ACPI_ROUND_BITS_UP_TO_BYTES (obj_desc->common_field.bit_length); if (buffer_length < byte_field_length) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Buffer length %X too small for field %X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Buffer length %X too small for field %X\n", buffer_length, byte_field_length)); - /* TBD: Need a better error code */ - return_ACPI_STATUS (AE_BUFFER_OVERFLOW); } /* Convert byte count to datum count, round up if necessary */ - datum_count = ROUND_UP_TO (byte_field_length, obj_desc->common_field.access_byte_width); + datum_count = ACPI_ROUND_UP_TO (byte_field_length, obj_desc->common_field.access_byte_width); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Byte_len=%x, Datum_len=%x, Bit_gran=%x, Byte_gran=%x\n", - byte_field_length, datum_count, obj_desc->common_field.access_bit_width, - obj_desc->common_field.access_byte_width)); + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Byte_len=%X, Datum_len=%X, Byte_gran=%X\n", + byte_field_length, datum_count, obj_desc->common_field.access_byte_width)); /* * Break the request into up to three parts (similar to an I/O request): @@ -785,15 +896,15 @@ * * Mask off bits that are "below" the field (if any) */ - mask = MASK_BITS_BELOW (obj_desc->common_field.start_field_bit_offset); + mask = ACPI_MASK_BITS_BELOW (obj_desc->common_field.start_field_bit_offset); /* If the field fits in one datum, may need to mask upper bits */ - if ((obj_desc->common_field.access_flags & AFIELD_SINGLE_DATUM) && + if ((obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM) && obj_desc->common_field.end_field_valid_bits) { /* There are bits above the field, mask them off also */ - mask &= MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits); + mask &= ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits); } /* Shift and mask the value into the field position */ @@ -803,7 +914,7 @@ /* Apply the update rule (if necessary) and write the datum to the field */ - status = acpi_ex_write_field_datum_with_update_rule (obj_desc, mask, merged_datum, + status = acpi_ex_write_with_update_rule (obj_desc, mask, merged_datum, field_datum_byte_offset); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); @@ -812,7 +923,7 @@ /* If the entire field fits within one datum, we are done. */ if ((datum_count == 1) && - (obj_desc->common_field.access_flags & AFIELD_SINGLE_DATUM)) { + (obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM)) { return_ACPI_STATUS (AE_OK); } @@ -849,7 +960,6 @@ (previous_raw_datum >> obj_desc->common_field.datum_valid_bits) | (this_raw_datum << obj_desc->common_field.start_field_bit_offset); } - else { /* Field began aligned on datum boundary */ @@ -874,24 +984,23 @@ * * Mask off the unused bits above (after) the end-of-field */ - mask = MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits); + mask = ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits); merged_datum &= mask; /* Write the last datum with the update rule */ - status = acpi_ex_write_field_datum_with_update_rule (obj_desc, mask, - merged_datum, field_datum_byte_offset); + status = acpi_ex_write_with_update_rule (obj_desc, mask, merged_datum, + field_datum_byte_offset); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } } } - else { /* Normal case -- write the completed datum */ - status = acpi_ex_write_field_datum (obj_desc, - field_datum_byte_offset, merged_datum); + status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset, + &merged_datum, ACPI_WRITE); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/executer/exmisc.c lia64-2.4/drivers/acpi/executer/exmisc.c --- linux-2.4.18/drivers/acpi/executer/exmisc.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exmisc.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes - * $Revision: 92 $ + * $Revision: 105 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,14 +26,13 @@ #include "acpi.h" -#include "acparser.h" #include "acinterp.h" #include "amlcode.h" #include "acdispat.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exmisc") + ACPI_MODULE_NAME ("exmisc") /******************************************************************************* @@ -59,10 +58,12 @@ acpi_status status = AE_OK; - FUNCTION_TRACE_PTR ("Ex_get_object_reference", obj_desc); + ACPI_FUNCTION_TRACE_PTR ("Ex_get_object_reference", obj_desc); - if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_INTERNAL)) { + switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) { + case ACPI_DESC_TYPE_OPERAND: + if (obj_desc->common.type != INTERNAL_TYPE_REFERENCE) { *return_desc = NULL; status = AE_TYPE; @@ -77,8 +78,9 @@ case AML_LOCAL_OP: case AML_ARG_OP: - *return_desc = (void *) acpi_ds_method_data_get_node (obj_desc->reference.opcode, - obj_desc->reference.offset, walk_state); + status = acpi_ds_method_data_get_node (obj_desc->reference.opcode, + obj_desc->reference.offset, walk_state, + ACPI_CAST_INDIRECT_PTR (acpi_namespace_node, return_desc)); break; default: @@ -89,18 +91,22 @@ status = AE_AML_INTERNAL; goto cleanup; } + break; - } - else if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) { + case ACPI_DESC_TYPE_NAMED: + /* Must be a named object; Just return the Node */ *return_desc = obj_desc; - } + break; + + + default: - else { *return_desc = NULL; status = AE_TYPE; + break; } @@ -113,7 +119,7 @@ /******************************************************************************* * - * FUNCTION: Acpi_ex_do_concatenate + * FUNCTION: Acpi_ex_concat_template * * PARAMETERS: *Obj_desc - Object to be converted. Must be an * Integer, Buffer, or String @@ -121,13 +127,106 @@ * * RETURN: Status * + * DESCRIPTION: Concatenate two resource templates + * + ******************************************************************************/ + +acpi_status +acpi_ex_concat_template ( + acpi_operand_object *obj_desc1, + acpi_operand_object *obj_desc2, + acpi_operand_object **actual_return_desc, + acpi_walk_state *walk_state) +{ + acpi_status status; + acpi_operand_object *return_desc; + NATIVE_CHAR *new_buf; + u8 *end_tag1; + u8 *end_tag2; + ACPI_SIZE length1; + ACPI_SIZE length2; + + + ACPI_FUNCTION_TRACE ("Ex_concat_template"); + + + /* Find the End_tags in each resource template */ + + end_tag1 = acpi_ut_get_resource_end_tag (obj_desc1); + end_tag2 = acpi_ut_get_resource_end_tag (obj_desc2); + if (!end_tag1 || !end_tag2) { + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); + } + + /* Create a new buffer object for the result */ + + return_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER); + if (!return_desc) { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + /* Allocate a new buffer for the result */ + + length1 = ACPI_PTR_DIFF (end_tag1, obj_desc1->buffer.pointer); + length2 = ACPI_PTR_DIFF (end_tag2, obj_desc2->buffer.pointer) + + 2; /* Size of END_TAG */ + + new_buf = ACPI_MEM_ALLOCATE (length1 + length2); + if (!new_buf) { + ACPI_REPORT_ERROR + (("Ex_concat_template: Buffer allocation failure\n")); + status = AE_NO_MEMORY; + goto cleanup; + } + + /* Copy the templates to the new descriptor */ + + ACPI_MEMCPY (new_buf, obj_desc1->buffer.pointer, length1); + ACPI_MEMCPY (new_buf + length1, obj_desc2->buffer.pointer, length2); + + /* Complete the buffer object initialization */ + + return_desc->common.flags = AOPOBJ_DATA_VALID; + return_desc->buffer.pointer = (u8 *) new_buf; + return_desc->buffer.length = (u32) (length1 + length2); + + /* Compute the new checksum */ + + new_buf[return_desc->buffer.length - 1] = (NATIVE_CHAR) + acpi_ut_generate_checksum (return_desc->buffer.pointer, + (return_desc->buffer.length - 1)); + + /* Return the completed template descriptor */ + + *actual_return_desc = return_desc; + return_ACPI_STATUS (AE_OK); + + +cleanup: + + acpi_ut_remove_reference (return_desc); + return_ACPI_STATUS (status); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ex_do_concatenate + * + * PARAMETERS: Obj_desc1 - First source object + * Obj_desc2 - Second source object + * Actual_return_desc - Where to place the return object + * Walk_state - Current walk state + * + * RETURN: Status + * * DESCRIPTION: Concatenate two objects OF THE SAME TYPE. * ******************************************************************************/ acpi_status acpi_ex_do_concatenate ( - acpi_operand_object *obj_desc, + acpi_operand_object *obj_desc1, acpi_operand_object *obj_desc2, acpi_operand_object **actual_return_desc, acpi_walk_state *walk_state) @@ -137,73 +236,66 @@ acpi_integer this_integer; acpi_operand_object *return_desc; NATIVE_CHAR *new_buf; - u32 integer_size = sizeof (acpi_integer); - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* * There are three cases to handle: - * 1) Two Integers concatenated to produce a buffer - * 2) Two Strings concatenated to produce a string - * 3) Two Buffers concatenated to produce a buffer + * + * 1) Two Integers concatenated to produce a new Buffer + * 2) Two Strings concatenated to produce a new String + * 3) Two Buffers concatenated to produce a new Buffer */ - switch (obj_desc->common.type) { + switch (obj_desc1->common.type) { case ACPI_TYPE_INTEGER: - /* Handle both ACPI 1.0 and ACPI 2.0 Integer widths */ - - if (walk_state->method_node->flags & ANOBJ_DATA_WIDTH_32) { - /* - * We are running a method that exists in a 32-bit ACPI table. - * Truncate the value to 32 bits by zeroing out the upper - * 32-bit field - */ - integer_size = sizeof (u32); - } - - /* Result of two integers is a buffer */ + /* Result of two Integers is a Buffer */ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER); if (!return_desc) { return (AE_NO_MEMORY); } - /* Need enough space for two integers */ + /* Need enough buffer space for two integers */ - return_desc->buffer.length = integer_size * 2; + return_desc->buffer.length = acpi_gbl_integer_byte_width * 2; new_buf = ACPI_MEM_CALLOCATE (return_desc->buffer.length); if (!new_buf) { - REPORT_ERROR + ACPI_REPORT_ERROR (("Ex_do_concatenate: Buffer allocation failure\n")); status = AE_NO_MEMORY; goto cleanup; } - return_desc->buffer.pointer = (u8 *) new_buf; - /* Convert the first integer */ - this_integer = obj_desc->integer.value; - for (i = 0; i < integer_size; i++) { - new_buf[i] = (u8) this_integer; + this_integer = obj_desc1->integer.value; + for (i = 0; i < acpi_gbl_integer_byte_width; i++) { + new_buf[i] = (NATIVE_CHAR) this_integer; this_integer >>= 8; } /* Convert the second integer */ this_integer = obj_desc2->integer.value; - for (; i < (integer_size * 2); i++) { - new_buf[i] = (u8) this_integer; + for (; i < (ACPI_MUL_2 (acpi_gbl_integer_byte_width)); i++) { + new_buf[i] = (NATIVE_CHAR) this_integer; this_integer >>= 8; } + /* Complete the buffer object initialization */ + + return_desc->common.flags = AOPOBJ_DATA_VALID; + return_desc->buffer.pointer = (u8 *) new_buf; break; case ACPI_TYPE_STRING: + /* Result of two Strings is a String */ + return_desc = acpi_ut_create_internal_object (ACPI_TYPE_STRING); if (!return_desc) { return (AE_NO_MEMORY); @@ -211,66 +303,71 @@ /* Operand0 is string */ - new_buf = ACPI_MEM_ALLOCATE (obj_desc->string.length + - obj_desc2->string.length + 1); + new_buf = ACPI_MEM_ALLOCATE ((ACPI_SIZE) obj_desc1->string.length + + (ACPI_SIZE) obj_desc2->string.length + 1); if (!new_buf) { - REPORT_ERROR + ACPI_REPORT_ERROR (("Ex_do_concatenate: String allocation failure\n")); status = AE_NO_MEMORY; goto cleanup; } - STRCPY (new_buf, obj_desc->string.pointer); - STRCPY (new_buf + obj_desc->string.length, + /* Concatenate the strings */ + + ACPI_STRCPY (new_buf, obj_desc1->string.pointer); + ACPI_STRCPY (new_buf + obj_desc1->string.length, obj_desc2->string.pointer); - /* Point the return object to the new string */ + /* Complete the String object initialization */ return_desc->string.pointer = new_buf; - return_desc->string.length = obj_desc->string.length += - obj_desc2->string.length; + return_desc->string.length = obj_desc1->string.length + + obj_desc2->string.length; break; case ACPI_TYPE_BUFFER: - /* Operand0 is a buffer */ + /* Result of two Buffers is a Buffer */ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER); if (!return_desc) { return (AE_NO_MEMORY); } - new_buf = ACPI_MEM_ALLOCATE (obj_desc->buffer.length + - obj_desc2->buffer.length); + new_buf = ACPI_MEM_ALLOCATE ((ACPI_SIZE) obj_desc1->buffer.length + + (ACPI_SIZE) obj_desc2->buffer.length); if (!new_buf) { - REPORT_ERROR + ACPI_REPORT_ERROR (("Ex_do_concatenate: Buffer allocation failure\n")); status = AE_NO_MEMORY; goto cleanup; } - MEMCPY (new_buf, obj_desc->buffer.pointer, - obj_desc->buffer.length); - MEMCPY (new_buf + obj_desc->buffer.length, obj_desc2->buffer.pointer, + /* Concatenate the buffers */ + + ACPI_MEMCPY (new_buf, obj_desc1->buffer.pointer, + obj_desc1->buffer.length); + ACPI_MEMCPY (new_buf + obj_desc1->buffer.length, obj_desc2->buffer.pointer, obj_desc2->buffer.length); - /* - * Point the return object to the new buffer - */ + /* Complete the buffer object initialization */ - return_desc->buffer.pointer = (u8 *) new_buf; - return_desc->buffer.length = obj_desc->buffer.length + - obj_desc2->buffer.length; + return_desc->common.flags = AOPOBJ_DATA_VALID; + return_desc->buffer.pointer = (u8 *) new_buf; + return_desc->buffer.length = obj_desc1->buffer.length + + obj_desc2->buffer.length; break; default: + + /* Invalid object type, should not happen here */ + status = AE_AML_INTERNAL; return_desc = NULL; } - *actual_return_desc = return_desc; return (AE_OK); @@ -288,7 +385,7 @@ * * PARAMETERS: Opcode - AML opcode * Operand0 - Integer operand #0 - * Operand0 - Integer operand #1 + * Operand1 - Integer operand #1 * * RETURN: Integer result of the operation * @@ -369,7 +466,7 @@ * * PARAMETERS: Opcode - AML opcode * Operand0 - Integer operand #0 - * Operand0 - Integer operand #1 + * Operand1 - Integer operand #1 * * RETURN: TRUE/FALSE result of the operation * @@ -431,6 +528,9 @@ if (operand0 || operand1) { return (TRUE); } + break; + + default: break; } diff -urN linux-2.4.18/drivers/acpi/executer/exmutex.c lia64-2.4/drivers/acpi/executer/exmutex.c --- linux-2.4.18/drivers/acpi/executer/exmutex.c Mon Sep 24 15:06:41 2001 +++ lia64-2.4/drivers/acpi/executer/exmutex.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exmutex - ASL Mutex Acquire/Release functions - * $Revision: 7 $ + * $Revision: 13 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,12 +27,9 @@ #include "acpi.h" #include "acinterp.h" -#include "acnamesp.h" -#include "achware.h" -#include "acevents.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exmutex") + ACPI_MODULE_NAME ("exmutex") /******************************************************************************* @@ -51,13 +48,23 @@ acpi_ex_unlink_mutex ( acpi_operand_object *obj_desc) { + ACPI_THREAD_STATE *thread = obj_desc->mutex.owner_thread; + + + if (!thread) { + return; + } if (obj_desc->mutex.next) { (obj_desc->mutex.next)->mutex.prev = obj_desc->mutex.prev; } + if (obj_desc->mutex.prev) { (obj_desc->mutex.prev)->mutex.next = obj_desc->mutex.next; } + else { + thread->acquired_mutex_list = obj_desc->mutex.next; + } } @@ -77,23 +84,27 @@ void acpi_ex_link_mutex ( acpi_operand_object *obj_desc, - acpi_operand_object *list_head) + ACPI_THREAD_STATE *thread) { + acpi_operand_object *list_head; + + + list_head = thread->acquired_mutex_list; /* This object will be the first object in the list */ - obj_desc->mutex.prev = list_head; - obj_desc->mutex.next = list_head->mutex.next; + obj_desc->mutex.prev = NULL; + obj_desc->mutex.next = list_head; /* Update old first object to point back to this object */ - if (list_head->mutex.next) { - (list_head->mutex.next)->mutex.prev = obj_desc; + if (list_head) { + list_head->mutex.prev = obj_desc; } /* Update list head */ - list_head->mutex.next = obj_desc; + thread->acquired_mutex_list = obj_desc; } @@ -119,7 +130,7 @@ acpi_status status; - FUNCTION_TRACE_PTR ("Ex_acquire_mutex", obj_desc); + ACPI_FUNCTION_TRACE_PTR ("Ex_acquire_mutex", obj_desc); if (!obj_desc) { return_ACPI_STATUS (AE_BAD_PARAMETER); @@ -129,15 +140,18 @@ * Current Sync must be less than or equal to the sync level of the * mutex. This mechanism provides some deadlock prevention */ - if (walk_state->current_sync_level > obj_desc->mutex.sync_level) { + if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) { return_ACPI_STATUS (AE_AML_MUTEX_ORDER); } /* - * If the mutex is already owned by this thread, - * just increment the acquisition depth + * Support for multiple acquires by the owning thread */ - if (obj_desc->mutex.owner == walk_state) { + if (obj_desc->mutex.owner_thread == walk_state->thread) { + /* + * The mutex is already owned by this thread, + * just increment the acquisition depth + */ obj_desc->mutex.acquisition_depth++; return_ACPI_STATUS (AE_OK); } @@ -153,14 +167,14 @@ /* Have the mutex, update mutex and walk info */ - obj_desc->mutex.owner = walk_state; + obj_desc->mutex.owner_thread = walk_state->thread; obj_desc->mutex.acquisition_depth = 1; - walk_state->current_sync_level = obj_desc->mutex.sync_level; - /* Link the mutex to the walk state for force-unlock at method exit */ + walk_state->thread->current_sync_level = obj_desc->mutex.sync_level; + + /* Link the mutex to the current thread for force-unlock at method exit */ - acpi_ex_link_mutex (obj_desc, (acpi_operand_object *) - &(walk_state->walk_list->acquired_mutex_list)); + acpi_ex_link_mutex (obj_desc, walk_state->thread); return_ACPI_STATUS (AE_OK); } @@ -186,7 +200,7 @@ acpi_status status; - FUNCTION_TRACE ("Ex_release_mutex"); + ACPI_FUNCTION_TRACE ("Ex_release_mutex"); if (!obj_desc) { @@ -195,13 +209,13 @@ /* The mutex must have been previously acquired in order to release it */ - if (!obj_desc->mutex.owner) { + if (!obj_desc->mutex.owner_thread) { return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED); } /* The Mutex is owned, but this thread must be the owner */ - if (obj_desc->mutex.owner != walk_state) { + if (obj_desc->mutex.owner_thread != walk_state->thread) { return_ACPI_STATUS (AE_AML_NOT_OWNER); } @@ -209,7 +223,7 @@ * The sync level of the mutex must be less than or * equal to the current sync level */ - if (obj_desc->mutex.sync_level > walk_state->current_sync_level) { + if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) { return_ACPI_STATUS (AE_AML_MUTEX_ORDER); } @@ -223,6 +237,9 @@ return_ACPI_STATUS (AE_OK); } + /* Unlink the mutex from the owner's list */ + + acpi_ex_unlink_mutex (obj_desc); /* Release the mutex */ @@ -230,12 +247,8 @@ /* Update the mutex and walk state */ - obj_desc->mutex.owner = NULL; - walk_state->current_sync_level = obj_desc->mutex.sync_level; - - /* Unlink the mutex from the owner's list */ - - acpi_ex_unlink_mutex (obj_desc); + obj_desc->mutex.owner_thread = NULL; + walk_state->thread->current_sync_level = obj_desc->mutex.sync_level; return_ACPI_STATUS (status); } @@ -253,15 +266,16 @@ * ******************************************************************************/ -acpi_status +void acpi_ex_release_all_mutexes ( - acpi_operand_object *list_head) + ACPI_THREAD_STATE *thread) { - acpi_operand_object *next = list_head->mutex.next; + acpi_operand_object *next = thread->acquired_mutex_list; acpi_operand_object *this; + acpi_status status; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* @@ -271,19 +285,21 @@ this = next; next = this->mutex.next; - /* Mark mutex un-owned */ - - this->mutex.owner = NULL; - this->mutex.prev = NULL; - this->mutex.next = NULL; - this->mutex.acquisition_depth = 0; + this->mutex.acquisition_depth = 1; + this->mutex.prev = NULL; + this->mutex.next = NULL; /* Release the mutex */ - acpi_ex_system_release_mutex (this); - } + status = acpi_ex_system_release_mutex (this); + if (ACPI_FAILURE (status)) { + continue; + } - return (AE_OK); + /* Mark mutex unowned */ + + this->mutex.owner_thread = NULL; + } } diff -urN linux-2.4.18/drivers/acpi/executer/exnames.c lia64-2.4/drivers/acpi/executer/exnames.c --- linux-2.4.18/drivers/acpi/executer/exnames.c Mon Sep 24 15:06:41 2001 +++ lia64-2.4/drivers/acpi/executer/exnames.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exnames - interpreter/scanner name load/execute - * $Revision: 83 $ + * $Revision: 91 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,10 +28,9 @@ #include "acpi.h" #include "acinterp.h" #include "amlcode.h" -#include "acnamesp.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exnames") + ACPI_MODULE_NAME ("exnames") /* AML Package Length encodings */ @@ -67,7 +66,7 @@ NATIVE_CHAR *name_string; u32 size_needed; - FUNCTION_TRACE ("Ex_allocate_name_string"); + ACPI_FUNCTION_TRACE ("Ex_allocate_name_string"); /* @@ -75,7 +74,7 @@ * Also, one byte for the null terminator. * This may actually be somewhat longer than needed. */ - if (prefix_count == (u32) -1) { + if (prefix_count == ACPI_UINT32_MAX) { /* Special case for root */ size_needed = 1 + (ACPI_NAME_SIZE * num_name_segs) + 2 + 1; @@ -90,7 +89,7 @@ */ name_string = ACPI_MEM_ALLOCATE (size_needed); if (!name_string) { - REPORT_ERROR (("Ex_allocate_name_string: Could not allocate size %d\n", size_needed)); + ACPI_REPORT_ERROR (("Ex_allocate_name_string: Could not allocate size %d\n", size_needed)); return_PTR (NULL); } @@ -98,10 +97,9 @@ /* Set up Root or Parent prefixes if needed */ - if (prefix_count == (u32) -1) { + if (prefix_count == ACPI_UINT32_MAX) { *temp_ptr++ = AML_ROOT_PREFIX; } - else { while (prefix_count--) { *temp_ptr++ = AML_PARENT_PREFIX; @@ -117,7 +115,6 @@ *temp_ptr++ = AML_MULTI_NAME_PREFIX_OP; *temp_ptr++ = (char) num_name_segs; } - else if (2 == num_name_segs) { /* Set up dual prefixes */ @@ -150,13 +147,13 @@ u8 **in_aml_address, NATIVE_CHAR *name_string) { - u8 *aml_address = *in_aml_address; + char *aml_address = (void *) *in_aml_address; acpi_status status = AE_OK; u32 index; - NATIVE_CHAR char_buf[5]; + char char_buf[5]; - FUNCTION_TRACE ("Ex_name_segment"); + ACPI_FUNCTION_TRACE ("Ex_name_segment"); /* @@ -172,34 +169,32 @@ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Bytes from stream:\n")); - for (index = 4; - (index > 0) && (acpi_ut_valid_acpi_character (*aml_address)); - --index) { - char_buf[4 - index] = *aml_address++; - ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "%c\n", char_buf[4 - index])); + for (index = 0; + (index < ACPI_NAME_SIZE) && (acpi_ut_valid_acpi_character (*aml_address)); + index++) { + char_buf[index] = *aml_address++; + ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "%c\n", char_buf[index])); } /* Valid name segment */ - if (0 == index) { + if (index == 4) { /* Found 4 valid characters */ char_buf[4] = '\0'; if (name_string) { - STRCAT (name_string, char_buf); + ACPI_STRCAT (name_string, char_buf); ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Appended to - %s \n", name_string)); } - else { ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "No Name string - %s \n", char_buf)); } } - - else if (4 == index) { + else if (index == 0) { /* * First character was not a valid name character, * so we are looking at something other than a name. @@ -209,7 +204,6 @@ char_buf[0])); status = AE_CTRL_PENDING; } - else { /* Segment started with one or more valid characters, but fewer than 4 */ @@ -218,7 +212,7 @@ *aml_address, aml_address)); } - *in_aml_address = aml_address; + *in_aml_address = (u8 *) aml_address; return_ACPI_STATUS (status); } @@ -235,10 +229,9 @@ * ******************************************************************************/ - acpi_status acpi_ex_get_name_string ( - acpi_object_type8 data_type, + acpi_object_type data_type, u8 *in_aml_address, NATIVE_CHAR **out_name_string, u32 *out_name_length) @@ -248,11 +241,10 @@ NATIVE_CHAR *name_string = NULL; u32 num_segments; u32 prefix_count = 0; - u8 prefix = 0; u8 has_prefix = FALSE; - FUNCTION_TRACE_PTR ("Ex_get_name_string", aml_address); + ACPI_FUNCTION_TRACE_PTR ("Ex_get_name_string", aml_address); if (INTERNAL_TYPE_REGION_FIELD == data_type || @@ -268,24 +260,22 @@ status = acpi_ex_name_segment (&aml_address, name_string); } } - else { /* * Data_type is not a field name. * Examine first character of name for root or parent prefix operators */ switch (*aml_address) { - case AML_ROOT_PREFIX: - prefix = *aml_address++; - ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Root_prefix: %x\n", prefix)); + ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Root_prefix(\\) at %p\n", aml_address)); /* * Remember that we have a Root_prefix -- * see comment in Acpi_ex_allocate_name_string() */ - prefix_count = (u32) -1; + aml_address++; + prefix_count = ACPI_UINT32_MAX; has_prefix = TRUE; break; @@ -295,18 +285,21 @@ /* Increment past possibly multiple parent prefixes */ do { - prefix = *aml_address++; - ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Parent_prefix: %x\n", prefix)); + ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Parent_prefix (^) at %p\n", aml_address)); - ++prefix_count; + aml_address++; + prefix_count++; } while (*aml_address == AML_PARENT_PREFIX); + has_prefix = TRUE; break; default: + /* Not a prefix character */ + break; } @@ -314,12 +307,11 @@ /* Examine first character of name for name segment prefix operator */ switch (*aml_address) { - case AML_DUAL_NAME_PREFIX: - prefix = *aml_address++; - ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Dual_name_prefix: %x\n", prefix)); + ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Dual_name_prefix at %p\n", aml_address)); + aml_address++; name_string = acpi_ex_allocate_name_string (prefix_count, 2); if (!name_string) { status = AE_NO_MEMORY; @@ -339,12 +331,12 @@ case AML_MULTI_NAME_PREFIX_OP: - prefix = *aml_address++; - ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Multi_name_prefix: %x\n", prefix)); + ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Multi_name_prefix at %p\n", aml_address)); /* Fetch count of segments remaining in name path */ - num_segments = *aml_address++; + aml_address++; + num_segments = *aml_address; name_string = acpi_ex_allocate_name_string (prefix_count, num_segments); if (!name_string) { @@ -354,11 +346,12 @@ /* Indicate that we processed a prefix */ + aml_address++; has_prefix = TRUE; while (num_segments && (status = acpi_ex_name_segment (&aml_address, name_string)) == AE_OK) { - --num_segments; + num_segments--; } break; @@ -368,7 +361,7 @@ /* Null_name valid as of 8-12-98 ASL/AML Grammar Update */ - if (-1 == prefix_count) { + if (prefix_count == ACPI_UINT32_MAX) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Name_seg is \"\\\" followed by NULL\n")); } @@ -396,19 +389,16 @@ status = acpi_ex_name_segment (&aml_address, name_string); break; - - } /* Switch (Peek_op ()) */ + } } - if (AE_CTRL_PENDING == status && has_prefix) { /* Ran out of segments after processing a prefix */ - REPORT_ERROR ( + ACPI_REPORT_ERROR ( ("Ex_do_name: Malformed Name at %p\n", name_string)); status = AE_AML_BAD_NAME; } - *out_name_string = name_string; *out_name_length = (u32) (aml_address - in_aml_address); diff -urN linux-2.4.18/drivers/acpi/executer/exoparg1.c lia64-2.4/drivers/acpi/executer/exoparg1.c --- linux-2.4.18/drivers/acpi/executer/exoparg1.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exoparg1.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exoparg1 - AML execution - opcodes with 1 argument - * $Revision: 120 $ + * $Revision: 137 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exoparg1") + ACPI_MODULE_NAME ("exoparg1") /*! @@ -81,10 +81,10 @@ acpi_status status = AE_OK; - FUNCTION_TRACE_STR ("Ex_opcode_1A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("Ex_opcode_1A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode)); - /* Examine the opcode */ + /* Examine the AML opcode */ switch (walk_state->opcode) { case AML_RELEASE_OP: /* Release (Mutex_object) */ @@ -107,13 +107,13 @@ case AML_SLEEP_OP: /* Sleep (Msec_time) */ - acpi_ex_system_do_suspend ((u32) operand[0]->integer.value); + status = acpi_ex_system_do_suspend ((u32) operand[0]->integer.value); break; case AML_STALL_OP: /* Stall (Usec_time) */ - acpi_ex_system_do_stall ((u32) operand[0]->integer.value); + status = acpi_ex_system_do_stall ((u32) operand[0]->integer.value); break; @@ -125,7 +125,7 @@ default: /* Unknown opcode */ - REPORT_ERROR (("Acpi_ex_opcode_1A_0T_0R: Unknown opcode %X\n", + ACPI_REPORT_ERROR (("Acpi_ex_opcode_1A_0T_0R: Unknown opcode %X\n", walk_state->opcode)); status = AE_AML_BAD_OPCODE; break; @@ -156,19 +156,20 @@ acpi_operand_object **operand = &walk_state->operands[0]; - FUNCTION_TRACE_STR ("Ex_opcode_1A_1T_0R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("Ex_opcode_1A_1T_0R", acpi_ps_get_opcode_name (walk_state->opcode)); - switch (walk_state->opcode) { + /* Examine the AML opcode */ + switch (walk_state->opcode) { case AML_LOAD_OP: - status = acpi_ex_load_op (operand[0], operand[1]); + status = acpi_ex_load_op (operand[0], operand[1], walk_state); break; default: /* Unknown opcode */ - REPORT_ERROR (("Acpi_ex_opcode_1A_1T_0R: Unknown opcode %X\n", + ACPI_REPORT_ERROR (("Acpi_ex_opcode_1A_1T_0R: Unknown opcode %X\n", walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; @@ -208,10 +209,10 @@ acpi_integer digit; - FUNCTION_TRACE_STR ("Ex_opcode_1A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("Ex_opcode_1A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); - /* Create a return object of type Integer for most opcodes */ + /* Examine the AML opcode */ switch (walk_state->opcode) { case AML_BIT_NOT_OP: @@ -221,156 +222,158 @@ case AML_TO_BCD_OP: case AML_COND_REF_OF_OP: + /* Create a return object of type Integer for these opcodes */ + return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); if (!return_desc) { status = AE_NO_MEMORY; goto cleanup; } - break; - } + switch (walk_state->opcode) { + case AML_BIT_NOT_OP: /* Not (Operand, Result) */ + return_desc->integer.value = ~operand[0]->integer.value; + break; - switch (walk_state->opcode) { - case AML_BIT_NOT_OP: /* Not (Operand, Result) */ + case AML_FIND_SET_LEFT_BIT_OP: /* Find_set_left_bit (Operand, Result) */ - return_desc->integer.value = ~operand[0]->integer.value; - break; + return_desc->integer.value = operand[0]->integer.value; + /* + * Acpi specification describes Integer type as a little + * endian unsigned value, so this boundary condition is valid. + */ + for (temp32 = 0; return_desc->integer.value && temp32 < ACPI_INTEGER_BIT_SIZE; ++temp32) { + return_desc->integer.value >>= 1; + } - case AML_FIND_SET_LEFT_BIT_OP: /* Find_set_left_bit (Operand, Result) */ + return_desc->integer.value = temp32; + break; - return_desc->integer.value = operand[0]->integer.value; + case AML_FIND_SET_RIGHT_BIT_OP: /* Find_set_right_bit (Operand, Result) */ - /* - * Acpi specification describes Integer type as a little - * endian unsigned value, so this boundary condition is valid. - */ - for (temp32 = 0; return_desc->integer.value && temp32 < ACPI_INTEGER_BIT_SIZE; ++temp32) { - return_desc->integer.value >>= 1; - } + return_desc->integer.value = operand[0]->integer.value; - return_desc->integer.value = temp32; - break; + /* + * The Acpi specification describes Integer type as a little + * endian unsigned value, so this boundary condition is valid. + */ + for (temp32 = 0; return_desc->integer.value && temp32 < ACPI_INTEGER_BIT_SIZE; ++temp32) { + return_desc->integer.value <<= 1; + } + /* Since the bit position is one-based, subtract from 33 (65) */ - case AML_FIND_SET_RIGHT_BIT_OP: /* Find_set_right_bit (Operand, Result) */ + return_desc->integer.value = temp32 == 0 ? 0 : (ACPI_INTEGER_BIT_SIZE + 1) - temp32; + break; - return_desc->integer.value = operand[0]->integer.value; + case AML_FROM_BCD_OP: /* From_bcd (BCDValue, Result) */ - /* - * The Acpi specification describes Integer type as a little - * endian unsigned value, so this boundary condition is valid. - */ - for (temp32 = 0; return_desc->integer.value && temp32 < ACPI_INTEGER_BIT_SIZE; ++temp32) { - return_desc->integer.value <<= 1; - } + /* + * The 64-bit ACPI integer can hold 16 4-bit BCD integers + */ + return_desc->integer.value = 0; + for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) { + /* Get one BCD digit */ - /* Since the bit position is one-based, subtract from 33 (65) */ + digit = (acpi_integer) ((operand[0]->integer.value >> (i * 4)) & 0xF); - return_desc->integer.value = temp32 == 0 ? 0 : (ACPI_INTEGER_BIT_SIZE + 1) - temp32; - break; + /* Check the range of the digit */ + + if (digit > 9) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD digit too large: %d\n", + (u32) digit)); + status = AE_AML_NUMERIC_OVERFLOW; + goto cleanup; + } + if (digit > 0) { + /* Sum into the result with the appropriate power of 10 */ - case AML_FROM_BCD_OP: /* From_bcd (BCDValue, Result) */ + for (j = 0; j < i; j++) { + digit *= 10; + } - /* - * The 64-bit ACPI integer can hold 16 4-bit BCD integers - */ - return_desc->integer.value = 0; - for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) { - /* Get one BCD digit */ + return_desc->integer.value += digit; + } + } + break; - digit = (acpi_integer) ((operand[0]->integer.value >> (i * 4)) & 0xF); - /* Check the range of the digit */ + case AML_TO_BCD_OP: /* To_bcd (Operand, Result) */ - if (digit > 9) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD digit too large: %d\n", - (u32) digit)); + if (operand[0]->integer.value > ACPI_MAX_BCD_VALUE) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD overflow: %8.8X%8.8X\n", + ACPI_HIDWORD(operand[0]->integer.value), + ACPI_LODWORD(operand[0]->integer.value))); status = AE_AML_NUMERIC_OVERFLOW; goto cleanup; } - if (digit > 0) { - /* Sum into the result with the appropriate power of 10 */ + return_desc->integer.value = 0; + for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) { + /* Divide by nth factor of 10 */ + temp32 = 0; + digit = operand[0]->integer.value; for (j = 0; j < i; j++) { - digit *= 10; + (void) acpi_ut_short_divide (&digit, 10, &digit, &temp32); } - return_desc->integer.value += digit; - } - } - break; + /* Create the BCD digit from the remainder above */ + if (digit > 0) { + return_desc->integer.value += ((acpi_integer) temp32 << (i * 4)); + } + } + break; - case AML_TO_BCD_OP: /* To_bcd (Operand, Result) */ - if (operand[0]->integer.value > ACPI_MAX_BCD_VALUE) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD overflow: %8.8X%8.8X\n", - HIDWORD(operand[0]->integer.value), LODWORD(operand[0]->integer.value))); - status = AE_AML_NUMERIC_OVERFLOW; - goto cleanup; - } + case AML_COND_REF_OF_OP: /* Cond_ref_of (Source_object, Result) */ - return_desc->integer.value = 0; - for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) { - /* Divide by nth factor of 10 */ + /* + * This op is a little strange because the internal return value is + * different than the return value stored in the result descriptor + * (There are really two return values) + */ + if ((acpi_namespace_node *) operand[0] == acpi_gbl_root_node) { + /* + * This means that the object does not exist in the namespace, + * return FALSE + */ + return_desc->integer.value = 0; - temp32 = 0; - digit = operand[0]->integer.value; - for (j = 0; j < i; j++) { - acpi_ut_short_divide (&digit, 10, &digit, &temp32); + /* + * Must delete the result descriptor since there is no reference + * being returned + */ + acpi_ut_remove_reference (operand[1]); + goto cleanup; } - /* Create the BCD digit from the remainder above */ + /* Get the object reference and store it */ - if (digit > 0) { - return_desc->integer.value += (temp32 << (i * 4)); + status = acpi_ex_get_object_reference (operand[0], &return_desc2, walk_state); + if (ACPI_FAILURE (status)) { + goto cleanup; } - } - break; - - case AML_COND_REF_OF_OP: /* Cond_ref_of (Source_object, Result) */ + status = acpi_ex_store (return_desc2, operand[1], walk_state); - /* - * This op is a little strange because the internal return value is - * different than the return value stored in the result descriptor - * (There are really two return values) - */ - if ((acpi_namespace_node *) operand[0] == acpi_gbl_root_node) { - /* - * This means that the object does not exist in the namespace, - * return FALSE - */ - return_desc->integer.value = 0; + /* The object exists in the namespace, return TRUE */ - /* - * Must delete the result descriptor since there is no reference - * being returned - */ - acpi_ut_remove_reference (operand[1]); + return_desc->integer.value = ACPI_INTEGER_MAX; goto cleanup; - } - /* Get the object reference and store it */ - status = acpi_ex_get_object_reference (operand[0], &return_desc2, walk_state); - if (ACPI_FAILURE (status)) { - goto cleanup; + default: + /* No other opcodes get here */ + break; } - - status = acpi_ex_store (return_desc2, operand[1], walk_state); - - /* The object exists in the namespace, return TRUE */ - - return_desc->integer.value = ACPI_INTEGER_MAX; - goto cleanup; break; @@ -395,7 +398,6 @@ walk_state->result_obj = operand[0]; walk_state->operands[0] = NULL; /* Prevent deletion */ return_ACPI_STATUS (status); - break; /* @@ -403,8 +405,7 @@ */ case AML_COPY_OP: /* Copy (Source, Target) */ - status = AE_NOT_IMPLEMENTED; - goto cleanup; + status = acpi_ut_copy_iobject_to_iobject (operand[0], &return_desc, walk_state); break; @@ -432,29 +433,26 @@ break; - /* - * These are two obsolete opcodes - */ case AML_SHIFT_LEFT_BIT_OP: /* Shift_left_bit (Source, Bit_num) */ case AML_SHIFT_RIGHT_BIT_OP: /* Shift_right_bit (Source, Bit_num) */ - + /* + * These are two obsolete opcodes + */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s is obsolete and not implemented\n", acpi_ps_get_opcode_name (walk_state->opcode))); status = AE_SUPPORT; goto cleanup; - break; default: /* Unknown opcode */ - REPORT_ERROR (("Acpi_ex_opcode_1A_1T_1R: Unknown opcode %X\n", + ACPI_REPORT_ERROR (("Acpi_ex_opcode_1A_1T_1R: Unknown opcode %X\n", walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; } - /* * Store the return value computed above into the target object */ @@ -499,13 +497,12 @@ acpi_integer value; - FUNCTION_TRACE_STR ("Ex_opcode_1A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("Ex_opcode_1A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode)); - /* Get the operand and decode the opcode */ + /* Examine the AML opcode */ switch (walk_state->opcode) { - case AML_LNOT_OP: /* LNot (Operand) */ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); @@ -523,10 +520,10 @@ /* * Since we are expecting a Reference operand, it - * can be either a Node or an internal object. + * can be either a NS Node or an internal object. */ return_desc = operand[0]; - if (VALID_DESCRIPTOR_TYPE (operand[0], ACPI_DESC_TYPE_INTERNAL)) { + if (ACPI_GET_DESCRIPTOR_TYPE (operand[0]) == ACPI_DESC_TYPE_OPERAND) { /* Internal reference object - prevent deletion */ acpi_ut_add_reference (return_desc); @@ -582,7 +579,7 @@ case AML_DEBUG_OP: - /* Per 1.0b spec, Debug object is of type "Debug_object" */ + /* The Debug Object is of type "Debug_object" */ type = ACPI_TYPE_DEBUG_OBJECT; break; @@ -601,7 +598,6 @@ */ type = (*(operand[0]->reference.where))->common.type; } - break; @@ -615,13 +611,12 @@ default: - REPORT_ERROR (("Acpi_ex_opcode_1A_0T_1R/Type_op: Internal error - Unknown Reference subtype %X\n", + ACPI_REPORT_ERROR (("Acpi_ex_opcode_1A_0T_1R/Type_op: Internal error - Unknown Reference subtype %X\n", operand[0]->reference.opcode)); status = AE_AML_INTERNAL; goto cleanup; } } - else { /* * It's not a Reference, so it must be a direct name pointer. @@ -636,6 +631,11 @@ case INTERNAL_TYPE_INDEX_FIELD: type = ACPI_TYPE_FIELD_UNIT; + break; + + default: + /* No change to Type required */ + break; } } @@ -655,15 +655,19 @@ case AML_SIZE_OF_OP: /* Size_of (Source_object) */ temp_desc = operand[0]; - if (VALID_DESCRIPTOR_TYPE (operand[0], ACPI_DESC_TYPE_NAMED)) { + if (ACPI_GET_DESCRIPTOR_TYPE (operand[0]) == ACPI_DESC_TYPE_NAMED) { temp_desc = acpi_ns_get_attached_object ((acpi_namespace_node *) operand[0]); } if (!temp_desc) { value = 0; } - else { + /* + * Type is guaranteed to be a buffer, string, or package at this + * point (even if the original operand was an object reference, it + * will be resolved and typechecked during operand resolution.) + */ switch (temp_desc->common.type) { case ACPI_TYPE_BUFFER: value = temp_desc->buffer.length; @@ -677,16 +681,9 @@ value = temp_desc->package.count; break; - case INTERNAL_TYPE_REFERENCE: - - /* TBD: this must be a reference to a buf/str/pkg?? */ - - value = 4; - break; - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Not Buf/Str/Pkg - found type %X\n", - temp_desc->common.type)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Size_of, Not Buf/Str/Pkg - found type %s\n", + acpi_ut_get_type_name (temp_desc->common.type))); status = AE_AML_OPERAND_TYPE; goto cleanup; } @@ -715,79 +712,113 @@ break; - case AML_DEREF_OF_OP: /* Deref_of (Obj_reference) */ + case AML_DEREF_OF_OP: /* Deref_of (Obj_reference | String) */ - /* Check for a method local or argument */ + /* Check for a method local or argument, or standalone String */ - if (!VALID_DESCRIPTOR_TYPE (operand[0], ACPI_DESC_TYPE_NAMED)) { - /* - * Must resolve/dereference the local/arg reference first - */ - switch (operand[0]->reference.opcode) { - /* Set Operand[0] to the value of the local/arg */ + if (ACPI_GET_DESCRIPTOR_TYPE (operand[0]) != ACPI_DESC_TYPE_NAMED) { + switch (ACPI_GET_OBJECT_TYPE (operand[0])) { + case INTERNAL_TYPE_REFERENCE: + /* + * This is a Deref_of (Local_x | Arg_x) + * + * Must resolve/dereference the local/arg reference first + */ + switch (operand[0]->reference.opcode) { + case AML_LOCAL_OP: + case AML_ARG_OP: + + /* Set Operand[0] to the value of the local/arg */ + + status = acpi_ds_method_data_get_value (operand[0]->reference.opcode, + operand[0]->reference.offset, walk_state, &temp_desc); + if (ACPI_FAILURE (status)) { + goto cleanup; + } - case AML_LOCAL_OP: - case AML_ARG_OP: + /* + * Delete our reference to the input object and + * point to the object just retrieved + */ + acpi_ut_remove_reference (operand[0]); + operand[0] = temp_desc; + break; - acpi_ds_method_data_get_value (operand[0]->reference.opcode, - operand[0]->reference.offset, walk_state, &temp_desc); + default: + + /* Must be an Index op - handled below */ + break; + } + break; + + + case ACPI_TYPE_STRING: /* - * Delete our reference to the input object and - * point to the object just retrieved + * This is a Deref_of (String). The string is a reference to a named ACPI object. + * + * 1) Find the owning Node + * 2) Dereference the node to an actual object. Could be a Field, so we nee + * to resolve the node to a value. */ - acpi_ut_remove_reference (operand[0]); - operand[0] = temp_desc; - break; + status = acpi_ns_get_node_by_path (operand[0]->string.pointer, + walk_state->scope_info->scope.node, ACPI_NS_SEARCH_PARENT, + ACPI_CAST_INDIRECT_PTR (acpi_namespace_node, &return_desc)); + if (ACPI_FAILURE (status)) { + goto cleanup; + } + + status = acpi_ex_resolve_node_to_value ( + ACPI_CAST_INDIRECT_PTR (acpi_namespace_node, &return_desc), walk_state); + goto cleanup; + default: - /* Index op - handled below */ - break; + status = AE_AML_OPERAND_TYPE; + goto cleanup; } } - /* Operand[0] may have changed from the code above */ - if (VALID_DESCRIPTOR_TYPE (operand[0], ACPI_DESC_TYPE_NAMED)) { - /* Get the actual object from the Node (This is the dereference) */ - - return_desc = ((acpi_namespace_node *) operand[0])->object; - - /* Returning a pointer to the object, add another reference! */ - - acpi_ut_add_reference (return_desc); + if (ACPI_GET_DESCRIPTOR_TYPE (operand[0]) == ACPI_DESC_TYPE_NAMED) { + /* + * This is a Deref_of (Object_reference) + * Get the actual object from the Node (This is the dereference). + * -- This case may only happen when a Local_x or Arg_x is dereferenced above. + */ + return_desc = acpi_ns_get_attached_object ((acpi_namespace_node *) operand[0]); } - else { /* - * This must be a reference object produced by the Index - * ASL operation -- check internal opcode + * This must be a reference object produced by either the Index() or + * Ref_of() operator */ - if ((operand[0]->reference.opcode != AML_INDEX_OP) && - (operand[0]->reference.opcode != AML_REF_OF_OP)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode in ref(%p) - %X\n", - operand[0], operand[0]->reference.opcode)); - - status = AE_TYPE; - goto cleanup; - } - - switch (operand[0]->reference.opcode) { case AML_INDEX_OP: /* - * Supported target types for the Index operator are - * 1) A Buffer - * 2) A Package + * The target type for the Index operator must be + * either a Buffer or a Package */ - if (operand[0]->reference.target_type == ACPI_TYPE_BUFFER_FIELD) { + switch (operand[0]->reference.target_type) { + case ACPI_TYPE_BUFFER_FIELD: + + /* Ensure that the Buffer arguments are evaluated */ + + temp_desc = operand[0]->reference.object; +#if 0 + + status = acpi_ds_get_buffer_arguments (temp_desc); + if (ACPI_FAILURE (status)) { + goto cleanup; + } +#endif + /* - * The target is a buffer, we must create a new object that - * contains one element of the buffer, the element pointed - * to by the index. + * Create a new object that contains one element of the + * buffer -- the element pointed to by the index. * * NOTE: index into a buffer is NOT a pointer to a * sub-buffer of the main buffer, it is only a pointer to a @@ -799,20 +830,29 @@ goto cleanup; } - temp_desc = operand[0]->reference.object; + /* + * Since we are returning the value of the buffer at the + * indexed location, we don't need to add an additional + * reference to the buffer itself. + */ return_desc->integer.value = temp_desc->buffer.pointer[operand[0]->reference.offset]; + break; - /* TBD: [Investigate] (see below) Don't add an additional - * ref! - */ - } - else if (operand[0]->reference.target_type == ACPI_TYPE_PACKAGE) { + case ACPI_TYPE_PACKAGE: + +#if 0 + /* Ensure that the Package arguments are evaluated */ + + status = acpi_ds_get_package_arguments (operand[0]->reference.object); + if (ACPI_FAILURE (status)) { + goto cleanup; + } +#endif /* - * The target is a package, we want to return the referenced - * element of the package. We must add another reference to - * this object, however. + * Return the referenced element of the package. We must add + * another reference to the referenced object, however. */ return_desc = *(operand[0]->reference.where); if (!return_desc) { @@ -821,7 +861,6 @@ * an uninitialized package element and is thus a * severe error. */ - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "NULL package element obj %p\n", operand[0])); status = AE_AML_UNINITIALIZED_ELEMENT; @@ -829,15 +868,16 @@ } acpi_ut_add_reference (return_desc); - } + break; + + + default: - else { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Target_type %X in obj %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Index Target_type %X in obj %p\n", operand[0]->reference.target_type, operand[0])); status = AE_AML_OPERAND_TYPE; goto cleanup; } - break; @@ -849,15 +889,22 @@ acpi_ut_add_reference (return_desc); break; + + + default: + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode in ref(%p) - %X\n", + operand[0], operand[0]->reference.opcode)); + + status = AE_TYPE; + goto cleanup; } } - break; default: - REPORT_ERROR (("Acpi_ex_opcode_1A_0T_1R: Unknown opcode %X\n", + ACPI_REPORT_ERROR (("Acpi_ex_opcode_1A_0T_1R: Unknown opcode %X\n", walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; diff -urN linux-2.4.18/drivers/acpi/executer/exoparg2.c lia64-2.4/drivers/acpi/executer/exoparg2.c --- linux-2.4.18/drivers/acpi/executer/exoparg2.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exoparg2.c Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: exoparg2 - AML execution - opcodes with 2 arguments - * $Revision: 97 $ + * $Revision: 106 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,15 +26,13 @@ #include "acpi.h" #include "acparser.h" -#include "acnamesp.h" #include "acinterp.h" #include "acevents.h" #include "amlcode.h" -#include "acdispat.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exoparg2") + ACPI_MODULE_NAME ("exoparg2") /*! @@ -84,50 +82,45 @@ acpi_status status = AE_OK; - FUNCTION_TRACE_STR ("Ex_opcode_2A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("Ex_opcode_2A_0T_0R", + acpi_ps_get_opcode_name (walk_state->opcode)); /* Examine the opcode */ switch (walk_state->opcode) { - case AML_NOTIFY_OP: /* Notify (Notify_object, Notify_value) */ /* The first operand is a namespace node */ node = (acpi_namespace_node *) operand[0]; - /* The node must refer to a device or thermal zone */ - - if (node && operand[1]) /* TBD: is this check necessary? */ { - switch (node->type) { - case ACPI_TYPE_DEVICE: - case ACPI_TYPE_THERMAL: + /* Notifies allowed on this object? */ - /* - * Dispatch the notify to the appropriate handler - * NOTE: the request is queued for execution after this method - * completes. The notify handlers are NOT invoked synchronously - * from this thread -- because handlers may in turn run other - * control methods. - */ - status = acpi_ev_queue_notify_request (node, - (u32) operand[1]->integer.value); - break; - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unexpected notify object type %X\n", - node->type)); + if (!acpi_ev_is_notify_object (node)) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unexpected notify object type [%s]\n", + acpi_ut_get_type_name (node->type))); - status = AE_AML_OPERAND_TYPE; - break; - } + status = AE_AML_OPERAND_TYPE; + break; } + + /* + * Dispatch the notify to the appropriate handler + * NOTE: the request is queued for execution after this method + * completes. The notify handlers are NOT invoked synchronously + * from this thread -- because handlers may in turn run other + * control methods. + */ + status = acpi_ev_queue_notify_request (node, + (u32) operand[1]->integer.value); break; + default: - REPORT_ERROR (("Acpi_ex_opcode_2A_0T_0R: Unknown opcode %X\n", walk_state->opcode)); + ACPI_REPORT_ERROR (("Acpi_ex_opcode_2A_0T_0R: Unknown opcode %X\n", + walk_state->opcode)); status = AE_AML_BAD_OPCODE; } @@ -158,7 +151,7 @@ acpi_status status; - FUNCTION_TRACE_STR ("Ex_opcode_2A_2T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("Ex_opcode_2A_2T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); /* @@ -191,11 +184,10 @@ default: - REPORT_ERROR (("Acpi_ex_opcode_2A_2T_1R: Unknown opcode %X\n", + ACPI_REPORT_ERROR (("Acpi_ex_opcode_2A_2T_1R: Unknown opcode %X\n", walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; - break; } @@ -257,7 +249,7 @@ acpi_status status = AE_OK; - FUNCTION_TRACE_STR ("Ex_opcode_2A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("Ex_opcode_2A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); /* @@ -344,7 +336,7 @@ case AML_CONCAT_RES_OP: /* Concatenate_res_template (Buffer, Buffer, Result) (ACPI 2.0) */ - status = AE_NOT_IMPLEMENTED; + status = acpi_ex_concat_template (operand[0], operand[1], &return_desc, walk_state); break; @@ -424,12 +416,11 @@ walk_state->result_obj = return_desc; goto cleanup; - break; default: - REPORT_ERROR (("Acpi_ex_opcode_2A_1T_1R: Unknown opcode %X\n", + ACPI_REPORT_ERROR (("Acpi_ex_opcode_2A_1T_1R: Unknown opcode %X\n", walk_state->opcode)); status = AE_AML_BAD_OPCODE; break; @@ -486,7 +477,7 @@ u8 logical_result = FALSE; - FUNCTION_TRACE_STR ("Ex_opcode_2A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("Ex_opcode_2A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); /* Create the internal return object */ @@ -531,10 +522,9 @@ default: - REPORT_ERROR (("Acpi_ex_opcode_2A_0T_1R: Unknown opcode %X\n", walk_state->opcode)); + ACPI_REPORT_ERROR (("Acpi_ex_opcode_2A_0T_1R: Unknown opcode %X\n", walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; - break; } diff -urN linux-2.4.18/drivers/acpi/executer/exoparg3.c lia64-2.4/drivers/acpi/executer/exoparg3.c --- linux-2.4.18/drivers/acpi/executer/exoparg3.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exoparg3.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exoparg3 - AML execution - opcodes with 3 arguments - * $Revision: 3 $ + * $Revision: 13 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exoparg3") + ACPI_MODULE_NAME ("exoparg3") /*! @@ -79,7 +79,7 @@ acpi_status status = AE_OK; - FUNCTION_TRACE_STR ("Ex_opcode_3A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("Ex_opcode_3A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode)); switch (walk_state->opcode) { @@ -87,7 +87,7 @@ case AML_FATAL_OP: /* Fatal (Fatal_type Fatal_code Fatal_arg) */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Fatal_op: Type %x Code %x Arg %x <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", + "Fatal_op: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", (u32) operand[0]->integer.value, (u32) operand[1]->integer.value, (u32) operand[2]->integer.value)); @@ -102,7 +102,7 @@ /* * Always signal the OS! */ - acpi_os_signal (ACPI_SIGNAL_FATAL, fatal); + status = acpi_os_signal (ACPI_SIGNAL_FATAL, fatal); /* Might return while OS is shutting down, just continue */ @@ -112,11 +112,10 @@ default: - REPORT_ERROR (("Acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n", + ACPI_REPORT_ERROR (("Acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n", walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; - break; } @@ -146,11 +145,11 @@ acpi_operand_object *return_desc = NULL; char *buffer; acpi_status status = AE_OK; - u32 index; - u32 length; + NATIVE_UINT index; + ACPI_SIZE length; - FUNCTION_TRACE_STR ("Ex_opcode_3A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("Ex_opcode_3A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); switch (walk_state->opcode) { @@ -168,8 +167,8 @@ /* Get the Integer values from the objects */ - index = (u32) operand[1]->integer.value; - length = (u32) operand[2]->integer.value; + index = (NATIVE_UINT) operand[1]->integer.value; + length = (ACPI_SIZE) operand[2]->integer.value; /* * If the index is beyond the length of the String/Buffer, or if the @@ -181,37 +180,36 @@ if ((index + length) > operand[0]->string.length) { - length = operand[0]->string.length - index; + length = (ACPI_SIZE) operand[0]->string.length - index; } /* Allocate a new buffer for the String/Buffer */ - buffer = ACPI_MEM_CALLOCATE (length + 1); + buffer = ACPI_MEM_CALLOCATE ((ACPI_SIZE) length + 1); if (!buffer) { - return (AE_NO_MEMORY); + status = AE_NO_MEMORY; + goto cleanup; } /* Copy the portion requested */ - MEMCPY (buffer, operand[0]->string.pointer + index, - length); + ACPI_MEMCPY (buffer, operand[0]->string.pointer + index, + length); /* Set the length of the new String/Buffer */ return_desc->string.pointer = buffer; - return_desc->string.length = length; + return_desc->string.length = (u32) length; } - break; default: - REPORT_ERROR (("Acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n", + ACPI_REPORT_ERROR (("Acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n", walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; - break; } /* Store the result in the target */ diff -urN linux-2.4.18/drivers/acpi/executer/exoparg6.c lia64-2.4/drivers/acpi/executer/exoparg6.c --- linux-2.4.18/drivers/acpi/executer/exoparg6.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exoparg6.c Tue Apr 9 15:46:59 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exoparg6 - AML execution - opcodes with 6 arguments - * $Revision: 4 $ + * $Revision: 10 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exoparg6") + ACPI_MODULE_NAME ("exoparg6") /*! @@ -158,7 +158,7 @@ acpi_operand_object *this_element; - FUNCTION_TRACE_STR ("Ex_opcode_6A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); + ACPI_FUNCTION_TRACE_STR ("Ex_opcode_6A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode)); switch (walk_state->opcode) { @@ -199,6 +199,7 @@ * Examine each element until a match is found. Within the loop, * "continue" signifies that the current element does not match * and the next should be examined. + * * Upon finding a match, the loop will terminate via "break" at * the bottom. If it terminates "normally", Match_value will be -1 * (its initial value) indicating that no match was found. When @@ -209,27 +210,21 @@ /* * Treat any NULL or non-numeric elements as non-matching. - * TBD [Unhandled] - if an element is a Name, - * should we examine its value? */ if (!this_element || this_element->common.type != ACPI_TYPE_INTEGER) { continue; } - /* - * Within these switch statements: - * "break" (exit from the switch) signifies a match; - * "continue" (proceed to next iteration of enclosing - * "for" loop) signifies a non-match. + * "continue" (proceed to next iteration of enclosing + * "for" loop) signifies a non-match. */ if (!acpi_ex_do_match ((u32) operand[1]->integer.value, this_element->integer.value, operand[2]->integer.value)) { continue; } - if (!acpi_ex_do_match ((u32) operand[3]->integer.value, this_element->integer.value, operand[4]->integer.value)) { continue; @@ -246,18 +241,16 @@ case AML_LOAD_TABLE_OP: - status = AE_NOT_IMPLEMENTED; - goto cleanup; + status = acpi_ex_load_table_op (walk_state, &return_desc); break; default: - REPORT_ERROR (("Acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n", + ACPI_REPORT_ERROR (("Acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n", walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; - break; } diff -urN linux-2.4.18/drivers/acpi/executer/exprep.c lia64-2.4/drivers/acpi/executer/exprep.c --- linux-2.4.18/drivers/acpi/executer/exprep.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exprep.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities - * $Revision: 99 $ + * $Revision: 117 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,88 +29,128 @@ #include "acinterp.h" #include "amlcode.h" #include "acnamesp.h" -#include "acparser.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exprep") + ACPI_MODULE_NAME ("exprep") /******************************************************************************* * - * FUNCTION: Acpi_ex_decode_field_access_type + * FUNCTION: Acpi_ex_decode_field_access * * PARAMETERS: Access - Encoded field access bits * Length - Field length. * - * RETURN: Field granularity (8, 16, 32 or 64) + * RETURN: Field granularity (8, 16, 32 or 64) and + * Byte_alignment (1, 2, 3, or 4) * * DESCRIPTION: Decode the Access_type bits of a field definition. * ******************************************************************************/ static u32 -acpi_ex_decode_field_access_type ( - u32 access, - u16 length, - u32 *alignment) +acpi_ex_decode_field_access ( + acpi_operand_object *obj_desc, + u8 field_flags, + u32 *return_byte_alignment) { - PROC_NAME ("Ex_decode_field_access_type"); + u32 access; + u8 byte_alignment; + u8 bit_length; +/* u32 Length; */ + + + ACPI_FUNCTION_NAME ("Ex_decode_field_access"); + + access = (field_flags & AML_FIELD_ACCESS_TYPE_MASK); switch (access) { - case ACCESS_ANY_ACC: + case AML_FIELD_ACCESS_ANY: - *alignment = 8; + byte_alignment = 1; + bit_length = 8; + +#if 0 + /* + * TBD: optimize + * + * Any attempt to optimize the access size to the size of the field + * must take into consideration the length of the region and take + * care that an access to the field will not attempt to access + * beyond the end of the region. + */ /* Use the length to set the access type */ + length = obj_desc->common_field.bit_length; + if (length <= 8) { - return (8); + bit_length = 8; } else if (length <= 16) { - return (16); + bit_length = 16; } else if (length <= 32) { - return (32); + bit_length = 32; } else if (length <= 64) { - return (64); + bit_length = 64; } + else { + /* Larger than Qword - just use byte-size chunks */ - /* Default is 8 (byte) */ + bit_length = 8; + } +#endif + break; - return (8); + case AML_FIELD_ACCESS_BYTE: + byte_alignment = 1; + bit_length = 8; break; - case ACCESS_BYTE_ACC: - *alignment = 8; - return (8); + case AML_FIELD_ACCESS_WORD: + byte_alignment = 2; + bit_length = 16; break; - case ACCESS_WORD_ACC: - *alignment = 16; - return (16); + case AML_FIELD_ACCESS_DWORD: + byte_alignment = 4; + bit_length = 32; break; - case ACCESS_DWORD_ACC: - *alignment = 32; - return (32); + case AML_FIELD_ACCESS_QWORD: /* ACPI 2.0 */ + byte_alignment = 8; + bit_length = 64; break; - case ACCESS_QWORD_ACC: /* ACPI 2.0 */ - *alignment = 64; - return (64); + case AML_FIELD_ACCESS_BUFFER: /* ACPI 2.0 */ + byte_alignment = 8; + bit_length = 8; break; default: /* Invalid field access type */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Unknown field access type %x\n", + "Unknown field access type %X\n", access)); return (0); } + + if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) { + /* + * Buffer_field access can be on any byte boundary, so the + * Byte_alignment is always 1 byte -- regardless of any Byte_alignment + * implied by the field access type. + */ + byte_alignment = 1; + } + + *return_byte_alignment = byte_alignment; + return (bit_length); } @@ -128,7 +168,9 @@ * RETURN: Status * * DESCRIPTION: Initialize the areas of the field object that are common - * to the various types of fields. + * to the various types of fields. Note: This is very "sensitive" + * code because we are solving the general case for field + * alignment. * ******************************************************************************/ @@ -136,107 +178,106 @@ acpi_ex_prep_common_field_object ( acpi_operand_object *obj_desc, u8 field_flags, + u8 field_attribute, u32 field_bit_position, u32 field_bit_length) { u32 access_bit_width; - u32 alignment; + u32 byte_alignment; u32 nearest_byte_address; - FUNCTION_TRACE ("Ex_prep_common_field_object"); + ACPI_FUNCTION_TRACE ("Ex_prep_common_field_object"); /* * Note: the structure being initialized is the - * ACPI_COMMON_FIELD_INFO; No structure fields outside of the common area - * are initialized by this procedure. + * ACPI_COMMON_FIELD_INFO; No structure fields outside of the common + * area are initialized by this procedure. */ - - /* Demultiplex the Field_flags byte */ - - obj_desc->common_field.lock_rule = (u8) ((field_flags & LOCK_RULE_MASK) - >> LOCK_RULE_SHIFT); - obj_desc->common_field.update_rule = (u8) ((field_flags & UPDATE_RULE_MASK) - >> UPDATE_RULE_SHIFT); - /* Other misc fields */ - - obj_desc->common_field.bit_length = (u16) field_bit_length; + obj_desc->common_field.field_flags = field_flags; + obj_desc->common_field.attribute = field_attribute; + obj_desc->common_field.bit_length = field_bit_length; /* * Decode the access type so we can compute offsets. The access type gives * two pieces of information - the width of each field access and the - * necessary alignment of the access. For Any_acc, the width used is the - * largest necessary/possible in an attempt to access the whole field in one - * I/O operation. However, for Any_acc, the alignment is 8. For all other - * access types (Byte, Word, Dword, Qword), the width is the same as the - * alignment. + * necessary Byte_alignment (address granularity) of the access. + * + * For Any_acc, the Access_bit_width is the largest width that is both + * necessary and possible in an attempt to access the whole field in one + * I/O operation. However, for Any_acc, the Byte_alignment is always one + * byte. + * + * For all Buffer Fields, the Byte_alignment is always one byte. + * + * For all other access types (Byte, Word, Dword, Qword), the Bitwidth is + * the same (equivalent) as the Byte_alignment. */ - access_bit_width = acpi_ex_decode_field_access_type ( - ((field_flags & ACCESS_TYPE_MASK) >> ACCESS_TYPE_SHIFT), - obj_desc->field.bit_length, &alignment); + access_bit_width = acpi_ex_decode_field_access (obj_desc, field_flags, + &byte_alignment); if (!access_bit_width) { return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } /* Setup width (access granularity) fields */ - obj_desc->common_field.access_bit_width = (u8) access_bit_width; /* 8, 16, 32, 64 */ - obj_desc->common_field.access_byte_width = (u8) DIV_8 (access_bit_width); /* 1, 2, 4, 8 */ - - if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) { - /* - * Buffer_field access can be on any byte boundary, so the - * alignment is always 8 (regardless of any alignment implied by the - * field access type.) - */ - alignment = 8; - } - + obj_desc->common_field.access_byte_width = (u8) + ACPI_DIV_8 (access_bit_width); /* 1, 2, 4, 8 */ /* - * Base_byte_offset is the address of the start of the field within the region. It is - * the byte address of the first *datum* (field-width data unit) of the field. - * (i.e., the first datum that contains at least the first *bit* of the field.) + * Base_byte_offset is the address of the start of the field within the + * region. It is the byte address of the first *datum* (field-width data + * unit) of the field. (i.e., the first datum that contains at least the + * first *bit* of the field.) + * + * Note: Byte_alignment is always either equal to the Access_bit_width or 8 + * (Byte access), and it defines the addressing granularity of the parent + * region or buffer. */ - nearest_byte_address = ROUND_BITS_DOWN_TO_BYTES (field_bit_position); - obj_desc->common_field.base_byte_offset = ROUND_DOWN (nearest_byte_address, - DIV_8 (alignment)); + nearest_byte_address = + ACPI_ROUND_BITS_DOWN_TO_BYTES (field_bit_position); + obj_desc->common_field.base_byte_offset = + ACPI_ROUND_DOWN (nearest_byte_address, byte_alignment); /* - * Start_field_bit_offset is the offset of the first bit of the field within a field datum. - * This is calculated as the number of bits from the Base_byte_offset. In other words, - * the start of the field is relative to a byte address, regardless of the access type - * of the field. + * Start_field_bit_offset is the offset of the first bit of the field within + * a field datum. */ - obj_desc->common_field.start_field_bit_offset = (u8) (MOD_8 (field_bit_position)); + obj_desc->common_field.start_field_bit_offset = (u8) + (field_bit_position - ACPI_MUL_8 (obj_desc->common_field.base_byte_offset)); /* - * Datum_valid_bits is the number of valid field bits in the first field datum. + * Valid bits -- the number of bits that compose a partial datum, + * 1) At the end of the field within the region (arbitrary starting bit + * offset) + * 2) At the end of a buffer used to contain the field (starting offset + * always zero) */ - obj_desc->common_field.datum_valid_bits = (u8) (access_bit_width - - obj_desc->common_field.start_field_bit_offset); + obj_desc->common_field.end_field_valid_bits = (u8) + ((obj_desc->common_field.start_field_bit_offset + field_bit_length) % + access_bit_width); + /* Start_buffer_bit_offset always = 0 */ + + obj_desc->common_field.end_buffer_valid_bits = (u8) + (field_bit_length % access_bit_width); /* - * Valid bits -- the number of bits that compose a partial datum, - * 1) At the end of the field within the region (arbitrary starting bit offset) - * 2) At the end of a buffer used to contain the field (starting offset always zero) + * Datum_valid_bits is the number of valid field bits in the first + * field datum. */ - obj_desc->common_field.end_field_valid_bits = (u8) ((obj_desc->common_field.start_field_bit_offset + - field_bit_length) % access_bit_width); - obj_desc->common_field.end_buffer_valid_bits = (u8) (field_bit_length % access_bit_width); /* Start_buffer_bit_offset always = 0 */ - + obj_desc->common_field.datum_valid_bits = (u8) + (access_bit_width - obj_desc->common_field.start_field_bit_offset); /* - * Does the entire field fit within a single field access element - * (datum)? (without crossing a datum boundary) + * Does the entire field fit within a single field access element? (datum) + * (i.e., without crossing a datum boundary) */ - if ((obj_desc->common_field.start_field_bit_offset + obj_desc->common_field.bit_length) <= - (u16) obj_desc->common_field.access_bit_width) { - obj_desc->common_field.access_flags |= AFIELD_SINGLE_DATUM; + if ((obj_desc->common_field.start_field_bit_offset + field_bit_length) <= + (u16) access_bit_width) { + obj_desc->common.flags |= AOPOBJ_SINGLE_DATUM; } - return_ACPI_STATUS (AE_OK); } @@ -267,7 +308,7 @@ acpi_status status; - FUNCTION_TRACE ("Ex_prep_field_value"); + ACPI_FUNCTION_TRACE ("Ex_prep_field_value"); /* Parameter validation */ @@ -280,14 +321,15 @@ type = acpi_ns_get_type (info->region_node); if (type != ACPI_TYPE_REGION) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %X %s\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Needed Region, found type %X %s\n", type, acpi_ut_get_type_name (type))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } } - /* Allocate a new region object */ + /* Allocate a new field object */ obj_desc = acpi_ut_create_internal_object (info->field_type); if (!obj_desc) { @@ -296,8 +338,9 @@ /* Initialize areas of the object that are common to all fields */ + obj_desc->common_field.node = info->field_node; status = acpi_ex_prep_common_field_object (obj_desc, info->field_flags, - info->field_bit_position, info->field_bit_length); + info->attribute, info->field_bit_position, info->field_bit_length); if (ACPI_FAILURE (status)) { acpi_ut_delete_object_desc (obj_desc); return_ACPI_STATUS (status); @@ -308,33 +351,37 @@ switch (info->field_type) { case INTERNAL_TYPE_REGION_FIELD: - obj_desc->field.region_obj = acpi_ns_get_attached_object (info->region_node); + obj_desc->field.region_obj = acpi_ns_get_attached_object (info->region_node); /* An additional reference for the container */ acpi_ut_add_reference (obj_desc->field.region_obj); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Region_field: Bitoff=%X Off=%X Gran=%X Region %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Region_field: Bitoff=%X Off=%X Gran=%X Region %p\n", obj_desc->field.start_field_bit_offset, obj_desc->field.base_byte_offset, - obj_desc->field.access_bit_width, obj_desc->field.region_obj)); + obj_desc->field.access_byte_width, obj_desc->field.region_obj)); break; case INTERNAL_TYPE_BANK_FIELD: - obj_desc->bank_field.value = info->bank_value; - obj_desc->bank_field.region_obj = acpi_ns_get_attached_object (info->region_node); - obj_desc->bank_field.bank_register_obj = acpi_ns_get_attached_object (info->register_node); + obj_desc->bank_field.value = info->bank_value; + obj_desc->bank_field.region_obj = acpi_ns_get_attached_object (info->region_node); + obj_desc->bank_field.bank_obj = acpi_ns_get_attached_object (info->register_node); /* An additional reference for the attached objects */ acpi_ut_add_reference (obj_desc->bank_field.region_obj); - acpi_ut_add_reference (obj_desc->bank_field.bank_register_obj); + acpi_ut_add_reference (obj_desc->bank_field.bank_obj); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Bank Field: Bit_off=%X Off=%X Gran=%X Region %p Bank_reg %p\n", - obj_desc->bank_field.start_field_bit_offset, obj_desc->bank_field.base_byte_offset, - obj_desc->field.access_bit_width, obj_desc->bank_field.region_obj, - obj_desc->bank_field.bank_register_obj)); + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Bank Field: Bit_off=%X Off=%X Gran=%X Region %p Bank_reg %p\n", + obj_desc->bank_field.start_field_bit_offset, + obj_desc->bank_field.base_byte_offset, + obj_desc->field.access_byte_width, + obj_desc->bank_field.region_obj, + obj_desc->bank_field.bank_obj)); break; @@ -342,8 +389,8 @@ obj_desc->index_field.index_obj = acpi_ns_get_attached_object (info->register_node); obj_desc->index_field.data_obj = acpi_ns_get_attached_object (info->data_register_node); - obj_desc->index_field.value = (u32) (info->field_bit_position / - obj_desc->field.access_bit_width); + obj_desc->index_field.value = (u32) + (info->field_bit_position / ACPI_MUL_8 (obj_desc->field.access_byte_width)); if (!obj_desc->index_field.data_obj || !obj_desc->index_field.index_obj) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Index Object\n")); @@ -355,11 +402,18 @@ acpi_ut_add_reference (obj_desc->index_field.data_obj); acpi_ut_add_reference (obj_desc->index_field.index_obj); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Index_field: bitoff=%X off=%X gran=%X Index %p Data %p\n", - obj_desc->index_field.start_field_bit_offset, obj_desc->index_field.base_byte_offset, - obj_desc->field.access_bit_width, obj_desc->index_field.index_obj, + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Index_field: bitoff=%X off=%X gran=%X Index %p Data %p\n", + obj_desc->index_field.start_field_bit_offset, + obj_desc->index_field.base_byte_offset, + obj_desc->field.access_byte_width, + obj_desc->index_field.index_obj, obj_desc->index_field.data_obj)); break; + + default: + /* No other types should get here */ + break; } /* @@ -367,10 +421,10 @@ * preserving the current type of that Named_obj. */ status = acpi_ns_attach_object (info->field_node, obj_desc, - (u8) acpi_ns_get_type (info->field_node)); + acpi_ns_get_type (info->field_node)); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "set Named_obj %p (%4.4s) val = %p\n", - info->field_node, (char*)&(info->field_node->name), obj_desc)); + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "set Named_obj %p (%4.4s) val = %p\n", + info->field_node, info->field_node->name.ascii, obj_desc)); /* Remove local reference to the object */ diff -urN linux-2.4.18/drivers/acpi/executer/exregion.c lia64-2.4/drivers/acpi/executer/exregion.c --- linux-2.4.18/drivers/acpi/executer/exregion.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exregion.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exregion - ACPI default Op_region (address space) handlers - * $Revision: 61 $ + * $Revision: 79 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,14 +27,10 @@ #include "acpi.h" #include "acinterp.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "achware.h" -#include "acevents.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exregion") + ACPI_MODULE_NAME ("exregion") /******************************************************************************* @@ -60,7 +56,7 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value, + acpi_integer *value, void *handler_context, void *region_context) { @@ -68,9 +64,12 @@ void *logical_addr_ptr = NULL; acpi_mem_space_context *mem_info = region_context; u32 length; + ACPI_SIZE window_size; +#ifndef _HW_ALIGNMENT_SUPPORT + u32 remainder; +#endif - - FUNCTION_TRACE ("Ex_system_memory_space_handler"); + ACPI_FUNCTION_TRACE ("Ex_system_memory_space_handler"); /* Validate and translate the bit width */ @@ -88,14 +87,28 @@ length = 4; break; + case 64: + length = 8; + break; + default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid System_memory width %d\n", bit_width)); return_ACPI_STATUS (AE_AML_OPERAND_VALUE); - break; } +#ifndef _HW_ALIGNMENT_SUPPORT + /* + * Hardware does not support non-aligned data transfers, we must verify + * the request. + */ + (void) acpi_ut_short_divide ((acpi_integer *) &address, length, NULL, &remainder); + if (remainder != 0) { + return_ACPI_STATUS (AE_AML_ALIGNMENT); + } +#endif + /* * Does the request fit into the cached memory mapping? * Is 1) Address below the current mapping? OR @@ -115,61 +128,80 @@ mem_info->mapped_length); } - mem_info->mapped_length = 0; /* In case of failure below */ + /* + * Don't attempt to map memory beyond the end of the region, and + * constrain the maximum mapping size to something reasonable. + */ + window_size = (ACPI_SIZE) ((mem_info->address + mem_info->length) - address); + if (window_size > SYSMEM_REGION_WINDOW_SIZE) { + window_size = SYSMEM_REGION_WINDOW_SIZE; + } /* Create a new mapping starting at the address given */ - status = acpi_os_map_memory (address, SYSMEM_REGION_WINDOW_SIZE, + status = acpi_os_map_memory (address, window_size, (void **) &mem_info->mapped_logical_address); if (ACPI_FAILURE (status)) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %8.8X%8.8X, size %X\n", + ACPI_HIDWORD (address), ACPI_LODWORD (address), (u32) window_size)); + mem_info->mapped_length = 0; return_ACPI_STATUS (status); } /* Save the physical address and mapping size */ mem_info->mapped_physical_address = address; - mem_info->mapped_length = SYSMEM_REGION_WINDOW_SIZE; + mem_info->mapped_length = window_size; } - /* * Generate a logical pointer corresponding to the address we want to * access */ - - /* TBD: should these pointers go to 64-bit in all cases ? */ - logical_addr_ptr = mem_info->mapped_logical_address + ((acpi_integer) address - (acpi_integer) mem_info->mapped_physical_address); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "System_memory %d (%d width) Address=%8.8X%8.8X\n", function, bit_width, - HIDWORD (address), LODWORD (address))); - - /* Perform the memory read or write */ + ACPI_HIDWORD (address), ACPI_LODWORD (address))); + /* + * Perform the memory read or write + * + * Note: For machines that do not support non-aligned transfers, the target + * address was checked for alignment above. We do not attempt to break the + * transfer up into smaller (byte-size) chunks because the AML specifically + * asked for a transfer width that the hardware may require. + */ switch (function) { + case ACPI_READ: - case ACPI_READ_ADR_SPACE: - + *value = 0; switch (bit_width) { case 8: - *value = (u32)* (u8 *) logical_addr_ptr; + *value = (acpi_integer) *((u8 *) logical_addr_ptr); break; case 16: - MOVE_UNALIGNED16_TO_32 (value, logical_addr_ptr); + *value = (acpi_integer) *((u16 *) logical_addr_ptr); break; case 32: - MOVE_UNALIGNED32_TO_32 (value, logical_addr_ptr); + *value = (acpi_integer) *((u32 *) logical_addr_ptr); break; - } +#if ACPI_MACHINE_WIDTH != 16 + case 64: + *value = (acpi_integer) *((u64 *) logical_addr_ptr); + break; +#endif + default: + /* Bit_width was already validated */ + break; + } break; - - case ACPI_WRITE_ADR_SPACE: + case ACPI_WRITE: switch (bit_width) { case 8: @@ -177,16 +209,24 @@ break; case 16: - MOVE_UNALIGNED16_TO_16 (logical_addr_ptr, value); + *(u16 *) logical_addr_ptr = (u16) *value; break; case 32: - MOVE_UNALIGNED32_TO_32 (logical_addr_ptr, value); + *(u32 *) logical_addr_ptr = (u32) *value; break; - } - break; +#if ACPI_MACHINE_WIDTH != 16 + case 64: + *(u64 *) logical_addr_ptr = (u64) *value; + break; +#endif + default: + /* Bit_width was already validated */ + break; + } + break; default: status = AE_BAD_PARAMETER; @@ -220,37 +260,34 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value, + acpi_integer *value, void *handler_context, void *region_context) { acpi_status status = AE_OK; - FUNCTION_TRACE ("Ex_system_io_space_handler"); + ACPI_FUNCTION_TRACE ("Ex_system_io_space_handler"); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "System_iO %d (%d width) Address=%8.8X%8.8X\n", function, bit_width, - HIDWORD (address), LODWORD (address))); + ACPI_HIDWORD (address), ACPI_LODWORD (address))); /* Decode the function parameter */ switch (function) { - - case ACPI_READ_ADR_SPACE: + case ACPI_READ: *value = 0; status = acpi_os_read_port ((ACPI_IO_ADDRESS) address, value, bit_width); break; - - case ACPI_WRITE_ADR_SPACE: + case ACPI_WRITE: status = acpi_os_write_port ((ACPI_IO_ADDRESS) address, *value, bit_width); break; - default: status = AE_BAD_PARAMETER; break; @@ -283,7 +320,7 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value, + acpi_integer *value, void *handler_context, void *region_context) { @@ -292,11 +329,11 @@ u16 pci_register; - FUNCTION_TRACE ("Ex_pci_config_space_handler"); + ACPI_FUNCTION_TRACE ("Ex_pci_config_space_handler"); /* - * The arguments to Acpi_os(Read|Write)Pci_cfg(Byte|Word|Dword) are: + * The arguments to Acpi_os(Read|Write)Pci_configuration are: * * Pci_segment is the PCI bus segment range 0-31 * Pci_bus is the PCI bus number range 0-255 @@ -308,7 +345,7 @@ * */ pci_id = (acpi_pci_id *) region_context; - pci_register = (u16) address; + pci_register = (u16) (u32) address; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Pci_config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n", @@ -316,20 +353,17 @@ pci_id->function, pci_register)); switch (function) { - - case ACPI_READ_ADR_SPACE: + case ACPI_READ: *value = 0; status = acpi_os_read_pci_configuration (pci_id, pci_register, value, bit_width); break; - - case ACPI_WRITE_ADR_SPACE: + case ACPI_WRITE: status = acpi_os_write_pci_configuration (pci_id, pci_register, *value, bit_width); break; - default: status = AE_BAD_PARAMETER; @@ -363,14 +397,14 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value, + acpi_integer *value, void *handler_context, void *region_context) { acpi_status status = AE_OK; - FUNCTION_TRACE ("Ex_cmos_space_handler"); + ACPI_FUNCTION_TRACE ("Ex_cmos_space_handler"); return_ACPI_STATUS (status); @@ -400,16 +434,76 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value, + acpi_integer *value, void *handler_context, void *region_context) { acpi_status status = AE_OK; - FUNCTION_TRACE ("Ex_pci_bar_space_handler"); + ACPI_FUNCTION_TRACE ("Ex_pci_bar_space_handler"); return_ACPI_STATUS (status); } + + +/******************************************************************************* + * + * FUNCTION: Acpi_ex_data_table_space_handler + * + * PARAMETERS: Function - Read or Write operation + * Address - Where in the space to read or write + * Bit_width - Field width in bits (8, 16, or 32) + * Value - Pointer to in or out value + * Handler_context - Pointer to Handler's context + * Region_context - Pointer to context specific to the + * accessed region + * + * RETURN: Status + * + * DESCRIPTION: Handler for the Data Table address space (Op Region) + * + ******************************************************************************/ + +acpi_status +acpi_ex_data_table_space_handler ( + u32 function, + ACPI_PHYSICAL_ADDRESS address, + u32 bit_width, + acpi_integer *value, + void *handler_context, + void *region_context) +{ + acpi_status status = AE_OK; + u32 byte_width = ACPI_DIV_8 (bit_width); + u32 i; + char *logical_addr_ptr; + + + ACPI_FUNCTION_TRACE ("Ex_data_table_space_handler"); + + + logical_addr_ptr = ACPI_PHYSADDR_TO_PTR (address); + + + /* Perform the memory read or write */ + + switch (function) { + case ACPI_READ: + + for (i = 0; i < byte_width; i++) { + ((char *) value) [i] = logical_addr_ptr[i]; + } + break; + + case ACPI_WRITE: + default: + + return_ACPI_STATUS (AE_SUPPORT); + } + + return_ACPI_STATUS (status); +} + diff -urN linux-2.4.18/drivers/acpi/executer/exresnte.c lia64-2.4/drivers/acpi/executer/exresnte.c --- linux-2.4.18/drivers/acpi/executer/exresnte.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exresnte.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exresnte - AML Interpreter object resolution - * $Revision: 43 $ + * $Revision: 53 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,16 +27,13 @@ #include "acpi.h" #include "amlcode.h" -#include "acparser.h" #include "acdispat.h" #include "acinterp.h" #include "acnamesp.h" -#include "actables.h" -#include "acevents.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exresnte") + ACPI_MODULE_NAME ("exresnte") /******************************************************************************* @@ -44,7 +41,7 @@ * FUNCTION: Acpi_ex_resolve_node_to_value * * PARAMETERS: Object_ptr - Pointer to a location that contains - * a pointer to a NS node, and will recieve a + * a pointer to a NS node, and will receive a * pointer to the resolved object. * Walk_state - Current state. Valid only if executing AML * code. NULL if simply resolving an object @@ -75,25 +72,24 @@ acpi_operand_object *source_desc; acpi_operand_object *obj_desc = NULL; acpi_namespace_node *node; - acpi_object_type8 entry_type; + acpi_object_type entry_type; acpi_integer temp_val; - FUNCTION_TRACE ("Ex_resolve_node_to_value"); + ACPI_FUNCTION_TRACE ("Ex_resolve_node_to_value"); /* * The stack pointer points to a acpi_namespace_node (Node). Get the * object that is attached to the Node. */ - node = *object_ptr; - source_desc = acpi_ns_get_attached_object (node); + node = *object_ptr; + source_desc = acpi_ns_get_attached_object (node); entry_type = acpi_ns_get_type ((acpi_handle) node); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p Source_desc=%p Type=%X\n", node, source_desc, entry_type)); - /* * Several object types require no further processing: * 1) Devices rarely have an attached object, return the Node @@ -115,7 +111,6 @@ * of the attached object or pointer */ switch (entry_type) { - case ACPI_TYPE_PACKAGE: if (ACPI_TYPE_PACKAGE != source_desc->common.type) { @@ -124,10 +119,13 @@ return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } - /* Return an additional reference to the object */ + status = acpi_ds_get_package_arguments (source_desc); + if (ACPI_SUCCESS (status)) { + /* Return an additional reference to the object */ - obj_desc = source_desc; - acpi_ut_add_reference (obj_desc); + obj_desc = source_desc; + acpi_ut_add_reference (obj_desc); + } break; @@ -139,10 +137,13 @@ return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } - /* Return an additional reference to the object */ + status = acpi_ds_get_buffer_arguments (source_desc); + if (ACPI_SUCCESS (status)) { + /* Return an additional reference to the object */ - obj_desc = source_desc; - acpi_ut_add_reference (obj_desc); + obj_desc = source_desc; + acpi_ut_add_reference (obj_desc); + } break; @@ -184,10 +185,9 @@ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Node=%p Source_desc=%p Type=%X\n", node, source_desc, entry_type)); - status = acpi_ex_read_data_from_field (source_desc, &obj_desc); + status = acpi_ex_read_data_from_field (walk_state, source_desc, &obj_desc); break; - /* * For these objects, just return the object attached to the Node */ @@ -214,7 +214,6 @@ node)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */ - break; /* diff -urN linux-2.4.18/drivers/acpi/executer/exresolv.c lia64-2.4/drivers/acpi/executer/exresolv.c --- linux-2.4.18/drivers/acpi/executer/exresolv.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exresolv.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exresolv - AML Interpreter object resolution - * $Revision: 101 $ + * $Revision: 111 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,121 +27,12 @@ #include "acpi.h" #include "amlcode.h" -#include "acparser.h" #include "acdispat.h" #include "acinterp.h" -#include "acnamesp.h" -#include "actables.h" -#include "acevents.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exresolv") - - -/******************************************************************************* - * - * FUNCTION: Acpi_ex_get_buffer_field_value - * - * PARAMETERS: *Obj_desc - Pointer to a Buffer_field - * *Result_desc - Pointer to an empty descriptor which will - * become an Integer with the field's value - * - * RETURN: Status - * - * DESCRIPTION: Retrieve the value from a Buffer_field - * - ******************************************************************************/ - -acpi_status -acpi_ex_get_buffer_field_value ( - acpi_operand_object *obj_desc, - acpi_operand_object *result_desc) -{ - acpi_status status; - u32 mask; - u8 *location; - - - FUNCTION_TRACE ("Ex_get_buffer_field_value"); - - - /* - * Parameter validation - */ - if (!obj_desc) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null field pointer\n")); - return_ACPI_STATUS (AE_AML_NO_OPERAND); - } - - if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) { - status = acpi_ds_get_buffer_field_arguments (obj_desc); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - } - - if (!obj_desc->buffer_field.buffer_obj) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null container pointer\n")); - return_ACPI_STATUS (AE_AML_INTERNAL); - } - - if (ACPI_TYPE_BUFFER != obj_desc->buffer_field.buffer_obj->common.type) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - container is not a Buffer\n")); - return_ACPI_STATUS (AE_AML_OPERAND_TYPE); - } - - if (!result_desc) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null result pointer\n")); - return_ACPI_STATUS (AE_AML_INTERNAL); - } - - - /* Field location is (base of buffer) + (byte offset) */ - - location = obj_desc->buffer_field.buffer_obj->buffer.pointer - + obj_desc->buffer_field.base_byte_offset; - - /* - * Construct Mask with as many 1 bits as the field width - * - * NOTE: Only the bottom 5 bits are valid for a shift operation, so - * special care must be taken for any shift greater than 31 bits. - * - * TBD: [Unhandled] Fields greater than 32 bits will not work. - */ - if (obj_desc->buffer_field.bit_length < 32) { - mask = ((u32) 1 << obj_desc->buffer_field.bit_length) - (u32) 1; - } - else { - mask = ACPI_UINT32_MAX; - } - - result_desc->integer.type = (u8) ACPI_TYPE_INTEGER; - - /* Get the 32 bit value at the location */ - - MOVE_UNALIGNED32_TO_32 (&result_desc->integer.value, location); - - /* - * Shift the 32-bit word containing the field, and mask off the - * resulting value - */ - result_desc->integer.value = - (result_desc->integer.value >> obj_desc->buffer_field.start_field_bit_offset) & mask; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "** Read from buffer %p byte %d bit %d width %d addr %p mask %08X val %8.8X%8.8X\n", - obj_desc->buffer_field.buffer_obj->buffer.pointer, - obj_desc->buffer_field.base_byte_offset, - obj_desc->buffer_field.start_field_bit_offset, - obj_desc->buffer_field.bit_length, - location, mask, - HIDWORD(result_desc->integer.value), - LODWORD(result_desc->integer.value))); - - return_ACPI_STATUS (AE_OK); -} + ACPI_MODULE_NAME ("exresolv") /******************************************************************************* @@ -167,7 +58,7 @@ acpi_status status; - FUNCTION_TRACE_PTR ("Ex_resolve_to_value", stack_ptr); + ACPI_FUNCTION_TRACE_PTR ("Ex_resolve_to_value", stack_ptr); if (!stack_ptr || !*stack_ptr) { @@ -175,13 +66,12 @@ return_ACPI_STATUS (AE_AML_NO_OPERAND); } - /* * The entity pointed to by the Stack_ptr can be either * 1) A valid acpi_operand_object, or * 2) A acpi_namespace_node (Named_obj) */ - if (VALID_DESCRIPTOR_TYPE (*stack_ptr, ACPI_DESC_TYPE_INTERNAL)) { + if (ACPI_GET_DESCRIPTOR_TYPE (*stack_ptr) == ACPI_DESC_TYPE_OPERAND) { status = acpi_ex_resolve_object_to_value (stack_ptr, walk_state); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); @@ -192,16 +82,16 @@ * Object on the stack may have changed if Acpi_ex_resolve_object_to_value() * was called (i.e., we can't use an _else_ here.) */ - if (VALID_DESCRIPTOR_TYPE (*stack_ptr, ACPI_DESC_TYPE_NAMED)) { - status = acpi_ex_resolve_node_to_value ((acpi_namespace_node **) stack_ptr, + if (ACPI_GET_DESCRIPTOR_TYPE (*stack_ptr) == ACPI_DESC_TYPE_NAMED) { + status = acpi_ex_resolve_node_to_value ( + ACPI_CAST_INDIRECT_PTR (acpi_namespace_node, stack_ptr), walk_state); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Resolved object %p\n", *stack_ptr)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Resolved object %p\n", *stack_ptr)); return_ACPI_STATUS (AE_OK); } @@ -233,7 +123,7 @@ u16 opcode; - FUNCTION_TRACE ("Ex_resolve_object_to_value"); + ACPI_FUNCTION_TRACE ("Ex_resolve_object_to_value"); stack_desc = *stack_ptr; @@ -241,13 +131,11 @@ /* This is an acpi_operand_object */ switch (stack_desc->common.type) { - case INTERNAL_TYPE_REFERENCE: opcode = stack_desc->reference.opcode; switch (opcode) { - case AML_NAME_OP: /* @@ -286,11 +174,10 @@ acpi_ut_remove_reference (stack_desc); *stack_ptr = obj_desc; - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "[Arg/Local %d] Value_obj is %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Arg/Local %d] Value_obj is %p\n", stack_desc->reference.offset, obj_desc)); break; - /* * For constants, we must change the reference/constant object * to a real integer object @@ -327,6 +214,10 @@ case AML_REVISION_OP: obj_desc->integer.value = ACPI_CA_SUPPORT_LEVEL; break; + + default: + /* No other opcodes can get here */ + break; } /* @@ -359,7 +250,6 @@ acpi_ut_add_reference (obj_desc); *stack_ptr = obj_desc; } - else { /* * A NULL object descriptor means an unitialized element of @@ -381,7 +271,6 @@ status = AE_AML_INTERNAL; break; } - break; @@ -403,50 +292,36 @@ break; /* case INTERNAL_TYPE_REFERENCE */ - case ACPI_TYPE_BUFFER_FIELD: + case ACPI_TYPE_BUFFER: - obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_ANY); - if (!obj_desc) { - return_ACPI_STATUS (AE_NO_MEMORY); - } + status = acpi_ds_get_buffer_arguments (stack_desc); + break; - status = acpi_ex_get_buffer_field_value (stack_desc, obj_desc); - if (ACPI_FAILURE (status)) { - acpi_ut_remove_reference (obj_desc); - obj_desc = NULL; - } - *stack_ptr = (void *) obj_desc; + case ACPI_TYPE_PACKAGE: + + status = acpi_ds_get_package_arguments (stack_desc); break; + /* + * These cases may never happen here, but just in case.. + */ + case ACPI_TYPE_BUFFER_FIELD: + case INTERNAL_TYPE_REGION_FIELD: case INTERNAL_TYPE_BANK_FIELD: + case INTERNAL_TYPE_INDEX_FIELD: - obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_ANY); - if (!obj_desc) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - /* TBD: WRONG! */ - - status = acpi_ex_get_buffer_field_value (stack_desc, obj_desc); - if (ACPI_FAILURE (status)) { - acpi_ut_remove_reference (obj_desc); - obj_desc = NULL; - } + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Source_desc=%p Type=%X\n", + stack_desc, stack_desc->common.type)); + status = acpi_ex_read_data_from_field (walk_state, stack_desc, &obj_desc); *stack_ptr = (void *) obj_desc; break; - - /* TBD: [Future] - may need to handle Index_field, and Def_field someday */ - default: - break; - - } /* switch (Stack_desc->Common.Type) */ - + } return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/executer/exresop.c lia64-2.4/drivers/acpi/executer/exresop.c --- linux-2.4.18/drivers/acpi/executer/exresop.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exresop.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exresop - AML Interpreter operand/object resolution - * $Revision: 41 $ + * $Revision: 50 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,15 +28,12 @@ #include "acpi.h" #include "amlcode.h" #include "acparser.h" -#include "acdispat.h" #include "acinterp.h" #include "acnamesp.h" -#include "actables.h" -#include "acevents.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exresop") + ACPI_MODULE_NAME ("exresop") /******************************************************************************* @@ -59,7 +56,7 @@ acpi_object_type this_type, void *object) { - PROC_NAME ("Ex_check_object_type"); + ACPI_FUNCTION_NAME ("Ex_check_object_type"); if (type_needed == ACPI_TYPE_ANY) { @@ -69,7 +66,7 @@ } if (type_needed != this_type) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [%s], found [%s] %p\n", acpi_ut_get_type_name (type_needed), acpi_ut_get_type_name (this_type), object)); @@ -85,18 +82,21 @@ * * FUNCTION: Acpi_ex_resolve_operands * - * PARAMETERS: Opcode Opcode being interpreted - * Stack_ptr Top of operand stack + * PARAMETERS: Opcode - Opcode being interpreted + * Stack_ptr - Pointer to the operand stack to be + * resolved + * Walk_state - Current stateu * * RETURN: Status * - * DESCRIPTION: Convert stack entries to required types + * DESCRIPTION: Convert multiple input operands to the types required by the + * target operator. * - * Each nibble in Arg_types represents one required operand - * and indicates the required Type: + * Each nibble (actually 5 bits) in Arg_types represents one required + * operand and indicates the required Type: * - * The corresponding stack entry will be converted to the - * required type if possible, else return an exception + * The corresponding operand will be converted to the required type if + * possible, otherwise we abort with an exception. * ******************************************************************************/ @@ -116,7 +116,7 @@ acpi_object_type type_needed; - FUNCTION_TRACE_U32 ("Ex_resolve_operands", opcode); + ACPI_FUNCTION_TRACE_U32 ("Ex_resolve_operands", opcode); op_info = acpi_ps_get_opcode_info (opcode); @@ -124,7 +124,6 @@ return_ACPI_STATUS (AE_AML_BAD_OPCODE); } - arg_types = op_info->runtime_args; if (arg_types == ARGI_INVALID_OPCODE) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - %X is not a valid AML opcode\n", @@ -133,9 +132,8 @@ return_ACPI_STATUS (AE_AML_INTERNAL); } - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode %X Operand_types=%X \n", - opcode, arg_types)); - + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode %X [%s] Operand_types=%X \n", + opcode, op_info->name, arg_types)); /* * Normal exit is with (Arg_types == 0) at end of argument list. @@ -158,13 +156,17 @@ /* Decode the descriptor type */ - if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) { + switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) { + case ACPI_DESC_TYPE_NAMED: + /* Node */ object_type = ((acpi_namespace_node *) obj_desc)->type; - } + break; + + + case ACPI_DESC_TYPE_OPERAND: - else if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_INTERNAL)) { /* ACPI internal object */ object_type = obj_desc->common.type; @@ -187,7 +189,6 @@ return_ACPI_STATUS (AE_AML_BAD_OPCODE); } - switch (obj_desc->reference.opcode) { case AML_ZERO_OP: case AML_ONE_OP: @@ -199,27 +200,28 @@ case AML_LOCAL_OP: case AML_REVISION_OP: - DEBUG_ONLY_MEMBERS (ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + ACPI_DEBUG_ONLY_MEMBERS (ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Reference Opcode: %s\n", op_info->name))); break; default: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Reference Opcode: Unknown [%02x]\n", obj_desc->reference.opcode)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); - break; } } - } + break; + + + default: - else { /* Invalid descriptor */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Bad descriptor type %X in Obj %p\n", - obj_desc->common.data_type, obj_desc)); + ACPI_GET_DESCRIPTOR_TYPE (obj_desc), obj_desc)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -231,24 +233,36 @@ this_arg_type = GET_CURRENT_ARG_TYPE (arg_types); INCREMENT_ARG_LIST (arg_types); - /* * Handle cases where the object does not need to be * resolved to a value */ switch (this_arg_type) { + case ARGI_REF_OR_STRING: /* Can be a String or Reference */ - case ARGI_REFERENCE: /* References */ + if ((ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_OPERAND) && + (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_STRING)) { + /* + * String found - the string references a named object and must be + * resolved to a node + */ + goto next_operand; + } + + /* Else not a string - fall through to the normal Reference case below */ + /*lint -fallthrough */ + + case ARGI_REFERENCE: /* References: */ case ARGI_INTEGER_REF: case ARGI_OBJECT_REF: case ARGI_DEVICE_REF: - case ARGI_TARGETREF: /* TBD: must implement implicit conversion rules before store */ + case ARGI_TARGETREF: /* Allows implicit conversion rules before store */ case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */ - case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */ + case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */ /* Need an operand of type INTERNAL_TYPE_REFERENCE */ - if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) /* direct name ptr OK as-is */ { + if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) /* Node (name) ptr OK as-is */ { goto next_operand; } @@ -258,7 +272,6 @@ return_ACPI_STATUS (status); } - if (AML_NAME_OP == obj_desc->reference.opcode) { /* * Convert an indirect name ptr to direct name ptr and put @@ -268,9 +281,7 @@ acpi_ut_remove_reference (obj_desc); (*stack_ptr) = temp_node; } - goto next_operand; - break; case ARGI_ANYTYPE: @@ -287,6 +298,10 @@ goto next_operand; } break; + + default: + /* All cases covered above */ + break; } @@ -298,7 +313,6 @@ return_ACPI_STATUS (status); } - /* * Check the resulting object (value) type */ @@ -362,7 +376,7 @@ status = acpi_ex_convert_to_integer (*stack_ptr, stack_ptr, walk_state); if (ACPI_FAILURE (status)) { if (status == AE_TYPE) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_type_name ((*stack_ptr)->common.type), *stack_ptr)); @@ -371,9 +385,7 @@ return_ACPI_STATUS (status); } - goto next_operand; - break; case ARGI_BUFFER: @@ -385,7 +397,7 @@ status = acpi_ex_convert_to_buffer (*stack_ptr, stack_ptr, walk_state); if (ACPI_FAILURE (status)) { if (status == AE_TYPE) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_type_name ((*stack_ptr)->common.type), *stack_ptr)); @@ -394,9 +406,7 @@ return_ACPI_STATUS (status); } - goto next_operand; - break; case ARGI_STRING: @@ -408,7 +418,7 @@ status = acpi_ex_convert_to_string (*stack_ptr, stack_ptr, 16, ACPI_UINT32_MAX, walk_state); if (ACPI_FAILURE (status)) { if (status == AE_TYPE) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_type_name ((*stack_ptr)->common.type), *stack_ptr)); @@ -417,82 +427,109 @@ return_ACPI_STATUS (status); } - goto next_operand; - break; case ARGI_COMPUTEDATA: /* Need an operand of type INTEGER, STRING or BUFFER */ - if ((ACPI_TYPE_INTEGER != (*stack_ptr)->common.type) && - (ACPI_TYPE_STRING != (*stack_ptr)->common.type) && - (ACPI_TYPE_BUFFER != (*stack_ptr)->common.type)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + switch ((*stack_ptr)->common.type) { + case ACPI_TYPE_INTEGER: + case ACPI_TYPE_STRING: + case ACPI_TYPE_BUFFER: + + /* Valid operand */ + break; + + default: + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_type_name ((*stack_ptr)->common.type), *stack_ptr)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } goto next_operand; - break; case ARGI_DATAOBJECT: /* * ARGI_DATAOBJECT is only used by the Size_of operator. + * Need a buffer, string, package, or Node reference. * - * The ACPI specification allows Size_of to return the size of - * a Buffer, String or Package. However, the MS ACPI.SYS AML - * Interpreter also allows an Node reference to return without - * error with a size of 4. - */ - - /* Need a buffer, string, package or Node reference */ - - if (((*stack_ptr)->common.type != ACPI_TYPE_BUFFER) && - ((*stack_ptr)->common.type != ACPI_TYPE_STRING) && - ((*stack_ptr)->common.type != ACPI_TYPE_PACKAGE) && - ((*stack_ptr)->common.type != INTERNAL_TYPE_REFERENCE)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Needed [Buf/Str/Pkg/Ref], found [%s] %p\n", - acpi_ut_get_type_name ((*stack_ptr)->common.type), *stack_ptr)); - - return_ACPI_STATUS (AE_AML_OPERAND_TYPE); - } - - /* - * If this is a reference, only allow a reference to an Node. + * The only reference allowed here is a direct reference to + * a namespace node. */ if ((*stack_ptr)->common.type == INTERNAL_TYPE_REFERENCE) { if (!(*stack_ptr)->reference.node) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Node Reference], found [%p]\n", *stack_ptr)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } + + /* Get the object attached to the node */ + + temp_node = acpi_ns_get_attached_object ((*stack_ptr)->reference.node); + if (!temp_node) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Node [%p] has no attached object\n", + (*stack_ptr)->reference.node)); + + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); + } + + /* + * Swap the reference object with the node's object. Must add + * a reference to the node object, and remove a reference from + * the original reference object. + */ + acpi_ut_add_reference (temp_node); + acpi_ut_remove_reference (*stack_ptr); + (*stack_ptr) = temp_node; + } + + /* Need a buffer, string, package */ + + switch ((*stack_ptr)->common.type) { + case ACPI_TYPE_PACKAGE: + case ACPI_TYPE_STRING: + case ACPI_TYPE_BUFFER: + + /* Valid operand */ + break; + + default: + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Needed [Buf/Str/Pkg], found [%s] %p\n", + acpi_ut_get_type_name ((*stack_ptr)->common.type), *stack_ptr)); + + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } goto next_operand; - break; case ARGI_COMPLEXOBJ: /* Need a buffer or package or (ACPI 2.0) String */ - if (((*stack_ptr)->common.type != ACPI_TYPE_BUFFER) && - ((*stack_ptr)->common.type != ACPI_TYPE_STRING) && - ((*stack_ptr)->common.type != ACPI_TYPE_PACKAGE)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Needed [Buf/Pkg], found [%s] %p\n", + switch ((*stack_ptr)->common.type) { + case ACPI_TYPE_PACKAGE: + case ACPI_TYPE_STRING: + case ACPI_TYPE_BUFFER: + + /* Valid operand */ + break; + + default: + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Needed [Buf/Str/Pkg], found [%s] %p\n", acpi_ut_get_type_name ((*stack_ptr)->common.type), *stack_ptr)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } goto next_operand; - break; default: @@ -506,7 +543,6 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* * Make sure that the original object was resolved to the * required object type (Simple cases only). @@ -517,7 +553,6 @@ return_ACPI_STATUS (status); } - next_operand: /* * If more operands needed, decrement Stack_ptr to point @@ -528,7 +563,6 @@ } } /* while (*Types) */ - return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/executer/exstore.c lia64-2.4/drivers/acpi/executer/exstore.c --- linux-2.4.18/drivers/acpi/executer/exstore.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exstore.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exstore - AML Interpreter object store support - * $Revision: 150 $ + * $Revision: 164 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,16 +26,14 @@ #include "acpi.h" -#include "acparser.h" #include "acdispat.h" #include "acinterp.h" #include "amlcode.h" #include "acnamesp.h" -#include "actables.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exstore") + ACPI_MODULE_NAME ("exstore") /******************************************************************************* @@ -46,13 +44,15 @@ * *Dest_desc - Where to store it. Must be an NS node * or an acpi_operand_object of type * Reference; + * Walk_state - Current walk state * * RETURN: Status * * DESCRIPTION: Store the value described by Source_desc into the location * described by Dest_desc. Called by various interpreter * functions to store the result of an operation into - * the destination operand. + * the destination operand -- not just simply the actual "Store" + * ASL operator. * ******************************************************************************/ @@ -66,19 +66,19 @@ acpi_operand_object *ref_desc = dest_desc; - FUNCTION_TRACE_PTR ("Ex_store", dest_desc); + ACPI_FUNCTION_TRACE_PTR ("Ex_store", dest_desc); /* Validate parameters */ if (!source_desc || !dest_desc) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null pointer\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null parameter\n")); return_ACPI_STATUS (AE_AML_NO_OPERAND); } /* Dest_desc can be either a namespace node or an ACPI object */ - if (VALID_DESCRIPTOR_TYPE (dest_desc, ACPI_DESC_TYPE_NAMED)) { + if (ACPI_GET_DESCRIPTOR_TYPE (dest_desc) == ACPI_DESC_TYPE_NAMED) { /* * Dest is a namespace node, * Storing an object into a Name "container" @@ -86,12 +86,9 @@ status = acpi_ex_store_object_to_node (source_desc, (acpi_namespace_node *) dest_desc, walk_state); - /* All done, that's it */ - return_ACPI_STATUS (status); } - /* Destination object must be an object of type Reference */ if (dest_desc->common.type != INTERNAL_TYPE_REFERENCE) { @@ -100,15 +97,14 @@ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Destination is not a Reference_obj [%p]\n", dest_desc)); - DUMP_STACK_ENTRY (source_desc); - DUMP_STACK_ENTRY (dest_desc); - DUMP_OPERANDS (&dest_desc, IMODE_EXECUTE, "Ex_store", + ACPI_DUMP_STACK_ENTRY (source_desc); + ACPI_DUMP_STACK_ENTRY (dest_desc); + ACPI_DUMP_OPERANDS (&dest_desc, ACPI_IMODE_EXECUTE, "Ex_store", 2, "Target is not a Reference_obj"); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } - /* * Examine the Reference opcode. These cases are handled: * @@ -119,7 +115,6 @@ * 5) Store to a constant -- a noop */ switch (ref_desc->reference.opcode) { - case AML_NAME_OP: /* Storing an object into a Name "container" */ @@ -153,7 +148,7 @@ * Storing to the Debug object causes the value stored to be * displayed and otherwise has no effect -- see ACPI Specification */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Write to Debug Object: ****:\n\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "**** Write to Debug Object: ****:\n\n")); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %s: ", acpi_ut_get_type_name (source_desc->common.type))); @@ -161,15 +156,16 @@ switch (source_desc->common.type) { case ACPI_TYPE_INTEGER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%X (%d)\n", - (u32) source_desc->integer.value, (u32) source_desc->integer.value)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%8.8X%8.8X\n", + ACPI_HIWORD (source_desc->integer.value), + ACPI_LOWORD (source_desc->integer.value))); break; case ACPI_TYPE_BUFFER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Length 0x%X\n", - (u32) source_desc->buffer.length)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Length %.2X\n", + (u32) source_desc->buffer.length)); break; @@ -181,18 +177,19 @@ case ACPI_TYPE_PACKAGE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Elements - 0x%X\n", - (u32) source_desc->package.elements)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Elements Ptr - %p\n", + source_desc->package.elements)); break; default: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "@0x%p\n", source_desc)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Type %s %p\n", + acpi_ut_get_type_name (source_desc->common.type), source_desc)); break; } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "\n")); break; @@ -202,27 +199,23 @@ case AML_REVISION_OP: /* - * Storing to a constant is a no-op -- see ACPI Specification - * Delete the reference descriptor, however + * Storing to a constant is a no-op according to the ACPI + * Specification. (Delete the reference descriptor, however.) */ break; default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - Unknown Reference subtype %02x\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Reference subtype %02x\n", ref_desc->reference.opcode)); - - /* TBD: [Restructure] use object dump routine !! */ - - DUMP_BUFFER (ref_desc, sizeof (acpi_operand_object)); + ACPI_DUMP_ENTRY (ref_desc, ACPI_LV_ERROR); status = AE_AML_INTERNAL; break; } /* switch (Ref_desc->Reference.Opcode) */ - return_ACPI_STATUS (status); } @@ -231,36 +224,36 @@ * * FUNCTION: Acpi_ex_store_object_to_index * - * PARAMETERS: *Source_desc - Value to be stored - * *Node - Named object to receive the value + * PARAMETERS: *Source_desc - Value to be stored + * *Dest_desc - Named object to receive the value + * Walk_state - Current walk state * * RETURN: Status * - * DESCRIPTION: Store the object to the named object. + * DESCRIPTION: Store the object to indexed Buffer or Package element * ******************************************************************************/ acpi_status acpi_ex_store_object_to_index ( acpi_operand_object *source_desc, - acpi_operand_object *dest_desc, + acpi_operand_object *index_desc, acpi_walk_state *walk_state) { acpi_status status = AE_OK; acpi_operand_object *obj_desc; - u32 length; - u32 i; + acpi_operand_object *new_desc; u8 value = 0; - FUNCTION_TRACE ("Ex_store_object_to_index"); + ACPI_FUNCTION_TRACE ("Ex_store_object_to_index"); /* * Destination must be a reference pointer, and * must point to either a buffer or a package */ - switch (dest_desc->reference.target_type) { + switch (index_desc->reference.target_type) { case ACPI_TYPE_PACKAGE: /* * Storing to a package element is not simple. The source must be @@ -268,95 +261,48 @@ * source is copied into the destination - we can't just point to the * source object. */ - if (dest_desc->reference.target_type == ACPI_TYPE_PACKAGE) { - /* - * The object at *(Dest_desc->Reference.Where) is the - * element within the package that is to be modified. - */ - obj_desc = *(dest_desc->reference.where); - if (obj_desc) { - /* - * If the Destination element is a package, we will delete - * that object and construct a new one. - * - * TBD: [Investigate] Should both the src and dest be required - * to be packages? - * && (Source_desc->Common.Type == ACPI_TYPE_PACKAGE) - */ - if (obj_desc->common.type == ACPI_TYPE_PACKAGE) { - /* Take away the reference for being part of a package */ - - acpi_ut_remove_reference (obj_desc); - obj_desc = NULL; - } - } - - if (!obj_desc) { - /* - * If the Obj_desc is NULL, it means that an uninitialized package - * element has been used as a destination (this is OK), therefore, - * we must create the destination element to match the type of the - * source element NOTE: Source_desccan be of any type. - */ - obj_desc = acpi_ut_create_internal_object (source_desc->common.type); - if (!obj_desc) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - /* - * If the source is a package, copy the source to the new dest - */ - if (ACPI_TYPE_PACKAGE == obj_desc->common.type) { - status = acpi_ut_copy_ipackage_to_ipackage (source_desc, obj_desc, walk_state); - if (ACPI_FAILURE (status)) { - acpi_ut_remove_reference (obj_desc); - return_ACPI_STATUS (status); - } - } - - /* Install the new descriptor into the package */ - - *(dest_desc->reference.where) = obj_desc; - } - - if (ACPI_TYPE_PACKAGE != obj_desc->common.type) { - /* - * The destination element is not a package, so we need to - * convert the contents of the source (Source_desc) and copy into - * the destination (Obj_desc) - */ - status = acpi_ex_store_object_to_object (source_desc, obj_desc, - walk_state); - if (ACPI_FAILURE (status)) { - /* - * An error occurrered when copying the internal object - * so delete the reference. - */ - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Unable to copy the internal object\n")); - return_ACPI_STATUS (AE_AML_OPERAND_TYPE); - } - } + /* + * The object at *(Index_desc->Reference.Where) is the + * element within the package that is to be modified. + */ + obj_desc = *(index_desc->reference.where); + + /* Do the conversion/store */ + + status = acpi_ex_store_object_to_object (source_desc, obj_desc, &new_desc, + walk_state); + if (ACPI_FAILURE (status)) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Could not store object to indexed package element\n")); + return_ACPI_STATUS (status); + } + + /* + * If a new object was created, we must install it as the new + * package element + */ + if (new_desc != obj_desc) { + acpi_ut_remove_reference (obj_desc); + *(index_desc->reference.where) = new_desc; } break; case ACPI_TYPE_BUFFER_FIELD: - - /* TBD: can probably call the generic Buffer/Field routines */ - /* - * Storing into a buffer at a location defined by an Index. + * Store into a Buffer (not actually a real Buffer_field) at a + * location defined by an Index. * - * Each 8-bit element of the source object is written to the - * 8-bit Buffer Field of the Index destination object. + * The first 8-bit element of the source object is written to the + * 8-bit Buffer location defined by the Index destination object, + * according to the ACPI 2.0 specification. */ /* - * Set the Obj_desc to the destination object and type check. + * Make sure the target is a Buffer */ - obj_desc = dest_desc->reference.object; + obj_desc = index_desc->reference.object; if (obj_desc->common.type != ACPI_TYPE_BUFFER) { return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -367,65 +313,45 @@ */ switch (source_desc->common.type) { case ACPI_TYPE_INTEGER: - /* - * Type is Integer, assign bytewise - * This loop to assign each of the elements is somewhat - * backward because of the Big Endian-ness of IA-64 - */ - length = sizeof (acpi_integer); - for (i = length; i != 0; i--) { - value = (u8)(source_desc->integer.value >> (MUL_8 (i - 1))); - obj_desc->buffer.pointer[dest_desc->reference.offset] = value; - } - break; + /* Use the least-significant byte of the integer */ - case ACPI_TYPE_BUFFER: - /* - * Type is Buffer, the Length is in the structure. - * Just loop through the elements and assign each one in turn. - */ - length = source_desc->buffer.length; - for (i = 0; i < length; i++) { - value = source_desc->buffer.pointer[i]; - obj_desc->buffer.pointer[dest_desc->reference.offset] = value; - } + value = (u8) (source_desc->integer.value); break; + case ACPI_TYPE_BUFFER: - case ACPI_TYPE_STRING: - /* - * Type is String, the Length is in the structure. - * Just loop through the elements and assign each one in turn. - */ - length = source_desc->string.length; - for (i = 0; i < length; i++) { - value = source_desc->string.pointer[i]; - obj_desc->buffer.pointer[dest_desc->reference.offset] = value; - } + value = source_desc->buffer.pointer[0]; break; + case ACPI_TYPE_STRING: + + value = (u8) source_desc->string.pointer[0]; + break; default: - /* Other types are invalid */ + /* All other types are invalid */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Source must be Number/Buffer/String type, not %X\n", - source_desc->common.type)); - status = AE_AML_OPERAND_TYPE; - break; + "Source must be Integer/Buffer/String type, not %s\n", + acpi_ut_get_type_name (source_desc->common.type))); + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } + + /* Store the source value into the target buffer byte */ + + obj_desc->buffer.pointer[index_desc->reference.offset] = value; break; default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Target is not a Package or Buffer_field\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Target is not a Package or Buffer_field\n")); status = AE_AML_OPERAND_TYPE; break; } - return_ACPI_STATUS (status); } @@ -434,15 +360,16 @@ * * FUNCTION: Acpi_ex_store_object_to_node * - * PARAMETERS: *Source_desc - Value to be stored - * *Node - Named object to receive the value + * PARAMETERS: Source_desc - Value to be stored + * Node - Named object to receive the value + * Walk_state - Current walk state * * RETURN: Status * * DESCRIPTION: Store the object to the named object. * * The Assignment of an object to a named object is handled here - * The val passed in will replace the current value (if any) + * The value passed in will replace the current value (if any) * with the input value. * * When storing into an object the data is converted to the @@ -450,10 +377,7 @@ * that the target object type (for an initialized target) will * not be changed by a store operation. * - * NOTE: the global lock is acquired early. This will result - * in the global lock being held a bit longer. Also, if the - * function fails during set up we may get the lock when we - * don't really need it. I don't think we care. + * Assumes parameters are already validated. * ******************************************************************************/ @@ -465,15 +389,12 @@ { acpi_status status = AE_OK; acpi_operand_object *target_desc; - acpi_object_type8 target_type = ACPI_TYPE_ANY; - + acpi_operand_object *new_desc; + acpi_object_type target_type; - FUNCTION_TRACE ("Ex_store_object_to_node"); + ACPI_FUNCTION_TRACE_PTR ("Ex_store_object_to_node", source_desc); - /* - * Assuming the parameters were already validated - */ /* * Get current type of the node, and object attached to Node @@ -481,10 +402,9 @@ target_type = acpi_ns_get_type (node); target_desc = acpi_ns_get_attached_object (node); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Storing %p(%s) into node %p(%s)\n", - node, acpi_ut_get_type_name (source_desc->common.type), - source_desc, acpi_ut_get_type_name (target_type))); - + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p(%s) into node %p(%s)\n", + source_desc, acpi_ut_get_type_name (source_desc->common.type), + node, acpi_ut_get_type_name (target_type))); /* * Resolve the source object to an actual value @@ -495,7 +415,6 @@ return_ACPI_STATUS (status); } - /* * Do the actual store operation */ @@ -522,28 +441,30 @@ * * Copy and/or convert the source object to a new target object */ - status = acpi_ex_store_object (source_desc, target_type, &target_desc, walk_state); + status = acpi_ex_store_object_to_object (source_desc, target_desc, &new_desc, walk_state); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } - /* - * Store the new Target_desc as the new value of the Name, and set - * the Name's type to that of the value being stored in it. - * Source_desc reference count is incremented by Attach_object. - */ - status = acpi_ns_attach_object (node, target_desc, target_type); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Store %s into %s via Convert/Attach\n", - acpi_ut_get_type_name (target_desc->common.type), - acpi_ut_get_type_name (target_type))); + if (new_desc != target_desc) { + /* + * Store the new New_desc as the new value of the Name, and set + * the Name's type to that of the value being stored in it. + * Source_desc reference count is incremented by Attach_object. + */ + status = acpi_ns_attach_object (node, new_desc, target_type); + + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "Store %s into %s via Convert/Attach\n", + acpi_ut_get_type_name (source_desc->common.type), + acpi_ut_get_type_name (new_desc->common.type))); + } break; default: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %s (%p) directly into node (%p), no implicit conversion\n", acpi_ut_get_type_name (source_desc->common.type), source_desc, node)); @@ -553,91 +474,7 @@ break; } - return_ACPI_STATUS (status); } - -/******************************************************************************* - * - * FUNCTION: Acpi_ex_store_object_to_object - * - * PARAMETERS: *Source_desc - Value to be stored - * *Dest_desc - Object to receive the value - * - * RETURN: Status - * - * DESCRIPTION: Store an object to another object. - * - * The Assignment of an object to another (not named) object - * is handled here. - * The val passed in will replace the current value (if any) - * with the input value. - * - * When storing into an object the data is converted to the - * target object type then stored in the object. This means - * that the target object type (for an initialized target) will - * not be changed by a store operation. - * - * This module allows destination types of Number, String, - * and Buffer. - * - ******************************************************************************/ - -acpi_status -acpi_ex_store_object_to_object ( - acpi_operand_object *source_desc, - acpi_operand_object *dest_desc, - acpi_walk_state *walk_state) -{ - acpi_status status = AE_OK; - acpi_object_type8 destination_type = dest_desc->common.type; - - - FUNCTION_TRACE ("Ex_store_object_to_object"); - - - /* - * Assuming the parameters are valid! - */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Storing %p(%s) to %p(%s)\n", - source_desc, acpi_ut_get_type_name (source_desc->common.type), - dest_desc, acpi_ut_get_type_name (dest_desc->common.type))); - - - /* - * From this interface, we only support Integers/Strings/Buffers - */ - switch (destination_type) { - case ACPI_TYPE_INTEGER: - case ACPI_TYPE_STRING: - case ACPI_TYPE_BUFFER: - break; - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Store into %s not implemented\n", - acpi_ut_get_type_name (dest_desc->common.type))); - - return_ACPI_STATUS (AE_NOT_IMPLEMENTED); - } - - - /* - * Resolve the source object to an actual value - * (If it is a reference object) - */ - status = acpi_ex_resolve_object (&source_desc, destination_type, walk_state); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - - - /* - * Copy and/or convert the source object to the destination object - */ - status = acpi_ex_store_object (source_desc, destination_type, &dest_desc, walk_state); - - - return_ACPI_STATUS (status); -} diff -urN linux-2.4.18/drivers/acpi/executer/exstoren.c lia64-2.4/drivers/acpi/executer/exstoren.c --- linux-2.4.18/drivers/acpi/executer/exstoren.c Mon Sep 24 15:06:41 2001 +++ lia64-2.4/drivers/acpi/executer/exstoren.c Tue Jun 11 14:24:22 2002 @@ -3,12 +3,12 @@ * * Module Name: exstoren - AML Interpreter object store support, * Store to Node (namespace object) - * $Revision: 40 $ + * $Revision: 48 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,16 +27,11 @@ #include "acpi.h" -#include "acparser.h" -#include "acdispat.h" #include "acinterp.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "actables.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exstoren") + ACPI_MODULE_NAME ("exstoren") /******************************************************************************* @@ -57,66 +52,61 @@ acpi_status acpi_ex_resolve_object ( acpi_operand_object **source_desc_ptr, - acpi_object_type8 target_type, + acpi_object_type target_type, acpi_walk_state *walk_state) { acpi_operand_object *source_desc = *source_desc_ptr; acpi_status status = AE_OK; - FUNCTION_TRACE ("Ex_resolve_object"); + ACPI_FUNCTION_TRACE ("Ex_resolve_object"); /* - * Ensure we have a Source that can be stored in the target + * Ensure we have a Target that can be stored to */ switch (target_type) { - - /* This case handles the "interchangeable" types Integer, String, and Buffer. */ - - /* - * These cases all require only Integers or values that - * can be converted to Integers (Strings or Buffers) - */ case ACPI_TYPE_BUFFER_FIELD: case INTERNAL_TYPE_REGION_FIELD: case INTERNAL_TYPE_BANK_FIELD: case INTERNAL_TYPE_INDEX_FIELD: + /* + * These cases all require only Integers or values that + * can be converted to Integers (Strings or Buffers) + */ - /* - * Stores into a Field/Region or into a Buffer/String - * are all essentially the same. - */ case ACPI_TYPE_INTEGER: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: + /* + * Stores into a Field/Region or into a Integer/Buffer/String + * are all essentially the same. This case handles the + * "interchangeable" types Integer, String, and Buffer. + */ + if (source_desc->common.type == INTERNAL_TYPE_REFERENCE) { + /* Resolve a reference object first */ - /* TBD: FIX - check for source==REF, resolve, then check type */ + status = acpi_ex_resolve_to_value (source_desc_ptr, walk_state); + if (ACPI_FAILURE (status)) { + break; + } + } /* - * If Source_desc is not a valid type, try to resolve it to one. + * Must have a Integer, Buffer, or String */ if ((source_desc->common.type != ACPI_TYPE_INTEGER) && (source_desc->common.type != ACPI_TYPE_BUFFER) && (source_desc->common.type != ACPI_TYPE_STRING)) { /* - * Initially not a valid type, convert + * Conversion successful but still not a valid type */ - status = acpi_ex_resolve_to_value (source_desc_ptr, walk_state); - if (ACPI_SUCCESS (status) && - (source_desc->common.type != ACPI_TYPE_INTEGER) && - (source_desc->common.type != ACPI_TYPE_BUFFER) && - (source_desc->common.type != ACPI_TYPE_STRING)) { - /* - * Conversion successful but still not a valid type - */ - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Cannot assign type %s to %s (must be type Int/Str/Buf)\n", - acpi_ut_get_type_name ((*source_desc_ptr)->common.type), - acpi_ut_get_type_name (target_type))); - status = AE_AML_OPERAND_TYPE; - } + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Cannot assign type %s to %s (must be type Int/Str/Buf)\n", + acpi_ut_get_type_name (source_desc->common.type), + acpi_ut_get_type_name (target_type))); + status = AE_AML_OPERAND_TYPE; } break; @@ -147,11 +137,11 @@ /******************************************************************************* * - * FUNCTION: Acpi_ex_store_object + * FUNCTION: Acpi_ex_store_object_to_object * * PARAMETERS: Source_desc - Object to store - * Target_type - Current type of the target - * Target_desc_ptr - Pointer to the target + * Dest_desc - Object to receive a copy of the source + * New_desc - New object if Dest_desc is obsoleted * Walk_state - Current walk state * * RETURN: Status @@ -161,93 +151,114 @@ * conversion), and a copy of the value of the source to * the target. * + * The Assignment of an object to another (not named) object + * is handled here. + * The Source passed in will replace the current value (if any) + * with the input value. + * + * When storing into an object the data is converted to the + * target object type then stored in the object. This means + * that the target object type (for an initialized target) will + * not be changed by a store operation. + * + * This module allows destination types of Number, String, + * Buffer, and Package. + * + * Assumes parameters are already validated. NOTE: Source_desc + * resolution (from a reference object) must be performed by + * the caller if necessary. + * ******************************************************************************/ acpi_status -acpi_ex_store_object ( +acpi_ex_store_object_to_object ( acpi_operand_object *source_desc, - acpi_object_type8 target_type, - acpi_operand_object **target_desc_ptr, + acpi_operand_object *dest_desc, + acpi_operand_object **new_desc, acpi_walk_state *walk_state) { - acpi_operand_object *target_desc = *target_desc_ptr; + acpi_operand_object *actual_src_desc; acpi_status status = AE_OK; - FUNCTION_TRACE ("Ex_store_object"); + ACPI_FUNCTION_TRACE_PTR ("Acpi_ex_store_object_to_object", source_desc); - /* - * Perform the "implicit conversion" of the source to the current type - * of the target - As per the ACPI specification. - * - * If no conversion performed, Source_desc is left alone, otherwise it - * is updated with a new object. - */ - status = acpi_ex_convert_to_target_type (target_type, &source_desc, walk_state); - if (ACPI_FAILURE (status)) { + actual_src_desc = source_desc; + if (!dest_desc) { + /* + * There is no destination object (An uninitialized node or + * package element), so we can simply copy the source object + * creating a new destination object + */ + status = acpi_ut_copy_iobject_to_iobject (actual_src_desc, new_desc, walk_state); return_ACPI_STATUS (status); } + if (source_desc->common.type != dest_desc->common.type) { + /* + * The source type does not match the type of the destination. + * Perform the "implicit conversion" of the source to the current type + * of the target as per the ACPI specification. + * + * If no conversion performed, Actual_src_desc = Source_desc. + * Otherwise, Actual_src_desc is a temporary object to hold the + * converted object. + */ + status = acpi_ex_convert_to_target_type (dest_desc->common.type, source_desc, + &actual_src_desc, walk_state); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + } + /* * We now have two objects of identical types, and we can perform a * copy of the *value* of the source object. */ - switch (target_type) { - case ACPI_TYPE_ANY: - case INTERNAL_TYPE_DEF_ANY: - - /* - * The target namespace node is uninitialized (has no target object), - * and will take on the type of the source object - */ - *target_desc_ptr = source_desc; - break; - - + switch (dest_desc->common.type) { case ACPI_TYPE_INTEGER: - target_desc->integer.value = source_desc->integer.value; + dest_desc->integer.value = actual_src_desc->integer.value; /* Truncate value if we are executing from a 32-bit ACPI table */ - acpi_ex_truncate_for32bit_table (target_desc, walk_state); + acpi_ex_truncate_for32bit_table (dest_desc, walk_state); break; case ACPI_TYPE_STRING: - status = acpi_ex_copy_string_to_string (source_desc, target_desc); + status = acpi_ex_store_string_to_string (actual_src_desc, dest_desc); break; - case ACPI_TYPE_BUFFER: - status = acpi_ex_copy_buffer_to_buffer (source_desc, target_desc); + status = acpi_ex_store_buffer_to_buffer (actual_src_desc, dest_desc); break; - case ACPI_TYPE_PACKAGE: - /* - * TBD: [Unhandled] Not real sure what to do here - */ - status = AE_NOT_IMPLEMENTED; + status = acpi_ut_copy_iobject_to_iobject (actual_src_desc, &dest_desc, walk_state); break; - default: - /* * All other types come here. */ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Store into type %s not implemented\n", - acpi_ut_get_type_name (target_type))); + acpi_ut_get_type_name (dest_desc->common.type))); status = AE_NOT_IMPLEMENTED; break; } + if (actual_src_desc != source_desc) { + /* Delete the intermediate (temporary) source object */ + + acpi_ut_remove_reference (actual_src_desc); + } + *new_desc = dest_desc; return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/executer/exstorob.c lia64-2.4/drivers/acpi/executer/exstorob.c --- linux-2.4.18/drivers/acpi/executer/exstorob.c Mon Sep 24 15:06:41 2001 +++ lia64-2.4/drivers/acpi/executer/exstorob.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exstorob - AML Interpreter object store support, store to object - * $Revision: 37 $ + * $Revision: 44 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,21 +26,16 @@ #include "acpi.h" -#include "acparser.h" -#include "acdispat.h" #include "acinterp.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "actables.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exstorob") + ACPI_MODULE_NAME ("exstorob") /******************************************************************************* * - * FUNCTION: Acpi_ex_copy_buffer_to_buffer + * FUNCTION: Acpi_ex_store_buffer_to_buffer * * PARAMETERS: Source_desc - Source object to copy * Target_desc - Destination object of the copy @@ -52,7 +47,7 @@ ******************************************************************************/ acpi_status -acpi_ex_copy_buffer_to_buffer ( +acpi_ex_store_buffer_to_buffer ( acpi_operand_object *source_desc, acpi_operand_object *target_desc) { @@ -60,7 +55,7 @@ u8 *buffer; - PROC_NAME ("Ex_copy_buffer_to_buffer"); + ACPI_FUNCTION_NAME ("Ex_store_buffer_to_buffer"); /* @@ -89,28 +84,32 @@ if (length <= target_desc->buffer.length) { /* Clear existing buffer and copy in the new one */ - MEMSET (target_desc->buffer.pointer, 0, target_desc->buffer.length); - MEMCPY (target_desc->buffer.pointer, buffer, length); + ACPI_MEMSET (target_desc->buffer.pointer, 0, target_desc->buffer.length); + ACPI_MEMCPY (target_desc->buffer.pointer, buffer, length); } else { /* * Truncate the source, copy only what will fit */ - MEMCPY (target_desc->buffer.pointer, buffer, target_desc->buffer.length); + ACPI_MEMCPY (target_desc->buffer.pointer, buffer, target_desc->buffer.length); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Truncating src buffer from %X to %X\n", length, target_desc->buffer.length)); } + /* Copy flags */ + + target_desc->buffer.flags = source_desc->buffer.flags; + return (AE_OK); } /******************************************************************************* * - * FUNCTION: Acpi_ex_copy_string_to_string + * FUNCTION: Acpi_ex_store_string_to_string * * PARAMETERS: Source_desc - Source object to copy * Target_desc - Destination object of the copy @@ -122,7 +121,7 @@ ******************************************************************************/ acpi_status -acpi_ex_copy_string_to_string ( +acpi_ex_store_string_to_string ( acpi_operand_object *source_desc, acpi_operand_object *target_desc) { @@ -130,7 +129,7 @@ u8 *buffer; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* @@ -145,8 +144,8 @@ if (length < target_desc->string.length) { /* Clear old string and copy in the new one */ - MEMSET (target_desc->string.pointer, 0, target_desc->string.length); - MEMCPY (target_desc->string.pointer, buffer, length); + ACPI_MEMSET (target_desc->string.pointer, 0, target_desc->string.length); + ACPI_MEMCPY (target_desc->string.pointer, buffer, length); } else { @@ -162,13 +161,13 @@ ACPI_MEM_FREE (target_desc->string.pointer); } - target_desc->string.pointer = ACPI_MEM_ALLOCATE (length + 1); + target_desc->string.pointer = ACPI_MEM_ALLOCATE ((ACPI_SIZE) length + 1); if (!target_desc->string.pointer) { return (AE_NO_MEMORY); } target_desc->string.length = length; - MEMCPY (target_desc->string.pointer, buffer, length); + ACPI_MEMCPY (target_desc->string.pointer, buffer, length); } return (AE_OK); diff -urN linux-2.4.18/drivers/acpi/executer/exsystem.c lia64-2.4/drivers/acpi/executer/exsystem.c --- linux-2.4.18/drivers/acpi/executer/exsystem.c Mon Sep 24 15:06:41 2001 +++ lia64-2.4/drivers/acpi/executer/exsystem.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exsystem - Interface to OS services - * $Revision: 67 $ + * $Revision: 73 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,12 +27,10 @@ #include "acpi.h" #include "acinterp.h" -#include "acnamesp.h" -#include "achware.h" #include "acevents.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exsystem") + ACPI_MODULE_NAME ("exsystem") /******************************************************************************* @@ -56,9 +54,10 @@ u32 timeout) { acpi_status status; + acpi_status status2; - FUNCTION_TRACE ("Ex_system_wait_semaphore"); + ACPI_FUNCTION_TRACE ("Ex_system_wait_semaphore"); status = acpi_os_wait_semaphore (semaphore, 1, 0); @@ -78,11 +77,11 @@ /* Reacquire the interpreter */ - status = acpi_ex_enter_interpreter (); - if (ACPI_SUCCESS (status)) { - /* Restore the timeout exception */ + status2 = acpi_ex_enter_interpreter (); + if (ACPI_FAILURE (status2)) { + /* Report fatal error, could not acquire interpreter */ - status = AE_TIME; + return_ACPI_STATUS (status2); } } @@ -96,17 +95,20 @@ * * PARAMETERS: How_long - The amount of time to stall * - * RETURN: None + * RETURN: Status * * DESCRIPTION: Suspend running thread for specified amount of time. * ******************************************************************************/ -void +acpi_status acpi_ex_system_do_stall ( u32 how_long) { - FUNCTION_ENTRY (); + acpi_status status = AE_OK; + + + ACPI_FUNCTION_ENTRY (); if (how_long > 1000) /* 1 millisecond */ { @@ -118,12 +120,14 @@ /* And now we must get the interpreter again */ - acpi_ex_enter_interpreter (); + status = acpi_ex_enter_interpreter (); } else { acpi_os_sleep (0, (how_long / 1000) + 1); } + + return (status); } @@ -139,12 +143,14 @@ * ******************************************************************************/ -void +acpi_status acpi_ex_system_do_suspend ( u32 how_long) { + acpi_status status; - FUNCTION_ENTRY (); + + ACPI_FUNCTION_ENTRY (); /* Since this thread will sleep, we must release the interpreter */ @@ -156,7 +162,8 @@ /* And now we must get the interpreter again */ - acpi_ex_enter_interpreter (); + status = acpi_ex_enter_interpreter (); + return (status); } @@ -183,7 +190,7 @@ acpi_status status = AE_OK; - FUNCTION_TRACE_PTR ("Ex_system_acquire_mutex", obj_desc); + ACPI_FUNCTION_TRACE_PTR ("Ex_system_acquire_mutex", obj_desc); if (!obj_desc) { @@ -194,7 +201,7 @@ * Support for the _GL_ Mutex object -- go get the global lock */ if (obj_desc->mutex.semaphore == acpi_gbl_global_lock_semaphore) { - status = acpi_ev_acquire_global_lock (); + status = acpi_ev_acquire_global_lock ((u32) time_desc->integer.value); return_ACPI_STATUS (status); } @@ -226,7 +233,7 @@ acpi_status status = AE_OK; - FUNCTION_TRACE ("Ex_system_release_mutex"); + ACPI_FUNCTION_TRACE ("Ex_system_release_mutex"); if (!obj_desc) { @@ -237,8 +244,8 @@ * Support for the _GL_ Mutex object -- release the global lock */ if (obj_desc->mutex.semaphore == acpi_gbl_global_lock_semaphore) { - acpi_ev_release_global_lock (); - return_ACPI_STATUS (AE_OK); + status = acpi_ev_release_global_lock (); + return_ACPI_STATUS (status); } status = acpi_os_signal_semaphore (obj_desc->mutex.semaphore, 1); @@ -266,7 +273,7 @@ acpi_status status = AE_OK; - FUNCTION_TRACE ("Ex_system_signal_event"); + ACPI_FUNCTION_TRACE ("Ex_system_signal_event"); if (obj_desc) { @@ -300,7 +307,7 @@ acpi_status status = AE_OK; - FUNCTION_TRACE ("Ex_system_wait_event"); + ACPI_FUNCTION_TRACE ("Ex_system_wait_event"); if (obj_desc) { @@ -308,7 +315,6 @@ (u32) time_desc->integer.value); } - return_ACPI_STATUS (status); } @@ -333,7 +339,7 @@ void *temp_semaphore; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* @@ -342,7 +348,7 @@ */ status = acpi_os_create_semaphore (ACPI_NO_UNIT_LIMIT, 0, &temp_semaphore); if (ACPI_SUCCESS (status)) { - acpi_os_delete_semaphore (obj_desc->event.semaphore); + (void) acpi_os_delete_semaphore (obj_desc->event.semaphore); obj_desc->event.semaphore = temp_semaphore; } diff -urN linux-2.4.18/drivers/acpi/executer/exutils.c lia64-2.4/drivers/acpi/executer/exutils.c --- linux-2.4.18/drivers/acpi/executer/exutils.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/executer/exutils.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: exutils - interpreter/scanner utilities - * $Revision: 85 $ + * $Revision: 98 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,15 +42,12 @@ #define DEFINE_AML_GLOBALS #include "acpi.h" -#include "acparser.h" #include "acinterp.h" #include "amlcode.h" -#include "acnamesp.h" #include "acevents.h" -#include "acparser.h" #define _COMPONENT ACPI_EXECUTER - MODULE_NAME ("exutils") + ACPI_MODULE_NAME ("exutils") /******************************************************************************* @@ -59,8 +56,8 @@ * * PARAMETERS: None * - * DESCRIPTION: Enter the interpreter execution region - * TBD: should be a macro + * DESCRIPTION: Enter the interpreter execution region. Failure to enter + * the interpreter region is a fatal system error * ******************************************************************************/ @@ -69,10 +66,14 @@ { acpi_status status; - FUNCTION_TRACE ("Ex_enter_interpreter"); + ACPI_FUNCTION_TRACE ("Ex_enter_interpreter"); status = acpi_ut_acquire_mutex (ACPI_MTX_EXECUTE); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not acquire interpreter mutex\n")); + } + return_ACPI_STATUS (status); } @@ -95,17 +96,21 @@ * already executing * 7) About to invoke a user-installed opregion handler * - * TBD: should be a macro - * ******************************************************************************/ void acpi_ex_exit_interpreter (void) { - FUNCTION_TRACE ("Ex_exit_interpreter"); + acpi_status status; + + + ACPI_FUNCTION_TRACE ("Ex_exit_interpreter"); - acpi_ut_release_mutex (ACPI_MTX_EXECUTE); + status = acpi_ut_release_mutex (ACPI_MTX_EXECUTE); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not release interpreter mutex\n")); + } return_VOID; } @@ -126,7 +131,7 @@ acpi_object_type type) { - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); if ((type > ACPI_TYPE_MAX && type < INTERNAL_TYPE_BEGIN) || @@ -159,7 +164,7 @@ acpi_walk_state *walk_state) { - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* @@ -172,7 +177,7 @@ return; } - if (walk_state->method_node->flags & ANOBJ_DATA_WIDTH_32) { + if (acpi_gbl_integer_byte_width == 4) { /* * We are running a method that exists in a 32-bit ACPI table. * Truncate the value to 32 bits by zeroing out the upper 32-bit field @@ -186,7 +191,8 @@ * * FUNCTION: Acpi_ex_acquire_global_lock * - * PARAMETERS: Rule - Lock rule: Always_lock, Never_lock + * PARAMETERS: Field_flags - Flags with Lock rule: + * Always_lock or Never_lock * * RETURN: TRUE/FALSE indicating whether the lock was actually acquired * @@ -198,25 +204,24 @@ u8 acpi_ex_acquire_global_lock ( - u32 rule) + u32 field_flags) { u8 locked = FALSE; acpi_status status; - FUNCTION_TRACE ("Ex_acquire_global_lock"); + ACPI_FUNCTION_TRACE ("Ex_acquire_global_lock"); - /* Only attempt lock if the Rule says so */ + /* Only attempt lock if the Always_lock bit is set */ - if (rule == (u32) GLOCK_ALWAYS_LOCK) { - /* We should attempt to get the lock */ + if (field_flags & AML_FIELD_LOCK_RULE_MASK) { + /* We should attempt to get the lock, wait forever */ - status = acpi_ev_acquire_global_lock (); + status = acpi_ev_acquire_global_lock (ACPI_UINT32_MAX); if (ACPI_SUCCESS (status)) { locked = TRUE; } - else { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not acquire Global Lock, %s\n", acpi_format_exception (status))); @@ -240,12 +245,14 @@ * ******************************************************************************/ -acpi_status +void acpi_ex_release_global_lock ( u8 locked_by_me) { + acpi_status status; + - FUNCTION_TRACE ("Ex_release_global_lock"); + ACPI_FUNCTION_TRACE ("Ex_release_global_lock"); /* Only attempt unlock if the caller locked it */ @@ -253,11 +260,13 @@ if (locked_by_me) { /* OK, now release the lock */ - acpi_ev_release_global_lock (); - } - + status = acpi_ev_release_global_lock (); + if (ACPI_FAILURE (status)) { + /* Report the error, but there isn't much else we can do */ - return_ACPI_STATUS (AE_OK); + ACPI_REPORT_ERROR (("Could not release ACPI Global Lock\n")); + } + } } @@ -277,23 +286,24 @@ acpi_integer value, u32 base) { - u32 num_digits = 0; + u32 num_digits; + acpi_integer current_value; + acpi_integer quotient; - FUNCTION_TRACE ("Ex_digits_needed"); + ACPI_FUNCTION_TRACE ("Ex_digits_needed"); - if (base < 1) { - REPORT_ERROR (("Ex_digits_needed: Internal error - Invalid base\n")); - } + /* + * acpi_integer is unsigned, so we don't worry about a '-' + */ + current_value = value; + num_digits = 0; - else { - /* - * acpi_integer is unsigned, which is why we don't worry about a '-' - */ - for (num_digits = 1; - (acpi_ut_short_divide (&value, base, &value, NULL)); - ++num_digits) { ; } + while (current_value) { + (void) acpi_ut_short_divide (¤t_value, base, "ient, NULL); + num_digits++; + current_value = quotient; } return_VALUE (num_digits); @@ -302,45 +312,6 @@ /******************************************************************************* * - * FUNCTION: ntohl - * - * PARAMETERS: Value - Value to be converted - * - * DESCRIPTION: Convert a 32-bit value to big-endian (swap the bytes) - * - ******************************************************************************/ - -static u32 -_ntohl ( - u32 value) -{ - union { - u32 value; - u8 bytes[4]; - } out; - - union { - u32 value; - u8 bytes[4]; - } in; - - - FUNCTION_ENTRY (); - - - in.value = value; - - out.bytes[0] = in.bytes[3]; - out.bytes[1] = in.bytes[2]; - out.bytes[2] = in.bytes[1]; - out.bytes[3] = in.bytes[0]; - - return (out.value); -} - - -/******************************************************************************* - * * FUNCTION: Acpi_ex_eisa_id_to_string * * PARAMETERS: Numeric_id - EISA ID to be converted @@ -350,31 +321,29 @@ * ******************************************************************************/ -acpi_status +void acpi_ex_eisa_id_to_string ( u32 numeric_id, NATIVE_CHAR *out_string) { - u32 id; + u32 eisa_id; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); - /* swap to big-endian to get contiguous bits */ + /* Swap ID to big-endian to get contiguous bits */ - id = _ntohl (numeric_id); + eisa_id = acpi_ut_dword_byte_swap (numeric_id); - out_string[0] = (char) ('@' + ((id >> 26) & 0x1f)); - out_string[1] = (char) ('@' + ((id >> 21) & 0x1f)); - out_string[2] = (char) ('@' + ((id >> 16) & 0x1f)); - out_string[3] = acpi_ut_hex_to_ascii_char (id, 12); - out_string[4] = acpi_ut_hex_to_ascii_char (id, 8); - out_string[5] = acpi_ut_hex_to_ascii_char (id, 4); - out_string[6] = acpi_ut_hex_to_ascii_char (id, 0); + out_string[0] = (char) ('@' + ((eisa_id >> 26) & 0x1f)); + out_string[1] = (char) ('@' + ((eisa_id >> 21) & 0x1f)); + out_string[2] = (char) ('@' + ((eisa_id >> 16) & 0x1f)); + out_string[3] = acpi_ut_hex_to_ascii_char ((acpi_integer) eisa_id, 12); + out_string[4] = acpi_ut_hex_to_ascii_char ((acpi_integer) eisa_id, 8); + out_string[5] = acpi_ut_hex_to_ascii_char ((acpi_integer) eisa_id, 4); + out_string[6] = acpi_ut_hex_to_ascii_char ((acpi_integer) eisa_id, 0); out_string[7] = 0; - - return (AE_OK); } @@ -389,7 +358,7 @@ * ******************************************************************************/ -acpi_status +void acpi_ex_unsigned_integer_to_string ( acpi_integer value, NATIVE_CHAR *out_string) @@ -397,20 +366,20 @@ u32 count; u32 digits_needed; u32 remainder; + acpi_integer quotient; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); digits_needed = acpi_ex_digits_needed (value, 10); out_string[digits_needed] = 0; for (count = digits_needed; count > 0; count--) { - acpi_ut_short_divide (&value, 10, &value, &remainder); - out_string[count-1] = (NATIVE_CHAR) ('0' + remainder); + (void) acpi_ut_short_divide (&value, 10, "ient, &remainder); + out_string[count-1] = (NATIVE_CHAR) ('0' + remainder);\ + value = quotient; } - - return (AE_OK); } diff -urN linux-2.4.18/drivers/acpi/fan.c lia64-2.4/drivers/acpi/fan.c --- linux-2.4.18/drivers/acpi/fan.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/fan.c Tue Jun 11 14:24:22 2002 @@ -0,0 +1,300 @@ +/* + * acpi_fan.c - ACPI Fan Driver ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include +#include +#include +#include "acpi_bus.h" +#include "acpi_drivers.h" + + +#define _COMPONENT ACPI_FAN_COMPONENT +ACPI_MODULE_NAME ("acpi_fan") + +MODULE_AUTHOR("Paul Diefenbaugh"); +MODULE_DESCRIPTION(ACPI_FAN_DRIVER_NAME); +MODULE_LICENSE("GPL"); + +#define PREFIX "ACPI: " + + +int acpi_fan_add (struct acpi_device *device); +int acpi_fan_remove (struct acpi_device *device, int type); + +static struct acpi_driver acpi_fan_driver = { + name: ACPI_FAN_DRIVER_NAME, + class: ACPI_FAN_CLASS, + ids: ACPI_FAN_HID, + ops: { + add: acpi_fan_add, + remove: acpi_fan_remove, + }, +}; + +struct acpi_fan { + acpi_handle handle; +}; + + +/* -------------------------------------------------------------------------- + FS Interface (/proc) + -------------------------------------------------------------------------- */ + +#include +#include + +struct proc_dir_entry *acpi_fan_dir = NULL; + + +static int +acpi_fan_read_state ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_fan *fan = (struct acpi_fan *) data; + char *p = page; + int len = 0; + int state = 0; + + ACPI_FUNCTION_TRACE("acpi_fan_read_state"); + + if (!fan || (off != 0)) + goto end; + + if (0 != acpi_bus_get_power(fan->handle, &state)) + goto end; + + p += sprintf(p, "status: %s\n", + !state?"on":"off"); + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_fan_write_state ( + struct file *file, + const char *buffer, + unsigned long count, + void *data) +{ + int result = 0; + struct acpi_fan *fan = (struct acpi_fan *) data; + char state_string[12] = {'\0'}; + + ACPI_FUNCTION_TRACE("acpi_fan_write_state"); + + if (!fan || (count > sizeof(state_string) - 1)) + return_VALUE(-EINVAL); + + if (copy_from_user(state_string, buffer, count)) + return_VALUE(-EFAULT); + + state_string[count] = '\0'; + + result = acpi_bus_set_power(fan->handle, + simple_strtoul(state_string, NULL, 0)); + if (0 != result) + return_VALUE(result); + + return_VALUE(count); +} + + +static int +acpi_fan_add_fs ( + struct acpi_device *device) +{ + struct proc_dir_entry *entry = NULL; + + ACPI_FUNCTION_TRACE("acpi_fan_add_fs"); + + if (!device) + return_VALUE(-EINVAL); + + if (!acpi_fan_dir) { + acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir); + if (!acpi_fan_dir) + return_VALUE(-ENODEV); + } + + if (!acpi_device_dir(device)) { + acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), + acpi_fan_dir); + if (!acpi_device_dir(device)) + return_VALUE(-ENODEV); + } + + /* 'status' [R/W] */ + entry = create_proc_entry(ACPI_FAN_FILE_STATE, + S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_FAN_FILE_STATE)); + else { + entry->read_proc = acpi_fan_read_state; + entry->write_proc = acpi_fan_write_state; + entry->data = acpi_driver_data(device); + } + + return_VALUE(0); +} + + +static int +acpi_fan_remove_fs ( + struct acpi_device *device) +{ + ACPI_FUNCTION_TRACE("acpi_fan_remove_fs"); + + if (!acpi_fan_dir) + return_VALUE(-ENODEV); + + if (acpi_device_dir(device)) + remove_proc_entry(acpi_device_bid(device), acpi_fan_dir); + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Driver Interface + -------------------------------------------------------------------------- */ + +int +acpi_fan_add ( + struct acpi_device *device) +{ + int result = 0; + struct acpi_fan *fan = NULL; + int state = 0; + + ACPI_FUNCTION_TRACE("acpi_fan_add"); + + if (!device) + return_VALUE(-EINVAL); + + fan = kmalloc(sizeof(struct acpi_fan), GFP_KERNEL); + if (!fan) + return_VALUE(-ENOMEM); + memset(fan, 0, sizeof(struct acpi_fan)); + + fan->handle = device->handle; + sprintf(acpi_device_name(device), "%s", ACPI_FAN_DEVICE_NAME); + sprintf(acpi_device_class(device), "%s", ACPI_FAN_CLASS); + acpi_driver_data(device) = fan; + + result = acpi_bus_get_power(fan->handle, &state); + if (0 != result) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error reading power state\n")); + goto end; + } + + result = acpi_fan_add_fs(device); + if (0 != result) + goto end; + + printk(KERN_INFO PREFIX "%s [%s] (%s)\n", + acpi_device_name(device), acpi_device_bid(device), + !device->power.state?"on":"off"); + +end: + if (0 != result) + kfree(fan); + + return_VALUE(result); +} + + +int +acpi_fan_remove ( + struct acpi_device *device, + int type) +{ + struct acpi_fan *fan = NULL; + + ACPI_FUNCTION_TRACE("acpi_fan_remove"); + + if (!device || !acpi_driver_data(device)) + return_VALUE(-EINVAL); + + fan = (struct acpi_fan *) acpi_driver_data(device); + + acpi_fan_remove_fs(device); + + kfree(fan); + + return_VALUE(0); +} + + +int __init +acpi_fan_init (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_fan_init"); + + result = acpi_bus_register_driver(&acpi_fan_driver); + if (0 > result) + return_VALUE(-ENODEV); + + return_VALUE(0); +} + + +void __exit +acpi_fan_exit (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_fan_exit"); + + result = acpi_bus_unregister_driver(&acpi_fan_driver); + if (0 == result) + remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir); + + return_VOID; +} + + +module_init(acpi_fan_init); +module_exit(acpi_fan_exit); + diff -urN linux-2.4.18/drivers/acpi/hardware/Makefile lia64-2.4/drivers/acpi/hardware/Makefile --- linux-2.4.18/drivers/acpi/hardware/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/hardware/Makefile Tue Apr 9 15:46:59 2002 @@ -1,11 +1,10 @@ # # Makefile for all Linux ACPI interpreter subdirectories -# EXCEPT for the ospm directory # O_TARGET := $(notdir $(CURDIR)).o -obj-$(CONFIG_ACPI) := $(patsubst %.c,%.o,$(wildcard *.c)) +obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c)) EXTRA_CFLAGS += $(ACPI_CFLAGS) diff -urN linux-2.4.18/drivers/acpi/hardware/hwacpi.c lia64-2.4/drivers/acpi/hardware/hwacpi.c --- linux-2.4.18/drivers/acpi/hardware/hwacpi.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/hardware/hwacpi.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface - * $Revision: 46 $ + * $Revision: 58 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,11 +26,10 @@ #include "acpi.h" -#include "achware.h" #define _COMPONENT ACPI_HARDWARE - MODULE_NAME ("hwacpi") + ACPI_MODULE_NAME ("hwacpi") /****************************************************************************** @@ -49,131 +48,28 @@ acpi_hw_initialize ( void) { - acpi_status status = AE_OK; - u32 index; + acpi_status status; - FUNCTION_TRACE ("Hw_initialize"); + ACPI_FUNCTION_TRACE ("Hw_initialize"); /* We must have the ACPI tables by the time we get here */ if (!acpi_gbl_FADT) { - acpi_gbl_restore_acpi_chipset = FALSE; - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No FADT!\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "A FADT is not loaded\n")); return_ACPI_STATUS (AE_NO_ACPI_TABLES); } - /* Identify current ACPI/legacy mode */ - - switch (acpi_gbl_system_flags & SYS_MODES_MASK) { - case (SYS_MODE_ACPI): - - acpi_gbl_original_mode = SYS_MODE_ACPI; - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "System supports ACPI mode only.\n")); - break; - - - case (SYS_MODE_LEGACY): - - acpi_gbl_original_mode = SYS_MODE_LEGACY; - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Tables loaded from buffer, hardware assumed to support LEGACY mode only.\n")); - break; - - - case (SYS_MODE_ACPI | SYS_MODE_LEGACY): - - if (acpi_hw_get_mode () == SYS_MODE_ACPI) { - acpi_gbl_original_mode = SYS_MODE_ACPI; - } - else { - acpi_gbl_original_mode = SYS_MODE_LEGACY; - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "System supports both ACPI and LEGACY modes.\n")); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "System is currently in %s mode.\n", - (acpi_gbl_original_mode == SYS_MODE_ACPI) ? "ACPI" : "LEGACY")); - break; - } - - - if (acpi_gbl_system_flags & SYS_MODE_ACPI) { - /* Target system supports ACPI mode */ - - /* - * The purpose of this code is to save the initial state - * of the ACPI event enable registers. An exit function will be - * registered which will restore this state when the application - * exits. The exit function will also clear all of the ACPI event - * status bits prior to restoring the original mode. - * - * The location of the PM1a_evt_blk enable registers is defined as the - * base of PM1a_evt_blk + DIV_2(PM1a_evt_blk_length). Since the spec further - * fully defines the PM1a_evt_blk to be a total of 4 bytes, the offset - * for the enable registers is always 2 from the base. It is hard - * coded here. If this changes in the spec, this code will need to - * be modified. The PM1b_evt_blk behaves as expected. - */ - acpi_gbl_pm1_enable_register_save = (u16) acpi_hw_register_read ( - ACPI_MTX_LOCK, PM1_EN); - - - /* - * The GPEs behave similarly, except that the length of the register - * block is not fixed, so the buffer must be allocated with malloc - */ - if (ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xgpe0blk.address) && - acpi_gbl_FADT->gpe0blk_len) { - /* GPE0 specified in FADT */ - - acpi_gbl_gpe0enable_register_save = ACPI_MEM_ALLOCATE ( - DIV_2 (acpi_gbl_FADT->gpe0blk_len)); - if (!acpi_gbl_gpe0enable_register_save) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - /* Save state of GPE0 enable bits */ - - for (index = 0; index < DIV_2 (acpi_gbl_FADT->gpe0blk_len); index++) { - acpi_gbl_gpe0enable_register_save[index] = - (u8) acpi_hw_register_read (ACPI_MTX_LOCK, GPE0_EN_BLOCK | index); - } - } - - else { - acpi_gbl_gpe0enable_register_save = NULL; - } + /* Sanity check the FADT for valid values */ - if (ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xgpe1_blk.address) && - acpi_gbl_FADT->gpe1_blk_len) { - /* GPE1 defined */ - - acpi_gbl_gpe1_enable_register_save = ACPI_MEM_ALLOCATE ( - DIV_2 (acpi_gbl_FADT->gpe1_blk_len)); - if (!acpi_gbl_gpe1_enable_register_save) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - /* save state of GPE1 enable bits */ - - for (index = 0; index < DIV_2 (acpi_gbl_FADT->gpe1_blk_len); index++) { - acpi_gbl_gpe1_enable_register_save[index] = - (u8) acpi_hw_register_read (ACPI_MTX_LOCK, GPE1_EN_BLOCK | index); - } - } - - else { - acpi_gbl_gpe1_enable_register_save = NULL; - } + status = acpi_ut_validate_fadt (); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } - return_ACPI_STATUS (status); + return_ACPI_STATUS (AE_OK); } @@ -185,8 +81,7 @@ * * RETURN: Status * - * DESCRIPTION: Transitions the system into the requested mode or does nothing - * if the system is already in that mode. + * DESCRIPTION: Transitions the system into the requested mode. * ******************************************************************************/ @@ -195,36 +90,68 @@ u32 mode) { - acpi_status status = AE_NO_HARDWARE_RESPONSE; + acpi_status status; + u32 retry; - FUNCTION_TRACE ("Hw_set_mode"); + ACPI_FUNCTION_TRACE ("Hw_set_mode"); - if (mode == SYS_MODE_ACPI) { + if (mode == acpi_hw_get_mode()) + return_ACPI_STATUS (AE_OK); + + /* If no SMI_CMD, system does not support SMI */ + if (!acpi_gbl_FADT->smi_cmd) + return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE); + + switch (mode) { + case ACPI_SYS_MODE_ACPI: + /* BIOS should have disabled ALL fixed and GP events */ - acpi_os_write_port (acpi_gbl_FADT->smi_cmd, acpi_gbl_FADT->acpi_enable, 8); + status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd, + (acpi_integer) acpi_gbl_FADT->acpi_enable, 8); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Attempting to enable ACPI mode\n")); - } + break; - else if (mode == SYS_MODE_LEGACY) { + case ACPI_SYS_MODE_LEGACY: + + /* If both enable/disable are zero, legacy mode is not supported */ + if (!acpi_gbl_FADT->acpi_enable && !acpi_gbl_FADT->acpi_disable) + return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE); + /* * BIOS should clear all fixed status bits and restore fixed event * enable bits to default */ - acpi_os_write_port (acpi_gbl_FADT->smi_cmd, acpi_gbl_FADT->acpi_disable, 8); + status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd, + (acpi_integer) acpi_gbl_FADT->acpi_disable, 8); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Attempting to enable Legacy (non-ACPI) mode\n")); + break; + default: + return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Give the platform some time to react */ + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - acpi_os_stall (20000); + /* + * Some hardware takes a LONG time to switch modes. Give them 3 sec to + * do so, but allow faster systems to proceed more quickly. + */ + retry = 3000; + while (retry) { + status = AE_NO_HARDWARE_RESPONSE; - if (acpi_hw_get_mode () == mode) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n", mode)); - status = AE_OK; + if (acpi_hw_get_mode() == mode) { + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n", mode)); + status = AE_OK; + break; + } + acpi_os_stall(1000); + retry--; } return_ACPI_STATUS (status); @@ -247,74 +174,33 @@ u32 acpi_hw_get_mode (void) { + acpi_status status; + u32 value; - FUNCTION_TRACE ("Hw_get_mode"); + ACPI_FUNCTION_TRACE ("Hw_get_mode"); - if (acpi_hw_register_bit_access (ACPI_READ, ACPI_MTX_LOCK, SCI_EN)) { - return_VALUE (SYS_MODE_ACPI); + status = acpi_get_register (ACPI_BITREG_SCI_ENABLE, &value, ACPI_MTX_LOCK); + if (ACPI_FAILURE (status)) { + return_VALUE (ACPI_SYS_MODE_LEGACY); } - else { - return_VALUE (SYS_MODE_LEGACY); - } -} - - -/****************************************************************************** - * - * FUNCTION: Acpi_hw_get_mode_capabilities - * - * PARAMETERS: none - * - * RETURN: logical OR of SYS_MODE_ACPI and SYS_MODE_LEGACY determined at initial - * system state. - * - * DESCRIPTION: Returns capablities of system - * - ******************************************************************************/ - -u32 -acpi_hw_get_mode_capabilities (void) -{ - - FUNCTION_TRACE ("Hw_get_mode_capabilities"); - - if (!(acpi_gbl_system_flags & SYS_MODES_MASK)) { - if (acpi_hw_get_mode () == SYS_MODE_LEGACY) { - /* - * Assume that if this call is being made, Acpi_init has been called - * and ACPI support has been established by the presence of the - * tables. Therefore since we're in SYS_MODE_LEGACY, the system - * must support both modes - */ - acpi_gbl_system_flags |= (SYS_MODE_ACPI | SYS_MODE_LEGACY); + if (value) { + return_VALUE (ACPI_SYS_MODE_ACPI); + } + else { +#ifdef CONFIG_IA64_HP_PROTO + /* + * If enable/disable are zero, the system doesn't support + * legacy mode, so the SCI_EN is wrong. + */ + if (!acpi_gbl_FADT->acpi_enable && + !acpi_gbl_FADT->acpi_disable) { + printk("Warning: Ignoring bogus SCI_EN value\n"); + return_VALUE (ACPI_SYS_MODE_ACPI); } +#endif - else { - /* TBD: [Investigate] !!! this may be unsafe... */ - /* - * system is is ACPI mode, so try to switch back to LEGACY to see if - * it is supported - */ - acpi_hw_set_mode (SYS_MODE_LEGACY); - - if (acpi_hw_get_mode () == SYS_MODE_LEGACY) { - /* Now in SYS_MODE_LEGACY, so both are supported */ - - acpi_gbl_system_flags |= (SYS_MODE_ACPI | SYS_MODE_LEGACY); - acpi_hw_set_mode (SYS_MODE_ACPI); - } - - else { - /* Still in SYS_MODE_ACPI so this must be an ACPI only system */ - - acpi_gbl_system_flags |= SYS_MODE_ACPI; - } - } + return_VALUE (ACPI_SYS_MODE_LEGACY); } - - return_VALUE (acpi_gbl_system_flags & SYS_MODES_MASK); } - - diff -urN linux-2.4.18/drivers/acpi/hardware/hwgpe.c lia64-2.4/drivers/acpi/hardware/hwgpe.c --- linux-2.4.18/drivers/acpi/hardware/hwgpe.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/hardware/hwgpe.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Module Name: hwgpe - Low level GPE enable/disable/clear functions - * $Revision: 35 $ + * $Revision: 41 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,12 +25,30 @@ */ #include "acpi.h" -#include "achware.h" -#include "acnamesp.h" #include "acevents.h" #define _COMPONENT ACPI_HARDWARE - MODULE_NAME ("hwgpe") + ACPI_MODULE_NAME ("hwgpe") + + +/****************************************************************************** + * + * FUNCTION: Acpi_hw_get_gpe_bit_mask + * + * PARAMETERS: Gpe_number - The GPE + * + * RETURN: Gpe register bitmask for this gpe level + * + * DESCRIPTION: Get the bitmask for this GPE + * + ******************************************************************************/ + +u8 +acpi_hw_get_gpe_bit_mask ( + u32 gpe_number) +{ + return (acpi_gbl_gpe_number_info [acpi_ev_get_gpe_number_index (gpe_number)].bit_mask); +} /****************************************************************************** @@ -45,38 +63,44 @@ * ******************************************************************************/ -void +acpi_status acpi_hw_enable_gpe ( u32 gpe_number) { u32 in_byte; u32 register_index; - u32 bit_mask; + u8 bit_mask; + acpi_status status; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); - /* - * Translate GPE number to index into global registers array. - */ - register_index = acpi_gbl_gpe_valid[gpe_number]; + /* Translate GPE number to index into global registers array. */ - /* - * Figure out the bit offset for this GPE within the target register. - */ - bit_mask = acpi_gbl_decode_to8bit [MOD_8 (gpe_number)]; + register_index = acpi_ev_get_gpe_register_index (gpe_number); + + /* Get the register bitmask for this GPE */ + + bit_mask = acpi_hw_get_gpe_bit_mask (gpe_number); /* * Read the current value of the register, set the appropriate bit * to enable the GPE, and write out the new register. */ - in_byte = 0; - acpi_os_read_port (acpi_gbl_gpe_registers[register_index].enable_addr, &in_byte, 8); - acpi_os_write_port (acpi_gbl_gpe_registers[register_index].enable_addr, - (in_byte | bit_mask), 8); + status = acpi_hw_low_level_read (8, &in_byte, + &acpi_gbl_gpe_register_info[register_index].enable_address, 0); + if (ACPI_FAILURE (status)) { + return (status); + } + + status = acpi_hw_low_level_write (8, (in_byte | bit_mask), + &acpi_gbl_gpe_register_info[register_index].enable_address, 0); + + return (status); } + /****************************************************************************** * * FUNCTION: Acpi_hw_enable_gpe_for_wakeup @@ -95,28 +119,27 @@ u32 gpe_number) { u32 register_index; - u32 bit_mask; + u8 bit_mask; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); - /* - * Translate GPE number to index into global registers array. - */ - register_index = acpi_gbl_gpe_valid[gpe_number]; + /* Translate GPE number to index into global registers array. */ - /* - * Figure out the bit offset for this GPE within the target register. - */ - bit_mask = acpi_gbl_decode_to8bit [MOD_8 (gpe_number)]; + register_index = acpi_ev_get_gpe_register_index (gpe_number); + + /* Get the register bitmask for this GPE */ + + bit_mask = acpi_hw_get_gpe_bit_mask (gpe_number); /* * Set the bit so we will not disable this when sleeping */ - acpi_gbl_gpe_registers[register_index].wake_enable |= bit_mask; + acpi_gbl_gpe_register_info[register_index].wake_enable |= bit_mask; } + /****************************************************************************** * * FUNCTION: Acpi_hw_disable_gpe @@ -129,40 +152,48 @@ * ******************************************************************************/ -void +acpi_status acpi_hw_disable_gpe ( u32 gpe_number) { u32 in_byte; u32 register_index; - u32 bit_mask; + u8 bit_mask; + acpi_status status; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); - /* - * Translate GPE number to index into global registers array. - */ - register_index = acpi_gbl_gpe_valid[gpe_number]; + /* Translate GPE number to index into global registers array. */ - /* - * Figure out the bit offset for this GPE within the target register. - */ - bit_mask = acpi_gbl_decode_to8bit [MOD_8 (gpe_number)]; + register_index = acpi_ev_get_gpe_register_index (gpe_number); + + /* Get the register bitmask for this GPE */ + + bit_mask = acpi_hw_get_gpe_bit_mask (gpe_number); /* * Read the current value of the register, clear the appropriate bit, * and write out the new register value to disable the GPE. */ - in_byte = 0; - acpi_os_read_port (acpi_gbl_gpe_registers[register_index].enable_addr, &in_byte, 8); - acpi_os_write_port (acpi_gbl_gpe_registers[register_index].enable_addr, - (in_byte & ~bit_mask), 8); + status = acpi_hw_low_level_read (8, &in_byte, + &acpi_gbl_gpe_register_info[register_index].enable_address, 0); + if (ACPI_FAILURE (status)) { + return (status); + } + + status = acpi_hw_low_level_write (8, (in_byte & ~bit_mask), + &acpi_gbl_gpe_register_info[register_index].enable_address, 0); + if (ACPI_FAILURE (status)) { + return (status); + } acpi_hw_disable_gpe_for_wakeup(gpe_number); + return (AE_OK); } + /****************************************************************************** * * FUNCTION: Acpi_hw_disable_gpe_for_wakeup @@ -181,28 +212,27 @@ u32 gpe_number) { u32 register_index; - u32 bit_mask; + u8 bit_mask; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); - /* - * Translate GPE number to index into global registers array. - */ - register_index = acpi_gbl_gpe_valid[gpe_number]; + /* Translate GPE number to index into global registers array. */ - /* - * Figure out the bit offset for this GPE within the target register. - */ - bit_mask = acpi_gbl_decode_to8bit [MOD_8 (gpe_number)]; + register_index = acpi_ev_get_gpe_register_index (gpe_number); + + /* Get the register bitmask for this GPE */ + + bit_mask = acpi_hw_get_gpe_bit_mask (gpe_number); /* * Clear the bit so we will disable this when sleeping */ - acpi_gbl_gpe_registers[register_index].wake_enable &= ~bit_mask; + acpi_gbl_gpe_register_info[register_index].wake_enable &= ~bit_mask; } + /****************************************************************************** * * FUNCTION: Acpi_hw_clear_gpe @@ -215,32 +245,34 @@ * ******************************************************************************/ -void +acpi_status acpi_hw_clear_gpe ( u32 gpe_number) { u32 register_index; - u32 bit_mask; + u8 bit_mask; + acpi_status status; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); - /* - * Translate GPE number to index into global registers array. - */ - register_index = acpi_gbl_gpe_valid[gpe_number]; + /* Translate GPE number to index into global registers array. */ - /* - * Figure out the bit offset for this GPE within the target register. - */ - bit_mask = acpi_gbl_decode_to8bit [MOD_8 (gpe_number)]; + register_index = acpi_ev_get_gpe_register_index (gpe_number); + + /* Get the register bitmask for this GPE */ + + bit_mask = acpi_hw_get_gpe_bit_mask (gpe_number); /* * Write a one to the appropriate bit in the status register to * clear this GPE. */ - acpi_os_write_port (acpi_gbl_gpe_registers[register_index].status_addr, bit_mask, 8); + status = acpi_hw_low_level_write (8, bit_mask, + &acpi_gbl_gpe_register_info[register_index].status_address, 0); + + return (status); } @@ -256,61 +288,67 @@ * ******************************************************************************/ -void +acpi_status acpi_hw_get_gpe_status ( u32 gpe_number, acpi_event_status *event_status) { u32 in_byte = 0; u32 register_index = 0; - u32 bit_mask = 0; + u8 bit_mask = 0; + ACPI_GPE_REGISTER_INFO *gpe_register_info; + acpi_status status; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); if (!event_status) { - return; + return (AE_BAD_PARAMETER); } (*event_status) = 0; - /* - * Translate GPE number to index into global registers array. - */ - register_index = acpi_gbl_gpe_valid[gpe_number]; + /* Translate GPE number to index into global registers array. */ - /* - * Figure out the bit offset for this GPE within the target register. - */ - bit_mask = acpi_gbl_decode_to8bit [MOD_8 (gpe_number)]; + register_index = acpi_ev_get_gpe_register_index (gpe_number); + gpe_register_info = &acpi_gbl_gpe_register_info[register_index]; + + /* Get the register bitmask for this GPE */ + + bit_mask = acpi_hw_get_gpe_bit_mask (gpe_number); + + /* GPE Enabled? */ + + status = acpi_hw_low_level_read (8, &in_byte, &gpe_register_info->enable_address, 0); + if (ACPI_FAILURE (status)) { + return (status); + } - /* - * Enabled?: - */ - in_byte = 0; - acpi_os_read_port (acpi_gbl_gpe_registers[register_index].enable_addr, &in_byte, 8); if (bit_mask & in_byte) { (*event_status) |= ACPI_EVENT_FLAG_ENABLED; } - /* - * Enabled for wake?: - */ - if (bit_mask & acpi_gbl_gpe_registers[register_index].wake_enable) { + /* GPE Enabled for wake? */ + + if (bit_mask & gpe_register_info->wake_enable) { (*event_status) |= ACPI_EVENT_FLAG_WAKE_ENABLED; } - /* - * Set? - */ - in_byte = 0; - acpi_os_read_port (acpi_gbl_gpe_registers[register_index].status_addr, &in_byte, 8); + /* GPE active (set)? */ + + status = acpi_hw_low_level_read (8, &in_byte, &gpe_register_info->status_address, 0); + if (ACPI_FAILURE (status)) { + return (status); + } + if (bit_mask & in_byte) { (*event_status) |= ACPI_EVENT_FLAG_SET; } + return (AE_OK); } + /****************************************************************************** * * FUNCTION: Acpi_hw_disable_non_wakeup_gpes @@ -321,36 +359,53 @@ * * DESCRIPTION: Disable all non-wakeup GPEs * Call with interrupts disabled. The interrupt handler also - * modifies Acpi_gbl_Gpe_registers[i].Enable, so it should not be + * modifies Acpi_gbl_Gpe_register_info[i].Enable, so it should not be * given the chance to run until after non-wake GPEs are * re-enabled. * ******************************************************************************/ -void +acpi_status acpi_hw_disable_non_wakeup_gpes ( void) { u32 i; + ACPI_GPE_REGISTER_INFO *gpe_register_info; + u32 in_value; + acpi_status status; + + + ACPI_FUNCTION_ENTRY (); - FUNCTION_ENTRY (); for (i = 0; i < acpi_gbl_gpe_register_count; i++) { + gpe_register_info = &acpi_gbl_gpe_register_info[i]; + /* * Read the enabled status of all GPEs. We * will be using it to restore all the GPEs later. */ - acpi_os_read_port (acpi_gbl_gpe_registers[i].enable_addr, - &acpi_gbl_gpe_registers[i].enable, 8); + status = acpi_hw_low_level_read (8, &in_value, + &gpe_register_info->enable_address, 0); + if (ACPI_FAILURE (status)) { + return (status); + } + + gpe_register_info->enable = (u8) in_value; /* - * Disable all GPEs but wakeup GPEs. + * Disable all GPEs except wakeup GPEs. */ - acpi_os_write_port(acpi_gbl_gpe_registers[i].enable_addr, - acpi_gbl_gpe_registers[i].wake_enable, 8); + status = acpi_hw_low_level_write (8, gpe_register_info->wake_enable, + &gpe_register_info->enable_address, 0); + if (ACPI_FAILURE (status)) { + return (status); + } } + return (AE_OK); } + /****************************************************************************** * * FUNCTION: Acpi_hw_enable_non_wakeup_gpes @@ -363,20 +418,30 @@ * ******************************************************************************/ -void +acpi_status acpi_hw_enable_non_wakeup_gpes ( void) { u32 i; + ACPI_GPE_REGISTER_INFO *gpe_register_info; + acpi_status status; + + + ACPI_FUNCTION_ENTRY (); - FUNCTION_ENTRY (); for (i = 0; i < acpi_gbl_gpe_register_count; i++) { + gpe_register_info = &acpi_gbl_gpe_register_info[i]; + /* * We previously stored the enabled status of all GPEs. * Blast them back in. */ - acpi_os_write_port(acpi_gbl_gpe_registers[i].enable_addr, - acpi_gbl_gpe_registers[i].enable, 8); + status = acpi_hw_low_level_write (8, gpe_register_info->enable, + &gpe_register_info->enable_address, 0); + if (ACPI_FAILURE (status)) { + return (status); + } } + return (AE_OK); } diff -urN linux-2.4.18/drivers/acpi/hardware/hwregs.c lia64-2.4/drivers/acpi/hardware/hwregs.c --- linux-2.4.18/drivers/acpi/hardware/hwregs.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/hardware/hwregs.c Tue Jun 11 14:24:22 2002 @@ -3,12 +3,12 @@ * * Module Name: hwregs - Read/write access functions for the various ACPI * control and status registers. - * $Revision: 110 $ + * $Revision: 130 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,40 +27,10 @@ #include "acpi.h" -#include "achware.h" #include "acnamesp.h" #define _COMPONENT ACPI_HARDWARE - MODULE_NAME ("hwregs") - - -/******************************************************************************* - * - * FUNCTION: Acpi_hw_get_bit_shift - * - * PARAMETERS: Mask - Input mask to determine bit shift from. - * Must have at least 1 bit set. - * - * RETURN: Bit location of the lsb of the mask - * - * DESCRIPTION: Returns the bit number for the low order bit that's set. - * - ******************************************************************************/ - -u32 -acpi_hw_get_bit_shift ( - u32 mask) -{ - u32 shift; - - - FUNCTION_TRACE ("Hw_get_bit_shift"); - - - for (shift = 0; ((mask >> shift) & 1) == 0; shift++) { ; } - - return_VALUE (shift); -} + ACPI_MODULE_NAME ("hwregs") /******************************************************************************* @@ -75,92 +45,94 @@ * ******************************************************************************/ -void +acpi_status acpi_hw_clear_acpi_status (void) { - u16 gpe_length; - u16 index; + NATIVE_UINT_MAX32 i; + NATIVE_UINT gpe_block; + acpi_status status; - FUNCTION_TRACE ("Hw_clear_acpi_status"); + ACPI_FUNCTION_TRACE ("Hw_clear_acpi_status"); ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %04X\n", - ALL_FIXED_STS_BITS, + ACPI_BITMASK_ALL_FIXED_STATUS, (u16) ACPI_GET_ADDRESS (acpi_gbl_FADT->Xpm1a_evt_blk.address))); - acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE); - - acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, PM1_STS, ALL_FIXED_STS_BITS); - - - if (ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xpm1b_evt_blk.address)) { - acpi_os_write_port ((ACPI_IO_ADDRESS) - ACPI_GET_ADDRESS (acpi_gbl_FADT->Xpm1b_evt_blk.address), - ALL_FIXED_STS_BITS, 16); + status = acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } - /* now clear the GPE Bits */ + status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS, + ACPI_BITMASK_ALL_FIXED_STATUS); + if (ACPI_FAILURE (status)) { + goto unlock_and_exit; + } - if (acpi_gbl_FADT->gpe0blk_len) { - gpe_length = (u16) DIV_2 (acpi_gbl_FADT->gpe0blk_len); + /* Clear the fixed events */ - for (index = 0; index < gpe_length; index++) { - acpi_os_write_port ((ACPI_IO_ADDRESS) ( - ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe0blk.address) + index), - 0xFF, 8); + if (ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xpm1b_evt_blk.address)) { + status = acpi_hw_low_level_write (16, ACPI_BITMASK_ALL_FIXED_STATUS, + &acpi_gbl_FADT->Xpm1b_evt_blk, 0); + if (ACPI_FAILURE (status)) { + goto unlock_and_exit; } } - if (acpi_gbl_FADT->gpe1_blk_len) { - gpe_length = (u16) DIV_2 (acpi_gbl_FADT->gpe1_blk_len); + /* Clear the GPE Bits */ - for (index = 0; index < gpe_length; index++) { - acpi_os_write_port ((ACPI_IO_ADDRESS) ( - ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe1_blk.address) + index), - 0xFF, 8); + for (gpe_block = 0; gpe_block < ACPI_MAX_GPE_BLOCKS; gpe_block++) { + for (i = 0; i < acpi_gbl_gpe_block_info[gpe_block].register_count; i++) { + status = acpi_hw_low_level_write (8, 0xFF, + acpi_gbl_gpe_block_info[gpe_block].block_address, i); + if (ACPI_FAILURE (status)) { + goto unlock_and_exit; + } } } - acpi_ut_release_mutex (ACPI_MTX_HARDWARE); - return_VOID; +unlock_and_exit: + (void) acpi_ut_release_mutex (ACPI_MTX_HARDWARE); + return_ACPI_STATUS (status); } /******************************************************************************* * - * FUNCTION: Acpi_hw_obtain_sleep_type_register_data + * FUNCTION: Acpi_get_sleep_type_data * - * PARAMETERS: Sleep_state - Numeric state requested - * *Slp_Typ_a - Pointer to byte to receive SLP_TYPa value - * *Slp_Typ_b - Pointer to byte to receive SLP_TYPb value + * PARAMETERS: Sleep_state - Numeric sleep state + * *Sleep_type_a - Where SLP_TYPa is returned + * *Sleep_type_b - Where SLP_TYPb is returned * * RETURN: Status - ACPI status * - * DESCRIPTION: Acpi_hw_obtain_sleep_type_register_data() obtains the SLP_TYP and - * SLP_TYPb values for the sleep state requested. + * DESCRIPTION: Obtain the SLP_TYPa and SLP_TYPb values for the requested sleep + * state. * ******************************************************************************/ acpi_status -acpi_hw_obtain_sleep_type_register_data ( +acpi_get_sleep_type_data ( u8 sleep_state, - u8 *slp_typ_a, - u8 *slp_typ_b) + u8 *sleep_type_a, + u8 *sleep_type_b) { acpi_status status = AE_OK; acpi_operand_object *obj_desc; - FUNCTION_TRACE ("Hw_obtain_sleep_type_register_data"); + ACPI_FUNCTION_TRACE ("Acpi_get_sleep_type_data"); /* * Validate parameters */ if ((sleep_state > ACPI_S_STATES_MAX) || - !slp_typ_a || !slp_typ_b) { + !sleep_type_a || !sleep_type_b) { return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -174,7 +146,7 @@ } if (!obj_desc) { - REPORT_ERROR (("Missing Sleep State object\n")); + ACPI_REPORT_ERROR (("Missing Sleep State object\n")); return_ACPI_STATUS (AE_NOT_EXIST); } @@ -185,387 +157,281 @@ */ /* Even though Acpi_evaluate_object resolves package references, - * Ns_evaluate dpesn't. So, we do it here. + * Ns_evaluate doesn't. So, we do it here. */ status = acpi_ut_resolve_package_references(obj_desc); if (obj_desc->package.count < 2) { /* Must have at least two elements */ - REPORT_ERROR (("Sleep State package does not have at least two elements\n")); - status = AE_ERROR; + ACPI_REPORT_ERROR (("Sleep State package does not have at least two elements\n")); + status = AE_AML_NO_OPERAND; } - - else if (((obj_desc->package.elements[0])->common.type != - ACPI_TYPE_INTEGER) || - ((obj_desc->package.elements[1])->common.type != - ACPI_TYPE_INTEGER)) { + else if (((obj_desc->package.elements[0])->common.type != ACPI_TYPE_INTEGER) || + ((obj_desc->package.elements[1])->common.type != ACPI_TYPE_INTEGER)) { /* Must have two */ - REPORT_ERROR (("Sleep State package elements are not both of type Number\n")); - status = AE_ERROR; + ACPI_REPORT_ERROR (("Sleep State package elements are not both of type Number\n")); + status = AE_AML_OPERAND_TYPE; } - else { /* * Valid _Sx_ package size, type, and value */ - *slp_typ_a = (u8) (obj_desc->package.elements[0])->integer.value; - - *slp_typ_b = (u8) (obj_desc->package.elements[1])->integer.value; + *sleep_type_a = (u8) (obj_desc->package.elements[0])->integer.value; + *sleep_type_b = (u8) (obj_desc->package.elements[1])->integer.value; } - if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Bad Sleep object %p type %X\n", obj_desc, obj_desc->common.type)); } acpi_ut_remove_reference (obj_desc); - return_ACPI_STATUS (status); } /******************************************************************************* * - * FUNCTION: Acpi_hw_register_bit_access + * FUNCTION: Acpi_hw_get_register_bit_mask * - * PARAMETERS: Read_write - Either ACPI_READ or ACPI_WRITE. - * Use_lock - Lock the hardware - * Register_id - index of ACPI Register to access - * Value - (only used on write) value to write to the - * Register. Shifted all the way right. + * PARAMETERS: Register_id - index of ACPI Register to access * - * RETURN: Value written to or read from specified Register. This value - * is shifted all the way right. + * RETURN: The bit mask to be used when accessing the register * - * DESCRIPTION: Generic ACPI Register read/write function. + * DESCRIPTION: Map Register_id into a register bit mask. * ******************************************************************************/ -u32 -acpi_hw_register_bit_access ( - NATIVE_UINT read_write, - u8 use_lock, - u32 register_id, - ...) /* Value (only used on write) */ +ACPI_BIT_REGISTER_INFO * +acpi_hw_get_bit_register_info ( + u32 register_id) { - u32 register_value = 0; - u32 mask = 0; - u32 value = 0; - va_list marker; - + ACPI_FUNCTION_NAME ("Hw_get_bit_register_info"); - FUNCTION_TRACE ("Hw_register_bit_access"); - - - if (read_write == ACPI_WRITE) { - va_start (marker, register_id); - value = va_arg (marker, u32); - va_end (marker); - } - if (ACPI_MTX_LOCK == use_lock) { - acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE); + if (register_id > ACPI_BITREG_MAX) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid Bit_register ID: %X\n", register_id)); + return (NULL); } - /* - * Decode the Register ID - * Register id = Register block id | bit id - * - * Check bit id to fine locate Register offset. - * Check Mask to determine Register offset, and then read-write. - */ - switch (REGISTER_BLOCK_ID (register_id)) { - case PM1_STS: - - switch (register_id) { - case TMR_STS: - mask = TMR_STS_MASK; - break; - - case BM_STS: - mask = BM_STS_MASK; - break; - - case GBL_STS: - mask = GBL_STS_MASK; - break; - - case PWRBTN_STS: - mask = PWRBTN_STS_MASK; - break; - - case SLPBTN_STS: - mask = SLPBTN_STS_MASK; - break; - - case RTC_STS: - mask = RTC_STS_MASK; - break; - - case WAK_STS: - mask = WAK_STS_MASK; - break; - - default: - mask = 0; - break; - } - - register_value = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, PM1_STS); - - if (read_write == ACPI_WRITE) { - /* - * Status Registers are different from the rest. Clear by - * writing 1, writing 0 has no effect. So, the only relevent - * information is the single bit we're interested in, all - * others should be written as 0 so they will be left - * unchanged - */ - value <<= acpi_hw_get_bit_shift (mask); - value &= mask; - - if (value) { - acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, PM1_STS, - (u16) value); - register_value = 0; - } - } - - break; - - - case PM1_EN: + return (&acpi_gbl_bit_register_info[register_id]); +} - switch (register_id) { - case TMR_EN: - mask = TMR_EN_MASK; - break; - case GBL_EN: - mask = GBL_EN_MASK; - break; +/******************************************************************************* + * + * FUNCTION: Acpi_get_register + * + * PARAMETERS: Register_id - index of ACPI Register to access + * Use_lock - Lock the hardware + * + * RETURN: Value is read from specified Register. Value returned is + * normalized to bit0 (is shifted all the way right) + * + * DESCRIPTION: ACPI Bit_register read function. + * + ******************************************************************************/ - case PWRBTN_EN: - mask = PWRBTN_EN_MASK; - break; +acpi_status +acpi_get_register ( + u32 register_id, + u32 *return_value, + u32 flags) +{ + u32 register_value = 0; + ACPI_BIT_REGISTER_INFO *bit_reg_info; + acpi_status status; - case SLPBTN_EN: - mask = SLPBTN_EN_MASK; - break; - case RTC_EN: - mask = RTC_EN_MASK; - break; + ACPI_FUNCTION_TRACE ("Acpi_get_register"); - default: - mask = 0; - break; - } - register_value = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, PM1_EN); + /* Get the info structure corresponding to the requested ACPI Register */ - if (read_write == ACPI_WRITE) { - register_value &= ~mask; - value <<= acpi_hw_get_bit_shift (mask); - value &= mask; - register_value |= value; + bit_reg_info = acpi_hw_get_bit_register_info (register_id); + if (!bit_reg_info) { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } - acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, PM1_EN, (u16) register_value); + if (flags & ACPI_MTX_LOCK) { + status = acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } + } - break; - - - case PM1_CONTROL: + status = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, + bit_reg_info->parent_register, ®ister_value); - switch (register_id) { - case SCI_EN: - mask = SCI_EN_MASK; - break; + if (flags & ACPI_MTX_LOCK) { + (void) acpi_ut_release_mutex (ACPI_MTX_HARDWARE); + } - case BM_RLD: - mask = BM_RLD_MASK; - break; + if (ACPI_SUCCESS (status)) { + /* Normalize the value that was read */ - case GBL_RLS: - mask = GBL_RLS_MASK; - break; + register_value = ((register_value & bit_reg_info->access_bit_mask) + >> bit_reg_info->bit_position); - case SLP_TYPE_A: - case SLP_TYPE_B: - mask = SLP_TYPE_X_MASK; - break; + *return_value = register_value; - case SLP_EN: - mask = SLP_EN_MASK; - break; + ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read value %X\n", register_value)); + } - default: - mask = 0; - break; - } + return_ACPI_STATUS (status); +} - /* - * Read the PM1 Control register. - * Note that at this level, the fact that there are actually TWO - * registers (A and B) and that B may not exist, are abstracted. - */ - register_value = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, PM1_CONTROL); +/******************************************************************************* + * + * FUNCTION: Acpi_set_register + * + * PARAMETERS: Register_id - ID of ACPI Bit_register to access + * Value - (only used on write) value to write to the + * Register, NOT pre-normalized to the bit pos. + * Flags - Lock the hardware or not + * + * RETURN: None + * + * DESCRIPTION: ACPI Bit Register write function. + * + ******************************************************************************/ - ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM1 control: Read %X\n", register_value)); +acpi_status +acpi_set_register ( + u32 register_id, + u32 value, + u32 flags) +{ + u32 register_value = 0; + ACPI_BIT_REGISTER_INFO *bit_reg_info; + acpi_status status; - if (read_write == ACPI_WRITE) { - register_value &= ~mask; - value <<= acpi_hw_get_bit_shift (mask); - value &= mask; - register_value |= value; - /* - * SLP_TYPE_x Registers are written differently - * than any other control Registers with - * respect to A and B Registers. The value - * for A may be different than the value for B - * - * Therefore, pass the Register_id, not just generic PM1_CONTROL, - * because we need to do different things. Yuck. - */ - acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, register_id, - (u16) register_value); - } - break; + ACPI_FUNCTION_TRACE_U32 ("Acpi_set_register", register_id); - case PM2_CONTROL: + /* Get the info structure corresponding to the requested ACPI Register */ - switch (register_id) { - case ARB_DIS: - mask = ARB_DIS_MASK; - break; + bit_reg_info = acpi_hw_get_bit_register_info (register_id); + if (!bit_reg_info) { + ACPI_REPORT_ERROR (("Bad ACPI HW Register_id: %X\n", register_id)); + return_ACPI_STATUS (AE_BAD_PARAMETER); + } - default: - mask = 0; - break; + if (flags & ACPI_MTX_LOCK) { + status = acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } + } - register_value = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, PM2_CONTROL); - - ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM2 control: Read %X from %8.8X%8.8X\n", - register_value, HIDWORD(acpi_gbl_FADT->Xpm2_cnt_blk.address), - LODWORD(acpi_gbl_FADT->Xpm2_cnt_blk.address))); + /* Always do a register read first so we can insert the new bits */ - if (read_write == ACPI_WRITE) { - register_value &= ~mask; - value <<= acpi_hw_get_bit_shift (mask); - value &= mask; - register_value |= value; + status = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, + bit_reg_info->parent_register, ®ister_value); + if (ACPI_FAILURE (status)) { + goto unlock_and_exit; + } - ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %8.8X%8.8X\n", - register_value, - HIDWORD(acpi_gbl_FADT->Xpm2_cnt_blk.address), - LODWORD(acpi_gbl_FADT->Xpm2_cnt_blk.address))); + /* + * Decode the Register ID + * Register id = Register block id | bit id + * + * Check bit id to fine locate Register offset. + * Check Mask to determine Register offset, and then read-write. + */ + switch (bit_reg_info->parent_register) { + case ACPI_REGISTER_PM1_STATUS: - acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, - PM2_CONTROL, (u8) (register_value)); + /* + * Status Registers are different from the rest. Clear by + * writing 1, writing 0 has no effect. So, the only relevent + * information is the single bit we're interested in, all others should + * be written as 0 so they will be left unchanged + */ + value = ACPI_REGISTER_PREPARE_BITS (value, + bit_reg_info->bit_position, bit_reg_info->access_bit_mask); + if (value) { + status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, + ACPI_REGISTER_PM1_STATUS, (u16) value); + register_value = 0; } break; - case PM_TIMER: + case ACPI_REGISTER_PM1_ENABLE: - mask = TMR_VAL_MASK; - register_value = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, - PM_TIMER); - ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM_TIMER: Read %X from %8.8X%8.8X\n", - register_value, - HIDWORD(acpi_gbl_FADT->Xpm_tmr_blk.address), - LODWORD(acpi_gbl_FADT->Xpm_tmr_blk.address))); + ACPI_REGISTER_INSERT_VALUE (register_value, bit_reg_info->bit_position, + bit_reg_info->access_bit_mask, value); + status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, + ACPI_REGISTER_PM1_ENABLE, (u16) register_value); break; - case GPE1_EN_BLOCK: - case GPE1_STS_BLOCK: - case GPE0_EN_BLOCK: - case GPE0_STS_BLOCK: - - /* Determine the bit to be accessed - * - * (u32) Register_id: - * 31 24 16 8 0 - * +--------+--------+--------+--------+ - * | gpe_block_id | gpe_bit_number | - * +--------+--------+--------+--------+ - * - * gpe_block_id is one of GPE[01]_EN_BLOCK and GPE[01]_STS_BLOCK - * gpe_bit_number is relative from the gpe_block (0x00~0xFF) - */ - mask = REGISTER_BIT_ID(register_id); /* gpe_bit_number */ - register_id = REGISTER_BLOCK_ID(register_id) | (mask >> 3); - mask = acpi_gbl_decode_to8bit [mask % 8]; + case ACPI_REGISTER_PM1_CONTROL: /* - * The base address of the GPE 0 Register Block - * Plus 1/2 the length of the GPE 0 Register Block - * The enable Register is the Register following the Status Register - * and each Register is defined as 1/2 of the total Register Block + * Read the PM1 Control register. + * Note that at this level, the fact that there are actually TWO + * registers (A and B - and that B may not exist) is abstracted. */ + ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM1 control: Read %X\n", register_value)); - /* - * This sets the bit within Enable_bit that needs to be written to - * the Register indicated in Mask to a 1, all others are 0 - */ + ACPI_REGISTER_INSERT_VALUE (register_value, bit_reg_info->bit_position, + bit_reg_info->access_bit_mask, value); - /* Now get the current Enable Bits in the selected Reg */ + status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, register_id, + (u16) register_value); + break; - register_value = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, register_id); - ACPI_DEBUG_PRINT ((ACPI_DB_IO, "GPE Enable bits: Read %X from %X\n", - register_value, register_id)); - if (read_write == ACPI_WRITE) { - register_value &= ~mask; - value <<= acpi_hw_get_bit_shift (mask); - value &= mask; - register_value |= value; + case ACPI_REGISTER_PM2_CONTROL: - /* - * This write will put the Action state into the General Purpose - * Enable Register indexed by the value in Mask - */ - ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %04X\n", - register_value, register_id)); - acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, register_id, - (u8) register_value); - register_value = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, - register_id); + status = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, + ACPI_REGISTER_PM2_CONTROL, ®ister_value); + if (ACPI_FAILURE (status)) { + goto unlock_and_exit; } - break; + ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM2 control: Read %X from %8.8X%8.8X\n", + register_value, + ACPI_HIDWORD (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xpm2_cnt_blk.address)), + ACPI_LODWORD (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xpm2_cnt_blk.address)))); - case SMI_CMD_BLOCK: - case PROCESSOR_BLOCK: + ACPI_REGISTER_INSERT_VALUE (register_value, bit_reg_info->bit_position, + bit_reg_info->access_bit_mask, value); - /* Not used by any callers at this time - therefore, not implemented */ + ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %4.4X to %8.8X%8.8X\n", + register_value, + ACPI_HIDWORD (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xpm2_cnt_blk.address)), + ACPI_LODWORD (ACPI_GET_ADDRESS (acpi_gbl_FADT->Xpm2_cnt_blk.address)))); + + status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, + ACPI_REGISTER_PM2_CONTROL, (u8) (register_value)); + break; - default: - mask = 0; + default: break; } - if (ACPI_MTX_LOCK == use_lock) { - acpi_ut_release_mutex (ACPI_MTX_HARDWARE); + +unlock_and_exit: + + if (flags & ACPI_MTX_LOCK) { + (void) acpi_ut_release_mutex (ACPI_MTX_HARDWARE); } + /* Normalize the value that was read */ - register_value &= mask; - register_value >>= acpi_hw_get_bit_shift (mask); + ACPI_DEBUG_EXEC (register_value = ((register_value & bit_reg_info->access_bit_mask) >> bit_reg_info->bit_position)); - ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Register I/O: returning %X\n", register_value)); - return_VALUE (register_value); + ACPI_DEBUG_PRINT ((ACPI_DB_IO, "ACPI Register Write actual %X\n", register_value)); + return_ACPI_STATUS (status); } @@ -583,103 +449,98 @@ * ******************************************************************************/ -u32 +acpi_status acpi_hw_register_read ( u8 use_lock, - u32 register_id) + u32 register_id, + u32 *return_value) { - u32 value = 0; + u32 value1 = 0; + u32 value2 = 0; u32 bank_offset; + acpi_status status; - FUNCTION_TRACE ("Hw_register_read"); + ACPI_FUNCTION_TRACE ("Hw_register_read"); if (ACPI_MTX_LOCK == use_lock) { - acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE); + status = acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } } + switch (register_id) { + case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ - switch (REGISTER_BLOCK_ID(register_id)) { - case PM1_STS: /* 16-bit access */ + status = acpi_hw_low_level_read (16, &value1, &acpi_gbl_FADT->Xpm1a_evt_blk, 0); + if (ACPI_FAILURE (status)) { + goto unlock_and_exit; + } - value = acpi_hw_low_level_read (16, &acpi_gbl_FADT->Xpm1a_evt_blk, 0); - value |= acpi_hw_low_level_read (16, &acpi_gbl_FADT->Xpm1b_evt_blk, 0); + status = acpi_hw_low_level_read (16, &value2, &acpi_gbl_FADT->Xpm1b_evt_blk, 0); + value1 |= value2; break; - case PM1_EN: /* 16-bit access*/ - - bank_offset = DIV_2 (acpi_gbl_FADT->pm1_evt_len); - value = acpi_hw_low_level_read (16, &acpi_gbl_FADT->Xpm1a_evt_blk, bank_offset); - value |= acpi_hw_low_level_read (16, &acpi_gbl_FADT->Xpm1b_evt_blk, bank_offset); - break; - + case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access*/ - case PM1_CONTROL: /* 16-bit access */ + bank_offset = ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len); + status = acpi_hw_low_level_read (16, &value1, &acpi_gbl_FADT->Xpm1a_evt_blk, bank_offset); + if (ACPI_FAILURE (status)) { + goto unlock_and_exit; + } - value = acpi_hw_low_level_read (16, &acpi_gbl_FADT->Xpm1a_cnt_blk, 0); - value |= acpi_hw_low_level_read (16, &acpi_gbl_FADT->Xpm1b_cnt_blk, 0); + status = acpi_hw_low_level_read (16, &value2, &acpi_gbl_FADT->Xpm1b_evt_blk, bank_offset); + value1 |= value2; break; - case PM2_CONTROL: /* 8-bit access */ + case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */ - value = acpi_hw_low_level_read (8, &acpi_gbl_FADT->Xpm2_cnt_blk, 0); - break; - - - case PM_TIMER: /* 32-bit access */ + status = acpi_hw_low_level_read (16, &value1, &acpi_gbl_FADT->Xpm1a_cnt_blk, 0); + if (ACPI_FAILURE (status)) { + goto unlock_and_exit; + } - value = acpi_hw_low_level_read (32, &acpi_gbl_FADT->Xpm_tmr_blk, 0); + status = acpi_hw_low_level_read (16, &value2, &acpi_gbl_FADT->Xpm1b_cnt_blk, 0); + value1 |= value2; break; - /* - * For the GPE? Blocks, the lower word of Register_id contains the - * byte offset for which to read, as each part of each block may be - * several bytes long. - */ - case GPE0_STS_BLOCK: /* 8-bit access */ + case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ - bank_offset = REGISTER_BIT_ID(register_id); - value = acpi_hw_low_level_read (8, &acpi_gbl_FADT->Xgpe0blk, bank_offset); + status = acpi_hw_low_level_read (8, &value1, &acpi_gbl_FADT->Xpm2_cnt_blk, 0); break; - case GPE0_EN_BLOCK: /* 8-bit access */ - - bank_offset = DIV_2 (acpi_gbl_FADT->gpe0blk_len) + REGISTER_BIT_ID(register_id); - value = acpi_hw_low_level_read (8, &acpi_gbl_FADT->Xgpe0blk, bank_offset); - break; - case GPE1_STS_BLOCK: /* 8-bit access */ + case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ - bank_offset = REGISTER_BIT_ID(register_id); - value = acpi_hw_low_level_read (8, &acpi_gbl_FADT->Xgpe1_blk, bank_offset); + status = acpi_hw_low_level_read (32, &value1, &acpi_gbl_FADT->Xpm_tmr_blk, 0); break; - case GPE1_EN_BLOCK: /* 8-bit access */ + case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ - bank_offset = DIV_2 (acpi_gbl_FADT->gpe1_blk_len) + REGISTER_BIT_ID(register_id); - value = acpi_hw_low_level_read (8, &acpi_gbl_FADT->Xgpe1_blk, bank_offset); - break; - - case SMI_CMD_BLOCK: /* 8bit */ - - acpi_os_read_port (acpi_gbl_FADT->smi_cmd, &value, 8); + status = acpi_os_read_port (acpi_gbl_FADT->smi_cmd, &value1, 8); break; default: - /* Value will be returned as 0 */ + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Register ID: %X\n", register_id)); + status = AE_BAD_PARAMETER; break; } - +unlock_and_exit: if (ACPI_MTX_LOCK == use_lock) { - acpi_ut_release_mutex (ACPI_MTX_HARDWARE); + (void) acpi_ut_release_mutex (ACPI_MTX_HARDWARE); + } + + if (ACPI_SUCCESS (status)) { + *return_value = value1; } - return_VALUE (value); + return_ACPI_STATUS (status); } @@ -697,118 +558,104 @@ * ******************************************************************************/ -void +acpi_status acpi_hw_register_write ( u8 use_lock, u32 register_id, u32 value) { u32 bank_offset; + acpi_status status; - FUNCTION_TRACE ("Hw_register_write"); + ACPI_FUNCTION_TRACE ("Hw_register_write"); if (ACPI_MTX_LOCK == use_lock) { - acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE); + status = acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } } + switch (register_id) { + case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ - switch (REGISTER_BLOCK_ID (register_id)) { - case PM1_STS: /* 16-bit access */ - - acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1a_evt_blk, 0); - acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1b_evt_blk, 0); - break; - - - case PM1_EN: /* 16-bit access*/ - - bank_offset = DIV_2 (acpi_gbl_FADT->pm1_evt_len); - acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1a_evt_blk, bank_offset); - acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1b_evt_blk, bank_offset); - break; - - - case PM1_CONTROL: /* 16-bit access */ + status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1a_evt_blk, 0); + if (ACPI_FAILURE (status)) { + goto unlock_and_exit; + } - acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1a_cnt_blk, 0); - acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1b_cnt_blk, 0); + status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1b_evt_blk, 0); break; - case PM1A_CONTROL: /* 16-bit access */ + case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access*/ - acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1a_cnt_blk, 0); - break; - - - case PM1B_CONTROL: /* 16-bit access */ + bank_offset = ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len); + status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1a_evt_blk, bank_offset); + if (ACPI_FAILURE (status)) { + goto unlock_and_exit; + } - acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1b_cnt_blk, 0); + status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1b_evt_blk, bank_offset); break; - case PM2_CONTROL: /* 8-bit access */ - - acpi_hw_low_level_write (8, value, &acpi_gbl_FADT->Xpm2_cnt_blk, 0); - break; - + case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */ - case PM_TIMER: /* 32-bit access */ + status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1a_cnt_blk, 0); + if (ACPI_FAILURE (status)) { + goto unlock_and_exit; + } - acpi_hw_low_level_write (32, value, &acpi_gbl_FADT->Xpm_tmr_blk, 0); + status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1b_cnt_blk, 0); break; - case GPE0_STS_BLOCK: /* 8-bit access */ + case ACPI_REGISTER_PM1A_CONTROL: /* 16-bit access */ - bank_offset = REGISTER_BIT_ID(register_id); - acpi_hw_low_level_write (8, value, &acpi_gbl_FADT->Xgpe0blk, bank_offset); + status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1a_cnt_blk, 0); break; - case GPE0_EN_BLOCK: /* 8-bit access */ + case ACPI_REGISTER_PM1B_CONTROL: /* 16-bit access */ - bank_offset = DIV_2 (acpi_gbl_FADT->gpe0blk_len) + REGISTER_BIT_ID(register_id); - acpi_hw_low_level_write (8, value, &acpi_gbl_FADT->Xgpe0blk, bank_offset); + status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1b_cnt_blk, 0); break; - case GPE1_STS_BLOCK: /* 8-bit access */ + case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ - bank_offset = REGISTER_BIT_ID(register_id); - acpi_hw_low_level_write (8, value, &acpi_gbl_FADT->Xgpe1_blk, bank_offset); + status = acpi_hw_low_level_write (8, value, &acpi_gbl_FADT->Xpm2_cnt_blk, 0); break; - case GPE1_EN_BLOCK: /* 8-bit access */ + case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ - bank_offset = DIV_2 (acpi_gbl_FADT->gpe1_blk_len) + REGISTER_BIT_ID(register_id); - acpi_hw_low_level_write (8, value, &acpi_gbl_FADT->Xgpe1_blk, bank_offset); + status = acpi_hw_low_level_write (32, value, &acpi_gbl_FADT->Xpm_tmr_blk, 0); break; - case SMI_CMD_BLOCK: /* 8bit */ + case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ - /* For 2.0, SMI_CMD is always in IO space */ - /* TBD: what about 1.0? 0.71? */ + /* SMI_CMD is currently always in IO space */ - acpi_os_write_port (acpi_gbl_FADT->smi_cmd, value, 8); + status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd, (acpi_integer) value, 8); break; default: - value = 0; + status = AE_BAD_PARAMETER; break; } - +unlock_and_exit: if (ACPI_MTX_LOCK == use_lock) { - acpi_ut_release_mutex (ACPI_MTX_HARDWARE); + (void) acpi_ut_release_mutex (ACPI_MTX_HARDWARE); } - return_VOID; + return_ACPI_STATUS (status); } @@ -826,31 +673,33 @@ * ******************************************************************************/ -u32 +acpi_status acpi_hw_low_level_read ( u32 width, + u32 *value, acpi_generic_address *reg, u32 offset) { - u32 value = 0; ACPI_PHYSICAL_ADDRESS mem_address; ACPI_IO_ADDRESS io_address; acpi_pci_id pci_id; u16 pci_register; + acpi_status status; - FUNCTION_ENTRY (); + ACPI_FUNCTION_NAME ("Hw_low_level_read"); /* * Must have a valid pointer to a GAS structure, and - * a non-zero address within + * a non-zero address within. However, don't return an error + * because the PM1A/B code must not fail if B isn't present. */ if ((!reg) || (!ACPI_VALID_ADDRESS (reg->address))) { - return 0; + return (AE_OK); } - + *value = 0; /* * Three address spaces supported: @@ -859,17 +708,19 @@ switch (reg->address_space_id) { case ACPI_ADR_SPACE_SYSTEM_MEMORY: - mem_address = (ACPI_PHYSICAL_ADDRESS) (ACPI_GET_ADDRESS (reg->address) + offset); + mem_address = (ACPI_GET_ADDRESS (reg->address) + + (ACPI_PHYSICAL_ADDRESS) offset); - acpi_os_read_memory (mem_address, &value, width); + status = acpi_os_read_memory (mem_address, value, width); break; case ACPI_ADR_SPACE_SYSTEM_IO: - io_address = (ACPI_IO_ADDRESS) (ACPI_GET_ADDRESS (reg->address) + offset); + io_address = (ACPI_IO_ADDRESS) (ACPI_GET_ADDRESS (reg->address) + + (ACPI_PHYSICAL_ADDRESS) offset); - acpi_os_read_port (io_address, &value, width); + status = acpi_os_read_port (io_address, value, width); break; @@ -879,13 +730,20 @@ pci_id.bus = 0; pci_id.device = ACPI_PCI_DEVICE (ACPI_GET_ADDRESS (reg->address)); pci_id.function = ACPI_PCI_FUNCTION (ACPI_GET_ADDRESS (reg->address)); - pci_register = (u16) (ACPI_PCI_REGISTER (ACPI_GET_ADDRESS (reg->address)) + offset); + pci_register = (u16) (ACPI_PCI_REGISTER (ACPI_GET_ADDRESS (reg->address)) + + offset); - acpi_os_read_pci_configuration (&pci_id, pci_register, &value, width); + status = acpi_os_read_pci_configuration (&pci_id, pci_register, value, width); + break; + + + default: + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unsupported address space: %X\n", reg->address_space_id)); + status = AE_BAD_PARAMETER; break; } - return value; + return (status); } @@ -905,7 +763,7 @@ * ******************************************************************************/ -void +acpi_status acpi_hw_low_level_write ( u32 width, u32 value, @@ -916,21 +774,21 @@ ACPI_IO_ADDRESS io_address; acpi_pci_id pci_id; u16 pci_register; + acpi_status status; - FUNCTION_ENTRY (); + ACPI_FUNCTION_NAME ("Hw_low_level_write"); /* * Must have a valid pointer to a GAS structure, and - * a non-zero address within + * a non-zero address within. However, don't return an error + * because the PM1A/B code must not fail if B isn't present. */ if ((!reg) || (!ACPI_VALID_ADDRESS (reg->address))) { - return; + return (AE_OK); } - - /* * Three address spaces supported: * Memory, Io, or PCI config. @@ -938,17 +796,19 @@ switch (reg->address_space_id) { case ACPI_ADR_SPACE_SYSTEM_MEMORY: - mem_address = (ACPI_PHYSICAL_ADDRESS) (ACPI_GET_ADDRESS (reg->address) + offset); + mem_address = (ACPI_GET_ADDRESS (reg->address) + + (ACPI_PHYSICAL_ADDRESS) offset); - acpi_os_write_memory (mem_address, value, width); + status = acpi_os_write_memory (mem_address, (acpi_integer) value, width); break; case ACPI_ADR_SPACE_SYSTEM_IO: - io_address = (ACPI_IO_ADDRESS) (ACPI_GET_ADDRESS (reg->address) + offset); + io_address = (ACPI_IO_ADDRESS) (ACPI_GET_ADDRESS (reg->address) + + (ACPI_PHYSICAL_ADDRESS) offset); - acpi_os_write_port (io_address, value, width); + status = acpi_os_write_port (io_address, (acpi_integer) value, width); break; @@ -958,9 +818,18 @@ pci_id.bus = 0; pci_id.device = ACPI_PCI_DEVICE (ACPI_GET_ADDRESS (reg->address)); pci_id.function = ACPI_PCI_FUNCTION (ACPI_GET_ADDRESS (reg->address)); - pci_register = (u16) (ACPI_PCI_REGISTER (ACPI_GET_ADDRESS (reg->address)) + offset); + pci_register = (u16) (ACPI_PCI_REGISTER (ACPI_GET_ADDRESS (reg->address)) + + offset); + + status = acpi_os_write_pci_configuration (&pci_id, pci_register, (acpi_integer) value, width); + break; - acpi_os_write_pci_configuration (&pci_id, pci_register, value, width); + + default: + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unsupported address space: %X\n", reg->address_space_id)); + status = AE_BAD_PARAMETER; break; } + + return (status); } diff -urN linux-2.4.18/drivers/acpi/hardware/hwsleep.c lia64-2.4/drivers/acpi/hardware/hwsleep.c --- linux-2.4.18/drivers/acpi/hardware/hwsleep.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/hardware/hwsleep.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface - * $Revision: 22 $ + * $Revision: 45 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,11 +25,9 @@ */ #include "acpi.h" -#include "acnamesp.h" -#include "achware.h" #define _COMPONENT ACPI_HARDWARE - MODULE_NAME ("hwsleep") + ACPI_MODULE_NAME ("hwsleep") /****************************************************************************** @@ -39,7 +37,7 @@ * PARAMETERS: Physical_address - Physical address of ACPI real mode * entry point. * - * RETURN: AE_OK or AE_ERROR + * RETURN: Status * * DESCRIPTION: Access function for d_firmware_waking_vector field in FACS * @@ -50,22 +48,18 @@ ACPI_PHYSICAL_ADDRESS physical_address) { - FUNCTION_TRACE ("Acpi_set_firmware_waking_vector"); - + ACPI_FUNCTION_TRACE ("Acpi_set_firmware_waking_vector"); - /* Make sure that we have an FACS */ - - if (!acpi_gbl_FACS) { - return_ACPI_STATUS (AE_NO_ACPI_TABLES); - } /* Set the vector */ - if (acpi_gbl_FACS->vector_width == 32) { - * (u32 *) acpi_gbl_FACS->firmware_waking_vector = (u32) physical_address; + if (acpi_gbl_common_fACS.vector_width == 32) { + *(ACPI_CAST_PTR (u32, acpi_gbl_common_fACS.firmware_waking_vector)) + = (u32) physical_address; } else { - *acpi_gbl_FACS->firmware_waking_vector = physical_address; + *acpi_gbl_common_fACS.firmware_waking_vector + = physical_address; } return_ACPI_STATUS (AE_OK); @@ -82,7 +76,7 @@ * * RETURN: Status * - * DESCRIPTION: Access function for d_firmware_waking_vector field in FACS + * DESCRIPTION: Access function for Firmware_waking_vector field in FACS * ******************************************************************************/ @@ -91,141 +85,229 @@ ACPI_PHYSICAL_ADDRESS *physical_address) { - FUNCTION_TRACE ("Acpi_get_firmware_waking_vector"); + ACPI_FUNCTION_TRACE ("Acpi_get_firmware_waking_vector"); if (!physical_address) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Make sure that we have an FACS */ - - if (!acpi_gbl_FACS) { - return_ACPI_STATUS (AE_NO_ACPI_TABLES); - } - /* Get the vector */ - if (acpi_gbl_FACS->vector_width == 32) { - *physical_address = * (u32 *) acpi_gbl_FACS->firmware_waking_vector; + if (acpi_gbl_common_fACS.vector_width == 32) { + *physical_address = (ACPI_PHYSICAL_ADDRESS) + *(ACPI_CAST_PTR (u32, acpi_gbl_common_fACS.firmware_waking_vector)); } else { - *physical_address = *acpi_gbl_FACS->firmware_waking_vector; + *physical_address = + *acpi_gbl_common_fACS.firmware_waking_vector; } return_ACPI_STATUS (AE_OK); } + /****************************************************************************** * - * FUNCTION: Acpi_enter_sleep_state + * FUNCTION: Acpi_enter_sleep_state_prep * * PARAMETERS: Sleep_state - Which sleep state to enter * * RETURN: Status * - * DESCRIPTION: Enter a system sleep state (see ACPI 2.0 spec p 231) + * DESCRIPTION: Prepare to enter a system sleep state (see ACPI 2.0 spec p 231) + * This function must execute with interrupts enabled. + * We break sleeping into 2 stages so that OSPM can handle + * various OS-specific tasks between the two steps. * ******************************************************************************/ acpi_status -acpi_enter_sleep_state ( +acpi_enter_sleep_state_prep ( u8 sleep_state) { acpi_status status; acpi_object_list arg_list; acpi_object arg; - u8 type_a; - u8 type_b; - u16 PM1Acontrol; - u16 PM1Bcontrol; - FUNCTION_TRACE ("Acpi_enter_sleep_state"); + ACPI_FUNCTION_TRACE ("Acpi_enter_sleep_state_prep"); /* * _PSW methods could be run here to enable wake-on keyboard, LAN, etc. */ - status = acpi_hw_obtain_sleep_type_register_data (sleep_state, &type_a, &type_b); - if (!ACPI_SUCCESS (status)) { - return status; + status = acpi_get_sleep_type_data (sleep_state, + &acpi_gbl_sleep_type_a, &acpi_gbl_sleep_type_b); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } - /* run the _PTS and _GTS methods */ + /* Setup parameter object */ - MEMSET(&arg_list, 0, sizeof(arg_list)); arg_list.count = 1; arg_list.pointer = &arg; - MEMSET(&arg, 0, sizeof(arg)); arg.type = ACPI_TYPE_INTEGER; arg.integer.value = sleep_state; - acpi_evaluate_object (NULL, "\\_PTS", &arg_list, NULL); - acpi_evaluate_object (NULL, "\\_GTS", &arg_list, NULL); + /* Run the _PTS and _GTS methods */ + + status = acpi_evaluate_object (NULL, "\\_PTS", &arg_list, NULL); + if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) { + return_ACPI_STATUS (status); + } + + status = acpi_evaluate_object (NULL, "\\_GTS", &arg_list, NULL); + if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) { + return_ACPI_STATUS (status); + } + + return_ACPI_STATUS (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: Acpi_enter_sleep_state + * + * PARAMETERS: Sleep_state - Which sleep state to enter + * + * RETURN: Status + * + * DESCRIPTION: Enter a system sleep state (see ACPI 2.0 spec p 231) + * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED + * + ******************************************************************************/ + +acpi_status +acpi_enter_sleep_state ( + u8 sleep_state) +{ + u32 PM1Acontrol; + u32 PM1Bcontrol; + ACPI_BIT_REGISTER_INFO *sleep_type_reg_info; + ACPI_BIT_REGISTER_INFO *sleep_enable_reg_info; + u32 in_value; + acpi_status status; + + + ACPI_FUNCTION_TRACE ("Acpi_enter_sleep_state"); + + + if ((acpi_gbl_sleep_type_a > ACPI_SLEEP_TYPE_MAX) || + (acpi_gbl_sleep_type_b > ACPI_SLEEP_TYPE_MAX)) { + ACPI_REPORT_ERROR (("Sleep values out of range: A=%X B=%X\n", + acpi_gbl_sleep_type_a, acpi_gbl_sleep_type_b)); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); + } + + + sleep_type_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_TYPE_A); + sleep_enable_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_ENABLE); + + /* Clear wake status */ - /* clear wake status */ + status = acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_LOCK); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + status = acpi_hw_clear_acpi_status(); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - acpi_hw_register_bit_access (ACPI_WRITE, ACPI_MTX_LOCK, WAK_STS, 1); + /* Disable BM arbitration */ - disable (); + status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_LOCK); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - acpi_hw_disable_non_wakeup_gpes(); + status = acpi_hw_disable_non_wakeup_gpes(); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - PM1Acontrol = (u16) acpi_hw_register_read (ACPI_MTX_LOCK, PM1_CONTROL); + /* Get current value of PM1A control */ + status = acpi_hw_register_read (ACPI_MTX_LOCK, ACPI_REGISTER_PM1_CONTROL, &PM1Acontrol); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Entering S%d\n", sleep_state)); - /* mask off SLP_EN and SLP_TYP fields */ + /* Clear SLP_EN and SLP_TYP fields */ - PM1Acontrol &= ~(SLP_TYPE_X_MASK | SLP_EN_MASK); + PM1Acontrol &= ~(sleep_type_reg_info->access_bit_mask | sleep_enable_reg_info->access_bit_mask); PM1Bcontrol = PM1Acontrol; - /* mask in SLP_TYP */ + /* Insert SLP_TYP bits */ - PM1Acontrol |= (type_a << acpi_hw_get_bit_shift (SLP_TYPE_X_MASK)); - PM1Bcontrol |= (type_b << acpi_hw_get_bit_shift (SLP_TYPE_X_MASK)); + PM1Acontrol |= (acpi_gbl_sleep_type_a << sleep_type_reg_info->bit_position); + PM1Bcontrol |= (acpi_gbl_sleep_type_b << sleep_type_reg_info->bit_position); - /* write #1: fill in SLP_TYP data */ + /* Write #1: fill in SLP_TYP data */ + + status = acpi_hw_register_write (ACPI_MTX_LOCK, ACPI_REGISTER_PM1A_CONTROL, PM1Acontrol); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - acpi_hw_register_write (ACPI_MTX_LOCK, PM1A_CONTROL, PM1Acontrol); - acpi_hw_register_write (ACPI_MTX_LOCK, PM1B_CONTROL, PM1Bcontrol); + status = acpi_hw_register_write (ACPI_MTX_LOCK, ACPI_REGISTER_PM1B_CONTROL, PM1Bcontrol); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - /* mask in SLP_EN */ + /* Insert SLP_ENABLE bit */ - PM1Acontrol |= (1 << acpi_hw_get_bit_shift (SLP_EN_MASK)); - PM1Bcontrol |= (1 << acpi_hw_get_bit_shift (SLP_EN_MASK)); + PM1Acontrol |= sleep_enable_reg_info->access_bit_mask; + PM1Bcontrol |= sleep_enable_reg_info->access_bit_mask; - /* flush caches */ + /* Write #2: SLP_TYP + SLP_EN */ - wbinvd(); + ACPI_FLUSH_CPU_CACHE (); - /* write #2: SLP_TYP + SLP_EN */ + status = acpi_hw_register_write (ACPI_MTX_LOCK, ACPI_REGISTER_PM1A_CONTROL, PM1Acontrol); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - acpi_hw_register_write (ACPI_MTX_LOCK, PM1A_CONTROL, PM1Acontrol); - acpi_hw_register_write (ACPI_MTX_LOCK, PM1B_CONTROL, PM1Bcontrol); + status = acpi_hw_register_write (ACPI_MTX_LOCK, ACPI_REGISTER_PM1B_CONTROL, PM1Bcontrol); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* * Wait a second, then try again. This is to get S4/5 to work on all machines. */ if (sleep_state > ACPI_STATE_S3) { - acpi_os_stall(1000000); - - acpi_hw_register_write (ACPI_MTX_LOCK, PM1_CONTROL, - (1 << acpi_hw_get_bit_shift (SLP_EN_MASK))); + /* + * We wait so long to allow chipsets that poll this reg very slowly to + * still read the right value. Ideally, this entire block would go + * away entirely. + */ + acpi_os_stall (10000000); + + status = acpi_hw_register_write (ACPI_MTX_LOCK, ACPI_REGISTER_PM1_CONTROL, + sleep_enable_reg_info->access_bit_mask); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } } - /* wait until we enter sleep state */ + /* Wait until we enter sleep state */ do { - acpi_os_stall(10000); - } - while (!acpi_hw_register_bit_access (ACPI_READ, ACPI_MTX_LOCK, WAK_STS)); + status = acpi_get_register (ACPI_BITREG_WAKE_STATUS, &in_value, ACPI_MTX_LOCK); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - acpi_hw_enable_non_wakeup_gpes(); + /* Spin until we wake */ - enable (); + } while (!in_value); return_ACPI_STATUS (AE_OK); } @@ -248,25 +330,45 @@ { acpi_object_list arg_list; acpi_object arg; + acpi_status status; + + + ACPI_FUNCTION_TRACE ("Acpi_leave_sleep_state"); - FUNCTION_TRACE ("Acpi_leave_sleep_state"); + /* Ensure Enter_sleep_state_prep -> Enter_sleep_state ordering */ + acpi_gbl_sleep_type_a = ACPI_SLEEP_TYPE_INVALID; + + /* Setup parameter object */ - MEMSET (&arg_list, 0, sizeof(arg_list)); arg_list.count = 1; arg_list.pointer = &arg; - MEMSET (&arg, 0, sizeof(arg)); arg.type = ACPI_TYPE_INTEGER; arg.integer.value = sleep_state; - acpi_evaluate_object (NULL, "\\_BFS", &arg_list, NULL); - acpi_evaluate_object (NULL, "\\_WAK", &arg_list, NULL); + /* Ignore any errors from these methods */ + + status = acpi_evaluate_object (NULL, "\\_BFS", &arg_list, NULL); + if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) { + ACPI_REPORT_ERROR (("Method _BFS failed, %s\n", acpi_format_exception (status))); + } + + status = acpi_evaluate_object (NULL, "\\_WAK", &arg_list, NULL); + if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) { + ACPI_REPORT_ERROR (("Method _WAK failed, %s\n", acpi_format_exception (status))); + } /* _WAK returns stuff - do we want to look at it? */ - acpi_hw_enable_non_wakeup_gpes(); + status = acpi_hw_enable_non_wakeup_gpes(); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + /* Disable BM arbitration */ + status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_LOCK); - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/hardware/hwtimer.c lia64-2.4/drivers/acpi/hardware/hwtimer.c --- linux-2.4.18/drivers/acpi/hardware/hwtimer.c Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/hardware/hwtimer.c Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Name: hwtimer.c - ACPI Power Management Timer Interface - * $Revision: 14 $ + * $Revision: 21 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,10 +25,9 @@ */ #include "acpi.h" -#include "achware.h" #define _COMPONENT ACPI_HARDWARE - MODULE_NAME ("hwtimer") + ACPI_MODULE_NAME ("hwtimer") /****************************************************************************** @@ -47,7 +46,7 @@ acpi_get_timer_resolution ( u32 *resolution) { - FUNCTION_TRACE ("Acpi_get_timer_resolution"); + ACPI_FUNCTION_TRACE ("Acpi_get_timer_resolution"); if (!resolution) { @@ -57,7 +56,6 @@ if (0 == acpi_gbl_FADT->tmr_val_ext) { *resolution = 24; } - else { *resolution = 32; } @@ -82,17 +80,19 @@ acpi_get_timer ( u32 *ticks) { - FUNCTION_TRACE ("Acpi_get_timer"); + acpi_status status; + + + ACPI_FUNCTION_TRACE ("Acpi_get_timer"); if (!ticks) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - acpi_os_read_port ((ACPI_IO_ADDRESS) - ACPI_GET_ADDRESS (acpi_gbl_FADT->Xpm_tmr_blk.address), ticks, 32); + status = acpi_hw_low_level_read (32, ticks, &acpi_gbl_FADT->Xpm_tmr_blk, 0); - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS (status); } @@ -129,13 +129,12 @@ u32 *time_elapsed) { u32 delta_ticks = 0; - u32 seconds = 0; - u32 milliseconds = 0; - u32 microseconds = 0; - u32 remainder = 0; + uint64_overlay normalized_ticks; + acpi_status status; + acpi_integer out_quotient; - FUNCTION_TRACE ("Acpi_get_timer_duration"); + ACPI_FUNCTION_TRACE ("Acpi_get_timer_duration"); if (!time_elapsed) { @@ -150,21 +149,18 @@ if (start_ticks < end_ticks) { delta_ticks = end_ticks - start_ticks; } - else if (start_ticks > end_ticks) { - /* 24-bit Timer */ - if (0 == acpi_gbl_FADT->tmr_val_ext) { + /* 24-bit Timer */ + delta_ticks = (((0x00FFFFFF - start_ticks) + end_ticks) & 0x00FFFFFF); } - - /* 32-bit Timer */ - else { + /* 32-bit Timer */ + delta_ticks = (0xFFFFFFFF - start_ticks) + end_ticks; } } - else { *time_elapsed = 0; return_ACPI_STATUS (AE_OK); @@ -173,49 +169,18 @@ /* * Compute Duration: * ----------------- - * Since certain compilers (gcc/Linux, argh!) don't support 64-bit - * divides in kernel-space we have to do some trickery to preserve - * accuracy while using 32-bit math. - * - * TBD: Change to use 64-bit math when supported. * - * The process is as follows: - * 1. Compute the number of seconds by dividing Delta Ticks by - * the timer frequency. - * 2. Compute the number of milliseconds in the remainder from step #1 - * by multiplying by 1000 and then dividing by the timer frequency. - * 3. Compute the number of microseconds in the remainder from step #2 - * by multiplying by 1000 and then dividing by the timer frequency. - * 4. Add the results from steps 1, 2, and 3 to get the total duration. + * Requires a 64-bit divide: * - * Example: The time elapsed for Delta_ticks = 0xFFFFFFFF should be - * 1199864031 microseconds. This is computed as follows: - * Step #1: Seconds = 1199; Remainder = 3092840 - * Step #2: Milliseconds = 864; Remainder = 113120 - * Step #3: Microseconds = 31; Remainder = + * Time_elapsed = (Delta_ticks * 1000000) / PM_TIMER_FREQUENCY; */ + normalized_ticks.full = ((u64) delta_ticks) * 1000000; - /* Step #1 */ - - seconds = delta_ticks / PM_TIMER_FREQUENCY; - remainder = delta_ticks % PM_TIMER_FREQUENCY; - - /* Step #2 */ - - milliseconds = (remainder * 1000) / PM_TIMER_FREQUENCY; - remainder = (remainder * 1000) % PM_TIMER_FREQUENCY; + status = acpi_ut_short_divide (&normalized_ticks.full, PM_TIMER_FREQUENCY, + &out_quotient, NULL); - /* Step #3 */ - - microseconds = (remainder * 1000) / PM_TIMER_FREQUENCY; - - /* Step #4 */ - - *time_elapsed = seconds * 1000000; - *time_elapsed += milliseconds * 1000; - *time_elapsed += microseconds; - - return_ACPI_STATUS (AE_OK); + *time_elapsed = (u32) out_quotient; + return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/include/acconfig.h lia64-2.4/drivers/acpi/include/acconfig.h --- linux-2.4.18/drivers/acpi/include/acconfig.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/acconfig.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acconfig.h - Global configuration constants - * $Revision: 74 $ + * $Revision: 102 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,12 +34,13 @@ *****************************************************************************/ /* - * ACPI_DEBUG - This switch enables all the debug facilities of the ACPI - * subsystem. This includes the DEBUG_PRINT output statements - * When disabled, all DEBUG_PRINT statements are compiled out. + * ACPI_DEBUG - This switch enables all the debug facilities of the + * ACPI subsystem. This includes the DEBUG_PRINT output + * statements. When disabled, all DEBUG_PRINT + * statements are compiled out. * * ACPI_APPLICATION - Use this switch if the subsystem is going to be run - * at the application level. + * at the application level. * */ @@ -53,43 +54,44 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20011018 +#define ACPI_CA_VERSION 0x20020517 /* Version of ACPI supported */ #define ACPI_CA_SUPPORT_LEVEL 2 - /* Maximum objects in the various object caches */ -#define MAX_STATE_CACHE_DEPTH 64 /* State objects for stacks */ +#define MAX_STATE_CACHE_DEPTH 64 /* State objects for stacks */ #define MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ #define MAX_EXTPARSE_CACHE_DEPTH 64 /* Parse tree objects */ #define MAX_OBJECT_CACHE_DEPTH 64 /* Interpreter operand objects */ -#define MAX_WALK_CACHE_DEPTH 4 /* Objects for parse tree walks (method execution) */ - +#define MAX_WALK_CACHE_DEPTH 4 /* Objects for parse tree walks */ /* String size constants */ #define MAX_STRING_LENGTH 512 -#define PATHNAME_MAX 256 /* A full namespace pathname */ - +#define PATHNAME_MAX 256 /* A full namespace pathname */ /* Maximum count for a semaphore object */ #define MAX_SEMAPHORE_COUNT 256 - /* Max reference count (for debug only) */ #define MAX_REFERENCE_COUNT 0x400 - /* Size of cached memory mapping for system memory operation region */ #define SYSMEM_REGION_WINDOW_SIZE 4096 +/****************************************************************************** + * + * Configuration of subsystem behavior + * + *****************************************************************************/ + /* * Debugger threading model * Use single threaded if the entire subsystem is contained in an application @@ -98,7 +100,6 @@ * By default the model is single threaded if ACPI_APPLICATION is set, * multi-threaded if ACPI_APPLICATION is not set. */ - #define DEBUGGER_SINGLE_THREADED 0 #define DEBUGGER_MULTI_THREADED 1 @@ -109,6 +110,12 @@ #define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED #endif +/* + * Should the subystem abort the loading of an ACPI table if the + * table checksum is incorrect? + */ +#define ACPI_CHECKSUM_ABORT FALSE + /****************************************************************************** * @@ -116,10 +123,13 @@ * *****************************************************************************/ +/* Number of distinct GPE register blocks */ + +#define ACPI_MAX_GPE_BLOCKS 2 + /* * Method info (in WALK_STATE), containing local variables and argumetns */ - #define MTH_NUM_LOCALS 8 #define MTH_MAX_LOCAL 7 @@ -133,17 +143,15 @@ /* * Operand Stack (in WALK_STATE), Must be large enough to contain MTH_MAX_ARG */ - #define OBJ_NUM_OPERANDS 8 #define OBJ_MAX_OPERAND 7 /* Names within the namespace are 4 bytes long */ #define ACPI_NAME_SIZE 4 -#define PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 s8 for separator */ +#define PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ #define PATH_SEPARATOR '.' - /* Constants used in searching for the RSDP in low memory */ #define LO_RSDP_WINDOW_BASE 0 /* Physical Address */ @@ -152,10 +160,32 @@ #define HI_RSDP_WINDOW_SIZE 0x20000 #define RSDP_SCAN_STEP 16 +/* Operation regions */ + +#define ACPI_NUM_PREDEFINED_REGIONS 8 +#define ACPI_USER_REGION_BEGIN 0x80 + /* Maximum Space_ids for Operation Regions */ #define ACPI_MAX_ADDRESS_SPACE 255 -#define ACPI_NUM_ADDRESS_SPACES 256 + +/* RSDP checksums */ + +#define ACPI_RSDP_CHECKSUM_LENGTH 20 +#define ACPI_RSDP_XCHECKSUM_LENGTH 36 + + +/****************************************************************************** + * + * ACPI AML Debugger + * + *****************************************************************************/ + + +#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */ + +#define ACPI_DEBUGGER_COMMAND_PROMPT '-' +#define ACPI_DEBUGGER_EXECUTE_PROMPT '%' #endif /* _ACCONFIG_H */ diff -urN linux-2.4.18/drivers/acpi/include/acdebug.h lia64-2.4/drivers/acpi/include/acdebug.h --- linux-2.4.18/drivers/acpi/include/acdebug.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/acdebug.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acdebug.h - ACPI/AML debugger - * $Revision: 50 $ + * $Revision: 61 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,61 +27,8 @@ #define __ACDEBUG_H__ -#define DB_MAX_ARGS 8 /* Must be max method args + 1 */ - -#define DB_COMMAND_PROMPT '-' -#define DB_EXECUTE_PROMPT '%' - - -extern int optind; -extern NATIVE_CHAR *optarg; -extern u8 *aml_start; -extern u32 aml_length; - -extern u8 acpi_gbl_db_opt_tables; -extern u8 acpi_gbl_db_opt_disasm; -extern u8 acpi_gbl_db_opt_stats; -extern u8 acpi_gbl_db_opt_parse_jit; -extern u8 acpi_gbl_db_opt_verbose; -extern u8 acpi_gbl_db_opt_ini_methods; - - -extern NATIVE_CHAR *acpi_gbl_db_args[DB_MAX_ARGS]; -extern NATIVE_CHAR acpi_gbl_db_line_buf[80]; -extern NATIVE_CHAR acpi_gbl_db_scope_buf[40]; -extern NATIVE_CHAR acpi_gbl_db_debug_filename[40]; -extern u8 acpi_gbl_db_output_to_file; -extern NATIVE_CHAR *acpi_gbl_db_buffer; -extern NATIVE_CHAR *acpi_gbl_db_filename; -extern NATIVE_CHAR *acpi_gbl_db_disasm_indent; -extern u8 acpi_gbl_db_output_flags; -extern u32 acpi_gbl_db_debug_level; -extern u32 acpi_gbl_db_console_debug_level; -extern acpi_table_header *acpi_gbl_db_table_ptr; - -/* - * Statistic globals - */ -extern u16 acpi_gbl_obj_type_count[INTERNAL_TYPE_NODE_MAX+1]; -extern u16 acpi_gbl_node_type_count[INTERNAL_TYPE_NODE_MAX+1]; -extern u16 acpi_gbl_obj_type_count_misc; -extern u16 acpi_gbl_node_type_count_misc; -extern u32 acpi_gbl_num_nodes; -extern u32 acpi_gbl_num_objects; - - -extern u32 acpi_gbl_size_of_parse_tree; -extern u32 acpi_gbl_size_of_method_trees; -extern u32 acpi_gbl_size_of_node_entries; -extern u32 acpi_gbl_size_of_acpi_objects; - - #define ACPI_DEBUG_BUFFER_SIZE 4196 -#define DB_REDIRECTABLE_OUTPUT 0x01 -#define DB_CONSOLE_OUTPUT 0x02 -#define DB_DUPLICATE_OUTPUT 0x03 - typedef struct command_info { @@ -116,7 +63,7 @@ * dbapi - external debugger interfaces */ -int +acpi_status acpi_db_initialize ( void); @@ -135,7 +82,6 @@ * dbcmds - debug commands and output routines */ - void acpi_db_display_table_info ( NATIVE_CHAR *table_arg); @@ -206,6 +152,38 @@ acpi_db_display_resources ( NATIVE_CHAR *object_arg); +void +acpi_db_check_integrity ( + void); + +acpi_status +acpi_db_integrity_walk ( + acpi_handle obj_handle, + u32 nesting_level, + void *context, + void **return_value); + +acpi_status +acpi_db_walk_and_match_name ( + acpi_handle obj_handle, + u32 nesting_level, + void *context, + void **return_value); + +acpi_status +acpi_db_walk_for_references ( + acpi_handle obj_handle, + u32 nesting_level, + void *context, + void **return_value); + +acpi_status +acpi_db_walk_for_specific_objects ( + acpi_handle obj_handle, + u32 nesting_level, + void *context, + void **return_value); + /* * dbdisasm - AML disassembler @@ -234,12 +212,20 @@ acpi_db_decode_internal_object ( acpi_operand_object *obj_desc); +u32 +acpi_db_block_type ( + acpi_parse_object *op); + +acpi_status +acpi_ps_display_object_pathname ( + acpi_walk_state *walk_state, + acpi_parse_object *op); + /* * dbdisply - debug display commands */ - void acpi_db_display_method_info ( acpi_parse_object *op); @@ -284,6 +270,14 @@ acpi_operand_object *obj_desc, acpi_walk_state *walk_state); +void +acpi_db_dump_parser_descriptor ( + acpi_parse_object *op); + +void * +acpi_db_get_pointer ( + void *target); + /* * dbexec - debugger control method execution @@ -301,16 +295,36 @@ NATIVE_CHAR *num_loops_arg, NATIVE_CHAR *method_name_arg); +acpi_status +acpi_db_execute_method ( + acpi_db_method_info *info, + acpi_buffer *return_obj); + +void +acpi_db_execute_setup ( + acpi_db_method_info *info); + +u32 +acpi_db_get_outstanding_allocations ( + void); + +void ACPI_SYSTEM_XFACE +acpi_db_method_thread ( + void *context); + /* * dbfileio - Debugger file I/O commands */ -acpi_object_type8 +acpi_object_type acpi_db_match_argument ( NATIVE_CHAR *user_argument, ARGUMENT_INFO *arguments); +acpi_status +ae_local_load_table ( + acpi_table_header *table_ptr); void acpi_db_close_debug_file ( @@ -324,6 +338,9 @@ acpi_db_load_acpi_table ( NATIVE_CHAR *filename); +acpi_status +acpi_db_get_acpi_table ( + NATIVE_CHAR *filename); /* * dbhistry - debugger HISTORY command @@ -351,7 +368,7 @@ acpi_walk_state *walk_state, acpi_parse_object *op); -void +void ACPI_SYSTEM_XFACE acpi_db_execute_thread ( void *context); @@ -360,6 +377,27 @@ NATIVE_CHAR prompt, acpi_parse_object *op); +void +acpi_db_display_help ( + NATIVE_CHAR *help_type); + +NATIVE_CHAR * +acpi_db_get_next_token ( + NATIVE_CHAR *string, + NATIVE_CHAR **next); + +u32 +acpi_db_get_line ( + NATIVE_CHAR *input_buffer); + +u32 +acpi_db_match_command ( + NATIVE_CHAR *user_command); + +void +acpi_db_single_thread ( + void); + /* * dbstats - Generation and display of ACPI table statistics @@ -374,6 +412,21 @@ acpi_status acpi_db_display_statistics ( NATIVE_CHAR *type_arg); + +acpi_status +acpi_db_classify_one_object ( + acpi_handle obj_handle, + u32 nesting_level, + void *context, + void **return_value); + +void +acpi_db_count_namespace_objects ( + void); + +void +acpi_db_enumerate_object ( + acpi_operand_object *obj_desc); /* diff -urN linux-2.4.18/drivers/acpi/include/acdispat.h lia64-2.4/drivers/acpi/include/acdispat.h --- linux-2.4.18/drivers/acpi/include/acdispat.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/acdispat.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acdispat.h - dispatcher (parser to interpreter interface) - * $Revision: 45 $ + * $Revision: 54 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,6 +58,13 @@ /* dsopcode - support for late evaluation */ acpi_status +acpi_ds_execute_arguments ( + acpi_namespace_node *node, + acpi_namespace_node *scope_node, + u32 aml_length, + u8 *aml_start); + +acpi_status acpi_ds_get_buffer_field_arguments ( acpi_operand_object *obj_desc); @@ -65,6 +72,43 @@ acpi_ds_get_region_arguments ( acpi_operand_object *rgn_desc); +acpi_status +acpi_ds_get_buffer_arguments ( + acpi_operand_object *obj_desc); + +acpi_status +acpi_ds_get_package_arguments ( + acpi_operand_object *obj_desc); + +acpi_status +acpi_ds_init_buffer_field ( + u16 aml_opcode, + acpi_operand_object *obj_desc, + acpi_operand_object *buffer_desc, + acpi_operand_object *offset_desc, + acpi_operand_object *length_desc, + acpi_operand_object *result_desc); + +acpi_status +acpi_ds_eval_buffer_field_operands ( + acpi_walk_state *walk_state, + acpi_parse_object *op); + +acpi_status +acpi_ds_eval_region_operands ( + acpi_walk_state *walk_state, + acpi_parse_object *op); + +acpi_status +acpi_ds_eval_data_object_operands ( + acpi_walk_state *walk_state, + acpi_parse_object *op, + acpi_operand_object *obj_desc); + +acpi_status +acpi_ds_initialize_region ( + acpi_handle obj_handle); + /* dsctrl - Parser/Interpreter interface, control stack routines */ @@ -86,7 +130,7 @@ acpi_status acpi_ds_get_predicate_value ( acpi_walk_state *walk_state, - u32 has_result_obj); + acpi_operand_object *result_obj); acpi_status acpi_ds_exec_begin_op ( @@ -101,6 +145,12 @@ /* dsfield - Parser/Interpreter interface for AML fields */ acpi_status +acpi_ds_get_field_names ( + ACPI_CREATE_FIELD_INFO *info, + acpi_walk_state *walk_state, + acpi_parse_object *arg); + +acpi_status acpi_ds_create_field ( acpi_parse_object *op, acpi_namespace_node *region_node, @@ -123,6 +173,11 @@ acpi_parse_object *op, acpi_walk_state *walk_state); +acpi_status +acpi_ds_init_field_objects ( + acpi_parse_object *op, + acpi_walk_state *walk_state); + /* dsload - Parser/Interpreter interface, namespace load callbacks */ @@ -167,7 +222,7 @@ acpi_walk_state *walk_state, acpi_operand_object ***node); -acpi_status +void acpi_ds_method_data_delete_all ( acpi_walk_state *walk_state); @@ -175,7 +230,7 @@ acpi_ds_is_method_value ( acpi_operand_object *obj_desc); -acpi_object_type8 +acpi_object_type acpi_ds_method_data_get_type ( u16 opcode, u32 index, @@ -188,7 +243,7 @@ acpi_walk_state *walk_state, acpi_operand_object **dest_desc); -acpi_status +void acpi_ds_method_data_delete_value ( u16 opcode, u32 index, @@ -200,18 +255,19 @@ u32 max_param_count, acpi_walk_state *walk_state); -acpi_namespace_node * +acpi_status acpi_ds_method_data_get_node ( u16 opcode, u32 index, - acpi_walk_state *walk_state); + acpi_walk_state *walk_state, + acpi_namespace_node **node); -acpi_status +void acpi_ds_method_data_init ( acpi_walk_state *walk_state); acpi_status -acpi_ds_method_data_set_entry ( +acpi_ds_method_data_set_value ( u16 opcode, u32 index, acpi_operand_object *object, @@ -226,7 +282,7 @@ acpi_status acpi_ds_call_control_method ( - acpi_walk_list *walk_list, + ACPI_THREAD_STATE *thread, acpi_walk_state *walk_state, acpi_parse_object *op); @@ -261,9 +317,17 @@ acpi_namespace_node *start_node); acpi_status +acpi_ds_build_internal_buffer_obj ( + acpi_walk_state *walk_state, + acpi_parse_object *op, + u32 buffer_length, + acpi_operand_object **obj_desc_ptr); + +acpi_status acpi_ds_build_internal_package_obj ( acpi_walk_state *walk_state, acpi_parse_object *op, + u32 package_length, acpi_operand_object **obj_desc); acpi_status @@ -286,23 +350,6 @@ acpi_parse_object *op); -/* dsregn - Parser/Interpreter interface - Op Region parsing */ - -acpi_status -acpi_ds_eval_buffer_field_operands ( - acpi_walk_state *walk_state, - acpi_parse_object *op); - -acpi_status -acpi_ds_eval_region_operands ( - acpi_walk_state *walk_state, - acpi_parse_object *op); - -acpi_status -acpi_ds_initialize_region ( - acpi_handle obj_handle); - - /* dsutils - Parser/Interpreter interface utility routines */ u8 @@ -331,15 +378,6 @@ acpi_ds_resolve_operands ( acpi_walk_state *walk_state); -acpi_object_type8 -acpi_ds_map_opcode_to_data_type ( - u16 opcode, - u32 *out_flags); - -acpi_object_type8 -acpi_ds_map_named_opcode_to_data_type ( - u16 opcode); - /* * dswscope - Scope Stack manipulation @@ -348,7 +386,7 @@ acpi_status acpi_ds_scope_stack_push ( acpi_namespace_node *node, - acpi_object_type8 type, + acpi_object_type type, acpi_walk_state *walk_state); @@ -368,7 +406,7 @@ acpi_owner_id owner_id, acpi_parse_object *origin, acpi_operand_object *mth_desc, - acpi_walk_list *walk_list); + ACPI_THREAD_STATE *thread); acpi_status acpi_ds_init_aml_walk ( @@ -396,12 +434,12 @@ acpi_walk_state * acpi_ds_pop_walk_state ( - acpi_walk_list *walk_list); + ACPI_THREAD_STATE *thread); void acpi_ds_push_walk_state ( acpi_walk_state *walk_state, - acpi_walk_list *walk_list); + ACPI_THREAD_STATE *thread); acpi_status acpi_ds_result_stack_pop ( @@ -417,7 +455,7 @@ acpi_walk_state * acpi_ds_get_current_walk_state ( - acpi_walk_list *walk_list); + ACPI_THREAD_STATE *thread); void acpi_ds_delete_walk_state_cache ( diff -urN linux-2.4.18/drivers/acpi/include/acevents.h lia64-2.4/drivers/acpi/include/acevents.h --- linux-2.4.18/drivers/acpi/include/acevents.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/acevents.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acevents.h - Event subcomponent prototypes and defines - * $Revision: 66 $ + * $Revision: 79 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,9 +31,13 @@ acpi_ev_initialize ( void); +acpi_status +acpi_ev_handler_initialize ( + void); + /* - * Acpi_evfixed - Fixed event handling + * Evfixed - Fixed event handling */ acpi_status @@ -46,18 +50,22 @@ u32 acpi_ev_fixed_event_dispatch ( - u32 acpi_event); + u32 event); /* - * Acpi_evglock - Global Lock support + * Evmisc */ +u8 +acpi_ev_is_notify_object ( + acpi_namespace_node *node); + acpi_status acpi_ev_acquire_global_lock( - void); + u32 timeout); -void +acpi_status acpi_ev_release_global_lock( void); @@ -65,9 +73,26 @@ acpi_ev_init_global_lock_handler ( void); +u32 +acpi_ev_get_gpe_register_index ( + u32 gpe_number); + +u32 +acpi_ev_get_gpe_number_index ( + u32 gpe_number); + +acpi_status +acpi_ev_queue_notify_request ( + acpi_namespace_node *node, + u32 notify_value); + +void ACPI_SYSTEM_XFACE +acpi_ev_notify_dispatch ( + void *context); + /* - * Acpi_evgpe - GPE handling and dispatch + * Evgpe - GPE handling and dispatch */ acpi_status @@ -86,26 +111,12 @@ acpi_ev_gpe_detect ( void); - /* - * Acpi_evnotify - Device Notify handling and dispatch + * Evregion - Address Space handling */ acpi_status -acpi_ev_queue_notify_request ( - acpi_namespace_node *node, - u32 notify_value); - -void -acpi_ev_notify_dispatch ( - void *context); - -/* - * Acpi_evregion - Address Space handling - */ - -acpi_status -acpi_ev_install_default_address_space_handlers ( +acpi_ev_init_address_spaces ( void); acpi_status @@ -114,8 +125,7 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value); - + void *value); acpi_status acpi_ev_addr_handler_helper ( @@ -124,21 +134,20 @@ void *context, void **return_value); -void -acpi_ev_disassociate_region_from_handler( - acpi_operand_object *region_obj, - u8 acpi_ns_is_locked); - - acpi_status -acpi_ev_associate_region_and_handler ( +acpi_ev_attach_region ( acpi_operand_object *handler_obj, acpi_operand_object *region_obj, u8 acpi_ns_is_locked); +void +acpi_ev_detach_region ( + acpi_operand_object *region_obj, + u8 acpi_ns_is_locked); + /* - * Acpi_evregini - Region initialization and setup + * Evregini - Region initialization and setup */ acpi_status @@ -204,10 +213,6 @@ u32 acpi_ev_initialize_sCI ( u32 program_sCI); - -void -acpi_ev_restore_acpi_state ( - void); void acpi_ev_terminate ( diff -urN linux-2.4.18/drivers/acpi/include/acexcep.h lia64-2.4/drivers/acpi/include/acexcep.h --- linux-2.4.18/drivers/acpi/include/acexcep.h Mon Sep 24 15:06:41 2001 +++ lia64-2.4/drivers/acpi/include/acexcep.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acexcep.h - Exception codes returned by the ACPI subsystem - * $Revision: 50 $ + * $Revision: 63 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,7 +54,7 @@ #define AE_NO_MEMORY (acpi_status) (0x0004 | AE_CODE_ENVIRONMENTAL) #define AE_NOT_FOUND (acpi_status) (0x0005 | AE_CODE_ENVIRONMENTAL) #define AE_NOT_EXIST (acpi_status) (0x0006 | AE_CODE_ENVIRONMENTAL) -#define AE_EXIST (acpi_status) (0x0007 | AE_CODE_ENVIRONMENTAL) +#define AE_ALREADY_EXISTS (acpi_status) (0x0007 | AE_CODE_ENVIRONMENTAL) #define AE_TYPE (acpi_status) (0x0008 | AE_CODE_ENVIRONMENTAL) #define AE_NULL_OBJECT (acpi_status) (0x0009 | AE_CODE_ENVIRONMENTAL) #define AE_NULL_ENTRY (acpi_status) (0x000A | AE_CODE_ENVIRONMENTAL) @@ -74,8 +74,9 @@ #define AE_ALREADY_ACQUIRED (acpi_status) (0x0018 | AE_CODE_ENVIRONMENTAL) #define AE_NO_HARDWARE_RESPONSE (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL) #define AE_NO_GLOBAL_LOCK (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL) +#define AE_LOGICAL_ADDRESS (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL) -#define AE_CODE_ENV_MAX 0x001A +#define AE_CODE_ENV_MAX 0x001B /* * Programmer exceptions @@ -85,8 +86,12 @@ #define AE_BAD_PATHNAME (acpi_status) (0x0003 | AE_CODE_PROGRAMMER) #define AE_BAD_DATA (acpi_status) (0x0004 | AE_CODE_PROGRAMMER) #define AE_BAD_ADDRESS (acpi_status) (0x0005 | AE_CODE_PROGRAMMER) +#define AE_ALIGNMENT (acpi_status) (0x0006 | AE_CODE_PROGRAMMER) +#define AE_BAD_HEX_CONSTANT (acpi_status) (0x0007 | AE_CODE_PROGRAMMER) +#define AE_BAD_OCTAL_CONSTANT (acpi_status) (0x0008 | AE_CODE_PROGRAMMER) +#define AE_BAD_DECIMAL_CONSTANT (acpi_status) (0x0009 | AE_CODE_PROGRAMMER) -#define AE_CODE_PGM_MAX 0x0005 +#define AE_CODE_PGM_MAX 0x0009 /* @@ -96,8 +101,10 @@ #define AE_BAD_HEADER (acpi_status) (0x0002 | AE_CODE_ACPI_TABLES) #define AE_BAD_CHECKSUM (acpi_status) (0x0003 | AE_CODE_ACPI_TABLES) #define AE_BAD_VALUE (acpi_status) (0x0004 | AE_CODE_ACPI_TABLES) +#define AE_TABLE_NOT_SUPPORTED (acpi_status) (0x0005 | AE_CODE_ACPI_TABLES) +#define AE_INVALID_TABLE_LENGTH (acpi_status) (0x0006 | AE_CODE_ACPI_TABLES) -#define AE_CODE_TBL_MAX 0x0003 +#define AE_CODE_TBL_MAX 0x0006 /* @@ -129,8 +136,14 @@ #define AE_AML_MUTEX_ORDER (acpi_status) (0x0017 | AE_CODE_AML) #define AE_AML_MUTEX_NOT_ACQUIRED (acpi_status) (0x0018 | AE_CODE_AML) #define AE_AML_INVALID_RESOURCE_TYPE (acpi_status) (0x0019 | AE_CODE_AML) +#define AE_AML_INVALID_INDEX (acpi_status) (0x001A | AE_CODE_AML) +#define AE_AML_REGISTER_LIMIT (acpi_status) (0x001B | AE_CODE_AML) +#define AE_AML_NO_WHILE (acpi_status) (0x001C | AE_CODE_AML) +#define AE_AML_ALIGNMENT (acpi_status) (0x001D | AE_CODE_AML) +#define AE_AML_NO_RESOURCE_END_TAG (acpi_status) (0x001E | AE_CODE_AML) +#define AE_AML_BAD_RESOURCE_VALUE (acpi_status) (0x001F | AE_CODE_AML) -#define AE_CODE_AML_MAX 0x0019 +#define AE_CODE_AML_MAX 0x001F /* * Internal exceptions used for control @@ -143,8 +156,10 @@ #define AE_CTRL_DEPTH (acpi_status) (0x0006 | AE_CODE_CONTROL) #define AE_CTRL_END (acpi_status) (0x0007 | AE_CODE_CONTROL) #define AE_CTRL_TRANSFER (acpi_status) (0x0008 | AE_CODE_CONTROL) +#define AE_CTRL_BREAK (acpi_status) (0x0009 | AE_CODE_CONTROL) +#define AE_CTRL_CONTINUE (acpi_status) (0x000A | AE_CODE_CONTROL) -#define AE_CODE_CTRL_MAX 0x0008 +#define AE_CODE_CTRL_MAX 0x000A #ifdef DEFINE_ACPI_GLOBALS @@ -162,7 +177,7 @@ "AE_NO_MEMORY", "AE_NOT_FOUND", "AE_NOT_EXIST", - "AE_EXIST", + "AE_ALREADY_EXISTS", "AE_TYPE", "AE_NULL_OBJECT", "AE_NULL_ENTRY", @@ -182,6 +197,7 @@ "AE_ALREADY_ACQUIRED", "AE_NO_HARDWARE_RESPONSE", "AE_NO_GLOBAL_LOCK", + "AE_LOGICAL_ADDRESS" }; NATIVE_CHAR const *acpi_gbl_exception_names_pgm[] = @@ -191,6 +207,10 @@ "AE_BAD_PATHNAME", "AE_BAD_DATA", "AE_BAD_ADDRESS", + "AE_ALIGNMENT", + "AE_BAD_HEX_CONSTANT", + "AE_BAD_OCTAL_CONSTANT", + "AE_BAD_DECIMAL_CONSTANT" }; NATIVE_CHAR const *acpi_gbl_exception_names_tbl[] = @@ -199,6 +219,8 @@ "AE_BAD_HEADER", "AE_BAD_CHECKSUM", "AE_BAD_VALUE", + "AE_TABLE_NOT_SUPPORTED", + "AE_INVALID_TABLE_LENGTH" }; NATIVE_CHAR const *acpi_gbl_exception_names_aml[] = @@ -228,6 +250,12 @@ "AE_AML_MUTEX_ORDER", "AE_AML_MUTEX_NOT_ACQUIRED", "AE_AML_INVALID_RESOURCE_TYPE", + "AE_AML_INVALID_INDEX", + "AE_AML_REGISTER_LIMIT", + "AE_AML_NO_WHILE", + "AE_AML_ALIGNMENT", + "AE_AML_NO_RESOURCE_END_TAG", + "AE_AML_BAD_RESOURCE_VALUE" }; NATIVE_CHAR const *acpi_gbl_exception_names_ctrl[] = @@ -240,6 +268,8 @@ "AE_CTRL_DEPTH", "AE_CTRL_END", "AE_CTRL_TRANSFER", + "AE_CTRL_BREAK", + "AE_CTRL_CONTINUE" }; #endif /* ACPI GLOBALS */ diff -urN linux-2.4.18/drivers/acpi/include/acglobal.h lia64-2.4/drivers/acpi/include/acglobal.h --- linux-2.4.18/drivers/acpi/include/acglobal.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/acglobal.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acglobal.h - Declarations for global variables - * $Revision: 106 $ + * $Revision: 125 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,11 +71,21 @@ * of each in the system. Each global points to the actual table. * */ -ACPI_EXTERN RSDP_DESCRIPTOR *acpi_gbl_RSDP; -ACPI_EXTERN xsdt_descriptor *acpi_gbl_XSDT; -ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT; -ACPI_EXTERN acpi_table_header *acpi_gbl_DSDT; -ACPI_EXTERN acpi_common_facs *acpi_gbl_FACS; +ACPI_EXTERN u32 acpi_gbl_table_flags; +ACPI_EXTERN RSDP_DESCRIPTOR *acpi_gbl_RSDP; +ACPI_EXTERN xsdt_descriptor *acpi_gbl_XSDT; +ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT; +ACPI_EXTERN acpi_table_header *acpi_gbl_DSDT; +ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS; +ACPI_EXTERN acpi_common_facs acpi_gbl_common_fACS; + +/* + * Handle both ACPI 1.0 and ACPI 2.0 Integer widths + * If we are running a method that exists in a 32-bit ACPI table. + * Use only 32 bits of the Integer for conversion. + */ +ACPI_EXTERN u8 acpi_gbl_integer_bit_width; +ACPI_EXTERN u8 acpi_gbl_integer_byte_width; /* * Since there may be multiple SSDTs and PSDTS, a single pointer is not @@ -107,22 +117,19 @@ ACPI_EXTERN ACPI_MEMORY_LIST acpi_gbl_memory_lists[ACPI_NUM_MEM_LISTS]; ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER acpi_gbl_drv_notify; ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER acpi_gbl_sys_notify; -ACPI_EXTERN u8 *acpi_gbl_gpe0enable_register_save; -ACPI_EXTERN u8 *acpi_gbl_gpe1_enable_register_save; +ACPI_EXTERN ACPI_INIT_HANDLER acpi_gbl_init_handler; ACPI_EXTERN acpi_walk_state *acpi_gbl_breakpoint_walk; ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore; ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count; -ACPI_EXTERN u32 acpi_gbl_restore_acpi_chipset; ACPI_EXTERN u32 acpi_gbl_original_mode; -ACPI_EXTERN u32 acpi_gbl_edge_level_save; -ACPI_EXTERN u32 acpi_gbl_irq_enable_save; ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; ACPI_EXTERN u32 acpi_gbl_ps_find_count; ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; ACPI_EXTERN u16 acpi_gbl_next_table_owner_id; ACPI_EXTERN u16 acpi_gbl_next_method_owner_id; +ACPI_EXTERN u16 acpi_gbl_global_lock_handle; ACPI_EXTERN u8 acpi_gbl_debugger_configuration; ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; ACPI_EXTERN u8 acpi_gbl_step_to_next_call; @@ -130,10 +137,10 @@ ACPI_EXTERN u8 acpi_gbl_global_lock_present; extern u8 acpi_gbl_shutdown; -extern u32 acpi_gbl_system_flags; extern u32 acpi_gbl_startup_flags; extern const u8 acpi_gbl_decode_to8bit[8]; extern const NATIVE_CHAR *acpi_gbl_db_sleep_states[ACPI_NUM_SLEEP_STATES]; +extern const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; /***************************************************************************** @@ -150,14 +157,14 @@ ACPI_EXTERN acpi_namespace_node *acpi_gbl_root_node; extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES]; -extern const predefined_names acpi_gbl_pre_defined_names [NUM_PREDEFINED_NAMES]; +extern const acpi_predefined_names acpi_gbl_pre_defined_names [NUM_PREDEFINED_NAMES]; #ifdef ACPI_DEBUG ACPI_EXTERN u32 acpi_gbl_current_node_count; ACPI_EXTERN u32 acpi_gbl_current_node_size; ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count; -ACPI_EXTERN u32 acpi_gbl_entry_stack_pointer; -ACPI_EXTERN u32 acpi_gbl_lowest_stack_pointer; +ACPI_EXTERN ACPI_SIZE acpi_gbl_entry_stack_pointer; +ACPI_EXTERN ACPI_SIZE acpi_gbl_lowest_stack_pointer; ACPI_EXTERN u32 acpi_gbl_deepest_nesting; #endif @@ -168,11 +175,7 @@ ****************************************************************************/ -ACPI_EXTERN acpi_walk_list *acpi_gbl_current_walk_list; - -/* Address Space handlers */ - -ACPI_EXTERN acpi_adr_space_info acpi_gbl_address_spaces[ACPI_NUM_ADDRESS_SPACES]; +ACPI_EXTERN ACPI_THREAD_STATE *acpi_gbl_current_walk_list; /* Control method single step flag */ @@ -187,34 +190,41 @@ ACPI_EXTERN acpi_parse_object *acpi_gbl_parsed_namespace_root; +/***************************************************************************** + * + * Hardware globals + * + ****************************************************************************/ + +extern ACPI_BIT_REGISTER_INFO acpi_gbl_bit_register_info[ACPI_NUM_BITREG]; +ACPI_EXTERN u8 acpi_gbl_sleep_type_a; +ACPI_EXTERN u8 acpi_gbl_sleep_type_b; + /***************************************************************************** * - * Event globals + * Event and GPE globals * ****************************************************************************/ -ACPI_EXTERN acpi_fixed_event_info acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS]; +extern acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS]; +ACPI_EXTERN ACPI_FIXED_EVENT_HANDLER acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS]; + ACPI_EXTERN acpi_handle acpi_gbl_gpe_obj_handle; ACPI_EXTERN u32 acpi_gbl_gpe_register_count; -ACPI_EXTERN acpi_gpe_registers *acpi_gbl_gpe_registers; -ACPI_EXTERN acpi_gpe_level_info *acpi_gbl_gpe_info; +ACPI_EXTERN u32 acpi_gbl_gpe_number_max; +ACPI_EXTERN ACPI_GPE_REGISTER_INFO *acpi_gbl_gpe_register_info; +ACPI_EXTERN ACPI_GPE_NUMBER_INFO *acpi_gbl_gpe_number_info; +ACPI_EXTERN ACPI_GPE_BLOCK_INFO acpi_gbl_gpe_block_info[ACPI_MAX_GPE_BLOCKS]; /* - * Gpe validation and translation table - * Indexed by the GPE number, returns GPE_INVALID if the GPE is not supported. - * Otherwise, returns a valid index into the global GPE table. + * GPE translation table + * Indexed by the GPE number, returns a valid index into the global GPE tables. * * This table is needed because the GPE numbers supported by block 1 do not * have to be contiguous with the GPE numbers supported by block 0. */ -ACPI_EXTERN u8 acpi_gbl_gpe_valid [ACPI_NUM_GPE]; - -/* Acpi_event counter for debug only */ - -#ifdef ACPI_DEBUG -ACPI_EXTERN u32 acpi_gbl_event_count[ACPI_NUM_FIXED_EVENTS]; -#endif +ACPI_EXTERN ACPI_GPE_INDEX_INFO *acpi_gbl_gpe_number_to_index; /***************************************************************************** @@ -223,10 +233,56 @@ * ****************************************************************************/ + +ACPI_EXTERN u8 acpi_gbl_db_output_flags; + + #ifdef ENABLE_DEBUGGER -ACPI_EXTERN u8 acpi_gbl_method_executing; -ACPI_EXTERN u8 acpi_gbl_db_terminate_threads; -#endif + +extern u8 acpi_gbl_method_executing; +extern u8 acpi_gbl_db_terminate_threads; + +ACPI_EXTERN int optind; +ACPI_EXTERN NATIVE_CHAR *optarg; + +ACPI_EXTERN u8 acpi_gbl_db_opt_tables; +ACPI_EXTERN u8 acpi_gbl_db_opt_disasm; +ACPI_EXTERN u8 acpi_gbl_db_opt_stats; +ACPI_EXTERN u8 acpi_gbl_db_opt_verbose; +ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods; + + +ACPI_EXTERN NATIVE_CHAR *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]; +ACPI_EXTERN NATIVE_CHAR acpi_gbl_db_line_buf[80]; +ACPI_EXTERN NATIVE_CHAR acpi_gbl_db_parsed_buf[80]; +ACPI_EXTERN NATIVE_CHAR acpi_gbl_db_scope_buf[40]; +ACPI_EXTERN NATIVE_CHAR acpi_gbl_db_debug_filename[40]; +ACPI_EXTERN u8 acpi_gbl_db_output_to_file; +ACPI_EXTERN NATIVE_CHAR *acpi_gbl_db_buffer; +ACPI_EXTERN NATIVE_CHAR *acpi_gbl_db_filename; +ACPI_EXTERN NATIVE_CHAR *acpi_gbl_db_disasm_indent; +ACPI_EXTERN u32 acpi_gbl_db_debug_level; +ACPI_EXTERN u32 acpi_gbl_db_console_debug_level; +ACPI_EXTERN acpi_table_header *acpi_gbl_db_table_ptr; +ACPI_EXTERN acpi_namespace_node *acpi_gbl_db_scope_node; + +/* + * Statistic globals + */ +ACPI_EXTERN u16 acpi_gbl_obj_type_count[INTERNAL_TYPE_NODE_MAX+1]; +ACPI_EXTERN u16 acpi_gbl_node_type_count[INTERNAL_TYPE_NODE_MAX+1]; +ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc; +ACPI_EXTERN u16 acpi_gbl_node_type_count_misc; +ACPI_EXTERN u32 acpi_gbl_num_nodes; +ACPI_EXTERN u32 acpi_gbl_num_objects; + + +ACPI_EXTERN u32 acpi_gbl_size_of_parse_tree; +ACPI_EXTERN u32 acpi_gbl_size_of_method_trees; +ACPI_EXTERN u32 acpi_gbl_size_of_node_entries; +ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; + +#endif /* ENABLE_DEBUGGER */ #endif /* __ACGLOBAL_H__ */ diff -urN linux-2.4.18/drivers/acpi/include/achware.h lia64-2.4/drivers/acpi/include/achware.h --- linux-2.4.18/drivers/acpi/include/achware.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/achware.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: achware.h -- hardware specific interfaces - * $Revision: 56 $ + * $Revision: 60 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,50 +60,48 @@ /* Register I/O Prototypes */ +ACPI_BIT_REGISTER_INFO * +acpi_hw_get_bit_register_info ( + u32 register_id); -u32 -acpi_hw_register_bit_access ( - NATIVE_UINT read_write, - u8 use_lock, - u32 register_id, - ... /* DWORD Write Value */); - -u32 +acpi_status acpi_hw_register_read ( u8 use_lock, - u32 register_id); + u32 register_id, + u32 *return_value); -void +acpi_status acpi_hw_register_write ( u8 use_lock, u32 register_id, u32 value); -u32 +acpi_status acpi_hw_low_level_read ( u32 width, + u32 *value, acpi_generic_address *reg, u32 offset); -void +acpi_status acpi_hw_low_level_write ( u32 width, u32 value, acpi_generic_address *reg, u32 offset); -void +acpi_status acpi_hw_clear_acpi_status ( void); -u32 -acpi_hw_get_bit_shift ( - u32 mask); - /* GPE support */ -void +u8 +acpi_hw_get_gpe_bit_mask ( + u32 gpe_number); + +acpi_status acpi_hw_enable_gpe ( u32 gpe_number); @@ -111,7 +109,7 @@ acpi_hw_enable_gpe_for_wakeup ( u32 gpe_number); -void +acpi_status acpi_hw_disable_gpe ( u32 gpe_number); @@ -119,31 +117,22 @@ acpi_hw_disable_gpe_for_wakeup ( u32 gpe_number); -void +acpi_status acpi_hw_clear_gpe ( u32 gpe_number); -void +acpi_status acpi_hw_get_gpe_status ( u32 gpe_number, acpi_event_status *event_status); -void +acpi_status acpi_hw_disable_non_wakeup_gpes ( void); -void +acpi_status acpi_hw_enable_non_wakeup_gpes ( void); - - -/* Sleep Prototypes */ - -acpi_status -acpi_hw_obtain_sleep_type_register_data ( - u8 sleep_state, - u8 *slp_typ_a, - u8 *slp_typ_b); /* ACPI Timer prototypes */ diff -urN linux-2.4.18/drivers/acpi/include/acinterp.h lia64-2.4/drivers/acpi/include/acinterp.h --- linux-2.4.18/drivers/acpi/include/acinterp.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/acinterp.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acinterp.h - Interpreter subcomponent prototypes and defines - * $Revision: 116 $ + * $Revision: 137 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,24 +27,7 @@ #define __ACINTERP_H__ -#define WALK_OPERANDS &(walk_state->operands [walk_state->num_operands -1]) - - -/* Interpreter constants */ - -#define AML_END_OF_BLOCK -1 -#define PUSH_PKG_LENGTH 1 -#define DO_NOT_PUSH_PKG_LENGTH 0 - - -#define STACK_TOP 0 -#define STACK_BOTTOM (u32) -1 - -/* Constants for global "When_to_parse_methods" */ - -#define METHOD_PARSE_AT_INIT 0x0 -#define METHOD_PARSE_JUST_IN_TIME 0x1 -#define METHOD_DELETE_AT_COMPLETION 0x2 +#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1])) acpi_status @@ -53,9 +36,14 @@ acpi_operand_object **stack_ptr, acpi_walk_state *walk_state); +acpi_status +acpi_ex_check_object_type ( + acpi_object_type type_needed, + acpi_object_type this_type, + void *object); /* - * amxface - External interpreter interfaces + * exxface - External interpreter interfaces */ acpi_status @@ -70,7 +58,7 @@ /* - * amconvrt - object conversion + * exconvrt - object conversion */ acpi_status @@ -95,13 +83,19 @@ acpi_status acpi_ex_convert_to_target_type ( - acpi_object_type8 destination_type, - acpi_operand_object **obj_desc, + acpi_object_type destination_type, + acpi_operand_object *source_desc, + acpi_operand_object **result_desc, acpi_walk_state *walk_state); +u32 +acpi_ex_convert_to_ascii ( + acpi_integer integer, + u32 base, + u8 *string); /* - * amfield - ACPI AML (p-code) execution - field manipulation + * exfield - ACPI AML (p-code) execution - field manipulation */ acpi_status @@ -117,55 +111,53 @@ u32 buffer_length); acpi_status -acpi_ex_setup_field ( +acpi_ex_setup_region ( acpi_operand_object *obj_desc, - u32 field_byte_offset); + u32 field_datum_byte_offset); acpi_status -acpi_ex_read_field_datum ( +acpi_ex_access_region ( acpi_operand_object *obj_desc, - u32 field_byte_offset, - u32 *value); + u32 field_datum_byte_offset, + acpi_integer *value, + u32 read_write); -acpi_status -acpi_ex_common_access_field ( - u32 mode, +u8 +acpi_ex_register_overflow ( acpi_operand_object *obj_desc, - void *buffer, - u32 buffer_length); - + acpi_integer value); acpi_status -acpi_ex_access_index_field ( - u32 mode, +acpi_ex_field_datum_io ( acpi_operand_object *obj_desc, - void *buffer, - u32 buffer_length); + u32 field_datum_byte_offset, + acpi_integer *value, + u32 read_write); acpi_status -acpi_ex_access_bank_field ( - u32 mode, +acpi_ex_write_with_update_rule ( acpi_operand_object *obj_desc, - void *buffer, - u32 buffer_length); + acpi_integer mask, + acpi_integer field_value, + u32 field_datum_byte_offset); -acpi_status -acpi_ex_access_region_field ( - u32 mode, - acpi_operand_object *obj_desc, +void +acpi_ex_get_buffer_datum( + acpi_integer *datum, void *buffer, - u32 buffer_length); - + u32 byte_granularity, + u32 offset); -acpi_status -acpi_ex_access_buffer_field ( - u32 mode, - acpi_operand_object *obj_desc, +void +acpi_ex_set_buffer_datum ( + acpi_integer merged_datum, void *buffer, - u32 buffer_length); + u32 byte_granularity, + u32 offset); acpi_status acpi_ex_read_data_from_field ( + acpi_walk_state *walk_state, acpi_operand_object *obj_desc, acpi_operand_object **ret_buffer_desc); @@ -175,7 +167,7 @@ acpi_operand_object *obj_desc); /* - * ammisc - ACPI AML (p-code) execution - specific opcodes + * exmisc - ACPI AML (p-code) execution - specific opcodes */ acpi_status @@ -190,6 +182,12 @@ acpi_ex_opcode_6A_0T_1R ( acpi_walk_state *walk_state); +u8 +acpi_ex_do_match ( + u32 match_op, + acpi_integer package_value, + acpi_integer match_value); + acpi_status acpi_ex_get_object_reference ( acpi_operand_object *obj_desc, @@ -197,6 +195,13 @@ acpi_walk_state *walk_state); acpi_status +acpi_ex_concat_template ( + acpi_operand_object *obj_desc, + acpi_operand_object *obj_desc2, + acpi_operand_object **actual_return_desc, + acpi_walk_state *walk_state); + +acpi_status acpi_ex_do_concatenate ( acpi_operand_object *obj_desc, acpi_operand_object *obj_desc2, @@ -216,15 +221,6 @@ acpi_integer operand1); acpi_status -acpi_ex_load_op ( - acpi_operand_object *rgn_desc, - acpi_operand_object *ddb_handle); - -acpi_status -acpi_ex_unload_table ( - acpi_operand_object *ddb_handle); - -acpi_status acpi_ex_create_mutex ( acpi_walk_state *walk_state); @@ -263,7 +259,33 @@ /* - * ammutex - mutex support + * exconfig - dynamic table load/unload + */ + +acpi_status +acpi_ex_add_table ( + acpi_table_header *table, + acpi_namespace_node *parent_node, + acpi_operand_object **ddb_handle); + +acpi_status +acpi_ex_load_op ( + acpi_operand_object *obj_desc, + acpi_operand_object *target, + acpi_walk_state *walk_state); + +acpi_status +acpi_ex_load_table_op ( + acpi_walk_state *walk_state, + acpi_operand_object **return_desc); + +acpi_status +acpi_ex_unload_table ( + acpi_operand_object *ddb_handle); + + +/* + * exmutex - mutex support */ acpi_status @@ -277,59 +299,37 @@ acpi_operand_object *obj_desc, acpi_walk_state *walk_state); -acpi_status +void acpi_ex_release_all_mutexes ( - acpi_operand_object *mutex_list); + ACPI_THREAD_STATE *thread); void acpi_ex_unlink_mutex ( acpi_operand_object *obj_desc); +void +acpi_ex_link_mutex ( + acpi_operand_object *obj_desc, + ACPI_THREAD_STATE *thread); /* - * amprep - ACPI AML (p-code) execution - prep utilities + * exprep - ACPI AML (p-code) execution - prep utilities */ acpi_status acpi_ex_prep_common_field_object ( acpi_operand_object *obj_desc, u8 field_flags, - u32 field_position, - u32 field_length); - -acpi_status -acpi_ex_prep_region_field_value ( - acpi_namespace_node *node, - acpi_handle region, - u8 field_flags, - u32 field_position, - u32 field_length); - -acpi_status -acpi_ex_prep_bank_field_value ( - acpi_namespace_node *node, - acpi_namespace_node *region_node, - acpi_namespace_node *bank_register_node, - u32 bank_val, - u8 field_flags, - u32 field_position, - u32 field_length); - -acpi_status -acpi_ex_prep_index_field_value ( - acpi_namespace_node *node, - acpi_namespace_node *index_reg, - acpi_namespace_node *data_reg, - u8 field_flags, - u32 field_position, - u32 field_length); + u8 field_attribute, + u32 field_bit_position, + u32 field_bit_length); acpi_status acpi_ex_prep_field_value ( ACPI_CREATE_FIELD_INFO *info); /* - * amsystem - Interface to OS services + * exsystem - Interface to OS services */ acpi_status @@ -337,11 +337,11 @@ acpi_operand_object *value, acpi_operand_object *obj_desc); -void +acpi_status acpi_ex_system_do_suspend( u32 time); -void +acpi_status acpi_ex_system_do_stall ( u32 time); @@ -374,7 +374,7 @@ /* - * ammonadic - ACPI AML (p-code) execution, monadic operators + * exmonadic - ACPI AML (p-code) execution, monadic operators */ acpi_status @@ -394,7 +394,7 @@ acpi_walk_state *walk_state); /* - * amdyadic - ACPI AML (p-code) execution, dyadic operators + * exdyadic - ACPI AML (p-code) execution, dyadic operators */ acpi_status @@ -415,7 +415,7 @@ /* - * amresolv - Object resolution and get value functions + * exresolv - Object resolution and get value functions */ acpi_status @@ -433,31 +433,19 @@ acpi_operand_object **stack_ptr, acpi_walk_state *walk_state); -acpi_status -acpi_ex_get_buffer_field_value ( - acpi_operand_object *field_desc, - acpi_operand_object *result_desc); - /* - * amdump - Scanner debug output routines + * exdump - Scanner debug output routines */ void -acpi_ex_show_hex_value ( - u32 byte_count, - u8 *aml_start, - u32 lead_space); - - -acpi_status acpi_ex_dump_operand ( acpi_operand_object *entry_desc); void acpi_ex_dump_operands ( acpi_operand_object **operands, - operating_mode interpreter_mode, + acpi_interpreter_mode interpreter_mode, NATIVE_CHAR *ident, u32 num_levels, NATIVE_CHAR *note, @@ -469,15 +457,34 @@ acpi_operand_object *object, u32 flags); - void acpi_ex_dump_node ( acpi_namespace_node *node, u32 flags); +void +acpi_ex_out_string ( + char *title, + char *value); + +void +acpi_ex_out_pointer ( + char *title, + void *value); + +void +acpi_ex_out_integer ( + char *title, + u32 value); + +void +acpi_ex_out_address ( + char *title, + ACPI_PHYSICAL_ADDRESS value); + /* - * amnames - interpreter/scanner name load/execute + * exnames - interpreter/scanner name load/execute */ NATIVE_CHAR * @@ -496,7 +503,7 @@ acpi_status acpi_ex_get_name_string ( - acpi_object_type8 data_type, + acpi_object_type data_type, u8 *in_aml_address, NATIVE_CHAR **out_name_string, u32 *out_name_length); @@ -504,11 +511,11 @@ acpi_status acpi_ex_do_name ( acpi_object_type data_type, - operating_mode load_exec_mode); + acpi_interpreter_mode load_exec_mode); /* - * amstore - Object store support + * exstore - Object store support */ acpi_status @@ -529,42 +536,36 @@ acpi_namespace_node *node, acpi_walk_state *walk_state); -acpi_status -acpi_ex_store_object_to_object ( - acpi_operand_object *source_desc, - acpi_operand_object *dest_desc, - acpi_walk_state *walk_state); - /* - * + * exstoren */ acpi_status acpi_ex_resolve_object ( acpi_operand_object **source_desc_ptr, - acpi_object_type8 target_type, + acpi_object_type target_type, acpi_walk_state *walk_state); acpi_status -acpi_ex_store_object ( +acpi_ex_store_object_to_object ( acpi_operand_object *source_desc, - acpi_object_type8 target_type, - acpi_operand_object **target_desc_ptr, + acpi_operand_object *dest_desc, + acpi_operand_object **new_desc, acpi_walk_state *walk_state); /* - * amcopy - object copy + * excopy - object copy */ acpi_status -acpi_ex_copy_buffer_to_buffer ( +acpi_ex_store_buffer_to_buffer ( acpi_operand_object *source_desc, acpi_operand_object *target_desc); acpi_status -acpi_ex_copy_string_to_string ( +acpi_ex_store_string_to_string ( acpi_operand_object *source_desc, acpi_operand_object *target_desc); @@ -589,7 +590,7 @@ acpi_operand_object *target_desc); /* - * amutils - interpreter/scanner utilities + * exutils - interpreter/scanner utilities */ acpi_status @@ -613,7 +614,7 @@ acpi_ex_acquire_global_lock ( u32 rule); -acpi_status +void acpi_ex_release_global_lock ( u8 locked); @@ -622,19 +623,19 @@ acpi_integer value, u32 base); -acpi_status +void acpi_ex_eisa_id_to_string ( u32 numeric_id, NATIVE_CHAR *out_string); -acpi_status +void acpi_ex_unsigned_integer_to_string ( acpi_integer value, NATIVE_CHAR *out_string); /* - * amregion - default Op_region handlers + * exregion - default Op_region handlers */ acpi_status @@ -642,7 +643,7 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value, + acpi_integer *value, void *handler_context, void *region_context); @@ -651,7 +652,7 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value, + acpi_integer *value, void *handler_context, void *region_context); @@ -660,7 +661,7 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value, + acpi_integer *value, void *handler_context, void *region_context); @@ -669,7 +670,7 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value, + acpi_integer *value, void *handler_context, void *region_context); @@ -678,7 +679,7 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value, + acpi_integer *value, void *handler_context, void *region_context); @@ -687,7 +688,7 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value, + acpi_integer *value, void *handler_context, void *region_context); @@ -696,9 +697,18 @@ u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value, + acpi_integer *value, void *handler_context, void *region_context); + +acpi_status +acpi_ex_data_table_space_handler ( + u32 function, + ACPI_PHYSICAL_ADDRESS address, + u32 bit_width, + acpi_integer *value, + void *handler_context, + void *region_context); #endif /* __INTERP_H__ */ diff -urN linux-2.4.18/drivers/acpi/include/aclocal.h lia64-2.4/drivers/acpi/include/aclocal.h --- linux-2.4.18/drivers/acpi/include/aclocal.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/aclocal.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: aclocal.h - Internal data types used across the ACPI subsystem - * $Revision: 138 $ + * $Revision: 167 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,22 +37,9 @@ #define ACPI_LOGICAL_ADDRESSING 0x00 #define ACPI_PHYSICAL_ADDRESSING 0x01 -/* Object descriptor types */ +/* Total number of aml opcodes defined */ -#define ACPI_CACHED_OBJECT 0x11 /* ORed in when object is cached */ -#define ACPI_DESC_TYPE_STATE 0x20 -#define ACPI_DESC_TYPE_STATE_UPDATE 0x21 -#define ACPI_DESC_TYPE_STATE_PACKAGE 0x22 -#define ACPI_DESC_TYPE_STATE_CONTROL 0x23 -#define ACPI_DESC_TYPE_STATE_RPSCOPE 0x24 -#define ACPI_DESC_TYPE_STATE_PSCOPE 0x25 -#define ACPI_DESC_TYPE_STATE_WSCOPE 0x26 -#define ACPI_DESC_TYPE_STATE_RESULT 0x27 -#define ACPI_DESC_TYPE_STATE_NOTIFY 0x28 -#define ACPI_DESC_TYPE_WALK 0x44 -#define ACPI_DESC_TYPE_PARSER 0x66 -#define ACPI_DESC_TYPE_INTERNAL 0x88 -#define ACPI_DESC_TYPE_NAMED 0xAA +#define AML_NUM_OPCODES 0x7E /***************************************************************************** @@ -138,10 +125,10 @@ typedef u16 acpi_owner_id; -#define OWNER_TYPE_TABLE 0x0 -#define OWNER_TYPE_METHOD 0x1 -#define FIRST_METHOD_ID 0x0000 -#define FIRST_TABLE_ID 0x8000 +#define ACPI_OWNER_TYPE_TABLE 0x0 +#define ACPI_OWNER_TYPE_METHOD 0x1 +#define ACPI_FIRST_METHOD_ID 0x0000 +#define ACPI_FIRST_TABLE_ID 0x8000 /* TBD: [Restructure] get rid of the need for this! */ @@ -166,11 +153,11 @@ typedef enum { - IMODE_LOAD_PASS1 = 0x01, - IMODE_LOAD_PASS2 = 0x02, - IMODE_EXECUTE = 0x0E + ACPI_IMODE_LOAD_PASS1 = 0x01, + ACPI_IMODE_LOAD_PASS2 = 0x02, + ACPI_IMODE_EXECUTE = 0x0E -} operating_mode; +} acpi_interpreter_mode; /* @@ -181,12 +168,18 @@ * be the first byte in this structure. */ +typedef union acpi_name_union +{ + u32 integer; + char ascii[4]; +} ACPI_NAME_UNION; + typedef struct acpi_node { - u8 data_type; + u8 descriptor; /* Used to differentiate object descriptor types */ u8 type; /* Type associated with this name */ u16 owner_id; - u32 name; /* ACPI Name, always 4 chars per ACPI spec */ + ACPI_NAME_UNION name; /* ACPI Name, always 4 chars per ACPI spec */ union acpi_operand_obj *object; /* Pointer to attached ACPI object (optional) */ @@ -198,12 +191,12 @@ } acpi_namespace_node; -#define ENTRY_NOT_FOUND NULL +#define ACPI_ENTRY_NOT_FOUND NULL /* Node flags */ -#define ANOBJ_AML_ATTACHMENT 0x01 +#define ANOBJ_RESERVED 0x01 #define ANOBJ_END_OF_PEER_LIST 0x02 #define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */ #define ANOBJ_METHOD_ARG 0x08 @@ -227,7 +220,7 @@ u8 *aml_start; u64 physical_address; u32 aml_length; - u32 length; + ACPI_SIZE length; u32 count; acpi_owner_id table_id; u8 type; @@ -243,13 +236,13 @@ acpi_handle *list; u32 *count; -} find_context; +} acpi_find_context; typedef struct { acpi_namespace_node *node; -} ns_search_data; +} acpi_ns_search_data; /* @@ -258,10 +251,10 @@ typedef struct { NATIVE_CHAR *name; - acpi_object_type8 type; + u8 type; NATIVE_CHAR *val; -} predefined_names; +} acpi_predefined_names; /* Object types used during package copies */ @@ -297,20 +290,11 @@ u32 field_bit_position; u32 field_bit_length; u8 field_flags; + u8 attribute; u8 field_type; } ACPI_CREATE_FIELD_INFO; -/* - * Field flags: Bits 00 - 03 : Access_type (Any_acc, Byte_acc, etc.) - * 04 : Lock_rule (1 == Lock) - * 05 - 06 : Update_rule - */ - -#define FIELD_ACCESS_TYPE_MASK 0x0F -#define FIELD_LOCK_RULE_MASK 0x10 -#define FIELD_UPDATE_RULE_MASK 0x60 - /***************************************************************************** * @@ -318,49 +302,29 @@ * ****************************************************************************/ - -/* Status bits. */ - -#define ACPI_STATUS_PMTIMER 0x0001 -#define ACPI_STATUS_BUSMASTER 0x0010 -#define ACPI_STATUS_GLOBAL 0x0020 -#define ACPI_STATUS_POWER_BUTTON 0x0100 -#define ACPI_STATUS_SLEEP_BUTTON 0x0200 -#define ACPI_STATUS_RTC_ALARM 0x0400 - -/* Enable bits. */ - -#define ACPI_ENABLE_PMTIMER 0x0001 -#define ACPI_ENABLE_GLOBAL 0x0020 -#define ACPI_ENABLE_POWER_BUTTON 0x0100 -#define ACPI_ENABLE_SLEEP_BUTTON 0x0200 -#define ACPI_ENABLE_RTC_ALARM 0x0400 - - -/* - * Entry in the Address_space (AKA Operation Region) table - */ +/* Information about each GPE register block */ typedef struct { - acpi_adr_space_handler handler; - void *context; + u8 address_space_id; + acpi_generic_address *block_address; + u16 register_count; + u8 block_base_number; -} acpi_adr_space_info; +} ACPI_GPE_BLOCK_INFO; - -/* Values and addresses of the GPE registers (both banks) */ +/* Information about a particular GPE register pair */ typedef struct { - u16 status_addr; /* Address of status reg */ - u16 enable_addr; /* Address of enable reg */ + acpi_generic_address status_address; /* Address of status reg */ + acpi_generic_address enable_address; /* Address of enable reg */ u8 status; /* Current value of status reg */ u8 enable; /* Current value of enable reg */ u8 wake_enable; /* Mask of bits to keep enabled when sleeping */ - u8 gpe_base; /* Base GPE number */ + u8 base_gpe_number; /* Base GPE number for this register */ -} acpi_gpe_registers; +} ACPI_GPE_REGISTER_INFO; #define ACPI_GPE_LEVEL_TRIGGERED 1 @@ -371,15 +335,22 @@ typedef struct { - u8 type; /* Level or Edge */ - acpi_handle method_handle; /* Method handle for direct (fast) execution */ acpi_gpe_handler handler; /* Address of handler, if any */ void *context; /* Context to be passed to handler */ + u8 type; /* Level or Edge */ + u8 bit_mask; + -} acpi_gpe_level_info; +} ACPI_GPE_NUMBER_INFO; +typedef struct +{ + u8 number_index; + +} ACPI_GPE_INDEX_INFO; + /* Information about each particular fixed event */ typedef struct @@ -387,9 +358,18 @@ acpi_event_handler handler; /* Address of handler. */ void *context; /* Context to be passed to handler */ -} acpi_fixed_event_info; +} ACPI_FIXED_EVENT_HANDLER; +typedef struct +{ + u8 status_register_id; + u8 enable_register_id; + u16 status_bit_mask; + u16 enable_bit_mask; + +} acpi_fixed_event_info; + /* Information used during field processing */ typedef struct @@ -408,27 +388,26 @@ ****************************************************************************/ -#define CONTROL_NORMAL 0xC0 -#define CONTROL_CONDITIONAL_EXECUTING 0xC1 -#define CONTROL_PREDICATE_EXECUTING 0xC2 -#define CONTROL_PREDICATE_FALSE 0xC3 -#define CONTROL_PREDICATE_TRUE 0xC4 +#define ACPI_CONTROL_NORMAL 0xC0 +#define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1 +#define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2 +#define ACPI_CONTROL_PREDICATE_FALSE 0xC3 +#define ACPI_CONTROL_PREDICATE_TRUE 0xC4 /* Forward declarations */ struct acpi_walk_state; -struct acpi_walk_list; -struct acpi_parse_obj; struct acpi_obj_mutex; +union acpi_parse_obj; #define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ u8 data_type; /* To differentiate various internal objs */\ - u8 flags; \ - u16 value; \ - u16 state; \ - u16 acpi_eval; \ - void *next; \ + u8 flags; \ + u16 value; \ + u16 state; \ + u16 reserved; \ + void *next; \ typedef struct acpi_common_state { @@ -470,8 +449,10 @@ typedef struct acpi_control_state { ACPI_STATE_COMMON - struct acpi_parse_obj *predicate_op; - u8 *aml_predicate_start; /* Start of if/while predicate */ + union acpi_parse_obj *predicate_op; + u8 *aml_predicate_start; /* Start of if/while predicate */ + u8 *package_end; /* End of if/while block */ + u16 opcode; } acpi_control_state; @@ -490,16 +471,31 @@ typedef struct acpi_pscope_state { ACPI_STATE_COMMON - struct acpi_parse_obj *op; /* current op being parsed */ - u8 *arg_end; /* current argument end */ - u8 *pkg_end; /* current package end */ - u32 arg_list; /* next argument to parse */ - u32 arg_count; /* Number of fixed arguments */ + union acpi_parse_obj *op; /* current op being parsed */ + u8 *arg_end; /* current argument end */ + u8 *pkg_end; /* current package end */ + u32 arg_list; /* next argument to parse */ + u32 arg_count; /* Number of fixed arguments */ } acpi_pscope_state; /* + * Thread state - one per thread across multiple walk states. Multiple walk + * states are created when there are nested control methods executing. + */ +typedef struct acpi_thread_state +{ + ACPI_STATE_COMMON + struct acpi_walk_state *walk_state_list; /* Head of list of Walk_states for this thread */ + union acpi_operand_obj *acquired_mutex_list; /* List of all currently acquired mutexes */ + u32 thread_id; /* Running thread ID */ + u16 current_sync_level; /* Mutex Sync (nested acquire) level */ + +} ACPI_THREAD_STATE; + + +/* * Result values - used to accumulate the results of nested * AML arguments */ @@ -516,7 +512,7 @@ typedef acpi_status (*acpi_parse_downwards) ( struct acpi_walk_state *walk_state, - struct acpi_parse_obj **out_op); + union acpi_parse_obj **out_op); typedef acpi_status (*acpi_parse_upwards) ( @@ -546,6 +542,7 @@ acpi_scope_state scope; acpi_pscope_state parse_scope; acpi_pkg_state pkg; + ACPI_THREAD_STATE thread; acpi_result_values results; acpi_notify_info notify; @@ -574,16 +571,16 @@ */ typedef struct acpi_opcode_info { +#ifdef _OPCODE_NAMES + NATIVE_CHAR *name; /* Opcode name (debug only) */ +#endif u32 parse_args; /* Grammar/Parse time arguments */ u32 runtime_args; /* Interpret time arguments */ - u16 flags; /* Misc flags */ + u32 flags; /* Misc flags */ + u8 object_type; /* Corresponding internal object type */ u8 class; /* Opcode class */ u8 type; /* Opcode type */ -#ifdef _OPCODE_NAMES - NATIVE_CHAR *name; /* op name (debug only) */ -#endif - } acpi_opcode_info; @@ -598,7 +595,7 @@ NATIVE_CHAR *string; /* NULL terminated string */ u8 *buffer; /* buffer or string */ NATIVE_CHAR *name; /* NULL terminated string */ - struct acpi_parse_obj *arg; /* arguments and contained ops */ + union acpi_parse_obj *arg; /* arguments and contained ops */ } acpi_parse_value; @@ -606,12 +603,12 @@ #define ACPI_PARSE_COMMON \ u8 data_type; /* To differentiate various internal objs */\ u8 flags; /* Type of Op */\ - u16 opcode; /* AML opcode */\ + u16 aml_opcode; /* AML opcode */\ u32 aml_offset; /* offset of declaration in AML */\ - struct acpi_parse_obj *parent; /* parent op */\ - struct acpi_parse_obj *next; /* next op */\ - DEBUG_ONLY_MEMBERS (\ - NATIVE_CHAR op_name[16]) /* op name (debug only) */\ + union acpi_parse_obj *parent; /* parent op */\ + union acpi_parse_obj *next; /* next op */\ + ACPI_DEBUG_ONLY_MEMBERS (\ + NATIVE_CHAR aml_op_name[16]) /* op name (debug only) */\ /* NON-DEBUG members below: */\ acpi_namespace_node *node; /* for use by interpreter */\ acpi_parse_value value; /* Value or args associated with the opcode */\ @@ -620,24 +617,68 @@ /* * generic operation (eg. If, While, Store) */ -typedef struct acpi_parse_obj +typedef struct acpi_parseobj_common { ACPI_PARSE_COMMON -} acpi_parse_object; +} ACPI_PARSE_OBJ_COMMON; /* * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and Op_regions), * and bytelists. */ -typedef struct acpi_parse2_obj +typedef struct acpi_parseobj_named { ACPI_PARSE_COMMON u8 *data; /* AML body or bytelist data */ u32 length; /* AML length */ u32 name; /* 4-byte name or zero if no name */ -} acpi_parse2_object; +} ACPI_PARSE_OBJ_NAMED; + + +/* The parse node is the fundamental element of the parse tree */ + +typedef struct acpi_parseobj_asl +{ + ACPI_PARSE_COMMON + + union acpi_parse_obj *child; + + + union acpi_parse_obj *parent_method; + char *filename; + char *external_name; + char *namepath; + u32 extra_value; + u32 column; + u32 line_number; + u32 logical_line_number; + u32 logical_byte_offset; + u32 end_line; + u32 end_logical_line; + u16 parse_opcode; + u32 acpi_btype; + u32 aml_length; + u32 aml_subtree_length; + u32 final_aml_length; + u32 final_aml_offset; + u8 aml_opcode_length; + u8 aml_pkg_len_bytes; + u16 compile_flags; + u8 extra; + char parse_op_name[12]; + +} ACPI_PARSE_OBJ_ASL; + + +typedef union acpi_parse_obj +{ + ACPI_PARSE_OBJ_COMMON common; + ACPI_PARSE_OBJ_NAMED named; + ACPI_PARSE_OBJ_ASL asl; + +} acpi_parse_object; /* @@ -652,153 +693,111 @@ u8 *aml_end; /* (last + 1) AML byte */ u8 *pkg_start; /* current package begin */ u8 *pkg_end; /* current package end */ - - struct acpi_parse_obj *start_op; /* root of parse tree */ + union acpi_parse_obj *start_op; /* root of parse tree */ struct acpi_node *start_node; union acpi_gen_state *scope; /* current scope */ + union acpi_parse_obj *start_scope; +} acpi_parse_state; - struct acpi_parse_obj *start_scope; +/* Parse object flags */ -} acpi_parse_state; +#define ACPI_PARSEOP_GENERIC 0x01 +#define ACPI_PARSEOP_NAMED 0x02 +#define ACPI_PARSEOP_DEFERRED 0x04 +#define ACPI_PARSEOP_BYTELIST 0x08 +#define ACPI_PARSEOP_IN_CACHE 0x80 /***************************************************************************** * - * Hardware and PNP + * Hardware (ACPI registers) and PNP * ****************************************************************************/ +#define PCI_ROOT_HID_STRING "PNP0A03" -/* PCI */ -#define PCI_ROOT_HID_STRING "PNP0A03" - -/* - * The #define's and enum below establish an abstract way of identifying what - * register block and register is to be accessed. Do not change any of the - * values as they are used in switch statements and offset calculations. - */ - -#define REGISTER_BLOCK_MASK 0xFF00 /* Register Block Id */ -#define BIT_IN_REGISTER_MASK 0x00FF /* Bit Id in the Register Block Id */ -#define BYTE_IN_REGISTER_MASK 0x00FF /* Register Offset in the Register Block */ - -#define REGISTER_BLOCK_ID(reg_id) (reg_id & REGISTER_BLOCK_MASK) -#define REGISTER_BIT_ID(reg_id) (reg_id & BIT_IN_REGISTER_MASK) -#define REGISTER_OFFSET(reg_id) (reg_id & BYTE_IN_REGISTER_MASK) - -/* - * Access Rule - * To access a Register Bit: - * -> Use Bit Name (= Register Block Id | Bit Id) defined in the enum. - * - * To access a Register: - * -> Use Register Id (= Register Block Id | Register Offset) - */ - - -/* - * Register Block Id - */ -#define PM1_STS 0x0100 -#define PM1_EN 0x0200 -#define PM1_CONTROL 0x0300 -#define PM1A_CONTROL 0x0400 -#define PM1B_CONTROL 0x0500 -#define PM2_CONTROL 0x0600 -#define PM_TIMER 0x0700 -#define PROCESSOR_BLOCK 0x0800 -#define GPE0_STS_BLOCK 0x0900 -#define GPE0_EN_BLOCK 0x0A00 -#define GPE1_STS_BLOCK 0x0B00 -#define GPE1_EN_BLOCK 0x0C00 -#define SMI_CMD_BLOCK 0x0D00 +typedef struct +{ + u8 parent_register; + u8 bit_position; + u16 access_bit_mask; -/* - * Address space bitmasks for mmio or io spaces - */ +} ACPI_BIT_REGISTER_INFO; -#define SMI_CMD_ADDRESS_SPACE 0x01 -#define PM1_BLK_ADDRESS_SPACE 0x02 -#define PM2_CNT_BLK_ADDRESS_SPACE 0x04 -#define PM_TMR_BLK_ADDRESS_SPACE 0x08 -#define GPE0_BLK_ADDRESS_SPACE 0x10 -#define GPE1_BLK_ADDRESS_SPACE 0x20 /* - * Control bit definitions + * Register IDs + * These are the full ACPI registers */ -#define TMR_STS (PM1_STS | 0x01) -#define BM_STS (PM1_STS | 0x02) -#define GBL_STS (PM1_STS | 0x03) -#define PWRBTN_STS (PM1_STS | 0x04) -#define SLPBTN_STS (PM1_STS | 0x05) -#define RTC_STS (PM1_STS | 0x06) -#define WAK_STS (PM1_STS | 0x07) - -#define TMR_EN (PM1_EN | 0x01) - /* no BM_EN */ -#define GBL_EN (PM1_EN | 0x03) -#define PWRBTN_EN (PM1_EN | 0x04) -#define SLPBTN_EN (PM1_EN | 0x05) -#define RTC_EN (PM1_EN | 0x06) -#define WAK_EN (PM1_EN | 0x07) - -#define SCI_EN (PM1_CONTROL | 0x01) -#define BM_RLD (PM1_CONTROL | 0x02) -#define GBL_RLS (PM1_CONTROL | 0x03) -#define SLP_TYPE_A (PM1_CONTROL | 0x04) -#define SLP_TYPE_B (PM1_CONTROL | 0x05) -#define SLP_EN (PM1_CONTROL | 0x06) - -#define ARB_DIS (PM2_CONTROL | 0x01) +#define ACPI_REGISTER_PM1_STATUS 0x01 +#define ACPI_REGISTER_PM1_ENABLE 0x02 +#define ACPI_REGISTER_PM1_CONTROL 0x03 +#define ACPI_REGISTER_PM1A_CONTROL 0x04 +#define ACPI_REGISTER_PM1B_CONTROL 0x05 +#define ACPI_REGISTER_PM2_CONTROL 0x06 +#define ACPI_REGISTER_PM_TIMER 0x07 +#define ACPI_REGISTER_PROCESSOR_BLOCK 0x08 +#define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x09 -#define TMR_VAL (PM_TIMER | 0x01) -#define GPE0_STS (GPE0_STS_BLOCK | 0x01) -#define GPE0_EN (GPE0_EN_BLOCK | 0x01) +/* Masks used to access the Bit_registers */ -#define GPE1_STS (GPE1_STS_BLOCK | 0x01) -#define GPE1_EN (GPE1_EN_BLOCK | 0x01) +#define ACPI_BITMASK_TIMER_STATUS 0x0001 +#define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010 +#define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020 +#define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100 +#define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200 +#define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400 +#define ACPI_BITMASK_WAKE_STATUS 0x8000 +#define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \ + ACPI_BITMASK_BUS_MASTER_STATUS | \ + ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ + ACPI_BITMASK_POWER_BUTTON_STATUS | \ + ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ + ACPI_BITMASK_RT_CLOCK_STATUS | \ + ACPI_BITMASK_WAKE_STATUS) -#define TMR_STS_MASK 0x0001 -#define BM_STS_MASK 0x0010 -#define GBL_STS_MASK 0x0020 -#define PWRBTN_STS_MASK 0x0100 -#define SLPBTN_STS_MASK 0x0200 -#define RTC_STS_MASK 0x0400 -#define WAK_STS_MASK 0x8000 +#define ACPI_BITMASK_TIMER_ENABLE 0x0001 +#define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 +#define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100 +#define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200 +#define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400 -#define ALL_FIXED_STS_BITS (TMR_STS_MASK | BM_STS_MASK | GBL_STS_MASK \ - | PWRBTN_STS_MASK | SLPBTN_STS_MASK \ - | RTC_STS_MASK | WAK_STS_MASK) +#define ACPI_BITMASK_SCI_ENABLE 0x0001 +#define ACPI_BITMASK_BUS_MASTER_RLD 0x0002 +#define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004 +#define ACPI_BITMASK_SLEEP_TYPE_X 0x1C00 +#define ACPI_BITMASK_SLEEP_ENABLE 0x2000 -#define TMR_EN_MASK 0x0001 -#define GBL_EN_MASK 0x0020 -#define PWRBTN_EN_MASK 0x0100 -#define SLPBTN_EN_MASK 0x0200 -#define RTC_EN_MASK 0x0400 +#define ACPI_BITMASK_ARB_DISABLE 0x0001 -#define SCI_EN_MASK 0x0001 -#define BM_RLD_MASK 0x0002 -#define GBL_RLS_MASK 0x0004 -#define SLP_TYPE_X_MASK 0x1C00 -#define SLP_EN_MASK 0x2000 -#define ARB_DIS_MASK 0x0001 -#define TMR_VAL_MASK 0xFFFFFFFF +/* Raw bit position of each Bit_register */ -#define GPE0_STS_MASK -#define GPE0_EN_MASK +#define ACPI_BITPOSITION_TIMER_STATUS 0x00 +#define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04 +#define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05 +#define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08 +#define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09 +#define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A +#define ACPI_BITPOSITION_WAKE_STATUS 0x0F -#define GPE1_STS_MASK -#define GPE1_EN_MASK +#define ACPI_BITPOSITION_TIMER_ENABLE 0x00 +#define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05 +#define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08 +#define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09 +#define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A +#define ACPI_BITPOSITION_SCI_ENABLE 0x00 +#define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01 +#define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02 +#define ACPI_BITPOSITION_SLEEP_TYPE_X 0x0A +#define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D -#define ACPI_READ 1 -#define ACPI_WRITE 2 +#define ACPI_BITPOSITION_ARB_DISABLE 0x00 /***************************************************************************** @@ -810,45 +809,45 @@ /* Resource_type values */ -#define RESOURCE_TYPE_MEMORY_RANGE 0 -#define RESOURCE_TYPE_IO_RANGE 1 -#define RESOURCE_TYPE_BUS_NUMBER_RANGE 2 +#define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0 +#define ACPI_RESOURCE_TYPE_IO_RANGE 1 +#define ACPI_RESOURCE_TYPE_BUS_NUMBER_RANGE 2 /* Resource descriptor types and masks */ -#define RESOURCE_DESC_TYPE_LARGE 0x80 -#define RESOURCE_DESC_TYPE_SMALL 0x00 +#define ACPI_RDESC_TYPE_LARGE 0x80 +#define ACPI_RDESC_TYPE_SMALL 0x00 -#define RESOURCE_DESC_TYPE_MASK 0x80 -#define RESOURCE_DESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */ +#define ACPI_RDESC_TYPE_MASK 0x80 +#define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */ /* * Small resource descriptor types * Note: The 3 length bits (2:0) must be zero */ -#define RESOURCE_DESC_IRQ_FORMAT 0x20 -#define RESOURCE_DESC_DMA_FORMAT 0x28 -#define RESOURCE_DESC_START_DEPENDENT 0x30 -#define RESOURCE_DESC_END_DEPENDENT 0x38 -#define RESOURCE_DESC_IO_PORT 0x40 -#define RESOURCE_DESC_FIXED_IO_PORT 0x48 -#define RESOURCE_DESC_SMALL_VENDOR 0x70 -#define RESOURCE_DESC_END_TAG 0x78 +#define ACPI_RDESC_TYPE_IRQ_FORMAT 0x20 +#define ACPI_RDESC_TYPE_DMA_FORMAT 0x28 +#define ACPI_RDESC_TYPE_START_DEPENDENT 0x30 +#define ACPI_RDESC_TYPE_END_DEPENDENT 0x38 +#define ACPI_RDESC_TYPE_IO_PORT 0x40 +#define ACPI_RDESC_TYPE_FIXED_IO_PORT 0x48 +#define ACPI_RDESC_TYPE_SMALL_VENDOR 0x70 +#define ACPI_RDESC_TYPE_END_TAG 0x78 /* * Large resource descriptor types */ -#define RESOURCE_DESC_MEMORY_24 0x81 -#define RESOURCE_DESC_GENERAL_REGISTER 0x82 -#define RESOURCE_DESC_LARGE_VENDOR 0x84 -#define RESOURCE_DESC_MEMORY_32 0x85 -#define RESOURCE_DESC_FIXED_MEMORY_32 0x86 -#define RESOURCE_DESC_DWORD_ADDRESS_SPACE 0x87 -#define RESOURCE_DESC_WORD_ADDRESS_SPACE 0x88 -#define RESOURCE_DESC_EXTENDED_XRUPT 0x89 -#define RESOURCE_DESC_QWORD_ADDRESS_SPACE 0x8A +#define ACPI_RDESC_TYPE_MEMORY_24 0x81 +#define ACPI_RDESC_TYPE_GENERAL_REGISTER 0x82 +#define ACPI_RDESC_TYPE_LARGE_VENDOR 0x84 +#define ACPI_RDESC_TYPE_MEMORY_32 0x85 +#define ACPI_RDESC_TYPE_FIXED_MEMORY_32 0x86 +#define ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE 0x87 +#define ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE 0x88 +#define ACPI_RDESC_TYPE_EXTENDED_XRUPT 0x89 +#define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A /* String version of device HIDs and UIDs */ @@ -868,7 +867,8 @@ * ****************************************************************************/ -#define ASCII_ZERO 0x30 +#define ACPI_ASCII_ZERO 0x30 + /***************************************************************************** * @@ -885,7 +885,12 @@ u32 num_loops; NATIVE_CHAR pathname[128]; -} db_method_info; +} acpi_db_method_info; + + +#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 +#define ACPI_DB_CONSOLE_OUTPUT 0x02 +#define ACPI_DB_DUPLICATE_OUTPUT 0x03 /***************************************************************************** @@ -905,10 +910,9 @@ /* Entry for a memory allocation (debug only) */ - -#define MEM_MALLOC 0 -#define MEM_CALLOC 1 -#define MAX_MODULE_NAME 16 +#define ACPI_MEM_MALLOC 0 +#define ACPI_MEM_CALLOC 1 +#define ACPI_MAX_MODULE_NAME 16 #define ACPI_COMMON_DEBUG_MEM_HEADER \ struct acpi_debug_mem_block *previous; \ @@ -916,9 +920,8 @@ u32 size; \ u32 component; \ u32 line; \ - NATIVE_CHAR module[MAX_MODULE_NAME]; \ + NATIVE_CHAR module[ACPI_MAX_MODULE_NAME]; \ u8 alloc_type; - typedef struct { diff -urN linux-2.4.18/drivers/acpi/include/acmacros.h lia64-2.4/drivers/acpi/include/acmacros.h --- linux-2.4.18/drivers/acpi/include/acmacros.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/acmacros.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acmacros.h - C macros for the entire subsystem. - * $Revision: 97 $ + * $Revision: 123 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,54 +31,23 @@ * Data manipulation macros */ -#ifndef LOWORD -#define LOWORD(l) ((u16)(NATIVE_UINT)(l)) -#endif - -#ifndef HIWORD -#define HIWORD(l) ((u16)((((NATIVE_UINT)(l)) >> 16) & 0xFFFF)) -#endif - -#ifndef LOBYTE -#define LOBYTE(l) ((u8)(u16)(l)) -#endif +#define ACPI_LOWORD(l) ((u16)(u32)(l)) +#define ACPI_HIWORD(l) ((u16)((((u32)(l)) >> 16) & 0xFFFF)) +#define ACPI_LOBYTE(l) ((u8)(u16)(l)) +#define ACPI_HIBYTE(l) ((u8)((((u16)(l)) >> 8) & 0xFF)) -#ifndef HIBYTE -#define HIBYTE(l) ((u8)((((u16)(l)) >> 8) & 0xFF)) -#endif - -#define BIT0(x) ((((x) & 0x01) > 0) ? 1 : 0) -#define BIT1(x) ((((x) & 0x02) > 0) ? 1 : 0) -#define BIT2(x) ((((x) & 0x04) > 0) ? 1 : 0) - -#define BIT3(x) ((((x) & 0x08) > 0) ? 1 : 0) -#define BIT4(x) ((((x) & 0x10) > 0) ? 1 : 0) -#define BIT5(x) ((((x) & 0x20) > 0) ? 1 : 0) -#define BIT6(x) ((((x) & 0x40) > 0) ? 1 : 0) -#define BIT7(x) ((((x) & 0x80) > 0) ? 1 : 0) -#define LOW_BASE(w) ((u16) ((w) & 0x0000FFFF)) -#define MID_BASE(b) ((u8) (((b) & 0x00FF0000) >> 16)) -#define HI_BASE(b) ((u8) (((b) & 0xFF000000) >> 24)) -#define LOW_LIMIT(w) ((u16) ((w) & 0x0000FFFF)) -#define HI_LIMIT(b) ((u8) (((b) & 0x00FF0000) >> 16)) +#if ACPI_MACHINE_WIDTH == 16 - -#ifdef _IA16 /* * For 16-bit addresses, we have to assume that the upper 32 bits * are zero. */ -#ifndef LODWORD -#define LODWORD(l) (l) -#endif - -#ifndef HIDWORD -#define HIDWORD(l) (0) -#endif +#define ACPI_LODWORD(l) ((u32)(l)) +#define ACPI_HIDWORD(l) ((u32)(0)) #define ACPI_GET_ADDRESS(a) ((a).lo) -#define ACPI_STORE_ADDRESS(a,b) {(a).hi=0;(a).lo=(b);} +#define ACPI_STORE_ADDRESS(a,b) {(a).hi=0;(a).lo=(u32)(b);} #define ACPI_VALID_ADDRESS(a) ((a).hi | (a).lo) #else @@ -86,13 +55,8 @@ /* * acpi_integer is 32-bits, no 64-bit support on this platform */ -#ifndef LODWORD -#define LODWORD(l) ((u32)(l)) -#endif - -#ifndef HIDWORD -#define HIDWORD(l) (0) -#endif +#define ACPI_LODWORD(l) ((u32)(l)) +#define ACPI_HIDWORD(l) ((u32)(0)) #define ACPI_GET_ADDRESS(a) (a) #define ACPI_STORE_ADDRESS(a,b) ((a)=(b)) @@ -103,16 +67,11 @@ /* * Full 64-bit address/integer on both 32-bit and 64-bit platforms */ -#ifndef LODWORD -#define LODWORD(l) ((u32)(u64)(l)) -#endif - -#ifndef HIDWORD -#define HIDWORD(l) ((u32)(((*(uint64_struct *)(&l))).hi)) -#endif +#define ACPI_LODWORD(l) ((u32)(u64)(l)) +#define ACPI_HIDWORD(l) ((u32)(((*(uint64_struct *)(void *)(&l))).hi)) #define ACPI_GET_ADDRESS(a) (a) -#define ACPI_STORE_ADDRESS(a,b) ((a)=(b)) +#define ACPI_STORE_ADDRESS(a,b) ((a)=(ACPI_PHYSICAL_ADDRESS)(b)) #define ACPI_VALID_ADDRESS(a) (a) #endif #endif @@ -121,13 +80,31 @@ * Extract a byte of data using a pointer. Any more than a byte and we * get into potential aligment issues -- see the STORE macros below */ -#define GET8(addr) (*(u8*)(addr)) +#define ACPI_GET8(addr) (*(u8*)(addr)) /* Pointer arithmetic */ +#define ACPI_PTR_ADD(t,a,b) (t *) (void *)((char *)(a) + (NATIVE_UINT)(b)) +#define ACPI_PTR_DIFF(a,b) (NATIVE_UINT) ((char *)(a) - (char *)(b)) -#define POINTER_ADD(t,a,b) (t *) ((NATIVE_UINT)(a) + (NATIVE_UINT)(b)) -#define POINTER_DIFF(a,b) ((u32) ((NATIVE_UINT)(a) - (NATIVE_UINT)(b))) +/* Pointer/Integer type conversions */ + +#define ACPI_TO_POINTER(i) ACPI_PTR_ADD (void, (void *) NULL,(NATIVE_UINT)i) +#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) +#define ACPI_OFFSET(d,f) (ACPI_SIZE) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) +#define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f) + +#define ACPI_CAST_PTR(t, p) ((t *)(void *)(p)) +#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **)(void *)(p)) + +#if ACPI_MACHINE_WIDTH == 16 +#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_UNALIGNED32_TO_32(d,s) +#define ACPI_PHYSADDR_TO_PTR(i) (void *)(i) +#define ACPI_PTR_TO_PHYSADDR(i) (u32) (char *)(i) +#else +#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) +#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) +#endif /* * Macros for moving data around to/from buffers that are possibly unaligned. @@ -139,10 +116,10 @@ /* The hardware supports unaligned transfers, just do the move */ -#define MOVE_UNALIGNED16_TO_16(d,s) *(u16*)(d) = *(u16*)(s) -#define MOVE_UNALIGNED32_TO_32(d,s) *(u32*)(d) = *(u32*)(s) -#define MOVE_UNALIGNED16_TO_32(d,s) *(u32*)(d) = *(u16*)(s) -#define MOVE_UNALIGNED64_TO_64(d,s) *(u64*)(d) = *(u64*)(s) +#define ACPI_MOVE_UNALIGNED16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s) +#define ACPI_MOVE_UNALIGNED32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) +#define ACPI_MOVE_UNALIGNED16_TO_32(d,s) *(u32 *)(void *)(d) = *(u16 *)(void *)(s) +#define ACPI_MOVE_UNALIGNED64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) #else /* @@ -151,24 +128,24 @@ * the destination (or both) is/are unaligned. */ -#define MOVE_UNALIGNED16_TO_16(d,s) {((u8 *)(d))[0] = ((u8 *)(s))[0];\ - ((u8 *)(d))[1] = ((u8 *)(s))[1];} +#define ACPI_MOVE_UNALIGNED16_TO_16(d,s) {((u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ + ((u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];} -#define MOVE_UNALIGNED32_TO_32(d,s) {((u8 *)(d))[0] = ((u8 *)(s))[0];\ - ((u8 *)(d))[1] = ((u8 *)(s))[1];\ - ((u8 *)(d))[2] = ((u8 *)(s))[2];\ - ((u8 *)(d))[3] = ((u8 *)(s))[3];} - -#define MOVE_UNALIGNED16_TO_32(d,s) {(*(u32*)(d)) = 0; MOVE_UNALIGNED16_TO_16(d,s);} - -#define MOVE_UNALIGNED64_TO_64(d,s) {((u8 *)(d))[0] = ((u8 *)(s))[0];\ - ((u8 *)(d))[1] = ((u8 *)(s))[1];\ - ((u8 *)(d))[2] = ((u8 *)(s))[2];\ - ((u8 *)(d))[3] = ((u8 *)(s))[3];\ - ((u8 *)(d))[4] = ((u8 *)(s))[4];\ - ((u8 *)(d))[5] = ((u8 *)(s))[5];\ - ((u8 *)(d))[6] = ((u8 *)(s))[6];\ - ((u8 *)(d))[7] = ((u8 *)(s))[7];} +#define ACPI_MOVE_UNALIGNED32_TO_32(d,s) {((u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ + ((u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ + ((u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\ + ((u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[3];} + +#define ACPI_MOVE_UNALIGNED16_TO_32(d,s) {(*(u32*)(void *)(d)) = 0; ACPI_MOVE_UNALIGNED16_TO_16(d,s);} + +#define ACPI_MOVE_UNALIGNED64_TO_64(d,s) {((u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ + ((u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ + ((u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\ + ((u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[3];\ + ((u8 *)(void *)(d))[4] = ((u8 *)(void *)(s))[4];\ + ((u8 *)(void *)(d))[5] = ((u8 *)(void *)(s))[5];\ + ((u8 *)(void *)(d))[6] = ((u8 *)(void *)(s))[6];\ + ((u8 *)(void *)(d))[7] = ((u8 *)(void *)(s))[7];} #endif @@ -177,52 +154,50 @@ * Fast power-of-two math macros for non-optimized compilers */ -#define _DIV(value,power_of2) ((u32) ((value) >> (power_of2))) -#define _MUL(value,power_of2) ((u32) ((value) << (power_of2))) -#define _MOD(value,divisor) ((u32) ((value) & ((divisor) -1))) - -#define DIV_2(a) _DIV(a,1) -#define MUL_2(a) _MUL(a,1) -#define MOD_2(a) _MOD(a,2) - -#define DIV_4(a) _DIV(a,2) -#define MUL_4(a) _MUL(a,2) -#define MOD_4(a) _MOD(a,4) - -#define DIV_8(a) _DIV(a,3) -#define MUL_8(a) _MUL(a,3) -#define MOD_8(a) _MOD(a,8) - -#define DIV_16(a) _DIV(a,4) -#define MUL_16(a) _MUL(a,4) -#define MOD_16(a) _MOD(a,16) +#define _ACPI_DIV(value,power_of2) ((u32) ((value) >> (power_of2))) +#define _ACPI_MUL(value,power_of2) ((u32) ((value) << (power_of2))) +#define _ACPI_MOD(value,divisor) ((u32) ((value) & ((divisor) -1))) + +#define ACPI_DIV_2(a) _ACPI_DIV(a,1) +#define ACPI_MUL_2(a) _ACPI_MUL(a,1) +#define ACPI_MOD_2(a) _ACPI_MOD(a,2) + +#define ACPI_DIV_4(a) _ACPI_DIV(a,2) +#define ACPI_MUL_4(a) _ACPI_MUL(a,2) +#define ACPI_MOD_4(a) _ACPI_MOD(a,4) + +#define ACPI_DIV_8(a) _ACPI_DIV(a,3) +#define ACPI_MUL_8(a) _ACPI_MUL(a,3) +#define ACPI_MOD_8(a) _ACPI_MOD(a,8) + +#define ACPI_DIV_16(a) _ACPI_DIV(a,4) +#define ACPI_MUL_16(a) _ACPI_MUL(a,4) +#define ACPI_MOD_16(a) _ACPI_MOD(a,16) /* * Rounding macros (Power of two boundaries only) */ -#define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1))) -#define ROUND_UP(value,boundary) (((value) + ((boundary)-1)) & (~((boundary)-1))) +#define ACPI_ROUND_DOWN(value,boundary) (((NATIVE_UINT)(value)) & (~(((NATIVE_UINT) boundary)-1))) +#define ACPI_ROUND_UP(value,boundary) ((((NATIVE_UINT)(value)) + (((NATIVE_UINT) boundary)-1)) & (~(((NATIVE_UINT) boundary)-1))) -#define ROUND_DOWN_TO_32_BITS(a) ROUND_DOWN(a,4) -#define ROUND_DOWN_TO_64_BITS(a) ROUND_DOWN(a,8) -#define ROUND_DOWN_TO_NATIVE_WORD(a) ROUND_DOWN(a,ALIGNED_ADDRESS_BOUNDARY) +#define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4) +#define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8) +#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,ALIGNED_ADDRESS_BOUNDARY) -#define ROUND_UP_TO_32_bITS(a) ROUND_UP(a,4) -#define ROUND_UP_TO_64_bITS(a) ROUND_UP(a,8) -#define ROUND_UP_TO_NATIVE_WORD(a) ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) +#define ACPI_ROUND_UP_TO_32_bITS(a) ACPI_ROUND_UP(a,4) +#define ACPI_ROUND_UP_TO_64_bITS(a) ACPI_ROUND_UP(a,8) +#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) -#define ROUND_PTR_UP_TO_4(a,b) ((b *)(((NATIVE_UINT)(a) + 3) & ~3)) -#define ROUND_PTR_UP_TO_8(a,b) ((b *)(((NATIVE_UINT)(a) + 7) & ~7)) -#define ROUND_BITS_UP_TO_BYTES(a) DIV_8((a) + 7) -#define ROUND_BITS_DOWN_TO_BYTES(a) DIV_8((a)) +#define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) +#define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) -#define ROUND_UP_TO_1K(a) (((a) + 1023) >> 10) +#define ACPI_ROUND_UP_TO_1K(a) (((a) + 1023) >> 10) /* Generic (non-power-of-two) rounding */ -#define ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) +#define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) /* * Bitmask creation @@ -230,21 +205,33 @@ * MASK_BITS_ABOVE creates a mask starting AT the position and above * MASK_BITS_BELOW creates a mask starting one bit BELOW the position */ -#define MASK_BITS_ABOVE(position) (~(((u32)(-1)) << ((u32) (position)))) -#define MASK_BITS_BELOW(position) (((u32)(-1)) << ((u32) (position))) +#define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_INTEGER_MAX) << ((u32) (position)))) +#define ACPI_MASK_BITS_BELOW(position) ((ACPI_INTEGER_MAX) << ((u32) (position))) +#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) /* Macros for GAS addressing */ -#ifndef _IA16 +#if ACPI_MACHINE_WIDTH != 16 #define ACPI_PCI_DEVICE_MASK (u64) 0x0000FFFF00000000 #define ACPI_PCI_FUNCTION_MASK (u64) 0x00000000FFFF0000 #define ACPI_PCI_REGISTER_MASK (u64) 0x000000000000FFFF -#define ACPI_PCI_FUNCTION(a) (u16) ((((a) & ACPI_PCI_FUNCTION_MASK) >> 16)) -#define ACPI_PCI_DEVICE(a) (u16) ((((a) & ACPI_PCI_DEVICE_MASK) >> 32)) -#define ACPI_PCI_REGISTER(a) (u16) (((a) & ACPI_PCI_REGISTER_MASK)) +/* + * Obsolete + */ + +/* +#define ACPI_PCI_FUNCTION(a) (u16) ((((u64)((u64)(a) & ACPI_PCI_FUNCTION_MASK)) >> 16)) +#define ACPI_PCI_DEVICE(a) (u16) ((((u64)((u64)(a) & ACPI_PCI_DEVICE_MASK)) >> 32)) +#define ACPI_PCI_REGISTER(a) (u16) (((u64)((u64)(a) & ACPI_PCI_REGISTER_MASK))) +*/ + + +#define ACPI_PCI_DEVICE(a) (u16) ((ACPI_HIDWORD ((a))) & 0x0000FFFF) +#define ACPI_PCI_FUNCTION(a) (u16) ((ACPI_LODWORD ((a))) >> 16) +#define ACPI_PCI_REGISTER(a) (u16) ((ACPI_LODWORD ((a))) & 0x0000FFFF) #else @@ -256,23 +243,30 @@ #endif + +/* Bitfields within ACPI registers */ + +#define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) +#define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask) + /* - * An acpi_handle (which is actually an acpi_namespace_node *) can appear in some contexts, - * such as on ap_obj_stack, where a pointer to an acpi_operand_object can also + * An acpi_namespace_node * can appear in some contexts, + * where a pointer to an acpi_operand_object can also * appear. This macro is used to distinguish them. * - * The Data_type field is the first field in both structures. + * The "Descriptor" field is the first field in both structures. */ -#define VALID_DESCRIPTOR_TYPE(d,t) (((acpi_namespace_node *)d)->data_type == t) +#define ACPI_GET_DESCRIPTOR_TYPE(d) (((ACPI_DESCRIPTOR *)(void *)(d))->descriptor_id) +#define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((ACPI_DESCRIPTOR *)(void *)(d))->descriptor_id = t) /* Macro to test the object type */ -#define IS_THIS_OBJECT_TYPE(d,t) (((acpi_operand_object *)d)->common.type == (u8)t) +#define ACPI_GET_OBJECT_TYPE(d) (((acpi_operand_object *)(void *)d)->common.type) /* Macro to check the table flags for SINGLE or MULTIPLE tables are allowed */ -#define IS_SINGLE_TABLE(x) (((x) & 0x01) == ACPI_TABLE_SINGLE ? 1 : 0) +#define ACPI_IS_SINGLE_TABLE(x) (((x) & 0x01) == ACPI_TABLE_SINGLE ? 1 : 0) /* * Macro to check if a pointer is within an ACPI table. @@ -280,12 +274,12 @@ * as a pointer to an acpi_table_header. (b+1) then points past the header, * and ((u8 *)b+b->Length) points one byte past the end of the table. */ -#ifndef _IA16 -#define IS_IN_ACPI_TABLE(a,b) (((u8 *)(a) >= (u8 *)(b + 1)) &&\ - ((u8 *)(a) < ((u8 *)b + b->length))) +#if ACPI_MACHINE_WIDTH != 16 +#define ACPI_IS_IN_ACPI_TABLE(a,b) (((u8 *)(a) >= (u8 *)(b + 1)) &&\ + ((u8 *)(a) < ((u8 *)b + b->length))) #else -#define IS_IN_ACPI_TABLE(a,b) (_segment)(a) == (_segment)(b) &&\ +#define ACPI_IS_IN_ACPI_TABLE(a,b) (_segment)(a) == (_segment)(b) &&\ (((u8 *)(a) >= (u8 *)(b + 1)) &&\ ((u8 *)(a) < ((u8 *)b + b->length))) #endif @@ -293,10 +287,10 @@ /* * Macros for the master AML opcode table */ -#ifdef ACPI_DEBUG -#define ACPI_OP(name,Pargs,Iargs,class,type,flags) {Pargs,Iargs,flags,class,type,name} +#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) +#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {name,Pargs,Iargs,flags,obj_type,class,type} #else -#define ACPI_OP(name,Pargs,Iargs,class,type,flags) {Pargs,Iargs,flags,class,type} +#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {Pargs,Iargs,flags,obj_type,class,type} #endif #define ARG_TYPE_WIDTH 5 @@ -335,10 +329,10 @@ * 5) Expand address to 64 bits */ #define ASL_BUILD_GAS_FROM_ENTRY(a,b,c,d) {a.address_space_id = (u8) d;\ - a.register_bit_width = (u8) MUL_8 (b);\ + a.register_bit_width = (u8) ACPI_MUL_8 (b);\ a.register_bit_offset = 0;\ a.reserved = 0;\ - ACPI_STORE_ADDRESS (a.address,c);} + ACPI_STORE_ADDRESS (a.address,(ACPI_PHYSICAL_ADDRESS) c);} /* ACPI V1.0 entries -- address space is always I/O */ @@ -349,7 +343,7 @@ * Reporting macros that are never compiled out */ -#define PARAM_LIST(pl) pl +#define ACPI_PARAM_LIST(pl) pl /* * Error reporting. These versions add callers module and line#. Since @@ -359,32 +353,32 @@ #ifdef ACPI_DEBUG -#define REPORT_INFO(fp) {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \ - acpi_os_printf PARAM_LIST(fp);} -#define REPORT_ERROR(fp) {acpi_ut_report_error(_THIS_MODULE,__LINE__,_COMPONENT); \ - acpi_os_printf PARAM_LIST(fp);} -#define REPORT_WARNING(fp) {acpi_ut_report_warning(_THIS_MODULE,__LINE__,_COMPONENT); \ - acpi_os_printf PARAM_LIST(fp);} +#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \ + acpi_os_printf ACPI_PARAM_LIST(fp);} +#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_THIS_MODULE,__LINE__,_COMPONENT); \ + acpi_os_printf ACPI_PARAM_LIST(fp);} +#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_THIS_MODULE,__LINE__,_COMPONENT); \ + acpi_os_printf ACPI_PARAM_LIST(fp);} #else -#define REPORT_INFO(fp) {acpi_ut_report_info("ACPI",__LINE__,_COMPONENT); \ - acpi_os_printf PARAM_LIST(fp);} -#define REPORT_ERROR(fp) {acpi_ut_report_error("ACPI",__LINE__,_COMPONENT); \ - acpi_os_printf PARAM_LIST(fp);} -#define REPORT_WARNING(fp) {acpi_ut_report_warning("ACPI",__LINE__,_COMPONENT); \ - acpi_os_printf PARAM_LIST(fp);} +#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info("ACPI",__LINE__,_COMPONENT); \ + acpi_os_printf ACPI_PARAM_LIST(fp);} +#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error("ACPI",__LINE__,_COMPONENT); \ + acpi_os_printf ACPI_PARAM_LIST(fp);} +#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning("ACPI",__LINE__,_COMPONENT); \ + acpi_os_printf ACPI_PARAM_LIST(fp);} #endif /* Error reporting. These versions pass thru the module and line# */ -#define _REPORT_INFO(a,b,c,fp) {acpi_ut_report_info(a,b,c); \ - acpi_os_printf PARAM_LIST(fp);} -#define _REPORT_ERROR(a,b,c,fp) {acpi_ut_report_error(a,b,c); \ - acpi_os_printf PARAM_LIST(fp);} -#define _REPORT_WARNING(a,b,c,fp) {acpi_ut_report_warning(a,b,c); \ - acpi_os_printf PARAM_LIST(fp);} +#define _ACPI_REPORT_INFO(a,b,c,fp) {acpi_ut_report_info(a,b,c); \ + acpi_os_printf ACPI_PARAM_LIST(fp);} +#define _ACPI_REPORT_ERROR(a,b,c,fp) {acpi_ut_report_error(a,b,c); \ + acpi_os_printf ACPI_PARAM_LIST(fp);} +#define _ACPI_REPORT_WARNING(a,b,c,fp) {acpi_ut_report_warning(a,b,c); \ + acpi_os_printf ACPI_PARAM_LIST(fp);} /* * Debug macros that are conditionally compiled @@ -392,7 +386,7 @@ #ifdef ACPI_DEBUG -#define MODULE_NAME(name) static char *_THIS_MODULE = name; +#define ACPI_MODULE_NAME(name) static char *_THIS_MODULE = name; /* * Function entry tracing. @@ -400,21 +394,21 @@ * as a local string ("_Proc_name) so that it can be also used by the function exit macros below. */ -#define PROC_NAME(a) acpi_debug_print_info _dbg; \ +#define ACPI_FUNCTION_NAME(a) acpi_debug_print_info _dbg; \ _dbg.component_id = _COMPONENT; \ _dbg.proc_name = a; \ _dbg.module_name = _THIS_MODULE; -#define FUNCTION_TRACE(a) PROC_NAME(a)\ - acpi_ut_trace(__LINE__,&_dbg) -#define FUNCTION_TRACE_PTR(a,b) PROC_NAME(a)\ - acpi_ut_trace_ptr(__LINE__,&_dbg,(void *)b) -#define FUNCTION_TRACE_U32(a,b) PROC_NAME(a)\ - acpi_ut_trace_u32(__LINE__,&_dbg,(u32)b) -#define FUNCTION_TRACE_STR(a,b) PROC_NAME(a)\ - acpi_ut_trace_str(__LINE__,&_dbg,(NATIVE_CHAR *)b) +#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a)\ + acpi_ut_trace(__LINE__,&_dbg) +#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a)\ + acpi_ut_trace_ptr(__LINE__,&_dbg,(void *)b) +#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a)\ + acpi_ut_trace_u32(__LINE__,&_dbg,(u32)b) +#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a)\ + acpi_ut_trace_str(__LINE__,&_dbg,(NATIVE_CHAR *)b) -#define FUNCTION_ENTRY() acpi_ut_track_stack_ptr() +#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() /* * Function exit tracing. @@ -423,46 +417,52 @@ * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros * so that "_Proc_name" is defined. */ -#define return_VOID {acpi_ut_exit(__LINE__,&_dbg);return;} -#define return_ACPI_STATUS(s) {acpi_ut_status_exit(__LINE__,&_dbg,s);return(s);} -#define return_VALUE(s) {acpi_ut_value_exit(__LINE__,&_dbg,s);return(s);} -#define return_PTR(s) {acpi_ut_ptr_exit(__LINE__,&_dbg,(u8 *)s);return(s);} +#ifdef ACPI_USE_DO_WHILE_0 +#define ACPI_DO_WHILE0(a) do a while(0) +#else +#define ACPI_DO_WHILE0(a) a +#endif +#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(__LINE__,&_dbg);return;}) +#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(__LINE__,&_dbg,(s));return((s));}) +#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(__LINE__,&_dbg,(acpi_integer)(s));return((s));}) +#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(__LINE__,&_dbg,(u8 *)(s));return((s));}) /* Conditional execution */ -#define DEBUG_EXEC(a) a -#define NORMAL_EXEC(a) +#define ACPI_DEBUG_EXEC(a) a +#define ACPI_NORMAL_EXEC(a) -#define DEBUG_DEFINE(a) a; -#define DEBUG_ONLY_MEMBERS(a) a; +#define ACPI_DEBUG_DEFINE(a) a; +#define ACPI_DEBUG_ONLY_MEMBERS(a) a; #define _OPCODE_NAMES #define _VERBOSE_STRUCTURES /* Stack and buffer dumping */ -#define DUMP_STACK_ENTRY(a) acpi_ex_dump_operand(a) -#define DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_THIS_MODULE,__LINE__) +#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand(a) +#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_THIS_MODULE,__LINE__) -#define DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) -#define DUMP_TABLES(a,b) acpi_ns_dump_tables(a,b) -#define DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) -#define DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) -#define DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) -#define BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a)) +#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) +#define ACPI_DUMP_TABLES(a,b) acpi_ns_dump_tables(a,b) +#define ACPI_DUMP_PATHNAME(a,b,c,d) (void) acpi_ns_dump_pathname(a,b,c,d) +#define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) +#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) +#define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a)) /* * Generate INT3 on ACPI_ERROR (Debug only!) */ -#define ERROR_BREAK -#ifdef ERROR_BREAK -#define BREAK_ON_ERROR(lvl) if ((lvl)&ACPI_ERROR) acpi_os_signal(ACPI_SIGNAL_BREAKPOINT,"Fatal error encountered\n") +#define ACPI_ERROR_BREAK +#ifdef ACPI_ERROR_BREAK +#define ACPI_BREAK_ON_ERROR(lvl) if ((lvl)&ACPI_ERROR) \ + acpi_os_signal(ACPI_SIGNAL_BREAKPOINT,"Fatal error encountered\n") #else -#define BREAK_ON_ERROR(lvl) +#define ACPI_BREAK_ON_ERROR(lvl) #endif /* @@ -472,8 +472,8 @@ * 2) Debug error level or trace level for the print statement is enabled */ -#define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print PARAM_LIST(pl) -#define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw PARAM_LIST(pl) +#define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl) +#define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl) #else @@ -482,39 +482,43 @@ * leaving no executable debug code! */ -#define MODULE_NAME(name) +#define ACPI_MODULE_NAME(name) #define _THIS_MODULE "" -#define DEBUG_EXEC(a) -#define NORMAL_EXEC(a) a; +#define ACPI_DEBUG_EXEC(a) +#define ACPI_NORMAL_EXEC(a) a; -#define DEBUG_DEFINE(a) -#define DEBUG_ONLY_MEMBERS(a) -#define PROC_NAME(a) -#define FUNCTION_TRACE(a) -#define FUNCTION_TRACE_PTR(a,b) -#define FUNCTION_TRACE_U32(a,b) -#define FUNCTION_TRACE_STR(a,b) -#define FUNCTION_EXIT -#define FUNCTION_STATUS_EXIT(s) -#define FUNCTION_VALUE_EXIT(s) -#define FUNCTION_ENTRY() -#define DUMP_STACK_ENTRY(a) -#define DUMP_OPERANDS(a,b,c,d,e) -#define DUMP_ENTRY(a,b) -#define DUMP_TABLES(a,b) -#define DUMP_PATHNAME(a,b,c,d) -#define DUMP_RESOURCE_LIST(a) -#define DUMP_BUFFER(a,b) +#define ACPI_DEBUG_DEFINE(a) +#define ACPI_DEBUG_ONLY_MEMBERS(a) +#define ACPI_FUNCTION_NAME(a) +#define ACPI_FUNCTION_TRACE(a) +#define ACPI_FUNCTION_TRACE_PTR(a,b) +#define ACPI_FUNCTION_TRACE_U32(a,b) +#define ACPI_FUNCTION_TRACE_STR(a,b) +#define ACPI_FUNCTION_EXIT +#define ACPI_FUNCTION_STATUS_EXIT(s) +#define ACPI_FUNCTION_VALUE_EXIT(s) +#define ACPI_FUNCTION_ENTRY() +#define ACPI_DUMP_STACK_ENTRY(a) +#define ACPI_DUMP_OPERANDS(a,b,c,d,e) +#define ACPI_DUMP_ENTRY(a,b) +#define ACPI_DUMP_TABLES(a,b) +#define ACPI_DUMP_PATHNAME(a,b,c,d) +#define ACPI_DUMP_RESOURCE_LIST(a) +#define ACPI_DUMP_BUFFER(a,b) #define ACPI_DEBUG_PRINT(pl) #define ACPI_DEBUG_PRINT_RAW(pl) -#define BREAK_MSG(a) +#define ACPI_BREAK_MSG(a) #define return_VOID return #define return_ACPI_STATUS(s) return(s) #define return_VALUE(s) return(s) #define return_PTR(s) return(s) +#ifdef ENABLE_DEBUGGER +#define _OPCODE_NAMES +#endif + #endif /* @@ -523,9 +527,9 @@ * DEBUG_PRINT stuff (set by ACPI_DEBUG) is on, or not. */ #ifdef ENABLE_DEBUGGER -#define DEBUGGER_EXEC(a) a +#define ACPI_DEBUGGER_EXEC(a) a #else -#define DEBUGGER_EXEC(a) +#define ACPI_DEBUGGER_EXEC(a) #endif @@ -533,10 +537,10 @@ * For 16-bit code, we want to shrink some things even though * we are using ACPI_DEBUG to get the debug output */ -#ifdef _IA16 -#undef DEBUG_ONLY_MEMBERS +#if ACPI_MACHINE_WIDTH == 16 +#undef ACPI_DEBUG_ONLY_MEMBERS #undef _VERBOSE_STRUCTURES -#define DEBUG_ONLY_MEMBERS(a) +#define ACPI_DEBUG_ONLY_MEMBERS(a) #endif @@ -545,11 +549,11 @@ * 1) Set name to blanks * 2) Copy the object name */ -#define ADD_OBJECT_NAME(a,b) MEMSET (a->common.name, ' ', sizeof (a->common.name));\ - STRNCPY (a->common.name, acpi_gbl_ns_type_names[b], sizeof (a->common.name)) +#define ACPI_ADD_OBJECT_NAME(a,b) ACPI_MEMSET (a->common.name, ' ', sizeof (a->common.name));\ + ACPI_STRNCPY (a->common.name, acpi_gbl_ns_type_names[b], sizeof (a->common.name)) #else -#define ADD_OBJECT_NAME(a,b) +#define ACPI_ADD_OBJECT_NAME(a,b) #endif @@ -561,8 +565,8 @@ /* Memory allocation */ -#define ACPI_MEM_ALLOCATE(a) acpi_os_allocate(a) -#define ACPI_MEM_CALLOCATE(a) acpi_os_callocate(a) +#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((ACPI_SIZE)(a),_COMPONENT,_THIS_MODULE,__LINE__) +#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((ACPI_SIZE)(a), _COMPONENT,_THIS_MODULE,__LINE__) #define ACPI_MEM_FREE(a) acpi_os_free(a) #define ACPI_MEM_TRACKING(a) @@ -571,9 +575,9 @@ /* Memory allocation */ -#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate(a,_COMPONENT,_THIS_MODULE,__LINE__) -#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate(a, _COMPONENT,_THIS_MODULE,__LINE__) -#define ACPI_MEM_FREE(a) acpi_ut_free(a,_COMPONENT,_THIS_MODULE,__LINE__) +#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((ACPI_SIZE)(a),_COMPONENT,_THIS_MODULE,__LINE__) +#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((ACPI_SIZE)(a), _COMPONENT,_THIS_MODULE,__LINE__) +#define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_THIS_MODULE,__LINE__) #define ACPI_MEM_TRACKING(a) a #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ diff -urN linux-2.4.18/drivers/acpi/include/acnamesp.h lia64-2.4/drivers/acpi/include/acnamesp.h --- linux-2.4.18/drivers/acpi/include/acnamesp.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/acnamesp.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acnamesp.h - Namespace subcomponent prototypes and defines - * $Revision: 110 $ + * $Revision: 125 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,37 +29,37 @@ /* To search the entire name space, pass this as Search_base */ -#define NS_ALL ((acpi_handle)0) +#define ACPI_NS_ALL ((acpi_handle)0) /* * Elements of Acpi_ns_properties are bit significant * and should be one-to-one with values of acpi_object_type */ -#define NSP_NORMAL 0 -#define NSP_NEWSCOPE 1 /* a definition of this type opens a name scope */ -#define NSP_LOCAL 2 /* suppress search of enclosing scopes */ +#define ACPI_NS_NORMAL 0 +#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */ +#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */ /* Definitions of the predefined namespace names */ -#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ -#define ACPI_ROOT_NAME (u32) 0x2F202020 /* Root name is "/ " */ -#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */ +#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ +#define ACPI_ROOT_NAME (u32) 0x2F202020 /* Root name is "/ " */ +#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */ -#define NS_ROOT_PATH "/" -#define NS_SYSTEM_BUS "_SB_" +#define ACPI_NS_ROOT_PATH "\\" +#define ACPI_NS_SYSTEM_BUS "_SB_" /* Flags for Acpi_ns_lookup, Acpi_ns_search_and_enter */ -#define NS_NO_UPSEARCH 0 -#define NS_SEARCH_PARENT 0x01 -#define NS_DONT_OPEN_SCOPE 0x02 -#define NS_NO_PEER_SEARCH 0x04 -#define NS_ERROR_IF_FOUND 0x08 +#define ACPI_NS_NO_UPSEARCH 0 +#define ACPI_NS_SEARCH_PARENT 0x01 +#define ACPI_NS_DONT_OPEN_SCOPE 0x02 +#define ACPI_NS_NO_PEER_SEARCH 0x04 +#define ACPI_NS_ERROR_IF_FOUND 0x08 -#define NS_WALK_UNLOCK TRUE -#define NS_WALK_NO_UNLOCK FALSE +#define ACPI_NS_WALK_UNLOCK TRUE +#define ACPI_NS_WALK_NO_UNLOCK FALSE acpi_status @@ -94,7 +94,7 @@ acpi_status acpi_ns_walk_namespace ( - acpi_object_type8 type, + acpi_object_type type, acpi_handle start_object, u32 max_depth, u8 unlock_before_callback, @@ -104,11 +104,11 @@ acpi_namespace_node * acpi_ns_get_next_node ( - acpi_object_type8 type, + acpi_object_type type, acpi_namespace_node *parent, acpi_namespace_node *child); -acpi_status +void acpi_ns_delete_namespace_by_owner ( u16 table_id); @@ -139,7 +139,6 @@ * Top-level namespace access - nsaccess */ - acpi_status acpi_ns_root_initialize ( void); @@ -148,8 +147,8 @@ acpi_ns_lookup ( acpi_generic_state *scope_info, NATIVE_CHAR *name, - acpi_object_type8 type, - operating_mode interpreter_mode, + acpi_object_type type, + acpi_interpreter_mode interpreter_mode, u32 flags, acpi_walk_state *walk_state, acpi_namespace_node **ret_node); @@ -159,7 +158,6 @@ * Named object allocation/deallocation - nsalloc */ - acpi_namespace_node * acpi_ns_create_node ( u32 name); @@ -168,7 +166,7 @@ acpi_ns_delete_node ( acpi_namespace_node *node); -acpi_status +void acpi_ns_delete_namespace_subtree ( acpi_namespace_node *parent_handle); @@ -216,12 +214,31 @@ u32 component); void +acpi_ns_print_pathname ( + u32 num_segments, + char *pathname); + +acpi_status +acpi_ns_dump_one_device ( + acpi_handle obj_handle, + u32 level, + void *context, + void **return_value); + +void acpi_ns_dump_root_devices ( void); +acpi_status +acpi_ns_dump_one_object ( + acpi_handle obj_handle, + u32 level, + void *context, + void **return_value); + void acpi_ns_dump_objects ( - acpi_object_type8 type, + acpi_object_type type, u8 display_type, u32 max_depth, u32 ownder_id, @@ -277,15 +294,21 @@ /* - * Scope manipulation - nsscope + * Name and Scope manipulation - nsnames */ u32 acpi_ns_opens_scope ( - acpi_object_type8 type); + acpi_object_type type); + +void +acpi_ns_build_external_path ( + acpi_namespace_node *node, + ACPI_SIZE size, + NATIVE_CHAR *name_buffer); NATIVE_CHAR * -acpi_ns_get_table_pathname ( +acpi_ns_get_external_pathname ( acpi_namespace_node *node); NATIVE_CHAR * @@ -294,9 +317,8 @@ acpi_status acpi_ns_handle_to_pathname ( - acpi_handle obj_handle, - u32 *buf_size, - NATIVE_CHAR *user_buffer); + acpi_handle target_handle, + acpi_buffer *buffer); u8 acpi_ns_pattern_match ( @@ -304,25 +326,51 @@ NATIVE_CHAR *search_for); acpi_status -acpi_ns_get_node ( - NATIVE_CHAR *pathname, +acpi_ns_get_node_by_path ( + NATIVE_CHAR *external_pathname, acpi_namespace_node *in_prefix_node, + u32 flags, acpi_namespace_node **out_node); -u32 +ACPI_SIZE acpi_ns_get_pathname_length ( acpi_namespace_node *node); /* - * Object management for NTEs - nsobject + * Object management for namespace nodes - nsobject */ acpi_status acpi_ns_attach_object ( acpi_namespace_node *node, acpi_operand_object *object, - acpi_object_type8 type); + acpi_object_type type); + +acpi_operand_object * +acpi_ns_get_attached_object ( + acpi_namespace_node *node); + +acpi_operand_object * +acpi_ns_get_secondary_object ( + acpi_operand_object *obj_desc); + +acpi_status +acpi_ns_attach_data ( + acpi_namespace_node *node, + ACPI_OBJECT_HANDLER handler, + void *data); + +acpi_status +acpi_ns_detach_data ( + acpi_namespace_node *node, + ACPI_OBJECT_HANDLER handler); + +acpi_status +acpi_ns_get_attached_data ( + acpi_namespace_node *node, + ACPI_OBJECT_HANDLER handler, + void **data); /* @@ -334,8 +382,8 @@ u32 entry_name, acpi_walk_state *walk_state, acpi_namespace_node *node, - operating_mode interpreter_mode, - acpi_object_type8 type, + acpi_interpreter_mode interpreter_mode, + acpi_object_type type, u32 flags, acpi_namespace_node **ret_node); @@ -343,7 +391,7 @@ acpi_ns_search_node ( u32 entry_name, acpi_namespace_node *node, - acpi_object_type8 type, + acpi_object_type type, acpi_namespace_node **ret_node); void @@ -351,7 +399,7 @@ acpi_walk_state *walk_state, acpi_namespace_node *parent_node, /* Parent */ acpi_namespace_node *node, /* New Child*/ - acpi_object_type8 type); + acpi_object_type type); /* @@ -366,23 +414,19 @@ acpi_ns_valid_path_separator ( NATIVE_CHAR sep); -acpi_object_type8 +acpi_object_type acpi_ns_get_type ( acpi_namespace_node *node); -void * -acpi_ns_get_attached_object ( - acpi_namespace_node *node); - u32 acpi_ns_local ( - acpi_object_type8 type); + acpi_object_type type); acpi_status acpi_ns_build_internal_name ( acpi_namestring_info *info); -acpi_status +void acpi_ns_get_internal_name_length ( acpi_namestring_info *info); @@ -411,7 +455,7 @@ void); acpi_namespace_node * -acpi_ns_get_parent_object ( +acpi_ns_get_parent_node ( acpi_namespace_node *node); diff -urN linux-2.4.18/drivers/acpi/include/acobject.h lia64-2.4/drivers/acpi/include/acobject.h --- linux-2.4.18/drivers/acpi/include/acobject.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/acobject.h Tue Jun 11 14:24:22 2002 @@ -2,12 +2,12 @@ /****************************************************************************** * * Name: acobject.h - Definition of acpi_operand_object (Internal object only) - * $Revision: 93 $ + * $Revision: 111 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,23 +32,14 @@ * The acpi_operand_object is used to pass AML operands from the dispatcher * to the interpreter, and to keep track of the various handlers such as * address space handlers and notify handlers. The object is a constant - * size in order to allow them to be cached and reused. - * - * All variants of the acpi_operand_object are defined with the same - * sequence of field types, with fields that are not used in a particular - * variant being named "Reserved". This is not strictly necessary, but - * may in some circumstances simplify understanding if these structures - * need to be displayed in a debugger having limited (or no) support for - * union types. It also simplifies some debug code in Dump_table() which - * dumps multi-level values: fetching Buffer.Pointer suffices to pick up - * the value or next level for any of several types. + * size in order to allow it to be cached and reused. */ -/****************************************************************************** +/******************************************************************************* * * Common Descriptors * - *****************************************************************************/ + ******************************************************************************/ /* * Common area for all objects. @@ -56,46 +47,40 @@ * Data_type is used to differentiate between internal descriptors, and MUST * be the first byte in this structure. */ - - -#define ACPI_OBJECT_COMMON_HEADER /* SIZE/ALIGNMENT: 32-bits plus trailing 8-bit flag */\ - u8 data_type; /* To differentiate various internal objs */\ +#define ACPI_OBJECT_COMMON_HEADER /* SIZE/ALIGNMENT: 32 bits, one ptr plus trailing 8-bit flag */\ + u8 descriptor; /* To differentiate various internal objs */\ u8 type; /* acpi_object_type */\ u16 reference_count; /* For object deletion management */\ + union acpi_operand_obj *next_object; /* Objects linked to parent NS node */\ u8 flags; \ -/* Defines for flag byte above */ +/* Values for flag byte above */ -#define AOPOBJ_STATIC_ALLOCATION 0x1 -#define AOPOBJ_STATIC_POINTER 0x2 -#define AOPOBJ_DATA_VALID 0x4 -#define AOPOBJ_ZERO_CONST 0x4 -#define AOPOBJ_INITIALIZED 0x8 +#define AOPOBJ_RESERVED 0x01 +#define AOPOBJ_STATIC_POINTER 0x02 +#define AOPOBJ_DATA_VALID 0x04 +#define AOPOBJ_OBJECT_INITIALIZED 0x08 +#define AOPOBJ_SETUP_COMPLETE 0x10 +#define AOPOBJ_SINGLE_DATUM 0x20 /* * Common bitfield for the field objects - * "Field Datum" -- a datum from the actual field object - * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field + * "Field Datum" -- a datum from the actual field object + * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field */ #define ACPI_COMMON_FIELD_INFO /* SIZE/ALIGNMENT: 24 bits + three 32-bit values */\ - u8 access_flags;\ - u16 bit_length; /* Length of field in bits */\ - u32 base_byte_offset; /* Byte offset within containing object */\ - u8 access_bit_width; /* Read/Write size in bits (from ASL Access_type)*/\ + u8 field_flags; /* Access, update, and lock bits */\ + u8 attribute; /* From Access_as keyword */\ u8 access_byte_width; /* Read/Write size in bytes */\ - u8 update_rule; /* How neighboring field bits are handled */\ - u8 lock_rule; /* Global Lock: 1 = "Must Lock" */\ + u32 bit_length; /* Length of field in bits */\ + u32 base_byte_offset; /* Byte offset within containing object */\ u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\ u8 datum_valid_bits; /* Valid bit in first "Field datum" */\ u8 end_field_valid_bits; /* Valid bits in the last "field datum" */\ u8 end_buffer_valid_bits; /* Valid bits in the last "buffer datum" */\ - u32 value; /* Value to store into the Bank or Index register */ - - -/* Access flag bits */ - -#define AFIELD_SINGLE_DATUM 0x1 + u32 value; /* Value to store into the Bank or Index register */\ + acpi_namespace_node *node; /* Link back to parent node */ /* @@ -105,29 +90,29 @@ u32 length; +/* + * Common fields for objects that support ASL notifications + */ +#define ACPI_COMMON_NOTIFY_INFO \ + union acpi_operand_obj *sys_handler; /* Handler for system notifies */\ + union acpi_operand_obj *drv_handler; /* Handler for driver notifies */\ + union acpi_operand_obj *addr_handler; /* Handler for Address space */ + + /****************************************************************************** * - * Individual Object Descriptors + * Basic data types * *****************************************************************************/ - -typedef struct /* COMMON */ +typedef struct acpi_object_common { ACPI_OBJECT_COMMON_HEADER } ACPI_OBJECT_COMMON; -typedef struct /* CACHE_LIST */ -{ - ACPI_OBJECT_COMMON_HEADER - union acpi_operand_obj *next; /* Link for object cache and internal lists*/ - -} ACPI_OBJECT_CACHE_LIST; - - -typedef struct /* NUMBER - has value */ +typedef struct acpi_object_integer { ACPI_OBJECT_COMMON_HEADER @@ -136,47 +121,47 @@ } ACPI_OBJECT_INTEGER; -typedef struct /* STRING - has length and pointer - Null terminated, ASCII characters only */ +typedef struct acpi_object_string /* Null terminated, ASCII characters only */ { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO - NATIVE_CHAR *pointer; /* String value in AML stream or in allocated space */ + NATIVE_CHAR *pointer; /* String in AML stream or allocated string */ } ACPI_OBJECT_STRING; -typedef struct /* BUFFER - has length and pointer - not null terminated */ +typedef struct acpi_object_buffer { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO - u8 *pointer; /* Buffer value in AML stream or in allocated space */ + u8 *pointer; /* Buffer in AML stream or allocated buffer */ + acpi_namespace_node *node; /* Link back to parent node */ + u8 *aml_start; + u32 aml_length; } ACPI_OBJECT_BUFFER; -typedef struct /* PACKAGE - has count, elements, next element */ +typedef struct acpi_object_package { ACPI_OBJECT_COMMON_HEADER u32 count; /* # of elements in package */ + u32 aml_length; + u8 *aml_start; + acpi_namespace_node *node; /* Link back to parent node */ union acpi_operand_obj **elements; /* Array of pointers to Acpi_objects */ - union acpi_operand_obj **next_element; /* used only while initializing */ } ACPI_OBJECT_PACKAGE; -typedef struct /* DEVICE - has handle and notification handler/context */ -{ - ACPI_OBJECT_COMMON_HEADER - - union acpi_operand_obj *sys_handler; /* Handler for system notifies */ - union acpi_operand_obj *drv_handler; /* Handler for driver notifies */ - union acpi_operand_obj *addr_handler; /* Handler for Address space */ - -} ACPI_OBJECT_DEVICE; - +/****************************************************************************** + * + * Complex data types + * + *****************************************************************************/ -typedef struct /* EVENT */ +typedef struct acpi_object_event { ACPI_OBJECT_COMMON_HEADER void *semaphore; @@ -186,7 +171,7 @@ #define INFINITE_CONCURRENCY 0xFF -typedef struct /* METHOD */ +typedef struct acpi_object_method { ACPI_OBJECT_COMMON_HEADER u8 method_flags; @@ -204,80 +189,96 @@ } ACPI_OBJECT_METHOD; -typedef struct acpi_obj_mutex /* MUTEX */ +typedef struct acpi_object_mutex { ACPI_OBJECT_COMMON_HEADER u16 sync_level; u16 acquisition_depth; + struct acpi_thread_state *owner_thread; void *semaphore; - void *owner; union acpi_operand_obj *prev; /* Link for list of acquired mutexes */ union acpi_operand_obj *next; /* Link for list of acquired mutexes */ } ACPI_OBJECT_MUTEX; -typedef struct /* REGION */ +typedef struct acpi_object_region { ACPI_OBJECT_COMMON_HEADER u8 space_id; - u32 length; - ACPI_PHYSICAL_ADDRESS address; - union acpi_operand_obj *extra; /* Pointer to executable AML (in region definition) */ union acpi_operand_obj *addr_handler; /* Handler for system notifies */ acpi_namespace_node *node; /* containing object */ union acpi_operand_obj *next; + u32 length; + ACPI_PHYSICAL_ADDRESS address; } ACPI_OBJECT_REGION; -typedef struct /* POWER RESOURCE - has Handle and notification handler/context*/ +/****************************************************************************** + * + * Objects that can be notified. All share a common Notify_info area. + * + *****************************************************************************/ + +typedef struct acpi_object_notify_common /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ +{ + ACPI_OBJECT_COMMON_HEADER + ACPI_COMMON_NOTIFY_INFO + +} ACPI_OBJECT_NOTIFY_COMMON; + + +typedef struct acpi_object_device { ACPI_OBJECT_COMMON_HEADER + ACPI_COMMON_NOTIFY_INFO + +} ACPI_OBJECT_DEVICE; + + +typedef struct acpi_object_power_resource +{ + ACPI_OBJECT_COMMON_HEADER + ACPI_COMMON_NOTIFY_INFO u32 system_level; u32 resource_order; - union acpi_operand_obj *sys_handler; /* Handler for system notifies */ - union acpi_operand_obj *drv_handler; /* Handler for driver notifies */ - } ACPI_OBJECT_POWER_RESOURCE; -typedef struct /* PROCESSOR - has Handle and notification handler/context*/ +typedef struct acpi_object_processor { ACPI_OBJECT_COMMON_HEADER + ACPI_COMMON_NOTIFY_INFO u32 proc_id; u32 length; ACPI_IO_ADDRESS address; - union acpi_operand_obj *sys_handler; /* Handler for system notifies */ - union acpi_operand_obj *drv_handler; /* Handler for driver notifies */ - union acpi_operand_obj *addr_handler; /* Handler for Address space */ - } ACPI_OBJECT_PROCESSOR; -typedef struct /* THERMAL ZONE - has Handle and Handler/Context */ +typedef struct acpi_object_thermal_zone { ACPI_OBJECT_COMMON_HEADER + ACPI_COMMON_NOTIFY_INFO - union acpi_operand_obj *sys_handler; /* Handler for system notifies */ - union acpi_operand_obj *drv_handler; /* Handler for driver notifies */ - union acpi_operand_obj *addr_handler; /* Handler for Address space */ } ACPI_OBJECT_THERMAL_ZONE; -/* +/****************************************************************************** + * * Fields. All share a common header/info field. - */ + * + *****************************************************************************/ -typedef struct /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ +typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO @@ -286,7 +287,7 @@ } ACPI_OBJECT_FIELD_COMMON; -typedef struct /* REGION FIELD */ +typedef struct acpi_object_region_field { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO @@ -295,18 +296,18 @@ } ACPI_OBJECT_REGION_FIELD; -typedef struct /* BANK FIELD */ +typedef struct acpi_object_bank_field { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_obj *region_obj; /* Containing Op_region object */ - union acpi_operand_obj *bank_register_obj; /* Bank_select Register object */ + union acpi_operand_obj *bank_obj; /* Bank_select Register object */ } ACPI_OBJECT_BANK_FIELD; -typedef struct /* INDEX FIELD */ +typedef struct acpi_object_index_field { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO @@ -324,23 +325,23 @@ /* The Buffer_field is different in that it is part of a Buffer, not an Op_region */ -typedef struct /* BUFFER FIELD */ +typedef struct acpi_object_buffer_field { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO - union acpi_operand_obj *extra; /* Pointer to executable AML (in field definition) */ - acpi_namespace_node *node; /* Parent (containing) object node */ union acpi_operand_obj *buffer_obj; /* Containing Buffer object */ } ACPI_OBJECT_BUFFER_FIELD; -/* - * Handlers - */ +/****************************************************************************** + * + * Objects for handlers + * + *****************************************************************************/ -typedef struct /* NOTIFY HANDLER */ +typedef struct acpi_object_notify_handler { ACPI_OBJECT_COMMON_HEADER @@ -353,10 +354,10 @@ /* Flags for address handler */ -#define ADDR_HANDLER_DEFAULT_INSTALLED 0x1 +#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x1 -typedef struct /* ADDRESS HANDLER */ +typedef struct acpi_object_addr_handler { ACPI_OBJECT_COMMON_HEADER @@ -373,12 +374,17 @@ } ACPI_OBJECT_ADDR_HANDLER; +/****************************************************************************** + * + * Special internal objects + * + *****************************************************************************/ + /* * The Reference object type is used for these opcodes: * Arg[0-6], Local[0-7], Index_op, Name_op, Zero_op, One_op, Ones_op, Debug_op */ - -typedef struct /* Reference - Local object type */ +typedef struct acpi_object_reference { ACPI_OBJECT_COMMON_HEADER @@ -400,8 +406,7 @@ * * Currently: Region and Field_unit types */ - -typedef struct /* EXTRA */ +typedef struct acpi_object_extra { ACPI_OBJECT_COMMON_HEADER u8 byte_fill1; @@ -414,38 +419,104 @@ } ACPI_OBJECT_EXTRA; +/* Additional data that can be attached to namespace nodes */ + +typedef struct acpi_object_data +{ + ACPI_OBJECT_COMMON_HEADER + ACPI_OBJECT_HANDLER handler; + void *pointer; + +} ACPI_OBJECT_DATA; + + +/* Structure used when objects are cached for reuse */ + +typedef struct acpi_object_cache_list +{ + ACPI_OBJECT_COMMON_HEADER + union acpi_operand_obj *next; /* Link for object cache and internal lists*/ + +} ACPI_OBJECT_CACHE_LIST; + + /****************************************************************************** * - * acpi_operand_object Descriptor - a giant union of all of the above + * acpi_operand_object Descriptor - a giant union of all of the above * *****************************************************************************/ typedef union acpi_operand_obj { ACPI_OBJECT_COMMON common; - ACPI_OBJECT_CACHE_LIST cache; + ACPI_OBJECT_INTEGER integer; ACPI_OBJECT_STRING string; ACPI_OBJECT_BUFFER buffer; ACPI_OBJECT_PACKAGE package; - ACPI_OBJECT_BUFFER_FIELD buffer_field; - ACPI_OBJECT_DEVICE device; + ACPI_OBJECT_EVENT event; ACPI_OBJECT_METHOD method; ACPI_OBJECT_MUTEX mutex; ACPI_OBJECT_REGION region; + + ACPI_OBJECT_NOTIFY_COMMON common_notify; + ACPI_OBJECT_DEVICE device; ACPI_OBJECT_POWER_RESOURCE power_resource; ACPI_OBJECT_PROCESSOR processor; ACPI_OBJECT_THERMAL_ZONE thermal_zone; + ACPI_OBJECT_FIELD_COMMON common_field; ACPI_OBJECT_REGION_FIELD field; + ACPI_OBJECT_BUFFER_FIELD buffer_field; ACPI_OBJECT_BANK_FIELD bank_field; ACPI_OBJECT_INDEX_FIELD index_field; - ACPI_OBJECT_REFERENCE reference; + ACPI_OBJECT_NOTIFY_HANDLER notify_handler; ACPI_OBJECT_ADDR_HANDLER addr_handler; + + ACPI_OBJECT_REFERENCE reference; ACPI_OBJECT_EXTRA extra; + ACPI_OBJECT_DATA data; + ACPI_OBJECT_CACHE_LIST cache; } acpi_operand_object; + + +/****************************************************************************** + * + * ACPI_DESCRIPTOR - objects that share a common descriptor identifier + * + *****************************************************************************/ + + +/* Object descriptor types */ + +#define ACPI_DESC_TYPE_CACHED 0x11 /* Used only when object is cached */ +#define ACPI_DESC_TYPE_STATE 0x20 +#define ACPI_DESC_TYPE_STATE_UPDATE 0x21 +#define ACPI_DESC_TYPE_STATE_PACKAGE 0x22 +#define ACPI_DESC_TYPE_STATE_CONTROL 0x23 +#define ACPI_DESC_TYPE_STATE_RPSCOPE 0x24 +#define ACPI_DESC_TYPE_STATE_PSCOPE 0x25 +#define ACPI_DESC_TYPE_STATE_WSCOPE 0x26 +#define ACPI_DESC_TYPE_STATE_RESULT 0x27 +#define ACPI_DESC_TYPE_STATE_NOTIFY 0x28 +#define ACPI_DESC_TYPE_STATE_THREAD 0x29 +#define ACPI_DESC_TYPE_WALK 0x44 +#define ACPI_DESC_TYPE_PARSER 0x66 +#define ACPI_DESC_TYPE_OPERAND 0x88 +#define ACPI_DESC_TYPE_NAMED 0xAA + + +typedef union acpi_desc +{ + u8 descriptor_id; /* To differentiate various internal objs */\ + acpi_operand_object object; + acpi_namespace_node node; + acpi_parse_object op; + +} ACPI_DESCRIPTOR; + #endif /* _ACOBJECT_H */ diff -urN linux-2.4.18/drivers/acpi/include/acoutput.h lia64-2.4/drivers/acpi/include/acoutput.h --- linux-2.4.18/drivers/acpi/include/acoutput.h Mon Sep 24 15:06:42 2001 +++ lia64-2.4/drivers/acpi/include/acoutput.h Tue Apr 9 15:46:59 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acoutput.h -- debug output - * $Revision: 84 $ + * $Revision: 86 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,25 +46,18 @@ #define ACPI_DEBUGGER 0x00000200 #define ACPI_OS_SERVICES 0x00000400 -#define ACPI_BUS 0x00010000 -#define ACPI_SYSTEM 0x00020000 -#define ACPI_POWER 0x00040000 -#define ACPI_EC 0x00080000 -#define ACPI_AC_ADAPTER 0x00100000 -#define ACPI_BATTERY 0x00200000 -#define ACPI_BUTTON 0x00400000 -#define ACPI_PROCESSOR 0x00800000 -#define ACPI_THERMAL 0x01000000 -#define ACPI_FAN 0x02000000 - -#define ACPI_ALL_COMPONENTS 0x0FFFFFFF +#define ACPI_ALL_COMPONENTS 0x00000FFF #define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) +/* Component IDs for ACPI tools and utilities */ + +#define ACPI_COMPILER 0x00001000 +#define ACPI_TOOLS 0x00002000 -#define ACPI_COMPILER 0x10000000 -#define ACPI_TOOLS 0x20000000 +/* Component IDs reserved for ACPI drivers */ +#define ACPI_ALL_DRIVERS 0xFFFF0000 /* * Raw debug output levels, do not use these in the DEBUG_PRINT macros diff -urN linux-2.4.18/drivers/acpi/include/acparser.h lia64-2.4/drivers/acpi/include/acparser.h --- linux-2.4.18/drivers/acpi/include/acparser.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/acparser.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: acparser.h - AML Parser subcomponent prototypes and defines - * $Revision: 54 $ + * $Revision: 59 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,15 +28,11 @@ #define __ACPARSER_H__ -#define OP_HAS_RETURN_VALUE 1 +#define OP_HAS_RETURN_VALUE 1 /* variable # arguments */ -#define ACPI_VAR_ARGS ACPI_UINT32_MAX - -/* maximum virtual address */ - -#define ACPI_MAX_AML ((u8 *)(~0UL)) +#define ACPI_VAR_ARGS ACPI_UINT32_MAX #define ACPI_PARSE_DELETE_TREE 0x0001 @@ -48,7 +44,8 @@ #define ACPI_PARSE_EXECUTE 0x0030 #define ACPI_PARSE_MODE_MASK 0x0030 -/* psapi - Parser external interfaces */ + +/* Parser external interfaces */ acpi_status acpi_psx_load_table ( @@ -61,6 +58,7 @@ acpi_operand_object **params, acpi_operand_object **return_obj_desc); + /****************************************************************************** * * Parser interfaces @@ -85,8 +83,8 @@ void acpi_ps_get_next_simple_arg ( acpi_parse_state *parser_state, - u32 arg_type, /* type of argument */ - acpi_parse_object *arg); /* (OUT) argument data */ + u32 arg_type, + acpi_parse_object *arg); void acpi_ps_get_next_namepath ( @@ -106,6 +104,19 @@ u32 *arg_count); +/* psfind */ + +acpi_parse_object * +acpi_ps_find_name ( + acpi_parse_object *scope, + u32 name, + u32 opcode); + +acpi_parse_object* +acpi_ps_get_parent ( + acpi_parse_object *op); + + /* psopcode - AML Opcode information */ const acpi_opcode_info * @@ -119,6 +130,21 @@ /* psparse - top level parsing routines */ +u32 +acpi_ps_get_opcode_size ( + u32 opcode); + +void +acpi_ps_complete_this_op ( + acpi_walk_state *walk_state, + acpi_parse_object *op); + +acpi_status +acpi_ps_next_parse_state ( + acpi_walk_state *walk_state, + acpi_parse_object *op, + acpi_status callback_status); + acpi_status acpi_ps_find_object ( acpi_walk_state *walk_state, @@ -232,6 +258,10 @@ acpi_walk_state *walk_state, acpi_parse_object *op, acpi_parse_upwards ascending_callback); + +acpi_status +acpi_ps_delete_completed_op ( + acpi_walk_state *walk_state); /* psutils - parser utilities */ diff -urN linux-2.4.18/drivers/acpi/include/acpi.h lia64-2.4/drivers/acpi/include/acpi.h --- linux-2.4.18/drivers/acpi/include/acpi.h Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/include/acpi.h Tue Apr 9 15:46:59 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acpi.h - Master include file, Publics and external data. - * $Revision: 54 $ + * $Revision: 55 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -urN linux-2.4.18/drivers/acpi/include/acpiosxf.h lia64-2.4/drivers/acpi/include/acpiosxf.h --- linux-2.4.18/drivers/acpi/include/acpiosxf.h Mon Sep 24 15:06:42 2001 +++ lia64-2.4/drivers/acpi/include/acpiosxf.h Tue Apr 9 15:46:59 2002 @@ -9,7 +9,7 @@ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -62,12 +62,12 @@ * Types specific to the OS service interfaces */ -typedef -u32 (*OSD_HANDLER) ( +typedef u32 +(ACPI_SYSTEM_XFACE *OSD_HANDLER) ( void *context); -typedef -void (*OSD_EXECUTION_CALLBACK) ( +typedef void +(ACPI_SYSTEM_XFACE *OSD_EXECUTION_CALLBACK) ( void *context); @@ -83,10 +83,20 @@ acpi_os_terminate ( void); + +/* + * ACPI Table interfaces + */ + acpi_status acpi_os_get_root_pointer ( u32 flags, - ACPI_PHYSICAL_ADDRESS *rsdp_physical_address); + ACPI_POINTER *address); + +acpi_status +acpi_os_table_override ( + acpi_table_header *existing_table, + acpi_table_header **new_table); /* @@ -121,11 +131,7 @@ void * acpi_os_allocate ( - u32 size); - -void * -acpi_os_callocate ( - u32 size); + ACPI_SIZE size); void acpi_os_free ( @@ -134,13 +140,13 @@ acpi_status acpi_os_map_memory ( ACPI_PHYSICAL_ADDRESS physical_address, - u32 length, + ACPI_SIZE size, void **logical_address); void acpi_os_unmap_memory ( void *logical_address, - u32 length); + ACPI_SIZE size); acpi_status acpi_os_get_physical_address ( @@ -202,7 +208,7 @@ acpi_status acpi_os_write_port ( ACPI_IO_ADDRESS address, - NATIVE_UINT value, + acpi_integer value, u32 width); @@ -220,7 +226,7 @@ acpi_status acpi_os_write_memory ( ACPI_PHYSICAL_ADDRESS address, - NATIVE_UINT value, + acpi_integer value, u32 width); @@ -240,7 +246,7 @@ acpi_os_write_pci_configuration ( acpi_pci_id *pci_id, u32 register, - NATIVE_UINT value, + acpi_integer value, u32 width); @@ -272,12 +278,12 @@ * Debug print routines */ -s32 +void ACPI_INTERNAL_VAR_XFACE acpi_os_printf ( const NATIVE_CHAR *format, ...); -s32 +void acpi_os_vprintf ( const NATIVE_CHAR *format, va_list args); diff -urN linux-2.4.18/drivers/acpi/include/acpixf.h lia64-2.4/drivers/acpi/include/acpixf.h --- linux-2.4.18/drivers/acpi/include/acpixf.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/acpixf.h Tue Jun 11 14:24:22 2002 @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -67,6 +67,14 @@ acpi_format_exception ( acpi_status exception); +acpi_status +acpi_purge_cached_objects ( + void); + +acpi_status +acpi_install_initialization_handler ( + ACPI_INIT_HANDLER handler, + u32 function); /* * ACPI Memory manager @@ -92,7 +100,7 @@ acpi_status acpi_find_root_pointer ( u32 flags, - ACPI_PHYSICAL_ADDRESS *rsdp_physical_address); + ACPI_POINTER *rsdp_address); acpi_status acpi_load_tables ( @@ -158,6 +166,23 @@ acpi_string pathname, acpi_handle *ret_handle); +acpi_status +acpi_attach_data ( + acpi_handle obj_handle, + ACPI_OBJECT_HANDLER handler, + void *data); + +acpi_status +acpi_detach_data ( + acpi_handle obj_handle, + ACPI_OBJECT_HANDLER handler); + +acpi_status +acpi_get_data ( + acpi_handle obj_handle, + ACPI_OBJECT_HANDLER handler, + void **data); + /* * Object manipulation and enumeration @@ -244,11 +269,12 @@ acpi_status acpi_acquire_global_lock ( - void); + u32 timeout, + u32 *handle); acpi_status acpi_release_global_lock ( - void); + u32 handle); acpi_status acpi_remove_gpe_handler ( @@ -308,6 +334,18 @@ */ acpi_status +acpi_get_register ( + u32 register_id, + u32 *return_value, + u32 flags); + +acpi_status +acpi_set_register ( + u32 register_id, + u32 value, + u32 flags); + +acpi_status acpi_set_firmware_waking_vector ( ACPI_PHYSICAL_ADDRESS physical_address); @@ -316,11 +354,22 @@ ACPI_PHYSICAL_ADDRESS *physical_address); acpi_status +acpi_get_sleep_type_data ( + u8 sleep_state, + u8 *slp_typ_a, + u8 *slp_typ_b); + +acpi_status +acpi_enter_sleep_state_prep ( + u8 sleep_state); + +acpi_status acpi_enter_sleep_state ( - u8 sleep_state); + u8 sleep_state); acpi_status acpi_leave_sleep_state ( - u8 sleep_state); + u8 sleep_state); + #endif /* __ACXFACE_H__ */ diff -urN linux-2.4.18/drivers/acpi/include/acresrc.h lia64-2.4/drivers/acpi/include/acresrc.h --- linux-2.4.18/drivers/acpi/include/acresrc.h Mon Sep 24 15:06:42 2001 +++ lia64-2.4/drivers/acpi/include/acresrc.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acresrc.h - Resource Manager function prototypes - * $Revision: 25 $ + * $Revision: 33 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,25 +55,73 @@ acpi_status acpi_rs_create_resource_list ( acpi_operand_object *byte_stream_buffer, - u8 *output_buffer, - u32 *output_buffer_length); + acpi_buffer *output_buffer); acpi_status acpi_rs_create_byte_stream ( acpi_resource *linked_list_buffer, - u8 *output_buffer, - u32 *output_buffer_length); + acpi_buffer *output_buffer); acpi_status acpi_rs_create_pci_routing_table ( - acpi_operand_object *method_return_object, - u8 *output_buffer, - u32 *output_buffer_length); + acpi_operand_object *package_object, + acpi_buffer *output_buffer); /* - *Function prototypes called from Acpi_rs_create*APIs + * Function prototypes called from Acpi_rs_create* */ +void +acpi_rs_dump_irq ( + acpi_resource_data *data); + +void +acpi_rs_dump_address16 ( + acpi_resource_data *data); + +void +acpi_rs_dump_address32 ( + acpi_resource_data *data); + +void +acpi_rs_dump_address64 ( + acpi_resource_data *data); + +void +acpi_rs_dump_dma ( + acpi_resource_data *data); + +void +acpi_rs_dump_io ( + acpi_resource_data *data); + +void +acpi_rs_dump_extended_irq ( + acpi_resource_data *data); + +void +acpi_rs_dump_fixed_io ( + acpi_resource_data *data); + +void +acpi_rs_dump_fixed_memory32 ( + acpi_resource_data *data); + +void +acpi_rs_dump_memory24 ( + acpi_resource_data *data); + +void +acpi_rs_dump_memory32 ( + acpi_resource_data *data); + +void +acpi_rs_dump_start_depend_fns ( + acpi_resource_data *data); + +void +acpi_rs_dump_vendor_specific ( + acpi_resource_data *data); void acpi_rs_dump_resource_list ( @@ -90,228 +138,227 @@ u32 *size); acpi_status -acpi_rs_calculate_list_length ( +acpi_rs_get_list_length ( u8 *byte_stream_buffer, u32 byte_stream_buffer_length, - u32 *size_needed); + ACPI_SIZE *size_needed); acpi_status -acpi_rs_calculate_byte_stream_length ( +acpi_rs_get_byte_stream_length ( acpi_resource *linked_list_buffer, - u32 *size_needed); + ACPI_SIZE *size_needed); acpi_status -acpi_rs_calculate_pci_routing_table_length ( +acpi_rs_get_pci_routing_table_length ( acpi_operand_object *package_object, - u32 *buffer_size_needed); + ACPI_SIZE *buffer_size_needed); acpi_status acpi_rs_byte_stream_to_list ( u8 *byte_stream_buffer, u32 byte_stream_buffer_length, - u8 **output_buffer); + u8 *output_buffer); acpi_status acpi_rs_list_to_byte_stream ( acpi_resource *linked_list, - u32 byte_stream_size_needed, - u8 **output_buffer); + ACPI_SIZE byte_stream_size_needed, + u8 *output_buffer); acpi_status acpi_rs_io_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status acpi_rs_fixed_io_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status acpi_rs_io_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status acpi_rs_fixed_io_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status acpi_rs_irq_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status acpi_rs_irq_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status acpi_rs_dma_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status acpi_rs_dma_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status acpi_rs_address16_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status acpi_rs_address16_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status acpi_rs_address32_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status acpi_rs_address32_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status acpi_rs_address64_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status acpi_rs_address64_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status -acpi_rs_start_dependent_functions_resource ( +acpi_rs_start_depend_fns_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status -acpi_rs_end_dependent_functions_resource ( +acpi_rs_end_depend_fns_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status -acpi_rs_start_dependent_functions_stream ( +acpi_rs_start_depend_fns_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status -acpi_rs_end_dependent_functions_stream ( +acpi_rs_end_depend_fns_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status acpi_rs_memory24_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status acpi_rs_memory24_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status acpi_rs_memory32_range_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size -); + ACPI_SIZE *structure_size); acpi_status acpi_rs_fixed_memory32_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status acpi_rs_memory32_range_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status acpi_rs_fixed_memory32_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status acpi_rs_extended_irq_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status acpi_rs_extended_irq_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status acpi_rs_end_tag_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status acpi_rs_end_tag_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); acpi_status acpi_rs_vendor_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size); + ACPI_SIZE *structure_size); acpi_status acpi_rs_vendor_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed); + ACPI_SIZE *bytes_consumed); u8 acpi_rs_get_resource_type ( diff -urN linux-2.4.18/drivers/acpi/include/acstruct.h lia64-2.4/drivers/acpi/include/acstruct.h --- linux-2.4.18/drivers/acpi/include/acstruct.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/acstruct.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acstruct.h - Internal structs - * $Revision: 10 $ + * $Revision: 19 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,12 +39,14 @@ * the tree (for whatever reason), and for control method execution. */ -#define NEXT_OP_DOWNWARD 1 -#define NEXT_OP_UPWARD 2 +#define ACPI_NEXT_OP_DOWNWARD 1 +#define ACPI_NEXT_OP_UPWARD 2 -#define WALK_NON_METHOD 0 -#define WALK_METHOD 1 -#define WALK_METHOD_RESTART 2 +#define ACPI_WALK_NON_METHOD 0 +#define ACPI_WALK_METHOD 1 +#define ACPI_WALK_METHOD_RESTART 2 +#define ACPI_WALK_CONST_REQUIRED 3 +#define ACPI_WALK_CONST_OPTIONAL 4 typedef struct acpi_walk_state { @@ -56,12 +58,12 @@ u8 num_operands; /* Stack pointer for Operands[] array */ u8 return_used; u8 walk_type; - u16 current_sync_level; /* Mutex Sync (nested acquire) level */ u16 opcode; /* Current AML opcode */ u32 arg_count; /* push for fixed or var args */ u32 aml_offset; u32 arg_types; u32 method_breakpoint; /* For single stepping */ + u32 user_breakpoint; /* User AML breakpoint */ u32 parse_flags; u32 prev_arg_types; @@ -86,49 +88,38 @@ union acpi_operand_obj *return_desc; /* Return object, if any */ acpi_generic_state *scope_info; /* Stack of nested scopes */ -/* TBD: Obsolete with removal of WALK procedure ? */ acpi_parse_object *prev_op; /* Last op that was processed */ acpi_parse_object *next_op; /* next op to be processed */ - - acpi_parse_downwards descending_callback; acpi_parse_upwards ascending_callback; - struct acpi_walk_list *walk_list; + ACPI_THREAD_STATE *thread; struct acpi_walk_state *next; /* Next Walk_state in list */ } acpi_walk_state; -/* - * Walk list - head of a tree of walk states. Multiple walk states are created when there - * are nested control methods executing. - */ -typedef struct acpi_walk_list -{ - - acpi_walk_state *walk_state; - ACPI_OBJECT_MUTEX acquired_mutex_list; /* List of all currently acquired mutexes */ - -} acpi_walk_list; - - /* Info used by Acpi_ps_init_objects */ typedef struct acpi_init_walk_info { u16 method_count; + u16 device_count; u16 op_region_count; u16 field_count; + u16 buffer_count; + u16 package_count; u16 op_region_init; u16 field_init; + u16 buffer_init; + u16 package_init; u16 object_count; acpi_table_desc *table_desc; } acpi_init_walk_info; -/* Info used by TBD */ +/* Info used by Acpi_ns_initialize_devices */ typedef struct acpi_device_walk_info { diff -urN linux-2.4.18/drivers/acpi/include/actables.h lia64-2.4/drivers/acpi/include/actables.h --- linux-2.4.18/drivers/acpi/include/actables.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/actables.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: actables.h - ACPI table management - * $Revision: 32 $ + * $Revision: 41 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,6 +63,15 @@ * tbget - Table "get" routines */ +void +acpi_tb_table_override ( + acpi_table_desc *table_info); + +acpi_status +acpi_tb_get_table_with_override ( + ACPI_POINTER *address, + acpi_table_desc *table_info); + acpi_status acpi_tb_get_table_ptr ( acpi_table_type table_type, @@ -71,22 +80,16 @@ acpi_status acpi_tb_get_table ( - ACPI_PHYSICAL_ADDRESS physical_address, - acpi_table_header *buffer_ptr, + ACPI_POINTER *address, acpi_table_desc *table_info); acpi_status acpi_tb_verify_rsdp ( - ACPI_PHYSICAL_ADDRESS RSDP_physical_address); - -acpi_status -acpi_tb_get_table_facs ( - acpi_table_header *buffer_ptr, - acpi_table_desc *table_info); + ACPI_POINTER *address); -ACPI_PHYSICAL_ADDRESS +void acpi_tb_get_rsdt_address ( - void); + ACPI_POINTER *out_address); acpi_status acpi_tb_validate_rsdt ( @@ -94,9 +97,9 @@ acpi_status acpi_tb_get_table_pointer ( - ACPI_PHYSICAL_ADDRESS physical_address, + ACPI_POINTER *address, u32 flags, - u32 *size, + ACPI_SIZE *size, acpi_table_header **table_ptr); /* @@ -105,8 +108,7 @@ acpi_status acpi_tb_get_all_tables ( - u32 number_of_tables, - acpi_table_header *buffer_ptr); + u32 number_of_tables); /* @@ -115,12 +117,15 @@ acpi_status acpi_tb_install_table ( - acpi_table_header *table_ptr, + acpi_table_desc *table_info); + +acpi_status +acpi_tb_match_signature ( + NATIVE_CHAR *signature, acpi_table_desc *table_info); acpi_status acpi_tb_recognize_table ( - acpi_table_header *table_ptr, acpi_table_desc *table_info); acpi_status @@ -178,9 +183,16 @@ */ acpi_status +acpi_tb_find_table ( + NATIVE_CHAR *signature, + NATIVE_CHAR *oem_id, + NATIVE_CHAR *oem_table_id, + acpi_table_header **table_ptr); + +acpi_status acpi_tb_map_acpi_table ( ACPI_PHYSICAL_ADDRESS physical_address, - u32 *size, + ACPI_SIZE *size, acpi_table_header **logical_address); acpi_status diff -urN linux-2.4.18/drivers/acpi/include/actbl.h lia64-2.4/drivers/acpi/include/actbl.h --- linux-2.4.18/drivers/acpi/include/actbl.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/actbl.h Tue Apr 9 15:46:59 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: actbl.h - Table data structures defined in ACPI specification - * $Revision: 46 $ + * $Revision: 52 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,6 @@ /* * Values for description table header signatures */ - #define RSDP_NAME "RSDP" #define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ #define APIC_SIG "APIC" /* Multiple APIC Description Table */ @@ -42,7 +41,7 @@ #define XSDT_SIG "XSDT" /* Extended System Description Table */ #define SSDT_SIG "SSDT" /* Secondary System Description Table */ #define SBST_SIG "SBST" /* Smart Battery Specification Table */ -#define SPIC_SIG "SPIC" /* iosapic table */ +#define SPIC_SIG "SPIC" /* IOSAPIC table */ #define BOOT_SIG "BOOT" /* Boot table */ @@ -75,29 +74,27 @@ * Architecture-independent tables * The architecture dependent tables are in separate files */ - typedef struct /* Root System Descriptor Pointer */ { - NATIVE_CHAR signature [8]; /* contains "RSD PTR " */ - u8 checksum; /* to make sum of struct == 0 */ + NATIVE_CHAR signature [8]; /* ACPI signature, contains "RSD PTR " */ + u8 checksum; /* To make sum of struct == 0 */ NATIVE_CHAR oem_id [6]; /* OEM identification */ u8 revision; /* Must be 0 for 1.0, 2 for 2.0 */ u32 rsdt_physical_address; /* 32-bit physical address of RSDT */ u32 length; /* XSDT Length in bytes including hdr */ u64 xsdt_physical_address; /* 64-bit physical address of XSDT */ u8 extended_checksum; /* Checksum of entire table */ - NATIVE_CHAR reserved [3]; /* reserved field must be 0 */ + NATIVE_CHAR reserved [3]; /* Reserved field must be 0 */ } RSDP_DESCRIPTOR; typedef struct /* ACPI common table header */ { - NATIVE_CHAR signature [4]; /* identifies type of table */ - u32 length; /* length of table, in bytes, - * including header */ - u8 revision; /* specification minor version # */ - u8 checksum; /* to make sum of entire table == 0 */ + NATIVE_CHAR signature [4]; /* ACPI signature (4 ASCII characters) */ + u32 length; /* Length of table, in bytes, including header */ + u8 revision; /* ACPI Specification minor version # */ + u8 checksum; /* To make sum of entire table == 0 */ NATIVE_CHAR oem_id [6]; /* OEM identification */ NATIVE_CHAR oem_table_id [8]; /* OEM table identification */ u32 oem_revision; /* OEM revision number */ @@ -118,7 +115,7 @@ typedef struct /* APIC Table */ { - acpi_table_header header; /* table header */ + acpi_table_header header; /* ACPI table header */ u32 local_apic_address; /* Physical address for accessing local APICs */ u32 PCATcompat : 1; /* a one indicates system also has dual 8259s */ u32 reserved1 : 31; @@ -138,7 +135,7 @@ { APIC_HEADER header; u8 processor_apic_id; /* ACPI processor id */ - u8 local_apic_id; /* processor's local APIC id */ + u8 local_apic_id; /* Processor's local APIC id */ u32 processor_enabled: 1; /* Processor is usable if set */ u32 reserved1 : 31; @@ -149,21 +146,21 @@ { APIC_HEADER header; u8 io_apic_id; /* I/O APIC ID */ - u8 reserved; /* reserved - must be zero */ + u8 reserved; /* Reserved - must be zero */ u32 io_apic_address; /* APIC's physical address */ - u32 vector; /* interrupt vector index where INTI + u32 vector; /* Interrupt vector index where INTI * lines start */ } IO_APIC; /* -** IA64 TODO: Add SAPIC Tables -*/ + * IA64 TBD: Add SAPIC Tables + */ /* -** IA64 TODO: Modify Smart Battery Description to comply with ACPI IA64 -** extensions. -*/ + * IA64 TBD: Modify Smart Battery Description to comply with ACPI IA64 + * extensions. + */ typedef struct /* Smart Battery Description Table */ { acpi_table_header header; @@ -182,7 +179,6 @@ * and type of memory allocation (mapped or allocated) for each * table for 1) when we exit, and 2) if a new table is installed */ - #define ACPI_MEM_NOT_ALLOCATED 0 #define ACPI_MEM_ALLOCATED 1 #define ACPI_MEM_MAPPED 2 @@ -191,7 +187,7 @@ #define ACPI_TABLE_SINGLE 0 #define ACPI_TABLE_MULTIPLE 1 - +#define ACPI_TABLE_EXECUTABLE 2 /* Data about each known table type */ @@ -199,19 +195,17 @@ { NATIVE_CHAR *name; NATIVE_CHAR *signature; + void **global_ptr; u8 sig_length; u8 flags; - u16 status; - void **global_ptr; } ACPI_TABLE_SUPPORT; + /* * Get the architecture-specific tables */ - -#include "actbl1.h" /* Acpi 1.0 table defintions */ -#include "actbl71.h" /* Acpi 0.71 IA-64 Extension table defintions */ +#include "actbl1.h" /* Acpi 1.0 table definitions */ #include "actbl2.h" /* Acpi 2.0 table definitions */ #endif /* __ACTBL_H__ */ diff -urN linux-2.4.18/drivers/acpi/include/actbl1.h lia64-2.4/drivers/acpi/include/actbl1.h --- linux-2.4.18/drivers/acpi/include/actbl1.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/actbl1.h Tue Apr 9 15:46:59 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: actbl1.h - ACPI 1.0 tables - * $Revision: 17 $ + * $Revision: 21 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,91 +28,88 @@ #pragma pack(1) -/*************************************/ -/* ACPI Specification Rev 1.0 for */ -/* the Root System Description Table */ -/*************************************/ +/* + * ACPI 1.0 Root System Description Table (RSDT) + */ typedef struct { - acpi_table_header header; /* Table header */ + acpi_table_header header; /* ACPI Table header */ u32 table_offset_entry [1]; /* Array of pointers to other */ /* ACPI tables */ } RSDT_DESCRIPTOR_REV1; -/***************************************/ -/* ACPI Specification Rev 1.0 for */ -/* the Firmware ACPI Control Structure */ -/***************************************/ +/* + * ACPI 1.0 Firmware ACPI Control Structure (FACS) + */ typedef struct { - NATIVE_CHAR signature[4]; /* signature "FACS" */ - u32 length; /* length of structure, in bytes */ - u32 hardware_signature; /* hardware configuration signature */ + NATIVE_CHAR signature[4]; /* ACPI Signature */ + u32 length; /* Length of structure, in bytes */ + u32 hardware_signature; /* Hardware configuration signature */ u32 firmware_waking_vector; /* ACPI OS waking vector */ u32 global_lock; /* Global Lock */ u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */ - u32 reserved1 : 31; /* must be 0 */ - u8 resverved3 [40]; /* reserved - must be zero */ + u32 reserved1 : 31; /* Must be 0 */ + u8 resverved3 [40]; /* Reserved - must be zero */ } facs_descriptor_rev1; -/************************************/ -/* ACPI Specification Rev 1.0 for */ -/* the Fixed ACPI Description Table */ -/************************************/ +/* + * ACPI 1.0 Fixed ACPI Description Table (FADT) + */ typedef struct { - acpi_table_header header; /* table header */ + acpi_table_header header; /* ACPI Table header */ u32 firmware_ctrl; /* Physical address of FACS */ u32 dsdt; /* Physical address of DSDT */ u8 model; /* System Interrupt Model */ - u8 reserved1; /* reserved */ + u8 reserved1; /* Reserved */ u16 sci_int; /* System vector of SCI interrupt */ u32 smi_cmd; /* Port address of SMI command port */ - u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */ - u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */ + u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ + u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ - u8 reserved2; /* reserved - must be zero */ + u8 reserved2; /* Reserved - must be zero */ u32 pm1a_evt_blk; /* Port address of Power Mgt 1a Acpi_event Reg Blk */ u32 pm1b_evt_blk; /* Port address of Power Mgt 1b Acpi_event Reg Blk */ u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ u32 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ u32 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ u32 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ - u32 gpe0blk; /* Port addr of General Purpose Acpi_event 0 Reg Blk */ + u32 gpe0_blk; /* Port addr of General Purpose Acpi_event 0 Reg Blk */ u32 gpe1_blk; /* Port addr of General Purpose Acpi_event 1 Reg Blk */ u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */ u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */ u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ - u8 gpe0blk_len; /* Byte Length of ports at gpe0_blk */ + u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ - u8 gpe1_base; /* offset in gpe model where gpe1 events start */ - u8 reserved3; /* reserved */ - u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */ - u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */ + u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ + u8 reserved3; /* Reserved */ + u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ + u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ u16 flush_size; /* Size of area read to flush caches */ u16 flush_stride; /* Stride used in flushing caches */ - u8 duty_offset; /* bit location of duty cycle field in p_cnt reg */ - u8 duty_width; /* bit width of duty cycle field in p_cnt reg */ - u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */ - u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */ - u8 century; /* index to century in RTC CMOS RAM */ - u8 reserved4; /* reserved */ - u8 reserved4a; /* reserved */ - u8 reserved4b; /* reserved */ - u32 wb_invd : 1; /* wbinvd instruction works properly */ - u32 wb_invd_flush : 1; /* wbinvd flushes but does not invalidate */ - u32 proc_c1 : 1; /* all processors support C1 state */ + u8 duty_offset; /* Bit location of duty cycle field in p_cnt reg */ + u8 duty_width; /* Bit width of duty cycle field in p_cnt reg */ + u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ + u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ + u8 century; /* Index to century in RTC CMOS RAM */ + u8 reserved4; /* Reserved */ + u8 reserved4a; /* Reserved */ + u8 reserved4b; /* Reserved */ + u32 wb_invd : 1; /* The wbinvd instruction works properly */ + u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */ + u32 proc_c1 : 1; /* All processors support C1 state */ u32 plvl2_up : 1; /* C2 state works on MP system */ u32 pwr_button : 1; /* Power button is handled as a generic feature */ u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ - u32 tmr_val_ext : 1; /* tmr_val is 32 bits */ - u32 reserved5 : 23; /* reserved - must be zero */ + u32 tmr_val_ext : 1; /* The tmr_val width is 32 bits (0 = 24 bits) */ + u32 reserved5 : 23; /* Reserved - must be zero */ } fadt_descriptor_rev1; diff -urN linux-2.4.18/drivers/acpi/include/actbl2.h lia64-2.4/drivers/acpi/include/actbl2.h --- linux-2.4.18/drivers/acpi/include/actbl2.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/actbl2.h Tue Apr 9 15:46:59 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: actbl2.h - ACPI Specification Revision 2.0 Tables - * $Revision: 24 $ + * $Revision: 27 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,48 +49,48 @@ #pragma pack(1) /* - * ACPI Specification Rev 2.0 for the Root System Description Table + * ACPI 2.0 Root System Description Table (RSDT) */ typedef struct { - acpi_table_header header; /* Table header */ + acpi_table_header header; /* ACPI table header */ u32 table_offset_entry [1]; /* Array of pointers to */ - /* other tables' headers */ + /* ACPI table headers */ } RSDT_DESCRIPTOR_REV2; /* - * ACPI Specification Rev 2.0 for the Extended System Description Table (XSDT) + * ACPI 2.0 Extended System Description Table (XSDT) */ typedef struct { - acpi_table_header header; /* Table header */ + acpi_table_header header; /* ACPI table header */ u64 table_offset_entry [1]; /* Array of pointers to */ - /* other tables' headers */ + /* ACPI table headers */ } XSDT_DESCRIPTOR_REV2; /* - * ACPI Specification Rev 2.0 for the Firmware ACPI Control Structure + * ACPI 2.0 Firmware ACPI Control Structure (FACS) */ typedef struct { - NATIVE_CHAR signature[4]; /* signature "FACS" */ - u32 length; /* length of structure, in bytes */ - u32 hardware_signature; /* hardware configuration signature */ + NATIVE_CHAR signature[4]; /* ACPI signature */ + u32 length; /* Length of structure, in bytes */ + u32 hardware_signature; /* Hardware configuration signature */ u32 firmware_waking_vector; /* 32bit physical address of the Firmware Waking Vector. */ u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */ - u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */ - u32 reserved1 : 31; /* must be 0 */ + u32 S4bios_f : 1; /* S4Bios_f - Indicates if S4BIOS support is present */ + u32 reserved1 : 31; /* Must be 0 */ u64 Xfirmware_waking_vector; /* 64bit physical address of the Firmware Waking Vector. */ u8 version; /* Version of this table */ - u8 reserved3 [31]; /* reserved - must be zero */ + u8 reserved3 [31]; /* Reserved - must be zero */ } facs_descriptor_rev2; /* - * ACPI Specification Rev 2.0 for the Generic Address Structure (GAS) + * ACPI 2.0 Generic Address Structure (GAS) */ typedef struct { @@ -104,64 +104,64 @@ /* - * ACPI Specification Rev 2.0 for the Fixed ACPI Description Table + * ACPI 2.0 Fixed ACPI Description Table (FADT) */ typedef struct { - acpi_table_header header; /* table header */ + acpi_table_header header; /* ACPI table header */ u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ u32 V1_dsdt; /* 32-bit physical address of DSDT */ u8 reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ u8 prefer_PM_profile; /* Conveys preferred power management profile to OSPM. */ u16 sci_int; /* System vector of SCI interrupt */ u32 smi_cmd; /* Port address of SMI command port */ - u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */ - u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */ + u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ + u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ - u8 pstate_cnt; /* processor performance state control*/ + u8 pstate_cnt; /* Processor performance state control*/ u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a Acpi_event Reg Blk */ u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b Acpi_event Reg Blk */ u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ - u32 V1_gpe0blk; /* Port addr of General Purpose Acpi_event 0 Reg Blk */ + u32 V1_gpe0_blk; /* Port addr of General Purpose Acpi_event 0 Reg Blk */ u32 V1_gpe1_blk; /* Port addr of General Purpose Acpi_event 1 Reg Blk */ u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */ u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */ u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ - u8 gpe0blk_len; /* Byte Length of ports at gpe0_blk */ + u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ - u8 gpe1_base; /* offset in gpe model where gpe1 events start */ + u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ u8 cst_cnt; /* Support for the _CST object and C States change notification.*/ - u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */ - u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */ - u16 flush_size; /* number of flush strides that need to be read */ + u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ + u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ + u16 flush_size; /* Number of flush strides that need to be read */ u16 flush_stride; /* Processor's memory cache line width, in bytes */ u8 duty_offset; /* Processor_’s duty cycle index in processor's P_CNT reg*/ u8 duty_width; /* Processor_’s duty cycle value bit width in P_CNT register.*/ - u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */ - u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */ - u8 century; /* index to century in RTC CMOS RAM */ + u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ + u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ + u8 century; /* Index to century in RTC CMOS RAM */ u16 iapc_boot_arch; /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/ - u8 reserved2; /* reserved */ - u32 wb_invd : 1; /* wbinvd instruction works properly */ - u32 wb_invd_flush : 1; /* wbinvd flushes but does not invalidate */ - u32 proc_c1 : 1; /* all processors support C1 state */ + u8 reserved2; /* Reserved */ + u32 wb_invd : 1; /* The wbinvd instruction works properly */ + u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */ + u32 proc_c1 : 1; /* All processors support C1 state */ u32 plvl2_up : 1; /* C2 state works on MP system */ u32 pwr_button : 1; /* Power button is handled as a generic feature */ u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ - u32 tmr_val_ext : 1; /* tmr_val is 32 bits */ + u32 tmr_val_ext : 1; /* Indicates tmr_val is 32 bits 0=24-bits*/ u32 dock_cap : 1; /* Supports Docking */ u32 reset_reg_sup : 1; /* Indicates system supports system reset via the FADT RESET_REG*/ u32 sealed_case : 1; /* Indicates system has no internal expansion capabilities and case is sealed. */ u32 headless : 1; /* Indicates system does not have local video capabilities or local input devices.*/ u32 cpu_sw_sleep : 1; /* Indicates to OSPM that a processor native instruction */ - /* must be executed after writing the SLP_TYPx register. */ - u32 reserved6 : 18; /* reserved - must be zero */ + /* Must be executed after writing the SLP_TYPx register. */ + u32 reserved6 : 18; /* Reserved - must be zero */ acpi_generic_address reset_register; /* Reset register address in GAS format */ u8 reset_value; /* Value to write to the Reset_register port to reset the system. */ @@ -174,7 +174,7 @@ acpi_generic_address Xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */ acpi_generic_address Xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */ acpi_generic_address Xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ - acpi_generic_address Xgpe0blk; /* Extended General Purpose Acpi_event 0 Reg Blk address */ + acpi_generic_address Xgpe0_blk; /* Extended General Purpose Acpi_event 0 Reg Blk address */ acpi_generic_address Xgpe1_blk; /* Extended General Purpose Acpi_event 1 Reg Blk address */ } fadt_descriptor_rev2; diff -urN linux-2.4.18/drivers/acpi/include/actbl71.h lia64-2.4/drivers/acpi/include/actbl71.h --- linux-2.4.18/drivers/acpi/include/actbl71.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/actbl71.h Tue Apr 9 15:46:59 2002 @@ -3,12 +3,12 @@ * Name: actbl71.h - IA-64 Extensions to the ACPI Spec Rev. 0.71 * This file includes tables specific to this * specification revision. - * $Revision: 11 $ + * $Revision: 12 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -111,13 +111,13 @@ u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ - u64 gpe0blk; /* Port addr of General Purpose Acpi_event 0 Reg Blk */ + u64 gpe0_blk; /* Port addr of General Purpose Acpi_event 0 Reg Blk */ u64 gpe1_blk; /* Port addr of General Purpose Acpi_event 1 Reg Blk */ u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */ u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */ u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ - u8 gpe0blk_len; /* Byte Length of ports at gpe0_blk */ + u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ u8 gpe1_base; /* offset in gpe model where gpe1 events start */ u8 reserved3; /* reserved */ diff -urN linux-2.4.18/drivers/acpi/include/actypes.h lia64-2.4/drivers/acpi/include/actypes.h --- linux-2.4.18/drivers/acpi/include/actypes.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/actypes.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: actypes.h - Common data types for the entire ACPI subsystem - * $Revision: 193 $ + * $Revision: 237 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,13 +28,23 @@ /*! [Begin] no source code translation (keep the typedefs) */ + + +/* + * Data type ranges + */ +#define ACPI_UINT8_MAX (UINT8) 0xFF +#define ACPI_UINT16_MAX (UINT16) 0xFFFF +#define ACPI_UINT32_MAX (UINT32) 0xFFFFFFFF +#define ACPI_UINT64_MAX (UINT64) 0xFFFFFFFFFFFFFFFF +#define ACPI_ASCII_MAX 0x7F + + + /* * Data types - Fixed across all compilation models * * BOOLEAN Logical Boolean. - * 1 byte value containing a 0 for FALSE or a 1 for TRUE. - * Other values are undefined. - * * INT8 8-bit (1 byte) signed value * UINT8 8-bit (1 byte) unsigned value * INT16 16-bit (2 byte) signed value @@ -45,40 +55,47 @@ * UINT64 64-bit (8 byte) unsigned value * NATIVE_INT 32-bit on IA-32, 64-bit on IA-64 signed value * NATIVE_UINT 32-bit on IA-32, 64-bit on IA-64 unsigned value - * UCHAR Character. 1 byte unsigned value. */ +#ifndef ACPI_MACHINE_WIDTH +#error ACPI_MACHINE_WIDTH not defined +#endif -#ifdef _IA64 +#if ACPI_MACHINE_WIDTH == 64 /* * 64-bit type definitions */ typedef unsigned char UINT8; typedef unsigned char BOOLEAN; -typedef unsigned char UCHAR; typedef unsigned short UINT16; typedef int INT32; typedef unsigned int UINT32; +typedef COMPILER_DEPENDENT_INT64 INT64; typedef COMPILER_DEPENDENT_UINT64 UINT64; -typedef UINT64 NATIVE_UINT; typedef INT64 NATIVE_INT; +typedef UINT64 NATIVE_UINT; -typedef NATIVE_UINT ACPI_TBLPTR; +typedef UINT32 NATIVE_UINT_MAX32; +typedef UINT64 NATIVE_UINT_MIN32; + +typedef UINT64 ACPI_TBLPTR; typedef UINT64 ACPI_IO_ADDRESS; typedef UINT64 ACPI_PHYSICAL_ADDRESS; +typedef UINT64 ACPI_SIZE; #define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */ #define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */ +#define ACPI_MAX_PTR ACPI_UINT64_MAX +#define ACPI_SIZE_MAX ACPI_UINT64_MAX -#elif _IA16 +#elif ACPI_MACHINE_WIDTH == 16 /* * 16-bit type definitions */ typedef unsigned char UINT8; typedef unsigned char BOOLEAN; -typedef unsigned char UCHAR; typedef unsigned int UINT16; typedef long INT32; typedef int INT16; @@ -94,13 +111,19 @@ typedef UINT16 NATIVE_UINT; typedef INT16 NATIVE_INT; +typedef UINT16 NATIVE_UINT_MAX32; +typedef UINT32 NATIVE_UINT_MIN32; + typedef UINT32 ACPI_TBLPTR; typedef UINT32 ACPI_IO_ADDRESS; typedef char *ACPI_PHYSICAL_ADDRESS; +typedef UINT16 ACPI_SIZE; #define ALIGNED_ADDRESS_BOUNDARY 0x00000002 #define _HW_ALIGNMENT_SUPPORT #define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ +#define ACPI_MAX_PTR ACPI_UINT16_MAX +#define ACPI_SIZE_MAX ACPI_UINT16_MAX /* * (16-bit only) internal integers must be 32-bits, so @@ -109,29 +132,37 @@ #define ACPI_NO_INTEGER64_SUPPORT -#else +#elif ACPI_MACHINE_WIDTH == 32 /* * 32-bit type definitions (default) */ typedef unsigned char UINT8; typedef unsigned char BOOLEAN; -typedef unsigned char UCHAR; typedef unsigned short UINT16; typedef int INT32; typedef unsigned int UINT32; +typedef COMPILER_DEPENDENT_INT64 INT64; typedef COMPILER_DEPENDENT_UINT64 UINT64; -typedef UINT32 NATIVE_UINT; typedef INT32 NATIVE_INT; +typedef UINT32 NATIVE_UINT; -typedef NATIVE_UINT ACPI_TBLPTR; +typedef UINT32 NATIVE_UINT_MAX32; +typedef UINT32 NATIVE_UINT_MIN32; + +typedef UINT64 ACPI_TBLPTR; typedef UINT32 ACPI_IO_ADDRESS; typedef UINT64 ACPI_PHYSICAL_ADDRESS; +typedef UINT32 ACPI_SIZE; #define ALIGNED_ADDRESS_BOUNDARY 0x00000004 #define _HW_ALIGNMENT_SUPPORT -#endif +#define ACPI_MAX_PTR ACPI_UINT32_MAX +#define ACPI_SIZE_MAX ACPI_UINT32_MAX +#else +#error unknown ACPI_MACHINE_WIDTH +#endif /* @@ -143,19 +174,10 @@ typedef char NATIVE_CHAR; -/* - * Data type ranges - */ - -#define ACPI_UINT8_MAX (UINT8) 0xFF -#define ACPI_UINT16_MAX (UINT16) 0xFFFF -#define ACPI_UINT32_MAX (UINT32) 0xFFFFFFFF -#define ACPI_UINT64_MAX (UINT64) 0xFFFFFFFFFFFFFFFF - - #ifdef DEFINE_ALTERNATE_TYPES /* - * Types used only in translated source + * Types used only in translated source, defined here to enable + * cross-platform compilation only. */ typedef INT32 s32; typedef UINT8 u8; @@ -167,6 +189,31 @@ /* + * Pointer overlays to avoid lots of typecasting for + * code that accepts both physical and logical pointers. + */ +typedef union acpi_ptrs +{ + ACPI_PHYSICAL_ADDRESS physical; + void *logical; + ACPI_TBLPTR value; + +} ACPI_POINTERS; + +typedef struct acpi_pointer +{ + u32 pointer_type; + union acpi_ptrs pointer; + +} ACPI_POINTER; + +/* Pointer_types for above */ + +#define ACPI_LOGICAL_POINTER 0x01 +#define ACPI_PHYSICAL_POINTER 0x02 + + +/* * Useful defines */ @@ -208,6 +255,13 @@ } uint64_overlay; +typedef struct +{ + u32 lo; + u32 hi; + +} UINT32_STRUCT; + /* * Acpi integer width. In ACPI version 1, integers are @@ -241,7 +295,7 @@ #define ACPI_MAX_BCD_DIGITS 16 #define ACPI_MAX_DECIMAL_DIGITS 19 -#ifdef _IA64 +#if ACPI_MACHINE_WIDTH == 64 #define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */ #endif #endif @@ -251,7 +305,7 @@ * Constants with special meanings */ -#define ACPI_ROOT_OBJECT (acpi_handle)(-1) +#define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR) /* @@ -261,9 +315,10 @@ #define ACPI_NO_ADDRESS_SPACE_INIT 0x01 #define ACPI_NO_HARDWARE_INIT 0x02 #define ACPI_NO_EVENT_INIT 0x04 -#define ACPI_NO_ACPI_ENABLE 0x08 -#define ACPI_NO_DEVICE_INIT 0x10 -#define ACPI_NO_OBJECT_INIT 0x20 +#define ACPI_NO_HANDLER_INIT 0x08 +#define ACPI_NO_ACPI_ENABLE 0x10 +#define ACPI_NO_DEVICE_INIT 0x20 +#define ACPI_NO_OBJECT_INIT 0x40 /* * Initialization state @@ -292,6 +347,19 @@ #define ACPI_D_STATES_MAX ACPI_STATE_D3 #define ACPI_D_STATE_COUNT 4 +#define ACPI_STATE_C0 (u8) 0 +#define ACPI_STATE_C1 (u8) 1 +#define ACPI_STATE_C2 (u8) 2 +#define ACPI_STATE_C3 (u8) 3 +#define ACPI_C_STATES_MAX ACPI_STATE_C3 +#define ACPI_C_STATE_COUNT 4 + +/* + * Sleep type invalid value + */ +#define ACPI_SLEEP_TYPE_MAX 0x7 +#define ACPI_SLEEP_TYPE_INVALID 0xFF + /* * Standard notify values */ @@ -326,35 +394,33 @@ * Types associated with names. The first group of * values correspond to the definition of the ACPI * Object_type operator (See the ACPI Spec). Therefore, - * only add to the first group if the spec changes! + * only add to the first group if the spec changes. * * Types must be kept in sync with the Acpi_ns_properties * and Acpi_ns_type_names arrays */ typedef u32 acpi_object_type; -typedef u8 acpi_object_type8; +#define ACPI_TYPE_ANY 0x00 +#define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */ +#define ACPI_TYPE_STRING 0x02 +#define ACPI_TYPE_BUFFER 0x03 +#define ACPI_TYPE_PACKAGE 0x04 /* Byte_const, multiple Data_term/Constant/Super_name */ +#define ACPI_TYPE_FIELD_UNIT 0x05 +#define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */ +#define ACPI_TYPE_EVENT 0x07 +#define ACPI_TYPE_METHOD 0x08 /* Name, Byte_const, multiple Code */ +#define ACPI_TYPE_MUTEX 0x09 +#define ACPI_TYPE_REGION 0x0A +#define ACPI_TYPE_POWER 0x0B /* Name,Byte_const,Word_const,multi Node */ +#define ACPI_TYPE_PROCESSOR 0x0C /* Name,Byte_const,DWord_const,Byte_const,multi Nm_o */ +#define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */ +#define ACPI_TYPE_BUFFER_FIELD 0x0E +#define ACPI_TYPE_DDB_HANDLE 0x0F +#define ACPI_TYPE_DEBUG_OBJECT 0x10 -#define ACPI_TYPE_ANY 0 /* 0x00 */ -#define ACPI_TYPE_INTEGER 1 /* 0x01 Byte/Word/Dword/Zero/One/Ones */ -#define ACPI_TYPE_STRING 2 /* 0x02 */ -#define ACPI_TYPE_BUFFER 3 /* 0x03 */ -#define ACPI_TYPE_PACKAGE 4 /* 0x04 Byte_const, multiple Data_term/Constant/Super_name */ -#define ACPI_TYPE_FIELD_UNIT 5 /* 0x05 */ -#define ACPI_TYPE_DEVICE 6 /* 0x06 Name, multiple Node */ -#define ACPI_TYPE_EVENT 7 /* 0x07 */ -#define ACPI_TYPE_METHOD 8 /* 0x08 Name, Byte_const, multiple Code */ -#define ACPI_TYPE_MUTEX 9 /* 0x09 */ -#define ACPI_TYPE_REGION 10 /* 0x0A */ -#define ACPI_TYPE_POWER 11 /* 0x0B Name,Byte_const,Word_const,multi Node */ -#define ACPI_TYPE_PROCESSOR 12 /* 0x0C Name,Byte_const,DWord_const,Byte_const,multi Nm_o */ -#define ACPI_TYPE_THERMAL 13 /* 0x0D Name, multiple Node */ -#define ACPI_TYPE_BUFFER_FIELD 14 /* 0x0E */ -#define ACPI_TYPE_DDB_HANDLE 15 /* 0x0F */ -#define ACPI_TYPE_DEBUG_OBJECT 16 /* 0x10 */ - -#define ACPI_TYPE_MAX 16 +#define ACPI_TYPE_MAX 0x10 /* * This section contains object types that do not relate to the ACPI Object_type operator. @@ -363,36 +429,37 @@ * Also, values exceeding the largest official ACPI Object_type must not overlap with * defined AML opcodes. */ -#define INTERNAL_TYPE_BEGIN 17 +#define INTERNAL_TYPE_BEGIN 0x11 -#define INTERNAL_TYPE_REGION_FIELD 17 /* 0x11 */ -#define INTERNAL_TYPE_BANK_FIELD 18 /* 0x12 */ -#define INTERNAL_TYPE_INDEX_FIELD 19 /* 0x13 */ -#define INTERNAL_TYPE_REFERENCE 20 /* 0x14 Arg#, Local#, Name, Debug; used only in descriptors */ -#define INTERNAL_TYPE_ALIAS 21 /* 0x15 */ -#define INTERNAL_TYPE_NOTIFY 22 /* 0x16 */ -#define INTERNAL_TYPE_ADDRESS_HANDLER 23 /* 0x17 */ -#define INTERNAL_TYPE_RESOURCE 24 /* 0x18 */ -#define INTERNAL_TYPE_RESOURCE_FIELD 25 /* 0x19 */ +#define INTERNAL_TYPE_REGION_FIELD 0x11 +#define INTERNAL_TYPE_BANK_FIELD 0x12 +#define INTERNAL_TYPE_INDEX_FIELD 0x13 +#define INTERNAL_TYPE_REFERENCE 0x14 /* Arg#, Local#, Name, Debug; used only in descriptors */ +#define INTERNAL_TYPE_ALIAS 0x15 +#define INTERNAL_TYPE_NOTIFY 0x16 +#define INTERNAL_TYPE_ADDRESS_HANDLER 0x17 +#define INTERNAL_TYPE_RESOURCE 0x18 +#define INTERNAL_TYPE_RESOURCE_FIELD 0x19 -#define INTERNAL_TYPE_NODE_MAX 25 +#define INTERNAL_TYPE_NODE_MAX 0x19 /* These are pseudo-types because there are never any namespace nodes with these types */ -#define INTERNAL_TYPE_FIELD_DEFN 26 /* 0x1A Name, Byte_const, multiple Field_element */ -#define INTERNAL_TYPE_BANK_FIELD_DEFN 27 /* 0x1B 2 Name,DWord_const,Byte_const,multi Field_element */ -#define INTERNAL_TYPE_INDEX_FIELD_DEFN 28 /* 0x1C 2 Name, Byte_const, multiple Field_element */ -#define INTERNAL_TYPE_IF 29 /* 0x1D */ -#define INTERNAL_TYPE_ELSE 30 /* 0x1E */ -#define INTERNAL_TYPE_WHILE 31 /* 0x1F */ -#define INTERNAL_TYPE_SCOPE 32 /* 0x20 Name, multiple Node */ -#define INTERNAL_TYPE_DEF_ANY 33 /* 0x21 type is Any, suppress search of enclosing scopes */ -#define INTERNAL_TYPE_EXTRA 34 /* 0x22 */ +#define INTERNAL_TYPE_FIELD_DEFN 0x1A /* Name, Byte_const, multiple Field_element */ +#define INTERNAL_TYPE_BANK_FIELD_DEFN 0x1B /* 2 Name,DWord_const,Byte_const,multi Field_element */ +#define INTERNAL_TYPE_INDEX_FIELD_DEFN 0x1C /* 2 Name, Byte_const, multiple Field_element */ +#define INTERNAL_TYPE_IF 0x1D +#define INTERNAL_TYPE_ELSE 0x1E +#define INTERNAL_TYPE_WHILE 0x1F +#define INTERNAL_TYPE_SCOPE 0x20 /* Name, multiple Node */ +#define INTERNAL_TYPE_DEF_ANY 0x21 /* type is Any, suppress search of enclosing scopes */ +#define INTERNAL_TYPE_EXTRA 0x22 +#define INTERNAL_TYPE_DATA 0x23 -#define INTERNAL_TYPE_MAX 34 +#define INTERNAL_TYPE_MAX 0x23 -#define INTERNAL_TYPE_INVALID 35 +#define INTERNAL_TYPE_INVALID 0x24 #define ACPI_TYPE_NOT_FOUND 0xFF @@ -428,51 +495,48 @@ #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF +/* + * All I/O + */ +#define ACPI_READ 0 +#define ACPI_WRITE 1 + /* - * Acpi_event Types: - * ------------ - * Fixed & general purpose... + * Acpi_event Types: Fixed & General Purpose */ typedef u32 acpi_event_type; -#define ACPI_EVENT_FIXED (acpi_event_type) 0 -#define ACPI_EVENT_GPE (acpi_event_type) 1 +#define ACPI_EVENT_FIXED 0 +#define ACPI_EVENT_GPE 1 /* * Fixed events */ -#define ACPI_EVENT_PMTIMER (acpi_event_type) 0 - /* - * There's no bus master event so index 1 is used for IRQ's that are not - * handled by the SCI handler - */ -#define ACPI_EVENT_NOT_USED (acpi_event_type) 1 -#define ACPI_EVENT_GLOBAL (acpi_event_type) 2 -#define ACPI_EVENT_POWER_BUTTON (acpi_event_type) 3 -#define ACPI_EVENT_SLEEP_BUTTON (acpi_event_type) 4 -#define ACPI_EVENT_RTC (acpi_event_type) 5 -#define ACPI_EVENT_GENERAL (acpi_event_type) 6 -#define ACPI_EVENT_MAX 6 -#define ACPI_NUM_FIXED_EVENTS (acpi_event_type) 7 +#define ACPI_EVENT_PMTIMER 0 +#define ACPI_EVENT_GLOBAL 1 +#define ACPI_EVENT_POWER_BUTTON 2 +#define ACPI_EVENT_SLEEP_BUTTON 3 +#define ACPI_EVENT_RTC 4 +#define ACPI_EVENT_MAX 4 +#define ACPI_NUM_FIXED_EVENTS ACPI_EVENT_MAX + 1 #define ACPI_GPE_INVALID 0xFF #define ACPI_GPE_MAX 0xFF #define ACPI_NUM_GPE 256 -#define ACPI_EVENT_LEVEL_TRIGGERED (acpi_event_type) 1 -#define ACPI_EVENT_EDGE_TRIGGERED (acpi_event_type) 2 +#define ACPI_EVENT_LEVEL_TRIGGERED 1 +#define ACPI_EVENT_EDGE_TRIGGERED 2 /* * GPEs */ -#define ACPI_EVENT_ENABLE 0x1 -#define ACPI_EVENT_WAKE_ENABLE 0x2 -#define ACPI_EVENT_DISABLE 0x1 -#define ACPI_EVENT_WAKE_DISABLE 0x2 +#define ACPI_EVENT_WAKE_ENABLE 0x1 + +#define ACPI_EVENT_WAKE_DISABLE 0x1 /* @@ -504,7 +568,7 @@ #define ACPI_DEVICE_NOTIFY 1 #define ACPI_MAX_NOTIFY_HANDLER_TYPE 1 -#define MAX_SYS_NOTIFY 0x7f +#define ACPI_MAX_SYS_NOTIFY 0x7f /* Address Space (Operation Region) Types */ @@ -518,9 +582,41 @@ #define ACPI_ADR_SPACE_SMBUS (ACPI_ADR_SPACE_TYPE) 4 #define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5 #define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6 +#define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 7 /* + * Bit_register IDs + * These are bitfields defined within the full ACPI registers + */ +#define ACPI_BITREG_TIMER_STATUS 0x00 +#define ACPI_BITREG_BUS_MASTER_STATUS 0x01 +#define ACPI_BITREG_GLOBAL_LOCK_STATUS 0x02 +#define ACPI_BITREG_POWER_BUTTON_STATUS 0x03 +#define ACPI_BITREG_SLEEP_BUTTON_STATUS 0x04 +#define ACPI_BITREG_RT_CLOCK_STATUS 0x05 +#define ACPI_BITREG_WAKE_STATUS 0x06 + +#define ACPI_BITREG_TIMER_ENABLE 0x07 +#define ACPI_BITREG_GLOBAL_LOCK_ENABLE 0x08 +#define ACPI_BITREG_POWER_BUTTON_ENABLE 0x09 +#define ACPI_BITREG_SLEEP_BUTTON_ENABLE 0x0A +#define ACPI_BITREG_RT_CLOCK_ENABLE 0x0B +#define ACPI_BITREG_WAKE_ENABLE 0x0C + +#define ACPI_BITREG_SCI_ENABLE 0x0D +#define ACPI_BITREG_BUS_MASTER_RLD 0x0E +#define ACPI_BITREG_GLOBAL_LOCK_RELEASE 0x0F +#define ACPI_BITREG_SLEEP_TYPE_A 0x10 +#define ACPI_BITREG_SLEEP_TYPE_B 0x11 +#define ACPI_BITREG_SLEEP_ENABLE 0x12 + +#define ACPI_BITREG_ARB_DISABLE 0x13 + +#define ACPI_BITREG_MAX 0x13 +#define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1 + +/* * External ACPI object definition */ @@ -576,7 +672,7 @@ u32 resource_order; } power_resource; -} acpi_object, *PACPI_OBJECT; +} acpi_object; /* @@ -588,16 +684,20 @@ u32 count; acpi_object *pointer; -} acpi_object_list, *PACPI_OBJECT_LIST; +} acpi_object_list; /* * Miscellaneous common Data Structures used by the interfaces */ +#define ACPI_NO_BUFFER 0 +#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1) +#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2) + typedef struct { - u32 length; /* Length in bytes of the buffer */ + ACPI_SIZE length; /* Length in bytes of the buffer */ void *pointer; /* pointer to buffer */ } acpi_buffer; @@ -616,10 +716,10 @@ * Structure and flags for Acpi_get_system_info */ -#define SYS_MODE_UNKNOWN 0x0000 -#define SYS_MODE_ACPI 0x0001 -#define SYS_MODE_LEGACY 0x0002 -#define SYS_MODES_MASK 0x0003 +#define ACPI_SYS_MODE_UNKNOWN 0x0000 +#define ACPI_SYS_MODE_ACPI 0x0001 +#define ACPI_SYS_MODE_LEGACY 0x0002 +#define ACPI_SYS_MODES_MASK 0x0003 /* @@ -669,22 +769,32 @@ u32 value, void *context); +typedef +void (*ACPI_OBJECT_HANDLER) ( + acpi_handle object, + u32 function, + void *data); + +typedef +acpi_status (*ACPI_INIT_HANDLER) ( + acpi_handle object, + u32 function); + +#define ACPI_INIT_DEVICE_INI 1 -/* Address Spaces (Operation Regions */ -#define ACPI_READ_ADR_SPACE 1 -#define ACPI_WRITE_ADR_SPACE 2 +/* Address Spaces (Operation Regions */ typedef acpi_status (*acpi_adr_space_handler) ( u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, - u32 *value, + acpi_integer *value, void *handler_context, void *region_context); -#define ACPI_DEFAULT_HANDLER ((acpi_adr_space_handler) NULL) +#define ACPI_DEFAULT_HANDLER NULL typedef @@ -707,8 +817,8 @@ /* Interrupt handler return values */ -#define INTERRUPT_NOT_HANDLED 0x00 -#define INTERRUPT_HANDLED 0x01 +#define ACPI_INTERRUPT_NOT_HANDLED 0x00 +#define ACPI_INTERRUPT_HANDLED 0x01 /* Structure and flags for Acpi_get_device_info */ @@ -755,9 +865,11 @@ typedef struct { + u32 length; + ACPI_PHYSICAL_ADDRESS address; ACPI_PHYSICAL_ADDRESS mapped_physical_address; u8 *mapped_logical_address; - u32 mapped_length; + ACPI_SIZE mapped_length; } acpi_mem_space_context; @@ -773,78 +885,78 @@ /* * Memory Attributes */ -#define READ_ONLY_MEMORY (u8) 0x00 -#define READ_WRITE_MEMORY (u8) 0x01 +#define ACPI_READ_ONLY_MEMORY (u8) 0x00 +#define ACPI_READ_WRITE_MEMORY (u8) 0x01 -#define NON_CACHEABLE_MEMORY (u8) 0x00 -#define CACHABLE_MEMORY (u8) 0x01 -#define WRITE_COMBINING_MEMORY (u8) 0x02 -#define PREFETCHABLE_MEMORY (u8) 0x03 +#define ACPI_NON_CACHEABLE_MEMORY (u8) 0x00 +#define ACPI_CACHABLE_MEMORY (u8) 0x01 +#define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02 +#define ACPI_PREFETCHABLE_MEMORY (u8) 0x03 /* * IO Attributes - * The ISA IO ranges are: n000-n0FFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh. + * The ISA IO ranges are: n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh. * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cD0-n_fFFh. */ -#define NON_ISA_ONLY_RANGES (u8) 0x01 -#define ISA_ONLY_RANGES (u8) 0x02 -#define ENTIRE_RANGE (NON_ISA_ONLY_RANGES | ISA_ONLY_RANGES) +#define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01 +#define ACPI_ISA_ONLY_RANGES (u8) 0x02 +#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) /* * IO Port Descriptor Decode */ -#define DECODE_10 (u8) 0x00 /* 10-bit IO address decode */ -#define DECODE_16 (u8) 0x01 /* 16-bit IO address decode */ +#define ACPI_DECODE_10 (u8) 0x00 /* 10-bit IO address decode */ +#define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */ /* * IRQ Attributes */ -#define EDGE_SENSITIVE (u8) 0x00 -#define LEVEL_SENSITIVE (u8) 0x01 +#define ACPI_EDGE_SENSITIVE (u8) 0x00 +#define ACPI_LEVEL_SENSITIVE (u8) 0x01 -#define ACTIVE_HIGH (u8) 0x00 -#define ACTIVE_LOW (u8) 0x01 +#define ACPI_ACTIVE_HIGH (u8) 0x00 +#define ACPI_ACTIVE_LOW (u8) 0x01 -#define EXCLUSIVE (u8) 0x00 -#define SHARED (u8) 0x01 +#define ACPI_EXCLUSIVE (u8) 0x00 +#define ACPI_SHARED (u8) 0x01 /* * DMA Attributes */ -#define COMPATIBILITY (u8) 0x00 -#define TYPE_A (u8) 0x01 -#define TYPE_B (u8) 0x02 -#define TYPE_F (u8) 0x03 - -#define NOT_BUS_MASTER (u8) 0x00 -#define BUS_MASTER (u8) 0x01 - -#define TRANSFER_8 (u8) 0x00 -#define TRANSFER_8_16 (u8) 0x01 -#define TRANSFER_16 (u8) 0x02 +#define ACPI_COMPATIBILITY (u8) 0x00 +#define ACPI_TYPE_A (u8) 0x01 +#define ACPI_TYPE_B (u8) 0x02 +#define ACPI_TYPE_F (u8) 0x03 + +#define ACPI_NOT_BUS_MASTER (u8) 0x00 +#define ACPI_BUS_MASTER (u8) 0x01 + +#define ACPI_TRANSFER_8 (u8) 0x00 +#define ACPI_TRANSFER_8_16 (u8) 0x01 +#define ACPI_TRANSFER_16 (u8) 0x02 /* * Start Dependent Functions Priority definitions */ -#define GOOD_CONFIGURATION (u8) 0x00 -#define ACCEPTABLE_CONFIGURATION (u8) 0x01 -#define SUB_OPTIMAL_CONFIGURATION (u8) 0x02 +#define ACPI_GOOD_CONFIGURATION (u8) 0x00 +#define ACPI_ACCEPTABLE_CONFIGURATION (u8) 0x01 +#define ACPI_SUB_OPTIMAL_CONFIGURATION (u8) 0x02 /* * 16, 32 and 64-bit Address Descriptor resource types */ -#define MEMORY_RANGE (u8) 0x00 -#define IO_RANGE (u8) 0x01 -#define BUS_NUMBER_RANGE (u8) 0x02 +#define ACPI_MEMORY_RANGE (u8) 0x00 +#define ACPI_IO_RANGE (u8) 0x01 +#define ACPI_BUS_NUMBER_RANGE (u8) 0x02 -#define ADDRESS_NOT_FIXED (u8) 0x00 -#define ADDRESS_FIXED (u8) 0x01 +#define ACPI_ADDRESS_NOT_FIXED (u8) 0x00 +#define ACPI_ADDRESS_FIXED (u8) 0x01 -#define POS_DECODE (u8) 0x00 -#define SUB_DECODE (u8) 0x01 +#define ACPI_POS_DECODE (u8) 0x00 +#define ACPI_SUB_DECODE (u8) 0x01 -#define PRODUCER (u8) 0x00 -#define CONSUMER (u8) 0x01 +#define ACPI_PRODUCER (u8) 0x00 +#define ACPI_CONSUMER (u8) 0x01 /* @@ -908,6 +1020,12 @@ typedef struct { + u8 checksum; + +} ACPI_RESOURCE_END_TAG; + +typedef struct +{ u32 read_write_attribute; u32 min_base_address; u32 max_base_address; @@ -1053,7 +1171,7 @@ #define ACPI_RSTYPE_ADDRESS64 13 #define ACPI_RSTYPE_EXT_IRQ 14 -typedef u32 acpi_resource_type; +typedef u32 acpi_resource_type; typedef union { @@ -1063,6 +1181,7 @@ acpi_resource_io io; acpi_resource_fixed_io fixed_io; acpi_resource_vendor vendor_specific; + ACPI_RESOURCE_END_TAG end_tag; acpi_resource_mem24 memory24; acpi_resource_mem32 memory32; acpi_resource_fixed_mem32 fixed_memory32; @@ -1081,20 +1200,25 @@ } acpi_resource; -#define ACPI_RESOURCE_LENGTH 12 -#define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ +#define ACPI_RESOURCE_LENGTH 12 +#define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ -#define SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) +#define ACPI_SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) -#define NEXT_RESOURCE(res) (acpi_resource *)((u8 *) res + res->length) +#define ACPI_NEXT_RESOURCE(res) (acpi_resource *)((u8 *) res + res->length) +#ifdef _HW_ALIGNMENT_SUPPORT +#define ACPI_ALIGN_RESOURCE_SIZE(length) (length) +#else +#define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length) +#endif /* - * END: Definitions for Resource Attributes + * END: of definitions for Resource Attributes */ -typedef struct pci_routing_table +typedef struct acpi_pci_routing_table { u32 length; u32 pin; @@ -1102,11 +1226,11 @@ u32 source_index; NATIVE_CHAR source[4]; /* pad to 64 bits so sizeof() works in all cases */ -} pci_routing_table; - +} acpi_pci_routing_table; /* - * END: Definitions for PCI Routing tables + * END: of definitions for PCI Routing tables */ + #endif /* __ACTYPES_H__ */ diff -urN linux-2.4.18/drivers/acpi/include/acutils.h lia64-2.4/drivers/acpi/include/acutils.h --- linux-2.4.18/drivers/acpi/include/acutils.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/acutils.h Tue Jun 11 14:24:22 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures - * $Revision: 117 $ + * $Revision: 137 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,7 +46,7 @@ typedef struct acpi_pkg_info { u8 *free_space; - u32 length; + ACPI_SIZE length; u32 object_space; u32 num_packages; } acpi_pkg_info; @@ -82,7 +82,7 @@ acpi_ut_hardware_initialize ( void); -acpi_status +void acpi_ut_subsystem_shutdown ( void); @@ -94,7 +94,7 @@ * Ut_global - Global data structures and procedures */ -#ifdef ACPI_DEBUG +#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) NATIVE_CHAR * acpi_ut_get_mutex_name ( @@ -102,23 +102,27 @@ NATIVE_CHAR * acpi_ut_get_type_name ( - u32 type); + acpi_object_type type); + +#endif + NATIVE_CHAR * acpi_ut_get_region_name ( u8 space_id); -#endif - +NATIVE_CHAR * +acpi_ut_get_event_name ( + u32 event_id); -u8 +char acpi_ut_hex_to_ascii_char ( acpi_integer integer, u32 position); u8 acpi_ut_valid_object_type ( - u32 type); + acpi_object_type type); acpi_owner_id acpi_ut_allocate_owner_id ( @@ -146,7 +150,7 @@ const NATIVE_CHAR *src_string, NATIVE_UINT count); -u32 +int acpi_ut_strncmp ( const NATIVE_CHAR *string1, const NATIVE_CHAR *string2, @@ -191,13 +195,32 @@ NATIVE_UINT value, NATIVE_UINT count); -u32 +int acpi_ut_to_upper ( - u32 c); + int c); -u32 +int acpi_ut_to_lower ( - u32 c); + int c); + +extern const u8 _acpi_ctype[]; + +#define _ACPI_XA 0x00 /* extra alphabetic - not supported */ +#define _ACPI_XS 0x40 /* extra space */ +#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ +#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ +#define _ACPI_DI 0x04 /* '0'-'9' */ +#define _ACPI_LO 0x02 /* 'a'-'z' */ +#define _ACPI_PU 0x10 /* punctuation */ +#define _ACPI_SP 0x08 /* space */ +#define _ACPI_UP 0x01 /* 'A'-'Z' */ +#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ + +#define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) +#define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) +#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) +#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) +#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) #endif /* ACPI_USE_SYSTEM_CLIBRARY */ @@ -219,6 +242,20 @@ u32 *space_used); acpi_status +acpi_ut_copy_ielement_to_eelement ( + u8 object_type, + acpi_operand_object *source_object, + acpi_generic_state *state, + void *context); + +acpi_status +acpi_ut_copy_ielement_to_ielement ( + u8 object_type, + acpi_operand_object *source_object, + acpi_generic_state *state, + void *context); + +acpi_status acpi_ut_copy_iobject_to_eobject ( acpi_operand_object *obj, acpi_buffer *ret_buffer); @@ -244,6 +281,17 @@ acpi_operand_object *dest_obj, acpi_walk_state *walk_state); +acpi_status +acpi_ut_copy_simple_object ( + acpi_operand_object *source_desc, + acpi_operand_object *dest_desc); + +acpi_status +acpi_ut_copy_iobject_to_iobject ( + acpi_operand_object *source_desc, + acpi_operand_object **dest_desc, + acpi_walk_state *walk_state); + /* * Ut_create - Object creation @@ -338,7 +386,7 @@ u32 display, u32 component_id); -void +void ACPI_INTERNAL_VAR_XFACE acpi_ut_debug_print ( u32 requested_debug_level, u32 line_number, @@ -346,7 +394,7 @@ char *format, ...) ACPI_PRINTF_LIKE_FUNC; -void +void ACPI_INTERNAL_VAR_XFACE acpi_ut_debug_print_raw ( u32 requested_debug_level, u32 line_number, @@ -371,7 +419,7 @@ acpi_ut_delete_internal_simple_object ( acpi_operand_object *object); -acpi_status +void acpi_ut_delete_internal_object_list ( acpi_operand_object **obj_list); @@ -383,6 +431,7 @@ /* Method name strings */ #define METHOD_NAME__HID "_HID" +#define METHOD_NAME__CID "_CID" #define METHOD_NAME__UID "_UID" #define METHOD_NAME__ADR "_ADR" #define METHOD_NAME__STA "_STA" @@ -404,6 +453,11 @@ acpi_device_id *hid); acpi_status +acpi_ut_execute_CID ( + acpi_namespace_node *device_node, + acpi_device_id *cid); + +acpi_status acpi_ut_execute_STA ( acpi_namespace_node *device_node, u32 *status_flags); @@ -452,7 +506,7 @@ NATIVE_CHAR *module_name, u32 line_number, u32 component_id, - acpi_object_type8 type); + acpi_object_type type); void * acpi_ut_allocate_object_desc_dbg ( @@ -491,17 +545,24 @@ acpi_status acpi_ut_get_simple_object_size ( acpi_operand_object *obj, - u32 *obj_length); + ACPI_SIZE *obj_length); acpi_status acpi_ut_get_package_object_size ( acpi_operand_object *obj, - u32 *obj_length); + ACPI_SIZE *obj_length); acpi_status acpi_ut_get_object_size( acpi_operand_object *obj, - u32 *obj_length); + ACPI_SIZE *obj_length); + +acpi_status +acpi_ut_get_element_length ( + u8 object_type, + acpi_operand_object *source_object, + acpi_generic_state *state, + void *context); /* @@ -522,6 +583,10 @@ acpi_ut_create_generic_state ( void); +ACPI_THREAD_STATE * +acpi_ut_create_thread_state ( + void); + acpi_generic_state * acpi_ut_create_update_state ( acpi_operand_object *object, @@ -588,6 +653,12 @@ acpi_ut_valid_acpi_character ( NATIVE_CHAR character); +acpi_status +acpi_ut_strtoul64 ( + NATIVE_CHAR *string, + u32 base, + acpi_integer *ret_integer); + NATIVE_CHAR * acpi_ut_strupr ( NATIVE_CHAR *src_string); @@ -596,6 +667,29 @@ acpi_ut_resolve_package_references ( acpi_operand_object *obj_desc); +acpi_status +acpi_ut_resolve_reference ( + u8 object_type, + acpi_operand_object *source_object, + acpi_generic_state *state, + void *context); + +u8 * +acpi_ut_get_resource_end_tag ( + acpi_operand_object *obj_desc); + +u8 +acpi_ut_generate_checksum ( + u8 *buffer, + u32 length); + +u32 +acpi_ut_dword_byte_swap ( + u32 value); + +void +acpi_ut_set_integer_width ( + u8 revision); #ifdef ACPI_DEBUG void @@ -623,31 +717,79 @@ acpi_ut_delete_generic_cache ( u32 list_id); +acpi_status +acpi_ut_validate_buffer ( + acpi_buffer *buffer); + +acpi_status +acpi_ut_initialize_buffer ( + acpi_buffer *buffer, + ACPI_SIZE required_length); + -/* Debug Memory allocation functions */ +/* Memory allocation functions */ void * acpi_ut_allocate ( - u32 size, + ACPI_SIZE size, u32 component, NATIVE_CHAR *module, u32 line); void * acpi_ut_callocate ( - u32 size, + ACPI_SIZE size, + u32 component, + NATIVE_CHAR *module, + u32 line); + + +#ifdef ACPI_DBG_TRACK_ALLOCATIONS + +void * +acpi_ut_allocate_and_track ( + ACPI_SIZE size, + u32 component, + NATIVE_CHAR *module, + u32 line); + +void * +acpi_ut_callocate_and_track ( + ACPI_SIZE size, u32 component, NATIVE_CHAR *module, u32 line); void -acpi_ut_free ( +acpi_ut_free_and_track ( void *address, u32 component, NATIVE_CHAR *module, u32 line); -#ifdef ACPI_DBG_TRACK_ALLOCATIONS +acpi_debug_mem_block * +acpi_ut_find_allocation ( + u32 list_id, + void *allocation); + +acpi_status +acpi_ut_track_allocation ( + u32 list_id, + acpi_debug_mem_block *address, + ACPI_SIZE size, + u8 alloc_type, + u32 component, + NATIVE_CHAR *module, + u32 line); + +acpi_status +acpi_ut_remove_allocation ( + u32 list_id, + acpi_debug_mem_block *address, + u32 component, + NATIVE_CHAR *module, + u32 line); + void acpi_ut_dump_allocation_info ( void); diff -urN linux-2.4.18/drivers/acpi/include/adisasm.h lia64-2.4/drivers/acpi/include/adisasm.h --- linux-2.4.18/drivers/acpi/include/adisasm.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/include/adisasm.h Tue Jun 11 14:24:22 2002 @@ -0,0 +1,76 @@ +/****************************************************************************** + * + * Module Name: adisasm - AML disassembler + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2002, R. Byron Moore + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _ADISASM +#define _ADISASM + + +extern u8 *dsdt_ptr; +extern u32 acpi_dsdt_length; +extern int optind; +extern char *optarg; +extern u8 *aml_start; +extern u32 aml_length; + + +int +getopt ( + int argc, + char **argv, + char *opts); + + +acpi_status +ad_aml_disassemble ( + char *filename); + +void +ad_print_statistics (void); + + +acpi_status +ad_find_dsdt( + u8 **dsdt_ptr, + u32 *dsdt_length); + +void +ad_dump_tables (void); + + +acpi_status +ad_get_tables ( + char *filename); + +acpi_status +ad_parse_tables (void); + +acpi_status +ad_display_tables (void); + +acpi_status +ad_display_statistics (void); + + +#endif + diff -urN linux-2.4.18/drivers/acpi/include/amlcode.h lia64-2.4/drivers/acpi/include/amlcode.h --- linux-2.4.18/drivers/acpi/include/amlcode.h Mon Nov 5 18:28:43 2001 +++ lia64-2.4/drivers/acpi/include/amlcode.h Tue Jun 11 14:24:23 2002 @@ -3,12 +3,12 @@ * Name: amlcode.h - Definitions for AML, as included in "definition blocks" * Declarations and definitions contained herein are derived * directly from the ACPI specification. - * $Revision: 58 $ + * $Revision: 68 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,6 @@ #ifndef __AMLCODE_H__ #define __AMLCODE_H__ - /* primary opcodes */ #define AML_NULL_CHAR (u16) 0x00 @@ -185,6 +184,7 @@ #define AML_INT_STATICSTRING_OP (u16) 0x0034 #define AML_INT_METHODCALL_OP (u16) 0x0035 #define AML_INT_RETURN_VALUE_OP (u16) 0x0036 +#define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037 #define ARG_NONE 0x0 @@ -218,6 +218,9 @@ * Resolved argument types for the AML Interpreter * Each field in the Arg_types u32 is 5 bits, allowing for a maximum of 6 arguments. * There can be up to 31 unique argument types (0 is end-of-arg-list indicator) + * + * Note: If and when 5 bits becomes insufficient, it would probably be best + * to convert to a 6-byte array of argument types, allowing 8 bits per argument. */ /* "Standard" ACPI types are 1-15 (0x0F) */ @@ -247,6 +250,7 @@ #define ARGI_FIXED_TARGET 0x1B /* Target, no implicit conversion */ #define ARGI_SIMPLE_TARGET 0x1C /* Name, Local, Arg -- no implicit conversion */ #define ARGI_BUFFERSTRING 0x1D +#define ARGI_REF_OR_STRING 0x1E /* Reference or String (Used by DEREFOF op only) */ #define ARGI_INVALID_OPCODE 0xFFFFFFFF @@ -285,6 +289,7 @@ #define AML_CREATE 0x0004 #define AML_MATH 0x0002 #define AML_LOGICAL 0x0001 +#define AML_CONSTANT 0x1000 /* Convenient flag groupings */ @@ -331,15 +336,16 @@ /* Misc */ #define AML_TYPE_CREATE_FIELD 0x11 -#define AML_TYPE_CONTROL 0x12 -#define AML_TYPE_NAMED_NO_OBJ 0x13 -#define AML_TYPE_NAMED_FIELD 0x14 -#define AML_TYPE_NAMED_SIMPLE 0x15 -#define AML_TYPE_NAMED_COMPLEX 0x16 -#define AML_TYPE_RETURN 0x17 +#define AML_TYPE_CREATE_OBJECT 0x12 +#define AML_TYPE_CONTROL 0x13 +#define AML_TYPE_NAMED_NO_OBJ 0x14 +#define AML_TYPE_NAMED_FIELD 0x15 +#define AML_TYPE_NAMED_SIMPLE 0x16 +#define AML_TYPE_NAMED_COMPLEX 0x17 +#define AML_TYPE_RETURN 0x18 -#define AML_TYPE_UNDEFINED 0x18 -#define AML_TYPE_BOGUS 0x19 +#define AML_TYPE_UNDEFINED 0x19 +#define AML_TYPE_BOGUS 0x1A /* @@ -369,7 +375,8 @@ REGION_SMBUS, REGION_CMOS, REGION_PCI_BAR, - REGION_FIXED_HW = 0x7F, + REGION_DATA_TABLE, /* Internal use only */ + REGION_FIXED_HW = 0x7F } AML_REGION_TYPES; @@ -390,52 +397,76 @@ #define MAX_MATCH_OPERATOR 5 -/* Field Access Types */ +/* + * Field_flags + * + * This byte is extracted from the AML and includes three separate + * pieces of information about the field: + * 1) The field access type + * 2) The field update rule + * 3) The lock rule for the field + * + * Bits 00 - 03 : Access_type (Any_acc, Byte_acc, etc.) + * 04 : Lock_rule (1 == Lock) + * 05 - 06 : Update_rule + */ +#define AML_FIELD_ACCESS_TYPE_MASK 0x0F +#define AML_FIELD_LOCK_RULE_MASK 0x10 +#define AML_FIELD_UPDATE_RULE_MASK 0x60 + -#define ACCESS_TYPE_MASK 0x0f -#define ACCESS_TYPE_SHIFT 0 +/* 1) Field Access Types */ typedef enum { - ACCESS_ANY_ACC = 0, - ACCESS_BYTE_ACC = 1, - ACCESS_WORD_ACC = 2, - ACCESS_DWORD_ACC = 3, - ACCESS_QWORD_ACC = 4, /* ACPI 2.0 */ - ACCESS_BLOCK_ACC = 4, - ACCESS_SMBSEND_RECV_ACC = 5, - ACCESS_SMBQUICK_ACC = 6 + AML_FIELD_ACCESS_ANY = 0x00, + AML_FIELD_ACCESS_BYTE = 0x01, + AML_FIELD_ACCESS_WORD = 0x02, + AML_FIELD_ACCESS_DWORD = 0x03, + AML_FIELD_ACCESS_QWORD = 0x04, /* ACPI 2.0 */ + AML_FIELD_ACCESS_BUFFER = 0x05 /* ACPI 2.0 */ } AML_ACCESS_TYPE; -/* Field Lock Rules */ - -#define LOCK_RULE_MASK 0x10 -#define LOCK_RULE_SHIFT 4 +/* 2) Field Lock Rules */ typedef enum { - GLOCK_NEVER_LOCK = 0, - GLOCK_ALWAYS_LOCK = 1 + AML_FIELD_LOCK_NEVER = 0x00, + AML_FIELD_LOCK_ALWAYS = 0x10 } AML_LOCK_RULE; -/* Field Update Rules */ - -#define UPDATE_RULE_MASK 0x060 -#define UPDATE_RULE_SHIFT 5 +/* 3) Field Update Rules */ typedef enum { - UPDATE_PRESERVE = 0, - UPDATE_WRITE_AS_ONES = 1, - UPDATE_WRITE_AS_ZEROS = 2 + AML_FIELD_UPDATE_PRESERVE = 0x00, + AML_FIELD_UPDATE_WRITE_AS_ONES = 0x20, + AML_FIELD_UPDATE_WRITE_AS_ZEROS = 0x40 } AML_UPDATE_RULE; +/* + * Field Access Attributes. + * This byte is extracted from the AML via the + * Access_as keyword + */ +typedef enum +{ + AML_FIELD_ATTRIB_SMB_QUICK = 0x02, + AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04, + AML_FIELD_ATTRIB_SMB_BYTE = 0x06, + AML_FIELD_ATTRIB_SMB_WORD = 0x08, + AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A, + AML_FIELD_ATTRIB_SMB_CALL = 0x0E + +} AML_ACCESS_ATTRIBUTE; + + /* bit fields in Method_flags byte */ #define METHOD_FLAGS_ARG_COUNT 0x07 @@ -445,15 +476,11 @@ /* Array sizes. Used for range checking also */ -#define NUM_REGION_TYPES 7 -#define NUM_ACCESS_TYPES 7 +#define NUM_ACCESS_TYPES 6 #define NUM_UPDATE_RULES 3 #define NUM_MATCH_OPS 7 #define NUM_OPCODES 256 #define NUM_FIELD_NAMES 2 - - -#define USER_REGION_BEGIN 0x80 #endif /* __AMLCODE_H__ */ diff -urN linux-2.4.18/drivers/acpi/include/platform/acdos16.h lia64-2.4/drivers/acpi/include/platform/acdos16.h --- linux-2.4.18/drivers/acpi/include/platform/acdos16.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/include/platform/acdos16.h Tue Apr 9 15:46:59 2002 @@ -0,0 +1,60 @@ +/****************************************************************************** + * + * Name: acdos16.h - DOS specific defines, etc. + * $Revision: 2 $ + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2002, R. Byron Moore + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __ACDOS16_H__ +#define __ACDOS16_H__ + +#define ACPI_USE_STANDARD_HEADERS +#define ACPI_OS_NAME "MSDOS" + +/* + * Calling conventions: + * + * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) + * ACPI_EXTERNAL_XFACE - External ACPI interfaces + * ACPI_INTERNAL_XFACE - Internal ACPI interfaces + * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces + */ +#define ACPI_SYSTEM_XFACE __cdecl +#define ACPI_EXTERNAL_XFACE +#define ACPI_INTERNAL_XFACE +#define ACPI_INTERNAL_VAR_XFACE __cdecl + +#define ACPI_ASM_MACROS +#define BREAKPOINT3 +#define ACPI_DISABLE_IRQS() +#define ACPI_ENABLE_IRQS() +#define halt() +#define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq) +#define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq) + + +/* This macro is used to tag functions as "printf-like" because + * some compilers can catch printf format string problems. MSVC + * doesn't, so this is proprocessed away. + */ +#define ACPI_PRINTF_LIKE_FUNC + +#endif /* __ACDOS16_H__ */ diff -urN linux-2.4.18/drivers/acpi/include/platform/acenv.h lia64-2.4/drivers/acpi/include/platform/acenv.h --- linux-2.4.18/drivers/acpi/include/platform/acenv.h Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/include/platform/acenv.h Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acenv.h - Generation environment specific items - * $Revision: 77 $ + * $Revision: 94 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ #ifdef _ACPI_ASL_COMPILER #define ACPI_DEBUG #define ACPI_APPLICATION -#define ENABLE_DEBUGGER +/* #define ENABLE_DEBUGGER */ #define ACPI_USE_SYSTEM_CLIBRARY #endif @@ -61,7 +61,7 @@ * 2) This is NOT a 16-bit version of the code (not enough real-mode memory) */ #ifdef ACPI_DEBUG -#ifndef _IA16 +#if ACPI_MACHINE_WIDTH != 16 #define ACPI_DBG_TRACK_ALLOCATIONS #endif #endif @@ -105,24 +105,40 @@ /*! [Begin] no source code translation */ -#ifdef _LINUX +#if defined(_LINUX) #include "aclinux.h" -#elif _AED_EFI +#elif defined(_AED_EFI) #include "acefi.h" -#elif WIN32 +#elif defined(WIN32) #include "acwin.h" -#elif __FreeBSD__ +#elif defined(WIN64) +#include "acwin64.h" + +#elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ +#include "acdos16.h" + +#elif defined(__FreeBSD__) #include "acfreebsd.h" +#elif defined(MODESTO) +#include "acmodesto.h" + +#elif defined(NETWARE) +#include "acnetware.h" + #else /* All other environments */ #define ACPI_USE_STANDARD_HEADERS +#define COMPILER_DEPENDENT_INT64 long long +#define COMPILER_DEPENDENT_UINT64 unsigned long long + + /* Name of host operating system (returned by the _OS_ namespace object) */ #define ACPI_OS_NAME "Intel ACPI/CA Core Subsystem" @@ -135,7 +151,6 @@ #endif - /*! [End] no source code translation !*/ /****************************************************************************** @@ -166,21 +181,24 @@ * We will be linking to the standard Clib functions */ -#define STRSTR(s1,s2) strstr((s1), (s2)) -#define STRUPR(s) acpi_ut_strupr ((s)) -#define STRLEN(s) (u32) strlen((s)) -#define STRCPY(d,s) strcpy((d), (s)) -#define STRNCPY(d,s,n) strncpy((d), (s), (NATIVE_INT)(n)) -#define STRNCMP(d,s,n) strncmp((d), (s), (NATIVE_INT)(n)) -#define STRCMP(d,s) strcmp((d), (s)) -#define STRCAT(d,s) strcat((d), (s)) -#define STRNCAT(d,s,n) strncat((d), (s), (NATIVE_INT)(n)) -#define STRTOUL(d,s,n) strtoul((d), (s), (NATIVE_INT)(n)) -#define MEMCPY(d,s,n) memcpy((d), (s), (NATIVE_INT)(n)) -#define MEMSET(d,s,n) memset((d), (s), (NATIVE_INT)(n)) -#define TOUPPER toupper -#define TOLOWER tolower -#define IS_XDIGIT isxdigit +#define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) +#define ACPI_STRUPR(s) (void) acpi_ut_strupr ((s)) +#define ACPI_STRLEN(s) (ACPI_SIZE) strlen((s)) +#define ACPI_STRCPY(d,s) (void) strcpy((d), (s)) +#define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (ACPI_SIZE)(n)) +#define ACPI_STRNCMP(d,s,n) strncmp((d), (s), (ACPI_SIZE)(n)) +#define ACPI_STRCMP(d,s) strcmp((d), (s)) +#define ACPI_STRCAT(d,s) (void) strcat((d), (s)) +#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (ACPI_SIZE)(n)) +#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n)) +#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n)) +#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n)) +#define ACPI_TOUPPER toupper +#define ACPI_TOLOWER tolower +#define ACPI_IS_XDIGIT isxdigit +#define ACPI_IS_DIGIT isdigit +#define ACPI_IS_SPACE isspace +#define ACPI_IS_UPPER isupper /****************************************************************************** * @@ -207,35 +225,35 @@ * Storage alignment properties */ -#define _AUPBND (sizeof (NATIVE_INT) - 1) -#define _ADNBND (sizeof (NATIVE_INT) - 1) +#define _AUPBND (sizeof (NATIVE_INT) - 1) +#define _ADNBND (sizeof (NATIVE_INT) - 1) /* * Variable argument list macro definitions */ -#define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) -#define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) -#define va_end(ap) (void) 0 -#define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) +#define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) +#define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) +#define va_end(ap) (void) 0 +#define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) #endif /* va_arg */ -#define STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) -#define STRUPR(s) acpi_ut_strupr ((s)) -#define STRLEN(s) acpi_ut_strlen ((s)) -#define STRCPY(d,s) acpi_ut_strcpy ((d), (s)) -#define STRNCPY(d,s,n) acpi_ut_strncpy ((d), (s), (n)) -#define STRNCMP(d,s,n) acpi_ut_strncmp ((d), (s), (n)) -#define STRCMP(d,s) acpi_ut_strcmp ((d), (s)) -#define STRCAT(d,s) acpi_ut_strcat ((d), (s)) -#define STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (n)) -#define STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s),(n)) -#define MEMCPY(d,s,n) acpi_ut_memcpy ((d), (s), (n)) -#define MEMSET(d,v,n) acpi_ut_memset ((d), (v), (n)) -#define TOUPPER acpi_ut_to_upper -#define TOLOWER acpi_ut_to_lower +#define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) +#define ACPI_STRUPR(s) (void) acpi_ut_strupr ((s)) +#define ACPI_STRLEN(s) (ACPI_SIZE) acpi_ut_strlen ((s)) +#define ACPI_STRCPY(d,s) (void) acpi_ut_strcpy ((d), (s)) +#define ACPI_STRNCPY(d,s,n) (void) acpi_ut_strncpy ((d), (s), (ACPI_SIZE)(n)) +#define ACPI_STRNCMP(d,s,n) acpi_ut_strncmp ((d), (s), (ACPI_SIZE)(n)) +#define ACPI_STRCMP(d,s) acpi_ut_strcmp ((d), (s)) +#define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s)) +#define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (ACPI_SIZE)(n)) +#define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (ACPI_SIZE)(n)) +#define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (ACPI_SIZE)(n)) +#define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (ACPI_SIZE)(n)) +#define ACPI_TOUPPER acpi_ut_to_upper +#define ACPI_TOLOWER acpi_ut_to_lower #endif /* ACPI_USE_SYSTEM_CLIBRARY */ @@ -256,14 +274,26 @@ */ /* Unrecognized compiler, use defaults */ + #ifndef ACPI_ASM_MACROS +/* + * Calling conventions: + * + * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) + * ACPI_EXTERNAL_XFACE - External ACPI interfaces + * ACPI_INTERNAL_XFACE - Internal ACPI interfaces + * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces + */ +#define ACPI_SYSTEM_XFACE +#define ACPI_EXTERNAL_XFACE +#define ACPI_INTERNAL_XFACE +#define ACPI_INTERNAL_VAR_XFACE + #define ACPI_ASM_MACROS -#define causeinterrupt(level) #define BREAKPOINT3 -#define disable() -#define enable() -#define halt() +#define ACPI_DISABLE_IRQS() +#define ACPI_ENABLE_IRQS() #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq) #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq) @@ -274,21 +304,15 @@ /* Don't want software interrupts within a ring3 application */ -#undef causeinterrupt #undef BREAKPOINT3 -#define causeinterrupt(level) #define BREAKPOINT3 #endif /****************************************************************************** * - * Compiler-specific + * Compiler-specific information is contained in the compiler-specific + * headers. * *****************************************************************************/ - -/* this has been moved to compiler-specific headers, which are included from the - platform header. */ - - #endif /* __ACENV_H__ */ diff -urN linux-2.4.18/drivers/acpi/include/platform/acgcc.h lia64-2.4/drivers/acpi/include/platform/acgcc.h --- linux-2.4.18/drivers/acpi/include/platform/acgcc.h Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/include/platform/acgcc.h Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: acgcc.h - GCC specific defines, etc. - * $Revision: 14 $ + * $Revision: 23 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,140 +25,6 @@ #ifndef __ACGCC_H__ #define __ACGCC_H__ - - -#ifdef __ia64__ -#define _IA64 - -#define COMPILER_DEPENDENT_UINT64 unsigned long -/* Single threaded */ -#define ACPI_APPLICATION - -#define ACPI_ASM_MACROS -#define causeinterrupt(level) -#define BREAKPOINT3 -#define disable() __cli() -#define enable() __sti() - -/*! [Begin] no source code translation */ - -#include - -#define halt() ia64_pal_halt_light() /* PAL_HALT[_LIGHT] */ -#define safe_halt() ia64_pal_halt(1) /* PAL_HALT */ - - -#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ - do { \ - __asm__ volatile ("1: ld4 r29=%1\n" \ - ";;\n" \ - "mov ar.ccv=r29\n" \ - "mov r2=r29\n" \ - "shr.u r30=r29,1\n" \ - "and r29=-4,r29\n" \ - ";;\n" \ - "add r29=2,r29\n" \ - "and r30=1,r30\n" \ - ";;\n" \ - "add r29=r29,r30\n" \ - ";;\n" \ - "cmpxchg4.acq r30=%1,r29,ar.ccv\n" \ - ";;\n" \ - "cmp.eq p6,p7=r2,r30\n" \ - "(p7) br.dpnt.few 1b\n" \ - "cmp.gt p8,p9=3,r29\n" \ - ";;\n" \ - "(p8) mov %0=-1\n" \ - "(p9) mov %0=r0\n" \ - :"=r"(Acq):"m"(GLptr):"r2","r29","r30","memory"); \ - } while (0) - -#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ - do { \ - __asm__ volatile ("1: ld4 r29=%1\n" \ - ";;\n" \ - "mov ar.ccv=r29\n" \ - "mov r2=r29\n" \ - "and r29=-4,r29\n" \ - ";;\n" \ - "cmpxchg4.acq r30=%1,r29,ar.ccv\n" \ - ";;\n" \ - "cmp.eq p6,p7=r2,r30\n" \ - "(p7) br.dpnt.few 1b\n" \ - "and %0=1,r2\n" \ - ";;\n" \ - :"=r"(Acq):"m"(GLptr):"r2","r29","r30","memory"); \ - } while (0) -/*! [End] no source code translation !*/ - - -#else /* DO IA32 */ - -#define COMPILER_DEPENDENT_UINT64 unsigned long long -#define ACPI_ASM_MACROS -#define causeinterrupt(level) -#define BREAKPOINT3 -#define disable() __cli() -#define enable() __sti() -#define halt() __asm__ __volatile__ ("sti; hlt":::"memory") - -/*! [Begin] no source code translation - * - * A brief explanation as GNU inline assembly is a bit hairy - * %0 is the output parameter in EAX ("=a") - * %1 and %2 are the input parameters in ECX ("c") - * and an immediate value ("i") respectively - * All actual register references are preceded with "%%" as in "%%edx" - * Immediate values in the assembly are preceded by "$" as in "$0x1" - * The final asm parameter are the operation altered non-output registers. - */ -#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ - do { \ - int dummy; \ - asm("1: movl (%1),%%eax;" \ - "movl %%eax,%%edx;" \ - "andl %2,%%edx;" \ - "btsl $0x1,%%edx;" \ - "adcl $0x0,%%edx;" \ - "lock; cmpxchgl %%edx,(%1);" \ - "jnz 1b;" \ - "cmpb $0x3,%%dl;" \ - "sbbl %%eax,%%eax" \ - :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~1L):"dx"); \ - } while(0) - -#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ - do { \ - int dummy; \ - asm("1: movl (%1),%%eax;" \ - "movl %%eax,%%edx;" \ - "andl %2,%%edx;" \ - "lock; cmpxchgl %%edx,(%1);" \ - "jnz 1b;" \ - "andl $0x1,%%eax" \ - :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~3L):"dx"); \ - } while(0) - - -/* - * Math helper asm macros - */ -#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \ - asm("divl %2;" \ - :"=a"(q32), "=d"(r32) \ - :"r"(d32), \ - "0"(n_lo), "1"(n_hi)) - - -#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \ - asm("shrl $1,%2;" \ - "rcrl $1,%3;" \ - :"=r"(n_hi), "=r"(n_lo) \ - :"0"(n_hi), "1"(n_lo)) - -/*! [End] no source code translation !*/ - -#endif /* IA 32 */ /* This macro is used to tag functions as "printf-like" because * some compilers (like GCC) can catch printf format string problems. diff -urN linux-2.4.18/drivers/acpi/include/platform/acintel.h lia64-2.4/drivers/acpi/include/platform/acintel.h --- linux-2.4.18/drivers/acpi/include/platform/acintel.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/include/platform/acintel.h Tue Apr 9 15:47:00 2002 @@ -0,0 +1,77 @@ +/****************************************************************************** + * + * Name: acintel.h - VC specific defines, etc. + * $Revision: 5 $ + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2002, R. Byron Moore + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __ACINTEL_H__ +#define __ACINTEL_H__ + + +#define COMPILER_DEPENDENT_UINT64 unsigned __int64 + +/* + * Calling conventions: + * + * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) + * ACPI_EXTERNAL_XFACE - External ACPI interfaces + * ACPI_INTERNAL_XFACE - Internal ACPI interfaces + * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces + */ +#define ACPI_SYSTEM_XFACE +#define ACPI_EXTERNAL_XFACE +#define ACPI_INTERNAL_XFACE +#define ACPI_INTERNAL_VAR_XFACE + +/* + * Math helper functions + */ +#define ACPI_DIV_64_BY_32(n, n_hi, n_lo, d32, q32, r32) \ +{ \ + q32 = n / d32; \ + r32 = n % d32; \ +} + +#define ACPI_SHIFT_RIGHT_64(n, n_hi, n_lo) \ +{ \ + n <<= 1; \ +} + + +#pragma warning(disable:810) + +/* warn C4100: unreferenced formal parameter */ +#pragma warning(disable:4100) + +/* warn C4127: conditional expression is constant */ +#pragma warning(disable:4127) + +/* warn C4706: assignment within conditional expression */ +#pragma warning(disable:4706) + +/* This macro is used to tag functions as "printf-like" because + * some compilers can catch printf format string problems. MSVC + * doesn't, so this is proprocessed away. + */ +#define ACPI_PRINTF_LIKE_FUNC + +#endif /* __ACINTEL_H__ */ diff -urN linux-2.4.18/drivers/acpi/include/platform/aclinux.h lia64-2.4/drivers/acpi/include/platform/aclinux.h --- linux-2.4.18/drivers/acpi/include/platform/aclinux.h Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/include/platform/aclinux.h Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Name: aclinux.h - OS specific defines, etc. - * $Revision: 14 $ + * $Revision: 25 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,24 +39,37 @@ #include #include #include +#include #define strtoul simple_strtoul -#else +#define ACPI_MACHINE_WIDTH BITS_PER_LONG + +#else /* !__KERNEL__ */ #include #include #include #include +#if defined(__ia64__) || defined(__x86_64__) +#define ACPI_MACHINE_WIDTH 64 +#define COMPILER_DEPENDENT_INT64 long +#define COMPILER_DEPENDENT_UINT64 unsigned long +#else +#define ACPI_MACHINE_WIDTH 32 +#define COMPILER_DEPENDENT_INT64 long long +#define COMPILER_DEPENDENT_UINT64 unsigned long long +#define ACPI_USE_NATIVE_DIVIDE #endif +#endif /* __KERNEL__ */ + /* Linux uses GCC */ #include "acgcc.h" #undef DEBUGGER_THREADING -#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED - +#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #endif /* __ACLINUX_H__ */ diff -urN linux-2.4.18/drivers/acpi/include/platform/acwin64.h lia64-2.4/drivers/acpi/include/platform/acwin64.h --- linux-2.4.18/drivers/acpi/include/platform/acwin64.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/include/platform/acwin64.h Tue Apr 9 15:47:00 2002 @@ -0,0 +1,72 @@ +/****************************************************************************** + * + * Name: acwin.h - OS specific defines, etc. + * $Revision: 6 $ + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2002, R. Byron Moore + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __ACWIN64_H__ +#define __ACWIN64_H__ + +/*! [Begin] no source code translation (Keep the include) */ + +#include "acintel.h" +/*! [End] no source code translation !*/ + +#define ACPI_OS_NAME "Windows" + +#define strupr _strupr +#define ACPI_USE_STANDARD_HEADERS + +/* + * Handle platform- and compiler-specific assembly language differences. + * + * Notes: + * 1) Interrupt 3 is used to break into a debugger + * 2) Interrupts are turned off during ACPI register setup + */ + +/*! [Begin] no source code translation */ + +#define ACPI_ASM_MACROS +#define causeinterrupt(level) +#define BREAKPOINT3 +#define ACPI_DISABLE_IRQS() +#define ACPI_ENABLE_IRQS() +#define ACPI_FLUSH_CPU_CACHE() + + +/* + * For Acpi applications, we don't want to try to access the global lock + */ +#ifdef ACPI_APPLICATION +#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) (Acq = 0xFF) +#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pnd) (Pnd = 0) +#else + +#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) + +#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pnd) + +#endif + + +#endif /* __ACWIN_H__ */ diff -urN linux-2.4.18/drivers/acpi/kdb/README.txt lia64-2.4/drivers/acpi/kdb/README.txt --- linux-2.4.18/drivers/acpi/kdb/README.txt Mon Sep 24 15:06:42 2001 +++ lia64-2.4/drivers/acpi/kdb/README.txt Wed Dec 31 16:00:00 1969 @@ -1,36 +0,0 @@ -Using the ACPI debugger with kdb --------------------------------- - -ACPI CA includes a full-featured debugger, which allows the examination of -a running system's ACPI tables, as well as running and stepping through -control methods. - -Configuration -------------- -1) Edit the main acpi Makefile. On the ACPI_CFLAGS line, remove the '#', thus - enabling the debugger. - -2) Download the latest kdb patch from: - - ftp://oss.sgi.com/www/projects/kdb/download/ix86/ - - Follow the instructions at http://oss.sgi.com/projects/kdb/ on how to - install the patch and configure KDB. - -3) This would probably be a good time to recompile the kernel, and make sure - kdb works (Hitting the Pause key should drop you into it. Type "go" to exit - it. - -4) The kdb <--> ACPI debugger interface is a module. Type "make modules", and - it will be built and placed in drivers/acpi/kdb. - -5) Change to that directory and type "insmod kdbm_acpi.o". This loads the - module we just built. - -6) Break back into kdb. If you type help, you should now see "acpi" listed as - a command, at the bottom. - -7) Type "acpi". You are now in the ACPI debugger. While hosted by kdb, it is - wholly separate, and has many ACPI-specific commands. Type "?" or "help" - to get a listing of the command categories, and then "help " for - a list of commands and their descriptions diff -urN linux-2.4.18/drivers/acpi/kdb/kdbm_acpi.c lia64-2.4/drivers/acpi/kdb/kdbm_acpi.c --- linux-2.4.18/drivers/acpi/kdb/kdbm_acpi.c Mon Sep 24 15:06:42 2001 +++ lia64-2.4/drivers/acpi/kdb/kdbm_acpi.c Wed Dec 31 16:00:00 1969 @@ -1,54 +0,0 @@ -/* - * kdbm_acpi.c - kdb debugger module interface for ACPI debugger - * - * Copyright (C) 2000 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include -#include - -#include "acpi.h" -#include "acdebug.h" - -extern int acpi_in_debugger; - -static int -kdbm_acpi(int argc, const char **argv, const char **envp, struct pt_regs *regs) -{ - acpi_in_debugger = 1; - - acpi_db_user_commands(DB_COMMAND_PROMPT, NULL); - - acpi_in_debugger = 0; - - return 0; -} - -int -init_module(void) -{ - kdb_register("acpi", kdbm_acpi, "", "Enter ACPI debugger", 0); - - return 0; -} - -void -cleanup_module(void) -{ - kdb_unregister("acpi"); -} diff -urN linux-2.4.18/drivers/acpi/namespace/Makefile lia64-2.4/drivers/acpi/namespace/Makefile --- linux-2.4.18/drivers/acpi/namespace/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/namespace/Makefile Tue Apr 9 15:47:00 2002 @@ -1,11 +1,10 @@ # # Makefile for all Linux ACPI interpreter subdirectories -# EXCEPT for the ospm directory # O_TARGET := $(notdir $(CURDIR)).o -obj-$(CONFIG_ACPI) := $(patsubst %.c,%.o,$(wildcard *.c)) +obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c)) EXTRA_CFLAGS += $(ACPI_CFLAGS) diff -urN linux-2.4.18/drivers/acpi/namespace/nsaccess.c lia64-2.4/drivers/acpi/namespace/nsaccess.c --- linux-2.4.18/drivers/acpi/namespace/nsaccess.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/namespace/nsaccess.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: nsaccess - Top-level functions for accessing ACPI namespace - * $Revision: 135 $ + * $Revision: 155 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,13 +26,12 @@ #include "acpi.h" #include "amlcode.h" -#include "acinterp.h" #include "acnamesp.h" #include "acdispat.h" #define _COMPONENT ACPI_NAMESPACE - MODULE_NAME ("nsaccess") + ACPI_MODULE_NAME ("nsaccess") /******************************************************************************* @@ -52,16 +51,19 @@ acpi_status acpi_ns_root_initialize (void) { - acpi_status status = AE_OK; - const predefined_names *init_val = NULL; - acpi_namespace_node *new_node; - acpi_operand_object *obj_desc; + acpi_status status; + const acpi_predefined_names *init_val = NULL; + acpi_namespace_node *new_node; + acpi_operand_object *obj_desc; - FUNCTION_TRACE ("Ns_root_initialize"); + ACPI_FUNCTION_TRACE ("Ns_root_initialize"); - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* * The global root ptr is initially NULL, so a non-NULL value indicates @@ -72,22 +74,20 @@ goto unlock_and_exit; } - /* * Tell the rest of the subsystem that the root is initialized * (This is OK because the namespace is locked) */ acpi_gbl_root_node = &acpi_gbl_root_node_struct; - /* Enter the pre-defined names in the name table */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Entering predefined entries into namespace\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Entering predefined entries into namespace\n")); for (init_val = acpi_gbl_pre_defined_names; init_val->name; init_val++) { status = acpi_ns_lookup (NULL, init_val->name, init_val->type, - IMODE_LOAD_PASS2, NS_NO_UPSEARCH, - NULL, &new_node); + ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, NULL, &new_node); if (ACPI_FAILURE (status) || (!new_node)) /* Must be on same line for code converter */ { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, @@ -116,13 +116,11 @@ * internal representation. Only types actually * used for initial values are implemented here. */ - switch (init_val->type) { - case ACPI_TYPE_INTEGER: obj_desc->integer.value = - (acpi_integer) STRTOUL (init_val->val, NULL, 10); + (acpi_integer) ACPI_STRTOUL (init_val->val, NULL, 10); break; @@ -131,7 +129,7 @@ /* * Build an object around the static string */ - obj_desc->string.length = STRLEN (init_val->val); + obj_desc->string.length = ACPI_STRLEN (init_val->val); obj_desc->string.pointer = init_val->val; obj_desc->common.flags |= AOPOBJ_STATIC_POINTER; break; @@ -140,16 +138,15 @@ case ACPI_TYPE_MUTEX: obj_desc->mutex.sync_level = - (u16) STRTOUL (init_val->val, NULL, 10); + (u16) ACPI_STRTOUL (init_val->val, NULL, 10); - if (STRCMP (init_val->name, "_GL_") == 0) { + if (ACPI_STRCMP (init_val->name, "_GL_") == 0) { /* * Create a counting semaphore for the * global lock */ status = acpi_os_create_semaphore (ACPI_NO_UNIT_LIMIT, 1, &obj_desc->mutex.semaphore); - if (ACPI_FAILURE (status)) { goto unlock_and_exit; } @@ -160,13 +157,11 @@ */ acpi_gbl_global_lock_semaphore = obj_desc->mutex.semaphore; } - else { /* Create a mutex */ status = acpi_os_create_semaphore (1, 1, &obj_desc->mutex.semaphore); - if (ACPI_FAILURE (status)) { goto unlock_and_exit; } @@ -175,7 +170,7 @@ default: - REPORT_ERROR (("Unsupported initial type value %X\n", + ACPI_REPORT_ERROR (("Unsupported initial type value %X\n", init_val->type)); acpi_ut_remove_reference (obj_desc); obj_desc = NULL; @@ -184,7 +179,7 @@ /* Store pointer to value descriptor in the Node */ - acpi_ns_attach_object (new_node, obj_desc, obj_desc->common.type); + status = acpi_ns_attach_object (new_node, obj_desc, obj_desc->common.type); /* Remove local reference to the object */ @@ -194,7 +189,7 @@ unlock_and_exit: - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } @@ -226,8 +221,8 @@ acpi_ns_lookup ( acpi_generic_state *scope_info, NATIVE_CHAR *pathname, - acpi_object_type8 type, - operating_mode interpreter_mode, + acpi_object_type type, + acpi_interpreter_mode interpreter_mode, u32 flags, acpi_walk_state *walk_state, acpi_namespace_node **return_node) @@ -235,33 +230,26 @@ acpi_status status; acpi_namespace_node *prefix_node; acpi_namespace_node *current_node = NULL; - acpi_namespace_node *scope_to_push = NULL; acpi_namespace_node *this_node = NULL; u32 num_segments; acpi_name simple_name; - u8 null_name_path = FALSE; - acpi_object_type8 type_to_check_for; - acpi_object_type8 this_search_type; - u32 local_flags = flags & ~NS_ERROR_IF_FOUND; + acpi_object_type type_to_check_for; + acpi_object_type this_search_type; + u32 local_flags = flags & ~ACPI_NS_ERROR_IF_FOUND; - DEBUG_EXEC (u32 i;) - - FUNCTION_TRACE ("Ns_lookup"); + ACPI_FUNCTION_TRACE ("Ns_lookup"); if (!return_node) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - acpi_gbl_ns_lookup_count++; - - *return_node = ENTRY_NOT_FOUND; - + *return_node = ACPI_ENTRY_NOT_FOUND; if (!acpi_gbl_root_node) { - return (AE_NO_NAMESPACE); + return_ACPI_STATUS (AE_NO_NAMESPACE); } /* @@ -270,7 +258,8 @@ */ if ((!scope_info) || (!scope_info->scope.node)) { - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Null scope prefix, using root node (%p)\n", + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "Null scope prefix, using root node (%p)\n", acpi_gbl_root_node)); prefix_node = acpi_gbl_root_node; @@ -279,7 +268,6 @@ prefix_node = scope_info->scope.node; } - /* * This check is explicitly split to relax the Type_to_check_for * conditions for Bank_field_defn. Originally, both Bank_field_defn and @@ -292,210 +280,201 @@ type_to_check_for = ACPI_TYPE_REGION; } - else if (INTERNAL_TYPE_BANK_FIELD_DEFN == type) { /* Bank_field_defn defines data fields in a Field Object */ type_to_check_for = ACPI_TYPE_ANY; } - else { type_to_check_for = type; } - - /* TBD: [Restructure] - Move the pathname stuff into a new procedure */ - - /* Examine the name pointer */ - + /* + * Begin examination of the actual pathname + */ if (!pathname) { - /* 8-12-98 ASL Grammar Update supports null Name_path */ + /* A Null Name_path is allowed and refers to the root */ - null_name_path = TRUE; num_segments = 0; - this_node = acpi_gbl_root_node; + this_node = acpi_gbl_root_node; + pathname = ""; ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "Null Pathname (Zero segments), Flags=%x\n", flags)); + "Null Pathname (Zero segments), Flags=%X\n", flags)); } - else { /* - * Valid name pointer (Internal name format) + * Name pointer is valid (and must be in internal name format) * - * Check for prefixes. As represented in the AML stream, a - * Pathname consists of an optional scope prefix followed by - * a segment part. + * Check for scope prefixes: * - * If present, the scope prefix is either a Root_prefix (in - * which case the name is fully qualified), or zero or more - * Parent_prefixes (in which case the name's scope is relative - * to the current scope). + * As represented in the AML stream, a namepath consists of an + * optional scope prefix followed by a name segment part. * - * The segment part consists of either: - * - A single 4-byte name segment, or - * - A Dual_name_prefix followed by two 4-byte name segments, or - * - A Multi_name_prefix_op, followed by a byte indicating the - * number of segments and the segments themselves. + * If present, the scope prefix is either a Root Prefix (in + * which case the name is fully qualified), or one or more + * Parent Prefixes (in which case the name's scope is relative + * to the current scope). */ - if (*pathname == AML_ROOT_PREFIX) { - /* Pathname is fully qualified, look in root name table */ + if (*pathname == (u8) AML_ROOT_PREFIX) { + /* Pathname is fully qualified, start from the root */ - current_node = acpi_gbl_root_node; + this_node = acpi_gbl_root_node; - /* point to segment part */ + /* Point to name segment part */ pathname++; ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching from root [%p]\n", - current_node)); - - /* Direct reference to root, "\" */ - - if (!(*pathname)) { - this_node = acpi_gbl_root_node; - goto check_for_new_scope_and_exit; - } + this_node)); } - else { /* Pathname is relative to current scope, start there */ - current_node = prefix_node; - - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching relative to pfx scope [%p]\n", + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "Searching relative to pfx scope [%p]\n", prefix_node)); /* - * Handle up-prefix (carat). More than one prefix - * is supported + * Handle multiple Parent Prefixes (carat) by just getting + * the parent node for each prefix instance. */ - while (*pathname == AML_PARENT_PREFIX) { - /* Point to segment part or next Parent_prefix */ - + this_node = prefix_node; + while (*pathname == (u8) AML_PARENT_PREFIX) { + /* + * Point past this prefix to the name segment + * part or the next Parent Prefix + */ pathname++; - /* Backup to the parent's scope */ + /* Backup to the parent node */ - this_node = acpi_ns_get_parent_object (current_node); + this_node = acpi_ns_get_parent_node (this_node); if (!this_node) { /* Current scope has no parent scope */ - REPORT_ERROR ( - ("Too many parent prefixes (^) - reached root\n")); + ACPI_REPORT_ERROR ( + ("ACPI path has too many parent prefixes (^) - reached beyond root node\n")); return_ACPI_STATUS (AE_NOT_FOUND); } - - current_node = this_node; } } - /* - * Examine the name prefix opcode, if any, - * to determine the number of segments + * Determine the number of ACPI name segments in this pathname. + * + * The segment part consists of either: + * - A Null name segment (0) + * - A Dual_name_prefix followed by two 4-byte name segments + * - A Multi_name_prefix followed by a byte indicating the + * number of segments and the segments themselves. + * - A single 4-byte name segment + * + * Examine the name prefix opcode, if any, to determine the number of + * segments. */ - if (*pathname == AML_DUAL_NAME_PREFIX) { - num_segments = 2; + switch (*pathname) { + case 0: + /* + * Null name after a root or parent prefixes. We already + * have the correct target node and there are no name segments. + */ + num_segments = 0; - /* point to first segment */ + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "Prefix-only Pathname (Zero name segments), Flags=%X\n", flags)); + break; + + case AML_DUAL_NAME_PREFIX: + + /* Two segments, point to first name segment */ + num_segments = 2; pathname++; ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Dual Pathname (2 segments, Flags=%X)\n", flags)); - } + break; - else if (*pathname == AML_MULTI_NAME_PREFIX_OP) { - num_segments = (u32)* (u8 *) ++pathname; + case AML_MULTI_NAME_PREFIX_OP: - /* point to first segment */ + /* Extract segment count, point to first name segment */ pathname++; + num_segments = (u32) (u8) *pathname; + pathname++; ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Multi Pathname (%d Segments, Flags=%X) \n", num_segments, flags)); - } + break; - else { + default: /* - * No Dual or Multi prefix, hence there is only one - * segment and Pathname is already pointing to it. + * Not a Null name, no Dual or Multi prefix, hence there is + * only one name segment and Pathname is already pointing to it. */ num_segments = 1; ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Simple Pathname (1 segment, Flags=%X)\n", flags)); + break; } -#ifdef ACPI_DEBUG - - /* TBD: [Restructure] Make this a procedure */ - - /* Debug only: print the entire name that we are about to lookup */ - - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[")); - - for (i = 0; i < num_segments; i++) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, "%4.4s/", (char*)&pathname[i * 4])); - } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, "]\n")); -#endif + ACPI_DEBUG_EXEC (acpi_ns_print_pathname (num_segments, pathname)); } - /* - * Search namespace for each segment of the name. - * Loop through and verify/add each name segment. + * Search namespace for each segment of the name. Loop through and + * verify/add each name segment. */ - while (num_segments-- && current_node) { + current_node = this_node; + while (num_segments && current_node) { /* * Search for the current name segment under the current - * named object. The Type is significant only at the last (topmost) - * level. (We don't care about the types along the path, only + * named object. The Type is significant only at the last name + * segment. (We don't care about the types along the path, only * the type of the final target object.) */ this_search_type = ACPI_TYPE_ANY; + num_segments--; if (!num_segments) { this_search_type = type; local_flags = flags; } - /* Pluck one ACPI name from the front of the pathname */ + /* Extract one ACPI name from the front of the pathname */ - MOVE_UNALIGNED32_TO_32 (&simple_name, pathname); + ACPI_MOVE_UNALIGNED32_TO_32 (&simple_name, pathname); /* Try to find the ACPI name */ - status = acpi_ns_search_and_enter (simple_name, walk_state, - current_node, interpreter_mode, - this_search_type, local_flags, - &this_node); - + status = acpi_ns_search_and_enter (simple_name, walk_state, current_node, + interpreter_mode, this_search_type, local_flags, &this_node); if (ACPI_FAILURE (status)) { if (status == AE_NOT_FOUND) { - /* Name not found in ACPI namespace */ + /* Name not found in ACPI namespace */ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "Name [%4.4s] not found in scope %p\n", - (char*)&simple_name, current_node)); + "Name [%4.4s] not found in scope [%4.4s] %p\n", + (char *) &simple_name, (char *) ¤t_node->name, current_node)); } return_ACPI_STATUS (status); } - /* + * Sanity typecheck of the target object: + * * If 1) This is the last segment (Num_segments == 0) - * 2) and looking for a specific type + * 2) And we are looking for a specific type * (Not checking for TYPE_ANY) * 3) Which is not an alias - * 4) which is not a local type (TYPE_DEF_ANY) - * 5) which is not a local type (TYPE_SCOPE) - * 6) which is not a local type (TYPE_INDEX_FIELD_DEFN) - * 7) and type of object is known (not TYPE_ANY) - * 8) and object does not match request + * 4) Which is not a local type (TYPE_DEF_ANY) + * 5) Which is not a local type (TYPE_SCOPE) + * 6) Which is not a local type (TYPE_INDEX_FIELD_DEFN) + * 7) And the type of target object is known (not TYPE_ANY) + * 8) And target object does not match what we are looking for * * Then we have a type mismatch. Just warn and ignore it. */ @@ -509,9 +488,9 @@ (this_node->type != type_to_check_for)) { /* Complain about a type mismatch */ - REPORT_WARNING ( + ACPI_REPORT_WARNING ( ("Ns_lookup: %4.4s, type %X, checking for type %X\n", - (char*)&simple_name, this_node->type, type_to_check_for)); + (char *) &simple_name, this_node->type, type_to_check_for)); } /* @@ -519,57 +498,33 @@ * specific type, but the type of found object is known, use that type * to see if it opens a scope. */ - if ((0 == num_segments) && (ACPI_TYPE_ANY == type)) { + if ((num_segments == 0) && (type == ACPI_TYPE_ANY)) { type = this_node->type; } - if ((num_segments || acpi_ns_opens_scope (type)) && - (this_node->child == NULL)) { - /* - * More segments or the type implies enclosed scope, - * and the next scope has not been allocated. - */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Load mode=%X This_node=%p\n", - interpreter_mode, this_node)); - } - - current_node = this_node; - - /* point to next name segment */ + /* Point to next name segment and make this node current */ pathname += ACPI_NAME_SIZE; + current_node = this_node; } - /* * Always check if we need to open a new scope */ -check_for_new_scope_and_exit: - - if (!(flags & NS_DONT_OPEN_SCOPE) && (walk_state)) { + if (!(flags & ACPI_NS_DONT_OPEN_SCOPE) && (walk_state)) { /* - * If entry is a type which opens a scope, - * push the new scope on the scope stack. + * If entry is a type which opens a scope, push the new scope on the + * scope stack. */ if (acpi_ns_opens_scope (type_to_check_for)) { - /* 8-12-98 ASL Grammar Update supports null Name_path */ - - if (null_name_path) { - /* TBD: [Investigate] - is this the correct thing to do? */ - - scope_to_push = NULL; - } - else { - scope_to_push = this_node; - } - - status = acpi_ds_scope_stack_push (scope_to_push, type, - walk_state); + status = acpi_ds_scope_stack_push (this_node, type, walk_state); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Set global scope to %p\n", scope_to_push)); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "Setting current scope to [%4.4s] (%p)\n", + this_node->name.ascii, this_node)); } } diff -urN linux-2.4.18/drivers/acpi/namespace/nsalloc.c lia64-2.4/drivers/acpi/namespace/nsalloc.c --- linux-2.4.18/drivers/acpi/namespace/nsalloc.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/namespace/nsalloc.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: nsalloc - Namespace allocation and deletion utilities - * $Revision: 60 $ + * $Revision: 74 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,11 +26,10 @@ #include "acpi.h" #include "acnamesp.h" -#include "acinterp.h" #define _COMPONENT ACPI_NAMESPACE - MODULE_NAME ("nsalloc") + ACPI_MODULE_NAME ("nsalloc") /******************************************************************************* @@ -52,7 +51,7 @@ acpi_namespace_node *node; - FUNCTION_TRACE ("Ns_create_node"); + ACPI_FUNCTION_TRACE ("Ns_create_node"); node = ACPI_MEM_CALLOCATE (sizeof (acpi_namespace_node)); @@ -62,9 +61,9 @@ ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE].total_allocated++); - node->data_type = ACPI_DESC_TYPE_NAMED; - node->name = name; + node->name.integer = name; node->reference_count = 1; + ACPI_SET_DESCRIPTOR_TYPE (node, ACPI_DESC_TYPE_NAMED); return_PTR (node); } @@ -91,10 +90,10 @@ acpi_namespace_node *next_node; - FUNCTION_TRACE_PTR ("Ns_delete_node", node); + ACPI_FUNCTION_TRACE_PTR ("Ns_delete_node", node); - parent_node = acpi_ns_get_parent_object (node); + parent_node = acpi_ns_get_parent_node (node); prev_node = NULL; next_node = parent_node->child; @@ -118,12 +117,9 @@ ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE].total_freed++); /* - * Detach an object if there is one + * Detach an object if there is one then delete the node */ - if (node->object) { - acpi_ns_detach_object (node); - } - + acpi_ns_detach_object (node); ACPI_MEM_FREE (node); return_VOID; } @@ -140,7 +136,11 @@ * * RETURN: None * - * DESCRIPTION: Initialize a new entry within a namespace table. + * DESCRIPTION: Initialize a new namespace node and install it amongst + * its peers. + * + * Note: Current namespace lookup is linear search, so the nodes + * are not linked in any particular order. * ******************************************************************************/ @@ -149,13 +149,13 @@ acpi_walk_state *walk_state, acpi_namespace_node *parent_node, /* Parent */ acpi_namespace_node *node, /* New Child*/ - acpi_object_type8 type) + acpi_object_type type) { u16 owner_id = TABLE_ID_DSDT; acpi_namespace_node *child_node; - FUNCTION_TRACE ("Ns_install_node"); + ACPI_FUNCTION_TRACE ("Ns_install_node"); /* @@ -167,16 +167,12 @@ owner_id = walk_state->owner_id; } - - /* link the new entry into the parent and existing children */ - - /* TBD: Could be first, last, or alphabetic */ + /* Link the new entry into the parent and existing children */ child_node = parent_node->child; if (!child_node) { parent_node->child = node; } - else { while (!(child_node->flags & ANOBJ_END_OF_PEER_LIST)) { child_node = child_node->peer; @@ -209,8 +205,8 @@ * We will fill in the actual type when the * real definition is found later. */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "[%4.4s] is a forward reference\n", - (char*)&node->name)); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] is a forward reference\n", + node->name.ascii)); } /* @@ -235,13 +231,13 @@ } ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s added to %p at %p\n", - (char*)&node->name, parent_node, node)); + node->name.ascii, parent_node, node)); /* * Increment the reference count(s) of all parents up to * the root! */ - while ((node = acpi_ns_get_parent_object (node)) != NULL) { + while ((node = acpi_ns_get_parent_node (node)) != NULL) { node->reference_count++; } @@ -257,8 +253,8 @@ * * RETURN: None. * - * DESCRIPTION: Delete all children of the parent object. Deletes a - * "scope". + * DESCRIPTION: Delete all children of the parent object. In other words, + * deletes a "scope". * ******************************************************************************/ @@ -271,7 +267,7 @@ u8 flags; - FUNCTION_TRACE_PTR ("Ns_delete_children", parent_node); + ACPI_FUNCTION_TRACE_PTR ("Ns_delete_children", parent_node); if (!parent_node) { @@ -305,7 +301,7 @@ ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE].total_freed++); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object %p, Remaining %X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p, Remaining %X\n", child_node, acpi_gbl_current_node_count)); /* @@ -338,11 +334,11 @@ * RETURN: None. * * DESCRIPTION: Delete a subtree of the namespace. This includes all objects - * stored within the subtree. Scope tables are deleted also + * stored within the subtree. * ******************************************************************************/ -acpi_status +void acpi_ns_delete_namespace_subtree ( acpi_namespace_node *parent_node) { @@ -350,11 +346,11 @@ u32 level = 1; - FUNCTION_TRACE ("Ns_delete_namespace_subtree"); + ACPI_FUNCTION_TRACE ("Ns_delete_namespace_subtree"); if (!parent_node) { - return_ACPI_STATUS (AE_OK); + return_VOID; } /* @@ -383,7 +379,6 @@ child_node = 0; } } - else { /* * No more children of this parent node. @@ -403,11 +398,11 @@ /* Move up the tree to the grandparent */ - parent_node = acpi_ns_get_parent_object (parent_node); + parent_node = acpi_ns_get_parent_node (parent_node); } } - return_ACPI_STATUS (AE_OK); + return_VOID; } @@ -430,34 +425,37 @@ acpi_ns_remove_reference ( acpi_namespace_node *node) { - acpi_namespace_node *next_node; + acpi_namespace_node *parent_node; + acpi_namespace_node *this_node; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* * Decrement the reference count(s) of this node and all * nodes up to the root, Delete anything with zero remaining references. */ - next_node = node; - while (next_node) { - /* Decrement the reference count on this node*/ + this_node = node; + while (this_node) { + /* Prepare to move up to parent */ - next_node->reference_count--; + parent_node = acpi_ns_get_parent_node (this_node); + + /* Decrement the reference count on this node */ + + this_node->reference_count--; /* Delete the node if no more references */ - if (!next_node->reference_count) { + if (!this_node->reference_count) { /* Delete all children and delete the node */ - acpi_ns_delete_children (next_node); - acpi_ns_delete_node (next_node); + acpi_ns_delete_children (this_node); + acpi_ns_delete_node (this_node); } - /* Move up to parent */ - - next_node = acpi_ns_get_parent_object (next_node); + this_node = parent_node; } } @@ -476,65 +474,71 @@ * ******************************************************************************/ -acpi_status +void acpi_ns_delete_namespace_by_owner ( u16 owner_id) { acpi_namespace_node *child_node; + acpi_namespace_node *deletion_node; u32 level; acpi_namespace_node *parent_node; - FUNCTION_TRACE ("Ns_delete_namespace_by_owner"); + ACPI_FUNCTION_TRACE_U32 ("Ns_delete_namespace_by_owner", owner_id); - parent_node = acpi_gbl_root_node; - child_node = 0; - level = 1; + parent_node = acpi_gbl_root_node; + child_node = NULL; + deletion_node = NULL; + level = 1; /* * Traverse the tree of nodes until we bubble back up * to where we started. */ while (level > 0) { - /* Get the next node in this scope (NULL if none) */ + /* + * Get the next child of this parent node. When Child_node is NULL, + * the first child of the parent is returned + */ + child_node = acpi_ns_get_next_node (ACPI_TYPE_ANY, parent_node, child_node); + + if (deletion_node) { + acpi_ns_remove_reference (deletion_node); + deletion_node = NULL; + } - child_node = acpi_ns_get_next_node (ACPI_TYPE_ANY, parent_node, - child_node); if (child_node) { if (child_node->owner_id == owner_id) { - /* Found a child node - detach any attached object */ + /* Found a matching child node - detach any attached object */ acpi_ns_detach_object (child_node); } /* Check if this node has any children */ - if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, 0)) { + if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, NULL)) { /* * There is at least one child of this node, * visit the node */ level++; parent_node = child_node; - child_node = 0; + child_node = NULL; } - else if (child_node->owner_id == owner_id) { - acpi_ns_remove_reference (child_node); + deletion_node = child_node; } } - else { /* * No more children of this parent node. * Move up to the grandparent. */ level--; - if (level != 0) { if (parent_node->owner_id == owner_id) { - acpi_ns_remove_reference (parent_node); + deletion_node = parent_node; } } @@ -544,11 +548,11 @@ /* Move up the tree to the grandparent */ - parent_node = acpi_ns_get_parent_object (parent_node); + parent_node = acpi_ns_get_parent_node (parent_node); } } - return_ACPI_STATUS (AE_OK); + return_VOID; } diff -urN linux-2.4.18/drivers/acpi/namespace/nsdump.c lia64-2.4/drivers/acpi/namespace/nsdump.c --- linux-2.4.18/drivers/acpi/namespace/nsdump.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/namespace/nsdump.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: nsdump - table dumping routines for debug - * $Revision: 105 $ + * $Revision: 135 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,18 +25,57 @@ #include "acpi.h" -#include "acinterp.h" #include "acnamesp.h" -#include "actables.h" #include "acparser.h" #define _COMPONENT ACPI_NAMESPACE - MODULE_NAME ("nsdump") - + ACPI_MODULE_NAME ("nsdump") #if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) + +/******************************************************************************* + * + * FUNCTION: Acpi_ns_print_pathname + * + * PARAMETERS: Num_segment - Number of ACPI name segments + * Pathname - The compressed (internal) path + * + * DESCRIPTION: Print an object's full namespace pathname + * + ******************************************************************************/ + +void +acpi_ns_print_pathname ( + u32 num_segments, + char *pathname) +{ + ACPI_FUNCTION_NAME ("Ns_print_pathname"); + + + if (!(acpi_dbg_level & ACPI_LV_NAMES) || !(acpi_dbg_layer & ACPI_NAMESPACE)) { + return; + } + + /* Print the entire name */ + + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[")); + + while (num_segments) { + acpi_os_printf ("%4.4s", pathname); + pathname += ACPI_NAME_SIZE; + + num_segments--; + if (num_segments) { + acpi_os_printf ("."); + } + } + + acpi_os_printf ("]\n"); +} + + /******************************************************************************* * * FUNCTION: Acpi_ns_dump_pathname @@ -58,11 +97,11 @@ u32 level, u32 component) { - NATIVE_CHAR *buffer; - u32 length; + acpi_buffer buffer; + acpi_status status; - FUNCTION_TRACE ("Ns_dump_pathname"); + ACPI_FUNCTION_TRACE ("Ns_dump_pathname"); /* Do this only if the requested debug level and component are enabled */ @@ -71,21 +110,17 @@ return_ACPI_STATUS (AE_OK); } - buffer = ACPI_MEM_ALLOCATE (PATHNAME_MAX); - if (!buffer) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - /* Convert handle to a full pathname and print it (with supplied message) */ - length = PATHNAME_MAX; - if (ACPI_SUCCESS (acpi_ns_handle_to_pathname (handle, &length, buffer))) { - acpi_os_printf ("%s %s (%p)\n", msg, buffer, handle); - } + buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; - ACPI_MEM_FREE (buffer); + status = acpi_ns_handle_to_pathname (handle, &buffer); + if (ACPI_SUCCESS (status)) { + acpi_os_printf ("%s %s (Node %p)\n", msg, buffer.pointer, handle); + ACPI_MEM_FREE (buffer.pointer); + } - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS (status); } @@ -112,16 +147,17 @@ acpi_walk_info *info = (acpi_walk_info *) context; acpi_namespace_node *this_node; acpi_operand_object *obj_desc = NULL; - acpi_object_type8 obj_type; - acpi_object_type8 type; + acpi_object_type obj_type; + acpi_object_type type; u32 bytes_to_dump; u32 downstream_sibling_mask = 0; u32 level_tmp; u32 which_bit; u32 i; + u32 dbg_level; - PROC_NAME ("Ns_dump_one_object"); + ACPI_FUNCTION_NAME ("Ns_dump_one_object"); this_node = acpi_ns_map_handle_to_node (obj_handle); @@ -147,68 +183,63 @@ return (AE_OK); } - /* Indent the object according to the level */ while (level_tmp--) { - /* Print appropriate characters to form tree structure */ if (level_tmp) { if (downstream_sibling_mask & which_bit) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "|")); + acpi_os_printf ("|"); } - else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ")); + acpi_os_printf (" "); } which_bit <<= 1; } - else { if (acpi_ns_exist_downstream_sibling (this_node + 1)) { - downstream_sibling_mask |= (1 << (level - 1)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+")); + downstream_sibling_mask |= ((u32) 1 << (level - 1)); + acpi_os_printf ("+"); } - else { - downstream_sibling_mask &= ACPI_UINT32_MAX ^ (1 << (level - 1)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+")); + downstream_sibling_mask &= ACPI_UINT32_MAX ^ ((u32) 1 << (level - 1)); + acpi_os_printf ("+"); } if (this_node->child == NULL) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "-")); + acpi_os_printf ("-"); } - else if (acpi_ns_exist_downstream_sibling (this_node->child)) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+")); + acpi_os_printf ("+"); } - else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "-")); + acpi_os_printf ("-"); } } } - /* Check the integrity of our data */ if (type > INTERNAL_TYPE_MAX) { - type = INTERNAL_TYPE_DEF_ANY; /* prints as *ERROR* */ + type = INTERNAL_TYPE_DEF_ANY; /* prints as *ERROR* */ } - if (!acpi_ut_valid_acpi_name (this_node->name)) { - REPORT_WARNING (("Invalid ACPI Name %08X\n", this_node->name)); + if (!acpi_ut_valid_acpi_name (this_node->name.integer)) { + ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n", this_node->name.integer)); } /* * Now we can print out the pertinent information */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %4.4s %-12s %p", - (char*)&this_node->name, acpi_ut_get_type_name (type), this_node)); + acpi_os_printf (" %4.4s %-12s %p", + this_node->name.ascii, acpi_ut_get_type_name (type), this_node); - obj_desc = this_node->object; + dbg_level = acpi_dbg_level; + acpi_dbg_level = 0; + obj_desc = acpi_ns_get_attached_object (this_node); + acpi_dbg_level = dbg_level; switch (info->display_type) { case ACPI_DISPLAY_SUMMARY: @@ -216,110 +247,149 @@ if (!obj_desc) { /* No attached object, we are done */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + acpi_os_printf ("\n"); return (AE_OK); } - switch (type) { case ACPI_TYPE_PROCESSOR: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ID %d Addr %.4X Len %.4X\n", + + acpi_os_printf (" ID %hd Addr %.4X Len %.4X\n", obj_desc->processor.proc_id, obj_desc->processor.address, - obj_desc->processor.length)); + obj_desc->processor.length); break; + case ACPI_TYPE_DEVICE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Notification object: %p", obj_desc)); + + acpi_os_printf (" Notification object: %p", obj_desc); break; + case ACPI_TYPE_METHOD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Args %d Len %.4X Aml %p \n", + + acpi_os_printf (" Args %hd Len %.4X Aml %p \n", obj_desc->method.param_count, obj_desc->method.aml_length, - obj_desc->method.aml_start)); + obj_desc->method.aml_start); break; + case ACPI_TYPE_INTEGER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " = %8.8X%8.8X\n", - HIDWORD (obj_desc->integer.value), - LODWORD (obj_desc->integer.value))); + + acpi_os_printf (" = %8.8X%8.8X\n", + ACPI_HIDWORD (obj_desc->integer.value), + ACPI_LODWORD (obj_desc->integer.value)); break; + case ACPI_TYPE_PACKAGE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Elements %.2X\n", - obj_desc->package.count)); + + if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { + acpi_os_printf (" Elements %.2X\n", + obj_desc->package.count); + } + else { + acpi_os_printf (" [Length not yet evaluated]\n"); + } break; - case ACPI_TYPE_BUFFER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Len %.2X", - obj_desc->buffer.length)); - /* Dump some of the buffer */ + case ACPI_TYPE_BUFFER: - if (obj_desc->buffer.length > 0) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " =")); - for (i = 0; (i < obj_desc->buffer.length && i < 12); i++) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %.2X", - obj_desc->buffer.pointer[i])); + if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { + acpi_os_printf (" Len %.2X", + obj_desc->buffer.length); + + /* Dump some of the buffer */ + + if (obj_desc->buffer.length > 0) { + acpi_os_printf (" ="); + for (i = 0; (i < obj_desc->buffer.length && i < 12); i++) { + acpi_os_printf (" %.2hX", obj_desc->buffer.pointer[i]); + } } + acpi_os_printf ("\n"); + } + else { + acpi_os_printf (" [Length not yet evaluated]\n"); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); break; + case ACPI_TYPE_STRING: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Len %.2X", - obj_desc->string.length)); + + acpi_os_printf (" Len %.2X", obj_desc->string.length); if (obj_desc->string.length > 0) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " = \"%.32s\"...", - obj_desc->string.pointer)); + acpi_os_printf (" = \"%.32s\"", obj_desc->string.pointer); + if (obj_desc->string.length > 32) { + acpi_os_printf ("..."); + } } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + acpi_os_printf ("\n"); break; + case ACPI_TYPE_REGION: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [%s]", - acpi_ut_get_region_name (obj_desc->region.space_id))); + + acpi_os_printf (" [%s]", acpi_ut_get_region_name (obj_desc->region.space_id)); if (obj_desc->region.flags & AOPOBJ_DATA_VALID) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Addr %8.8X%8.8X Len %.4X\n", - HIDWORD(obj_desc->region.address), - LODWORD(obj_desc->region.address), - obj_desc->region.length)); + acpi_os_printf (" Addr %8.8X%8.8X Len %.4X\n", + ACPI_HIDWORD (obj_desc->region.address), + ACPI_LODWORD (obj_desc->region.address), + obj_desc->region.length); } else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [Address/Length not evaluated]\n")); + acpi_os_printf (" [Address/Length not yet evaluated]\n"); } break; + case INTERNAL_TYPE_REFERENCE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [%s]\n", - acpi_ps_get_opcode_name (obj_desc->reference.opcode))); + + acpi_os_printf (" [%s]\n", + acpi_ps_get_opcode_name (obj_desc->reference.opcode)); break; + case ACPI_TYPE_BUFFER_FIELD: - /* TBD: print Buffer name when we can easily get it */ + if (obj_desc->buffer_field.buffer_obj && + obj_desc->buffer_field.buffer_obj->buffer.node) { + acpi_os_printf (" Buf [%4.4s]", + obj_desc->buffer_field.buffer_obj->buffer.node->name.ascii); + } break; + case INTERNAL_TYPE_REGION_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Rgn [%4.4s]", - (char *) &obj_desc->common_field.region_obj->region.node->name)); + + acpi_os_printf (" Rgn [%4.4s]", + obj_desc->common_field.region_obj->region.node->name.ascii); break; + case INTERNAL_TYPE_BANK_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Rgn [%4.4s]", - (char *) &obj_desc->common_field.region_obj->region.node->name)); + + acpi_os_printf (" Rgn [%4.4s] Bnk [%4.4s]", + obj_desc->common_field.region_obj->region.node->name.ascii, + obj_desc->bank_field.bank_obj->common_field.node->name.ascii); break; + case INTERNAL_TYPE_INDEX_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Rgn [%4.4s]", - (char *) &obj_desc->index_field.index_obj->common_field.region_obj->region.node->name)); + + acpi_os_printf (" Idx [%4.4s] Dat [%4.4s]", + obj_desc->index_field.index_obj->common_field.node->name.ascii, + obj_desc->index_field.data_obj->common_field.node->name.ascii); break; + default: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Object %p\n", obj_desc)); + acpi_os_printf (" Object %p\n", obj_desc); break; } @@ -330,74 +400,72 @@ case INTERNAL_TYPE_REGION_FIELD: case INTERNAL_TYPE_BANK_FIELD: case INTERNAL_TYPE_INDEX_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Off %.2X Len %.2X Acc %.2d\n", - (obj_desc->common_field.base_byte_offset * 8) + obj_desc->common_field.start_field_bit_offset, - obj_desc->common_field.bit_length, - obj_desc->common_field.access_bit_width)); + acpi_os_printf (" Off %.2X Len %.2X Acc %.2hd\n", + (obj_desc->common_field.base_byte_offset * 8) + + obj_desc->common_field.start_field_bit_offset, + obj_desc->common_field.bit_length, + obj_desc->common_field.access_byte_width); break; - } + default: + break; + } break; case ACPI_DISPLAY_OBJECTS: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "%p O:%p", - this_node, obj_desc)); + acpi_os_printf ("%p O:%p", + this_node, obj_desc); if (!obj_desc) { /* No attached object, we are done */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + acpi_os_printf ("\n"); return (AE_OK); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(R%d)", - obj_desc->common.reference_count)); + acpi_os_printf ("(R%d)", + obj_desc->common.reference_count); switch (type) { - case ACPI_TYPE_METHOD: /* Name is a Method and its AML offset/length are set */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " M:%p-%X\n", - obj_desc->method.aml_start, - obj_desc->method.aml_length)); - + acpi_os_printf (" M:%p-%X\n", obj_desc->method.aml_start, + obj_desc->method.aml_length); break; - case ACPI_TYPE_INTEGER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " N:%X%X\n", - HIDWORD(obj_desc->integer.value), - LODWORD(obj_desc->integer.value))); + acpi_os_printf (" N:%X%X\n", ACPI_HIDWORD(obj_desc->integer.value), + ACPI_LODWORD(obj_desc->integer.value)); break; - case ACPI_TYPE_STRING: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " S:%p-%X\n", - obj_desc->string.pointer, - obj_desc->string.length)); + acpi_os_printf (" S:%p-%X\n", obj_desc->string.pointer, + obj_desc->string.length); break; - case ACPI_TYPE_BUFFER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " B:%p-%X\n", - obj_desc->buffer.pointer, - obj_desc->buffer.length)); + acpi_os_printf (" B:%p-%X\n", obj_desc->buffer.pointer, + obj_desc->buffer.length); break; - default: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + acpi_os_printf ("\n"); break; } break; + + + default: + acpi_os_printf ("\n"); + break; } /* If debug turned off, done */ @@ -409,48 +477,55 @@ /* If there is an attached object, display it */ - obj_desc = this_node->object; + dbg_level = acpi_dbg_level; + acpi_dbg_level = 0; + obj_desc = acpi_ns_get_attached_object (this_node); + acpi_dbg_level = dbg_level; /* Dump attached objects */ while (obj_desc) { obj_type = INTERNAL_TYPE_INVALID; + acpi_os_printf (" Attached Object %p: ", obj_desc); /* Decode the type of attached object and dump the contents */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Attached Object %p: ", obj_desc)); + switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) { + case ACPI_DESC_TYPE_NAMED: - if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to Node)\n")); + acpi_os_printf ("(Ptr to Node)\n"); bytes_to_dump = sizeof (acpi_namespace_node); - } + break; + + case ACPI_DESC_TYPE_OPERAND: - else if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_INTERNAL)) { obj_type = obj_desc->common.type; if (obj_type > INTERNAL_TYPE_MAX) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %X [UNKNOWN])\n", obj_type)); + acpi_os_printf ("(Ptr to ACPI Object type %X [UNKNOWN])\n", obj_type); bytes_to_dump = 32; } - else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %2.2X [%s])\n", - obj_type, acpi_ut_get_type_name (obj_type))); + acpi_os_printf ("(Ptr to ACPI Object type %s, %X)\n", + acpi_ut_get_type_name (obj_type), obj_type); bytes_to_dump = sizeof (acpi_operand_object); } - } + break; - else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(String or Buffer - not descriptor)\n")); + + default: + + acpi_os_printf ("(String or Buffer ptr - not an object descriptor)\n"); bytes_to_dump = 16; + break; } - DUMP_BUFFER (obj_desc, bytes_to_dump); + ACPI_DUMP_BUFFER (obj_desc, bytes_to_dump); /* If value is NOT an internal object, we are done */ - if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) { + if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) { goto cleanup; } @@ -459,11 +534,11 @@ */ switch (obj_type) { case ACPI_TYPE_STRING: - obj_desc = (acpi_operand_object *) obj_desc->string.pointer; + obj_desc = (void *) obj_desc->string.pointer; break; case ACPI_TYPE_BUFFER: - obj_desc = (acpi_operand_object *) obj_desc->buffer.pointer; + obj_desc = (void *) obj_desc->buffer.pointer; break; case ACPI_TYPE_BUFFER_FIELD: @@ -471,34 +546,34 @@ break; case ACPI_TYPE_PACKAGE: - obj_desc = (acpi_operand_object *) obj_desc->package.elements; + obj_desc = (void *) obj_desc->package.elements; break; case ACPI_TYPE_METHOD: - obj_desc = (acpi_operand_object *) obj_desc->method.aml_start; + obj_desc = (void *) obj_desc->method.aml_start; break; case INTERNAL_TYPE_REGION_FIELD: - obj_desc = (acpi_operand_object *) obj_desc->field.region_obj; + obj_desc = (void *) obj_desc->field.region_obj; break; case INTERNAL_TYPE_BANK_FIELD: - obj_desc = (acpi_operand_object *) obj_desc->bank_field.region_obj; + obj_desc = (void *) obj_desc->bank_field.region_obj; break; case INTERNAL_TYPE_INDEX_FIELD: - obj_desc = (acpi_operand_object *) obj_desc->index_field.index_obj; + obj_desc = (void *) obj_desc->index_field.index_obj; break; - default: + default: goto cleanup; } - obj_type = INTERNAL_TYPE_INVALID; /* Terminate loop after next pass */ + obj_type = INTERNAL_TYPE_INVALID; /* Terminate loop after next pass */ } cleanup: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + acpi_os_printf ("\n"); return (AE_OK); } @@ -521,7 +596,7 @@ void acpi_ns_dump_objects ( - acpi_object_type8 type, + acpi_object_type type, u8 display_type, u32 max_depth, u32 owner_id, @@ -530,7 +605,7 @@ acpi_walk_info info; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); info.debug_level = ACPI_LV_TABLES; @@ -538,8 +613,9 @@ info.display_type = display_type; - acpi_ns_walk_namespace (type, start_handle, max_depth, NS_WALK_NO_UNLOCK, acpi_ns_dump_one_object, - (void *) &info, NULL); + (void) acpi_ns_walk_namespace (type, start_handle, max_depth, + ACPI_NS_WALK_NO_UNLOCK, acpi_ns_dump_one_object, + (void *) &info, NULL); } @@ -569,7 +645,7 @@ u32 i; - PROC_NAME ("Ns_dump_one_device"); + ACPI_FUNCTION_NAME ("Ns_dump_one_device"); status = acpi_ns_dump_one_object (obj_handle, level, context, return_value); @@ -580,8 +656,10 @@ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ")); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %s, ADR: %8.8X%8.8X, Status: %x\n", - info.hardware_id, HIDWORD(info.address), LODWORD(info.address), info.current_status)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %s, ADR: %8.8X%8.8X, Status: %X\n", + info.hardware_id, + ACPI_HIDWORD (info.address), ACPI_LODWORD (info.address), + info.current_status)); } return (status); @@ -602,9 +680,10 @@ acpi_ns_dump_root_devices (void) { acpi_handle sys_bus_handle; + acpi_status status; - PROC_NAME ("Ns_dump_root_devices"); + ACPI_FUNCTION_NAME ("Ns_dump_root_devices"); /* Only dump the table if tracing is enabled */ @@ -613,11 +692,16 @@ return; } - acpi_get_handle (0, NS_SYSTEM_BUS, &sys_bus_handle); + status = acpi_get_handle (0, ACPI_NS_SYSTEM_BUS, &sys_bus_handle); + if (ACPI_FAILURE (status)) { + return; + } ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Display of all devices in the namespace:\n")); - acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, sys_bus_handle, ACPI_UINT32_MAX, NS_WALK_NO_UNLOCK, - acpi_ns_dump_one_device, NULL, NULL); + + status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, sys_bus_handle, + ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK, + acpi_ns_dump_one_device, NULL, NULL); } #endif @@ -643,7 +727,7 @@ acpi_handle search_handle = search_base; - FUNCTION_TRACE ("Ns_dump_tables"); + ACPI_FUNCTION_TRACE ("Ns_dump_tables"); if (!acpi_gbl_root_node) { @@ -655,7 +739,7 @@ return_VOID; } - if (NS_ALL == search_base) { + if (ACPI_NS_ALL == search_base) { /* entire namespace */ search_handle = acpi_gbl_root_node; @@ -688,13 +772,14 @@ acpi_walk_info info; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); info.debug_level = debug_level; info.owner_id = ACPI_UINT32_MAX; + info.display_type = ACPI_DISPLAY_SUMMARY; - acpi_ns_dump_one_object (handle, 1, &info, NULL); + (void) acpi_ns_dump_one_object (handle, 1, &info, NULL); } #endif diff -urN linux-2.4.18/drivers/acpi/namespace/nseval.c lia64-2.4/drivers/acpi/namespace/nseval.c --- linux-2.4.18/drivers/acpi/namespace/nseval.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/namespace/nseval.c Tue Jun 11 14:24:23 2002 @@ -2,12 +2,12 @@ * * Module Name: nseval - Object evaluation interfaces -- includes control * method lookup and execution. - * $Revision: 102 $ + * $Revision: 114 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,14 +26,13 @@ #include "acpi.h" -#include "amlcode.h" #include "acparser.h" #include "acinterp.h" #include "acnamesp.h" #define _COMPONENT ACPI_NAMESPACE - MODULE_NAME ("nseval") + ACPI_MODULE_NAME ("nseval") /******************************************************************************* @@ -72,7 +71,7 @@ acpi_generic_state scope_info; - FUNCTION_TRACE ("Ns_evaluate_relative"); + ACPI_FUNCTION_TRACE ("Ns_evaluate_relative"); /* @@ -91,11 +90,14 @@ /* Get the prefix handle and Node */ - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } prefix_node = acpi_ns_map_handle_to_node (handle); if (!prefix_node) { - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); status = AE_BAD_PARAMETER; goto cleanup; } @@ -104,13 +106,13 @@ scope_info.scope.node = prefix_node; status = acpi_ns_lookup (&scope_info, internal_path, ACPI_TYPE_ANY, - IMODE_EXECUTE, NS_NO_UPSEARCH, NULL, + ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, NULL, &node); - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object [%s] not found [%s]\n", + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Object [%s] not found [%s]\n", pathname, acpi_format_exception (status))); goto cleanup; } @@ -119,12 +121,12 @@ * Now that we have a handle to the object, we can attempt * to evaluate it. */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s [%p] Value %p\n", - pathname, node, node->object)); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p\n", + pathname, node, acpi_ns_get_attached_object (node))); status = acpi_ns_evaluate_by_handle (node, params, return_object); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "*** Completed eval of object %s ***\n", + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "*** Completed eval of object %s ***\n", pathname)); cleanup: @@ -165,7 +167,7 @@ NATIVE_CHAR *internal_path = NULL; - FUNCTION_TRACE ("Ns_evaluate_by_name"); + ACPI_FUNCTION_TRACE ("Ns_evaluate_by_name"); /* Build an internal name string for the method */ @@ -175,18 +177,21 @@ return_ACPI_STATUS (status); } - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* Lookup the name in the namespace */ status = acpi_ns_lookup (NULL, internal_path, ACPI_TYPE_ANY, - IMODE_EXECUTE, NS_NO_UPSEARCH, NULL, + ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, NULL, &node); - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object at [%s] was not found, status=%.4X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Object at [%s] was not found, status=%.4X\n", pathname, status)); goto cleanup; } @@ -195,12 +200,12 @@ * Now that we have a handle to the object, we can attempt * to evaluate it. */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s [%p] Value %p\n", - pathname, node, node->object)); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p\n", + pathname, node, acpi_ns_get_attached_object (node))); status = acpi_ns_evaluate_by_handle (node, params, return_object); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "*** Completed eval of object %s ***\n", + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "*** Completed eval of object %s ***\n", pathname)); @@ -246,7 +251,7 @@ acpi_operand_object *local_return_object; - FUNCTION_TRACE ("Ns_evaluate_by_handle"); + ACPI_FUNCTION_TRACE ("Ns_evaluate_by_handle"); /* Check if namespace has been initialized */ @@ -269,11 +274,14 @@ /* Get the prefix handle and Node */ - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } node = acpi_ns_map_handle_to_node (handle); if (!node) { - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -323,12 +331,9 @@ *return_object = local_return_object; } + /* Map AE_CTRL_RETURN_VALUE to AE_OK, we are done with it */ - /* Map AE_RETURN_VALUE to AE_OK, we are done with it */ - - if (status == AE_CTRL_RETURN_VALUE) { - status = AE_OK; - } + status = AE_OK; } /* @@ -368,7 +373,7 @@ acpi_operand_object *obj_desc; - FUNCTION_TRACE ("Ns_execute_control_method"); + ACPI_FUNCTION_TRACE ("Ns_execute_control_method"); /* Verify that there is a method associated with this object */ @@ -377,21 +382,16 @@ if (!obj_desc) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No attached method object\n")); - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (AE_NULL_OBJECT); } + ACPI_DUMP_PATHNAME (method_node, "Ns_execute_control_method: Executing", + ACPI_LV_INFO, _COMPONENT); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Control method at Offset %p Length %x]\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Method at AML address %p Length %X\n", obj_desc->method.aml_start + 1, obj_desc->method.aml_length - 1)); - DUMP_PATHNAME (method_node, "Ns_execute_control_method: Executing", - ACPI_LV_NAMES, _COMPONENT); - - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "At offset %p\n", - obj_desc->method.aml_start + 1)); - - /* * Unlock the namespace before execution. This allows namespace access * via the external Acpi* interfaces while a method is being executed. @@ -399,7 +399,10 @@ * interpreter locks to ensure that no thread is using the portion of the * namespace that is being deleted. */ - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* * Execute the method via the interpreter. The interpreter is locked @@ -427,7 +430,7 @@ * * DESCRIPTION: Return the current value of the object * - * MUTEX: Assumes namespace is locked + * MUTEX: Assumes namespace is locked, leaves namespace unlocked * ******************************************************************************/ @@ -437,111 +440,59 @@ acpi_operand_object **return_obj_desc) { acpi_status status = AE_OK; - acpi_operand_object *obj_desc; - acpi_operand_object *source_desc; + acpi_namespace_node *resolved_node = node; - FUNCTION_TRACE ("Ns_get_object_value"); + ACPI_FUNCTION_TRACE ("Ns_get_object_value"); /* - * We take the value from certain objects directly + * Objects require additional resolution steps (e.g., the + * Node may be a field that must be read, etc.) -- we can't just grab + * the object out of the node. */ - if ((node->type == ACPI_TYPE_PROCESSOR) || - (node->type == ACPI_TYPE_POWER)) { - /* - * Create a Reference object to contain the object - */ - obj_desc = acpi_ut_create_internal_object (node->type); - if (!obj_desc) { - status = AE_NO_MEMORY; - goto unlock_and_exit; - } - - /* - * Get the attached object - */ - source_desc = acpi_ns_get_attached_object (node); - if (!source_desc) { - status = AE_NULL_OBJECT; - goto unlock_and_exit; - } - - /* - * Just copy from the original to the return object - * - * TBD: [Future] - need a low-level object copy that handles - * the reference count automatically. (Don't want to copy it) - */ - MEMCPY (obj_desc, source_desc, sizeof (acpi_operand_object)); - obj_desc->common.reference_count = 1; - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); - } - /* - * Other objects require a reference object wrapper which we - * then attempt to resolve. + * Use Resolve_node_to_value() to get the associated value. This call + * always deletes Obj_desc (allocated above). + * + * NOTE: we can get away with passing in NULL for a walk state + * because Obj_desc is guaranteed to not be a reference to either + * a method local or a method argument (because this interface can only be + * called from the Acpi_evaluate external interface, never called from + * a running control method.) + * + * Even though we do not directly invoke the interpreter + * for this, we must enter it because we could access an opregion. + * The opregion access code assumes that the interpreter + * is locked. + * + * We must release the namespace lock before entering the + * intepreter. */ - else { - /* Create an Reference object to contain the object */ - - obj_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_REFERENCE); - if (!obj_desc) { - status = AE_NO_MEMORY; - goto unlock_and_exit; - } - - /* Construct a descriptor pointing to the name */ - - obj_desc->reference.opcode = (u8) AML_NAME_OP; - obj_desc->reference.object = (void *) node; + status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + status = acpi_ex_enter_interpreter (); + if (ACPI_SUCCESS (status)) { + status = acpi_ex_resolve_node_to_value (&resolved_node, NULL); /* - * Use Resolve_to_value() to get the associated value. This call - * always deletes Obj_desc (allocated above). - * - * NOTE: we can get away with passing in NULL for a walk state - * because Obj_desc is guaranteed to not be a reference to either - * a method local or a method argument - * - * Even though we do not directly invoke the interpreter - * for this, we must enter it because we could access an opregion. - * The opregion access code assumes that the interpreter - * is locked. - * - * We must release the namespace lock before entering the - * intepreter. + * If Acpi_ex_resolve_node_to_value() succeeded, the return value was + * placed in Resolved_node. */ - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); - status = acpi_ex_enter_interpreter (); - if (ACPI_SUCCESS (status)) { - status = acpi_ex_resolve_to_value (&obj_desc, NULL); + acpi_ex_exit_interpreter (); - acpi_ex_exit_interpreter (); + if (ACPI_SUCCESS (status)) { + status = AE_CTRL_RETURN_VALUE; + *return_obj_desc = ACPI_CAST_PTR (acpi_operand_object, resolved_node); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returning obj %p\n", resolved_node)); } } - /* - * If Acpi_ex_resolve_to_value() succeeded, the return value was - * placed in Obj_desc. - */ - if (ACPI_SUCCESS (status)) { - status = AE_CTRL_RETURN_VALUE; - - *return_obj_desc = obj_desc; - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Returning obj %p\n", *return_obj_desc)); - } - /* Namespace is unlocked */ return_ACPI_STATUS (status); - - -unlock_and_exit: - - /* Unlock the namespace */ - - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); - return_ACPI_STATUS (status); } + diff -urN linux-2.4.18/drivers/acpi/namespace/nsinit.c lia64-2.4/drivers/acpi/namespace/nsinit.c --- linux-2.4.18/drivers/acpi/namespace/nsinit.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/namespace/nsinit.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: nsinit - namespace initialization - * $Revision: 33 $ + * $Revision: 47 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ #include "acinterp.h" #define _COMPONENT ACPI_NAMESPACE - MODULE_NAME ("nsinit") + ACPI_MODULE_NAME ("nsinit") /******************************************************************************* @@ -54,20 +54,16 @@ acpi_init_walk_info info; - FUNCTION_TRACE ("Ns_initialize_objects"); + ACPI_FUNCTION_TRACE ("Ns_initialize_objects"); ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "**** Starting initialization of namespace objects ****\n")); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Completing Region and Field initialization:")); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Completing Region/Field/Buffer/Package initialization:")); + /* Set all init info to zero */ - info.field_count = 0; - info.field_init = 0; - info.op_region_count = 0; - info.op_region_init = 0; - info.object_count = 0; - + ACPI_MEMSET (&info, 0, sizeof (acpi_init_walk_info)); /* Walk entire namespace from the supplied root */ @@ -75,17 +71,20 @@ ACPI_UINT32_MAX, acpi_ns_init_one_object, &info, NULL); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Walk_namespace failed! %x\n", status)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Walk_namespace failed! %s\n", + acpi_format_exception (status))); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - "\n%d/%d Regions, %d/%d Fields initialized (%d nodes total)\n", - info.op_region_init, info.op_region_count, info.field_init, - info.field_count, info.object_count)); + "\n_initialized %hd/%hd Regions %hd/%hd Fields %hd/%hd Buffers %hd/%hd Packages (%hd nodes)\n", + info.op_region_init, info.op_region_count, + info.field_init, info.field_count, + info.buffer_init, info.buffer_count, + info.package_init, info.package_count, info.object_count)); ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "%d Control Methods found\n", info.method_count)); + "%hd Control Methods found\n", info.method_count)); ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "%d Op Regions found\n", info.op_region_count)); + "%hd Op Regions found\n", info.op_region_count)); return_ACPI_STATUS (AE_OK); } @@ -115,26 +114,29 @@ acpi_device_walk_info info; - FUNCTION_TRACE ("Ns_initialize_devices"); + ACPI_FUNCTION_TRACE ("Ns_initialize_devices"); + + /* Init counters */ info.device_count = 0; info.num_STA = 0; info.num_INI = 0; + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Executing all Device _STA and_INI methods:")); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Executing device _INI methods:")); + /* Walk namespace for all objects of type Device */ status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, FALSE, acpi_ns_init_one_device, &info, NULL); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Walk_namespace failed! %x\n", status)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Walk_namespace failed! %s\n", + acpi_format_exception (status))); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - "\n%d Devices found: %d _STA, %d _INI\n", + "\n%hd Devices found containing: %hd _STA, %hd _INI methods\n", info.device_count, info.num_STA, info.num_INI)); return_ACPI_STATUS (status); @@ -168,32 +170,57 @@ void *context, void **return_value) { - acpi_object_type8 type; + acpi_object_type type; acpi_status status; acpi_init_walk_info *info = (acpi_init_walk_info *) context; acpi_namespace_node *node = (acpi_namespace_node *) obj_handle; acpi_operand_object *obj_desc; - PROC_NAME ("Ns_init_one_object"); + ACPI_FUNCTION_NAME ("Ns_init_one_object"); info->object_count++; - /* And even then, we are only interested in a few object types */ type = acpi_ns_get_type (obj_handle); - obj_desc = node->object; + obj_desc = acpi_ns_get_attached_object (node); if (!obj_desc) { return (AE_OK); } - if ((type != ACPI_TYPE_REGION) && - (type != ACPI_TYPE_BUFFER_FIELD)) { + /* Increment counters for object types we are looking for */ + + switch (type) { + case ACPI_TYPE_REGION: + info->op_region_count++; + break; + + case ACPI_TYPE_BUFFER_FIELD: + info->field_count++; + break; + + case ACPI_TYPE_BUFFER: + info->buffer_count++; + break; + + case ACPI_TYPE_PACKAGE: + info->package_count++; + break; + + default: + + /* No init required, just exit now */ return (AE_OK); } + /* + * If the object is already initialized, nothing else to do + */ + if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { + return (AE_OK); + } /* * Must lock the interpreter before executing AML code @@ -203,61 +230,57 @@ return (status); } + /* + * Each of these types can contain executable AML code within + * the declaration. + */ switch (type) { - case ACPI_TYPE_REGION: - info->op_region_count++; - if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { - break; - } - info->op_region_init++; status = acpi_ds_get_region_arguments (obj_desc); - if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n")); - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "%s while getting region arguments [%4.4s]\n", - acpi_format_exception (status), (char*)&node->name)); - } - - if (!(acpi_dbg_level & ACPI_LV_INIT)) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, ".")); - } - break; case ACPI_TYPE_BUFFER_FIELD: - info->field_count++; - if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { - break; - } - info->field_init++; status = acpi_ds_get_buffer_field_arguments (obj_desc); - if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n")); - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "%s while getting buffer field arguments [%4.4s]\n", - acpi_format_exception (status), (char*)&node->name)); - } - if (!(acpi_dbg_level & ACPI_LV_INIT)) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, ".")); - } + break; + case ACPI_TYPE_BUFFER: + + info->buffer_init++; + status = acpi_ds_get_buffer_arguments (obj_desc); + break; + + + case ACPI_TYPE_PACKAGE: + + info->package_init++; + status = acpi_ds_get_package_arguments (obj_desc); break; default: + /* No other types can get here */ break; } + if (ACPI_FAILURE (status)) { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Could not execute arguments for [%4.4s] (%s), %s\n", + node->name.ascii, acpi_ut_get_type_name (type), acpi_format_exception (status))); + } + + if (!(acpi_dbg_level & ACPI_LV_INIT)) { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, ".")); + } /* * We ignore errors from above, and always return OK, since - * we don't want to abort the walk on a single error. + * we don't want to abort the walk on any single error. */ acpi_ex_exit_interpreter (); return (AE_OK); @@ -291,7 +314,7 @@ acpi_device_walk_info *info = (acpi_device_walk_info *) context; - FUNCTION_TRACE ("Ns_init_one_device"); + ACPI_FUNCTION_TRACE ("Ns_init_one_device"); if (!(acpi_dbg_level & ACPI_LV_INIT)) { @@ -300,20 +323,26 @@ info->device_count++; - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } node = acpi_ns_map_handle_to_node (obj_handle); if (!node) { - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); - return (AE_BAD_PARAMETER); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + return_ACPI_STATUS (AE_BAD_PARAMETER); } - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* * Run _STA to determine if we can run _INI on the device. */ - DEBUG_EXEC (acpi_ut_display_init_pathname (node, "_STA [Method]")); + ACPI_DEBUG_EXEC (acpi_ut_display_init_pathname (node, "_STA [Method]")); status = acpi_ut_execute_STA (node, &flags); if (ACPI_FAILURE (status)) { /* Ignore error and move on to next device */ @@ -329,36 +358,41 @@ return_ACPI_STATUS(AE_CTRL_DEPTH); } - /* * The device is present. Run _INI. */ - DEBUG_EXEC (acpi_ut_display_init_pathname (obj_handle, "_INI [Method]")); + ACPI_DEBUG_EXEC (acpi_ut_display_init_pathname (obj_handle, "_INI [Method]")); status = acpi_ns_evaluate_relative (obj_handle, "_INI", NULL, NULL); - if (AE_NOT_FOUND == status) { - /* No _INI means device requires no initialization */ + if (ACPI_FAILURE (status)) { + /* No _INI (AE_NOT_FOUND) means device requires no initialization */ - status = AE_OK; - } + if (status != AE_NOT_FOUND) { + /* Ignore error and move on to next device */ - else if (ACPI_FAILURE (status)) { - /* Ignore error and move on to next device */ + #ifdef ACPI_DEBUG + NATIVE_CHAR *scope_name = acpi_ns_get_external_pathname (obj_handle); -#ifdef ACPI_DEBUG - NATIVE_CHAR *scope_name = acpi_ns_get_table_pathname (obj_handle); + ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "%s._INI failed: %s\n", + scope_name, acpi_format_exception (status))); - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "%s._INI failed: %s\n", - scope_name, acpi_format_exception (status))); + ACPI_MEM_FREE (scope_name); + #endif + } - ACPI_MEM_FREE (scope_name); -#endif + status = AE_OK; } - else { /* Count of successful INIs */ info->num_INI++; } - return_ACPI_STATUS (AE_OK); + if (acpi_gbl_init_handler) { + /* External initialization handler is present, call it */ + + status = acpi_gbl_init_handler (obj_handle, ACPI_INIT_DEVICE_INI); + } + + + return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/namespace/nsload.c lia64-2.4/drivers/acpi/namespace/nsload.c --- linux-2.4.18/drivers/acpi/namespace/nsload.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/namespace/nsload.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: nsload - namespace loading/expanding/contracting procedures - * $Revision: 47 $ + * $Revision: 55 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,23 +25,21 @@ #include "acpi.h" -#include "acinterp.h" #include "acnamesp.h" #include "amlcode.h" #include "acparser.h" #include "acdispat.h" -#include "acdebug.h" #define _COMPONENT ACPI_NAMESPACE - MODULE_NAME ("nsload") + ACPI_MODULE_NAME ("nsload") /******************************************************************************* * * FUNCTION: Acpi_load_namespace * - * PARAMETERS: Display_aml_during_load + * PARAMETERS: None * * RETURN: Status * @@ -57,7 +55,7 @@ acpi_status status; - FUNCTION_TRACE ("Acpi_load_name_space"); + ACPI_FUNCTION_TRACE ("Acpi_load_name_space"); /* There must be at least a DSDT installed */ @@ -67,7 +65,6 @@ return_ACPI_STATUS (AE_NO_ACPI_TABLES); } - /* * Load the namespace. The DSDT is required, * but the SSDT and PSDT tables are optional. @@ -79,15 +76,13 @@ /* Ignore exceptions from these */ - acpi_ns_load_table_by_type (ACPI_TABLE_SSDT); - acpi_ns_load_table_by_type (ACPI_TABLE_PSDT); - + (void) acpi_ns_load_table_by_type (ACPI_TABLE_SSDT); + (void) acpi_ns_load_table_by_type (ACPI_TABLE_PSDT); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "ACPI Namespace successfully loaded at root %p\n", acpi_gbl_root_node)); - return_ACPI_STATUS (status); } @@ -96,11 +91,12 @@ * * FUNCTION: Acpi_ns_one_parse_pass * - * PARAMETERS: + * PARAMETERS: Pass_number - 1 or 2 + * Table_desc - The table to be parsed. * * RETURN: Status * - * DESCRIPTION: + * DESCRIPTION: Perform one complete parse of an ACPI/AML table. * ******************************************************************************/ @@ -114,7 +110,7 @@ acpi_walk_state *walk_state; - FUNCTION_TRACE ("Ns_one_complete_parse"); + ACPI_FUNCTION_TRACE ("Ns_one_complete_parse"); /* Create and init a Root Node */ @@ -124,8 +120,7 @@ return_ACPI_STATUS (AE_NO_MEMORY); } - ((acpi_parse2_object *) parse_root)->name = ACPI_ROOT_NAME; - + parse_root->named.name = ACPI_ROOT_NAME; /* Create and initialize a new walk state */ @@ -174,7 +169,7 @@ acpi_status status; - FUNCTION_TRACE ("Ns_parse_table"); + ACPI_FUNCTION_TRACE ("Ns_parse_table"); /* @@ -192,7 +187,6 @@ return_ACPI_STATUS (status); } - /* * AML Parse, pass 2 * @@ -232,8 +226,18 @@ acpi_status status; - FUNCTION_TRACE ("Ns_load_table"); + ACPI_FUNCTION_TRACE ("Ns_load_table"); + + /* Check if table contains valid AML (must be DSDT, PSDT, SSDT, etc.) */ + + if (!(acpi_gbl_acpi_table_data[table_desc->type].flags & ACPI_TABLE_EXECUTABLE)) { + /* Just ignore this table */ + + return_ACPI_STATUS (AE_OK); + } + + /* Check validity of the AML start and length */ if (!table_desc->aml_start) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null AML pointer\n")); @@ -242,13 +246,11 @@ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AML block at %p\n", table_desc->aml_start)); - if (!table_desc->aml_length) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Zero-length AML block\n")); return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* * Parse the table and load the namespace with all named * objects found within. Control methods are NOT parsed @@ -260,9 +262,13 @@ */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Loading table into namespace ****\n")); - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + status = acpi_ns_parse_table (table_desc, node->child); - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); @@ -305,22 +311,23 @@ acpi_table_type table_type) { u32 i; - acpi_status status = AE_OK; + acpi_status status; acpi_table_desc *table_desc; - FUNCTION_TRACE ("Ns_load_table_by_type"); + ACPI_FUNCTION_TRACE ("Ns_load_table_by_type"); - acpi_ut_acquire_mutex (ACPI_MTX_TABLES); - + status = acpi_ut_acquire_mutex (ACPI_MTX_TABLES); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* * Table types supported are: * DSDT (one), SSDT/PSDT (multiple) */ switch (table_type) { - case ACPI_TABLE_DSDT: ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading DSDT\n")); @@ -408,11 +415,8 @@ unlock_and_exit: - - acpi_ut_release_mutex (ACPI_MTX_TABLES); - + (void) acpi_ut_release_mutex (ACPI_MTX_TABLES); return_ACPI_STATUS (status); - } @@ -427,8 +431,8 @@ * DESCRIPTION: Walks the namespace starting at the given handle and deletes * all objects, entries, and scopes in the entire subtree. * - * TBD: [Investigate] What if any part of this subtree is in use? - * (i.e. on one of the object stacks?) + * Namespace/Interpreter should be locked or the subsystem should + * be in shutdown before this routine is called. * ******************************************************************************/ @@ -444,7 +448,7 @@ u32 level; - FUNCTION_TRACE ("Ns_delete_subtree"); + ACPI_FUNCTION_TRACE ("Ns_delete_subtree"); parent_handle = start_handle; @@ -463,7 +467,6 @@ child_handle = next_child_handle; - /* Did we get a new object? */ if (ACPI_SUCCESS (status)) { @@ -480,7 +483,6 @@ child_handle = 0; } } - else { /* * No more children in this object, go back up to @@ -493,7 +495,10 @@ acpi_ns_delete_children (child_handle); child_handle = parent_handle; - acpi_get_parent (parent_handle, &parent_handle); + status = acpi_get_parent (parent_handle, &parent_handle); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } } } @@ -526,7 +531,7 @@ acpi_status status; - FUNCTION_TRACE ("Ns_unload_name_space"); + ACPI_FUNCTION_TRACE ("Ns_unload_name_space"); /* Parameter validation */ @@ -538,7 +543,6 @@ if (!handle) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* This function does the real work */ diff -urN linux-2.4.18/drivers/acpi/namespace/nsnames.c lia64-2.4/drivers/acpi/namespace/nsnames.c --- linux-2.4.18/drivers/acpi/namespace/nsnames.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/namespace/nsnames.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: nsnames - Name manipulation and search - * $Revision: 64 $ + * $Revision: 77 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,96 +26,127 @@ #include "acpi.h" #include "amlcode.h" -#include "acinterp.h" #include "acnamesp.h" #define _COMPONENT ACPI_NAMESPACE - MODULE_NAME ("nsnames") + ACPI_MODULE_NAME ("nsnames") /******************************************************************************* * - * FUNCTION: Acpi_ns_get_table_pathname + * FUNCTION: Acpi_ns_build_external_path * - * PARAMETERS: Node - Scope whose name is needed + * PARAMETERS: Node - NS node whose pathname is needed + * Size - Size of the pathname + * *Name_buffer - Where to return the pathname * - * RETURN: Pointer to storage containing the fully qualified name of - * the scope, in Label format (all segments strung together - * with no separators) + * RETURN: Places the pathname into the Name_buffer, in external format + * (name segments separated by path separators) * - * DESCRIPTION: Used for debug printing in Acpi_ns_search_table(). + * DESCRIPTION: Generate a full pathaname * ******************************************************************************/ -NATIVE_CHAR * -acpi_ns_get_table_pathname ( - acpi_namespace_node *node) +void +acpi_ns_build_external_path ( + acpi_namespace_node *node, + ACPI_SIZE size, + NATIVE_CHAR *name_buffer) { - NATIVE_CHAR *name_buffer; - u32 size; - acpi_name name; - acpi_namespace_node *child_node; + ACPI_SIZE index; acpi_namespace_node *parent_node; - FUNCTION_TRACE_PTR ("Ns_get_table_pathname", node); + ACPI_FUNCTION_NAME ("Ns_build_external_path"); - if (!acpi_gbl_root_node || !node) { - /* - * If the name space has not been initialized, - * this function should not have been called. - */ - return_PTR (NULL); + /* Special case for root */ + + index = size - 1; + if (index < ACPI_NAME_SIZE) { + name_buffer[0] = AML_ROOT_PREFIX; + name_buffer[1] = 0; + return; } - child_node = node->child; + /* Store terminator byte, then build name backwards */ + + parent_node = node; + name_buffer[index] = 0; + while ((index > ACPI_NAME_SIZE) && (parent_node != acpi_gbl_root_node)) { + index -= ACPI_NAME_SIZE; - /* Calculate required buffer size based on depth below root */ + /* Put the name into the buffer */ + + ACPI_MOVE_UNALIGNED32_TO_32 ((name_buffer + index), &parent_node->name); + parent_node = acpi_ns_get_parent_node (parent_node); - size = 1; - parent_node = child_node; - while (parent_node) { - parent_node = acpi_ns_get_parent_object (parent_node); - if (parent_node) { - size += ACPI_NAME_SIZE; - } + /* Prefix name with the path separator */ + + index--; + name_buffer[index] = PATH_SEPARATOR; } + /* Overwrite final separator with the root prefix character */ - /* Allocate a buffer to be returned to caller */ + name_buffer[index] = AML_ROOT_PREFIX; - name_buffer = ACPI_MEM_CALLOCATE (size + 1); - if (!name_buffer) { - REPORT_ERROR (("Ns_get_table_pathname: allocation failure\n")); - return_PTR (NULL); + if (index != 0) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Could not construct pathname; index=%X, size=%X, Path=%s\n", + (u32) index, (u32) size, &name_buffer[size])); } + return; +} - /* Store terminator byte, then build name backwards */ - name_buffer[size] = '\0'; - while ((size > ACPI_NAME_SIZE) && - acpi_ns_get_parent_object (child_node)) { - size -= ACPI_NAME_SIZE; - name = acpi_ns_find_parent_name (child_node); +#ifdef ACPI_DEBUG +/******************************************************************************* + * + * FUNCTION: Acpi_ns_get_external_pathname + * + * PARAMETERS: Node - NS node whose pathname is needed + * + * RETURN: Pointer to storage containing the fully qualified name of + * the node, In external format (name segments separated by path + * separators.) + * + * DESCRIPTION: Used for debug printing in Acpi_ns_search_table(). + * + ******************************************************************************/ - /* Put the name into the buffer */ +NATIVE_CHAR * +acpi_ns_get_external_pathname ( + acpi_namespace_node *node) +{ + NATIVE_CHAR *name_buffer; + ACPI_SIZE size; + + + ACPI_FUNCTION_TRACE_PTR ("Ns_get_external_pathname", node); - MOVE_UNALIGNED32_TO_32 ((name_buffer + size), &name); - child_node = acpi_ns_get_parent_object (child_node); - } - name_buffer[--size] = AML_ROOT_PREFIX; + /* Calculate required buffer size based on depth below root */ + + size = acpi_ns_get_pathname_length (node); + + /* Allocate a buffer to be returned to caller */ - if (size != 0) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Bad pointer returned; size=%X\n", size)); + name_buffer = ACPI_MEM_CALLOCATE (size); + if (!name_buffer) { + ACPI_REPORT_ERROR (("Ns_get_table_pathname: allocation failure\n")); + return_PTR (NULL); } + /* Build the path in the allocated buffer */ + + acpi_ns_build_external_path (node, size, name_buffer); return_PTR (name_buffer); } +#endif /******************************************************************************* @@ -130,31 +161,27 @@ * ******************************************************************************/ -u32 +ACPI_SIZE acpi_ns_get_pathname_length ( acpi_namespace_node *node) { - u32 size; + ACPI_SIZE size; acpi_namespace_node *next_node; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* * Compute length of pathname as 5 * number of name segments. * Go back up the parent tree to the root */ - for (size = 0, next_node = node; - acpi_ns_get_parent_object (next_node); - next_node = acpi_ns_get_parent_object (next_node)) { - size += PATH_SEGMENT_LENGTH; - } - - /* Special case for size still 0 - no parent for "special" nodes */ + size = 0; + next_node = node; - if (!size) { - size = PATH_SEGMENT_LENGTH; + while (next_node != acpi_gbl_root_node) { + size += PATH_SEGMENT_LENGTH; + next_node = acpi_ns_get_parent_node (next_node); } return (size + 1); @@ -167,96 +194,49 @@ * * PARAMETERS: Target_handle - Handle of named object whose name is * to be found - * Buf_size - Size of the buffer provided - * User_buffer - Where the pathname is returned + * Buffer - Where the pathname is returned * * RETURN: Status, Buffer is filled with pathname if status is AE_OK * * DESCRIPTION: Build and return a full namespace pathname * - * MUTEX: Locks Namespace - * ******************************************************************************/ acpi_status acpi_ns_handle_to_pathname ( acpi_handle target_handle, - u32 *buf_size, - NATIVE_CHAR *user_buffer) + acpi_buffer *buffer) { - acpi_status status = AE_OK; + acpi_status status; acpi_namespace_node *node; - u32 path_length; - u32 user_buf_size; - acpi_name name; - u32 size; + ACPI_SIZE required_size; - FUNCTION_TRACE_PTR ("Ns_handle_to_pathname", target_handle); + ACPI_FUNCTION_TRACE_PTR ("Ns_handle_to_pathname", target_handle); - if (!acpi_gbl_root_node) { - /* - * If the name space has not been initialized, - * this function should not have been called. - */ - return_ACPI_STATUS (AE_NO_NAMESPACE); - } - node = acpi_ns_map_handle_to_node (target_handle); if (!node) { return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* Determine size required for the caller buffer */ - /* Set return length to the required path length */ - - path_length = acpi_ns_get_pathname_length (node); - size = path_length - 1; - - user_buf_size = *buf_size; - *buf_size = path_length; + required_size = acpi_ns_get_pathname_length (node); - /* Check if the user buffer is sufficiently large */ + /* Validate/Allocate/Clear caller buffer */ - if (path_length > user_buf_size) { - status = AE_BUFFER_OVERFLOW; - goto exit; + status = acpi_ut_initialize_buffer (buffer, required_size); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } - /* Store null terminator */ - - user_buffer[size] = 0; - size -= ACPI_NAME_SIZE; - - /* Put the original ACPI name at the end of the path */ - - MOVE_UNALIGNED32_TO_32 ((user_buffer + size), - &node->name); - - user_buffer[--size] = PATH_SEPARATOR; - - /* Build name backwards, putting "." between segments */ - - while ((size > ACPI_NAME_SIZE) && node) { - size -= ACPI_NAME_SIZE; - name = acpi_ns_find_parent_name (node); - MOVE_UNALIGNED32_TO_32 ((user_buffer + size), &name); - - user_buffer[--size] = PATH_SEPARATOR; - node = acpi_ns_get_parent_object (node); - } - - /* - * Overlay the "." preceding the first segment with - * the root name "\" - */ - user_buffer[size] = '\\'; + /* Build the path in the caller buffer */ - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Len=%X, %s \n", path_length, user_buffer)); + acpi_ns_build_external_path (node, required_size, buffer->pointer); -exit: - return_ACPI_STATUS (status); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s [%X] \n", (char *) buffer->pointer, (u32) required_size)); + return_ACPI_STATUS (AE_OK); } diff -urN linux-2.4.18/drivers/acpi/namespace/nsobject.c lia64-2.4/drivers/acpi/namespace/nsobject.c --- linux-2.4.18/drivers/acpi/namespace/nsobject.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/namespace/nsobject.c Tue Jun 11 14:24:23 2002 @@ -2,12 +2,12 @@ * * Module Name: nsobject - Utilities for objects attached to namespace * table entries - * $Revision: 67 $ + * $Revision: 82 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,14 +26,11 @@ #include "acpi.h" -#include "amlcode.h" #include "acnamesp.h" -#include "acinterp.h" -#include "actables.h" #define _COMPONENT ACPI_NAMESPACE - MODULE_NAME ("nsobject") + ACPI_MODULE_NAME ("nsobject") /******************************************************************************* @@ -48,6 +45,8 @@ * DESCRIPTION: Record the given object as the value associated with the * name whose acpi_handle is passed. If Object is NULL * and Type is ACPI_TYPE_ANY, set the name as having no value. + * Note: Future may require that the Node->Flags field be passed + * as a parameter. * * MUTEX: Assumes namespace is locked * @@ -57,45 +56,37 @@ acpi_ns_attach_object ( acpi_namespace_node *node, acpi_operand_object *object, - acpi_object_type8 type) + acpi_object_type type) { acpi_operand_object *obj_desc; - acpi_operand_object *previous_obj_desc; - acpi_object_type8 obj_type = ACPI_TYPE_ANY; - u8 flags; + acpi_operand_object *last_obj_desc; + acpi_object_type object_type = ACPI_TYPE_ANY; - FUNCTION_TRACE ("Ns_attach_object"); + ACPI_FUNCTION_TRACE ("Ns_attach_object"); /* * Parameter validation */ - if (!acpi_gbl_root_node) { - /* Name space not initialized */ - - REPORT_ERROR (("Ns_attach_object: Namespace not initialized\n")); - return_ACPI_STATUS (AE_NO_NAMESPACE); - } - if (!node) { /* Invalid handle */ - REPORT_ERROR (("Ns_attach_object: Null Named_obj handle\n")); + ACPI_REPORT_ERROR (("Ns_attach_object: Null Named_obj handle\n")); return_ACPI_STATUS (AE_BAD_PARAMETER); } if (!object && (ACPI_TYPE_ANY != type)) { /* Null object */ - REPORT_ERROR (("Ns_attach_object: Null object, but type not ACPI_TYPE_ANY\n")); + ACPI_REPORT_ERROR (("Ns_attach_object: Null object, but type not ACPI_TYPE_ANY\n")); return_ACPI_STATUS (AE_BAD_PARAMETER); } - if (!VALID_DESCRIPTOR_TYPE (node, ACPI_DESC_TYPE_NAMED)) { + if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) { /* Not a name handle */ - REPORT_ERROR (("Ns_attach_object: Invalid handle\n")); + ACPI_REPORT_ERROR (("Ns_attach_object: Invalid handle\n")); return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -108,42 +99,27 @@ return_ACPI_STATUS (AE_OK); } - - /* Get the current flags field of the Node */ - - flags = node->flags; - flags &= ~ANOBJ_AML_ATTACHMENT; - - /* If null object, we will just install it */ if (!object) { - obj_desc = NULL; - obj_type = ACPI_TYPE_ANY; + obj_desc = NULL; + object_type = ACPI_TYPE_ANY; } /* * If the source object is a namespace Node with an attached object, * we will use that (attached) object */ - else if (VALID_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_NAMED) && + else if ((ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_NAMED) && ((acpi_namespace_node *) object)->object) { /* * Value passed is a name handle and that name has a * non-null value. Use that name's value and type. */ - obj_desc = ((acpi_namespace_node *) object)->object; - obj_type = ((acpi_namespace_node *) object)->type; - - /* - * Copy appropriate flags - */ - if (((acpi_namespace_node *) object)->flags & ANOBJ_AML_ATTACHMENT) { - flags |= ANOBJ_AML_ATTACHMENT; - } + obj_desc = ((acpi_namespace_node *) object)->object; + object_type = ((acpi_namespace_node *) object)->type; } - /* * Otherwise, we will use the parameter object, but we must type * it first @@ -154,68 +130,46 @@ /* If a valid type (non-ANY) was given, just use it */ if (ACPI_TYPE_ANY != type) { - obj_type = type; + object_type = type; } - else { - /* - * Cannot figure out the type -- set to Def_any which - * will print as an error in the name table dump - */ - if (acpi_dbg_level > 0) { - DUMP_PATHNAME (node, - "Ns_attach_object confused: setting bogus type for ", - ACPI_LV_INFO, _COMPONENT); - - if (VALID_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_NAMED)) { - DUMP_PATHNAME (object, "name ", ACPI_LV_INFO, _COMPONENT); - } - - else { - DUMP_PATHNAME (object, "object ", ACPI_LV_INFO, _COMPONENT); - DUMP_STACK_ENTRY (object); - } - } - - obj_type = INTERNAL_TYPE_DEF_ANY; + object_type = INTERNAL_TYPE_DEF_ANY; } } - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Installing %p into Node %p [%4.4s]\n", - obj_desc, node, (char*)&node->name)); - - - /* - * Must increment the new value's reference count - * (if it is an internal object) - */ - acpi_ut_add_reference (obj_desc); - - /* Save the existing object (if any) for deletion later */ + obj_desc, node, node->name.ascii)); - previous_obj_desc = node->object; - - /* Install the object and set the type, flags */ - - node->object = obj_desc; - node->type = (u8) obj_type; - node->flags |= flags; + /* Detach an existing attached object if present */ + if (node->object) { + acpi_ns_detach_object (node); + } - /* - * Delete an existing attached object. - */ - if (previous_obj_desc) { - /* One for the attach to the Node */ + if (obj_desc) { + /* + * Must increment the new value's reference count + * (if it is an internal object) + */ + acpi_ut_add_reference (obj_desc); - acpi_ut_remove_reference (previous_obj_desc); + /* + * Handle objects with multiple descriptors - walk + * to the end of the descriptor list + */ + last_obj_desc = obj_desc; + while (last_obj_desc->common.next_object) { + last_obj_desc = last_obj_desc->common.next_object; + } - /* Now delete */ + /* Install the object at the front of the object list */ - acpi_ut_remove_reference (previous_obj_desc); + last_obj_desc->common.next_object = node->object; } + node->type = (u8) object_type; + node->object = obj_desc; + return_ACPI_STATUS (AE_OK); } @@ -241,20 +195,32 @@ acpi_operand_object *obj_desc; - FUNCTION_TRACE ("Ns_detach_object"); + ACPI_FUNCTION_TRACE ("Ns_detach_object"); obj_desc = node->object; - if (!obj_desc) { + if (!obj_desc || + (obj_desc->common.type == INTERNAL_TYPE_DATA)) { return_VOID; } /* Clear the entry in all cases */ node->object = NULL; + if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_OPERAND) { + node->object = obj_desc->common.next_object; + if (node->object && + (node->object->common.type != INTERNAL_TYPE_DATA)) { + node->object = node->object->common.next_object; + } + } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object=%p Value=%p Name %4.4s\n", - node, obj_desc, (char*)&node->name)); + /* Reset the node type to untyped */ + + node->type = ACPI_TYPE_ANY; + + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Node %p [%4.4s] Object %p\n", + node, node->name.ascii, obj_desc)); /* Remove one reference on the object (and all subobjects) */ @@ -274,21 +240,197 @@ * ******************************************************************************/ -void * +acpi_operand_object * acpi_ns_get_attached_object ( acpi_namespace_node *node) { - FUNCTION_TRACE_PTR ("Ns_get_attached_object", node); + ACPI_FUNCTION_TRACE_PTR ("Ns_get_attached_object", node); if (!node) { - /* handle invalid */ - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Null Node ptr\n")); return_PTR (NULL); } + if (!node->object || + ((ACPI_GET_DESCRIPTOR_TYPE (node->object) != ACPI_DESC_TYPE_OPERAND) && + (ACPI_GET_DESCRIPTOR_TYPE (node->object) != ACPI_DESC_TYPE_NAMED)) || + (node->object->common.type == INTERNAL_TYPE_DATA)) { + return_PTR (NULL); + } + return_PTR (node->object); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ns_get_secondary_object + * + * PARAMETERS: Node - Parent Node to be examined + * + * RETURN: Current value of the object field from the Node whose + * handle is passed + * + ******************************************************************************/ + +acpi_operand_object * +acpi_ns_get_secondary_object ( + acpi_operand_object *obj_desc) +{ + ACPI_FUNCTION_TRACE_PTR ("Ns_get_secondary_object", obj_desc); + + + if ((!obj_desc) || + (obj_desc->common.type == INTERNAL_TYPE_DATA) || + (!obj_desc->common.next_object) || + (obj_desc->common.next_object->common.type == INTERNAL_TYPE_DATA)) { + return_PTR (NULL); + } + + return_PTR (obj_desc->common.next_object); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ns_attach_data + * + * PARAMETERS: + * + * RETURN: Status + * + * DESCRIPTION: + * + ******************************************************************************/ + +acpi_status +acpi_ns_attach_data ( + acpi_namespace_node *node, + ACPI_OBJECT_HANDLER handler, + void *data) +{ + acpi_operand_object *prev_obj_desc; + acpi_operand_object *obj_desc; + acpi_operand_object *data_desc; + + + /* */ + prev_obj_desc = NULL; + obj_desc = node->object; + while (obj_desc) { + if ((obj_desc->common.type == INTERNAL_TYPE_DATA) && + (obj_desc->data.handler == handler)) { + return (AE_ALREADY_EXISTS); + } + + prev_obj_desc = obj_desc; + obj_desc = obj_desc->common.next_object; + } + + + /* Create an internal object for the data */ + + data_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_DATA); + if (!data_desc) { + return (AE_NO_MEMORY); + } + + data_desc->data.handler = handler; + data_desc->data.pointer = data; + + + /* Install the data object */ + + if (prev_obj_desc) { + prev_obj_desc->common.next_object = data_desc; + } + else { + node->object = data_desc; + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ns_detach_data + * + * PARAMETERS: + * + * RETURN: Status + * + * DESCRIPTION: + * + ******************************************************************************/ + +acpi_status +acpi_ns_detach_data ( + acpi_namespace_node *node, + ACPI_OBJECT_HANDLER handler) +{ + acpi_operand_object *obj_desc; + acpi_operand_object *prev_obj_desc; + + + prev_obj_desc = NULL; + obj_desc = node->object; + while (obj_desc) { + if ((obj_desc->common.type == INTERNAL_TYPE_DATA) && + (obj_desc->data.handler == handler)) { + if (prev_obj_desc) { + prev_obj_desc->common.next_object = obj_desc->common.next_object; + } + else { + node->object = obj_desc->common.next_object; + } + + acpi_ut_remove_reference (obj_desc); + return (AE_OK); + } + + prev_obj_desc = obj_desc; + obj_desc = obj_desc->common.next_object; + } + + return (AE_NOT_FOUND); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ns_get_attached_data + * + * PARAMETERS: + * + * RETURN: Status + * + * DESCRIPTION: + * + ******************************************************************************/ + +acpi_status +acpi_ns_get_attached_data ( + acpi_namespace_node *node, + ACPI_OBJECT_HANDLER handler, + void **data) +{ + acpi_operand_object *obj_desc; + + + obj_desc = node->object; + while (obj_desc) { + if ((obj_desc->common.type == INTERNAL_TYPE_DATA) && + (obj_desc->data.handler == handler)) { + *data = obj_desc->data.pointer; + return (AE_OK); + } + + obj_desc = obj_desc->common.next_object; + } + + return (AE_NOT_FOUND); } diff -urN linux-2.4.18/drivers/acpi/namespace/nssearch.c lia64-2.4/drivers/acpi/namespace/nssearch.c --- linux-2.4.18/drivers/acpi/namespace/nssearch.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/namespace/nssearch.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: nssearch - Namespace search - * $Revision: 75 $ + * $Revision: 85 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,13 +25,11 @@ #include "acpi.h" -#include "amlcode.h" -#include "acinterp.h" #include "acnamesp.h" #define _COMPONENT ACPI_NAMESPACE - MODULE_NAME ("nssearch") + ACPI_MODULE_NAME ("nssearch") /******************************************************************************* @@ -64,30 +62,29 @@ acpi_ns_search_node ( u32 target_name, acpi_namespace_node *node, - acpi_object_type8 type, + acpi_object_type type, acpi_namespace_node **return_node) { acpi_namespace_node *next_node; - FUNCTION_TRACE ("Ns_search_node"); + ACPI_FUNCTION_TRACE ("Ns_search_node"); #ifdef ACPI_DEBUG if (ACPI_LV_NAMES & acpi_dbg_level) { NATIVE_CHAR *scope_name; - scope_name = acpi_ns_get_table_pathname (node); + scope_name = acpi_ns_get_external_pathname (node); if (scope_name) { - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching %s [%p] For %4.4s (type %X)\n", - scope_name, node, (char*)&target_name, type)); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching %s [%p] For %4.4s (type %s)\n", + scope_name, node, (char *) &target_name, acpi_ut_get_type_name (type))); ACPI_MEM_FREE (scope_name); } } #endif - /* * Search for name in this table, which is to say that we must search * for the name among the children of this object @@ -96,7 +93,7 @@ while (next_node) { /* Check for match against the name */ - if (next_node->name == target_name) { + if (next_node->name.integer == target_name) { /* * Found matching entry. Capture the type if appropriate, before * returning the entry. @@ -123,14 +120,13 @@ } ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "Name %4.4s (actual type %X) found at %p\n", - (char*)&target_name, next_node->type, next_node)); + "Name %4.4s Type [%s] found at %p\n", + (char *) &target_name, acpi_ut_get_type_name (next_node->type), next_node)); *return_node = next_node; return_ACPI_STATUS (AE_OK); } - /* * The last entry in the list points back to the parent, * so a flag is used to indicate the end-of-list @@ -146,11 +142,10 @@ next_node = next_node->peer; } - /* Searched entire table, not found */ - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Name %4.4s (type %X) not found at %p\n", - (char*)&target_name, type, next_node)); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Name %4.4s Type [%s] not found at %p\n", + (char *) &target_name, acpi_ut_get_type_name (type), next_node)); return_ACPI_STATUS (AE_NOT_FOUND); } @@ -185,17 +180,17 @@ acpi_ns_search_parent_tree ( u32 target_name, acpi_namespace_node *node, - acpi_object_type8 type, + acpi_object_type type, acpi_namespace_node **return_node) { acpi_status status; acpi_namespace_node *parent_node; - FUNCTION_TRACE ("Ns_search_parent_tree"); + ACPI_FUNCTION_TRACE ("Ns_search_parent_tree"); - parent_node = acpi_ns_get_parent_object (node); + parent_node = acpi_ns_get_parent_node (node); /* * If there is no parent (at the root) or type is "local", we won't be @@ -205,33 +200,33 @@ (!parent_node)) { if (!parent_node) { ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] has no parent\n", - (char*)&target_name)); + (char *) &target_name)); } if (acpi_ns_local (type)) { - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] type %X is local(no search)\n", - (char*)&target_name, type)); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] type [%s] must be local to this scope (no parent search)\n", + (char *) &target_name, acpi_ut_get_type_name (type))); } return_ACPI_STATUS (AE_NOT_FOUND); } - /* Search the parent tree */ - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching parent for %4.4s\n", (char*)&target_name)); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching parent for %4.4s\n", (char *) &target_name)); /* * Search parents until found the target or we have backed up to * the root */ while (parent_node) { - /* Search parent scope */ - /* TBD: [Investigate] Why ACPI_TYPE_ANY? */ - + /* + * Search parent scope. Use TYPE_ANY because we don't care about the + * object type at this point, we only care about the existence of + * the actual name we are searching for. Typechecking comes later. + */ status = acpi_ns_search_node (target_name, parent_node, ACPI_TYPE_ANY, return_node); - if (ACPI_SUCCESS (status)) { return_ACPI_STATUS (status); } @@ -240,10 +235,9 @@ * Not found here, go up another level * (until we reach the root) */ - parent_node = acpi_ns_get_parent_object (parent_node); + parent_node = acpi_ns_get_parent_node (parent_node); } - /* Not found in parent tree */ return_ACPI_STATUS (AE_NOT_FOUND); @@ -280,8 +274,8 @@ u32 target_name, acpi_walk_state *walk_state, acpi_namespace_node *node, - operating_mode interpreter_mode, - acpi_object_type8 type, + acpi_interpreter_mode interpreter_mode, + acpi_object_type type, u32 flags, acpi_namespace_node **return_node) { @@ -289,7 +283,7 @@ acpi_namespace_node *new_node; - FUNCTION_TRACE ("Ns_search_and_enter"); + ACPI_FUNCTION_TRACE ("Ns_search_and_enter"); /* Parameter validation */ @@ -298,25 +292,23 @@ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null param- Table %p Name %X Return %p\n", node, target_name, return_node)); - REPORT_ERROR (("Ns_search_and_enter: bad (null) parameter\n")); + ACPI_REPORT_ERROR (("Ns_search_and_enter: bad (null) parameter\n")); return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Name must consist of printable characters */ if (!acpi_ut_valid_acpi_name (target_name)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "*** Bad character in name: %08x *** \n", target_name)); - REPORT_ERROR (("Ns_search_and_enter: Bad character in ACPI Name\n")); + ACPI_REPORT_ERROR (("Ns_search_and_enter: Bad character in ACPI Name\n")); return_ACPI_STATUS (AE_BAD_CHARACTER); } - /* Try to find the name in the table specified by the caller */ - *return_node = ENTRY_NOT_FOUND; + *return_node = ACPI_ENTRY_NOT_FOUND; status = acpi_ns_search_node (target_name, node, type, return_node); if (status != AE_NOT_FOUND) { /* @@ -324,8 +316,8 @@ * return the error */ if ((status == AE_OK) && - (flags & NS_ERROR_IF_FOUND)) { - status = AE_EXIST; + (flags & ACPI_NS_ERROR_IF_FOUND)) { + status = AE_ALREADY_EXISTS; } /* @@ -335,9 +327,8 @@ return_ACPI_STATUS (status); } - /* - * Not found in the table. If we are NOT performing the + * The name was not found. If we are NOT performing the * first pass (name entry) of loading the namespace, search * the parent tree (all the way to the root if necessary.) * We don't want to perform the parent search when the @@ -345,8 +336,8 @@ * the search when namespace references are being resolved * (load pass 2) and during the execution phase. */ - if ((interpreter_mode != IMODE_LOAD_PASS1) && - (flags & NS_SEARCH_PARENT)) { + if ((interpreter_mode != ACPI_IMODE_LOAD_PASS1) && + (flags & ACPI_NS_SEARCH_PARENT)) { /* * Not found in table - search parent tree according * to ACPI specification @@ -358,17 +349,15 @@ } } - /* * In execute mode, just search, never add names. Exit now. */ - if (interpreter_mode == IMODE_EXECUTE) { + if (interpreter_mode == ACPI_IMODE_EXECUTE) { ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s Not found in %p [Not adding]\n", - (char*)&target_name, node)); + (char *) &target_name, node)); return_ACPI_STATUS (AE_NOT_FOUND); } - /* Create the new named object */ diff -urN linux-2.4.18/drivers/acpi/namespace/nsutils.c lia64-2.4/drivers/acpi/namespace/nsutils.c --- linux-2.4.18/drivers/acpi/namespace/nsutils.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/namespace/nsutils.c Tue Jun 11 14:24:23 2002 @@ -2,12 +2,12 @@ * * Module Name: nsutils - Utilities for accessing ACPI namespace, accessing * parents and siblings and Scope manipulation - * $Revision: 92 $ + * $Revision: 109 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,12 +27,11 @@ #include "acpi.h" #include "acnamesp.h" -#include "acinterp.h" #include "amlcode.h" #include "actables.h" #define _COMPONENT ACPI_NAMESPACE - MODULE_NAME ("nsutils") + ACPI_MODULE_NAME ("nsutils") /******************************************************************************* @@ -87,19 +86,19 @@ * ******************************************************************************/ -acpi_object_type8 +acpi_object_type acpi_ns_get_type ( acpi_namespace_node *node) { - FUNCTION_TRACE ("Ns_get_type"); + ACPI_FUNCTION_TRACE ("Ns_get_type"); if (!node) { - REPORT_WARNING (("Ns_get_type: Null Node ptr")); + ACPI_REPORT_WARNING (("Ns_get_type: Null Node ptr")); return_VALUE (ACPI_TYPE_ANY); } - return_VALUE (node->type); + return_VALUE ((acpi_object_type) node->type); } @@ -116,19 +115,19 @@ u32 acpi_ns_local ( - acpi_object_type8 type) + acpi_object_type type) { - FUNCTION_TRACE ("Ns_local"); + ACPI_FUNCTION_TRACE ("Ns_local"); if (!acpi_ut_valid_object_type (type)) { /* Type code out of range */ - REPORT_WARNING (("Ns_local: Invalid Object Type\n")); - return_VALUE (NSP_NORMAL); + ACPI_REPORT_WARNING (("Ns_local: Invalid Object Type\n")); + return_VALUE (ACPI_NS_NORMAL); } - return_VALUE ((u32) acpi_gbl_ns_properties[type] & NSP_LOCAL); + return_VALUE ((u32) acpi_gbl_ns_properties[type] & ACPI_NS_LOCAL); } @@ -146,7 +145,7 @@ * ******************************************************************************/ -acpi_status +void acpi_ns_get_internal_name_length ( acpi_namestring_info *info) { @@ -154,7 +153,7 @@ u32 i; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); next_external_char = info->external_name; @@ -175,7 +174,6 @@ info->fully_qualified = TRUE; next_external_char++; } - else { /* * Handle Carat prefixes @@ -205,8 +203,6 @@ 4 + info->num_carats; info->next_external_char = next_external_char; - - return (AE_OK); } @@ -231,10 +227,10 @@ NATIVE_CHAR *internal_name = info->internal_name; NATIVE_CHAR *external_name = info->next_external_char; NATIVE_CHAR *result = NULL; - u32 i; + NATIVE_UINT_MIN32 i; - FUNCTION_TRACE ("Ns_build_internal_name"); + ACPI_FUNCTION_TRACE ("Ns_build_internal_name"); /* Setup the correct prefixes, counts, and pointers */ @@ -255,7 +251,6 @@ result = &internal_name[3]; } } - else { /* * Not fully qualified. @@ -268,15 +263,13 @@ } } - if (num_segments == 1) { + if (num_segments <= 1) { result = &internal_name[i]; } - else if (num_segments == 2) { internal_name[i] = AML_DUAL_NAME_PREFIX; result = &internal_name[i+1]; } - else { internal_name[i] = AML_MULTI_NAME_PREFIX_OP; internal_name[i+1] = (char) num_segments; @@ -284,7 +277,6 @@ } } - /* Build the name (minus path separators) */ for (; num_segments; num_segments--) { @@ -295,11 +287,10 @@ result[i] = '_'; } - else { /* Convert the character to uppercase and save it */ - result[i] = (char) TOUPPER (*external_name); + result[i] = (char) ACPI_TOUPPER ((int) *external_name); external_name++; } } @@ -317,18 +308,17 @@ result += ACPI_NAME_SIZE; } - /* Terminate the string */ *result = 0; if (info->fully_qualified) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "returning [%p] (abs) \"\\%s\"\n", - internal_name, &internal_name[0])); + internal_name, internal_name)); } else { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "returning [%p] (rel) \"%s\"\n", - internal_name, &internal_name[2])); + internal_name, internal_name)); } return_ACPI_STATUS (AE_OK); @@ -360,7 +350,7 @@ acpi_status status; - FUNCTION_TRACE ("Ns_internalize_name"); + ACPI_FUNCTION_TRACE ("Ns_internalize_name"); if ((!external_name) || @@ -369,7 +359,6 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Get the length of the new internal name */ info.external_name = external_name; @@ -418,24 +407,23 @@ u32 *converted_name_length, char **converted_name) { - u32 prefix_length = 0; - u32 names_index = 0; - u32 names_count = 0; - u32 i = 0; - u32 j = 0; + NATIVE_UINT_MIN32 prefix_length = 0; + NATIVE_UINT_MIN32 names_index = 0; + NATIVE_UINT_MIN32 num_segments = 0; + NATIVE_UINT_MIN32 i = 0; + NATIVE_UINT_MIN32 j = 0; + NATIVE_UINT_MIN32 required_length; - FUNCTION_TRACE ("Ns_externalize_name"); + ACPI_FUNCTION_TRACE ("Ns_externalize_name"); if (!internal_name_length || !internal_name || - !converted_name_length || !converted_name) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* * Check for a prefix (one '\' | one or more '^'). */ @@ -456,6 +444,9 @@ } break; + + default: + break; } /* @@ -464,36 +455,36 @@ */ if (prefix_length < internal_name_length) { switch (internal_name[prefix_length]) { + case AML_MULTI_NAME_PREFIX_OP: - /* 4-byte names */ + /* 4-byte names */ - case AML_MULTI_NAME_PREFIX_OP: names_index = prefix_length + 2; - names_count = (u32) internal_name[prefix_length + 1]; + num_segments = (u32) (u8) internal_name[prefix_length + 1]; break; + case AML_DUAL_NAME_PREFIX: - /* two 4-byte names */ + /* Two 4-byte names */ - case AML_DUAL_NAME_PREFIX: names_index = prefix_length + 1; - names_count = 2; + num_segments = 2; break; + case 0: - /* Null_name */ + /* Null_name */ - case 0: names_index = 0; - names_count = 0; + num_segments = 0; break; + default: - /* one 4-byte name */ + /* one 4-byte name */ - default: names_index = prefix_length; - names_count = 1; + num_segments = 1; break; } } @@ -503,23 +494,22 @@ * of the prefix, length of all object names, length of any required * punctuation ('.') between object names, plus the NULL terminator. */ - *converted_name_length = prefix_length + (4 * names_count) + - ((names_count > 0) ? (names_count - 1) : 0) + 1; + required_length = prefix_length + (4 * num_segments) + + ((num_segments > 0) ? (num_segments - 1) : 0) + 1; /* * Check to see if we're still in bounds. If not, there's a problem * with Internal_name (invalid format). */ - if (*converted_name_length > internal_name_length) { - REPORT_ERROR (("Ns_externalize_name: Invalid internal name\n")); + if (required_length > internal_name_length) { + ACPI_REPORT_ERROR (("Ns_externalize_name: Invalid internal name\n")); return_ACPI_STATUS (AE_BAD_PATHNAME); } /* * Build Converted_name... */ - - (*converted_name) = ACPI_MEM_CALLOCATE (*converted_name_length); + *converted_name = ACPI_MEM_CALLOCATE (required_length); if (!(*converted_name)) { return_ACPI_STATUS (AE_NO_MEMORY); } @@ -530,8 +520,8 @@ (*converted_name)[j++] = internal_name[i]; } - if (names_count > 0) { - for (i = 0; i < names_count; i++) { + if (num_segments > 0) { + for (i = 0; i < num_segments; i++) { if (i > 0) { (*converted_name)[j++] = '.'; } @@ -543,6 +533,10 @@ } } + if (converted_name_length) { + *converted_name_length = (u32) required_length; + } + return_ACPI_STATUS (AE_OK); } @@ -557,6 +551,9 @@ * * DESCRIPTION: Convert a namespace handle to a real Node * + * Note: Real integer handles allow for more verification + * and keep all pointers within this subsystem. + * ******************************************************************************/ acpi_namespace_node * @@ -564,13 +561,11 @@ acpi_handle handle) { - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* - * Simple implementation for now; - * TBD: [Future] Real integer handles allow for more verification - * and keep all pointers within this subsystem! + * Simple implementation. */ if (!handle) { return (NULL); @@ -580,10 +575,9 @@ return (acpi_gbl_root_node); } - /* We can at least attempt to verify the handle */ - if (!VALID_DESCRIPTOR_TYPE (handle, ACPI_DESC_TYPE_NAMED)) { + if (ACPI_GET_DESCRIPTOR_TYPE (handle) != ACPI_DESC_TYPE_NAMED) { return (NULL); } @@ -611,8 +605,6 @@ /* * Simple implementation for now; - * TBD: [Future] Real integer handles allow for more verification - * and keep all pointers within this subsystem! */ return ((acpi_handle) node); @@ -654,7 +646,7 @@ acpi_namespace_node *this_node; - FUNCTION_TRACE ("Ns_terminate"); + ACPI_FUNCTION_TRACE ("Ns_terminate"); this_node = acpi_gbl_root_node; @@ -702,25 +694,25 @@ u32 acpi_ns_opens_scope ( - acpi_object_type8 type) + acpi_object_type type) { - FUNCTION_TRACE_U32 ("Ns_opens_scope", type); + ACPI_FUNCTION_TRACE_U32 ("Ns_opens_scope", type); if (!acpi_ut_valid_object_type (type)) { /* type code out of range */ - REPORT_WARNING (("Ns_opens_scope: Invalid Object Type\n")); - return_VALUE (NSP_NORMAL); + ACPI_REPORT_WARNING (("Ns_opens_scope: Invalid Object Type %X\n", type)); + return_VALUE (ACPI_NS_NORMAL); } - return_VALUE (((u32) acpi_gbl_ns_properties[type]) & NSP_NEWSCOPE); + return_VALUE (((u32) acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE); } /******************************************************************************* * - * FUNCTION: Acpi_ns_get_node + * FUNCTION: Acpi_ns_get_node_by_path * * PARAMETERS: *Pathname - Name to be found, in external (ASL) format. The * \ (backslash) and ^ (carat) prefixes, and the @@ -729,6 +721,8 @@ * root of the name space. If Name is fully * qualified (first s8 is '\'), the passed value * of Scope will not be accessed. + * Flags - Used to indicate whether to perform upsearch or + * not. * Return_node - Where the Node is returned * * DESCRIPTION: Look up a name relative to a given scope and return the @@ -739,9 +733,10 @@ ******************************************************************************/ acpi_status -acpi_ns_get_node ( +acpi_ns_get_node_by_path ( NATIVE_CHAR *pathname, acpi_namespace_node *start_node, + u32 flags, acpi_namespace_node **return_node) { acpi_generic_state scope_info; @@ -749,20 +744,13 @@ NATIVE_CHAR *internal_path = NULL; - FUNCTION_TRACE_PTR ("Ns_get_node", pathname); + ACPI_FUNCTION_TRACE_PTR ("Ns_get_node_by_path", pathname); - /* Ensure that the namespace has been initialized */ - - if (!acpi_gbl_root_node) { - return_ACPI_STATUS (AE_NO_NAMESPACE); - } - if (!pathname) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Convert path to internal representation */ status = acpi_ns_internalize_name (pathname, &internal_path); @@ -770,8 +758,12 @@ return_ACPI_STATUS (status); } + /* Must lock namespace during lookup */ - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* Setup lookup scope (search starting point) */ @@ -780,20 +772,17 @@ /* Lookup the name in the namespace */ status = acpi_ns_lookup (&scope_info, internal_path, - ACPI_TYPE_ANY, IMODE_EXECUTE, - NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE, + ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, + (flags | ACPI_NS_DONT_OPEN_SCOPE), NULL, return_node); - if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s, %s\n", internal_path, acpi_format_exception (status))); } - - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); - /* Cleanup */ + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); ACPI_MEM_FREE (internal_path); return_ACPI_STATUS (status); } @@ -820,24 +809,25 @@ acpi_namespace_node *parent_node; - FUNCTION_TRACE ("Ns_find_parent_name"); + ACPI_FUNCTION_TRACE ("Ns_find_parent_name"); if (child_node) { /* Valid entry. Get the parent Node */ - parent_node = acpi_ns_get_parent_object (child_node); + parent_node = acpi_ns_get_parent_node (child_node); if (parent_node) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Parent of %p [%4.4s] is %p [%4.4s]\n", - child_node, (char*)&child_node->name, parent_node, (char*)&parent_node->name)); + child_node, child_node->name.ascii, + parent_node, parent_node->name.ascii)); - if (parent_node->name) { - return_VALUE (parent_node->name); + if (parent_node->name.integer) { + return_VALUE ((acpi_name) parent_node->name.integer); } } ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "unable to find parent of %p (%4.4s)\n", - child_node, (char*)&child_node->name)); + child_node, child_node->name.ascii)); } return_VALUE (ACPI_UNKNOWN_NAME); @@ -871,7 +861,7 @@ return (FALSE); } - if (node->name) { + if (node->name.integer) { return (TRUE); } @@ -883,7 +873,7 @@ /******************************************************************************* * - * FUNCTION: Acpi_ns_get_parent_object + * FUNCTION: Acpi_ns_get_parent_node * * PARAMETERS: Node - Current table entry * @@ -895,12 +885,10 @@ acpi_namespace_node * -acpi_ns_get_parent_object ( +acpi_ns_get_parent_node ( acpi_namespace_node *node) { - - - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); if (!node) { diff -urN linux-2.4.18/drivers/acpi/namespace/nswalk.c lia64-2.4/drivers/acpi/namespace/nswalk.c --- linux-2.4.18/drivers/acpi/namespace/nswalk.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/namespace/nswalk.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: nswalk - Functions for walking the ACPI namespace - * $Revision: 26 $ + * $Revision: 33 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,12 +25,11 @@ #include "acpi.h" -#include "acinterp.h" #include "acnamesp.h" #define _COMPONENT ACPI_NAMESPACE - MODULE_NAME ("nswalk") + ACPI_MODULE_NAME ("nswalk") /******************************************************************************* @@ -54,14 +53,14 @@ acpi_namespace_node * acpi_ns_get_next_node ( - acpi_object_type8 type, + acpi_object_type type, acpi_namespace_node *parent_node, acpi_namespace_node *child_node) { acpi_namespace_node *next_node = NULL; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); if (!child_node) { @@ -138,7 +137,7 @@ acpi_status acpi_ns_walk_namespace ( - acpi_object_type8 type, + acpi_object_type type, acpi_handle start_node, u32 max_depth, u8 unlock_before_callback, @@ -149,11 +148,11 @@ acpi_status status; acpi_namespace_node *child_node; acpi_namespace_node *parent_node; - acpi_object_type8 child_type; + acpi_object_type child_type; u32 level; - FUNCTION_TRACE ("Ns_walk_namespace"); + ACPI_FUNCTION_TRACE ("Ns_walk_namespace"); /* Special case for the namespace Root Node */ @@ -194,14 +193,20 @@ * callback function */ if (unlock_before_callback) { - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } } status = user_function (child_node, level, context, return_value); if (unlock_before_callback) { - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } } switch (status) { @@ -216,14 +221,12 @@ /* Exit now, with OK status */ return_ACPI_STATUS (AE_OK); - break; default: /* All others are valid exceptions */ return_ACPI_STATUS (status); - break; } } @@ -247,7 +250,6 @@ } } } - else { /* * No more children of this node (Acpi_ns_get_next_node @@ -256,7 +258,7 @@ */ level--; child_node = parent_node; - parent_node = acpi_ns_get_parent_object (parent_node); + parent_node = acpi_ns_get_parent_node (parent_node); } } diff -urN linux-2.4.18/drivers/acpi/namespace/nsxfname.c lia64-2.4/drivers/acpi/namespace/nsxfname.c --- linux-2.4.18/drivers/acpi/namespace/nsxfname.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/namespace/nsxfname.c Tue Jun 11 14:24:23 2002 @@ -2,12 +2,12 @@ * * Module Name: nsxfname - Public interfaces to the ACPI subsystem * ACPI Namespace oriented interfaces - * $Revision: 82 $ + * $Revision: 91 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,16 +26,11 @@ #include "acpi.h" -#include "acinterp.h" #include "acnamesp.h" -#include "amlcode.h" -#include "acparser.h" -#include "acdispat.h" -#include "acevents.h" #define _COMPONENT ACPI_NAMESPACE - MODULE_NAME ("nsxfname") + ACPI_MODULE_NAME ("nsxfname") /**************************************************************************** @@ -67,7 +62,7 @@ acpi_namespace_node *prefix_node = NULL; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* Parameter Validation */ @@ -79,20 +74,26 @@ /* Convert a parent handle to a prefix node */ if (parent) { - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return (status); + } prefix_node = acpi_ns_map_handle_to_node (parent); if (!prefix_node) { - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return (AE_BAD_PARAMETER); } - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return (status); + } } /* Special case for root, since we can't search for it */ - if (STRCMP (pathname, NS_ROOT_PATH) == 0) { + if (ACPI_STRCMP (pathname, ACPI_NS_ROOT_PATH) == 0) { *ret_handle = acpi_ns_convert_entry_to_handle (acpi_gbl_root_node); return (AE_OK); } @@ -100,7 +101,7 @@ /* * Find the Node and convert to a handle */ - status = acpi_ns_get_node (pathname, prefix_node, &node); + status = acpi_ns_get_node_by_path (pathname, prefix_node, ACPI_NS_NO_UPSEARCH, &node); *ret_handle = NULL; if (ACPI_SUCCESS (status)) { @@ -117,7 +118,7 @@ * * PARAMETERS: Handle - Handle to be converted to a pathname * Name_type - Full pathname or single segment - * Ret_path_ptr - Buffer for returned path + * Buffer - Buffer for returned path * * RETURN: Pointer to a string containing the fully qualified Name. * @@ -131,63 +132,63 @@ acpi_get_name ( acpi_handle handle, u32 name_type, - acpi_buffer *ret_path_ptr) + acpi_buffer *buffer) { acpi_status status; acpi_namespace_node *node; - /* Buffer pointer must be valid always */ + /* Parameter validation */ - if (!ret_path_ptr || (name_type > ACPI_NAME_TYPE_MAX)) { + if (name_type > ACPI_NAME_TYPE_MAX) { return (AE_BAD_PARAMETER); } - /* Allow length to be zero and ignore the pointer */ - - if ((ret_path_ptr->length) && - (!ret_path_ptr->pointer)) { - return (AE_BAD_PARAMETER); + status = acpi_ut_validate_buffer (buffer); + if (ACPI_FAILURE (status)) { + return (status); } if (name_type == ACPI_FULL_PATHNAME) { /* Get the full pathname (From the namespace root) */ - status = acpi_ns_handle_to_pathname (handle, &ret_path_ptr->length, - ret_path_ptr->pointer); + status = acpi_ns_handle_to_pathname (handle, buffer); return (status); } /* * Wants the single segment ACPI name. - * Validate handle and convert to an Node + * Validate handle and convert to a namespace Node */ - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return (status); + } + node = acpi_ns_map_handle_to_node (handle); if (!node) { status = AE_BAD_PARAMETER; goto unlock_and_exit; } - /* Check if name will fit in buffer */ + /* Validate/Allocate/Clear caller buffer */ - if (ret_path_ptr->length < PATH_SEGMENT_LENGTH) { - ret_path_ptr->length = PATH_SEGMENT_LENGTH; - status = AE_BUFFER_OVERFLOW; + status = acpi_ut_initialize_buffer (buffer, PATH_SEGMENT_LENGTH); + if (ACPI_FAILURE (status)) { goto unlock_and_exit; } /* Just copy the ACPI name from the Node and zero terminate it */ - STRNCPY (ret_path_ptr->pointer, (NATIVE_CHAR *) &node->name, + ACPI_STRNCPY (buffer->pointer, node->name.ascii, ACPI_NAME_SIZE); - ((NATIVE_CHAR *) ret_path_ptr->pointer) [ACPI_NAME_SIZE] = 0; + ((NATIVE_CHAR *) buffer->pointer) [ACPI_NAME_SIZE] = 0; status = AE_OK; unlock_and_exit: - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return (status); } @@ -226,18 +227,24 @@ return (AE_BAD_PARAMETER); } - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return (status); + } node = acpi_ns_map_handle_to_node (handle); if (!node) { - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return (AE_BAD_PARAMETER); } - info->type = node->type; - info->name = node->name; + info->type = node->type; + info->name = node->name.integer; - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return (status); + } /* * If not a device, we are all done. @@ -260,8 +267,7 @@ status = acpi_ut_execute_HID (node, &hid); if (ACPI_SUCCESS (status)) { - STRNCPY (info->hardware_id, hid.buffer, sizeof(info->hardware_id)); - + ACPI_STRNCPY (info->hardware_id, hid.buffer, sizeof(info->hardware_id)); info->valid |= ACPI_VALID_HID; } @@ -269,8 +275,7 @@ status = acpi_ut_execute_UID (node, &uid); if (ACPI_SUCCESS (status)) { - STRCPY (info->unique_id, uid.buffer); - + ACPI_STRCPY (info->unique_id, uid.buffer); info->valid |= ACPI_VALID_UID; } diff -urN linux-2.4.18/drivers/acpi/namespace/nsxfobj.c lia64-2.4/drivers/acpi/namespace/nsxfobj.c --- linux-2.4.18/drivers/acpi/namespace/nsxfobj.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/namespace/nsxfobj.c Tue Jun 11 14:24:23 2002 @@ -2,12 +2,12 @@ * * Module Name: nsxfobj - Public interfaces to the ACPI subsystem * ACPI Object oriented interfaces - * $Revision: 95 $ + * $Revision: 112 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,13 +26,104 @@ #include "acpi.h" -#include "acinterp.h" #include "acnamesp.h" -#include "acdispat.h" #define _COMPONENT ACPI_NAMESPACE - MODULE_NAME ("nsxfobj") + ACPI_MODULE_NAME ("nsxfobj") + + +/******************************************************************************* + * + * FUNCTION: Acpi_evaluate_object_typed + * + * PARAMETERS: Handle - Object handle (optional) + * *Pathname - Object pathname (optional) + * **External_params - List of parameters to pass to method, + * terminated by NULL. May be NULL + * if no parameters are being passed. + * *Return_buffer - Where to put method's return value (if + * any). If NULL, no value is returned. + * Return_type - Expected type of return object + * + * RETURN: Status + * + * DESCRIPTION: Find and evaluate the given object, passing the given + * parameters if necessary. One of "Handle" or "Pathname" must + * be valid (non-null) + * + ******************************************************************************/ + +acpi_status +acpi_evaluate_object_typed ( + acpi_handle handle, + acpi_string pathname, + acpi_object_list *external_params, + acpi_buffer *return_buffer, + acpi_object_type return_type) +{ + acpi_status status; + u8 must_free = FALSE; + + + ACPI_FUNCTION_TRACE ("Acpi_evaluate_object_typed"); + + + /* Return buffer must be valid */ + + if (!return_buffer) { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + if (return_buffer->length == ACPI_ALLOCATE_BUFFER) { + must_free = TRUE; + } + + /* Evaluate the object */ + + status = acpi_evaluate_object (handle, pathname, external_params, return_buffer); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + /* Type ANY means "don't care" */ + + if (return_type == ACPI_TYPE_ANY) { + return_ACPI_STATUS (AE_OK); + } + + if (return_buffer->length == 0) { + /* Error because caller specifically asked for a return value */ + + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "No return value\n")); + + return_ACPI_STATUS (AE_NULL_OBJECT); + } + + /* Examine the object type returned from Evaluate_object */ + + if (((acpi_object *) return_buffer->pointer)->type == return_type) { + return_ACPI_STATUS (AE_OK); + } + + /* Return object type does not match requested type */ + + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Incorrect return type [%s] requested [%s]\n", + acpi_ut_get_type_name (((acpi_object *) return_buffer->pointer)->type), + acpi_ut_get_type_name (return_type))); + + if (must_free) { + /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */ + + acpi_os_free (return_buffer->pointer); + return_buffer->pointer = NULL; + } + + return_buffer->length = 0; + return_ACPI_STATUS (AE_TYPE); +} /******************************************************************************* @@ -65,12 +156,11 @@ acpi_status status; acpi_operand_object **internal_params = NULL; acpi_operand_object *internal_return_obj = NULL; - u32 buffer_space_needed; - u32 user_buffer_length; + ACPI_SIZE buffer_space_needed; u32 i; - FUNCTION_TRACE ("Acpi_evaluate_object"); + ACPI_FUNCTION_TRACE ("Acpi_evaluate_object"); /* @@ -83,12 +173,12 @@ * Allocate a new parameter block for the internal objects * Add 1 to count to allow for null terminated internal list */ - internal_params = ACPI_MEM_CALLOCATE ((external_params->count + 1) * sizeof (void *)); + internal_params = ACPI_MEM_CALLOCATE (((ACPI_SIZE) external_params->count + 1) * + sizeof (void *)); if (!internal_params) { return_ACPI_STATUS (AE_NO_MEMORY); } - /* * Convert each external object in the list to an * internal object @@ -96,7 +186,6 @@ for (i = 0; i < external_params->count; i++) { status = acpi_ut_copy_eobject_to_iobject (&external_params->pointer[i], &internal_params[i]); - if (ACPI_FAILURE (status)) { acpi_ut_delete_internal_object_list (internal_params); return_ACPI_STATUS (status); @@ -105,7 +194,6 @@ internal_params[external_params->count] = NULL; } - /* * Three major cases: * 1) Fully qualified pathname @@ -117,9 +205,9 @@ /* * The path is fully qualified, just evaluate by name */ - status = acpi_ns_evaluate_by_name (pathname, internal_params, &internal_return_obj); + status = acpi_ns_evaluate_by_name (pathname, internal_params, + &internal_return_obj); } - else if (!handle) { /* * A handle is optional iff a fully qualified pathname @@ -127,16 +215,16 @@ * qualified names above, this is an error */ if (!pathname) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Both Handle and Pathname are NULL\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Both Handle and Pathname are NULL\n")); } - else { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Handle is NULL and Pathname is relative\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Handle is NULL and Pathname is relative\n")); } status = AE_BAD_PARAMETER; } - else { /* * We get here if we have a handle -- and if we have a @@ -148,15 +236,15 @@ * The null pathname case means the handle is for * the actual object to be evaluated */ - status = acpi_ns_evaluate_by_handle (handle, internal_params, &internal_return_obj); + status = acpi_ns_evaluate_by_handle (handle, internal_params, + &internal_return_obj); } - else { /* * Both a Handle and a relative Pathname */ status = acpi_ns_evaluate_relative (handle, pathname, internal_params, - &internal_return_obj); + &internal_return_obj); } } @@ -165,26 +253,23 @@ * If we are expecting a return value, and all went well above, * copy the return value to an external object. */ - if (return_buffer) { - user_buffer_length = return_buffer->length; - return_buffer->length = 0; - - if (internal_return_obj) { - if (VALID_DESCRIPTOR_TYPE (internal_return_obj, ACPI_DESC_TYPE_NAMED)) { + if (!internal_return_obj) { + return_buffer->length = 0; + } + else { + if (ACPI_GET_DESCRIPTOR_TYPE (internal_return_obj) == ACPI_DESC_TYPE_NAMED) { /* - * If we got an Node as a return object, - * this means the object we are evaluating - * has nothing interesting to return (such - * as a mutex, etc.) We return an error - * because these types are essentially - * unsupported by this interface. We - * don't check up front because this makes - * it easier to add support for various - * types at a later date if necessary. + * If we received a NS Node as a return object, this means that + * the object we are evaluating has nothing interesting to + * return (such as a mutex, etc.) We return an error because + * these types are essentially unsupported by this interface. + * We don't check up front because this makes it easier to add + * support for various types at a later date if necessary. */ status = AE_TYPE; - internal_return_obj = NULL; /* No need to delete an Node */ + internal_return_obj = NULL; /* No need to delete a NS Node */ + return_buffer->length = 0; } if (ACPI_SUCCESS (status)) { @@ -195,38 +280,29 @@ status = acpi_ut_get_object_size (internal_return_obj, &buffer_space_needed); if (ACPI_SUCCESS (status)) { - /* - * Check if there is enough room in the - * caller's buffer - */ - if (user_buffer_length < buffer_space_needed) { + /* Validate/Allocate/Clear caller buffer */ + + status = acpi_ut_initialize_buffer (return_buffer, buffer_space_needed); + if (ACPI_FAILURE (status)) { /* - * Caller's buffer is too small, can't - * give him partial results fail the call - * but return the buffer size needed + * Caller's buffer is too small or a new one can't be allocated */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Needed buffer size %X, received %X\n", - buffer_space_needed, user_buffer_length)); - - return_buffer->length = buffer_space_needed; - status = AE_BUFFER_OVERFLOW; + "Needed buffer size %X, %s\n", + (u32) buffer_space_needed, acpi_format_exception (status))); } - else { /* * We have enough space for the object, build it */ status = acpi_ut_copy_iobject_to_eobject (internal_return_obj, return_buffer); - return_buffer->length = buffer_space_needed; } } } } } - /* Delete the return and parameter objects */ if (internal_return_obj) { @@ -275,7 +351,7 @@ acpi_handle child, acpi_handle *ret_handle) { - acpi_status status = AE_OK; + acpi_status status; acpi_namespace_node *node; acpi_namespace_node *parent_node = NULL; acpi_namespace_node *child_node = NULL; @@ -287,7 +363,10 @@ return (AE_BAD_PARAMETER); } - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return (status); + } /* If null handle, use the parent */ @@ -300,10 +379,8 @@ goto unlock_and_exit; } } - - /* Non-null handle, ignore the parent */ - else { + /* Non-null handle, ignore the parent */ /* Convert and validate the handle */ child_node = acpi_ns_map_handle_to_node (child); @@ -313,11 +390,9 @@ } } - /* Internal function does the real work */ - node = acpi_ns_get_next_node ((acpi_object_type8) type, - parent_node, child_node); + node = acpi_ns_get_next_node (type, parent_node, child_node); if (!node) { status = AE_NOT_FOUND; goto unlock_and_exit; @@ -330,7 +405,7 @@ unlock_and_exit: - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return (status); } @@ -354,6 +429,7 @@ acpi_object_type *ret_type) { acpi_namespace_node *node; + acpi_status status; /* Parameter Validation */ @@ -371,21 +447,24 @@ return (AE_OK); } - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return (status); + } /* Convert and validate the handle */ node = acpi_ns_map_handle_to_node (handle); if (!node) { - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return (AE_BAD_PARAMETER); } *ret_type = node->type; - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); - return (AE_OK); + status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + return (status); } @@ -409,7 +488,7 @@ acpi_handle *ret_handle) { acpi_namespace_node *node; - acpi_status status = AE_OK; + acpi_status status; if (!ret_handle) { @@ -422,8 +501,10 @@ return (AE_NULL_ENTRY); } - - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return (status); + } /* Convert and validate the handle */ @@ -433,22 +514,21 @@ goto unlock_and_exit; } - /* Get the parent entry */ *ret_handle = - acpi_ns_convert_entry_to_handle (acpi_ns_get_parent_object (node)); + acpi_ns_convert_entry_to_handle (acpi_ns_get_parent_node (node)); /* Return exeption if parent is null */ - if (!acpi_ns_get_parent_object (node)) { + if (!acpi_ns_get_parent_node (node)) { status = AE_NULL_ENTRY; } unlock_and_exit: - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return (status); } @@ -495,7 +575,7 @@ acpi_status status; - FUNCTION_TRACE ("Acpi_walk_namespace"); + ACPI_FUNCTION_TRACE ("Acpi_walk_namespace"); /* Parameter validation */ @@ -512,13 +592,15 @@ * to the user function - since this function * must be allowed to make Acpi calls itself. */ - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); - status = acpi_ns_walk_namespace ((acpi_object_type8) type, start_object, - max_depth, NS_WALK_UNLOCK, user_function, context, - return_value); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ns_walk_namespace (type, start_object, max_depth, ACPI_NS_WALK_UNLOCK, + user_function, context, return_value); + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } @@ -547,15 +629,23 @@ acpi_status status; acpi_namespace_node *node; u32 flags; - acpi_device_id device_id; + acpi_device_id hid; + acpi_device_id cid; acpi_get_devices_info *info; info = context; - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return (status); + } + node = acpi_ns_map_handle_to_node (obj_handle); - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return (status); + } if (!node) { return (AE_BAD_PARAMETER); @@ -570,30 +660,41 @@ } if (!(flags & 0x01)) { - /* don't return at the device or children of the device if not there */ + /* Don't return at the device or children of the device if not there */ return (AE_CTRL_DEPTH); } /* - * Filter based on device HID + * Filter based on device HID & CID */ if (info->hid != NULL) { - status = acpi_ut_execute_HID (node, &device_id); + status = acpi_ut_execute_HID (node, &hid); if (status == AE_NOT_FOUND) { return (AE_OK); } - else if (ACPI_FAILURE (status)) { return (AE_CTRL_DEPTH); } - if (STRNCMP (device_id.buffer, info->hid, sizeof (device_id.buffer)) != 0) { - return (AE_OK); + if (ACPI_STRNCMP (hid.buffer, info->hid, sizeof (hid.buffer)) != 0) { + status = acpi_ut_execute_CID (node, &cid); + if (status == AE_NOT_FOUND) { + return (AE_OK); + } + else if (ACPI_FAILURE (status)) { + return (AE_CTRL_DEPTH); + } + + /* TBD: Handle CID packages */ + + if (ACPI_STRNCMP (cid.buffer, info->hid, sizeof (cid.buffer)) != 0) { + return (AE_OK); + } } } - info->user_function (obj_handle, nesting_level, info->context, return_value); - return (AE_OK); + status = info->user_function (obj_handle, nesting_level, info->context, return_value); + return (status); } @@ -633,7 +734,7 @@ acpi_get_devices_info info; - FUNCTION_TRACE ("Acpi_get_devices"); + ACPI_FUNCTION_TRACE ("Acpi_get_devices"); /* Parameter validation */ @@ -656,14 +757,170 @@ * to the user function - since this function * must be allowed to make Acpi calls itself. */ - acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - NS_WALK_UNLOCK, + ACPI_NS_WALK_UNLOCK, acpi_ns_get_device_callback, &info, return_value); - acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); - + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); } + + +/******************************************************************************* + * + * FUNCTION: Acpi_attach_data + * + * PARAMETERS: + * + * RETURN: Status + * + * DESCRIPTION: + * + ******************************************************************************/ + +acpi_status +acpi_attach_data ( + acpi_handle obj_handle, + ACPI_OBJECT_HANDLER handler, + void *data) +{ + acpi_namespace_node *node; + acpi_status status; + + + /* Parameter validation */ + + if (!obj_handle || + !handler || + !data) { + return (AE_BAD_PARAMETER); + } + + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return (status); + } + + /* Convert and validate the handle */ + + node = acpi_ns_map_handle_to_node (obj_handle); + if (!node) { + status = AE_BAD_PARAMETER; + goto unlock_and_exit; + } + + status = acpi_ns_attach_data (node, handler, data); + +unlock_and_exit: + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + return (status); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_detach_data + * + * PARAMETERS: + * + * RETURN: Status + * + * DESCRIPTION: + * + ******************************************************************************/ + +acpi_status +acpi_detach_data ( + acpi_handle obj_handle, + ACPI_OBJECT_HANDLER handler) +{ + acpi_namespace_node *node; + acpi_status status; + + + /* Parameter validation */ + + if (!obj_handle || + !handler) { + return (AE_BAD_PARAMETER); + } + + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return (status); + } + + /* Convert and validate the handle */ + + node = acpi_ns_map_handle_to_node (obj_handle); + if (!node) { + status = AE_BAD_PARAMETER; + goto unlock_and_exit; + } + + status = acpi_ns_detach_data (node, handler); + +unlock_and_exit: + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + return (status); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_get_data + * + * PARAMETERS: + * + * RETURN: Status + * + * DESCRIPTION: + * + ******************************************************************************/ + +acpi_status +acpi_get_data ( + acpi_handle obj_handle, + ACPI_OBJECT_HANDLER handler, + void **data) +{ + acpi_namespace_node *node; + acpi_status status; + + + /* Parameter validation */ + + if (!obj_handle || + !handler || + !data) { + return (AE_BAD_PARAMETER); + } + + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return (status); + } + + /* Convert and validate the handle */ + + node = acpi_ns_map_handle_to_node (obj_handle); + if (!node) { + status = AE_BAD_PARAMETER; + goto unlock_and_exit; + } + + status = acpi_ns_get_attached_data (node, handler, data); + +unlock_and_exit: + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + return (status); +} + + diff -urN linux-2.4.18/drivers/acpi/os.c lia64-2.4/drivers/acpi/os.c --- linux-2.4.18/drivers/acpi/os.c Mon Nov 26 11:18:30 2001 +++ lia64-2.4/drivers/acpi/os.c Wed Dec 31 16:00:00 1969 @@ -1,920 +0,0 @@ -/****************************************************************************** - * - * Module Name: os.c - Linux OSL functions - * $Revision: 49 $ - * - *****************************************************************************/ - -/* - * os.c - OS-dependent functions - * - * Copyright (C) 2000 Andrew Henroid - * Copyright (C) 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -/* Changes - * - * Christopher Liebman 2001-5-15 - * - Fixed improper kernel_thread parameters - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef CONFIG_ACPI_EFI -#include -#endif - -#ifdef _IA64 -#include -#endif - -#define _COMPONENT ACPI_OS_SERVICES - MODULE_NAME ("os") - -typedef struct -{ - OSD_EXECUTION_CALLBACK function; - void *context; -} ACPI_OS_DPC; - - -/***************************************************************************** - * Debugger Stuff - *****************************************************************************/ - -#ifdef ENABLE_DEBUGGER - -#include - -/* stuff for debugger support */ -int acpi_in_debugger = 0; -extern NATIVE_CHAR line_buf[80]; - -#endif - - -/***************************************************************************** - * Globals - *****************************************************************************/ - -static int acpi_irq_irq = 0; -static OSD_HANDLER acpi_irq_handler = NULL; -static void *acpi_irq_context = NULL; - - -/****************************************************************************** - * Functions - *****************************************************************************/ - -acpi_status -acpi_os_initialize(void) -{ - return AE_OK; -} - -acpi_status -acpi_os_terminate(void) -{ - if (acpi_irq_handler) { - acpi_os_remove_interrupt_handler(acpi_irq_irq, - acpi_irq_handler); - } - - return AE_OK; -} - -s32 -acpi_os_printf(const NATIVE_CHAR *fmt,...) -{ - s32 size; - va_list args; - va_start(args, fmt); - size = acpi_os_vprintf(fmt, args); - va_end(args); - - return size; -} - -s32 -acpi_os_vprintf(const NATIVE_CHAR *fmt, va_list args) -{ - static char buffer[512]; - int size = vsprintf(buffer, fmt, args); - -#ifdef ENABLE_DEBUGGER - if (acpi_in_debugger) { - kdb_printf("%s", buffer); - } else { - printk("%s", buffer); - } -#else - printk("%s", buffer); -#endif - - return size; -} - -void * -acpi_os_allocate(u32 size) -{ - return kmalloc(size, GFP_KERNEL); -} - -void * -acpi_os_callocate(u32 size) -{ - void *ptr = acpi_os_allocate(size); - if (ptr) - memset(ptr, 0, size); - - return ptr; -} - -void -acpi_os_free(void *ptr) -{ - kfree(ptr); -} - - -acpi_status -acpi_os_get_root_pointer(u32 flags, ACPI_PHYSICAL_ADDRESS *phys_addr) -{ -#ifndef CONFIG_ACPI_EFI - if (ACPI_FAILURE(acpi_find_root_pointer(flags, phys_addr))) { - printk(KERN_ERR "ACPI: System description tables not found\n"); - return AE_ERROR; - } -#else /*CONFIG_ACPI_EFI*/ - if (efi.acpi20) - *phys_addr = (ACPI_PHYSICAL_ADDRESS) efi.acpi20; - else if (efi.acpi) - *phys_addr = (ACPI_PHYSICAL_ADDRESS) efi.acpi; - else { - printk(KERN_ERR "ACPI: System description tables not found\n"); - *phys_addr = NULL; - return AE_ERROR; - } -#endif /*CONFIG_ACPI_EFI*/ - - return AE_OK; -} - -acpi_status -acpi_os_map_memory(ACPI_PHYSICAL_ADDRESS phys, u32 size, void **virt) -{ - if (phys > ULONG_MAX) { - printk(KERN_ERR "ACPI: Cannot map memory that high\n"); - return AE_ERROR; - } - - *virt = ioremap((unsigned long) phys, size); - if (!*virt) - return AE_ERROR; - - return AE_OK; -} - -void -acpi_os_unmap_memory(void *virt, u32 size) -{ - iounmap(virt); -} - -acpi_status -acpi_os_get_physical_address(void *virt, ACPI_PHYSICAL_ADDRESS *phys) -{ - if(!phys || !virt) - return AE_BAD_PARAMETER; - - *phys = virt_to_phys(virt); - - return AE_OK; -} - -static void -acpi_irq(int irq, void *dev_id, struct pt_regs *regs) -{ - (*acpi_irq_handler)(acpi_irq_context); -} - -acpi_status -acpi_os_install_interrupt_handler(u32 irq, OSD_HANDLER handler, void *context) -{ -#ifdef _IA64 - irq = isa_irq_to_vector(irq); -#endif /*_IA64*/ - acpi_irq_irq = irq; - acpi_irq_handler = handler; - acpi_irq_context = context; - if (request_irq(irq, - acpi_irq, - SA_SHIRQ, - "acpi", - acpi_irq)) { - printk(KERN_ERR "ACPI: SCI (IRQ%d) allocation failed\n", irq); - return AE_ERROR; - } - - return AE_OK; -} - -acpi_status -acpi_os_remove_interrupt_handler(u32 irq, OSD_HANDLER handler) -{ - if (acpi_irq_handler) { -#ifdef _IA64 - irq = isa_irq_to_vector(irq); -#endif /*_IA64*/ - free_irq(irq, acpi_irq); - acpi_irq_handler = NULL; - } - - return AE_OK; -} - -/* - * Running in interpreter thread context, safe to sleep - */ - -void -acpi_os_sleep(u32 sec, u32 ms) -{ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ * sec + (ms * HZ) / 1000); -} - -void -acpi_os_stall(u32 us) -{ - if (us > 10000) { - mdelay(us / 1000); - } - else { - udelay(us); - } -} - -acpi_status -acpi_os_read_port( - ACPI_IO_ADDRESS port, - void *value, - u32 width) -{ - u32 dummy; - - if (!value) - value = &dummy; - - switch (width) - { - case 8: - *(u8*) value = inb(port); - break; - case 16: - *(u16*) value = inw(port); - break; - case 32: - *(u32*) value = inl(port); - break; - default: - BUG(); - } - - return AE_OK; -} - -acpi_status -acpi_os_write_port( - ACPI_IO_ADDRESS port, - NATIVE_UINT value, - u32 width) -{ - switch (width) - { - case 8: - outb(value, port); - break; - case 16: - outw(value, port); - break; - case 32: - outl(value, port); - break; - default: - BUG(); - } - - return AE_OK; -} - -acpi_status -acpi_os_read_memory( - ACPI_PHYSICAL_ADDRESS phys_addr, - void *value, - u32 width) -{ - u32 dummy; - - if (!value) - value = &dummy; - - switch (width) - { - case 8: - *(u8*) value = *(u8*) phys_to_virt(phys_addr); - break; - case 16: - *(u16*) value = *(u16*) phys_to_virt(phys_addr); - break; - case 32: - *(u32*) value = *(u32*) phys_to_virt(phys_addr); - break; - default: - BUG(); - } - - return AE_OK; -} - -acpi_status -acpi_os_write_memory( - ACPI_PHYSICAL_ADDRESS phys_addr, - u32 value, - u32 width) -{ - switch (width) - { - case 8: - *(u8*) phys_to_virt(phys_addr) = value; - break; - case 16: - *(u16*) phys_to_virt(phys_addr) = value; - break; - case 32: - *(u32*) phys_to_virt(phys_addr) = value; - break; - default: - BUG(); - } - - return AE_OK; -} - - -#ifdef CONFIG_ACPI_PCI - -/* Architecture-dependent low-level PCI configuration access functions. */ -extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *val); -extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 val); - -acpi_status -acpi_os_read_pci_configuration ( - acpi_pci_id *pci_id, - u32 reg, - void *value, - u32 width) -{ - int result = 0; - if (!value) - return AE_ERROR; - - switch (width) - { - case 8: - result = pci_config_read(pci_id->segment, pci_id->bus, - pci_id->device, pci_id->function, reg, 1, value); - break; - case 16: - result = pci_config_read(pci_id->segment, pci_id->bus, - pci_id->device, pci_id->function, reg, 2, value); - break; - case 32: - result = pci_config_read(pci_id->segment, pci_id->bus, - pci_id->device, pci_id->function, reg, 4, value); - break; - default: - BUG(); - } - - return (result ? AE_ERROR : AE_OK); -} - -acpi_status -acpi_os_write_pci_configuration ( - acpi_pci_id *pci_id, - u32 reg, - NATIVE_UINT value, - u32 width) -{ - int result = 0; - - switch (width) - { - case 8: - result = pci_config_write(pci_id->segment, pci_id->bus, - pci_id->device, pci_id->function, reg, 1, value); - break; - case 16: - result = pci_config_write(pci_id->segment, pci_id->bus, - pci_id->device, pci_id->function, reg, 2, value); - break; - case 32: - result = pci_config_write(pci_id->segment, pci_id->bus, - pci_id->device, pci_id->function, reg, 4, value); - break; - default: - BUG(); - } - - return (result ? AE_ERROR : AE_OK); -} - -#else /*CONFIG_ACPI_PCI*/ - -acpi_status -acpi_os_read_pci_configuration ( - acpi_pci_id *pci_id, - u32 reg, - void *value, - u32 width) -{ - int devfn = PCI_DEVFN(pci_id->device, pci_id->function); - struct pci_dev *dev = pci_find_slot(pci_id->bus, devfn); - - if (!value || !dev) - return AE_ERROR; - - switch (width) - { - case 8: - if (pci_read_config_byte(dev, reg, (u8*) value)) - return AE_ERROR; - break; - case 16: - if (pci_read_config_word(dev, reg, (u16*) value)) - return AE_ERROR; - break; - case 32: - if (pci_read_config_dword(dev, reg, (u32*) value)) - return AE_ERROR; - break; - default: - BUG(); - } - - return AE_OK; -} - -acpi_status -acpi_os_write_pci_configuration ( - acpi_pci_id *pci_id, - u32 reg, - u32 value, - u32 width) -{ - int devfn = PCI_DEVFN(pci_id->device, pci_id->function); - struct pci_dev *dev = pci_find_slot(pci_id->bus, devfn); - - if (!dev) - return AE_ERROR; - - switch (width) - { - case 8: - if (pci_write_config_byte(dev, reg, value)) - return AE_ERROR; - break; - case 16: - if (pci_write_config_word(dev, reg, value)) - return AE_ERROR; - break; - case 32: - if (pci_write_config_dword(dev, reg, value)) - return AE_ERROR; - break; - default: - BUG(); - } - - return AE_OK; -} - -#endif /*CONFIG_ACPI_PCI*/ - - -acpi_status -acpi_os_load_module ( - char *module_name) -{ - PROC_NAME("acpi_os_load_module"); - - if (!module_name) - return AE_BAD_PARAMETER; - - if (0 > request_module(module_name)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to load module [%s].\n", module_name)); - return AE_ERROR; - } - - return AE_OK; -} - -acpi_status -acpi_os_unload_module ( - char *module_name) -{ - if (!module_name) - return AE_BAD_PARAMETER; - - /* TODO: How on Linux? */ - /* this is done automatically for all modules with - use_count = 0, I think. see: MOD_INC_USE_COUNT -ASG */ - - return AE_OK; -} - - -/* - * See acpi_os_queue_for_execution() - */ -static int -acpi_os_queue_exec ( - void *context) -{ - ACPI_OS_DPC *dpc = (ACPI_OS_DPC*)context; - - PROC_NAME("acpi_os_queue_exec"); - - daemonize(); - strcpy(current->comm, "kacpidpc"); - - if (!dpc || !dpc->function) - return AE_BAD_PARAMETER; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Executing function [%p(%p)].\n", dpc->function, dpc->context)); - - dpc->function(dpc->context); - - kfree(dpc); - - return 1; -} - -static void -acpi_os_schedule_exec ( - void *context) -{ - ACPI_OS_DPC *dpc = NULL; - int thread_pid = -1; - - PROC_NAME("acpi_os_schedule_exec"); - - dpc = (ACPI_OS_DPC*)context; - if (!dpc) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) context.\n")); - return; - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Creating new thread to run function [%p(%p)].\n", dpc->function, dpc->context)); - - thread_pid = kernel_thread(acpi_os_queue_exec, dpc, - (CLONE_FS | CLONE_FILES | SIGCHLD)); - if (thread_pid < 0) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Call to kernel_thread() failed.\n")); - acpi_os_free(dpc); - } -} - -acpi_status -acpi_os_queue_for_execution( - u32 priority, - OSD_EXECUTION_CALLBACK function, - void *context) -{ - acpi_status status = AE_OK; - ACPI_OS_DPC *dpc = NULL; - - PROC_NAME("acpi_os_queue_for_execution"); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Scheduling function [%p(%p)] for deferred execution.\n", function, context)); - - if (!function) - return AE_BAD_PARAMETER; - - /* - * Queue via DPC: - * -------------- - * Note that we have to use two different processes for queuing DPCs: - * Interrupt-Level: Use schedule_task; can't spawn a new thread. - * Kernel-Level: Spawn a new kernel thread, as schedule_task has - * its limitations (e.g. single-threaded model), and - * all other task queues run at interrupt-level. - */ - switch (priority) { - - case OSD_PRIORITY_GPE: - { - static struct tq_struct task; - - /* - * Allocate/initialize DPC structure. Note that this memory will be - * freed by the callee. - */ - dpc = kmalloc(sizeof(ACPI_OS_DPC), GFP_ATOMIC); - if (!dpc) - return AE_NO_MEMORY; - - dpc->function = function; - dpc->context = context; - - memset(&task, 0, sizeof(struct tq_struct)); - - task.routine = acpi_os_schedule_exec; - task.data = (void*)dpc; - - if (schedule_task(&task) < 0) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Call to schedule_task() failed.\n")); - status = AE_ERROR; - } - } - break; - - default: - /* - * Allocate/initialize DPC structure. Note that this memory will be - * freed by the callee. - */ - dpc = kmalloc(sizeof(ACPI_OS_DPC), GFP_KERNEL); - if (!dpc) - return AE_NO_MEMORY; - - dpc->function = function; - dpc->context = context; - - acpi_os_schedule_exec(dpc); - break; - } - - return status; -} - - -acpi_status -acpi_os_create_semaphore( - u32 max_units, - u32 initial_units, - acpi_handle *handle) -{ - struct semaphore *sem = NULL; - - PROC_NAME("acpi_os_create_semaphore"); - - sem = acpi_os_callocate(sizeof(struct semaphore)); - if (!sem) - return AE_NO_MEMORY; - - sema_init(sem, initial_units); - - *handle = (acpi_handle*)sem; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Creating semaphore[%p|%d].\n", *handle, initial_units)); - - return AE_OK; -} - - -/* - * TODO: A better way to delete semaphores? Linux doesn't have a - * 'delete_semaphore()' function -- may result in an invalid - * pointer dereference for non-synchronized consumers. Should - * we at least check for blocked threads and signal/cancel them? - */ - -acpi_status -acpi_os_delete_semaphore( - acpi_handle handle) -{ - struct semaphore *sem = (struct semaphore*) handle; - - PROC_NAME("acpi_os_delete_semaphore"); - - if (!sem) - return AE_BAD_PARAMETER; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting semaphore[%p].\n", handle)); - - acpi_os_free(sem); sem = NULL; - - return AE_OK; -} - - -/* - * TODO: The kernel doesn't have a 'down_timeout' function -- had to - * improvise. The process is to sleep for one scheduler quantum - * until the semaphore becomes available. Downside is that this - * may result in starvation for timeout-based waits when there's - * lots of semaphore activity. - * - * TODO: Support for units > 1? - */ -acpi_status -acpi_os_wait_semaphore( - acpi_handle handle, - u32 units, - u32 timeout) -{ - acpi_status status = AE_OK; - struct semaphore *sem = (struct semaphore*)handle; - int ret = 0; - - PROC_NAME("acpi_os_wait_semaphore"); - - if (!sem || (units < 1)) - return AE_BAD_PARAMETER; - - if (units > 1) - return AE_SUPPORT; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Waiting for semaphore[%p|%d|%d]\n", handle, units, timeout)); - - switch (timeout) - { - /* - * No Wait: - * -------- - * A zero timeout value indicates that we shouldn't wait - just - * acquire the semaphore if available otherwise return AE_TIME - * (a.k.a. 'would block'). - */ - case 0: - if(down_trylock(sem)) - status = AE_TIME; - break; - - /* - * Wait Indefinitely: - * ------------------ - */ - case WAIT_FOREVER: - ret = down_interruptible(sem); - if (ret < 0) - status = AE_ERROR; - break; - - /* - * Wait w/ Timeout: - * ---------------- - */ - default: - // TODO: A better timeout algorithm? - { - int i = 0; - static const int quantum_ms = 1000/HZ; - - ret = down_trylock(sem); - for (i = timeout; (i > 0 && ret < 0); i -= quantum_ms) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(1); - ret = down_trylock(sem); - } - - if (ret != 0) - status = AE_TIME; - } - break; - } - - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Failed to acquire semaphore[%p|%d|%d]\n", handle, units, timeout)); - } - else { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Acquired semaphore[%p|%d|%d]\n", handle, units, timeout)); - } - - return status; -} - - -/* - * TODO: Support for units > 1? - */ -acpi_status -acpi_os_signal_semaphore( - acpi_handle handle, - u32 units) -{ - struct semaphore *sem = (struct semaphore *) handle; - - PROC_NAME("acpi_os_signal_semaphore"); - - if (!sem || (units < 1)) - return AE_BAD_PARAMETER; - - if (units > 1) - return AE_SUPPORT; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Signaling semaphore[%p|%d]\n", handle, units)); - - up(sem); - - return AE_OK; -} - -u32 -acpi_os_get_line(NATIVE_CHAR *buffer) -{ - -#ifdef ENABLE_DEBUGGER - if (acpi_in_debugger) { - u32 chars; - - kdb_read(buffer, sizeof(line_buf)); - - /* remove the CR kdb includes */ - chars = strlen(buffer) - 1; - buffer[chars] = '\0'; - } -#endif - - return 0; -} - -/* - * We just have to assume we're dealing with valid memory - */ - -BOOLEAN -acpi_os_readable(void *ptr, u32 len) -{ - return 1; -} - -BOOLEAN -acpi_os_writable(void *ptr, u32 len) -{ - return 1; -} - -u32 -acpi_os_get_thread_id (void) -{ - if (!in_interrupt()) - return current->pid; - - return 0; -} - -acpi_status -acpi_os_signal ( - u32 function, - void *info) -{ - switch (function) - { - case ACPI_SIGNAL_FATAL: - printk(KERN_ERR "ACPI: Fatal opcode executed\n"); - break; - case ACPI_SIGNAL_BREAKPOINT: - { - char *bp_info = (char*) info; - - printk(KERN_ERR "ACPI breakpoint: %s\n", bp_info); - } - default: - break; - } - - return AE_OK; -} - -acpi_status -acpi_os_breakpoint(NATIVE_CHAR *msg) -{ - acpi_os_printf("breakpoint: %s", msg); - - return AE_OK; -} - diff -urN linux-2.4.18/drivers/acpi/osl.c lia64-2.4/drivers/acpi/osl.c --- linux-2.4.18/drivers/acpi/osl.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/osl.c Tue Jun 11 18:14:23 2002 @@ -0,0 +1,911 @@ +/* + * acpi_osl.c - OS-dependent functions ($Revision: 1.2 $) + * + * Copyright (C) 2000 Andrew Henroid + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "acpi.h" + +#ifdef CONFIG_ACPI_EFI +#include +u64 efi_mem_attributes (u64 phys_addr); +#endif + +#ifdef CONFIG_IA64 +#include +#include +#endif + + +#define _COMPONENT ACPI_OS_SERVICES +ACPI_MODULE_NAME ("osl") + +#define PREFIX "ACPI: " + +typedef struct +{ + OSD_EXECUTION_CALLBACK function; + void *context; +} ACPI_OS_DPC; + + +#ifdef ENABLE_DEBUGGER +#include +/* stuff for debugger support */ +int acpi_in_debugger = 0; +extern NATIVE_CHAR line_buf[80]; +#endif /*ENABLE_DEBUGGER*/ + +static int acpi_irq_irq = 0; +static OSD_HANDLER acpi_irq_handler = NULL; +static void *acpi_irq_context = NULL; + + +acpi_status +acpi_os_initialize(void) +{ + /* + * Initialize PCI configuration space access, as we'll need to access + * it while walking the namespace (bus 0 and root bridges w/ _BBNs). + */ +#ifdef CONFIG_ACPI_PCI + pcibios_config_init(); + if (!pci_config_read || !pci_config_write) { + printk(KERN_ERR PREFIX "Access to PCI configuration space unavailable\n"); + return AE_NULL_ENTRY; + } +#endif + + return AE_OK; +} + +acpi_status +acpi_os_terminate(void) +{ + if (acpi_irq_handler) { + acpi_os_remove_interrupt_handler(acpi_irq_irq, + acpi_irq_handler); + } + + return AE_OK; +} + +void +acpi_os_printf(const NATIVE_CHAR *fmt,...) +{ + va_list args; + va_start(args, fmt); + acpi_os_vprintf(fmt, args); + va_end(args); +} + +void +acpi_os_vprintf(const NATIVE_CHAR *fmt, va_list args) +{ + static char buffer[512]; + + vsprintf(buffer, fmt, args); + +#ifdef ENABLE_DEBUGGER + if (acpi_in_debugger) { + kdb_printf("%s", buffer); + } else { + printk("%s", buffer); + } +#else + printk("%s", buffer); +#endif +} + +void * +acpi_os_allocate(ACPI_SIZE size) +{ + return kmalloc(size, GFP_KERNEL); +} + +void * +acpi_os_callocate(ACPI_SIZE size) +{ + void *ptr = acpi_os_allocate(size); + if (ptr) + memset(ptr, 0, size); + + return ptr; +} + +void +acpi_os_free(void *ptr) +{ + kfree(ptr); +} + +acpi_status +acpi_os_get_root_pointer(u32 flags, ACPI_POINTER *addr) +{ +#ifdef CONFIG_ACPI_EFI + addr->pointer_type = ACPI_PHYSICAL_POINTER; + if (efi.acpi20) + addr->pointer.physical = (ACPI_PHYSICAL_ADDRESS) virt_to_phys(efi.acpi20); + else if (efi.acpi) + addr->pointer.physical = (ACPI_PHYSICAL_ADDRESS) virt_to_phys(efi.acpi); + else { + printk(KERN_ERR PREFIX "System description tables not found\n"); + return AE_NOT_FOUND; + } +#else + if (ACPI_FAILURE(acpi_find_root_pointer(flags, addr))) { + printk(KERN_ERR PREFIX "System description tables not found\n"); + return AE_NOT_FOUND; + } +#endif /*CONFIG_ACPI_EFI*/ + + return AE_OK; +} + +acpi_status +acpi_os_map_memory(ACPI_PHYSICAL_ADDRESS phys, ACPI_SIZE size, void **virt) +{ +#ifdef CONFIG_ACPI_EFI + if (!(EFI_MEMORY_WB & efi_mem_attributes(phys))) { + *virt = ioremap(phys, size); + } else { + *virt = phys_to_virt(phys); + } +#else + if (phys > ULONG_MAX) { + printk(KERN_ERR PREFIX "Cannot map memory that high\n"); + return AE_BAD_PARAMETER; + } + /* + * ioremap checks to ensure this is in reserved space + */ + *virt = ioremap((unsigned long) phys, size); +#endif + + if (!*virt) + return AE_NO_MEMORY; + + return AE_OK; +} + +void +acpi_os_unmap_memory(void *virt, ACPI_SIZE size) +{ + iounmap(virt); +} + +acpi_status +acpi_os_get_physical_address(void *virt, ACPI_PHYSICAL_ADDRESS *phys) +{ + if(!phys || !virt) + return AE_BAD_PARAMETER; + + *phys = virt_to_phys(virt); + + return AE_OK; +} + +acpi_status +acpi_os_table_override (acpi_table_header *existing_table, acpi_table_header **new_table) +{ + if (!existing_table || !new_table) + return AE_BAD_PARAMETER; + + *new_table = NULL; + return AE_OK; +} + +static void +acpi_irq(int irq, void *dev_id, struct pt_regs *regs) +{ + (*acpi_irq_handler)(acpi_irq_context); +} + +acpi_status +acpi_os_install_interrupt_handler(u32 irq, OSD_HANDLER handler, void *context) +{ +#ifdef CONFIG_IA64 + irq = gsi_to_vector(irq); +#endif /* CONFIG_IA64 */ + acpi_irq_irq = irq; + acpi_irq_handler = handler; + acpi_irq_context = context; + if (request_irq(irq, acpi_irq, SA_SHIRQ, "acpi", acpi_irq)) { + printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq); + return AE_NOT_ACQUIRED; + } + + return AE_OK; +} + +acpi_status +acpi_os_remove_interrupt_handler(u32 irq, OSD_HANDLER handler) +{ + if (acpi_irq_handler) { +#ifdef CONFIG_IA64 + irq = gsi_to_vector(irq); +#endif /* CONFIG_IA64 */ + free_irq(irq, acpi_irq); + acpi_irq_handler = NULL; + } + + return AE_OK; +} + +/* + * Running in interpreter thread context, safe to sleep + */ + +void +acpi_os_sleep(u32 sec, u32 ms) +{ + current->state = TASK_INTERRUPTIBLE; + schedule_timeout(HZ * sec + (ms * HZ) / 1000); +} + +void +acpi_os_stall(u32 us) +{ + if (us > 10000) { + mdelay(us / 1000); + } + else { + udelay(us); + } +} + +acpi_status +acpi_os_read_port( + ACPI_IO_ADDRESS port, + void *value, + u32 width) +{ + u32 dummy; + + if (!value) + value = &dummy; + + switch (width) + { + case 8: + *(u8*) value = inb(port); + break; + case 16: + *(u16*) value = inw(port); + break; + case 32: + *(u32*) value = inl(port); + break; + default: + BUG(); + } + + return AE_OK; +} + +acpi_status +acpi_os_write_port( + ACPI_IO_ADDRESS port, + acpi_integer value, + u32 width) +{ + switch (width) + { + case 8: + outb(value, port); + break; + case 16: + outw(value, port); + break; + case 32: + outl(value, port); + break; + default: + BUG(); + } + + return AE_OK; +} + +acpi_status +acpi_os_read_memory( + ACPI_PHYSICAL_ADDRESS phys_addr, + void *value, + u32 width) +{ + u32 dummy; + void *virt_addr; + +#ifdef CONFIG_ACPI_EFI + int iomem = 0; + + if (EFI_MEMORY_UC & efi_mem_attributes(phys_addr)) { + iomem = 1; + virt_addr = ioremap(phys_addr, width); + } else { + virt_addr = phys_to_virt(phys_addr); + } +#else + virt_addr = phys_to_virt(phys_addr); +#endif + if (!value) + value = &dummy; + + switch (width) { + case 8: + *(u8*) value = *(u8*) virt_addr; + break; + case 16: + *(u16*) value = *(u16*) virt_addr; + break; + case 32: + *(u32*) value = *(u32*) virt_addr; + break; + default: + BUG(); + } + +#ifdef CONFIG_ACPI_EFI + if (iomem) + iounmap(virt_addr); +#endif + + return AE_OK; +} + +acpi_status +acpi_os_write_memory( + ACPI_PHYSICAL_ADDRESS phys_addr, + acpi_integer value, + u32 width) +{ + void *virt_addr; + +#ifdef CONFIG_ACPI_EFI + int iomem = 0; + + if (EFI_MEMORY_UC & efi_mem_attributes(phys_addr)) { + iomem = 1; + virt_addr = ioremap(phys_addr,width); + } else { + virt_addr = phys_to_virt(phys_addr); + } +#else + virt_addr = phys_to_virt(phys_addr); +#endif + + switch (width) { + case 8: + *(u8*) virt_addr = value; + break; + case 16: + *(u16*) virt_addr = value; + break; + case 32: + *(u32*) virt_addr = value; + break; + default: + BUG(); + } + +#ifdef CONFIG_ACPI_EFI + if (iomem) + iounmap(virt_addr); +#endif + + return AE_OK; +} + +#ifdef CONFIG_ACPI_PCI + +acpi_status +acpi_os_read_pci_configuration ( + acpi_pci_id *pci_id, + u32 reg, + void *value, + u32 width) +{ + int result = 0; + if (!value) + return AE_BAD_PARAMETER; + + switch (width) + { + case 8: + result = pci_config_read(pci_id->segment, pci_id->bus, + pci_id->device, pci_id->function, reg, 1, value); + break; + case 16: + result = pci_config_read(pci_id->segment, pci_id->bus, + pci_id->device, pci_id->function, reg, 2, value); + break; + case 32: + result = pci_config_read(pci_id->segment, pci_id->bus, + pci_id->device, pci_id->function, reg, 4, value); + break; + default: + BUG(); + } + + return (result ? AE_ERROR : AE_OK); +} + +acpi_status +acpi_os_write_pci_configuration ( + acpi_pci_id *pci_id, + u32 reg, + acpi_integer value, + u32 width) +{ + int result = 0; + + switch (width) + { + case 8: + result = pci_config_write(pci_id->segment, pci_id->bus, + pci_id->device, pci_id->function, reg, 1, value); + break; + case 16: + result = pci_config_write(pci_id->segment, pci_id->bus, + pci_id->device, pci_id->function, reg, 2, value); + break; + case 32: + result = pci_config_write(pci_id->segment, pci_id->bus, + pci_id->device, pci_id->function, reg, 4, value); + break; + default: + BUG(); + } + + return (result ? AE_ERROR : AE_OK); +} + +#else /*!CONFIG_ACPI_PCI*/ + +acpi_status +acpi_os_write_pci_configuration ( + acpi_pci_id *pci_id, + u32 reg, + acpi_integer value, + u32 width) +{ + return (AE_SUPPORT); +} + +acpi_status +acpi_os_read_pci_configuration ( + acpi_pci_id *pci_id, + u32 reg, + void *value, + u32 width) +{ + return (AE_SUPPORT); +} + +#endif /*CONFIG_ACPI_PCI*/ + +acpi_status +acpi_os_load_module ( + char *module_name) +{ + ACPI_FUNCTION_TRACE ("os_load_module"); + + if (!module_name) + return_ACPI_STATUS (AE_BAD_PARAMETER); + + if (0 > request_module(module_name)) { + ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to load module [%s].\n", module_name)); + return_ACPI_STATUS (AE_ERROR); + } + + return_ACPI_STATUS (AE_OK); +} + +acpi_status +acpi_os_unload_module ( + char *module_name) +{ + if (!module_name) + return AE_BAD_PARAMETER; + + /* TODO: How on Linux? */ + /* this is done automatically for all modules with + use_count = 0, I think. see: MOD_INC_USE_COUNT -ASG */ + + return AE_OK; +} + + +/* + * See acpi_os_queue_for_execution() + */ +static int +acpi_os_queue_exec ( + void *context) +{ + ACPI_OS_DPC *dpc = (ACPI_OS_DPC*)context; + + ACPI_FUNCTION_TRACE ("os_queue_exec"); + + daemonize(); + strcpy(current->comm, "kacpidpc"); + + if (!dpc || !dpc->function) + return_ACPI_STATUS (AE_BAD_PARAMETER); + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Executing function [%p(%p)].\n", dpc->function, dpc->context)); + + dpc->function(dpc->context); + + kfree(dpc); + + return_ACPI_STATUS (AE_OK); +} + +static void +acpi_os_schedule_exec ( + void *context) +{ + ACPI_OS_DPC *dpc = NULL; + int thread_pid = -1; + + ACPI_FUNCTION_TRACE ("os_schedule_exec"); + + dpc = (ACPI_OS_DPC*)context; + if (!dpc) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) context.\n")); + return_VOID; + } + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Creating new thread to run function [%p(%p)].\n", dpc->function, dpc->context)); + + thread_pid = kernel_thread(acpi_os_queue_exec, dpc, + (CLONE_FS | CLONE_FILES | SIGCHLD)); + if (thread_pid < 0) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Call to kernel_thread() failed.\n")); + acpi_os_free(dpc); + } + return_VOID; +} + +acpi_status +acpi_os_queue_for_execution( + u32 priority, + OSD_EXECUTION_CALLBACK function, + void *context) +{ + acpi_status status = AE_OK; + ACPI_OS_DPC *dpc = NULL; + + ACPI_FUNCTION_TRACE ("os_queue_for_execution"); + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Scheduling function [%p(%p)] for deferred execution.\n", function, context)); + + if (!function) + return_ACPI_STATUS (AE_BAD_PARAMETER); + + /* + * Queue via DPC: + * -------------- + * Note that we have to use two different processes for queuing DPCs: + * Interrupt-Level: Use schedule_task; can't spawn a new thread. + * Kernel-Level: Spawn a new kernel thread, as schedule_task has + * its limitations (e.g. single-threaded model), and + * all other task queues run at interrupt-level. + */ + switch (priority) { + + case OSD_PRIORITY_GPE: + { + static struct tq_struct task; + + /* + * Allocate/initialize DPC structure. Note that this memory will be + * freed by the callee. + */ + dpc = kmalloc(sizeof(ACPI_OS_DPC), GFP_ATOMIC); + if (!dpc) + return_ACPI_STATUS (AE_NO_MEMORY); + + dpc->function = function; + dpc->context = context; + + memset(&task, 0, sizeof(struct tq_struct)); + + task.routine = acpi_os_schedule_exec; + task.data = (void*)dpc; + + if (schedule_task(&task) < 0) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Call to schedule_task() failed.\n")); + status = AE_ERROR; + } + } + break; + + default: + /* + * Allocate/initialize DPC structure. Note that this memory will be + * freed by the callee. + */ + dpc = kmalloc(sizeof(ACPI_OS_DPC), GFP_KERNEL); + if (!dpc) + return_ACPI_STATUS (AE_NO_MEMORY); + + dpc->function = function; + dpc->context = context; + + acpi_os_schedule_exec(dpc); + break; + } + + return_ACPI_STATUS (status); +} + + +acpi_status +acpi_os_create_semaphore( + u32 max_units, + u32 initial_units, + acpi_handle *handle) +{ + struct semaphore *sem = NULL; + + ACPI_FUNCTION_TRACE ("os_create_semaphore"); + + sem = acpi_os_callocate(sizeof(struct semaphore)); + if (!sem) + return_ACPI_STATUS (AE_NO_MEMORY); + + sema_init(sem, initial_units); + + *handle = (acpi_handle*)sem; + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Creating semaphore[%p|%d].\n", *handle, initial_units)); + + return_ACPI_STATUS (AE_OK); +} + + +/* + * TODO: A better way to delete semaphores? Linux doesn't have a + * 'delete_semaphore()' function -- may result in an invalid + * pointer dereference for non-synchronized consumers. Should + * we at least check for blocked threads and signal/cancel them? + */ + +acpi_status +acpi_os_delete_semaphore( + acpi_handle handle) +{ + struct semaphore *sem = (struct semaphore*) handle; + + ACPI_FUNCTION_TRACE ("os_delete_semaphore"); + + if (!sem) + return_ACPI_STATUS (AE_BAD_PARAMETER); + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting semaphore[%p].\n", handle)); + + acpi_os_free(sem); sem = NULL; + + return_ACPI_STATUS (AE_OK); +} + + +/* + * TODO: The kernel doesn't have a 'down_timeout' function -- had to + * improvise. The process is to sleep for one scheduler quantum + * until the semaphore becomes available. Downside is that this + * may result in starvation for timeout-based waits when there's + * lots of semaphore activity. + * + * TODO: Support for units > 1? + */ +acpi_status +acpi_os_wait_semaphore( + acpi_handle handle, + u32 units, + u32 timeout) +{ + acpi_status status = AE_OK; + struct semaphore *sem = (struct semaphore*)handle; + int ret = 0; + + ACPI_FUNCTION_TRACE ("os_wait_semaphore"); + + if (!sem || (units < 1)) + return_ACPI_STATUS (AE_BAD_PARAMETER); + + if (units > 1) + return_ACPI_STATUS (AE_SUPPORT); + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Waiting for semaphore[%p|%d|%d]\n", handle, units, timeout)); + + switch (timeout) + { + /* + * No Wait: + * -------- + * A zero timeout value indicates that we shouldn't wait - just + * acquire the semaphore if available otherwise return AE_TIME + * (a.k.a. 'would block'). + */ + case 0: + if(down_trylock(sem)) + status = AE_TIME; + break; + + /* + * Wait Indefinitely: + * ------------------ + */ + case WAIT_FOREVER: + ret = down_interruptible(sem); + if (ret < 0) + status = AE_ERROR; + break; + + /* + * Wait w/ Timeout: + * ---------------- + */ + default: + // TODO: A better timeout algorithm? + { + int i = 0; + static const int quantum_ms = 1000/HZ; + + ret = down_trylock(sem); + for (i = timeout; (i > 0 && ret < 0); i -= quantum_ms) { + current->state = TASK_INTERRUPTIBLE; + schedule_timeout(1); + ret = down_trylock(sem); + } + + if (ret != 0) + status = AE_TIME; + } + break; + } + + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Failed to acquire semaphore[%p|%d|%d]\n", handle, units, timeout)); + } + else { + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Acquired semaphore[%p|%d|%d]\n", handle, units, timeout)); + } + + return_ACPI_STATUS (status); +} + + +/* + * TODO: Support for units > 1? + */ +acpi_status +acpi_os_signal_semaphore( + acpi_handle handle, + u32 units) +{ + struct semaphore *sem = (struct semaphore *) handle; + + ACPI_FUNCTION_TRACE ("os_signal_semaphore"); + + if (!sem || (units < 1)) + return_ACPI_STATUS (AE_BAD_PARAMETER); + + if (units > 1) + return_ACPI_STATUS (AE_SUPPORT); + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Signaling semaphore[%p|%d]\n", handle, units)); + + up(sem); + + return_ACPI_STATUS (AE_OK); +} + +u32 +acpi_os_get_line(NATIVE_CHAR *buffer) +{ + +#ifdef ENABLE_DEBUGGER + if (acpi_in_debugger) { + u32 chars; + + kdb_read(buffer, sizeof(line_buf)); + + /* remove the CR kdb includes */ + chars = strlen(buffer) - 1; + buffer[chars] = '\0'; + } +#endif + + return 0; +} + +/* + * We just have to assume we're dealing with valid memory + */ + +BOOLEAN +acpi_os_readable(void *ptr, u32 len) +{ + return 1; +} + +BOOLEAN +acpi_os_writable(void *ptr, u32 len) +{ + return 1; +} + +u32 +acpi_os_get_thread_id (void) +{ + if (!in_interrupt()) + return current->pid; + + return 0; +} + +acpi_status +acpi_os_signal ( + u32 function, + void *info) +{ + switch (function) + { + case ACPI_SIGNAL_FATAL: + printk(KERN_ERR PREFIX "Fatal opcode executed\n"); + break; + case ACPI_SIGNAL_BREAKPOINT: + { + char *bp_info = (char*) info; + + printk(KERN_ERR "ACPI breakpoint: %s\n", bp_info); + } + default: + break; + } + + return AE_OK; +} + +acpi_status +acpi_os_breakpoint(NATIVE_CHAR *msg) +{ + acpi_os_printf("breakpoint: %s", msg); + + return AE_OK; +} + diff -urN linux-2.4.18/drivers/acpi/ospm/Makefile lia64-2.4/drivers/acpi/ospm/Makefile --- linux-2.4.18/drivers/acpi/ospm/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/ospm/Makefile Wed Dec 31 16:00:00 1969 @@ -1,22 +0,0 @@ -# -# Makefile for the Linux OSPM code. -# - -O_TARGET := $(notdir $(CURDIR)).o - -ACPI_CFLAGS += -I$(CURDIR)/include - -EXTRA_CFLAGS += $(ACPI_CFLAGS) - -subdir-$(CONFIG_ACPI_BUSMGR) += busmgr -subdir-$(CONFIG_ACPI_EC) += ec -subdir-$(CONFIG_ACPI_SYS) += system -subdir-$(CONFIG_ACPI_CPU) += processor -subdir-$(CONFIG_ACPI_CMBATT) += battery -subdir-$(CONFIG_ACPI_AC) += ac_adapter -subdir-$(CONFIG_ACPI_BUTTON) += button -subdir-$(CONFIG_ACPI_THERMAL) += thermal - -obj-y += $(foreach dir,$(subdir-y),$(dir)/ospm_$(dir).o) - -include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/drivers/acpi/ospm/ac_adapter/Makefile lia64-2.4/drivers/acpi/ospm/ac_adapter/Makefile --- linux-2.4.18/drivers/acpi/ospm/ac_adapter/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/ospm/ac_adapter/Makefile Wed Dec 31 16:00:00 1969 @@ -1,6 +0,0 @@ -O_TARGET := ospm_$(notdir $(CURDIR)).o -obj-m := $(O_TARGET) -EXTRA_CFLAGS += $(ACPI_CFLAGS) -obj-y := $(patsubst %.c,%.o,$(wildcard *.c)) - -include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/drivers/acpi/ospm/ac_adapter/ac.c lia64-2.4/drivers/acpi/ospm/ac_adapter/ac.c --- linux-2.4.18/drivers/acpi/ospm/ac_adapter/ac.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/ac_adapter/ac.c Wed Dec 31 16:00:00 1969 @@ -1,398 +0,0 @@ -/***************************************************************************** - * - * Module Name: ac.c - * $Revision: 23 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include "ac.h" - - -#define _COMPONENT ACPI_AC_ADAPTER - MODULE_NAME ("ac") - - -/**************************************************************************** - * Internal Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: ac_print - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Prints out information on a specific ac_adapter. - * - ****************************************************************************/ - -void -ac_print ( - AC_CONTEXT *ac_adapter) -{ -#ifdef ACPI_DEBUG - - acpi_buffer buffer; - - PROC_NAME("ac_print"); - - if (!ac_adapter) { - return; - } - - buffer.length = 256; - buffer.pointer = acpi_os_callocate(buffer.length); - if (!buffer.pointer) { - return; - } - - /* - * Get the full pathname for this ACPI object. - */ - acpi_get_name(ac_adapter->acpi_handle, ACPI_FULL_PATHNAME, &buffer); - - /* - * Print out basic adapter information. - */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| AC Adapter[%02x]:[%p] %s\n", ac_adapter->device_handle, ac_adapter->acpi_handle, (char*)buffer.pointer)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - - acpi_os_free(buffer.pointer); -#endif /*ACPI_DEBUG*/ - - return; -} - - -/**************************************************************************** - * - * FUNCTION: ac_add_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ac_add_device( - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - BM_DEVICE *device = NULL; - AC_CONTEXT *ac_adapter = NULL; - acpi_device_info info; - - FUNCTION_TRACE("ac_add_device"); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Adding ac_adapter device [%02x].\n", device_handle)); - - if (!context || *context) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) context.")); - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Get information on this device. - */ - status = bm_get_device_info(device_handle, &device); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Allocate a new AC_CONTEXT structure. - */ - ac_adapter = acpi_os_callocate(sizeof(AC_CONTEXT)); - if (!ac_adapter) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - ac_adapter->device_handle = device->handle; - ac_adapter->acpi_handle = device->acpi_handle; - - /* - * Get information on this object. - */ - status = acpi_get_object_info(ac_adapter->acpi_handle, &info); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to get object info for ac_adapter device.")); - goto end; - } - - /* - * _UID? - * ----- - */ - if (info.valid & ACPI_VALID_UID) { - strncpy(ac_adapter->uid, info.unique_id, sizeof(info.unique_id)); - } - else { - strncpy(ac_adapter->uid, "0", sizeof("0")); - } - - /* - * _STA? - * ----- - */ - if (!(info.valid & ACPI_VALID_STA)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Must have valid _STA.\n")); - status = AE_ERROR; - goto end; - } - - status = ac_osl_add_device(ac_adapter); - if (ACPI_FAILURE(status)) { - goto end; - } - - *context = ac_adapter; - - ac_print(ac_adapter); - -end: - if (ACPI_FAILURE(status)) { - acpi_os_free(ac_adapter); - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: ac_remove_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ac_remove_device ( - void **context) -{ - acpi_status status = AE_OK; - AC_CONTEXT *ac_adapter = NULL; - - FUNCTION_TRACE("ac_remove_device"); - - if (!context || !*context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - ac_adapter = (AC_CONTEXT*)*context; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing ac_adapter device [%02x].\n", ac_adapter->device_handle)); - - ac_osl_remove_device(ac_adapter); - - acpi_os_free(ac_adapter); - - *context = NULL; - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: ac_initialize - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ac_initialize (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("ac_initialize"); - - MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID)); - MEMSET(&driver, 0, sizeof(BM_DRIVER)); - - driver.notify = &ac_notify; - driver.request = &ac_request; - - /* - * Register driver for AC Adapter devices. - */ - MEMCPY(criteria.hid, AC_HID_AC_ADAPTER, sizeof(AC_HID_AC_ADAPTER)); - - status = bm_register_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: ac_terminate - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ac_terminate (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("ac_terminate"); - - MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID)); - MEMSET(&driver, 0, sizeof(BM_DRIVER)); - - /* - * Unregister driver for AC Adapter devices. - */ - MEMCPY(criteria.hid, AC_HID_AC_ADAPTER, sizeof(AC_HID_AC_ADAPTER)); - - driver.notify = &ac_notify; - driver.request = &ac_request; - - status = bm_unregister_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/***************************************************************************** - * - * FUNCTION: ac_notify - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ -acpi_status -ac_notify ( - BM_NOTIFY notify_type, - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("ac_notify"); - - if (!context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - switch (notify_type) { - - case BM_NOTIFY_DEVICE_ADDED: - status = ac_add_device(device_handle, context); - break; - - case BM_NOTIFY_DEVICE_REMOVED: - status = ac_remove_device(context); - break; - - case AC_NOTIFY_STATUS_CHANGE: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Status change event detected.\n")); - status = ac_osl_generate_event(notify_type, - ((AC_CONTEXT*)*context)); - break; - - default: - status = AE_SUPPORT; - break; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: ac_request - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ac_request ( - BM_REQUEST *request, - void *context) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("ac_request"); - - /* - * Must have a valid request structure and context. - */ - if (!request || !context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Handle Request: - * --------------- - */ - switch (request->command) { - - default: - status = AE_SUPPORT; - break; - } - - request->status = status; - - return_ACPI_STATUS(status); -} diff -urN linux-2.4.18/drivers/acpi/ospm/ac_adapter/ac_osl.c lia64-2.4/drivers/acpi/ospm/ac_adapter/ac_osl.c --- linux-2.4.18/drivers/acpi/ospm/ac_adapter/ac_osl.c Wed Dec 26 16:58:37 2001 +++ lia64-2.4/drivers/acpi/ospm/ac_adapter/ac_osl.c Wed Dec 31 16:00:00 1969 @@ -1,257 +0,0 @@ -/***************************************************************************** - * - * Module Name: ac_osl.c - * $Revision: 10 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include -#include -#include -#include -#include -#include "ac.h" - - -MODULE_AUTHOR("Andrew Grover"); -MODULE_DESCRIPTION("ACPI Component Architecture (CA) - AC Adapter Driver"); -MODULE_LICENSE("GPL"); - - -#define AC_PROC_ROOT "ac_adapter" -#define AC_PROC_STATUS "status" -#define AC_ON_LINE "on-line" -#define AC_OFF_LINE "off-line" - -extern struct proc_dir_entry *bm_proc_root; -static struct proc_dir_entry *ac_proc_root = NULL; - - -/**************************************************************************** - * - * FUNCTION: ac_osl_proc_read_status - * - ****************************************************************************/ - -static int -ac_osl_proc_read_status ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *context) -{ - acpi_status status = AE_OK; - AC_CONTEXT *ac_adapter = NULL; - char *p = page; - int len; - - if (!context) { - goto end; - } - - ac_adapter = (AC_CONTEXT*)context; - - /* don't get status more than once for a single proc read */ - if (off != 0) { - goto end; - } - - status = bm_evaluate_simple_integer(ac_adapter->acpi_handle, - "_PSR", &(ac_adapter->is_online)); - if (ACPI_FAILURE(status)) { - p += sprintf(p, "Error reading AC Adapter status\n"); - goto end; - } - - if (ac_adapter->is_online) { - p += sprintf(p, "Status: %s\n", - AC_ON_LINE); - } - else { - p += sprintf(p, "Status: %s\n", - AC_OFF_LINE); - } - -end: - len = (p - page); - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - - return(len); -} - - -/**************************************************************************** - * - * FUNCTION: ac_osl_add_device - * - ****************************************************************************/ - -acpi_status -ac_osl_add_device( - AC_CONTEXT *ac_adapter) -{ - struct proc_dir_entry *proc_entry = NULL; - - if (!ac_adapter) { - return(AE_BAD_PARAMETER); - } - - printk(KERN_INFO "ACPI: AC Adapter found\n"); - - proc_entry = proc_mkdir(ac_adapter->uid, ac_proc_root); - if (!proc_entry) { - return(AE_ERROR); - } - - create_proc_read_entry(AC_PROC_STATUS, S_IFREG | S_IRUGO, - proc_entry, ac_osl_proc_read_status, (void*)ac_adapter); - - return(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: ac_osl_remove_device - * - ****************************************************************************/ - -acpi_status -ac_osl_remove_device ( - AC_CONTEXT *ac_adapter) -{ - char proc_entry[64]; - - if (!ac_adapter) { - return(AE_BAD_PARAMETER); - } - - sprintf(proc_entry, "%s/%s", ac_adapter->uid, AC_PROC_STATUS); - remove_proc_entry(proc_entry, ac_proc_root); - - sprintf(proc_entry, "%s", ac_adapter->uid); - remove_proc_entry(proc_entry, ac_proc_root); - - return(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: ac_osl_generate_event - * - ****************************************************************************/ - -acpi_status -ac_osl_generate_event ( - u32 event, - AC_CONTEXT *ac_adapter) -{ - acpi_status status = AE_OK; - - if (!ac_adapter) { - return(AE_BAD_PARAMETER); - } - - switch (event) { - - case AC_NOTIFY_STATUS_CHANGE: - status = bm_osl_generate_event(ac_adapter->device_handle, - AC_PROC_ROOT, ac_adapter->uid, event, 0); - break; - - default: - return(AE_BAD_PARAMETER); - break; - } - - return(status); -} - - -/**************************************************************************** - * - * FUNCTION: ac_osl_init - * - * PARAMETERS: - * - * RETURN: 0: Success - * - * DESCRIPTION: Module initialization. - * - ****************************************************************************/ - -static int __init -ac_osl_init (void) -{ - acpi_status status = AE_OK; - - ac_proc_root = proc_mkdir(AC_PROC_ROOT, bm_proc_root); - if (!ac_proc_root) { - status = AE_ERROR; - } - else { - status = ac_initialize(); - if (ACPI_FAILURE(status)) { - remove_proc_entry(AC_PROC_ROOT, bm_proc_root); - } - - } - - return (ACPI_SUCCESS(status)) ? 0 : -ENODEV; -} - - -/**************************************************************************** - * - * FUNCTION: ac_osl_cleanup - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Module cleanup. - * - ****************************************************************************/ - -static void __exit -ac_osl_cleanup (void) -{ - ac_terminate(); - - if (ac_proc_root) { - remove_proc_entry(AC_PROC_ROOT, bm_proc_root); - } - - return; -} - - -module_init(ac_osl_init); -module_exit(ac_osl_cleanup); diff -urN linux-2.4.18/drivers/acpi/ospm/battery/Makefile lia64-2.4/drivers/acpi/ospm/battery/Makefile --- linux-2.4.18/drivers/acpi/ospm/battery/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/ospm/battery/Makefile Wed Dec 31 16:00:00 1969 @@ -1,6 +0,0 @@ -O_TARGET := ospm_$(notdir $(CURDIR)).o -obj-m := $(O_TARGET) -EXTRA_CFLAGS += $(ACPI_CFLAGS) -obj-y := $(patsubst %.c,%.o,$(wildcard *.c)) - -include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/drivers/acpi/ospm/battery/bt.c lia64-2.4/drivers/acpi/ospm/battery/bt.c --- linux-2.4.18/drivers/acpi/ospm/battery/bt.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/battery/bt.c Wed Dec 31 16:00:00 1969 @@ -1,654 +0,0 @@ -/***************************************************************************** - * - * Module Name: bt.c - * $Revision: 29 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include "bt.h" - - -#define _COMPONENT ACPI_BATTERY - MODULE_NAME ("bt") - - -/**************************************************************************** - * Internal Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: bt_print - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Prints out information on a specific battery. - * - ****************************************************************************/ - -void -bt_print ( - BT_CONTEXT *battery) -{ -#ifdef ACPI_DEBUG - acpi_buffer buffer; - - PROC_NAME("bt_print"); - - if (!battery) { - return; - } - - buffer.length = 256; - buffer.pointer = acpi_os_callocate(buffer.length); - if (!buffer.pointer) { - return; - } - - /* - * Get the full pathname for this ACPI object. - */ - acpi_get_name(battery->acpi_handle, ACPI_FULL_PATHNAME, &buffer); - - /* - * Print out basic battery information. - */ - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Battery[%02x]:[%p] %s\n", battery->device_handle, battery->acpi_handle, (char*)buffer.pointer)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| uid[%s] is_present[%d] power_units[%s]\n", battery->uid, battery->is_present, battery->power_units)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - - acpi_os_free(buffer.pointer); -#endif /*ACPI_DEBUG*/ - - return; -} - - -/**************************************************************************** - * - * FUNCTION: bt_get_info - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - * NOTES: Allocates battery_info - which must be freed by the caller. - * - ****************************************************************************/ - -acpi_status -bt_get_info ( - BT_CONTEXT *battery, - BT_BATTERY_INFO **battery_info) -{ - acpi_status status = AE_OK; - acpi_buffer bif_buffer, package_format, package_data; - acpi_object *package = NULL; - - FUNCTION_TRACE("bt_get_info"); - - if (!battery || !battery_info || *battery_info) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - memset(&bif_buffer, 0, sizeof(acpi_buffer)); - - /* - * Evalute _BIF: - * ------------- - * And be sure to deallocate bif_buffer.pointer! - */ - status = bm_evaluate_object(battery->acpi_handle, "_BIF", NULL, - &bif_buffer); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Extract Package Data: - * --------------------- - * Type-cast this bif_buffer to a package and use helper - * functions to convert results into BT_BATTERY_INFO structure. - * The first attempt is just to get the size of the package - * data; the second gets the data (once we know the required - * bif_buffer size). - */ - status = bm_cast_buffer(&bif_buffer, (void**)&package, - sizeof(acpi_object)); - if (ACPI_FAILURE(status)) { - goto end; - } - - package_format.length = sizeof("NNNNNNNNNSSSS"); - package_format.pointer = "NNNNNNNNNSSSS"; - - memset(&package_data, 0, sizeof(acpi_buffer)); - - status = bm_extract_package_data(package, &package_format, - &package_data); - if (status != AE_BUFFER_OVERFLOW) { - if (status == AE_OK) { - status = AE_ERROR; - } - goto end; - } - - package_data.pointer = acpi_os_callocate(package_data.length); - if (!package_data.pointer) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - status = bm_extract_package_data(package, &package_format, - &package_data); - if (ACPI_FAILURE(status)) { - acpi_os_free(package_data.pointer); - goto end; - } - - *battery_info = package_data.pointer; - -end: - acpi_os_free(bif_buffer.pointer); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bt_get_status - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bt_get_status ( - BT_CONTEXT *battery, - BT_BATTERY_STATUS **battery_status) -{ - acpi_status status = AE_OK; - acpi_buffer bst_buffer, package_format, package_data; - acpi_object *package = NULL; - - FUNCTION_TRACE("bt_get_status"); - - if (!battery || !battery_status || *battery_status) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - memset(&bst_buffer, 0, sizeof(acpi_buffer)); - - /* - * Evalute _BST: - * ------------- - * And be sure to deallocate bst_buffer.pointer! - */ - status = bm_evaluate_object(battery->acpi_handle, "_BST", - NULL, &bst_buffer); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Extract Package Data: - * --------------------- - * Type-cast this bst_buffer to a package and use helper - * functions to convert results into BT_BATTERY_STATUS structure. - * The first attempt is just to get the size of the package data; - * the second gets the data (once we know the required bst_buffer - * size). - */ - status = bm_cast_buffer(&bst_buffer, (void**)&package, - sizeof(acpi_object)); - if (ACPI_FAILURE(status)) { - goto end; - } - - package_format.length = sizeof("NNNN"); - package_format.pointer = "NNNN"; - - memset(&package_data, 0, sizeof(acpi_buffer)); - - status = bm_extract_package_data(package, &package_format, - &package_data); - if (status != AE_BUFFER_OVERFLOW) { - if (status == AE_OK) { - status = AE_ERROR; - } - goto end; - } - - package_data.pointer = acpi_os_callocate(package_data.length); - if (!package_data.pointer) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - status = bm_extract_package_data(package, &package_format, - &package_data); - if (ACPI_FAILURE(status)) { - acpi_os_free(package_data.pointer); - goto end; - } - - *battery_status = package_data.pointer; - -end: - acpi_os_free(bst_buffer.pointer); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bt_check_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bt_check_device ( - BT_CONTEXT *battery) -{ - acpi_status status = AE_OK; - BM_DEVICE_STATUS battery_status = BM_STATUS_UNKNOWN; - u32 was_present = FALSE; - BT_BATTERY_INFO *battery_info = NULL; - - FUNCTION_TRACE("bt_check_device"); - - if (!battery) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - was_present = battery->is_present; - - /* - * Battery Present? - * ---------------- - * Get the device status and check if battery slot is occupied. - */ - status = bm_get_device_status(battery->device_handle, &battery_status); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unable to get battery status.\n")); - return_ACPI_STATUS(status); - } - - if (battery_status & BM_STATUS_BATTERY_PRESENT) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Battery socket occupied.\n")); - battery->is_present = TRUE; - } - else { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Battery socket not occupied.\n")); - battery->is_present = FALSE; - } - - /* - * Battery Appeared? - * ----------------- - */ - if (!was_present && battery->is_present) { - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Battery insertion detected.\n")); - - /* - * Units of Power? - * --------------- - * Get the 'units of power', as we'll need this to report - * status information. - */ - status = bt_get_info(battery, &battery_info); - if (ACPI_SUCCESS(status)) { - battery->power_units = (battery_info->power_unit) - ? BT_POWER_UNITS_AMPS : BT_POWER_UNITS_WATTS; - acpi_os_free(battery_info); - } - } - - /* - * Battery Disappeared? - * -------------------- - */ - else if (was_present && !battery->is_present) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Battery removal detected.\n")); - battery->power_units = BT_POWER_UNITS_DEFAULT; - } - - return_ACPI_STATUS(status); -} - - -/***************************************************************************** - * - * FUNCTION: bt_add_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bt_add_device ( - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - BM_DEVICE *device = NULL; - BT_CONTEXT *battery = NULL; - - FUNCTION_TRACE("bt_add_device"); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Adding battery device [%02x].\n", device_handle)); - - if (!context || *context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Get information on this device. - */ - status = bm_get_device_info(device_handle, &device); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Allocate a new BT_CONTEXT structure. - */ - battery = acpi_os_callocate(sizeof(BT_CONTEXT)); - if (!battery) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - battery->device_handle = device->handle; - battery->acpi_handle = device->acpi_handle; - strncpy(battery->uid, device->id.uid, sizeof(battery->uid)); - - battery->power_units = BT_POWER_UNITS_DEFAULT; - battery->is_present = FALSE; - - /* - * See if battery is really present. - */ - status = bt_check_device(battery); - if (ACPI_FAILURE(status)) { - goto end; - } - - status = bt_osl_add_device(battery); - if (ACPI_FAILURE(status)) { - goto end; - } - - *context = battery; - - bt_print(battery); - -end: - if (ACPI_FAILURE(status)) { - acpi_os_free(battery); - } - - return_ACPI_STATUS(status); -} - - -/***************************************************************************** - * - * FUNCTION: bt_remove_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bt_remove_device ( - void **context) -{ - acpi_status status = AE_OK; - BT_CONTEXT *battery = NULL; - - FUNCTION_TRACE("bt_remove_device"); - - if (!context || !*context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - battery = (BT_CONTEXT*)*context; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing battery device [%02x].\n", battery->device_handle)); - - bt_osl_remove_device(battery); - - acpi_os_free(battery); - - *context = NULL; - - return_ACPI_STATUS(status); -} - - -/***************************************************************************** - * External Functions - *****************************************************************************/ - -/***************************************************************************** - * - * FUNCTION: bt_initialize - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bt_initialize (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("bt_initialize"); - - memset(&criteria, 0, sizeof(BM_DEVICE_ID)); - memset(&driver, 0, sizeof(BM_DRIVER)); - - /* - * Register driver for driver method battery devices. - */ - MEMCPY(criteria.hid, BT_HID_CM_BATTERY, sizeof(BT_HID_CM_BATTERY)); - - driver.notify = &bt_notify; - driver.request = &bt_request; - - status = bm_register_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bt_terminate - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bt_terminate (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("bt_terminate"); - - memset(&criteria, 0, sizeof(BM_DEVICE_ID)); - memset(&driver, 0, sizeof(BM_DRIVER)); - - /* - * Unregister driver for driver method battery devices. - */ - MEMCPY(criteria.hid, BT_HID_CM_BATTERY, sizeof(BT_HID_CM_BATTERY)); - - driver.notify = &bt_notify; - driver.request = &bt_request; - - status = bm_unregister_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bt_notify - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bt_notify ( - BM_NOTIFY notify_type, - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("bt_notify"); - - if (!context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - switch (notify_type) { - - case BM_NOTIFY_DEVICE_ADDED: - status = bt_add_device(device_handle, context); - break; - - case BM_NOTIFY_DEVICE_REMOVED: - status = bt_remove_device(context); - break; - - case BT_NOTIFY_STATUS_CHANGE: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Status change (_BST) event detected.\n")); - status = bt_osl_generate_event(notify_type, - ((BT_CONTEXT*)*context)); - break; - - case BT_NOTIFY_INFORMATION_CHANGE: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Information change (_BIF) event detected.\n")); - status = bt_check_device((BT_CONTEXT*)*context); - if (ACPI_SUCCESS(status)) { - status = bt_osl_generate_event(notify_type, - ((BT_CONTEXT*)*context)); - } - break; - - default: - status = AE_SUPPORT; - break; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bt_request - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bt_request ( - BM_REQUEST *request, - void *context) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("bt_request"); - - /* - * Must have a valid request structure and context. - */ - if (!request || !context) - return_ACPI_STATUS(AE_BAD_PARAMETER); - - /* - * Handle request: - * --------------- - */ - switch (request->command) { - - default: - status = AE_SUPPORT; - break; - } - - request->status = status; - - return_ACPI_STATUS(status); -} diff -urN linux-2.4.18/drivers/acpi/ospm/battery/bt_osl.c lia64-2.4/drivers/acpi/ospm/battery/bt_osl.c --- linux-2.4.18/drivers/acpi/ospm/battery/bt_osl.c Wed Dec 26 16:58:37 2001 +++ lia64-2.4/drivers/acpi/ospm/battery/bt_osl.c Wed Dec 31 16:00:00 1969 @@ -1,443 +0,0 @@ -/****************************************************************************** - * - * Module Name: bt_osl.c - * $Revision: 24 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Changes: - * Brendan Burns 2000-11-15 - * - added proc battery interface - * - parse returned data from _BST and _BIF - * Andy Grover 2000-12-8 - * - improved proc interface - */ - - -#include -#include -#include -#include -#include -#include -#include "bt.h" - - -MODULE_AUTHOR("Andrew Grover"); -MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Control Method Battery Driver"); -MODULE_LICENSE("GPL"); - - -#define BT_PROC_ROOT "battery" -#define BT_PROC_STATUS "status" -#define BT_PROC_INFO "info" - -extern struct proc_dir_entry *bm_proc_root; -static struct proc_dir_entry *bt_proc_root = NULL; - - -/**************************************************************************** - * - * FUNCTION: bt_osl_proc_read_info - * - ****************************************************************************/ - -static int -bt_osl_proc_read_info ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *context) -{ - BT_CONTEXT *battery = NULL; - BT_BATTERY_INFO *battery_info = NULL; - char *p = page; - int len = 0; - - if (!context || (off != 0)) { - goto end; - } - - battery = (BT_CONTEXT*)context; - - /* - * Battery Present? - * ---------------- - */ - if (!battery->is_present) { - p += sprintf(p, "Present: no\n"); - goto end; - } - else { - p += sprintf(p, "Present: yes\n"); - } - - /* - * Get Battery Information: - * ------------------------ - */ - if (ACPI_FAILURE(bt_get_info(battery, &battery_info))) { - p += sprintf(p, "Error reading battery information (_BIF)\n"); - goto end; - } - - if (battery_info->design_capacity == BT_UNKNOWN) { - p += sprintf(p, "Design Capacity: unknown\n"); - } - else { - p += sprintf(p, "Design Capacity: %d %sh\n", - (u32)battery_info->design_capacity, - battery->power_units); - } - - if (battery_info->last_full_capacity == BT_UNKNOWN) { - p += sprintf(p, "Last Full Capacity: unknown\n"); - } - else { - p += sprintf(p, "Last Full Capacity: %d %sh\n", - (u32)battery_info->last_full_capacity, - battery->power_units); - } - - if (battery_info->battery_technology == 0) { - p += sprintf(p, "Battery Technology: primary (non-rechargeable)\n"); - } - else if (battery_info->battery_technology == 1) { - p += sprintf(p, "Battery Technology: secondary (rechargeable)\n"); - } - else { - p += sprintf(p, "Battery Technology: unknown\n"); - } - - if (battery_info->design_voltage == BT_UNKNOWN) { - p += sprintf(p, "Design Voltage: unknown\n"); - } - else { - p += sprintf(p, "Design Voltage: %d mV\n", - (u32)battery_info->design_voltage); - } - - p += sprintf(p, "Design Capacity Warning: %d %sh\n", - (u32)battery_info->design_capacity_warning, - battery->power_units); - p += sprintf(p, "Design Capacity Low: %d %sh\n", - (u32)battery_info->design_capacity_low, - battery->power_units); - p += sprintf(p, "Capacity Granularity 1: %d %sh\n", - (u32)battery_info->battery_capacity_granularity_1, - battery->power_units); - p += sprintf(p, "Capacity Granularity 2: %d %sh\n", - (u32)battery_info->battery_capacity_granularity_2, - battery->power_units); - p += sprintf(p, "Model Number: %s\n", - battery_info->model_number); - p += sprintf(p, "Serial Number: %s\n", - battery_info->serial_number); - p += sprintf(p, "Battery Type: %s\n", - battery_info->battery_type); - p += sprintf(p, "OEM Info: %s\n", - battery_info->oem_info); - -end: - len = (p - page); - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - - acpi_os_free(battery_info); - - return(len); -} - - -/**************************************************************************** - * - * FUNCTION: bt_osl_proc_read_status - * - ****************************************************************************/ - -static int -bt_osl_proc_read_status ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *context) -{ - BT_CONTEXT *battery = NULL; - BT_BATTERY_STATUS *battery_status = NULL; - char *p = page; - int len = 0; - - if (!context || (off != 0)) { - goto end; - } - - battery = (BT_CONTEXT*)context; - - /* - * Battery Present? - * ---------------- - */ - if (!battery->is_present) { - p += sprintf(p, "Present: no\n"); - goto end; - } - else { - p += sprintf(p, "Present: yes\n"); - } - - /* - * Get Battery Status: - * ------------------- - */ - if (ACPI_FAILURE(bt_get_status(battery, &battery_status))) { - p += sprintf(p, "Error reading battery status (_BST)\n"); - goto end; - } - - /* - * Store Data: - * ----------- - */ - - if (!battery_status->state) { - p += sprintf(p, "State: ok\n"); - } - else { - if (battery_status->state & 0x1) - p += sprintf(p, "State: discharging\n"); - if (battery_status->state & 0x2) - p += sprintf(p, "State: charging\n"); - if (battery_status->state & 0x4) - p += sprintf(p, "State: critically low\n"); - } - - if (battery_status->present_rate == BT_UNKNOWN) { - p += sprintf(p, "Present Rate: unknown\n"); - } - else { - p += sprintf(p, "Present Rate: %d %s\n", - (u32)battery_status->present_rate, - battery->power_units); - } - - if (battery_status->remaining_capacity == BT_UNKNOWN) { - p += sprintf(p, "Remaining Capacity: unknown\n"); - } - else { - p += sprintf(p, "Remaining Capacity: %d %sh\n", - (u32)battery_status->remaining_capacity, - battery->power_units); - } - - if (battery_status->present_voltage == BT_UNKNOWN) { - p += sprintf(p, "Battery Voltage: unknown\n"); - } - else { - p += sprintf(p, "Battery Voltage: %d mV\n", - (u32)battery_status->present_voltage); - } - -end: - len = (p - page); - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - - acpi_os_free(battery_status); - - return(len); -} - - -/**************************************************************************** - * - * FUNCTION: bt_osl_add_device - * - ****************************************************************************/ - -acpi_status -bt_osl_add_device( - BT_CONTEXT *battery) -{ - struct proc_dir_entry *proc_entry = NULL; - - if (!battery) { - return(AE_BAD_PARAMETER); - } - - if (battery->is_present) { - printk("ACPI: Battery socket found, battery present\n"); - } - else { - printk("ACPI: Battery socket found, battery absent\n"); - } - - proc_entry = proc_mkdir(battery->uid, bt_proc_root); - if (!proc_entry) { - return(AE_ERROR); - } - - create_proc_read_entry(BT_PROC_STATUS, S_IFREG | S_IRUGO, - proc_entry, bt_osl_proc_read_status, (void*)battery); - - create_proc_read_entry(BT_PROC_INFO, S_IFREG | S_IRUGO, - proc_entry, bt_osl_proc_read_info, (void*)battery); - - return(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bt_osl_remove_device - * - ****************************************************************************/ - -acpi_status -bt_osl_remove_device ( - BT_CONTEXT *battery) -{ - char proc_entry[64]; - - if (!battery) { - return(AE_BAD_PARAMETER); - } - - sprintf(proc_entry, "%s/%s", battery->uid, BT_PROC_INFO); - remove_proc_entry(proc_entry, bt_proc_root); - - sprintf(proc_entry, "%s/%s", battery->uid, BT_PROC_STATUS); - remove_proc_entry(proc_entry, bt_proc_root); - - sprintf(proc_entry, "%s", battery->uid); - remove_proc_entry(proc_entry, bt_proc_root); - - return(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bt_osl_generate_event - * - ****************************************************************************/ - -acpi_status -bt_osl_generate_event ( - u32 event, - BT_CONTEXT *battery) -{ - acpi_status status = AE_OK; - - if (!battery) { - return(AE_BAD_PARAMETER); - } - - switch (event) { - - case BT_NOTIFY_STATUS_CHANGE: - case BT_NOTIFY_INFORMATION_CHANGE: - status = bm_osl_generate_event(battery->device_handle, - BT_PROC_ROOT, battery->uid, event, 0); - break; - - default: - return(AE_BAD_PARAMETER); - break; - } - - return(status); -} - - -/**************************************************************************** - * - * FUNCTION: bt_osl_init - * - * PARAMETERS: - * - * RETURN: 0: Success - * - * DESCRIPTION: Module initialization. - * - ****************************************************************************/ - -static int __init -bt_osl_init (void) -{ - acpi_status status = AE_OK; - - /* abort if no busmgr */ - if (!bm_proc_root) - return -ENODEV; - - bt_proc_root = proc_mkdir(BT_PROC_ROOT, bm_proc_root); - if (!bt_proc_root) { - status = AE_ERROR; - } - else { - status = bt_initialize(); - if (ACPI_FAILURE(status)) { - remove_proc_entry(BT_PROC_ROOT, bm_proc_root); - } - } - - return (ACPI_SUCCESS(status)) ? 0 : -ENODEV; -} - - -/**************************************************************************** - * - * FUNCTION: bt_osl_cleanup - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Module cleanup. - * - ****************************************************************************/ - -static void __exit -bt_osl_cleanup (void) -{ - bt_terminate(); - - if (bt_proc_root) { - remove_proc_entry(BT_PROC_ROOT, bm_proc_root); - } - - return; -} - - -module_init(bt_osl_init); -module_exit(bt_osl_cleanup); diff -urN linux-2.4.18/drivers/acpi/ospm/busmgr/Makefile lia64-2.4/drivers/acpi/ospm/busmgr/Makefile --- linux-2.4.18/drivers/acpi/ospm/busmgr/Makefile Mon Sep 24 15:06:43 2001 +++ lia64-2.4/drivers/acpi/ospm/busmgr/Makefile Wed Dec 31 16:00:00 1969 @@ -1,8 +0,0 @@ -export-objs := bm_osl.o - -O_TARGET := ospm_$(notdir $(CURDIR)).o -obj-m := $(O_TARGET) -EXTRA_CFLAGS += $(ACPI_CFLAGS) -obj-y := $(patsubst %.c,%.o,$(wildcard *.c)) - -include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/drivers/acpi/ospm/busmgr/bm.c lia64-2.4/drivers/acpi/ospm/busmgr/bm.c --- linux-2.4.18/drivers/acpi/ospm/busmgr/bm.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/busmgr/bm.c Wed Dec 31 16:00:00 1969 @@ -1,1146 +0,0 @@ -/****************************************************************************** - * - * Module Name: bm.c - * $Revision: 48 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include -#include -#include -#include "bm.h" - - -#define _COMPONENT ACPI_BUS - MODULE_NAME ("bm") - - -/**************************************************************************** - * Globals - ****************************************************************************/ - -extern fadt_descriptor_rev2 acpi_fadt; -/* TBD: Make dynamically sizeable. */ -BM_NODE_LIST node_list; - - -/**************************************************************************** - * Internal Functions - ****************************************************************************/ - -/***************************************************************************** - * - * FUNCTION: bm_print_object - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -void -bm_print_object ( - acpi_handle handle) -{ - acpi_buffer buffer; - acpi_handle parent; - acpi_object_type type; - - buffer.length = 256; - buffer.pointer = acpi_os_callocate(buffer.length); - if (!buffer.pointer) { - return; - } - - acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); - acpi_get_parent(handle, &parent); - acpi_get_type(handle, &type); - - /* - * TBD: Hack to get around scope identification problem. - */ - if (type == ACPI_TYPE_ANY) { - if (ACPI_SUCCESS(acpi_get_next_object(ACPI_TYPE_ANY, - handle, 0, NULL))) { - type = INTERNAL_TYPE_SCOPE; - } - } - - switch (type) - { - case INTERNAL_TYPE_SCOPE: - acpi_os_printf("SCOPE: "); - break; - case ACPI_TYPE_INTEGER: - acpi_os_printf("SIMPLE (number): "); - break; - case ACPI_TYPE_STRING: - acpi_os_printf("SIMPLE (string): "); - break; - case ACPI_TYPE_BUFFER: - acpi_os_printf("SIMPLE (buffer): "); - break; - case ACPI_TYPE_PACKAGE: - acpi_os_printf("SIMPLE (package): "); - break; - case ACPI_TYPE_FIELD_UNIT: - acpi_os_printf("FIELD UNIT: "); - break; - case ACPI_TYPE_DEVICE: - acpi_os_printf("DEVICE: "); - break; - case ACPI_TYPE_EVENT: - acpi_os_printf("EVENT: "); - break; - case ACPI_TYPE_METHOD: - acpi_os_printf("CONTROL METHOD: "); - break; - case ACPI_TYPE_MUTEX: - acpi_os_printf("MUTEX: "); - break; - case ACPI_TYPE_REGION: - acpi_os_printf("OPERATION REGION: "); - break; - case ACPI_TYPE_POWER: - acpi_os_printf("POWER RESOURCE: "); - break; - case ACPI_TYPE_PROCESSOR: - acpi_os_printf("PROCESSOR: "); - break; - case ACPI_TYPE_THERMAL: - acpi_os_printf("THERMAL ZONE: "); - break; - case ACPI_TYPE_BUFFER_FIELD: - acpi_os_printf("BUFFER FIELD: "); - break; - case ACPI_TYPE_DDB_HANDLE: - acpi_os_printf("DDB HANDLE: "); - break; - default: - acpi_os_printf("OTHER (%d): ", type); - break; - } - - acpi_os_printf("Object[%p][%s] parent[%p].\n", handle, (char*)buffer.pointer, parent); - - acpi_os_free(buffer.pointer); -} - - -/**************************************************************************** - * - * FUNCTION: bm_print_node - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -void -bm_print_node ( - BM_NODE *node, - u32 flags) -{ -#ifdef ACPI_DEBUG - acpi_buffer buffer; - BM_DEVICE *device = NULL; - char *type_string = NULL; - - PROC_NAME("bm_print_node"); - - if (!node) { - return; - } - - device = &(node->device); - - if (flags & BM_PRINT_PRESENT) { - if (!BM_DEVICE_PRESENT(device)) { - return; - } - } - - buffer.length = 256; - buffer.pointer = acpi_os_callocate(buffer.length); - if (!buffer.pointer) { - return; - } - - acpi_get_name(device->acpi_handle, ACPI_FULL_PATHNAME, &buffer); - - switch(device->id.type) { - case BM_TYPE_SYSTEM: - type_string = " System"; - break; - case BM_TYPE_SCOPE: - type_string = " Scope"; - break; - case BM_TYPE_PROCESSOR: - type_string = " Proc"; - break; - case BM_TYPE_THERMAL_ZONE: - type_string = "Thermal"; - break; - case BM_TYPE_POWER_RESOURCE: - type_string = " Power"; - break; - case BM_TYPE_FIXED_BUTTON: - type_string = " Button"; - break; - case BM_TYPE_DEVICE: - type_string = " Device"; - break; - default: - type_string = "Unknown"; - break; - } - - if (!(flags & BM_PRINT_GROUP)) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+-------------------------------------------------------------------------------\n")); - } - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| %s[%02x]:[%p] flags[%02x] hid[%s] %s\n", type_string, device->handle, device->acpi_handle, device->flags, (device->id.hid[0] ? device->id.hid : " "), (char*)buffer.pointer)); - - if (flags & BM_PRINT_IDENTIFICATION) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| identification: uid[%s] adr[%08x]\n", device->id.uid, device->id.adr)); - } - - if (flags & BM_PRINT_LINKAGE) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| linkage: this[%p] parent[%p] next[%p]\n", node, node->parent, node->next)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| scope.head[%p] scope.tail[%p]\n", node->scope.head, node->scope.tail)); - } - - if (flags & BM_PRINT_POWER) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| power: state[D%d] flags[%08x]\n", device->power.state, device->power.flags)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| S0[%02x] S1[%02x] S2[%02x] S3[%02x] S4[%02x] S5[%02x]\n", device->power.dx_supported[0], device->power.dx_supported[1], device->power.dx_supported[2], device->power.dx_supported[3], device->power.dx_supported[4], device->power.dx_supported[5])); - } - - if (!(flags & BM_PRINT_GROUP)) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+-------------------------------------------------------------------------------\n")); - } - - acpi_os_free(buffer.pointer); -#endif /*ACPI_DEBUG*/ - - return; -} - - -/**************************************************************************** - * - * FUNCTION: bm_print_hierarchy - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -void -bm_print_hierarchy (void) -{ -#ifdef ACPI_DEBUG - u32 i = 0; - - FUNCTION_TRACE("bm_print_hierarchy"); - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - - for (i = 0; i < node_list.count; i++) { - bm_print_node(node_list.nodes[i], BM_PRINT_GROUP | BM_PRINT_PRESENT); - } - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); -#endif /*ACPI_DEBUG*/ - - return_VOID; -} - - -/**************************************************************************** - * - * FUNCTION: bm_get_status - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_get_status ( - BM_DEVICE *device) -{ - acpi_status status = AE_OK; - - if (!device) { - return AE_BAD_PARAMETER; - } - - device->status = BM_STATUS_UNKNOWN; - - /* - * Dynamic Status? - * --------------- - * If _STA isn't present we just return the default status. - */ - if (!(device->flags & BM_FLAGS_DYNAMIC_STATUS)) { - device->status = BM_STATUS_DEFAULT; - return AE_OK; - } - - /* - * Evaluate _STA: - * -------------- - */ - status = bm_evaluate_simple_integer(device->acpi_handle, "_STA", - &(device->status)); - - return status; -} - - -/**************************************************************************** - * - * FUNCTION: bm_get_identification - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_get_identification ( - BM_DEVICE *device) -{ - acpi_status status = AE_OK; - acpi_device_info info; - - if (!device) { - return AE_BAD_PARAMETER; - } - - if (!(device->flags & BM_FLAGS_IDENTIFIABLE)) { - return AE_OK; - } - - device->id.uid[0] = BM_UID_UNKNOWN; - device->id.hid[0] = BM_HID_UNKNOWN; - device->id.adr = BM_ADDRESS_UNKNOWN; - - /* - * Get Object Info: - * ---------------- - * Evalute _UID, _HID, and _ADR... - */ - status = acpi_get_object_info(device->acpi_handle, &info); - if (ACPI_FAILURE(status)) { - return status; - } - - if (info.valid & ACPI_VALID_UID) { - MEMCPY((void*)device->id.uid, (void*)info.unique_id, - sizeof(BM_DEVICE_UID)); - } - - if (info.valid & ACPI_VALID_HID) { - MEMCPY((void*)device->id.hid, (void*)info.hardware_id, - sizeof(BM_DEVICE_HID)); - } - - if (info.valid & ACPI_VALID_ADR) { - device->id.adr = info.address; - } - - return status; -} - - -/**************************************************************************** - * - * FUNCTION: bm_get_flags - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_get_flags ( - BM_DEVICE *device) -{ - acpi_handle acpi_handle = NULL; - - if (!device) { - return AE_BAD_PARAMETER; - } - - device->flags = BM_FLAGS_UNKNOWN; - - switch (device->id.type) { - - case BM_TYPE_DEVICE: - - /* - * Presence of _DCK indicates a docking station. - */ - if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, - "_DCK", &acpi_handle))) { - device->flags |= BM_FLAGS_DOCKING_STATION; - } - - /* - * Presence of _EJD and/or _EJx indicates 'ejectable'. - * TBD: _EJx... - */ - if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, - "_EJD", &acpi_handle))) { - device->flags |= BM_FLAGS_EJECTABLE; - } - - /* - * Presence of _PR0 or _PS0 indicates 'power manageable'. - */ - if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, - "_PR0", &acpi_handle)) || - ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, - "_PS0", &acpi_handle))) { - device->flags |= BM_FLAGS_POWER_CONTROL; - } - - /* - * Presence of _CRS indicates 'configurable'. - */ - if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, - "_CRS", &acpi_handle))) { - device->flags |= BM_FLAGS_CONFIGURABLE; - } - - /* Fall through to next case statement. */ - - case BM_TYPE_PROCESSOR: - case BM_TYPE_THERMAL_ZONE: - case BM_TYPE_POWER_RESOURCE: - /* - * Presence of _HID or _ADR indicates 'identifiable'. - */ - if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, - "_HID", &acpi_handle)) || - ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, - "_ADR", &acpi_handle))) { - device->flags |= BM_FLAGS_IDENTIFIABLE; - } - - /* - * Presence of _STA indicates 'dynamic status'. - */ - if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, - "_STA", &acpi_handle))) { - device->flags |= BM_FLAGS_DYNAMIC_STATUS; - } - - break; - } - - return AE_OK; -} - - -/**************************************************************************** - * - * FUNCTION: bm_add_namespace_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_add_namespace_device ( - acpi_handle acpi_handle, - acpi_object_type acpi_type, - BM_NODE *parent, - BM_NODE **child) -{ - acpi_status status = AE_OK; - BM_NODE *node = NULL; - BM_DEVICE *device = NULL; - - FUNCTION_TRACE("bm_add_namespace_device"); - - if (!parent || !child) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - if (node_list.count > BM_HANDLES_MAX) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - (*child) = NULL; - - /* - * Create Node: - * ------------ - */ - node = acpi_os_callocate(sizeof(BM_NODE)); - if (!node) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - node->parent = parent; - node->next = NULL; - - device = &(node->device); - - device->handle = node_list.count; - device->acpi_handle = acpi_handle; - - /* - * Device Type: - * ------------ - */ - switch (acpi_type) { - case INTERNAL_TYPE_SCOPE: - device->id.type = BM_TYPE_SCOPE; - break; - case ACPI_TYPE_PROCESSOR: - device->id.type = BM_TYPE_PROCESSOR; - break; - case ACPI_TYPE_THERMAL: - device->id.type = BM_TYPE_THERMAL_ZONE; - break; - case ACPI_TYPE_POWER: - device->id.type = BM_TYPE_POWER_RESOURCE; - break; - case ACPI_TYPE_DEVICE: - device->id.type = BM_TYPE_DEVICE; - break; - } - - /* - * Get Other Device Info: - * ---------------------- - * But only if this device's parent is present (which implies - * this device MAY be present). - */ - if (BM_NODE_PRESENT(node->parent)) { - /* - * Device Flags - */ - status = bm_get_flags(device); - if (ACPI_FAILURE(status)) { - goto end; - } - - /* - * Device Identification - */ - status = bm_get_identification(device); - if (ACPI_FAILURE(status)) { - goto end; - } - - /* - * Device Status - */ - status = bm_get_status(device); - if (ACPI_FAILURE(status)) { - goto end; - } - - /* - * Power Management: - * ----------------- - * If this node doesn't provide direct power control - * then we inherit PM capabilities from its parent. - * - * TBD: Inherit! - */ - if (BM_IS_POWER_CONTROL(device)) { - status = bm_get_pm_capabilities(node); - if (ACPI_FAILURE(status)) { - goto end; - } - } - } - -end: - if (ACPI_FAILURE(status)) { - acpi_os_free(node); - } - else { - /* - * Add to the node_list. - */ - node_list.nodes[node_list.count++] = node; - - /* - * Formulate Hierarchy: - * -------------------- - * Arrange within the namespace by assigning the parent and - * adding to the parent device's list of children (scope). - */ - if (!parent->scope.head) { - parent->scope.head = node; - } - else { - if (!parent->scope.tail) { - (parent->scope.head)->next = node; - } - else { - (parent->scope.tail)->next = node; - } - } - parent->scope.tail = node; - - (*child) = node; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_enumerate_namespace - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_enumerate_namespace (void) -{ - acpi_status status = AE_OK; - acpi_handle parent_handle = ACPI_ROOT_OBJECT; - acpi_handle child_handle = NULL; - BM_NODE *parent = NULL; - BM_NODE *child = NULL; - acpi_object_type acpi_type = 0; - u32 level = 1; - - FUNCTION_TRACE("bm_enumerate_namespace"); - - parent = node_list.nodes[0]; - - /* - * Enumerate ACPI Namespace: - * ------------------------- - * Parse through the ACPI namespace, identify all 'devices', - * and create a new entry for each in our collection. - */ - while (level > 0) { - - /* - * Get the next object at this level. - */ - status = acpi_get_next_object(ACPI_TYPE_ANY, parent_handle, child_handle, &child_handle); - if (ACPI_SUCCESS(status)) { - /* - * TBD: This is a hack to get around the problem - * identifying scope objects. Scopes - * somehow need to be uniquely identified. - */ - status = acpi_get_type(child_handle, &acpi_type); - if (ACPI_SUCCESS(status) && (acpi_type == ACPI_TYPE_ANY)) { - status = acpi_get_next_object(ACPI_TYPE_ANY, child_handle, 0, NULL); - if (ACPI_SUCCESS(status)) { - acpi_type = INTERNAL_TYPE_SCOPE; - } - } - - /* - * Device? - * ------- - * If this object is a 'device', insert into the - * ACPI Bus Manager's local hierarchy and search - * the object's scope for any child devices (a - * depth-first search). - */ - switch (acpi_type) { - case INTERNAL_TYPE_SCOPE: - case ACPI_TYPE_DEVICE: - case ACPI_TYPE_PROCESSOR: - case ACPI_TYPE_THERMAL: - case ACPI_TYPE_POWER: - status = bm_add_namespace_device(child_handle, acpi_type, parent, &child); - if (ACPI_SUCCESS(status)) { - status = acpi_get_next_object(ACPI_TYPE_ANY, child_handle, 0, NULL); - if (ACPI_SUCCESS(status)) { - level++; - parent_handle = child_handle; - child_handle = 0; - parent = child; - } - } - break; - } - } - - /* - * Scope Exhausted: - * ---------------- - * No more children in this object's scope, Go back up - * in the namespace tree to the object's parent. - */ - else { - level--; - child_handle = parent_handle; - acpi_get_parent(parent_handle, - &parent_handle); - - if (parent) { - parent = parent->parent; - } - else { - return_ACPI_STATUS(AE_NULL_ENTRY); - } - } - } - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bm_add_fixed_feature_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_add_fixed_feature_device ( - BM_NODE *parent, - BM_DEVICE_TYPE device_type, - char *device_hid) -{ - acpi_status status = AE_OK; - BM_NODE *node = NULL; - - FUNCTION_TRACE("bm_add_fixed_feature_device"); - - if (!parent) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - if (node_list.count > BM_HANDLES_MAX) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - /* - * Allocate the new device and add to the device array. - */ - node = acpi_os_callocate(sizeof(BM_NODE)); - if (!node) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - /* - * Get device info. - */ - node->device.handle = node_list.count; - node->device.acpi_handle = ACPI_ROOT_OBJECT; - node->device.id.type = BM_TYPE_FIXED_BUTTON; - if (device_hid) { - MEMCPY((void*)node->device.id.hid, device_hid, - sizeof(node->device.id.hid)); - } - node->device.flags = BM_FLAGS_FIXED_FEATURE; - node->device.status = BM_STATUS_DEFAULT; - /* TBD: Device PM capabilities */ - - /* - * Add to the node_list. - */ - node_list.nodes[node_list.count++] = node; - - /* - * Formulate Hierarchy: - * -------------------- - * Arrange within the namespace by assigning the parent and - * adding to the parent device's list of children (scope). - */ - node->parent = parent; - node->next = NULL; - - if (parent) { - if (!parent->scope.head) { - parent->scope.head = node; - } - else { - if (!parent->scope.tail) { - (parent->scope.head)->next = node; - } - else { - (parent->scope.tail)->next = node; - } - } - parent->scope.tail = node; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_enumerate_fixed_features - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_enumerate_fixed_features (void) -{ - FUNCTION_TRACE("bm_enumerate_fixed_features"); - - /* - * Root Object: - * ------------ - * Fabricate the root object, which happens to always get a - * device_handle of zero. - */ - node_list.nodes[0] = acpi_os_callocate(sizeof(BM_NODE)); - if (NULL == (node_list.nodes[0])) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - node_list.nodes[0]->device.handle = BM_HANDLE_ROOT; - node_list.nodes[0]->device.acpi_handle = ACPI_ROOT_OBJECT; - node_list.nodes[0]->device.flags = BM_FLAGS_UNKNOWN; - node_list.nodes[0]->device.status = BM_STATUS_DEFAULT; - node_list.nodes[0]->device.id.type = BM_TYPE_SYSTEM; - /* TBD: Get system PM capabilities (Sx states?) */ - - node_list.count++; - - /* - * Fixed Features: - * --------------- - * Enumerate fixed-feature devices (e.g. power and sleep buttons). - */ - if (acpi_fadt.pwr_button == 0) { - bm_add_fixed_feature_device(node_list.nodes[0], - BM_TYPE_FIXED_BUTTON, BM_HID_POWER_BUTTON); - } - - if (acpi_fadt.sleep_button == 0) { - bm_add_fixed_feature_device(node_list.nodes[0], - BM_TYPE_FIXED_BUTTON, BM_HID_SLEEP_BUTTON); - } - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bm_get_handle - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_get_handle ( - acpi_handle acpi_handle, - BM_HANDLE *device_handle) -{ - acpi_status status = AE_NOT_FOUND; - u32 i = 0; - - FUNCTION_TRACE("bm_get_handle"); - - if (!device_handle) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - *device_handle = BM_HANDLE_UNKNOWN; - - /* - * Search all devices for a match on the ACPI handle. - */ - for (i=0; idevice.acpi_handle == acpi_handle) { - *device_handle = node_list.nodes[i]->device.handle; - status = AE_OK; - break; - } - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_get_node - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_get_node ( - BM_HANDLE device_handle, - acpi_handle acpi_handle, - BM_NODE **node) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("bm_get_node"); - - if (!node) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* busmgr failed to init, but we're being called by subordinate drivers */ - if (node_list.count < 1) { - return_ACPI_STATUS(AE_NOT_FOUND); - } - - /* - * If no device handle, resolve acpi handle to device handle. - */ - if (!device_handle && acpi_handle) { - status = bm_get_handle(acpi_handle, &device_handle); - if (ACPI_FAILURE(status)) - return_ACPI_STATUS(status); - } - - /* - * Valid device handle? - */ - if (device_handle > BM_HANDLES_MAX) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid node handle [%02x] detected.\n", device_handle)); - return_ACPI_STATUS(AE_ERROR); - } - - *node = node_list.nodes[device_handle]; - - /* - * Valid node? - */ - if (!(*node)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) node entry [%02x] detected.\n", device_handle)); - return_ACPI_STATUS(AE_NULL_ENTRY); - } - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: bm_initialize - * - * PARAMETERS: - * - * RETURN: Exception code. - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_initialize (void) -{ - acpi_status status = AE_OK; - u32 start = 0; - u32 stop = 0; - u32 elapsed = 0; - - FUNCTION_TRACE("bm_initialize"); - - MEMSET(&node_list, 0, sizeof(BM_NODE_LIST)); - - status = acpi_get_timer(&start); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Building device hierarchy.\n")); - - /* - * Enumerate ACPI fixed-feature devices. - */ - status = bm_enumerate_fixed_features(); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Enumerate the ACPI namespace. - */ - status = bm_enumerate_namespace(); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - acpi_get_timer(&stop); - acpi_get_timer_duration(start, stop, &elapsed); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Building device hierarchy took [%d] microseconds.\n", elapsed)); - - /* - * Display hierarchy. - */ - bm_print_hierarchy(); - - /* - * Register for all standard and device-specific notifications. - */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Registering for all device notifications.\n")); - - status = acpi_install_notify_handler(ACPI_ROOT_OBJECT, - ACPI_SYSTEM_NOTIFY, &bm_notify, NULL); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to register for standard notifications.\n")); - return_ACPI_STATUS(status); - } - - status = acpi_install_notify_handler(ACPI_ROOT_OBJECT, - ACPI_DEVICE_NOTIFY, &bm_notify, NULL); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to register for device-specific notifications.\n")); - return_ACPI_STATUS(status); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Bus Manager enabled.\n")); - - /* - * Initialize built-in power resource driver. - */ - bm_pr_initialize(); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_terminate - * - * PARAMETERS: - * - * RETURN: Exception code. - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_terminate (void) -{ - acpi_status status = AE_OK; - u32 i = 0; - - FUNCTION_TRACE("bm_terminate"); - - /* - * Terminate built-in power resource driver. - */ - bm_pr_terminate(); - - /* - * Unregister for all notifications. - */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unregistering for device notifications.\n")); - - status = acpi_remove_notify_handler(ACPI_ROOT_OBJECT, - ACPI_SYSTEM_NOTIFY, &bm_notify); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to un-register for standard notifications.\n")); - } - - status = acpi_remove_notify_handler(ACPI_ROOT_OBJECT, - ACPI_DEVICE_NOTIFY, &bm_notify); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to un-register for device-specific notifications.\n")); - } - - /* - * Parse through the device array, freeing all entries. - */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing device hierarchy.\n")); - for (i = 0; i < node_list.count; i++) { - if (node_list.nodes[i]) { - acpi_os_free(node_list.nodes[i]); - } - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Bus Manager disabled.\n")); - - return_ACPI_STATUS(AE_OK); -} diff -urN linux-2.4.18/drivers/acpi/ospm/busmgr/bm_osl.c lia64-2.4/drivers/acpi/ospm/busmgr/bm_osl.c --- linux-2.4.18/drivers/acpi/ospm/busmgr/bm_osl.c Wed Dec 26 16:58:37 2001 +++ lia64-2.4/drivers/acpi/ospm/busmgr/bm_osl.c Wed Dec 31 16:00:00 1969 @@ -1,390 +0,0 @@ -/***************************************************************************** - * - * Module Name: bm_osl.c - * $Revision: 17 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "bm.h" - - -MODULE_AUTHOR("Andrew Grover"); -MODULE_DESCRIPTION("ACPI Component Architecture (CA) - ACPI Bus Manager"); -MODULE_LICENSE("GPL"); - - -/***************************************************************************** - * Types & Defines - *****************************************************************************/ - -typedef struct -{ - BM_HANDLE device_handle; - char *device_type; - char *device_instance; - u32 event_type; - u32 event_data; - struct list_head list; -} BM_OSL_EVENT; - - -#define BM_PROC_ROOT "acpi" -#define BM_PROC_EVENT "event" -#define BM_PROC_DEVICES "devices" - -#define BM_MAX_STRING_LENGTH 80 - - -/**************************************************************************** - * Globals - ****************************************************************************/ - -struct proc_dir_entry *bm_proc_root = NULL; -static struct proc_dir_entry *bm_proc_event = NULL; - -#ifdef ACPI_DEBUG -static u32 save_dbg_layer; -static u32 save_dbg_level; -#endif /*ACPI_DEBUG*/ - -extern BM_NODE_LIST node_list; - -static spinlock_t bm_osl_event_lock = SPIN_LOCK_UNLOCKED; - -static LIST_HEAD(bm_event_list); - -static DECLARE_WAIT_QUEUE_HEAD(bm_event_wait_queue); - -static int event_is_open = 0; - - -/**************************************************************************** - * Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: bm_osl_generate_event - * - * DESCRIPTION: Generates an event for user-space consumption by writing - * the event data to the 'event' file. - * - ****************************************************************************/ - -acpi_status -bm_osl_generate_event ( - BM_HANDLE device_handle, - char *device_type, - char *device_instance, - u32 event_type, - u32 event_data) -{ - BM_OSL_EVENT *event = NULL; - u32 flags = 0; - - /* drop event on the floor if no one's listening */ - if (!event_is_open) - return (AE_OK); - - /* - * Allocate a new event structure. - */ - event = acpi_os_callocate(sizeof(BM_OSL_EVENT)); - if (!event) - goto alloc_error; - - event->device_type = acpi_os_callocate(strlen(device_type) - + sizeof(char)); - if (!event->device_type) - goto alloc_error; - - event->device_instance = acpi_os_callocate(strlen(device_instance) - + sizeof(char)); - if (!event->device_instance) - goto alloc_error; - - /* - * Set event data. - */ - event->device_handle = device_handle; - strcpy(event->device_type, device_type); - strcpy(event->device_instance, device_instance); - event->event_type = event_type; - event->event_data = event_data; - - /* - * Add to the end of our event list. - */ - spin_lock_irqsave(&bm_osl_event_lock, flags); - list_add_tail(&event->list, &bm_event_list); - spin_unlock_irqrestore(&bm_osl_event_lock, flags); - - /* - * Signal waiting threads (if any). - */ - wake_up_interruptible(&bm_event_wait_queue); - - return(AE_OK); - -alloc_error: - if (event->device_instance) - acpi_os_free(event->device_instance); - - if (event->device_type) - acpi_os_free(event->device_type); - - if (event) - acpi_os_free(event); - - return (AE_NO_MEMORY); -} - -static int bm_osl_open_event(struct inode *inode, struct file *file) -{ - spin_lock_irq (&bm_osl_event_lock); - - if(event_is_open) - goto out_busy; - - event_is_open = 1; - - spin_unlock_irq (&bm_osl_event_lock); - return 0; - -out_busy: - spin_unlock_irq (&bm_osl_event_lock); - return -EBUSY; -} - - -static int bm_osl_close_event(struct inode *inode, struct file *file) -{ - event_is_open = 0; - return 0; -} - -/**************************************************************************** - * - * FUNCTION: bm_osl_read_event - * - * DESCRIPTION: Handles reads to the 'event' file by blocking user-mode - * threads until data (an event) is generated. - * - ****************************************************************************/ -static ssize_t -bm_osl_read_event( - struct file *file, - char *buf, - size_t count, - loff_t *ppos) -{ - BM_OSL_EVENT *event = NULL; - unsigned long flags = 0; - static char str[BM_MAX_STRING_LENGTH]; - static int chars_remaining = 0; - static char *ptr; - - if (!chars_remaining) { - DECLARE_WAITQUEUE(wait, current); - - if (list_empty(&bm_event_list)) { - - if (file->f_flags & O_NONBLOCK) - return -EAGAIN; - - set_current_state(TASK_INTERRUPTIBLE); - add_wait_queue(&bm_event_wait_queue, &wait); - - if (list_empty(&bm_event_list)) { - schedule(); - } - - remove_wait_queue(&bm_event_wait_queue, &wait); - set_current_state(TASK_RUNNING); - - if (signal_pending(current)) { - return -ERESTARTSYS; - } - } - - spin_lock_irqsave(&bm_osl_event_lock, flags); - event = list_entry(bm_event_list.next, BM_OSL_EVENT, list); - list_del(&event->list); - spin_unlock_irqrestore(&bm_osl_event_lock, flags); - - chars_remaining = sprintf(str, "%s %s %08x %08x\n", - event->device_type, event->device_instance, - event->event_type, event->event_data); - ptr = str; - - acpi_os_free(event->device_type); - acpi_os_free(event->device_instance); - acpi_os_free(event); - } - - if (chars_remaining < count) - count = chars_remaining; - - if (copy_to_user(buf, ptr, count)) - return -EFAULT; - - *ppos += count; - chars_remaining -= count; - ptr += count; - - return count; -} - -/**************************************************************************** - * - * FUNCTION: bm_osl_poll_event - * - * DESCRIPTION: Handles poll() of the 'event' file by blocking user-mode - * threads until data (an event) is generated. - * - ****************************************************************************/ -static unsigned int -bm_osl_poll_event( - struct file *file, - poll_table *wait) -{ - poll_wait(file, &bm_event_wait_queue, wait); - if (!list_empty(&bm_event_list)) - return POLLIN | POLLRDNORM; - return 0; -} - -struct file_operations proc_event_operations = { - open: bm_osl_open_event, - read: bm_osl_read_event, - release: bm_osl_close_event, - poll: bm_osl_poll_event, -}; - -/**************************************************************************** - * - * FUNCTION: bm_osl_init - * - ****************************************************************************/ - -int -bm_osl_init(void) -{ - acpi_status status = AE_OK; - - status = acpi_subsystem_status(); - if (ACPI_FAILURE(status)) - return -ENODEV; - - bm_proc_root = proc_mkdir(BM_PROC_ROOT, NULL); - if (!bm_proc_root) { - return(AE_ERROR); - } - - bm_proc_event = create_proc_entry(BM_PROC_EVENT, S_IRUSR, bm_proc_root); - if (bm_proc_event) { - bm_proc_event->proc_fops = &proc_event_operations; - } - - status = bm_initialize(); - - return (ACPI_SUCCESS(status)) ? 0 : -ENODEV; -} - - -/**************************************************************************** - * - * FUNCTION: bm_osl_cleanup - * - ****************************************************************************/ - -void -bm_osl_cleanup(void) -{ - bm_terminate(); - - if (bm_proc_event) { - remove_proc_entry(BM_PROC_EVENT, bm_proc_root); - bm_proc_event = NULL; - } - - if (bm_proc_root) { - remove_proc_entry(BM_PROC_ROOT, NULL); - bm_proc_root = NULL; - } - - return; -} - - -module_init(bm_osl_init); -module_exit(bm_osl_cleanup); - - -/**************************************************************************** - * Symbols - ****************************************************************************/ - -/* bm.c */ - -EXPORT_SYMBOL(bm_get_node); - -/* bmdriver.c */ - -EXPORT_SYMBOL(bm_get_device_power_state); -EXPORT_SYMBOL(bm_set_device_power_state); -EXPORT_SYMBOL(bm_get_device_info); -EXPORT_SYMBOL(bm_get_device_status); -EXPORT_SYMBOL(bm_get_device_context); -EXPORT_SYMBOL(bm_register_driver); -EXPORT_SYMBOL(bm_unregister_driver); - -/* bmsearch.c */ - -EXPORT_SYMBOL(bm_search); - -/* bmrequest.c */ - -EXPORT_SYMBOL(bm_request); - -/* bmutils.c */ - -EXPORT_SYMBOL(bm_extract_package_data); -EXPORT_SYMBOL(bm_evaluate_object); -EXPORT_SYMBOL(bm_evaluate_simple_integer); -EXPORT_SYMBOL(bm_evaluate_reference_list); -EXPORT_SYMBOL(bm_copy_to_buffer); -EXPORT_SYMBOL(bm_cast_buffer); - -/* bm_proc.c */ - -EXPORT_SYMBOL(bm_osl_generate_event); -EXPORT_SYMBOL(bm_proc_root); diff -urN linux-2.4.18/drivers/acpi/ospm/busmgr/bmdriver.c lia64-2.4/drivers/acpi/ospm/busmgr/bmdriver.c --- linux-2.4.18/drivers/acpi/ospm/busmgr/bmdriver.c Mon Sep 24 15:06:43 2001 +++ lia64-2.4/drivers/acpi/ospm/busmgr/bmdriver.c Wed Dec 31 16:00:00 1969 @@ -1,469 +0,0 @@ -/***************************************************************************** - * - * Module Name: bmdriver.c - * $Revision: 21 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include "bm.h" - -#define _COMPONENT ACPI_BUS - MODULE_NAME ("bmdriver") - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: bm_get_device_power_state - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_get_device_power_state ( - BM_HANDLE device_handle, - BM_POWER_STATE *state) -{ - acpi_status status = AE_OK; - BM_NODE *node = NULL; - - FUNCTION_TRACE("bm_get_device_power_state"); - - if (!state) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - *state = ACPI_STATE_UNKNOWN; - - /* - * Resolve device handle to node. - */ - status = bm_get_node(device_handle, 0, &node); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Get the current power state. - */ - status = bm_get_power_state(node); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - *state = node->device.power.state; - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_set_device_power_state - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_set_device_power_state ( - BM_HANDLE device_handle, - BM_POWER_STATE state) -{ - acpi_status status = AE_OK; - BM_NODE *node = NULL; - - FUNCTION_TRACE("bm_set_device_power_state"); - - /* - * Resolve device handle to node. - */ - status = bm_get_node(device_handle, 0, &node); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Set the current power state. - */ - status = bm_set_power_state(node, state); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_get_device_status - * - * PARAMETERS: - * device_handle is really an index number into the array of BM_DEVICE - * structures in info_list. This data item is passed to - * the registered program's "notify" callback. It is used - * to retrieve the specific BM_DEVICE structure instance - * associated with the callback. - * device_status is a pointer that receives the result of processing - * the device's associated ACPI _STA. - * - * RETURN: - * The acpi_status value indicates success AE_OK or failure of the function - * - * DESCRIPTION: Evaluates the device's ACPI _STA, if it is present. - * - ****************************************************************************/ - -acpi_status -bm_get_device_status ( - BM_HANDLE device_handle, - BM_DEVICE_STATUS *device_status) -{ - acpi_status status = AE_OK; - BM_NODE *node = NULL; - - FUNCTION_TRACE("bm_get_device_status"); - - if (!device_status) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - *device_status = BM_STATUS_UNKNOWN; - - /* - * Resolve device handle to node. - */ - status = bm_get_node(device_handle, 0, &node); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Parent Present? - * --------------- - * If the parent isn't present we can't evalute _STA on the child. - * Return an unknown status. - */ - if (!BM_NODE_PRESENT(node->parent)) { - return_ACPI_STATUS(AE_OK); - } - - /* - * Dynamic Status? - * --------------- - * If _STA isn't present we just return the default status. - */ - if (!(node->device.flags & BM_FLAGS_DYNAMIC_STATUS)) { - *device_status = BM_STATUS_DEFAULT; - return_ACPI_STATUS(AE_OK); - } - - /* - * Evaluate _STA: - * -------------- - */ - status = bm_evaluate_simple_integer(node->device.acpi_handle, "_STA", - &(node->device.status)); - if (ACPI_SUCCESS(status)) { - *device_status = node->device.status; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_get_device_info - * - * PARAMETERS: - * device_handle An index used to retrieve the associated BM_DEVICE info. - * device A pointer to a BM_DEVICE structure instance pointer. - * This pointed to BM_DEVICE structure will contain the - * this device's information. - * - * RETURN: - * The acpi_status value indicates success AE_OK or failure of the function - * - * DESCRIPTION: - * Using the device_handle this function retrieves this device's - * BM_DEVICE structure instance and save's it in device. - * - ****************************************************************************/ - -acpi_status -bm_get_device_info ( - BM_HANDLE device_handle, - BM_DEVICE **device) -{ - acpi_status status = AE_OK; - BM_NODE *node = NULL; - - FUNCTION_TRACE("bm_get_device_info"); - - if (!device) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Resolve device handle to internal device. - */ - status = bm_get_node(device_handle, 0, &node); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - *device = &(node->device); - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bm_get_device_context - * - * device_handle An index used to retrieve the associated BM_DEVICE info. - * context A pointer to a BM_DRIVER_CONTEXT structure instance. - * - * RETURN: - * The acpi_status value indicates success AE_OK or failure of the function - * - * DESCRIPTION: - * Using the device_handle this function retrieves this device's - * BM_DRIVER_CONTEXT structure instance and save's it in context. - * - ****************************************************************************/ - -acpi_status -bm_get_device_context ( - BM_HANDLE device_handle, - BM_DRIVER_CONTEXT *context) -{ - acpi_status status = AE_OK; - BM_NODE *node = NULL; - - FUNCTION_TRACE("bm_get_device_context"); - - if (!context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - *context = NULL; - - /* - * Resolve device handle to internal device. - */ - status = bm_get_node(device_handle, 0, &node); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - if (!node->driver.context) { - return_ACPI_STATUS(AE_NULL_ENTRY); - } - - *context = node->driver.context; - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bm_register_driver - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_register_driver ( - BM_DEVICE_ID *criteria, - BM_DRIVER *driver) -{ - acpi_status status = AE_NOT_FOUND; - BM_HANDLE_LIST device_list; - BM_NODE *node = NULL; - BM_DEVICE *device = NULL; - u32 i = 0; - - FUNCTION_TRACE("bm_register_driver"); - - if (!criteria || !driver || !driver->notify || !driver->request) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - MEMSET(&device_list, 0, sizeof(BM_HANDLE_LIST)); - - /* - * Find Matches: - * ------------- - * Search through the entire device hierarchy for matches against - * the given device criteria. - */ - status = bm_search(BM_HANDLE_ROOT, criteria, &device_list); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Install driver: - * ---------------- - * For each match, record the driver information and execute the - * driver's Notify() funciton (if present) to notify the driver - * of the device's presence. - */ - for (i = 0; i < device_list.count; i++) { - - /* Resolve the device handle. */ - status = bm_get_node(device_list.handles[i], 0, &node); - if (ACPI_FAILURE(status)) { - continue; - } - - device = &(node->device); - - /* - * Make sure another driver hasn't already registered for - * this device. - */ - if (BM_IS_DRIVER_CONTROL(device)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Another driver has already registered for device [%02x].\n", device->handle)); - continue; - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Registering driver for device [%02x].\n", device->handle)); - - /* Notify driver of new device. */ - status = driver->notify(BM_NOTIFY_DEVICE_ADDED, - node->device.handle, &(node->driver.context)); - if (ACPI_SUCCESS(status)) { - node->driver.notify = driver->notify; - node->driver.request = driver->request; - node->device.flags |= BM_FLAGS_DRIVER_CONTROL; - } - } - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bm_unregister_driver - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_unregister_driver ( - BM_DEVICE_ID *criteria, - BM_DRIVER *driver) -{ - acpi_status status = AE_NOT_FOUND; - BM_HANDLE_LIST device_list; - BM_NODE *node = NULL; - BM_DEVICE *device = NULL; - u32 i = 0; - - FUNCTION_TRACE("bm_unregister_driver"); - - if (!criteria || !driver || !driver->notify || !driver->request) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - MEMSET(&device_list, 0, sizeof(BM_HANDLE_LIST)); - - /* - * Find Matches: - * ------------- - * Search through the entire device hierarchy for matches against - * the given device criteria. - */ - status = bm_search(BM_HANDLE_ROOT, criteria, &device_list); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Remove driver: - * --------------- - * For each match, execute the driver's Notify() function to allow - * the driver to cleanup each device instance. - */ - for (i = 0; i < device_list.count; i++) { - - /* Resolve the device handle. */ - status = bm_get_node(device_list.handles[i], 0, &node); - if (ACPI_FAILURE(status)) { - continue; - } - - device = &(node->device); - - /* - * Make sure driver has really registered for this device. - */ - if (!BM_IS_DRIVER_CONTROL(device)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Driver hasn't registered for device [%02x].\n", device->handle)); - continue; - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unregistering driver for device [%02x].\n", device->handle)); - - /* Notify driver of device removal. */ - status = node->driver.notify(BM_NOTIFY_DEVICE_REMOVED, - node->device.handle, &(node->driver.context)); - if (ACPI_SUCCESS(status)) { - node->driver.notify = NULL; - node->driver.request = NULL; - node->driver.context = NULL; - node->device.flags &= ~BM_FLAGS_DRIVER_CONTROL; - } - } - - return_ACPI_STATUS(AE_OK); -} diff -urN linux-2.4.18/drivers/acpi/ospm/busmgr/bmnotify.c lia64-2.4/drivers/acpi/ospm/busmgr/bmnotify.c --- linux-2.4.18/drivers/acpi/ospm/busmgr/bmnotify.c Mon Sep 24 15:06:43 2001 +++ lia64-2.4/drivers/acpi/ospm/busmgr/bmnotify.c Wed Dec 31 16:00:00 1969 @@ -1,312 +0,0 @@ -/***************************************************************************** - * - * Module Name: bmnotify.c - * $Revision: 21 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include "bm.h" - - -#define _COMPONENT ACPI_BUS - MODULE_NAME ("bmnotify") - - -/**************************************************************************** - * Internal Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: bm_generate_notify - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_generate_notify ( - BM_NODE *node, - u32 notify_type) -{ - acpi_status status = AE_OK; - BM_DEVICE *device = NULL; - - FUNCTION_TRACE("bm_generate_notify"); - - if (!node) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - device = &(node->device); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Sending notify [%02x] to device [%02x].\n", notify_type, node->device.handle)); - - if (!BM_IS_DRIVER_CONTROL(device)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "No driver installed for device [%02x].\n", device->handle)); - return_ACPI_STATUS(AE_NOT_EXIST); - } - - status = node->driver.notify(notify_type, node->device.handle, - &(node->driver.context)); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_device_check - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_device_check ( - BM_NODE *node, - u32 *status_change) -{ - acpi_status status = AE_OK; - BM_DEVICE *device = NULL; - BM_DEVICE_STATUS old_status = BM_STATUS_UNKNOWN; - - FUNCTION_TRACE("bm_device_check"); - - if (!node) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - device = &(node->device); - - if (status_change) { - *status_change = FALSE; - } - - old_status = device->status; - - /* - * Parent Present? - * --------------- - * Only check this device if its parent is present (which implies - * this device MAY be present). - */ - if (!BM_NODE_PRESENT(node->parent)) { - return_ACPI_STATUS(AE_OK); - } - - /* - * Get Status: - * ----------- - * And see if the status has changed. - */ - status = bm_get_status(device); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - if (old_status == node->device.status) { - return_ACPI_STATUS(AE_OK); - } - - if (status_change) { - *status_change = TRUE; - } - - /* - * Device Insertion? - * ----------------- - */ - if ((device->status & BM_STATUS_PRESENT) && - !(old_status & BM_STATUS_PRESENT)) { - /* TBD: Make sure driver is loaded, and if not, load. */ - status = bm_generate_notify(node, BM_NOTIFY_DEVICE_ADDED); - } - - /* - * Device Removal? - * --------------- - */ - else if (!(device->status & BM_STATUS_PRESENT) && - (old_status & BM_STATUS_PRESENT)) { - /* TBD: Unload driver if last device instance. */ - status = bm_generate_notify(node, BM_NOTIFY_DEVICE_REMOVED); - } - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bm_bus_check - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_bus_check ( - BM_NODE *parent_node) -{ - acpi_status status = AE_OK; - u32 status_change = FALSE; - - FUNCTION_TRACE("bm_bus_check"); - - if (!parent_node) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Status Change? - * -------------- - */ - status = bm_device_check(parent_node, &status_change); - if (ACPI_FAILURE(status) || !status_change) { - return_ACPI_STATUS(status); - } - - /* - * Enumerate Scope: - * ---------------- - * TBD: Enumerate child devices within this device's scope and - * run bm_device_check()'s on them... - */ - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: bm_notify - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -void -bm_notify ( - acpi_handle acpi_handle, - u32 notify_value, - void *context) -{ - acpi_status status = AE_OK; - BM_NODE *node = NULL; - - FUNCTION_TRACE("bm_notify"); - - /* - * Resolve the ACPI handle. - */ - status = bm_get_node(0, acpi_handle, &node); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Recieved notify [%02x] for unknown device [%p].\n", notify_value, acpi_handle)); - return_VOID; - } - - /* - * Device-Specific or Standard? - * ---------------------------- - * Device-specific notifies are forwarded to the control module's - * notify() function for processing. Standard notifies are handled - * internally. - */ - if (notify_value > 0x7F) { - status = bm_generate_notify(node, notify_value); - } - else { - switch (notify_value) { - - case BM_NOTIFY_BUS_CHECK: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Received BUS CHECK notification for device [%02x].\n", node->device.handle)); - status = bm_bus_check(node); - break; - - case BM_NOTIFY_DEVICE_CHECK: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Received DEVICE CHECK notification for device [%02x].\n", node->device.handle)); - status = bm_device_check(node, NULL); - break; - - case BM_NOTIFY_DEVICE_WAKE: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Received DEVICE WAKE notification for device [%02x].\n", node->device.handle)); - /* TBD */ - break; - - case BM_NOTIFY_EJECT_REQUEST: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Received EJECT REQUEST notification for device [%02x].\n", node->device.handle)); - /* TBD */ - break; - - case BM_NOTIFY_DEVICE_CHECK_LIGHT: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Received DEVICE CHECK LIGHT notification for device [%02x].\n", node->device.handle)); - /* TBD: Exactly what does the 'light' mean? */ - status = bm_device_check(node, NULL); - break; - - case BM_NOTIFY_FREQUENCY_MISMATCH: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Received FREQUENCY MISMATCH notification for device [%02x].\n", node->device.handle)); - /* TBD */ - break; - - case BM_NOTIFY_BUS_MODE_MISMATCH: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Received BUS MODE MISMATCH notification for device [%02x].\n", node->device.handle)); - /* TBD */ - break; - - case BM_NOTIFY_POWER_FAULT: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Received POWER FAULT notification.\n")); - /* TBD */ - break; - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Received unknown/unsupported notification.\n")); - break; - } - } - - return_VOID; -} - - diff -urN linux-2.4.18/drivers/acpi/ospm/busmgr/bmpm.c lia64-2.4/drivers/acpi/ospm/busmgr/bmpm.c --- linux-2.4.18/drivers/acpi/ospm/busmgr/bmpm.c Mon Sep 24 15:06:43 2001 +++ lia64-2.4/drivers/acpi/ospm/busmgr/bmpm.c Wed Dec 31 16:00:00 1969 @@ -1,442 +0,0 @@ -/***************************************************************************** - * - * Module Name: bmpm.c - * $Revision: 14 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include "bm.h" -#include "bmpower.h" - - -#define _COMPONENT ACPI_BUS - MODULE_NAME ("bmpm") - - -/**************************************************************************** - * Internal Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: bm_get_inferred_power_state - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_get_inferred_power_state ( - BM_DEVICE *device) -{ - acpi_status status = AE_OK; - BM_HANDLE_LIST pr_list; - BM_POWER_STATE list_state = ACPI_STATE_UNKNOWN; - char object_name[5] = {'_','P','R','0','\0'}; - u32 i = 0; - - FUNCTION_TRACE("bm_get_inferred_power_state"); - - if (!device) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - MEMSET(&pr_list, 0, sizeof(BM_HANDLE_LIST)); - - device->power.state = ACPI_STATE_D3; - - /* - * Calculate Power State: - * ---------------------- - * Try to infer the devices's power state by checking the state of - * the devices's power resources. We start by evaluating _PR0 - * (resource requirements at D0) and work through _PR1 and _PR2. - * We know the current devices power state when all resources (for - * a give Dx state) are ON. If no power resources are on then the - * device is assumed to be off (D3). - */ - for (i=ACPI_STATE_D0; iacpi_handle, - object_name, &pr_list); - - if (ACPI_SUCCESS(status)) { - - status = bm_pr_list_get_state(&pr_list, &list_state); - - if (ACPI_SUCCESS(status)) { - - if (list_state == ACPI_STATE_D0) { - device->power.state = i; - break; - } - } - } - } - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: bm_get_power_state - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_get_power_state ( - BM_NODE *node) -{ - acpi_status status = AE_OK; - BM_DEVICE *device = NULL; - - FUNCTION_TRACE("bm_get_power_state"); - - if (!node || !node->parent) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - device = &(node->device); - - device->power.state = ACPI_STATE_UNKNOWN; - - /* - * Power Control? - * -------------- - * If this device isn't directly power manageable (e.g. doesn't - * include _PR0/_PS0) then there's nothing to do (state is static). - */ - if (!BM_IS_POWER_CONTROL(device)) { - return_ACPI_STATUS(AE_OK); - } - - /* - * Parent Present? - * --------------- - * Make sure the parent is present before mucking with the child. - */ - if (!BM_NODE_PRESENT(node->parent)) { - return_ACPI_STATUS(AE_NOT_EXIST); - } - - /* - * Get Power State: - * ---------------- - * Either directly (via _PSC) or inferred (via power resource - * dependencies). - */ - if (BM_IS_POWER_STATE(device)) { - status = bm_evaluate_simple_integer(device->acpi_handle, - "_PSC", &(device->power.state)); - } - else { - status = bm_get_inferred_power_state(device); - } - - if (ACPI_SUCCESS(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Device [%02x] is at power state [D%d].\n", device->handle, device->power.state)); - } - else { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Error getting power state for device [%02x]\n", device->handle)); - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_set_power_state - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_set_power_state ( - BM_NODE *node, - BM_POWER_STATE state) -{ - acpi_status status = AE_OK; - BM_DEVICE *device = NULL; - BM_DEVICE *parent_device = NULL; - BM_HANDLE_LIST current_list; - BM_HANDLE_LIST target_list; - char object_name[5] = {'_','P','R','0','\0'}; - - FUNCTION_TRACE("bm_set_power_state"); - - if (!node || !node->parent || (state > ACPI_STATE_D3)) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - MEMSET(¤t_list, 0, sizeof(BM_HANDLE_LIST)); - MEMSET(&target_list, 0, sizeof(BM_HANDLE_LIST)); - - device = &(node->device); - parent_device = &(node->parent->device); - - /* - * Power Control? - * -------------- - * If this device isn't directly power manageable (e.g. doesn't - * include _PR0/_PS0) then return an error (can't set state). - */ - if (!BM_IS_POWER_CONTROL(device)) { - return_ACPI_STATUS(AE_ERROR); - } - - /* - * Parent Present? - * --------------- - * Make sure the parent is present before mucking with the child. - */ - if (!BM_NODE_PRESENT(node->parent)) { - return_ACPI_STATUS(AE_NOT_EXIST); - } - - /* - * Check Parent's Power State: - * --------------------------- - * Can't be in a higher power state (lower Dx value) than parent. - */ - if (state < parent_device->power.state) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Cannot set device [%02x] to a higher-powered state than parent_device.\n", device->handle)); - return_ACPI_STATUS(AE_ERROR); - } - - /* - * Get Resources: - * -------------- - * Get the power resources associated with the device's current - * and target power states. - */ - if (device->power.state != ACPI_STATE_UNKNOWN) { - object_name[3] = '0' + device->power.state; - bm_evaluate_reference_list(device->acpi_handle, - object_name, ¤t_list); - } - - object_name[3] = '0' + state; - bm_evaluate_reference_list(device->acpi_handle, object_name, - &target_list); - - /* - * Transition Resources: - * --------------------- - * Transition all power resources referenced by this device to - * the correct power state (taking into consideration sequencing - * and dependencies to other devices). - */ - if (current_list.count || target_list.count) { - status = bm_pr_list_transition(¤t_list, &target_list); - } - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Execute _PSx: - * ------------- - * Execute the _PSx method corresponding to the target Dx state, - * if it exists. - */ - object_name[2] = 'S'; - object_name[3] = '0' + state; - bm_evaluate_object(device->acpi_handle, object_name, NULL, NULL); - - if (ACPI_SUCCESS(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Device [%02x] is now at [D%d].\n", device->handle, state)); - device->power.state = state; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_get_pm_capabilities - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_get_pm_capabilities ( - BM_NODE *node) -{ - acpi_status status = AE_OK; - BM_DEVICE *device = NULL; - BM_DEVICE *parent_device = NULL; - acpi_handle acpi_handle = NULL; - BM_POWER_STATE dx_supported = ACPI_STATE_UNKNOWN; - char object_name[5] = {'_','S','0','D','\0'}; - u32 i = 0; - - FUNCTION_TRACE("bm_get_pm_capabilities"); - - if (!node || !node->parent) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - device = &(node->device); - parent_device = &(node->parent->device); - - /* - * Power Management Flags: - * ----------------------- - */ - if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PSC", - &acpi_handle))) { - device->power.flags |= BM_FLAGS_POWER_STATE; - } - - if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_IRC", - &acpi_handle))) { - device->power.flags |= BM_FLAGS_INRUSH_CURRENT; - } - - if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PRW", - &acpi_handle))) { - device->power.flags |= BM_FLAGS_WAKE_CAPABLE; - } - - /* - * Device Power State: - * ------------------- - * Note that we can't get the device's power state until we've - * initialized all power resources, so for now we just set to - * unknown. - */ - device->power.state = ACPI_STATE_UNKNOWN; - - /* - * Dx Supported in S0: - * ------------------- - * Figure out which Dx states are supported by this device for the - * S0 (working) state. Note that D0 and D3 are required (assumed). - */ - device->power.dx_supported[ACPI_STATE_S0] = BM_FLAGS_D0_SUPPORT | - BM_FLAGS_D3_SUPPORT; - - if ((ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PR1", - &acpi_handle))) || - (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PS1", - &acpi_handle)))) { - device->power.dx_supported[ACPI_STATE_S0] |= - BM_FLAGS_D1_SUPPORT; - } - - if ((ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PR2", - &acpi_handle))) || - (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PS2", - &acpi_handle)))) { - device->power.dx_supported[ACPI_STATE_S0] |= - BM_FLAGS_D2_SUPPORT; - } - - /* - * Dx Supported in S1-S5: - * ---------------------- - * Figure out which Dx states are supported by this device for - * all other Sx states. - */ - for (i = ACPI_STATE_S1; i <= ACPI_STATE_S5; i++) { - - /* - * D3 support is assumed (off is always possible!). - */ - device->power.dx_supported[i] = BM_FLAGS_D3_SUPPORT; - - /* - * Evalute _Sx_d: - * ------------- - * Which returns the highest (power) Dx state supported in - * this system (Sx) state. We convert this value to a bit - * mask of supported states (conceptually simpler). - */ - status = bm_evaluate_simple_integer(device->acpi_handle, - object_name, &dx_supported); - if (ACPI_SUCCESS(status)) { - switch (dx_supported) { - case 0: - device->power.dx_supported[i] |= - BM_FLAGS_D0_SUPPORT; - /* fall through */ - case 1: - device->power.dx_supported[i] |= - BM_FLAGS_D1_SUPPORT; - /* fall through */ - case 2: - device->power.dx_supported[i] |= - BM_FLAGS_D2_SUPPORT; - /* fall through */ - case 3: - device->power.dx_supported[i] |= - BM_FLAGS_D3_SUPPORT; - break; - } - - /* - * Validate: - * --------- - * Mask of any states that _Sx_d falsely advertises - * (e.g.claims D1 support but neither _PR2 or _PS2 - * exist). In other words, S1-S5 can't offer a Dx - * state that isn't supported by S0. - */ - device->power.dx_supported[i] &= - device->power.dx_supported[ACPI_STATE_S0]; - } - - object_name[2]++; - } - - return_ACPI_STATUS(AE_OK); -} diff -urN linux-2.4.18/drivers/acpi/ospm/busmgr/bmpower.c lia64-2.4/drivers/acpi/ospm/busmgr/bmpower.c --- linux-2.4.18/drivers/acpi/ospm/busmgr/bmpower.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/busmgr/bmpower.c Wed Dec 31 16:00:00 1969 @@ -1,664 +0,0 @@ -/**************************************************************************** - * - * Module Name: bmpower.c - Driver for ACPI Power Resource 'devices' - * $Revision: 20 $ - * - ****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * TBD: 1. Sequencing of power resource list transitions. - * 2. Global serialization of power resource transtions (see ACPI - * spec section 7.1.2/7.1.3). - * 3. Better error handling. - */ - - -#include -#include "bm.h" -#include "bmpower.h" - - -#define _COMPONENT ACPI_BUS - MODULE_NAME ("bmpower") - - -/**************************************************************************** - * Function Prototypes - ****************************************************************************/ - -acpi_status -bm_pr_notify ( - BM_NOTIFY notify_type, - BM_HANDLE device_handle, - void **context); - -acpi_status -bm_pr_request ( - BM_REQUEST *request, - void *context); - - -/**************************************************************************** - * Internal Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: bm_pr_print - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_pr_print ( - BM_POWER_RESOURCE *pr) -{ - acpi_buffer buffer; - - PROC_NAME("bm_pr_print"); - - if (!pr) { - return(AE_BAD_PARAMETER); - } - - buffer.length = 256; - buffer.pointer = acpi_os_callocate(buffer.length); - if (!buffer.pointer) { - return(AE_NO_MEMORY); - } - - acpi_get_name(pr->acpi_handle, ACPI_FULL_PATHNAME, &buffer); - - acpi_os_printf("Power Resource: found\n"); - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Power_resource[%02x]:[%p] %s\n", pr->device_handle, pr->acpi_handle, (char*)buffer.pointer)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| system_level[S%d] resource_order[%d]\n", pr->system_level, pr->resource_order)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| state[D%d] reference_count[%d]\n", pr->state, pr->reference_count)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - - acpi_os_free(buffer.pointer); - - return(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bm_pr_get_state - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_pr_get_state ( - BM_POWER_RESOURCE *pr) -{ - acpi_status status = AE_OK; - BM_DEVICE_STATUS device_status = BM_STATUS_UNKNOWN; - - FUNCTION_TRACE("bm_pr_get_state"); - - if (!pr) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - pr->state = ACPI_STATE_UNKNOWN; - - /* - * Evaluate _STA: - * -------------- - * Evalute _STA to determine whether the power resource is ON or OFF. - * Note that if the power resource isn't present we'll get AE_OK but - * an unknown status. - */ - status = bm_get_device_status(pr->device_handle, &device_status); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Error reading status for power resource [%02x].\n", pr->device_handle)); - return_ACPI_STATUS(status); - } - - /* - * Mask off all bits but the first as some systems return non-standard - * values (e.g. 0x51). - */ - switch (device_status & 0x01) { - case 0: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Power resource [%02x] is OFF.\n", pr->device_handle)); - pr->state = ACPI_STATE_D3; - break; - case 1: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Power resource [%02x] is ON.\n", pr->device_handle)); - pr->state = ACPI_STATE_D0; - break; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_pr_set_state - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_pr_set_state ( - BM_POWER_RESOURCE *pr, - BM_POWER_STATE target_state) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("bm_pr_set_state"); - - if (!pr) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - status = bm_pr_get_state(pr); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - if (target_state == pr->state) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Power resource [%02x] already at target power state [D%d].\n", pr->device_handle, pr->state)); - return_ACPI_STATUS(AE_OK); - } - - switch (target_state) { - - case ACPI_STATE_D0: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Turning power resource [%02x] ON.\n", pr->device_handle)); - status = bm_evaluate_object(pr->acpi_handle, "_ON", NULL, NULL); - break; - - case ACPI_STATE_D3: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Turning power resource [%02x] OFF.\n", pr->device_handle)); - status = bm_evaluate_object(pr->acpi_handle, "_OFF", NULL, NULL); - break; - - default: - status = AE_BAD_PARAMETER; - break; - } - - status = bm_pr_get_state(pr); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_pr_list_get_state - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_pr_list_get_state ( - BM_HANDLE_LIST *pr_list, - BM_POWER_STATE *power_state) -{ - acpi_status status = AE_OK; - BM_POWER_RESOURCE *pr = NULL; - u32 i = 0; - - FUNCTION_TRACE("bm_pr_list_get_state"); - - if (!pr_list || !power_state) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - if (pr_list->count < 1) { - pr->state = ACPI_STATE_UNKNOWN; - return_ACPI_STATUS(AE_ERROR); - } - - (*power_state) = ACPI_STATE_D0; - - /* - * Calculate Current power_state: - * ----------------------------- - * The current state of a list of power resources is ON if all - * power resources are currently in the ON state. In other words, - * if any power resource in the list is OFF then the collection - * isn't fully ON. - */ - for (i = 0; i < pr_list->count; i++) { - - status = bm_get_device_context(pr_list->handles[i], - (BM_DRIVER_CONTEXT*)(&pr)); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Invalid reference to power resource [%02x].\n", pr_list->handles[i])); - (*power_state) = ACPI_STATE_UNKNOWN; - break; - } - - status = bm_pr_get_state(pr); - if (ACPI_FAILURE(status)) { - (*power_state) = ACPI_STATE_UNKNOWN; - break; - } - - if (pr->state != ACPI_STATE_D0) { - (*power_state) = pr->state; - break; - } - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_pr_list_transition - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_pr_list_transition ( - BM_HANDLE_LIST *current_list, - BM_HANDLE_LIST *target_list) -{ - acpi_status status = AE_OK; - BM_POWER_RESOURCE *pr = NULL; - u32 i = 0; - - FUNCTION_TRACE("bm_pr_list_transition"); - - if (!current_list || !target_list) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Reference Target: - * ----------------- - * Reference all resources for the target power state first (so - * the device doesn't get turned off while transitioning). Power - * resources that aren't on (new reference count of 1) are turned on. - */ - for (i = 0; i < target_list->count; i++) { - - status = bm_get_device_context(target_list->handles[i], - (BM_DRIVER_CONTEXT*)(&pr)); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Invalid reference to power resource [%02x].\n", target_list->handles[i])); - continue; - } - - if (++pr->reference_count == 1) { - /* TBD: Need ordering based upon resource_order */ - status = bm_pr_set_state(pr, ACPI_STATE_D0); - if (ACPI_FAILURE(status)) { - /* TBD: How do we handle this? */ - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to change power state for power resource [%02x].\n", target_list->handles[i])); - } - } - } - - /* - * Dereference Current: - * -------------------- - * Dereference all resources for the current power state. Power - * resources no longer referenced (new reference count of 0) are - * turned off. - */ - for (i = 0; i < current_list->count; i++) { - - status = bm_get_device_context(current_list->handles[i], - (BM_DRIVER_CONTEXT*)(&pr)); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Invalid reference to power resource [%02x].\n", target_list->handles[i])); - continue; - } - - if (--pr->reference_count == 0) { - /* TBD: Need ordering based upon resource_order */ - status = bm_pr_set_state(pr, ACPI_STATE_D3); - if (ACPI_FAILURE(status)) { - /* TBD: How do we handle this? */ - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to change power state for power resource [%02x].\n", current_list->handles[i])); - } - } - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_pr_add_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_pr_add_device ( - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - BM_POWER_RESOURCE *pr = NULL; - BM_DEVICE *device = NULL; - acpi_buffer buffer; - acpi_object acpi_object; - - FUNCTION_TRACE("bm_pr_add_device"); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Adding power resource [%02x].\n", device_handle)); - - if (!context || *context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - buffer.length = sizeof(acpi_object); - buffer.pointer = &acpi_object; - - /* - * Get information on this device. - */ - status = bm_get_device_info(device_handle, &device); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Allocate a new BM_POWER_RESOURCE structure. - */ - pr = acpi_os_callocate(sizeof(BM_POWER_RESOURCE)); - if (!pr) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - pr->device_handle = device->handle; - pr->acpi_handle = device->acpi_handle; - - /* - * Get information on this power resource. - */ - status = acpi_evaluate_object(pr->acpi_handle, NULL, NULL, &buffer); - if (ACPI_FAILURE(status)) { - goto end; - } - - pr->system_level = acpi_object.power_resource.system_level; - pr->resource_order = acpi_object.power_resource.resource_order; - pr->state = ACPI_STATE_UNKNOWN; - pr->reference_count = 0; - - /* - * Get the power resource's current state (ON|OFF). - */ - status = bm_pr_get_state(pr); - -end: - if (ACPI_FAILURE(status)) { - acpi_os_free(pr); - } - else { - *context = pr; - bm_pr_print(pr); - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_pr_remove_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_pr_remove_device ( - void **context) -{ - acpi_status status = AE_OK; - BM_POWER_RESOURCE *pr = NULL; - - FUNCTION_TRACE("bm_pr_remove_device"); - - if (!context || !*context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - pr = (BM_POWER_RESOURCE*)*context; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing power resource [%02x].\n", pr->device_handle)); - - acpi_os_free(pr); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: bm_pr_initialize - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_pr_initialize (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("bm_pr_initialize"); - - MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID)); - MEMSET(&driver, 0, sizeof(BM_DRIVER)); - - criteria.type = BM_TYPE_POWER_RESOURCE; - - driver.notify = &bm_pr_notify; - driver.request = &bm_pr_request; - - status = bm_register_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_pr_terminate - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_pr_terminate (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("bm_pr_terminate"); - - MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID)); - MEMSET(&driver, 0, sizeof(BM_DRIVER)); - - criteria.type = BM_TYPE_POWER_RESOURCE; - - driver.notify = &bm_pr_notify; - driver.request = &bm_pr_request; - - status = bm_unregister_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_pr_notify - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_pr_notify ( - BM_NOTIFY notify_type, - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("bm_pr_notify"); - - switch (notify_type) { - - case BM_NOTIFY_DEVICE_ADDED: - status = bm_pr_add_device(device_handle, context); - break; - - case BM_NOTIFY_DEVICE_REMOVED: - status = bm_pr_remove_device(context); - break; - - default: - status = AE_SUPPORT; - break; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_pr_request - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_pr_request ( - BM_REQUEST *request, - void *context) -{ - acpi_status status = AE_OK; - BM_POWER_RESOURCE *pr = NULL; - - FUNCTION_TRACE("bm_pr_request"); - - /* - * Must have a valid request structure and context. - */ - if (!request || !context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * context contains information specific to this power resource. - */ - pr = (BM_POWER_RESOURCE*)context; - - /* - * Handle request: - * --------------- - */ - switch (request->command) { - - default: - status = AE_SUPPORT; - break; - } - - request->status = status; - - return_ACPI_STATUS(status); -} - - diff -urN linux-2.4.18/drivers/acpi/ospm/busmgr/bmrequest.c lia64-2.4/drivers/acpi/ospm/busmgr/bmrequest.c --- linux-2.4.18/drivers/acpi/ospm/busmgr/bmrequest.c Mon Sep 24 15:06:43 2001 +++ lia64-2.4/drivers/acpi/ospm/busmgr/bmrequest.c Wed Dec 31 16:00:00 1969 @@ -1,164 +0,0 @@ -/****************************************************************************** - * - * Module Name: bmrequest.c - * $Revision: 16 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include "bm.h" - -#define _COMPONENT ACPI_BUS - MODULE_NAME ("bmrequest") - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: bm_generate_request - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_generate_request ( - BM_NODE *node, - BM_REQUEST *request) -{ - acpi_status status = AE_OK; - BM_DEVICE *device = NULL; - - FUNCTION_TRACE("bm_generate_request"); - - if (!node || !request) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - device = &(node->device); - - if (!BM_IS_DRIVER_CONTROL(device)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "No driver installed for device [%02x].\n", device->handle)); - return_ACPI_STATUS(AE_NOT_EXIST); - } - - status = node->driver.request(request, node->driver.context); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_request - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_request ( - BM_REQUEST *request) -{ - acpi_status status = AE_OK; - BM_NODE *node = NULL; - BM_DEVICE *device = NULL; - - FUNCTION_TRACE("bm_request"); - - /* - * Must have a valid request structure. - */ - if (!request) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Received request for device [%02x] command [%02x].\n", request->handle, request->command)); - - /* - * Resolve the node. - */ - status = bm_get_node(request->handle, 0, &node); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - device = &(node->device); - - /* - * Device-Specific Request? - * ------------------------ - * If a device-specific command (>=0x80) forward this request to - * the appropriate driver. - */ - if (request->command & BM_COMMAND_DEVICE_SPECIFIC) { - status = bm_generate_request(node, request); - return_ACPI_STATUS(status); - } - - /* - * Bus-Specific Requests: - * ---------------------- - */ - switch (request->command) { - - case BM_COMMAND_GET_POWER_STATE: - status = bm_get_power_state(node); - if (ACPI_FAILURE(status)) { - break; - } - status = bm_copy_to_buffer(&(request->buffer), - &(device->power.state), sizeof(BM_POWER_STATE)); - break; - - case BM_COMMAND_SET_POWER_STATE: - { - BM_POWER_STATE *power_state = NULL; - - status = bm_cast_buffer(&(request->buffer), - (void**)&power_state, sizeof(BM_POWER_STATE)); - if (ACPI_FAILURE(status)) { - break; - } - status = bm_set_power_state(node, *power_state); - } - break; - - default: - status = AE_SUPPORT; - request->status = AE_SUPPORT; - break; - } - - return_ACPI_STATUS(status); -} diff -urN linux-2.4.18/drivers/acpi/ospm/busmgr/bmsearch.c lia64-2.4/drivers/acpi/ospm/busmgr/bmsearch.c --- linux-2.4.18/drivers/acpi/ospm/busmgr/bmsearch.c Mon Sep 24 15:06:43 2001 +++ lia64-2.4/drivers/acpi/ospm/busmgr/bmsearch.c Wed Dec 31 16:00:00 1969 @@ -1,192 +0,0 @@ -/****************************************************************************** - * - * Module Name: bmsearch.c - * $Revision: 16 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include "bm.h" - - -#define _COMPONENT ACPI_BUS - MODULE_NAME ("bmsearch") - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: bm_compare - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_compare ( - BM_DEVICE *device, - BM_DEVICE_ID *criteria) -{ - if (!device || !criteria) { - return AE_BAD_PARAMETER; - } - - /* - * Present? - * -------- - * We're only going to match on devices that are present. - * TBD: Optimize in bm_search (don't have to call here). - */ - if (!BM_DEVICE_PRESENT(device)) { - return AE_NOT_FOUND; - } - - /* - * Type? - */ - if (criteria->type && (criteria->type != device->id.type)) { - return AE_NOT_FOUND; - } - - /* - * HID? - */ - if ((criteria->hid[0]) && (0 != STRNCMP(criteria->hid, - device->id.hid, sizeof(BM_DEVICE_HID)))) { - return AE_NOT_FOUND; - } - - /* - * ADR? - */ - if ((criteria->adr) && (criteria->adr != device->id.adr)) { - return AE_NOT_FOUND; - } - - return AE_OK; -} - - -/**************************************************************************** - * - * FUNCTION: bm_search - * - * PARAMETERS: - * - * RETURN: AE_BAD_PARAMETER- invalid input parameter - * AE_NOT_EXIST - start_device_handle doesn't exist - * AE_NOT_FOUND - no matches to Search_info.criteria found - * AE_OK - success - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_search( - BM_HANDLE device_handle, - BM_DEVICE_ID *criteria, - BM_HANDLE_LIST *results) -{ - acpi_status status = AE_OK; - BM_NODE *node = NULL; - - FUNCTION_TRACE("bm_search"); - - if (!criteria || !results) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - results->count = 0; - - /* - * Locate Starting Point: - * ---------------------- - * Locate the node in the hierarchy where we'll begin our search. - */ - status = bm_get_node(device_handle, 0, &node); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Parse Hierarchy: - * ---------------- - * Parse through the node hierarchy looking for matches. - */ - while (node && (results->count<=BM_HANDLES_MAX)) { - /* - * Depth-first: - * ------------ - * Searches are always performed depth-first. - */ - if (node->scope.head) { - status = bm_compare(&(node->device), criteria); - if (ACPI_SUCCESS(status)) { - results->handles[results->count++] = - node->device.handle; - } - node = node->scope.head; - } - - /* - * Now Breadth: - * ------------ - * Search all peers until scope is exhausted. - */ - else { - status = bm_compare(&(node->device), criteria); - if (ACPI_SUCCESS(status)) { - results->handles[results->count++] = - node->device.handle; - } - - /* - * Locate Next Device: - * ------------------- - * The next node is either a peer at this level - * (node->next is valid), or we work are way back - * up the tree until we either find a non-parsed - * peer or hit the top (node->parent is NULL). - */ - while (!node->next && node->parent) { - node = node->parent; - } - node = node->next; - } - } - - if (results->count == 0) { - return_ACPI_STATUS(AE_NOT_FOUND); - } - else { - return_ACPI_STATUS(AE_OK); - } -} - diff -urN linux-2.4.18/drivers/acpi/ospm/busmgr/bmutils.c lia64-2.4/drivers/acpi/ospm/busmgr/bmutils.c --- linux-2.4.18/drivers/acpi/ospm/busmgr/bmutils.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/busmgr/bmutils.c Wed Dec 31 16:00:00 1969 @@ -1,611 +0,0 @@ -/***************************************************************************** - * - * Module Name: bmutils.c - * $Revision: 43 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include "bm.h" - - -#define _COMPONENT ACPI_BUS - MODULE_NAME ("bmutils") - - -#ifdef ACPI_DEBUG -#define DEBUG_EVAL_ERROR(l,h,p,s) bm_print_eval_error(l,h,p,s) -#else -#define DEBUG_EVAL_ERROR(l,h,p,s) -#endif - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: bm_print_eval_error - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -void -bm_print_eval_error ( - u32 debug_level, - acpi_handle handle, - acpi_string pathname, - acpi_status status) -{ - acpi_buffer buffer; - acpi_status local_status; - - PROC_NAME("bm_print_eval_error"); - - buffer.length = 256; - buffer.pointer = acpi_os_callocate(buffer.length); - if (!buffer.pointer) { - return; - } - - local_status = acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); - if (ACPI_FAILURE(local_status)) { - ACPI_DEBUG_PRINT((ACPI_DEBUG_LEVEL(debug_level), "Evaluate object [%p], %s\n", handle, - acpi_format_exception(status))); - return; - } - - if (pathname) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluate object [%s.%s], %s\n", (char*)buffer.pointer, pathname, - acpi_format_exception(status))); - } - else { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluate object [%s], %s\n", (char*)buffer.pointer, - acpi_format_exception(status))); - } - - acpi_os_free(buffer.pointer); -} - - -/**************************************************************************** - * - * FUNCTION: bm_copy_to_buffer - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_copy_to_buffer ( - acpi_buffer *buffer, - void *data, - u32 length) -{ - FUNCTION_TRACE("bm_copy_to_buffer"); - - if (!buffer || (!buffer->pointer) || !data || (length == 0)) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - if (length > buffer->length) { - buffer->length = length; - return_ACPI_STATUS(AE_BUFFER_OVERFLOW); - } - - buffer->length = length; - MEMCPY(buffer->pointer, data, length); - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bm_cast_buffer - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_cast_buffer ( - acpi_buffer *buffer, - void **pointer, - u32 length) -{ - FUNCTION_TRACE("bm_cast_buffer"); - - if (!buffer || !buffer->pointer || !pointer || length == 0) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - if (length > buffer->length) { - return_ACPI_STATUS(AE_BAD_DATA); - } - - *pointer = buffer->pointer; - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bm_extract_package_data - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_extract_package_data ( - acpi_object *package, - acpi_buffer *format, - acpi_buffer *buffer) -{ - u32 tail_offset = 0; - u32 size_required = 0; - char *format_string = NULL; - u32 format_count = 0; - u32 i = 0; - u8 *head = NULL; - u8 *tail = NULL; - - FUNCTION_TRACE("bm_extract_package_data"); - - if (!package || (package->type != ACPI_TYPE_PACKAGE) || (package->package.count < 1)) { - ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'package' argument\n")); - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - if (!format || !format->pointer || (format->length < 1)) { - ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'format' argument\n")); - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - if (!buffer) { - ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'buffer' argument\n")); - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - format_count = (format->length/sizeof(char)) - 1; - if (format_count > package->package.count) { - ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Format specifies more objects [%d] than exist in package [%d].", format_count, package->package.count)); - return_ACPI_STATUS(AE_BAD_DATA); - } - - format_string = (char*)format->pointer; - - /* - * Calculate size_required. - */ - for (i=0; ipackage.elements[i]); - - if (!element) { - return_ACPI_STATUS(AE_BAD_DATA); - } - - switch (element->type) { - - case ACPI_TYPE_INTEGER: - switch (format_string[i]) { - case 'N': - size_required += sizeof(acpi_integer); - tail_offset += sizeof(acpi_integer); - break; - case 'S': - size_required += sizeof(char*) + sizeof(acpi_integer) + sizeof(char); - tail_offset += sizeof(char*); - break; - default: - ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid package element [%d]: got number, expecing [%c].\n", i, format_string[i])); - return_ACPI_STATUS(AE_BAD_DATA); - break; - } - break; - - case ACPI_TYPE_STRING: - case ACPI_TYPE_BUFFER: - switch (format_string[i]) { - case 'S': - size_required += sizeof(char*) + (element->string.length * sizeof(char)) + sizeof(char); - tail_offset += sizeof(char*); - break; - case 'B': - size_required += sizeof(u8*) + (element->buffer.length * sizeof(u8)); - tail_offset += sizeof(u8*); - break; - default: - ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid package element [%d] got string/buffer, expecing [%c].\n", i, format_string[i])); - return_ACPI_STATUS(AE_BAD_DATA); - break; - } - break; - - case ACPI_TYPE_PACKAGE: - default: - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found unsupported element at index=%d\n", i)); - /* TBD: handle nested packages... */ - return_ACPI_STATUS(AE_SUPPORT); - break; - } - } - - /* - * Validate output buffer. - */ - if (buffer->length < size_required) { - buffer->length = size_required; - return_ACPI_STATUS(AE_BUFFER_OVERFLOW); - } - else if (buffer->length != size_required || !buffer->pointer) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - head = buffer->pointer; - tail = buffer->pointer + tail_offset; - - /* - * Extract package data. - */ - for (i=0; ipackage.elements[i]); - - switch (element->type) { - - case ACPI_TYPE_INTEGER: - switch (format_string[i]) { - case 'N': - *((acpi_integer*)head) = element->integer.value; - head += sizeof(acpi_integer); - break; - case 'S': - pointer = (u8**)head; - *pointer = tail; - *((acpi_integer*)tail) = element->integer.value; - head += sizeof(acpi_integer*); - tail += sizeof(acpi_integer); - /* NULL terminate string */ - *tail = (char)0; - tail += sizeof(char); - break; - default: - /* Should never get here */ - break; - } - break; - - case ACPI_TYPE_STRING: - case ACPI_TYPE_BUFFER: - switch (format_string[i]) { - case 'S': - pointer = (u8**)head; - *pointer = tail; - memcpy(tail, element->string.pointer, element->string.length); - head += sizeof(char*); - tail += element->string.length * sizeof(char); - /* NULL terminate string */ - *tail = (char)0; - tail += sizeof(char); - break; - case 'B': - pointer = (u8**)head; - *pointer = tail; - memcpy(tail, element->buffer.pointer, element->buffer.length); - head += sizeof(u8*); - tail += element->buffer.length * sizeof(u8); - break; - default: - /* Should never get here */ - break; - } - break; - - case ACPI_TYPE_PACKAGE: - /* TBD: handle nested packages... */ - default: - /* Should never get here */ - break; - } - } - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bm_evaluate_object - * - * PARAMETERS: - * - * RETURN: AE_OK - * AE_BUFFER_OVERFLOW Evaluated object returned data, but - * caller did not provide buffer. - * - * DESCRIPTION: Helper for acpi_evaluate_object that handles buffer - * allocation. Note that the caller is responsible for - * freeing buffer->pointer! - * - ****************************************************************************/ - -acpi_status -bm_evaluate_object ( - acpi_handle handle, - acpi_string pathname, - acpi_object_list *arguments, - acpi_buffer *buffer) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("bm_evaluate_object"); - - /* If caller provided a buffer it must be unallocated/zero'd. */ - if ((buffer) && (buffer->length != 0 || buffer->pointer)) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Evalute Object: - * --------------- - * The first attempt is just to get the size of the object data - * (that is unless there's no return data, e.g. _INI); the second - * gets the data. - */ - status = acpi_evaluate_object(handle, pathname, arguments, buffer); - if (ACPI_SUCCESS(status)) { - return_ACPI_STATUS(status); - } - else if ((buffer) && (status == AE_BUFFER_OVERFLOW)) { - - /* Gotta allocate -- CALLER MUST FREE! */ - buffer->pointer = acpi_os_callocate(buffer->length); - if (!buffer->pointer) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - /* Re-evaluate -- this time it should work */ - status = acpi_evaluate_object(handle, pathname, - arguments, buffer); - } - - if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - DEBUG_EVAL_ERROR(ACPI_LV_WARN, handle, pathname, - status); - } - if (buffer && buffer->pointer) { - acpi_os_free(buffer->pointer); - buffer->pointer = NULL; - buffer->length = 0; - } - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_evaluate_simple_integer - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_evaluate_simple_integer ( - acpi_handle handle, - acpi_string pathname, - u32 *data) -{ - acpi_status status = AE_OK; - acpi_object *element = NULL; - acpi_buffer buffer; - - FUNCTION_TRACE("bm_evaluate_simple_integer"); - - if (!data) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - MEMSET(&buffer, 0, sizeof(acpi_buffer)); - - /* - * Evaluate Object: - * ---------------- - */ - status = bm_evaluate_object(handle, pathname, NULL, &buffer); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "failed to evaluate object (%s)\n", - acpi_format_exception(status))); - goto end; - } - - /* - * Validate Data: - * -------------- - */ - status = bm_cast_buffer(&buffer, (void**)&element, - sizeof(acpi_object)); - if (ACPI_FAILURE(status)) { - DEBUG_EVAL_ERROR(ACPI_LV_WARN, handle, pathname, status); - goto end; - } - - if (element->type != ACPI_TYPE_INTEGER) { - status = AE_BAD_DATA; - DEBUG_EVAL_ERROR(ACPI_LV_WARN, handle, pathname, status); - goto end; - } - - *data = element->integer.value; - -end: - acpi_os_free(buffer.pointer); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bm_evaluate_reference_list - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bm_evaluate_reference_list ( - acpi_handle handle, - acpi_string pathname, - BM_HANDLE_LIST *reference_list) -{ - acpi_status status = AE_OK; - acpi_object *package = NULL; - acpi_object *element = NULL; - acpi_handle reference_handle = NULL; - acpi_buffer buffer; - u32 i = 0; - - FUNCTION_TRACE("bm_evaluate_reference_list"); - - if (!reference_list) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - MEMSET(&buffer, 0, sizeof(acpi_buffer)); - - /* - * Evaluate Object: - * ---------------- - */ - status = bm_evaluate_object(handle, pathname, NULL, &buffer); - if (ACPI_FAILURE(status)) { - goto end; - } - - /* - * Validate Package: - * ----------------- - */ - status = bm_cast_buffer(&buffer, (void**)&package, - sizeof(acpi_object)); - if (ACPI_FAILURE(status)) { - DEBUG_EVAL_ERROR(ACPI_LV_WARN, handle, pathname, status); - goto end; - } - - if (package->type != ACPI_TYPE_PACKAGE) { - status = AE_BAD_DATA; - DEBUG_EVAL_ERROR(ACPI_LV_WARN, handle, pathname, status); - goto end; - } - - if (package->package.count > BM_HANDLES_MAX) { - package->package.count = BM_HANDLES_MAX; - } - - /* - * Parse Package Data: - * ------------------- - */ - for (i = 0; i < package->package.count; i++) { - - element = &(package->package.elements[i]); - - if (!element || (element->type != ACPI_TYPE_STRING)) { - status = AE_BAD_DATA; - ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid element in package (not a device reference).\n")); - DEBUG_EVAL_ERROR (ACPI_LV_WARN, handle, pathname, status); - break; - } - - /* - * Resolve reference string (e.g. "\_PR_.CPU_") to an - * acpi_handle. - */ - status = acpi_get_handle(handle, - element->string.pointer, &reference_handle); - if (ACPI_FAILURE(status)) { - status = AE_BAD_DATA; - ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to resolve device reference [%s].\n", element->string.pointer)); - DEBUG_EVAL_ERROR (ACPI_LV_WARN, handle, pathname, status); - break; - } - - /* - * Resolve acpi_handle to BM_HANDLE. - */ - status = bm_get_handle(reference_handle, - &(reference_list->handles[i])); - if (ACPI_FAILURE(status)) { - status = AE_BAD_DATA; - ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to resolve device reference for [%p].\n", reference_handle)); - DEBUG_EVAL_ERROR (ACPI_LV_WARN, handle, pathname, status); - break; - } - - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resolved reference [%s]->[%p]->[%02x]\n", element->string.pointer, reference_handle, reference_list->handles[i])); - - (reference_list->count)++; - } - -end: - acpi_os_free(buffer.pointer); - - return_ACPI_STATUS(status); -} - - diff -urN linux-2.4.18/drivers/acpi/ospm/button/Makefile lia64-2.4/drivers/acpi/ospm/button/Makefile --- linux-2.4.18/drivers/acpi/ospm/button/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/ospm/button/Makefile Wed Dec 31 16:00:00 1969 @@ -1,6 +0,0 @@ -O_TARGET := ospm_$(notdir $(CURDIR)).o -obj-m := $(O_TARGET) -EXTRA_CFLAGS += $(ACPI_CFLAGS) -obj-y := $(patsubst %.c,%.o,$(wildcard *.c)) - -include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/drivers/acpi/ospm/button/bn.c lia64-2.4/drivers/acpi/ospm/button/bn.c --- linux-2.4.18/drivers/acpi/ospm/button/bn.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/button/bn.c Wed Dec 31 16:00:00 1969 @@ -1,507 +0,0 @@ -/***************************************************************************** - * - * Module Name: bn.c - * $Revision: 27 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Plxxe, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include "bn.h" - - -#define _COMPONENT ACPI_BUTTON - MODULE_NAME ("bn") - - -/***************************************************************************** - * Internal Functions - *****************************************************************************/ - -/***************************************************************************** - * - * FUNCTION: bn_print - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Prints out information on a specific button. - * - ****************************************************************************/ - -void -bn_print ( - BN_CONTEXT *button) -{ -#ifdef ACPI_DEBUG - acpi_buffer buffer; - - PROC_NAME("bn_print"); - - if (!button) { - return; - } - - buffer.length = 256; - buffer.pointer = acpi_os_callocate(buffer.length); - if (!buffer.pointer) { - return; - } - - /* - * Get the full pathname for this ACPI object. - */ - acpi_get_name(button->acpi_handle, ACPI_FULL_PATHNAME, &buffer); - - /* - * Print out basic button information. - */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - - switch (button->type) { - - case BN_TYPE_POWER_BUTTON: - case BN_TYPE_POWER_BUTTON_FIXED: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Power_button[%02x]:[%p] %s\n", button->device_handle, button->acpi_handle, (char*)buffer.pointer)); - break; - - case BN_TYPE_SLEEP_BUTTON: - case BN_TYPE_SLEEP_BUTTON_FIXED: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Sleep_button[%02x]:[%p] %s\n", button->device_handle, button->acpi_handle, (char*)buffer.pointer)); - break; - - case BN_TYPE_LID_SWITCH: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Lid_switch[%02x]:[%p] %s\n", button->device_handle, button->acpi_handle, (char*)buffer.pointer)); - break; - } - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - - acpi_os_free(buffer.pointer); -#endif /*ACPI_DEBUG*/ - - return; -} - - -/**************************************************************************** - * - * FUNCTION: bn_add_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bn_add_device( - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - BM_DEVICE *device = NULL; - BN_CONTEXT *button = NULL; - - FUNCTION_TRACE("bn_add_device"); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Adding button device [%02x].\n", device_handle)); - - if (!context || *context) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid context.\n")); - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Get information on this device. - */ - status = bm_get_device_info( device_handle, &device ); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Allocate a new BN_CONTEXT structure. - */ - button = acpi_os_callocate(sizeof(BN_CONTEXT)); - if (!button) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - button->device_handle = device->handle; - button->acpi_handle = device->acpi_handle; - - /* - * Power Button? - * ------------- - * Either fixed-feature or generic (namespace) types. - */ - if (strncmp(device->id.hid, BN_HID_POWER_BUTTON, - sizeof(BM_DEVICE_HID)) == 0) { - - if (device->id.type == BM_TYPE_FIXED_BUTTON) { - - button->type = BN_TYPE_POWER_BUTTON_FIXED; - - /* Register for fixed-feature events. */ - status = acpi_install_fixed_event_handler( - ACPI_EVENT_POWER_BUTTON, bn_notify_fixed, - (void*)button); - } - else { - button->type = BN_TYPE_POWER_BUTTON; - } - - } - - /* - * Sleep Button? - * ------------- - * Either fixed-feature or generic (namespace) types. - */ - else if (strncmp( device->id.hid, BN_HID_SLEEP_BUTTON, - sizeof(BM_DEVICE_HID)) == 0) { - - if (device->id.type == BM_TYPE_FIXED_BUTTON) { - - button->type = BN_TYPE_SLEEP_BUTTON_FIXED; - - /* Register for fixed-feature events. */ - status = acpi_install_fixed_event_handler( - ACPI_EVENT_SLEEP_BUTTON, bn_notify_fixed, - (void*)button); - } - else { - button->type = BN_TYPE_SLEEP_BUTTON; - } - } - - /* - * LID Switch? - * ----------- - */ - else if (strncmp( device->id.hid, BN_HID_LID_SWITCH, - sizeof(BM_DEVICE_HID)) == 0) { - button->type = BN_TYPE_LID_SWITCH; - } - - status = bn_osl_add_device(button); - if (ACPI_FAILURE(status)) { - goto end; - } - - *context = button; - - bn_print(button); - -end: - if (ACPI_FAILURE(status)) { - acpi_os_free(button); - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bn_remove_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bn_remove_device( - void **context) -{ - acpi_status status = AE_OK; - BN_CONTEXT *button = NULL; - - FUNCTION_TRACE("bn_remove_device"); - - if (!context || !*context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - button = (BN_CONTEXT*)*context; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing button device [%02x].\n", button->device_handle)); - - /* - * Unregister for fixed-feature events. - */ - switch (button->type) { - case BN_TYPE_POWER_BUTTON_FIXED: - status = acpi_remove_fixed_event_handler( - ACPI_EVENT_POWER_BUTTON, bn_notify_fixed); - break; - case BN_TYPE_SLEEP_BUTTON_FIXED: - status = acpi_remove_fixed_event_handler( - ACPI_EVENT_SLEEP_BUTTON, bn_notify_fixed); - break; - } - - bn_osl_remove_device(button); - - acpi_os_free(button); - - *context = NULL; - - return_ACPI_STATUS(status); -} - - -/***************************************************************************** - * External Functions - *****************************************************************************/ - -/***************************************************************************** - * - * FUNCTION: bn_initialize - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - - ****************************************************************************/ - -acpi_status -bn_initialize (void) -{ - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("bn_initialize"); - - MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID)); - MEMSET(&driver, 0, sizeof(BM_DRIVER)); - - driver.notify = &bn_notify; - driver.request = &bn_request; - - /* - * Register for power buttons. - */ - MEMCPY(criteria.hid, BN_HID_POWER_BUTTON, sizeof(BN_HID_POWER_BUTTON)); - bm_register_driver(&criteria, &driver); - - /* - * Register for sleep buttons. - */ - MEMCPY(criteria.hid, BN_HID_SLEEP_BUTTON, sizeof(BN_HID_SLEEP_BUTTON)); - bm_register_driver(&criteria, &driver); - - /* - * Register for LID switches. - */ - MEMCPY(criteria.hid, BN_HID_LID_SWITCH, sizeof(BN_HID_LID_SWITCH)); - bm_register_driver(&criteria, &driver); - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bn_terminate - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bn_terminate (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("bn_terminate"); - - MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID)); - MEMSET(&driver, 0, sizeof(BM_DRIVER)); - - driver.notify = &bn_notify; - driver.request = &bn_request; - - /* - * Unregister for power buttons. - */ - MEMCPY(criteria.hid, BN_HID_POWER_BUTTON, sizeof(BN_HID_POWER_BUTTON)); - status = bm_unregister_driver(&criteria, &driver); - - /* - * Unregister for sleep buttons. - */ - MEMCPY(criteria.hid, BN_HID_SLEEP_BUTTON, sizeof(BN_HID_SLEEP_BUTTON)); - status = bm_unregister_driver(&criteria, &driver); - - /* - * Unregister for LID switches. - */ - MEMCPY(criteria.hid, BN_HID_LID_SWITCH, sizeof(BN_HID_LID_SWITCH)); - status = bm_unregister_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bn_notify_fixed - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bn_notify_fixed ( - void *context) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("bn_notify_fixed"); - - if (!context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Status change event detected.\n")); - - status = bn_osl_generate_event(BN_NOTIFY_STATUS_CHANGE, - ((BN_CONTEXT*)context)); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bn_notify - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bn_notify ( - BM_NOTIFY notify_type, - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("bn_notify"); - - if (!context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - switch (notify_type) { - case BM_NOTIFY_DEVICE_ADDED: - status = bn_add_device(device_handle, context); - break; - - case BM_NOTIFY_DEVICE_REMOVED: - status = bn_remove_device(context); - break; - - case BN_NOTIFY_STATUS_CHANGE: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Status change event detected.\n")); - status = bn_osl_generate_event(BN_NOTIFY_STATUS_CHANGE, - ((BN_CONTEXT*)*context)); - break; - - default: - status = AE_SUPPORT; - break; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: bn_request - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -bn_request ( - BM_REQUEST *request, - void *context) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("bn_request"); - - /* - * Must have a valid request structure and context. - */ - if (!request || !context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Handle Request: - * --------------- - */ - switch (request->command) { - - default: - status = AE_SUPPORT; - break; - } - - request->status = status; - - return_ACPI_STATUS(status); -} diff -urN linux-2.4.18/drivers/acpi/ospm/button/bn_osl.c lia64-2.4/drivers/acpi/ospm/button/bn_osl.c --- linux-2.4.18/drivers/acpi/ospm/button/bn_osl.c Wed Dec 26 16:58:37 2001 +++ lia64-2.4/drivers/acpi/ospm/button/bn_osl.c Wed Dec 31 16:00:00 1969 @@ -1,311 +0,0 @@ -/****************************************************************************** - * - * Module Name: bn_osl.c - * $Revision: 16 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include -#include -#include -#include -#include -#include "bn.h" - - -MODULE_AUTHOR("Andrew Grover"); -MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Button Driver"); -MODULE_LICENSE("GPL"); - - -#define BN_PROC_ROOT "button" -#define BN_PROC_POWER_BUTTON "power" -#define BN_PROC_SLEEP_BUTTON "sleep" -#define BN_PROC_LID_SWITCH "lid" - -extern struct proc_dir_entry *bm_proc_root; -static struct proc_dir_entry *bn_proc_root = NULL; - - -#define BN_TYPE_UNKNOWN 0 -#define BN_TYPE_FIXED 1 -#define BN_TYPE_GENERIC 2 - -static int bn_power_button = BN_TYPE_UNKNOWN; -static int bn_sleep_button = BN_TYPE_UNKNOWN; -static int bn_lid_switch = BN_TYPE_UNKNOWN; - - -/**************************************************************************** - * - * FUNCTION: bn_osl_add_device - * - ****************************************************************************/ - -acpi_status -bn_osl_add_device( - BN_CONTEXT *button) -{ - acpi_status status = AE_OK; - - if (!button) { - return(AE_BAD_PARAMETER); - } - - switch (button->type) { - - case BN_TYPE_POWER_BUTTON_FIXED: - bn_power_button = BN_TYPE_FIXED; - printk(KERN_INFO "ACPI: Power Button (FF) found\n"); - if (!proc_mkdir(BN_PROC_POWER_BUTTON, bn_proc_root)) { - status = AE_ERROR; - } - break; - - case BN_TYPE_POWER_BUTTON: - /* - * Avoid creating multiple /proc entries when (buggy) ACPI - * BIOS tables erroneously list both fixed- and generic- - * feature buttons. Note that fixed-feature buttons are - * always enumerated first (and there can only be one) so - * we only need to check here. - */ - switch (bn_power_button) { - case BN_TYPE_GENERIC: - printk(KERN_WARNING "ACPI: Multiple generic-space power buttons detected, using first\n"); - break; - case BN_TYPE_FIXED: - printk(KERN_WARNING "ACPI: Multiple power buttons detected, ignoring fixed-feature\n"); - default: - printk(KERN_INFO "ACPI: Power Button (CM) found\n"); - bn_power_button = BN_TYPE_GENERIC; - if (!proc_mkdir(BN_PROC_POWER_BUTTON, bn_proc_root)) { - status = AE_ERROR; - } - break; - } - break; - - case BN_TYPE_SLEEP_BUTTON_FIXED: - bn_sleep_button = BN_TYPE_FIXED; - printk(KERN_INFO "ACPI: Sleep Button (FF) found\n"); - if (!proc_mkdir(BN_PROC_SLEEP_BUTTON, bn_proc_root)) { - status = AE_ERROR; - } - break; - - case BN_TYPE_SLEEP_BUTTON: - /* - * Avoid creating multiple /proc entries when (buggy) ACPI - * BIOS tables erroneously list both fixed- and generic- - * feature buttons. Note that fixed-feature buttons are - * always enumerated first (and there can only be one) so - * we only need to check here. - */ - switch (bn_sleep_button) { - case BN_TYPE_GENERIC: - printk(KERN_WARNING "ACPI: Multiple generic-space sleep buttons detected, using first\n"); - break; - case BN_TYPE_FIXED: - printk(KERN_WARNING "ACPI: Multiple sleep buttons detected, ignoring fixed-feature\n"); - default: - bn_sleep_button = BN_TYPE_GENERIC; - printk(KERN_INFO "ACPI: Sleep Button (CM) found\n"); - if (!proc_mkdir(BN_PROC_SLEEP_BUTTON, bn_proc_root)) { - status = AE_ERROR; - } - break; - } - break; - - case BN_TYPE_LID_SWITCH: - if (bn_lid_switch) { - printk(KERN_WARNING "ACPI: Multiple generic-space lid switches detected, using first\n"); - break; - } - bn_lid_switch = BN_TYPE_GENERIC; - printk(KERN_INFO "ACPI: Lid Switch (CM) found\n"); - if (!proc_mkdir(BN_PROC_LID_SWITCH, bn_proc_root)) { - status = AE_ERROR; - } - break; - } - - return(status); -} - - -/**************************************************************************** - * - * FUNCTION: bn_osl_remove_device - * - ****************************************************************************/ - -acpi_status -bn_osl_remove_device ( - BN_CONTEXT *button) -{ - if (!button) { - return(AE_BAD_PARAMETER); - } - - switch (button->type) { - - case BN_TYPE_POWER_BUTTON: - case BN_TYPE_POWER_BUTTON_FIXED: - remove_proc_entry(BN_PROC_POWER_BUTTON, bn_proc_root); - break; - - case BN_TYPE_SLEEP_BUTTON: - case BN_TYPE_SLEEP_BUTTON_FIXED: - remove_proc_entry(BN_PROC_SLEEP_BUTTON, bn_proc_root); - break; - - case BN_TYPE_LID_SWITCH: - remove_proc_entry(BN_PROC_LID_SWITCH, bn_proc_root); - break; - } - - return(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: bn_osl_generate_event - * - ****************************************************************************/ - -acpi_status -bn_osl_generate_event ( - u32 event, - BN_CONTEXT *button) -{ - acpi_status status = AE_OK; - - if (!button) { - return(AE_BAD_PARAMETER); - } - - switch (event) { - - case BN_NOTIFY_STATUS_CHANGE: - - switch(button->type) { - - case BN_TYPE_POWER_BUTTON: - case BN_TYPE_POWER_BUTTON_FIXED: - status = bm_osl_generate_event(button->device_handle, - BN_PROC_ROOT, BN_PROC_POWER_BUTTON, event, 0); - break; - - case BN_TYPE_SLEEP_BUTTON: - case BN_TYPE_SLEEP_BUTTON_FIXED: - status = bm_osl_generate_event(button->device_handle, - BN_PROC_ROOT, BN_PROC_SLEEP_BUTTON, event, 0); - break; - - case BN_TYPE_LID_SWITCH: - status = bm_osl_generate_event(button->device_handle, - BN_PROC_ROOT, BN_PROC_LID_SWITCH, event, 0); - break; - - default: - status = AE_SUPPORT; - break; - } - - break; - - default: - return(AE_BAD_PARAMETER); - break; - } - - return(status); -} - - -/**************************************************************************** - * - * FUNCTION: bn_osl_init - * - * PARAMETERS: - * - * RETURN: 0: Success - * - * DESCRIPTION: Module initialization. - * - ****************************************************************************/ - -static int __init -bn_osl_init (void) -{ - acpi_status status = AE_OK; - - /* abort if no busmgr */ - if (!bm_proc_root) - return -ENODEV; - - bn_proc_root = proc_mkdir(BN_PROC_ROOT, bm_proc_root); - if (!bn_proc_root) { - status = AE_ERROR; - } - else { - status = bn_initialize(); - if (ACPI_FAILURE(status)) { - remove_proc_entry(BN_PROC_ROOT, bm_proc_root); - } - } - - return (ACPI_SUCCESS(status)) ? 0 : -ENODEV; -} - - -/**************************************************************************** - * - * FUNCTION: bn_osl_cleanup - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Module cleanup. - * - ****************************************************************************/ - -static void __exit -bn_osl_cleanup (void) -{ - bn_terminate(); - - if (bn_proc_root) { - remove_proc_entry(BN_PROC_ROOT, bm_proc_root); - } - - return; -} - - -module_init(bn_osl_init); -module_exit(bn_osl_cleanup); diff -urN linux-2.4.18/drivers/acpi/ospm/ec/Makefile lia64-2.4/drivers/acpi/ospm/ec/Makefile --- linux-2.4.18/drivers/acpi/ospm/ec/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/ospm/ec/Makefile Wed Dec 31 16:00:00 1969 @@ -1,6 +0,0 @@ -O_TARGET := ospm_$(notdir $(CURDIR)).o -obj-m := $(O_TARGET) -EXTRA_CFLAGS += $(ACPI_CFLAGS) -obj-y := $(patsubst %.c,%.o,$(wildcard *.c)) - -include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/drivers/acpi/ospm/ec/ec_osl.c lia64-2.4/drivers/acpi/ospm/ec/ec_osl.c --- linux-2.4.18/drivers/acpi/ospm/ec/ec_osl.c Wed Dec 26 16:58:37 2001 +++ lia64-2.4/drivers/acpi/ospm/ec/ec_osl.c Wed Dec 31 16:00:00 1969 @@ -1,91 +0,0 @@ -/***************************************************************************** - * - * Module Name: ec_osl.c - * $Revision: 11 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include -#include -#include -#include -#include -#include -#include "ec.h" - - -MODULE_AUTHOR("Andrew Grover"); -MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Embedded Controller Driver"); -MODULE_LICENSE("GPL"); - -extern struct proc_dir_entry *bm_proc_root; - - -/**************************************************************************** - * - * FUNCTION: ec_osl_init - * - * PARAMETERS: - * - * RETURN: 0: Success - * - * DESCRIPTION: Module initialization. - * - ****************************************************************************/ - -static int __init -ec_osl_init (void) -{ - acpi_status status = AE_OK; - - /* abort if no busmgr */ - if (!bm_proc_root) - return -ENODEV; - - status = ec_initialize(); - - return (ACPI_SUCCESS(status)) ? 0 : -ENODEV; -} - -/**************************************************************************** - * - * FUNCTION: ec_osl_cleanup - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Module cleanup. - * - ****************************************************************************/ - -static void __exit -ec_osl_cleanup(void) -{ - ec_terminate(); - - return; -} - -module_init(ec_osl_init); -module_exit(ec_osl_cleanup); diff -urN linux-2.4.18/drivers/acpi/ospm/ec/ecgpe.c lia64-2.4/drivers/acpi/ospm/ec/ecgpe.c --- linux-2.4.18/drivers/acpi/ospm/ec/ecgpe.c Mon Sep 24 15:06:44 2001 +++ lia64-2.4/drivers/acpi/ospm/ec/ecgpe.c Wed Dec 31 16:00:00 1969 @@ -1,249 +0,0 @@ -/***************************************************************************** - * - * Module Name: ecgpe.c - * $Revision: 28 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include "ec.h" - -#define _COMPONENT ACPI_EC - MODULE_NAME ("ecgpe") - - -/**************************************************************************** - * - * FUNCTION: ec_query_handler - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -void -ec_query_handler ( - void *context) -{ - EC_CONTEXT *ec = (EC_CONTEXT*)context; - static char object_name[5] = {'_','Q','0','0','\0'}; - const char hex[] = {'0','1','2','3','4','5','6','7','8', - '9','A','B','C','D','E','F'}; - - FUNCTION_TRACE("ec_query_handler"); - - if (!ec) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) context.\n")); - return_VOID; - } - - /* - * Evaluate _Qxx: - * -------------- - * Evaluate corresponding _Qxx method. Note that a zero query value - * indicates a spurious EC_SCI (no such thing as _Q00). - */ - object_name[2] = hex[((ec->query_data >> 4) & 0x0F)]; - object_name[3] = hex[(ec->query_data & 0x0F)]; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Evaluating [%s] for ec [%02x].\n", object_name, ec->device_handle)); - - bm_evaluate_object(ec->acpi_handle, object_name, NULL, NULL); - - return_VOID; -} - - -/**************************************************************************** - * - * FUNCTION: ec_gpe_handler - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -void -ec_gpe_handler ( - void *context) -{ - acpi_status status = AE_OK; - EC_CONTEXT *ec = (EC_CONTEXT*)context; - EC_STATUS ec_status = 0; - - FUNCTION_TRACE("ec_gpe_handler"); - - if (!ec) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) context.\n")); - return_VOID; - } - - /* TBD: synchronize w/ transaction (ectransx). */ - - /* - * EC_SCI? - * ------- - * Check the EC_SCI bit to see if this is an EC_SCI event. If not (e.g. - * OBF/IBE) just return, as we already poll to detect these events. - */ - acpi_os_read_port(ec->status_port, &ec_status, 8); - if (!(ec_status & EC_FLAG_SCI)) { - return_VOID; - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "EC_SCI event detected on ec [%02x] - running query.\n", ec->device_handle)); - - /* - * Run Query: - * ---------- - * Query the EC to find out which _Qxx method we need to evaluate. - * Note that successful completion of the query causes the EC_SCI - * bit to be cleared (and thus clearing the interrupt source). - */ - status = ec_io_write(ec, ec->command_port, EC_COMMAND_QUERY, - EC_EVENT_OUTPUT_BUFFER_FULL); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to send 'query command' to EC.\n")); - return_VOID; - } - - status = ec_io_read(ec, ec->data_port, &(ec->query_data), - EC_EVENT_NONE); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Error reading query data.\n")); - return_VOID; - } - - /* TBD: un-synchronize w/ transaction (ectransx). */ - - /* - * Spurious EC_SCI? - * ---------------- - */ - if (!ec->query_data) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Spurious EC SCI detected.\n")); - return_VOID; - } - - /* - * Defer _Qxx Execution: - * --------------------- - * Can't evaluate this method now 'cause we're at interrupt-level. - */ - status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE, - ec_query_handler, ec); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to defer _Qxx method evaluation.\n")); - return_VOID; - } - - return_VOID; -} - - -/**************************************************************************** - * - * FUNCTION: ec_install_gpe_handler - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_install_gpe_handler ( - EC_CONTEXT *ec) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("ec_install_gpe_handler"); - - if (!ec) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Evaluate _GPE: - * -------------- - * Evaluate the "_GPE" object (required) to find out which GPE bit - * is used by this EC to signal events (SCIs). - */ - status = bm_evaluate_simple_integer(ec->acpi_handle, - "_GPE", &(ec->gpe_bit)); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Install GPE Handler: - * -------------------- - * Install a handler for this EC's GPE bit. - */ - status = acpi_install_gpe_handler(ec->gpe_bit, ACPI_EVENT_EDGE_TRIGGERED, - &ec_gpe_handler, ec); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "acpi_install_gpe_handler() failed for GPE bit [%02x] with status [%08x].\n", ec->gpe_bit, status)); - ec->gpe_bit = EC_GPE_UNKNOWN; - return_ACPI_STATUS(status); - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: ec_remove_gpe_handler - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_remove_gpe_handler ( - EC_CONTEXT *ec) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("ec_remove_gpe_handler"); - - if (!ec) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - status = acpi_remove_gpe_handler(ec->gpe_bit, &ec_gpe_handler); - - return_ACPI_STATUS(status); -} diff -urN linux-2.4.18/drivers/acpi/ospm/ec/ecmain.c lia64-2.4/drivers/acpi/ospm/ec/ecmain.c --- linux-2.4.18/drivers/acpi/ospm/ec/ecmain.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/ec/ecmain.c Wed Dec 31 16:00:00 1969 @@ -1,498 +0,0 @@ -/***************************************************************************** - * - * Module Name: ecmain.c - * $Revision: 29 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include "ec.h" - -#define _COMPONENT ACPI_EC - MODULE_NAME ("ecmain") - - -/**************************************************************************** - * Internal Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: ec_print - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Prints out information on a specific ec. - * - ****************************************************************************/ - -void -ec_print ( - EC_CONTEXT *ec) -{ -#ifdef ACPI_DEBUG - acpi_buffer buffer; -#endif /*ACPI_DEBUG*/ - - PROC_NAME("ec_print"); - - if (!ec) { - return; - } - - acpi_os_printf("EC: found, GPE %d\n", ec->gpe_bit); - -#ifdef ACPI_DEBUG - buffer.length = 256; - buffer.pointer = acpi_os_callocate(buffer.length); - if (!buffer.pointer) { - return; - } - - /* - * Get the full pathname for this ACPI object. - */ - acpi_get_name(ec->acpi_handle, ACPI_FULL_PATHNAME, &buffer); - - /* - * Print out basic thermal zone information. - */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Embedded_controller[%02x]:[%p] %s\n", ec->device_handle, ec->acpi_handle, (char*)buffer.pointer)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| gpe_bit[%02x] status/command_port[%02x] data_port[%02x]\n", ec->gpe_bit, ec->status_port, ec->data_port)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - - acpi_os_free(buffer.pointer); -#endif /*ACPI_DEBUG*/ - - return; -} - - -/**************************************************************************** - * - * FUNCTION: ec_get_port_values - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Evaluate _CRS to get the current resources (I/O port - * addresses) for this EC. - * - ****************************************************************************/ - -acpi_status -ec_get_port_values( - EC_CONTEXT *ec) -{ - acpi_status status = AE_OK; - acpi_buffer buffer; - acpi_resource *resource = NULL; - - FUNCTION_TRACE("ec_get_port_values"); - - if (!ec) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - buffer.length = 0; - buffer.pointer = NULL; - - status = acpi_get_current_resources(ec->acpi_handle, &buffer); - if (status != AE_BUFFER_OVERFLOW) { - return_ACPI_STATUS(status); - } - - buffer.pointer = acpi_os_callocate(buffer.length); - if (!buffer.pointer) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - status = acpi_get_current_resources(ec->acpi_handle, &buffer); - if (ACPI_FAILURE(status)) { - goto end; - } - - resource = (acpi_resource *) buffer.pointer; - ec->data_port = resource->data.io.min_base_address; - - resource = NEXT_RESOURCE(resource); - - ec->status_port = ec->command_port = - resource->data.io.min_base_address; -end: - acpi_os_free(buffer.pointer); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: ec_add_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_add_device( - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - BM_DEVICE *device = NULL; - EC_CONTEXT *ec = NULL; - u8 gpe_handler = FALSE; - u8 space_handler = FALSE; - - FUNCTION_TRACE("ec_add_device"); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Adding EC device [%02x].\n", device_handle)); - - if (!context || *context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Get information on this device. - */ - status = bm_get_device_info(device_handle, &device); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Allocate a new EC_CONTEXT structure. - */ - ec = acpi_os_callocate(sizeof(EC_CONTEXT)); - if (!ec) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - ec->device_handle = device->handle; - ec->acpi_handle = device->acpi_handle; - - /* - * Get the I/O port addresses for the command/status and data ports. - */ - status = ec_get_port_values(ec); - if (ACPI_FAILURE(status)) { - goto end; - } - - /* - * See if we need to obtain the global lock for EC transactions. - */ - status = bm_evaluate_simple_integer(ec->acpi_handle, "_GLK", - &ec->use_global_lock); - if (status == AE_NOT_FOUND) { - ec->use_global_lock = 0; - } - else if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "EC _GLK failed\n")); - goto end; - } - - /* - * Install a handler for servicing this EC's GPE. - */ - status = ec_install_gpe_handler(ec); - if (ACPI_FAILURE(status)) { - goto end; - } - else { - gpe_handler = TRUE; - } - - /* - * Install a handler for servicing this EC's address space. - */ - status = ec_install_space_handler(ec); - if (ACPI_FAILURE(status)) { - goto end; - } - else { - space_handler = TRUE; - } - - /* - * Create a semaphore to serialize EC transactions. - */ - status = acpi_os_create_semaphore(1,1, &(ec->mutex)); - if (ACPI_FAILURE(status)) { - goto end; - } - - /* - * Context now contains information specific to this EC. Note - * that we'll get this pointer back on every ec_request() and - * ec_notify(). - */ - *context = ec; - - ec_print(ec); - -end: - if (ACPI_FAILURE(status)) { - - if (gpe_handler) { - ec_remove_gpe_handler(ec); - } - - if (space_handler) { - ec_remove_space_handler(ec); - } - - if (ec->mutex) { - acpi_os_delete_semaphore(ec->mutex); - } - - acpi_os_free(ec); - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: ec_remove_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_remove_device( - void **context) -{ - acpi_status status = AE_OK; - EC_CONTEXT *ec = NULL; - - FUNCTION_TRACE("ec_remove_device"); - - if (!context || !*context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - ec = (EC_CONTEXT*)*context; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing EC device [%02x].\n", ec->device_handle)); - - ec_remove_space_handler(ec); - - ec_remove_gpe_handler(ec); - - if (ec->mutex) { - acpi_os_delete_semaphore(ec->mutex); - } - - acpi_os_free(ec); - - *context = NULL; - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: ec_initialize - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_initialize (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("ec_initialize"); - - MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID)); - MEMSET(&driver, 0, sizeof(BM_DRIVER)); - - /* - * Register driver for AC Adapter devices. - */ - MEMCPY(criteria.hid, EC_HID_EC, sizeof(EC_HID_EC)); - - driver.notify = &ec_notify; - driver.request = &ec_request; - - status = bm_register_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: ec_terminate - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_terminate(void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("ec_terminate"); - - MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID)); - MEMSET(&driver, 0, sizeof(BM_DRIVER)); - - /* - * Unregister driver for AC Adapter devices. - */ - MEMCPY(criteria.hid, EC_HID_EC, sizeof(EC_HID_EC)); - - driver.notify = &ec_notify; - driver.request = &ec_request; - - status = bm_unregister_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: ec_notify - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_notify ( - BM_NOTIFY notify, - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("ec_notify"); - - switch (notify) { - - case BM_NOTIFY_DEVICE_ADDED: - status = ec_add_device(device_handle, context); - break; - - case BM_NOTIFY_DEVICE_REMOVED: - status = ec_remove_device(context); - break; - - default: - status = AE_SUPPORT; - break; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: ec_request - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_request ( - BM_REQUEST *request, - void *context) -{ - acpi_status status = AE_OK; - EC_REQUEST *ec_request = NULL; - EC_CONTEXT *ec = NULL; - - FUNCTION_TRACE("ec_request"); - - /* - * Must have a valid request structure and context. - */ - if (!request || !context) - return_ACPI_STATUS(AE_BAD_PARAMETER); - - /* - * buffer must contain a valid EC_REQUEST structure. - */ - status = bm_cast_buffer(&(request->buffer), (void**)&ec_request, - sizeof(EC_REQUEST)); - if (ACPI_FAILURE(status)) - return_ACPI_STATUS(status); - - /* - * context contains information specific to this EC. - */ - ec = (EC_CONTEXT*)context; - - /* - * Perform the Transaction. - */ - status = ec_transaction(ec, ec_request); - - return_ACPI_STATUS(status); -} diff -urN linux-2.4.18/drivers/acpi/ospm/ec/ecspace.c lia64-2.4/drivers/acpi/ospm/ec/ecspace.c --- linux-2.4.18/drivers/acpi/ospm/ec/ecspace.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/ec/ecspace.c Wed Dec 31 16:00:00 1969 @@ -1,192 +0,0 @@ -/***************************************************************************** - * - * Module Name: ecspace.c - * $Revision: 23 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include "ec.h" - -#define _COMPONENT ACPI_EC - MODULE_NAME ("ecspace") - - -/**************************************************************************** - * - * FUNCTION: ec_space_setup - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_space_setup ( - acpi_handle region_handle, - u32 function, - void *handler_context, - void **return_context) -{ - /* - * The EC object is in the handler context and is needed - * when calling the ec_space_handler. - */ - *return_context = handler_context; - - return AE_OK; -} - - -/**************************************************************************** - * - * FUNCTION: ec_space_handler - * - * PARAMETERS: function - Read or Write operation - * address - Where in the space to read or write - * bit_width - Field width in bits (should be 8) - * value - Pointer to in or out value - * context - context pointer - * - * RETURN: - * - * DESCRIPTION: Handler for the Embedded Controller (EC) address space - * (Op Region) - * - ****************************************************************************/ - -acpi_status -ec_space_handler ( - u32 function, - ACPI_PHYSICAL_ADDRESS address, - u32 bit_width, - u32 *value, - void *handler_context, - void *region_context) -{ - acpi_status status = AE_OK; - EC_CONTEXT *ec = NULL; - EC_REQUEST ec_request; - - FUNCTION_TRACE("ec_space_handler"); - - if (address > 0xFF || bit_width != 8 || !value || !handler_context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - ec = (EC_CONTEXT*)handler_context; - - switch (function) { - - case ACPI_READ_ADR_SPACE: - ec_request.command = EC_COMMAND_READ; - ec_request.address = address; - ec_request.data = 0; - break; - - case ACPI_WRITE_ADR_SPACE: - ec_request.command = EC_COMMAND_WRITE; - ec_request.address = address; - ec_request.data = (u8)(*value); - break; - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Received request with invalid function [%X].\n", function)); - return_ACPI_STATUS(AE_BAD_PARAMETER); - break; - } - - /* - * Perform the Transaction. - */ - status = ec_transaction(ec, &ec_request); - if (ACPI_SUCCESS(status)) { - (*value) = (u32)ec_request.data; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: ec_install_space_handler - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_install_space_handler ( - EC_CONTEXT *ec) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("ec_install_space_handler"); - - if (!ec) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - status = acpi_install_address_space_handler (ec->acpi_handle, - ACPI_ADR_SPACE_EC, &ec_space_handler, &ec_space_setup, ec); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: ec_remove_space_handler - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_remove_space_handler ( - EC_CONTEXT *ec) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("ec_remove_space_handler"); - - if (!ec) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - status = acpi_remove_address_space_handler(ec->acpi_handle, - ACPI_ADR_SPACE_EC, &ec_space_handler); - - return_ACPI_STATUS(status); -} diff -urN linux-2.4.18/drivers/acpi/ospm/ec/ectransx.c lia64-2.4/drivers/acpi/ospm/ec/ectransx.c --- linux-2.4.18/drivers/acpi/ospm/ec/ectransx.c Mon Sep 24 15:06:44 2001 +++ lia64-2.4/drivers/acpi/ospm/ec/ectransx.c Wed Dec 31 16:00:00 1969 @@ -1,343 +0,0 @@ -/***************************************************************************** - * - * Module Name: ectransx.c - * $Revision: 24 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include "ec.h" - -#define _COMPONENT ACPI_EC - MODULE_NAME ("ectransx") - - -/**************************************************************************** - * - * FUNCTION: ec_io_wait - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_io_wait ( - EC_CONTEXT *ec, - EC_EVENT wait_event) -{ - EC_STATUS ec_status = 0; - u32 i = 100; - - if (!ec || ((wait_event != EC_EVENT_OUTPUT_BUFFER_FULL) - && (wait_event != EC_EVENT_INPUT_BUFFER_EMPTY))) { - return(AE_BAD_PARAMETER); - } - - /* - * Wait for Event: - * --------------- - * Poll the EC status register waiting for the event to occur. - * Note that we'll wait a maximum of 1ms in 10us chunks. - */ - switch (wait_event) { - - case EC_EVENT_OUTPUT_BUFFER_FULL: - do { - acpi_os_read_port(ec->status_port, &ec_status, 8); - if (ec_status & EC_FLAG_OUTPUT_BUFFER) { - return(AE_OK); - } - acpi_os_stall(10); - } while (--i>0); - break; - - case EC_EVENT_INPUT_BUFFER_EMPTY: - do { - acpi_os_read_port(ec->status_port, &ec_status, 8); - if (!(ec_status & EC_FLAG_INPUT_BUFFER)) { - return(AE_OK); - } - acpi_os_stall(10); - } while (--i>0); - break; - } - - return(AE_TIME); -} - - -/**************************************************************************** - * - * FUNCTION: ec_io_read - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_io_read ( - EC_CONTEXT *ec, - ACPI_IO_ADDRESS io_port, - u8 *data, - EC_EVENT wait_event) -{ - acpi_status status = AE_OK; - - if (!ec || !data) { - return(AE_BAD_PARAMETER); - } - - acpi_os_read_port(io_port, (u32*) data, 8); - - if (wait_event) { - status = ec_io_wait(ec, wait_event); - } - - return(status); -} - - -/**************************************************************************** - * - * FUNCTION: ec_io_write - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_io_write ( - EC_CONTEXT *ec, - ACPI_IO_ADDRESS io_port, - u8 data, - EC_EVENT wait_event) -{ - acpi_status status = AE_OK; - - if (!ec) { - return(AE_BAD_PARAMETER); - } - - acpi_os_write_port(io_port, data, 8); - - if (wait_event) { - status = ec_io_wait(ec, wait_event); - } - - return(status); -} - - -/**************************************************************************** - * - * FUNCTION: ec_read - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_read ( - EC_CONTEXT *ec, - u8 address, - u8 *data) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("ec_read"); - - if (!ec || !data) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - if (ec->use_global_lock) { - status = acpi_acquire_global_lock(); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Could not acquire Global Lock\n")); - return_ACPI_STATUS(status); - } - } - - status = ec_io_write(ec, ec->command_port, EC_COMMAND_READ, - EC_EVENT_INPUT_BUFFER_EMPTY); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to send 'read command' to EC.\n")); - return_ACPI_STATUS(status); - } - - status = ec_io_write(ec, ec->data_port, address, - EC_EVENT_OUTPUT_BUFFER_FULL); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to send 'read address' to EC.\n")); - return_ACPI_STATUS(status); - } - - status = ec_io_read(ec, ec->data_port, data, EC_EVENT_NONE); - - if (ec->use_global_lock) { - acpi_release_global_lock(); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Read data [%02x] from address [%02x] on ec [%02x].\n", (*data), address, ec->device_handle)); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: ec_write - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_write ( - EC_CONTEXT *ec, - u8 address, - u8 data) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("ec_write"); - - if (!ec) - return_ACPI_STATUS(AE_BAD_PARAMETER); - - if (ec->use_global_lock) { - status = acpi_acquire_global_lock(); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Could not acquire Global Lock\n")); - return_ACPI_STATUS(status); - } - } - - status = ec_io_write(ec, ec->command_port, EC_COMMAND_WRITE, - EC_EVENT_INPUT_BUFFER_EMPTY); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to send 'write command' to EC.\n")); - return_ACPI_STATUS(status); - } - - status = ec_io_write(ec, ec->data_port, address, - EC_EVENT_INPUT_BUFFER_EMPTY); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to send 'write address' to EC.\n")); - return_ACPI_STATUS(status); - } - - status = ec_io_write(ec, ec->data_port, data, - EC_EVENT_INPUT_BUFFER_EMPTY); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to send 'write data' to EC.\n")); - return_ACPI_STATUS(status); - } - - if (ec->use_global_lock) { - acpi_release_global_lock(); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Wrote data [%02x] to address [%02x] on ec [%02x].\n", data, address, ec->device_handle)); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: ec_transaction - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -ec_transaction ( - EC_CONTEXT *ec, - EC_REQUEST *request) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("ec_transaction"); - - if (!ec || !request) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Obtain mutex to serialize all EC transactions. - */ - status = acpi_os_wait_semaphore(ec->mutex, 1, EC_DEFAULT_TIMEOUT); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Perform the transaction. - */ - switch (request->command) { - - case EC_COMMAND_READ: - status = ec_read(ec, request->address, &(request->data)); - break; - - case EC_COMMAND_WRITE: - status = ec_write(ec, request->address, request->data); - break; - - default: - status = AE_SUPPORT; - break; - } - - /* - * Signal the mutex to indicate transaction completion. - */ - acpi_os_signal_semaphore(ec->mutex, 1); - - return_ACPI_STATUS(status); -} diff -urN linux-2.4.18/drivers/acpi/ospm/include/ac.h lia64-2.4/drivers/acpi/ospm/include/ac.h --- linux-2.4.18/drivers/acpi/ospm/include/ac.h Mon Sep 24 15:06:44 2001 +++ lia64-2.4/drivers/acpi/ospm/include/ac.h Wed Dec 31 16:00:00 1969 @@ -1,102 +0,0 @@ -/***************************************************************************** - * - * Module Name: ac.h - * $Revision: 6 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef __AC_H__ -#define __AC_H__ - -#include -#include -#include - - -/***************************************************************************** - * Types & Other Defines - *****************************************************************************/ - -/* - * Notifications: - * -------------- - */ -#define AC_NOTIFY_STATUS_CHANGE ((BM_NOTIFY) 0x80) - -/* - * Hardware IDs: - * ------------- - */ -#define AC_HID_AC_ADAPTER "ACPI0003" - - -/* - * Device Context: - * --------------- - */ -typedef struct -{ - BM_HANDLE device_handle; - acpi_handle acpi_handle; - char uid[9]; - u32 is_online; -} AC_CONTEXT; - - -/***************************************************************************** - * Function Prototypes - *****************************************************************************/ - -acpi_status -ac_initialize (void); - -acpi_status -ac_terminate (void); - -acpi_status -ac_notify ( - u32 notify_type, - u32 device, - void **context); - -acpi_status -ac_request( - BM_REQUEST *request_info, - void *context); - -/* AC Adapter Driver OSL */ - -acpi_status -ac_osl_add_device ( - AC_CONTEXT *ac_adapter); - -acpi_status -ac_osl_remove_device ( - AC_CONTEXT *ac_adapter); - -acpi_status -ac_osl_generate_event ( - u32 event, - AC_CONTEXT *ac_adapter); - - -#endif /* __AC_H__ */ diff -urN linux-2.4.18/drivers/acpi/ospm/include/bm.h lia64-2.4/drivers/acpi/ospm/include/bm.h --- linux-2.4.18/drivers/acpi/ospm/include/bm.h Mon Sep 24 15:06:44 2001 +++ lia64-2.4/drivers/acpi/ospm/include/bm.h Wed Dec 31 16:00:00 1969 @@ -1,583 +0,0 @@ -/***************************************************************************** - * - * Module name: bm.h - * $Revision: 41 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __BM_H__ -#define __BM_H__ - -#include -#include - - -/***************************************************************************** - * Types & Defines - *****************************************************************************/ - -/* - * Output Flags (Debug): - * --------------------- - */ -#define BM_PRINT_ALL (0x00000000) -#define BM_PRINT_GROUP (0x00000001) -#define BM_PRINT_LINKAGE (0x00000002) -#define BM_PRINT_IDENTIFICATION (0x00000004) -#define BM_PRINT_POWER (0x00000008) -#define BM_PRINT_PRESENT (0x00000010) - - -/* - * BM_COMMAND: - * ----------- - */ -typedef u32 BM_COMMAND; - -#define BM_COMMAND_UNKNOWN ((BM_COMMAND) 0x00) - -#define BM_COMMAND_GET_POWER_STATE ((BM_COMMAND) 0x01) -#define BM_COMMAND_SET_POWER_STATE ((BM_COMMAND) 0x02) - -#define BM_COMMAND_DEVICE_SPECIFIC ((BM_COMMAND) 0x80) - -/* - * BM_NOTIFY: - * ---------- - * Standard ACPI notification values, from section 5.6.3 of the ACPI 2.0 - * specification. Note that the Bus Manager internally handles all - * standard ACPI notifications -- driver modules are never sent these - * values (see "Bus Manager Notifications", below). - */ -typedef u32 BM_NOTIFY; - -#define BM_NOTIFY_BUS_CHECK ((BM_NOTIFY) 0x00) -#define BM_NOTIFY_DEVICE_CHECK ((BM_NOTIFY) 0x01) -#define BM_NOTIFY_DEVICE_WAKE ((BM_NOTIFY) 0x02) -#define BM_NOTIFY_EJECT_REQUEST ((BM_NOTIFY) 0x03) -#define BM_NOTIFY_DEVICE_CHECK_LIGHT ((BM_NOTIFY) 0x04) -#define BM_NOTIFY_FREQUENCY_MISMATCH ((BM_NOTIFY) 0x05) -#define BM_NOTIFY_BUS_MODE_MISMATCH ((BM_NOTIFY) 0x06) -#define BM_NOTIFY_POWER_FAULT ((BM_NOTIFY) 0x07) - -/* - * These are a higher-level abstraction of ACPI notifications, intended - * for consumption by driver modules to facilitate Pn_p. - */ -#define BM_NOTIFY_UNKNOWN ((BM_NOTIFY) 0x00) -#define BM_NOTIFY_DEVICE_ADDED ((BM_NOTIFY) 0x01) -#define BM_NOTIFY_DEVICE_REMOVED ((BM_NOTIFY) 0x02) - - -/* - * BM_HANDLE: - * ---------- - */ -typedef u32 BM_HANDLE; - -#define BM_HANDLE_ROOT ((BM_HANDLE) 0x00000000) -#define BM_HANDLE_UNKNOWN ((BM_HANDLE) 0xFFFFFFFF) -#define BM_HANDLES_MAX 100 - - -/* - * BM_HANDLE_LIST: - * --------------- - */ -typedef struct -{ - u32 count; - BM_HANDLE handles[BM_HANDLES_MAX]; -} BM_HANDLE_LIST; - - -/* - * BM_DEVICE_TYPE: - * --------------- - */ -typedef u32 BM_DEVICE_TYPE; - -#define BM_TYPE_UNKNOWN ((BM_DEVICE_TYPE) 0x00000000) - -#define BM_TYPE_SYSTEM ((BM_DEVICE_TYPE) 0x00000001) -#define BM_TYPE_SCOPE ((BM_DEVICE_TYPE) 0x00000002) -#define BM_TYPE_PROCESSOR ((BM_DEVICE_TYPE) 0x00000003) -#define BM_TYPE_THERMAL_ZONE ((BM_DEVICE_TYPE) 0x00000004) -#define BM_TYPE_POWER_RESOURCE ((BM_DEVICE_TYPE) 0x00000005) -#define BM_TYPE_DEVICE ((BM_DEVICE_TYPE) 0x00000006) -#define BM_TYPE_FIXED_BUTTON ((BM_DEVICE_TYPE) 0x00000007) - - -/* - * BM_DEVICE_UID: - * -------------- - */ -typedef char BM_DEVICE_UID[9]; - -#define BM_UID_UNKNOWN '0' - - -/* - * BM_DEVICE_HID: - * -------------- - */ -typedef char BM_DEVICE_HID[9]; - -#define BM_HID_UNKNOWN '\0' -#define BM_HID_POWER_BUTTON "PNP0C0C" -#define BM_HID_SLEEP_BUTTON "PNP0C0E" - -/* - * BM_DEVICE_ADR: - * -------------- - */ -typedef u32 BM_DEVICE_ADR; - -#define BM_ADDRESS_UNKNOWN 0 - - -/* - * BM_DEVICE_FLAGS: - * ---------------- - * The encoding of BM_DEVICE_FLAGS is illustrated below. - * Note that a set bit (1) indicates the property is TRUE - * (e.g. if bit 0 is set then the device has dynamic status). - * +--+------------+-+-+-+-+-+-+-+ - * |31| Bits 30:7 |6|5|4|3|2|1|0| - * +--+------------+-+-+-+-+-+-+-+ - * | | | | | | | | | - * | | | | | | | | +- Dynamic status? - * | | | | | | | +--- Identifiable? - * | | | | | | +----- Configurable? - * | | | | | +------- Power Control? - * | | | | +--------- Ejectable? - * | | | +----------- Docking Station? - * | | +------------- Fixed-Feature? - * | +-------------------- - * +---------------------------- Driver Control? - * - * Dynamic status: Device has a _STA object. - * Identifiable: Device has a _HID and/or _ADR and possibly other - * identification objects defined. - * Configurable: Device has a _CRS and possibly other configuration - * objects defined. - * Power Control: Device has a _PR0 and/or _PS0 and possibly other - * power management objects defined. - * Ejectable: Device has an _EJD and/or _EJx and possibly other - * dynamic insertion/removal objects defined. - * Docking Station: Device has a _DCK object defined. - * Fixed-Feature: Device does not exist in the namespace; was - * enumerated as a fixed-feature (e.g. power button). - * Driver Control: A driver has been installed for this device. - */ -typedef u32 BM_DEVICE_FLAGS; - -#define BM_FLAGS_UNKNOWN ((BM_DEVICE_FLAGS) 0x00000000) - -#define BM_FLAGS_DYNAMIC_STATUS ((BM_DEVICE_FLAGS) 0x00000001) -#define BM_FLAGS_IDENTIFIABLE ((BM_DEVICE_FLAGS) 0x00000002) -#define BM_FLAGS_CONFIGURABLE ((BM_DEVICE_FLAGS) 0x00000004) -#define BM_FLAGS_POWER_CONTROL ((BM_DEVICE_FLAGS) 0x00000008) -#define BM_FLAGS_EJECTABLE ((BM_DEVICE_FLAGS) 0x00000010) -#define BM_FLAGS_DOCKING_STATION ((BM_DEVICE_FLAGS) 0x00000020) -#define BM_FLAGS_FIXED_FEATURE ((BM_DEVICE_FLAGS) 0x00000040) -#define BM_FLAGS_DRIVER_CONTROL ((BM_DEVICE_FLAGS) 0x80000000) - - -/* - * Device PM Flags: - * ---------------- - * +-----------+-+-+-+-+-+-+-+ - * | Bits 31:7 |6|5|4|3|2|1|0| - * +-----------+-+-+-+-+-+-+-+ - * | | | | | | | | - * | | | | | | | +- D0 Support? - * | | | | | | +--- D1 Support? - * | | | | | +----- D2 Support? - * | | | | +------- D3 Support? - * | | | +--------- Power State Queriable? - * | | +----------- Inrush Current? - * | +------------- Wake Capable? - * +-------------------- - * - * D0-D3 Support: Device supports corresponding Dx state. - * Power State: Device has a _PSC (current power state) object defined. - * Inrush Current: Device has an _IRC (inrush current) object defined. - * Wake Capable: Device has a _PRW (wake-capable) object defined. - */ -#define BM_FLAGS_D0_SUPPORT ((BM_DEVICE_FLAGS) 0x00000001) -#define BM_FLAGS_D1_SUPPORT ((BM_DEVICE_FLAGS) 0x00000002) -#define BM_FLAGS_D2_SUPPORT ((BM_DEVICE_FLAGS) 0x00000004) -#define BM_FLAGS_D3_SUPPORT ((BM_DEVICE_FLAGS) 0x00000008) -#define BM_FLAGS_POWER_STATE ((BM_DEVICE_FLAGS) 0x00000010) -#define BM_FLAGS_INRUSH_CURRENT ((BM_DEVICE_FLAGS) 0x00000020) -#define BM_FLAGS_WAKE_CAPABLE ((BM_DEVICE_FLAGS) 0x00000040) - - -/* - * BM_DEVICE_STATUS: - * ----------------- - * The encoding of BM_DEVICE_STATUS is illustrated below. - * Note that a set bit (1) indicates the property is TRUE - * (e.g. if bit 0 is set then the device is present). - * +-----------+-+-+-+-+-+ - * | Bits 31:4 |4|3|2|1|0| - * +-----------+-+-+-+-+-+ - * | | | | | | - * | | | | | +- Present? - * | | | | +--- Enabled? - * | | | +----- Show in UI? - * | | +------- Functioning? - * | +--------- Battery Present? - * +---------------- - */ -typedef u32 BM_DEVICE_STATUS; - -#define BM_STATUS_UNKNOWN ((BM_DEVICE_STATUS) 0x00000000) -#define BM_STATUS_PRESENT ((BM_DEVICE_STATUS) 0x00000001) -#define BM_STATUS_ENABLED ((BM_DEVICE_STATUS) 0x00000002) -#define BM_STATUS_SHOW_UI ((BM_DEVICE_STATUS) 0x00000004) -#define BM_STATUS_FUNCTIONING ((BM_DEVICE_STATUS) 0x00000008) -#define BM_STATUS_BATTERY_PRESENT ((BM_DEVICE_STATUS) 0x00000010) -#define BM_STATUS_DEFAULT ((BM_DEVICE_STATUS) 0x0000000F) - - -/* - * BM_POWER_STATE: - * --------------- - */ -typedef u32 BM_POWER_STATE; - - -/* - * BM_DEVICE_ID: - * ------------- - */ -typedef struct -{ - BM_DEVICE_TYPE type; - BM_DEVICE_UID uid; - BM_DEVICE_HID hid; - BM_DEVICE_ADR adr; -} BM_DEVICE_ID; - - -/* - * BM_DEVICE_POWER: - * ---------------- - * Structure containing basic device power management information. - */ -typedef struct -{ - BM_DEVICE_FLAGS flags; - BM_POWER_STATE state; - BM_DEVICE_FLAGS dx_supported[ACPI_S_STATE_COUNT]; -} BM_DEVICE_POWER; - - -/* - * BM_DEVICE: - * ---------- - */ -typedef struct -{ - BM_HANDLE handle; - acpi_handle acpi_handle; - BM_DEVICE_FLAGS flags; - BM_DEVICE_STATUS status; - BM_DEVICE_ID id; - BM_DEVICE_POWER power; -} BM_DEVICE; - - -/* - * BM_SEARCH: - * ---------- - * Structure used for searching the ACPI Bus Manager's device hierarchy. - */ -typedef struct -{ - BM_DEVICE_ID criteria; - BM_HANDLE_LIST results; -} BM_SEARCH; - - -/* - * BM_REQUEST: - * ----------- - * Structure used for sending requests to/through the ACPI Bus Manager. - */ -typedef struct -{ - acpi_status status; - BM_COMMAND command; - BM_HANDLE handle; - acpi_buffer buffer; -} BM_REQUEST; - - -/* - * Driver Registration: - * -------------------- - */ - -/* Driver Context */ -typedef void * BM_DRIVER_CONTEXT; - -/* Notification Callback Function */ -typedef -acpi_status (*BM_DRIVER_NOTIFY) ( - BM_NOTIFY notify_type, - BM_HANDLE device_handle, - BM_DRIVER_CONTEXT *context); - -/* Request Callback Function */ -typedef -acpi_status (*BM_DRIVER_REQUEST) ( - BM_REQUEST *request, - BM_DRIVER_CONTEXT context); - -/* Driver Registration */ -typedef struct -{ - BM_DRIVER_NOTIFY notify; - BM_DRIVER_REQUEST request; - BM_DRIVER_CONTEXT context; -} BM_DRIVER; - - -/* - * BM_NODE: - * -------- - * Structure used to maintain the device hierarchy. - */ -typedef struct _BM_NODE -{ - BM_DEVICE device; - BM_DRIVER driver; - struct _BM_NODE *parent; - struct _BM_NODE *next; - struct - { - struct _BM_NODE *head; - struct _BM_NODE *tail; - } scope; -} BM_NODE; - - -/* - * BM_NODE_LIST: - * ------------- - * Structure used to maintain an array of node pointers. - */ -typedef struct -{ - u32 count; - BM_NODE *nodes[BM_HANDLES_MAX]; -} BM_NODE_LIST; - - -/***************************************************************************** - * Macros - *****************************************************************************/ - -/* - * Device Presence: - * ---------------- - * Note that status (_STA) means something different for power resources - * (they're assumed to always be present). - */ -#define BM_DEVICE_PRESENT(d) ((d->id.type!=BM_TYPE_POWER_RESOURCE)?(d->status & BM_STATUS_PRESENT):TRUE) -#define BM_NODE_PRESENT(n) ((n->device.id.type!=BM_TYPE_POWER_RESOURCE)?(n->device.status & BM_STATUS_PRESENT):TRUE) - -/* - * Device Flags: - * ------------- - */ -#define BM_IS_DRIVER_CONTROL(d) (d->flags & BM_FLAGS_DRIVER_CONTROL) -#define BM_IS_POWER_CONTROL(d) (d->flags & BM_FLAGS_POWER_CONTROL) - - /* - * Device Power Flags: - * ------------------- - */ -#define BM_IS_POWER_STATE(d) (d->power.flags & BM_FLAGS_POWER_STATE) - -/***************************************************************************** - * Function Prototypes - *****************************************************************************/ - -/* bm.c */ - -acpi_status -bm_initialize (void); - -acpi_status -bm_terminate (void); - -acpi_status -bm_get_status ( - BM_DEVICE *device); - -acpi_status -bm_get_handle ( - acpi_handle acpi_handle, - BM_HANDLE *device_handle); - -acpi_status -bm_get_node ( - BM_HANDLE device_handle, - acpi_handle acpi_handle, - BM_NODE **node); - -/* bmsearch.c */ - -acpi_status -bm_search( - BM_HANDLE device_handle, - BM_DEVICE_ID *criteria, - BM_HANDLE_LIST *results); - -/* bmnotify.c */ - -void -bm_notify ( - acpi_handle acpi_handle, - u32 notify_value, - void *context); - -/* bm_request.c */ - -acpi_status -bm_request ( - BM_REQUEST *request_info); - -/* bmdriver.c */ - -acpi_status -bm_get_device_power_state ( - BM_HANDLE device_handle, - BM_POWER_STATE *state); - -acpi_status -bm_set_device_power_state ( - BM_HANDLE device_handle, - BM_POWER_STATE state); - -acpi_status -bm_get_device_status ( - BM_HANDLE device_handle, - BM_DEVICE_STATUS *device_status); - -acpi_status -bm_get_device_info ( - BM_HANDLE device_handle, - BM_DEVICE **device_info); - -acpi_status -bm_get_device_context ( - BM_HANDLE device_handle, - BM_DRIVER_CONTEXT *context); - -acpi_status -bm_register_driver ( - BM_DEVICE_ID *criteria, - BM_DRIVER *driver); - -acpi_status -bm_unregister_driver ( - BM_DEVICE_ID *criteria, - BM_DRIVER *driver); - -/* bmpm.c */ - -acpi_status -bm_get_pm_capabilities ( - BM_NODE *node); - -acpi_status -bm_get_power_state ( - BM_NODE *node); - -acpi_status -bm_set_power_state ( - BM_NODE *node, - BM_POWER_STATE target_state); - -/* bmpower.c */ - -acpi_status -bm_pr_initialize (void); - -acpi_status -bm_pr_terminate (void); - -/* bmutils.c */ - -acpi_status -bm_cast_buffer ( - acpi_buffer *buffer, - void **pointer, - u32 length); - -acpi_status -bm_copy_to_buffer ( - acpi_buffer *buffer, - void *data, - u32 length); - -acpi_status -bm_extract_package_data ( - acpi_object *package, - acpi_buffer *format, - acpi_buffer *buffer); - -acpi_status -bm_evaluate_object ( - acpi_handle acpi_handle, - acpi_string pathname, - acpi_object_list *arguments, - acpi_buffer *buffer); - -acpi_status -bm_evaluate_simple_integer ( - acpi_handle acpi_handle, - acpi_string pathname, - u32 *data); - -acpi_status -bm_evaluate_reference_list ( - acpi_handle acpi_handle, - acpi_string pathname, - BM_HANDLE_LIST *reference_list); - -/* ACPI Bus Driver OSL */ - -acpi_status -bm_osl_generate_event ( - BM_HANDLE device_handle, - char *device_type, - char *device_instance, - u32 event_type, - u32 event_data); - - -#endif /* __BM_H__ */ diff -urN linux-2.4.18/drivers/acpi/ospm/include/bmpower.h lia64-2.4/drivers/acpi/ospm/include/bmpower.h --- linux-2.4.18/drivers/acpi/ospm/include/bmpower.h Mon Sep 24 15:06:44 2001 +++ lia64-2.4/drivers/acpi/ospm/include/bmpower.h Wed Dec 31 16:00:00 1969 @@ -1,75 +0,0 @@ -/***************************************************************************** - * - * Module name: bmpower.h - * $Revision: 9 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __BMPOWER_H__ -#define __BMPOWER_H__ - -#include "bm.h" - - -/***************************************************************************** - * Types & Defines - *****************************************************************************/ - - -/* - * BM_POWER_RESOURCE: - * ------------------ - */ -typedef struct -{ - BM_HANDLE device_handle; - acpi_handle acpi_handle; - BM_POWER_STATE system_level; - u32 resource_order; - BM_POWER_STATE state; - u32 reference_count; -} BM_POWER_RESOURCE; - - -/***************************************************************************** - * Function Prototypes - *****************************************************************************/ - -/* bmpower.c */ - -acpi_status -bm_pr_initialize (void); - -acpi_status -bm_pr_terminate (void); - -acpi_status -bm_pr_list_get_state ( - BM_HANDLE_LIST *resource_list, - BM_POWER_STATE *power_state); - -acpi_status -bm_pr_list_transition ( - BM_HANDLE_LIST *current_list, - BM_HANDLE_LIST *target_list); - - -#endif /* __BMPOWER_H__ */ diff -urN linux-2.4.18/drivers/acpi/ospm/include/bn.h lia64-2.4/drivers/acpi/ospm/include/bn.h --- linux-2.4.18/drivers/acpi/ospm/include/bn.h Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/include/bn.h Wed Dec 31 16:00:00 1969 @@ -1,122 +0,0 @@ -/****************************************************************************** - * - * Module Name: bn.h - * $Revision: 12 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef __BN_H__ -#define __BN_H__ - -#include -#include -#include - - -/***************************************************************************** - * Types & Other Defines - *****************************************************************************/ - -/* - * Notifications: - * --------------------- - */ -#define BN_NOTIFY_STATUS_CHANGE ((BM_NOTIFY) 0x80) - - -/* - * Types: - * ------ - */ -#define BN_TYPE_POWER_BUTTON 0x01 -#define BN_TYPE_POWER_BUTTON_FIXED 0x02 -#define BN_TYPE_SLEEP_BUTTON 0x03 -#define BN_TYPE_SLEEP_BUTTON_FIXED 0x04 -#define BN_TYPE_LID_SWITCH 0x05 - - -/* - * Hardware IDs: - * ------------- - * TBD: Power and Sleep button HIDs also exist in . Should all - * HIDs (ACPI well-known devices) exist in one place (e.g. - * acpi_hid.h)? - */ -#define BN_HID_POWER_BUTTON "PNP0C0C" -#define BN_HID_SLEEP_BUTTON "PNP0C0E" -#define BN_HID_LID_SWITCH "PNP0C0D" - - -/* - * Device Context: - * --------------- - */ -typedef struct -{ - BM_HANDLE device_handle; - acpi_handle acpi_handle; - u32 type; -} BN_CONTEXT; - - -/****************************************************************************** - * Function Prototypes - *****************************************************************************/ - -acpi_status -bn_initialize (void); - -acpi_status -bn_terminate (void); - -acpi_status -bn_notify_fixed ( - void *context); - -acpi_status -bn_notify ( - u32 notify_type, - u32 device, - void **context); - -acpi_status -bn_request( - BM_REQUEST *request_info, - void *context); - -/* Button OSL */ - -acpi_status -bn_osl_add_device ( - BN_CONTEXT *button); - -acpi_status -bn_osl_remove_device ( - BN_CONTEXT *button); - -acpi_status -bn_osl_generate_event ( - u32 event, - BN_CONTEXT *button); - - -#endif /* __BN_H__ */ diff -urN linux-2.4.18/drivers/acpi/ospm/include/bt.h lia64-2.4/drivers/acpi/ospm/include/bt.h --- linux-2.4.18/drivers/acpi/ospm/include/bt.h Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/include/bt.h Wed Dec 31 16:00:00 1969 @@ -1,164 +0,0 @@ -/****************************************************************************** - * - * Module Name: bt.h - * $Revision: 18 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef __BT_H__ -#define __BT_H__ - -#include -#include -#include - - -/***************************************************************************** - * Types & Other Defines - *****************************************************************************/ - -/*! [Begin] no source code translation */ - -#define BT_UNKNOWN 0xFFFFFFFF -#define BT_POWER_UNITS_DEFAULT "?" -#define BT_POWER_UNITS_WATTS "mW" -#define BT_POWER_UNITS_AMPS "mA" - -/*! [End] no source code translation !*/ - -/* - * Battery Notifications: - * ---------------------- - */ -#define BT_NOTIFY_STATUS_CHANGE ((BM_NOTIFY) 0x80) -#define BT_NOTIFY_INFORMATION_CHANGE ((BM_NOTIFY) 0x81) - - -/* - * Hardware IDs: - * ------------- - */ -#define BT_HID_CM_BATTERY "PNP0C0A" - - -/* - * BT_CM_BATTERY_INFO: - * ------------------- - */ -typedef struct -{ - acpi_integer power_unit; - acpi_integer design_capacity; - acpi_integer last_full_capacity; - acpi_integer battery_technology; - acpi_integer design_voltage; - acpi_integer design_capacity_warning; - acpi_integer design_capacity_low; - acpi_integer battery_capacity_granularity_1; - acpi_integer battery_capacity_granularity_2; - acpi_string model_number; - acpi_string serial_number; - acpi_string battery_type; - acpi_string oem_info; - -} BT_BATTERY_INFO; - - -/* - * BT_CM_BATTERY_STATUS: - * --------------------- - */ -typedef struct -{ - acpi_integer state; - acpi_integer present_rate; - acpi_integer remaining_capacity; - acpi_integer present_voltage; - -} BT_BATTERY_STATUS; - - -/* - * BT_CONTEXT: - * ----------- - */ -typedef struct -{ - BM_HANDLE device_handle; - acpi_handle acpi_handle; - char uid[9]; - acpi_string power_units; - u8 is_present; - -} BT_CONTEXT; - - -/***************************************************************************** - * Function Prototypes - *****************************************************************************/ - -/* bt.c */ - -acpi_status -bt_initialize (void); - -acpi_status -bt_terminate (void); - -acpi_status -bt_notify ( - u32 notify_type, - u32 device, - void **context); - -acpi_status -bt_request( - BM_REQUEST *request_info, - void *context); - -acpi_status -bt_get_status ( - BT_CONTEXT *battery, - BT_BATTERY_STATUS **battery_status); - -acpi_status -bt_get_info ( - BT_CONTEXT *battery, - BT_BATTERY_INFO **battery_info); - -/* Battery OSL */ - -acpi_status -bt_osl_add_device ( - BT_CONTEXT *battery); - -acpi_status -bt_osl_remove_device ( - BT_CONTEXT *battery); - -acpi_status -bt_osl_generate_event ( - u32 event, - BT_CONTEXT *battery); - - -#endif /* __BT_H__ */ diff -urN linux-2.4.18/drivers/acpi/ospm/include/ec.h lia64-2.4/drivers/acpi/ospm/include/ec.h --- linux-2.4.18/drivers/acpi/ospm/include/ec.h Mon Sep 24 15:06:44 2001 +++ lia64-2.4/drivers/acpi/ospm/include/ec.h Wed Dec 31 16:00:00 1969 @@ -1,202 +0,0 @@ -/***************************************************************************** - * - * Module Name: ec.h - * $Revision: 19 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef __EC_H__ -#define __EC_H__ - -#include -#include -#include -#include -#include - - -/***************************************************************************** - * Types & Other Defines - *****************************************************************************/ - -#define EC_DEFAULT_TIMEOUT 1000 /* 1 second */ -#define EC_GPE_UNKNOWN 0xFFFFFFFF -#define EC_PORT_UNKNOWN 0x00000000 -#define EC_BURST_ENABLE_ACKNOWLEDGE 0x90 - - -/* - * Commands: - * --------- - */ -typedef u8 EC_COMMAND; - -#define EC_COMMAND_UNKNOWN ((EC_COMMAND) 0x00) -#define EC_COMMAND_READ ((EC_COMMAND) 0x80) -#define EC_COMMAND_WRITE ((EC_COMMAND) 0x81) -#define EC_COMMAND_QUERY ((EC_COMMAND) 0x84) - - -/* - * EC_STATUS: - * ---------- - * The encoding of the EC status register is illustrated below. - * Note that a set bit (1) indicates the property is TRUE - * (e.g. if bit 0 is set then the output buffer is full). - * +-+-+-+-+-+-+-+-+ - * |7|6|5|4|3|2|1|0| - * +-+-+-+-+-+-+-+-+ - * | | | | | | | | - * | | | | | | | +- Output Buffer Full (OBF)? - * | | | | | | +--- Input Buffer Full (IBF)? - * | | | | | +----- - * | | | | +------- data Register is command Byte? - * | | | +--------- Burst Mode Enabled? - * | | +----------- SCI event? - * | +------------- SMI event? - * +--------------- - * - */ -typedef u32 EC_STATUS; - -#define EC_FLAG_OUTPUT_BUFFER ((EC_STATUS) 0x01) -#define EC_FLAG_INPUT_BUFFER ((EC_STATUS) 0x02) -#define EC_FLAG_BURST_MODE ((EC_STATUS) 0x10) -#define EC_FLAG_SCI ((EC_STATUS) 0x20) - - -/* - * EC_EVENT: - * --------- - */ -typedef u32 EC_EVENT; - -#define EC_EVENT_UNKNOWN ((EC_EVENT) 0x00) -#define EC_EVENT_NONE ((EC_EVENT) 0x00) -#define EC_EVENT_OUTPUT_BUFFER_FULL ((EC_EVENT) 0x01) -#define EC_EVENT_INPUT_BUFFER_EMPTY ((EC_EVENT) 0x02) -#define EC_EVENT_SCI ((EC_EVENT) 0x03) - - -/* - * Hardware IDs: - * ------------- - */ -#define EC_HID_EC "PNP0C09" - - -/* - * EC_REQUEST: - * ----------- - */ -typedef struct -{ - EC_COMMAND command; - u8 address; - u8 data; -} EC_REQUEST; - - -/* - * Device Context: - * --------------- - */ -typedef struct -{ - BM_HANDLE device_handle; - acpi_handle acpi_handle; - u32 gpe_bit; - u32 status_port; - u32 command_port; - u32 data_port; - u32 use_global_lock; - u8 query_data; - acpi_handle mutex; -} EC_CONTEXT; - - -/***************************************************************************** - * Function Prototypes - *****************************************************************************/ - -/* ec.c */ - -acpi_status -ec_initialize(void); - -acpi_status -ec_terminate(void); - -acpi_status -ec_notify ( - u32 notify_type, - u32 device, - void **context); - -acpi_status -ec_request( - BM_REQUEST *request_info, - void *context); - -/* ectransx.c */ - -acpi_status -ec_transaction ( - EC_CONTEXT *ec, - EC_REQUEST *ec_request); - -acpi_status -ec_io_read ( - EC_CONTEXT *ec, - u32 io_port, - u8 *data, - EC_EVENT wait_event); - -acpi_status -ec_io_write ( - EC_CONTEXT *ec, - u32 io_port, - u8 data, - EC_EVENT wait_event); - -/* ecgpe.c */ - -acpi_status -ec_install_gpe_handler ( - EC_CONTEXT *ec); - -acpi_status -ec_remove_gpe_handler ( - EC_CONTEXT *ec); - -/* ecspace.c */ - -acpi_status -ec_install_space_handler ( - EC_CONTEXT *ec); - -acpi_status -ec_remove_space_handler ( - EC_CONTEXT *ec); - - -#endif /* __EC_H__ */ diff -urN linux-2.4.18/drivers/acpi/ospm/include/pr.h lia64-2.4/drivers/acpi/ospm/include/pr.h --- linux-2.4.18/drivers/acpi/ospm/include/pr.h Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/include/pr.h Wed Dec 31 16:00:00 1969 @@ -1,265 +0,0 @@ -/****************************************************************************** - * - * Module Name: processor.h - * $Revision: 13 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __PR_H__ -#define __PR_H__ - -#include - - -/***************************************************************************** - * Types & Other Defines - *****************************************************************************/ - - -#define PR_MAX_POWER_STATES 4 -#define PR_MAX_THROTTLE_STATES 8 -#define PR_MAX_PERF_STATES 32 -#define PR_MAX_C2_LATENCY 100 -#define PR_MAX_C3_LATENCY 1000 - - -/* - * Commands: - * --------- - */ -#define PR_COMMAND_GET_POWER_INFO ((BM_COMMAND) 0x80) -#define PR_COMMAND_SET_POWER_INFO ((BM_COMMAND) 0x81) -#define PR_COMMAND_GET_PERF_INFO ((BM_COMMAND) 0x82) -#define PR_COMMAND_GET_PERF_STATE ((BM_COMMAND) 0x83) -#define PR_COMMAND_SET_PERF_LIMIT ((BM_COMMAND) 0x84) - - -/* - * Notifications: - * -------------- - */ -#define PR_NOTIFY_PERF_STATES ((BM_NOTIFY) 0x80) -#define PR_NOTIFY_POWER_STATES ((BM_NOTIFY) 0x81) - - -/* - * Performance Control: - * -------------------- - */ -#define PR_PERF_DEC 0x00 -#define PR_PERF_INC 0x01 -#define PR_PERF_MAX 0xFF - - -/* - * Power States: - * ------------- - */ -#define PR_C0 0x00 -#define PR_C1 0x01 -#define PR_C2 0x02 -#define PR_C3 0x03 - -#define PR_C1_FLAG 0x01; -#define PR_C2_FLAG 0x02; -#define PR_C3_FLAG 0x04; - - -/* - * PR_CX_POLICY_VALUES: - * -------------------- - */ -typedef struct -{ - u32 time_threshold; - u32 count_threshold; - u32 bm_threshold; - u32 target_state; - u32 count; -} PR_CX_POLICY_VALUES; - - -/* - * PR_CX: - * ------ - */ -typedef struct -{ - u32 latency; - u32 utilization; - u8 is_valid; - PR_CX_POLICY_VALUES promotion; - PR_CX_POLICY_VALUES demotion; -} PR_CX; - - -/* - * PR_POWER: - * --------- - */ -typedef struct -{ - ACPI_PHYSICAL_ADDRESS p_lvl2; - ACPI_PHYSICAL_ADDRESS p_lvl3; - u32 bm_activity; - u32 active_state; - u32 default_state; - u32 busy_metric; - u32 state_count; - PR_CX state[PR_MAX_POWER_STATES]; -} PR_POWER; - - -/* - * PR_PERFORMANCE_STATE: - * --------------------- - */ -typedef struct -{ - u32 performance; - u32 power; -} PR_PERFORMANCE_STATE; - - -/* - * PR_PERFORMANCE: - * --------------- - */ -typedef struct -{ - u32 active_state; - u32 thermal_limit; - u32 power_limit; - u32 state_count; - PR_PERFORMANCE_STATE state[PR_MAX_PERF_STATES]; -} PR_PERFORMANCE; - - -/* - * PR_PBLOCK: - * ---------- - */ -typedef struct -{ - u32 length; - ACPI_PHYSICAL_ADDRESS address; -} PR_PBLOCK; - - -/* - * PR_CONTEXT: - * ----------- - */ -typedef struct -{ - BM_HANDLE device_handle; - acpi_handle acpi_handle; - u32 uid; - PR_PBLOCK pblk; - PR_POWER power; - PR_PERFORMANCE performance; -} PR_CONTEXT; - - -/****************************************************************************** - * Function Prototypes - *****************************************************************************/ - -/* processor.c */ - -acpi_status -pr_initialize(void); - -acpi_status -pr_terminate(void); - -acpi_status -pr_notify ( - BM_NOTIFY notify_type, - BM_HANDLE device_handle, - void **context); - -acpi_status -pr_request( - BM_REQUEST *request, - void *context); - -/* prpower.c */ - -void -pr_power_idle (void); - -acpi_status -pr_power_add_device ( - PR_CONTEXT *processor); - -acpi_status -pr_power_remove_device ( - PR_CONTEXT *processor); - -acpi_status -pr_power_initialize (void); - -acpi_status -pr_power_terminate (void); - -/* prperf.c */ - -acpi_status -pr_perf_get_state ( - PR_CONTEXT *processor, - u32 *state); - -acpi_status -pr_perf_set_state ( - PR_CONTEXT *processor, - u32 state); - -acpi_status -pr_perf_set_limit ( - PR_CONTEXT *processor, - u32 limit); - -acpi_status -pr_perf_add_device ( - PR_CONTEXT *processor); - -acpi_status -pr_perf_remove_device ( - PR_CONTEXT *processor); - -/* Processor Driver OSL */ - -acpi_status -pr_osl_add_device ( - PR_CONTEXT *processor); - -acpi_status -pr_osl_remove_device ( - PR_CONTEXT *processor); - -acpi_status -pr_osl_generate_event ( - u32 event, - PR_CONTEXT *processor); - - -#endif /* __PR_H__ */ diff -urN linux-2.4.18/drivers/acpi/ospm/include/sm.h lia64-2.4/drivers/acpi/ospm/include/sm.h --- linux-2.4.18/drivers/acpi/ospm/include/sm.h Mon Sep 24 15:06:44 2001 +++ lia64-2.4/drivers/acpi/ospm/include/sm.h Wed Dec 31 16:00:00 1969 @@ -1,91 +0,0 @@ -/***************************************************************************** - * - * Module Name: sm.h - * $Revision: 3 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef __SM_H__ -#define __SM_H__ - -#include -#include -#include - - -/***************************************************************************** - * Types & Other Defines - *****************************************************************************/ - -#define SM_MAX_SYSTEM_STATES 6 /* S0-S5 */ - - - /* - * Device Context: - * --------------- - */ -typedef struct -{ - BM_HANDLE device_handle; - acpi_handle acpi_handle; - u8 states[SM_MAX_SYSTEM_STATES]; -} SM_CONTEXT; - - -/***************************************************************************** - * Function Prototypes - *****************************************************************************/ - -acpi_status -sm_initialize (void); - -acpi_status -sm_terminate (void); - -acpi_status -sm_notify ( - u32 notify_type, - u32 device, - void **context); - -acpi_status -sm_request( - BM_REQUEST *request_info, - void *context); - -/* System Driver OSL */ - -acpi_status -sm_osl_add_device ( - SM_CONTEXT *system); - -acpi_status -sm_osl_remove_device ( - SM_CONTEXT *system); - -acpi_status -sm_osl_generate_event ( - u32 event, - SM_CONTEXT *system); - - -#endif /* __SM_H__ */ diff -urN linux-2.4.18/drivers/acpi/ospm/include/tz.h lia64-2.4/drivers/acpi/ospm/include/tz.h --- linux-2.4.18/drivers/acpi/ospm/include/tz.h Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/include/tz.h Wed Dec 31 16:00:00 1969 @@ -1,252 +0,0 @@ -/***************************************************************************** - * - * Module Name: tz.h - * $Revision: 24 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TZ_H__ -#define __TZ_H__ - -/* TBD: Linux-specific */ -#include -#include - -#include -#include - - -/***************************************************************************** - * Types & Other Defines - *****************************************************************************/ - -#define TZ_MAX_THRESHOLDS 12 /* _AC0 through _AC9 + _CRT + _PSV */ -#define TZ_MAX_ACTIVE_THRESHOLDS 10 /* _AC0 through _AC9 */ -#define TZ_MAX_COOLING_DEVICES 10 /* TBD: Make size dynamic */ - - -/* - * Notifications: - * -------------- - */ -#define TZ_NOTIFY_TEMPERATURE_CHANGE ((BM_NOTIFY) 0x80) -#define TZ_NOTIFY_THRESHOLD_CHANGE ((BM_NOTIFY) 0x81) -#define TZ_NOTIFY_DEVICE_LISTS_CHANGE ((BM_NOTIFY) 0x82) - - -/* - * TZ_THRESHOLD_TYPE: - * ------------------ - */ -typedef u32 TZ_THRESHOLD_TYPE; - -#define TZ_THRESHOLD_UNKNOWN ((TZ_THRESHOLD_TYPE) 0x00) -#define TZ_THRESHOLD_CRITICAL ((TZ_THRESHOLD_TYPE) 0x01) - -#define TZ_THRESHOLD_PASSIVE ((TZ_THRESHOLD_TYPE) 0x02) -#define TZ_THRESHOLD_ACTIVE ((TZ_THRESHOLD_TYPE) 0x03) - - -/* - * TZ_COOLING_STATE: - * ----------------- - */ -typedef u32 TZ_COOLING_STATE; - -#define TZ_COOLING_UNKNOWN ((TZ_COOLING_STATE) 0x00) -#define TZ_COOLING_ENABLED ((TZ_COOLING_STATE) 0x01) -#define TZ_COOLING_DISABLED ((TZ_COOLING_STATE) 0x02) - - -/* - * TZ_COOLING_MODE: - * ---------------- - */ -typedef u32 TZ_COOLING_MODE; - -#define TZ_COOLING_MODE_ACTIVE ((TZ_COOLING_MODE) 0x00) -#define TZ_COOLING_MODE_PASSIVE ((TZ_COOLING_MODE) 0x01) - - -/* - * Thermal State: - * -------------- - * The encoding of TZ_STATE is illustrated below. - * Note that a set bit (1) indicates the property is TRUE - * (e.g. if bit 0 is set then the device has dynamic status). - * No bits set indicates an OK cooling state. - * +--+--+--+-----------+----------+ - * |31|30|29| Bits 27:4 | Bits 3:0 | - * +--+--+--+-----------+----------+ - * | | | | | - * | | | | +------ Active Index - * | | | +----------------- - * | | +------------------------- Active - * | +---------------------------- Passive - * +------------------------------- Critical - * - * Active Index: Value representing the level of active cooling - * presently applied (e.g. 0=_AL0, 9=_AL9). Only - * valid when 'Active' is set. - * Active: If set, indicates that the system temperature - * has crossed at least one active threshold (_ALx). - * Passive: If set, indicates that the system temperature - * has crossed the passive threshold (_PSL). - * Passive: If set, indicates that the system temperature - * has crossed the critical threshold (_CRT). - */ -typedef u32 TZ_STATE; - -#define TZ_STATE_OK ((TZ_STATE) 0x00000000) -#define TZ_STATE_HOT ((TZ_STATE) 0x10000000) -#define TZ_STATE_ACTIVE ((TZ_STATE) 0x20000000) -#define TZ_STATE_PASSIVE ((TZ_STATE) 0x40000000) -#define TZ_STATE_CRITICAL ((TZ_STATE) 0x80000000) - -typedef struct { - u32 temperature; -} TZ_CRITICAL_THRESHOLD; - -typedef struct { - u8 is_valid; - u32 temperature; -} TZ_HOT_THRESHOLD; - -typedef struct { - u8 is_valid; - u32 temperature; - u32 tc1; - u32 tc2; - u32 tsp; - BM_HANDLE_LIST devices; -} TZ_PASSIVE_THRESHOLD; - -typedef struct { - u8 is_valid; - u32 temperature; - TZ_COOLING_STATE cooling_state; - BM_HANDLE_LIST devices; -} TZ_ACTIVE_THRESHOLD; - -typedef struct { - TZ_CRITICAL_THRESHOLD critical; - TZ_HOT_THRESHOLD hot; - TZ_PASSIVE_THRESHOLD passive; - TZ_ACTIVE_THRESHOLD active[TZ_MAX_ACTIVE_THRESHOLDS]; -} TZ_THRESHOLDS; - -/* - * TZ_POLICY: - * --------- - */ -typedef struct { - u32 temperature; - TZ_STATE state; - TZ_COOLING_MODE cooling_mode; - u32 polling_freq; - TZ_THRESHOLDS thresholds; - struct timer_list timer; -} TZ_POLICY; - - -/* - * TZ_CONTEXT: - * ----------- - */ -typedef struct { - BM_HANDLE device_handle; - acpi_handle acpi_handle; - char uid[9]; - TZ_POLICY policy; -} TZ_CONTEXT; - - -/***************************************************************************** - * Function Prototypes - *****************************************************************************/ - -/* tz.c */ - -acpi_status -tz_initialize (void); - -acpi_status -tz_terminate (void); - -acpi_status -tz_notify ( - BM_NOTIFY notify_type, - BM_HANDLE device_handle, - BM_DRIVER_CONTEXT *context); - -acpi_status -tz_request ( - BM_REQUEST *request, - BM_DRIVER_CONTEXT context); - -acpi_status -tz_get_temperature ( - TZ_CONTEXT *tz); - -acpi_status -tz_get_thresholds ( - TZ_CONTEXT *tz); - -acpi_status -tz_set_cooling_preference ( - TZ_CONTEXT *tz, - TZ_COOLING_MODE cooling_mode); - -void -tz_print ( - TZ_CONTEXT *tz); - -/* tzpolicy.c */ - -acpi_status -tz_policy_add_device ( - TZ_CONTEXT *tz); - -acpi_status -tz_policy_remove_device ( - TZ_CONTEXT *tz); - -void -tz_policy_check ( - void *context); - -/* tz_osl.c */ - -acpi_status -tz_osl_add_device ( - TZ_CONTEXT *tz); - -acpi_status -tz_osl_remove_device ( - TZ_CONTEXT *tz); - -acpi_status -tz_osl_generate_event ( - u32 event, - TZ_CONTEXT *tz); - - -#endif /* __TZ_H__ */ diff -urN linux-2.4.18/drivers/acpi/ospm/processor/Makefile lia64-2.4/drivers/acpi/ospm/processor/Makefile --- linux-2.4.18/drivers/acpi/ospm/processor/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/ospm/processor/Makefile Wed Dec 31 16:00:00 1969 @@ -1,6 +0,0 @@ -O_TARGET := ospm_$(notdir $(CURDIR)).o -obj-m := $(O_TARGET) -EXTRA_CFLAGS += $(ACPI_CFLAGS) -obj-y := $(patsubst %.c,%.o,$(wildcard *.c)) - -include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/drivers/acpi/ospm/processor/pr.c lia64-2.4/drivers/acpi/ospm/processor/pr.c --- linux-2.4.18/drivers/acpi/ospm/processor/pr.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/processor/pr.c Wed Dec 31 16:00:00 1969 @@ -1,497 +0,0 @@ -/***************************************************************************** - * - * Module Name: pr.c - * $Revision: 34 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include -#include "pr.h" - - -#define _COMPONENT ACPI_PROCESSOR - MODULE_NAME ("pr") - - -/**************************************************************************** - * Globals - ****************************************************************************/ - -extern fadt_descriptor_rev2 acpi_fadt; - - -/**************************************************************************** - * Internal Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: pr_print - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Prints out information on a specific thermal zone. - * - ****************************************************************************/ - -void -pr_print ( - PR_CONTEXT *processor) -{ -#ifdef ACPI_DEBUG - acpi_buffer buffer; - - FUNCTION_TRACE("pr_print"); - - buffer.length = 256; - buffer.pointer = acpi_os_callocate(buffer.length); - if (!buffer.pointer) { - return; - } - - /* - * Get the full pathname for this ACPI object. - */ - acpi_get_name(processor->acpi_handle, ACPI_FULL_PATHNAME, &buffer); - - /* - * Print out basic processor information. - */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Processor[%02x]:[%p] uid[%02x] %s\n", processor->device_handle, processor->acpi_handle, processor->uid, (char*)buffer.pointer)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| power: %cC0 %cC1 %cC2[%d] %cC3[%d]\n", (processor->power.state[0].is_valid?'+':'-'), (processor->power.state[1].is_valid?'+':'-'), (processor->power.state[2].is_valid?'+':'-'), processor->power.state[2].latency, (processor->power.state[3].is_valid?'+':'-'), processor->power.state[3].latency)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| performance: states[%d]\n", processor->performance.state_count)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - - acpi_os_free(buffer.pointer); -#endif /* ACPI_DEBUG */ - - return; -} - - -/**************************************************************************** - * - * FUNCTION: pr_add_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -pr_add_device( - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - PR_CONTEXT *processor = NULL; - BM_DEVICE *device = NULL; - acpi_buffer buffer; - acpi_object acpi_object; - static u32 processor_count = 0; - - - FUNCTION_TRACE("pr_add_device"); - - if (!context || *context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - status = bm_get_device_info(device_handle, &device); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - processor = acpi_os_callocate(sizeof(PR_CONTEXT)); - if (!processor) { - return AE_NO_MEMORY; - } - - processor->device_handle = device->handle; - processor->acpi_handle = device->acpi_handle; - - /* - * Processor Block: - * ---------------- - */ - memset(&acpi_object, 0, sizeof(acpi_object)); - - buffer.length = sizeof(acpi_object); - buffer.pointer = &acpi_object; - - status = acpi_evaluate_object(processor->acpi_handle, NULL, NULL, &buffer); - if (ACPI_FAILURE(status)) { - goto end; - } - - /* - * Processor ID: - * ------------- - * TBD: We need to synchronize the processor ID values in ACPI - * with those of the APIC. For example, an IBM T20 has a - * proc_id value of '1', where the Linux value for the - * first CPU on this system is '0'. Since x86 CPUs are - * mapped 1:1 we can simply use a zero-based counter. Note - * that this assumes that processor objects are enumerated - * in the proper order. - */ - /* processor->uid = acpi_object.processor.proc_id; */ - processor->uid = processor_count++; - - processor->pblk.length = acpi_object.processor.pblk_length; - processor->pblk.address = acpi_object.processor.pblk_address; - - status = pr_power_add_device(processor); - if (ACPI_FAILURE(status)) { - goto end; - } - - status = pr_perf_add_device(processor); - if (ACPI_FAILURE(status)) { - goto end; - } - - status = pr_osl_add_device(processor); - if (ACPI_FAILURE(status)) { - goto end; - } - - *context = processor; - - pr_print(processor); - -end: - if (ACPI_FAILURE(status)) { - acpi_os_free(processor); - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: pr_remove_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -pr_remove_device ( - void **context) -{ - acpi_status status = AE_OK; - PR_CONTEXT *processor= NULL; - - FUNCTION_TRACE("pr_remove_device"); - - if (!context || !*context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - processor = (PR_CONTEXT*)(*context); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing processor device [%02x].\n", processor->device_handle)); - - pr_osl_remove_device(processor); - - pr_perf_remove_device(processor); - - pr_power_remove_device(processor); - - acpi_os_free(processor); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: pr_initialize - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -pr_initialize (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("pr_initialize"); - - memset(&criteria, 0, sizeof(BM_DEVICE_ID)); - memset(&driver, 0, sizeof(BM_DRIVER)); - - /* - * Initialize power (Cx state) policy. - */ - status = pr_power_initialize(); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Register driver for processor devices. - */ - criteria.type = BM_TYPE_PROCESSOR; - - driver.notify = &pr_notify; - driver.request = &pr_request; - - status = bm_register_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: pr_terminate - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -pr_terminate (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("pr_terminate"); - - memset(&criteria, 0, sizeof(BM_DEVICE_ID)); - memset(&driver, 0, sizeof(BM_DRIVER)); - - /* - * Terminate power (Cx state) policy. - */ - status = pr_power_terminate(); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Unegister driver for processor devices. - */ - criteria.type = BM_TYPE_PROCESSOR; - - driver.notify = &pr_notify; - driver.request = &pr_request; - - status = bm_unregister_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: pr_notify - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -pr_notify ( - BM_NOTIFY notify_type, - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - PR_CONTEXT *processor = NULL; - - FUNCTION_TRACE("pr_notify"); - - processor = (PR_CONTEXT*)*context; - - switch (notify_type) { - - case BM_NOTIFY_DEVICE_ADDED: - status = pr_add_device(device_handle, context); - break; - - case BM_NOTIFY_DEVICE_REMOVED: - status = pr_remove_device(context); - break; - - case PR_NOTIFY_PERF_STATES: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Performance states change event detected on processor [%02x].\n", device_handle)); - /* TBD: Streamline (this is simple but overkill). */ - status = pr_perf_remove_device(processor); - if (ACPI_SUCCESS(status)) { - status = pr_perf_add_device(processor); - } - if (ACPI_SUCCESS(status)) { - status = pr_osl_generate_event(notify_type, - (processor)); - } - break; - - case PR_NOTIFY_POWER_STATES: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Power states change event detected on processor [%02x].\n", device_handle)); - /* TBD: Streamline (this is simple but overkill). */ - status = pr_power_remove_device(processor); - if (ACPI_SUCCESS(status)) { - status = pr_power_add_device(processor); - } - if (ACPI_SUCCESS(status)) { - status = pr_osl_generate_event(notify_type, - (processor)); - } - break; - - default: - status = AE_SUPPORT; - break; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: pr_request - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -pr_request ( - BM_REQUEST *request, - void *context) -{ - acpi_status status = AE_OK; - PR_CONTEXT *processor = NULL; - - FUNCTION_TRACE("pr_request"); - - /* - * Must have a valid request structure and context. - */ - if (!request || !context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - processor = (PR_CONTEXT*)context; - - /* - * Handle request: - * --------------- - */ - switch (request->command) { - - case PR_COMMAND_GET_POWER_INFO: - status = bm_copy_to_buffer(&(request->buffer), - &(processor->power), sizeof(PR_POWER)); - break; - - case PR_COMMAND_SET_POWER_INFO: - { - PR_POWER *power_info = NULL; - u32 i = 0; - - status = bm_cast_buffer(&(request->buffer), - (void**)&power_info, sizeof(PR_POWER)); - if (ACPI_SUCCESS(status)) { - for (i=0; ipower.state_count; i++) { - MEMCPY(&(processor->power.state[i].promotion), - &(power_info->state[i].promotion), - sizeof(PR_CX_POLICY_VALUES)); - MEMCPY(&(processor->power.state[i].demotion), - &(power_info->state[i].demotion), - sizeof(PR_CX_POLICY_VALUES)); - } - } - } - break; - - case PR_COMMAND_GET_PERF_INFO: - status = bm_copy_to_buffer(&(request->buffer), - &(processor->performance), sizeof(PR_PERFORMANCE)); - break; - - case PR_COMMAND_GET_PERF_STATE: - status = bm_copy_to_buffer(&(request->buffer), - &(processor->performance.active_state), sizeof(u32)); - break; - - case PR_COMMAND_SET_PERF_LIMIT: - { - u32 *limit = NULL; - - status = bm_cast_buffer(&(request->buffer), - (void**)&limit, sizeof(u32)); - if (ACPI_SUCCESS(status)) { - status = pr_perf_set_limit(processor, *limit); - } - } - break; - - default: - status = AE_SUPPORT; - break; - } - - request->status = status; - - return_ACPI_STATUS(status); -} diff -urN linux-2.4.18/drivers/acpi/ospm/processor/pr_osl.c lia64-2.4/drivers/acpi/ospm/processor/pr_osl.c --- linux-2.4.18/drivers/acpi/ospm/processor/pr_osl.c Wed Dec 26 16:58:37 2001 +++ lia64-2.4/drivers/acpi/ospm/processor/pr_osl.c Wed Dec 31 16:00:00 1969 @@ -1,344 +0,0 @@ -/****************************************************************************** - * - * Module Name: pr_osl.c - * $Revision: 21 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include "pr.h" - - -MODULE_AUTHOR("Andrew Grover"); -MODULE_DESCRIPTION("ACPI Component Architecture (CA) - IA32 Processor Driver"); -MODULE_LICENSE("GPL"); - - -#define PR_PROC_ROOT "processor" -#define PR_PROC_STATUS "status" -#define PR_PROC_INFO "info" - -extern struct proc_dir_entry *bm_proc_root; -static struct proc_dir_entry *pr_proc_root = NULL; -extern unsigned short acpi_piix4_bmisx; - - -/**************************************************************************** - * - * FUNCTION: pr_osl_proc_read_status - * - ****************************************************************************/ - -static int -pr_osl_proc_read_status ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *context) -{ - PR_CONTEXT *processor = NULL; - char *p = page; - int len = 0; - - if (!context || (off != 0)) { - goto end; - } - - processor = (PR_CONTEXT*)context; - - p += sprintf(p, "Bus Mastering Activity: %08x\n", - processor->power.bm_activity); - - p += sprintf(p, "C-State Utilization: C1[%d] C2[%d] C3[%d]\n", - processor->power.state[PR_C1].utilization, - processor->power.state[PR_C2].utilization, - processor->power.state[PR_C3].utilization); - -end: - len = (p - page); - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - - return(len); -} - - -/**************************************************************************** - * - * FUNCTION: pr_osl_proc_read_info - * - ****************************************************************************/ - -static int -pr_osl_proc_read_info ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *context) -{ - PR_CONTEXT *processor = NULL; - char *p = page; - int len = 0; - - if (!context || (off != 0)) { - goto end; - } - - processor = (PR_CONTEXT*)context; - - p += sprintf(p, "\n"); - -end: - len = (p - page); - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - - return(len); -} - - -/**************************************************************************** - * - * FUNCTION: pr_osl_add_device - * - ****************************************************************************/ - -acpi_status -pr_osl_add_device( - PR_CONTEXT *processor) -{ - u32 i = 0; - struct proc_dir_entry *proc_entry = NULL, *proc; - char processor_uid[16]; - - if (!processor) { - return(AE_BAD_PARAMETER); - } - - printk("Processor[%x]:", processor->uid); - for (i=0; ipower.state_count; i++) { - if (processor->power.state[i].is_valid) { - printk(" C%d", i); - } - } - if (processor->performance.state_count > 1) - printk(", %d throttling states", processor->performance.state_count); - if (acpi_piix4_bmisx && processor->power.state[3].is_valid) - printk(" (PIIX errata enabled)"); - printk("\n"); - - sprintf(processor_uid, "%d", processor->uid); - - proc_entry = proc_mkdir(processor_uid, pr_proc_root); - if (!proc_entry) - return(AE_ERROR); - - proc = create_proc_read_entry(PR_PROC_STATUS, S_IFREG | S_IRUGO, - proc_entry, pr_osl_proc_read_status, (void*)processor); - if (!proc_entry) - return(AE_ERROR); - - proc = create_proc_read_entry(PR_PROC_INFO, S_IFREG | S_IRUGO, - proc_entry, pr_osl_proc_read_info, (void*)processor); - if (!proc_entry) - return(AE_ERROR); - - return(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: pr_osl_remove_device - * - ****************************************************************************/ - -acpi_status -pr_osl_remove_device ( - PR_CONTEXT *processor) -{ - char proc_entry[64]; - - if (!processor) { - return(AE_BAD_PARAMETER); - } - - sprintf(proc_entry, "%d/%s", processor->uid, PR_PROC_INFO); - remove_proc_entry(proc_entry, pr_proc_root); - - sprintf(proc_entry, "%d/%s", processor->uid, PR_PROC_STATUS); - remove_proc_entry(proc_entry, pr_proc_root); - - sprintf(proc_entry, "%d", processor->uid); - remove_proc_entry(proc_entry, pr_proc_root); - - return(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: pr_osl_generate_event - * - ****************************************************************************/ - -acpi_status -pr_osl_generate_event ( - u32 event, - PR_CONTEXT *processor) -{ - acpi_status status = AE_OK; - char processor_uid[16]; - - if (!processor) { - return(AE_BAD_PARAMETER); - } - - switch (event) { - - case PR_NOTIFY_PERF_STATES: - case PR_NOTIFY_POWER_STATES: - sprintf(processor_uid, "%d", processor->uid); - status = bm_osl_generate_event(processor->device_handle, - PR_PROC_ROOT, processor_uid, event, 0); - break; - - default: - return(AE_BAD_PARAMETER); - break; - } - - return(status); -} - - -/**************************************************************************** - * Errata Handling - ****************************************************************************/ - -void acpi_pr_errata (void) -{ - struct pci_dev *dev = NULL; - - while ((dev = pci_find_subsys(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, - PCI_ANY_ID, PCI_ANY_ID, dev))) { - switch (dev->device) { - case PCI_DEVICE_ID_INTEL_82801BA_8: /* PIIX4U4 */ - case PCI_DEVICE_ID_INTEL_82801BA_9: /* PIIX4U3 */ - case PCI_DEVICE_ID_INTEL_82451NX: /* PIIX4NX */ - case PCI_DEVICE_ID_INTEL_82372FB_1: /* PIIX4U2 */ - case PCI_DEVICE_ID_INTEL_82801AA_1: /* PIIX4U */ - case PCI_DEVICE_ID_INTEL_82443MX_1: /* PIIX4E2 */ - case PCI_DEVICE_ID_INTEL_82801AB_1: /* PIIX4E */ - case PCI_DEVICE_ID_INTEL_82371AB: /* PIIX4 */ - acpi_piix4_bmisx = pci_resource_start(dev, 4); - return; - } - } - - return; -} - - -/**************************************************************************** - * - * FUNCTION: pr_osl_init - * - * PARAMETERS: - * - * RETURN: 0: Success - * - * DESCRIPTION: Module initialization. - * - ****************************************************************************/ - -static int __init -pr_osl_init (void) -{ - acpi_status status = AE_OK; - - /* abort if no busmgr */ - if (!bm_proc_root) - return -ENODEV; - - acpi_pr_errata(); - - pr_proc_root = proc_mkdir(PR_PROC_ROOT, bm_proc_root); - if (!pr_proc_root) { - status = AE_ERROR; - } - else { - status = pr_initialize(); - if (ACPI_FAILURE(status)) { - remove_proc_entry(PR_PROC_ROOT, bm_proc_root); - } - - } - - return (ACPI_SUCCESS(status)) ? 0 : -ENODEV; -} - - -/**************************************************************************** - * - * FUNCTION: pr_osl_cleanup - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Module cleanup. - * - ****************************************************************************/ - -static void __exit -pr_osl_cleanup (void) -{ - pr_terminate(); - - if (pr_proc_root) { - remove_proc_entry(PR_PROC_ROOT, bm_proc_root); - } - - return; -} - - -module_init(pr_osl_init); -module_exit(pr_osl_cleanup); diff -urN linux-2.4.18/drivers/acpi/ospm/processor/prperf.c lia64-2.4/drivers/acpi/ospm/processor/prperf.c --- linux-2.4.18/drivers/acpi/ospm/processor/prperf.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/processor/prperf.c Wed Dec 31 16:00:00 1969 @@ -1,456 +0,0 @@ -/***************************************************************************** - * - * Module Name: prperf.c - * $Revision: 21 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * TBD: 1. Support ACPI 2.0 processor performance states (not just throttling). - * 2. Fully implement thermal -vs- power management limit control. - */ - - -#include -#include -#include "pr.h" - -#define _COMPONENT ACPI_PROCESSOR - MODULE_NAME ("prperf") - - -/**************************************************************************** - * Globals - ****************************************************************************/ - -extern fadt_descriptor_rev2 acpi_fadt; -const u32 POWER_OF_2[] = {1,2,4,8,16,32,64,128,256,512}; - - -/**************************************************************************** - * - * FUNCTION: pr_perf_get_frequency - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -pr_perf_get_frequency ( - PR_CONTEXT *processor, - u32 *frequency) { - acpi_status status = AE_OK; - - FUNCTION_TRACE("pr_perf_get_frequency"); - - if (!processor || !frequency) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* TBD: Generic method to calculate processor frequency. */ - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: pr_perf_get_state - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -/* TBD: Include support for _real_ performance states (not just throttling). */ - -acpi_status -pr_perf_get_state ( - PR_CONTEXT *processor, - u32 *state) -{ - u32 pblk_value = 0; - u32 duty_mask = 0; - u32 duty_cycle = 0; - - FUNCTION_TRACE("pr_perf_get_state"); - - if (!processor || !state) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - if (processor->performance.state_count == 1) { - *state = 0; - return_ACPI_STATUS(AE_OK); - } - - acpi_os_read_port(processor->pblk.address, &pblk_value, 32); - - /* - * Throttling Enabled? - * ------------------- - * If so, calculate the current throttling state, otherwise return - * '100% performance' (state 0). - */ - if (pblk_value & 0x00000010) { - - duty_mask = processor->performance.state_count - 1; - duty_mask <<= acpi_fadt.duty_offset; - - duty_cycle = pblk_value & duty_mask; - duty_cycle >>= acpi_fadt.duty_offset; - - if (duty_cycle == 0) { - *state = 0; - } - else { - *state = processor->performance.state_count - - duty_cycle; - } - } - else { - *state = 0; - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Processor [%02x] is at performance state [%d%%].\n", processor->device_handle, processor->performance.state[*state].performance)); - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: pr_perf_set_state - * - * PARAMETERS: - * - * RETURN: AE_OK - * AE_BAD_PARAMETER - * AE_BAD_DATA Invalid target throttling state. - * - * DESCRIPTION: - * - ****************************************************************************/ - -/* TBD: Includes support for _real_ performance states (not just throttling). */ - -acpi_status -pr_perf_set_state ( - PR_CONTEXT *processor, - u32 state) -{ - u32 pblk_value = 0; - u32 duty_mask = 0; - u32 duty_cycle = 0; - u32 i = 0; - - FUNCTION_TRACE ("pr_perf_set_state"); - - if (!processor) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - if (state > (processor->performance.state_count - 1)) { - return_ACPI_STATUS(AE_BAD_DATA); - } - - if ((state == processor->performance.active_state) || - (processor->performance.state_count == 1)) { - return_ACPI_STATUS(AE_OK); - } - - /* - * Calculate Duty Cycle/Mask: - * -------------------------- - * Note that we don't support duty_cycle values that span bit 4. - */ - if (state) { - duty_cycle = processor->performance.state_count - state; - duty_cycle <<= acpi_fadt.duty_offset; - } - else { - duty_cycle = 0; - } - - duty_mask = ~((u32)(processor->performance.state_count - 1)); - for (i=0; ipblk.address, &pblk_value, 32); - if (pblk_value & 0x00000010) { - pblk_value &= 0xFFFFFFEF; - acpi_os_write_port(processor->pblk.address, pblk_value, 32); - } - - /* - * Set Duty Cycle: - * --------------- - * Mask off the old duty_cycle value, mask in the new. - */ - pblk_value &= duty_mask; - pblk_value |= duty_cycle; - acpi_os_write_port(processor->pblk.address, pblk_value, 32); - - /* - * Enable Throttling: - * ------------------ - * But only for non-zero (non-100% performance) states. - */ - if (state) { - pblk_value |= 0x00000010; - acpi_os_write_port(processor->pblk.address, pblk_value, 32); - } - - processor->performance.active_state = state; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Processor [%02x] set to performance state [%d%%].\n", processor->device_handle, processor->performance.state[state].performance)); - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: pr_perf_set_limit - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -pr_perf_set_limit ( - PR_CONTEXT *processor, - u32 limit) -{ - acpi_status status = AE_OK; - PR_PERFORMANCE *performance = NULL; - - FUNCTION_TRACE ("pr_perf_set_limit"); - - if (!processor) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - performance = &(processor->performance); - - /* - * Set Limit: - * ---------- - * TBD: Properly manage thermal and power limits (only set - * performance state iff...). - */ - switch (limit) { - - case PR_PERF_DEC: - if (performance->active_state < - (performance->state_count-1)) { - status = pr_perf_set_state(processor, - (performance->active_state+1)); - } - break; - - case PR_PERF_INC: - if (performance->active_state > 0) { - status = pr_perf_set_state(processor, - (performance->active_state-1)); - } - break; - - case PR_PERF_MAX: - if (performance->active_state != 0) { - status = pr_perf_set_state(processor, 0); - } - break; - - default: - return_ACPI_STATUS(AE_BAD_DATA); - break; - } - - if (ACPI_SUCCESS(status)) { - performance->thermal_limit = performance->active_state; - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Processor [%02x] thermal performance limit set to [%d%%].\n", processor->device_handle, processor->performance.state[performance->active_state].performance)); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: pr_perf_add_device - * - * PARAMETERS: processor Our processor-specific context. - * - * RETURN: AE_OK - * AE_BAD_PARAMETER - * - * DESCRIPTION: Calculates the number of throttling states and the state - * performance/power values. - * - ****************************************************************************/ - -/* TBD: Support duty_cycle values that span bit 4. */ - -acpi_status -pr_perf_add_device ( - PR_CONTEXT *processor) -{ - acpi_status status = AE_OK; - u32 i = 0; - u32 performance_step = 0; - u32 percentage = 0; - - FUNCTION_TRACE("pr_perf_add_device"); - - if (!processor) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Valid PBLK? - * ----------- - * For SMP it is common to have the first (boot) processor have a - * valid PBLK while all others do not -- which implies that - * throttling has system-wide effects (duty_cycle programmed into - * the chipset effects all processors). - */ - if ((processor->pblk.length < 6) || !processor->pblk.address) { - processor->performance.state_count = 1; - } - - /* - * Valid Duty Offset/Width? - * ------------------------ - * We currently only support duty_cycle values that fall within - * bits 0-3, as things get complicated when this value spans bit 4 - * (the throttling enable/disable bit). - */ - else if ((acpi_fadt.duty_offset + acpi_fadt.duty_width) > 4) { - processor->performance.state_count = 1; - } - - /* - * Compute State Count: - * -------------------- - * The number of throttling states is computed as 2^duty_width, - * but limited by PR_MAX_THROTTLE_STATES. Note that a duty_width - * of zero results is one throttling state (100%). - */ - else { - processor->performance.state_count = - POWER_OF_2[acpi_fadt.duty_width]; - } - - if (processor->performance.state_count > PR_MAX_THROTTLE_STATES) { - processor->performance.state_count = PR_MAX_THROTTLE_STATES; - } - - /* - * Compute State Values: - * --------------------- - * Note that clock throttling displays a linear power/performance - * relationship (at 50% performance the CPU will consume 50% power). - */ - performance_step = (1000 / processor->performance.state_count); - - for (i=0; iperformance.state_count; i++) { - percentage = (1000 - (performance_step * i))/10; - processor->performance.state[i].performance = percentage; - processor->performance.state[i].power = percentage; - } - - /* - * Get Current State: - * ------------------ - */ - status = pr_perf_get_state(processor, &(processor->performance.active_state)); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Set to Maximum Performance: - * --------------------------- - * We'll let subsequent policy (e.g. thermal/power) decide to lower - * performance if it so chooses, but for now crank up the speed. - */ - if (0 != processor->performance.active_state) { - status = pr_perf_set_state(processor, 0); - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: pr_perf_remove_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -pr_perf_remove_device ( - PR_CONTEXT *processor) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("pr_perf_remove_device"); - - if (!processor) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - MEMSET(&(processor->performance), 0, sizeof(PR_PERFORMANCE)); - - return_ACPI_STATUS(status); -} - diff -urN linux-2.4.18/drivers/acpi/ospm/processor/prpower.c lia64-2.4/drivers/acpi/ospm/processor/prpower.c --- linux-2.4.18/drivers/acpi/ospm/processor/prpower.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/processor/prpower.c Wed Dec 31 16:00:00 1969 @@ -1,665 +0,0 @@ -/***************************************************************************** - * - * Module Name: prpower.c - * $Revision: 32 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -/* TBD: Linux specific */ -#include -#include -#include - -#include -#include -#include "pr.h" - -#define _COMPONENT ACPI_PROCESSOR - MODULE_NAME ("prpower") - - -/**************************************************************************** - * Globals - ****************************************************************************/ - -extern FADT_DESCRIPTOR acpi_fadt; -static u32 last_idle_jiffies = 0; -static PR_CONTEXT *processor_list[NR_CPUS]; -static void (*pr_pm_idle_save)(void) = NULL; -static u8 bm_control = 0; - - -/* Used for PIIX4 errata handling. */ -unsigned short acpi_piix4_bmisx = 0; - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: pr_power_activate_state - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -void -pr_power_activate_state ( - PR_CONTEXT *processor, - u32 next_state) -{ - - PROC_NAME("pr_power_activate_state"); - - if (!processor) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) context.\n")); - return; - } - - processor->power.state[processor->power.active_state].promotion.count = 0; - processor->power.state[processor->power.active_state].demotion.count = 0; - - /* - * Cleanup from old state. - */ - switch (processor->power.active_state) { - - case PR_C3: - /* Disable bus master reload */ - acpi_hw_register_bit_access(ACPI_WRITE, ACPI_MTX_DO_NOT_LOCK, - BM_RLD, 0); - break; - } - - /* - * Prepare to use new state. - */ - switch (next_state) { - - case PR_C3: - /* Enable bus master reload */ - acpi_hw_register_bit_access(ACPI_WRITE, ACPI_MTX_DO_NOT_LOCK, - BM_RLD, 1); - break; - } - - processor->power.active_state = next_state; - - return; -} - - -/**************************************************************************** - * - * FUNCTION: pr_power_idle - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -void -pr_power_idle (void) -{ - PR_CX *c_state = NULL; - u32 next_state = 0; - u32 start_ticks, end_ticks, time_elapsed; - PR_CONTEXT *processor = NULL; - - PROC_NAME("pr_power_idle"); - - processor = processor_list[smp_processor_id()]; - - if (!processor || processor->power.active_state == PR_C0) { - return; - } - - next_state = processor->power.active_state; - - /* - * Check OS Idleness: - * ------------------ - * If the OS has been busy (hasn't called the idle handler in a while) - * then automatically demote to the default power state (e.g. C1). - * - * TBD: Optimize by having scheduler determine business instead - * of having us try to calculate it. - */ - if (processor->power.active_state != processor->power.default_state) { - if ((jiffies - last_idle_jiffies) >= processor->power.busy_metric) { - next_state = processor->power.default_state; - if (next_state != processor->power.active_state) { - pr_power_activate_state(processor, next_state); - } - } - } - - disable(); - - /* - * Log BM Activity: - * ---------------- - * Read BM_STS and record its value for later use by C3 policy. - * (Note that we save the BM_STS values for the last 32 cycles). - */ - if (bm_control) { - processor->power.bm_activity <<= 1; - if (acpi_hw_register_bit_access(ACPI_READ, ACPI_MTX_DO_NOT_LOCK, BM_STS)) { - processor->power.bm_activity |= 1; - acpi_hw_register_bit_access(ACPI_WRITE, ACPI_MTX_DO_NOT_LOCK, - BM_STS, 1); - } - else if (acpi_piix4_bmisx) { - /* - * PIIX4 Errata: - * ------------- - * This code is a workaround for errata #18 "C3 Power State/ - * BMIDE and Type-F DMA Livelock" from the July '01 PIIX4 - * specification update. Note that BM_STS doesn't always - * reflect the true state of bus mastering activity; forcing - * us to manually check the BMIDEA bit of each IDE channel. - */ - if ((inb_p(acpi_piix4_bmisx + 0x02) & 0x01) || - (inb_p(acpi_piix4_bmisx + 0x0A) & 0x01)) - processor->power.bm_activity |= 1; - } - } - - c_state = &(processor->power.state[processor->power.active_state]); - - c_state->utilization++; - - /* - * Sleep: - * ------ - * Invoke the current Cx state to put the processor to sleep. - */ - switch (processor->power.active_state) { - - case PR_C1: - /* Invoke C1 */ - enable(); halt(); - /* - * TBD: Can't get time duration while in C1, as resumes - * go to an ISR rather than here. - */ - time_elapsed = 0xFFFFFFFF; - break; - - case PR_C2: - /* See how long we're asleep for */ - acpi_get_timer(&start_ticks); - /* Invoke C2 */ - acpi_os_read_port(processor->power.p_lvl2, NULL, 8); - /* Dummy op - must do something useless after P_LVL2 read */ - acpi_hw_register_bit_access(ACPI_READ, ACPI_MTX_DO_NOT_LOCK, BM_STS); - /* Compute time elapsed */ - acpi_get_timer(&end_ticks); - /* Re-enable interrupts */ - enable(); - acpi_get_timer_duration(start_ticks, end_ticks, &time_elapsed); - break; - - case PR_C3: - /* Disable bus master arbitration */ - acpi_hw_register_bit_access(ACPI_WRITE, ACPI_MTX_DO_NOT_LOCK, ARB_DIS, 1); - /* See how long we're asleep for */ - acpi_get_timer(&start_ticks); - /* Invoke C3 */ - acpi_os_read_port(processor->power.p_lvl3, NULL, 8); - /* Dummy op - must do something useless after P_LVL3 read */ - acpi_hw_register_bit_access(ACPI_READ, ACPI_MTX_DO_NOT_LOCK, BM_STS); - /* Compute time elapsed */ - acpi_get_timer(&end_ticks); - /* Enable bus master arbitration */ - acpi_hw_register_bit_access(ACPI_WRITE, ACPI_MTX_DO_NOT_LOCK, - ARB_DIS, 0); - /* Re-enable interrupts */ - enable(); - acpi_get_timer_duration(start_ticks, end_ticks, &time_elapsed); - break; - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Attempt to use unsupported power state C%d.\n", processor->power.active_state)); - enable(); - break; - } - - /* - * Promotion? - * ---------- - * Track the number of successful sleeps (time asleep is greater - * than time_threshold) and promote when count_threshold is - * reached. - */ - if ((c_state->promotion.target_state) && - (time_elapsed >= c_state->promotion.time_threshold)) { - - c_state->promotion.count++; - c_state->demotion.count = 0; - - if (c_state->promotion.count >= c_state->promotion.count_threshold) { - /* - * Bus Mastering Activity, if active and used - * by this state's promotion policy, prevents - * promotions from occuring. - */ - if (!bm_control || !(processor->power.bm_activity & c_state->promotion.bm_threshold)) - next_state = c_state->promotion.target_state; - } - } - - /* - * Demotion? - * --------- - * Track the number of shorts (time asleep is less than - * time_threshold) and demote when count_threshold is reached. - */ - if (c_state->demotion.target_state) { - - if (time_elapsed < c_state->demotion.time_threshold) { - - c_state->demotion.count++; - c_state->promotion.count = 0; - - if (c_state->demotion.count >= - c_state->demotion.count_threshold) { - next_state = c_state->demotion.target_state; - } - } - - /* - * Bus Mastering Activity, if active and used by this - * state's promotion policy, causes an immediate demotion - * to occur. - */ - if (bm_control && (processor->power.bm_activity & c_state->demotion.bm_threshold)) - next_state = c_state->demotion.target_state; - } - - /* - * New Cx State? - * ------------- - * If we're going to start using a new Cx state we must clean up - * from the previous and prepare to use the new. - */ - if (next_state != processor->power.active_state) { - pr_power_activate_state(processor, next_state); - processor->power.active_state = processor->power.active_state; - } - - /* - * Track OS Idleness: - * ------------------ - * Record a jiffies timestamp to compute time elapsed between calls - * to the idle handler. - */ - last_idle_jiffies = jiffies; - - return; -} - - -/***************************************************************************** - * - * FUNCTION: pr_power_set_default_policy - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Sets the default Cx state policy (OS idle handler). Our - * scheme is to promote quickly to C2 but more conservatively - * to C3. We're favoring C2 for its characteristics of low - * latency (quick response), good power savings, and ability - * to allow bus mastering activity. - * - * Note that Cx state policy is completely customizable, with - * the goal of having heuristics to alter policy dynamically. - * - ****************************************************************************/ - -acpi_status -pr_power_set_default_policy ( - PR_CONTEXT *processor) -{ - FUNCTION_TRACE("pr_power_set_default_policy"); - - if (!processor) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Busy Metric: - * ------------ - * Used to determine when the OS has been busy and thus when - * policy should return to using the default Cx state (e.g. C1). - * On Linux we use the number of jiffies (scheduler quantums) - * that transpire between calls to the idle handler. - * - * TBD: Linux-specific. - */ - processor->power.busy_metric = 2; - - /* - * C1: - * --- - * C1 serves as our default state. It must be valid. - */ - if (processor->power.state[PR_C1].is_valid) { - processor->power.active_state = - processor->power.default_state = PR_C1; - } - else { - processor->power.active_state = - processor->power.default_state = PR_C0; - return_ACPI_STATUS(AE_OK); - } - - /* - * C2: - * --- - * Set default C1 promotion and C2 demotion policies. - */ - if (processor->power.state[PR_C2].is_valid) { - /* - * Promote from C1 to C2 anytime we're asleep in C1 for - * longer than two times the C2 latency (to amortize cost - * of transition). Demote from C2 to C1 anytime we're - * asleep in C2 for less than this time. - */ - processor->power.state[PR_C1].promotion.count_threshold = 10; - processor->power.state[PR_C1].promotion.time_threshold = - 2 * processor->power.state[PR_C2].latency; - processor->power.state[PR_C1].promotion.target_state = PR_C2; - - processor->power.state[PR_C2].demotion.count_threshold = 1; - processor->power.state[PR_C2].demotion.time_threshold = - 2 * processor->power.state[PR_C2].latency; - processor->power.state[PR_C2].demotion.target_state = PR_C1; - } - - /* - * C3: - * --- - * Set default C2 promotion and C3 demotion policies. - */ - if ((processor->power.state[PR_C2].is_valid) && - (processor->power.state[PR_C3].is_valid)) { - /* - * Promote from C2 to C3 after 4 cycles of no bus - * mastering activity (while maintaining sleep time - * criteria). Demote immediately on a short or - * whenever bus mastering activity occurs. - */ - processor->power.state[PR_C2].promotion.count_threshold = 1; - processor->power.state[PR_C2].promotion.time_threshold = - 2 * processor->power.state[PR_C3].latency; - processor->power.state[PR_C2].promotion.bm_threshold = - 0x0000000F; - processor->power.state[PR_C2].promotion.target_state = - PR_C3; - - processor->power.state[PR_C3].demotion.count_threshold = 1; - processor->power.state[PR_C3].demotion.time_threshold = - 2 * processor->power.state[PR_C3].latency; - processor->power.state[PR_C3].demotion.bm_threshold = - 0x0000000F; - processor->power.state[PR_C3].demotion.target_state = - PR_C2; - } - - return_ACPI_STATUS(AE_OK); -} - -/***************************************************************************** - * - * FUNCTION: pr_power_add_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -/* - * TBD: 1. PROC_C1 support. - * 2. Symmetric Cx state support (different Cx states supported - * by different CPUs results in lowest common denominator). - */ - -acpi_status -pr_power_add_device ( - PR_CONTEXT *processor) -{ - FUNCTION_TRACE("pr_power_add_device"); - - if (!processor) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * State Count: - * ------------ - * Fixed at four (C0-C3). We use is_valid to determine whether or - * not a state actually gets used. - */ - processor->power.state_count = PR_MAX_POWER_STATES; - - /* - * C0: - * --- - * C0 exists only as filler in our array. (Let's assume its valid!) - */ - processor->power.state[PR_C0].is_valid = TRUE; - - /* - * C1: - * --- - * ACPI states that C1 must be supported by all processors - * with a latency so small that it can be ignored. - * - * TBD: What about PROC_C1 support? - */ - processor->power.state[PR_C1].is_valid = TRUE; - - /* - * C2: - * --- - * We're only supporting C2 on UP systems with latencies <= 100us. - * - * TBD: Support for C2 on MP (P_LVL2_UP) -- I'm taking the - * conservative approach for now. - */ - processor->power.state[PR_C2].latency = acpi_fadt.plvl2_lat; - -#ifdef CONFIG_SMP - if (smp_num_cpus == 1) { -#endif /*CONFIG_SMP*/ - if (acpi_fadt.plvl2_lat <= PR_MAX_C2_LATENCY) { - processor->power.state[PR_C2].is_valid = TRUE; - processor->power.p_lvl2 = processor->pblk.address + 4; - } -#ifdef CONFIG_SMP - } -#endif /*CONFIG_SMP*/ - - - /* - * C3: - * --- - * We're only supporting C3 on UP systems with latencies <= 1000us, - * and that include the ability to disable bus mastering while in - * C3 (ARB_DIS) but allows bus mastering requests to wake the system - * from C3 (BM_RLD). Note his method of maintaining cache coherency - * (disabling of bus mastering) cannot be used on SMP systems, and - * flushing caches (e.g. WBINVD) is simply too costly at this time. - * - * TBD: Support for C3 on MP -- I'm taking the conservative - * approach for now. - */ - processor->power.state[PR_C3].latency = acpi_fadt.plvl3_lat; - -#ifdef CONFIG_SMP - if (smp_num_cpus == 1) { -#endif /*CONFIG_SMP*/ - if ((acpi_fadt.plvl3_lat <= PR_MAX_C3_LATENCY) && bm_control) { - processor->power.state[PR_C3].is_valid = TRUE; - processor->power.p_lvl3 = processor->pblk.address + 5; - } -#ifdef CONFIG_SMP - } -#endif /*CONFIG_SMP*/ - - /* - * Set Default Policy: - * ------------------- - * Now that we know which state are supported, set the default - * policy. Note that this policy can be changed dynamically - * (e.g. encourage deeper sleeps to conserve battery life when - * not on AC). - */ - pr_power_set_default_policy(processor); - - /* - * Save Processor Context: - * ----------------------- - * TBD: Enhance Linux idle handler to take processor context - * parameter. - */ - processor_list[processor->uid] = processor; - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: pr_power_remove_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -pr_power_remove_device ( - PR_CONTEXT *processor) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("pr_power_remove_device"); - - if (!processor) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - MEMSET(&(processor->power), 0, sizeof(PR_POWER)); - - processor_list[processor->uid] = NULL; - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: pr_power_initialize - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -pr_power_initialize (void) -{ - u32 i = 0; - - FUNCTION_TRACE("pr_power_initialize"); - - /* TBD: Linux-specific. */ - for (i=0; i - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -pr_power_terminate (void) -{ - FUNCTION_TRACE("pr_power_terminate"); - - /* - * Remove idle handler. - * - * TBD: Linux-specific (need OSL function). - */ - pm_idle = pr_pm_idle_save; - - return_ACPI_STATUS(AE_OK); -} diff -urN linux-2.4.18/drivers/acpi/ospm/system/Makefile lia64-2.4/drivers/acpi/ospm/system/Makefile --- linux-2.4.18/drivers/acpi/ospm/system/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/ospm/system/Makefile Wed Dec 31 16:00:00 1969 @@ -1,6 +0,0 @@ -O_TARGET := ospm_$(notdir $(CURDIR)).o -obj-m := $(O_TARGET) -EXTRA_CFLAGS += $(ACPI_CFLAGS) -obj-y := $(patsubst %.c,%.o,$(wildcard *.c)) - -include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/drivers/acpi/ospm/system/sm.c lia64-2.4/drivers/acpi/ospm/system/sm.c --- linux-2.4.18/drivers/acpi/ospm/system/sm.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/system/sm.c Wed Dec 31 16:00:00 1969 @@ -1,373 +0,0 @@ -/***************************************************************************** - * - * Module Name: sm.c - * $Revision: 20 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include "sm.h" - - -#define _COMPONENT ACPI_SYSTEM - MODULE_NAME ("sm") - - -/**************************************************************************** - * Internal Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: sm_print - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Prints out information on a specific system. - * - ****************************************************************************/ - -void -sm_print ( - SM_CONTEXT *system) -{ -#ifdef ACPI_DEBUG - acpi_buffer buffer; - - PROC_NAME("sm_print"); - - buffer.length = 256; - buffer.pointer = acpi_os_callocate(buffer.length); - if (!buffer.pointer) { - return; - } - - /* - * Get the full pathname for this ACPI object. - */ - acpi_get_name(system->acpi_handle, ACPI_FULL_PATHNAME, &buffer); - - /* - * Print out basic system information. - */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| System[%02x]:[%p] %s\n", system->device_handle, system->acpi_handle, (char*)buffer.pointer)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| states: %cS0 %cS1 %cS2 %cS3 %cS4 %cS5\n", (system->states[0]?'+':'-'), (system->states[1]?'+':'-'), (system->states[2]?'+':'-'), (system->states[3]?'+':'-'), (system->states[4]?'+':'-'), (system->states[5]?'+':'-'))); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - - acpi_os_free(buffer.pointer); -#endif /*ACPI_DEBUG*/ - - return; -} - - -/**************************************************************************** - * - * FUNCTION: sm_add_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -sm_add_device( - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - BM_DEVICE *device = NULL; - SM_CONTEXT *system = NULL; - u8 i, type_a, type_b; - - - FUNCTION_TRACE("sm_add_device"); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Adding system device [%02x].\n", device_handle)); - - if (!context || *context) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) context.")); - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Allocate a new SM_CONTEXT structure. - */ - system = acpi_os_callocate(sizeof(SM_CONTEXT)); - if (!system) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - /* - * Get information on this device. - */ - status = bm_get_device_info(device_handle, &device); - if (ACPI_FAILURE(status)) { - goto end; - } - - system->device_handle = device->handle; - system->acpi_handle = device->acpi_handle; - - /* - * Sx States: - * ---------- - * Figure out which Sx states are supported. - */ - for (i=0; istates[i] = TRUE; - } - } - - status = sm_osl_add_device(system); - if (ACPI_FAILURE(status)) { - goto end; - } - - *context = system; - - sm_print(system); - -end: - if (ACPI_FAILURE(status)) { - acpi_os_free(system); - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: sm_remove_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -sm_remove_device ( - void **context) -{ - acpi_status status = AE_OK; - SM_CONTEXT *system = NULL; - - FUNCTION_TRACE("sm_remove_device"); - - if (!context || !*context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - system = (SM_CONTEXT*)*context; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing system device [%02x].\n", system->device_handle)); - - status = sm_osl_remove_device(system); - - acpi_os_free(system); - - *context = NULL; - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: sm_initialize - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -sm_initialize (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("sm_initialize"); - - MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID)); - MEMSET(&driver, 0, sizeof(BM_DRIVER)); - - /* - * Register driver for the System device. - */ - criteria.type = BM_TYPE_SYSTEM; - - driver.notify = &sm_notify; - driver.request = &sm_request; - - status = bm_register_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: sm_terminate - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -sm_terminate (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("sm_terminate"); - - MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID)); - MEMSET(&driver, 0, sizeof(BM_DRIVER)); - - /* - * Unregister driver for System devices. - */ - criteria.type = BM_TYPE_SYSTEM; - - driver.notify = &sm_notify; - driver.request = &sm_request; - - status = bm_unregister_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/***************************************************************************** - * - * FUNCTION: sm_notify - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ -acpi_status -sm_notify ( - BM_NOTIFY notify_type, - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("sm_notify"); - - if (!context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - switch (notify_type) { - - case BM_NOTIFY_DEVICE_ADDED: - status = sm_add_device(device_handle, context); - break; - - case BM_NOTIFY_DEVICE_REMOVED: - status = sm_remove_device(context); - break; - - default: - status = AE_SUPPORT; - break; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: sm_request - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -sm_request ( - BM_REQUEST *request, - void *context) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("sm_request"); - - /* - * Must have a valid request structure and context. - */ - if (!request || !context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Handle Request: - * --------------- - */ - switch (request->command) { - - default: - status = AE_SUPPORT; - break; - } - - request->status = status; - - return_ACPI_STATUS(status); -} diff -urN linux-2.4.18/drivers/acpi/ospm/system/sm_osl.c lia64-2.4/drivers/acpi/ospm/system/sm_osl.c --- linux-2.4.18/drivers/acpi/ospm/system/sm_osl.c Wed Dec 26 16:58:37 2001 +++ lia64-2.4/drivers/acpi/ospm/system/sm_osl.c Wed Dec 31 16:00:00 1969 @@ -1,919 +0,0 @@ -/****************************************************************************** - * - * Module Name: sm_osl.c - * $Revision: 16 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "sm.h" - - -MODULE_AUTHOR("Andrew Grover"); -MODULE_DESCRIPTION("ACPI Component Architecture (CA) - ACPI System Driver"); -MODULE_LICENSE("GPL"); - - -#define SM_PROC_INFO "info" -#define SM_PROC_DSDT "dsdt" - -extern struct proc_dir_entry *bm_proc_root; -struct proc_dir_entry *sm_proc_root = NULL; -static void (*sm_pm_power_off)(void) = NULL; - -static ssize_t sm_osl_read_dsdt(struct file *, char *, size_t, loff_t *); - -static struct file_operations proc_dsdt_operations = { - read: sm_osl_read_dsdt, -}; - -static acpi_status sm_osl_suspend(u32 state); - -struct proc_dir_entry *bm_proc_sleep; -struct proc_dir_entry *bm_proc_alarm; -struct proc_dir_entry *bm_proc_gpe; - -static int -sm_osl_proc_read_sleep ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *context) -{ - SM_CONTEXT *system = (SM_CONTEXT*) context; - char *str = page; - int len; - int i; - - if (!system) - goto end; - - if (off != 0) - goto end; - - for (i = 0; i <= ACPI_S5; i++) { - if (system->states[i]) - str += sprintf(str,"S%d ", i); - } - - str += sprintf(str, "\n"); - -end: - - len = (str - page); - if (len < (off + count)) - *eof = 1; - - *start = page + off; - len -= off; - - if (len > count) - len = count; - - if (len < 0) - len = 0; - - return (len); -} - -int sm_osl_proc_write_sleep (struct file *file, - const char *buffer, - unsigned long count, - void *data) -{ - SM_CONTEXT *system = (SM_CONTEXT*) data; - char str[10]; - char *strend; - unsigned long value; - - if (count > (sizeof(str) - 1)) - return -EINVAL; - - if (copy_from_user(str,buffer,count)) - return -EFAULT; - - str[count] = '\0'; - - value = simple_strtoul(str,&strend,0); - if (str == strend) - return -EINVAL; - - if (value == 0 || value >= ACPI_S5) - return -EINVAL; - - /* - * make sure that the sleep state is supported - */ - if (system->states[value] != TRUE) - return -EINVAL; - - sm_osl_suspend(value); - - return (count); -} - - -/**************************************************************************** - * - * FUNCTION: sm_osl_proc_read_info - * - ****************************************************************************/ - -static int -sm_osl_proc_read_info ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *context) -{ - acpi_status status = AE_OK; - SM_CONTEXT *system = NULL; - char *p = page; - int len; - acpi_system_info system_info; - acpi_buffer buffer; - u32 i = 0; - - if (!context) { - goto end; - } - - system = (SM_CONTEXT*) context; - - /* don't get status more than once for a single proc read */ - if (off != 0) { - goto end; - } - - /* - * Get ACPI CA Information. - */ - buffer.length = sizeof(system_info); - buffer.pointer = &system_info; - - status = acpi_get_system_info(&buffer); - if (ACPI_FAILURE(status)) { - p += sprintf(p, "ACPI-CA Version: unknown\n"); - } - else { - p += sprintf(p, "ACPI-CA Version: %x\n", - system_info.acpi_ca_version); - } - - p += sprintf(p, "Sx States Supported: "); - for (i=0; istates[i]) { - p += sprintf(p, "S%d ", i); - } - } - p += sprintf(p, "\n"); - -end: - len = (p - page); - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - - return(len); -} - -/**************************************************************************** - * - * FUNCTION: sm_osl_read_dsdt - * - ****************************************************************************/ - -static ssize_t -sm_osl_read_dsdt( - struct file *file, - char *buf, - size_t count, - loff_t *ppos) -{ - acpi_buffer acpi_buf; - void *data; - size_t size = 0; - - acpi_buf.length = 0; - acpi_buf.pointer = NULL; - - - /* determine what buffer size we will need */ - if (acpi_get_table(ACPI_TABLE_DSDT, 1, &acpi_buf) != AE_BUFFER_OVERFLOW) { - return 0; - } - - acpi_buf.pointer = kmalloc(acpi_buf.length, GFP_KERNEL); - if (!acpi_buf.pointer) { - return -ENOMEM; - } - - /* get the table for real */ - if (!ACPI_SUCCESS(acpi_get_table(ACPI_TABLE_DSDT, 1, &acpi_buf))) { - kfree(acpi_buf.pointer); - return 0; - } - - if (*ppos < acpi_buf.length) { - data = acpi_buf.pointer + file->f_pos; - size = acpi_buf.length - file->f_pos; - if (size > count) - size = count; - if (copy_to_user(buf, data, size)) { - kfree(acpi_buf.pointer); - return -EFAULT; - } - } - - kfree(acpi_buf.pointer); - - *ppos += size; - - return size; -} - -static int -sm_osl_proc_read_alarm ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *context) -{ - char *str = page; - int len; - u32 sec,min,hr; - u32 day,mo,yr; - - if (off != 0) goto out; - - spin_lock(&rtc_lock); - sec = CMOS_READ(RTC_SECONDS_ALARM); - min = CMOS_READ(RTC_MINUTES_ALARM); - hr = CMOS_READ(RTC_HOURS_ALARM); - -#if 0 - /* if I ever get an FACP with proper values, maybe I'll enable this code */ - if (acpi_gbl_FADT->day_alrm) - day = CMOS_READ(acpi_gbl_FADT->day_alrm); - else - day = CMOS_READ(RTC_DAY_OF_MONTH); - if (acpi_gbl_FADT->mon_alrm) - mo = CMOS_READ(acpi_gbl_FADT->mon_alrm); - else - mo = CMOS_READ(RTC_MONTH);; - if (acpi_gbl_FADT->century) - yr = CMOS_READ(acpi_gbl_FADT->century) * 100 + CMOS_READ(RTC_YEAR); - else - yr = CMOS_READ(RTC_YEAR); -#else - day = CMOS_READ(RTC_DAY_OF_MONTH); - mo = CMOS_READ(RTC_MONTH); - yr = CMOS_READ(RTC_YEAR); -#endif - spin_unlock(&rtc_lock); - - BCD_TO_BIN(sec); - BCD_TO_BIN(min); - BCD_TO_BIN(hr); - BCD_TO_BIN(day); - BCD_TO_BIN(mo); - BCD_TO_BIN(yr); - - str += sprintf(str,"%4.4u-",yr); - - str += (mo > 12) ? - sprintf(str,"**-") : - sprintf(str,"%2.2u-",mo); - - str += (day > 31) ? - sprintf(str,"** ") : - sprintf(str,"%2.2u ",day); - - str += (hr > 23) ? - sprintf(str,"**:") : - sprintf(str,"%2.2u:",hr); - - str += (min > 59) ? - sprintf(str,"**:") : - sprintf(str,"%2.2u:",min); - - str += (sec > 59) ? - sprintf(str,"**\n") : - sprintf(str,"%2.2u\n",sec); - - out: - len = str - page; - - if (len < count) *eof = 1; - else if (len > count) len = count; - - if (len < 0) len = 0; - - *start = page; - - return len; -} - -static int get_date_field(char **str, u32 *value) -{ - char *next,*strend; - int error = -EINVAL; - - /* try to find delimeter, only to insert null; - * the end of string won't have one, but is still valid - */ - next = strpbrk(*str,"- :"); - if (next) *next++ = '\0'; - - *value = simple_strtoul(*str,&strend,10); - - /* signal success if we got a good digit */ - if (strend != *str) error = 0; - - if (next) *str = next; - return error; -} - - - -int sm_osl_proc_write_alarm ( - struct file *file, - const char *buffer, - unsigned long count, - void *data) -{ - char buf[30]; - char *str = buf; - u32 sec,min,hr; - u32 day,mo,yr; - int adjust = 0; - unsigned char rtc_control; - int error = -EINVAL; - - if (count > sizeof(buf) - 1) return -EINVAL; - - if (copy_from_user(str,buffer,count)) return -EFAULT; - - str[count] = '\0'; - /* check for time adjustment */ - if (str[0] == '+') { - str++; - adjust = 1; - } - - if ((error = get_date_field(&str,&yr))) goto out; - if ((error = get_date_field(&str,&mo))) goto out; - if ((error = get_date_field(&str,&day))) goto out; - if ((error = get_date_field(&str,&hr))) goto out; - if ((error = get_date_field(&str,&min))) goto out; - if ((error = get_date_field(&str,&sec))) goto out; - - - if (sec > 59) { - min += 1; - sec -= 60; - } - if (min > 59) { - hr += 1; - min -= 60; - } - if (hr > 23) { - day += 1; - hr -= 24; - } - if (day > 31) { - mo += 1; - day -= 31; - } - if (mo > 12) { - yr += 1; - mo -= 12; - } - - spin_lock_irq(&rtc_lock); - rtc_control = CMOS_READ(RTC_CONTROL); - if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { - BIN_TO_BCD(yr); - BIN_TO_BCD(mo); - BIN_TO_BCD(day); - BIN_TO_BCD(hr); - BIN_TO_BCD(min); - BIN_TO_BCD(sec); - } - - if (adjust) { - yr += CMOS_READ(RTC_YEAR); - mo += CMOS_READ(RTC_MONTH); - day += CMOS_READ(RTC_DAY_OF_MONTH); - hr += CMOS_READ(RTC_HOURS); - min += CMOS_READ(RTC_MINUTES); - sec += CMOS_READ(RTC_SECONDS); - } - spin_unlock_irq(&rtc_lock); - - if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { - BCD_TO_BIN(yr); - BCD_TO_BIN(mo); - BCD_TO_BIN(day); - BCD_TO_BIN(hr); - BCD_TO_BIN(min); - BCD_TO_BIN(sec); - } - - if (sec > 59) { - min++; - sec -= 60; - } - if (min > 59) { - hr++; - min -= 60; - } - if (hr > 23) { - day++; - hr -= 24; - } - if (day > 31) { - mo++; - day -= 31; - } - if (mo > 12) { - yr++; - mo -= 12; - } - if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { - BIN_TO_BCD(yr); - BIN_TO_BCD(mo); - BIN_TO_BCD(day); - BIN_TO_BCD(hr); - BIN_TO_BCD(min); - BIN_TO_BCD(sec); - } - - spin_lock_irq(&rtc_lock); - /* write the fields the rtc knows about */ - CMOS_WRITE(hr,RTC_HOURS_ALARM); - CMOS_WRITE(min,RTC_MINUTES_ALARM); - CMOS_WRITE(sec,RTC_SECONDS_ALARM); - - /* If the system supports an enhanced alarm, it will have non-zero - * offsets into the CMOS RAM here. - * Which for some reason are pointing to the RTC area of memory. - */ -#if 0 - if (acpi_gbl_FADT->day_alrm) CMOS_WRITE(day,acpi_gbl_FADT->day_alrm); - if (acpi_gbl_FADT->mon_alrm) CMOS_WRITE(mo,acpi_gbl_FADT->mon_alrm); - if (acpi_gbl_FADT->century) CMOS_WRITE(yr / 100,acpi_gbl_FADT->century); -#endif - /* enable the rtc alarm interrupt */ - if (!(rtc_control & RTC_AIE)) { - rtc_control |= RTC_AIE; - CMOS_WRITE(rtc_control,RTC_CONTROL); - CMOS_READ(RTC_INTR_FLAGS); - } - - /* unlock the lock on the rtc now that we're done with it */ - spin_unlock_irq(&rtc_lock); - - acpi_hw_register_bit_access(ACPI_WRITE,ACPI_MTX_LOCK, RTC_EN, 1); - - file->f_pos += count; - - error = 0; - out: - return error ? error : count; -} - -static int -sm_osl_proc_read_gpe( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *context) -{ - char *str = page; - int size; - int length; - int i; - u32 addr,data; - - if (off) goto out; - - if (acpi_gbl_FADT->V1_gpe0blk) { - length = acpi_gbl_FADT->gpe0blk_len / 2; - - str += sprintf(str,"GPE0: "); - - for (i = length; i > 0; i--) { - addr = GPE0_EN_BLOCK | (i - 1); - data = acpi_hw_register_read(ACPI_MTX_LOCK,addr); - str += sprintf(str,"%2.2x ",data); - } - str += sprintf(str,"\n"); - - str += sprintf(str,"Status: "); - for (i = length; i > 0; i--) { - addr = GPE0_STS_BLOCK | (i - 1); - data = acpi_hw_register_read(ACPI_MTX_LOCK,addr); - str += sprintf(str,"%2.2x ",data); - } - str += sprintf(str,"\n"); - } - - if (acpi_gbl_FADT->V1_gpe1_blk) { - length = acpi_gbl_FADT->gpe1_blk_len / 2; - - - str += sprintf(str,"GPE1: "); - for (i = length; i > 0; i--) { - addr = GPE1_EN_BLOCK | (i - 1); - data = acpi_hw_register_read(ACPI_MTX_LOCK,addr); - str += sprintf(str,"%2.2x",data); - } - str += sprintf(str,"\n"); - - str += sprintf(str,"Status: "); - for (i = length; i > 0; i--) { - addr = GPE1_STS_BLOCK | (i - 1); - data = acpi_hw_register_read(ACPI_MTX_LOCK,addr); - str += sprintf(str,"%2.2x",data); - } - str += sprintf(str,"\n"); - } - out: - size = str - page; - if (size < count) *eof = 1; - else if (size > count) size = count; - - if (size < 0) size = 0; - *start = page; - - return size; -} - -static int -sm_osl_proc_write_gpe ( - struct file *file, - const char *buffer, - unsigned long count, - void *data) -{ - char buf[256]; - char *str = buf; - char *next; - int error = -EINVAL; - u32 addr,value = 0; - - if (count > sizeof(buf) + 1) return -EINVAL; - - if (copy_from_user(str,buffer,count)) return -EFAULT; - - str[count] = '\0'; - - /* set addr to which block to refer to */ - if (!strncmp(str,"GPE0 ",5)) addr = GPE0_EN_BLOCK; - else if (!strncmp(str,"GPE1 ",5)) addr = GPE1_EN_BLOCK; - else goto out; - - str += 5; - - /* set low order bits to index of bit to set */ - addr |= simple_strtoul(str,&next,0); - if (next == str) goto out; - - if (next) { - str = ++next; - value = simple_strtoul(str,&next,0); - if (next == str) value = 1; - } - - value = acpi_hw_register_bit_access(ACPI_WRITE,ACPI_MTX_LOCK,addr,(value ? 1 : 0)); - - error = 0; - out: - return error ? error : count; -} - - -/**************************************************************************** - * - * FUNCTION: sm_osl_suspend - * - * PARAMETERS: %state: Sleep state to enter. Assumed that caller has filtered - * out bogus values, so it's one of S1, S2, S3 or S4 - * - * RETURN: ACPI_STATUS, whether or not we successfully entered and - * exited sleep. - * - * DESCRIPTION: - * This function is the meat of the sleep routine, as far as the ACPI-CA is - * concerned. - * - * See Chapter 9 of the ACPI 2.0 spec for details concerning the methodology here. - * - * It will do the following things: - * - Call arch-specific routines to save the processor and kernel state - * - Call acpi_enter_sleep_state to actually go to sleep - * .... - * When we wake back up, we will: - * - Restore the processor and kernel state - * - Return to the user - * - * By having this routine in here, it hides it from every part of the CA, - * so it can remain OS-independent. The only function that calls this is - * sm_proc_write_sleep, which gets the sleep state to enter from the user. - * - ****************************************************************************/ -static acpi_status -sm_osl_suspend(u32 state) -{ - acpi_status status = AE_ERROR; - unsigned long wakeup_address; - - /* get out if state is invalid */ - if (state < ACPI_S1 || state > ACPI_S5) - goto acpi_sleep_done; - - /* make sure we don't get any suprises */ - disable(); - - /* TODO: save device state and suspend them */ - - /* save the processor state to memory if going into S2 or S3; - * save it to disk if going into S4. - * Also, set the FWV if going into an STR state - */ - if (state == ACPI_S2 || state == ACPI_S3) { -#ifdef DONT_USE_UNTIL_LOWLEVEL_CODE_EXISTS - wakeup_address = acpi_save_state_mem((unsigned long)&&acpi_sleep_done); - - if (!wakeup_address) goto acpi_sleep_done; - - acpi_set_firmware_waking_vector( - (ACPI_PHYSICAL_ADDRESS)wakeup_address); -#endif - } else if (state == ACPI_S4) -#ifdef DONT_USE_UNTIL_LOWLEVEL_CODE_EXISTS - if (acpi_save_state_disk((unsigned long)&&acpi_sleep_done)) - goto acpi_sleep_done; -#endif - - /* set status, since acpi_enter_sleep_state won't return unless something - * goes wrong, or it's just S1. - */ - status = AE_OK; - - mdelay(10); - status = acpi_enter_sleep_state(state); - - acpi_sleep_done: - - /* pause for a bit to allow devices to come back on */ - mdelay(10); - - /* make sure that the firmware waking vector is reset */ - acpi_set_firmware_waking_vector((ACPI_PHYSICAL_ADDRESS)0); - - acpi_leave_sleep_state(state); - - /* TODO: resume devices and restore their state */ - - enable(); - return status; -} - - -/**************************************************************************** - * - * FUNCTION: sm_osl_power_down - * - ****************************************************************************/ - -void -sm_osl_power_down (void) -{ - /* Power down the system (S5 = soft off). */ - sm_osl_suspend(ACPI_S5); -} - - -/**************************************************************************** - * - * FUNCTION: sm_osl_add_device - * - ****************************************************************************/ - -acpi_status -sm_osl_add_device( - SM_CONTEXT *system) -{ - u32 i = 0; - struct proc_dir_entry *bm_proc_dsdt; - - if (!system) { - return(AE_BAD_PARAMETER); - } - - printk("ACPI: System firmware supports"); - for (i=0; istates[i]) { - printk(" S%d", i); - } - } - printk("\n"); - - if (system->states[ACPI_STATE_S5]) { - sm_pm_power_off = pm_power_off; - pm_power_off = sm_osl_power_down; - } - - create_proc_read_entry(SM_PROC_INFO, S_IRUGO, - sm_proc_root, sm_osl_proc_read_info, (void*)system); - - bm_proc_sleep = create_proc_read_entry("sleep", S_IFREG | S_IRUGO | S_IWUSR, - sm_proc_root, sm_osl_proc_read_sleep, (void*)system); - if (bm_proc_sleep) - bm_proc_sleep->write_proc = sm_osl_proc_write_sleep; - - bm_proc_alarm = create_proc_read_entry("alarm", S_IFREG | S_IRUGO | S_IWUSR, - sm_proc_root,sm_osl_proc_read_alarm, NULL); - if (bm_proc_alarm) - bm_proc_alarm->write_proc = sm_osl_proc_write_alarm; - - bm_proc_gpe = create_proc_read_entry("gpe", S_IFREG | S_IRUGO | S_IWUSR, - sm_proc_root,sm_osl_proc_read_gpe,NULL); - if (bm_proc_gpe) - bm_proc_gpe->write_proc = sm_osl_proc_write_gpe; - - /* - * Get a wakeup address for use when we come back from sleep. - * At least on IA-32, this needs to be in low memory. - * When sleep is supported on other arch's, then we may want - * to move this out to another place, but GFP_LOW should suffice - * for now. - */ -#if 0 - if (system->states[ACPI_S3] || system->states[ACPI_S4]) { - acpi_wakeup_address = (unsigned long)virt_to_phys(get_free_page(GFP_LOWMEM)); - printk(KERN_INFO "ACPI: Have wakeup address 0x%8.8x\n",acpi_wakeup_address); - } -#endif - - /* - * This returns more than a page, so we need to use our own file ops, - * not proc's generic ones - */ - bm_proc_dsdt = create_proc_entry(SM_PROC_DSDT, S_IRUSR, sm_proc_root); - if (bm_proc_dsdt) { - bm_proc_dsdt->proc_fops = &proc_dsdt_operations; - } - - return(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: sm_osl_remove_device - * - ****************************************************************************/ - -acpi_status -sm_osl_remove_device ( - SM_CONTEXT *system) -{ - if (!system) { - return(AE_BAD_PARAMETER); - } - - remove_proc_entry(SM_PROC_INFO, sm_proc_root); - remove_proc_entry(SM_PROC_DSDT, sm_proc_root); - - return(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: sm_osl_generate_event - * - ****************************************************************************/ - -acpi_status -sm_osl_generate_event ( - u32 event, - SM_CONTEXT *system) -{ - acpi_status status = AE_OK; - - if (!system) { - return(AE_BAD_PARAMETER); - } - - switch (event) { - - default: - return(AE_BAD_PARAMETER); - break; - } - - return(status); -} - - -/**************************************************************************** - * - * FUNCTION: sm_osl_init - * - * PARAMETERS: - * - * RETURN: 0: Success - * - * DESCRIPTION: Module initialization. - * - ****************************************************************************/ - -static int __init -sm_osl_init (void) -{ - acpi_status status = AE_OK; - - /* abort if no busmgr */ - if (!bm_proc_root) - return -ENODEV; - - sm_proc_root = bm_proc_root; - if (!sm_proc_root) { - status = AE_ERROR; - } - else { - status = sm_initialize(); - } - - return (ACPI_SUCCESS(status)) ? 0 : -ENODEV; -} - - -/**************************************************************************** - * - * FUNCTION: sm_osl_cleanup - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Module cleanup. - * - ****************************************************************************/ - -static void __exit -sm_osl_cleanup (void) -{ - sm_terminate(); - - return; -} - - -module_init(sm_osl_init); -module_exit(sm_osl_cleanup); diff -urN linux-2.4.18/drivers/acpi/ospm/thermal/Makefile lia64-2.4/drivers/acpi/ospm/thermal/Makefile --- linux-2.4.18/drivers/acpi/ospm/thermal/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/ospm/thermal/Makefile Wed Dec 31 16:00:00 1969 @@ -1,6 +0,0 @@ -O_TARGET := ospm_$(notdir $(CURDIR)).o -obj-m := $(O_TARGET) -EXTRA_CFLAGS += $(ACPI_CFLAGS) -obj-y := $(patsubst %.c,%.o,$(wildcard *.c)) - -include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/drivers/acpi/ospm/thermal/tz.c lia64-2.4/drivers/acpi/ospm/thermal/tz.c --- linux-2.4.18/drivers/acpi/ospm/thermal/tz.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/thermal/tz.c Wed Dec 31 16:00:00 1969 @@ -1,642 +0,0 @@ -/***************************************************************************** - * - * Module Name: tz.c - * $Revision: 44 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include -#include "tz.h" - - -#define _COMPONENT ACPI_THERMAL - MODULE_NAME ("tz") - - -/**************************************************************************** - * Globals - ****************************************************************************/ - -extern int TZP; - - -/**************************************************************************** - * Internal Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: tz_print - * - ****************************************************************************/ - -void -tz_print ( - TZ_CONTEXT *tz) -{ -#ifdef ACPI_DEBUG - acpi_buffer buffer; - u32 i,j = 0; - TZ_THRESHOLDS *thresholds = NULL; - - FUNCTION_TRACE("tz_print"); - - if (!tz) - return; - - thresholds = &(tz->policy.thresholds); - - buffer.length = 256; - buffer.pointer = acpi_os_callocate(buffer.length); - if (!buffer.pointer) - return; - - /* - * Get the full pathname for this ACPI object. - */ - acpi_get_name(tz->acpi_handle, ACPI_FULL_PATHNAME, &buffer); - - /* - * Print out basic thermal zone information. - */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Thermal_zone[%02x]:[%p] %s\n", tz->device_handle, tz->acpi_handle, (char*)buffer.pointer)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| temperature[%d] state[%08x]\n", tz->policy.temperature, tz->policy.state)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| cooling_mode[%08x] polling_freq[%d]\n", tz->policy.cooling_mode, tz->policy.polling_freq)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| critical[%d]\n", thresholds->critical.temperature)); - if (thresholds->hot.is_valid) - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| hot[%d]\n", thresholds->hot.temperature)); - if (thresholds->passive.is_valid) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| passive[%d]: tc1[%d] tc2[%d] tsp[%d]\n", thresholds->passive.temperature, thresholds->passive.tc1, thresholds->passive.tc2, thresholds->passive.tsp)); - if (thresholds->passive.devices.count > 0) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| devices")); - for (j=0; (jpassive.devices.count && j<10); j++) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "[%02x]", thresholds->passive.devices.handles[j])); - } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); - } - } - for (i=0; iactive[i].is_valid) - break; - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| active[%d]: index[%d]\n", thresholds->active[i].temperature, i)); - if (thresholds->active[i].devices.count > 0) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| devices")); - for (j=0; (jactive[i].devices.count && j<10); j++) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "[%02x]", thresholds->active[i].devices.handles[j])); - } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); - } - } - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n")); - - acpi_os_free(buffer.pointer); -#endif /*ACPI_DEBUG*/ - - return; -} - - -/**************************************************************************** - * - * FUNCTION: tz_get_temperaturee - * - ****************************************************************************/ - -acpi_status -tz_get_temperature ( - TZ_CONTEXT *tz) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("tz_get_temperature"); - - if (!tz) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Evaluate the _TMP method to get the current temperature. - */ - status = bm_evaluate_simple_integer(tz->acpi_handle, "_TMP", &(tz->policy.temperature)); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %d d_k\n", tz->policy.temperature)); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: tz_set_cooling_preference - * - ****************************************************************************/ - -acpi_status -tz_set_cooling_preference ( - TZ_CONTEXT *tz, - TZ_COOLING_MODE cooling_mode) -{ - acpi_status status = AE_OK; - acpi_object_list arg_list; - acpi_object arg0; - - FUNCTION_TRACE("tz_set_cooling_preference"); - - if (!tz || ((cooling_mode != TZ_COOLING_MODE_ACTIVE) && (cooling_mode != TZ_COOLING_MODE_PASSIVE))) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Build the argument list, which simply consists of the current - * cooling preference. - */ - memset(&arg_list, 0, sizeof(acpi_object)); - arg_list.count = 1; - arg_list.pointer = &arg0; - - memset(&arg0, 0, sizeof(acpi_object)); - arg0.type = ACPI_TYPE_INTEGER; - arg0.integer.value = cooling_mode; - - /* - * Evaluate "_SCP" - setting the new cooling preference. - */ - status = acpi_evaluate_object(tz->acpi_handle, "_SCP", &arg_list, NULL); - if (ACPI_FAILURE(status)) { - tz->policy.cooling_mode = -1; - return_ACPI_STATUS(status); - } - - tz->policy.cooling_mode = cooling_mode; - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: tz_get_thresholds - * - ****************************************************************************/ - -acpi_status -tz_get_thresholds ( - TZ_CONTEXT *tz) -{ - acpi_status status = AE_OK; - TZ_THRESHOLDS *thresholds = NULL; - u32 value = 0; - u32 i = 0; - - FUNCTION_TRACE("acpi_tz_get_thresholds"); - - if (!tz) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - thresholds = &(tz->policy.thresholds); - - /* Critical Shutdown (required) */ - - status = bm_evaluate_simple_integer(tz->acpi_handle, "_CRT", &value); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No critical threshold\n")); - return_ACPI_STATUS(status); - } - else { - thresholds->critical.temperature = value; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found critical threshold [%d]\n", thresholds->critical.temperature)); - - } - - /* Critical Sleep (optional) */ - - status = bm_evaluate_simple_integer(tz->acpi_handle, "_HOT", &value); - if (ACPI_FAILURE(status)) { - thresholds->hot.is_valid = 0; - thresholds->hot.temperature = 0; - } - else { - thresholds->hot.is_valid = 1; - thresholds->hot.temperature = value; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found hot threshold [%d]\n", thresholds->hot.temperature)); - } - - /* Passive: Processors (optional) */ - - status = bm_evaluate_simple_integer(tz->acpi_handle, "_PSV", &value); - if (ACPI_FAILURE(status)) { - thresholds->passive.is_valid = 0; - thresholds->passive.temperature = 0; - } - else { - thresholds->passive.is_valid = 1; - thresholds->passive.temperature = value; - - status = bm_evaluate_simple_integer(tz->acpi_handle, "_TC1", &value); - if (ACPI_FAILURE(status)) { - thresholds->passive.is_valid = 0; - } - thresholds->passive.tc1 = value; - - status = bm_evaluate_simple_integer(tz->acpi_handle, "_TC2", &value); - if (ACPI_FAILURE(status)) { - thresholds->passive.is_valid = 0; - } - thresholds->passive.tc2 = value; - - status = bm_evaluate_simple_integer(tz->acpi_handle, "_TSP", &value); - if (ACPI_FAILURE(status)) { - thresholds->passive.is_valid = 0; - } - thresholds->passive.tsp = value; - - status = bm_evaluate_reference_list(tz->acpi_handle, "_PSL", &(thresholds->passive.devices)); - if (ACPI_FAILURE(status)) { - thresholds->passive.is_valid = 0; - } - - if (thresholds->passive.is_valid) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found passive threshold [%d]\n", thresholds->passive.temperature)); - } - else { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid passive threshold\n")); - } - } - - /* Active: Fans, etc. (optional) */ - - for (i=0; iacpi_handle, name, &value); - if (ACPI_FAILURE(status)) { - thresholds->active[i].is_valid = 0; - thresholds->active[i].temperature = 0; - break; - } - - thresholds->active[i].temperature = value; - name[2] = 'L'; - - status = bm_evaluate_reference_list(tz->acpi_handle, name, &(thresholds->active[i].devices)); - if (ACPI_SUCCESS(status)) { - thresholds->active[i].is_valid = 1; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found active threshold [%d]:[%d]\n", i, thresholds->active[i].temperature)); - } - else { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid active threshold [%d]\n", i)); - } - } - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: tz_add_device - * - ****************************************************************************/ - -acpi_status -tz_add_device ( - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - TZ_CONTEXT *tz = NULL; - BM_DEVICE *device = NULL; - acpi_handle tmp_handle = NULL; - static u32 zone_count = 0; - - FUNCTION_TRACE("tz_add_device"); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Adding thermal zone [%02x].\n", device_handle)); - - if (!context || *context) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Invalid context for device [%02x].\n", device_handle)); - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - /* - * Get information on this device. - */ - status = bm_get_device_info(device_handle, &device); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Allocate a new Thermal Zone device. - */ - tz = acpi_os_callocate(sizeof(TZ_CONTEXT)); - if (!tz) { - return_ACPI_STATUS(AE_NO_MEMORY); - } - - tz->device_handle = device->handle; - tz->acpi_handle = device->acpi_handle; - - /* TBD: How to manage 'uid' when zones are Pn_p? */ - sprintf(tz->uid, "%d", zone_count++); - - /* - * Temperature: - * ------------ - * Make sure we can read the zone's current temperature (_TMP). - * If we can't, there's no use in doing any policy (abort). - */ - status = tz_get_temperature(tz); - if (ACPI_FAILURE(status)) - goto end; - - /* - * Polling Frequency: - * ------------------ - * If _TZP doesn't exist use the OS default polling frequency. - */ - status = bm_evaluate_simple_integer(tz->acpi_handle, "_TZP", &(tz->policy.polling_freq)); - if (ACPI_FAILURE(status)) { - tz->policy.polling_freq = TZP; - } - status = AE_OK; - - /* - * Cooling Preference: - * ------------------- - * Default to ACTIVE (noisy) cooling until policy decides otherwise. - * Note that _SCP is optional. - */ - tz_set_cooling_preference(tz, TZ_COOLING_MODE_ACTIVE); - - /* - * Start Policy: - * ------------- - * Thermal policy is included in the kernel (this driver) because - * of the critical role it plays in avoiding nuclear meltdown. =O - */ - status = tz_policy_add_device(tz); - if (ACPI_FAILURE(status)) - goto end; - - status = tz_osl_add_device(tz); - if (ACPI_FAILURE(status)) - goto end; - - *context = tz; - - tz_print(tz); - -end: - if (ACPI_FAILURE(status)) - acpi_os_free(tz); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: tz_remove_device - * - ****************************************************************************/ - -acpi_status -tz_remove_device ( - void **context) -{ - acpi_status status = AE_OK; - TZ_CONTEXT *tz = NULL; - - FUNCTION_TRACE("tz_remove_device"); - - if (!context || !*context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - tz = (TZ_CONTEXT*)(*context); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing thermal zone [%02x].\n", tz->device_handle)); - - status = tz_osl_remove_device(tz); - - /* - * Remove Policy: - * -------------- - * TBD: Move all thermal zone policy to user-mode daemon... - */ - status = tz_policy_remove_device(tz); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - acpi_os_free(tz); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * External Functions - ****************************************************************************/ - -/**************************************************************************** - * - * FUNCTION: tz_initialize - * - ****************************************************************************/ - -acpi_status -tz_initialize (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("tz_initialize"); - - memset(&criteria, 0, sizeof(BM_DEVICE_ID)); - memset(&driver, 0, sizeof(BM_DRIVER)); - - /* - * Register driver for thermal zone devices. - */ - criteria.type = BM_TYPE_THERMAL_ZONE; - - driver.notify = &tz_notify; - driver.request = &tz_request; - - status = bm_register_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: tz_terminate - * - ****************************************************************************/ - -acpi_status -tz_terminate (void) -{ - acpi_status status = AE_OK; - BM_DEVICE_ID criteria; - BM_DRIVER driver; - - FUNCTION_TRACE("tz_terminate"); - - memset(&criteria, 0, sizeof(BM_DEVICE_ID)); - memset(&driver, 0, sizeof(BM_DRIVER)); - - /* - * Unregister driver for thermal zone devices. - */ - criteria.type = BM_TYPE_THERMAL_ZONE; - - driver.notify = &tz_notify; - driver.request = &tz_request; - - status = bm_unregister_driver(&criteria, &driver); - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: tz_notify - * - ****************************************************************************/ - -acpi_status -tz_notify ( - BM_NOTIFY notify_type, - BM_HANDLE device_handle, - void **context) -{ - acpi_status status = AE_OK; - TZ_CONTEXT *tz = NULL; - - FUNCTION_TRACE("tz_notify"); - - if (!context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - tz = (TZ_CONTEXT*)*context; - - switch (notify_type) { - - case BM_NOTIFY_DEVICE_ADDED: - status = tz_add_device(device_handle, context); - break; - - case BM_NOTIFY_DEVICE_REMOVED: - status = tz_remove_device(context); - break; - - case TZ_NOTIFY_TEMPERATURE_CHANGE: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Temperature (_TMP) change event detected.\n")); - tz_policy_check(*context); - status = tz_get_temperature(tz); - if (ACPI_SUCCESS(status)) { - status = tz_osl_generate_event(notify_type, tz); - } - break; - - case TZ_NOTIFY_THRESHOLD_CHANGE: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Threshold (_SCP) change event detected.\n")); - status = tz_policy_remove_device(tz); - if (ACPI_SUCCESS(status)) { - status = tz_policy_add_device(tz); - } - status = tz_osl_generate_event(notify_type, tz); - break; - - case TZ_NOTIFY_DEVICE_LISTS_CHANGE: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Device lists (_ALx, _PSL, _TZD) change event detected.\n")); - status = tz_policy_remove_device(tz); - if (ACPI_SUCCESS(status)) { - status = tz_policy_add_device(tz); - } - status = tz_osl_generate_event(notify_type, tz); - break; - - default: - status = AE_SUPPORT; - break; - } - - return_ACPI_STATUS(status); -} - - -/**************************************************************************** - * - * FUNCTION: tz_request - * - ****************************************************************************/ - -acpi_status -tz_request ( - BM_REQUEST *request, - void *context) -{ - acpi_status status = AE_OK; - TZ_CONTEXT *tz = NULL; - - FUNCTION_TRACE("tz_request"); - - /* - * Must have a valid request structure and context. - */ - if (!request || !context) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - tz = (TZ_CONTEXT*)context; - - /* - * Handle request: - * --------------- - */ - switch (request->command) { - - default: - status = AE_SUPPORT; - break; - } - - request->status = status; - - return_ACPI_STATUS(status); -} diff -urN linux-2.4.18/drivers/acpi/ospm/thermal/tz_osl.c lia64-2.4/drivers/acpi/ospm/thermal/tz_osl.c --- linux-2.4.18/drivers/acpi/ospm/thermal/tz_osl.c Wed Dec 26 16:58:37 2001 +++ lia64-2.4/drivers/acpi/ospm/thermal/tz_osl.c Wed Dec 31 16:00:00 1969 @@ -1,398 +0,0 @@ -/****************************************************************************** - * - * Module Name: tz_osl.c - * $Revision: 25 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include -#include -#include -#include -#include -#include "tz.h" - - -MODULE_AUTHOR("Andrew Grover"); -MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Thermal Zone Driver"); -MODULE_LICENSE("GPL"); - -int TZP = 0; -MODULE_PARM(TZP, "i"); -MODULE_PARM_DESC(TZP, "Thermal zone polling frequency, in 1/10 seconds.\n"); - - -#define TZ_PROC_ROOT "thermal" -#define TZ_PROC_STATUS "status" -#define TZ_PROC_INFO "info" - -extern struct proc_dir_entry *bm_proc_root; -static struct proc_dir_entry *tz_proc_root = NULL; - - -/**************************************************************************** - * - * FUNCTION: tz_osl_proc_read_info - * - ****************************************************************************/ - -static int -tz_osl_proc_read_info ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *context) -{ - acpi_status status = AE_OK; - char name[5]; - acpi_buffer buffer = {sizeof(name), &name}; - TZ_CONTEXT *tz = NULL; - TZ_THRESHOLDS *thresholds = NULL; - char *p = page; - int len = 0; - u32 i,j; - u32 t = 0; - - if (!context || (off != 0)) - goto end; - - tz = (TZ_CONTEXT*)context; - - thresholds = &(tz->policy.thresholds); - - p += sprintf(p, "critical (S5): trip=%d\n", thresholds->critical.temperature); - - if (thresholds->hot.is_valid) - p += sprintf(p, "critical (S4): trip=%d\n", thresholds->hot.temperature); - - if (thresholds->passive.is_valid) { - p += sprintf(p, "passive: trip=%d tc1=%d tc2=%d tsp=%d devices=", thresholds->passive.temperature, thresholds->passive.tc1, thresholds->passive.tc2, thresholds->passive.tsp); - for (j=0; jpassive.devices.count; j++) - p += sprintf(p, "%08x%c", thresholds->passive.devices.handles[j], (j==thresholds->passive.devices.count-1)?'\n':','); - } - - for (i=0; iactive[i].is_valid)) - break; - p += sprintf(p, "active[%d]: trip=%d devices=", i, thresholds->active[i].temperature); - for (j=0; jactive[i].devices.count; j++) - p += sprintf(p, "%08x%c", thresholds->active[i].devices.handles[j], (j==thresholds->passive.devices.count-1)?'\n':','); - } - - p += sprintf(p, "cooling mode: "); - switch (tz->policy.cooling_mode) { - case TZ_COOLING_MODE_ACTIVE: - p += sprintf(p, "active (noisy)\n"); - break; - case TZ_COOLING_MODE_PASSIVE: - p += sprintf(p, "passive (quiet)\n"); - break; - default: - p += sprintf(p, "unknown\n"); - break; - } - - p += sprintf(p, "polling: "); - switch (tz->policy.polling_freq) { - case 0: - p += sprintf(p, "disabled\n"); - break; - default: - p += sprintf(p, "%d dS\n", tz->policy.polling_freq); - break; - } - -end: - len = (p - page); - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - - return len; -} - - -/**************************************************************************** - * - * FUNCTION: tz_osl_proc_write_info - * - ****************************************************************************/ - -static int tz_osl_proc_write_info ( - struct file *file, - const char *buffer, - unsigned long count, - void *data) -{ - TZ_CONTEXT *tz = NULL; - u32 state = 0; - u32 size = 0; - - if (!buffer || (count==0) || !data) { - goto end; - } - - tz = (TZ_CONTEXT*)data; - - size = strlen(buffer); - if (size < 4) - goto end; - - /* Cooling preference: "scp=0" (active) or "scp=1" (passive) */ - if (0 == strncmp(buffer, "scp=", 4)) { - tz_set_cooling_preference(tz, (buffer[4] - '0')); - } - - /* Polling frequency: "tzp=X" (poll every X [0-9] seconds) */ - else if (0 == strncmp(buffer, "tzp=", 4)) { - tz->policy.polling_freq = (buffer[4] - '0') * 10; - tz_policy_check(tz); - } - -end: - return count; -} - - -/**************************************************************************** - * - * FUNCTION: tz_osl_proc_read_status - * - ****************************************************************************/ - -static int -tz_osl_proc_read_status ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *context) -{ - TZ_CONTEXT *tz = NULL; - char *p = page; - int len = 0; - - if (!context || (off != 0)) { - goto end; - } - - tz = (TZ_CONTEXT*)context; - - /* Temperature */ - - tz_get_temperature(tz); - - p += sprintf(p, "temperature: %d dK\n", tz->policy.temperature); - - p += sprintf(p, "state: "); - if (tz->policy.state == 0) - p += sprintf(p, "ok\n"); - else if (tz->policy.state & TZ_STATE_CRITICAL) - p += sprintf(p, "critical\n"); - else if (tz->policy.state & TZ_STATE_HOT) - p += sprintf(p, "hot\n"); - else { - if (tz->policy.state & TZ_STATE_ACTIVE) - p += sprintf(p, "active[%d] ", tz->policy.state & 0x07); - if (tz->policy.state & TZ_STATE_PASSIVE) - p += sprintf(p, "passive "); - p += sprintf(p, "\n"); - } - -end: - len = (p - page); - if (len <= off+count) *eof = 1; - *start = page + off; - len -= off; - if (len>count) len = count; - if (len<0) len = 0; - - return(len); -} - - -/**************************************************************************** - * - * FUNCTION: tz_osl_add_device - * - ****************************************************************************/ - -acpi_status -tz_osl_add_device( - TZ_CONTEXT *tz) -{ - struct proc_dir_entry *proc_entry = NULL; - struct proc_dir_entry *proc_child_entry = NULL; - - if (!tz) { - return(AE_BAD_PARAMETER); - } - - printk("ACPI: Thermal Zone found\n"); - - proc_entry = proc_mkdir(tz->uid, tz_proc_root); - if (!proc_entry) - return(AE_ERROR); - - proc_child_entry = create_proc_read_entry(TZ_PROC_STATUS, S_IFREG | S_IRUGO, proc_entry, tz_osl_proc_read_status, (void*)tz); - if (!proc_child_entry) - return(AE_ERROR); - - proc_child_entry = create_proc_entry(TZ_PROC_INFO, S_IFREG | 0644, proc_entry); - if (!proc_child_entry) - return(AE_ERROR); - - proc_child_entry->read_proc = tz_osl_proc_read_info; - proc_child_entry->write_proc = tz_osl_proc_write_info; - proc_child_entry->data = (void*)tz; - - return(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: tz_osl_remove_device - * - ****************************************************************************/ - -acpi_status -tz_osl_remove_device ( - TZ_CONTEXT *tz) -{ - char proc_entry[64]; - - if (!tz) { - return(AE_BAD_PARAMETER); - } - - sprintf(proc_entry, "%s/%s", tz->uid, TZ_PROC_INFO); - remove_proc_entry(proc_entry, tz_proc_root); - - sprintf(proc_entry, "%s/%s", tz->uid, TZ_PROC_STATUS); - remove_proc_entry(proc_entry, tz_proc_root); - - sprintf(proc_entry, "%s", tz->uid); - remove_proc_entry(proc_entry, tz_proc_root); - - return(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: tz_osl_generate_event - * - ****************************************************************************/ - -acpi_status -tz_osl_generate_event ( - u32 event, - TZ_CONTEXT *tz) -{ - acpi_status status = AE_OK; - - if (!tz) { - return(AE_BAD_PARAMETER); - } - - switch (event) { - - case TZ_NOTIFY_TEMPERATURE_CHANGE: - status = bm_osl_generate_event(tz->device_handle, - TZ_PROC_ROOT, tz->uid, event, - tz->policy.temperature); - break; - - case TZ_NOTIFY_THRESHOLD_CHANGE: - case TZ_NOTIFY_DEVICE_LISTS_CHANGE: - status = bm_osl_generate_event(tz->device_handle, - TZ_PROC_ROOT, tz->uid, event, 0); - break; - - default: - return(AE_BAD_PARAMETER); - break; - } - - return(status); -} - - -/**************************************************************************** - * - * FUNCTION: tz_osl_init - * - ****************************************************************************/ - -static int __init -tz_osl_init (void) -{ - acpi_status status = AE_OK; - - /* abort if no busmgr */ - if (!bm_proc_root) - return -ENODEV; - - tz_proc_root = proc_mkdir(TZ_PROC_ROOT, bm_proc_root); - if (!tz_proc_root) { - status = AE_ERROR; - } - else { - status = tz_initialize(); - if (ACPI_FAILURE(status)) { - remove_proc_entry(TZ_PROC_ROOT, bm_proc_root); - } - - } - - return (ACPI_SUCCESS(status)) ? 0 : -ENODEV; -} - - -/**************************************************************************** - * - * FUNCTION: tz_osl_cleanup - * - ****************************************************************************/ - -static void __exit -tz_osl_cleanup (void) -{ - tz_terminate(); - - if (tz_proc_root) { - remove_proc_entry(TZ_PROC_ROOT, bm_proc_root); - } - - return; -} - - -module_init(tz_osl_init); -module_exit(tz_osl_cleanup); diff -urN linux-2.4.18/drivers/acpi/ospm/thermal/tzpolicy.c lia64-2.4/drivers/acpi/ospm/thermal/tzpolicy.c --- linux-2.4.18/drivers/acpi/ospm/thermal/tzpolicy.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/ospm/thermal/tzpolicy.c Wed Dec 31 16:00:00 1969 @@ -1,578 +0,0 @@ -/**************************************************************************** - * - * Module Name: tzpolicy.c - - * $Revision: 30 $ - * - ****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 Andrew Grover - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * TBD: 1. Support performance-limit control for non-processor devices - * (those listed in _TZD, e.g. graphics). - */ - -#include -#include -#include - -#include -#include -#include "tz.h" - - -#define _COMPONENT ACPI_THERMAL - MODULE_NAME ("tzpolicy") - - -/**************************************************************************** - * Globals - ****************************************************************************/ - -void -tz_policy_run ( - unsigned long data); - - -/**************************************************************************** - * Internal Functions - ****************************************************************************/ - -acpi_status -set_performance_limit ( - BM_HANDLE device_handle, - u32 flag) -{ - acpi_status status; - BM_REQUEST request; - - request.status = AE_OK; - request.handle = device_handle; - request.command = PR_COMMAND_SET_PERF_LIMIT; - request.buffer.length = sizeof(u32); - request.buffer.pointer = &flag; - - status = bm_request(&request); - - if (ACPI_FAILURE(status)) - return status; - else - return request.status; -} - - -/**************************************************************************** - * - * FUNCTION: tz_policy_critical - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -tz_policy_critical( - TZ_CONTEXT *tz) -{ - FUNCTION_TRACE("tz_policy_critical"); - - if (!tz) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - if (tz->policy.temperature >= tz->policy.thresholds.critical.temperature) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Critical (S5) threshold reached.\n")); - /* TBD: Need method for shutting down system. */ - } - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: tz_policy_hot - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -tz_policy_hot( - TZ_CONTEXT *tz) -{ - FUNCTION_TRACE("tz_policy_hot"); - - if (!tz || !tz->policy.thresholds.hot.is_valid) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - if (tz->policy.temperature >= tz->policy.thresholds.hot.temperature) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Critical (S4) threshold reached.\n")); - /* TBD: Need method for invoking OS-level critical suspend. */ - } - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: tz_policy_passive - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -tz_policy_passive( - TZ_CONTEXT *tz) -{ - TZ_PASSIVE_THRESHOLD *passive = NULL; - static u32 last_temperature = 0; - s32 trend = 0; - u32 i = 0; - - FUNCTION_TRACE("tz_policy_passive"); - - if (!tz || !tz->policy.thresholds.passive.is_valid) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - passive = &(tz->policy.thresholds.passive); - - if (tz->policy.temperature >= passive->temperature) { - /* - * Thermal trend? - * -------------- - * Using the passive cooling equation (see the ACPI - * Specification), calculate the current thermal trend - * (a.k.a. performance delta). - */ - trend = passive->tc1 * (tz->policy.temperature - last_temperature) + passive->tc2 * (tz->policy.temperature - passive->temperature); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "trend[%d] = TC1[%d]*(temp[%d]-last[%d]) + TC2[%d]*(temp[%d]-passive[%d])\n", trend, passive->tc1, tz->policy.temperature, last_temperature, passive->tc2, tz->policy.temperature, passive->temperature)); - - last_temperature = tz->policy.temperature; - - /* - * Heating Up? - * ----------- - * Decrease thermal performance limit on all passive - * cooling devices (processors). - */ - if (trend > 0) { - for (i=0; idevices.count; i++) - set_performance_limit(passive->devices.handles[i], PR_PERF_DEC); - } - /* - * Cooling Off? - * ------------ - * Increase thermal performance limit on all passive - * cooling devices (processors). - */ - else if (trend < 0) { - for (i=0; idevices.count; i++) - set_performance_limit(passive->devices.handles[i], PR_PERF_INC); - } - } - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: tz_policy_active - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -tz_policy_active( - TZ_CONTEXT *tz) -{ - acpi_status status = AE_OK; - TZ_ACTIVE_THRESHOLD *active = NULL; - u32 i,j = 0; - - FUNCTION_TRACE("tz_policy_active"); - - if (!tz || !tz->policy.thresholds.active[0].is_valid) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - for (i=0; ipolicy.thresholds.active[i]); - if (!active || !active->is_valid) - break; - - /* - * Above Threshold? - * ---------------- - * If not already enabled, turn ON all cooling devices - * associated with this active threshold. - */ - if ((tz->policy.temperature >= active->temperature) && (active->cooling_state != TZ_COOLING_ENABLED)) { - for (j = 0; j < active->devices.count; j++) { - status = bm_set_device_power_state(active->devices.handles[j], ACPI_STATE_D0); - if (ACPI_SUCCESS(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Cooling device [%02x] now ON.\n", active->devices.handles[j])); - } - else { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to turn ON cooling device [%02x].\n", active->devices.handles[j])); - } - } - active->cooling_state = TZ_COOLING_ENABLED; - } - /* - * Below Threshold? - * ---------------- - * Turn OFF all cooling devices associated with this - * threshold. Note that by checking "if not disabled" we - * turn off all cooling devices for thresholds in the - * TZ_COOLING_STATE_UNKNOWN state, useful as a level-set - * during the first pass. - */ - else if (active->cooling_state != TZ_COOLING_DISABLED) { - for (j = 0; j < active->devices.count; j++) { - status = bm_set_device_power_state(active->devices.handles[j], ACPI_STATE_D3); - if (ACPI_SUCCESS(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Cooling device [%02x] now OFF.\n", active->devices.handles[j])); - } - else { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unable to turn OFF cooling device [%02x].\n", active->devices.handles[j])); - } - } - active->cooling_state = TZ_COOLING_DISABLED; - } - } - - return_ACPI_STATUS(AE_OK); -} - - -/**************************************************************************** - * - * FUNCTION: tz_policy_check - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: Note that this function will get called whenever: - * 1. A thermal event occurs. - * 2. The polling/sampling time period expires. - * - ****************************************************************************/ - -void -tz_policy_check ( - void *context) -{ - acpi_status status = AE_OK; - TZ_CONTEXT *tz = NULL; - TZ_POLICY *policy = NULL; - TZ_THRESHOLDS *thresholds = NULL; - u32 previous_temperature = 0; - u32 previous_state = 0; - u32 active_index = 0; - u32 i = 0; - u32 sleep_time = 0; - - FUNCTION_TRACE("tz_policy_check"); - - if (!context) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) context.\n")); - return_VOID; - } - - tz = (TZ_CONTEXT*)context; - policy = &(tz->policy); - thresholds = &(tz->policy.thresholds); - - /* - * Preserve Previous State: - * ------------------------ - */ - previous_temperature = tz->policy.temperature; - previous_state = tz->policy.state; - - /* - * Get Temperature: - * ---------------- - */ - status = tz_get_temperature(tz); - if (ACPI_FAILURE(status)) { - return_VOID; - } - - /* - * Calculate State: - * ---------------- - */ - policy->state = TZ_STATE_OK; - - /* Critical? */ - if (policy->temperature >= thresholds->critical.temperature) - policy->state |= TZ_STATE_CRITICAL; - - /* Hot? */ - if ((thresholds->hot.is_valid) && (policy->temperature >= thresholds->hot.temperature)) - policy->state |= TZ_STATE_CRITICAL; - - /* Passive? */ - if ((thresholds->passive.is_valid) && (policy->temperature >= thresholds->passive.temperature)) - policy->state |= TZ_STATE_PASSIVE; - - /* Active? */ - if (thresholds->active[0].is_valid) { - for (i=0; iactive[i].is_valid) && (policy->temperature >= thresholds->active[i].temperature)) { - policy->state |= TZ_STATE_ACTIVE; - if (i > active_index) - active_index = i; - } - } - policy->state |= active_index; - } - - /* - * Invoke Policy: - * -------------- - * Note that policy must be invoked both when 'going into' a - * policy state (e.g. to allow fans to be turned on) and 'going - * out of' a policy state (e.g. to allow fans to be turned off); - * thus we must preserve the previous state. - */ - if (policy->state & TZ_STATE_CRITICAL) - tz_policy_critical(tz); - if (policy->state & TZ_STATE_HOT) - tz_policy_hot(tz); - if ((policy->state & TZ_STATE_PASSIVE) || (previous_state & TZ_STATE_PASSIVE)) - tz_policy_passive(tz); - if ((policy->state & TZ_STATE_ACTIVE) || (previous_state & TZ_STATE_ACTIVE)) - tz_policy_active(tz); - - /* - * Calculate Sleep Time: - * --------------------- - * If we're in the passive state, use _TSP's value. Otherwise - * use _TZP or the OS's default polling frequency. If no polling - * frequency is specified then we'll wait forever (that is, until - * a thermal event occurs -- e.g. never poll). Note that _TSP - * and _TZD values are given in 1/10th seconds. - */ - if (policy->state & TZ_STATE_PASSIVE) - sleep_time = thresholds->passive.tsp * 100; - else if (policy->polling_freq > 0) - sleep_time = policy->polling_freq * 100; - else - sleep_time = WAIT_FOREVER; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Thermal_zone[%02x]: temperature[%d] state[%08x]\n", tz->device_handle, policy->temperature, policy->state)); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Scheduling next poll in [%d]ms.\n", sleep_time)); - - /* - * Schedule Next Poll: - * ------------------- - */ - if (sleep_time < WAIT_FOREVER) { - if (timer_pending(&(policy->timer))) - mod_timer(&(policy->timer), (HZ*sleep_time)/1000); - else { - policy->timer.data = (u32)tz; - policy->timer.function = tz_policy_run; - policy->timer.expires = jiffies + (HZ*sleep_time)/1000; - add_timer(&(policy->timer)); - } - } - else { - if (timer_pending(&(policy->timer))) - del_timer(&(policy->timer)); - } - - return_VOID; -} - - -/**************************************************************************** - * - * FUNCTION: tz_policy_run - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - - -void -tz_policy_run ( - unsigned long data) -{ - acpi_status status = AE_OK; - - FUNCTION_TRACE("tz_policy_run"); - - if (!data) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) context.\n")); - return_VOID; - } - - /* - * Defer to Non-Interrupt Level: - * ----------------------------- - * Note that all Linux kernel timers run at interrupt-level (ack!). - */ - status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE, tz_policy_check, (void*)data); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Error invoking thermal policy.\n")); - } - - return_VOID; -} - - -/**************************************************************************** - * - * FUNCTION: tz_policy_add_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -tz_policy_add_device ( - TZ_CONTEXT *tz) -{ - acpi_status status = AE_OK; - TZ_THRESHOLDS *thresholds = NULL; - u32 i,j = 0; - - FUNCTION_TRACE("tz_policy_add_device"); - - if (!tz) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Adding policy for thermal zone [%02x].\n", tz->device_handle)); - - /* - * Get Thresholds: - * --------------- - */ - status = tz_get_thresholds(tz); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * Initialize Policies: - * -------------------- - */ - if (tz->policy.thresholds.passive.is_valid) { - for (i=0; ipolicy.thresholds.passive.devices.count; i++) - set_performance_limit(tz->policy.thresholds.passive.devices.handles[i], PR_PERF_MAX); - tz_policy_passive(tz); - } - if (tz->policy.thresholds.active[0].is_valid) - tz_policy_active(tz); - - /* - * Initialize Policy Timer: - * ------------------------ - */ - init_timer(&(tz->policy.timer)); - - /* - * Start Policy: - * ------------- - * Run an initial check using this zone's policy. - */ - tz_policy_check(tz); - - return_ACPI_STATUS(AE_OK); -} - - -/***************************************************************************** - * - * FUNCTION: tz_policy_remove_device - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ****************************************************************************/ - -acpi_status -tz_policy_remove_device( - TZ_CONTEXT *tz) -{ - u32 i = 0; - - FUNCTION_TRACE("tz_remove_device"); - - if (!tz) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing policy for thermal zone [%02x].\n", tz->device_handle)); - - /* - * Delete the thermal zone policy timer entry, if exists. - */ - if (timer_pending(&(tz->policy.timer))) - del_timer(&(tz->policy.timer)); - - /* - * Reset thermal performance limit on all processors back to max. - */ - if (tz->policy.thresholds.passive.is_valid) { - for (i=0; ipolicy.thresholds.passive.devices.count; i++) - set_performance_limit(tz->policy.thresholds.passive.devices.handles[i], PR_PERF_MAX); - } - - return_ACPI_STATUS(AE_OK); -} diff -urN linux-2.4.18/drivers/acpi/parser/Makefile lia64-2.4/drivers/acpi/parser/Makefile --- linux-2.4.18/drivers/acpi/parser/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/parser/Makefile Tue Apr 9 15:47:00 2002 @@ -1,11 +1,10 @@ # # Makefile for all Linux ACPI interpreter subdirectories -# EXCEPT for the ospm directory # O_TARGET := $(notdir $(CURDIR)).o -obj-$(CONFIG_ACPI) := $(patsubst %.c,%.o,$(wildcard *.c)) +obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c)) EXTRA_CFLAGS += $(ACPI_CFLAGS) diff -urN linux-2.4.18/drivers/acpi/parser/psargs.c lia64-2.4/drivers/acpi/parser/psargs.c --- linux-2.4.18/drivers/acpi/parser/psargs.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/parser/psargs.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: psargs - Parse AML opcode arguments - * $Revision: 52 $ + * $Revision: 61 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ #include "acnamesp.h" #define _COMPONENT ACPI_PARSER - MODULE_NAME ("psargs") + ACPI_MODULE_NAME ("psargs") /******************************************************************************* @@ -54,10 +54,10 @@ u32 length = 0; - FUNCTION_TRACE ("Ps_get_next_package_length"); + ACPI_FUNCTION_TRACE ("Ps_get_next_package_length"); - encoded_length = (u32) GET8 (parser_state->aml); + encoded_length = (u32) ACPI_GET8 (parser_state->aml); parser_state->aml++; @@ -70,7 +70,7 @@ case 1: /* 2-byte encoding (next byte + bits 0-3) */ - length = ((GET8 (parser_state->aml) << 04) | + length = ((ACPI_GET8 (parser_state->aml) << 04) | (encoded_length & 0x0F)); parser_state->aml++; break; @@ -78,8 +78,8 @@ case 2: /* 3-byte encoding (next 2 bytes + bits 0-3) */ - length = ((GET8 (parser_state->aml + 1) << 12) | - (GET8 (parser_state->aml) << 04) | + length = ((ACPI_GET8 (parser_state->aml + 1) << 12) | + (ACPI_GET8 (parser_state->aml) << 04) | (encoded_length & 0x0F)); parser_state->aml += 2; break; @@ -87,12 +87,16 @@ case 3: /* 4-byte encoding (next 3 bytes + bits 0-3) */ - length = ((GET8 (parser_state->aml + 2) << 20) | - (GET8 (parser_state->aml + 1) << 12) | - (GET8 (parser_state->aml) << 04) | + length = ((ACPI_GET8 (parser_state->aml + 2) << 20) | + (ACPI_GET8 (parser_state->aml + 1) << 12) | + (ACPI_GET8 (parser_state->aml) << 04) | (encoded_length & 0x0F)); parser_state->aml += 3; break; + + default: + /* Can't get here, only 2 bits / 4 cases */ + break; } return_VALUE (length); @@ -120,7 +124,7 @@ NATIVE_UINT length; - FUNCTION_TRACE ("Ps_get_next_package_end"); + ACPI_FUNCTION_TRACE ("Ps_get_next_package_end"); length = (NATIVE_UINT) acpi_ps_get_next_package_length (parser_state); @@ -148,17 +152,16 @@ acpi_ps_get_next_namestring ( acpi_parse_state *parser_state) { - u8 *start = parser_state->aml; - u8 *end = parser_state->aml; - u32 length; + u8 *start = parser_state->aml; + u8 *end = parser_state->aml; - FUNCTION_TRACE ("Ps_get_next_namestring"); + ACPI_FUNCTION_TRACE ("Ps_get_next_namestring"); /* Handle multiple prefix characters */ - while (acpi_ps_is_prefix_char (GET8 (end))) { + while (acpi_ps_is_prefix_char (ACPI_GET8 (end))) { /* include prefix '\\' or '^' */ end++; @@ -166,7 +169,7 @@ /* Decode the path */ - switch (GET8 (end)) { + switch (ACPI_GET8 (end)) { case 0: /* Null_name */ @@ -177,35 +180,29 @@ end++; break; - case AML_DUAL_NAME_PREFIX: - /* two name segments */ + /* Two name segments */ end += 9; break; - case AML_MULTI_NAME_PREFIX_OP: - /* multiple name segments */ + /* Multiple name segments, 4 chars each */ - length = (u32) GET8 (end + 1) * 4; - end += 2 + length; + end += 2 + ((ACPI_SIZE) ACPI_GET8 (end + 1) * 4); break; - default: - /* single name segment */ - /* assert (Acpi_ps_is_lead (GET8 (End))); */ + /* Single name segment */ end += 4; break; } parser_state->aml = (u8*) end; - return_PTR ((NATIVE_CHAR *) start); } @@ -247,7 +244,7 @@ acpi_parse_object *count; - FUNCTION_TRACE ("Ps_get_next_namepath"); + ACPI_FUNCTION_TRACE ("Ps_get_next_namepath"); path = acpi_ps_get_next_namestring (parser_state); @@ -255,7 +252,7 @@ /* Null name case, create a null namepath object */ acpi_ps_init_op (arg, AML_INT_NAMEPATH_OP); - arg->value.name = path; + arg->common.value.name = path; return_VOID; } @@ -271,7 +268,7 @@ } if (op) { - if (op->opcode == AML_METHOD_OP) { + if (op->common.aml_opcode == AML_METHOD_OP) { /* * The name refers to a control method, so this namepath is a * method invocation. We need to 1) Get the number of arguments @@ -279,21 +276,21 @@ * object into a METHODCALL object. */ count = acpi_ps_get_arg (op, 0); - if (count && count->opcode == AML_BYTE_OP) { + if (count && count->common.aml_opcode == AML_BYTE_OP) { name_op = acpi_ps_alloc_op (AML_INT_NAMEPATH_OP); if (name_op) { /* Change arg into a METHOD CALL and attach the name */ acpi_ps_init_op (arg, AML_INT_METHODCALL_OP); - name_op->value.name = path; + name_op->common.value.name = path; /* Point METHODCALL/NAME to the METHOD Node */ - name_op->node = (acpi_namespace_node *) op; + name_op->common.node = (acpi_namespace_node *) op; acpi_ps_append_arg (arg, name_op); - *arg_count = (u32) count->value.integer & + *arg_count = (u32) count->common.value.integer & METHOD_FLAGS_ARG_COUNT; } } @@ -315,7 +312,7 @@ * pathname */ acpi_ps_init_op (arg, AML_INT_NAMEPATH_OP); - arg->value.name = path; + arg->common.value.name = path; return_VOID; @@ -340,7 +337,7 @@ acpi_generic_state scope_info; - FUNCTION_TRACE ("Ps_get_next_namepath"); + ACPI_FUNCTION_TRACE ("Ps_get_next_namepath"); path = acpi_ps_get_next_namestring (parser_state); @@ -348,65 +345,62 @@ /* Null name case, create a null namepath object */ acpi_ps_init_op (arg, AML_INT_NAMEPATH_OP); - arg->value.name = path; + arg->common.value.name = path; return_VOID; } + /* + * Lookup the name in the internal namespace + */ + scope_info.scope.node = NULL; + node = parser_state->start_node; + if (node) { + scope_info.scope.node = node; + } - if (method_call) { - /* - * Lookup the name in the internal namespace - */ - scope_info.scope.node = NULL; - node = parser_state->start_node; - if (node) { - scope_info.scope.node = node; - } - - /* - * Lookup object. We don't want to add anything new to the namespace - * here, however. So we use MODE_EXECUTE. Allow searching of the - * parent tree, but don't open a new scope -- we just want to lookup the - * object (MUST BE mode EXECUTE to perform upsearch) - */ - status = acpi_ns_lookup (&scope_info, path, ACPI_TYPE_ANY, IMODE_EXECUTE, - NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE, NULL, - &node); - if (ACPI_SUCCESS (status)) { - if (node->type == ACPI_TYPE_METHOD) { - method_node = node; - ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "method - %p Path=%p\n", - method_node, path)); - - name_op = acpi_ps_alloc_op (AML_INT_NAMEPATH_OP); - if (name_op) { - /* Change arg into a METHOD CALL and attach name to it */ - - acpi_ps_init_op (arg, AML_INT_METHODCALL_OP); - - name_op->value.name = path; - - /* Point METHODCALL/NAME to the METHOD Node */ + /* + * Lookup object. We don't want to add anything new to the namespace + * here, however. So we use MODE_EXECUTE. Allow searching of the + * parent tree, but don't open a new scope -- we just want to lookup the + * object (MUST BE mode EXECUTE to perform upsearch) + */ + status = acpi_ns_lookup (&scope_info, path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, + ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, + &node); + if (ACPI_SUCCESS (status)) { + if (node->type == ACPI_TYPE_METHOD) { + method_node = node; + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "method - %p Path=%p\n", + method_node, path)); + + name_op = acpi_ps_alloc_op (AML_INT_NAMEPATH_OP); + if (name_op) { + /* Change arg into a METHOD CALL and attach name to it */ + + acpi_ps_init_op (arg, AML_INT_METHODCALL_OP); + + name_op->common.value.name = path; - name_op->node = method_node; - acpi_ps_append_arg (arg, name_op); + /* Point METHODCALL/NAME to the METHOD Node */ - if (!method_node->object) { - return_VOID; - } + name_op->common.node = method_node; + acpi_ps_append_arg (arg, name_op); - *arg_count = (method_node->object)->method.param_count; + if (!acpi_ns_get_attached_object (method_node)) { + return_VOID; } - return_VOID; + *arg_count = (acpi_ns_get_attached_object (method_node))->method.param_count; } - /* - * Else this is normal named object reference. - * Just init the NAMEPATH object with the pathname. - * (See code below) - */ + return_VOID; } + + /* + * Else this is normal named object reference. + * Just init the NAMEPATH object with the pathname. + * (See code below) + */ } /* @@ -415,7 +409,7 @@ * pathname. */ acpi_ps_init_op (arg, AML_INT_NAMEPATH_OP); - arg->value.name = path; + arg->common.value.name = path; return_VOID; @@ -444,15 +438,14 @@ acpi_parse_object *arg) { - FUNCTION_TRACE_U32 ("Ps_get_next_simple_arg", arg_type); + ACPI_FUNCTION_TRACE_U32 ("Ps_get_next_simple_arg", arg_type); switch (arg_type) { - case ARGP_BYTEDATA: acpi_ps_init_op (arg, AML_BYTE_OP); - arg->value.integer = (u32) GET8 (parser_state->aml); + arg->common.value.integer = (u32) ACPI_GET8 (parser_state->aml); parser_state->aml++; break; @@ -463,7 +456,7 @@ /* Get 2 bytes from the AML stream */ - MOVE_UNALIGNED16_TO_32 (&arg->value.integer, parser_state->aml); + ACPI_MOVE_UNALIGNED16_TO_32 (&arg->common.value.integer, parser_state->aml); parser_state->aml += 2; break; @@ -474,7 +467,7 @@ /* Get 4 bytes from the AML stream */ - MOVE_UNALIGNED32_TO_32 (&arg->value.integer, parser_state->aml); + ACPI_MOVE_UNALIGNED32_TO_32 (&arg->common.value.integer, parser_state->aml); parser_state->aml += 4; break; @@ -485,7 +478,7 @@ /* Get 8 bytes from the AML stream */ - MOVE_UNALIGNED64_TO_64 (&arg->value.integer, parser_state->aml); + ACPI_MOVE_UNALIGNED64_TO_64 (&arg->common.value.integer, parser_state->aml); parser_state->aml += 8; break; @@ -493,9 +486,9 @@ case ARGP_CHARLIST: acpi_ps_init_op (arg, AML_STRING_OP); - arg->value.string = (char*) parser_state->aml; + arg->common.value.string = (char *) parser_state->aml; - while (GET8 (parser_state->aml) != '\0') { + while (ACPI_GET8 (parser_state->aml) != '\0') { parser_state->aml++; } parser_state->aml++; @@ -506,7 +499,12 @@ case ARGP_NAMESTRING: acpi_ps_init_op (arg, AML_INT_NAMEPATH_OP); - arg->value.name = acpi_ps_get_next_namestring (parser_state); + arg->common.value.name = acpi_ps_get_next_namestring (parser_state); + break; + + + default: + ACPI_REPORT_ERROR (("Invalid Arg_type %X\n", arg_type)); break; } @@ -530,33 +528,30 @@ acpi_ps_get_next_field ( acpi_parse_state *parser_state) { - u32 aml_offset = parser_state->aml - - parser_state->aml_start; + u32 aml_offset = ACPI_PTR_DIFF (parser_state->aml, + parser_state->aml_start); acpi_parse_object *field; u16 opcode; u32 name; - FUNCTION_TRACE ("Ps_get_next_field"); + ACPI_FUNCTION_TRACE ("Ps_get_next_field"); /* determine field type */ - switch (GET8 (parser_state->aml)) { - + switch (ACPI_GET8 (parser_state->aml)) { default: opcode = AML_INT_NAMEDFIELD_OP; break; - case 0x00: opcode = AML_INT_RESERVEDFIELD_OP; parser_state->aml++; break; - case 0x01: opcode = AML_INT_ACCESSFIELD_OP; @@ -568,43 +563,52 @@ /* Allocate a new field op */ field = acpi_ps_alloc_op (opcode); - if (field) { - field->aml_offset = aml_offset; + if (!field) { + return_PTR (NULL); + } - /* Decode the field type */ + field->common.aml_offset = aml_offset; - switch (opcode) { - case AML_INT_NAMEDFIELD_OP: + /* Decode the field type */ - /* Get the 4-character name */ + switch (opcode) { + case AML_INT_NAMEDFIELD_OP: - MOVE_UNALIGNED32_TO_32 (&name, parser_state->aml); - acpi_ps_set_name (field, name); - parser_state->aml += 4; + /* Get the 4-character name */ - /* Get the length which is encoded as a package length */ + ACPI_MOVE_UNALIGNED32_TO_32 (&name, parser_state->aml); + acpi_ps_set_name (field, name); + parser_state->aml += 4; - field->value.size = acpi_ps_get_next_package_length (parser_state); - break; + /* Get the length which is encoded as a package length */ + field->common.value.size = acpi_ps_get_next_package_length (parser_state); + break; - case AML_INT_RESERVEDFIELD_OP: - /* Get the length which is encoded as a package length */ + case AML_INT_RESERVEDFIELD_OP: - field->value.size = acpi_ps_get_next_package_length (parser_state); - break; + /* Get the length which is encoded as a package length */ + field->common.value.size = acpi_ps_get_next_package_length (parser_state); + break; - case AML_INT_ACCESSFIELD_OP: - /* Get Access_type and Access_atrib and merge into the field Op */ + case AML_INT_ACCESSFIELD_OP: - field->value.integer = ((GET8 (parser_state->aml) << 8) | - GET8 (parser_state->aml)); - parser_state->aml += 2; - break; - } + /* + * Get Access_type and Access_attrib and merge into the field Op + * Access_type is first operand, Access_attribute is second + */ + field->common.value.integer32 = (ACPI_GET8 (parser_state->aml) << 8); + parser_state->aml++; + field->common.value.integer32 |= ACPI_GET8 (parser_state->aml); + parser_state->aml++; + break; + + default: + /* Opcode was set in previous switch */ + break; } return_PTR (field); @@ -639,7 +643,7 @@ u32 subop; - FUNCTION_TRACE_PTR ("Ps_get_next_arg", parser_state); + ACPI_FUNCTION_TRACE_PTR ("Ps_get_next_arg", parser_state); switch (arg_type) { @@ -679,7 +683,7 @@ } if (prev) { - prev->next = field; + prev->common.next = field; } else { @@ -705,8 +709,8 @@ if (arg) { /* fill in bytelist data */ - arg->value.size = (parser_state->pkg_end - parser_state->aml); - ((acpi_parse2_object *) arg)->data = parser_state->aml; + arg->common.value.size = ACPI_PTR_DIFF (parser_state->pkg_end, parser_state->aml); + arg->named.data = parser_state->aml; } /* skip to End of byte data */ @@ -717,7 +721,8 @@ case ARGP_TARGET: - case ARGP_SUPERNAME: { + case ARGP_SUPERNAME: + case ARGP_SIMPLENAME: { subop = acpi_ps_peek_opcode (parser_state); if (subop == 0 || acpi_ps_is_leading_char (subop) || @@ -757,6 +762,10 @@ *arg_count = ACPI_VAR_ARGS; } + break; + + default: + ACPI_REPORT_ERROR (("Invalid Arg_type: %X\n", arg_type)); break; } diff -urN linux-2.4.18/drivers/acpi/parser/psopcode.c lia64-2.4/drivers/acpi/parser/psopcode.c --- linux-2.4.18/drivers/acpi/parser/psopcode.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/parser/psopcode.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: psopcode - Parser/Interpreter opcode information table - * $Revision: 49 $ + * $Revision: 69 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ #define _COMPONENT ACPI_PARSER - MODULE_NAME ("psopcode") + ACPI_MODULE_NAME ("psopcode") #define _UNK 0x6B @@ -45,9 +45,9 @@ #define _UNKNOWN_OPCODE 0x02 /* An example unknown opcode */ #define MAX_EXTENDED_OPCODE 0x88 -#define NUM_EXTENDED_OPCODE MAX_EXTENDED_OPCODE + 1 +#define NUM_EXTENDED_OPCODE (MAX_EXTENDED_OPCODE + 1) #define MAX_INTERNAL_OPCODE -#define NUM_INTERNAL_OPCODE MAX_INTERNAL_OPCODE + 1 +#define NUM_INTERNAL_OPCODE (MAX_INTERNAL_OPCODE + 1) /******************************************************************************* @@ -184,7 +184,7 @@ #define ARGP_TO_STRING_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) #define ARGP_TYPE_OP ARGP_LIST1 (ARGP_SUPERNAME) #define ARGP_UNLOAD_OP ARGP_LIST1 (ARGP_SUPERNAME) -#define ARGP_VAR_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_BYTEDATA, ARGP_DATAOBJLIST) +#define ARGP_VAR_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_DATAOBJLIST) #define ARGP_WAIT_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG) #define ARGP_WHILE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_TERMLIST) #define ARGP_WORD_OP ARGP_LIST1 (ARGP_WORDDATA) @@ -219,7 +219,7 @@ #define ARGI_BIT_XOR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_BREAK_OP ARG_NONE #define ARGI_BREAK_POINT_OP ARG_NONE -#define ARGI_BUFFER_OP ARGI_INVALID_OPCODE +#define ARGI_BUFFER_OP ARGI_LIST1 (ARGI_INTEGER) #define ARGI_BYTE_OP ARGI_INVALID_OPCODE #define ARGI_BYTELIST_OP ARGI_INVALID_OPCODE #define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF) @@ -236,7 +236,7 @@ #define ARGI_DATA_REGION_OP ARGI_LIST3 (ARGI_STRING, ARGI_STRING, ARGI_STRING) #define ARGI_DEBUG_OP ARG_NONE #define ARGI_DECREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF) -#define ARGI_DEREF_OF_OP ARGI_LIST1 (ARGI_REFERENCE) +#define ARGI_DEREF_OF_OP ARGI_LIST1 (ARGI_REF_OR_STRING) #define ARGI_DEVICE_OP ARGI_INVALID_OPCODE #define ARGI_DIVIDE_OP ARGI_LIST4 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF, ARGI_TARGETREF) #define ARGI_DWORD_OP ARGI_INVALID_OPCODE @@ -260,7 +260,7 @@ #define ARGI_LNOT_OP ARGI_LIST1 (ARGI_INTEGER) #define ARGI_LNOTEQUAL_OP ARGI_INVALID_OPCODE #define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION, ARGI_TARGETREF) -#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_TARGETREF) +#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_ANYTYPE) #define ARGI_LOCAL0 ARG_NONE #define ARGI_LOCAL1 ARG_NONE #define ARGI_LOCAL2 ARG_NONE @@ -284,7 +284,7 @@ #define ARGI_NOTIFY_OP ARGI_LIST2 (ARGI_DEVICE_REF, ARGI_INTEGER) #define ARGI_ONE_OP ARG_NONE #define ARGI_ONES_OP ARG_NONE -#define ARGI_PACKAGE_OP ARGI_INVALID_OPCODE +#define ARGI_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER) #define ARGI_POWER_RES_OP ARGI_INVALID_OPCODE #define ARGI_PROCESSOR_OP ARGI_INVALID_OPCODE #define ARGI_QWORD_OP ARGI_INVALID_OPCODE @@ -315,7 +315,7 @@ #define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_FIXED_TARGET) #define ARGI_TYPE_OP ARGI_LIST1 (ARGI_ANYTYPE) #define ARGI_UNLOAD_OP ARGI_LIST1 (ARGI_DDBHANDLE) -#define ARGI_VAR_PACKAGE_OP ARGI_INVALID_OPCODE +#define ARGI_VAR_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER) #define ARGI_WAIT_OP ARGI_LIST2 (ARGI_EVENT, ARGI_INTEGER) #define ARGI_WHILE_OP ARGI_INVALID_OPCODE #define ARGI_WORD_OP ARGI_INVALID_OPCODE @@ -328,7 +328,7 @@ /****************************************************************************** - Opcodes that have associated namespace objects + Opcodes that have associated namespace objects (AML_NSOBJECT flag) AML_SCOPE_OP AML_DEVICE_OP @@ -354,7 +354,7 @@ AML_INT_METHODCALL_OP AML_INT_NAMEPATH_OP - Opcodes that are "namespace" opcodes + Opcodes that are "namespace" opcodes (AML_NSOPCODE flag) AML_SCOPE_OP AML_DEVICE_OP @@ -372,7 +372,7 @@ AML_REGION_OP AML_INT_NAMEDFIELD_OP - Opcodes that have an associated namespace node + Opcodes that have an associated namespace node (AML_NSNODE flag) AML_SCOPE_OP AML_DEVICE_OP @@ -395,7 +395,7 @@ AML_INT_METHODCALL_OP AML_INT_NAMEPATH_OP - Opcodes that define named ACPI objects + Opcodes that define named ACPI objects (AML_NAMED flag) AML_SCOPE_OP AML_DEVICE_OP @@ -410,8 +410,8 @@ AML_REGION_OP AML_INT_NAMEDFIELD_OP - Opcodes that contain executable AML as part of the definition that - must be deferred until needed + Opcodes that contain executable AML as part of the definition that + must be deferred until needed AML_METHOD_OP AML_VAR_PACKAGE_OP @@ -422,6 +422,7 @@ AML_CREATE_DWORD_FIELD_OP AML_CREATE_QWORD_FIELD_OP AML_REGION_OP + AML_BUFFER_OP Field opcodes @@ -447,146 +448,149 @@ */ -static const acpi_opcode_info aml_op_info[] = +const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = { -/* Index Name Parser Args Interpreter Args Class Type Flags */ +/*! [Begin] no source code translation */ +/* Index Name Parser Args Interpreter Args ObjectType Class Type Flags */ -/* 00 */ ACPI_OP ("Zero", ARGP_ZERO_OP, ARGI_ZERO_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), -/* 01 */ ACPI_OP ("One", ARGP_ONE_OP, ARGI_ONE_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), -/* 02 */ ACPI_OP ("Alias", ARGP_ALIAS_OP, ARGI_ALIAS_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 03 */ ACPI_OP ("Name", ARGP_NAME_OP, ARGI_NAME_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 04 */ ACPI_OP ("Byte_const", ARGP_BYTE_OP, ARGI_BYTE_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), -/* 05 */ ACPI_OP ("Word_const", ARGP_WORD_OP, ARGI_WORD_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), -/* 06 */ ACPI_OP ("Dword_const", ARGP_DWORD_OP, ARGI_DWORD_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), -/* 07 */ ACPI_OP ("String", ARGP_STRING_OP, ARGI_STRING_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), -/* 08 */ ACPI_OP ("Scope", ARGP_SCOPE_OP, ARGI_SCOPE_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 09 */ ACPI_OP ("Buffer", ARGP_BUFFER_OP, ARGI_BUFFER_OP, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS), -/* 0A */ ACPI_OP ("Package", ARGP_PACKAGE_OP, ARGI_PACKAGE_OP, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS), -/* 0B */ ACPI_OP ("Method", ARGP_METHOD_OP, ARGI_METHOD_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER), -/* 0C */ ACPI_OP ("Local0", ARGP_LOCAL0, ARGI_LOCAL0, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 0D */ ACPI_OP ("Local1", ARGP_LOCAL1, ARGI_LOCAL1, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 0E */ ACPI_OP ("Local2", ARGP_LOCAL2, ARGI_LOCAL2, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 0F */ ACPI_OP ("Local3", ARGP_LOCAL3, ARGI_LOCAL3, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 10 */ ACPI_OP ("Local4", ARGP_LOCAL4, ARGI_LOCAL4, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 11 */ ACPI_OP ("Local5", ARGP_LOCAL5, ARGI_LOCAL5, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 12 */ ACPI_OP ("Local6", ARGP_LOCAL6, ARGI_LOCAL6, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 13 */ ACPI_OP ("Local7", ARGP_LOCAL7, ARGI_LOCAL7, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 14 */ ACPI_OP ("Arg0", ARGP_ARG0, ARGI_ARG0, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 15 */ ACPI_OP ("Arg1", ARGP_ARG1, ARGI_ARG1, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 16 */ ACPI_OP ("Arg2", ARGP_ARG2, ARGI_ARG2, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 17 */ ACPI_OP ("Arg3", ARGP_ARG3, ARGI_ARG3, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 18 */ ACPI_OP ("Arg4", ARGP_ARG4, ARGI_ARG4, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 19 */ ACPI_OP ("Arg5", ARGP_ARG5, ARGI_ARG5, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 1_a */ ACPI_OP ("Arg6", ARGP_ARG6, ARGI_ARG6, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 1_b */ ACPI_OP ("Store", ARGP_STORE_OP, ARGI_STORE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 1_c */ ACPI_OP ("Ref_of", ARGP_REF_OF_OP, ARGI_REF_OF_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 1_d */ ACPI_OP ("Add", ARGP_ADD_OP, ARGI_ADD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 1_e */ ACPI_OP ("Concatenate", ARGP_CONCAT_OP, ARGI_CONCAT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), -/* 1_f */ ACPI_OP ("Subtract", ARGP_SUBTRACT_OP, ARGI_SUBTRACT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 20 */ ACPI_OP ("Increment", ARGP_INCREMENT_OP, ARGI_INCREMENT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 21 */ ACPI_OP ("Decrement", ARGP_DECREMENT_OP, ARGI_DECREMENT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 22 */ ACPI_OP ("Multiply", ARGP_MULTIPLY_OP, ARGI_MULTIPLY_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 23 */ ACPI_OP ("Divide", ARGP_DIVIDE_OP, ARGI_DIVIDE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_2T_1R, AML_FLAGS_EXEC_2A_2T_1R), -/* 24 */ ACPI_OP ("Shift_left", ARGP_SHIFT_LEFT_OP, ARGI_SHIFT_LEFT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 25 */ ACPI_OP ("Shift_right", ARGP_SHIFT_RIGHT_OP, ARGI_SHIFT_RIGHT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 26 */ ACPI_OP ("And", ARGP_BIT_AND_OP, ARGI_BIT_AND_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 27 */ ACPI_OP ("NAnd", ARGP_BIT_NAND_OP, ARGI_BIT_NAND_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 28 */ ACPI_OP ("Or", ARGP_BIT_OR_OP, ARGI_BIT_OR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 29 */ ACPI_OP ("NOr", ARGP_BIT_NOR_OP, ARGI_BIT_NOR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 2_a */ ACPI_OP ("XOr", ARGP_BIT_XOR_OP, ARGI_BIT_XOR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 2_b */ ACPI_OP ("Not", ARGP_BIT_NOT_OP, ARGI_BIT_NOT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 2_c */ ACPI_OP ("Find_set_left_bit", ARGP_FIND_SET_LEFT_BIT_OP, ARGI_FIND_SET_LEFT_BIT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 2_d */ ACPI_OP ("Find_set_right_bit", ARGP_FIND_SET_RIGHT_BIT_OP,ARGI_FIND_SET_RIGHT_BIT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 2_e */ ACPI_OP ("Deref_of", ARGP_DEREF_OF_OP, ARGI_DEREF_OF_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 2_f */ ACPI_OP ("Notify", ARGP_NOTIFY_OP, ARGI_NOTIFY_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_0R, AML_FLAGS_EXEC_2A_0T_0R), -/* 30 */ ACPI_OP ("Size_of", ARGP_SIZE_OF_OP, ARGI_SIZE_OF_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 31 */ ACPI_OP ("Index", ARGP_INDEX_OP, ARGI_INDEX_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), -/* 32 */ ACPI_OP ("Match", ARGP_MATCH_OP, ARGI_MATCH_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R), -/* 33 */ ACPI_OP ("Create_dWord_field", ARGP_CREATE_DWORD_FIELD_OP,ARGI_CREATE_DWORD_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), -/* 34 */ ACPI_OP ("Create_word_field", ARGP_CREATE_WORD_FIELD_OP, ARGI_CREATE_WORD_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), -/* 35 */ ACPI_OP ("Create_byte_field", ARGP_CREATE_BYTE_FIELD_OP, ARGI_CREATE_BYTE_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), -/* 36 */ ACPI_OP ("Create_bit_field", ARGP_CREATE_BIT_FIELD_OP, ARGI_CREATE_BIT_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), -/* 37 */ ACPI_OP ("Object_type", ARGP_TYPE_OP, ARGI_TYPE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 38 */ ACPI_OP ("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), -/* 39 */ ACPI_OP ("LOr", ARGP_LOR_OP, ARGI_LOR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), -/* 3_a */ ACPI_OP ("LNot", ARGP_LNOT_OP, ARGI_LNOT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 3_b */ ACPI_OP ("LEqual", ARGP_LEQUAL_OP, ARGI_LEQUAL_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), -/* 3_c */ ACPI_OP ("LGreater", ARGP_LGREATER_OP, ARGI_LGREATER_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), -/* 3_d */ ACPI_OP ("LLess", ARGP_LLESS_OP, ARGI_LLESS_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), -/* 3_e */ ACPI_OP ("If", ARGP_IF_OP, ARGI_IF_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), -/* 3_f */ ACPI_OP ("Else", ARGP_ELSE_OP, ARGI_ELSE_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), -/* 40 */ ACPI_OP ("While", ARGP_WHILE_OP, ARGI_WHILE_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), -/* 41 */ ACPI_OP ("Noop", ARGP_NOOP_OP, ARGI_NOOP_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), -/* 42 */ ACPI_OP ("Return", ARGP_RETURN_OP, ARGI_RETURN_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), -/* 43 */ ACPI_OP ("Break", ARGP_BREAK_OP, ARGI_BREAK_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), -/* 44 */ ACPI_OP ("Break_point", ARGP_BREAK_POINT_OP, ARGI_BREAK_POINT_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), -/* 45 */ ACPI_OP ("Ones", ARGP_ONES_OP, ARGI_ONES_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), +/* 00 */ ACPI_OP ("Zero", ARGP_ZERO_OP, ARGI_ZERO_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT), +/* 01 */ ACPI_OP ("One", ARGP_ONE_OP, ARGI_ONE_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT), +/* 02 */ ACPI_OP ("Alias", ARGP_ALIAS_OP, ARGI_ALIAS_OP, INTERNAL_TYPE_ALIAS, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 03 */ ACPI_OP ("Name", ARGP_NAME_OP, ARGI_NAME_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 04 */ ACPI_OP ("ByteConst", ARGP_BYTE_OP, ARGI_BYTE_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT), +/* 05 */ ACPI_OP ("WordConst", ARGP_WORD_OP, ARGI_WORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT), +/* 06 */ ACPI_OP ("DwordConst", ARGP_DWORD_OP, ARGI_DWORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT), +/* 07 */ ACPI_OP ("String", ARGP_STRING_OP, ARGI_STRING_OP, ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT), +/* 08 */ ACPI_OP ("Scope", ARGP_SCOPE_OP, ARGI_SCOPE_OP, INTERNAL_TYPE_SCOPE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 09 */ ACPI_OP ("Buffer", ARGP_BUFFER_OP, ARGI_BUFFER_OP, ACPI_TYPE_BUFFER, AML_CLASS_CREATE, AML_TYPE_CREATE_OBJECT, AML_HAS_ARGS | AML_DEFER | AML_CONSTANT), +/* 0A */ ACPI_OP ("Package", ARGP_PACKAGE_OP, ARGI_PACKAGE_OP, ACPI_TYPE_PACKAGE, AML_CLASS_CREATE, AML_TYPE_CREATE_OBJECT, AML_HAS_ARGS | AML_DEFER | AML_CONSTANT), +/* 0B */ ACPI_OP ("Method", ARGP_METHOD_OP, ARGI_METHOD_OP, ACPI_TYPE_METHOD, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER), +/* 0C */ ACPI_OP ("Local0", ARGP_LOCAL0, ARGI_LOCAL0, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 0D */ ACPI_OP ("Local1", ARGP_LOCAL1, ARGI_LOCAL1, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 0E */ ACPI_OP ("Local2", ARGP_LOCAL2, ARGI_LOCAL2, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 0F */ ACPI_OP ("Local3", ARGP_LOCAL3, ARGI_LOCAL3, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 10 */ ACPI_OP ("Local4", ARGP_LOCAL4, ARGI_LOCAL4, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 11 */ ACPI_OP ("Local5", ARGP_LOCAL5, ARGI_LOCAL5, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 12 */ ACPI_OP ("Local6", ARGP_LOCAL6, ARGI_LOCAL6, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 13 */ ACPI_OP ("Local7", ARGP_LOCAL7, ARGI_LOCAL7, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 14 */ ACPI_OP ("Arg0", ARGP_ARG0, ARGI_ARG0, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 15 */ ACPI_OP ("Arg1", ARGP_ARG1, ARGI_ARG1, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 16 */ ACPI_OP ("Arg2", ARGP_ARG2, ARGI_ARG2, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 17 */ ACPI_OP ("Arg3", ARGP_ARG3, ARGI_ARG3, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 18 */ ACPI_OP ("Arg4", ARGP_ARG4, ARGI_ARG4, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 19 */ ACPI_OP ("Arg5", ARGP_ARG5, ARGI_ARG5, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 1A */ ACPI_OP ("Arg6", ARGP_ARG6, ARGI_ARG6, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 1B */ ACPI_OP ("Store", ARGP_STORE_OP, ARGI_STORE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 1C */ ACPI_OP ("RefOf", ARGP_REF_OF_OP, ARGI_REF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), +/* 1D */ ACPI_OP ("Add", ARGP_ADD_OP, ARGI_ADD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT), +/* 1E */ ACPI_OP ("Concatenate", ARGP_CONCAT_OP, ARGI_CONCAT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT), +/* 1F */ ACPI_OP ("Subtract", ARGP_SUBTRACT_OP, ARGI_SUBTRACT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT), +/* 20 */ ACPI_OP ("Increment", ARGP_INCREMENT_OP, ARGI_INCREMENT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT), +/* 21 */ ACPI_OP ("Decrement", ARGP_DECREMENT_OP, ARGI_DECREMENT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT), +/* 22 */ ACPI_OP ("Multiply", ARGP_MULTIPLY_OP, ARGI_MULTIPLY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT), +/* 23 */ ACPI_OP ("Divide", ARGP_DIVIDE_OP, ARGI_DIVIDE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_2T_1R, AML_FLAGS_EXEC_2A_2T_1R | AML_CONSTANT), +/* 24 */ ACPI_OP ("ShiftLeft", ARGP_SHIFT_LEFT_OP, ARGI_SHIFT_LEFT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT), +/* 25 */ ACPI_OP ("ShiftRight", ARGP_SHIFT_RIGHT_OP, ARGI_SHIFT_RIGHT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT), +/* 26 */ ACPI_OP ("And", ARGP_BIT_AND_OP, ARGI_BIT_AND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT), +/* 27 */ ACPI_OP ("NAnd", ARGP_BIT_NAND_OP, ARGI_BIT_NAND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT), +/* 28 */ ACPI_OP ("Or", ARGP_BIT_OR_OP, ARGI_BIT_OR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT), +/* 29 */ ACPI_OP ("NOr", ARGP_BIT_NOR_OP, ARGI_BIT_NOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT), +/* 2A */ ACPI_OP ("XOr", ARGP_BIT_XOR_OP, ARGI_BIT_XOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT), +/* 2B */ ACPI_OP ("Not", ARGP_BIT_NOT_OP, ARGI_BIT_NOT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT), +/* 2C */ ACPI_OP ("FindSetLeftBit", ARGP_FIND_SET_LEFT_BIT_OP, ARGI_FIND_SET_LEFT_BIT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT), +/* 2D */ ACPI_OP ("FindSetRightBit", ARGP_FIND_SET_RIGHT_BIT_OP,ARGI_FIND_SET_RIGHT_BIT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT), +/* 2E */ ACPI_OP ("DerefOf", ARGP_DEREF_OF_OP, ARGI_DEREF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), +/* 2F */ ACPI_OP ("Notify", ARGP_NOTIFY_OP, ARGI_NOTIFY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_0R, AML_FLAGS_EXEC_2A_0T_0R), +/* 30 */ ACPI_OP ("SizeOf", ARGP_SIZE_OF_OP, ARGI_SIZE_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), +/* 31 */ ACPI_OP ("Index", ARGP_INDEX_OP, ARGI_INDEX_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT), +/* 32 */ ACPI_OP ("Match", ARGP_MATCH_OP, ARGI_MATCH_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R | AML_CONSTANT), +/* 33 */ ACPI_OP ("CreateDWordField", ARGP_CREATE_DWORD_FIELD_OP,ARGI_CREATE_DWORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), +/* 34 */ ACPI_OP ("CreateWordField", ARGP_CREATE_WORD_FIELD_OP, ARGI_CREATE_WORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), +/* 35 */ ACPI_OP ("CreateByteField", ARGP_CREATE_BYTE_FIELD_OP, ARGI_CREATE_BYTE_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), +/* 36 */ ACPI_OP ("CreateBitField", ARGP_CREATE_BIT_FIELD_OP, ARGI_CREATE_BIT_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), +/* 37 */ ACPI_OP ("ObjectType", ARGP_TYPE_OP, ARGI_TYPE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), +/* 38 */ ACPI_OP ("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT), +/* 39 */ ACPI_OP ("LOr", ARGP_LOR_OP, ARGI_LOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT), +/* 3A */ ACPI_OP ("LNot", ARGP_LNOT_OP, ARGI_LNOT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT), +/* 3B */ ACPI_OP ("LEqual", ARGP_LEQUAL_OP, ARGI_LEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT), +/* 3C */ ACPI_OP ("LGreater", ARGP_LGREATER_OP, ARGI_LGREATER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT), +/* 3D */ ACPI_OP ("LLess", ARGP_LLESS_OP, ARGI_LLESS_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT), +/* 3E */ ACPI_OP ("If", ARGP_IF_OP, ARGI_IF_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), +/* 3F */ ACPI_OP ("Else", ARGP_ELSE_OP, ARGI_ELSE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), +/* 40 */ ACPI_OP ("While", ARGP_WHILE_OP, ARGI_WHILE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), +/* 41 */ ACPI_OP ("Noop", ARGP_NOOP_OP, ARGI_NOOP_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), +/* 42 */ ACPI_OP ("Return", ARGP_RETURN_OP, ARGI_RETURN_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), +/* 43 */ ACPI_OP ("Break", ARGP_BREAK_OP, ARGI_BREAK_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), +/* 44 */ ACPI_OP ("BreakPoint", ARGP_BREAK_POINT_OP, ARGI_BREAK_POINT_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), +/* 45 */ ACPI_OP ("Ones", ARGP_ONES_OP, ARGI_ONES_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT), /* Prefixed opcodes (Two-byte opcodes with a prefix op) */ -/* 46 */ ACPI_OP ("Mutex", ARGP_MUTEX_OP, ARGI_MUTEX_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 47 */ ACPI_OP ("Event", ARGP_EVENT_OP, ARGI_EVENT_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ), -/* 48 */ ACPI_OP ("Cond_ref_of", ARGP_COND_REF_OF_OP, ARGI_COND_REF_OF_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 49 */ ACPI_OP ("Create_field", ARGP_CREATE_FIELD_OP, ARGI_CREATE_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_FIELD | AML_CREATE), -/* 4_a */ ACPI_OP ("Load", ARGP_LOAD_OP, ARGI_LOAD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_0R, AML_FLAGS_EXEC_1A_1T_0R), -/* 4_b */ ACPI_OP ("Stall", ARGP_STALL_OP, ARGI_STALL_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), -/* 4_c */ ACPI_OP ("Sleep", ARGP_SLEEP_OP, ARGI_SLEEP_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), -/* 4_d */ ACPI_OP ("Acquire", ARGP_ACQUIRE_OP, ARGI_ACQUIRE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R), -/* 4_e */ ACPI_OP ("Signal", ARGP_SIGNAL_OP, ARGI_SIGNAL_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), -/* 4_f */ ACPI_OP ("Wait", ARGP_WAIT_OP, ARGI_WAIT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R), -/* 50 */ ACPI_OP ("Reset", ARGP_RESET_OP, ARGI_RESET_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), -/* 51 */ ACPI_OP ("Release", ARGP_RELEASE_OP, ARGI_RELEASE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), -/* 52 */ ACPI_OP ("From_bCD", ARGP_FROM_BCD_OP, ARGI_FROM_BCD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 53 */ ACPI_OP ("To_bCD", ARGP_TO_BCD_OP, ARGI_TO_BCD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 54 */ ACPI_OP ("Unload", ARGP_UNLOAD_OP, ARGI_UNLOAD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), -/* 55 */ ACPI_OP ("Revision", ARGP_REVISION_OP, ARGI_REVISION_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), -/* 56 */ ACPI_OP ("Debug", ARGP_DEBUG_OP, ARGI_DEBUG_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), -/* 57 */ ACPI_OP ("Fatal", ARGP_FATAL_OP, ARGI_FATAL_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R), -/* 58 */ ACPI_OP ("Op_region", ARGP_REGION_OP, ARGI_REGION_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER), -/* 59 */ ACPI_OP ("Field", ARGP_FIELD_OP, ARGI_FIELD_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), -/* 5_a */ ACPI_OP ("Device", ARGP_DEVICE_OP, ARGI_DEVICE_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 5_b */ ACPI_OP ("Processor", ARGP_PROCESSOR_OP, ARGI_PROCESSOR_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 5_c */ ACPI_OP ("Power_resource", ARGP_POWER_RES_OP, ARGI_POWER_RES_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 5_d */ ACPI_OP ("Thermal_zone", ARGP_THERMAL_ZONE_OP, ARGI_THERMAL_ZONE_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 5_e */ ACPI_OP ("Index_field", ARGP_INDEX_FIELD_OP, ARGI_INDEX_FIELD_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), -/* 5_f */ ACPI_OP ("Bank_field", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), +/* 46 */ ACPI_OP ("Mutex", ARGP_MUTEX_OP, ARGI_MUTEX_OP, ACPI_TYPE_MUTEX, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 47 */ ACPI_OP ("Event", ARGP_EVENT_OP, ARGI_EVENT_OP, ACPI_TYPE_EVENT, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ), +/* 48 */ ACPI_OP ("CondRefOf", ARGP_COND_REF_OF_OP, ARGI_COND_REF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 49 */ ACPI_OP ("CreateField", ARGP_CREATE_FIELD_OP, ARGI_CREATE_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_FIELD | AML_CREATE), +/* 4A */ ACPI_OP ("Load", ARGP_LOAD_OP, ARGI_LOAD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_0R, AML_FLAGS_EXEC_1A_1T_0R), +/* 4B */ ACPI_OP ("Stall", ARGP_STALL_OP, ARGI_STALL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), +/* 4C */ ACPI_OP ("Sleep", ARGP_SLEEP_OP, ARGI_SLEEP_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), +/* 4D */ ACPI_OP ("Acquire", ARGP_ACQUIRE_OP, ARGI_ACQUIRE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R), +/* 4E */ ACPI_OP ("Signal", ARGP_SIGNAL_OP, ARGI_SIGNAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), +/* 4F */ ACPI_OP ("Wait", ARGP_WAIT_OP, ARGI_WAIT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R), +/* 50 */ ACPI_OP ("Reset", ARGP_RESET_OP, ARGI_RESET_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), +/* 51 */ ACPI_OP ("Release", ARGP_RELEASE_OP, ARGI_RELEASE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), +/* 52 */ ACPI_OP ("FromBCD", ARGP_FROM_BCD_OP, ARGI_FROM_BCD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT), +/* 53 */ ACPI_OP ("ToBCD", ARGP_TO_BCD_OP, ARGI_TO_BCD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT), +/* 54 */ ACPI_OP ("Unload", ARGP_UNLOAD_OP, ARGI_UNLOAD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), +/* 55 */ ACPI_OP ("Revision", ARGP_REVISION_OP, ARGI_REVISION_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), +/* 56 */ ACPI_OP ("Debug", ARGP_DEBUG_OP, ARGI_DEBUG_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), +/* 57 */ ACPI_OP ("Fatal", ARGP_FATAL_OP, ARGI_FATAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R), +/* 58 */ ACPI_OP ("OperationRegion", ARGP_REGION_OP, ARGI_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER), +/* 59 */ ACPI_OP ("Field", ARGP_FIELD_OP, ARGI_FIELD_OP, INTERNAL_TYPE_FIELD_DEFN,AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), +/* 5A */ ACPI_OP ("Device", ARGP_DEVICE_OP, ARGI_DEVICE_OP, ACPI_TYPE_DEVICE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 5B */ ACPI_OP ("Processor", ARGP_PROCESSOR_OP, ARGI_PROCESSOR_OP, ACPI_TYPE_PROCESSOR, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 5C */ ACPI_OP ("PowerResource", ARGP_POWER_RES_OP, ARGI_POWER_RES_OP, ACPI_TYPE_POWER, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 5D */ ACPI_OP ("ThermalZone", ARGP_THERMAL_ZONE_OP, ARGI_THERMAL_ZONE_OP, ACPI_TYPE_THERMAL, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 5E */ ACPI_OP ("IndexField", ARGP_INDEX_FIELD_OP, ARGI_INDEX_FIELD_OP, INTERNAL_TYPE_INDEX_FIELD_DEFN,AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), +/* 5F */ ACPI_OP ("BankField", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, INTERNAL_TYPE_BANK_FIELD_DEFN,AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), /* Internal opcodes that map to invalid AML opcodes */ -/* 60 */ ACPI_OP ("LNot_equal", ARGP_LNOTEQUAL_OP, ARGI_LNOTEQUAL_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), -/* 61 */ ACPI_OP ("LLess_equal", ARGP_LLESSEQUAL_OP, ARGI_LLESSEQUAL_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), -/* 62 */ ACPI_OP ("LGreater_equal", ARGP_LGREATEREQUAL_OP, ARGI_LGREATEREQUAL_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), -/* 63 */ ACPI_OP ("[Name_path]", ARGP_NAMEPATH_OP, ARGI_NAMEPATH_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_NSOBJECT | AML_NSNODE ), -/* 64 */ ACPI_OP ("[Method_call]", ARGP_METHODCALL_OP, ARGI_METHODCALL_OP, AML_CLASS_METHOD_CALL, AML_TYPE_METHOD_CALL, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE), -/* 65 */ ACPI_OP ("[Byte_list]", ARGP_BYTELIST_OP, ARGI_BYTELIST_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), -/* 66 */ ACPI_OP ("[Reserved_field]", ARGP_RESERVEDFIELD_OP, ARGI_RESERVEDFIELD_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), -/* 67 */ ACPI_OP ("[Named_field]", ARGP_NAMEDFIELD_OP, ARGI_NAMEDFIELD_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ), -/* 68 */ ACPI_OP ("[Access_field]", ARGP_ACCESSFIELD_OP, ARGI_ACCESSFIELD_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), -/* 69 */ ACPI_OP ("[Static_string", ARGP_STATICSTRING_OP, ARGI_STATICSTRING_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), -/* 6_a */ ACPI_OP ("[Return Value]", ARG_NONE, ARG_NONE, AML_CLASS_RETURN_VALUE, AML_TYPE_RETURN, AML_HAS_ARGS | AML_HAS_RETVAL), -/* 6_b */ ACPI_OP ("UNKNOWN_OP!", ARG_NONE, ARG_NONE, AML_CLASS_UNKNOWN, AML_TYPE_BOGUS, AML_HAS_ARGS), -/* 6_c */ ACPI_OP ("ASCII_ONLY!", ARG_NONE, ARG_NONE, AML_CLASS_ASCII, AML_TYPE_BOGUS, AML_HAS_ARGS), -/* 6_d */ ACPI_OP ("PREFIX_ONLY!", ARG_NONE, ARG_NONE, AML_CLASS_PREFIX, AML_TYPE_BOGUS, AML_HAS_ARGS), +/* 60 */ ACPI_OP ("LNotEqual", ARGP_LNOTEQUAL_OP, ARGI_LNOTEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT), +/* 61 */ ACPI_OP ("LLessEqual", ARGP_LLESSEQUAL_OP, ARGI_LLESSEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT), +/* 62 */ ACPI_OP ("LGreaterEqual", ARGP_LGREATEREQUAL_OP, ARGI_LGREATEREQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT), +/* 63 */ ACPI_OP ("[NamePath]", ARGP_NAMEPATH_OP, ARGI_NAMEPATH_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_NSOBJECT | AML_NSNODE ), +/* 64 */ ACPI_OP ("[MethodCall]", ARGP_METHODCALL_OP, ARGI_METHODCALL_OP, ACPI_TYPE_METHOD, AML_CLASS_METHOD_CALL, AML_TYPE_METHOD_CALL, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE), +/* 65 */ ACPI_OP ("[ByteList]", ARGP_BYTELIST_OP, ARGI_BYTELIST_OP, ACPI_TYPE_ANY, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), +/* 66 */ ACPI_OP ("[ReservedField]", ARGP_RESERVEDFIELD_OP, ARGI_RESERVEDFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), +/* 67 */ ACPI_OP ("[NamedField]", ARGP_NAMEDFIELD_OP, ARGI_NAMEDFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ), +/* 68 */ ACPI_OP ("[AccessField]", ARGP_ACCESSFIELD_OP, ARGI_ACCESSFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), +/* 69 */ ACPI_OP ("[StaticString", ARGP_STATICSTRING_OP, ARGI_STATICSTRING_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), +/* 6A */ ACPI_OP ("[Return Value]", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_RETURN_VALUE, AML_TYPE_RETURN, AML_HAS_ARGS | AML_HAS_RETVAL), +/* 6B */ ACPI_OP ("UNKNOWN_OP!", ARG_NONE, ARG_NONE, INTERNAL_TYPE_INVALID, AML_CLASS_UNKNOWN, AML_TYPE_BOGUS, AML_HAS_ARGS), +/* 6C */ ACPI_OP ("ASCII_ONLY!", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_ASCII, AML_TYPE_BOGUS, AML_HAS_ARGS), +/* 6D */ ACPI_OP ("PREFIX_ONLY!", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_PREFIX, AML_TYPE_BOGUS, AML_HAS_ARGS), /* ACPI 2.0 opcodes */ -/* 6_e */ ACPI_OP ("Qword_const", ARGP_QWORD_OP, ARGI_QWORD_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), -/* 6_f */ ACPI_OP ("Var_package", ARGP_VAR_PACKAGE_OP, ARGI_VAR_PACKAGE_OP, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS | AML_DEFER), -/* 70 */ ACPI_OP ("Concat_res", ARGP_CONCAT_RES_OP, ARGI_CONCAT_RES_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), -/* 71 */ ACPI_OP ("Mod", ARGP_MOD_OP, ARGI_MOD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), -/* 72 */ ACPI_OP ("Create_qWord_field", ARGP_CREATE_QWORD_FIELD_OP,ARGI_CREATE_QWORD_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), -/* 73 */ ACPI_OP ("To_buffer", ARGP_TO_BUFFER_OP, ARGI_TO_BUFFER_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 74 */ ACPI_OP ("To_decimal_string", ARGP_TO_DEC_STR_OP, ARGI_TO_DEC_STR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 75 */ ACPI_OP ("To_hex_string", ARGP_TO_HEX_STR_OP, ARGI_TO_HEX_STR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 76 */ ACPI_OP ("To_integer", ARGP_TO_INTEGER_OP, ARGI_TO_INTEGER_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 77 */ ACPI_OP ("To_string", ARGP_TO_STRING_OP, ARGI_TO_STRING_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), -/* 78 */ ACPI_OP ("Copy_object", ARGP_COPY_OP, ARGI_COPY_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 79 */ ACPI_OP ("Mid", ARGP_MID_OP, ARGI_MID_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_1T_1R, AML_FLAGS_EXEC_3A_1T_1R), -/* 7_a */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), -/* 7_b */ ACPI_OP ("Load_table", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R), -/* 7_c */ ACPI_OP ("Data_op_region", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 6E */ ACPI_OP ("QwordConst", ARGP_QWORD_OP, ARGI_QWORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT), +/* 6F */ ACPI_OP ("Package /*Var*/", ARGP_VAR_PACKAGE_OP, ARGI_VAR_PACKAGE_OP, ACPI_TYPE_PACKAGE, AML_CLASS_CREATE, AML_TYPE_CREATE_OBJECT, AML_HAS_ARGS | AML_DEFER), +/* 70 */ ACPI_OP ("ConcatenateResTemplate", ARGP_CONCAT_RES_OP, ARGI_CONCAT_RES_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT), +/* 71 */ ACPI_OP ("Mod", ARGP_MOD_OP, ARGI_MOD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT), +/* 72 */ ACPI_OP ("CreateQWordField", ARGP_CREATE_QWORD_FIELD_OP,ARGI_CREATE_QWORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), +/* 73 */ ACPI_OP ("ToBuffer", ARGP_TO_BUFFER_OP, ARGI_TO_BUFFER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT), +/* 74 */ ACPI_OP ("ToDecimalString", ARGP_TO_DEC_STR_OP, ARGI_TO_DEC_STR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT), +/* 75 */ ACPI_OP ("ToHexString", ARGP_TO_HEX_STR_OP, ARGI_TO_HEX_STR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT), +/* 76 */ ACPI_OP ("ToInteger", ARGP_TO_INTEGER_OP, ARGI_TO_INTEGER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT), +/* 77 */ ACPI_OP ("ToString", ARGP_TO_STRING_OP, ARGI_TO_STRING_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT), +/* 78 */ ACPI_OP ("CopyObject", ARGP_COPY_OP, ARGI_COPY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 79 */ ACPI_OP ("Mid", ARGP_MID_OP, ARGI_MID_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_1T_1R, AML_FLAGS_EXEC_3A_1T_1R | AML_CONSTANT), +/* 7A */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), +/* 7B */ ACPI_OP ("LoadTable", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R), +/* 7C */ ACPI_OP ("DataTableRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 7D */ ACPI_OP ("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP, INTERNAL_TYPE_SCOPE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE) +/*! [End] no source code translation !*/ }; /* @@ -594,7 +598,7 @@ * index into the table above */ -static const u8 aml_short_op_info_index[256] = +static const u8 acpi_gbl_short_op_index[256] = { /* 0 1 2 3 4 5 6 7 */ /* 8 9 A B C D E F */ @@ -604,7 +608,7 @@ /* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, /* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, /* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX, -/* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, _UNK, +/* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, 0x7D, /* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, /* 0x40 */ _UNK, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, /* 0x48 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, @@ -633,7 +637,7 @@ }; -static const u8 aml_long_op_info_index[NUM_EXTENDED_OPCODE] = +static const u8 acpi_gbl_long_op_index[NUM_EXTENDED_OPCODE] = { /* 0 1 2 3 4 5 6 7 */ /* 8 9 A B C D E F */ @@ -676,57 +680,40 @@ acpi_ps_get_opcode_info ( u16 opcode) { - const acpi_opcode_info *op_info; - u8 upper_opcode; - u8 lower_opcode; - - - PROC_NAME ("Ps_get_opcode_info"); - - - /* Split the 16-bit opcode into separate bytes */ - - upper_opcode = (u8) (opcode >> 8); - lower_opcode = (u8) opcode; - - /* Default is "unknown opcode" */ - - op_info = &aml_op_info [_UNK]; + ACPI_FUNCTION_NAME ("Ps_get_opcode_info"); /* * Detect normal 8-bit opcode or extended 16-bit opcode */ - - switch (upper_opcode) { + switch ((u8) (opcode >> 8)) { case 0: /* Simple (8-bit) opcode: 0-255, can't index beyond table */ - op_info = &aml_op_info [aml_short_op_info_index [lower_opcode]]; - break; - + return (&acpi_gbl_aml_op_info [acpi_gbl_short_op_index [(u8) opcode]]); case AML_EXTOP: /* Extended (16-bit, prefix+opcode) opcode */ - if (lower_opcode <= MAX_EXTENDED_OPCODE) { - op_info = &aml_op_info [aml_long_op_info_index [lower_opcode]]; + if (((u8) opcode) <= MAX_EXTENDED_OPCODE) { + return (&acpi_gbl_aml_op_info [acpi_gbl_long_op_index [(u8) opcode]]); } - break; + /* Else fall through to error case below */ + /*lint -fallthrough */ default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown extended opcode=%X\n", opcode)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown extended opcode [%X]\n", opcode)); break; } - /* Get the Op info pointer for this opcode */ + /* Default is "unknown opcode" */ - return (op_info); + return (&acpi_gbl_aml_op_info [_UNK]); } @@ -747,6 +734,8 @@ acpi_ps_get_opcode_name ( u16 opcode) { +#ifdef ACPI_DEBUG + const acpi_opcode_info *op; @@ -754,11 +743,11 @@ /* Always guaranteed to return a valid pointer */ -#ifdef ACPI_DEBUG return (op->name); + #else return ("AE_NOT_CONFIGURED"); + #endif } - diff -urN linux-2.4.18/drivers/acpi/parser/psparse.c lia64-2.4/drivers/acpi/parser/psparse.c --- linux-2.4.18/drivers/acpi/parser/psparse.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/parser/psparse.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: psparse - Parser top level AML parse routines - * $Revision: 104 $ + * $Revision: 127 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,15 +38,13 @@ #include "acdispat.h" #include "amlcode.h" #include "acnamesp.h" -#include "acdebug.h" #include "acinterp.h" #define _COMPONENT ACPI_PARSER - MODULE_NAME ("psparse") + ACPI_MODULE_NAME ("psparse") -u32 acpi_gbl_depth = 0; -extern u32 acpi_gbl_scope_depth; +static u32 acpi_gbl_depth = 0; /******************************************************************************* @@ -61,7 +59,7 @@ * ******************************************************************************/ -static u32 +u32 acpi_ps_get_opcode_size ( u32 opcode) { @@ -99,32 +97,16 @@ aml = parser_state->aml; - opcode = (u16) GET8 (aml); + opcode = (u16) ACPI_GET8 (aml); - aml++; - - /* - * Original code special cased LNOTEQUAL, LLESSEQUAL, LGREATEREQUAL. - * These opcodes are no longer recognized. Instead, they are broken into - * two opcodes. - * - * - * if (Opcode == AML_EXTOP - * || (Opcode == AML_LNOT - * && (GET8 (Aml) == AML_LEQUAL - * || GET8 (Aml) == AML_LGREATER - * || GET8 (Aml) == AML_LLESS))) - * - * extended Opcode, !=, <=, or >= - */ if (opcode == AML_EXTOP) { /* Extended opcode */ - opcode = (u16) ((opcode << 8) | GET8 (aml)); + aml++; + opcode = (u16) ((opcode << 8) | ACPI_GET8 (aml)); } - return (opcode); } @@ -188,13 +170,13 @@ * PARAMETERS: Walk_state - Current State * Op - Op to complete * - * RETURN: TRUE if Op and subtree was deleted + * RETURN: None. * * DESCRIPTION: Perform any cleanup at the completion of an Op. * ******************************************************************************/ -static u8 +void acpi_ps_complete_this_op ( acpi_walk_state *walk_state, acpi_parse_object *op) @@ -206,8 +188,14 @@ acpi_parse_object *replacement_op = NULL; - FUNCTION_TRACE_PTR ("Ps_complete_this_op", op); + ACPI_FUNCTION_TRACE_PTR ("Ps_complete_this_op", op); + + + /* Check for null Op, can happen if AML code is corrupt */ + if (!op) { + return_VOID; + } /* Delete this op and the subtree below it if asked to */ @@ -215,60 +203,84 @@ (walk_state->op_info->class != AML_CLASS_ARGUMENT)) { /* Make sure that we only delete this subtree */ - if (op->parent) { + if (op->common.parent) { /* * Check if we need to replace the operator and its subtree * with a return value op (placeholder op) */ - parent_info = acpi_ps_get_opcode_info (op->parent->opcode); + parent_info = acpi_ps_get_opcode_info (op->common.parent->common.aml_opcode); switch (parent_info->class) { - case AML_CLASS_CONTROL: /* IF, ELSE, WHILE only */ + case AML_CLASS_CONTROL: break; - case AML_CLASS_NAMED_OBJECT: /* Scope, method, etc. */ case AML_CLASS_CREATE: /* * These opcodes contain Term_arg operands. The current - * op must be replace by a placeholder return op + * op must be replaced by a placeholder return op + */ + replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP); + if (!replacement_op) { + return_VOID; + } + break; + + case AML_CLASS_NAMED_OBJECT: + + /* + * These opcodes contain Term_arg operands. The current + * op must be replaced by a placeholder return op */ - if ((op->parent->opcode == AML_REGION_OP) || - (op->parent->opcode == AML_CREATE_FIELD_OP) || - (op->parent->opcode == AML_CREATE_BIT_FIELD_OP) || - (op->parent->opcode == AML_CREATE_BYTE_FIELD_OP) || - (op->parent->opcode == AML_CREATE_WORD_FIELD_OP) || - (op->parent->opcode == AML_CREATE_DWORD_FIELD_OP) || - (op->parent->opcode == AML_CREATE_QWORD_FIELD_OP)) { + if ((op->common.parent->common.aml_opcode == AML_REGION_OP) || + (op->common.parent->common.aml_opcode == AML_DATA_REGION_OP) || + (op->common.parent->common.aml_opcode == AML_BUFFER_OP) || + (op->common.parent->common.aml_opcode == AML_PACKAGE_OP) || + (op->common.parent->common.aml_opcode == AML_VAR_PACKAGE_OP)) { replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP); if (!replacement_op) { - return_VALUE (FALSE); + return_VOID; } } + if ((op->common.parent->common.aml_opcode == AML_NAME_OP) && + (walk_state->descending_callback != acpi_ds_exec_begin_op)) { + if ((op->common.aml_opcode == AML_BUFFER_OP) || + (op->common.aml_opcode == AML_PACKAGE_OP) || + (op->common.aml_opcode == AML_VAR_PACKAGE_OP)) { + replacement_op = acpi_ps_alloc_op (op->common.aml_opcode); + if (!replacement_op) { + return_VOID; + } + + replacement_op->named.data = op->named.data; + replacement_op->named.length = op->named.length; + } + } break; default: replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP); if (!replacement_op) { - return_VALUE (FALSE); + return_VOID; } } /* We must unlink this op from the parent tree */ - prev = op->parent->value.arg; + prev = op->common.parent->common.value.arg; if (prev == op) { /* This op is the first in the list */ if (replacement_op) { - replacement_op->parent = op->parent; - replacement_op->value.arg = NULL; - op->parent->value.arg = replacement_op; - replacement_op->next = op->next; + replacement_op->common.parent = op->common.parent; + replacement_op->common.value.arg = NULL; + replacement_op->common.node = op->common.node; + op->common.parent->common.value.arg = replacement_op; + replacement_op->common.next = op->common.next; } else { - op->parent->value.arg = op->next; + op->common.parent->common.value.arg = op->common.next; } } @@ -277,37 +289,37 @@ else while (prev) { /* Traverse all siblings in the parent's argument list */ - next = prev->next; + next = prev->common.next; if (next == op) { if (replacement_op) { - replacement_op->parent = op->parent; - replacement_op->value.arg = NULL; - prev->next = replacement_op; - replacement_op->next = op->next; + replacement_op->common.parent = op->common.parent; + replacement_op->common.value.arg = NULL; + replacement_op->common.node = op->common.node; + prev->common.next = replacement_op; + replacement_op->common.next = op->common.next; next = NULL; } else { - prev->next = op->next; + prev->common.next = op->common.next; next = NULL; } } prev = next; } - } /* Now we can actually delete the subtree rooted at op */ acpi_ps_delete_parse_tree (op); - return_VALUE (TRUE); + return_VOID; } - return_VALUE (FALSE); + return_VOID; #else - return (FALSE); + return; #endif } @@ -318,13 +330,14 @@ * * PARAMETERS: Parser_state - Current parser state object * - * RETURN: + * RETURN: Status * - * DESCRIPTION: + * DESCRIPTION: Update the parser state based upon the return exception from + * the parser callback. * ******************************************************************************/ -static acpi_status +acpi_status acpi_ps_next_parse_state ( acpi_walk_state *walk_state, acpi_parse_object *op, @@ -332,11 +345,9 @@ { acpi_parse_state *parser_state = &walk_state->parser_state; acpi_status status = AE_CTRL_PENDING; - u8 *start; - u32 package_length; - FUNCTION_TRACE_PTR ("Ps_next_parse_state", op); + ACPI_FUNCTION_TRACE_PTR ("Ps_next_parse_state", op); switch (callback_status) { @@ -351,32 +362,33 @@ break; - case AE_CTRL_PENDING: + case AE_CTRL_BREAK: - /* - * Predicate of a WHILE was true and the loop just completed an - * execution. Go back to the start of the loop and reevaluate the - * predicate. - */ + parser_state->aml = walk_state->aml_last_while; + walk_state->control_state->common.value = FALSE; + status = AE_CTRL_BREAK; + break; + + case AE_CTRL_CONTINUE: - /* TBD: How to handle a break within a while. */ - /* This code attempts it */ + + parser_state->aml = walk_state->aml_last_while; + status = AE_CTRL_CONTINUE; + break; + + case AE_CTRL_PENDING: parser_state->aml = walk_state->aml_last_while; break; case AE_CTRL_TRUE: + /* * Predicate of an IF was true, and we are at the matching ELSE. * Just close out this package - * - * Note: Parser_state->Aml is modified by the package length procedure - * TBD: [Investigate] perhaps it shouldn't, too much trouble */ - start = parser_state->aml; - package_length = acpi_ps_get_next_package_length (parser_state); - parser_state->aml = start + package_length; + parser_state->aml = acpi_ps_get_next_package_end (parser_state); break; @@ -406,7 +418,7 @@ status = AE_CTRL_TRANSFER; walk_state->prev_op = op; walk_state->method_call_op = op; - walk_state->method_call_node = (op->value.arg)->node; + walk_state->method_call_node = (op->common.value.arg)->common.node; /* Will return value (if any) be used by the caller? */ @@ -448,17 +460,21 @@ acpi_parse_object *arg = NULL; acpi_parse_object pre_op; acpi_parse_state *parser_state; - u8 *aml_op_start; + u8 *aml_op_start = NULL; - FUNCTION_TRACE_PTR ("Ps_parse_loop", walk_state); + ACPI_FUNCTION_TRACE_PTR ("Ps_parse_loop", walk_state); + + if (walk_state->descending_callback == NULL) { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } parser_state = &walk_state->parser_state; walk_state->arg_types = 0; #ifndef PARSER_ONLY - if (walk_state->walk_type & WALK_METHOD_RESTART) { + if (walk_state->walk_type & ACPI_WALK_METHOD_RESTART) { /* We are restarting a preempted control method */ if (acpi_ps_has_completed_scope (parser_state)) { @@ -467,18 +483,17 @@ * was just completed */ if ((parser_state->scope->parse_scope.op) && - ((parser_state->scope->parse_scope.op->opcode == AML_IF_OP) || - (parser_state->scope->parse_scope.op->opcode == AML_WHILE_OP)) && + ((parser_state->scope->parse_scope.op->common.aml_opcode == AML_IF_OP) || + (parser_state->scope->parse_scope.op->common.aml_opcode == AML_WHILE_OP)) && (walk_state->control_state) && (walk_state->control_state->common.state == - CONTROL_PREDICATE_EXECUTING)) { - + ACPI_CONTROL_PREDICATE_EXECUTING)) { /* * A predicate was just completed, get the value of the * predicate and branch based on that value */ walk_state->op = NULL; - status = acpi_ds_get_predicate_value (walk_state, TRUE); + status = acpi_ds_get_predicate_value (walk_state, ACPI_TO_POINTER (TRUE)); if (ACPI_FAILURE (status) && ((status & AE_CODE_MASK) != AE_CODE_CONTROL)) { if (status == AE_AML_NO_RETURN_VALUE) { @@ -498,7 +513,6 @@ acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count); ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped scope, Op=%p\n", op)); } - else if (walk_state->prev_op) { /* We were in the middle of an op */ @@ -512,12 +526,12 @@ * Iterative parsing loop, while there is more aml to process: */ while ((parser_state->aml < parser_state->aml_end) || (op)) { + aml_op_start = parser_state->aml; if (!op) { /* Get the next opcode from the AML stream */ - aml_op_start = parser_state->aml; - walk_state->aml_offset = parser_state->aml - parser_state->aml_start; - walk_state->opcode = acpi_ps_peek_opcode (parser_state); + walk_state->aml_offset = ACPI_PTR_DIFF (parser_state->aml, parser_state->aml_start); + walk_state->opcode = acpi_ps_peek_opcode (parser_state); /* * First cut to determine what we have found: @@ -542,10 +556,10 @@ /* The opcode is unrecognized. Just skip unknown opcodes */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Found unknown opcode %X at AML offset %X, ignoring\n", - walk_state->opcode, walk_state->aml_offset)); + "Found unknown opcode %X at AML address %p offset %X, ignoring\n", + walk_state->opcode, parser_state->aml, walk_state->aml_offset)); - DUMP_BUFFER (parser_state->aml, 128); + ACPI_DUMP_BUFFER (parser_state->aml, 128); /* Assume one-byte bad opcode */ @@ -559,15 +573,13 @@ parser_state->aml += acpi_ps_get_opcode_size (walk_state->opcode); walk_state->arg_types = walk_state->op_info->parse_args; break; - } - /* Create Op structure and append to parent's argument list */ if (walk_state->op_info->flags & AML_NAMED) { - pre_op.value.arg = NULL; - pre_op.opcode = walk_state->opcode; + pre_op.common.value.arg = NULL; + pre_op.common.aml_opcode = walk_state->opcode; while (GET_CURRENT_ARG_TYPE (walk_state->arg_types) != ARGP_NAME) { arg = acpi_ps_get_next_arg (parser_state, @@ -577,47 +589,41 @@ INCREMENT_ARG_LIST (walk_state->arg_types); } - /* We know that this arg is a name, move to next arg */ INCREMENT_ARG_LIST (walk_state->arg_types); - if (walk_state->descending_callback != NULL) { - /* - * Find the object. This will either insert the object into - * the namespace or simply look it up - */ - walk_state->op = NULL; - - status = walk_state->descending_callback (walk_state, &op); + /* + * Find the object. This will either insert the object into + * the namespace or simply look it up + */ + walk_state->op = NULL; - /* TBD: check status here? */ + status = walk_state->descending_callback (walk_state, &op); + if (ACPI_FAILURE (status)) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "During name lookup/catalog, %s\n", + acpi_format_exception (status))); + goto close_this_op; + } - if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "During name lookup/catalog, %s\n", - acpi_format_exception (status))); - goto close_this_op; - } + if (op == NULL) { + continue; + } - if (op == NULL) { - continue; - } - status = acpi_ps_next_parse_state (walk_state, op, status); - if (status == AE_CTRL_PENDING) { - status = AE_OK; - goto close_this_op; - } + status = acpi_ps_next_parse_state (walk_state, op, status); + if (status == AE_CTRL_PENDING) { + status = AE_OK; + goto close_this_op; + } - if (ACPI_FAILURE (status)) { - goto close_this_op; - } + if (ACPI_FAILURE (status)) { + goto close_this_op; } - acpi_ps_append_arg (op, pre_op.value.arg); + acpi_ps_append_arg (op, pre_op.common.value.arg); acpi_gbl_depth++; - - if (op->opcode == AML_REGION_OP) { + if (op->common.aml_opcode == AML_REGION_OP) { /* * Defer final parsing of an Operation_region body, * because we don't have enough info in the first pass @@ -630,12 +636,10 @@ * * (Length is unknown until parse of the body complete) */ - ((acpi_parse2_object * ) op)->data = aml_op_start; - ((acpi_parse2_object * ) op)->length = 0; + op->named.data = aml_op_start; + op->named.length = 0; } } - - else { /* Not a named opcode, just allocate Op and append to parent */ @@ -645,14 +649,13 @@ return_ACPI_STATUS (AE_NO_MEMORY); } - if (walk_state->op_info->flags & AML_CREATE) { /* * Backup to beginning of Create_xXXfield declaration * Body_length is unknown until we parse the body */ - ((acpi_parse2_object * ) op)->data = aml_op_start; - ((acpi_parse2_object * ) op)->length = 0; + op->named.data = aml_op_start; + op->named.length = 0; } acpi_ps_append_arg (acpi_ps_get_parent_scope (parser_state), op); @@ -662,7 +665,7 @@ * Find the object. This will either insert the object into * the namespace or simply look it up */ - walk_state->op = op; + walk_state->op = op; status = walk_state->descending_callback (walk_state, &op); status = acpi_ps_next_parse_state (walk_state, op, status); @@ -677,12 +680,13 @@ } } - op->aml_offset = walk_state->aml_offset; + op->common.aml_offset = walk_state->aml_offset; if (walk_state->op_info) { ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, - "Op=%p Opcode=%4.4X Aml %p Oft=%5.5X\n", - op, op->opcode, parser_state->aml, op->aml_offset)); + "Opcode %4.4hX [%s] Op %p Aml %p Aml_offset %5.5X\n", + op->common.aml_opcode, walk_state->op_info->name, + op, parser_state->aml, op->common.aml_offset)); } } @@ -691,18 +695,17 @@ walk_state->arg_count = 0; - if (walk_state->arg_types) /* Are there any arguments that must be processed? */ { - /* get arguments */ + /* Get arguments */ - switch (op->opcode) { + switch (op->common.aml_opcode) { case AML_BYTE_OP: /* AML_BYTEDATA_ARG */ case AML_WORD_OP: /* AML_WORDDATA_ARG */ case AML_DWORD_OP: /* AML_DWORDATA_ARG */ case AML_QWORD_OP: /* AML_QWORDATA_ARG */ case AML_STRING_OP: /* AML_ASCIICHARLIST_ARG */ - /* fill in constant or string argument directly */ + /* Fill in constant or string argument directly */ acpi_ps_get_next_simple_arg (parser_state, GET_CURRENT_ARG_TYPE (walk_state->arg_types), op); @@ -720,197 +723,251 @@ /* Op is not a constant or string, append each argument */ while (GET_CURRENT_ARG_TYPE (walk_state->arg_types) && !walk_state->arg_count) { - walk_state->aml_offset = parser_state->aml - parser_state->aml_start; + walk_state->aml_offset = ACPI_PTR_DIFF (parser_state->aml, + parser_state->aml_start); arg = acpi_ps_get_next_arg (parser_state, GET_CURRENT_ARG_TYPE (walk_state->arg_types), &walk_state->arg_count); if (arg) { - arg->aml_offset = walk_state->aml_offset; + arg->common.aml_offset = walk_state->aml_offset; acpi_ps_append_arg (op, arg); } INCREMENT_ARG_LIST (walk_state->arg_types); } + switch (op->common.aml_opcode) { + case AML_METHOD_OP: - /* For a method, save the length and address of the body */ + /* For a method, save the length and address of the body */ - if (op->opcode == AML_METHOD_OP) { /* * Skip parsing of control method or opregion body, * because we don't have enough info in the first pass * to parse them correctly. */ - ((acpi_parse2_object * ) op)->data = parser_state->aml; - ((acpi_parse2_object * ) op)->length = (u32) (parser_state->pkg_end - - parser_state->aml); - + op->named.data = parser_state->aml; + op->named.length = (u32) (parser_state->pkg_end - parser_state->aml); /* * Skip body of method. For Op_regions, we must continue * parsing because the opregion is not a standalone * package (We don't know where the end is). */ parser_state->aml = parser_state->pkg_end; - walk_state->arg_count = 0; - } + walk_state->arg_count = 0; + break; + + case AML_BUFFER_OP: + case AML_PACKAGE_OP: + case AML_VAR_PACKAGE_OP: + + if ((op->common.parent) && + (op->common.parent->common.aml_opcode == AML_NAME_OP) && + (walk_state->descending_callback != acpi_ds_exec_begin_op)) { + /* + * Skip parsing of + * because we don't have enough info in the first pass + * to parse them correctly. + */ + op->named.data = aml_op_start; + op->named.length = (u32) (parser_state->pkg_end - aml_op_start); + /* + * Skip body + */ + parser_state->aml = parser_state->pkg_end; + walk_state->arg_count = 0; + } + break; + case AML_WHILE_OP: + + if (walk_state->control_state) { + walk_state->control_state->control.package_end = parser_state->pkg_end; + } + break; + + default: + /* No action for all other opcodes */ + break; + } break; } } + /* Check for arguments that need to be processed */ - /* - * Zero Arg_count means that all arguments for this op have been processed - */ - if (!walk_state->arg_count) { - /* completed Op, prepare for next */ + if (walk_state->arg_count) { + /* There are arguments (complex ones), push Op and prepare for argument */ - walk_state->op_info = acpi_ps_get_opcode_info (op->opcode); - if (walk_state->op_info->flags & AML_NAMED) { - if (acpi_gbl_depth) { - acpi_gbl_depth--; - } + status = acpi_ps_push_scope (parser_state, op, walk_state->arg_types, walk_state->arg_count); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + op = NULL; + continue; + } - if (op->opcode == AML_REGION_OP) { - /* - * Skip parsing of control method or opregion body, - * because we don't have enough info in the first pass - * to parse them correctly. - * - * Completed parsing an Op_region declaration, we now - * know the length. - */ - ((acpi_parse2_object * ) op)->length = (u32) (parser_state->aml - - ((acpi_parse2_object * ) op)->data); - } + /* All arguments have been processed -- Op is complete, prepare for next */ + + walk_state->op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); + if (walk_state->op_info->flags & AML_NAMED) { + if (acpi_gbl_depth) { + acpi_gbl_depth--; } - if (walk_state->op_info->flags & AML_CREATE) { + if (op->common.aml_opcode == AML_REGION_OP) { /* - * Backup to beginning of Create_xXXfield declaration (1 for - * Opcode) + * Skip parsing of control method or opregion body, + * because we don't have enough info in the first pass + * to parse them correctly. * - * Body_length is unknown until we parse the body + * Completed parsing an Op_region declaration, we now + * know the length. */ - ((acpi_parse2_object * ) op)->length = (u32) (parser_state->aml - - ((acpi_parse2_object * ) op)->data); + op->named.length = (u32) (parser_state->aml - op->named.data); } + } - /* This op complete, notify the dispatcher */ + if (walk_state->op_info->flags & AML_CREATE) { + /* + * Backup to beginning of Create_xXXfield declaration (1 for + * Opcode) + * + * Body_length is unknown until we parse the body + */ + op->named.length = (u32) (parser_state->aml - op->named.data); + } - if (walk_state->ascending_callback != NULL) { - walk_state->op = op; - walk_state->opcode = op->opcode; + /* This op complete, notify the dispatcher */ - status = walk_state->ascending_callback (walk_state); - status = acpi_ps_next_parse_state (walk_state, op, status); - if (status == AE_CTRL_PENDING) { - status = AE_OK; - goto close_this_op; - } + if (walk_state->ascending_callback != NULL) { + walk_state->op = op; + walk_state->opcode = op->common.aml_opcode; + + status = walk_state->ascending_callback (walk_state); + status = acpi_ps_next_parse_state (walk_state, op, status); + if (status == AE_CTRL_PENDING) { + status = AE_OK; + goto close_this_op; } + } close_this_op: + /* + * Finished one argument of the containing scope + */ + parser_state->scope->parse_scope.arg_count--; + + /* Close this Op (will result in parse subtree deletion) */ + + acpi_ps_complete_this_op (walk_state, op); + op = NULL; + + switch (status) { + case AE_OK: + break; + + + case AE_CTRL_TRANSFER: /* - * Finished one argument of the containing scope + * We are about to transfer to a called method. */ - parser_state->scope->parse_scope.arg_count--; + walk_state->prev_op = op; + walk_state->prev_arg_types = walk_state->arg_types; + return_ACPI_STATUS (status); - /* Close this Op (may result in parse subtree deletion) */ - if (acpi_ps_complete_this_op (walk_state, op)) { - op = NULL; - } + case AE_CTRL_END: + acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count); - switch (status) { - case AE_OK: - break; + walk_state->op = op; + walk_state->op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); + walk_state->opcode = op->common.aml_opcode; + status = walk_state->ascending_callback (walk_state); + status = acpi_ps_next_parse_state (walk_state, op, status); - case AE_CTRL_TRANSFER: + acpi_ps_complete_this_op (walk_state, op); + op = NULL; + status = AE_OK; + break; - /* - * We are about to transfer to a called method. - */ - walk_state->prev_op = op; - walk_state->prev_arg_types = walk_state->arg_types; - return_ACPI_STATUS (status); - break; + case AE_CTRL_BREAK: + case AE_CTRL_CONTINUE: - case AE_CTRL_END: + /* Pop off scopes until we find the While */ + while (!op || (op->common.aml_opcode != AML_WHILE_OP)) { acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count); + } - walk_state->op = op; - walk_state->op_info = acpi_ps_get_opcode_info (op->opcode); - walk_state->opcode = op->opcode; + /* Close this iteration of the While loop */ - status = walk_state->ascending_callback (walk_state); - status = acpi_ps_next_parse_state (walk_state, op, status); + walk_state->op = op; + walk_state->op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); + walk_state->opcode = op->common.aml_opcode; - acpi_ps_complete_this_op (walk_state, op); - op = NULL; - status = AE_OK; - break; + status = walk_state->ascending_callback (walk_state); + status = acpi_ps_next_parse_state (walk_state, op, status); + acpi_ps_complete_this_op (walk_state, op); + op = NULL; - case AE_CTRL_TERMINATE: + status = AE_OK; + break; - status = AE_OK; - /* Clean up */ - do { - if (op) { - acpi_ps_complete_this_op (walk_state, op); - } + case AE_CTRL_TERMINATE: - acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count); - } while (op); + status = AE_OK; - return_ACPI_STATUS (status); - break; + /* Clean up */ + do { + if (op) { + acpi_ps_complete_this_op (walk_state, op); + } + acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count); + } while (op); - default: /* All other non-AE_OK status */ + return_ACPI_STATUS (status); - if (op == NULL) { - acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count); - } - walk_state->prev_op = op; - walk_state->prev_arg_types = walk_state->arg_types; - /* - * TEMP: - */ + default: /* All other non-AE_OK status */ - return_ACPI_STATUS (status); - break; - } + do { + if (op) { + acpi_ps_complete_this_op (walk_state, op); + } + acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count); - /* This scope complete? */ + } while (op); - if (acpi_ps_has_completed_scope (parser_state)) { - acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count); - ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped scope, Op=%p\n", op)); - } - else { - op = NULL; + /* + * TBD: Cleanup parse ops on error + */ +#if 0 + if (op == NULL) { + acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count); } - +#endif + walk_state->prev_op = op; + walk_state->prev_arg_types = walk_state->arg_types; + return_ACPI_STATUS (status); } + /* This scope complete? */ - /* Arg_count is non-zero */ - + if (acpi_ps_has_completed_scope (parser_state)) { + acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count); + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped scope, Op=%p\n", op)); + } else { - /* complex argument, push Op and prepare for argument */ - - acpi_ps_push_scope (parser_state, op, walk_state->arg_types, walk_state->arg_count); op = NULL; } @@ -928,8 +985,8 @@ if (op) { if (walk_state->ascending_callback != NULL) { walk_state->op = op; - walk_state->op_info = acpi_ps_get_opcode_info (op->opcode); - walk_state->opcode = op->opcode; + walk_state->op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); + walk_state->opcode = op->common.aml_opcode; status = walk_state->ascending_callback (walk_state); status = acpi_ps_next_parse_state (walk_state, op, status); @@ -992,30 +1049,32 @@ acpi_walk_state *walk_state) { acpi_status status; - acpi_walk_list walk_list; - acpi_walk_list *prev_walk_list = acpi_gbl_current_walk_list; + ACPI_THREAD_STATE *thread; + ACPI_THREAD_STATE *prev_walk_list = acpi_gbl_current_walk_list; acpi_walk_state *previous_walk_state; - FUNCTION_TRACE ("Ps_parse_aml"); + ACPI_FUNCTION_TRACE ("Ps_parse_aml"); ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Entered with Walk_state=%p Aml=%p size=%X\n", walk_state, walk_state->parser_state.aml, walk_state->parser_state.aml_size)); - /* Create and initialize a new walk list */ - - walk_list.walk_state = NULL; - walk_list.acquired_mutex_list.prev = NULL; - walk_list.acquired_mutex_list.next = NULL; + /* Create and initialize a new thread state */ - walk_state->walk_list = &walk_list; - acpi_ds_push_walk_state (walk_state, &walk_list); + thread = acpi_ut_create_thread_state (); + if (!thread) { + return_ACPI_STATUS (AE_NO_MEMORY); + } + walk_state->thread = thread; + acpi_ds_push_walk_state (walk_state, thread); - /* TBD: [Restructure] TEMP until we pass Walk_state to the interpreter + /* + * This global allows the AML debugger to get a handle to the currently + * executing control method. */ - acpi_gbl_current_walk_list = &walk_list; + acpi_gbl_current_walk_list = thread; /* * Execute the walk loop as long as there is a valid Walk State. This @@ -1041,13 +1100,13 @@ * A method call was detected. * Transfer control to the called control method */ - status = acpi_ds_call_control_method (&walk_list, walk_state, NULL); + status = acpi_ds_call_control_method (thread, walk_state, NULL); /* * If the transfer to the new method method call worked, a new walk * state was created -- get it */ - walk_state = acpi_ds_get_current_walk_state (&walk_list); + walk_state = acpi_ds_get_current_walk_state (thread); continue; } @@ -1057,7 +1116,7 @@ /* We are done with this walk, move on to the parent if any */ - walk_state = acpi_ds_pop_walk_state (&walk_list); + walk_state = acpi_ds_pop_walk_state (thread); /* Reset the current scope to the beginning of scope stack */ @@ -1068,7 +1127,13 @@ * there's lots of cleanup to do */ if ((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE) { - acpi_ds_terminate_control_method (walk_state); + status = acpi_ds_terminate_control_method (walk_state); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not terminate control method properly\n")); + status = AE_OK; + + /* Ignore error and continue */ + } } /* Delete this walk state and all linked control states */ @@ -1082,17 +1147,27 @@ /* Check if we have restarted a preempted walk */ - walk_state = acpi_ds_get_current_walk_state (&walk_list); + walk_state = acpi_ds_get_current_walk_state (thread); if (walk_state) { if (ACPI_SUCCESS (status)) { - /* There is another walk state, restart it */ - /* - * If the method returned value is not used by the parent, + * There is another walk state, restart it. + * If the method return value is not used by the parent, * The object is deleted */ - acpi_ds_restart_control_method (walk_state, previous_walk_state->return_desc); - walk_state->walk_type |= WALK_METHOD_RESTART; + status = acpi_ds_restart_control_method (walk_state, previous_walk_state->return_desc); + if (ACPI_SUCCESS (status)) { + walk_state->walk_type |= ACPI_WALK_METHOD_RESTART; + } + } + else { + /* On error, delete any return object */ + + acpi_ut_remove_reference (previous_walk_state->return_desc); + + ACPI_REPORT_ERROR (("Method execution failed, %s\n", acpi_format_exception (status))); + ACPI_DUMP_PATHNAME (walk_state->method_node, "Method pathname: ", + ACPI_LV_ERROR, _COMPONENT); } } @@ -1113,10 +1188,10 @@ acpi_ds_delete_walk_state (previous_walk_state); } - /* Normal exit */ - acpi_ex_release_all_mutexes ((acpi_operand_object *) &walk_list.acquired_mutex_list); + acpi_ex_release_all_mutexes (thread); + acpi_ut_delete_generic_state (ACPI_CAST_PTR (acpi_generic_state, thread)); acpi_gbl_current_walk_list = prev_walk_list; return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/parser/psscope.c lia64-2.4/drivers/acpi/parser/psscope.c --- linux-2.4.18/drivers/acpi/parser/psscope.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/parser/psscope.c Tue Apr 9 15:47:00 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: psscope - Parser scope stack management routines - * $Revision: 30 $ + * $Revision: 35 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #include "acparser.h" #define _COMPONENT ACPI_PARSER - MODULE_NAME ("psscope") + ACPI_MODULE_NAME ("psscope") /******************************************************************************* @@ -95,7 +95,7 @@ acpi_generic_state *scope; - FUNCTION_TRACE_PTR ("Ps_init_scope", root_op); + ACPI_FUNCTION_TRACE_PTR ("Ps_init_scope", root_op); scope = acpi_ut_create_generic_state (); @@ -141,12 +141,12 @@ acpi_generic_state *scope; - FUNCTION_TRACE_PTR ("Ps_push_scope", op); + ACPI_FUNCTION_TRACE_PTR ("Ps_push_scope", op); scope = acpi_ut_create_generic_state (); if (!scope) { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } @@ -170,7 +170,7 @@ else { /* single argument */ - scope->parse_scope.arg_end = ACPI_MAX_AML; + scope->parse_scope.arg_end = ACPI_TO_POINTER (ACPI_MAX_PTR); } return_ACPI_STATUS (AE_OK); @@ -203,7 +203,7 @@ acpi_generic_state *scope = parser_state->scope; - FUNCTION_TRACE ("Ps_pop_scope"); + ACPI_FUNCTION_TRACE ("Ps_pop_scope"); /* @@ -257,7 +257,7 @@ { acpi_generic_state *scope; - FUNCTION_TRACE_PTR ("Ps_cleanup_scope", parser_state); + ACPI_FUNCTION_TRACE_PTR ("Ps_cleanup_scope", parser_state); if (!parser_state) { diff -urN linux-2.4.18/drivers/acpi/parser/pstree.c lia64-2.4/drivers/acpi/parser/pstree.c --- linux-2.4.18/drivers/acpi/parser/pstree.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/parser/pstree.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: pstree - Parser op tree manipulation/traversal/search - * $Revision: 35 $ + * $Revision: 39 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ #include "amlcode.h" #define _COMPONENT ACPI_PARSER - MODULE_NAME ("pstree") + ACPI_MODULE_NAME ("pstree") /******************************************************************************* @@ -54,12 +54,12 @@ const acpi_opcode_info *op_info; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* Get the info structure for this opcode */ - op_info = acpi_ps_get_opcode_info (op->opcode); + op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); if (op_info->class == AML_CLASS_UNKNOWN) { /* Invalid opcode or ASCII character */ @@ -76,10 +76,10 @@ /* Get the requested argument object */ - arg = op->value.arg; + arg = op->common.value.arg; while (arg && argn) { argn--; - arg = arg->next; + arg = arg->common.next; } return (arg); @@ -108,7 +108,7 @@ const acpi_opcode_info *op_info; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); if (!op) { @@ -117,11 +117,12 @@ /* Get the info structure for this opcode */ - op_info = acpi_ps_get_opcode_info (op->opcode); + op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); if (op_info->class == AML_CLASS_UNKNOWN) { /* Invalid opcode */ - REPORT_ERROR (("Ps_append_arg: Invalid AML Opcode: 0x%2.2X\n", op->opcode)); + ACPI_REPORT_ERROR (("Ps_append_arg: Invalid AML Opcode: 0x%2.2X\n", + op->common.aml_opcode)); return; } @@ -136,28 +137,28 @@ /* Append the argument to the linked argument list */ - if (op->value.arg) { + if (op->common.value.arg) { /* Append to existing argument list */ - prev_arg = op->value.arg; - while (prev_arg->next) { - prev_arg = prev_arg->next; + prev_arg = op->common.value.arg; + while (prev_arg->common.next) { + prev_arg = prev_arg->common.next; } - prev_arg->next = arg; + prev_arg->common.next = arg; } else { /* No argument list, this will be the first argument */ - op->value.arg = arg; + op->common.value.arg = arg; } /* Set the parent in this arg and any args linked after it */ while (arg) { - arg->parent = op; - arg = arg->next; + arg->common.parent = op; + arg = arg->common.next; } } @@ -181,10 +182,10 @@ acpi_parse_object *child = NULL; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); - switch (op->opcode) { + switch (op->common.aml_opcode) { case AML_SCOPE_OP: case AML_ELSE_OP: case AML_DEVICE_OP: @@ -219,6 +220,10 @@ child = acpi_ps_get_arg (op, 3); break; + + default: + /* All others have no children */ + break; } return (child); @@ -249,7 +254,7 @@ acpi_parse_object *arg; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); if (!op) { @@ -265,19 +270,19 @@ /* look for a sibling */ - next = op->next; + next = op->common.next; if (next) { return (next); } /* look for a sibling of parent */ - parent = op->parent; + parent = op->common.parent; while (parent) { arg = acpi_ps_get_arg (parent, 0); while (arg && (arg != origin) && (arg != op)) { - arg = arg->next; + arg = arg->common.next; } if (arg == origin) { @@ -286,13 +291,14 @@ return (NULL); } - if (parent->next) { + if (parent->common.next) { /* found sibling of parent */ - return (parent->next); + + return (parent->common.next); } op = parent; - parent = parent->parent; + parent = parent->common.parent; } return (next); diff -urN linux-2.4.18/drivers/acpi/parser/psutils.c lia64-2.4/drivers/acpi/parser/psutils.c --- linux-2.4.18/drivers/acpi/parser/psutils.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/parser/psutils.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: psutils - Parser miscellaneous utilities (Parser only) - * $Revision: 44 $ + * $Revision: 51 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,14 +29,7 @@ #include "amlcode.h" #define _COMPONENT ACPI_PARSER - MODULE_NAME ("psutils") - - -#define PARSEOP_GENERIC 0x01 -#define PARSEOP_NAMED 0x02 -#define PARSEOP_DEFERRED 0x04 -#define PARSEOP_BYTELIST 0x08 -#define PARSEOP_IN_CACHE 0x80 + ACPI_MODULE_NAME ("psutils") /******************************************************************************* @@ -58,19 +51,14 @@ acpi_parse_object *op, u16 opcode) { - const acpi_opcode_info *aml_op; - + ACPI_FUNCTION_ENTRY (); - FUNCTION_ENTRY (); + op->common.data_type = ACPI_DESC_TYPE_PARSER; + op->common.aml_opcode = opcode; - op->data_type = ACPI_DESC_TYPE_PARSER; - op->opcode = opcode; - - aml_op = acpi_ps_get_opcode_info (opcode); - - DEBUG_ONLY_MEMBERS (STRNCPY (op->op_name, aml_op->name, - sizeof (op->op_name))); + ACPI_DEBUG_ONLY_MEMBERS (ACPI_STRNCPY (op->common.aml_op_name, + (acpi_ps_get_opcode_info (opcode))->name, sizeof (op->common.aml_op_name))); } @@ -98,7 +86,7 @@ const acpi_opcode_info *op_info; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); op_info = acpi_ps_get_opcode_info (opcode); @@ -106,33 +94,28 @@ /* Allocate the minimum required size object */ if (op_info->flags & AML_DEFER) { - size = sizeof (acpi_parse2_object); - flags = PARSEOP_DEFERRED; + size = sizeof (ACPI_PARSE_OBJ_NAMED); + flags = ACPI_PARSEOP_DEFERRED; } - else if (op_info->flags & AML_NAMED) { - size = sizeof (acpi_parse2_object); - flags = PARSEOP_NAMED; + size = sizeof (ACPI_PARSE_OBJ_NAMED); + flags = ACPI_PARSEOP_NAMED; } - else if (opcode == AML_INT_BYTELIST_OP) { - size = sizeof (acpi_parse2_object); - flags = PARSEOP_BYTELIST; + size = sizeof (ACPI_PARSE_OBJ_NAMED); + flags = ACPI_PARSEOP_BYTELIST; } - else { - size = sizeof (acpi_parse_object); - flags = PARSEOP_GENERIC; + size = sizeof (ACPI_PARSE_OBJ_COMMON); + flags = ACPI_PARSEOP_GENERIC; } - - if (size == sizeof (acpi_parse_object)) { + if (size == sizeof (ACPI_PARSE_OBJ_COMMON)) { /* * The generic op is by far the most common (16 to 1) */ op = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_PSNODE); } - else { op = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_PSNODE_EXT); } @@ -141,7 +124,7 @@ if (op) { acpi_ps_init_op (op, opcode); - op->flags = flags; + op->common.flags = flags; } return (op); @@ -165,17 +148,16 @@ acpi_ps_free_op ( acpi_parse_object *op) { - PROC_NAME ("Ps_free_op"); + ACPI_FUNCTION_NAME ("Ps_free_op"); - if (op->opcode == AML_INT_RETURN_VALUE_OP) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Free retval op: %p\n", op)); + if (op->common.aml_opcode == AML_INT_RETURN_VALUE_OP) { + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Free retval op: %p\n", op)); } - if (op->flags == PARSEOP_GENERIC) { + if (op->common.flags == ACPI_PARSEOP_GENERIC) { acpi_ut_release_to_cache (ACPI_MEM_LIST_PSNODE, op); } - else { acpi_ut_release_to_cache (ACPI_MEM_LIST_PSNODE_EXT, op); } @@ -198,7 +180,7 @@ acpi_ps_delete_parse_cache ( void) { - FUNCTION_TRACE ("Ps_delete_parse_cache"); + ACPI_FUNCTION_TRACE ("Ps_delete_parse_cache"); acpi_ut_delete_generic_cache (ACPI_MEM_LIST_PSNODE); @@ -249,13 +231,13 @@ /* The "generic" object has no name associated with it */ - if (op->flags & PARSEOP_GENERIC) { + if (op->common.flags & ACPI_PARSEOP_GENERIC) { return (0); } /* Only the "Extended" parse objects have a name */ - return (((acpi_parse2_object *) op)->name); + return (op->named.name); } @@ -270,10 +252,10 @@ /* The "generic" object has no name associated with it */ - if (op->flags & PARSEOP_GENERIC) { + if (op->common.flags & ACPI_PARSEOP_GENERIC) { return; } - ((acpi_parse2_object *) op)->name = name; + op->named.name = name; } diff -urN linux-2.4.18/drivers/acpi/parser/pswalk.c lia64-2.4/drivers/acpi/parser/pswalk.c --- linux-2.4.18/drivers/acpi/parser/pswalk.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/parser/pswalk.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: pswalk - Parser routines to walk parsed op tree(s) - * $Revision: 58 $ + * $Revision: 67 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,14 +25,11 @@ #include "acpi.h" -#include "amlcode.h" #include "acparser.h" #include "acdispat.h" -#include "acnamesp.h" -#include "acinterp.h" #define _COMPONENT ACPI_PARSER - MODULE_NAME ("pswalk") + ACPI_MODULE_NAME ("pswalk") /******************************************************************************* @@ -61,12 +58,12 @@ acpi_status status; - FUNCTION_TRACE_PTR ("Ps_get_next_walk_op", op); + ACPI_FUNCTION_TRACE_PTR ("Ps_get_next_walk_op", op); /* Check for a argument only if we are descending in the tree */ - if (walk_state->next_op_info != NEXT_OP_UPWARD) { + if (walk_state->next_op_info != ACPI_NEXT_OP_UPWARD) { /* Look for an argument or child of the current op */ next = acpi_ps_get_arg (op, 0); @@ -75,22 +72,21 @@ walk_state->prev_op = op; walk_state->next_op = next; - walk_state->next_op_info = NEXT_OP_DOWNWARD; + walk_state->next_op_info = ACPI_NEXT_OP_DOWNWARD; return_ACPI_STATUS (AE_OK); } - /* * No more children, this Op is complete. Save Next and Parent * in case the Op object gets deleted by the callback routine */ - next = op->next; - parent = op->parent; + next = op->common.next; + parent = op->common.parent; walk_state->op = op; - walk_state->op_info = acpi_ps_get_opcode_info (op->opcode); - walk_state->opcode = op->opcode; + walk_state->op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); + walk_state->opcode = op->common.aml_opcode; status = ascending_callback (walk_state); @@ -115,7 +111,7 @@ walk_state->prev_op = op; walk_state->next_op = next; - walk_state->next_op_info = NEXT_OP_DOWNWARD; + walk_state->next_op_info = ACPI_NEXT_OP_DOWNWARD; /* Continue downward */ @@ -127,7 +123,6 @@ * the tree */ } - else { /* * We are resuming a walk, and we were (are) going upward in the tree. @@ -136,7 +131,6 @@ parent = op; } - /* * Look for a sibling of the current Op's parent * Continue moving up the tree until we find a node that has not been @@ -145,12 +139,12 @@ while (parent) { /* We are moving up the tree, therefore this parent Op is complete */ - grand_parent = parent->parent; - next = parent->next; + grand_parent = parent->common.parent; + next = parent->common.next; walk_state->op = parent; - walk_state->op_info = acpi_ps_get_opcode_info (parent->opcode); - walk_state->opcode = parent->opcode; + walk_state->op_info = acpi_ps_get_opcode_info (parent->common.aml_opcode); + walk_state->opcode = parent->common.aml_opcode; status = ascending_callback (walk_state); @@ -175,7 +169,7 @@ walk_state->prev_op = parent; walk_state->next_op = next; - walk_state->next_op_info = NEXT_OP_DOWNWARD; + walk_state->next_op_info = ACPI_NEXT_OP_DOWNWARD; return_ACPI_STATUS (status); } @@ -188,9 +182,10 @@ } - /* Got all the way to the top of the tree, we must be done! */ - /* However, the code should have terminated in the loop above */ - + /* + * Got all the way to the top of the tree, we must be done! + * However, the code should have terminated in the loop above + */ walk_state->next_op = NULL; return_ACPI_STATUS (AE_OK); @@ -212,7 +207,7 @@ * ******************************************************************************/ -static acpi_status +acpi_status acpi_ps_delete_completed_op ( acpi_walk_state *walk_state) { @@ -239,10 +234,11 @@ acpi_parse_object *subtree_root) { acpi_walk_state *walk_state; - acpi_walk_list walk_list; + ACPI_THREAD_STATE *thread; + acpi_status status; - FUNCTION_TRACE_PTR ("Ps_delete_parse_tree", subtree_root); + ACPI_FUNCTION_TRACE_PTR ("Ps_delete_parse_tree", subtree_root); if (!subtree_root) { @@ -251,11 +247,12 @@ /* Create and initialize a new walk list */ - walk_list.walk_state = NULL; - walk_list.acquired_mutex_list.prev = NULL; - walk_list.acquired_mutex_list.next = NULL; + thread = acpi_ut_create_thread_state (); + if (!thread) { + return_VOID; + } - walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, NULL, NULL, &walk_list); + walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, NULL, NULL, thread); if (!walk_state) { return_VOID; } @@ -264,25 +261,26 @@ walk_state->descending_callback = NULL; walk_state->ascending_callback = NULL; - walk_state->origin = subtree_root; walk_state->next_op = subtree_root; - /* Head downward in the tree */ - walk_state->next_op_info = NEXT_OP_DOWNWARD; + walk_state->next_op_info = ACPI_NEXT_OP_DOWNWARD; /* Visit all nodes in the subtree */ while (walk_state->next_op) { - acpi_ps_get_next_walk_op (walk_state, walk_state->next_op, + status = acpi_ps_get_next_walk_op (walk_state, walk_state->next_op, acpi_ps_delete_completed_op); + if (ACPI_FAILURE (status)) { + break; + } } /* We are done with this walk */ - acpi_ex_release_all_mutexes ((acpi_operand_object *) &walk_list.acquired_mutex_list); + acpi_ut_delete_generic_state (ACPI_CAST_PTR (acpi_generic_state, thread)); acpi_ds_delete_walk_state (walk_state); return_VOID; diff -urN linux-2.4.18/drivers/acpi/parser/psxface.c lia64-2.4/drivers/acpi/parser/psxface.c --- linux-2.4.18/drivers/acpi/parser/psxface.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/parser/psxface.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: psxface - Parser external interfaces - * $Revision: 52 $ + * $Revision: 64 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ #define _COMPONENT ACPI_PARSER - MODULE_NAME ("psxface") + ACPI_MODULE_NAME ("psxface") /******************************************************************************* @@ -67,7 +67,7 @@ acpi_walk_state *walk_state; - FUNCTION_TRACE ("Psx_execute"); + ACPI_FUNCTION_TRACE ("Psx_execute"); /* Validate the Node and get the attached object */ @@ -102,7 +102,7 @@ * 1) Perform the first pass parse of the method to enter any * named objects that it creates into the namespace */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Begin Method Parse **** Entry=%p obj=%p\n", method_node, obj_desc)); @@ -113,9 +113,16 @@ return_ACPI_STATUS (AE_NO_MEMORY); } + /* + * Get a new Owner_id for objects created by this method. Namespace + * objects (such as Operation Regions) can be created during the + * first pass parse. + */ + obj_desc->method.owning_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD); + /* Create and initialize a new walk state */ - walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, + walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id, NULL, NULL, NULL); if (!walk_state) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -124,7 +131,7 @@ status = acpi_ds_init_aml_walk (walk_state, op, method_node, obj_desc->method.aml_start, obj_desc->method.aml_length, NULL, NULL, 1); if (ACPI_FAILURE (status)) { - /* TBD: delete walk state */ + acpi_ds_delete_walk_state (walk_state); return_ACPI_STATUS (status); } @@ -133,11 +140,10 @@ status = acpi_ps_parse_aml (walk_state); acpi_ps_delete_parse_tree (op); - /* * 2) Execute the method. Performs second pass parse simultaneously */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Begin Method Execution **** Entry=%p obj=%p\n", method_node, obj_desc)); @@ -150,13 +156,12 @@ /* Init new op with the method name and pointer back to the NS node */ - acpi_ps_set_name (op, method_node->name); - op->node = method_node; + acpi_ps_set_name (op, method_node->name.integer); + op->common.node = method_node; /* Create and initialize a new walk state */ - walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, - NULL, NULL, NULL); + walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, NULL, NULL, NULL); if (!walk_state) { return_ACPI_STATUS (AE_NO_MEMORY); } @@ -164,7 +169,7 @@ status = acpi_ds_init_aml_walk (walk_state, op, method_node, obj_desc->method.aml_start, obj_desc->method.aml_length, params, return_obj_desc, 3); if (ACPI_FAILURE (status)) { - /* TBD: delete walk state */ + acpi_ds_delete_walk_state (walk_state); return_ACPI_STATUS (status); } @@ -178,29 +183,23 @@ /* Take away the extra reference that we gave the parameters above */ for (i = 0; params[i]; i++) { - acpi_ut_update_object_reference (params[i], REF_DECREMENT); - } - } - + /* Ignore errors, just do them all */ - if (ACPI_FAILURE (status)) { - DUMP_PATHNAME (method_node, "Ps_execute: method failed -", - ACPI_LV_ERROR, _COMPONENT); + (void) acpi_ut_update_object_reference (params[i], REF_DECREMENT); + } } - /* * If the method has returned an object, signal this to the caller with * a control exception code */ if (*return_obj_desc) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Method returned Obj_desc=%p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Method returned Obj_desc=%p\n", *return_obj_desc)); - DUMP_STACK_ENTRY (*return_obj_desc); + ACPI_DUMP_STACK_ENTRY (*return_obj_desc); status = AE_CTRL_RETURN_VALUE; } - return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/pci_bind.c lia64-2.4/drivers/acpi/pci_bind.c --- linux-2.4.18/drivers/acpi/pci_bind.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/pci_bind.c Tue Jun 11 14:24:23 2002 @@ -0,0 +1,309 @@ +/* + * pci_bind.c - ACPI PCI Device Binding ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "acpi_bus.h" +#include "acpi_drivers.h" + + +#define _COMPONENT ACPI_PCI_COMPONENT +ACPI_MODULE_NAME ("pci_bind") + +#define PREFIX "ACPI: " + + +struct acpi_pci_data { + acpi_pci_id id; + struct pci_bus *bus; + struct pci_dev *dev; +}; + + +void +acpi_pci_data_handler ( + acpi_handle handle, + u32 function, + void *context) +{ + ACPI_FUNCTION_TRACE("acpi_pci_data_handler"); + + /* TBD: Anything we need to do here? */ + + return_VOID; +} + + +/** + * acpi_os_get_pci_id + * ------------------ + * This function is used by the ACPI Interpreter (a.k.a. Core Subsystem) + * to resolve PCI information for ACPI-PCI devices defined in the namespace. + * This typically occurs when resolving PCI operation region information. + */ +acpi_status +acpi_os_get_pci_id ( + acpi_handle handle, + acpi_pci_id *id) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_device *device = NULL; + struct acpi_pci_data *data = NULL; + + ACPI_FUNCTION_TRACE("acpi_os_get_pci_id"); + + if (!id) + return_ACPI_STATUS(AE_BAD_PARAMETER); + + result = acpi_bus_get_device(handle, &device); + if (0 != result) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid ACPI Bus context for device %s\n", + acpi_device_bid(device))); + return_ACPI_STATUS(AE_NOT_EXIST); + } + + status = acpi_get_data(handle, acpi_pci_data_handler, (void**) &data); + if (ACPI_FAILURE(status) || !data || !data->dev) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid ACPI-PCI context for device %s\n", + acpi_device_bid(device))); + return_ACPI_STATUS(status); + } + + *id = data->id; + + /* + id->segment = data->id.segment; + id->bus = data->id.bus; + id->device = data->id.device; + id->function = data->id.function; + */ + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Device %s has PCI address %02x:%02x:%02x.%02x\n", + acpi_device_bid(device), id->segment, id->bus, + id->device, id->function)); + + return_ACPI_STATUS(AE_OK); +} + + +int +acpi_pci_bind ( + struct acpi_device *device) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_pci_data *data = NULL; + struct acpi_pci_data *pdata = NULL; + char pathname[PATHNAME_MAX] = {0}; + acpi_buffer buffer = {PATHNAME_MAX, pathname}; + acpi_handle handle = NULL; + + ACPI_FUNCTION_TRACE("acpi_pci_bind"); + + if (!device || !device->parent) + return_VALUE(-EINVAL); + + data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL); + if (!data) + return_VALUE(-ENOMEM); + memset(data, 0, sizeof(struct acpi_pci_data)); + + acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer); + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Binding PCI device [%s]...\n", + pathname)); + + /* + * Segment & Bus + * ------------- + * These are obtained via the parent device's ACPI-PCI context. + */ + status = acpi_get_data(device->parent->handle, acpi_pci_data_handler, + (void**) &pdata); + if (ACPI_FAILURE(status) || !pdata || !pdata->bus) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid ACPI-PCI context for parent device %s\n", + acpi_device_bid(device->parent))); + result = -ENODEV; + goto end; + } + data->id.segment = pdata->id.segment; + data->id.bus = pdata->bus->number; + + /* + * Device & Function + * ----------------- + * These are simply obtained from the device's _ADR method. Note + * that a value of zero is valid. + */ + data->id.device = device->pnp.bus_address >> 16; + data->id.function = device->pnp.bus_address & 0xFFFF; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "...to %02x:%02x:%02x.%02x\n", + data->id.segment, data->id.bus, data->id.device, + data->id.function)); + + /* + * TBD: Support slot devices (e.g. function=0xFFFF). + */ + + /* + * Locate PCI Device + * ----------------- + * Locate matching device in PCI namespace. If it doesn't exist + * this typically means that the device isn't currently inserted + * (e.g. docking station, port replicator, etc.). + */ + data->dev = pci_find_slot(data->id.bus, PCI_DEVFN(data->id.device, data->id.function)); + if (!data->dev) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Device %02x:%02x:%02x.%02x not present in PCI namespace\n", + data->id.segment, data->id.bus, + data->id.device, data->id.function)); + result = -ENODEV; + goto end; + } + if (!data->dev->bus) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Device %02x:%02x:%02x.%02x has invalid 'bus' field\n", + data->id.segment, data->id.bus, + data->id.device, data->id.function)); + result = -ENODEV; + goto end; + } + + /* + * PCI Bridge? + * ----------- + * If so, set the 'bus' field and install the 'bind' function to + * facilitate callbacks for all of its children. + */ + if (data->dev->subordinate) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Device %02x:%02x:%02x.%02x is a PCI bridge\n", + data->id.segment, data->id.bus, + data->id.device, data->id.function)); + data->bus = data->dev->subordinate; + device->ops.bind = acpi_pci_bind; + } + + /* + * Attach ACPI-PCI Context + * ----------------------- + * Thus binding the ACPI and PCI devices. + */ + status = acpi_attach_data(device->handle, acpi_pci_data_handler, data); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to attach ACPI-PCI context to device %s\n", + acpi_device_bid(device))); + result = -ENODEV; + goto end; + } + + /* + * PCI Routing Table + * ----------------- + * Evaluate and parse _PRT, if exists. This code is independent of + * PCI bridges (above) to allow parsing of _PRT objects within the + * scope of non-bridge devices. Note that _PRTs within the scope of + * a PCI bridge assume the bridge's subordinate bus number. + * + * TBD: Can _PRTs exist within the scope of non-bridge PCI devices? + */ + status = acpi_get_handle(device->handle, METHOD_NAME__PRT, &handle); + if (ACPI_SUCCESS(status)) { + if (data->bus) /* PCI-PCI bridge */ + acpi_pci_irq_add_prt(device->handle, data->id.segment, + data->bus->number); + else /* non-bridge PCI device */ + acpi_pci_irq_add_prt(device->handle, data->id.segment, + data->id.bus); + } + +end: + if (0 != result) + kfree(data); + + return_VALUE(result); +} + + +int +acpi_pci_bind_root ( + struct acpi_device *device, + acpi_pci_id *id, + struct pci_bus *bus) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_pci_data *data = NULL; + char pathname[PATHNAME_MAX] = {0}; + acpi_buffer buffer = {PATHNAME_MAX, pathname}; + + ACPI_FUNCTION_TRACE("acpi_pci_bind_root"); + + if (!device || !id || !bus) + return_VALUE(-EINVAL); + + data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL); + if (!data) + return_VALUE(-ENOMEM); + memset(data, 0, sizeof(struct acpi_pci_data)); + + data->id = *id; + data->bus = bus; + device->ops.bind = acpi_pci_bind; + + acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Binding PCI root bridge [%s] to " + "%02x:%02x\n", pathname, id->segment, id->bus)); + + status = acpi_attach_data(device->handle, acpi_pci_data_handler, data); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to attach ACPI-PCI context to device %s\n", + pathname)); + result = -ENODEV; + goto end; + } + +end: + if (result != 0) + kfree(data); + + return_VALUE(result); +} diff -urN linux-2.4.18/drivers/acpi/pci_irq.c lia64-2.4/drivers/acpi/pci_irq.c --- linux-2.4.18/drivers/acpi/pci_irq.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/pci_irq.c Tue Jun 11 14:24:23 2002 @@ -0,0 +1,391 @@ +/* + * pci_irq.c - ACPI PCI Interrupt Routing ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * Copyright (C) 2002 Dominik Brodowski + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "acpi_bus.h" +#include "acpi_drivers.h" + + +#define _COMPONENT ACPI_PCI_COMPONENT +ACPI_MODULE_NAME ("pci_irq") + +#define PREFIX "PCI: " + +struct acpi_prt_list acpi_prt; + +#ifdef CONFIG_X86 +extern void eisa_set_level_irq(unsigned int irq); +#endif + + +/* -------------------------------------------------------------------------- + PCI IRQ Routing Table (PRT) Support + -------------------------------------------------------------------------- */ + +static struct acpi_prt_entry * +acpi_pci_irq_find_prt_entry ( + int segment, + int bus, + int device, + int pin) +{ + struct list_head *node = NULL; + struct acpi_prt_entry *entry = NULL; + + ACPI_FUNCTION_TRACE("acpi_pci_irq_find_prt_entry"); + + /* + * Parse through all PRT entries looking for a match on the specified + * PCI device's segment, bus, device, and pin (don't care about func). + * + * TBD: Acquire/release lock + */ + list_for_each(node, &acpi_prt.entries) { + entry = list_entry(node, struct acpi_prt_entry, node); + if ((segment == entry->id.segment) + && (bus == entry->id.bus) + && (device == entry->id.device) + && (pin == entry->pin)) { + return_PTR(entry); + } + } + + return_PTR(NULL); +} + + +static int +acpi_pci_irq_add_entry ( + acpi_handle handle, + int segment, + int bus, + acpi_pci_routing_table *prt) +{ + struct acpi_prt_entry *entry = NULL; + + ACPI_FUNCTION_TRACE("acpi_pci_irq_add_entry"); + + if (!prt) + return_VALUE(-EINVAL); + + entry = kmalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL); + if (!entry) + return_VALUE(-ENOMEM); + memset(entry, 0, sizeof(struct acpi_prt_entry)); + + entry->id.segment = segment; + entry->id.bus = bus; + entry->id.device = (prt->address >> 16) & 0xFFFF; + entry->id.function = prt->address & 0xFFFF; + entry->pin = prt->pin; + + /* + * Type 1: Dynamic + * --------------- + * The 'source' field specifies the PCI interrupt link device used to + * configure the IRQ assigned to this slot|dev|pin. The 'source_index' + * indicates which resource descriptor in the resource template (of + * the link device) this interrupt is allocated from. + * + * NOTE: Don't query the Link Device for IRQ information at this time + * because Link Device enumeration may not have occurred yet + * (e.g. exists somewhere 'below' this _PRT entry in the ACPI + * namespace). + */ + if (prt->source[0]) { + acpi_get_handle(handle, prt->source, &entry->link.handle); + entry->link.index = prt->source_index; + } + /* + * Type 2: Static + * -------------- + * The 'source' field is NULL, and the 'source_index' field specifies + * the IRQ value, which is hardwired to specific interrupt inputs on + * the interrupt controller. + */ + else + entry->link.index = prt->source_index; + + ACPI_DEBUG_PRINT_RAW((ACPI_DB_INFO, + " %02X:%02X:%02X[%c] -> %s[%d]\n", + entry->id.segment, entry->id.bus, entry->id.device, + ('A' + entry->pin), prt->source, entry->link.index)); + + /* TBD: Acquire/release lock */ + list_add_tail(&entry->node, &acpi_prt.entries); + acpi_prt.count++; + + return_VALUE(0); +} + + +int +acpi_pci_irq_add_prt ( + acpi_handle handle, + int segment, + int bus) +{ + acpi_status status = AE_OK; + char pathname[PATHNAME_MAX] = {0}; + acpi_buffer buffer = {0, NULL}; + acpi_pci_routing_table *prt = NULL; + acpi_pci_routing_table *entry = NULL; + static int first_time = 1; + + ACPI_FUNCTION_TRACE("acpi_pci_irq_add_prt"); + + if (first_time) { + acpi_prt.count = 0; + INIT_LIST_HEAD(&acpi_prt.entries); + first_time = 0; + } + + /* + * NOTE: We're given a 'handle' to the _PRT object's parent device + * (either a PCI root bridge or PCI-PCI bridge). + */ + + buffer.length = sizeof(pathname); + buffer.pointer = pathname; + acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); + + printk(KERN_DEBUG "ACPI: PCI Interrupt Routing Table [%s._PRT]\n", + pathname); + + /* + * Evaluate this _PRT and add its entries to our global list (acpi_prt). + */ + + buffer.length = 0; + buffer.pointer = NULL; + status = acpi_get_irq_routing_table(handle, &buffer); + if (status != AE_BUFFER_OVERFLOW) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n", + acpi_format_exception(status))); + return_VALUE(-ENODEV); + } + + prt = kmalloc(buffer.length, GFP_KERNEL); + if (!prt) + return_VALUE(-ENOMEM); + memset(prt, 0, buffer.length); + buffer.pointer = prt; + + status = acpi_get_irq_routing_table(handle, &buffer); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n", + acpi_format_exception(status))); + kfree(buffer.pointer); + return_VALUE(-ENODEV); + } + + entry = prt; + + while (entry && (entry->length > 0)) { + acpi_pci_irq_add_entry(handle, segment, bus, entry); + entry = (acpi_pci_routing_table *) + ((unsigned long) entry + entry->length); + } + + kfree(prt); + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + PCI Interrupt Routing Support + -------------------------------------------------------------------------- */ + +static int +acpi_pci_irq_lookup ( + int segment, + int bus, + int device, + int pin) +{ + struct acpi_prt_entry *entry = NULL; + + ACPI_FUNCTION_TRACE("acpi_pci_irq_lookup"); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Searching for PRT entry for %02x:%02x:%02x[%c]\n", + segment, bus, device, ('A' + pin))); + + entry = acpi_pci_irq_find_prt_entry(segment, bus, device, pin); + if (!entry) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PRT entry not found\n")); + return_VALUE(0); + } + + if (!entry->irq && entry->link.handle) + entry->irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index); + else if (!entry->irq) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Invalid static routing entry (IRQ 0)\n")); + return_VALUE(0); + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", entry->irq)); + + return_VALUE(entry->irq); +} + + +static int +acpi_pci_irq_derive ( + struct pci_dev *dev, + int pin) +{ + struct pci_dev *bridge = dev; + int irq = 0; + + ACPI_FUNCTION_TRACE("acpi_pci_irq_derive"); + + if (!dev) + return_VALUE(-EINVAL); + + /* + * Attempt to derive an IRQ for this device from a parent bridge's + * PCI interrupt routing entry (a.k.a. the "bridge swizzle"). + */ + while (!irq && (bridge = bridge->bus->self)) { + pin = (pin + PCI_SLOT(bridge->devfn)) % 4; + irq = acpi_pci_irq_lookup(0, bridge->bus->number, PCI_SLOT(bridge->devfn), pin); + } + + if (!irq) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to derive IRQ for device %s\n", dev->slot_name)); + return_VALUE(0); + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derived IRQ %d\n", irq)); + + return_VALUE(irq); +} + + +int +acpi_pci_irq_enable ( + struct pci_dev *dev) +{ + int irq = 0; + u8 pin = 0; + static u16 irq_mask = 0; + + ACPI_FUNCTION_TRACE("acpi_pci_irq_enable"); + + if (!dev) + return_VALUE(-EINVAL); + + pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); + if (!pin) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No interrupt pin configured for device %s\n", dev->slot_name)); + return_VALUE(0); + } + pin--; + + if (!dev->bus) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) 'bus' field\n")); + return_VALUE(-ENODEV); + } + + /* + * First we check the PCI IRQ routing table (PRT) for an IRQ. PRT + * values override any BIOS-assinged IRQs set during boot. + */ + irq = acpi_pci_irq_lookup(0, dev->bus->number, PCI_SLOT(dev->devfn), pin); + if (irq) + dev->irq = irq; + + /* + * If no PRT entry was found and the device wasn't assigned an IRQ + * during boot we'll try to derive an IRQ from the device's parent + * bridge. + */ + if (!dev->irq && dev->bus->self) { + irq = acpi_pci_irq_derive(dev, pin); + if (irq) + dev->irq = irq; + } + + + if (!dev->irq) { + printk(KERN_WARNING PREFIX "No IRQ known for interrupt pin %c of device %s\n", ('A' + pin), dev->slot_name); + return_VALUE(0); + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device %s using IRQ %d\n", dev->slot_name, dev->irq)); + + /* + * Make sure all (legacy) PCI IRQs are set as level-triggered. + */ +#ifdef CONFIG_X86 + if ((dev->irq < 16) && !((1 << dev->irq) & irq_mask)) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Setting IRQ %d as level-triggered\n", dev->irq)); + irq_mask |= (1 << dev->irq); + eisa_set_level_irq(dev->irq); + } +#endif + + return_VALUE(dev->irq); +} + + +int __init +acpi_pci_irq_init (void) +{ + struct pci_dev *dev = NULL; + + ACPI_FUNCTION_TRACE("acpi_pci_irq_init"); + + if (!acpi_prt.count) { + printk(KERN_WARNING PREFIX "ACPI tables contain no PCI IRQ " + "routing entries\n"); + return_VALUE(-ENODEV); + } + + /* Make sure all link devices have a valid IRQ. */ + acpi_pci_link_check(); + +#ifdef CONFIG_X86_IO_APIC + /* Program IOAPICs using data from PRT entries. */ + if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) + mp_parse_prt(); +#endif + + pci_for_each_dev(dev) + acpi_pci_irq_enable(dev); + + return_VALUE(acpi_prt.count); +} diff -urN linux-2.4.18/drivers/acpi/pci_link.c lia64-2.4/drivers/acpi/pci_link.c --- linux-2.4.18/drivers/acpi/pci_link.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/pci_link.c Tue Jun 11 14:24:23 2002 @@ -0,0 +1,581 @@ +/* + * pci_link.c - ACPI PCI Interrupt Link Device Driver ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * Copyright (C) 2002 Dominik Brodowski + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * TBD: + * 1. Support more than one IRQ resource entry per link device (index). + * 2. Implement start/stop mechanism and use ACPI Bus Driver facilities + * for IRQ management (e.g. start()->_SRS). + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "acpi_bus.h" +#include "acpi_drivers.h" + + +#define _COMPONENT ACPI_PCI_COMPONENT +ACPI_MODULE_NAME ("pci_link") + +#define PREFIX "ACPI: " + + +#define ACPI_PCI_LINK_MAX_POSSIBLE 16 + +static int acpi_pci_link_add (struct acpi_device *device); +static int acpi_pci_link_remove (struct acpi_device *device, int type); + +static struct acpi_driver acpi_pci_link_driver = { + name: ACPI_PCI_LINK_DRIVER_NAME, + class: ACPI_PCI_LINK_CLASS, + ids: ACPI_PCI_LINK_HID, + ops: { + add: acpi_pci_link_add, + remove: acpi_pci_link_remove, + }, +}; + +struct acpi_pci_link_irq { + u8 active; /* Current IRQ */ + u8 possible_count; + u8 possible[ACPI_PCI_LINK_MAX_POSSIBLE]; +}; + +struct acpi_pci_link { + struct list_head node; + struct acpi_device *device; + acpi_handle handle; + struct acpi_pci_link_irq irq; +}; + +static struct { + int count; + struct list_head entries; +} acpi_link; + + +/* -------------------------------------------------------------------------- + PCI Link Device Management + -------------------------------------------------------------------------- */ + +static int +acpi_pci_link_get_possible ( + struct acpi_pci_link *link) +{ + int result = 0; + acpi_status status = AE_OK; + acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + acpi_resource *resource = NULL; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_pci_link_get_possible"); + + if (!link) + return_VALUE(-EINVAL); + + status = acpi_get_possible_resources(link->handle, &buffer); + if (ACPI_FAILURE(status) || !buffer.pointer) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRS\n")); + result = -ENODEV; + goto end; + } + + resource = (acpi_resource *) buffer.pointer; + + switch (resource->id) { + case ACPI_RSTYPE_IRQ: + { + acpi_resource_irq *p = &resource->data.irq; + if (!p || !p->number_of_interrupts) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Blank IRQ resource\n")); + result = -ENODEV; + goto end; + } + for (i = 0; (inumber_of_interrupts && iinterrupts[i]) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ %d\n", p->interrupts[i])); + continue; + } + link->irq.possible[i] = p->interrupts[i]; + link->irq.possible_count++; + } + break; + } + case ACPI_RSTYPE_EXT_IRQ: + { + acpi_resource_ext_irq *p = &resource->data.extended_irq; + if (!p || !p->number_of_interrupts) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Blank IRQ resource\n")); + result = -ENODEV; + goto end; + } + for (i = 0; (inumber_of_interrupts && iinterrupts[i]) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ %d\n", p->interrupts[i])); + continue; + } + link->irq.possible[i] = p->interrupts[i]; + link->irq.possible_count++; + } + break; + } + default: + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Resource is not an IRQ entry\n")); + result = -ENODEV; + goto end; + break; + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Found %d possible IRQs\n", link->irq.possible_count)); + +end: + kfree(buffer.pointer); + + return_VALUE(result); +} + + +static int +acpi_pci_link_get_current ( + struct acpi_pci_link *link) +{ + int result = 0; + acpi_status status = AE_OK; + acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + acpi_resource *resource = NULL; + int irq = 0; + + ACPI_FUNCTION_TRACE("acpi_pci_link_get_current"); + + if (!link || !link->handle) + return_VALUE(-EINVAL); + + link->irq.active = 0; + + /* Make sure the link is enabled (no use querying if it isn't). */ + result = acpi_bus_get_status(link->device); + if (0 != result) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to read status\n")); + goto end; + } + if (!link->device->status.enabled) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n")); + return_VALUE(0); + } + + /* + * Query and parse _CRS to get the current IRQ assignment. + */ + + status = acpi_get_current_resources(link->handle, &buffer); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _CRS\n")); + result = -ENODEV; + goto end; + } + resource = (acpi_resource *) buffer.pointer; + + switch (resource->id) { + case ACPI_RSTYPE_IRQ: + { + acpi_resource_irq *p = &resource->data.irq; + if (!p || !p->number_of_interrupts) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Blank IRQ resource\n")); + result = -ENODEV; + goto end; + } + irq = p->interrupts[0]; + break; + } + case ACPI_RSTYPE_EXT_IRQ: + { + acpi_resource_ext_irq *p = &resource->data.extended_irq; + if (!p || !p->number_of_interrupts) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Blank IRQ resource\n")); + result = -ENODEV; + goto end; + } + irq = p->interrupts[0]; + break; + } + default: + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Resource isn't an IRQ\n")); + result = -ENODEV; + goto end; + } + + if (!irq) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid use of IRQ 0\n")); + result = -ENODEV; + goto end; + } + + /* + * Note that we don't validate that the current IRQ (_CRS) exists + * within the possible IRQs (_PRS): we blindly assume that whatever + * IRQ a boot-enabled Link device is set to is the correct one. + * (Required to support systems such as the Toshiba 5005-S504.) + */ + + link->irq.active = irq; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active)); + +end: + kfree(buffer.pointer); + + return_VALUE(result); +} + + +static int +acpi_pci_link_set ( + struct acpi_pci_link *link, + int irq) +{ + int result = 0; + acpi_status status = AE_OK; + struct { + acpi_resource res; + acpi_resource end; + } resource; + acpi_buffer buffer = {sizeof(resource)+1, &resource}; + int i = 0; + int valid = 0; + + ACPI_FUNCTION_TRACE("acpi_pci_link_set"); + + if (!link || !irq) + return_VALUE(-EINVAL); + + /* See if we're already at the target IRQ. */ + if (irq == link->irq.active) + return_VALUE(0); + + /* Make sure the target IRQ in the list of possible IRQs. */ + for (i=0; iirq.possible_count; i++) { + if (irq == link->irq.possible[i]) + valid = 1; + } + if (!valid) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Target IRQ %d invalid\n", irq)); + return_VALUE(-EINVAL); + } + + memset(&resource, 0, sizeof(resource)); + + /* NOTE: PCI interrupts are always level / active_low / shared. */ + resource.res.id = ACPI_RSTYPE_IRQ; + resource.res.length = sizeof(acpi_resource); + resource.res.data.irq.edge_level = ACPI_LEVEL_SENSITIVE; + resource.res.data.irq.active_high_low = ACPI_ACTIVE_LOW; + resource.res.data.irq.shared_exclusive = ACPI_SHARED; + resource.res.data.irq.number_of_interrupts = 1; + resource.res.data.irq.interrupts[0] = irq; + resource.end.id = ACPI_RSTYPE_END_TAG; + + status = acpi_set_current_resources(link->handle, &buffer); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n")); + return_VALUE(-ENODEV); + } + + /* Make sure the device is enabled. */ + result = acpi_bus_get_status(link->device); + if (0 != result) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to read status\n")); + return_VALUE(result); + } + if (!link->device->status.enabled) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link disabled\n")); + return_VALUE(-ENODEV); + } + + /* Make sure the active IRQ is the one we requested. */ + result = acpi_pci_link_get_current(link); + if (0 != result) { + return_VALUE(result); + } + if (link->irq.active != irq) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Attempt to enable at IRQ %d resulted in IRQ %d\n", + irq, link->irq.active)); + link->irq.active = 0; + return_VALUE(-ENODEV); + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Set IRQ %d\n", link->irq.active)); + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + PCI Link IRQ Management + -------------------------------------------------------------------------- */ + +#define ACPI_MAX_IRQS 256 +#define ACPI_MAX_ISA_IRQ 16 + +/* + * IRQ penalties are used to promote PCI IRQ balancing. We set each ISA- + * possible IRQ (0-15) with a default penalty relative to its feasibility + * for PCI's use: + * + * Never use: 0, 1, 2 (timer, keyboard, and cascade) + * Avoid using: 13, 14, and 15 (FP error and IDE) + * Penalize: 3, 4, 6, 7, 12 (known ISA uses) + * + * Thus we're left with IRQs 5, 9, 10, 11, and everything above 15 (IO[S]APIC) + * as 'best bets' for PCI use. + */ + +static int acpi_irq_penalty[ACPI_MAX_IRQS] = { + 1000000, 1000000, 1000000, 10000, + 10000, 0, 10000, 10000, + 10000, 0, 0, 0, + 10000, 100000, 100000, 100000, +}; + + +int +acpi_pci_link_check (void) +{ + struct list_head *node = NULL; + struct acpi_pci_link *link = NULL; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_pci_link_check"); + + /* + * Pass #1: Update penalties to facilitate IRQ balancing. + */ + list_for_each(node, &acpi_link.entries) { + + link = list_entry(node, struct acpi_pci_link, node); + if (!link) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n")); + continue; + } + + if (link->irq.active) + acpi_irq_penalty[link->irq.active] += 100; + else { + int penalty = 100 / link->irq.possible_count; + for (i=0; iirq.possible_count; i++) { + if (link->irq.possible[i] < ACPI_MAX_ISA_IRQ) + acpi_irq_penalty[link->irq.possible[i]] += penalty; + } + } + } + + /* + * Pass #2: Enable boot-disabled Links at 'best' IRQ. + */ + list_for_each(node, &acpi_link.entries) { + int irq = 0; + int i = 0; + + link = list_entry(node, struct acpi_pci_link, node); + if (!link) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n")); + continue; + } + + if (link->irq.active) + continue; + + irq = link->irq.possible[0]; + + /* + * Select the best IRQ. This is done in reverse to promote + * the use of IRQs 9, 10, 11, and >15. + */ + for (i=(link->irq.possible_count-1); i>0; i--) { + if (acpi_irq_penalty[irq] > acpi_irq_penalty[link->irq.possible[i]]) + irq = link->irq.possible[i]; + } + + /* Enable the link device at this IRQ. */ + acpi_pci_link_set(link, irq); + + acpi_irq_penalty[link->irq.active] += 100; + + printk(PREFIX "%s [%s] enabled at IRQ %d\n", + acpi_device_name(link->device), + acpi_device_bid(link->device), irq); + } + + return_VALUE(0); +} + + +int +acpi_pci_link_get_irq ( + acpi_handle handle, + int index) +{ + int result = 0; + struct acpi_device *device = NULL; + struct acpi_pci_link *link = NULL; + + ACPI_FUNCTION_TRACE("acpi_pci_link_get_irq"); + + result = acpi_bus_get_device(handle, &device); + if (0 != result) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n")); + return_VALUE(0); + } + + link = (struct acpi_pci_link *) acpi_driver_data(device); + if (!link) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n")); + return_VALUE(0); + } + + /* TBD: Support multiple index (IRQ) entries per Link Device */ + if (0 != index) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid index %d\n", index)); + return_VALUE(0); + } + + if (!link->irq.active) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link disabled\n")); + return_VALUE(0); + } + + return_VALUE(link->irq.active); +} + + +/* -------------------------------------------------------------------------- + Driver Interface + -------------------------------------------------------------------------- */ + +static int +acpi_pci_link_add ( + struct acpi_device *device) +{ + int result = 0; + struct acpi_pci_link *link = NULL; + int i = 0; + int found = 0; + + ACPI_FUNCTION_TRACE("acpi_pci_link_add"); + + if (!device) + return_VALUE(-EINVAL); + + link = kmalloc(sizeof(struct acpi_pci_link), GFP_KERNEL); + if (!link) + return_VALUE(-ENOMEM); + memset(link, 0, sizeof(struct acpi_pci_link)); + + link->device = device; + link->handle = device->handle; + sprintf(acpi_device_name(device), "%s", ACPI_PCI_LINK_DEVICE_NAME); + sprintf(acpi_device_class(device), "%s", ACPI_PCI_LINK_CLASS); + acpi_driver_data(device) = link; + + result = acpi_pci_link_get_possible(link); + if (0 != result) + goto end; + + acpi_pci_link_get_current(link); + + printk(PREFIX "%s [%s] (IRQs", acpi_device_name(device), acpi_device_bid(device)); + for (i = 0; i < link->irq.possible_count; i++) { + if (link->irq.active == link->irq.possible[i]) { + printk(" *%d", link->irq.possible[i]); + found = 1; + } + else + printk(" %d", link->irq.possible[i]); + } + if (!link->irq.active) + printk(", disabled"); + else if (!found) + printk(", enabled at IRQ %d", link->irq.active); + printk(")\n"); + + /* TBD: Acquire/release lock */ + list_add_tail(&link->node, &acpi_link.entries); + acpi_link.count++; + +end: + if (0 != result) + kfree(link); + + return_VALUE(result); +} + + +static int +acpi_pci_link_remove ( + struct acpi_device *device, + int type) +{ + struct acpi_pci_link *link = NULL; + + ACPI_FUNCTION_TRACE("acpi_pci_link_remove"); + + if (!device || !acpi_driver_data(device)) + return_VALUE(-EINVAL); + + link = (struct acpi_pci_link *) acpi_driver_data(device); + + /* TBD: Acquire/release lock */ + list_del(&link->node); + + kfree(link); + + return_VALUE(0); +} + + +int __init +acpi_pci_link_init (void) +{ + ACPI_FUNCTION_TRACE("acpi_pci_link_init"); + + acpi_link.count = 0; + INIT_LIST_HEAD(&acpi_link.entries); + + if (0 > acpi_bus_register_driver(&acpi_pci_link_driver)) + return_VALUE(-ENODEV); + + return_VALUE(0); +} diff -urN linux-2.4.18/drivers/acpi/pci_root.c lia64-2.4/drivers/acpi/pci_root.c --- linux-2.4.18/drivers/acpi/pci_root.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/pci_root.c Tue Jun 11 14:24:23 2002 @@ -0,0 +1,246 @@ +/* + * pci_root.c - ACPI PCI Root Bridge Driver ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "acpi_bus.h" +#include "acpi_drivers.h" + + +#define _COMPONENT ACPI_PCI_COMPONENT +ACPI_MODULE_NAME ("pci_root") + +extern struct pci_ops *pci_root_ops; + +#define PREFIX "ACPI: " + +static int acpi_pci_root_add (struct acpi_device *device); +static int acpi_pci_root_remove (struct acpi_device *device, int type); + +static struct acpi_driver acpi_pci_root_driver = { + name: ACPI_PCI_ROOT_DRIVER_NAME, + class: ACPI_PCI_ROOT_CLASS, + ids: ACPI_PCI_ROOT_HID, + ops: { + add: acpi_pci_root_add, + remove: acpi_pci_root_remove, + }, +}; + +struct acpi_pci_root { + acpi_handle handle; + acpi_pci_id id; + struct pci_bus *bus; +}; + + +static int +acpi_pci_root_add ( + struct acpi_device *device) +{ + int result = 0; + struct acpi_pci_root *root = NULL; + acpi_status status = AE_OK; + unsigned long value = 0; + acpi_handle handle = NULL; + + ACPI_FUNCTION_TRACE("acpi_pci_root_add"); + + if (!device) + return_VALUE(-EINVAL); + + root = kmalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); + if (!root) + return_VALUE(-ENOMEM); + memset(root, 0, sizeof(struct acpi_pci_root)); + + root->handle = device->handle; + sprintf(acpi_device_name(device), "%s", ACPI_PCI_ROOT_DEVICE_NAME); + sprintf(acpi_device_class(device), "%s", ACPI_PCI_ROOT_CLASS); + acpi_driver_data(device) = root; + + /* + * TBD: Doesn't the bus driver automatically set this? + */ + device->ops.bind = acpi_pci_bind; + + /* + * Segment + * ------- + * Obtained via _SEG, if exists, otherwise assumed to be zero (0). + */ + status = acpi_evaluate_integer(root->handle, METHOD_NAME__SEG, NULL, + &value); + switch (status) { + case AE_OK: + root->id.segment = (u16) value; + printk("_SEG exists! Unsupported. Abort.\n"); + BUG(); + break; + case AE_NOT_FOUND: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Assuming segment 0 (no _SEG)\n")); + root->id.segment = 0; + break; + default: + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SEG\n")); + result = -ENODEV; + goto end; + } + + /* + * Bus + * --- + * Obtained via _BBN, if exists, otherwise assumed to be zero (0). + */ + status = acpi_evaluate_integer(root->handle, METHOD_NAME__BBN, NULL, + &value); + switch (status) { + case AE_OK: + root->id.bus = (u16) value; + break; + case AE_NOT_FOUND: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Assuming bus 0 (no _BBN)\n")); + root->id.bus = 0; + break; + default: + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BBN\n")); + result = -ENODEV; + goto end; + } + + /* + * Device & Function + * ----------------- + * Obtained from _ADR (which has already been evaluated for us). + */ + root->id.device = device->pnp.bus_address >> 16; + root->id.function = device->pnp.bus_address & 0xFFFF; + + /* + * TBD: Evaluate _CRS to get root bridge resources + * TBD: Need PCI interface for enumeration/configuration of roots. + */ + + printk(KERN_INFO PREFIX "%s [%s] (%02x:%02x)\n", + acpi_device_name(device), acpi_device_bid(device), + root->id.segment, root->id.bus); + + /* + * Scan the Root Bridge + * -------------------- + * Must do this prior to any attempt to bind the root device, as the + * PCI namespace does not get created until this call is made (and + * thus the root bridge's pci_dev does not exist). + */ + root->bus = pcibios_scan_root(root->id.bus); + if (!root->bus) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Bus %02x:%02x not present in PCI namespace\n", + root->id.segment, root->id.bus)); + result = -ENODEV; + goto end; + } + + /* + * Attach ACPI-PCI Context + * ----------------------- + * Thus binding the ACPI and PCI devices. + */ + result = acpi_pci_bind_root(device, &root->id, root->bus); + if (0 != result) + goto end; + + /* + * PCI Routing Table + * ----------------- + * Evaluate and parse _PRT, if exists. + */ + status = acpi_get_handle(root->handle, METHOD_NAME__PRT, &handle); + if (ACPI_SUCCESS(status)) + result = acpi_pci_irq_add_prt(root->handle, root->id.segment, + root->id.bus); + +end: + if (0 != result) + kfree(root); + + return_VALUE(result); +} + + +static int +acpi_pci_root_remove ( + struct acpi_device *device, + int type) +{ + struct acpi_pci_root *root = NULL; + + ACPI_FUNCTION_TRACE("acpi_pci_root_remove"); + + if (!device || !acpi_driver_data(device)) + return_VALUE(-EINVAL); + + root = (struct acpi_pci_root *) acpi_driver_data(device); + + kfree(root); + + return_VALUE(0); +} + + +int __init +acpi_pci_root_init (void) +{ + ACPI_FUNCTION_TRACE("acpi_pci_root_init"); + + /* DEBUG: + acpi_dbg_layer = ACPI_PCI_COMPONENT; + acpi_dbg_level = 0xFFFFFFFF; + */ + + if (0 > acpi_bus_register_driver(&acpi_pci_root_driver)) + return_VALUE(-ENODEV); + + return_VALUE(0); +} + + +void __exit +acpi_pci_root_exit (void) +{ + ACPI_FUNCTION_TRACE("acpi_pci_root_exit"); + + acpi_bus_unregister_driver(&acpi_pci_root_driver); + + return_VOID; +} diff -urN linux-2.4.18/drivers/acpi/power.c lia64-2.4/drivers/acpi/power.c --- linux-2.4.18/drivers/acpi/power.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/power.c Tue Jun 11 14:24:23 2002 @@ -0,0 +1,610 @@ +/* + * acpi_power.c - ACPI Bus Power Management ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include +#include +#include +#include "acpi_bus.h" +#include "acpi_drivers.h" + + +#define _COMPONENT ACPI_POWER_COMPONENT +ACPI_MODULE_NAME ("acpi_power") + +#define PREFIX "ACPI: " + + +int acpi_power_add (struct acpi_device *device); +int acpi_power_remove (struct acpi_device *device, int type); + +static struct acpi_driver acpi_power_driver = { + name: ACPI_POWER_DRIVER_NAME, + class: ACPI_POWER_CLASS, + ids: ACPI_POWER_HID, + ops: { + add: acpi_power_add, + remove: acpi_power_remove, + }, +}; + +struct acpi_power_resource +{ + acpi_handle handle; + acpi_bus_id name; + u32 system_level; + u32 order; + int state; + int references; +}; + +static struct list_head acpi_power_resource_list; + + +/* -------------------------------------------------------------------------- + Power Resource Management + -------------------------------------------------------------------------- */ + +static int +acpi_power_get_context ( + acpi_handle handle, + struct acpi_power_resource **resource) +{ + int result = 0; + struct acpi_device *device = NULL; + + ACPI_FUNCTION_TRACE("acpi_power_get_context"); + + if (!resource) + return_VALUE(-ENODEV); + + result = acpi_bus_get_device(handle, &device); + if (0 != result) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error getting context [%p]\n", + handle)); + return_VALUE(result); + } + + *resource = (struct acpi_power_resource *) acpi_driver_data(device); + if (!resource) + return_VALUE(-ENODEV); + + return_VALUE(0); +} + + +static int +acpi_power_get_state ( + struct acpi_power_resource *resource) +{ + acpi_status status = AE_OK; + unsigned long sta = 0; + + ACPI_FUNCTION_TRACE("acpi_power_get_state"); + + if (!resource) + return_VALUE(-EINVAL); + + status = acpi_evaluate_integer(resource->handle, "_STA", NULL, &sta); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + if (sta & 0x01) + resource->state = ACPI_POWER_RESOURCE_STATE_ON; + else + resource->state = ACPI_POWER_RESOURCE_STATE_OFF; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n", + resource->name, resource->state?"on":"off")); + + return_VALUE(0); +} + + +static int +acpi_power_get_list_state ( + struct acpi_handle_list *list, + int *state) +{ + int result = 0; + struct acpi_power_resource *resource = NULL; + u32 i = 0; + + ACPI_FUNCTION_TRACE("acpi_power_get_list_state"); + + if (!list || !state) + return_VALUE(-EINVAL); + + /* The state of the list is 'on' IFF all resources are 'on'. */ + + for (i=0; icount; i++) { + result = acpi_power_get_context(list->handles[i], &resource); + if (0 != result) + return_VALUE(result); + result = acpi_power_get_state(resource); + if (0 != result) + return_VALUE(result); + + *state = resource->state; + + if (*state != ACPI_POWER_RESOURCE_STATE_ON) + break; + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource list is %s\n", + *state?"on":"off")); + + return_VALUE(result); +} + + +static int +acpi_power_on ( + acpi_handle handle) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_device *device = NULL; + struct acpi_power_resource *resource = NULL; + + ACPI_FUNCTION_TRACE("acpi_power_on"); + + result = acpi_power_get_context(handle, &resource); + if (0 != result) + return_VALUE(result); + + resource->references++; + + if ((resource->references > 1) + || (resource->state == ACPI_POWER_RESOURCE_STATE_ON)) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already on\n", + resource->name)); + return_VALUE(0); + } + + status = acpi_evaluate(resource->handle, "_ON", NULL, NULL); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + result = acpi_power_get_state(resource); + if (0 != result) + return_VALUE(result); + if (resource->state != ACPI_POWER_RESOURCE_STATE_ON) + return_VALUE(-ENOEXEC); + + /* Update the power resource's _device_ power state */ + result = acpi_bus_get_device(resource->handle, &device); + if (0 != result) + return_VALUE(result); + device->power.state = ACPI_STATE_D0; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned on\n", + resource->name)); + + return_VALUE(0); +} + + +static int +acpi_power_off ( + acpi_handle handle) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_device *device = NULL; + struct acpi_power_resource *resource = NULL; + + ACPI_FUNCTION_TRACE("acpi_power_off"); + + result = acpi_power_get_context(handle, &resource); + if (0 != result) + return_VALUE(result); + + if (resource->references) + resource->references--; + + if (resource->references) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Resource [%s] is still in use, dereferencing\n", + device->pnp.bus_id)); + return_VALUE(0); + } + + if (resource->state == ACPI_POWER_RESOURCE_STATE_OFF) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already off\n", + device->pnp.bus_id)); + return_VALUE(0); + } + + status = acpi_evaluate(resource->handle, "_OFF", NULL, NULL); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + result = acpi_power_get_state(resource); + if (0 != result) + return_VALUE(result); + if (resource->state != ACPI_POWER_RESOURCE_STATE_OFF) + return_VALUE(-ENOEXEC); + + /* Update the power resource's _device_ power state */ + result = acpi_bus_get_device(resource->handle, &device); + if (0 != result) + return_VALUE(result); + device->power.state = ACPI_STATE_D3; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned off\n", + resource->name)); + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Device Power Management + -------------------------------------------------------------------------- */ + +int +acpi_power_get_inferred_state ( + struct acpi_device *device) +{ + int result = 0; + struct acpi_handle_list *list = NULL; + int list_state = 0; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_power_get_inferred_state"); + + if (!device) + return_VALUE(-EINVAL); + + device->power.state = ACPI_STATE_UNKNOWN; + + /* + * We know a device's inferred power state when all the resources + * required for a given D-state are 'on'. + */ + for (i=ACPI_STATE_D0; ipower.states[i].resources; + if (list->count < 1) + continue; + + result = acpi_power_get_list_state(list, &list_state); + if (0 != result) + return_VALUE(result); + + if (list_state == ACPI_POWER_RESOURCE_STATE_ON) { + device->power.state = i; + return_VALUE(0); + } + } + + device->power.state = ACPI_STATE_D3; + + return_VALUE(0); +} + + +int +acpi_power_transition ( + struct acpi_device *device, + int state) +{ + int result = 0; + struct acpi_handle_list *cl = NULL; /* Current Resources */ + struct acpi_handle_list *tl = NULL; /* Target Resources */ + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_power_transition"); + + if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3)) + return_VALUE(-EINVAL); + + cl = &device->power.states[device->power.state].resources; + tl = &device->power.states[state].resources; + + device->power.state = ACPI_STATE_UNKNOWN; + + if (!cl->count && !tl->count) { + result = -ENODEV; + goto end; + } + + /* TBD: Resources must be ordered. */ + + /* + * First we reference all power resources required in the target list + * (e.g. so the device doesn't loose power while transitioning). + */ + for (i=0; icount; i++) { + result = acpi_power_on(tl->handles[i]); + if (0 != result) + goto end; + } + + device->power.state = state; + + /* + * Then we dereference all power resources used in the current list. + */ + for (i=0; icount; i++) { + result = acpi_power_off(cl->handles[i]); + if (0 != result) + goto end; + } + +end: + if (0 != result) + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Error transitioning device [%s] to D%d\n", + device->pnp.bus_id, state)); + + return_VALUE(result); +} + + +/* -------------------------------------------------------------------------- + FS Interface (/proc) + -------------------------------------------------------------------------- */ + +#include +#include + +struct proc_dir_entry *acpi_power_dir = NULL; + + +static int +acpi_power_read_status ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_power_resource *resource = NULL; + char *p = page; + int len; + + ACPI_FUNCTION_TRACE("acpi_power_read_status"); + + if (!data || (off != 0)) + goto end; + + resource = (struct acpi_power_resource *) data; + + p += sprintf(p, "state: "); + switch (resource->state) { + case ACPI_POWER_RESOURCE_STATE_ON: + p += sprintf(p, "on\n"); + break; + case ACPI_POWER_RESOURCE_STATE_OFF: + p += sprintf(p, "off\n"); + break; + default: + p += sprintf(p, "unknown\n"); + break; + } + + p += sprintf(p, "system level: S%d\n", + resource->system_level); + p += sprintf(p, "order: %d\n", + resource->order); + p += sprintf(p, "reference count: %d\n", + resource->references); + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_power_add_fs ( + struct acpi_device *device) +{ + struct proc_dir_entry *entry = NULL; + + ACPI_FUNCTION_TRACE("acpi_power_add_fs"); + + if (!device) + return_VALUE(-EINVAL); + + if (!acpi_power_dir) { + acpi_power_dir = proc_mkdir(ACPI_POWER_CLASS, acpi_root_dir); + if (!acpi_power_dir) + return_VALUE(-ENODEV); + } + + if (!acpi_device_dir(device)) { + acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), + acpi_power_dir); + if (!acpi_device_dir(device)) + return_VALUE(-ENODEV); + } + + /* 'status' [R] */ + entry = create_proc_entry(ACPI_POWER_FILE_STATUS, + S_IRUGO, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_POWER_FILE_STATUS)); + else { + entry->read_proc = acpi_power_read_status; + entry->data = acpi_driver_data(device); + } + + return_VALUE(0); +} + + +static int +acpi_power_remove_fs ( + struct acpi_device *device) +{ + ACPI_FUNCTION_TRACE("acpi_power_remove_fs"); + + if (!acpi_power_dir) + return_VALUE(-ENODEV); + + if (acpi_device_dir(device)) + remove_proc_entry(acpi_device_bid(device), acpi_power_dir); + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Driver Interface + -------------------------------------------------------------------------- */ + +int +acpi_power_add ( + struct acpi_device *device) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_power_resource *resource = NULL; + acpi_object acpi_object; + acpi_buffer buffer = {sizeof(acpi_object), &acpi_object}; + + ACPI_FUNCTION_TRACE("acpi_power_add"); + + if (!device) + return_VALUE(-EINVAL); + + resource = kmalloc(sizeof(struct acpi_power_resource), GFP_KERNEL); + if (!resource) + return_VALUE(-ENOMEM); + memset(resource, 0, sizeof(struct acpi_power_resource)); + + resource->handle = device->handle; + sprintf(resource->name, "%s", device->pnp.bus_id); + sprintf(acpi_device_name(device), "%s", ACPI_POWER_DEVICE_NAME); + sprintf(acpi_device_class(device), "%s", ACPI_POWER_CLASS); + acpi_driver_data(device) = resource; + + /* Evalute the object to get the system level and resource order. */ + status = acpi_evaluate_object(resource->handle, NULL, NULL, &buffer); + if (ACPI_FAILURE(status)) { + result = -ENODEV; + goto end; + } + resource->system_level = acpi_object.power_resource.system_level; + resource->order = acpi_object.power_resource.resource_order; + + result = acpi_power_get_state(resource); + if (0 != result) + goto end; + + switch (resource->state) { + case ACPI_POWER_RESOURCE_STATE_ON: + device->power.state = ACPI_STATE_D0; + break; + case ACPI_POWER_RESOURCE_STATE_OFF: + device->power.state = ACPI_STATE_D3; + break; + default: + device->power.state = ACPI_STATE_UNKNOWN; + break; + } + + result = acpi_power_add_fs(device); + if (0 != result) + goto end; + + printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device), + acpi_device_bid(device), resource->state?"on":"off"); + +end: + if (0 != result) + kfree(resource); + + return_VALUE(result); +} + + +int +acpi_power_remove ( + struct acpi_device *device, + int type) +{ + struct acpi_power_resource *resource = NULL; + + ACPI_FUNCTION_TRACE("acpi_power_remove"); + + if (!device || !acpi_driver_data(device)) + return_VALUE(-EINVAL); + + resource = (struct acpi_power_resource *) acpi_driver_data(device); + + acpi_power_remove_fs(device); + + kfree(resource); + + return_VALUE(0); +} + + +int __init +acpi_power_init (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_power_init"); + + INIT_LIST_HEAD(&acpi_power_resource_list); + + result = acpi_bus_register_driver(&acpi_power_driver); + if (0 > result) { + remove_proc_entry(ACPI_POWER_CLASS, acpi_root_dir); + return_VALUE(-ENODEV); + } + + return_VALUE(0); +} + + +void __exit +acpi_power_exit (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_power_exit"); + + /* TBD: Empty acpi_power_resource_list */ + + result = acpi_bus_unregister_driver(&acpi_power_driver); + if (0 == result) + remove_proc_entry(ACPI_POWER_CLASS, acpi_root_dir); + + return_VOID; +} diff -urN linux-2.4.18/drivers/acpi/processor.c lia64-2.4/drivers/acpi/processor.c --- linux-2.4.18/drivers/acpi/processor.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/processor.c Tue Jun 11 14:24:23 2002 @@ -0,0 +1,2324 @@ +/* + * acpi_processor.c - ACPI Processor Driver ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * TBD: + * 1. Make # power/performance states dynamic. + * 2. Support duty_cycle values that span bit 4. + * 3. Optimize by having scheduler determine business instead of + * having us try to calculate it here. + * 4. Need C1 timing -- must modify kernel (IRQ handler) to get this. + * 5. Convert time values to ticks (initially) to avoid having to do + * the math (acpi_get_timer_duration). + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "acpi_bus.h" +#include "acpi_drivers.h" + + +#define _COMPONENT ACPI_PROCESSOR_COMPONENT +ACPI_MODULE_NAME ("acpi_processor") + +MODULE_AUTHOR("Paul Diefenbaugh"); +MODULE_DESCRIPTION(ACPI_PROCESSOR_DRIVER_NAME); +MODULE_LICENSE("GPL"); + +#define PREFIX "ACPI: " + +#define US_TO_PM_TIMER_TICKS(t) ((t * PM_TIMER_FREQUENCY) / 1000000) +#define C2_OVERHEAD 4 /* 1us (3.579 ticks per us) */ +#define C3_OVERHEAD 4 /* 1us (3.579 ticks per us) */ + +#define ACPI_PROCESSOR_BUSY_METRIC 10 + +#define ACPI_PROCESSOR_MAX_POWER ACPI_C_STATE_COUNT +#define ACPI_PROCESSOR_MAX_C2_LATENCY 100 +#define ACPI_PROCESSOR_MAX_C3_LATENCY 1000 + +#define ACPI_PROCESSOR_MAX_PERFORMANCE 8 + +#define ACPI_PROCESSOR_MAX_THROTTLING 16 +#define ACPI_PROCESSOR_MAX_THROTTLE 250 /* 25% */ +#define ACPI_PROCESSOR_MAX_DUTY_WIDTH 4 + +const u32 POWER_OF_2[] = {1,2,4,8,16,32,64}; + +#define ACPI_PROCESSOR_LIMIT_USER 0 +#define ACPI_PROCESSOR_LIMIT_THERMAL 1 + +static int acpi_processor_add (struct acpi_device *device); +static int acpi_processor_remove (struct acpi_device *device, int type); + +static struct acpi_driver acpi_processor_driver = { + name: ACPI_PROCESSOR_DRIVER_NAME, + class: ACPI_PROCESSOR_CLASS, + ids: ACPI_PROCESSOR_HID, + ops: { + add: acpi_processor_add, + remove: acpi_processor_remove, + }, +}; + +/* Power Management */ + +struct acpi_processor_cx_policy { + u32 count; + int state; + struct { + u32 time; + u32 ticks; + u32 count; + u32 bm; + } threshold; +}; + +struct acpi_processor_cx { + u8 valid; + u32 address; + u32 latency; + u32 latency_ticks; + u32 power; + u32 usage; + struct acpi_processor_cx_policy promotion; + struct acpi_processor_cx_policy demotion; +}; + +struct acpi_processor_power { + int state; + int default_state; + u32 bm_activity; + struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; +}; + +/* Performance Management */ + +struct acpi_pct_register { + u8 descriptor; + u16 length; + u8 space_id; + u8 bit_width; + u8 bit_offset; + u8 reserved; + u64 address; +} __attribute__ ((packed)); + +struct acpi_processor_px { + acpi_integer core_frequency; /* megahertz */ + acpi_integer power; /* milliWatts */ + acpi_integer transition_latency; /* microseconds */ + acpi_integer bus_master_latency; /* microseconds */ + acpi_integer control; /* control value */ + acpi_integer status; /* success indicator */ +}; + +struct acpi_processor_performance { + int state; + int platform_limit; + u16 control_register; + u16 status_register; + int state_count; + struct acpi_processor_px states[ACPI_PROCESSOR_MAX_PERFORMANCE]; +}; + + +/* Throttling Control */ + +struct acpi_processor_tx { + u16 power; + u16 performance; +}; + +struct acpi_processor_throttling { + int state; + u32 address; + u8 duty_offset; + u8 duty_width; + int state_count; + struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING]; +}; + +/* Limit Interface */ + +struct acpi_processor_lx { + int px; /* performace state */ + int tx; /* throttle level */ +}; + +struct acpi_processor_limit { + struct acpi_processor_lx state; /* current limit */ + struct acpi_processor_lx thermal; /* thermal limit */ + struct acpi_processor_lx user; /* user limit */ +}; + + +struct acpi_processor_flags { + u8 power:1; + u8 performance:1; + u8 throttling:1; + u8 limit:1; + u8 bm_control:1; + u8 bm_check:1; + u8 reserved:2; +}; + +struct acpi_processor { + acpi_handle handle; + u32 acpi_id; + u32 id; + struct acpi_processor_flags flags; + struct acpi_processor_power power; + struct acpi_processor_performance performance; + struct acpi_processor_throttling throttling; + struct acpi_processor_limit limit; +}; + +struct acpi_processor_errata { + u8 smp; + struct { + u8 throttle:1; + u8 fdma:1; + u8 reserved:6; + u32 bmisx; + } piix4; +}; + +static struct acpi_processor *processors[NR_CPUS]; +static struct acpi_processor_errata errata; +static void (*pm_idle_save)(void) = NULL; + + +/* -------------------------------------------------------------------------- + Errata Handling + -------------------------------------------------------------------------- */ + +int +acpi_processor_errata_piix4 ( + struct pci_dev *dev) +{ + u8 rev = 0; + u8 value1 = 0; + u8 value2 = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_errata_piix4"); + + if (!dev) + return_VALUE(-EINVAL); + + /* + * Note that 'dev' references the PIIX4 ACPI Controller. + */ + + pci_read_config_byte(dev, PCI_REVISION_ID, &rev); + + switch (rev) { + case 0: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 A-step\n")); + break; + case 1: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 B-step\n")); + break; + case 2: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4E\n")); + break; + case 3: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4M\n")); + break; + default: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found unknown PIIX4\n")); + break; + } + + switch (rev) { + + case 0: /* PIIX4 A-step */ + case 1: /* PIIX4 B-step */ + /* + * See specification changes #13 ("Manual Throttle Duty Cycle") + * and #14 ("Enabling and Disabling Manual Throttle"), plus + * erratum #5 ("STPCLK# Deassertion Time") from the January + * 2002 PIIX4 specification update. Applies to only older + * PIIX4 models. + */ + errata.piix4.throttle = 1; + + case 2: /* PIIX4E */ + case 3: /* PIIX4M */ + /* + * See erratum #18 ("C3 Power State/BMIDE and Type-F DMA + * Livelock") from the January 2002 PIIX4 specification update. + * Applies to all PIIX4 models. + */ + + /* + * BM-IDE + * ------ + * Find the PIIX4 IDE Controller and get the Bus Master IDE + * Status register address. We'll use this later to read + * each IDE controller's DMA status to make sure we catch all + * DMA activity. + */ + dev = pci_find_subsys(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82371AB, + PCI_ANY_ID, PCI_ANY_ID, NULL); + if (dev) + errata.piix4.bmisx = pci_resource_start(dev, 4); + + /* + * Type-F DMA + * ---------- + * Find the PIIX4 ISA Controller and read the Motherboard + * DMA controller's status to see if Type-F (Fast) DMA mode + * is enabled (bit 7) on either channel. Note that we'll + * disable C3 support if this is enabled, as some legacy + * devices won't operate well if fast DMA is disabled. + */ + dev = pci_find_subsys(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82371AB_0, + PCI_ANY_ID, PCI_ANY_ID, NULL); + if (dev) { + pci_read_config_byte(dev, 0x76, &value1); + pci_read_config_byte(dev, 0x77, &value2); + if ((value1 & 0x80) || (value2 & 0x80)) + errata.piix4.fdma = 1; + } + + break; + } + + if (errata.piix4.bmisx) + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Bus master activity detection (BM-IDE) erratum enabled\n")); + if (errata.piix4.fdma) + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Type-F DMA livelock erratum (C3 disabled)\n")); + + return_VALUE(0); +} + + +int +acpi_processor_errata ( + struct acpi_processor *pr) +{ + int result = 0; + struct pci_dev *dev = NULL; + + ACPI_FUNCTION_TRACE("acpi_processor_errata"); + + if (!pr) + return_VALUE(-EINVAL); + + /* + * PIIX4 + */ + dev = pci_find_subsys(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82371AB_3, PCI_ANY_ID, PCI_ANY_ID, NULL); + if (dev) + result = acpi_processor_errata_piix4(dev); + + return_VALUE(result); +} + + +/* -------------------------------------------------------------------------- + Power Management + -------------------------------------------------------------------------- */ + +static inline u32 +ticks_elapsed ( + u32 t1, + u32 t2) +{ + if (t2 >= t1) + return (t2 - t1); + else if (!acpi_fadt.tmr_val_ext) + return (((0x00FFFFFF - t1) + t2) & 0x00FFFFFF); + else + return ((0xFFFFFFFF - t1) + t2); +} + + +static void +acpi_processor_power_activate ( + struct acpi_processor *pr, + int state) +{ + if (!pr) + return; + + pr->power.states[pr->power.state].promotion.count = 0; + pr->power.states[pr->power.state].demotion.count = 0; + + /* Cleanup from old state. */ + switch (pr->power.state) { + case ACPI_STATE_C3: + /* Disable bus master reload */ + acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0, ACPI_MTX_DO_NOT_LOCK); + break; + } + + /* Prepare to use new state. */ + switch (state) { + case ACPI_STATE_C3: + /* Enable bus master reload */ + acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 1, ACPI_MTX_DO_NOT_LOCK); + break; + } + + pr->power.state = state; + + return; +} + + +static void +acpi_processor_idle (void) +{ + struct acpi_processor *pr = NULL; + struct acpi_processor_cx *cx = NULL; + int next_state = 0; + int sleep_ticks = 0; + u32 t1, t2 = 0; + + pr = processors[smp_processor_id()]; + if (!pr) + return; + + /* + * Interrupts must be disabled during bus mastering calculations and + * for C2/C3 transitions. + */ + __cli(); + + cx = &(pr->power.states[pr->power.state]); + + /* + * Check BM Activity + * ----------------- + * Check for bus mastering activity (if required), record, and check + * for demotion. + */ + if (pr->flags.bm_check) { + u32 bm_status = 0; + + pr->power.bm_activity <<= 1; + + acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS, + &bm_status, ACPI_MTX_DO_NOT_LOCK); + if (bm_status) { + pr->power.bm_activity++; + acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS, + 1, ACPI_MTX_DO_NOT_LOCK); + } + /* + * PIIX4 Erratum #18: Note that BM_STS doesn't always reflect + * the true state of bus mastering activity; forcing us to + * manually check the BMIDEA bit of each IDE channel. + */ + else if (errata.piix4.bmisx) { + if ((inb_p(errata.piix4.bmisx + 0x02) & 0x01) + || (inb_p(errata.piix4.bmisx + 0x0A) & 0x01)) + pr->power.bm_activity++; + } + /* + * Apply bus mastering demotion policy. Automatically demote + * to avoid a faulty transition. Note that the processor + * won't enter a low-power state during this call (to this + * funciton) but should upon the next. + * + * TBD: A better policy might be to fallback to the demotion + * state (use it for this quantum only) istead of + * demoting -- and rely on duration as our sole demotion + * qualification. This may, however, introduce DMA + * issues (e.g. floppy DMA transfer overrun/underrun). + */ + if (pr->power.bm_activity & cx->demotion.threshold.bm) { + __sti(); + next_state = cx->demotion.state; + goto end; + } + } + + cx->usage++; + + /* + * Sleep: + * ------ + * Invoke the current Cx state to put the processor to sleep. + */ + switch (pr->power.state) { + + case ACPI_STATE_C1: + /* Invoke C1. */ + safe_halt(); + /* + * TBD: Can't get time duration while in C1, as resumes + * go to an ISR rather than here. Need to instrument + * base interrupt handler. + */ + sleep_ticks = 0xFFFFFFFF; + break; + + case ACPI_STATE_C2: + /* Get start time (ticks) */ + t1 = inl(acpi_fadt.Xpm_tmr_blk.address); + /* Invoke C2 */ + inb(pr->power.states[ACPI_STATE_C2].address); + /* Dummy op - must do something useless after P_LVL2 read */ + t2 = inl(acpi_fadt.Xpm_tmr_blk.address); + /* Get end time (ticks) */ + t2 = inl(acpi_fadt.Xpm_tmr_blk.address); + /* Re-enable interrupts */ + __sti(); + /* Compute time (ticks) that we were actually asleep */ + sleep_ticks = ticks_elapsed(t1, t2) - cx->latency_ticks - C2_OVERHEAD; + break; + + case ACPI_STATE_C3: + /* Disable bus master arbitration */ + acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_DO_NOT_LOCK); + /* Get start time (ticks) */ + t1 = inl(acpi_fadt.Xpm_tmr_blk.address); + /* Invoke C3 */ + inb(pr->power.states[ACPI_STATE_C3].address); + /* Dummy op - must do something useless after P_LVL3 read */ + t2 = inl(acpi_fadt.Xpm_tmr_blk.address); + /* Get end time (ticks) */ + t2 = inl(acpi_fadt.Xpm_tmr_blk.address); + /* Enable bus master arbitration */ + acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_DO_NOT_LOCK); + /* Re-enable interrupts */ + __sti(); + /* Compute time (ticks) that we were actually asleep */ + sleep_ticks = ticks_elapsed(t1, t2) - cx->latency_ticks - C3_OVERHEAD; + break; + + default: + __sti(); + return; + } + + next_state = pr->power.state; + + /* + * Promotion? + * ---------- + * Track the number of longs (time asleep is greater than threshold) + * and promote when the count threshold is reached. Note that bus + * mastering activity may prevent promotions. + */ + if (cx->promotion.state) { + if (sleep_ticks > cx->promotion.threshold.ticks) { + cx->promotion.count++; + cx->demotion.count = 0; + if (cx->promotion.count >= cx->promotion.threshold.count) { + if (pr->flags.bm_check) { + if (!(pr->power.bm_activity & cx->promotion.threshold.bm)) { + next_state = cx->promotion.state; + goto end; + } + } + else { + next_state = cx->promotion.state; + goto end; + } + } + } + } + + /* + * Demotion? + * --------- + * Track the number of shorts (time asleep is less than time threshold) + * and demote when the usage threshold is reached. + */ + if (cx->demotion.state) { + if (sleep_ticks < cx->demotion.threshold.ticks) { + cx->demotion.count++; + cx->promotion.count = 0; + if (cx->demotion.count >= cx->demotion.threshold.count) { + next_state = cx->demotion.state; + goto end; + } + } + } + +end: + /* + * New Cx State? + * ------------- + * If we're going to start using a new Cx state we must clean up + * from the previous and prepare to use the new. + */ + if (next_state != pr->power.state) + acpi_processor_power_activate(pr, next_state); + + return; +} + + +static int +acpi_processor_set_power_policy ( + struct acpi_processor *pr) +{ + ACPI_FUNCTION_TRACE("acpi_processor_set_power_policy"); + + /* + * This function sets the default Cx state policy (OS idle handler). + * Our scheme is to promote quickly to C2 but more conservatively + * to C3. We're favoring C2 for its characteristics of low latency + * (quick response), good power savings, and ability to allow bus + * mastering activity. Note that the Cx state policy is completely + * customizable and can be altered dynamically. + */ + + if (!pr) + return_VALUE(-EINVAL); + + /* + * C0/C1 + * ----- + */ + pr->power.state = ACPI_STATE_C1; + pr->power.default_state = ACPI_STATE_C1; + + /* + * C1/C2 + * ----- + * Set the default C1 promotion and C2 demotion policies, where we + * promote from C1 to C2 after several (10) successive C1 transitions, + * as we cannot (currently) measure the time spent in C1. Demote from + * C2 to C1 anytime we experience a 'short' (time spent in C2 is less + * than the C2 transtion latency). Note the simplifying assumption + * that the 'cost' of a transition is amortized when we sleep for at + * least as long as the transition's latency (thus the total transition + * time is two times the latency). + * + * TBD: Measure C1 sleep times by instrumenting the core IRQ handler. + * TBD: Demote to default C-State after long periods of activity. + * TBD: Investigate policy's use of CPU utilization -vs- sleep duration. + */ + if (pr->power.states[ACPI_STATE_C2].valid) { + pr->power.states[ACPI_STATE_C1].promotion.threshold.count = 10; + pr->power.states[ACPI_STATE_C1].promotion.threshold.ticks = + pr->power.states[ACPI_STATE_C2].latency_ticks; + pr->power.states[ACPI_STATE_C1].promotion.state = ACPI_STATE_C2; + + pr->power.states[ACPI_STATE_C2].demotion.threshold.count = 1; + pr->power.states[ACPI_STATE_C2].demotion.threshold.ticks = + pr->power.states[ACPI_STATE_C2].latency_ticks; + pr->power.states[ACPI_STATE_C2].demotion.state = ACPI_STATE_C1; + } + + /* + * C2/C3 + * ----- + * Set default C2 promotion and C3 demotion policies, where we promote + * from C2 to C3 after several (4) cycles of no bus mastering activity + * while maintaining sleep time criteria. Demote immediately on a + * short or whenever bus mastering activity occurs. + */ + if ((pr->power.states[ACPI_STATE_C2].valid) && + (pr->power.states[ACPI_STATE_C3].valid)) { + pr->power.states[ACPI_STATE_C2].promotion.threshold.count = 4; + pr->power.states[ACPI_STATE_C2].promotion.threshold.ticks = + pr->power.states[ACPI_STATE_C3].latency_ticks; + pr->power.states[ACPI_STATE_C2].promotion.threshold.bm = 0x0F; + pr->power.states[ACPI_STATE_C2].promotion.state = ACPI_STATE_C3; + + pr->power.states[ACPI_STATE_C3].demotion.threshold.count = 1; + pr->power.states[ACPI_STATE_C3].demotion.threshold.ticks = + pr->power.states[ACPI_STATE_C3].latency_ticks; + pr->power.states[ACPI_STATE_C3].demotion.threshold.bm = 0x0F; + pr->power.states[ACPI_STATE_C3].demotion.state = ACPI_STATE_C2; + } + + return_VALUE(0); +} + + +int +acpi_processor_get_power_info ( + struct acpi_processor *pr) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_get_power_info"); + + if (!pr) + return_VALUE(-EINVAL); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "lvl2[0x%08x] lvl3[0x%08x]\n", + pr->power.states[ACPI_STATE_C2].address, + pr->power.states[ACPI_STATE_C3].address)); + + /* TBD: Support ACPI 2.0 objects */ + + /* + * C0 + * -- + * This state exists only as filler in our array. + */ + pr->power.states[ACPI_STATE_C0].valid = 1; + + /* + * C1 + * -- + * ACPI requires C1 support for all processors. + * + * TBD: What about PROC_C1? + */ + pr->power.states[ACPI_STATE_C1].valid = 1; + + /* + * C2 + * -- + * We're (currently) only supporting C2 on UP systems. + * + * TBD: Support for C2 on MP (P_LVL2_UP). + */ + if (pr->power.states[ACPI_STATE_C2].address) { + + pr->power.states[ACPI_STATE_C2].latency = acpi_fadt.plvl2_lat; + + /* + * C2 latency must be less than or equal to 100 microseconds. + */ + if (acpi_fadt.plvl2_lat >= ACPI_PROCESSOR_MAX_C2_LATENCY) + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "C2 latency too large [%d]\n", + acpi_fadt.plvl2_lat)); + /* + * Only support C2 on UP systems (see TBD above). + */ + else if (errata.smp) + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "C2 not supported in SMP mode\n")); + /* + * Otherwise we've met all of our C2 requirements. + * Normalize the C2 latency to expidite policy. + */ + else { + pr->power.states[ACPI_STATE_C2].valid = 1; + pr->power.states[ACPI_STATE_C2].latency_ticks = + US_TO_PM_TIMER_TICKS(acpi_fadt.plvl2_lat); + } + } + + /* + * C3 + * -- + * TBD: Investigate use of WBINVD on UP/SMP system in absence of + * bm_control. + */ + if (pr->power.states[ACPI_STATE_C3].address) { + + pr->power.states[ACPI_STATE_C3].latency = acpi_fadt.plvl3_lat; + + /* + * C3 latency must be less than or equal to 1000 microseconds. + */ + if (acpi_fadt.plvl3_lat >= ACPI_PROCESSOR_MAX_C3_LATENCY) + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "C3 latency too large [%d]\n", + acpi_fadt.plvl3_lat)); + /* + * Only support C3 when bus mastering arbitration control + * is present (able to disable bus mastering to maintain + * cache coherency while in C3). + */ + else if (!pr->flags.bm_control) + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "C3 support requires bus mastering control\n")); + /* + * Only support C3 on UP systems, as bm_control is only viable + * on a UP system and flushing caches (e.g. WBINVD) is simply + * too costly (at this time). + */ + else if (errata.smp) + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "C3 not supported in SMP mode\n")); + /* + * PIIX4 Erratum #18: We don't support C3 when Type-F (fast) + * DMA transfers are used by any ISA device to avoid livelock. + * Note that we could disable Type-F DMA (as recommended by + * the erratum), but this is known to disrupt certain ISA + * devices thus we take the conservative approach. + */ + else if (errata.piix4.fdma) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "C3 not supported on PIIX4 with Type-F DMA\n")); + } + /* + * Otherwise we've met all of our C3 requirements. + * Normalize the C2 latency to expidite policy. Enable + * checking of bus mastering status (bm_check) so we can + * use this in our C3 policy. + */ + else { + pr->power.states[ACPI_STATE_C3].valid = 1; + pr->power.states[ACPI_STATE_C3].latency_ticks = + US_TO_PM_TIMER_TICKS(acpi_fadt.plvl3_lat); + pr->flags.bm_check = 1; + } + } + + /* + * Set Default Policy + * ------------------ + * Now that we know which state are supported, set the default + * policy. Note that this policy can be changed dynamically + * (e.g. encourage deeper sleeps to conserve battery life when + * not on AC). + */ + result = acpi_processor_set_power_policy(pr); + if (0 != result) + return_VALUE(result); + + /* + * If this processor supports C2 or C3 we denote it as being 'power + * manageable'. Note that there's really no policy involved for + * when only C1 is supported. + */ + if (pr->power.states[ACPI_STATE_C2].valid + || pr->power.states[ACPI_STATE_C3].valid) + pr->flags.power = 1; + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Performance Management + -------------------------------------------------------------------------- */ + +static int +acpi_processor_get_platform_limit ( + struct acpi_processor* pr) +{ + acpi_status status = 0; + unsigned long ppc = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_get_platform_limit"); + + if (!pr) + return_VALUE(-EINVAL); + + /* + * _PPC indicates the maximum state currently supported by the platform + * (e.g. 0 = states 0..n; 1 = states 1..n; etc. + */ + status = acpi_evaluate_integer(pr->handle, "_PPC", NULL, &ppc); + if(ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PPC\n")); + return_VALUE(-ENODEV); + } + + pr->performance.platform_limit = (int) ppc; + + return_VALUE(0); +} + + +static int +acpi_processor_get_performance_control ( + struct acpi_processor *pr) +{ + int result = 0; + acpi_status status = 0; + acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + acpi_object *pct = NULL; + acpi_object obj = {0}; + struct acpi_pct_register *reg = NULL; + + ACPI_FUNCTION_TRACE("acpi_processor_get_performance_control"); + + status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer); + if(ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PCT\n")); + return_VALUE(-ENODEV); + } + + pct = (acpi_object *) buffer.pointer; + if (!pct || (pct->type != ACPI_TYPE_PACKAGE) + || (pct->package.count != 2)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PCT data\n")); + result = -EFAULT; + goto end; + } + + /* + * control_register + */ + + obj = pct->package.elements[0]; + + if ((obj.type != ACPI_TYPE_BUFFER) + || (obj.buffer.length < sizeof(struct acpi_pct_register)) + || (obj.buffer.pointer == NULL)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid _PCT data (control_register)\n")); + result = -EFAULT; + goto end; + } + + reg = (struct acpi_pct_register *) (obj.buffer.pointer); + + if (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unsupported address space [%d] (control_register)\n", + (u32) reg->space_id)); + result = -EFAULT; + goto end; + } + + pr->performance.control_register = (u16) reg->address; + + /* + * status_register + */ + + obj = pct->package.elements[1]; + + if ((obj.type != ACPI_TYPE_BUFFER) + || (obj.buffer.length < sizeof(struct acpi_pct_register)) + || (obj.buffer.pointer == NULL)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid _PCT data (status_register)\n")); + result = -EFAULT; + goto end; + } + + reg = (struct acpi_pct_register *) (obj.buffer.pointer); + + if (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unsupported address space [%d] (status_register)\n", + (u32) reg->space_id)); + result = -EFAULT; + goto end; + } + + pr->performance.status_register = (u16) reg->address; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "control_register[0x%04x] status_register[0x%04x]\n", + pr->performance.control_register, + pr->performance.status_register)); + +end: + kfree(buffer.pointer); + + return_VALUE(result); +} + + +static int +acpi_processor_get_performance_states ( + struct acpi_processor* pr) +{ + int result = 0; + acpi_status status = AE_OK; + acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + acpi_buffer format = {sizeof("NNNNNN"), "NNNNNN"}; + acpi_buffer state = {0, NULL}; + acpi_object *pss = NULL; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_get_performance_states"); + + status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); + if(ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PSS\n")); + return_VALUE(-ENODEV); + } + + pss = (acpi_object *) buffer.pointer; + if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data\n")); + result = -EFAULT; + goto end; + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d performance states\n", + pss->package.count)); + + if (pss->package.count > ACPI_PROCESSOR_MAX_PERFORMANCE) { + pr->performance.state_count = ACPI_PROCESSOR_MAX_PERFORMANCE; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Limiting number of states to max (%d)\n", + ACPI_PROCESSOR_MAX_PERFORMANCE)); + } + else + pr->performance.state_count = pss->package.count; + + if (pr->performance.state_count > 1) + pr->flags.performance = 1; + + for (i = 0; i < pr->performance.state_count; i++) { + + struct acpi_processor_px *px = &(pr->performance.states[i]); + + state.length = sizeof(struct acpi_processor_px); + state.pointer = px; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Extracting state %d\n", i)); + + status = acpi_extract_package(&(pss->package.elements[i]), + &format, &state); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data\n")); + result = -EFAULT; + goto end; + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "State [%d]: core_frequency[%d] power[%d] transition_latency[%d] bus_master_latency[%d] control[0x%x] status[0x%x]\n", + i, + (u32) px->core_frequency, + (u32) px->power, + (u32) px->transition_latency, + (u32) px->bus_master_latency, + (u32) px->control, + (u32) px->status)); + } + +end: + kfree(buffer.pointer); + + return_VALUE(result); +} + + +static int +acpi_processor_set_performance ( + struct acpi_processor *pr, + int state) +{ + u16 port = 0; + u8 value = 0; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_set_performance"); + + if (!pr) + return_VALUE(-EINVAL); + + if (!pr->flags.performance) + return_VALUE(-ENODEV); + + if (state >= pr->performance.state_count) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Invalid target state (P%d)\n", state)); + return_VALUE(-ENODEV); + } + + if (state < pr->performance.platform_limit) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Platform limit (P%d) overrides target state (P%d)\n", + pr->performance.platform_limit, state)); + return_VALUE(-ENODEV); + } + + if (state == pr->performance.state) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Already at target state (P%d)\n", state)); + return_VALUE(0); + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Transitioning from P%d to P%d\n", + pr->performance.state, state)); + + /* + * First we write the target state's 'control' value to the + * control_register. + */ + + port = pr->performance.control_register; + value = (u16) pr->performance.states[state].control; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Writing 0x%02x to port 0x%04x\n", value, port)); + + outb(value, port); + + /* + * Then we read the 'status_register' and compare the value with the + * target state's 'status' to make sure the transition was successful. + * Note that we'll poll for up to 1ms (100 cycles of 10us) before + * giving up. + */ + + port = pr->performance.status_register; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Looking for 0x%02x from port 0x%04x\n", + (u8) pr->performance.states[state].status, port)); + + for (i=0; i<100; i++) { + value = inb(port); + if (value == (u8) pr->performance.states[state].status) + break; + udelay(10); + } + + if (value != pr->performance.states[state].status) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Transition failed\n")); + return_VALUE(-ENODEV); + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Transition successful after %d microseconds\n", + i * 10)); + + pr->performance.state = state; + + return_VALUE(0); +} + + +static int +acpi_processor_get_performance_info ( + struct acpi_processor *pr) +{ + int result = 0; + acpi_status status = AE_OK; + acpi_handle handle = NULL; + + ACPI_FUNCTION_TRACE("acpi_processor_get_performance_info"); + + if (!pr) + return_VALUE(-EINVAL); + + status = acpi_get_handle(pr->handle, "_PCT", &handle); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "ACPI-based processor performance control unavailable\n")); + return_VALUE(0); + } + + result = acpi_processor_get_performance_control(pr); + if (0 != result) + return_VALUE(result); + + result = acpi_processor_get_performance_states(pr); + if (0 != result) + return_VALUE(result); + + result = acpi_processor_get_platform_limit(pr); + if (0 != result) + return_VALUE(result); + + /* + * TBD: Don't trust the latency values we get from BIOS, but rather + * measure the latencies during run-time (e.g. get_latencies). + */ + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Throttling Control + -------------------------------------------------------------------------- */ + +static int +acpi_processor_get_throttling ( + struct acpi_processor *pr) +{ + int state = 0; + u32 value = 0; + u32 duty_mask = 0; + u32 duty_value = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_get_throttling"); + + if (!pr) + return_VALUE(-EINVAL); + + if (!pr->flags.throttling) + return_VALUE(-ENODEV); + + pr->throttling.state = 0; + + __cli(); + + duty_mask = pr->throttling.state_count - 1; + + duty_mask <<= pr->throttling.duty_offset; + + value = inl(pr->throttling.address); + + /* + * Compute the current throttling state when throttling is enabled + * (bit 4 is on). + */ + if (value & 0x10) { + duty_value = value & duty_mask; + duty_value >>= pr->throttling.duty_offset; + + if (duty_value) + state = pr->throttling.state_count-duty_value; + } + + pr->throttling.state = state; + + __sti(); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Throttling state is T%d (%d%% throttling applied)\n", + state, pr->throttling.states[state].performance)); + + return_VALUE(0); +} + + +static int +acpi_processor_set_throttling ( + struct acpi_processor *pr, + int state) +{ + u32 value = 0; + u32 duty_mask = 0; + u32 duty_value = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_set_throttling"); + + if (!pr) + return_VALUE(-EINVAL); + + if ((state < 0) || (state > (pr->throttling.state_count - 1))) + return_VALUE(-EINVAL); + + if (!pr->flags.throttling) + return_VALUE(-ENODEV); + + if (state == pr->throttling.state) + return_VALUE(0); + + __cli(); + + /* + * Calculate the duty_value and duty_mask. + */ + if (state) { + duty_value = pr->throttling.state_count - state; + + duty_value <<= pr->throttling.duty_offset; + + /* Used to clear all duty_value bits */ + duty_mask = pr->throttling.state_count - 1; + + duty_mask <<= acpi_fadt.duty_offset; + duty_mask = ~duty_mask; + } + + /* + * Disable throttling by writing a 0 to bit 4. Note that we must + * turn it off before you can change the duty_value. + */ + value = inl(pr->throttling.address); + if (value & 0x10) { + value &= 0xFFFFFFEF; + outl(value, pr->throttling.address); + } + + /* + * Write the new duty_value and then enable throttling. Note + * that a state value of 0 leaves throttling disabled. + */ + if (state) { + value &= duty_mask; + value |= duty_value; + outl(value, pr->throttling.address); + + value |= 0x00000010; + outl(value, pr->throttling.address); + } + + pr->throttling.state = state; + + __sti(); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Throttling state set to T%d (%d%%)\n", state, + (pr->throttling.states[state].performance?pr->throttling.states[state].performance/10:0))); + + return_VALUE(0); +} + + +static int +acpi_processor_get_throttling_info ( + struct acpi_processor *pr) +{ + int result = 0; + int step = 0; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_get_throttling_info"); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n", + pr->throttling.address, + pr->throttling.duty_offset, + pr->throttling.duty_width)); + + if (!pr) + return_VALUE(-EINVAL); + + /* TBD: Support ACPI 2.0 objects */ + + if (!pr->throttling.address) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n")); + return_VALUE(0); + } + else if (!pr->throttling.duty_width) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling states\n")); + return_VALUE(0); + } + /* TBD: Support duty_cycle values that span bit 4. */ + else if ((pr->throttling.duty_offset + + pr->throttling.duty_width) > 4) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "duty_cycle spans bit 4\n")); + return_VALUE(0); + } + + /* + * PIIX4 Errata: We don't support throttling on the original PIIX4. + * This shouldn't be an issue as few (if any) mobile systems ever + * used this part. + */ + if (errata.piix4.throttle) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Throttling not supported on PIIX4 A- or B-step\n")); + return_VALUE(0); + } + + pr->throttling.state_count = POWER_OF_2[acpi_fadt.duty_width]; + + /* + * Compute state values. Note that throttling displays a linear power/ + * performance relationship (at 50% performance the CPU will consume + * 50% power). Values are in 1/10th of a percent to preserve accuracy. + */ + + step = (1000 / pr->throttling.state_count); + + for (i=0; ithrottling.state_count; i++) { + pr->throttling.states[i].performance = step * i; + pr->throttling.states[i].power = step * i; + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d throttling states\n", + pr->throttling.state_count)); + + pr->flags.throttling = 1; + + /* + * Disable throttling (if enabled). We'll let subsequent policy (e.g. + * thermal) decide to lower performance if it so chooses, but for now + * we'll crank up the speed. + */ + + result = acpi_processor_get_throttling(pr); + if (0 != result) + goto end; + + if (pr->throttling.state) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabling throttling (was T%d)\n", + pr->throttling.state)); + result = acpi_processor_set_throttling(pr, 0); + if (0 != result) + goto end; + } + +end: + if (0 != result) + pr->flags.throttling = 0; + + return_VALUE(result); +} + + +/* -------------------------------------------------------------------------- + Limit Interface + -------------------------------------------------------------------------- */ + +static int +acpi_processor_apply_limit ( + struct acpi_processor* pr) +{ + int result = 0; + u16 px = 0; + u16 tx = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_apply_limit"); + + if (!pr) + return_VALUE(-EINVAL); + + if (!pr->flags.limit) + return_VALUE(-ENODEV); + + if (pr->flags.performance) { + px = pr->performance.platform_limit; + if (pr->limit.user.px > px) + px = pr->limit.user.px; + if (pr->limit.thermal.px > px) + px = pr->limit.thermal.px; + + result = acpi_processor_set_performance(pr, px); + if (0 != result) + goto end; + } + + if (pr->flags.throttling) { + if (pr->limit.user.tx > tx) + tx = pr->limit.user.tx; + if (pr->limit.thermal.tx > tx) + tx = pr->limit.thermal.tx; + + result = acpi_processor_set_throttling(pr, tx); + if (0 != result) + goto end; + } + + pr->limit.state.px = px; + pr->limit.state.tx = tx; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d] limit set to (P%d:T%d)\n", + pr->id, + pr->limit.state.px, + pr->limit.state.tx)); + +end: + if (0 != result) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to set limit\n")); + + return_VALUE(result); +} + + +int +acpi_processor_set_thermal_limit ( + acpi_handle handle, + int type) +{ + int result = 0; + struct acpi_processor *pr = NULL; + struct acpi_device *device = NULL; + int px = 0; + int tx = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_set_thermal_limit"); + + if ((type < ACPI_PROCESSOR_LIMIT_NONE) + || (type > ACPI_PROCESSOR_LIMIT_DECREMENT)) + return_VALUE(-EINVAL); + + result = acpi_bus_get_device(handle, &device); + if (0 != result) + return_VALUE(result); + + pr = (struct acpi_processor *) acpi_driver_data(device); + if (!pr) + return_VALUE(-ENODEV); + + if (!pr->flags.limit) + return_VALUE(-ENODEV); + + /* Thermal limits are always relative to the current Px/Tx state. */ + if (pr->flags.performance) + pr->limit.thermal.px = pr->performance.state; + if (pr->flags.throttling) + pr->limit.thermal.tx = pr->throttling.state; + + /* + * Our default policy is to only use throttling at the lowest + * performance state. + */ + + switch (type) { + + case ACPI_PROCESSOR_LIMIT_NONE: + px = 0; + tx = 0; + break; + + case ACPI_PROCESSOR_LIMIT_INCREMENT: + if (pr->flags.performance) { + if (px == (pr->performance.state_count - 1)) + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "At maximum performance state\n")); + else { + px++; + goto end; + } + } + if (pr->flags.throttling) { + if (tx == (pr->throttling.state_count - 1)) + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "At maximum throttling state\n")); + else + tx++; + } + break; + + case ACPI_PROCESSOR_LIMIT_DECREMENT: + if (pr->flags.performance) { + if (px == pr->performance.platform_limit) + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "At minimum performance state\n")); + else { + px--; + goto end; + } + } + if (pr->flags.throttling) { + if (tx == 0) + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "At minimum throttling state\n")); + else + tx--; + } + break; + } + +end: + pr->limit.thermal.px = px; + pr->limit.thermal.tx = tx; + + result = acpi_processor_apply_limit(pr); + if (0 != result) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to set thermal limit\n")); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Thermal limit now (P%d:T%d)\n", + pr->limit.thermal.px, + pr->limit.thermal.tx)); + + return_VALUE(result); +} + + +static int +acpi_processor_get_limit_info ( + struct acpi_processor *pr) +{ + ACPI_FUNCTION_TRACE("acpi_processor_get_limit_info"); + + if (!pr) + return_VALUE(-EINVAL); + + if (pr->flags.performance || pr->flags.throttling) + pr->flags.limit = 1; + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + FS Interface (/proc) + -------------------------------------------------------------------------- */ + +#include +#include + +struct proc_dir_entry *acpi_processor_dir = NULL; + +static int +acpi_processor_read_info ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_processor *pr = (struct acpi_processor *) data; + char *p = page; + int len = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_read_info"); + + if (!pr || (off != 0)) + goto end; + + p += sprintf(p, "processor id: %d\n", + pr->id); + + p += sprintf(p, "acpi id: %d\n", + pr->acpi_id); + + p += sprintf(p, "bus mastering control: %s\n", + pr->flags.bm_control ? "yes" : "no"); + + p += sprintf(p, "power management: %s\n", + pr->flags.power ? "yes" : "no"); + + p += sprintf(p, "throttling control: %s\n", + pr->flags.throttling ? "yes" : "no"); + + p += sprintf(p, "performance management: %s\n", + pr->flags.performance ? "yes" : "no"); + + p += sprintf(p, "limit interface: %s\n", + pr->flags.limit ? "yes" : "no"); + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_processor_read_power ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_processor *pr = (struct acpi_processor *) data; + char *p = page; + int len = 0; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_read_power"); + + if (!pr || (off != 0)) + goto end; + + p += sprintf(p, "active state: C%d\n", + pr->power.state); + + p += sprintf(p, "default state: C%d\n", + pr->power.default_state); + + p += sprintf(p, "bus master activity: %08x\n", + pr->power.bm_activity); + + p += sprintf(p, "states:\n"); + + for (i=1; ipower.state?'*':' '), i); + + if (!pr->power.states[i].valid) { + p += sprintf(p, "\n"); + continue; + } + + if (pr->power.states[i].promotion.state) + p += sprintf(p, "promotion[C%d] ", + pr->power.states[i].promotion.state); + else + p += sprintf(p, "promotion[--] "); + + if (pr->power.states[i].demotion.state) + p += sprintf(p, "demotion[C%d] ", + pr->power.states[i].demotion.state); + else + p += sprintf(p, "demotion[--] "); + + p += sprintf(p, "latency[%03d] usage[%08d]\n", + pr->power.states[i].latency, + pr->power.states[i].usage); + } + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_processor_read_performance ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_processor *pr = (struct acpi_processor *) data; + char *p = page; + int len = 0; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_read_performance"); + + if (!pr || (off != 0)) + goto end; + + if (!pr->flags.performance) { + p += sprintf(p, "\n"); + goto end; + } + + p += sprintf(p, "state count: %d\n", + pr->performance.state_count); + + p += sprintf(p, "active state: P%d\n", + pr->performance.state); + + p += sprintf(p, "states:\n"); + + for (i=0; iperformance.state_count; i++) + p += sprintf(p, " %cP%d: %d MHz, %d mW, %d uS\n", + (i == pr->performance.state?'*':' '), i, + (u32) pr->performance.states[i].core_frequency, + (u32) pr->performance.states[i].power, + (u32) pr->performance.states[i].transition_latency); + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_processor_write_performance ( + struct file *file, + const char *buffer, + unsigned long count, + void *data) +{ + int result = 0; + struct acpi_processor *pr = (struct acpi_processor *) data; + char state_string[12] = {'\0'}; + + ACPI_FUNCTION_TRACE("acpi_processor_write_performance"); + + if (!pr || (count > sizeof(state_string) - 1)) + return_VALUE(-EINVAL); + + if (copy_from_user(state_string, buffer, count)) + return_VALUE(-EFAULT); + + state_string[count] = '\0'; + + result = acpi_processor_set_performance(pr, + simple_strtoul(state_string, NULL, 0)); + if (0 != result) + return_VALUE(result); + + return_VALUE(count); +} + + +static int +acpi_processor_read_throttling ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_processor *pr = (struct acpi_processor *) data; + char *p = page; + int len = 0; + int i = 0; + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_read_throttling"); + + if (!pr || (off != 0)) + goto end; + + if (!(pr->throttling.state_count > 0)) { + p += sprintf(p, "\n"); + goto end; + } + + result = acpi_processor_get_throttling(pr); + + if (result) { + p += sprintf(p, "Could not determine current throttling state.\n"); + goto end; + } + + p += sprintf(p, "state count: %d\n", + pr->throttling.state_count); + + p += sprintf(p, "active state: T%d\n", + pr->throttling.state); + + p += sprintf(p, "states:\n"); + + for (i=0; ithrottling.state_count; i++) + p += sprintf(p, " %cT%d: %02d%%\n", + (i == pr->throttling.state?'*':' '), i, + (pr->throttling.states[i].performance?pr->throttling.states[i].performance/10:0)); + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_processor_write_throttling ( + struct file *file, + const char *buffer, + unsigned long count, + void *data) +{ + int result = 0; + struct acpi_processor *pr = (struct acpi_processor *) data; + char state_string[12] = {'\0'}; + + ACPI_FUNCTION_TRACE("acpi_processor_write_throttling"); + + if (!pr || (count > sizeof(state_string) - 1)) + return_VALUE(-EINVAL); + + if (copy_from_user(state_string, buffer, count)) + return_VALUE(-EFAULT); + + state_string[count] = '\0'; + + result = acpi_processor_set_throttling(pr, + simple_strtoul(state_string, NULL, 0)); + if (0 != result) + return_VALUE(result); + + return_VALUE(count); +} + + +static int +acpi_processor_read_limit ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_processor *pr = (struct acpi_processor *) data; + char *p = page; + int len = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_read_limit"); + + if (!pr || (off != 0)) + goto end; + + if (!pr->flags.limit) { + p += sprintf(p, "\n"); + goto end; + } + + p += sprintf(p, "active limit: P%d:T%d\n", + pr->limit.state.px, pr->limit.state.tx); + + p += sprintf(p, "platform limit: P%d:T0\n", + pr->flags.performance?pr->performance.platform_limit:0); + + p += sprintf(p, "user limit: P%d:T%d\n", + pr->limit.user.px, pr->limit.user.tx); + + p += sprintf(p, "thermal limit: P%d:T%d\n", + pr->limit.thermal.px, pr->limit.thermal.tx); + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_processor_write_limit ( + struct file *file, + const char *buffer, + unsigned long count, + void *data) +{ + int result = 0; + struct acpi_processor *pr = (struct acpi_processor *) data; + char limit_string[25] = {'\0'}; + int px = 0; + int tx = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_write_limit"); + + if (!pr || (count > sizeof(limit_string) - 1)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n")); + return_VALUE(-EINVAL); + } + + if (copy_from_user(limit_string, buffer, count)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data\n")); + return_VALUE(-EFAULT); + } + + limit_string[count] = '\0'; + + if (sscanf(limit_string, "%d:%d", &px, &tx) != 2) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n")); + return_VALUE(-EINVAL); + } + + if (pr->flags.performance) { + if ((px < pr->performance.platform_limit) + || (px > (pr->performance.state_count - 1))) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid px\n")); + return_VALUE(-EINVAL); + } + pr->limit.user.px = px; + } + + if (pr->flags.throttling) { + if ((tx < 0) || (tx > (pr->throttling.state_count - 1))) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid tx\n")); + return_VALUE(-EINVAL); + } + pr->limit.user.tx = tx; + } + + result = acpi_processor_apply_limit(pr); + + return_VALUE(count); +} + + +static int +acpi_processor_add_fs ( + struct acpi_device *device) +{ + struct proc_dir_entry *entry = NULL; + + ACPI_FUNCTION_TRACE("acpi_processor_add_fs"); + + if (!acpi_processor_dir) { + acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, + acpi_root_dir); + if (!acpi_processor_dir) + return_VALUE(-ENODEV); + } + + if (!acpi_device_dir(device)) { + acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), + acpi_processor_dir); + if (!acpi_device_dir(device)) + return_VALUE(-ENODEV); + } + + /* 'info' [R] */ + entry = create_proc_entry(ACPI_PROCESSOR_FILE_INFO, + S_IRUGO, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_PROCESSOR_FILE_INFO)); + else { + entry->read_proc = acpi_processor_read_info; + entry->data = acpi_driver_data(device); + } + + /* 'power' [R] */ + entry = create_proc_entry(ACPI_PROCESSOR_FILE_POWER, + S_IRUGO, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_PROCESSOR_FILE_POWER)); + else { + entry->read_proc = acpi_processor_read_power; + entry->data = acpi_driver_data(device); + } + + /* 'performance' [R/W] */ + entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE, + S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_PROCESSOR_FILE_PERFORMANCE)); + else { + entry->read_proc = acpi_processor_read_performance; + entry->write_proc = acpi_processor_write_performance; + entry->data = acpi_driver_data(device); + } + + /* 'throttling' [R/W] */ + entry = create_proc_entry(ACPI_PROCESSOR_FILE_THROTTLING, + S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_PROCESSOR_FILE_THROTTLING)); + else { + entry->read_proc = acpi_processor_read_throttling; + entry->write_proc = acpi_processor_write_throttling; + entry->data = acpi_driver_data(device); + } + + /* 'limit' [R/W] */ + entry = create_proc_entry(ACPI_PROCESSOR_FILE_LIMIT, + S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_PROCESSOR_FILE_LIMIT)); + else { + entry->read_proc = acpi_processor_read_limit; + entry->write_proc = acpi_processor_write_limit; + entry->data = acpi_driver_data(device); + } + + return_VALUE(0); +} + + +static int +acpi_processor_remove_fs ( + struct acpi_device *device) +{ + ACPI_FUNCTION_TRACE("acpi_processor_remove_fs"); + + if (!acpi_processor_dir) + return_VALUE(-ENODEV); + + if (acpi_device_dir(device)) + remove_proc_entry(acpi_device_bid(device), acpi_processor_dir); + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Driver Interface + -------------------------------------------------------------------------- */ + +static int +acpi_processor_get_info ( + struct acpi_processor *pr) +{ + acpi_status status = 0; + acpi_object object = {0}; + acpi_buffer buffer = {sizeof(acpi_object), &object}; + static int cpu_count = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_get_info"); + + if (!pr) + return_VALUE(-EINVAL); + +#ifdef CONFIG_SMP + if (smp_num_cpus > 1) + errata.smp = smp_num_cpus; +#endif + + acpi_processor_errata(pr); + + /* + * Check to see if we have bus mastering arbitration control. This + * is required for proper C3 usage (to maintain cache coherency). + */ + if (acpi_fadt.V1_pm2_cnt_blk && acpi_fadt.pm2_cnt_len) { + pr->flags.bm_control = 1; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Bus mastering arbitration control present\n")); + } + else + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "No bus mastering arbitration control\n")); + + /* + * Evalute the processor object. Note that it is common on SMP to + * have the first (boot) processor with a valid PBLK address while + * all others have a NULL address. + */ + status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error evaluating processor object\n")); + return_VALUE(-ENODEV); + } + + /* + * TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP. + * >>> 'acpi_get_processor_id(acpi_id, &id)' in arch/xxx/acpi.c + */ + pr->id = cpu_count++; + pr->acpi_id = object.processor.proc_id; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d:%d]\n", pr->id, + pr->acpi_id)); + + if (!object.processor.pblk_address) + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n")); + else if (object.processor.pblk_length < 6) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid PBLK length [%d]\n", + object.processor.pblk_length)); + else { + pr->throttling.address = object.processor.pblk_address; + pr->throttling.duty_offset = acpi_fadt.duty_offset; + pr->throttling.duty_width = acpi_fadt.duty_width; + pr->power.states[ACPI_STATE_C2].address = + object.processor.pblk_address + 4; + pr->power.states[ACPI_STATE_C3].address = + object.processor.pblk_address + 5; + } + + acpi_processor_get_power_info(pr); + acpi_processor_get_performance_info(pr); + acpi_processor_get_throttling_info(pr); + acpi_processor_get_limit_info(pr); + + return_VALUE(0); +} + + +static void +acpi_processor_notify ( + acpi_handle handle, + u32 event, + void *data) +{ + int result = 0; + struct acpi_processor *pr = (struct acpi_processor *) data; + struct acpi_device *device = NULL; + + ACPI_FUNCTION_TRACE("acpi_processor_notify"); + + if (!pr) + return_VOID; + + if (0 != acpi_bus_get_device(pr->handle, &device)) + return_VOID; + + switch (event) { + case ACPI_PROCESSOR_NOTIFY_PERFORMANCE: + result = acpi_processor_get_platform_limit(pr); + if (0 == result) + acpi_processor_apply_limit(pr); + + acpi_bus_generate_event(device, event, + pr->performance.platform_limit); + break; + case ACPI_PROCESSOR_NOTIFY_POWER: + /* TBD */ + acpi_bus_generate_event(device, event, 0); + break; + default: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Unsupported event [0x%x]\n", event)); + break; + } + + return_VOID; +} + + +static int +acpi_processor_add ( + struct acpi_device *device) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_processor *pr = NULL; + u32 i = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_add"); + + if (!device) + return_VALUE(-EINVAL); + + pr = kmalloc(sizeof(struct acpi_processor), GFP_KERNEL); + if (!pr) + return_VALUE(-ENOMEM); + memset(pr, 0, sizeof(struct acpi_processor)); + + pr->handle = device->handle; + sprintf(acpi_device_name(device), "%s", ACPI_PROCESSOR_DEVICE_NAME); + sprintf(acpi_device_class(device), "%s", ACPI_PROCESSOR_CLASS); + acpi_driver_data(device) = pr; + + result = acpi_processor_get_info(pr); + if (0 != result) + goto end; + + result = acpi_processor_add_fs(device); + if (0 != result) + goto end; + + status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY, + acpi_processor_notify, pr); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error installing notify handler\n")); + result = -ENODEV; + goto end; + } + + processors[pr->id] = pr; + + /* + * Install the idle handler if processor power management is supported. + * Note that the default idle handler (default_idle) will be used on + * platforms that only support C1. + */ + if ((pr->id == 0) && (pr->flags.power)) { + pm_idle_save = pm_idle; + pm_idle = acpi_processor_idle; + } + + printk(KERN_INFO PREFIX "%s [%s] (supports", + acpi_device_name(device), acpi_device_bid(device)); + for (i=1; ipower.states[i].valid) + printk(" C%d", i); + if (pr->flags.performance) + printk(", %d performance states", pr->performance.state_count); + if (pr->flags.throttling) + printk(", %d throttling states", pr->throttling.state_count); + printk(")\n"); + +end: + if (0 != result) { + acpi_processor_remove_fs(device); + kfree(pr); + } + + return_VALUE(result); +} + + +static int +acpi_processor_remove ( + struct acpi_device *device, + int type) +{ + acpi_status status = AE_OK; + struct acpi_processor *pr = NULL; + + ACPI_FUNCTION_TRACE("acpi_processor_remove"); + + if (!device || !acpi_driver_data(device)) + return_VALUE(-EINVAL); + + pr = (struct acpi_processor *) acpi_driver_data(device); + + /* Unregister the idle handler when processor #0 is removed. */ + if (pr->id == 0) + pm_idle = pm_idle_save; + + status = acpi_remove_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY, + acpi_processor_notify); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); + return_VALUE(-ENODEV); + } + + acpi_processor_remove_fs(device); + + processors[pr->id] = NULL; + + kfree(pr); + + return_VALUE(0); +} + + +static int __init +acpi_processor_init (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_init"); + + memset(&processors, 0, sizeof(processors)); + memset(&errata, 0, sizeof(errata)); + + result = acpi_bus_register_driver(&acpi_processor_driver); + if (0 > result) + return_VALUE(-ENODEV); + + return_VALUE(0); +} + + +static void __exit +acpi_processor_exit (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_exit"); + + result = acpi_bus_unregister_driver(&acpi_processor_driver); + if (0 == result) + remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); + + return_VOID; +} + + +module_init(acpi_processor_init); +module_exit(acpi_processor_exit); diff -urN linux-2.4.18/drivers/acpi/resources/Makefile lia64-2.4/drivers/acpi/resources/Makefile --- linux-2.4.18/drivers/acpi/resources/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/resources/Makefile Tue Apr 9 15:47:00 2002 @@ -1,11 +1,10 @@ # # Makefile for all Linux ACPI interpreter subdirectories -# EXCEPT for the ospm directory # O_TARGET := $(notdir $(CURDIR)).o -obj-$(CONFIG_ACPI) := $(patsubst %.c,%.o,$(wildcard *.c)) +obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c)) EXTRA_CFLAGS += $(ACPI_CFLAGS) diff -urN linux-2.4.18/drivers/acpi/resources/rsaddr.c lia64-2.4/drivers/acpi/resources/rsaddr.c --- linux-2.4.18/drivers/acpi/resources/rsaddr.c Mon Sep 24 15:06:46 2001 +++ lia64-2.4/drivers/acpi/resources/rsaddr.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: rsaddr - Address resource descriptors (16/32/64) - * $Revision: 19 $ + * $Revision: 26 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #include "acresrc.h" #define _COMPONENT ACPI_RESOURCES - MODULE_NAME ("rsaddr") + ACPI_MODULE_NAME ("rsaddr") /******************************************************************************* @@ -37,13 +37,12 @@ * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -56,26 +55,26 @@ acpi_status acpi_rs_address16_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { u8 *buffer = byte_stream_buffer; - acpi_resource *output_struct = (acpi_resource *) *output_buffer; - NATIVE_CHAR *temp_ptr; - u32 struct_size = SIZEOF_RESOURCE (acpi_resource_address16); + acpi_resource *output_struct = (void *) *output_buffer; + u8 *temp_ptr; + ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_address16); u32 index; u16 temp16; u8 temp8; - FUNCTION_TRACE ("Rs_address16_resource"); + ACPI_FUNCTION_TRACE ("Rs_address16_resource"); /* * Point past the Descriptor to get the number of bytes consumed */ buffer += 1; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); *bytes_consumed = temp16 + 3; output_struct->id = ACPI_RSTYPE_ADDRESS16; @@ -87,6 +86,7 @@ temp8 = *buffer; /* Values 0-2 are valid */ + if (temp8 > 2) { return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); } @@ -99,24 +99,20 @@ buffer += 1; temp8 = *buffer; - /* - * Producer / Consumer - */ + /* Producer / Consumer */ + output_struct->data.address16.producer_consumer = temp8 & 0x01; - /* - * Decode - */ + /* Decode */ + output_struct->data.address16.decode = (temp8 >> 1) & 0x01; - /* - * Min Address Fixed - */ + /* Min Address Fixed */ + output_struct->data.address16.min_address_fixed = (temp8 >> 2) & 0x01; - /* - * Max Address Fixed - */ + /* Max Address Fixed */ + output_struct->data.address16.max_address_fixed = (temp8 >> 3) & 0x01; /* @@ -125,19 +121,17 @@ buffer += 1; temp8 = *buffer; - if (MEMORY_RANGE == output_struct->data.address16.resource_type) { + if (ACPI_MEMORY_RANGE == output_struct->data.address16.resource_type) { output_struct->data.address16.attribute.memory.read_write_attribute = (u16) (temp8 & 0x01); output_struct->data.address16.attribute.memory.cache_attribute = (u16) ((temp8 >> 1) & 0x0F); } - else { - if (IO_RANGE == output_struct->data.address16.resource_type) { + if (ACPI_IO_RANGE == output_struct->data.address16.resource_type) { output_struct->data.address16.attribute.io.range_attribute = (u16) (temp8 & 0x03); } - else { /* BUS_NUMBER_RANGE == Address16.Data->Resource_type */ /* Nothing needs to be filled in */ @@ -148,35 +142,35 @@ * Get Granularity (Bytes 6-7) */ buffer += 1; - MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.granularity, + ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.granularity, buffer); /* * Get Min_address_range (Bytes 8-9) */ buffer += 2; - MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.min_address_range, + ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.min_address_range, buffer); /* * Get Max_address_range (Bytes 10-11) */ buffer += 2; - MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.max_address_range, + ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.max_address_range, buffer); /* * Get Address_translation_offset (Bytes 12-13) */ buffer += 2; - MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.address_translation_offset, + ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.address_translation_offset, buffer); /* * Get Address_length (Bytes 14-15) */ buffer += 2; - MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.address_length, + ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.address_length, buffer); /* @@ -206,7 +200,7 @@ output_struct->data.address16.resource_source.string_ptr = (NATIVE_CHAR *)((u8 * )output_struct + struct_size); - temp_ptr = output_struct->data.address16.resource_source.string_ptr; + temp_ptr = (u8 *) output_struct->data.address16.resource_source.string_ptr; /* Copy the string into the buffer */ @@ -233,9 +227,8 @@ * Struct_size to the next 32-bit boundary. */ temp8 = (u8) (index + 1); - struct_size += ROUND_UP_TO_32_bITS (temp8); + struct_size += ACPI_ROUND_UP_TO_32_bITS (temp8); } - else { output_struct->data.address16.resource_source.index = 0x00; output_struct->data.address16.resource_source.string_length = 0; @@ -245,7 +238,7 @@ /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -261,9 +254,8 @@ * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -276,16 +268,16 @@ acpi_rs_address16_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer = *output_buffer; u8 *length_field; u8 temp8; NATIVE_CHAR *temp_pointer = NULL; - u32 actual_bytes; + ACPI_SIZE actual_bytes; - FUNCTION_TRACE ("Rs_address16_stream"); + ACPI_FUNCTION_TRACE ("Rs_address16_stream"); /* @@ -324,7 +316,7 @@ */ temp8 = 0; - if (MEMORY_RANGE == linked_list->data.address16.resource_type) { + if (ACPI_MEMORY_RANGE == linked_list->data.address16.resource_type) { temp8 = (u8) (linked_list->data.address16.attribute.memory.read_write_attribute & 0x01); @@ -333,8 +325,7 @@ (linked_list->data.address16.attribute.memory.cache_attribute & 0x0F) << 1; } - - else if (IO_RANGE == linked_list->data.address16.resource_type) { + else if (ACPI_IO_RANGE == linked_list->data.address16.resource_type) { temp8 = (u8) (linked_list->data.address16.attribute.io.range_attribute & 0x03); @@ -346,35 +337,35 @@ /* * Set the address space granularity */ - MOVE_UNALIGNED16_TO_16 (buffer, + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.address16.granularity); buffer += 2; /* * Set the address range minimum */ - MOVE_UNALIGNED16_TO_16 (buffer, + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.address16.min_address_range); buffer += 2; /* * Set the address range maximum */ - MOVE_UNALIGNED16_TO_16 (buffer, + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.address16.max_address_range); buffer += 2; /* * Set the address translation offset */ - MOVE_UNALIGNED16_TO_16 (buffer, + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.address16.address_translation_offset); buffer += 2; /* * Set the address length */ - MOVE_UNALIGNED16_TO_16 (buffer, + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.address16.address_length); buffer += 2; @@ -392,21 +383,20 @@ /* * Copy the string */ - STRCPY (temp_pointer, + ACPI_STRCPY (temp_pointer, linked_list->data.address16.resource_source.string_ptr); /* * Buffer needs to be set to the length of the sting + one for the * terminating null */ - buffer += (STRLEN (linked_list->data.address16.resource_source.string_ptr) - + 1); + buffer += (ACPI_STRLEN (linked_list->data.address16.resource_source.string_ptr) + 1); } /* * Return the number of bytes consumed in this operation */ - actual_bytes = POINTER_DIFF (buffer, *output_buffer); + actual_bytes = ACPI_PTR_DIFF (buffer, *output_buffer); *bytes_consumed = actual_bytes; /* @@ -414,7 +404,7 @@ * minus the header size (3 bytes) */ actual_bytes -= 3; - MOVE_UNALIGNED16_TO_16 (length_field, &actual_bytes); + ACPI_MOVE_UNALIGNED16_TO_16 (length_field, &actual_bytes); return_ACPI_STATUS (AE_OK); } @@ -425,13 +415,12 @@ * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -444,33 +433,30 @@ acpi_status acpi_rs_address32_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { u8 *buffer; - acpi_resource *output_struct; + acpi_resource *output_struct= (void *) *output_buffer; u16 temp16; u8 temp8; - NATIVE_CHAR *temp_ptr; - u32 struct_size; + u8 *temp_ptr; + ACPI_SIZE struct_size; u32 index; - FUNCTION_TRACE ("Rs_address32_resource"); + ACPI_FUNCTION_TRACE ("Rs_address32_resource"); buffer = byte_stream_buffer; - output_struct = (acpi_resource *) *output_buffer; - - struct_size = SIZEOF_RESOURCE (acpi_resource_address32); + struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_address32); /* * Point past the Descriptor to get the number of bytes consumed */ buffer += 1; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); - + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); *bytes_consumed = temp16 + 3; output_struct->id = ACPI_RSTYPE_ADDRESS32; @@ -520,20 +506,18 @@ buffer += 1; temp8 = *buffer; - if (MEMORY_RANGE == output_struct->data.address32.resource_type) { + if (ACPI_MEMORY_RANGE == output_struct->data.address32.resource_type) { output_struct->data.address32.attribute.memory.read_write_attribute = (u16) (temp8 & 0x01); output_struct->data.address32.attribute.memory.cache_attribute = (u16) ((temp8 >> 1) & 0x0F); } - else { - if (IO_RANGE == output_struct->data.address32.resource_type) { + if (ACPI_IO_RANGE == output_struct->data.address32.resource_type) { output_struct->data.address32.attribute.io.range_attribute = (u16) (temp8 & 0x03); } - else { /* BUS_NUMBER_RANGE == Output_struct->Data.Address32.Resource_type */ /* Nothing needs to be filled in */ @@ -544,35 +528,35 @@ * Get Granularity (Bytes 6-9) */ buffer += 1; - MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.granularity, + ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.granularity, buffer); /* * Get Min_address_range (Bytes 10-13) */ buffer += 4; - MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.min_address_range, + ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.min_address_range, buffer); /* * Get Max_address_range (Bytes 14-17) */ buffer += 4; - MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.max_address_range, + ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.max_address_range, buffer); /* * Get Address_translation_offset (Bytes 18-21) */ buffer += 4; - MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.address_translation_offset, + ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.address_translation_offset, buffer); /* * Get Address_length (Bytes 22-25) */ buffer += 4; - MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.address_length, + ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.address_length, buffer); /* @@ -601,12 +585,11 @@ output_struct->data.address32.resource_source.string_ptr = (NATIVE_CHAR *)((u8 *)output_struct + struct_size); - temp_ptr = output_struct->data.address32.resource_source.string_ptr; + temp_ptr = (u8 *) output_struct->data.address32.resource_source.string_ptr; /* Copy the string into the buffer */ index = 0; - while (0x00 != *buffer) { *temp_ptr = *buffer; @@ -627,9 +610,8 @@ * Struct_size to the next 32-bit boundary. */ temp8 = (u8) (index + 1); - struct_size += ROUND_UP_TO_32_bITS (temp8); + struct_size += ACPI_ROUND_UP_TO_32_bITS (temp8); } - else { output_struct->data.address32.resource_source.index = 0x00; output_struct->data.address32.resource_source.string_length = 0; @@ -639,7 +621,7 @@ /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -655,9 +637,8 @@ * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -670,7 +651,7 @@ acpi_rs_address32_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer; u16 *length_field; @@ -678,7 +659,7 @@ NATIVE_CHAR *temp_pointer; - FUNCTION_TRACE ("Rs_address32_stream"); + ACPI_FUNCTION_TRACE ("Rs_address32_stream"); buffer = *output_buffer; @@ -692,8 +673,7 @@ /* * Set a pointer to the Length field - to be filled in later */ - - length_field = (u16 *) buffer; + length_field = ACPI_CAST_PTR (u16, buffer); buffer += 2; /* @@ -720,7 +700,7 @@ */ temp8 = 0; - if(MEMORY_RANGE == linked_list->data.address32.resource_type) { + if (ACPI_MEMORY_RANGE == linked_list->data.address32.resource_type) { temp8 = (u8) (linked_list->data.address32.attribute.memory.read_write_attribute & 0x01); @@ -729,8 +709,7 @@ (linked_list->data.address32.attribute.memory.cache_attribute & 0x0F) << 1; } - - else if (IO_RANGE == linked_list->data.address32.resource_type) { + else if (ACPI_IO_RANGE == linked_list->data.address32.resource_type) { temp8 = (u8) (linked_list->data.address32.attribute.io.range_attribute & 0x03); @@ -742,35 +721,35 @@ /* * Set the address space granularity */ - MOVE_UNALIGNED32_TO_32 (buffer, + ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.address32.granularity); buffer += 4; /* * Set the address range minimum */ - MOVE_UNALIGNED32_TO_32 (buffer, + ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.address32.min_address_range); buffer += 4; /* * Set the address range maximum */ - MOVE_UNALIGNED32_TO_32 (buffer, + ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.address32.max_address_range); buffer += 4; /* * Set the address translation offset */ - MOVE_UNALIGNED32_TO_32 (buffer, + ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.address32.address_translation_offset); buffer += 4; /* * Set the address length */ - MOVE_UNALIGNED32_TO_32 (buffer, + ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.address32.address_length); buffer += 4; @@ -788,20 +767,20 @@ /* * Copy the string */ - STRCPY (temp_pointer, + ACPI_STRCPY (temp_pointer, linked_list->data.address32.resource_source.string_ptr); /* * Buffer needs to be set to the length of the sting + one for the * terminating null */ - buffer += (STRLEN (linked_list->data.address32.resource_source.string_ptr) + 1); + buffer += (ACPI_STRLEN (linked_list->data.address32.resource_source.string_ptr) + 1); } /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); /* * Set the length field to the number of bytes consumed @@ -818,13 +797,12 @@ * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -837,32 +815,30 @@ acpi_status acpi_rs_address64_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { u8 *buffer; - acpi_resource *output_struct; + acpi_resource *output_struct = (void *) *output_buffer; u16 temp16; u8 temp8; - NATIVE_CHAR *temp_ptr; - u32 struct_size; + u8 *temp_ptr; + ACPI_SIZE struct_size; u32 index; - FUNCTION_TRACE ("Rs_address64_resource"); + ACPI_FUNCTION_TRACE ("Rs_address64_resource"); buffer = byte_stream_buffer; - output_struct = (acpi_resource *) *output_buffer; - - struct_size = SIZEOF_RESOURCE (acpi_resource_address64); + struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_address64); /* * Point past the Descriptor to get the number of bytes consumed */ buffer += 1; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); *bytes_consumed = temp16 + 3; output_struct->id = ACPI_RSTYPE_ADDRESS64; @@ -874,6 +850,7 @@ temp8 = *buffer; /* Values 0-2 are valid */ + if(temp8 > 2) { return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); } @@ -912,20 +889,18 @@ buffer += 1; temp8 = *buffer; - if (MEMORY_RANGE == output_struct->data.address64.resource_type) { + if (ACPI_MEMORY_RANGE == output_struct->data.address64.resource_type) { output_struct->data.address64.attribute.memory.read_write_attribute = (u16) (temp8 & 0x01); output_struct->data.address64.attribute.memory.cache_attribute = (u16) ((temp8 >> 1) & 0x0F); } - else { - if (IO_RANGE == output_struct->data.address64.resource_type) { + if (ACPI_IO_RANGE == output_struct->data.address64.resource_type) { output_struct->data.address64.attribute.io.range_attribute = (u16) (temp8 & 0x03); } - else { /* BUS_NUMBER_RANGE == Output_struct->Data.Address64.Resource_type */ /* Nothing needs to be filled in */ @@ -936,35 +911,35 @@ * Get Granularity (Bytes 6-13) */ buffer += 1; - MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.granularity, + ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.granularity, buffer); /* * Get Min_address_range (Bytes 14-21) */ buffer += 8; - MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.min_address_range, + ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.min_address_range, buffer); /* * Get Max_address_range (Bytes 22-29) */ buffer += 8; - MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.max_address_range, + ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.max_address_range, buffer); /* * Get Address_translation_offset (Bytes 30-37) */ buffer += 8; - MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.address_translation_offset, + ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.address_translation_offset, buffer); /* * Get Address_length (Bytes 38-45) */ buffer += 8; - MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.address_length, + ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.address_length, buffer); /* @@ -995,12 +970,11 @@ output_struct->data.address64.resource_source.string_ptr = (NATIVE_CHAR *)((u8 *)output_struct + struct_size); - temp_ptr = output_struct->data.address64.resource_source.string_ptr; + temp_ptr = (u8 *) output_struct->data.address64.resource_source.string_ptr; /* Copy the string into the buffer */ index = 0; - while (0x00 != *buffer) { *temp_ptr = *buffer; @@ -1022,9 +996,8 @@ * Struct_size to the next 32-bit boundary. */ temp8 = (u8) (index + 1); - struct_size += ROUND_UP_TO_32_bITS (temp8); + struct_size += ACPI_ROUND_UP_TO_32_bITS (temp8); } - else { output_struct->data.address64.resource_source.index = 0x00; output_struct->data.address64.resource_source.string_length = 0; @@ -1034,7 +1007,7 @@ /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -1050,9 +1023,8 @@ * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -1065,7 +1037,7 @@ acpi_rs_address64_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer; u16 *length_field; @@ -1073,7 +1045,7 @@ NATIVE_CHAR *temp_pointer; - FUNCTION_TRACE ("Rs_address64_stream"); + ACPI_FUNCTION_TRACE ("Rs_address64_stream"); buffer = *output_buffer; @@ -1088,7 +1060,7 @@ * Set a pointer to the Length field - to be filled in later */ - length_field = (u16 *)buffer; + length_field = ACPI_CAST_PTR (u16, buffer); buffer += 2; /* @@ -1115,7 +1087,7 @@ */ temp8 = 0; - if(MEMORY_RANGE == linked_list->data.address64.resource_type) { + if (ACPI_MEMORY_RANGE == linked_list->data.address64.resource_type) { temp8 = (u8) (linked_list->data.address64.attribute.memory.read_write_attribute & 0x01); @@ -1124,8 +1096,7 @@ (linked_list->data.address64.attribute.memory.cache_attribute & 0x0F) << 1; } - - else if (IO_RANGE == linked_list->data.address64.resource_type) { + else if (ACPI_IO_RANGE == linked_list->data.address64.resource_type) { temp8 = (u8) (linked_list->data.address64.attribute.io.range_attribute & 0x03); @@ -1137,35 +1108,35 @@ /* * Set the address space granularity */ - MOVE_UNALIGNED64_TO_64 (buffer, + ACPI_MOVE_UNALIGNED64_TO_64 (buffer, &linked_list->data.address64.granularity); buffer += 8; /* * Set the address range minimum */ - MOVE_UNALIGNED64_TO_64 (buffer, + ACPI_MOVE_UNALIGNED64_TO_64 (buffer, &linked_list->data.address64.min_address_range); buffer += 8; /* * Set the address range maximum */ - MOVE_UNALIGNED64_TO_64 (buffer, + ACPI_MOVE_UNALIGNED64_TO_64 (buffer, &linked_list->data.address64.max_address_range); buffer += 8; /* * Set the address translation offset */ - MOVE_UNALIGNED64_TO_64 (buffer, + ACPI_MOVE_UNALIGNED64_TO_64 (buffer, &linked_list->data.address64.address_translation_offset); buffer += 8; /* * Set the address length */ - MOVE_UNALIGNED64_TO_64 (buffer, + ACPI_MOVE_UNALIGNED64_TO_64 (buffer, &linked_list->data.address64.address_length); buffer += 8; @@ -1183,19 +1154,19 @@ /* * Copy the string */ - STRCPY (temp_pointer, linked_list->data.address64.resource_source.string_ptr); + ACPI_STRCPY (temp_pointer, linked_list->data.address64.resource_source.string_ptr); /* * Buffer needs to be set to the length of the sting + one for the * terminating null */ - buffer += (STRLEN (linked_list->data.address64.resource_source.string_ptr) + 1); + buffer += (ACPI_STRLEN (linked_list->data.address64.resource_source.string_ptr) + 1); } /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); /* * Set the length field to the number of bytes consumed diff -urN linux-2.4.18/drivers/acpi/resources/rscalc.c lia64-2.4/drivers/acpi/resources/rscalc.c --- linux-2.4.18/drivers/acpi/resources/rscalc.c Mon Sep 24 15:06:46 2001 +++ lia64-2.4/drivers/acpi/resources/rscalc.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: rscalc - Calculate stream and list lengths - * $Revision: 32 $ + * $Revision: 42 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,12 +30,12 @@ #include "acnamesp.h" #define _COMPONENT ACPI_RESOURCES - MODULE_NAME ("rscalc") + ACPI_MODULE_NAME ("rscalc") /******************************************************************************* * - * FUNCTION: Acpi_rs_calculate_byte_stream_length + * FUNCTION: Acpi_rs_get_byte_stream_length * * PARAMETERS: Linked_list - Pointer to the resource linked list * Size_needed - u32 pointer of the size buffer needed @@ -50,17 +50,17 @@ ******************************************************************************/ acpi_status -acpi_rs_calculate_byte_stream_length ( +acpi_rs_get_byte_stream_length ( acpi_resource *linked_list, - u32 *size_needed) + ACPI_SIZE *size_needed) { - u32 byte_stream_size_needed = 0; - u32 segment_size; + ACPI_SIZE byte_stream_size_needed = 0; + ACPI_SIZE segment_size; acpi_resource_ext_irq *ex_irq = NULL; u8 done = FALSE; - FUNCTION_TRACE ("Rs_calculate_byte_stream_length"); + ACPI_FUNCTION_TRACE ("Rs_get_byte_stream_length"); while (!done) { @@ -180,9 +180,9 @@ */ segment_size = 16; - if (NULL != linked_list->data.address16.resource_source.string_ptr) { - segment_size += (1 + - linked_list->data.address16.resource_source.string_length); + if (linked_list->data.address16.resource_source.string_ptr) { + segment_size += linked_list->data.address16.resource_source.string_length; + segment_size++; } break; @@ -196,9 +196,9 @@ */ segment_size = 26; - if (NULL != linked_list->data.address32.resource_source.string_ptr) { - segment_size += (1 + - linked_list->data.address32.resource_source.string_length); + if (linked_list->data.address32.resource_source.string_ptr) { + segment_size += linked_list->data.address32.resource_source.string_length; + segment_size++; } break; @@ -212,9 +212,9 @@ */ segment_size = 46; - if (NULL != linked_list->data.address64.resource_source.string_ptr) { - segment_size += (1 + - linked_list->data.address64.resource_source.string_length); + if (linked_list->data.address64.resource_source.string_ptr) { + segment_size += linked_list->data.address64.resource_source.string_length; + segment_size++; } break; @@ -229,11 +229,11 @@ * Resource Source + 1 for the null. */ segment_size = 9 + - ((linked_list->data.extended_irq.number_of_interrupts - 1) * 4); + (((ACPI_SIZE) linked_list->data.extended_irq.number_of_interrupts - 1) * 4); - if (NULL != ex_irq->resource_source.string_ptr) { - segment_size += (1 + - linked_list->data.extended_irq.resource_source.string_length); + if (ex_irq && ex_irq->resource_source.string_ptr) { + segment_size += linked_list->data.extended_irq.resource_source.string_length; + segment_size++; } break; @@ -243,7 +243,6 @@ * so exit with an error */ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); - break; } /* switch (Linked_list->Id) */ @@ -255,7 +254,7 @@ /* * Point to the next object */ - linked_list = POINTER_ADD (acpi_resource, + linked_list = ACPI_PTR_ADD (acpi_resource, linked_list, linked_list->length); } @@ -269,7 +268,7 @@ /******************************************************************************* * - * FUNCTION: Acpi_rs_calculate_list_length + * FUNCTION: Acpi_rs_get_list_length * * PARAMETERS: Byte_stream_buffer - Pointer to the resource byte stream * Byte_stream_buffer_length - Size of Byte_stream_buffer @@ -286,10 +285,10 @@ ******************************************************************************/ acpi_status -acpi_rs_calculate_list_length ( +acpi_rs_get_list_length ( u8 *byte_stream_buffer, u32 byte_stream_buffer_length, - u32 *size_needed) + ACPI_SIZE *size_needed) { u32 buffer_size = 0; u32 bytes_parsed = 0; @@ -305,7 +304,7 @@ u8 additional_bytes; - FUNCTION_TRACE ("Rs_calculate_list_length"); + ACPI_FUNCTION_TRACE ("Rs_get_list_length"); while (bytes_parsed < byte_stream_buffer_length) { @@ -315,65 +314,65 @@ resource_type = acpi_rs_get_resource_type (*byte_stream_buffer); switch (resource_type) { - case RESOURCE_DESC_MEMORY_24: + case ACPI_RDESC_TYPE_MEMORY_24: /* * 24-Bit Memory Resource */ bytes_consumed = 12; - structure_size = SIZEOF_RESOURCE (acpi_resource_mem24); + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_mem24); break; - case RESOURCE_DESC_LARGE_VENDOR: + case ACPI_RDESC_TYPE_LARGE_VENDOR: /* * Vendor Defined Resource */ buffer = byte_stream_buffer; ++buffer; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); bytes_consumed = temp16 + 3; /* * Ensure a 32-bit boundary for the structure */ - temp16 = (u16) ROUND_UP_TO_32_bITS (temp16); + temp16 = (u16) ACPI_ROUND_UP_TO_32_bITS (temp16); - structure_size = SIZEOF_RESOURCE (acpi_resource_vendor) + + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_vendor) + (temp16 * sizeof (u8)); break; - case RESOURCE_DESC_MEMORY_32: + case ACPI_RDESC_TYPE_MEMORY_32: /* * 32-Bit Memory Range Resource */ bytes_consumed = 20; - structure_size = SIZEOF_RESOURCE (acpi_resource_mem32); + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_mem32); break; - case RESOURCE_DESC_FIXED_MEMORY_32: + case ACPI_RDESC_TYPE_FIXED_MEMORY_32: /* * 32-Bit Fixed Memory Resource */ bytes_consumed = 12; - structure_size = SIZEOF_RESOURCE (acpi_resource_fixed_mem32); + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_fixed_mem32); break; - case RESOURCE_DESC_QWORD_ADDRESS_SPACE: + case ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE: /* * 64-Bit Address Resource */ buffer = byte_stream_buffer; ++buffer; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); bytes_consumed = temp16 + 3; @@ -397,21 +396,21 @@ /* * Ensure a 64-bit boundary for the structure */ - temp8 = (u8) ROUND_UP_TO_64_bITS (temp8); + temp8 = (u8) ACPI_ROUND_UP_TO_64_bITS (temp8); - structure_size = SIZEOF_RESOURCE (acpi_resource_address64) + + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_address64) + (temp8 * sizeof (u8)); break; - case RESOURCE_DESC_DWORD_ADDRESS_SPACE: + case ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE: /* * 32-Bit Address Resource */ buffer = byte_stream_buffer; ++buffer; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); bytes_consumed = temp16 + 3; @@ -435,21 +434,21 @@ /* * Ensure a 32-bit boundary for the structure */ - temp8 = (u8) ROUND_UP_TO_32_bITS (temp8); + temp8 = (u8) ACPI_ROUND_UP_TO_32_bITS (temp8); - structure_size = SIZEOF_RESOURCE (acpi_resource_address32) + + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_address32) + (temp8 * sizeof (u8)); break; - case RESOURCE_DESC_WORD_ADDRESS_SPACE: + case ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE: /* * 16-Bit Address Resource */ buffer = byte_stream_buffer; ++buffer; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); bytes_consumed = temp16 + 3; @@ -473,21 +472,21 @@ /* * Ensure a 32-bit boundary for the structure */ - temp8 = (u8) ROUND_UP_TO_32_bITS (temp8); + temp8 = (u8) ACPI_ROUND_UP_TO_32_bITS (temp8); - structure_size = SIZEOF_RESOURCE (acpi_resource_address16) + + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_address16) + (temp8 * sizeof (u8)); break; - case RESOURCE_DESC_EXTENDED_XRUPT: + case ACPI_RDESC_TYPE_EXTENDED_XRUPT: /* * Extended IRQ */ buffer = byte_stream_buffer; ++buffer; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); bytes_consumed = temp16 + 3; @@ -518,7 +517,6 @@ if (9 + additional_bytes < temp16) { temp8 = (u8) (temp16 - (9 + additional_bytes)); } - else { temp8 = 0; } @@ -526,15 +524,15 @@ /* * Ensure a 32-bit boundary for the structure */ - temp8 = (u8) ROUND_UP_TO_32_bITS (temp8); + temp8 = (u8) ACPI_ROUND_UP_TO_32_bITS (temp8); - structure_size = SIZEOF_RESOURCE (acpi_resource_ext_irq) + + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_ext_irq) + (additional_bytes * sizeof (u8)) + (temp8 * sizeof (u8)); break; - case RESOURCE_DESC_IRQ_FORMAT: + case ACPI_RDESC_TYPE_IRQ_FORMAT: /* * IRQ Resource. * Determine if it there are two or three trailing bytes @@ -545,7 +543,6 @@ if(temp8 & 0x01) { bytes_consumed = 4; } - else { bytes_consumed = 3; } @@ -558,7 +555,7 @@ /* * Look at the number of bits set */ - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); for (index = 0; index < 16; index++) { if (temp16 & 0x1) { @@ -568,12 +565,12 @@ temp16 >>= 1; } - structure_size = SIZEOF_RESOURCE (acpi_resource_io) + + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_io) + (number_of_interrupts * sizeof (u32)); break; - case RESOURCE_DESC_DMA_FORMAT: + case ACPI_RDESC_TYPE_DMA_FORMAT: /* * DMA Resource */ @@ -598,12 +595,12 @@ temp8 >>= 1; } - structure_size = SIZEOF_RESOURCE (acpi_resource_dma) + + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_dma) + (number_of_channels * sizeof (u32)); break; - case RESOURCE_DESC_START_DEPENDENT: + case ACPI_RDESC_TYPE_START_DEPENDENT: /* * Start Dependent Functions Resource * Determine if it there are two or three trailing bytes @@ -618,11 +615,11 @@ bytes_consumed = 1; } - structure_size = SIZEOF_RESOURCE (acpi_resource_start_dpf); + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_start_dpf); break; - case RESOURCE_DESC_END_DEPENDENT: + case ACPI_RDESC_TYPE_END_DEPENDENT: /* * End Dependent Functions Resource */ @@ -631,25 +628,25 @@ break; - case RESOURCE_DESC_IO_PORT: + case ACPI_RDESC_TYPE_IO_PORT: /* * IO Port Resource */ bytes_consumed = 8; - structure_size = SIZEOF_RESOURCE (acpi_resource_io); + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_io); break; - case RESOURCE_DESC_FIXED_IO_PORT: + case ACPI_RDESC_TYPE_FIXED_IO_PORT: /* * Fixed IO Port Resource */ bytes_consumed = 4; - structure_size = SIZEOF_RESOURCE (acpi_resource_fixed_io); + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_fixed_io); break; - case RESOURCE_DESC_SMALL_VENDOR: + case ACPI_RDESC_TYPE_SMALL_VENDOR: /* * Vendor Specific Resource */ @@ -662,13 +659,13 @@ /* * Ensure a 32-bit boundary for the structure */ - temp8 = (u8) ROUND_UP_TO_32_bITS (temp8); - structure_size = SIZEOF_RESOURCE (acpi_resource_vendor) + + temp8 = (u8) ACPI_ROUND_UP_TO_32_bITS (temp8); + structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_vendor) + (temp8 * sizeof (u8)); break; - case RESOURCE_DESC_END_TAG: + case ACPI_RDESC_TYPE_END_TAG: /* * End Tag */ @@ -684,14 +681,12 @@ * so exit with an error */ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); - break; } - /* * Update the return value and counter */ - buffer_size += structure_size; + buffer_size += ACPI_ALIGN_RESOURCE_SIZE(structure_size); bytes_parsed += bytes_consumed; /* @@ -700,7 +695,6 @@ byte_stream_buffer += bytes_consumed; } - /* * This is the data the caller needs */ @@ -711,7 +705,7 @@ /******************************************************************************* * - * FUNCTION: Acpi_rs_calculate_pci_routing_table_length + * FUNCTION: Acpi_rs_get_pci_routing_table_length * * PARAMETERS: Package_object - Pointer to the package object * Buffer_size_needed - u32 pointer of the size buffer @@ -727,12 +721,12 @@ ******************************************************************************/ acpi_status -acpi_rs_calculate_pci_routing_table_length ( +acpi_rs_get_pci_routing_table_length ( acpi_operand_object *package_object, - u32 *buffer_size_needed) + ACPI_SIZE *buffer_size_needed) { u32 number_of_elements; - u32 temp_size_needed = 0; + ACPI_SIZE temp_size_needed = 0; acpi_operand_object **top_object_list; u32 index; acpi_operand_object *package_element; @@ -741,7 +735,7 @@ u32 table_index; - FUNCTION_TRACE ("Rs_calculate_pci_routing_table_length"); + ACPI_FUNCTION_TRACE ("Rs_get_pci_routing_table_length"); number_of_elements = package_object->package.count; @@ -781,7 +775,6 @@ ((*sub_object_list)->reference.opcode == AML_INT_NAMEPATH_OP))) { name_found = TRUE; } - else { /* * Look at the next element @@ -790,12 +783,12 @@ } } - temp_size_needed += (sizeof (pci_routing_table) - 4); + temp_size_needed += (sizeof (acpi_pci_routing_table) - 4); /* * Was a String type found? */ - if (TRUE == name_found) { + if (name_found) { if (ACPI_TYPE_STRING == (*sub_object_list)->common.type) { /* * The length String.Length field includes the @@ -803,13 +796,11 @@ */ temp_size_needed += (*sub_object_list)->string.length; } - else { temp_size_needed += acpi_ns_get_pathname_length ( (*sub_object_list)->reference.node); } } - else { /* * If no name was found, then this is a NULL, which is @@ -820,7 +811,7 @@ /* Round up the size since each element must be aligned */ - temp_size_needed = ROUND_UP_TO_64_bITS (temp_size_needed); + temp_size_needed = ACPI_ROUND_UP_TO_64_bITS (temp_size_needed); /* * Point to the next acpi_operand_object @@ -828,10 +819,9 @@ top_object_list++; } - /* * Adding an extra element to the end of the list, essentially a NULL terminator */ - *buffer_size_needed = temp_size_needed + sizeof (pci_routing_table); + *buffer_size_needed = temp_size_needed + sizeof (acpi_pci_routing_table); return_ACPI_STATUS (AE_OK); } diff -urN linux-2.4.18/drivers/acpi/resources/rscreate.c lia64-2.4/drivers/acpi/resources/rscreate.c --- linux-2.4.18/drivers/acpi/resources/rscreate.c Mon Sep 24 15:06:46 2001 +++ lia64-2.4/drivers/acpi/resources/rscreate.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: rscreate - Create resource lists/tables - * $Revision: 36 $ + * $Revision: 56 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ #include "acnamesp.h" #define _COMPONENT ACPI_RESOURCES - MODULE_NAME ("rscreate") + ACPI_MODULE_NAME ("rscreate") /******************************************************************************* @@ -55,17 +55,16 @@ acpi_status acpi_rs_create_resource_list ( acpi_operand_object *byte_stream_buffer, - u8 *output_buffer, - u32 *output_buffer_length) + acpi_buffer *output_buffer) { acpi_status status; u8 *byte_stream_start; - u32 list_size_needed = 0; + ACPI_SIZE list_size_needed = 0; u32 byte_stream_buffer_length; - FUNCTION_TRACE ("Rs_create_resource_list"); + ACPI_FUNCTION_TRACE ("Rs_create_resource_list"); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Byte_stream_buffer = %p\n", byte_stream_buffer)); @@ -80,48 +79,32 @@ * Pass the Byte_stream_buffer into a module that can calculate * the buffer size needed for the linked list */ - status = acpi_rs_calculate_list_length (byte_stream_start, byte_stream_buffer_length, + status = acpi_rs_get_list_length (byte_stream_start, byte_stream_buffer_length, &list_size_needed); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Status=%X List_size_needed=%X\n", - status, list_size_needed)); - - /* - * Exit with the error passed back - */ + status, (u32) list_size_needed)); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } - /* - * If the linked list will fit into the available buffer - * call to fill in the list - */ - if (list_size_needed <= *output_buffer_length) { - /* - * Zero out the return buffer before proceeding - */ - MEMSET (output_buffer, 0x00, *output_buffer_length); - - status = acpi_rs_byte_stream_to_list (byte_stream_start, byte_stream_buffer_length, - &output_buffer); + /* Validate/Allocate/Clear caller buffer */ - /* - * Exit with the error passed back - */ - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Output_buffer = %p\n", output_buffer)); + status = acpi_ut_initialize_buffer (output_buffer, list_size_needed); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } - else { - *output_buffer_length = list_size_needed; - return_ACPI_STATUS (AE_BUFFER_OVERFLOW); + /* Do the conversion */ + + status = acpi_rs_byte_stream_to_list (byte_stream_start, byte_stream_buffer_length, + output_buffer->pointer); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } - *output_buffer_length = list_size_needed; + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Output_buffer %p Length %X\n", + output_buffer->pointer, (u32) output_buffer->length)); return_ACPI_STATUS (AE_OK); } @@ -137,225 +120,203 @@ * * RETURN: Status AE_OK if okay, else a valid acpi_status code. * If the Output_buffer is too small, the error will be - * AE_BUFFER_OVERFLOW and Output_buffer_length will point + * AE_BUFFER_OVERFLOW and Output_buffer->Length will point * to the size buffer needed. * * DESCRIPTION: Takes the acpi_operand_object package and creates a * linked list of PCI interrupt descriptions * + * NOTE: It is the caller's responsibility to ensure that the start of the + * output buffer is aligned properly (if necessary). + * ******************************************************************************/ acpi_status acpi_rs_create_pci_routing_table ( acpi_operand_object *package_object, - u8 *output_buffer, - u32 *output_buffer_length) + acpi_buffer *output_buffer) { - u8 *buffer = output_buffer; + u8 *buffer; acpi_operand_object **top_object_list = NULL; acpi_operand_object **sub_object_list = NULL; acpi_operand_object *package_element = NULL; - u32 buffer_size_needed = 0; + ACPI_SIZE buffer_size_needed = 0; u32 number_of_elements = 0; u32 index = 0; - pci_routing_table *user_prt = NULL; + acpi_pci_routing_table *user_prt = NULL; acpi_namespace_node *node; acpi_status status; + acpi_buffer path_buffer; - FUNCTION_TRACE ("Rs_create_pci_routing_table"); + ACPI_FUNCTION_TRACE ("Rs_create_pci_routing_table"); + /* Params already validated, so we don't re-validate here */ + /* - * Params already validated, so we don't re-validate here + * Get the required buffer length */ - status = acpi_rs_calculate_pci_routing_table_length (package_object, + status = acpi_rs_get_pci_routing_table_length (package_object, &buffer_size_needed); - - if (!ACPI_SUCCESS(status)) { + if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Buffer_size_needed = %X\n", buffer_size_needed)); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Buffer_size_needed = %X\n", (u32) buffer_size_needed)); + + /* Validate/Allocate/Clear caller buffer */ + + status = acpi_ut_initialize_buffer (output_buffer, buffer_size_needed); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* - * If the data will fit into the available buffer - * call to fill in the list + * Loop through the ACPI_INTERNAL_OBJECTS - Each object should contain an + * acpi_integer Address, a u8 Pin, a Name and a u8 Source_index. */ - if (buffer_size_needed <= *output_buffer_length) { + top_object_list = package_object->package.elements; + number_of_elements = package_object->package.count; + buffer = output_buffer->pointer; + user_prt = ACPI_CAST_PTR (acpi_pci_routing_table, buffer); + + for (index = 0; index < number_of_elements; index++) { /* - * Zero out the return buffer before proceeding + * Point User_prt past this current structure + * + * NOTE: On the first iteration, User_prt->Length will + * be zero because we cleared the return buffer earlier */ - MEMSET (output_buffer, 0x00, *output_buffer_length); + buffer += user_prt->length; + user_prt = ACPI_CAST_PTR (acpi_pci_routing_table, buffer); /* - * Loop through the ACPI_INTERNAL_OBJECTS - Each object should - * contain a u32 Address, a u8 Pin, a Name and a u8 - * Source_index. + * Fill in the Length field with the information we have at this point. + * The minus four is to subtract the size of the u8 Source[4] member + * because it is added below. */ - top_object_list = package_object->package.elements; - number_of_elements = package_object->package.count; - user_prt = (pci_routing_table *) buffer; - - - buffer = ROUND_PTR_UP_TO_8 (buffer, u8); - - for (index = 0; index < number_of_elements; index++) { - /* - * Point User_prt past this current structure - * - * NOTE: On the first iteration, User_prt->Length will - * be zero because we cleared the return buffer earlier - */ - buffer += user_prt->length; - user_prt = (pci_routing_table *) buffer; + user_prt->length = (sizeof (acpi_pci_routing_table) -4); + /* + * Dereference the sub-package + */ + package_element = *top_object_list; - /* - * Fill in the Length field with the information we - * have at this point. - * The minus four is to subtract the size of the - * u8 Source[4] member because it is added below. - */ - user_prt->length = (sizeof (pci_routing_table) -4); - - /* - * Dereference the sub-package - */ - package_element = *top_object_list; + /* + * The Sub_object_list will now point to an array of the four IRQ + * elements: Address, Pin, Source and Source_index + */ + sub_object_list = package_element->package.elements; - /* - * The Sub_object_list will now point to an array of - * the four IRQ elements: Address, Pin, Source and - * Source_index - */ - sub_object_list = package_element->package.elements; + /* + * 1) First subobject: Dereference the Address + */ + if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) { + user_prt->address = (*sub_object_list)->integer.value; + } + else { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n", + acpi_ut_get_type_name ((*sub_object_list)->common.type))); + return_ACPI_STATUS (AE_BAD_DATA); + } - /* - * 1) First subobject: Dereference the Address - */ - if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) { - user_prt->address = (*sub_object_list)->integer.value; - } + /* + * 2) Second subobject: Dereference the Pin + */ + sub_object_list++; - else { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n", - acpi_ut_get_type_name ((*sub_object_list)->common.type))); - return_ACPI_STATUS (AE_BAD_DATA); - } + if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) { + user_prt->pin = (u32) (*sub_object_list)->integer.value; + } + else { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n", + acpi_ut_get_type_name ((*sub_object_list)->common.type))); + return_ACPI_STATUS (AE_BAD_DATA); + } - /* - * 2) Second subobject: Dereference the Pin - */ - sub_object_list++; + /* + * 3) Third subobject: Dereference the Source Name + */ + sub_object_list++; - if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) { - user_prt->pin = (u32) (*sub_object_list)->integer.value; - } + switch ((*sub_object_list)->common.type) { + case INTERNAL_TYPE_REFERENCE: - else { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n", - acpi_ut_get_type_name ((*sub_object_list)->common.type))); + if ((*sub_object_list)->reference.opcode != AML_INT_NAMEPATH_OP) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need name, found reference op %X\n", + (*sub_object_list)->reference.opcode)); return_ACPI_STATUS (AE_BAD_DATA); } - /* - * 3) Third subobject: Dereference the Source Name - */ - sub_object_list++; - - switch ((*sub_object_list)->common.type) { - case INTERNAL_TYPE_REFERENCE: + node = (*sub_object_list)->reference.node; - if ((*sub_object_list)->reference.opcode != AML_INT_NAMEPATH_OP) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need name, found reference op %X\n", - (*sub_object_list)->reference.opcode)); - return_ACPI_STATUS (AE_BAD_DATA); - } + /* Use *remaining* length of the buffer as max for pathname */ - node = (*sub_object_list)->reference.node; + path_buffer.length = output_buffer->length - + (u32) ((u8 *) user_prt->source - (u8 *) output_buffer->pointer); + path_buffer.pointer = user_prt->source; - /* TBD: use *remaining* length of the buffer! */ + status = acpi_ns_handle_to_pathname ((acpi_handle) node, &path_buffer); - status = acpi_ns_handle_to_pathname ((acpi_handle *) node, - output_buffer_length, user_prt->source); + user_prt->length += ACPI_STRLEN (user_prt->source) + 1; /* include null terminator */ + break; - user_prt->length += STRLEN (user_prt->source) + 1; /* include null terminator */ - break; + case ACPI_TYPE_STRING: - case ACPI_TYPE_STRING: + ACPI_STRCPY (user_prt->source, + (*sub_object_list)->string.pointer); - STRCPY (user_prt->source, - (*sub_object_list)->string.pointer); + /* Add to the Length field the length of the string */ - /* - * Add to the Length field the length of the string - */ - user_prt->length += (*sub_object_list)->string.length; - break; + user_prt->length += (*sub_object_list)->string.length; + break; - case ACPI_TYPE_INTEGER: - /* - * If this is a number, then the Source Name - * is NULL, since the entire buffer was zeroed - * out, we can leave this alone. - */ - /* - * Add to the Length field the length of - * the u32 NULL - */ - user_prt->length += sizeof (u32); - break; + case ACPI_TYPE_INTEGER: + /* + * If this is a number, then the Source Name is NULL, since the + * entire buffer was zeroed out, we can leave this alone. + * + * Add to the Length field the length of the u32 NULL + */ + user_prt->length += sizeof (u32); + break; - default: + default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n", - acpi_ut_get_type_name ((*sub_object_list)->common.type))); - return_ACPI_STATUS (AE_BAD_DATA); - break; - } + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n", + acpi_ut_get_type_name ((*sub_object_list)->common.type))); + return_ACPI_STATUS (AE_BAD_DATA); + } - /* Now align the current length */ + /* Now align the current length */ - user_prt->length = ROUND_UP_TO_64_bITS (user_prt->length); + user_prt->length = ACPI_ROUND_UP_TO_64_bITS (user_prt->length); - /* - * 4) Fourth subobject: Dereference the Source Index - */ - sub_object_list++; - - if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) { - user_prt->source_index = (u32) (*sub_object_list)->integer.value; - } - - else { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n", - acpi_ut_get_type_name ((*sub_object_list)->common.type))); - return_ACPI_STATUS (AE_BAD_DATA); - } + /* + * 4) Fourth subobject: Dereference the Source Index + */ + sub_object_list++; - /* - * Point to the next acpi_operand_object - */ - top_object_list++; + if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) { + user_prt->source_index = (u32) (*sub_object_list)->integer.value; + } + else { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n", + acpi_ut_get_type_name ((*sub_object_list)->common.type))); + return_ACPI_STATUS (AE_BAD_DATA); } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Output_buffer = %p\n", output_buffer)); - } - - else { - *output_buffer_length = buffer_size_needed; + /* Point to the next acpi_operand_object */ - return_ACPI_STATUS (AE_BUFFER_OVERFLOW); + top_object_list++; } - /* - * Report the amount of buffer used - */ - *output_buffer_length = buffer_size_needed; + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Output_buffer %p Length %X\n", + output_buffer->pointer, (u32) output_buffer->length)); return_ACPI_STATUS (AE_OK); } @@ -366,11 +327,10 @@ * * PARAMETERS: Linked_list_buffer - Pointer to the resource linked list * Output_buffer - Pointer to the user's buffer - * Output_buffer_length - Size of Output_buffer * * RETURN: Status AE_OK if okay, else a valid acpi_status code. * If the Output_buffer is too small, the error will be - * AE_BUFFER_OVERFLOW and Output_buffer_length will point + * AE_BUFFER_OVERFLOW and Output_buffer->Length will point * to the size buffer needed. * * DESCRIPTION: Takes the linked list of device resources and @@ -382,14 +342,13 @@ acpi_status acpi_rs_create_byte_stream ( acpi_resource *linked_list_buffer, - u8 *output_buffer, - u32 *output_buffer_length) + acpi_buffer *output_buffer) { acpi_status status; - u32 byte_stream_size_needed = 0; + ACPI_SIZE byte_stream_size_needed = 0; - FUNCTION_TRACE ("Rs_create_byte_stream"); + ACPI_FUNCTION_TRACE ("Rs_create_byte_stream"); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Linked_list_buffer = %p\n", linked_list_buffer)); @@ -397,50 +356,35 @@ /* * Params already validated, so we don't re-validate here * - * Pass the Linked_list_buffer into a module that can calculate + * Pass the Linked_list_buffer into a module that calculates * the buffer size needed for the byte stream. */ - status = acpi_rs_calculate_byte_stream_length (linked_list_buffer, + status = acpi_rs_get_byte_stream_length (linked_list_buffer, &byte_stream_size_needed); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Byte_stream_size_needed=%X, %s\n", - byte_stream_size_needed, acpi_format_exception (status))); - - /* - * Exit with the error passed back - */ + (u32) byte_stream_size_needed, acpi_format_exception (status))); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } - /* - * If the linked list will fit into the available buffer - * call to fill in the list - */ - if (byte_stream_size_needed <= *output_buffer_length) { - /* - * Zero out the return buffer before proceeding - */ - MEMSET (output_buffer, 0x00, *output_buffer_length); - - status = acpi_rs_list_to_byte_stream (linked_list_buffer, byte_stream_size_needed, - &output_buffer); + /* Validate/Allocate/Clear caller buffer */ - /* - * Exit with the error passed back - */ - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Output_buffer = %p\n", output_buffer)); + status = acpi_ut_initialize_buffer (output_buffer, byte_stream_size_needed); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } - else { - *output_buffer_length = byte_stream_size_needed; - return_ACPI_STATUS (AE_BUFFER_OVERFLOW); + /* Do the conversion */ + + status = acpi_rs_list_to_byte_stream (linked_list_buffer, byte_stream_size_needed, + output_buffer->pointer); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Output_buffer %p Length %X\n", + output_buffer->pointer, (u32) output_buffer->length)); return_ACPI_STATUS (AE_OK); } diff -urN linux-2.4.18/drivers/acpi/resources/rsdump.c lia64-2.4/drivers/acpi/resources/rsdump.c --- linux-2.4.18/drivers/acpi/resources/rsdump.c Mon Sep 24 15:06:46 2001 +++ lia64-2.4/drivers/acpi/resources/rsdump.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: rsdump - Functions to display the resource structures. - * $Revision: 23 $ + * $Revision: 32 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,10 +28,10 @@ #include "acresrc.h" #define _COMPONENT ACPI_RESOURCES - MODULE_NAME ("rsdump") + ACPI_MODULE_NAME ("rsdump") -#ifdef ACPI_DEBUG +#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) /******************************************************************************* * @@ -53,19 +53,19 @@ u8 index = 0; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("IRQ Resource\n"); acpi_os_printf (" %s Triggered\n", - LEVEL_SENSITIVE == irq_data->edge_level ? "Level" : "Edge"); + ACPI_LEVEL_SENSITIVE == irq_data->edge_level ? "Level" : "Edge"); acpi_os_printf (" Active %s\n", - ACTIVE_LOW == irq_data->active_high_low ? "Low" : "High"); + ACPI_ACTIVE_LOW == irq_data->active_high_low ? "Low" : "High"); acpi_os_printf (" %s\n", - SHARED == irq_data->shared_exclusive ? "Shared" : "Exclusive"); + ACPI_SHARED == irq_data->shared_exclusive ? "Shared" : "Exclusive"); acpi_os_printf (" %X Interrupts ( ", irq_data->number_of_interrupts); @@ -98,25 +98,25 @@ u8 index = 0; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("DMA Resource\n"); switch (dma_data->type) { - case COMPATIBILITY: + case ACPI_COMPATIBILITY: acpi_os_printf (" Compatibility mode\n"); break; - case TYPE_A: + case ACPI_TYPE_A: acpi_os_printf (" Type A\n"); break; - case TYPE_B: + case ACPI_TYPE_B: acpi_os_printf (" Type B\n"); break; - case TYPE_F: + case ACPI_TYPE_F: acpi_os_printf (" Type F\n"); break; @@ -126,19 +126,19 @@ } acpi_os_printf (" %sBus Master\n", - BUS_MASTER == dma_data->bus_master ? "" : "Not a "); + ACPI_BUS_MASTER == dma_data->bus_master ? "" : "Not a "); switch (dma_data->transfer) { - case TRANSFER_8: + case ACPI_TRANSFER_8: acpi_os_printf (" 8-bit only transfer\n"); break; - case TRANSFER_8_16: + case ACPI_TRANSFER_8_16: acpi_os_printf (" 8 and 16-bit transfer\n"); break; - case TRANSFER_16: + case ACPI_TRANSFER_16: acpi_os_printf (" 16 bit only transfer\n"); break; @@ -160,7 +160,7 @@ /******************************************************************************* * - * FUNCTION: Acpi_rs_dump_start_dependent_functions + * FUNCTION: Acpi_rs_dump_start_depend_fns * * PARAMETERS: Data - pointer to the resource structure to dump. * @@ -171,27 +171,27 @@ ******************************************************************************/ void -acpi_rs_dump_start_dependent_functions ( - acpi_resource_data *data) +acpi_rs_dump_start_depend_fns ( + acpi_resource_data *data) { - acpi_resource_start_dpf *sdf_data = (acpi_resource_start_dpf *) data; + acpi_resource_start_dpf *sdf_data = (acpi_resource_start_dpf *) data; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("Start Dependent Functions Resource\n"); switch (sdf_data->compatibility_priority) { - case GOOD_CONFIGURATION: + case ACPI_GOOD_CONFIGURATION: acpi_os_printf (" Good configuration\n"); break; - case ACCEPTABLE_CONFIGURATION: + case ACPI_ACCEPTABLE_CONFIGURATION: acpi_os_printf (" Acceptable configuration\n"); break; - case SUB_OPTIMAL_CONFIGURATION: + case ACPI_SUB_OPTIMAL_CONFIGURATION: acpi_os_printf (" Sub-optimal configuration\n"); break; @@ -201,15 +201,15 @@ } switch(sdf_data->performance_robustness) { - case GOOD_CONFIGURATION: + case ACPI_GOOD_CONFIGURATION: acpi_os_printf (" Good configuration\n"); break; - case ACCEPTABLE_CONFIGURATION: + case ACPI_ACCEPTABLE_CONFIGURATION: acpi_os_printf (" Acceptable configuration\n"); break; - case SUB_OPTIMAL_CONFIGURATION: + case ACPI_SUB_OPTIMAL_CONFIGURATION: acpi_os_printf (" Sub-optimal configuration\n"); break; @@ -242,13 +242,13 @@ acpi_resource_io *io_data = (acpi_resource_io *) data; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("Io Resource\n"); acpi_os_printf (" %d bit decode\n", - DECODE_16 == io_data->io_decode ? 16 : 10); + ACPI_DECODE_16 == io_data->io_decode ? 16 : 10); acpi_os_printf (" Range minimum base: %08X\n", io_data->min_base_address); @@ -285,7 +285,7 @@ acpi_resource_fixed_io *fixed_io_data = (acpi_resource_fixed_io *) data; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("Fixed Io Resource\n"); @@ -319,7 +319,7 @@ u16 index = 0; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("Vendor Specific Resource\n"); @@ -354,13 +354,13 @@ acpi_resource_mem24 *memory24_data = (acpi_resource_mem24 *) data; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("24-Bit Memory Range Resource\n"); acpi_os_printf (" Read%s\n", - READ_WRITE_MEMORY == + ACPI_READ_WRITE_MEMORY == memory24_data->read_write_attribute ? "/Write" : " only"); @@ -399,13 +399,13 @@ acpi_resource_mem32 *memory32_data = (acpi_resource_mem32 *) data; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("32-Bit Memory Range Resource\n"); acpi_os_printf (" Read%s\n", - READ_WRITE_MEMORY == + ACPI_READ_WRITE_MEMORY == memory32_data->read_write_attribute ? "/Write" : " only"); @@ -444,13 +444,13 @@ acpi_resource_fixed_mem32 *fixed_memory32_data = (acpi_resource_fixed_mem32 *) data; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("32-Bit Fixed Location Memory Range Resource\n"); acpi_os_printf (" Read%s\n", - READ_WRITE_MEMORY == + ACPI_READ_WRITE_MEMORY == fixed_memory32_data->read_write_attribute ? "/Write" : " Only"); @@ -483,34 +483,34 @@ acpi_resource_address16 *address16_data = (acpi_resource_address16 *) data; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("16-Bit Address Space Resource\n"); acpi_os_printf (" Resource Type: "); switch (address16_data->resource_type) { - case MEMORY_RANGE: + case ACPI_MEMORY_RANGE: acpi_os_printf ("Memory Range\n"); switch (address16_data->attribute.memory.cache_attribute) { - case NON_CACHEABLE_MEMORY: + case ACPI_NON_CACHEABLE_MEMORY: acpi_os_printf (" Type Specific: " "Noncacheable memory\n"); break; - case CACHABLE_MEMORY: + case ACPI_CACHABLE_MEMORY: acpi_os_printf (" Type Specific: " "Cacheable memory\n"); break; - case WRITE_COMBINING_MEMORY: + case ACPI_WRITE_COMBINING_MEMORY: acpi_os_printf (" Type Specific: " "Write-combining memory\n"); break; - case PREFETCHABLE_MEMORY: + case ACPI_PREFETCHABLE_MEMORY: acpi_os_printf (" Type Specific: " "Prefetchable memory\n"); break; @@ -522,27 +522,27 @@ } acpi_os_printf (" Type Specific: Read%s\n", - READ_WRITE_MEMORY == + ACPI_READ_WRITE_MEMORY == address16_data->attribute.memory.read_write_attribute ? "/Write" : " Only"); break; - case IO_RANGE: + case ACPI_IO_RANGE: acpi_os_printf ("I/O Range\n"); switch (address16_data->attribute.io.range_attribute) { - case NON_ISA_ONLY_RANGES: + case ACPI_NON_ISA_ONLY_RANGES: acpi_os_printf (" Type Specific: " "Non-ISA Io Addresses\n"); break; - case ISA_ONLY_RANGES: + case ACPI_ISA_ONLY_RANGES: acpi_os_printf (" Type Specific: " "ISA Io Addresses\n"); break; - case ENTIRE_RANGE: + case ACPI_ENTIRE_RANGE: acpi_os_printf (" Type Specific: " "ISA and non-ISA Io Addresses\n"); break; @@ -554,7 +554,7 @@ } break; - case BUS_NUMBER_RANGE: + case ACPI_BUS_NUMBER_RANGE: acpi_os_printf ("Bus Number Range\n"); break; @@ -566,19 +566,19 @@ } acpi_os_printf (" Resource %s\n", - CONSUMER == address16_data->producer_consumer ? + ACPI_CONSUMER == address16_data->producer_consumer ? "Consumer" : "Producer"); acpi_os_printf (" %s decode\n", - SUB_DECODE == address16_data->decode ? + ACPI_SUB_DECODE == address16_data->decode ? "Subtractive" : "Positive"); acpi_os_printf (" Min address is %s fixed\n", - ADDRESS_FIXED == address16_data->min_address_fixed ? + ACPI_ADDRESS_FIXED == address16_data->min_address_fixed ? "" : "not"); acpi_os_printf (" Max address is %s fixed\n", - ADDRESS_FIXED == address16_data->max_address_fixed ? + ACPI_ADDRESS_FIXED == address16_data->max_address_fixed ? "" : "not"); acpi_os_printf (" Granularity: %08X\n", @@ -626,33 +626,33 @@ acpi_resource_address32 *address32_data = (acpi_resource_address32 *) data; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("32-Bit Address Space Resource\n"); switch (address32_data->resource_type) { - case MEMORY_RANGE: + case ACPI_MEMORY_RANGE: acpi_os_printf (" Resource Type: Memory Range\n"); switch (address32_data->attribute.memory.cache_attribute) { - case NON_CACHEABLE_MEMORY: + case ACPI_NON_CACHEABLE_MEMORY: acpi_os_printf (" Type Specific: " "Noncacheable memory\n"); break; - case CACHABLE_MEMORY: + case ACPI_CACHABLE_MEMORY: acpi_os_printf (" Type Specific: " "Cacheable memory\n"); break; - case WRITE_COMBINING_MEMORY: + case ACPI_WRITE_COMBINING_MEMORY: acpi_os_printf (" Type Specific: " "Write-combining memory\n"); break; - case PREFETCHABLE_MEMORY: + case ACPI_PREFETCHABLE_MEMORY: acpi_os_printf (" Type Specific: " "Prefetchable memory\n"); break; @@ -664,27 +664,27 @@ } acpi_os_printf (" Type Specific: Read%s\n", - READ_WRITE_MEMORY == + ACPI_READ_WRITE_MEMORY == address32_data->attribute.memory.read_write_attribute ? "/Write" : " Only"); break; - case IO_RANGE: + case ACPI_IO_RANGE: acpi_os_printf (" Resource Type: Io Range\n"); switch (address32_data->attribute.io.range_attribute) { - case NON_ISA_ONLY_RANGES: + case ACPI_NON_ISA_ONLY_RANGES: acpi_os_printf (" Type Specific: " "Non-ISA Io Addresses\n"); break; - case ISA_ONLY_RANGES: + case ACPI_ISA_ONLY_RANGES: acpi_os_printf (" Type Specific: " "ISA Io Addresses\n"); break; - case ENTIRE_RANGE: + case ACPI_ENTIRE_RANGE: acpi_os_printf (" Type Specific: " "ISA and non-ISA Io Addresses\n"); break; @@ -696,7 +696,7 @@ } break; - case BUS_NUMBER_RANGE: + case ACPI_BUS_NUMBER_RANGE: acpi_os_printf (" Resource Type: Bus Number Range\n"); break; @@ -708,19 +708,19 @@ } acpi_os_printf (" Resource %s\n", - CONSUMER == address32_data->producer_consumer ? + ACPI_CONSUMER == address32_data->producer_consumer ? "Consumer" : "Producer"); acpi_os_printf (" %s decode\n", - SUB_DECODE == address32_data->decode ? + ACPI_SUB_DECODE == address32_data->decode ? "Subtractive" : "Positive"); acpi_os_printf (" Min address is %s fixed\n", - ADDRESS_FIXED == address32_data->min_address_fixed ? + ACPI_ADDRESS_FIXED == address32_data->min_address_fixed ? "" : "not "); acpi_os_printf (" Max address is %s fixed\n", - ADDRESS_FIXED == address32_data->max_address_fixed ? + ACPI_ADDRESS_FIXED == address32_data->max_address_fixed ? "" : "not "); acpi_os_printf (" Granularity: %08X\n", @@ -768,33 +768,33 @@ acpi_resource_address64 *address64_data = (acpi_resource_address64 *) data; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("64-Bit Address Space Resource\n"); switch (address64_data->resource_type) { - case MEMORY_RANGE: + case ACPI_MEMORY_RANGE: acpi_os_printf (" Resource Type: Memory Range\n"); switch (address64_data->attribute.memory.cache_attribute) { - case NON_CACHEABLE_MEMORY: + case ACPI_NON_CACHEABLE_MEMORY: acpi_os_printf (" Type Specific: " "Noncacheable memory\n"); break; - case CACHABLE_MEMORY: + case ACPI_CACHABLE_MEMORY: acpi_os_printf (" Type Specific: " "Cacheable memory\n"); break; - case WRITE_COMBINING_MEMORY: + case ACPI_WRITE_COMBINING_MEMORY: acpi_os_printf (" Type Specific: " "Write-combining memory\n"); break; - case PREFETCHABLE_MEMORY: + case ACPI_PREFETCHABLE_MEMORY: acpi_os_printf (" Type Specific: " "Prefetchable memory\n"); break; @@ -806,27 +806,27 @@ } acpi_os_printf (" Type Specific: Read%s\n", - READ_WRITE_MEMORY == + ACPI_READ_WRITE_MEMORY == address64_data->attribute.memory.read_write_attribute ? "/Write" : " Only"); break; - case IO_RANGE: + case ACPI_IO_RANGE: acpi_os_printf (" Resource Type: Io Range\n"); switch (address64_data->attribute.io.range_attribute) { - case NON_ISA_ONLY_RANGES: + case ACPI_NON_ISA_ONLY_RANGES: acpi_os_printf (" Type Specific: " "Non-ISA Io Addresses\n"); break; - case ISA_ONLY_RANGES: + case ACPI_ISA_ONLY_RANGES: acpi_os_printf (" Type Specific: " "ISA Io Addresses\n"); break; - case ENTIRE_RANGE: + case ACPI_ENTIRE_RANGE: acpi_os_printf (" Type Specific: " "ISA and non-ISA Io Addresses\n"); break; @@ -838,7 +838,7 @@ } break; - case BUS_NUMBER_RANGE: + case ACPI_BUS_NUMBER_RANGE: acpi_os_printf (" Resource Type: Bus Number Range\n"); break; @@ -850,19 +850,19 @@ } acpi_os_printf (" Resource %s\n", - CONSUMER == address64_data->producer_consumer ? + ACPI_CONSUMER == address64_data->producer_consumer ? "Consumer" : "Producer"); acpi_os_printf (" %s decode\n", - SUB_DECODE == address64_data->decode ? + ACPI_SUB_DECODE == address64_data->decode ? "Subtractive" : "Positive"); acpi_os_printf (" Min address is %s fixed\n", - ADDRESS_FIXED == address64_data->min_address_fixed ? + ACPI_ADDRESS_FIXED == address64_data->min_address_fixed ? "" : "not "); acpi_os_printf (" Max address is %s fixed\n", - ADDRESS_FIXED == address64_data->max_address_fixed ? + ACPI_ADDRESS_FIXED == address64_data->max_address_fixed ? "" : "not "); acpi_os_printf (" Granularity: %16X\n", @@ -911,25 +911,25 @@ u8 index = 0; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); acpi_os_printf ("Extended IRQ Resource\n"); acpi_os_printf (" Resource %s\n", - CONSUMER == ext_irq_data->producer_consumer ? + ACPI_CONSUMER == ext_irq_data->producer_consumer ? "Consumer" : "Producer"); acpi_os_printf (" %s\n", - LEVEL_SENSITIVE == ext_irq_data->edge_level ? + ACPI_LEVEL_SENSITIVE == ext_irq_data->edge_level ? "Level" : "Edge"); acpi_os_printf (" Active %s\n", - ACTIVE_LOW == ext_irq_data->active_high_low ? + ACPI_ACTIVE_LOW == ext_irq_data->active_high_low ? "low" : "high"); acpi_os_printf (" %s\n", - SHARED == ext_irq_data->shared_exclusive ? + ACPI_SHARED == ext_irq_data->shared_exclusive ? "Shared" : "Exclusive"); acpi_os_printf (" Interrupts : %X ( ", @@ -972,12 +972,12 @@ u8 done = FALSE; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); if (acpi_dbg_level & ACPI_LV_RESOURCES && _COMPONENT & acpi_dbg_layer) { while (!done) { - acpi_os_printf ("Resource structure %x.\n", count++); + acpi_os_printf ("Resource structure %X.\n", count++); switch (resource->id) { case ACPI_RSTYPE_IRQ: @@ -989,7 +989,7 @@ break; case ACPI_RSTYPE_START_DPF: - acpi_rs_dump_start_dependent_functions (&resource->data); + acpi_rs_dump_start_depend_fns (&resource->data); break; case ACPI_RSTYPE_END_DPF: @@ -1049,7 +1049,7 @@ } - resource = POINTER_ADD (acpi_resource, resource, resource->length); + resource = ACPI_PTR_ADD (acpi_resource, resource, resource->length); } } @@ -1070,25 +1070,26 @@ void acpi_rs_dump_irq_list ( - u8 *route_table) + u8 *route_table) { - u8 *buffer = route_table; - u8 count = 0; - u8 done = FALSE; - pci_routing_table *prt_element; + u8 *buffer = route_table; + u8 count = 0; + u8 done = FALSE; + acpi_pci_routing_table *prt_element; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); if (acpi_dbg_level & ACPI_LV_RESOURCES && _COMPONENT & acpi_dbg_layer) { - prt_element = (pci_routing_table *) buffer; + prt_element = ACPI_CAST_PTR (acpi_pci_routing_table, buffer); while (!done) { acpi_os_printf ("PCI IRQ Routing Table structure %X.\n", count++); - acpi_os_printf (" Address: %X\n", - prt_element->address); + acpi_os_printf (" Address: %8.8X%8.8X\n", + ACPI_HIDWORD (prt_element->address), + ACPI_LODWORD (prt_element->address)); acpi_os_printf (" Pin: %X\n", prt_element->pin); @@ -1099,7 +1100,7 @@ buffer += prt_element->length; - prt_element = (pci_routing_table *) buffer; + prt_element = ACPI_CAST_PTR (acpi_pci_routing_table, buffer); if(0 == prt_element->length) { done = TRUE; diff -urN linux-2.4.18/drivers/acpi/resources/rsio.c lia64-2.4/drivers/acpi/resources/rsio.c --- linux-2.4.18/drivers/acpi/resources/rsio.c Mon Sep 24 15:06:46 2001 +++ lia64-2.4/drivers/acpi/resources/rsio.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: rsio - IO and DMA resource descriptors - * $Revision: 14 $ + * $Revision: 20 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #include "acresrc.h" #define _COMPONENT ACPI_RESOURCES - MODULE_NAME ("rsio") + ACPI_MODULE_NAME ("rsio") /******************************************************************************* @@ -37,13 +37,12 @@ * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -56,18 +55,18 @@ acpi_status acpi_rs_io_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { u8 *buffer = byte_stream_buffer; - acpi_resource *output_struct = (acpi_resource *) *output_buffer; + acpi_resource *output_struct = (void *) *output_buffer; u16 temp16 = 0; u8 temp8 = 0; - u32 struct_size = SIZEOF_RESOURCE (acpi_resource_io); + ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_io); - FUNCTION_TRACE ("Rs_io_resource"); + ACPI_FUNCTION_TRACE ("Rs_io_resource"); /* @@ -89,7 +88,7 @@ * Check Min_base Address */ buffer += 1; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); output_struct->data.io.min_base_address = temp16; @@ -97,7 +96,7 @@ * Check Max_base Address */ buffer += 2; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); output_struct->data.io.max_base_address = temp16; @@ -120,7 +119,7 @@ /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -136,13 +135,12 @@ * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -155,18 +153,18 @@ acpi_status acpi_rs_fixed_io_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { u8 *buffer = byte_stream_buffer; - acpi_resource *output_struct = (acpi_resource *) *output_buffer; + acpi_resource *output_struct = (void *) *output_buffer; u16 temp16 = 0; u8 temp8 = 0; - u32 struct_size = SIZEOF_RESOURCE (acpi_resource_fixed_io); + ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_fixed_io); - FUNCTION_TRACE ("Rs_fixed_io_resource"); + ACPI_FUNCTION_TRACE ("Rs_fixed_io_resource"); /* @@ -180,7 +178,7 @@ * Check Range Base Address */ buffer += 1; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); output_struct->data.fixed_io.base_address = temp16; @@ -195,7 +193,7 @@ /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -211,9 +209,8 @@ * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -226,14 +223,14 @@ acpi_rs_io_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer = *output_buffer; u16 temp16 = 0; u8 temp8 = 0; - FUNCTION_TRACE ("Rs_io_stream"); + ACPI_FUNCTION_TRACE ("Rs_io_stream"); /* @@ -255,7 +252,7 @@ */ temp16 = (u16) linked_list->data.io.min_base_address; - MOVE_UNALIGNED16_TO_16 (buffer, &temp16); + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16); buffer += 2; /* @@ -263,7 +260,7 @@ */ temp16 = (u16) linked_list->data.io.max_base_address; - MOVE_UNALIGNED16_TO_16 (buffer, &temp16); + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16); buffer += 2; /* @@ -285,7 +282,7 @@ /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); return_ACPI_STATUS (AE_OK); } @@ -296,9 +293,8 @@ * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -311,14 +307,14 @@ acpi_rs_fixed_io_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer = *output_buffer; u16 temp16 = 0; u8 temp8 = 0; - FUNCTION_TRACE ("Rs_fixed_io_stream"); + ACPI_FUNCTION_TRACE ("Rs_fixed_io_stream"); /* @@ -333,7 +329,7 @@ */ temp16 = (u16) linked_list->data.fixed_io.base_address; - MOVE_UNALIGNED16_TO_16 (buffer, &temp16); + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16); buffer += 2; /* @@ -347,7 +343,7 @@ /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); return_ACPI_STATUS (AE_OK); } @@ -358,13 +354,12 @@ * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -377,19 +372,19 @@ acpi_status acpi_rs_dma_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { u8 *buffer = byte_stream_buffer; - acpi_resource *output_struct = (acpi_resource *) *output_buffer; + acpi_resource *output_struct = (void *) *output_buffer; u8 temp8 = 0; u8 index; u8 i; - u32 struct_size = SIZEOF_RESOURCE (acpi_resource_dma); + ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_dma); - FUNCTION_TRACE ("Rs_dma_resource"); + ACPI_FUNCTION_TRACE ("Rs_dma_resource"); /* @@ -412,13 +407,18 @@ i++; } } + if (i == 0) { + /* Zero channels is invalid! */ + + return_ACPI_STATUS (AE_BAD_DATA); + } output_struct->data.dma.number_of_channels = i; /* * Calculate the structure size based upon the number of interrupts */ - struct_size += (output_struct->data.dma.number_of_channels - 1) * 4; + struct_size += ((ACPI_SIZE) output_struct->data.dma.number_of_channels - 1) * 4; /* * Point to Byte 2 @@ -448,7 +448,7 @@ /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -464,9 +464,8 @@ * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -479,7 +478,7 @@ acpi_rs_dma_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer = *output_buffer; u16 temp16 = 0; @@ -487,7 +486,7 @@ u8 index; - FUNCTION_TRACE ("Rs_dma_stream"); + ACPI_FUNCTION_TRACE ("Rs_dma_stream"); /* @@ -523,7 +522,7 @@ /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); return_ACPI_STATUS (AE_OK); } diff -urN linux-2.4.18/drivers/acpi/resources/rsirq.c lia64-2.4/drivers/acpi/resources/rsirq.c --- linux-2.4.18/drivers/acpi/resources/rsirq.c Mon Sep 24 15:06:46 2001 +++ lia64-2.4/drivers/acpi/resources/rsirq.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: rsirq - IRQ resource descriptors - * $Revision: 18 $ + * $Revision: 28 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #include "acresrc.h" #define _COMPONENT ACPI_RESOURCES - MODULE_NAME ("rsirq") + ACPI_MODULE_NAME ("rsirq") /******************************************************************************* @@ -37,13 +37,12 @@ * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -56,20 +55,20 @@ acpi_status acpi_rs_irq_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { u8 *buffer = byte_stream_buffer; - acpi_resource *output_struct = (acpi_resource *) *output_buffer; + acpi_resource *output_struct = (void *) *output_buffer; u16 temp16 = 0; u8 temp8 = 0; u8 index; u8 i; - u32 struct_size = SIZEOF_RESOURCE (acpi_resource_irq); + ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_irq); - FUNCTION_TRACE ("Rs_irq_resource"); + ACPI_FUNCTION_TRACE ("Rs_irq_resource"); /* @@ -84,24 +83,30 @@ * Point to the 16-bits of Bytes 1 and 2 */ buffer += 1; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); output_struct->data.irq.number_of_interrupts = 0; /* Decode the IRQ bits */ for (i = 0, index = 0; index < 16; index++) { - if((temp16 >> index) & 0x01) { + if ((temp16 >> index) & 0x01) { output_struct->data.irq.interrupts[i] = index; i++; } } + + if (i == 0) { + /* Zero interrupts is invalid! */ + + return_ACPI_STATUS (AE_BAD_DATA); + } output_struct->data.irq.number_of_interrupts = i; /* * Calculate the structure size based upon the number of interrupts */ - struct_size += (output_struct->data.irq.number_of_interrupts - 1) * 4; + struct_size += ((ACPI_SIZE) output_struct->data.irq.number_of_interrupts - 1) * 4; /* * Point to Byte 3 if it is used @@ -114,16 +119,14 @@ * Check for HE, LL or HL */ if (temp8 & 0x01) { - output_struct->data.irq.edge_level = EDGE_SENSITIVE; - output_struct->data.irq.active_high_low = ACTIVE_HIGH; + output_struct->data.irq.edge_level = ACPI_EDGE_SENSITIVE; + output_struct->data.irq.active_high_low = ACPI_ACTIVE_HIGH; } - else { if (temp8 & 0x8) { - output_struct->data.irq.edge_level = LEVEL_SENSITIVE; - output_struct->data.irq.active_high_low = ACTIVE_LOW; + output_struct->data.irq.edge_level = ACPI_LEVEL_SENSITIVE; + output_struct->data.irq.active_high_low = ACPI_ACTIVE_LOW; } - else { /* * Only _LL and _HE polarity/trigger interrupts @@ -139,21 +142,20 @@ */ output_struct->data.irq.shared_exclusive = (temp8 >> 3) & 0x01; } - else { /* * Assume Edge Sensitive, Active High, Non-Sharable * per ACPI Specification */ - output_struct->data.irq.edge_level = EDGE_SENSITIVE; - output_struct->data.irq.active_high_low = ACTIVE_HIGH; - output_struct->data.irq.shared_exclusive = EXCLUSIVE; + output_struct->data.irq.edge_level = ACPI_EDGE_SENSITIVE; + output_struct->data.irq.active_high_low = ACPI_ACTIVE_HIGH; + output_struct->data.irq.shared_exclusive = ACPI_EXCLUSIVE; } /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -169,9 +171,8 @@ * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -184,7 +185,7 @@ acpi_rs_irq_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer = *output_buffer; u16 temp16 = 0; @@ -193,20 +194,19 @@ u8 IRQinfo_byte_needed; - FUNCTION_TRACE ("Rs_irq_stream"); + ACPI_FUNCTION_TRACE ("Rs_irq_stream"); /* * The descriptor field is set based upon whether a third byte is * needed to contain the IRQ Information. */ - if (EDGE_SENSITIVE == linked_list->data.irq.edge_level && - ACTIVE_HIGH == linked_list->data.irq.active_high_low && - EXCLUSIVE == linked_list->data.irq.shared_exclusive) { + if (ACPI_EDGE_SENSITIVE == linked_list->data.irq.edge_level && + ACPI_ACTIVE_HIGH == linked_list->data.irq.active_high_low && + ACPI_EXCLUSIVE == linked_list->data.irq.shared_exclusive) { *buffer = 0x22; IRQinfo_byte_needed = FALSE; } - else { *buffer = 0x23; IRQinfo_byte_needed = TRUE; @@ -225,7 +225,7 @@ temp16 |= 0x1 << temp8; } - MOVE_UNALIGNED16_TO_16 (buffer, &temp16); + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16); buffer += 2; /* @@ -236,11 +236,10 @@ temp8 = (u8) ((linked_list->data.irq.shared_exclusive & 0x01) << 4); - if (LEVEL_SENSITIVE == linked_list->data.irq.edge_level && - ACTIVE_LOW == linked_list->data.irq.active_high_low) { + if (ACPI_LEVEL_SENSITIVE == linked_list->data.irq.edge_level && + ACPI_ACTIVE_LOW == linked_list->data.irq.active_high_low) { temp8 |= 0x08; } - else { temp8 |= 0x01; } @@ -252,7 +251,7 @@ /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); return_ACPI_STATUS (AE_OK); } @@ -263,13 +262,12 @@ * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -282,27 +280,27 @@ acpi_status acpi_rs_extended_irq_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { u8 *buffer = byte_stream_buffer; - acpi_resource *output_struct = (acpi_resource *) *output_buffer; + acpi_resource *output_struct = (void *) *output_buffer; u16 temp16 = 0; u8 temp8 = 0; - NATIVE_CHAR *temp_ptr; + u8 *temp_ptr; u8 index; - u32 struct_size = SIZEOF_RESOURCE (acpi_resource_ext_irq); + ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_ext_irq); - FUNCTION_TRACE ("Rs_extended_irq_resource"); + ACPI_FUNCTION_TRACE ("Rs_extended_irq_resource"); /* * Point past the Descriptor to get the number of bytes consumed */ buffer += 1; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); *bytes_consumed = temp16 + 3; output_struct->id = ACPI_RSTYPE_EXT_IRQ; @@ -316,28 +314,20 @@ output_struct->data.extended_irq.producer_consumer = temp8 & 0x01; /* - * Check for HE, LL or HL + * Check for Interrupt Mode + * + * The definition of an Extended IRQ changed between ACPI spec v1.0b + * and ACPI spec 2.0 (section 6.4.3.6 in both). + * + * - Edge/Level are defined opposite in the table vs the headers */ - if(temp8 & 0x02) { - output_struct->data.extended_irq.edge_level = EDGE_SENSITIVE; - output_struct->data.extended_irq.active_high_low = ACTIVE_HIGH; - } - - else { - if(temp8 & 0x4) { - output_struct->data.extended_irq.edge_level = LEVEL_SENSITIVE; - output_struct->data.extended_irq.active_high_low = ACTIVE_LOW; - } + output_struct->data.extended_irq.edge_level = + (temp8 & 0x2) ? ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE; - else { - /* - * Only _LL and _HE polarity/trigger interrupts - * are allowed (ACPI spec v1.0b ection 6.4.2.1), - * so an error will occur if we reach this point - */ - return_ACPI_STATUS (AE_BAD_DATA); - } - } + /* + * Check Interrupt Polarity + */ + output_struct->data.extended_irq.active_high_low = (temp8 >> 2) & 0x1; /* * Check for sharable @@ -367,8 +357,8 @@ * Cycle through every IRQ in the table */ for (index = 0; index < temp8; index++) { - output_struct->data.extended_irq.interrupts[index] = - (u32)*buffer; + ACPI_MOVE_UNALIGNED32_TO_32 ( + &output_struct->data.extended_irq.interrupts[index], buffer); /* Point to the next IRQ */ @@ -383,7 +373,7 @@ * stream that are default. */ if (*bytes_consumed > - (u32)(output_struct->data.extended_irq.number_of_interrupts * 4) + 5) { + ((ACPI_SIZE) output_struct->data.extended_irq.number_of_interrupts * 4) + 5) { /* Dereference the Index */ temp8 = *buffer; @@ -399,12 +389,11 @@ output_struct->data.extended_irq.resource_source.string_ptr = (NATIVE_CHAR *)(output_struct + struct_size); - temp_ptr = output_struct->data.extended_irq.resource_source.string_ptr; + temp_ptr = (u8 *) output_struct->data.extended_irq.resource_source.string_ptr; /* Copy the string into the buffer */ index = 0; - while (0x00 != *buffer) { *temp_ptr = *buffer; @@ -425,9 +414,8 @@ * Struct_size to the next 32-bit boundary. */ temp8 = (u8) (index + 1); - struct_size += ROUND_UP_TO_32_bITS (temp8); + struct_size += ACPI_ROUND_UP_TO_32_bITS (temp8); } - else { output_struct->data.extended_irq.resource_source.index = 0x00; output_struct->data.extended_irq.resource_source.string_length = 0; @@ -437,7 +425,7 @@ /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -453,9 +441,8 @@ * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -468,7 +455,7 @@ acpi_rs_extended_irq_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer = *output_buffer; u16 *length_field; @@ -477,7 +464,7 @@ NATIVE_CHAR *temp_pointer = NULL; - FUNCTION_TRACE ("Rs_extended_irq_stream"); + ACPI_FUNCTION_TRACE ("Rs_extended_irq_stream"); /* @@ -489,7 +476,7 @@ /* * Set a pointer to the Length field - to be filled in later */ - length_field = (u16 *)buffer; + length_field = ACPI_CAST_PTR (u16, buffer); buffer += 2; /* @@ -498,14 +485,24 @@ temp8 = (u8)(linked_list->data.extended_irq.producer_consumer & 0x01); temp8 |= ((linked_list->data.extended_irq.shared_exclusive & 0x01) << 3); - if (LEVEL_SENSITIVE == linked_list->data.extended_irq.edge_level && - ACTIVE_LOW == linked_list->data.extended_irq.active_high_low) { - temp8 |= 0x04; - } - else { - temp8 |= 0x02; + /* + * Set the Interrupt Mode + * + * The definition of an Extended IRQ changed between ACPI spec v1.0b + * and ACPI spec 2.0 (section 6.4.3.6 in both). This code does not + * implement the more restrictive definition of 1.0b + * + * - Edge/Level are defined opposite in the table vs the headers + */ + if (ACPI_EDGE_SENSITIVE == linked_list->data.extended_irq.edge_level) { + temp8 |= 0x2; } + /* + * Set the Interrupt Polarity + */ + temp8 |= ((linked_list->data.extended_irq.active_high_low & 0x1) << 2); + *buffer = temp8; buffer += 1; @@ -519,7 +516,7 @@ for (index = 0; index < linked_list->data.extended_irq.number_of_interrupts; index++) { - MOVE_UNALIGNED32_TO_32 (buffer, + ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.extended_irq.interrupts[index]); buffer += 4; } @@ -536,20 +533,20 @@ /* * Copy the string */ - STRCPY (temp_pointer, + ACPI_STRCPY (temp_pointer, linked_list->data.extended_irq.resource_source.string_ptr); /* * Buffer needs to be set to the length of the sting + one for the * terminating null */ - buffer += (STRLEN (linked_list->data.extended_irq.resource_source.string_ptr) + 1); + buffer += (ACPI_STRLEN (linked_list->data.extended_irq.resource_source.string_ptr) + 1); } /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); /* * Set the length field to the number of bytes consumed diff -urN linux-2.4.18/drivers/acpi/resources/rslist.c lia64-2.4/drivers/acpi/resources/rslist.c --- linux-2.4.18/drivers/acpi/resources/rslist.c Mon Sep 24 15:06:46 2001 +++ lia64-2.4/drivers/acpi/resources/rslist.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: rslist - Linked list utilities - * $Revision: 19 $ + * $Revision: 30 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #include "acresrc.h" #define _COMPONENT ACPI_RESOURCES - MODULE_NAME ("rslist") + ACPI_MODULE_NAME ("rslist") /******************************************************************************* @@ -49,28 +49,31 @@ u8 resource_start_byte) { - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* * Determine if this is a small or large resource */ - switch (resource_start_byte & RESOURCE_DESC_TYPE_MASK) { - case RESOURCE_DESC_TYPE_SMALL: + switch (resource_start_byte & ACPI_RDESC_TYPE_MASK) { + case ACPI_RDESC_TYPE_SMALL: /* * Small Resource Type -- Only bits 6:3 are valid */ - return ((u8) (resource_start_byte & RESOURCE_DESC_SMALL_MASK)); - break; + return ((u8) (resource_start_byte & ACPI_RDESC_SMALL_MASK)); - case RESOURCE_DESC_TYPE_LARGE: + case ACPI_RDESC_TYPE_LARGE: /* * Large Resource Type -- All bits are valid */ return (resource_start_byte); + + + default: + /* No other types of resource descriptor */ break; } @@ -98,183 +101,182 @@ acpi_rs_byte_stream_to_list ( u8 *byte_stream_buffer, u32 byte_stream_buffer_length, - u8 **output_buffer) + u8 *output_buffer) { acpi_status status; - u32 bytes_parsed = 0; + ACPI_SIZE bytes_parsed = 0; u8 resource_type = 0; - u32 bytes_consumed = 0; - u8 **buffer = output_buffer; - u32 structure_size = 0; + ACPI_SIZE bytes_consumed = 0; + u8 *buffer = output_buffer; + ACPI_SIZE structure_size = 0; u8 end_tag_processed = FALSE; + acpi_resource *resource; - - FUNCTION_TRACE ("Rs_byte_stream_to_list"); + ACPI_FUNCTION_TRACE ("Rs_byte_stream_to_list"); while (bytes_parsed < byte_stream_buffer_length && - FALSE == end_tag_processed) { + !end_tag_processed) { /* * The next byte in the stream is the resource type */ resource_type = acpi_rs_get_resource_type (*byte_stream_buffer); switch (resource_type) { - case RESOURCE_DESC_MEMORY_24: + case ACPI_RDESC_TYPE_MEMORY_24: /* * 24-Bit Memory Resource */ status = acpi_rs_memory24_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_LARGE_VENDOR: + case ACPI_RDESC_TYPE_LARGE_VENDOR: /* * Vendor Defined Resource */ status = acpi_rs_vendor_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_MEMORY_32: + case ACPI_RDESC_TYPE_MEMORY_32: /* * 32-Bit Memory Range Resource */ status = acpi_rs_memory32_range_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_FIXED_MEMORY_32: + case ACPI_RDESC_TYPE_FIXED_MEMORY_32: /* * 32-Bit Fixed Memory Resource */ status = acpi_rs_fixed_memory32_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_QWORD_ADDRESS_SPACE: + case ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE: /* * 64-Bit Address Resource */ status = acpi_rs_address64_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_DWORD_ADDRESS_SPACE: + case ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE: /* * 32-Bit Address Resource */ status = acpi_rs_address32_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_WORD_ADDRESS_SPACE: + case ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE: /* * 16-Bit Address Resource */ status = acpi_rs_address16_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_EXTENDED_XRUPT: + case ACPI_RDESC_TYPE_EXTENDED_XRUPT: /* * Extended IRQ */ status = acpi_rs_extended_irq_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_IRQ_FORMAT: + case ACPI_RDESC_TYPE_IRQ_FORMAT: /* * IRQ Resource */ status = acpi_rs_irq_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_DMA_FORMAT: + case ACPI_RDESC_TYPE_DMA_FORMAT: /* * DMA Resource */ status = acpi_rs_dma_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_START_DEPENDENT: + case ACPI_RDESC_TYPE_START_DEPENDENT: /* * Start Dependent Functions Resource */ - status = acpi_rs_start_dependent_functions_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + status = acpi_rs_start_depend_fns_resource (byte_stream_buffer, + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_END_DEPENDENT: + case ACPI_RDESC_TYPE_END_DEPENDENT: /* * End Dependent Functions Resource */ - status = acpi_rs_end_dependent_functions_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + status = acpi_rs_end_depend_fns_resource (byte_stream_buffer, + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_IO_PORT: + case ACPI_RDESC_TYPE_IO_PORT: /* * IO Port Resource */ status = acpi_rs_io_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_FIXED_IO_PORT: + case ACPI_RDESC_TYPE_FIXED_IO_PORT: /* * Fixed IO Port Resource */ status = acpi_rs_fixed_io_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_SMALL_VENDOR: + case ACPI_RDESC_TYPE_SMALL_VENDOR: /* * Vendor Specific Resource */ status = acpi_rs_vendor_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; - case RESOURCE_DESC_END_TAG: + case ACPI_RDESC_TYPE_END_TAG: /* * End Tag */ end_tag_processed = TRUE; status = acpi_rs_end_tag_resource (byte_stream_buffer, - &bytes_consumed, buffer, &structure_size); + &bytes_consumed, &buffer, &structure_size); break; default: /* - * Invalid/Unknowns resource type + * Invalid/Unknown resource type */ - status = AE_AML_ERROR; + status = AE_AML_INVALID_RESOURCE_TYPE; break; } - - if (!ACPI_SUCCESS(status)) { + if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -291,15 +293,17 @@ /* * Set the Buffer to the next structure */ - *buffer += structure_size; + resource = ACPI_CAST_PTR (acpi_resource, buffer); + resource->length = ACPI_ALIGN_RESOURCE_SIZE(resource->length); + buffer += ACPI_ALIGN_RESOURCE_SIZE(structure_size); } /* end while */ /* * Check the reason for exiting the while loop */ - if (TRUE != end_tag_processed) { - return_ACPI_STATUS (AE_AML_ERROR); + if (!end_tag_processed) { + return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); } return_ACPI_STATUS (AE_OK); @@ -313,7 +317,7 @@ * PARAMETERS: Linked_list - Pointer to the resource linked list * Byte_steam_size_needed - Calculated size of the byte stream * needed from calling - * Acpi_rs_calculate_byte_stream_length() + * Acpi_rs_get_byte_stream_length() * The size of the Output_buffer is * guaranteed to be >= * Byte_stream_size_needed @@ -330,16 +334,16 @@ acpi_status acpi_rs_list_to_byte_stream ( acpi_resource *linked_list, - u32 byte_stream_size_needed, - u8 **output_buffer) + ACPI_SIZE byte_stream_size_needed, + u8 *output_buffer) { acpi_status status; - u8 *buffer = *output_buffer; - u32 bytes_consumed = 0; + u8 *buffer = output_buffer; + ACPI_SIZE bytes_consumed = 0; u8 done = FALSE; - FUNCTION_TRACE ("Rs_list_to_byte_stream"); + ACPI_FUNCTION_TRACE ("Rs_list_to_byte_stream"); while (!done) { @@ -362,7 +366,7 @@ /* * Start Dependent Functions Resource */ - status = acpi_rs_start_dependent_functions_stream (linked_list, + status = acpi_rs_start_depend_fns_stream (linked_list, &buffer, &bytes_consumed); break; @@ -370,7 +374,7 @@ /* * End Dependent Functions Resource */ - status = acpi_rs_end_dependent_functions_stream (linked_list, + status = acpi_rs_end_depend_fns_stream (linked_list, &buffer, &bytes_consumed); break; @@ -472,8 +476,7 @@ } /* switch (Linked_list->Id) */ - - if (!ACPI_SUCCESS(status)) { + if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -485,7 +488,7 @@ /* * Point to the next object */ - linked_list = POINTER_ADD (acpi_resource, + linked_list = ACPI_PTR_ADD (acpi_resource, linked_list, linked_list->length); } diff -urN linux-2.4.18/drivers/acpi/resources/rsmemory.c lia64-2.4/drivers/acpi/resources/rsmemory.c --- linux-2.4.18/drivers/acpi/resources/rsmemory.c Mon Sep 24 15:06:46 2001 +++ lia64-2.4/drivers/acpi/resources/rsmemory.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: rsmem24 - Memory resource descriptors - * $Revision: 14 $ + * $Revision: 20 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #include "acresrc.h" #define _COMPONENT ACPI_RESOURCES - MODULE_NAME ("rsmemory") + ACPI_MODULE_NAME ("rsmemory") /******************************************************************************* @@ -37,13 +37,12 @@ * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -56,18 +55,18 @@ acpi_status acpi_rs_memory24_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { u8 *buffer = byte_stream_buffer; - acpi_resource *output_struct = (acpi_resource *) *output_buffer; + acpi_resource *output_struct = (void *) *output_buffer; u16 temp16 = 0; u8 temp8 = 0; - u32 struct_size = SIZEOF_RESOURCE (acpi_resource_mem24); + ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_mem24); - FUNCTION_TRACE ("Rs_memory24_resource"); + ACPI_FUNCTION_TRACE ("Rs_memory24_resource"); /* @@ -75,9 +74,9 @@ */ buffer += 1; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); buffer += 2; - *bytes_consumed = temp16 + 3; + *bytes_consumed = (ACPI_SIZE) temp16 + 3; output_struct->id = ACPI_RSTYPE_MEM24; /* @@ -90,34 +89,34 @@ /* * Get Min_base_address (Bytes 4-5) */ - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); buffer += 2; output_struct->data.memory24.min_base_address = temp16; /* * Get Max_base_address (Bytes 6-7) */ - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); buffer += 2; output_struct->data.memory24.max_base_address = temp16; /* * Get Alignment (Bytes 8-9) */ - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); buffer += 2; output_struct->data.memory24.alignment = temp16; /* * Get Range_length (Bytes 10-11) */ - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); output_struct->data.memory24.range_length = temp16; /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -133,9 +132,8 @@ * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -148,14 +146,14 @@ acpi_rs_memory24_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer = *output_buffer; u16 temp16 = 0; u8 temp8 = 0; - FUNCTION_TRACE ("Rs_memory24_stream"); + ACPI_FUNCTION_TRACE ("Rs_memory24_stream"); /* @@ -168,7 +166,7 @@ * The length field is static */ temp16 = 0x09; - MOVE_UNALIGNED16_TO_16 (buffer, &temp16); + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16); buffer += 2; /* @@ -181,31 +179,31 @@ /* * Set the Range minimum base address */ - MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.min_base_address); + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.min_base_address); buffer += 2; /* * Set the Range maximum base address */ - MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.max_base_address); + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.max_base_address); buffer += 2; /* * Set the base alignment */ - MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.alignment); + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.alignment); buffer += 2; /* * Set the range length */ - MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.range_length); + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.range_length); buffer += 2; /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); return_ACPI_STATUS (AE_OK); } @@ -216,13 +214,12 @@ * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -235,18 +232,18 @@ acpi_status acpi_rs_memory32_range_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { u8 *buffer = byte_stream_buffer; - acpi_resource *output_struct = (acpi_resource *) *output_buffer; + acpi_resource *output_struct = (void *) *output_buffer; u16 temp16 = 0; u8 temp8 = 0; - u32 struct_size = SIZEOF_RESOURCE (acpi_resource_mem32); + ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_mem32); - FUNCTION_TRACE ("Rs_memory32_range_resource"); + ACPI_FUNCTION_TRACE ("Rs_memory32_range_resource"); /* @@ -254,9 +251,9 @@ */ buffer += 1; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); buffer += 2; - *bytes_consumed = temp16 + 3; + *bytes_consumed = (ACPI_SIZE) temp16 + 3; output_struct->id = ACPI_RSTYPE_MEM32; @@ -281,32 +278,32 @@ /* * Get Min_base_address (Bytes 4-7) */ - MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.min_base_address, + ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.min_base_address, buffer); buffer += 4; /* * Get Max_base_address (Bytes 8-11) */ - MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.max_base_address, + ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.max_base_address, buffer); buffer += 4; /* * Get Alignment (Bytes 12-15) */ - MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.alignment, buffer); + ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.alignment, buffer); buffer += 4; /* * Get Range_length (Bytes 16-19) */ - MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.range_length, buffer); + ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.range_length, buffer); /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -322,13 +319,12 @@ * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -341,28 +337,28 @@ acpi_status acpi_rs_fixed_memory32_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { u8 *buffer = byte_stream_buffer; - acpi_resource *output_struct = (acpi_resource *) *output_buffer; + acpi_resource *output_struct = (void *) *output_buffer; u16 temp16 = 0; u8 temp8 = 0; - u32 struct_size = SIZEOF_RESOURCE (acpi_resource_fixed_mem32); + ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_fixed_mem32); - FUNCTION_TRACE ("Rs_fixed_memory32_resource"); + ACPI_FUNCTION_TRACE ("Rs_fixed_memory32_resource"); /* * Point past the Descriptor to get the number of bytes consumed */ buffer += 1; - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); buffer += 2; - *bytes_consumed = temp16 + 3; + *bytes_consumed = (ACPI_SIZE) temp16 + 3; output_struct->id = ACPI_RSTYPE_FIXED_MEM32; @@ -376,20 +372,20 @@ /* * Get Range_base_address (Bytes 4-7) */ - MOVE_UNALIGNED32_TO_32 (&output_struct->data.fixed_memory32.range_base_address, + ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.fixed_memory32.range_base_address, buffer); buffer += 4; /* * Get Range_length (Bytes 8-11) */ - MOVE_UNALIGNED32_TO_32 (&output_struct->data.fixed_memory32.range_length, + ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.fixed_memory32.range_length, buffer); /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -405,9 +401,8 @@ * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -420,14 +415,14 @@ acpi_rs_memory32_range_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer = *output_buffer; u16 temp16 = 0; u8 temp8 = 0; - FUNCTION_TRACE ("Rs_memory32_range_stream"); + ACPI_FUNCTION_TRACE ("Rs_memory32_range_stream"); /* @@ -441,7 +436,7 @@ */ temp16 = 0x11; - MOVE_UNALIGNED16_TO_16 (buffer, &temp16); + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16); buffer += 2; /* @@ -454,31 +449,31 @@ /* * Set the Range minimum base address */ - MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.min_base_address); + ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.min_base_address); buffer += 4; /* * Set the Range maximum base address */ - MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.max_base_address); + ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.max_base_address); buffer += 4; /* * Set the base alignment */ - MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.alignment); + ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.alignment); buffer += 4; /* * Set the range length */ - MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.range_length); + ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.range_length); buffer += 4; /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); return_ACPI_STATUS (AE_OK); } @@ -489,9 +484,8 @@ * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -504,14 +498,14 @@ acpi_rs_fixed_memory32_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer = *output_buffer; u16 temp16 = 0; u8 temp8 = 0; - FUNCTION_TRACE ("Rs_fixed_memory32_stream"); + ACPI_FUNCTION_TRACE ("Rs_fixed_memory32_stream"); /* @@ -525,7 +519,7 @@ */ temp16 = 0x09; - MOVE_UNALIGNED16_TO_16 (buffer, &temp16); + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16); buffer += 2; /* @@ -538,21 +532,21 @@ /* * Set the Range base address */ - MOVE_UNALIGNED32_TO_32 (buffer, + ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.fixed_memory32.range_base_address); buffer += 4; /* * Set the range length */ - MOVE_UNALIGNED32_TO_32 (buffer, + ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.fixed_memory32.range_length); buffer += 4; /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); return_ACPI_STATUS (AE_OK); } diff -urN linux-2.4.18/drivers/acpi/resources/rsmisc.c lia64-2.4/drivers/acpi/resources/rsmisc.c --- linux-2.4.18/drivers/acpi/resources/rsmisc.c Mon Sep 24 15:06:46 2001 +++ lia64-2.4/drivers/acpi/resources/rsmisc.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: rsmisc - Miscellaneous resource descriptors - * $Revision: 16 $ + * $Revision: 24 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #include "acresrc.h" #define _COMPONENT ACPI_RESOURCES - MODULE_NAME ("rsmisc") + ACPI_MODULE_NAME ("rsmisc") /******************************************************************************* @@ -37,13 +37,12 @@ * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -56,15 +55,15 @@ acpi_status acpi_rs_end_tag_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { - acpi_resource *output_struct = (acpi_resource *) *output_buffer; - u32 struct_size = ACPI_RESOURCE_LENGTH; + acpi_resource *output_struct = (void *) *output_buffer; + ACPI_SIZE struct_size = ACPI_RESOURCE_LENGTH; - FUNCTION_TRACE ("Rs_end_tag_resource"); + ACPI_FUNCTION_TRACE ("Rs_end_tag_resource"); /* @@ -96,9 +95,8 @@ * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -111,13 +109,13 @@ acpi_rs_end_tag_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer = *output_buffer; u8 temp8 = 0; - FUNCTION_TRACE ("Rs_end_tag_stream"); + ACPI_FUNCTION_TRACE ("Rs_end_tag_stream"); /* @@ -138,7 +136,7 @@ /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); return_ACPI_STATUS (AE_OK); } @@ -149,13 +147,12 @@ * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -168,19 +165,19 @@ acpi_status acpi_rs_vendor_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { u8 *buffer = byte_stream_buffer; - acpi_resource *output_struct = (acpi_resource *) *output_buffer; + acpi_resource *output_struct = (void *) *output_buffer; u16 temp16 = 0; u8 temp8 = 0; u8 index; - u32 struct_size = SIZEOF_RESOURCE (acpi_resource_vendor); + ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_vendor); - FUNCTION_TRACE ("Rs_vendor_resource"); + ACPI_FUNCTION_TRACE ("Rs_vendor_resource"); /* @@ -190,34 +187,31 @@ if (temp8 & 0x80) { /* - * Large Item - * Point to the length field + * Large Item, point to the length field */ buffer += 1; /* Dereference */ - MOVE_UNALIGNED16_TO_16 (&temp16, buffer); + ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer); /* Calculate bytes consumed */ - *bytes_consumed = temp16 + 3; + *bytes_consumed = (ACPI_SIZE) temp16 + 3; /* Point to the first vendor byte */ buffer += 2; } - else { /* - * Small Item - * Dereference the size + * Small Item, dereference the size */ temp16 = (u8)(*buffer & 0x07); /* Calculate bytes consumed */ - *bytes_consumed = temp16 + 1; + *bytes_consumed = (ACPI_SIZE) temp16 + 1; /* Point to the first vendor byte */ @@ -237,12 +231,12 @@ * calculate the length of the vendor string and expand the * Struct_size to the next 32-bit boundary. */ - struct_size += ROUND_UP_TO_32_bITS (temp16); + struct_size += ACPI_ROUND_UP_TO_32_bITS (temp16); /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -258,9 +252,8 @@ * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -273,7 +266,7 @@ acpi_rs_vendor_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer = *output_buffer; u16 temp16 = 0; @@ -281,7 +274,7 @@ u8 index; - FUNCTION_TRACE ("Rs_vendor_stream"); + ACPI_FUNCTION_TRACE ("Rs_vendor_stream"); /* @@ -289,25 +282,22 @@ */ if(linked_list->data.vendor_specific.length > 7) { /* - * Large Item - * Set the descriptor field and length bytes + * Large Item, Set the descriptor field and length bytes */ *buffer = 0x84; buffer += 1; temp16 = (u16) linked_list->data.vendor_specific.length; - MOVE_UNALIGNED16_TO_16 (buffer, &temp16); + ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16); buffer += 2; } - else { /* - * Small Item - * Set the descriptor field + * Small Item, Set the descriptor field */ temp8 = 0x70; - temp8 |= linked_list->data.vendor_specific.length; + temp8 |= (u8) linked_list->data.vendor_specific.length; *buffer = temp8; buffer += 1; @@ -326,24 +316,23 @@ /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); return_ACPI_STATUS (AE_OK); } /******************************************************************************* * - * FUNCTION: Acpi_rs_start_dependent_functions_resource + * FUNCTION: Acpi_rs_start_depend_fns_resource * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -354,19 +343,19 @@ ******************************************************************************/ acpi_status -acpi_rs_start_dependent_functions_resource ( +acpi_rs_start_depend_fns_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { u8 *buffer = byte_stream_buffer; - acpi_resource *output_struct = (acpi_resource *) *output_buffer; + acpi_resource *output_struct = (void *) *output_buffer; u8 temp8 = 0; - u32 struct_size = SIZEOF_RESOURCE (acpi_resource_start_dpf); + ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_start_dpf); - FUNCTION_TRACE ("Rs_start_dependent_functions_resource"); + ACPI_FUNCTION_TRACE ("Rs_start_depend_fns_resource"); /* @@ -391,7 +380,7 @@ output_struct->data.start_dpf.compatibility_priority = temp8 & 0x03; if (3 == output_struct->data.start_dpf.compatibility_priority) { - return_ACPI_STATUS (AE_AML_ERROR); + return_ACPI_STATUS (AE_AML_BAD_RESOURCE_VALUE); } /* @@ -400,22 +389,21 @@ output_struct->data.start_dpf.performance_robustness = (temp8 >> 2) & 0x03; if (3 == output_struct->data.start_dpf.performance_robustness) { - return_ACPI_STATUS (AE_AML_ERROR); + return_ACPI_STATUS (AE_AML_BAD_RESOURCE_VALUE); } } - else { output_struct->data.start_dpf.compatibility_priority = - ACCEPTABLE_CONFIGURATION; + ACPI_ACCEPTABLE_CONFIGURATION; output_struct->data.start_dpf.performance_robustness = - ACCEPTABLE_CONFIGURATION; + ACPI_ACCEPTABLE_CONFIGURATION; } /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -427,17 +415,16 @@ /******************************************************************************* * - * FUNCTION: Acpi_rs_end_dependent_functions_resource + * FUNCTION: Acpi_rs_end_depend_fns_resource * * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte * stream - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes consumed from - * the Byte_stream_buffer - * Output_buffer - Pointer to the user's return buffer - * Structure_size - u32 pointer that is filled with - * the number of bytes in the filled - * in structure + * Bytes_consumed - Pointer to where the number of bytes + * consumed the Byte_stream_buffer is + * returned + * Output_buffer - Pointer to the return data buffer + * Structure_size - Pointer to where the number of bytes + * in the return data struct is returned * * RETURN: Status * @@ -448,17 +435,17 @@ ******************************************************************************/ acpi_status -acpi_rs_end_dependent_functions_resource ( +acpi_rs_end_depend_fns_resource ( u8 *byte_stream_buffer, - u32 *bytes_consumed, + ACPI_SIZE *bytes_consumed, u8 **output_buffer, - u32 *structure_size) + ACPI_SIZE *structure_size) { - acpi_resource *output_struct = (acpi_resource *) *output_buffer; - u32 struct_size = ACPI_RESOURCE_LENGTH; + acpi_resource *output_struct = (void *) *output_buffer; + ACPI_SIZE struct_size = ACPI_RESOURCE_LENGTH; - FUNCTION_TRACE ("Rs_end_dependent_functions_resource"); + ACPI_FUNCTION_TRACE ("Rs_end_depend_fns_resource"); /* @@ -474,7 +461,7 @@ /* * Set the Length parameter */ - output_struct->length = struct_size; + output_struct->length = (u32) struct_size; /* * Return the final size of the structure @@ -486,7 +473,7 @@ /******************************************************************************* * - * FUNCTION: Acpi_rs_start_dependent_functions_stream + * FUNCTION: Acpi_rs_start_depend_fns_stream * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer @@ -502,25 +489,25 @@ ******************************************************************************/ acpi_status -acpi_rs_start_dependent_functions_stream ( +acpi_rs_start_depend_fns_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed) + ACPI_SIZE *bytes_consumed) { u8 *buffer = *output_buffer; u8 temp8 = 0; - FUNCTION_TRACE ("Rs_start_dependent_functions_stream"); + ACPI_FUNCTION_TRACE ("Rs_start_depend_fns_stream"); /* * The descriptor field is set based upon whether a byte is needed * to contain Priority data. */ - if (ACCEPTABLE_CONFIGURATION == + if (ACPI_ACCEPTABLE_CONFIGURATION == linked_list->data.start_dpf.compatibility_priority && - ACCEPTABLE_CONFIGURATION == + ACPI_ACCEPTABLE_CONFIGURATION == linked_list->data.start_dpf.performance_robustness) { *buffer = 0x30; } @@ -544,20 +531,19 @@ /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); return_ACPI_STATUS (AE_OK); } /******************************************************************************* * - * FUNCTION: Acpi_rs_end_dependent_functions_stream + * FUNCTION: Acpi_rs_end_depend_fns_stream * * PARAMETERS: Linked_list - Pointer to the resource linked list * Output_buffer - Pointer to the user's return buffer - * Bytes_consumed - u32 pointer that is filled with - * the number of bytes of the - * Output_buffer used + * Bytes_consumed - Pointer to where the number of bytes + * used in the Output_buffer is returned * * RETURN: Status * @@ -567,16 +553,15 @@ ******************************************************************************/ acpi_status -acpi_rs_end_dependent_functions_stream ( +acpi_rs_end_depend_fns_stream ( acpi_resource *linked_list, u8 **output_buffer, - u32 *bytes_consumed - ) + ACPI_SIZE *bytes_consumed) { u8 *buffer = *output_buffer; - FUNCTION_TRACE ("Rs_end_dependent_functions_stream"); + ACPI_FUNCTION_TRACE ("Rs_end_depend_fns_stream"); /* @@ -588,7 +573,7 @@ /* * Return the number of bytes consumed in this operation */ - *bytes_consumed = POINTER_DIFF (buffer, *output_buffer); + *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); return_ACPI_STATUS (AE_OK); } diff -urN linux-2.4.18/drivers/acpi/resources/rsutils.c lia64-2.4/drivers/acpi/resources/rsutils.c --- linux-2.4.18/drivers/acpi/resources/rsutils.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/resources/rsutils.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: rsutils - Utilities for the resource manager - * $Revision: 23 $ + * $Revision: 30 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ #define _COMPONENT ACPI_RESOURCES - MODULE_NAME ("rsutils") + ACPI_MODULE_NAME ("rsutils") /******************************************************************************* @@ -58,15 +58,12 @@ { acpi_operand_object *ret_obj; acpi_status status; - u32 buffer_space_needed; - FUNCTION_TRACE ("Rs_get_prt_method_data"); + ACPI_FUNCTION_TRACE ("Rs_get_prt_method_data"); - /* already validated params, so we won't repeat here */ - - buffer_space_needed = ret_buffer->length; + /* Parameters guaranteed valid by caller */ /* * Execute the method, no parameters @@ -83,34 +80,25 @@ return_ACPI_STATUS (AE_TYPE); } - /* - * The return object will be a package, so check the - * parameters. If the return object is not a package, - * then the underlying AML code is corrupt or improperly - * written. + * The return object will be a package, so check the parameters. If the + * return object is not a package, then the underlying AML code is corrupt + * or improperly written. */ if (ACPI_TYPE_PACKAGE != ret_obj->common.type) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_PRT did not return a Package, returned %s\n", + acpi_ut_get_type_name (ret_obj->common.type))); status = AE_AML_OPERAND_TYPE; goto cleanup; } /* - * Make the call to create a resource linked list from the - * byte stream buffer that comes back from the _CRS method - * execution. - */ - status = acpi_rs_create_pci_routing_table (ret_obj, ret_buffer->pointer, - &buffer_space_needed); - - /* - * Tell the user how much of the buffer we have used or is needed - * and return the final status. + * Create a resource linked list from the byte stream buffer that comes + * back from the _CRS method execution. */ - ret_buffer->length = buffer_space_needed; + status = acpi_rs_create_pci_routing_table (ret_obj, ret_buffer); - - /* On exit, we must delete the object returned by evaluate_object */ + /* On exit, we must delete the object returned by Evaluate_object */ cleanup: @@ -144,16 +132,15 @@ { acpi_operand_object *ret_obj; acpi_status status; - u32 buffer_space_needed = ret_buffer->length; - FUNCTION_TRACE ("Rs_get_crs_method_data"); + ACPI_FUNCTION_TRACE ("Rs_get_crs_method_data"); - /* already validated params, so we won't repeat here */ + /* Parameters guaranteed valid by caller */ /* - * Execute the method, no parameters + * Execute the method, no parameters */ status = acpi_ns_evaluate_relative (handle, "_CRS", NULL, &ret_obj); if (ACPI_FAILURE (status)) { @@ -169,30 +156,23 @@ /* * The return object will be a buffer, but check the - * parameters. If the return object is not a buffer, - * then the underlying AML code is corrupt or improperly - * written. + * parameters. If the return object is not a buffer, + * then the underlying AML code is corrupt or improperly + * written. */ if (ACPI_TYPE_BUFFER != ret_obj->common.type) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_CRS did not return a Buffer, returned %s\n", + acpi_ut_get_type_name (ret_obj->common.type))); status = AE_AML_OPERAND_TYPE; goto cleanup; } /* * Make the call to create a resource linked list from the - * byte stream buffer that comes back from the _CRS method - * execution. + * byte stream buffer that comes back from the _CRS method + * execution. */ - status = acpi_rs_create_resource_list (ret_obj, ret_buffer->pointer, - &buffer_space_needed); - - - /* - * Tell the user how much of the buffer we have used or is needed - * and return the final status. - */ - ret_buffer->length = buffer_space_needed; - + status = acpi_rs_create_resource_list (ret_obj, ret_buffer); /* On exit, we must delete the object returned by evaluate_object */ @@ -228,16 +208,15 @@ { acpi_operand_object *ret_obj; acpi_status status; - u32 buffer_space_needed = ret_buffer->length; - FUNCTION_TRACE ("Rs_get_prs_method_data"); + ACPI_FUNCTION_TRACE ("Rs_get_prs_method_data"); - /* already validated params, so we won't repeat here */ + /* Parameters guaranteed valid by caller */ /* - * Execute the method, no parameters + * Execute the method, no parameters */ status = acpi_ns_evaluate_relative (handle, "_PRS", NULL, &ret_obj); if (ACPI_FAILURE (status)) { @@ -253,29 +232,23 @@ /* * The return object will be a buffer, but check the - * parameters. If the return object is not a buffer, - * then the underlying AML code is corrupt or improperly - * written.. + * parameters. If the return object is not a buffer, + * then the underlying AML code is corrupt or improperly + * written.. */ if (ACPI_TYPE_BUFFER != ret_obj->common.type) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_PRS did not return a Buffer, returned %s\n", + acpi_ut_get_type_name (ret_obj->common.type))); status = AE_AML_OPERAND_TYPE; goto cleanup; } /* * Make the call to create a resource linked list from the - * byte stream buffer that comes back from the _CRS method - * execution. - */ - status = acpi_rs_create_resource_list (ret_obj, ret_buffer->pointer, - &buffer_space_needed); - - /* - * Tell the user how much of the buffer we have used or is needed - * and return the final status. + * byte stream buffer that comes back from the _CRS method + * execution. */ - ret_buffer->length = buffer_space_needed; - + status = acpi_rs_create_resource_list (ret_obj, ret_buffer); /* On exit, we must delete the object returned by evaluate_object */ @@ -311,50 +284,25 @@ { acpi_operand_object *params[2]; acpi_status status; - u8 *byte_stream = NULL; - u32 buffer_size_needed = 0; + acpi_buffer buffer; - FUNCTION_TRACE ("Rs_set_srs_method_data"); + ACPI_FUNCTION_TRACE ("Rs_set_srs_method_data"); - /* already validated params, so we won't repeat here */ + /* Parameters guaranteed valid by caller */ /* * The In_buffer parameter will point to a linked list of * resource parameters. It needs to be formatted into a - * byte stream to be sent in as an input parameter. - */ - buffer_size_needed = 0; - - /* - * First call is to get the buffer size needed - */ - status = acpi_rs_create_byte_stream (in_buffer->pointer, byte_stream, - &buffer_size_needed); - /* - * We expect a return of AE_BUFFER_OVERFLOW - * if not, exit with the error + * byte stream to be sent in as an input parameter to _SRS + * + * Convert the linked list into a byte stream */ - if (AE_BUFFER_OVERFLOW != status) { - return_ACPI_STATUS (status); - } - - /* - * Allocate the buffer needed - */ - byte_stream = ACPI_MEM_CALLOCATE (buffer_size_needed); - if (NULL == byte_stream) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - /* - * Now call to convert the linked list into a byte stream - */ - status = acpi_rs_create_byte_stream (in_buffer->pointer, byte_stream, - &buffer_size_needed); + buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; + status = acpi_rs_create_byte_stream (in_buffer->pointer, &buffer); if (ACPI_FAILURE (status)) { - goto cleanup; + return_ACPI_STATUS (status); } /* @@ -362,28 +310,26 @@ */ params[0] = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER); if (!params[0]) { - status = AE_NO_MEMORY; - goto cleanup; + acpi_os_free (buffer.pointer); + return_ACPI_STATUS (AE_NO_MEMORY); } - params [1] = NULL; /* - * Set up the parameter object + * Set up the parameter object */ - params[0]->buffer.length = buffer_size_needed; - params[0]->buffer.pointer = byte_stream; + params[0]->buffer.length = (u32) buffer.length; + params[0]->buffer.pointer = buffer.pointer; + params[1] = NULL; /* * Execute the method, no return value */ status = acpi_ns_evaluate_relative (handle, "_SRS", params, NULL); - acpi_ut_remove_reference (params[0]); /* * Clean up and return the status from Acpi_ns_evaluate_relative */ -cleanup: - + acpi_ut_remove_reference (params[0]); return_ACPI_STATUS (status); } diff -urN linux-2.4.18/drivers/acpi/resources/rsxface.c lia64-2.4/drivers/acpi/resources/rsxface.c --- linux-2.4.18/drivers/acpi/resources/rsxface.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/resources/rsxface.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: rsxface - Public interfaces to the resource manager - * $Revision: 15 $ + * $Revision: 19 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,12 +25,10 @@ #include "acpi.h" -#include "acinterp.h" -#include "acnamesp.h" #include "acresrc.h" #define _COMPONENT ACPI_RESOURCES - MODULE_NAME ("rsxface") + ACPI_MODULE_NAME ("rsxface") /******************************************************************************* @@ -64,7 +62,7 @@ acpi_status status; - FUNCTION_TRACE ("Acpi_get_irq_routing_table "); + ACPI_FUNCTION_TRACE ("Acpi_get_irq_routing_table "); /* @@ -73,12 +71,15 @@ * we also need a valid pointer in the buffer. If it's a zero buffer length, * we'll be returning the needed buffer size, so keep going. */ - if ((!device_handle) || - (!ret_buffer) || - ((!ret_buffer->pointer) && (ret_buffer->length))) { + if (!device_handle) { return_ACPI_STATUS (AE_BAD_PARAMETER); } + status = acpi_ut_validate_buffer (ret_buffer); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + status = acpi_rs_get_prt_method_data (device_handle, ret_buffer); return_ACPI_STATUS (status); } @@ -116,7 +117,7 @@ acpi_status status; - FUNCTION_TRACE ("Acpi_get_current_resources"); + ACPI_FUNCTION_TRACE ("Acpi_get_current_resources"); /* @@ -125,12 +126,15 @@ * we also need a valid pointer in the buffer. If it's a zero buffer length, * we'll be returning the needed buffer size, so keep going. */ - if ((!device_handle) || - (!ret_buffer) || - ((ret_buffer->length) && (!ret_buffer->pointer))) { + if (!device_handle) { return_ACPI_STATUS (AE_BAD_PARAMETER); } + status = acpi_ut_validate_buffer (ret_buffer); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + status = acpi_rs_get_crs_method_data (device_handle, ret_buffer); return_ACPI_STATUS (status); } @@ -165,7 +169,7 @@ acpi_status status; - FUNCTION_TRACE ("Acpi_get_possible_resources"); + ACPI_FUNCTION_TRACE ("Acpi_get_possible_resources"); /* @@ -174,12 +178,15 @@ * we also need a valid pointer in the buffer. If it's a zero buffer length, * we'll be returning the needed buffer size, so keep going. */ - if ((!device_handle) || - (!ret_buffer) || - ((ret_buffer->length) && (!ret_buffer->pointer))) { + if (!device_handle) { return_ACPI_STATUS (AE_BAD_PARAMETER); } + status = acpi_ut_validate_buffer (ret_buffer); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + status = acpi_rs_get_prs_method_data (device_handle, ret_buffer); return_ACPI_STATUS (status); } @@ -211,7 +218,7 @@ acpi_status status; - FUNCTION_TRACE ("Acpi_set_current_resources"); + ACPI_FUNCTION_TRACE ("Acpi_set_current_resources"); /* diff -urN linux-2.4.18/drivers/acpi/system.c lia64-2.4/drivers/acpi/system.c --- linux-2.4.18/drivers/acpi/system.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/system.c Tue Jun 11 14:24:23 2002 @@ -0,0 +1,1282 @@ +/* + * acpi_system.c - ACPI System Driver ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef __i386__ +#include +#endif +#include "acpi_bus.h" +#include "acpi_drivers.h" + +#ifdef CONFIG_X86 +#ifdef CONFIG_ACPI_SLEEP +#include +#endif +#endif + + +#define _COMPONENT ACPI_SYSTEM_COMPONENT +ACPI_MODULE_NAME ("acpi_system") + +#define PREFIX "ACPI: " + +extern FADT_DESCRIPTOR acpi_fadt; + +static int acpi_system_add (struct acpi_device *device); +static int acpi_system_remove (struct acpi_device *device, int type); + +static struct acpi_driver acpi_system_driver = { + name: ACPI_SYSTEM_DRIVER_NAME, + class: ACPI_SYSTEM_CLASS, + ids: ACPI_SYSTEM_HID, + ops: { + add: acpi_system_add, + remove: acpi_system_remove + }, +}; + +struct acpi_system +{ + acpi_handle handle; + u8 states[ACPI_S_STATE_COUNT]; +}; + +/* Global vars for handling event proc entry */ +static spinlock_t acpi_system_event_lock = SPIN_LOCK_UNLOCKED; +int event_is_open = 0; +extern struct list_head acpi_bus_event_list; +extern wait_queue_head_t acpi_bus_event_queue; + +/* -------------------------------------------------------------------------- + System Sleep + -------------------------------------------------------------------------- */ + +#ifdef CONFIG_PM + +static void +acpi_power_off (void) +{ + acpi_enter_sleep_state_prep(ACPI_STATE_S5); + ACPI_DISABLE_IRQS(); + acpi_enter_sleep_state(ACPI_STATE_S5); +} + +#endif /*CONFIG_PM*/ + + +#ifdef CONFIG_ACPI_SLEEP + +/** + * acpi_system_restore_state - OS-specific restoration of state + * @state: sleep state we're exiting + * + * Note that if we're coming back from S4, the memory image should have already + * been loaded from the disk and is already in place. (Otherwise how else would we + * be here?). + */ +acpi_status +acpi_system_restore_state ( + u32 state) +{ + /* restore processor state + * We should only be here if we're coming back from STR or STD. + * And, in the case of the latter, the memory image should have already + * been loaded from disk. + */ + if (state > ACPI_STATE_S1) + acpi_restore_state_mem(); + + /* wait for power to come back */ + mdelay(10); +#ifdef HAVE_NEW_DEVICE_MODEL + /* turn all the devices back on */ + device_resume(RESUME_POWER_ON); + + /* enable interrupts once again */ + ACPI_ENABLE_IRQS(); + + /* restore device context */ + device_resume(RESUME_RESTORE_STATE); +#endif + return AE_OK; +} + +/** + * acpi_system_save_state - save OS specific state and power down devices + * @state: sleep state we're entering. + * + * This handles saving all context to memory, and possibly disk. + * First, we call to the device driver layer to save device state. + * Once we have that, we save whatevery processor and kernel state we + * need to memory. + * If we're entering S4, we then write the memory image to disk. + * + * Only then is it safe for us to power down devices, since we may need + * the disks and upstream buses to write to. + */ +acpi_status +acpi_system_save_state( + u32 state) +{ + int error = 0; + +#ifdef HAVE_NEW_DEVICE_MODEL + /* Send notification to devices that they will be suspended. + * If any device or driver cannot make the transition, either up + * or down, we'll get an error back. + */ + error = device_suspend(state, SUSPEND_NOTIFY); + if (error) + return AE_ERROR; +#endif + if (state < ACPI_STATE_S5) { + +#ifdef HAVE_NEW_DEVICE_MODEL + /* Tell devices to stop I/O and actually save their state. + * It is theoretically possible that something could fail, + * so handle that gracefully.. + */ + error = device_suspend(state, SUSPEND_SAVE_STATE); + if (error) { + /* tell devices to restore state if they have + * it saved and to start taking I/O requests. + */ + device_resume(RESUME_RESTORE_STATE); + return error; + } +#endif + + /* flush caches */ + ACPI_FLUSH_CPU_CACHE(); + + /* Do arch specific saving of state. */ + if (state > ACPI_STATE_S1) { + error = acpi_save_state_mem(); + + if (!error && (state == ACPI_STATE_S4)) + error = acpi_save_state_disk(); + +#ifdef HAVE_NEW_DEVICE_MODEL + if (error) { + device_resume(RESUME_RESTORE_STATE); + return error; + } +#endif + } + } +#ifdef HAVE_NEW_DEVICE_MODEL + /* disable interrupts + * Note that acpi_suspend -- our caller -- will do this once we return. + * But, we want it done early, so we don't get any suprises during + * the device suspend sequence. + */ + ACPI_DISABLE_IRQS(); + + /* Unconditionally turn off devices. + * Obvious if we enter a sleep state. + * If entering S5 (soft off), this should put devices in a + * quiescent state. + */ + error = device_suspend(state, SUSPEND_POWER_DOWN); + + /* We're pretty screwed if we got an error from this. + * We try to recover by simply calling our own restore_state + * function; see above for definition. + * + * If it's S5 though, go through with it anyway.. + */ + if (error && state != ACPI_STATE_S5) + acpi_system_restore_state(state); +#endif + return error ? AE_ERROR : AE_OK; +} + + +/**************************************************************************** + * + * FUNCTION: acpi_system_suspend + * + * PARAMETERS: %state: Sleep state to enter. + * + * RETURN: acpi_status, whether or not we successfully entered and + * exited sleep. + * + * DESCRIPTION: Perform OS-specific action to enter sleep state. + * This is the final step in going to sleep, per spec. If we + * know we're coming back (i.e. not entering S5), we save the + * processor flags. [ We'll have to save and restore them anyway, + * so we use the arch-agnostic save_flags and restore_flags + * here.] We then set the place to return to in arch-specific + * globals using arch_set_return_point. Finally, we call the + * ACPI function to write the proper values to I/O ports. + * + ****************************************************************************/ + +acpi_status +acpi_system_suspend( + u32 state) +{ + acpi_status status = AE_ERROR; + unsigned long flags = 0; + + save_flags(flags); + kernel_fpu_begin(); + + switch (state) + { + case ACPI_STATE_S1: + /* do nothing */ + break; + + case ACPI_STATE_S2: + case ACPI_STATE_S3: + save_register_state((unsigned long)&&acpi_sleep_done); + break; + } + + barrier(); + status = acpi_enter_sleep_state(state); + +acpi_sleep_done: + + restore_register_state(); + fix_processor_context(); + + kernel_fpu_end(); + restore_flags(flags); + + return status; +} + + +/** + * acpi_suspend - OS-agnostic system suspend/resume support (S? states) + * @state: state we're entering + * + */ +acpi_status +acpi_suspend ( + u32 state) +{ + acpi_status status; + + /* get out if state is invalid */ + if (state < ACPI_STATE_S1 || state > ACPI_STATE_S5) + return AE_ERROR; + + /* do we have a wakeup address for S2 and S3? */ + if (state == ACPI_STATE_S2 || state == ACPI_STATE_S3) { + if (!acpi_wakeup_address) + return AE_ERROR; + acpi_set_firmware_waking_vector((ACPI_PHYSICAL_ADDRESS) acpi_wakeup_address); + } + + acpi_enter_sleep_state_prep(state); + + status = acpi_system_save_state(state); + if (!ACPI_SUCCESS(status)) + return status; + + /* disable interrupts and flush caches */ + ACPI_DISABLE_IRQS(); + ACPI_FLUSH_CPU_CACHE(); + + /* perform OS-specific sleep actions */ + status = acpi_system_suspend(state); + + /* Even if we failed to go to sleep, all of the devices are in an suspended + * mode. So, we run these unconditionaly to make sure we have a usable system + * no matter what. + */ + acpi_system_restore_state(state); + acpi_leave_sleep_state(state); + + /* make sure interrupts are enabled */ + ACPI_ENABLE_IRQS(); + + /* reset firmware waking vector */ + acpi_set_firmware_waking_vector((ACPI_PHYSICAL_ADDRESS) 0); + + return status; +} + +#endif /* CONFIG_ACPI_SLEEP */ + + +/* -------------------------------------------------------------------------- + FS Interface (/proc) + -------------------------------------------------------------------------- */ + +#include +#include + + +static int +acpi_system_read_info ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_system *system = (struct acpi_system *) data; + char *p = page; + int size = 0; + u32 i = 0; + + ACPI_FUNCTION_TRACE("acpi_system_read_info"); + + if (!system || (off != 0)) + goto end; + + p += sprintf(p, "version: %x\n", ACPI_CA_VERSION); + + p += sprintf(p, "states: "); + for (i=0; istates[i]) + p += sprintf(p, "S%d ", i); + } + p += sprintf(p, "\n"); + +end: + size = (p - page); + if (size <= off+count) *eof = 1; + *start = page + off; + size -= off; + if (size>count) size = count; + if (size<0) size = 0; + + return_VALUE(size); +} + +static int acpi_system_open_event(struct inode *inode, struct file *file); +static ssize_t acpi_system_read_event (struct file*, char*, size_t, loff_t*); +static int acpi_system_close_event(struct inode *inode, struct file *file); +static unsigned int acpi_system_poll_event(struct file *file, poll_table *wait); + + +static struct file_operations acpi_system_event_ops = { + open: acpi_system_open_event, + read: acpi_system_read_event, + release: acpi_system_close_event, + poll: acpi_system_poll_event, +}; + +static int +acpi_system_open_event(struct inode *inode, struct file *file) +{ + spin_lock_irq (&acpi_system_event_lock); + + if(event_is_open) + goto out_busy; + + event_is_open = 1; + + spin_unlock_irq (&acpi_system_event_lock); + return 0; + +out_busy: + spin_unlock_irq (&acpi_system_event_lock); + return -EBUSY; +} + +static ssize_t +acpi_system_read_event ( + struct file *file, + char *buffer, + size_t count, + loff_t *ppos) +{ + int result = 0; + char outbuf[ACPI_MAX_STRING]; + int size = 0; + struct acpi_bus_event event; + + ACPI_FUNCTION_TRACE("acpi_system_read_event"); + + memset(&event, 0, sizeof(struct acpi_bus_event)); + + if (count < ACPI_MAX_STRING) + goto end; + + if ((file->f_flags & O_NONBLOCK) + && (list_empty(&acpi_bus_event_list))) + return_VALUE(-EAGAIN); + + result = acpi_bus_receive_event(&event); + if (0 != result) { + size = sprintf(outbuf, "error\n"); + goto end; + } + + size = sprintf(outbuf, "%s %s %08x %08x\n", + event.device_class?event.device_class:"", + event.bus_id?event.bus_id:"", + event.type, + event.data); + +end: + if (copy_to_user(buffer, outbuf, size)) + return_VALUE(-EFAULT); + + *ppos += size; + + return_VALUE(size); +} + +static int +acpi_system_close_event(struct inode *inode, struct file *file) +{ + spin_lock_irq (&acpi_system_event_lock); + event_is_open = 0; + spin_unlock_irq (&acpi_system_event_lock); + return 0; +} + +static unsigned int +acpi_system_poll_event( + struct file *file, + poll_table *wait) +{ + poll_wait(file, &acpi_bus_event_queue, wait); + if (!list_empty(&acpi_bus_event_list)) + return POLLIN | POLLRDNORM; + return 0; +} + +static ssize_t acpi_system_read_dsdt (struct file*, char*, size_t, loff_t*); + +static struct file_operations acpi_system_dsdt_ops = { + read: acpi_system_read_dsdt, +}; + +static ssize_t +acpi_system_read_dsdt ( + struct file *file, + char *buffer, + size_t count, + loff_t *ppos) +{ + acpi_status status = AE_OK; + acpi_buffer dsdt = {ACPI_ALLOCATE_BUFFER, NULL}; + void *data = 0; + size_t size = 0; + + ACPI_FUNCTION_TRACE("acpi_system_read_dsdt"); + + status = acpi_get_table(ACPI_TABLE_DSDT, 1, &dsdt); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + if (*ppos < dsdt.length) { + data = dsdt.pointer + file->f_pos; + size = dsdt.length - file->f_pos; + if (size > count) + size = count; + if (copy_to_user(buffer, data, size)) { + kfree(dsdt.pointer); + return_VALUE(-EFAULT); + } + } + + kfree(dsdt.pointer); + + *ppos += size; + + return_VALUE(size); +} + + +static ssize_t acpi_system_read_fadt (struct file*, char*, size_t, loff_t*); + +static struct file_operations acpi_system_fadt_ops = { + read: acpi_system_read_fadt, +}; + +static ssize_t +acpi_system_read_fadt ( + struct file *file, + char *buffer, + size_t count, + loff_t *ppos) +{ + acpi_status status = AE_OK; + acpi_buffer fadt = {ACPI_ALLOCATE_BUFFER, NULL}; + void *data = 0; + size_t size = 0; + + ACPI_FUNCTION_TRACE("acpi_system_read_fadt"); + + status = acpi_get_table(ACPI_TABLE_FADT, 1, &fadt); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + if (*ppos < fadt.length) { + data = fadt.pointer + file->f_pos; + size = fadt.length - file->f_pos; + if (size > count) + size = count; + if (copy_to_user(buffer, data, size)) { + kfree(fadt.pointer); + return_VALUE(-EFAULT); + } + } + + kfree(fadt.pointer); + + *ppos += size; + + return_VALUE(size); +} + + +#ifdef ACPI_DEBUG + +static int +acpi_system_read_debug ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + char *p = page; + int size = 0; + + if (off != 0) + goto end; + + switch ((unsigned long) data) { + case 0: + p += sprintf(p, "0x%08x\n", acpi_dbg_layer); + break; + case 1: + p += sprintf(p, "0x%08x\n", acpi_dbg_level); + break; + default: + p += sprintf(p, "Invalid debug option\n"); + break; + } + +end: + size = (p - page); + if (size <= off+count) *eof = 1; + *start = page + off; + size -= off; + if (size>count) size = count; + if (size<0) size = 0; + + return size; +} + + +static int +acpi_system_write_debug ( + struct file *file, + const char *buffer, + unsigned long count, + void *data) +{ + char debug_string[12] = {'\0'}; + + ACPI_FUNCTION_TRACE("acpi_system_write_debug"); + + if (count > sizeof(debug_string) - 1) + return_VALUE(-EINVAL); + + if (copy_from_user(debug_string, buffer, count)) + return_VALUE(-EFAULT); + + debug_string[count] = '\0'; + + switch ((unsigned long) data) { + case 0: + acpi_dbg_layer = simple_strtoul(debug_string, NULL, 0); + break; + case 1: + acpi_dbg_level = simple_strtoul(debug_string, NULL, 0); + break; + default: + return_VALUE(-EINVAL); + } + + return_VALUE(count); +} + +#endif /* ACPI_DEBUG */ + + +#ifdef CONFIG_ACPI_SLEEP + +static int +acpi_system_read_sleep ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_system *system = (struct acpi_system *) data; + char *p = page; + int size; + int i; + + ACPI_FUNCTION_TRACE("acpi_system_read_sleep"); + + if (!system || (off != 0)) + goto end; + + for (i = 0; i <= ACPI_STATE_S5; i++) { + if (system->states[i]) + p += sprintf(p,"S%d ", i); + } + + p += sprintf(p, "\n"); + +end: + size = (p - page); + if (size <= off+count) *eof = 1; + *start = page + off; + size -= off; + if (size>count) size = count; + if (size<0) size = 0; + + return_VALUE(size); +} + + +static int +acpi_system_write_sleep ( + struct file *file, + const char *buffer, + unsigned long count, + void *data) +{ + acpi_status status = AE_OK; + struct acpi_system *system = (struct acpi_system *) data; + char state_string[12] = {'\0'}; + u32 state = 0; + + ACPI_FUNCTION_TRACE("acpi_system_write_sleep"); + + if (!system || (count > sizeof(state_string) - 1)) + return_VALUE(-EINVAL); + + if (copy_from_user(state_string, buffer, count)) + return_VALUE(-EFAULT); + + state_string[count] = '\0'; + + state = simple_strtoul(state_string, NULL, 0); + + if (!system->states[state]) + return_VALUE(-ENODEV); + + status = acpi_suspend(state); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + return_VALUE(count); +} + + +static int +acpi_system_read_alarm ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *context) +{ + char *p = page; + int size = 0; + u32 sec, min, hr; + u32 day, mo, yr; + + ACPI_FUNCTION_TRACE("acpi_system_read_alarm"); + + if (off != 0) + goto end; + + spin_lock(&rtc_lock); + + sec = CMOS_READ(RTC_SECONDS_ALARM); + min = CMOS_READ(RTC_MINUTES_ALARM); + hr = CMOS_READ(RTC_HOURS_ALARM); + +#if 0 /* If we ever get an FACP with proper values... */ + if (acpi_gbl_FADT->day_alrm) + day = CMOS_READ(acpi_gbl_FADT->day_alrm); + else + day = CMOS_READ(RTC_DAY_OF_MONTH); + if (acpi_gbl_FADT->mon_alrm) + mo = CMOS_READ(acpi_gbl_FADT->mon_alrm); + else + mo = CMOS_READ(RTC_MONTH);; + if (acpi_gbl_FADT->century) + yr = CMOS_READ(acpi_gbl_FADT->century) * 100 + CMOS_READ(RTC_YEAR); + else + yr = CMOS_READ(RTC_YEAR); +#else + day = CMOS_READ(RTC_DAY_OF_MONTH); + mo = CMOS_READ(RTC_MONTH); + yr = CMOS_READ(RTC_YEAR); +#endif + + spin_unlock(&rtc_lock); + + BCD_TO_BIN(sec); + BCD_TO_BIN(min); + BCD_TO_BIN(hr); + BCD_TO_BIN(day); + BCD_TO_BIN(mo); + BCD_TO_BIN(yr); + +#if 0 + /* we're trusting the FADT (see above)*/ +#else + /* If we're not trusting the FADT, we should at least make it + * right for _this_ century... ehm, what is _this_ century? + * + * TBD: + * ASAP: find piece of code in the kernel, e.g. star tracker driver, + * which we can trust to determine the century correctly. Atom + * watch driver would be nice, too... + * + * if that has not happened, change for first release in 2050: + * if (yr<50) + * yr += 2100; + * else + * yr += 2000; // current line of code + * + * if that has not happened either, please do on 2099/12/31:23:59:59 + * s/2000/2100 + * + */ + yr += 2000; +#endif + + p += sprintf(p,"%4.4u-", yr); + p += (mo > 12) ? sprintf(p, "**-") : sprintf(p, "%2.2u-", mo); + p += (day > 31) ? sprintf(p, "** ") : sprintf(p, "%2.2u ", day); + p += (hr > 23) ? sprintf(p, "**:") : sprintf(p, "%2.2u:", hr); + p += (min > 59) ? sprintf(p, "**:") : sprintf(p, "%2.2u:", min); + p += (sec > 59) ? sprintf(p, "**\n") : sprintf(p, "%2.2u\n", sec); + + end: + size = p - page; + if (size < count) *eof = 1; + else if (size > count) size = count; + if (size < 0) size = 0; + *start = page; + + return_VALUE(size); +} + + +static int +get_date_field ( + char **p, + u32 *value) +{ + char *next = NULL; + char *string_end = NULL; + int result = -EINVAL; + + /* + * Try to find delimeter, only to insert null. The end of the + * string won't have one, but is still valid. + */ + next = strpbrk(*p, "- :"); + if (next) + *next++ = '\0'; + + *value = simple_strtoul(*p, &string_end, 10); + + /* Signal success if we got a good digit */ + if (string_end != *p) + result = 0; + + if (next) + *p = next; + + return result; +} + + +static int +acpi_system_write_alarm ( + struct file *file, + const char *buffer, + unsigned long count, + void *data) +{ + int result = 0; + char alarm_string[30] = {'\0'}; + char *p = alarm_string; + u32 sec, min, hr, day, mo, yr; + int adjust = 0; + unsigned char rtc_control = 0; + + ACPI_FUNCTION_TRACE("acpi_system_write_alarm"); + + if (count > sizeof(alarm_string) - 1) + return_VALUE(-EINVAL); + + if (copy_from_user(alarm_string, buffer, count)) + return_VALUE(-EFAULT); + + alarm_string[count] = '\0'; + + /* check for time adjustment */ + if (alarm_string[0] == '+') { + p++; + adjust = 1; + } + + if ((result = get_date_field(&p, &yr))) + goto end; + if ((result = get_date_field(&p, &mo))) + goto end; + if ((result = get_date_field(&p, &day))) + goto end; + if ((result = get_date_field(&p, &hr))) + goto end; + if ((result = get_date_field(&p, &min))) + goto end; + if ((result = get_date_field(&p, &sec))) + goto end; + + if (sec > 59) { + min += 1; + sec -= 60; + } + if (min > 59) { + hr += 1; + min -= 60; + } + if (hr > 23) { + day += 1; + hr -= 24; + } + if (day > 31) { + mo += 1; + day -= 31; + } + if (mo > 12) { + yr += 1; + mo -= 12; + } + + spin_lock_irq(&rtc_lock); + + rtc_control = CMOS_READ(RTC_CONTROL); + if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { + BIN_TO_BCD(yr); + BIN_TO_BCD(mo); + BIN_TO_BCD(day); + BIN_TO_BCD(hr); + BIN_TO_BCD(min); + BIN_TO_BCD(sec); + } + + if (adjust) { + yr += CMOS_READ(RTC_YEAR); + mo += CMOS_READ(RTC_MONTH); + day += CMOS_READ(RTC_DAY_OF_MONTH); + hr += CMOS_READ(RTC_HOURS); + min += CMOS_READ(RTC_MINUTES); + sec += CMOS_READ(RTC_SECONDS); + } + + spin_unlock_irq(&rtc_lock); + + if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { + BCD_TO_BIN(yr); + BCD_TO_BIN(mo); + BCD_TO_BIN(day); + BCD_TO_BIN(hr); + BCD_TO_BIN(min); + BCD_TO_BIN(sec); + } + + if (sec > 59) { + min++; + sec -= 60; + } + if (min > 59) { + hr++; + min -= 60; + } + if (hr > 23) { + day++; + hr -= 24; + } + if (day > 31) { + mo++; + day -= 31; + } + if (mo > 12) { + yr++; + mo -= 12; + } + if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { + BIN_TO_BCD(yr); + BIN_TO_BCD(mo); + BIN_TO_BCD(day); + BIN_TO_BCD(hr); + BIN_TO_BCD(min); + BIN_TO_BCD(sec); + } + + spin_lock_irq(&rtc_lock); + + /* write the fields the rtc knows about */ + CMOS_WRITE(hr, RTC_HOURS_ALARM); + CMOS_WRITE(min, RTC_MINUTES_ALARM); + CMOS_WRITE(sec, RTC_SECONDS_ALARM); + + /* + * If the system supports an enhanced alarm it will have non-zero + * offsets into the CMOS RAM here -- which for some reason are pointing + * to the RTC area of memory. + */ +#if 0 + if (acpi_gbl_FADT->day_alrm) + CMOS_WRITE(day, acpi_gbl_FADT->day_alrm); + if (acpi_gbl_FADT->mon_alrm) + CMOS_WRITE(mo, acpi_gbl_FADT->mon_alrm); + if (acpi_gbl_FADT->century) + CMOS_WRITE(yr/100, acpi_gbl_FADT->century); +#endif + /* enable the rtc alarm interrupt */ + if (!(rtc_control & RTC_AIE)) { + rtc_control |= RTC_AIE; + CMOS_WRITE(rtc_control,RTC_CONTROL); + CMOS_READ(RTC_INTR_FLAGS); + } + + spin_unlock_irq(&rtc_lock); + + acpi_set_register(ACPI_BITREG_RT_CLOCK_ENABLE, 1, ACPI_MTX_LOCK); + + file->f_pos += count; + + result = 0; +end: + return_VALUE(result ? result : count); +} + +#endif /*CONFIG_ACPI_SLEEP*/ + + +static int +acpi_system_add_fs ( + struct acpi_device *device) +{ + struct proc_dir_entry *entry = NULL; + + ACPI_FUNCTION_TRACE("acpi_system_add_fs"); + + if (!device) + return_VALUE(-EINVAL); + + /* 'info' [R] */ + entry = create_proc_entry(ACPI_SYSTEM_FILE_INFO, + S_IRUGO, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_SYSTEM_FILE_INFO)); + else { + entry->read_proc = acpi_system_read_info; + entry->data = acpi_driver_data(device); + } + + /* 'dsdt' [R] */ + entry = create_proc_entry(ACPI_SYSTEM_FILE_DSDT, + S_IRUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_SYSTEM_FILE_DSDT)); + else + entry->proc_fops = &acpi_system_dsdt_ops; + + /* 'fadt' [R] */ + entry = create_proc_entry(ACPI_SYSTEM_FILE_FADT, + S_IRUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_SYSTEM_FILE_FADT)); + else + entry->proc_fops = &acpi_system_fadt_ops; + + /* 'event' [R] */ + entry = create_proc_entry(ACPI_SYSTEM_FILE_EVENT, + S_IRUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_SYSTEM_FILE_EVENT)); + else + entry->proc_fops = &acpi_system_event_ops; + +#ifdef CONFIG_ACPI_SLEEP + + /* 'sleep' [R/W]*/ + entry = create_proc_entry(ACPI_SYSTEM_FILE_SLEEP, + S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_SYSTEM_FILE_SLEEP)); + else { + entry->read_proc = acpi_system_read_sleep; + entry->write_proc = acpi_system_write_sleep; + entry->data = acpi_driver_data(device); + } + + /* 'alarm' [R/W] */ + entry = create_proc_entry(ACPI_SYSTEM_FILE_ALARM, + S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_SYSTEM_FILE_ALARM)); + else { + entry->read_proc = acpi_system_read_alarm; + entry->write_proc = acpi_system_write_alarm; + entry->data = acpi_driver_data(device); + } + +#endif /*CONFIG_ACPI_SLEEP*/ + +#ifdef ACPI_DEBUG + + /* 'debug_layer' [R/W] */ + entry = create_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, + S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_SYSTEM_FILE_DEBUG_LAYER)); + else { + entry->read_proc = acpi_system_read_debug; + entry->write_proc = acpi_system_write_debug; + entry->data = (void *) 0; + } + + /* 'debug_level' [R/W] */ + entry = create_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, + S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_SYSTEM_FILE_DEBUG_LEVEL)); + else { + entry->read_proc = acpi_system_read_debug; + entry->write_proc = acpi_system_write_debug; + entry->data = (void *) 1; + } + +#endif /*ACPI_DEBUG*/ + + return_VALUE(0); +} + + +static int +acpi_system_remove_fs ( + struct acpi_device *device) +{ + ACPI_FUNCTION_TRACE("acpi_system_remove_fs"); + + if (!device) + return_VALUE(-EINVAL); + + remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_device_dir(device)); + remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_device_dir(device)); + remove_proc_entry(ACPI_SYSTEM_FILE_EVENT, acpi_device_dir(device)); +#ifdef CONFIG_ACPI_SLEEP + remove_proc_entry(ACPI_SYSTEM_FILE_SLEEP, acpi_device_dir(device)); + remove_proc_entry(ACPI_SYSTEM_FILE_ALARM, acpi_device_dir(device)); +#endif +#ifdef ACPI_DEBUG + remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, + acpi_device_dir(device)); + remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, + acpi_device_dir(device)); +#endif + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Driver Interface + -------------------------------------------------------------------------- */ + +#if defined(CONFIG_MAGIC_SYSRQ) && defined(CONFIG_PM) + +/* Simple wrapper calling power down function. */ +static void acpi_sysrq_power_off(int key, struct pt_regs *pt_regs, + struct kbd_struct *kbd, struct tty_struct *tty) +{ + acpi_power_off(); +} + +struct sysrq_key_op sysrq_acpi_poweroff_op = { + handler: &acpi_sysrq_power_off, + help_msg: "Off", + action_msg: "Power Off\n" +}; + +#endif /* CONFIG_MAGIC_SYSRQ */ + +static int +acpi_system_add ( + struct acpi_device *device) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_system *system = NULL; + u8 i = 0; + + ACPI_FUNCTION_TRACE("acpi_system_add"); + + if (!device) + return_VALUE(-EINVAL); + + system = kmalloc(sizeof(struct acpi_system), GFP_KERNEL); + if (!system) + return_VALUE(-ENOMEM); + memset(system, 0, sizeof(struct acpi_system)); + + system->handle = device->handle; + sprintf(acpi_device_name(device), "%s", ACPI_SYSTEM_DEVICE_NAME); + sprintf(acpi_device_class(device), "%s", ACPI_SYSTEM_CLASS); + acpi_driver_data(device) = system; + + result = acpi_system_add_fs(device); + if (0 != result) + goto end; + + printk(KERN_INFO PREFIX "%s [%s] (supports", + acpi_device_name(device), acpi_device_bid(device)); + for (i=0; istates[i] = 1; + printk(" S%d", i); + } + } + printk(")\n"); + +#ifdef CONFIG_PM + /* Install the soft-off (S5) handler. */ + if (system->states[ACPI_STATE_S5]) { + pm_power_off = acpi_power_off; + register_sysrq_key('o', &sysrq_acpi_poweroff_op); + } +#endif + +end: + if (0 != result) + kfree(system); + + return_VALUE(result); +} + + +static int +acpi_system_remove ( + struct acpi_device *device, + int type) +{ + struct acpi_system *system = NULL; + + ACPI_FUNCTION_TRACE("acpi_system_remove"); + + if (!device || !acpi_driver_data(device)) + return_VALUE(-EINVAL); + + system = (struct acpi_system *) acpi_driver_data(device); + +#ifdef CONFIG_PM + /* Remove the soft-off (S5) handler. */ + if (system->states[ACPI_STATE_S5]) { + unregister_sysrq_key('o', &sysrq_acpi_poweroff_op); + pm_power_off = NULL; + } +#endif + + acpi_system_remove_fs(device); + + kfree(system); + + return 0; +} + + +int __init +acpi_system_init (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_system_init"); + + result = acpi_bus_register_driver(&acpi_system_driver); + if (0 > result) + return_VALUE(-ENODEV); + + return_VALUE(0); +} + + +void __exit +acpi_system_exit (void) +{ + ACPI_FUNCTION_TRACE("acpi_system_exit"); + acpi_bus_unregister_driver(&acpi_system_driver); + return_VOID; +} diff -urN linux-2.4.18/drivers/acpi/tables/Makefile lia64-2.4/drivers/acpi/tables/Makefile --- linux-2.4.18/drivers/acpi/tables/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/tables/Makefile Tue Apr 9 15:47:01 2002 @@ -1,11 +1,10 @@ # # Makefile for all Linux ACPI interpreter subdirectories -# EXCEPT for the ospm directory # O_TARGET := $(notdir $(CURDIR)).o -obj-$(CONFIG_ACPI) := $(patsubst %.c,%.o,$(wildcard *.c)) +obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c)) EXTRA_CFLAGS += $(ACPI_CFLAGS) diff -urN linux-2.4.18/drivers/acpi/tables/tbconvrt.c lia64-2.4/drivers/acpi/tables/tbconvrt.c --- linux-2.4.18/drivers/acpi/tables/tbconvrt.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/tables/tbconvrt.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: tbconvrt - ACPI Table conversion utilities - * $Revision: 28 $ + * $Revision: 41 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,13 +25,11 @@ #include "acpi.h" -#include "achware.h" #include "actables.h" -#include "actbl.h" #define _COMPONENT ACPI_TABLES - MODULE_NAME ("tbconvrt") + ACPI_MODULE_NAME ("tbconvrt") /******************************************************************************* @@ -54,15 +52,14 @@ u32 pointer_size; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); -#ifndef _IA64 +#if ACPI_MACHINE_WIDTH != 64 if (RSDP->revision < 2) { pointer_size = sizeof (u32); } - else #endif { @@ -96,21 +93,21 @@ acpi_table_desc *table_info, u32 *number_of_tables) { - u32 table_size; + ACPI_SIZE table_size; u32 i; xsdt_descriptor *new_table; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); - *number_of_tables = acpi_tb_get_table_count (acpi_gbl_RSDP, table_info->pointer); + /* Get the number of tables defined in the RSDT or XSDT */ + *number_of_tables = acpi_tb_get_table_count (acpi_gbl_RSDP, table_info->pointer); /* Compute size of the converted XSDT */ - table_size = (*number_of_tables * sizeof (u64)) + sizeof (acpi_table_header); - + table_size = ((ACPI_SIZE) *number_of_tables * sizeof (u64)) + sizeof (acpi_table_header); /* Allocate an XSDT */ @@ -121,20 +118,15 @@ /* Copy the header and set the length */ - MEMCPY (new_table, table_info->pointer, sizeof (acpi_table_header)); - new_table->header.length = table_size; + ACPI_MEMCPY (new_table, table_info->pointer, sizeof (acpi_table_header)); + new_table->header.length = (u32) table_size; /* Copy the table pointers */ for (i = 0; i < *number_of_tables; i++) { if (acpi_gbl_RSDP->revision < 2) { -#ifdef _IA64 - new_table->table_offset_entry[i] = - ((RSDT_DESCRIPTOR_REV071 *) table_info->pointer)->table_offset_entry[i]; -#else ACPI_STORE_ADDRESS (new_table->table_offset_entry[i], ((RSDT_DESCRIPTOR_REV1 *) table_info->pointer)->table_offset_entry[i]); -#endif } else { new_table->table_offset_entry[i] = @@ -142,12 +134,10 @@ } } - /* Delete the original table (either mapped or in a buffer) */ acpi_tb_delete_single_table (table_info); - /* Point the table descriptor to the new table */ table_info->pointer = (acpi_table_header *) new_table; @@ -161,325 +151,254 @@ /******************************************************************************* * - * FUNCTION: Acpi_tb_convert_table_fadt + * FUNCTION: Acpi_tb_convert_fadt1 * - * PARAMETERS: + * PARAMETERS: Local_fadt - Pointer to new FADT + * Original_fadt - Pointer to old FADT * - * RETURN: + * RETURN: Populates Local_fadt * - * DESCRIPTION: - * Converts BIOS supplied 1.0 and 0.71 ACPI FADT to an intermediate - * ACPI 2.0 FADT. If the BIOS supplied a 2.0 FADT then it is simply - * copied to the intermediate FADT. The ACPI CA software uses this - * intermediate FADT. Thus a significant amount of special #ifdef - * type codeing is saved. This intermediate FADT will need to be - * freed at some point. + * DESCRIPTION: Convert an ACPI 1.0 FADT to common internal format * ******************************************************************************/ -acpi_status -acpi_tb_convert_table_fadt (void) +static void +acpi_tb_convert_fadt1 ( + fadt_descriptor_rev2 *local_fadt, + fadt_descriptor_rev1 *original_fadt) { -#ifdef _IA64 - fadt_descriptor_rev071 *FADT71; - u8 pm1_address_space; - u8 pm2_address_space; - u8 pm_timer_address_space; - u8 gpe0address_space; - u8 gpe1_address_space; -#else - fadt_descriptor_rev1 *FADT1; -#endif - - fadt_descriptor_rev2 *FADT2; - acpi_table_desc *table_desc; - - - FUNCTION_TRACE ("Tb_convert_table_fadt"); - - - /* Acpi_gbl_FADT is valid */ - /* Allocate and zero the 2.0 buffer */ - - FADT2 = ACPI_MEM_CALLOCATE (sizeof (fadt_descriptor_rev2)); - if (FADT2 == NULL) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - - /* The ACPI FADT revision number is FADT2_REVISION_ID=3 */ - /* So, if the current table revision is less than 3 it is type 1.0 or 0.71 */ - - if (acpi_gbl_FADT->header.revision >= FADT2_REVISION_ID) { - /* We have an ACPI 2.0 FADT but we must copy it to our local buffer */ - - *FADT2 = *((fadt_descriptor_rev2*) acpi_gbl_FADT); - - } - - else { - -#ifdef _IA64 - /* - * For the 64-bit case only, a revision ID less than V2.0 means the - * tables are the 0.71 extensions - */ - - /* The BIOS stored FADT should agree with Revision 0.71 */ - - FADT71 = (fadt_descriptor_rev071 *) acpi_gbl_FADT; - - /* Copy the table header*/ - - FADT2->header = FADT71->header; - - /* Copy the common fields */ - - FADT2->sci_int = FADT71->sci_int; - FADT2->acpi_enable = FADT71->acpi_enable; - FADT2->acpi_disable = FADT71->acpi_disable; - FADT2->S4bios_req = FADT71->S4bios_req; - FADT2->plvl2_lat = FADT71->plvl2_lat; - FADT2->plvl3_lat = FADT71->plvl3_lat; - FADT2->day_alrm = FADT71->day_alrm; - FADT2->mon_alrm = FADT71->mon_alrm; - FADT2->century = FADT71->century; - FADT2->gpe1_base = FADT71->gpe1_base; - - /* - * We still use the block length registers even though - * the GAS structure should obsolete them. This is because - * these registers are byte lengths versus the GAS which - * contains a bit width - */ - FADT2->pm1_evt_len = FADT71->pm1_evt_len; - FADT2->pm1_cnt_len = FADT71->pm1_cnt_len; - FADT2->pm2_cnt_len = FADT71->pm2_cnt_len; - FADT2->pm_tm_len = FADT71->pm_tm_len; - FADT2->gpe0blk_len = FADT71->gpe0blk_len; - FADT2->gpe1_blk_len = FADT71->gpe1_blk_len; - FADT2->gpe1_base = FADT71->gpe1_base; - - /* Copy the existing 0.71 flags to 2.0. The other bits are zero.*/ - - FADT2->wb_invd = FADT71->flush_cash; - FADT2->proc_c1 = FADT71->proc_c1; - FADT2->plvl2_up = FADT71->plvl2_up; - FADT2->pwr_button = FADT71->pwr_button; - FADT2->sleep_button = FADT71->sleep_button; - FADT2->fixed_rTC = FADT71->fixed_rTC; - FADT2->rtcs4 = FADT71->rtcs4; - FADT2->tmr_val_ext = FADT71->tmr_val_ext; - FADT2->dock_cap = FADT71->dock_cap; - - - /* We should not use these next two addresses */ - /* Since our buffer is pre-zeroed nothing to do for */ - /* the next three data items in the structure */ - /* FADT2->Firmware_ctrl = 0; */ - /* FADT2->Dsdt = 0; */ - - /* System Interrupt Model isn't used in ACPI 2.0*/ - /* FADT2->Reserved1 = 0; */ - - /* This field is set by the OEM to convey the preferred */ - /* power management profile to OSPM. It doesn't have any*/ - /* 0.71 equivalence. Since we don't know what kind of */ - /* 64-bit system this is, we will pick unspecified. */ - - FADT2->prefer_PM_profile = PM_UNSPECIFIED; - - - /* Port address of SMI command port */ - /* We shouldn't use this port because IA64 doesn't */ - /* have or use SMI. It has PMI. */ - - FADT2->smi_cmd = (u32)(FADT71->smi_cmd & 0xFFFFFFFF); - - /* processor performance state control*/ - /* The value OSPM writes to the SMI_CMD register to assume */ - /* processor performance state control responsibility. */ - /* There isn't any equivalence in 0.71 */ - /* Again this should be meaningless for IA64 */ - /* FADT2->Pstate_cnt = 0; */ + /* ACPI 1.0 FACS */ + /* The BIOS stored FADT should agree with Revision 1.0 */ - /* The 32-bit Power management and GPE registers are */ - /* not valid in IA-64 and we are not going to use them */ - /* so leaving them pre-zeroed. */ - - /* Support for the _CST object and C States change notification.*/ - /* This data item hasn't any 0.71 equivalence so leaving it zero.*/ - /* FADT2->Cst_cnt = 0; */ - - /* number of flush strides that need to be read */ - /* No 0.71 equivalence. Leave pre-zeroed. */ - /* FADT2->Flush_size = 0; */ - - /* Processor's memory cache line width, in bytes */ - /* No 0.71 equivalence. Leave pre-zeroed. */ - /* FADT2->Flush_stride = 0; */ - - /* Processor's duty cycle index in processor's P_CNT reg*/ - /* No 0.71 equivalence. Leave pre-zeroed. */ - /* FADT2->Duty_offset = 0; */ + /* + * Copy the table header and the common part of the tables. + * + * The 2.0 table is an extension of the 1.0 table, so the entire 1.0 + * table can be copied first, then expand some fields to 64 bits. + */ + ACPI_MEMCPY (local_fadt, original_fadt, sizeof (fadt_descriptor_rev1)); - /* Processor's duty cycle value bit width in P_CNT register.*/ - /* No 0.71 equivalence. Leave pre-zeroed. */ - /* FADT2->Duty_width = 0; */ + /* Convert table pointers to 64-bit fields */ + ACPI_STORE_ADDRESS (local_fadt->Xfirmware_ctrl, local_fadt->V1_firmware_ctrl); + ACPI_STORE_ADDRESS (local_fadt->Xdsdt, local_fadt->V1_dsdt); - /* Since there isn't any equivalence in 0.71 */ - /* and since Big_sur had to support legacy */ + /* + * System Interrupt Model isn't used in ACPI 2.0 (Local_fadt->Reserved1 = 0;) + */ - FADT2->iapc_boot_arch = BAF_LEGACY_DEVICES; + /* + * This field is set by the OEM to convey the preferred power management + * profile to OSPM. It doesn't have any 1.0 equivalence. Since we don't + * know what kind of 32-bit system this is, we will use "unspecified". + */ + local_fadt->prefer_PM_profile = PM_UNSPECIFIED; - /* Copy to ACPI 2.0 64-BIT Extended Addresses */ + /* + * Processor Performance State Control. This is the value OSPM writes to + * the SMI_CMD register to assume processor performance state control + * responsibility. There isn't any equivalence in 1.0, leave it zeroed. + */ + local_fadt->pstate_cnt = 0; - FADT2->Xfirmware_ctrl = FADT71->firmware_ctrl; - FADT2->Xdsdt = FADT71->dsdt; + /* + * Support for the _CST object and C States change notification. + * This data item hasn't any 1.0 equivalence so leave it zero. + */ + local_fadt->cst_cnt = 0; + /* + * Since there isn't any equivalence in 1.0 and since it highly likely + * that a 1.0 system has legacy support. + */ + local_fadt->iapc_boot_arch = BAF_LEGACY_DEVICES; - /* Extract the address space IDs */ + /* + * Convert the V1.0 block addresses to V2.0 GAS structures + */ + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1a_evt_blk, local_fadt->pm1_evt_len, local_fadt->V1_pm1a_evt_blk); + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1b_evt_blk, local_fadt->pm1_evt_len, local_fadt->V1_pm1b_evt_blk); + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1a_cnt_blk, local_fadt->pm1_cnt_len, local_fadt->V1_pm1a_cnt_blk); + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1b_cnt_blk, local_fadt->pm1_cnt_len, local_fadt->V1_pm1b_cnt_blk); + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm2_cnt_blk, local_fadt->pm2_cnt_len, local_fadt->V1_pm2_cnt_blk); + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm_tmr_blk, local_fadt->pm_tm_len, local_fadt->V1_pm_tmr_blk); + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xgpe0_blk, local_fadt->gpe0_blk_len, local_fadt->V1_gpe0_blk); + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xgpe1_blk, local_fadt->gpe1_blk_len, local_fadt->V1_gpe1_blk); - pm1_address_space = (u8)((FADT71->address_space & PM1_BLK_ADDRESS_SPACE) >> 1); - pm2_address_space = (u8)((FADT71->address_space & PM2_CNT_BLK_ADDRESS_SPACE) >> 2); - pm_timer_address_space = (u8)((FADT71->address_space & PM_TMR_BLK_ADDRESS_SPACE) >> 3); - gpe0address_space = (u8)((FADT71->address_space & GPE0_BLK_ADDRESS_SPACE) >> 4); - gpe1_address_space = (u8)((FADT71->address_space & GPE1_BLK_ADDRESS_SPACE) >> 5); +} - /* - * Convert the 0.71 (non-GAS style) Block addresses to V2.0 GAS structures, - * in this order: - * - * PM 1_a Events - * PM 1_b Events - * PM 1_a Control - * PM 1_b Control - * PM 2 Control - * PM Timer Control - * GPE Block 0 - * GPE Block 1 - */ - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xpm1a_evt_blk, FADT71->pm1_evt_len, FADT71->pm1a_evt_blk, pm1_address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xpm1b_evt_blk, FADT71->pm1_evt_len, FADT71->pm1b_evt_blk, pm1_address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xpm1a_cnt_blk, FADT71->pm1_cnt_len, FADT71->pm1a_cnt_blk, pm1_address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xpm1b_cnt_blk, FADT71->pm1_cnt_len, FADT71->pm1b_cnt_blk, pm1_address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xpm2_cnt_blk, FADT71->pm2_cnt_len, FADT71->pm2_cnt_blk, pm2_address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xpm_tmr_blk, FADT71->pm_tm_len, FADT71->pm_tmr_blk, pm_timer_address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xgpe0blk, FADT71->gpe0blk_len, FADT71->gpe0blk, gpe0address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xgpe1_blk, FADT71->gpe1_blk_len, FADT71->gpe1_blk, gpe1_address_space); +/******************************************************************************* + * + * FUNCTION: Acpi_tb_convert_fadt2 + * + * PARAMETERS: Local_fadt - Pointer to new FADT + * Original_fadt - Pointer to old FADT + * + * RETURN: Populates Local_fadt + * + * DESCRIPTION: Convert an ACPI 2.0 FADT to common internal format. + * Handles optional "X" fields. + * + ******************************************************************************/ -#else +static void +acpi_tb_convert_fadt2 ( + fadt_descriptor_rev2 *local_fadt, + fadt_descriptor_rev2 *original_fadt) +{ - /* ACPI 1.0 FACS */ + /* We have an ACPI 2.0 FADT but we must copy it to our local buffer */ + ACPI_MEMCPY (local_fadt, original_fadt, sizeof (fadt_descriptor_rev2)); - /* The BIOS stored FADT should agree with Revision 1.0 */ + /* + * "X" fields are optional extensions to the original V1.0 fields, so + * we must selectively expand V1.0 fields if the corresponding X field + * is zero. + */ + if (!(ACPI_GET_ADDRESS (local_fadt->Xfirmware_ctrl))) { + ACPI_STORE_ADDRESS (local_fadt->Xfirmware_ctrl, local_fadt->V1_firmware_ctrl); + } - FADT1 = (fadt_descriptor_rev1*) acpi_gbl_FADT; + if (!(ACPI_GET_ADDRESS (local_fadt->Xdsdt))) { + ACPI_STORE_ADDRESS (local_fadt->Xdsdt, local_fadt->V1_dsdt); + } - /* - * Copy the table header and the common part of the tables - * The 2.0 table is an extension of the 1.0 table, so the - * entire 1.0 table can be copied first, then expand some - * fields to 64 bits. - */ - MEMCPY (FADT2, FADT1, sizeof (fadt_descriptor_rev1)); + if (!(ACPI_GET_ADDRESS (local_fadt->Xpm1a_evt_blk.address))) { + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1a_evt_blk, + local_fadt->pm1_evt_len, local_fadt->V1_pm1a_evt_blk); + } + if (!(ACPI_GET_ADDRESS (local_fadt->Xpm1b_evt_blk.address))) { + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1b_evt_blk, + local_fadt->pm1_evt_len, local_fadt->V1_pm1b_evt_blk); + } - /* Convert table pointers to 64-bit fields */ + if (!(ACPI_GET_ADDRESS (local_fadt->Xpm1a_cnt_blk.address))) { + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1a_cnt_blk, + local_fadt->pm1_cnt_len, local_fadt->V1_pm1a_cnt_blk); + } - ACPI_STORE_ADDRESS (FADT2->Xfirmware_ctrl, FADT1->firmware_ctrl); - ACPI_STORE_ADDRESS (FADT2->Xdsdt, FADT1->dsdt); + if (!(ACPI_GET_ADDRESS (local_fadt->Xpm1b_cnt_blk.address))) { + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1b_cnt_blk, + local_fadt->pm1_cnt_len, local_fadt->V1_pm1b_cnt_blk); + } - /* System Interrupt Model isn't used in ACPI 2.0*/ - /* FADT2->Reserved1 = 0; */ + if (!(ACPI_GET_ADDRESS (local_fadt->Xpm2_cnt_blk.address))) { + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm2_cnt_blk, + local_fadt->pm2_cnt_len, local_fadt->V1_pm2_cnt_blk); + } - /* This field is set by the OEM to convey the preferred */ - /* power management profile to OSPM. It doesn't have any*/ - /* 1.0 equivalence. Since we don't know what kind of */ - /* 32-bit system this is, we will pick unspecified. */ + if (!(ACPI_GET_ADDRESS (local_fadt->Xpm_tmr_blk.address))) { + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm_tmr_blk, + local_fadt->pm_tm_len, local_fadt->V1_pm_tmr_blk); + } - FADT2->prefer_PM_profile = PM_UNSPECIFIED; + if (!(ACPI_GET_ADDRESS (local_fadt->Xgpe0_blk.address))) { + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xgpe0_blk, + local_fadt->gpe0_blk_len, local_fadt->V1_gpe0_blk); + } + if (!(ACPI_GET_ADDRESS (local_fadt->Xgpe1_blk.address))) { + ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xgpe1_blk, + local_fadt->gpe1_blk_len, local_fadt->V1_gpe1_blk); + } +} - /* Processor Performance State Control. This is the value */ - /* OSPM writes to the SMI_CMD register to assume processor */ - /* performance state control responsibility. There isn't */ - /* any equivalence in 1.0. So leave it zeroed. */ +/******************************************************************************* + * + * FUNCTION: Acpi_tb_convert_table_fadt + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: + * Converts a BIOS supplied ACPI 1.0 FADT to an intermediate + * ACPI 2.0 FADT. If the BIOS supplied a 2.0 FADT then it is simply + * copied to the intermediate FADT. The ACPI CA software uses this + * intermediate FADT. Thus a significant amount of special #ifdef + * type codeing is saved. This intermediate FADT will need to be + * freed at some point. + * + ******************************************************************************/ - FADT2->pstate_cnt = 0; +acpi_status +acpi_tb_convert_table_fadt (void) +{ + fadt_descriptor_rev2 *local_fadt; + acpi_table_desc *table_desc; - /* Support for the _CST object and C States change notification.*/ - /* This data item hasn't any 1.0 equivalence so leaving it zero.*/ + ACPI_FUNCTION_TRACE ("Tb_convert_table_fadt"); - FADT2->cst_cnt = 0; + /* + * Acpi_gbl_FADT is valid + * Allocate and zero the 2.0 FADT buffer + */ + local_fadt = ACPI_MEM_CALLOCATE (sizeof (fadt_descriptor_rev2)); + if (local_fadt == NULL) { + return_ACPI_STATUS (AE_NO_MEMORY); + } - /* Since there isn't any equivalence in 1.0 and since it */ - /* is highly likely that a 1.0 system has legacy support. */ + /* + * FADT length and version validation. The table must be at least as + * long as the version 1.0 FADT + */ + if (acpi_gbl_FADT->header.length < sizeof (fadt_descriptor_rev1)) { + ACPI_REPORT_ERROR (("Invalid FADT table length: 0x%X\n", acpi_gbl_FADT->header.length)); + return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH); + } - FADT2->iapc_boot_arch = BAF_LEGACY_DEVICES; + if (acpi_gbl_FADT->header.revision >= FADT2_REVISION_ID) { + if (acpi_gbl_FADT->header.length < sizeof (fadt_descriptor_rev2)) { + /* Length is too short to be a V2.0 table */ + ACPI_REPORT_WARNING (("Inconsistent FADT length (0x%X) and revision (0x%X), using FADT V1.0 portion of table\n", + acpi_gbl_FADT->header.length, acpi_gbl_FADT->header.revision)); - /* - * Convert the V1.0 Block addresses to V2.0 GAS structures - * in this order: - * - * PM 1_a Events - * PM 1_b Events - * PM 1_a Control - * PM 1_b Control - * PM 2 Control - * PM Timer Control - * GPE Block 0 - * GPE Block 1 - */ + acpi_tb_convert_fadt1 (local_fadt, (void *) acpi_gbl_FADT); + } + else { + /* Valid V2.0 table */ - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xpm1a_evt_blk, FADT1->pm1_evt_len, FADT1->pm1a_evt_blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xpm1b_evt_blk, FADT1->pm1_evt_len, FADT1->pm1b_evt_blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xpm1a_cnt_blk, FADT1->pm1_cnt_len, FADT1->pm1a_cnt_blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xpm1b_cnt_blk, FADT1->pm1_cnt_len, FADT1->pm1b_cnt_blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xpm2_cnt_blk, FADT1->pm2_cnt_len, FADT1->pm2_cnt_blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xpm_tmr_blk, FADT1->pm_tm_len, FADT1->pm_tmr_blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xgpe0blk, FADT1->gpe0blk_len, FADT1->gpe0blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xgpe1_blk, FADT1->gpe1_blk_len, FADT1->gpe1_blk); -#endif + acpi_tb_convert_fadt2 (local_fadt, acpi_gbl_FADT); + } } + else { + /* Valid V1.0 table */ + acpi_tb_convert_fadt1 (local_fadt, (void *) acpi_gbl_FADT); + } /* - * Global FADT pointer will point to the common V2.0 FADT + * Global FADT pointer will point to the new common V2.0 FADT */ - acpi_gbl_FADT = FADT2; + acpi_gbl_FADT = local_fadt; acpi_gbl_FADT->header.length = sizeof (FADT_DESCRIPTOR); - /* Free the original table */ table_desc = &acpi_gbl_acpi_tables[ACPI_TABLE_FADT]; acpi_tb_delete_single_table (table_desc); - /* Install the new table */ - table_desc->pointer = (acpi_table_header *) acpi_gbl_FADT; + table_desc->pointer = (acpi_table_header *) acpi_gbl_FADT; table_desc->base_pointer = acpi_gbl_FADT; - table_desc->allocation = ACPI_MEM_ALLOCATED; - table_desc->length = sizeof (fadt_descriptor_rev2); - + table_desc->allocation = ACPI_MEM_ALLOCATED; + table_desc->length = sizeof (fadt_descriptor_rev2); /* Dump the entire FADT */ ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Hex dump of common internal FADT, size %d (%X)\n", acpi_gbl_FADT->header.length, acpi_gbl_FADT->header.length)); - DUMP_BUFFER ((u8 *) (acpi_gbl_FADT), acpi_gbl_FADT->header.length); - + ACPI_DUMP_BUFFER ((u8 *) (acpi_gbl_FADT), acpi_gbl_FADT->header.length); return_ACPI_STATUS (AE_OK); } @@ -489,11 +408,12 @@ * * FUNCTION: Acpi_tb_convert_table_facs * - * PARAMETERS: + * PARAMETERS: Table_info - Info for currently installad FACS * - * RETURN: + * RETURN: Status * - * DESCRIPTION: + * DESCRIPTION: Convert ACPI 1.0 and ACPI 2.0 FACS to a common internal + * table format. * ******************************************************************************/ @@ -501,68 +421,42 @@ acpi_tb_build_common_facs ( acpi_table_desc *table_info) { - acpi_common_facs *common_facs; - -#ifdef _IA64 - facs_descriptor_rev071 *FACS71; -#else - facs_descriptor_rev1 *FACS1; -#endif - facs_descriptor_rev2 *FACS2; + ACPI_FUNCTION_TRACE ("Tb_build_common_facs"); - FUNCTION_TRACE ("Tb_build_common_facs"); + /* Absolute minimum length is 24, but the ACPI spec says 64 */ - - /* Allocate a common FACS */ - - common_facs = ACPI_MEM_CALLOCATE (sizeof (acpi_common_facs)); - if (!common_facs) { - return_ACPI_STATUS (AE_NO_MEMORY); + if (acpi_gbl_FACS->length < 24) { + ACPI_REPORT_ERROR (("Invalid FACS table length: 0x%X\n", acpi_gbl_FACS->length)); + return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH); } + if (acpi_gbl_FACS->length < 64) { + ACPI_REPORT_WARNING (("FACS is shorter than the ACPI specification allows: 0x%X, using anyway\n", + acpi_gbl_FACS->length)); + } /* Copy fields to the new FACS */ - if (acpi_gbl_RSDP->revision < 2) { -#ifdef _IA64 - /* 0.71 FACS */ - - FACS71 = (facs_descriptor_rev071 *) acpi_gbl_FACS; - - common_facs->global_lock = (u32 *) &(FACS71->global_lock); - common_facs->firmware_waking_vector = &FACS71->firmware_waking_vector; - common_facs->vector_width = 64; -#else - /* ACPI 1.0 FACS */ - - FACS1 = (facs_descriptor_rev1 *) acpi_gbl_FACS; - - common_facs->global_lock = &(FACS1->global_lock); - common_facs->firmware_waking_vector = (u64 *) &FACS1->firmware_waking_vector; - common_facs->vector_width = 32; + acpi_gbl_common_fACS.global_lock = &(acpi_gbl_FACS->global_lock); -#endif - } + if ((acpi_gbl_RSDP->revision < 2) || + (acpi_gbl_FACS->length < 32) || + (!(ACPI_GET_ADDRESS (acpi_gbl_FACS->Xfirmware_waking_vector)))) { + /* ACPI 1.0 FACS or short table or optional X_ field is zero */ + acpi_gbl_common_fACS.firmware_waking_vector = ACPI_CAST_PTR (u64, &(acpi_gbl_FACS->firmware_waking_vector)); + acpi_gbl_common_fACS.vector_width = 32; + } else { - /* ACPI 2.0 FACS */ + /* ACPI 2.0 FACS with valid X_ field */ - FACS2 = (facs_descriptor_rev2 *) acpi_gbl_FACS; - - common_facs->global_lock = &(FACS2->global_lock); - common_facs->firmware_waking_vector = &FACS2->Xfirmware_waking_vector; - common_facs->vector_width = 64; + acpi_gbl_common_fACS.firmware_waking_vector = &acpi_gbl_FACS->Xfirmware_waking_vector; + acpi_gbl_common_fACS.vector_width = 64; } - - /* Set the global FACS pointer to point to the common FACS */ - - - acpi_gbl_FACS = common_facs; - - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS (AE_OK); } diff -urN linux-2.4.18/drivers/acpi/tables/tbget.c lia64-2.4/drivers/acpi/tables/tbget.c --- linux-2.4.18/drivers/acpi/tables/tbget.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/tables/tbget.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: tbget - ACPI Table get* routines - * $Revision: 56 $ + * $Revision: 77 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,14 +25,128 @@ #include "acpi.h" -#include "achware.h" #include "actables.h" #define _COMPONENT ACPI_TABLES - MODULE_NAME ("tbget") + ACPI_MODULE_NAME ("tbget") -#define RSDP_CHECKSUM_LENGTH 20 + +/******************************************************************************* + * + * FUNCTION: Acpi_tb_table_override + * + * PARAMETERS: *Table_info - Info for current table + * + * RETURN: None + * + * DESCRIPTION: Attempts override of current table with a new one if provided + * by the host OS. + * + ******************************************************************************/ + +void +acpi_tb_table_override ( + acpi_table_desc *table_info) +{ + acpi_table_header *new_table; + acpi_status status; + ACPI_POINTER address; + acpi_table_desc new_table_info; + + + ACPI_FUNCTION_TRACE ("Acpi_tb_table_override"); + + + status = acpi_os_table_override (table_info->pointer, &new_table); + if (ACPI_FAILURE (status)) { + /* Some severe error from the OSL, but we basically ignore it */ + + ACPI_REPORT_ERROR (("Could not override ACPI table, %s\n", + acpi_format_exception (status))); + return_VOID; + } + + if (!new_table) { + /* No table override */ + + return_VOID; + } + + /* + * We have a new table to override the old one. Get a copy of + * the new one. We know that the new table has a logical pointer. + */ + address.pointer_type = ACPI_LOGICAL_POINTER; + address.pointer.logical = new_table; + + status = acpi_tb_get_table (&address, &new_table_info); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not copy ACPI table override\n")); + return_VOID; + } + + /* + * Delete the original table + */ + acpi_tb_delete_single_table (table_info); + + /* Copy the table info */ + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Successful table override [%4.4s]\n", + ((acpi_table_header *) new_table_info.pointer)->signature)); + + ACPI_MEMCPY (table_info, &new_table_info, sizeof (acpi_table_desc)); + return_VOID; +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_tb_get_table_with_override + * + * PARAMETERS: Address - Physical or logical address of table + * *Table_info - Where the table info is returned + * + * RETURN: Status + * + * DESCRIPTION: Gets and installs the table with possible table override by OS. + * + ******************************************************************************/ + +acpi_status +acpi_tb_get_table_with_override ( + ACPI_POINTER *address, + acpi_table_desc *table_info) +{ + acpi_status status; + + + ACPI_FUNCTION_TRACE ("Acpi_tb_get_table_with_override"); + + + status = acpi_tb_get_table (address, table_info); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not get ACPI table, %s\n", + acpi_format_exception (status))); + return_ACPI_STATUS (status); + } + + /* + * Attempt override. It either happens or it doesn't, no status + */ + acpi_tb_table_override (table_info); + + /* Install the table */ + + status = acpi_tb_install_table (table_info); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not install ACPI table, %s\n", + acpi_format_exception (status))); + } + + return_ACPI_STATUS (status); +} /******************************************************************************* @@ -60,7 +174,7 @@ u32 i; - FUNCTION_TRACE ("Tb_get_table_ptr"); + ACPI_FUNCTION_TRACE ("Tb_get_table_ptr"); if (!acpi_gbl_DSDT) { @@ -71,7 +185,6 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* * For all table types (Single/Multiple), the first * instance is always in the list head. @@ -85,7 +198,6 @@ return_ACPI_STATUS (AE_OK); } - /* * Check for instance out of range */ @@ -117,10 +229,8 @@ * * FUNCTION: Acpi_tb_get_table * - * PARAMETERS: Physical_address - Physical address of table to retrieve - * *Buffer_ptr - If Buffer_ptr is valid, read data from - * buffer rather than searching memory - * *Table_info - Where the table info is returned + * PARAMETERS: Address - Physical address of table to retrieve + * *Table_info - Where the table info is returned * * RETURN: Status * @@ -130,36 +240,30 @@ acpi_status acpi_tb_get_table ( - ACPI_PHYSICAL_ADDRESS physical_address, - acpi_table_header *buffer_ptr, + ACPI_POINTER *address, acpi_table_desc *table_info) { acpi_table_header *table_header = NULL; acpi_table_header *full_table = NULL; - u32 size; + ACPI_SIZE size; u8 allocation; acpi_status status = AE_OK; - FUNCTION_TRACE ("Tb_get_table"); + ACPI_FUNCTION_TRACE ("Tb_get_table"); - if (!table_info) { + if (!table_info || !address) { return_ACPI_STATUS (AE_BAD_PARAMETER); } + switch (address->pointer_type) { + case ACPI_LOGICAL_POINTER: - if (buffer_ptr) { /* * Getting data from a buffer, not BIOS tables */ - table_header = buffer_ptr; - status = acpi_tb_validate_table_header (table_header); - if (ACPI_FAILURE (status)) { - /* Table failed verification, map all errors to BAD_DATA */ - - return_ACPI_STATUS (AE_BAD_DATA); - } + table_header = address->pointer.logical; /* Allocate buffer for the entire table */ @@ -170,23 +274,24 @@ /* Copy the entire table (including header) to the local buffer */ - size = table_header->length; - MEMCPY (full_table, buffer_ptr, size); + size = (ACPI_SIZE) table_header->length; + ACPI_MEMCPY (full_table, table_header, size); /* Save allocation type */ allocation = ACPI_MEM_ALLOCATED; - } + break; - /* - * Not reading from a buffer, just map the table's physical memory - * into our address space. - */ - else { + case ACPI_PHYSICAL_POINTER: + + /* + * Not reading from a buffer, just map the table's physical memory + * into our address space. + */ size = SIZE_IN_HEADER; - status = acpi_tb_map_acpi_table (physical_address, &size, &full_table); + status = acpi_tb_map_acpi_table (address->pointer.physical, &size, &full_table); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -194,9 +299,13 @@ /* Save allocation type */ allocation = ACPI_MEM_MAPPED; - } + break; + default: + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + /* Return values */ table_info->pointer = full_table; @@ -204,6 +313,12 @@ table_info->allocation = allocation; table_info->base_pointer = full_table; + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Found table [%4.4s] at %8.8X%8.8X, mapped/copied to %p\n", + full_table->signature, + ACPI_HIDWORD (address->pointer.physical), + ACPI_LODWORD (address->pointer.physical), full_table)); + return_ACPI_STATUS (status); } @@ -213,26 +328,31 @@ * FUNCTION: Acpi_tb_get_all_tables * * PARAMETERS: Number_of_tables - Number of tables to get - * Table_ptr - Input buffer pointer, optional * * RETURN: Status * - * DESCRIPTION: Load and validate all tables other than the RSDT. The RSDT must + * DESCRIPTION: Load and validate tables other than the RSDT. The RSDT must * already be loaded and validated. * + * Get the minimum set of ACPI tables, namely: + * + * 1) FADT (via RSDT in loop below) + * 2) FACS (via FADT) + * 3) DSDT (via FADT) + * ******************************************************************************/ acpi_status acpi_tb_get_all_tables ( - u32 number_of_tables, - acpi_table_header *table_ptr) + u32 number_of_tables) { acpi_status status = AE_OK; u32 index; acpi_table_desc table_info; + ACPI_POINTER address; - FUNCTION_TRACE ("Tb_get_all_tables"); + ACPI_FUNCTION_TRACE ("Tb_get_all_tables"); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Number of tables: %d\n", number_of_tables)); @@ -240,44 +360,43 @@ /* * Loop through all table pointers found in RSDT. * This will NOT include the FACS and DSDT - we must get - * them after the loop + * them after the loop. + * + * The ONLY table we are interested in getting here is the FADT. */ for (index = 0; index < number_of_tables; index++) { /* Clear the Table_info each time */ - MEMSET (&table_info, 0, sizeof (acpi_table_desc)); + ACPI_MEMSET (&table_info, 0, sizeof (acpi_table_desc)); /* Get the table via the XSDT */ - status = acpi_tb_get_table ((ACPI_PHYSICAL_ADDRESS) - ACPI_GET_ADDRESS (acpi_gbl_XSDT->table_offset_entry[index]), - table_ptr, &table_info); - - /* Ignore a table that failed verification */ - - if (status == AE_BAD_DATA) { - continue; - } - - /* However, abort on serious errors */ + address.pointer_type = acpi_gbl_table_flags; + address.pointer.value = ACPI_GET_ADDRESS (acpi_gbl_XSDT->table_offset_entry[index]); + status = acpi_tb_get_table (&address, &table_info); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } /* Recognize and install the table */ - status = acpi_tb_install_table (table_ptr, &table_info); + status = acpi_tb_install_table (&table_info); if (ACPI_FAILURE (status)) { /* * Unrecognized or unsupported table, delete it and ignore the * error. Just get as many tables as we can, later we will * determine if there are enough tables to continue. */ - acpi_tb_uninstall_table (&table_info); + (void) acpi_tb_uninstall_table (&table_info); + status = AE_OK; } } + if (!acpi_gbl_FADT) { + ACPI_REPORT_ERROR (("No FADT present in R/XSDT\n")); + return_ACPI_STATUS (AE_NO_ACPI_TABLES); + } /* * Convert the FADT to a common format. This allows earlier revisions of the @@ -285,32 +404,30 @@ */ status = acpi_tb_convert_table_fadt (); if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not convert FADT to internal common format\n")); return_ACPI_STATUS (status); } - - /* - * Get the minimum set of ACPI tables, namely: - * - * 1) FADT (via RSDT in loop above) - * 2) FACS - * 3) DSDT - * - */ - /* * Get the FACS (must have the FADT first, from loop above) * Acpi_tb_get_table_facs will fail if FADT pointer is not valid */ - status = acpi_tb_get_table_facs (table_ptr, &table_info); + address.pointer_type = acpi_gbl_table_flags; + address.pointer.value = ACPI_GET_ADDRESS (acpi_gbl_FADT->Xfirmware_ctrl); + + status = acpi_tb_get_table (&address, &table_info); if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not get the FACS, %s\n", + acpi_format_exception (status))); return_ACPI_STATUS (status); } /* Install the FACS */ - status = acpi_tb_install_table (table_ptr, &table_info); + status = acpi_tb_install_table (&table_info); if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not install the FACS, %s\n", + acpi_format_exception (status))); return_ACPI_STATUS (status); } @@ -323,46 +440,32 @@ return_ACPI_STATUS (status); } - /* - * Get the DSDT (We know that the FADT is valid now) + * Get/install the DSDT (We know that the FADT is valid now) */ - status = acpi_tb_get_table ((ACPI_PHYSICAL_ADDRESS) ACPI_GET_ADDRESS (acpi_gbl_FADT->Xdsdt), - table_ptr, &table_info); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - - /* Install the DSDT */ + address.pointer_type = acpi_gbl_table_flags; + address.pointer.value = ACPI_GET_ADDRESS (acpi_gbl_FADT->Xdsdt); - status = acpi_tb_install_table (table_ptr, &table_info); + status = acpi_tb_get_table_with_override (&address, &table_info); if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not get the DSDT\n")); return_ACPI_STATUS (status); } - /* Dump the DSDT Header */ + /* Set Integer Width (32/64) based upon DSDT revision */ - ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Hex dump of DSDT Header:\n")); - DUMP_BUFFER ((u8 *) acpi_gbl_DSDT, sizeof (acpi_table_header)); + acpi_ut_set_integer_width (acpi_gbl_DSDT->revision); /* Dump the entire DSDT */ ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, - "Hex dump of DSDT (After header), size %d (%x)\n", - acpi_gbl_DSDT->length, acpi_gbl_DSDT->length)); - DUMP_BUFFER ((u8 *) (acpi_gbl_DSDT + 1), acpi_gbl_DSDT->length); - - /* - * Initialize the capabilities flags. - * Assumes that platform supports ACPI_MODE since we have tables! - */ - acpi_gbl_system_flags |= acpi_hw_get_mode_capabilities (); - + "Hex dump of entire DSDT, size %d (0x%X), Integer width = %d\n", + acpi_gbl_DSDT->length, acpi_gbl_DSDT->length, acpi_gbl_integer_bit_width)); + ACPI_DUMP_BUFFER ((u8 *) acpi_gbl_DSDT, acpi_gbl_DSDT->length); /* Always delete the RSDP mapping, we are done with it */ acpi_tb_delete_acpi_table (ACPI_TABLE_RSDP); - return_ACPI_STATUS (status); } @@ -381,50 +484,69 @@ acpi_status acpi_tb_verify_rsdp ( - ACPI_PHYSICAL_ADDRESS rsdp_physical_address) + ACPI_POINTER *address) { acpi_table_desc table_info; acpi_status status; - u8 *table_ptr; + RSDP_DESCRIPTOR *rsdp; - FUNCTION_TRACE ("Tb_verify_rsdp"); + ACPI_FUNCTION_TRACE ("Tb_verify_rsdp"); - /* - * Obtain access to the RSDP structure - */ - status = acpi_os_map_memory (rsdp_physical_address, sizeof (RSDP_DESCRIPTOR), - (void **) &table_ptr); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + switch (address->pointer_type) { + case ACPI_LOGICAL_POINTER: + + rsdp = address->pointer.logical; + break; + + case ACPI_PHYSICAL_POINTER: + /* + * Obtain access to the RSDP structure + */ + status = acpi_os_map_memory (address->pointer.physical, sizeof (RSDP_DESCRIPTOR), + (void **) &rsdp); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + break; + + default: + return_ACPI_STATUS (AE_BAD_PARAMETER); } /* * The signature and checksum must both be correct */ - if (STRNCMP ((NATIVE_CHAR *) table_ptr, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) { + if (ACPI_STRNCMP ((NATIVE_CHAR *) rsdp, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) { /* Nope, BAD Signature */ status = AE_BAD_SIGNATURE; goto cleanup; } - if (acpi_tb_checksum (table_ptr, RSDP_CHECKSUM_LENGTH) != 0) { - /* Nope, BAD Checksum */ + /* Check the standard checksum */ + if (acpi_tb_checksum (rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) { status = AE_BAD_CHECKSUM; goto cleanup; } - /* TBD: Check extended checksum if table version >= 2 */ + /* Check extended checksum if table version >= 2 */ + + if (rsdp->revision >= 2) { + if (acpi_tb_checksum (rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0) { + status = AE_BAD_CHECKSUM; + goto cleanup; + } + } /* The RSDP supplied is OK */ - table_info.pointer = (acpi_table_header *) table_ptr; + table_info.pointer = ACPI_CAST_PTR (acpi_table_header, rsdp); table_info.length = sizeof (RSDP_DESCRIPTOR); table_info.allocation = ACPI_MEM_MAPPED; - table_info.base_pointer = table_ptr; + table_info.base_pointer = rsdp; /* Save the table pointers and allocation info */ @@ -433,17 +555,18 @@ goto cleanup; } - /* Save the RSDP in a global for easy access */ - acpi_gbl_RSDP = (RSDP_DESCRIPTOR *) table_info.pointer; + acpi_gbl_RSDP = ACPI_CAST_PTR (RSDP_DESCRIPTOR, table_info.pointer); return_ACPI_STATUS (status); /* Error exit */ cleanup: - acpi_os_unmap_memory (table_ptr, sizeof (RSDP_DESCRIPTOR)); + if (acpi_gbl_table_flags & ACPI_PHYSICAL_POINTER) { + acpi_os_unmap_memory (rsdp, sizeof (RSDP_DESCRIPTOR)); + } return_ACPI_STATUS (status); } @@ -461,34 +584,26 @@ * ******************************************************************************/ -ACPI_PHYSICAL_ADDRESS -acpi_tb_get_rsdt_address (void) +void +acpi_tb_get_rsdt_address ( + ACPI_POINTER *out_address) { - ACPI_PHYSICAL_ADDRESS physical_address; + ACPI_FUNCTION_ENTRY (); - FUNCTION_ENTRY (); + out_address->pointer_type = acpi_gbl_table_flags; /* * For RSDP revision 0 or 1, we use the RSDT. * For RSDP revision 2 (and above), we use the XSDT */ if (acpi_gbl_RSDP->revision < 2) { -#ifdef _IA64 - /* 0.71 RSDP has 64bit Rsdt address field */ - physical_address = ((RSDP_DESCRIPTOR_REV071 *)acpi_gbl_RSDP)->rsdt_physical_address; -#else - physical_address = (ACPI_PHYSICAL_ADDRESS) acpi_gbl_RSDP->rsdt_physical_address; -#endif + out_address->pointer.value = acpi_gbl_RSDP->rsdt_physical_address; } - else { - physical_address = (ACPI_PHYSICAL_ADDRESS) - ACPI_GET_ADDRESS (acpi_gbl_RSDP->xsdt_physical_address); + out_address->pointer.value = ACPI_GET_ADDRESS (acpi_gbl_RSDP->xsdt_physical_address); } - - return (physical_address); } @@ -508,36 +623,36 @@ acpi_tb_validate_rsdt ( acpi_table_header *table_ptr) { - u32 no_match; + int no_match; - PROC_NAME ("Tb_validate_rsdt"); + ACPI_FUNCTION_NAME ("Tb_validate_rsdt"); /* * For RSDP revision 0 or 1, we use the RSDT. - * For RSDP revision 2 (and above), we use the XSDT + * For RSDP revision 2 and above, we use the XSDT */ if (acpi_gbl_RSDP->revision < 2) { - no_match = STRNCMP ((char *) table_ptr, RSDT_SIG, + no_match = ACPI_STRNCMP ((char *) table_ptr, RSDT_SIG, sizeof (RSDT_SIG) -1); } else { - no_match = STRNCMP ((char *) table_ptr, XSDT_SIG, + no_match = ACPI_STRNCMP ((char *) table_ptr, XSDT_SIG, sizeof (XSDT_SIG) -1); } - if (no_match) { /* Invalid RSDT or XSDT signature */ - REPORT_ERROR (("Invalid signature where RSDP indicates RSDT/XSDT should be located\n")); + ACPI_REPORT_ERROR (("Invalid signature where RSDP indicates RSDT/XSDT should be located\n")); - DUMP_BUFFER (acpi_gbl_RSDP, 20); + ACPI_DUMP_BUFFER (acpi_gbl_RSDP, 20); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, - "RSDT/XSDT signature at %X is invalid\n", - acpi_gbl_RSDP->rsdt_physical_address)); + "RSDT/XSDT signature at %X (%p) is invalid\n", + acpi_gbl_RSDP->rsdt_physical_address, + (void *) (NATIVE_UINT) acpi_gbl_RSDP->rsdt_physical_address)); return (AE_BAD_SIGNATURE); } @@ -562,27 +677,57 @@ acpi_status acpi_tb_get_table_pointer ( - ACPI_PHYSICAL_ADDRESS physical_address, + ACPI_POINTER *address, u32 flags, - u32 *size, + ACPI_SIZE *size, acpi_table_header **table_ptr) { - acpi_status status; + acpi_status status = AE_OK; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); + /* + * What mode is the processor in? (Virtual or Physical addressing) + */ if ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING) { - *size = SIZE_IN_HEADER; - status = acpi_tb_map_acpi_table (physical_address, size, table_ptr); - } + /* Incoming pointer can be either logical or physical */ + + switch (address->pointer_type) { + case ACPI_PHYSICAL_POINTER: + *size = SIZE_IN_HEADER; + status = acpi_tb_map_acpi_table (address->pointer.physical, size, table_ptr); + break; + + case ACPI_LOGICAL_POINTER: + + *table_ptr = address->pointer.logical; + *size = 0; + break; + + default: + return (AE_BAD_PARAMETER); + } + } else { - *size = 0; - *table_ptr = (acpi_table_header *) (ACPI_TBLPTR) physical_address; + /* In Physical addressing mode, all pointers must be physical */ + + switch (address->pointer_type) { + case ACPI_PHYSICAL_POINTER: + *size = 0; + *table_ptr = address->pointer.logical; + break; + + case ACPI_LOGICAL_POINTER: - status = AE_OK; + status = AE_BAD_PARAMETER; + break; + + default: + return (AE_BAD_PARAMETER); + } } return (status); @@ -607,33 +752,27 @@ { acpi_table_desc table_info; acpi_status status; - ACPI_PHYSICAL_ADDRESS physical_address; + ACPI_POINTER address; - FUNCTION_TRACE ("Tb_get_table_rsdt"); + ACPI_FUNCTION_TRACE ("Tb_get_table_rsdt"); - /* - * Get the RSDT from the RSDP - */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "RSDP located at %p, RSDT physical=%8.8X%8.8X \n", - acpi_gbl_RSDP, HIDWORD(acpi_gbl_RSDP->rsdt_physical_address), - LODWORD(acpi_gbl_RSDP->rsdt_physical_address))); - + /* Get the RSDT/XSDT from the RSDP */ - physical_address = acpi_tb_get_rsdt_address (); - - - /* Get the RSDT/XSDT */ - - status = acpi_tb_get_table (physical_address, NULL, &table_info); + acpi_tb_get_rsdt_address (&address); + status = acpi_tb_get_table (&address, &table_info); if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not get the RSDT, %s\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not get the R/XSDT, %s\n", acpi_format_exception (status))); return_ACPI_STATUS (status); } + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "RSDP located at %p, RSDT physical=%8.8X%8.8X \n", + acpi_gbl_RSDP, + ACPI_HIDWORD (address.pointer.value), + ACPI_LODWORD (address.pointer.value))); /* Check the RSDT or XSDT signature */ @@ -642,14 +781,12 @@ return_ACPI_STATUS (status); } - /* * Valid RSDT signature, verify the checksum. If it fails, just * print a warning and ignore it. */ status = acpi_tb_verify_table_checksum (table_info.pointer); - /* Convert and/or copy to an XSDT structure */ status = acpi_tb_convert_to_xsdt (&table_info, number_of_tables); @@ -667,88 +804,7 @@ acpi_gbl_XSDT = (xsdt_descriptor *) table_info.pointer; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "XSDT located at %p\n", acpi_gbl_XSDT)); - return_ACPI_STATUS (status); } - -/****************************************************************************** - * - * FUNCTION: Acpi_tb_get_table_facs - * - * PARAMETERS: *Buffer_ptr - If Buffer_ptr is valid, read data from - * buffer rather than searching memory - * *Table_info - Where the table info is returned - * - * RETURN: Status - * - * DESCRIPTION: Returns a pointer to the FACS as defined in FADT. This - * function assumes the global variable FADT has been - * correctly initialized. The value of FADT->Firmware_ctrl - * into a far pointer which is returned. - * - *****************************************************************************/ - -acpi_status -acpi_tb_get_table_facs ( - acpi_table_header *buffer_ptr, - acpi_table_desc *table_info) -{ - acpi_table_header *table_ptr = NULL; - u32 size; - u8 allocation; - acpi_status status = AE_OK; - - - FUNCTION_TRACE ("Tb_get_table_facs"); - - - /* Must have a valid FADT pointer */ - - if (!acpi_gbl_FADT) { - return_ACPI_STATUS (AE_NO_ACPI_TABLES); - } - - size = sizeof (FACS_DESCRIPTOR); - if (buffer_ptr) { - /* - * Getting table from a file -- allocate a buffer and - * read the table. - */ - table_ptr = ACPI_MEM_ALLOCATE (size); - if(!table_ptr) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - MEMCPY (table_ptr, buffer_ptr, size); - - /* Save allocation type */ - - allocation = ACPI_MEM_ALLOCATED; - } - - else { - /* Just map the physical memory to our address space */ - - status = acpi_tb_map_acpi_table ((ACPI_PHYSICAL_ADDRESS) ACPI_GET_ADDRESS (acpi_gbl_FADT->Xfirmware_ctrl), - &size, &table_ptr); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - - /* Save allocation type */ - - allocation = ACPI_MEM_MAPPED; - } - - - /* Return values */ - - table_info->pointer = table_ptr; - table_info->length = size; - table_info->allocation = allocation; - table_info->base_pointer = table_ptr; - - return_ACPI_STATUS (status); -} diff -urN linux-2.4.18/drivers/acpi/tables/tbinstal.c lia64-2.4/drivers/acpi/tables/tbinstal.c --- linux-2.4.18/drivers/acpi/tables/tbinstal.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/tables/tbinstal.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: tbinstal - ACPI table installation and removal - * $Revision: 45 $ + * $Revision: 61 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,20 +25,66 @@ #include "acpi.h" -#include "achware.h" #include "actables.h" #define _COMPONENT ACPI_TABLES - MODULE_NAME ("tbinstal") + ACPI_MODULE_NAME ("tbinstal") + + +/******************************************************************************* + * + * FUNCTION: Acpi_tb_match_signature + * + * PARAMETERS: Signature - Table signature to match + * Table_info - Return data + * + * RETURN: Status + * + * DESCRIPTION: Compare signature against the list of "ACPI-subsystem-owned" + * tables (DSDT/FADT/SSDT, etc.) Returns the Table_type_iD on match. + * + ******************************************************************************/ + +acpi_status +acpi_tb_match_signature ( + NATIVE_CHAR *signature, + acpi_table_desc *table_info) +{ + NATIVE_UINT i; + + + ACPI_FUNCTION_TRACE ("Tb_match_signature"); + + + /* + * Search for a signature match among the known table types + */ + for (i = 0; i < NUM_ACPI_TABLES; i++) { + if (!ACPI_STRNCMP (signature, acpi_gbl_acpi_table_data[i].signature, + acpi_gbl_acpi_table_data[i].sig_length)) { + /* Found a signature match, return index if requested */ + + if (table_info) { + table_info->type = (u8) i; + } + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Signature match %4.4s\n", + (char *) acpi_gbl_acpi_table_data[i].signature)); + + return_ACPI_STATUS (AE_OK); + } + } + + return_ACPI_STATUS (AE_TABLE_NOT_SUPPORTED); +} /******************************************************************************* * * FUNCTION: Acpi_tb_install_table * - * PARAMETERS: Table_ptr - Input buffer pointer, optional - * Table_info - Return value from Acpi_tb_get_table + * PARAMETERS: Table_info - Return value from Acpi_tb_get_table * * RETURN: Status * @@ -50,26 +96,28 @@ acpi_status acpi_tb_install_table ( - acpi_table_header *table_ptr, acpi_table_desc *table_info) { acpi_status status; - FUNCTION_TRACE ("Tb_install_table"); + ACPI_FUNCTION_TRACE ("Tb_install_table"); /* * Check the table signature and make sure it is recognized * Also checks the header checksum */ - status = acpi_tb_recognize_table (table_ptr, table_info); + status = acpi_tb_recognize_table (table_info); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } /* Lock tables while installing */ - acpi_ut_acquire_mutex (ACPI_MTX_TABLES); + status = acpi_ut_acquire_mutex (ACPI_MTX_TABLES); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* Install the table into the global data structure */ @@ -78,7 +126,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s located at %p\n", acpi_gbl_acpi_table_data[table_info->type].name, table_info->pointer)); - acpi_ut_release_mutex (ACPI_MTX_TABLES); + (void) acpi_ut_release_mutex (ACPI_MTX_TABLES); return_ACPI_STATUS (status); } @@ -87,8 +135,7 @@ * * FUNCTION: Acpi_tb_recognize_table * - * PARAMETERS: Table_ptr - Input buffer pointer, optional - * Table_info - Return value from Acpi_tb_get_table + * PARAMETERS: Table_info - Return value from Acpi_tb_get_table * * RETURN: Status * @@ -106,16 +153,13 @@ acpi_status acpi_tb_recognize_table ( - acpi_table_header *table_ptr, acpi_table_desc *table_info) { acpi_table_header *table_header; acpi_status status; - acpi_table_type table_type = 0; - u32 i; - FUNCTION_TRACE ("Tb_recognize_table"); + ACPI_FUNCTION_TRACE ("Tb_recognize_table"); /* Ensure that we have a valid table pointer */ @@ -126,52 +170,41 @@ } /* - * Search for a signature match among the known table types - * Start at index one -> Skip the RSDP + * We only "recognize" a limited number of ACPI tables -- namely, the + * ones that are used by the subsystem (DSDT, FADT, etc.) + * + * An AE_TABLE_NOT_SUPPORTED means that the table was not recognized. + * This can be any one of many valid ACPI tables, it just isn't one of + * the tables that is consumed by the core subsystem */ - status = AE_SUPPORT; - for (i = 1; i < NUM_ACPI_TABLES; i++) { - if (!STRNCMP (table_header->signature, - acpi_gbl_acpi_table_data[i].signature, - acpi_gbl_acpi_table_data[i].sig_length)) { - /* - * Found a signature match, get the pertinent info from the - * Table_data structure - */ - table_type = i; - status = acpi_gbl_acpi_table_data[i].status; + status = acpi_tb_match_signature (table_header->signature, table_info); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Found %4.4s\n", - (char*)acpi_gbl_acpi_table_data[i].signature)); - break; - } + status = acpi_tb_validate_table_header (table_header); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } /* Return the table type and length via the info struct */ - table_info->type = (u8) table_type; - table_info->length = table_header->length; - + table_info->length = (ACPI_SIZE) table_header->length; /* * Validate checksum for _most_ tables, * even the ones whose signature we don't recognize */ - if (table_type != ACPI_TABLE_FACS) { - /* But don't abort if the checksum is wrong */ - /* TBD: [Future] make this a configuration option? */ + if (table_info->type != ACPI_TABLE_FACS) { + status = acpi_tb_verify_table_checksum (table_header); - acpi_tb_verify_table_checksum (table_header); - } +#if (!ACPI_CHECKSUM_ABORT) + if (ACPI_FAILURE (status)) { + /* Ignore the error if configuration says so */ - /* - * An AE_SUPPORT means that the table was not recognized. - * We basically ignore this; just print a debug message - */ - if (status == AE_SUPPORT) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Unsupported table %s (Type %X) was found and discarded\n", - acpi_gbl_acpi_table_data[table_type].name, table_type)); + status = AE_OK; + } +#endif } return_ACPI_STATUS (status); @@ -200,7 +233,7 @@ acpi_table_desc *table_desc; - FUNCTION_TRACE_U32 ("Tb_init_table_descriptor", table_type); + ACPI_FUNCTION_TRACE_U32 ("Tb_init_table_descriptor", table_type); /* * Install the table into the global data structure @@ -208,25 +241,24 @@ list_head = &acpi_gbl_acpi_tables[table_type]; table_desc = list_head; - /* * Two major types of tables: 1) Only one instance is allowed. This * includes most ACPI tables such as the DSDT. 2) Multiple instances of * the table are allowed. This includes SSDT and PSDTs. */ - if (IS_SINGLE_TABLE (acpi_gbl_acpi_table_data[table_type].flags)) { + if (ACPI_IS_SINGLE_TABLE (acpi_gbl_acpi_table_data[table_type].flags)) { /* * Only one table allowed, and a table has alread been installed * at this location, so return an error. */ if (list_head->pointer) { - return_ACPI_STATUS (AE_EXIST); + return_ACPI_STATUS (AE_ALREADY_EXISTS); } table_desc->count = 1; + table_desc->prev = NULL; + table_desc->next = NULL; } - - else { /* * Multiple tables allowed for this table type, we must link @@ -253,15 +285,14 @@ list_head->prev = table_desc; } - else { table_desc->count = 1; } } - /* Common initialization of the table descriptor */ + table_desc->type = table_info->type; table_desc->pointer = table_info->pointer; table_desc->base_pointer = table_info->base_pointer; table_desc->length = table_info->length; @@ -269,7 +300,7 @@ table_desc->aml_start = (u8 *) (table_desc->pointer + 1), table_desc->aml_length = (u32) (table_desc->length - (u32) sizeof (acpi_table_header)); - table_desc->table_id = acpi_ut_allocate_owner_id (OWNER_TYPE_TABLE); + table_desc->table_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_TABLE); table_desc->loaded_into_namespace = FALSE; /* @@ -280,7 +311,6 @@ *(acpi_gbl_acpi_table_data[table_type].global_ptr) = table_info->pointer; } - /* Return Data */ table_info->table_id = table_desc->table_id; @@ -315,7 +345,6 @@ for (type = 0; type < NUM_ACPI_TABLES; type++) { acpi_tb_delete_acpi_table (type); } - } @@ -336,20 +365,17 @@ acpi_tb_delete_acpi_table ( acpi_table_type type) { - FUNCTION_TRACE_U32 ("Tb_delete_acpi_table", type); + + ACPI_FUNCTION_TRACE_U32 ("Tb_delete_acpi_table", type); if (type > ACPI_TABLE_MAX) { return_VOID; } - - acpi_ut_acquire_mutex (ACPI_MTX_TABLES); - - /* Free the table */ - - acpi_tb_free_acpi_tables_of_type (&acpi_gbl_acpi_tables[type]); - + if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_TABLES))) { + return; + } /* Clear the appropriate "typed" global table pointer */ @@ -380,8 +406,11 @@ break; } - acpi_ut_release_mutex (ACPI_MTX_TABLES); + /* Free the table */ + + acpi_tb_free_acpi_tables_of_type (&acpi_gbl_acpi_tables[type]); + (void) acpi_ut_release_mutex (ACPI_MTX_TABLES); return_VOID; } @@ -408,7 +437,7 @@ u32 i; - FUNCTION_TRACE_PTR ("Tb_free_acpi_tables_of_type", list_head); + ACPI_FUNCTION_TRACE_PTR ("Tb_free_acpi_tables_of_type", list_head); /* Get the head of the list */ @@ -454,21 +483,21 @@ /* Valid table, determine type of memory allocation */ switch (table_desc->allocation) { - case ACPI_MEM_NOT_ALLOCATED: break; - case ACPI_MEM_ALLOCATED: ACPI_MEM_FREE (table_desc->base_pointer); break; - case ACPI_MEM_MAPPED: acpi_os_unmap_memory (table_desc->base_pointer, table_desc->length); break; + + default: + break; } } } @@ -480,7 +509,7 @@ * * PARAMETERS: Table_info - A table info struct * - * RETURN: None. + * RETURN: Pointer to the next table in the list (of same type) * * DESCRIPTION: Free the memory associated with an internal ACPI table that * is either installed or has never been installed. @@ -495,14 +524,13 @@ acpi_table_desc *next_desc; - FUNCTION_TRACE_PTR ("Tb_delete_single_table", table_desc); + ACPI_FUNCTION_TRACE_PTR ("Acpi_tb_uninstall_table", table_desc); if (!table_desc) { return_PTR (NULL); } - /* Unlink the descriptor */ if (table_desc->prev) { @@ -513,16 +541,13 @@ table_desc->next->prev = table_desc->prev; } - /* Free the memory allocated for the table itself */ acpi_tb_delete_single_table (table_desc); - /* Free the table descriptor (Don't delete the list head, tho) */ if ((table_desc->prev) == (table_desc->next)) { - next_desc = NULL; /* Clear the list head */ @@ -530,16 +555,13 @@ table_desc->pointer = NULL; table_desc->length = 0; table_desc->count = 0; - } - else { /* Free the table descriptor */ next_desc = table_desc->next; ACPI_MEM_FREE (table_desc); } - return_PTR (next_desc); } diff -urN linux-2.4.18/drivers/acpi/tables/tbutils.c lia64-2.4/drivers/acpi/tables/tbutils.c --- linux-2.4.18/drivers/acpi/tables/tbutils.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/tables/tbutils.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: tbutils - Table manipulation utilities - * $Revision: 42 $ + * $Revision: 53 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,11 +26,10 @@ #include "acpi.h" #include "actables.h" -#include "acinterp.h" #define _COMPONENT ACPI_TABLES - MODULE_NAME ("tbutils") + ACPI_MODULE_NAME ("tbutils") /******************************************************************************* @@ -55,7 +54,7 @@ acpi_table_desc *list_head; - PROC_NAME ("Tb_handle_to_object"); + ACPI_FUNCTION_NAME ("Tb_handle_to_object"); for (i = 0; i < ACPI_TABLE_MAX; i++) { @@ -71,7 +70,6 @@ } while (list_head != &acpi_gbl_acpi_tables[i]); } - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Table_id=%X does not exist\n", table_id)); return (AE_BAD_PARAMETER); } @@ -79,81 +77,6 @@ /******************************************************************************* * - * FUNCTION: Acpi_tb_system_table_pointer - * - * PARAMETERS: *Where - Pointer to be examined - * - * RETURN: TRUE if Where is within the AML stream (in one of the ACPI - * system tables such as the DSDT or an SSDT.) - * FALSE otherwise - * - ******************************************************************************/ - -u8 -acpi_tb_system_table_pointer ( - void *where) -{ - u32 i; - acpi_table_desc *table_desc; - acpi_table_header *table; - - - /* No function trace, called too often! */ - - - /* Ignore null pointer */ - - if (!where) { - return (FALSE); - } - - - /* Check for a pointer within the DSDT */ - - if ((acpi_gbl_DSDT) && - (IS_IN_ACPI_TABLE (where, acpi_gbl_DSDT))) { - return (TRUE); - } - - - /* Check each of the loaded SSDTs (if any)*/ - - table_desc = &acpi_gbl_acpi_tables[ACPI_TABLE_SSDT]; - - for (i = 0; i < acpi_gbl_acpi_tables[ACPI_TABLE_SSDT].count; i++) { - table = table_desc->pointer; - - if (IS_IN_ACPI_TABLE (where, table)) { - return (TRUE); - } - - table_desc = table_desc->next; - } - - - /* Check each of the loaded PSDTs (if any)*/ - - table_desc = &acpi_gbl_acpi_tables[ACPI_TABLE_PSDT]; - - for (i = 0; i < acpi_gbl_acpi_tables[ACPI_TABLE_PSDT].count; i++) { - table = table_desc->pointer; - - if (IS_IN_ACPI_TABLE (where, table)) { - return (TRUE); - } - - table_desc = table_desc->next; - } - - - /* Pointer does not point into any system table */ - - return (FALSE); -} - - -/******************************************************************************* - * * FUNCTION: Acpi_tb_validate_table_header * * PARAMETERS: Table_header - Logical pointer to the table @@ -179,7 +102,7 @@ acpi_name signature; - PROC_NAME ("Tb_validate_table_header"); + ACPI_FUNCTION_NAME ("Tb_validate_table_header"); /* Verify that this is a valid address */ @@ -190,30 +113,28 @@ return (AE_BAD_ADDRESS); } - /* Ensure that the signature is 4 ASCII characters */ - MOVE_UNALIGNED32_TO_32 (&signature, &table_header->signature); + ACPI_MOVE_UNALIGNED32_TO_32 (&signature, table_header->signature); if (!acpi_ut_valid_acpi_name (signature)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Table signature at %p [%p] has invalid characters\n", table_header, &signature)); - REPORT_WARNING (("Invalid table signature %4.4s found\n", (char*)&signature)); - DUMP_BUFFER (table_header, sizeof (acpi_table_header)); + ACPI_REPORT_WARNING (("Invalid table signature found: [%4.4s]\n", (char *) &signature)); + ACPI_DUMP_BUFFER (table_header, sizeof (acpi_table_header)); return (AE_BAD_SIGNATURE); } - /* Validate the table length */ if (table_header->length < sizeof (acpi_table_header)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid length in table header %p name %4.4s\n", - table_header, (char*)&signature)); + table_header, (char *) &signature)); - REPORT_WARNING (("Invalid table header length found\n")); - DUMP_BUFFER (table_header, sizeof (acpi_table_header)); + ACPI_REPORT_WARNING (("Invalid table header length (0x%X) found\n", table_header->length)); + ACPI_DUMP_BUFFER (table_header, sizeof (acpi_table_header)); return (AE_BAD_HEADER); } @@ -240,15 +161,15 @@ acpi_status acpi_tb_map_acpi_table ( ACPI_PHYSICAL_ADDRESS physical_address, - u32 *size, + ACPI_SIZE *size, acpi_table_header **logical_address) { acpi_table_header *table; - u32 table_size = *size; + ACPI_SIZE table_size = *size; acpi_status status = AE_OK; - PROC_NAME ("Tb_map_acpi_table"); + ACPI_FUNCTION_NAME ("Tb_map_acpi_table"); /* If size is zero, look at the table header to get the actual size */ @@ -264,7 +185,7 @@ /* Extract the full table length before we delete the mapping */ - table_size = table->length; + table_size = (ACPI_SIZE) table->length; /* * Validate the header and delete the mapping. @@ -283,10 +204,10 @@ } } - /* Map the physical memory for the correct length */ - status = acpi_os_map_memory (physical_address, table_size, (void **) &table); + status = acpi_os_map_memory (physical_address, table_size, + (void **) &table); if (ACPI_FAILURE (status)) { return (status); } @@ -297,7 +218,6 @@ *size = table_size; *logical_address = table; - return (status); } @@ -323,7 +243,7 @@ acpi_status status = AE_OK; - FUNCTION_TRACE ("Tb_verify_table_checksum"); + ACPI_FUNCTION_TRACE ("Tb_verify_table_checksum"); /* Compute the checksum on the table */ @@ -333,13 +253,11 @@ /* Return the appropriate exception */ if (checksum) { - REPORT_WARNING (("Invalid checksum (%X) in table %4.4s\n", - checksum, (char*)&table_header->signature)); + ACPI_REPORT_WARNING (("Invalid checksum (%X) in table %4.4s\n", + checksum, table_header->signature)); status = AE_BAD_CHECKSUM; } - - return_ACPI_STATUS (status); } @@ -362,8 +280,8 @@ void *buffer, u32 length) { - u8 *limit; - u8 *rover; + const u8 *limit; + const u8 *rover; u8 sum = 0; @@ -376,7 +294,6 @@ sum = (u8) (sum + *rover); } } - return (sum); } diff -urN linux-2.4.18/drivers/acpi/tables/tbxface.c lia64-2.4/drivers/acpi/tables/tbxface.c --- linux-2.4.18/drivers/acpi/tables/tbxface.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/tables/tbxface.c Tue Jun 11 14:24:23 2002 @@ -2,12 +2,12 @@ * * Module Name: tbxface - Public interfaces to the ACPI subsystem * ACPI table oriented interfaces - * $Revision: 45 $ + * $Revision: 57 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,12 +27,11 @@ #include "acpi.h" #include "acnamesp.h" -#include "acinterp.h" #include "actables.h" #define _COMPONENT ACPI_TABLES - MODULE_NAME ("tbxface") + ACPI_MODULE_NAME ("tbxface") /******************************************************************************* @@ -51,29 +50,31 @@ acpi_status acpi_load_tables (void) { - ACPI_PHYSICAL_ADDRESS rsdp_physical_address; + ACPI_POINTER rsdp_address; acpi_status status; u32 number_of_tables = 0; - FUNCTION_TRACE ("Acpi_load_tables"); + ACPI_FUNCTION_TRACE ("Acpi_load_tables"); /* Get the RSDP */ status = acpi_os_get_root_pointer (ACPI_LOGICAL_ADDRESSING, - &rsdp_physical_address); + &rsdp_address); if (ACPI_FAILURE (status)) { - REPORT_ERROR (("Acpi_load_tables: Could not get RSDP, %s\n", + ACPI_REPORT_ERROR (("Acpi_load_tables: Could not get RSDP, %s\n", acpi_format_exception (status))); goto error_exit; } /* Map and validate the RSDP */ - status = acpi_tb_verify_rsdp (rsdp_physical_address); + acpi_gbl_table_flags = rsdp_address.pointer_type; + + status = acpi_tb_verify_rsdp (&rsdp_address); if (ACPI_FAILURE (status)) { - REPORT_ERROR (("Acpi_load_tables: RSDP Failed validation: %s\n", + ACPI_REPORT_ERROR (("Acpi_load_tables: RSDP Failed validation: %s\n", acpi_format_exception (status))); goto error_exit; } @@ -82,16 +83,16 @@ status = acpi_tb_get_table_rsdt (&number_of_tables); if (ACPI_FAILURE (status)) { - REPORT_ERROR (("Acpi_load_tables: Could not load RSDT: %s\n", + ACPI_REPORT_ERROR (("Acpi_load_tables: Could not load RSDT: %s\n", acpi_format_exception (status))); goto error_exit; } /* Now get the rest of the tables */ - status = acpi_tb_get_all_tables (number_of_tables, NULL); + status = acpi_tb_get_all_tables (number_of_tables); if (ACPI_FAILURE (status)) { - REPORT_ERROR (("Acpi_load_tables: Error getting required tables (DSDT/FADT/FACS): %s\n", + ACPI_REPORT_ERROR (("Acpi_load_tables: Error getting required tables (DSDT/FADT/FACS): %s\n", acpi_format_exception (status))); goto error_exit; } @@ -103,7 +104,7 @@ status = acpi_ns_load_namespace (); if (ACPI_FAILURE (status)) { - REPORT_ERROR (("Acpi_load_tables: Could not load namespace: %s\n", + ACPI_REPORT_ERROR (("Acpi_load_tables: Could not load namespace: %s\n", acpi_format_exception (status))); goto error_exit; } @@ -112,7 +113,7 @@ error_exit: - REPORT_ERROR (("Acpi_load_tables: Could not load tables: %s\n", + ACPI_REPORT_ERROR (("Acpi_load_tables: Could not load tables: %s\n", acpi_format_exception (status))); return_ACPI_STATUS (status); @@ -141,9 +142,10 @@ { acpi_status status; acpi_table_desc table_info; + ACPI_POINTER address; - FUNCTION_TRACE ("Acpi_load_table"); + ACPI_FUNCTION_TRACE ("Acpi_load_table"); if (!table_ptr) { @@ -152,14 +154,17 @@ /* Copy the table to a local buffer */ - status = acpi_tb_get_table (0, table_ptr, &table_info); + address.pointer_type = ACPI_LOGICAL_POINTER; + address.pointer.logical = table_ptr; + + status = acpi_tb_get_table (&address, &table_info); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } /* Install the new table into the local data structures */ - status = acpi_tb_install_table (NULL, &table_info); + status = acpi_tb_install_table (&table_info); if (ACPI_FAILURE (status)) { /* Free table allocated by Acpi_tb_get_table */ @@ -167,16 +172,32 @@ return_ACPI_STATUS (status); } + /* Convert the table to common format if necessary */ + + switch (table_info.type) { + case ACPI_TABLE_FADT: + + status = acpi_tb_convert_table_fadt (); + break; + + case ACPI_TABLE_FACS: + + status = acpi_tb_build_common_facs (&table_info); + break; + + default: + /* Load table into namespace if it contains executable AML */ + + status = acpi_ns_load_table (table_info.installed_desc, acpi_gbl_root_node); + break; + } - status = acpi_ns_load_table (table_info.installed_desc, acpi_gbl_root_node); if (ACPI_FAILURE (status)) { /* Uninstall table and free the buffer */ - acpi_tb_uninstall_table (table_info.installed_desc); - return_ACPI_STATUS (status); + (void) acpi_tb_uninstall_table (table_info.installed_desc); } - return_ACPI_STATUS (status); } @@ -200,7 +221,7 @@ acpi_table_desc *list_head; - FUNCTION_TRACE ("Acpi_unload_table"); + ACPI_FUNCTION_TRACE ("Acpi_unload_table"); /* Parameter validation */ @@ -263,7 +284,7 @@ acpi_status status; - FUNCTION_TRACE ("Acpi_get_table_header"); + ACPI_FUNCTION_TRACE ("Acpi_get_table_header"); if ((instance == 0) || @@ -275,7 +296,7 @@ /* Check the table type and instance */ if ((table_type > ACPI_TABLE_MAX) || - (IS_SINGLE_TABLE (acpi_gbl_acpi_table_data[table_type].flags) && + (ACPI_IS_SINGLE_TABLE (acpi_gbl_acpi_table_data[table_type].flags) && instance > 1)) { return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -298,7 +319,7 @@ /* * Copy the header to the caller's buffer */ - MEMCPY ((void *) out_table_header, (void *) tbl_ptr, + ACPI_MEMCPY ((void *) out_table_header, (void *) tbl_ptr, sizeof (acpi_table_header)); return_ACPI_STATUS (status); @@ -336,25 +357,27 @@ { acpi_table_header *tbl_ptr; acpi_status status; - u32 ret_buf_len; + ACPI_SIZE table_length; - FUNCTION_TRACE ("Acpi_get_table"); + ACPI_FUNCTION_TRACE ("Acpi_get_table"); - /* - * If we have a buffer, we must have a length too - */ - if ((instance == 0) || - (!ret_buffer) || - ((!ret_buffer->pointer) && (ret_buffer->length))) { + /* Parameter validation */ + + if (instance == 0) { return_ACPI_STATUS (AE_BAD_PARAMETER); } + status = acpi_ut_validate_buffer (ret_buffer); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + /* Check the table type and instance */ if ((table_type > ACPI_TABLE_MAX) || - (IS_SINGLE_TABLE (acpi_gbl_acpi_table_data[table_type].flags) && + (ACPI_IS_SINGLE_TABLE (acpi_gbl_acpi_table_data[table_type].flags) && instance > 1)) { return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -375,31 +398,28 @@ return_ACPI_STATUS (AE_NOT_EXIST); } - /* - * Got a table ptr, assume it's ok and copy it to the user's buffer - */ + /* Get the table length */ + if (table_type == ACPI_TABLE_RSDP) { /* * RSD PTR is the only "table" without a header */ - ret_buf_len = sizeof (RSDP_DESCRIPTOR); + table_length = sizeof (RSDP_DESCRIPTOR); } else { - ret_buf_len = tbl_ptr->length; + table_length = (ACPI_SIZE) tbl_ptr->length; } - /* - * Verify we have space in the caller's buffer for the table - */ - if (ret_buffer->length < ret_buf_len) { - ret_buffer->length = ret_buf_len; - return_ACPI_STATUS (AE_BUFFER_OVERFLOW); - } + /* Validate/Allocate/Clear caller buffer */ - ret_buffer->length = ret_buf_len; + status = acpi_ut_initialize_buffer (ret_buffer, table_length); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - MEMCPY ((void *) ret_buffer->pointer, (void *) tbl_ptr, ret_buf_len); + /* Copy the table to the buffer */ + ACPI_MEMCPY ((void *) ret_buffer->pointer, (void *) tbl_ptr, table_length); return_ACPI_STATUS (AE_OK); } diff -urN linux-2.4.18/drivers/acpi/tables/tbxfroot.c lia64-2.4/drivers/acpi/tables/tbxfroot.c --- linux-2.4.18/drivers/acpi/tables/tbxfroot.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/tables/tbxfroot.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: tbxfroot - Find the root ACPI table (RSDT) - * $Revision: 52 $ + * $Revision: 63 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,22 +25,261 @@ #include "acpi.h" -#include "achware.h" #include "actables.h" #define _COMPONENT ACPI_TABLES - MODULE_NAME ("tbxfroot") + ACPI_MODULE_NAME ("tbxfroot") -#define RSDP_CHECKSUM_LENGTH 20 +/******************************************************************************* + * + * FUNCTION: Acpi_tb_find_table + * + * PARAMETERS: Signature - String with ACPI table signature + * Oem_id - String with the table OEM ID + * Oem_table_id - String with the OEM Table ID. + * + * RETURN: Status + * + * DESCRIPTION: Find an ACPI table (in the RSDT/XSDT) that matches the + * Signature, OEM ID and OEM Table ID. + * + ******************************************************************************/ + +acpi_status +acpi_tb_find_table ( + NATIVE_CHAR *signature, + NATIVE_CHAR *oem_id, + NATIVE_CHAR *oem_table_id, + acpi_table_header **table_ptr) +{ + acpi_status status; + acpi_table_header *table; + + + ACPI_FUNCTION_TRACE ("Tb_find_table"); + + + /* Validate string lengths */ + + if ((ACPI_STRLEN (signature) > 4) || + (ACPI_STRLEN (oem_id) > 6) || + (ACPI_STRLEN (oem_table_id) > 8)) { + return_ACPI_STATUS (AE_AML_STRING_LIMIT); + } + + /* Find the table */ + + status = acpi_get_firmware_table (signature, 1, + ACPI_LOGICAL_ADDRESSING, &table); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + /* Check Oem_id and Oem_table_id */ + + if ((oem_id[0] && ACPI_STRCMP (oem_id, table->oem_id)) || + (oem_table_id[0] && ACPI_STRCMP (oem_table_id, table->oem_table_id))) { + return_ACPI_STATUS (AE_AML_NAME_NOT_FOUND); + } + + *table_ptr = table; + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_get_firmware_table + * + * PARAMETERS: Signature - Any ACPI table signature + * Instance - the non zero instance of the table, allows + * support for multiple tables of the same type + * Flags - 0: Physical/Virtual support + * Ret_buffer - pointer to a structure containing a buffer to + * receive the table + * + * RETURN: Status + * + * DESCRIPTION: This function is called to get an ACPI table. The caller + * supplies an Out_buffer large enough to contain the entire ACPI + * table. Upon completion + * the Out_buffer->Length field will indicate the number of bytes + * copied into the Out_buffer->Buf_ptr buffer. This table will be + * a complete table including the header. + * + ******************************************************************************/ + +acpi_status +acpi_get_firmware_table ( + acpi_string signature, + u32 instance, + u32 flags, + acpi_table_header **table_pointer) +{ + ACPI_POINTER rsdp_address; + ACPI_POINTER address; + acpi_table_header *rsdt_ptr = NULL; + acpi_table_header *table_ptr; + acpi_status status; + ACPI_SIZE rsdt_size = 0; + ACPI_SIZE table_size; + u32 table_count; + u32 i; + u32 j; + + + ACPI_FUNCTION_TRACE ("Acpi_get_firmware_table"); + + + /* + * Ensure that at least the table manager is initialized. We don't + * require that the entire ACPI subsystem is up for this interface + */ + + /* + * If we have a buffer, we must have a length too + */ + if ((instance == 0) || + (!signature) || + (!table_pointer)) { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + if (!acpi_gbl_RSDP) { + /* Get the RSDP */ + + status = acpi_os_get_root_pointer (flags, &rsdp_address); + if (ACPI_FAILURE (status)) { + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "RSDP not found\n")); + return_ACPI_STATUS (AE_NO_ACPI_TABLES); + } + + /* Map and validate the RSDP */ + + if ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING) { + status = acpi_os_map_memory (rsdp_address.pointer.physical, sizeof (RSDP_DESCRIPTOR), + (void **) &acpi_gbl_RSDP); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + } + else { + acpi_gbl_RSDP = rsdp_address.pointer.logical; + } + + /* + * The signature and checksum must both be correct + */ + if (ACPI_STRNCMP ((NATIVE_CHAR *) acpi_gbl_RSDP, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) { + /* Nope, BAD Signature */ + + status = AE_BAD_SIGNATURE; + goto cleanup; + } + + if (acpi_tb_checksum (acpi_gbl_RSDP, ACPI_RSDP_CHECKSUM_LENGTH) != 0) { + /* Nope, BAD Checksum */ + + status = AE_BAD_CHECKSUM; + goto cleanup; + } + } + + /* Get the RSDT and validate it */ + + acpi_tb_get_rsdt_address (&address); + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "RSDP located at %p, RSDT physical=%8.8X%8.8X \n", + acpi_gbl_RSDP, + ACPI_HIDWORD (address.pointer.value), + ACPI_LODWORD (address.pointer.value))); + + status = acpi_tb_get_table_pointer (&address, flags, &rsdt_size, &rsdt_ptr); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + + status = acpi_tb_validate_rsdt (rsdt_ptr); + if (ACPI_FAILURE (status)) { + goto cleanup; + } + + /* Get the number of table pointers within the RSDT */ + + table_count = acpi_tb_get_table_count (acpi_gbl_RSDP, rsdt_ptr); + + + /* + * Search the RSDT/XSDT for the correct instance of the + * requested table + */ + for (i = 0, j = 0; i < table_count; i++) { + /* Get the next table pointer */ + + address.pointer_type = acpi_gbl_table_flags; + if (acpi_gbl_RSDP->revision < 2) { + address.pointer.value = ((RSDT_DESCRIPTOR *) rsdt_ptr)->table_offset_entry[i]; + } + else { + address.pointer.value = ACPI_GET_ADDRESS ( + ((xsdt_descriptor *) rsdt_ptr)->table_offset_entry[i]); + } + + /* Get addressibility if necessary */ + + status = acpi_tb_get_table_pointer (&address, flags, &table_size, &table_ptr); + if (ACPI_FAILURE (status)) { + goto cleanup; + } + + /* Compare table signatures and table instance */ + + if (!ACPI_STRNCMP ((char *) table_ptr, signature, ACPI_STRLEN (signature))) { + /* An instance of the table was found */ + + j++; + if (j >= instance) { + /* Found the correct instance */ + + *table_pointer = table_ptr; + goto cleanup; + } + } + + /* Delete table mapping if using virtual addressing */ + + if ((table_size) && + ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING)) { + acpi_os_unmap_memory (table_ptr, table_size); + } + } + + /* Did not find the table */ + + status = AE_NOT_EXIST; + + +cleanup: + if (rsdt_size) { + acpi_os_unmap_memory (rsdt_ptr, rsdt_size); + } + return_ACPI_STATUS (status); +} + + +/* TBD: Move to a new file */ + +#if ACPI_MACHINE_WIDTH != 16 /******************************************************************************* * * FUNCTION: Acpi_find_root_pointer * - * PARAMETERS: **Rsdp_physical_address - Where to place the RSDP address - * Flags - Logical/Physical addressing + * PARAMETERS: **Rsdp_address - Where to place the RSDP address + * Flags - Logical/Physical addressing * * RETURN: Status, Physical address of the RSDP * @@ -51,13 +290,13 @@ acpi_status acpi_find_root_pointer ( u32 flags, - ACPI_PHYSICAL_ADDRESS *rsdp_physical_address) + ACPI_POINTER *rsdp_address) { acpi_table_desc table_info; acpi_status status; - FUNCTION_TRACE ("Acpi_find_root_pointer"); + ACPI_FUNCTION_TRACE ("Acpi_find_root_pointer"); /* Get the RSDP */ @@ -68,8 +307,8 @@ return_ACPI_STATUS (AE_NO_ACPI_TABLES); } - *rsdp_physical_address = table_info.physical_address; - + rsdp_address->pointer_type = ACPI_PHYSICAL_POINTER; + rsdp_address->pointer.physical = table_info.physical_address; return_ACPI_STATUS (AE_OK); } @@ -96,7 +335,7 @@ u8 *mem_rover; - FUNCTION_TRACE ("Tb_scan_memory_for_rsdp"); + ACPI_FUNCTION_TRACE ("Tb_scan_memory_for_rsdp"); /* Search from given start addr for the requested length */ @@ -107,9 +346,9 @@ /* The signature and checksum must both be correct */ - if (STRNCMP ((NATIVE_CHAR *) mem_rover, + if (ACPI_STRNCMP ((NATIVE_CHAR *) mem_rover, RSDP_SIG, sizeof (RSDP_SIG)-1) == 0 && - acpi_tb_checksum (mem_rover, RSDP_CHECKSUM_LENGTH) == 0) { + acpi_tb_checksum (mem_rover, ACPI_RSDP_CHECKSUM_LENGTH) == 0) { /* If so, we have found the RSDP */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, @@ -121,7 +360,6 @@ /* Searched entire block, no RSDP was found */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,"Searched entire block, no RSDP was found.\n")); - return_PTR (NULL); } @@ -156,7 +394,7 @@ acpi_status status = AE_OK; - FUNCTION_TRACE ("Tb_find_rsdp"); + ACPI_FUNCTION_TRACE ("Tb_find_rsdp"); /* @@ -166,7 +404,7 @@ /* * 1) Search EBDA (low memory) paragraphs */ - status = acpi_os_map_memory (LO_RSDP_WINDOW_BASE, LO_RSDP_WINDOW_SIZE, + status = acpi_os_map_memory ((u64) LO_RSDP_WINDOW_BASE, LO_RSDP_WINDOW_SIZE, (void **) &table_ptr); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); @@ -179,17 +417,16 @@ /* Found it, return the physical address */ phys_addr = LO_RSDP_WINDOW_BASE; - phys_addr += (mem_rover - table_ptr); + phys_addr += ACPI_PTR_DIFF (mem_rover,table_ptr); table_info->physical_address = phys_addr; - return_ACPI_STATUS (AE_OK); } /* * 2) Search upper memory: 16-byte boundaries in E0000h-F0000h */ - status = acpi_os_map_memory (HI_RSDP_WINDOW_BASE, HI_RSDP_WINDOW_SIZE, + status = acpi_os_map_memory ((u64) HI_RSDP_WINDOW_BASE, HI_RSDP_WINDOW_SIZE, (void **) &table_ptr); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); @@ -202,15 +439,13 @@ /* Found it, return the physical address */ phys_addr = HI_RSDP_WINDOW_BASE; - phys_addr += (mem_rover - table_ptr); + phys_addr += ACPI_PTR_DIFF (mem_rover, table_ptr); table_info->physical_address = phys_addr; - return_ACPI_STATUS (AE_OK); } } - /* * Physical addressing */ @@ -218,212 +453,32 @@ /* * 1) Search EBDA (low memory) paragraphs */ - mem_rover = acpi_tb_scan_memory_for_rsdp ((u8 *) LO_RSDP_WINDOW_BASE, + mem_rover = acpi_tb_scan_memory_for_rsdp (ACPI_PHYSADDR_TO_PTR (LO_RSDP_WINDOW_BASE), LO_RSDP_WINDOW_SIZE); if (mem_rover) { /* Found it, return the physical address */ - table_info->physical_address = (ACPI_TBLPTR) mem_rover; + table_info->physical_address = ACPI_TO_INTEGER (mem_rover); return_ACPI_STATUS (AE_OK); } /* * 2) Search upper memory: 16-byte boundaries in E0000h-F0000h */ - mem_rover = acpi_tb_scan_memory_for_rsdp ((u8 *) HI_RSDP_WINDOW_BASE, + mem_rover = acpi_tb_scan_memory_for_rsdp (ACPI_PHYSADDR_TO_PTR (HI_RSDP_WINDOW_BASE), HI_RSDP_WINDOW_SIZE); if (mem_rover) { /* Found it, return the physical address */ - table_info->physical_address = (ACPI_TBLPTR) mem_rover; + table_info->physical_address = ACPI_TO_INTEGER (mem_rover); return_ACPI_STATUS (AE_OK); } } - /* RSDP signature was not found */ return_ACPI_STATUS (AE_NOT_FOUND); } - -/******************************************************************************* - * - * FUNCTION: Acpi_get_firmware_table - * - * PARAMETERS: Signature - Any ACPI table signature - * Instance - the non zero instance of the table, allows - * support for multiple tables of the same type - * Flags - 0: Physical/Virtual support - * Ret_buffer - pointer to a structure containing a buffer to - * receive the table - * - * RETURN: Status - * - * DESCRIPTION: This function is called to get an ACPI table. The caller - * supplies an Out_buffer large enough to contain the entire ACPI - * table. Upon completion - * the Out_buffer->Length field will indicate the number of bytes - * copied into the Out_buffer->Buf_ptr buffer. This table will be - * a complete table including the header. - * - ******************************************************************************/ - -acpi_status -acpi_get_firmware_table ( - acpi_string signature, - u32 instance, - u32 flags, - acpi_table_header **table_pointer) -{ - ACPI_PHYSICAL_ADDRESS physical_address; - acpi_table_header *rsdt_ptr = NULL; - acpi_table_header *table_ptr; - acpi_status status; - u32 rsdt_size = 0; - u32 table_size; - u32 table_count; - u32 i; - u32 j; - - - FUNCTION_TRACE ("Acpi_get_firmware_table"); - - - /* - * Ensure that at least the table manager is initialized. We don't - * require that the entire ACPI subsystem is up for this interface - */ - - /* - * If we have a buffer, we must have a length too - */ - if ((instance == 0) || - (!signature) || - (!table_pointer)) { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - - if (!acpi_gbl_RSDP) { - /* Get the RSDP */ - - status = acpi_os_get_root_pointer (flags, &physical_address); - if (ACPI_FAILURE (status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "RSDP not found\n")); - return_ACPI_STATUS (AE_NO_ACPI_TABLES); - } - - /* Map and validate the RSDP */ - - if ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING) { - status = acpi_os_map_memory (physical_address, sizeof (RSDP_DESCRIPTOR), - (void **) &acpi_gbl_RSDP); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - } - else { - acpi_gbl_RSDP = (void *) (NATIVE_UINT) physical_address; - } - - /* - * The signature and checksum must both be correct - */ - if (STRNCMP ((NATIVE_CHAR *) acpi_gbl_RSDP, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) { - /* Nope, BAD Signature */ - - status = AE_BAD_SIGNATURE; - goto cleanup; - } - - if (acpi_tb_checksum (acpi_gbl_RSDP, RSDP_CHECKSUM_LENGTH) != 0) { - /* Nope, BAD Checksum */ - - status = AE_BAD_CHECKSUM; - goto cleanup; - } - } - - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "RSDP located at %p, RSDT physical=%8.8X%8.8X \n", - acpi_gbl_RSDP, HIDWORD(acpi_gbl_RSDP->rsdt_physical_address), - LODWORD(acpi_gbl_RSDP->rsdt_physical_address))); - - - /* Get the RSDT and validate it */ - - physical_address = acpi_tb_get_rsdt_address (); - status = acpi_tb_get_table_pointer (physical_address, flags, &rsdt_size, &rsdt_ptr); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - - status = acpi_tb_validate_rsdt (rsdt_ptr); - if (ACPI_FAILURE (status)) { - goto cleanup; - } - - - /* Get the number of table pointers within the RSDT */ - - table_count = acpi_tb_get_table_count (acpi_gbl_RSDP, rsdt_ptr); - - - /* - * Search the RSDT/XSDT for the correct instance of the - * requested table - */ - for (i = 0, j = 0; i < table_count; i++) { - /* Get the next table pointer */ - - if (acpi_gbl_RSDP->revision < 2) { - physical_address = ((RSDT_DESCRIPTOR *) rsdt_ptr)->table_offset_entry[i]; - } - else { - physical_address = (ACPI_PHYSICAL_ADDRESS) - ACPI_GET_ADDRESS (((xsdt_descriptor *) rsdt_ptr)->table_offset_entry[i]); - } - - /* Get addressibility if necessary */ - - status = acpi_tb_get_table_pointer (physical_address, flags, &table_size, &table_ptr); - if (ACPI_FAILURE (status)) { - goto cleanup; - } - - /* Compare table signatures and table instance */ - - if (!STRNCMP ((char *) table_ptr, signature, STRLEN (signature))) { - /* An instance of the table was found */ - - j++; - if (j >= instance) { - /* Found the correct instance */ - - *table_pointer = table_ptr; - goto cleanup; - } - } - - /* Delete table mapping if using virtual addressing */ - - if ((table_size) && - ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING)) { - acpi_os_unmap_memory (table_ptr, table_size); - } - } - - /* Did not find the table */ - - status = AE_NOT_EXIST; - - -cleanup: - if (rsdt_size) { - acpi_os_unmap_memory (rsdt_ptr, rsdt_size); - } - return_ACPI_STATUS (status); -} - +#endif diff -urN linux-2.4.18/drivers/acpi/tables.c lia64-2.4/drivers/acpi/tables.c --- linux-2.4.18/drivers/acpi/tables.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/tables.c Tue Jun 11 14:24:23 2002 @@ -0,0 +1,475 @@ +/* + * acpi_tables.c - ACPI Boot-Time Table Parsing + * + * Copyright (C) 2001 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PREFIX "ACPI: " + +#define ACPI_MAX_TABLES ACPI_TABLE_COUNT + +static char *acpi_table_signatures[ACPI_TABLE_COUNT] = { + [ACPI_TABLE_UNKNOWN] = "????", + [ACPI_APIC] = "APIC", + [ACPI_BOOT] = "BOOT", + [ACPI_DBGP] = "DBGP", + [ACPI_DSDT] = "DSDT", + [ACPI_ECDT] = "ECDT", + [ACPI_ETDT] = "ETDT", + [ACPI_FACP] = "FACP", + [ACPI_FACS] = "FACS", + [ACPI_OEMX] = "OEM", + [ACPI_PSDT] = "PSDT", + [ACPI_SBST] = "SBST", + [ACPI_SLIT] = "SLIT", + [ACPI_SPCR] = "SPCR", + [ACPI_SRAT] = "SRAT", + [ACPI_SSDT] = "SSDT", + [ACPI_SPMI] = "SPMI" +}; + +/* System Description Table (RSDT/XSDT) */ +struct acpi_table_sdt { + unsigned long pa; /* Physical Address */ + unsigned long count; /* Table count */ + struct { + unsigned long pa; + enum acpi_table_id id; + unsigned long size; + } entry[ACPI_MAX_TABLES]; +} __attribute__ ((packed)); + +static struct acpi_table_sdt sdt; + +acpi_madt_entry_handler madt_handlers[ACPI_MADT_ENTRY_COUNT]; + + +void +acpi_table_print ( + struct acpi_table_header *header, + unsigned long phys_addr) +{ + char *name = NULL; + + if (!header) + return; + + /* Some table signatures aren't good table names */ + + if (0 == strncmp((char *) &header->signature, + acpi_table_signatures[ACPI_APIC], + sizeof(header->signature))) { + name = "MADT"; + } + else if (0 == strncmp((char *) &header->signature, + acpi_table_signatures[ACPI_FACP], + sizeof(header->signature))) { + name = "FADT"; + } + else + name = header->signature; + + printk(KERN_INFO PREFIX "%.4s (v%3.3d %6.6s %8.8s %5.5d.%5.5d) @ 0x%p\n", + name, header->revision, header->oem_id, + header->oem_table_id, header->oem_revision >> 16, + header->oem_revision & 0xffff, (void *) phys_addr); +} + + +void +acpi_table_print_madt_entry ( + acpi_table_entry_header *header) +{ + if (!header) + return; + + switch (header->type) { + + case ACPI_MADT_LAPIC: + { + struct acpi_table_lapic *p = + (struct acpi_table_lapic*) header; + printk(KERN_INFO PREFIX "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", + p->acpi_id, p->id, p->flags.enabled?"enabled":"disabled"); + } + break; + + case ACPI_MADT_IOAPIC: + { + struct acpi_table_ioapic *p = + (struct acpi_table_ioapic*) header; + printk(KERN_INFO PREFIX "IOAPIC (id[0x%02x] address[0x%08x] global_irq_base[0x%x])\n", + p->id, p->address, p->global_irq_base); + } + break; + + case ACPI_MADT_INT_SRC_OVR: + { + struct acpi_table_int_src_ovr *p = + (struct acpi_table_int_src_ovr*) header; + printk(KERN_INFO PREFIX "INT_SRC_OVR (bus[%d] irq[0x%x] global_irq[0x%x] polarity[0x%x] trigger[0x%x])\n", + p->bus, p->bus_irq, p->global_irq, p->flags.polarity, p->flags.trigger); + } + break; + + case ACPI_MADT_NMI_SRC: + { + struct acpi_table_nmi_src *p = + (struct acpi_table_nmi_src*) header; + printk(KERN_INFO PREFIX "NMI_SRC (polarity[0x%x] trigger[0x%x] global_irq[0x%x])\n", + p->flags.polarity, p->flags.trigger, p->global_irq); + } + break; + + case ACPI_MADT_LAPIC_NMI: + { + struct acpi_table_lapic_nmi *p = + (struct acpi_table_lapic_nmi*) header; + printk(KERN_INFO PREFIX "LAPIC_NMI (acpi_id[0x%02x] polarity[0x%x] trigger[0x%x] lint[0x%x])\n", + p->acpi_id, p->flags.polarity, p->flags.trigger, p->lint); + } + break; + + case ACPI_MADT_LAPIC_ADDR_OVR: + { + struct acpi_table_lapic_addr_ovr *p = + (struct acpi_table_lapic_addr_ovr*) header; + printk(KERN_INFO PREFIX "LAPIC_ADDR_OVR (address[%p])\n", + (void *) (unsigned long) p->address); + } + break; + + case ACPI_MADT_IOSAPIC: + { + struct acpi_table_iosapic *p = + (struct acpi_table_iosapic*) header; + printk(KERN_INFO PREFIX "IOSAPIC (id[0x%x] global_irq_base[0x%x] address[%p])\n", + p->id, p->global_irq_base, (void *) (unsigned long) p->address); + } + break; + + case ACPI_MADT_LSAPIC: + { + struct acpi_table_lsapic *p = + (struct acpi_table_lsapic*) header; + printk(KERN_INFO PREFIX "LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n", + p->acpi_id, p->id, p->eid, p->flags.enabled?"enabled":"disabled"); + } + break; + + case ACPI_MADT_PLAT_INT_SRC: + { + struct acpi_table_plat_int_src *p = + (struct acpi_table_plat_int_src*) header; + printk(KERN_INFO PREFIX "PLAT_INT_SRC (polarity[0x%x] trigger[0x%x] type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", + p->flags.polarity, p->flags.trigger, p->type, p->id, p->eid, p->iosapic_vector, p->global_irq); + } + break; + + default: + printk(KERN_WARNING PREFIX "Found unsupported MADT entry (type = 0x%x)\n", + header->type); + break; + } +} + + +static int +acpi_table_compute_checksum ( + void *table_pointer, + unsigned long length) +{ + u8 *p = (u8 *) table_pointer; + unsigned long remains = length; + unsigned long sum = 0; + + if (!p || !length) + return -EINVAL; + + while (remains--) + sum += *p++; + + return (sum & 0xFF); +} + + +int __init +acpi_table_parse_madt ( + enum acpi_table_id id, + acpi_madt_entry_handler handler) +{ + struct acpi_table_madt *madt = NULL; + acpi_table_entry_header *entry = NULL; + unsigned long count = 0; + unsigned long madt_end = 0; + int i = 0; + + if (!handler) + return -EINVAL; + + /* Locate the MADT (if exists). There should only be one. */ + + for (i = 0; i < sdt.count; i++) { + if (sdt.entry[i].id != ACPI_APIC) + continue; + madt = (struct acpi_table_madt *) + __acpi_map_table(sdt.entry[i].pa, sdt.entry[i].size); + if (!madt) { + printk(KERN_WARNING PREFIX "Unable to map MADT\n"); + return -ENODEV; + } + break; + } + + if (!madt) { + printk(KERN_WARNING PREFIX "MADT not present\n"); + return -ENODEV; + } + + madt_end = (unsigned long) madt + sdt.entry[i].size; + + /* Parse all entries looking for a match. */ + + entry = (acpi_table_entry_header *) + ((unsigned long) madt + sizeof(struct acpi_table_madt)); + + while (((unsigned long) entry) < madt_end) { + if (entry->type == id) { + count++; + handler(entry); + } + entry = (acpi_table_entry_header *) + ((unsigned long) entry += entry->length); + } + + return count; +} + + +int __init +acpi_table_parse ( + enum acpi_table_id id, + acpi_table_handler handler) +{ + int count = 0; + int i = 0; + + if (!handler) + return -EINVAL; + + for (i = 0; i < sdt.count; i++) { + if (sdt.entry[i].id != id) + continue; + handler(sdt.entry[i].pa, sdt.entry[i].size); + count++; + } + + return count; +} + + +static int __init +acpi_table_get_sdt ( + struct acpi_table_rsdp *rsdp) +{ + struct acpi_table_header *header = NULL; + int i, id = 0; + + if (!rsdp) + return -EINVAL; + + /* First check XSDT (but only on ACPI 2.0-compatible systems) */ + + if ((rsdp->revision >= 2) && + (((struct acpi20_table_rsdp*)rsdp)->xsdt_address)) { + + struct acpi_table_xsdt *mapped_xsdt = NULL; + + sdt.pa = ((struct acpi20_table_rsdp*)rsdp)->xsdt_address; + + header = (struct acpi_table_header *) + __acpi_map_table(sdt.pa, sizeof(struct acpi_table_header)); + + if (!header) { + printk(KERN_WARNING PREFIX "Unable to map XSDT header\n"); + return -ENODEV; + } + + if (strncmp(header->signature, "XSDT", 4)) { + printk(KERN_WARNING PREFIX "XSDT signature incorrect\n"); + return -ENODEV; + } + + sdt.count = (header->length - sizeof(struct acpi_table_header)) >> 3; + if (sdt.count > ACPI_MAX_TABLES) { + printk(KERN_WARNING PREFIX "Truncated %lu XSDT entries\n", + (ACPI_MAX_TABLES - sdt.count)); + sdt.count = ACPI_MAX_TABLES; + } + + mapped_xsdt = (struct acpi_table_xsdt *) + __acpi_map_table(sdt.pa, header->length); + if (!mapped_xsdt) { + printk(KERN_WARNING PREFIX "Unable to map XSDT\n"); + return -ENODEV; + } + + header = &mapped_xsdt->header; + + for (i = 0; i < sdt.count; i++) + sdt.entry[i].pa = (unsigned long) mapped_xsdt->entry[i]; + } + + /* Then check RSDT */ + + else if (rsdp->rsdt_address) { + + struct acpi_table_rsdt *mapped_rsdt = NULL; + + sdt.pa = rsdp->rsdt_address; + + header = (struct acpi_table_header *) + __acpi_map_table(sdt.pa, sizeof(struct acpi_table_header)); + if (!header) { + printk(KERN_WARNING PREFIX "Unable to map RSDT header\n"); + return -ENODEV; + } + + if (strncmp(header->signature, "RSDT", 4)) { + printk(KERN_WARNING PREFIX "RSDT signature incorrect\n"); + return -ENODEV; + } + + sdt.count = (header->length - sizeof(struct acpi_table_header)) >> 2; + if (sdt.count > ACPI_MAX_TABLES) { + printk(KERN_WARNING PREFIX "Truncated %lu RSDT entries\n", + (ACPI_TABLE_COUNT - sdt.count)); + sdt.count = ACPI_MAX_TABLES; + } + + mapped_rsdt = (struct acpi_table_rsdt *) + __acpi_map_table(sdt.pa, header->length); + if (!mapped_rsdt) { + printk(KERN_WARNING PREFIX "Unable to map RSDT\n"); + return -ENODEV; + } + + header = &mapped_rsdt->header; + + for (i = 0; i < sdt.count; i++) + sdt.entry[i].pa = (unsigned long) mapped_rsdt->entry[i]; + } + + else { + printk(KERN_WARNING PREFIX "No System Description Table (RSDT/XSDT) specified in RSDP\n"); + return -ENODEV; + } + + acpi_table_print(header, sdt.pa); + + for (i = 0; i < sdt.count; i++) { + + header = (struct acpi_table_header *) + __acpi_map_table(sdt.entry[i].pa, + sizeof(struct acpi_table_header)); + if (!header) + continue; + + acpi_table_print(header, sdt.entry[i].pa); + + if (0 != acpi_table_compute_checksum(header, header->length)) { + printk(KERN_WARNING " >>> ERROR: Invalid checksum\n"); + continue; + } + + sdt.entry[i].size = header->length; + + for (id = 0; id < ACPI_TABLE_COUNT; id++) { + if (0 == strncmp((char *) &header->signature, + acpi_table_signatures[id], + sizeof(header->signature))) { + sdt.entry[i].id = id; + } + } + } + + return 0; +} + + +int __init +acpi_table_init ( + char *cmdline) +{ + struct acpi_table_rsdp *rsdp = NULL; + unsigned long rsdp_phys = 0; + int result = 0; + + memset(&sdt, 0, sizeof(struct acpi_table_sdt)); + memset(&madt_handlers, 0, sizeof(madt_handlers)); + + /* Locate and map the Root System Description Table (RSDP) */ + + rsdp_phys = acpi_find_rsdp(); + if (!rsdp_phys) { + printk(KERN_ERR PREFIX "Unable to locate RSDP\n"); + return -ENODEV; + } + + rsdp = (struct acpi_table_rsdp *) __va(rsdp_phys); + if (!rsdp) { + printk(KERN_WARNING PREFIX "Unable to map RSDP\n"); + return -ENODEV; + } + + printk(KERN_INFO PREFIX "RSDP (v%3.3d %6.6s ) @ 0x%p\n", + rsdp->revision, rsdp->oem_id, (void *) rsdp_phys); + + if (rsdp->revision < 2) + result = acpi_table_compute_checksum(rsdp, sizeof(struct acpi_table_rsdp)); + else + result = acpi_table_compute_checksum(rsdp, ((struct acpi20_table_rsdp *)rsdp)->length); + + if (0 != result) { + printk(KERN_WARNING " >>> ERROR: Invalid checksum\n"); + return -ENODEV; + } + + /* Locate and map the System Description table (RSDT/XSDT) */ + + if (0 != acpi_table_get_sdt(rsdp)) + return -ENODEV; + + return 0; +} + diff -urN linux-2.4.18/drivers/acpi/thermal.c lia64-2.4/drivers/acpi/thermal.c --- linux-2.4.18/drivers/acpi/thermal.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/thermal.c Tue Jun 11 14:24:23 2002 @@ -0,0 +1,1318 @@ +/* + * acpi_thermal.c - ACPI Thermal Zone Driver ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This driver fully implements the ACPI thermal policy as described in the + * ACPI 2.0 Specification. + * + * TBD: 1. Implement passive cooling hysteresis. + * 2. Enhance passive cooling (CPU) states/limit interface to support + * concepts of 'multiple limiters', upper/lower limits, etc. + * + */ + +#include +#include +#include +#include +#include +#include +#include "acpi_bus.h" +#include "acpi_drivers.h" + + +#define _COMPONENT ACPI_THERMAL_COMPONENT +ACPI_MODULE_NAME ("acpi_thermal") + +MODULE_AUTHOR("Paul Diefenbaugh"); +MODULE_DESCRIPTION(ACPI_THERMAL_DRIVER_NAME); +MODULE_LICENSE("GPL"); + +static int tzp = 0; +MODULE_PARM(tzp, "i"); +MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n"); + +#define PREFIX "ACPI: " + + +#define ACPI_THERMAL_MAX_ACTIVE 10 + +#define KELVIN_TO_CELSIUS(t) ((t-2732+5)/10) + +static int acpi_thermal_add (struct acpi_device *device); +static int acpi_thermal_remove (struct acpi_device *device, int type); + +static struct acpi_driver acpi_thermal_driver = { + name: ACPI_THERMAL_DRIVER_NAME, + class: ACPI_THERMAL_CLASS, + ids: ACPI_THERMAL_HID, + ops: { + add: acpi_thermal_add, + remove: acpi_thermal_remove, + }, +}; + +struct acpi_thermal_state { + u8 critical:1; + u8 hot:1; + u8 passive:1; + u8 active:1; + u8 reserved:4; + int active_index; +}; + +struct acpi_thermal_state_flags { + u8 valid:1; + u8 enabled:1; + u8 reserved:6; +}; + +struct acpi_thermal_critical { + struct acpi_thermal_state_flags flags; + unsigned long temperature; +}; + +struct acpi_thermal_hot { + struct acpi_thermal_state_flags flags; + unsigned long temperature; +}; + +struct acpi_thermal_passive { + struct acpi_thermal_state_flags flags; + unsigned long temperature; + unsigned long tc1; + unsigned long tc2; + unsigned long tsp; + struct acpi_handle_list devices; +}; + +struct acpi_thermal_active { + struct acpi_thermal_state_flags flags; + unsigned long temperature; + struct acpi_handle_list devices; +}; + +struct acpi_thermal_trips { + struct acpi_thermal_critical critical; + struct acpi_thermal_hot hot; + struct acpi_thermal_passive passive; + struct acpi_thermal_active active[ACPI_THERMAL_MAX_ACTIVE]; +}; + +struct acpi_thermal_flags { + u8 cooling_mode:1; /* _SCP */ + u8 devices:1; /* _TZD */ + u8 reserved:6; +}; + +struct acpi_thermal { + acpi_handle handle; + acpi_bus_id name; + unsigned long temperature; + unsigned long last_temperature; + unsigned long polling_frequency; + u8 cooling_mode; + struct acpi_thermal_flags flags; + struct acpi_thermal_state state; + struct acpi_thermal_trips trips; + struct acpi_handle_list devices; + struct timer_list timer; +}; + + +/* -------------------------------------------------------------------------- + Thermal Zone Management + -------------------------------------------------------------------------- */ + +static int +acpi_thermal_get_temperature ( + struct acpi_thermal *tz) +{ + acpi_status status = AE_OK; + + ACPI_FUNCTION_TRACE("acpi_thermal_get_temperature"); + + if (!tz) + return_VALUE(-EINVAL); + + tz->last_temperature = tz->temperature; + + status = acpi_evaluate_integer(tz->handle, "_TMP", NULL, &tz->temperature); + if (ACPI_FAILURE(status)) + return -ENODEV; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n", tz->temperature)); + + return_VALUE(0); +} + + +static int +acpi_thermal_get_polling_frequency ( + struct acpi_thermal *tz) +{ + acpi_status status = AE_OK; + + ACPI_FUNCTION_TRACE("acpi_thermal_get_polling_frequency"); + + if (!tz) + return_VALUE(-EINVAL); + + status = acpi_evaluate_integer(tz->handle, "_TZP", NULL, &tz->polling_frequency); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency is %lu dS\n", tz->polling_frequency)); + + return_VALUE(0); +} + + +static int +acpi_thermal_set_polling ( + struct acpi_thermal *tz, + int seconds) +{ + ACPI_FUNCTION_TRACE("acpi_thermal_set_polling"); + + if (!tz) + return_VALUE(-EINVAL); + + tz->polling_frequency = seconds * 10; /* Convert value to deci-seconds */ + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency set to %lu seconds\n", tz->polling_frequency)); + + return_VALUE(0); +} + + +static int +acpi_thermal_set_cooling_mode ( + struct acpi_thermal *tz, + int mode) +{ + acpi_status status = AE_OK; + acpi_object arg0 = {ACPI_TYPE_INTEGER}; + acpi_object_list arg_list= {1, &arg0}; + acpi_handle handle = NULL; + + ACPI_FUNCTION_TRACE("acpi_thermal_set_cooling_mode"); + + if (!tz) + return_VALUE(-EINVAL); + + status = acpi_get_handle(tz->handle, "_SCP", &handle); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n")); + return_VALUE(-ENODEV); + } + + arg0.integer.value = mode; + + status = acpi_evaluate(handle, NULL, &arg_list, NULL); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + tz->cooling_mode = mode; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling mode [%s]\n", + mode?"passive":"active")); + + return_VALUE(0); +} + + +static int +acpi_thermal_get_trip_points ( + struct acpi_thermal *tz) +{ + acpi_status status = AE_OK; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_thermal_get_trip_points"); + + if (!tz) + return_VALUE(-EINVAL); + + /* Critical Shutdown (required) */ + + status = acpi_evaluate_integer(tz->handle, "_CRT", NULL, + &tz->trips.critical.temperature); + if (ACPI_FAILURE(status)) { + tz->trips.critical.flags.valid = 0; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No critical threshold\n")); + return -ENODEV; + } + else { + tz->trips.critical.flags.valid = 1; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found critical threshold [%lu]\n", tz->trips.critical.temperature)); + } + + /* Critical Sleep (optional) */ + + status = acpi_evaluate_integer(tz->handle, "_HOT", NULL, &tz->trips.hot.temperature); + if (ACPI_FAILURE(status)) { + tz->trips.hot.flags.valid = 0; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No hot threshold\n")); + } + else { + tz->trips.hot.flags.valid = 1; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found hot threshold [%lu]\n", tz->trips.hot.temperature)); + } + + /* Passive: Processors (optional) */ + + status = acpi_evaluate_integer(tz->handle, "_PSV", NULL, &tz->trips.passive.temperature); + if (ACPI_FAILURE(status)) { + tz->trips.passive.flags.valid = 0; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No passive threshold\n")); + } + else { + tz->trips.passive.flags.valid = 1; + + status = acpi_evaluate_integer(tz->handle, "_TC1", NULL, &tz->trips.passive.tc1); + if (ACPI_FAILURE(status)) + tz->trips.passive.flags.valid = 0; + + status = acpi_evaluate_integer(tz->handle, "_TC2", NULL, &tz->trips.passive.tc2); + if (ACPI_FAILURE(status)) + tz->trips.passive.flags.valid = 0; + + status = acpi_evaluate_integer(tz->handle, "_TSP", NULL, &tz->trips.passive.tsp); + if (ACPI_FAILURE(status)) + tz->trips.passive.flags.valid = 0; + + status = acpi_evaluate_reference(tz->handle, "_PSL", NULL, &tz->trips.passive.devices); + if (ACPI_FAILURE(status)) + tz->trips.passive.flags.valid = 0; + + if (!tz->trips.passive.flags.valid) + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid passive threshold\n")); + else + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found passive threshold [%lu]\n", tz->trips.passive.temperature)); + } + + /* Active: Fans, etc. (optional) */ + + for (i=0; ihandle, name, NULL, &tz->trips.active[i].temperature); + if (ACPI_FAILURE(status)) + break; + + name[2] = 'L'; + status = acpi_evaluate_reference(tz->handle, name, NULL, &tz->trips.active[i].devices); + if (ACPI_SUCCESS(status)) { + tz->trips.active[i].flags.valid = 1; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found active threshold [%d]:[%lu]\n", i, tz->trips.active[i].temperature)); + } + else + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid active threshold [%d]\n", i)); + } + + return_VALUE(0); +} + + +static int +acpi_thermal_get_devices ( + struct acpi_thermal *tz) +{ + acpi_status status = AE_OK; + + ACPI_FUNCTION_TRACE("acpi_thermal_get_devices"); + + if (!tz) + return_VALUE(-EINVAL); + + status = acpi_evaluate_reference(tz->handle, "_TZD", NULL, &tz->devices); + if (ACPI_FAILURE(status)) + return_VALUE(-ENODEV); + + return_VALUE(0); +} + + +static int +acpi_thermal_call_usermode ( + char *path) +{ + char *argv[2] = {NULL, NULL}; + char *envp[3] = {NULL, NULL, NULL}; + + ACPI_FUNCTION_TRACE("acpi_thermal_call_usermode"); + + if (!path) + return_VALUE(-EINVAL);; + + argv[0] = path; + + /* minimal command environment */ + envp[0] = "HOME=/"; + envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; + + call_usermodehelper(argv[0], argv, envp); + + return_VALUE(0); +} + + +static int +acpi_thermal_critical ( + struct acpi_thermal *tz) +{ + int result = 0; + struct acpi_device *device = NULL; + + ACPI_FUNCTION_TRACE("acpi_thermal_critical"); + + if (!tz || !tz->trips.critical.flags.valid) + return_VALUE(-EINVAL); + + if (tz->temperature >= tz->trips.critical.temperature) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Critical trip point\n")); + tz->trips.critical.flags.enabled = 1; + } + else if (tz->trips.critical.flags.enabled) + tz->trips.critical.flags.enabled = 0; + + result = acpi_bus_get_device(tz->handle, &device); + if (0 != result) + return_VALUE(result); + + acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_CRITICAL, tz->trips.critical.flags.enabled); + + acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF); + + return_VALUE(0); +} + + +static int +acpi_thermal_hot ( + struct acpi_thermal *tz) +{ + int result = 0; + struct acpi_device *device = NULL; + + ACPI_FUNCTION_TRACE("acpi_thermal_hot"); + + if (!tz || !tz->trips.hot.flags.valid) + return_VALUE(-EINVAL); + + if (tz->temperature >= tz->trips.hot.temperature) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Hot trip point\n")); + tz->trips.hot.flags.enabled = 1; + } + else if (tz->trips.hot.flags.enabled) + tz->trips.hot.flags.enabled = 0; + + result = acpi_bus_get_device(tz->handle, &device); + if (0 != result) + return_VALUE(result); + + acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_HOT, tz->trips.hot.flags.enabled); + + /* TBD: Call user-mode "sleep(S4)" function */ + + return_VALUE(0); +} + + +static int +acpi_thermal_passive ( + struct acpi_thermal *tz) +{ + int result = 0; + struct acpi_thermal_passive *passive = NULL; + int trend = 0; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_thermal_passive"); + + if (!tz || !tz->trips.passive.flags.valid) + return_VALUE(-EINVAL); + + passive = &(tz->trips.passive); + + /* + * Above Trip? + * ----------- + * Calculate the thermal trend (using the passive cooling equation) + * and modify the performance limit for all passive cooling devices + * accordingly. Note that we assume symmetry. + */ + if (tz->temperature >= passive->temperature) { + trend = (passive->tc1 * (tz->temperature - tz->last_temperature)) + (passive->tc2 * (tz->temperature - passive->temperature)); + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "trend[%d]=(tc1[%lu]*(tmp[%lu]-last[%lu]))+(tc2[%lu]*(tmp[%lu]-psv[%lu]))\n", + trend, passive->tc1, tz->temperature, + tz->last_temperature, passive->tc2, + tz->temperature, passive->temperature)); + /* Heating up? */ + if (trend > 0) + for (i=0; idevices.count; i++) + acpi_processor_set_thermal_limit( + passive->devices.handles[i], + ACPI_PROCESSOR_LIMIT_INCREMENT); + /* Cooling off? */ + else if (trend < 0) + for (i=0; idevices.count; i++) + acpi_processor_set_thermal_limit( + passive->devices.handles[i], + ACPI_PROCESSOR_LIMIT_DECREMENT); + } + + /* + * Below Trip? + * ----------- + * Implement passive cooling hysteresis to slowly increase performance + * and avoid thrashing around the passive trip point. Note that we + * assume symmetry. + */ + else if (tz->trips.passive.flags.enabled) { + for (i=0; idevices.count; i++) + result = acpi_processor_set_thermal_limit( + passive->devices.handles[i], + ACPI_PROCESSOR_LIMIT_DECREMENT); + if (1 == result) { + tz->trips.passive.flags.enabled = 0; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Disabling passive cooling (zone is cool)\n")); + } + } + + return_VALUE(0); +} + + +static int +acpi_thermal_active ( + struct acpi_thermal *tz) +{ + int result = 0; + struct acpi_thermal_active *active = NULL; + int i = 0; + int j = 0; + + ACPI_FUNCTION_TRACE("acpi_thermal_active"); + + if (!tz) + return_VALUE(-EINVAL); + + for (i=0; itrips.active[i]); + if (!active || !active->flags.valid) + break; + + /* + * Above Threshold? + * ---------------- + * If not already enabled, turn ON all cooling devices + * associated with this active threshold. + */ + if (tz->temperature >= active->temperature) { + tz->state.active_index = i; + if (!active->flags.enabled) { + for (j = 0; j < active->devices.count; j++) { + result = acpi_bus_set_power(active->devices.handles[j], ACPI_STATE_D0); + if (0 != result) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to turn cooling device [%p] 'on'\n", active->devices.handles[j])); + continue; + } + active->flags.enabled = 1; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling device [%p] now 'on'\n", active->devices.handles[j])); + } + } + } + /* + * Below Threshold? + * ---------------- + * Turn OFF all cooling devices associated with this + * threshold. + */ + else if (active->flags.enabled) { + for (j = 0; j < active->devices.count; j++) { + result = acpi_bus_set_power(active->devices.handles[j], ACPI_STATE_D3); + if (0 != result) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to turn cooling device [%p] 'off'\n", active->devices.handles[j])); + continue; + } + active->flags.enabled = 0; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling device [%p] now 'off'\n", active->devices.handles[j])); + } + } + } + + return_VALUE(0); +} + + +static void acpi_thermal_check (void *context); + +static void +acpi_thermal_run ( + unsigned long data) +{ + acpi_os_queue_for_execution(OSD_PRIORITY_GPE, acpi_thermal_check, (void *) data); +} + + +static void +acpi_thermal_check ( + void *data) +{ + int result = 0; + struct acpi_thermal *tz = (struct acpi_thermal *) data; + unsigned long sleep_time = 0; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_thermal_check"); + + if (!tz) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) context.\n")); + return_VOID; + } + + result = acpi_thermal_get_temperature(tz); + if (0 != result) + return_VOID; + + memset(&tz->state, 0, sizeof(tz->state)); + + /* + * Check Trip Points + * ----------------- + * Compare the current temperature to the trip point values to see + * if we've entered one of the thermal policy states. Note that + * this function determines when a state is entered, but the + * individual policy decides when it is exited (e.g. hysteresis). + */ + if ((tz->trips.critical.flags.valid) && (tz->temperature >= tz->trips.critical.temperature)) + tz->trips.critical.flags.enabled = 1; + if ((tz->trips.hot.flags.valid) && (tz->temperature >= tz->trips.hot.temperature)) + tz->trips.hot.flags.enabled = 1; + if ((tz->trips.passive.flags.valid) && (tz->temperature >= tz->trips.passive.temperature)) + tz->trips.passive.flags.enabled = 1; + for (i=0; itrips.active[i].flags.valid) && (tz->temperature >= tz->trips.active[i].temperature)) + tz->trips.active[i].flags.enabled = 1; + + /* + * Invoke Policy + * ------------- + * Separated from the above check to allow individual policy to + * determine when to exit a given state. + */ + if (tz->trips.critical.flags.enabled) + acpi_thermal_critical(tz); + if (tz->trips.hot.flags.enabled) + acpi_thermal_hot(tz); + if (tz->trips.passive.flags.enabled) + acpi_thermal_passive(tz); + if (tz->trips.active[0].flags.enabled) + acpi_thermal_active(tz); + + /* + * Calculate State + * --------------- + * Again, separated from the above two to allow independent policy + * decisions. + */ + if (tz->trips.critical.flags.enabled) + tz->state.critical = 1; + if (tz->trips.hot.flags.enabled) + tz->state.hot = 1; + if (tz->trips.passive.flags.enabled) + tz->state.passive = 1; + for (i=0; itrips.active[i].flags.enabled) + tz->state.active = 1; + + /* + * Calculate Sleep Time + * -------------------- + * If we're in the passive state, use _TSP's value. Otherwise + * use the default polling frequency (e.g. _TZP). If no polling + * frequency is specified then we'll wait forever (at least until + * a thermal event occurs). Note that _TSP and _TZD values are + * given in 1/10th seconds (we must covert to milliseconds). + */ + if (tz->state.passive) + sleep_time = tz->trips.passive.tsp * 100; + else if (tz->polling_frequency > 0) + sleep_time = tz->polling_frequency * 100; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "%s: temperature[%lu] sleep[%lu]\n", + tz->name, tz->temperature, sleep_time)); + + /* + * Schedule Next Poll + * ------------------ + */ + if (!sleep_time) { + if (timer_pending(&(tz->timer))) + del_timer(&(tz->timer)); + } + else { + if (timer_pending(&(tz->timer))) + mod_timer(&(tz->timer), (HZ * sleep_time) / 1000); + else { + tz->timer.data = (unsigned long) tz; + tz->timer.function = acpi_thermal_run; + tz->timer.expires = jiffies + (HZ * sleep_time) / 1000; + add_timer(&(tz->timer)); + } + } + + return_VOID; +} + + +/* -------------------------------------------------------------------------- + FS Interface (/proc) + -------------------------------------------------------------------------- */ + +#include +#include + +struct proc_dir_entry *acpi_thermal_dir = NULL; + + +static int +acpi_thermal_read_state ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_thermal *tz = (struct acpi_thermal *) data; + char *p = page; + int len = 0; + + ACPI_FUNCTION_TRACE("acpi_thermal_read_state"); + + if (!tz || (off != 0)) + goto end; + + p += sprintf(p, "state: "); + + if (!tz->state.critical && !tz->state.hot && !tz->state.passive && !tz->state.active) + p += sprintf(p, "ok\n"); + else { + if (tz->state.critical) + p += sprintf(p, "critical "); + if (tz->state.hot) + p += sprintf(p, "hot "); + if (tz->state.passive) + p += sprintf(p, "passive "); + if (tz->state.active) + p += sprintf(p, "active[%d]", tz->state.active_index); + p += sprintf(p, "\n"); + } + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_thermal_read_temperature ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + int result = 0; + struct acpi_thermal *tz = (struct acpi_thermal *) data; + char *p = page; + int len = 0; + + ACPI_FUNCTION_TRACE("acpi_thermal_read_temperature"); + + if (!tz || (off != 0)) + goto end; + + result = acpi_thermal_get_temperature(tz); + if (0 != result) + goto end; + + p += sprintf(p, "temperature: %lu C\n", + KELVIN_TO_CELSIUS(tz->temperature)); + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_thermal_read_trip_points ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_thermal *tz = (struct acpi_thermal *) data; + char *p = page; + int len = 0; + int i = 0; + int j = 0; + + ACPI_FUNCTION_TRACE("acpi_thermal_read_trip_points"); + + if (!tz || (off != 0)) + goto end; + + if (tz->trips.critical.flags.valid) + p += sprintf(p, "critical (S5): %lu C\n", + KELVIN_TO_CELSIUS(tz->trips.critical.temperature)); + + if (tz->trips.hot.flags.valid) + p += sprintf(p, "hot (S4): %lu C\n", + KELVIN_TO_CELSIUS(tz->trips.hot.temperature)); + + if (tz->trips.passive.flags.valid) { + p += sprintf(p, "passive: %lu C: tc1=%lu tc2=%lu tsp=%lu devices=", + KELVIN_TO_CELSIUS(tz->trips.passive.temperature), + tz->trips.passive.tc1, + tz->trips.passive.tc2, + tz->trips.passive.tsp); + for (j=0; jtrips.passive.devices.count; j++) { + + p += sprintf(p, "0x%p ", tz->trips.passive.devices.handles[j]); + } + p += sprintf(p, "\n"); + } + + for (i=0; itrips.active[i].flags.valid)) + break; + p += sprintf(p, "active[%d]: %lu C: devices=", + i, KELVIN_TO_CELSIUS(tz->trips.active[i].temperature)); + for (j=0; jtrips.active[i].devices.count; j++) + p += sprintf(p, "0x%p ", + tz->trips.active[i].devices.handles[j]); + p += sprintf(p, "\n"); + } + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_thermal_read_cooling_mode ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_thermal *tz = (struct acpi_thermal *) data; + char *p = page; + int len = 0; + + ACPI_FUNCTION_TRACE("acpi_thermal_read_cooling_mode"); + + if (!tz || (off != 0)) + goto end; + + if (!tz->flags.cooling_mode) { + p += sprintf(p, "\n"); + goto end; + } + + p += sprintf(p, "cooling mode: %s\n", + tz->cooling_mode?"passive":"active"); + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_thermal_write_cooling_mode ( + struct file *file, + const char *buffer, + unsigned long count, + void *data) +{ + int result = 0; + struct acpi_thermal *tz = (struct acpi_thermal *) data; + char mode_string[12] = {'\0'}; + + ACPI_FUNCTION_TRACE("acpi_thermal_write_cooling_mode"); + + if (!tz || (count > sizeof(mode_string) - 1)) + return_VALUE(-EINVAL); + + if (!tz->flags.cooling_mode) + return_VALUE(-ENODEV); + + if (copy_from_user(mode_string, buffer, count)) + return_VALUE(-EFAULT); + + mode_string[count] = '\0'; + + result = acpi_thermal_set_cooling_mode(tz, + simple_strtoul(mode_string, NULL, 0)); + if (0 != result) + return_VALUE(result); + + return_VALUE(count); +} + + +static int +acpi_thermal_read_polling ( + char *page, + char **start, + off_t off, + int count, + int *eof, + void *data) +{ + struct acpi_thermal *tz = (struct acpi_thermal *) data; + char *p = page; + int len = 0; + + ACPI_FUNCTION_TRACE("acpi_thermal_read_polling"); + + if (!tz || (off != 0)) + goto end; + + if (!tz->polling_frequency) { + p += sprintf(p, "\n"); + goto end; + } + + p += sprintf(p, "polling frequency: %lu seconds\n", + (tz->polling_frequency / 10)); + +end: + len = (p - page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + + return_VALUE(len); +} + + +static int +acpi_thermal_write_polling ( + struct file *file, + const char *buffer, + unsigned long count, + void *data) +{ + int result = 0; + struct acpi_thermal *tz = (struct acpi_thermal *) data; + char polling_string[12] = {'\0'}; + int seconds = 0; + + ACPI_FUNCTION_TRACE("acpi_thermal_write_polling"); + + if (!tz || (count > sizeof(polling_string) - 1)) + return_VALUE(-EINVAL); + + if (copy_from_user(polling_string, buffer, count)) + return_VALUE(-EFAULT); + + polling_string[count] = '\0'; + + seconds = simple_strtoul(polling_string, NULL, 0); + + result = acpi_thermal_set_polling(tz, seconds); + if (0 != result) + return_VALUE(result); + + acpi_thermal_check(tz); + + return_VALUE(count); +} + + +static int +acpi_thermal_add_fs ( + struct acpi_device *device) +{ + struct proc_dir_entry *entry = NULL; + + ACPI_FUNCTION_TRACE("acpi_thermal_add_fs"); + + if (!acpi_thermal_dir) { + acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, + acpi_root_dir); + if (!acpi_thermal_dir) + return_VALUE(-ENODEV); + } + + if (!acpi_device_dir(device)) { + acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), + acpi_thermal_dir); + if (!acpi_device_dir(device)) + return_VALUE(-ENODEV); + } + + /* 'state' [R] */ + entry = create_proc_entry(ACPI_THERMAL_FILE_STATE, + S_IRUGO, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_THERMAL_FILE_STATE)); + else { + entry->read_proc = acpi_thermal_read_state; + entry->data = acpi_driver_data(device); + } + + /* 'temperature' [R] */ + entry = create_proc_entry(ACPI_THERMAL_FILE_TEMPERATURE, + S_IRUGO, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_THERMAL_FILE_TEMPERATURE)); + else { + entry->read_proc = acpi_thermal_read_temperature; + entry->data = acpi_driver_data(device); + } + + /* 'trip_points' [R] */ + entry = create_proc_entry(ACPI_THERMAL_FILE_TRIP_POINTS, + S_IRUGO, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_THERMAL_FILE_POLLING_FREQ)); + else { + entry->read_proc = acpi_thermal_read_trip_points; + entry->data = acpi_driver_data(device); + } + + /* 'cooling_mode' [R/W] */ + entry = create_proc_entry(ACPI_THERMAL_FILE_COOLING_MODE, + S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_THERMAL_FILE_COOLING_MODE)); + else { + entry->read_proc = acpi_thermal_read_cooling_mode; + entry->write_proc = acpi_thermal_write_cooling_mode; + entry->data = acpi_driver_data(device); + } + + /* 'polling_frequency' [R/W] */ + entry = create_proc_entry(ACPI_THERMAL_FILE_POLLING_FREQ, + S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_THERMAL_FILE_POLLING_FREQ)); + else { + entry->read_proc = acpi_thermal_read_polling; + entry->write_proc = acpi_thermal_write_polling; + entry->data = acpi_driver_data(device); + } + + return_VALUE(0); +} + + +static int +acpi_thermal_remove_fs ( + struct acpi_device *device) +{ + ACPI_FUNCTION_TRACE("acpi_thermal_remove_fs"); + + if (!acpi_thermal_dir) + return_VALUE(-ENODEV); + + if (acpi_device_dir(device)) + remove_proc_entry(acpi_device_bid(device), acpi_thermal_dir); + + return_VALUE(0); +} + + +/* -------------------------------------------------------------------------- + Driver Interface + -------------------------------------------------------------------------- */ + +static void +acpi_thermal_notify ( + acpi_handle handle, + u32 event, + void *data) +{ + struct acpi_thermal *tz = (struct acpi_thermal *) data; + struct acpi_device *device = NULL; + + ACPI_FUNCTION_TRACE("acpi_thermal_notify"); + + if (!tz) + return_VOID; + + if (0 != acpi_bus_get_device(tz->handle, &device)) + return_VOID; + + switch (event) { + case ACPI_THERMAL_NOTIFY_TEMPERATURE: + acpi_thermal_check(tz); + break; + case ACPI_THERMAL_NOTIFY_THRESHOLDS: + acpi_thermal_get_trip_points(tz); + acpi_thermal_check(tz); + acpi_bus_generate_event(device, event, 0); + break; + case ACPI_THERMAL_NOTIFY_DEVICES: + if (tz->flags.devices) + acpi_thermal_get_devices(tz); + acpi_bus_generate_event(device, event, 0); + break; + default: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Unsupported event [0x%x]\n", event)); + break; + } + + return_VOID; +} + + +static int +acpi_thermal_get_info ( + struct acpi_thermal *tz) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_thermal_get_info"); + + if (!tz) + return_VALUE(-EINVAL); + + /* Get temperature [_TMP] (required) */ + result = acpi_thermal_get_temperature(tz); + if (0 != result) + return_VALUE(result); + + /* Set the cooling mode [_SCP] to active cooling (default) */ + result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE); + if (0 == result) + tz->flags.cooling_mode = 1; + + /* Get trip points [_CRT, _PSV, etc.] (required) */ + result = acpi_thermal_get_trip_points(tz); + if (0 != result) + return_VALUE(result); + + /* Get default polling frequency [_TZP] (optional) */ + if (tzp) + tz->polling_frequency = tzp; + else + acpi_thermal_get_polling_frequency(tz); + + /* Get devices in this thermal zone [_TZD] (optional) */ + result = acpi_thermal_get_devices(tz); + if (0 == result) + tz->flags.devices = 1; + + return_VALUE(0); +} + + +static int +acpi_thermal_add ( + struct acpi_device *device) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_thermal *tz = NULL; + + ACPI_FUNCTION_TRACE("acpi_thermal_add"); + + if (!device) + return_VALUE(-EINVAL); + + tz = kmalloc(sizeof(struct acpi_thermal), GFP_KERNEL); + if (!tz) + return_VALUE(-ENOMEM); + memset(tz, 0, sizeof(struct acpi_thermal)); + + tz->handle = device->handle; + sprintf(tz->name, "%s", device->pnp.bus_id); + sprintf(acpi_device_name(device), "%s", ACPI_THERMAL_DEVICE_NAME); + sprintf(acpi_device_class(device), "%s", ACPI_THERMAL_CLASS); + acpi_driver_data(device) = tz; + + result = acpi_thermal_get_info(tz); + if (0 != result) + goto end; + + result = acpi_thermal_add_fs(device); + if (0 != result) + return_VALUE(result); + + acpi_thermal_check(tz); + + status = acpi_install_notify_handler(tz->handle, + ACPI_DEVICE_NOTIFY, acpi_thermal_notify, tz); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error installing notify handler\n")); + result = -ENODEV; + goto end; + } + + init_timer(&tz->timer); + + printk(KERN_INFO PREFIX "%s [%s] (%lu C)\n", + acpi_device_name(device), acpi_device_bid(device), + KELVIN_TO_CELSIUS(tz->temperature)); + +end: + if (result) { + acpi_thermal_remove_fs(device); + kfree(tz); + } + + return_VALUE(result); +} + + +static int +acpi_thermal_remove ( + struct acpi_device *device, + int type) +{ + acpi_status status = AE_OK; + struct acpi_thermal *tz = NULL; + + ACPI_FUNCTION_TRACE("acpi_thermal_remove"); + + if (!device || !acpi_driver_data(device)) + return_VALUE(-EINVAL); + + tz = (struct acpi_thermal *) acpi_driver_data(device); + + if (timer_pending(&(tz->timer))) + del_timer(&(tz->timer)); + + status = acpi_remove_notify_handler(tz->handle, + ACPI_DEVICE_NOTIFY, acpi_thermal_notify); + if (ACPI_FAILURE(status)) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing notify handler\n")); + + /* Terminate policy */ + if (tz->trips.passive.flags.valid + && tz->trips.passive.flags.enabled) { + tz->trips.passive.flags.enabled = 0; + acpi_thermal_passive(tz); + } + if (tz->trips.active[0].flags.valid + && tz->trips.active[0].flags.enabled) { + tz->trips.active[0].flags.enabled = 0; + acpi_thermal_active(tz); + } + + acpi_thermal_remove_fs(device); + + return_VALUE(0); +} + + +static int __init +acpi_thermal_init (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_thermal_init"); + + result = acpi_bus_register_driver(&acpi_thermal_driver); + if (0 > result) + return_VALUE(-ENODEV); + + return_VALUE(0); +} + + +static void __exit +acpi_thermal_exit (void) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_thermal_exit"); + + result = acpi_bus_unregister_driver(&acpi_thermal_driver); + if (0 == result) + remove_proc_entry(ACPI_THERMAL_CLASS, acpi_root_dir); + + return_VOID; +} + + +module_init(acpi_thermal_init); +module_exit(acpi_thermal_exit); diff -urN linux-2.4.18/drivers/acpi/utilities/Makefile lia64-2.4/drivers/acpi/utilities/Makefile --- linux-2.4.18/drivers/acpi/utilities/Makefile Wed Jun 20 17:47:40 2001 +++ lia64-2.4/drivers/acpi/utilities/Makefile Tue Apr 9 15:47:01 2002 @@ -1,11 +1,10 @@ # # Makefile for all Linux ACPI interpreter subdirectories -# EXCEPT for the ospm directory # O_TARGET := $(notdir $(CURDIR)).o -obj-$(CONFIG_ACPI) := $(patsubst %.c,%.o,$(wildcard *.c)) +obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c)) EXTRA_CFLAGS += $(ACPI_CFLAGS) diff -urN linux-2.4.18/drivers/acpi/utilities/utalloc.c lia64-2.4/drivers/acpi/utilities/utalloc.c --- linux-2.4.18/drivers/acpi/utilities/utalloc.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/utilities/utalloc.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: utalloc - local cache and memory allocation routines - * $Revision: 106 $ + * $Revision: 127 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,13 +25,9 @@ #include "acpi.h" -#include "acparser.h" -#include "acinterp.h" -#include "acnamesp.h" -#include "acglobal.h" #define _COMPONENT ACPI_UTILITIES - MODULE_NAME ("utalloc") + ACPI_MODULE_NAME ("utalloc") /****************************************************************************** @@ -56,7 +52,7 @@ ACPI_MEMORY_LIST *cache_info; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* If walk cache is full, just free this wallkstate object */ @@ -70,20 +66,22 @@ /* Otherwise put this object back into the cache */ else { - acpi_ut_acquire_mutex (ACPI_MTX_CACHES); + if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_CACHES))) { + return; + } /* Mark the object as cached */ - MEMSET (object, 0xCA, cache_info->object_size); - ((acpi_operand_object *) object)->common.data_type = ACPI_CACHED_OBJECT; + ACPI_MEMSET (object, 0xCA, cache_info->object_size); + ACPI_SET_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_CACHED); /* Put the object at the head of the cache list */ - * (char **) (((char *) object) + cache_info->link_offset) = cache_info->list_head; + * (ACPI_CAST_INDIRECT_PTR (char, &(((char *) object)[cache_info->link_offset]))) = cache_info->list_head; cache_info->list_head = object; cache_info->cache_depth++; - acpi_ut_release_mutex (ACPI_MTX_CACHES); + (void) acpi_ut_release_mutex (ACPI_MTX_CACHES); } } @@ -110,11 +108,14 @@ void *object; - PROC_NAME ("Ut_acquire_from_cache"); + ACPI_FUNCTION_NAME ("Ut_acquire_from_cache"); cache_info = &acpi_gbl_memory_lists[list_id]; - acpi_ut_acquire_mutex (ACPI_MTX_CACHES); + if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_CACHES))) { + return (NULL); + } + ACPI_MEM_TRACKING (cache_info->cache_requests++); /* Check the cache first */ @@ -123,7 +124,7 @@ /* There is an object available, use it */ object = cache_info->list_head; - cache_info->list_head = * (char **) (((char *) object) + cache_info->link_offset); + cache_info->list_head = *(ACPI_CAST_INDIRECT_PTR (char, &(((char *) object)[cache_info->link_offset]))); ACPI_MEM_TRACKING (cache_info->cache_hits++); cache_info->cache_depth--; @@ -133,11 +134,13 @@ object, acpi_gbl_memory_lists[list_id].list_name)); #endif - acpi_ut_release_mutex (ACPI_MTX_CACHES); + if (ACPI_FAILURE (acpi_ut_release_mutex (ACPI_MTX_CACHES))) { + return (NULL); + } /* Clear (zero) the previously used Object */ - MEMSET (object, 0, cache_info->object_size); + ACPI_MEMSET (object, 0, cache_info->object_size); } else { @@ -145,7 +148,9 @@ /* Avoid deadlock with ACPI_MEM_CALLOCATE */ - acpi_ut_release_mutex (ACPI_MTX_CACHES); + if (ACPI_FAILURE (acpi_ut_release_mutex (ACPI_MTX_CACHES))) { + return (NULL); + } object = ACPI_MEM_CALLOCATE (cache_info->object_size); ACPI_MEM_TRACKING (cache_info->total_allocated++); @@ -175,14 +180,14 @@ char *next; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); cache_info = &acpi_gbl_memory_lists[list_id]; while (cache_info->list_head) { /* Delete one cached state object */ - next = * (char **) (((char *) cache_info->list_head) + cache_info->link_offset); + next = *(ACPI_CAST_INDIRECT_PTR (char, &(((char *) cache_info->list_head)[cache_info->link_offset]))); ACPI_MEM_FREE (cache_info->list_head); cache_info->list_head = next; @@ -191,9 +196,230 @@ } -#ifdef ACPI_DBG_TRACK_ALLOCATIONS +/******************************************************************************* + * + * FUNCTION: Acpi_ut_validate_buffer + * + * PARAMETERS: Buffer - Buffer descriptor to be validated + * + * RETURN: Status + * + * DESCRIPTION: Perform parameter validation checks on an acpi_buffer + * + ******************************************************************************/ + +acpi_status +acpi_ut_validate_buffer ( + acpi_buffer *buffer) +{ + + /* Obviously, the structure pointer must be valid */ + + if (!buffer) { + return (AE_BAD_PARAMETER); + } + + /* Special semantics for the length */ + + if ((buffer->length == ACPI_NO_BUFFER) || + (buffer->length == ACPI_ALLOCATE_BUFFER) || + (buffer->length == ACPI_ALLOCATE_LOCAL_BUFFER)) { + return (AE_OK); + } + + /* Length is valid, the buffer pointer must be also */ + + if (!buffer->pointer) { + return (AE_BAD_PARAMETER); + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ut_initialize_buffer + * + * PARAMETERS: Required_length - Length needed + * Buffer - Buffer to be validated + * + * RETURN: Status + * + * DESCRIPTION: Validate that the buffer is of the required length or + * allocate a new buffer. + * + ******************************************************************************/ + +acpi_status +acpi_ut_initialize_buffer ( + acpi_buffer *buffer, + ACPI_SIZE required_length) +{ + acpi_status status = AE_OK; + + + switch (buffer->length) { + case ACPI_NO_BUFFER: + + /* Set the exception and returned the required length */ + + status = AE_BUFFER_OVERFLOW; + break; + + + case ACPI_ALLOCATE_BUFFER: + + /* Allocate a new buffer */ + + buffer->pointer = acpi_os_allocate (required_length); + if (!buffer->pointer) { + return (AE_NO_MEMORY); + } + + /* Clear the buffer */ + + ACPI_MEMSET (buffer->pointer, 0, required_length); + break; + + + case ACPI_ALLOCATE_LOCAL_BUFFER: + /* Allocate a new buffer with local interface to allow tracking */ + + buffer->pointer = ACPI_MEM_ALLOCATE (required_length); + if (!buffer->pointer) { + return (AE_NO_MEMORY); + } + + /* Clear the buffer */ + + ACPI_MEMSET (buffer->pointer, 0, required_length); + break; + + + default: + + /* Validate the size of the buffer */ + + if (buffer->length < required_length) { + status = AE_BUFFER_OVERFLOW; + } + + /* Clear the buffer */ + + ACPI_MEMSET (buffer->pointer, 0, required_length); + break; + } + + buffer->length = required_length; + return (status); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ut_allocate + * + * PARAMETERS: Size - Size of the allocation + * Component - Component type of caller + * Module - Source file name of caller + * Line - Line number of caller + * + * RETURN: Address of the allocated memory on success, NULL on failure. + * + * DESCRIPTION: The subsystem's equivalent of malloc. + * + ******************************************************************************/ + +void * +acpi_ut_allocate ( + ACPI_SIZE size, + u32 component, + NATIVE_CHAR *module, + u32 line) +{ + void *allocation; + + + ACPI_FUNCTION_TRACE_U32 ("Ut_allocate", size); + + + /* Check for an inadvertent size of zero bytes */ + + if (!size) { + _ACPI_REPORT_ERROR (module, line, component, + ("Ut_allocate: Attempt to allocate zero bytes\n")); + size = 1; + } + + allocation = acpi_os_allocate (size); + if (!allocation) { + /* Report allocation error */ + + _ACPI_REPORT_ERROR (module, line, component, + ("Ut_allocate: Could not allocate size %X\n", (u32) size)); + + return_PTR (NULL); + } + return_PTR (allocation); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ut_callocate + * + * PARAMETERS: Size - Size of the allocation + * Component - Component type of caller + * Module - Source file name of caller + * Line - Line number of caller + * + * RETURN: Address of the allocated memory on success, NULL on failure. + * + * DESCRIPTION: Subsystem equivalent of calloc. + * + ******************************************************************************/ + +void * +acpi_ut_callocate ( + ACPI_SIZE size, + u32 component, + NATIVE_CHAR *module, + u32 line) +{ + void *allocation; + + + ACPI_FUNCTION_TRACE_U32 ("Ut_callocate", size); + + + /* Check for an inadvertent size of zero bytes */ + + if (!size) { + _ACPI_REPORT_ERROR (module, line, component, + ("Ut_callocate: Attempt to allocate zero bytes\n")); + return_PTR (NULL); + } + + allocation = acpi_os_allocate (size); + if (!allocation) { + /* Report allocation error */ + + _ACPI_REPORT_ERROR (module, line, component, + ("Ut_callocate: Could not allocate size %X\n", (u32) size)); + return_PTR (NULL); + } + + /* Clear the memory block */ + + ACPI_MEMSET (allocation, 0, size); + return_PTR (allocation); +} + + +#ifdef ACPI_DBG_TRACK_ALLOCATIONS /* * These procedures are used for tracking memory leaks in the subsystem, and * they get compiled out when the ACPI_DBG_TRACK_ALLOCATIONS is not set. @@ -208,9 +434,162 @@ /******************************************************************************* * + * FUNCTION: Acpi_ut_allocate_and_track + * + * PARAMETERS: Size - Size of the allocation + * Component - Component type of caller + * Module - Source file name of caller + * Line - Line number of caller + * + * RETURN: Address of the allocated memory on success, NULL on failure. + * + * DESCRIPTION: The subsystem's equivalent of malloc. + * + ******************************************************************************/ + +void * +acpi_ut_allocate_and_track ( + ACPI_SIZE size, + u32 component, + NATIVE_CHAR *module, + u32 line) +{ + acpi_debug_mem_block *allocation; + acpi_status status; + + + allocation = acpi_ut_allocate (size + sizeof (acpi_debug_mem_block), component, + module, line); + if (!allocation) { + return (NULL); + } + + status = acpi_ut_track_allocation (ACPI_MEM_LIST_GLOBAL, allocation, size, + ACPI_MEM_MALLOC, component, module, line); + if (ACPI_FAILURE (status)) { + acpi_os_free (allocation); + return (NULL); + } + + acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].total_allocated++; + acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].current_total_size += (u32) size; + + return ((void *) &allocation->user_space); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ut_callocate_and_track + * + * PARAMETERS: Size - Size of the allocation + * Component - Component type of caller + * Module - Source file name of caller + * Line - Line number of caller + * + * RETURN: Address of the allocated memory on success, NULL on failure. + * + * DESCRIPTION: Subsystem equivalent of calloc. + * + ******************************************************************************/ + +void * +acpi_ut_callocate_and_track ( + ACPI_SIZE size, + u32 component, + NATIVE_CHAR *module, + u32 line) +{ + acpi_debug_mem_block *allocation; + acpi_status status; + + + allocation = acpi_ut_callocate (size + sizeof (acpi_debug_mem_block), component, + module, line); + if (!allocation) { + /* Report allocation error */ + + _ACPI_REPORT_ERROR (module, line, component, + ("Ut_callocate: Could not allocate size %X\n", (u32) size)); + return (NULL); + } + + status = acpi_ut_track_allocation (ACPI_MEM_LIST_GLOBAL, allocation, size, + ACPI_MEM_CALLOC, component, module, line); + if (ACPI_FAILURE (status)) { + acpi_os_free (allocation); + return (NULL); + } + + acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].total_allocated++; + acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].current_total_size += (u32) size; + + return ((void *) &allocation->user_space); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ut_free_and_track + * + * PARAMETERS: Allocation - Address of the memory to deallocate + * Component - Component type of caller + * Module - Source file name of caller + * Line - Line number of caller + * + * RETURN: None + * + * DESCRIPTION: Frees the memory at Allocation + * + ******************************************************************************/ + +void +acpi_ut_free_and_track ( + void *allocation, + u32 component, + NATIVE_CHAR *module, + u32 line) +{ + acpi_debug_mem_block *debug_block; + acpi_status status; + + + ACPI_FUNCTION_TRACE_PTR ("Ut_free", allocation); + + + if (NULL == allocation) { + _ACPI_REPORT_ERROR (module, line, component, + ("Acpi_ut_free: Attempt to delete a NULL address\n")); + + return_VOID; + } + + debug_block = ACPI_CAST_PTR (acpi_debug_mem_block, + (((char *) allocation) - sizeof (acpi_debug_mem_header))); + + acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].total_freed++; + acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].current_total_size -= debug_block->size; + + status = acpi_ut_remove_allocation (ACPI_MEM_LIST_GLOBAL, debug_block, + component, module, line); + if (ACPI_FAILURE (status)) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not free memory, %s\n", + acpi_format_exception (status))); + } + + acpi_os_free (debug_block); + + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed\n", allocation)); + + return_VOID; +} + + +/******************************************************************************* + * * FUNCTION: Acpi_ut_find_allocation * - * PARAMETERS: Address - Address of allocated memory + * PARAMETERS: Allocation - Address of allocated memory * * RETURN: A list element if found; NULL otherwise. * @@ -221,12 +600,12 @@ acpi_debug_mem_block * acpi_ut_find_allocation ( u32 list_id, - void *address) + void *allocation) { acpi_debug_mem_block *element; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); if (list_id > ACPI_MEM_LIST_MAX) { @@ -238,7 +617,7 @@ /* Search for the address. */ while (element) { - if (element == address) { + if (element == allocation) { return (element); } @@ -253,7 +632,7 @@ * * FUNCTION: Acpi_ut_track_allocation * - * PARAMETERS: Address - Address of allocated memory + * PARAMETERS: Allocation - Address of allocated memory * Size - Size of the allocation * Alloc_type - MEM_MALLOC or MEM_CALLOC * Component - Component type of caller @@ -269,8 +648,8 @@ acpi_status acpi_ut_track_allocation ( u32 list_id, - acpi_debug_mem_block *address, - u32 size, + acpi_debug_mem_block *allocation, + ACPI_SIZE size, u8 alloc_type, u32 component, NATIVE_CHAR *module, @@ -281,7 +660,7 @@ acpi_status status = AE_OK; - FUNCTION_TRACE_PTR ("Ut_track_allocation", address); + ACPI_FUNCTION_TRACE_PTR ("Ut_track_allocation", allocation); if (list_id > ACPI_MEM_LIST_MAX) { @@ -289,46 +668,49 @@ } mem_list = &acpi_gbl_memory_lists[list_id]; - acpi_ut_acquire_mutex (ACPI_MTX_MEMORY); + status = acpi_ut_acquire_mutex (ACPI_MTX_MEMORY); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* * Search list for this address to make sure it is not already on the list. * This will catch several kinds of problems. */ - element = acpi_ut_find_allocation (list_id, address); + element = acpi_ut_find_allocation (list_id, allocation); if (element) { - REPORT_ERROR (("Ut_track_allocation: Address already present in list! (%p)\n", - address)); + ACPI_REPORT_ERROR (("Ut_track_allocation: Allocation already present in list! (%p)\n", + allocation)); - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Element %p Address %p\n", element, address)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Element %p Address %p\n", element, allocation)); goto unlock_and_exit; } /* Fill in the instance data. */ - address->size = size; - address->alloc_type = alloc_type; - address->component = component; - address->line = line; + allocation->size = (u32) size; + allocation->alloc_type = alloc_type; + allocation->component = component; + allocation->line = line; - STRNCPY (address->module, module, MAX_MODULE_NAME); + ACPI_STRNCPY (allocation->module, module, ACPI_MAX_MODULE_NAME); /* Insert at list head */ if (mem_list->list_head) { - ((acpi_debug_mem_block *)(mem_list->list_head))->previous = address; + ((acpi_debug_mem_block *)(mem_list->list_head))->previous = allocation; } - address->next = mem_list->list_head; - address->previous = NULL; + allocation->next = mem_list->list_head; + allocation->previous = NULL; - mem_list->list_head = address; + mem_list->list_head = allocation; unlock_and_exit: - acpi_ut_release_mutex (ACPI_MTX_MEMORY); + status = acpi_ut_release_mutex (ACPI_MTX_MEMORY); return_ACPI_STATUS (status); } @@ -337,7 +719,7 @@ * * FUNCTION: Acpi_ut_remove_allocation * - * PARAMETERS: Address - Address of allocated memory + * PARAMETERS: Allocation - Address of allocated memory * Component - Component type of caller * Module - Source file name of caller * Line - Line number of caller @@ -351,15 +733,16 @@ acpi_status acpi_ut_remove_allocation ( u32 list_id, - acpi_debug_mem_block *address, + acpi_debug_mem_block *allocation, u32 component, NATIVE_CHAR *module, u32 line) { ACPI_MEMORY_LIST *mem_list; + acpi_status status; - FUNCTION_TRACE ("Ut_remove_allocation"); + ACPI_FUNCTION_TRACE ("Ut_remove_allocation"); if (list_id > ACPI_MEM_LIST_MAX) { @@ -370,37 +753,38 @@ if (NULL == mem_list->list_head) { /* No allocations! */ - _REPORT_ERROR (module, line, component, + _ACPI_REPORT_ERROR (module, line, component, ("Ut_remove_allocation: Empty allocation list, nothing to free!\n")); return_ACPI_STATUS (AE_OK); } - - acpi_ut_acquire_mutex (ACPI_MTX_MEMORY); + status = acpi_ut_acquire_mutex (ACPI_MTX_MEMORY); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* Unlink */ - if (address->previous) { - (address->previous)->next = address->next; + if (allocation->previous) { + (allocation->previous)->next = allocation->next; } else { - mem_list->list_head = address->next; + mem_list->list_head = allocation->next; } - if (address->next) { - (address->next)->previous = address->previous; + if (allocation->next) { + (allocation->next)->previous = allocation->previous; } - /* Mark the segment as deleted */ - MEMSET (&address->user_space, 0xEA, address->size); + ACPI_MEMSET (&allocation->user_space, 0xEA, allocation->size); - ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing size %X\n", address->size)); + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing size %X\n", allocation->size)); - acpi_ut_release_mutex (ACPI_MTX_MEMORY); - return_ACPI_STATUS (AE_OK); + status = acpi_ut_release_mutex (ACPI_MTX_MEMORY); + return_ACPI_STATUS (status); } @@ -424,7 +808,7 @@ ACPI_MEMORY_LIST *Mem_list; */ - FUNCTION_TRACE ("Ut_dump_allocation_info"); + ACPI_FUNCTION_TRACE ("Ut_dump_allocation_info"); /* ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, @@ -482,302 +866,120 @@ NATIVE_CHAR *module) { acpi_debug_mem_block *element; - u32 i; + ACPI_DESCRIPTOR *descriptor; + u32 num_outstanding = 0; - FUNCTION_TRACE ("Ut_dump_allocations"); - - - element = acpi_gbl_memory_lists[0].list_head; - if (element == NULL) { - ACPI_DEBUG_PRINT ((ACPI_DB_OK, - "No outstanding allocations.\n")); - return_VOID; - } + ACPI_FUNCTION_TRACE ("Ut_dump_allocations"); /* * Walk the allocation list. */ - acpi_ut_acquire_mutex (ACPI_MTX_MEMORY); - - ACPI_DEBUG_PRINT ((ACPI_DB_OK, - "Outstanding allocations:\n")); + if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_MEMORY))) { + return; + } - for (i = 1; ; i++) /* Just a counter */ { + element = acpi_gbl_memory_lists[0].list_head; + while (element) { if ((element->component & component) && - ((module == NULL) || (0 == STRCMP (module, element->module)))) { - if (((acpi_operand_object *)(&element->user_space))->common.type != ACPI_CACHED_OBJECT) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - "%p Len %04X %9.9s-%d", - &element->user_space, element->size, element->module, - element->line)); + ((module == NULL) || (0 == ACPI_STRCMP (module, element->module)))) { + /* Ignore allocated objects that are in a cache */ + + descriptor = ACPI_CAST_PTR (ACPI_DESCRIPTOR, &element->user_space); + if (descriptor->descriptor_id != ACPI_DESC_TYPE_CACHED) { + acpi_os_printf ("%p Len %04X %9.9s-%d ", + descriptor, element->size, element->module, + element->line); /* Most of the elements will be internal objects. */ - switch (((acpi_operand_object *) - (&element->user_space))->common.data_type) { - case ACPI_DESC_TYPE_INTERNAL: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " Obj_type %12.12s R%d", - acpi_ut_get_type_name (((acpi_operand_object *)(&element->user_space))->common.type), - ((acpi_operand_object *)(&element->user_space))->common.reference_count)); + switch (ACPI_GET_DESCRIPTOR_TYPE (descriptor)) { + case ACPI_DESC_TYPE_OPERAND: + acpi_os_printf ("Obj_type %12.12s R%hd", + acpi_ut_get_type_name (descriptor->object.common.type), + descriptor->object.common.reference_count); break; case ACPI_DESC_TYPE_PARSER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " Parse_obj Opcode %04X", - ((acpi_parse_object *)(&element->user_space))->opcode)); + acpi_os_printf ("Parse_obj Aml_opcode %04hX", + descriptor->op.asl.aml_opcode); break; case ACPI_DESC_TYPE_NAMED: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " Node %4.4s", - (char*)&((acpi_namespace_node *)(&element->user_space))->name)); + acpi_os_printf ("Node %4.4s", + descriptor->node.name.ascii); break; case ACPI_DESC_TYPE_STATE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " Untyped State_obj")); + acpi_os_printf ("Untyped State_obj"); break; case ACPI_DESC_TYPE_STATE_UPDATE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " UPDATE State_obj")); + acpi_os_printf ("UPDATE State_obj"); break; case ACPI_DESC_TYPE_STATE_PACKAGE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " PACKAGE State_obj")); + acpi_os_printf ("PACKAGE State_obj"); break; case ACPI_DESC_TYPE_STATE_CONTROL: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " CONTROL State_obj")); + acpi_os_printf ("CONTROL State_obj"); break; case ACPI_DESC_TYPE_STATE_RPSCOPE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " ROOT-PARSE-SCOPE State_obj")); + acpi_os_printf ("ROOT-PARSE-SCOPE State_obj"); break; case ACPI_DESC_TYPE_STATE_PSCOPE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " PARSE-SCOPE State_obj")); + acpi_os_printf ("PARSE-SCOPE State_obj"); break; case ACPI_DESC_TYPE_STATE_WSCOPE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " WALK-SCOPE State_obj")); + acpi_os_printf ("WALK-SCOPE State_obj"); break; case ACPI_DESC_TYPE_STATE_RESULT: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " RESULT State_obj")); + acpi_os_printf ("RESULT State_obj"); break; case ACPI_DESC_TYPE_STATE_NOTIFY: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " NOTIFY State_obj")); + acpi_os_printf ("NOTIFY State_obj"); + break; + + case ACPI_DESC_TYPE_STATE_THREAD: + acpi_os_printf ("THREAD State_obj"); + break; + + default: + /* All types should appear above */ break; } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "\n")); + acpi_os_printf ( "\n"); + num_outstanding++; } } - - if (element->next == NULL) { - break; - } - element = element->next; } - acpi_ut_release_mutex (ACPI_MTX_MEMORY); - - ACPI_DEBUG_PRINT ((ACPI_DB_OK, - "Total number of unfreed allocations = %d(%X)\n", i,i)); - - - return_VOID; - -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_ut_allocate - * - * PARAMETERS: Size - Size of the allocation - * Component - Component type of caller - * Module - Source file name of caller - * Line - Line number of caller - * - * RETURN: Address of the allocated memory on success, NULL on failure. - * - * DESCRIPTION: The subsystem's equivalent of malloc. - * - ******************************************************************************/ - -void * -acpi_ut_allocate ( - u32 size, - u32 component, - NATIVE_CHAR *module, - u32 line) -{ - acpi_debug_mem_block *address; - acpi_status status; - + (void) acpi_ut_release_mutex (ACPI_MTX_MEMORY); - FUNCTION_TRACE_U32 ("Ut_allocate", size); + /* Print summary */ - - /* Check for an inadvertent size of zero bytes */ - - if (!size) { - _REPORT_ERROR (module, line, component, - ("Ut_allocate: Attempt to allocate zero bytes\n")); - size = 1; - } - - address = acpi_os_allocate (size + sizeof (acpi_debug_mem_block)); - if (!address) { - /* Report allocation error */ - - _REPORT_ERROR (module, line, component, - ("Ut_allocate: Could not allocate size %X\n", size)); - - return_PTR (NULL); - } - - status = acpi_ut_track_allocation (ACPI_MEM_LIST_GLOBAL, address, size, - MEM_MALLOC, component, module, line); - if (ACPI_FAILURE (status)) { - acpi_os_free (address); - return_PTR (NULL); - } - - acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].total_allocated++; - acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].current_total_size += size; - - ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p Size %X\n", address, size)); - - return_PTR ((void *) &address->user_space); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_ut_callocate - * - * PARAMETERS: Size - Size of the allocation - * Component - Component type of caller - * Module - Source file name of caller - * Line - Line number of caller - * - * RETURN: Address of the allocated memory on success, NULL on failure. - * - * DESCRIPTION: Subsystem equivalent of calloc. - * - ******************************************************************************/ - -void * -acpi_ut_callocate ( - u32 size, - u32 component, - NATIVE_CHAR *module, - u32 line) -{ - acpi_debug_mem_block *address; - acpi_status status; - - - FUNCTION_TRACE_U32 ("Ut_callocate", size); - - - /* Check for an inadvertent size of zero bytes */ - - if (!size) { - _REPORT_ERROR (module, line, component, - ("Ut_callocate: Attempt to allocate zero bytes\n")); - return_PTR (NULL); - } - - - address = acpi_os_callocate (size + sizeof (acpi_debug_mem_block)); - if (!address) { - /* Report allocation error */ - - _REPORT_ERROR (module, line, component, - ("Ut_callocate: Could not allocate size %X\n", size)); - return_PTR (NULL); - } - - status = acpi_ut_track_allocation (ACPI_MEM_LIST_GLOBAL, address, size, - MEM_CALLOC, component, module, line); - if (ACPI_FAILURE (status)) { - acpi_os_free (address); - return_PTR (NULL); + if (!num_outstanding) { + ACPI_DEBUG_PRINT ((ACPI_DB_OK, + "No outstanding allocations.\n")); } - - acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].total_allocated++; - acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].current_total_size += size; - - ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p Size %X\n", address, size)); - return_PTR ((void *) &address->user_space); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_ut_free - * - * PARAMETERS: Address - Address of the memory to deallocate - * Component - Component type of caller - * Module - Source file name of caller - * Line - Line number of caller - * - * RETURN: None - * - * DESCRIPTION: Frees the memory at Address - * - ******************************************************************************/ - -void -acpi_ut_free ( - void *address, - u32 component, - NATIVE_CHAR *module, - u32 line) -{ - acpi_debug_mem_block *debug_block; - - - FUNCTION_TRACE_PTR ("Ut_free", address); - - - if (NULL == address) { - _REPORT_ERROR (module, line, component, - ("Acpi_ut_free: Trying to delete a NULL address\n")); - - return_VOID; + else { + ACPI_DEBUG_PRINT ((ACPI_DB_OK, + "%d(%X) Outstanding allocations\n", + num_outstanding, num_outstanding)); } - debug_block = (acpi_debug_mem_block *) - (((char *) address) - sizeof (acpi_debug_mem_header)); - - acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].total_freed++; - acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].current_total_size -= debug_block->size; - - acpi_ut_remove_allocation (ACPI_MEM_LIST_GLOBAL, debug_block, - component, module, line); - acpi_os_free (debug_block); - - ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed\n", address)); - return_VOID; } + #endif /* #ifdef ACPI_DBG_TRACK_ALLOCATIONS */ diff -urN linux-2.4.18/drivers/acpi/utilities/utcopy.c lia64-2.4/drivers/acpi/utilities/utcopy.c --- linux-2.4.18/drivers/acpi/utilities/utcopy.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/utilities/utcopy.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: utcopy - Internal to external object translation utilities - * $Revision: 83 $ + * $Revision: 98 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,13 +25,12 @@ #include "acpi.h" -#include "acinterp.h" #include "acnamesp.h" #include "amlcode.h" #define _COMPONENT ACPI_UTILITIES - MODULE_NAME ("utcopy") + ACPI_MODULE_NAME ("utcopy") /******************************************************************************* @@ -56,27 +55,28 @@ acpi_operand_object *internal_object, acpi_object *external_object, u8 *data_space, - u32 *buffer_space_used) + ACPI_SIZE *buffer_space_used) { - u32 length = 0; + acpi_buffer buffer; acpi_status status = AE_OK; - FUNCTION_TRACE ("Ut_copy_isimple_to_esimple"); + ACPI_FUNCTION_TRACE ("Ut_copy_isimple_to_esimple"); + + *buffer_space_used = 0; /* * Check for NULL object case (could be an uninitialized * package element */ if (!internal_object) { - *buffer_space_used = 0; return_ACPI_STATUS (AE_OK); } /* Always clear the external object */ - MEMSET (external_object, 0, sizeof (acpi_object)); + ACPI_MEMSET (external_object, 0, sizeof (acpi_object)); /* * In general, the external object will be the same type as @@ -87,28 +87,31 @@ /* However, only a limited number of external types are supported */ switch (internal_object->common.type) { - case ACPI_TYPE_STRING: - length = internal_object->string.length + 1; - external_object->string.length = internal_object->string.length; external_object->string.pointer = (NATIVE_CHAR *) data_space; - MEMCPY ((void *) data_space, (void *) internal_object->string.pointer, length); + external_object->string.length = internal_object->string.length; + *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD ((ACPI_SIZE) internal_object->string.length + 1); + + ACPI_MEMCPY ((void *) data_space, (void *) internal_object->string.pointer, + (ACPI_SIZE) internal_object->string.length + 1); break; case ACPI_TYPE_BUFFER: - length = internal_object->buffer.length; - external_object->buffer.length = internal_object->buffer.length; external_object->buffer.pointer = data_space; - MEMCPY ((void *) data_space, (void *) internal_object->buffer.pointer, length); + external_object->buffer.length = internal_object->buffer.length; + *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD (internal_object->string.length); + + ACPI_MEMCPY ((void *) data_space, (void *) internal_object->buffer.pointer, + internal_object->buffer.length); break; case ACPI_TYPE_INTEGER: - external_object->integer.value= internal_object->integer.value; + external_object->integer.value = internal_object->integer.value; break; @@ -143,15 +146,19 @@ * This is a named reference, get the string. We already know that * we have room for it, use max length */ - length = MAX_STRING_LENGTH; external_object->type = ACPI_TYPE_STRING; external_object->string.pointer = (NATIVE_CHAR *) data_space; - status = acpi_ns_handle_to_pathname ((acpi_handle *) internal_object->reference.node, - &length, (char *) data_space); + + buffer.length = MAX_STRING_LENGTH; + buffer.pointer = data_space; + + status = acpi_ns_handle_to_pathname ((acpi_handle) internal_object->reference.node, + &buffer); /* Converted (external) string length is returned from above */ - external_object->string.length = length; + external_object->string.length = (u32) buffer.length; + *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD (buffer.length); break; default: @@ -189,12 +196,8 @@ * There is no corresponding external object type */ return_ACPI_STATUS (AE_SUPPORT); - break; } - - *buffer_space_used = (u32) ROUND_UP_TO_NATIVE_WORD (length); - return_ACPI_STATUS (status); } @@ -220,12 +223,12 @@ { acpi_status status = AE_OK; acpi_pkg_info *info = (acpi_pkg_info *) context; - u32 object_space; + ACPI_SIZE object_space; u32 this_index; acpi_object *target_object; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); this_index = state->pkg.index; @@ -236,16 +239,16 @@ case ACPI_COPY_TYPE_SIMPLE: /* - * This is a simple or null object -- get the size + * This is a simple or null object */ status = acpi_ut_copy_isimple_to_esimple (source_object, target_object, info->free_space, &object_space); if (ACPI_FAILURE (status)) { return (status); } - break; + case ACPI_COPY_TYPE_PACKAGE: /* @@ -253,7 +256,7 @@ */ target_object->type = ACPI_TYPE_PACKAGE; target_object->package.count = source_object->package.count; - target_object->package.elements = (acpi_object *) info->free_space; + target_object->package.elements = ACPI_CAST_PTR (acpi_object, info->free_space); /* * Pass the new package object back to the package walk routine @@ -264,18 +267,17 @@ * Save space for the array of objects (Package elements) * update the buffer length counter */ - object_space = (u32) ROUND_UP_TO_NATIVE_WORD ( - target_object->package.count * sizeof (acpi_object)); + object_space = ACPI_ROUND_UP_TO_NATIVE_WORD ( + (ACPI_SIZE) target_object->package.count * sizeof (acpi_object)); break; + default: return (AE_BAD_PARAMETER); } - info->free_space += object_space; info->length += object_space; - return (status); } @@ -303,20 +305,20 @@ acpi_ut_copy_ipackage_to_epackage ( acpi_operand_object *internal_object, u8 *buffer, - u32 *space_used) + ACPI_SIZE *space_used) { acpi_object *external_object; acpi_status status; acpi_pkg_info info; - FUNCTION_TRACE ("Ut_copy_ipackage_to_epackage"); + ACPI_FUNCTION_TRACE ("Ut_copy_ipackage_to_epackage"); /* * First package at head of the buffer */ - external_object = (acpi_object *) buffer; + external_object = ACPI_CAST_PTR (acpi_object, buffer); /* * Free space begins right after the first package @@ -324,31 +326,27 @@ info.length = 0; info.object_space = 0; info.num_packages = 1; - info.free_space = buffer + ROUND_UP_TO_NATIVE_WORD (sizeof (acpi_object)); - + info.free_space = buffer + ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (acpi_object)); external_object->type = internal_object->common.type; external_object->package.count = internal_object->package.count; - external_object->package.elements = (acpi_object *) info.free_space; - + external_object->package.elements = ACPI_CAST_PTR (acpi_object, info.free_space); /* * Build an array of ACPI_OBJECTS in the buffer * and move the free space past it */ info.free_space += external_object->package.count * - ROUND_UP_TO_NATIVE_WORD (sizeof (acpi_object)); - + ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (acpi_object)); status = acpi_ut_walk_package_tree (internal_object, external_object, acpi_ut_copy_ielement_to_eelement, &info); *space_used = info.length; - return_ACPI_STATUS (status); - } + /******************************************************************************* * * FUNCTION: Acpi_ut_copy_iobject_to_eobject @@ -371,10 +369,10 @@ acpi_status status; - FUNCTION_TRACE ("Ut_copy_iobject_to_eobject"); + ACPI_FUNCTION_TRACE ("Ut_copy_iobject_to_eobject"); - if (IS_THIS_OBJECT_TYPE (internal_object, ACPI_TYPE_PACKAGE)) { + if (internal_object->common.type == ACPI_TYPE_PACKAGE) { /* * Package object: Copy all subobjects (including * nested packages) @@ -382,7 +380,6 @@ status = acpi_ut_copy_ipackage_to_epackage (internal_object, ret_buffer->pointer, &ret_buffer->length); } - else { /* * Build a simple object (no nested objects) @@ -390,7 +387,7 @@ status = acpi_ut_copy_isimple_to_esimple (internal_object, (acpi_object *) ret_buffer->pointer, ((u8 *) ret_buffer->pointer + - ROUND_UP_TO_NATIVE_WORD (sizeof (acpi_object))), + ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (acpi_object))), &ret_buffer->length); /* * build simple does not include the object size in the length @@ -427,7 +424,7 @@ acpi_operand_object *internal_object; - FUNCTION_TRACE ("Ut_copy_esimple_to_isimple"); + ACPI_FUNCTION_TRACE ("Ut_copy_esimple_to_isimple"); /* @@ -449,7 +446,6 @@ * Whatever other type -- it is not supported */ return_ACPI_STATUS (AE_SUPPORT); - break; } @@ -459,14 +455,14 @@ case ACPI_TYPE_STRING: - internal_object->string.pointer = ACPI_MEM_CALLOCATE (external_object->string.length + 1); + internal_object->string.pointer = ACPI_MEM_CALLOCATE ((ACPI_SIZE) external_object->string.length + 1); if (!internal_object->string.pointer) { return_ACPI_STATUS (AE_NO_MEMORY); } - MEMCPY (internal_object->string.pointer, - external_object->string.pointer, - external_object->string.length); + ACPI_MEMCPY (internal_object->string.pointer, + external_object->string.pointer, + external_object->string.length); internal_object->string.length = external_object->string.length; break; @@ -479,9 +475,9 @@ return_ACPI_STATUS (AE_NO_MEMORY); } - MEMCPY (internal_object->buffer.pointer, - external_object->buffer.pointer, - external_object->buffer.length); + ACPI_MEMCPY (internal_object->buffer.pointer, + external_object->buffer.pointer, + external_object->buffer.length); internal_object->buffer.length = external_object->buffer.length; break; @@ -491,8 +487,11 @@ internal_object->integer.value = external_object->integer.value; break; - } + default: + /* Other types can't get here */ + break; + } *ret_internal_object = internal_object; return_ACPI_STATUS (AE_OK); @@ -537,7 +536,7 @@ acpi_object *this_external_obj; - FUNCTION_TRACE ("Ut_copy_epackage_to_ipackage"); + ACPI_FUNCTION_TRACE ("Ut_copy_epackage_to_ipackage"); /* @@ -591,23 +590,13 @@ acpi_status status; - FUNCTION_TRACE ("Ut_copy_eobject_to_iobject"); + ACPI_FUNCTION_TRACE ("Ut_copy_eobject_to_iobject"); if (external_object->type == ACPI_TYPE_PACKAGE) { /* - * Package objects contain other objects (which can be objects) - * buildpackage does it all - * - * TBD: Package conversion must be completed and tested - * NOTE: this code converts packages as input parameters to - * control methods only. This is a very, very rare case. + * Packages as external input to control methods are not supported, */ -/* - Status = Acpi_ut_copy_epackage_to_ipackage(Internal_object, - Ret_buffer->Pointer, - &Ret_buffer->Length); -*/ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Packages as parameters not implemented!\n")); @@ -627,11 +616,88 @@ /******************************************************************************* * + * FUNCTION: Acpi_ut_copy_simple_object + * + * PARAMETERS: Source_desc - The internal object to be copied + * Dest_desc - New target object + * + * RETURN: Status + * + * DESCRIPTION: Simple copy of one internal object to another. Reference count + * of the destination object is preserved. + * + ******************************************************************************/ + +acpi_status +acpi_ut_copy_simple_object ( + acpi_operand_object *source_desc, + acpi_operand_object *dest_desc) +{ + u16 reference_count; + acpi_operand_object *next_object; + + + /* Save fields from destination that we don't want to overwrite */ + + reference_count = dest_desc->common.reference_count; + next_object = dest_desc->common.next_object; + + /* Copy the entire source object over the destination object*/ + + ACPI_MEMCPY ((char *) dest_desc, (char *) source_desc, sizeof (acpi_operand_object)); + + /* Restore the saved fields */ + + dest_desc->common.reference_count = reference_count; + dest_desc->common.next_object = next_object; + + /* Handle the objects with extra data */ + + switch (dest_desc->common.type) { + case ACPI_TYPE_BUFFER: + + dest_desc->buffer.node = NULL; + dest_desc->common.flags = source_desc->common.flags; + + /* Fall through to common string/buffer case */ + /*lint -fallthrough */ + + case ACPI_TYPE_STRING: + + /* + * Allocate and copy the actual string if and only if: + * 1) There is a valid string (length > 0) + * 2) The string is not static (not in an ACPI table) (in this case, + * the actual pointer was already copied above) + */ + if ((source_desc->string.length) && + (!(source_desc->common.flags & AOPOBJ_STATIC_POINTER))) { + dest_desc->string.pointer = ACPI_MEM_ALLOCATE (source_desc->string.length); + if (!dest_desc->string.pointer) { + return (AE_NO_MEMORY); + } + + ACPI_MEMCPY (dest_desc->string.pointer, source_desc->string.pointer, + source_desc->string.length); + } + break; + + default: + /* Nothing to do for other simple objects */ + break; + } + + return (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: Acpi_ut_copy_ielement_to_ielement * * PARAMETERS: ACPI_PKG_CALLBACK * - * RETURN: Status - the status of the call + * RETURN: Status * * DESCRIPTION: Copy one package element to another package element * @@ -650,7 +716,7 @@ acpi_operand_object *target_object; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); this_index = state->pkg.index; @@ -668,8 +734,7 @@ return (AE_NO_MEMORY); } - status = acpi_ex_store_object_to_object (source_object, target_object, - (acpi_walk_state *) context); + status = acpi_ut_copy_simple_object (source_object, target_object); if (ACPI_FAILURE (status)) { return (status); } @@ -679,18 +744,18 @@ case 1: + /* * This object is a package - go down another nesting level * Create and build the package object */ target_object = acpi_ut_create_internal_object (ACPI_TYPE_PACKAGE); if (!target_object) { - /* TBD: must delete package created up to this point */ - return (AE_NO_MEMORY); } target_object->package.count = source_object->package.count; + target_object->common.flags = source_object->common.flags; /* * Pass the new package object back to the package walk routine @@ -703,11 +768,11 @@ *this_target_ptr = target_object; break; + default: return (AE_BAD_PARAMETER); } - return (status); } @@ -735,30 +800,85 @@ acpi_status status = AE_OK; - FUNCTION_TRACE ("Ut_copy_ipackage_to_ipackage"); + ACPI_FUNCTION_TRACE ("Ut_copy_ipackage_to_ipackage"); dest_obj->common.type = source_obj->common.type; + dest_obj->common.flags = source_obj->common.flags; dest_obj->package.count = source_obj->package.count; /* * Create the object array and walk the source package tree */ - dest_obj->package.elements = ACPI_MEM_CALLOCATE ((source_obj->package.count + 1) * + dest_obj->package.elements = ACPI_MEM_CALLOCATE (((ACPI_SIZE) source_obj->package.count + 1) * sizeof (void *)); - dest_obj->package.next_element = dest_obj->package.elements; - if (!dest_obj->package.elements) { - REPORT_ERROR ( + ACPI_REPORT_ERROR ( ("Aml_build_copy_internal_package_object: Package allocation failure\n")); return_ACPI_STATUS (AE_NO_MEMORY); } - + /* + * Copy the package element-by-element by walking the package "tree". + * This handles nested packages of arbitrary depth. + */ status = acpi_ut_walk_package_tree (source_obj, dest_obj, acpi_ut_copy_ielement_to_ielement, walk_state); + if (ACPI_FAILURE (status)) { + /* On failure, delete the destination package object */ + + acpi_ut_remove_reference (dest_obj); + } return_ACPI_STATUS (status); } + + +/******************************************************************************* + * + * FUNCTION: Acpi_ut_copy_iobject_to_iobject + * + * PARAMETERS: Walk_state - Current walk state + * Source_desc - The internal object to be copied + * Dest_desc - Where the copied object is returned + * + * RETURN: Status + * + * DESCRIPTION: Copy an internal object to a new internal object + * + ******************************************************************************/ + +acpi_status +acpi_ut_copy_iobject_to_iobject ( + acpi_operand_object *source_desc, + acpi_operand_object **dest_desc, + acpi_walk_state *walk_state) +{ + acpi_status status = AE_OK; + + + ACPI_FUNCTION_TRACE ("Ut_copy_iobject_to_iobject"); + + + /* Create the top level object */ + + *dest_desc = acpi_ut_create_internal_object (source_desc->common.type); + if (!*dest_desc) { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + /* Copy the object and possible subobjects */ + + if (source_desc->common.type == ACPI_TYPE_PACKAGE) { + status = acpi_ut_copy_ipackage_to_ipackage (source_desc, *dest_desc, + walk_state); + } + else { + status = acpi_ut_copy_simple_object (source_desc, *dest_desc); + } + + return_ACPI_STATUS (status); +} + diff -urN linux-2.4.18/drivers/acpi/utilities/utdebug.c lia64-2.4/drivers/acpi/utilities/utdebug.c --- linux-2.4.18/drivers/acpi/utilities/utdebug.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/utilities/utdebug.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: utdebug - Debug print routines - * $Revision: 90 $ + * $Revision: 103 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,16 +27,15 @@ #include "acpi.h" #define _COMPONENT ACPI_UTILITIES - MODULE_NAME ("utdebug") - - -u32 acpi_gbl_prev_thread_id = 0xFFFFFFFF; -char *acpi_gbl_fn_entry_str = "----Entry"; -char *acpi_gbl_fn_exit_str = "----Exit-"; + ACPI_MODULE_NAME ("utdebug") #ifdef ACPI_DEBUG +static u32 acpi_gbl_prev_thread_id = 0xFFFFFFFF; +static char *acpi_gbl_fn_entry_str = "----Entry"; +static char *acpi_gbl_fn_exit_str = "----Exit-"; + /***************************************************************************** * @@ -57,7 +56,7 @@ u32 current_sp; - acpi_gbl_entry_stack_pointer = (u32) ¤t_sp; + acpi_gbl_entry_stack_pointer = ACPI_PTR_DIFF (¤t_sp, NULL); } @@ -77,9 +76,10 @@ acpi_ut_track_stack_ptr ( void) { - u32 current_sp; + ACPI_SIZE current_sp; - current_sp = (u32) ¤t_sp; + + current_sp = ACPI_PTR_DIFF (¤t_sp, NULL); if (current_sp < acpi_gbl_lowest_stack_pointer) { acpi_gbl_lowest_stack_pointer = current_sp; @@ -111,7 +111,7 @@ * ****************************************************************************/ -void +void ACPI_INTERNAL_VAR_XFACE acpi_ut_debug_print ( u32 requested_debug_level, u32 line_number, @@ -131,7 +131,6 @@ return; } - /* * Thread tracking and context switch notification */ @@ -150,14 +149,13 @@ * Display the module name, current line number, thread ID (if requested), * current procedure nesting level, and the current procedure name */ - acpi_os_printf ("%8s-%04d ", dbg_info->module_name, line_number); + acpi_os_printf ("%8s-%04ld ", dbg_info->module_name, line_number); if (ACPI_LV_THREADS & acpi_dbg_level) { - acpi_os_printf ("[%04X] ", thread_id, acpi_gbl_nesting_level, dbg_info->proc_name); + acpi_os_printf ("[%04lX] ", thread_id, acpi_gbl_nesting_level, dbg_info->proc_name); } - acpi_os_printf ("[%02d] %-22.22s: ", acpi_gbl_nesting_level, dbg_info->proc_name); - + acpi_os_printf ("[%02ld] %-22.22s: ", acpi_gbl_nesting_level, dbg_info->proc_name); va_start (args, format); acpi_os_vprintf (format, args); @@ -184,7 +182,7 @@ * ****************************************************************************/ -void +void ACPI_INTERNAL_VAR_XFACE acpi_ut_debug_print_raw ( u32 requested_debug_level, u32 line_number, @@ -201,7 +199,6 @@ } va_start (args, format); - acpi_os_vprintf (format, args); } @@ -431,7 +428,8 @@ { acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, - "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str, HIDWORD(value), LODWORD(value)); + "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str, + ACPI_HIDWORD (value), ACPI_LODWORD (value)); acpi_gbl_nesting_level--; } @@ -493,8 +491,8 @@ u32 display, u32 component_id) { - u32 i = 0; - u32 j; + NATIVE_UINT i = 0; + NATIVE_UINT j; u32 temp32; u8 buf_char; @@ -506,6 +504,11 @@ return; } + if ((count < 4) || (count & 0x01)) { + display = DB_BYTE_DISPLAY; + } + + acpi_os_printf ("\n_offset Value\n"); /* * Nasty little dump buffer routine! @@ -515,7 +518,6 @@ acpi_os_printf ("%05X ", i); - /* Print 16 hex chars */ for (j = 0; j < 16;) { @@ -539,8 +541,8 @@ case DB_WORD_DISPLAY: - MOVE_UNALIGNED16_TO_32 (&temp32, - &buffer[i + j]); + ACPI_MOVE_UNALIGNED16_TO_32 (&temp32, + &buffer[i + j]); acpi_os_printf ("%04X ", temp32); j += 2; break; @@ -548,8 +550,8 @@ case DB_DWORD_DISPLAY: - MOVE_UNALIGNED32_TO_32 (&temp32, - &buffer[i + j]); + ACPI_MOVE_UNALIGNED32_TO_32 (&temp32, + &buffer[i + j]); acpi_os_printf ("%08X ", temp32); j += 4; break; @@ -557,24 +559,22 @@ case DB_QWORD_DISPLAY: - MOVE_UNALIGNED32_TO_32 (&temp32, - &buffer[i + j]); + ACPI_MOVE_UNALIGNED32_TO_32 (&temp32, + &buffer[i + j]); acpi_os_printf ("%08X", temp32); - MOVE_UNALIGNED32_TO_32 (&temp32, - &buffer[i + j + 4]); + ACPI_MOVE_UNALIGNED32_TO_32 (&temp32, + &buffer[i + j + 4]); acpi_os_printf ("%08X ", temp32); j += 8; break; } } - /* * Print the ASCII equivalent characters * But watch out for the bad unprintable ones... */ - for (j = 0; j < 16; j++) { if (i + j >= count) { acpi_os_printf ("\n"); diff -urN linux-2.4.18/drivers/acpi/utilities/utdelete.c lia64-2.4/drivers/acpi/utilities/utdelete.c --- linux-2.4.18/drivers/acpi/utilities/utdelete.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/utilities/utdelete.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: utdelete - object deletion and reference count utilities - * $Revision: 81 $ + * $Revision: 90 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,11 +27,9 @@ #include "acpi.h" #include "acinterp.h" #include "acnamesp.h" -#include "actables.h" -#include "acparser.h" #define _COMPONENT ACPI_UTILITIES - MODULE_NAME ("utdelete") + ACPI_MODULE_NAME ("utdelete") /******************************************************************************* @@ -53,9 +51,10 @@ { void *obj_pointer = NULL; acpi_operand_object *handler_desc; + acpi_operand_object *second_desc; - FUNCTION_TRACE_PTR ("Ut_delete_internal_obj", object); + ACPI_FUNCTION_TRACE_PTR ("Ut_delete_internal_obj", object); if (!object) { @@ -67,10 +66,9 @@ * actual ACPI objects (for example, a raw buffer pointer). */ switch (object->common.type) { - case ACPI_TYPE_STRING: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** String %p, ptr %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "**** String %p, ptr %p\n", object, object->string.pointer)); /* Free the actual string buffer */ @@ -83,7 +81,7 @@ case ACPI_TYPE_BUFFER: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Buffer %p, ptr %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "**** Buffer %p, ptr %p\n", object, object->buffer.pointer)); /* Free the actual buffer */ @@ -94,7 +92,7 @@ case ACPI_TYPE_PACKAGE: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, " **** Package of count %X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, " **** Package of count %X\n", object->package.count)); /* @@ -110,43 +108,43 @@ case ACPI_TYPE_MUTEX: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "***** Mutex %p, Semaphore %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Mutex %p, Semaphore %p\n", object, object->mutex.semaphore)); acpi_ex_unlink_mutex (object); - acpi_os_delete_semaphore (object->mutex.semaphore); + (void) acpi_os_delete_semaphore (object->mutex.semaphore); break; case ACPI_TYPE_EVENT: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "***** Event %p, Semaphore %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Event %p, Semaphore %p\n", object, object->event.semaphore)); - acpi_os_delete_semaphore (object->event.semaphore); + (void) acpi_os_delete_semaphore (object->event.semaphore); object->event.semaphore = NULL; break; case ACPI_TYPE_METHOD: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "***** Method %p\n", object)); + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Method %p\n", object)); /* Delete the method semaphore if it exists */ if (object->method.semaphore) { - acpi_os_delete_semaphore (object->method.semaphore); + (void) acpi_os_delete_semaphore (object->method.semaphore); object->method.semaphore = NULL; } - break; case ACPI_TYPE_REGION: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "***** Region %p\n", object)); + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Region %p\n", object)); - if (object->region.extra) { + second_desc = acpi_ns_get_secondary_object (object); + if (second_desc) { /* * Free the Region_context if and only if the handler is one of the * default handlers -- and therefore, we created the context object @@ -154,53 +152,47 @@ */ handler_desc = object->region.addr_handler; if ((handler_desc) && - (handler_desc->addr_handler.hflags == ADDR_HANDLER_DEFAULT_INSTALLED)) { - obj_pointer = object->region.extra->extra.region_context; + (handler_desc->addr_handler.hflags == ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) { + obj_pointer = second_desc->extra.region_context; } /* Now we can free the Extra object */ - acpi_ut_delete_object_desc (object->region.extra); + acpi_ut_delete_object_desc (second_desc); } break; case ACPI_TYPE_BUFFER_FIELD: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "***** Buffer Field %p\n", object)); + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Buffer Field %p\n", object)); - if (object->buffer_field.extra) { - acpi_ut_delete_object_desc (object->buffer_field.extra); + second_desc = acpi_ns_get_secondary_object (object); + if (second_desc) { + acpi_ut_delete_object_desc (second_desc); } break; + default: break; } - /* - * Delete any allocated memory found above - */ + /* Free any allocated memory (pointer within the object) found above */ + if (obj_pointer) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting Obj Ptr %p \n", obj_pointer)); + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Deleting Object Subptr %p\n", + obj_pointer)); ACPI_MEM_FREE (obj_pointer); } - /* Only delete the object if it was dynamically allocated */ - - if (object->common.flags & AOPOBJ_STATIC_ALLOCATION) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object %p [%s] static allocation, no delete\n", - object, acpi_ut_get_type_name (object->common.type))); - } + /* Now the object can be safely deleted */ - if (!(object->common.flags & AOPOBJ_STATIC_ALLOCATION)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting object %p [%s]\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Deleting Object %p [%s]\n", object, acpi_ut_get_type_name (object->common.type))); - acpi_ut_delete_object_desc (object); - } - + acpi_ut_delete_object_desc (object); return_VOID; } @@ -211,21 +203,21 @@ * * PARAMETERS: *Obj_list - Pointer to the list to be deleted * - * RETURN: Status - the status of the call + * RETURN: None * * DESCRIPTION: This function deletes an internal object list, including both * simple objects and package objects * ******************************************************************************/ -acpi_status +void acpi_ut_delete_internal_object_list ( acpi_operand_object **obj_list) { acpi_operand_object **internal_obj; - FUNCTION_TRACE ("Ut_delete_internal_object_list"); + ACPI_FUNCTION_TRACE ("Ut_delete_internal_object_list"); /* Walk the null-terminated internal list */ @@ -237,8 +229,7 @@ /* Free the combined parameter pointer list and object array */ ACPI_MEM_FREE (obj_list); - - return_ACPI_STATUS (AE_OK); + return_VOID; } @@ -264,13 +255,13 @@ u16 new_count; - PROC_NAME ("Ut_update_ref_count"); + ACPI_FUNCTION_NAME ("Ut_update_ref_count"); + if (!object) { return; } - count = object->common.reference_count; new_count = count; @@ -284,7 +275,7 @@ new_count++; object->common.reference_count = new_count; - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Obj %p Refs=%X, [Incremented]\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, [Incremented]\n", object, new_count)); break; @@ -292,21 +283,20 @@ case REF_DECREMENT: if (count < 1) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Obj %p Refs=%X, can't decrement! (Set to 0)\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, can't decrement! (Set to 0)\n", object, new_count)); new_count = 0; } - else { new_count--; - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Obj %p Refs=%X, [Decremented]\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, [Decremented]\n", object, new_count)); } if (object->common.type == ACPI_TYPE_METHOD) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Method Obj %p Refs=%X, [Decremented]\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Method Obj %p Refs=%X, [Decremented]\n", object, new_count)); } @@ -320,7 +310,7 @@ case REF_FORCE_DELETE: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Obj %p Refs=%X, Force delete! (Set to 0)\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, Force delete! (Set to 0)\n", object, count)); new_count = 0; @@ -335,7 +325,6 @@ break; } - /* * Sanity check the reference count, for debug purposes only. * (A deleted object will have a huge reference count) @@ -386,7 +375,7 @@ acpi_generic_state *state; - FUNCTION_TRACE_PTR ("Ut_update_object_reference", object); + ACPI_FUNCTION_TRACE_PTR ("Ut_update_object_reference", object); /* Ignore a null object ptr */ @@ -395,16 +384,14 @@ return_ACPI_STATUS (AE_OK); } - /* - * Make sure that this isn't a namespace handle or an AML pointer + * Make sure that this isn't a namespace handle */ - if (VALID_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_NAMED)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object %p is NS handle\n", object)); + if (ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_NAMED) { + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p is NS handle\n", object)); return_ACPI_STATUS (AE_OK); } - state = acpi_ut_create_update_state (object, action); while (state) { @@ -417,13 +404,12 @@ * Different object types have different subobjects. */ switch (object->common.type) { - case ACPI_TYPE_DEVICE: status = acpi_ut_create_update_state_and_push (object->device.addr_handler, action, &state_list); if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + goto error_exit; } acpi_ut_update_ref_count (object->device.sys_handler, action); @@ -460,7 +446,7 @@ status = acpi_ut_create_update_state_and_push ( object->package.elements[i], action, &state_list); if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + goto error_exit; } } break; @@ -470,9 +456,8 @@ status = acpi_ut_create_update_state_and_push ( object->buffer_field.buffer_obj, action, &state_list); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + goto error_exit; } break; @@ -482,7 +467,7 @@ status = acpi_ut_create_update_state_and_push ( object->field.region_obj, action, &state_list); if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + goto error_exit; } break; @@ -490,15 +475,15 @@ case INTERNAL_TYPE_BANK_FIELD: status = acpi_ut_create_update_state_and_push ( - object->bank_field.bank_register_obj, action, &state_list); + object->bank_field.bank_obj, action, &state_list); if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + goto error_exit; } status = acpi_ut_create_update_state_and_push ( object->bank_field.region_obj, action, &state_list); if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + goto error_exit; } break; @@ -508,25 +493,25 @@ status = acpi_ut_create_update_state_and_push ( object->index_field.index_obj, action, &state_list); if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + goto error_exit; } status = acpi_ut_create_update_state_and_push ( object->index_field.data_obj, action, &state_list); if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + goto error_exit; } break; case ACPI_TYPE_REGION: case INTERNAL_TYPE_REFERENCE: + default: /* No subobjects */ break; } - /* * Now we can update the count in the main object. This can only * happen after we update the sub-objects in case this causes the @@ -534,14 +519,20 @@ */ acpi_ut_update_ref_count (object, action); - /* Move on to the next object to be updated */ state = acpi_ut_pop_generic_state (&state_list); } - return_ACPI_STATUS (AE_OK); + + +error_exit: + + ACPI_REPORT_ERROR (("Could not update object reference count, %s\n", + acpi_format_exception (status))); + + return_ACPI_STATUS (status); } @@ -563,7 +554,7 @@ acpi_operand_object *object) { - FUNCTION_TRACE_PTR ("Ut_add_reference", object); + ACPI_FUNCTION_TRACE_PTR ("Ut_add_reference", object); /* @@ -576,8 +567,7 @@ /* * We have a valid ACPI internal object, now increment the reference count */ - acpi_ut_update_object_reference (object, REF_INCREMENT); - + (void) acpi_ut_update_object_reference (object, REF_INCREMENT); return_VOID; } @@ -599,7 +589,7 @@ acpi_operand_object *object) { - FUNCTION_TRACE_PTR ("Ut_remove_reference", object); + ACPI_FUNCTION_TRACE_PTR ("Ut_remove_reference", object); /* * Allow a NULL pointer to be passed in, just ignore it. This saves @@ -607,7 +597,7 @@ * */ if (!object || - (VALID_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_NAMED))) { + (ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_NAMED)) { return_VOID; } @@ -618,7 +608,7 @@ return_VOID; } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Obj %p Refs=%X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X\n", object, object->common.reference_count)); /* @@ -626,7 +616,7 @@ * if the reference count becomes 0. (Must also decrement the ref count * of all subobjects!) */ - acpi_ut_update_object_reference (object, REF_DECREMENT); + (void) acpi_ut_update_object_reference (object, REF_DECREMENT); return_VOID; } diff -urN linux-2.4.18/drivers/acpi/utilities/uteval.c lia64-2.4/drivers/acpi/utilities/uteval.c --- linux-2.4.18/drivers/acpi/utilities/uteval.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/utilities/uteval.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: uteval - Object evaluation - * $Revision: 31 $ + * $Revision: 39 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ #define _COMPONENT ACPI_UTILITIES - MODULE_NAME ("uteval") + ACPI_MODULE_NAME ("uteval") /******************************************************************************* @@ -60,7 +60,7 @@ acpi_status status; - FUNCTION_TRACE ("Ut_evaluate_numeric_object"); + ACPI_FUNCTION_TRACE ("Ut_evaluate_numeric_object"); /* Execute the method */ @@ -68,12 +68,12 @@ status = acpi_ns_evaluate_relative (device_node, object_name, NULL, &obj_desc); if (ACPI_FAILURE (status)) { if (status == AE_NOT_FOUND) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s on %4.4s was not found\n", - object_name, (char*)&device_node->name)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s on %4.4s was not found\n", + object_name, device_node->name.ascii)); } else { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s on %4.4s failed with status %s\n", - object_name, (char*)&device_node->name, + object_name, device_node->name.ascii, acpi_format_exception (status))); } @@ -138,7 +138,7 @@ acpi_status status; - FUNCTION_TRACE ("Ut_execute_HID"); + ACPI_FUNCTION_TRACE ("Ut_execute_HID"); /* Execute the method */ @@ -147,13 +147,12 @@ METHOD_NAME__HID, NULL, &obj_desc); if (ACPI_FAILURE (status)) { if (status == AE_NOT_FOUND) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_HID on %4.4s was not found\n", - (char*)&device_node->name)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "_HID on %4.4s was not found\n", + device_node->name.ascii)); } - else { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_HID on %4.4s failed %s\n", - (char*)&device_node->name, acpi_format_exception (status))); + device_node->name.ascii, acpi_format_exception (status))); } return_ACPI_STATUS (status); @@ -177,21 +176,111 @@ "Type returned from _HID not a number or string: %s(%X) \n", acpi_ut_get_type_name (obj_desc->common.type), obj_desc->common.type)); } - else { if (obj_desc->common.type == ACPI_TYPE_INTEGER) { /* Convert the Numeric HID to string */ acpi_ex_eisa_id_to_string ((u32) obj_desc->integer.value, hid->buffer); } - else { /* Copy the String HID from the returned object */ - STRNCPY(hid->buffer, obj_desc->string.pointer, sizeof(hid->buffer)); + ACPI_STRNCPY (hid->buffer, obj_desc->string.pointer, sizeof(hid->buffer)); + } + } + + /* On exit, we must delete the return object */ + + acpi_ut_remove_reference (obj_desc); + + return_ACPI_STATUS (status); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ut_execute_CID + * + * PARAMETERS: Device_node - Node for the device + * *Cid - Where the CID is returned + * + * RETURN: Status + * + * DESCRIPTION: Executes the _CID control method that returns one or more + * compatible hardware IDs for the device. + * + * NOTE: Internal function, no parameter validation + * + ******************************************************************************/ + +acpi_status +acpi_ut_execute_CID ( + acpi_namespace_node *device_node, + acpi_device_id *cid) +{ + acpi_operand_object *obj_desc; + acpi_status status; + + + ACPI_FUNCTION_TRACE ("Ut_execute_CID"); + + /* Execute the method */ + + status = acpi_ns_evaluate_relative (device_node, + METHOD_NAME__CID, NULL, &obj_desc); + if (ACPI_FAILURE (status)) { + if (status == AE_NOT_FOUND) { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "_CID on %4.4s was not found\n", + device_node->name.ascii)); } + else { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_CID on %4.4s failed %s\n", + device_node->name.ascii, acpi_format_exception (status))); + } + + return_ACPI_STATUS (status); } + /* Did we get a return object? */ + + if (!obj_desc) { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from _CID\n")); + return_ACPI_STATUS (AE_TYPE); + } + + /* + * A _CID can return either a single compatible ID or a package of compatible + * IDs. Each compatible ID can be a Number (32 bit compressed EISA ID) or + * string (PCI ID format, e.g. "PCI\VEN_vvvv&DEV_dddd&SUBSYS_ssssssss"). + */ + switch (obj_desc->common.type) { + case ACPI_TYPE_INTEGER: + + /* Convert the Numeric CID to string */ + + acpi_ex_eisa_id_to_string ((u32) obj_desc->integer.value, cid->buffer); + break; + + case ACPI_TYPE_STRING: + + /* Copy the String CID from the returned object */ + + ACPI_STRNCPY (cid->buffer, obj_desc->string.pointer, sizeof(cid->buffer)); + break; + + case ACPI_TYPE_PACKAGE: + + /* TBD: Parse package elements; need different return struct, etc. */ + break; + + default: + + status = AE_TYPE; + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Type returned from _CID not a number, string, or package: %s(%X) \n", + acpi_ut_get_type_name (obj_desc->common.type), obj_desc->common.type)); + break; + } /* On exit, we must delete the return object */ @@ -226,7 +315,7 @@ acpi_status status; - PROC_NAME ("Ut_execute_UID"); + ACPI_FUNCTION_NAME ("Ut_execute_UID"); /* Execute the method */ @@ -235,14 +324,13 @@ METHOD_NAME__UID, NULL, &obj_desc); if (ACPI_FAILURE (status)) { if (status == AE_NOT_FOUND) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_UID on %4.4s was not found\n", - (char*)&device_node->name)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "_UID on %4.4s was not found\n", + device_node->name.ascii)); } - else { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_UID on %4.4s failed %s\n", - (char*)&device_node->name, acpi_format_exception (status))); + device_node->name.ascii, acpi_format_exception (status))); } return (status); @@ -266,18 +354,16 @@ "Type returned from _UID was not a number or string: %X \n", obj_desc->common.type)); } - else { if (obj_desc->common.type == ACPI_TYPE_INTEGER) { /* Convert the Numeric UID to string */ acpi_ex_unsigned_integer_to_string (obj_desc->integer.value, uid->buffer); } - else { /* Copy the String UID from the returned object */ - STRNCPY(uid->buffer, obj_desc->string.pointer, sizeof(uid->buffer)); + ACPI_STRNCPY (uid->buffer, obj_desc->string.pointer, sizeof(uid->buffer)); } } @@ -315,7 +401,7 @@ acpi_status status; - FUNCTION_TRACE ("Ut_execute_STA"); + ACPI_FUNCTION_TRACE ("Ut_execute_STA"); /* Execute the method */ @@ -323,9 +409,9 @@ status = acpi_ns_evaluate_relative (device_node, METHOD_NAME__STA, NULL, &obj_desc); if (AE_NOT_FOUND == status) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "_STA on %4.4s was not found, assuming present.\n", - (char*)&device_node->name)); + device_node->name.ascii)); *flags = 0x0F; status = AE_OK; @@ -333,7 +419,7 @@ else if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_STA on %4.4s failed %s\n", - (char*)&device_node->name, + device_node->name.ascii, acpi_format_exception (status))); } @@ -353,7 +439,6 @@ "Type returned from _STA was not a number: %X \n", obj_desc->common.type)); } - else { /* Extract the status flags */ diff -urN linux-2.4.18/drivers/acpi/utilities/utglobal.c lia64-2.4/drivers/acpi/utilities/utglobal.c --- linux-2.4.18/drivers/acpi/utilities/utglobal.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/utilities/utglobal.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: utglobal - Global variables for the ACPI subsystem - * $Revision: 133 $ + * $Revision: 161 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,14 +26,10 @@ #define DEFINE_ACPI_GLOBALS #include "acpi.h" -#include "acevents.h" #include "acnamesp.h" -#include "acinterp.h" -#include "amlcode.h" - #define _COMPONENT ACPI_UTILITIES - MODULE_NAME ("utglobal") + ACPI_MODULE_NAME ("utglobal") /****************************************************************************** @@ -56,51 +52,63 @@ acpi_status sub_status; - sub_status = (status & ~AE_CODE_MASK); + ACPI_FUNCTION_NAME ("Format_exception"); + sub_status = (status & ~AE_CODE_MASK); + switch (status & AE_CODE_MASK) { case AE_CODE_ENVIRONMENTAL: if (sub_status <= AE_CODE_ENV_MAX) { exception = acpi_gbl_exception_names_env [sub_status]; + break; } - break; + goto unknown; case AE_CODE_PROGRAMMER: if (sub_status <= AE_CODE_PGM_MAX) { exception = acpi_gbl_exception_names_pgm [sub_status -1]; + break; } - break; + goto unknown; case AE_CODE_ACPI_TABLES: if (sub_status <= AE_CODE_TBL_MAX) { exception = acpi_gbl_exception_names_tbl [sub_status -1]; + break; } - break; + goto unknown; case AE_CODE_AML: if (sub_status <= AE_CODE_AML_MAX) { exception = acpi_gbl_exception_names_aml [sub_status -1]; + break; } - break; + goto unknown; case AE_CODE_CONTROL: if (sub_status <= AE_CODE_CTRL_MAX) { exception = acpi_gbl_exception_names_ctrl [sub_status -1]; + break; } - break; + goto unknown; default: - break; + goto unknown; } return ((const char *) exception); + +unknown: + + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown exception code: 0x%8.8X\n", status)); + return ((const char *) exception); } @@ -136,10 +144,9 @@ /* System flags */ -u32 acpi_gbl_system_flags = 0; u32 acpi_gbl_startup_flags = 0; -/* System starts unitialized! */ +/* System starts uninitialized */ u8 acpi_gbl_shutdown = TRUE; @@ -168,16 +175,16 @@ * during the initialization sequence. */ -const predefined_names acpi_gbl_pre_defined_names[] = -{ {"_GPE", INTERNAL_TYPE_DEF_ANY}, - {"_PR_", INTERNAL_TYPE_DEF_ANY}, - {"_SB_", ACPI_TYPE_DEVICE}, - {"_SI_", INTERNAL_TYPE_DEF_ANY}, - {"_TZ_", INTERNAL_TYPE_DEF_ANY}, - {"_REV", ACPI_TYPE_INTEGER, "2"}, - {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, - {"_GL_", ACPI_TYPE_MUTEX, "0"}, - {NULL, ACPI_TYPE_ANY} /* Table terminator */ +const acpi_predefined_names acpi_gbl_pre_defined_names[] = +{ {"_GPE", INTERNAL_TYPE_DEF_ANY, NULL}, + {"_PR_", INTERNAL_TYPE_DEF_ANY, NULL}, + {"_SB_", ACPI_TYPE_DEVICE, NULL}, + {"_SI_", INTERNAL_TYPE_DEF_ANY, NULL}, + {"_TZ_", INTERNAL_TYPE_DEF_ANY, NULL}, + {"_REV", ACPI_TYPE_INTEGER, "2"}, + {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, + {"_GL_", ACPI_TYPE_MUTEX, "0"}, + {NULL, ACPI_TYPE_ANY, NULL} /* Table terminator */ }; @@ -188,52 +195,53 @@ * and the table is indexed by values of acpi_object_type */ -const u8 acpi_gbl_ns_properties[] = +const u8 acpi_gbl_ns_properties[] = { - NSP_NORMAL, /* 00 Any */ - NSP_NORMAL, /* 01 Number */ - NSP_NORMAL, /* 02 String */ - NSP_NORMAL, /* 03 Buffer */ - NSP_LOCAL, /* 04 Package */ - NSP_NORMAL, /* 05 Field_unit */ - NSP_NEWSCOPE | NSP_LOCAL, /* 06 Device */ - NSP_LOCAL, /* 07 Acpi_event */ - NSP_NEWSCOPE | NSP_LOCAL, /* 08 Method */ - NSP_LOCAL, /* 09 Mutex */ - NSP_LOCAL, /* 10 Region */ - NSP_NEWSCOPE | NSP_LOCAL, /* 11 Power */ - NSP_NEWSCOPE | NSP_LOCAL, /* 12 Processor */ - NSP_NEWSCOPE | NSP_LOCAL, /* 13 Thermal */ - NSP_NORMAL, /* 14 Buffer_field */ - NSP_NORMAL, /* 15 Ddb_handle */ - NSP_NORMAL, /* 16 Debug Object */ - NSP_NORMAL, /* 17 Def_field */ - NSP_NORMAL, /* 18 Bank_field */ - NSP_NORMAL, /* 19 Index_field */ - NSP_NORMAL, /* 20 Reference */ - NSP_NORMAL, /* 21 Alias */ - NSP_NORMAL, /* 22 Notify */ - NSP_NORMAL, /* 23 Address Handler */ - NSP_NEWSCOPE | NSP_LOCAL, /* 24 Resource Desc */ - NSP_NEWSCOPE | NSP_LOCAL, /* 25 Resource Field */ - NSP_NORMAL, /* 26 Def_field_defn */ - NSP_NORMAL, /* 27 Bank_field_defn */ - NSP_NORMAL, /* 28 Index_field_defn */ - NSP_NORMAL, /* 29 If */ - NSP_NORMAL, /* 30 Else */ - NSP_NORMAL, /* 31 While */ - NSP_NEWSCOPE, /* 32 Scope */ - NSP_LOCAL, /* 33 Def_any */ - NSP_NORMAL, /* 34 Extra */ - NSP_NORMAL /* 35 Invalid */ + ACPI_NS_NORMAL, /* 00 Any */ + ACPI_NS_NORMAL, /* 01 Number */ + ACPI_NS_NORMAL, /* 02 String */ + ACPI_NS_NORMAL, /* 03 Buffer */ + ACPI_NS_NORMAL, /* 04 Package */ + ACPI_NS_NORMAL, /* 05 Field_unit */ + ACPI_NS_NEWSCOPE, /* 06 Device */ + ACPI_NS_NORMAL, /* 07 Event */ + ACPI_NS_NEWSCOPE, /* 08 Method */ + ACPI_NS_NORMAL, /* 09 Mutex */ + ACPI_NS_NORMAL, /* 10 Region */ + ACPI_NS_NEWSCOPE, /* 11 Power */ + ACPI_NS_NEWSCOPE, /* 12 Processor */ + ACPI_NS_NEWSCOPE, /* 13 Thermal */ + ACPI_NS_NORMAL, /* 14 Buffer_field */ + ACPI_NS_NORMAL, /* 15 Ddb_handle */ + ACPI_NS_NORMAL, /* 16 Debug Object */ + ACPI_NS_NORMAL, /* 17 Def_field */ + ACPI_NS_NORMAL, /* 18 Bank_field */ + ACPI_NS_NORMAL, /* 19 Index_field */ + ACPI_NS_NORMAL, /* 20 Reference */ + ACPI_NS_NORMAL, /* 21 Alias */ + ACPI_NS_NORMAL, /* 22 Notify */ + ACPI_NS_NORMAL, /* 23 Address Handler */ + ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 24 Resource Desc */ + ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Field */ + ACPI_NS_NORMAL, /* 26 Def_field_defn */ + ACPI_NS_NORMAL, /* 27 Bank_field_defn */ + ACPI_NS_NORMAL, /* 28 Index_field_defn */ + ACPI_NS_NORMAL, /* 29 If */ + ACPI_NS_NORMAL, /* 30 Else */ + ACPI_NS_NORMAL, /* 31 While */ + ACPI_NS_NEWSCOPE, /* 32 Scope */ + ACPI_NS_LOCAL, /* 33 Def_any */ + ACPI_NS_NORMAL, /* 34 Extra */ + ACPI_NS_NORMAL, /* 35 Data */ + ACPI_NS_NORMAL /* 36 Invalid */ }; /* Hex to ASCII conversion table */ -const NATIVE_CHAR acpi_gbl_hex_to_ascii[] = +static const NATIVE_CHAR acpi_gbl_hex_to_ascii[] = {'0','1','2','3','4','5','6','7', - '8','9','A','B','C','D','E','F'}; + '8','9','A','B','C','D','E','F'}; /***************************************************************************** * @@ -249,7 +257,7 @@ * ****************************************************************************/ -u8 +char acpi_ut_hex_to_ascii_char ( acpi_integer integer, u32 position) @@ -261,12 +269,15 @@ /****************************************************************************** * - * Table globals + * Table name globals * * NOTE: This table includes ONLY the ACPI tables that the subsystem consumes. * it is NOT an exhaustive list of all possible ACPI tables. All ACPI tables * that are not used by the subsystem are simply ignored. * + * Do NOT add any table to this list that is not consumed directly by this + * subsystem. + * ******************************************************************************/ @@ -275,19 +286,148 @@ ACPI_TABLE_SUPPORT acpi_gbl_acpi_table_data[NUM_ACPI_TABLES] = { - /*********** Name, Signature, Signature size, How many allowed?, Supported? Global typed pointer */ + /*********** Name, Signature, Global typed pointer Signature size, How many allowed?, Contains valid AML? */ - /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, sizeof (RSDP_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, NULL}, - /* DSDT 1 */ {DSDT_SIG, DSDT_SIG, sizeof (DSDT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &acpi_gbl_DSDT}, - /* FADT 2 */ {FADT_SIG, FADT_SIG, sizeof (FADT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &acpi_gbl_FADT}, - /* FACS 3 */ {FACS_SIG, FACS_SIG, sizeof (FACS_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &acpi_gbl_FACS}, - /* PSDT 4 */ {PSDT_SIG, PSDT_SIG, sizeof (PSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK, NULL}, - /* SSDT 5 */ {SSDT_SIG, SSDT_SIG, sizeof (SSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK, NULL}, - /* XSDT 6 */ {XSDT_SIG, XSDT_SIG, sizeof (RSDT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, NULL}, + /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, NULL, sizeof (RSDP_SIG)-1, ACPI_TABLE_SINGLE}, + /* DSDT 1 */ {DSDT_SIG, DSDT_SIG, (void **) &acpi_gbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SINGLE | ACPI_TABLE_EXECUTABLE}, + /* FADT 2 */ {FADT_SIG, FADT_SIG, (void **) &acpi_gbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_SINGLE}, + /* FACS 3 */ {FACS_SIG, FACS_SIG, (void **) &acpi_gbl_FACS, sizeof (FACS_SIG)-1, ACPI_TABLE_SINGLE}, + /* PSDT 4 */ {PSDT_SIG, PSDT_SIG, NULL, sizeof (PSDT_SIG)-1, ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE}, + /* SSDT 5 */ {SSDT_SIG, SSDT_SIG, NULL, sizeof (SSDT_SIG)-1, ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE}, + /* XSDT 6 */ {XSDT_SIG, XSDT_SIG, NULL, sizeof (RSDT_SIG)-1, ACPI_TABLE_SINGLE}, }; -#ifdef ACPI_DEBUG +/****************************************************************************** + * + * Event and Hardware globals + * + ******************************************************************************/ + +ACPI_BIT_REGISTER_INFO acpi_gbl_bit_register_info[ACPI_NUM_BITREG] = +{ + /* Name Parent Register Register Bit Position Register Bit Mask */ + + /* ACPI_BITREG_TIMER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_TIMER_STATUS, ACPI_BITMASK_TIMER_STATUS}, + /* ACPI_BITREG_BUS_MASTER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_BUS_MASTER_STATUS, ACPI_BITMASK_BUS_MASTER_STATUS}, + /* ACPI_BITREG_GLOBAL_LOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_STATUS}, + /* ACPI_BITREG_POWER_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_STATUS}, + /* ACPI_BITREG_SLEEP_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_STATUS}, + /* ACPI_BITREG_RT_CLOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_STATUS}, + /* ACPI_BITREG_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_WAKE_STATUS, ACPI_BITMASK_WAKE_STATUS}, + + /* ACPI_BITREG_TIMER_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_TIMER_ENABLE, ACPI_BITMASK_TIMER_ENABLE}, + /* ACPI_BITREG_GLOBAL_LOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, + /* ACPI_BITREG_POWER_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_ENABLE}, + /* ACPI_BITREG_SLEEP_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, + /* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_ENABLE}, + /* ACPI_BITREG_WAKE_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, 0, 0}, + + /* ACPI_BITREG_SCI_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SCI_ENABLE, ACPI_BITMASK_SCI_ENABLE}, + /* ACPI_BITREG_BUS_MASTER_RLD */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_BUS_MASTER_RLD, ACPI_BITMASK_BUS_MASTER_RLD}, + /* ACPI_BITREG_GLOBAL_LOCK_RELEASE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE, ACPI_BITMASK_GLOBAL_LOCK_RELEASE}, + /* ACPI_BITREG_SLEEP_TYPE_A */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_TYPE_X, ACPI_BITMASK_SLEEP_TYPE_X}, + /* ACPI_BITREG_SLEEP_TYPE_B */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_TYPE_X, ACPI_BITMASK_SLEEP_TYPE_X}, + /* ACPI_BITREG_SLEEP_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_ENABLE, ACPI_BITMASK_SLEEP_ENABLE}, + + /* ACPI_BITREG_ARB_DIS */ {ACPI_REGISTER_PM2_CONTROL, ACPI_BITPOSITION_ARB_DISABLE, ACPI_BITMASK_ARB_DISABLE} +}; + + +acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] = +{ + /* ACPI_EVENT_PMTIMER */ {ACPI_BITREG_TIMER_STATUS, ACPI_BITREG_TIMER_ENABLE, ACPI_BITMASK_TIMER_STATUS, ACPI_BITMASK_TIMER_ENABLE}, + /* ACPI_EVENT_GLOBAL */ {ACPI_BITREG_GLOBAL_LOCK_STATUS, ACPI_BITREG_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, + /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_ENABLE}, + /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, + /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, 0, 0}, +}; + +/***************************************************************************** + * + * FUNCTION: Acpi_ut_get_region_name + * + * PARAMETERS: None. + * + * RETURN: Status + * + * DESCRIPTION: Translate a Space ID into a name string (Debug only) + * + ****************************************************************************/ + +/* Region type decoding */ + +static const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = +{ + "System_memory", + "System_iO", + "PCIConfig", + "Embedded_control", + "SMBus", + "CMOS", + "PCIBar_target", + "Data_table", +}; + + +NATIVE_CHAR * +acpi_ut_get_region_name ( + u8 space_id) +{ + + if (space_id >= ACPI_USER_REGION_BEGIN) + { + return ("User_defined_region"); + } + + else if (space_id >= ACPI_NUM_PREDEFINED_REGIONS) + { + return ("Invalid_space_iD"); + } + + return ((NATIVE_CHAR *) acpi_gbl_region_types[space_id]); +} + + +/***************************************************************************** + * + * FUNCTION: Acpi_ut_get_event_name + * + * PARAMETERS: None. + * + * RETURN: Status + * + * DESCRIPTION: Translate a Event ID into a name string (Debug only) + * + ****************************************************************************/ + +/* Event type decoding */ + +static const NATIVE_CHAR *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = +{ + "PM_Timer", + "Global_lock", + "Power_button", + "Sleep_button", + "Real_time_clock", +}; + + +NATIVE_CHAR * +acpi_ut_get_event_name ( + u32 event_id) +{ + + if (event_id > ACPI_EVENT_MAX) + { + return ("Invalid_event_iD"); + } + + return ((NATIVE_CHAR *) acpi_gbl_event_types[event_id]); +} + + +#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) /* * Strings and procedures used for debug only @@ -321,6 +461,18 @@ } +/***************************************************************************** + * + * FUNCTION: Acpi_ut_get_type_name + * + * PARAMETERS: None. + * + * RETURN: Status + * + * DESCRIPTION: Translate a Type ID into a name string (Debug only) + * + ****************************************************************************/ + /* * Elements of Acpi_gbl_Ns_type_names below must match * one-to-one with values of acpi_object_type @@ -370,25 +522,14 @@ /* 32 */ "Scope", /* 33 */ "Def_any", /* 34 */ "Extra", - /* 35 */ "Invalid" + /* 35 */ "Data", + /* 36 */ "Invalid" }; -/***************************************************************************** - * - * FUNCTION: Acpi_ut_get_type_name - * - * PARAMETERS: None. - * - * RETURN: Status - * - * DESCRIPTION: Translate a Type ID into a name string (Debug only) - * - ****************************************************************************/ - NATIVE_CHAR * acpi_ut_get_type_name ( - u32 type) + acpi_object_type type) { if (type > INTERNAL_TYPE_INVALID) @@ -400,61 +541,21 @@ } -/* Region type decoding */ - -const NATIVE_CHAR *acpi_gbl_region_types[NUM_REGION_TYPES] = -{ - "System_memory", - "System_iO", - "PCIConfig", - "Embedded_control", - "SMBus", - "CMOS", - "PCIBar_target", -}; - - -/***************************************************************************** - * - * FUNCTION: Acpi_ut_get_region_name - * - * PARAMETERS: None. - * - * RETURN: Status - * - * DESCRIPTION: Translate a Space ID into a name string (Debug only) - * - ****************************************************************************/ - -NATIVE_CHAR * -acpi_ut_get_region_name ( - u8 space_id) -{ - - if (space_id >= USER_REGION_BEGIN) - { - return ("User_defined_region"); - } - - else if (space_id >= NUM_REGION_TYPES) - { - return ("Invalid_space_iD"); - } - - return ((NATIVE_CHAR *) acpi_gbl_region_types[space_id]); -} +/* Various strings for future use */ +#if 0 +#include "amlcode.h" /* Data used in keeping track of fields */ -const NATIVE_CHAR *acpi_gbl_FEnames[NUM_FIELD_NAMES] = +static const NATIVE_CHAR *acpi_gbl_FEnames[NUM_FIELD_NAMES] = { "skip", "?access?" }; /* FE = Field Element */ -const NATIVE_CHAR *acpi_gbl_match_ops[NUM_MATCH_OPS] = +static const NATIVE_CHAR *acpi_gbl_match_ops[NUM_MATCH_OPS] = { "Error", "MTR", @@ -468,26 +569,26 @@ /* Access type decoding */ -const NATIVE_CHAR *acpi_gbl_access_types[NUM_ACCESS_TYPES] = +static const NATIVE_CHAR *acpi_gbl_access_types[NUM_ACCESS_TYPES] = { "Any_acc", "Byte_acc", "Word_acc", "DWord_acc", - "Block_acc", - "SMBSend_recv_acc", - "SMBQuick_acc" + "QWord_acc", + "Buffer_acc", }; /* Update rule decoding */ -const NATIVE_CHAR *acpi_gbl_update_rules[NUM_UPDATE_RULES] = +static const NATIVE_CHAR *acpi_gbl_update_rules[NUM_UPDATE_RULES] = { "Preserve", "Write_as_ones", "Write_as_zeros" }; +#endif /* Future use */ #endif @@ -506,7 +607,7 @@ u8 acpi_ut_valid_object_type ( - u32 type) + acpi_object_type type) { if (type > ACPI_TYPE_MAX) @@ -539,40 +640,44 @@ acpi_owner_id owner_id = 0xFFFF; - FUNCTION_TRACE ("Ut_allocate_owner_id"); + ACPI_FUNCTION_TRACE ("Ut_allocate_owner_id"); - acpi_ut_acquire_mutex (ACPI_MTX_CACHES); + if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_CACHES))) + { + return (0); + } switch (id_type) { - case OWNER_TYPE_TABLE: + case ACPI_OWNER_TYPE_TABLE: owner_id = acpi_gbl_next_table_owner_id; acpi_gbl_next_table_owner_id++; - if (acpi_gbl_next_table_owner_id == FIRST_METHOD_ID) + if (acpi_gbl_next_table_owner_id == ACPI_FIRST_METHOD_ID) { - acpi_gbl_next_table_owner_id = FIRST_TABLE_ID; + acpi_gbl_next_table_owner_id = ACPI_FIRST_TABLE_ID; } break; - case OWNER_TYPE_METHOD: + case ACPI_OWNER_TYPE_METHOD: owner_id = acpi_gbl_next_method_owner_id; acpi_gbl_next_method_owner_id++; - if (acpi_gbl_next_method_owner_id == FIRST_TABLE_ID) + if (acpi_gbl_next_method_owner_id == ACPI_FIRST_TABLE_ID) { - acpi_gbl_next_method_owner_id = FIRST_METHOD_ID; + acpi_gbl_next_method_owner_id = ACPI_FIRST_METHOD_ID; } break; - } - - acpi_ut_release_mutex (ACPI_MTX_CACHES); + default: + break; + } + (void) acpi_ut_release_mutex (ACPI_MTX_CACHES); return_VALUE (owner_id); } @@ -595,22 +700,22 @@ u32 i; - FUNCTION_TRACE ("Ut_init_globals"); + ACPI_FUNCTION_TRACE ("Ut_init_globals"); /* Memory allocation and cache lists */ - MEMSET (acpi_gbl_memory_lists, 0, sizeof (ACPI_MEMORY_LIST) * ACPI_NUM_MEM_LISTS); + ACPI_MEMSET (acpi_gbl_memory_lists, 0, sizeof (ACPI_MEMORY_LIST) * ACPI_NUM_MEM_LISTS); - acpi_gbl_memory_lists[ACPI_MEM_LIST_STATE].link_offset = (u16) (NATIVE_UINT) &(((acpi_generic_state *) NULL)->common.next); - acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE].link_offset = (u16) (NATIVE_UINT) &(((acpi_parse_object *) NULL)->next); - acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE_EXT].link_offset = (u16) (NATIVE_UINT) &(((acpi_parse2_object *) NULL)->next); - acpi_gbl_memory_lists[ACPI_MEM_LIST_OPERAND].link_offset = (u16) (NATIVE_UINT) &(((acpi_operand_object *) NULL)->cache.next); - acpi_gbl_memory_lists[ACPI_MEM_LIST_WALK].link_offset = (u16) (NATIVE_UINT) &(((acpi_walk_state *) NULL)->next); + acpi_gbl_memory_lists[ACPI_MEM_LIST_STATE].link_offset = (u16) ACPI_PTR_DIFF (&(((acpi_generic_state *) NULL)->common.next), NULL); + acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE].link_offset = (u16) ACPI_PTR_DIFF (&(((acpi_parse_object *) NULL)->common.next), NULL); + acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE_EXT].link_offset = (u16) ACPI_PTR_DIFF (&(((acpi_parse_object *) NULL)->common.next), NULL); + acpi_gbl_memory_lists[ACPI_MEM_LIST_OPERAND].link_offset = (u16) ACPI_PTR_DIFF (&(((acpi_operand_object *) NULL)->cache.next), NULL); + acpi_gbl_memory_lists[ACPI_MEM_LIST_WALK].link_offset = (u16) ACPI_PTR_DIFF (&(((acpi_walk_state *) NULL)->next), NULL); acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE].object_size = sizeof (acpi_namespace_node); acpi_gbl_memory_lists[ACPI_MEM_LIST_STATE].object_size = sizeof (acpi_generic_state); - acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE].object_size = sizeof (acpi_parse_object); - acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE_EXT].object_size = sizeof (acpi_parse2_object); + acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE].object_size = sizeof (ACPI_PARSE_OBJ_COMMON); + acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE_EXT].object_size = sizeof (ACPI_PARSE_OBJ_NAMED); acpi_gbl_memory_lists[ACPI_MEM_LIST_OPERAND].object_size = sizeof (acpi_operand_object); acpi_gbl_memory_lists[ACPI_MEM_LIST_WALK].object_size = sizeof (acpi_walk_state); @@ -640,15 +745,6 @@ acpi_gbl_acpi_tables[i].count = 0; } - - /* Address Space handler array */ - - for (i = 0; i < ACPI_NUM_ADDRESS_SPACES; i++) - { - acpi_gbl_address_spaces[i].handler = NULL; - acpi_gbl_address_spaces[i].context = NULL; - } - /* Mutex locked flags */ for (i = 0; i < NUM_MTX; i++) @@ -662,6 +758,7 @@ acpi_gbl_sys_notify.handler = NULL; acpi_gbl_drv_notify.handler = NULL; + acpi_gbl_init_handler = NULL; /* Global "typed" ACPI table pointers */ @@ -675,11 +772,11 @@ acpi_gbl_global_lock_acquired = FALSE; acpi_gbl_global_lock_thread_count = 0; + acpi_gbl_global_lock_handle = 0; /* Miscellaneous variables */ - acpi_gbl_system_flags = 0; - acpi_gbl_startup_flags = 0; + acpi_gbl_table_flags = ACPI_PHYSICAL_POINTER; acpi_gbl_rsdp_original_location = 0; acpi_gbl_cm_single_step = FALSE; acpi_gbl_db_terminate_threads = FALSE; @@ -687,24 +784,22 @@ acpi_gbl_ns_lookup_count = 0; acpi_gbl_ps_find_count = 0; acpi_gbl_acpi_hardware_present = TRUE; - acpi_gbl_next_table_owner_id = FIRST_TABLE_ID; - acpi_gbl_next_method_owner_id = FIRST_METHOD_ID; + acpi_gbl_next_table_owner_id = ACPI_FIRST_TABLE_ID; + acpi_gbl_next_method_owner_id = ACPI_FIRST_METHOD_ID; acpi_gbl_debugger_configuration = DEBUGGER_THREADING; + acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT; /* Hardware oriented */ - acpi_gbl_gpe0enable_register_save = NULL; - acpi_gbl_gpe1_enable_register_save = NULL; - acpi_gbl_original_mode = SYS_MODE_UNKNOWN; /* original ACPI/legacy mode */ - acpi_gbl_gpe_registers = NULL; - acpi_gbl_gpe_info = NULL; + acpi_gbl_gpe_register_info = NULL; + acpi_gbl_gpe_number_info = NULL; /* Namespace */ acpi_gbl_root_node = NULL; - acpi_gbl_root_node_struct.name = ACPI_ROOT_NAME; - acpi_gbl_root_node_struct.data_type = ACPI_DESC_TYPE_NAMED; + acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME; + acpi_gbl_root_node_struct.descriptor = ACPI_DESC_TYPE_NAMED; acpi_gbl_root_node_struct.type = ACPI_TYPE_ANY; acpi_gbl_root_node_struct.child = NULL; acpi_gbl_root_node_struct.peer = NULL; @@ -713,7 +808,7 @@ #ifdef ACPI_DEBUG - acpi_gbl_lowest_stack_pointer = ACPI_UINT32_MAX; + acpi_gbl_lowest_stack_pointer = ACPI_SIZE_MAX; #endif return_VOID; diff -urN linux-2.4.18/drivers/acpi/utilities/utinit.c lia64-2.4/drivers/acpi/utilities/utinit.c --- linux-2.4.18/drivers/acpi/utilities/utinit.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/utilities/utinit.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: utinit - Common ACPI subsystem initialization - * $Revision: 102 $ + * $Revision: 112 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,18 +25,11 @@ #include "acpi.h" -#include "achware.h" #include "acnamesp.h" #include "acevents.h" -#include "acparser.h" -#include "acdispat.h" #define _COMPONENT ACPI_UTILITIES - MODULE_NAME ("utinit") - - -#define ACPI_OFFSET(d,o) ((u32) &(((d *)0)->o)) -#define ACPI_FADT_OFFSET(o) ACPI_OFFSET (FADT_DESCRIPTOR, o) + ACPI_MODULE_NAME ("utinit") /******************************************************************************* @@ -54,19 +47,16 @@ * ******************************************************************************/ -static acpi_status +static void acpi_ut_fadt_register_error ( NATIVE_CHAR *register_name, u32 value, - u32 offset) + ACPI_SIZE offset) { - REPORT_ERROR ( - ("Invalid FADT value %s=%lX at offset %lX FADT=%p\n", + ACPI_REPORT_WARNING ( + ("Invalid FADT value %s=%X at offset %X FADT=%p\n", register_name, value, offset, acpi_gbl_FADT)); - - - return (AE_BAD_VALUE); } @@ -86,69 +76,67 @@ acpi_ut_validate_fadt ( void) { - acpi_status status = AE_OK; - /* * Verify Fixed ACPI Description Table fields, * but don't abort on any problems, just display error */ if (acpi_gbl_FADT->pm1_evt_len < 4) { - status = acpi_ut_fadt_register_error ("PM1_EVT_LEN", + acpi_ut_fadt_register_error ("PM1_EVT_LEN", (u32) acpi_gbl_FADT->pm1_evt_len, ACPI_FADT_OFFSET (pm1_evt_len)); } if (!acpi_gbl_FADT->pm1_cnt_len) { - status = acpi_ut_fadt_register_error ("PM1_CNT_LEN", 0, + acpi_ut_fadt_register_error ("PM1_CNT_LEN", 0, ACPI_FADT_OFFSET (pm1_cnt_len)); } if (!ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xpm1a_evt_blk.address)) { - status = acpi_ut_fadt_register_error ("X_PM1a_EVT_BLK", 0, + acpi_ut_fadt_register_error ("X_PM1a_EVT_BLK", 0, ACPI_FADT_OFFSET (Xpm1a_evt_blk.address)); } if (!ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xpm1a_cnt_blk.address)) { - status = acpi_ut_fadt_register_error ("X_PM1a_CNT_BLK", 0, + acpi_ut_fadt_register_error ("X_PM1a_CNT_BLK", 0, ACPI_FADT_OFFSET (Xpm1a_cnt_blk.address)); } if (!ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xpm_tmr_blk.address)) { - status = acpi_ut_fadt_register_error ("X_PM_TMR_BLK", 0, + acpi_ut_fadt_register_error ("X_PM_TMR_BLK", 0, ACPI_FADT_OFFSET (Xpm_tmr_blk.address)); } if ((ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xpm2_cnt_blk.address) && !acpi_gbl_FADT->pm2_cnt_len)) { - status = acpi_ut_fadt_register_error ("PM2_CNT_LEN", + acpi_ut_fadt_register_error ("PM2_CNT_LEN", (u32) acpi_gbl_FADT->pm2_cnt_len, ACPI_FADT_OFFSET (pm2_cnt_len)); } if (acpi_gbl_FADT->pm_tm_len < 4) { - status = acpi_ut_fadt_register_error ("PM_TM_LEN", + acpi_ut_fadt_register_error ("PM_TM_LEN", (u32) acpi_gbl_FADT->pm_tm_len, ACPI_FADT_OFFSET (pm_tm_len)); } - /* length of GPE blocks must be a multiple of 2 */ + /* Length of GPE blocks must be a multiple of 2 */ - if (ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xgpe0blk.address) && - (acpi_gbl_FADT->gpe0blk_len & 1)) { - status = acpi_ut_fadt_register_error ("(x)GPE0_BLK_LEN", - (u32) acpi_gbl_FADT->gpe0blk_len, - ACPI_FADT_OFFSET (gpe0blk_len)); + if (ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xgpe0_blk.address) && + (acpi_gbl_FADT->gpe0_blk_len & 1)) { + acpi_ut_fadt_register_error ("(x)GPE0_BLK_LEN", + (u32) acpi_gbl_FADT->gpe0_blk_len, + ACPI_FADT_OFFSET (gpe0_blk_len)); } if (ACPI_VALID_ADDRESS (acpi_gbl_FADT->Xgpe1_blk.address) && (acpi_gbl_FADT->gpe1_blk_len & 1)) { - status = acpi_ut_fadt_register_error ("(x)GPE1_BLK_LEN", + acpi_ut_fadt_register_error ("(x)GPE1_BLK_LEN", (u32) acpi_gbl_FADT->gpe1_blk_len, ACPI_FADT_OFFSET (gpe1_blk_len)); } - return (status); + return (AE_OK); } @@ -168,19 +156,12 @@ acpi_ut_terminate (void) { - FUNCTION_TRACE ("Ut_terminate"); + ACPI_FUNCTION_TRACE ("Ut_terminate"); /* Free global tables, etc. */ - if (acpi_gbl_gpe0enable_register_save) { - ACPI_MEM_FREE (acpi_gbl_gpe0enable_register_save); - } - - if (acpi_gbl_gpe1_enable_register_save) { - ACPI_MEM_FREE (acpi_gbl_gpe1_enable_register_save); - } - + /* Nothing to do at this time */ return_VOID; } @@ -199,17 +180,17 @@ * ******************************************************************************/ -acpi_status +void acpi_ut_subsystem_shutdown (void) { - FUNCTION_TRACE ("Ut_subsystem_shutdown"); + ACPI_FUNCTION_TRACE ("Ut_subsystem_shutdown"); /* Just exit if subsystem is already shutdown */ if (acpi_gbl_shutdown) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "ACPI Subsystem is already terminated\n")); - return_ACPI_STATUS (AE_OK); + return_VOID; } /* Subsystem appears active, go ahead and shut it down */ @@ -217,7 +198,6 @@ acpi_gbl_shutdown = TRUE; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem...\n")); - /* Close the Namespace */ acpi_ns_terminate (); @@ -230,17 +210,9 @@ acpi_ut_terminate (); - /* Flush the local cache(s) */ + /* Purge the local caches */ - acpi_ut_delete_generic_state_cache (); - acpi_ut_delete_object_cache (); - acpi_ds_delete_walk_state_cache (); - - /* Close the Parser */ - - /* TBD: [Restructure] Acpi_ps_terminate () */ - - acpi_ps_delete_parse_cache (); + (void) acpi_purge_cached_objects (); /* Debug only - display leftover memory allocation, if any */ @@ -248,7 +220,7 @@ acpi_ut_dump_allocations (ACPI_UINT32_MAX, NULL); #endif - return_ACPI_STATUS (AE_OK); + return_VOID; } diff -urN linux-2.4.18/drivers/acpi/utilities/utmath.c lia64-2.4/drivers/acpi/utilities/utmath.c --- linux-2.4.18/drivers/acpi/utilities/utmath.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/utilities/utmath.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: utmath - Integer math support routines - * $Revision: 7 $ + * $Revision: 11 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #define _COMPONENT ACPI_UTILITIES - MODULE_NAME ("utmath") + ACPI_MODULE_NAME ("utmath") /* * Support for double-precision integer divide. This code is included here @@ -66,14 +66,14 @@ u32 remainder32; - FUNCTION_TRACE ("Ut_short_divide"); + ACPI_FUNCTION_TRACE ("Ut_short_divide"); dividend.full = *in_dividend; /* Always check for a zero divisor */ if (divisor == 0) { - REPORT_ERROR (("Acpi_ut_short_divide: Divide by zero\n")); + ACPI_REPORT_ERROR (("Acpi_ut_short_divide: Divide by zero\n")); return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); } @@ -132,13 +132,13 @@ uint64_overlay partial3; - FUNCTION_TRACE ("Ut_divide"); + ACPI_FUNCTION_TRACE ("Ut_divide"); /* Always check for a zero divisor */ if (*in_divisor == 0) { - REPORT_ERROR (("Acpi_ut_divide: Divide by zero\n")); + ACPI_REPORT_ERROR (("Acpi_ut_divide: Divide by zero\n")); return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); } @@ -193,7 +193,7 @@ */ partial1 = quotient.part.lo * divisor.part.hi; partial2.full = (acpi_integer) quotient.part.lo * divisor.part.lo; - partial3.full = partial2.part.hi + partial1; + partial3.full = (acpi_integer) partial2.part.hi + partial1; remainder.part.hi = partial3.part.lo; remainder.part.lo = partial2.part.lo; @@ -213,8 +213,8 @@ } remainder.full = remainder.full - dividend.full; - remainder.part.hi = -((s32) remainder.part.hi); - remainder.part.lo = -((s32) remainder.part.lo); + remainder.part.hi = (u32) -((s32) remainder.part.hi); + remainder.part.lo = (u32) -((s32) remainder.part.lo); if (remainder.part.lo) { remainder.part.hi--; @@ -257,13 +257,13 @@ u32 *out_remainder) { - FUNCTION_TRACE ("Ut_short_divide"); + ACPI_FUNCTION_TRACE ("Ut_short_divide"); /* Always check for a zero divisor */ if (divisor == 0) { - REPORT_ERROR (("Acpi_ut_short_divide: Divide by zero\n")); + ACPI_REPORT_ERROR (("Acpi_ut_short_divide: Divide by zero\n")); return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); } @@ -286,13 +286,13 @@ acpi_integer *out_quotient, acpi_integer *out_remainder) { - FUNCTION_TRACE ("Ut_divide"); + ACPI_FUNCTION_TRACE ("Ut_divide"); /* Always check for a zero divisor */ if (*in_divisor == 0) { - REPORT_ERROR (("Acpi_ut_divide: Divide by zero\n")); + ACPI_REPORT_ERROR (("Acpi_ut_divide: Divide by zero\n")); return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); } diff -urN linux-2.4.18/drivers/acpi/utilities/utmisc.c lia64-2.4/drivers/acpi/utilities/utmisc.c --- linux-2.4.18/drivers/acpi/utilities/utmisc.c Mon Nov 5 18:28:44 2001 +++ lia64-2.4/drivers/acpi/utilities/utmisc.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /******************************************************************************* * * Module Name: utmisc - common utility procedures - * $Revision: 52 $ + * $Revision: 75 $ * ******************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,16 +25,125 @@ #include "acpi.h" -#include "acevents.h" -#include "achware.h" #include "acnamesp.h" -#include "acinterp.h" #include "amlcode.h" -#include "acdebug.h" #define _COMPONENT ACPI_UTILITIES - MODULE_NAME ("utmisc") + ACPI_MODULE_NAME ("utmisc") + + +/******************************************************************************* + * + * FUNCTION: Acpi_ut_dword_byte_swap + * + * PARAMETERS: Value - Value to be converted + * + * DESCRIPTION: Convert a 32-bit value to big-endian (swap the bytes) + * + ******************************************************************************/ + +u32 +acpi_ut_dword_byte_swap ( + u32 value) +{ + union { + u32 value; + u8 bytes[4]; + } out; + + union { + u32 value; + u8 bytes[4]; + } in; + + + ACPI_FUNCTION_ENTRY (); + + + in.value = value; + + out.bytes[0] = in.bytes[3]; + out.bytes[1] = in.bytes[2]; + out.bytes[2] = in.bytes[1]; + out.bytes[3] = in.bytes[0]; + + return (out.value); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ut_set_integer_width + * + * PARAMETERS: Revision From DSDT header + * + * RETURN: None + * + * DESCRIPTION: Set the global integer bit width based upon the revision + * of the DSDT. For Revision 1 and 0, Integers are 32 bits. + * For Revision 2 and above, Integers are 64 bits. Yes, this + * makes a difference. + * + ******************************************************************************/ + +void +acpi_ut_set_integer_width ( + u8 revision) +{ + + if (revision <= 1) { + acpi_gbl_integer_bit_width = 32; + acpi_gbl_integer_byte_width = 4; + } + else { + acpi_gbl_integer_bit_width = 64; + acpi_gbl_integer_byte_width = 8; + } +} + + +#ifdef ACPI_DEBUG +/******************************************************************************* + * + * FUNCTION: Acpi_ut_display_init_pathname + * + * PARAMETERS: Obj_handle - Handle whose pathname will be displayed + * Path - Additional path string to be appended + * + * RETURN: acpi_status + * + * DESCRIPTION: Display full pathnbame of an object, DEBUG ONLY + * + ******************************************************************************/ + +void +acpi_ut_display_init_pathname ( + acpi_handle obj_handle, + char *path) +{ + acpi_status status; + acpi_buffer buffer; + + + ACPI_FUNCTION_NAME ("Ut_display_init_pathname"); + + + buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; + + status = acpi_ns_handle_to_pathname (obj_handle, &buffer); + if (ACPI_SUCCESS (status)) { + if (path) { + ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "%s.%s\n", (char *) buffer.pointer, path)); + } + else { + ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "%s\n", (char *) buffer.pointer)); + } + + ACPI_MEM_FREE (buffer.pointer); + } +} +#endif /******************************************************************************* @@ -60,7 +169,7 @@ u32 i; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); for (i = 0; i < ACPI_NAME_SIZE; i++) { @@ -92,7 +201,7 @@ NATIVE_CHAR character) { - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); return ((u8) ((character == '_') || (character >= 'A' && character <= 'Z') || @@ -102,6 +211,152 @@ /******************************************************************************* * + * FUNCTION: Acpi_ut_strtoul64 + * + * PARAMETERS: String - Null terminated string + * Terminater - Where a pointer to the terminating byte is returned + * Base - Radix of the string + * + * RETURN: Converted value + * + * DESCRIPTION: Convert a string into an unsigned value. + * + ******************************************************************************/ +#define NEGATIVE 1 +#define POSITIVE 0 + +acpi_status +acpi_ut_strtoul64 ( + NATIVE_CHAR *string, + u32 base, + acpi_integer *ret_integer) +{ + u32 index; + acpi_integer return_value = 0; + acpi_status status = AE_OK; + acpi_integer dividend; + acpi_integer quotient; + + + *ret_integer = 0; + + switch (base) { + case 0: + case 8: + case 10: + case 16: + break; + + default: + /* + * The specified Base parameter is not in the domain of + * this function: + */ + return (AE_BAD_PARAMETER); + } + + /* + * skip over any white space in the buffer: + */ + while (ACPI_IS_SPACE (*string) || *string == '\t') { + ++string; + } + + /* + * If the input parameter Base is zero, then we need to + * determine if it is octal, decimal, or hexadecimal: + */ + if (base == 0) { + if (*string == '0') { + if (ACPI_TOLOWER (*(++string)) == 'x') { + base = 16; + ++string; + } + else { + base = 8; + } + } + else { + base = 10; + } + } + + /* + * For octal and hexadecimal bases, skip over the leading + * 0 or 0x, if they are present. + */ + if (base == 8 && *string == '0') { + string++; + } + + if (base == 16 && + *string == '0' && + ACPI_TOLOWER (*(++string)) == 'x') { + string++; + } + + /* Main loop: convert the string to an unsigned long */ + + while (*string) { + if (ACPI_IS_DIGIT (*string)) { + index = ((u8) *string) - '0'; + } + else { + index = (u8) ACPI_TOUPPER (*string); + if (ACPI_IS_UPPER ((char) index)) { + index = index - 'A' + 10; + } + else { + goto error_exit; + } + } + + if (index >= base) { + goto error_exit; + } + + /* Check to see if value is out of range: */ + + dividend = ACPI_INTEGER_MAX - (acpi_integer) index; + (void) acpi_ut_short_divide (÷nd, base, "ient, NULL); + if (return_value > quotient) { + goto error_exit; + } + + return_value *= base; + return_value += index; + ++string; + } + + *ret_integer = return_value; + return (status); + + +error_exit: + switch (base) { + case 8: + status = AE_BAD_OCTAL_CONSTANT; + break; + + case 10: + status = AE_BAD_DECIMAL_CONSTANT; + break; + + case 16: + status = AE_BAD_HEX_CONSTANT; + break; + + default: + /* Base validated above */ + break; + } + + return (status); +} + + +/******************************************************************************* + * * FUNCTION: Acpi_ut_strupr * * PARAMETERS: Src_string - The source string to convert to @@ -119,13 +374,13 @@ NATIVE_CHAR *string; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* Walk entire string, uppercasing the letters */ for (string = src_string; *string; ) { - *string = (char) TOUPPER (*string); + *string = (char) ACPI_TOUPPER (*string); string++; } @@ -153,7 +408,7 @@ acpi_status status; - FUNCTION_TRACE ("Ut_mutex_initialize"); + ACPI_FUNCTION_TRACE ("Ut_mutex_initialize"); /* @@ -189,14 +444,14 @@ u32 i; - FUNCTION_TRACE ("Ut_mutex_terminate"); + ACPI_FUNCTION_TRACE ("Ut_mutex_terminate"); /* * Delete each predefined mutex object */ for (i = 0; i < NUM_MTX; i++) { - acpi_ut_delete_mutex (i); + (void) acpi_ut_delete_mutex (i); } return_VOID; @@ -222,7 +477,7 @@ acpi_status status = AE_OK; - FUNCTION_TRACE_U32 ("Ut_create_mutex", mutex_id); + ACPI_FUNCTION_TRACE_U32 ("Ut_create_mutex", mutex_id); if (mutex_id > MAX_MTX) { @@ -260,7 +515,7 @@ acpi_status status; - FUNCTION_TRACE_U32 ("Ut_delete_mutex", mutex_id); + ACPI_FUNCTION_TRACE_U32 ("Ut_delete_mutex", mutex_id); if (mutex_id > MAX_MTX) { @@ -298,7 +553,7 @@ u32 this_thread_id; - PROC_NAME ("Ut_acquire_mutex"); + ACPI_FUNCTION_NAME ("Ut_acquire_mutex"); if (mutex_id > MAX_MTX) { @@ -340,7 +595,6 @@ status = acpi_os_wait_semaphore (acpi_gbl_acpi_mutex_info[mutex_id].mutex, 1, WAIT_FOREVER); - if (ACPI_SUCCESS (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %X acquired Mutex [%s]\n", this_thread_id, acpi_ut_get_mutex_name (mutex_id))); @@ -380,7 +634,7 @@ u32 this_thread_id; - PROC_NAME ("Ut_release_mutex"); + ACPI_FUNCTION_NAME ("Ut_release_mutex"); this_thread_id = acpi_os_get_thread_id (); @@ -469,7 +723,7 @@ acpi_generic_state *state; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); /* Ignore null objects; these are expected */ @@ -513,7 +767,7 @@ acpi_generic_state *state; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); state = acpi_ut_create_pkg_state (internal_object, external_object, index); @@ -545,7 +799,7 @@ acpi_generic_state **list_head, acpi_generic_state *state) { - FUNCTION_TRACE ("Ut_push_generic_state"); + ACPI_FUNCTION_TRACE ("Ut_push_generic_state"); /* Push the state object onto the front of the list (stack) */ @@ -576,7 +830,7 @@ acpi_generic_state *state; - FUNCTION_TRACE ("Ut_pop_generic_state"); + ACPI_FUNCTION_TRACE ("Ut_pop_generic_state"); /* Remove the state object at the head of the list (stack) */ @@ -611,7 +865,7 @@ acpi_generic_state *state; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); state = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_STATE); @@ -628,6 +882,45 @@ /******************************************************************************* * + * FUNCTION: Acpi_ut_create_thread_state + * + * PARAMETERS: None + * + * RETURN: Thread State + * + * DESCRIPTION: Create a "Thread State" - a flavor of the generic state used + * to track per-thread info during method execution + * + ******************************************************************************/ + +ACPI_THREAD_STATE * +acpi_ut_create_thread_state ( + void) +{ + acpi_generic_state *state; + + + ACPI_FUNCTION_TRACE ("Ut_create_thread_state"); + + + /* Create the generic state object */ + + state = acpi_ut_create_generic_state (); + if (!state) { + return_PTR (NULL); + } + + /* Init fields specific to the update struct */ + + state->common.data_type = ACPI_DESC_TYPE_STATE_THREAD; + state->thread.thread_id = acpi_os_get_thread_id (); + + return_PTR ((ACPI_THREAD_STATE *) state); +} + + +/******************************************************************************* + * * FUNCTION: Acpi_ut_create_update_state * * PARAMETERS: Object - Initial Object to be installed in the @@ -650,14 +943,14 @@ acpi_generic_state *state; - FUNCTION_TRACE_PTR ("Ut_create_update_state", object); + ACPI_FUNCTION_TRACE_PTR ("Ut_create_update_state", object); /* Create the generic state object */ state = acpi_ut_create_generic_state (); if (!state) { - return (NULL); + return_PTR (NULL); } /* Init fields specific to the update struct */ @@ -693,14 +986,14 @@ acpi_generic_state *state; - FUNCTION_TRACE_PTR ("Ut_create_pkg_state", internal_object); + ACPI_FUNCTION_TRACE_PTR ("Ut_create_pkg_state", internal_object); /* Create the generic state object */ state = acpi_ut_create_generic_state (); if (!state) { - return (NULL); + return_PTR (NULL); } /* Init fields specific to the update struct */ @@ -735,21 +1028,21 @@ acpi_generic_state *state; - FUNCTION_TRACE ("Ut_create_control_state"); + ACPI_FUNCTION_TRACE ("Ut_create_control_state"); /* Create the generic state object */ state = acpi_ut_create_generic_state (); if (!state) { - return (NULL); + return_PTR (NULL); } /* Init fields specific to the control struct */ state->common.data_type = ACPI_DESC_TYPE_STATE_CONTROL; - state->common.state = CONTROL_CONDITIONAL_EXECUTING; + state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING; return_PTR (state); } @@ -772,7 +1065,7 @@ acpi_ut_delete_generic_state ( acpi_generic_state *state) { - FUNCTION_TRACE ("Ut_delete_generic_state"); + ACPI_FUNCTION_TRACE ("Ut_delete_generic_state"); acpi_ut_release_to_cache (ACPI_MEM_LIST_STATE, state); @@ -797,7 +1090,7 @@ acpi_ut_delete_generic_state_cache ( void) { - FUNCTION_TRACE ("Ut_delete_generic_state_cache"); + ACPI_FUNCTION_TRACE ("Ut_delete_generic_state_cache"); acpi_ut_delete_generic_cache (ACPI_MEM_LIST_STATE); @@ -807,100 +1100,116 @@ /******************************************************************************* * - * FUNCTION: Acpi_ut_resolve_package_references + * FUNCTION: Acpi_ut_resolve_reference * - * PARAMETERS: Obj_desc - The Package object on which to resolve refs + * PARAMETERS: ACPI_PKG_CALLBACK * - * RETURN: Status + * RETURN: Status - the status of the call * - * DESCRIPTION: Walk through a package and turn internal references into values + * DESCRIPTION: Resolve a reference object to an actual value * ******************************************************************************/ acpi_status -acpi_ut_resolve_package_references ( - acpi_operand_object *obj_desc) +acpi_ut_resolve_reference ( + u8 object_type, + acpi_operand_object *source_object, + acpi_generic_state *state, + void *context) { - u32 count; - acpi_operand_object *sub_object; - + acpi_pkg_info *info = (acpi_pkg_info *) context; - FUNCTION_TRACE ("Ut_resolve_package_references"); + switch (object_type) { + case ACPI_COPY_TYPE_SIMPLE: - if (obj_desc->common.type != ACPI_TYPE_PACKAGE) { - /* The object must be a package */ + /* + * Simple object - check for a reference + */ + if (source_object->common.type == INTERNAL_TYPE_REFERENCE) { + switch (source_object->reference.opcode) { + case AML_ZERO_OP: - REPORT_ERROR (("Must resolve Package Refs on a Package\n")); - return_ACPI_STATUS(AE_ERROR); - } + source_object->common.type = ACPI_TYPE_INTEGER; + source_object->integer.value = 0; + break; - /* - * TBD: what about nested packages? */ + case AML_ONE_OP: - for (count = 0; count < obj_desc->package.count; count++) { - sub_object = obj_desc->package.elements[count]; + source_object->common.type = ACPI_TYPE_INTEGER; + source_object->integer.value = 1; + break; - if (sub_object->common.type == INTERNAL_TYPE_REFERENCE) { - if (sub_object->reference.opcode == AML_ZERO_OP) { - sub_object->common.type = ACPI_TYPE_INTEGER; - sub_object->integer.value = 0; - } + case AML_ONES_OP: - else if (sub_object->reference.opcode == AML_ONE_OP) { - sub_object->common.type = ACPI_TYPE_INTEGER; - sub_object->integer.value = 1; - } + source_object->common.type = ACPI_TYPE_INTEGER; + source_object->integer.value = ACPI_INTEGER_MAX; + break; - else if (sub_object->reference.opcode == AML_ONES_OP) { - sub_object->common.type = ACPI_TYPE_INTEGER; - sub_object->integer.value = ACPI_INTEGER_MAX; + default: + /* Other types not supported */ + return (AE_SUPPORT); } } + break; + + + case ACPI_COPY_TYPE_PACKAGE: + + /* Package object - nothing much to do here, let the walk handle it */ + + info->num_packages++; + state->pkg.this_target_obj = NULL; + break; + + default: + return (AE_BAD_PARAMETER); } - return_ACPI_STATUS(AE_OK); + return (AE_OK); } -#ifdef ACPI_DEBUG /******************************************************************************* * - * FUNCTION: Acpi_ut_display_init_pathname + * FUNCTION: Acpi_ut_resolve_package_references * - * PARAMETERS: Obj_handle - Handle whose pathname will be displayed - * Path - Additional path string to be appended + * PARAMETERS: Obj_desc - The Package object on which to resolve refs * - * RETURN: acpi_status + * RETURN: Status * - * DESCRIPTION: Display full pathnbame of an object, DEBUG ONLY + * DESCRIPTION: Walk through a package and turn internal references into values * ******************************************************************************/ -void -acpi_ut_display_init_pathname ( - acpi_handle obj_handle, - char *path) +acpi_status +acpi_ut_resolve_package_references ( + acpi_operand_object *obj_desc) { + acpi_pkg_info info; acpi_status status; - u32 length = 128; - char buffer[128]; - PROC_NAME ("Ut_display_init_pathname"); + ACPI_FUNCTION_TRACE ("Ut_resolve_package_references"); - status = acpi_ns_handle_to_pathname (obj_handle, &length, buffer); - if (ACPI_SUCCESS (status)) { - if (path) { - ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "%s.%s\n", buffer, path)); - } - else { - ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "%s\n", buffer)); - } + if (obj_desc->common.type != ACPI_TYPE_PACKAGE) { + /* The object must be a package */ + + ACPI_REPORT_ERROR (("Expecting a Package object\n")); + return_ACPI_STATUS (AE_TYPE); } + + info.length = 0; + info.object_space = 0; + info.num_packages = 1; + + status = acpi_ut_walk_package_tree (obj_desc, NULL, + acpi_ut_resolve_reference, &info); + + return_ACPI_STATUS (status); } -#endif + /******************************************************************************* * @@ -928,7 +1237,7 @@ acpi_operand_object *this_source_obj; - FUNCTION_TRACE ("Ut_walk_package_tree"); + ACPI_FUNCTION_TRACE ("Ut_walk_package_tree"); state = acpi_ut_create_pkg_state (source_object, target_object, 0); @@ -942,24 +1251,19 @@ state->pkg.source_object->package.elements[this_index]; /* - * Check for + * Check for: * 1) An uninitialized package element. It is completely - * legal to declare a package and leave it uninitialized + * legal to declare a package and leave it uninitialized * 2) Not an internal object - can be a namespace node instead * 3) Any type other than a package. Packages are handled in else - * case below. + * case below. */ if ((!this_source_obj) || - (!VALID_DESCRIPTOR_TYPE ( - this_source_obj, ACPI_DESC_TYPE_INTERNAL)) || - (!IS_THIS_OBJECT_TYPE ( - this_source_obj, ACPI_TYPE_PACKAGE))) { - + (ACPI_GET_DESCRIPTOR_TYPE (this_source_obj) != ACPI_DESC_TYPE_OPERAND) || + (this_source_obj->common.type != ACPI_TYPE_PACKAGE)) { status = walk_callback (ACPI_COPY_TYPE_SIMPLE, this_source_obj, state, context); if (ACPI_FAILURE (status)) { - /* TBD: must delete package created up to this point */ - return_ACPI_STATUS (status); } @@ -975,7 +1279,6 @@ acpi_ut_delete_generic_state (state); state = acpi_ut_pop_generic_state (&state_list); - /* Finished when there are no more states */ if (!state) { @@ -994,32 +1297,23 @@ state->pkg.index++; } } - else { - /* This is a sub-object of type package */ + /* This is a subobject of type package */ status = walk_callback (ACPI_COPY_TYPE_PACKAGE, this_source_obj, state, context); if (ACPI_FAILURE (status)) { - /* TBD: must delete package created up to this point */ - return_ACPI_STATUS (status); } - - /* - * The callback above returned a new target package object. - */ - /* * Push the current state and create a new one + * The callback above returned a new target package object. */ acpi_ut_push_generic_state (&state_list, state); state = acpi_ut_create_pkg_state (this_source_obj, state->pkg.this_target_obj, 0); if (!state) { - /* TBD: must delete package created up to this point */ - return_ACPI_STATUS (AE_NO_MEMORY); } } @@ -1027,7 +1321,89 @@ /* We should never get here */ - return (AE_AML_INTERNAL); + return_ACPI_STATUS (AE_AML_INTERNAL); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ut_generate_checksum + * + * PARAMETERS: Buffer - Buffer to be scanned + * Length - number of bytes to examine + * + * RETURN: checksum + * + * DESCRIPTION: Generate a checksum on a raw buffer + * + ******************************************************************************/ + +u8 +acpi_ut_generate_checksum ( + u8 *buffer, + u32 length) +{ + u32 i; + signed char sum = 0; + + for (i = 0; i < length; i++) { + sum = (signed char) (sum + buffer[i]); + } + + return ((u8) (0 - sum)); +} + + +/******************************************************************************* + * + * FUNCTION: Acpi_ut_get_resource_end_tag + * + * PARAMETERS: Obj_desc - The resource template buffer object + * + * RETURN: Pointer to the end tag + * + * DESCRIPTION: Find the END_TAG resource descriptor in a resource template + * + ******************************************************************************/ + + +u8 * +acpi_ut_get_resource_end_tag ( + acpi_operand_object *obj_desc) +{ + u8 buffer_byte; + u8 *buffer; + u8 *end_buffer; + + + buffer = obj_desc->buffer.pointer; + end_buffer = buffer + obj_desc->buffer.length; + + while (buffer < end_buffer) { + buffer_byte = *buffer; + if (buffer_byte & ACPI_RDESC_TYPE_MASK) { + /* Large Descriptor - Length is next 2 bytes */ + + buffer += ((*(buffer+1) | (*(buffer+2) << 8)) + 3); + } + else { + /* Small Descriptor. End Tag will be found here */ + + if ((buffer_byte & ACPI_RDESC_SMALL_MASK) == ACPI_RDESC_TYPE_END_TAG) { + /* Found the end tag descriptor, all done. */ + + return (buffer); + } + + /* Length is in the header */ + + buffer += ((buffer_byte & 0x07) + 1); + } + } + + /* End tag not found */ + + return (NULL); } diff -urN linux-2.4.18/drivers/acpi/utilities/utobject.c lia64-2.4/drivers/acpi/utilities/utobject.c --- linux-2.4.18/drivers/acpi/utilities/utobject.c Mon Nov 5 18:28:45 2001 +++ lia64-2.4/drivers/acpi/utilities/utobject.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: utobject - ACPI object create/delete/size/cache routines - * $Revision: 57 $ + * $Revision: 73 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,14 +25,12 @@ #include "acpi.h" -#include "acinterp.h" #include "acnamesp.h" -#include "actables.h" #include "amlcode.h" #define _COMPONENT ACPI_UTILITIES - MODULE_NAME ("utobject") + ACPI_MODULE_NAME ("utobject") /******************************************************************************* @@ -62,26 +60,50 @@ NATIVE_CHAR *module_name, u32 line_number, u32 component_id, - acpi_object_type8 type) + acpi_object_type type) { acpi_operand_object *object; + acpi_operand_object *second_object; - FUNCTION_TRACE_STR ("Ut_create_internal_object_dbg", acpi_ut_get_type_name (type)); + ACPI_FUNCTION_TRACE_STR ("Ut_create_internal_object_dbg", acpi_ut_get_type_name (type)); /* Allocate the raw object descriptor */ object = acpi_ut_allocate_object_desc_dbg (module_name, line_number, component_id); if (!object) { - /* Allocation failure */ - return_PTR (NULL); } + switch (type) { + case ACPI_TYPE_REGION: + case ACPI_TYPE_BUFFER_FIELD: + + /* These types require a secondary object */ + + second_object = acpi_ut_allocate_object_desc_dbg (module_name, line_number, component_id); + if (!second_object) { + acpi_ut_delete_object_desc (object); + return_PTR (NULL); + } + + second_object->common.type = INTERNAL_TYPE_EXTRA; + second_object->common.reference_count = 1; + + /* Link the second object to the first */ + + object->common.next_object = second_object; + break; + + default: + /* All others have no secondary object */ + break; + } + /* Save the object type in the object descriptor */ - object->common.type = type; + object->common.type = (u8) type; /* Init the reference count */ @@ -108,7 +130,7 @@ void *object) { - PROC_NAME ("Ut_valid_internal_object"); + ACPI_FUNCTION_NAME ("Ut_valid_internal_object"); /* Check for a null pointer */ @@ -121,31 +143,33 @@ /* Check the descriptor type field */ - if (!VALID_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_INTERNAL)) { - /* Not an ACPI internal object, do some further checking */ + switch (ACPI_GET_DESCRIPTOR_TYPE (object)) { + case ACPI_DESC_TYPE_OPERAND: - if (VALID_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_NAMED)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "**** Obj %p is a named obj, not ACPI obj\n", object)); - } + /* The object appears to be a valid acpi_operand_object */ - else if (VALID_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_PARSER)) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "**** Obj %p is a parser obj, not ACPI obj\n", object)); - } + return (TRUE); - else { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "**** Obj %p is of unknown type\n", object)); - } + case ACPI_DESC_TYPE_NAMED: - return (FALSE); - } + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "**** Obj %p is a named obj, not ACPI obj\n", object)); + break; + case ACPI_DESC_TYPE_PARSER: - /* The object appears to be a valid acpi_operand_object */ + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "**** Obj %p is a parser obj, not ACPI obj\n", object)); + break; - return (TRUE); + default: + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "**** Obj %p is of unknown type\n", object)); + break; + } + + return (FALSE); } @@ -174,12 +198,12 @@ acpi_operand_object *object; - FUNCTION_TRACE ("Ut_allocate_object_desc_dbg"); + ACPI_FUNCTION_TRACE ("Ut_allocate_object_desc_dbg"); object = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_OPERAND); if (!object) { - _REPORT_ERROR (module_name, line_number, component_id, + _ACPI_REPORT_ERROR (module_name, line_number, component_id, ("Could not allocate an object descriptor\n")); return_PTR (NULL); @@ -188,10 +212,10 @@ /* Mark the descriptor type */ - object->common.data_type = ACPI_DESC_TYPE_INTERNAL; + ACPI_SET_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_OPERAND); ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p Size %X\n", - object, sizeof (acpi_operand_object))); + object, (u32) sizeof (acpi_operand_object))); return_PTR (object); } @@ -213,12 +237,12 @@ acpi_ut_delete_object_desc ( acpi_operand_object *object) { - FUNCTION_TRACE_PTR ("Ut_delete_object_desc", object); + ACPI_FUNCTION_TRACE_PTR ("Ut_delete_object_desc", object); /* Object must be an acpi_operand_object */ - if (object->common.data_type != ACPI_DESC_TYPE_INTERNAL) { + if (ACPI_GET_DESCRIPTOR_TYPE (object) != ACPI_DESC_TYPE_OPERAND) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Obj %p is not an ACPI object\n", object)); return_VOID; @@ -247,7 +271,7 @@ acpi_ut_delete_object_cache ( void) { - FUNCTION_TRACE ("Ut_delete_object_cache"); + ACPI_FUNCTION_TRACE ("Ut_delete_object_cache"); acpi_ut_delete_generic_cache (ACPI_MEM_LIST_OPERAND); @@ -275,13 +299,13 @@ acpi_status acpi_ut_get_simple_object_size ( acpi_operand_object *internal_object, - u32 *obj_length) + ACPI_SIZE *obj_length) { - u32 length; + ACPI_SIZE length; acpi_status status = AE_OK; - FUNCTION_TRACE_PTR ("Ut_get_simple_object_size", internal_object); + ACPI_FUNCTION_TRACE_PTR ("Ut_get_simple_object_size", internal_object); /* Handle a null object (Could be a uninitialized package element -- which is legal) */ @@ -296,10 +320,10 @@ length = sizeof (acpi_object); - if (VALID_DESCRIPTOR_TYPE (internal_object, ACPI_DESC_TYPE_NAMED)) { + if (ACPI_GET_DESCRIPTOR_TYPE (internal_object) == ACPI_DESC_TYPE_NAMED) { /* Object is a named object (reference), just return the length */ - *obj_length = (u32) ROUND_UP_TO_NATIVE_WORD (length); + *obj_length = ACPI_ROUND_UP_TO_NATIVE_WORD (length); return_ACPI_STATUS (status); } @@ -315,13 +339,13 @@ case ACPI_TYPE_STRING: - length += internal_object->string.length + 1; + length += (ACPI_SIZE) internal_object->string.length + 1; break; case ACPI_TYPE_BUFFER: - length += internal_object->buffer.length; + length += (ACPI_SIZE) internal_object->buffer.length; break; @@ -337,23 +361,37 @@ case INTERNAL_TYPE_REFERENCE: - /* - * The only type that should be here is internal opcode NAMEPATH_OP -- since - * this means an object reference - */ - if (internal_object->reference.opcode != AML_INT_NAMEPATH_OP) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Unsupported Reference opcode=%X in object %p\n", - internal_object->reference.opcode, internal_object)); - status = AE_TYPE; - } + switch (internal_object->reference.opcode) { + case AML_ZERO_OP: + case AML_ONE_OP: + case AML_ONES_OP: + case AML_REVISION_OP: + + /* These Constant opcodes will be resolved to Integers */ + + break; + + case AML_INT_NAMEPATH_OP: - else { /* * Get the actual length of the full pathname to this object. * The reference will be converted to the pathname to the object */ - length += ROUND_UP_TO_NATIVE_WORD (acpi_ns_get_pathname_length (internal_object->reference.node)); + length += ACPI_ROUND_UP_TO_NATIVE_WORD (acpi_ns_get_pathname_length (internal_object->reference.node)); + break; + + default: + + /* + * No other reference opcodes are supported. + * Notably, Locals and Args are not supported, by this may be + * required eventually. + */ + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Unsupported Reference opcode=%X in object %p\n", + internal_object->reference.opcode, internal_object)); + status = AE_TYPE; + break; } break; @@ -373,8 +411,7 @@ * on a machine word boundary. (preventing alignment faults on some * machines.) */ - *obj_length = (u32) ROUND_UP_TO_NATIVE_WORD (length); - + *obj_length = ACPI_ROUND_UP_TO_NATIVE_WORD (length); return_ACPI_STATUS (status); } @@ -400,11 +437,11 @@ { acpi_status status = AE_OK; acpi_pkg_info *info = (acpi_pkg_info *) context; - u32 object_space; + ACPI_SIZE object_space; switch (object_type) { - case 0: + case ACPI_COPY_TYPE_SIMPLE: /* * Simple object - just get the size (Null object/entry is handled @@ -419,18 +456,22 @@ break; - case 1: - /* Package - nothing much to do here, let the walk handle it */ + case ACPI_COPY_TYPE_PACKAGE: + + /* Package object - nothing much to do here, let the walk handle it */ info->num_packages++; state->pkg.this_target_obj = NULL; break; + default: + + /* No other types allowed */ + return (AE_BAD_PARAMETER); } - return (status); } @@ -455,13 +496,13 @@ acpi_status acpi_ut_get_package_object_size ( acpi_operand_object *internal_object, - u32 *obj_length) + ACPI_SIZE *obj_length) { acpi_status status; acpi_pkg_info info; - FUNCTION_TRACE_PTR ("Ut_get_package_object_size", internal_object); + ACPI_FUNCTION_TRACE_PTR ("Ut_get_package_object_size", internal_object); info.length = 0; @@ -470,14 +511,17 @@ status = acpi_ut_walk_package_tree (internal_object, NULL, acpi_ut_get_element_length, &info); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } /* * We have handled all of the objects in all levels of the package. * just add the length of the package objects themselves. * Round up to the next machine word. */ - info.length += ROUND_UP_TO_NATIVE_WORD (sizeof (acpi_object)) * - info.num_packages; + info.length += ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (acpi_object)) * + (ACPI_SIZE) info.num_packages; /* Return the total package length */ @@ -503,19 +547,18 @@ acpi_status acpi_ut_get_object_size( acpi_operand_object *internal_object, - u32 *obj_length) + ACPI_SIZE *obj_length) { acpi_status status; - FUNCTION_ENTRY (); + ACPI_FUNCTION_ENTRY (); - if ((VALID_DESCRIPTOR_TYPE (internal_object, ACPI_DESC_TYPE_INTERNAL)) && - (IS_THIS_OBJECT_TYPE (internal_object, ACPI_TYPE_PACKAGE))) { + if ((ACPI_GET_DESCRIPTOR_TYPE (internal_object) == ACPI_DESC_TYPE_OPERAND) && + (internal_object->common.type == ACPI_TYPE_PACKAGE)) { status = acpi_ut_get_package_object_size (internal_object, obj_length); } - else { status = acpi_ut_get_simple_object_size (internal_object, obj_length); } diff -urN linux-2.4.18/drivers/acpi/utilities/utxface.c lia64-2.4/drivers/acpi/utilities/utxface.c --- linux-2.4.18/drivers/acpi/utilities/utxface.c Mon Nov 5 18:28:45 2001 +++ lia64-2.4/drivers/acpi/utilities/utxface.c Tue Jun 11 14:24:23 2002 @@ -1,12 +1,12 @@ /****************************************************************************** * * Module Name: utxface - External interfaces for "global" ACPI functions - * $Revision: 82 $ + * $Revision: 96 $ * *****************************************************************************/ /* - * Copyright (C) 2000, 2001 R. Byron Moore + * Copyright (C) 2000 - 2002, R. Byron Moore * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,16 +26,13 @@ #include "acpi.h" #include "acevents.h" -#include "achware.h" #include "acnamesp.h" -#include "acinterp.h" -#include "amlcode.h" +#include "acparser.h" +#include "acdispat.h" #include "acdebug.h" -#include "acexcep.h" - #define _COMPONENT ACPI_UTILITIES - MODULE_NAME ("utxface") + ACPI_MODULE_NAME ("utxface") /******************************************************************************* @@ -57,10 +54,10 @@ { acpi_status status; - FUNCTION_TRACE ("Acpi_initialize_subsystem"); + ACPI_FUNCTION_TRACE ("Acpi_initialize_subsystem"); - DEBUG_EXEC(acpi_ut_init_stack_ptr_trace ()); + ACPI_DEBUG_EXEC (acpi_ut_init_stack_ptr_trace ()); /* Initialize all globals used by the subsystem */ @@ -71,7 +68,7 @@ status = acpi_os_initialize (); if (ACPI_FAILURE (status)) { - REPORT_ERROR (("OSD failed to initialize, %s\n", + ACPI_REPORT_ERROR (("OSD failed to initialize, %s\n", acpi_format_exception (status))); return_ACPI_STATUS (status); } @@ -80,7 +77,7 @@ status = acpi_ut_mutex_initialize (); if (ACPI_FAILURE (status)) { - REPORT_ERROR (("Global mutex creation failure, %s\n", + ACPI_REPORT_ERROR (("Global mutex creation failure, %s\n", acpi_format_exception (status))); return_ACPI_STATUS (status); } @@ -92,7 +89,7 @@ status = acpi_ns_root_initialize (); if (ACPI_FAILURE (status)) { - REPORT_ERROR (("Namespace initialization failure, %s\n", + ACPI_REPORT_ERROR (("Namespace initialization failure, %s\n", acpi_format_exception (status))); return_ACPI_STATUS (status); } @@ -100,7 +97,7 @@ /* If configured, initialize the AML debugger */ - DEBUGGER_EXEC (acpi_db_initialize ()); + ACPI_DEBUGGER_EXEC (status = acpi_db_initialize ()); return_ACPI_STATUS (status); } @@ -126,25 +123,18 @@ acpi_status status = AE_OK; - FUNCTION_TRACE ("Acpi_enable_subsystem"); - + ACPI_FUNCTION_TRACE ("Acpi_enable_subsystem"); - /* Sanity check the FADT for valid values */ - - status = acpi_ut_validate_fadt (); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } /* - * Install the default Op_region handlers. These are - * installed unless other handlers have already been - * installed via the Install_address_space_handler interface + * Install the default Op_region handlers. These are installed unless + * other handlers have already been installed via the + * Install_address_space_handler interface */ if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Installing default address space handlers\n")); - status = acpi_ev_install_default_address_space_handlers (); + status = acpi_ev_init_address_spaces (); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -152,6 +142,7 @@ /* * We must initialize the hardware before we can enable ACPI. + * FADT values are validated here. */ if (!(flags & ACPI_NO_HARDWARE_INIT)) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI hardware\n")); @@ -190,6 +181,16 @@ } } + /* Install SCI handler, Global Lock handler, GPE handlers */ + + if (!(flags & ACPI_NO_HANDLER_INIT)) { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Installing SCI/GL/GPE handlers\n")); + + status = acpi_ev_handler_initialize (); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + } /* * Initialize all device objects in the namespace @@ -204,7 +205,6 @@ } } - /* * Initialize the objects that remain uninitialized. This * runs the executable AML that is part of the declaration of Op_regions @@ -219,8 +219,14 @@ } } - acpi_gbl_startup_flags |= ACPI_INITIALIZED_OK; + /* + * Empty the caches (delete the cached objects) on the assumption that + * the table load filled them up more than they will be at runtime -- + * thus wasting non-paged memory. + */ + status = acpi_purge_cached_objects (); + acpi_gbl_startup_flags |= ACPI_INITIALIZED_OK; return_ACPI_STATUS (status); } @@ -240,16 +246,15 @@ acpi_status acpi_terminate (void) { - FUNCTION_TRACE ("Acpi_terminate"); + acpi_status status; - /* Terminate the AML Debugger if present */ + ACPI_FUNCTION_TRACE ("Acpi_terminate"); - DEBUGGER_EXEC(acpi_gbl_db_terminate_threads = TRUE); - /* TBD: [Investigate] This is no longer needed?*/ -/* Acpi_ut_release_mutex (ACPI_MTX_DEBUG_CMD_READY); */ + /* Terminate the AML Debugger if present */ + ACPI_DEBUGGER_EXEC(acpi_gbl_db_terminate_threads = TRUE); /* Shutdown and free all resources */ @@ -270,10 +275,8 @@ /* Now we can shutdown the OS-dependent layer */ - acpi_os_terminate (); - - - return_ACPI_STATUS (AE_OK); + status = acpi_os_terminate (); + return_ACPI_STATUS (status); } @@ -328,42 +331,39 @@ { acpi_system_info *info_ptr; u32 i; + acpi_status status; - FUNCTION_TRACE ("Acpi_get_system_info"); + ACPI_FUNCTION_TRACE ("Acpi_get_system_info"); - /* - * Must have a valid buffer - */ - if ((!out_buffer) || - (!out_buffer->pointer)) { - return_ACPI_STATUS (AE_BAD_PARAMETER); + /* Parameter validation */ + + status = acpi_ut_validate_buffer (out_buffer); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } - if (out_buffer->length < sizeof (acpi_system_info)) { - /* - * Caller's buffer is too small - */ - out_buffer->length = sizeof (acpi_system_info); + /* Validate/Allocate/Clear caller buffer */ - return_ACPI_STATUS (AE_BUFFER_OVERFLOW); + status = acpi_ut_initialize_buffer (out_buffer, sizeof (acpi_system_info)); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } - /* - * Set return length and get data + * Populate the return buffer */ - out_buffer->length = sizeof (acpi_system_info); info_ptr = (acpi_system_info *) out_buffer->pointer; info_ptr->acpi_ca_version = ACPI_CA_VERSION; /* System flags (ACPI capabilities) */ - info_ptr->flags = acpi_gbl_system_flags; + info_ptr->flags = ACPI_SYS_MODE_ACPI; /* Timer resolution - 24 or 32 bits */ + if (!acpi_gbl_FADT) { info_ptr->timer_resolution = 0; } @@ -395,3 +395,61 @@ } +/***************************************************************************** + * + * FUNCTION: Acpi_install_initialization_handler + * + * PARAMETERS: Handler - Callback procedure + * + * RETURN: Status + * + * DESCRIPTION: Install an initialization handler + * + * TBD: When a second function is added, must save the Function also. + * + ****************************************************************************/ + +acpi_status +acpi_install_initialization_handler ( + ACPI_INIT_HANDLER handler, + u32 function) +{ + + if (!handler) { + return (AE_BAD_PARAMETER); + } + + if (acpi_gbl_init_handler) { + return (AE_ALREADY_EXISTS); + } + + acpi_gbl_init_handler = handler; + return AE_OK; +} + + +/***************************************************************************** + * + * FUNCTION: Acpi_purge_cached_objects + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Empty all caches (delete the cached objects) + * + ****************************************************************************/ + +acpi_status +acpi_purge_cached_objects (void) +{ + ACPI_FUNCTION_TRACE ("Acpi_purge_cached_objects"); + + + acpi_ut_delete_generic_state_cache (); + acpi_ut_delete_object_cache (); + acpi_ds_delete_walk_state_cache (); + acpi_ps_delete_parse_cache (); + + return_ACPI_STATUS (AE_OK); +} diff -urN linux-2.4.18/drivers/acpi/utils.c lia64-2.4/drivers/acpi/utils.c --- linux-2.4.18/drivers/acpi/utils.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/acpi/utils.c Tue Jun 11 14:24:23 2002 @@ -0,0 +1,460 @@ +/* + * acpi_utils.c - ACPI Utility Functions ($Revision: 1.1 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include +#include +#include +#include "acpi_bus.h" +#include "acpi_drivers.h" + + +#define _COMPONENT ACPI_BUS_COMPONENT +ACPI_MODULE_NAME ("acpi_utils") + + +/* -------------------------------------------------------------------------- + Object Evaluation Helpers + -------------------------------------------------------------------------- */ + +#ifdef ACPI_DEBUG +#define acpi_util_eval_error(h,p,s) {\ + char prefix[80] = {'\0'};\ + acpi_buffer buffer = {sizeof(prefix), prefix};\ + acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer);\ + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluate [%s.%s]: %s\n",\ + (char *) prefix, p, acpi_format_exception(s))); } +#else +#define acpi_util_eval_error(h,p,s) +#endif + + +acpi_status +acpi_extract_package ( + acpi_object *package, + acpi_buffer *format, + acpi_buffer *buffer) +{ + u32 size_required = 0; + u32 tail_offset = 0; + char *format_string = NULL; + u32 format_count = 0; + u32 i = 0; + u8 *head = NULL; + u8 *tail = NULL; + + ACPI_FUNCTION_TRACE("acpi_extract_package"); + + if (!package || (package->type != ACPI_TYPE_PACKAGE) || (package->package.count < 1)) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'package' argument\n")); + return_ACPI_STATUS(AE_BAD_PARAMETER); + } + + if (!format || !format->pointer || (format->length < 1)) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'format' argument\n")); + return_ACPI_STATUS(AE_BAD_PARAMETER); + } + + if (!buffer) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'buffer' argument\n")); + return_ACPI_STATUS(AE_BAD_PARAMETER); + } + + format_count = (format->length/sizeof(char)) - 1; + if (format_count > package->package.count) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Format specifies more objects [%d] than exist in package [%d].", format_count, package->package.count)); + return_ACPI_STATUS(AE_BAD_DATA); + } + + format_string = (char*)format->pointer; + + /* + * Calculate size_required. + */ + for (i=0; ipackage.elements[i]); + + if (!element) { + return_ACPI_STATUS(AE_BAD_DATA); + } + + switch (element->type) { + + case ACPI_TYPE_INTEGER: + switch (format_string[i]) { + case 'N': + size_required += sizeof(acpi_integer); + tail_offset += sizeof(acpi_integer); + break; + case 'S': + size_required += sizeof(char*) + sizeof(acpi_integer) + sizeof(char); + tail_offset += sizeof(char*); + break; + default: + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid package element [%d]: got number, expecing [%c].\n", i, format_string[i])); + return_ACPI_STATUS(AE_BAD_DATA); + break; + } + break; + + case ACPI_TYPE_STRING: + case ACPI_TYPE_BUFFER: + switch (format_string[i]) { + case 'S': + size_required += sizeof(char*) + (element->string.length * sizeof(char)) + sizeof(char); + tail_offset += sizeof(char*); + break; + case 'B': + size_required += sizeof(u8*) + (element->buffer.length * sizeof(u8)); + tail_offset += sizeof(u8*); + break; + default: + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid package element [%d] got string/buffer, expecing [%c].\n", i, format_string[i])); + return_ACPI_STATUS(AE_BAD_DATA); + break; + } + break; + + case ACPI_TYPE_PACKAGE: + default: + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found unsupported element at index=%d\n", i)); + /* TBD: handle nested packages... */ + return_ACPI_STATUS(AE_SUPPORT); + break; + } + } + + /* + * Validate output buffer. + */ + if (buffer->length < size_required) { + buffer->length = size_required; + return_ACPI_STATUS(AE_BUFFER_OVERFLOW); + } + else if (buffer->length != size_required || !buffer->pointer) { + return_ACPI_STATUS(AE_BAD_PARAMETER); + } + + head = buffer->pointer; + tail = buffer->pointer + tail_offset; + + /* + * Extract package data. + */ + for (i=0; ipackage.elements[i]); + + if (!element) { + return_ACPI_STATUS(AE_BAD_DATA); + } + + switch (element->type) { + + case ACPI_TYPE_INTEGER: + switch (format_string[i]) { + case 'N': + *((acpi_integer*)head) = element->integer.value; + head += sizeof(acpi_integer); + break; + case 'S': + pointer = (u8**)head; + *pointer = tail; + *((acpi_integer*)tail) = element->integer.value; + head += sizeof(acpi_integer*); + tail += sizeof(acpi_integer); + /* NULL terminate string */ + *tail = (char)0; + tail += sizeof(char); + break; + default: + /* Should never get here */ + break; + } + break; + + case ACPI_TYPE_STRING: + case ACPI_TYPE_BUFFER: + switch (format_string[i]) { + case 'S': + pointer = (u8**)head; + *pointer = tail; + memcpy(tail, element->string.pointer, element->string.length); + head += sizeof(char*); + tail += element->string.length * sizeof(char); + /* NULL terminate string */ + *tail = (char)0; + tail += sizeof(char); + break; + case 'B': + pointer = (u8**)head; + *pointer = tail; + memcpy(tail, element->buffer.pointer, element->buffer.length); + head += sizeof(u8*); + tail += element->buffer.length * sizeof(u8); + break; + default: + /* Should never get here */ + break; + } + break; + + case ACPI_TYPE_PACKAGE: + /* TBD: handle nested packages... */ + default: + /* Should never get here */ + break; + } + } + + return_ACPI_STATUS(AE_OK); +} + + +acpi_status +acpi_evaluate ( + acpi_handle handle, + acpi_string pathname, + acpi_object_list *arguments, + acpi_buffer *buffer) +{ + acpi_status status = AE_OK; + + ACPI_FUNCTION_TRACE("acpi_evaluate"); + + /* If caller provided a buffer it must be unallocated/zero'd. */ + if (buffer && (buffer->length != 0 || buffer->pointer)) + return_ACPI_STATUS(AE_BAD_PARAMETER); + + /* + * Evalute object. The first attempt is just to get the size of the + * object data (that is unless there's no return data); the second + * gets the data. + */ + status = acpi_evaluate_object(handle, pathname, arguments, buffer); + + if (ACPI_SUCCESS(status)) { + return_ACPI_STATUS(status); + } + + else if (buffer && (status == AE_BUFFER_OVERFLOW)) { + + /* Gotta allocate - CALLER MUST FREE! */ + buffer->pointer = kmalloc(buffer->length, GFP_KERNEL); + if (!buffer->pointer) { + return_ACPI_STATUS(AE_NO_MEMORY); + } + memset(buffer->pointer, 0, buffer->length); + + /* Re-evaluate - this time it should work. */ + status = acpi_evaluate_object(handle, pathname, arguments, + buffer); + } + + if (ACPI_FAILURE(status)) { + if (status != AE_NOT_FOUND) + acpi_util_eval_error(handle, pathname, status); + if (buffer && buffer->pointer) { + kfree(buffer->pointer); + buffer->length = 0; + } + } + + return_ACPI_STATUS(status); +} + + +acpi_status +acpi_evaluate_integer ( + acpi_handle handle, + acpi_string pathname, + acpi_object_list *arguments, + unsigned long *data) +{ + acpi_status status = AE_OK; + acpi_object element; + acpi_buffer buffer = {sizeof(acpi_object), &element}; + + ACPI_FUNCTION_TRACE("acpi_evaluate_integer"); + + if (!data) + return_ACPI_STATUS(AE_BAD_PARAMETER); + + status = acpi_evaluate_object(handle, pathname, arguments, &buffer); + if (ACPI_FAILURE(status)) { + acpi_util_eval_error(handle, pathname, status); + return_ACPI_STATUS(status); + } + + if (element.type != ACPI_TYPE_INTEGER) { + acpi_util_eval_error(handle, pathname, AE_BAD_DATA); + return_ACPI_STATUS(AE_BAD_DATA); + } + + *data = element.integer.value; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%lu]\n", *data)); + + return_ACPI_STATUS(AE_OK); +} + + +#if 0 +acpi_status +acpi_evaluate_string ( + acpi_handle handle, + acpi_string pathname, + acpi_object_list *arguments, + acpi_string *data) +{ + acpi_status status = AE_OK; + acpi_object *element = NULL; + acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + + ACPI_FUNCTION_TRACE("acpi_evaluate_string"); + + if (!data) + return_ACPI_STATUS(AE_BAD_PARAMETER); + + status = acpi_evaluate_object(handle, pathname, arguments, &buffer); + if (ACPI_FAILURE(status)) { + acpi_util_eval_error(handle, pathname, status); + return_ACPI_STATUS(status); + } + + element = (acpi_object *) buffer.pointer; + + if ((element->type != ACPI_TYPE_STRING) + || (element->type != ACPI_TYPE_BUFFER) + || !element->string.length) { + acpi_util_eval_error(handle, pathname, AE_BAD_DATA); + return_ACPI_STATUS(AE_BAD_DATA); + } + + *data = kmalloc(element->string.length + 1, GFP_KERNEL); + if (!data) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Memory allocation error\n")); + return_VALUE(-ENOMEM); + } + memset(*data, 0, element->string.length + 1); + + memcpy(*data, element->string.pointer, element->string.length); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%s]\n", *data)); + + return_ACPI_STATUS(AE_OK); +} +#endif + + +acpi_status +acpi_evaluate_reference ( + acpi_handle handle, + acpi_string pathname, + acpi_object_list *arguments, + struct acpi_handle_list *list) +{ + acpi_status status = AE_OK; + acpi_object *package = NULL; + acpi_object *element = NULL; + acpi_buffer buffer = {0, NULL}; + u32 i = 0; + + ACPI_FUNCTION_TRACE("acpi_evaluate_reference"); + + if (!list) { + return_ACPI_STATUS(AE_BAD_PARAMETER); + } + + /* Evaluate object. */ + + status = acpi_evaluate(handle, pathname, arguments, &buffer); + if (ACPI_FAILURE(status)) + goto end; + + package = (acpi_object *) buffer.pointer; + + if (!package || (package->type != ACPI_TYPE_PACKAGE) + || (package->package.count == 0)) { + status = AE_BAD_DATA; + acpi_util_eval_error(handle, pathname, status); + goto end; + } + + /* Allocate list - CALLER MUST FREE! */ + list->count = package->package.count; + if (list->count > 10) { + return AE_NO_MEMORY; + } + /* TBD: dynamically allocate */ + /* + list->handles = kmalloc(sizeof(acpi_handle)*(list->count), GFP_KERNEL); + if (!list->handles) { + return_ACPI_STATUS(AE_NO_MEMORY); + } + memset(list->handles, 0, sizeof(acpi_handle)*(list->count)); + */ + + /* Parse package data. */ + + for (i = 0; i < list->count; i++) { + + element = &(package->package.elements[i]); + + if (!element || (element->type != ACPI_TYPE_STRING)) { + status = AE_BAD_DATA; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid element in package (not a device reference)\n")); + acpi_util_eval_error(handle, pathname, status); + break; + } + + /* Convert reference (e.g. "\_PR_.CPU_") to acpi_handle. */ + + status = acpi_get_handle(handle, element->string.pointer, + &(list->handles[i])); + if (ACPI_FAILURE(status)) { + status = AE_BAD_DATA; + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to resolve device reference [%s]\n", element->string.pointer)); + acpi_util_eval_error(handle, pathname, status); + break; + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resolved reference [%s]->[%p]\n", element->string.pointer, list->handles[i])); + } + +end: + if (ACPI_FAILURE(status)) { + list->count = 0; + //kfree(list->handles); + } + + kfree(buffer.pointer); + + return_ACPI_STATUS(status); +} + + diff -urN linux-2.4.18/drivers/char/Config.in lia64-2.4/drivers/char/Config.in --- linux-2.4.18/drivers/char/Config.in Tue Feb 26 11:04:05 2002 +++ lia64-2.4/drivers/char/Config.in Mon Jul 22 21:48:05 2002 @@ -11,15 +11,18 @@ tristate 'Standard/generic (8250/16550 and compatible UARTs) serial support' CONFIG_SERIAL if [ "$CONFIG_SERIAL" = "y" ]; then bool ' Support for console on serial port' CONFIG_SERIAL_CONSOLE + if [ "$CONFIG_IA64" = "y" ]; then + bool 'Support for serial console port described by EFI HCDP table' CONFIG_SERIAL_HCDP + fi if [ "$CONFIG_ARCH_ACORN" = "y" ]; then tristate ' Atomwide serial port support' CONFIG_ATOMWIDE_SERIAL tristate ' Dual serial port support' CONFIG_DUALSP_SERIAL fi fi +dep_mbool 'Extended dumb serial driver options' CONFIG_SERIAL_EXTENDED $CONFIG_SERIAL if [ "$CONFIG_ACPI" = "y" ]; then bool ' Support for serial ports defined by ACPI tables' CONFIG_SERIAL_ACPI fi -dep_mbool 'Extended dumb serial driver options' CONFIG_SERIAL_EXTENDED $CONFIG_SERIAL if [ "$CONFIG_SERIAL_EXTENDED" = "y" ]; then bool ' Support more than 4 serial ports' CONFIG_SERIAL_MANY_PORTS bool ' Support for sharing serial interrupts' CONFIG_SERIAL_SHARE_IRQ @@ -208,9 +211,13 @@ fi endmenu -dep_tristate '/dev/agpgart (AGP Support)' CONFIG_AGP $CONFIG_DRM_AGP +tristate '/dev/agpgart (AGP Support)' CONFIG_AGP if [ "$CONFIG_AGP" != "n" ]; then bool ' Intel 440LX/BX/GX and I815/I830M/I840/I850 support' CONFIG_AGP_INTEL + if [ "$CONFIG_IA64" != "n" ]; then + bool ' Intel 460GX support' CONFIG_AGP_I460 + bool ' HP ZX1 AGP support' CONFIG_AGP_HP_ZX1 + fi bool ' Intel I810/I815/I830M (on-board) support' CONFIG_AGP_I810 bool ' VIA chipset support' CONFIG_AGP_VIA bool ' AMD Irongate, 761, and 762 support' CONFIG_AGP_AMD diff -urN linux-2.4.18/drivers/char/Makefile lia64-2.4/drivers/char/Makefile --- linux-2.4.18/drivers/char/Makefile Tue Feb 26 11:04:06 2002 +++ lia64-2.4/drivers/char/Makefile Mon Jul 8 18:40:23 2002 @@ -127,6 +127,7 @@ obj-$(CONFIG_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o $(CONSOLE) selection.o obj-$(CONFIG_SERIAL) += $(SERIAL) obj-$(CONFIG_SERIAL_ACPI) += acpi_serial.o +obj-$(CONFIG_SERIAL_HCDP) += hcdp_serial.o obj-$(CONFIG_SERIAL_21285) += serial_21285.o obj-$(CONFIG_SERIAL_SA1100) += serial_sa1100.o obj-$(CONFIG_SERIAL_AMBA) += serial_amba.o @@ -139,6 +140,7 @@ obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o +obj-$(CONFIG_SIM_SERIAL) += simserial.o obj-$(CONFIG_ROCKETPORT) += rocket.o obj-$(CONFIG_MOXA_SMARTIO) += mxser.o obj-$(CONFIG_MOXA_INTELLIO) += moxa.o diff -urN linux-2.4.18/drivers/char/agp/agp.h lia64-2.4/drivers/char/agp/agp.h --- linux-2.4.18/drivers/char/agp/agp.h Tue Feb 26 11:04:06 2002 +++ lia64-2.4/drivers/char/agp/agp.h Thu Apr 11 14:58:35 2002 @@ -84,8 +84,8 @@ void *dev_private_data; struct pci_dev *dev; gatt_mask *masks; - unsigned long *gatt_table; - unsigned long *gatt_table_real; + u32 *gatt_table; + u32 *gatt_table_real; unsigned long scratch_page; unsigned long gart_bus_addr; unsigned long gatt_bus_addr; @@ -99,7 +99,6 @@ int needs_scratch_page; int aperture_size_idx; int num_aperture_sizes; - int num_of_masks; int capndx; int cant_use_aperture; @@ -111,6 +110,7 @@ void (*cleanup) (void); void (*tlb_flush) (agp_memory *); unsigned long (*mask_memory) (unsigned long, int); + unsigned long (*unmask_memory) (unsigned long); void (*cache_flush) (void); int (*create_gatt_table) (void); int (*free_gatt_table) (void); @@ -125,10 +125,12 @@ }; +#define OUTREG64(mmap, addr, val) __raw_writeq((val), (mmap)+(addr)) #define OUTREG32(mmap, addr, val) __raw_writel((val), (mmap)+(addr)) #define OUTREG16(mmap, addr, val) __raw_writew((val), (mmap)+(addr)) #define OUTREG8(mmap, addr, val) __raw_writeb((val), (mmap)+(addr)) +#define INREG64(mmap, addr) __raw_readq((mmap)+(addr)) #define INREG32(mmap, addr) __raw_readl((mmap)+(addr)) #define INREG16(mmap, addr) __raw_readw((mmap)+(addr)) #define INREG8(mmap, addr) __raw_readb((mmap)+(addr)) @@ -150,6 +152,10 @@ #define A_IDXFIX() (A_SIZE_FIX(agp_bridge.aperture_sizes) + i) #define MAXKEY (4096 * 32) +#ifndef max +#define max(a,b) (((a)>(b))?(a):(b)) +#endif + #define AGPGART_MODULE_NAME "agpgart" #define PFX AGPGART_MODULE_NAME ": " @@ -221,6 +227,9 @@ #ifndef PCI_DEVICE_ID_INTEL_82443GX_1 #define PCI_DEVICE_ID_INTEL_82443GX_1 0x71a1 #endif +#ifndef PCI_DEVICE_ID_INTEL_460GX +#define PCI_DEVICE_ID_INTEL_460GX 0x84ea +#endif #ifndef PCI_DEVICE_ID_AMD_IRONGATE_0 #define PCI_DEVICE_ID_AMD_IRONGATE_0 0x7006 #endif @@ -263,6 +272,15 @@ #define INTEL_NBXCFG 0x50 #define INTEL_ERRSTS 0x91 +/* Intel 460GX Registers */ +#define INTEL_I460_APBASE 0x10 +#define INTEL_I460_BAPBASE 0x98 +#define INTEL_I460_GXBCTL 0xa0 +#define INTEL_I460_AGPSIZ 0xa2 +#define INTEL_I460_ATTBASE 0xfe200000 +#define INTEL_I460_GATT_VALID (1UL << 24) +#define INTEL_I460_GATT_COHERENT (1UL << 25) + /* intel i830 registers */ #define I830_GMCH_CTRL 0x52 #define I830_GMCH_ENABLED 0x4 @@ -374,5 +392,14 @@ #define SVWRKS_TLBFLUSH 0x10 #define SVWRKS_POSTFLUSH 0x14 #define SVWRKS_DIRFLUSH 0x0c + +/* HP ZX1 SBA registers */ +#define HP_ZX1_CTRL 0x200 +#define HP_ZX1_IBASE 0x300 +#define HP_ZX1_IMASK 0x308 +#define HP_ZX1_PCOM 0x310 +#define HP_ZX1_TCNFG 0x318 +#define HP_ZX1_PDIR_BASE 0x320 +#define HP_ZX1_CACHE_FLUSH 0x428 #endif /* _AGP_BACKEND_PRIV_H */ diff -urN linux-2.4.18/drivers/char/agp/agpgart_be.c lia64-2.4/drivers/char/agp/agpgart_be.c --- linux-2.4.18/drivers/char/agp/agpgart_be.c Tue Feb 26 11:04:06 2002 +++ lia64-2.4/drivers/char/agp/agpgart_be.c Wed Jun 12 08:38:23 2002 @@ -22,6 +22,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * 460GX support by Chris Ahna */ #include #include @@ -43,6 +44,9 @@ #include #include #include +#include +#include +#include #include #include "agp.h" @@ -60,7 +64,7 @@ EXPORT_SYMBOL(agp_backend_release); static void flush_cache(void); - + static struct agp_bridge_data agp_bridge; static int agp_try_unsupported __initdata = 0; @@ -205,19 +209,54 @@ agp_bridge.free_by_type(curr); return; } - if (curr->page_count != 0) { - for (i = 0; i < curr->page_count; i++) { - curr->memory[i] &= ~(0x00000fff); - agp_bridge.agp_destroy_page((unsigned long) - phys_to_virt(curr->memory[i])); + if(agp_bridge.cant_use_aperture == 0) { + if (curr->page_count != 0) { + for (i = 0; i < curr->page_count; i++) { + agp_bridge.agp_destroy_page((unsigned long) + phys_to_virt(curr->memory[i])); + } } + } else { + vfree(curr->vmptr); } + agp_free_key(curr->key); vfree(curr->memory); kfree(curr); MOD_DEC_USE_COUNT; } +#define IN_VMALLOC(_x) (((_x) >= VMALLOC_START) && ((_x) < VMALLOC_END)) + +/* + * Look up and return the pte corresponding to addr. We only do this for + * agp_ioremap'ed addresses. + */ +static pte_t * agp_lookup_pte(unsigned long addr) { + + pgd_t *dir; + pmd_t *pmd; + pte_t *pte; + + if(!IN_VMALLOC(addr)) + return NULL; + + dir = pgd_offset_k(addr); + pmd = pmd_offset(dir, addr); + + if(pmd) { + pte = pte_offset(pmd, addr); + + if(pte) { + return pte; + } else { + return NULL; + } + } else { + return NULL; + } +} + #define ENTRIES_PER_PAGE (PAGE_SIZE / sizeof(unsigned long)) agp_memory *agp_allocate_memory(size_t page_count, u32 type) @@ -247,24 +286,53 @@ scratch_pages = (page_count + ENTRIES_PER_PAGE - 1) / ENTRIES_PER_PAGE; new = agp_create_memory(scratch_pages); - if (new == NULL) { MOD_DEC_USE_COUNT; return NULL; } - for (i = 0; i < page_count; i++) { - new->memory[i] = agp_bridge.agp_alloc_page(); - if (new->memory[i] == 0) { - /* Free this structure */ - agp_free_memory(new); + if(agp_bridge.cant_use_aperture == 0) { + for (i = 0; i < page_count; i++) { + new->memory[i] = agp_bridge.agp_alloc_page(); + + if (new->memory[i] == 0) { + /* Free this structure */ + agp_free_memory(new); + return NULL; + } + new->memory[i] = virt_to_phys((void *) new->memory[i]); + new->page_count++; + } + } else { + void *vmblock; + unsigned long vaddr, paddr; + pte_t *pte; + + vmblock = __vmalloc(page_count << PAGE_SHIFT, GFP_KERNEL, +#if 0/*XXX non-coherent AGP DMA*/ + pgprot_writecombine(PAGE_KERNEL)); +#else + PAGE_KERNEL); +#endif + if(vmblock == NULL) { + MOD_DEC_USE_COUNT; return NULL; } - new->memory[i] = - agp_bridge.mask_memory( - virt_to_phys((void *) new->memory[i]), - type); - new->page_count++; + + new->vmptr = vmblock; + vaddr = (unsigned long) vmblock; + + for(i = 0; i < page_count; i++, vaddr += PAGE_SIZE) { + pte = agp_lookup_pte(vaddr); + if(pte == NULL) { + MOD_DEC_USE_COUNT; + return NULL; + } + paddr = __pa(page_address(pte_page(*pte))); + new->memory[i] = paddr; + } + + new->page_count = page_count; } return new; @@ -307,9 +375,6 @@ void agp_copy_info(agp_kern_info * info) { - unsigned long page_mask = 0; - int i; - memset(info, 0, sizeof(agp_kern_info)); if (agp_bridge.type == NOT_SUPPORTED) { info->chipset = agp_bridge.type; @@ -325,11 +390,7 @@ info->max_memory = agp_bridge.max_memory_agp; info->current_memory = atomic_read(&agp_bridge.current_memory_agp); info->cant_use_aperture = agp_bridge.cant_use_aperture; - - for(i = 0; i < agp_bridge.num_of_masks; i++) - page_mask |= agp_bridge.mask_memory(page_mask, i); - - info->page_mask = ~page_mask; + info->page_mask = ~0UL; } /* End - Routine to copy over information structure */ @@ -353,12 +414,13 @@ curr->is_flushed = TRUE; } ret_val = agp_bridge.insert_memory(curr, pg_start, curr->type); - + if (ret_val != 0) { return ret_val; } curr->is_bound = TRUE; curr->pg_start = pg_start; + return 0; } @@ -377,6 +439,7 @@ if (ret_val != 0) { return ret_val; } + curr->is_bound = FALSE; curr->pg_start = 0; return 0; @@ -387,9 +450,9 @@ /* * Driver routines - start * Currently this module supports the following chipsets: - * i810, i815, 440lx, 440bx, 440gx, i830, i840, i845, i850, i860, via vp3, + * i810, i815, 440lx, 440bx, 440gx, 460gx, i830, i840, i845, i850, i860, via vp3, * via mvp3, via kx133, via kt133, amd irongate, amd 761, amd 762, ALi M1541, - * and generic support for the SiS chipsets. + * chipsets. */ /* Generic Agp routines - Start */ @@ -506,8 +569,18 @@ * command registers. */ - while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, - device)) != NULL) { + + pci_for_each_dev(device) + { + /* + * Enable AGP devices. Most will be VGA display but + * some may be coprocessors on non VGA devices too + */ + + if((((device->class >> 16) & 0xFF) != PCI_BASE_CLASS_DISPLAY) && + (device->class != (PCI_CLASS_PROCESSOR_CO << 8))) + continue; + pci_read_config_dword(device, 0x04, &scratch); if (!(scratch & 0x00100000)) @@ -624,7 +697,7 @@ for (page = virt_to_page(table); page <= virt_to_page(table_end); page++) set_bit(PG_reserved, &page->flags); - agp_bridge.gatt_table_real = (unsigned long *) table; + agp_bridge.gatt_table_real = (u32 *) table; CACHE_FLUSH(); agp_bridge.gatt_table = ioremap_nocache(virt_to_phys(table), (PAGE_SIZE * (1 << page_order))); @@ -756,7 +829,8 @@ mem->is_flushed = TRUE; } for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { - agp_bridge.gatt_table[j] = mem->memory[i]; + agp_bridge.gatt_table[j] = + agp_bridge.mask_memory(mem->memory[i], mem->type); } agp_bridge.tlb_flush(mem); @@ -843,6 +917,11 @@ agp_bridge.agp_enable(mode); } +static unsigned long agp_generic_unmask_memory(unsigned long addr) +{ + return addr & ~(0x00000fff); +} + /* End - Generic Agp routines */ #ifdef CONFIG_AGP_I810 @@ -993,7 +1072,8 @@ CACHE_FLUSH(); for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { OUTREG32(intel_i810_private.registers, - I810_PTE_BASE + (j * 4), mem->memory[i]); + I810_PTE_BASE + (j * 4), + agp_bridge.mask_memory(mem->memory[i], mem->type)); } CACHE_FLUSH(); @@ -1059,10 +1139,7 @@ agp_free_memory(new); return NULL; } - new->memory[0] = - agp_bridge.mask_memory( - virt_to_phys((void *) new->memory[0]), - type); + new->memory[0] = virt_to_phys((void *) new->memory[0]); new->page_count = 1; new->num_scratch_pages = 1; new->type = AGP_PHYS_MEMORY; @@ -1096,7 +1173,6 @@ intel_i810_private.i810_dev = i810_dev; agp_bridge.masks = intel_i810_masks; - agp_bridge.num_of_masks = 2; agp_bridge.aperture_sizes = (void *) intel_i810_sizes; agp_bridge.size_type = FIXED_APER_SIZE; agp_bridge.num_aperture_sizes = 2; @@ -1107,6 +1183,7 @@ agp_bridge.cleanup = intel_i810_cleanup; agp_bridge.tlb_flush = intel_i810_tlbflush; agp_bridge.mask_memory = intel_i810_mask_memory; + agp_bridge.unmask_memory = agp_generic_unmask_memory; agp_bridge.agp_enable = intel_i810_agp_enable; agp_bridge.cache_flush = global_cache_flush; agp_bridge.create_gatt_table = agp_generic_create_gatt_table; @@ -1298,7 +1375,8 @@ CACHE_FLUSH(); for (i = 0, j = pg_start; i < mem->page_count; i++, j++) - OUTREG32(intel_i830_private.registers,I810_PTE_BASE + (j * 4),mem->memory[i]); + OUTREG32(intel_i830_private.registers,I810_PTE_BASE + (j * 4), + agp_bridge.mask_memory(mem->memory[i], mem->type)); CACHE_FLUSH(); @@ -1359,60 +1437,689 @@ return(NULL); } - nw->memory[0] = agp_bridge.mask_memory(virt_to_phys((void *) nw->memory[0]),type); - nw->page_count = 1; - nw->num_scratch_pages = 1; - nw->type = AGP_PHYS_MEMORY; - nw->physical = virt_to_phys((void *) physical); - return(nw); - } + nw->memory[0] = virt_to_phys((void *) nw->memory[0]); + nw->page_count = 1; + nw->num_scratch_pages = 1; + nw->type = AGP_PHYS_MEMORY; + nw->physical = virt_to_phys((void *) physical); + return(nw); + } + + return(NULL); +} + +static int __init intel_i830_setup(struct pci_dev *i830_dev) +{ + intel_i830_private.i830_dev = i830_dev; + + agp_bridge.masks = intel_i810_masks; + agp_bridge.aperture_sizes = (void *) intel_i830_sizes; + agp_bridge.size_type = FIXED_APER_SIZE; + agp_bridge.num_aperture_sizes = 2; + + agp_bridge.dev_private_data = (void *) &intel_i830_private; + agp_bridge.needs_scratch_page = TRUE; + + agp_bridge.configure = intel_i830_configure; + agp_bridge.fetch_size = intel_i830_fetch_size; + agp_bridge.cleanup = intel_i830_cleanup; + agp_bridge.tlb_flush = intel_i810_tlbflush; + agp_bridge.mask_memory = intel_i810_mask_memory; + agp_bridge.agp_enable = intel_i810_agp_enable; + agp_bridge.cache_flush = global_cache_flush; + + agp_bridge.create_gatt_table = intel_i830_create_gatt_table; + agp_bridge.free_gatt_table = intel_i830_free_gatt_table; + + agp_bridge.insert_memory = intel_i830_insert_entries; + agp_bridge.remove_memory = intel_i830_remove_entries; + agp_bridge.alloc_by_type = intel_i830_alloc_by_type; + agp_bridge.free_by_type = intel_i810_free_by_type; + agp_bridge.agp_alloc_page = agp_generic_alloc_page; + agp_bridge.agp_destroy_page = agp_generic_destroy_page; + + agp_bridge.suspend = agp_generic_suspend; + agp_bridge.resume = agp_generic_resume; + agp_bridge.cant_use_aperture = 0; + + return(0); +} + +#endif /* CONFIG_AGP_I810 */ + +#ifdef CONFIG_AGP_I460 + +/* BIOS configures the chipset so that one of two apbase registers are used */ +static u8 intel_i460_dynamic_apbase = 0x10; + +/* 460 supports multiple GART page sizes, so GART pageshift is dynamic */ +static u8 intel_i460_pageshift = 12; +static u32 intel_i460_pagesize; + +/* Keep track of which is larger, chipset or kernel page size. */ +static u32 intel_i460_cpk = 1; + +/* Structure for tracking partial use of 4MB GART pages */ +static u32 **i460_pg_detail = NULL; +static u32 *i460_pg_count = NULL; + +#define I460_CPAGES_PER_KPAGE (PAGE_SIZE >> intel_i460_pageshift) +#define I460_KPAGES_PER_CPAGE ((1 << intel_i460_pageshift) >> PAGE_SHIFT) + +#define I460_SRAM_IO_DISABLE (1 << 4) +#define I460_BAPBASE_ENABLE (1 << 3) +#define I460_AGPSIZ_MASK 0x7 +#define I460_4M_PS (1 << 1) + +#define log2(x) ffz(~(x)) + +static int intel_i460_fetch_size(void) +{ + int i; + u8 temp; + aper_size_info_8 *values; + + /* Determine the GART page size */ + pci_read_config_byte(agp_bridge.dev, INTEL_I460_GXBCTL, &temp); + intel_i460_pageshift = (temp & I460_4M_PS) ? 22 : 12; + intel_i460_pagesize = 1UL << intel_i460_pageshift; + + values = A_SIZE_8(agp_bridge.aperture_sizes); + + pci_read_config_byte(agp_bridge.dev, INTEL_I460_AGPSIZ, &temp); + + /* Exit now if the IO drivers for the GART SRAMS are turned off */ + if(temp & I460_SRAM_IO_DISABLE) { + printk("[agpgart] GART SRAMS disabled on 460GX chipset\n"); + printk("[agpgart] AGPGART operation not possible\n"); + return 0; + } + + /* Make sure we don't try to create an 2 ^ 23 entry GATT */ + if((intel_i460_pageshift == 0) && ((temp & I460_AGPSIZ_MASK) == 4)) { + printk("[agpgart] We can't have a 32GB aperture with 4KB" + " GART pages\n"); + return 0; + } + + /* Determine the proper APBASE register */ + if(temp & I460_BAPBASE_ENABLE) + intel_i460_dynamic_apbase = INTEL_I460_BAPBASE; + else intel_i460_dynamic_apbase = INTEL_I460_APBASE; + + for (i = 0; i < agp_bridge.num_aperture_sizes; i++) { + + /* + * Dynamically calculate the proper num_entries and page_order + * values for the define aperture sizes. Take care not to + * shift off the end of values[i].size. + */ + values[i].num_entries = (values[i].size << 8) >> + (intel_i460_pageshift - 12); + values[i].page_order = log2((sizeof(u32)*values[i].num_entries) + >> PAGE_SHIFT); + } + + for (i = 0; i < agp_bridge.num_aperture_sizes; i++) { + /* Neglect control bits when matching up size_value */ + if ((temp & I460_AGPSIZ_MASK) == values[i].size_value) { + agp_bridge.previous_size = + agp_bridge.current_size = (void *) (values + i); + agp_bridge.aperture_size_idx = i; + return values[i].size; + } + } + + return 0; +} + +/* There isn't anything to do here since 460 has no GART TLB. */ +static void intel_i460_tlb_flush(agp_memory * mem) +{ + return; +} + +/* + * This utility function is needed to prevent corruption of the control bits + * which are stored along with the aperture size in 460's AGPSIZ register + */ +static void intel_i460_write_agpsiz(u8 size_value) +{ + u8 temp; + + pci_read_config_byte(agp_bridge.dev, INTEL_I460_AGPSIZ, &temp); + pci_write_config_byte(agp_bridge.dev, INTEL_I460_AGPSIZ, + ((temp & ~I460_AGPSIZ_MASK) | size_value)); +} + +static void intel_i460_cleanup(void) +{ + aper_size_info_8 *previous_size; + + previous_size = A_SIZE_8(agp_bridge.previous_size); + intel_i460_write_agpsiz(previous_size->size_value); + + if(intel_i460_cpk == 0) + { + vfree(i460_pg_detail); + vfree(i460_pg_count); + } +} + + +/* Control bits for Out-Of-GART coherency and Burst Write Combining */ +#define I460_GXBCTL_OOG (1UL << 0) +#define I460_GXBCTL_BWC (1UL << 2) + +static int intel_i460_configure(void) +{ + union { + u32 small[2]; + u64 large; + } temp; + u8 scratch; + int i; + + aper_size_info_8 *current_size; + + temp.large = 0; + + current_size = A_SIZE_8(agp_bridge.current_size); + intel_i460_write_agpsiz(current_size->size_value); + + /* + * Do the necessary rigmarole to read all eight bytes of APBASE. + * This has to be done since the AGP aperture can be above 4GB on + * 460 based systems. + */ + pci_read_config_dword(agp_bridge.dev, intel_i460_dynamic_apbase, + &(temp.small[0])); + pci_read_config_dword(agp_bridge.dev, intel_i460_dynamic_apbase + 4, + &(temp.small[1])); + + /* Clear BAR control bits */ + agp_bridge.gart_bus_addr = temp.large & ~((1UL << 3) - 1); + + pci_read_config_byte(agp_bridge.dev, INTEL_I460_GXBCTL, &scratch); + pci_write_config_byte(agp_bridge.dev, INTEL_I460_GXBCTL, + (scratch & 0x02) | I460_GXBCTL_OOG | I460_GXBCTL_BWC); + + /* + * Initialize partial allocation trackers if a GART page is bigger than + * a kernel page. + */ + if(I460_CPAGES_PER_KPAGE >= 1) { + intel_i460_cpk = 1; + } else { + intel_i460_cpk = 0; + + i460_pg_detail = (void *) vmalloc(sizeof(*i460_pg_detail) * + current_size->num_entries); + i460_pg_count = (void *) vmalloc(sizeof(*i460_pg_count) * + current_size->num_entries); + + for (i = 0; i < current_size->num_entries; i++) { + i460_pg_count[i] = 0; + i460_pg_detail[i] = NULL; + } + } + + return 0; +} + +static int intel_i460_create_gatt_table(void) { + + char *table; + int i; + int page_order; + int num_entries; + void *temp; + unsigned int read_back; + + /* + * Load up the fixed address of the GART SRAMS which hold our + * GATT table. + */ + table = (char *) __va(INTEL_I460_ATTBASE); + + temp = agp_bridge.current_size; + page_order = A_SIZE_8(temp)->page_order; + num_entries = A_SIZE_8(temp)->num_entries; + + agp_bridge.gatt_table_real = (u32 *) table; + agp_bridge.gatt_table = ioremap_nocache(virt_to_phys(table), + (PAGE_SIZE * (1 << page_order))); + agp_bridge.gatt_bus_addr = virt_to_phys(agp_bridge.gatt_table_real); + + for (i = 0; i < num_entries; i++) { + agp_bridge.gatt_table[i] = 0; + } + + /* + * The 460 spec says we have to read the last location written to + * make sure that all writes have taken effect + */ + read_back = agp_bridge.gatt_table[i - 1]; + + return 0; +} + +static int intel_i460_free_gatt_table(void) +{ + int num_entries; + int i; + void *temp; + unsigned int read_back; + + temp = agp_bridge.current_size; + + num_entries = A_SIZE_8(temp)->num_entries; + + for (i = 0; i < num_entries; i++) { + agp_bridge.gatt_table[i] = 0; + } + + /* + * The 460 spec says we have to read the last location written to + * make sure that all writes have taken effect + */ + read_back = agp_bridge.gatt_table[i - 1]; + + iounmap(agp_bridge.gatt_table); + + return 0; +} + +/* These functions are called when PAGE_SIZE exceeds the GART page size */ + +static int intel_i460_insert_memory_cpk(agp_memory * mem, + off_t pg_start, int type) +{ + int i, j, k, num_entries; + void *temp; + unsigned long paddr; + unsigned int read_back; + + /* + * The rest of the kernel will compute page offsets in terms of + * PAGE_SIZE. + */ + pg_start = I460_CPAGES_PER_KPAGE * pg_start; + + temp = agp_bridge.current_size; + num_entries = A_SIZE_8(temp)->num_entries; + + if((pg_start + I460_CPAGES_PER_KPAGE * mem->page_count) > num_entries) { + printk("[agpgart] Looks like we're out of AGP memory\n"); + return -EINVAL; + } + + j = pg_start; + while (j < (pg_start + I460_CPAGES_PER_KPAGE * mem->page_count)) { + if (!PGE_EMPTY(agp_bridge.gatt_table[j])) { + return -EBUSY; + } + j++; + } + +#if 0 + /* not necessary since 460 GART is operated in coherent mode... */ + + if (mem->is_flushed == FALSE) { + CACHE_FLUSH(); + mem->is_flushed = TRUE; + } +#endif + + for (i = 0, j = pg_start; i < mem->page_count; i++) { + + paddr = mem->memory[i]; + + for (k = 0; k < I460_CPAGES_PER_KPAGE; k++, j++, paddr += intel_i460_pagesize) + agp_bridge.gatt_table[j] = (unsigned int) + agp_bridge.mask_memory(paddr, mem->type); + } + + /* + * The 460 spec says we have to read the last location written to + * make sure that all writes have taken effect + */ + read_back = agp_bridge.gatt_table[j - 1]; + + return 0; +} + +static int intel_i460_remove_memory_cpk(agp_memory * mem, off_t pg_start, + int type) +{ + int i; + unsigned int read_back; + + pg_start = I460_CPAGES_PER_KPAGE * pg_start; + + for (i = pg_start; i < (pg_start + I460_CPAGES_PER_KPAGE * + mem->page_count); i++) + agp_bridge.gatt_table[i] = 0; + + /* + * The 460 spec says we have to read the last location written to + * make sure that all writes have taken effect + */ + read_back = agp_bridge.gatt_table[i - 1]; + + return 0; +} + +/* + * These functions are called when the GART page size exceeds PAGE_SIZE. + * + * This situation is interesting since AGP memory allocations that are + * smaller than a single GART page are possible. The structures i460_pg_count + * and i460_pg_detail track partial allocation of the large GART pages to + * work around this issue. + * + * i460_pg_count[pg_num] tracks the number of kernel pages in use within + * GART page pg_num. i460_pg_detail[pg_num] is an array containing a + * psuedo-GART entry for each of the aforementioned kernel pages. The whole + * of i460_pg_detail is equivalent to a giant GATT with page size equal to + * that of the kernel. + */ + +static void *intel_i460_alloc_large_page(int pg_num) +{ + int i; + void *bp, *bp_end; + struct page *page; + + i460_pg_detail[pg_num] = (void *) vmalloc(sizeof(u32) * + I460_KPAGES_PER_CPAGE); + if(i460_pg_detail[pg_num] == NULL) { + printk("[agpgart] Out of memory, we're in trouble...\n"); + return NULL; + } + + for(i = 0; i < I460_KPAGES_PER_CPAGE; i++) + i460_pg_detail[pg_num][i] = 0; + + bp = (void *) __get_free_pages(GFP_KERNEL, + intel_i460_pageshift - PAGE_SHIFT); + if(bp == NULL) { + printk("[agpgart] Couldn't alloc 4M GART page...\n"); + return NULL; + } + + bp_end = bp + ((PAGE_SIZE * + (1 << (intel_i460_pageshift - PAGE_SHIFT))) - 1); + + for (page = virt_to_page(bp); page <= virt_to_page(bp_end); page++) + { + atomic_inc(&page->count); + set_bit(PG_locked, &page->flags); + atomic_inc(&agp_bridge.current_memory_agp); + } + + return bp; +} + +static void intel_i460_free_large_page(int pg_num, unsigned long addr) +{ + struct page *page; + void *bp, *bp_end; + + bp = (void *) __va(addr); + bp_end = bp + (PAGE_SIZE * + (1 << (intel_i460_pageshift - PAGE_SHIFT))); + + vfree(i460_pg_detail[pg_num]); + i460_pg_detail[pg_num] = NULL; + + for (page = virt_to_page(bp); page < virt_to_page(bp_end); page++) + { + atomic_dec(&page->count); + clear_bit(PG_locked, &page->flags); + wake_up(&page->wait); + atomic_dec(&agp_bridge.current_memory_agp); + } + + free_pages((unsigned long) bp, intel_i460_pageshift - PAGE_SHIFT); +} + +static int intel_i460_insert_memory_kpc(agp_memory * mem, + off_t pg_start, int type) +{ + int i, pg, start_pg, end_pg, start_offset, end_offset, idx; + int num_entries; + void *temp; + unsigned int read_back; + unsigned long paddr; + + temp = agp_bridge.current_size; + num_entries = A_SIZE_8(temp)->num_entries; + + /* Figure out what pg_start means in terms of our large GART pages */ + start_pg = pg_start / I460_KPAGES_PER_CPAGE; + start_offset = pg_start % I460_KPAGES_PER_CPAGE; + end_pg = (pg_start + mem->page_count - 1) / + I460_KPAGES_PER_CPAGE; + end_offset = (pg_start + mem->page_count - 1) % + I460_KPAGES_PER_CPAGE; + + if(end_pg > num_entries) + { + printk("[agpgart] Looks like we're out of AGP memory\n"); + return -EINVAL; + } + + /* Check if the requested region of the aperture is free */ + for(pg = start_pg; pg <= end_pg; pg++) + { + /* Allocate new GART pages if necessary */ + if(i460_pg_detail[pg] == NULL) { + temp = intel_i460_alloc_large_page(pg); + if(temp == NULL) + return -ENOMEM; + agp_bridge.gatt_table[pg] = agp_bridge.mask_memory( + (unsigned long) temp, 0); + read_back = agp_bridge.gatt_table[pg]; + } + + for(idx = ((pg == start_pg) ? start_offset : 0); + idx < ((pg == end_pg) ? (end_offset + 1) + : I460_KPAGES_PER_CPAGE); + idx++) + { + if(i460_pg_detail[pg][idx] != 0) + return -EBUSY; + } + } + +#if 0 + /* not necessary since 460 GART is operated in coherent mode... */ + if (mem->is_flushed == FALSE) { + CACHE_FLUSH(); + mem->is_flushed = TRUE; + } +#endif + + for(pg = start_pg, i = 0; pg <= end_pg; pg++) + { + paddr = agp_bridge.unmask_memory(agp_bridge.gatt_table[pg]); + for(idx = ((pg == start_pg) ? start_offset : 0); + idx < ((pg == end_pg) ? (end_offset + 1) + : I460_KPAGES_PER_CPAGE); + idx++, i++) + { + mem->memory[i] = paddr + (idx * PAGE_SIZE); + i460_pg_detail[pg][idx] = + agp_bridge.mask_memory(mem->memory[i], mem->type); + + i460_pg_count[pg]++; + } + } + + return 0; +} + +static int intel_i460_remove_memory_kpc(agp_memory * mem, + off_t pg_start, int type) +{ + int i, pg, start_pg, end_pg, start_offset, end_offset, idx; + int num_entries; + void *temp; + unsigned int read_back; + unsigned long paddr; + + temp = agp_bridge.current_size; + num_entries = A_SIZE_8(temp)->num_entries; + + /* Figure out what pg_start means in terms of our large GART pages */ + start_pg = pg_start / I460_KPAGES_PER_CPAGE; + start_offset = pg_start % I460_KPAGES_PER_CPAGE; + end_pg = (pg_start + mem->page_count - 1) / + I460_KPAGES_PER_CPAGE; + end_offset = (pg_start + mem->page_count - 1) % + I460_KPAGES_PER_CPAGE; + + for(i = 0, pg = start_pg; pg <= end_pg; pg++) + { + for(idx = ((pg == start_pg) ? start_offset : 0); + idx < ((pg == end_pg) ? (end_offset + 1) + : I460_KPAGES_PER_CPAGE); + idx++, i++) + { + mem->memory[i] = 0; + i460_pg_detail[pg][idx] = 0; + i460_pg_count[pg]--; + } + + /* Free GART pages if they are unused */ + if(i460_pg_count[pg] == 0) { + paddr = agp_bridge.unmask_memory(agp_bridge.gatt_table[pg]); + agp_bridge.gatt_table[pg] = agp_bridge.scratch_page; + read_back = agp_bridge.gatt_table[pg]; + + intel_i460_free_large_page(pg, paddr); + } + } + + return 0; +} + +/* Dummy routines to call the approriate {cpk,kpc} function */ + +static int intel_i460_insert_memory(agp_memory * mem, + off_t pg_start, int type) +{ + if(intel_i460_cpk) + return intel_i460_insert_memory_cpk(mem, pg_start, type); + else + return intel_i460_insert_memory_kpc(mem, pg_start, type); +} + +static int intel_i460_remove_memory(agp_memory * mem, + off_t pg_start, int type) +{ + if(intel_i460_cpk) + return intel_i460_remove_memory_cpk(mem, pg_start, type); + else + return intel_i460_remove_memory_kpc(mem, pg_start, type); +} + +/* + * If the kernel page size is smaller that the chipset page size, we don't + * want to allocate memory until we know where it is to be bound in the + * aperture (a multi-kernel-page alloc might fit inside of an already + * allocated GART page). Consequently, don't allocate or free anything + * if i460_cpk (meaning chipset pages per kernel page) isn't set. + * + * Let's just hope nobody counts on the allocated AGP memory being there + * before bind time (I don't think current drivers do)... + */ +static unsigned long intel_i460_alloc_page(void) +{ + if(intel_i460_cpk) + return agp_generic_alloc_page(); - return(NULL); + /* Returning NULL would cause problems */ + return ((unsigned long) ~0UL); } -static int __init intel_i830_setup(struct pci_dev *i830_dev) +static void intel_i460_destroy_page(unsigned long page) { - intel_i830_private.i830_dev = i830_dev; + if(intel_i460_cpk) + agp_generic_destroy_page(page); +} - agp_bridge.masks = intel_i810_masks; - agp_bridge.num_of_masks = 3; - agp_bridge.aperture_sizes = (void *) intel_i830_sizes; - agp_bridge.size_type = FIXED_APER_SIZE; - agp_bridge.num_aperture_sizes = 2; +static gatt_mask intel_i460_masks[] = +{ + { + INTEL_I460_GATT_VALID | INTEL_I460_GATT_COHERENT, + 0 + } +}; - agp_bridge.dev_private_data = (void *) &intel_i830_private; - agp_bridge.needs_scratch_page = TRUE; +static unsigned long intel_i460_mask_memory(unsigned long addr, int type) +{ + /* Make sure the returned address is a valid GATT entry */ + return (agp_bridge.masks[0].mask | (((addr & + ~((1 << intel_i460_pageshift) - 1)) & 0xffffff000) >> 12)); +} - agp_bridge.configure = intel_i830_configure; - agp_bridge.fetch_size = intel_i830_fetch_size; - agp_bridge.cleanup = intel_i830_cleanup; - agp_bridge.tlb_flush = intel_i810_tlbflush; - agp_bridge.mask_memory = intel_i810_mask_memory; - agp_bridge.agp_enable = intel_i810_agp_enable; - agp_bridge.cache_flush = global_cache_flush; +static unsigned long intel_i460_unmask_memory(unsigned long addr) +{ + /* Turn a GATT entry into a physical address */ + return ((addr & 0xffffff) << 12); +} - agp_bridge.create_gatt_table = intel_i830_create_gatt_table; - agp_bridge.free_gatt_table = intel_i830_free_gatt_table; +static aper_size_info_8 intel_i460_sizes[3] = +{ + /* + * The 32GB aperture is only available with a 4M GART page size. + * Due to the dynamic GART page size, we can't figure out page_order + * or num_entries until runtime. + */ + {32768, 0, 0, 4}, + {1024, 0, 0, 2}, + {256, 0, 0, 1} +}; - agp_bridge.insert_memory = intel_i830_insert_entries; - agp_bridge.remove_memory = intel_i830_remove_entries; - agp_bridge.alloc_by_type = intel_i830_alloc_by_type; - agp_bridge.free_by_type = intel_i810_free_by_type; - agp_bridge.agp_alloc_page = agp_generic_alloc_page; - agp_bridge.agp_destroy_page = agp_generic_destroy_page; +static int __init intel_i460_setup (struct pci_dev *pdev) +{ - agp_bridge.suspend = agp_generic_suspend; - agp_bridge.resume = agp_generic_resume; - agp_bridge.cant_use_aperture = 0; + agp_bridge.masks = intel_i460_masks; + agp_bridge.aperture_sizes = (void *) intel_i460_sizes; + agp_bridge.size_type = U8_APER_SIZE; + agp_bridge.num_aperture_sizes = 3; + agp_bridge.dev_private_data = NULL; + agp_bridge.needs_scratch_page = FALSE; + agp_bridge.configure = intel_i460_configure; + agp_bridge.fetch_size = intel_i460_fetch_size; + agp_bridge.cleanup = intel_i460_cleanup; + agp_bridge.tlb_flush = intel_i460_tlb_flush; + agp_bridge.mask_memory = intel_i460_mask_memory; + agp_bridge.unmask_memory = intel_i460_unmask_memory; + agp_bridge.agp_enable = agp_generic_agp_enable; + agp_bridge.cache_flush = global_cache_flush; + agp_bridge.create_gatt_table = intel_i460_create_gatt_table; + agp_bridge.free_gatt_table = intel_i460_free_gatt_table; + agp_bridge.insert_memory = intel_i460_insert_memory; + agp_bridge.remove_memory = intel_i460_remove_memory; + agp_bridge.alloc_by_type = agp_generic_alloc_by_type; + agp_bridge.free_by_type = agp_generic_free_by_type; + agp_bridge.agp_alloc_page = intel_i460_alloc_page; + agp_bridge.agp_destroy_page = intel_i460_destroy_page; +#if 0 + agp_bridge.suspend = ??; + agp_bridge.resume = ??; +#endif + agp_bridge.cant_use_aperture = 1; - return(0); -} + return 0; -#endif /* CONFIG_AGP_I810 */ - - #ifdef CONFIG_AGP_INTEL + (void) pdev; /* unused */ +} -#endif /* CONFIG_AGP_I810 */ +#endif /* CONFIG_AGP_I460 */ #ifdef CONFIG_AGP_INTEL @@ -1801,7 +2508,6 @@ static int __init intel_generic_setup (struct pci_dev *pdev) { agp_bridge.masks = intel_generic_masks; - agp_bridge.num_of_masks = 1; agp_bridge.aperture_sizes = (void *) intel_generic_sizes; agp_bridge.size_type = U16_APER_SIZE; agp_bridge.num_aperture_sizes = 7; @@ -1812,6 +2518,7 @@ agp_bridge.cleanup = intel_cleanup; agp_bridge.tlb_flush = intel_tlbflush; agp_bridge.mask_memory = intel_mask_memory; + agp_bridge.unmask_memory = agp_generic_unmask_memory; agp_bridge.agp_enable = agp_generic_agp_enable; agp_bridge.cache_flush = global_cache_flush; agp_bridge.create_gatt_table = agp_generic_create_gatt_table; @@ -1832,11 +2539,9 @@ } - static int __init intel_820_setup (struct pci_dev *pdev) { agp_bridge.masks = intel_generic_masks; - agp_bridge.num_of_masks = 1; agp_bridge.aperture_sizes = (void *) intel_8xx_sizes; agp_bridge.size_type = U8_APER_SIZE; agp_bridge.num_aperture_sizes = 7; @@ -1869,7 +2574,6 @@ static int __init intel_830mp_setup (struct pci_dev *pdev) { agp_bridge.masks = intel_generic_masks; - agp_bridge.num_of_masks = 1; agp_bridge.aperture_sizes = (void *) intel_830mp_sizes; agp_bridge.size_type = U8_APER_SIZE; agp_bridge.num_aperture_sizes = 4; @@ -1901,7 +2605,6 @@ static int __init intel_840_setup (struct pci_dev *pdev) { agp_bridge.masks = intel_generic_masks; - agp_bridge.num_of_masks = 1; agp_bridge.aperture_sizes = (void *) intel_8xx_sizes; agp_bridge.size_type = U8_APER_SIZE; agp_bridge.num_aperture_sizes = 7; @@ -1934,7 +2637,6 @@ static int __init intel_845_setup (struct pci_dev *pdev) { agp_bridge.masks = intel_generic_masks; - agp_bridge.num_of_masks = 1; agp_bridge.aperture_sizes = (void *) intel_8xx_sizes; agp_bridge.size_type = U8_APER_SIZE; agp_bridge.num_aperture_sizes = 7; @@ -1945,6 +2647,7 @@ agp_bridge.cleanup = intel_8xx_cleanup; agp_bridge.tlb_flush = intel_8xx_tlbflush; agp_bridge.mask_memory = intel_mask_memory; + agp_bridge.unmask_memory = agp_generic_unmask_memory; agp_bridge.agp_enable = agp_generic_agp_enable; agp_bridge.cache_flush = global_cache_flush; agp_bridge.create_gatt_table = agp_generic_create_gatt_table; @@ -1967,7 +2670,6 @@ static int __init intel_850_setup (struct pci_dev *pdev) { agp_bridge.masks = intel_generic_masks; - agp_bridge.num_of_masks = 1; agp_bridge.aperture_sizes = (void *) intel_8xx_sizes; agp_bridge.size_type = U8_APER_SIZE; agp_bridge.num_aperture_sizes = 7; @@ -1978,6 +2680,7 @@ agp_bridge.cleanup = intel_8xx_cleanup; agp_bridge.tlb_flush = intel_8xx_tlbflush; agp_bridge.mask_memory = intel_mask_memory; + agp_bridge.unmask_memory = agp_generic_unmask_memory; agp_bridge.agp_enable = agp_generic_agp_enable; agp_bridge.cache_flush = global_cache_flush; agp_bridge.create_gatt_table = agp_generic_create_gatt_table; @@ -2000,7 +2703,6 @@ static int __init intel_860_setup (struct pci_dev *pdev) { agp_bridge.masks = intel_generic_masks; - agp_bridge.num_of_masks = 1; agp_bridge.aperture_sizes = (void *) intel_8xx_sizes; agp_bridge.size_type = U8_APER_SIZE; agp_bridge.num_aperture_sizes = 7; @@ -2120,7 +2822,6 @@ static int __init via_generic_setup (struct pci_dev *pdev) { agp_bridge.masks = via_generic_masks; - agp_bridge.num_of_masks = 1; agp_bridge.aperture_sizes = (void *) via_generic_sizes; agp_bridge.size_type = U8_APER_SIZE; agp_bridge.num_aperture_sizes = 7; @@ -2131,6 +2832,7 @@ agp_bridge.cleanup = via_cleanup; agp_bridge.tlb_flush = via_tlbflush; agp_bridge.mask_memory = via_mask_memory; + agp_bridge.unmask_memory = agp_generic_unmask_memory; agp_bridge.agp_enable = agp_generic_agp_enable; agp_bridge.cache_flush = global_cache_flush; agp_bridge.create_gatt_table = agp_generic_create_gatt_table; @@ -2234,7 +2936,6 @@ static int __init sis_generic_setup (struct pci_dev *pdev) { agp_bridge.masks = sis_generic_masks; - agp_bridge.num_of_masks = 1; agp_bridge.aperture_sizes = (void *) sis_generic_sizes; agp_bridge.size_type = U8_APER_SIZE; agp_bridge.num_aperture_sizes = 7; @@ -2245,6 +2946,7 @@ agp_bridge.cleanup = sis_cleanup; agp_bridge.tlb_flush = sis_tlbflush; agp_bridge.mask_memory = sis_mask_memory; + agp_bridge.unmask_memory = agp_generic_unmask_memory; agp_bridge.agp_enable = agp_generic_agp_enable; agp_bridge.cache_flush = global_cache_flush; agp_bridge.create_gatt_table = agp_generic_create_gatt_table; @@ -2267,8 +2969,8 @@ #ifdef CONFIG_AGP_AMD typedef struct _amd_page_map { - unsigned long *real; - unsigned long *remapped; + u32 *real; + u32 *remapped; } amd_page_map; static struct _amd_irongate_private { @@ -2281,7 +2983,7 @@ { int i; - page_map->real = (unsigned long *) __get_free_page(GFP_KERNEL); + page_map->real = (u32 *) __get_free_page(GFP_KERNEL); if (page_map->real == NULL) { return -ENOMEM; } @@ -2536,7 +3238,7 @@ off_t pg_start, int type) { int i, j, num_entries; - unsigned long *cur_gatt; + u32 *cur_gatt; unsigned long addr; num_entries = A_SIZE_LVL2(agp_bridge.current_size)->num_entries; @@ -2566,7 +3268,8 @@ for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { addr = (j * PAGE_SIZE) + agp_bridge.gart_bus_addr; cur_gatt = GET_GATT(addr); - cur_gatt[GET_GATT_OFF(addr)] = mem->memory[i]; + cur_gatt[GET_GATT_OFF(addr)] = + agp_bridge.mask_memory(mem->memory[i], mem->type); } agp_bridge.tlb_flush(mem); return 0; @@ -2576,7 +3279,7 @@ int type) { int i; - unsigned long *cur_gatt; + u32 *cur_gatt; unsigned long addr; if (type != 0 || mem->type != 0) { @@ -2612,7 +3315,6 @@ static int __init amd_irongate_setup (struct pci_dev *pdev) { agp_bridge.masks = amd_irongate_masks; - agp_bridge.num_of_masks = 1; agp_bridge.aperture_sizes = (void *) amd_irongate_sizes; agp_bridge.size_type = LVL2_APER_SIZE; agp_bridge.num_aperture_sizes = 7; @@ -2623,6 +3325,7 @@ agp_bridge.cleanup = amd_irongate_cleanup; agp_bridge.tlb_flush = amd_irongate_tlbflush; agp_bridge.mask_memory = amd_irongate_mask_memory; + agp_bridge.unmask_memory = agp_generic_unmask_memory; agp_bridge.agp_enable = agp_generic_agp_enable; agp_bridge.cache_flush = global_cache_flush; agp_bridge.create_gatt_table = amd_create_gatt_table; @@ -2860,7 +3563,6 @@ static int __init ali_generic_setup (struct pci_dev *pdev) { agp_bridge.masks = ali_generic_masks; - agp_bridge.num_of_masks = 1; agp_bridge.aperture_sizes = (void *) ali_generic_sizes; agp_bridge.size_type = U32_APER_SIZE; agp_bridge.num_aperture_sizes = 7; @@ -2871,6 +3573,7 @@ agp_bridge.cleanup = ali_cleanup; agp_bridge.tlb_flush = ali_tlbflush; agp_bridge.mask_memory = ali_mask_memory; + agp_bridge.unmask_memory = agp_generic_unmask_memory; agp_bridge.agp_enable = agp_generic_agp_enable; agp_bridge.cache_flush = ali_cache_flush; agp_bridge.create_gatt_table = agp_generic_create_gatt_table; @@ -3268,7 +3971,8 @@ for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { addr = (j * PAGE_SIZE) + agp_bridge.gart_bus_addr; cur_gatt = SVRWRKS_GET_GATT(addr); - cur_gatt[GET_GATT_OFF(addr)] = mem->memory[i]; + cur_gatt[GET_GATT_OFF(addr)] = + agp_bridge.mask_memory(mem->memory[i], mem->type); } agp_bridge.tlb_flush(mem); return 0; @@ -3426,8 +4130,18 @@ * command registers. */ - while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, - device)) != NULL) { + + pci_for_each_dev(device) + { + /* + * Enable AGP devices. Most will be VGA display but + * some may be coprocessors on non VGA devices too + */ + + if((((device->class >> 16) & 0xFF) != PCI_BASE_CLASS_DISPLAY) && + (device->class != (PCI_CLASS_PROCESSOR_CO << 8))) + continue; + pci_read_config_dword(device, 0x04, &scratch); if (!(scratch & 0x00100000)) @@ -3458,7 +4172,6 @@ serverworks_private.svrwrks_dev = pdev; agp_bridge.masks = serverworks_masks; - agp_bridge.num_of_masks = 1; agp_bridge.aperture_sizes = (void *) serverworks_sizes; agp_bridge.size_type = LVL2_APER_SIZE; agp_bridge.num_aperture_sizes = 7; @@ -3522,6 +4235,364 @@ #endif /* CONFIG_AGP_SWORKS */ +#ifdef CONFIG_AGP_HP_ZX1 + +#ifndef log2 +#define log2(x) ffz(~(x)) +#endif + +#define HP_ZX1_IOVA_BASE GB(1UL) +#define HP_ZX1_IOVA_SIZE GB(1UL) +#define HP_ZX1_GART_SIZE (HP_ZX1_IOVA_SIZE / 2) +#define HP_ZX1_SBA_IOMMU_COOKIE 0x0000badbadc0ffeeUL + +#define HP_ZX1_PDIR_VALID_BIT 0x8000000000000000UL +#define HP_ZX1_IOVA_TO_PDIR(va) ((va - hp_private.iova_base) >> \ + hp_private.io_tlb_shift) + +static aper_size_info_fixed hp_zx1_sizes[] = +{ + {0, 0, 0}, /* filled in by hp_zx1_fetch_size() */ +}; + +static struct _hp_private { + struct pci_dev *ioc; + volatile u8 *registers; + u64 *io_pdir; // PDIR for entire IOVA + u64 *gatt; // PDIR just for GART (subset of above) + u64 gatt_entries; + u64 iova_base; + u64 gart_base; + u64 gart_size; + u64 io_pdir_size; + int io_pdir_owner; // do we own it, or share it with sba_iommu? + int io_page_size; + int io_tlb_shift; + int io_tlb_ps; // IOC ps config + int io_pages_per_kpage; + u8 ioc_rev; +} hp_private; + +static int __init hp_zx1_ioc_shared(void) +{ + struct _hp_private *hp = &hp_private; + + printk(KERN_INFO PFX "HP ZX1 IOC: IOPDIR shared with sba_iommu\n"); + + /* + * IOC already configured by sba_iommu module; just use + * its setup. We assume: + * - IOVA space is 1Gb in size + * - first 512Mb is IOMMU, second 512Mb is GART + */ + hp->io_tlb_ps = INREG64(hp->registers, HP_ZX1_TCNFG); + switch (hp->io_tlb_ps) { + case 0: hp->io_tlb_shift = 12; break; + case 1: hp->io_tlb_shift = 13; break; + case 2: hp->io_tlb_shift = 14; break; + case 3: hp->io_tlb_shift = 16; break; + default: + printk(KERN_ERR PFX "Invalid IOTLB page size " + "configuration 0x%x\n", hp->io_tlb_ps); + hp->gatt = 0; + hp->gatt_entries = 0; + return -ENODEV; + } + hp->io_page_size = 1 << hp->io_tlb_shift; + hp->io_pages_per_kpage = PAGE_SIZE / hp->io_page_size; + + hp->iova_base = INREG64(hp->registers, HP_ZX1_IBASE) & ~0x1; + hp->gart_base = hp->iova_base + HP_ZX1_IOVA_SIZE - HP_ZX1_GART_SIZE; + + hp->gart_size = HP_ZX1_GART_SIZE; + hp->gatt_entries = hp->gart_size / hp->io_page_size; + + hp->io_pdir = phys_to_virt(INREG64(hp->registers, HP_ZX1_PDIR_BASE)); + hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)]; + + if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) { + hp->gatt = 0; + hp->gatt_entries = 0; + printk(KERN_ERR PFX "No reserved IO PDIR entry found; " + "GART disabled\n"); + return -ENODEV; + } + + return 0; +} + +static int __init hp_zx1_ioc_owner(void) +{ + struct _hp_private *hp = &hp_private; + + printk(KERN_INFO PFX "HP ZX1 IOC: IOPDIR dedicated to GART\n"); + + /* + * Select an IOV page size no larger than system page size. + */ + if (PAGE_SIZE >= KB(64)) { + hp->io_tlb_shift = 16; + hp->io_tlb_ps = 3; + } else if (PAGE_SIZE >= KB(16)) { + hp->io_tlb_shift = 14; + hp->io_tlb_ps = 2; + } else if (PAGE_SIZE >= KB(8)) { + hp->io_tlb_shift = 13; + hp->io_tlb_ps = 1; + } else { + hp->io_tlb_shift = 12; + hp->io_tlb_ps = 0; + } + hp->io_page_size = 1 << hp->io_tlb_shift; + hp->io_pages_per_kpage = PAGE_SIZE / hp->io_page_size; + + hp->iova_base = HP_ZX1_IOVA_BASE; + hp->gart_size = HP_ZX1_GART_SIZE; + hp->gart_base = hp->iova_base + HP_ZX1_IOVA_SIZE - hp->gart_size; + + hp->gatt_entries = hp->gart_size / hp->io_page_size; + hp->io_pdir_size = (HP_ZX1_IOVA_SIZE / hp->io_page_size) * sizeof(u64); + + return 0; +} + +static int __init hp_zx1_ioc_init(void) +{ + struct _hp_private *hp = &hp_private; + struct pci_dev *ioc; + int i; + + ioc = pci_find_device(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_ZX1_IOC, NULL); + if (!ioc) { + printk(KERN_ERR PFX "Detected HP ZX1 AGP bridge but no IOC\n"); + return -ENODEV; + } + hp->ioc = ioc; + + pci_read_config_byte(ioc, PCI_REVISION_ID, &hp->ioc_rev); + + for (i = 0; i < PCI_NUM_RESOURCES; i++) { + if (pci_resource_flags(ioc, i) == IORESOURCE_MEM) { + hp->registers = (u8 *) ioremap(pci_resource_start(ioc, + i), + pci_resource_len(ioc, i)); + break; + } + } + if (!hp->registers) { + printk(KERN_ERR PFX "Detected HP ZX1 AGP bridge but no CSRs\n"); + + return -ENODEV; + } + + /* + * If the IOTLB is currently disabled, we can take it over. + * Otherwise, we have to share with sba_iommu. + */ + hp->io_pdir_owner = (INREG64(hp->registers, HP_ZX1_IBASE) & 0x1) == 0; + + if (hp->io_pdir_owner) + return hp_zx1_ioc_owner(); + + return hp_zx1_ioc_shared(); +} + +static int hp_zx1_fetch_size(void) +{ + int size; + + size = hp_private.gart_size / MB(1); + hp_zx1_sizes[0].size = size; + agp_bridge.current_size = (void *) &hp_zx1_sizes[0]; + return size; +} + +static int hp_zx1_configure(void) +{ + struct _hp_private *hp = &hp_private; + + agp_bridge.gart_bus_addr = hp->gart_base; + agp_bridge.capndx = pci_find_capability(agp_bridge.dev, PCI_CAP_ID_AGP); + pci_read_config_dword(agp_bridge.dev, + agp_bridge.capndx + PCI_AGP_STATUS, &agp_bridge.mode); + + if (hp->io_pdir_owner) { + OUTREG64(hp->registers, HP_ZX1_PDIR_BASE, + virt_to_phys(hp->io_pdir)); + OUTREG64(hp->registers, HP_ZX1_TCNFG, hp->io_tlb_ps); + OUTREG64(hp->registers, HP_ZX1_IMASK, ~(HP_ZX1_IOVA_SIZE - 1)); + OUTREG64(hp->registers, HP_ZX1_IBASE, hp->iova_base | 0x1); + OUTREG64(hp->registers, HP_ZX1_PCOM, + hp->iova_base | log2(HP_ZX1_IOVA_SIZE)); + INREG64(hp->registers, HP_ZX1_PCOM); + } + + return 0; +} + +static void hp_zx1_cleanup(void) +{ + struct _hp_private *hp = &hp_private; + + if (hp->io_pdir_owner) + OUTREG64(hp->registers, HP_ZX1_IBASE, 0); + iounmap((void *) hp->registers); +} + +static void hp_zx1_tlbflush(agp_memory * mem) +{ + struct _hp_private *hp = &hp_private; + + OUTREG64(hp->registers, HP_ZX1_PCOM, + hp->gart_base | log2(hp->gart_size)); + INREG64(hp->registers, HP_ZX1_PCOM); +} + +static int hp_zx1_create_gatt_table(void) +{ + struct _hp_private *hp = &hp_private; + int i; + + if (hp->io_pdir_owner) { + hp->io_pdir = (u64 *) __get_free_pages(GFP_KERNEL, + get_order(hp->io_pdir_size)); + if (!hp->io_pdir) { + printk(KERN_ERR PFX "Couldn't allocate contiguous " + "memory for I/O PDIR\n"); + hp->gatt = 0; + hp->gatt_entries = 0; + return -ENOMEM; + } + memset(hp->io_pdir, 0, hp->io_pdir_size); + + hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)]; + } + + for (i = 0; i < hp->gatt_entries; i++) { + hp->gatt[i] = (unsigned long) agp_bridge.scratch_page; + } + + return 0; +} + +static int hp_zx1_free_gatt_table(void) +{ + struct _hp_private *hp = &hp_private; + + if (hp->io_pdir_owner) + free_pages((unsigned long) hp->io_pdir, + get_order(hp->io_pdir_size)); + else + hp->gatt[0] = HP_ZX1_SBA_IOMMU_COOKIE; + return 0; +} + +static int hp_zx1_insert_memory(agp_memory * mem, off_t pg_start, int type) +{ + struct _hp_private *hp = &hp_private; + int i, k; + off_t j, io_pg_start; + int io_pg_count; + + if (type != 0 || mem->type != 0) { + return -EINVAL; + } + + io_pg_start = hp->io_pages_per_kpage * pg_start; + io_pg_count = hp->io_pages_per_kpage * mem->page_count; + if ((io_pg_start + io_pg_count) > hp->gatt_entries) { + return -EINVAL; + } + + j = io_pg_start; + while (j < (io_pg_start + io_pg_count)) { + if (hp->gatt[j]) { + return -EBUSY; + } + j++; + } + +#if 0 + /* Not necessary since zx1 agp is coherent */ + if (mem->is_flushed == FALSE) { + CACHE_FLUSH(); + mem->is_flushed = TRUE; + } +#endif + + for (i = 0, j = io_pg_start; i < mem->page_count; i++) { + unsigned long paddr; + + paddr = mem->memory[i]; + for (k = 0; + k < hp->io_pages_per_kpage; + k++, j++, paddr += hp->io_page_size) { + hp->gatt[j] = agp_bridge.mask_memory(paddr, type); + } + } + + agp_bridge.tlb_flush(mem); + return 0; +} + +static int hp_zx1_remove_memory(agp_memory * mem, off_t pg_start, int type) +{ + struct _hp_private *hp = &hp_private; + int i, io_pg_start, io_pg_count; + + if (type != 0 || mem->type != 0) { + return -EINVAL; + } + + io_pg_start = hp->io_pages_per_kpage * pg_start; + io_pg_count = hp->io_pages_per_kpage * mem->page_count; + for (i = io_pg_start; i < io_pg_count + io_pg_start; i++) { + hp->gatt[i] = agp_bridge.scratch_page; + } + + agp_bridge.tlb_flush(mem); + return 0; +} + +static unsigned long hp_zx1_mask_memory(unsigned long addr, int type) +{ + return HP_ZX1_PDIR_VALID_BIT | addr; +} + +static unsigned long hp_zx1_unmask_memory(unsigned long addr) +{ + return addr & ~(HP_ZX1_PDIR_VALID_BIT); +} + +static int __init hp_zx1_setup (struct pci_dev *pdev) +{ + agp_bridge.dev_private_data = NULL; + agp_bridge.size_type = FIXED_APER_SIZE; + agp_bridge.needs_scratch_page = FALSE; + agp_bridge.configure = hp_zx1_configure; + agp_bridge.fetch_size = hp_zx1_fetch_size; + agp_bridge.cleanup = hp_zx1_cleanup; + agp_bridge.tlb_flush = hp_zx1_tlbflush; + agp_bridge.mask_memory = hp_zx1_mask_memory; + agp_bridge.unmask_memory = hp_zx1_unmask_memory; + agp_bridge.agp_enable = agp_generic_agp_enable; + agp_bridge.cache_flush = global_cache_flush; + agp_bridge.create_gatt_table = hp_zx1_create_gatt_table; + agp_bridge.free_gatt_table = hp_zx1_free_gatt_table; + agp_bridge.insert_memory = hp_zx1_insert_memory; + agp_bridge.remove_memory = hp_zx1_remove_memory; + agp_bridge.alloc_by_type = agp_generic_alloc_by_type; + agp_bridge.free_by_type = agp_generic_free_by_type; + agp_bridge.agp_alloc_page = agp_generic_alloc_page; + agp_bridge.agp_destroy_page = agp_generic_destroy_page; + agp_bridge.cant_use_aperture = 1; + + return hp_zx1_ioc_init(); + + (void) pdev; /* unused */ +} + +#endif /* CONFIG_AGP_HP_ZX1 */ /* per-chipset initialization data. * note -- all chipsets for a single vendor MUST be grouped together @@ -3695,6 +4766,15 @@ #endif /* CONFIG_AGP_INTEL */ +#ifdef CONFIG_AGP_I460 + { PCI_DEVICE_ID_INTEL_460GX, + PCI_VENDOR_ID_INTEL, + INTEL_460GX, + "Intel", + "460GX", + intel_i460_setup }, +#endif + #ifdef CONFIG_AGP_SIS { PCI_DEVICE_ID_SI_740, PCI_VENDOR_ID_SI, @@ -3815,6 +4895,15 @@ via_generic_setup }, #endif /* CONFIG_AGP_VIA */ +#ifdef CONFIG_AGP_HP_ZX1 + { PCI_DEVICE_ID_HP_ZX1_LBA, + PCI_VENDOR_ID_HP, + HP_ZX1, + "HP", + "ZX1", + hp_zx1_setup }, +#endif + { 0, }, /* dummy final entry, always present */ }; @@ -3893,6 +4982,18 @@ return -ENODEV; } +static int agp_check_supported_device(struct pci_dev *dev) { + + int i; + + for(i = 0; i < ARRAY_SIZE (agp_bridge_info); i++) { + if(dev->vendor == agp_bridge_info[i].vendor_id && + dev->device == agp_bridge_info[i].device_id) + return 1; + } + + return 0; +} /* Supported Device Scanning routine */ @@ -3902,8 +5003,14 @@ u8 cap_ptr = 0x00; u32 cap_id, scratch; - if ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) == NULL) - return -ENODEV; + /* + * Some systems have multiple host bridges (i.e. BigSur), so + * we can't just use the first one we find. + */ + do { + if ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev)) == NULL) + return -ENODEV; + } while(!agp_check_supported_device(dev)); agp_bridge.dev = dev; @@ -4041,6 +5148,23 @@ #endif /* CONFIG_AGP_SWORKS */ +#ifdef CONFIG_AGP_HP_ZX1 + if (dev->vendor == PCI_VENDOR_ID_HP) { + do { + /* ZX1 LBAs can be either PCI or AGP bridges */ + if (pci_find_capability(dev, PCI_CAP_ID_AGP)) { + printk(KERN_INFO PFX "Detected HP ZX1 AGP " + "chipset at %s\n", dev->slot_name); + agp_bridge.type = HP_ZX1; + agp_bridge.dev = dev; + return hp_zx1_setup(dev); + } + dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev); + } while (dev); + return -ENODEV; + } +#endif /* CONFIG_AGP_HP_ZX1 */ + /* find capndx */ pci_read_config_dword(dev, 0x04, &scratch); if (!(scratch & 0x00100000)) @@ -4091,7 +5215,7 @@ { long memory, index, result; - memory = virt_to_phys(high_memory) >> 20; + memory = (num_physpages << PAGE_SHIFT) >> 20; index = 1; while ((memory > maxes_table[index].mem) && diff -urN linux-2.4.18/drivers/char/drm/ati_pcigart.h lia64-2.4/drivers/char/drm/ati_pcigart.h --- linux-2.4.18/drivers/char/drm/ati_pcigart.h Mon Nov 26 11:18:32 2001 +++ lia64-2.4/drivers/char/drm/ati_pcigart.h Fri Jul 19 18:26:38 2002 @@ -30,14 +30,20 @@ #define __NO_VERSION__ #include "drmP.h" -#if PAGE_SIZE == 8192 +#if PAGE_SIZE == 65536 +# define ATI_PCIGART_TABLE_ORDER 0 +# define ATI_PCIGART_TABLE_PAGES (1 << 0) +#elif PAGE_SIZE == 16384 +# define ATI_PCIGART_TABLE_ORDER 1 +# define ATI_PCIGART_TABLE_PAGES (1 << 1) +#elif PAGE_SIZE == 8192 # define ATI_PCIGART_TABLE_ORDER 2 # define ATI_PCIGART_TABLE_PAGES (1 << 2) #elif PAGE_SIZE == 4096 # define ATI_PCIGART_TABLE_ORDER 3 # define ATI_PCIGART_TABLE_PAGES (1 << 3) #else -# error - PAGE_SIZE not 8K or 4K +# error - PAGE_SIZE not 64K, 16K, 8K or 4K #endif # define ATI_MAX_PCIGART_PAGES 8192 /* 32 MB aperture, 4K pages */ @@ -103,6 +109,7 @@ goto done; } +#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) if ( !dev->pdev ) { DRM_ERROR( "PCI device unknown!\n" ); goto done; @@ -117,6 +124,9 @@ address = 0; goto done; } +#else + bus_address = virt_to_bus( (void *)address ); +#endif pci_gart = (u32 *)address; @@ -126,6 +136,7 @@ memset( pci_gart, 0, ATI_MAX_PCIGART_PAGES * sizeof(u32) ); for ( i = 0 ; i < pages ; i++ ) { +#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) /* we need to support large memory configurations */ entry->busaddr[i] = pci_map_single(dev->pdev, page_address( entry->pagelist[i] ), @@ -139,7 +150,9 @@ goto done; } page_base = (u32) entry->busaddr[i]; - +#else + page_base = page_to_bus( entry->pagelist[i] ); +#endif for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) { *pci_gart++ = cpu_to_le32( page_base ); page_base += ATI_PCIGART_PAGE_SIZE; @@ -164,6 +177,7 @@ unsigned long addr, dma_addr_t bus_addr) { +#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) drm_sg_mem_t *entry = dev->sg; unsigned long pages; int i; @@ -188,6 +202,8 @@ PAGE_SIZE, PCI_DMA_TODEVICE); } } + +#endif if ( addr ) { DRM(ati_free_pcigart_table)( addr ); diff -urN linux-2.4.18/drivers/char/drm/drmP.h lia64-2.4/drivers/char/drm/drmP.h --- linux-2.4.18/drivers/char/drm/drmP.h Mon Nov 5 18:28:46 2001 +++ lia64-2.4/drivers/char/drm/drmP.h Fri Jul 19 18:26:38 2002 @@ -366,13 +366,13 @@ if (len > DRM_PROC_LIMIT) { ret; *eof = 1; return len - offset; } /* Mapping helper macros */ -#define DRM_IOREMAP(map) \ - (map)->handle = DRM(ioremap)( (map)->offset, (map)->size ) +#define DRM_IOREMAP(map, dev) \ + (map)->handle = DRM(ioremap)( (map)->offset, (map)->size, (dev) ) -#define DRM_IOREMAPFREE(map) \ +#define DRM_IOREMAPFREE(map, dev) \ do { \ if ( (map)->handle && (map)->size ) \ - DRM(ioremapfree)( (map)->handle, (map)->size ); \ + DRM(ioremapfree)( (map)->handle, (map)->size, (dev) ); \ } while (0) #define DRM_FIND_MAP(_map, _o) \ @@ -826,8 +826,8 @@ extern unsigned long DRM(alloc_pages)(int order, int area); extern void DRM(free_pages)(unsigned long address, int order, int area); -extern void *DRM(ioremap)(unsigned long offset, unsigned long size); -extern void DRM(ioremapfree)(void *pt, unsigned long size); +extern void *DRM(ioremap)(unsigned long offset, unsigned long size, drm_device_t *dev); +extern void DRM(ioremapfree)(void *pt, unsigned long size, drm_device_t *dev); #if __REALLY_HAVE_AGP extern agp_memory *DRM(alloc_agp)(int pages, u32 type); diff -urN linux-2.4.18/drivers/char/drm/drm_agpsupport.h lia64-2.4/drivers/char/drm/drm_agpsupport.h --- linux-2.4.18/drivers/char/drm/drm_agpsupport.h Mon Nov 26 11:18:32 2001 +++ lia64-2.4/drivers/char/drm/drm_agpsupport.h Fri Jul 19 18:26:38 2002 @@ -277,6 +277,7 @@ case INTEL_I840: head->chipset = "Intel i840"; break; case INTEL_I845: head->chipset = "Intel i845"; break; case INTEL_I850: head->chipset = "Intel i850"; break; + case INTEL_460GX: head->chipset = "Intel 460GX"; break; #endif case VIA_GENERIC: head->chipset = "VIA"; break; @@ -315,6 +316,8 @@ case SVWRKS_GENERIC: head->chipset = "Serverworks Generic"; break; #endif + + case HP_ZX1: head->chipset = "HP ZX1"; break; default: head->chipset = "Unknown"; break; } diff -urN linux-2.4.18/drivers/char/drm/drm_bufs.h lia64-2.4/drivers/char/drm/drm_bufs.h --- linux-2.4.18/drivers/char/drm/drm_bufs.h Fri Aug 10 18:14:41 2001 +++ lia64-2.4/drivers/char/drm/drm_bufs.h Fri Jul 19 18:26:38 2002 @@ -107,7 +107,7 @@ switch ( map->type ) { case _DRM_REGISTERS: case _DRM_FRAME_BUFFER: -#if !defined(__sparc__) && !defined(__alpha__) +#if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__) if ( map->offset + map->size < map->offset || map->offset < virt_to_phys(high_memory) ) { DRM(free)( map, sizeof(*map), DRM_MEM_MAPS ); @@ -124,7 +124,7 @@ MTRR_TYPE_WRCOMB, 1 ); } #endif - map->handle = DRM(ioremap)( map->offset, map->size ); + map->handle = DRM(ioremap)( map->offset, map->size, dev ); break; case _DRM_SHM: @@ -249,7 +249,7 @@ DRM_DEBUG("mtrr_del = %d\n", retcode); } #endif - DRM(ioremapfree)(map->handle, map->size); + DRM(ioremapfree)(map->handle, map->size, dev); break; case _DRM_SHM: vfree(map->handle); diff -urN linux-2.4.18/drivers/char/drm/drm_drv.h lia64-2.4/drivers/char/drm/drm_drv.h --- linux-2.4.18/drivers/char/drm/drm_drv.h Wed Oct 24 10:17:46 2001 +++ lia64-2.4/drivers/char/drm/drm_drv.h Wed Oct 24 10:24:23 2001 @@ -439,7 +439,7 @@ DRM_DEBUG( "mtrr_del=%d\n", retcode ); } #endif - DRM(ioremapfree)( map->handle, map->size ); + DRM(ioremapfree)( map->handle, map->size, dev ); break; case _DRM_SHM: vfree(map->handle); diff -urN linux-2.4.18/drivers/char/drm/drm_memory.h lia64-2.4/drivers/char/drm/drm_memory.h --- linux-2.4.18/drivers/char/drm/drm_memory.h Fri Aug 10 18:14:41 2001 +++ lia64-2.4/drivers/char/drm/drm_memory.h Fri Jul 19 18:26:38 2002 @@ -306,9 +306,14 @@ } } -void *DRM(ioremap)(unsigned long offset, unsigned long size) +void *DRM(ioremap)(unsigned long offset, unsigned long size, drm_device_t *dev) { void *pt; +#if __REALLY_HAVE_AGP + drm_map_t *map = NULL; + drm_map_list_t *r_list; + struct list_head *list; +#endif if (!size) { DRM_MEM_ERROR(DRM_MEM_MAPPINGS, @@ -316,12 +321,51 @@ return NULL; } +#if __REALLY_HAVE_AGP + if(!dev->agp || dev->agp->cant_use_aperture == 0) + goto standard_ioremap; + + list_for_each(list, &dev->maplist->head) { + r_list = (drm_map_list_t *)list; + map = r_list->map; + if (!map) continue; + if (map->offset <= offset && + (map->offset + map->size) >= (offset + size)) + break; + } + + if(map && map->type == _DRM_AGP) { + struct drm_agp_mem *agpmem; + + for(agpmem = dev->agp->memory; agpmem; + agpmem = agpmem->next) { + if(agpmem->bound <= offset && + (agpmem->bound + (agpmem->pages + << PAGE_SHIFT)) >= (offset + size)) + break; + } + + if(agpmem == NULL) + goto ioremap_failure; + + pt = agpmem->memory->vmptr + (offset - agpmem->bound); + goto ioremap_success; + } + +standard_ioremap: +#endif if (!(pt = ioremap(offset, size))) { +#if __REALLY_HAVE_AGP +ioremap_failure: +#endif spin_lock(&DRM(mem_lock)); ++DRM(mem_stats)[DRM_MEM_MAPPINGS].fail_count; spin_unlock(&DRM(mem_lock)); return NULL; } +#if __REALLY_HAVE_AGP +ioremap_success: +#endif spin_lock(&DRM(mem_lock)); ++DRM(mem_stats)[DRM_MEM_MAPPINGS].succeed_count; DRM(mem_stats)[DRM_MEM_MAPPINGS].bytes_allocated += size; @@ -329,7 +373,7 @@ return pt; } -void DRM(ioremapfree)(void *pt, unsigned long size) +void DRM(ioremapfree)(void *pt, unsigned long size, drm_device_t *dev) { int alloc_count; int free_count; @@ -337,7 +381,11 @@ if (!pt) DRM_MEM_ERROR(DRM_MEM_MAPPINGS, "Attempt to free NULL pointer\n"); +#if __REALLY_HAVE_AGP + else if(!dev->agp || dev->agp->cant_use_aperture == 0) +#else else +#endif iounmap(pt); spin_lock(&DRM(mem_lock)); diff -urN linux-2.4.18/drivers/char/drm/drm_scatter.h lia64-2.4/drivers/char/drm/drm_scatter.h --- linux-2.4.18/drivers/char/drm/drm_scatter.h Mon Sep 24 15:06:58 2001 +++ lia64-2.4/drivers/char/drm/drm_scatter.h Fri Jul 19 18:26:38 2002 @@ -47,9 +47,11 @@ vfree( entry->virtual ); +#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) DRM(free)( entry->busaddr, entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES ); +#endif DRM(free)( entry->pagelist, entry->pages * sizeof(*entry->pagelist), DRM_MEM_PAGES ); @@ -97,6 +99,7 @@ return -ENOMEM; } +#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) entry->busaddr = DRM(alloc)( pages * sizeof(*entry->busaddr), DRM_MEM_PAGES ); if ( !entry->busaddr ) { @@ -109,12 +112,15 @@ return -ENOMEM; } memset( (void *)entry->busaddr, 0, pages * sizeof(*entry->busaddr) ); +#endif entry->virtual = vmalloc_32( pages << PAGE_SHIFT ); if ( !entry->virtual ) { +#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) DRM(free)( entry->busaddr, entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES ); +#endif DRM(free)( entry->pagelist, entry->pages * sizeof(*entry->pagelist), DRM_MEM_PAGES ); diff -urN linux-2.4.18/drivers/char/drm/drm_vm.h lia64-2.4/drivers/char/drm/drm_vm.h --- linux-2.4.18/drivers/char/drm/drm_vm.h Mon Nov 26 11:18:32 2001 +++ lia64-2.4/drivers/char/drm/drm_vm.h Fri Jul 19 18:26:38 2002 @@ -78,7 +78,7 @@ * Find the right map */ - if(!dev->agp->cant_use_aperture) goto vm_nopage_error; + if(!dev->agp || !dev->agp->cant_use_aperture) goto vm_nopage_error; list_for_each(list, &dev->maplist->head) { r_list = (drm_map_list_t *)list; @@ -255,7 +255,7 @@ DRM_DEBUG("mtrr_del = %d\n", retcode); } #endif - DRM(ioremapfree)(map->handle, map->size); + DRM(ioremapfree)(map->handle, map->size, dev); break; case _DRM_SHM: vfree(map->handle); @@ -456,6 +456,7 @@ drm_map_list_t *r_list; unsigned long offset = 0; struct list_head *list; + struct page *page; DRM_DEBUG("start = 0x%lx, end = 0x%lx, offset = 0x%lx\n", vma->vm_start, vma->vm_end, VM_OFFSET(vma)); @@ -502,28 +503,34 @@ switch (map->type) { case _DRM_AGP: -#if defined(__alpha__) - /* - * On Alpha we can't talk to bus dma address from the - * CPU, so for memory of type DRM_AGP, we'll deal with - * sorting out the real physical pages and mappings - * in nopage() - */ - vma->vm_ops = &DRM(vm_ops); - break; +#if __REALLY_HAVE_AGP + if(dev->agp->cant_use_aperture == 1) { + /* + * On some systems we can't talk to bus dma address from + * the CPU, so for memory of type DRM_AGP, we'll deal + * with sorting out the real physical pages and mappings + * in nopage() + */ + vma->vm_ops = &DRM(vm_ops); +#if 0/*XXX non-coherent AGP DMA*/ + vma->vm_page_prot = + pgprot_writecombine(vma->vm_page_prot); +#endif + goto mapswitch_out; + } #endif /* fall through to _DRM_FRAME_BUFFER... */ case _DRM_FRAME_BUFFER: case _DRM_REGISTERS: - if (VM_OFFSET(vma) >= __pa(high_memory)) { + page = virt_to_page(__va(VM_OFFSET(vma))); + if (!VALID_PAGE(page) || PageReserved(page)) { #if defined(__i386__) if (boot_cpu_data.x86 > 3 && map->type != _DRM_AGP) { pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; pgprot_val(vma->vm_page_prot) &= ~_PAGE_PWT; } #elif defined(__ia64__) - if (map->type != _DRM_AGP) - vma->vm_page_prot = + vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); #elif defined(__powerpc__) pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE | _PAGE_GUARDED; @@ -567,11 +574,14 @@ #else vma->vm_pte = (unsigned long)map; #endif - vma->vm_flags |= VM_RESERVED; + vma->vm_flags |= VM_RESERVED; break; default: return -EINVAL; /* This should never happen. */ } +#if __REALLY_HAVE_AGP +mapswitch_out: +#endif vma->vm_flags |= VM_RESERVED; /* Don't swap */ #if LINUX_VERSION_CODE < 0x020203 /* KERNEL_VERSION(2,2,3) */ diff -urN linux-2.4.18/drivers/char/drm/i810_dma.c lia64-2.4/drivers/char/drm/i810_dma.c --- linux-2.4.18/drivers/char/drm/i810_dma.c Wed Aug 8 09:42:15 2001 +++ lia64-2.4/drivers/char/drm/i810_dma.c Mon Aug 20 18:09:34 2001 @@ -315,7 +315,7 @@ if(dev_priv->ring.virtual_start) { DRM(ioremapfree)((void *) dev_priv->ring.virtual_start, - dev_priv->ring.Size); + dev_priv->ring.Size, dev); } if(dev_priv->hw_status_page != 0UL) { i810_free_page(dev, dev_priv->hw_status_page); @@ -329,7 +329,8 @@ for (i = 0; i < dma->buf_count; i++) { drm_buf_t *buf = dma->buflist[ i ]; drm_i810_buf_priv_t *buf_priv = buf->dev_private; - DRM(ioremapfree)(buf_priv->kernel_virtual, buf->total); + DRM(ioremapfree)(buf_priv->kernel_virtual, + buf->total, dev); } } return 0; @@ -402,7 +403,7 @@ *buf_priv->in_use = I810_BUF_FREE; buf_priv->kernel_virtual = DRM(ioremap)(buf->bus_address, - buf->total); + buf->total, dev); } return 0; } @@ -458,7 +459,7 @@ dev_priv->ring.virtual_start = DRM(ioremap)(dev->agp->base + init->ring_start, - init->ring_size); + init->ring_size, dev); if (dev_priv->ring.virtual_start == NULL) { dev->dev_private = (void *) dev_priv; diff -urN linux-2.4.18/drivers/char/drm/mga_dma.c lia64-2.4/drivers/char/drm/mga_dma.c --- linux-2.4.18/drivers/char/drm/mga_dma.c Wed Aug 8 09:42:15 2001 +++ lia64-2.4/drivers/char/drm/mga_dma.c Mon Aug 20 18:09:34 2001 @@ -557,9 +557,9 @@ (drm_mga_sarea_t *)((u8 *)dev_priv->sarea->handle + init->sarea_priv_offset); - DRM_IOREMAP( dev_priv->warp ); - DRM_IOREMAP( dev_priv->primary ); - DRM_IOREMAP( dev_priv->buffers ); + DRM_IOREMAP( dev_priv->warp, dev ); + DRM_IOREMAP( dev_priv->primary, dev ); + DRM_IOREMAP( dev_priv->buffers, dev ); if(!dev_priv->warp->handle || !dev_priv->primary->handle || @@ -647,9 +647,9 @@ if ( dev->dev_private ) { drm_mga_private_t *dev_priv = dev->dev_private; - DRM_IOREMAPFREE( dev_priv->warp ); - DRM_IOREMAPFREE( dev_priv->primary ); - DRM_IOREMAPFREE( dev_priv->buffers ); + DRM_IOREMAPFREE( dev_priv->warp, dev ); + DRM_IOREMAPFREE( dev_priv->primary, dev ); + DRM_IOREMAPFREE( dev_priv->buffers, dev ); if ( dev_priv->head != NULL ) { mga_freelist_cleanup( dev ); diff -urN linux-2.4.18/drivers/char/drm/r128_cce.c lia64-2.4/drivers/char/drm/r128_cce.c --- linux-2.4.18/drivers/char/drm/r128_cce.c Mon Sep 24 15:06:58 2001 +++ lia64-2.4/drivers/char/drm/r128_cce.c Wed Nov 21 13:42:25 2001 @@ -216,7 +216,22 @@ int i; for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) { +#ifndef CONFIG_AGP_I460 if ( GET_RING_HEAD( &dev_priv->ring ) == dev_priv->ring.tail ) { +#else + /* + * XXX - this is (I think) a 460GX specific hack + * + * When doing texturing, ring.tail sometimes gets ahead of + * PM4_BUFFER_DL_WPTR by 2; consequently, the card processes + * its whole quota of instructions and *ring.head is still 2 + * short of ring.tail. Work around this for now in lieu of + * a better solution. + */ + if ( GET_RING_HEAD( &dev_priv->ring ) == dev_priv->ring.tail || + ( dev_priv->ring.tail - + GET_RING_HEAD( &dev_priv->ring ) ) == 2 ) { +#endif int pm4stat = R128_READ( R128_PM4_STAT ); if ( ( (pm4stat & R128_PM4_FIFOCNT_MASK) >= dev_priv->cce_fifo_size ) && @@ -317,7 +332,7 @@ static void r128_cce_init_ring_buffer( drm_device_t *dev, drm_r128_private_t *dev_priv ) { - u32 ring_start; + u32 ring_start, rptr_addr; u32 tmp; DRM_DEBUG( "%s\n", __FUNCTION__ ); @@ -341,8 +356,28 @@ SET_RING_HEAD( &dev_priv->ring, 0 ); if ( !dev_priv->is_pci ) { - R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR, - dev_priv->ring_rptr->offset ); +#if defined(CONFIG_AGP_I460) && defined(__ia64__) + /* + * XXX - This is a 460GX specific hack + * + * We have to hack this right now. 460GX isn't claiming PCI + * writes from the card into the AGP aperture. Because of this, + * we have to get space outside of the aperture for RPTR_ADDR. + */ + if( dev->agp->agp_info.chipset == INTEL_460GX ) { + unsigned long alt_rh_off; + + alt_rh_off = __get_free_page(GFP_KERNEL | GFP_DMA); + atomic_inc(&virt_to_page(alt_rh_off)->count); + set_bit(PG_locked, &virt_to_page(alt_rh_off)->flags); + + dev_priv->ring.head = (__volatile__ u32 *) alt_rh_off; + SET_RING_HEAD( &dev_priv->ring, 0 ); + rptr_addr = __pa( dev_priv->ring.head ); + } else +#endif + rptr_addr = dev_priv->ring_rptr->offset; + R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR, rptr_addr ); } else { drm_sg_mem_t *entry = dev->sg; unsigned long tmp_ofs, page_ofs; @@ -350,11 +385,20 @@ tmp_ofs = dev_priv->ring_rptr->offset - dev->sg->handle; page_ofs = tmp_ofs >> PAGE_SHIFT; +#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR, entry->busaddr[page_ofs]); DRM_DEBUG( "ring rptr: offset=0x%08x handle=0x%08lx\n", entry->busaddr[page_ofs], entry->handle + tmp_ofs ); +#else + R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR, + page_to_bus(entry->pagelist[page_ofs])); + + DRM_DEBUG( "ring rptr: offset=0x%08lx handle=0x%08lx\n", + page_to_bus(entry->pagelist[page_ofs]), + entry->handle + tmp_ofs ); +#endif } /* Set watermark control */ @@ -550,9 +594,9 @@ init->sarea_priv_offset); if ( !dev_priv->is_pci ) { - DRM_IOREMAP( dev_priv->cce_ring ); - DRM_IOREMAP( dev_priv->ring_rptr ); - DRM_IOREMAP( dev_priv->buffers ); + DRM_IOREMAP( dev_priv->cce_ring, dev ); + DRM_IOREMAP( dev_priv->ring_rptr, dev ); + DRM_IOREMAP( dev_priv->buffers, dev ); if(!dev_priv->cce_ring->handle || !dev_priv->ring_rptr->handle || !dev_priv->buffers->handle) { @@ -624,9 +668,9 @@ drm_r128_private_t *dev_priv = dev->dev_private; if ( !dev_priv->is_pci ) { - DRM_IOREMAPFREE( dev_priv->cce_ring ); - DRM_IOREMAPFREE( dev_priv->ring_rptr ); - DRM_IOREMAPFREE( dev_priv->buffers ); + DRM_IOREMAPFREE( dev_priv->cce_ring, dev ); + DRM_IOREMAPFREE( dev_priv->ring_rptr, dev ); + DRM_IOREMAPFREE( dev_priv->buffers, dev ); } else { if (!DRM(ati_pcigart_cleanup)( dev, dev_priv->phys_pci_gart, @@ -634,6 +678,21 @@ DRM_ERROR( "failed to cleanup PCI GART!\n" ); } +#if defined(CONFIG_AGP_I460) && defined(__ia64__) + /* + * Free the page we grabbed for RPTR_ADDR + */ + if( !dev_priv->is_pci && dev->agp->agp_info.chipset == INTEL_460GX ) { + unsigned long alt_rh_off = + (unsigned long) dev_priv->ring.head; + + atomic_dec(&virt_to_page(alt_rh_off)->count); + clear_bit(PG_locked, &virt_to_page(alt_rh_off)->flags); + wake_up(&virt_to_page(alt_rh_off)->wait); + free_page(alt_rh_off); + } +#endif + DRM(free)( dev->dev_private, sizeof(drm_r128_private_t), DRM_MEM_DRIVER ); dev->dev_private = NULL; diff -urN linux-2.4.18/drivers/char/drm/radeon_cp.c lia64-2.4/drivers/char/drm/radeon_cp.c --- linux-2.4.18/drivers/char/drm/radeon_cp.c Mon Sep 24 15:06:58 2001 +++ lia64-2.4/drivers/char/drm/radeon_cp.c Wed Nov 21 13:54:26 2001 @@ -575,7 +575,7 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev, drm_radeon_private_t *dev_priv ) { - u32 ring_start, cur_read_ptr; + u32 ring_start, cur_read_ptr, rptr_addr; u32 tmp; /* Initialize the memory controller */ @@ -612,8 +612,28 @@ dev_priv->ring.tail = cur_read_ptr; if ( !dev_priv->is_pci ) { - RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR, - dev_priv->ring_rptr->offset ); +#if defined(CONFIG_AGP_I460) && defined(__ia64__) + /* + * XXX - This is a 460GX specific hack + * + * We have to hack this right now. 460GX isn't claiming PCI + * writes from the card into the AGP aperture. Because of this, + * we have to get space outside of the aperture for RPTR_ADDR. + */ + if( dev->agp->agp_info.chipset == INTEL_460GX ) { + unsigned long alt_rh_off; + + alt_rh_off = __get_free_page(GFP_KERNEL | GFP_DMA); + atomic_inc(&virt_to_page(alt_rh_off)->count); + set_bit(PG_locked, &virt_to_page(alt_rh_off)->flags); + + dev_priv->ring.head = (__volatile__ u32 *) alt_rh_off; + *dev_priv->ring.head = cur_read_ptr; + rptr_addr = __pa( dev_priv->ring.head ); + } else +#endif + rptr_addr = dev_priv->ring_rptr->offset; + RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR, rptr_addr ); } else { drm_sg_mem_t *entry = dev->sg; unsigned long tmp_ofs, page_ofs; @@ -621,11 +641,19 @@ tmp_ofs = dev_priv->ring_rptr->offset - dev->sg->handle; page_ofs = tmp_ofs >> PAGE_SHIFT; +#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR, entry->busaddr[page_ofs]); DRM_DEBUG( "ring rptr: offset=0x%08x handle=0x%08lx\n", entry->busaddr[page_ofs], entry->handle + tmp_ofs ); +#else + RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR, + entry->busaddr[page_ofs]); + DRM_DEBUG( "ring rptr: offset=0x%08x handle=0x%08lx\n", + entry->busaddr[page_ofs], + entry->handle + tmp_ofs ); +#endif } /* Set ring buffer size */ @@ -836,9 +864,9 @@ init->sarea_priv_offset); if ( !dev_priv->is_pci ) { - DRM_IOREMAP( dev_priv->cp_ring ); - DRM_IOREMAP( dev_priv->ring_rptr ); - DRM_IOREMAP( dev_priv->buffers ); + DRM_IOREMAP( dev_priv->cp_ring, dev ); + DRM_IOREMAP( dev_priv->ring_rptr, dev ); + DRM_IOREMAP( dev_priv->buffers, dev ); if(!dev_priv->cp_ring->handle || !dev_priv->ring_rptr->handle || !dev_priv->buffers->handle) { @@ -983,9 +1011,9 @@ drm_radeon_private_t *dev_priv = dev->dev_private; if ( !dev_priv->is_pci ) { - DRM_IOREMAPFREE( dev_priv->cp_ring ); - DRM_IOREMAPFREE( dev_priv->ring_rptr ); - DRM_IOREMAPFREE( dev_priv->buffers ); + DRM_IOREMAPFREE( dev_priv->cp_ring, dev ); + DRM_IOREMAPFREE( dev_priv->ring_rptr, dev ); + DRM_IOREMAPFREE( dev_priv->buffers, dev ); } else { if (!DRM(ati_pcigart_cleanup)( dev, dev_priv->phys_pci_gart, @@ -993,6 +1021,21 @@ DRM_ERROR( "failed to cleanup PCI GART!\n" ); } +#if defined(CONFIG_AGP_I460) && defined(__ia64__) + /* + * Free the page we grabbed for RPTR_ADDR + */ + if( !dev_priv->is_pci && dev->agp->agp_info.chipset == INTEL_460GX ) { + unsigned long alt_rh_off = + (unsigned long) dev_priv->ring.head; + + atomic_dec(&virt_to_page(alt_rh_off)->count); + clear_bit(PG_locked, &virt_to_page(alt_rh_off)->flags); + wake_up(&virt_to_page(alt_rh_off)->wait); + free_page(alt_rh_off); + } +#endif + DRM(free)( dev->dev_private, sizeof(drm_radeon_private_t), DRM_MEM_DRIVER ); dev->dev_private = NULL; diff -urN linux-2.4.18/drivers/char/drm-4.0/agpsupport.c lia64-2.4/drivers/char/drm-4.0/agpsupport.c --- linux-2.4.18/drivers/char/drm-4.0/agpsupport.c Tue Feb 26 11:04:07 2002 +++ lia64-2.4/drivers/char/drm-4.0/agpsupport.c Tue Feb 26 13:34:54 2002 @@ -30,6 +30,7 @@ #define __NO_VERSION__ #include "drmP.h" +#include #include #if LINUX_VERSION_CODE < 0x020400 #include "agpsupport-pre24.h" @@ -264,6 +265,7 @@ #if LINUX_VERSION_CODE >= 0x020400 case INTEL_I840: head->chipset = "Intel i840"; break; #endif + case INTEL_460GX: head->chipset = "Intel 460GX"; break; case VIA_GENERIC: head->chipset = "VIA"; break; case VIA_VP3: head->chipset = "VIA VP3"; break; @@ -297,6 +299,14 @@ default: head->chipset = "Unknown"; break; } +#if LINUX_VERSION_CODE <= 0x020408 + head->cant_use_aperture = 0; + head->page_mask = ~(0xfff); +#else + head->cant_use_aperture = head->agp_info.cant_use_aperture; + head->page_mask = head->agp_info.page_mask; +#endif + DRM_INFO("AGP %d.%d on %s @ 0x%08lx %ZuMB\n", head->agp_info.version.major, head->agp_info.version.minor, diff -urN linux-2.4.18/drivers/char/drm-4.0/bufs.c lia64-2.4/drivers/char/drm-4.0/bufs.c --- linux-2.4.18/drivers/char/drm-4.0/bufs.c Tue Feb 26 11:04:07 2002 +++ lia64-2.4/drivers/char/drm-4.0/bufs.c Tue Feb 26 13:34:54 2002 @@ -73,7 +73,7 @@ switch (map->type) { case _DRM_REGISTERS: case _DRM_FRAME_BUFFER: -#ifndef __sparc__ +#if !defined(__sparc__) && !defined(__ia64__) if (map->offset + map->size < map->offset || map->offset < virt_to_phys(high_memory)) { drm_free(map, sizeof(*map), DRM_MEM_MAPS); @@ -87,7 +87,7 @@ MTRR_TYPE_WRCOMB, 1); } #endif - map->handle = drm_ioremap(map->offset, map->size); + map->handle = drm_ioremap(map->offset, map->size, dev); break; diff -urN linux-2.4.18/drivers/char/drm-4.0/drmP.h lia64-2.4/drivers/char/drm-4.0/drmP.h --- linux-2.4.18/drivers/char/drm-4.0/drmP.h Tue Feb 26 11:04:07 2002 +++ lia64-2.4/drivers/char/drm-4.0/drmP.h Tue May 7 10:02:22 2002 @@ -510,6 +510,8 @@ int acquired; unsigned long base; int agp_mtrr; + int cant_use_aperture; + unsigned long page_mask; } drm_agp_head_t; #endif @@ -679,8 +681,10 @@ extern unsigned long drm_alloc_pages(int order, int area); extern void drm_free_pages(unsigned long address, int order, int area); -extern void *drm_ioremap(unsigned long offset, unsigned long size); -extern void drm_ioremapfree(void *pt, unsigned long size); +extern void *drm_ioremap(unsigned long offset, unsigned long size, + drm_device_t *dev); +extern void drm_ioremapfree(void *pt, unsigned long size, + drm_device_t *dev); #if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE) extern agp_memory *drm_alloc_agp(int pages, u32 type); diff -urN linux-2.4.18/drivers/char/drm-4.0/ffb_drv.c lia64-2.4/drivers/char/drm-4.0/ffb_drv.c --- linux-2.4.18/drivers/char/drm-4.0/ffb_drv.c Tue Feb 26 11:04:07 2002 +++ lia64-2.4/drivers/char/drm-4.0/ffb_drv.c Tue Feb 26 13:34:54 2002 @@ -158,7 +158,7 @@ switch (map->type) { case _DRM_REGISTERS: case _DRM_FRAME_BUFFER: - drm_ioremapfree(map->handle, map->size); + drm_ioremapfree(map->handle, map->size, dev); break; case _DRM_SHM: diff -urN linux-2.4.18/drivers/char/drm-4.0/gamma_drv.c lia64-2.4/drivers/char/drm-4.0/gamma_drv.c --- linux-2.4.18/drivers/char/drm-4.0/gamma_drv.c Tue Feb 26 11:04:07 2002 +++ lia64-2.4/drivers/char/drm-4.0/gamma_drv.c Tue Feb 26 13:34:54 2002 @@ -258,7 +258,7 @@ DRM_DEBUG("mtrr_del = %d\n", retcode); } #endif - drm_ioremapfree(map->handle, map->size); + drm_ioremapfree(map->handle, map->size, dev); break; case _DRM_SHM: drm_free_pages((unsigned long)map->handle, diff -urN linux-2.4.18/drivers/char/drm-4.0/i810_dma.c lia64-2.4/drivers/char/drm-4.0/i810_dma.c --- linux-2.4.18/drivers/char/drm-4.0/i810_dma.c Tue Feb 26 11:04:07 2002 +++ lia64-2.4/drivers/char/drm-4.0/i810_dma.c Tue Feb 26 13:34:54 2002 @@ -309,7 +309,7 @@ if(dev_priv->ring.virtual_start) { drm_ioremapfree((void *) dev_priv->ring.virtual_start, - dev_priv->ring.Size); + dev_priv->ring.Size, dev); } if(dev_priv->hw_status_page != 0UL) { i810_free_page(dev, dev_priv->hw_status_page); @@ -323,7 +323,8 @@ for (i = 0; i < dma->buf_count; i++) { drm_buf_t *buf = dma->buflist[ i ]; drm_i810_buf_priv_t *buf_priv = buf->dev_private; - drm_ioremapfree(buf_priv->kernel_virtual, buf->total); + drm_ioremapfree(buf_priv->kernel_virtual, + buf->total, dev); } } return 0; @@ -397,7 +398,7 @@ *buf_priv->in_use = I810_BUF_FREE; buf_priv->kernel_virtual = drm_ioremap(buf->bus_address, - buf->total); + buf->total, dev); } return 0; } @@ -434,7 +435,7 @@ dev_priv->ring.virtual_start = drm_ioremap(dev->agp->base + init->ring_start, - init->ring_size); + init->ring_size, dev); dev_priv->ring.tail_mask = dev_priv->ring.Size - 1; diff -urN linux-2.4.18/drivers/char/drm-4.0/i810_drv.c lia64-2.4/drivers/char/drm-4.0/i810_drv.c --- linux-2.4.18/drivers/char/drm-4.0/i810_drv.c Tue Feb 26 11:04:07 2002 +++ lia64-2.4/drivers/char/drm-4.0/i810_drv.c Tue Feb 26 13:34:54 2002 @@ -286,7 +286,7 @@ DRM_DEBUG("mtrr_del = %d\n", retcode); } #endif - drm_ioremapfree(map->handle, map->size); + drm_ioremapfree(map->handle, map->size, dev); break; case _DRM_SHM: drm_free_pages((unsigned long)map->handle, diff -urN linux-2.4.18/drivers/char/drm-4.0/memory.c lia64-2.4/drivers/char/drm-4.0/memory.c --- linux-2.4.18/drivers/char/drm-4.0/memory.c Tue Feb 26 11:04:07 2002 +++ lia64-2.4/drivers/char/drm-4.0/memory.c Tue Feb 26 13:34:54 2002 @@ -296,7 +296,7 @@ } } -void *drm_ioremap(unsigned long offset, unsigned long size) +void *drm_ioremap(unsigned long offset, unsigned long size, drm_device_t *dev) { void *pt; @@ -306,12 +306,50 @@ return NULL; } + if(dev->agp->cant_use_aperture == 0) { + goto standard_ioremap; + } else { + drm_map_t *map = NULL; + int i; + + for(i = 0; i < dev->map_count; i++) { + map = dev->maplist[i]; + if (!map) continue; + if (map->offset <= offset && + (map->offset + map->size) >= (offset + size)) + break; + } + + if(map && map->type == _DRM_AGP) { + struct drm_agp_mem *agpmem; + + for(agpmem = dev->agp->memory; agpmem; + agpmem = agpmem->next) { + if(agpmem->bound <= offset && + (agpmem->bound + (agpmem->pages + << PAGE_SHIFT)) >= (offset + size)) + break; + } + + if(agpmem == NULL) + goto standard_ioremap; + + pt = agpmem->memory->vmptr + (offset - agpmem->bound); + goto ioremap_success; + } else { + goto standard_ioremap; + } + } + +standard_ioremap: if (!(pt = ioremap(offset, size))) { spin_lock(&drm_mem_lock); ++drm_mem_stats[DRM_MEM_MAPPINGS].fail_count; spin_unlock(&drm_mem_lock); return NULL; } + +ioremap_success: spin_lock(&drm_mem_lock); ++drm_mem_stats[DRM_MEM_MAPPINGS].succeed_count; drm_mem_stats[DRM_MEM_MAPPINGS].bytes_allocated += size; @@ -319,7 +357,7 @@ return pt; } -void drm_ioremapfree(void *pt, unsigned long size) +void drm_ioremapfree(void *pt, unsigned long size, drm_device_t *dev) { int alloc_count; int free_count; @@ -327,7 +365,7 @@ if (!pt) DRM_MEM_ERROR(DRM_MEM_MAPPINGS, "Attempt to free NULL pointer\n"); - else + else if(dev->agp->cant_use_aperture == 0) iounmap(pt); spin_lock(&drm_mem_lock); diff -urN linux-2.4.18/drivers/char/drm-4.0/mga_dma.c lia64-2.4/drivers/char/drm-4.0/mga_dma.c --- linux-2.4.18/drivers/char/drm-4.0/mga_dma.c Tue Feb 26 11:04:07 2002 +++ lia64-2.4/drivers/char/drm-4.0/mga_dma.c Tue Feb 26 13:34:54 2002 @@ -308,7 +308,7 @@ temp = ((temp + PAGE_SIZE - 1) / PAGE_SIZE) * PAGE_SIZE; dev_priv->ioremap = drm_ioremap(dev->agp->base + offset, - temp); + temp, dev); if(dev_priv->ioremap == NULL) { DRM_ERROR("Ioremap failed\n"); return -ENOMEM; @@ -635,7 +635,7 @@ dev_priv->primary_size + PAGE_SIZE - 1) / PAGE_SIZE * PAGE_SIZE; - drm_ioremapfree((void *) dev_priv->ioremap, temp); + drm_ioremapfree((void *) dev_priv->ioremap, temp, dev); } if(dev_priv->status_page != NULL) { iounmap(dev_priv->status_page); @@ -741,10 +741,18 @@ return -ENOMEM; } - /* Write status page when secend or softrap occurs */ + /* Write status page when secend or softrap occurs + * + * Disable this on ia64 on the off chance that real status page will be + * above 4GB. + */ +#if defined(__ia64__) + MGA_WRITE(MGAREG_PRIMPTR, + virt_to_bus((void *)dev_priv->real_status_page)); +#else MGA_WRITE(MGAREG_PRIMPTR, virt_to_bus((void *)dev_priv->real_status_page) | 0x00000003); - +#endif /* Private is now filled in, initialize the hardware */ { diff -urN linux-2.4.18/drivers/char/drm-4.0/mga_drv.c lia64-2.4/drivers/char/drm-4.0/mga_drv.c --- linux-2.4.18/drivers/char/drm-4.0/mga_drv.c Tue Feb 26 11:04:07 2002 +++ lia64-2.4/drivers/char/drm-4.0/mga_drv.c Tue Feb 26 13:34:54 2002 @@ -286,7 +286,7 @@ DRM_DEBUG("mtrr_del = %d\n", retcode); } #endif - drm_ioremapfree(map->handle, map->size); + drm_ioremapfree(map->handle, map->size, dev); break; case _DRM_SHM: drm_free_pages((unsigned long)map->handle, diff -urN linux-2.4.18/drivers/char/drm-4.0/mga_drv.h lia64-2.4/drivers/char/drm-4.0/mga_drv.h --- linux-2.4.18/drivers/char/drm-4.0/mga_drv.h Tue Feb 26 11:04:08 2002 +++ lia64-2.4/drivers/char/drm-4.0/mga_drv.h Tue Feb 26 13:34:54 2002 @@ -295,7 +295,7 @@ num_dwords + 1 + outcount, ADRINDEX(reg), val); \ if( ++outcount == 4) { \ outcount = 0; \ - dma_ptr[0] = *(unsigned long *)tempIndex; \ + dma_ptr[0] = *(u32 *)tempIndex; \ dma_ptr+=5; \ num_dwords += 5; \ } \ diff -urN linux-2.4.18/drivers/char/drm-4.0/r128_cce.c lia64-2.4/drivers/char/drm-4.0/r128_cce.c --- linux-2.4.18/drivers/char/drm-4.0/r128_cce.c Tue Feb 26 11:04:08 2002 +++ lia64-2.4/drivers/char/drm-4.0/r128_cce.c Tue Feb 26 13:34:54 2002 @@ -86,12 +86,13 @@ }; -#define DO_REMAP(_m) (_m)->handle = drm_ioremap((_m)->offset, (_m)->size) +#define DO_REMAP(_m, _d) (_m)->handle = drm_ioremap((_m)->offset, \ + (_m)->size, (_d)) -#define DO_REMAPFREE(_m) \ +#define DO_REMAPFREE(_m, _d) \ do { \ if ((_m)->handle && (_m)->size) \ - drm_ioremapfree((_m)->handle, (_m)->size); \ + drm_ioremapfree((_m)->handle, (_m)->size, (_d)); \ } while (0) #define DO_FIND_MAP(_m, _o) \ @@ -229,7 +230,21 @@ int i; for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) { +#ifndef CONFIG_AGP_I460 if ( *dev_priv->ring.head == dev_priv->ring.tail ) { +#else + /* + * XXX - this is (I think) a 460GX specific hack + * + * When doing texturing, ring.tail sometimes gets ahead of + * PM4_BUFFER_DL_WPTR by 2; consequently, the card processes + * its whole quota of instructions and *ring.head is still 2 + * short of ring.tail. Work around this for now in lieu of + * a better solution. + */ + if ( (*dev_priv->ring.head == dev_priv->ring.tail) || + ((dev_priv->ring.tail - *dev_priv->ring.head) == 2) ) { +#endif int pm4stat = R128_READ( R128_PM4_STAT ); if ( ( (pm4stat & R128_PM4_FIFOCNT_MASK) >= dev_priv->cce_fifo_size ) && @@ -342,10 +357,34 @@ R128_WRITE( R128_PM4_BUFFER_DL_WPTR, 0 ); R128_WRITE( R128_PM4_BUFFER_DL_RPTR, 0 ); +#if defined(CONFIG_AGP_I460) && defined(__ia64__) + /* + * XXX - This is a 460GX specific hack + * + * We have to hack this right now. 460GX isn't claiming PCI writes + * from the card into the AGP aperture. Because of this, we have + * to get space outside of the aperture for RPTR_ADDR. + */ + if(dev->agp->agp_info.chipset == INTEL_460GX) { + dev_priv->ring.head = (void *) + __get_free_page(GFP_KERNEL | GFP_DMA); + atomic_inc(&virt_to_page(dev_priv->ring.head)->count); + set_bit(PG_locked, &virt_to_page(dev_priv->ring.head)->flags); + dev_priv->ring.head = __va(dev_priv->ring.head); + + *dev_priv->ring.head = 0; + R128_WRITE(R128_PM4_BUFFER_DL_RPTR_ADDR, + __pa(dev_priv->ring.head)); + } else { +#else /* DL_RPTR_ADDR is a physical address in AGP space. */ *dev_priv->ring.head = 0; R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR, dev_priv->ring_rptr->offset ); +#endif +#if defined(CONFIG_AGP_I460) && defined(__ia64__) + } +#endif /* Set watermark control */ R128_WRITE( R128_PM4_BUFFER_WM_CNTL, @@ -481,12 +520,12 @@ (drm_r128_sarea_t *)((u8 *)dev_priv->sarea->handle + init->sarea_priv_offset); - DO_REMAP( dev_priv->cce_ring ); - DO_REMAP( dev_priv->ring_rptr ); - DO_REMAP( dev_priv->buffers ); + DO_REMAP( dev_priv->cce_ring, dev ); + DO_REMAP( dev_priv->ring_rptr, dev ); + DO_REMAP( dev_priv->buffers, dev ); #if 0 if ( !dev_priv->is_pci ) { - DO_REMAP( dev_priv->agp_textures ); + DO_REMAP( dev_priv->agp_textures, dev ); } #endif @@ -521,15 +560,28 @@ if ( dev->dev_private ) { drm_r128_private_t *dev_priv = dev->dev_private; - DO_REMAPFREE( dev_priv->cce_ring ); - DO_REMAPFREE( dev_priv->ring_rptr ); - DO_REMAPFREE( dev_priv->buffers ); + DO_REMAPFREE( dev_priv->cce_ring, dev ); + DO_REMAPFREE( dev_priv->ring_rptr, dev ); + DO_REMAPFREE( dev_priv->buffers, dev ); #if 0 if ( !dev_priv->is_pci ) { - DO_REMAPFREE( dev_priv->agp_textures ); + DO_REMAPFREE( dev_priv->agp_textures, dev ); } #endif +#if defined(CONFIG_AGP_I460) && defined(__ia64__) + /* + * Free the page we grabbed for RPTR_ADDR + */ + if(dev->agp->agp_info.chipset == INTEL_460GX) { + atomic_dec(&virt_to_page(dev_priv->ring.head)->count); + clear_bit(PG_locked, + &virt_to_page(dev_priv->ring.head)->flags); + wake_up(&virt_to_page(dev_priv->ring.head)->wait); + free_page((unsigned long) dev_priv->ring.head); + } +#endif + drm_free( dev->dev_private, sizeof(drm_r128_private_t), DRM_MEM_DRIVER ); dev->dev_private = NULL; diff -urN linux-2.4.18/drivers/char/drm-4.0/r128_drv.c lia64-2.4/drivers/char/drm-4.0/r128_drv.c --- linux-2.4.18/drivers/char/drm-4.0/r128_drv.c Tue Feb 26 11:04:08 2002 +++ lia64-2.4/drivers/char/drm-4.0/r128_drv.c Tue Feb 26 13:34:54 2002 @@ -296,7 +296,7 @@ DRM_DEBUG("mtrr_del = %d\n", retcode); } #endif - drm_ioremapfree(map->handle, map->size); + drm_ioremapfree(map->handle, map->size, dev); break; case _DRM_SHM: drm_free_pages((unsigned long)map->handle, diff -urN linux-2.4.18/drivers/char/drm-4.0/radeon_cp.c lia64-2.4/drivers/char/drm-4.0/radeon_cp.c --- linux-2.4.18/drivers/char/drm-4.0/radeon_cp.c Tue Feb 26 11:04:08 2002 +++ lia64-2.4/drivers/char/drm-4.0/radeon_cp.c Tue Feb 26 13:34:54 2002 @@ -300,12 +300,13 @@ }; -#define DO_IOREMAP(_m) (_m)->handle = drm_ioremap((_m)->offset, (_m)->size) +#define DO_IOREMAP(_m, _d) (_m)->handle = drm_ioremap((_m)->offset, \ + (_m)->size, (_d)) -#define DO_IOREMAPFREE(_m) \ +#define DO_IOREMAPFREE(_m, _d) \ do { \ if ((_m)->handle && (_m)->size) \ - drm_ioremapfree((_m)->handle, (_m)->size); \ + drm_ioremapfree((_m)->handle, (_m)->size, (_d));\ } while (0) #define DO_FIND_MAP(_m, _o) \ @@ -592,11 +593,36 @@ /* Initialize the ring buffer's read and write pointers */ cur_read_ptr = RADEON_READ( RADEON_CP_RB_RPTR ); RADEON_WRITE( RADEON_CP_RB_WPTR, cur_read_ptr ); + +#if defined(CONFIG_AGP_I460) && defined(__ia64__) + /* + * XXX - This is a 460GX specific hack + * + * We have to hack this right now. The GXB isn't claiming PCI writes + * from the card into the AGP aperture. Because of this, we have + * to get space outside of the aperture for RPTR_ADDR. + */ + if(dev->agp->agp_info.chipset == INTEL_460GX) { + dev_priv->ring.head = (void *) + __get_free_page(GFP_KERNEL | GFP_DMA); + atomic_inc(&virt_to_page(dev_priv->ring.head)->count); + set_bit(PG_locked, &virt_to_page(dev_priv->ring.head)->flags); + dev_priv->ring.head = __va(dev_priv->ring.head); + + *dev_priv->ring.head = cur_read_ptr; + dev_priv->ring.tail = cur_read_ptr; + + RADEON_WRITE(RADEON_CP_RB_RPTR_ADDR, __pa(dev_priv->ring.head)); + } else { +#else *dev_priv->ring.head = cur_read_ptr; dev_priv->ring.tail = cur_read_ptr; RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR, dev_priv->ring_rptr->offset ); - +#endif +#if defined(CONFIG_AGP_I460) && defined(__ia64__) + } +#endif /* Set ring buffer size */ RADEON_WRITE( RADEON_CP_RB_CNTL, dev_priv->ring.size_l2qw ); @@ -757,12 +783,12 @@ (drm_radeon_sarea_t *)((u8 *)dev_priv->sarea->handle + init->sarea_priv_offset); - DO_IOREMAP( dev_priv->cp_ring ); - DO_IOREMAP( dev_priv->ring_rptr ); - DO_IOREMAP( dev_priv->buffers ); + DO_IOREMAP( dev_priv->cp_ring, dev ); + DO_IOREMAP( dev_priv->ring_rptr, dev ); + DO_IOREMAP( dev_priv->buffers, dev ); #if 0 if ( !dev_priv->is_pci ) { - DO_IOREMAP( dev_priv->agp_textures ); + DO_IOREMAP( dev_priv->agp_textures, dev ); } #endif @@ -828,15 +854,28 @@ if ( dev->dev_private ) { drm_radeon_private_t *dev_priv = dev->dev_private; - DO_IOREMAPFREE( dev_priv->cp_ring ); - DO_IOREMAPFREE( dev_priv->ring_rptr ); - DO_IOREMAPFREE( dev_priv->buffers ); + DO_IOREMAPFREE( dev_priv->cp_ring, dev ); + DO_IOREMAPFREE( dev_priv->ring_rptr, dev ); + DO_IOREMAPFREE( dev_priv->buffers, dev ); #if 0 if ( !dev_priv->is_pci ) { - DO_IOREMAPFREE( dev_priv->agp_textures ); + DO_IOREMAPFREE( dev_priv->agp_textures, dev ); } #endif +#if defined(CONFIG_AGP_I460) && defined(__ia64__) + /* + * Free the page we grabbed for RPTR_ADDR. + */ + if(dev->agp->agp_info.chipset == INTEL_460GX) { + atomic_dec(&virt_to_page(dev_priv->ring.head)->count); + clear_bit(PG_locked, + &virt_to_page(dev_priv->ring.head)->flags); + wake_up(&virt_to_page(dev_priv->ring.head)->wait); + free_page((unsigned long) dev_priv->ring.head); + } +#endif + drm_free( dev->dev_private, sizeof(drm_radeon_private_t), DRM_MEM_DRIVER ); dev->dev_private = NULL; diff -urN linux-2.4.18/drivers/char/drm-4.0/radeon_drv.c lia64-2.4/drivers/char/drm-4.0/radeon_drv.c --- linux-2.4.18/drivers/char/drm-4.0/radeon_drv.c Tue Feb 26 11:04:08 2002 +++ lia64-2.4/drivers/char/drm-4.0/radeon_drv.c Tue Feb 26 13:34:54 2002 @@ -294,7 +294,7 @@ DRM_DEBUG("mtrr_del = %d\n", retcode); } #endif - drm_ioremapfree(map->handle, map->size); + drm_ioremapfree(map->handle, map->size, dev); break; case _DRM_SHM: drm_free_pages((unsigned long)map->handle, diff -urN linux-2.4.18/drivers/char/drm-4.0/radeon_drv.h lia64-2.4/drivers/char/drm-4.0/radeon_drv.h --- linux-2.4.18/drivers/char/drm-4.0/radeon_drv.h Tue Feb 26 11:04:08 2002 +++ lia64-2.4/drivers/char/drm-4.0/radeon_drv.h Tue Feb 26 13:34:54 2002 @@ -535,7 +535,7 @@ #define RADEON_MAX_VB_VERTS (0xffff) -#define RADEON_BASE(reg) ((u32)(dev_priv->mmio->handle)) +#define RADEON_BASE(reg) ((unsigned long)(dev_priv->mmio->handle)) #define RADEON_ADDR(reg) (RADEON_BASE(reg) + reg) #define RADEON_DEREF(reg) *(__volatile__ u32 *)RADEON_ADDR(reg) diff -urN linux-2.4.18/drivers/char/drm-4.0/tdfx_drv.c lia64-2.4/drivers/char/drm-4.0/tdfx_drv.c --- linux-2.4.18/drivers/char/drm-4.0/tdfx_drv.c Tue Feb 26 11:04:08 2002 +++ lia64-2.4/drivers/char/drm-4.0/tdfx_drv.c Tue Feb 26 13:34:54 2002 @@ -264,7 +264,7 @@ DRM_DEBUG("mtrr_del = %d\n", retcode); } #endif - drm_ioremapfree(map->handle, map->size); + drm_ioremapfree(map->handle, map->size, dev); break; case _DRM_SHM: drm_free_pages((unsigned long)map->handle, diff -urN linux-2.4.18/drivers/char/drm-4.0/vm.c lia64-2.4/drivers/char/drm-4.0/vm.c --- linux-2.4.18/drivers/char/drm-4.0/vm.c Tue Feb 26 11:04:08 2002 +++ lia64-2.4/drivers/char/drm-4.0/vm.c Fri Jun 7 16:55:09 2002 @@ -30,6 +30,7 @@ */ #define __NO_VERSION__ +#include #include "drmP.h" struct vm_operations_struct drm_vm_ops = { @@ -67,6 +68,65 @@ int write_access) #endif { +#if defined(__ia64__) + drm_file_t *priv = vma->vm_file->private_data; + drm_device_t *dev = priv->dev; + drm_map_t *map = NULL; + int i; + + /* + * Find the right map + */ + + if(!dev->agp->cant_use_aperture) goto vm_nopage_error; + + for (i = 0; i < dev->map_count; i++) { + map = dev->maplist[i]; + if (!map) continue; + if (map->offset == VM_OFFSET(vma)) break; + } + + if (map && map->type == _DRM_AGP) { + unsigned long offset = address - vma->vm_start; + unsigned long baddr = VM_OFFSET(vma) + offset, paddr; + struct drm_agp_mem *agpmem; + struct page *page; + + /* + * It's AGP memory - find the real physical page to map + */ + for(agpmem = dev->agp->memory; agpmem; agpmem = agpmem->next) { + if (agpmem->bound <= baddr && + agpmem->bound + agpmem->pages * PAGE_SIZE > baddr) + break; + } + + if (!agpmem) goto vm_nopage_error; + + /* + * Get the page, inc the use count, and return it + */ + offset = (baddr - agpmem->bound) >> PAGE_SHIFT; + + /* + * This is bad. What we really want to do here is unmask + * the GART table entry held in the agp_memory structure. + * There isn't a convenient way to call agp_bridge.unmask_ + * memory from here, so hard code it for now. + */ + paddr = (agpmem->memory->memory[offset] & 0xffffff) << 12; + + page = virt_to_page(__va(paddr)); + get_page(page); + +#if LINUX_VERSION_CODE < 0x020317 + return page_address(page); +#else + return page; +#endif + } +vm_nopage_error: +#endif return NOPAGE_SIGBUS; /* Disallow mremap */ } @@ -272,6 +332,7 @@ drm_file_t *priv = filp->private_data; drm_device_t *dev = priv->dev; drm_map_t *map = NULL; + unsigned long off; int i; DRM_DEBUG("start = 0x%lx, end = 0x%lx, offset = 0x%lx\n", @@ -288,7 +349,16 @@ bit longer. */ for (i = 0; i < dev->map_count; i++) { map = dev->maplist[i]; - if (map->offset == VM_OFFSET(vma)) break; + off = map->offset ^ VM_OFFSET(vma); +#ifdef __ia64__ + /* + * Ignore region bits, makes IA32 processes happier + * XXX This is a hack... + */ + off &= ~0xe000000000000000; +#endif // __ia64__ + if (off == 0) + break; } if (i >= dev->map_count) return -EINVAL; @@ -312,11 +382,21 @@ } switch (map->type) { + case _DRM_AGP: +#if defined(__ia64__) + /* + * On ia64 we can't talk to bus dma address from + * the CPU, so for memory of type DRM_AGP, we'll deal with + * sorting out the real physical pages and mappings in + * in nopage() + */ + vma->vm_ops = &drm_vm_ops; + break; +#endif case _DRM_FRAME_BUFFER: case _DRM_REGISTERS: - case _DRM_AGP: if (VM_OFFSET(vma) >= __pa(high_memory)) { -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) if (boot_cpu_data.x86 > 3 && map->type != _DRM_AGP) { pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; pgprot_val(vma->vm_page_prot) &= ~_PAGE_PWT; diff -urN linux-2.4.18/drivers/char/efirtc.c lia64-2.4/drivers/char/efirtc.c --- linux-2.4.18/drivers/char/efirtc.c Mon Sep 24 15:06:59 2001 +++ lia64-2.4/drivers/char/efirtc.c Mon Sep 24 15:22:31 2001 @@ -40,7 +40,7 @@ #include #include -#define EFI_RTC_VERSION "0.2" +#define EFI_RTC_VERSION "0.3" #define EFI_ISDST (EFI_TIME_ADJUST_DAYLIGHT|EFI_TIME_IN_DAYLIGHT) /* @@ -315,56 +315,45 @@ spin_unlock_irqrestore(&efi_rtc_lock,flags); p += sprintf(p, - "Time :\n" - "Year : %u\n" - "Month : %u\n" - "Day : %u\n" - "Hour : %u\n" - "Minute : %u\n" - "Second : %u\n" - "Nanosecond: %u\n" - "Daylight : %u\n", - eft.year, eft.month, eft.day, eft.hour, eft.minute, - eft.second, eft.nanosecond, eft.daylight); + "Time : %u:%u:%u.%09u\n" + "Date : %u-%u-%u\n" + "Daylight : %u\n", + eft.hour, eft.minute, eft.second, eft.nanosecond, + eft.year, eft.month, eft.day, + eft.daylight); if ( eft.timezone == EFI_UNSPECIFIED_TIMEZONE) - p += sprintf(p, "Timezone : unspecified\n"); + p += sprintf(p, "Timezone : unspecified\n"); else /* XXX fixme: convert to string? */ - p += sprintf(p, "Timezone : %u\n", eft.timezone); + p += sprintf(p, "Timezone : %u\n", eft.timezone); p += sprintf(p, - "\nWakeup Alm:\n" - "Enabled : %s\n" - "Pending : %s\n" - "Year : %u\n" - "Month : %u\n" - "Day : %u\n" - "Hour : %u\n" - "Minute : %u\n" - "Second : %u\n" - "Nanosecond: %u\n" - "Daylight : %u\n", - enabled == 1 ? "Yes" : "No", - pending == 1 ? "Yes" : "No", - alm.year, alm.month, alm.day, alm.hour, alm.minute, - alm.second, alm.nanosecond, alm.daylight); + "Alarm Time : %u:%u:%u.%09u\n" + "Alarm Date : %u-%u-%u\n" + "Alarm Daylight : %u\n" + "Enabled : %s\n" + "Pending : %s\n", + alm.hour, alm.minute, alm.second, alm.nanosecond, + alm.year, alm.month, alm.day, + alm.daylight, + enabled == 1 ? "yes" : "no", + pending == 1 ? "yes" : "no"); if ( eft.timezone == EFI_UNSPECIFIED_TIMEZONE) - p += sprintf(p, "Timezone : unspecified\n"); + p += sprintf(p, "Timezone : unspecified\n"); else /* XXX fixme: convert to string? */ - p += sprintf(p, "Timezone : %u\n", eft.timezone); + p += sprintf(p, "Timezone : %u\n", alm.timezone); /* * now prints the capabilities */ p += sprintf(p, - "\nClock Cap :\n" - "Resolution: %u\n" - "Accuracy : %u\n" - "SetstoZero: %u\n", + "Resolution : %u\n" + "Accuracy : %u\n" + "SetstoZero : %u\n", cap.resolution, cap.accuracy, cap.sets_to_zero); return p - buf; @@ -390,7 +379,7 @@ misc_register(&efi_rtc_dev); - create_proc_read_entry ("efirtc", 0, NULL, efi_rtc_read_proc, NULL); + create_proc_read_entry ("driver/efirtc", 0, NULL, efi_rtc_read_proc, NULL); return 0; } diff -urN linux-2.4.18/drivers/char/hcdp_serial.c lia64-2.4/drivers/char/hcdp_serial.c --- linux-2.4.18/drivers/char/hcdp_serial.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/char/hcdp_serial.c Mon Jul 8 15:20:33 2002 @@ -0,0 +1,221 @@ +/* + * linux/drivers/char/hcdp_serial.c + * + * Copyright (C) 2002 Hewlett-Packard Co. + * Copyright (C) 2002 Khalid Aziz + * + * Parse the EFI HCDP table to locate serial console and debug ports + * and initialize them + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#undef SERIAL_DEBUG_HCDP + +extern struct serial_state rs_table[]; +extern int serial_nr_ports; + +/* + * Parse the HCDP table to find descriptions for headless console and + * debug serial ports and add them to rs_table[]. A pointer to HCDP + * table is passed as parameter. This function should be called + * before serial_console_init() is called to make sure the HCDP serial + * console will be available for use. IA-64 kernel calls this function + * from setup_arch() after the EFI and ACPI tables have been parsed. + */ +void __init setup_serial_hcdp(void *tablep) +{ + hcdp_t hcdp; + hcdp_dev_t *hcdp_dev; + struct serial_struct serial_req; + unsigned long iobase; + int global_sys_irq; + int i, nr; + int shift_once = 1; + +#ifdef SERIAL_DEBUG_HCDP + printk("Entering setup_serial_hcdp()\n"); +#endif + + /* Verify we have a valid table pointer */ + if (tablep == NULL) { + return; + } + + /* + * We do not trust firmware to give us a table starting at an + * aligned address. Make a local copy of the HCDP table with + * aligned structures. + */ + memcpy(&hcdp, tablep, sizeof(hcdp)); + + /* + * Perform a sanity check on the table. Table should have a + * signature of "HCDP" and it should be atleast 82 bytes + * long to have any useful information. + */ + if ((strncmp(hcdp.signature, HCDP_SIGNATURE, + HCDP_SIG_LEN) != 0)) { + return; + } + if (hcdp.len < 82) { + return; + } + +#ifdef SERIAL_DEBUG_HCDP + printk("setup_serial_hcdp(): table pointer = 0x%p\n", tablep); + printk(" sig = '%c%c%c%c'\n", + hcdp.signature[0], + hcdp.signature[1], + hcdp.signature[2], + hcdp.signature[3]); + printk(" length = %d\n", hcdp.len); + printk(" Rev = %d\n", hcdp.rev); + printk(" OEM ID = %c%c%c%c%c%c\n", + hcdp.oemid[0], hcdp.oemid[1], hcdp.oemid[2], + hcdp.oemid[3], hcdp.oemid[4], hcdp.oemid[5]); + printk(" Number of entries = %d\n", hcdp.num_entries); +#endif + + /* + * Parse each device entry + */ + for (nr=0; nrtype != HCDP_DEV_CONSOLE) + continue; + + iobase = (u64)(hcdp_dev->base_addr.addrhi)<<32 | hcdp_dev->base_addr.addrlo; + global_sys_irq = hcdp_dev->global_int; +#ifdef SERIAL_DEBUG_HCDP + printk(" type = %s\n", + ((hcdp_dev->type == HCDP_DEV_CONSOLE)?"Headless Console":((hcdp_dev->type == HCDP_DEV_DEBUG)?"Debug port":"Huh????"))); + printk(" Base address space = %s\n", ((hcdp_dev->base_addr.space_id == ACPI_MEM_SPACE)?"Memory Space":((hcdp_dev->base_addr.space_id == ACPI_IO_SPACE)?"I/O space":"PCI space"))); + printk(" Base address = 0x%p\n", iobase); + printk(" Global System Int = %d\n", global_sys_irq); + printk(" Baud rate = %d\n", hcdp_dev->baud); + printk(" Bits = %d\n", hcdp_dev->bits); + printk(" Clock rate = %d\n", hcdp_dev->clock_rate); + if (hcdp_dev->base_addr.space_id == ACPI_PCICONF_SPACE) { + printk(" PCI serial port:\n"); + printk(" Bus %d, Device %d, Vendor ID 0x%x, Dev ID 0x%x\n", + hcdp_dev->pci_bus, hcdp_dev->pci_dev, + hcdp_dev->pci_vendor_id, hcdp_dev->pci_dev_id); + } +#endif + + + /* + * Now build a serial_req structure to update the entry in + * rs_table for the headless console port. + */ + if (hcdp_dev->clock_rate) + serial_req.baud_base = hcdp_dev->clock_rate; + else + serial_req.baud_base = DEFAULT_BAUD_BASE; + /* + * Check if this is an I/O mapped address or a memory mapped address + */ + if (hcdp_dev->base_addr.space_id == ACPI_MEM_SPACE) { + serial_req.port = 0; + serial_req.port_high = 0; + serial_req.iomem_base = (void *)ioremap(iobase, 64); + serial_req.io_type = SERIAL_IO_MEM; + } + else if (hcdp_dev->base_addr.space_id == ACPI_IO_SPACE) { + serial_req.port = (unsigned long) iobase & 0xffffffff; + serial_req.port_high = (unsigned long)(((u64)iobase) >> 32); + serial_req.iomem_base = NULL; + serial_req.io_type = SERIAL_IO_PORT; + } + else if (hcdp_dev->base_addr.space_id == ACPI_PCICONF_SPACE) { + printk("WARNING: No support for PCI serial console\n"); + return; + } + + /* + * Check if HCDP defines a port already in rs_table + */ + for (i = 0; i < serial_nr_ports; i++) { + if ((rs_table[i].port == serial_req.port) && + (rs_table[i].iomem_base==serial_req.iomem_base)) + break; + } + if (i == serial_nr_ports) { + /* + * We have reserved a slot for HCDP defined console + * port at HCDP_SERIAL_CONSOLE_PORT in rs_table + * which is not 0. This means using this slot would + * put the console at a device other than ttyS0. + * Users expect to see the console at ttyS0. Now + * that we have determined HCDP does describe a + * serial console and it is not one of the compiled + * in ports, let us move the entries in rs_table + * up by a slot towards HCDP_SERIAL_CONSOLE_PORT to + * make room for the HCDP console at ttyS0. We may go + * through this loop more than once if + * early_serial_setup() fails. Make sure we shift the + * entries in rs_table only once. + */ + if (shift_once) { + int j; + + for (j=HCDP_SERIAL_CONSOLE_PORT; j>0; j--) + memcpy(rs_table+j, rs_table+j-1, + sizeof(struct serial_state)); + shift_once = 0; + } + serial_req.line = 0; + } + else + serial_req.line = i; + + /* + * If the table does not have IRQ information, use 0 for IRQ. + * This will force rs_init() to probe for IRQ. + */ + serial_req.irq = global_sys_irq; + if (global_sys_irq == 0) { + serial_req.flags = ASYNC_SKIP_TEST|ASYNC_BOOT_AUTOCONF; + } + else { + serial_req.flags = ASYNC_SKIP_TEST|ASYNC_BOOT_AUTOCONF| + ASYNC_AUTO_IRQ; + } + + serial_req.xmit_fifo_size = serial_req.custom_divisor = 0; + serial_req.close_delay = serial_req.hub6 = serial_req.closing_wait = 0; + serial_req.iomem_reg_shift = 0; + if (early_serial_setup(&serial_req) < 0) { + printk("setup_serial_hcdp(): early_serial_setup() for HCDP serial console port failed. Will try any additional consoles in HCDP.\n"); + continue; + } + else + if (hcdp_dev->type == HCDP_DEV_CONSOLE) + break; +#ifdef SERIAL_DEBUG_HCDP + printk("\n"); +#endif + } + +#ifdef SERIAL_DEBUG_HCDP + printk("Leaving setup_serial_hcdp()\n"); +#endif +} diff -urN linux-2.4.18/drivers/char/mem.c lia64-2.4/drivers/char/mem.c --- linux-2.4.18/drivers/char/mem.c Wed Dec 26 16:58:38 2001 +++ lia64-2.4/drivers/char/mem.c Fri Jul 19 17:11:49 2002 @@ -177,6 +177,11 @@ test_bit(X86_FEATURE_CYRIX_ARR, &boot_cpu_data.x86_capability) || test_bit(X86_FEATURE_CENTAUR_MCR, &boot_cpu_data.x86_capability) ) && addr >= __pa(high_memory); +#elif defined(__ia64__) + struct page *page; + + page = virt_to_page(__va(addr)); + return !VALID_PAGE(page) || PageReserved(page); #else return addr >= __pa(high_memory); #endif @@ -191,9 +196,15 @@ * through a file pointer that was marked O_SYNC will be * done non-cached. */ - if (noncached_address(offset) || (file->f_flags & O_SYNC)) + if (noncached_address(offset) || (file->f_flags & O_SYNC) + || (vma->vm_flags & VM_NONCACHED)) vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); +#ifdef MAP_WRITECOMBINED + if (vma->vm_flags & VM_WRITECOMBINED) + vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); +#endif + /* Don't try to swap out physical pages.. */ vma->vm_flags |= VM_RESERVED; @@ -506,13 +517,15 @@ switch (orig) { case 0: file->f_pos = offset; - return file->f_pos; + break; case 1: file->f_pos += offset; - return file->f_pos; + break; default: return -EINVAL; } + force_successful_syscall_return(); + return file->f_pos; } static int open_port(struct inode * inode, struct file * filp) diff -urN linux-2.4.18/drivers/char/pc_keyb.c lia64-2.4/drivers/char/pc_keyb.c --- linux-2.4.18/drivers/char/pc_keyb.c Mon Nov 26 11:18:32 2001 +++ lia64-2.4/drivers/char/pc_keyb.c Fri Mar 29 17:16:46 2002 @@ -802,6 +802,17 @@ { int status; +#ifdef CONFIG_IA64 + /* + * This is not really IA-64 specific. Probably ought to be done on all platforms + * that are (potentially) legacy-free. + */ + if (kbd_read_status() == 0xff && kbd_read_input() == 0xff) { + kbd_exists = 0; + return "No keyboard controller preset"; + } +#endif + /* * Test the keyboard interface. * This seems to be the only way to get it going. @@ -904,6 +915,10 @@ char *msg = initialize_kbd(); if (msg) printk(KERN_WARNING "initialize_kbd: %s\n", msg); +#ifdef CONFIG_IA64 + if (!kbd_exists) + return; +#endif } #if defined CONFIG_PSMOUSE diff -urN linux-2.4.18/drivers/char/serial.c lia64-2.4/drivers/char/serial.c --- linux-2.4.18/drivers/char/serial.c Tue Feb 26 11:04:09 2002 +++ lia64-2.4/drivers/char/serial.c Mon Jul 8 15:19:36 2002 @@ -321,11 +321,12 @@ MODULE_PARM_DESC(force_rsa, "Force I/O ports for RSA"); #endif /* CONFIG_SERIAL_RSA */ -static struct serial_state rs_table[RS_TABLE_SIZE] = { +struct serial_state rs_table[RS_TABLE_SIZE] = { SERIAL_PORT_DFNS /* Defined in serial.h */ }; #define NR_PORTS (sizeof(rs_table)/sizeof(struct serial_state)) +int serial_nr_ports = NR_PORTS; #if (defined(ENABLE_SERIAL_PCI) || defined(ENABLE_SERIAL_PNP)) #define NR_PCI_BOARDS 8 diff -urN linux-2.4.18/drivers/char/simserial.c lia64-2.4/drivers/char/simserial.c --- linux-2.4.18/drivers/char/simserial.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/char/simserial.c Fri Jul 19 23:26:48 2002 @@ -0,0 +1,1095 @@ +/* + * Simulated Serial Driver (fake serial) + * + * This driver is mostly used for bringup purposes and will go away. + * It has a strong dependency on the system console. All outputs + * are rerouted to the same facility as the one used by printk which, in our + * case means sys_sim.c console (goes via the simulator). The code hereafter + * is completely leveraged from the serial.c driver. + * + * Copyright (C) 1999-2000, 2002 Hewlett-Packard Co + * Stephane Eranian + * David Mosberger-Tang + * + * 02/04/00 D. Mosberger Merged in serial.c bug fixes in rs_close(). + * 02/25/00 D. Mosberger Synced up with 2.3.99pre-5 version of serial.c. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#undef SIMSERIAL_DEBUG /* define this to get some debug information */ + +#define KEYBOARD_INTR 3 /* must match with simulator! */ + +#define NR_PORTS 1 /* only one port for now */ +#define SERIAL_INLINE 1 + +#ifdef SERIAL_INLINE +#define _INLINE_ inline +#endif + +#ifndef MIN +#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#endif + +#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT) + +#define SSC_GETCHAR 21 + +extern long ia64_ssc (long, long, long, long, int); +extern void ia64_ssc_connect_irq (long intr, long irq); + +static char *serial_name = "SimSerial driver"; +static char *serial_version = "0.6"; + +/* + * This has been extracted from asm/serial.h. We need one eventually but + * I don't know exactly what we're going to put in it so just fake one + * for now. + */ +#define BASE_BAUD ( 1843200 / 16 ) + +#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) + +/* + * Most of the values here are meaningless to this particular driver. + * However some values must be preserved for the code (leveraged from serial.c + * to work correctly). + * port must not be 0 + * type must not be UNKNOWN + * So I picked arbitrary (guess from where?) values instead + */ +static struct serial_state rs_table[NR_PORTS]={ + /* UART CLK PORT IRQ FLAGS */ + { 0, BASE_BAUD, 0x3F8, 0, STD_COM_FLAGS,0,PORT_16550 } /* ttyS0 */ +}; + +/* + * Just for the fun of it ! + */ +static struct serial_uart_config uart_config[] = { + { "unknown", 1, 0 }, + { "8250", 1, 0 }, + { "16450", 1, 0 }, + { "16550", 1, 0 }, + { "16550A", 16, UART_CLEAR_FIFO | UART_USE_FIFO }, + { "cirrus", 1, 0 }, + { "ST16650", 1, UART_CLEAR_FIFO | UART_STARTECH }, + { "ST16650V2", 32, UART_CLEAR_FIFO | UART_USE_FIFO | + UART_STARTECH }, + { "TI16750", 64, UART_CLEAR_FIFO | UART_USE_FIFO}, + { 0, 0} +}; + +static struct tty_driver serial_driver, callout_driver; +static int serial_refcount; + +static struct async_struct *IRQ_ports[NR_IRQS]; +static struct tty_struct *serial_table[NR_PORTS]; +static struct termios *serial_termios[NR_PORTS]; +static struct termios *serial_termios_locked[NR_PORTS]; + +static struct console *console; + +static unsigned char *tmp_buf; +static DECLARE_MUTEX(tmp_buf_sem); + +extern struct console *console_drivers; /* from kernel/printk.c */ + +/* + * ------------------------------------------------------------ + * rs_stop() and rs_start() + * + * This routines are called before setting or resetting tty->stopped. + * They enable or disable transmitter interrupts, as necessary. + * ------------------------------------------------------------ + */ +static void rs_stop(struct tty_struct *tty) +{ +#ifdef SIMSERIAL_DEBUG + printk("rs_stop: tty->stopped=%d tty->hw_stopped=%d tty->flow_stopped=%d\n", + tty->stopped, tty->hw_stopped, tty->flow_stopped); +#endif + +} + +static void rs_start(struct tty_struct *tty) +{ +#if SIMSERIAL_DEBUG + printk("rs_start: tty->stopped=%d tty->hw_stopped=%d tty->flow_stopped=%d\n", + tty->stopped, tty->hw_stopped, tty->flow_stopped); +#endif +} + +static void receive_chars(struct tty_struct *tty, struct pt_regs *regs) +{ + unsigned char ch; + static unsigned char seen_esc = 0; + + while ( (ch = ia64_ssc(0, 0, 0, 0, SSC_GETCHAR)) ) { + if ( ch == 27 && seen_esc == 0 ) { + seen_esc = 1; + continue; + } else { + if ( seen_esc==1 && ch == 'O' ) { + seen_esc = 2; + continue; + } else if ( seen_esc == 2 ) { + if ( ch == 'P' ) show_state(); /* F1 key */ + if ( ch == 'Q' ) show_buffers(); /* F2 key */ + seen_esc = 0; + continue; + } + } + seen_esc = 0; + if (tty->flip.count >= TTY_FLIPBUF_SIZE) break; + + *tty->flip.char_buf_ptr = ch; + + *tty->flip.flag_buf_ptr = 0; + + tty->flip.flag_buf_ptr++; + tty->flip.char_buf_ptr++; + tty->flip.count++; + } + tty_flip_buffer_push(tty); +} + +/* + * This is the serial driver's interrupt routine for a single port + */ +static void rs_interrupt_single(int irq, void *dev_id, struct pt_regs * regs) +{ + struct async_struct * info; + + /* + * I don't know exactly why they don't use the dev_id opaque data + * pointer instead of this extra lookup table + */ + info = IRQ_ports[irq]; + if (!info || !info->tty) { + printk("simrs_interrupt_single: info|tty=0 info=%p problem\n", info); + return; + } + /* + * pretty simple in our case, because we only get interrupts + * on inbound traffic + */ + receive_chars(info->tty, regs); +} + +/* + * ------------------------------------------------------------------- + * Here ends the serial interrupt routines. + * ------------------------------------------------------------------- + */ + +#if 0 +/* + * not really used in our situation so keep them commented out for now + */ +static DECLARE_TASK_QUEUE(tq_serial); /* used to be at the top of the file */ +static void do_serial_bh(void) +{ + run_task_queue(&tq_serial); + printk("do_serial_bh: called\n"); +} +#endif + +static void do_softint(void *private_) +{ + printk("simserial: do_softint called\n"); +} + +static void rs_put_char(struct tty_struct *tty, unsigned char ch) +{ + struct async_struct *info = (struct async_struct *)tty->driver_data; + unsigned long flags; + + if (!tty || !info->xmit.buf) return; + + save_flags(flags); cli(); + if (CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE) == 0) { + restore_flags(flags); + return; + } + info->xmit.buf[info->xmit.head] = ch; + info->xmit.head = (info->xmit.head + 1) & (SERIAL_XMIT_SIZE-1); + restore_flags(flags); +} + +static _INLINE_ void transmit_chars(struct async_struct *info, int *intr_done) +{ + int count; + unsigned long flags; + + save_flags(flags); cli(); + + if (info->x_char) { + char c = info->x_char; + + console->write(console, &c, 1); + + info->state->icount.tx++; + info->x_char = 0; + + goto out; + } + + if (info->xmit.head == info->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { +#ifdef SIMSERIAL_DEBUG + printk("transmit_chars: head=%d, tail=%d, stopped=%d\n", + info->xmit.head, info->xmit.tail, info->tty->stopped); +#endif + goto out; + } + /* + * We removed the loop and try to do it in to chunks. We need + * 2 operations maximum because it's a ring buffer. + * + * First from current to tail if possible. + * Then from the beginning of the buffer until necessary + */ + + count = MIN(CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE), + SERIAL_XMIT_SIZE - info->xmit.tail); + console->write(console, info->xmit.buf+info->xmit.tail, count); + + info->xmit.tail = (info->xmit.tail+count) & (SERIAL_XMIT_SIZE-1); + + /* + * We have more at the beginning of the buffer + */ + count = CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); + if (count) { + console->write(console, info->xmit.buf, count); + info->xmit.tail += count; + } +out: + restore_flags(flags); +} + +static void rs_flush_chars(struct tty_struct *tty) +{ + struct async_struct *info = (struct async_struct *)tty->driver_data; + + if (info->xmit.head == info->xmit.tail || tty->stopped || tty->hw_stopped || + !info->xmit.buf) + return; + + transmit_chars(info, NULL); +} + + +static int rs_write(struct tty_struct * tty, int from_user, + const unsigned char *buf, int count) +{ + int c, ret = 0; + struct async_struct *info = (struct async_struct *)tty->driver_data; + unsigned long flags; + + if (!tty || !info->xmit.buf || !tmp_buf) return 0; + + save_flags(flags); + if (from_user) { + down(&tmp_buf_sem); + while (1) { + int c1; + c = CIRC_SPACE_TO_END(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); + if (count < c) + c = count; + if (c <= 0) + break; + + c -= copy_from_user(tmp_buf, buf, c); + if (!c) { + if (!ret) + ret = -EFAULT; + break; + } + cli(); + c1 = CIRC_SPACE_TO_END(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); + if (c1 < c) + c = c1; + memcpy(info->xmit.buf + info->xmit.head, tmp_buf, c); + info->xmit.head = ((info->xmit.head + c) & + (SERIAL_XMIT_SIZE-1)); + restore_flags(flags); + buf += c; + count -= c; + ret += c; + } + up(&tmp_buf_sem); + } else { + cli(); + while (1) { + c = CIRC_SPACE_TO_END(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); + if (count < c) + c = count; + if (c <= 0) { + break; + } + memcpy(info->xmit.buf + info->xmit.head, buf, c); + info->xmit.head = ((info->xmit.head + c) & + (SERIAL_XMIT_SIZE-1)); + buf += c; + count -= c; + ret += c; + } + restore_flags(flags); + } + /* + * Hey, we transmit directly from here in our case + */ + if (CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE) + && !tty->stopped && !tty->hw_stopped) { + transmit_chars(info, NULL); + } + return ret; +} + +static int rs_write_room(struct tty_struct *tty) +{ + struct async_struct *info = (struct async_struct *)tty->driver_data; + + return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); +} + +static int rs_chars_in_buffer(struct tty_struct *tty) +{ + struct async_struct *info = (struct async_struct *)tty->driver_data; + + return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); +} + +static void rs_flush_buffer(struct tty_struct *tty) +{ + struct async_struct *info = (struct async_struct *)tty->driver_data; + unsigned long flags; + + save_flags(flags); cli(); + info->xmit.head = info->xmit.tail = 0; + restore_flags(flags); + + wake_up_interruptible(&tty->write_wait); + + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && + tty->ldisc.write_wakeup) + (tty->ldisc.write_wakeup)(tty); +} + +/* + * This function is used to send a high-priority XON/XOFF character to + * the device + */ +static void rs_send_xchar(struct tty_struct *tty, char ch) +{ + struct async_struct *info = (struct async_struct *)tty->driver_data; + + info->x_char = ch; + if (ch) { + /* + * I guess we could call console->write() directly but + * let's do that for now. + */ + transmit_chars(info, NULL); + } +} + +/* + * ------------------------------------------------------------ + * rs_throttle() + * + * This routine is called by the upper-layer tty layer to signal that + * incoming characters should be throttled. + * ------------------------------------------------------------ + */ +static void rs_throttle(struct tty_struct * tty) +{ + if (I_IXOFF(tty)) rs_send_xchar(tty, STOP_CHAR(tty)); + + printk("simrs_throttle called\n"); +} + +static void rs_unthrottle(struct tty_struct * tty) +{ + struct async_struct *info = (struct async_struct *)tty->driver_data; + + if (I_IXOFF(tty)) { + if (info->x_char) + info->x_char = 0; + else + rs_send_xchar(tty, START_CHAR(tty)); + } + printk("simrs_unthrottle called\n"); +} + +/* + * rs_break() --- routine which turns the break handling on or off + */ +static void rs_break(struct tty_struct *tty, int break_state) +{ +} + +static int rs_ioctl(struct tty_struct *tty, struct file * file, + unsigned int cmd, unsigned long arg) +{ + if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && + (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) && + (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { + if (tty->flags & (1 << TTY_IO_ERROR)) + return -EIO; + } + + switch (cmd) { + case TIOCMGET: + printk("rs_ioctl: TIOCMGET called\n"); + return -EINVAL; + case TIOCMBIS: + case TIOCMBIC: + case TIOCMSET: + printk("rs_ioctl: TIOCMBIS/BIC/SET called\n"); + return -EINVAL; + case TIOCGSERIAL: + printk("simrs_ioctl TIOCGSERIAL called\n"); + return 0; + case TIOCSSERIAL: + printk("simrs_ioctl TIOCSSERIAL called\n"); + return 0; + case TIOCSERCONFIG: + printk("rs_ioctl: TIOCSERCONFIG called\n"); + return -EINVAL; + + case TIOCSERGETLSR: /* Get line status register */ + printk("rs_ioctl: TIOCSERGETLSR called\n"); + return -EINVAL; + + case TIOCSERGSTRUCT: + printk("rs_ioctl: TIOCSERGSTRUCT called\n"); +#if 0 + if (copy_to_user((struct async_struct *) arg, + info, sizeof(struct async_struct))) + return -EFAULT; +#endif + return 0; + + /* + * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change + * - mask passed in arg for lines of interest + * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking) + * Caller should use TIOCGICOUNT to see which one it was + */ + case TIOCMIWAIT: + printk("rs_ioctl: TIOCMIWAIT: called\n"); + return 0; + /* + * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) + * Return: write counters to the user passed counter struct + * NB: both 1->0 and 0->1 transitions are counted except for + * RI where only 0->1 is counted. + */ + case TIOCGICOUNT: + printk("rs_ioctl: TIOCGICOUNT called\n"); + return 0; + + case TIOCSERGWILD: + case TIOCSERSWILD: + /* "setserial -W" is called in Debian boot */ + printk ("TIOCSER?WILD ioctl obsolete, ignored.\n"); + return 0; + + default: + return -ENOIOCTLCMD; + } + return 0; +} + +#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) + +static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios) +{ + unsigned int cflag = tty->termios->c_cflag; + + if ( (cflag == old_termios->c_cflag) + && ( RELEVANT_IFLAG(tty->termios->c_iflag) + == RELEVANT_IFLAG(old_termios->c_iflag))) + return; + + + /* Handle turning off CRTSCTS */ + if ((old_termios->c_cflag & CRTSCTS) && + !(tty->termios->c_cflag & CRTSCTS)) { + tty->hw_stopped = 0; + rs_start(tty); + } +} +/* + * This routine will shutdown a serial port; interrupts are disabled, and + * DTR is dropped if the hangup on close termio flag is on. + */ +static void shutdown(struct async_struct * info) +{ + unsigned long flags; + struct serial_state *state; + int retval; + + if (!(info->flags & ASYNC_INITIALIZED)) return; + + state = info->state; + +#ifdef SIMSERIAL_DEBUG + printk("Shutting down serial port %d (irq %d)....", info->line, + state->irq); +#endif + + save_flags(flags); cli(); /* Disable interrupts */ + + /* + * First unlink the serial port from the IRQ chain... + */ + if (info->next_port) + info->next_port->prev_port = info->prev_port; + if (info->prev_port) + info->prev_port->next_port = info->next_port; + else + IRQ_ports[state->irq] = info->next_port; + + /* + * Free the IRQ, if necessary + */ + if (state->irq && (!IRQ_ports[state->irq] || + !IRQ_ports[state->irq]->next_port)) { + if (IRQ_ports[state->irq]) { + free_irq(state->irq, NULL); + retval = request_irq(state->irq, rs_interrupt_single, + IRQ_T(info), "serial", NULL); + + if (retval) + printk("serial shutdown: request_irq: error %d" + " Couldn't reacquire IRQ.\n", retval); + } else + free_irq(state->irq, NULL); + } + + if (info->xmit.buf) { + free_page((unsigned long) info->xmit.buf); + info->xmit.buf = 0; + } + + if (info->tty) set_bit(TTY_IO_ERROR, &info->tty->flags); + + info->flags &= ~ASYNC_INITIALIZED; + restore_flags(flags); +} + +/* + * ------------------------------------------------------------ + * rs_close() + * + * This routine is called when the serial port gets closed. First, we + * wait for the last remaining data to be sent. Then, we unlink its + * async structure from the interrupt chain if necessary, and we free + * that IRQ if nothing is left in the chain. + * ------------------------------------------------------------ + */ +static void rs_close(struct tty_struct *tty, struct file * filp) +{ + struct async_struct * info = (struct async_struct *)tty->driver_data; + struct serial_state *state; + unsigned long flags; + + if (!info ) return; + + state = info->state; + + save_flags(flags); cli(); + + if (tty_hung_up_p(filp)) { +#ifdef SIMSERIAL_DEBUG + printk("rs_close: hung_up\n"); +#endif + MOD_DEC_USE_COUNT; + restore_flags(flags); + return; + } +#ifdef SIMSERIAL_DEBUG + printk("rs_close ttys%d, count = %d\n", info->line, state->count); +#endif + if ((tty->count == 1) && (state->count != 1)) { + /* + * Uh, oh. tty->count is 1, which means that the tty + * structure will be freed. state->count should always + * be one in these conditions. If it's greater than + * one, we've got real problems, since it means the + * serial port won't be shutdown. + */ + printk("rs_close: bad serial port count; tty->count is 1, " + "state->count is %d\n", state->count); + state->count = 1; + } + if (--state->count < 0) { + printk("rs_close: bad serial port count for ttys%d: %d\n", + info->line, state->count); + state->count = 0; + } + if (state->count) { + MOD_DEC_USE_COUNT; + restore_flags(flags); + return; + } + info->flags |= ASYNC_CLOSING; + restore_flags(flags); + + /* + * Now we wait for the transmit buffer to clear; and we notify + * the line discipline to only process XON/XOFF characters. + */ + shutdown(info); + if (tty->driver.flush_buffer) tty->driver.flush_buffer(tty); + if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); + info->event = 0; + info->tty = 0; + if (info->blocked_open) { + if (info->close_delay) { + current->state = TASK_INTERRUPTIBLE; + schedule_timeout(info->close_delay); + } + wake_up_interruptible(&info->open_wait); + } + info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE|ASYNC_CLOSING); + wake_up_interruptible(&info->close_wait); + MOD_DEC_USE_COUNT; +} + +/* + * rs_wait_until_sent() --- wait until the transmitter is empty + */ +static void rs_wait_until_sent(struct tty_struct *tty, int timeout) +{ +} + + +/* + * rs_hangup() --- called by tty_hangup() when a hangup is signaled. + */ +static void rs_hangup(struct tty_struct *tty) +{ + struct async_struct * info = (struct async_struct *)tty->driver_data; + struct serial_state *state = info->state; + +#ifdef SIMSERIAL_DEBUG + printk("rs_hangup: called\n"); +#endif + + state = info->state; + + rs_flush_buffer(tty); + if (info->flags & ASYNC_CLOSING) + return; + shutdown(info); + + info->event = 0; + state->count = 0; + info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE); + info->tty = 0; + wake_up_interruptible(&info->open_wait); +} + + +static int get_async_struct(int line, struct async_struct **ret_info) +{ + struct async_struct *info; + struct serial_state *sstate; + + sstate = rs_table + line; + sstate->count++; + if (sstate->info) { + *ret_info = sstate->info; + return 0; + } + info = kmalloc(sizeof(struct async_struct), GFP_KERNEL); + if (!info) { + sstate->count--; + return -ENOMEM; + } + memset(info, 0, sizeof(struct async_struct)); + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); + init_waitqueue_head(&info->delta_msr_wait); + info->magic = SERIAL_MAGIC; + info->port = sstate->port; + info->flags = sstate->flags; + info->xmit_fifo_size = sstate->xmit_fifo_size; + info->line = line; + info->tqueue.routine = do_softint; + info->tqueue.data = info; + info->state = sstate; + if (sstate->info) { + kfree(info); + *ret_info = sstate->info; + return 0; + } + *ret_info = sstate->info = info; + return 0; +} + +static int +startup(struct async_struct *info) +{ + unsigned long flags; + int retval=0; + void (*handler)(int, void *, struct pt_regs *); + struct serial_state *state= info->state; + unsigned long page; + + page = get_free_page(GFP_KERNEL); + if (!page) + return -ENOMEM; + + save_flags(flags); cli(); + + if (info->flags & ASYNC_INITIALIZED) { + free_page(page); + goto errout; + } + + if (!state->port || !state->type) { + if (info->tty) set_bit(TTY_IO_ERROR, &info->tty->flags); + free_page(page); + goto errout; + } + if (info->xmit.buf) + free_page(page); + else + info->xmit.buf = (unsigned char *) page; + +#ifdef SIMSERIAL_DEBUG + printk("startup: ttys%d (irq %d)...", info->line, state->irq); +#endif + + /* + * Allocate the IRQ if necessary + */ + if (state->irq && (!IRQ_ports[state->irq] || + !IRQ_ports[state->irq]->next_port)) { + if (IRQ_ports[state->irq]) { + retval = -EBUSY; + goto errout; + } else + handler = rs_interrupt_single; + + retval = request_irq(state->irq, handler, IRQ_T(info), + "simserial", NULL); + if (retval) { + if (capable(CAP_SYS_ADMIN)) { + if (info->tty) + set_bit(TTY_IO_ERROR, + &info->tty->flags); + retval = 0; + } + goto errout; + } + } + + /* + * Insert serial port into IRQ chain. + */ + info->prev_port = 0; + info->next_port = IRQ_ports[state->irq]; + if (info->next_port) + info->next_port->prev_port = info; + IRQ_ports[state->irq] = info; + + if (info->tty) clear_bit(TTY_IO_ERROR, &info->tty->flags); + + info->xmit.head = info->xmit.tail = 0; + +#if 0 + /* + * Set up serial timers... + */ + timer_table[RS_TIMER].expires = jiffies + 2*HZ/100; + timer_active |= 1 << RS_TIMER; +#endif + + /* + * Set up the tty->alt_speed kludge + */ + if (info->tty) { + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) + info->tty->alt_speed = 57600; + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) + info->tty->alt_speed = 115200; + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) + info->tty->alt_speed = 230400; + if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) + info->tty->alt_speed = 460800; + } + + info->flags |= ASYNC_INITIALIZED; + restore_flags(flags); + return 0; + +errout: + restore_flags(flags); + return retval; +} + + +/* + * This routine is called whenever a serial port is opened. It + * enables interrupts for a serial port, linking in its async structure into + * the IRQ chain. It also performs the serial-specific + * initialization for the tty structure. + */ +static int rs_open(struct tty_struct *tty, struct file * filp) +{ + struct async_struct *info; + int retval, line; + unsigned long page; + + MOD_INC_USE_COUNT; + line = MINOR(tty->device) - tty->driver.minor_start; + if ((line < 0) || (line >= NR_PORTS)) { + MOD_DEC_USE_COUNT; + return -ENODEV; + } + retval = get_async_struct(line, &info); + if (retval) { + MOD_DEC_USE_COUNT; + return retval; + } + tty->driver_data = info; + info->tty = tty; + +#ifdef SIMSERIAL_DEBUG + printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line, + info->state->count); +#endif + info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; + + if (!tmp_buf) { + page = get_free_page(GFP_KERNEL); + if (!page) { + /* MOD_DEC_USE_COUNT; "info->tty" will cause this? */ + return -ENOMEM; + } + if (tmp_buf) + free_page(page); + else + tmp_buf = (unsigned char *) page; + } + + /* + * If the port is the middle of closing, bail out now + */ + if (tty_hung_up_p(filp) || + (info->flags & ASYNC_CLOSING)) { + if (info->flags & ASYNC_CLOSING) + interruptible_sleep_on(&info->close_wait); + /* MOD_DEC_USE_COUNT; "info->tty" will cause this? */ +#ifdef SERIAL_DO_RESTART + return ((info->flags & ASYNC_HUP_NOTIFY) ? + -EAGAIN : -ERESTARTSYS); +#else + return -EAGAIN; +#endif + } + + /* + * Start up serial port + */ + retval = startup(info); + if (retval) { + /* MOD_DEC_USE_COUNT; "info->tty" will cause this? */ + return retval; + } + + if ((info->state->count == 1) && + (info->flags & ASYNC_SPLIT_TERMIOS)) { + if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + *tty->termios = info->state->normal_termios; + else + *tty->termios = info->state->callout_termios; + } + + /* + * figure out which console to use (should be one already) + */ + console = console_drivers; + while (console) { + if ((console->flags & CON_ENABLED) && console->write) break; + console = console->next; + } + + info->session = current->session; + info->pgrp = current->pgrp; + +#ifdef SIMSERIAL_DEBUG + printk("rs_open ttys%d successful\n", info->line); +#endif + return 0; +} + +/* + * /proc fs routines.... + */ + +static inline int line_info(char *buf, struct serial_state *state) +{ + return sprintf(buf, "%d: uart:%s port:%lX irq:%d\n", + state->line, uart_config[state->type].name, + state->port, state->irq); +} + +static int rs_read_proc(char *page, char **start, off_t off, int count, + int *eof, void *data) +{ + int i, len = 0, l; + off_t begin = 0; + + len += sprintf(page, "simserinfo:1.0 driver:%s\n", serial_version); + for (i = 0; i < NR_PORTS && len < 4000; i++) { + l = line_info(page + len, &rs_table[i]); + len += l; + if (len+begin > off+count) + goto done; + if (len+begin < off) { + begin += len; + len = 0; + } + } + *eof = 1; +done: + if (off >= len+begin) + return 0; + *start = page + (begin-off); + return ((count < begin+len-off) ? count : begin+len-off); +} + +/* + * --------------------------------------------------------------------- + * rs_init() and friends + * + * rs_init() is called at boot-time to initialize the serial driver. + * --------------------------------------------------------------------- + */ + +/* + * This routine prints out the appropriate serial driver version + * number, and identifies which options were configured into this + * driver. + */ +static inline void show_serial_version(void) +{ + printk(KERN_INFO "%s version %s with", serial_name, serial_version); + printk(" no serial options enabled\n"); +} + +/* + * The serial driver boot-time initialization code! + */ +static int __init +simrs_init (void) +{ + int i; + struct serial_state *state; + + show_serial_version(); + + /* Initialize the tty_driver structure */ + + memset(&serial_driver, 0, sizeof(struct tty_driver)); + serial_driver.magic = TTY_DRIVER_MAGIC; + serial_driver.driver_name = "simserial"; + serial_driver.name = "ttyS"; + serial_driver.major = TTY_MAJOR; + serial_driver.minor_start = 64; + serial_driver.num = 1; + serial_driver.type = TTY_DRIVER_TYPE_SERIAL; + serial_driver.subtype = SERIAL_TYPE_NORMAL; + serial_driver.init_termios = tty_std_termios; + serial_driver.init_termios.c_cflag = + B9600 | CS8 | CREAD | HUPCL | CLOCAL; + serial_driver.flags = TTY_DRIVER_REAL_RAW; + serial_driver.refcount = &serial_refcount; + serial_driver.table = serial_table; + serial_driver.termios = serial_termios; + serial_driver.termios_locked = serial_termios_locked; + + serial_driver.open = rs_open; + serial_driver.close = rs_close; + serial_driver.write = rs_write; + serial_driver.put_char = rs_put_char; + serial_driver.flush_chars = rs_flush_chars; + serial_driver.write_room = rs_write_room; + serial_driver.chars_in_buffer = rs_chars_in_buffer; + serial_driver.flush_buffer = rs_flush_buffer; + serial_driver.ioctl = rs_ioctl; + serial_driver.throttle = rs_throttle; + serial_driver.unthrottle = rs_unthrottle; + serial_driver.send_xchar = rs_send_xchar; + serial_driver.set_termios = rs_set_termios; + serial_driver.stop = rs_stop; + serial_driver.start = rs_start; + serial_driver.hangup = rs_hangup; + serial_driver.break_ctl = rs_break; + serial_driver.wait_until_sent = rs_wait_until_sent; + serial_driver.read_proc = rs_read_proc; + + /* + * Let's have a little bit of fun ! + */ + for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) { + + if (state->type == PORT_UNKNOWN) continue; + + if (!state->irq) { + state->irq = ia64_alloc_irq(); + ia64_ssc_connect_irq(KEYBOARD_INTR, state->irq); + } + + printk(KERN_INFO "ttyS%02d at 0x%04lx (irq = %d) is a %s\n", + state->line, + state->port, state->irq, + uart_config[state->type].name); + } + /* + * The callout device is just like normal device except for + * major number and the subtype code. + */ + callout_driver = serial_driver; + callout_driver.name = "cua"; + callout_driver.major = TTYAUX_MAJOR; + callout_driver.subtype = SERIAL_TYPE_CALLOUT; + callout_driver.read_proc = 0; + callout_driver.proc_entry = 0; + + if (tty_register_driver(&serial_driver)) + panic("Couldn't register simserial driver\n"); + + if (tty_register_driver(&callout_driver)) + panic("Couldn't register callout driver\n"); + + return 0; +} + +#ifndef MODULE +__initcall(simrs_init); +#endif diff -urN linux-2.4.18/drivers/ide/ide-geometry.c lia64-2.4/drivers/ide/ide-geometry.c --- linux-2.4.18/drivers/ide/ide-geometry.c Mon Nov 26 11:18:36 2001 +++ lia64-2.4/drivers/ide/ide-geometry.c Mon Nov 26 11:21:31 2001 @@ -3,8 +3,11 @@ */ #include #include -#include #include + +#ifdef __i386__ +# include +#endif /* * We query CMOS about hard disks : it could be that we have a SCSI/ESDI/etc diff -urN linux-2.4.18/drivers/input/joydev.c lia64-2.4/drivers/input/joydev.c --- linux-2.4.18/drivers/input/joydev.c Wed Oct 10 16:31:46 2001 +++ lia64-2.4/drivers/input/joydev.c Wed Oct 10 16:34:43 2001 @@ -87,6 +87,12 @@ MODULE_LICENSE("GPL"); MODULE_SUPPORTED_DEVICE("input/js"); +static inline unsigned long +jiffies_to_msec (unsigned long t) +{ + return 1000*(t / HZ) + 1000*(t % HZ)/HZ; +} + static int joydev_correct(int value, struct js_corr *corr) { switch (corr->type) { @@ -134,7 +140,7 @@ return; } - event.time = jiffies * (1000 / HZ); + event.time = jiffies_to_msec(jiffies); while (list) { @@ -279,7 +285,7 @@ struct js_event event; - event.time = jiffies * (1000/HZ); + event.time = jiffies_to_msec(jiffies); if (list->startup < joydev->nkey) { event.type = JS_EVENT_BUTTON | JS_EVENT_INIT; diff -urN linux-2.4.18/drivers/media/radio/Makefile lia64-2.4/drivers/media/radio/Makefile --- linux-2.4.18/drivers/media/radio/Makefile Sun Aug 5 13:15:05 2001 +++ lia64-2.4/drivers/media/radio/Makefile Mon Aug 13 23:45:57 2001 @@ -11,7 +11,7 @@ # Object file lists. -obj-y := +obj-y := dummy.o obj-m := obj-n := obj- := diff -urN linux-2.4.18/drivers/media/radio/dummy.c lia64-2.4/drivers/media/radio/dummy.c --- linux-2.4.18/drivers/media/radio/dummy.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/media/radio/dummy.c Tue Jan 23 01:18:20 2001 @@ -0,0 +1 @@ +/* just so the linker knows what kind of object files it's deadling with... */ diff -urN linux-2.4.18/drivers/media/video/Makefile lia64-2.4/drivers/media/video/Makefile --- linux-2.4.18/drivers/media/video/Makefile Mon Nov 26 11:18:38 2001 +++ lia64-2.4/drivers/media/video/Makefile Mon Nov 26 11:21:33 2001 @@ -11,7 +11,7 @@ # Object file lists. -obj-y := +obj-y := dummy.o obj-m := obj-n := obj- := diff -urN linux-2.4.18/drivers/media/video/dummy.c lia64-2.4/drivers/media/video/dummy.c --- linux-2.4.18/drivers/media/video/dummy.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/media/video/dummy.c Mon Oct 30 22:17:11 2000 @@ -0,0 +1 @@ +/* just so the linker knows what kind of object files it's deadling with... */ diff -urN linux-2.4.18/drivers/message/fusion/Config.in lia64-2.4/drivers/message/fusion/Config.in --- linux-2.4.18/drivers/message/fusion/Config.in Fri Jul 6 17:03:11 2001 +++ lia64-2.4/drivers/message/fusion/Config.in Wed Feb 27 14:25:30 2002 @@ -7,10 +7,8 @@ if [ "$CONFIG_BLK_DEV_SD" = "y" -a "$CONFIG_FUSION" = "y" ]; then define_bool CONFIG_FUSION_BOOT y - comment "(ability to boot linux kernel from Fusion device is ENABLED!)" else define_bool CONFIG_FUSION_BOOT n - comment "(ability to boot linux kernel from Fusion device is DISABLED!)" fi if [ "$CONFIG_MODULES" = "y" ]; then diff -urN linux-2.4.18/drivers/message/fusion/Makefile lia64-2.4/drivers/message/fusion/Makefile --- linux-2.4.18/drivers/message/fusion/Makefile Mon Sep 24 15:07:19 2001 +++ lia64-2.4/drivers/message/fusion/Makefile Wed Feb 27 14:25:30 2002 @@ -27,6 +27,7 @@ #EXTRA_CFLAGS += -DDEBUG #EXTRA_CFLAGS += -DMPT_DEBUG #EXTRA_CFLAGS += -DMPT_DEBUG_MSG_FRAME +#EXTRA_CFLAGS += -DMPT_DEBUG_SG # # driver/module specifics... # @@ -34,11 +35,13 @@ #CFLAGS_mptbase.o += -DMPT_DEBUG_HANDSHAKE #CFLAGS_mptbase.o += -DMPT_DEBUG_IRQ # -# For {mptscsih, mptctl}: +# For mptscsih: #CFLAGS_mptscsih.o += -DMPT_SCSI_USE_NEW_EH #CFLAGS_mptscsih.o += -DMPT_DEBUG_SCANDV -#CFLAGS_mptscsih.o += -DMPT_DEBUG_SG -#CFLAGS_mptctl.o += -DMPT_DEBUG_SG +#CFLAGS_mptscsih.o += -DMPT_DEBUG_RESET +# +# For mptctl: +#CFLAGS_mptctl.o += -DMPT_DEBUG_IOCTL # # For mptlan: #CFLAGS_mptlan.o += -DMPT_LAN_IO_DEBUG diff -urN linux-2.4.18/drivers/message/fusion/isense.c lia64-2.4/drivers/message/fusion/isense.c --- linux-2.4.18/drivers/message/fusion/isense.c Wed Oct 24 10:17:52 2001 +++ lia64-2.4/drivers/message/fusion/isense.c Tue Mar 19 15:05:36 2002 @@ -5,12 +5,13 @@ * Error Report logging output. This module implements SCSI-3 * Opcode lookup and a sorted table of SCSI-3 ASC/ASCQ strings. * - * Copyright (c) 1991-2001 Steven J. Ralston + * Copyright (c) 1991-2002 Steven J. Ralston * Written By: Steven J. Ralston * (yes I wrote some of the orig. code back in 1991!) - * (mailto:Steve.Ralston@lsil.com) + * (mailto:sjralston1@netscape.net) + * (mailto:Pam.Delaney@lsil.com) * - * $Id: isense.c,v 1.28.14.1 2001/08/24 20:07:04 sralston Exp $ + * $Id: isense.c,v 1.33 2002/02/27 18:44:19 sralston Exp $ */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* @@ -49,11 +50,15 @@ */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -#include +#include #include +#include #include #include -#include +#include +#if defined (__sparc__) +#include +#endif /* Hmmm, avoid undefined spinlock_t on lk-2.2.14-5.0 */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) @@ -61,7 +66,7 @@ #endif #define MODULEAUTHOR "Steven J. Ralston" -#define COPYRIGHT "Copyright (c) 2001 " MODULEAUTHOR +#define COPYRIGHT "Copyright (c) 2001-2002 " MODULEAUTHOR #include "mptbase.h" #include "isense.h" @@ -87,7 +92,6 @@ EXPORT_NO_SYMBOLS; MODULE_AUTHOR(MODULEAUTHOR); MODULE_DESCRIPTION(my_NAME); -MODULE_LICENSE("GPL"); /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ int __init isense_init(void) diff -urN linux-2.4.18/drivers/message/fusion/linux_compat.h lia64-2.4/drivers/message/fusion/linux_compat.h --- linux-2.4.18/drivers/message/fusion/linux_compat.h Fri Jul 6 17:03:11 2001 +++ lia64-2.4/drivers/message/fusion/linux_compat.h Fri Jul 19 18:32:12 2002 @@ -11,6 +11,16 @@ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +#ifndef rwlock_init +#define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while(0) +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) +#define SET_NICE(current,x) do {(current)->nice = (x);} while (0) +#else +#define SET_NICE(current,x) +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) # if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) typedef unsigned int dma_addr_t; @@ -58,12 +68,33 @@ extern inline __cleanup_module_func_t __cleanup_module_inline(void) \ { return x; } -#else +#else #define module_init(x) __initcall(x); #define module_exit(x) __exitcall(x); #endif /* } block snipped from lk-2.2.18/include/linux/init.h */ +/* This block snipped from lk-2.2.18/include/linux/sched.h { */ +/* + * Used prior to schedule_timeout calls.. + */ +#define __set_current_state(state_value) do { current->state = state_value; } while (0) +#ifdef __SMP__ +#define set_current_state(state_value) do { __set_current_state(state_value); mb(); } while (0) +#else +#define set_current_state(state_value) __set_current_state(state_value) +#endif +/* } block snipped from lk-2.2.18/include/linux/sched.h */ + +/* procfs compat stuff... */ +#define proc_mkdir(x,y) create_proc_entry(x, S_IFDIR, y) + +/* MUTEX compat stuff... */ +#define DECLARE_MUTEX(name) struct semaphore name=MUTEX +#define DECLARE_MUTEX_LOCKED(name) struct semaphore name=MUTEX_LOCKED +#define init_MUTEX(x) *(x)=MUTEX +#define init_MUTEX_LOCKED(x) *(x)=MUTEX_LOCKED + /* Wait queues. */ #define DECLARE_WAIT_QUEUE_HEAD(name) \ struct wait_queue * (name) = NULL @@ -90,6 +121,17 @@ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) */ +/* + * Inclined to use: + * #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10) + * here, but MODULE_LICENSE defined in 2.4.9-6 and 2.4.9-13 + * breaks the rule:-( + */ +#ifndef MODULE_LICENSE +#define MODULE_LICENSE(license) +#endif + + /* PCI/driver subsystem { */ #ifndef pci_for_each_dev #define pci_for_each_dev(dev) for((dev)=pci_devices; (dev)!=NULL; (dev)=(dev)->next) @@ -120,26 +162,6 @@ #endif /* } ifndef pci_for_each_dev */ -/* procfs compat stuff... */ -#ifdef CONFIG_PROC_FS -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,28) -#define CREATE_PROCDIR_ENTRY(x,y) create_proc_entry(x, S_IFDIR, y) -/* This is a macro so we don't need to pull all the procfs - * headers into this file. -DaveM - */ -#define create_proc_read_entry(name, mode, base, __read_proc, __data) \ -({ struct proc_dir_entry *__res=create_proc_entry(name,mode,base); \ - if (__res) { \ - __res->read_proc=(__read_proc); \ - __res->data=(__data); \ - } \ - __res; \ -}) -#else -#define CREATE_PROCDIR_ENTRY(x,y) proc_mkdir(x, y) -#endif -#endif - /* Compatability for the 2.3.x PCI DMA API. */ #ifndef PCI_DMA_BIDIRECTIONAL /*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ @@ -193,6 +215,7 @@ /*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ #endif /* PCI_DMA_BIDIRECTIONAL */ + /*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ #endif /* _LINUX_COMPAT_H */ diff -urN linux-2.4.18/drivers/message/fusion/lsi/fc_log.h lia64-2.4/drivers/message/fusion/lsi/fc_log.h --- linux-2.4.18/drivers/message/fusion/lsi/fc_log.h Mon Sep 24 15:07:19 2001 +++ lia64-2.4/drivers/message/fusion/lsi/fc_log.h Wed Feb 27 14:25:30 2002 @@ -7,7 +7,7 @@ * in the IOCLogInfo field of a MPI Default Reply Message. * * CREATION DATE: 6/02/2000 - * ID: $Id: fc_log.h,v 4.5 2001/06/07 19:18:00 sschremm Exp $ + * ID: $Id: fc_log.h,v 4.6 2001/07/26 14:41:33 sschremm Exp $ */ @@ -62,7 +62,7 @@ MPI_IOCLOGINFO_FC_TARGET_MRSP_KILLED_BY_LIP = 0x2100000a, /* Manual Response not sent due to a LIP */ MPI_IOCLOGINFO_FC_TARGET_NO_CLASS_3 = 0x2100000b, /* not sent because remote node does not support Class 3 */ MPI_IOCLOGINFO_FC_TARGET_LOGIN_NOT_VALID = 0x2100000c, /* not sent because login to remote node not validated */ - MPI_IOCLOGINFO_FC_TARGET_FROM_OUTBOUND = 0x2100000e, /* cleared from the outbound after a logout */ + MPI_IOCLOGINFO_FC_TARGET_FROM_OUTBOUND = 0x2100000e, /* cleared from the outbound queue after a logout */ MPI_IOCLOGINFO_FC_TARGET_WAITING_FOR_DATA_IN = 0x2100000f, /* cleared waiting for data after a logout */ MPI_IOCLOGINFO_FC_LAN_BASE = 0x22000000, diff -urN linux-2.4.18/drivers/message/fusion/lsi/mpi.h lia64-2.4/drivers/message/fusion/lsi/mpi.h --- linux-2.4.18/drivers/message/fusion/lsi/mpi.h Mon Sep 24 15:07:19 2001 +++ lia64-2.4/drivers/message/fusion/lsi/mpi.h Wed Feb 27 14:25:30 2002 @@ -6,7 +6,7 @@ * Title: MPI Message independent structures and definitions * Creation Date: July 27, 2000 * - * MPI Version: 01.01.07 + * MPI Version: 01.02.03 * * Version History * --------------- @@ -39,6 +39,11 @@ * Added function codes for RAID. * 04-09-01 01.01.07 Added alternate define for MPI_DOORBELL_ACTIVE, * MPI_DOORBELL_USED, to better match the spec. + * 08-08-01 01.02.01 Original release for v1.2 work. + * Changed MPI_VERSION_MINOR from 0x01 to 0x02. + * Added define MPI_FUNCTION_TOOLBOX. + * 09-28-01 01.02.02 New function code MPI_SCSI_ENCLOSURE_PROCESSOR. + * 11-01-01 01.02.03 Changed name to MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR. * -------------------------------------------------------------------------- */ @@ -53,7 +58,7 @@ *****************************************************************************/ #define MPI_VERSION_MAJOR (0x01) -#define MPI_VERSION_MINOR (0x01) +#define MPI_VERSION_MINOR (0x02) #define MPI_VERSION ((MPI_VERSION_MAJOR << 8) | MPI_VERSION_MINOR) /* Note: The major versions of 0xe0 through 0xff are reserved */ @@ -216,8 +221,12 @@ #define MPI_FUNCTION_FC_COMMON_TRANSPORT_SEND (0x13) #define MPI_FUNCTION_FC_PRIMITIVE_SEND (0x14) -#define MPI_FUNCTION_RAID_VOLUME (0x15) +#define MPI_FUNCTION_RAID_ACTION (0x15) #define MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH (0x16) + +#define MPI_FUNCTION_TOOLBOX (0x17) + +#define MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR (0x18) #define MPI_FUNCTION_LAN_SEND (0x20) #define MPI_FUNCTION_LAN_RECEIVE (0x21) diff -urN linux-2.4.18/drivers/message/fusion/lsi/mpi_cnfg.h lia64-2.4/drivers/message/fusion/lsi/mpi_cnfg.h --- linux-2.4.18/drivers/message/fusion/lsi/mpi_cnfg.h Mon Sep 24 15:07:19 2001 +++ lia64-2.4/drivers/message/fusion/lsi/mpi_cnfg.h Wed Feb 27 14:25:30 2002 @@ -6,7 +6,7 @@ * Title: MPI Config message, structures, and Pages * Creation Date: July 27, 2000 * - * MPI Version: 01.01.11 + * MPI Version: 01.02.05 * * Version History * --------------- @@ -72,6 +72,42 @@ * Added IO Unit Page 3. * Modified defines for Scsi Port Page 2. * Modified RAID Volume Pages. + * 08-08-01 01.02.01 Original release for v1.2 work. + * Added SepID and SepBus to RVP2 IMPhysicalDisk struct. + * Added defines for the SEP bits in RVP2 VolumeSettings. + * Modified the DeviceSettings field in RVP2 to use the + * proper structure. + * Added defines for SES, SAF-TE, and cross channel for + * IOCPage2 CapabilitiesFlags. + * Removed define for MPI_IOUNITPAGE2_FLAGS_RAID_DISABLE. + * Removed define for + * MPI_SCSIPORTPAGE2_PORT_FLAGS_PARITY_ENABLE. + * Added define for MPI_CONFIG_PAGEATTR_RO_PERSISTENT. + * 08-29-01 01.02.02 Fixed value for MPI_MANUFACTPAGE_DEVID_53C1035. + * Added defines for MPI_FCPORTPAGE1_FLAGS_HARD_ALPA_ONLY + * and MPI_FCPORTPAGE1_FLAGS_IMMEDIATE_ERROR_REPLY. + * Removed MPI_SCSIPORTPAGE0_CAP_PACING_TRANSFERS, + * MPI_SCSIDEVPAGE0_NP_PACING_TRANSFERS, and + * MPI_SCSIDEVPAGE1_RP_PACING_TRANSFERS, and + * MPI_SCSIDEVPAGE1_CONF_PPR_ALLOWED. + * Added defines for MPI_SCSIDEVPAGE1_CONF_WDTR_DISALLOWED + * and MPI_SCSIDEVPAGE1_CONF_SDTR_DISALLOWED. + * Added OnBusTimerValue to CONFIG_PAGE_SCSI_PORT_1. + * Added rejected bits to SCSI Device Page 0 Information. + * Increased size of ALPA array in FC Port Page 2 by one + * and removed a one byte reserved field. + * 09-28-01 01.02.03 Swapped NegWireSpeedLow and NegWireSpeedLow in + * CONFIG_PAGE_LAN_1 to match preferred 64-bit ordering. + * Added structures for Manufacturing Page 4, IO Unit + * Page 3, IOC Page 3, IOC Page 4, RAID Volume Page 0, and + * RAID PhysDisk Page 0. + * 10-04-01 01.02.04 Added define for MPI_CONFIG_PAGETYPE_RAID_PHYSDISK. + * Modified some of the new defines to make them 32 + * character unique. + * Modified how variable length pages (arrays) are defined. + * Added generic defines for hot spare pools and RAID + * volume types. + * 11-01-01 01.02.05 Added define for MPI_IOUNITPAGE1_DISABLE_IR. * -------------------------------------------------------------------------- */ @@ -104,12 +140,13 @@ fCONFIG_PAGE_HEADER_UNION, MPI_POINTER PTR_CONFIG_PAGE_HEADER_UNION; -/****************************************************************************/ -/* PageType field values */ -/****************************************************************************/ +/**************************************************************************** +* PageType field values +****************************************************************************/ #define MPI_CONFIG_PAGEATTR_READ_ONLY (0x00) #define MPI_CONFIG_PAGEATTR_CHANGEABLE (0x10) #define MPI_CONFIG_PAGEATTR_PERSISTENT (0x20) +#define MPI_CONFIG_PAGEATTR_RO_PERSISTENT (0x30) #define MPI_CONFIG_PAGEATTR_MASK (0xF0) #define MPI_CONFIG_PAGETYPE_IO_UNIT (0x00) @@ -122,29 +159,21 @@ #define MPI_CONFIG_PAGETYPE_LAN (0x07) #define MPI_CONFIG_PAGETYPE_RAID_VOLUME (0x08) #define MPI_CONFIG_PAGETYPE_MANUFACTURING (0x09) +#define MPI_CONFIG_PAGETYPE_RAID_PHYSDISK (0x0A) #define MPI_CONFIG_PAGETYPE_MASK (0x0F) #define MPI_CONFIG_TYPENUM_MASK (0x0FFF) /**************************************************************************** - * PageAddres field values - ****************************************************************************/ +* PageAddress field values +****************************************************************************/ #define MPI_SCSI_PORT_PGAD_PORT_MASK (0x000000FF) -#define MPI_SCSI_DEVICE_FORM_MASK (0xF0000000) -#define MPI_SCSI_DEVICE_FORM_TARGETID (0x00000000) -#define MPI_SCSI_DEVICE_FORM_RAID_PHYS_DEV_NUM (0x10000000) #define MPI_SCSI_DEVICE_TARGET_ID_MASK (0x000000FF) #define MPI_SCSI_DEVICE_TARGET_ID_SHIFT (0) #define MPI_SCSI_DEVICE_BUS_MASK (0x0000FF00) #define MPI_SCSI_DEVICE_BUS_SHIFT (8) -#define MPI_SCSI_DEVICE_VOLUME_TARG_ID_MASK (0x000000FF) -#define MPI_SCSI_DEVICE_VOLUME_TARG_ID_SHIFT (0) -#define MPI_SCSI_DEVICE_VOLUME_BUS_MASK (0x0000FF00) -#define MPI_SCSI_DEVICE_VOLUME_BUS_SHIFT (8) -#define MPI_SCSI_DEVICE_PHYS_DISK_NUM_MASK (0x00FF0000) -#define MPI_SCSI_DEVICE_PHYS_DISK_NUM_SHIFT (16) #define MPI_FC_PORT_PGAD_PORT_MASK (0xF0000000) #define MPI_FC_PORT_PGAD_PORT_SHIFT (28) @@ -167,10 +196,14 @@ #define MPI_FC_DEVICE_PGAD_BT_TID_MASK (0x000000FF) #define MPI_FC_DEVICE_PGAD_BT_TID_SHIFT (0) +#define MPI_PHYSDISK_PGAD_PHYSDISKNUM_MASK (0x000000FF) +#define MPI_PHYSDISK_PGAD_PHYSDISKNUM_SHIFT (0) + -/****************************************************************************/ -/* Config Request Message */ -/****************************************************************************/ + +/**************************************************************************** +* Config Request Message +****************************************************************************/ typedef struct _MSG_CONFIG { U8 Action; /* 00h */ @@ -181,16 +214,16 @@ U8 MsgFlags; /* 07h */ U32 MsgContext; /* 08h */ U8 Reserved2[8]; /* 0Ch */ - fCONFIG_PAGE_HEADER Header; /* 14h */ + fCONFIG_PAGE_HEADER Header; /* 14h */ U32 PageAddress; /* 18h */ SGE_IO_UNION PageBufferSGE; /* 1Ch */ } MSG_CONFIG, MPI_POINTER PTR_MSG_CONFIG, Config_t, MPI_POINTER pConfig_t; -/****************************************************************************/ -/* Action field values */ -/****************************************************************************/ +/**************************************************************************** +* Action field values +****************************************************************************/ #define MPI_CONFIG_ACTION_PAGE_HEADER (0x00) #define MPI_CONFIG_ACTION_PAGE_READ_CURRENT (0x01) #define MPI_CONFIG_ACTION_PAGE_WRITE_CURRENT (0x02) @@ -213,7 +246,7 @@ U8 Reserved2[2]; /* 0Ch */ U16 IOCStatus; /* 0Eh */ U32 IOCLogInfo; /* 10h */ - fCONFIG_PAGE_HEADER Header; /* 14h */ + fCONFIG_PAGE_HEADER Header; /* 14h */ } MSG_CONFIG_REPLY, MPI_POINTER PTR_MSG_CONFIG_REPLY, ConfigReply_t, MPI_POINTER pConfigReply_t; @@ -225,19 +258,24 @@ * *****************************************************************************/ -/****************************************************************************/ -/* Manufacturing Config pages */ -/****************************************************************************/ +/**************************************************************************** +* Manufacturing Config pages +****************************************************************************/ #define MPI_MANUFACTPAGE_DEVICEID_FC909 (0x0621) #define MPI_MANUFACTPAGE_DEVICEID_FC919 (0x0624) #define MPI_MANUFACTPAGE_DEVICEID_FC929 (0x0622) +#define MPI_MANUFACTPAGE_DEVICEID_FC919X (0x0628) +#define MPI_MANUFACTPAGE_DEVICEID_FC929X (0x0626) #define MPI_MANUFACTPAGE_DEVID_53C1030 (0x0030) #define MPI_MANUFACTPAGE_DEVID_53C1030ZC (0x0031) -#define MPI_MANUFACTPAGE_DEVID_53C1035 (0x0035) +#define MPI_MANUFACTPAGE_DEVID_1030_53C1035 (0x0032) +#define MPI_MANUFACTPAGE_DEVID_1030ZC_53C1035 (0x0033) +#define MPI_MANUFACTPAGE_DEVID_53C1035 (0x0040) +#define MPI_MANUFACTPAGE_DEVID_53C1035ZC (0x0041) typedef struct _CONFIG_PAGE_MANUFACTURING_0 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U8 ChipName[16]; /* 04h */ U8 ChipRevision[8]; /* 14h */ U8 BoardName[16]; /* 1Ch */ @@ -252,7 +290,7 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_1 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U8 VPD[256]; /* 04h */ } fCONFIG_PAGE_MANUFACTURING_1, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_1, ManufacturingPage1_t, MPI_POINTER pManufacturingPage1_t; @@ -269,35 +307,72 @@ MpiChipRevisionId_t, MPI_POINTER pMpiChipRevisionId_t; +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check Header.PageLength at runtime. + */ +#ifndef MPI_MAN_PAGE_2_HW_SETTINGS_WORDS +#define MPI_MAN_PAGE_2_HW_SETTINGS_WORDS (1) +#endif + typedef struct _CONFIG_PAGE_MANUFACTURING_2 { - fCONFIG_PAGE_HEADER Header; /* 00h */ - MPI_CHIP_REVISION_ID ChipId; /* 04h */ - U32 HwSettings[1]; /* 08h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ + MPI_CHIP_REVISION_ID ChipId; /* 04h */ + U32 HwSettings[MPI_MAN_PAGE_2_HW_SETTINGS_WORDS];/* 08h */ } fCONFIG_PAGE_MANUFACTURING_2, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_2, ManufacturingPage2_t, MPI_POINTER pManufacturingPage2_t; #define MPI_MANUFACTURING2_PAGEVERSION (0x00) +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check Header.PageLength at runtime. + */ +#ifndef MPI_MAN_PAGE_3_INFO_WORDS +#define MPI_MAN_PAGE_3_INFO_WORDS (1) +#endif + typedef struct _CONFIG_PAGE_MANUFACTURING_3 { - fCONFIG_PAGE_HEADER Header; /* 00h */ - MPI_CHIP_REVISION_ID ChipId; /* 04h */ - U32 Info[1]; /* 08h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ + MPI_CHIP_REVISION_ID ChipId; /* 04h */ + U32 Info[MPI_MAN_PAGE_3_INFO_WORDS];/* 08h */ } fCONFIG_PAGE_MANUFACTURING_3, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_3, ManufacturingPage3_t, MPI_POINTER pManufacturingPage3_t; #define MPI_MANUFACTURING3_PAGEVERSION (0x00) -/****************************************************************************/ -/* IO Unit Config Pages */ -/****************************************************************************/ +typedef struct _CONFIG_PAGE_MANUFACTURING_4 +{ + fCONFIG_PAGE_HEADER Header; /* 00h */ + U32 Reserved1; /* 04h */ + U8 InfoOffset0; /* 08h */ + U8 InfoSize0; /* 09h */ + U8 InfoOffset1; /* 0Ah */ + U8 InfoSize1; /* 0Bh */ + U8 InquirySize; /* 0Ch */ + U8 Reserved2; /* 0Dh */ + U16 Reserved3; /* 0Eh */ + U8 InquiryData[56]; /* 10h */ + U32 ISVolumeSettings; /* 48h */ + U32 IMEVolumeSettings; /* 4Ch */ + U32 IMVolumeSettings; /* 50h */ +} fCONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4, + ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t; + +#define MPI_MANUFACTURING4_PAGEVERSION (0x00) + + +/**************************************************************************** +* IO Unit Config Pages +****************************************************************************/ typedef struct _CONFIG_PAGE_IO_UNIT_0 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U64 UniqueValue; /* 04h */ } fCONFIG_PAGE_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_0, IOUnitPage0_t, MPI_POINTER pIOUnitPage0_t; @@ -307,18 +382,20 @@ typedef struct _CONFIG_PAGE_IO_UNIT_1 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 Flags; /* 04h */ } fCONFIG_PAGE_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_1, IOUnitPage1_t, MPI_POINTER pIOUnitPage1_t; #define MPI_IOUNITPAGE1_PAGEVERSION (0x00) +/* IO Unit Page 1 Flags defines */ + #define MPI_IOUNITPAGE1_MULTI_FUNCTION (0x00000000) #define MPI_IOUNITPAGE1_SINGLE_FUNCTION (0x00000001) #define MPI_IOUNITPAGE1_MULTI_PATHING (0x00000002) #define MPI_IOUNITPAGE1_SINGLE_PATHING (0x00000000) - +#define MPI_IOUNITPAGE1_DISABLE_IR (0x00000040) #define MPI_IOUNITPAGE1_FORCE_32 (0x00000080) @@ -335,7 +412,7 @@ typedef struct _CONFIG_PAGE_IO_UNIT_2 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 Flags; /* 04h */ U32 BiosVersion; /* 08h */ MPI_ADAPTER_INFO AdapterOrder[4]; /* 0Ch */ @@ -344,38 +421,45 @@ #define MPI_IOUNITPAGE2_PAGEVERSION (0x00) -#define MPI_IOUNITPAGE2_FLAGS_RAID_DISABLE (0x00000001) #define MPI_IOUNITPAGE2_FLAGS_PAUSE_ON_ERROR (0x00000002) #define MPI_IOUNITPAGE2_FLAGS_VERBOSE_ENABLE (0x00000004) #define MPI_IOUNITPAGE2_FLAGS_COLOR_VIDEO_DISABLE (0x00000008) #define MPI_IOUNITPAGE2_FLAGS_DONT_HOOK_INT_40 (0x00000010) +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check Header.PageLength at runtime. + */ +#ifndef MPI_IO_UNIT_PAGE_3_GPIO_VAL_MAX +#define MPI_IO_UNIT_PAGE_3_GPIO_VAL_MAX (1) +#endif + typedef struct _CONFIG_PAGE_IO_UNIT_3 { - fCONFIG_PAGE_HEADER Header; /* 00h */ - U32 VolumeSettings; /* 04h */ - U8 InfoOffset0; /* 08h */ - U8 InfoSize0; /* 09h */ - U8 InfoOffset1; /* 0Ah */ - U8 InfoSize1; /* 0Bh */ - U8 InquirySize; /* 0Ch */ - U8 Reserved; /* 0Dh */ - U16 Reserved2; /* 0Eh */ - U8 InquiryData[56]; /* 10h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ + U8 GPIOCount; /* 04h */ + U8 Reserved1; /* 05h */ + U16 Reserved2; /* 06h */ + U16 GPIOVal[MPI_IO_UNIT_PAGE_3_GPIO_VAL_MAX]; /* 08h */ } fCONFIG_PAGE_IO_UNIT_3, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_3, IOUnitPage3_t, MPI_POINTER pIOUnitPage3_t; -#define MPI_IOUNITPAGE3_PAGEVERSION (0x00) +#define MPI_IOUNITPAGE3_PAGEVERSION (0x01) + +#define MPI_IOUNITPAGE3_GPIO_FUNCTION_MASK (0xFC) +#define MPI_IOUNITPAGE3_GPIO_FUNCTION_SHIFT (2) +#define MPI_IOUNITPAGE3_GPIO_SETTING_OFF (0x00) +#define MPI_IOUNITPAGE3_GPIO_SETTING_ON (0x01) -/****************************************************************************/ -/* IOC Config Pages */ -/****************************************************************************/ +/**************************************************************************** +* IOC Config Pages +****************************************************************************/ typedef struct _CONFIG_PAGE_IOC_0 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 TotalNVStore; /* 04h */ U32 FreeNVStore; /* 08h */ U16 VendorID; /* 0Ch */ @@ -393,7 +477,7 @@ typedef struct _CONFIG_PAGE_IOC_1 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 Flags; /* 04h */ U32 CoalescingTimeout; /* 08h */ U8 CoalescingDepth; /* 0Ch */ @@ -408,53 +492,120 @@ typedef struct _CONFIG_PAGE_IOC_2_RAID_VOL { - U8 VolumeTargetID; /* 00h */ - U8 VolumeBus; /* 01h */ - U16 Reserved; /* 02h */ - U8 VolumeVersionMinor; /* 04h */ - U8 VolumeVersionMajor; /* 05h */ - U8 VolumeRaidType; /* 06h */ - U8 Reserved1; /* 07h */ + U8 VolumeID; /* 00h */ + U8 VolumeBus; /* 01h */ + U8 VolumeIOC; /* 02h */ + U8 VolumePageNumber; /* 03h */ + U8 VolumeType; /* 04h */ + U8 Reserved2; /* 05h */ + U16 Reserved3; /* 06h */ } fCONFIG_PAGE_IOC_2_RAID_VOL, MPI_POINTER PTR_CONFIG_PAGE_IOC_2_RAID_VOL, ConfigPageIoc2RaidVol_t, MPI_POINTER pConfigPageIoc2RaidVol_t; +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check Header.PageLength at runtime. + */ +#ifndef MPI_IOC_PAGE_2_RAID_VOLUME_MAX +#define MPI_IOC_PAGE_2_RAID_VOLUME_MAX (1) +#endif + typedef struct _CONFIG_PAGE_IOC_2 { - fCONFIG_PAGE_HEADER Header; /* 00h */ - U32 CapabilitiesFlags; /* 04h */ - U8 NumActiveVolumes; /* 08h */ - U8 MaxVolumes; /* 09h */ - U16 Reserved; /* 0Ah */ - fCONFIG_PAGE_IOC_2_RAID_VOL RaidVolume[1]; /* 0Ch */ + fCONFIG_PAGE_HEADER Header; /* 00h */ + U32 CapabilitiesFlags; /* 04h */ + U8 NumActiveVolumes; /* 08h */ + U8 MaxVolumes; /* 09h */ + U8 NumActivePhysDisks; /* 0Ah */ + U8 MaxPhysDisks; /* 0Bh */ + fCONFIG_PAGE_IOC_2_RAID_VOL RaidVolume[MPI_IOC_PAGE_2_RAID_VOLUME_MAX];/* 0Ch */ } fCONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2, IOCPage2_t, MPI_POINTER pIOCPage2_t; -#define MPI_IOCPAGE2_PAGEVERSION (0x00) +#define MPI_IOCPAGE2_PAGEVERSION (0x01) /* IOC Page 2 Capabilities flags */ -#define MPI_IOCPAGE2_CAP_FLAGS_RAID_0_SUPPORT (0x00000001) -#define MPI_IOCPAGE2_CAP_FLAGS_RAID_1_SUPPORT (0x00000002) -#define MPI_IOCPAGE2_CAP_FLAGS_LSI_MIRROR_SUPPORT (0x00000004) -#define MPI_IOCPAGE2_CAP_FLAGS_RAID_5_SUPPORT (0x00000008) -#define MPI_IOCPAGE2_CAP_FLAGS_RAID_10_SUPPORT (0x00000010) - -/* IOC Page 2 Volume RAID Type values */ - -#define MPI_IOCPAGE2_VOL_TYPE_RAID_0 (0x00) -#define MPI_IOCPAGE2_VOL_TYPE_RAID_1 (0x01) -#define MPI_IOCPAGE2_VOL_TYPE_LSI_MIRROR (0x02) -#define MPI_IOCPAGE2_VOL_TYPE_RAID_5 (0x05) -#define MPI_IOCPAGE2_VOL_TYPE_RAID_10 (0x0A) - - -/****************************************************************************/ -/* SCSI Port Config Pages */ -/****************************************************************************/ +#define MPI_IOCPAGE2_CAP_FLAGS_IS_SUPPORT (0x00000001) +#define MPI_IOCPAGE2_CAP_FLAGS_IME_SUPPORT (0x00000002) +#define MPI_IOCPAGE2_CAP_FLAGS_IM_SUPPORT (0x00000004) +#define MPI_IOCPAGE2_CAP_FLAGS_SES_SUPPORT (0x20000000) +#define MPI_IOCPAGE2_CAP_FLAGS_SAFTE_SUPPORT (0x40000000) +#define MPI_IOCPAGE2_CAP_FLAGS_CROSS_CHANNEL_SUPPORT (0x80000000) + +/* IOC Page 2 Volume RAID Type values, also used in RAID Volume pages */ + +#define MPI_RAID_VOL_TYPE_IS (0x00) +#define MPI_RAID_VOL_TYPE_IME (0x01) +#define MPI_RAID_VOL_TYPE_IM (0x02) + + +typedef struct _IOC_3_PHYS_DISK +{ + U8 PhysDiskID; /* 00h */ + U8 PhysDiskBus; /* 01h */ + U8 PhysDiskIOC; /* 02h */ + U8 PhysDiskNum; /* 03h */ +} IOC_3_PHYS_DISK, MPI_POINTER PTR_IOC_3_PHYS_DISK, + Ioc3PhysDisk_t, MPI_POINTER pIoc3PhysDisk_t; + +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check Header.PageLength at runtime. + */ +#ifndef MPI_IOC_PAGE_3_PHYSDISK_MAX +#define MPI_IOC_PAGE_3_PHYSDISK_MAX (1) +#endif + +typedef struct _CONFIG_PAGE_IOC_3 +{ + fCONFIG_PAGE_HEADER Header; /* 00h */ + U8 NumPhysDisks; /* 04h */ + U8 Reserved1; /* 05h */ + U16 Reserved2; /* 06h */ + IOC_3_PHYS_DISK PhysDisk[MPI_IOC_PAGE_3_PHYSDISK_MAX]; /* 08h */ +} fCONFIG_PAGE_IOC_3, MPI_POINTER PTR_CONFIG_PAGE_IOC_3, + IOCPage3_t, MPI_POINTER pIOCPage3_t; + +#define MPI_IOCPAGE3_PAGEVERSION (0x00) + + +typedef struct _IOC_4_SEP +{ + U8 SEPTargetID; /* 00h */ + U8 SEPBus; /* 01h */ + U16 Reserved; /* 02h */ +} IOC_4_SEP, MPI_POINTER PTR_IOC_4_SEP, + Ioc4Sep_t, MPI_POINTER pIoc4Sep_t; + +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check Header.PageLength at runtime. + */ +#ifndef MPI_IOC_PAGE_4_SEP_MAX +#define MPI_IOC_PAGE_4_SEP_MAX (1) +#endif + +typedef struct _CONFIG_PAGE_IOC_4 +{ + fCONFIG_PAGE_HEADER Header; /* 00h */ + U8 ActiveSEP; /* 04h */ + U8 MaxSEP; /* 05h */ + U16 Reserved1; /* 06h */ + IOC_4_SEP SEP[MPI_IOC_PAGE_4_SEP_MAX]; /* 08h */ +} fCONFIG_PAGE_IOC_4, MPI_POINTER PTR_CONFIG_PAGE_IOC_4, + IOCPage4_t, MPI_POINTER pIOCPage4_t; + +#define MPI_IOCPAGE4_PAGEVERSION (0x00) + + +/**************************************************************************** +* SCSI Port Config Pages +****************************************************************************/ typedef struct _CONFIG_PAGE_SCSI_PORT_0 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 Capabilities; /* 04h */ U32 PhysicalInterface; /* 08h */ } fCONFIG_PAGE_SCSI_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_0, @@ -465,7 +616,6 @@ #define MPI_SCSIPORTPAGE0_CAP_IU (0x00000001) #define MPI_SCSIPORTPAGE0_CAP_DT (0x00000002) #define MPI_SCSIPORTPAGE0_CAP_QAS (0x00000004) -#define MPI_SCSIPORTPAGE0_CAP_PACING_TRANSFERS (0x00000008) #define MPI_SCSIPORTPAGE0_CAP_MIN_SYNC_PERIOD_MASK (0x0000FF00) #define MPI_SCSIPORTPAGE0_CAP_MAX_SYNC_OFFSET_MASK (0x00FF0000) #define MPI_SCSIPORTPAGE0_CAP_WIDE (0x20000000) @@ -479,12 +629,13 @@ typedef struct _CONFIG_PAGE_SCSI_PORT_1 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 Configuration; /* 04h */ + U32 OnBusTimerValue; /* 08h */ } fCONFIG_PAGE_SCSI_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_1, SCSIPortPage1_t, MPI_POINTER pSCSIPortPage1_t; -#define MPI_SCSIPORTPAGE1_PAGEVERSION (0x01) +#define MPI_SCSIPORTPAGE1_PAGEVERSION (0x02) #define MPI_SCSIPORTPAGE1_CFG_PORT_SCSI_ID_MASK (0x000000FF) #define MPI_SCSIPORTPAGE1_CFG_PORT_RESPONSE_ID_MASK (0xFFFF0000) @@ -500,7 +651,7 @@ typedef struct _CONFIG_PAGE_SCSI_PORT_2 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 PortFlags; /* 04h */ U32 PortSettings; /* 08h */ MPI_DEVICE_INFO DeviceSettings[16]; /* 0Ch */ @@ -510,7 +661,6 @@ #define MPI_SCSIPORTPAGE2_PAGEVERSION (0x01) #define MPI_SCSIPORTPAGE2_PORT_FLAGS_SCAN_HIGH_TO_LOW (0x00000001) -#define MPI_SCSIPORTPAGE2_PORT_FLAGS_PARITY_ENABLE (0x00000002) #define MPI_SCSIPORTPAGE2_PORT_FLAGS_AVOID_SCSI_RESET (0x00000004) #define MPI_SCSIPORTPAGE2_PORT_FLAGS_ALTERNATE_CHS (0x00000008) #define MPI_SCSIPORTPAGE2_PORT_FLAGS_TERMINATION_DISABLE (0x00000010) @@ -536,47 +686,48 @@ #define MPI_SCSIPORTPAGE2_DEVICE_BOOT_CHOICE (0x0020) -/****************************************************************************/ -/* SCSI Target Device Config Pages */ -/****************************************************************************/ +/**************************************************************************** +* SCSI Target Device Config Pages +****************************************************************************/ typedef struct _CONFIG_PAGE_SCSI_DEVICE_0 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 NegotiatedParameters; /* 04h */ U32 Information; /* 08h */ } fCONFIG_PAGE_SCSI_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_0, SCSIDevicePage0_t, MPI_POINTER pSCSIDevicePage0_t; -#define MPI_SCSIDEVPAGE0_PAGEVERSION (0x01) +#define MPI_SCSIDEVPAGE0_PAGEVERSION (0x02) #define MPI_SCSIDEVPAGE0_NP_IU (0x00000001) #define MPI_SCSIDEVPAGE0_NP_DT (0x00000002) #define MPI_SCSIDEVPAGE0_NP_QAS (0x00000004) -#define MPI_SCSIDEVPAGE0_NP_PACING_TRANSFERS (0x00000008) #define MPI_SCSIDEVPAGE0_NP_NEG_SYNC_PERIOD_MASK (0x0000FF00) #define MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK (0x00FF0000) #define MPI_SCSIDEVPAGE0_NP_WIDE (0x20000000) #define MPI_SCSIDEVPAGE0_NP_AIP (0x80000000) #define MPI_SCSIDEVPAGE0_INFO_PARAMS_NEGOTIATED (0x00000001) +#define MPI_SCSIDEVPAGE0_INFO_SDTR_REJECTED (0x00000002) +#define MPI_SCSIDEVPAGE0_INFO_WDTR_REJECTED (0x00000004) +#define MPI_SCSIDEVPAGE0_INFO_PPR_REJECTED (0x00000008) typedef struct _CONFIG_PAGE_SCSI_DEVICE_1 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 RequestedParameters; /* 04h */ U32 Reserved; /* 08h */ U32 Configuration; /* 0Ch */ } fCONFIG_PAGE_SCSI_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_1, SCSIDevicePage1_t, MPI_POINTER pSCSIDevicePage1_t; -#define MPI_SCSIDEVPAGE1_PAGEVERSION (0x02) +#define MPI_SCSIDEVPAGE1_PAGEVERSION (0x03) #define MPI_SCSIDEVPAGE1_RP_IU (0x00000001) #define MPI_SCSIDEVPAGE1_RP_DT (0x00000002) #define MPI_SCSIDEVPAGE1_RP_QAS (0x00000004) -#define MPI_SCSIDEVPAGE1_RP_PACING_TRANSFERS (0x00000008) #define MPI_SCSIDEVPAGE1_RP_MIN_SYNC_PERIOD_MASK (0x0000FF00) #define MPI_SCSIDEVPAGE1_RP_MAX_SYNC_OFFSET_MASK (0x00FF0000) #define MPI_SCSIDEVPAGE1_RP_WIDE (0x20000000) @@ -585,12 +736,13 @@ #define MPI_SCSIDEVPAGE1_DV_LVD_DRIVE_STRENGTH_MASK (0x00000003) #define MPI_SCSIDEVPAGE1_DV_SE_SLEW_RATE_MASK (0x00000300) -#define MPI_SCSIDEVPAGE1_CONF_PPR_ALLOWED (0x00000001) +#define MPI_SCSIDEVPAGE1_CONF_WDTR_DISALLOWED (0x00000002) +#define MPI_SCSIDEVPAGE1_CONF_SDTR_DISALLOWED (0x00000004) typedef struct _CONFIG_PAGE_SCSI_DEVICE_2 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 DomainValidation; /* 04h */ U32 ParityPipeSelect; /* 08h */ U32 DataPipeSelect; /* 0Ch */ @@ -629,13 +781,13 @@ #define MPI_SCSIDEVPAGE2_DPS_BIT_15_PL_SELECT_MASK (0xC0000000) -/****************************************************************************/ -/* FC Port Config Pages */ -/****************************************************************************/ +/**************************************************************************** +* FC Port Config Pages +****************************************************************************/ typedef struct _CONFIG_PAGE_FC_PORT_0 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 Flags; /* 04h */ U8 MPIPortNumber; /* 08h */ U8 LinkType; /* 09h */ @@ -715,7 +867,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_1 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 Flags; /* 04h */ U64 NoSEEPROMWWNN; /* 08h */ U64 NoSEEPROMWWPN; /* 10h */ @@ -726,8 +878,10 @@ } fCONFIG_PAGE_FC_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_1, FCPortPage1_t, MPI_POINTER pFCPortPage1_t; -#define MPI_FCPORTPAGE1_PAGEVERSION (0x01) +#define MPI_FCPORTPAGE1_PAGEVERSION (0x02) +#define MPI_FCPORTPAGE1_FLAGS_EXT_FCP_STATUS_EN (0x08000000) +#define MPI_FCPORTPAGE1_FLAGS_IMMEDIATE_ERROR_REPLY (0x04000000) #define MPI_FCPORTPAGE1_FLAGS_SORT_BY_DID (0x00000001) #define MPI_FCPORTPAGE1_FLAGS_SORT_BY_WWN (0x00000000) @@ -747,22 +901,21 @@ #define MPI_FCPORTPAGE1_LCONFIG_SPEED_10GIG (0x03) #define MPI_FCPORTPAGE1_LCONFIG_SPEED_AUTO (0x0F) -#define MPI_FCPORTPAGE1_TOPOLGY_MASK (0x0F) -#define MPI_FCPORTPAGE1_TOPOLGY_NLPORT (0x01) -#define MPI_FCPORTPAGE1_TOPOLGY_NPORT (0x02) -#define MPI_FCPORTPAGE1_TOPOLGY_AUTO (0x0F) +#define MPI_FCPORTPAGE1_TOPOLOGY_MASK (0x0F) +#define MPI_FCPORTPAGE1_TOPOLOGY_NLPORT (0x01) +#define MPI_FCPORTPAGE1_TOPOLOGY_NPORT (0x02) +#define MPI_FCPORTPAGE1_TOPOLOGY_AUTO (0x0F) typedef struct _CONFIG_PAGE_FC_PORT_2 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U8 NumberActive; /* 04h */ - U8 ALPA[126]; /* 05h */ - U8 Reserved; /* 83h */ + U8 ALPA[127]; /* 05h */ } fCONFIG_PAGE_FC_PORT_2, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_2, FCPortPage2_t, MPI_POINTER pFCPortPage2_t; -#define MPI_FCPORTPAGE2_PAGEVERSION (0x00) +#define MPI_FCPORTPAGE2_PAGEVERSION (0x01) typedef struct _WWN_FORMAT @@ -795,10 +948,18 @@ #define MPI_PERSISTENT_FLAGS_BOOT_DEVICE (0x0008) #define MPI_PERSISTENT_FLAGS_BY_DID (0x0080) +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check Header.PageLength at runtime. + */ +#ifndef MPI_FC_PORT_PAGE_3_ENTRY_MAX +#define MPI_FC_PORT_PAGE_3_ENTRY_MAX (1) +#endif + typedef struct _CONFIG_PAGE_FC_PORT_3 { - fCONFIG_PAGE_HEADER Header; /* 00h */ - FC_PORT_PERSISTENT Entry[1]; /* 04h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ + FC_PORT_PERSISTENT Entry[MPI_FC_PORT_PAGE_3_ENTRY_MAX]; /* 04h */ } fCONFIG_PAGE_FC_PORT_3, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_3, FCPortPage3_t, MPI_POINTER pFCPortPage3_t; @@ -807,7 +968,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_4 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 PortFlags; /* 04h */ U32 PortSettings; /* 08h */ } fCONFIG_PAGE_FC_PORT_4, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_4, @@ -833,13 +994,22 @@ U16 Reserved; /* 02h */ U64 AliasWWNN; /* 04h */ U64 AliasWWPN; /* 0Ch */ -} fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5_ALIAS_INFO, +} fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO, + MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5_ALIAS_INFO, FcPortPage5AliasInfo_t, MPI_POINTER pFcPortPage5AliasInfo_t; +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check Header.PageLength at runtime. + */ +#ifndef MPI_FC_PORT_PAGE_5_ALIAS_MAX +#define MPI_FC_PORT_PAGE_5_ALIAS_MAX (1) +#endif + typedef struct _CONFIG_PAGE_FC_PORT_5 { - fCONFIG_PAGE_HEADER Header; /* 00h */ - fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO AliasInfo[1]; /* 04h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO AliasInfo[MPI_FC_PORT_PAGE_5_ALIAS_MAX];/* 04h */ } fCONFIG_PAGE_FC_PORT_5, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5, FCPortPage5_t, MPI_POINTER pFCPortPage5_t; @@ -851,7 +1021,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_6 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 Reserved; /* 04h */ U64 TimeSinceReset; /* 08h */ U64 TxFrames; /* 10h */ @@ -877,7 +1047,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_7 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 Reserved; /* 04h */ U8 PortSymbolicName[256]; /* 08h */ } fCONFIG_PAGE_FC_PORT_7, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_7, @@ -888,7 +1058,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_8 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 BitVector[8]; /* 04h */ } fCONFIG_PAGE_FC_PORT_8, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_8, FCPortPage8_t, MPI_POINTER pFCPortPage8_t; @@ -898,7 +1068,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_9 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U32 Reserved; /* 04h */ U64 GlobalWWPN; /* 08h */ U64 GlobalWWNN; /* 10h */ @@ -916,13 +1086,13 @@ #define MPI_FCPORTPAGE9_PAGEVERSION (0x00) -/****************************************************************************/ -/* FC Device Config Pages */ -/****************************************************************************/ +/**************************************************************************** +* FC Device Config Pages +****************************************************************************/ typedef struct _CONFIG_PAGE_FC_DEVICE_0 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U64 WWNN; /* 04h */ U64 WWPN; /* 0Ch */ U32 PortIdentifier; /* 14h */ @@ -947,112 +1117,191 @@ #define MPI_FC_DEVICE_PAGE0_PROT_FCP_TARGET (0x02) #define MPI_FC_DEVICE_PAGE0_PROT_FCP_INITIATOR (0x04) -#define MPI_FC_DEVICE_PAGE0_PGAD_PORT_MASK (MPI_FC_DEVICE_PGAD_PORT_MASK) -#define MPI_FC_DEVICE_PAGE0_PGAD_FORM_MASK (MPI_FC_DEVICE_PGAD_FORM_MASK) -#define MPI_FC_DEVICE_PAGE0_PGAD_FORM_NEXT_DID (MPI_FC_DEVICE_PGAD_FORM_NEXT_DID) -#define MPI_FC_DEVICE_PAGE0_PGAD_FORM_BUS_TID (MPI_FC_DEVICE_PGAD_FORM_BUS_TID) -#define MPI_FC_DEVICE_PAGE0_PGAD_DID_MASK (MPI_FC_DEVICE_PGAD_ND_DID_MASK) -#define MPI_FC_DEVICE_PAGE0_PGAD_BUS_MASK (MPI_FC_DEVICE_PGAD_BT_BUS_MASK) -#define MPI_FC_DEVICE_PAGE0_PGAD_BUS_SHIFT (MPI_FC_DEVICE_PGAD_BT_BUS_SHIFT) -#define MPI_FC_DEVICE_PAGE0_PGAD_TID_MASK (MPI_FC_DEVICE_PGAD_BT_TID_MASK) - - -/****************************************************************************/ -/* RAID Volume Config Pages */ -/****************************************************************************/ - -typedef struct _RAIDVOL2_IM_PHYS_ID -{ - U8 TargetID; /* 00h */ - U8 Bus; /* 01h */ - U8 IocNumber; /* 02h */ - U8 PhysDiskNumber; /* 03h */ - U8 Reserved[8]; /* 04h */ - U8 PhysicalDiskIdentifier[16]; /* 0Ch */ - U8 VendorId[8]; /* 1Ch */ - U8 ProductId[16]; /* 24h */ - U8 ProductRevLevel[4]; /* 34h */ - U32 Reserved1; /* 38h */ - U8 Info[32]; /* 3Ch */ -} RAIDVOL2_IM_PHYS_ID, MPI_POINTER PTR_RAIDVOL2_IM_PHYS_ID, - RaidVol2ImPhysicalID_t, MPI_POINTER pRaidVol2ImPhysicalID_t; - -typedef struct _RAIDVOL2_IM_DISK_INFO -{ - U32 DiskStatus; /* 00h */ - U32 DeviceSettings; /* 04h */ - U16 ErrorCount; /* 08h */ - U16 Reserved; /* 0Ah */ - U8 ErrorCdbByte; /* 0Ch */ - U8 ErrorSenseKey; /* 0Dh */ - U8 ErrorASC; /* 0Eh */ - U8 ErrorASCQ; /* 0Fh */ - U16 SmartCount; /* 10h */ - U8 SmartASC; /* 12h */ - U8 SmartASCQ; /* 13h */ -} RAIDVOL2_IM_DISK_INFO, MPI_POINTER PTR_RAIDVOL2_IM_DISK_INFO, - RaidVol2ImDiskInfo_t, MPI_POINTER pRaidVol2ImDiskInfo_t; +#define MPI_FC_DEVICE_PAGE0_PGAD_PORT_MASK (MPI_FC_DEVICE_PGAD_PORT_MASK) +#define MPI_FC_DEVICE_PAGE0_PGAD_FORM_MASK (MPI_FC_DEVICE_PGAD_FORM_MASK) +#define MPI_FC_DEVICE_PAGE0_PGAD_FORM_NEXT_DID (MPI_FC_DEVICE_PGAD_FORM_NEXT_DID) +#define MPI_FC_DEVICE_PAGE0_PGAD_FORM_BUS_TID (MPI_FC_DEVICE_PGAD_FORM_BUS_TID) +#define MPI_FC_DEVICE_PAGE0_PGAD_DID_MASK (MPI_FC_DEVICE_PGAD_ND_DID_MASK) +#define MPI_FC_DEVICE_PAGE0_PGAD_BUS_MASK (MPI_FC_DEVICE_PGAD_BT_BUS_MASK) +#define MPI_FC_DEVICE_PAGE0_PGAD_BUS_SHIFT (MPI_FC_DEVICE_PGAD_BT_BUS_SHIFT) +#define MPI_FC_DEVICE_PAGE0_PGAD_TID_MASK (MPI_FC_DEVICE_PGAD_BT_TID_MASK) + + +/**************************************************************************** +* RAID Volume Config Pages +****************************************************************************/ + +typedef struct _RAID_VOL0_PHYS_DISK +{ + U16 Reserved; /* 00h */ + U8 PhysDiskMap; /* 02h */ + U8 PhysDiskNum; /* 03h */ +} RAID_VOL0_PHYS_DISK, MPI_POINTER PTR_RAID_VOL0_PHYS_DISK, + RaidVol0PhysDisk_t, MPI_POINTER pRaidVol0PhysDisk_t; + +#define MPI_RAIDVOL0_PHYSDISK_PRIMARY (0x01) +#define MPI_RAIDVOL0_PHYSDISK_SECONDARY (0x02) + +typedef struct _RAID_VOL0_STATUS +{ + U8 Flags; /* 00h */ + U8 State; /* 01h */ + U16 Reserved; /* 02h */ +} RAID_VOL0_STATUS, MPI_POINTER PTR_RAID_VOL0_STATUS, + RaidVol0Status_t, MPI_POINTER pRaidVol0Status_t; + +/* RAID Volume Page 0 VolumeStatus defines */ + +#define MPI_RAIDVOL0_STATUS_FLAG_ENABLED (0x01) +#define MPI_RAIDVOL0_STATUS_FLAG_QUIESCED (0x02) +#define MPI_RAIDVOL0_STATUS_FLAG_RESYNC_IN_PROGRESS (0x04) + +#define MPI_RAIDVOL0_STATUS_STATE_OPTIMAL (0x00) +#define MPI_RAIDVOL0_STATUS_STATE_DEGRADED (0x01) +#define MPI_RAIDVOL0_STATUS_STATE_FAILED (0x02) + +typedef struct _RAID_VOL0_SETTINGS +{ + U16 Settings; /* 00h */ + U8 HotSparePool; /* 01h */ /* MPI_RAID_HOT_SPARE_POOL_ */ + U8 Reserved; /* 02h */ +} RAID_VOL0_SETTINGS, MPI_POINTER PTR_RAID_VOL0_SETTINGS, + RaidVol0Settings, MPI_POINTER pRaidVol0Settings; + +/* RAID Volume Page 0 VolumeSettings defines */ + +#define MPI_RAIDVOL0_SETTING_WRITE_CACHING_ENABLE (0x0001) +#define MPI_RAIDVOL0_SETTING_OFFLINE_ON_SMART (0x0002) +#define MPI_RAIDVOL0_SETTING_AUTO_CONFIGURE (0x0004) +#define MPI_RAIDVOL0_SETTING_PRIORITY_RESYNC (0x0008) +#define MPI_RAIDVOL0_SETTING_USE_PRODUCT_ID_SUFFIX (0x0010) +#define MPI_RAIDVOL0_SETTING_USE_DEFAULTS (0x8000) + +/* RAID Volume Page 0 HotSparePool defines, also used in RAID Physical Disk */ +#define MPI_RAID_HOT_SPARE_POOL_0 (0x01) +#define MPI_RAID_HOT_SPARE_POOL_1 (0x02) +#define MPI_RAID_HOT_SPARE_POOL_2 (0x04) +#define MPI_RAID_HOT_SPARE_POOL_3 (0x08) +#define MPI_RAID_HOT_SPARE_POOL_4 (0x10) +#define MPI_RAID_HOT_SPARE_POOL_5 (0x20) +#define MPI_RAID_HOT_SPARE_POOL_6 (0x40) +#define MPI_RAID_HOT_SPARE_POOL_7 (0x80) + +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check Header.PageLength at runtime. + */ +#ifndef MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX +#define MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX (1) +#endif + +typedef struct _CONFIG_PAGE_RAID_VOL_0 +{ + fCONFIG_PAGE_HEADER Header; /* 00h */ + U8 VolumeID; /* 04h */ + U8 VolumeBus; /* 05h */ + U8 VolumeIOC; /* 06h */ + U8 VolumeType; /* 07h */ /* MPI_RAID_VOL_TYPE_ */ + RAID_VOL0_STATUS VolumeStatus; /* 08h */ + RAID_VOL0_SETTINGS VolumeSettings; /* 0Ch */ + U32 MaxLBA; /* 10h */ + U32 Reserved1; /* 14h */ + U32 StripeSize; /* 18h */ + U32 Reserved2; /* 1Ch */ + U32 Reserved3; /* 20h */ + U8 NumPhysDisks; /* 24h */ + U8 Reserved4; /* 25h */ + U16 Reserved5; /* 26h */ + RAID_VOL0_PHYS_DISK PhysDisk[MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX];/* 28h */ +} fCONFIG_PAGE_RAID_VOL_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_0, + RaidVolumePage0_t, MPI_POINTER pRaidVolumePage0_t; + +#define MPI_RAIDVOLPAGE0_PAGEVERSION (0x00) + + +/**************************************************************************** +* RAID Physical Disk Config Pages +****************************************************************************/ + +typedef struct _RAID_PHYS_DISK0_ERROR_DATA +{ + U8 ErrorCdbByte; /* 00h */ + U8 ErrorSenseKey; /* 01h */ + U16 Reserved; /* 02h */ + U16 ErrorCount; /* 04h */ + U8 ErrorASC; /* 06h */ + U8 ErrorASCQ; /* 07h */ + U16 SmartCount; /* 08h */ + U8 SmartASC; /* 0Ah */ + U8 SmartASCQ; /* 0Bh */ +} RAID_PHYS_DISK0_ERROR_DATA, MPI_POINTER PTR_RAID_PHYS_DISK0_ERROR_DATA, + RaidPhysDisk0ErrorData_t, MPI_POINTER pRaidPhysDisk0ErrorData_t; + +typedef struct _RAID_PHYS_DISK_INQUIRY_DATA +{ + U8 VendorID[8]; /* 00h */ + U8 ProductID[16]; /* 08h */ + U8 ProductRevLevel[4]; /* 18h */ + U8 Info[32]; /* 1Ch */ +} RAID_PHYS_DISK0_INQUIRY_DATA, MPI_POINTER PTR_RAID_PHYS_DISK0_INQUIRY_DATA, + RaidPhysDisk0InquiryData, MPI_POINTER pRaidPhysDisk0InquiryData; + +typedef struct _RAID_PHYS_DISK0_SETTINGS +{ + U8 SepID; /* 00h */ + U8 SepBus; /* 01h */ + U8 HotSparePool; /* 02h */ /* MPI_RAID_HOT_SPARE_POOL_ */ + U8 PhysDiskSettings; /* 03h */ +} RAID_PHYS_DISK0_SETTINGS, MPI_POINTER PTR_RAID_PHYS_DISK0_SETTINGS, + RaidPhysDiskSettings_t, MPI_POINTER pRaidPhysDiskSettings_t; + +typedef struct _RAID_PHYS_DISK0_STATUS +{ + U8 Flags; /* 00h */ + U8 State; /* 01h */ + U16 Reserved; /* 02h */ +} RAID_PHYS_DISK0_STATUS, MPI_POINTER PTR_RAID_PHYS_DISK0_STATUS, + RaidPhysDiskStatus_t, MPI_POINTER pRaidPhysDiskStatus_t; /* RAID Volume 2 IM Physical Disk DiskStatus flags */ -#define MPI_RVP2_PHYS_DISK_PRIMARY (0x00000001) -#define MPI_RVP2_PHYS_DISK_SECONDARY (0x00000002) -#define MPI_RVP2_PHYS_DISK_HOT_SPARE (0x00000004) -#define MPI_RVP2_PHYS_DISK_OUT_OF_SYNC (0x00000008) -#define MPI_RVP2_PHYS_DISK_STATUS_MASK (0x00000F00) -#define MPI_RVP2_PHYS_DISK_STATUS_ONLINE (0x00000000) -#define MPI_RVP2_PHYS_DISK_STATUS_MISSING (0x00000100) -#define MPI_RVP2_PHYS_DISK_STATUS_NOT_COMPATIBLE (0x00000200) -#define MPI_RVP2_PHYS_DISK_STATUS_FAILED (0x00000300) -#define MPI_RVP2_PHYS_DISK_STATUS_INITIALIZING (0x00000400) -#define MPI_RVP2_PHYS_DISK_STATUS_OFFLINE_REQUESTED (0x00000500) -#define MPI_RVP2_PHYS_DISK_STATUS_OTHER_OFFLINE (0x00000F00) - - -typedef struct _RAIDVOL2_IM_PHYSICAL_DISK -{ - RAIDVOL2_IM_PHYS_ID Id; /* 00h */ - RAIDVOL2_IM_DISK_INFO Info; /* 5Ch */ -} RAIDVOL2_IM_PHYSICAL_DISK, MPI_POINTER PTR_RAIDVOL2_IM_PHYSICAL_DISK, - RaidVol2ImPhysicalDisk_t, MPI_POINTER pRaidVol2ImPhysicalDisk_t; - -#define MPI_RAIDVOLPAGE2_MAX_DISKS (3) - -typedef struct _CONFIG_PAGE_RAID_VOL_2 -{ - fCONFIG_PAGE_HEADER Header; /* 00h */ - U32 VolumeStatus; /* 04h */ - U32 VolumeSettings; /* 08h */ - U32 Reserved; /* 0Ch */ - U64 MaxLba; /* 10h */ - U32 BlockSize; /* 18h */ - U8 Reserved1; /* 1Ch */ - U8 NumPhysicalDisks; /* 1Dh */ - U16 Reserved2; /* 1Eh */ - RAIDVOL2_IM_PHYSICAL_DISK IMPhysicalDisk[MPI_RAIDVOLPAGE2_MAX_DISKS]; -} fCONFIG_PAGE_RAID_VOL_2, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_2, - RaidVolumePage2_t, MPI_POINTER pRaidVolumePage2_t; - -#define MPI_RAIDVOLPAGE2_PAGEVERSION (0x00) - -/* RAID Volume Page 2 VolumeStatus defines */ - -#define MPI_RAIDVOLPAGE2_STATUS_ENABLED (0x00000001) -#define MPI_RAIDVOLPAGE2_STATUS_QUIESCED (0x00000002) -#define MPI_RAIDVOLPAGE2_STATUS_RESYNC_IN_PROGRESS (0x00000004) -#define MPI_RAIDVOLPAGE2_STATUS_DEGRADED (0x00000008) - -/* RAID Volume Page 2 VolumeSettings defines */ - -#define MPI_RAIDVOLPAGE2_SETTING_WRITE_CACHING_ENABLE (0x00000001) -#define MPI_RAIDVOLPAGE2_SETTING_OFFLINE_ON_SMART (0x00000002) -#define MPI_RAIDVOLPAGE2_SETTING_AUTO_CONFIGURE (0x00000004) -#define MPI_RAIDVOLPAGE2_SETTING_USE_DEFAULTS (0x80000000) - - -/****************************************************************************/ -/* LAN Config Pages */ -/****************************************************************************/ +#define MPI_PHYSDISK0_STATUS_FLAG_OUT_OF_SYNC (0x01) +#define MPI_PHYSDISK0_STATUS_FLAG_QUIESCED (0x02) + +#define MPI_PHYSDISK0_STATUS_ONLINE (0x00) +#define MPI_PHYSDISK0_STATUS_MISSING (0x01) +#define MPI_PHYSDISK0_STATUS_NOT_COMPATIBLE (0x02) +#define MPI_PHYSDISK0_STATUS_FAILED (0x03) +#define MPI_PHYSDISK0_STATUS_INITIALIZING (0x04) +#define MPI_PHYSDISK0_STATUS_OFFLINE_REQUESTED (0x05) +#define MPI_PHYSDISK0_STATUS_FAILED_REQUESTED (0x06) +#define MPI_PHYSDISK0_STATUS_OTHER_OFFLINE (0xFF) + +typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_0 +{ + fCONFIG_PAGE_HEADER Header; /* 00h */ + U8 PhysDiskID; /* 04h */ + U8 PhysDiskBus; /* 05h */ + U8 PhysDiskIOC; /* 06h */ + U8 PhysDiskNum; /* 07h */ + RAID_PHYS_DISK0_SETTINGS PhysDiskSettings; /* 08h */ + U32 Reserved1; /* 0Ch */ + U32 Reserved2; /* 10h */ + U32 Reserved3; /* 14h */ + U8 DiskIdentifier[16]; /* 18h */ + RAID_PHYS_DISK0_INQUIRY_DATA InquiryData; /* 28h */ + RAID_PHYS_DISK0_STATUS PhysDiskStatus; /* 64h */ + U32 MaxLBA; /* 68h */ + RAID_PHYS_DISK0_ERROR_DATA ErrorData; /* 6Ch */ +} fCONFIG_PAGE_RAID_PHYS_DISK_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_PHYS_DISK_0, + RaidPhysDiskPage0_t, MPI_POINTER pRaidPhysDiskPage0_t; + +#define MPI_RAIDPHYSDISKPAGE0_PAGEVERSION (0x00) + + +/**************************************************************************** +* LAN Config Pages +****************************************************************************/ typedef struct _CONFIG_PAGE_LAN_0 { @@ -1083,8 +1332,8 @@ U32 MaxWireSpeedHigh; /* 1Ch */ U32 BucketsRemaining; /* 20h */ U32 MaxReplySize; /* 24h */ - U32 NegWireSpeedHigh; /* 28h */ - U32 NegWireSpeedLow; /* 2Ch */ + U32 NegWireSpeedLow; /* 28h */ + U32 NegWireSpeedHigh; /* 2Ch */ } fCONFIG_PAGE_LAN_1, MPI_POINTER PTR_CONFIG_PAGE_LAN_1, LANPage1_t, MPI_POINTER pLANPage1_t; diff -urN linux-2.4.18/drivers/message/fusion/lsi/mpi_fc.h lia64-2.4/drivers/message/fusion/lsi/mpi_fc.h --- linux-2.4.18/drivers/message/fusion/lsi/mpi_fc.h Mon Sep 24 15:07:19 2001 +++ lia64-2.4/drivers/message/fusion/lsi/mpi_fc.h Wed Feb 27 14:25:30 2002 @@ -6,7 +6,7 @@ * Title: MPI Fibre Channel messages and structures * Creation Date: June 12, 2000 * - * MPI Version: 01.01.07 + * MPI Version: 01.02.02 * * Version History * --------------- @@ -32,6 +32,9 @@ * Added MPI_FC_PRIM_SEND_FLAGS_RESET_LINK define. * Added structure offset comments. * 04-09-01 01.01.07 Added RspLength field to MSG_LINK_SERVICE_RSP_REQUEST. + * 08-08-01 01.02.01 Original release for v1.2 work. + * 09-28-01 01.02.02 Change name of reserved field in + * MSG_LINK_SERVICE_RSP_REPLY. * -------------------------------------------------------------------------- */ @@ -172,7 +175,7 @@ U8 MsgLength; /* 02h */ U8 Function; /* 03h */ U16 Reserved1; /* 04h */ - U8 Reserved2; /* 06h */ + U8 Reserved_0100_InitiatorIndex; /* 06h */ /* obsolete InitiatorIndex */ U8 MsgFlags; /* 07h */ U32 MsgContext; /* 08h */ U16 Reserved3; /* 0Ch */ diff -urN linux-2.4.18/drivers/message/fusion/lsi/mpi_init.h lia64-2.4/drivers/message/fusion/lsi/mpi_init.h --- linux-2.4.18/drivers/message/fusion/lsi/mpi_init.h Mon Sep 24 15:07:19 2001 +++ lia64-2.4/drivers/message/fusion/lsi/mpi_init.h Wed Feb 27 14:25:30 2002 @@ -6,7 +6,7 @@ * Title: MPI initiator mode messages and structures * Creation Date: June 8, 2000 * - * MPI Version: 01.01.05 + * MPI Version: 01.02.04 * * Version History * --------------- @@ -22,6 +22,13 @@ * 02-20-01 01.01.03 Started using MPI_POINTER. * 03-27-01 01.01.04 Added structure offset comments. * 04-10-01 01.01.05 Added new MsgFlag for MSG_SCSI_TASK_MGMT. + * 08-08-01 01.02.01 Original release for v1.2 work. + * 08-29-01 01.02.02 Added MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET. + * Added MPI_SCSI_STATE_QUEUE_TAG_REJECTED for + * MSG_SCSI_IO_REPLY. + * 09-28-01 01.02.03 Added structures and defines for SCSI Enclosure + * Processor messages. + * 10-04-01 01.02.04 Added defines for SEP request Action field. * -------------------------------------------------------------------------- */ @@ -151,6 +158,7 @@ #define MPI_SCSI_STATE_NO_SCSI_STATUS (0x04) #define MPI_SCSI_STATE_TERMINATED (0x08) #define MPI_SCSI_STATE_RESPONSE_INFO_VALID (0x10) +#define MPI_SCSI_STATE_QUEUE_TAG_REJECTED (0x20) /* SCSIIO Reply ResponseInfo values */ /* (FCP-1 RSP_CODE values and SPI-3 Packetized Failure codes) */ @@ -191,6 +199,7 @@ #define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET (0x02) #define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET (0x03) #define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS (0x04) +#define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05) /* MsgFlags bits */ #define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00) @@ -215,5 +224,92 @@ U32 TerminationCount; /* 14h */ } MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY, SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t; + + +/****************************************************************************/ +/* SCSI Enclosure Processor messages */ +/****************************************************************************/ + +typedef struct _MSG_SEP_REQUEST +{ + U8 TargetID; /* 00h */ + U8 Bus; /* 01h */ + U8 ChainOffset; /* 02h */ + U8 Function; /* 03h */ + U8 Action; /* 04h */ + U8 Reserved1; /* 05h */ + U8 Reserved2; /* 06h */ + U8 MsgFlags; /* 07h */ + U32 MsgContext; /* 08h */ + U32 SlotStatus; /* 0Ch */ +} MSG_SEP_REQUEST, MPI_POINTER PTR_MSG_SEP_REQUEST, + SEPRequest_t, MPI_POINTER pSEPRequest_t; + +/* Action defines */ +#define MPI_SEP_REQ_ACTION_WRITE_STATUS (0x00) +#define MPI_SEP_REQ_ACTION_READ_STATUS (0x01) + +/* SlotStatus bits for MSG_SEP_REQUEST */ +#define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR (0x00000001) +#define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY (0x00000002) +#define MPI_SEP_REQ_SLOTSTATUS_DEV_REBUILDING (0x00000004) +#define MPI_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008) +#define MPI_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010) +#define MPI_SEP_REQ_SLOTSTATUS_PARITY_CHECK (0x00000020) +#define MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT (0x00000040) +#define MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED (0x00000080) +#define MPI_SEP_REQ_SLOTSTATUS_HOT_SPARE (0x00000100) +#define MPI_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED (0x00000200) +#define MPI_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) +#define MPI_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE (0x00040000) +#define MPI_SEP_REQ_SLOTSTATUS_REQUEST_INSERT (0x00080000) +#define MPI_SEP_REQ_SLOTSTATUS_DO_NOT_MOVE (0x00400000) +#define MPI_SEP_REQ_SLOTSTATUS_B_ENABLE_BYPASS (0x04000000) +#define MPI_SEP_REQ_SLOTSTATUS_A_ENABLE_BYPASS (0x08000000) +#define MPI_SEP_REQ_SLOTSTATUS_DEV_OFF (0x10000000) +#define MPI_SEP_REQ_SLOTSTATUS_SWAP_RESET (0x80000000) + + +typedef struct _MSG_SEP_REPLY +{ + U8 TargetID; /* 00h */ + U8 Bus; /* 01h */ + U8 MsgLength; /* 02h */ + U8 Function; /* 03h */ + U8 Action; /* 04h */ + U8 Reserved1; /* 05h */ + U8 Reserved2; /* 06h */ + U8 MsgFlags; /* 07h */ + U32 MsgContext; /* 08h */ + U16 Reserved3; /* 0Ch */ + U16 IOCStatus; /* 0Eh */ + U32 IOCLogInfo; /* 10h */ + U32 SlotStatus; /* 14h */ +} MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY, + SEPReply_t, MPI_POINTER pSEPReply_t; + +/* SlotStatus bits for MSG_SEP_REPLY */ +#define MPI_SEP_REPLY_SLOTSTATUS_NO_ERROR (0x00000001) +#define MPI_SEP_REPLY_SLOTSTATUS_DEV_FAULTY (0x00000002) +#define MPI_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING (0x00000004) +#define MPI_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008) +#define MPI_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010) +#define MPI_SEP_REPLY_SLOTSTATUS_PARITY_CHECK (0x00000020) +#define MPI_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT (0x00000040) +#define MPI_SEP_REPLY_SLOTSTATUS_UNCONFIGURED (0x00000080) +#define MPI_SEP_REPLY_SLOTSTATUS_HOT_SPARE (0x00000100) +#define MPI_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED (0x00000200) +#define MPI_SEP_REPLY_SLOTSTATUS_REPORT (0x00010000) +#define MPI_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) +#define MPI_SEP_REPLY_SLOTSTATUS_REMOVE_READY (0x00040000) +#define MPI_SEP_REPLY_SLOTSTATUS_INSERT_READY (0x00080000) +#define MPI_SEP_REPLY_SLOTSTATUS_DO_NOT_REMOVE (0x00400000) +#define MPI_SEP_REPLY_SLOTSTATUS_B_BYPASS_ENABLED (0x01000000) +#define MPI_SEP_REPLY_SLOTSTATUS_A_BYPASS_ENABLED (0x02000000) +#define MPI_SEP_REPLY_SLOTSTATUS_B_ENABLE_BYPASS (0x04000000) +#define MPI_SEP_REPLY_SLOTSTATUS_A_ENABLE_BYPASS (0x08000000) +#define MPI_SEP_REPLY_SLOTSTATUS_DEV_OFF (0x10000000) +#define MPI_SEP_REPLY_SLOTSTATUS_FAULT_SENSED (0x40000000) +#define MPI_SEP_REPLY_SLOTSTATUS_SWAPPED (0x80000000) #endif diff -urN linux-2.4.18/drivers/message/fusion/lsi/mpi_ioc.h lia64-2.4/drivers/message/fusion/lsi/mpi_ioc.h --- linux-2.4.18/drivers/message/fusion/lsi/mpi_ioc.h Mon Sep 24 15:07:19 2001 +++ lia64-2.4/drivers/message/fusion/lsi/mpi_ioc.h Wed Feb 27 14:25:30 2002 @@ -6,7 +6,7 @@ * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Creation Date: August 11, 2000 * - * MPI Version: 01.01.07 + * MPI Version: 01.02.04 * * Version History * --------------- @@ -38,6 +38,19 @@ * 03-27-01 01.01.06 Added defines for ProductId field of MPI_FW_HEADER. * Added structure offset comments. * 04-09-01 01.01.07 Added structure EVENT_DATA_EVENT_CHANGE. + * 08-08-01 01.02.01 Original release for v1.2 work. + * New format for FWVersion and ProductId in + * MSG_IOC_FACTS_REPLY and MPI_FW_HEADER. + * 08-31-01 01.02.02 Addded event MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE and + * related structure and defines. + * Added event MPI_EVENT_ON_BUS_TIMER_EXPIRED. + * Added MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE. + * Replaced a reserved field in MSG_IOC_FACTS_REPLY with + * IOCExceptions and changed DataImageSize to reserved. + * Added MPI_FW_DOWNLOAD_ITYPE_NVSTORE_DATA and + * MPI_FW_UPLOAD_ITYPE_NVDATA. + * 09-28-01 01.02.03 Modified Event Data for Integrated RAID. + * 11-01-01 01.02.04 Added defines for MPI_EXT_IMAGE_HEADER ImageType field. * -------------------------------------------------------------------------- */ @@ -73,6 +86,17 @@ } MSG_IOC_INIT, MPI_POINTER PTR_MSG_IOC_INIT, IOCInit_t, MPI_POINTER pIOCInit_t; +/* WhoInit values */ +#define MPI_WHOINIT_NO_ONE (0x00) +#define MPI_WHOINIT_SYSTEM_BIOS (0x01) +#define MPI_WHOINIT_ROM_BIOS (0x02) +#define MPI_WHOINIT_PCI_PEER (0x03) +#define MPI_WHOINIT_HOST_DRIVER (0x04) +#define MPI_WHOINIT_MANUFACTURER (0x05) + +/* Flags values */ +#define MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE (0x01) + typedef struct _MSG_IOC_INIT_REPLY { U8 WhoInit; /* 00h */ @@ -90,14 +114,6 @@ } MSG_IOC_INIT_REPLY, MPI_POINTER PTR_MSG_IOC_INIT_REPLY, IOCInitReply_t, MPI_POINTER pIOCInitReply_t; -/* WhoInit values */ - -#define MPI_WHOINIT_NO_ONE (0x00) -#define MPI_WHOINIT_SYSTEM_BIOS (0x01) -#define MPI_WHOINIT_ROM_BIOS (0x02) -#define MPI_WHOINIT_PCI_PEER (0x03) -#define MPI_WHOINIT_HOST_DRIVER (0x04) -#define MPI_WHOINIT_MANUFACTURER (0x05) /****************************************************************************/ @@ -115,8 +131,21 @@ } MSG_IOC_FACTS, MPI_POINTER PTR_IOC_FACTS, IOCFacts_t, MPI_POINTER pIOCFacts_t; -/* IOC Facts Reply */ +typedef struct _MPI_FW_VERSION_STRUCT +{ + U8 Dev; /* 00h */ + U8 Unit; /* 01h */ + U8 Minor; /* 02h */ + U8 Major; /* 03h */ +} MPI_FW_VERSION_STRUCT; + +typedef union _MPI_FW_VERSION +{ + MPI_FW_VERSION_STRUCT Struct; + U32 Word; +} MPI_FW_VERSION; +/* IOC Facts Reply */ typedef struct _MSG_IOC_FACTS_REPLY { U16 MsgVersion; /* 00h */ @@ -126,7 +155,7 @@ U8 IOCNumber; /* 06h */ U8 MsgFlags; /* 07h */ U32 MsgContext; /* 08h */ - U16 Reserved2; /* 0Ch */ + U16 IOCExceptions; /* 0Ch */ U16 IOCStatus; /* 0Eh */ U32 IOCLogInfo; /* 10h */ U8 MaxChainDepth; /* 14h */ @@ -135,7 +164,7 @@ U8 Flags; /* 17h */ U16 ReplyQueueDepth; /* 18h */ U16 RequestFrameSize; /* 1Ah */ - U16 FWVersion; /* 1Ch */ + U16 Reserved_0101_FWVersion; /* 1Ch */ /* obsolete 16-bit FWVersion */ U16 ProductID; /* 1Eh */ U32 CurrentHostMfaHighAddr; /* 20h */ U16 GlobalCredits; /* 24h */ @@ -146,18 +175,20 @@ U8 MaxDevices; /* 2Eh */ U8 MaxBuses; /* 2Fh */ U32 FWImageSize; /* 30h */ - U32 DataImageSize; /* 34h */ + U32 Reserved4; /* 34h */ + MPI_FW_VERSION FWVersion; /* 38h */ } MSG_IOC_FACTS_REPLY, MPI_POINTER PTR_MSG_IOC_FACTS_REPLY, IOCFactsReply_t, MPI_POINTER pIOCFactsReply_t; -#define MPI_IOCFACTS_MSGVERSION_MAJOR_MASK (0xFF00) -#define MPI_IOCFACTS_MSGVERSION_MINOR_MASK (0x00FF) +#define MPI_IOCFACTS_MSGVERSION_MAJOR_MASK (0xFF00) +#define MPI_IOCFACTS_MSGVERSION_MINOR_MASK (0x00FF) + +#define MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL (0x0001) -#define MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT (0x01) -#define MPI_IOCFACTS_FLAGS_DATA_IMAGE_UPLOAD (0x02) +#define MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT (0x01) -#define MPI_IOCFACTS_EVENTSTATE_DISABLED (0x00) -#define MPI_IOCFACTS_EVENTSTATE_ENABLED (0x01) +#define MPI_IOCFACTS_EVENTSTATE_DISABLED (0x00) +#define MPI_IOCFACTS_EVENTSTATE_ENABLED (0x01) @@ -326,7 +357,6 @@ } MSG_EVENT_ACK_REPLY, MPI_POINTER PTR_MSG_EVENT_ACK_REPLY, EventAckReply_t, MPI_POINTER pEventAckReply_t; - /* Switch */ #define MPI_EVENT_NOTIFICATION_SWITCH_OFF (0x00) @@ -345,7 +375,9 @@ #define MPI_EVENT_LOOP_STATE_CHANGE (0x00000008) #define MPI_EVENT_LOGOUT (0x00000009) #define MPI_EVENT_EVENT_CHANGE (0x0000000A) -#define MPI_EVENT_RAID_STATUS_CHANGE (0x0000000B) +#define MPI_EVENT_INTEGRATED_RAID (0x0000000B) +#define MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE (0x0000000C) +#define MPI_EVENT_ON_BUS_TIMER_EXPIRED (0x0000000D) /* AckRequired field values */ @@ -372,6 +404,27 @@ } EVENT_DATA_SCSI, MPI_POINTER PTR_EVENT_DATA_SCSI, EventDataScsi_t, MPI_POINTER pEventDataScsi_t; +/* SCSI Device Status Change Event data */ + +typedef struct _EVENT_DATA_SCSI_DEVICE_STATUS_CHANGE +{ + U8 TargetID; /* 00h */ + U8 Bus; /* 01h */ + U8 ReasonCode; /* 02h */ + U8 LUN; /* 03h */ + U8 ASC; /* 04h */ + U8 ASCQ; /* 05h */ + U16 Reserved; /* 06h */ +} EVENT_DATA_SCSI_DEVICE_STATUS_CHANGE, + MPI_POINTER PTR_EVENT_DATA_SCSI_DEVICE_STATUS_CHANGE, + MpiEventDataScsiDeviceStatusChange_t, + MPI_POINTER pMpiEventDataScsiDeviceStatusChange_t; + +/* MPI SCSI Device Status Change Event data ReasonCode values */ +#define MPI_EVENT_SCSI_DEV_STAT_RC_ADDED (0x03) +#define MPI_EVENT_SCSI_DEV_STAT_RC_NOT_RESPONDING (0x04) +#define MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA (0x05) + /* MPI Link Status Change Event data */ typedef struct _EVENT_DATA_LINK_STATUS @@ -417,29 +470,34 @@ } EVENT_DATA_LOGOUT, MPI_POINTER PTR_EVENT_DATA_LOGOUT, EventDataLogout_t, MPI_POINTER pEventDataLogout_t; -/* MPI RAID Status Change Event data */ +/* MPI Integrated RAID Event data */ -typedef struct _EVENT_DATA_RAID_STATUS_CHANGE +typedef struct _EVENT_DATA_RAID { - U8 VolumeTargetID; /* 00h */ + U8 VolumeID; /* 00h */ U8 VolumeBus; /* 01h */ U8 ReasonCode; /* 02h */ U8 PhysDiskNum; /* 03h */ U8 ASC; /* 04h */ U8 ASCQ; /* 05h */ U16 Reserved; /* 06h */ -} EVENT_DATA_RAID_STATUS_CHANGE, MPI_POINTER PTR_EVENT_DATA_RAID_STATUS_CHANGE, - MpiEventDataRaidStatusChange_t, MPI_POINTER pMpiEventDataRaidStatusChange_t; - - -/* MPI RAID Status Change Event data ReasonCode values */ - -#define MPI_EVENT_RAID_DATA_RC_VOLUME_OPTIMAL (0x00) -#define MPI_EVENT_RAID_DATA_RC_VOLUME_DEGRADED (0x01) -#define MPI_EVENT_RAID_DATA_RC_STARTED_RESYNC (0x02) -#define MPI_EVENT_RAID_DATA_RC_DISK_ADDED (0x03) -#define MPI_EVENT_RAID_DATA_RC_DISK_NOT_RESPONDING (0x04) -#define MPI_EVENT_RAID_DATA_RC_SMART_DATA (0x05) + U32 SettingsStatus; /* 08h */ +} EVENT_DATA_RAID, MPI_POINTER PTR_EVENT_DATA_RAID, + MpiEventDataRaid_t, MPI_POINTER pMpiEventDataRaid_t; + +/* MPI Integrated RAID Event data ReasonCode values */ +#define MPI_EVENT_RAID_RC_VOLUME_CREATED (0x00) +#define MPI_EVENT_RAID_RC_VOLUME_DELETED (0x01) +#define MPI_EVENT_RAID_RC_VOLUME_SETTINGS_CHANGED (0x02) +#define MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED (0x03) +#define MPI_EVENT_RAID_RC_VOLUME_PHYSDISK_CHANGED (0x04) +#define MPI_EVENT_RAID_RC_PHYSDISK_CREATED (0x05) +#define MPI_EVENT_RAID_RC_PHYSDISK_DELETED (0x06) +#define MPI_EVENT_RAID_RC_PHYSDISK_SETTINGS_CHANGED (0x07) +#define MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED (0x08) +#define MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED (0x09) +#define MPI_EVENT_RAID_RC_SMART_DATA (0x0A) +#define MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED (0x0B) /***************************************************************************** @@ -468,6 +526,7 @@ #define MPI_FW_DOWNLOAD_ITYPE_RESERVED (0x00) #define MPI_FW_DOWNLOAD_ITYPE_FW (0x01) #define MPI_FW_DOWNLOAD_ITYPE_BIOS (0x02) +#define MPI_FW_DOWNLOAD_ITYPE_NVDATA (0x03) typedef struct _FWDownloadTCSGE @@ -476,7 +535,7 @@ U8 ContextSize; /* 01h */ U8 DetailsLength; /* 02h */ U8 Flags; /* 03h */ - U32 Reserved1; /* 04h */ + U32 Reserved_0100_Checksum; /* 04h */ /* obsolete Checksum */ U32 ImageOffset; /* 08h */ U32 ImageSize; /* 0Ch */ } FW_DOWNLOAD_TCSGE, MPI_POINTER PTR_FW_DOWNLOAD_TCSGE, @@ -519,7 +578,7 @@ #define MPI_FW_UPLOAD_ITYPE_FW_IOC_MEM (0x00) #define MPI_FW_UPLOAD_ITYPE_FW_FLASH (0x01) #define MPI_FW_UPLOAD_ITYPE_BIOS_FLASH (0x02) -#define MPI_FW_UPLOAD_ITYPE_DATA_IOC_MEM (0x03) +#define MPI_FW_UPLOAD_ITYPE_NVDATA (0x03) typedef struct _FWUploadTCSGE { @@ -563,11 +622,10 @@ U32 Checksum; /* 1Ch */ U16 VendorId; /* 20h */ U16 ProductId; /* 22h */ - U16 FwVersion; /* 24h */ - U16 Reserved1; /* 26h */ + MPI_FW_VERSION FWVersion; /* 24h */ U32 SeqCodeVersion; /* 28h */ U32 ImageSize; /* 2Ch */ - U32 Reserved2; /* 30h */ + U32 NextImageHeaderOffset; /* 30h */ U32 LoadStartAddress; /* 34h */ U32 IopResetVectorValue; /* 38h */ U32 IopResetRegAddr; /* 3Ch */ @@ -581,30 +639,49 @@ #define MPI_FW_HEADER_WHAT_SIGNATURE (0x29232840) /* defines for using the ProductId field */ -#define MPI_FW_HEADER_PID_TYPE_MASK (0xF000) -#define MPI_FW_HEADER_PID_TYPE_SCSI (0x0000) -#define MPI_FW_HEADER_PID_TYPE_FC (0x1000) - -#define MPI_FW_HEADER_PID_FW_VENDOR_MASK (0x0F00) -#define MPI_FW_HEADER_PID_FW_VENDOR_LSI (0x0000) - -#define MPI_FW_HEADER_PID_FAMILY_MASK (0x000F) -#define MPI_FW_HEADER_PID_FAMILY_1030_SCSI (0x0000) -#define MPI_FW_HEADER_PID_FAMILY_909_FC (0x0000) -#define MPI_FW_HEADER_PID_FAMILY_919_FC (0x0001) -#define MPI_FW_HEADER_PID_FAMILY_919X_FC (0x0002) - - -typedef struct _MPI_DATA_HEADER -{ - U32 Signature; /* 00h */ - U16 FunctionNumber; /* 04h */ - U16 Length; /* 06h */ - U32 Checksum; /* 08h */ - U32 LoadStartAddress; /* 0Ch */ -} MPI_DATA_HEADER, MPI_POINTER PTR_MPI_DATA_HEADER, - MpiDataHeader_t, MPI_POINTER pMpiDataHeader_t; +#define MPI_FW_HEADER_PID_TYPE_MASK (0xF000) +#define MPI_FW_HEADER_PID_TYPE_SCSI (0x0000) +#define MPI_FW_HEADER_PID_TYPE_FC (0x1000) + +#define MPI_FW_HEADER_PID_PROD_MASK (0x0F00) +#define MPI_FW_HEADER_PID_PROD_INITIATOR_SCSI (0x0100) +#define MPI_FW_HEADER_PID_PROD_TARGET_INITIATOR_SCSI (0x0200) +#define MPI_FW_HEADER_PID_PROD_TARGET_SCSI (0x0300) +#define MPI_FW_HEADER_PID_PROD_IM_SCSI (0x0400) +#define MPI_FW_HEADER_PID_PROD_IS_SCSI (0x0500) +#define MPI_FW_HEADER_PID_PROD_CTX_SCSI (0x0600) + +#define MPI_FW_HEADER_PID_FAMILY_MASK (0x00FF) +#define MPI_FW_HEADER_PID_FAMILY_1030A0_SCSI (0x0001) +#define MPI_FW_HEADER_PID_FAMILY_1030B0_SCSI (0x0002) +#define MPI_FW_HEADER_PID_FAMILY_1030B1_SCSI (0x0003) +#define MPI_FW_HEADER_PID_FAMILY_1030C0_SCSI (0x0004) +#define MPI_FW_HEADER_PID_FAMILY_1020A0_SCSI (0x0005) +#define MPI_FW_HEADER_PID_FAMILY_1020B0_SCSI (0x0006) +#define MPI_FW_HEADER_PID_FAMILY_1020B1_SCSI (0x0007) +#define MPI_FW_HEADER_PID_FAMILY_1020C0_SCSI (0x0008) +#define MPI_FW_HEADER_PID_FAMILY_1035A0_SCSI (0x0009) +#define MPI_FW_HEADER_PID_FAMILY_1035B0_SCSI (0x000A) +#define MPI_FW_HEADER_PID_FAMILY_909_FC (0x0000) +#define MPI_FW_HEADER_PID_FAMILY_919_FC (0x0001) +#define MPI_FW_HEADER_PID_FAMILY_919X_FC (0x0002) -#define MPI_DATA_HEADER_SIGNATURE (0x43504147) +typedef struct _MPI_EXT_IMAGE_HEADER +{ + U8 ImageType; /* 00h */ + U8 Reserved; /* 01h */ + U16 Reserved1; /* 02h */ + U32 Checksum; /* 04h */ + U32 ImageSize; /* 08h */ + U32 NextImageHeaderOffset; /* 0Ch */ + U32 LoadStartAddress; /* 10h */ + U32 Reserved2; /* 14h */ +} MPI_EXT_IMAGE_HEADER, MPI_POINTER PTR_MPI_EXT_IMAGE_HEADER, + MpiExtImageHeader_t, MPI_POINTER pMpiExtImageHeader_t; + +/* defines for the ImageType field */ +#define MPI_EXT_IMAGE_TYPE_UNSPECIFIED (0x00) +#define MPI_EXT_IMAGE_TYPE_FW (0x01) +#define MPI_EXT_IMAGE_TYPE_NVDATA (0x03) #endif diff -urN linux-2.4.18/drivers/message/fusion/lsi/mpi_lan.h lia64-2.4/drivers/message/fusion/lsi/mpi_lan.h --- linux-2.4.18/drivers/message/fusion/lsi/mpi_lan.h Mon Sep 24 15:07:19 2001 +++ lia64-2.4/drivers/message/fusion/lsi/mpi_lan.h Wed Feb 27 14:25:30 2002 @@ -6,7 +6,7 @@ * Title: MPI LAN messages and structures * Creation Date: June 30, 2000 * - * MPI Version: 01.01.03 + * MPI Version: 01.02.01 * * Version History * --------------- @@ -27,6 +27,7 @@ * 11-02-00 01.01.01 Original release for post 1.0 work * 02-20-01 01.01.02 Started using MPI_POINTER. * 03-27-01 01.01.03 Added structure offset comments. + * 08-08-01 01.02.01 Original release for v1.2 work. * -------------------------------------------------------------------------- */ diff -urN linux-2.4.18/drivers/message/fusion/lsi/mpi_raid.h lia64-2.4/drivers/message/fusion/lsi/mpi_raid.h --- linux-2.4.18/drivers/message/fusion/lsi/mpi_raid.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/message/fusion/lsi/mpi_raid.h Wed Feb 27 14:25:30 2002 @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2001 LSI Logic Corporation. + * + * + * Name: MPI_RAID.H + * Title: MPI RAID message and structures + * Creation Date: February 27, 2001 + * + * MPI Version: 01.02.04 + * + * Version History + * --------------- + * + * Date Version Description + * -------- -------- ------------------------------------------------------ + * 02-27-01 01.01.01 Original release for this file. + * 03-27-01 01.01.02 Added structure offset comments. + * 08-08-01 01.02.01 Original release for v1.2 work. + * 09-28-01 01.02.02 Major rework for MPI v1.2 Integrated RAID changes. + * 10-04-01 01.02.03 Added ActionData defines for + * MPI_RAID_ACTION_DELETE_VOLUME action. + * 11-01-01 01.02.04 Added define for MPI_RAID_ACTION_ADATA_DO_NOT_SYNC. + * -------------------------------------------------------------------------- + */ + +#ifndef MPI_RAID_H +#define MPI_RAID_H + + +/****************************************************************************** +* +* R A I D M e s s a g e s +* +*******************************************************************************/ + + +/****************************************************************************/ +/* RAID Volume Request */ +/****************************************************************************/ + +typedef struct _MSG_RAID_ACTION +{ + U8 Action; /* 00h */ + U8 Reserved1; /* 01h */ + U8 ChainOffset; /* 02h */ + U8 Function; /* 03h */ + U8 VolumeID; /* 04h */ + U8 VolumeBus; /* 05h */ + U8 PhysDiskNum; /* 06h */ + U8 MsgFlags; /* 07h */ + U32 MsgContext; /* 08h */ + U32 Reserved2; /* 0Ch */ + U32 ActionDataWord; /* 10h */ + SGE_SIMPLE_UNION ActionDataSGE; /* 14h */ +} MSG_RAID_ACTION_REQUEST, MPI_POINTER PTR_MSG_RAID_ACTION_REQUEST, + MpiRaidActionRequest_t , MPI_POINTER pMpiRaidActionRequest_t; + + +/* RAID Action request Action values */ + +#define MPI_RAID_ACTION_STATUS (0x00) +#define MPI_RAID_ACTION_INDICATOR_STRUCT (0x01) +#define MPI_RAID_ACTION_CREATE_VOLUME (0x02) +#define MPI_RAID_ACTION_DELETE_VOLUME (0x03) +#define MPI_RAID_ACTION_DISABLE_VOLUME (0x04) +#define MPI_RAID_ACTION_ENABLE_VOLUME (0x05) +#define MPI_RAID_ACTION_QUIESCE_PHYS_IO (0x06) +#define MPI_RAID_ACTION_ENABLE_PHYS_IO (0x07) +#define MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS (0x08) +#define MPI_RAID_ACTION_PHYSDISK_OFFLINE (0x0A) +#define MPI_RAID_ACTION_PHYSDISK_ONLINE (0x0B) +#define MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS (0x0C) +#define MPI_RAID_ACTION_CREATE_PHYSDISK (0x0D) +#define MPI_RAID_ACTION_DELETE_PHYSDISK (0x0E) +#define MPI_RAID_ACTION_FAIL_PHYSDISK (0x0F) +#define MPI_RAID_ACTION_REPLACE_PHYSDISK (0x10) + +/* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */ +#define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001) + +/* ActionDataWord defines for use with MPI_RAID_ACTION_DELETE_VOLUME action */ +#define MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS (0x00000000) +#define MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS (0x00000001) + + +/* RAID Action reply message */ + +typedef struct _MSG_RAID_ACTION_REPLY +{ + U8 Action; /* 00h */ + U8 Reserved; /* 01h */ + U8 MsgLength; /* 02h */ + U8 Function; /* 03h */ + U8 VolumeID; /* 04h */ + U8 VolumeBus; /* 05h */ + U8 PhysDiskNum; /* 06h */ + U8 MsgFlags; /* 07h */ + U32 MsgContext; /* 08h */ + U16 ActionStatus; /* 0Ch */ + U16 IOCStatus; /* 0Eh */ + U32 IOCLogInfo; /* 10h */ + U32 VolumeStatus; /* 14h */ + U32 ActionData; /* 18h */ +} MSG_RAID_ACTION_REPLY, MPI_POINTER PTR_MSG_RAID_ACTION_REPLY, + MpiRaidActionReply_t, MPI_POINTER pMpiRaidActionReply_t; + + +/* RAID Volume reply ActionStatus values */ + +#define MPI_RAID_ACTION_ASTATUS_SUCCESS (0x0000) +#define MPI_RAID_ACTION_ASTATUS_INVALID_ACTION (0x0001) +#define MPI_RAID_ACTION_ASTATUS_FAILURE (0x0002) +#define MPI_RAID_ACTION_ASTATUS_IN_PROGRESS (0x0003) + + +/* RAID Volume reply RAID Volume Indicator structure */ + +typedef struct _MPI_RAID_VOL_INDICATOR +{ + U64 TotalBlocks; /* 00h */ + U64 BlocksRemaining; /* 08h */ +} MPI_RAID_VOL_INDICATOR, MPI_POINTER PTR_MPI_RAID_VOL_INDICATOR, + MpiRaidVolIndicator_t, MPI_POINTER pMpiRaidVolIndicator_t; + + +/****************************************************************************/ +/* SCSI IO RAID Passthrough Request */ +/****************************************************************************/ + +typedef struct _MSG_SCSI_IO_RAID_PT_REQUEST +{ + U8 PhysDiskNum; /* 00h */ + U8 Reserved1; /* 01h */ + U8 ChainOffset; /* 02h */ + U8 Function; /* 03h */ + U8 CDBLength; /* 04h */ + U8 SenseBufferLength; /* 05h */ + U8 Reserved2; /* 06h */ + U8 MsgFlags; /* 07h */ + U32 MsgContext; /* 08h */ + U8 LUN[8]; /* 0Ch */ + U32 Control; /* 14h */ + U8 CDB[16]; /* 18h */ + U32 DataLength; /* 28h */ + U32 SenseBufferLowAddr; /* 2Ch */ + SGE_IO_UNION SGL; /* 30h */ +} MSG_SCSI_IO_RAID_PT_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REQUEST, + SCSIIORaidPassthroughRequest_t, MPI_POINTER pSCSIIORaidPassthroughRequest_t; + + +/* SCSI IO RAID Passthrough reply structure */ + +typedef struct _MSG_SCSI_IO_RAID_PT_REPLY +{ + U8 PhysDiskNum; /* 00h */ + U8 Reserved1; /* 01h */ + U8 MsgLength; /* 02h */ + U8 Function; /* 03h */ + U8 CDBLength; /* 04h */ + U8 SenseBufferLength; /* 05h */ + U8 Reserved2; /* 06h */ + U8 MsgFlags; /* 07h */ + U32 MsgContext; /* 08h */ + U8 SCSIStatus; /* 0Ch */ + U8 SCSIState; /* 0Dh */ + U16 IOCStatus; /* 0Eh */ + U32 IOCLogInfo; /* 10h */ + U32 TransferCount; /* 14h */ + U32 SenseCount; /* 18h */ + U32 ResponseInfo; /* 1Ch */ +} MSG_SCSI_IO_RAID_PT_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REPLY, + SCSIIORaidPassthroughReply_t, MPI_POINTER pSCSIIORaidPassthroughReply_t; + + +#endif + + + diff -urN linux-2.4.18/drivers/message/fusion/lsi/mpi_targ.h lia64-2.4/drivers/message/fusion/lsi/mpi_targ.h --- linux-2.4.18/drivers/message/fusion/lsi/mpi_targ.h Mon Sep 24 15:07:19 2001 +++ lia64-2.4/drivers/message/fusion/lsi/mpi_targ.h Wed Feb 27 14:25:30 2002 @@ -6,7 +6,7 @@ * Title: MPI Target mode messages and structures * Creation Date: June 22, 2000 * - * MPI Version: 01.01.04 + * MPI Version: 01.02.04 * * Version History * --------------- @@ -26,6 +26,14 @@ * Added structures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and * MPI_TARGET_FCP_CMD_BUFFER. * 03-27-01 01.01.04 Added structure offset comments. + * 08-08-01 01.02.01 Original release for v1.2 work. + * 09-28-01 01.02.02 Added structure for MPI_TARGET_SCSI_SPI_STATUS_IU. + * Added PriorityReason field to some replies and + * defined more PriorityReason codes. + * Added some defines for to support previous version + * of MPI. + * 10-04-01 01.02.03 Added PriorityReason to MSG_TARGET_ERROR_REPLY. + * 11-01-01 01.02.04 Added define for TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY. * -------------------------------------------------------------------------- */ @@ -78,6 +86,7 @@ #define CMD_BUFFER_POST_FLAGS_64_BIT_ADDR (0x80) #define CMD_BUFFER_POST_IO_INDEX_MASK (0x00003FFF) +#define CMD_BUFFER_POST_IO_INDEX_MASK_0100 (0x000003FF) /* obsolete */ typedef struct _MSG_TARGET_CMD_BUFFER_POST_REPLY @@ -97,7 +106,7 @@ } MSG_TARGET_CMD_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REPLY, TargetCmdBufferPostReply_t, MPI_POINTER pTargetCmdBufferPostReply_t; - +/* the following structure is obsolete as of MPI v1.2 */ typedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY { U16 Reserved; /* 00h */ @@ -117,6 +126,13 @@ #define PRIORITY_REASON_NO_DISCONNECT (0x00) #define PRIORITY_REASON_SCSI_TASK_MANAGEMENT (0x01) +#define PRIORITY_REASON_CMD_PARITY_ERR (0x02) +#define PRIORITY_REASON_MSG_OUT_PARITY_ERR (0x03) +#define PRIORITY_REASON_LQ_CRC_ERR (0x04) +#define PRIORITY_REASON_CMD_CRC_ERR (0x05) +#define PRIORITY_REASON_PROTOCOL_ERR (0x06) +#define PRIORITY_REASON_DATA_OUT_PARITY_ERR (0x07) +#define PRIORITY_REASON_DATA_OUT_CRC_ERR (0x08) #define PRIORITY_REASON_UNKNOWN (0xFF) @@ -129,7 +145,8 @@ U8 Reserved2; /* 06h */ U8 MsgFlags; /* 07h */ U32 MsgContext; /* 08h */ - U16 Reserved3; /* 0Ch */ + U8 PriorityReason; /* 0Ch */ + U8 Reserved3; /* 0Dh */ U16 IOCStatus; /* 0Eh */ U32 IOCLogInfo; /* 10h */ U32 ReplyWord; /* 14h */ @@ -204,7 +221,8 @@ U8 Reserved2; /* 06h */ U8 MsgFlags; /* 07h */ U32 MsgContext; /* 08h */ - U16 Reserved3; /* 0Ch */ + U8 PriorityReason; /* 0Ch */ + U8 Reserved3; /* 0Dh */ U16 IOCStatus; /* 0Eh */ U32 IOCLogInfo; /* 10h */ U32 ReplyWord; /* 14h */ @@ -234,8 +252,34 @@ TargetStatusSendRequest_t, MPI_POINTER pTargetStatusSendRequest_t; #define TARGET_STATUS_SEND_FLAGS_AUTO_GOOD_STATUS (0x01) +#define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY (0x04) #define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER (0x80) +typedef struct _MPI_TARGET_FCP_RSP_BUFFER +{ + U8 Reserved0[8]; /* 00h */ + U8 FcpStatus; /* 08h */ + U8 FcpFlags; /* 09h */ + U8 Reserved1[2]; /* 0Ah */ + U32 FcpResid; /* 0Ch */ + U32 FcpSenseLength; /* 10h */ + U32 FcpResponseLength; /* 14h */ + U8 FcpResponseData[8]; /* 18h */ + U8 FcpSenseData[32]; /* Pad to 64 bytes */ /* 20h */ +} MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER, + MpiTargetFcpRspBuffer, MPI_POINTER pMpiTargetFcpRspBuffer; + +typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU +{ + U8 Reserved0; /* 00h */ + U8 Reserved1; /* 01h */ + U8 Valid; /* 02h */ + U8 Status; /* 03h */ + U32 SenseDataListLength; /* 04h */ + U32 PktFailuresListLength; /* 08h */ + U8 SenseData[52]; /* Pad the IU to 64 bytes */ /* 0Ch */ +} MPI_TARGET_SCSI_SPI_STATUS_IU, MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_STATUS_IU, + TargetScsiSpiStatusIU_t, MPI_POINTER pTargetScsiSpiStatusIU_t; /****************************************************************************/ /* Target Mode Abort Request */ @@ -323,6 +367,41 @@ #define SET_PORT(t, p) ((t) = ((t) & ~TARGET_MODE_REPLY_PORT_MASK) | \ (((p) << TARGET_MODE_REPLY_PORT_SHIFT) & \ TARGET_MODE_REPLY_PORT_MASK)) + +/* the following obsolete values are for MPI v1.0 support */ +#define TARGET_MODE_REPLY_0100_MASK_HOST_INDEX (0x000003FF) +#define TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX (0) +#define TARGET_MODE_REPLY_0100_MASK_IOC_INDEX (0x001FF800) +#define TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX (11) +#define TARGET_MODE_REPLY_0100_PORT_MASK (0x00400000) +#define TARGET_MODE_REPLY_0100_PORT_SHIFT (22) +#define TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX (0x1F800000) +#define TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX (23) + +#define GET_HOST_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) \ + >> TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX) + +#define SET_HOST_INDEX_0100(t, hi) \ + ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) | \ + (((hi) << TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX) & \ + TARGET_MODE_REPLY_0100_MASK_HOST_INDEX)) + +#define GET_IOC_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) \ + >> TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX) + +#define SET_IOC_INDEX_0100(t, ii) \ + ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) | \ + (((ii) << TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX) & \ + TARGET_MODE_REPLY_0100_MASK_IOC_INDEX)) + +#define GET_INITIATOR_INDEX_0100(x) \ + (((x) & TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) \ + >> TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX) + +#define SET_INITIATOR_INDEX_0100(t, ii) \ + ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) | \ + (((ii) << TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX) & \ + TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX)) #endif diff -urN linux-2.4.18/drivers/message/fusion/lsi/mpi_type.h lia64-2.4/drivers/message/fusion/lsi/mpi_type.h --- linux-2.4.18/drivers/message/fusion/lsi/mpi_type.h Fri Jul 6 17:03:11 2001 +++ lia64-2.4/drivers/message/fusion/lsi/mpi_type.h Wed Feb 27 14:25:30 2002 @@ -6,7 +6,7 @@ * Title: MPI Basic type definitions * Creation Date: June 6, 2000 * - * MPI Version: 01.01.02 + * MPI Version: 01.02.01 * * Version History * --------------- @@ -17,6 +17,7 @@ * 06-06-00 01.00.01 Update version number for 1.0 release. * 11-02-00 01.01.01 Original release for post 1.0 work * 02-20-01 01.01.02 Added define and ifdef for MPI_POINTER. + * 08-08-01 01.02.01 Original release for v1.2 work. * -------------------------------------------------------------------------- */ diff -urN linux-2.4.18/drivers/message/fusion/mptbase.c lia64-2.4/drivers/message/fusion/mptbase.c --- linux-2.4.18/drivers/message/fusion/mptbase.c Wed Oct 10 16:31:56 2001 +++ lia64-2.4/drivers/message/fusion/mptbase.c Tue Mar 19 15:05:36 2002 @@ -20,6 +20,12 @@ * And to Roger Hickerson (LSI Logic) for tirelessly supporting * this driver project. * + * A special thanks to Pamela Delaney (LSI Logic) for tons of work + * and countless enhancements while adding support for the 1030 + * chip family. Pam has been instrumental in the development of + * of the 2.xx.xx series fusion drivers, and her contributions are + * far too numerous to hope to list in one place. + * * All manner of help from Stephen Shirron (LSI Logic): * low-level FC analysis, debug + various fixes in FCxx firmware, * initial port to alpha platform, various driver code optimizations, @@ -38,11 +44,12 @@ * for gobs of hard work fixing and optimizing LAN code. * THANK YOU! * - * Copyright (c) 1999-2001 LSI Logic Corporation + * Copyright (c) 1999-2002 LSI Logic Corporation * Originally By: Steven J. Ralston - * (mailto:Steve.Ralston@lsil.com) + * (mailto:sjralston1@netscape.net) + * (mailto:Pam.Delaney@lsil.com) * - * $Id: mptbase.c,v 1.53.4.3 2001/09/18 03:54:54 sralston Exp $ + * $Id: mptbase.c,v 1.110 2002/02/27 18:44:20 sralston Exp $ */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* @@ -93,11 +100,14 @@ #include #include #include -#include +#include /* needed for in_interrupt() proto */ #include #ifdef CONFIG_MTRR #include #endif +#ifdef __sparc__ +#include /* needed for __irq_itoa() proto */ +#endif #include "mptbase.h" @@ -110,27 +120,33 @@ MODULE_DESCRIPTION(my_NAME); MODULE_LICENSE("GPL"); - /* * cmd line parameters */ MODULE_PARM(PortIo, "0-1i"); MODULE_PARM_DESC(PortIo, "[0]=Use mmap, 1=Use port io"); -MODULE_PARM(HardReset, "0-1i"); -MODULE_PARM_DESC(HardReset, "0=Disable HardReset, [1]=Enable HardReset"); static int PortIo = 0; -static int HardReset = 1; + +#ifdef MFCNT +static int mfcounter = 0; +#define PRINT_MF_COUNT 20000 +#endif /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * Public data... */ -int mpt_lan_index = 0; -int mpt_stm_index = 0; +int mpt_lan_index = -1; +int mpt_stm_index = -1; + +struct proc_dir_entry *mpt_proc_root_dir; + +DmpServices_t *DmpService; + +void *mpt_v_ASCQ_TablePtr; +const char **mpt_ScsiOpcodesPtr; +int mpt_ASCQ_TableSz; -void *mpt_v_ASCQ_TablePtr = NULL; -const char **mpt_ScsiOpcodesPtr = NULL; -int mpt_ASCQ_TableSz = 0; #define WHOINIT_UNKNOWN 0xAA @@ -139,12 +155,12 @@ * Private data... */ /* Adapter lookup table */ -static MPT_ADAPTER *mpt_adapters[MPT_MAX_ADAPTERS] = {0}; + MPT_ADAPTER *mpt_adapters[MPT_MAX_ADAPTERS]; static MPT_ADAPTER_TRACKER MptAdapters; /* Callback lookup table */ static MPT_CALLBACK MptCallbacks[MPT_MAX_PROTOCOL_DRIVERS]; /* Protocol driver class lookup table */ -static int MptDriverClass[MPT_MAX_PROTOCOL_DRIVERS]; +static int MptDriverClass[MPT_MAX_PROTOCOL_DRIVERS]; /* Event handler lookup table */ static MPT_EVHANDLER MptEvHandlers[MPT_MAX_PROTOCOL_DRIVERS]; /* Reset handler lookup table */ @@ -152,6 +168,10 @@ static int FusionInitCalled = 0; static int mpt_base_index = -1; +static int last_drv_idx = -1; +static int isense_idx = -1; + +static DECLARE_WAIT_QUEUE_HEAD(mpt_waitq); /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* @@ -160,49 +180,84 @@ static void mpt_interrupt(int irq, void *bus_id, struct pt_regs *r); static int mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply); -static int mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason); -static int mpt_adapter_install(struct pci_dev *pdev); -static void mpt_detect_929_bound_ports(MPT_ADAPTER *this, struct pci_dev *pdev); +static int mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag); +static int mpt_adapter_install(struct pci_dev *pdev); +static void mpt_detect_bound_ports(MPT_ADAPTER *this, struct pci_dev *pdev); static void mpt_adapter_disable(MPT_ADAPTER *ioc, int freeup); static void mpt_adapter_dispose(MPT_ADAPTER *ioc); static void MptDisplayIocCapabilities(MPT_ADAPTER *ioc); -static int MakeIocReady(MPT_ADAPTER *ioc, int force); -static u32 GetIocState(MPT_ADAPTER *ioc, int cooked); -static int GetIocFacts(MPT_ADAPTER *ioc); -static int GetPortFacts(MPT_ADAPTER *ioc, int portnum); -static int SendIocInit(MPT_ADAPTER *ioc); -static int SendPortEnable(MPT_ADAPTER *ioc, int portnum); -static int mpt_fc9x9_reset(MPT_ADAPTER *ioc, int ignore); -static int KickStart(MPT_ADAPTER *ioc, int ignore); -static int SendIocReset(MPT_ADAPTER *ioc, u8 reset_type); +static int MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag); +//static u32 mpt_GetIocState(MPT_ADAPTER *ioc, int cooked); +static int GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason); +static int GetPortFacts(MPT_ADAPTER *ioc, int portnum, int sleepFlag); +static int SendIocInit(MPT_ADAPTER *ioc, int sleepFlag); +static int SendPortEnable(MPT_ADAPTER *ioc, int portnum, int sleepFlag); +static int mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag); +static int mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag); +static int mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag); +static int KickStart(MPT_ADAPTER *ioc, int ignore, int sleepFlag); +static int SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag); static int PrimeIocFifos(MPT_ADAPTER *ioc); -static int HandShakeReqAndReply(MPT_ADAPTER *ioc, int reqBytes, u32 *req, int replyBytes, u16 *u16reply, int maxwait); -static int WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong); -static int WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong); -static int WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong); +static int WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag); +static int WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag); +static int WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag); static int GetLanConfigPages(MPT_ADAPTER *ioc); +static int GetFcPortPage0(MPT_ADAPTER *ioc, int portnum); +static int GetIoUnitPage2(MPT_ADAPTER *ioc); +static int mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum); +static int mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int portnum); +static int mpt_findImVolumes(MPT_ADAPTER *ioc); +static void mpt_timer_expired(unsigned long data); static int SendEventNotification(MPT_ADAPTER *ioc, u8 EvSwitch); static int SendEventAck(MPT_ADAPTER *ioc, EventNotificationReply_t *evnp); -static int procmpt_create(void); #ifdef CONFIG_PROC_FS +static int procmpt_create(void); static int procmpt_destroy(void); +static int procmpt_summary_read(char *buf, char **start, off_t offset, + int request, int *eof, void *data); +static int procmpt_version_read(char *buf, char **start, off_t offset, + int request, int *eof, void *data); +static int procmpt_iocinfo_read(char *buf, char **start, off_t offset, + int request, int *eof, void *data); #endif -static int procmpt_read_summary(char *page, char **start, off_t off, int count, int *eof, void *data); -static int procmpt_read_dbg(char *page, char **start, off_t off, int count, int *eof, void *data); -/*static int procmpt_info(char *buf, char **start, off_t offset, int len);*/ +static void mpt_get_fw_exp_ver(char *buf, MPT_ADAPTER *ioc); +//int mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag); static int ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *evReply, int *evHandlers); static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info); static void mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info); -static struct proc_dir_entry *procmpt_root_dir = NULL; - int fusion_init(void); static void fusion_exit(void); /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * more Private data... + */ +#ifdef CONFIG_PROC_FS +struct _mpt_proc_list { + const char *name; + int (*f)(char *, char **, off_t, int, int *, void *); +} mpt_proc_list[] = { + { "summary", procmpt_summary_read}, + { "version", procmpt_version_read}, +}; +#define MPT_PROC_ENTRIES (sizeof(mpt_proc_list)/sizeof(mpt_proc_list[0])) + +struct _mpt_ioc_proc_list { + const char *name; + int (*f)(char *, char **, off_t, int, int *, void *); +} mpt_ioc_proc_list[] = { + { "info", procmpt_iocinfo_read}, + { "summary", procmpt_summary_read}, +}; +#define MPT_IOC_PROC_ENTRIES (sizeof(mpt_ioc_proc_list)/sizeof(mpt_ioc_proc_list[0])) + +#endif + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* 20000207 -sralston * GRRRRR... IOSpace (port i/o) register access (for the 909) is back! * 20000517 -sralston @@ -225,9 +280,18 @@ writel(v, a); } +static inline void CHIPREG_PIO_WRITE32(volatile u32 *a, u32 v) +{ + outl(v, (unsigned long)a); +} + +static inline u32 CHIPREG_PIO_READ32(volatile u32 *a) +{ + return inl((unsigned long)a); +} /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** +/* * mpt_interrupt - MPT adapter (IOC) specific interrupt handler. * @irq: irq number (not used) * @bus_id: bus identifier cookie == pointer to MPT_ADAPTER structure @@ -252,8 +316,7 @@ MPT_FRAME_HDR *mf; MPT_FRAME_HDR *mr; u32 pa; - u32 *m; - int req_idx; + int req_idx = -1; int cb_idx; int type; int freeme; @@ -262,6 +325,21 @@ ioc = bus_id; /* + * Verify ioc pointer is ok + */ + { + MPT_ADAPTER *iocCmp; + iocCmp = mpt_adapter_find_first(); + while ((ioc != iocCmp) && iocCmp) + iocCmp = mpt_adapter_find_next(iocCmp); + + if (!iocCmp) { + printk(KERN_WARNING "mpt_interrupt: Invalid ioc!\n"); + return; + } + } + + /* * Drain the reply FIFO! * * NOTES: I've seen up to 10 replies processed in this loop, so far... @@ -281,25 +359,27 @@ * Check for non-TURBO reply! */ if (pa & MPI_ADDRESS_REPLY_A_BIT) { - dma_addr_t reply_dma_addr; + u32 reply_dma_low; u16 ioc_stat; /* non-TURBO reply! Hmmm, something may be up... * Newest turbo reply mechanism; get address * via left shift 1 (get rid of MPI_ADDRESS_REPLY_A_BIT)! */ - reply_dma_addr = (pa = (pa << 1)); - /* Map DMA address of reply header to cpu address. */ - m = (u32 *) ((u8 *)ioc->reply_frames + - (reply_dma_addr - ioc->reply_frames_dma)); + /* Map DMA address of reply header to cpu address. + * pa is 32 bits - but the dma address may be 32 or 64 bits + * get offset based only only the low addresses + */ + reply_dma_low = (pa = (pa << 1)); + mr = (MPT_FRAME_HDR *)((u8 *)ioc->reply_frames + + (reply_dma_low - ioc->reply_frames_low_dma)); - mr = (MPT_FRAME_HDR *) m; req_idx = le16_to_cpu(mr->u.frame.hwhdr.msgctxu.fld.req_idx); cb_idx = mr->u.frame.hwhdr.msgctxu.fld.cb_idx; mf = MPT_INDEX_2_MFPTR(ioc, req_idx); - dprintk((KERN_INFO MYNAM ": %s: Got non-TURBO reply=%p\n", + dprintk((MYIOC_s_INFO_FMT "Got non-TURBO reply=%p\n", ioc->name, mr)); DBG_DUMP_REPLY_FRAME(mr) @@ -307,7 +387,7 @@ * Check/log IOC log info */ ioc_stat = le16_to_cpu(mr->u.reply.IOCStatus); - if (ioc_stat & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) { + if (ioc_stat & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) { u32 log_info = le32_to_cpu(mr->u.reply.IOCLogInfo); if ((int)ioc->chip_type <= (int)FC929) mpt_fc_log_info(ioc, log_info); @@ -318,7 +398,7 @@ /* * Process turbo (context) reply... */ - dirqprintk((KERN_INFO MYNAM ": %s: Got TURBO reply(=%08x)\n", ioc->name, pa)); + dirqprintk((MYIOC_s_INFO_FMT "Got TURBO reply(=%08x)\n", ioc->name, pa)); type = (pa >> MPI_CONTEXT_REPLY_TYPE_SHIFT); if (type == MPI_CONTEXT_REPLY_TYPE_SCSI_TARGET) { cb_idx = mpt_stm_index; @@ -357,6 +437,34 @@ pa = 0; /* No reply flush! */ } + if ((int)ioc->chip_type > (int)FC929) { + /* Verify mf, mf are reasonable. + */ + if ((mf) && ((mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth)) + || (mf < ioc->req_frames)) ) { + printk(MYIOC_s_WARN_FMT + "mpt_interrupt: Invalid mf (%p) req_idx (%d)!\n", ioc->name, mf, req_idx); + cb_idx = 0; + pa = 0; + freeme = 0; + } + if ((pa) && (mr) && ((mr >= MPT_INDEX_2_RFPTR(ioc, ioc->req_depth)) + || (mr < ioc->reply_frames)) ) { + printk(MYIOC_s_WARN_FMT + "mpt_interrupt: Invalid rf (%p)!\n", ioc->name, mr); + cb_idx = 0; + pa = 0; + freeme = 0; + } + if (cb_idx > (MPT_MAX_PROTOCOL_DRIVERS-1)) { + printk(MYIOC_s_WARN_FMT + "mpt_interrupt: Invalid cb_idx (%d)!\n", ioc->name, cb_idx); + cb_idx = 0; + pa = 0; + freeme = 0; + } + } + /* Check for (valid) IO callback! */ if (cb_idx) { /* Do the callback! */ @@ -374,15 +482,18 @@ /* Put Request back on FreeQ! */ spin_lock_irqsave(&ioc->FreeQlock, flags); Q_ADD_TAIL(&ioc->FreeQ, &mf->u.frame.linkage, MPT_FRAME_HDR); +#ifdef MFCNT + ioc->mfcnt--; +#endif spin_unlock_irqrestore(&ioc->FreeQlock, flags); } count++; - dirqprintk((KERN_INFO MYNAM ": %s: ISR processed frame #%d\n", ioc->name, count)); + dirqprintk((MYIOC_s_INFO_FMT "ISR processed frame #%d\n", ioc->name, count)); mb(); if (count >= MPT_MAX_REPLIES_PER_ISR) { - dirqprintk((KERN_INFO MYNAM ": %s: ISR processed %d replies.", + dirqprintk((MYIOC_s_INFO_FMT "ISR processed %d replies.", ioc->name, count)); dirqprintk((" Giving this ISR a break!\n")); return; @@ -409,17 +520,17 @@ int freereq = 1; u8 func; - dprintk((KERN_INFO MYNAM ": %s: mpt_base_reply() called\n", ioc->name)); + dprintk((MYIOC_s_INFO_FMT "mpt_base_reply() called\n", ioc->name)); if ((mf == NULL) || (mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth))) { - printk(KERN_ERR MYNAM ": %s: ERROR - NULL or BAD request frame ptr! (=%p)\n", + printk(MYIOC_s_ERR_FMT "NULL or BAD request frame ptr! (=%p)\n", ioc->name, mf); return 1; } if (reply == NULL) { - dprintk((KERN_ERR MYNAM ": %s: ERROR - Unexpected NULL Event (turbo?) reply!\n", + dprintk((MYIOC_s_ERR_FMT "Unexpected NULL Event (turbo?) reply!\n", ioc->name)); return 1; } @@ -430,7 +541,7 @@ } func = reply->u.hdr.Function; - dprintk((KERN_INFO MYNAM ": %s: mpt_base_reply, Function=%02Xh\n", + dprintk((MYIOC_s_INFO_FMT "mpt_base_reply, Function=%02Xh\n", ioc->name, func)); if (func == MPI_FUNCTION_EVENT_NOTIFICATION) { @@ -441,30 +552,77 @@ results = ProcessEventNotification(ioc, pEvReply, &evHandlers); if (results != evHandlers) { /* CHECKME! Any special handling needed here? */ - dprintk((KERN_WARNING MYNAM ": %s: Hmmm... Called %d event handlers, sum results = %d\n", + dprintk((MYIOC_s_WARN_FMT "Called %d event handlers, sum results = %d\n", ioc->name, evHandlers, results)); } /* - * Hmmm... It seems that EventNotificationReply is an exception - * to the rule of one reply per request. + * Hmmm... It seems that EventNotificationReply is an exception + * to the rule of one reply per request. */ if (pEvReply->MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY) freereq = 0; + #ifdef CONFIG_PROC_FS // LogEvent(ioc, pEvReply); #endif + } else if (func == MPI_FUNCTION_EVENT_ACK) { - dprintk((KERN_INFO MYNAM ": %s: mpt_base_reply, EventAck reply received\n", + dprintk((MYIOC_s_INFO_FMT "mpt_base_reply, EventAck reply received\n", ioc->name)); + } else if (func == MPI_FUNCTION_CONFIG) { + CONFIGPARMS *pCfg; + unsigned long flags; + + dprintk((MYIOC_s_INFO_FMT "config_complete (mf=%p,mr=%p)\n", + ioc->name, mf, reply)); + + pCfg = * ((CONFIGPARMS **)((u8 *) mf + ioc->req_sz - sizeof(void *))); + + if (pCfg) { + /* disable timer and remove from linked list */ + del_timer(&pCfg->timer); + + spin_lock_irqsave(&ioc->FreeQlock, flags); + Q_DEL_ITEM(&pCfg->linkage); + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + + /* + * If IOC Status is SUCCESS, save the header + * and set the status code to GOOD. + */ + pCfg->status = MPT_CONFIG_ERROR; + if (reply) { + ConfigReply_t *pReply = (ConfigReply_t *)reply; + u16 status; + + status = le16_to_cpu(pReply->IOCStatus) & MPI_IOCSTATUS_MASK; + dprintk((KERN_NOTICE " IOCStatus=%04xh, IOCLogInfo=%08xh\n", + status, le32_to_cpu(pReply->IOCLogInfo))); + + pCfg->status = status; + if (status == MPI_IOCSTATUS_SUCCESS) { + pCfg->hdr->PageVersion = pReply->Header.PageVersion; + pCfg->hdr->PageLength = pReply->Header.PageLength; + pCfg->hdr->PageNumber = pReply->Header.PageNumber; + pCfg->hdr->PageType = pReply->Header.PageType; + } + } + + /* + * Wake up the original calling thread + */ + pCfg->wait_done = 1; + wake_up(&mpt_waitq); + } } else { - printk(KERN_ERR MYNAM ": %s: ERROR - Unexpected msg function (=%02Xh) reply received!\n", + printk(MYIOC_s_ERR_FMT "Unexpected msg function (=%02Xh) reply received!\n", ioc->name, func); } /* - * Conditionally tell caller to free the original - * EventNotification/EventAck/unexpected request frame! + * Conditionally tell caller to free the original + * EventNotification/EventAck/unexpected request frame! */ return freereq; } @@ -480,21 +638,22 @@ * protocol-specific driver must do this before it will be able to * use any IOC resources, such as obtaining request frames. * - * NOTES: The SCSI protocol driver currently calls this routine twice - * in order to register separate callbacks; one for "normal" SCSI IO - * and another for MptScsiTaskMgmt requests. + * NOTES: The SCSI protocol driver currently calls this routine thrice + * in order to register separate callbacks; one for "normal" SCSI IO; + * one for MptScsiTaskMgmt requests; one for Scan/DV requests. * * Returns a positive integer valued "handle" in the - * range (and S.O.D. order) {7,6,...,1} if successful. + * range (and S.O.D. order) {N,...,7,6,5,...,1} if successful. * Any non-positive return value (including zero!) should be considered * an error by the caller. */ int mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass) { - int r = -1; int i; + last_drv_idx = -1; + #ifndef MODULE /* * Handle possibility of the mptscsih_detect() routine getting @@ -512,7 +671,7 @@ #endif /* - * Search for empty callback slot in this order: {7,6,...,1} + * Search for empty callback slot in this order: {N,...,7,6,5,...,1} * (slot/handle 0 is reserved!) */ for (i = MPT_MAX_PROTOCOL_DRIVERS-1; i; i--) { @@ -520,7 +679,7 @@ MptCallbacks[i] = cbfunc; MptDriverClass[i] = dclass; MptEvHandlers[i] = NULL; - r = i; + last_drv_idx = i; if (cbfunc != mpt_base_reply) { MOD_INC_USE_COUNT; } @@ -528,7 +687,7 @@ } } - return r; + return last_drv_idx; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ @@ -546,6 +705,11 @@ MptCallbacks[cb_idx] = NULL; MptDriverClass[cb_idx] = MPTUNKNOWN_DRIVER; MptEvHandlers[cb_idx] = NULL; + + last_drv_idx++; + if (isense_idx != -1 && isense_idx <= cb_idx) + isense_idx++; + if (cb_idx != mpt_base_index) { MOD_DEC_USE_COUNT; } @@ -639,7 +803,8 @@ * @handle: Handle of registered MPT protocol driver * @iocid: IOC unique identifier (integer) * - * Returns pointer to a MPT request frame or %NULL if none are available. + * Returns pointer to a MPT request frame or %NULL if none are available + * or IOC is not active. */ MPT_FRAME_HDR* mpt_get_msg_frame(int handle, int iocid) @@ -650,6 +815,16 @@ /* validate handle and ioc identifier */ iocp = mpt_adapters[iocid]; + +#ifdef MFCNT + if (!iocp->active) + printk(KERN_WARNING "IOC Not Active! mpt_get_msg_frame returning NULL!\n"); +#endif + + /* If interrupts are not attached, do not return a request frame */ + if (!iocp->active) + return NULL; + spin_lock_irqsave(&iocp->FreeQlock, flags); if (! Q_IS_EMPTY(&iocp->FreeQ)) { int req_offset; @@ -662,8 +837,20 @@ mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_offset / iocp->req_sz); mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0; +#ifdef MFCNT + iocp->mfcnt++; +#endif } spin_unlock_irqrestore(&iocp->FreeQlock, flags); + +#ifdef MFCNT + if (mf == NULL) + printk(KERN_WARNING "IOC Active. No free Msg Frames! Count 0x%x Max 0x%x\n", iocp->mfcnt, iocp->req_depth); + mfcounter++; + if (mfcounter == PRINT_MF_COUNT) + printk(KERN_INFO "MF Count 0x%x Max 0x%x \n", iocp->mfcnt, iocp->req_depth); +#endif + dmfprintk((KERN_INFO MYNAM ": %s: mpt_get_msg_frame(%d,%d), got mf=%p\n", iocp->name, handle, iocid, mf)); return mf; @@ -687,7 +874,7 @@ iocp = mpt_adapters[iocid]; if (iocp != NULL) { - dma_addr_t mf_dma_addr; + u32 mf_dma_addr; int req_offset; /* ensure values are reset properly! */ @@ -700,23 +887,23 @@ #ifdef MPT_DEBUG_MSG_FRAME { u32 *m = mf->u.frame.hwhdr.__hdr; - int i, n; + int ii, n; printk(KERN_INFO MYNAM ": %s: About to Put msg frame @ %p:\n" KERN_INFO " ", iocp->name, m); n = iocp->req_sz/4 - 1; while (m[n] == 0) n--; - for (i=0; i<=n; i++) { - if (i && ((i%8)==0)) + for (ii=0; ii<=n; ii++) { + if (ii && ((ii%8)==0)) printk("\n" KERN_INFO " "); - printk(" %08x", le32_to_cpu(m[i])); + printk(" %08x", le32_to_cpu(m[ii])); } printk("\n"); } #endif - mf_dma_addr = iocp->req_frames_dma + req_offset; + mf_dma_addr = iocp->req_frames_low_dma + req_offset; CHIPREG_WRITE32(&iocp->chip->RequestFifo, mf_dma_addr); } } @@ -742,6 +929,9 @@ /* Put Request back on FreeQ! */ spin_lock_irqsave(&iocp->FreeQlock, flags); Q_ADD_TAIL(&iocp->FreeQ, &mf->u.frame.linkage, MPT_FRAME_HDR); +#ifdef MFCNT + iocp->mfcnt--; +#endif spin_unlock_irqrestore(&iocp->FreeQlock, flags); } } @@ -754,8 +944,9 @@ * @iocid: IOC unique identifier (integer) * @reqBytes: Size of the request in bytes * @req: Pointer to MPT request frame + * @sleepFlag: Use schedule if CAN_SLEEP else use udelay. * - * This routine is used exclusively by mptscsih to send MptScsiTaskMgmt + * This routine is used exclusively to send MptScsiTaskMgmt * requests since they are required to be sent via doorbell handshake. * * NOTE: It is the callers responsibility to byte-swap fields in the @@ -764,41 +955,30 @@ * Returns 0 for success, non-zero for failure. */ int -mpt_send_handshake_request(int handle, int iocid, int reqBytes, u32 *req) +mpt_send_handshake_request(int handle, int iocid, int reqBytes, u32 *req, int sleepFlag) { MPT_ADAPTER *iocp; int r = 0; iocp = mpt_adapters[iocid]; if (iocp != NULL) { - u8 *req_as_bytes; - u32 ioc_raw_state; - int i; - - /* YIKES! We already know something is amiss. - * Do upfront check on IOC state. - */ - ioc_raw_state = GetIocState(iocp, 0); - if ((ioc_raw_state & MPI_DOORBELL_ACTIVE) || - ((ioc_raw_state & MPI_IOC_STATE_MASK) != MPI_IOC_STATE_OPERATIONAL)) { - printk(KERN_WARNING MYNAM ": %s: Bad IOC state (%08x) WARNING!\n", - iocp->name, ioc_raw_state); - if ((r = mpt_do_ioc_recovery(iocp, MPT_HOSTEVENT_IOC_RECOVER)) != 0) { - printk(KERN_WARNING MYNAM ": WARNING - (%d) Cannot recover %s\n", - r, iocp->name); - return r; - } - } + u8 *req_as_bytes; + int ii; + + /* State is known to be good upon entering + * this function so issue the bus reset + * request. + */ /* * Emulate what mpt_put_msg_frame() does /wrt to sanity * setting cb_idx/req_idx. But ONLY if this request * is in proper (pre-alloc'd) request buffer range... */ - i = MFPTR_2_MPT_INDEX(iocp,(MPT_FRAME_HDR*)req); - if (reqBytes >= 12 && i >= 0 && i < iocp->req_depth) { + ii = MFPTR_2_MPT_INDEX(iocp,(MPT_FRAME_HDR*)req); + if (reqBytes >= 12 && ii >= 0 && ii < iocp->req_depth) { MPT_FRAME_HDR *mf = (MPT_FRAME_HDR*)req; - mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(i); + mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(ii); mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle; } @@ -810,36 +990,40 @@ ((reqBytes/4)<chip->Doorbell) & MPI_DOORBELL_ACTIVE)) + return -5; + dhsprintk((KERN_INFO MYNAM ": %s: mpt_send_handshake_request start, WaitCnt=%d\n", - iocp->name, i)); + iocp->name, ii)); CHIPREG_WRITE32(&iocp->chip->IntStatus, 0); - if ((r = WaitForDoorbellAck(iocp, 1)) < 0) { + if ((r = WaitForDoorbellAck(iocp, 1, sleepFlag)) < 0) { return -2; } /* Send request via doorbell handshake */ req_as_bytes = (u8 *) req; - for (i = 0; i < reqBytes/4; i++) { + for (ii = 0; ii < reqBytes/4; ii++) { u32 word; - word = ((req_as_bytes[(i*4) + 0] << 0) | - (req_as_bytes[(i*4) + 1] << 8) | - (req_as_bytes[(i*4) + 2] << 16) | - (req_as_bytes[(i*4) + 3] << 24)); + word = ((req_as_bytes[(ii*4) + 0] << 0) | + (req_as_bytes[(ii*4) + 1] << 8) | + (req_as_bytes[(ii*4) + 2] << 16) | + (req_as_bytes[(ii*4) + 3] << 24)); CHIPREG_WRITE32(&iocp->chip->Doorbell, word); - if ((r = WaitForDoorbellAck(iocp, 1)) < 0) { + if ((r = WaitForDoorbellAck(iocp, 1, sleepFlag)) < 0) { r = -3; break; } } - if ((r = WaitForDoorbellInt(iocp, 2)) >= 0) + if ((r = WaitForDoorbellInt(iocp, 10, sleepFlag)) >= 0) r = 0; else r = -4; @@ -871,8 +1055,8 @@ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** - * mpt_adapter_find_next - Find next MPT adapter pointer. - * @prev: Pointer to previous MPT adapter + * mpt_adapter_find_next - Find next MPT adapter pointer. + * @prev: Pointer to previous MPT adapter * * Returns next MPT adapter pointer or %NULL if there are no more. */ @@ -888,13 +1072,13 @@ } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** +/* * mpt_pci_scan - Scan PCI devices for MPT adapters. * * Returns count of MPT adapters found, keying off of PCI vendor and * device_id's. */ -int __init +static int __init mpt_pci_scan(void) { struct pci_dev *pdev; @@ -906,7 +1090,7 @@ dprintk((KERN_INFO MYNAM ": Checking for MPT adapters...\n")); /* - * NOTE: The 929 (I believe) will appear as 2 separate PCI devices, + * NOTE: The 929 and 1030 will appear as 2 separate PCI devices, * one for each channel. */ pci_for_each_dev(pdev) { @@ -917,9 +1101,9 @@ if ((pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC909) && (pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC929) && (pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC919) && + (pdev->device != MPI_MANUFACTPAGE_DEVID_53C1030) && #if 0 /* FIXME! C103x family */ - (pdev->device != MPI_MANUFACTPAGE_DEVID_53C1030) && (pdev->device != MPI_MANUFACTPAGE_DEVID_53C1030_ZC) && (pdev->device != MPI_MANUFACTPAGE_DEVID_53C1035) && #endif @@ -929,7 +1113,7 @@ } /* GRRRRR - * 929 dual function devices may be presented in Func 1,0 order, + * dual function devices (929, 1030) may be presented in Func 1,0 order, * but we'd really really rather have them in Func 0,1 order. * Do some kind of look ahead here... */ @@ -937,11 +1121,11 @@ pdev2 = pci_peek_next_dev(pdev); if (pdev2 && (pdev2->vendor == 0x1000) && (PCI_SLOT(pdev2->devfn) == PCI_SLOT(pdev->devfn)) && - (pdev2->device == MPI_MANUFACTPAGE_DEVICEID_FC929) && + (pdev2->device == pdev->device) && (pdev2->bus->number == pdev->bus->number) && !(pdev2->devfn & 1)) { dprintk((KERN_INFO MYNAM ": MPT adapter found: PCI bus/dfn=%02x/%02xh, class=%08x, id=%xh\n", - pdev2->bus->number, pdev2->devfn, pdev2->class, pdev2->device)); + pdev2->bus->number, pdev2->devfn, pdev2->class, pdev2->device)); found++; if ((r = mpt_adapter_install(pdev2)) == 0) count++; @@ -969,9 +1153,7 @@ } #ifdef CONFIG_PROC_FS - if (procmpt_create() != 0) - printk(KERN_WARNING MYNAM ": WARNING! - %s creation failed!\n", - MPT_PROCFS_MPTBASEDIR); + (void) procmpt_create(); #endif return count; @@ -1004,7 +1186,7 @@ } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** +/* * mpt_adapter_install - Install a PCI intelligent MPT adapter. * @pdev: Pointer to pci_dev structure * @@ -1030,7 +1212,7 @@ unsigned long port; u32 msize; u32 psize; - int i; + int ii; int r = -ENODEV; int len; @@ -1040,41 +1222,68 @@ return -ENOMEM; } memset(ioc, 0, sizeof(*ioc)); - ioc->req_sz = MPT_REQ_SIZE; /* avoid div by zero! */ ioc->alloc_total = sizeof(MPT_ADAPTER); + ioc->req_sz = MPT_DEFAULT_FRAME_SIZE; /* avoid div by zero! */ + ioc->reply_sz = ioc->req_sz; ioc->pcidev = pdev; + ioc->diagPending = 0; + spin_lock_init(&ioc->diagLock); + + /* Initialize the event logging. + */ + ioc->eventTypes = 0; /* None */ + ioc->eventContext = 0; + ioc->eventLogSize = 0; + ioc->events = NULL; + +#ifdef MFCNT + ioc->mfcnt = 0; +#endif + + /* Initialize the FW and Data image pointers. + */ + ioc->FWImage = NULL; + ioc->FWImage_dma = 0; + + /* Initilize SCSI Config Data structure + */ + memset(&ioc->spi_data, 0, sizeof(ScsiCfgData)); + + /* Initialize the running configQ head. + */ + Q_INIT(&ioc->configQ, Q_ITEM); /* Find lookup slot. */ - for (i=0; i < MPT_MAX_ADAPTERS; i++) { - if (mpt_adapters[i] == NULL) { - ioc->id = i; /* Assign adapter unique id (lookup) */ + for (ii=0; ii < MPT_MAX_ADAPTERS; ii++) { + if (mpt_adapters[ii] == NULL) { + ioc->id = ii; /* Assign adapter unique id (lookup) */ break; } } - if (i == MPT_MAX_ADAPTERS) { - printk(KERN_ERR MYNAM ": ERROR - mpt_adapters[%d] table overflow!\n", i); + if (ii == MPT_MAX_ADAPTERS) { + printk(KERN_ERR MYNAM ": ERROR - mpt_adapters[%d] table overflow!\n", ii); kfree(ioc); return -ENFILE; } mem_phys = msize = 0; port = psize = 0; - for (i=0; i < DEVICE_COUNT_RESOURCE; i++) { - if (pdev->PCI_BASEADDR_FLAGS(i) & PCI_BASE_ADDRESS_SPACE_IO) { + for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) { + if (pdev->PCI_BASEADDR_FLAGS(ii) & PCI_BASE_ADDRESS_SPACE_IO) { /* Get I/O space! */ - port = pdev->PCI_BASEADDR_START(i); - psize = PCI_BASEADDR_SIZE(pdev,i); + port = pdev->PCI_BASEADDR_START(ii); + psize = PCI_BASEADDR_SIZE(pdev,ii); } else { /* Get memmap */ - mem_phys = pdev->PCI_BASEADDR_START(i); - msize = PCI_BASEADDR_SIZE(pdev,i); + mem_phys = pdev->PCI_BASEADDR_START(ii); + msize = PCI_BASEADDR_SIZE(pdev,ii); break; } } ioc->mem_size = msize; - if (i == DEVICE_COUNT_RESOURCE) { + if (ii == DEVICE_COUNT_RESOURCE) { printk(KERN_ERR MYNAM ": ERROR - MPT adapter has no memory regions defined!\n"); kfree(ioc); return -EINVAL; @@ -1098,6 +1307,8 @@ } dprintk((KERN_INFO MYNAM ": mem = %p, mem_phys = %lx\n", mem, mem_phys)); + dprintk((KERN_INFO MYNAM ": facts @ %p, pfacts[0] @ %p\n", + &ioc->facts, &ioc->pfacts[0])); if (PortIo) { u8 *pmem = (u8*)port; ioc->mem_phys = port; @@ -1107,6 +1318,13 @@ ioc->chip = (SYSIF_REGS*)mem; } + /* Save Port IO values incase we need to do downloadboot */ + { + u8 *pmem = (u8*)port; + ioc->pio_mem_phys = port; + ioc->pio_chip = (SYSIF_REGS*)pmem; + } + ioc->chip_type = FCUNK; if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC909) { ioc->chip_type = FC909; @@ -1120,12 +1338,19 @@ ioc->chip_type = FC919; ioc->prod_name = "LSIFC919"; } -#if 0 - else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_53C1030) { + else if (pdev->device == MPI_MANUFACTPAGE_DEVID_53C1030) { ioc->chip_type = C1030; ioc->prod_name = "LSI53C1030"; + { + /* 1030 Chip Fix. Disable Split transactions + * for PCIX. Set bits 4 - 6 to zero. + */ + u16 pcixcmd = 0; + pci_read_config_word(pdev, 0x6a, &pcixcmd); + pcixcmd &= 0xFF8F; + pci_write_config_word(pdev, 0x6a, pcixcmd); + } } -#endif myname = "iocN"; len = strlen(myname); @@ -1145,8 +1370,13 @@ r = request_irq(pdev->irq, mpt_interrupt, SA_SHIRQ, ioc->name, ioc); if (r < 0) { - printk(KERN_ERR MYNAM ": %s: ERROR - Unable to allocate interrupt %d!\n", +#ifndef __sparc__ + printk(MYIOC_s_ERR_FMT "Unable to allocate interrupt %d!\n", ioc->name, pdev->irq); +#else + printk(MYIOC_s_ERR_FMT "Unable to allocate interrupt %s!\n", + ioc->name, __irq_itoa(pdev->irq)); +#endif iounmap(mem); kfree(ioc); return -EBUSY; @@ -1156,7 +1386,11 @@ pci_set_master(pdev); /* ?? */ +#ifndef __sparc__ dprintk((KERN_INFO MYNAM ": %s installed at interrupt %d\n", ioc->name, pdev->irq)); +#else + dprintk((KERN_INFO MYNAM ": %s installed at interrupt %s\n", ioc->name, __irq_itoa(pdev->irq))); +#endif } /* tack onto tail of our MPT adapter list */ @@ -1166,12 +1400,12 @@ mpt_adapters[ioc->id] = ioc; /* NEW! 20010220 -sralston - * Check for "929 bound ports" to reduce redundant resets. + * Check for "bound ports" (929, 1030) to reduce redundant resets. */ - if (ioc->chip_type == FC929) - mpt_detect_929_bound_ports(ioc, pdev); + if ((ioc->chip_type == FC929) || (ioc->chip_type == C1030)) + mpt_detect_bound_ports(ioc, pdev); - if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP)) != 0) { + if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP, CAN_SLEEP)) != 0) { printk(KERN_WARNING MYNAM ": WARNING - %s did not initialize properly! (%d)\n", ioc->name, r); } @@ -1180,10 +1414,11 @@ } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** +/* * mpt_do_ioc_recovery - Initialize or recover MPT adapter. * @ioc: Pointer to MPT adapter structure * @reason: Event word / reason + * @sleepFlag: Use schedule if CAN_SLEEP else use udelay. * * This routine performs all the steps necessary to bring the IOC * to a OPERATIONAL state. @@ -1191,16 +1426,21 @@ * This routine also pre-fetches the LAN MAC address of a Fibre Channel * MPT adapter. * - * Returns 0 for success. + * Returns: + * 0 for success + * -1 if failed to get board READY + * -2 if READY but IOCFacts Failed + * -3 if READY but PrimeIOCFifos Failed + * -4 if READY but IOCInit Failed */ static int -mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason) +mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) { int hard_reset_done = 0; int alt_ioc_ready = 0; int hard; int r; - int i; + int ii; int handlers; printk(KERN_INFO MYNAM ": Initiating %s %s\n", @@ -1211,156 +1451,106 @@ ioc->active = 0; /* NOTE: Access to IOC's request FreeQ is now blocked! */ -// FIXME? Cleanup all IOC requests here! (or below?) -// But watch out for event associated request? + if (ioc->alt_ioc) { + /* Disable alt-IOC's reply interrupts for a bit ... */ + CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, 0xFFFFFFFF); + ioc->alt_ioc->active = 0; + /* NOTE: Access to alt-IOC's request FreeQ is now blocked! */ + } - hard = HardReset; - if (ioc->alt_ioc && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) + hard = 1; + if (reason == MPT_HOSTEVENT_IOC_BRINGUP) hard = 0; - if ((hard_reset_done = MakeIocReady(ioc, hard)) < 0) { + if ((hard_reset_done = MakeIocReady(ioc, hard, sleepFlag)) < 0) { printk(KERN_WARNING MYNAM ": %s NOT READY WARNING!\n", ioc->name); return -1; } -// NEW! -#if 0 // Kiss-of-death!?! - if (ioc->alt_ioc) { -// Grrr... Hold off any alt-IOC interrupts (and events) while -// handshaking to IOC, needed because? - /* Disable alt-IOC's reply interrupts for a bit ... */ - alt_ioc_intmask = CHIPREG_READ32(&ioc->alt_ioc->chip->IntMask); - CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, 0xFFFFFFFF); - ioc->alt_ioc->active = 0; - /* NOTE: Access to alt-IOC's request FreeQ is now blocked! */ - } -#endif - + /* hard_reset_done = 0 if a soft reset was performed + * and 1 if a hard reset was performed. + */ if (hard_reset_done && ioc->alt_ioc) { - if ((r = MakeIocReady(ioc->alt_ioc, 0)) == 0) + if ((r = MakeIocReady(ioc->alt_ioc, 0, sleepFlag)) == 0) alt_ioc_ready = 1; else - printk(KERN_WARNING MYNAM ": alt-%s: (%d) Not ready WARNING!\n", + printk(KERN_WARNING MYNAM + ": alt-%s: (%d) Not ready WARNING!\n", ioc->alt_ioc->name, r); } + /* Get IOC facts! */ + if ((r = GetIocFacts(ioc, sleepFlag, reason)) != 0) + return -2; if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { - /* Get IOC facts! */ - if ((r = GetIocFacts(ioc)) != 0) - return -2; MptDisplayIocCapabilities(ioc); } - /* - * Call each currently registered protocol IOC reset handler - * with pre-reset indication. - * NOTE: If we're doing _IOC_BRINGUP, there can be no - * MptResetHandlers[] registered yet. - */ - if (hard_reset_done) { - r = handlers = 0; - for (i=MPT_MAX_PROTOCOL_DRIVERS-1; i; i--) { - if (MptResetHandlers[i]) { - dprintk((KERN_INFO MYNAM ": %s: Calling IOC pre_reset handler #%d\n", - ioc->name, i)); - r += (*(MptResetHandlers[i]))(ioc, MPT_IOC_PRE_RESET); - handlers++; - - if (alt_ioc_ready) { - dprintk((KERN_INFO MYNAM ": %s: Calling alt-IOC pre_reset handler #%d\n", - ioc->alt_ioc->name, i)); - r += (*(MptResetHandlers[i]))(ioc->alt_ioc, MPT_IOC_PRE_RESET); - handlers++; - } - } - } - /* FIXME? Examine results here? */ - } - - // May need to check/upload firmware & data here! - - if ((r = SendIocInit(ioc)) != 0) - return -3; -// NEW! if (alt_ioc_ready) { - if ((r = SendIocInit(ioc->alt_ioc)) != 0) { - alt_ioc_ready = 0; - printk(KERN_WARNING MYNAM ": alt-%s: (%d) init failure WARNING!\n", - ioc->alt_ioc->name, r); - } - } - - /* - * Call each currently registered protocol IOC reset handler - * with post-reset indication. - * NOTE: If we're doing _IOC_BRINGUP, there can be no - * MptResetHandlers[] registered yet. - */ - if (hard_reset_done) { - r = handlers = 0; - for (i=MPT_MAX_PROTOCOL_DRIVERS-1; i; i--) { - if (MptResetHandlers[i]) { - dprintk((KERN_INFO MYNAM ": %s: Calling IOC post_reset handler #%d\n", - ioc->name, i)); - r += (*(MptResetHandlers[i]))(ioc, MPT_IOC_POST_RESET); - handlers++; - - if (alt_ioc_ready) { - dprintk((KERN_INFO MYNAM ": %s: Calling alt-IOC post_reset handler #%d\n", - ioc->alt_ioc->name, i)); - r += (*(MptResetHandlers[i]))(ioc->alt_ioc, MPT_IOC_POST_RESET); - handlers++; - } - } + if ((r = GetIocFacts(ioc->alt_ioc, sleepFlag, reason)) != 0) + return -2; + if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { + MptDisplayIocCapabilities(ioc->alt_ioc); } - /* FIXME? Examine results here? */ } /* * Prime reply & request queues! - * (mucho alloc's) + * (mucho alloc's) Must be done prior to + * init as upper addresses are needed for init. */ if ((r = PrimeIocFifos(ioc)) != 0) + return -3; + + // May need to check/upload firmware & data here! + if ((r = SendIocInit(ioc, sleepFlag)) != 0) return -4; // NEW! if (alt_ioc_ready && ((r = PrimeIocFifos(ioc->alt_ioc)) != 0)) { printk(KERN_WARNING MYNAM ": alt-%s: (%d) FIFO mgmt alloc WARNING!\n", ioc->alt_ioc->name, r); + alt_ioc_ready = 0; } -// FIXME! Cleanup all IOC (and alt-IOC?) requests here! + if (alt_ioc_ready) { + if ((r = SendIocInit(ioc->alt_ioc, sleepFlag)) != 0) { + alt_ioc_ready = 0; + printk(KERN_WARNING MYNAM + ": alt-%s: (%d) init failure WARNING!\n", + ioc->alt_ioc->name, r); + } + } - if ((ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) && - (ioc->lan_cnfg_page0.Header.PageLength == 0)) { - /* - * Pre-fetch the ports LAN MAC address! - * (LANPage1_t stuff) - */ - (void) GetLanConfigPages(ioc); -#ifdef MPT_DEBUG - { - u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; - dprintk((KERN_INFO MYNAM ": %s: LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n", - ioc->name, a[5], a[4], a[3], a[2], a[1], a[0] )); + if (reason == MPT_HOSTEVENT_IOC_BRINGUP){ + if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) { + dprintk((MYIOC_s_INFO_FMT + "firmware upload required!\n", ioc->name)); + + r = mpt_do_upload(ioc, sleepFlag); + if (r != 0) + printk(KERN_WARNING MYNAM ": firmware upload failure!\n"); + /* Handle the alt IOC too */ + if (alt_ioc_ready){ + r = mpt_do_upload(ioc->alt_ioc, sleepFlag); + if (r != 0) + printk(KERN_WARNING MYNAM ": firmware upload failure!\n"); + } } -#endif } + /* Enable! (reply interrupt) */ CHIPREG_WRITE32(&ioc->chip->IntMask, ~(MPI_HIM_RIM)); ioc->active = 1; -// NEW! -#if 0 // Kiss-of-death!?! - if (alt_ioc_ready && (r==0)) { + if (ioc->alt_ioc) { /* (re)Enable alt-IOC! (reply interrupt) */ dprintk((KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n", ioc->alt_ioc->name)); CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, ~(MPI_HIM_RIM)); ioc->alt_ioc->active = 1; } -#endif /* NEW! 20010120 -sralston * Enable MPT base driver management of EventNotification @@ -1368,19 +1558,95 @@ */ if (!ioc->facts.EventState) (void) SendEventNotification(ioc, 1); /* 1=Enable EventNotification */ -// NEW! -// FIXME!?! -// if (ioc->alt_ioc && alt_ioc_ready && !ioc->alt_ioc->facts.EventState) { -// (void) SendEventNotification(ioc->alt_ioc, 1); /* 1=Enable EventNotification */ -// } + + if (ioc->alt_ioc && alt_ioc_ready && !ioc->alt_ioc->facts.EventState) + (void) SendEventNotification(ioc->alt_ioc, 1); /* 1=Enable EventNotification */ + + /* (Bugzilla:fibrebugs, #513) + * Bug fix (part 2)! 20010905 -sralston + * Add additional "reason" check before call to GetLanConfigPages + * (combined with GetIoUnitPage2 call). This prevents a somewhat + * recursive scenario; GetLanConfigPages times out, timer expired + * routine calls HardResetHandler, which calls into here again, + * and we try GetLanConfigPages again... + */ + if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { + if ((int)ioc->chip_type <= (int)FC929) { + /* + * Pre-fetch FC port WWN and stuff... + * (FCPortPage0_t stuff) + */ + for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) { + (void) GetFcPortPage0(ioc, ii); + } + + if ((ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) && + (ioc->lan_cnfg_page0.Header.PageLength == 0)) { + /* + * Pre-fetch the ports LAN MAC address! + * (LANPage1_t stuff) + */ + (void) GetLanConfigPages(ioc); +#ifdef MPT_DEBUG + { + u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; + dprintk((MYIOC_s_INFO_FMT "LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n", + ioc->name, a[5], a[4], a[3], a[2], a[1], a[0] )); + } +#endif + } + } else { + /* Get NVRAM and adapter maximums from SPP 0 and 2 + */ + mpt_GetScsiPortSettings(ioc, 0); + + /* Get version and length of SDP 1 + */ + mpt_readScsiDevicePageHeaders(ioc, 0); + + /* Find IM volumes + */ + if (ioc->facts.MsgVersion >= 0x0102) + mpt_findImVolumes(ioc); + } + + GetIoUnitPage2(ioc); + } + + /* + * Call each currently registered protocol IOC reset handler + * with post-reset indication. + * NOTE: If we're doing _IOC_BRINGUP, there can be no + * MptResetHandlers[] registered yet. + */ + if (hard_reset_done) { + r = handlers = 0; + for (ii=MPT_MAX_PROTOCOL_DRIVERS-1; ii; ii--) { + if (MptResetHandlers[ii]) { + dprintk((MYIOC_s_INFO_FMT "Calling IOC post_reset handler #%d\n", + ioc->name, ii)); + r += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_POST_RESET); + handlers++; + + if (alt_ioc_ready) { + dprintk((MYIOC_s_INFO_FMT "Calling alt-%s post_reset handler #%d\n", + ioc->name, ioc->alt_ioc->name, ii)); + r += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_POST_RESET); + handlers++; + } + } + } + /* FIXME? Examine results here? */ + } return 0; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* - * mpt_detect_929_bound_ports - Search for PCI bus/dev_function - * which matches PCI bus/dev_function (+/-1) for newly discovered 929. + * mpt_detect_bound_ports - Search for PCI bus/dev_function + * which matches PCI bus/dev_function (+/-1) for newly discovered 929 + * or 1030. * @ioc: Pointer to MPT adapter structure * @pdev: Pointer to (struct pci_dev) structure * @@ -1388,22 +1654,22 @@ * using alt_ioc pointer fields in their %MPT_ADAPTER structures. */ static void -mpt_detect_929_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev) +mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev) { MPT_ADAPTER *ioc_srch = mpt_adapter_find_first(); unsigned int match_lo, match_hi; match_lo = pdev->devfn-1; match_hi = pdev->devfn+1; - dprintk((KERN_INFO MYNAM ": %s: PCI bus/devfn=%x/%x, searching for devfn match on %x or %x\n", + dprintk((MYIOC_s_INFO_FMT "PCI bus/devfn=%x/%x, searching for devfn match on %x or %x\n", ioc->name, pdev->bus->number, pdev->devfn, match_lo, match_hi)); while (ioc_srch != NULL) { struct pci_dev *_pcidev = ioc_srch->pcidev; - if ( (_pcidev->device == MPI_MANUFACTPAGE_DEVICEID_FC929) && - (_pcidev->bus->number == pdev->bus->number) && - (_pcidev->devfn == match_lo || _pcidev->devfn == match_hi) ) { + if ((_pcidev->device == pdev->device) && + (_pcidev->bus->number == pdev->bus->number) && + (_pcidev->devfn == match_lo || _pcidev->devfn == match_hi) ) { /* Paranoia checks */ if (ioc->alt_ioc != NULL) { printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n", @@ -1418,8 +1684,6 @@ ioc->name, ioc_srch->name)); ioc_srch->alt_ioc = ioc; ioc->alt_ioc = ioc_srch; - ioc->sod_reset = ioc->alt_ioc->sod_reset; - ioc->last_kickstart = ioc->alt_ioc->last_kickstart; break; } ioc_srch = mpt_adapter_find_next(ioc_srch); @@ -1440,10 +1704,10 @@ u32 state; /* Disable the FW */ - state = GetIocState(this, 1); + state = mpt_GetIocState(this, 1); if (state == MPI_IOC_STATE_OPERATIONAL) { - if (SendIocReset(this, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET) != 0) - (void) KickStart(this, 1); + if (SendIocReset(this, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, NO_SLEEP) != 0) + (void) KickStart(this, 1, NO_SLEEP); } /* Disable adapter interrupts! */ @@ -1475,12 +1739,37 @@ } if (freeup && this->sense_buf_pool != NULL) { - sz = (this->req_depth * 256); + sz = (this->req_depth * MPT_SENSE_BUFFER_ALLOC); pci_free_consistent(this->pcidev, sz, this->sense_buf_pool, this->sense_buf_pool_dma); this->sense_buf_pool = NULL; this->alloc_total -= sz; } + + if (freeup && this->events != NULL){ + sz = MPTCTL_EVENT_LOG_SIZE * sizeof(MPT_IOCTL_EVENTS); + kfree(this->events); + this->events = NULL; + this->alloc_total -= sz; + } + + if (freeup && this->FWImage != NULL) { + sz = this->facts.FWImageSize; + pci_free_consistent(this->pcidev, sz, + this->FWImage, this->FWImage_dma); + this->FWImage = NULL; + this->alloc_total -= sz; + } + + if (freeup && this->spi_data.nvram != NULL) { + kfree(this->spi_data.nvram); + this->spi_data.nvram = NULL; + } + + if (freeup && this->spi_data.pIocPg3 != NULL) { + kfree(this->spi_data.pIocPg3); + this->spi_data.pIocPg3 = NULL; + } } } @@ -1575,23 +1864,30 @@ /* * MakeIocReady - Get IOC to a READY state, using KickStart if needed. * @ioc: Pointer to MPT_ADAPTER structure - * @kick: Force hard KickStart of IOC + * @force: Force hard KickStart of IOC + * @sleepFlag: Specifies whether the process can sleep * - * Returns 0 for already-READY, 1 for hard reset success, - * else negative for failure. + * Returns: + * 1 - DIAG reset and READY + * 0 - READY initially OR soft reset and READY + * -1 - Any failure on KickStart + * -2 - Msg Unit Reset Failed + * -3 - IO Unit Reset Failed + * -4 - IOC owned by a PEER */ static int -MakeIocReady(MPT_ADAPTER *ioc, int force) +MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) { u32 ioc_state; int statefault = 0; - int cntdn; + int cntdn; int hard_reset_done = 0; int r; - int i; + int ii; + int whoinit; /* Get current [raw] IOC state */ - ioc_state = GetIocState(ioc, 0); + ioc_state = mpt_GetIocState(ioc, 0); dhsprintk((KERN_INFO MYNAM "::MakeIocReady, %s [raw] state=%08x\n", ioc->name, ioc_state)); /* @@ -1600,7 +1896,7 @@ */ if (ioc_state & MPI_DOORBELL_ACTIVE) { statefault = 1; - printk(KERN_WARNING MYNAM ": %s: Uh-oh, unexpected doorbell active!\n", + printk(MYIOC_s_WARN_FMT "Unexpected doorbell active!\n", ioc->name); } @@ -1613,7 +1909,7 @@ */ if ((ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_FAULT) { statefault = 2; - printk(KERN_WARNING MYNAM ": %s: Uh-oh, IOC is in FAULT state!!!\n", + printk(MYIOC_s_WARN_FMT "IOC is in FAULT state!!!\n", ioc->name); printk(KERN_WARNING " FAULT code = %04xh\n", ioc_state & MPI_DOORBELL_DATA_MASK); @@ -1623,28 +1919,49 @@ * Hmmm... Did it get left operational? */ if ((ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_OPERATIONAL) { - statefault = 3; - dprintk((KERN_WARNING MYNAM ": %s: Hmmm... IOC operational unexpected\n", + dprintk((MYIOC_s_WARN_FMT "IOC operational unexpected\n", ioc->name)); + + /* Check WhoInit. + * If PCI Peer, exit. + * Else, if no fault conditions are present, issue a MessageUnitReset + * Else, fall through to KickStart case + */ + whoinit = (ioc_state & MPI_DOORBELL_WHO_INIT_MASK) >> MPI_DOORBELL_WHO_INIT_SHIFT; + dprintk((KERN_WARNING MYNAM + ": whoinit 0x%x\n statefault %d force %d\n", + whoinit, statefault, force)); + if (whoinit == MPI_WHOINIT_PCI_PEER) + return -4; + else { + if ((statefault == 0 ) && (force == 0)) { + if ((r = SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag)) == 0) + return 0; + } + statefault = 3; + } } - hard_reset_done = KickStart(ioc, statefault||force); + hard_reset_done = KickStart(ioc, statefault||force, sleepFlag); if (hard_reset_done < 0) return -1; /* * Loop here waiting for IOC to come READY. */ - i = 0; + ii = 0; cntdn = HZ * 15; - while ((ioc_state = GetIocState(ioc, 1)) != MPI_IOC_STATE_READY) { + if (sleepFlag != CAN_SLEEP) + cntdn *= 10; /* 1500 iterations @ 1msec per */ + + while ((ioc_state = mpt_GetIocState(ioc, 1)) != MPI_IOC_STATE_READY) { if (ioc_state == MPI_IOC_STATE_OPERATIONAL) { /* * BIOS or previous driver load left IOC in OP state. * Reset messaging FIFOs. */ - if ((r = SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET)) != 0) { - printk(KERN_ERR MYNAM ": %s: ERROR - IOC msg unit reset failed!\n", ioc->name); + if ((r = SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag)) != 0) { + printk(MYIOC_s_ERR_FMT "IOC msg unit reset failed!\n", ioc->name); return -2; } } else if (ioc_state == MPI_IOC_STATE_RESET) { @@ -1652,25 +1969,30 @@ * Something is wrong. Try to get IOC back * to a known state. */ - if ((r = SendIocReset(ioc, MPI_FUNCTION_IO_UNIT_RESET)) != 0) { - printk(KERN_ERR MYNAM ": %s: ERROR - IO unit reset failed!\n", ioc->name); + if ((r = SendIocReset(ioc, MPI_FUNCTION_IO_UNIT_RESET, sleepFlag)) != 0) { + printk(MYIOC_s_ERR_FMT "IO unit reset failed!\n", ioc->name); return -3; } } - i++; cntdn--; + ii++; cntdn--; if (!cntdn) { - printk(KERN_ERR MYNAM ": %s: ERROR - Wait IOC_READY state timeout(%d)!\n", - ioc->name, (i+5)/HZ); + printk(MYIOC_s_ERR_FMT "Wait IOC_READY state timeout(%d)!\n", + ioc->name, (ii+5)/HZ); return -ETIME; } - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(1); + if (sleepFlag == CAN_SLEEP) { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(1); + } else { + mdelay (1); /* 1 msec delay */ + } + } if (statefault < 3) { - printk(KERN_WARNING MYNAM ": %s: Whew! Recovered from %s\n", + printk(MYIOC_s_INFO_FMT "Recovered from %s\n", ioc->name, statefault==1 ? "stuck handshake" : "IOC FAULT"); } @@ -1680,21 +2002,21 @@ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* - * GetIocState - Get the current state of a MPT adapter. + * mpt_GetIocState - Get the current state of a MPT adapter. * @ioc: Pointer to MPT_ADAPTER structure * @cooked: Request raw or cooked IOC state * * Returns all IOC Doorbell register bits if cooked==0, else just the * Doorbell bits in MPI_IOC_STATE_MASK. */ -static u32 -GetIocState(MPT_ADAPTER *ioc, int cooked) +u32 +mpt_GetIocState(MPT_ADAPTER *ioc, int cooked) { u32 s, sc; /* Get! */ s = CHIPREG_READ32(&ioc->chip->Doorbell); - dprintk((KERN_INFO MYNAM ": %s: raw state = %08x\n", ioc->name, s)); +// dprintk((MYIOC_s_INFO_FMT "raw state = %08x\n", ioc->name, s)); sc = s & MPI_IOC_STATE_MASK; /* Save! */ @@ -1707,11 +2029,13 @@ /* * GetIocFacts - Send IOCFacts request to MPT adapter. * @ioc: Pointer to MPT_ADAPTER structure + * @sleepFlag: Specifies whether the process can sleep + * @reason: If recovery, only update facts. * * Returns 0 for success, non-zero for failure. */ static int -GetIocFacts(MPT_ADAPTER *ioc) +GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason) { IOCFacts_t get_facts; IOCFactsReply_t *facts; @@ -1741,14 +2065,13 @@ get_facts.Function = MPI_FUNCTION_IOC_FACTS; /* Assert: All other get_facts fields are zero! */ - dprintk((KERN_INFO MYNAM ": %s: Sending get IocFacts request\n", ioc->name)); + dprintk((MYIOC_s_INFO_FMT "Sending get IocFacts request\n", ioc->name)); /* No non-zero fields in the get_facts request are greater than * 1 byte in size, so we can just fire it off as is. */ - r = HandShakeReqAndReply(ioc, - req_sz, (u32*)&get_facts, - reply_sz, (u16*)facts, 3); + r = mpt_handshake_req_reply_wait(ioc, req_sz, (u32*)&get_facts, + reply_sz, (u16*)facts, 3 /*seconds*/, sleepFlag); if (r != 0) return r; @@ -1761,14 +2084,17 @@ */ /* Did we get a valid reply? */ if (facts->MsgLength > offsetof(IOCFactsReply_t, RequestFrameSize)/sizeof(u32)) { - /* - * If not been here, done that, save off first WhoInit value - */ - if (ioc->FirstWhoInit == WHOINIT_UNKNOWN) - ioc->FirstWhoInit = facts->WhoInit; + if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { + /* + * If not been here, done that, save off first WhoInit value + */ + if (ioc->FirstWhoInit == WHOINIT_UNKNOWN) + ioc->FirstWhoInit = facts->WhoInit; + } facts->MsgVersion = le16_to_cpu(facts->MsgVersion); facts->MsgContext = le32_to_cpu(facts->MsgContext); + facts->IOCExceptions = le16_to_cpu(facts->IOCExceptions); facts->IOCStatus = le16_to_cpu(facts->IOCStatus); facts->IOCLogInfo = le32_to_cpu(facts->IOCLogInfo); status = facts->IOCStatus & MPI_IOCSTATUS_MASK; @@ -1776,7 +2102,23 @@ facts->ReplyQueueDepth = le16_to_cpu(facts->ReplyQueueDepth); facts->RequestFrameSize = le16_to_cpu(facts->RequestFrameSize); - facts->FWVersion = le16_to_cpu(facts->FWVersion); + + /* + * FC f/w version changed between 1.1 and 1.2 + * Old: u16{Major(4),Minor(4),SubMinor(8)} + * New: u32{Major(8),Minor(8),Unit(8),Dev(8)} + */ + if (facts->MsgVersion < 0x0102) { + /* + * Handle old FC f/w style, convert to new... + */ + u16 oldv = le16_to_cpu(facts->Reserved_0101_FWVersion); + facts->FWVersion.Word = + ((oldv<<12) & 0xFF000000) | + ((oldv<<8) & 0x000FFF00); + } else + facts->FWVersion.Word = le32_to_cpu(facts->FWVersion.Word); + facts->ProductID = le16_to_cpu(facts->ProductID); facts->CurrentHostMfaHighAddr = le32_to_cpu(facts->CurrentHostMfaHighAddr); @@ -1791,52 +2133,42 @@ * Older MPI-1.00.xx struct had 13 dwords, and enlarged * to 14 in MPI-1.01.0x. */ - if (facts->MsgLength >= sizeof(IOCFactsReply_t)/sizeof(u32) && facts->MsgVersion > 0x0100) { + if (facts->MsgLength >= (offsetof(IOCFactsReply_t,FWImageSize) + 7)/4 && + facts->MsgVersion > 0x0100) { facts->FWImageSize = le32_to_cpu(facts->FWImageSize); - facts->DataImageSize = le32_to_cpu(facts->DataImageSize); } - if (facts->RequestFrameSize) { - /* - * Set values for this IOC's REQUEST queue size & depth... - */ - ioc->req_sz = MIN(MPT_REQ_SIZE, facts->RequestFrameSize * 4); - - /* - * Set values for this IOC's REPLY queue size & depth... - * - * BUG? FIX? 20000516 -nromer & sralston - * GRRR... The following did not translate well from MPI v0.09: - * ioc->reply_sz = MIN(MPT_REPLY_SIZE, facts->ReplySize * 4); - * to 0.10: - * ioc->reply_sz = MIN(MPT_REPLY_SIZE, facts->BlockSize * 4); - * Was trying to minimally optimize to smallest possible reply size - * (and greatly reduce kmalloc size). But LAN may need larger reply? - * - * So for now, just set reply size to request size. FIXME? - */ - ioc->reply_sz = ioc->req_sz; - } else { + if (!facts->RequestFrameSize) { /* Something is wrong! */ - printk(KERN_ERR MYNAM ": %s: ERROR - IOC reported invalid 0 request size!\n", + printk(MYIOC_s_ERR_FMT "IOC reported invalid 0 request size!\n", ioc->name); - ioc->req_sz = MPT_REQ_SIZE; - ioc->reply_sz = MPT_REPLY_SIZE; return -55; } - ioc->req_depth = MIN(MPT_REQ_DEPTH, facts->GlobalCredits); - ioc->reply_depth = MIN(MPT_REPLY_DEPTH, facts->ReplyQueueDepth); - dprintk((KERN_INFO MYNAM ": %s: reply_sz=%3d, reply_depth=%4d\n", + if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { + /* + * Set values for this IOC's request & reply frame sizes, + * and request & reply queue depths... + */ + ioc->req_sz = MIN(MPT_DEFAULT_FRAME_SIZE, facts->RequestFrameSize * 4); + ioc->req_depth = MIN(MPT_DEFAULT_REQ_DEPTH, facts->GlobalCredits); + ioc->reply_sz = ioc->req_sz; + ioc->reply_depth = MIN(MPT_DEFAULT_REPLY_DEPTH, facts->ReplyQueueDepth); + + /* 1030 - should we use a smaller DEFAULT_REPLY_DEPTH? + * FIX + */ + dprintk((MYIOC_s_INFO_FMT "reply_sz=%3d, reply_depth=%4d\n", ioc->name, ioc->reply_sz, ioc->reply_depth)); - dprintk((KERN_INFO MYNAM ": %s: req_sz =%3d, req_depth =%4d\n", + dprintk((MYIOC_s_INFO_FMT "req_sz =%3d, req_depth =%4d\n", ioc->name, ioc->req_sz, ioc->req_depth)); - /* Get port facts! */ - if ( (r = GetPortFacts(ioc, 0)) != 0 ) - return r; + /* Get port facts! */ + if ( (r = GetPortFacts(ioc, 0, sleepFlag)) != 0 ) + return r; + } } else { - printk(KERN_ERR MYNAM ": %s: ERROR - Invalid IOC facts reply!\n", + printk(MYIOC_s_ERR_FMT "Invalid IOC facts reply!\n", ioc->name); return -66; } @@ -1849,15 +2181,16 @@ * GetPortFacts - Send PortFacts request to MPT adapter. * @ioc: Pointer to MPT_ADAPTER structure * @portnum: Port number + * @sleepFlag: Specifies whether the process can sleep * * Returns 0 for success, non-zero for failure. */ static int -GetPortFacts(MPT_ADAPTER *ioc, int portnum) +GetPortFacts(MPT_ADAPTER *ioc, int portnum, int sleepFlag) { PortFacts_t get_pfacts; PortFactsReply_t *pfacts; - int i; + int ii; int req_sz; int reply_sz; @@ -1883,16 +2216,16 @@ get_pfacts.PortNumber = portnum; /* Assert: All other get_pfacts fields are zero! */ - dprintk((KERN_INFO MYNAM ": %s: Sending get PortFacts(%d) request\n", + dprintk((MYIOC_s_INFO_FMT "Sending get PortFacts(%d) request\n", ioc->name, portnum)); /* No non-zero fields in the get_pfacts request are greater than * 1 byte in size, so we can just fire it off as is. */ - i = HandShakeReqAndReply(ioc, req_sz, (u32*)&get_pfacts, - reply_sz, (u16*)pfacts, 3); - if (i != 0) - return i; + ii = mpt_handshake_req_reply_wait(ioc, req_sz, (u32*)&get_pfacts, + reply_sz, (u16*)pfacts, 3 /*seconds*/, sleepFlag); + if (ii != 0) + return ii; /* Did we get a valid reply? */ @@ -1914,13 +2247,14 @@ /* * SendIocInit - Send IOCInit request to MPT adapter. * @ioc: Pointer to MPT_ADAPTER structure + * @sleepFlag: Specifies whether the process can sleep * * Send IOCInit followed by PortEnable to bring IOC to OPERATIONAL state. * * Returns 0 for success, non-zero for failure. */ static int -SendIocInit(MPT_ADAPTER *ioc) +SendIocInit(MPT_ADAPTER *ioc, int sleepFlag) { IOCInit_t ioc_init; MPIDefaultReply_t init_reply; @@ -1937,20 +2271,35 @@ ioc_init.Function = MPI_FUNCTION_IOC_INIT; /* ioc_init.Flags = 0; */ - /*ioc_init.MaxDevices = 16;*/ - ioc_init.MaxDevices = 255; -/* ioc_init.MaxBuses = 16; */ - ioc_init.MaxBuses = 1; + if ((int)ioc->chip_type <= (int)FC929) { + ioc_init.MaxDevices = MPT_MAX_FC_DEVICES; + } + else { + ioc_init.MaxDevices = MPT_MAX_SCSI_DEVICES; + } + ioc_init.MaxBuses = MPT_MAX_BUS; /* ioc_init.MsgFlags = 0; */ /* ioc_init.MsgContext = cpu_to_le32(0x00000000); */ ioc_init.ReplyFrameSize = cpu_to_le16(ioc->reply_sz); /* in BYTES */ - ioc_init.HostMfaHighAddr = cpu_to_le32(0); /* Say we 32-bit! for now */ - dprintk((KERN_INFO MYNAM ": %s: Sending IOCInit (req @ %p)\n", ioc->name, &ioc_init)); +#ifdef __ia64__ + /* Save the upper 32-bits of the request + * (reply) and sense buffers. + */ + ioc_init.HostMfaHighAddr = cpu_to_le32((u32)(ioc->req_frames_dma >> 32)); + ioc_init.SenseBufferHighAddr = cpu_to_le32((u32)(ioc->sense_buf_pool_dma >> 32)); +#else + /* Force 32-bit addressing */ + ioc_init.HostMfaHighAddr = cpu_to_le32(0); + ioc_init.SenseBufferHighAddr = cpu_to_le32(0); +#endif - r = HandShakeReqAndReply(ioc, sizeof(IOCInit_t), (u32*)&ioc_init, - sizeof(MPIDefaultReply_t), (u16*)&init_reply, 10); + dprintk((MYIOC_s_INFO_FMT "Sending IOCInit (req @ %p)\n", + ioc->name, &ioc_init)); + + r = mpt_handshake_req_reply_wait(ioc, sizeof(IOCInit_t), (u32*)&ioc_init, + sizeof(MPIDefaultReply_t), (u16*)&init_reply, 10 /*seconds*/, sleepFlag); if (r != 0) return r; @@ -1958,7 +2307,7 @@ * since we don't even look at it's contents. */ - if ((r = SendPortEnable(ioc, 0)) != 0) + if ((r = SendPortEnable(ioc, 0, sleepFlag)) != 0) return r; /* YIKES! SUPER IMPORTANT!!! @@ -1967,21 +2316,27 @@ */ count = 0; cntdn = HZ * 60; /* chg'd from 30 to 60 seconds */ - state = GetIocState(ioc, 1); + if (sleepFlag != CAN_SLEEP) + cntdn *= 10; /* scale for 1msec delays */ + state = mpt_GetIocState(ioc, 1); while (state != MPI_IOC_STATE_OPERATIONAL && --cntdn) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(1); + if (sleepFlag == CAN_SLEEP) { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(1); + } else { + mdelay(1); + } if (!cntdn) { - printk(KERN_ERR MYNAM ": %s: ERROR - Wait IOC_OP state timeout(%d)!\n", + printk(MYIOC_s_ERR_FMT "Wait IOC_OP state timeout(%d)!\n", ioc->name, (count+5)/HZ); return -9; } - state = GetIocState(ioc, 1); + state = mpt_GetIocState(ioc, 1); count++; } - dhsprintk((KERN_INFO MYNAM ": %s: INFO - Wait IOC_OPERATIONAL state (cnt=%d)\n", + dhsprintk((MYIOC_s_INFO_FMT "INFO - Wait IOC_OPERATIONAL state (cnt=%d)\n", ioc->name, count)); return r; @@ -1992,17 +2347,18 @@ * SendPortEnable - Send PortEnable request to MPT adapter port. * @ioc: Pointer to MPT_ADAPTER structure * @portnum: Port number to enable + * @sleepFlag: Specifies whether the process can sleep * * Send PortEnable to bring IOC to OPERATIONAL state. * * Returns 0 for success, non-zero for failure. */ static int -SendPortEnable(MPT_ADAPTER *ioc, int portnum) +SendPortEnable(MPT_ADAPTER *ioc, int portnum, int sleepFlag) { PortEnable_t port_enable; MPIDefaultReply_t reply_buf; - int i; + int ii; int req_sz; int reply_sz; @@ -2019,13 +2375,21 @@ /* port_enable.MsgFlags = 0; */ /* port_enable.MsgContext = 0; */ - dprintk((KERN_INFO MYNAM ": %s: Sending Port(%d)Enable (req @ %p)\n", + dprintk((MYIOC_s_INFO_FMT "Sending Port(%d)Enable (req @ %p)\n", ioc->name, portnum, &port_enable)); - i = HandShakeReqAndReply(ioc, req_sz, (u32*)&port_enable, - reply_sz, (u16*)&reply_buf, 65); - if (i != 0) - return i; + /* RAID FW may take a long time to enable + */ + if ((int)ioc->chip_type <= (int)FC929) { + ii = mpt_handshake_req_reply_wait(ioc, req_sz, (u32*)&port_enable, + reply_sz, (u16*)&reply_buf, 65 /*seconds*/, sleepFlag); + } else { + ii = mpt_handshake_req_reply_wait(ioc, req_sz, (u32*)&port_enable, + reply_sz, (u16*)&reply_buf, 300 /*seconds*/, sleepFlag); + } + + if (ii != 0) + return ii; /* We do not even look at the reply, so we need not * swap the multi-byte fields. @@ -2036,19 +2400,341 @@ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* + * mpt_do_upload - Construct and Send FWUpload request to MPT adapter port. + * @ioc: Pointer to MPT_ADAPTER structure + * @sleepFlag: Specifies whether the process can sleep + * + * Returns 0 for success, >0 for handshake failure + * <0 for fw upload failure. + * + * Remark: If bound IOC and a successful FWUpload was performed + * on the bound IOC, the second image is discarded + * and memory is free'd. Both channels must upload to prevent + * IOC from running in degraded mode. + */ +static int +mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag) +{ + u8 request[sizeof(FWUpload_t) + 24]; + u8 reply[sizeof(FWUploadReply_t)]; + FWUpload_t *prequest; + FWUploadReply_t *preply; + FWUploadTCSGE_t *ptcsge = NULL; + MptSge_t *psge; + u8 *mem; + dma_addr_t dma_addr; + int sgeoffset; + int i, sz, req_sz, reply_sz; + int cmdStatus, freeMem = 0; + + /* If the image size is 0 or if the pointer is + * not NULL (error), we are done. + */ + if (((sz = ioc->facts.FWImageSize) == 0) || ioc->FWImage) + return 0; + + /* Allocate memory + */ + mem = pci_alloc_consistent(ioc->pcidev, sz, &ioc->FWImage_dma); + if (mem == NULL) + return -1; + + memset(mem, 0, sz); + ioc->alloc_total += sz; + ioc->FWImage = mem; + dprintk((KERN_INFO MYNAM ": FW Image @ %p[%p], sz=%d bytes\n", + mem, (void *)(ulong)ioc->FWImage_dma, sz)); + + dma_addr = ioc->FWImage_dma; + + prequest = (FWUpload_t *)&request; + preply = (FWUploadReply_t *)&reply; + + /* Destination... */ + req_sz = sizeof(FWUpload_t) - sizeof(SGE_MPI_UNION) + + sizeof(FWUploadTCSGE_t) + sizeof(MptSge_t); + memset(prequest, 0, req_sz); + + reply_sz = sizeof(reply); + memset(preply, 0, reply_sz); + + prequest->ImageType = MPI_FW_UPLOAD_ITYPE_FW_IOC_MEM; + prequest->Function = MPI_FUNCTION_FW_UPLOAD; + prequest->MsgContext = 0; /* anything */ + + ptcsge = (FWUploadTCSGE_t *) &prequest->SGL; + ptcsge->Reserved = 0; + ptcsge->ContextSize = 0; + ptcsge->DetailsLength = 12; + ptcsge->Flags = MPI_SGE_FLAGS_TRANSACTION_ELEMENT; + ptcsge->Reserved1 = 0; + ptcsge->ImageOffset = 0; + ptcsge->ImageSize = cpu_to_le32(sz); + + sgeoffset = sizeof(FWUpload_t) - sizeof(SGE_MPI_UNION) + sizeof(FWUploadTCSGE_t); + psge = (MptSge_t *) &request[sgeoffset]; + psge->FlagsLength = cpu_to_le32(MPT_SGE_FLAGS_SSIMPLE_READ | (u32) sz); + + cpu_to_leXX(dma_addr, psge->Address); + + dprintk((MYIOC_s_INFO_FMT "Sending FW Upload (req @ %p)\n", + ioc->name, prequest)); + + i = mpt_handshake_req_reply_wait(ioc, req_sz, (u32*)prequest, + reply_sz, (u16*)preply, 65 /*seconds*/, sleepFlag); + + cmdStatus = -EFAULT; + if (i == 0) { + /* Handshake transfer was complete and successful. + * Check the Reply Frame. + */ + int status, transfer_sz; + status = le16_to_cpu(preply->IOCStatus); + if (status == MPI_IOCSTATUS_SUCCESS) { + transfer_sz = le32_to_cpu(preply->ActualImageSize); + if (transfer_sz == sz) + cmdStatus = 0; + } + } + dprintk((MYIOC_s_INFO_FMT ": do_upload status %d \n", + ioc->name, cmdStatus)); + + /* Check to see if we have a copy of this image in + * host memory already. + */ + if (cmdStatus == 0) { + if (ioc->alt_ioc && ioc->alt_ioc->FWImage) + freeMem = 1; + } + + /* We already have a copy of this image or + * we had some type of an error - either the handshake + * failed (i != 0) or the command did not complete successfully. + */ + if (cmdStatus || freeMem) { + dprintk((MYIOC_s_INFO_FMT ": do_upload freeing %s image \n", + ioc->name, cmdStatus ? "incomplete" : "duplicate")); + + pci_free_consistent(ioc->pcidev, sz, + ioc->FWImage, ioc->FWImage_dma); + ioc->FWImage = NULL; + ioc->alloc_total -= sz; + } + + return cmdStatus; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mpt_downloadboot - DownloadBoot code + * @ioc: Pointer to MPT_ADAPTER structure + * @flag: Specify which part of IOC memory is to be uploaded. + * @sleepFlag: Specifies whether the process can sleep + * + * FwDownloadBoot requires Programmed IO access. + * + * Returns 0 for success + * -1 FW Image size is 0 + * -2 No valid FWImage Pointer + * <0 for fw upload failure. + */ +static int +mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) +{ + MpiFwHeader_t *FwHdr = NULL; + MpiExtImageHeader_t *ExtHdr; + int fw_sz; + u32 diag0val; +#ifdef MPT_DEBUG + u32 diag1val = 0; +#endif + int count = 0; + u32 *ptru32 = NULL; + u32 diagRwData; + u32 nextImage; + + dprintk((MYIOC_s_INFO_FMT "DbGb0: downloadboot entered.\n", + ioc->name)); +#ifdef MPT_DEBUG + diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); + if (ioc->alt_ioc) + diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic); + dprintk((MYIOC_s_INFO_FMT "DbGb1: diag0=%08x, diag1=%08x\n", + ioc->name, diag0val, diag1val)); +#endif + + dprintk((MYIOC_s_INFO_FMT "fw size 0x%x, ioc FW Ptr %p\n", + ioc->name, ioc->facts.FWImageSize, ioc->FWImage)); + if (ioc->alt_ioc) + dprintk((MYIOC_s_INFO_FMT "alt ioc FW Ptr %p\n", + ioc->name, ioc->alt_ioc->FWImage)); + + /* Get dma_addr and data transfer size. + */ + if ((fw_sz = ioc->facts.FWImageSize) == 0) + return -1; + + /* Get the DMA from ioc or ioc->alt_ioc */ + if (ioc->FWImage) + FwHdr = (MpiFwHeader_t *)ioc->FWImage; + else if (ioc->alt_ioc && ioc->alt_ioc->FWImage) + FwHdr = (MpiFwHeader_t *)ioc->alt_ioc->FWImage; + + dprintk((MYIOC_s_INFO_FMT "DbGb2: FW Image @ %p\n", + ioc->name, FwHdr)); + + if (!FwHdr) + return -2; + + /* Write magic sequence to WriteSequence register + * until enter diagnostic mode + */ + diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); + while ((diag0val & MPI_DIAG_DRWE) == 0) { + CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_1ST_KEY_VALUE); + CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE); + CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_3RD_KEY_VALUE); + CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_4TH_KEY_VALUE); + CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_5TH_KEY_VALUE); + + /* wait 100 msec */ + if (sleepFlag == CAN_SLEEP) { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(100 * HZ / 1000); + } else { + mdelay (100); + } + + count++; + if (count > 20) { + printk(MYIOC_s_ERR_FMT "Enable Diagnostic mode FAILED! (%02xh)\n", + ioc->name, diag0val); + return -EFAULT; + + } + + diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); +#ifdef MPT_DEBUG + if (ioc->alt_ioc) + diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic); + dprintk((MYIOC_s_INFO_FMT "DbGb3: diag0=%08x, diag1=%08x\n", + ioc->name, diag0val, diag1val)); +#endif + dprintk((MYIOC_s_INFO_FMT "Wrote magic DiagWriteEn sequence (%x)\n", + ioc->name, diag0val)); + } + + /* Set the DiagRwEn and Disable ARM bits */ + diag0val |= (MPI_DIAG_RW_ENABLE | MPI_DIAG_DISABLE_ARM); + CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val); + +#ifdef MPT_DEBUG + if (ioc->alt_ioc) + diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic); + dprintk((MYIOC_s_INFO_FMT "DbGb3: diag0=%08x, diag1=%08x\n", + ioc->name, diag0val, diag1val)); +#endif + + /* Write the LoadStartAddress to the DiagRw Address Register + * using Programmed IO + */ + + CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, FwHdr->LoadStartAddress); + dprintk((MYIOC_s_INFO_FMT "LoadStart addr written 0x%x \n", + ioc->name, FwHdr->LoadStartAddress)); + + nextImage = FwHdr->NextImageHeaderOffset; + + /* round up count to a 32bit alignment */ + ptru32 = (u32 *) FwHdr; + count = (FwHdr->ImageSize + 3)/4; + + dprintk((MYIOC_s_INFO_FMT "Write FW Image: 0x%x u32's @ %p\n", + ioc->name, count, ptru32)); + while (count-- ) { + CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, *ptru32); + ptru32++; + } + + dprintk((MYIOC_s_INFO_FMT "FW Image done! \n", ioc->name)); + + while (nextImage) { + + /* Set the pointer to the extended image + */ + ExtHdr = (MpiExtImageHeader_t *) ((char *) FwHdr + nextImage); + + CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, ExtHdr->LoadStartAddress); + + count = (ExtHdr->ImageSize + 3 )/4; + + ptru32 = (u32 *) ExtHdr; + dprintk((MYIOC_s_INFO_FMT "Write Ext Image: 0x%x u32's @ %p\n", + ioc->name, count, ptru32)); + while (count-- ) { + CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, *ptru32); + ptru32++; + } + nextImage = ExtHdr->NextImageHeaderOffset; + } + + + /* Write the IopResetVectorRegAddr */ + dprintk((MYIOC_s_INFO_FMT "Write IopResetVector Addr! \n", ioc->name)); + CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, FwHdr->IopResetRegAddr); + + /* Write the IopResetVectorValue */ + dprintk((MYIOC_s_INFO_FMT "Write IopResetVector Value! \n", ioc->name)); + CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, FwHdr->IopResetVectorValue); + + /* Clear the internal flash bad bit - autoincrementing register, + * so must do two writes. + */ + CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, 0x3F000000); + diagRwData = CHIPREG_PIO_READ32(&ioc->pio_chip->DiagRwData); + diagRwData |= 0x4000000; + CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, 0x3F000000); + CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, diagRwData); + + /* clear the RW enable and DISARM bits */ + diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); + diag0val &= ~(MPI_DIAG_DISABLE_ARM | MPI_DIAG_RW_ENABLE | MPI_DIAG_FLASH_BAD_SIG); + CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val); + + /* Write 0xFF to reset the sequencer */ + CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF); + + return 0; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* * KickStart - Perform hard reset of MPT adapter. * @ioc: Pointer to MPT_ADAPTER structure * @force: Force hard reset + * @sleepFlag: Specifies whether the process can sleep * * This routine places MPT adapter in diagnostic mode via the * WriteSequence register, and then performs a hard reset of adapter * via the Diagnostic register. * - * Returns 0 for soft reset success, 1 for hard reset success, - * else a negative value for failure. + * Inputs: sleepflag - CAN_SLEEP (non-interrupt thread) + * or NO_SLEEP (interrupt thread, use mdelay) + * force - 1 if doorbell active, board fault state + * board operational, IOC_RECOVERY or + * IOC_BRINGUP and there is an alt_ioc. + * 0 else + * + * Returns: + * 1 - hard reset, READY + * 0 - no reset due to History bit, READY + * -1 - no reset due to History bit but not READY + * OR reset but failed to come READY + * -2 - no reset, could not enter DIAG mode + * -3 - reset but bad FW bit */ static int -KickStart(MPT_ADAPTER *ioc, int force) +KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag) { int hard_reset_done = 0; u32 ioc_state; @@ -2056,183 +2742,295 @@ dprintk((KERN_WARNING MYNAM ": KickStarting %s!\n", ioc->name)); - hard_reset_done = mpt_fc9x9_reset(ioc, force); -#if 0 - if (ioc->chip_type == FC909 || ioc->chip-type == FC919) { - hard_reset_done = mpt_fc9x9_reset(ioc, force); - } else if (ioc->chip_type == FC929) { - unsigned long delta; - - delta = jiffies - ioc->last_kickstart; - dprintk((KERN_INFO MYNAM ": %s: 929 KickStart, last=%ld, delta = %ld\n", - ioc->name, ioc->last_kickstart, delta)); - if ((ioc->sod_reset == 0) || (delta >= 10*HZ)) - hard_reset_done = mpt_fc9x9_reset(ioc, ignore); - else { - dprintk((KERN_INFO MYNAM ": %s: Skipping KickStart (delta=%ld)!\n", - ioc->name, delta)); - return 0; - } - /* TODO! Add C1030! - } else if (ioc->chip_type == C1030) { - */ - } else { - printk(KERN_ERR MYNAM ": %s: ERROR - Bad chip_type (0x%x)\n", - ioc->name, ioc->chip_type); - return -5; - } -#endif - + hard_reset_done = mpt_diag_reset(ioc, force, sleepFlag); if (hard_reset_done < 0) return hard_reset_done; - dprintk((KERN_INFO MYNAM ": %s: Diagnostic reset successful\n", + dprintk((MYIOC_s_INFO_FMT "Diagnostic reset successful!\n", ioc->name)); for (cnt=0; cntname, cnt)); return hard_reset_done; } - /* udelay(10000) ? */ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(1); + if (sleepFlag == CAN_SLEEP) { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(1); + } else { + mdelay (10); + } } - printk(KERN_ERR MYNAM ": %s: ERROR - Failed to come READY after reset!\n", + printk(MYIOC_s_ERR_FMT "Failed to come READY after reset!\n", ioc->name); return -1; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* - * mpt_fc9x9_reset - Perform hard reset of FC9x9 adapter. + * mpt_diag_reset - Perform hard reset of the adapter. * @ioc: Pointer to MPT_ADAPTER structure - * - * This routine places FC9x9 adapter in diagnostic mode via the - * WriteSequence register, and then performs a hard reset of adapter - * via the Diagnostic register. - * - * Returns 0 for success, non-zero for failure. + * @ignore: Set if to honor and clear to ignore + * the reset history bit + * @sleepflag: CAN_SLEEP if called in a non-interrupt thread, + * else set to NO_SLEEP (use mdelay instead) + * + * This routine places the adapter in diagnostic mode via the + * WriteSequence register and then performs a hard reset of adapter + * via the Diagnostic register. Adapter should be in ready state + * upon successful completion. + * + * Returns: 1 hard reset successful + * 0 no reset performed because reset history bit set + * -2 enabling diagnostic mode failed + * -3 diagnostic reset failed */ static int -mpt_fc9x9_reset(MPT_ADAPTER *ioc, int ignore) +mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) { u32 diag0val; + u32 doorbell; int hard_reset_done = 0; + int count = 0; +#ifdef MPT_DEBUG + u32 diag1val = 0; +#endif - /* Use "Diagnostic reset" method! (only thing available!) */ + /* Clear any existing interrupts */ + CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); + /* Use "Diagnostic reset" method! (only thing available!) */ diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); + #ifdef MPT_DEBUG -{ - u32 diag1val = 0; if (ioc->alt_ioc) diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic); - dprintk((KERN_INFO MYNAM ": %s: DBG1: diag0=%08x, diag1=%08x\n", + dprintk((MYIOC_s_INFO_FMT "DbG1: diag0=%08x, diag1=%08x\n", ioc->name, diag0val, diag1val)); -} #endif - if (diag0val & MPI_DIAG_DRWE) { - dprintk((KERN_INFO MYNAM ": %s: DiagWriteEn bit already set\n", - ioc->name)); - } else { - /* Write magic sequence to WriteSequence register */ - CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_1ST_KEY_VALUE); - CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE); - CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_3RD_KEY_VALUE); - CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_4TH_KEY_VALUE); - CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_5TH_KEY_VALUE); - dprintk((KERN_INFO MYNAM ": %s: Wrote magic DiagWriteEn sequence [spot#1]\n", - ioc->name)); - } - diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); + /* Do the reset if we are told to ignore the reset history + * or if the reset history is 0 + */ + if (ignore || !(diag0val & MPI_DIAG_RESET_HISTORY)) { + while ((diag0val & MPI_DIAG_DRWE) == 0) { + /* Write magic sequence to WriteSequence register + * Loop until in diagnostic mode + */ + CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_1ST_KEY_VALUE); + CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE); + CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_3RD_KEY_VALUE); + CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_4TH_KEY_VALUE); + CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_5TH_KEY_VALUE); + + /* wait 100 msec */ + if (sleepFlag == CAN_SLEEP) { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(100 * HZ / 1000); + } else { + mdelay (100); + } + + count++; + if (count > 20) { + printk(MYIOC_s_ERR_FMT "Enable Diagnostic mode FAILED! (%02xh)\n", + ioc->name, diag0val); + return -2; + + } + + diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); + + dprintk((MYIOC_s_INFO_FMT "Wrote magic DiagWriteEn sequence (%x)\n", + ioc->name, diag0val)); + } + #ifdef MPT_DEBUG -{ - u32 diag1val = 0; - if (ioc->alt_ioc) - diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic); - dprintk((KERN_INFO MYNAM ": %s: DbG2: diag0=%08x, diag1=%08x\n", - ioc->name, diag0val, diag1val)); -} + if (ioc->alt_ioc) + diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic); + dprintk((MYIOC_s_INFO_FMT "DbG2: diag0=%08x, diag1=%08x\n", + ioc->name, diag0val, diag1val)); #endif - if (!ignore && (diag0val & MPI_DIAG_RESET_HISTORY)) { - dprintk((KERN_INFO MYNAM ": %s: Skipping due to ResetHistory bit set!\n", - ioc->name)); - } else { + /* Write the PreventIocBoot bit */ + if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) { + diag0val |= MPI_DIAG_PREVENT_IOC_BOOT; + CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val); + } + + /* + * Disable the ARM (Bug fix) + * + */ + CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val | MPI_DIAG_DISABLE_ARM); + mdelay (1); + /* * Now hit the reset bit in the Diagnostic register - * (THE BIG HAMMER!) + * (THE BIG HAMMER!) (Clears DRWE bit). */ - CHIPREG_WRITE32(&ioc->chip->Diagnostic, MPI_DIAG_RESET_ADAPTER); + CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val | MPI_DIAG_RESET_ADAPTER); hard_reset_done = 1; - dprintk((KERN_INFO MYNAM ": %s: Diagnostic reset performed\n", + dprintk((MYIOC_s_INFO_FMT "Diagnostic reset performed\n", ioc->name)); - /* want udelay(100) */ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(1); + /* + * Call each currently registered protocol IOC reset handler + * with pre-reset indication. + * NOTE: If we're doing _IOC_BRINGUP, there can be no + * MptResetHandlers[] registered yet. + */ + { + int ii; + int r = 0; + + for (ii=MPT_MAX_PROTOCOL_DRIVERS-1; ii; ii--) { + if (MptResetHandlers[ii]) { + dprintk((MYIOC_s_INFO_FMT "Calling IOC pre_reset handler #%d\n", + ioc->name, ii)); + r += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_PRE_RESET); + if (ioc->alt_ioc) { + dprintk((MYIOC_s_INFO_FMT "Calling alt-%s pre_reset handler #%d\n", + ioc->name, ioc->alt_ioc->name, ii)); + r += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_PRE_RESET); + } + } + } + /* FIXME? Examine results here? */ + } + + if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) { + /* If the DownloadBoot operation fails, the + * IOC will be left unusable. This is a fatal error + * case. _diag_reset will return < 0 + */ + for (count = 0; count < 30; count ++) { + diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); +#ifdef MPT_DEBUG + if (ioc->alt_ioc) + diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic); + dprintk((MYIOC_s_INFO_FMT + "DbG2b: diag0=%08x, diag1=%08x\n", + ioc->name, diag0val, diag1val)); +#endif + if (!(diag0val & MPI_DIAG_RESET_ADAPTER)) { + break; + } + + /* wait 1 sec */ + if (sleepFlag == CAN_SLEEP) { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ); + } else { + mdelay (1000); + } + } + if ((count = mpt_downloadboot(ioc, sleepFlag)) < 0) { + printk(KERN_WARNING MYNAM + ": firmware downloadboot failure (%d)!\n", count); + } + + } else { + /* Wait for FW to reload and for board + * to go to the READY state. + * Maximum wait is 30 seconds. + * If fail, no error will check again + * with calling program. + */ + for (count = 0; count < 30; count ++) { + doorbell = CHIPREG_READ32(&ioc->chip->Doorbell); + doorbell &= MPI_IOC_STATE_MASK; + + if (doorbell == MPI_IOC_STATE_READY) { + break; + } + + /* wait 1 sec */ + if (sleepFlag == CAN_SLEEP) { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ); + } else { + mdelay (1000); + } + } + } + } - /* Write magic sequence to WriteSequence register */ + diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); +#ifdef MPT_DEBUG + if (ioc->alt_ioc) + diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic); + dprintk((MYIOC_s_INFO_FMT "DbG3: diag0=%08x, diag1=%08x\n", + ioc->name, diag0val, diag1val)); +#endif + + /* Clear RESET_HISTORY bit! Place board in the + * diagnostic mode to update the diag register. + */ + diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); + count = 0; + while ((diag0val & MPI_DIAG_DRWE) == 0) { + /* Write magic sequence to WriteSequence register + * Loop until in diagnostic mode + */ CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_1ST_KEY_VALUE); CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE); CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_3RD_KEY_VALUE); CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_4TH_KEY_VALUE); CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_5TH_KEY_VALUE); - dprintk((KERN_INFO MYNAM ": %s: Wrote magic DiagWriteEn sequence [spot#2]\n", - ioc->name)); - } - /* Clear RESET_HISTORY bit! */ - CHIPREG_WRITE32(&ioc->chip->Diagnostic, 0x0); + /* wait 100 msec */ + if (sleepFlag == CAN_SLEEP) { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(100 * HZ / 1000); + } else { + mdelay (100); + } + count++; + if (count > 20) { + printk(MYIOC_s_ERR_FMT "Enable Diagnostic mode FAILED! (%02xh)\n", + ioc->name, diag0val); + break; + } + diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); + } + diag0val &= ~MPI_DIAG_RESET_HISTORY; + CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val); diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); -#ifdef MPT_DEBUG -{ - u32 diag1val = 0; - if (ioc->alt_ioc) - diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic); - dprintk((KERN_INFO MYNAM ": %s: DbG3: diag0=%08x, diag1=%08x\n", - ioc->name, diag0val, diag1val)); -} -#endif if (diag0val & MPI_DIAG_RESET_HISTORY) { - printk(KERN_WARNING MYNAM ": %s: WARNING - ResetHistory bit failed to clear!\n", + printk(MYIOC_s_WARN_FMT "ResetHistory bit failed to clear!\n", ioc->name); } + /* Disable Diagnostic Mode + */ + CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFFFFFFFF); + + /* Check FW reload status flags. + */ diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); + if (diag0val & (MPI_DIAG_FLASH_BAD_SIG | MPI_DIAG_RESET_ADAPTER | MPI_DIAG_DISABLE_ARM)) { + printk(MYIOC_s_ERR_FMT "Diagnostic reset FAILED! (%02xh)\n", + ioc->name, diag0val); + return -3; + } + #ifdef MPT_DEBUG -{ - u32 diag1val = 0; if (ioc->alt_ioc) diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic); - dprintk((KERN_INFO MYNAM ": %s: DbG4: diag0=%08x, diag1=%08x\n", + dprintk((MYIOC_s_INFO_FMT "DbG4: diag0=%08x, diag1=%08x\n", ioc->name, diag0val, diag1val)); -} #endif - if (diag0val & (MPI_DIAG_FLASH_BAD_SIG | MPI_DIAG_RESET_ADAPTER | MPI_DIAG_DISABLE_ARM)) { - printk(KERN_ERR MYNAM ": %s: ERROR - Diagnostic reset FAILED! (%02xh)\n", - ioc->name, diag0val); - return -3; - } /* * Reset flag that says we've enabled event notification */ ioc->facts.EventState = 0; - /* NEW! 20010220 -sralston - * Try to avoid redundant resets of the 929. - */ - ioc->sod_reset++; - ioc->last_kickstart = jiffies; - if (ioc->alt_ioc) { - ioc->alt_ioc->sod_reset = ioc->sod_reset; - ioc->alt_ioc->last_kickstart = ioc->last_kickstart; - } + if (ioc->alt_ioc) + ioc->alt_ioc->facts.EventState = 0; return hard_reset_done; } @@ -2249,16 +3047,45 @@ * Returns 0 for success, non-zero for failure. */ static int -SendIocReset(MPT_ADAPTER *ioc, u8 reset_type) +SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag) { int r; + u32 state; + int cntdn, count; dprintk((KERN_WARNING MYNAM ": %s: Sending IOC reset(0x%02x)!\n", ioc->name, reset_type)); CHIPREG_WRITE32(&ioc->chip->Doorbell, reset_type<name, (count+5)/HZ); + return -ETIME; + } + + if (sleepFlag == CAN_SLEEP) { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(1); + } else { + mdelay (1); /* 1 msec delay */ + } + } + /* TODO! * Cleanup all event stuff for this IOC; re-issue EventNotification * request if needed. @@ -2275,7 +3102,8 @@ * @ioc: Pointer to MPT_ADAPTER structure * * This routine allocates memory for the MPT reply and request frame - * pools, and primes the IOC reply FIFO with reply frames. + * pools (if necessary), and primes the IOC reply FIFO with + * reply frames. * * Returns 0 for success, non-zero for failure. */ @@ -2284,6 +3112,7 @@ { MPT_FRAME_HDR *mf; unsigned long b; + unsigned long flags; dma_addr_t aligned_mem_dma; u8 *mem, *aligned_mem; int i, sz; @@ -2299,8 +3128,8 @@ memset(mem, 0, sz); ioc->alloc_total += sz; ioc->reply_alloc = mem; - dprintk((KERN_INFO MYNAM ": %s.reply_alloc @ %p[%08x], sz=%d bytes\n", - ioc->name, mem, ioc->reply_alloc_dma, sz)); + dprintk((KERN_INFO MYNAM ": %s.reply_alloc @ %p[%p], sz=%d bytes\n", + ioc->name, mem, (void *)(ulong)ioc->reply_alloc_dma, sz)); b = (unsigned long) mem; b = (b + (0x80UL - 1UL)) & ~(0x80UL - 1UL); /* round up to 128-byte boundary */ @@ -2308,15 +3137,20 @@ ioc->reply_frames = (MPT_FRAME_HDR *) aligned_mem; ioc->reply_frames_dma = (ioc->reply_alloc_dma + (aligned_mem - mem)); - aligned_mem_dma = ioc->reply_frames_dma; - dprintk((KERN_INFO MYNAM ": %s.reply_frames @ %p[%08x]\n", - ioc->name, aligned_mem, aligned_mem_dma)); - - for (i = 0; i < ioc->reply_depth; i++) { - /* Write each address to the IOC! */ - CHIPREG_WRITE32(&ioc->chip->ReplyFifo, aligned_mem_dma); - aligned_mem_dma += ioc->reply_sz; - } + + ioc->reply_frames_low_dma = (u32) (ioc->reply_frames_dma & 0xFFFFFFFF); + } + + /* Post Reply frames to FIFO + */ + aligned_mem_dma = ioc->reply_frames_dma; + dprintk((KERN_INFO MYNAM ": %s.reply_frames @ %p[%p]\n", + ioc->name, ioc->reply_frames, (void *)(ulong)aligned_mem_dma)); + + for (i = 0; i < ioc->reply_depth; i++) { + /* Write each address to the IOC! */ + CHIPREG_WRITE32(&ioc->chip->ReplyFifo, aligned_mem_dma); + aligned_mem_dma += ioc->reply_sz; } @@ -2336,8 +3170,8 @@ memset(mem, 0, sz); ioc->alloc_total += sz; ioc->req_alloc = mem; - dprintk((KERN_INFO MYNAM ": %s.req_alloc @ %p[%08x], sz=%d bytes\n", - ioc->name, mem, ioc->req_alloc_dma, sz)); + dprintk((KERN_INFO MYNAM ": %s.req_alloc @ %p[%p], sz=%d bytes\n", + ioc->name, mem, (void *)(ulong)ioc->req_alloc_dma, sz)); b = (unsigned long) mem; b = (b + (0x80UL - 1UL)) & ~(0x80UL - 1UL); /* round up to 128-byte boundary */ @@ -2345,18 +3179,18 @@ ioc->req_frames = (MPT_FRAME_HDR *) aligned_mem; ioc->req_frames_dma = (ioc->req_alloc_dma + (aligned_mem - mem)); - aligned_mem_dma = ioc->req_frames_dma; - dprintk((KERN_INFO MYNAM ": %s.req_frames @ %p[%08x]\n", - ioc->name, aligned_mem, aligned_mem_dma)); + ioc->req_frames_low_dma = (u32) (ioc->req_frames_dma & 0xFFFFFFFF); - for (i = 0; i < ioc->req_depth; i++) { - mf = (MPT_FRAME_HDR *) aligned_mem; - - /* Queue REQUESTs *internally*! */ - Q_ADD_TAIL(&ioc->FreeQ.head, &mf->u.frame.linkage, MPT_FRAME_HDR); - aligned_mem += ioc->req_sz; +#ifdef __ia64__ + /* Check: upper 32-bits of the request and reply frame + * physical addresses must be the same. + * ia64 check only + */ + if ((ioc->req_frames_dma >> 32) != (ioc->reply_frames_dma >> 32)){ + goto out_fail; } +#endif #if defined(CONFIG_MTRR) && 0 /* @@ -2367,20 +3201,38 @@ ioc->mtrr_reg = mtrr_add(ioc->req_alloc_dma, sz, MTRR_TYPE_WRCOMB, 1); - dprintk((KERN_INFO MYNAM ": %s: MTRR region registered (base:size=%08x:%x)\n", - ioc->name, ioc->req_alloc_dma, - sz )); + dprintk((MYIOC_s_INFO_FMT "MTRR region registered (base:size=%08x:%x)\n", + ioc->name, ioc->req_alloc_dma, sz)); #endif + } + + /* Initialize Request frames linked list + */ + aligned_mem_dma = ioc->req_frames_dma; + aligned_mem = (u8 *) ioc->req_frames; + dprintk((KERN_INFO MYNAM ": %s.req_frames @ %p[%p]\n", + ioc->name, aligned_mem, (void *)(ulong)aligned_mem_dma)); + spin_lock_irqsave(&ioc->FreeQlock, flags); + Q_INIT(&ioc->FreeQ, MPT_FRAME_HDR); + for (i = 0; i < ioc->req_depth; i++) { + mf = (MPT_FRAME_HDR *) aligned_mem; + + /* Queue REQUESTs *internally*! */ + Q_ADD_TAIL(&ioc->FreeQ.head, &mf->u.frame.linkage, MPT_FRAME_HDR); + aligned_mem += ioc->req_sz; } + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + if (ioc->sense_buf_pool == NULL) { - sz = (ioc->req_depth * 256); + sz = (ioc->req_depth * MPT_SENSE_BUFFER_ALLOC); ioc->sense_buf_pool = pci_alloc_consistent(ioc->pcidev, sz, &ioc->sense_buf_pool_dma); if (ioc->sense_buf_pool == NULL) goto out_fail; + ioc->sense_buf_low_dma = (u32) (ioc->sense_buf_pool_dma & 0xFFFFFFFF); ioc->alloc_total += sz; } @@ -2408,7 +3260,7 @@ #if defined(CONFIG_MTRR) && 0 if (ioc->mtrr_reg > 0) { mtrr_del(ioc->mtrr_reg, 0, 0); - dprintk((KERN_INFO MYNAM ": %s: MTRR region de-registered\n", + dprintk((MYIOC_s_INFO_FMT "MTRR region de-registered\n", ioc->name)); } #endif @@ -2417,7 +3269,7 @@ ioc->alloc_total -= sz; } if (ioc->sense_buf_pool != NULL) { - sz = (ioc->req_depth * 256); + sz = (ioc->req_depth * MPT_SENSE_BUFFER_ALLOC); pci_free_consistent(ioc->pcidev, sz, ioc->sense_buf_pool, ioc->sense_buf_pool_dma); @@ -2427,8 +3279,8 @@ } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* - * HandShakeReqAndReply - Send MPT request to and receive reply from +/** + * mpt_handshake_req_reply_wait - Send MPT request to and receive reply from * IOC via doorbell handshake method. * @ioc: Pointer to MPT_ADAPTER structure * @reqBytes: Size of the request in bytes @@ -2436,6 +3288,7 @@ * @replyBytes: Expected size of the reply in bytes * @u16reply: Pointer to area where reply should be written * @maxwait: Max wait time for a reply (in seconds) + * @sleepFlag: Specifies whether the process can sleep * * NOTES: It is the callers responsibility to byte-swap fields in the * request which are greater than 1 byte in size. It is also the @@ -2444,8 +3297,9 @@ * * Returns 0 for success, non-zero for failure. */ -static int -HandShakeReqAndReply(MPT_ADAPTER *ioc, int reqBytes, u32 *req, int replyBytes, u16 *u16reply, int maxwait) +int +mpt_handshake_req_reply_wait(MPT_ADAPTER *ioc, int reqBytes, u32 *req, + int replyBytes, u16 *u16reply, int maxwait, int sleepFlag) { MPIDefaultReply_t *mptReply; int failcnt = 0; @@ -2471,57 +3325,61 @@ /* * Wait for IOC's doorbell handshake int */ - if ((t = WaitForDoorbellInt(ioc, 2)) < 0) + if ((t = WaitForDoorbellInt(ioc, 5, sleepFlag)) < 0) failcnt++; - dhsprintk((KERN_INFO MYNAM ": %s: HandShake request start, WaitCnt=%d%s\n", + dhsprintk((MYIOC_s_INFO_FMT "HandShake request start, WaitCnt=%d%s\n", ioc->name, t, failcnt ? " - MISSING DOORBELL HANDSHAKE!" : "")); + /* Read doorbell and check for active bit */ + if (!(CHIPREG_READ32(&ioc->chip->Doorbell) & MPI_DOORBELL_ACTIVE)) + return -1; + /* * Clear doorbell int (WRITE 0 to IntStatus reg), * then wait for IOC to ACKnowledge that it's ready for * our handshake request. */ CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); - if (!failcnt && (t = WaitForDoorbellAck(ioc, 2)) < 0) + if (!failcnt && (t = WaitForDoorbellAck(ioc, 2, sleepFlag)) < 0) failcnt++; if (!failcnt) { - int i; + int ii; u8 *req_as_bytes = (u8 *) req; /* * Stuff request words via doorbell handshake, * with ACK from IOC for each. */ - for (i = 0; !failcnt && i < reqBytes/4; i++) { - u32 word = ((req_as_bytes[(i*4) + 0] << 0) | - (req_as_bytes[(i*4) + 1] << 8) | - (req_as_bytes[(i*4) + 2] << 16) | - (req_as_bytes[(i*4) + 3] << 24)); + for (ii = 0; !failcnt && ii < reqBytes/4; ii++) { + u32 word = ((req_as_bytes[(ii*4) + 0] << 0) | + (req_as_bytes[(ii*4) + 1] << 8) | + (req_as_bytes[(ii*4) + 2] << 16) | + (req_as_bytes[(ii*4) + 3] << 24)); CHIPREG_WRITE32(&ioc->chip->Doorbell, word); - if ((t = WaitForDoorbellAck(ioc, 2)) < 0) + if ((t = WaitForDoorbellAck(ioc, 2, sleepFlag)) < 0) failcnt++; } dmfprintk((KERN_INFO MYNAM ": Handshake request frame (@%p) header\n", req)); DBG_DUMP_REQUEST_FRAME_HDR(req) - dhsprintk((KERN_INFO MYNAM ": %s: HandShake request post done, WaitCnt=%d%s\n", + dhsprintk((MYIOC_s_INFO_FMT "HandShake request post done, WaitCnt=%d%s\n", ioc->name, t, failcnt ? " - MISSING DOORBELL ACK!" : "")); /* * Wait for completion of doorbell handshake reply from the IOC */ - if (!failcnt && (t = WaitForDoorbellReply(ioc, maxwait)) < 0) + if (!failcnt && (t = WaitForDoorbellReply(ioc, maxwait, sleepFlag)) < 0) failcnt++; /* * Copy out the cached reply... */ - for(i=0; i < MIN(replyBytes/2,mptReply->MsgLength*2); i++) - u16reply[i] = ioc->hs_reply[i]; + for (ii=0; ii < MIN(replyBytes/2,mptReply->MsgLength*2); ii++) + u16reply[ii] = ioc->hs_reply[ii]; } else { return -99; } @@ -2535,6 +3393,7 @@ * in it's IntStatus register. * @ioc: Pointer to MPT_ADAPTER structure * @howlong: How long to wait (in seconds) + * @sleepFlag: Specifies whether the process can sleep * * This routine waits (up to ~2 seconds max) for IOC doorbell * handshake ACKnowledge. @@ -2542,28 +3401,40 @@ * Returns a negative value on failure, else wait loop count. */ static int -WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong) +WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag) { int cntdn = HZ * howlong; int count = 0; u32 intstat; - while (--cntdn) { - intstat = CHIPREG_READ32(&ioc->chip->IntStatus); - if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) - break; - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(1); - count++; + if (sleepFlag == CAN_SLEEP) { + while (--cntdn) { + intstat = CHIPREG_READ32(&ioc->chip->IntStatus); + if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) + break; + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(1); + count++; + } + } else { + cntdn *= 10; /* convert to msec */ + while (--cntdn) { + intstat = CHIPREG_READ32(&ioc->chip->IntStatus); + if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) + break; + mdelay (1); + count++; + } + count /= 10; } if (cntdn) { - dhsprintk((KERN_INFO MYNAM ": %s: WaitForDoorbell ACK (cnt=%d)\n", + dhsprintk((MYIOC_s_INFO_FMT "WaitForDoorbell ACK (cnt=%d)\n", ioc->name, count)); return count; } - printk(KERN_ERR MYNAM ": %s: ERROR - Doorbell ACK timeout(%d)!\n", + printk(MYIOC_s_ERR_FMT "Doorbell ACK timeout(%d)!\n", ioc->name, (count+5)/HZ); return -1; } @@ -2574,34 +3445,47 @@ * in it's IntStatus register. * @ioc: Pointer to MPT_ADAPTER structure * @howlong: How long to wait (in seconds) + * @sleepFlag: Specifies whether the process can sleep * * This routine waits (up to ~2 seconds max) for IOC doorbell interrupt. * * Returns a negative value on failure, else wait loop count. */ static int -WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong) +WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag) { int cntdn = HZ * howlong; int count = 0; u32 intstat; - while (--cntdn) { - intstat = CHIPREG_READ32(&ioc->chip->IntStatus); - if (intstat & MPI_HIS_DOORBELL_INTERRUPT) - break; - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(1); - count++; + if (sleepFlag == CAN_SLEEP) { + while (--cntdn) { + intstat = CHIPREG_READ32(&ioc->chip->IntStatus); + if (intstat & MPI_HIS_DOORBELL_INTERRUPT) + break; + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(1); + count++; + } + } else { + cntdn *= 10; /* convert to msec */ + while (--cntdn) { + intstat = CHIPREG_READ32(&ioc->chip->IntStatus); + if (intstat & MPI_HIS_DOORBELL_INTERRUPT) + break; + mdelay(1); + count++; + } + count /= 10; } if (cntdn) { - dhsprintk((KERN_INFO MYNAM ": %s: WaitForDoorbell INT (cnt=%d)\n", + dhsprintk((MYIOC_s_INFO_FMT "WaitForDoorbell INT (cnt=%d)\n", ioc->name, count)); return count; } - printk(KERN_ERR MYNAM ": %s: ERROR - Doorbell INT timeout(%d)!\n", + printk(MYIOC_s_ERR_FMT "Doorbell INT timeout(%d)!\n", ioc->name, (count+5)/HZ); return -1; } @@ -2611,6 +3495,7 @@ * WaitForDoorbellReply - Wait for and capture a IOC handshake reply. * @ioc: Pointer to MPT_ADAPTER structure * @howlong: How long to wait (in seconds) + * @sleepFlag: Specifies whether the process can sleep * * This routine polls the IOC for a handshake reply, 16 bits at a time. * Reply is cached to IOC private area large enough to hold a maximum @@ -2619,13 +3504,13 @@ * Returns a negative value on failure, else size of reply in WORDS. */ static int -WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong) +WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag) { int u16cnt = 0; int failcnt = 0; int t; u16 *hs_reply = ioc->hs_reply; - volatile MPIDefaultReply_t *mptReply = (MPIDefaultReply_t *) ioc->hs_reply; + volatile MPIDefaultReply_t *mptReply = (MPIDefaultReply_t *) ioc->hs_reply; u16 hword; hs_reply[0] = hs_reply[1] = hs_reply[7] = 0; @@ -2634,12 +3519,12 @@ * Get first two u16's so we can look at IOC's intended reply MsgLength */ u16cnt=0; - if ((t = WaitForDoorbellInt(ioc, howlong)) < 0) { + if ((t = WaitForDoorbellInt(ioc, howlong, sleepFlag)) < 0) { failcnt++; } else { hs_reply[u16cnt++] = le16_to_cpu(CHIPREG_READ32(&ioc->chip->Doorbell) & 0x0000FFFF); CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); - if ((t = WaitForDoorbellInt(ioc, 2)) < 0) + if ((t = WaitForDoorbellInt(ioc, 2, sleepFlag)) < 0) failcnt++; else { hs_reply[u16cnt++] = le16_to_cpu(CHIPREG_READ32(&ioc->chip->Doorbell) & 0x0000FFFF); @@ -2647,7 +3532,7 @@ } } - dhsprintk((KERN_INFO MYNAM ": %s: First handshake reply word=%08x%s\n", + dhsprintk((MYIOC_s_INFO_FMT "First handshake reply word=%08x%s\n", ioc->name, le32_to_cpu(*(u32 *)hs_reply), failcnt ? " - MISSING DOORBELL HANDSHAKE!" : "")); @@ -2656,7 +3541,7 @@ * reply 16 bits at a time. */ for (u16cnt=2; !failcnt && u16cnt < (2 * mptReply->MsgLength); u16cnt++) { - if ((t = WaitForDoorbellInt(ioc, 2)) < 0) + if ((t = WaitForDoorbellInt(ioc, 2, sleepFlag)) < 0) failcnt++; hword = le16_to_cpu(CHIPREG_READ32(&ioc->chip->Doorbell) & 0x0000FFFF); /* don't overflow our IOC hs_reply[] buffer! */ @@ -2665,12 +3550,12 @@ CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); } - if (!failcnt && (t = WaitForDoorbellInt(ioc, 2)) < 0) + if (!failcnt && (t = WaitForDoorbellInt(ioc, 2, sleepFlag)) < 0) failcnt++; CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); if (failcnt) { - printk(KERN_ERR MYNAM ": %s: ERROR - Handshake reply failure!\n", + printk(MYIOC_s_ERR_FMT "Handshake reply failure!\n", ioc->name); return -failcnt; } @@ -2681,130 +3566,631 @@ else if ((mptReply->IOCStatus & MPI_IOCSTATUS_MASK) != MPI_IOCSTATUS_SUCCESS) { return -102; } -#endif +#endif + + dmfprintk((MYIOC_s_INFO_FMT "Got Handshake reply:\n", ioc->name)); + DBG_DUMP_REPLY_FRAME(mptReply) + + dhsprintk((MYIOC_s_INFO_FMT "WaitForDoorbell REPLY (sz=%d)\n", + ioc->name, u16cnt/2)); + return u16cnt/2; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * GetLanConfigPages - Fetch LANConfig pages. + * @ioc: Pointer to MPT_ADAPTER structure + * + * Return: 0 for success + * -ENOMEM if no memory available + * -EPERM if not allowed due to ISR context + * -EAGAIN if no msg frames currently available + * -EFAULT for non-successful reply or no reply (timeout) + */ +static int +GetLanConfigPages(MPT_ADAPTER *ioc) +{ + ConfigPageHeader_t hdr; + CONFIGPARMS cfg; + LANPage0_t *ppage0_alloc; + dma_addr_t page0_dma; + LANPage1_t *ppage1_alloc; + dma_addr_t page1_dma; + int rc = 0; + int data_sz; + int copy_sz; + + /* Get LAN Page 0 header */ + hdr.PageVersion = 0; + hdr.PageLength = 0; + hdr.PageNumber = 0; + hdr.PageType = MPI_CONFIG_PAGETYPE_LAN; + cfg.hdr = &hdr; + cfg.physAddr = -1; + cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; + cfg.dir = 0; + cfg.pageAddr = 0; + cfg.timeout = 0; + + if ((rc = mpt_config(ioc, &cfg)) != 0) + return rc; + + if (hdr.PageLength > 0) { + data_sz = hdr.PageLength * 4; + ppage0_alloc = (LANPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma); + rc = -ENOMEM; + if (ppage0_alloc) { + memset((u8 *)ppage0_alloc, 0, data_sz); + cfg.physAddr = page0_dma; + cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; + + if ((rc = mpt_config(ioc, &cfg)) == 0) { + /* save the data */ + copy_sz = MIN(sizeof(LANPage0_t), data_sz); + memcpy(&ioc->lan_cnfg_page0, ppage0_alloc, copy_sz); + + } + + pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma); + + /* FIXME! + * Normalize endianness of structure data, + * by byte-swapping all > 1 byte fields! + */ + + } + + if (rc) + return rc; + } + + /* Get LAN Page 1 header */ + hdr.PageVersion = 0; + hdr.PageLength = 0; + hdr.PageNumber = 1; + hdr.PageType = MPI_CONFIG_PAGETYPE_LAN; + cfg.hdr = &hdr; + cfg.physAddr = -1; + cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; + cfg.dir = 0; + cfg.pageAddr = 0; + + if ((rc = mpt_config(ioc, &cfg)) != 0) + return rc; + + if (hdr.PageLength == 0) + return 0; + + data_sz = hdr.PageLength * 4; + rc = -ENOMEM; + ppage1_alloc = (LANPage1_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page1_dma); + if (ppage1_alloc) { + memset((u8 *)ppage1_alloc, 0, data_sz); + cfg.physAddr = page1_dma; + cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; + + if ((rc = mpt_config(ioc, &cfg)) == 0) { + /* save the data */ + copy_sz = MIN(sizeof(LANPage1_t), data_sz); + memcpy(&ioc->lan_cnfg_page1, ppage1_alloc, copy_sz); + } + + pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage1_alloc, page1_dma); + + /* FIXME! + * Normalize endianness of structure data, + * by byte-swapping all > 1 byte fields! + */ + + } + + return rc; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * GetFcPortPage0 - Fetch FCPort config Page0. + * @ioc: Pointer to MPT_ADAPTER structure + * @portnum: IOC Port number + * + * Return: 0 for success + * -ENOMEM if no memory available + * -EPERM if not allowed due to ISR context + * -EAGAIN if no msg frames currently available + * -EFAULT for non-successful reply or no reply (timeout) + */ +static int +GetFcPortPage0(MPT_ADAPTER *ioc, int portnum) +{ + ConfigPageHeader_t hdr; + CONFIGPARMS cfg; + FCPortPage0_t *ppage0_alloc; + FCPortPage0_t *pp0dest; + dma_addr_t page0_dma; + int data_sz; + int copy_sz; + int rc; + + /* Get FCPort Page 0 header */ + hdr.PageVersion = 0; + hdr.PageLength = 0; + hdr.PageNumber = 0; + hdr.PageType = MPI_CONFIG_PAGETYPE_FC_PORT; + cfg.hdr = &hdr; + cfg.physAddr = -1; + cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; + cfg.dir = 0; + cfg.pageAddr = portnum; + cfg.timeout = 0; + + if ((rc = mpt_config(ioc, &cfg)) != 0) + return rc; + + if (hdr.PageLength == 0) + return 0; + + data_sz = hdr.PageLength * 4; + rc = -ENOMEM; + ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma); + if (ppage0_alloc) { + memset((u8 *)ppage0_alloc, 0, data_sz); + cfg.physAddr = page0_dma; + cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; + + if ((rc = mpt_config(ioc, &cfg)) == 0) { + /* save the data */ + pp0dest = &ioc->fc_port_page0[portnum]; + copy_sz = MIN(sizeof(FCPortPage0_t), data_sz); + memcpy(pp0dest, ppage0_alloc, copy_sz); + + /* + * Normalize endianness of structure data, + * by byte-swapping all > 1 byte fields! + */ + pp0dest->Flags = le32_to_cpu(pp0dest->Flags); + pp0dest->PortIdentifier = le32_to_cpu(pp0dest->PortIdentifier); + pp0dest->WWNN.Low = le32_to_cpu(pp0dest->WWNN.Low); + pp0dest->WWNN.High = le32_to_cpu(pp0dest->WWNN.High); + pp0dest->WWPN.Low = le32_to_cpu(pp0dest->WWPN.Low); + pp0dest->WWPN.High = le32_to_cpu(pp0dest->WWPN.High); + pp0dest->SupportedServiceClass = le32_to_cpu(pp0dest->SupportedServiceClass); + pp0dest->SupportedSpeeds = le32_to_cpu(pp0dest->SupportedSpeeds); + pp0dest->CurrentSpeed = le32_to_cpu(pp0dest->CurrentSpeed); + pp0dest->MaxFrameSize = le32_to_cpu(pp0dest->MaxFrameSize); + pp0dest->FabricWWNN.Low = le32_to_cpu(pp0dest->FabricWWNN.Low); + pp0dest->FabricWWNN.High = le32_to_cpu(pp0dest->FabricWWNN.High); + pp0dest->FabricWWPN.Low = le32_to_cpu(pp0dest->FabricWWPN.Low); + pp0dest->FabricWWPN.High = le32_to_cpu(pp0dest->FabricWWPN.High); + pp0dest->DiscoveredPortsCount = le32_to_cpu(pp0dest->DiscoveredPortsCount); + pp0dest->MaxInitiators = le32_to_cpu(pp0dest->MaxInitiators); + + } + + pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma); + } + + return rc; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * GetIoUnitPage2 - Retrieve BIOS version and boot order information. + * @ioc: Pointer to MPT_ADAPTER structure + * + * Returns: 0 for success + * -ENOMEM if no memory available + * -EPERM if not allowed due to ISR context + * -EAGAIN if no msg frames currently available + * -EFAULT for non-successful reply or no reply (timeout) + */ +static int +GetIoUnitPage2(MPT_ADAPTER *ioc) +{ + ConfigPageHeader_t hdr; + CONFIGPARMS cfg; + IOUnitPage2_t *ppage_alloc; + dma_addr_t page_dma; + int data_sz; + int rc; + + /* Get the page header */ + hdr.PageVersion = 0; + hdr.PageLength = 0; + hdr.PageNumber = 2; + hdr.PageType = MPI_CONFIG_PAGETYPE_IO_UNIT; + cfg.hdr = &hdr; + cfg.physAddr = -1; + cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; + cfg.dir = 0; + cfg.pageAddr = 0; + cfg.timeout = 0; + + if ((rc = mpt_config(ioc, &cfg)) != 0) + return rc; + + if (hdr.PageLength == 0) + return 0; + + /* Read the config page */ + data_sz = hdr.PageLength * 4; + rc = -ENOMEM; + ppage_alloc = (IOUnitPage2_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma); + if (ppage_alloc) { + memset((u8 *)ppage_alloc, 0, data_sz); + cfg.physAddr = page_dma; + cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; + + /* If Good, save data */ + if ((rc = mpt_config(ioc, &cfg)) == 0) + ioc->biosVersion = le32_to_cpu(ppage_alloc->BiosVersion); + + pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage_alloc, page_dma); + } + + return rc; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mpt_GetScsiPortSettings - read SCSI Port Page 0 and 2 + * @ioc: Pointer to a Adapter Strucutre + * @portnum: IOC port number + * + * Return: -EFAULT if read of config page header fails + * or if no nvram + * If read of SCSI Port Page 0 fails, + * NVRAM = MPT_HOST_NVRAM_INVALID (0xFFFFFFFF) + * Adapter settings: async, narrow + * Return 1 + * If read of SCSI Port Page 2 fails, + * Adapter settings valid + * NVRAM = MPT_HOST_NVRAM_INVALID (0xFFFFFFFF) + * Return 1 + * Else + * Both valid + * Return 0 + * CHECK - what type of locking mechanisms should be used???? + */ +static int +mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum) +{ + u8 *pbuf = NULL; + dma_addr_t buf_dma; + CONFIGPARMS cfg; + ConfigPageHeader_t header; + int ii; + int data, rc = 0; + + /* Allocate memory + */ + if (!ioc->spi_data.nvram) { + int sz; + u8 *mem; + sz = MPT_MAX_SCSI_DEVICES * sizeof(int); + mem = kmalloc(sz, GFP_KERNEL); + if (mem == NULL) + return -EFAULT; + + ioc->spi_data.nvram = (int *) mem; + + dprintk((MYIOC_s_INFO_FMT "SCSI device NVRAM settings @ %p, sz=%d\n", + ioc->name, ioc->spi_data.nvram, sz)); + } + + /* Invalidate NVRAM information + */ + for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) { + ioc->spi_data.nvram[ii] = MPT_HOST_NVRAM_INVALID; + } + + /* Read SPP0 header, allocate memory, then read page. + */ + header.PageVersion = 0; + header.PageLength = 0; + header.PageNumber = 0; + header.PageType = MPI_CONFIG_PAGETYPE_SCSI_PORT; + cfg.hdr = &header; + cfg.physAddr = -1; + cfg.pageAddr = portnum; + cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; + cfg.dir = 0; + cfg.timeout = 0; /* use default */ + if (mpt_config(ioc, &cfg) != 0) + return -EFAULT; + + if (header.PageLength > 0) { + pbuf = pci_alloc_consistent(ioc->pcidev, header.PageLength * 4, &buf_dma); + if (pbuf) { + cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; + cfg.physAddr = buf_dma; + if (mpt_config(ioc, &cfg) != 0) { + ioc->spi_data.maxBusWidth = MPT_NARROW; + ioc->spi_data.maxSyncOffset = 0; + ioc->spi_data.minSyncFactor = MPT_ASYNC; + ioc->spi_data.busType = MPT_HOST_BUS_UNKNOWN; + rc = 1; + } else { + /* Save the Port Page 0 data + */ + SCSIPortPage0_t *pPP0 = (SCSIPortPage0_t *) pbuf; + pPP0->Capabilities = le32_to_cpu(pPP0->Capabilities); + pPP0->PhysicalInterface = le32_to_cpu(pPP0->PhysicalInterface); + + ioc->spi_data.maxBusWidth = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_WIDE ? 1 : 0; + data = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_MAX_SYNC_OFFSET_MASK; + if (data) { + ioc->spi_data.maxSyncOffset = (u8) (data >> 16); + data = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_MIN_SYNC_PERIOD_MASK; + ioc->spi_data.minSyncFactor = (u8) (data >> 8); + } else { + ioc->spi_data.maxSyncOffset = 0; + ioc->spi_data.minSyncFactor = MPT_ASYNC; + } + + ioc->spi_data.busType = pPP0->PhysicalInterface & MPI_SCSIPORTPAGE0_PHY_SIGNAL_TYPE_MASK; + + /* Update the minSyncFactor based on bus type. + */ + if ((ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_HVD) || + (ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_SE)) { + + if (ioc->spi_data.minSyncFactor < MPT_ULTRA) + ioc->spi_data.minSyncFactor = MPT_ULTRA; + } + } + if (pbuf) { + pci_free_consistent(ioc->pcidev, header.PageLength * 4, pbuf, buf_dma); + pbuf = NULL; + } + } + } + + /* SCSI Port Page 2 - Read the header then the page. + */ + header.PageVersion = 0; + header.PageLength = 0; + header.PageNumber = 2; + header.PageType = MPI_CONFIG_PAGETYPE_SCSI_PORT; + cfg.hdr = &header; + cfg.physAddr = -1; + cfg.pageAddr = portnum; + cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; + cfg.dir = 0; + if (mpt_config(ioc, &cfg) != 0) + return -EFAULT; + + if (header.PageLength > 0) { + /* Allocate memory and read SCSI Port Page 2 + */ + pbuf = pci_alloc_consistent(ioc->pcidev, header.PageLength * 4, &buf_dma); + if (pbuf) { + cfg.action = MPI_CONFIG_ACTION_PAGE_READ_NVRAM; + cfg.physAddr = buf_dma; + if (mpt_config(ioc, &cfg) != 0) { + /* Nvram data is left with INVALID mark + */ + rc = 1; + } else { + SCSIPortPage2_t *pPP2 = (SCSIPortPage2_t *) pbuf; + MpiDeviceInfo_t *pdevice = NULL; + + /* Save the Port Page 2 data + * (reformat into a 32bit quantity) + */ + for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) { + pdevice = &pPP2->DeviceSettings[ii]; + data = (le16_to_cpu(pdevice->DeviceFlags) << 16) | + (pdevice->SyncFactor << 8) | pdevice->Timeout; + ioc->spi_data.nvram[ii] = data; + } + } + + pci_free_consistent(ioc->pcidev, header.PageLength * 4, pbuf, buf_dma); + pbuf = NULL; + } + } - dmfprintk((KERN_INFO MYNAM ": %s: Got Handshake reply:\n", ioc->name)); - DBG_DUMP_REPLY_FRAME(mptReply) + /* Update Adapter limits with those from NVRAM + * Comment: Don't need to do this. Target performance + * parameters will never exceed the adapters limits. + */ - dhsprintk((KERN_INFO MYNAM ": %s: WaitForDoorbell REPLY (sz=%d)\n", - ioc->name, u16cnt/2)); - return u16cnt/2; + return rc; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* - * GetLanConfigPages - Fetch LANConfig pages. - * @ioc: Pointer to MPT_ADAPTER structure +/* mpt_readScsiDevicePageHeaders - save version and length of SDP1 + * @ioc: Pointer to a Adapter Strucutre + * @portnum: IOC port number * - * Returns 0 for success, non-zero for failure. + * Return: -EFAULT if read of config page header fails + * or 0 if success. */ static int -GetLanConfigPages(MPT_ADAPTER *ioc) +mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int portnum) { - Config_t config_req; - ConfigReply_t config_reply; - LANPage0_t *page0; - dma_addr_t page0_dma; - LANPage1_t *page1; - dma_addr_t page1_dma; - int i; - int req_sz; - int reply_sz; - int data_sz; + CONFIGPARMS cfg; + ConfigPageHeader_t header; -/* LANPage0 */ - /* Immediate destination (reply area)... */ - reply_sz = sizeof(config_reply); - memset(&config_reply, 0, reply_sz); - - /* Ultimate destination... */ - page0 = &ioc->lan_cnfg_page0; - data_sz = sizeof(*page0); - memset(page0, 0, data_sz); - - /* Request area (config_req on the stack right now!) */ - req_sz = sizeof(config_req); - memset(&config_req, 0, req_sz); - config_req.Function = MPI_FUNCTION_CONFIG; - config_req.Action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; - /* config_req.Header.PageVersion = 0; */ - /* config_req.Header.PageLength = 0; */ - config_req.Header.PageNumber = 0; - config_req.Header.PageType = MPI_CONFIG_PAGETYPE_LAN; - /* config_req.PageAddress = 0; */ - config_req.PageBufferSGE.u.Simple.FlagsLength = cpu_to_le32( - ((MPI_SGE_FLAGS_LAST_ELEMENT | - MPI_SGE_FLAGS_END_OF_BUFFER | - MPI_SGE_FLAGS_END_OF_LIST | - MPI_SGE_FLAGS_SIMPLE_ELEMENT | - MPI_SGE_FLAGS_SYSTEM_ADDRESS | - MPI_SGE_FLAGS_32_BIT_ADDRESSING | - MPI_SGE_FLAGS_32_BIT_CONTEXT) << MPI_SGE_FLAGS_SHIFT) | - (u32)data_sz - ); - page0_dma = pci_map_single(ioc->pcidev, page0, data_sz, PCI_DMA_FROMDEVICE); - config_req.PageBufferSGE.u.Simple.u.Address32 = cpu_to_le32(page0_dma); + /* Read the SCSI Device Page 1 header + */ + header.PageVersion = 0; + header.PageLength = 0; + header.PageNumber = 1; + header.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; + cfg.hdr = &header; + cfg.physAddr = -1; + cfg.pageAddr = portnum; + cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; + cfg.dir = 0; + cfg.timeout = 0; + if (mpt_config(ioc, &cfg) != 0) + return -EFAULT; + + ioc->spi_data.sdp1version = cfg.hdr->PageVersion; + ioc->spi_data.sdp1length = cfg.hdr->PageLength; + + header.PageVersion = 0; + header.PageLength = 0; + header.PageNumber = 0; + header.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; + if (mpt_config(ioc, &cfg) != 0) + return -EFAULT; - dprintk((KERN_INFO MYNAM ": %s: Sending Config request LAN_PAGE_0\n", - ioc->name)); + ioc->spi_data.sdp0version = cfg.hdr->PageVersion; + ioc->spi_data.sdp0length = cfg.hdr->PageLength; - i = HandShakeReqAndReply(ioc, req_sz, (u32*)&config_req, - reply_sz, (u16*)&config_reply, 3); - pci_unmap_single(ioc->pcidev, page0_dma, data_sz, PCI_DMA_FROMDEVICE); - if (i != 0) - return i; + return 0; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/** + * mpt_findImVolumes - Identify IDs of hidden disks and RAID Volumes + * @ioc: Pointer to a Adapter Strucutre + * @portnum: IOC port number + * + * Return: + * 0 on success + * -EFAULT if read of config page header fails or data pointer not NULL + * -ENOMEM if pci_alloc failed + */ +static int +mpt_findImVolumes(MPT_ADAPTER *ioc) +{ + IOCPage2_t *pIoc2 = NULL; + IOCPage3_t *pIoc3 = NULL; + ConfigPageIoc2RaidVol_t *pIocRv = NULL; + u8 *mem; + dma_addr_t ioc2_dma; + dma_addr_t ioc3_dma; + CONFIGPARMS cfg; + ConfigPageHeader_t header; + int jj; + int rc = 0; + int iocpage2sz; + int iocpage3sz = 0; + u8 nVols, nPhys; + u8 vid, vbus, vioc; + + if (ioc->spi_data.pIocPg3) + return -EFAULT; + + /* Read IOCP2 header then the page. + */ + header.PageVersion = 0; + header.PageLength = 0; + header.PageNumber = 2; + header.PageType = MPI_CONFIG_PAGETYPE_IOC; + cfg.hdr = &header; + cfg.physAddr = -1; + cfg.pageAddr = 0; + cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; + cfg.dir = 0; + cfg.timeout = 0; + if (mpt_config(ioc, &cfg) != 0) + return -EFAULT; + + if (header.PageLength == 0) + return -EFAULT; + + iocpage2sz = header.PageLength * 4; + pIoc2 = pci_alloc_consistent(ioc->pcidev, iocpage2sz, &ioc2_dma); + if (!pIoc2) + return -ENOMEM; + + cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; + cfg.physAddr = ioc2_dma; + if (mpt_config(ioc, &cfg) != 0) + goto done_and_free; + + /* Identify RAID Volume Id's */ + nVols = pIoc2->NumActiveVolumes; + if ( nVols == 0) { + /* No RAID Volumes. Done. + */ + } else { + /* At least 1 RAID Volume + */ + pIocRv = pIoc2->RaidVolume; + ioc->spi_data.isRaid = 0; + for (jj = 0; jj < nVols; jj++, pIocRv++) { + vid = pIocRv->VolumeID; + vbus = pIocRv->VolumeBus; + vioc = pIocRv->VolumeIOC; + + /* find the match + */ + if (vbus == 0) { + ioc->spi_data.isRaid |= (1 << vid); + } else { + /* Error! Always bus 0 + */ + } + } + } - /* Now byte swap the necessary LANPage0 fields */ + /* Identify Hidden Physical Disk Id's */ + nPhys = pIoc2->NumActivePhysDisks; + if (nPhys == 0) { + /* No physical disks. Done. + */ + } else { + /* There is at least one physical disk. + * Read and save IOC Page 3 + */ + header.PageVersion = 0; + header.PageLength = 0; + header.PageNumber = 3; + header.PageType = MPI_CONFIG_PAGETYPE_IOC; + cfg.hdr = &header; + cfg.physAddr = -1; + cfg.pageAddr = 0; + cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; + cfg.dir = 0; + cfg.timeout = 0; + if (mpt_config(ioc, &cfg) != 0) + goto done_and_free; -/* LANPage1 */ - /* Immediate destination (reply area)... */ - reply_sz = sizeof(config_reply); - memset(&config_reply, 0, reply_sz); - - /* Ultimate destination... */ - page1 = &ioc->lan_cnfg_page1; - data_sz = sizeof(*page1); - memset(page1, 0, data_sz); - - /* Request area (config_req on the stack right now!) */ - req_sz = sizeof(config_req); - memset(&config_req, 0, req_sz); - config_req.Function = MPI_FUNCTION_CONFIG; - config_req.Action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; - /* config_req.Header.PageVersion = 0; */ - /* config_req.Header.PageLength = 0; */ - config_req.Header.PageNumber = 1; - config_req.Header.PageType = MPI_CONFIG_PAGETYPE_LAN; - /* config_req.PageAddress = 0; */ - config_req.PageBufferSGE.u.Simple.FlagsLength = cpu_to_le32( - ((MPI_SGE_FLAGS_LAST_ELEMENT | - MPI_SGE_FLAGS_END_OF_BUFFER | - MPI_SGE_FLAGS_END_OF_LIST | - MPI_SGE_FLAGS_SIMPLE_ELEMENT | - MPI_SGE_FLAGS_SYSTEM_ADDRESS | - MPI_SGE_FLAGS_32_BIT_ADDRESSING | - MPI_SGE_FLAGS_32_BIT_CONTEXT) << MPI_SGE_FLAGS_SHIFT) | - (u32)data_sz - ); - page1_dma = pci_map_single(ioc->pcidev, page1, data_sz, PCI_DMA_FROMDEVICE); - config_req.PageBufferSGE.u.Simple.u.Address32 = cpu_to_le32(page1_dma); + if (header.PageLength == 0) + goto done_and_free; - dprintk((KERN_INFO MYNAM ": %s: Sending Config request LAN_PAGE_1\n", - ioc->name)); + /* Read Header good, alloc memory + */ + iocpage3sz = header.PageLength * 4; + pIoc3 = pci_alloc_consistent(ioc->pcidev, iocpage3sz, &ioc3_dma); + if (!pIoc3) + goto done_and_free; - i = HandShakeReqAndReply(ioc, req_sz, (u32*)&config_req, - reply_sz, (u16*)&config_reply, 3); - pci_unmap_single(ioc->pcidev, page1_dma, data_sz, PCI_DMA_FROMDEVICE); - if (i != 0) - return i; + /* Read the Page and save the data + * into malloc'd memory. + */ + cfg.physAddr = ioc3_dma; + cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; + if (mpt_config(ioc, &cfg) == 0) { + mem = kmalloc(iocpage3sz, GFP_KERNEL); + if (mem) { + memcpy(mem, (u8 *)pIoc3, iocpage3sz); + ioc->spi_data.pIocPg3 = (IOCPage3_t *) mem; + } + } + } - /* Now byte swap the necessary LANPage1 fields */ +done_and_free: + if (pIoc2) { + pci_free_consistent(ioc->pcidev, iocpage2sz, pIoc2, ioc2_dma); + pIoc2 = NULL; + } - return 0; + if (pIoc3) { + pci_free_consistent(ioc->pcidev, iocpage3sz, pIoc3, ioc3_dma); + pIoc3 = NULL; + } + + return rc; } + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** +/* * SendEventNotification - Send EventNotification (on or off) request * to MPT adapter. * @ioc: Pointer to MPT_ADAPTER structure @@ -2817,13 +4203,13 @@ evnp = (EventNotification_t *) mpt_get_msg_frame(mpt_base_index, ioc->id); if (evnp == NULL) { - dprintk((KERN_WARNING MYNAM ": %s: WARNING - Unable to allocate a event request frame!\n", + dprintk((MYIOC_s_WARN_FMT "Unable to allocate event request frame!\n", ioc->name)); return 0; } memset(evnp, 0, sizeof(*evnp)); - dprintk((KERN_INFO MYNAM ": %s: Sending EventNotification(%d)\n", ioc->name, EvSwitch)); + dprintk((MYIOC_s_INFO_FMT "Sending EventNotification(%d)\n", ioc->name, EvSwitch)); evnp->Function = MPI_FUNCTION_EVENT_NOTIFICATION; evnp->ChainOffset = 0; @@ -2847,13 +4233,13 @@ EventAck_t *pAck; if ((pAck = (EventAck_t *) mpt_get_msg_frame(mpt_base_index, ioc->id)) == NULL) { - printk(KERN_WARNING MYNAM ": %s: WARNING - Unable to allocate event ACK request frame!\n", + printk(MYIOC_s_WARN_FMT "Unable to allocate event ACK request frame!\n", ioc->name); return -1; } memset(pAck, 0, sizeof(*pAck)); - dprintk((KERN_INFO MYNAM ": %s: Sending EventAck\n", ioc->name)); + dprintk((MYIOC_s_INFO_FMT "Sending EventAck\n", ioc->name)); pAck->Function = MPI_FUNCTION_EVENT_ACK; pAck->ChainOffset = 0; @@ -2866,25 +4252,212 @@ return 0; } -#ifdef CONFIG_PROC_FS /* { */ +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/** + * mpt_config - Generic function to issue config message + * @ioc - Pointer to an adapter structure + * @cfg - Pointer to a configuration structure. Struct contains + * action, page address, direction, physical address + * and pointer to a configuration page header + * Page header is updated. + * + * Returns 0 for success + * -EPERM if not allowed due to ISR context + * -EAGAIN if no msg frames currently available + * -EFAULT for non-successful reply or no reply (timeout) + */ +int +mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg) +{ + Config_t *pReq; + MPT_FRAME_HDR *mf; + MptSge_t *psge; + unsigned long flags; + int ii, rc; + int flagsLength; + int in_isr; + + /* (Bugzilla:fibrebugs, #513) + * Bug fix (part 1)! 20010905 -sralston + * Prevent calling wait_event() (below), if caller happens + * to be in ISR context, because that is fatal! + */ + in_isr = in_interrupt(); + if (in_isr) { + dprintk((MYIOC_s_WARN_FMT "Config request not allowed in ISR context!\n", + ioc->name)); + return -EPERM; + } + + /* Get and Populate a free Frame + */ + if ((mf = mpt_get_msg_frame(mpt_base_index, ioc->id)) == NULL) { + dprintk((MYIOC_s_WARN_FMT "mpt_config: no msg frames!\n", + ioc->name)); + return -EAGAIN; + } + pReq = (Config_t *)mf; + pReq->Action = pCfg->action; + pReq->Reserved = 0; + pReq->ChainOffset = 0; + pReq->Function = MPI_FUNCTION_CONFIG; + pReq->Reserved1[0] = 0; + pReq->Reserved1[1] = 0; + pReq->Reserved1[2] = 0; + pReq->MsgFlags = 0; + for (ii=0; ii < 8; ii++) + pReq->Reserved2[ii] = 0; + + pReq->Header.PageVersion = pCfg->hdr->PageVersion; + pReq->Header.PageLength = pCfg->hdr->PageLength; + pReq->Header.PageNumber = pCfg->hdr->PageNumber; + pReq->Header.PageType = (pCfg->hdr->PageType & MPI_CONFIG_PAGETYPE_MASK); + pReq->PageAddress = cpu_to_le32(pCfg->pageAddr); + + /* Add a SGE to the config request. + */ + flagsLength = ((MPI_SGE_FLAGS_LAST_ELEMENT | + MPI_SGE_FLAGS_END_OF_BUFFER | + MPI_SGE_FLAGS_END_OF_LIST | + MPI_SGE_FLAGS_SIMPLE_ELEMENT | + MPT_SGE_ADDRESS_SIZE ) << MPI_SGE_FLAGS_SHIFT) | + pCfg->hdr->PageLength * 4; + + if (pCfg->dir) + flagsLength |= (MPI_SGE_FLAGS_DIRECTION << MPI_SGE_FLAGS_SHIFT); + + psge = (MptSge_t *) &pReq->PageBufferSGE; + psge->FlagsLength = cpu_to_le32(flagsLength); + cpu_to_leXX(pCfg->physAddr, psge->Address); + + dprintk((MYIOC_s_INFO_FMT "Sending Config request type %d, page %d and action %d\n", + ioc->name, pReq->Header.PageType, pReq->Header.PageNumber, pReq->Action)); + + /* Append pCfg pointer to end of mf + */ + *((void **) (((u8 *) mf) + (ioc->req_sz - sizeof(void *)))) = (void *) pCfg; + + /* Initalize the timer + */ + init_timer(&pCfg->timer); + pCfg->timer.data = (unsigned long) ioc; + pCfg->timer.function = mpt_timer_expired; + pCfg->wait_done = 0; + + /* Set the timer; ensure 10 second minimum */ + if (pCfg->timeout < 10) + pCfg->timer.expires = jiffies + HZ*10; + else + pCfg->timer.expires = jiffies + HZ*pCfg->timeout; + + /* Add to end of Q, set timer and then issue this command */ + spin_lock_irqsave(&ioc->FreeQlock, flags); + Q_ADD_TAIL(&ioc->configQ.head, &pCfg->linkage, Q_ITEM); + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + + add_timer(&pCfg->timer); + mpt_put_msg_frame(mpt_base_index, ioc->id, mf); + wait_event(mpt_waitq, pCfg->wait_done); + + /* mf has been freed - do not access */ + + rc = pCfg->status; + + return rc; +} + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* - * procfs (%MPT_PROCFS_MPTBASEDIR/...) support stuff... + * mpt_timer_expired - Call back for timer process. + * Used only internal config functionality. + * @data: Pointer to MPT_SCSI_HOST recast as an unsigned long + */ +static void +mpt_timer_expired(unsigned long data) +{ + MPT_ADAPTER *ioc = (MPT_ADAPTER *) data; + + dprintk((MYIOC_s_WARN_FMT "mpt_timer_expired! \n", ioc->name)); + + /* Perform a FW reload */ + if (mpt_HardResetHandler(ioc, NO_SLEEP) < 0) + printk(MYIOC_s_WARN_FMT "Firmware Reload FAILED!\n", ioc->name); + + /* No more processing. + * Hard reset clean-up will wake up + * process and free all resources. + */ + dprintk((MYIOC_s_WARN_FMT "mpt_timer_expired complete!\n", ioc->name)); + + return; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mpt_ioc_reset - Base cleanup for hard reset + * @ioc: Pointer to the adapter structure + * @reset_phase: Indicates pre- or post-reset functionality + * + * Remark: Free's resources with internally generated commands. */ +static int +mpt_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) +{ + CONFIGPARMS *pCfg; + unsigned long flags; + + dprintk((KERN_WARNING MYNAM + ": IOC %s_reset routed to MPT base driver!\n", + reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post")); + + if (reset_phase == MPT_IOC_PRE_RESET) { + /* If the internal config Q is not empty - + * delete timer. MF resources will be freed when + * the FIFO's are primed. + */ + spin_lock_irqsave(&ioc->FreeQlock, flags); + if (! Q_IS_EMPTY(&ioc->configQ)){ + pCfg = (CONFIGPARMS *)ioc->configQ.head; + do { + del_timer(&pCfg->timer); + pCfg = (CONFIGPARMS *) (pCfg->linkage.forw); + } while (pCfg != (CONFIGPARMS *)&ioc->configQ); + } + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + + } else { + CONFIGPARMS *pNext; + + /* Search the configQ for internal commands. + * Flush the Q, and wake up all suspended threads. + */ + spin_lock_irqsave(&ioc->FreeQlock, flags); + if (! Q_IS_EMPTY(&ioc->configQ)){ + pCfg = (CONFIGPARMS *)ioc->configQ.head; + do { + pNext = (CONFIGPARMS *) pCfg->linkage.forw; -#define PROC_MPT_READ_RETURN(page,start,off,count,eof,len) \ -{ \ - len -= off; \ - if (len < count) { \ - *eof = 1; \ - if (len <= 0) \ - return 0; \ - } else \ - len = count; \ - *start = page + off; \ - return len; \ + Q_DEL_ITEM(&pCfg->linkage); + + pCfg->status = MPT_CONFIG_ERROR; + pCfg->wait_done = 1; + wake_up(&mpt_waitq); + + pCfg = pNext; + } while (pCfg != (CONFIGPARMS *)&ioc->configQ); + } + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + } + + return 1; /* currently means nothing really */ } + +#ifdef CONFIG_PROC_FS /* { */ +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * procfs (%MPT_PROCFS_MPTBASEDIR/...) support stuff... + */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * procmpt_create - Create %MPT_PROCFS_MPTBASEDIR entries. @@ -2894,71 +4467,62 @@ static int procmpt_create(void) { - MPT_ADAPTER *ioc; - struct proc_dir_entry *ent; - int errcnt = 0; + MPT_ADAPTER *ioc; + struct proc_dir_entry *ent; + int ii; /* - * BEWARE: If/when MPT_PROCFS_MPTBASEDIR changes from "mpt" - * (single level) to multi level (e.g. "driver/message/fusion") - * something here needs to change. -sralston + * BEWARE: If/when MPT_PROCFS_MPTBASEDIR changes from "mpt" + * (single level) to multi level (e.g. "driver/message/fusion") + * something here needs to change. -sralston */ - procmpt_root_dir = CREATE_PROCDIR_ENTRY(MPT_PROCFS_MPTBASEDIR, NULL); - if (procmpt_root_dir == NULL) + mpt_proc_root_dir = proc_mkdir(MPT_PROCFS_MPTBASEDIR, NULL); + if (mpt_proc_root_dir == NULL) return -ENOTDIR; - if ((ioc = mpt_adapter_find_first()) != NULL) { - ent = create_proc_read_entry(MPT_PROCFS_SUMMARY_NODE, 0, NULL, procmpt_read_summary, NULL); - if (ent == NULL) { - printk(KERN_WARNING MYNAM ": WARNING - Could not create %s entry!\n", - MPT_PROCFS_SUMMARY_PATHNAME); - errcnt++; + for (ii=0; ii < MPT_PROC_ENTRIES; ii++) { + ent = create_proc_entry(mpt_proc_list[ii].name, + S_IFREG|S_IRUGO, mpt_proc_root_dir); + if (!ent) { + printk(KERN_WARNING MYNAM + ": WARNING - Could not create /proc/mpt/%s entry\n", + mpt_proc_list[ii].name); + continue; } + ent->read_proc = mpt_proc_list[ii].f; + ent->data = NULL; } + ioc = mpt_adapter_find_first(); while (ioc != NULL) { - char pname[32]; - int namelen; + struct proc_dir_entry *dent; /* * Create "/proc/mpt/iocN" subdirectory entry for each MPT adapter. */ - namelen = sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s", ioc->name); - if ((ent = CREATE_PROCDIR_ENTRY(pname, NULL)) != NULL) { + if ((dent = proc_mkdir(ioc->name, mpt_proc_root_dir)) != NULL) { /* - * And populate it with: "summary" and "dbg" file entries. + * And populate it with mpt_ioc_proc_list[] entries. */ - (void) sprintf(pname+namelen, "/summary"); - ent = create_proc_read_entry(pname, 0, NULL, procmpt_read_summary, ioc); - if (ent == NULL) { - errcnt++; - printk(KERN_WARNING MYNAM ": %s: WARNING - Could not create /proc/%s entry!\n", - ioc->name, pname); - } -//#ifdef MPT_DEBUG - /* DEBUG aid! */ - (void) sprintf(pname+namelen, "/dbg"); - ent = create_proc_read_entry(pname, 0, NULL, procmpt_read_dbg, ioc); - if (ent == NULL) { - errcnt++; - printk(KERN_WARNING MYNAM ": %s: WARNING - Could not create /proc/%s entry!\n", - ioc->name, pname); + for (ii=0; ii < MPT_IOC_PROC_ENTRIES; ii++) { + ent = create_proc_entry(mpt_ioc_proc_list[ii].name, + S_IFREG|S_IRUGO, dent); + if (!ent) { + printk(KERN_WARNING MYNAM + ": WARNING - Could not create /proc/mpt/%s/%s entry!\n", + ioc->name, + mpt_ioc_proc_list[ii].name); + continue; + } + ent->read_proc = mpt_ioc_proc_list[ii].f; + ent->data = ioc; } -//#endif } else { - errcnt++; - printk(KERN_WARNING MYNAM ": %s: WARNING - Could not create /proc/%s entry!\n", - ioc->name, pname); - + printk(MYIOC_s_WARN_FMT "Could not create /proc/mpt/%s subdir entry!\n", + ioc->name, mpt_ioc_proc_list[ii].name); } - ioc = mpt_adapter_find_next(ioc); } - if (errcnt) { -// remove_proc_entry("mpt", 0); - return -ENOTDIR; - } - return 0; } @@ -2971,44 +4535,44 @@ static int procmpt_destroy(void) { - MPT_ADAPTER *ioc; + MPT_ADAPTER *ioc; + int ii; - if (!procmpt_root_dir) + if (!mpt_proc_root_dir) return 0; /* - * BEWARE: If/when MPT_PROCFS_MPTBASEDIR changes from "mpt" - * (single level) to multi level (e.g. "driver/message/fusion") - * something here needs to change. -sralston + * BEWARE: If/when MPT_PROCFS_MPTBASEDIR changes from "mpt" + * (single level) to multi level (e.g. "driver/message/fusion") + * something here needs to change. -sralston */ ioc = mpt_adapter_find_first(); - if (ioc != NULL) { - remove_proc_entry(MPT_PROCFS_SUMMARY_NODE, 0); - } - while (ioc != NULL) { char pname[32]; int namelen; + + namelen = sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s", ioc->name); + /* * Tear down each "/proc/mpt/iocN" subdirectory. */ - namelen = sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s", ioc->name); - (void) sprintf(pname+namelen, "/summary"); - remove_proc_entry(pname, 0); -//#ifdef MPT_DEBUG - (void) sprintf(pname+namelen, "/dbg"); - remove_proc_entry(pname, 0); -//#endif - (void) sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s", ioc->name); - remove_proc_entry(pname, 0); + for (ii=0; ii < MPT_IOC_PROC_ENTRIES; ii++) { + (void) sprintf(pname+namelen, "/%s", mpt_ioc_proc_list[ii].name); + remove_proc_entry(pname, NULL); + } + + remove_proc_entry(ioc->name, mpt_proc_root_dir); ioc = mpt_adapter_find_next(ioc); } - if (atomic_read((atomic_t *)&procmpt_root_dir->count) == 0) { - remove_proc_entry(MPT_PROCFS_MPTBASEDIR, 0); - procmpt_root_dir = NULL; + for (ii=0; ii < MPT_PROC_ENTRIES; ii++) + remove_proc_entry(mpt_proc_list[ii].name, mpt_proc_root_dir); + + if (atomic_read((atomic_t *)&mpt_proc_root_dir->count) == 0) { + remove_proc_entry(MPT_PROCFS_MPTBASEDIR, NULL); + mpt_proc_root_dir = NULL; return 0; } @@ -3016,23 +4580,23 @@ } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** - * procmpt_read_summary - Handle read request from /proc/mpt/summary +/* + * procmpt_summary_read - Handle read request from /proc/mpt/summary * or from /proc/mpt/iocN/summary. - * @page: Pointer to area to write information + * @buf: Pointer to area to write information * @start: Pointer to start pointer - * @off: Offset to start writing - * @count: + * @offset: Offset to start writing + * @request: * @eof: Pointer to EOF integer - * @data: Pointer + * @data: Pointer * - * Returns numbers of characters written to process performing the read. + * Returns number of characters written to process performing the read. */ static int -procmpt_read_summary(char *page, char **start, off_t off, int count, int *eof, void *data) +procmpt_summary_read(char *buf, char **start, off_t offset, int request, int *eof, void *data) { MPT_ADAPTER *ioc; - char *out = page; + char *out = buf; int len; if (data == NULL) @@ -3040,84 +4604,196 @@ else ioc = data; -// Too verbose! -// out += sprintf(out, "Attached Fusion MPT I/O Controllers:%s\n", ioc ? "" : " none"); - while (ioc) { int more = 0; -// Too verbose! -// mpt_print_ioc_facts(ioc, out, &more, 0); mpt_print_ioc_summary(ioc, out, &more, 0, 1); out += more; - if ((out-page) >= count) { + if ((out-buf) >= request) { break; } if (data == NULL) ioc = mpt_adapter_find_next(ioc); else - ioc = NULL; /* force exit for iocN */ + ioc = NULL; /* force exit for iocN */ } - len = out - page; + len = out - buf; - PROC_MPT_READ_RETURN(page,start,off,count,eof,len); + MPT_PROC_READ_RETURN(buf,start,offset,request,eof,len); } -// debug aid! /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** - * procmpt_read_dbg - Handle read request from /proc/mpt/iocN/dbg. - * @page: Pointer to area to write information +/* + * procmpt_version_read - Handle read request from /proc/mpt/version. + * @buf: Pointer to area to write information * @start: Pointer to start pointer - * @off: Offset to start writing - * @count: + * @offset: Offset to start writing + * @request: * @eof: Pointer to EOF integer - * @data: Pointer + * @data: Pointer * - * Returns numbers of characters written to process performing the read. + * Returns number of characters written to process performing the read. */ static int -procmpt_read_dbg(char *page, char **start, off_t off, int count, int *eof, void *data) +procmpt_version_read(char *buf, char **start, off_t offset, int request, int *eof, void *data) { - MPT_ADAPTER *ioc; - char *out = page; - int len; + int ii; + int scsi, lan, ctl, targ, dmp; + char *drvname; + int len; + + len = sprintf(buf, "%s-%s\n", "mptlinux", MPT_LINUX_VERSION_COMMON); + len += sprintf(buf+len, " Fusion MPT base driver\n"); + + scsi = lan = ctl = targ = dmp = 0; + for (ii=MPT_MAX_PROTOCOL_DRIVERS-1; ii; ii--) { + drvname = NULL; + if (MptCallbacks[ii]) { + switch (MptDriverClass[ii]) { + case MPTSCSIH_DRIVER: + if (!scsi++) drvname = "SCSI host"; + break; + case MPTLAN_DRIVER: + if (!lan++) drvname = "LAN"; + break; + case MPTSTM_DRIVER: + if (!targ++) drvname = "SCSI target"; + break; + case MPTCTL_DRIVER: + if (!ctl++) drvname = "ioctl"; + break; + case MPTDMP_DRIVER: + if (!dmp++) drvname = "DMP"; + break; + } + + if (drvname) + len += sprintf(buf+len, " Fusion MPT %s driver\n", drvname); + /* + * Handle isense special case, because it + * doesn't do a formal mpt_register call. + */ + if (isense_idx == ii) + len += sprintf(buf+len, " Fusion MPT isense driver\n"); + } else + break; + } - ioc = data; + MPT_PROC_READ_RETURN(buf,start,offset,request,eof,len); +} - while (ioc) { - int more = 0; +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * procmpt_iocinfo_read - Handle read request from /proc/mpt/iocN/info. + * @buf: Pointer to area to write information + * @start: Pointer to start pointer + * @offset: Offset to start writing + * @request: + * @eof: Pointer to EOF integer + * @data: Pointer + * + * Returns number of characters written to process performing the read. + */ +static int +procmpt_iocinfo_read(char *buf, char **start, off_t offset, int request, int *eof, void *data) +{ + MPT_ADAPTER *ioc = data; + int len; + char expVer[32]; + int sz; + int p; - mpt_print_ioc_facts(ioc, out, &more, 0); + mpt_get_fw_exp_ver(expVer, ioc); - out += more; - if ((out-page) >= count) { - break; + len = sprintf(buf, "%s:", ioc->name); + if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) + len += sprintf(buf+len, " (f/w download boot flag set)"); +// if (ioc->facts.IOCExceptions & MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL) +// len += sprintf(buf+len, " CONFIG_CHECKSUM_FAIL!"); + + len += sprintf(buf+len, "\n ProductID = 0x%04x (%s)\n", + ioc->facts.ProductID, + ioc->prod_name); + len += sprintf(buf+len, " FWVersion = 0x%08x%s", ioc->facts.FWVersion.Word, expVer); + if (ioc->facts.FWImageSize) + len += sprintf(buf+len, " (fw_size=%d)", ioc->facts.FWImageSize); + len += sprintf(buf+len, "\n MsgVersion = 0x%04x\n", ioc->facts.MsgVersion); + len += sprintf(buf+len, " FirstWhoInit = 0x%02x\n", ioc->FirstWhoInit); + len += sprintf(buf+len, " EventState = 0x%02x\n", ioc->facts.EventState); + + len += sprintf(buf+len, " CurrentHostMfaHighAddr = 0x%08x\n", + ioc->facts.CurrentHostMfaHighAddr); + len += sprintf(buf+len, " CurrentSenseBufferHighAddr = 0x%08x\n", + ioc->facts.CurrentSenseBufferHighAddr); + + len += sprintf(buf+len, " MaxChainDepth = 0x%02x frames\n", ioc->facts.MaxChainDepth); + len += sprintf(buf+len, " MinBlockSize = 0x%02x bytes\n", 4*ioc->facts.BlockSize); + + len += sprintf(buf+len, " RequestFrames @ 0x%p (Dma @ 0x%p)\n", + ioc->req_alloc, (void *)(ulong)ioc->req_alloc_dma); + /* + * Rounding UP to nearest 4-kB boundary here... + */ + sz = (ioc->req_sz * ioc->req_depth) + 128; + sz = ((sz + 0x1000UL - 1UL) / 0x1000) * 0x1000; + len += sprintf(buf+len, " {CurReqSz=%d} x {CurReqDepth=%d} = %d bytes ^= 0x%x\n", + ioc->req_sz, ioc->req_depth, ioc->req_sz*ioc->req_depth, sz); + len += sprintf(buf+len, " {MaxReqSz=%d} {MaxReqDepth=%d}\n", + 4*ioc->facts.RequestFrameSize, + ioc->facts.GlobalCredits); + + len += sprintf(buf+len, " ReplyFrames @ 0x%p (Dma @ 0x%p)\n", + ioc->reply_alloc, (void *)(ulong)ioc->reply_alloc_dma); + sz = (ioc->reply_sz * ioc->reply_depth) + 128; + len += sprintf(buf+len, " {CurRepSz=%d} x {CurRepDepth=%d} = %d bytes ^= 0x%x\n", + ioc->reply_sz, ioc->reply_depth, ioc->reply_sz*ioc->reply_depth, sz); + len += sprintf(buf+len, " {MaxRepSz=%d} {MaxRepDepth=%d}\n", + ioc->facts.CurReplyFrameSize, + ioc->facts.ReplyQueueDepth); + + len += sprintf(buf+len, " MaxDevices = %d\n", + (ioc->facts.MaxDevices==0) ? 255 : ioc->facts.MaxDevices); + len += sprintf(buf+len, " MaxBuses = %d\n", ioc->facts.MaxBuses); + + /* per-port info */ + for (p=0; p < ioc->facts.NumberOfPorts; p++) { + len += sprintf(buf+len, " PortNumber = %d (of %d)\n", + p+1, + ioc->facts.NumberOfPorts); + if ((int)ioc->chip_type <= (int)FC929) { + if (ioc->pfacts[p].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) { + u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; + len += sprintf(buf+len, " LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n", + a[5], a[4], a[3], a[2], a[1], a[0]); + } + len += sprintf(buf+len, " WWN = %08X%08X:%08X%08X\n", + ioc->fc_port_page0[p].WWNN.High, + ioc->fc_port_page0[p].WWNN.Low, + ioc->fc_port_page0[p].WWPN.High, + ioc->fc_port_page0[p].WWPN.Low); } - ioc = NULL; } - len = out - page; - PROC_MPT_READ_RETURN(page,start,off,count,eof,len); + MPT_PROC_READ_RETURN(buf,start,offset,request,eof,len); } + #endif /* CONFIG_PROC_FS } */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ static void mpt_get_fw_exp_ver(char *buf, MPT_ADAPTER *ioc) { - if ((ioc->facts.FWVersion & 0xF000) == 0xE000) + buf[0] ='\0'; + if ((ioc->facts.FWVersion.Word >> 24) == 0x0E) { sprintf(buf, " (Exp %02d%02d)", - (ioc->facts.FWVersion & 0x0F00) >> 8, /* Month */ - ioc->facts.FWVersion & 0x001F); /* Day */ - else - buf[0] ='\0'; + (ioc->facts.FWVersion.Word >> 16) & 0x00FF, /* Month */ + (ioc->facts.FWVersion.Word >> 8) & 0x1F); /* Day */ - /* insider hack! */ - if (ioc->facts.FWVersion & 0x0080) { - strcat(buf, " [MDBG]"); + /* insider hack! */ + if ((ioc->facts.FWVersion.Word >> 8) & 0x80) + strcat(buf, " [MDBG]"); } } @@ -3130,8 +4806,8 @@ * @len: Offset at which to start writing in buffer * @showlan: Display LAN stuff? * - * This routine writes (english readable) ASCII text, which represents - * a summary of IOC information, to a buffer. + * This routine writes (english readable) ASCII text, which represents + * a summary of IOC information, to a buffer. */ void mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int *size, int len, int showlan) @@ -3144,11 +4820,11 @@ /* * Shorter summary of attached ioc's... */ - y = sprintf(buffer+len, "%s: %s, %s%04xh%s, Ports=%d, MaxQ=%d", + y = sprintf(buffer+len, "%s: %s, %s%08xh%s, Ports=%d, MaxQ=%d", ioc->name, ioc->prod_name, MPT_FW_REV_MAGIC_ID_STRING, /* "FwRev=" or somesuch */ - ioc->facts.FWVersion, + ioc->facts.FWVersion.Word, expVer, ioc->facts.NumberOfPorts, ioc->req_depth); @@ -3159,8 +4835,11 @@ a[5], a[4], a[3], a[2], a[1], a[0]); } - if (ioc->pci_irq < 100) - y += sprintf(buffer+len+y, ", IRQ=%d", ioc->pci_irq); +#ifndef __sparc__ + y += sprintf(buffer+len+y, ", IRQ=%d", ioc->pci_irq); +#else + y += sprintf(buffer+len+y, ", IRQ=%s", __irq_itoa(ioc->pci_irq)); +#endif if (!ioc->active) y += sprintf(buffer+len+y, " (disabled)"); @@ -3171,75 +4850,66 @@ } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * Reset Handling + */ +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** - * mpt_print_ioc_facts - Write ASCII summary of IOC facts to a buffer. + * mpt_HardResetHandler - Generic reset handler, issue SCSI Task + * Management call based on input arg values. If TaskMgmt fails, + * return associated SCSI request. * @ioc: Pointer to MPT_ADAPTER structure - * @buffer: Pointer to buffer where IOC facts should be written - * @size: Pointer to number of bytes we wrote (set by this routine) - * @len: Offset at which to start writing in buffer + * @sleepFlag: Indicates if sleep or schedule must be called. + * + * Remark: _HardResetHandler can be invoked from an interrupt thread (timer) + * or a non-interrupt thread. In the former, must not call schedule(). * - * This routine writes (english readable) ASCII text, which represents - * a summary of the IOC facts, to a buffer. + * Remark: A return of -1 is a FATAL error case, as it means a + * FW reload/initialization failed. + * + * Returns 0 for SUCCESS or -1 if FAILED. */ -void -mpt_print_ioc_facts(MPT_ADAPTER *ioc, char *buffer, int *size, int len) +int +mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) { - char expVer[32]; - char iocName[16]; - int sz; - int y; - int p; - - mpt_get_fw_exp_ver(expVer, ioc); + int rc; + unsigned long flags; - strcpy(iocName, ioc->name); - y = sprintf(buffer+len, "%s:\n", iocName); + dprintk((MYIOC_s_INFO_FMT "HardResetHandler Entered!\n", ioc->name)); +#ifdef MFCNT + printk(MYIOC_s_INFO_FMT "HardResetHandler Entered!\n", ioc->name); + printk("MF count 0x%x !\n", ioc->mfcnt); +#endif - y += sprintf(buffer+len+y, " ProductID = 0x%04x\n", ioc->facts.ProductID); - for (p=0; p < ioc->facts.NumberOfPorts; p++) { - y += sprintf(buffer+len+y, " PortNumber = %d (of %d)\n", - p+1, - ioc->facts.NumberOfPorts); - if (ioc->pfacts[p].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) { - u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; - y += sprintf(buffer+len+y, " LanAddr = 0x%02x:%02x:%02x:%02x:%02x:%02x\n", - a[5], a[4], a[3], a[2], a[1], a[0]); - } - } - y += sprintf(buffer+len+y, " FWVersion = 0x%04x%s\n", ioc->facts.FWVersion, expVer); - y += sprintf(buffer+len+y, " MsgVersion = 0x%04x\n", ioc->facts.MsgVersion); - y += sprintf(buffer+len+y, " FirstWhoInit = 0x%02x\n", ioc->FirstWhoInit); - y += sprintf(buffer+len+y, " EventState = 0x%02x\n", ioc->facts.EventState); - y += sprintf(buffer+len+y, " CurrentHostMfaHighAddr = 0x%08x\n", - ioc->facts.CurrentHostMfaHighAddr); - y += sprintf(buffer+len+y, " CurrentSenseBufferHighAddr = 0x%08x\n", - ioc->facts.CurrentSenseBufferHighAddr); - y += sprintf(buffer+len+y, " MaxChainDepth = 0x%02x frames\n", ioc->facts.MaxChainDepth); - y += sprintf(buffer+len+y, " MinBlockSize = 0x%02x bytes\n", 4*ioc->facts.BlockSize); + /* Reset the adapter. Prevent more than 1 call to + * mpt_do_ioc_recovery at any instant in time. + */ + spin_lock_irqsave(&ioc->diagLock, flags); + if ((ioc->diagPending) || (ioc->alt_ioc && ioc->alt_ioc->diagPending)){ + spin_unlock_irqrestore(&ioc->diagLock, flags); + return 0; + } else { + ioc->diagPending = 1; + } + spin_unlock_irqrestore(&ioc->diagLock, flags); - y += sprintf(buffer+len+y, " RequestFrames @ 0x%p (Dma @ 0x%08x)\n", - ioc->req_alloc, ioc->req_alloc_dma); - /* - * Rounding UP to nearest 4-kB boundary here... + /* FIXME: If do_ioc_recovery fails, repeat.... */ - sz = (ioc->req_sz * ioc->req_depth) + 128; - sz = ((sz + 0x1000UL - 1UL) / 0x1000) * 0x1000; - y += sprintf(buffer+len+y, " {CurReqSz=%d} x {CurReqDepth=%d} = %d bytes ^= 0x%x\n", - ioc->req_sz, ioc->req_depth, ioc->req_sz*ioc->req_depth, sz); - y += sprintf(buffer+len+y, " {MaxReqSz=%d} {MaxReqDepth=%d}\n", - 4*ioc->facts.RequestFrameSize, - ioc->facts.GlobalCredits); - y += sprintf(buffer+len+y, " ReplyFrames @ 0x%p (Dma @ 0x%08x)\n", - ioc->reply_alloc, ioc->reply_alloc_dma); - sz = (ioc->reply_sz * ioc->reply_depth) + 128; - y += sprintf(buffer+len+y, " {CurRepSz=%d} x {CurRepDepth=%d} = %d bytes ^= 0x%x\n", - ioc->reply_sz, ioc->reply_depth, ioc->reply_sz*ioc->reply_depth, sz); - y += sprintf(buffer+len+y, " {MaxRepSz=%d} {MaxRepDepth=%d}\n", - ioc->facts.CurReplyFrameSize, - ioc->facts.ReplyQueueDepth); + if ((rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER, sleepFlag)) != 0) { + printk(KERN_WARNING MYNAM ": WARNING - (%d) Cannot recover %s\n", + rc, ioc->name); + } - *size = y; + spin_lock_irqsave(&ioc->diagLock, flags); + ioc->diagPending = 0; + if (ioc->alt_ioc) + ioc->alt_ioc->diagPending = 0; + spin_unlock_irqrestore(&ioc->diagLock, flags); + + dprintk((MYIOC_s_INFO_FMT "HardResetHandler rc = %d!\n", ioc->name, rc)); + + return rc; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ @@ -3268,7 +4938,7 @@ ds = "External Bus Reset"; break; case MPI_EVENT_RESCAN: - ds = "Bus Rescan Event"; + ds = "Bus Rescan Event"; /* Ok, do we need to do anything here? As far as I can tell, this is when a new device gets added to the loop. */ @@ -3296,6 +4966,9 @@ else ds = "Events(OFF) Change"; break; + case MPI_EVENT_INTEGRATED_RAID: + ds = "Integrated Raid"; + break; /* * MPT base "custom" events may be added here... */ @@ -3307,7 +4980,7 @@ } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** +/* * ProcessEventNotification - Route a received EventNotificationReply to * all currently regeistered event handlers. * @ioc: Pointer to MPT_ADAPTER structure @@ -3322,7 +4995,7 @@ u16 evDataLen; u32 evData0 = 0; // u32 evCtx; - int i; + int ii; int r = 0; int handlers = 0; char *evStr; @@ -3339,15 +5012,15 @@ } evStr = EventDescriptionStr(event, evData0); - dprintk((KERN_INFO MYNAM ": %s: MPT event (%s=%02Xh) detected!\n", + dprintk((MYIOC_s_INFO_FMT "MPT event (%s=%02Xh) detected!\n", ioc->name, evStr, event)); #if defined(MPT_DEBUG) || defined(MPT_DEBUG_EVENTS) printk(KERN_INFO MYNAM ": Event data:\n" KERN_INFO); - for (i = 0; i < evDataLen; i++) - printk(" %08x", le32_to_cpu(pEventReply->Data[i])); + for (ii = 0; ii < evDataLen; ii++) + printk(" %08x", le32_to_cpu(pEventReply->Data[ii])); printk("\n"); #endif @@ -3365,6 +5038,8 @@ case MPI_EVENT_LINK_STATUS_CHANGE: /* 07 */ case MPI_EVENT_LOOP_STATE_CHANGE: /* 08 */ case MPI_EVENT_LOGOUT: /* 09 */ + case MPI_EVENT_INTEGRATED_RAID: /* 0B */ + case MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE: /* 0C */ default: break; case MPI_EVENT_EVENT_CHANGE: /* 0A */ @@ -3382,13 +5057,36 @@ } /* + * Should this event be logged? Events are written sequentially. + * When buffer is full, start again at the top. + */ + if (ioc->events && (ioc->eventTypes & ( 1 << event))) { + int idx; + + idx = ioc->eventContext % ioc->eventLogSize; + + ioc->events[idx].event = event; + ioc->events[idx].eventContext = ioc->eventContext; + + for (ii = 0; ii < 2; ii++) { + if (ii < evDataLen) + ioc->events[idx].data[ii] = le32_to_cpu(pEventReply->Data[ii]); + else + ioc->events[idx].data[ii] = 0; + } + + ioc->eventContext++; + } + + + /* * Call each currently registered protocol event handler. */ - for (i=MPT_MAX_PROTOCOL_DRIVERS-1; i; i--) { - if (MptEvHandlers[i]) { - dprintk((KERN_INFO MYNAM ": %s: Routing Event to event handler #%d\n", - ioc->name, i)); - r += (*(MptEvHandlers[i]))(ioc, pEventReply); + for (ii=MPT_MAX_PROTOCOL_DRIVERS-1; ii; ii--) { + if (MptEvHandlers[ii]) { + dprintk((MYIOC_s_INFO_FMT "Routing Event to event handler #%d\n", + ioc->name, ii)); + r += (*(MptEvHandlers[ii]))(ioc, pEventReply); handlers++; } } @@ -3398,7 +5096,9 @@ * If needed, send (a single) EventAck. */ if (pEventReply->AckRequired == MPI_EVENT_NOTIFICATION_ACK_REQUIRED) { - if ((i = SendEventAck(ioc, pEventReply)) != 0) { + if ((ii = SendEventAck(ioc, pEventReply)) != 0) { + printk(MYIOC_s_WARN_FMT "SendEventAck returned %d\n", + ioc->name, ii); } } @@ -3427,7 +5127,7 @@ switch(log_info) { /* FCP Initiator */ - case MPI_IOCLOGINFO_FC_INIT_ERROR_OUT_OF_ORDER_FRAME: + case MPI_IOCLOGINFO_FC_INIT_ERROR_OUT_OF_ORDER_FRAME: desc = "Received an out of order frame - unsupported"; break; case MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_START_OF_FRAME: @@ -3483,7 +5183,7 @@ desc = "Not sent because login to remote node not validated"; break; case MPI_IOCLOGINFO_FC_TARGET_FROM_OUTBOUND: - desc = "Cleared from the outbound after a logout"; + desc = "Cleared from the outbound queue after a logout"; break; case MPI_IOCLOGINFO_FC_TARGET_WAITING_FOR_DATA_IN: desc = "Cleared waiting for data after a logout"; @@ -3516,7 +5216,7 @@ break; } - printk(KERN_INFO MYNAM ": %s: LogInfo(0x%08x): SubCl={%s}", + printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x): SubCl={%s}", ioc->name, log_info, subcl_str[subcl]); if (SubCl == MPI_IOCLOGINFO_FC_INVALID_FIELD_BYTE_OFFSET) printk(", byte_offset=%d\n", log_info & MPI_IOCLOGINFO_FC_INVALID_FIELD_MAX_OFFSET); @@ -3539,7 +5239,7 @@ mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info) { /* FIXME! */ - printk(KERN_INFO MYNAM ": %s: LogInfo(0x%08x)\n", ioc->name, log_info); + printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x)\n", ioc->name, log_info); } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ @@ -3553,7 +5253,7 @@ * Specialized driver registration routine for the isense driver. */ int -mpt_register_ascqops_strings(/*ASCQ_Table_t*/void *ascqTable, int ascqtbl_sz, const char **opsTable) +mpt_register_ascqops_strings(void *ascqTable, int ascqtbl_sz, const char **opsTable) { int r = 0; @@ -3562,6 +5262,7 @@ mpt_ASCQ_TableSz = ascqtbl_sz; mpt_ScsiOpcodesPtr = opsTable; printk(KERN_INFO MYNAM ": English readable SCSI-3 strings enabled:-)\n"); + isense_idx = last_drv_idx; r = 1; } MOD_INC_USE_COUNT; @@ -3582,11 +5283,15 @@ mpt_ASCQ_TableSz = 0; mpt_ScsiOpcodesPtr = NULL; printk(KERN_INFO MYNAM ": English readable SCSI-3 strings disabled)-:\n"); + isense_idx = -1; MOD_DEC_USE_COUNT; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +EXPORT_SYMBOL(mpt_adapters); +EXPORT_SYMBOL(mpt_proc_root_dir); +EXPORT_SYMBOL(DmpService); EXPORT_SYMBOL(mpt_register); EXPORT_SYMBOL(mpt_deregister); EXPORT_SYMBOL(mpt_event_register); @@ -3597,12 +5302,16 @@ EXPORT_SYMBOL(mpt_put_msg_frame); EXPORT_SYMBOL(mpt_free_msg_frame); EXPORT_SYMBOL(mpt_send_handshake_request); +EXPORT_SYMBOL(mpt_handshake_req_reply_wait); EXPORT_SYMBOL(mpt_adapter_find_first); EXPORT_SYMBOL(mpt_adapter_find_next); EXPORT_SYMBOL(mpt_verify_adapter); +EXPORT_SYMBOL(mpt_GetIocState); EXPORT_SYMBOL(mpt_print_ioc_summary); EXPORT_SYMBOL(mpt_lan_index); EXPORT_SYMBOL(mpt_stm_index); +EXPORT_SYMBOL(mpt_HardResetHandler); +EXPORT_SYMBOL(mpt_config); EXPORT_SYMBOL(mpt_register_ascqops_strings); EXPORT_SYMBOL(mpt_deregister_ascqops_strings); @@ -3611,12 +5320,13 @@ EXPORT_SYMBOL(mpt_ScsiOpcodesPtr); /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** +/* * fusion_init - Fusion MPT base driver initialization routine. * * Returns 0 for success, non-zero for failure. */ -int __init fusion_init(void) +int __init +fusion_init(void) { int i; @@ -3636,12 +5346,22 @@ MptResetHandlers[i] = NULL; } + DmpService = NULL; + /* NEW! 20010120 -sralston * Register ourselves (mptbase) in order to facilitate * EventNotification handling. */ mpt_base_index = mpt_register(mpt_base_reply, MPTBASE_DRIVER); + /* Register for hard reset handling callbacks. + */ + if (mpt_reset_register(mpt_base_index, mpt_ioc_reset) == 0) { + dprintk((KERN_INFO MYNAM ": Register for IOC reset notification\n")); + } else { + /* FIXME! */ + } + if ((i = mpt_pci_scan()) < 0) return i; @@ -3649,13 +5369,14 @@ } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** +/* * fusion_exit - Perform driver unload cleanup. * * This routine frees all resources associated with each MPT adapter * and removes all %MPT_PROCFS_MPTBASEDIR entries. */ -static void fusion_exit(void) +static void +fusion_exit(void) { MPT_ADAPTER *this; @@ -3665,7 +5386,7 @@ * Moved this *above* removal of all MptAdapters! */ #ifdef CONFIG_PROC_FS - procmpt_destroy(); + (void) procmpt_destroy(); #endif while (! Q_IS_EMPTY(&MptAdapters)) { @@ -3673,6 +5394,8 @@ Q_DEL_ITEM(this); mpt_adapter_dispose(this); } + + mpt_reset_deregister(mpt_base_index); } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ diff -urN linux-2.4.18/drivers/message/fusion/mptbase.h lia64-2.4/drivers/message/fusion/mptbase.h --- linux-2.4.18/drivers/message/fusion/mptbase.h Wed Oct 10 16:31:56 2001 +++ lia64-2.4/drivers/message/fusion/mptbase.h Fri Jul 19 18:32:12 2002 @@ -8,11 +8,12 @@ * Credits: * (see mptbase.c) * - * Copyright (c) 1999-2001 LSI Logic Corporation + * Copyright (c) 1999-2002 LSI Logic Corporation * Originally By: Steven J. Ralston - * (mailto:Steve.Ralston@lsil.com) + * (mailto:sjralston1@netscape.net) + * (mailto:Pam.Delaney@lsil.com) * - * $Id: mptbase.h,v 1.46.2.2.2.2 2001/09/18 03:22:29 sralston Exp $ + * $Id: mptbase.h,v 1.103 2002/02/27 20:24:38 pdelaney Exp $ */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* @@ -55,6 +56,7 @@ /*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ #include "linux_compat.h" /* linux-2.2.x (vs. -2.4.x) tweaks */ +#include "scsi3.h" /* SCSI defines */ #include "lsi/mpi_type.h" #include "lsi/mpi.h" /* Fusion MPI(nterface) basic defs */ @@ -62,6 +64,7 @@ #include "lsi/mpi_cnfg.h" /* IOC configuration support */ #include "lsi/mpi_init.h" /* SCSI Host (initiator) protocol support */ #include "lsi/mpi_lan.h" /* LAN over FC protocol support */ +#include "lsi/mpi_raid.h" /* Integrated Mirroring support */ #include "lsi/mpi_fc.h" /* Fibre Channel (lowlevel) support */ #include "lsi/mpi_targ.h" /* SCSI/FCP Target protcol support */ @@ -74,11 +77,11 @@ #endif #ifndef COPYRIGHT -#define COPYRIGHT "Copyright (c) 1999-2001 " MODULEAUTHOR +#define COPYRIGHT "Copyright (c) 1999-2002 " MODULEAUTHOR #endif -#define MPT_LINUX_VERSION_COMMON "1.02.02" -#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-1.02.02" +#define MPT_LINUX_VERSION_COMMON "2.00.11" +#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-2.00.11" #define WHAT_MAGIC_STRING "@" "(" "#" ")" #define show_mptmod_ver(s,ver) \ @@ -89,39 +92,77 @@ * Fusion MPT(linux) driver configurable stuff... */ #define MPT_MAX_ADAPTERS 16 -#define MPT_MAX_PROTOCOL_DRIVERS 8 +#define MPT_MAX_PROTOCOL_DRIVERS 16 +#define MPT_MAX_BUS 1 #define MPT_MAX_FC_DEVICES 255 +#define MPT_MAX_SCSI_DEVICES 16 +#define MPT_LAST_LUN 31 +#define MPT_SENSE_BUFFER_ALLOC 64 + /* allow for 256 max sense alloc, but only 255 max request */ +#if MPT_SENSE_BUFFER_ALLOC >= 256 +# undef MPT_SENSE_BUFFER_ALLOC +# define MPT_SENSE_BUFFER_ALLOC 256 +# define MPT_SENSE_BUFFER_SIZE 255 +#else +# define MPT_SENSE_BUFFER_SIZE MPT_SENSE_BUFFER_ALLOC +#endif -#define MPT_MISCDEV_BASENAME "mptctl" -#define MPT_MISCDEV_PATHNAME "/dev/" MPT_MISCDEV_BASENAME +#define MPT_NAME_LENGTH 32 #define MPT_PROCFS_MPTBASEDIR "mpt" /* chg it to "driver/fusion" ? */ -#define MPT_PROCFS_SUMMARY_NODE MPT_PROCFS_MPTBASEDIR "/summary" -#define MPT_PROCFS_SUMMARY_PATHNAME "/proc/" MPT_PROCFS_SUMMARY_NODE -#define MPT_FW_REV_MAGIC_ID_STRING "FwRev=" +#define MPT_PROCFS_SUMMARY_ALL_NODE MPT_PROCFS_MPTBASEDIR "/summary" +#define MPT_PROCFS_SUMMARY_ALL_PATHNAME "/proc/" MPT_PROCFS_SUMMARY_ALL_NODE +#define MPT_FW_REV_MAGIC_ID_STRING "FwRev=" -#ifdef __KERNEL__ /* { */ #define MPT_MAX_REQ_DEPTH 1023 -#define MPT_REQ_DEPTH 256 +#define MPT_DEFAULT_REQ_DEPTH 256 #define MPT_MIN_REQ_DEPTH 128 #define MPT_MAX_REPLY_DEPTH MPT_MAX_REQ_DEPTH -#define MPT_REPLY_DEPTH 128 +#define MPT_DEFAULT_REPLY_DEPTH 128 #define MPT_MIN_REPLY_DEPTH 8 #define MPT_MAX_REPLIES_PER_ISR 32 #define MPT_MAX_FRAME_SIZE 128 -#define MPT_REQ_SIZE 128 -#define MPT_REPLY_SIZE 128 +#define MPT_DEFAULT_FRAME_SIZE 128 -#define MPT_SG_BUCKETS_PER_HUNK 1 +#define MPT_SG_REQ_128_SCALE 1 +#define MPT_SG_REQ_96_SCALE 2 +#define MPT_SG_REQ_64_SCALE 4 -#ifdef MODULE -#define MPT_REQ_DEPTH_RANGE_STR __MODULE_STRING(MPT_MIN_REQ_DEPTH) "-" __MODULE_STRING(MPT_MAX_REQ_DEPTH) -#define MPT_REPLY_DEPTH_RANGE_STR __MODULE_STRING(MPT_MIN_REPLY_DEPTH) "-" __MODULE_STRING(MPT_MAX_REPLY_DEPTH) -#define MPT_REPLY_SIZE_RANGE_STR __MODULE_STRING(MPT_MIN_REPLY_SIZE) "-" __MODULE_STRING(MPT_MAX_FRAME_SIZE) -#endif +#define CAN_SLEEP 1 +#define NO_SLEEP 0 + +/* + * SCSI transfer rate defines. + */ +#define MPT_ULTRA320 0x08 +#define MPT_ULTRA160 0x09 +#define MPT_ULTRA2 0x0A +#define MPT_ULTRA 0x0C +#define MPT_FAST 0x19 +#define MPT_SCSI 0x32 +#define MPT_ASYNC 0xFF + +#define MPT_NARROW 0 +#define MPT_WIDE 1 + +#ifdef __KERNEL__ /* { */ +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ + +#include + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * Attempt semi-consistent error & warning msgs across + * MPT drivers. NOTE: Users of these macro defs must + * themselves define their own MYNAM. + */ +#define MYIOC_s_INFO_FMT KERN_INFO MYNAM ": %s: " +#define MYIOC_s_NOTE_FMT KERN_NOTICE MYNAM ": %s: " +#define MYIOC_s_WARN_FMT KERN_WARNING MYNAM ": %s: WARNING - " +#define MYIOC_s_ERR_FMT KERN_ERR MYNAM ": %s: ERROR - " /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* @@ -133,6 +174,7 @@ MPTSCSIH_DRIVER, /* MPT SCSI host (initiator) class */ MPTLAN_DRIVER, /* MPT LAN class */ MPTSTM_DRIVER, /* MPT SCSI target mode class */ + MPTDMP_DRIVER, /* MPT Dynamic Multi-pathing class */ MPTUNKNOWN_DRIVER } MPT_DRIVER_CLASS; @@ -145,10 +187,21 @@ struct _MPT_FRAME_HDR *forw; struct _MPT_FRAME_HDR *back; u32 arg1; + u32 pad; void *argp1; +#ifndef MPT_SCSI_USE_NEW_EH + void *argp2; +#endif } linkage; /* - * NOTE: On non-32-bit systems, where pointers are LARGE, + * NOTE: When request frames are free, on the linkage structure + * contets are valid. All other values are invalid. + * In particular, do NOT reply on offset [2] + * (in words) being the * message context. + * The message context must be reset (computed via base address + * + an offset) prior to issuing any command. + * + * NOTE2: On non-32-bit systems, where pointers are LARGE, * using the linkage pointers destroys our sacred MsgContext * field contents. But we don't care anymore because these * are now reset in mpt_put_msg_frame() just prior to sending @@ -169,6 +222,12 @@ } fld; } msgctxu; } hwhdr; + /* + * Remark: 32 bit identifier: + * 31-24: reserved + * 23-16: call back index + * 15-0 : request index + */ } MPT_FRAME_TRACKER; /* @@ -189,6 +248,11 @@ } u; } MPT_FRAME_HDR; +#define MPT_REQ_MSGFLAGS_DROPME 0x80 + +/* Used for tracking the free request frames + * and free reply frames. + */ typedef struct _MPT_Q_TRACKER { MPT_FRAME_HDR *head; MPT_FRAME_HDR *tail; @@ -214,9 +278,20 @@ struct _Q_ITEM *tail; } Q_TRACKER; +typedef struct _MPT_DONE_Q { + struct _MPT_DONE_Q *forw; + struct _MPT_DONE_Q *back; + void *argp; +} MPT_DONE_Q; + +typedef struct _DONE_Q_TRACKER { + MPT_DONE_Q *head; + MPT_DONE_Q *tail; +} DONE_Q_TRACKER; /* - * Chip-specific stuff... + * Chip-specific stuff... FC929 delineates break between + * FC and Parallel SCSI parts. Do NOT re-order. */ typedef enum { @@ -237,7 +312,9 @@ u32 WriteSequence; /* 04 Write Sequence register */ u32 Diagnostic; /* 08 Diagnostic register */ u32 TestBase; /* 0C Test Base Address */ - u32 Reserved1[8]; /* 10-2F reserved for future use */ + u32 DiagRwData; /* 10 Read Write Data (fw download) */ + u32 DiagRwAddress; /* 14 Read Write Address (fw download)*/ + u32 Reserved1[6]; /* 18-2F reserved for future use */ u32 IntStatus; /* 30 Interrupt Status */ u32 IntMask; /* 34 Interrupt Mask */ u32 Reserved2[2]; /* 38-3F reserved for future use */ @@ -256,60 +333,271 @@ */ +/* + * Dynamic Multi-Pathing specific stuff... + */ +#define DMP_MAX_PATHS 8 + +typedef struct _PathInfo { + u8 ioc; + u8 target; + u8 pad; + u8 pflags; +} PathInfo; + +#define PATHINFO_FLAGS_OWNED 0x01 +#define PATHINFO_FLAGS_EXISTS 0x02 +#define PATHINFO_FLAGS_AVAILABLE 0x04 +#define PATHINFO_FLAGS_SECONDARY 0x08 + +#define PFLAGS_EXISTS_AND_AVAIL (PATHINFO_FLAGS_EXISTS|PATHINFO_FLAGS_AVAILABLE) +#define PFLAGS_AVAIL_AND_OWNED (PATHINFO_FLAGS_AVAILABLE|PATHINFO_FLAGS_OWNED) + +typedef struct _ScsiCmndTracker { + void *head; + void *tail; +} ScsiCmndTracker; + + +/* + * VirtDevice - FC LUN device or SCSI target device + * (used to be FCSCSI_TARGET) + */ +typedef struct _VirtDevice { + struct _VirtDevice *forw; + struct _VirtDevice *back; + rwlock_t VdevLock; + int ref_cnt; + u8 tflags; + u8 ioc_id; + u8 target_id; + u8 bus_id; + u8 minSyncFactor; /* 0xFF is async */ + u8 maxOffset; /* 0 if async */ + u8 maxWidth; /* 0 if narrow, 1 if wide*/ + u8 negoFlags; /* 0 if WDTR/SDTR allowed */ + u8 raidVolume; /* set, if RAID Volume */ + u8 rsvd; /* alignment */ + u16 rsvd1raid; + int npaths; + u16 fc_phys_lun; + u16 fc_xlat_lun; + int stall_detected; + PathInfo path[DMP_MAX_PATHS]; + struct timer_list stall_timer; + struct timer_list retry_timer; + struct timer_list gone_timer; + ScsiCmndTracker WaitQ; + ScsiCmndTracker SentQ; + ScsiCmndTracker DoneQ; +//--- LUN split here? + u8 sense[SCSI_STD_SENSE_BYTES]; /* 18 */ + u8 rsvd2[2]; /* alignment */ + u32 luns; /* Max LUNs is 32 */ + u8 inq_data[SCSI_STD_INQUIRY_BYTES]; /* 36 */ + u8 pad0[4]; + u8 uniq_prepad[8]; + u8 inq00_data[20]; + u8 pad1[4]; + /* IEEE Registered Extended Identifier + obtained via INQUIRY VPD page 0x83 */ + u8 uniq_data[20]; + u8 pad2[4]; + u8 inqC3_data[12]; + u8 pad3[4]; + u8 inqC9_data[12]; + u8 pad4[4]; + u8 dev_vol_name[64]; +} VirtDevice; + +/* + * Fibre Channel (SCSI) target device and associated defines... + */ +#define MPT_TARGET_DEFAULT_DV_STATUS 0 +#define MPT_TARGET_FLAGS_VALID_NEGO 0x01 +#define MPT_TARGET_FLAGS_VALID_INQUIRY 0x02 +#define MPT_TARGET_FLAGS_VALID_SENSE 0x04 +#define MPT_TARGET_FLAGS_Q_YES 0x08 + +#define MPT_TARGET_NO_NEGO_WIDE 0x01 +#define MPT_TARGET_NO_NEGO_SYNC 0x02 + +typedef struct _VirtDevTracker { + struct _VirtDevice *head; + struct _VirtDevice *tail; + rwlock_t VlistLock; + int pad; +} VirtDevTracker; + + +/* + * /proc/mpt interface + */ +typedef struct { + const char *name; + mode_t mode; + int pad; + read_proc_t *read_proc; + write_proc_t *write_proc; +} mpt_proc_entry_t; + +#define MPT_PROC_READ_RETURN(buf,start,offset,request,eof,len) \ +do { \ + len -= offset; \ + if (len < request) { \ + *eof = 1; \ + if (len <= 0) \ + return 0; \ + } else \ + len = request; \ + *start = buf + offset; \ + return len; \ +} while (0) + + +/* + * IOCTL structure and associated defines + */ + +#define MPT_IOCTL_STATUS_DID_TIMEOUT 0x01 /* The current IOCTL timed out */ +#define MPT_IOCTL_STATUS_RF_VALID 0x02 /* The Reply Frame is VALID */ +#define MPT_IOCTL_STATUS_TIMER_ACTIVE 0x04 /* The timer is running */ +#define MPT_IOCTL_STATUS_SENSE_VALID 0x08 /* Sense data is valid */ +#define MPT_IOCTL_STATUS_COMMAND_GOOD 0x10 /* Command Status GOOD */ + +typedef struct _MPT_IOCTL { + struct _MPT_ADAPTER *ioc; + struct timer_list timer; /* timer function for this adapter */ + u8 ReplyFrame[MPT_DEFAULT_FRAME_SIZE]; /* reply frame data */ + u8 sense[MPT_SENSE_BUFFER_ALLOC]; + int wait_done; /* wake-up value for this ioc */ + u8 cmd; /* current command */ + u8 status; /* current command status */ + u8 pad[2]; +} MPT_IOCTL; + +/* + * Event Structure and define + */ +#define MPTCTL_EVENT_LOG_SIZE (0x0000000A) +typedef struct _mpt_ioctl_events { + u32 event; /* Specified by define above */ + u32 eventContext; /* Index or counter */ + int data[2]; /* First 8 bytes of Event Data */ +} MPT_IOCTL_EVENTS; + +/* + * CONFIGPARM status defines + */ +#define MPT_CONFIG_GOOD MPI_IOCSTATUS_SUCCESS +#define MPT_CONFIG_ERROR 0x002F + +/* + * Substructure to store SCSI specific configuration page data + */ +#define MPT_SCSICFG_NEGOTIATE 0x01 /* Negotiate on next IO */ +#define MPT_SCSICFG_NEED_DV 0x02 /* Schedule DV */ +#define MPT_SCSICFG_DV_PENDING 0x04 /* DV on this physical id pending */ +#define MPT_SCSICFG_DV_DONE 0x08 /* DV on this physical id complete */ + +#define MPT_SCSICFG_USE_NVRAM 0x01 /* WriteSDP1 using NVRAM */ +#define MPT_SCSICFG_ALL_IDS 0x02 /* WriteSDP1 to all IDS */ + +typedef struct _ScsiCfgData { + int *nvram; /* table of device NVRAM values */ + IOCPage3_t *pIocPg3; /* table of physical disks */ + u8 dvStatus[MPT_MAX_SCSI_DEVICES]; + int isRaid; /* bit field, 1 if RAID */ + u8 minSyncFactor; /* 0xFF if async */ + u8 maxSyncOffset; /* 0 if async */ + u8 maxBusWidth; /* 0 if narrow, 1 if wide */ + u8 busType; /* SE, LVD, HD */ + u8 sdp1version; /* SDP1 version */ + u8 sdp1length; /* SDP1 length */ + u8 sdp0version; /* SDP0 version */ + u8 sdp0length; /* SDP0 length */ + u8 dvScheduled; /* 1 if scheduled */ + u8 forceDv; /* 1 to force DV scheduling */ + u8 rsvd[2]; +} ScsiCfgData; + +/* + * Adapter Structure - pci_dev specific. Maximum: MPT_MAX_ADAPTERS + */ typedef struct _MPT_ADAPTER { struct _MPT_ADAPTER *forw; struct _MPT_ADAPTER *back; - int id; /* Unique adapter id {0,1,2,...} */ - int pci_irq; - char name[32]; /* "iocN" */ + int id; /* Unique adapter id N {0,1,2,...} */ + int pci_irq; /* This irq */ + char name[MPT_NAME_LENGTH]; /* "iocN" */ char *prod_name; /* "LSIFC9x9" */ - u32 mem_phys; /* == f4020000 (mmap) */ volatile SYSIF_REGS *chip; /* == c8817000 (mmap) */ - CHIP_TYPE chip_type; - int mem_size; + volatile SYSIF_REGS *pio_chip; /* Programmed IO (downloadboot) */ + u32 mem_phys; /* == f4020000 (mmap) */ + u32 pio_mem_phys; /* Programmed IO (downloadboot) */ + int mem_size; /* mmap memory size */ int alloc_total; u32 last_state; int active; - int sod_reset; - unsigned long last_kickstart; - u8 *reply_alloc; /* Reply frames alloc ptr */ + u8 *reply_alloc; /* Reply frames alloc ptr */ dma_addr_t reply_alloc_dma; - MPT_FRAME_HDR *reply_frames; /* Reply frames - rounded up! */ + MPT_FRAME_HDR *reply_frames; /* Reply msg frames - rounded up! */ dma_addr_t reply_frames_dma; - int reply_depth; - int reply_sz; + u32 reply_frames_low_dma; + int reply_depth; /* Num Allocated reply frames */ + int reply_sz; /* Reply frame size */ + CHIP_TYPE chip_type; /* We (host driver) get to manage our own RequestQueue! */ - u8 *req_alloc; /* Request frames alloc ptr */ + u8 *req_alloc; /* Request frames alloc ptr */ dma_addr_t req_alloc_dma; - MPT_FRAME_HDR *req_frames; /* Request msg frames for PULL mode! */ + MPT_FRAME_HDR *req_frames; /* Request msg frames - rounded up! */ dma_addr_t req_frames_dma; - int req_depth; - int req_sz; - MPT_Q_TRACKER FreeQ; + u32 req_frames_low_dma; + int req_depth; /* Number of request frames */ + int req_sz; /* Request frame size (bytes) */ spinlock_t FreeQlock; + MPT_Q_TRACKER FreeQ; /* Pool of SCSI sense buffers for commands coming from * the SCSI mid-layer. We have one 256 byte sense buffer * for each REQ entry. */ u8 *sense_buf_pool; dma_addr_t sense_buf_pool_dma; - struct pci_dev *pcidev; -/* atomic_t userCnt; */ - u8 *memmap; + u32 sense_buf_low_dma; int mtrr_reg; - struct Scsi_Host *sh; + void *pcidev; /* struct pci_dev pointer */ + u8 *memmap; /* mmap address */ + struct Scsi_Host *sh; /* Scsi Host pointer */ + ScsiCfgData spi_data; /* Scsi config. data */ + MPT_IOCTL *ioctl; /* ioctl data pointer */ struct proc_dir_entry *ioc_dentry; - struct _MPT_ADAPTER *alt_ioc; + struct _MPT_ADAPTER *alt_ioc; /* ptr to 929 bound adapter port */ + spinlock_t diagLock; /* diagnostic reset lock */ + int diagPending; + u32 biosVersion; /* BIOS version from IO Unit Page 2 */ + int eventTypes; /* Event logging parameters */ + int eventContext; /* Next event context */ + int eventLogSize; /* Max number of cached events */ + struct _mpt_ioctl_events *events; /* pointer to event log */ + u8 *FWImage; /* Pointer to FW */ + dma_addr_t FWImage_dma; + Q_TRACKER configQ; /* linked list of config. requests */ int hs_reply_idx; +#ifndef MFCNT + u32 pad0; +#else + u32 mfcnt; +#endif u32 hs_req[MPT_MAX_FRAME_SIZE/sizeof(u32)]; u16 hs_reply[MPT_MAX_FRAME_SIZE/sizeof(u16)]; IOCFactsReply_t facts; PortFactsReply_t pfacts[2]; + FCPortPage0_t fc_port_page0[2]; LANPage0_t lan_cnfg_page0; LANPage1_t lan_cnfg_page1; u8 FirstWhoInit; - u8 pad1[3]; + u8 pad1[7]; } MPT_ADAPTER; @@ -324,7 +612,6 @@ * 0 = not Ok ... */ typedef int (*MPT_CALLBACK)(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply); - typedef int (*MPT_EVHANDLER)(MPT_ADAPTER *ioc, EventNotificationReply_t *evReply); typedef int (*MPT_RESETHANDLER)(MPT_ADAPTER *ioc, int reset_phase); /* reset_phase defs */ @@ -344,6 +631,47 @@ #define MPT_HOSTEVENT_IOC_BRINGUP 0x91 #define MPT_HOSTEVENT_IOC_RECOVER 0x92 +/* 32 vs 64 bit SGL code. + * + */ +#if defined(__ia64__) +typedef SGESimple64_t MptSge_t; +typedef SGEChain64_t MptChain_t; + +#define cpu_to_leXX(y, p) { \ + u32 low = (u32) (y & 0xFFFFFFFF); \ + u32 high = (u32) (y >> 32); \ + p.Low = cpu_to_le32(low); \ + p.High = cpu_to_le32(high); \ +} + +#define leXX_to_cpu(y, p) { \ + y = (dma_addr_t) le32_to_cpu(p.High); \ + y = (y << 32); \ + y |= le32_to_cpu(p.Low); \ +} + +#define MPT_SGE_ADDRESS_SIZE MPI_SGE_FLAGS_64_BIT_ADDRESSING +#define MPT_SCSIIO_MSG_FLAGS MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 + + +#else + +typedef SGESimple32_t MptSge_t; +typedef SGEChain32_t MptChain_t; +#define cpu_to_leXX(y,p) { \ + p = cpu_to_le32(y); \ +} + +#define leXX_to_cpu(y,p) { \ + y = le32_to_cpu(p); \ +} + +#define MPT_SGE_ADDRESS_SIZE MPI_SGE_FLAGS_32_BIT_ADDRESSING +#define MPT_SCSIIO_MSG_FLAGS MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 + +#endif + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * Funky (private) macros... @@ -360,7 +688,8 @@ #define dhsprintk(x) #endif -#if defined(MPT_DEBUG) || defined(MPT_DEBUG_MSG_FRAME) +//#if defined(MPT_DEBUG) || defined(MPT_DEBUG_MSG_FRAME) +#if defined(MPT_DEBUG_MSG_FRAME) #define dmfprintk(x) printk x #else #define dmfprintk(x) @@ -372,24 +701,35 @@ #define dirqprintk(x) #endif -#ifdef MPT_DEBUG_EVENTS -#define deventprintk(x) printk x +#ifdef MPT_DEBUG_SG +#define dsgprintk(x) printk x #else -#define deventprintk(x) +#define dsgprintk(x) #endif -#ifdef MPT_DEBUG_SPINLOCK -#define dslprintk(x) printk x +#ifdef MPT_DEBUG_DV +#define ddvprintk(x) printk x #else -#define dslprintk(x) +#define ddvprintk(x) #endif -#ifdef MPT_DEBUG_SG -#define dsgprintk(x) printk x +#if defined(MPT_DEBUG_DV) || defined(MPT_DEBUG_DV_TINY) +#define ddvtprintk(x) printk x #else -#define dsgprintk(x) +#define ddvtprintk(x) #endif +#ifdef MPT_DEBUG_IOCTL +#define dctlprintk(x) printk x +#else +#define dctlprintk(x) +#endif + +#ifdef MPT_DEBUG_RESET +#define dtmprintk(x) printk x +#else +#define dtmprintk(x) +#endif #define MPT_INDEX_2_MFPTR(ioc,idx) \ (MPT_FRAME_HDR*)( (u8*)(ioc)->req_frames + (ioc)->req_sz * (idx) ) @@ -397,6 +737,9 @@ #define MFPTR_2_MPT_INDEX(ioc,mf) \ (int)( ((u8*)mf - (u8*)(ioc)->req_frames) / (ioc)->req_sz ) +#define MPT_INDEX_2_RFPTR(ioc,idx) \ + (MPT_FRAME_HDR*)( (u8*)(ioc)->reply_frames + (ioc)->req_sz * (idx) ) + #define Q_INIT(q,type) (q)->head = (q)->tail = (type*)(q) #define Q_IS_EMPTY(q) ((Q_ITEM*)(q)->head == (Q_ITEM*)(q)) @@ -425,7 +768,6 @@ _forw->back = _back; \ } - #define SWAB4(value) \ (u32)( (((value) & 0x000000ff) << 24) \ | (((value) & 0x0000ff00) << 8) \ @@ -457,64 +799,143 @@ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -#endif /* } __KERNEL__ */ +/* + * MPT_SCSI_HOST defines - Used by the IOCTL and the SCSI drivers + * Private to the driver. + */ +/* LOCAL structure and fields used when processing + * internally generated commands. These include: + * bus scan, dv and config requests. + */ +typedef struct _MPT_LOCAL_REPLY { + ConfigPageHeader_t header; + int completion; + u8 sense[SCSI_STD_SENSE_BYTES]; + u8 scsiStatus; + u8 skip; + u32 pad; +} MPT_LOCAL_REPLY; + +#define MPT_HOST_BUS_UNKNOWN (0xFF) +#define MPT_HOST_TOO_MANY_TM (0x05) +#define MPT_HOST_NVRAM_INVALID (0xFFFFFFFF) +#define MPT_HOST_NO_CHAIN (0xFFFFFFFF) +#define MPT_NVRAM_MASK_TIMEOUT (0x000000FF) +#define MPT_NVRAM_SYNC_MASK (0x0000FF00) +#define MPT_NVRAM_SYNC_SHIFT (8) +#define MPT_NVRAM_DISCONNECT_ENABLE (0x00010000) +#define MPT_NVRAM_ID_SCAN_ENABLE (0x00020000) +#define MPT_NVRAM_LUN_SCAN_ENABLE (0x00040000) +#define MPT_NVRAM_TAG_QUEUE_ENABLE (0x00080000) +#define MPT_NVRAM_WIDE_DISABLE (0x00100000) +#define MPT_NVRAM_BOOT_CHOICE (0x00200000) + +typedef struct _MPT_SCSI_HOST { + MPT_ADAPTER *ioc; + int port; + u32 pad0; + struct scsi_cmnd **ScsiLookup; + /* Pool of buffers for chaining. ReqToChain + * and ChainToChain track index of chain buffers. + * ChainBuffer (DMA) virt/phys addresses. + * FreeChainQ (lock) locking mechanisms. + */ + int *ReqToChain; + int *ChainToChain; + u8 *ChainBuffer; + dma_addr_t ChainBufferDMA; + MPT_Q_TRACKER FreeChainQ; + spinlock_t FreeChainQlock; + u32 qtag_tick; + VirtDevice **Targets; + MPT_LOCAL_REPLY *pLocal; /* used for internal commands */ + struct timer_list timer; + struct timer_list TMtimer; /* Timer for TM commands ONLY */ + /* Pool of memory for holding SCpnts before doing + * OS callbacks. freeQ is the free pool. + */ + u8 *memQ; + DONE_Q_TRACKER freeQ; + DONE_Q_TRACKER doneQ; /* Holds Linux formmatted requests */ + DONE_Q_TRACKER pendingQ; /* Holds MPI formmatted requests */ + MPT_Q_TRACKER taskQ; /* TM request Q */ + spinlock_t freedoneQlock; + int taskQcnt; + u8 numTMrequests; + u8 tmPending; + u8 resetPending; + u8 is_spi; /* Parallel SCSI i/f */ + u8 negoNvram; /* DV disabled, nego NVRAM */ + u8 is_multipath; /* Multi-path compatible */ + u8 rsvd[2]; + MPT_FRAME_HDR *tmPtr; /* Ptr to TM request*/ + MPT_FRAME_HDR *cmdPtr; /* Ptr to nonOS request */ + struct scsi_cmnd *abortSCpnt; + MPT_LOCAL_REPLY localReply; /* internal cmd reply struct */ +} MPT_SCSI_HOST; + +/* + * Structure for overlaying onto scsi_cmnd->SCp area + * NOTE: SCp area is 36 bytes min, 44 bytes max? + */ +typedef struct _scPrivate { + struct scsi_cmnd *forw; + struct scsi_cmnd *back; + void *p1; + void *p2; + u8 io_path_id; /* DMP */ + u8 pad[7]; +} scPrivate; /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * More Dynamic Multi-Pathing stuff... + */ + +/* Forward decl, a strange C thing, to prevent gcc compiler warnings */ +struct scsi_cmnd; /* - * MPT Control IOCTLs and structures + * DMP service layer structure / API interface */ -#define MPT_MAGIC_NUMBER 'm' -#define MPTRWPERF _IOWR(MPT_MAGIC_NUMBER,0,struct mpt_raw_r_w) -#define MPTRWPERF_CHK _IOR(MPT_MAGIC_NUMBER,13,struct mpt_raw_r_w) -#define MPTRWPERF_RESET _IOR(MPT_MAGIC_NUMBER,14,struct mpt_raw_r_w) -#define MPTFWDOWNLOAD _IOWR(MPT_MAGIC_NUMBER,15,struct mpt_fw_xfer) -#define MPTSCSICMD _IOWR(MPT_MAGIC_NUMBER,16,struct mpt_scsi_cmd) - -/* - * Define something *vague* enough that caller doesn't - * really need to know anything about device parameters - * (blk_size, capacity, etc.) - */ -struct mpt_raw_r_w { - unsigned int iocnum; /* IOC unit number */ - unsigned int port; /* IOC port number */ - unsigned int target; /* SCSI Target */ - unsigned int lun; /* SCSI LUN */ - unsigned int iters; /* N iterations */ - unsigned short nblks; /* number of blocks per IO */ - unsigned short qdepth; /* max Q depth on this device */ - unsigned char range; /* 0-100% of FULL disk capacity, 0=use (nblks X iters) */ - unsigned char skip; /* % of disk to skip */ - unsigned char rdwr; /* 0-100%, 0=pure ReaDs, 100=pure WRites */ - unsigned char seqran; /* 0-100%, 0=pure SEQential, 100=pure RANdom */ - unsigned int cache_sz; /* In Kb! Optimize hits to N Kb cache size */ -}; - -struct mpt_fw_xfer { - unsigned int iocnum; /* IOC unit number */ -/* u8 flags;*/ /* Message flags - bit field */ - unsigned int fwlen; - void *bufp; /* Pointer to firmware buffer */ -}; - -struct mpt_scsi_cmd { - unsigned int iocnum; /* IOC unit number */ - unsigned int port; /* IOC port number */ - unsigned int target; /* SCSI Target */ - unsigned int lun; /* SCSI LUN */ - SCSIIORequest_t scsi_req; - SCSIIOReply_t scsi_reply; -}; - -struct mpt_ioctl_sanity { - unsigned int iocnum; -}; +typedef struct _DmpServices { + VirtDevTracker VdevList; + struct semaphore *Daemon; + int (*ScsiPathSelect) + (struct scsi_cmnd *, MPT_SCSI_HOST **hd, int *target, int *lun); + int (*DmpIoDoneChk) + (MPT_SCSI_HOST *, struct scsi_cmnd *, + SCSIIORequest_t *, + SCSIIOReply_t *); + void (*mptscsih_scanVlist) + (MPT_SCSI_HOST *, int portnum); + int (*ScsiAbort) + (struct scsi_cmnd *); + int (*ScsiBusReset) + (struct scsi_cmnd *); +} DmpServices_t; -#ifdef __KERNEL__ /* { */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * Generic structure passed to the base mpt_config function. + */ +typedef struct _x_config_parms { + Q_ITEM linkage; /* linked list */ + struct timer_list timer; /* timer function for this request */ + ConfigPageHeader_t *hdr; + dma_addr_t physAddr; + int wait_done; /* wait for this request */ + u32 pageAddr; /* properly formatted */ + u8 action; + u8 dir; + u8 timeout; /* seconds */ + u8 pad1; + u16 status; + u16 pad2; +} CONFIGPARMS; +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * Public entry points... */ @@ -524,21 +945,28 @@ extern void mpt_event_deregister(int cb_idx); extern int mpt_reset_register(int cb_idx, MPT_RESETHANDLER reset_func); extern void mpt_reset_deregister(int cb_idx); -extern int mpt_register_ascqops_strings(/*ASCQ_Table_t*/void *ascqTable, int ascqtbl_sz, const char **opsTable); +extern int mpt_register_ascqops_strings(void *ascqTable, int ascqtbl_sz, const char **opsTable); extern void mpt_deregister_ascqops_strings(void); extern MPT_FRAME_HDR *mpt_get_msg_frame(int handle, int iocid); extern void mpt_free_msg_frame(int handle, int iocid, MPT_FRAME_HDR *mf); extern void mpt_put_msg_frame(int handle, int iocid, MPT_FRAME_HDR *mf); -extern int mpt_send_handshake_request(int handle, int iocid, int reqBytes, u32 *req); +extern int mpt_send_handshake_request(int handle, int iocid, int reqBytes, u32 *req, int sleepFlag); +extern int mpt_handshake_req_reply_wait(MPT_ADAPTER *ioc, int reqBytes, u32 *req, int replyBytes, u16 *u16reply, int maxwait, int sleepFlag); extern int mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp); extern MPT_ADAPTER *mpt_adapter_find_first(void); extern MPT_ADAPTER *mpt_adapter_find_next(MPT_ADAPTER *prev); +extern u32 mpt_GetIocState(MPT_ADAPTER *ioc, int cooked); extern void mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buf, int *size, int len, int showlan); -extern void mpt_print_ioc_facts(MPT_ADAPTER *ioc, char *buf, int *size, int len); +extern int mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag); +extern int mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *cfg); /* * Public data decl's... */ +extern MPT_ADAPTER *mpt_adapters[MPT_MAX_ADAPTERS]; +extern struct proc_dir_entry *mpt_proc_root_dir; +extern DmpServices_t *DmpService; + extern int mpt_lan_index; /* needed by mptlan.c */ extern int mpt_stm_index; /* needed by mptstm.c */ @@ -563,7 +991,7 @@ #define offsetof(t, m) ((size_t) (&((t *)0)->m)) #endif -#if defined(__alpha__) || defined(__sparc_v9__) +#if defined(__alpha__) || defined(__sparc_v9__) || defined(__ia64__) #define CAST_U32_TO_PTR(x) ((void *)(u64)x) #define CAST_PTR_TO_U32(x) ((u32)(u64)x) #else @@ -576,6 +1004,40 @@ ((pflags) & MPI_PORTFACTS_PROTOCOL_TARGET) ? 'T' : 't', \ ((pflags) & MPI_PORTFACTS_PROTOCOL_LAN) ? 'L' : 'l', \ ((pflags) & MPI_PORTFACTS_PROTOCOL_LOGBUSADDR) ? 'B' : 'b' + +/* + * Shifted SGE Defines - Use in SGE with FlagsLength member. + * Otherwise, use MPI_xxx defines (refer to "lsi/mpi.h" header). + * Defaults: 32 bit SGE, SYSTEM_ADDRESS if direction bit is 0, read + */ +#define MPT_TRANSFER_IOC_TO_HOST (0x00000000) +#define MPT_TRANSFER_HOST_TO_IOC (0x04000000) +#define MPT_SGE_FLAGS_LAST_ELEMENT (0x80000000) +#define MPT_SGE_FLAGS_END_OF_BUFFER (0x40000000) +#define MPT_SGE_FLAGS_LOCAL_ADDRESS (0x08000000) +#define MPT_SGE_FLAGS_DIRECTION (0x04000000) +#define MPT_SGE_FLAGS_ADDRESSING (MPT_SGE_ADDRESS_SIZE << MPI_SGE_FLAGS_SHIFT) +#define MPT_SGE_FLAGS_END_OF_LIST (0x01000000) + +#define MPT_SGE_FLAGS_TRANSACTION_ELEMENT (0x00000000) +#define MPT_SGE_FLAGS_SIMPLE_ELEMENT (0x10000000) +#define MPT_SGE_FLAGS_CHAIN_ELEMENT (0x30000000) +#define MPT_SGE_FLAGS_ELEMENT_MASK (0x30000000) + +#define MPT_SGE_FLAGS_SSIMPLE_READ \ + (MPT_SGE_FLAGS_LAST_ELEMENT | \ + MPT_SGE_FLAGS_END_OF_BUFFER | \ + MPT_SGE_FLAGS_END_OF_LIST | \ + MPT_SGE_FLAGS_SIMPLE_ELEMENT | \ + MPT_SGE_FLAGS_ADDRESSING | \ + MPT_TRANSFER_IOC_TO_HOST) +#define MPT_SGE_FLAGS_SSIMPLE_WRITE \ + (MPT_SGE_FLAGS_LAST_ELEMENT | \ + MPT_SGE_FLAGS_END_OF_BUFFER | \ + MPT_SGE_FLAGS_END_OF_LIST | \ + MPT_SGE_FLAGS_SIMPLE_ELEMENT | \ + MPT_SGE_FLAGS_ADDRESSING | \ + MPT_TRANSFER_HOST_TO_IOC) /*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ #endif diff -urN linux-2.4.18/drivers/message/fusion/mptctl.c lia64-2.4/drivers/message/fusion/mptctl.c --- linux-2.4.18/drivers/message/fusion/mptctl.c Wed Oct 10 16:31:56 2001 +++ lia64-2.4/drivers/message/fusion/mptctl.c Tue Mar 19 15:05:36 2002 @@ -9,6 +9,12 @@ * This driver would not exist if not for Alan Cox's development * of the linux i2o driver. * + * A special thanks to Pamela Delaney (LSI Logic) for tons of work + * and countless enhancements while adding support for the 1030 + * chip family. Pam has been instrumental in the development of + * of the 2.xx.xx series fusion drivers, and her contributions are + * far too numerous to hope to list in one place. + * * A huge debt of gratitude is owed to David S. Miller (DaveM) * for fixing much of the stupid and broken stuff in the early * driver while porting to sparc64 platform. THANK YOU! @@ -18,16 +24,17 @@ * (plus Eddie's other helpful hints and insights) * * Thanks to Arnaldo Carvalho de Melo for finding and patching - * a potential memory leak in mpt_ioctl_do_fw_download(), + * a potential memory leak in mptctl_do_fw_download(), * and for some kmalloc insight:-) * * (see also mptbase.c) * - * Copyright (c) 1999-2001 LSI Logic Corporation + * Copyright (c) 1999-2002 LSI Logic Corporation * Originally By: Steven J. Ralston, Noah Romer - * (mailto:Steve.Ralston@lsil.com) + * (mailto:sjralston1@netscape.net) + * (mailto:Pam.Delaney@lsil.com) * - * $Id: mptctl.c,v 1.25.4.1 2001/08/24 20:07:06 sralston Exp $ + * $Id: mptctl.c,v 1.52 2002/02/27 18:44:24 sralston Exp $ */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* @@ -79,11 +86,16 @@ #include #include -#include +#include /* needed for access to Scsi_Host struct */ +#include +#include /* for io_request_lock (spinlock) decl */ +#include "../../scsi/scsi.h" +#include "../../scsi/hosts.h" #define COPYRIGHT "Copyright (c) 1999-2001 LSI Logic Corporation" -#define MODULEAUTHOR "Steven J. Ralston, Noah Romer" +#define MODULEAUTHOR "Steven J. Ralston, Noah Romer, Pamela Delaney" #include "mptbase.h" +#include "mptctl.h" /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ #define my_NAME "Fusion MPT misc device (ioctl) driver" @@ -95,21 +107,59 @@ MODULE_DESCRIPTION(my_NAME); MODULE_LICENSE("GPL"); - /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ static int mptctl_id = -1; -static int rwperf_reset = 0; static struct semaphore mptctl_syscall_sem_ioc[MPT_MAX_ADAPTERS]; +static DECLARE_WAIT_QUEUE_HEAD ( mptctl_wait ); + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -static int mpt_ioctl_rwperf(unsigned long arg); -static int mpt_ioctl_rwperf_status(unsigned long arg); -static int mpt_ioctl_rwperf_reset(unsigned long arg); -static int mpt_ioctl_fw_download(unsigned long arg); -static int mpt_ioctl_do_fw_download(int ioc, char *ufwbuf, size_t fwlen); -static int mpt_ioctl_scsi_cmd(unsigned long arg); +struct buflist { + u8 *kptr; + int len; +}; + +/* + * Function prototypes. Called from OS entry point mptctl_ioctl. + * arg contents specific to function. + */ +static int mptctl_fw_download(unsigned long arg); +static int mptctl_getiocinfo (unsigned long arg); +static int mptctl_gettargetinfo (unsigned long arg); +static int mptctl_readtest (unsigned long arg); +static int mptctl_mpt_command (unsigned long arg); +static int mptctl_eventquery (unsigned long arg); +static int mptctl_eventenable (unsigned long arg); +static int mptctl_eventreport (unsigned long arg); +static int mptctl_replace_fw (unsigned long arg); + +static int mptctl_do_reset(unsigned long arg); + +static int mptctl_compaq_ioctl(struct file *file, unsigned int cmd, unsigned long arg); +static int mptctl_cpq_getpciinfo(unsigned long arg); +static int mptctl_cpq_getdriver(unsigned long arg); +static int mptctl_cpq_ctlr_status(unsigned long arg); +static int mptctl_cpq_target_address(unsigned long arg); +static int mptctl_cpq_passthru(unsigned long arg); +static int mptctl_compaq_scsiio(VENDOR_IOCTL_REQ *pVenReq, cpqfc_passthru_t *pPass); + +/* + * Private function calls. + */ +static int mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local); +static int mptctl_do_fw_download(int ioc, char *ufwbuf, size_t fwlen); +static MptSge_t *kbuf_alloc_2_sgl( int bytes, u32 dir, int sge_offset, int *frags, + struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc); +static void kfree_sgl( MptSge_t *sgl, dma_addr_t sgl_dma, + struct buflist *buflist, MPT_ADAPTER *ioc); +static void mptctl_timer_expired (unsigned long data); + +/* + * Reset Handler cleanup function + */ +static int mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase); /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* @@ -132,26 +182,27 @@ /* linux only seems to ever give 128kB MAX contiguous (GFP_USER) mem bytes */ #define MAX_KMALLOC_SZ (128*1024) -struct buflist { - u8 *kptr; - int len; -}; - -#define myMAX_TARGETS (1<<4) -#define myMAX_LUNS (1<<3) -#define myMAX_T_MASK (myMAX_TARGETS-1) -#define myMAX_L_MASK (myMAX_LUNS-1) -static u8 DevInUse[myMAX_TARGETS][myMAX_LUNS] = {{0,0}}; -static u32 DevIosCount[myMAX_TARGETS][myMAX_LUNS] = {{0,0}}; +#define MPT_IOCTL_DEFAULT_TIMEOUT 10 /* Default timeout value (seconds) */ static u32 fwReplyBuffer[16]; static pMPIDefaultReply_t ReplyMsg = NULL; -/* some private forw protos */ -static SGESimple32_t *kbuf_alloc_2_sgl( int bytes, u32 dir, int *frags, - struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc); -static void kfree_sgl( SGESimple32_t *sgl, dma_addr_t sgl_dma, - struct buflist *buflist, MPT_ADAPTER *ioc); +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* Function to return 0 if the sge Address member is 0 and + * non-zero else. Used in the mpt_do_fw_download routines. + */ +static inline int +mptctl_test_address(MptSge_t *sge) +{ +#ifdef __ia64__ + if ((sge->Address.Low) || (sge->Address.High)) + return 1; + else + return 0; +#else + return sge->Address; +#endif +} /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** @@ -159,7 +210,7 @@ * @ioc: Pointer to MPT adapter * @nonblock: boolean, non-zero if O_NONBLOCK is set * - * All of the mptctl commands can potentially sleep, which is illegal + * All of the ioctl commands can potentially sleep, which is illegal * with a spinlock held, thus we perform mutual exclusion here. * * Returns negative errno on error, or zero for success. @@ -167,16 +218,27 @@ static inline int mptctl_syscall_down(MPT_ADAPTER *ioc, int nonblock) { - dprintk((KERN_INFO MYNAM "::mpt_syscall_down(%p,%d) called\n", ioc, nonblock)); + int rc = 0; + dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down(%p,%d) called\n", ioc, nonblock)); +#if defined(__sparc__) && defined(__sparc_v9__) /*{*/ + if (!nonblock) { + if (down_interruptible(&mptctl_syscall_sem_ioc[ioc->id])) + rc = -ERESTARTSYS; + } else { + rc = -EPERM; + } +#else if (nonblock) { if (down_trylock(&mptctl_syscall_sem_ioc[ioc->id])) - return -EAGAIN; + rc = -EAGAIN; } else { if (down_interruptible(&mptctl_syscall_sem_ioc[ioc->id])) - return -ERESTARTSYS; + rc = -ERESTARTSYS; } - return 0; +#endif + dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down return %d\n", rc)); + return rc; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ @@ -189,18 +251,150 @@ static int mptctl_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply) { - u8 targ; + char *sense_data; + int sz, req_index; + u16 iocStatus; + u8 cmd; + + dctlprintk((MYIOC_s_INFO_FMT ": mptctl_reply()!\n", ioc->name)); + if (req) + cmd = req->u.hdr.Function; + else + return 1; + + if (ioc->ioctl) { + /* If timer is not running, then an error occurred. + * A timeout will call the reset routine to reload the messaging + * queues. + * Main callback will free message and reply frames. + */ + if (ioc->ioctl->status & MPT_IOCTL_STATUS_TIMER_ACTIVE) { + /* Delete this timer + */ + del_timer (&ioc->ioctl->timer); + ioc->ioctl->status &= ~MPT_IOCTL_STATUS_TIMER_ACTIVE; + + /* Set the overall status byte. Good if: + * IOC status is good OR if no reply and a SCSI IO request + */ + if (reply) { + /* Copy the reply frame (which much exist + * for non-SCSI I/O) to the IOC structure. + */ + dctlprintk((MYIOC_s_INFO_FMT ": Copying Reply Frame @%p to IOC!\n", + ioc->name, reply)); + memcpy(ioc->ioctl->ReplyFrame, reply, + MIN(ioc->reply_sz, 4*reply->u.reply.MsgLength)); + ioc->ioctl->status |= MPT_IOCTL_STATUS_RF_VALID; + + /* Set the command status to GOOD if IOC Status is GOOD + * OR if SCSI I/O cmd and data underrun or recovered error. + */ + iocStatus = reply->u.reply.IOCStatus & MPI_IOCSTATUS_MASK; + if (iocStatus == MPI_IOCSTATUS_SUCCESS) + ioc->ioctl->status |= MPT_IOCTL_STATUS_COMMAND_GOOD; + + if ((iocStatus == MPI_IOCSTATUS_SCSI_DATA_UNDERRUN) || + (iocStatus == MPI_IOCSTATUS_SCSI_RECOVERED_ERROR)) { + if ((cmd == MPI_FUNCTION_SCSI_IO_REQUEST) || + (cmd == MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH)) { + ioc->ioctl->status |= MPT_IOCTL_STATUS_COMMAND_GOOD; + } + } + + /* Copy the sense data - if present + */ + if ((cmd == MPI_FUNCTION_SCSI_IO_REQUEST) && + (reply->u.sreply.SCSIState & MPI_SCSI_STATE_AUTOSENSE_VALID)){ + + sz = req->u.scsireq.SenseBufferLength; + req_index = le16_to_cpu(req->u.frame.hwhdr.msgctxu.fld.req_idx); + sense_data = ((u8 *)ioc->sense_buf_pool + (req_index * MPT_SENSE_BUFFER_ALLOC)); + memcpy(ioc->ioctl->sense, sense_data, sz); + ioc->ioctl->status |= MPT_IOCTL_STATUS_SENSE_VALID; + } + } else if ((cmd == MPI_FUNCTION_SCSI_IO_REQUEST) || + (cmd == MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH)) { + ioc->ioctl->status |= MPT_IOCTL_STATUS_COMMAND_GOOD; + } + + /* We are done, issue wake up + */ + ioc->ioctl->wait_done = 1; + wake_up (&mptctl_wait); + } else if (reply && cmd == MPI_FUNCTION_FW_DOWNLOAD) { + /* Two paths to FW DOWNLOAD! */ + // NOTE: Expects/requires non-Turbo reply! + dctlprintk((MYIOC_s_INFO_FMT ":Caching MPI_FUNCTION_FW_DOWNLOAD reply!\n", + ioc->name)); + memcpy(fwReplyBuffer, reply, MIN(sizeof(fwReplyBuffer), 4*reply->u.reply.MsgLength)); + ReplyMsg = (pMPIDefaultReply_t) fwReplyBuffer; + } + } + return 1; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptctl_timer_expired + * + * Call back for timer process. Used only for ioctl functionality. + * + */ +static void mptctl_timer_expired (unsigned long data) +{ + MPT_IOCTL *ioctl = (MPT_IOCTL *) data; + + dctlprintk((KERN_NOTICE MYNAM ": Timer Expired! Host %d\n", + ioctl->ioc->id)); - //dprintk((KERN_DEBUG MYNAM ": Got mptctl_reply()!\n")); + /* Issue a reset for this device. + * The IOC is not responding. + */ + mpt_HardResetHandler(ioctl->ioc, NO_SLEEP); + return; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptctl_ioc_reset + * + * Clean-up functionality. Used only if there has been a + * reload of the FW due. + * + */ +static int +mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) +{ + MPT_IOCTL *ioctl = ioc->ioctl; + dctlprintk((KERN_INFO MYNAM ": IOC %s_reset routed to IOCTL driver!\n", + reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post")); + + if (reset_phase == MPT_IOC_PRE_RESET){ + + /* Someone has called the reset handler to + * do a hard reset. No more replies from the FW. + * Delete the timer. + */ + if (ioctl && (ioctl->status & MPT_IOCTL_STATUS_TIMER_ACTIVE)){ + + /* Delete this timer + */ + del_timer(&ioctl->timer); + } - if (req && req->u.hdr.Function == MPI_FUNCTION_SCSI_IO_REQUEST) { - targ = req->u.scsireq.TargetID & myMAX_T_MASK; - DevIosCount[targ][0]--; - } else if (reply && req && req->u.hdr.Function == MPI_FUNCTION_FW_DOWNLOAD) { - // NOTE: Expects/requires non-Turbo reply! - dprintk((KERN_INFO MYNAM ": Caching MPI_FUNCTION_FW_DOWNLOAD reply!\n")); - memcpy(fwReplyBuffer, reply, MIN(sizeof(fwReplyBuffer), 4*reply->u.reply.MsgLength)); - ReplyMsg = (pMPIDefaultReply_t) fwReplyBuffer; + } else { + /* Set the status and continue IOCTL + * processing. All memory will be free'd + * by originating thread after wake_up is + * called. + */ + if (ioctl && (ioctl->status & MPT_IOCTL_STATUS_TIMER_ACTIVE)){ + ioctl->status = MPT_IOCTL_STATUS_DID_TIMEOUT; + + /* Wake up the calling process + */ + ioctl->wait_done = 1; + wake_up(&mptctl_wait); + } } return 1; @@ -208,7 +402,7 @@ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* - * struct file_operations functionality. + * struct file_operations functionality. * Members: * llseek, write, read, ioctl, open, release */ @@ -234,63 +428,93 @@ static ssize_t mptctl_read(struct file *file, char *buf, size_t count, loff_t *ptr) { + printk(KERN_ERR MYNAM ": ioctl READ not yet supported\n"); return 0; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * MPT ioctl handler + * cmd - specify the particular IOCTL command to be issued + * arg - data specific to the command. Must not be null. */ static int -mpt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +mptctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { - struct mpt_ioctl_sanity *usanity = (struct mpt_ioctl_sanity *) arg; - struct mpt_ioctl_sanity ksanity; + mpt_ioctl_header *uhdr = (mpt_ioctl_header *) arg; + mpt_ioctl_header khdr; int iocnum; unsigned iocnumX; int nonblock = (file->f_flags & O_NONBLOCK); int ret; MPT_ADAPTER *iocp = NULL; - dprintk((KERN_INFO MYNAM "::mpt_ioctl() called\n")); + dctlprintk(("mptctl_ioctl() called\n")); - if (copy_from_user(&ksanity, usanity, sizeof(ksanity))) { - printk(KERN_ERR "%s::mpt_ioctl() @%d - " - "Unable to copy mpt_ioctl_sanity data @ %p\n", - __FILE__, __LINE__, (void*)usanity); + if (copy_from_user(&khdr, uhdr, sizeof(khdr))) { + printk(KERN_ERR "%s::mptctl_ioctl() @%d - " + "Unable to copy mpt_ioctl_header data @ %p\n", + __FILE__, __LINE__, (void*)uhdr); return -EFAULT; } ret = -ENXIO; /* (-6) No such device or address */ - /* Verify intended MPT adapter */ - iocnumX = ksanity.iocnum & 0xFF; + /* Test for Compaq-specific IOCTL's. + */ + if ((cmd == CPQFCTS_GETPCIINFO) || (cmd == CPQFCTS_CTLR_STATUS) || + (cmd == CPQFCTS_GETDRIVER) || (cmd == CPQFCTS_SCSI_PASSTHRU) || + (cmd == CPQFCTS_SCSI_IOCTL_FC_TARGET_ADDRESS)) + return mptctl_compaq_ioctl(file, cmd, arg); + + /* Verify intended MPT adapter - set iocnum and the adapter + * pointer (iocp) + */ + iocnumX = khdr.iocnum & 0xFF; if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || (iocp == NULL)) { - printk(KERN_ERR "%s::mpt_ioctl() @%d - ioc%d not found!\n", + printk(KERN_ERR "%s::mptctl_ioctl() @%d - ioc%d not found!\n", __FILE__, __LINE__, iocnumX); return -ENODEV; } + /* Handle those commands that are just returning + * information stored in the driver. + * These commands should never time out and are unaffected + * by TM and FW reloads. + */ + if (cmd == MPTIOCINFO) { + return mptctl_getiocinfo(arg); + } else if (cmd == MPTTARGETINFO) { + return mptctl_gettargetinfo(arg); + } else if (cmd == MPTTEST) { + return mptctl_readtest(arg); + } else if (cmd == MPTEVENTQUERY) { + return mptctl_eventquery(arg); + } else if (cmd == MPTEVENTENABLE) { + return mptctl_eventenable(arg); + } else if (cmd == MPTEVENTREPORT) { + return mptctl_eventreport(arg); + } else if (cmd == MPTFWREPLACE) { + return mptctl_replace_fw(arg); + } + + /* All of these commands require an interrupt or + * are unknown/illegal. + */ if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) return ret; - dprintk((KERN_INFO MYNAM "::mpt_ioctl() - Using %s\n", iocp->name)); + dctlprintk((MYIOC_s_INFO_FMT ": mptctl_ioctl()\n", iocp->name)); switch(cmd) { - case MPTRWPERF: - ret = mpt_ioctl_rwperf(arg); - break; - case MPTRWPERF_CHK: - ret = mpt_ioctl_rwperf_status(arg); - break; - case MPTRWPERF_RESET: - ret = mpt_ioctl_rwperf_reset(arg); - break; case MPTFWDOWNLOAD: - ret = mpt_ioctl_fw_download(arg); + ret = mptctl_fw_download(arg); + break; + case MPTCOMMAND: + ret = mptctl_mpt_command(arg); break; - case MPTSCSICMD: - ret = mpt_ioctl_scsi_cmd(arg); + case MPTHARDRESET: + ret = mptctl_do_reset(arg); break; default: ret = -EINVAL; @@ -301,6 +525,36 @@ return ret; } +static int mptctl_do_reset(unsigned long arg) +{ + struct mpt_ioctl_diag_reset *urinfo = (struct mpt_ioctl_diag_reset *) arg; + struct mpt_ioctl_diag_reset krinfo; + MPT_ADAPTER *iocp; + + dctlprintk((KERN_INFO "mptctl_do_reset called.\n")); + + if (copy_from_user(&krinfo, urinfo, sizeof(struct mpt_ioctl_diag_reset))) { + printk(KERN_ERR "%s@%d::mptctl_do_reset - " + "Unable to copy mpt_ioctl_diag_reset struct @ %p\n", + __FILE__, __LINE__, (void*)urinfo); + return -EFAULT; + } + + if (mpt_verify_adapter(krinfo.hdr.iocnum, &iocp) < 0) { + printk(KERN_ERR "%s@%d::mptctl_do_reset - ioc%d not found!\n", + __FILE__, __LINE__, krinfo.hdr.iocnum); + return -ENXIO; /* (-6) No such device or address */ + } + + if (mpt_HardResetHandler(iocp, NO_SLEEP) != 0) { + printk (KERN_ERR "%s@%d::mptctl_do_reset - reset failed.\n", + __FILE__, __LINE__); + return -1; + } + + return 0; +} + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ static int mptctl_open(struct inode *inode, struct file *file) { @@ -317,13 +571,29 @@ } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * MPT FW download function. Cast the arg into the mpt_fw_xfer structure. + * This structure contains: iocnum, firmware length (bytes), + * pointer to user space memory where the fw image is stored. + * + * Outputs: None. + * Return: 0 if successful + * -EFAULT if data unavailable + * -ENXIO if no such device + * -EAGAIN if resource problem + * -ENOMEM if no memory for SGE + * -EMLINK if too many chain buffers required + * -EBADRQC if adapter does not support FW download + * -EBUSY if adapter is busy + * -ENOMSG if FW upload returned bad status + */ static int -mpt_ioctl_fw_download(unsigned long arg) +mptctl_fw_download(unsigned long arg) { struct mpt_fw_xfer *ufwdl = (struct mpt_fw_xfer *) arg; struct mpt_fw_xfer kfwdl; - dprintk((KERN_INFO "mpt_ioctl_fwdl called. mptctl_id = %xh\n", mptctl_id)); //tc + dctlprintk((KERN_INFO "mptctl_fwdl called. mptctl_id = %xh\n", mptctl_id)); //tc if (copy_from_user(&kfwdl, ufwdl, sizeof(struct mpt_fw_xfer))) { printk(KERN_ERR "%s@%d::_ioctl_fwdl - " "Unable to copy mpt_fw_xfer struct @ %p\n", @@ -331,44 +601,52 @@ return -EFAULT; } - return mpt_ioctl_do_fw_download(kfwdl.iocnum, kfwdl.bufp, kfwdl.fwlen); + return mptctl_do_fw_download(kfwdl.iocnum, kfwdl.bufp, kfwdl.fwlen); } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* - * MPT FW Download + * FW Download engine. + * Outputs: None. + * Return: 0 if successful + * -EFAULT if data unavailable + * -ENXIO if no such device + * -EAGAIN if resource problem + * -ENOMEM if no memory for SGE + * -EMLINK if too many chain buffers required + * -EBADRQC if adapter does not support FW download + * -EBUSY if adapter is busy + * -ENOMSG if FW upload returned bad status */ static int -mpt_ioctl_do_fw_download(int ioc, char *ufwbuf, size_t fwlen) +mptctl_do_fw_download(int ioc, char *ufwbuf, size_t fwlen) { FWDownload_t *dlmsg; MPT_FRAME_HDR *mf; MPT_ADAPTER *iocp; -// char *fwbuf; -// dma_addr_t fwbuf_dma; - FWDownloadTCSGE_t *fwVoodoo; -// SGEAllUnion_t *fwSgl; + FWDownloadTCSGE_t *ptsge; + MptSge_t *sgl; + MptSge_t *sgOut, *sgIn; + struct buflist *buflist; + struct buflist *bl; + dma_addr_t sgl_dma; int ret; - - SGESimple32_t *sgl; - SGESimple32_t *sgOut, *sgIn; - dma_addr_t sgl_dma; - struct buflist *buflist = NULL; - struct buflist *bl = NULL; - int numfrags = 0; - int maxfrags; - int n = 0; - u32 sgdir; - u32 nib; - int fw_bytes_copied = 0; - u16 iocstat; - int i; - - dprintk((KERN_INFO "mpt_ioctl_do_fwdl called. mptctl_id = %xh.\n", mptctl_id)); - - dprintk((KERN_INFO "DbG: kfwdl.bufp = %p\n", ufwbuf)); - dprintk((KERN_INFO "DbG: kfwdl.fwlen = %d\n", (int)fwlen)); - dprintk((KERN_INFO "DbG: kfwdl.ioc = %04xh\n", ioc)); + int numfrags = 0; + int maxfrags; + int n = 0; + u32 sgdir; + u32 nib; + int fw_bytes_copied = 0; + int i; + int cntdn; + int sge_offset = 0; + u16 iocstat; + + dctlprintk((KERN_INFO "mptctl_do_fwdl called. mptctl_id = %xh.\n", mptctl_id)); + + dctlprintk((KERN_INFO "DbG: kfwdl.bufp = %p\n", ufwbuf)); + dctlprintk((KERN_INFO "DbG: kfwdl.fwlen = %d\n", (int)fwlen)); + dctlprintk((KERN_INFO "DbG: kfwdl.ioc = %04xh\n", ioc)); if ((ioc = mpt_verify_adapter(ioc, &iocp)) < 0) { printk("%s@%d::_ioctl_fwdl - ioc%d not found!\n", @@ -376,11 +654,13 @@ return -ENXIO; /* (-6) No such device or address */ } + /* Valid device. Get a message frame and construct the FW download message. + */ if ((mf = mpt_get_msg_frame(mptctl_id, ioc)) == NULL) return -EAGAIN; dlmsg = (FWDownload_t*) mf; - fwVoodoo = (FWDownloadTCSGE_t *) &dlmsg->SGL; - sgOut = (SGESimple32_t *) (fwVoodoo + 1); + ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL; + sgOut = (MptSge_t *) (ptsge + 1); /* * Construct f/w download request @@ -392,27 +672,36 @@ dlmsg->Reserved1[0] = dlmsg->Reserved1[1] = dlmsg->Reserved1[2] = 0; dlmsg->MsgFlags = 0; - fwVoodoo->Reserved = 0; - fwVoodoo->ContextSize = 0; - fwVoodoo->DetailsLength = 12; - fwVoodoo->Flags = MPI_SGE_FLAGS_TRANSACTION_ELEMENT; - fwVoodoo->Reserved1 = 0; - fwVoodoo->ImageOffset = 0; - fwVoodoo->ImageSize = cpu_to_le32(fwlen); + /* Set up the Transaction SGE. + */ + ptsge->Reserved = 0; + ptsge->ContextSize = 0; + ptsge->DetailsLength = 12; + ptsge->Flags = MPI_SGE_FLAGS_TRANSACTION_ELEMENT; + ptsge->Reserved_0100_Checksum = 0; + ptsge->ImageOffset = 0; + ptsge->ImageSize = cpu_to_le32(fwlen); + + /* Add the SGL + */ /* * Need to kmalloc area(s) for holding firmware image bytes. * But we need to do it piece meal, using a proper * scatter gather list (with 128kB MAX hunks). - * + * * A practical limit here might be # of sg hunks that fit into * a single IOC request frame; 12 or 8 (see below), so: * For FC9xx: 12 x 128kB == 1.5 mB (max) * For C1030: 8 x 128kB == 1 mB (max) * We could support chaining, but things get ugly(ier:) + * + * Set the sge_offset to the start of the sgl (bytes). */ sgdir = 0x04000000; /* IOC will READ from sys mem */ - if ((sgl = kbuf_alloc_2_sgl(fwlen, sgdir, &numfrags, &buflist, &sgl_dma, iocp)) == NULL) + sge_offset = sizeof(MPIHeader_t) + sizeof(FWDownloadTCSGE_t); + if ((sgl = kbuf_alloc_2_sgl(fwlen, sgdir, sge_offset, + &numfrags, &buflist, &sgl_dma, iocp)) == NULL) return -ENOMEM; /* @@ -420,16 +709,19 @@ * for FC9xx f/w image, but calculate max number of sge hunks * we can fit into a request frame, and limit ourselves to that. * (currently no chain support) - * For FC9xx: (128-12-16)/8 = 12.5 = 12 - * For C1030: (96-12-16)/8 = 8.5 = 8 + * maxfrags = (Request Size - FWdownload Size ) / Size of 32 bit SGE + * Request maxfrags + * 128 12 + * 96 8 + * 64 4 */ - maxfrags = (iocp->req_sz - sizeof(MPIHeader_t) - sizeof(FWDownloadTCSGE_t)) / sizeof(SGESimple32_t); + maxfrags = (iocp->req_sz - sizeof(MPIHeader_t) - sizeof(FWDownloadTCSGE_t)) / sizeof(MptSge_t); if (numfrags > maxfrags) { ret = -EMLINK; goto fwdl_out; } - dprintk((KERN_INFO "DbG: sgl buffer = %p, sgfrags = %d\n", sgl, numfrags)); + dctlprintk((KERN_INFO "DbG: sgl buffer = %p, sgfrags = %d\n", sgl, numfrags)); /* * Parse SG list, copying sgl itself, @@ -439,11 +731,17 @@ sgIn = sgl; bl = buflist; for (i=0; i < numfrags; i++) { - nib = (le32_to_cpu(sgIn->FlagsLength) & 0xF0000000) >> 28; - /* skip ignore/chain. */ + + /* Get the SGE type: 0 - TCSGE, 3 - Chain, 1 - Simple SGE + * Skip everything but Simple. If simple, copy from + * user space into kernel space. + * Note: we should not have anything but Simple as + * Chain SGE are illegal. + */ + nib = (le32_to_cpu(sgIn->FlagsLength) & 0x30000000) >> 28; if (nib == 0 || nib == 3) { ; - } else if (sgIn->Address) { + } else if (mptctl_test_address(sgIn)) { *sgOut = *sgIn; n++; if (copy_from_user(bl->kptr, ufwbuf+fw_bytes_copied, bl->len)) { @@ -478,26 +776,24 @@ /* * Wait until the reply has been received */ - { - int foo = 0; - - while (ReplyMsg == NULL) { - if (!(foo%1000000)) { - dprintk((KERN_INFO "DbG::_do_fwdl: " - "In ReplyMsg loop - iteration %d\n", - foo)); //tc - } + for (cntdn=HZ*60, i=1; ReplyMsg == NULL; cntdn--, i++) { + if (!cntdn) { ret = -ETIME; - if (++foo > 60000000) - goto fwdl_out; - mb(); - schedule(); - barrier(); + goto fwdl_out; } + + if (!(i%HZ)) { + dctlprintk((KERN_INFO "DbG::_do_fwdl: " + "In ReplyMsg loop - iteration %d\n", + i)); + } + + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(1); } if (sgl) - kfree_sgl(sgl, sgl_dma, buflist, iocp); + kfree_sgl(sgl, sgl_dma, buflist, iocp); iocstat = le16_to_cpu(ReplyMsg->IOCStatus) & MPI_IOCSTATUS_MASK; if (iocstat == MPI_IOCSTATUS_SUCCESS) { @@ -527,32 +823,46 @@ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* - * NEW rwperf (read/write performance) stuff starts here... + * SGE Allocation routine + * + * Inputs: bytes - number of bytes to be transferred + * sgdir - data direction + * sge_offset - offset (in bytes) from the start of the request + * frame to the first SGE + * ioc - pointer to the mptadapter + * Outputs: frags - number of scatter gather elements + * blp - point to the buflist pointer + * sglbuf_dma - pointer to the (dma) sgl + * Returns: Null if failes + * pointer to the (virtual) sgl if successful. */ - -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -static SGESimple32_t * -kbuf_alloc_2_sgl(int bytes, u32 sgdir, int *frags, +static MptSge_t * +kbuf_alloc_2_sgl(int bytes, u32 sgdir, int sge_offset, int *frags, struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc) { - SGESimple32_t *sglbuf = NULL; - struct buflist *buflist = NULL; + MptSge_t *sglbuf = NULL; /* pointer to array of SGE + * and chain buffers */ + struct buflist *buflist = NULL; /* kernel routine */ + MptSge_t *sgl; + MptChain_t *last_chain = NULL; int numfrags = 0; int fragcnt = 0; int alloc_sz = MIN(bytes,MAX_KMALLOC_SZ); // avoid kernel warning msg! int bytes_allocd = 0; int this_alloc; - SGESimple32_t *sgl; - u32 pa; // phys addr - SGEChain32_t *last_chain = NULL; - SGEChain32_t *old_chain = NULL; + dma_addr_t pa; // phys addr int chaincnt = 0; int i, buflist_ent; int sg_spill = MAX_FRAGS_SPILL1; int dir; + /* initialization */ *frags = 0; *blp = NULL; + + /* Allocate and initialize an array of kernel + * structures for the SG elements. + */ i = MAX_SGL_BYTES / 8; buflist = kmalloc(i, GFP_USER); if (buflist == NULL) @@ -560,6 +870,11 @@ memset(buflist, 0, i); buflist_ent = 0; + /* Allocate a single block of memory to store the sg elements and + * the chain buffers. The calling routine is responsible for + * copying the data in this array into the correct place in the + * request and chain buffers. + */ sglbuf = pci_alloc_consistent(ioc->pcidev, MAX_SGL_BYTES, sglbuf_dma); if (sglbuf == NULL) goto free_and_fail; @@ -569,7 +884,15 @@ else dir = PCI_DMA_FROMDEVICE; + /* At start: + * sgl = sglbuf = point to beginning of sg buffer + * buflist_ent = 0 = first kernel structure + * sg_spill = number of SGE that can be written before the first + * chain element. + * + */ sgl = sglbuf; + sg_spill = ((ioc->req_sz - sge_offset)/ sizeof(MptSge_t)) - 1; while (bytes_allocd < bytes) { this_alloc = MIN(alloc_sz, bytes-bytes_allocd); buflist[buflist_ent].len = this_alloc; @@ -594,7 +917,7 @@ /* Write one SIMPLE sge */ sgl->FlagsLength = cpu_to_le32(0x10000000|sgdir|this_alloc); dma_addr = pci_map_single(ioc->pcidev, buflist[buflist_ent].kptr, this_alloc, dir); - sgl->Address = cpu_to_le32(dma_addr); + cpu_to_leXX(dma_addr, sgl->Address); fragcnt++; numfrags++; @@ -609,24 +932,43 @@ if (fragcnt == sg_spill) { dma_addr_t chain_link; - if (last_chain != NULL) - last_chain->NextChainOffset = 0x1E; - - fragcnt = 0; - sg_spill = MAX_FRAGS_SPILL2; + /* If there is a chain element, set the offset + * (in 32 bit words) to the next chain element. + * fragcnt = # sge = 8 bytes = 2 words + * + * Set the length of the chain element (bytes) + * This includes the size of the next chain element. + * + * We are now done with last_chain and the previous + * buffer. + */ + if (last_chain != NULL) { + last_chain->NextChainOffset = fragcnt * 2; + last_chain->Length = cpu_to_le16((fragcnt+1) * 8); + } - /* fixup previous SIMPLE sge */ + /* Finish the current buffer: + * - add the LE bit to last sge + * - add the chain element + */ sgl[-1].FlagsLength |= cpu_to_le32(0x80000000); chain_link = (*sglbuf_dma) + ((u8 *)(sgl+1) - (u8 *)sglbuf); /* Write one CHAIN sge */ - sgl->FlagsLength = cpu_to_le32(0x30000080); - sgl->Address = cpu_to_le32(chain_link); +// sgl->FlagsLength = cpu_to_le32(0x30000080); + sgl->FlagsLength = cpu_to_le32(0x30000000); + cpu_to_leXX(chain_link, sgl->Address); + + /* Reset everything for the next SGE series, + * save a ptr to the chain element in last_chain + */ + fragcnt = 0; +// sg_spill = MAX_FRAGS_SPILL2; + sg_spill = (ioc->req_sz / sizeof(MptSge_t)) - 1; - old_chain = last_chain; - last_chain = (SGEChain32_t*)sgl; + last_chain = (MptChain_t*)sgl; chaincnt++; numfrags++; sgl++; @@ -646,18 +988,19 @@ /* Last sge fixup: set LE+eol+eob bits */ sgl[-1].FlagsLength |= cpu_to_le32(0xC1000000); - /* Chain fixup needed? */ - if (last_chain != NULL && fragcnt < 16) + /* Chain fixup needed? */ /* SteveR CHECKME!!! */ +// if (last_chain != NULL && fragcnt < 16) + if (last_chain != NULL) last_chain->Length = cpu_to_le16(fragcnt * 8); *frags = numfrags; *blp = buflist; - dprintk((KERN_INFO MYNAM "-SG: kbuf_alloc_2_sgl() - " + dctlprintk((KERN_INFO MYNAM "-SG: kbuf_alloc_2_sgl() - " "%d SG frags generated! (%d CHAIN%s)\n", numfrags, chaincnt, chaincnt>1?"s":"")); - dprintk((KERN_INFO MYNAM "-SG: kbuf_alloc_2_sgl() - " + dctlprintk((KERN_INFO MYNAM "-SG: kbuf_alloc_2_sgl() - " "last (big) alloc_sz=%d\n", alloc_sz)); @@ -675,7 +1018,7 @@ if ((le32_to_cpu(sglbuf[i].FlagsLength) >> 24) == 0x30) continue; - dma_addr = le32_to_cpu(sglbuf[i].Address); + leXX_to_cpu(dma_addr, sglbuf[i].Address); kptr = buflist[i].kptr; len = buflist[i].len; @@ -688,16 +1031,19 @@ } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * Routine to free the SGL elements. + */ static void -kfree_sgl(SGESimple32_t *sgl, dma_addr_t sgl_dma, struct buflist *buflist, MPT_ADAPTER *ioc) +kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, struct buflist *buflist, MPT_ADAPTER *ioc) { - SGESimple32_t *sg = sgl; + MptSge_t *sg = sgl; struct buflist *bl = buflist; u32 nib; int dir; int n = 0; - if (le32_to_cpu(sg->FlagsLength) & 0x04000000) + if ((le32_to_cpu(sg->FlagsLength) & 0x04000000)) dir = PCI_DMA_TODEVICE; else dir = PCI_DMA_FROMDEVICE; @@ -707,12 +1053,12 @@ /* skip ignore/chain. */ if (nib == 0 || nib == 3) { ; - } else if (sg->Address) { + } else if (mptctl_test_address(sg)) { dma_addr_t dma_addr; void *kptr; int len; - dma_addr = le32_to_cpu(sg->Address); + leXX_to_cpu(dma_addr, sg->Address); kptr = bl->kptr; len = bl->len; pci_unmap_single(ioc->pcidev, dma_addr, len, dir); @@ -725,12 +1071,12 @@ } /* we're at eob! */ - if (sg->Address) { + if (mptctl_test_address(sg)) { dma_addr_t dma_addr; void *kptr; int len; - dma_addr = le32_to_cpu(sg->Address); + leXX_to_cpu(dma_addr, sg->Address); kptr = bl->kptr; len = bl->len; pci_unmap_single(ioc->pcidev, dma_addr, len, dir); @@ -740,392 +1086,1686 @@ pci_free_consistent(ioc->pcidev, MAX_SGL_BYTES, sgl, sgl_dma); kfree(buflist); - dprintk((KERN_INFO MYNAM "-SG: Free'd 1 SGL buf + %d kbufs!\n", n)); + dctlprintk((KERN_INFO MYNAM "-SG: Free'd 1 SGL buf + %d kbufs!\n", n)); } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mptctl_getiocinfo - Query the host adapter for IOC information. + * @arg: User space argument + * + * Outputs: None. + * Return: 0 if successful + * -EFAULT if data unavailable + * -ENODEV if no such device/adapter + */ static int -mpt_ioctl_rwperf_init(struct mpt_raw_r_w *dest, unsigned long src, - char *caller, MPT_ADAPTER **iocpp) +mptctl_getiocinfo (unsigned long arg) { - char *myname = "_rwperf_init()"; - int ioc; + struct mpt_ioctl_iocinfo *uarg = (struct mpt_ioctl_iocinfo *) arg; + struct mpt_ioctl_iocinfo karg; + MPT_ADAPTER *ioc; + struct pci_dev *pdev; + struct Scsi_Host *sh; + MPT_SCSI_HOST *hd; + int iocnum; + int numDevices = 0; + unsigned int max_id; + int ii; + int port; + u8 revision; + + dctlprintk((": mptctl_getiocinfo called.\n")); + if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_iocinfo))) { + printk(KERN_ERR "%s@%d::mptctl_getiocinfo - " + "Unable to read in mpt_ioctl_iocinfo struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } - /* get copy of structure passed from user space */ - if (copy_from_user(dest, (void*)src, sizeof(*dest))) { - printk(KERN_ERR MYNAM "::%s() @%d - Can't copy mpt_raw_r_w data @ %p\n", - myname, __LINE__, (void*)src); - return -EFAULT; /* (-14) Bad address */ - } else { - dprintk((KERN_INFO MYNAM "-perf: PerfInfo.{ioc,targ,qd,iters,nblks}" - ": %d %d %d %d %d\n", - dest->iocnum, dest->target, - (int)dest->qdepth, dest->iters, dest->nblks )); - dprintk((KERN_INFO MYNAM "-perf: PerfInfo.{cache,skip,range,rdwr,seqran}" - ": %d %d %d %d %d\n", - dest->cache_sz, dest->skip, dest->range, - dest->rdwr, dest->seqran )); - - /* Get the MPT adapter id. */ - if ((ioc = mpt_verify_adapter(dest->iocnum, iocpp)) < 0) { - printk(KERN_ERR MYNAM "::%s() @%d - ioc%d not found!\n", - myname, __LINE__, dest->iocnum); - return -ENXIO; /* (-6) No such device or address */ - } else { - dprintk((MYNAM "-perf: %s using mpt/ioc%x, target %02xh\n", - caller, dest->iocnum, dest->target)); - } + if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; } - return ioc; -} + /* Verify the data transfer size is correct. + * Ignore the port setting. + */ + if (karg.hdr.maxDataSize != sizeof(struct mpt_ioctl_iocinfo)) { + printk(KERN_ERR "%s@%d::mptctl_getiocinfo - " + "Structure size mismatch. Command not completed.\n", + __FILE__, __LINE__); + return -EFAULT; + } -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ + /* Fill in the data and return the structure to the calling + * program + */ + if (ioc->chip_type == C1030) + karg.adapterType = MPT_IOCTL_INTERFACE_SCSI; + else + karg.adapterType = MPT_IOCTL_INTERFACE_FC; -/* Treat first N blocks of disk as sacred! */ -#define SACRED_BLOCKS 100 - -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -static int -mpt_ioctl_rwperf(unsigned long arg) -{ - struct mpt_raw_r_w kPerfInfo; - /* NOTE: local copy, on stack==KERNEL_SPACE! */ - u8 target, targetM; - u8 lun, lunM; - u8 scsiop; - int qdepth; - int iters; - int cache_sz; - u32 xferbytes; - u32 scsidir; - u32 qtag; - u32 scsictl; - u32 sgdir; - u32 blkno; - u32 sbphys; - SGESimple32_t *sgl; - dma_addr_t sgl_dma; - struct buflist *buflist; - SGESimple32_t *sgOut, *sgIn; - int numfrags; - u32 *msg; - int i; - int ioc; - MPT_FRAME_HDR *mf; - MPT_ADAPTER *iocp; - int sgfragcpycnt; - int blklo, blkhi; - u8 nextchainoffset; - u8 *SenseBuf; - dma_addr_t SenseBufDMA; - char *myname = "_rwperf()"; - - dprintk((KERN_INFO "%s - starting...\n", myname)); - - /* Validate target device */ - if ((ioc = mpt_ioctl_rwperf_init(&kPerfInfo, arg, myname, &iocp)) < 0) - return ioc; - - /* Allocate DMA'able memory for the sense buffer. */ - SenseBuf = pci_alloc_consistent(iocp->pcidev, 256, &SenseBufDMA); - - /* set perf parameters from input */ - target = kPerfInfo.target & 0x0FF; - targetM = target & myMAX_T_MASK; - lun = kPerfInfo.lun & 0x1F; // LUN=31 max - lunM = lun & myMAX_L_MASK; - qdepth = kPerfInfo.qdepth; - iters = kPerfInfo.iters; - xferbytes = ((u32)kPerfInfo.nblks)<<9; - - DevInUse[targetM][lunM] = 1; - DevIosCount[targetM][lunM] = 0; - - cache_sz = kPerfInfo.cache_sz * 1024; // CacheSz in kB! - - /* ToDo: */ - /* get capacity (?) */ - - - // pre-build, one time, everything we can for speed in the loops below... - - scsiop = 0x28; // default to SCSI READ! - scsidir = MPI_SCSIIO_CONTROL_READ; // DATA IN (host<--ioc<--dev) - // 02000000 - qtag = MPI_SCSIIO_CONTROL_SIMPLEQ; // 00000000 - - if (xferbytes == 0) { - // Do 0-byte READ!!! - // IMPORTANT! Need to set no SCSI DIR for this! - scsidir = MPI_SCSIIO_CONTROL_NODATATRANSFER; - } - - scsictl = scsidir | qtag; - - /* - * Set sgdir for DMA transfer. - */ -// sgdir = 0x04000000; // SCSI WRITE - sgdir = 0x00000000; // SCSI READ - - if ((sgl = kbuf_alloc_2_sgl(MAX(512,xferbytes), sgdir, &numfrags, &buflist, &sgl_dma, iocp)) == NULL) - return -ENOMEM; - - sgfragcpycnt = MIN(10,numfrags); - nextchainoffset = 0; - if (numfrags > 10) - nextchainoffset = 0x1E; - - sbphys = SenseBufDMA; - - rwperf_reset = 0; - -// do { // target-loop - - blkno = SACRED_BLOCKS; // Treat first N blocks as sacred! - // FIXME! Skip option - blklo = blkno; - blkhi = blkno; - - do { // inner-loop - - while ((mf = mpt_get_msg_frame(mptctl_id, ioc)) == NULL) { - mb(); - schedule(); - barrier(); - } - msg = (u32*)mf; - - /* Start piecing the SCSIIORequest together */ - msg[0] = 0x00000000 | nextchainoffset<<16 | target; - msg[1] = 0x0000FF0A; // 255 sense bytes, 10-byte CDB! - msg[3] = lun << 8; - msg[4] = 0; - msg[5] = scsictl; - - // 16 bytes of CDB @ msg[6,7,8,9] are below... - - msg[6] = ( ((blkno & 0xFF000000) >> 8) - | ((blkno & 0x00FF0000) << 8) - | scsiop ); - msg[7] = ( (((u32)kPerfInfo.nblks & 0x0000FF00) << 16) - | ((blkno & 0x000000FF) << 8) - | ((blkno & 0x0000FF00) >> 8) ); - msg[8] = (kPerfInfo.nblks & 0x00FF); - msg[9] = 0; - - msg[10] = xferbytes; - -// msg[11] = 0xD0000100; -// msg[12] = sbphys; -// msg[13] = 0; - msg[11] = sbphys; - - // Copy the SGL... - if (xferbytes) { - sgOut = (SGESimple32_t*)&msg[12]; - sgIn = sgl; - for (i=0; i < sgfragcpycnt; i++) - *sgOut++ = *sgIn++; - } - - // fubar! QueueDepth issue!!! - while ( !rwperf_reset - && (DevIosCount[targetM][lunM] >= MIN(qdepth,64)) ) - { - mb(); - schedule(); - barrier(); - } - -// blkno += kPerfInfo.nblks; -// EXP Stuff! -// Try optimizing to certain cache size for the target! -// by keeping blkno within cache range if at all possible -#if 0 - if ( cache_sz - && ((2 * kPerfInfo.nblks) <= (cache_sz>>9)) - && ((blkno + kPerfInfo.nblks) > ((cache_sz>>9) + SACRED_BLOCKS)) ) - blkno = SACRED_BLOCKS; - else - blkno += kPerfInfo.nblks; -#endif -// Ok, cheat! - if (cache_sz && ((blkno + kPerfInfo.nblks) > ((cache_sz>>9) + SACRED_BLOCKS)) ) - blkno = SACRED_BLOCKS; - else - blkno += kPerfInfo.nblks; + port = karg.hdr.port; + + karg.port = port; + pdev = (struct pci_dev *) ioc->pcidev; - if (blkno > blkhi) - blkhi = blkno; + karg.pciId = pdev->device; + pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision); + karg.hwRev = revision; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) + karg.subSystemDevice = pdev->subsystem_device; + karg.subSystemVendor = pdev->subsystem_vendor; +#endif - DevIosCount[targetM][lunM]++; + /* Get number of devices + */ + if ( (sh = ioc->sh) != NULL) { + + /* sh->max_id = maximum target ID + 1 + */ + max_id = sh->max_id - 1; + hd = (MPT_SCSI_HOST *) sh->hostdata; + + /* Check all of the target structures and + * keep a counter. + */ + if (hd && hd->Targets) { + for (ii = 0; ii <= max_id; ii++) { + if (hd->Targets[ii]) + numDevices++; + } + } + } + karg.numDevices = numDevices; - /* - * Finally, post the request - */ - mpt_put_msg_frame(mptctl_id, ioc, mf); + /* Set the BIOS and FW Version + */ + karg.FWVersion = ioc->facts.FWVersion.Word; + karg.BIOSVersion = ioc->biosVersion; + /* Set the Version Strings. + */ + strncpy (karg.driverVersion, MPT_LINUX_PACKAGE_NAME, MPT_IOCTL_VERSION_LENGTH); - /* let linux breath! */ - mb(); - schedule(); - barrier(); + karg.busChangeEvent = 0; + karg.hostId = ioc->pfacts[port].PortSCSIID; + karg.rsvd[0] = karg.rsvd[1] = 0; - //dprintk((KERN_DEBUG MYNAM "-perf: inner-loop, cnt=%d\n", iters)); + /* Copy the data from kernel memory to user memory + */ + if (copy_to_user((char *)arg, &karg, + sizeof(struct mpt_ioctl_iocinfo))) { + printk(KERN_ERR "%s@%d::mptctl_getiocinfo - " + "Unable to write out mpt_ioctl_iocinfo struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } - } while ((--iters > 0) && !rwperf_reset); + return 0; +} - dprintk((KERN_INFO MYNAM "-perf: DbG: blklo=%d, blkhi=%d\n", blklo, blkhi)); - dprintk((KERN_INFO MYNAM "-perf: target-loop, thisTarget=%d\n", target)); +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mptctl_gettargetinfo - Query the host adapter for target information. + * @arg: User space argument + * + * Outputs: None. + * Return: 0 if successful + * -EFAULT if data unavailable + * -ENODEV if no such device/adapter + */ +static int +mptctl_gettargetinfo (unsigned long arg) +{ + struct mpt_ioctl_targetinfo *uarg = (struct mpt_ioctl_targetinfo *) arg; + struct mpt_ioctl_targetinfo karg; + MPT_ADAPTER *ioc; + struct Scsi_Host *sh; + MPT_SCSI_HOST *hd; + char *pmem; + int *pdata; + int iocnum; + int numDevices = 0; + unsigned int max_id; + int ii, jj, lun; + int maxWordsLeft; + int numBytes; + u8 port; + + dctlprintk(("mptctl_gettargetinfo called.\n")); + if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_targetinfo))) { + printk(KERN_ERR "%s@%d::mptctl_gettargetinfo - " + "Unable to read in mpt_ioctl_targetinfo struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } -// // TEMPORARY! -// target = 0; + if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; + } -// } while (target); + /* Get the port number and set the maximum number of bytes + * in the returned structure. + * Ignore the port setting. + */ + numBytes = karg.hdr.maxDataSize - sizeof(mpt_ioctl_header); + maxWordsLeft = numBytes/sizeof(int); + port = karg.hdr.port; + + if (maxWordsLeft <= 0) { + printk(KERN_ERR "%s::mptctl_gettargetinfo() @%d - no memory available!\n", + __FILE__, __LINE__); + return -ENOMEM; + } + /* Fill in the data and return the structure to the calling + * program + */ - if (DevIosCount[targetM][lunM]) { - dprintk((KERN_INFO " DbG: DevIosCount[%d][%d]=%d\n", - targetM, lunM, DevIosCount[targetM][lunM])); - } + /* struct mpt_ioctl_targetinfo does not contain sufficient space + * for the target structures so when the IOCTL is called, there is + * not sufficient stack space for the structure. Allocate memory, + * populate the memory, copy back to the user, then free memory. + * targetInfo format: + * bits 31-24: reserved + * 23-16: LUN + * 15- 8: Bus Number + * 7- 0: Target ID + */ + pmem = kmalloc(numBytes, GFP_KERNEL); + if (pmem == NULL) { + printk(KERN_ERR "%s::mptctl_gettargetinfo() @%d - no memory available!\n", + __FILE__, __LINE__); + return -ENOMEM; + } + memset(pmem, 0, numBytes); + pdata = (int *) pmem; - while (DevIosCount[targetM][lunM]) { - //dprintk((KERN_DEBUG " DbG: Waiting... DevIosCount[%d][%d]=%d\n", - // targetM, lunM, DevIosCount[targetM][lunM])); - mb(); - schedule(); - barrier(); - } - DevInUse[targetM][lunM] = 0; + /* Get number of devices + */ + if ( (sh = ioc->sh) != NULL) { + + max_id = sh->max_id - 1; + hd = (MPT_SCSI_HOST *) sh->hostdata; + + /* Check all of the target structures. + * Save the Id and increment the counter, + * if ptr non-null. + * sh->max_id = maximum target ID + 1 + */ + if (hd && hd->Targets) { + ii = 0; + while (ii <= max_id) { + if (hd->Targets[ii]) { + for (jj = 0; jj <= MPT_LAST_LUN; jj++) { + lun = (1 << jj); + if (hd->Targets[ii]->luns & lun) { + numDevices++; + *pdata = (jj << 16) | ii; + --maxWordsLeft; + + pdata++; + + if (maxWordsLeft <= 0) { + break; + } + } + } + } + ii++; + } + } + } + karg.numDevices = numDevices; - pci_free_consistent(iocp->pcidev, 256, SenseBuf, SenseBufDMA); + /* Copy part of the data from kernel memory to user memory + */ + if (copy_to_user((char *)arg, &karg, + sizeof(struct mpt_ioctl_targetinfo))) { + printk(KERN_ERR "%s@%d::mptctl_gettargetinfo - " + "Unable to write out mpt_ioctl_targetinfo struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + kfree(pmem); + return -EFAULT; + } - if (sgl) - kfree_sgl(sgl, sgl_dma, buflist, iocp); + /* Copy the remaining data from kernel memory to user memory + */ + if (copy_to_user((char *) uarg->targetInfo, pmem, numBytes)) { + printk(KERN_ERR "%s@%d::mptctl_gettargetinfo - " + "Unable to write out mpt_ioctl_targetinfo struct @ %p\n", + __FILE__, __LINE__, (void*)pdata); + kfree(pmem); + return -EFAULT; + } - dprintk((KERN_INFO " *** done ***\n")); + kfree(pmem); - return 0; + return 0; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* MPT IOCTL Test function. + * + * Outputs: None. + * Return: 0 if successful + * -EFAULT if data unavailable + * -ENODEV if no such device/adapter + */ static int -mpt_ioctl_rwperf_status(unsigned long arg) +mptctl_readtest (unsigned long arg) { - struct mpt_raw_r_w kPerfInfo; - /* NOTE: local copy, on stack==KERNEL_SPACE! */ - MPT_ADAPTER *iocp; - int ioc; -// u8 targ; -// u8 lun; - int T, L; - char *myname = "_rwperf_status()"; + struct mpt_ioctl_test *uarg = (struct mpt_ioctl_test *) arg; + struct mpt_ioctl_test karg; + MPT_ADAPTER *ioc; + int iocnum; + dctlprintk(("mptctl_readtest called.\n")); + if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) { + printk(KERN_ERR "%s@%d::mptctl_readtest - " + "Unable to read in mpt_ioctl_test struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } - dprintk((KERN_INFO "%s - starting...\n", myname)); + if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_readtest() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; + } - /* Get a pointer to the MPT adapter. */ - if ((ioc = mpt_ioctl_rwperf_init(&kPerfInfo, arg, myname, &iocp)) < 0) - return ioc; + /* Fill in the data and return the structure to the calling + * program + */ - /* set perf parameters from input */ -// targ = kPerfInfo.target & 0xFF; -// lun = kPerfInfo.lun & 0x1F; +#ifdef MFCNT + karg.chip_type = ioc->mfcnt; +#else + karg.chip_type = ioc->chip_type; +#endif + strncpy (karg.name, ioc->name, MPT_MAX_NAME); + strncpy (karg.product, ioc->prod_name, MPT_PRODUCT_LENGTH); - for (T=0; T < myMAX_TARGETS; T++) - for (L=0; L < myMAX_LUNS; L++) - if (DevIosCount[T][L]) { - printk(KERN_INFO "%s: ioc%d->00:%02x:%02x" - ", IosCnt=%d\n", - myname, ioc, T, L, DevIosCount[T][L] ); - } + /* Copy the data from kernel memory to user memory + */ + if (copy_to_user((char *)arg, &karg, sizeof(struct mpt_ioctl_test))) { + printk(KERN_ERR "%s@%d::mptctl_readtest - " + "Unable to write out mpt_ioctl_test struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } return 0; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mptctl_eventquery - Query the host adapter for the event types + * that are being logged. + * @arg: User space argument + * + * Outputs: None. + * Return: 0 if successful + * -EFAULT if data unavailable + * -ENODEV if no such device/adapter + */ static int -mpt_ioctl_rwperf_reset(unsigned long arg) +mptctl_eventquery (unsigned long arg) { - struct mpt_raw_r_w kPerfInfo; - /* NOTE: local copy, on stack==KERNEL_SPACE! */ - MPT_ADAPTER *iocp; - int ioc; -// u8 targ; -// u8 lun; - int T, L; - int i; - char *myname = "_rwperf_reset()"; - - dprintk((KERN_INFO "%s - starting...\n", myname)); - - /* Get MPT adapter id. */ - if ((ioc = mpt_ioctl_rwperf_init(&kPerfInfo, arg, myname, &iocp)) < 0) - return ioc; - - /* set perf parameters from input */ -// targ = kPerfInfo.target & 0xFF; -// lun = kPerfInfo.lun & 0x1F; - - rwperf_reset = 1; - for (i=0; i < 1000000; i++) { - mb(); - schedule(); - barrier(); - } - rwperf_reset = 0; - - for (T=0; T < myMAX_TARGETS; T++) - for (L=0; L < myMAX_LUNS; L++) - if (DevIosCount[T][L]) { - printk(KERN_INFO "%s: ioc%d->00:%02x:%02x, " - "IosCnt RESET! (from %d to 0)\n", - myname, ioc, T, L, DevIosCount[T][L] ); - DevIosCount[T][L] = 0; - DevInUse[T][L] = 0; - } + struct mpt_ioctl_eventquery *uarg = (struct mpt_ioctl_eventquery *) arg; + struct mpt_ioctl_eventquery karg; + MPT_ADAPTER *ioc; + int iocnum; + + dctlprintk(("mptctl_eventquery called.\n")); + if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) { + printk(KERN_ERR "%s@%d::mptctl_eventquery - " + "Unable to read in mpt_ioctl_eventquery struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_eventquery() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; + } + karg.eventEntries = ioc->eventLogSize; + karg.eventTypes = ioc->eventTypes; + + /* Copy the data from kernel memory to user memory + */ + if (copy_to_user((char *)arg, &karg, sizeof(struct mpt_ioctl_eventquery))) { + printk(KERN_ERR "%s@%d::mptctl_eventquery - " + "Unable to write out mpt_ioctl_eventquery struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } return 0; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ static int -mpt_ioctl_scsi_cmd(unsigned long arg) +mptctl_eventenable (unsigned long arg) { - return -ENOSYS; + struct mpt_ioctl_eventenable *uarg = (struct mpt_ioctl_eventenable *) arg; + struct mpt_ioctl_eventenable karg; + MPT_ADAPTER *ioc; + int iocnum; + + dctlprintk(("mptctl_eventenable called.\n")); + if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) { + printk(KERN_ERR "%s@%d::mptctl_eventenable - " + "Unable to read in mpt_ioctl_eventenable struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_eventenable() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; + } + + if (ioc->events == NULL) { + /* Have not yet allocated memory - do so now. + */ + int sz = MPTCTL_EVENT_LOG_SIZE * sizeof(MPT_IOCTL_EVENTS); + ioc->events = kmalloc(sz, GFP_KERNEL); + if (ioc->events == NULL) { + printk(KERN_ERR MYNAM ": ERROR - Insufficient memory to add adapter!\n"); + return -ENOMEM; + } + memset(ioc->events, 0, sz); + ioc->alloc_total += sz; + + ioc->eventLogSize = MPTCTL_EVENT_LOG_SIZE; + ioc->eventContext = 0; + } + + /* Update the IOC event logging flag. + */ + ioc->eventTypes = karg.eventTypes; + + return 0; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +static int +mptctl_eventreport (unsigned long arg) +{ + struct mpt_ioctl_eventreport *uarg = (struct mpt_ioctl_eventreport *) arg; + struct mpt_ioctl_eventreport karg; + MPT_ADAPTER *ioc; + int iocnum; + int numBytes, maxEvents, max; + + dctlprintk(("mptctl_eventreport called.\n")); + if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) { + printk(KERN_ERR "%s@%d::mptctl_eventreport - " + "Unable to read in mpt_ioctl_eventreport struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,51) -#define owner_THIS_MODULE owner: THIS_MODULE, -#else -#define owner_THIS_MODULE -#endif + if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_eventreport() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; + } -static struct file_operations mptctl_fops = { - owner_THIS_MODULE - llseek: no_llseek, - read: mptctl_read, - write: mptctl_write, - ioctl: mpt_ioctl, - open: mptctl_open, - release: mptctl_release, -}; + numBytes = karg.hdr.maxDataSize - sizeof(mpt_ioctl_header); + maxEvents = numBytes/sizeof(MPT_IOCTL_EVENTS); -static struct miscdevice mptctl_miscdev = { - MPT_MINOR, - MYNAM, - &mptctl_fops -}; -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ + max = ioc->eventLogSize < maxEvents ? ioc->eventLogSize : maxEvents; -#if defined(__sparc__) && defined(__sparc_v9__) /*{*/ + /* If fewer than 1 event is requested, there must have + * been some type of error. + */ + if ((max < 1) || !ioc->events) + return -ENODATA; -/* The dynamic ioctl32 compat. registry only exists in >2.3.x sparc64 kernels */ + /* Copy the data from kernel memory to user memory + */ + numBytes = max * sizeof(MPT_IOCTL_EVENTS); + if (copy_to_user((char *) uarg->eventData, ioc->events, numBytes)) { + printk(KERN_ERR "%s@%d::mptctl_eventreport - " + "Unable to write out mpt_ioctl_eventreport struct @ %p\n", + __FILE__, __LINE__, (void*)ioc->events); + return -EFAULT; + } + + return 0; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +static int +mptctl_replace_fw (unsigned long arg) +{ + struct mpt_ioctl_replace_fw *uarg = (struct mpt_ioctl_replace_fw *) arg; + struct mpt_ioctl_replace_fw karg; + MPT_ADAPTER *ioc; + int iocnum; + u8 *mem = NULL; + dma_addr_t mem_dma; + int oldFwSize, newFwSize; + + dctlprintk(("mptctl_replace_fw called.\n")); + if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) { + printk(KERN_ERR "%s@%d::mptctl_replace_fw - " + "Unable to read in mpt_ioctl_replace_fw struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_replace_fw() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; + } + + /* If not caching FW, return 0 + */ + if ((ioc->FWImage == NULL) && (ioc->alt_ioc) && (ioc->alt_ioc->FWImage == NULL)) { + return 0; + } + + + /* Allocate memory for the new FW image + */ + newFwSize = karg.newImageSize; + mem = pci_alloc_consistent(ioc->pcidev, newFwSize, &mem_dma); + if (mem == NULL) + return -ENOMEM; + + ioc->alloc_total += newFwSize; + + /* Copy the data from user memory to kernel space + */ + if (copy_from_user(mem, uarg->newImage, newFwSize)) { + printk(KERN_ERR "%s@%d::mptctl_replace_fw - " + "Unable to read in mpt_ioctl_replace_fw image @ %p\n", + __FILE__, __LINE__, (void*)uarg); + pci_free_consistent(ioc->pcidev, newFwSize, mem, mem_dma); + ioc->alloc_total -= newFwSize; + return -EFAULT; + } + + /* Free the old FW image + */ + oldFwSize = ioc->facts.FWImageSize; + if (ioc->FWImage) { + pci_free_consistent(ioc->pcidev, oldFwSize, ioc->FWImage, ioc->FWImage_dma); + ioc->alloc_total -= oldFwSize; + ioc->FWImage = mem; + ioc->FWImage_dma = mem_dma; + + } else if ((ioc->alt_ioc) && (ioc->alt_ioc->FWImage)) { + pci_free_consistent(ioc->pcidev, oldFwSize, ioc->alt_ioc->FWImage, ioc->alt_ioc->FWImage_dma); + ioc->alloc_total -= oldFwSize; + ioc->alt_ioc->FWImage = mem; + ioc->alt_ioc->FWImage_dma = mem_dma; + } + + /* Update IOCFactsReply + */ + ioc->facts.FWImageSize = newFwSize; + if (ioc->alt_ioc) + ioc->alt_ioc->facts.FWImageSize = newFwSize; + + return 0; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* MPT IOCTL MPTCOMMAND function. + * Cast the arg into the mpt_ioctl_mpt_command structure. + * + * Outputs: None. + * Return: 0 if successful + * -EBUSY if previous command timout and IOC reset is not complete. + * -EFAULT if data unavailable + * -ENODEV if no such device/adapter + * -ETIME if timer expires + * -ENOMEM if memory allocation error + */ +static int +mptctl_mpt_command (unsigned long arg) +{ + struct mpt_ioctl_command *uarg = (struct mpt_ioctl_command *) arg; + struct mpt_ioctl_command karg; + MPT_ADAPTER *ioc; + int iocnum; + int rc; + + dctlprintk(("mptctl_command called.\n")); + + if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_command))) { + printk(KERN_ERR "%s@%d::mptctl_mpt_command - " + "Unable to read in mpt_ioctl_command struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_mpt_command() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; + } + + rc = mptctl_do_mpt_command (karg, (char *) &uarg->MF, 0); + + return rc; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* Worker routine for the IOCTL MPTCOMMAND and MPTCOMMAND32 (sparc) commands. + * + * Outputs: None. + * Return: 0 if successful + * -EBUSY if previous command timout and IOC reset is not complete. + * -EFAULT if data unavailable + * -ENODEV if no such device/adapter + * -ETIME if timer expires + * -ENOMEM if memory allocation error + */ +static int +mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local) +{ + MPT_ADAPTER *ioc; + MPT_FRAME_HDR *mf = NULL; + MPIHeader_t *hdr; + MptSge_t *psge; + MptSge_t *this_sge = NULL; + MptSge_t *sglbuf = NULL; + struct buflist bufIn; /* data In buffer */ + struct buflist bufOut; /* data Out buffer */ + dma_addr_t sglbuf_dma; + dma_addr_t dma_addr; + int dir; /* PCI data direction */ + int sgSize = 0; /* Num SG elements */ + int this_alloc; + int iocnum, flagsLength; + int sz, rc = 0; + int msgContext; + u16 req_idx; + + dctlprintk(("mptctl_do_mpt_command called.\n")); + + if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; + } + if (!ioc->ioctl) { + printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " + "No memory available during driver init.\n", + __FILE__, __LINE__); + return -ENOMEM; + } else if (ioc->ioctl->status & MPT_IOCTL_STATUS_DID_TIMEOUT) { + printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " + "Busy with IOC Reset \n", __FILE__, __LINE__); + return -EBUSY; + } + + /* Verify that the final request frame will not be too large. + */ + sz = karg.dataSgeOffset * 4; + if (karg.dataInSize > 0) + sz += sizeof (MptSge_t); + if (karg.dataOutSize > 0) + sz += sizeof (MptSge_t); + + if ( sz > ioc->req_sz) { + printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " + "Request frame too large (%d) maximum (%d)\n", + __FILE__, __LINE__, sz, ioc->req_sz); + return -EFAULT; + } + + /* Get a free request frame and save the message context. + */ + if ((mf = mpt_get_msg_frame(mptctl_id, ioc->id)) == NULL) + return -EAGAIN; + + hdr = (MPIHeader_t *) mf; + msgContext = le32_to_cpu(hdr->MsgContext); + req_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); + + /* Copy the request frame + * Reset the saved message context. + */ + if (local) { + /* Request frame in kernel space + */ + memcpy((char *)mf, (char *) mfPtr, karg.dataSgeOffset * 4); + } else { + /* Request frame in user space + */ + if (copy_from_user((char *)mf, (char *) mfPtr, + karg.dataSgeOffset * 4)){ + printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " + "Unable to read MF from mpt_ioctl_command struct @ %p\n", + __FILE__, __LINE__, (void*)mfPtr); + rc = -EFAULT; + goto done_free_mem; + } + } + hdr->MsgContext = cpu_to_le32(msgContext); + + + /* Verify that this request is allowed. + */ + switch (hdr->Function) { + case MPI_FUNCTION_IOC_FACTS: + case MPI_FUNCTION_PORT_FACTS: + case MPI_FUNCTION_CONFIG: + case MPI_FUNCTION_FC_COMMON_TRANSPORT_SEND: + case MPI_FUNCTION_FC_EX_LINK_SRVC_SEND: + case MPI_FUNCTION_FW_UPLOAD: + case MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR: + case MPI_FUNCTION_FW_DOWNLOAD: + break; + + case MPI_FUNCTION_SCSI_IO_REQUEST: + if (ioc->sh) { + SCSIIORequest_t *pScsiReq = (SCSIIORequest_t *) mf; + VirtDevice *pTarget = NULL; + MPT_SCSI_HOST *hd = NULL; + int qtag = MPI_SCSIIO_CONTROL_UNTAGGED; + int scsidir = 0; + int target = (int) pScsiReq->TargetID; + int dataSize; + + pScsiReq->MsgFlags = MPT_SCSIIO_MSG_FLAGS; + + /* verify that app has not requested + * more sense data than driver + * can provide, if so, reset this parameter + * set the sense buffer pointer low address + * update the control field to specify Q type + */ + if (karg.maxSenseBytes > MPT_SENSE_BUFFER_SIZE) + pScsiReq->SenseBufferLength = MPT_SENSE_BUFFER_SIZE; + + pScsiReq->SenseBufferLowAddr = + cpu_to_le32(ioc->sense_buf_low_dma + + (req_idx * MPT_SENSE_BUFFER_ALLOC)); + + if ( (hd = (MPT_SCSI_HOST *) ioc->sh->hostdata)) { + if (hd->Targets) + pTarget = hd->Targets[target]; + } + + if (pTarget &&(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)) + qtag = MPI_SCSIIO_CONTROL_SIMPLEQ; + + /* Have the IOCTL driver set the direction based + * on the dataOutSize (ordering issue with Sparc). + */ + if (karg.dataOutSize > 0 ) { + scsidir = MPI_SCSIIO_CONTROL_WRITE; + dataSize = karg.dataOutSize; + } + else { + scsidir = MPI_SCSIIO_CONTROL_READ; + dataSize = karg.dataInSize; + } + + pScsiReq->Control = cpu_to_le32(scsidir | qtag); + pScsiReq->DataLength = cpu_to_le32(dataSize); + + } else { + printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " + "SCSI driver is not loaded. \n", + __FILE__, __LINE__); + rc = -EFAULT; + goto done_free_mem; + } + break; + + case MPI_FUNCTION_RAID_ACTION: + /* Just add a SGE + */ + break; + + case MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH: + if (ioc->sh) { + SCSIIORequest_t *pScsiReq = (SCSIIORequest_t *) mf; + int qtag = MPI_SCSIIO_CONTROL_SIMPLEQ; + int scsidir = MPI_SCSIIO_CONTROL_READ; + int dataSize; + + pScsiReq->MsgFlags = MPT_SCSIIO_MSG_FLAGS; + + /* verify that app has not requested + * more sense data than driver + * can provide, if so, reset this parameter + * set the sense buffer pointer low address + * update the control field to specify Q type + */ + if (karg.maxSenseBytes > MPT_SENSE_BUFFER_SIZE) + pScsiReq->SenseBufferLength = MPT_SENSE_BUFFER_SIZE; + + pScsiReq->SenseBufferLowAddr = + cpu_to_le32(ioc->sense_buf_low_dma + + (req_idx * MPT_SENSE_BUFFER_ALLOC)); + + /* All commands to physical devices are tagged + */ + + /* Have the IOCTL driver set the direction based + * on the dataOutSize (ordering issue with Sparc). + */ + if (karg.dataOutSize > 0 ) { + scsidir = MPI_SCSIIO_CONTROL_WRITE; + dataSize = karg.dataOutSize; + } + else { + scsidir = MPI_SCSIIO_CONTROL_READ; + dataSize = karg.dataInSize; + } + + pScsiReq->Control = cpu_to_le32(scsidir | qtag); + pScsiReq->DataLength = cpu_to_le32(dataSize); + + } else { + printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " + "SCSI driver is not loaded. \n", + __FILE__, __LINE__); + rc = -EFAULT; + goto done_free_mem; + } + break; + + default: + /* + * MPI_FUNCTION_IOC_INIT + * MPI_FUNCTION_PORT_ENABLE + * MPI_FUNCTION_TARGET_CMD_BUFFER_POST + * MPI_FUNCTION_TARGET_ASSIST + * MPI_FUNCTION_TARGET_STATUS_SEND + * MPI_FUNCTION_TARGET_MODE_ABORT + * MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET + * MPI_FUNCTION_IO_UNIT_RESET + * MPI_FUNCTION_HANDSHAKE + * MPI_FUNCTION_REPLY_FRAME_REMOVAL + * MPI_FUNCTION_EVENT_NOTIFICATION + * (driver handles event notification) + * MPI_FUNCTION_EVENT_ACK + * MPI_FUNCTION_SCSI_TASK_MGMT + */ + + /* What to do with these??? CHECK ME!!! + MPI_FUNCTION_FC_LINK_SRVC_BUF_POST + MPI_FUNCTION_FC_LINK_SRVC_RSP + MPI_FUNCTION_FC_ABORT + MPI_FUNCTION_FC_PRIMITIVE_SEND + MPI_FUNCTION_LAN_SEND + MPI_FUNCTION_LAN_RECEIVE + MPI_FUNCTION_LAN_RESET + */ + + printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " + "Illegal request (function 0x%x) \n", + __FILE__, __LINE__, hdr->Function); + rc = -EFAULT; + goto done_free_mem; + } + + /* Add the SGL ( at most one data in SGE and one data out SGE ) + * In the case of two SGE's - the data out (write) will always + * preceede the data in (read) SGE. psgList is used to free the + * allocated memory. + */ + psge = (MptSge_t *) ( ((int *) mf) + karg.dataSgeOffset); + flagsLength = 0; + + /* bufIn and bufOut are used for user to kernel space transfers + */ + bufIn.kptr = bufOut.kptr = NULL; + bufIn.len = bufOut.len = 0; + + if (karg.dataOutSize > 0 ) + sgSize ++; + + if (karg.dataInSize > 0 ) + sgSize ++; + + if (sgSize > 0) { + + /* Allocate memory for the SGL. + * Used to free kernel memory once + * the MF is freed. + */ + sglbuf = pci_alloc_consistent (ioc->pcidev, + sgSize*sizeof(MptSge_t), &sglbuf_dma); + if (sglbuf == NULL) { + rc = -ENOMEM; + goto done_free_mem; + } + this_sge = sglbuf; + + /* Set up the dataOut memory allocation */ + if (karg.dataOutSize > 0) { + dir = PCI_DMA_TODEVICE; + if (karg.dataInSize > 0 ) { + flagsLength = ( MPI_SGE_FLAGS_SIMPLE_ELEMENT | + MPI_SGE_FLAGS_DIRECTION | + MPT_SGE_ADDRESS_SIZE ) + << MPI_SGE_FLAGS_SHIFT; + } else { + flagsLength = MPT_SGE_FLAGS_SSIMPLE_WRITE; + } + flagsLength |= karg.dataOutSize; + + this_alloc = karg.dataOutSize; + bufOut.len = this_alloc; + bufOut.kptr = pci_alloc_consistent( + ioc->pcidev, this_alloc, &dma_addr); + + if (bufOut.kptr == NULL) { + rc = -ENOMEM; + goto done_free_mem; + } else { + /* Copy user data to kernel space. + */ + if (copy_from_user(bufOut.kptr, + karg.dataOutBufPtr, + bufOut.len)) { + + printk(KERN_ERR + "%s@%d::mptctl_do_mpt_command - Unable " + "to read user data " + "struct @ %p\n", + __FILE__, __LINE__,(void*)karg.dataOutBufPtr); + rc = -EFAULT; + goto done_free_mem; + } + + /* Set up this SGE. + * Copy to MF and to sglbuf + */ + + psge->FlagsLength = cpu_to_le32 (flagsLength); + cpu_to_leXX(dma_addr, psge->Address); + psge++; + + this_sge->FlagsLength=cpu_to_le32(flagsLength); + cpu_to_leXX(dma_addr, this_sge->Address); + this_sge++; + } + } + + if (karg.dataInSize > 0) { + dir = PCI_DMA_FROMDEVICE; + flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ; + flagsLength |= karg.dataInSize; + + this_alloc = karg.dataInSize; + bufIn.len = this_alloc; + bufIn.kptr = pci_alloc_consistent(ioc->pcidev, + this_alloc, &dma_addr); + if (bufIn.kptr == NULL) { + rc = -ENOMEM; + goto done_free_mem; + } else { + /* Set up this SGE + * Copy to MF and to sglbuf + */ + psge->FlagsLength = cpu_to_le32 (flagsLength); + cpu_to_leXX(dma_addr, psge->Address); + + this_sge->FlagsLength=cpu_to_le32(flagsLength); + cpu_to_leXX(dma_addr, this_sge->Address); + this_sge++; + } + } + } else { + /* Add a NULL SGE + */ + flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ; + psge->FlagsLength = cpu_to_le32 (flagsLength); + cpu_to_leXX( (dma_addr_t) -1, psge->Address); + } + + /* The request is complete. Set the timer parameters + * and issue the request. + */ + if (karg.timeout > 0) { + ioc->ioctl->timer.expires = jiffies + HZ*karg.timeout; + } else { + ioc->ioctl->timer.expires = jiffies + HZ*MPT_IOCTL_DEFAULT_TIMEOUT; + } + + ioc->ioctl->wait_done = 0; + ioc->ioctl->status |= MPT_IOCTL_STATUS_TIMER_ACTIVE; + add_timer(&ioc->ioctl->timer); + + mpt_put_msg_frame(mptctl_id, ioc->id, mf); + wait_event(mptctl_wait, ioc->ioctl->wait_done); + + /* The command is complete. * Return data to the user. + * + * If command completed, mf has been freed so cannot + * use this memory. + * + * If timeout, a recovery mechanism has been called. + * Need to free the mf. + */ + if (ioc->ioctl->status & MPT_IOCTL_STATUS_DID_TIMEOUT) { + + /* A timeout - there is no data to return to the + * the user other than an error. + * The timer callback deleted the + * timer and reset the adapter queues. + */ + printk(KERN_WARNING "%s@%d::mptctl_do_mpt_command - " + "Timeout Occurred on IOCTL! Resetting IOC.\n", __FILE__, __LINE__); + rc = -ETIME; + + /* Free memory and return to the calling function + */ + goto done_free_mem; + + } else { + /* Callback freed request frame. + */ + mf = NULL; + + /* If a valid reply frame, copy to the user. + * Offset 2: reply length in U32's + */ + if (ioc->ioctl->status & MPT_IOCTL_STATUS_RF_VALID) { + if (karg.maxReplyBytes < ioc->reply_sz) { + sz = MIN(karg.maxReplyBytes, 4*ioc->ioctl->ReplyFrame[2]); + } else { + sz = MIN(ioc->reply_sz, 4*ioc->ioctl->ReplyFrame[2]); + } + + if (sz > 0) { + if (copy_to_user((char *)karg.replyFrameBufPtr, + &ioc->ioctl->ReplyFrame, sz)){ + + printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " + "Unable to write out reply frame %p\n", + __FILE__, __LINE__, (void*)karg.replyFrameBufPtr); + rc = -ENODATA; + goto done_free_mem; + } + } + } + + /* If valid sense data, copy to user. + */ + if (ioc->ioctl->status & MPT_IOCTL_STATUS_SENSE_VALID) { + sz = MIN(karg.maxSenseBytes, MPT_SENSE_BUFFER_SIZE); + if (sz > 0) { + if (copy_to_user((char *)karg.senseDataPtr, ioc->ioctl->sense, sz)) { + printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " + "Unable to write sense data to user %p\n", + __FILE__, __LINE__, + (void*)karg.senseDataPtr); + rc = -ENODATA; + goto done_free_mem; + } + } + } + + /* If the overall status is _GOOD and data in, copy data + * to user. + */ + if ((ioc->ioctl->status & MPT_IOCTL_STATUS_COMMAND_GOOD) && + (karg.dataInSize > 0) && (bufIn.kptr)) { + + if (copy_to_user((char *)karg.dataInBufPtr, + bufIn.kptr, karg.dataInSize)) { + printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " + "Unable to write data to user %p\n", + __FILE__, __LINE__, + (void*)karg.dataInBufPtr); + rc = -ENODATA; + } + } + } + +done_free_mem: + /* Clear status bits. + */ + ioc->ioctl->status = 0; + + if (sglbuf) { + this_sge = sglbuf; + + /* Free the allocated memory. + */ + if (bufOut.kptr != NULL ) { + + leXX_to_cpu (dma_addr, this_sge->Address); + + this_sge++; /* go to next structure */ + this_alloc = bufOut.len; + pci_free_consistent(ioc->pcidev, + this_alloc, (void *) &bufOut, dma_addr); + } + + if (bufIn.kptr != NULL ) { + leXX_to_cpu (dma_addr, this_sge->Address); + this_alloc = bufIn.len; + + pci_free_consistent(ioc->pcidev, + this_alloc, (void *) &bufIn, dma_addr); + } + + this_alloc = sgSize * sizeof(MptSge_t); + pci_free_consistent(ioc->pcidev, + this_alloc, (void *) sglbuf, sglbuf_dma); + + } + + /* mf will be null if allocation failed OR + * if command completed OK (callback freed) + */ + if (mf) + mpt_free_msg_frame(mptctl_id, ioc->id, mf); + + return rc; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* Routine for the Compaq IOCTL commands. + * + * Outputs: None. + * Return: 0 if successful + * -EBUSY if previous command timout and IOC reset is not complete. + * -EFAULT if data unavailable + * -ENODEV if no such device/adapter + * -ETIME if timer expires + * -ENOMEM if memory allocation error + */ +static int +mptctl_compaq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + int iocnum = 0; + unsigned iocnumX = 0; + int ret; + int nonblock = (file->f_flags & O_NONBLOCK); + MPT_ADAPTER *iocp = NULL; + + if (cmd == CPQFCTS_SCSI_PASSTHRU) { + /* Update the iocnum */ + if (copy_from_user(&iocnumX, (int *)arg, sizeof(int))) { + printk(KERN_ERR "%s::mptctl_compaq_ioctl() @%d - " + "Unable to read controller number @ %p\n", + __FILE__, __LINE__, (void*)arg); + return -EFAULT; + } + iocnumX &= 0xFF; + } + + if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || + (iocp == NULL)) { + printk(KERN_ERR "%s::mptctl_compaq_ioctl() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnumX); + return -ENODEV; + } + + /* All of these commands require an interrupt or + * are unknown/illegal. + */ + if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) + return ret; + + dctlprintk((MYIOC_s_INFO_FMT ": mptctl_compaq_ioctl()\n", iocp->name)); + + switch(cmd) { + case CPQFCTS_GETPCIINFO: + ret = mptctl_cpq_getpciinfo(arg); + break; + case CPQFCTS_GETDRIVER: + ret = mptctl_cpq_getdriver(arg); + break; + case CPQFCTS_CTLR_STATUS: + ret = mptctl_cpq_ctlr_status(arg); + break; + case CPQFCTS_SCSI_IOCTL_FC_TARGET_ADDRESS: + ret = mptctl_cpq_target_address(arg); + break; + case CPQFCTS_SCSI_PASSTHRU: + ret = mptctl_cpq_passthru(arg); + break; + default: + ret = -EINVAL; + } + + up(&mptctl_syscall_sem_ioc[iocp->id]); + + return ret; + +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptctl_cpq_getpciinfo - Get PCI Information in format desired by Compaq + * + * Outputs: None. + * Return: 0 if successful + * -EBUSY if previous command timout and IOC reset is not complete. + * -EFAULT if data unavailable + * -ENODEV if no such device/adapter + * -ETIME if timer expires + */ +static int +mptctl_cpq_getpciinfo(unsigned long arg) +{ + cpqfc_pci_info_struct *uarg = (cpqfc_pci_info_struct *) arg; + cpqfc_pci_info_struct karg; + MPT_ADAPTER *ioc; + struct pci_dev *pdev; + CONFIGPARMS cfg; + ConfigPageHeader_t hdr; + int iocnum = 0, iocnumX = 0; + dma_addr_t buf_dma; + u8 *pbuf = NULL; + int failed; + + dctlprintk((": mptctl_cpq_pciinfo called.\n")); + if (copy_from_user(&karg, uarg, sizeof(cpqfc_pci_info_struct))) { + printk(KERN_ERR "%s@%d::mptctl_cpq_pciinfo - " + "Unable to read in cpqfc_pci_info_struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_pciinfo() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; + } + + pdev = (struct pci_dev *) ioc->pcidev; + + /* Populate the structure. */ + karg.bus = pdev->bus->number; + karg.bus_type = 1; /* 1 = PCI; 4 = unknown */ + karg.device_fn = PCI_FUNC(pdev->devfn); + karg.slot_number = PCI_SLOT(pdev->devfn); + karg.vendor_id = pdev->vendor; + karg.device_id = pdev->device; + karg.board_id = (karg.device_id | (karg.vendor_id << 16)); + karg.class_code = pdev->class; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) + karg.sub_vendor_id = pdev->subsystem_vendor; + karg.sub_device_id = pdev->subsystem_device; +#endif + + /* Issue a config request to get the device serial number + */ + hdr.PageVersion = 0; + hdr.PageLength = 0; + hdr.PageNumber = 0; + hdr.PageType = MPI_CONFIG_PAGETYPE_MANUFACTURING; + cfg.hdr = &hdr; + cfg.physAddr = -1; + cfg.pageAddr = 0; + cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; + cfg.dir = 0; /* read */ + cfg.timeout = 10; + + failed = 1; + + if (mpt_config(ioc, &cfg) == 0) { + if (cfg.hdr->PageLength > 0) { + /* Issue the second config page request */ + cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; + + pbuf = pci_alloc_consistent(ioc->pcidev, hdr.PageLength * 4, &buf_dma); + if (pbuf) { + cfg.physAddr = buf_dma; + if (mpt_config(ioc, &cfg) == 0) { + ManufacturingPage0_t *pdata = (ManufacturingPage0_t *) pbuf; + strncpy(karg.serial_number, pdata->BoardTracerNumber, 17); + failed = 0; + } + pci_free_consistent(ioc->pcidev, hdr.PageLength * 4, pbuf, buf_dma); + pbuf = NULL; + } + } + } + if (failed) + strncpy(karg.serial_number, " ", 17); + + /* Copy the data from kernel memory to user memory + */ + if (copy_to_user((char *)arg, &karg, + sizeof(cpqfc_pci_info_struct))) { + printk(KERN_ERR "%s@%d::mptctl_cpq_pciinfo - " + "Unable to write out cpqfc_pci_info_struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + return 0; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptctl_cpq_getdriver - Get Driver Version in format desired by Compaq + * + * Outputs: None. + * Return: 0 if successful + * -EFAULT if data unavailable + * -ENODEV if no such device/adapter + */ +static int +mptctl_cpq_getdriver(unsigned long arg) +{ + int *uarg = (int *)arg; + int karg; + MPT_ADAPTER *ioc = NULL; + int iocnum = 0, iocnumX = 0; + int ii, jj; + char version[10]; + char val; + char *vptr = NULL; + char *pptr = NULL; + + dctlprintk((": mptctl_cpq_getdriver called.\n")); + if (copy_from_user(&karg, uarg, sizeof(int))) { + printk(KERN_ERR "%s@%d::mptctl_cpq_getdriver - " + "Unable to read in struct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_cpq_getdriver() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; + } + + strncpy(version, MPT_LINUX_VERSION_COMMON, 8); + + karg = 0; + vptr = version; + ii = 3; + while (ii > 0) { + pptr = strchr(vptr, '.'); + if (pptr) { + *pptr = '\0'; + val = 0; + for (jj=0; vptr[jj]>='0' && vptr[jj]<='9'; jj++) + val = 10 * val + (vptr[jj] - '0'); + karg |= (val << (8*ii)); + pptr++; + vptr = pptr; + } else + break; + ii--; + } + + /* Copy the data from kernel memory to user memory + */ + if (copy_to_user((char *)arg, &karg, + sizeof(int))) { + printk(KERN_ERR "%s@%d::mptctl_cpq_getdriver - " + "Unable to write out stuct @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + return 0; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptctl_cpq_ctlr_status - Get controller status in format desired by Compaq + * + * Outputs: None. + * Return: 0 if successful + * -EFAULT if data unavailable + * -ENODEV if no such device/adapter + */ +static int +mptctl_cpq_ctlr_status(unsigned long arg) +{ + cpqfc_ctlr_status *uarg = (cpqfc_ctlr_status *) arg; + cpqfc_ctlr_status karg; + MPT_ADAPTER *ioc; + int iocnum = 0, iocnumX = 0; + + dctlprintk((": mptctl_cpq_pciinfo called.\n")); + if (copy_from_user(&karg, uarg, sizeof(cpqfc_ctlr_status))) { + printk(KERN_ERR "%s@%d::mptctl_cpq_ctlr_status - " + "Unable to read in cpqfc_ctlr_status @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_cpq_ctlr_status() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; + } + + karg.status = ioc->last_state; + karg.offline_reason = 0; + + /* Copy the data from kernel memory to user memory + */ + if (copy_to_user((char *)arg, &karg, + sizeof(cpqfc_ctlr_status))) { + printk(KERN_ERR "%s@%d::mptctl_cpq_ctlr_status - " + "Unable to write out cpqfc_ctlr_status @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + return 0; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptctl_cpq_target_address - Get WWN Information in format desired by Compaq + * + * Outputs: None. + * Return: 0 if successful + * -EBUSY if previous command timout and IOC reset is not complete. + * -EFAULT if data unavailable + * -ENODEV if no such device/adapter + * -ETIME if timer expires + */ +static int +mptctl_cpq_target_address(unsigned long arg) +{ + Scsi_FCTargAddress *uarg = (Scsi_FCTargAddress *) arg; + Scsi_FCTargAddress karg; + MPT_ADAPTER *ioc; + int iocnum = 0, iocnumX = 0; + CONFIGPARMS cfg; + ConfigPageHeader_t hdr; + dma_addr_t buf_dma; + u8 *pbuf = NULL; + FCPortPage0_t *ppp0; + int ii, failed; + u32 low, high; + + dctlprintk((": mptctl_cpq_target_address called.\n")); + if (copy_from_user(&karg, uarg, sizeof(Scsi_FCTargAddress))) { + printk(KERN_ERR "%s@%d::mptctl_cpq_target_address - " + "Unable to read in Scsi_FCTargAddress @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_cpq_target_address() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; + } + + karg.host_port_id = 0; + + /* Issue a config request to get the device wwn + */ + hdr.PageVersion = 0; + hdr.PageLength = 0; + hdr.PageNumber = 0; + hdr.PageType = MPI_CONFIG_PAGETYPE_FC_PORT; + cfg.hdr = &hdr; + cfg.physAddr = -1; + cfg.pageAddr = 0; + cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; + cfg.dir = 0; /* read */ + cfg.timeout = 10; + + failed = 1; + + if (mpt_config(ioc, &cfg) == 0) { + if (cfg.hdr->PageLength > 0) { + /* Issue the second config page request */ + cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; + + pbuf = pci_alloc_consistent(ioc->pcidev, hdr.PageLength * 4, &buf_dma); + if (pbuf) { + cfg.physAddr = buf_dma; + if (mpt_config(ioc, &cfg) == 0) { + ppp0 = (FCPortPage0_t *) pbuf; + + low = le32_to_cpu(ppp0->WWNN.Low); + high = le32_to_cpu(ppp0->WWNN.High); + + for (ii = 0; ii < 4; ii++) { + karg.host_wwn[7-ii] = low & 0xFF; + karg.host_wwn[3-ii] = high & 0xFF; + low = (low >> 8); + high = (high >> 8); + } + failed = 0; + } + pci_free_consistent(ioc->pcidev, hdr.PageLength * 4, pbuf, buf_dma); + pbuf = NULL; + } + } + } + + if (failed) { + for (ii = 7; ii >= 0; ii--) + karg.host_wwn[ii] = 0; + } + + /* Copy the data from kernel memory to user memory + */ + if (copy_to_user((char *)arg, &karg, + sizeof(Scsi_FCTargAddress))) { + printk(KERN_ERR "%s@%d::mptctl_cpq_target_address - " + "Unable to write out Scsi_FCTargAddress @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + return 0; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptctl_cpq_passthru - Construct and issue a SCSI IO Passthru + * + * Requires the SCSI host driver to be loaded. + * I386 version. + * + * Outputs: None. + * Return: 0 if successful + * -EBUSY if previous command timout and IOC reset is not complete. + * -EFAULT if data unavailable + * -ENODEV if no such device/adapter + * -ETIME if timer expires + */ +static int +mptctl_cpq_passthru(unsigned long arg) +{ + VENDOR_IOCTL_REQ *uarg = (VENDOR_IOCTL_REQ *) arg; + VENDOR_IOCTL_REQ karg; + cpqfc_passthru_t kpass; + MPT_ADAPTER *ioc; + int iocnum = 0, iocnumX = 0; + int rc; + + dctlprintk((": mptctl_cpq_passthru called.\n")); + if (copy_from_user(&karg, uarg, sizeof(VENDOR_IOCTL_REQ))) { + printk(KERN_ERR "%s@%d::mptctl_cpq_passthru - " + "Unable to read in VENDOR_IOCTL_REQ @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + /* Set the IOC number */ + iocnumX = karg.lc & 0xFF; + if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR "%s::mptctl_cpq_passthru() @%d - ioc%d not found!\n", + __FILE__, __LINE__, iocnum); + return -ENODEV; + } + + if (ioc->sh == NULL) { + printk(KERN_ERR "%s::mptctl_cpq_passthru() @%d - SCSI Host driver not loaded!\n", + __FILE__, __LINE__); + return -EFAULT; + } + + /* Read in the second buffer */ + if (copy_from_user(&kpass, uarg->argp, sizeof(cpqfc_passthru_t))) { + printk(KERN_ERR "%s@%d::mptctl_cpq_passthru - " + "Unable to read in cpqfc_passthru_t @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + + /* Generate the SCSI IO command and issue */ + rc = mptctl_compaq_scsiio(&karg, &kpass); + return rc; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptctl_compaq_scsiio - Reformat Compaq structures into driver structures + * Call the generic _do_mpt_command function. + * + * Requires the SCSI host driver to be loaded. + * I386 version. + * + * Outputs: None. + * Return: 0 if successful + * -EBUSY if previous command timout and IOC reset is not complete. + * -EFAULT if data unavailable + * -ENODEV if no such device/adapter + * -ETIME if timer expires + */ +static int +mptctl_compaq_scsiio(VENDOR_IOCTL_REQ *pVenReq, cpqfc_passthru_t *pPass) +{ + struct mpt_ioctl_command karg; + SCSIIORequest_t request ; + SCSIIORequest_t *pMf; + int ii, rc; + u8 opcode; + + /* Fill in parameters to karg */ + karg.hdr.iocnum = pVenReq->lc; + karg.hdr.port = 0; + karg.hdr.maxDataSize = 0; /* not used */ + karg.timeout = 0; /* use default */ + + karg.replyFrameBufPtr = NULL; /* no reply data */ + karg.maxReplyBytes = 0; + + karg.senseDataPtr = pPass->sense_data; + karg.maxSenseBytes = pPass->sense_len; /* max is 40 */ + + if (pPass->rw_flag == MPT_COMPAQ_WRITE) { + karg.dataOutBufPtr = pPass->bufp; + karg.dataOutSize = pPass->len; + karg.dataInBufPtr = NULL; + karg.dataInSize = 0; + } else { + karg.dataInBufPtr = pPass->bufp; + karg.dataInSize = pPass->len; + karg.dataOutBufPtr = NULL; + karg.dataOutSize = 0; + } + + karg.dataSgeOffset = (sizeof(SCSIIORequest_t) - sizeof(SGE_IO_UNION))/4; + + /* Construct the Message frame */ + pMf = &request; + + pMf->TargetID = (u8) pVenReq->ld; /* ???? FIXME */ + pMf->Bus = (u8) pPass->bus; + pMf->ChainOffset = 0; + pMf->Function = MPI_FUNCTION_SCSI_IO_REQUEST; + + /* May need some tweaking here */ + opcode = (u8) pPass->cdb[0]; + if (opcode < 0x20) + pMf->CDBLength = 6; + else if (opcode < 0x60) + pMf->CDBLength = 10; + else if ((opcode < 0xC0) && (opcode >= 0xA0)) + pMf->CDBLength = 12; + else + pMf->CDBLength = 16; + + pMf->SenseBufferLength = karg.maxSenseBytes; /* max is 40 */ + pMf->Reserved = 0; + pMf->MsgFlags = 0; /* set later */ + pMf->MsgContext = 0; /* set later */ + + for (ii = 0; ii < 8; ii++) + pMf->LUN[ii] = 0; + pMf->LUN[1] = 0; /* ???? FIXME */ + + /* Tag values set by _do_mpt_command */ + if (pPass->rw_flag == MPT_COMPAQ_WRITE) + pMf->Control = MPI_SCSIIO_CONTROL_WRITE; + else + pMf->Control = MPI_SCSIIO_CONTROL_READ; + + for (ii = 0; ii < 16; ii++) + pMf->CDB[ii] = pPass->cdb[ii]; + + pMf->DataLength = pPass->len; + + /* All remaining fields are set by the next function + */ + rc = mptctl_do_mpt_command (karg, (char *)pMf, 1); + return rc; +} + + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,51) +#define owner_THIS_MODULE owner: THIS_MODULE, +#else +#define owner_THIS_MODULE +#endif + +static struct file_operations mptctl_fops = { + owner_THIS_MODULE + llseek: no_llseek, + read: mptctl_read, + write: mptctl_write, + ioctl: mptctl_ioctl, + open: mptctl_open, + release: mptctl_release, +}; + +static struct miscdevice mptctl_miscdev = { + MPT_MINOR, + MYNAM, + &mptctl_fops +}; + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ + +#if defined(__sparc__) && defined(__sparc_v9__) /*{*/ + +/* The dynamic ioctl32 compat. registry only exists in >2.3.x sparc64 kernels */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0) /*{*/ extern int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, @@ -1133,18 +2773,15 @@ unsigned long, struct file *)); int unregister_ioctl32_conversion(unsigned int cmd); - -struct mpt_fw_xfer32 { - unsigned int iocnum; - unsigned int fwlen; - u32 bufp; -}; - -#define MPTFWDOWNLOAD32 _IOWR(MPT_MAGIC_NUMBER,15,struct mpt_fw_xfer32) - extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* sparc32_XXX functions are used to provide a conversion between + * pointers and u32's. If the arg does not contain any pointers, then + * a specialized function (sparc32_XXX) is not needed. If the arg + * does contain pointer(s), then the specialized function is used + * to ensure the structure contents is properly processed by mptctl. + */ static int sparc32_mptfwxfer_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *filp) @@ -1156,7 +2793,7 @@ int nonblock = (filp->f_flags & O_NONBLOCK); int ret; - dprintk((KERN_INFO MYNAM "::sparc32_mptfwxfer_ioctl() called\n")); + dctlprintk((KERN_INFO MYNAM "::sparc32_mptfwxfer_ioctl() called\n")); if (copy_from_user(&kfw32, (char *)arg, sizeof(kfw32))) return -EFAULT; @@ -1177,13 +2814,131 @@ kfw.fwlen = kfw32.fwlen; kfw.bufp = (void *)(unsigned long)kfw32.bufp; - ret = mpt_ioctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen); + ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen); + + up(&mptctl_syscall_sem_ioc[iocp->id]); + + return ret; +} + +static int +sparc32_mpt_command(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *filp) +{ + struct mpt_ioctl_command32 karg32; + struct mpt_ioctl_command32 *uarg = (struct mpt_ioctl_command32 *) arg; + struct mpt_ioctl_command karg; + MPT_ADAPTER *iocp = NULL; + int iocnum, iocnumX; + int nonblock = (filp->f_flags & O_NONBLOCK); + int ret; + + dctlprintk((KERN_INFO MYNAM "::sparc32_mpt_command() called\n")); + + if (copy_from_user(&karg32, (char *)arg, sizeof(karg32))) + return -EFAULT; + + /* Verify intended MPT adapter */ + iocnumX = karg32.hdr.iocnum & 0xFF; + if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || + (iocp == NULL)) { + printk(KERN_ERR MYNAM "::sparc32_mpt_command @%d - ioc%d not found!\n", + __LINE__, iocnumX); + return -ENODEV; + } + + if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) + return ret; + + /* Copy data to karg */ + karg.hdr.iocnum = karg32.hdr.iocnum; + karg.hdr.port = karg32.hdr.port; + karg.timeout = karg32.timeout; + karg.maxReplyBytes = karg32.maxReplyBytes; + + karg.dataInSize = karg32.dataInSize; + karg.dataOutSize = karg32.dataOutSize; + karg.maxSenseBytes = karg32.maxSenseBytes; + karg.dataSgeOffset = karg32.dataSgeOffset; + + karg.replyFrameBufPtr = (char *)(unsigned long)karg32.replyFrameBufPtr; + karg.dataInBufPtr = (char *)(unsigned long)karg32.dataInBufPtr; + karg.dataOutBufPtr = (char *)(unsigned long)karg32.dataOutBufPtr; + karg.senseDataPtr = (char *)(unsigned long)karg32.senseDataPtr; + + /* Pass new structure to do_mpt_command + */ + ret = mptctl_do_mpt_command (karg, (char *) &uarg->MF, 0); up(&mptctl_syscall_sem_ioc[iocp->id]); return ret; } +static int +sparc32_mptctl_cpq_passthru(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *filp) +{ + VENDOR_IOCTL_REQ32 *uarg = (VENDOR_IOCTL_REQ32 *) arg; + VENDOR_IOCTL_REQ32 karg32; + VENDOR_IOCTL_REQ karg; + cpqfc_passthru32_t kpass32; + cpqfc_passthru_t kpass; + MPT_ADAPTER *ioc; + int nonblock = (filp->f_flags & O_NONBLOCK); + int iocnum = 0, iocnumX = 0; + int rc; + int ii; + + dctlprintk((KERN_INFO MYNAM "::sparc32_mptctl_cpq_passthru() called\n")); + + if (copy_from_user(&karg32, (char *)arg, sizeof(karg32))) + return -EFAULT; + + /* Verify intended MPT adapter */ + iocnumX = karg32.lc & 0xFF; + if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) || + (ioc == NULL)) { + printk(KERN_ERR MYNAM "::sparc32_mpt_command @%d - ioc%d not found!\n", + __LINE__, iocnumX); + return -ENODEV; + } + + if ((rc = mptctl_syscall_down(ioc, nonblock)) != 0) + return rc; + + /* Copy data to karg */ + karg.ld = karg32.ld; + karg.node = karg32.node; + karg.lc = karg32.lc; + karg.nexus = karg32.nexus; + karg.argp = (void *)(unsigned long)karg32.argp; + + /* Read in the second buffer */ + if (copy_from_user(&kpass32, karg.argp, sizeof(cpqfc_passthru32_t))) { + printk(KERN_ERR "%s@%d::sparc32_mptctl_cpq_passthru - " + "Unable to read in cpqfc_passthru_t @ %p\n", + __FILE__, __LINE__, (void*)uarg); + return -EFAULT; + } + + /* Copy the 32bit buffer to kpass */ + for (ii = 0; ii < 16; ii++) + kpass.cdb[ii] = kpass32.cdb[ii]; + kpass.bus = kpass32.bus; + kpass.pdrive = kpass32.pdrive; + kpass.len = kpass32.len; + kpass.sense_len = kpass32.sense_len; + kpass.bufp = (void *)(unsigned long)kpass32.bufp; + kpass.rw_flag = kpass32.rw_flag; + + /* Generate the SCSI IO command and issue */ + rc = mptctl_compaq_scsiio(&karg, &kpass); + + up(&mptctl_syscall_sem_ioc[ioc->id]); + return rc; +} + #endif /*} linux >= 2.3.x */ #endif /*} sparc */ @@ -1193,26 +2948,76 @@ int err; int i; int where = 1; + int sz; + u8 *mem; + MPT_ADAPTER *ioc = NULL; + int iocnum; show_mptmod_ver(my_NAME, my_VERSION); for (i=0; iioctl = (MPT_IOCTL *) mem; + ioc->ioctl->ioc = ioc; + init_timer (&ioc->ioctl->timer); + ioc->ioctl->timer.data = (unsigned long) ioc->ioctl; + ioc->ioctl->timer.function = mptctl_timer_expired; + } } #if defined(__sparc__) && defined(__sparc_v9__) /*{*/ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0) /*{*/ - err = register_ioctl32_conversion(MPTRWPERF, NULL); + err = register_ioctl32_conversion(MPTIOCINFO, NULL); + if (++where && err) goto out_fail; + err = register_ioctl32_conversion(MPTTARGETINFO, NULL); + if (++where && err) goto out_fail; + err = register_ioctl32_conversion(MPTTEST, NULL); + if (++where && err) goto out_fail; + err = register_ioctl32_conversion(MPTEVENTQUERY, NULL); + if (++where && err) goto out_fail; + err = register_ioctl32_conversion(MPTEVENTENABLE, NULL); + if (++where && err) goto out_fail; + err = register_ioctl32_conversion(MPTEVENTREPORT, NULL); + if (++where && err) goto out_fail; + err = register_ioctl32_conversion(MPTHARDRESET, NULL); + if (++where && err) goto out_fail; + err = register_ioctl32_conversion(MPTCOMMAND32, sparc32_mpt_command); + if (++where && err) goto out_fail; + err = register_ioctl32_conversion(MPTFWDOWNLOAD32, + sparc32_mptfwxfer_ioctl); + if (++where && err) goto out_fail; + err = register_ioctl32_conversion(CPQFCTS_GETPCIINFO, NULL); + if (++where && err) goto out_fail; + err = register_ioctl32_conversion(CPQFCTS_CTLR_STATUS, NULL); if (++where && err) goto out_fail; - err = register_ioctl32_conversion(MPTRWPERF_CHK, NULL); + err = register_ioctl32_conversion(CPQFCTS_GETDRIVER, NULL); if (++where && err) goto out_fail; - err = register_ioctl32_conversion(MPTRWPERF_RESET, NULL); + err = register_ioctl32_conversion(CPQFCTS_SCSI_IOCTL_FC_TARGET_ADDRESS, NULL); if (++where && err) goto out_fail; - err = register_ioctl32_conversion(MPTFWDOWNLOAD32, sparc32_mptfwxfer_ioctl); + err = register_ioctl32_conversion(CPQFCTS_SCSI_PASSTHRU32, sparc32_mptctl_cpq_passthru); if (++where && err) goto out_fail; #endif /*} linux >= 2.3.x */ #endif /*} sparc */ + /* Register this device */ if (misc_register(&mptctl_miscdev) == -1) { printk(KERN_ERR MYNAM ": Can't register misc device [minor=%d].\n", MPT_MINOR); err = -EBUSY; @@ -1226,13 +3031,19 @@ * Install our handler */ ++where; - if ((mptctl_id = mpt_register(mptctl_reply, MPTCTL_DRIVER)) <= 0) { + if ((mptctl_id = mpt_register(mptctl_reply, MPTCTL_DRIVER)) < 0) { printk(KERN_ERR MYNAM ": ERROR: Failed to register with Fusion MPT base driver\n"); misc_deregister(&mptctl_miscdev); err = -EBUSY; goto out_fail; } + if (mpt_reset_register(mptctl_id, mptctl_ioc_reset) == 0) { + dprintk((KERN_INFO MYNAM ": Registered for IOC reset notifications\n")); + } else { + /* FIXME! */ + } + return 0; out_fail: @@ -1241,35 +3052,72 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0) /*{*/ printk(KERN_ERR MYNAM ": ERROR: Failed to register ioctl32_conversion!" " (%d:err=%d)\n", where, err); - unregister_ioctl32_conversion(MPTRWPERF); - unregister_ioctl32_conversion(MPTRWPERF_CHK); - unregister_ioctl32_conversion(MPTRWPERF_RESET); + unregister_ioctl32_conversion(MPTIOCINFO); + unregister_ioctl32_conversion(MPTTARGETINFO); + unregister_ioctl32_conversion(MPTTEST); + unregister_ioctl32_conversion(MPTEVENTQUERY); + unregister_ioctl32_conversion(MPTEVENTENABLE); + unregister_ioctl32_conversion(MPTEVENTREPORT); + unregister_ioctl32_conversion(MPTHARDRESET); + unregister_ioctl32_conversion(MPTCOMMAND32); unregister_ioctl32_conversion(MPTFWDOWNLOAD32); + unregister_ioctl32_conversion(CPQFCTS_GETPCIINFO); + unregister_ioctl32_conversion(CPQFCTS_GETDRIVER); + unregister_ioctl32_conversion(CPQFCTS_CTLR_STATUS); + unregister_ioctl32_conversion(CPQFCTS_SCSI_IOCTL_FC_TARGET_ADDRESS); + unregister_ioctl32_conversion(CPQFCTS_SCSI_PASSTHRU32); #endif /*} linux >= 2.3.x */ #endif /*} sparc */ + for (i=0; iioctl) { + kfree ( ioc->ioctl ); + ioc->ioctl = NULL; + } + } + } return err; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ void mptctl_exit(void) { - -#if defined(__sparc__) && defined(__sparc_v9__) /*{*/ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0) /*{*/ - unregister_ioctl32_conversion(MPTRWPERF); - unregister_ioctl32_conversion(MPTRWPERF_CHK); - unregister_ioctl32_conversion(MPTRWPERF_RESET); - unregister_ioctl32_conversion(MPTFWDOWNLOAD32); -#endif /*} linux >= 2.3.x */ -#endif /*} sparc */ + int i; + MPT_ADAPTER *ioc; + int iocnum; misc_deregister(&mptctl_miscdev); - printk(KERN_INFO MYNAM ": /dev/%s @ (major,minor=%d,%d)\n", + printk(KERN_INFO MYNAM ": Deregistered /dev/%s @ (major,minor=%d,%d)\n", mptctl_miscdev.name, MISC_MAJOR, mptctl_miscdev.minor); - printk(KERN_INFO MYNAM ": Deregistered from Fusion MPT base driver\n"); + /* De-register reset handler from base module */ + mpt_reset_deregister(mptctl_id); + dprintk((KERN_INFO MYNAM ": Deregistered for IOC reset notifications\n")); + + /* De-register callback handler from base module */ mpt_deregister(mptctl_id); + printk(KERN_INFO MYNAM ": Deregistered from Fusion MPT base driver\n"); + + /* Free allocated memory */ + for (i=0; iioctl) { + kfree ( ioc->ioctl ); + ioc->ioctl = NULL; + } + } + } } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ diff -urN linux-2.4.18/drivers/message/fusion/mptctl.h lia64-2.4/drivers/message/fusion/mptctl.h --- linux-2.4.18/drivers/message/fusion/mptctl.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/message/fusion/mptctl.h Tue Mar 19 15:05:36 2002 @@ -0,0 +1,395 @@ +/* + * linux/drivers/message/fusion/mptioctl.h + * Fusion MPT misc device (ioctl) driver. + * For use with PCI chip/adapter(s): + * LSIFC9xx/LSI409xx Fibre Channel + * running LSI Logic Fusion MPT (Message Passing Technology) firmware. + * + * Credits: + * This driver would not exist if not for Alan Cox's development + * of the linux i2o driver. + * + * A huge debt of gratitude is owed to David S. Miller (DaveM) + * for fixing much of the stupid and broken stuff in the early + * driver while porting to sparc64 platform. THANK YOU! + * + * (see also mptbase.c) + * + * Copyright (c) 1999-2002 LSI Logic Corporation + * Originally By: Steven J. Ralston + * (mailto:sjralston1@netscape.net) + * (mailto:Pam.Delaney@lsil.com) + * + * $Id: mptctl.h,v 1.2 2002/03/19 23:05:36 awilliam Exp $ + */ +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + NO WARRANTY + THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT + LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, + MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is + solely responsible for determining the appropriateness of using and + distributing the Program and assumes all risks associated with its + exercise of rights under this Agreement, including but not limited to + the risks and costs of program errors, damage to or loss of data, + programs or equipment, and unavailability or interruption of operations. + + DISCLAIMER OF LIABILITY + NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED + HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef MPTCTL_H_INCLUDED +#define MPTCTL_H_INCLUDED +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ + +#include "linux/version.h" + + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * + */ +#define MPT_MISCDEV_BASENAME "mptctl" +#define MPT_MISCDEV_PATHNAME "/dev/" MPT_MISCDEV_BASENAME + +#define MPT_PRODUCT_LENGTH 12 + +/* + * Generic MPT Control IOCTLs and structures + */ +#define MPT_MAGIC_NUMBER 'm' + +#define MPTRWPERF _IOWR(MPT_MAGIC_NUMBER,0,struct mpt_raw_r_w) + +#define MPTFWDOWNLOAD _IOWR(MPT_MAGIC_NUMBER,15,struct mpt_fw_xfer) +#define MPTCOMMAND _IOWR(MPT_MAGIC_NUMBER,20,struct mpt_ioctl_command) + +#if defined(__KERNEL__) && defined(__sparc__) && defined(__sparc_v9__) /*{*/ +#define MPTFWDOWNLOAD32 _IOWR(MPT_MAGIC_NUMBER,15,struct mpt_fw_xfer32) +#define MPTCOMMAND32 _IOWR(MPT_MAGIC_NUMBER,20,struct mpt_ioctl_command32) +#endif /*}*/ + +#define MPTIOCINFO _IOWR(MPT_MAGIC_NUMBER,17,struct mpt_ioctl_iocinfo) +#define MPTTARGETINFO _IOWR(MPT_MAGIC_NUMBER,18,struct mpt_ioctl_targetinfo) +#define MPTTEST _IOWR(MPT_MAGIC_NUMBER,19,struct mpt_ioctl_test) +#define MPTEVENTQUERY _IOWR(MPT_MAGIC_NUMBER,21,struct mpt_ioctl_eventquery) +#define MPTEVENTENABLE _IOWR(MPT_MAGIC_NUMBER,22,struct mpt_ioctl_eventenable) +#define MPTEVENTREPORT _IOWR(MPT_MAGIC_NUMBER,23,struct mpt_ioctl_eventreport) +#define MPTHARDRESET _IOWR(MPT_MAGIC_NUMBER,24,struct mpt_ioctl_diag_reset) +#define MPTFWREPLACE _IOWR(MPT_MAGIC_NUMBER,25,struct mpt_ioctl_replace_fw) + +/* + * SPARC PLATFORM REMARK: + * IOCTL data structures that contain pointers + * will have different sizes in the driver and applications + * (as the app. will not use 8-byte pointers). + * Apps should use MPTFWDOWNLOAD and MPTCOMMAND. + * The driver will convert data from + * mpt_fw_xfer32 (mpt_ioctl_command32) to mpt_fw_xfer (mpt_ioctl_command) + * internally. + */ +struct mpt_fw_xfer { + unsigned int iocnum; /* IOC unit number */ + unsigned int fwlen; + void *bufp; /* Pointer to firmware buffer */ +}; + +#if defined(__KERNEL__) && defined(__sparc__) && defined(__sparc_v9__) /*{*/ +struct mpt_fw_xfer32 { + unsigned int iocnum; + unsigned int fwlen; + u32 bufp; +}; +#endif /*}*/ + + +/* + * IOCTL header structure. + * iocnum - must be defined. + * port - must be defined for all IOCTL commands other than MPTIOCINFO + * maxDataSize - ignored on MPTCOMMAND commands + * - ignored on MPTFWREPLACE commands + * - on query commands, reports the maximum number of bytes to be returned + * to the host driver (count includes the header). + * That is, set to sizeof(struct mpt_ioctl_iocinfo) for fixed sized commands. + * Set to sizeof(struct mpt_ioctl_targetinfo) + datasize for variable + * sized commands. (MPTTARGETINFO, MPTEVENTREPORT) + */ +typedef struct _mpt_ioctl_header { + unsigned int iocnum; /* IOC unit number */ + unsigned int port; /* IOC port number */ + int maxDataSize; /* Maximum Num. bytes to transfer on read */ +} mpt_ioctl_header; + +/* + * Issue a diagnostic reset + */ +struct mpt_ioctl_diag_reset { + mpt_ioctl_header hdr; +}; + + +/* + * Adapter Information Page + * Read only. + * Data starts at offset 0xC + */ +#define MPT_IOCTL_INTERFACE_FC (0x01) +#define MPT_IOCTL_INTERFACE_SCSI (0x00) +#define MPT_IOCTL_VERSION_LENGTH (32) + +struct mpt_ioctl_iocinfo { + mpt_ioctl_header hdr; + int adapterType; /* SCSI or FCP */ + int port; /* port number */ + int pciId; /* PCI Id. */ + int hwRev; /* hardware revision */ + int subSystemDevice; /* PCI subsystem Device ID */ + int subSystemVendor; /* PCI subsystem Vendor ID */ + int numDevices; /* number of devices */ + int FWVersion; /* FW Version (integer) */ + int BIOSVersion; /* BIOS Version (integer) */ + char driverVersion[MPT_IOCTL_VERSION_LENGTH]; /* Driver Version (string) */ + char busChangeEvent; + char hostId; + char rsvd[2]; +}; + +/* + * Device Information Page + * Report the number of, and ids of, all targets + * on this IOC. The ids array is a packed structure + * of the known targetInfo. + * bits 31-24: reserved + * 23-16: LUN + * 15- 8: Bus Number + * 7- 0: Target ID + */ +struct mpt_ioctl_targetinfo { + mpt_ioctl_header hdr; + int numDevices; /* Num targets on this ioc */ + int targetInfo[1]; +}; + + +/* + * Event reporting IOCTL's. These IOCTL's will + * use the following defines: + */ +struct mpt_ioctl_eventquery { + mpt_ioctl_header hdr; + unsigned short eventEntries; + unsigned short reserved; + unsigned int eventTypes; +}; + +struct mpt_ioctl_eventenable { + mpt_ioctl_header hdr; + unsigned int eventTypes; +}; + +#ifndef __KERNEL__ +typedef struct { + uint event; + uint eventContext; + uint data[2]; +} MPT_IOCTL_EVENTS; +#endif + +struct mpt_ioctl_eventreport { + mpt_ioctl_header hdr; + MPT_IOCTL_EVENTS eventData[1]; +}; + +#define MPT_MAX_NAME 32 +struct mpt_ioctl_test { + mpt_ioctl_header hdr; + u8 name[MPT_MAX_NAME]; + int chip_type; + u8 product [MPT_PRODUCT_LENGTH]; +}; + +/* Replace the FW image cached in host driver memory + * newImageSize - image size in bytes + * newImage - first byte of the new image + */ +typedef struct mpt_ioctl_replace_fw { + mpt_ioctl_header hdr; + int newImageSize; + u8 newImage[1]; +} mpt_ioctl_replace_fw_t; + +/* General MPT Pass through data strucutre + * + * iocnum + * timeout - in seconds, command timeout. If 0, set by driver to + * default value. + * replyFrameBufPtr - reply location + * dataInBufPtr - destination for read + * dataOutBufPtr - data source for write + * senseDataPtr - sense data location + * maxReplyBytes - maximum number of reply bytes to be sent to app. + * dataInSize - num bytes for data transfer in (read) + * dataOutSize - num bytes for data transfer out (write) + * dataSgeOffset - offset in words from the start of the request message + * to the first SGL + * MF[1]; + * + * Remark: Some config pages have bi-directional transfer, + * both a read and a write. The basic structure allows for + * a bidirectional set up. Normal messages will have one or + * both of these buffers NULL. + */ +struct mpt_ioctl_command { + mpt_ioctl_header hdr; + int timeout; /* optional (seconds) */ + char *replyFrameBufPtr; + char *dataInBufPtr; + char *dataOutBufPtr; + char *senseDataPtr; + int maxReplyBytes; + int dataInSize; + int dataOutSize; + int maxSenseBytes; + int dataSgeOffset; + char MF[1]; +}; + +/* + * SPARC PLATFORM: See earlier remark. + */ +#if defined(__KERNEL__) && defined(__sparc__) && defined(__sparc_v9__) /*{*/ +struct mpt_ioctl_command32 { + mpt_ioctl_header hdr; + int timeout; + u32 replyFrameBufPtr; + u32 dataInBufPtr; + u32 dataOutBufPtr; + u32 senseDataPtr; + int maxReplyBytes; + int dataInSize; + int dataOutSize; + int maxSenseBytes; + int dataSgeOffset; + char MF[1]; +}; +#endif /*}*/ + + + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ + /* + * COMPAQ Specific IOCTL Defines and Structures + */ + +#define CPQFCTS_IOC_MAGIC 'Z' + +#define CPQFCTS_GETPCIINFO _IOR(CPQFCTS_IOC_MAGIC, 1, cpqfc_pci_info_struct) +#define CPQFCTS_GETDRIVER _IOR(CPQFCTS_IOC_MAGIC, 2, int) +#define CPQFCTS_CTLR_STATUS _IOR(CPQFCTS_IOC_MAGIC, 3, struct _cpqfc_ctlr_status) +#define CPQFCTS_SCSI_IOCTL_FC_TARGET_ADDRESS _IOR(CPQFCTS_IOC_MAGIC, 4, struct scsi_fctargaddress) +#define CPQFCTS_SCSI_PASSTHRU _IOWR(CPQFCTS_IOC_MAGIC, 5, VENDOR_IOCTL_REQ) +#if defined(__sparc__) && defined(__sparc_v9__) +#define CPQFCTS_SCSI_PASSTHRU32 _IOWR(CPQFCTS_IOC_MAGIC, 5, VENDOR_IOCTL_REQ32) +#endif + +typedef struct { + unsigned short bus; + unsigned short bus_type; + unsigned short device_fn; + u32 board_id; + u32 slot_number; + unsigned short vendor_id; + unsigned short device_id; + unsigned short class_code; + unsigned short sub_vendor_id; + unsigned short sub_device_id; + u8 serial_number[81]; +} cpqfc_pci_info_struct; + + +typedef struct scsi_fctargaddress { + unsigned int host_port_id; + u8 host_wwn[8]; /* WW Network Name */ +} Scsi_FCTargAddress; + +typedef struct _cpqfc_ctlr_status { + u32 status; + u32 offline_reason; +} cpqfc_ctlr_status; + + +/* Compaq SCSI I/O Passthru structures. + */ +#define MPT_COMPAQ_READ 0x26 +#define MPT_COMPAQ_WRITE 0x27 + +typedef struct { + int lc; /* controller number */ + int node; /* node number */ + int ld; /* target logical id */ + u32 nexus; + void *argp; +} VENDOR_IOCTL_REQ; + +#if defined(__KERNEL__) && defined(__sparc__) && defined(__sparc_v9__) /*{*/ +typedef struct { + int lc; /* controller number */ + int node; /* node number */ + int ld; /* target logical id */ + u32 nexus; + u32 argp; +} VENDOR_IOCTL_REQ32; +#endif + +typedef struct { + char cdb[16]; /* cdb */ + unsigned short bus; /* bus number */ + unsigned short pdrive; /* physical drive */ + int len; /* data area size */ + int sense_len; /* sense size */ + char sense_data[40]; /* sense buffer */ + void *bufp; /* data buffer pointer */ + char rw_flag; +} cpqfc_passthru_t; + +#if defined(__KERNEL__) && defined(__sparc__) && defined(__sparc_v9__) /*{*/ +typedef struct { + char cdb[16]; /* cdb */ + unsigned short bus; /* bus number */ + unsigned short pdrive; /* physical drive */ + int len; /* data area size */ + int sense_len; /* sense size */ + char sense_data[40]; /* sense buffer */ + u32 bufp; /* data buffer pointer */ + char rw_flag; +} cpqfc_passthru32_t; +#endif + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ + + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ + +#endif + diff -urN linux-2.4.18/drivers/message/fusion/mptlan.c lia64-2.4/drivers/message/fusion/mptlan.c --- linux-2.4.18/drivers/message/fusion/mptlan.c Wed Oct 10 16:31:56 2001 +++ lia64-2.4/drivers/message/fusion/mptlan.c Tue Mar 19 15:05:36 2002 @@ -23,10 +23,10 @@ * * (see also mptbase.c) * - * Copyright (c) 2000-2001 LSI Logic Corporation + * Copyright (c) 2000-2002 LSI Logic Corporation * Originally By: Noah Romer * - * $Id: mptlan.c,v 1.32.2.2 2001/07/12 19:43:33 nromer Exp $ + * $Id: mptlan.c,v 1.51 2002/02/11 14:40:55 sralston Exp $ */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* @@ -79,6 +79,8 @@ #define MYNAM "mptlan" +MODULE_LICENSE("GPL"); + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * MPT LAN message sizes without variable part. @@ -109,8 +111,8 @@ MPT_ADAPTER *mpt_dev; u8 pnum; /* Port number in the IOC. This is not a Unix network port! */ - atomic_t buckets_out; /* number of unused buckets on IOC */ - int bucketthresh; /* Send more when this many used */ + atomic_t buckets_out; /* number of unused buckets on IOC */ + int bucketthresh; /* Send more when this many left */ int *mpt_txfidx; /* Free Tx Context list */ int mpt_txfidx_tail; @@ -123,8 +125,8 @@ struct BufferControl *RcvCtl; /* Receive BufferControl structs */ struct BufferControl *SendCtl; /* Send BufferControl structs */ - int max_buckets_out; /* Max buckets to send to IOC */ - int tx_max_out; /* IOC's Tx queue len */ + int max_buckets_out; /* Max buckets to send to IOC */ + int tx_max_out; /* IOC's Tx queue len */ u32 total_posted; u32 total_received; @@ -152,7 +154,8 @@ static int mpt_lan_reset(struct net_device *dev); static int mpt_lan_close(struct net_device *dev); static void mpt_lan_post_receive_buckets(void *dev_id); -static void mpt_lan_wake_post_buckets_task(struct net_device *dev); +static void mpt_lan_wake_post_buckets_task(struct net_device *dev, + int priority); static int mpt_lan_receive_post_turbo(struct net_device *dev, u32 tmsg); static int mpt_lan_receive_post_reply(struct net_device *dev, LANReceivePostReply_t *pRecvRep); @@ -175,8 +178,10 @@ static struct net_device *mpt_landev[MPT_MAX_ADAPTERS+1]; +#ifdef QLOGIC_NAA_WORKAROUND static struct NAA_Hosed *mpt_bad_naa = NULL; rwlock_t bad_naa_lock; +#endif /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* @@ -229,7 +234,7 @@ case LAN_REPLY_FORM_SEND_SINGLE: // dioprintk((MYNAM "/lan_reply: " // "calling mpt_lan_send_reply (turbo)\n")); - + // Potential BUG here? -sralston // FreeReqFrame = mpt_lan_send_turbo(dev, tmsg); // If/when mpt_lan_send_turbo would return 1 here, @@ -333,7 +338,7 @@ struct net_device *dev = mpt_landev[ioc->id]; struct mpt_lan_priv *priv = (struct mpt_lan_priv *) dev->priv; - dprintk((KERN_INFO MYNAM ": IOC %s_reset routed to LAN driver!\n", + dlprintk((KERN_INFO MYNAM ": IOC %s_reset routed to LAN driver!\n", reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post")); if (priv->mpt_rxfidx == NULL) @@ -342,9 +347,11 @@ if (reset_phase == MPT_IOC_PRE_RESET) { int i; unsigned long flags; - + netif_stop_queue(dev); + dlprintk ((KERN_INFO "mptlan/ioc_reset: called netif_stop_queue for %s.\n", dev->name)); + atomic_set(&priv->buckets_out, 0); /* Reset Rx Free Tail index and re-populate the queue. */ @@ -365,7 +372,7 @@ static int mpt_lan_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) { - dprintk((KERN_INFO MYNAM ": MPT event routed to LAN driver!\n")); + dlprintk((KERN_INFO MYNAM ": MPT event routed to LAN driver!\n")); switch (le32_to_cpu(pEvReply->Event)) { case MPI_EVENT_NONE: /* 00 */ @@ -403,9 +410,9 @@ if (mpt_lan_reset(dev) != 0) { MPT_ADAPTER *mpt_dev = priv->mpt_dev; - + printk (KERN_WARNING MYNAM "/lan_open: lan_reset failed."); - + if (mpt_dev->active) printk ("The ioc is active. Perhaps it needs to be" " reset?\n"); @@ -429,7 +436,7 @@ priv->mpt_txfidx[++priv->mpt_txfidx_tail] = i; } - dprintk((KERN_INFO MYNAM "@lo: Finished initializing SendCtl\n")); + dlprintk((KERN_INFO MYNAM "@lo: Finished initializing SendCtl\n")); priv->mpt_rxfidx = kmalloc(priv->max_buckets_out * sizeof(int), GFP_KERNEL); @@ -447,12 +454,12 @@ priv->mpt_rxfidx[++priv->mpt_rxfidx_tail] = i; } -/**/ dprintk((KERN_INFO MYNAM "/lo: txfidx contains - ")); +/**/ dlprintk((KERN_INFO MYNAM "/lo: txfidx contains - ")); /**/ for (i = 0; i < priv->tx_max_out; i++) -/**/ dprintk((" %xh", priv->mpt_txfidx[i])); -/**/ dprintk(("\n")); +/**/ dlprintk((" %xh", priv->mpt_txfidx[i])); +/**/ dlprintk(("\n")); - dprintk((KERN_INFO MYNAM "/lo: Finished initializing RcvCtl\n")); + dlprintk((KERN_INFO MYNAM "/lo: Finished initializing RcvCtl\n")); mpt_lan_post_receive_buckets(dev); printk(KERN_INFO MYNAM ": %s/%s: interface up & active\n", @@ -466,7 +473,7 @@ } netif_start_queue(dev); - dprintk((KERN_INFO MYNAM "/lo: Done.\n")); + dlprintk((KERN_INFO MYNAM "/lo: Done.\n")); return 0; out_mpt_rxfidx: @@ -494,7 +501,7 @@ mf = mpt_get_msg_frame(LanCtx, priv->mpt_dev->id); if (mf == NULL) { -/* dprintk((KERN_ERR MYNAM "/reset: Evil funkiness abounds! " +/* dlprintk((KERN_ERR MYNAM "/reset: Evil funkiness abounds! " "Unable to allocate a request frame.\n")); */ return -1; @@ -523,11 +530,11 @@ unsigned int timeout; int i; - dprintk((KERN_INFO MYNAM ": mpt_lan_close called\n")); + dlprintk((KERN_INFO MYNAM ": mpt_lan_close called\n")); mpt_event_deregister(LanCtx); - dprintk((KERN_INFO MYNAM ":lan_close: Posted %d buckets " + dlprintk((KERN_INFO MYNAM ":lan_close: Posted %d buckets " "since driver was loaded, %d still out\n", priv->total_posted,atomic_read(&priv->buckets_out))); @@ -537,18 +544,18 @@ timeout = 2 * HZ; while (atomic_read(&priv->buckets_out) && --timeout) { - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(1); } for (i = 0; i < priv->max_buckets_out; i++) { if (priv->RcvCtl[i].skb != NULL) { -/**/ dprintk((KERN_INFO MYNAM "/lan_close: bucket %05x " +/**/ dlprintk((KERN_INFO MYNAM "/lan_close: bucket %05x " /**/ "is still out\n", i)); pci_unmap_single(mpt_dev->pcidev, priv->RcvCtl[i].dma, - priv->RcvCtl[i].len, + priv->RcvCtl[i].len, PCI_DMA_FROMDEVICE); - dev_kfree_skb(priv->RcvCtl[i].skb); + dev_kfree_skb(priv->RcvCtl[i].skb); } } @@ -556,11 +563,11 @@ kfree (priv->mpt_rxfidx); for (i = 0; i < priv->tx_max_out; i++) { - if (priv->SendCtl[i].skb != NULL) { + if (priv->SendCtl[i].skb != NULL) { pci_unmap_single(mpt_dev->pcidev, priv->SendCtl[i].dma, priv->SendCtl[i].len, PCI_DMA_TODEVICE); - dev_kfree_skb(priv->SendCtl[i].skb); + dev_kfree_skb(priv->SendCtl[i].skb); } } @@ -599,7 +606,13 @@ static void mpt_lan_tx_timeout(struct net_device *dev) { - netif_wake_queue(dev); + struct mpt_lan_priv *priv = (struct mpt_lan_priv *) dev->priv; + MPT_ADAPTER *mpt_dev = priv->mpt_dev; + + if (mpt_dev->active) { + dlprintk (("mptlan/tx_timeout: calling netif_wake_queue for %s.\n", dev->name)); + netif_wake_queue(dev); + } } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ @@ -722,7 +735,6 @@ dma_addr_t dma; unsigned long flags; int ctx; - struct NAA_Hosed *nh; u16 cur_naa = 0x1000; dioprintk((KERN_INFO MYNAM ": %s called, skb_addr = %p\n", @@ -741,7 +753,6 @@ mf = mpt_get_msg_frame(LanCtx, mpt_dev->id); if (mf == NULL) { netif_stop_queue(dev); - dev_kfree_skb(skb); spin_unlock_irqrestore(&priv->txfidx_lock, flags); printk (KERN_ERR "%s: Unable to alloc request frame\n", @@ -791,6 +802,10 @@ // IOC_AND_NETDEV_NAMES_s_s(dev), // ctx, skb, skb->data)); +#ifdef QLOGIC_NAA_WORKAROUND +{ + struct NAA_Hosed *nh; + /* Munge the NAA for Tx packets to QLogic boards, which don't follow RFC 2625. The longer I look at this, the more my opinion of Qlogic drops. */ @@ -803,12 +818,14 @@ (nh->ieee[4] == skb->mac.raw[4]) && (nh->ieee[5] == skb->mac.raw[5])) { cur_naa = nh->NAA; - dprintk ((KERN_INFO "mptlan/sdu_send: using NAA value " + dlprintk ((KERN_INFO "mptlan/sdu_send: using NAA value " "= %04x.\n", cur_naa)); break; } } read_unlock_irq(&bad_naa_lock); +} +#endif pTrans->TransactionDetails[0] = cpu_to_le32((cur_naa << 16) | (skb->mac.raw[0] << 8) | @@ -821,10 +838,10 @@ pSimple = (SGESimple64_t *) &pTrans->TransactionDetails[2]; /* If we ever decide to send more than one Simple SGE per LANSend, then - we will need to make sure that LAST_ELEMENT only gets set on the + we will need to make sure that LAST_ELEMENT only gets set on the last one. Otherwise, bad voodoo and evil funkiness will commence. */ pSimple->FlagsLength = cpu_to_le32( - ((MPI_SGE_FLAGS_LAST_ELEMENT | + ((MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_SYSTEM_ADDRESS | @@ -842,23 +859,32 @@ dev->trans_start = jiffies; dioprintk((KERN_INFO MYNAM ": %s/%s: Sending packet. FlagsLength = %08x.\n", - IOC_AND_NETDEV_NAMES_s_s(dev), - le32_to_cpu(pSimple->FlagsLength))); + IOC_AND_NETDEV_NAMES_s_s(dev), + le32_to_cpu(pSimple->FlagsLength))); return 0; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ static inline void -mpt_lan_wake_post_buckets_task(struct net_device *dev) +mpt_lan_wake_post_buckets_task(struct net_device *dev, int priority) +/* + * @priority: 0 = put it on the timer queue, 1 = put it on the immediate queue + */ { struct mpt_lan_priv *priv = dev->priv; - + if (test_and_set_bit(0, &priv->post_buckets_active) == 0) { - queue_task(&priv->post_buckets_task, &tq_immediate); - mark_bh(IMMEDIATE_BH); - dioprintk((KERN_INFO MYNAM ": %s/%s: Queued post_buckets task.\n", - IOC_AND_NETDEV_NAMES_s_s(dev) )); + if (priority) { + queue_task(&priv->post_buckets_task, &tq_immediate); + mark_bh(IMMEDIATE_BH); + } else { + queue_task(&priv->post_buckets_task, &tq_timer); + dioprintk((KERN_INFO MYNAM ": post_buckets queued on " + "timer.\n")); + } + dioprintk((KERN_INFO MYNAM ": %s/%s: Queued post_buckets task.\n", + IOC_AND_NETDEV_NAMES_s_s(dev) )); } } @@ -870,7 +896,7 @@ skb->protocol = mpt_lan_type_trans(skb, dev); - dioprintk((KERN_INFO MYNAM ": %s/%s: Incoming packet (%d bytes) " + dioprintk((KERN_INFO MYNAM ": %s/%s: Incoming packet (%d bytes) " "delivered to upper level.\n", IOC_AND_NETDEV_NAMES_s_s(dev), skb->len)); @@ -884,7 +910,7 @@ atomic_read(&priv->buckets_out))); if (atomic_read(&priv->buckets_out) < priv->bucketthresh) - mpt_lan_wake_post_buckets_task(dev); + mpt_lan_wake_post_buckets_task(dev, 1); dioprintk((KERN_INFO MYNAM "/receive_post_reply: %d buckets " "remaining, %d received back since sod\n", @@ -956,12 +982,12 @@ unsigned long flags; struct sk_buff *skb; u32 ctx; - u8 count; + int count; int i; count = pRecvRep->NumberOfContexts; -/**/ dprintk((KERN_INFO MYNAM "/receive_post_reply: " +/**/ dlprintk((KERN_INFO MYNAM "/receive_post_reply: " "IOC returned %d buckets, freeing them...\n", count)); spin_lock_irqsave(&priv->rxfidx_lock, flags); @@ -970,11 +996,11 @@ skb = priv->RcvCtl[ctx].skb; -// dprintk((KERN_INFO MYNAM ": %s: dev_name = %s\n", +// dlprintk((KERN_INFO MYNAM ": %s: dev_name = %s\n", // IOC_AND_NETDEV_NAMES_s_s(dev))); -// dprintk((KERN_INFO MYNAM "@rpr[2], priv = %p, buckets_out addr = %p", -// priv, &(priv->buckets_out))); -// dprintk((KERN_INFO MYNAM "@rpr[2] TC + 3\n")); +// dlprintk((KERN_INFO MYNAM "@rpr[2], priv = %p, buckets_out addr = %p", +// priv, &(priv->buckets_out))); +// dlprintk((KERN_INFO MYNAM "@rpr[2] TC + 3\n")); priv->RcvCtl[ctx].skb = NULL; pci_unmap_single(mpt_dev->pcidev, priv->RcvCtl[ctx].dma, @@ -989,13 +1015,13 @@ // for (i = 0; i < priv->max_buckets_out; i++) // if (priv->RcvCtl[i].skb != NULL) -// dprintk((KERN_INFO MYNAM "@rpr: bucket %03x " +// dlprintk((KERN_INFO MYNAM "@rpr: bucket %03x " // "is still out\n", i)); -/* dprintk((KERN_INFO MYNAM "/receive_post_reply: freed %d buckets\n", +/* dlprintk((KERN_INFO MYNAM "/receive_post_reply: freed %d buckets\n", count)); */ -/**/ dprintk((KERN_INFO MYNAM "@receive_post_reply: %d buckets " +/**/ dlprintk((KERN_INFO MYNAM "@receive_post_reply: %d buckets " /**/ "remaining, %d received back since sod.\n", /**/ atomic_read(&priv->buckets_out), priv->total_received)); return 0; @@ -1010,9 +1036,9 @@ MPT_ADAPTER *mpt_dev = priv->mpt_dev; struct sk_buff *skb, *old_skb; unsigned long flags; - u32 len, ctx; - u32 offset; - u8 count; + u32 len, ctx, offset; + u32 remaining = le32_to_cpu(pRecvRep->BucketsRemaining); + int count; int i, l; dioprintk((KERN_INFO MYNAM ": mpt_lan_receive_post_reply called\n")); @@ -1059,7 +1085,7 @@ if (!skb) { printk (KERN_ERR MYNAM ": %s/%s: ERROR - Can't allocate skb! (%s@%d)\n", IOC_AND_NETDEV_NAMES_s_s(dev), - __FILE__, __LINE__); + __FILE__, __LINE__); return -ENOMEM; } @@ -1096,7 +1122,7 @@ if (!skb) { printk (KERN_ERR MYNAM ": %s/%s: ERROR - Can't allocate skb! (%s@%d)\n", IOC_AND_NETDEV_NAMES_s_s(dev), - __FILE__, __LINE__); + __FILE__, __LINE__); return -ENOMEM; } @@ -1140,25 +1166,32 @@ "Arrgghh! We've done it again!\n"); } -#if 0 - { - u32 remaining = le32_to_cpu(pRecvRep->BucketsRemaining); - if (remaining < priv->bucketthresh) - mpt_lan_wake_post_buckets_task(dev); - - if (remaining == 0) - printk (KERN_WARNING MYNAM ": %s/%s: WARNING - IOC out of buckets! " - "(priv->buckets_out = %d)\n", - IOC_AND_NETDEV_NAMES_s_s(dev), - atomic_read(&priv->buckets_out)); - else - printk (KERN_INFO MYNAM ": %s/%s: IOC says %d buckets left. " - "(priv->buckets_out = %d)\n", - IOC_AND_NETDEV_NAMES_s_s(dev), - remaining, atomic_read(&priv->buckets_out)); + if (remaining == 0) + printk (KERN_WARNING MYNAM ": %s/%s: WARNING - IOC out of buckets! " + "(priv->buckets_out = %d)\n", + IOC_AND_NETDEV_NAMES_s_s(dev), + atomic_read(&priv->buckets_out)); + else if (remaining < 10) + printk (KERN_INFO MYNAM ": %s/%s: IOC says %d buckets left. " + "(priv->buckets_out = %d)\n", + IOC_AND_NETDEV_NAMES_s_s(dev), + remaining, atomic_read(&priv->buckets_out)); + + if ((remaining < priv->bucketthresh) && + ((atomic_read(&priv->buckets_out) - remaining) > + MPT_LAN_BUCKETS_REMAIN_MISMATCH_THRESH)) { + + printk (KERN_WARNING MYNAM " Mismatch between driver's " + "buckets_out count and fw's BucketsRemaining " + "count has crossed the threshold, issuing a " + "LanReset to clear the fw's hashtable. You may " + "want to check your /var/log/messages for \"CRC " + "error\" event notifications.\n"); + + mpt_lan_reset(dev); + mpt_lan_wake_post_buckets_task(dev, 0); } -#endif - + return mpt_lan_receive_skb(dev, skb); } @@ -1242,15 +1275,15 @@ if (skb == NULL) { skb = dev_alloc_skb(len); if (skb == NULL) { -/**/ printk (KERN_WARNING -/**/ MYNAM "/%s: Can't alloc skb\n", -/**/ __FUNCTION__); + printk (KERN_WARNING + MYNAM "/%s: Can't alloc skb\n", + __FUNCTION__); priv->mpt_rxfidx[++priv->mpt_rxfidx_tail] = ctx; spin_unlock_irqrestore(&priv->rxfidx_lock, flags); break; } - dma = pci_map_single(mpt_dev->pcidev, skb->data, + dma = pci_map_single(mpt_dev->pcidev, skb->data, len, PCI_DMA_FROMDEVICE); priv->RcvCtl[ctx].skb = skb; @@ -1308,7 +1341,7 @@ dioprintk((KERN_INFO MYNAM "/%s: End_buckets = %u, priv->buckets_out = %u\n", __FUNCTION__, buckets, atomic_read(&priv->buckets_out))); dioprintk((KERN_INFO MYNAM "/%s: Posted %u buckets and received %u back\n", - __FUNCTION__, priv->total_posted, priv->total_received)); + __FUNCTION__, priv->total_posted, priv->total_received)); clear_bit(0, &priv->post_buckets_active); } @@ -1336,7 +1369,7 @@ priv->post_buckets_task.data = dev; priv->post_buckets_active = 0; - dprintk((KERN_INFO MYNAM "@%d: bucketlen = %d\n", + dlprintk((KERN_INFO MYNAM "@%d: bucketlen = %d\n", __LINE__, dev->mtu + dev->hard_header_len + 4)); atomic_set(&priv->buckets_out, 0); @@ -1346,7 +1379,7 @@ if (mpt_dev->pfacts[0].MaxLanBuckets < max_buckets_out) priv->max_buckets_out = mpt_dev->pfacts[0].MaxLanBuckets; - dprintk((KERN_INFO MYNAM "@%d: MaxLanBuckets=%d, max_buckets_out/priv=%d/%d\n", + dlprintk((KERN_INFO MYNAM "@%d: MaxLanBuckets=%d, max_buckets_out/priv=%d/%d\n", __LINE__, mpt_dev->pfacts[0].MaxLanBuckets, max_buckets_out, @@ -1389,7 +1422,7 @@ dev->tx_timeout = mpt_lan_tx_timeout; dev->watchdog_timeo = MPT_LAN_TX_TIMEOUT; - dprintk((KERN_INFO MYNAM ": Finished registering dev " + dlprintk((KERN_INFO MYNAM ": Finished registering dev " "and setting initial values\n")); SET_MODULE_OWNER(dev); @@ -1407,9 +1440,11 @@ show_mptmod_ver(LANAME, LANVER); - /* Init the global r/w lock for the bad_naa list. We want to do this +#ifdef QLOGIC_NAA_WORKAROUND + /* Init the global r/w lock for the bad_naa list. We want to do this before any boards are initialized and may be used. */ rwlock_init(&bad_naa_lock); +#endif if ((LanCtx = mpt_register(lan_reply, MPTLAN_DRIVER)) <= 0) { printk (KERN_ERR MYNAM ": Failed to register with MPT base driver\n"); @@ -1419,10 +1454,10 @@ /* Set the callback index to be used by driver core for turbo replies */ mpt_lan_index = LanCtx; - dprintk((KERN_INFO MYNAM ": assigned context of %d\n", LanCtx)); + dlprintk((KERN_INFO MYNAM ": assigned context of %d\n", LanCtx)); if (mpt_reset_register(LanCtx, mpt_lan_ioc_reset) == 0) { - dprintk((KERN_INFO MYNAM ": Registered for IOC reset notifications\n")); + dlprintk((KERN_INFO MYNAM ": Registered for IOC reset notifications\n")); } else { printk(KERN_ERR MYNAM ": Eieee! unable to register a reset " "handler with mptbase! The world is at an end! " @@ -1458,7 +1493,7 @@ // IOC_AND_NETDEV_NAMES_s_s(dev), // NETDEV_TO_LANPRIV_PTR(dev)->tx_max_out); mpt_landev[j] = dev; - dprintk((KERN_INFO MYNAM "/init: dev_addr=%p, mpt_landev[%d]=%p\n", + dlprintk((KERN_INFO MYNAM "/init: dev_addr=%p, mpt_landev[%d]=%p\n", dev, j, mpt_landev[j])); j++; @@ -1508,18 +1543,15 @@ MODULE_PARM(tx_max_out_p, "i"); MODULE_PARM(max_buckets_out, "i"); // Debug stuff. FIXME! -MODULE_LICENSE("GPL"); - module_init(mpt_lan_init); module_exit(mpt_lan_exit); /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ static unsigned short -mpt_lan_type_trans(struct sk_buff *skb, struct net_device *dev) +mpt_lan_type_trans(struct sk_buff *skb, struct net_device *dev) { struct mpt_lan_ohdr *fch = (struct mpt_lan_ohdr *)skb->data; struct fcllc *fcllc; - u16 source_naa = fch->stype, found = 0; skb->mac.raw = skb->data; skb_pull(skb, sizeof(struct mpt_lan_ohdr)); @@ -1535,7 +1567,7 @@ printk (KERN_WARNING MYNAM ": %s: WARNING - Broadcast swap F/W bug detected!\n", NETDEV_PTR_TO_IOC_NAME_s(dev)); printk (KERN_WARNING MYNAM ": Please update sender @ MAC_addr = %02x:%02x:%02x:%02x:%02x:%02x\n", - fch->saddr[0], fch->saddr[1], fch->saddr[2], + fch->saddr[0], fch->saddr[1], fch->saddr[2], fch->saddr[3], fch->saddr[4], fch->saddr[5]); } @@ -1555,6 +1587,10 @@ fcllc = (struct fcllc *)skb->data; +#ifdef QLOGIC_NAA_WORKAROUND +{ + u16 source_naa = fch->stype, found = 0; + /* Workaround for QLogic not following RFC 2625 in regards to the NAA value. */ @@ -1562,15 +1598,15 @@ source_naa = swab16(source_naa); if (fcllc->ethertype == htons(ETH_P_ARP)) - dprintk ((KERN_INFO "mptlan/type_trans: got arp req/rep w/ naa of " + dlprintk ((KERN_INFO "mptlan/type_trans: got arp req/rep w/ naa of " "%04x.\n", source_naa)); - if ((fcllc->ethertype == htons(ETH_P_ARP)) && + if ((fcllc->ethertype == htons(ETH_P_ARP)) && ((source_naa >> 12) != MPT_LAN_NAA_RFC2625)){ struct NAA_Hosed *nh, *prevnh; int i; - dprintk ((KERN_INFO "mptlan/type_trans: ARP Req/Rep from " + dlprintk ((KERN_INFO "mptlan/type_trans: ARP Req/Rep from " "system with non-RFC 2625 NAA value (%04x).\n", source_naa)); @@ -1584,17 +1620,17 @@ (nh->ieee[4] == fch->saddr[4]) && (nh->ieee[5] == fch->saddr[5])) { found = 1; - dprintk ((KERN_INFO "mptlan/type_trans: ARP Re" + dlprintk ((KERN_INFO "mptlan/type_trans: ARP Re" "q/Rep w/ bad NAA from system already" " in DB.\n")); break; } } - + if ((!found) && (nh == NULL)) { nh = kmalloc(sizeof(struct NAA_Hosed), GFP_KERNEL); - dprintk ((KERN_INFO "mptlan/type_trans: ARP Req/Rep w/" + dlprintk ((KERN_INFO "mptlan/type_trans: ARP Req/Rep w/" " bad NAA from system not yet in DB.\n")); if (nh != NULL) { @@ -1603,11 +1639,11 @@ mpt_bad_naa = nh; if (prevnh) prevnh->next = nh; - + nh->NAA = source_naa; /* Set the S_NAA value. */ for (i = 0; i < FC_ALEN; i++) nh->ieee[i] = fch->saddr[i]; - dprintk ((KERN_INFO "Got ARP from %02x:%02x:%02x:%02x:" + dlprintk ((KERN_INFO "Got ARP from %02x:%02x:%02x:%02x:" "%02x:%02x with non-compliant S_NAA value.\n", fch->saddr[0], fch->saddr[1], fch->saddr[2], fch->saddr[3], fch->saddr[4],fch->saddr[5])); @@ -1622,9 +1658,10 @@ } write_unlock_irq(&bad_naa_lock); } - +} +#endif - /* Strip the SNAP header from ARP packets since we don't + /* Strip the SNAP header from ARP packets since we don't * pass them through to the 802.2/SNAP layers. */ if (fcllc->dsap == EXTENDED_SAP && diff -urN linux-2.4.18/drivers/message/fusion/mptlan.h lia64-2.4/drivers/message/fusion/mptlan.h --- linux-2.4.18/drivers/message/fusion/mptlan.h Mon Sep 24 15:07:20 2001 +++ lia64-2.4/drivers/message/fusion/mptlan.h Wed Feb 27 14:25:30 2002 @@ -21,6 +21,7 @@ #include #include #include +#include // #include #include @@ -43,13 +44,15 @@ #define MPT_LAN_MAX_BUCKETS_OUT 256 #define MPT_LAN_BUCKET_THRESH 18 /* 9 buckets in one message */ +#define MPT_LAN_BUCKETS_REMAIN_MISMATCH_THRESH 10 #define MPT_LAN_RX_COPYBREAK 200 -#define MPT_LAN_TX_TIMEOUT (1*HZ) +#define MPT_LAN_TX_TIMEOUT (1*HZ) #define MPT_TX_MAX_OUT_LIM 127 #define MPT_LAN_MIN_MTU 96 /* RFC2625 */ #define MPT_LAN_MAX_MTU 65280 /* RFC2625 */ -#define MPT_LAN_MTU 16128 /* be nice to slab allocator */ +#define MPT_LAN_MTU 13312 /* Max perf range + lower mem + usage than 16128 */ #define MPT_LAN_NAA_RFC2625 0x1 #define MPT_LAN_NAA_QLOGIC 0x2 @@ -64,6 +67,12 @@ #define dioprintk(x) printk x #else #define dioprintk(x) +#endif + +#ifdef MPT_LAN_DEBUG +#define dlprintk(x) printk x +#else +#define dlprintk(x) #endif #define NETDEV_TO_LANPRIV_PTR(d) ((struct mpt_lan_priv *)(d)->priv) diff -urN linux-2.4.18/drivers/message/fusion/mptlinux.txt lia64-2.4/drivers/message/fusion/mptlinux.txt --- linux-2.4.18/drivers/message/fusion/mptlinux.txt Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/message/fusion/mptlinux.txt Tue Mar 19 15:05:36 2002 @@ -0,0 +1,470 @@ +****************************************************************************** + mptlinux.txt +****************************************************************************** + +This file presents general information about the LSI Logic Fusion MPT(TM) +(Message Passing Technology) device drivers for Linux(TM). +It also describes the features and use of the device drivers for the +Linux operating system environment. + +This file is divided into the following sections: + Introduction + Features + LSI Logic Devices Supported + Installing the Fusion MPT Linux Drivers + Custom Linux Kernel Installation Instructions + Adding Fusion MPT support to the Kernel + Updating Bundled Fusion MPT Driver + Kernel Patch Instructions + General Information + IA64 Details + Driver Build Instructions + Loading the Drivers As Modules + Boot Setup Commands + Syntax + Available Arguments + Configuring Network Interfaces for MPT LAN Support + Troubleshooting + +******************************** Introduction ******************************** + +The mptlinux drivers are free software and are supported in source form. +These drivers are distributed in the hope that they will be useful, but +without any warranty and without even the implied warranty of merchantability +or fitness for a particular purpose. You can redistribute them and/or modify +them under the terms of version 2 or later of the GNU Public License as +published by the Free Software Foundation. You should have received a copy +of this license with your Linux kernel source tree (/usr/src/linux/COPYING). +For detailed information on the GNU Public License, contact the Free Software +Foundation, Inc at 59 Temple Place - Suite 330, Boston, MA 02111-1307 or at +URL http://www.gnu.org/copyleft/gpl.html. + +=== Features === + +o Supports SCSI and IETF-compliant LAN protocols concurrently over FC +o Supports 1Gbit/s Fibre Channel transfer rates (LSIFC909) +o Supports 1Gbit/s and 2Gbit/s Fibre Channel transfer rates (LSIFC919, + LSIFC929) +o Supports Ultra320 transfer rates (LSI53C1030) +o Supports LSI Logic Fusion MPT Architecture and common software interface +o Low host CPU utilization with one, or less than one, interrupt per I/O + +=== LSI Logic Devices Supported === + +o LSIFC909 chips and LSI40909 adapters +o LSIFC919 chips and LSI40919 adapters +o LSIFC929 chips and LSI44929 adapters +o LSI53C1030 chips and LSI22320 adapters + +****************** Installing the Fusion MPT Linux Drivers ******************* + +=== Custom Linux Kernel Installation Instructions === + +The mptlinux drivers are provided in source form so that the drivers can +be compiled and installed on any system running Linux. You must have the +linux kernel source tree available to perform the procedures below. + +------ Adding Fusion MPT support to the Kernel + +For Red Hat 7.0, all 2.2 and 2.4.0 through 2.4.6 kernels, Fusion MPT support +must be added to the kernel source. + +The mptlinux driver source tar archive should be unpacked from the root of +your linux kernel source tree (normally /usr/src/linux). + Example: + $ cd /usr/src/linux + $ zcat /tmp/mptlinux-2.00.11-src.tar.gz | tar xvf - + +------ Updating Bundled Fusion MPT Driver + +A version of the mptlinux driver is bundled in Red Hat 7.1 and 7.2 +and official kernels starting with version 2.4.7. + +Before updating the bundled source, save the original driver tree +in a compressed tar file. + Example: + # cd /usr/src/linux/drivers/message + # tar czvf fusion.orig.tar.gz fusion + +Delete the original driver tree and unpack the new driver files + Example: + # rm -rf fusion + # cd /usr/src/linux + # zcat /tmp/mptlinux-2.00.11-src.tar.gz | tar xvf - + +(Deletion of the original driver tree is necessary to remove obsolete files.) + +=== Kernel Patch Instructions === + +------ General Information + +The mptlinux host drivers may require a small set of patches to your linux kernel +source tree. Patch sets for stock and "well known" kernel versions have been +included with the packed source tar archive. Patches may be required even if +the mptlinux driver is currently bundled. + Fusion patch files available for linux 2.2.x kernel versions: + 2.2.5-15, 2.2.5-16, (Red Hat 6.0) + 2.2.12, + 2.2.12-20, (Red Hat 6.1) + 2.2.13, + 2.2.14, + 2.2.14-5.0, 2.2.14-6.0, (Red Hat 6.2) + 2.2.14-caldera, (Caldera 2.3.1) + 2.2.15, + 2.2.16, + 2.2.16-22, (Red Hat 7.0) + 2.2.17, + 2.2.18, + 2.2.18-2, (TurboLinux 6.5) + 2.2.19, + 2.2.20 + Fusion patch files available for linux 2.4.x kernel versions: + 2.4.0, + 2.4.1, + 2.4.2, + 2.4.2-2, (Red Hat 7.1) + , (Caldera 3.1) + 2.4.3, + 2.4.3-12, (Red Hat 7.1, upd#1) + 2.4.4, + 2.4.4-4GB, (SuSE 7.2) + 2.4.5, + 2.4.6, + 2.4.7, + 2.4.7-10, (Red Hat 7.2) + 2.4.8, + 2.4.9, + 2.4.9-6, (Red Hat 7.1, upd#2) + 2.4.9-13, (Red Hat 7.2, upd#1) + 2.4.9-18, (Red Hat 7.2 IA64) + 2.4.9-21, (Red Hat 7.2, upd#2) + 2.4.10, + 2.4.11 (broken kernel, do not use), + 2.4.12, + 2.4.13, + 2.4.14, + 2.4.15, + 2.4.16, + 2.4.17, + 2.4.18 + + NOTES: + o The Fusion MPT LAN driver is NOT supported in any of the 2.2.x + kernels listed here. You MUST be working with a linux-2.4.x + kernel for Fusion MPT LAN support! + o For module support under 2.3.x and 2.4.x kernels you must have + modutils v2.3.15 or newer installed. + o IA64 support requires a linux-2.4.x kernel. + +To identify which kernel version you have, examine your +/usr/src/linux/Makefile as follows: + Example (on a RedHat(TM) 6.2 system): + VERSION = 2 + PATCHLEVEL = 2 + SUBLEVEL = 14 + EXTRAVERSION = -5.0 + +Then apply the closest patch set you can find. + + Example (on a Red Hat 6.2 system): + $ patch -p0 < drivers/message/fusion/patch/linux-2.2.14-5.0.txt + +These patches will apply small changes to the following files: + Makefile + arch/alpha/config.in + arch/i386/config.in + arch/sparc64/config.in + drivers/Makefile + include/linux/miscdevice.h + include/linux/proc_fs.h + +NOTE 1: If the driver is bundled in your kernel and no patch is +listed for your kernel, no patch set is required. Proceed to +the Driver Build Instructions. + +NOTE 2: You may not find an exact match for your kernel, however, applying +the closest patch set *should* work, in general, but may require that you +manually fixup any files for which the patch procedure might produce *.rej +file sections. You might optionally choose to hand-apply the small set of +required kernel patches by examining one or more of the kernel patch files. + +=== Driver Build Instructions === + +The following examples illustrate configuring and building +the LSI Logic Fusion MPT driver(s) as kernel modules, however, +please note that the MPT base and ScsiHost drivers can alternatively +be compiled into the linux kernel instead of built as modules. + +1. From the /usr/src/linux directory, ensure a clean kernel source + tree by executing the following command: + $ make mrproper + +2. From the /usr/src/linux directory, run your normal kernel + configuration routine: + $ make oldconfig + or: + $ make config + or: + $ make menuconfig + or: + $ make xconfig + +3. Look for the new top-level "Fusion MPT device support" entry: + Fusion MPT device support ---> + and select it to access the Fusion MPT drivers submenu entries: + Fusion MPT (base + ScsiHost) drivers + Enhanced SCSI error reporting + < > Fusion MPT misc device (ioctl) driver + < > Fusion MPT LAN driver + + On the submenu, select the "Fusion MPT (base + ScsiHost) drivers" line, + and then enter "m" to configure for building this support as a module. + (Alternatively, you can enter "y" here to have this support built + into the kernel.) + + NOTES: + o Enhanced SCSI error reporting and ioctl drivers are optional, + and it is recommended they only be built as modules, + due to kernel size considerations. + o DO NOT answer "y" for Fusion MPT LAN driver option as support + for this driver is currently restricted to module use only. + +4. For LAN support, make sure that "Fibre Channel driver support" is turned + on in the "Network device support" section. + +5. Save your kernel config changes. Follow any post config instructions + and do everything needed on your platform to rebuild the kernel. + This will typically include: + $ make dep + and: + $ make bzImage # varies on non-intel platforms + +6. Rebuild the kernel modules: + $ make modules + +NOTE: These last steps shown here will certainly require root permission. + +7. Optionally, (and potentially dangerous!), do everything needed + on your platform to install a newly built kernel. + (possibly temporarily, for sanity testing) + + Take care with this step and make sure you know what you're doing + as it's easy to wipe out a good/stable kernel from here on out! + +8. (Re)Install newly compiled kernel modules: + # make modules_install + + The output from the last step should look something like this: + Installing modules under /lib/modules/2.2.14-5.0/block + Installing modules under /lib/modules/2.2.14-5.0/net + Installing modules under /lib/modules/2.2.14-5.0/ipv4 + Installing modules under /lib/modules/2.2.14-5.0/scsi + Installing modules under /lib/modules/2.2.14-5.0/fs + Installing modules under /lib/modules/2.2.14-5.0/fs + Installing modules under /lib/modules/2.2.14-5.0/cdrom + Installing modules under /lib/modules/2.2.14-5.0/video + Installing modules under /lib/modules/2.2.14-5.0/net + Installing modules under /lib/modules/2.2.14-5.0/misc + +9. Shut down the system: + Example: + # shutdown -r now + and then reboot with the newly built linux kernel. + +=== Loading the Drivers As Modules === + +After building the driver modules, as described in the previous section, +the newly compiled kernel and modules are ready to be loaded. + +1. Load the Fusion MPT base driver. + # insmod mptbase + Fusion MPT base driver 2.00.11 + Copyright (c) 1999-2002 LSI Logic Corporation + mptbase: Initiating ioc0 bringup + ioc0: FC919: Capabilities={Initiator,Target,LAN} + mptbase: 1 MPT adapter found, 1 installed. + +2. Load the isense driver (optional but highly recommended), + to enable enhanced SCSI error reporting. + # insmod isense + SCSI-3 Opcodes & ASC/ASCQ Strings 2.00.11 + mptbase: English readable SCSI-3 OPs & ASC/ASCQ strings enabled:-) + +3. Load the Fusion MPT SCSI host driver. + # insmod mptscsih + Fusion MPT SCSI Host driver 2.00.11 + + Depending on what FC devices you have attached to your FC link, + you should see something like the following on the console and + in the system log: + scsi0 : ioc0: LSIFC919, FwRev=1000h, Ports=1, MaxQ=256, IRQ=9 + scsi : 1 host. + Vendor: SEAGATE Model: ST39102FC Rev: 0007 + Type: Direct-Access ANSI SCSI revision: 02 + Detected scsi disk sda at scsi0, channel 0, id 0, lun 0 + Vendor: SEAGATE Model: ST19171FC Rev: 0017 + Type: Direct-Access ANSI SCSI revision: 02 + Detected scsi disk sdb at scsi0, channel 0, id 1, lun 0 + SCSI device sda: hdwr sector= 512 bytes. Sectors= 17783240 [8683 MB] [8.7 GB] + sda: sda1 + SCSI device sdb: hdwr sector= 512 bytes. Sectors= 17783112 [8683 MB] [8.7 GB] + sdb: sdb1 + + All Fibre Channel target devices should be detected and mapped to linux + SCSI devices, /dev/sd{a,b,c,...} when the mptscsih module is loaded. + + All linux commands pertaining to SCSI disk storage management + (fdisk, mke2fs, mount, etc.) using the /dev/sdX[N] notation + should now be functional. + + FCP (SCSI) Device Access Example: + # fdisk /dev/sdb + # mke2fs /dev/sdb1 + # mount /dev/sdb1 /mnt/s1 + +=== Boot Setup Commands === + +1. Syntax + +Setup commands can be passed to the SCSI host driver mptscsih +as a string variable using 'insmod'. The following command +will install driver module with the bus width set to narrow +and Domain Validation disabled. + + insmod mptscsih.o mptscsih="dv:n width:0" + +Each string argument must be specified as "keyword:value". Only lower-case +characters and digits are allowed. + +2. Available Arguments + +2.1 Domain Validation + dv:n disabled + dv:y enabled [default] + + The SCSI host driver will perform a sequence of write, read and compare + commands to each target device during driver initialization. If data + corruption or bus hangs are detected during this sequence, the driver + will automatically slow the transfer rate until reliable transmission is + achieved. + + Warning! These tests use a devices internal buffer. Some + older SCSI devices behave badly, that is, freeze, when they receive a + Read or Write Buffer command. + + DV may be disabled on a per-device basis by setting the transfer + characterists to ASYNC and NARROW in the adapter BIOS. Alternatively, + DV may be disabled for the driver by passing in dv:n as a command + line argument. + + This option is has no effect for FC9XX parts. + +2.2 Maximum SCSI Bus Width + width:0 wide SCSI disabled + width:1 wide SCSI enabled + + The maximum allowed SCSI bus data transfer width is set to the + minimum of the command line options, adapter capabilities, and + NVRAM settings. + + This option is has no effect for FC9XX parts. + +2.3 Minimum SCSI Synchronous Factor + factor:0x08 Ultra320 (160 Mega-transfers / second) + factor:0x09 Ultra160 ( 80 Mega-transfers / second) + factor:0x0A Ultra2 ( 40 Mega-transfers / second) + factor:0x0C Ultra ( 20 Mega-transfers / second) + factor:0x19 FAST ( 10 Mega-transfers / second) + factor:0x32 SCSI ( 5 Mega-transfers / second) + factor:0xFF 5 Mega-trasfers/second and asynchronous + + The minimum allowed SCSI synchronous factor is set to the + maximum of the command line input, adapters capabilities and + NVRAM setting. If the minimum synchronous factor is 0xFF, the + synchronous offset will be set to 0 (asynchronous). + + This option is has no effect for FC9XX parts. + +=== Configuring Network Interfaces for MPT LAN Support === + +You can use either linuxconf, netcfg (only runs under X), or your own superb +knowledge of network configuration files and vi/emacs to setup the needed +info so that you can use your MPT LAN connection. The instructions below are +specifically for linuxconf, but they should be easily adapted to netcfg. +Instructions for manually adding the needed config files is beyond the scope +of this document. + +1. In linuxconf, go to Config->Networking->Client tasks->Basic host + information. + +2. Select an unused adaptor (i.e. 2) + +3. Set "Config mode" to "Manual" + +4. Set "Primary name" to whatever you want. + +5. Set "IP Address" to whatever you're using (I use the private class C + range, 192.168.0.x, for testing purposes). + +6. Set your netmask to whatever is used on your network. The default is + 255.255.255.0, and should be used unless your network admin says + otherwise. + +7. Set "Net device" to fc? (fc0 for the first LAN port, fc1 for the + second, . . .) + +8. If you want the interface to be activated automatically at boot, select + "Enabled" and then type "mptlan" on the "Kernel module" line. + +****************************** Troubleshooting ******************************* + +1. The SCSI driver error reporting has been nicely enhanced, making it much + more readable. Also, there's an (optional) isense driver/shim which + provides SCSI-3 opcode string lookup and a LARGE sorted table of 463 + unique SCSI-3 Additional Sense Code & Qualifier (ASC/ASCQ) strings, + translated directly from a text file off the SCSI T10.org's ftp site: + + ftp://ftp.t10.org/t10/drafts/spc2/asc-num.txt + + If the isense driver is (optionally) loaded, whenever a SCSI check + condition is generated[1], an english readable ASC/ASCQ string for the + SCSI error. + + Here's an example: + ----- + SCSI Error Report =-=-= (ioc0,scsi5:0) + SCSI_Status=02h (CHECK_CONDITION) + Original_CDB[]: 2A 00 00 00 00 41 00 00 02 00 - "WRITE(10)" + SenseData[12h]: 70 00 02 00 00 00 00 0A 00 00 00 00 04 02 02 00 00 00 + SenseKey=2h (NOT READY); FRU=02h + ASC/ASCQ=29h/00h "LOGICAL UNIT NOT READY, INITIALIZING CMD. REQUIRED" + ----- + + If the isense driver is NOT installed, neither the SCSI opcode string + nor the last ASC/ASCQ string will be displayed. + +2. If you have compiled your linux kernel with /proc file system support, + you can examine SCSI devices using this command: + $ cat /proc/scsi/scsi + + A summary of attached/recognized MPT adapters can be examined with the + following command: + $ cat /proc/mpt/summary + +3. If you have a LSI Fibre Channel RAID subsystem attached, some of the + standard linux SCSI devices that show up will not be accessible, + depending on the exact configuration of the RAID controller(s). + For example, if you have dual active controllers in one subsystem with + 8 active LUNs configured for each controller, all 16 LUNs will be visible + through each controller (32 SCSI devices total), although only 8 LUNs + will actually be accessible from each controller. There is currently + no filtering out of the "visible but not accessible" entries. + +****************************************************************************** + +Fusion MPT is a trademark of LSI Logic Corporation +Linux is a registered trademark of Linus Torvalds +Red Hat is a registered trademark of Red Hat Software, Inc. + +****************************************************************************** + diff -urN linux-2.4.18/drivers/message/fusion/mptscsih.c lia64-2.4/drivers/message/fusion/mptscsih.c --- linux-2.4.18/drivers/message/fusion/mptscsih.c Wed Oct 10 16:31:56 2001 +++ lia64-2.4/drivers/message/fusion/mptscsih.c Tue Mar 19 15:05:36 2002 @@ -9,17 +9,24 @@ * This driver would not exist if not for Alan Cox's development * of the linux i2o driver. * + * A special thanks to Pamela Delaney (LSI Logic) for tons of work + * and countless enhancements while adding support for the 1030 + * chip family. Pam has been instrumental in the development of + * of the 2.xx.xx series fusion drivers, and her contributions are + * far too numerous to hope to list in one place. + * * A huge debt of gratitude is owed to David S. Miller (DaveM) * for fixing much of the stupid and broken stuff in the early * driver while porting to sparc64 platform. THANK YOU! * * (see mptbase.c) * - * Copyright (c) 1999-2001 LSI Logic Corporation + * Copyright (c) 1999-2002 LSI Logic Corporation * Original author: Steven J. Ralston - * (mailto:Steve.Ralston@lsil.com) + * (mailto:sjralston1@netscape.net) + * (mailto:Pam.Delaney@lsil.com) * - * $Id: mptscsih.c,v 1.29.4.1 2001/09/18 03:22:30 sralston Exp $ + * $Id: mptscsih.c,v 1.80 2002/02/27 18:44:27 sralston Exp $ */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* @@ -66,6 +73,9 @@ #include #include #include /* for io_request_lock (spinlock) decl */ +#include /* for mdelay */ +#include /* needed for in_interrupt() proto */ +#include /* notifier code */ #include "../../scsi/scsi.h" #include "../../scsi/hosts.h" #include "../../scsi/sd.h" @@ -83,52 +93,131 @@ MODULE_DESCRIPTION(my_NAME); MODULE_LICENSE("GPL"); +/* Set string for command line args from insmod */ +#ifdef MODULE +char *mptscsih = 0; +MODULE_PARM(mptscsih, "s"); +#endif /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ typedef struct _BIG_SENSE_BUF { - u8 data[256]; + u8 data[MPT_SENSE_BUFFER_ALLOC]; } BIG_SENSE_BUF; -typedef struct _MPT_SCSI_HOST { - MPT_ADAPTER *ioc; - int port; - struct scsi_cmnd **ScsiLookup; - u8 *SgHunks; - dma_addr_t SgHunksDMA; - u32 qtag_tick; -} MPT_SCSI_HOST; - -typedef struct _MPT_SCSI_DEV { - struct _MPT_SCSI_DEV *forw; - struct _MPT_SCSI_DEV *back; - MPT_ADAPTER *ioc; - int sense_sz; - BIG_SENSE_BUF CachedSense; - unsigned long io_cnt; - unsigned long read_cnt; -} MPT_SCSI_DEV; +#define MPT_SCANDV_GOOD (0x00000000) /* must be 0 */ +#define MPT_SCANDV_DID_RESET (0x00000001) +#define MPT_SCANDV_SENSE (0x00000002) +#define MPT_SCANDV_SOME_ERROR (0x00000004) +#define MPT_SCANDV_SELECTION_TIMEOUT (0x00000008) + +#define MPT_SCANDV_MAX_RETRIES (10) + +#define MPT_ICFLAG_BUF_CAP 0x01 /* ReadBuffer Read Capacity format */ +#define MPT_ICFLAG_ECHO 0x02 /* ReadBuffer Echo buffer format */ +#define MPT_ICFLAG_PHYS_DISK 0x04 /* Any SCSI IO but do Phys Disk Format */ +#define MPT_ICFLAG_TAGGED_CMD 0x08 /* Do tagged IO */ +#define MPT_ICFLAG_DID_RESET 0x20 /* Bus Reset occured with this command */ +#define MPT_ICFLAG_RESERVED 0x40 /* Reserved has been issued */ + +typedef struct _internal_cmd { + char *data; /* data pointer */ + dma_addr_t data_dma; /* data dma address */ + int size; /* transfer size */ + u8 cmd; /* SCSI Op Code */ + u8 bus; /* bus number */ + u8 id; /* SCSI ID (virtual) */ + u8 lun; + u8 flags; /* Bit Field - See above */ + u8 physDiskNum; /* Phys disk number, -1 else */ + u8 rsvd2; + u8 rsvd; +} INTERNAL_CMD; + +typedef struct _negoparms { + u8 width; + u8 offset; + u8 factor; + u8 flags; +} NEGOPARMS; + +typedef struct _dv_parameters { + NEGOPARMS max; + NEGOPARMS now; + u8 cmd; + u8 id; + u16 pad1; +} DVPARAMETERS; + /* * Other private/forward protos... */ - static int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); static void mptscsih_report_queue_full(Scsi_Cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq); static int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); static int mptscsih_io_direction(Scsi_Cmnd *cmd); + +static int mptscsih_Add32BitSGE(MPT_SCSI_HOST *hd, Scsi_Cmnd *SCpnt, + SCSIIORequest_t *pReq, int req_idx); +static void mptscsih_AddNullSGE(SCSIIORequest_t *pReq); +static int mptscsih_getFreeChainBuffer(MPT_SCSI_HOST *hd, int *retIndex); +static void mptscsih_freeChainBuffers(MPT_SCSI_HOST *hd, int req_idx); +static int mptscsih_initChainBuffers (MPT_SCSI_HOST *hd, int init); + static void copy_sense_data(Scsi_Cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply); -static u32 SCPNT_TO_MSGCTX(Scsi_Cmnd *sc); +#ifndef MPT_SCSI_USE_NEW_EH +static void search_taskQ_for_cmd(Scsi_Cmnd *sc, MPT_SCSI_HOST *hd); +#endif +static u32 SCPNT_TO_LOOKUP_IDX(Scsi_Cmnd *sc); +static MPT_FRAME_HDR *mptscsih_search_pendingQ(MPT_SCSI_HOST *hd, int scpnt_idx); +static void post_pendingQ_commands(MPT_SCSI_HOST *hd); + +static int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort, int sleepFlag); +static int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort, int sleepFlag); static int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); static int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); +static VirtDevice *mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *data, int dlen); +void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target); +static void clear_sense_flag(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq); +static void mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq, char *data); +static void mptscsih_setDevicePage1Flags (u8 width, u8 factor, u8 offset, int *requestedPtr, int *configurationPtr, u8 flags); +static int mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target, int flags); +static int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); +static void mptscsih_timer_expired(unsigned long data); +static void mptscsih_taskmgmt_timeout(unsigned long data); +static int mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd); +static int mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum); + +#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION +static int mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io); +static void mptscsih_domainValidation(void *hd); +static void mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int target); +static void mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage); +static void mptscsih_fillbuf(char *buffer, int size, int index, int width); +#endif +static int mptscsih_setup(char *str); +static int mptscsih_halt(struct notifier_block *nb, ulong event, void *buf); + +/* + * Reboot Notification + */ +static struct notifier_block mptscsih_notifier = { + mptscsih_halt, NULL, 0 +}; + +/* + * Private data... + */ static int mpt_scsi_hosts = 0; static atomic_t queue_depth; static int ScsiDoneCtx = -1; static int ScsiTaskCtx = -1; +static int ScsiScanDvCtx = -1; /* Used only for bus scan and dv */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,28) static struct proc_dir_entry proc_mpt_scsihost = @@ -141,23 +230,40 @@ }; #endif -#define SNS_LEN(scp) sizeof((scp)->sense_buffer) +#define SNS_LEN(scp) sizeof((scp)->sense_buffer) #ifndef MPT_SCSI_USE_NEW_EH /* * Stuff to handle single-threading SCSI TaskMgmt * (abort/reset) requests... */ -static spinlock_t mpt_scsih_taskQ_lock = SPIN_LOCK_UNLOCKED; -static MPT_Q_TRACKER mpt_scsih_taskQ = { - (MPT_FRAME_HDR*) &mpt_scsih_taskQ, - (MPT_FRAME_HDR*) &mpt_scsih_taskQ -}; -static int mpt_scsih_taskQ_cnt = 0; -static int mpt_scsih_taskQ_bh_active = 0; -static MPT_FRAME_HDR *mpt_scsih_active_taskmgmt_mf = NULL; +static spinlock_t mytaskQ_lock = SPIN_LOCK_UNLOCKED; +static int mytaskQ_bh_active = 0; +static struct tq_struct mptscsih_ptaskfoo; +static atomic_t mpt_taskQdepth; +#endif + +#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION +/* + * Domain Validation task structure + */ +static spinlock_t dvtaskQ_lock = SPIN_LOCK_UNLOCKED; +static int dvtaskQ_active = 0; +static int dvtaskQ_release = 0; +static struct tq_struct mptscsih_dvTask; #endif +/* + * Wait Queue setup + */ +static DECLARE_WAIT_QUEUE_HEAD (scandv_waitq); +static int scandv_wait_done = 1; + +/* Driver default setup + */ +static struct mptscsih_driver_setup + driver_setup = MPTSCSIH_DRIVER_SETUP; + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * mptscsih_io_done - Main SCSI IO callback routine registered to @@ -174,123 +280,109 @@ * Returns 1 indicating alloc'd request frame ptr should be freed. */ static int -mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r) +mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) { Scsi_Cmnd *sc; MPT_SCSI_HOST *hd; - MPT_SCSI_DEV *mpt_sdev = NULL; + SCSIIORequest_t *pScsiReq; + SCSIIOReply_t *pScsiReply; + unsigned long flags; u16 req_idx; + hd = (MPT_SCSI_HOST *) ioc->sh->hostdata; + if ((mf == NULL) || (mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth))) { - printk(KERN_ERR MYNAM ": ERROR! NULL or BAD req frame ptr (=%p)!\n", mf); - return 1; + printk(MYIOC_s_ERR_FMT "%s req frame ptr! (=%p)!\n", + ioc->name, mf?"BAD":"NULL", mf); + /* return 1; CHECKME SteveR. Don't free. */ + return 0; } - hd = (MPT_SCSI_HOST *) ioc->sh->hostdata; req_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); sc = hd->ScsiLookup[req_idx]; - hd->ScsiLookup[req_idx] = NULL; + if (sc == NULL) { + MPIHeader_t *hdr = (MPIHeader_t *)mf; - dmfprintk((KERN_INFO MYNAM ": ScsiDone (req:sc:reply=%p:%p:%p)\n", mf, sc, r)); + atomic_dec(&queue_depth); - atomic_dec(&queue_depth); + /* writeSDP1 will use the ScsiDoneCtx + * There is no processing for the reply. + * Just return to the calling function. + */ + if (hdr->Function == MPI_FUNCTION_SCSI_IO_REQUEST) + printk(MYIOC_s_ERR_FMT "NULL ScsiCmd ptr!\n", ioc->name); - /* - * Check for {1st} {IO} completion to "new" device. - * How do we know it's a new device? - * If we haven't set SDpnt->hostdata I guess... - */ - if (sc && sc->device) { - mpt_sdev = (MPT_SCSI_DEV*)sc->device->hostdata; - if (!mpt_sdev) { - dprintk((KERN_INFO MYNAM ": *NEW* SCSI device (%d:%d:%d)!\n", - sc->device->id, sc->device->lun, sc->device->channel)); - if ((sc->device->hostdata = kmalloc(sizeof(MPT_SCSI_DEV), GFP_ATOMIC)) == NULL) { - printk(KERN_ERR MYNAM ": ERROR - kmalloc(%d) FAILED!\n", (int)sizeof(MPT_SCSI_DEV)); - } else { - memset(sc->device->hostdata, 0, sizeof(MPT_SCSI_DEV)); - mpt_sdev = (MPT_SCSI_DEV *) sc->device->hostdata; - mpt_sdev->ioc = ioc; - } - } else { - if (++mpt_sdev->io_cnt && mptscsih_io_direction(sc) < 0) { - if (++mpt_sdev->read_cnt == 3) { - dprintk((KERN_INFO MYNAM ": 3rd DATA_IN, CDB[0]=%02x\n", - sc->cmnd[0])); - } - } -#if 0 - if (mpt_sdev->sense_sz) { - /* - * Completion of first IO down this path - * *should* invalidate device SenseData... - */ - mpt_sdev->sense_sz = 0; - } -#endif - } + mptscsih_freeChainBuffers(hd, req_idx); + return 1; } -#if 0 -{ - MPT_FRAME_HDR *mf_chk; + dmfprintk((MYIOC_s_INFO_FMT "ScsiDone (mf=%p,mr=%p,sc=%p)\n", + ioc->name, mf, mr, sc)); - /* This, I imagine, is a costly check, but... - * If abort/reset active, check to see if this is a IO - * that completed while ABORT/RESET for it is waiting - * on our taskQ! - */ - if (! Q_IS_EMPTY(&mpt_scsih_taskQ)) { - /* If ABORT for this IO is queued, zap it! */ - mf_chk = search_taskQ(1,sc,MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK); - if (mf_chk != NULL) { - sc->result = DID_ABORT << 16; - spin_lock_irqsave(&io_request_lock, flags); - sc->scsi_done(sc); - spin_unlock_irqrestore(&io_request_lock, flags); - return 1; - } - } -} -#endif + atomic_dec(&queue_depth); - if (r != NULL && sc != NULL) { - SCSIIOReply_t *pScsiReply; - SCSIIORequest_t *pScsiReq; - u16 status; + sc->result = DID_OK << 16; /* Set default reply as OK */ + pScsiReq = (SCSIIORequest_t *) mf; + pScsiReply = (SCSIIOReply_t *) mr; + + if (pScsiReply == NULL) { + /* special context reply handling */ + + /* If regular Inquiry cmd - save inquiry data + */ + if (pScsiReq->CDB[0] == INQUIRY && !(pScsiReq->CDB[1] & 0x3)) { + int dlen; - pScsiReply = (SCSIIOReply_t *) r; - pScsiReq = (SCSIIORequest_t *) mf; + dlen = le32_to_cpu(pScsiReq->DataLength); + if (dlen >= SCSI_STD_INQUIRY_BYTES) { + mptscsih_initTarget(hd, + hd->port, + sc->target, + pScsiReq->LUN[1], + sc->buffer, + dlen); + } + } + clear_sense_flag(hd, pScsiReq); + + if (hd->is_spi) + mptscsih_set_dvflags(hd, pScsiReq, sc->buffer); + } else { + u32 xfer_cnt; + u16 status; + u8 scsi_state; status = le16_to_cpu(pScsiReply->IOCStatus) & MPI_IOCSTATUS_MASK; + scsi_state = pScsiReply->SCSIState; - dprintk((KERN_NOTICE MYNAM ": Uh-Oh! (req:sc:reply=%p:%p:%p)\n", mf, sc, r)); + dprintk((KERN_NOTICE " Uh-Oh! (%d:%d:%d) mf=%p, mr=%p, sc=%p\n", + ioc->id, pScsiReq->TargetID, pScsiReq->LUN[1], + mf, mr, sc)); dprintk((KERN_NOTICE " IOCStatus=%04xh, SCSIState=%02xh" - ", SCSIStatus=%02xh, IOCLogInfo=%08xh\n", - status, pScsiReply->SCSIState, pScsiReply->SCSIStatus, - le32_to_cpu(pScsiReply->IOCLogInfo))); + ", SCSIStatus=%02xh, IOCLogInfo=%08xh\n", + status, scsi_state, pScsiReply->SCSIStatus, + le32_to_cpu(pScsiReply->IOCLogInfo))); + + if (scsi_state & MPI_SCSI_STATE_AUTOSENSE_VALID) + copy_sense_data(sc, hd, mf, pScsiReply); /* * Look for + dump FCP ResponseInfo[]! */ - if (pScsiReply->SCSIState & MPI_SCSI_STATE_RESPONSE_INFO_VALID) { + if (scsi_state & MPI_SCSI_STATE_RESPONSE_INFO_VALID) { dprintk((KERN_NOTICE " FCP_ResponseInfo=%08xh\n", le32_to_cpu(pScsiReply->ResponseInfo))); } switch(status) { case MPI_IOCSTATUS_BUSY: /* 0x0002 */ - /*sc->result = DID_BUS_BUSY << 16;*/ /* YIKES! - Seems to - * kill linux interrupt - * handler - */ - sc->result = STS_BUSY; /* Try SCSI BUSY! */ - break; - - case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ - /* Not real sure here... */ - sc->result = DID_OK << 16; + /* CHECKME! + * Maybe: DRIVER_BUSY | SUGGEST_RETRY | DID_SOFT_ERROR (retry) + * But not: DID_BUS_BUSY lest one risk + * killing interrupt handler:-( + */ + sc->result = STS_BUSY; break; case MPI_IOCSTATUS_SCSI_INVALID_BUS: /* 0x0041 */ @@ -299,10 +391,29 @@ break; case MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE: /* 0x0043 */ - /* Spoof to SCSI Selection Timeout! */ + /* Spoof to SCSI Selection Timeout! */ sc->result = DID_NO_CONNECT << 16; break; + case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */ +#ifndef MPT_SCSI_USE_NEW_EH + search_taskQ_for_cmd(sc, hd); +#endif + /* Linux handles an unsolicited DID_RESET better + * than an unsolicited DID_ABORT. + */ + sc->result = DID_RESET << 16; + break; + + case MPI_IOCSTATUS_SCSI_IOC_TERMINATED: /* 0x004B */ + case MPI_IOCSTATUS_SCSI_EXT_TERMINATED: /* 0x004C */ +#ifndef MPT_SCSI_USE_NEW_EH + search_taskQ_for_cmd(sc, hd); +#endif + sc->result = DID_RESET << 16; + break; + + case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: /* 0x0049 */ case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ /* * YIKES! I just discovered that SCSI IO which @@ -312,78 +423,148 @@ * Do upfront check for valid SenseData and give it * precedence! */ + sc->result = (DID_OK << 16) | pScsiReply->SCSIStatus; + clear_sense_flag(hd, pScsiReq); if (pScsiReply->SCSIState & MPI_SCSI_STATE_AUTOSENSE_VALID) { - copy_sense_data(sc, hd, mf, pScsiReply); - sc->result = pScsiReply->SCSIStatus; - break; + /* Have already saved the status and sense data + */ + ; + } else if (pScsiReply->SCSIState & (MPI_SCSI_STATE_AUTOSENSE_FAILED | MPI_SCSI_STATE_NO_SCSI_STATUS)) { + /* What to do? + */ + sc->result = DID_SOFT_ERROR << 16; + } + else if (pScsiReply->SCSIState & MPI_SCSI_STATE_TERMINATED) { + /* Not real sure here either... */ + sc->result = DID_RESET << 16; } - dprintk((KERN_NOTICE MYNAM ": sc->underflow={report ERR if < %02xh bytes xfer'd}\n", sc->underflow)); - dprintk((KERN_NOTICE MYNAM ": ActBytesXferd=%02xh\n", le32_to_cpu(pScsiReply->TransferCount))); + /* Give report and update residual count. + */ + xfer_cnt = le32_to_cpu(pScsiReply->TransferCount); + dprintk((KERN_NOTICE " sc->underflow={report ERR if < %02xh bytes xfer'd}\n", + sc->underflow)); + dprintk((KERN_NOTICE " ActBytesXferd=%02xh\n", xfer_cnt)); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0) - sc->resid = sc->request_bufflen - le32_to_cpu(pScsiReply->TransferCount); - dprintk((KERN_NOTICE MYNAM ": SET sc->resid=%02xh\n", sc->resid)); + sc->resid = sc->request_bufflen - xfer_cnt; + dprintk((KERN_NOTICE " SET sc->resid=%02xh\n", sc->resid)); #endif - if (pScsiReq->CDB[0] == INQUIRY) { - sc->result = (DID_OK << 16); - break; - } + /* Report Queue Full + */ + if (sc->result == MPI_SCSI_STATUS_TASK_SET_FULL) + mptscsih_report_queue_full(sc, pScsiReply, pScsiReq); - /* workaround attempts... */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0) - if (sc->resid >= 0x200) { - /* GRRRRR... - * //sc->result = DID_SOFT_ERROR << 16; - * Try spoofing to BUSY - */ - sc->result = STS_BUSY; - } else { - sc->result = 0; + /* If regular Inquiry cmd and some data was transferred, + * save inquiry data + */ + if ( pScsiReq->CDB[0] == INQUIRY + && !(pScsiReq->CDB[1] & 0x3) + && xfer_cnt >= SCSI_STD_INQUIRY_BYTES + ) { + mptscsih_initTarget(hd, + hd->port, + sc->target, + pScsiReq->LUN[1], + sc->buffer, + xfer_cnt); } -#else - sc->result = 0; -#endif - break; - case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */ - sc->result = DID_ABORT << 16; - break; - - case MPI_IOCSTATUS_SCSI_IOC_TERMINATED: /* 0x004B */ - case MPI_IOCSTATUS_SCSI_EXT_TERMINATED: /* 0x004C */ - sc->result = DID_RESET << 16; + if (hd->is_spi) + mptscsih_set_dvflags(hd, pScsiReq, sc->buffer); break; + case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ case MPI_IOCSTATUS_SUCCESS: /* 0x0000 */ - sc->result = pScsiReply->SCSIStatus; + sc->result = (DID_OK << 16) | pScsiReply->SCSIStatus; + clear_sense_flag(hd, pScsiReq); if (pScsiReply->SCSIState & MPI_SCSI_STATE_AUTOSENSE_VALID) { - copy_sense_data(sc, hd, mf, pScsiReply); - - /* If running agains circa 200003dd 909 MPT f/w, - * may get this (AUTOSENSE_VALID) for actual TASK_SET_FULL - * (QUEUE_FULL) returned from device! --> get 0x0000?128 - * and with SenseBytes set to 0. + /* + * If running agains circa 200003dd 909 MPT f/w, + * may get this (AUTOSENSE_VALID) for actual TASK_SET_FULL + * (QUEUE_FULL) returned from device! --> get 0x0000?128 + * and with SenseBytes set to 0. */ if (pScsiReply->SCSIStatus == MPI_SCSI_STATUS_TASK_SET_FULL) mptscsih_report_queue_full(sc, pScsiReply, pScsiReq); + +#ifndef MPT_SCSI_USE_NEW_EH + /* ADDED 20011120 -sralston + * Scsi mid-layer (old_eh) doesn't seem to like it + * when RAID returns SCSIStatus=02 (CHECK CONDITION), + * SenseKey=01 (RECOVERED ERROR), ASC/ASCQ=95/01. + * Seems to be * treating this as a IO error:-( + * + * So just lie about it altogether here. + * + * NOTE: It still gets reported to syslog via + * mpt_ScsiHost_ErrorReport from copy_sense_data + * call far above. + */ + if ( pScsiReply->SCSIStatus == STS_CHECK_CONDITION + && SD_Sense_Key(sc->sense_buffer) == SK_RECOVERED_ERROR + ) { + sc->result = 0; + } +#endif + } - else if (pScsiReply->SCSIState & (MPI_SCSI_STATE_AUTOSENSE_FAILED | MPI_SCSI_STATE_NO_SCSI_STATUS)) { + else if (pScsiReply->SCSIState & + (MPI_SCSI_STATE_AUTOSENSE_FAILED | MPI_SCSI_STATE_NO_SCSI_STATUS) + ) { /* - * What to do? + * What to do? */ sc->result = DID_SOFT_ERROR << 16; } else if (pScsiReply->SCSIState & MPI_SCSI_STATE_TERMINATED) { /* Not real sure here either... */ - sc->result = DID_ABORT << 16; + sc->result = DID_RESET << 16; + } + else if (pScsiReply->SCSIState & MPI_SCSI_STATE_QUEUE_TAG_REJECTED) { + /* Device Inq. data indicates that it supports + * QTags, but rejects QTag messages. + * This command completed OK. + * + * Not real sure here either so do nothing... */ } if (sc->result == MPI_SCSI_STATUS_TASK_SET_FULL) mptscsih_report_queue_full(sc, pScsiReply, pScsiReq); + /* Add handling of: + * Reservation Conflict, Busy, + * Command Terminated, CHECK + */ + + /* If regular Inquiry cmd - save inquiry data + */ + xfer_cnt = le32_to_cpu(pScsiReply->TransferCount); + if ( sc->result == (DID_OK << 16) + && pScsiReq->CDB[0] == INQUIRY + && !(pScsiReq->CDB[1] & 0x3) + && xfer_cnt >= SCSI_STD_INQUIRY_BYTES + ) { + mptscsih_initTarget(hd, + hd->port, + sc->target, + pScsiReq->LUN[1], + sc->buffer, + xfer_cnt); + } + + if (hd->is_spi) + mptscsih_set_dvflags(hd, pScsiReq, sc->buffer); + break; + + case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR: /* 0x0047 */ + if (pScsiReply->SCSIState & MPI_SCSI_STATE_TERMINATED) { + /* Not real sure here either... */ + sc->result = DID_RESET << 16; + } else + sc->result = DID_SOFT_ERROR << 16; break; case MPI_IOCSTATUS_INVALID_FUNCTION: /* 0x0001 */ @@ -395,50 +576,50 @@ case MPI_IOCSTATUS_INVALID_STATE: /* 0x0008 */ case MPI_IOCSTATUS_SCSI_DATA_OVERRUN: /* 0x0044 */ case MPI_IOCSTATUS_SCSI_IO_DATA_ERROR: /* 0x0046 */ - case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR: /* 0x0047 */ - case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: /* 0x0049 */ case MPI_IOCSTATUS_SCSI_TASK_MGMT_FAILED: /* 0x004A */ default: /* - * What to do? + * What to do? */ sc->result = DID_SOFT_ERROR << 16; break; } /* switch(status) */ - dprintk((KERN_NOTICE MYNAM ": sc->result set to %08xh\n", sc->result)); + dprintk((KERN_NOTICE " sc->result set to %08xh\n", sc->result)); + } /* end of address reply case */ + + /* Unmap the DMA buffers, if any. */ + if (sc->use_sg) { + pci_unmap_sg(ioc->pcidev, (struct scatterlist *) sc->request_buffer, + sc->use_sg, scsi_to_pci_dma_dir(sc->sc_data_direction)); + } else if (sc->request_bufflen) { + scPrivate *my_priv; + + my_priv = (scPrivate *) &sc->SCp; + pci_unmap_single(ioc->pcidev, (dma_addr_t)(ulong)my_priv->p1, + sc->request_bufflen, + scsi_to_pci_dma_dir(sc->sc_data_direction)); } - if (sc != NULL) { - unsigned long flags; + hd->ScsiLookup[req_idx] = NULL; - /* Unmap the DMA buffers, if any. */ - if (sc->use_sg) { - pci_unmap_sg(ioc->pcidev, - (struct scatterlist *) sc->request_buffer, - sc->use_sg, - scsi_to_pci_dma_dir(sc->sc_data_direction)); - } else if (sc->request_bufflen) { - pci_unmap_single(ioc->pcidev, - (dma_addr_t)((long)sc->SCp.ptr), - sc->request_bufflen, - scsi_to_pci_dma_dir(sc->sc_data_direction)); - } + sc->host_scribble = NULL; /* CHECKME! - Do we need to clear this??? */ - spin_lock_irqsave(&io_request_lock, flags); - sc->scsi_done(sc); - spin_unlock_irqrestore(&io_request_lock, flags); - } + spin_lock_irqsave(&io_request_lock, flags); + sc->scsi_done(sc); /* Issue the command callback */ + spin_unlock_irqrestore(&io_request_lock, flags); + /* Free Chain buffers */ + mptscsih_freeChainBuffers(hd, req_idx); return 1; } -#ifndef MPT_SCSI_USE_NEW_EH +#ifndef MPT_SCSI_USE_NEW_EH /* { */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * search_taskQ - Search SCSI task mgmt request queue for specific - * request type + * request type. * @remove: (Boolean) Should request be removed if found? * @sc: Pointer to Scsi_Cmnd structure * @task_type: Task type to search for @@ -447,42 +628,55 @@ * was not found. */ static MPT_FRAME_HDR * -search_taskQ(int remove, Scsi_Cmnd *sc, u8 task_type) +search_taskQ(int remove, Scsi_Cmnd *sc, MPT_SCSI_HOST *hd, u8 task_type) { MPT_FRAME_HDR *mf = NULL; unsigned long flags; int count = 0; int list_sz; - dslprintk((KERN_INFO MYNAM ": spinlock#1\n")); - spin_lock_irqsave(&mpt_scsih_taskQ_lock, flags); - list_sz = mpt_scsih_taskQ_cnt; - if (! Q_IS_EMPTY(&mpt_scsih_taskQ)) { - mf = mpt_scsih_taskQ.head; + dprintk((KERN_INFO MYNAM ": search_taskQ(%d,sc=%p,%d) called\n", + remove, sc, task_type)); + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + list_sz = hd->taskQcnt; + if (! Q_IS_EMPTY(&hd->taskQ)) { + mf = hd->taskQ.head; do { count++; if (mf->u.frame.linkage.argp1 == sc && mf->u.frame.linkage.arg1 == task_type) { if (remove) { Q_DEL_ITEM(&mf->u.frame.linkage); - mpt_scsih_taskQ_cnt--; + hd->taskQcnt--; + atomic_dec(&mpt_taskQdepth); + + /* Don't save mf into nextmf because + * exit after command has been deleted. + */ + + /* Place the MF back on the FreeQ */ + Q_ADD_TAIL(&hd->ioc->FreeQ, + &mf->u.frame.linkage, + MPT_FRAME_HDR); +#ifdef MFCNT + hd->ioc->mfcnt--; +#endif } break; } - } while ((mf = mf->u.frame.linkage.forw) != (MPT_FRAME_HDR*)&mpt_scsih_taskQ); - if (mf == (MPT_FRAME_HDR*)&mpt_scsih_taskQ) { + } while ((mf = mf->u.frame.linkage.forw) != (MPT_FRAME_HDR*)&hd->taskQ); + if (mf == (MPT_FRAME_HDR*)&hd->taskQ) { mf = NULL; } } - spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags); + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); if (list_sz) { - dprintk((KERN_INFO MYNAM ": search_taskQ(%d,%p,%d) results=%p (%sFOUND%s)!\n", - remove, sc, task_type, + dprintk((KERN_INFO " Results=%p (%sFOUND%s)!\n", mf, mf ? "" : "NOT_", (mf && remove) ? "+REMOVED" : "" )); - dprintk((KERN_INFO MYNAM ": (searched thru %d of %d items on taskQ)\n", + dprintk((KERN_INFO " (searched thru %d of %d items on taskQ)\n", count, list_sz )); } @@ -490,2107 +684,6547 @@ return mf; } -#endif - -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ - -/* - * Hack! I'd like to report if a device is returning QUEUE_FULL - * but maybe not each and every time... - */ -static long last_queue_full = 0; - -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* - * mptscsih_report_queue_full - Report QUEUE_FULL status returned - * from a SCSI target device. - * @sc: Pointer to Scsi_Cmnd structure - * @pScsiReply: Pointer to SCSIIOReply_t - * @pScsiReq: Pointer to original SCSI request + * clean_taskQ - Clean the SCSI task mgmt request for + * this SCSI host instance. + * @hd: MPT_SCSI_HOST pointer * - * This routine periodically reports QUEUE_FULL status returned from a - * SCSI target device. It reports this to the console via kernel - * printk() API call, not more than once every 10 seconds. + * Returns: None. */ static void -mptscsih_report_queue_full(Scsi_Cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq) +clean_taskQ(MPT_SCSI_HOST *hd) { - long time = jiffies; + MPT_FRAME_HDR *mf = NULL; + MPT_FRAME_HDR *nextmf = NULL; + MPT_ADAPTER *ioc = hd->ioc; + unsigned long flags; - if (time - last_queue_full > 10 * HZ) { - printk(KERN_WARNING MYNAM ": Device reported QUEUE_FULL! SCSI bus:target:lun = %d:%d:%d\n", - 0, sc->target, sc->lun); - last_queue_full = time; + dprintk((KERN_INFO MYNAM ": clean_taskQ called\n")); + spin_lock_irqsave(&ioc->FreeQlock, flags); + if (! Q_IS_EMPTY(&hd->taskQ)) { + mf = hd->taskQ.head; + do { + Q_DEL_ITEM(&mf->u.frame.linkage); + hd->taskQcnt--; + atomic_dec(&mpt_taskQdepth); + + nextmf = mf->u.frame.linkage.forw; + + /* Place the MF back on the FreeQ */ + Q_ADD_TAIL(&ioc->FreeQ, &mf->u.frame.linkage, + MPT_FRAME_HDR); +#ifdef MFCNT + hd->ioc->mfcnt--; +#endif + } while ((mf = nextmf) != (MPT_FRAME_HDR*)&hd->taskQ); } -} + spin_unlock_irqrestore(&ioc->FreeQlock, flags); -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -static int BeenHereDoneThat = 0; + return; +} -/* SCSI fops start here... */ -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** - * mptscsih_detect - Register MPT adapter(s) as SCSI host(s) with - * linux scsi mid-layer. - * @tpnt: Pointer to Scsi_Host_Template structure - * - * (linux Scsi_Host_Template.detect routine) +/* + * search_taskQ_for_cmd - Search the SCSI task mgmt request queue for + * the specified command. If found, delete + * @hd: MPT_SCSI_HOST pointer * - * Returns number of SCSI host adapters that were successfully - * registered with the linux scsi mid-layer via the scsi_register() - * API call. + * Returns: None. */ -int -mptscsih_detect(Scsi_Host_Template *tpnt) +static void +search_taskQ_for_cmd(Scsi_Cmnd *sc, MPT_SCSI_HOST *hd) { - struct Scsi_Host *sh = NULL; - MPT_SCSI_HOST *hd = NULL; - MPT_ADAPTER *this; - unsigned long flags; - int sz; - u8 *mem; + MPT_FRAME_HDR *mf = NULL; + unsigned long flags; + int count = 0; - if (! BeenHereDoneThat++) { - show_mptmod_ver(my_NAME, my_VERSION); + dprintk((KERN_INFO MYNAM ": search_taskQ_for_cmd(sc=%p) called\n", sc)); + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + if (! Q_IS_EMPTY(&hd->taskQ)) { + mf = hd->taskQ.head; + do { + count++; + if (mf->u.frame.linkage.argp1 == sc) { + Q_DEL_ITEM(&mf->u.frame.linkage); + hd->taskQcnt--; + atomic_dec(&mpt_taskQdepth); + dprintk((KERN_INFO MYNAM + ": Cmd %p found! Deleting.\n", sc)); - if ((ScsiDoneCtx = mpt_register(mptscsih_io_done, MPTSCSIH_DRIVER)) <= 0) { - printk(KERN_ERR MYNAM ": Failed to register callback1 with MPT base driver\n"); - return mpt_scsi_hosts; - } - if ((ScsiTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSCSIH_DRIVER)) <= 0) { - printk(KERN_ERR MYNAM ": Failed to register callback2 with MPT base driver\n"); - return mpt_scsi_hosts; - } + /* Don't save mf into nextmf because + * exit after command has been deleted. + */ -#ifndef MPT_SCSI_USE_NEW_EH - Q_INIT(&mpt_scsih_taskQ, MPT_FRAME_HDR); - spin_lock_init(&mpt_scsih_taskQ_lock); + /* Place the MF back on the FreeQ */ + Q_ADD_TAIL(&hd->ioc->FreeQ, + &mf->u.frame.linkage, + MPT_FRAME_HDR); +#ifdef MFCNT + hd->ioc->mfcnt--; #endif + break; + } + } while ((mf = mf->u.frame.linkage.forw) != (MPT_FRAME_HDR*)&hd->taskQ); + } + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); - if (mpt_event_register(ScsiDoneCtx, mptscsih_event_process) == 0) { - dprintk((KERN_INFO MYNAM ": Registered for IOC event notifications\n")); - } else { - /* FIXME! */ - } + return; +} - if (mpt_reset_register(ScsiDoneCtx, mptscsih_ioc_reset) == 0) { - dprintk((KERN_INFO MYNAM ": Registered for IOC reset notifications\n")); - } else { - /* FIXME! */ - } - } +#endif /* } MPT_SCSI_USE_NEW_EH */ - dprintk((KERN_INFO MYNAM ": mpt_scsih_detect()\n")); - this = mpt_adapter_find_first(); - while (this != NULL) { - /* FIXME! Multi-port (aka FC929) support... - * for (i = 0; i < this->facts.NumberOfPorts; i++) - */ +/* + * Flush all commands on the doneQ. + * Lock Q when deleting/adding members + * Lock io_request_lock for OS callback. + */ +static void +flush_doneQ(MPT_SCSI_HOST *hd) +{ + MPT_DONE_Q *buffer; + Scsi_Cmnd *SCpnt; + unsigned long flags; - /* 20010215 -sralston - * Added sanity check on SCSI Initiator-mode enabled - * for this MPT adapter. - */ - if (!(this->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR)) { - printk(KERN_ERR MYNAM ": Skipping %s because SCSI Initiator mode is NOT enabled!\n", - this->name); - this = mpt_adapter_find_next(this); - continue; + /* Flush the doneQ. + */ + dprintk((KERN_INFO MYNAM ": flush_doneQ called\n")); + while (1) { + spin_lock_irqsave(&hd->freedoneQlock, flags); + if (Q_IS_EMPTY(&hd->doneQ)) { + spin_unlock_irqrestore(&hd->freedoneQlock, flags); + break; } - /* 20010202 -sralston - * Added sanity check on readiness of the MPT adapter. + buffer = hd->doneQ.head; + /* Delete from Q */ - if (this->last_state != MPI_IOC_STATE_OPERATIONAL) { - printk(KERN_ERR MYNAM ": ERROR - Skipping %s because it's not operational!\n", - this->name); - this = mpt_adapter_find_next(this); - continue; - } - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) - tpnt->proc_dir = &proc_mpt_scsihost; -#endif - sh = scsi_register(tpnt, sizeof(MPT_SCSI_HOST)); - if (sh != NULL) { - save_flags(flags); - cli(); - sh->io_port = 0; - sh->n_io_port = 0; - sh->irq = 0; - - /* Yikes! This is important! - * Otherwise, by default, linux only scans target IDs 0-7! - * - * BUG FIX! 20010618 -sralston & pdelaney - * FC919 testing was encountering "duplicate" FC devices, - * as it turns out because the 919 was returning 512 - * for PortFacts.MaxDevices, causing a wraparound effect - * in SCSI IO requests. So instead of using: - * sh->max_id = this->pfacts[0].MaxDevices - 1 - * we'll use a definitive max here. - */ - sh->max_id = MPT_MAX_FC_DEVICES; - - sh->this_id = this->pfacts[0].PortSCSIID; - - restore_flags(flags); - - hd = (MPT_SCSI_HOST *) sh->hostdata; - hd->ioc = this; - hd->port = 0; /* FIXME! */ - - /* SCSI needs Scsi_Cmnd lookup table! - * (with size equal to req_depth*PtrSz!) - */ - sz = hd->ioc->req_depth * sizeof(void *); - mem = kmalloc(sz, GFP_KERNEL); - if (mem == NULL) - return mpt_scsi_hosts; - - memset(mem, 0, sz); - hd->ScsiLookup = (struct scsi_cmnd **) mem; - - dprintk((KERN_INFO MYNAM ": ScsiLookup @ %p, sz=%d\n", - hd->ScsiLookup, sz)); - - /* SCSI also needs SG buckets/hunk management! - * (with size equal to N * req_sz * req_depth!) - * (where N is number of SG buckets per hunk) - */ - sz = MPT_SG_BUCKETS_PER_HUNK * hd->ioc->req_sz * hd->ioc->req_depth; - mem = pci_alloc_consistent(hd->ioc->pcidev, sz, - &hd->SgHunksDMA); - if (mem == NULL) - return mpt_scsi_hosts; + Q_DEL_ITEM(buffer); - memset(mem, 0, sz); - hd->SgHunks = (u8*)mem; - - dprintk((KERN_INFO MYNAM ": SgHunks @ %p(%08x), sz=%d\n", - hd->SgHunks, hd->SgHunksDMA, sz)); + /* Set the Scsi_Cmnd pointer + */ + SCpnt = (Scsi_Cmnd *) buffer->argp; + buffer->argp = NULL; - hd->qtag_tick = jiffies; + /* Add to the freeQ + */ + Q_ADD_TAIL(&hd->freeQ.head, buffer, MPT_DONE_Q); + spin_unlock_irqrestore(&hd->freedoneQlock, flags); - this->sh = sh; - mpt_scsi_hosts++; - } - this = mpt_adapter_find_next(this); + /* Do the OS callback. + */ + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->scsi_done(SCpnt); + spin_unlock_irqrestore(&io_request_lock, flags); } - return mpt_scsi_hosts; + return; } -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ - static char *info_kbuf = NULL; -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** - * mptscsih_release - Unregister SCSI host from linux scsi mid-layer - * @host: Pointer to Scsi_Host structure +/* + * Search the doneQ for a specific command. If found, delete from Q. + * Calling function will finish processing. + */ +static void +search_doneQ_for_cmd(MPT_SCSI_HOST *hd, Scsi_Cmnd *SCpnt) +{ + unsigned long flags; + MPT_DONE_Q *buffer; + + spin_lock_irqsave(&hd->freedoneQlock, flags); + if (!Q_IS_EMPTY(&hd->doneQ)) { + buffer = hd->doneQ.head; + do { + Scsi_Cmnd *sc = (Scsi_Cmnd *) buffer->argp; + if (SCpnt == sc) { + Q_DEL_ITEM(buffer); + SCpnt->result = sc->result; + + /* Set the Scsi_Cmnd pointer + */ + buffer->argp = NULL; + + /* Add to the freeQ + */ + Q_ADD_TAIL(&hd->freeQ.head, buffer, MPT_DONE_Q); + break; + } + } while ((buffer = buffer->forw) != (MPT_DONE_Q *) &hd->doneQ); + } + spin_unlock_irqrestore(&hd->freedoneQlock, flags); + return; +} + +/* + * mptscsih_flush_running_cmds - For each command found, search + * Scsi_Host instance taskQ and reply to OS. + * Called only if recovering from a FW reload. + * @hd: Pointer to a SCSI HOST structure * - * (linux Scsi_Host_Template.release routine) - * This routine releases all resources associated with the SCSI host - * adapter. + * Returns: None. * - * Returns 0 for success. + * Must be called while new I/Os are being queued. */ -int -mptscsih_release(struct Scsi_Host *host) +static void +mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd) { - MPT_SCSI_HOST *hd; -#ifndef MPT_SCSI_USE_NEW_EH + Scsi_Cmnd *SCpnt = NULL; + MPT_FRAME_HDR *mf = NULL; + int ii; + int max = hd->ioc->req_depth; unsigned long flags; - spin_lock_irqsave(&mpt_scsih_taskQ_lock, flags); - if (mpt_scsih_taskQ_bh_active) { - int count = 10 * HZ; + dprintk((KERN_INFO MYNAM ": flush_ScsiLookup called\n")); + for (ii= 0; ii < max; ii++) { + if ((SCpnt = hd->ScsiLookup[ii]) != NULL) { - dprintk((KERN_INFO MYNAM ": Info: Zapping TaskMgmt thread!\n")); + /* Command found. + */ + +#ifndef MPT_SCSI_USE_NEW_EH + /* Search taskQ, if found, delete. + */ + search_taskQ_for_cmd(SCpnt, hd); +#endif + + /* Search pendingQ, if found, + * delete from Q. If found, do not decrement + * queue_depth, command never posted. + */ + if (mptscsih_search_pendingQ(hd, ii) == NULL) + atomic_dec(&queue_depth); - /* Zap the taskQ! */ - Q_INIT(&mpt_scsih_taskQ, MPT_FRAME_HDR); - spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags); + /* Null ScsiLookup index + */ + hd->ScsiLookup[ii] = NULL; - while(mpt_scsih_taskQ_bh_active && --count) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(1); + mf = MPT_INDEX_2_MFPTR(hd->ioc, ii); + dmfprintk(( "flush: ScsiDone (mf=%p,sc=%p)\n", + mf, SCpnt)); + + /* Set status + * Do OS callback + * Free chain buffers + * Free message frame + */ + SCpnt->result = DID_RESET << 16; + SCpnt->host_scribble = NULL; + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->scsi_done(SCpnt); /* Issue the command callback */ + spin_unlock_irqrestore(&io_request_lock, flags); + + /* Free Chain buffers */ + mptscsih_freeChainBuffers(hd, ii); + + /* Free Message frames */ + mpt_free_msg_frame(ScsiDoneCtx, hd->ioc->id, mf); } - if (!count) - printk(KERN_ERR MYNAM ": ERROR! TaskMgmt thread still active!\n"); } - spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags); -#endif + return; +} - hd = (MPT_SCSI_HOST *) host->hostdata; - if (hd != NULL) { - int sz1, sz2; +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mptscsih_initChainBuffers - Allocate memory for and initialize + * chain buffers, chain buffer control arrays and spinlock. + * @hd: Pointer to MPT_SCSI_HOST structure + * @init: If set, initialize the spin lock. + */ +static int +mptscsih_initChainBuffers (MPT_SCSI_HOST *hd, int init) +{ + MPT_FRAME_HDR *chain; + u8 *mem; + unsigned long flags; + int sz, ii, numChain; - sz1 = sz2 = 0; - if (hd->ScsiLookup != NULL) { - sz1 = hd->ioc->req_depth * sizeof(void *); - kfree(hd->ScsiLookup); - hd->ScsiLookup = NULL; - } - if (hd->SgHunks != NULL) { + /* Chain buffer allocations + * Allocate and initialize tracker structures + */ + if (hd->ioc->req_sz <= 64) + numChain = MPT_SG_REQ_64_SCALE * hd->ioc->req_depth; + else if (hd->ioc->req_sz <= 96) + numChain = MPT_SG_REQ_96_SCALE * hd->ioc->req_depth; + else + numChain = MPT_SG_REQ_128_SCALE * hd->ioc->req_depth; - sz2 = MPT_SG_BUCKETS_PER_HUNK * hd->ioc->req_sz * hd->ioc->req_depth; - pci_free_consistent(hd->ioc->pcidev, sz2, - hd->SgHunks, hd->SgHunksDMA); - hd->SgHunks = NULL; - } - dprintk((KERN_INFO MYNAM ": Free'd ScsiLookup (%d) and SgHunks (%d) memory\n", sz1, sz2)); + sz = numChain * sizeof(int); + + if (hd->ReqToChain == NULL) { + mem = kmalloc(sz, GFP_KERNEL); + if (mem == NULL) + return -1; + + hd->ReqToChain = (int *) mem; + } else { + mem = (u8 *) hd->ReqToChain; } + memset(mem, 0xFF, sz); - if (mpt_scsi_hosts) { - if (--mpt_scsi_hosts == 0) { -#if 0 - mptscsih_flush_pending(); -#endif - mpt_reset_deregister(ScsiDoneCtx); - dprintk((KERN_INFO MYNAM ": Deregistered for IOC reset notifications\n")); + if (hd->ChainToChain == NULL) { + mem = kmalloc(sz, GFP_KERNEL); + if (mem == NULL) + return -1; - mpt_event_deregister(ScsiDoneCtx); - dprintk((KERN_INFO MYNAM ": Deregistered for IOC event notifications\n")); + hd->ChainToChain = (int *) mem; + } else { + mem = (u8 *) hd->ChainToChain; + } + memset(mem, 0xFF, sz); - mpt_deregister(ScsiDoneCtx); - mpt_deregister(ScsiTaskCtx); + if (hd->ChainBuffer == NULL) { + /* Allocate free chain buffer pool + */ + sz = numChain * hd->ioc->req_sz; + mem = pci_alloc_consistent(hd->ioc->pcidev, sz, &hd->ChainBufferDMA); + if (mem == NULL) + return -1; - if (info_kbuf != NULL) - kfree(info_kbuf); - } + hd->ChainBuffer = (u8*)mem; + } else { + mem = (u8 *) hd->ChainBuffer; + } + memset(mem, 0, sz); + + dprintk((KERN_INFO " ChainBuffer @ %p(%p), sz=%d\n", + hd->ChainBuffer, (void *)(ulong)hd->ChainBufferDMA, sz)); + + /* Initialize the free chain Q. + */ + if (init) { + spin_lock_init(&hd->FreeChainQlock); } + spin_lock_irqsave (&hd->FreeChainQlock, flags); + Q_INIT(&hd->FreeChainQ, MPT_FRAME_HDR); + + /* Post the chain buffers to the FreeChainQ. + */ + mem = (u8 *)hd->ChainBuffer; + for (ii=0; ii < numChain; ii++) { + chain = (MPT_FRAME_HDR *) mem; + Q_ADD_TAIL(&hd->FreeChainQ.head, &chain->u.frame.linkage, MPT_FRAME_HDR); + mem += hd->ioc->req_sz; + } + spin_unlock_irqrestore(&hd->FreeChainQlock, flags); + return 0; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** - * mptscsih_info - Return information about MPT adapter - * @SChost: Pointer to Scsi_Host structure - * - * (linux Scsi_Host_Template.info routine) +/* + * Hack! It might be nice to report if a device is returning QUEUE_FULL + * but maybe not each and every time... + */ +static long last_queue_full = 0; + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mptscsih_report_queue_full - Report QUEUE_FULL status returned + * from a SCSI target device. + * @sc: Pointer to Scsi_Cmnd structure + * @pScsiReply: Pointer to SCSIIOReply_t + * @pScsiReq: Pointer to original SCSI request * - * Returns pointer to buffer where information was written. + * This routine periodically reports QUEUE_FULL status returned from a + * SCSI target device. It reports this to the console via kernel + * printk() API call, not more than once every 10 seconds. */ -const char * -mptscsih_info(struct Scsi_Host *SChost) +static void +mptscsih_report_queue_full(Scsi_Cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq) { - MPT_SCSI_HOST *h; - int size = 0; - - if (info_kbuf == NULL) - if ((info_kbuf = kmalloc(0x1000 /* 4Kb */, GFP_KERNEL)) == NULL) - return info_kbuf; + long time = jiffies; - h = (MPT_SCSI_HOST *)SChost->hostdata; - info_kbuf[0] = '\0'; - mpt_print_ioc_summary(h->ioc, info_kbuf, &size, 0, 0); - info_kbuf[size-1] = '\0'; + if (time - last_queue_full > 10 * HZ) { + char *ioc_str = "ioc?"; - return info_kbuf; + if (sc->host && sc->host->hostdata) + ioc_str = ((MPT_SCSI_HOST *)sc->host->hostdata)->ioc->name; + printk(MYIOC_s_WARN_FMT "Device (%d:%d:%d) reported QUEUE_FULL!\n", + ioc_str, 0, sc->target, sc->lun); + last_queue_full = time; + } } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ - static int max_qd = 1; -#ifdef MPT_DEBUG - static int max_sges = 0; - static int max_xfer = 0; -#endif -#if 0 - static int max_num_sges = 0; - static int max_sgent_len = 0; -#endif -#if 0 -static int index_log[128]; -static int index_ent = 0; -static __inline__ void ADD_INDEX_LOG(int req_ent) -{ - int i = index_ent++; +static int BeenHereDoneThat = 0; - index_log[i & (128 - 1)] = req_ent; -} -#else -#define ADD_INDEX_LOG(req_ent) do { } while(0) -#endif +/* SCSI host fops start here... */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** - * mptscsih_qcmd - Primary Fusion MPT SCSI initiator IO start routine. - * @SCpnt: Pointer to Scsi_Cmnd structure - * @done: Pointer SCSI mid-layer IO completion function + * mptscsih_detect - Register MPT adapter(s) as SCSI host(s) with + * linux scsi mid-layer. + * @tpnt: Pointer to Scsi_Host_Template structure * - * (linux Scsi_Host_Template.queuecommand routine) - * This is the primary SCSI IO start routine. Create a MPI SCSIIORequest - * from a linux Scsi_Cmnd request and send it to the IOC. + * (linux Scsi_Host_Template.detect routine) * - * Returns 0. (rtn value discarded by linux scsi mid-layer) + * Returns number of SCSI host adapters that were successfully + * registered with the linux scsi mid-layer via the scsi_register() + * API call. */ int -mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) +mptscsih_detect(Scsi_Host_Template *tpnt) { - struct Scsi_Host *host; - MPT_SCSI_HOST *hd; - MPT_FRAME_HDR *mf; - SCSIIORequest_t *pScsiReq; - int datadir; - u32 len; - u32 sgdir; - u32 scsictl; - u32 scsidir; - u32 qtag; - u32 *mptr; - int sge_spill1; - int frm_sz; - int sges_left; - u32 chain_offset; - int my_idx; - int i; + struct Scsi_Host *sh = NULL; + MPT_SCSI_HOST *hd = NULL; + MPT_ADAPTER *this; + MPT_DONE_Q *freedoneQ; + unsigned long flags; + int sz, ii; + int numSGE = 0; + int scale; + u8 *mem; - dmfprintk((KERN_INFO MYNAM "_qcmd: SCpnt=%p, done()=%p\n", - SCpnt, done)); + if (! BeenHereDoneThat++) { + show_mptmod_ver(my_NAME, my_VERSION); - host = SCpnt->host; - hd = (MPT_SCSI_HOST *) host->hostdata; - -#if 0 - if (host->host_busy >= 60) { - MPT_ADAPTER *ioc = hd->ioc; - u16 pci_command, pci_status; - - /* The IOC is probably hung, investigate status. */ - printk("MPI: IOC probably hung IOCSTAT[%08x] INTSTAT[%08x] REPLYFIFO[%08x]\n", - readl(&ioc->chip.fc9xx->DoorbellValue), - readl(&ioc->chip.fc9xx->IntStatus), - readl(&ioc->chip.fc9xx->ReplyFifo)); - pci_read_config_word(ioc->pcidev, PCI_COMMAND, &pci_command); - pci_read_config_word(ioc->pcidev, PCI_STATUS, &pci_status); - printk("MPI: PCI command[%04x] status[%04x]\n", pci_command, pci_status); - { - /* DUMP req index logger. */ - int begin, end; + ScsiDoneCtx = mpt_register(mptscsih_io_done, MPTSCSIH_DRIVER); + ScsiTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSCSIH_DRIVER); + ScsiScanDvCtx = mpt_register(mptscsih_scandv_complete, MPTSCSIH_DRIVER); - begin = (index_ent - 65) & (128 - 1); - end = index_ent & (128 - 1); - printk("MPI: REQ_INDEX_HIST["); - while (begin != end) { - printk("(%04x)", index_log[begin]); - begin = (begin + 1) & (128 - 1); - } - printk("\n"); - } - sti(); - while(1) - barrier(); - } +#ifndef MPT_SCSI_USE_NEW_EH + spin_lock_init(&mytaskQ_lock); #endif - SCpnt->scsi_done = done; + if (mpt_event_register(ScsiDoneCtx, mptscsih_event_process) == 0) { + dprintk((KERN_INFO MYNAM ": Registered for IOC event notifications\n")); + } else { + /* FIXME! */ + } - /* 20000617 -sralston - * GRRRRR... Shouldn't have to do this but... - * Do explicit check for REQUEST_SENSE and cached SenseData. - * If yes, return cached SenseData. - */ -#ifdef MPT_SCSI_CACHE_AUTOSENSE - { - MPT_SCSI_DEV *mpt_sdev; + if (mpt_reset_register(ScsiDoneCtx, mptscsih_ioc_reset) == 0) { + dprintk((KERN_INFO MYNAM ": Registered for IOC reset notifications\n")); + } else { + /* FIXME! */ + } + } + dprintk((KERN_INFO MYNAM ": mpt_scsih_detect()\n")); - mpt_sdev = (MPT_SCSI_DEV *) SCpnt->device->hostdata; - if (mpt_sdev && SCpnt->cmnd[0] == REQUEST_SENSE) { - u8 *dest = NULL; +#ifdef MODULE + /* Evaluate the command line arguments, if any */ + if (mptscsih) + mptscsih_setup(mptscsih); +#endif +#ifndef MPT_SCSI_USE_NEW_EH + atomic_set(&mpt_taskQdepth, 0); +#endif - if (!SCpnt->use_sg) - dest = SCpnt->request_buffer; - else { - struct scatterlist *sg = (struct scatterlist *) SCpnt->request_buffer; - if (sg) - dest = (u8 *) (unsigned long)sg_dma_address(sg); + this = mpt_adapter_find_first(); + while (this != NULL) { + int portnum; + for (portnum=0; portnum < this->facts.NumberOfPorts; portnum++) { + + /* 20010215 -sralston + * Added sanity check on SCSI Initiator-mode enabled + * for this MPT adapter. + */ + if (!(this->pfacts[portnum].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR)) { + printk(MYIOC_s_WARN_FMT "Skipping because SCSI Initiator mode is NOT enabled!\n", + this->name); + continue; } - if (dest && mpt_sdev->sense_sz) { - memcpy(dest, mpt_sdev->CachedSense.data, mpt_sdev->sense_sz); -#ifdef MPT_DEBUG - { - int i; - u8 *sb; - - sb = mpt_sdev->CachedSense.data; - if (sb && ((sb[0] & 0x70) == 0x70)) { - printk(KERN_WARNING MYNAM ": Returning last cached SCSI (hex) SenseData:\n"); - printk(KERN_WARNING " "); - for (i = 0; i < (8 + sb[7]); i++) - printk("%s%02x", i == 13 ? "-" : " ", sb[i]); - printk("\n"); - } - } -#endif + /* 20010202 -sralston + * Added sanity check on readiness of the MPT adapter. + */ + if (this->last_state != MPI_IOC_STATE_OPERATIONAL) { + printk(MYIOC_s_WARN_FMT "Skipping because it's not operational!\n", + this->name); + continue; } - SCpnt->resid = SCpnt->request_bufflen - mpt_sdev->sense_sz; - SCpnt->result = 0; -/* spin_lock(&io_request_lock); */ - SCpnt->scsi_done(SCpnt); -/* spin_unlock(&io_request_lock); */ - return 0; - } - } + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) + tpnt->proc_dir = &proc_mpt_scsihost; #endif + sh = scsi_register(tpnt, sizeof(MPT_SCSI_HOST)); + if (sh != NULL) { + save_flags(flags); + cli(); + sh->io_port = 0; + sh->n_io_port = 0; + sh->irq = 0; + + /* Yikes! This is important! + * Otherwise, by default, linux + * only scans target IDs 0-7! + * pfactsN->MaxDevices unreliable + * (not supported in early + * versions of the FW). + * max_id = 1 + actual max id, + * max_lun = 1 + actual last lun, + * see hosts.h :o( + */ + if ((int)this->chip_type > (int)FC929) + sh->max_id = MPT_MAX_SCSI_DEVICES; + else { + /* For FC, increase the queue depth + * from MPT_SCSI_CAN_QUEUE (31) + * to MPT_FC_CAN_QUEUE (63). + */ + sh->can_queue = MPT_FC_CAN_QUEUE; + sh->max_id = MPT_MAX_FC_DEVICES<256 ? MPT_MAX_FC_DEVICES : 255; + } + sh->max_lun = MPT_LAST_LUN + 1; - if ((mf = mpt_get_msg_frame(ScsiDoneCtx, hd->ioc->id)) == NULL) { -/* SCpnt->result = DID_SOFT_ERROR << 16; */ - SCpnt->result = STS_BUSY; - SCpnt->scsi_done(SCpnt); -/* return 1; */ - return 0; - } - pScsiReq = (SCSIIORequest_t *) mf; + sh->this_id = this->pfacts[portnum].PortSCSIID; - my_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); + /* OS entry to allow host drivers to force + * a queue depth on a per device basis. + */ + sh->select_queue_depths = mptscsih_select_queue_depths; - ADD_INDEX_LOG(my_idx); + /* Verify that we won't exceed the maximum + * number of chain buffers + * We can optimize: ZZ = req_sz/sizeof(MptSge_t) + * For 32bit SGE's: + * numSGE = 1 + (ZZ-1)*(maxChain -1) + ZZ + * + (req_sz - 64)/sizeof(MptSge_t) + * A slightly different algorithm is required for + * 64bit SGEs. + */ + scale = this->req_sz/sizeof(MptSge_t); + if (sizeof(MptSge_t) == sizeof(SGESimple32_t)) { + numSGE = 1 + (scale - 1) * (this->facts.MaxChainDepth-1) + scale + + (this->req_sz - 64) / (sizeof(MptSge_t)); + } else if (sizeof(MptSge_t) == sizeof(SGESimple64_t)) { + numSGE = (scale - 1) * (this->facts.MaxChainDepth-1) + scale + + (this->req_sz - 60) / (sizeof(MptSge_t)); + } - /* Map the data portion, if any. */ - sges_left = SCpnt->use_sg; - if (sges_left) { - sges_left = pci_map_sg(hd->ioc->pcidev, - (struct scatterlist *) SCpnt->request_buffer, - sges_left, - scsi_to_pci_dma_dir(SCpnt->sc_data_direction)); - } else if (SCpnt->request_bufflen) { - dma_addr_t buf_dma_addr; + if (numSGE < sh->sg_tablesize) { + /* Reset this value */ + dprintk((MYIOC_s_INFO_FMT + "Resetting sg_tablesize to %d from %d\n", + this->name, numSGE, sh->sg_tablesize)); + sh->sg_tablesize = numSGE; + } - buf_dma_addr = pci_map_single(hd->ioc->pcidev, - SCpnt->request_buffer, - SCpnt->request_bufflen, - scsi_to_pci_dma_dir(SCpnt->sc_data_direction)); + restore_flags(flags); - /* We hide it here for later unmap. */ - SCpnt->SCp.ptr = (char *)(unsigned long) buf_dma_addr; - } + hd = (MPT_SCSI_HOST *) sh->hostdata; + hd->ioc = this; - /* - * Put together a MPT SCSI request... - */ + if ((int)this->chip_type > (int)FC929) + hd->is_spi = 1; - /* Assume SimpleQ, NO DATA XFER for now */ + if (DmpService && + (this->chip_type == FC919 || this->chip_type == FC929)) + hd->is_multipath = 1; - len = SCpnt->request_bufflen; - sgdir = 0x00000000; /* SGL IN (host<--ioc) */ - scsidir = MPI_SCSIIO_CONTROL_NODATATRANSFER; + hd->port = 0; /* FIXME! */ - /* - * The scsi layer should be handling this stuff - * (In 2.3.x it does -DaveM) - */ - - /* BUG FIX! 19991030 -sralston - * TUR's being issued with scsictl=0x02000000 (DATA_IN)! - * Seems we may receive a buffer (len>0) even when there - * will be no data transfer! GRRRRR... - */ - datadir = mptscsih_io_direction(SCpnt); - if (datadir < 0) { - scsidir = MPI_SCSIIO_CONTROL_READ; /* DATA IN (host<--ioc<--dev) */ - } else if (datadir > 0) { - sgdir = 0x04000000; /* SGL OUT (host-->ioc) */ - scsidir = MPI_SCSIIO_CONTROL_WRITE; /* DATA OUT (host-->ioc-->dev) */ - } else { - len = 0; - } - - qtag = MPI_SCSIIO_CONTROL_SIMPLEQ; - - /* - * Attach tags to the devices - */ - if (SCpnt->device->tagged_supported) { - /* - * Some drives are too stupid to handle fairness issues - * with tagged queueing. We throw in the odd ordered - * tag to stop them starving themselves. - */ - if ((jiffies - hd->qtag_tick) > (5*HZ)) { - qtag = MPI_SCSIIO_CONTROL_ORDEREDQ; - hd->qtag_tick = jiffies; + /* SCSI needs Scsi_Cmnd lookup table! + * (with size equal to req_depth*PtrSz!) + */ + sz = hd->ioc->req_depth * sizeof(void *); + mem = kmalloc(sz, GFP_KERNEL); + if (mem == NULL) + goto done; -#if 0 - /* These are ALWAYS zero! - * (Because this is a place for the device driver to dynamically - * assign tag numbers any way it sees fit. That's why -DaveM) - */ - dprintk((KERN_DEBUG MYNAM ": sc->device->current_tag = %08x\n", - SCpnt->device->current_tag)); - dprintk((KERN_DEBUG MYNAM ": sc->tag = %08x\n", - SCpnt->tag)); -#endif - } -#if 0 - else { - /* Hmmm... I always see value of 0 here, - * of which {HEAD_OF, ORDERED, SIMPLE} are NOT! -sralston - * (Because this is a place for the device driver to dynamically - * assign tag numbers any way it sees fit. That's why -DaveM) - * - * if (SCpnt->tag == HEAD_OF_QUEUE_TAG) - */ - if (SCpnt->device->current_tag == HEAD_OF_QUEUE_TAG) - qtag = MPI_SCSIIO_CONTROL_HEADOFQ; - else if (SCpnt->tag == ORDERED_QUEUE_TAG) - qtag = MPI_SCSIIO_CONTROL_ORDEREDQ; - } -#endif - } + memset(mem, 0, sz); + hd->ScsiLookup = (struct scsi_cmnd **) mem; - scsictl = scsidir | qtag; + dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n", + this->name, hd->ScsiLookup, sz)); - frm_sz = hd->ioc->req_sz; + if (mptscsih_initChainBuffers(hd, 1) < 0) + goto done; - /* Ack! - * sge_spill1 = 9; - */ - sge_spill1 = (frm_sz - (sizeof(SCSIIORequest_t) - sizeof(SGEIOUnion_t) + sizeof(SGEChain32_t))) / 8; - /* spill1: for req_sz == 128 (128-48==80, 80/8==10 SGEs max, first time!), --> use 9 - * spill1: for req_sz == 96 ( 96-48==48, 48/8== 6 SGEs max, first time!), --> use 5 - */ - dsgprintk((KERN_INFO MYNAM ": SG: %x spill1 = %d\n", - my_idx, sge_spill1)); - -#ifdef MPT_DEBUG - if (sges_left > max_sges) { - max_sges = sges_left; - dprintk((KERN_INFO MYNAM ": MPT_MaxSges = %d\n", max_sges)); - } -#endif -#if 0 - if (sges_left > max_num_sges) { - max_num_sges = sges_left; - printk(KERN_INFO MYNAM ": MPT_MaxNumSges = %d\n", max_num_sges); - } -#endif + /* Allocate memory for free and doneQ's + */ + sz = sh->can_queue * sizeof(MPT_DONE_Q); + mem = kmalloc(sz, GFP_KERNEL); + if (mem == NULL) + goto done; - dsgprintk((KERN_INFO MYNAM ": SG: %x sges_left = %d (initially)\n", - my_idx, sges_left)); + memset(mem, 0xFF, sz); + hd->memQ = mem; - chain_offset = 0; - if (sges_left > (sge_spill1+1)) { -#if 0 - chain_offset = 0x1E; -#endif - chain_offset = (frm_sz - 8) / 4; - } + /* Initialize the free, done and pending Qs. + */ + Q_INIT(&hd->freeQ, MPT_DONE_Q); + Q_INIT(&hd->doneQ, MPT_DONE_Q); + Q_INIT(&hd->pendingQ, MPT_DONE_Q); + spin_lock_init(&hd->freedoneQlock); + + mem = hd->memQ; + for (ii=0; ii < sh->can_queue; ii++) { + freedoneQ = (MPT_DONE_Q *) mem; + Q_ADD_TAIL(&hd->freeQ.head, freedoneQ, MPT_DONE_Q); + mem += sizeof(MPT_DONE_Q); + } - pScsiReq->TargetID = SCpnt->target; - pScsiReq->Bus = hd->port; - pScsiReq->ChainOffset = chain_offset; - pScsiReq->Function = MPI_FUNCTION_SCSI_IO_REQUEST; - pScsiReq->CDBLength = SCpnt->cmd_len; + /* Initialize this Scsi_Host + * internal task Q. + */ + Q_INIT(&hd->taskQ, MPT_FRAME_HDR); + hd->taskQcnt = 0; -/* We have 256 bytes alloc'd per IO; let's use it. */ -/* pScsiReq->SenseBufferLength = SNS_LEN(SCpnt); */ - pScsiReq->SenseBufferLength = 255; + /* Allocate memory for the device structures. + * A non-Null pointer at an offset + * indicates a device exists. + * max_id = 1 + maximum id (hosts.h) + */ + sz = sh->max_id * sizeof(void *); + mem = kmalloc(sz, GFP_KERNEL); + if (mem == NULL) + goto done; - pScsiReq->Reserved = 0; - pScsiReq->MsgFlags = 0; - pScsiReq->LUN[0] = 0; - pScsiReq->LUN[1] = SCpnt->lun; - pScsiReq->LUN[2] = 0; - pScsiReq->LUN[3] = 0; - pScsiReq->LUN[4] = 0; - pScsiReq->LUN[5] = 0; - pScsiReq->LUN[6] = 0; - pScsiReq->LUN[7] = 0; - pScsiReq->Control = cpu_to_le32(scsictl); + memset(mem, 0, sz); + hd->Targets = (VirtDevice **) mem; - /* - * Write SCSI CDB into the message - */ - for (i = 0; i < 12; i++) - pScsiReq->CDB[i] = SCpnt->cmnd[i]; - for (i = 12; i < 16; i++) - pScsiReq->CDB[i] = 0; + dprintk((KERN_INFO " Targets @ %p, sz=%d\n", hd->Targets, sz)); - /* DataLength */ - pScsiReq->DataLength = cpu_to_le32(len); - /* SenseBuffer low address */ - pScsiReq->SenseBufferLowAddr = cpu_to_le32(hd->ioc->sense_buf_pool_dma + (my_idx * 256)); + /* Clear the TM flags + */ + hd->tmPending = 0; + hd->resetPending = 0; + hd->abortSCpnt = NULL; + hd->tmPtr = NULL; + hd->numTMrequests = 0; + + /* Clear the pointer used to store + * single-threaded commands, i.e., those + * issued during a bus scan, dv and + * configuration pages. + */ + hd->cmdPtr = NULL; - mptr = (u32 *) &pScsiReq->SGL; + /* Attach the SCSI Host to the IOC structure + */ + this->sh = sh; - /* - * Now fill in the SGList... - * NOTES: For 128 byte req_sz, we can hold up to 10 simple SGE's - * in the remaining request frame. We -could- do unlimited chains - * but each chain buffer can only be req_sz bytes in size, and - * we lose one SGE whenever we chain. - * For 128 req_sz, we can hold up to 16 SGE's per chain buffer. - * For practical reasons, limit ourselves to 1 overflow chain buffer; - * giving us 9 + 16 == 25 SGE's max. - * At 4 Kb per SGE, that yields 100 Kb max transfer. - * - * (This code needs to be completely changed when/if 64-bit DMA - * addressing is used, since we will be able to fit much less than - * 10 embedded SG entries. -DaveM) - */ - if (sges_left) { - struct scatterlist *sg = (struct scatterlist *) SCpnt->request_buffer; - u32 v1, v2; - int sge_spill2; - int sge_cur_spill; - int sgCnt; - u8 *pSgBucket; - int chain_sz; - - len = 0; - - /* sge_spill2 = 15; - * spill2: for req_sz == 128 (128/8==16 SGEs max, first time!), --> use 15 - * spill2: for req_sz == 96 ( 96/8==12 SGEs max, first time!), --> use 11 - */ - sge_spill2 = frm_sz / 8 - 1; - dsgprintk((KERN_INFO MYNAM ": SG: %x spill2 = %d\n", - my_idx, sge_spill2)); - - pSgBucket = NULL; - sgCnt = 0; - sge_cur_spill = sge_spill1; - while (sges_left) { -#if 0 - if (sg_dma_len(sg) > max_sgent_len) { - max_sgent_len = sg_dma_len(sg); - printk(KERN_INFO MYNAM ": MPT_MaxSgentLen = %d\n", max_sgent_len); - } -#endif - /* Write one simple SGE */ - v1 = sgdir | 0x10000000 | sg_dma_len(sg); - len += sg_dma_len(sg); - v2 = sg_dma_address(sg); - dsgprintk((KERN_INFO MYNAM ": SG: %x Writing SGE @%p: %08x %08x, sges_left=%d\n", - my_idx, mptr, v1, v2, sges_left)); - *mptr++ = cpu_to_le32(v1); - *mptr++ = cpu_to_le32(v2); - sg++; - sgCnt++; - - if (--sges_left == 0) { - /* re-write 1st word of previous SGE with SIMPLE, - * LE, EOB, and EOL bits! - */ - v1 = 0xD1000000 | sgdir | sg_dma_len(sg-1); - dsgprintk((KERN_INFO MYNAM ": SG: %x (re)Writing SGE @%p: %08x (VERY LAST SGE!)\n", - my_idx, mptr-2, v1)); - *(mptr - 2) = cpu_to_le32(v1); - } else { - if ((sges_left > 1) && ((sgCnt % sge_cur_spill) == 0)) { - dsgprintk((KERN_INFO MYNAM ": SG: %x SG spill at modulo 0!\n", - my_idx)); - - /* Fixup previous SGE with LE bit! */ - v1 = sgdir | 0x90000000 | sg_dma_len(sg-1); - dsgprintk((KERN_INFO MYNAM ": SG: %x (re)Writing SGE @%p: %08x (LAST BUCKET SGE!)\n", - my_idx, mptr-2, v1)); - *(mptr - 2) = cpu_to_le32(v1); - - chain_offset = 0; - /* Going to need another chain? */ - if (sges_left > (sge_spill2+1)) { -#if 0 - chain_offset = 0x1E; + /* Initialize this SCSI Hosts' timers + * To use, set the timer expires field + * and add_timer + */ + init_timer(&hd->timer); + hd->timer.data = (unsigned long) hd; + hd->timer.function = mptscsih_timer_expired; + + init_timer(&hd->TMtimer); + hd->TMtimer.data = (unsigned long) hd; + hd->TMtimer.function = mptscsih_taskmgmt_timeout; + hd->qtag_tick = jiffies; + + /* Moved Earlier Pam D */ + /* this->sh = sh; */ + + if (hd->is_spi) { + /* Update with the driver setup + * values. + */ + if (hd->ioc->spi_data.maxBusWidth > driver_setup.max_width) + hd->ioc->spi_data.maxBusWidth = driver_setup.max_width; + if (hd->ioc->spi_data.minSyncFactor < driver_setup.min_sync_fac) + hd->ioc->spi_data.minSyncFactor = driver_setup.min_sync_fac; + + if (hd->ioc->spi_data.minSyncFactor == MPT_ASYNC) + hd->ioc->spi_data.maxSyncOffset = 0; + + hd->negoNvram = 0; +#ifdef MPTSCSIH_DISABLE_DOMAIN_VALIDATION + hd->negoNvram = MPT_SCSICFG_USE_NVRAM; #endif - chain_offset = (frm_sz - 8) / 4; - chain_sz = frm_sz; - } else { - chain_sz = sges_left * 8; - } - - /* write chain SGE at mptr. */ - v1 = 0x30000000 | chain_offset<<16 | chain_sz; - if (pSgBucket == NULL) { - pSgBucket = hd->SgHunks - + (my_idx * frm_sz * MPT_SG_BUCKETS_PER_HUNK); - } else { - pSgBucket += frm_sz; - } - v2 = (hd->SgHunksDMA + - ((u8 *)pSgBucket - (u8 *)hd->SgHunks)); - dsgprintk((KERN_INFO MYNAM ": SG: %x Writing SGE @%p: %08x %08x (CHAIN!)\n", - my_idx, mptr, v1, v2)); - *(mptr++) = cpu_to_le32(v1); - *(mptr) = cpu_to_le32(v2); + if (driver_setup.dv == 0) + hd->negoNvram = MPT_SCSICFG_USE_NVRAM; - mptr = (u32 *) pSgBucket; - sgCnt = 0; - sge_cur_spill = sge_spill2; - } - } - } - } else { - dsgprintk((KERN_INFO MYNAM ": SG: non-SG for %p, len=%d\n", - SCpnt, SCpnt->request_bufflen)); + hd->ioc->spi_data.forceDv = 0; + for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) + hd->ioc->spi_data.dvStatus[ii] = MPT_SCSICFG_NEGOTIATE; - if (len > 0) { - dma_addr_t buf_dma_addr; - buf_dma_addr = (dma_addr_t) (unsigned long)SCpnt->SCp.ptr; - *(mptr++) = cpu_to_le32(0xD1000000|sgdir|SCpnt->request_bufflen); - *(mptr++) = cpu_to_le32(buf_dma_addr); - } - } + ddvprintk((MYIOC_s_INFO_FMT + "dv %x width %x factor %x \n", + hd->ioc->name, driver_setup.dv, + driver_setup.max_width, + driver_setup.min_sync_fac)); -#ifdef MPT_DEBUG - /* if (SCpnt->request_bufflen > max_xfer) */ - if (len > max_xfer) { - max_xfer = len; - dprintk((KERN_INFO MYNAM ": MPT_MaxXfer = %d\n", max_xfer)); - } -#endif + } - hd->ScsiLookup[my_idx] = SCpnt; + mpt_scsi_hosts++; + } - /* Main banana... */ - mpt_put_msg_frame(ScsiDoneCtx, hd->ioc->id, mf); + } /* for each adapter port */ - atomic_inc(&queue_depth); - if (atomic_read(&queue_depth) > max_qd) { - max_qd = atomic_read(&queue_depth); - dprintk((KERN_INFO MYNAM ": Queue depth now %d.\n", max_qd)); + this = mpt_adapter_find_next(this); } - dmfprintk((KERN_INFO MYNAM ": Issued SCSI cmd (%p)\n", SCpnt)); +done: + if (mpt_scsi_hosts > 0) + register_reboot_notifier(&mptscsih_notifier); - return 0; + return mpt_scsi_hosts; } -#ifdef MPT_SCSI_USE_NEW_EH /* { */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* - mptscsih_abort - Returns: 0=SUCCESS, else FAILED -*/ + static char *info_kbuf = NULL; /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** - * mptscsih_abort - Abort linux Scsi_Cmnd routine, new_eh variant - * @SCpnt: Pointer to Scsi_Cmnd structure, IO to be aborted + * mptscsih_release - Unregister SCSI host from linux scsi mid-layer + * @host: Pointer to Scsi_Host structure * - * (linux Scsi_Host_Template.eh_abort_handler routine) + * (linux Scsi_Host_Template.release routine) + * This routine releases all resources associated with the SCSI host + * adapter. * - * Returns SUCCESS or FAILED. + * Returns 0 for success. */ int -mptscsih_abort(Scsi_Cmnd * SCpnt) +mptscsih_release(struct Scsi_Host *host) { - MPT_FRAME_HDR *mf; - SCSITaskMgmt_t *pScsiTm; MPT_SCSI_HOST *hd; - u32 *msg; - u32 ctx2abort; - int i; + int count; unsigned long flags; - printk(KERN_WARNING MYNAM ": Attempting _ABORT SCSI IO (=%p)\n", SCpnt); - printk(KERN_WARNING MYNAM ": IOs outstanding = %d\n", atomic_read(&queue_depth)); + hd = (MPT_SCSI_HOST *) host->hostdata; - hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata; +#ifndef MPT_SCSI_USE_NEW_EH +#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION + spin_lock_irqsave(&dvtaskQ_lock, flags); + dvtaskQ_release = 1; + spin_unlock_irqrestore(&dvtaskQ_lock, flags); +#endif - if ((mf = mpt_get_msg_frame(ScsiTaskCtx, hd->ioc->id)) == NULL) { -/* SCpnt->result = DID_SOFT_ERROR << 16; */ - SCpnt->result = STS_BUSY; - SCpnt->scsi_done(SCpnt); - return FAILED; + spin_lock_irqsave(&mytaskQ_lock, flags); + if (mytaskQ_bh_active) { + count = 10 * HZ; + + spin_unlock_irqrestore(&mytaskQ_lock, flags); + dprintk((KERN_INFO MYNAM ": Info: Zapping TaskMgmt thread!\n")); + clean_taskQ(hd); + + while(mytaskQ_bh_active && --count) { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(1); + } + if (!count) + printk(KERN_ERR MYNAM ": ERROR - TaskMgmt thread still active!\n"); } + spin_unlock_irqrestore(&mytaskQ_lock, flags); +#endif - pScsiTm = (SCSITaskMgmt_t *) mf; - msg = (u32 *) mf; +#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION + /* Check DV thread active */ + count = 10 * HZ; + spin_lock_irqsave(&dvtaskQ_lock, flags); + while(dvtaskQ_active && --count) { + spin_unlock_irqrestore(&dvtaskQ_lock, flags); + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(1); + spin_lock_irqsave(&dvtaskQ_lock, flags); + } + spin_unlock_irqrestore(&dvtaskQ_lock, flags); + if (!count) + printk(KERN_ERR MYNAM ": ERROR - DV thread still active!\n"); +#if defined(MPT_DEBUG_DV) || defined(MPT_DEBUG_DV_TINY) + else + printk(KERN_ERR MYNAM ": DV thread orig %d, count %d\n", 10 * HZ, count); +#endif +#endif - pScsiTm->TargetID = SCpnt->target; - pScsiTm->Bus = hd->port; - pScsiTm->ChainOffset = 0; - pScsiTm->Function = MPI_FUNCTION_SCSI_TASK_MGMT; + unregister_reboot_notifier(&mptscsih_notifier); - pScsiTm->Reserved = 0; - pScsiTm->TaskType = MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK; - pScsiTm->Reserved1 = 0; - pScsiTm->MsgFlags = 0; + if (hd != NULL) { + int sz1, sz2, sz3, sztarget=0; + int szchain = 0; + int szQ = 0; + int scale; - for (i = 0; i < 8; i++) { - u8 val = 0; - if (i == 1) - val = SCpnt->lun; - pScsiTm->LUN[i] = val; - } + /* Synchronize disk caches + */ + (void) mptscsih_synchronize_cache(hd, 0); - for (i = 0; i < 7; i++) - pScsiTm->Reserved2[i] = 0; + sz1 = sz2 = sz3 = 0; - /* Most important! Set TaskMsgContext to SCpnt's MsgContext! - * (the IO to be ABORT'd) - * - * NOTE: Since we do not byteswap MsgContext, we do not - * swap it here either. It is an opaque cookie to - * the controller, so it does not matter. -DaveM - */ - ctx2abort = SCPNT_TO_MSGCTX(SCpnt); - if (ctx2abort == -1) { - printk(KERN_ERR MYNAM ": ERROR - ScsiLookup fail(#2) for SCpnt=%p\n", SCpnt); - SCpnt->result = DID_SOFT_ERROR << 16; - spin_lock_irqsave(&io_request_lock, flags); - SCpnt->scsi_done(SCpnt); - spin_unlock_irqrestore(&io_request_lock, flags); - mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf); - } else { - dprintk((KERN_INFO MYNAM ":DbG: ctx2abort = %08x\n", ctx2abort)); - pScsiTm->TaskMsgContext = ctx2abort; + if (hd->ioc->req_sz <= 64) + scale = MPT_SG_REQ_64_SCALE; + else if (hd->ioc->req_sz <= 96) + scale = MPT_SG_REQ_96_SCALE; + else + scale = MPT_SG_REQ_128_SCALE; + if (hd->ScsiLookup != NULL) { + sz1 = hd->ioc->req_depth * sizeof(void *); + kfree(hd->ScsiLookup); + hd->ScsiLookup = NULL; + } - /* MPI v0.10 requires SCSITaskMgmt requests be sent via Doorbell/handshake - mpt_put_msg_frame(hd->ioc->id, mf); - */ - if ((i = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id, - sizeof(SCSITaskMgmt_t), msg)) - != 0) { - printk(KERN_WARNING MYNAM - ": WARNING[2] - IOC error (%d) processing TaskMgmt request (mf=%p:sc=%p)\n", - i, mf, SCpnt); - SCpnt->result = DID_SOFT_ERROR << 16; - spin_lock_irqsave(&io_request_lock, flags); - SCpnt->scsi_done(SCpnt); - spin_unlock_irqrestore(&io_request_lock, flags); - mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf); + if (hd->ReqToChain != NULL) { + szchain += scale * hd->ioc->req_depth * sizeof(int); + kfree(hd->ReqToChain); + hd->ReqToChain = NULL; } - } - //return SUCCESS; - return FAILED; -} + if (hd->ChainToChain != NULL) { + szchain += scale * hd->ioc->req_depth * sizeof(int); + kfree(hd->ChainToChain); + hd->ChainToChain = NULL; + } -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** - * mptscsih_dev_reset - Perform a SCSI TARGET_RESET! new_eh variant - * @SCpnt: Pointer to Scsi_Cmnd structure, IO which reset is due to - * - * (linux Scsi_Host_Template.eh_dev_reset_handler routine) - * - * Returns SUCCESS or FAILED. - */ -int -mptscsih_dev_reset(Scsi_Cmnd * SCpnt) -{ - MPT_FRAME_HDR *mf; - SCSITaskMgmt_t *pScsiTm; - MPT_SCSI_HOST *hd; - u32 *msg; - int i; - unsigned long flags; + if (hd->ChainBuffer != NULL) { + sz2 = scale * hd->ioc->req_depth * hd->ioc->req_sz; + szchain += sz2; - printk(KERN_WARNING MYNAM ": Attempting _TARGET_RESET (%p)\n", SCpnt); - printk(KERN_WARNING MYNAM ": IOs outstanding = %d\n", atomic_read(&queue_depth)); + pci_free_consistent(hd->ioc->pcidev, sz2, + hd->ChainBuffer, hd->ChainBufferDMA); + hd->ChainBuffer = NULL; + } - hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata; + if (hd->memQ != NULL) { + szQ = host->can_queue * sizeof(MPT_DONE_Q); + kfree(hd->memQ); + hd->memQ = NULL; + } - if ((mf = mpt_get_msg_frame(ScsiTaskCtx, hd->ioc->id)) == NULL) { -/* SCpnt->result = DID_SOFT_ERROR << 16; */ - SCpnt->result = STS_BUSY; - SCpnt->scsi_done(SCpnt); - return FAILED; - } + if (hd->Targets != NULL) { + int max, ii; - pScsiTm = (SCSITaskMgmt_t *) mf; - msg = (u32*)mf; + /* + * Free any target structures that were allocated. + */ + if (hd->is_spi) { + max = MPT_MAX_SCSI_DEVICES; + } else { + max = MPT_MAX_FC_DEVICES; + } + for (ii=0; ii < max; ii++) { + if (hd->Targets[ii]) { + kfree(hd->Targets[ii]); + hd->Targets[ii] = NULL; + sztarget += sizeof(VirtDevice); + } + } - pScsiTm->TargetID = SCpnt->target; - pScsiTm->Bus = hd->port; - pScsiTm->ChainOffset = 0; - pScsiTm->Function = MPI_FUNCTION_SCSI_TASK_MGMT; + /* + * Free pointer array. + */ + sz3 = max * sizeof(void *); + kfree(hd->Targets); + hd->Targets = NULL; + } - pScsiTm->Reserved = 0; - pScsiTm->TaskType = MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET; - pScsiTm->Reserved1 = 0; - pScsiTm->MsgFlags = 0; + dprintk((MYIOC_s_INFO_FMT "Free'd ScsiLookup (%d), chain (%d) and Target (%d+%d) memory\n", + hd->ioc->name, sz1, szchain, sz3, sztarget)); + dprintk(("Free'd done and free Q (%d) memory\n", szQ)); + } + /* NULL the Scsi_Host pointer + */ + hd->ioc->sh = NULL; + scsi_unregister(host); + + if (mpt_scsi_hosts) { + if (--mpt_scsi_hosts == 0) { + mpt_reset_deregister(ScsiDoneCtx); + dprintk((KERN_INFO MYNAM ": Deregistered for IOC reset notifications\n")); - /* _TARGET_RESET goes to LUN 0 always! */ - for (i = 0; i < 8; i++) - pScsiTm->LUN[i] = 0; - - /* Control: No data direction, set task mgmt bit? */ - for (i = 0; i < 7; i++) - pScsiTm->Reserved2[i] = 0; + mpt_event_deregister(ScsiDoneCtx); + dprintk((KERN_INFO MYNAM ": Deregistered for IOC event notifications\n")); - pScsiTm->TaskMsgContext = cpu_to_le32(0); + mpt_deregister(ScsiScanDvCtx); + mpt_deregister(ScsiTaskCtx); + mpt_deregister(ScsiDoneCtx); -/* MPI v0.10 requires SCSITaskMgmt requests be sent via Doorbell/handshake - mpt_put_msg_frame(hd->ioc->id, mf); -*/ -/* FIXME! Check return status! */ - if ((i = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id, - sizeof(SCSITaskMgmt_t), msg)) - != 0) { - printk(KERN_WARNING MYNAM - ": WARNING[3] - IOC error (%d) processing TaskMgmt request (mf=%p:sc=%p)\n", - i, mf, SCpnt); - SCpnt->result = DID_SOFT_ERROR << 16; - spin_lock_irqsave(&io_request_lock, flags); - SCpnt->scsi_done(SCpnt); - spin_unlock_irqrestore(&io_request_lock, flags); - mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf); + if (info_kbuf != NULL) + kfree(info_kbuf); + } } - //return SUCCESS; - return FAILED; + return 0; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** - * mptscsih_bus_reset - Perform a SCSI BUS_RESET! new_eh variant - * @SCpnt: Pointer to Scsi_Cmnd structure, IO which reset is due to + * mptscsih_halt - Process the reboot notification + * @nb: Pointer to a struct notifier_block (ignored) + * @event: event (SYS_HALT, SYS_RESTART, SYS_POWER_OFF) + * @buf: Pointer to a data buffer (ignored) * - * (linux Scsi_Host_Template.eh_bus_reset_handler routine) + * This routine called if a system shutdown or reboot is to occur. * - * Returns SUCCESS or FAILED. + * Return NOTIFY_DONE if this is something other than a reboot message. + * NOTIFY_OK if this is a reboot message. */ -int -mptscsih_bus_reset(Scsi_Cmnd * SCpnt) +static int +mptscsih_halt(struct notifier_block *nb, ulong event, void *buf) { - MPT_FRAME_HDR *mf; - SCSITaskMgmt_t *pScsiTm; - MPT_SCSI_HOST *hd; - u32 *msg; - int i; - unsigned long flags; - - printk(KERN_WARNING MYNAM ": Attempting _BUS_RESET (%p)\n", SCpnt); - printk(KERN_WARNING MYNAM ": IOs outstanding = %d\n", atomic_read(&queue_depth)); + MPT_ADAPTER *ioc = NULL; + MPT_SCSI_HOST *hd = NULL; - hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata; + /* Ignore all messages other than reboot message + */ + if ((event != SYS_RESTART) && (event != SYS_HALT) + && (event != SYS_POWER_OFF)) + return (NOTIFY_DONE); - if ((mf = mpt_get_msg_frame(ScsiTaskCtx, hd->ioc->id)) == NULL) { -/* SCpnt->result = DID_SOFT_ERROR << 16; */ - SCpnt->result = STS_BUSY; - SCpnt->scsi_done(SCpnt); - return FAILED; + for (ioc = mpt_adapter_find_first(); ioc != NULL; ioc = mpt_adapter_find_next(ioc)) { + /* Flush the cache of this adapter + */ + if (ioc->sh) { + hd = (MPT_SCSI_HOST *) ioc->sh->hostdata; + if (hd) { + mptscsih_synchronize_cache(hd, 0); + } + } } - pScsiTm = (SCSITaskMgmt_t *) mf; - msg = (u32 *) mf; - - pScsiTm->TargetID = SCpnt->target; - pScsiTm->Bus = hd->port; - pScsiTm->ChainOffset = 0; - pScsiTm->Function = MPI_FUNCTION_SCSI_TASK_MGMT; + unregister_reboot_notifier(&mptscsih_notifier); + return NOTIFY_OK; +} - pScsiTm->Reserved = 0; - pScsiTm->TaskType = MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS; - pScsiTm->Reserved1 = 0; - pScsiTm->MsgFlags = 0; +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/** + * mptscsih_info - Return information about MPT adapter + * @SChost: Pointer to Scsi_Host structure + * + * (linux Scsi_Host_Template.info routine) + * + * Returns pointer to buffer where information was written. + */ +const char * +mptscsih_info(struct Scsi_Host *SChost) +{ + MPT_SCSI_HOST *h; + int size = 0; - for (i = 0; i < 8; i++) - pScsiTm->LUN[i] = 0; + if (info_kbuf == NULL) + if ((info_kbuf = kmalloc(0x1000 /* 4Kb */, GFP_KERNEL)) == NULL) + return info_kbuf; - /* Control: No data direction, set task mgmt bit? */ - for (i = 0; i < 7; i++) - pScsiTm->Reserved2[i] = 0; + h = (MPT_SCSI_HOST *)SChost->hostdata; + info_kbuf[0] = '\0'; + mpt_print_ioc_summary(h->ioc, info_kbuf, &size, 0, 0); + info_kbuf[size-1] = '\0'; - pScsiTm->TaskMsgContext = cpu_to_le32(0); + return info_kbuf; +} -/* MPI v0.10 requires SCSITaskMgmt requests be sent via Doorbell/handshake - mpt_put_msg_frame(hd->ioc->id, mf); -*/ -/* FIXME! Check return status! */ - if ((i = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id, - sizeof(SCSITaskMgmt_t), msg)) - != 0) { - printk(KERN_WARNING MYNAM - ": WARNING[4] - IOC error (%d) processing TaskMgmt request (mf=%p:sc=%p)\n", - i, mf, SCpnt); - SCpnt->result = DID_SOFT_ERROR << 16; - spin_lock_irqsave(&io_request_lock, flags); - SCpnt->scsi_done(SCpnt); - spin_unlock_irqrestore(&io_request_lock, flags); - mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf); - } +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ + static int max_qd = 1; +#if 0 +static int index_log[128]; +static int index_ent = 0; +static __inline__ void ADD_INDEX_LOG(int req_ent) +{ + int i = index_ent++; - return SUCCESS; + index_log[i & (128 - 1)] = req_ent; } +#else +#define ADD_INDEX_LOG(req_ent) do { } while(0) +#endif + +#ifdef DROP_TEST +#define DROP_IOC 1 /* IOC to force failures */ +#define DROP_TARGET 3 /* Target ID to force failures */ +#define DROP_THIS_CMD 10000 /* iteration to drop command */ +static int dropCounter = 0; +static int dropTestOK = 0; /* num did good */ +static int dropTestBad = 0; /* num did bad */ +static int dropTestNum = 0; /* total = good + bad + incomplete */ +static int numTotCmds = 0; +static MPT_FRAME_HDR *dropMfPtr = NULL; +static int numTMrequested = 0; +#endif -#if 0 /* { */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** - * mptscsih_host_reset - Perform a SCSI host adapter RESET! - * new_eh variant - * @SCpnt: Pointer to Scsi_Cmnd structure, IO which reset is due to +/* + * mptscsih_put_msgframe - Wrapper routine to post message frame to F/W. + * @context: Call back context (ScsiDoneCtx, ScsiScanDvCtx) + * @id: IOC id number + * @mf: Pointer to message frame * - * (linux Scsi_Host_Template.eh_host_reset_handler routine) + * Handles the call to mptbase for posting request and queue depth + * tracking. * - * Returns SUCCESS or FAILED. + * Returns none. */ -int -mptscsih_host_reset(Scsi_Cmnd * SCpnt) +static void +mptscsih_put_msgframe(int context, int id, MPT_FRAME_HDR *mf) { - return FAILED; + /* Main banana... */ + atomic_inc(&queue_depth); + if (atomic_read(&queue_depth) > max_qd) { + max_qd = atomic_read(&queue_depth); + dprintk((KERN_INFO MYNAM ": Queue depth now %d.\n", max_qd)); + } + + mpt_put_msg_frame(context, id, mf); + + return; } -#endif /* } */ -#else /* MPT_SCSI old EH stuff... */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** - * mptscsih_old_abort - Abort linux Scsi_Cmnd routine - * @SCpnt: Pointer to Scsi_Cmnd structure, IO to be aborted + * mptscsih_qcmd - Primary Fusion MPT SCSI initiator IO start routine. + * @SCpnt: Pointer to Scsi_Cmnd structure + * @done: Pointer SCSI mid-layer IO completion function * - * (linux Scsi_Host_Template.abort routine) + * (linux Scsi_Host_Template.queuecommand routine) + * This is the primary SCSI IO start routine. Create a MPI SCSIIORequest + * from a linux Scsi_Cmnd request and send it to the IOC. * - * Returns SCSI_ABORT_{SUCCESS,BUSY,PENDING}. + * Returns 0. (rtn value discarded by linux scsi mid-layer) */ int -mptscsih_old_abort(Scsi_Cmnd *SCpnt) +mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) { MPT_SCSI_HOST *hd; MPT_FRAME_HDR *mf; - struct tq_struct *ptaskfoo; + SCSIIORequest_t *pScsiReq; + VirtDevice *pTarget; + MPT_DONE_Q *buffer = NULL; unsigned long flags; + int target; + int lun; + int datadir; + u32 datalen; + u32 scsictl; + u32 scsidir; + u32 qtag; + u32 cmd_len; + int my_idx; + int ii; + int rc; + int did_errcode; + int issueCmd; - printk(KERN_WARNING MYNAM ": Scheduling _ABORT SCSI IO (=%p)\n", SCpnt); - printk(KERN_WARNING MYNAM ": IOs outstanding = %d\n", atomic_read(&queue_depth)); + did_errcode = 0; + hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata; + target = SCpnt->target; + lun = SCpnt->lun; + SCpnt->scsi_done = done; - if ((hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata) == NULL) { - SCpnt->result = DID_ABORT << 16; - SCpnt->scsi_done(SCpnt); - return SCSI_ABORT_SUCCESS; - } + pTarget = hd->Targets[target]; - /* - * Check to see if there's already an ABORT queued for this guy. + dmfprintk((MYIOC_s_INFO_FMT "qcmd: SCpnt=%p, done()=%p\n", + (hd && hd->ioc) ? hd->ioc->name : "ioc?", SCpnt, done)); + + /* 20000617 -sralston + * GRRRRR... Shouldn't have to do this but... + * Do explicit check for REQUEST_SENSE and cached SenseData. + * If yes, return cached SenseData. */ - mf = search_taskQ(0,SCpnt,MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK); - if (mf != NULL) { - return SCSI_ABORT_PENDING; + if (SCpnt->cmnd[0] == REQUEST_SENSE) { + u8 *dest = NULL; + int sz; + + if (pTarget && (pTarget->tflags & MPT_TARGET_FLAGS_VALID_SENSE)) { + pTarget->tflags &= ~MPT_TARGET_FLAGS_VALID_SENSE; //sjr-moved-here + if (!SCpnt->use_sg) { + dest = SCpnt->request_buffer; + } else { + struct scatterlist *sg = (struct scatterlist *) SCpnt->request_buffer; + if (sg) + dest = (u8 *)(ulong)sg_dma_address(sg); + } + + if (dest) { + sz = MIN (SCSI_STD_SENSE_BYTES, SCpnt->request_bufflen); + memcpy(dest, pTarget->sense, sz); + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0) + SCpnt->resid = SCpnt->request_bufflen - sz; +#endif + SCpnt->result = 0; + SCpnt->scsi_done(SCpnt); + + //sjr-moved-up//pTarget->tflags &= ~MPT_TARGET_FLAGS_VALID_SENSE; + + return 0; + } + } } - if ((mf = mpt_get_msg_frame(ScsiTaskCtx, hd->ioc->id)) == NULL) { -/* SCpnt->result = DID_SOFT_ERROR << 16; */ - SCpnt->result = STS_BUSY; - SCpnt->scsi_done(SCpnt); - return SCSI_ABORT_BUSY; + if (hd->resetPending) { + /* Prevent new commands from being issued + * while reloading the FW. + */ + did_errcode = 1; + goto did_error; } /* - * Add ourselves to (end of) mpt_scsih_taskQ. - * Check to see if our _bh is running. If NOT, schedule it. + * Put together a MPT SCSI request... */ - dslprintk((KERN_INFO MYNAM ": spinlock#2\n")); - spin_lock_irqsave(&mpt_scsih_taskQ_lock, flags); - Q_ADD_TAIL(&mpt_scsih_taskQ, &mf->u.frame.linkage, MPT_FRAME_HDR); - mpt_scsih_taskQ_cnt++; - /* Yikes - linkage! */ -/* SCpnt->host_scribble = (unsigned char *)mf; */ - mf->u.frame.linkage.arg1 = MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK; - mf->u.frame.linkage.argp1 = SCpnt; - if (! mpt_scsih_taskQ_bh_active) { - mpt_scsih_taskQ_bh_active = 1; - /* - * Oh how cute, no alloc/free/mgmt needed if we use - * (bottom/unused portion of) MPT request frame. - */ - ptaskfoo = (struct tq_struct *) ((u8*)mf + hd->ioc->req_sz - sizeof(*ptaskfoo)); - ptaskfoo->sync = 0; - ptaskfoo->routine = mptscsih_taskmgmt_bh; - ptaskfoo->data = SCpnt; - - SCHEDULE_TASK(ptaskfoo); + if ((mf = mpt_get_msg_frame(ScsiDoneCtx, hd->ioc->id)) == NULL) { + dprintk((MYIOC_s_WARN_FMT "QueueCmd, no msg frames!!\n", + hd->ioc->name)); + did_errcode = 2; + goto did_error; } - spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags); - - return SCSI_ABORT_PENDING; -} -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** - * mptscsih_old_reset - Perform a SCSI BUS_RESET! - * @SCpnt: Pointer to Scsi_Cmnd structure, IO which reset is due to - * @reset_flags: (not used?) - * - * (linux Scsi_Host_Template.reset routine) - * - * Returns SCSI_RESET_{SUCCESS,PUNT,PENDING}. - */ -int -mptscsih_old_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags) -{ - MPT_SCSI_HOST *hd; - MPT_FRAME_HDR *mf; - struct tq_struct *ptaskfoo; - unsigned long flags; + pScsiReq = (SCSIIORequest_t *) mf; - printk(KERN_WARNING MYNAM ": Scheduling _BUS_RESET (=%p)\n", SCpnt); - printk(KERN_WARNING MYNAM ": IOs outstanding = %d\n", atomic_read(&queue_depth)); + my_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); - if ((hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata) == NULL) { - SCpnt->result = DID_RESET << 16; - SCpnt->scsi_done(SCpnt); - return SCSI_RESET_SUCCESS; - } + ADD_INDEX_LOG(my_idx); /* - * Check to see if there's already a BUS_RESET queued for this guy. + * The scsi layer should be handling this stuff + * (In 2.3.x it does -DaveM) */ - mf = search_taskQ(0,SCpnt,MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS); - if (mf != NULL) { - return SCSI_RESET_PENDING; - } - if ((mf = mpt_get_msg_frame(ScsiTaskCtx, hd->ioc->id)) == NULL) { -/* SCpnt->result = DID_SOFT_ERROR << 16; */ - SCpnt->result = STS_BUSY; - SCpnt->scsi_done(SCpnt); - return SCSI_RESET_PUNT; + /* BUG FIX! 19991030 -sralston + * TUR's being issued with scsictl=0x02000000 (DATA_IN)! + * Seems we may receive a buffer (datalen>0) even when there + * will be no data transfer! GRRRRR... + */ + datadir = mptscsih_io_direction(SCpnt); + if (datadir < 0) { + datalen = SCpnt->request_bufflen; + scsidir = MPI_SCSIIO_CONTROL_READ; /* DATA IN (host<--ioc<--dev) */ + } else if (datadir > 0) { + datalen = SCpnt->request_bufflen; + scsidir = MPI_SCSIIO_CONTROL_WRITE; /* DATA OUT (host-->ioc-->dev) */ + } else { + datalen = 0; + scsidir = MPI_SCSIIO_CONTROL_NODATATRANSFER; } - /* - * Add ourselves to (end of) mpt_scsih_taskQ. - * Check to see if our _bh is running. If NOT, schedule it. + /* Default to untagged. Once a target structure has been allocated, + * use the Inquiry data to determine if device supports tagged. */ - dslprintk((KERN_INFO MYNAM ": spinlock#3\n")); - spin_lock_irqsave(&mpt_scsih_taskQ_lock, flags); - Q_ADD_TAIL(&mpt_scsih_taskQ, &mf->u.frame.linkage, MPT_FRAME_HDR); - mpt_scsih_taskQ_cnt++; - /* Yikes - linkage! */ -/* SCpnt->host_scribble = (unsigned char *)mf; */ - mf->u.frame.linkage.arg1 = MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS; - mf->u.frame.linkage.argp1 = SCpnt; - if (! mpt_scsih_taskQ_bh_active) { - mpt_scsih_taskQ_bh_active = 1; + qtag = MPI_SCSIIO_CONTROL_UNTAGGED; + if (pTarget && (pTarget->tflags & MPT_TARGET_FLAGS_Q_YES) + && (SCpnt->device->tagged_supported)) { /* - * Oh how cute, no alloc/free/mgmt needed if we use - * (bottom/unused portion of) MPT request frame. + * Some drives are too stupid to handle fairness issues + * with tagged queueing. We throw in the odd ordered + * tag to stop them starving themselves. */ - ptaskfoo = (struct tq_struct *) ((u8*)mf + hd->ioc->req_sz - sizeof(*ptaskfoo)); - ptaskfoo->sync = 0; - ptaskfoo->routine = mptscsih_taskmgmt_bh; - ptaskfoo->data = SCpnt; - - SCHEDULE_TASK(ptaskfoo); + if ((jiffies - hd->qtag_tick) > (5*HZ)) { + qtag = MPI_SCSIIO_CONTROL_ORDEREDQ; + hd->qtag_tick = jiffies; + } + else + qtag = MPI_SCSIIO_CONTROL_SIMPLEQ; } - spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags); + scsictl = scsidir | qtag; - return SCSI_RESET_PENDING; -} + /* Use the above information to set up the message frame + */ + pScsiReq->TargetID = target; + pScsiReq->Bus = hd->port; + pScsiReq->ChainOffset = 0; + pScsiReq->Function = MPI_FUNCTION_SCSI_IO_REQUEST; + pScsiReq->CDBLength = SCpnt->cmd_len; + pScsiReq->SenseBufferLength = MPT_SENSE_BUFFER_SIZE; + pScsiReq->Reserved = 0; + pScsiReq->MsgFlags = MPT_SCSIIO_MSG_FLAGS; + pScsiReq->LUN[0] = 0; + pScsiReq->LUN[1] = lun; + pScsiReq->LUN[2] = 0; + pScsiReq->LUN[3] = 0; + pScsiReq->LUN[4] = 0; + pScsiReq->LUN[5] = 0; + pScsiReq->LUN[6] = 0; + pScsiReq->LUN[7] = 0; + pScsiReq->Control = cpu_to_le32(scsictl); -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* - * mptscsih_taskmgmt_bh - SCSI task mgmt bottom half handler - * @sc: (unused) - * - * This routine (thread) is active whenever there are any outstanding - * SCSI task management requests for a SCSI host adapter. - * IMPORTANT! This routine is scheduled therefore should never be - * running in ISR context. i.e., it's safe to sleep here. - */ -void -mptscsih_taskmgmt_bh(void *sc) -{ - Scsi_Cmnd *SCpnt; - MPT_FRAME_HDR *mf; - SCSITaskMgmt_t *pScsiTm; - MPT_SCSI_HOST *hd; - u32 ctx2abort = 0; - int i; - unsigned long flags; - u8 task_type; + /* + * Write SCSI CDB into the message + */ + cmd_len = SCpnt->cmd_len; + for (ii=0; ii < cmd_len; ii++) + pScsiReq->CDB[ii] = SCpnt->cmnd[ii]; + for (ii=cmd_len; ii < 16; ii++) + pScsiReq->CDB[ii] = 0; - dslprintk((KERN_INFO MYNAM ": spinlock#4\n")); - spin_lock_irqsave(&mpt_scsih_taskQ_lock, flags); - mpt_scsih_taskQ_bh_active = 1; - spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags); + /* DataLength */ + pScsiReq->DataLength = cpu_to_le32(datalen); - while (1) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ/4); + /* SenseBuffer low address */ + pScsiReq->SenseBufferLowAddr = cpu_to_le32(hd->ioc->sense_buf_low_dma + + (my_idx * MPT_SENSE_BUFFER_ALLOC)); - /* - * We MUST remove item from taskQ *before* we format the - * frame as a SCSITaskMgmt request and send it down to the IOC. + /* Now add the SG list + * Always have a SGE even if null length. + */ + rc = SUCCESS; + if (datalen == 0) { + /* Add a NULL SGE */ + mptscsih_AddNullSGE(pScsiReq); + } else { + /* Add a 32 or 64 bit SGE */ + rc = mptscsih_Add32BitSGE(hd, SCpnt, pScsiReq, my_idx); + } + + + if (rc == SUCCESS) { + hd->ScsiLookup[my_idx] = SCpnt; + SCpnt->host_scribble = NULL; + +#ifdef DROP_TEST + numTotCmds++; + /* If the IOC number and target match, increment + * counter. If counter matches DROP_THIS, do not + * issue command to FW to force a reset. + * Save the MF pointer so we can free resources + * when task mgmt completes. */ - dslprintk((KERN_INFO MYNAM ": spinlock#5\n")); - spin_lock_irqsave(&mpt_scsih_taskQ_lock, flags); - if (Q_IS_EMPTY(&mpt_scsih_taskQ)) { - spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags); - break; - } - mf = mpt_scsih_taskQ.head; - Q_DEL_ITEM(&mf->u.frame.linkage); - mpt_scsih_taskQ_cnt--; - mpt_scsih_active_taskmgmt_mf = mf; - spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags); - - SCpnt = (Scsi_Cmnd*)mf->u.frame.linkage.argp1; - if (SCpnt == NULL) { - printk(KERN_ERR MYNAM ": ERROR - TaskMgmt has NULL SCpnt! (%p:%p)\n", mf, SCpnt); - continue; - } - hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata; - pScsiTm = (SCSITaskMgmt_t *) mf; + if ((hd->ioc->id == DROP_IOC) && (target == DROP_TARGET)) { + dropCounter++; - for (i = 0; i < 8; i++) { - pScsiTm->LUN[i] = 0; - } + if (dropCounter == DROP_THIS_CMD) { + dropCounter = 0; - task_type = mf->u.frame.linkage.arg1; - if (task_type == MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK) { - printk(KERN_WARNING MYNAM ": Attempting _ABORT SCSI IO! (mf=%p:sc=%p)\n", - mf, SCpnt); - - /* Most important! Set TaskMsgContext to SCpnt's MsgContext! - * (the IO to be ABORT'd) - * - * NOTE: Since we do not byteswap MsgContext, we do not - * swap it here either. It is an opaque cookie to - * the controller, so it does not matter. -DaveM - */ - ctx2abort = SCPNT_TO_MSGCTX(SCpnt); - if (ctx2abort == -1) { - printk(KERN_ERR MYNAM ": ERROR - ScsiLookup fail(#1) for SCpnt=%p\n", SCpnt); - SCpnt->result = DID_SOFT_ERROR << 16; - spin_lock_irqsave(&io_request_lock, flags); - SCpnt->scsi_done(SCpnt); - spin_unlock_irqrestore(&io_request_lock, flags); - mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf); - continue; + /* If global is set, then we are already + * doing something - so keep issuing commands. + */ + if (dropMfPtr == NULL) { + dropTestNum++; + dropMfPtr = mf; + atomic_inc(&queue_depth); + printk(MYIOC_s_INFO_FMT + "Dropped SCSI cmd (%p)\n", + hd->ioc->name, SCpnt); + printk("mf (%p) req (%4x) tot cmds (%d)\n", + mf, my_idx, numTotCmds); + + return 0; + } } - pScsiTm->LUN[1] = SCpnt->lun; } - else if (task_type == MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS) - { - printk(KERN_WARNING MYNAM ": Attempting _BUS_RESET! (against SCSI IO mf=%p:sc=%p)\n", mf, SCpnt); - } -#if 0 - else if (task_type == MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET) {} - else if (task_type == MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET) {} #endif - printk(KERN_WARNING MYNAM ": IOs outstanding = %d\n", atomic_read(&queue_depth)); + /* SCSI specific processing */ + issueCmd = 1; + if (hd->is_spi) { + int dvStatus = hd->ioc->spi_data.dvStatus[target]; + + if (dvStatus || hd->ioc->spi_data.forceDv) { + + /* Write SDP1 on 1st I/O to this target */ + if (dvStatus & MPT_SCSICFG_NEGOTIATE) { + mptscsih_writeSDP1(hd, 0, target, hd->negoNvram); + dvStatus &= ~MPT_SCSICFG_NEGOTIATE; + hd->ioc->spi_data.dvStatus[target] = dvStatus; + } - pScsiTm->TargetID = SCpnt->target; - pScsiTm->Bus = hd->port; - pScsiTm->ChainOffset = 0; - pScsiTm->Function = MPI_FUNCTION_SCSI_TASK_MGMT; +#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION + if ((dvStatus & MPT_SCSICFG_NEED_DV) || hd->ioc->spi_data.forceDv) { + unsigned long lflags; + /* Schedule DV if necessary */ + spin_lock_irqsave(&dvtaskQ_lock, lflags); + if (!dvtaskQ_active) { + dvtaskQ_active = 1; + mptscsih_dvTask.sync = 0; + mptscsih_dvTask.routine = mptscsih_domainValidation; + mptscsih_dvTask.data = (void *) hd; - pScsiTm->Reserved = 0; - pScsiTm->TaskType = task_type; - pScsiTm->Reserved1 = 0; - pScsiTm->MsgFlags = 0; + SCHEDULE_TASK(&mptscsih_dvTask); + } + hd->ioc->spi_data.forceDv = 0; + spin_unlock_irqrestore(&dvtaskQ_lock, lflags); + } - for (i = 0; i < 7; i++) - pScsiTm->Reserved2[i] = 0; + /* Trying to do DV to this target, extend timeout. + * Wait to issue intil flag is clear + */ + if (dvStatus & MPT_SCSICFG_DV_PENDING) { + mod_timer(&SCpnt->eh_timeout, jiffies + 40 * HZ); + issueCmd = 0; + } +#endif + } + } - dprintk((KERN_INFO MYNAM ":DbG: ctx2abort = %08x\n", ctx2abort)); - pScsiTm->TaskMsgContext = ctx2abort; + if (issueCmd) { + mptscsih_put_msgframe(ScsiDoneCtx, hd->ioc->id, mf); + dmfprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (%p)\n", + hd->ioc->name, SCpnt)); + } else { + ddvtprintk((MYIOC_s_INFO_FMT "Pending SCSI cmd (%p)\n", + hd->ioc->name, SCpnt)); + /* Place this command on the pendingQ if possible */ + spin_lock_irqsave(&hd->freedoneQlock, flags); + if (!Q_IS_EMPTY(&hd->freeQ)) { + buffer = hd->freeQ.head; + Q_DEL_ITEM(buffer); - /* Control: No data direction, set task mgmt bit? */ + /* Save the mf pointer + */ + buffer->argp = (void *)mf; - /* - * As of MPI v0.10 this request can NOT be sent (normally) - * via FIFOs. So we can't: - * mpt_put_msg_frame(ScsiTaskCtx, hd->ioc->id, mf); - * SCSITaskMgmt requests MUST be sent ONLY via - * Doorbell/handshake now. :-( - */ - if ((i = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id, - sizeof(SCSITaskMgmt_t), (u32*) mf)) - != 0) { - printk(KERN_WARNING MYNAM ": WARNING[1] - IOC error (%d) processing TaskMgmt request (mf=%p:sc=%p)\n", i, mf, SCpnt); - SCpnt->result = DID_SOFT_ERROR << 16; - spin_lock_irqsave(&io_request_lock, flags); - SCpnt->scsi_done(SCpnt); - spin_unlock_irqrestore(&io_request_lock, flags); - mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf); - } else { - /* Spin-Wait for TaskMgmt complete!!! */ - while (mpt_scsih_active_taskmgmt_mf != NULL) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ/4); + /* Add to the pendingQ + */ + Q_ADD_TAIL(&hd->pendingQ.head, buffer, MPT_DONE_Q); + spin_unlock_irqrestore(&hd->freedoneQlock, flags); + } else { + spin_unlock_irqrestore(&hd->freedoneQlock, flags); + SCpnt->result = (DID_BUS_BUSY << 16); + SCpnt->scsi_done(SCpnt); } } + } else { + mptscsih_freeChainBuffers(hd, my_idx); + mpt_free_msg_frame(ScsiDoneCtx, hd->ioc->id, mf); + did_errcode = 3; + goto did_error; } - dslprintk((KERN_INFO MYNAM ": spinlock#6\n")); - spin_lock_irqsave(&mpt_scsih_taskQ_lock, flags); - mpt_scsih_taskQ_bh_active = 0; - spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags); + return 0; - return; -} +did_error: + dprintk((MYIOC_s_WARN_FMT "_qcmd did_errcode=%d (sc=%p)\n", + hd->ioc->name, did_errcode, SCpnt)); + /* Just wish OS to issue a retry */ + SCpnt->result = (DID_BUS_BUSY << 16); + spin_lock_irqsave(&hd->freedoneQlock, flags); + if (!Q_IS_EMPTY(&hd->freeQ)) { + buffer = hd->freeQ.head; + Q_DEL_ITEM(buffer); -#endif /* } */ + /* Set the Scsi_Cmnd pointer + */ + buffer->argp = (void *)SCpnt; + + /* Add to the doneQ + */ + Q_ADD_TAIL(&hd->doneQ.head, buffer, MPT_DONE_Q); + spin_unlock_irqrestore(&hd->freedoneQlock, flags); + } else { + spin_unlock_irqrestore(&hd->freedoneQlock, flags); + SCpnt->scsi_done(SCpnt); + } + + return 0; +} /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** - * mptscsih_taskmgmt_complete - Callback routine, gets registered to - * Fusion MPT base driver - * @ioc: Pointer to MPT_ADAPTER structure - * @mf: Pointer to SCSI task mgmt request frame - * @r: Pointer to SCSI task mgmt reply frame - * - * This routine is called from mptbase.c::mpt_interrupt() at the completion - * of any SCSI task management request. - * This routine is registered with the MPT (base) driver at driver - * load/init time via the mpt_register() API call. +/* + * mptscsih_Add32BitSGE - Add a 32Bit SGE (plus chain buffers) to the + * SCSIIORequest_t Message Frame. + * @hd: Pointer to MPT_SCSI_HOST structure + * @SCpnt: Pointer to Scsi_Cmnd structure + * @pReq: Pointer to SCSIIORequest_t structure * - * Returns 1 indicating alloc'd request frame ptr should be freed. + * Returns ... */ static int -mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r) +mptscsih_Add32BitSGE(MPT_SCSI_HOST *hd, Scsi_Cmnd *SCpnt, + SCSIIORequest_t *pReq, int req_idx) { - SCSITaskMgmtReply_t *pScsiTmReply; - SCSITaskMgmt_t *pScsiTmReq; - u8 tmType; -#ifndef MPT_SCSI_USE_NEW_EH - unsigned long flags; -#endif + MptSge_t *psge; + MptChain_t *chainSge; + struct scatterlist *sg; + int frm_sz; + int sges_left, sg_done; + int chain_idx = MPT_HOST_NO_CHAIN; + int sgeOffset; + int numSgeSlots, numSgeThisFrame; + u32 sgflags, sgdir, len, thisxfer = 0; + int offset; + int newIndex; + int ii; + dma_addr_t v2; + + sgdir = le32_to_cpu(pReq->Control) & MPI_SCSIIO_CONTROL_DATADIRECTION_MASK; + if (sgdir == MPI_SCSIIO_CONTROL_WRITE) { + sgdir = MPT_TRANSFER_HOST_TO_IOC; + } else { + sgdir = MPT_TRANSFER_IOC_TO_HOST; + } - dprintk((KERN_INFO MYNAM ": SCSI TaskMgmt completed mf=%p, r=%p\n", - mf, r)); + psge = (MptSge_t *) &pReq->SGL; + frm_sz = hd->ioc->req_sz; -#ifndef MPT_SCSI_USE_NEW_EH - dslprintk((KERN_INFO MYNAM ": spinlock#7\n")); - spin_lock_irqsave(&mpt_scsih_taskQ_lock, flags); - /* It better be the active one! */ - if (mf != mpt_scsih_active_taskmgmt_mf) { - printk(KERN_ERR MYNAM ": ERROR! Non-active TaskMgmt (=%p) completed!\n", mf); - mpt_scsih_active_taskmgmt_mf = NULL; - spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags); - return 1; + /* Map the data portion, if any. + * sges_left = 0 if no data transfer. + */ + sges_left = SCpnt->use_sg; + if (SCpnt->use_sg) { + sges_left = pci_map_sg(hd->ioc->pcidev, + (struct scatterlist *) SCpnt->request_buffer, + SCpnt->use_sg, + scsi_to_pci_dma_dir(SCpnt->sc_data_direction)); + } else if (SCpnt->request_bufflen) { + dma_addr_t buf_dma_addr; + scPrivate *my_priv; + + buf_dma_addr = pci_map_single(hd->ioc->pcidev, + SCpnt->request_buffer, + SCpnt->request_bufflen, + scsi_to_pci_dma_dir(SCpnt->sc_data_direction)); + + /* We hide it here for later unmap. */ + my_priv = (scPrivate *) &SCpnt->SCp; + my_priv->p1 = (void *)(ulong) buf_dma_addr; + + dsgprintk((MYIOC_s_INFO_FMT "SG: non-SG for %p, len=%d\n", + hd->ioc->name, SCpnt, SCpnt->request_bufflen)); + + /* 0xD1000000 = LAST | EOB | SIMPLE | EOL */ + psge->FlagsLength = cpu_to_le32( + 0xD1000000|sgdir|SCpnt->request_bufflen); + cpu_to_leXX(buf_dma_addr, psge->Address); + + return SUCCESS; } -#ifdef MPT_DEBUG - if ((mf == NULL) || - (mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth))) { - printk(KERN_ERR MYNAM ": ERROR! NULL or BAD TaskMgmt ptr (=%p)!\n", mf); - mpt_scsih_active_taskmgmt_mf = NULL; - spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags); - return 1; + /* Handle the SG case. + */ + sg = (struct scatterlist *) SCpnt->request_buffer; + sg_done = 0; + sgeOffset = sizeof(SCSIIORequest_t) - sizeof(SGE_IO_UNION); + chainSge = NULL; + + /* Prior to entering this loop - the following must be set + * current MF: sgeOffset (bytes) + * chainSge (Null if original MF is not a chain buffer) + * sg_done (num SGE done for this MF) + */ + +nextSGEset: + numSgeSlots = ((frm_sz - sgeOffset) / sizeof(MptSge_t)); + numSgeThisFrame = (sges_left < numSgeSlots) ? sges_left : numSgeSlots; + + sgflags = MPT_SGE_FLAGS_SIMPLE_ELEMENT | MPT_SGE_FLAGS_ADDRESSING | sgdir; + + /* Get first (num - 1) SG elements + * Skip any SG entries with a length of 0 + * NOTE: at finish, sg and psge pointed to NEXT data/location positions + */ + for (ii=0; ii < (numSgeThisFrame-1); ii++) { + thisxfer = sg_dma_len(sg); + if (thisxfer == 0) { + sg ++; /* Get next SG element from the OS */ + sg_done++; + continue; + } + + len += thisxfer; + psge->FlagsLength = cpu_to_le32( sgflags | thisxfer ); + v2 = sg_dma_address(sg); + cpu_to_leXX(v2, psge->Address); + + sg++; /* Get next SG element from the OS */ + psge++; /* Point to next SG location in this MF */ + sgeOffset += sizeof(MptSge_t); + sg_done++; } -#endif - spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags); -#endif - if (r != NULL) { - pScsiTmReply = (SCSITaskMgmtReply_t*)r; - pScsiTmReq = (SCSITaskMgmt_t*)mf; + if (numSgeThisFrame == sges_left) { + /* Add last element, end of buffer and end of list flags. + */ + sgflags |= MPT_SGE_FLAGS_LAST_ELEMENT | + MPT_SGE_FLAGS_END_OF_BUFFER | + MPT_SGE_FLAGS_ADDRESSING | + MPT_SGE_FLAGS_END_OF_LIST; - /* Figure out if this was ABORT_TASK, TARGET_RESET, or BUS_RESET! */ - tmType = pScsiTmReq->TaskType; + /* Add last SGE and set termination flags. + * Note: Last SGE may have a length of 0 - which should be ok. + */ + thisxfer = sg_dma_len(sg); + len += thisxfer; + + psge->FlagsLength = cpu_to_le32( sgflags | thisxfer ); + v2 = sg_dma_address(sg); + cpu_to_leXX(v2, psge->Address); + + sg_done++; + + if (chainSge) { + /* The current buffer is a chain buffer, + * but there is not another one. + * Update the chain element + * Offset and Length fields. + */ + chainSge->NextChainOffset = 0; + sgeOffset += sizeof(MptSge_t); + chainSge->Length = cpu_to_le16(sgeOffset); + } else { + /* The current buffer is the original MF + * and there is no Chain buffer. + */ + pReq->ChainOffset = 0; + } + } else { + /* At least one chain buffer is needed. + * Complete the first MF + * - last SGE element, set the LastElement bit + * - set ChainOffset (words) for orig MF + * (OR finish previous MF chain buffer) + * - update MFStructPtr ChainIndex + * - Populate chain element + * Also + * Loop until done. + */ - dprintk((KERN_INFO MYNAM ": TaskType = %d\n", tmType)); - dprintk((KERN_INFO MYNAM ": TerminationCount = %d\n", - le32_to_cpu(pScsiTmReply->TerminationCount))); + dsgprintk((MYIOC_s_INFO_FMT "SG: Chain Required! sg done %d\n", + hd->ioc->name, sg_done)); - /* Error? (anything non-zero?) */ - if (*(u32 *)&pScsiTmReply->Reserved2[0]) { - dprintk((KERN_INFO MYNAM ": SCSI TaskMgmt (%d) - Oops!\n", tmType)); - dprintk((KERN_INFO MYNAM ": IOCStatus = %04xh\n", - le16_to_cpu(pScsiTmReply->IOCStatus))); - dprintk((KERN_INFO MYNAM ": IOCLogInfo = %08xh\n", - le32_to_cpu(pScsiTmReply->IOCLogInfo))); + /* Set LAST_ELEMENT flag for last non-chain element + * in the buffer. Since psge points at the NEXT + * SGE element, go back one SGE element, update the flags + * and reset the pointer. (Note: sgflags & thisxfer are already + * set properly). + */ + if (sg_done) { + psge--; + sgflags = le32_to_cpu (psge->FlagsLength); + sgflags |= MPT_SGE_FLAGS_LAST_ELEMENT; + psge->FlagsLength = cpu_to_le32( sgflags ); + psge++; + } + + if (chainSge) { + /* The current buffer is a chain buffer. + * chainSge points to the previous Chain Element. + * Update its chain element Offset and Length (must + * include chain element size) fields. + * Old chain element is now complete. + */ + chainSge->NextChainOffset = (u8) (sgeOffset >> 2); + sgeOffset += sizeof(MptSge_t); + chainSge->Length = cpu_to_le16(sgeOffset); } else { - dprintk((KERN_INFO MYNAM ": SCSI TaskMgmt (%d) SUCCESS!\n", tmType)); + /* The original MF buffer requires a chain buffer - + * set the offset. + * Last element in this MF is a chain element. + */ + pReq->ChainOffset = (u8) (sgeOffset >> 2); } - } -#ifndef MPT_SCSI_USE_NEW_EH - /* - * Signal to _bh thread that we finished. - */ - dslprintk((KERN_INFO MYNAM ": spinlock#8\n")); - spin_lock_irqsave(&mpt_scsih_taskQ_lock, flags); - mpt_scsih_active_taskmgmt_mf = NULL; - spin_unlock_irqrestore(&mpt_scsih_taskQ_lock, flags); -#endif + sges_left -= sg_done; - return 1; + + /* NOTE: psge points to the beginning of the chain element + * in current buffer. Get a chain buffer. + */ + if ((mptscsih_getFreeChainBuffer(hd, &newIndex)) == FAILED) + return FAILED; + + /* Update the tracking arrays. + * If chainSge == NULL, update ReqToChain, else ChainToChain + */ + if (chainSge) { + hd->ChainToChain[chain_idx] = newIndex; + } else { + hd->ReqToChain[req_idx] = newIndex; + } + chain_idx = newIndex; + offset = hd->ioc->req_sz * chain_idx; + + /* Populate the chainSGE for the current buffer. + * - Set chain buffer pointer to psge and fill + * out the Address and Flags fields. + */ + chainSge = (MptChain_t *) psge; + chainSge->Flags = MPI_SGE_FLAGS_CHAIN_ELEMENT; + cpu_to_leXX ((hd->ChainBufferDMA + offset), chainSge->Address); + + dsgprintk((KERN_INFO " Current buff @ %p (index 0x%x)", + psge, req_idx)); + + /* Start the SGE for the next buffer + */ + psge = (MptSge_t *) (hd->ChainBuffer + offset); + sgeOffset = 0; + sg_done = 0; + + dsgprintk((KERN_INFO " Chain buff @ %p (index 0x%x)\n", + psge, chain_idx)); + + /* Start the SGE for the next buffer + */ + + goto nextSGEset; + } + + return SUCCESS; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* - * This is anyones guess quite frankly. + * mptscsih_AddNullSGE - Add a NULL SGE to the SCSIIORequest_t + * Message Frame. + * @pReq: Pointer to SCSIIORequest_t structure */ - -int -mptscsih_bios_param(Disk * disk, kdev_t dev, int *ip) +static void +mptscsih_AddNullSGE(SCSIIORequest_t *pReq) { - int size; + MptSge_t *psge; - size = disk->capacity; - ip[0] = 64; /* heads */ - ip[1] = 32; /* sectors */ - if ((ip[2] = size >> 11) > 1024) { /* cylinders, test for big disk */ - ip[0] = 255; /* heads */ - ip[1] = 63; /* sectors */ - ip[2] = size / (255 * 63); /* cylinders */ - } - return 0; + psge = (MptSge_t *) &pReq->SGL; + psge->FlagsLength = cpu_to_le32(MPT_SGE_FLAGS_SSIMPLE_READ | 0); + + cpu_to_leXX( (dma_addr_t) -1, psge->Address); + + return; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* - * Private routines... - */ -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* 19991030 -sralston - * Return absolute SCSI data direction: - * 1 = _DATA_OUT - * 0 = _DIR_NONE - * -1 = _DATA_IN + * mptscsih_getFreeChainBuffes - Function to get a free chain + * from the MPT_SCSI_HOST FreeChainQ. + * @hd: Pointer to the MPT_SCSI_HOST instance + * @req_idx: Index of the SCSI IO request frame. (output) + * + * return SUCCESS or FAILED */ static int -mptscsih_io_direction(Scsi_Cmnd *cmd) +mptscsih_getFreeChainBuffer(MPT_SCSI_HOST *hd, int *retIndex) { - switch (cmd->cmnd[0]) { - /* _DATA_OUT commands */ - case WRITE_6: case WRITE_10: case WRITE_12: - case WRITE_LONG: case WRITE_SAME: case WRITE_BUFFER: - case WRITE_VERIFY: case WRITE_VERIFY_12: - case COMPARE: case COPY: case COPY_VERIFY: - case SEARCH_EQUAL: case SEARCH_HIGH: case SEARCH_LOW: - case SEARCH_EQUAL_12: case SEARCH_HIGH_12: case SEARCH_LOW_12: - case MODE_SELECT: case MODE_SELECT_10: case LOG_SELECT: - case SEND_DIAGNOSTIC: case CHANGE_DEFINITION: case UPDATE_BLOCK: - case SET_WINDOW: case MEDIUM_SCAN: case SEND_VOLUME_TAG: - case REASSIGN_BLOCKS: - case PERSISTENT_RESERVE_OUT: - case 0xea: - return 1; + MPT_FRAME_HDR *chainBuf = NULL; + unsigned long flags; + int rc = FAILED; + int chain_idx = MPT_HOST_NO_CHAIN; - /* No data transfer commands */ - case SEEK_6: case SEEK_10: - case RESERVE: case RELEASE: - case TEST_UNIT_READY: - case START_STOP: - case ALLOW_MEDIUM_REMOVAL: - return 0; + //spin_lock_irqsave(&hd->FreeChainQlock, flags); + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + if (!Q_IS_EMPTY(&hd->FreeChainQ)) { - /* Conditional data transfer commands */ - case FORMAT_UNIT: - if (cmd->cmnd[1] & 0x10) /* FmtData (data out phase)? */ - return 1; - else - return 0; + int offset; - case VERIFY: - if (cmd->cmnd[1] & 0x02) /* VERIFY:BYTCHK (data out phase)? */ - return 1; - else - return 0; + chainBuf = hd->FreeChainQ.head; + Q_DEL_ITEM(&chainBuf->u.frame.linkage); + offset = (u8 *)chainBuf - (u8 *)hd->ChainBuffer; + chain_idx = offset / hd->ioc->req_sz; + rc = SUCCESS; + } + //spin_unlock_irqrestore(&hd->FreeChainQlock, flags); + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); - case RESERVE_10: - if (cmd->cmnd[1] & 0x03) /* RESERSE:{LongID|Extent} (data out phase)? */ - return 1; - else - return 0; -#if 0 - case REZERO_UNIT: /* (or REWIND) */ - case SPACE: - case ERASE: case ERASE_10: - case SYNCHRONIZE_CACHE: - case LOCK_UNLOCK_CACHE: -#endif + *retIndex = chain_idx; - /* Must be data _IN! */ - default: - return -1; - } + dsgprintk((MYIOC_s_INFO_FMT "getFreeChainBuffer (index %d), got buf=%p\n", + hd->ioc->name, *retIndex, chainBuf)); + + return rc; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mptscsih_freeChainBuffers - Function to free chain buffers associated + * with a SCSI IO request + * @hd: Pointer to the MPT_SCSI_HOST instance + * @req_idx: Index of the SCSI IO request frame. + * + * Called if SG chain buffer allocation fails and mptscsih callbacks. + * No return. + */ static void -copy_sense_data(Scsi_Cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply) +mptscsih_freeChainBuffers(MPT_SCSI_HOST *hd, int req_idx) { - MPT_SCSI_DEV *mpt_sdev = NULL; - u32 sense_count = le32_to_cpu(pScsiReply->SenseCount); - char devFoo[32]; - IO_Info_t thisIo; - - if (sc && sc->device) - mpt_sdev = (MPT_SCSI_DEV*) sc->device->hostdata; - - if (sense_count) { - u8 *sense_data; - int req_index; + MPT_FRAME_HDR *chain = NULL; + unsigned long flags; + int chain_idx; + int next; - /* Copy the sense received into the scsi command block. */ - req_index = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); - sense_data = ((u8 *)hd->ioc->sense_buf_pool + (req_index * 256)); - memcpy(sc->sense_buffer, sense_data, SNS_LEN(sc)); - /* Cache SenseData for this SCSI device! */ - if (mpt_sdev) { - memcpy(mpt_sdev->CachedSense.data, sense_data, sense_count); - mpt_sdev->sense_sz = sense_count; - } - } else { - dprintk((KERN_INFO MYNAM ": Hmmm... SenseData len=0! (?)\n")); - } + /* Get the first chain index and reset + * tracker state. + */ + chain_idx = hd->ReqToChain[req_idx]; + hd->ReqToChain[req_idx] = MPT_HOST_NO_CHAIN; + while (chain_idx != MPT_HOST_NO_CHAIN) { - thisIo.cdbPtr = sc->cmnd; - thisIo.sensePtr = sc->sense_buffer; - thisIo.SCSIStatus = pScsiReply->SCSIStatus; - thisIo.DoDisplay = 1; - sprintf(devFoo, "ioc%d,scsi%d:%d", hd->ioc->id, sc->target, sc->lun); - thisIo.DevIDStr = devFoo; -/* fubar */ - thisIo.dataPtr = NULL; - thisIo.inqPtr = NULL; - if (sc->device) { - thisIo.inqPtr = sc->device->vendor-8; /* FIXME!!! */ - } - (void) mpt_ScsiHost_ErrorReport(&thisIo); + /* Save the next chain buffer index */ + next = hd->ChainToChain[chain_idx]; - return; -} + /* Free this chain buffer and reset + * tracker + */ + hd->ChainToChain[chain_idx] = MPT_HOST_NO_CHAIN; -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -static u32 -SCPNT_TO_MSGCTX(Scsi_Cmnd *sc) -{ - MPT_SCSI_HOST *hd; - MPT_FRAME_HDR *mf; - int i; + chain = (MPT_FRAME_HDR *) (hd->ChainBuffer + + (chain_idx * hd->ioc->req_sz)); + //spin_lock_irqsave(&hd->FreeChainQlock, flags); + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + Q_ADD_TAIL(&hd->FreeChainQ.head, + &chain->u.frame.linkage, MPT_FRAME_HDR); + //spin_unlock_irqrestore(&hd->FreeChainQlock, flags); + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); - hd = (MPT_SCSI_HOST *) sc->host->hostdata; + dmfprintk((MYIOC_s_INFO_FMT "FreeChainBuffers (index %d)\n", + hd->ioc->name, chain_idx)); - for (i = 0; i < hd->ioc->req_depth; i++) { - if (hd->ScsiLookup[i] == sc) { - mf = MPT_INDEX_2_MFPTR(hd->ioc, i); - return mf->u.frame.hwhdr.msgctxu.MsgContext; - } + /* handle next */ + chain_idx = next; } - - return -1; + return; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * Reset Handling + */ -/* see mptscsih.h */ +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mptscsih_TMHandler - Generic handler for SCSI Task Management. + * Fall through to mpt_HardResetHandler if: not operational, too many + * failed TM requests or handshake failure. + * + * @ioc: Pointer to MPT_ADAPTER structure + * @type: Task Management type + * @target: Logical Target ID for reset (if appropriate) + * @lun: Logical Unit for reset (if appropriate) + * @ctx2abort: Context for the task to be aborted (if appropriate) + * @sleepFlag: If set, use udelay instead of schedule in handshake code. + * + * Remark: Currently invoked from a non-interrupt thread (_bh). + * + * Remark: With old EH code, at most 1 SCSI TaskMgmt function per IOC + * will be active. + * + * Returns 0 for SUCCESS or -1 if FAILED. + */ +static int +mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort, int sleepFlag) +{ + MPT_ADAPTER *ioc = NULL; + int rc = -1; + int doTask = 1; + u32 ioc_raw_state; + unsigned long flags; -#ifdef MPT_SCSIHOST_NEED_ENTRY_EXIT_HOOKUPS - static Scsi_Host_Template driver_template = MPT_SCSIHOST; -# include "../../scsi/scsi_module.c" + /* If FW is being reloaded currently, return success to + * the calling function. + */ + if (!hd) + return 0; + + ioc = hd->ioc; + dtmprintk((MYIOC_s_INFO_FMT "TMHandler Entered!\n", ioc->name)); + + if (ioc == NULL) { + printk(KERN_ERR MYNAM " TMHandler" " NULL ioc!\n"); + return 0; + } + + // SJR - CHECKME - Can we avoid this here? + // (mpt_HardResetHandler has this check...) + spin_lock_irqsave(&ioc->diagLock, flags); + if ((ioc->diagPending) || (ioc->alt_ioc && ioc->alt_ioc->diagPending)) { + spin_unlock_irqrestore(&ioc->diagLock, flags); + return 0; + } + spin_unlock_irqrestore(&ioc->diagLock, flags); + + /* Do not do a Task Management if there are + * too many failed TMs on this adapter. + */ + if (hd->numTMrequests > MPT_HOST_TOO_MANY_TM) + doTask = 0; + + /* Is operational? + */ + ioc_raw_state = mpt_GetIocState(hd->ioc, 0); + +#ifdef MPT_DEBUG_RESET + if ((ioc_raw_state & MPI_IOC_STATE_MASK) != MPI_IOC_STATE_OPERATIONAL) { + printk(MYIOC_s_WARN_FMT + "TM Handler: IOC Not operational! state 0x%x Calling HardResetHandler\n", + hd->ioc->name, ioc_raw_state); + } #endif + if (doTask && ((ioc_raw_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_OPERATIONAL) + && !(ioc_raw_state & MPI_DOORBELL_ACTIVE)) { + + /* Isse the Task Mgmt request. + */ + rc = mptscsih_IssueTaskMgmt(hd, type, target, lun, ctx2abort, sleepFlag); + if (rc) { + printk(MYIOC_s_INFO_FMT "Issue of TaskMgmt failed!\n", hd->ioc->name); + } else { + printk(MYIOC_s_INFO_FMT "Issue of TaskMgmt Successful!\n", hd->ioc->name); + } + } +#ifdef DROP_TEST + numTMrequested++; + if (numTMrequested > 5) { + rc = 0; /* set to 1 to force a hard reset */ + numTMrequested = 0; + } +#endif + + if (rc) { + dtmprintk((MYIOC_s_INFO_FMT "Falling through to HardReset! \n", + hd->ioc->name)); + rc = mpt_HardResetHandler(hd->ioc, sleepFlag); + } + + dtmprintk((MYIOC_s_INFO_FMT "TMHandler rc = %d!\n", hd->ioc->name, rc)); +#ifndef MPT_SCSI_USE_NEW_EH + dtmprintk((MYIOC_s_INFO_FMT "TMHandler: _bh_handler state (%d) taskQ count (%d)\n", + ioc->name, mytaskQ_bh_active, hd->taskQcnt)); +#endif + + return rc; +} + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mptscsih_IssueTaskMgmt - Generic send Task Management function. + * @hd: Pointer to MPT_SCSI_HOST structure + * @type: Task Management type + * @target: Logical Target ID for reset (if appropriate) + * @lun: Logical Unit for reset (if appropriate) + * @ctx2abort: Context for the task to be aborted (if appropriate) + * @sleepFlag: If set, use udelay instead of schedule in handshake code. + * + * Remark: _HardResetHandler can be invoked from an interrupt thread (timer) + * or a non-interrupt thread. In the former, must not call schedule(). + * + * Not all fields are meaningfull for all task types. + * + * Returns 0 for SUCCESS, -999 for "no msg frames", + * else other non-zero value returned. + */ static int -mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) +mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort, int sleepFlag) { - dprintk((KERN_INFO MYNAM ": IOC %s_reset routed to SCSI host driver!\n", - reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post")); + MPT_FRAME_HDR *mf; + SCSITaskMgmt_t *pScsiTm; + int ii; + int retval = 0; - if (reset_phase == MPT_IOC_PRE_RESET) { - /* FIXME! Do pre-reset cleanup */ - } else { - /* FIXME! Do post-reset cleanup */ + /* Return Fail to calling function if no message frames available. + */ + if ((mf = mpt_get_msg_frame(ScsiTaskCtx, hd->ioc->id)) == NULL) { + dtmprintk((MYIOC_s_WARN_FMT "IssueTaskMgmt, no msg frames!!\n", + hd->ioc->name)); + //return FAILED; + return -999; } + dtmprintk((MYIOC_s_INFO_FMT "IssueTaskMgmt request @ %p\n", + hd->ioc->name, mf)); - return 1; /* currently means nothing really */ + /* Format the Request + */ + pScsiTm = (SCSITaskMgmt_t *) mf; + pScsiTm->TargetID = target; + pScsiTm->Bus = hd->port; + pScsiTm->ChainOffset = 0; + pScsiTm->Function = MPI_FUNCTION_SCSI_TASK_MGMT; + + pScsiTm->Reserved = 0; + pScsiTm->TaskType = type; + pScsiTm->Reserved1 = 0; + pScsiTm->MsgFlags = 0; + + for (ii= 0; ii < 8; ii++) { + pScsiTm->LUN[ii] = 0; + } + pScsiTm->LUN[1] = lun; + + for (ii=0; ii < 7; ii++) + pScsiTm->Reserved2[ii] = 0; + + pScsiTm->TaskMsgContext = ctx2abort; + dtmprintk((MYIOC_s_INFO_FMT "IssueTaskMgmt, ctx2abort (0x%08x), type (%d)\n", + hd->ioc->name, ctx2abort, type)); + + /* MPI v0.10 requires SCSITaskMgmt requests be sent via Doorbell/handshake + mpt_put_msg_frame(hd->ioc->id, mf); + * Save the MF pointer in case the request times out. + */ + hd->tmPtr = mf; + hd->numTMrequests++; + hd->TMtimer.expires = jiffies + HZ*20; /* 20 seconds */ + add_timer(&hd->TMtimer); + + if ((retval = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id, + sizeof(SCSITaskMgmt_t), (u32*)pScsiTm, sleepFlag)) + != 0) { + dtmprintk((MYIOC_s_WARN_FMT "_send_handshake FAILED!" + " (hd %p, ioc %p, mf %p) \n", hd->ioc->name, hd, hd->ioc, mf)); + hd->numTMrequests--; + hd->tmPtr = NULL; + del_timer(&hd->TMtimer); + mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf); + return ii; + } + + return retval; } +#ifdef MPT_SCSI_USE_NEW_EH /* { */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -static int -mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) +/** + * mptscsih_abort - Abort linux Scsi_Cmnd routine, new_eh variant + * @SCpnt: Pointer to Scsi_Cmnd structure, IO to be aborted + * + * (linux Scsi_Host_Template.eh_abort_handler routine) + * + * Returns SUCCESS or FAILED. + */ +int +mptscsih_abort(Scsi_Cmnd * SCpnt) { - u8 event = le32_to_cpu(pEvReply->Event) & 0xFF; + MPT_SCSI_HOST *hd; + MPT_FRAME_HDR *mf; + unsigned long flags; + u32 ctx2abort; + int scpnt_idx; + u8 type; - dprintk((KERN_INFO MYNAM ": MPT event (=%02Xh) routed to SCSI host driver!\n", event)); + printk(KERN_WARNING MYNAM ": Attempting ABORT SCSI IO (=%p)\n", SCpnt); + printk(KERN_WARNING MYNAM ": IOs outstanding = %d\n", atomic_read(&queue_depth)); - switch (event) { - case MPI_EVENT_UNIT_ATTENTION: /* 03 */ - /* FIXME! */ - break; - case MPI_EVENT_IOC_BUS_RESET: /* 04 */ - /* FIXME! */ - break; - case MPI_EVENT_EXT_BUS_RESET: /* 05 */ - /* FIXME! */ - break; - case MPI_EVENT_LOGOUT: /* 09 */ - /* FIXME! */ - break; + if ((hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata) == NULL) { + SCpnt->result = DID_RESET << 16; + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->scsi_done(SCpnt); + spin_unlock_irqrestore(&io_request_lock, flags); + return SUCCESS; + } - /* - * CHECKME! Don't think we need to do - * anything for these, but... + /* Find this command + */ + if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(SCpnt)) < 0) { + /* Cmd not found in ScsiLookup. If found in + * doneQ, delete from Q. Do OS callback. */ - case MPI_EVENT_RESCAN: /* 06 */ - case MPI_EVENT_LINK_STATUS_CHANGE: /* 07 */ - case MPI_EVENT_LOOP_STATE_CHANGE: /* 08 */ - /* - * CHECKME! Falling thru... + search_doneQ_for_cmd(hd, SCpnt); + + SCpnt->result = DID_RESET << 16; + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->scsi_done(SCpnt); + spin_unlock_irqrestore(&io_request_lock, flags); + return SUCCESS; + } + + /* If this command is pended, then timeout/hang occurred + * during DV. Post command and flush pending Q + * and then following up with the reset request. + */ + if ((mf = mptscsih_search_pendingQ(hd, scpnt_idx)) != NULL) { + mptscsih_put_msgframe(ScsiDoneCtx, hd->ioc->id, mf); + post_pendingQ_commands(hd); + } + + /* Most important! Set TaskMsgContext to SCpnt's MsgContext! + * (the IO to be ABORT'd) + * + * NOTE: Since we do not byteswap MsgContext, we do not + * swap it here either. It is an opaque cookie to + * the controller, so it does not matter. -DaveM + */ + mf = MPT_INDEX_2_MFPTR(hd->ioc, scpnt_idx); + ctx2abort = mf->u.frame.hwhdr.msgctxu.MsgContext; + + /* This thread will not exit until tmPending is cleared + * FIXME - must ensure single threaded....DV conflict possible + */ + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + hd->tmPending = 1; + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + + if (hd->is_spi) + type = MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS; + else { + type = MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK; + hd->abortSCpnt = SCpnt; + printk(KERN_WARNING MYNAM ": Attempting ABORT SCSI IO! (sc=%p)\n", SCpnt); + } + + if (mptscsih_TMHandler(hd, type, + SCpnt->target, SCpnt->lun, ctx2abort, CAN_SLEEP) < 0) { + + /* The TM request failed and the subsequent FW-reload failed! + * Fatal error case. */ + printk(MYIOC_s_WARN_FMT "Error processing TaskMgmt request (sc=%p)\n", + hd->ioc->name, SCpnt); - case MPI_EVENT_NONE: /* 00 */ - case MPI_EVENT_LOG_DATA: /* 01 */ - case MPI_EVENT_STATE_CHANGE: /* 02 */ - case MPI_EVENT_EVENT_CHANGE: /* 0A */ - default: - dprintk((KERN_INFO MYNAM ": Ignoring event (=%02Xh)\n", event)); - break; + /* If command not found, do not do callback, + * just return failed. CHECKME + */ + if (hd->ScsiLookup[scpnt_idx] != NULL) { + //atomic_dec(&queue_depth); + SCpnt->result = STS_BUSY; + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->scsi_done(SCpnt); + spin_unlock_irqrestore(&io_request_lock, flags); + } + + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + hd->tmPending = 0; + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); } - return 1; /* currently means nothing really */ + + /* Spin on tmPending until we get the interrupt for this TM request. + */ + while (1) { + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + if (!hd->tmPending) { + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + break; + } + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ/4); + } + + return FAILED; } -#if 0 /* { */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* - * scsiherr.c - Fusion MPT SCSI Host driver error handling/reporting. +/** + * mptscsih_dev_reset - Perform a SCSI TARGET_RESET! new_eh variant + * @SCpnt: Pointer to Scsi_Cmnd structure, IO which reset is due to * - * drivers/message/fusion/scsiherr.c + * (linux Scsi_Host_Template.eh_dev_reset_handler routine) + * + * Returns SUCCESS or FAILED. */ +int +mptscsih_dev_reset(Scsi_Cmnd * SCpnt) +{ + MPT_SCSI_HOST *hd; + MPT_FRAME_HDR *mf; + unsigned long flags; + int scpnt_idx; + u8 type; -//extern const char **mpt_ScsiOpcodesPtr; /* needed by mptscsih.c */ -//extern ASCQ_Table_t *mpt_ASCQ_TablePtr; -//extern int mpt_ASCQ_TableSz; + printk(KERN_WARNING MYNAM ": Attempting _TARGET_RESET (%p)\n", SCpnt); + printk(KERN_WARNING MYNAM ": IOs outstanding = %d\n", atomic_read(&queue_depth)); -/* Lie! */ -#define MYNAM "mptscsih" + if ((hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata) == NULL) { + SCpnt->result = DID_RESET << 16; + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->scsi_done(SCpnt); + spin_unlock_irqrestore(&io_request_lock, flags); + return SUCCESS; + } -#endif /* } */ + /* Find this command + */ + if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(SCpnt)) < 0) { + /* Cmd not found in ScsiLookup. If found in + * doneQ, delete from Q. Do OS callback. + */ + search_doneQ_for_cmd(hd, SCpnt); -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* - * Private data... - */ -static ASCQ_Table_t *mptscsih_ASCQ_TablePtr; + SCpnt->result = DID_RESET << 16; + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->scsi_done(SCpnt); + spin_unlock_irqrestore(&io_request_lock, flags); + return SUCCESS; + } + + /* If this command is pended, then timeout/hang occurred + * during DV. Force bus reset by posting command to F/W + * and then following up with the reset request. + */ + if ((mf = mptscsih_search_pendingQ(hd, scpnt_idx)) != NULL) { + mptscsih_put_msgframe(ScsiDoneCtx, hd->ioc->id, mf); + post_pendingQ_commands(hd); + } + + /* This thread will not exit until tmPending is cleared + */ + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + hd->tmPending = 1; + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + + if (hd->is_spi) + type = MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS; + else { + type = MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET; + printk(KERN_WARNING MYNAM ": Attempting Target Reset! (sc=%p)\n", SCpnt); + } + + if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, + SCpnt->target, 0, 0, CAN_SLEEP) < 0) { + /* The TM request failed and the subsequent FW-reload failed! + * Fatal error case. + */ + printk(MYIOC_s_WARN_FMT "Error processing TaskMgmt request (sc=%p)\n", + hd->ioc->name, SCpnt); + + /* If command not found, do not do callback, + * just returned failed. CHECKME. + */ + if (hd->ScsiLookup[scpnt_idx] != NULL) { + //atomic_dec(&queue_depth); + SCpnt->result = STS_BUSY; + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->scsi_done(SCpnt); + spin_unlock_irqrestore(&io_request_lock, flags); + } + + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + hd->tmPending = 0; + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + } + + /* Spin on tmPending until we get the interrupt for this TM request. + */ + while (1) { + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + if (!hd->tmPending) { + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + break; + } + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ/4); + } + + //return SUCCESS; + return FAILED; +} /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* old symsense.c stuff... */ -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* - * Private data... - * To protect ourselves against those that would pass us bogus pointers +/** + * mptscsih_bus_reset - Perform a SCSI BUS_RESET! new_eh variant + * @SCpnt: Pointer to Scsi_Cmnd structure, IO which reset is due to + * + * (linux Scsi_Host_Template.eh_bus_reset_handler routine) + * + * Returns SUCCESS or FAILED. */ -static u8 dummyInqData[SCSI_STD_INQUIRY_BYTES] - = { 0x1F, 0x00, 0x00, 0x00, - 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static u8 dummySenseData[SCSI_STD_SENSE_BYTES] - = { 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 }; -static u8 dummyCDB[16] - = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static u8 dummyScsiData[16] - = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +int +mptscsih_bus_reset(Scsi_Cmnd * SCpnt) +{ + MPT_SCSI_HOST *hd; + MPT_FRAME_HDR *mf; + unsigned long flags; + int scpnt_idx; -#if 0 -static const char *PeripheralDeviceTypeString[32] = { - "Direct-access", /* 00h */ - "Sequential-access", /* 01h */ - "Printer", /* 02h */ - "Processor", /* 03h */ - /*"Write-Once-Read-Multiple",*/ /* 04h */ - "WORM", /* 04h */ - "CD-ROM", /* 05h */ - "Scanner", /* 06h */ - "Optical memory", /* 07h */ - "Media Changer", /* 08h */ - "Communications", /* 09h */ - "(Graphics arts pre-press)", /* 0Ah */ - "(Graphics arts pre-press)", /* 0Bh */ - "Array controller", /* 0Ch */ - "Enclosure services", /* 0Dh */ - "Simplified direct-access", /* 0Eh */ - "Reserved-0Fh", /* 0Fh */ - "Reserved-10h", /* 10h */ - "Reserved-11h", /* 11h */ - "Reserved-12h", /* 12h */ - "Reserved-13h", /* 13h */ - "Reserved-14h", /* 14h */ - "Reserved-15h", /* 15h */ - "Reserved-16h", /* 16h */ - "Reserved-17h", /* 17h */ - "Reserved-18h", /* 18h */ - "Reserved-19h", /* 19h */ - "Reserved-1Ah", /* 1Ah */ - "Reserved-1Bh", /* 1Bh */ - "Reserved-1Ch", /* 1Ch */ - "Reserved-1Dh", /* 1Dh */ - "Reserved-1Eh", /* 1Eh */ - "Unknown" /* 1Fh */ -}; -#endif + printk(KERN_WARNING MYNAM ": Attempting _BUS_RESET (%p)\n", SCpnt); + printk(KERN_WARNING MYNAM ": IOs outstanding = %d\n", atomic_read(&queue_depth)); -static char *ScsiStatusString[] = { - "GOOD", /* 00h */ - NULL, /* 01h */ - "CHECK CONDITION", /* 02h */ - NULL, /* 03h */ - "CONDITION MET", /* 04h */ - NULL, /* 05h */ - NULL, /* 06h */ - NULL, /* 07h */ - "BUSY", /* 08h */ - NULL, /* 09h */ - NULL, /* 0Ah */ - NULL, /* 0Bh */ - NULL, /* 0Ch */ - NULL, /* 0Dh */ - NULL, /* 0Eh */ - NULL, /* 0Fh */ - "INTERMEDIATE", /* 10h */ - NULL, /* 11h */ - NULL, /* 12h */ - NULL, /* 13h */ - "INTERMEDIATE-CONDITION MET", /* 14h */ - NULL, /* 15h */ - NULL, /* 16h */ - NULL, /* 17h */ - "RESERVATION CONFLICT", /* 18h */ - NULL, /* 19h */ - NULL, /* 1Ah */ - NULL, /* 1Bh */ - NULL, /* 1Ch */ - NULL, /* 1Dh */ - NULL, /* 1Eh */ - NULL, /* 1Fh */ - NULL, /* 20h */ - NULL, /* 21h */ - "COMMAND TERMINATED", /* 22h */ - NULL, /* 23h */ - NULL, /* 24h */ - NULL, /* 25h */ - NULL, /* 26h */ - NULL, /* 27h */ - "TASK SET FULL", /* 28h */ - NULL, /* 29h */ - NULL, /* 2Ah */ - NULL, /* 2Bh */ - NULL, /* 2Ch */ - NULL, /* 2Dh */ - NULL, /* 2Eh */ - NULL, /* 2Fh */ - "ACA ACTIVE", /* 30h */ - NULL -}; + if ((hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata) == NULL) { + SCpnt->result = DID_RESET << 16; + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->scsi_done(SCpnt); + spin_unlock_irqrestore(&io_request_lock, flags); + return SUCCESS; + } -static const char *ScsiCommonOpString[] = { - "TEST UNIT READY", /* 00h */ - "REZERO UNIT (REWIND)", /* 01h */ - NULL, /* 02h */ - "REQUEST_SENSE", /* 03h */ - "FORMAT UNIT (MEDIUM)", /* 04h */ - "READ BLOCK LIMITS", /* 05h */ - NULL, /* 06h */ - "REASSIGN BLOCKS", /* 07h */ - "READ(6)", /* 08h */ - NULL, /* 09h */ - "WRITE(6)", /* 0Ah */ - "SEEK(6)", /* 0Bh */ - NULL, /* 0Ch */ - NULL, /* 0Dh */ - NULL, /* 0Eh */ - "READ REVERSE", /* 0Fh */ - "WRITE_FILEMARKS", /* 10h */ - "SPACE(6)", /* 11h */ - "INQUIRY", /* 12h */ - NULL -}; + /* Find this command + */ + if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(SCpnt)) < 0) { + /* Cmd not found in ScsiLookup. If found in + * doneQ, delete from Q. Do OS callback. + */ + search_doneQ_for_cmd(hd, SCpnt); -static const char *SenseKeyString[] = { - "NO SENSE", /* 0h */ - "RECOVERED ERROR", /* 1h */ - "NOT READY", /* 2h */ - "MEDIUM ERROR", /* 3h */ - "HARDWARE ERROR", /* 4h */ - "ILLEGAL REQUEST", /* 5h */ - "UNIT ATTENTION", /* 6h */ - "DATA PROTECT", /* 7h */ - "BLANK CHECK", /* 8h */ - "VENDOR-SPECIFIC", /* 9h */ - "ABORTED COPY", /* Ah */ - "ABORTED COMMAND", /* Bh */ - "EQUAL (obsolete)", /* Ch */ - "VOLUME OVERFLOW", /* Dh */ - "MISCOMPARE", /* Eh */ - "RESERVED", /* Fh */ - NULL -}; + SCpnt->result = DID_RESET << 16; + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->scsi_done(SCpnt); + spin_unlock_irqrestore(&io_request_lock, flags); + return SUCCESS; + } -#define SPECIAL_ASCQ(c,q) \ - (((c) == 0x40 && (q) != 0x00) || ((c) == 0x4D) || ((c) == 0x70)) + /* If this command is pended, then timeout/hang occurred + * during DV. Force bus reset by posting command to F/W + * and then following up with the reset request. + */ + if ((mf = mptscsih_search_pendingQ(hd, scpnt_idx)) != NULL) { + mptscsih_put_msgframe(ScsiDoneCtx, hd->ioc->id, mf); + post_pendingQ_commands(hd); + } + + /* This thread will not exit until tmPending is cleared + */ + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + hd->tmPending = 1; + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + + if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS, + 0, 0, 0, CAN_SLEEP) < 0) { + + /* The TM request failed and the subsequent FW-reload failed! + * Fatal error case. + */ + printk(MYIOC_s_WARN_FMT "Error processing TaskMgmt request (sc=%p)\n", + hd->ioc->name, SCpnt); + + /* If command not found, do not do callback, + * just returned failed. CHECKME. + */ + if (hd->ScsiLookup[scpnt_idx] != NULL) { + //atomic_dec(&queue_depth); + SCpnt->result = STS_BUSY; + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->scsi_done(SCpnt); + spin_unlock_irqrestore(&io_request_lock, flags); + } + + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + hd->tmPending = 0; + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + + return FAILED; + } + + /* Spin on tmPending until we get the interrupt for this TM request. + */ + while (1) { + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + if (!hd->tmPending) { + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + break; + } + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ/4); + } + + return SUCCESS; +} #if 0 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* - * Sense_Key_Specific() - If Sense_Key_Specific_Valid bit is set, - * then print additional information via - * a call to SDMS_SystemAlert(). +/** + * mptscsih_host_reset - Perform a SCSI host adapter RESET! + * new_eh variant + * @SCpnt: Pointer to Scsi_Cmnd structure, IO which reset is due to * - * Return: nothing + * (linux Scsi_Host_Template.eh_host_reset_handler routine) + * + * Returns SUCCESS or FAILED. */ -static void Sense_Key_Specific(IO_Info_t *ioop, char *msg1) +int +mptscsih_host_reset(Scsi_Cmnd *SCpnt) { - u8 *sd; - u8 BadValue; - u8 SenseKey; - int Offset; - int len = strlen(msg1); + MPT_SCSI_HOST *hd; + MPT_FRAME_HDR *mf; - sd = ioop->sensePtr; - if (SD_Additional_Sense_Length(sd) < 8) - return; + printk(KERN_WARNING MYNAM ": Attempting HOST_RESET (%p)\n", SCpnt); + printk(KERN_WARNING MYNAM ": IOs outstanding = %d\n", atomic_read(&queue_depth)); - SenseKey = SD_Sense_Key(sd); + if ((hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata) == NULL) { + SCpnt->result = DID_RESET << 16; + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->scsi_done(SCpnt); + spin_unlock_irqrestore(&io_request_lock, flags); + return SUCCESS; + } + + /* If this command is pended, then timeout/hang occurred + * during DV. Force bus reset by posting command to F/W + * and then following up with the reset request. + */ + if ((mf = mptscsih_search_pendingQ(hd, scpnt_idx)) != NULL) { + mptscsih_put_msgframe(ScsiDoneCtx, hd->ioc->id, mf); + post_pendingQ_commands(hd); + } + + /* This thread will not exit until tmPending is cleared + */ + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + hd->tmPending = 1; + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + + if (mpt_HardResetHandler(hd->ioc, CAN_SLEEP) < 0) { + SCpnt->result = STS_BUSY; + spin_lock_irqsave(&io_request_lock, flags); // sjr-added + SCpnt->scsi_done(SCpnt); + spin_unlock_irqrestore(&io_request_lock, flags); // sjr-added + return FAILED; + } + + /* Spin on tmPending until we get the interrupt for this TM request. + */ + while (1) { + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + if (!hd->tmPending) { + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + break; + } + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ/4); + } + + return SUCCESS; +} +#endif + +#else /* MPT_SCSI old EH stuff... */ +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/** + * mptscsih_old_abort - Abort linux Scsi_Cmnd routine + * @SCpnt: Pointer to Scsi_Cmnd structure, IO to be aborted + * + * (linux Scsi_Host_Template.abort routine) + * + * Returns SCSI_ABORT_{SUCCESS,BUSY,PENDING}. + */ +int +mptscsih_old_abort(Scsi_Cmnd *SCpnt) +{ + MPT_SCSI_HOST *hd; + MPT_FRAME_HDR *mf; + struct tq_struct *ptaskfoo; + unsigned long flags; + int scpnt_idx; + + printk(KERN_WARNING MYNAM ": OldAbort scheduling ABORT SCSI IO (sc=%p)\n", SCpnt); + printk(KERN_WARNING " IOs outstanding = %d\n", atomic_read(&queue_depth)); + + if ((hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata) == NULL) { + printk(KERN_WARNING " WARNING - OldAbort, NULL hostdata ptr!!\n"); + SCpnt->result = DID_ERROR << 16; + SCpnt->scsi_done(SCpnt); + return SCSI_ABORT_NOT_RUNNING; + } + + if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(SCpnt)) < 0) { + /* Cmd not found in ScsiLookup. + * If found in doneQ, delete from Q. + * Do OS callback. + */ + search_doneQ_for_cmd(hd, SCpnt); + + SCpnt->result = DID_RESET << 16; + SCpnt->scsi_done(SCpnt); + return SCSI_ABORT_SUCCESS; + } else { + /* If this command is pended, then timeout/hang occurred + * during DV. Force bus reset by posting command to F/W + * and then following up with the reset request. + */ + if ((mf = mptscsih_search_pendingQ(hd, scpnt_idx)) != NULL) { + mptscsih_put_msgframe(ScsiDoneCtx, hd->ioc->id, mf); + post_pendingQ_commands(hd); + } + } + + /* + * Check to see if there's already an ABORT queued for this guy. + */ + mf = search_taskQ(0, SCpnt, hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK); + if (mf != NULL) { + dtmprintk((MYIOC_s_INFO_FMT "OldAbort:Abort Task PENDING cmd (%p) taskQ depth (%d)\n", + hd->ioc->name, SCpnt, hd->taskQcnt)); + return SCSI_ABORT_PENDING; + } + + // SJR - CHECKME - Can we avoid this here? + // (mpt_HardResetHandler has this check...) + /* If IOC is reloading FW, return PENDING. + */ + spin_lock_irqsave(&hd->ioc->diagLock, flags); + if (hd->ioc->diagPending) { + spin_unlock_irqrestore(&hd->ioc->diagLock, flags); + return SCSI_ABORT_PENDING; + } + spin_unlock_irqrestore(&hd->ioc->diagLock, flags); + + /* If there are no message frames what should we do? + */ + if ((mf = mpt_get_msg_frame(ScsiTaskCtx, hd->ioc->id)) == NULL) { + printk((KERN_WARNING " WARNING - OldAbort, no msg frames!!\n")); + /* We are out of message frames! + * Call the reset handler to do a FW reload. + */ + printk((KERN_WARNING " Reloading Firmware!!\n")); + if (mpt_HardResetHandler(hd->ioc, NO_SLEEP) < 0) { + printk((KERN_WARNING " Firmware Reload FAILED!!\n")); + } + return SCSI_ABORT_PENDING; + } + + /* + * Add ourselves to (end of) taskQ . + * Check to see if our _bh is running. If NOT, schedule it. + */ + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + Q_ADD_TAIL(&hd->taskQ, &mf->u.frame.linkage, MPT_FRAME_HDR); + hd->taskQcnt++; + atomic_inc(&mpt_taskQdepth); + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + + spin_lock_irqsave(&mytaskQ_lock, flags); + + /* Save the original SCpnt mf pointer + */ + SCpnt->host_scribble = (u8 *) MPT_INDEX_2_MFPTR (hd->ioc, scpnt_idx); + + /* For the time being, force bus reset on any abort + * requests for the 1030 FW. + */ + if (hd->is_spi) + mf->u.frame.linkage.arg1 = MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS; + else + mf->u.frame.linkage.arg1 = MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK; + + mf->u.frame.linkage.argp1 = SCpnt; + mf->u.frame.linkage.argp2 = (void *) hd; + + dtmprintk((MYIOC_s_INFO_FMT "OldAbort:_bh_handler state (%d) taskQ count (%d)\n", + hd->ioc->name, mytaskQ_bh_active, hd->taskQcnt)); + + if (! mytaskQ_bh_active) { + mytaskQ_bh_active = 1; + /* + * Oh how cute, no alloc/free/mgmt needed if we use + * (bottom/unused portion of) MPT request frame. + */ + ptaskfoo = (struct tq_struct *) &mptscsih_ptaskfoo; + ptaskfoo->sync = 0; + ptaskfoo->routine = mptscsih_taskmgmt_bh; + ptaskfoo->data = SCpnt; + + SCHEDULE_TASK(ptaskfoo); + } + spin_unlock_irqrestore(&mytaskQ_lock, flags); + + return SCSI_ABORT_PENDING; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/** + * mptscsih_old_reset - Perform a SCSI BUS_RESET! + * @SCpnt: Pointer to Scsi_Cmnd structure, IO which reset is due to + * @reset_flags: (not used?) + * + * (linux Scsi_Host_Template.reset routine) + * + * Returns SCSI_RESET_{SUCCESS,PUNT,PENDING}. + */ +int +mptscsih_old_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags) +{ + MPT_SCSI_HOST *hd; + MPT_FRAME_HDR *mf; + struct tq_struct *ptaskfoo; + unsigned long flags; + int scpnt_idx; + + printk(KERN_WARNING MYNAM ": OldReset scheduling BUS_RESET (sc=%p)\n", SCpnt); + printk(KERN_WARNING " IOs outstanding = %d\n", atomic_read(&queue_depth)); + + if ((hd = (MPT_SCSI_HOST *) SCpnt->host->hostdata) == NULL) { + SCpnt->result = DID_RESET << 16; + SCpnt->scsi_done(SCpnt); + return SCSI_RESET_SUCCESS; + } + + if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(SCpnt)) < 0) { + /* Cmd not found in ScsiLookup. + * If found in doneQ, delete from Q. + * Do OS callback. + */ + search_doneQ_for_cmd(hd, SCpnt); + + SCpnt->result = DID_RESET << 16; + SCpnt->scsi_done(SCpnt); + return SCSI_RESET_SUCCESS; + } else { + /* If this command is pended, then timeout/hang occurred + * during DV. Force bus reset by posting command to F/W + * and then following up with the reset request. + */ + if ((mf = mptscsih_search_pendingQ(hd, scpnt_idx)) != NULL) { + mptscsih_put_msgframe(ScsiDoneCtx, hd->ioc->id, mf); + post_pendingQ_commands(hd); + } + } + + /* + * Check to see if there's an ABORT_TASK queued for this guy. + * If so, delete. + */ + search_taskQ(1, SCpnt, hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK); + + /* + * Check to see if there's already a BUS_RESET queued for this guy. + */ + mf = search_taskQ(0, SCpnt, hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS); + if (mf != NULL) { + dtmprintk((MYIOC_s_INFO_FMT "OldReset:Reset Task PENDING cmd (%p) taskQ depth (%d)\n", + hd->ioc->name, SCpnt, hd->taskQcnt)); + return SCSI_RESET_PENDING; + } + + // SJR - CHECKME - Can we avoid this here? + // (mpt_HardResetHandler has this check...) + /* If IOC is reloading FW, return PENDING. + */ + spin_lock_irqsave(&hd->ioc->diagLock, flags); + if (hd->ioc->diagPending) { + spin_unlock_irqrestore(&hd->ioc->diagLock, flags); + return SCSI_RESET_PENDING; + } + spin_unlock_irqrestore(&hd->ioc->diagLock, flags); + + if ((mf = mpt_get_msg_frame(ScsiTaskCtx, hd->ioc->id)) == NULL) { + /* We are out of message frames! + * Call the reset handler to do a FW reload. + */ + printk((KERN_WARNING " Reloading Firmware!!\n")); + if (mpt_HardResetHandler(hd->ioc, NO_SLEEP) < 0) { + printk((KERN_WARNING " Firmware Reload FAILED!!\n")); + } + return SCSI_RESET_PENDING; + } + + /* + * Add ourselves to (end of) taskQ. + * Check to see if our _bh is running. If NOT, schedule it. + */ + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + Q_ADD_TAIL(&hd->taskQ, &mf->u.frame.linkage, MPT_FRAME_HDR); + hd->taskQcnt++; + atomic_inc(&mpt_taskQdepth); + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + + spin_lock_irqsave(&mytaskQ_lock, flags); + + /* Save the original SCpnt mf pointer + */ + SCpnt->host_scribble = (u8 *) MPT_INDEX_2_MFPTR (hd->ioc, scpnt_idx); + + mf->u.frame.linkage.arg1 = MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS; + mf->u.frame.linkage.argp1 = SCpnt; + mf->u.frame.linkage.argp2 = (void *) hd; + + dtmprintk((MYIOC_s_INFO_FMT "OldReset: _bh_handler state (%d) taskQ count (%d)\n", + hd->ioc->name, mytaskQ_bh_active, hd->taskQcnt)); + + if (! mytaskQ_bh_active) { + mytaskQ_bh_active = 1; + /* + * Oh how cute, no alloc/free/mgmt needed if we use + * (bottom/unused portion of) MPT request frame. + */ + ptaskfoo = (struct tq_struct *) &mptscsih_ptaskfoo; + ptaskfoo->sync = 0; + ptaskfoo->routine = mptscsih_taskmgmt_bh; + ptaskfoo->data = SCpnt; + + SCHEDULE_TASK(ptaskfoo); + } + spin_unlock_irqrestore(&mytaskQ_lock, flags); + return SCSI_RESET_PENDING; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mptscsih_taskmgmt_bh - SCSI task mgmt bottom half handler + * @sc: (unused) + * + * This routine (thread) is active whenever there are any outstanding + * SCSI task management requests for a SCSI host adapter. + * IMPORTANT! This routine is scheduled therefore should never be + * running in ISR context. i.e., it's safe to sleep here. + */ +void +mptscsih_taskmgmt_bh(void *sc) +{ + MPT_ADAPTER *ioc; + Scsi_Cmnd *SCpnt; + MPT_FRAME_HDR *mf = NULL; + MPT_SCSI_HOST *hd; + u32 ctx2abort = 0; + unsigned long flags; + int scpnt_idx; + int did; + u8 task_type; + + spin_lock_irqsave(&mytaskQ_lock, flags); + mytaskQ_bh_active = 1; + spin_unlock_irqrestore(&mytaskQ_lock, flags); + + do { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ/4); + did = 0; + + for (ioc = mpt_adapter_find_first(); ioc != NULL; ioc = mpt_adapter_find_next(ioc)) { + if (ioc->sh) { + hd = (MPT_SCSI_HOST *) ioc->sh->hostdata; + if (hd == NULL) { + printk(KERN_ERR MYNAM + ": ERROR - TaskMgmt NULL SCSI Host!" + "(ioc=%p, sh=%p hd=%p)\n", + ioc, ioc->sh, hd); + continue; + } + + spin_lock_irqsave(&ioc->FreeQlock, flags); + if (Q_IS_EMPTY(&hd->taskQ)) { + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + continue; + } + + /* If we ever find a non-empty queue, + * keep the handler alive + */ + did++; + + /* tmPending is SMP lock-protected */ + if (hd->tmPending || hd->tmPtr) { + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + continue; + } + hd->tmPending = 1; + + /* Process this request + */ + mf = hd->taskQ.head; + Q_DEL_ITEM(&mf->u.frame.linkage); + hd->taskQcnt--; + atomic_dec(&mpt_taskQdepth); + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + + SCpnt = (Scsi_Cmnd*)mf->u.frame.linkage.argp1; + if (SCpnt == NULL) { + printk(KERN_ERR MYNAM ": ERROR - TaskMgmt has NULL SCpnt! (mf=%p:sc=%p)\n", + mf, SCpnt); + mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf); + spin_lock_irqsave(&ioc->FreeQlock, flags); + hd->tmPending = 0; + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + continue; + } + + /* Get the ScsiLookup index pointer + * from the SC pointer. + */ + if (!SCpnt->host_scribble || ((MPT_SCSI_HOST *)SCpnt->host->hostdata != hd)) { + /* The command associated with the + * abort/reset request must have + * completed and this is a stale + * request. We are done. + * Free the current MF and continue. + */ + mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf); + spin_lock_irqsave(&ioc->FreeQlock, flags); + hd->tmPending = 0; + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + continue; + } + + scpnt_idx = MFPTR_2_MPT_INDEX(hd->ioc, SCpnt->host_scribble); + if (scpnt_idx != SCPNT_TO_LOOKUP_IDX(SCpnt)) { + /* Error! this should never happen!! + */ + mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf); + spin_lock_irqsave(&ioc->FreeQlock, flags); + hd->tmPending = 0; + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + continue; + } + + task_type = mf->u.frame.linkage.arg1; + ctx2abort = 0; + if (task_type == MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK) { + MPT_FRAME_HDR *SCpntMf; + + /* + * Most important! Set TaskMsgContext to SCpnt's MsgContext! + * (the IO to be ABORT'd) + * + * NOTE: Since we do not byteswap MsgContext, we do not + * swap it here either. It is an opaque cookie to + * the controller, so it does not matter. -DaveM + */ + SCpntMf = (MPT_FRAME_HDR *) SCpnt->host_scribble; + ctx2abort = SCpntMf->u.frame.hwhdr.msgctxu.MsgContext; + + hd->abortSCpnt = SCpnt; + printk(KERN_WARNING MYNAM ": Attempting ABORT SCSI IO! (mf=%p:sc=%p)\n", + mf, SCpnt); + } + + /* The TM handler will allocate a new mf, + * so free the current mf. + */ + mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf); + mf = NULL; + + if (mptscsih_TMHandler(hd, task_type, SCpnt->target, SCpnt->lun, ctx2abort, NO_SLEEP) < 0) { + + /* The TM request failed and the subsequent FW-reload failed! + * Fatal error case. + */ + printk(KERN_WARNING MYNAM + ": WARNING[1] - IOC error processing TaskMgmt request (sc=%p)\n", SCpnt); + + if (hd->ScsiLookup[scpnt_idx] != NULL) { + atomic_dec(&queue_depth); + SCpnt->result = DID_SOFT_ERROR << 16; + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->scsi_done(SCpnt); + spin_unlock_irqrestore(&io_request_lock, flags); + mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf); + } + spin_lock_irqsave(&ioc->FreeQlock, flags); + hd->tmPending = 0; + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + hd->abortSCpnt = NULL; + } + } + } + if (atomic_read(&mpt_taskQdepth) > 0) + did++; + + } while ( did ); + + spin_lock_irqsave(&mytaskQ_lock, flags); + mytaskQ_bh_active = 0; + spin_unlock_irqrestore(&mytaskQ_lock, flags); + + return; +} +#endif /* } */ + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/** + * mptscsih_taskmgmt_complete - Registered with Fusion MPT base driver + * @ioc: Pointer to MPT_ADAPTER structure + * @mf: Pointer to SCSI task mgmt request frame + * @mr: Pointer to SCSI task mgmt reply frame + * + * This routine is called from mptbase.c::mpt_interrupt() at the completion + * of any SCSI task management request. + * This routine is registered with the MPT (base) driver at driver + * load/init time via the mpt_register() API call. + * + * Returns 1 indicating alloc'd request frame ptr should be freed. + */ +static int +mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) +{ + SCSITaskMgmtReply_t *pScsiTmReply; + SCSITaskMgmt_t *pScsiTmReq; + MPT_SCSI_HOST *hd = NULL; + unsigned long flags; + u8 tmType = 0; + + dtmprintk((MYIOC_s_INFO_FMT "SCSI TaskMgmt completed (mf=%p,r=%p)\n", + ioc->name, mf, mr)); + if (ioc->sh) { + /* Depending on the thread, a timer is activated for + * the TM request. Delete this timer on completion of TM. + * Decrement count of outstanding TM requests. + */ + hd = (MPT_SCSI_HOST *)ioc->sh->hostdata; + if (hd->tmPtr) { + del_timer(&hd->TMtimer); + } + dtmprintk((MYIOC_s_INFO_FMT "taskQcnt (%d)\n", + ioc->name, hd->taskQcnt)); + } else { + dtmprintk((MYIOC_s_WARN_FMT "TaskMgmt Complete: NULL Scsi Host Ptr\n", + ioc->name)); + return 1; + } + + if (mr == NULL) { + dtmprintk((MYIOC_s_WARN_FMT "ERROR! TaskMgmt Reply: NULL Request %p\n", + ioc->name, mf)); + return 1; + } else { + pScsiTmReply = (SCSITaskMgmtReply_t*)mr; + pScsiTmReq = (SCSITaskMgmt_t*)mf; + + /* Figure out if this was ABORT_TASK, TARGET_RESET, or BUS_RESET! */ + tmType = pScsiTmReq->TaskType; + + dtmprintk((KERN_INFO " TaskType = %d, TerminationCount=%d\n", + tmType, le32_to_cpu(pScsiTmReply->TerminationCount))); + + /* Error? (anything non-zero?) */ + if (*(u32 *)&pScsiTmReply->Reserved2[0]) { + u16 iocstatus; + + iocstatus = le16_to_cpu(pScsiTmReply->IOCStatus) & MPI_IOCSTATUS_MASK; + dtmprintk((KERN_INFO " SCSI TaskMgmt (%d) - Oops!\n", tmType)); + dtmprintk((KERN_INFO " IOCStatus = %04xh\n", iocstatus)); + dtmprintk((KERN_INFO " IOCLogInfo = %08xh\n", + le32_to_cpu(pScsiTmReply->IOCLogInfo))); + + /* clear flags and continue. + */ + if (tmType == MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK) + hd->abortSCpnt = NULL; +#ifdef DROP_TEST + if (dropMfPtr) + dropTestBad++; +#endif + /* If an internal command is present + * or the TM failed - reload the FW. + * FC FW may respond FAILED to an ABORT + */ + if (tmType == MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS) { + if ((hd->cmdPtr) || + (iocstatus == MPI_IOCSTATUS_SCSI_TASK_MGMT_FAILED)) { + if (mpt_HardResetHandler(ioc, NO_SLEEP) < 0) { + printk((KERN_WARNING + " Firmware Reload FAILED!!\n")); + } + } + } + } else { + dtmprintk((KERN_INFO " SCSI TaskMgmt SUCCESS!\n")); + +#ifndef MPT_SCSI_USE_NEW_EH + if (tmType == MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS) { + /* clean taskQ - remove tasks associated with + * completed commands. + */ + clean_taskQ(hd); + } else if (tmType == MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK) { + /* If taskQ contains another request + * for this SCpnt, delete this request. + */ + search_taskQ_for_cmd(hd->abortSCpnt, hd); + } +#endif + hd->numTMrequests--; + hd->abortSCpnt = NULL; + flush_doneQ(hd); + +#ifdef DROP_TEST + if (dropMfPtr) + dropTestOK++; +#endif + } + } + +#ifdef DROP_TEST + { + Scsi_Cmnd *sc; + unsigned long flags; + u16 req_idx; + + /* Free resources for the drop test MF and chain buffers. + */ + if (dropMfPtr) { + req_idx = le16_to_cpu(dropMfPtr->u.frame.hwhdr.msgctxu.fld.req_idx); + sc = hd->ScsiLookup[req_idx]; + if (sc == NULL) { + printk(MYIOC_s_ERR_FMT + "Drop Test: NULL ScsiCmd ptr!\n", + ioc->name); + } else { + sc->host_scribble = NULL; + if (tmType == MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS) + sc->result = DID_RESET << 16; + else + sc->result = DID_ABORT << 16; + + hd->ScsiLookup[req_idx] = NULL; + atomic_dec(&queue_depth); + spin_lock_irqsave(&io_request_lock, flags); + sc->scsi_done(sc); /* Issue callback */ + spin_unlock_irqrestore(&io_request_lock, flags); + + mptscsih_freeChainBuffers(hd, req_idx); + mpt_free_msg_frame(ScsiDoneCtx, ioc->id, dropMfPtr); + + printk(MYIOC_s_INFO_FMT + "Free'd Dropped cmd (%p)\n", + hd->ioc->name, sc); + printk(MYIOC_s_INFO_FMT + "mf (%p) reqidx (%4x)\n", + hd->ioc->name, dropMfPtr, + req_idx); + printk(MYIOC_s_INFO_FMT + "Num Tot (%d) Good (%d) Bad (%d) \n", + hd->ioc->name, dropTestNum, + dropTestOK, dropTestBad); + } + dropMfPtr = NULL; + } + } +#endif + +#ifndef MPT_SCSI_USE_NEW_EH + /* + * Signal to _bh thread that we finished. + * This IOC can now process another TM command. + */ + dtmprintk((MYIOC_s_INFO_FMT "taskmgmt_complete: (=%p) done! Num Failed(%d) Task Count (%d)\n", + ioc->name, mf, hd->numTMrequests, hd->taskQcnt)); +#endif + hd->tmPtr = NULL; + spin_lock_irqsave(&ioc->FreeQlock, flags); + hd->tmPending = 0; + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + + return 1; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * This is anyones guess quite frankly. + */ + +int +mptscsih_bios_param(Disk * disk, kdev_t dev, int *ip) +{ + int size; + + size = disk->capacity; + ip[0] = 64; /* heads */ + ip[1] = 32; /* sectors */ + if ((ip[2] = size >> 11) > 1024) { /* cylinders, test for big disk */ + ip[0] = 255; /* heads */ + ip[1] = 63; /* sectors */ + ip[2] = size / (255 * 63); /* cylinders */ + } + return 0; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * OS entry point to adjust the queue_depths on a per-device basis. + * Called once per device the bus scan. Use it to force the queue_depth + * member to 1 if a device does not support Q tags. + */ +void +mptscsih_select_queue_depths(struct Scsi_Host *sh, Scsi_Device *sdList) +{ + struct scsi_device *device; + VirtDevice *pTarget; + MPT_SCSI_HOST *hd; + int ii, max; + + for (device = sdList; device; device = device->next) { + + if (device->host != sh) + continue; + + hd = (MPT_SCSI_HOST *) sh->hostdata; + if (!hd) + continue; + + if (hd->Targets) { + if (hd->is_spi) + max = MPT_MAX_SCSI_DEVICES; + else + max = MPT_MAX_FC_DEVICES; + + for (ii=0; ii < max; ii++) { + pTarget = hd->Targets[ii]; + if (pTarget && !(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)) { + device->queue_depth = 1; + } + } + } + } +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * Private routines... + */ +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* 19991030 -sralston + * Return absolute SCSI data direction: + * 1 = _DATA_OUT + * 0 = _DIR_NONE + * -1 = _DATA_IN + */ +static int +mptscsih_io_direction(Scsi_Cmnd *cmd) +{ + switch (cmd->cmnd[0]) { + /* _DATA_OUT commands */ + case WRITE_6: case WRITE_10: case WRITE_12: + case WRITE_LONG: case WRITE_SAME: case WRITE_BUFFER: + case WRITE_VERIFY: case WRITE_VERIFY_12: + case COMPARE: case COPY: case COPY_VERIFY: + case SEARCH_EQUAL: case SEARCH_HIGH: case SEARCH_LOW: + case SEARCH_EQUAL_12: case SEARCH_HIGH_12: case SEARCH_LOW_12: + case MODE_SELECT: case MODE_SELECT_10: case LOG_SELECT: + case SEND_DIAGNOSTIC: case CHANGE_DEFINITION: case UPDATE_BLOCK: + case SET_WINDOW: case MEDIUM_SCAN: case SEND_VOLUME_TAG: + case REASSIGN_BLOCKS: + case PERSISTENT_RESERVE_OUT: + case 0xea: + case 0xa3: + return 1; + + /* No data transfer commands */ + case SEEK_6: case SEEK_10: + case RESERVE: case RELEASE: + case TEST_UNIT_READY: + case START_STOP: + case ALLOW_MEDIUM_REMOVAL: + return 0; + + /* Conditional data transfer commands */ + case FORMAT_UNIT: + if (cmd->cmnd[1] & 0x10) /* FmtData (data out phase)? */ + return 1; + else + return 0; + + case VERIFY: + if (cmd->cmnd[1] & 0x02) /* VERIFY:BYTCHK (data out phase)? */ + return 1; + else + return 0; + + case RESERVE_10: + if (cmd->cmnd[1] & 0x03) /* RESERVE:{LongID|Extent} (data out phase)? */ + return 1; + else + return 0; + +#if 0 + case REZERO_UNIT: /* (or REWIND) */ + case SPACE: + case ERASE: case ERASE_10: + case SYNCHRONIZE_CACHE: + case LOCK_UNLOCK_CACHE: +#endif + + /* Must be data _IN! */ + default: + return -1; + } +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* Utility function to copy sense data from the scsi_cmnd buffer + * to the FC and SCSI target structures. + * + */ +static void +copy_sense_data(Scsi_Cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply) +{ + VirtDevice *target; + SCSIIORequest_t *pReq; + u32 sense_count = le32_to_cpu(pScsiReply->SenseCount); + int index; + char devFoo[96]; + IO_Info_t thisIo; + + /* Get target structure + */ + pReq = (SCSIIORequest_t *) mf; + index = (int) pReq->TargetID; + target = hd->Targets[index]; + if (hd->is_multipath && sc->device->hostdata) + target = (VirtDevice *) sc->device->hostdata; + + if (sense_count) { + u8 *sense_data; + int req_index; + + /* Copy the sense received into the scsi command block. */ + req_index = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); + sense_data = ((u8 *)hd->ioc->sense_buf_pool + (req_index * MPT_SENSE_BUFFER_ALLOC)); + memcpy(sc->sense_buffer, sense_data, SNS_LEN(sc)); + + /* save sense data to the target device + */ + if (target) { + int sz; + + sz = MIN(pReq->SenseBufferLength, sense_count); + if (sz > SCSI_STD_SENSE_BYTES) + sz = SCSI_STD_SENSE_BYTES; + memcpy(target->sense, sense_data, sz); + target->tflags |= MPT_TARGET_FLAGS_VALID_SENSE; + } + + /* Log SMART data (asc = 0x5D, non-IM case only) if required. + */ + if ((hd->ioc->events) && (hd->ioc->eventTypes & (1 << MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE))) { + if ((sense_data[12] == 0x5D) && (target->raidVolume == 0)) { + int idx; + MPT_ADAPTER *ioc = hd->ioc; + + idx = ioc->eventContext % ioc->eventLogSize; + ioc->events[idx].event = MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE; + ioc->events[idx].eventContext = ioc->eventContext; + + ioc->events[idx].data[0] = (pReq->LUN[1] << 24) || + (MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA << 16) || + (pReq->Bus << 8) || pReq->TargetID; + + ioc->events[idx].data[1] = (sense_data[13] << 8) || sense_data[12]; + + ioc->eventContext++; + } + } + + /* Print an error report for the user. + */ + thisIo.cdbPtr = sc->cmnd; + thisIo.sensePtr = sc->sense_buffer; + thisIo.SCSIStatus = pScsiReply->SCSIStatus; + thisIo.DoDisplay = 1; + if (hd->is_multipath) + sprintf(devFoo, "%d:%d:%d \"%s\"", + hd->ioc->id, + pReq->TargetID, + pReq->LUN[1], + target->dev_vol_name); + else + sprintf(devFoo, "%d:%d:%d", hd->ioc->id, sc->target, sc->lun); + thisIo.DevIDStr = devFoo; +/* fubar */ + thisIo.dataPtr = NULL; + thisIo.inqPtr = NULL; + if (sc->device) { + thisIo.inqPtr = sc->device->vendor-8; /* FIXME!!! */ + } + (void) mpt_ScsiHost_ErrorReport(&thisIo); + + } else { + dprintk((MYIOC_s_INFO_FMT "Hmmm... SenseData len=0! (?)\n", + hd->ioc->name)); + } + + return; +} + +static u32 +SCPNT_TO_LOOKUP_IDX(Scsi_Cmnd *sc) +{ + MPT_SCSI_HOST *hd; + int i; + + hd = (MPT_SCSI_HOST *) sc->host->hostdata; + + for (i = 0; i < hd->ioc->req_depth; i++) { + if (hd->ScsiLookup[i] == sc) { + return i; + } + } + + return -1; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ + +/* see mptscsih.h */ + +#ifdef MPT_SCSIHOST_NEED_ENTRY_EXIT_HOOKUPS + static Scsi_Host_Template driver_template = MPT_SCSIHOST; +# include "../../scsi/scsi_module.c" +#endif + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* Search the pendingQ for a command with specific index. + * If found, delete and return mf pointer + * If not found, return NULL + */ +static MPT_FRAME_HDR * +mptscsih_search_pendingQ(MPT_SCSI_HOST *hd, int scpnt_idx) +{ + unsigned long flags; + MPT_DONE_Q *buffer; + MPT_FRAME_HDR *mf = NULL; + MPT_FRAME_HDR *cmdMfPtr = NULL; + + ddvtprintk((MYIOC_s_INFO_FMT ": search_pendingQ called...", hd->ioc->name)); + cmdMfPtr = MPT_INDEX_2_MFPTR(hd->ioc, scpnt_idx); + spin_lock_irqsave(&hd->freedoneQlock, flags); + if (!Q_IS_EMPTY(&hd->pendingQ)) { + buffer = hd->pendingQ.head; + do { + mf = (MPT_FRAME_HDR *) buffer->argp; + if (mf == cmdMfPtr) { + Q_DEL_ITEM(buffer); + + /* clear the arg pointer + */ + buffer->argp = NULL; + + /* Add to the freeQ + */ + Q_ADD_TAIL(&hd->freeQ.head, buffer, MPT_DONE_Q); + break; + } + mf = NULL; + } while ((buffer = buffer->forw) != (MPT_DONE_Q *) &hd->pendingQ); + } + spin_unlock_irqrestore(&hd->freedoneQlock, flags); + ddvtprintk((" ...return %p\n", mf)); + return mf; +} + +/* Post all commands on the pendingQ to the FW. + * Lock Q when deleting/adding members + * Lock io_request_lock for OS callback. + */ +static void +post_pendingQ_commands(MPT_SCSI_HOST *hd) +{ + MPT_FRAME_HDR *mf; + MPT_DONE_Q *buffer; + unsigned long flags; + + /* Flush the pendingQ. + */ + ddvtprintk((MYIOC_s_INFO_FMT ": post_pendingQ_commands called\n", hd->ioc->name)); + while (1) { + spin_lock_irqsave(&hd->freedoneQlock, flags); + if (Q_IS_EMPTY(&hd->pendingQ)) { + spin_unlock_irqrestore(&hd->freedoneQlock, flags); + break; + } + + buffer = hd->pendingQ.head; + /* Delete from Q + */ + Q_DEL_ITEM(buffer); + + mf = (MPT_FRAME_HDR *) buffer->argp; + if (!mf) { + /* This should never happen */ + printk(MYIOC_s_WARN_FMT "post_pendingQ_commands: mf %p\n", hd->ioc->name, mf); + spin_unlock_irqrestore(&hd->freedoneQlock, flags); + continue; + } + + mptscsih_put_msgframe(ScsiDoneCtx, hd->ioc->id, mf); + ddvtprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (mf=%p)\n", + hd->ioc->name, mf)); + + buffer->argp = NULL; + + /* Add to the freeQ + */ + Q_ADD_TAIL(&hd->freeQ.head, buffer, MPT_DONE_Q); + spin_unlock_irqrestore(&hd->freedoneQlock, flags); + } + + return; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +static int +mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) +{ + MPT_SCSI_HOST *hd = NULL; + unsigned long flags; + + dtmprintk((KERN_WARNING MYNAM + ": IOC %s_reset routed to SCSI host driver!\n", + reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post")); + + /* If a FW reload request arrives after base installed but + * before all scsi hosts have been attached, then an alt_ioc + * may have a NULL sh pointer. + */ + if ((ioc->sh == NULL) || (ioc->sh->hostdata == NULL)) + return 0; + else + hd = (MPT_SCSI_HOST *) ioc->sh->hostdata; + + if (reset_phase == MPT_IOC_PRE_RESET) { + dtmprintk((MYIOC_s_WARN_FMT "Do Pre-Diag Reset handling\n", + ioc->name)); + + /* Clean Up: + * 1. Set Hard Reset Pending Flag + * All new commands go to doneQ + */ + hd->resetPending = 1; + + /* 2. Flush running commands + * Clean drop test code - if compiled + * Clean ScsiLookup (and associated memory) + * AND clean mytaskQ + */ + + /* 2a. Drop Test Command. + */ +#ifdef DROP_TEST + { + Scsi_Cmnd *sc; + unsigned long flags; + u16 req_idx; + + /* Free resources for the drop test MF + * and chain buffers. + */ + if (dropMfPtr) { + req_idx = le16_to_cpu(dropMfPtr->u.frame.hwhdr.msgctxu.fld.req_idx); + sc = hd->ScsiLookup[req_idx]; + if (sc == NULL) { + printk(MYIOC_s_ERR_FMT + "Drop Test: NULL ScsiCmd ptr!\n", + ioc->name); + } else { + sc->host_scribble = NULL; + sc->result = DID_RESET << 16; + hd->ScsiLookup[req_idx] = NULL; + atomic_dec(&queue_depth); + spin_lock_irqsave(&io_request_lock, flags); + sc->scsi_done(sc); /* Issue callback */ + spin_unlock_irqrestore(&io_request_lock, flags); + } + + mptscsih_freeChainBuffers(hd, req_idx); + mpt_free_msg_frame(ScsiDoneCtx, ioc->id, dropMfPtr); + printk(MYIOC_s_INFO_FMT + "Free'd: mf (%p) reqidx (%4x)\n", + hd->ioc->name, dropMfPtr, + req_idx); + } + dropMfPtr = NULL; + } +#endif + + /* 2b. Reply to OS all known outstanding I/O commands. + */ + mptscsih_flush_running_cmds(hd); + + /* 2c. If there was an internal command that + * has not completed, configuration or io request, + * free these resources. + */ + if (hd->cmdPtr) { + del_timer(&hd->timer); + mpt_free_msg_frame(ScsiScanDvCtx, ioc->id, hd->cmdPtr); + atomic_dec(&queue_depth); + } + + /* 2d. If a task management has not completed, + * free resources associated with this request. + */ + if (hd->tmPtr) { + del_timer(&hd->TMtimer); + mpt_free_msg_frame(ScsiTaskCtx, ioc->id, hd->tmPtr); + } + +#ifndef MPT_SCSI_USE_NEW_EH + /* 2e. Delete all commands on taskQ + * Should be superfluous - as this taskQ should + * be empty. + */ + clean_taskQ(hd); +#endif + dtmprintk((MYIOC_s_WARN_FMT "Pre-Reset handling complete.\n", + ioc->name)); + + } else { + dtmprintk((MYIOC_s_WARN_FMT "Do Post-Diag Reset handling\n", + ioc->name)); + + /* Once a FW reload begins, all new OS commands are + * redirected to the doneQ w/ a reset status. + * Init all control structures. + */ + + /* ScsiLookup initialization + */ + { + int ii; + for (ii=0; ii < hd->ioc->req_depth; ii++) + hd->ScsiLookup[ii] = NULL; + } + + /* 2. Chain Buffer initialization + */ + mptscsih_initChainBuffers(hd, 0); + + /* 3. tmPtr clear + */ + if (hd->tmPtr) { + hd->tmPtr = NULL; + } + + /* 4. Renegotiate to all devices, if SCSI + */ + if (hd->is_spi) + mptscsih_writeSDP1(hd, 0, 0, MPT_SCSICFG_ALL_IDS | MPT_SCSICFG_USE_NVRAM); + + /* 5. Enable new commands to be posted + */ + spin_lock_irqsave(&ioc->FreeQlock, flags); + hd->tmPending = 0; + spin_unlock_irqrestore(&ioc->FreeQlock, flags); + hd->resetPending = 0; + hd->numTMrequests = 0; + + /* 6. If there was an internal command, + * wake this process up. + */ + if (hd->cmdPtr) { + /* + * Wake up the original calling thread + */ + hd->pLocal = &hd->localReply; + hd->pLocal->completion = MPT_SCANDV_DID_RESET; + scandv_wait_done = 1; + wake_up(&scandv_waitq); + hd->cmdPtr = NULL; + } + + /* 7. Flush doneQ + */ + flush_doneQ(hd); + + dtmprintk((MYIOC_s_WARN_FMT "Post-Reset handling complete.\n", + ioc->name)); + } + + return 1; /* currently means nothing really */ +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +static int +mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) +{ + MPT_SCSI_HOST *hd; + u8 event = le32_to_cpu(pEvReply->Event) & 0xFF; + + dprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n", + ioc->name, event)); + + switch (event) { + case MPI_EVENT_UNIT_ATTENTION: /* 03 */ + /* FIXME! */ + break; + case MPI_EVENT_IOC_BUS_RESET: /* 04 */ + /* FIXME! */ + break; + case MPI_EVENT_EXT_BUS_RESET: /* 05 */ + /* FIXME! */ + break; + case MPI_EVENT_LOGOUT: /* 09 */ + /* FIXME! */ + break; + + /* + * CHECKME! Don't think we need to do + * anything for these, but... + */ + case MPI_EVENT_RESCAN: /* 06 */ + case MPI_EVENT_LINK_STATUS_CHANGE: /* 07 */ + case MPI_EVENT_LOOP_STATE_CHANGE: /* 08 */ + /* + * CHECKME! Falling thru... + */ + + case MPI_EVENT_INTEGRATED_RAID: /* 0B */ +#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION + /* negoNvram set to 0 if DV enabled and to USE_NVRAM if + * if DV disabled + */ + hd = (MPT_SCSI_HOST *) ioc->sh->hostdata; + if (hd->negoNvram == 0) { + ScsiCfgData *pSpi; + Ioc3PhysDisk_t *pPDisk; + int numPDisk; + u8 reason; + u8 physDiskNum; + + reason = (le32_to_cpu(pEvReply->Data[0]) & 0x00FF0000) >> 16; + if (reason == MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED) { + /* New or replaced disk. + * Set DV flag and schedule DV. + */ + pSpi = &ioc->spi_data; + physDiskNum = (le32_to_cpu(pEvReply->Data[0]) & 0xFF000000) >> 24; + if (pSpi->pIocPg3) { + pPDisk = pSpi->pIocPg3->PhysDisk; + numPDisk =pSpi->pIocPg3->NumPhysDisks; + + while (numPDisk) { + if (physDiskNum == pPDisk->PhysDiskNum) { + pSpi->dvStatus[pPDisk->PhysDiskID] = MPT_SCSICFG_NEED_DV; + pSpi->forceDv = MPT_SCSICFG_NEED_DV; + ddvtprintk(("NEED_DV set for phys disk id %d\n", pPDisk->PhysDiskID)); + break; + } + pPDisk++; + numPDisk--; + } + } + } + } +#endif + +#if defined(MPT_DEBUG_DV) || defined(MPT_DEBUG_DV_TINY) + printk("Raid Event RF: "); + { + u32 *m = (u32 *)pEvReply; + int ii; + int n = (int)pEvReply->MsgLength; + for (ii=6; ii < n; ii++) + printk(" %08x", le32_to_cpu(m[ii])); + printk("\n"); + } +#endif + break; + + case MPI_EVENT_NONE: /* 00 */ + case MPI_EVENT_LOG_DATA: /* 01 */ + case MPI_EVENT_STATE_CHANGE: /* 02 */ + case MPI_EVENT_EVENT_CHANGE: /* 0A */ + default: + dprintk((KERN_INFO " Ignoring event (=%02Xh)\n", event)); + break; + } + + return 1; /* currently means nothing really */ +} + +#if 0 /* { */ +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * scsiherr.c - Fusion MPT SCSI Host driver error handling/reporting. + * + * drivers/message/fusion/scsiherr.c + */ + +//extern const char **mpt_ScsiOpcodesPtr; /* needed by mptscsih.c */ +//extern ASCQ_Table_t *mpt_ASCQ_TablePtr; +//extern int mpt_ASCQ_TableSz; + +#define MYNAM "mptscsih" + +#endif /* } */ + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * Private data... + */ +static ASCQ_Table_t *mptscsih_ASCQ_TablePtr; + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* old symsense.c stuff... */ +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * Private data... + * To protect ourselves against those that would pass us bogus pointers + */ +static u8 dummyInqData[SCSI_STD_INQUIRY_BYTES] + = { 0x1F, 0x00, 0x00, 0x00, + 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static u8 dummySenseData[SCSI_STD_SENSE_BYTES] + = { 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 }; +static u8 dummyCDB[16] + = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static u8 dummyScsiData[16] + = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static const char *PeripheralDeviceTypeString[32] = { + "Direct-access", /* 00h */ + "Sequential-access", /* 01h */ + "Printer", /* 02h */ + "Processor", /* 03h */ + /*"Write-Once-Read-Multiple",*/ /* 04h */ + "WORM", /* 04h */ + "CD-ROM", /* 05h */ + "Scanner", /* 06h */ + "Optical memory", /* 07h */ + "Media Changer", /* 08h */ + "Communications", /* 09h */ + "(Graphics arts pre-press)", /* 0Ah */ + "(Graphics arts pre-press)", /* 0Bh */ + "Array controller", /* 0Ch */ + "Enclosure services", /* 0Dh */ + "Simplified direct-access", /* 0Eh */ + "Reserved-0Fh", /* 0Fh */ + "Reserved-10h", /* 10h */ + "Reserved-11h", /* 11h */ + "Reserved-12h", /* 12h */ + "Reserved-13h", /* 13h */ + "Reserved-14h", /* 14h */ + "Reserved-15h", /* 15h */ + "Reserved-16h", /* 16h */ + "Reserved-17h", /* 17h */ + "Reserved-18h", /* 18h */ + "Reserved-19h", /* 19h */ + "Reserved-1Ah", /* 1Ah */ + "Reserved-1Bh", /* 1Bh */ + "Reserved-1Ch", /* 1Ch */ + "Reserved-1Dh", /* 1Dh */ + "Reserved-1Eh", /* 1Eh */ + "Unknown" /* 1Fh */ +}; +#endif + +static char *ScsiStatusString[] = { + "GOOD", /* 00h */ + NULL, /* 01h */ + "CHECK CONDITION", /* 02h */ + NULL, /* 03h */ + "CONDITION MET", /* 04h */ + NULL, /* 05h */ + NULL, /* 06h */ + NULL, /* 07h */ + "BUSY", /* 08h */ + NULL, /* 09h */ + NULL, /* 0Ah */ + NULL, /* 0Bh */ + NULL, /* 0Ch */ + NULL, /* 0Dh */ + NULL, /* 0Eh */ + NULL, /* 0Fh */ + "INTERMEDIATE", /* 10h */ + NULL, /* 11h */ + NULL, /* 12h */ + NULL, /* 13h */ + "INTERMEDIATE-CONDITION MET", /* 14h */ + NULL, /* 15h */ + NULL, /* 16h */ + NULL, /* 17h */ + "RESERVATION CONFLICT", /* 18h */ + NULL, /* 19h */ + NULL, /* 1Ah */ + NULL, /* 1Bh */ + NULL, /* 1Ch */ + NULL, /* 1Dh */ + NULL, /* 1Eh */ + NULL, /* 1Fh */ + NULL, /* 20h */ + NULL, /* 21h */ + "COMMAND TERMINATED", /* 22h */ + NULL, /* 23h */ + NULL, /* 24h */ + NULL, /* 25h */ + NULL, /* 26h */ + NULL, /* 27h */ + "TASK SET FULL", /* 28h */ + NULL, /* 29h */ + NULL, /* 2Ah */ + NULL, /* 2Bh */ + NULL, /* 2Ch */ + NULL, /* 2Dh */ + NULL, /* 2Eh */ + NULL, /* 2Fh */ + "ACA ACTIVE", /* 30h */ + NULL +}; + +static const char *ScsiCommonOpString[] = { + "TEST UNIT READY", /* 00h */ + "REZERO UNIT (REWIND)", /* 01h */ + NULL, /* 02h */ + "REQUEST_SENSE", /* 03h */ + "FORMAT UNIT (MEDIUM)", /* 04h */ + "READ BLOCK LIMITS", /* 05h */ + NULL, /* 06h */ + "REASSIGN BLOCKS", /* 07h */ + "READ(6)", /* 08h */ + NULL, /* 09h */ + "WRITE(6)", /* 0Ah */ + "SEEK(6)", /* 0Bh */ + NULL, /* 0Ch */ + NULL, /* 0Dh */ + NULL, /* 0Eh */ + "READ REVERSE", /* 0Fh */ + "WRITE_FILEMARKS", /* 10h */ + "SPACE(6)", /* 11h */ + "INQUIRY", /* 12h */ + NULL +}; + +static const char *SenseKeyString[] = { + "NO SENSE", /* 0h */ + "RECOVERED ERROR", /* 1h */ + "NOT READY", /* 2h */ + "MEDIUM ERROR", /* 3h */ + "HARDWARE ERROR", /* 4h */ + "ILLEGAL REQUEST", /* 5h */ + "UNIT ATTENTION", /* 6h */ + "DATA PROTECT", /* 7h */ + "BLANK CHECK", /* 8h */ + "VENDOR-SPECIFIC", /* 9h */ + "ABORTED COPY", /* Ah */ + "ABORTED COMMAND", /* Bh */ + "EQUAL (obsolete)", /* Ch */ + "VOLUME OVERFLOW", /* Dh */ + "MISCOMPARE", /* Eh */ + "RESERVED", /* Fh */ + NULL +}; + +#define SPECIAL_ASCQ(c,q) \ + (((c) == 0x40 && (q) != 0x00) || ((c) == 0x4D) || ((c) == 0x70)) + +#if 0 +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * Sense_Key_Specific() - If Sense_Key_Specific_Valid bit is set, + * then print additional information via + * a call to SDMS_SystemAlert(). + */ +static void Sense_Key_Specific(IO_Info_t *ioop, char *msg1) +{ + u8 *sd; + u8 BadValue; + u8 SenseKey; + int Offset; + int len = strlen(msg1); + + sd = ioop->sensePtr; + if (SD_Additional_Sense_Length(sd) < 8) + return; + + SenseKey = SD_Sense_Key(sd); + + if (SD_Sense_Key_Specific_Valid(sd)) { + if (SenseKey == SK_ILLEGAL_REQUEST) { + Offset = SD_Bad_Byte(sd); + if (SD_Was_Illegal_Request(sd)) { + BadValue = ioop->cdbPtr[Offset]; + len += sprintf(msg1+len, "\n Illegal CDB value=%02Xh found at CDB ", + BadValue); + } else { + BadValue = ioop->dataPtr[Offset]; + len += sprintf(msg1+len, "\n Illegal DATA value=%02Xh found at DATA ", + BadValue); + } + len += sprintf(msg1+len, "byte=%02Xh", Offset); + if (SD_SKS_Bit_Pointer_Valid(sd)) + len += sprintf(msg1+len, "/bit=%1Xh", SD_SKS_Bit_Pointer(sd)); + } else if ((SenseKey == SK_RECOVERED_ERROR) || + (SenseKey == SK_HARDWARE_ERROR) || + (SenseKey == SK_MEDIUM_ERROR)) { + len += sprintf(msg1+len, "\n Recovery algorithm Actual_Retry_Count=%02Xh", + SD_Actual_Retry_Count(sd)); + } + } +} +#endif + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +static int dump_cdb(char *foo, unsigned char *cdb) +{ + int i, grpCode, cdbLen; + int l = 0; + + grpCode = cdb[0] >> 5; + if (grpCode < 1) + cdbLen = 6; + else if (grpCode < 3) + cdbLen = 10; + else if (grpCode == 5) + cdbLen = 12; + else + cdbLen = 16; + + for (i=0; i < cdbLen; i++) + l += sprintf(foo+l, " %02X", cdb[i]); + + return l; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +static int dump_sd(char *foo, unsigned char *sd) +{ + int snsLen = 8 + SD_Additional_Sense_Length(sd); + int l = 0; + int i; + + for (i=0; i < MIN(snsLen,18); i++) + l += sprintf(foo+l, " %02X", sd[i]); + l += sprintf(foo+l, "%s", snsLen>18 ? " ..." : ""); + + return l; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* Do ASC/ASCQ lookup/grindage to English readable string(s) */ +static const char * ascq_set_strings_4max( + u8 ASC, u8 ASCQ, + const char **s1, const char **s2, const char **s3, const char **s4) +{ + static const char *asc_04_part1_string = "LOGICAL UNIT "; + static const char *asc_04_part2a_string = "NOT READY, "; + static const char *asc_04_part2b_string = "IS "; + static const char *asc_04_ascq_NN_part3_strings[] = { /* ASC ASCQ (hex) */ + "CAUSE NOT REPORTABLE", /* 04 00 */ + "IN PROCESS OF BECOMING READY", /* 04 01 */ + "INITIALIZING CMD. REQUIRED", /* 04 02 */ + "MANUAL INTERVENTION REQUIRED", /* 04 03 */ + /* Add " IN PROGRESS" to all the following... */ + "FORMAT", /* 04 04 */ + "REBUILD", /* 04 05 */ + "RECALCULATION", /* 04 06 */ + "OPERATION", /* 04 07 */ + "LONG WRITE", /* 04 08 */ + "SELF-TEST", /* 04 09 */ + NULL + }; + static char *asc_04_part4_string = " IN PROGRESS"; + + static char *asc_29_ascq_NN_strings[] = { /* ASC ASCQ (hex) */ + "POWER ON, RESET, OR BUS DEVICE RESET OCCURRED", /* 29 00 */ + "POWER ON OCCURRED", /* 29 01 */ + "SCSI BUS RESET OCCURRED", /* 29 02 */ + "BUS DEVICE RESET FUNCTION OCCURRED", /* 29 03 */ + "DEVICE INTERNAL RESET", /* 29 04 */ + "TRANSCEIVER MODE CHANGED TO SINGLE-ENDED", /* 29 05 */ + "TRANSCEIVER MODE CHANGED TO LVD", /* 29 06 */ + NULL + }; + static char *ascq_vendor_uniq = "(Vendor Unique)"; + static char *ascq_noone = "(no matching ASC/ASCQ description found)"; + int idx; + + *s1 = *s2 = *s3 = *s4 = ""; /* set'em all to the empty "" string */ + + /* CHECKME! Need lock/sem? + * Update and examine for isense module presense. + */ + mptscsih_ASCQ_TablePtr = (ASCQ_Table_t *)mpt_v_ASCQ_TablePtr; + + if (mptscsih_ASCQ_TablePtr == NULL) { + /* 2nd chances... */ + if (ASC == 0x04 && (ASCQ < sizeof(asc_04_ascq_NN_part3_strings)/sizeof(char*)-1)) { + *s1 = asc_04_part1_string; + *s2 = (ASCQ == 0x01) ? asc_04_part2b_string : asc_04_part2a_string; + *s3 = asc_04_ascq_NN_part3_strings[ASCQ]; + /* check for " IN PROGRESS" ones */ + if (ASCQ >= 0x04) + *s4 = asc_04_part4_string; + } else if (ASC == 0x29 && (ASCQ < sizeof(asc_29_ascq_NN_strings)/sizeof(char*)-1)) + *s1 = asc_29_ascq_NN_strings[ASCQ]; + /* + * Else { leave all *s[1-4] values pointing to the empty "" string } + */ + return *s1; + } + + /* + * Need to check ASC here; if it is "special," then + * the ASCQ is variable, and indicates failed component number. + * We must treat the ASCQ as a "dont care" while searching the + * mptscsih_ASCQ_Table[] by masking it off, and then restoring it later + * on when we actually need to identify the failed component. + */ + if (SPECIAL_ASCQ(ASC,ASCQ)) + ASCQ = 0xFF; + + /* OK, now search mptscsih_ASCQ_Table[] for a matching entry */ + for (idx = 0; mptscsih_ASCQ_TablePtr && idx < mpt_ASCQ_TableSz; idx++) + if ((ASC == mptscsih_ASCQ_TablePtr[idx].ASC) && (ASCQ == mptscsih_ASCQ_TablePtr[idx].ASCQ)) { + *s1 = mptscsih_ASCQ_TablePtr[idx].Description; + return *s1; + } + + if ((ASC >= 0x80) || (ASCQ >= 0x80)) + *s1 = ascq_vendor_uniq; + else + *s1 = ascq_noone; + + return *s1; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * SCSI Error Report; desired output format... + *--- +SCSI Error Report =-=-=-=-=-=-=-=-=-=-=-=-=-= (ioc0,scsi0:0) + SCSI_Status=02h (CHECK CONDITION) + Original_CDB[]: 00 00 00 00 00 00 - TestUnitReady + SenseData[12h]: 70 00 06 00 00 00 00 0A 00 00 00 00 29 00 03 00 00 00 + SenseKey=6h (UNIT ATTENTION); FRU=03h + ASC/ASCQ=29h/00h, "POWER ON, RESET, OR BUS DEVICE RESET OCCURRED" + *--- + */ + +int mpt_ScsiHost_ErrorReport(IO_Info_t *ioop) +{ + char foo[512]; + char buf2[32]; + char *statstr; + const char *opstr; + int sk = SD_Sense_Key(ioop->sensePtr); + const char *skstr = SenseKeyString[sk]; + unsigned char asc = SD_ASC(ioop->sensePtr); + unsigned char ascq = SD_ASCQ(ioop->sensePtr); + int l; + + /* + * More quiet mode. + * Filter out common, repetitive, warning-type errors... like: + * POWER ON (06,29/00 or 06,29/01), + * SPINNING UP (02,04/01), + * LOGICAL UNIT NOT SUPPORTED (05,25/00), etc. + */ + if (sk == SK_NO_SENSE) { + return 0; + } + if ( (sk==SK_UNIT_ATTENTION && asc==0x29 && (ascq==0x00 || ascq==0x01)) + || (sk==SK_NOT_READY && asc==0x04 && ascq==0x01) + || (sk==SK_ILLEGAL_REQUEST && asc==0x25 && ascq==0x00) + ) + { + /* Do nothing! */ + return 0; + } + + /* + * Protect ourselves... + */ + if (ioop->cdbPtr == NULL) + ioop->cdbPtr = dummyCDB; + if (ioop->sensePtr == NULL) + ioop->sensePtr = dummySenseData; + if (ioop->inqPtr == NULL) + ioop->inqPtr = dummyInqData; + if (ioop->dataPtr == NULL) + ioop->dataPtr = dummyScsiData; + + statstr = NULL; + if ((ioop->SCSIStatus >= sizeof(ScsiStatusString)/sizeof(char*)-1) || + ((statstr = (char*)ScsiStatusString[ioop->SCSIStatus]) == NULL)) { + (void) sprintf(buf2, "Bad-Reserved-%02Xh", ioop->SCSIStatus); + statstr = buf2; + } + + opstr = NULL; + if (1+ioop->cdbPtr[0] <= sizeof(ScsiCommonOpString)/sizeof(char*)) + opstr = ScsiCommonOpString[ioop->cdbPtr[0]]; + else if (mpt_ScsiOpcodesPtr) + opstr = mpt_ScsiOpcodesPtr[ioop->cdbPtr[0]]; + + l = sprintf(foo, "SCSI Error Report =-=-= (%s)\n" + " SCSI_Status=%02Xh (%s)\n" + " Original_CDB[]:", + ioop->DevIDStr, + ioop->SCSIStatus, + statstr); + l += dump_cdb(foo+l, ioop->cdbPtr); + if (opstr) + l += sprintf(foo+l, " - \"%s\"", opstr); + l += sprintf(foo+l, "\n SenseData[%02Xh]:", 8+SD_Additional_Sense_Length(ioop->sensePtr)); + l += dump_sd(foo+l, ioop->sensePtr); + l += sprintf(foo+l, "\n SenseKey=%Xh (%s); FRU=%02Xh\n ASC/ASCQ=%02Xh/%02Xh", + sk, skstr, SD_FRU(ioop->sensePtr), asc, ascq ); + + { + const char *x1, *x2, *x3, *x4; + x1 = x2 = x3 = x4 = ""; + x1 = ascq_set_strings_4max(asc, ascq, &x1, &x2, &x3, &x4); + if (x1 != NULL) { + if (x1[0] != '(') + l += sprintf(foo+l, " \"%s%s%s%s\"", x1,x2,x3,x4); + else + l += sprintf(foo+l, " %s%s%s%s", x1,x2,x3,x4); + } + } + +#if 0 + if (SPECIAL_ASCQ(asc,ascq)) + l += sprintf(foo+l, " (%02Xh)", ascq); +#endif + + PrintF(("%s\n", foo)); + + return l; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mptscsih_initTarget - Target, LUN alloc/free functionality. + * @hd: Pointer to MPT_SCSI_HOST structure + * @bus_id: Bus number (?) + * @target_id: SCSI target id + * @lun: SCSI LUN id + * @data: Pointer to data + * @dlen: Number of INQUIRY bytes + * + * NOTE: It's only SAFE to call this routine if data points to + * sane & valid STANDARD INQUIRY data! + * + * Allocate and initialize memory for this target. + * Save inquiry data. + * + * Returns pointer to VirtDevice structure. + */ +static VirtDevice * +mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *data, int dlen) +{ + VirtDevice *vdev; + int sz; + + dprintk((MYIOC_s_INFO_FMT "initTarget (%d,%d,%d) called, hd=%p\n", + hd->ioc->name, bus_id, target_id, lun, hd)); + + if ((vdev = hd->Targets[target_id]) == NULL) { + if ((vdev = kmalloc(sizeof(VirtDevice), GFP_ATOMIC)) == NULL) { + printk(MYIOC_s_ERR_FMT "initTarget kmalloc(%d) FAILED!\n", + hd->ioc->name, (int)sizeof(VirtDevice)); + } else { + memset(vdev, 0, sizeof(VirtDevice)); + rwlock_init(&vdev->VdevLock); + Q_INIT(&vdev->WaitQ, void); + Q_INIT(&vdev->SentQ, void); + Q_INIT(&vdev->DoneQ, void); + vdev->tflags = 0; + vdev->ioc_id = hd->ioc->id; + vdev->target_id = target_id; + vdev->bus_id = bus_id; + + hd->Targets[target_id] = vdev; + dprintk((KERN_INFO " *NEW* Target structure (id %d) @ %p\n", + target_id, vdev)); + } + } + + if (vdev && data) { + if (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY)) { + + /* Copy the inquiry data - if we haven't yet. + */ + sz = MIN(dlen, SCSI_STD_INQUIRY_BYTES); + + memcpy (vdev->inq_data, data, sz); + vdev->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY; + + /* Update the target capabilities + */ + mptscsih_setTargetNegoParms(hd, vdev); + } + + /* Is LUN supported? If so, upper 3 bits will be 0 + * in first byte of inquiry data. + */ + if ((*data & 0xe0) == 0) + vdev->luns |= (1 << lun); + } + + if (vdev) { + if (hd->ioc->spi_data.isRaid & (1 << target_id)) + vdev->raidVolume = 1; + else + vdev->raidVolume = 0; + } + + dprintk((KERN_INFO " target = %p\n", vdev)); + return vdev; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * Update the target negotiation parameters based on the + * the Inquiry data, adapter capabilities, and NVRAM settings. + * + */ +void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target) +{ + int id = (int) target->target_id; + int nvram; + char canQ = 0; + u8 width = MPT_NARROW; + u8 factor = MPT_ASYNC; + u8 offset = 0; + u8 version, nfactor; + ScsiCfgData *pspi_data = &hd->ioc->spi_data; + + /* Set flags based on Inquiry data + */ + if (target->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY) { + version = target->inq_data[2] & 0x03; + if (version < 2) { + width = 0; + factor = MPT_ULTRA2; + offset = pspi_data->maxSyncOffset; + } else { + if (target->inq_data[7] & 0x20) { + width = 1; + } + + if (target->inq_data[7] & 0x10) { + if (version == 2) + factor = MPT_ULTRA2; + else + factor = MPT_ULTRA320; + + offset = pspi_data->maxSyncOffset; + } else { + factor = MPT_ASYNC; + offset = 0; + } + } + + if (target->inq_data[7] & 0x02) { + canQ = 1; + } + + /* Update tflags based on NVRAM settings. (SCSI only) + */ + if (pspi_data->nvram && (pspi_data->nvram[id] != MPT_HOST_NVRAM_INVALID)) { + nvram = pspi_data->nvram[id]; + nfactor = (nvram & MPT_NVRAM_SYNC_MASK) >> 8; + + if (width) + width = nvram & MPT_NVRAM_WIDE_DISABLE ? 0 : 1; + + if (offset > 0) { + /* Ensure factor is set to the + * maximum of: adapter, nvram, inquiry + */ + if (nfactor) { + if (nfactor < pspi_data->minSyncFactor ) + nfactor = pspi_data->minSyncFactor; + + factor = MAX (factor, nfactor); + if (factor == MPT_ASYNC) + offset = 0; + } else { + offset = 0; + factor = MPT_ASYNC; + } + } else { + factor = MPT_ASYNC; + } + } + + /* Make sure data is consistent + */ + if ((!width) && (factor < MPT_ULTRA2)) { + factor = MPT_ULTRA2; + } + + /* Save the data to the target structure. + */ + target->minSyncFactor = factor; + target->maxOffset = offset; + target->maxWidth = width; + if (canQ) { + target->tflags |= MPT_TARGET_FLAGS_Q_YES; + } + + target->tflags |= MPT_TARGET_FLAGS_VALID_NEGO; + + /* Disable all wide (sync) extended messages + * if device is narrow (async). + */ + target->negoFlags = 0; + if (!width) + target->negoFlags |= MPT_TARGET_NO_NEGO_WIDE; + + if (!offset) + target->negoFlags |= MPT_TARGET_NO_NEGO_SYNC; + } + + return; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * Clear sense valid flag. + */ +static void clear_sense_flag(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq) +{ + VirtDevice *target; + int index = (int) pReq->TargetID; + + if ((target = hd->Targets[index])) { + target->tflags &= ~MPT_TARGET_FLAGS_VALID_SENSE; + } + + return; +} + +/* + * If DV disabled (negoNvram set to USE_NVARM) or if not LUN 0, return. + * Else set the NEED_DV flag after Read Capacity Issued (disks) + * or Mode Sense (cdroms). Tapes, key off of Inquiry command. + */ +static void mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq, char *data) +{ + u8 cmd = pReq->CDB[0]; + + if (pReq->LUN[1] != 0) + return; + + if (hd->negoNvram != 0) + return; + + if ((cmd == READ_CAPACITY) || (cmd == MODE_SENSE) || + ((cmd == INQUIRY) && ((data[0] & 0x1F) == 0x01))) { + u8 dvStatus = hd->ioc->spi_data.dvStatus[pReq->TargetID]; + if (!(dvStatus & MPT_SCSICFG_DV_DONE)) { + ScsiCfgData *pSpi = &hd->ioc->spi_data; + if ((pSpi->isRaid & (1 << pReq->TargetID)) && pSpi->pIocPg3) { + /* Set NEED_DV for all hidden disks + */ + Ioc3PhysDisk_t *pPDisk = pSpi->pIocPg3->PhysDisk; + int numPDisk = pSpi->pIocPg3->NumPhysDisks; + + while (numPDisk) { + pSpi->dvStatus[pPDisk->PhysDiskID] |= MPT_SCSICFG_NEED_DV; + ddvtprintk(("NEED_DV set for phys disk id %d\n", pPDisk->PhysDiskID)); + pPDisk++; + numPDisk--; + } + } + pSpi->dvStatus[pReq->TargetID] |= MPT_SCSICFG_NEED_DV; + ddvtprintk(("NEED_DV set for visible disk id %d\n", + pReq->TargetID)); + }; + } +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * SCSI Config Page functionality ... + */ +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptscsih_setDevicePage1Flags - add Requested and Configuration fields flags + * based on width, factor and offset parameters. + * @width: bus width + * @factor: sync factor + * @offset: sync offset + * @requestedPtr: pointer to requested values (updated) + * @configurationPtr: pointer to configuration values (updated) + * @flags: flags to block WDTR or SDTR negotiation + * + * Return: None. + * + * Remark: Called by writeSDP1 and _dv_params + */ +static void +mptscsih_setDevicePage1Flags (u8 width, u8 factor, u8 offset, int *requestedPtr, int *configurationPtr, u8 flags) +{ + u8 nowide = flags & MPT_TARGET_NO_NEGO_WIDE; + u8 nosync = flags & MPT_TARGET_NO_NEGO_SYNC; + + *configurationPtr = 0; + *requestedPtr = width ? MPI_SCSIDEVPAGE1_RP_WIDE : 0; + *requestedPtr |= (offset << 16) | (factor << 8); + + if (width && offset && !nowide && !nosync) { + if (factor < MPT_ULTRA160) { + *requestedPtr |= (MPI_SCSIDEVPAGE1_RP_IU + MPI_SCSIDEVPAGE1_RP_DT + + MPI_SCSIDEVPAGE1_RP_QAS); + } else if (factor < MPT_ULTRA2) { + *requestedPtr |= MPI_SCSIDEVPAGE1_RP_DT; + } + } + + if (nowide) + *configurationPtr |= MPI_SCSIDEVPAGE1_CONF_WDTR_DISALLOWED; + + if (nosync) + *configurationPtr |= MPI_SCSIDEVPAGE1_CONF_SDTR_DISALLOWED; + + return; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptscsih_writeSDP1 - write SCSI Device Page 1 + * @hd: Pointer to a SCSI Host Strucutre + * @portnum: IOC port number + * @target_id: writeSDP1 for single ID + * @flags: MPT_SCSICFG_ALL_IDS, MPT_SCSICFG_USE_NVRAM + * + * Return: -EFAULT if read of config page header fails + * or 0 if success. + * + * Remark: If a target has been found, the settings from the + * target structure are used, else the device is set + * to async/narrow. + * + * Remark: Called during init and after a FW reload. + * Remark: We do not wait for a return, write pages sequentially. + */ +static int +mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags) +{ + MPT_ADAPTER *ioc = hd->ioc; + Config_t *pReq = NULL; + SCSIDevicePage1_t *pData = NULL; + VirtDevice *pTarget = NULL; + MPT_FRAME_HDR *mf; + MptSge_t *psge; + dma_addr_t dataDma; + u16 req_idx; + u32 frameOffset; + u32 requested, configuration, flagsLength; + int ii, nvram; + int id = 0, maxid = 0; + u8 width; + u8 factor; + u8 offset; + u8 bus = 0; + u8 negoFlags; + + if (ioc->spi_data.sdp1length == 0) + return 0; + + if (flags & MPT_SCSICFG_ALL_IDS) { + id = 0; + maxid = ioc->sh->max_id - 1; + } else if (ioc->sh) { + id = target_id; + maxid = MIN(id, ioc->sh->max_id - 1); + } + + for (; id <= maxid; id++) { + if (id == ioc->pfacts[portnum].PortSCSIID) + continue; + + if (flags & MPT_SCSICFG_USE_NVRAM) { + /* Use NVRAM, adapter maximums and target settings. + * Data over-riden by target structure information, if present + */ + width = ioc->spi_data.maxBusWidth; + offset = ioc->spi_data.maxSyncOffset; + factor = ioc->spi_data.minSyncFactor; + if (ioc->spi_data.nvram && (ioc->spi_data.nvram[id] != MPT_HOST_NVRAM_INVALID)) { + nvram = ioc->spi_data.nvram[id]; + + if (width) + width = nvram & MPT_NVRAM_WIDE_DISABLE ? 0 : 1; + + if (offset > 0) { + factor = (nvram & MPT_NVRAM_SYNC_MASK) >> 8; + if (factor == 0) { + /* Key for async */ + factor = MPT_ASYNC; + offset = 0; + } else if (factor < ioc->spi_data.minSyncFactor) { + factor = ioc->spi_data.minSyncFactor; + } + } else + factor = MPT_ASYNC; + } + + /* Set the negotiation flags. + */ + negoFlags = 0; + if (!width) + negoFlags |= MPT_TARGET_NO_NEGO_WIDE; + + if (!offset) + negoFlags |= MPT_TARGET_NO_NEGO_SYNC; + } else { + width = 0; + factor = MPT_ASYNC; + offset = 0; + negoFlags = MPT_TARGET_NO_NEGO_SYNC; + } + + /* If id is not a raid volume, get the updated + * transmission settings from the target structure. + */ + if (hd->Targets && (pTarget = hd->Targets[id]) && !pTarget->raidVolume) { + width = pTarget->maxWidth; + factor = pTarget->minSyncFactor; + offset = pTarget->maxOffset; + negoFlags = pTarget->negoFlags; + pTarget = NULL; + } + mptscsih_setDevicePage1Flags(width, factor, offset, + &requested, &configuration, negoFlags); + + + if (negoFlags == (MPT_TARGET_NO_NEGO_WIDE | MPT_TARGET_NO_NEGO_SYNC)) + continue; + + /* Get a MF for this command. + */ + if ((mf = mpt_get_msg_frame(ScsiDoneCtx, ioc->id)) == NULL) { + dprintk((MYIOC_s_WARN_FMT "write SDP1: no msg frames!\n", + ioc->name)); + return -EAGAIN; + } + + /* Set the request and the data pointers. + * Request takes: 36 bytes (32 bit SGE) + * SCSI Device Page 1 requires 16 bytes + * 40 + 16 <= size of SCSI IO Request = 56 bytes + * and MF size >= 64 bytes. + * Place data at end of MF. + */ + pReq = (Config_t *)mf; + + req_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); + frameOffset = ioc->req_sz - sizeof(SCSIDevicePage1_t); + + pData = (SCSIDevicePage1_t *)((u8 *) mf + frameOffset); + dataDma = ioc->req_frames_dma + (req_idx * ioc->req_sz) + frameOffset; + + /* Complete the request frame (same for all requests). + */ + pReq->Action = MPI_CONFIG_ACTION_PAGE_WRITE_CURRENT; + pReq->Reserved = 0; + pReq->ChainOffset = 0; + pReq->Function = MPI_FUNCTION_CONFIG; + pReq->Reserved1[0] = 0; + pReq->Reserved1[1] = 0; + pReq->Reserved1[2] = 0; + pReq->MsgFlags = 0; + for (ii=0; ii < 8; ii++) { + pReq->Reserved2[ii] = 0; + } + pReq->Header.PageVersion = ioc->spi_data.sdp1version; + pReq->Header.PageLength = ioc->spi_data.sdp1length; + pReq->Header.PageNumber = 1; + pReq->Header.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; + pReq->PageAddress = cpu_to_le32(id | (bus << 8 )); + + /* Add a SGE to the config request. + */ + flagsLength = MPT_SGE_FLAGS_SSIMPLE_WRITE | ioc->spi_data.sdp1length * 4; + + psge = (MptSge_t *) &pReq->PageBufferSGE; + psge->FlagsLength = cpu_to_le32(flagsLength); + cpu_to_leXX(dataDma, psge->Address); + + /* Set up the common data portion + */ + pData->Header.PageVersion = pReq->Header.PageVersion; + pData->Header.PageLength = pReq->Header.PageLength; + pData->Header.PageNumber = pReq->Header.PageNumber; + pData->Header.PageType = pReq->Header.PageType; + pData->RequestedParameters = cpu_to_le32(requested); + pData->Reserved = 0; + pData->Configuration = cpu_to_le32(configuration); + + dprintk((MYIOC_s_INFO_FMT + "write SDP1: id %d pgaddr 0x%x req 0x%x config 0x%x\n", + ioc->name, id, (id | (bus<<8)), + requested, configuration)); + + mptscsih_put_msgframe(ScsiDoneCtx, ioc->id, mf); + } + + return 0; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptscsih_taskmgmt_timeout - Call back for timeout on a + * task management request. + * @data: Pointer to MPT_SCSI_HOST recast as an unsigned long + * + */ +static void mptscsih_taskmgmt_timeout(unsigned long data) +{ + MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *) data; + + dprintk((MYIOC_s_WARN_FMT "TM request timed out!\n", hd->ioc->name)); + /* Delete the timer that triggered this callback. + * Remark: del_timer checks to make sure timer is active + * before deleting. + */ + del_timer(&hd->TMtimer); + + /* Call the reset handler. Already had a TM request + * timeout - so issue a diagnostic reset + */ + if (mpt_HardResetHandler(hd->ioc, NO_SLEEP) < 0) { + printk((KERN_WARNING " Firmware Reload FAILED!!\n")); + } + + return; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * Bus Scan and Domain Validation functionality ... + */ + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mptscsih_scandv_complete - Scan and DV callback routine registered + * to Fustion MPT (base) driver. + * + * @ioc: Pointer to MPT_ADAPTER structure + * @mf: Pointer to original MPT request frame + * @mr: Pointer to MPT reply frame (NULL if TurboReply) + * + * This routine is called from mpt.c::mpt_interrupt() at the completion + * of any SCSI IO request. + * This routine is registered with the Fusion MPT (base) driver at driver + * load/init time via the mpt_register() API call. + * + * Returns 1 indicating alloc'd request frame ptr should be freed. + * + * Remark: Sets a completion code and (possibly) saves sense data + * in the IOC member localReply structure. + * Used ONLY for bus scan, DV and other internal commands. + */ +static int +mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) +{ + MPT_SCSI_HOST *hd; + SCSIIORequest_t *pReq; + int completionCode; + u16 req_idx; + + if ((mf == NULL) || + (mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth))) { + printk(MYIOC_s_ERR_FMT + "ScanDvComplete, %s req frame ptr! (=%p)\n", + ioc->name, mf?"BAD":"NULL", mf); + goto wakeup; + } + + hd = (MPT_SCSI_HOST *) ioc->sh->hostdata; + del_timer(&hd->timer); + req_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); + hd->ScsiLookup[req_idx] = NULL; + pReq = (SCSIIORequest_t *) mf; + + if (mf != hd->cmdPtr) { + printk(MYIOC_s_WARN_FMT "ScanDvComplete (mf=%p, cmdPtr=%p)\n", + hd->ioc->name, mf, hd->cmdPtr); + } + hd->cmdPtr = NULL; + + ddvprintk((MYIOC_s_INFO_FMT "ScanDvComplete (mf=%p,mr=%p)\n", + hd->ioc->name, mf, mr)); + + atomic_dec(&queue_depth); + + hd->pLocal = &hd->localReply; + + /* If target struct exists, clear sense valid flag. + */ + clear_sense_flag(hd, pReq); + + if (mr == NULL) { + completionCode = MPT_SCANDV_GOOD; + } else { + SCSIIOReply_t *pReply; + u16 status; + + pReply = (SCSIIOReply_t *) mr; + + status = le16_to_cpu(pReply->IOCStatus) & MPI_IOCSTATUS_MASK; + + ddvprintk((KERN_NOTICE " IOCStatus=%04xh, SCSIState=%02xh, SCSIStatus=%02xh, IOCLogInfo=%08xh\n", + status, pReply->SCSIState, pReply->SCSIStatus, + le32_to_cpu(pReply->IOCLogInfo))); + + switch(status) { + + case MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE: /* 0x0043 */ + completionCode = MPT_SCANDV_SELECTION_TIMEOUT; + break; + + case MPI_IOCSTATUS_SCSI_IO_DATA_ERROR: /* 0x0046 */ + case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */ + case MPI_IOCSTATUS_SCSI_IOC_TERMINATED: /* 0x004B */ + case MPI_IOCSTATUS_SCSI_EXT_TERMINATED: /* 0x004C */ + completionCode = MPT_SCANDV_DID_RESET; + break; + + case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ + case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ + case MPI_IOCSTATUS_SUCCESS: /* 0x0000 */ + if (pReply->Function == MPI_FUNCTION_CONFIG) { + ConfigReply_t *pr = (ConfigReply_t *)mr; + completionCode = MPT_SCANDV_GOOD; + hd->pLocal->header.PageVersion = pr->Header.PageVersion; + hd->pLocal->header.PageLength = pr->Header.PageLength; + hd->pLocal->header.PageNumber = pr->Header.PageNumber; + hd->pLocal->header.PageType = pr->Header.PageType; + + } else if (pReply->Function == MPI_FUNCTION_RAID_ACTION) { + /* If the RAID Volume request is successful, + * return GOOD, else indicate that + * some type of error occurred. + */ + MpiRaidActionReply_t *pr = (MpiRaidActionReply_t *)mr; + if (pr->ActionStatus == MPI_RAID_ACTION_ASTATUS_SUCCESS) + completionCode = MPT_SCANDV_GOOD; + else + completionCode = MPT_SCANDV_SOME_ERROR; + + } else if (pReply->SCSIState & MPI_SCSI_STATE_AUTOSENSE_VALID) { + VirtDevice *target; + u8 *sense_data; + int sz; + + /* save sense data in global & target structure + */ + completionCode = MPT_SCANDV_SENSE; + hd->pLocal->scsiStatus = pReply->SCSIStatus; + sense_data = ((u8 *)hd->ioc->sense_buf_pool + + (req_idx * MPT_SENSE_BUFFER_ALLOC)); + + sz = MIN (pReq->SenseBufferLength, + SCSI_STD_SENSE_BYTES); + memcpy(hd->pLocal->sense, sense_data, sz); + + target = hd->Targets[pReq->TargetID]; + if (target) { + memcpy(target->sense, sense_data, sz); + target->tflags + |= MPT_TARGET_FLAGS_VALID_SENSE; + } + + ddvprintk((KERN_NOTICE " Check Condition, sense ptr %p\n", + sense_data)); + } else if (pReply->SCSIState & (MPI_SCSI_STATE_AUTOSENSE_FAILED | + MPI_SCSI_STATE_NO_SCSI_STATUS)) { + completionCode = MPT_SCANDV_DID_RESET; + } else if (pReply->SCSIState & MPI_SCSI_STATE_TERMINATED) { + completionCode = MPT_SCANDV_DID_RESET; + } else { + /* If no error, this will be equivalent + * to MPT_SCANDV_GOOD + */ + completionCode = (int) pReply->SCSIStatus; + } + break; + + case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR: /* 0x0047 */ + if (pReply->SCSIState & MPI_SCSI_STATE_TERMINATED) + completionCode = MPT_SCANDV_DID_RESET; + else + completionCode = MPT_SCANDV_SOME_ERROR; + break; + + default: + completionCode = MPT_SCANDV_SOME_ERROR; + break; + + } /* switch(status) */ + + ddvprintk((KERN_NOTICE " completionCode set to %08xh\n", + completionCode)); + } /* end of address reply case */ + + hd->pLocal->completion = completionCode; + + /* MF and RF are freed in mpt_interrupt + */ +wakeup: + /* Free Chain buffers (will never chain) in scan or dv */ + //mptscsih_freeChainBuffers(hd, req_idx); + + /* + * Wake up the original calling thread + */ + scandv_wait_done = 1; + wake_up(&scandv_waitq); + + return 1; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptscsih_timer_expired - Call back for timer process. + * Used only for dv functionality. + * @data: Pointer to MPT_SCSI_HOST recast as an unsigned long + * + */ +static void mptscsih_timer_expired(unsigned long data) +{ + MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *) data; +#ifndef MPT_SCSI_USE_NEW_EH + unsigned long flags; +#endif + + + ddvprintk((MYIOC_s_WARN_FMT "Timer Expired! Cmd %p\n", hd->ioc->name, hd->cmdPtr)); + + if (hd->cmdPtr) { + MPIHeader_t *cmd = (MPIHeader_t *)hd->cmdPtr; + + if (cmd->Function == MPI_FUNCTION_SCSI_IO_REQUEST) { + /* Desire to issue a task management request here. + * TM requests MUST be single threaded. + * If old eh code and no TM current, issue request. + * If new eh code, do nothing. Wait for OS cmd timeout + * for bus reset. + */ +#ifndef MPT_SCSI_USE_NEW_EH + spin_lock_irqsave(&hd->ioc->FreeQlock, flags); + if (hd->tmPending) { + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + return; + } else + hd->tmPending = 1; + spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); + + if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS, + 0, 0, 0, NO_SLEEP) < 0) { + printk(MYIOC_s_WARN_FMT "TM FAILED!\n", hd->ioc->name); + } +#else + ddvtprintk((MYIOC_s_NOTE_FMT "DV Cmd Timeout: NoOp\n", hd->ioc->name)); +#endif + } else { + /* Perform a FW reload */ + if (mpt_HardResetHandler(hd->ioc, NO_SLEEP) < 0) { + printk(MYIOC_s_WARN_FMT "Firmware Reload FAILED!\n", hd->ioc->name); + } + } + } else { + /* This should NEVER happen */ + printk(MYIOC_s_WARN_FMT "Null cmdPtr!!!!\n", hd->ioc->name); + } + + /* No more processing. + * TM call will generate an interrupt for SCSI TM Management. + * The FW will reply to all outstanding commands, callback will finish cleanup. + * Hard reset clean-up will free all resources. + */ + ddvprintk((MYIOC_s_WARN_FMT "Timer Expired Complete!\n", hd->ioc->name)); + + return; +} + +#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptscsih_do_raid - Format and Issue a RAID volume request message. + * @hd: Pointer to scsi host structure + * @action: What do be done. + * @id: Logical target id. + * @bus: Target locations bus. + * + * Returns: < 0 on a fatal error + * 0 on success + * + * Remark: Wait to return until reply processed by the ISR. + */ +static int +mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io) +{ + MpiRaidActionRequest_t *pReq; + MPT_FRAME_HDR *mf; + MptSge_t *psge; + int flagsLength; + int in_isr; + + in_isr = in_interrupt(); + if (in_isr) { + dprintk((MYIOC_s_WARN_FMT "Internal raid request not allowed in ISR context!\n", + hd->ioc->name)); + return -EPERM; + } + + /* Get and Populate a free Frame + */ + if ((mf = mpt_get_msg_frame(ScsiScanDvCtx, hd->ioc->id)) == NULL) { + ddvprintk((MYIOC_s_WARN_FMT "_do_raid: no msg frames!\n", + hd->ioc->name)); + return -EAGAIN; + } + pReq = (MpiRaidActionRequest_t *)mf; + pReq->Action = action; + pReq->Reserved1 = 0; + pReq->ChainOffset = 0; + pReq->Function = MPI_FUNCTION_RAID_ACTION; + pReq->VolumeID = io->id; + pReq->VolumeBus = io->bus; + pReq->PhysDiskNum = io->physDiskNum; + pReq->MsgFlags = 0; + pReq->Reserved2 = 0; + pReq->ActionDataWord = 0; /* Reserved for this action */ + //pReq->ActionDataSGE = 0; + + psge = (MptSge_t *) &pReq->ActionDataSGE; + + /* Add a SGE to the config request. + */ + flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ | 0; + + psge->FlagsLength = cpu_to_le32(flagsLength); + cpu_to_leXX( (dma_addr_t) -1, psge->Address); + + ddvprintk((MYIOC_s_INFO_FMT "RAID Volume action %x id %d\n", + hd->ioc->name, action, io->id)); + + hd->pLocal = NULL; + hd->timer.expires = jiffies + HZ*2; /* 2 second timeout */ + scandv_wait_done = 0; + + /* Save cmd pointer, for resource free if timeout or + * FW reload occurs + */ + hd->cmdPtr = mf; + + add_timer(&hd->timer); + mptscsih_put_msgframe(ScsiScanDvCtx, hd->ioc->id, mf); + wait_event(scandv_waitq, scandv_wait_done); + + if ((hd->pLocal == NULL) || (hd->pLocal->completion != MPT_SCANDV_GOOD)) + return -1; + + return 0; +} +#endif /* ~MPTSCSIH_DISABLE_DOMAIN_VALIDATION */ + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/** + * mptscsih_do_cmd - Do internal command. + * @hd: MPT_SCSI_HOST pointer + * @io: INTERNAL_CMD pointer. + * + * Issue the specified internally generated command and do command + * specific cleanup. For bus scan / DV only. + * NOTES: If command is Inquiry and status is good, + * initialize a target structure, save the data + * + * Remark: Single threaded access only. + * + * Return: + * < 0 if an illegal command or no resources + * + * 0 if good + * + * > 0 if command complete but some type of completion error. + */ +static int +mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io) +{ + MPT_FRAME_HDR *mf; + MptSge_t *mpisge; + SCSIIORequest_t *pScsiReq; + SCSIIORequest_t ReqCopy; + int my_idx, ii, dir; + int rc, cmdTimeout; + int in_isr; + char cmdLen; + char CDB[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + char cmd = io->cmd; + + in_isr = in_interrupt(); + if (in_isr) { + dprintk((MYIOC_s_WARN_FMT "Internal SCSI IO request not allowed in ISR context!\n", + hd->ioc->name)); + return -EPERM; + } + + + /* Set command specific information + */ + switch (cmd) { + case CMD_Inquiry: + cmdLen = 6; + dir = MPI_SCSIIO_CONTROL_READ; + CDB[0] = cmd; + CDB[4] = io->size; + cmdTimeout = 10; + break; + + case CMD_TestUnitReady: + cmdLen = 6; + dir = MPI_SCSIIO_CONTROL_READ; + cmdTimeout = 10; + break; + + case CMD_StartStopUnit: + cmdLen = 6; + dir = MPI_SCSIIO_CONTROL_READ; + CDB[0] = cmd; + CDB[4] = 1; /*Spin up the disk */ + cmdTimeout = 15; + break; + + case CMD_ReadBuffer: + cmdLen = 10; + dir = MPI_SCSIIO_CONTROL_READ; + CDB[0] = cmd; + if (io->flags & MPT_ICFLAG_ECHO) { + CDB[1] = 0x0A; + } else { + CDB[1] = 0x02; + } + + if (io->flags & MPT_ICFLAG_BUF_CAP) { + CDB[1] |= 0x01; + } + CDB[6] = (io->size >> 16) & 0xFF; + CDB[7] = (io->size >> 8) & 0xFF; + CDB[8] = io->size & 0xFF; + cmdTimeout = 10; + break; + + case CMD_WriteBuffer: + cmdLen = 10; + dir = MPI_SCSIIO_CONTROL_WRITE; + CDB[0] = cmd; + if (io->flags & MPT_ICFLAG_ECHO) { + CDB[1] = 0x0A; + } else { + CDB[1] = 0x02; + } + CDB[6] = (io->size >> 16) & 0xFF; + CDB[7] = (io->size >> 8) & 0xFF; + CDB[8] = io->size & 0xFF; + cmdTimeout = 10; + break; + + case CMD_Reserve6: + cmdLen = 6; + dir = MPI_SCSIIO_CONTROL_READ; + CDB[0] = cmd; + cmdTimeout = 10; + break; + + case CMD_Release6: + cmdLen = 6; + dir = MPI_SCSIIO_CONTROL_READ; + CDB[0] = cmd; + cmdTimeout = 10; + break; + + case CMD_SynchronizeCache: + cmdLen = 10; + dir = MPI_SCSIIO_CONTROL_READ; + CDB[0] = cmd; +// CDB[1] = 0x02; /* set immediate bit */ + cmdTimeout = 10; + break; + + default: + /* Error Case */ + return -EFAULT; + } + + /* Get and Populate a free Frame + */ + if ((mf = mpt_get_msg_frame(ScsiScanDvCtx, hd->ioc->id)) == NULL) { + ddvprintk((MYIOC_s_WARN_FMT "No msg frames!\n", + hd->ioc->name)); + return -EBUSY; + } + + pScsiReq = (SCSIIORequest_t *) mf; + + /* Get the request index */ + my_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); + ADD_INDEX_LOG(my_idx); /* for debug */ + + if (io->flags & MPT_ICFLAG_PHYS_DISK) { + pScsiReq->TargetID = io->physDiskNum; + pScsiReq->Bus = 0; + pScsiReq->ChainOffset = 0; + pScsiReq->Function = MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH; + } else { + pScsiReq->TargetID = io->id; + pScsiReq->Bus = io->bus; + pScsiReq->ChainOffset = 0; + pScsiReq->Function = MPI_FUNCTION_SCSI_IO_REQUEST; + } + + pScsiReq->CDBLength = cmdLen; + pScsiReq->SenseBufferLength = MPT_SENSE_BUFFER_SIZE; + + pScsiReq->Reserved = 0; + + pScsiReq->MsgFlags = MPT_SCSIIO_MSG_FLAGS; + /* MsgContext set in mpt_get_msg_fram call */ + + for (ii=0; ii < 8; ii++) + pScsiReq->LUN[ii] = 0; + pScsiReq->LUN[1] = io->lun; + + if (io->flags & MPT_ICFLAG_TAGGED_CMD) + pScsiReq->Control = cpu_to_le32(dir | MPI_SCSIIO_CONTROL_SIMPLEQ); + else + pScsiReq->Control = cpu_to_le32(dir | MPI_SCSIIO_CONTROL_UNTAGGED); + + for (ii=0; ii < 16; ii++) + pScsiReq->CDB[ii] = CDB[ii]; + + pScsiReq->DataLength = cpu_to_le32(io->size); + pScsiReq->SenseBufferLowAddr = cpu_to_le32(hd->ioc->sense_buf_low_dma + + (my_idx * MPT_SENSE_BUFFER_ALLOC)); + + ddvprintk((MYIOC_s_INFO_FMT "Sending Command 0x%x for (%d:%d:%d)\n", + hd->ioc->name, cmd, io->bus, io->id, io->lun)); + + /* 32 bit SG only */ + mpisge = (MptSge_t *) &pScsiReq->SGL; + + if (dir == MPI_SCSIIO_CONTROL_READ) { + mpisge->FlagsLength = cpu_to_le32( + MPT_SGE_FLAGS_SSIMPLE_READ | io->size); + } else { + mpisge->FlagsLength = cpu_to_le32( + MPT_SGE_FLAGS_SSIMPLE_WRITE | io->size); + } + + /* data_dma defaults to -1 + */ + cpu_to_leXX(io->data_dma, mpisge->Address); + + /* The ISR will free the request frame, but we need + * the information to initialize the target. Duplicate. + */ + memcpy(&ReqCopy, pScsiReq, sizeof(SCSIIORequest_t)); + + /* Issue this command after: + * finish init + * add timer + * Wait until the reply has been received + * ScsiScanDvCtx callback function will + * set hd->pLocal; + * set scandv_wait_done and call wake_up + */ + hd->pLocal = NULL; + hd->timer.expires = jiffies + HZ*cmdTimeout; + scandv_wait_done = 0; + + /* Save cmd pointer, for resource free if timeout or + * FW reload occurs + */ + hd->cmdPtr = mf; + + add_timer(&hd->timer); + mptscsih_put_msgframe(ScsiScanDvCtx, hd->ioc->id, mf); + wait_event(scandv_waitq, scandv_wait_done); + + if (hd->pLocal) { + rc = hd->pLocal->completion; + hd->pLocal->skip = 0; + + /* Always set fatal error codes in some cases. + */ + if (rc == MPT_SCANDV_SELECTION_TIMEOUT) + rc = -ENXIO; + else if (rc == MPT_SCANDV_SOME_ERROR) + rc = -rc; + } else { + rc = -EFAULT; + /* This should never happen. */ + ddvprintk((MYIOC_s_INFO_FMT "_do_cmd: Null pLocal!!!\n", + hd->ioc->name)); + } + + return rc; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/** + * mptscsih_synchronize_cache - Send SYNCHRONIZE_CACHE to all disks. + * @hd: Pointer to MPT_SCSI_HOST structure + * @portnum: IOC port number + * + * Uses the ISR, but with special processing. + * MUST be single-threaded. + * + * Return: 0 on completion + */ +static int +mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum) +{ + MPT_ADAPTER *ioc= hd->ioc; + VirtDevice *pTarget = NULL; + SCSIDevicePage1_t *pcfg1Data = NULL; + INTERNAL_CMD iocmd; + CONFIGPARMS cfg; + dma_addr_t cfg1_dma_addr = -1; + ConfigPageHeader_t header1; + int bus = 0; + int id = 0; + int lun = 0; + int hostId = ioc->pfacts[portnum].PortSCSIID; + int max_id; + int requested, configuration, data; + int doConfig = 0; + u8 flags, factor; + + max_id = ioc->sh->max_id - 1; + + /* Following parameters will not change + * in this routine. + */ + iocmd.cmd = CMD_SynchronizeCache; + iocmd.flags = 0; + iocmd.physDiskNum = -1; + iocmd.data = NULL; + iocmd.data_dma = -1; + iocmd.size = 0; + iocmd.rsvd = iocmd.rsvd2 = 0; + + /* No SCSI hosts + */ + if (hd->Targets == NULL) + return 0; + + /* Skip the host + */ + if (id == hostId) + id++; + + /* Write SDP1 for all SCSI devices + * Alloc memory and set up config buffer + */ + if (hd->is_spi) { + if (ioc->spi_data.sdp1length > 0) { + pcfg1Data = (SCSIDevicePage1_t *)pci_alloc_consistent(ioc->pcidev, + ioc->spi_data.sdp1length * 4, &cfg1_dma_addr); + + if (pcfg1Data != NULL) { + doConfig = 1; + header1.PageVersion = ioc->spi_data.sdp1version; + header1.PageLength = ioc->spi_data.sdp1length; + header1.PageNumber = 1; + header1.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; + cfg.hdr = &header1; + cfg.physAddr = cfg1_dma_addr; + cfg.action = MPI_CONFIG_ACTION_PAGE_WRITE_CURRENT; + cfg.dir = 1; + cfg.timeout = 0; + } + } + } + + /* loop through all devices on this port + */ + while (bus < MPT_MAX_BUS) { + iocmd.bus = bus; + iocmd.id = id; + pTarget = hd->Targets[(int)id]; + + if (doConfig) { + + /* Set the negotiation flags */ + if (pTarget && (pTarget = hd->Targets[id]) && !pTarget->raidVolume) { + flags = pTarget->negoFlags; + } else { + flags = 0; + if (hd->ioc->spi_data.nvram && (hd->ioc->spi_data.nvram[id] != MPT_HOST_NVRAM_INVALID)) { + data = hd->ioc->spi_data.nvram[id]; + + if (data & MPT_NVRAM_WIDE_DISABLE) + flags |= MPT_TARGET_NO_NEGO_WIDE; + + factor = (data & MPT_NVRAM_SYNC_MASK) >> MPT_NVRAM_SYNC_SHIFT; + if ((factor == 0) || (factor == MPT_ASYNC)) + flags |= MPT_TARGET_NO_NEGO_SYNC; + } + } + + /* Force to async, narrow */ + mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0, &requested, + &configuration, flags); + pcfg1Data->RequestedParameters = le32_to_cpu(requested); + pcfg1Data->Reserved = 0; + pcfg1Data->Configuration = le32_to_cpu(configuration); + cfg.pageAddr = (bus<<8) | id; + mpt_config(hd->ioc, &cfg); + } + + /* If target Ptr NULL or if this target is NOT a disk, skip. + */ + // if (pTarget && ((pTarget->inq_data[0] & 0x1F) == 0)) { + if (pTarget) { + for (lun=0; lun <= MPT_LAST_LUN; lun++) { + /* If LUN present, issue the command + */ + if (pTarget->luns & (1< max_id) { + id = 0; + bus++; + } + } + + if (pcfg1Data) { + pci_free_consistent(ioc->pcidev, header1.PageLength * 4, pcfg1Data, cfg1_dma_addr); + } + + return 0; +} + +#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/** + * mptscsih_domainValidation - Top level handler for domain validation. + * @hd: Pointer to MPT_SCSI_HOST structure. + * + * Uses the ISR, but with special processing. + * Called from schedule, should not be in interrupt mode. + * While thread alive, do dv for all devices needing dv + * + * Return: None. + */ +static void +mptscsih_domainValidation(void *arg) +{ + MPT_SCSI_HOST *hd = NULL; + MPT_ADAPTER *ioc = NULL; + unsigned long flags; + int id, maxid, dvStatus, did; + int ii, isPhysDisk; + + spin_lock_irqsave(&dvtaskQ_lock, flags); + dvtaskQ_active = 1; + if (dvtaskQ_release) { + dvtaskQ_active = 0; + spin_unlock_irqrestore(&dvtaskQ_lock, flags); + return; + } + spin_unlock_irqrestore(&dvtaskQ_lock, flags); + + /* For this ioc, loop through all devices and do dv to each device. + * When complete with this ioc, search through the ioc list, and + * for each scsi ioc found, do dv for all devices. Exit when no + * device needs dv. + */ + did = 1; + while (did) { + did = 0; + for (ioc = mpt_adapter_find_first(); ioc != NULL; ioc = mpt_adapter_find_next(ioc)) { + spin_lock_irqsave(&dvtaskQ_lock, flags); + if (dvtaskQ_release) { + dvtaskQ_active = 0; + spin_unlock_irqrestore(&dvtaskQ_lock, flags); + return; + } + spin_unlock_irqrestore(&dvtaskQ_lock, flags); + + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ/4); + + /* DV only to SCSI adapters */ + if ((int)ioc->chip_type <= (int)FC929) + continue; + + /* Make sure everything looks ok */ + if (ioc->sh == NULL) + continue; + + hd = (MPT_SCSI_HOST *) ioc->sh->hostdata; + if (hd == NULL) + continue; + + maxid = MIN (ioc->sh->max_id, MPT_MAX_SCSI_DEVICES); + + for (id = 0; id < maxid; id++) { + spin_lock_irqsave(&dvtaskQ_lock, flags); + if (dvtaskQ_release) { + dvtaskQ_active = 0; + spin_unlock_irqrestore(&dvtaskQ_lock, flags); + return; + } + spin_unlock_irqrestore(&dvtaskQ_lock, flags); + dvStatus = hd->ioc->spi_data.dvStatus[id]; + + if (dvStatus & MPT_SCSICFG_NEED_DV) { + + hd->ioc->spi_data.dvStatus[id] |= MPT_SCSICFG_DV_PENDING; + hd->ioc->spi_data.dvStatus[id] &= ~MPT_SCSICFG_NEED_DV; + + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ/4); + + /* If hidden phys disk, block IO's to all + * raid volumes + * else, process normally + */ + isPhysDisk = 0; + if (ioc->spi_data.pIocPg3) { + /* Search IOC page 3 to determine if + * this is hidden physical disk + */ + Ioc3PhysDisk_t *pPDisk = ioc->spi_data.pIocPg3->PhysDisk; + int numPDisk = ioc->spi_data.pIocPg3->NumPhysDisks; + + while (numPDisk) { + if (pPDisk->PhysDiskID == id) { + isPhysDisk = 1; + break; + } + pPDisk++; + numPDisk--; + } + } + + if (isPhysDisk) { + for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) { + if (hd->ioc->spi_data.isRaid & (1 << ii)) { + hd->ioc->spi_data.dvStatus[ii] |= MPT_SCSICFG_DV_PENDING; + } + } + } + + mptscsih_doDv(hd, 0, id); + did++; + hd->ioc->spi_data.dvStatus[id] |= MPT_SCSICFG_DV_DONE; + hd->ioc->spi_data.dvStatus[id] &= ~MPT_SCSICFG_DV_PENDING; + + if (isPhysDisk) { + for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) { + if (hd->ioc->spi_data.isRaid & (1 << ii)) { + hd->ioc->spi_data.dvStatus[ii] &= ~MPT_SCSICFG_DV_PENDING; + } + } + } + + /* Post OS IOs that were pended while + * DV running. + */ + post_pendingQ_commands(hd); + } + } + } + } + + spin_lock_irqsave(&dvtaskQ_lock, flags); + dvtaskQ_active = 0; + spin_unlock_irqrestore(&dvtaskQ_lock, flags); + + return; +} + + +#define MPT_GET_NVRAM_VALS 0x01 +#define MPT_UPDATE_MAX 0x02 +#define MPT_SET_MAX 0x04 +#define MPT_SET_MIN 0x08 +#define MPT_FALLBACK 0x10 +#define MPT_SAVE 0x20 + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/** + * mptscsih_doDv - Perform domain validation to a target. + * @hd: Pointer to MPT_SCSI_HOST structure. + * @portnum: IOC port number. + * @target: Physical ID of this target + * + * Uses the ISR, but with special processing. + * MUST be single-threaded. + * Test will exit if target is at async & narrow. + * + * Return: None. + */ +static void +mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id) +{ + MPT_ADAPTER *ioc = hd->ioc; + VirtDevice *pTarget = NULL; + u8 *pbuf1 = NULL; + u8 *pbuf2 = NULL; + dma_addr_t buf1_dma = -1; + dma_addr_t buf2_dma = -1; + ConfigPageHeader_t header1; + SCSIDevicePage1_t *pcfg1Data = NULL; + dma_addr_t cfg1_dma_addr = -1; + ConfigPageHeader_t header0; + SCSIDevicePage0_t *pcfg0Data = NULL; + dma_addr_t cfg0_dma_addr = -1; + DVPARAMETERS dv; + INTERNAL_CMD iocmd; + CONFIGPARMS cfg; + int rc, sz = 0; + int bufsize = 0; + int dataBufSize = 0; + int echoBufSize = 0; + int notDone; + int patt; + int repeat; + char firstPass = 1; + char doFallback = 0; + char readPage0; + char bus, lun; + + if (ioc->spi_data.sdp1length == 0) + return; + + if (ioc->spi_data.sdp0length == 0) + return; + + if (id == ioc->pfacts[portnum].PortSCSIID) + return; + + lun = 0; + bus = 0; + ddvtprintk((MYIOC_s_NOTE_FMT + "DV started: numIOs %d bus=%d, id %d dv @ %p\n", + ioc->name, atomic_read(&queue_depth), bus, id, &dv)); + + /* Prep DV structure + */ + memset (&dv, 0, sizeof(DVPARAMETERS)); + dv.id = id; + + /* Populate tmax with the current maximum + * transfer parameters for this target. + * Exit if narrow and async. + */ + dv.cmd = MPT_GET_NVRAM_VALS; + mptscsih_dv_parms(hd, &dv, NULL); + if ((!dv.max.width) && (!dv.max.offset)) + return; + + /* Prep SCSI IO structure + */ + iocmd.id = id; + iocmd.bus = bus; + iocmd.lun = lun; + iocmd.flags = 0; + iocmd.physDiskNum = -1; + iocmd.rsvd = iocmd.rsvd2 = 0; + + /* Use tagged commands if possible. + */ + pTarget = hd->Targets[id]; + if (pTarget && (pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)) + iocmd.flags |= MPT_ICFLAG_TAGGED_CMD; + + /* Prep cfg structure + */ + cfg.pageAddr = (bus<<8) | id; + cfg.hdr = NULL; + + /* Prep SDP0 header + */ + header0.PageVersion = ioc->spi_data.sdp0version; + header0.PageLength = ioc->spi_data.sdp0length; + header0.PageNumber = 0; + header0.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; + pcfg0Data = (SCSIDevicePage0_t *)pci_alloc_consistent(ioc->pcidev, + header0.PageLength * 4, &cfg0_dma_addr); + if (!pcfg0Data) + return; + + /* Prep SDP1 header + */ + header1.PageVersion = ioc->spi_data.sdp1version; + header1.PageLength = ioc->spi_data.sdp1length; + header1.PageNumber = 1; + header1.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; + pcfg1Data = (SCSIDevicePage1_t *)pci_alloc_consistent(ioc->pcidev, + header1.PageLength * 4, &cfg1_dma_addr); + if (!pcfg1Data) + goto target_done; + + /* Skip this ID? Set cfg.hdr to force config page write + */ + if ((ioc->spi_data.nvram[id] != MPT_HOST_NVRAM_INVALID) && + (!(ioc->spi_data.nvram[id] & MPT_NVRAM_ID_SCAN_ENABLE))) { + + ddvprintk((MYIOC_s_NOTE_FMT "DV Skipped: bus, id, lun (%d, %d, %d)\n", + ioc->name, bus, id, lun)); + + dv.cmd = MPT_SET_MAX; + mptscsih_dv_parms(hd, &dv, (void *)pcfg1Data); + cfg.hdr = &header1; + goto target_done; + } + + /* Finish iocmd inititialization - hidden or visible disk? */ + if (ioc->spi_data.pIocPg3) { + /* Searc IOC page 3 for matching id + */ + Ioc3PhysDisk_t *pPDisk = ioc->spi_data.pIocPg3->PhysDisk; + int numPDisk = ioc->spi_data.pIocPg3->NumPhysDisks; + + while (numPDisk) { + if (pPDisk->PhysDiskID == id) { + /* match */ + iocmd.flags |= MPT_ICFLAG_PHYS_DISK; + iocmd.physDiskNum = pPDisk->PhysDiskNum; + + /* Quiesce the IM + */ + if (mptscsih_do_raid(hd, MPI_RAID_ACTION_QUIESCE_PHYS_IO, &iocmd) < 0) { + ddvprintk((MYIOC_s_ERR_FMT "RAID Queisce FAILED!\n", ioc->name)); + goto target_done; + } + break; + } + pPDisk++; + numPDisk--; + } + } + + /* RAID Volume ID's may double for a physical device. If RAID but + * not a physical ID as well, skip DV. + */ + if ((hd->ioc->spi_data.isRaid & (1 << id)) && !(iocmd.flags & MPT_ICFLAG_PHYS_DISK)) + goto target_done; + + + /* Basic Test. + * Async & Narrow - Inquiry + * Async & Narrow - Inquiry + * Maximum transfer rate - Inquiry + * Compare buffers: + * If compare, test complete. + * If miscompare and first pass, repeat + * If miscompare and not first pass, fall back and repeat + */ + hd->pLocal = NULL; + readPage0 = 0; + sz = SCSI_STD_INQUIRY_BYTES; + pbuf1 = pci_alloc_consistent(ioc->pcidev, sz, &buf1_dma); + pbuf2 = pci_alloc_consistent(ioc->pcidev, sz, &buf2_dma); + if (!pbuf1 || !pbuf2) + goto target_done; + + while (1) { + ddvprintk((MYIOC_s_NOTE_FMT "DV: Start Basic test.\n", ioc->name)); + dv.cmd = MPT_SET_MIN; + mptscsih_dv_parms(hd, &dv, (void *)pcfg1Data); + + cfg.hdr = &header1; + cfg.physAddr = cfg1_dma_addr; + cfg.action = MPI_CONFIG_ACTION_PAGE_WRITE_CURRENT; + cfg.dir = 1; + if (mpt_config(hd->ioc, &cfg) != 0) + goto target_done; + + iocmd.cmd = CMD_Inquiry; + iocmd.data_dma = buf1_dma; + iocmd.data = pbuf1; + iocmd.size = sz; + if (mptscsih_do_cmd(hd, &iocmd) < 0) + goto target_done; + + /* Another GEM workaround. Check peripheral device type, + * if PROCESSOR, quit DV. + */ + if (((pbuf1[0] & 0x1F) == 0x03) || ((pbuf1[0] & 0x1F) > 0x08)) + goto target_done; + + if (mptscsih_do_cmd(hd, &iocmd) < 0) + goto target_done; + + if (doFallback) + dv.cmd = MPT_FALLBACK; + else + dv.cmd = MPT_SET_MAX; + + mptscsih_dv_parms(hd, &dv, (void *)pcfg1Data); + if (mpt_config(hd->ioc, &cfg) != 0) + goto target_done; + + if ((!dv.now.width) && (!dv.now.offset)) + goto target_done; + + iocmd.cmd = CMD_Inquiry; + iocmd.data_dma = buf2_dma; + iocmd.data = pbuf2; + iocmd.size = sz; + if (mptscsih_do_cmd(hd, &iocmd) < 0) + goto target_done; + else if (hd->pLocal == NULL) + goto target_done; + else { + /* Save the return code. + * If this is the first pass, + * read SCSI Device Page 0 + * and update the target max parameters. + */ + rc = hd->pLocal->completion; + doFallback = 0; + if (rc == MPT_SCANDV_GOOD) { + if (!readPage0) { + u32 sdp0_info; + u32 sdp0_nego; + + cfg.hdr = &header0; + cfg.physAddr = cfg0_dma_addr; + cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; + cfg.dir = 0; + if (mpt_config(hd->ioc, &cfg) != 0) + goto target_done; + + sdp0_info = le32_to_cpu(pcfg0Data->Information) & 0x0E; + sdp0_nego = (le32_to_cpu(pcfg0Data->NegotiatedParameters) & 0xFF00 ) >> 8; + + /* Quantum and Fujitsu workarounds. + * Quantum: PPR U320 -> PPR reply with Ultra2 and wide + * Fujitsu: PPR U320 -> Msg Reject and Ultra2 and wide + * Resetart with a request for U160. + */ + if ((dv.now.factor == MPT_ULTRA320) && (sdp0_nego == MPT_ULTRA2)) { + doFallback = 1; + } else { + dv.cmd = MPT_UPDATE_MAX; + mptscsih_dv_parms(hd, &dv, (void *)pcfg0Data); + /* Update the SCSI device page 1 area + */ + pcfg1Data->RequestedParameters = pcfg0Data->NegotiatedParameters; + readPage0 = 1; + } + } + + /* Quantum workaround. Restart this test will the fallback + * flag set. + */ + if (doFallback == 0) { + if (memcmp(pbuf1, pbuf2, sz) != 0) { + if (!firstPass) + doFallback = 1; + } else + break; /* test complete */ + } + + + } else if ((rc == MPT_SCANDV_DID_RESET) || (rc == MPT_SCANDV_SENSE)) + doFallback = 1; /* set fallback flag */ + else + goto target_done; + + firstPass = 0; + } + } + /* Free pbuf2, but use pbuf1 for + * acquiring the (echo) buffer size. + */ + pci_free_consistent(ioc->pcidev, sz, pbuf2, buf2_dma); + pbuf2 = NULL; + ddvprintk((MYIOC_s_NOTE_FMT "DV: Basic test completed OK.\n", ioc->name)); + + /* Start the Enhanced Test. + * 0) issue TUR to clear out check conditions + * 1) read capacity of echo (regular) buffer + * 2) reserve device + * 3) do write-read-compare data pattern test + * 4) release + * 5) update nego parms to target struct + */ + cfg.hdr = &header1; + cfg.physAddr = cfg1_dma_addr; + cfg.action = MPI_CONFIG_ACTION_PAGE_WRITE_CURRENT; + cfg.dir = 1; + + iocmd.cmd = CMD_TestUnitReady; + iocmd.data_dma = -1; + iocmd.data = NULL; + iocmd.size = 0; + notDone = 1; + while (notDone) { + if (mptscsih_do_cmd(hd, &iocmd) < 0) + goto target_done; + + if (hd->pLocal == NULL) + goto target_done; + + rc = hd->pLocal->completion; + if (rc == MPT_SCANDV_GOOD) + notDone = 0; + else if (rc == MPT_SCANDV_SENSE) { + u8 skey = hd->pLocal->sense[2] & 0x0F; + u8 asc = hd->pLocal->sense[12]; + u8 ascq = hd->pLocal->sense[13]; + ddvprintk((MYIOC_s_INFO_FMT + "SenseKey:ASC:ASCQ = (%x:%02x:%02x)\n", + ioc->name, skey, asc, ascq)); + + if (skey == SK_UNIT_ATTENTION) + notDone++; /* repeat */ + else if ((skey == SK_NOT_READY) && + (asc == 0x04)&&(ascq == 0x01)) { + /* wait then repeat */ + mdelay (2000); + notDone++; + } else if ((skey == SK_NOT_READY) && (asc == 0x3A)) { + /* no medium, try read test anyway */ + notDone = 0; + } else { + /* All other errors are fatal. + */ + ddvprintk((MYIOC_s_INFO_FMT "DV: fatal error.", + ioc->name)); + goto target_done; + } + } else + goto target_done; + } + + iocmd.cmd = CMD_ReadBuffer; + iocmd.data_dma = buf1_dma; + iocmd.data = pbuf1; + iocmd.size = 4; + iocmd.flags |= MPT_ICFLAG_BUF_CAP; + + dataBufSize = 0; + echoBufSize = 0; + for (patt = 0; patt < 2; patt++) { + if (patt == 0) + iocmd.flags |= MPT_ICFLAG_ECHO; + else + iocmd.flags &= ~MPT_ICFLAG_ECHO; + + notDone = 1; + while (notDone) { + bufsize = 0; + + /* If not ready after 8 trials, + * give up on this device. + */ + if (notDone > 8) + goto target_done; + + if (mptscsih_do_cmd(hd, &iocmd) < 0) + goto target_done; + else if (hd->pLocal == NULL) + goto target_done; + else { + rc = hd->pLocal->completion; + ddvprintk(("ReadBuffer Comp Code %d", rc)); + ddvprintk((" buff: %0x %0x %0x %0x\n", + pbuf1[0], pbuf1[1], pbuf1[2], pbuf1[3])); + + if (rc == MPT_SCANDV_GOOD) { + notDone = 0; + if (iocmd.flags & MPT_ICFLAG_ECHO) { + bufsize = ((pbuf1[2] & 0x1F) <<8) | pbuf1[3]; + } else { + bufsize = pbuf1[1]<<16 | pbuf1[2]<<8 | pbuf1[3]; + } + } else if (rc == MPT_SCANDV_SENSE) { + u8 skey = hd->pLocal->sense[2] & 0x0F; + u8 asc = hd->pLocal->sense[12]; + u8 ascq = hd->pLocal->sense[13]; + ddvprintk((MYIOC_s_INFO_FMT + "SenseKey:ASC:ASCQ = (%x:%02x:%02x)\n", + ioc->name, skey, asc, ascq)); + if (skey == SK_ILLEGAL_REQUEST) { + notDone = 0; + } else if (skey == SK_UNIT_ATTENTION) { + notDone++; /* repeat */ + } else if ((skey == SK_NOT_READY) && + (asc == 0x04)&&(ascq == 0x01)) { + /* wait then repeat */ + mdelay (2000); + notDone++; + } else { + /* All other errors are fatal. + */ + ddvprintk((MYIOC_s_INFO_FMT "DV: fatal error.", + ioc->name)); + goto target_done; + } + } else { + /* All other errors are fatal + */ + goto target_done; + } + } + } + + if (iocmd.flags & MPT_ICFLAG_ECHO) + echoBufSize = bufsize; + else + dataBufSize = bufsize; + } + pci_free_consistent(ioc->pcidev, sz, pbuf1, buf1_dma); + pbuf1 = NULL; + sz = 0; + iocmd.flags &= ~MPT_ICFLAG_BUF_CAP; + + /* Use echo buffers if possible, + * Exit if both buffers are 0. + */ + if (echoBufSize > 0) { + iocmd.flags |= MPT_ICFLAG_ECHO; + if (dataBufSize > 0) + bufsize = MIN(echoBufSize, dataBufSize); + else + bufsize = echoBufSize; + } else if (dataBufSize == 0) + goto target_done; + + ddvprintk((MYIOC_s_INFO_FMT "%s Buffer Capacity %d\n", ioc->name, + (iocmd.flags & MPT_ICFLAG_ECHO) ? "Echo" : " ", bufsize)); + + /* Allocate data buffers for write-read-compare test. + */ + sz = MIN(bufsize, 1024); + pbuf1 = pci_alloc_consistent(ioc->pcidev, sz, &buf1_dma); + pbuf2 = pci_alloc_consistent(ioc->pcidev, sz, &buf2_dma); + if (!pbuf1 || !pbuf2) + goto target_done; + + /* --- loop ---- + * On first pass, always issue a reserve. + * On additional loops, only if a reset has occurred. + * iocmd.flags indicates if echo or regular buffer + */ + for (patt = 0; patt < 4; patt++) { + ddvprintk(("Pattern %d\n", patt)); + if ((iocmd.flags & MPT_ICFLAG_RESERVED) && (iocmd.flags & MPT_ICFLAG_DID_RESET)) { + iocmd.cmd = CMD_TestUnitReady; + iocmd.data_dma = -1; + iocmd.data = NULL; + iocmd.size = 0; + if (mptscsih_do_cmd(hd, &iocmd) < 0) + goto target_done; + + iocmd.cmd = CMD_Release6; + iocmd.data_dma = -1; + iocmd.data = NULL; + iocmd.size = 0; + if (mptscsih_do_cmd(hd, &iocmd) < 0) + goto target_done; + else if (hd->pLocal == NULL) + goto target_done; + else { + rc = hd->pLocal->completion; + ddvprintk(("Release rc %d\n", rc)); + if (rc == MPT_SCANDV_GOOD) + iocmd.flags &= ~MPT_ICFLAG_RESERVED; + else + goto target_done; + } + iocmd.flags &= ~MPT_ICFLAG_RESERVED; + } + iocmd.flags &= ~MPT_ICFLAG_DID_RESET; + + repeat = 5; + while (repeat && (!(iocmd.flags & MPT_ICFLAG_RESERVED))) { + iocmd.cmd = CMD_Reserve6; + iocmd.data_dma = -1; + iocmd.data = NULL; + iocmd.size = 0; + if (mptscsih_do_cmd(hd, &iocmd) < 0) + goto target_done; + else if (hd->pLocal == NULL) + goto target_done; + else { + rc = hd->pLocal->completion; + if (rc == MPT_SCANDV_GOOD) { + iocmd.flags |= MPT_ICFLAG_RESERVED; + } else if (rc == MPT_SCANDV_SENSE) { + /* Wait if coming ready + */ + u8 skey = hd->pLocal->sense[2] & 0x0F; + u8 asc = hd->pLocal->sense[12]; + u8 ascq = hd->pLocal->sense[13]; + ddvprintk((MYIOC_s_INFO_FMT + "DV: Reserve Failed: ", ioc->name)); + ddvprintk(("SenseKey:ASC:ASCQ = (%x:%02x:%02x)\n", + skey, asc, ascq)); + + if ((skey == SK_NOT_READY) && (asc == 0x04)&& + (ascq == 0x01)) { + /* wait then repeat */ + mdelay (2000); + notDone++; + } else { + ddvprintk((MYIOC_s_INFO_FMT + "DV: Reserved Failed.", ioc->name)); + goto target_done; + } + } else { + ddvprintk((MYIOC_s_INFO_FMT "DV: Reserved Failed.", + ioc->name)); + goto target_done; + } + } + } + + mptscsih_fillbuf(pbuf1, sz, patt, 1); + iocmd.cmd = CMD_WriteBuffer; + iocmd.data_dma = buf1_dma; + iocmd.data = pbuf1; + iocmd.size = sz; + if (mptscsih_do_cmd(hd, &iocmd) < 0) + goto target_done; + else if (hd->pLocal == NULL) + goto target_done; + else { + rc = hd->pLocal->completion; + if (rc == MPT_SCANDV_GOOD) + ; /* Issue read buffer */ + else if (rc == MPT_SCANDV_DID_RESET) { + /* If using echo buffers, reset to data buffers. + * Else do Fallback and restart + * this test (re-issue reserve + * because of bus reset). + */ + if ((iocmd.flags & MPT_ICFLAG_ECHO) && (dataBufSize >= bufsize)) { + iocmd.flags &= ~MPT_ICFLAG_ECHO; + } else { + dv.cmd = MPT_FALLBACK; + mptscsih_dv_parms(hd, &dv, (void *)pcfg1Data); + + if (mpt_config(hd->ioc, &cfg) != 0) + goto target_done; + + if ((!dv.now.width) && (!dv.now.offset)) + goto target_done; + } + + iocmd.flags |= MPT_ICFLAG_DID_RESET; + patt = -1; + continue; + } else if (rc == MPT_SCANDV_SENSE) { + /* Restart data test if UA, else quit. + */ + u8 skey = hd->pLocal->sense[2] & 0x0F; + ddvprintk((MYIOC_s_INFO_FMT + "SenseKey:ASC:ASCQ = (%x:%02x:%02x)\n", ioc->name, skey, + hd->pLocal->sense[12], hd->pLocal->sense[13])); + if (skey == SK_UNIT_ATTENTION) { + patt = -1; + continue; + } else if (skey == SK_ILLEGAL_REQUEST) { + if (iocmd.flags & MPT_ICFLAG_ECHO) { + if (dataBufSize >= bufsize) { + iocmd.flags &= ~MPT_ICFLAG_ECHO; + patt = -1; + continue; + } + } + goto target_done; + } + else + goto target_done; + } else { + /* fatal error */ + goto target_done; + } + } + + iocmd.cmd = CMD_ReadBuffer; + iocmd.data_dma = buf2_dma; + iocmd.data = pbuf2; + iocmd.size = sz; + if (mptscsih_do_cmd(hd, &iocmd) < 0) + goto target_done; + else if (hd->pLocal == NULL) + goto target_done; + else { + rc = hd->pLocal->completion; + if (rc == MPT_SCANDV_GOOD) { + /* If buffers compare, + * go to next pattern, + * else, do a fallback and restart + * data transfer test. + */ + if (memcmp (pbuf1, pbuf2, sz) == 0) { + ; /* goto next pattern */ + } else { + /* Miscompare with Echo buffer, go to data buffer, + * if that buffer exists. + * Miscompare with Data buffer, check first 4 bytes, + * some devices return capacity. Exit in this case. + */ + if (iocmd.flags & MPT_ICFLAG_ECHO) { + if (dataBufSize >= bufsize) + iocmd.flags &= ~MPT_ICFLAG_ECHO; + else + goto target_done; + } else { + if (dataBufSize == (pbuf2[1]<<16 | pbuf2[2]<<8 | pbuf2[3])) { + /* Argh. Device returning wrong data. + * Quit DV for this device. + */ + goto target_done; + } + + /* Had an actual miscompare. Slow down.*/ + dv.cmd = MPT_FALLBACK; + mptscsih_dv_parms(hd, &dv, (void *)pcfg1Data); + + if (mpt_config(hd->ioc, &cfg) != 0) + goto target_done; + + if ((!dv.now.width) && (!dv.now.offset)) + goto target_done; + } + + patt = -1; + continue; + } + } else if (rc == MPT_SCANDV_DID_RESET) { + /* Do Fallback and restart + * this test (re-issue reserve + * because of bus reset). + */ + dv.cmd = MPT_FALLBACK; + mptscsih_dv_parms(hd, &dv, (void *)pcfg1Data); + + if (mpt_config(hd->ioc, &cfg) != 0) + goto target_done; + + if ((!dv.now.width) && (!dv.now.offset)) + goto target_done; + + iocmd.flags |= MPT_ICFLAG_DID_RESET; + patt = -1; + continue; + } else if (rc == MPT_SCANDV_SENSE) { + /* Restart data test if UA, else quit. + */ + u8 skey = hd->pLocal->sense[2] & 0x0F; + ddvprintk((MYIOC_s_INFO_FMT + "SenseKey:ASC:ASCQ = (%x:%02x:%02x)\n", ioc->name, skey, + hd->pLocal->sense[12], hd->pLocal->sense[13])); + if (skey == SK_UNIT_ATTENTION) { + patt = -1; + continue; + } + else + goto target_done; + } else { + /* fatal error */ + goto target_done; + } + } + + } /* --- end of patt loop ---- */ + +target_done: + if (iocmd.flags & MPT_ICFLAG_RESERVED) { + iocmd.cmd = CMD_Release6; + iocmd.data_dma = -1; + iocmd.data = NULL; + iocmd.size = 0; + if (mptscsih_do_cmd(hd, &iocmd) < 0) + printk(MYIOC_s_INFO_FMT "DV: Release failed. id %d", + ioc->name, id); + else if (hd->pLocal) { + if (hd->pLocal->completion == MPT_SCANDV_GOOD) + iocmd.flags &= ~MPT_ICFLAG_RESERVED; + } else { + printk(MYIOC_s_INFO_FMT "DV: Release failed. id %d", + ioc->name, id); + } + } + + + /* Set if cfg1_dma_addr contents is valid + */ + if (cfg.hdr != NULL) { + dv.cmd = MPT_SAVE; + mptscsih_dv_parms(hd, &dv, (void *)pcfg1Data); + + /* Save the final negotiated settings to + * SCSI device page 1. + */ + cfg.hdr = &header1; + cfg.physAddr = cfg1_dma_addr; + cfg.action = MPI_CONFIG_ACTION_PAGE_WRITE_CURRENT; + cfg.dir = 1; + mpt_config(hd->ioc, &cfg); + } + + /* If this is a RAID Passthrough, enable internal IOs + */ + if (iocmd.flags & MPT_ICFLAG_PHYS_DISK) { + if (mptscsih_do_raid(hd, MPI_RAID_ACTION_ENABLE_PHYS_IO, &iocmd) < 0) + ddvprintk((MYIOC_s_ERR_FMT "RAID Queisce FAILED!\n", ioc->name)); + } + + /* Done with the DV scan of the current target + */ + if (pcfg0Data) { + pci_free_consistent(ioc->pcidev, header0.PageLength * 4, + pcfg0Data, cfg0_dma_addr); + } + + if (pcfg1Data) { + pci_free_consistent(ioc->pcidev, header1.PageLength * 4, + pcfg1Data, cfg1_dma_addr); + } + + if (pbuf1) { + pci_free_consistent(ioc->pcidev, sz, pbuf1, buf1_dma); + pbuf1 = NULL; + } + + if (pbuf2) { + pci_free_consistent(ioc->pcidev, sz, pbuf2, buf2_dma); + pbuf2 = NULL; + } + + ddvtprintk((MYIOC_s_INFO_FMT "DV Done. IOs outstanding = %d\n", + ioc->name, atomic_read(&queue_depth))); + + return; +} + +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* mptscsih_dv_parms - perform a variety of operations on the + * parameters used for negotiation. + * @hd: Pointer to a SCSI host. + * @dv: Pointer to a structure that contains the maximum and current + * negotiated parameters. + */ +static void +mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage) +{ + VirtDevice *pTarget = NULL; + SCSIDevicePage0_t *pPage0 = NULL; + SCSIDevicePage1_t *pPage1 = NULL; + int val = 0, data, configuration; + u8 width = 0; + u8 offset = 0; + u8 factor = 0; + u8 negoFlags = 0; + u8 cmd = dv->cmd; + u8 id = dv->id; + + switch (cmd) { + case MPT_GET_NVRAM_VALS: + ddvprintk((MYIOC_s_NOTE_FMT "Getting NVRAM: ", + hd->ioc->name)); + /* Get the NVRAM values and save in tmax + * If not an LVD bus, the adapter minSyncFactor has been + * already throttled back. + */ + if ((hd->Targets)&&((pTarget = hd->Targets[(int)id]) != NULL) && !pTarget->raidVolume) { + width = pTarget->maxWidth; + offset = pTarget->maxOffset; + factor = pTarget->minSyncFactor; + negoFlags = pTarget->negoFlags; + } else { + if (hd->ioc->spi_data.nvram && (hd->ioc->spi_data.nvram[id] != MPT_HOST_NVRAM_INVALID)) { + data = hd->ioc->spi_data.nvram[id]; + width = data & MPT_NVRAM_WIDE_DISABLE ? 0 : 1; + if ((offset = hd->ioc->spi_data.maxSyncOffset) == 0) + factor = MPT_ASYNC; + else { + factor = (data & MPT_NVRAM_SYNC_MASK) >> MPT_NVRAM_SYNC_SHIFT; + if ((factor == 0) || (factor == MPT_ASYNC)){ + factor = MPT_ASYNC; + offset = 0; + } + } + } else { + width = MPT_NARROW; + offset = 0; + factor = MPT_ASYNC; + } + + /* Set the negotiation flags */ + negoFlags = 0; + if (!width) + negoFlags |= MPT_TARGET_NO_NEGO_WIDE; + + if (!offset) + negoFlags |= MPT_TARGET_NO_NEGO_SYNC; + } + + /* limit by adapter capabilities */ + width = MIN(width, hd->ioc->spi_data.maxBusWidth); + offset = MIN(offset, hd->ioc->spi_data.maxSyncOffset); + factor = MAX(factor, hd->ioc->spi_data.minSyncFactor); + + /* Check Consistency */ + if (offset && (factor < MPT_ULTRA2) && !width) + factor = MPT_ULTRA2; + + dv->max.width = width; + dv->max.offset = offset; + dv->max.factor = factor; + dv->max.flags = negoFlags; + ddvprintk((" width %d, factor %x, offset %x flags %x\n", + width, factor, offset, negoFlags)); + break; + + case MPT_UPDATE_MAX: + ddvprintk((MYIOC_s_NOTE_FMT + "Updating with SDP0 Data: ", hd->ioc->name)); + /* Update tmax values with those from Device Page 0.*/ + pPage0 = (SCSIDevicePage0_t *) pPage; + if (pPage0) { + val = cpu_to_le32(pPage0->NegotiatedParameters); + dv->max.width = val & MPI_SCSIDEVPAGE0_NP_WIDE ? 1 : 0; + dv->max.offset = (val&MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK) >> 16; + dv->max.factor = (val&MPI_SCSIDEVPAGE0_NP_NEG_SYNC_PERIOD_MASK) >> 8; + } + + dv->now.width = dv->max.width; + dv->now.offset = dv->max.offset; + dv->now.factor = dv->max.factor; + ddvprintk(("width %d, factor %x, offset %x, flags %x\n", + dv->now.width, dv->now.factor, dv->now.offset, dv->now.flags)); + break; + + case MPT_SET_MAX: + ddvprintk((MYIOC_s_NOTE_FMT "Setting Max: ", + hd->ioc->name)); + /* Set current to the max values. Update the config page.*/ + dv->now.width = dv->max.width; + dv->now.offset = dv->max.offset; + dv->now.factor = dv->max.factor; + dv->now.flags = dv->max.flags; + + pPage1 = (SCSIDevicePage1_t *)pPage; + if (pPage1) { + mptscsih_setDevicePage1Flags (dv->now.width, dv->now.factor, + dv->now.offset, &val, &configuration, dv->now.flags); + pPage1->RequestedParameters = le32_to_cpu(val); + pPage1->Reserved = 0; + pPage1->Configuration = le32_to_cpu(configuration); + + } + + ddvprintk(("width %d, factor %x, offset %x request %x, config %x\n", + dv->now.width, dv->now.factor, dv->now.offset, val, configuration)); + break; + + case MPT_SET_MIN: + ddvprintk((MYIOC_s_NOTE_FMT "Setting Min: ", + hd->ioc->name)); + /* Set page to asynchronous and narrow + * Do not update now, breaks fallback routine. */ + width = MPT_NARROW; + offset = 0; + factor = MPT_ASYNC; + negoFlags = dv->max.flags; + + pPage1 = (SCSIDevicePage1_t *)pPage; + if (pPage1) { + mptscsih_setDevicePage1Flags (width, factor, + offset, &val, &configuration, negoFlags); + pPage1->RequestedParameters = le32_to_cpu(val); + pPage1->Reserved = 0; + pPage1->Configuration = le32_to_cpu(configuration); + } + ddvprintk(("width %d, factor %x, offset %x request %x config %x\n", + dv->now.width, dv->now.factor, + dv->now.offset, val, configuration)); + break; + + case MPT_FALLBACK: + ddvprintk((MYIOC_s_NOTE_FMT + "Fallback: Start: offset %d, factor %x, width %d \n", + hd->ioc->name, dv->now.offset, + dv->now.factor, dv->now.width)); + width = dv->now.width; + offset = dv->now.offset; + factor = dv->now.factor; + if ((offset) && (dv->max.width)) { + if (factor < MPT_ULTRA160) + factor = MPT_ULTRA160; + else if (factor < MPT_ULTRA2) { + factor = MPT_ULTRA2; + width = MPT_WIDE; + } else if ((factor == MPT_ULTRA2) && width) { + factor = MPT_ULTRA2; + width = MPT_NARROW; + } else if (factor < MPT_ULTRA) { + factor = MPT_ULTRA; + width = MPT_WIDE; + } else if ((factor == MPT_ULTRA) && width) { + factor = MPT_ULTRA; + width = MPT_NARROW; + } else if (factor < MPT_FAST) { + factor = MPT_FAST; + width = MPT_WIDE; + } else if ((factor == MPT_FAST) && width) { + factor = MPT_FAST; + width = MPT_NARROW; + } else if (factor < MPT_SCSI) { + factor = MPT_SCSI; + width = MPT_WIDE; + } else if ((factor == MPT_SCSI) && width) { + factor = MPT_SCSI; + width = MPT_NARROW; + } else { + factor = MPT_ASYNC; + offset = 0; + } + + } else if (offset) { + width = MPT_NARROW; + if (factor < MPT_ULTRA) + factor = MPT_ULTRA; + else if (factor < MPT_FAST) + factor = MPT_FAST; + else if (factor < MPT_SCSI) + factor = MPT_SCSI; + else { + factor = MPT_ASYNC; + offset = 0; + } - if (SD_Sense_Key_Specific_Valid(sd)) { - if (SenseKey == SK_ILLEGAL_REQUEST) { - Offset = SD_Bad_Byte(sd); - if (SD_Was_Illegal_Request(sd)) { - BadValue = ioop->cdbPtr[Offset]; - len += sprintf(msg1+len, "\n Illegal CDB value=%02Xh found at CDB ", - BadValue); } else { - BadValue = ioop->dataPtr[Offset]; - len += sprintf(msg1+len, "\n Illegal DATA value=%02Xh found at DATA ", - BadValue); + width = MPT_NARROW; + factor = MPT_ASYNC; } - len += sprintf(msg1+len, "byte=%02Xh", Offset); - if (SD_SKS_Bit_Pointer_Valid(sd)) - len += sprintf(msg1+len, "/bit=%1Xh", SD_SKS_Bit_Pointer(sd)); - } else if ((SenseKey == SK_RECOVERED_ERROR) || - (SenseKey == SK_HARDWARE_ERROR) || - (SenseKey == SK_MEDIUM_ERROR)) { - len += sprintf(msg1+len, "\n Recovery algorithm Actual_Retry_Count=%02Xh", - SD_Actual_Retry_Count(sd)); + + dv->now.width = width; + dv->now.offset = offset; + dv->now.factor = factor; + dv->now.flags = dv->max.flags; + + pPage1 = (SCSIDevicePage1_t *)pPage; + if (pPage1) { + mptscsih_setDevicePage1Flags (width, factor, offset, &val, + &configuration, dv->now.flags); + + pPage1->RequestedParameters = le32_to_cpu(val); + pPage1->Reserved = 0; + pPage1->Configuration = le32_to_cpu(configuration); } - } -} -#endif -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -static int dump_cdb(char *foo, unsigned char *cdb) -{ - int i, grpCode, cdbLen; - int l = 0; + ddvprintk(("Finish: offset %d, factor %x, width %d, request %x config %x\n", + dv->now.offset, dv->now.factor, dv->now.width, val, configuration)); + break; - grpCode = cdb[0] >> 5; - if (grpCode < 1) - cdbLen = 6; - else if (grpCode < 3) - cdbLen = 10; - else if (grpCode == 5) - cdbLen = 12; - else - cdbLen = 16; + case MPT_SAVE: + ddvprintk((MYIOC_s_NOTE_FMT + "Saving to Target structure: ", hd->ioc->name)); + ddvprintk(("offset %d, factor %x, width %d \n", + dv->now.offset, dv->now.factor, dv->now.width)); - for (i=0; i < cdbLen; i++) - l += sprintf(foo+l, " %02X", cdb[i]); + /* Save these values to target structures + * or overwrite nvram (phys disks only). + */ - return l; -} + if ((hd->Targets)&&((pTarget = hd->Targets[(int)id]) != NULL) && !pTarget->raidVolume ) { + pTarget->maxWidth = dv->now.width; + pTarget->maxOffset = dv->now.offset; + pTarget->minSyncFactor = dv->now.factor; + } else { + /* Preserv all flags, use + * read-modify-write algorithm + */ + data = hd->ioc->spi_data.nvram[id]; -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -static int dump_sd(char *foo, unsigned char *sd) -{ - int snsLen = 8 + SD_Additional_Sense_Length(sd); - int l = 0; - int i; + if (dv->now.width) + data &= ~MPT_NVRAM_WIDE_DISABLE; + else + data |= MPT_NVRAM_WIDE_DISABLE; - for (i=0; i < MIN(snsLen,18); i++) - l += sprintf(foo+l, " %02X", sd[i]); - l += sprintf(foo+l, "%s", snsLen>18 ? " ..." : ""); + if (!dv->now.offset) + factor = MPT_ASYNC; - return l; + data &= ~MPT_NVRAM_SYNC_MASK; + data |= (dv->now.factor << MPT_NVRAM_SYNC_SHIFT) & MPT_NVRAM_SYNC_MASK; + + hd->ioc->spi_data.nvram[id] = data; + } + break; + } } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* Do ASC/ASCQ lookup/grindage to English readable string(s) */ -static const char * ascq_set_strings_4max( - u8 ASC, u8 ASCQ, - const char **s1, const char **s2, const char **s3, const char **s4) +/* mptscsih_fillbuf - fill a buffer with a special data pattern + * cleanup. For bus scan only. + * + * @buffer: Pointer to data buffer to be filled. + * @size: Number of bytes to fill + * @index: Pattern index + * @width: bus width, 0 (8 bits) or 1 (16 bits) + */ +static void +mptscsih_fillbuf(char *buffer, int size, int index, int width) { - static const char *asc_04_part1_string = "LOGICAL UNIT "; - static const char *asc_04_part2a_string = "NOT READY, "; - static const char *asc_04_part2b_string = "IS "; - static const char *asc_04_ascq_NN_part3_strings[] = { /* ASC ASCQ (hex) */ - "CAUSE NOT REPORTABLE", /* 04 00 */ - "IN PROCESS OF BECOMING READY", /* 04 01 */ - "INITIALIZING CMD. REQUIRED", /* 04 02 */ - "MANUAL INTERVENTION REQUIRED", /* 04 03 */ - /* Add " IN PROGRESS" to all the following... */ - "FORMAT", /* 04 04 */ - "REBUILD", /* 04 05 */ - "RECALCULATION", /* 04 06 */ - "OPERATION", /* 04 07 */ - "LONG WRITE", /* 04 08 */ - "SELF-TEST", /* 04 09 */ - NULL - }; - static char *asc_04_part4_string = " IN PROGRESS"; + char *ptr = buffer; + int ii; + char byte; + short val; - static char *asc_29_ascq_NN_strings[] = { /* ASC ASCQ (hex) */ - "POWER ON, RESET, OR BUS DEVICE RESET OCCURRED", /* 29 00 */ - "POWER ON OCCURRED", /* 29 01 */ - "SCSI BUS RESET OCCURRED", /* 29 02 */ - "BUS DEVICE RESET FUNCTION OCCURRED", /* 29 03 */ - "DEVICE INTERNAL RESET", /* 29 04 */ - "TRANSCEIVER MODE CHANGED TO SINGLE-ENDED", /* 29 05 */ - "TRANSCEIVER MODE CHANGED TO LVD", /* 29 06 */ - NULL - }; - static char *ascq_vendor_uniq = "(Vendor Unique)"; - static char *ascq_noone = "(no matching ASC/ASCQ description found)"; - int idx; + switch (index) { + case 0: - *s1 = *s2 = *s3 = *s4 = ""; /* set'em all to the empty "" string */ + if (width) { + /* Pattern: 0000 FFFF 0000 FFFF + */ + for (ii=0; ii < size; ii++, ptr++) { + if (ii & 0x02) + *ptr = 0xFF; + else + *ptr = 0x00; + } + } else { + /* Pattern: 00 FF 00 FF + */ + for (ii=0; ii < size; ii++, ptr++) { + if (ii & 0x01) + *ptr = 0xFF; + else + *ptr = 0x00; + } + } + break; - /* CHECKME! Need lock/sem? - * Update and examine for isense module presense. - */ - mptscsih_ASCQ_TablePtr = (ASCQ_Table_t *)mpt_v_ASCQ_TablePtr; + case 1: + if (width) { + /* Pattern: 5555 AAAA 5555 AAAA 5555 + */ + for (ii=0; ii < size; ii++, ptr++) { + if (ii & 0x02) + *ptr = 0xAA; + else + *ptr = 0x55; + } + } else { + /* Pattern: 55 AA 55 AA 55 + */ + for (ii=0; ii < size; ii++, ptr++) { + if (ii & 0x01) + *ptr = 0xAA; + else + *ptr = 0x55; + } + } + break; - if (mptscsih_ASCQ_TablePtr == NULL) { - /* 2nd chances... */ - if (ASC == 0x04 && (ASCQ < sizeof(asc_04_ascq_NN_part3_strings)/sizeof(char*)-1)) { - *s1 = asc_04_part1_string; - *s2 = (ASCQ == 0x01) ? asc_04_part2b_string : asc_04_part2a_string; - *s3 = asc_04_ascq_NN_part3_strings[ASCQ]; - /* check for " IN PROGRESS" ones */ - if (ASCQ >= 0x04) - *s4 = asc_04_part4_string; - } else if (ASC == 0x29 && (ASCQ < sizeof(asc_29_ascq_NN_strings)/sizeof(char*)-1)) - *s1 = asc_29_ascq_NN_strings[ASCQ]; - /* - * else { leave all *s[1-4] values pointing to the empty "" string } + case 2: + /* Pattern: 00 01 02 03 04 05 + * ... FE FF 00 01.. */ - return *s1; - } + for (ii=0; ii < size; ii++, ptr++) + *ptr = (char) ii; + break; - /* - * Need to check ASC here; if it is "special," then - * the ASCQ is variable, and indicates failed component number. - * We must treat the ASCQ as a "don't care" while searching the - * mptscsih_ASCQ_Table[] by masking it off, and then restoring it later - * on when we actually need to identify the failed component. - */ - if (SPECIAL_ASCQ(ASC,ASCQ)) - ASCQ = 0xFF; + case 3: + if (width) { + /* Wide Pattern: FFFE 0001 FFFD 0002 + * ... 4000 DFFF 8000 EFFF + */ + byte = 0; + for (ii=0; ii < size/2; ii++) { + /* Create the base pattern + */ + val = (1 << byte); + /* every 64 (0x40) bytes flip the pattern + * since we fill 2 bytes / iteration, + * test for ii = 0x20 + */ + if (ii & 0x20) + val = ~(val); - /* OK, now search mptscsih_ASCQ_Table[] for a matching entry */ - for (idx = 0; mptscsih_ASCQ_TablePtr && idx < mpt_ASCQ_TableSz; idx++) - if ((ASC == mptscsih_ASCQ_TablePtr[idx].ASC) && (ASCQ == mptscsih_ASCQ_TablePtr[idx].ASCQ)) - return (*s1 = mptscsih_ASCQ_TablePtr[idx].Description); + if (ii & 0x01) { + *ptr = (char)( (val & 0xFF00) >> 8); + ptr++; + *ptr = (char)(val & 0xFF); + byte++; + byte &= 0x0F; + } else { + val = ~val; + *ptr = (char)( (val & 0xFF00) >> 8); + ptr++; + *ptr = (char)(val & 0xFF); + } - if ((ASC >= 0x80) || (ASCQ >= 0x80)) - *s1 = ascq_vendor_uniq; - else - *s1 = ascq_noone; + ptr++; + } + } else { + /* Narrow Pattern: FE 01 FD 02 FB 04 + * .. 7F 80 01 FE 02 FD ... 80 7F + */ + byte = 0; + for (ii=0; ii < size; ii++, ptr++) { + /* Base pattern - first 32 bytes + */ + if (ii & 0x01) { + *ptr = (1 << byte); + byte++; + byte &= 0x07; + } else { + *ptr = (char) (~(1 << byte)); + } - return *s1; + /* Flip the pattern every 32 bytes + */ + if (ii & 0x20) + *ptr = ~(*ptr); + } + } + break; + } } +#endif /* ~MPTSCSIH_DISABLE_DOMAIN_VALIDATION */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* - * SCSI Error Report; desired output format... - *--- -SCSI Error Report =-=-=-=-=-=-=-=-=-=-=-=-=-= (ioc0,scsi0:0) - SCSI_Status=02h (CHECK CONDITION) - Original_CDB[]: 00 00 00 00 00 00 - TestUnitReady - SenseData[12h]: 70 00 06 00 00 00 00 0A 00 00 00 00 29 00 03 00 00 00 - SenseKey=6h (UNIT ATTENTION); FRU=03h - ASC/ASCQ=29h/00h, "POWER ON, RESET, OR BUS DEVICE RESET OCCURRED" - *--- +/* Commandline Parsing routines and defines. + * + * insmod format: + * insmod mptscsih mptscsih="width:1 dv:n factor:0x09" + * boot format: + * mptscsih=width:1,dv:n,factor:0x8 + * */ +#ifdef MODULE +#define ARG_SEP ' ' +#else +#define ARG_SEP ',' +#endif -int mpt_ScsiHost_ErrorReport(IO_Info_t *ioop) -{ - char foo[512]; - char buf2[32]; - char *statstr; - const char *opstr; - int sk = SD_Sense_Key(ioop->sensePtr); - const char *skstr = SenseKeyString[sk]; - unsigned char asc = SD_ASC(ioop->sensePtr); - unsigned char ascq = SD_ASCQ(ioop->sensePtr); - int l; +static char setup_token[] __initdata = + "dv:" + "width:" + "factor:" + ; /* DONNOT REMOVE THIS ';' */ + +#define OPT_DV 1 +#define OPT_MAX_WIDTH 2 +#define OPT_MIN_SYNC_FACTOR 3 - /* - * More quiet mode. - * Filter out common, repetitive, warning-type errors... like: - * POWER ON (06,29/00 or 06,29/01), - * SPINNING UP (02,04/01), - * LOGICAL UNIT NOT SUPPORTED (05,25/00), etc. - */ - if ( (sk==SK_UNIT_ATTENTION && asc==0x29 && (ascq==0x00 || ascq==0x01)) - || (sk==SK_NOT_READY && asc==0x04 && ascq==0x01) - || (sk==SK_ILLEGAL_REQUEST && asc==0x25 && ascq==0x00) - ) - { - /* Do nothing! */ - return 0; +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +static int +__init get_setup_token(char *p) +{ + char *cur = setup_token; + char *pc; + int i = 0; + + while (cur != NULL && (pc = strchr(cur, ':')) != NULL) { + ++pc; + ++i; + if (!strncmp(p, cur, pc - cur)) + return i; + cur = pc; } + return 0; +} - /* - * Protect ourselves... - */ - if (ioop->cdbPtr == NULL) - ioop->cdbPtr = dummyCDB; - if (ioop->sensePtr == NULL) - ioop->sensePtr = dummySenseData; - if (ioop->inqPtr == NULL) - ioop->inqPtr = dummyInqData; - if (ioop->dataPtr == NULL) - ioop->dataPtr = dummyScsiData; +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +static int +__init mptscsih_setup(char *str) +{ + char *cur = str; + char *pc, *pv; + unsigned long val; + int c; + + printk("KERN_WARNING: mptscsih_setup arg %s\n", str); + + while (cur != NULL && (pc = strchr(cur, ':')) != NULL) { + char *pe; + + val = 0; + pv = pc; + c = *++pv; + + if (c == 'n') + val = 0; + else if (c == 'y') + val = 1; + else + val = (int) simple_strtoul(pv, &pe, 0); - statstr = NULL; - if ((ioop->SCSIStatus >= sizeof(ScsiStatusString)/sizeof(char*)-1) || - ((statstr = (char*)ScsiStatusString[ioop->SCSIStatus]) == NULL)) { - (void) sprintf(buf2, "Bad-Reserved-%02Xh", ioop->SCSIStatus); - statstr = buf2; - } + printk("Found Token: %s, value %x\n", cur, (int)val); + switch (get_setup_token(cur)) { + case OPT_DV: + driver_setup.dv = val; + break; - opstr = NULL; - if (1+ioop->cdbPtr[0] <= sizeof(ScsiCommonOpString)/sizeof(char*)) - opstr = ScsiCommonOpString[ioop->cdbPtr[0]]; - else if (mpt_ScsiOpcodesPtr) - opstr = mpt_ScsiOpcodesPtr[ioop->cdbPtr[0]]; + case OPT_MAX_WIDTH: + driver_setup.max_width = val; + break; - l = sprintf(foo, "SCSI Error Report =-=-= (%s)\n" - " SCSI_Status=%02Xh (%s)\n" - " Original_CDB[]:", - ioop->DevIDStr, - ioop->SCSIStatus, - statstr); - l += dump_cdb(foo+l, ioop->cdbPtr); - if (opstr) - l += sprintf(foo+l, " - \"%s\"", opstr); - l += sprintf(foo+l, "\n SenseData[%02Xh]:", 8+SD_Additional_Sense_Length(ioop->sensePtr)); - l += dump_sd(foo+l, ioop->sensePtr); - l += sprintf(foo+l, "\n SenseKey=%Xh (%s); FRU=%02Xh\n ASC/ASCQ=%02Xh/%02Xh", - sk, skstr, SD_FRU(ioop->sensePtr), asc, ascq ); + case OPT_MIN_SYNC_FACTOR: + driver_setup.min_sync_fac = val; + break; - { - const char *x1, *x2, *x3, *x4; - x1 = x2 = x3 = x4 = ""; - x1 = ascq_set_strings_4max(asc, ascq, &x1, &x2, &x3, &x4); - if (x1 != NULL) { - if (x1[0] != '(') - l += sprintf(foo+l, " \"%s%s%s%s\"", x1,x2,x3,x4); - else - l += sprintf(foo+l, " %s%s%s%s", x1,x2,x3,x4); + default: + printk("mptscsih_setup: unexpected boot option '%.*s' ignored\n", (int)(pc-cur+1), cur); + break; } - } - -#if 0 - if (SPECIAL_ASCQ(asc,ascq)) - l += sprintf(foo+l, " (%02Xh)", ascq); -#endif - - PrintF(("%s\n", foo)); - return l; + if ((cur = strchr(cur, ARG_SEP)) != NULL) + ++cur; + } + return 1; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ diff -urN linux-2.4.18/drivers/message/fusion/mptscsih.h lia64-2.4/drivers/message/fusion/mptscsih.h --- linux-2.4.18/drivers/message/fusion/mptscsih.h Fri Jul 6 17:03:11 2001 +++ lia64-2.4/drivers/message/fusion/mptscsih.h Fri Jul 19 18:32:12 2002 @@ -15,11 +15,12 @@ * * (see also mptbase.c) * - * Copyright (c) 1999-2001 LSI Logic Corporation + * Copyright (c) 1999-2002 LSI Logic Corporation * Originally By: Steven J. Ralston - * (mailto:Steve.Ralston@lsil.com) + * (mailto:netscape.net) + * (mailto:Pam.Delaney@lsil.com) * - * $Id: mptscsih.h,v 1.7 2001/01/11 16:56:43 sralston Exp $ + * $Id: mptscsih.h,v 1.16 2002/02/27 18:44:30 sralston Exp $ */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* @@ -68,14 +69,47 @@ * SCSI Public stuff... */ -#ifdef __sparc__ -#define MPT_SCSI_CAN_QUEUE 63 -#define MPT_SCSI_CMD_PER_LUN 63 - /* FIXME! Still investigating qd=64 hang on sparc64... */ -#else -#define MPT_SCSI_CAN_QUEUE 64 -#define MPT_SCSI_CMD_PER_LUN 64 -#endif +/* + * Try to keep these at 2^N-1 + */ +#define MPT_FC_CAN_QUEUE 63 +#define MPT_SCSI_CAN_QUEUE 31 +#define MPT_SCSI_CMD_PER_LUN 7 + +#define MPT_SCSI_SG_DEPTH 40 + +/* To disable domain validation, uncomment the + * following line. No effect for FC devices. + * For SCSI devices, driver will negotiate to + * NVRAM settings (if available) or to maximum adapter + * capabilities. + */ +/* #define MPTSCSIH_DISABLE_DOMAIN_VALIDATION */ + + +/* SCSI driver setup structure. Settings can be overridden + * by command line options. + */ +#define MPTSCSIH_DOMAIN_VALIDATION 1 +#define MPTSCSIH_MAX_WIDTH 1 +#define MPTSCSIH_MIN_SYNC 0x08 + +struct mptscsih_driver_setup +{ + u8 dv; + u8 max_width; + u8 min_sync_fac; +}; + + +#define MPTSCSIH_DRIVER_SETUP \ +{ \ + MPTSCSIH_DOMAIN_VALIDATION, \ + MPTSCSIH_MAX_WIDTH, \ + MPTSCSIH_MIN_SYNC, \ +} + + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* @@ -143,6 +177,7 @@ #define x_scsi_dev_reset mptscsih_dev_reset #define x_scsi_host_reset mptscsih_host_reset #define x_scsi_bios_param mptscsih_bios_param +#define x_scsi_select_queue_depths mptscsih_select_queue_depths #define x_scsi_taskmgmt_bh mptscsih_taskmgmt_bh #define x_scsi_old_abort mptscsih_old_abort @@ -155,7 +190,6 @@ extern int x_scsi_detect(Scsi_Host_Template *); extern int x_scsi_release(struct Scsi_Host *host); extern const char *x_scsi_info(struct Scsi_Host *); -/*extern int x_scsi_command(Scsi_Cmnd *);*/ extern int x_scsi_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); #ifdef MPT_SCSI_USE_NEW_EH extern int x_scsi_abort(Scsi_Cmnd *); @@ -167,6 +201,7 @@ extern int x_scsi_old_reset(Scsi_Cmnd *, unsigned int); #endif extern int x_scsi_bios_param(Disk *, kdev_t, int *); +extern void x_scsi_select_queue_depths(struct Scsi_Host *, Scsi_Device *); extern void x_scsi_taskmgmt_bh(void *); #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) @@ -194,7 +229,7 @@ bios_param: x_scsi_bios_param, \ can_queue: MPT_SCSI_CAN_QUEUE, \ this_id: -1, \ - sg_tablesize: 25, \ + sg_tablesize: MPT_SCSI_SG_DEPTH, \ cmd_per_lun: MPT_SCSI_CMD_PER_LUN, \ unchecked_isa_dma: 0, \ use_clustering: ENABLE_CLUSTERING, \ @@ -217,7 +252,7 @@ bios_param: x_scsi_bios_param, \ can_queue: MPT_SCSI_CAN_QUEUE, \ this_id: -1, \ - sg_tablesize: 25, \ + sg_tablesize: MPT_SCSI_SG_DEPTH, \ cmd_per_lun: MPT_SCSI_CMD_PER_LUN, \ unchecked_isa_dma: 0, \ use_clustering: ENABLE_CLUSTERING \ diff -urN linux-2.4.18/drivers/message/fusion/scsi3.h lia64-2.4/drivers/message/fusion/scsi3.h --- linux-2.4.18/drivers/message/fusion/scsi3.h Mon Sep 24 15:07:20 2001 +++ lia64-2.4/drivers/message/fusion/scsi3.h Mon May 6 18:07:16 2002 @@ -4,11 +4,12 @@ * (Ultimately) SCSI-3 definitions; for now, inheriting * SCSI-2 definitions. * - * Copyright (c) 1996-2001 Steven J. Ralston + * Copyright (c) 1996-2002 Steven J. Ralston * Written By: Steven J. Ralston (19960517) - * (mailto:Steve.Ralston@lsil.com) + * (mailto:sjralston1@netscape.net) + * (mailto:Pam.Delaney@lsil.com) * - * $Id: scsi3.h,v 1.5 2001/04/06 14:31:32 sralston Exp $ + * $Id: scsi3.h,v 1.9 2002/02/27 18:45:02 sralston Exp $ */ #ifndef SCSI3_H_INCLUDED @@ -63,7 +64,10 @@ #define CMD_Write10 0x2A #define CMD_WriteVerify 0x2E #define CMD_Verify 0x2F +#define CMD_SynchronizeCache 0x35 #define CMD_ReadDefectData 0x37 +#define CMD_WriteBuffer 0x3B +#define CMD_ReadBuffer 0x3C #define CMD_ReadLong 0x3E #define CMD_LogSelect 0x4C #define CMD_LogSense 0x4D diff -urN linux-2.4.18/drivers/message/fusion/t10.org/asc-num.txt lia64-2.4/drivers/message/fusion/t10.org/asc-num.txt --- linux-2.4.18/drivers/message/fusion/t10.org/asc-num.txt Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/message/fusion/t10.org/asc-num.txt Wed Feb 27 14:25:31 2002 @@ -0,0 +1,505 @@ +File: ASC-NUM.TXT + +SCSI ASC/ASCQ Assignments +Numeric Sorted Listing +as of 5/18/00 + + D - DIRECT ACCESS DEVICE (SBC-2) device column key + .T - SEQUENTIAL ACCESS DEVICE (SSC) ------------------- + . L - PRINTER DEVICE (SSC) blank = reserved + . P - PROCESSOR DEVICE (SPC) not blank = allowed + . .W - WRITE ONCE READ MULTIPLE DEVICE (SBC-2) + . . R - CD DEVICE (MMC) + . . S - SCANNER DEVICE (SCSI-2) + . . .O - OPTICAL MEMORY DEVICE (SBC-2) + . . . M - MEDIA CHANGER DEVICE (SMC) + . . . C - COMMUNICATION DEVICE (SCSI-2) + . . . .A - STORAGE ARRAY DEVICE (SCC) + . . . . E - ENCLOSURE SERVICES DEVICE (SES) + . . . . B - SIMPLIFIED DIRECT-ACCESS DEVICE (RBC) + . . . . .K - OPTICAL CARD READER/WRITER DEVICE (OCRW) +ASC/ASCQ DTLPWRSOMCAEBK Description +------- -------------- ---------------------------------------------------- +00h/00h DTLPWRSOMCAEBK NO ADDITIONAL SENSE INFORMATION +00h/01h T FILEMARK DETECTED +00h/02h T S END-OF-PARTITION/MEDIUM DETECTED +00h/03h T SETMARK DETECTED +00h/04h T S BEGINNING-OF-PARTITION/MEDIUM DETECTED +00h/05h TL S END-OF-DATA DETECTED +00h/06h DTLPWRSOMCAEBK I/O PROCESS TERMINATED +00h/11h R AUDIO PLAY OPERATION IN PROGRESS +00h/12h R AUDIO PLAY OPERATION PAUSED +00h/13h R AUDIO PLAY OPERATION SUCCESSFULLY COMPLETED +00h/14h R AUDIO PLAY OPERATION STOPPED DUE TO ERROR +00h/15h R NO CURRENT AUDIO STATUS TO RETURN +00h/16h DTLPWRSOMCAEBK OPERATION IN PROGRESS +00h/17h DTL WRSOM AEBK CLEANING REQUESTED +01h/00h D W O BK NO INDEX/SECTOR SIGNAL +02h/00h D WR OM BK NO SEEK COMPLETE +03h/00h DTL W SO BK PERIPHERAL DEVICE WRITE FAULT +03h/01h T NO WRITE CURRENT +03h/02h T EXCESSIVE WRITE ERRORS +04h/00h DTLPWRSOMCAEBK LOGICAL UNIT NOT READY, CAUSE NOT REPORTABLE +04h/01h DTLPWRSOMCAEBK LOGICAL UNIT IS IN PROCESS OF BECOMING READY +04h/02h DTLPWRSOMCAEBK LOGICAL UNIT NOT READY, INITIALIZING CMD. REQUIRED +04h/03h DTLPWRSOMCAEBK LOGICAL UNIT NOT READY, MANUAL INTERVENTION REQUIRED +04h/04h DTL R O B LOGICAL UNIT NOT READY, FORMAT IN PROGRESS +04h/05h DT W OMCA BK LOGICAL UNIT NOT READY, REBUILD IN PROGRESS +04h/06h DT W OMCA BK LOGICAL UNIT NOT READY, RECALCULATION IN PROGRESS +04h/07h DTLPWRSOMCAEBK LOGICAL UNIT NOT READY, OPERATION IN PROGRESS +04h/08h R LOGICAL UNIT NOT READY, LONG WRITE IN PROGRESS +04h/09h DTLPWRSOMCAEBK LOGICAL UNIT NOT READY, SELF-TEST IN PROGRESS +04h/10h auxiliary memory code 2 (99-148) [proposed] +05h/00h DTL WRSOMCAEBK LOGICAL UNIT DOES NOT RESPOND TO SELECTION +06h/00h D WR OM BK NO REFERENCE POSITION FOUND +07h/00h DTL WRSOM BK MULTIPLE PERIPHERAL DEVICES SELECTED +08h/00h DTL WRSOMCAEBK LOGICAL UNIT COMMUNICATION FAILURE +08h/01h DTL WRSOMCAEBK LOGICAL UNIT COMMUNICATION TIME-OUT +08h/02h DTL WRSOMCAEBK LOGICAL UNIT COMMUNICATION PARITY ERROR +08h/03h DT R OM BK LOGICAL UNIT COMMUNICATION CRC ERROR (ULTRA-DMA/32) +08h/04h DTLPWRSO C K UNREACHABLE COPY TARGET +09h/00h DT WR O B TRACK FOLLOWING ERROR +09h/01h WR O K TRACKING SERVO FAILURE +09h/02h WR O K FOCUS SERVO FAILURE +09h/03h WR O SPINDLE SERVO FAILURE +09h/04h DT WR O B HEAD SELECT FAULT +0Ah/00h DTLPWRSOMCAEBK ERROR LOG OVERFLOW +0Bh/00h DTLPWRSOMCAEBK WARNING +0Bh/01h DTLPWRSOMCAEBK WARNING - SPECIFIED TEMPERATURE EXCEEDED +0Bh/02h DTLPWRSOMCAEBK WARNING - ENCLOSURE DEGRADED +0Ch/00h T RS WRITE ERROR +0Ch/01h K WRITE ERROR - RECOVERED WITH AUTO REALLOCATION +0Ch/02h D W O BK WRITE ERROR - AUTO REALLOCATION FAILED +0Ch/03h D W O BK WRITE ERROR - RECOMMEND REASSIGNMENT +0Ch/04h DT W O B COMPRESSION CHECK MISCOMPARE ERROR +0Ch/05h DT W O B DATA EXPANSION OCCURRED DURING COMPRESSION +0Ch/06h DT W O B BLOCK NOT COMPRESSIBLE +0Ch/07h R WRITE ERROR - RECOVERY NEEDED +0Ch/08h R WRITE ERROR - RECOVERY FAILED +0Ch/09h R WRITE ERROR - LOSS OF STREAMING +0Ch/0Ah R WRITE ERROR - PADDING BLOCKS ADDED +0Ch/0Bh auxiliary memory code 4 (99-148) [proposed] +0Dh/00h +0Eh/00h +0Fh/00h +10h/00h D W O BK ID CRC OR ECC ERROR +11h/00h DT WRSO BK UNRECOVERED READ ERROR +11h/01h DT WRSO BK READ RETRIES EXHAUSTED +11h/02h DT WRSO BK ERROR TOO LONG TO CORRECT +11h/03h DT W SO BK MULTIPLE READ ERRORS +11h/04h D W O BK UNRECOVERED READ ERROR - AUTO REALLOCATE FAILED +11h/05h WR O B L-EC UNCORRECTABLE ERROR +11h/06h WR O B CIRC UNRECOVERED ERROR +11h/07h W O B DATA RE-SYNCHRONIZATION ERROR +11h/08h T INCOMPLETE BLOCK READ +11h/09h T NO GAP FOUND +11h/0Ah DT O BK MISCORRECTED ERROR +11h/0Bh D W O BK UNRECOVERED READ ERROR - RECOMMEND REASSIGNMENT +11h/0Ch D W O BK UNRECOVERED READ ERROR - RECOMMEND REWRITE THE DATA +11h/0Dh DT WR O B DE-COMPRESSION CRC ERROR +11h/0Eh DT WR O B CANNOT DECOMPRESS USING DECLARED ALGORITHM +11h/0Fh R ERROR READING UPC/EAN NUMBER +11h/10h R ERROR READING ISRC NUMBER +11h/11h R READ ERROR - LOSS OF STREAMING +11h/12h auxiliary memory code 3 (99-148) [proposed] +12h/00h D W O BK ADDRESS MARK NOT FOUND FOR ID FIELD +13h/00h D W O BK ADDRESS MARK NOT FOUND FOR DATA FIELD +14h/00h DTL WRSO BK RECORDED ENTITY NOT FOUND +14h/01h DT WR O BK RECORD NOT FOUND +14h/02h T FILEMARK OR SETMARK NOT FOUND +14h/03h T END-OF-DATA NOT FOUND +14h/04h T BLOCK SEQUENCE ERROR +14h/05h DT W O BK RECORD NOT FOUND - RECOMMEND REASSIGNMENT +14h/06h DT W O BK RECORD NOT FOUND - DATA AUTO-REALLOCATED +15h/00h DTL WRSOM BK RANDOM POSITIONING ERROR +15h/01h DTL WRSOM BK MECHANICAL POSITIONING ERROR +15h/02h DT WR O BK POSITIONING ERROR DETECTED BY READ OF MEDIUM +16h/00h D W O BK DATA SYNCHRONIZATION MARK ERROR +16h/01h D W O BK DATA SYNC ERROR - DATA REWRITTEN +16h/02h D W O BK DATA SYNC ERROR - RECOMMEND REWRITE +16h/03h D W O BK DATA SYNC ERROR - DATA AUTO-REALLOCATED +16h/04h D W O BK DATA SYNC ERROR - RECOMMEND REASSIGNMENT +17h/00h DT WRSO BK RECOVERED DATA WITH NO ERROR CORRECTION APPLIED +17h/01h DT WRSO BK RECOVERED DATA WITH RETRIES +17h/02h DT WR O BK RECOVERED DATA WITH POSITIVE HEAD OFFSET +17h/03h DT WR O BK RECOVERED DATA WITH NEGATIVE HEAD OFFSET +17h/04h WR O B RECOVERED DATA WITH RETRIES AND/OR CIRC APPLIED +17h/05h D WR O BK RECOVERED DATA USING PREVIOUS SECTOR ID +17h/06h D W O BK RECOVERED DATA WITHOUT ECC - DATA AUTO-REALLOCATED +17h/07h D WR O BK RECOVERED DATA WITHOUT ECC - RECOMMEND REASSIGNMENT +17h/08h D WR O BK RECOVERED DATA WITHOUT ECC - RECOMMEND REWRITE +17h/09h D WR O BK RECOVERED DATA WITHOUT ECC - DATA REWRITTEN +18h/00h DT WR O BK RECOVERED DATA WITH ERROR CORRECTION APPLIED +18h/01h D WR O BK RECOVERED DATA WITH ERROR CORR. & RETRIES APPLIED +18h/02h D WR O BK RECOVERED DATA - DATA AUTO-REALLOCATED +18h/03h R RECOVERED DATA WITH CIRC +18h/04h R RECOVERED DATA WITH L-EC +18h/05h D WR O BK RECOVERED DATA - RECOMMEND REASSIGNMENT +18h/06h D WR O BK RECOVERED DATA - RECOMMEND REWRITE +18h/07h D W O BK RECOVERED DATA WITH ECC - DATA REWRITTEN +19h/00h D O K DEFECT LIST ERROR +19h/01h D O K DEFECT LIST NOT AVAILABLE +19h/02h D O K DEFECT LIST ERROR IN PRIMARY LIST +19h/03h D O K DEFECT LIST ERROR IN GROWN LIST +1Ah/00h DTLPWRSOMCAEBK PARAMETER LIST LENGTH ERROR +1Bh/00h DTLPWRSOMCAEBK SYNCHRONOUS DATA TRANSFER ERROR +1Ch/00h D O BK DEFECT LIST NOT FOUND +1Ch/01h D O BK PRIMARY DEFECT LIST NOT FOUND +1Ch/02h D O BK GROWN DEFECT LIST NOT FOUND +1Dh/00h DT WR O BK MISCOMPARE DURING VERIFY OPERATION +1Eh/00h D W O BK RECOVERED ID WITH ECC CORRECTION +1Fh/00h D O K PARTIAL DEFECT LIST TRANSFER +20h/00h DTLPWRSOMCAEBK INVALID COMMAND OPERATION CODE +20h/01h access controls code 1 (99-314) [proposed] +20h/02h access controls code 2 (99-314) [proposed] +20h/03h access controls code 3 (99-314) [proposed] +21h/00h DT WR OM BK LOGICAL BLOCK ADDRESS OUT OF RANGE +21h/01h DT WR OM BK INVALID ELEMENT ADDRESS +22h/00h D ILLEGAL FUNCTION (USE 20 00, 24 00, OR 26 00) +23h/00h +24h/00h DTLPWRSOMCAEBK INVALID FIELD IN CDB +24h/01h DTLPWRSOMCAEBK CDB DECRYPTION ERROR +25h/00h DTLPWRSOMCAEBK LOGICAL UNIT NOT SUPPORTED +26h/00h DTLPWRSOMCAEBK INVALID FIELD IN PARAMETER LIST +26h/01h DTLPWRSOMCAEBK PARAMETER NOT SUPPORTED +26h/02h DTLPWRSOMCAEBK PARAMETER VALUE INVALID +26h/03h DTLPWRSOMCAE K THRESHOLD PARAMETERS NOT SUPPORTED +26h/04h DTLPWRSOMCAEBK INVALID RELEASE OF PERSISTENT RESERVATION +26h/05h DTLPWRSOMCA BK DATA DECRYPTION ERROR +26h/06h DTLPWRSO C K TOO MANY TARGET DESCRIPTORS +26h/07h DTLPWRSO C K UNSUPPORTED TARGET DESCRIPTOR TYPE CODE +26h/08h DTLPWRSO C K TOO MANY SEGMENT DESCRIPTORS +26h/09h DTLPWRSO C K UNSUPPORTED SEGMENT DESCRIPTOR TYPE CODE +26h/0Ah DTLPWRSO C K UNEXPECTED INEXACT SEGMENT +26h/0Bh DTLPWRSO C K INLINE DATA LENGTH EXCEEDED +26h/0Ch DTLPWRSO C K INVALID OPERATION FOR COPY SOURCE OR DESTINATION +26h/0Dh DTLPWRSO C K COPY SEGMENT GRANULARITY VIOLATION +27h/00h DT WR O BK WRITE PROTECTED +27h/01h DT WR O BK HARDWARE WRITE PROTECTED +27h/02h DT WR O BK LOGICAL UNIT SOFTWARE WRITE PROTECTED +27h/03h T R ASSOCIATED WRITE PROTECT +27h/04h T R PERSISTENT WRITE PROTECT +27h/05h T R PERMANENT WRITE PROTECT +28h/00h DTLPWRSOMCAEBK NOT READY TO READY CHANGE, MEDIUM MAY HAVE CHANGED +28h/01h DT WR OM B IMPORT OR EXPORT ELEMENT ACCESSED +29h/00h DTLPWRSOMCAEBK POWER ON, RESET, OR BUS DEVICE RESET OCCURRED +29h/01h DTLPWRSOMCAEBK POWER ON OCCURRED +29h/02h DTLPWRSOMCAEBK SCSI BUS RESET OCCURRED +29h/03h DTLPWRSOMCAEBK BUS DEVICE RESET FUNCTION OCCURRED +29h/04h DTLPWRSOMCAEBK DEVICE INTERNAL RESET +29h/05h DTLPWRSOMCAEBK TRANSCEIVER MODE CHANGED TO SINGLE-ENDED +29h/06h DTLPWRSOMCAEBK TRANSCEIVER MODE CHANGED TO LVD +2Ah/00h DTL WRSOMCAEBK PARAMETERS CHANGED +2Ah/01h DTL WRSOMCAEBK MODE PARAMETERS CHANGED +2Ah/02h DTL WRSOMCAE K LOG PARAMETERS CHANGED +2Ah/03h DTLPWRSOMCAE K RESERVATIONS PREEMPTED +2Ah/04h DTLPWRSOMCAE RESERVATIONS RELEASED +2Ah/05h DTLPWRSOMCAE REGISTRATIONS PREEMPTED +2Bh/00h DTLPWRSO C K COPY CANNOT EXECUTE SINCE HOST CANNOT DISCONNECT +2Ch/00h DTLPWRSOMCAEBK COMMAND SEQUENCE ERROR +2Ch/01h S TOO MANY WINDOWS SPECIFIED +2Ch/02h S INVALID COMBINATION OF WINDOWS SPECIFIED +2Ch/03h R CURRENT PROGRAM AREA IS NOT EMPTY +2Ch/04h R CURRENT PROGRAM AREA IS EMPTY +2Ch/05h B ILLEGAL POWER CONDITION REQUEST +2Dh/00h T OVERWRITE ERROR ON UPDATE IN PLACE +2Eh/00h DTLPWRSO CA K ERROR DETECTED BY THIRD PARTY TEMPORARY INITIATOR +2Eh/01h DTLPWRSO CA K THIRD PARTY DEVICE FAILURE +2Eh/02h DTLPWRSO CA K COPY TARGET DEVICE NOT REACHABLE +2Eh/03h DTLPWRSO CA K INCORRECT COPY TARGET DEVICE TYPE +2Eh/04h DTLPWRSO CA K COPY TARGET DEVICE DATA UNDERRUN +2Eh/05h DTLPWRSO CA K COPY TARGET DEVICE DATA OVERRUN +2Fh/00h DTLPWRSOMCAEBK COMMANDS CLEARED BY ANOTHER INITIATOR +30h/00h DT WR OM BK INCOMPATIBLE MEDIUM INSTALLED +30h/01h DT WR O BK CANNOT READ MEDIUM - UNKNOWN FORMAT +30h/02h DT WR O BK CANNOT READ MEDIUM - INCOMPATIBLE FORMAT +30h/03h DT R K CLEANING CARTRIDGE INSTALLED +30h/04h DT WR O BK CANNOT WRITE MEDIUM - UNKNOWN FORMAT +30h/05h DT WR O BK CANNOT WRITE MEDIUM - INCOMPATIBLE FORMAT +30h/06h DT WR O B CANNOT FORMAT MEDIUM - INCOMPATIBLE MEDIUM +30h/07h DTL WRSOM AEBK CLEANING FAILURE +30h/08h R CANNOT WRITE - APPLICATION CODE MISMATCH +30h/09h R CURRENT SESSION NOT FIXATED FOR APPEND +31h/00h DT WR O BK MEDIUM FORMAT CORRUPTED +31h/01h D L R O B FORMAT COMMAND FAILED +32h/00h D W O BK NO DEFECT SPARE LOCATION AVAILABLE +32h/01h D W O BK DEFECT LIST UPDATE FAILURE +33h/00h T TAPE LENGTH ERROR +34h/00h DTLPWRSOMCAEBK ENCLOSURE FAILURE +35h/00h DTLPWRSOMCAEBK ENCLOSURE SERVICES FAILURE +35h/01h DTLPWRSOMCAEBK UNSUPPORTED ENCLOSURE FUNCTION +35h/02h DTLPWRSOMCAEBK ENCLOSURE SERVICES UNAVAILABLE +35h/03h DTLPWRSOMCAEBK ENCLOSURE SERVICES TRANSFER FAILURE +35h/04h DTLPWRSOMCAEBK ENCLOSURE SERVICES TRANSFER REFUSED +36h/00h L RIBBON, INK, OR TONER FAILURE +37h/00h DTL WRSOMCAEBK ROUNDED PARAMETER +38h/00h B EVENT STATUS NOTIFICATION +38h/02h B ESN - POWER MANAGEMENT CLASS EVENT +38h/04h B ESN - MEDIA CLASS EVENT +38h/06h B ESN - DEVICE BUSY CLASS EVENT +39h/00h DTL WRSOMCAE K SAVING PARAMETERS NOT SUPPORTED +3Ah/00h DTL WRSOM BK MEDIUM NOT PRESENT +3Ah/01h DT WR OM BK MEDIUM NOT PRESENT - TRAY CLOSED +3Ah/02h DT WR OM BK MEDIUM NOT PRESENT - TRAY OPEN +3Ah/03h DT WR OM B MEDIUM NOT PRESENT - LOADABLE +3Ah/04h DT WR OM B MEDIUM NOT PRESENT - MEDIUM AUXILIARY MEMORY ACCESSIBLE +3Bh/00h TL SEQUENTIAL POSITIONING ERROR +3Bh/01h T TAPE POSITION ERROR AT BEGINNING-OF-MEDIUM +3Bh/02h T TAPE POSITION ERROR AT END-OF-MEDIUM +3Bh/03h L TAPE OR ELECTRONIC VERTICAL FORMS UNIT NOT READY +3Bh/04h L SLEW FAILURE +3Bh/05h L PAPER JAM +3Bh/06h L FAILED TO SENSE TOP-OF-FORM +3Bh/07h L FAILED TO SENSE BOTTOM-OF-FORM +3Bh/08h T REPOSITION ERROR +3Bh/09h S READ PAST END OF MEDIUM +3Bh/0Ah S READ PAST BEGINNING OF MEDIUM +3Bh/0Bh S POSITION PAST END OF MEDIUM +3Bh/0Ch T S POSITION PAST BEGINNING OF MEDIUM +3Bh/0Dh DT WR OM BK MEDIUM DESTINATION ELEMENT FULL +3Bh/0Eh DT WR OM BK MEDIUM SOURCE ELEMENT EMPTY +3Bh/0Fh R END OF MEDIUM REACHED +3Bh/11h DT WR OM BK MEDIUM MAGAZINE NOT ACCESSIBLE +3Bh/12h DT WR OM BK MEDIUM MAGAZINE REMOVED +3Bh/13h DT WR OM BK MEDIUM MAGAZINE INSERTED +3Bh/14h DT WR OM BK MEDIUM MAGAZINE LOCKED +3Bh/15h DT WR OM BK MEDIUM MAGAZINE UNLOCKED +3Bh/16h R MECHANICAL POSITIONING OR CHANGER ERROR +3Ch/00h +3Dh/00h DTLPWRSOMCAE K INVALID BITS IN IDENTIFY MESSAGE +3Eh/00h DTLPWRSOMCAEBK LOGICAL UNIT HAS NOT SELF-CONFIGURED YET +3Eh/01h DTLPWRSOMCAEBK LOGICAL UNIT FAILURE +3Eh/02h DTLPWRSOMCAEBK TIMEOUT ON LOGICAL UNIT +3Eh/03h DTLPWRSOMCAEBK LOGICAL UNIT FAILED SELF-TEST +3Eh/04h DTLPWRSOMCAEBK LOGICAL UNIT UNABLE TO UPDATE SELF-TEST LOG +3Fh/00h DTLPWRSOMCAEBK TARGET OPERATING CONDITIONS HAVE CHANGED +3Fh/01h DTLPWRSOMCAEBK MICROCODE HAS BEEN CHANGED +3Fh/02h DTLPWRSOMC BK CHANGED OPERATING DEFINITION +3Fh/03h DTLPWRSOMCAEBK INQUIRY DATA HAS CHANGED +3Fh/04h DT WR OMCAEBK COMPONENT DEVICE ATTACHED +3Fh/05h DT WR OMCAEBK DEVICE IDENTIFIER CHANGED +3Fh/06h DT WR OMCAEB REDUNDANCY GROUP CREATED OR MODIFIED +3Fh/07h DT WR OMCAEB REDUNDANCY GROUP DELETED +3Fh/08h DT WR OMCAEB SPARE CREATED OR MODIFIED +3Fh/09h DT WR OMCAEB SPARE DELETED +3Fh/0Ah DT WR OMCAEBK VOLUME SET CREATED OR MODIFIED +3Fh/0Bh DT WR OMCAEBK VOLUME SET DELETED +3Fh/0Ch DT WR OMCAEBK VOLUME SET DEASSIGNED +3Fh/0Dh DT WR OMCAEBK VOLUME SET REASSIGNED +3Fh/0Eh DTLPWRSOMCAE REPORTED LUNS DATA HAS CHANGED +3Fh/0Fh DTLPWRSOMCAEBK ECHO BUFFER OVERWRITTEN +3Fh/10h DT WR OM B MEDIUM LOADABLE +3Fh/11h DT WR OM B MEDIUM AUXILIARY MEMORY ACCESSIBLE +40h/00h D RAM FAILURE (SHOULD USE 40 NN) +40h/NNh DTLPWRSOMCAEBK DIAGNOSTIC FAILURE ON COMPONENT NN (80H-FFH) +41h/00h D DATA PATH FAILURE (SHOULD USE 40 NN) +42h/00h D POWER-ON OR SELF-TEST FAILURE (SHOULD USE 40 NN) +43h/00h DTLPWRSOMCAEBK MESSAGE ERROR +44h/00h DTLPWRSOMCAEBK INTERNAL TARGET FAILURE +45h/00h DTLPWRSOMCAEBK SELECT OR RESELECT FAILURE +46h/00h DTLPWRSOMC BK UNSUCCESSFUL SOFT RESET +47h/00h DTLPWRSOMCAEBK SCSI PARITY ERROR +47h/01h DTLPWRSOMCAEBK DATA PHASE CRC ERROR DETECTED +47h/02h DTLPWRSOMCAEBK SCSI PARITY ERROR DETECTED DURING ST DATA PHASE +47h/03h DTLPWRSOMCAEBK INFORMATION UNIT CRC ERROR DETECTED +47h/04h DTLPWRSOMCAEBK ASYNCHRONOUS INFORMATION PROTECTION ERROR DETECTED +48h/00h DTLPWRSOMCAEBK INITIATOR DETECTED ERROR MESSAGE RECEIVED +49h/00h DTLPWRSOMCAEBK INVALID MESSAGE ERROR +4Ah/00h DTLPWRSOMCAEBK COMMAND PHASE ERROR +4Bh/00h DTLPWRSOMCAEBK DATA PHASE ERROR +4Ch/00h DTLPWRSOMCAEBK LOGICAL UNIT FAILED SELF-CONFIGURATION +4Dh/NNh DTLPWRSOMCAEBK TAGGED OVERLAPPED COMMANDS (NN = QUEUE TAG) +4Eh/00h DTLPWRSOMCAEBK OVERLAPPED COMMANDS ATTEMPTED +4Fh/00h +50h/00h T WRITE APPEND ERROR +50h/01h T WRITE APPEND POSITION ERROR +50h/02h T POSITION ERROR RELATED TO TIMING +51h/00h T R O ERASE FAILURE +52h/00h T CARTRIDGE FAULT +53h/00h DTL WRSOM BK MEDIA LOAD OR EJECT FAILED +53h/01h T UNLOAD TAPE FAILURE +53h/02h DT WR OM BK MEDIUM REMOVAL PREVENTED +54h/00h P SCSI TO HOST SYSTEM INTERFACE FAILURE +55h/00h P SYSTEM RESOURCE FAILURE +55h/01h D O BK SYSTEM BUFFER FULL +55h/02h DTLPWRSOM AE K INSUFFICIENT RESERVATION RESOURCES +55h/03h DTLPWRSOMCAE INSUFFICIENT RESOURCES +55h/04h DTLPWRSOM AE INSUFFICIENT REGISTRATION RESOURCES +55h/05h access controls code 4 (99-314) [proposed] +55h/06h auxiliary memory code 1 (99-148) [proposed] +56h/00h +57h/00h R UNABLE TO RECOVER TABLE-OF-CONTENTS +58h/00h O GENERATION DOES NOT EXIST +59h/00h O UPDATED BLOCK READ +5Ah/00h DTLPWRSOM BK OPERATOR REQUEST OR STATE CHANGE INPUT +5Ah/01h DT WR OM BK OPERATOR MEDIUM REMOVAL REQUEST +5Ah/02h DT WR O A BK OPERATOR SELECTED WRITE PROTECT +5Ah/03h DT WR O A BK OPERATOR SELECTED WRITE PERMIT +5Bh/00h DTLPWRSOM K LOG EXCEPTION +5Bh/01h DTLPWRSOM K THRESHOLD CONDITION MET +5Bh/02h DTLPWRSOM K LOG COUNTER AT MAXIMUM +5Bh/03h DTLPWRSOM K LOG LIST CODES EXHAUSTED +5Ch/00h D O RPL STATUS CHANGE +5Ch/01h D O SPINDLES SYNCHRONIZED +5Ch/02h D O SPINDLES NOT SYNCHRONIZED +5Dh/00h DTLPWRSOMCAEBK FAILURE PREDICTION THRESHOLD EXCEEDED +5Dh/01h R B MEDIA FAILURE PREDICTION THRESHOLD EXCEEDED +5Dh/02h R LOGICAL UNIT FAILURE PREDICTION THRESHOLD EXCEEDED +5Dh/10h D B HARDWARE IMPENDING FAILURE GENERAL HARD DRIVE FAILURE +5Dh/11h D B HARDWARE IMPENDING FAILURE DRIVE ERROR RATE TOO HIGH +5Dh/12h D B HARDWARE IMPENDING FAILURE DATA ERROR RATE TOO HIGH +5Dh/13h D B HARDWARE IMPENDING FAILURE SEEK ERROR RATE TOO HIGH +5Dh/14h D B HARDWARE IMPENDING FAILURE TOO MANY BLOCK REASSIGNS +5Dh/15h D B HARDWARE IMPENDING FAILURE ACCESS TIMES TOO HIGH +5Dh/16h D B HARDWARE IMPENDING FAILURE START UNIT TIMES TOO HIGH +5Dh/17h D B HARDWARE IMPENDING FAILURE CHANNEL PARAMETRICS +5Dh/18h D B HARDWARE IMPENDING FAILURE CONTROLLER DETECTED +5Dh/19h D B HARDWARE IMPENDING FAILURE THROUGHPUT PERFORMANCE +5Dh/1Ah D B HARDWARE IMPENDING FAILURE SEEK TIME PERFORMANCE +5Dh/1Bh D B HARDWARE IMPENDING FAILURE SPIN-UP RETRY COUNT +5Dh/1Ch D B HARDWARE IMPENDING FAILURE DRIVE CALIBRATION RETRY COUNT +5Dh/20h D B CONTROLLER IMPENDING FAILURE GENERAL HARD DRIVE FAILURE +5Dh/21h D B CONTROLLER IMPENDING FAILURE DRIVE ERROR RATE TOO HIGH +5Dh/22h D B CONTROLLER IMPENDING FAILURE DATA ERROR RATE TOO HIGH +5Dh/23h D B CONTROLLER IMPENDING FAILURE SEEK ERROR RATE TOO HIGH +5Dh/24h D B CONTROLLER IMPENDING FAILURE TOO MANY BLOCK REASSIGNS +5Dh/25h D B CONTROLLER IMPENDING FAILURE ACCESS TIMES TOO HIGH +5Dh/26h D B CONTROLLER IMPENDING FAILURE START UNIT TIMES TOO HIGH +5Dh/27h D B CONTROLLER IMPENDING FAILURE CHANNEL PARAMETRICS +5Dh/28h D B CONTROLLER IMPENDING FAILURE CONTROLLER DETECTED +5Dh/29h D B CONTROLLER IMPENDING FAILURE THROUGHPUT PERFORMANCE +5Dh/2Ah D B CONTROLLER IMPENDING FAILURE SEEK TIME PERFORMANCE +5Dh/2Bh D B CONTROLLER IMPENDING FAILURE SPIN-UP RETRY COUNT +5Dh/2Ch D B CONTROLLER IMPENDING FAILURE DRIVE CALIBRATION RETRY COUNT +5Dh/30h D B DATA CHANNEL IMPENDING FAILURE GENERAL HARD DRIVE FAILURE +5Dh/31h D B DATA CHANNEL IMPENDING FAILURE DRIVE ERROR RATE TOO HIGH +5Dh/32h D B DATA CHANNEL IMPENDING FAILURE DATA ERROR RATE TOO HIGH +5Dh/33h D B DATA CHANNEL IMPENDING FAILURE SEEK ERROR RATE TOO HIGH +5Dh/34h D B DATA CHANNEL IMPENDING FAILURE TOO MANY BLOCK REASSIGNS +5Dh/35h D B DATA CHANNEL IMPENDING FAILURE ACCESS TIMES TOO HIGH +5Dh/36h D B DATA CHANNEL IMPENDING FAILURE START UNIT TIMES TOO HIGH +5Dh/37h D B DATA CHANNEL IMPENDING FAILURE CHANNEL PARAMETRICS +5Dh/38h D B DATA CHANNEL IMPENDING FAILURE CONTROLLER DETECTED +5Dh/39h D B DATA CHANNEL IMPENDING FAILURE THROUGHPUT PERFORMANCE +5Dh/3Ah D B DATA CHANNEL IMPENDING FAILURE SEEK TIME PERFORMANCE +5Dh/3Bh D B DATA CHANNEL IMPENDING FAILURE SPIN-UP RETRY COUNT +5Dh/3Ch D B DATA CHANNEL IMPENDING FAILURE DRIVE CALIBRATION RETRY COUNT +5Dh/40h D B SERVO IMPENDING FAILURE GENERAL HARD DRIVE FAILURE +5Dh/41h D B SERVO IMPENDING FAILURE DRIVE ERROR RATE TOO HIGH +5Dh/42h D B SERVO IMPENDING FAILURE DATA ERROR RATE TOO HIGH +5Dh/43h D B SERVO IMPENDING FAILURE SEEK ERROR RATE TOO HIGH +5Dh/44h D B SERVO IMPENDING FAILURE TOO MANY BLOCK REASSIGNS +5Dh/45h D B SERVO IMPENDING FAILURE ACCESS TIMES TOO HIGH +5Dh/46h D B SERVO IMPENDING FAILURE START UNIT TIMES TOO HIGH +5Dh/47h D B SERVO IMPENDING FAILURE CHANNEL PARAMETRICS +5Dh/48h D B SERVO IMPENDING FAILURE CONTROLLER DETECTED +5Dh/49h D B SERVO IMPENDING FAILURE THROUGHPUT PERFORMANCE +5Dh/4Ah D B SERVO IMPENDING FAILURE SEEK TIME PERFORMANCE +5Dh/4Bh D B SERVO IMPENDING FAILURE SPIN-UP RETRY COUNT +5Dh/4Ch D B SERVO IMPENDING FAILURE DRIVE CALIBRATION RETRY COUNT +5Dh/50h D B SPINDLE IMPENDING FAILURE GENERAL HARD DRIVE FAILURE +5Dh/51h D B SPINDLE IMPENDING FAILURE DRIVE ERROR RATE TOO HIGH +5Dh/52h D B SPINDLE IMPENDING FAILURE DATA ERROR RATE TOO HIGH +5Dh/53h D B SPINDLE IMPENDING FAILURE SEEK ERROR RATE TOO HIGH +5Dh/54h D B SPINDLE IMPENDING FAILURE TOO MANY BLOCK REASSIGNS +5Dh/55h D B SPINDLE IMPENDING FAILURE ACCESS TIMES TOO HIGH +5Dh/56h D B SPINDLE IMPENDING FAILURE START UNIT TIMES TOO HIGH +5Dh/57h D B SPINDLE IMPENDING FAILURE CHANNEL PARAMETRICS +5Dh/58h D B SPINDLE IMPENDING FAILURE CONTROLLER DETECTED +5Dh/59h D B SPINDLE IMPENDING FAILURE THROUGHPUT PERFORMANCE +5Dh/5Ah D B SPINDLE IMPENDING FAILURE SEEK TIME PERFORMANCE +5Dh/5Bh D B SPINDLE IMPENDING FAILURE SPIN-UP RETRY COUNT +5Dh/5Ch D B SPINDLE IMPENDING FAILURE DRIVE CALIBRATION RETRY COUNT +5Dh/60h D B FIRMWARE IMPENDING FAILURE GENERAL HARD DRIVE FAILURE +5Dh/61h D B FIRMWARE IMPENDING FAILURE DRIVE ERROR RATE TOO HIGH +5Dh/62h D B FIRMWARE IMPENDING FAILURE DATA ERROR RATE TOO HIGH +5Dh/63h D B FIRMWARE IMPENDING FAILURE SEEK ERROR RATE TOO HIGH +5Dh/64h D B FIRMWARE IMPENDING FAILURE TOO MANY BLOCK REASSIGNS +5Dh/65h D B FIRMWARE IMPENDING FAILURE ACCESS TIMES TOO HIGH +5Dh/66h D B FIRMWARE IMPENDING FAILURE START UNIT TIMES TOO HIGH +5Dh/67h D B FIRMWARE IMPENDING FAILURE CHANNEL PARAMETRICS +5Dh/68h D B FIRMWARE IMPENDING FAILURE CONTROLLER DETECTED +5Dh/69h D B FIRMWARE IMPENDING FAILURE THROUGHPUT PERFORMANCE +5Dh/6Ah D B FIRMWARE IMPENDING FAILURE SEEK TIME PERFORMANCE +5Dh/6Bh D B FIRMWARE IMPENDING FAILURE SPIN-UP RETRY COUNT +5Dh/6Ch D B FIRMWARE IMPENDING FAILURE DRIVE CALIBRATION RETRY COUNT +5Dh/FFh DTLPWRSOMCAEBK FAILURE PREDICTION THRESHOLD EXCEEDED (FALSE) +5Eh/00h DTLPWRSO CA K LOW POWER CONDITION ON +5Eh/01h DTLPWRSO CA K IDLE CONDITION ACTIVATED BY TIMER +5Eh/02h DTLPWRSO CA K STANDBY CONDITION ACTIVATED BY TIMER +5Eh/03h DTLPWRSO CA K IDLE CONDITION ACTIVATED BY COMMAND +5Eh/04h DTLPWRSO CA K STANDBY CONDITION ACTIVATED BY COMMAND +5Eh/41h B POWER STATE CHANGE TO ACTIVE +5Eh/42h B POWER STATE CHANGE TO IDLE +5Eh/43h B POWER STATE CHANGE TO STANDBY +5Eh/45h B POWER STATE CHANGE TO SLEEP +5Eh/47h BK POWER STATE CHANGE TO DEVICE CONTROL +5Fh/00h +60h/00h S LAMP FAILURE +61h/00h S VIDEO ACQUISITION ERROR +61h/01h S UNABLE TO ACQUIRE VIDEO +61h/02h S OUT OF FOCUS +62h/00h S SCAN HEAD POSITIONING ERROR +63h/00h R END OF USER AREA ENCOUNTERED ON THIS TRACK +63h/01h R PACKET DOES NOT FIT IN AVAILABLE SPACE +64h/00h R ILLEGAL MODE FOR THIS TRACK +64h/01h R INVALID PACKET SIZE +65h/00h DTLPWRSOMCAEBK VOLTAGE FAULT +66h/00h S AUTOMATIC DOCUMENT FEEDER COVER UP +66h/01h S AUTOMATIC DOCUMENT FEEDER LIFT UP +66h/02h S DOCUMENT JAM IN AUTOMATIC DOCUMENT FEEDER +66h/03h S DOCUMENT MISS FEED AUTOMATIC IN DOCUMENT FEEDER +67h/00h A CONFIGURATION FAILURE +67h/01h A CONFIGURATION OF INCAPABLE LOGICAL UNITS FAILED +67h/02h A ADD LOGICAL UNIT FAILED +67h/03h A MODIFICATION OF LOGICAL UNIT FAILED +67h/04h A EXCHANGE OF LOGICAL UNIT FAILED +67h/05h A REMOVE OF LOGICAL UNIT FAILED +67h/06h A ATTACHMENT OF LOGICAL UNIT FAILED +67h/07h A CREATION OF LOGICAL UNIT FAILED +67h/08h A ASSIGN FAILURE OCCURRED +67h/09h A MULTIPLY ASSIGNED LOGICAL UNIT +68h/00h A LOGICAL UNIT NOT CONFIGURED +69h/00h A DATA LOSS ON LOGICAL UNIT +69h/01h A MULTIPLE LOGICAL UNIT FAILURES +69h/02h A PARITY/DATA MISMATCH +6Ah/00h A INFORMATIONAL, REFER TO LOG +6Bh/00h A STATE CHANGE HAS OCCURRED +6Bh/01h A REDUNDANCY LEVEL GOT BETTER +6Bh/02h A REDUNDANCY LEVEL GOT WORSE +6Ch/00h A REBUILD FAILURE OCCURRED +6Dh/00h A RECALCULATE FAILURE OCCURRED +6Eh/00h A COMMAND TO LOGICAL UNIT FAILED +6Fh/00h R COPY PROTECTION KEY EXCHANGE FAILURE - AUTHENTICATION FAILURE +6Fh/01h R COPY PROTECTION KEY EXCHANGE FAILURE - KEY NOT PRESENT +6Fh/02h R COPY PROTECTION KEY EXCHANGE FAILURE - KEY NOT ESTABLISHED +6Fh/03h R READ OF SCRAMBLED SECTOR WITHOUT AUTHENTICATION +6Fh/04h R MEDIA REGION CODE IS MISMATCHED TO LOGICAL UNIT REGION +6Fh/05h R DRIVE REGION MUST BE PERMANENT/REGION RESET COUNT ERROR +70h/NNh T DECOMPRESSION EXCEPTION SHORT ALGORITHM ID OF NN +71h/00h T DECOMPRESSION EXCEPTION LONG ALGORITHM ID +72h/00h R SESSION FIXATION ERROR +72h/01h R SESSION FIXATION ERROR WRITING LEAD-IN +72h/02h R SESSION FIXATION ERROR WRITING LEAD-OUT +72h/03h R SESSION FIXATION ERROR - INCOMPLETE TRACK IN SESSION +72h/04h R EMPTY OR PARTIALLY WRITTEN RESERVED TRACK +72h/05h R NO MORE TRACK RESERVATIONS ALLOWED +73h/00h R CD CONTROL ERROR +73h/01h R POWER CALIBRATION AREA ALMOST FULL +73h/02h R POWER CALIBRATION AREA IS FULL +73h/03h R POWER CALIBRATION AREA ERROR +73h/04h R PROGRAM MEMORY AREA UPDATE FAILURE +73h/05h R PROGRAM MEMORY AREA IS FULL +73h/06h R RMA/PMA IS FULL +74h/00h +75h/00h +76h/00h +77h/00h +78h/00h +79h/00h +7Ah/00h +7Bh/00h +7Ch/00h +7Dh/00h +7Eh/00h +7Fh/00h diff -urN linux-2.4.18/drivers/net/Config.in lia64-2.4/drivers/net/Config.in --- linux-2.4.18/drivers/net/Config.in Tue Feb 26 11:04:19 2002 +++ lia64-2.4/drivers/net/Config.in Fri Jul 19 17:14:10 2002 @@ -234,12 +234,15 @@ if [ "$CONFIG_ACENIC" != "n" ]; then bool ' Omit support for old Tigon I based AceNICs' CONFIG_ACENIC_OMIT_TIGON_I fi +dep_tristate 'Broadcom BCM5700 support' CONFIG_NET_BROADCOM $CONFIG_PCI dep_tristate 'D-Link DL2000-based Gigabit Ethernet support' CONFIG_DL2K $CONFIG_PCI dep_tristate 'MyriCOM Gigabit Ethernet support' CONFIG_MYRI_SBUS $CONFIG_SBUS +dep_tristate 'Intel Pro/1000 Gigabit Ethernet support' CONFIG_E1000 $CONFIG_PCI dep_tristate 'National Semiconduct DP83820 support' CONFIG_NS83820 $CONFIG_PCI dep_tristate 'Packet Engines Hamachi GNIC-II support' CONFIG_HAMACHI $CONFIG_PCI dep_tristate 'Packet Engines Yellowfin Gigabit-NIC support (EXPERIMENTAL)' CONFIG_YELLOWFIN $CONFIG_PCI $CONFIG_EXPERIMENTAL dep_tristate 'SysKonnect SK-98xx support' CONFIG_SK98LIN $CONFIG_PCI +dep_tristate 'Broadcom Tigon3 support' CONFIG_TIGON3 $CONFIG_PCI endmenu diff -urN linux-2.4.18/drivers/net/Makefile lia64-2.4/drivers/net/Makefile --- linux-2.4.18/drivers/net/Makefile Tue Feb 26 11:04:19 2002 +++ lia64-2.4/drivers/net/Makefile Fri Jul 19 17:15:18 2002 @@ -29,6 +29,14 @@ obj-$(CONFIG_ISDN) += slhc.o endif +ifeq ($(CONFIG_NET_BROADCOM),y) + obj-y += bcm/bcm5700.o +endif + +ifeq ($(CONFIG_E1000),y) + obj-y += e1000/e1000.o +endif + subdir-$(CONFIG_NET_PCMCIA) += pcmcia subdir-$(CONFIG_NET_WIRELESS) += wireless subdir-$(CONFIG_TULIP) += tulip @@ -40,6 +48,8 @@ subdir-$(CONFIG_APPLETALK) += appletalk subdir-$(CONFIG_SK98LIN) += sk98lin subdir-$(CONFIG_SKFP) += skfp +subdir-$(CONFIG_NET_BROADCOM) += bcm +subdir-$(CONFIG_E1000) += e1000 # # link order important here @@ -78,6 +88,7 @@ obj-$(CONFIG_NS83820) += ns83820.o obj-$(CONFIG_STNIC) += stnic.o 8390.o obj-$(CONFIG_FEALNX) += fealnx.o mii.o +obj-$(CONFIG_TIGON3) += tg3.o ifeq ($(CONFIG_SK98LIN),y) obj-y += sk98lin/sk98lin.o @@ -129,6 +140,7 @@ obj-$(CONFIG_ES3210) += es3210.o 8390.o obj-$(CONFIG_LNE390) += lne390.o 8390.o obj-$(CONFIG_NE3210) += ne3210.o 8390.o +obj-$(CONFIG_SIMETH) += simeth.o obj-$(CONFIG_PPP) += ppp_generic.o slhc.o obj-$(CONFIG_PPP_ASYNC) += ppp_async.o diff -urN linux-2.4.18/drivers/net/acenic.c lia64-2.4/drivers/net/acenic.c --- linux-2.4.18/drivers/net/acenic.c Tue Feb 26 11:04:19 2002 +++ lia64-2.4/drivers/net/acenic.c Fri Jul 19 17:16:02 2002 @@ -823,10 +823,13 @@ if (ap->version >= 2) writel(readl(®s->CpuBCtrl) | CPU_HALT, ®s->CpuBCtrl); + readl(®s->CpuCtrl); /* GGG flush write */ + /* * This clears any pending interrupts */ writel(1, ®s->Mb0Lo); + readl(®s->Mb0Lo); /* GGG flush write */ /* * Make sure no other CPUs are processing interrupts @@ -1104,35 +1107,28 @@ * to any crashes involving the NIC */ writel(HW_RESET | (HW_RESET << 24), ®s->HostCtrl); - wmb(); + wmb(); readl(®s->HostCtrl); /* GGG flush write */ + mdelay(1); /* - * Don't access any other registes before this point! + * Don't access any other registers before this point! */ -#ifdef __BIG_ENDIAN /* * This will most likely need BYTE_SWAP once we switch * to using __raw_writel() */ -#ifdef __parisc__ - writel((WORD_SWAP | BYTE_SWAP | CLR_INT | - ((WORD_SWAP | BYTE_SWAP | CLR_INT) << 24)), - ®s->HostCtrl); -#else - writel((WORD_SWAP | CLR_INT | ((WORD_SWAP | CLR_INT) << 24)), - ®s->HostCtrl); -#endif -#else writel((CLR_INT | WORD_SWAP | ((CLR_INT | WORD_SWAP) << 24)), ®s->HostCtrl); -#endif - mb(); + mb(); readl(®s->HostCtrl); /* GGG flush write */ /* * Stop the NIC CPU and clear pending interrupts */ writel(readl(®s->CpuCtrl) | CPU_HALT, ®s->CpuCtrl); + readl(®s->CpuCtrl); /* GGG flush write */ + writel(0, ®s->Mb0Lo); + readl(®s->Mb0Lo); /* GGG flush write */ tig_ver = readl(®s->HostCtrl) >> 28; @@ -1151,6 +1147,7 @@ tig_ver, tigon2FwReleaseMajor, tigon2FwReleaseMinor, tigon2FwReleaseFix); writel(readl(®s->CpuBCtrl) | CPU_HALT, ®s->CpuBCtrl); + readl(®s->CpuBCtrl); /* GGG flush write */ /* * The SRAM bank size does _not_ indicate the amount * of memory on the card, it controls the _bank_ size! @@ -1181,7 +1178,7 @@ writel(ACE_BYTE_SWAP_DMA | ACE_WARN | ACE_FATAL | ACE_WORD_SWAP_BD | ACE_NO_JUMBO_FRAG, ®s->ModeStat); #endif - mb(); + mb(); readl(®s->ModeStat); /* GGG flush write */ mac1 = 0; for(i = 0; i < 4; i++) { @@ -1318,7 +1315,7 @@ tmp &= ~DMA_READ_WRITE_MASK; tmp |= DMA_READ_MAX_128; /* - * All the docs sy MUST NOT. Well, I did. + * All the docs say MUST NOT. Well, I did. * Nothing terrible happens, if we load wrong size. * Bit w&i still works better! */ @@ -1327,6 +1324,12 @@ writel(tmp, ®s->PciState); #if 0 +/* The Host PCI bus controller driver has to set FBB. + * If all devices on that PCI bus support FBB, then the controller + * can enable FBB support in the Host PCI Bus controller (or on + * the PCI-PCI bridge if that applies). + * -ggg + */ /* * I have received reports from people having problems when this * bit is enabled. @@ -1395,6 +1398,7 @@ memset(ap->skb, 0, sizeof(struct ace_skb)); ace_load_firmware(dev); + ap->fw_running = 0; tmp_ptr = ap->info_dma; @@ -1406,9 +1410,9 @@ set_aceaddr(&info->evt_ctrl.rngptr, ap->evt_ring_dma); info->evt_ctrl.flags = 0; - set_aceaddr(&info->evt_prd_ptr, ap->evt_prd_dma); *(ap->evt_prd) = 0; - wmb(); + set_aceaddr(&info->evt_prd_ptr, ap->evt_prd_dma); + writel(0, ®s->EvtCsm); set_aceaddr(&info->cmd_ctrl.rngptr, 0x100); @@ -1518,9 +1522,9 @@ writel(DMA_THRESH_8W, ®s->DmaWriteCfg); #endif - writel(0, ®s->MaskInt); writel(1, ®s->IfIdx); - writel(1, ®s->AssistState); + writel(0, ®s->MaskInt); + readl(®s->MaskInt); /* GGG flush write */ writel(DEF_STAT, ®s->TuneStatTicks); writel(DEF_TRACE, ®s->TuneTrace); @@ -1611,6 +1615,7 @@ writel(tigon2FwStartAddr, ®s->Pc); writel(0, ®s->Mb0Lo); + readl(®s->Mb0Lo); /* GGG flush write */ /* * Set tx_csm before we start receiving interrupts, otherwise @@ -1630,10 +1635,21 @@ */ memset(&ap->stats, 0, sizeof(ap->stats)); + /* + * Enable DMA engine now. + * If we do this sooner, Mckinley box pukes. + * I assume it's because Tigon II DMA engine wants to check + * *something* even before the CPU is started. + */ + writel(1, ®s->AssistState); /* enable DMA */ + readl(®s->AssistState); /* GGG flush write */ + mdelay(1); + /* * Start the NIC CPU */ writel(readl(®s->CpuCtrl) & ~(CPU_HALT|CPU_TRACE), ®s->CpuCtrl); + readl(®s->CpuCtrl); /* GGG flush write */ /* * Wait for the firmware to spin up - max 3 seconds. @@ -1646,6 +1662,7 @@ ace_dump_trace(ap); writel(readl(®s->CpuCtrl) | CPU_HALT, ®s->CpuCtrl); + readl(®s->CpuCtrl); /* GGG flush write */ /* aman@sgi.com - account for badly behaving firmware/NIC: * - have observed that the NIC may continue to generate @@ -1660,6 +1677,7 @@ writel(readl(®s->CpuBCtrl) | CPU_HALT, ®s->CpuBCtrl); writel(0, ®s->Mb0Lo); + readl(®s->Mb0Lo); /* GGG flush write */ ecode = -EBUSY; goto init_error; @@ -2328,6 +2346,7 @@ * threads and it is wrong even for that case. */ writel(0, ®s->Mb0Lo); + readl(®s->Mb0Lo); /* GGG flush write */ /* * There is no conflict between transmit handling in @@ -3088,6 +3107,7 @@ tigon2FwRodataLen); ace_copy(regs, tigon2FwData, tigon2FwDataAddr,tigon2FwDataLen); } + readl(®s->CpuCtrl); /* GGG flush write */ return 0; } @@ -3112,23 +3132,24 @@ { u32 local; + mb(); readl(®s->LocalCtrl); /* GGG flush write */ udelay(ACE_SHORT_DELAY); local = readl(®s->LocalCtrl); local |= EEPROM_DATA_OUT | EEPROM_WRITE_ENABLE; writel(local, ®s->LocalCtrl); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG flush write */ udelay(ACE_SHORT_DELAY); local |= EEPROM_CLK_OUT; writel(local, ®s->LocalCtrl); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG flush write */ udelay(ACE_SHORT_DELAY); local &= ~EEPROM_DATA_OUT; writel(local, ®s->LocalCtrl); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG flush write */ udelay(ACE_SHORT_DELAY); local &= ~EEPROM_CLK_OUT; writel(local, ®s->LocalCtrl); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG flush write */ } @@ -3142,7 +3163,7 @@ local &= ~EEPROM_DATA_OUT; local |= EEPROM_WRITE_ENABLE; writel(local, ®s->LocalCtrl); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG flush write */ for (i = 0; i < 8; i++, magic <<= 1) { udelay(ACE_SHORT_DELAY); @@ -3151,16 +3172,16 @@ else local &= ~EEPROM_DATA_OUT; writel(local, ®s->LocalCtrl); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG flush write */ udelay(ACE_SHORT_DELAY); local |= EEPROM_CLK_OUT; writel(local, ®s->LocalCtrl); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG flush write */ udelay(ACE_SHORT_DELAY); local &= ~(EEPROM_CLK_OUT | EEPROM_DATA_OUT); writel(local, ®s->LocalCtrl); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG flush write */ } } @@ -3173,18 +3194,18 @@ local = readl(®s->LocalCtrl); local &= ~EEPROM_WRITE_ENABLE; writel(local, ®s->LocalCtrl); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG flush write */ udelay(ACE_LONG_DELAY); local |= EEPROM_CLK_OUT; writel(local, ®s->LocalCtrl); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG flush write */ udelay(ACE_SHORT_DELAY); /* sample data in middle of high clk */ state = (readl(®s->LocalCtrl) & EEPROM_DATA_IN) != 0; udelay(ACE_SHORT_DELAY); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG flush write */ writel(readl(®s->LocalCtrl) & ~EEPROM_CLK_OUT, ®s->LocalCtrl); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG flush write */ return state; } @@ -3239,7 +3260,7 @@ regs = ((struct ace_private *)dev->priv)->regs; /* - * Don't take interrupts on this CPU will bit banging + * Don't take interrupts on this CPU while bit banging * the %#%#@$ I2C device */ __save_flags(flags); @@ -3287,12 +3308,14 @@ local = readl(®s->LocalCtrl); local &= ~EEPROM_WRITE_ENABLE; writel(local, ®s->LocalCtrl); + readl(®s->LocalCtrl); /* GGG flush write */ udelay(ACE_LONG_DELAY); mb(); local |= EEPROM_CLK_OUT; writel(local, ®s->LocalCtrl); - mb(); + readl(®s->LocalCtrl); /* GGG flush write */ udelay(ACE_SHORT_DELAY); + mb(); /* sample data mid high clk */ result = (result << 1) | ((readl(®s->LocalCtrl) & EEPROM_DATA_IN) != 0); @@ -3301,11 +3324,13 @@ local = readl(®s->LocalCtrl); local &= ~EEPROM_CLK_OUT; writel(local, ®s->LocalCtrl); + readl(®s->LocalCtrl); /* GGG flush write */ udelay(ACE_SHORT_DELAY); mb(); if (i == 7) { local |= EEPROM_WRITE_ENABLE; writel(local, ®s->LocalCtrl); + readl(®s->LocalCtrl); /* GGG flush write */ mb(); udelay(ACE_SHORT_DELAY); } @@ -3313,12 +3338,12 @@ local |= EEPROM_DATA_OUT; writel(local, ®s->LocalCtrl); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG Flush write */ udelay(ACE_SHORT_DELAY); writel(readl(®s->LocalCtrl) | EEPROM_CLK_OUT, ®s->LocalCtrl); udelay(ACE_LONG_DELAY); writel(readl(®s->LocalCtrl) & ~EEPROM_CLK_OUT, ®s->LocalCtrl); - mb(); + mb(); readl(®s->LocalCtrl); /* GGG Flush write */ udelay(ACE_SHORT_DELAY); eeprom_stop(regs); diff -urN linux-2.4.18/drivers/net/bcm/5701rls.c lia64-2.4/drivers/net/bcm/5701rls.c --- linux-2.4.18/drivers/net/bcm/5701rls.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/5701rls.c Thu Apr 11 16:38:50 2002 @@ -0,0 +1,48 @@ +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/* History: */ +/* */ +/******************************************************************************/ + +#if INCLUDE_5701_AX_FIX + +#include "mm.h" +#include "5701rls.h" + +LM_STATUS LM_LoadRlsFirmware(PLM_DEVICE_BLOCK pDevice) +{ + T3_FWIMG_INFO FwImgInfo; + + FwImgInfo.StartAddress = t3FwStartAddr; + FwImgInfo.Text.Buffer = (PLM_UINT8)t3FwText; + FwImgInfo.Text.Offset = t3FwTextAddr; + FwImgInfo.Text.Length = t3FwTextLen; + FwImgInfo.ROnlyData.Buffer = (PLM_UINT8)t3FwRodata; + FwImgInfo.ROnlyData.Offset = t3FwRodataAddr; + FwImgInfo.ROnlyData.Length = t3FwRodataLen; + FwImgInfo.Data.Buffer = (PLM_UINT8)t3FwData; + FwImgInfo.Data.Offset = t3FwDataAddr; + FwImgInfo.Data.Length = t3FwDataLen; + + if (LM_LoadFirmware(pDevice, + &FwImgInfo, + T3_RX_CPU_ID | T3_TX_CPU_ID, + T3_RX_CPU_ID) != LM_STATUS_SUCCESS) + { + DbgMessage(FATAL, ("Failed loading firmware.\n")); + DbgBreak(); + return LM_STATUS_FAILURE; + } + + return LM_STATUS_SUCCESS; +} + +#endif /* INCLUDE_5701_AX_FIX */ diff -urN linux-2.4.18/drivers/net/bcm/5701rls.h lia64-2.4/drivers/net/bcm/5701rls.h --- linux-2.4.18/drivers/net/bcm/5701rls.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/5701rls.h Wed Feb 27 14:16:55 2002 @@ -0,0 +1,198 @@ +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/* History: */ +/******************************************************************************/ + +typedef unsigned long U32; +int t3FwReleaseMajor = 0x0; +int t3FwReleaseMinor = 0x0; +int t3FwReleaseFix = 0x0; +U32 t3FwStartAddr = 0x08000000; +U32 t3FwTextAddr = 0x08000000; +int t3FwTextLen = 0x9c0; +U32 t3FwRodataAddr = 0x080009c0; +int t3FwRodataLen = 0x60; +U32 t3FwDataAddr = 0x08000a40; +int t3FwDataLen = 0x20; +U32 t3FwSbssAddr = 0x08000a60; +int t3FwSbssLen = 0xc; +U32 t3FwBssAddr = 0x08000a70; +int t3FwBssLen = 0x10; +U32 t3FwText[(0x9c0/4) + 1] = { +0x0, +0x10000003, 0x0, 0xd, 0xd, +0x3c1d0800, 0x37bd3ffc, 0x3a0f021, 0x3c100800, +0x26100000, 0xe000018, 0x0, 0xd, +0x3c1d0800, 0x37bd3ffc, 0x3a0f021, 0x3c100800, +0x26100034, 0xe00021c, 0x0, 0xd, +0x0, 0x0, 0x0, 0x27bdffe0, +0x3c1cc000, 0xafbf0018, 0xaf80680c, 0xe00004c, +0x241b2105, 0x97850000, 0x97870002, 0x9782002c, +0x9783002e, 0x3c040800, 0x248409c0, 0xafa00014, +0x21400, 0x621825, 0x52c00, 0xafa30010, +0x8f860010, 0xe52825, 0xe000060, 0x24070102, +0x3c02ac00, 0x34420100, 0x3c03ac01, 0x34630100, +0xaf820490, 0x3c02ffff, 0xaf820494, 0xaf830498, +0xaf82049c, 0x24020001, 0xaf825ce0, 0xe00003f, +0xaf825d00, 0xe000140, 0x0, 0x8fbf0018, +0x3e00008, 0x27bd0020, 0x2402ffff, 0xaf825404, +0x8f835400, 0x34630400, 0xaf835400, 0xaf825404, +0x3c020800, 0x24420034, 0xaf82541c, 0x3e00008, +0xaf805400, 0x0, 0x0, 0x3c020800, +0x34423000, 0x3c030800, 0x34633000, 0x3c040800, +0x348437ff, 0x3c010800, 0xac220a64, 0x24020040, +0x3c010800, 0xac220a68, 0x3c010800, 0xac200a60, +0xac600000, 0x24630004, 0x83102b, 0x5040fffd, +0xac600000, 0x3e00008, 0x0, 0x804821, +0x8faa0010, 0x3c020800, 0x8c420a60, 0x3c040800, +0x8c840a68, 0x8fab0014, 0x24430001, 0x44102b, +0x3c010800, 0xac230a60, 0x14400003, 0x4021, +0x3c010800, 0xac200a60, 0x3c020800, 0x8c420a60, +0x3c030800, 0x8c630a64, 0x91240000, 0x21140, +0x431021, 0x481021, 0x25080001, 0xa0440000, +0x29020008, 0x1440fff4, 0x25290001, 0x3c020800, +0x8c420a60, 0x3c030800, 0x8c630a64, 0x8f84680c, +0x21140, 0x431021, 0xac440008, 0xac45000c, +0xac460010, 0xac470014, 0xac4a0018, 0x3e00008, +0xac4b001c, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x2000008, +0x0, 0xa0001e3, 0x3c0a0001, 0xa0001e3, +0x3c0a0002, 0xa0001e3, 0x0, 0xa0001e3, +0x0, 0xa0001e3, 0x0, 0xa0001e3, +0x0, 0xa0001e3, 0x0, 0xa0001e3, +0x0, 0xa0001e3, 0x0, 0xa0001e3, +0x0, 0xa0001e3, 0x0, 0xa0001e3, +0x3c0a0007, 0xa0001e3, 0x3c0a0008, 0xa0001e3, +0x3c0a0009, 0xa0001e3, 0x0, 0xa0001e3, +0x0, 0xa0001e3, 0x3c0a000b, 0xa0001e3, +0x3c0a000c, 0xa0001e3, 0x3c0a000d, 0xa0001e3, +0x0, 0xa0001e3, 0x0, 0xa0001e3, +0x3c0a000e, 0xa0001e3, 0x0, 0xa0001e3, +0x0, 0xa0001e3, 0x0, 0xa0001e3, +0x0, 0xa0001e3, 0x0, 0xa0001e3, +0x0, 0xa0001e3, 0x0, 0xa0001e3, +0x0, 0xa0001e3, 0x3c0a0013, 0xa0001e3, +0x3c0a0014, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x27bdffe0, +0x1821, 0x1021, 0xafbf0018, 0xafb10014, +0xafb00010, 0x3c010800, 0x220821, 0xac200a70, +0x3c010800, 0x220821, 0xac200a74, 0x3c010800, +0x220821, 0xac200a78, 0x24630001, 0x1860fff5, +0x2442000c, 0x24110001, 0x8f906810, 0x32020004, +0x14400005, 0x24040001, 0x3c020800, 0x8c420a78, +0x18400003, 0x2021, 0xe000182, 0x0, +0x32020001, 0x10400003, 0x0, 0xe000169, +0x0, 0xa000153, 0xaf915028, 0x8fbf0018, +0x8fb10014, 0x8fb00010, 0x3e00008, 0x27bd0020, +0x3c050800, 0x8ca50a70, 0x3c060800, 0x8cc60a80, +0x3c070800, 0x8ce70a78, 0x27bdffe0, 0x3c040800, +0x248409d0, 0xafbf0018, 0xafa00010, 0xe000060, +0xafa00014, 0xe00017b, 0x2021, 0x8fbf0018, +0x3e00008, 0x27bd0020, 0x24020001, 0x8f836810, +0x821004, 0x21027, 0x621824, 0x3e00008, +0xaf836810, 0x27bdffd8, 0xafbf0024, 0x1080002e, +0xafb00020, 0x8f825cec, 0xafa20018, 0x8f825cec, +0x3c100800, 0x26100a78, 0xafa2001c, 0x34028000, +0xaf825cec, 0x8e020000, 0x18400016, 0x0, +0x3c020800, 0x94420a74, 0x8fa3001c, 0x221c0, +0xac830004, 0x8fa2001c, 0x3c010800, 0xe000201, +0xac220a74, 0x10400005, 0x0, 0x8e020000, +0x24420001, 0xa0001df, 0xae020000, 0x3c020800, +0x8c420a70, 0x21c02, 0x321c0, 0xa0001c5, +0xafa2001c, 0xe000201, 0x0, 0x1040001f, +0x0, 0x8e020000, 0x8fa3001c, 0x24420001, +0x3c010800, 0xac230a70, 0x3c010800, 0xac230a74, +0xa0001df, 0xae020000, 0x3c100800, 0x26100a78, +0x8e020000, 0x18400028, 0x0, 0xe000201, +0x0, 0x14400024, 0x0, 0x8e020000, +0x3c030800, 0x8c630a70, 0x2442ffff, 0xafa3001c, +0x18400006, 0xae020000, 0x31402, 0x221c0, +0x8c820004, 0x3c010800, 0xac220a70, 0x97a2001e, +0x2442ff00, 0x2c420300, 0x1440000b, 0x24024000, +0x3c040800, 0x248409dc, 0xafa00010, 0xafa00014, +0x8fa6001c, 0x24050008, 0xe000060, 0x3821, +0xa0001df, 0x0, 0xaf825cf8, 0x3c020800, +0x8c420a40, 0x8fa3001c, 0x24420001, 0xaf835cf8, +0x3c010800, 0xac220a40, 0x8fbf0024, 0x8fb00020, +0x3e00008, 0x27bd0028, 0x27bdffe0, 0x3c040800, +0x248409e8, 0x2821, 0x3021, 0x3821, +0xafbf0018, 0xafa00010, 0xe000060, 0xafa00014, +0x8fbf0018, 0x3e00008, 0x27bd0020, 0x8f82680c, +0x8f85680c, 0x21827, 0x3182b, 0x31823, +0x431024, 0x441021, 0xa2282b, 0x10a00006, +0x0, 0x401821, 0x8f82680c, 0x43102b, +0x1440fffd, 0x0, 0x3e00008, 0x0, +0x3c040800, 0x8c840000, 0x3c030800, 0x8c630a40, +0x64102b, 0x54400002, 0x831023, 0x641023, +0x2c420008, 0x3e00008, 0x38420001, 0x27bdffe0, +0x802821, 0x3c040800, 0x24840a00, 0x3021, +0x3821, 0xafbf0018, 0xafa00010, 0xe000060, +0xafa00014, 0xa000216, 0x0, 0x8fbf0018, +0x3e00008, 0x27bd0020, 0x0, 0x27bdffe0, +0x3c1cc000, 0xafbf0018, 0xe00004c, 0xaf80680c, +0x3c040800, 0x24840a10, 0x3802821, 0x3021, +0x3821, 0xafa00010, 0xe000060, 0xafa00014, +0x2402ffff, 0xaf825404, 0x3c0200aa, 0xe000234, +0xaf825434, 0x8fbf0018, 0x3e00008, 0x27bd0020, +0x0, 0x0, 0x0, 0x27bdffe8, +0xafb00010, 0x24100001, 0xafbf0014, 0x3c01c003, +0xac200000, 0x8f826810, 0x30422000, 0x10400003, +0x0, 0xe000246, 0x0, 0xa00023a, +0xaf905428, 0x8fbf0014, 0x8fb00010, 0x3e00008, +0x27bd0018, 0x27bdfff8, 0x8f845d0c, 0x3c0200ff, +0x3c030800, 0x8c630a50, 0x3442fff8, 0x821024, +0x1043001e, 0x3c0500ff, 0x34a5fff8, 0x3c06c003, +0x3c074000, 0x851824, 0x8c620010, 0x3c010800, +0xac230a50, 0x30420008, 0x10400005, 0x871025, +0x8cc20000, 0x24420001, 0xacc20000, 0x871025, +0xaf825d0c, 0x8fa20000, 0x24420001, 0xafa20000, +0x8fa20000, 0x8fa20000, 0x24420001, 0xafa20000, +0x8fa20000, 0x8f845d0c, 0x3c030800, 0x8c630a50, +0x851024, 0x1443ffe8, 0x851824, 0x27bd0008, +0x3e00008, 0x0, 0x0, 0x0 }; +U32 t3FwRodata[(0x60/4) + 1] = { +0x35373031, 0x726c7341, 0x0, +0x0, 0x53774576, 0x656e7430, 0x0, +0x726c7045, 0x76656e74, 0x31000000, 0x556e6b6e, +0x45766e74, 0x0, 0x0, 0x0, +0x0, 0x66617461, 0x6c457272, 0x0, +0x0, 0x4d61696e, 0x43707542, 0x0, +0x0, 0x0 }; +U32 t3FwData[(0x20/4) + 1] = { +0x0, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, +0x0, 0x0 }; diff -urN linux-2.4.18/drivers/net/bcm/Makefile lia64-2.4/drivers/net/bcm/Makefile --- linux-2.4.18/drivers/net/bcm/Makefile Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/Makefile Wed Feb 27 14:16:55 2002 @@ -0,0 +1,13 @@ + +# +# Makefile for linux/drivers/net/bcm +# + +O_TARGET := bcm5700.o +obj-y := b57um.o b57proc.o tigon3.o autoneg.o 5701rls.o +obj-m := $(O_TARGET) + +EXTRA_CFLAGS = -DDBG=0 -DT3_JUMBO_RCV_RCB_ENTRY_COUNT=256 -DNICE_SUPPORT -DPCIX_TARGET_WORKAROUND=1 -DINCLUDE_TBI_SUPPORT -DINCLUDE_5701_AX_FIX=1 + +include $(TOPDIR)/Rules.make + diff -urN linux-2.4.18/drivers/net/bcm/autoneg.c lia64-2.4/drivers/net/bcm/autoneg.c --- linux-2.4.18/drivers/net/bcm/autoneg.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/autoneg.c Thu Apr 11 16:38:50 2002 @@ -0,0 +1,535 @@ +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2001 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/* History: */ +/******************************************************************************/ + +#if INCLUDE_TBI_SUPPORT +#include "autoneg.h" +#include "mm.h" + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +void +MM_AnTxConfig( + PAN_STATE_INFO pAnInfo) +{ + PLM_DEVICE_BLOCK pDevice; + + pDevice = (PLM_DEVICE_BLOCK) pAnInfo->pContext; + + REG_WR(pDevice, MacCtrl.TxAutoNeg, (LM_UINT32) pAnInfo->TxConfig.AsUSHORT); + + pDevice->MacMode |= MAC_MODE_SEND_CONFIGS; + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode); +} + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +void +MM_AnTxIdle( + PAN_STATE_INFO pAnInfo) +{ + PLM_DEVICE_BLOCK pDevice; + + pDevice = (PLM_DEVICE_BLOCK) pAnInfo->pContext; + + pDevice->MacMode &= ~MAC_MODE_SEND_CONFIGS; + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode); +} + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +char +MM_AnRxConfig( + PAN_STATE_INFO pAnInfo, + unsigned short *pRxConfig) +{ + PLM_DEVICE_BLOCK pDevice; + LM_UINT32 Value32; + char Retcode; + + Retcode = AN_FALSE; + + pDevice = (PLM_DEVICE_BLOCK) pAnInfo->pContext; + + Value32 = REG_RD(pDevice, MacCtrl.Status); + if(Value32 & MAC_STATUS_RECEIVING_CFG) + { + Value32 = REG_RD(pDevice, MacCtrl.RxAutoNeg); + *pRxConfig = (unsigned short) Value32; + + Retcode = AN_TRUE; + } + + return Retcode; +} + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +void +AutonegInit( + PAN_STATE_INFO pAnInfo) +{ + unsigned long j; + + for(j = 0; j < sizeof(AN_STATE_INFO); j++) + { + ((unsigned char *) pAnInfo)[j] = 0; + } + + /* Initialize the default advertisement register. */ + pAnInfo->mr_adv_full_duplex = 1; + pAnInfo->mr_adv_sym_pause = 1; + pAnInfo->mr_adv_asym_pause = 1; + pAnInfo->mr_an_enable = 1; +} + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +AUTONEG_STATUS +Autoneg8023z( + PAN_STATE_INFO pAnInfo) +{ + unsigned short RxConfig; + unsigned long Delta_us; + AUTONEG_STATUS AnRet; + + /* Get the current time. */ + if(pAnInfo->State == AN_STATE_UNKNOWN) + { + pAnInfo->RxConfig.AsUSHORT = 0; + pAnInfo->CurrentTime_us = 0; + pAnInfo->LinkTime_us = 0; + pAnInfo->AbilityMatchCfg = 0; + pAnInfo->AbilityMatchCnt = 0; + pAnInfo->AbilityMatch = AN_FALSE; + pAnInfo->IdleMatch = AN_FALSE; + pAnInfo->AckMatch = AN_FALSE; + } + + /* Increment the timer tick. This function is called every microsecon. */ +// pAnInfo->CurrentTime_us++; + + /* Set the AbilityMatch, IdleMatch, and AckMatch flags if their */ + /* corresponding conditions are satisfied. */ + if(MM_AnRxConfig(pAnInfo, &RxConfig)) + { + if(RxConfig != pAnInfo->AbilityMatchCfg) + { + pAnInfo->AbilityMatchCfg = RxConfig; + pAnInfo->AbilityMatch = AN_FALSE; + pAnInfo->AbilityMatchCnt = 0; + } + else + { + pAnInfo->AbilityMatchCnt++; + if(pAnInfo->AbilityMatchCnt > 1) + { + pAnInfo->AbilityMatch = AN_TRUE; + pAnInfo->AbilityMatchCfg = RxConfig; + } + } + + if(RxConfig & AN_CONFIG_ACK) + { + pAnInfo->AckMatch = AN_TRUE; + } + else + { + pAnInfo->AckMatch = AN_FALSE; + } + + pAnInfo->IdleMatch = AN_FALSE; + } + else + { + pAnInfo->IdleMatch = AN_TRUE; + + pAnInfo->AbilityMatchCfg = 0; + pAnInfo->AbilityMatchCnt = 0; + pAnInfo->AbilityMatch = AN_FALSE; + pAnInfo->AckMatch = AN_FALSE; + + RxConfig = 0; + } + + /* Save the last Config. */ + pAnInfo->RxConfig.AsUSHORT = RxConfig; + + /* Default return code. */ + AnRet = AUTONEG_STATUS_OK; + + /* Autoneg state machine as defined in 802.3z section 37.3.1.5. */ + switch(pAnInfo->State) + { + case AN_STATE_UNKNOWN: + if(pAnInfo->mr_an_enable || pAnInfo->mr_restart_an) + { + pAnInfo->CurrentTime_us = 0; + pAnInfo->State = AN_STATE_AN_ENABLE; + } + + /* Fall through.*/ + + case AN_STATE_AN_ENABLE: + pAnInfo->mr_an_complete = AN_FALSE; + pAnInfo->mr_page_rx = AN_FALSE; + + if(pAnInfo->mr_an_enable) + { + pAnInfo->LinkTime_us = 0; + pAnInfo->AbilityMatchCfg = 0; + pAnInfo->AbilityMatchCnt = 0; + pAnInfo->AbilityMatch = AN_FALSE; + pAnInfo->IdleMatch = AN_FALSE; + pAnInfo->AckMatch = AN_FALSE; + + pAnInfo->State = AN_STATE_AN_RESTART_INIT; + } + else + { + pAnInfo->State = AN_STATE_DISABLE_LINK_OK; + } + break; + + case AN_STATE_AN_RESTART_INIT: + pAnInfo->LinkTime_us = pAnInfo->CurrentTime_us; + pAnInfo->mr_np_loaded = AN_FALSE; + + pAnInfo->TxConfig.AsUSHORT = 0; + MM_AnTxConfig(pAnInfo); + + AnRet = AUTONEG_STATUS_TIMER_ENABLED; + + pAnInfo->State = AN_STATE_AN_RESTART; + + /* Fall through.*/ + + case AN_STATE_AN_RESTART: + /* Get the current time and compute the delta with the saved */ + /* link timer. */ + Delta_us = pAnInfo->CurrentTime_us - pAnInfo->LinkTime_us; + if(Delta_us > AN_LINK_TIMER_INTERVAL_US) + { + pAnInfo->State = AN_STATE_ABILITY_DETECT_INIT; + } + else + { + AnRet = AUTONEG_STATUS_TIMER_ENABLED; + } + break; + + case AN_STATE_DISABLE_LINK_OK: + AnRet = AUTONEG_STATUS_DONE; + break; + + case AN_STATE_ABILITY_DETECT_INIT: + /* Note: in the state diagram, this variable is set to */ + /* mr_adv_ability<12>. Is this right?. */ + pAnInfo->mr_toggle_tx = AN_FALSE; + +#if DBG + DbgMessage(INFORM, ("TxConfig: ")); + + if(pAnInfo->mr_adv_full_duplex) + { + DbgMessage(INFORM, ("FD ")); + } + + if(pAnInfo->mr_adv_half_duplex) + { + DbgMessage(INFORM, ("HD ")); + } + + if(pAnInfo->mr_adv_sym_pause) + { + DbgMessage(INFORM, ("PS1 ")); + } + + if(pAnInfo->mr_adv_asym_pause) + { + DbgMessage(INFORM, ("PS2 ")); + } + + if(pAnInfo->mr_adv_remote_fault1) + { + DbgMessage(INFORM, ("RF1 ")); + } + + if(pAnInfo->mr_adv_remote_fault2) + { + DbgMessage(INFORM, ("RF2 ")); + } + + if(pAnInfo->mr_adv_next_page) + { + DbgMessage(INFORM, ("NP ")); + } + + DbgMessage(INFORM, ("\n")); +#endif + + /* Send the config as advertised in the advertisement register. */ + pAnInfo->TxConfig.AsUSHORT = 0; + pAnInfo->TxConfig.D5_FD = pAnInfo->mr_adv_full_duplex; + pAnInfo->TxConfig.D6_HD = pAnInfo->mr_adv_half_duplex; + pAnInfo->TxConfig.D7_PS1 = pAnInfo->mr_adv_sym_pause; + pAnInfo->TxConfig.D8_PS2 = pAnInfo->mr_adv_asym_pause; + pAnInfo->TxConfig.D12_RF1 = pAnInfo->mr_adv_remote_fault1; + pAnInfo->TxConfig.D13_RF2 = pAnInfo->mr_adv_remote_fault2; + pAnInfo->TxConfig.D15_NP = pAnInfo->mr_adv_next_page; + + MM_AnTxConfig(pAnInfo); + + pAnInfo->State = AN_STATE_ABILITY_DETECT; + + break; + + case AN_STATE_ABILITY_DETECT: + if(pAnInfo->AbilityMatch == AN_TRUE && + pAnInfo->RxConfig.AsUSHORT != 0) + { + pAnInfo->State = AN_STATE_ACK_DETECT_INIT; + } + + break; + + case AN_STATE_ACK_DETECT_INIT: + pAnInfo->TxConfig.D14_ACK = 1; + MM_AnTxConfig(pAnInfo); + + pAnInfo->State = AN_STATE_ACK_DETECT; + + /* Fall through. */ + + case AN_STATE_ACK_DETECT: + if(pAnInfo->AckMatch == AN_TRUE) + { + if((pAnInfo->RxConfig.AsUSHORT & ~AN_CONFIG_ACK) == + (pAnInfo->AbilityMatchCfg & ~AN_CONFIG_ACK)) + { + pAnInfo->State = AN_STATE_COMPLETE_ACK_INIT; + } + else + { + DbgMessage(FATAL, ("1 ACK_DETECT ===> AN_ENABLE.\n")); + pAnInfo->State = AN_STATE_AN_ENABLE; + } + } + else if(pAnInfo->AbilityMatch == AN_TRUE && + pAnInfo->RxConfig.AsUSHORT == 0) + { + DbgMessage(FATAL, ("2 ACK_DETECT ===> AN_ENABLE.\n")); + pAnInfo->State = AN_STATE_AN_ENABLE; + } + + break; + + case AN_STATE_COMPLETE_ACK_INIT: + /* Make sure invalid bits are not set. */ + if(pAnInfo->RxConfig.bits.D0 || pAnInfo->RxConfig.bits.D1 || + pAnInfo->RxConfig.bits.D2 || pAnInfo->RxConfig.bits.D3 || + pAnInfo->RxConfig.bits.D4 || pAnInfo->RxConfig.bits.D9 || + pAnInfo->RxConfig.bits.D10 || pAnInfo->RxConfig.bits.D11) + { + DbgMessage(FATAL, ("Received an invalid Config.\n")); + DbgBreak(); + AnRet = AUTONEG_STATUS_FAILED; + break; + } + + /* Set up the link partner advertisement register. */ + pAnInfo->mr_lp_adv_full_duplex = pAnInfo->RxConfig.D5_FD; + pAnInfo->mr_lp_adv_half_duplex = pAnInfo->RxConfig.D6_HD; + pAnInfo->mr_lp_adv_sym_pause = pAnInfo->RxConfig.D7_PS1; + pAnInfo->mr_lp_adv_asym_pause = pAnInfo->RxConfig.D8_PS2; + pAnInfo->mr_lp_adv_remote_fault1 = pAnInfo->RxConfig.D12_RF1; + pAnInfo->mr_lp_adv_remote_fault2 = pAnInfo->RxConfig.D13_RF2; + pAnInfo->mr_lp_adv_next_page = pAnInfo->RxConfig.D15_NP; +#if DBG + DbgMessage(INFORM, ("RxConfig: ")); + + if(pAnInfo->mr_lp_adv_full_duplex) + { + DbgMessage(INFORM, ("FD ")); + } + + if(pAnInfo->mr_lp_adv_half_duplex) + { + DbgMessage(INFORM, ("HD ")); + } + + if(pAnInfo->mr_lp_adv_sym_pause) + { + DbgMessage(INFORM, ("PS1 ")); + } + + if(pAnInfo->mr_lp_adv_asym_pause) + { + DbgMessage(INFORM, ("PS2 ")); + } + + if(pAnInfo->mr_lp_adv_remote_fault1) + { + DbgMessage(INFORM, ("RF1 ")); + } + + if(pAnInfo->mr_lp_adv_remote_fault2) + { + DbgMessage(INFORM, ("RF2 ")); + } + + if(pAnInfo->mr_lp_adv_next_page) + { + DbgMessage(INFORM, ("NP ")); + } + + DbgMessage(INFORM, ("\n")); +#endif + + pAnInfo->LinkTime_us = pAnInfo->CurrentTime_us; + + pAnInfo->mr_toggle_tx = !pAnInfo->mr_toggle_tx; + pAnInfo->mr_toggle_rx = pAnInfo->RxConfig.bits.D11; + pAnInfo->mr_np_rx = pAnInfo->RxConfig.D15_NP; + pAnInfo->mr_page_rx = AN_TRUE; + + pAnInfo->State = AN_STATE_COMPLETE_ACK; + AnRet = AUTONEG_STATUS_TIMER_ENABLED; + + break; + + case AN_STATE_COMPLETE_ACK: + if(pAnInfo->AbilityMatch == AN_TRUE && + pAnInfo->RxConfig.AsUSHORT == 0) + { + DbgMessage(FATAL, ("COMPLETE_ACK ===> AN_ENABLE.\n")); + pAnInfo->State = AN_STATE_AN_ENABLE; + break; + } + + Delta_us = pAnInfo->CurrentTime_us - pAnInfo->LinkTime_us; + + if(Delta_us > AN_LINK_TIMER_INTERVAL_US) + { + if(pAnInfo->mr_adv_next_page == 0 || + pAnInfo->mr_lp_adv_next_page == 0) + { + pAnInfo->State = AN_STATE_IDLE_DETECT_INIT; + } + else + { + if(pAnInfo->TxConfig.bits.D15 == 0 && + pAnInfo->mr_np_rx == 0) + { + pAnInfo->State = AN_STATE_IDLE_DETECT_INIT; + } + else + { + DbgMessage(FATAL, ("Next page not implemented.\n")); + DbgBreak(); + AnRet = AUTONEG_STATUS_FAILED; + } + } + } + + break; + + case AN_STATE_IDLE_DETECT_INIT: + pAnInfo->LinkTime_us = pAnInfo->CurrentTime_us; + + MM_AnTxIdle(pAnInfo); + + pAnInfo->State = AN_STATE_IDLE_DETECT; + + AnRet = AUTONEG_STATUS_TIMER_ENABLED; + + break; + + case AN_STATE_IDLE_DETECT: + if(pAnInfo->AbilityMatch == AN_TRUE && + pAnInfo->RxConfig.AsUSHORT == 0) + { + DbgMessage(FATAL, ("IDLE_DETECT ===> AN_ENABLE.\n")); + pAnInfo->State = AN_STATE_AN_ENABLE; + break; + } + + Delta_us = pAnInfo->CurrentTime_us - pAnInfo->LinkTime_us; + if(Delta_us > AN_LINK_TIMER_INTERVAL_US) + { +// if(pAnInfo->IdleMatch == AN_TRUE) +// { + pAnInfo->State = AN_STATE_LINK_OK; +// } +// else +// { +// DbgMessage(FATAL, ("Autoneg failed in IDLE_DETECT.\n")); +// AnRet = AUTONEG_STATUS_FAILED; +// break; +// } + } + + break; + + case AN_STATE_LINK_OK: + pAnInfo->mr_an_complete = AN_TRUE; + pAnInfo->mr_link_ok = AN_TRUE; + AnRet = AUTONEG_STATUS_DONE; + + break; + + case AN_STATE_NEXT_PAGE_WAIT_INIT: + DbgMessage(FATAL, ("Not implemented.\n")); + DbgBreak(); + break; + + case AN_STATE_NEXT_PAGE_WAIT: + DbgMessage(FATAL, ("Not implemented.\n")); + DbgBreak(); + break; + + default: + DbgMessage(FATAL, ("Invalid AN state.\n")); + DbgBreak(); + AnRet = AUTONEG_STATUS_FAILED; + break; + } + + return AnRet; +} +#endif /* INCLUDE_TBI_SUPPORT */ + diff -urN linux-2.4.18/drivers/net/bcm/autoneg.h lia64-2.4/drivers/net/bcm/autoneg.h --- linux-2.4.18/drivers/net/bcm/autoneg.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/autoneg.h Fri Jul 19 17:16:21 2002 @@ -0,0 +1,416 @@ +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2001 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/* History: */ +/******************************************************************************/ + + +#ifndef AUTONEG_H +#define AUTONEG_H + + + +/******************************************************************************/ +/* Constants. */ +/******************************************************************************/ + +#define AN_LINK_TIMER_INTERVAL_US 12000 /* 10ms */ + +/* TRUE, FALSE */ +#define AN_TRUE 1 +#define AN_FALSE 0 + + + +/******************************************************************************/ +/* Main data structure for keeping track of 802.3z auto-negotation state */ +/* variables as shown in Figure 37-6 of the IEEE 802.3z specification. */ +/******************************************************************************/ + +typedef struct +{ + /* Current auto-negotiation state. */ + unsigned long State; + #define AN_STATE_UNKNOWN 0 + #define AN_STATE_AN_ENABLE 1 + #define AN_STATE_AN_RESTART_INIT 2 + #define AN_STATE_AN_RESTART 3 + #define AN_STATE_DISABLE_LINK_OK 4 + #define AN_STATE_ABILITY_DETECT_INIT 5 + #define AN_STATE_ABILITY_DETECT 6 + #define AN_STATE_ACK_DETECT_INIT 7 + #define AN_STATE_ACK_DETECT 8 + #define AN_STATE_COMPLETE_ACK_INIT 9 + #define AN_STATE_COMPLETE_ACK 10 + #define AN_STATE_IDLE_DETECT_INIT 11 + #define AN_STATE_IDLE_DETECT 12 + #define AN_STATE_LINK_OK 13 + #define AN_STATE_NEXT_PAGE_WAIT_INIT 14 + #define AN_STATE_NEXT_PAGE_WAIT 16 + + /* Link timer. */ + unsigned long LinkTime_us; + + /* Current time. */ + unsigned long CurrentTime_us; + + /* Need these values for consistency check. */ + unsigned short AbilityMatchCfg; + + /* Ability, idle, and ack match functions. */ + unsigned long AbilityMatchCnt; + char AbilityMatch; + char IdleMatch; + char AckMatch; + + /* Tx config data */ + union + { + /* The TxConfig register is arranged as follows: */ + /* */ + /* MSB LSB */ + /* +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ */ + /* | D7| D6| D5| D4| D3| D2| D1| D0|D15|D14|D13|D12|D11|D10| D9| D8| */ + /* +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ */ + struct + { +#ifdef BIG_ENDIAN_HOST + unsigned short D7:1; /* PS1 */ + unsigned short D6:1; /* HD */ + unsigned short D5:1; /* FD */ + unsigned short D4:1; + unsigned short D3:1; + unsigned short D2:1; + unsigned short D1:1; + unsigned short D0:1; + unsigned short D15:1; /* NP */ + unsigned short D14:1; /* ACK */ + unsigned short D13:1; /* RF2 */ + unsigned short D12:1; /* RF1 */ + unsigned short D11:1; + unsigned short D10:1; + unsigned short D9:1; + unsigned short D8:1; /* PS2 */ +#else /* BIG_ENDIAN_HOST */ + unsigned int D8:1; /* PS2 */ + unsigned int D9:1; + unsigned int D10:1; + unsigned int D11:1; + unsigned int D12:1; /* RF1 */ + unsigned int D13:1; /* RF2 */ + unsigned int D14:1; /* ACK */ + unsigned int D15:1; /* NP */ + unsigned int D0:1; + unsigned int D1:1; + unsigned int D2:1; + unsigned int D3:1; + unsigned int D4:1; + unsigned int D5:1; /* FD */ + unsigned int D6:1; /* HD */ + unsigned int D7:1; /* PS1 */ +#endif + } bits; + + unsigned short AsUSHORT; + + #define D8_PS2 bits.D8 + #define D12_RF1 bits.D12 + #define D13_RF2 bits.D13 + #define D14_ACK bits.D14 + #define D15_NP bits.D15 + #define D5_FD bits.D5 + #define D6_HD bits.D6 + #define D7_PS1 bits.D7 + } TxConfig; + + /* Rx config data */ + union + { + /* The RxConfig register is arranged as follows: */ + /* */ + /* MSB LSB */ + /* +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ */ + /* | D7| D6| D5| D4| D3| D2| D1| D0|D15|D14|D13|D12|D11|D10| D9| D8| */ + /* +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ */ + struct + { +#ifdef BIG_ENDIAN_HOST + unsigned short D7:1; /* PS1 */ + unsigned short D6:1; /* HD */ + unsigned short D5:1; /* FD */ + unsigned short D4:1; + unsigned short D3:1; + unsigned short D2:1; + unsigned short D1:1; + unsigned short D0:1; + unsigned short D15:1; /* NP */ + unsigned short D14:1; /* ACK */ + unsigned short D13:1; /* RF2 */ + unsigned short D12:1; /* RF1 */ + unsigned short D11:1; + unsigned short D10:1; + unsigned short D9:1; + unsigned short D8:1; /* PS2 */ +#else /* BIG_ENDIAN_HOST */ + unsigned int D8:1; /* PS2 */ + unsigned int D9:1; + unsigned int D10:1; + unsigned int D11:1; + unsigned int D12:1; /* RF1 */ + unsigned int D13:1; /* RF2 */ + unsigned int D14:1; /* ACK */ + unsigned int D15:1; /* NP */ + unsigned int D0:1; + unsigned int D1:1; + unsigned int D2:1; + unsigned int D3:1; + unsigned int D4:1; + unsigned int D5:1; /* FD */ + unsigned int D6:1; /* HD */ + unsigned int D7:1; /* PS1 */ +#endif + } bits; + + unsigned short AsUSHORT; + } RxConfig; + + #define AN_CONFIG_NP 0x0080 + #define AN_CONFIG_ACK 0x0040 + #define AN_CONFIG_RF2 0x0020 + #define AN_CONFIG_RF1 0x0010 + #define AN_CONFIG_PS2 0x0001 + #define AN_CONFIG_PS1 0x8000 + #define AN_CONFIG_HD 0x4000 + #define AN_CONFIG_FD 0x2000 + + + /* Management registers. */ + + /* Control register. */ + union + { + struct + { + unsigned int an_enable:1; + unsigned int loopback:1; + unsigned int reset:1; + unsigned int restart_an:1; + } bits; + + unsigned short AsUSHORT; + + #define mr_an_enable Mr0.bits.an_enable + #define mr_loopback Mr0.bits.loopback + #define mr_main_reset Mr0.bits.reset + #define mr_restart_an Mr0.bits.restart_an + } Mr0; + + /* Status register. */ + union + { + struct + { + unsigned int an_complete:1; + unsigned int link_ok:1; + } bits; + + unsigned short AsUSHORT; + + #define mr_an_complete Mr1.bits.an_complete + #define mr_link_ok Mr1.bits.link_ok + } Mr1; + + /* Advertisement register. */ + union + { + struct + { + unsigned int reserved_4:5; + unsigned int full_duplex:1; + unsigned int half_duplex:1; + unsigned int sym_pause:1; + unsigned int asym_pause:1; + unsigned int reserved_11:3; + unsigned int remote_fault1:1; + unsigned int remote_fault2:1; + unsigned int reserved_14:1; + unsigned int next_page:1; + } bits; + + unsigned short AsUSHORT; + + #define mr_adv_full_duplex Mr4.bits.full_duplex + #define mr_adv_half_duplex Mr4.bits.half_duplex + #define mr_adv_sym_pause Mr4.bits.sym_pause + #define mr_adv_asym_pause Mr4.bits.asym_pause + #define mr_adv_remote_fault1 Mr4.bits.remote_fault1 + #define mr_adv_remote_fault2 Mr4.bits.remote_fault2 + #define mr_adv_next_page Mr4.bits.next_page + } Mr4; + + /* Link partner advertisement register. */ + union + { + struct + { + unsigned int reserved_4:5; + unsigned int lp_full_duplex:1; + unsigned int lp_half_duplex:1; + unsigned int lp_sym_pause:1; + unsigned int lp_asym_pause:1; + unsigned int reserved_11:3; + unsigned int lp_remote_fault1:1; + unsigned int lp_remote_fault2:1; + unsigned int lp_ack:1; + unsigned int lp_next_page:1; + } bits; + + unsigned short AsUSHORT; + + #define mr_lp_adv_full_duplex Mr5.bits.lp_full_duplex + #define mr_lp_adv_half_duplex Mr5.bits.lp_half_duplex + #define mr_lp_adv_sym_pause Mr5.bits.lp_sym_pause + #define mr_lp_adv_asym_pause Mr5.bits.lp_asym_pause + #define mr_lp_adv_remote_fault1 Mr5.bits.lp_remote_fault1 + #define mr_lp_adv_remote_fault2 Mr5.bits.lp_remote_fault2 + #define mr_lp_adv_next_page Mr5.bits.lp_next_page + } Mr5; + + /* Auto-negotiation expansion register. */ + union + { + struct + { + unsigned int reserved_0:1; + unsigned int page_received:1; + unsigned int next_pageable:1; + unsigned int reserved_15:13; + } bits; + + unsigned short AsUSHORT; + } Mr6; + + /* Auto-negotiation next page transmit register. */ + union + { + struct + { + unsigned int code_field:11; + unsigned int toggle:1; + unsigned int ack2:1; + unsigned int message_page:1; + unsigned int reserved_14:1; + unsigned int next_page:1; + } bits; + + unsigned short AsUSHORT; + + #define mr_np_tx Mr7.AsUSHORT + } Mr7; + + /* Auto-negotiation link partner ability register. */ + union + { + struct + { + unsigned int code_field:11; + unsigned int toggle:1; + unsigned int ack2:1; + unsigned int message_page:1; + unsigned int ack:1; + unsigned int next_page:1; + } bits; + + unsigned short AsUSHORT; + + #define mr_lp_np_rx Mr8.AsUSHORT + } Mr8; + + /* Extended status register. */ + union + { + struct + { + unsigned int reserved_11:12; + unsigned int base1000_t_hd:1; + unsigned int base1000_t_fd:1; + unsigned int base1000_x_hd:1; + unsigned int base1000_x_fd:1; + } bits; + + unsigned short AsUSHORT; + } Mr15; + + /* Miscellaneous state variables. */ + union + { + struct + { + unsigned int toggle_tx:1; + unsigned int toggle_rx:1; + unsigned int np_rx:1; + unsigned int page_rx:1; + unsigned int np_loaded:1; + } bits; + + unsigned short AsUSHORT; + + #define mr_toggle_tx MrMisc.bits.toggle_tx + #define mr_toggle_rx MrMisc.bits.toggle_rx + #define mr_np_rx MrMisc.bits.np_rx + #define mr_page_rx MrMisc.bits.page_rx + #define mr_np_loaded MrMisc.bits.np_loaded + } MrMisc; + + + /* Implement specifics */ + + /* Pointer to the operating system specific data structure. */ + void *pContext; +} AN_STATE_INFO, *PAN_STATE_INFO; + + + +/******************************************************************************/ +/* Return code of Autoneg8023z. */ +/******************************************************************************/ + +typedef enum +{ + AUTONEG_STATUS_OK = 0, + AUTONEG_STATUS_DONE = 1, + AUTONEG_STATUS_TIMER_ENABLED = 2, +// AUTONEG_STATUS_FAILED = 0xffffffff, + AUTONEG_STATUS_FAILED = 0xfffffff +} AUTONEG_STATUS, *PAUTONEG_STATUS; + + + +/******************************************************************************/ +/* Function prototypes. */ +/******************************************************************************/ + +AUTONEG_STATUS Autoneg8023z(PAN_STATE_INFO pAnInfo); +void AutonegInit(PAN_STATE_INFO pAnInfo); + + + +/******************************************************************************/ +/* The following functions are defined in the os-dependent module. */ +/******************************************************************************/ + +void MM_AnTxConfig(PAN_STATE_INFO pAnInfo); +void MM_AnTxIdle(PAN_STATE_INFO pAnInfo); +char MM_AnRxConfig(PAN_STATE_INFO pAnInfo, unsigned short *pRxConfig); + + + +#endif /* AUTONEG_H */ + diff -urN linux-2.4.18/drivers/net/bcm/b57proc.c lia64-2.4/drivers/net/bcm/b57proc.c --- linux-2.4.18/drivers/net/bcm/b57proc.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/b57proc.c Fri Jul 19 17:18:00 2002 @@ -0,0 +1,334 @@ + +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/* /proc file system handling code. */ +/* */ +/******************************************************************************/ + +#include "mm.h" +#ifdef CONFIG_PROC_FS + +#define NICINFO_PROC_DIR "nicinfo" + +static struct proc_dir_entry *bcm5700_procfs_dir; + +extern char bcm5700_driver[], bcm5700_version[]; + +extern LM_UINT32 bcm5700_crc_count(PUM_DEVICE_BLOCK pUmDevice); + +static struct proc_dir_entry * +proc_getdir(char *name, struct proc_dir_entry *proc_dir) +{ + struct proc_dir_entry *pde = proc_dir; + + lock_kernel(); + for (pde=pde->subdir; pde; pde = pde->next) { + if (pde->namelen && (strcmp(name, pde->name) == 0)) { + /* directory exists */ + break; + } + } + if (pde == (struct proc_dir_entry *) 0) + { + /* create the directory */ +#if (LINUX_VERSION_CODE > 0x20300) + pde = proc_mkdir(name, proc_dir); +#else + pde = create_proc_entry(name, S_IFDIR, proc_dir); +#endif + if (pde == (struct proc_dir_entry *) 0) { + unlock_kernel(); + return (pde); + } + } + unlock_kernel(); + return (pde); +} + +int +bcm5700_proc_create(void) +{ + bcm5700_procfs_dir = proc_getdir(NICINFO_PROC_DIR, proc_net); + + if (bcm5700_procfs_dir == (struct proc_dir_entry *) 0) { + printk(KERN_DEBUG "Could not create procfs nicinfo directory %s\n", NICINFO_PROC_DIR); + return -1; + } + return 0; +} + +int +bcm5700_read_pfs(char *page, char **start, off_t off, int count, + int *eof, void *data) +{ + struct net_device *dev = (struct net_device *) data; + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) dev->priv; + PLM_DEVICE_BLOCK pDevice = &pUmDevice->lm_dev; + PT3_STATS_BLOCK pStats = (PT3_STATS_BLOCK) pDevice->pStatsBlkVirt; + int len = 0; + LM_UINT32 rx_mac_errors, rx_crc_errors, rx_align_errors; + LM_UINT32 rx_runt_errors, rx_frag_errors, rx_long_errors; + LM_UINT32 rx_overrun_errors, rx_jabber_errors; + + if (pUmDevice->opened == 0) + pStats = 0; + + len += sprintf(page+len, "Description\t\t\t%s\n", pUmDevice->name); + len += sprintf(page+len, "Driver_Name\t\t\t%s\n", bcm5700_driver); + len += sprintf(page+len, "Driver_Version\t\t\t%s\n", bcm5700_version); + len += sprintf(page+len, "Bootcode_Version\t\t%s\n", pDevice->BootCodeVer); + len += sprintf(page+len, "PCI_Vendor\t\t\t0x%04x\n", pDevice->PciVendorId); + len += sprintf(page+len, "PCI_Device_ID\t\t\t0x%04x\n", + pDevice->PciDeviceId); + len += sprintf(page+len, "PCI_Subsystem_Vendor\t\t0x%04x\n", + pDevice->SubsystemVendorId); + len += sprintf(page+len, "PCI_Subsystem_ID\t\t0x%04x\n", + pDevice->SubsystemId); + len += sprintf(page+len, "PCI_Revision_ID\t\t\t0x%02x\n", + pDevice->PciRevId); + len += sprintf(page+len, "PCI_Slot\t\t\t%d\n", + PCI_SLOT(pUmDevice->pdev->devfn)); + len += sprintf(page+len, "PCI_Bus\t\t\t\t%d\n", + pUmDevice->pdev->bus->number); + + len += sprintf(page+len, "PCI_Bus_Speed\t\t\t%s\n", + pDevice->BusSpeedStr); + + len += sprintf(page+len, "Memory\t\t\t\t0x%lx\n", pUmDevice->dev->base_addr); + len += sprintf(page+len, "IRQ\t\t\t\t%d\n", dev->irq); + len += sprintf(page+len, "System_Device_Name\t\t%s\n", dev->name); + len += sprintf(page+len, "Current_HWaddr\t\t\t%02x:%02x:%02x:%02x:%02x:%02x\n", + dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], + dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); + len += sprintf(page+len, + "Permanent_HWaddr\t\t%02x:%02x:%02x:%02x:%02x:%02x\n", + pDevice->NodeAddress[0], pDevice->NodeAddress[1], + pDevice->NodeAddress[2], pDevice->NodeAddress[3], + pDevice->NodeAddress[4], pDevice->NodeAddress[5]); + len += sprintf(page+len, "Part_Number\t\t\t%s\n\n", pDevice->PartNo); + + len += sprintf(page+len, "Link\t\t\t\t%s\n", + (pUmDevice->opened == 0) ? "unknown" : + ((pDevice->LinkStatus == LM_STATUS_LINK_ACTIVE) ? "up" : + "down")); + len += sprintf(page+len, "Speed\t\t\t\t%s\n", + ((pDevice->LinkStatus == LM_STATUS_LINK_DOWN) || + (pUmDevice->opened == 0)) ? "N/A" : + ((pDevice->LineSpeed == LM_LINE_SPEED_1000MBPS) ? "1000" : + ((pDevice->LineSpeed == LM_LINE_SPEED_100MBPS) ? "100" : + (pDevice->LineSpeed == LM_LINE_SPEED_10MBPS) ? "10" : "N/A"))); + len += sprintf(page+len, "Duplex\t\t\t\t%s\n", + ((pDevice->LinkStatus == LM_STATUS_LINK_DOWN) || + (pUmDevice->opened == 0)) ? "N/A" : + ((pDevice->DuplexMode == LM_DUPLEX_MODE_FULL) ? "full" : + "half")); + len += sprintf(page+len, "Flow_Control\t\t\t%s\n", + ((pDevice->LinkStatus == LM_STATUS_LINK_DOWN) || + (pUmDevice->opened == 0)) ? "N/A" : + ((pDevice->FlowControl == LM_FLOW_CONTROL_NONE) ? "off" : + (((pDevice->FlowControl & LM_FLOW_CONTROL_RX_TX_PAUSE) == + LM_FLOW_CONTROL_RX_TX_PAUSE) ? "receive/transmit" : + (pDevice->FlowControl & LM_FLOW_CONTROL_RECEIVE_PAUSE) ? + "receive" : "transmit"))); + len += sprintf(page+len, "State\t\t\t\t%s\n", + (dev->flags & IFF_UP) ? "up" : "down"); + len += sprintf(page+len, "MTU_Size\t\t\t%d\n\n", dev->mtu); + len += sprintf(page+len, "Rx_Packets\t\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->ifHCInUcastPkts.Low + + pStats->ifHCInMulticastPkts.Low + + pStats->ifHCInBroadcastPkts.Low)); + if (dev->mtu > 1500) { + len += sprintf(page+len, "Rx_Jumbo_Packets\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->etherStatsPkts1523Octetsto2047Octets.Low + + pStats->etherStatsPkts2048Octetsto4095Octets.Low + + pStats->etherStatsPkts4096Octetsto8191Octets.Low + + pStats->etherStatsPkts8192Octetsto9022Octets.Low)); + } + len += sprintf(page+len, "Tx_Packets\t\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->COSIfHCOutPkts[0].Low)); + len += sprintf(page+len, "Rx_Bytes\t\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->ifHCInOctets.Low)); + len += sprintf(page+len, "Tx_Bytes\t\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->ifHCOutOctets.Low)); + if (pStats == 0) { + rx_crc_errors = 0; + rx_align_errors = 0; + rx_runt_errors = 0; + rx_frag_errors = 0; + rx_long_errors = 0; + rx_overrun_errors = 0; + rx_jabber_errors = 0; + } + else { + rx_crc_errors = bcm5700_crc_count(pUmDevice); + rx_align_errors = pStats->dot3StatsAlignmentErrors.Low; + rx_runt_errors = pStats->etherStatsUndersizePkts.Low; + rx_frag_errors = pStats->etherStatsFragments.Low; + rx_long_errors = pStats->dot3StatsFramesTooLong.Low; + rx_overrun_errors = pStats->nicNoMoreRxBDs.Low; + rx_jabber_errors = pStats->etherStatsJabbers.Low; + } + rx_mac_errors = rx_crc_errors + rx_align_errors + rx_runt_errors + + rx_frag_errors + rx_long_errors + rx_jabber_errors; + len += sprintf(page+len, "Rx_Errors\t\t\t%u\n", + ((pStats == 0) ? 0 : + rx_mac_errors + rx_overrun_errors + pUmDevice->rx_misc_errors)); + len += sprintf(page+len, "Tx_Errors\t\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->ifOutErrors.Low)); + len += sprintf(page+len, "\nTx_Carrier_Errors\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->dot3StatsCarrierSenseErrors.Low)); + len += sprintf(page+len, "Tx_Abort_Excess_Coll\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->dot3StatsExcessiveCollisions.Low)); + len += sprintf(page+len, "Tx_Abort_Late_Coll\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->dot3StatsLateCollisions.Low)); + len += sprintf(page+len, "Tx_Deferred_Ok\t\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->dot3StatsDeferredTransmissions.Low)); + len += sprintf(page+len, "Tx_Single_Coll_Ok\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->dot3StatsSingleCollisionFrames.Low)); + len += sprintf(page+len, "Tx_Multi_Coll_Ok\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->dot3StatsMultipleCollisionFrames.Low)); + len += sprintf(page+len, "Tx_Total_Coll_Ok\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->etherStatsCollisions.Low)); + len += sprintf(page+len, "\nRx_CRC_Errors\t\t\t%u\n", rx_crc_errors); + len += sprintf(page+len, "Rx_Short_Fragment_Errors\t%u\n", + rx_frag_errors); + len += sprintf(page+len, "Rx_Short_Length_Errors\t\t%u\n", + rx_runt_errors); + len += sprintf(page+len, "Rx_Long_Length_Errors\t\t%u\n", + rx_long_errors); + len += sprintf(page+len, "Rx_Align_Errors\t\t\t%u\n", + rx_align_errors); + len += sprintf(page+len, "Rx_Overrun_Errors\t\t%u\n", + rx_overrun_errors); + len += sprintf(page+len, "\nTx_MAC_Errors\t\t\t%u\n", + ((pStats == 0) ? 0 : + pStats->dot3StatsInternalMacTransmitErrors.Low)); + len += sprintf(page+len, "Rx_MAC_Errors\t\t\t%u\n\n", + rx_mac_errors); + + len += sprintf(page+len, "Tx_Checksum\t\t\t%s\n", + ((pDevice->TaskToOffload & LM_TASK_OFFLOAD_TX_TCP_CHECKSUM) ? + "ON" : "OFF")); + len += sprintf(page+len, "Rx_Checksum\t\t\t%s\n", + ((pDevice->TaskToOffload & LM_TASK_OFFLOAD_RX_TCP_CHECKSUM) ? + "ON" : "OFF")); + len += sprintf(page+len, "Scatter_Gather\t\t\t%s\n", +#if (LINUX_VERSION_CODE >= 0x20400) + ((dev->features & NETIF_F_SG) ? "ON" : "OFF")); +#else + "OFF"); +#endif + len += sprintf(page+len, "Tx_Desc_Count\t\t\t%u\n", + pDevice->TxPacketDescCnt); + len += sprintf(page+len, "Rx_Desc_Count\t\t\t%u\n", + pDevice->RxStdDescCnt); + len += sprintf(page+len, "Rx_Jumbo_Desc_Count\t\t%u\n", + pDevice->RxJumboDescCnt); + len += sprintf(page+len, "Adaptive_Coalescing\t\t%s\n", + (pUmDevice->adaptive_coalesce ? "ON" : "OFF")); + len += sprintf(page+len, "Rx_Coalescing_Ticks\t\t%u\n", + pUmDevice->rx_curr_coalesce_ticks); + len += sprintf(page+len, "Rx_Coalesced_Frames\t\t%u\n", + pUmDevice->rx_curr_coalesce_frames); + len += sprintf(page+len, "Tx_Coalescing_Ticks\t\t%u\n", + pDevice->TxCoalescingTicks); + len += sprintf(page+len, "Tx_Coalesced_Frames\t\t%u\n", + pUmDevice->tx_curr_coalesce_frames); + len += sprintf(page+len, "Stats_Coalescing_Ticks\t\t%u\n", + pDevice->StatsCoalescingTicks); + len += sprintf(page+len, "Wake_On_LAN\t\t\t%s\n", + ((pDevice->WakeUpMode & LM_WAKE_UP_MODE_MAGIC_PACKET) ? + "ON" : "OFF")); +#if TIGON3_DEBUG + len += sprintf(page+len, "\nDmaReadWriteCtrl\t\t%x\n", + pDevice->DmaReadWriteCtrl); + len += sprintf(page+len, "\nTx_Zero_Copy_Packets\t\t%u\n", + pUmDevice->tx_zc_count); + len += sprintf(page+len, "Tx_Chksum_Packets\t\t%u\n", + pUmDevice->tx_chksum_count); + len += sprintf(page+len, "Tx_Highmem_Fragments\t\t%u\n", + pUmDevice->tx_himem_count); + len += sprintf(page+len, "Rx_Good_Chksum_Packets\t\t%u\n", + pUmDevice->rx_good_chksum_count); + len += sprintf(page+len, "Rx_Bad_Chksum_Packets\t\t%u\n", + pUmDevice->rx_bad_chksum_count); + if (!pDevice->EnableTbi) { + LM_UINT32 value32; + + LM_ReadPhy(pDevice, 0, &value32); + len += sprintf(page+len, "\nPhy_Register_0x00\t\t0x%x\n", value32); + LM_ReadPhy(pDevice, 1, &value32); + len += sprintf(page+len, "Phy_Register_0x01\t\t0x%x\n", value32); + LM_ReadPhy(pDevice, 2, &value32); + len += sprintf(page+len, "Phy_Register_0x02\t\t0x%x\n", value32); + LM_ReadPhy(pDevice, 3, &value32); + len += sprintf(page+len, "Phy_Register_0x03\t\t0x%x\n", value32); + LM_ReadPhy(pDevice, 4, &value32); + len += sprintf(page+len, "Phy_Register_0x04\t\t0x%x\n", value32); + LM_ReadPhy(pDevice, 5, &value32); + len += sprintf(page+len, "Phy_Register_0x05\t\t0x%x\n", value32); + LM_ReadPhy(pDevice, 9, &value32); + len += sprintf(page+len, "Phy_Register_0x09\t\t0x%x\n", value32); + LM_ReadPhy(pDevice, 0xa, &value32); + len += sprintf(page+len, "Phy_Register_0x0A\t\t0x%x\n", value32); + LM_ReadPhy(pDevice, 0xf, &value32); + len += sprintf(page+len, "Phy_Register_0x0F\t\t0x%x\n", value32); + LM_ReadPhy(pDevice, 0x10, &value32); + len += sprintf(page+len, "Phy_Register_0x10\t\t0x%x\n", value32); + LM_ReadPhy(pDevice, 0x19, &value32); + len += sprintf(page+len, "Phy_Register_0x19\t\t0x%x\n", value32); + } +#endif + + *eof = 1; + return len; +} + +int +bcm5700_proc_create_dev(struct net_device *dev) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) dev->priv; + + if (!bcm5700_procfs_dir) + return -1; + + sprintf(pUmDevice->pfs_name, "%s.info", dev->name); + pUmDevice->pfs_entry = create_proc_entry(pUmDevice->pfs_name, + S_IFREG, bcm5700_procfs_dir); + if (pUmDevice->pfs_entry == 0) + return -1; + pUmDevice->pfs_entry->read_proc = bcm5700_read_pfs; + pUmDevice->pfs_entry->data = dev; + return 0; +} +int +bcm5700_proc_remove_dev(struct net_device *dev) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) dev->priv; + + remove_proc_entry(pUmDevice->pfs_name, bcm5700_procfs_dir); + return 0; +} + +#endif diff -urN linux-2.4.18/drivers/net/bcm/b57um.c lia64-2.4/drivers/net/bcm/b57um.c --- linux-2.4.18/drivers/net/bcm/b57um.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/b57um.c Fri Jul 19 17:18:15 2002 @@ -0,0 +1,3106 @@ +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2001 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/******************************************************************************/ + + +char bcm5700_driver[] = "bcm5700"; +char bcm5700_version[] = "2.2.27"; +char bcm5700_date[] = "(07/03/02)"; + +#define B57UM +#include "mm.h" + +#define TASKLET + +/* A few user-configurable values. */ + +#define MAX_UNITS 16 +/* Used to pass the full-duplex flag, etc. */ +static int line_speed[MAX_UNITS] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +static int auto_speed[MAX_UNITS] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; +static int full_duplex[MAX_UNITS] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; +static int rx_flow_control[MAX_UNITS] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +static int tx_flow_control[MAX_UNITS] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +static int auto_flow_control[MAX_UNITS] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +static int mtu[MAX_UNITS] = {1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500}; /* Jumbo MTU for interfaces. */ +static int tx_checksum[MAX_UNITS] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; +static int rx_checksum[MAX_UNITS] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; +static int scatter_gather[MAX_UNITS] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; + +#define TX_DESC_CNT DEFAULT_TX_PACKET_DESC_COUNT +static unsigned int tx_pkt_desc_cnt[MAX_UNITS] = + {TX_DESC_CNT,TX_DESC_CNT,TX_DESC_CNT,TX_DESC_CNT,TX_DESC_CNT, + TX_DESC_CNT,TX_DESC_CNT,TX_DESC_CNT,TX_DESC_CNT,TX_DESC_CNT, + TX_DESC_CNT,TX_DESC_CNT,TX_DESC_CNT,TX_DESC_CNT,TX_DESC_CNT, + TX_DESC_CNT}; + +#define RX_DESC_CNT DEFAULT_STD_RCV_DESC_COUNT +static unsigned int rx_std_desc_cnt[MAX_UNITS] = + {RX_DESC_CNT,RX_DESC_CNT,RX_DESC_CNT,RX_DESC_CNT,RX_DESC_CNT, + RX_DESC_CNT,RX_DESC_CNT,RX_DESC_CNT,RX_DESC_CNT,RX_DESC_CNT, + RX_DESC_CNT,RX_DESC_CNT,RX_DESC_CNT,RX_DESC_CNT,RX_DESC_CNT, + RX_DESC_CNT }; + +#define JBO_DESC_CNT DEFAULT_JUMBO_RCV_DESC_COUNT +static unsigned int rx_jumbo_desc_cnt[MAX_UNITS] = + {JBO_DESC_CNT,JBO_DESC_CNT,JBO_DESC_CNT,JBO_DESC_CNT,JBO_DESC_CNT, + JBO_DESC_CNT,JBO_DESC_CNT,JBO_DESC_CNT,JBO_DESC_CNT,JBO_DESC_CNT, + JBO_DESC_CNT,JBO_DESC_CNT,JBO_DESC_CNT,JBO_DESC_CNT,JBO_DESC_CNT, + JBO_DESC_CNT }; + +#if INCLUDE_EXT_MEMORY_SUPPORT +#define MIN_DESC_CNT DEFAULT_MINI_RCV_DESC_COUNT +static unsigned int rx_mini_desc_cnt[MAX_UNITS] = + {MIN_DESC_CNT,MIN_DESC_CNT,MIN_DESC_CNT,MIN_DESC_CNT,MIN_DESC_CNT, + MIN_DESC_CNT,MIN_DESC_CNT,MIN_DESC_CNT,MIN_DESC_CNT,MIN_DESC_CNT, + MIN_DESC_CNT,MIN_DESC_CNT,MIN_DESC_CNT,MIN_DESC_CNT,MIN_DESC_CNT, + MIN_DESC_CNT }; + +#endif +static unsigned int adaptive_coalesce[MAX_UNITS] = + {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; + +#define RX_COAL_TK DEFAULT_RX_COALESCING_TICKS +static unsigned int rx_coalesce_ticks[MAX_UNITS] = + {RX_COAL_TK,RX_COAL_TK,RX_COAL_TK,RX_COAL_TK,RX_COAL_TK, + RX_COAL_TK, RX_COAL_TK,RX_COAL_TK,RX_COAL_TK,RX_COAL_TK, + RX_COAL_TK,RX_COAL_TK, RX_COAL_TK,RX_COAL_TK,RX_COAL_TK, + RX_COAL_TK}; + +#define RX_COAL_FM DEFAULT_RX_MAX_COALESCED_FRAMES +static unsigned int rx_max_coalesce_frames[MAX_UNITS] = + {RX_COAL_FM,RX_COAL_FM,RX_COAL_FM,RX_COAL_FM,RX_COAL_FM, + RX_COAL_FM,RX_COAL_FM,RX_COAL_FM,RX_COAL_FM,RX_COAL_FM, + RX_COAL_FM,RX_COAL_FM,RX_COAL_FM,RX_COAL_FM,RX_COAL_FM, + RX_COAL_FM}; + +#define TX_COAL_TK DEFAULT_TX_COALESCING_TICKS +static unsigned int tx_coalesce_ticks[MAX_UNITS] = + {TX_COAL_TK,TX_COAL_TK,TX_COAL_TK,TX_COAL_TK,TX_COAL_TK, + TX_COAL_TK, TX_COAL_TK,TX_COAL_TK,TX_COAL_TK,TX_COAL_TK, + TX_COAL_TK,TX_COAL_TK, TX_COAL_TK,TX_COAL_TK,TX_COAL_TK, + TX_COAL_TK}; + +#define TX_COAL_FM DEFAULT_TX_MAX_COALESCED_FRAMES +static unsigned int tx_max_coalesce_frames[MAX_UNITS] = + {TX_COAL_FM,TX_COAL_FM,TX_COAL_FM,TX_COAL_FM,TX_COAL_FM, + TX_COAL_FM,TX_COAL_FM,TX_COAL_FM,TX_COAL_FM,TX_COAL_FM, + TX_COAL_FM,TX_COAL_FM,TX_COAL_FM,TX_COAL_FM,TX_COAL_FM, + TX_COAL_FM}; + +#define ST_COAL_TK DEFAULT_STATS_COALESCING_TICKS +static unsigned int stats_coalesce_ticks[MAX_UNITS] = + {ST_COAL_TK,ST_COAL_TK,ST_COAL_TK,ST_COAL_TK,ST_COAL_TK, + ST_COAL_TK,ST_COAL_TK,ST_COAL_TK,ST_COAL_TK,ST_COAL_TK, + ST_COAL_TK,ST_COAL_TK,ST_COAL_TK,ST_COAL_TK,ST_COAL_TK, + ST_COAL_TK,}; + +static int enable_wol[MAX_UNITS] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + +/* Operational parameters that usually are not changed. */ +/* Time in jiffies before concluding the transmitter is hung. */ +#define TX_TIMEOUT (2*HZ) + +#if (LINUX_VERSION_CODE < 0x02030d) +#define pci_resource_start(dev, bar) (dev->base_address[bar] & PCI_BASE_ADDRESS_MEM_MASK) +#elif (LINUX_VERSION_CODE < 0x02032b) +#define pci_resource_start(dev, bar) (dev->resource[bar] & PCI_BASE_ADDRESS_MEM_MASK) +#endif + +#if (LINUX_VERSION_CODE < 0x02032b) +#define dev_kfree_skb_irq(skb) dev_kfree_skb(skb) +#define netif_wake_queue(dev) clear_bit(0, &dev->tbusy); mark_bh(NET_BH) +#define netif_stop_queue(dev) set_bit(0, &dev->tbusy) + +static inline void netif_start_queue(struct net_device *dev) +{ + dev->tbusy = 0; + dev->interrupt = 0; + dev->start = 1; +} + +#define netif_queue_stopped(dev) dev->tbusy +#define netif_running(dev) dev->start + +static inline void tasklet_schedule(struct tasklet_struct *tasklet) +{ + queue_task(tasklet, &tq_immediate); + mark_bh(IMMEDIATE_BH); +} + +static inline void tasklet_init(struct tasklet_struct *tasklet, + void (*func)(unsigned long), + unsigned long data) +{ + tasklet->next = NULL; + tasklet->sync = 0; + tasklet->routine = (void (*)(void *))func; + tasklet->data = (void *)data; +} + +#define tasklet_kill(tasklet) + +#endif + +#if (LINUX_VERSION_CODE < 0x020300) +struct pci_device_id { + unsigned int vendor, device; /* Vendor and device ID or PCI_ANY_ID */ + unsigned int subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */ + unsigned int class, class_mask; /* (class,subclass,prog-if) triplet */ + unsigned long driver_data; /* Data private to the driver */ +}; + +#define PCI_ANY_ID 0 + +#define pci_set_drvdata(pdev, dev) +#define pci_get_drvdata(pdev) 0 + +#define pci_enable_device(pdev) 0 + +#define __devinit __init +#define __devinitdata __initdata +#define __devexit + +#define SET_MODULE_OWNER(dev) +#define MODULE_DEVICE_TABLE(pci, pci_tbl) + +#endif + +#ifndef MODULE_LICENSE +#define MODULE_LICENSE(license) +#endif + +#if (LINUX_VERSION_CODE < 0x02032a) +static inline void *pci_alloc_consistent(struct pci_dev *pdev, size_t size, + dma_addr_t *dma_handle) +{ + void *virt_ptr; + + /* Maximum in slab.c */ + if (size > 131072) + return 0; + + virt_ptr = kmalloc(size, GFP_KERNEL); + *dma_handle = virt_to_bus(virt_ptr); + return virt_ptr; +} +#define pci_free_consistent(dev, size, ptr, dma_ptr) kfree(ptr) + +#define pci_map_single(dev, address, size, dir) virt_to_bus(address) +#define pci_unmap_single(dev, dma_addr, size, dir) + +#endif /*#if (LINUX_VERSION_CODE < 0x02032a) */ + +#if MAX_SKB_FRAGS +#if (LINUX_VERSION_CODE >= 0x02040d) + +typedef dma_addr_t dmaaddr_high_t; + +#else + +#if defined(CONFIG_HIGHMEM) && defined(CONFIG_X86) + +#if defined(CONFIG_HIGHMEM64G) +typedef unsigned long long dmaaddr_high_t; +#else +typedef dma_addr_t dmaaddr_high_t; +#endif + +#ifndef pci_map_page +#define pci_map_page bcm_pci_map_page +#endif + +static inline dmaaddr_high_t +bcm_pci_map_page(struct pci_dev *dev, struct page *page, + int offset, size_t size, int dir) +{ + dmaaddr_high_t phys; + + phys = (page-mem_map) * (dmaaddr_high_t) PAGE_SIZE + offset; + + return phys; +} + +#define pci_unmap_page(dev, map, size, dir) + +#else + +typedef dma_addr_t dmaaddr_high_t; + +/* Warning - This may not work for all architectures if HIGHMEM is defined */ + +#ifndef pci_map_page +#define pci_map_page(dev, page, offset, size, dir) \ + pci_map_single(dev, page_address(page) + (offset), size, dir) +#endif +#ifndef pci_unmap_page +#define pci_unmap_page(dev, map, size, dir) \ + pci_unmap_single(dev, map, size, dir) +#endif + +#endif /* #if defined(CONFIG_HIGHMEM) && defined(CONFIG_X86)*/ + +#endif /* #if (LINUX_VERSION_CODE >= 0x02040d)*/ +#endif /* #if MAX_SKB_FRAGS*/ + +#if (LINUX_VERSION_CODE < 0x020329) +#define pci_set_dma_mask(pdev, mask) (0) +#else +#if (LINUX_VERSION_CODE < 0x020403) +int +pci_set_dma_mask(struct pci_dev *dev, dma_addr_t mask) +{ + if(! pci_dma_supported(dev, mask)) + return -EIO; + + dev->dma_mask = mask; + + return 0; +} +#endif +#endif + +#if (LINUX_VERSION_CODE < 0x020402) +#define pci_request_regions(pdev, name) (0) +#define pci_release_regions(pdev) +#endif + +#define set_64bit_addr(paddr, low, high) \ + (paddr)->Low = low; \ + (paddr)->High = high; + +static inline void bcm_set_addr(LM_PHYSICAL_ADDRESS *paddr, dma_addr_t addr) +{ + unsigned long baddr = (unsigned long) addr; +#if (BITS_PER_LONG == 64) + set_64bit_addr(paddr, baddr & 0xffffffff, baddr >> 32); +#else + set_64bit_addr(paddr, baddr, 0); +#endif +} + +#if defined (CONFIG_X86) +#define NO_PCI_UNMAP 1 +#endif + +#if (LINUX_VERSION_CODE < 0x020412) +#if ! defined (NO_PCI_UNMAP) +#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME; +#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME; + +#define pci_unmap_addr(PTR, ADDR_NAME) \ + ((PTR)->ADDR_NAME) + +#define pci_unmap_len(PTR, LEN_NAME) \ + ((PTR)->LEN_NAME) + +#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \ + (((PTR)->ADDR_NAME) = (VAL)) + +#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ + (((PTR)->LEN_NAME) = (VAL)) +#else +#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) +#define DECLARE_PCI_UNMAP_LEN(ADDR_NAME) + +#define pci_unmap_addr(PTR, ADDR_NAME) 0 +#define pci_unmap_len(PTR, LEN_NAME) 0 +#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0) +#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) +#endif +#endif + +#if MAX_SKB_FRAGS +static inline void bcm_set_addr_high(LM_PHYSICAL_ADDRESS *paddr, dmaaddr_high_t addr) +{ +#if defined(CONFIG_HIGHMEM64G) && defined(CONFIG_X86) + set_64bit_addr(paddr, (unsigned long) (addr & 0xffffffff), + (unsigned long) (addr >> 32)); +#else + bcm_set_addr(paddr, (dma_addr_t) addr); +#endif +} +#endif + +#if ! defined(spin_is_locked) +#define spin_is_locked(lock) (test_bit(0,(lock))) +#endif + +inline long +bcm5700_lock(PUM_DEVICE_BLOCK pUmDevice) +{ + long flags; + + if (pUmDevice->do_global_lock) { + spin_lock_irqsave(&pUmDevice->global_lock, flags); + return flags; + } + return 0; +} + +inline void +bcm5700_unlock(PUM_DEVICE_BLOCK pUmDevice, long flags) +{ + if (pUmDevice->do_global_lock) { + spin_unlock_irqrestore(&pUmDevice->global_lock, flags); + } +} + +inline int +bcm5700_trylock(PUM_DEVICE_BLOCK pUmDevice, long *flags) +{ + if (pUmDevice->do_global_lock) { + if (spin_is_locked(&pUmDevice->global_lock)) + return 0; + spin_lock_irqsave(&pUmDevice->global_lock, *flags); + return 1; + } + return 1; +} + +inline void +bcm5700_intr_lock(PUM_DEVICE_BLOCK pUmDevice) +{ + if (pUmDevice->do_global_lock) { + spin_lock(&pUmDevice->global_lock); + } +} + +inline void +bcm5700_intr_unlock(PUM_DEVICE_BLOCK pUmDevice) +{ + if (pUmDevice->do_global_lock) { + spin_unlock(&pUmDevice->global_lock); + } +} + +long +bcm5700_phy_lock(PUM_DEVICE_BLOCK pUmDevice) +{ + long flags; + + if (pUmDevice->do_global_lock) { + spin_lock_irqsave(&pUmDevice->global_lock, flags); + return flags; + } + else { + spin_lock_irqsave(&pUmDevice->phy_lock, flags); + return flags; + } + return 0; +} + +void +bcm5700_phy_unlock(PUM_DEVICE_BLOCK pUmDevice, long flags) +{ + if (pUmDevice->do_global_lock) { + spin_unlock_irqrestore(&pUmDevice->global_lock, flags); + } + else { + spin_unlock_irqrestore(&pUmDevice->phy_lock, flags); + } +} + +void +bcm5700_intr_off(PUM_DEVICE_BLOCK pUmDevice) +{ + atomic_inc(&pUmDevice->intr_sem); + LM_DisableInterrupt(&pUmDevice->lm_dev); + synchronize_irq(); +} + +void +bcm5700_intr_on(PUM_DEVICE_BLOCK pUmDevice) +{ + if (atomic_dec_and_test(&pUmDevice->intr_sem)) { + LM_EnableInterrupt(&pUmDevice->lm_dev); + } +} + +/* + * Broadcom NIC Extension support + * -ffan + */ +#ifdef NICE_SUPPORT +#include "nicext.h" + +typedef struct { + ushort tag; + ushort signature; +} vlan_tag_t; + +#endif /* NICE_SUPPORT */ + +typedef struct _UM_PACKET { + LM_PACKET lm_packet; + struct sk_buff *skbuff; +#if MAX_SKB_FRAGS + DECLARE_PCI_UNMAP_ADDR(map[MAX_SKB_FRAGS + 1]) + DECLARE_PCI_UNMAP_LEN(map_len[MAX_SKB_FRAGS + 1]) +#else + DECLARE_PCI_UNMAP_ADDR(map[1]) + DECLARE_PCI_UNMAP_LEN(map_len[1]) +#endif + LM_FRAG_LIST frag_list; +#if MAX_SKB_FRAGS + LM_FRAG frag_list_bufs[MAX_SKB_FRAGS]; +#endif +} UM_PACKET, *PUM_PACKET; + +int MM_Packet_Desc_Size = sizeof(UM_PACKET); + +#if defined(MODULE) +MODULE_AUTHOR("Michael Chan "); +MODULE_DESCRIPTION("BCM5700 Driver"); +MODULE_LICENSE("GPL"); +MODULE_PARM(debug, "i"); +MODULE_PARM(line_speed, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(auto_speed, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(rx_flow_control, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(tx_flow_control, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(auto_flow_control, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(mtu, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(tx_checksum, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(rx_checksum, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(scatter_gather, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(tx_pkt_desc_cnt, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(rx_std_desc_cnt, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(rx_jumbo_desc_cnt, "1-" __MODULE_STRING(MAX_UNITS) "i"); +#if INCLUDE_EXT_MEMORY_SUPPORT +MODULE_PARM(rx_mini_desc_cnt, "1-" __MODULE_STRING(MAX_UNITS) "i"); +#endif +MODULE_PARM(adaptive_coalesce, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(rx_coalesce_ticks, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(rx_max_coalesce_frames, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(tx_coalesce_ticks, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(tx_max_coalesce_frames, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(stats_coalesce_ticks, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(enable_wol, "1-" __MODULE_STRING(MAX_UNITS) "i"); +#endif + +#define RUN_AT(x) (jiffies + (x)) + +char kernel_version[] = UTS_RELEASE; + +#define PCI_SUPPORT_VER2 + +#if ! defined(CAP_NET_ADMIN) +#define capable(CAP_XXX) (suser()) +#endif + +#define tigon3_debug debug +#if TIGON3_DEBUG +static int tigon3_debug = TIGON3_DEBUG; +#else +static int tigon3_debug = 0; +#endif + + +#if DBG +#define STATIC +#else +#define STATIC static +#endif + +STATIC int bcm5700_open(struct net_device *dev); +STATIC void bcm5700_timer(unsigned long data); +STATIC void bcm5700_tx_timeout(struct net_device *dev); +STATIC int bcm5700_start_xmit(struct sk_buff *skb, struct net_device *dev); +STATIC void bcm5700_interrupt(int irq, void *dev_instance, struct pt_regs *regs); +STATIC void bcm5700_tasklet(unsigned long data); +STATIC int bcm5700_close(struct net_device *dev); +STATIC struct net_device_stats *bcm5700_get_stats(struct net_device *dev); +STATIC int bcm5700_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); +STATIC void bcm5700_set_rx_mode(struct net_device *dev); +STATIC int bcm5700_set_mac_addr(struct net_device *dev, void *p); +STATIC int replenish_rx_buffers(PUM_DEVICE_BLOCK pUmDevice); +STATIC int check_4G_boundary(PUM_DEVICE_BLOCK pUmDevice, PUM_PACKET pUmPacket); +STATIC int bcm5700_freemem(struct net_device *dev); +STATIC int bcm5700_adapt_coalesce(PUM_DEVICE_BLOCK pUmDevice); +#ifdef BCM_VLAN +STATIC void bcm5700_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp); +STATIC void bcm5700_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid); +#endif + + +/* A list of all installed bcm5700 devices. */ +static struct net_device *root_tigon3_dev = NULL; + +typedef enum { + BCM5700VIGIL = 0, + BCM5700A6, + BCM5700T6, + BCM5700A9, + BCM5700T9, + BCM5700, + BCM5701A5, + BCM5701T1, + BCM5701T8, + BCM5701A7, + BCM5701A10, + BCM5701A12, + BCM5701, + BCM5702, + BCM5703, + BCM5703A31, + TC996T, + TC996ST, + TC996SSX, + TC996SX, + TC996BT, + TC997T, + TC997SX, + TC1000T, + TC940BR01, + TC942BR01, + NC6770, + NC7760, + NC7770, + NC7771, + NC7780, + NC7781, +} board_t; + + +/* indexed by board_t, above */ +static struct { + char *name; +} board_info[] __devinitdata = { + { "Broadcom Vigil B5700 1000Base-T" }, + { "Broadcom BCM5700 1000Base-T" }, + { "Broadcom BCM5700 1000Base-SX" }, + { "Broadcom BCM5700 1000Base-SX" }, + { "Broadcom BCM5700 1000Base-T" }, + { "Broadcom BCM5700" }, + { "Broadcom BCM5701 1000Base-T" }, + { "Broadcom BCM5701 1000Base-T" }, + { "Broadcom BCM5701 1000Base-T" }, + { "Broadcom BCM5701 1000Base-SX" }, + { "Broadcom BCM5701 1000Base-T" }, + { "Broadcom BCM5701 1000Base-T" }, + { "Broadcom BCM5701" }, + { "Broadcom BCM5702 1000Base-T" }, + { "Broadcom BCM5703 1000Base-T" }, + { "Broadcom BCM5703 1000Base-SX" }, + { "3Com 3C996 10/100/1000 Server NIC" }, + { "3Com 3C996 10/100/1000 Server NIC" }, + { "3Com 3C996 Gigabit Fiber-SX Server NIC" }, + { "3Com 3C996 Gigabit Fiber-SX Server NIC" }, + { "3Com 3C996B Gigabit Server NIC" }, + { "3Com 3C997 Gigabit Server NIC" }, + { "3Com 3C997 Gigabit Fiber-SX Server NIC" }, + { "3Com 3C1000 Gigabit NIC" }, + { "3Com 3C940 Gigabit LOM (21X21)" }, + { "3Com 3C942 Gigabit LOM (31X31)" }, + { "Compaq NC6770 Gigabit Server Adapter" }, + { "Compaq NC7760 Gigabit Server Adapter" }, + { "Compaq NC7770 Gigabit Server Adapter" }, + { "Compaq NC7771 Gigabit Server Adapter" }, + { "Compaq NC7780 Gigabit Server Adapter" }, + { "Compaq NC7781 Gigabit Server Adapter" }, + { 0 }, + }; + +static struct pci_device_id bcm5700_pci_tbl[] __devinitdata = { + {0x14e4, 0x1644, 0x1014, 0x0277, 0, 0, BCM5700VIGIL }, + {0x14e4, 0x1644, 0x14e4, 0x1644, 0, 0, BCM5700A6 }, + {0x14e4, 0x1644, 0x14e4, 0x2, 0, 0, BCM5700T6 }, + {0x14e4, 0x1644, 0x14e4, 0x3, 0, 0, BCM5700A9 }, + {0x14e4, 0x1644, 0x14e4, 0x4, 0, 0, BCM5700T9 }, + {0x14e4, 0x1644, 0x1028, 0xd1, 0, 0, BCM5700 }, + {0x14e4, 0x1644, 0x1028, 0x0106, 0, 0, BCM5700 }, + {0x14e4, 0x1644, 0x1028, 0x0109, 0, 0, BCM5700 }, + {0x14e4, 0x1644, 0x1028, 0x010a, 0, 0, BCM5700 }, + {0x14e4, 0x1644, 0x10b7, 0x1000, 0, 0, TC996T }, + {0x14e4, 0x1644, 0x10b7, 0x1001, 0, 0, TC996ST }, + {0x14e4, 0x1644, 0x10b7, 0x1002, 0, 0, TC996SSX }, + {0x14e4, 0x1644, 0x10b7, 0x1003, 0, 0, TC997T }, + {0x14e4, 0x1644, 0x10b7, 0x1005, 0, 0, TC997SX }, + {0x14e4, 0x1644, 0x10b7, 0x1008, 0, 0, TC942BR01 }, + {0x14e4, 0x1644, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5700 }, + {0x14e4, 0x1645, 0x14e4, 1, 0, 0, BCM5701A5 }, + {0x14e4, 0x1645, 0x14e4, 5, 0, 0, BCM5701T1 }, + {0x14e4, 0x1645, 0x14e4, 6, 0, 0, BCM5701T8 }, + {0x14e4, 0x1645, 0x14e4, 7, 0, 0, BCM5701A7 }, + {0x14e4, 0x1645, 0x14e4, 8, 0, 0, BCM5701A10 }, + {0x14e4, 0x1645, 0x14e4, 0x8008, 0, 0, BCM5701A12 }, + {0x14e4, 0x1645, 0x0e11, 0xc1, 0, 0, NC6770 }, + {0x14e4, 0x1645, 0x0e11, 0x7c, 0, 0, NC7770 }, + {0x14e4, 0x1645, 0x0e11, 0x85, 0, 0, NC7780 }, + {0x14e4, 0x1645, 0x1028, 0x0121, 0, 0, BCM5701 }, + {0x14e4, 0x1645, 0x10b7, 0x1004, 0, 0, TC996SX }, + {0x14e4, 0x1645, 0x10b7, 0x1006, 0, 0, TC996BT }, + {0x14e4, 0x1645, 0x10b7, 0x1007, 0, 0, TC1000T }, + {0x14e4, 0x1645, 0x10b7, 0x1008, 0, 0, TC940BR01 }, + {0x14e4, 0x1645, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5701 }, + {0x14e4, 0x1646, 0x14e4, 0x8009, 0, 0, BCM5702 }, + {0x14e4, 0x1646, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5702 }, + {0x14e4, 0x16a6, 0x14e4, 0x8009, 0, 0, BCM5702 }, + {0x14e4, 0x16a6, 0x14e4, 0x000c, 0, 0, BCM5702 }, + {0x14e4, 0x16a6, 0x0e11, 0xbb, 0, 0, NC7760 }, + {0x14e4, 0x16a6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5702 }, + {0x14e4, 0x1647, 0x14e4, 0x0009, 0, 0, BCM5703 }, + {0x14e4, 0x1647, 0x14e4, 0x000a, 0, 0, BCM5703A31 }, + {0x14e4, 0x1647, 0x14e4, 0x000b, 0, 0, BCM5703 }, + {0x14e4, 0x1647, 0x14e4, 0x800a, 0, 0, BCM5703 }, + {0x14e4, 0x1647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5703 }, + {0x14e4, 0x16a7, 0x14e4, 0x0009, 0, 0, BCM5703 }, + {0x14e4, 0x16a7, 0x14e4, 0x000a, 0, 0, BCM5703A31 }, + {0x14e4, 0x16a7, 0x14e4, 0x000b, 0, 0, BCM5703 }, + {0x14e4, 0x16a7, 0x14e4, 0x800a, 0, 0, BCM5703 }, + {0x14e4, 0x16a7, 0x0e11, 0xca, 0, 0, NC7771 }, + {0x14e4, 0x16a7, 0x0e11, 0xcb, 0, 0, NC7781 }, + {0x14e4, 0x16a7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5703 }, + {0,} +}; + +MODULE_DEVICE_TABLE(pci, bcm5700_pci_tbl); + +#ifdef CONFIG_PROC_FS +extern int bcm5700_proc_create(void); +extern int bcm5700_proc_create_dev(struct net_device *dev); +extern int bcm5700_proc_remove_dev(struct net_device *dev); +#endif + +static int __devinit bcm5700_init_board(struct pci_dev *pdev, + struct net_device **dev_out, + int board_idx) +{ + struct net_device *dev; + PUM_DEVICE_BLOCK pUmDevice; + PLM_DEVICE_BLOCK pDevice; + int rc; + + *dev_out = NULL; + + /* dev zeroed in init_etherdev */ + dev = init_etherdev(NULL, sizeof(*pUmDevice)); + if (dev == NULL) { + printk (KERN_ERR "%s: unable to alloc new ethernet\n", + bcm5700_driver); + return -ENOMEM; + } + SET_MODULE_OWNER(dev); + pUmDevice = (PUM_DEVICE_BLOCK) dev->priv; + + /* enable device (incl. PCI PM wakeup), and bus-mastering */ + rc = pci_enable_device (pdev); + if (rc) + goto err_out; + + rc = pci_request_regions(pdev, bcm5700_driver); + if (rc) + goto err_out; + + pci_set_master(pdev); + + if (pci_set_dma_mask(pdev, ~(0UL)) != 0) { + printk(KERN_ERR "System does not support DMA\n"); + pci_release_regions(pdev); + goto err_out; + } + + pUmDevice->dev = dev; + pUmDevice->pdev = pdev; + pUmDevice->mem_list_num = 0; + pUmDevice->next_module = root_tigon3_dev; + pUmDevice->index = board_idx; + root_tigon3_dev = dev; + + spin_lock_init(&pUmDevice->global_lock); + + spin_lock_init(&pUmDevice->undi_lock); + + spin_lock_init(&pUmDevice->phy_lock); + + pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + + if (mtu[board_idx] > 1500) { + if (mtu[board_idx] > 9000) { + dev->mtu = 9000; + printk(KERN_WARNING "%s: Invalid mtu parameter (%d), using 9000\n", dev->name, mtu[board_idx]); + } + else + dev->mtu = mtu[board_idx]; + } + else if (mtu[board_idx] < 1500) { + printk(KERN_WARNING "%s: Invalid mtu parameter (%d), using 1500\n", dev->name, mtu[board_idx]); + } + + if (pci_find_device(0x8086, 0x2418, NULL) || + pci_find_device(0x8086, 0x2428, NULL)) { + + /* Found ICH or ICH0 */ + pDevice->UndiFix = 1; + } + + if (LM_GetAdapterInfo(pDevice) != LM_STATUS_SUCCESS) { + printk(KERN_ERR "Get Adapter info failed\n"); + rc = -ENODEV; + goto err_out_unmap; + } + + if (pci_find_device(0x1022, 0x700c, NULL) && + (T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5703)) { + /* AMD762 writes I/O out of order */ + /* Setting bit 1 in 762's register 0x4C still doesn't work */ + /* for 5703 */ + pDevice->UndiFix = 1; + pDevice->EnablePciXFix = TRUE; + pDevice->NicSendBd = FALSE; + } + + pUmDevice->do_global_lock = 0; + if (T3_ASIC_REV(pUmDevice->lm_dev.ChipRevId) == T3_ASIC_REV_5700) { + /* The 5700 chip works best without interleaved register */ + /* accesses on certain machines. */ + pUmDevice->do_global_lock = 1; + } + if ((T3_ASIC_REV(pUmDevice->lm_dev.ChipRevId) == T3_ASIC_REV_5701) && + ((pDevice->PciState & T3_PCI_STATE_NOT_PCI_X_BUS) == 0)) { + + pUmDevice->rx_buf_align = 0; + } + else { + pUmDevice->rx_buf_align = 2; + } +/* dev->base_addr = pci_resource_start(pdev, 0);*/ + dev->mem_start = pci_resource_start(pdev, 0); + dev->mem_end = dev->mem_start + pDevice->MemBaseSize; + dev->irq = pDevice->Irq = pdev->irq; + + *dev_out = dev; + return 0; + +err_out_unmap: + pci_release_regions(pdev); + bcm5700_freemem(dev); + +err_out: + unregister_netdev(dev); + kfree (dev); + return rc; +} + +static int __devinit +bcm5700_print_ver(void) +{ + printk(KERN_INFO "Broadcom Gigabit Ethernet Driver %s ", + bcm5700_driver); +#ifdef NICE_SUPPORT + printk("with Broadcom NIC Extension (NICE) "); +#endif + printk("ver. %s %s\n", bcm5700_version, bcm5700_date); + return 0; +} + +static int __devinit +bcm5700_init_one(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + struct net_device *dev = NULL; + PUM_DEVICE_BLOCK pUmDevice; + PLM_DEVICE_BLOCK pDevice; + int i; + static int board_idx = -1; + static int printed_version = 0; + struct pci_dev *amd_dev; + + board_idx++; + + if (!printed_version) { + bcm5700_print_ver(); +#ifdef CONFIG_PROC_FS + bcm5700_proc_create(); +#endif + printed_version = 1; + } + + i = bcm5700_init_board(pdev, &dev, board_idx); + if (i < 0) { + return i; + } + + if (dev == NULL) + return -ENOMEM; + + dev->open = bcm5700_open; + dev->hard_start_xmit = bcm5700_start_xmit; + dev->stop = bcm5700_close; + dev->get_stats = bcm5700_get_stats; + dev->set_multicast_list = bcm5700_set_rx_mode; + dev->do_ioctl = bcm5700_ioctl; + dev->set_mac_address = &bcm5700_set_mac_addr; +#if (LINUX_VERSION_CODE >= 0x20400) + dev->tx_timeout = bcm5700_tx_timeout; + dev->watchdog_timeo = TX_TIMEOUT; +#endif +#ifdef BCM_VLAN + dev->vlan_rx_register = &bcm5700_vlan_rx_register; + dev->vlan_rx_kill_vid = &bcm5700_vlan_rx_kill_vid; +#endif + + pUmDevice = (PUM_DEVICE_BLOCK) dev->priv; + pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + + dev->base_addr = pci_resource_start(pdev, 0); + dev->irq = pdev->irq; + + pci_set_drvdata(pdev, dev); + + memcpy(dev->dev_addr, pDevice->NodeAddress, 6); + pUmDevice->name = board_info[ent->driver_data].name, + printk(KERN_INFO "%s: %s found at mem %lx, IRQ %d, ", + dev->name, pUmDevice->name, dev->base_addr, + dev->irq); + printk("node addr "); + for (i = 0; i < 6; i++) { + printk("%2.2x", dev->dev_addr[i]); + } + printk("\n"); + + printk(KERN_INFO "%s: ", dev->name); + if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5400_PHY_ID) + printk("Broadcom BCM5400 Copper "); + else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5401_PHY_ID) + printk("Broadcom BCM5401 Copper "); + else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5411_PHY_ID) + printk("Broadcom BCM5411 Copper "); + else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5701_PHY_ID) + printk("Broadcom BCM5701 Integrated Copper "); + else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5703_PHY_ID) + printk("Broadcom BCM5703 Integrated Copper "); + else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM8002_PHY_ID) + printk("Broadcom BCM8002 SerDes "); + else if (pDevice->EnableTbi) + printk("Agilent HDMP-1636 SerDes "); + else + printk("Unknown "); + printk("transceiver found\n"); + + printk(KERN_INFO "%s: ", dev->name); +#if (LINUX_VERSION_CODE >= 0x20400) + if (scatter_gather[board_idx]) { + dev->features |= NETIF_F_SG | NETIF_F_HIGHDMA; + } + if ((pDevice->ChipRevId != T3_CHIP_ID_5700_B0) && + tx_checksum[board_idx]) { + dev->features |= NETIF_F_IP_CSUM; + } +#ifdef BCM_VLAN + dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; +#endif + + printk("Scatter-gather %s, 64-bit DMA %s, Tx Checksum %s, ", + (char *) ((dev->features & NETIF_F_SG) ? "ON" : "OFF"), + (char *) ((dev->features & NETIF_F_HIGHDMA) ? "ON" : "OFF"), + (char *) ((dev->features & NETIF_F_IP_CSUM) ? "ON" : "OFF")); +#endif + if ((pDevice->ChipRevId != T3_CHIP_ID_5700_B0) && + rx_checksum[board_idx]) + printk("Rx Checksum ON"); + else + printk("Rx Checksum OFF"); + +#ifdef BCM_VLAN + printk(", 802.1Q VLAN ON\n"); +#else + printk("\n"); +#endif +#ifdef CONFIG_PROC_FS + bcm5700_proc_create_dev(dev); +#endif +#ifdef TASKLET + tasklet_init(&pUmDevice->tasklet, bcm5700_tasklet, + (unsigned long) pUmDevice); +#endif + if ((amd_dev = pci_find_device(0x1022, 0x700c, NULL))) { + u32 val; + + /* Found AMD 762 North bridge */ + pci_read_config_dword(amd_dev, 0x4c, &val); + if ((val & 0x02) == 0) { + pci_write_config_dword(amd_dev, 0x4c, val | 0x02); + printk(KERN_INFO "%s: Setting AMD762 Northbridge to enable PCI ordering compliance\n", bcm5700_driver); + } + } + return 0; + +} + + +static void __devexit +bcm5700_remove_one (struct pci_dev *pdev) +{ + struct net_device *dev = pci_get_drvdata (pdev); + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK)dev->priv; + +#ifdef CONFIG_PROC_FS + bcm5700_proc_remove_dev(dev); +#endif + unregister_netdev(dev); + + if (pUmDevice->lm_dev.pMappedMemBase) + iounmap(pUmDevice->lm_dev.pMappedMemBase); + + pci_release_regions(pdev); + + kfree(dev); + + pci_set_drvdata(pdev, NULL); + +/* pci_power_off(pdev, -1);*/ + +} + +int __devinit +bcm5700_probe(struct net_device *dev) +{ + int cards_found = 0; + struct pci_dev *pdev = NULL; + struct pci_device_id *pci_tbl; + u16 ssvid, ssid; + + if ( ! pci_present()) + return -ENODEV; + + pci_tbl = bcm5700_pci_tbl; + while ((pdev = pci_find_class(PCI_CLASS_NETWORK_ETHERNET << 8, pdev))) { + int idx; + + pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &ssvid); + pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &ssid); + for (idx = 0; pci_tbl[idx].vendor; idx++) { + if ((pci_tbl[idx].vendor == PCI_ANY_ID || + pci_tbl[idx].vendor == pdev->vendor) && + (pci_tbl[idx].device == PCI_ANY_ID || + pci_tbl[idx].device == pdev->device) && + (pci_tbl[idx].subvendor == PCI_ANY_ID || + pci_tbl[idx].subvendor == ssvid) && + (pci_tbl[idx].subdevice == PCI_ANY_ID || + pci_tbl[idx].subdevice == ssid)) + { + + break; + } + } + if (pci_tbl[idx].vendor == 0) + continue; + + + if (bcm5700_init_one(pdev, &pci_tbl[idx]) == 0) + cards_found++; + } + + return cards_found ? 0 : -ENODEV; +} + + + +STATIC int +bcm5700_open(struct net_device *dev) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK)dev->priv; + PLM_DEVICE_BLOCK pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + int index; + + index = pUmDevice->index; + if (pDevice->ChipRevId == T3_CHIP_ID_5700_B0) { + pDevice->TaskToOffload = LM_TASK_OFFLOAD_NONE; + } + else { + if (rx_checksum[index]) { + pDevice->TaskToOffload |= + LM_TASK_OFFLOAD_RX_TCP_CHECKSUM | + LM_TASK_OFFLOAD_RX_UDP_CHECKSUM; + } + if (tx_checksum[index]) { + pDevice->TaskToOffload |= + LM_TASK_OFFLOAD_TX_TCP_CHECKSUM | + LM_TASK_OFFLOAD_TX_UDP_CHECKSUM; + pDevice->NoTxPseudoHdrChksum = TRUE; + } + } + /* delay for 4 seconds */ + pUmDevice->delayed_link_ind = (4 * HZ) / pUmDevice->timer_interval; + + pUmDevice->adaptive_expiry = HZ / pUmDevice->timer_interval; + +#if INCLUDE_TBI_SUPPORT + if(pDevice->PollTbiLink) + pUmDevice->poll_tbi_expiry = HZ / pUmDevice->timer_interval; +#endif + + /* Sometimes we get spurious ints. after reset when link is down. */ + /* This field tells the isr to service the int. even if there is */ + /* no status block update. */ + if (pDevice->LedMode != LED_MODE_LINK10) { + pUmDevice->adapter_just_inited = (3 * HZ) / + pUmDevice->timer_interval; + } + else { + pUmDevice->adapter_just_inited = 0; + } + + if (request_irq(dev->irq, &bcm5700_interrupt, SA_SHIRQ, dev->name, dev)) { + return -EAGAIN; + } + + pUmDevice->opened = 1; +#if TIGON3_DEBUG + pUmDevice->tx_zc_count = 0; + pUmDevice->tx_chksum_count = 0; + pUmDevice->tx_himem_count = 0; + pUmDevice->rx_good_chksum_count = 0; + pUmDevice->rx_bad_chksum_count = 0; +#endif + if (LM_InitializeAdapter(pDevice) != LM_STATUS_SUCCESS) { + free_irq(dev->irq, dev); + bcm5700_freemem(dev); + return -EAGAIN; + } + if (pDevice->UndiFix) { + printk(KERN_INFO "%s: Using indirect register access\n", dev->name); + } + + if (memcmp(dev->dev_addr, pDevice->NodeAddress, 6)) { + LM_SetMacAddress(pDevice, dev->dev_addr); + } + + if (tigon3_debug > 1) + printk(KERN_DEBUG "%s: tigon3_open() irq %d.\n", dev->name, dev->irq); + + QQ_InitQueue(&pUmDevice->rx_out_of_buf_q.Container, + MAX_RX_PACKET_DESC_COUNT); + netif_start_queue(dev); + +#if (LINUX_VERSION_CODE < 0x020300) + MOD_INC_USE_COUNT; +#endif + + init_timer(&pUmDevice->timer); + pUmDevice->timer.expires = RUN_AT(pUmDevice->timer_interval); + pUmDevice->timer.data = (unsigned long)dev; + pUmDevice->timer.function = &bcm5700_timer; + add_timer(&pUmDevice->timer); + + atomic_set(&pUmDevice->intr_sem, 0); + LM_EnableInterrupt(pDevice); + + return 0; +} + +STATIC void +bcm5700_timer(unsigned long data) +{ + struct net_device *dev = (struct net_device *)data; + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK)dev->priv; + PLM_DEVICE_BLOCK pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + long flags; + LM_UINT32 value32; + + if (!pUmDevice->opened) + return; + + if (atomic_read(&pUmDevice->intr_sem)) { + pUmDevice->timer.expires = RUN_AT(pUmDevice->timer_interval); + add_timer(&pUmDevice->timer); + return; + } +#if INCLUDE_TBI_SUPPORT + if(pDevice->PollTbiLink && (--pUmDevice->poll_tbi_expiry == 0)) { + flags = bcm5700_phy_lock(pUmDevice); + value32 = REG_RD(pDevice, MacCtrl.Status); + if (((pDevice->LinkStatus == LM_STATUS_LINK_ACTIVE) && + ((value32 & MAC_STATUS_LINK_STATE_CHANGED) || + !(value32 & MAC_STATUS_PCS_SYNCED))) + || + ((pDevice->LinkStatus != LM_STATUS_LINK_ACTIVE) && + (value32 & MAC_STATUS_PCS_SYNCED))) + { + LM_SetupPhy(pDevice); + } + bcm5700_phy_unlock(pUmDevice, flags); + pUmDevice->poll_tbi_expiry = HZ / pUmDevice->timer_interval; + + } +#endif + + if (pUmDevice->delayed_link_ind > 0) { + if (pUmDevice->delayed_link_ind == 1) + MM_IndicateStatus(pDevice, pDevice->LinkStatus); + else + pUmDevice->delayed_link_ind--; + } + if (pUmDevice->adapter_just_inited > 0) { + pUmDevice->adapter_just_inited--; + if (pDevice->EnableTbi && !pUmDevice->adapter_just_inited && + !atomic_read(&pUmDevice->intr_sem)) { + LM_EnableInterrupt(pDevice); + } + } + + if (pUmDevice->crc_counter_expiry > 0) + pUmDevice->crc_counter_expiry--; + + if (!pUmDevice->interrupt) { + if (!pDevice->UseTaggedStatus) { + flags = bcm5700_lock(pUmDevice); + if (pDevice->pStatusBlkVirt->Status & STATUS_BLOCK_UPDATED) { + /* This will generate an interrupt */ + REG_WR(pDevice, Grc.LocalCtrl, + pDevice->GrcLocalCtrl | + GRC_MISC_LOCAL_CTRL_SET_INT); + } + else { + REG_WR(pDevice, HostCoalesce.Mode, + HOST_COALESCE_ENABLE | + HOST_COALESCE_NOW); + } + if (!(REG_RD(pDevice, DmaWrite.Mode) & + DMA_WRITE_MODE_ENABLE)) { + + bcm5700_unlock(pUmDevice, flags); + bcm5700_tx_timeout(dev); + } + else { + bcm5700_unlock(pUmDevice, flags); + } + if (pUmDevice->tx_queued) { + pUmDevice->tx_queued = 0; + netif_wake_queue(dev); + } + } +#if (LINUX_VERSION_CODE < 0x02032b) + if ((QQ_GetEntryCnt(&pDevice->TxPacketFreeQ.Container) != + pDevice->TxPacketDescCnt) && + ((jiffies - dev->trans_start) > TX_TIMEOUT)) { + + printk(KERN_WARNING "%s: Tx hung\n", dev->name); + bcm5700_tx_timeout(dev); + } +#endif + } + if (pUmDevice->adaptive_coalesce) { + pUmDevice->adaptive_expiry--; + if (pUmDevice->adaptive_expiry == 0) { + pUmDevice->adaptive_expiry = HZ / + pUmDevice->timer_interval; + bcm5700_adapt_coalesce(pUmDevice); + } + } + if (QQ_GetEntryCnt(&pUmDevice->rx_out_of_buf_q.Container) > + pUmDevice->rx_buf_repl_panic_thresh) { + /* Generate interrupt and let isr allocate buffers */ + REG_WR(pDevice, HostCoalesce.Mode, + HOST_COALESCE_ENABLE | HOST_COALESCE_NOW); + } + + pUmDevice->timer.expires = RUN_AT(pUmDevice->timer_interval); + add_timer(&pUmDevice->timer); + pUmDevice->spurious_int = 0; +} + +STATIC int +bcm5700_adapt_coalesce(PUM_DEVICE_BLOCK pUmDevice) +{ + PLM_DEVICE_BLOCK pDevice = &pUmDevice->lm_dev; + uint rx_curr_cnt, tx_curr_cnt, rx_delta, tx_delta, total_delta; + int adapt = 0; + long flags; + + rx_curr_cnt = pDevice->pStatsBlkVirt->ifHCInUcastPkts.Low; + tx_curr_cnt = pDevice->pStatsBlkVirt->COSIfHCOutPkts[0].Low; + if ((rx_curr_cnt <= pUmDevice->rx_last_cnt) || + (tx_curr_cnt <= pUmDevice->tx_last_cnt)) { + + /* skip if there is counter rollover */ + pUmDevice->rx_last_cnt = rx_curr_cnt; + pUmDevice->tx_last_cnt = tx_curr_cnt; + return 0; + } + + rx_delta = rx_curr_cnt - pUmDevice->rx_last_cnt; + tx_delta = tx_curr_cnt - pUmDevice->tx_last_cnt; + total_delta = rx_delta + tx_delta; + + pUmDevice->rx_last_cnt = rx_curr_cnt; + pUmDevice->tx_last_cnt = tx_curr_cnt; + + if (total_delta < rx_delta) + return 0; + + if (total_delta < ADAPTIVE_LO_PKT_THRESH) { + if (pUmDevice->rx_curr_coalesce_frames != + ADAPTIVE_LO_RX_MAX_COALESCED_FRAMES) { + + if (!bcm5700_trylock(pUmDevice, &flags)) + return 0; + + adapt = 1; + + pUmDevice->rx_curr_coalesce_frames = + ADAPTIVE_LO_RX_MAX_COALESCED_FRAMES; + pUmDevice->rx_curr_coalesce_ticks = + ADAPTIVE_LO_RX_COALESCING_TICKS; + pUmDevice->tx_curr_coalesce_frames = + ADAPTIVE_LO_TX_MAX_COALESCED_FRAMES; + + } + } + else if (total_delta < ADAPTIVE_HI_PKT_THRESH) { + if (pUmDevice->rx_curr_coalesce_frames != + DEFAULT_RX_MAX_COALESCED_FRAMES) { + + if (!bcm5700_trylock(pUmDevice, &flags)) + return 0; + + adapt = 1; + + pUmDevice->rx_curr_coalesce_frames = + DEFAULT_RX_MAX_COALESCED_FRAMES; + pUmDevice->rx_curr_coalesce_ticks = + DEFAULT_RX_COALESCING_TICKS; + pUmDevice->tx_curr_coalesce_frames = + DEFAULT_TX_MAX_COALESCED_FRAMES; + + } + } + else { + if (pUmDevice->rx_curr_coalesce_frames != + ADAPTIVE_HI_RX_MAX_COALESCED_FRAMES) { + + if (!bcm5700_trylock(pUmDevice, &flags)) + return 0; + + adapt = 1; + + pUmDevice->rx_curr_coalesce_frames = + ADAPTIVE_HI_RX_MAX_COALESCED_FRAMES; + pUmDevice->rx_curr_coalesce_ticks = + ADAPTIVE_HI_RX_COALESCING_TICKS; + pUmDevice->tx_curr_coalesce_frames = + ADAPTIVE_HI_TX_MAX_COALESCED_FRAMES; + + } + } + if (adapt) { + REG_WR(pDevice, HostCoalesce.RxMaxCoalescedFrames, + pUmDevice->rx_curr_coalesce_frames); + + REG_WR(pDevice, HostCoalesce.RxCoalescingTicks, + pUmDevice->rx_curr_coalesce_ticks); + + REG_WR(pDevice, HostCoalesce.TxMaxCoalescedFrames, + pUmDevice->tx_curr_coalesce_frames); + bcm5700_unlock(pUmDevice, flags); + } + return 0; +} + +STATIC void +bcm5700_tx_timeout(struct net_device *dev) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK)dev->priv; + PLM_DEVICE_BLOCK pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + long flags; + + netif_stop_queue(dev); + bcm5700_intr_off(pUmDevice); + flags = bcm5700_phy_lock(pUmDevice); + LM_ResetAdapter(pDevice); + if (memcmp(dev->dev_addr, pDevice->NodeAddress, 6)) { + LM_SetMacAddress(pDevice, dev->dev_addr); + } + bcm5700_phy_unlock(pUmDevice, flags); + bcm5700_intr_on(pUmDevice); + netif_wake_queue(dev); +} + +#ifdef BCM_VLAN +STATIC void +bcm5700_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) dev->priv; + + bcm5700_intr_off(pUmDevice); + pUmDevice->vlgrp = vlgrp; + bcm5700_intr_on(pUmDevice); +} + +STATIC void +bcm5700_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) dev->priv; + + bcm5700_intr_off(pUmDevice); + if (pUmDevice->vlgrp) { + pUmDevice->vlgrp->vlan_devices[vid] = NULL; + } + bcm5700_intr_on(pUmDevice); +} +#endif + +STATIC int +bcm5700_start_xmit(struct sk_buff *skb, struct net_device *dev) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK)dev->priv; + PLM_DEVICE_BLOCK pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + PLM_PACKET pPacket; + PUM_PACKET pUmPacket; + PLM_FRAG_LIST pfrag_list; + long flags; + unsigned int len; + dma_addr_t map; +#if MAX_SKB_FRAGS + skb_frag_t *frag; + int i; + int frag_no; + dmaaddr_high_t hi_map; +#endif +#ifdef NICE_SUPPORT + vlan_tag_t *vlan_tag; +#endif + + if ((pDevice->LinkStatus == LM_STATUS_LINK_DOWN) || !pDevice->InitDone) + { + dev_kfree_skb(skb); + return 0; + } + +#if (LINUX_VERSION_CODE < 0x02032b) + if (test_and_set_bit(0, &dev->tbusy)) { + return 1; + } +#endif + + if (pUmDevice->do_global_lock && pUmDevice->interrupt) { + netif_stop_queue(dev); + pUmDevice->tx_queued = 1; + if (!pUmDevice->interrupt) { + netif_wake_queue(dev); + pUmDevice->tx_queued = 0; + } + return 1; + } + + pPacket = (PLM_PACKET) + QQ_PopHead(&pDevice->TxPacketFreeQ.Container); + if (pPacket == 0) { + netif_stop_queue(dev); + pUmDevice->tx_full = 1; + if (QQ_GetEntryCnt(&pDevice->TxPacketFreeQ.Container)) { + netif_wake_queue(dev); + pUmDevice->tx_full = 0; + } + return 1; + } + pUmPacket = (PUM_PACKET) pPacket; + pUmPacket->skbuff = skb; + pfrag_list = &pUmPacket->frag_list; + pPacket->u.Tx.pFraglist = pfrag_list; + if (skb->ip_summed == CHECKSUM_HW) { + pPacket->Flags = SND_BD_FLAG_TCP_UDP_CKSUM; +#if TIGON3_DEBUG + pUmDevice->tx_chksum_count++; +#endif + } + else { + pPacket->Flags = 0; + } +#if MAX_SKB_FRAGS + if ((frag_no = skb_shinfo(skb)->nr_frags)) + len = skb->len - skb->data_len; + else + len = skb->len; + if (atomic_read(&pDevice->SendBdLeft) < (frag_no + 1)) { + netif_stop_queue(dev); + pUmDevice->tx_full = 1; + QQ_PushHead(&pDevice->TxPacketFreeQ.Container, pPacket); + if (atomic_read(&pDevice->SendBdLeft) >= (frag_no + 1)) { + netif_wake_queue(dev); + pUmDevice->tx_full = 0; + } + return 1; + } +#else + len = skb->len; + if (atomic_read(&pDevice->SendBdLeft) == 0) { + netif_stop_queue(dev); + pUmDevice->tx_full = 1; + QQ_PushHead(&pDevice->TxPacketFreeQ.Container, pPacket); + if (atomic_read(&pDevice->SendBdLeft)) { + netif_wake_queue(dev); + pUmDevice->tx_full = 0; + } + return 1; + } +#endif + + pfrag_list->Fragments[0].FragSize = len; + map = pci_map_single(pUmDevice->pdev, skb->data, len, PCI_DMA_TODEVICE); + bcm_set_addr(&pfrag_list->Fragments[0].FragBuf, map); + pci_unmap_addr_set(pUmPacket, map[0], map); + pci_unmap_len_set(pUmPacket, map_len[0], len); + +#if MAX_SKB_FRAGS + pPacket->u.Tx.FragCount = frag_no + 1; +#if TIGON3_DEBUG + if (pPacket->u.Tx.FragCount > 1) + pUmDevice->tx_zc_count++; +#endif + for (i = 1; i < pPacket->u.Tx.FragCount; i++) { + frag = &skb_shinfo(skb)->frags[i - 1]; + + hi_map = pci_map_page(pUmDevice->pdev, + frag->page, + frag->page_offset, + frag->size, PCI_DMA_TODEVICE); + + pci_unmap_addr_set(pUmPacket, map[i], hi_map); + pci_unmap_len_set(pUmPacket, map_len[i], frag->size); + bcm_set_addr_high(&pfrag_list->Fragments[i].FragBuf, hi_map); +#if TIGON3_DEBUG + if (pfrag_list->Fragments[i].FragBuf.High) + pUmDevice->tx_himem_count++; +#endif + pfrag_list->Fragments[i].FragSize = frag->size; + } +#else + pPacket->u.Tx.FragCount = 1; +#endif + + /* Work around 4GB dma problem */ + if (T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700) { + if (check_4G_boundary(pUmDevice, pUmPacket) == 0) { + QQ_PushHead(&pDevice->TxPacketFreeQ.Container, pPacket); +#if (LINUX_VERSION_CODE < 0x02032b) + netif_wake_queue(dev); +#endif + return 0; + } + skb = pUmPacket->skbuff; + } + +#ifdef BCM_VLAN + if (pUmDevice->vlgrp && vlan_tx_tag_present(skb)) { + pPacket->VlanTag = vlan_tx_tag_get(skb); + pPacket->Flags |= SND_BD_FLAG_VLAN_TAG; + } +#endif +#ifdef NICE_SUPPORT + vlan_tag = (vlan_tag_t *) &skb->cb[0]; + if (vlan_tag->signature == 0x5555) { + pPacket->VlanTag = vlan_tag->tag; + pPacket->Flags |= SND_BD_FLAG_VLAN_TAG; + vlan_tag->signature = 0; + } +#endif + flags = bcm5700_lock(pUmDevice); + LM_SendPacket(pDevice, pPacket); + bcm5700_unlock(pUmDevice, flags); + if (QQ_GetEntryCnt(&pDevice->TxPacketFreeQ.Container) == 0) { + netif_stop_queue(dev); + pUmDevice->tx_full = 1; + if (QQ_GetEntryCnt(&pDevice->TxPacketFreeQ.Container) != 0) { + netif_wake_queue(dev); + pUmDevice->tx_full = 0; + } + } +#if (LINUX_VERSION_CODE < 0x02032b) + else { + netif_wake_queue(dev); + } +#endif + dev->trans_start = jiffies; + return 0; +} + +STATIC +int +check_4G_boundary(PUM_DEVICE_BLOCK pUmDevice, PUM_PACKET pUmPacket) +{ + u32 base; + int i; + PLM_FRAG_LIST pfrag_list = &pUmPacket->frag_list; + PLM_FRAG pfrag; + struct sk_buff *skb, *nskb; + dma_addr_t map; + int do_copy = 0; + + /* Work around 4GB dma problem */ + for (i = 0; i < pUmPacket->lm_packet.u.Tx.FragCount; i++) { + pfrag = &pfrag_list->Fragments[i]; + + if (((base = pfrag->FragBuf.Low) > 0xffffdcc0) && + (pfrag->FragBuf.High == 0) && + ((base + 8 + pfrag->FragSize) < base)) { + + do_copy = 1; + break; + } + } + if (do_copy) { + skb = pUmPacket->skbuff; +#if ! defined(NO_PCI_UNMAP) + pci_unmap_single(pUmDevice->pdev, + pci_unmap_addr(pUmPacket, map[0]), + pci_unmap_len(pUmPacket, map_len[0]), + PCI_DMA_TODEVICE); +#if MAX_SKB_FRAGS + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { + pci_unmap_page(pUmDevice->pdev, + pci_unmap_addr(pUmPacket, map[i + 1]), + pci_unmap_len(pUmPacket, map_len[i + 1]), + PCI_DMA_TODEVICE); + } +#endif +#endif + if ((nskb = skb_copy(skb, GFP_ATOMIC))) { + pfrag_list->Fragments[0].FragSize = nskb->len; + map = pci_map_single(pUmDevice->pdev, nskb->data, + nskb->len, PCI_DMA_TODEVICE); + bcm_set_addr(&pfrag_list->Fragments[0].FragBuf, map); + pci_unmap_addr_set(pUmPacket, map[0], map); + pci_unmap_len_set(pUmPacket, map_len[0], nskb->len); + pUmPacket->lm_packet.u.Tx.FragCount = 1; + } + dev_kfree_skb(skb); + pUmPacket->skbuff = nskb; + if (nskb == 0) { + return 0; + } + } + return 1; +} + +STATIC void +bcm5700_interrupt(int irq, void *dev_instance, struct pt_regs *regs) +{ + struct net_device *dev = (struct net_device *)dev_instance; + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK)dev->priv; + PLM_DEVICE_BLOCK pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + LM_UINT32 oldtag, newtag; + int repl_buf_count, i; + + if (!pDevice->InitDone) + return; + + if (atomic_read(&pUmDevice->intr_sem)) + return; + + bcm5700_intr_lock(pUmDevice); + if (test_and_set_bit(0, (void*)&pUmDevice->interrupt)) { + printk(KERN_ERR "%s: Duplicate entry of the interrupt handler by " + "processor %d.\n", + dev->name, hard_smp_processor_id()); + bcm5700_intr_unlock(pUmDevice); + return; + } + + if (pDevice->UseTaggedStatus) { + if ((pDevice->pStatusBlkVirt->Status & STATUS_BLOCK_UPDATED) || + pUmDevice->adapter_just_inited) { + MB_REG_WR(pDevice, Mailbox.Interrupt[0].Low, 1); + oldtag = pDevice->pStatusBlkVirt->StatusTag; + + for (i = 0; ; i++) { + pDevice->pStatusBlkVirt->Status &= + ~STATUS_BLOCK_UPDATED; + + LM_ServiceInterrupts(pDevice); + newtag = pDevice->pStatusBlkVirt->StatusTag; + if ((newtag == oldtag) || (i > 50)) { + MB_REG_WR(pDevice, + Mailbox.Interrupt[0].Low, + newtag << 24); + if (pDevice->UndiFix) { + REG_WR(pDevice, Grc.LocalCtrl, + pDevice->GrcLocalCtrl | 0x2); + } + break; + } + oldtag = newtag; + } + } + } + else if ((pDevice->pStatusBlkVirt->Status & STATUS_BLOCK_UPDATED) || + pUmDevice->adapter_just_inited) { + do { + uint dummy; + + MB_REG_WR(pDevice, Mailbox.Interrupt[0].Low, 1); + pDevice->pStatusBlkVirt->Status &= ~STATUS_BLOCK_UPDATED; + LM_ServiceInterrupts(pDevice); + MB_REG_WR(pDevice, Mailbox.Interrupt[0].Low, 0); + dummy = MB_REG_RD(pDevice, Mailbox.Interrupt[0].Low); + } + while (pDevice->pStatusBlkVirt->Status & STATUS_BLOCK_UPDATED); + if (pDevice->UndiFix) { + REG_WR(pDevice, Grc.LocalCtrl, + pDevice->GrcLocalCtrl | 0x2); + } + } + if (pUmDevice->adapter_just_inited && pDevice->EnableTbi) { + if (pDevice->LinkStatus != LM_STATUS_LINK_ACTIVE) { + pUmDevice->spurious_int++; + if (pUmDevice->spurious_int > 25) { + LM_DisableInterrupt(pDevice); + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode | + MAC_MODE_LINK_POLARITY); + MM_Wait(1); + pUmDevice->spurious_int = 0; + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode); + if ((pUmDevice->adapter_just_inited == 0) && + !atomic_read(&pUmDevice->intr_sem)) { + LM_EnableInterrupt(pDevice); + } + } + } + } +#ifdef TASKLET + repl_buf_count = QQ_GetEntryCnt(&pUmDevice->rx_out_of_buf_q.Container); + if (repl_buf_count > pUmDevice->rx_buf_repl_thresh) { + if ((repl_buf_count > pUmDevice->rx_buf_repl_panic_thresh) && + (!test_and_set_bit(0, &pUmDevice->tasklet_busy))) { + replenish_rx_buffers(pUmDevice); + clear_bit(0, (void*)&pUmDevice->tasklet_busy); + } + else if (!pUmDevice->tasklet_pending) { + pUmDevice->tasklet_pending = 1; + tasklet_schedule(&pUmDevice->tasklet); + } + } +#else + if (QQ_GetEntryCnt(&pUmDevice->rx_out_of_buf_q.Container)) { + replenish_rx_buffers(pUmDevice); + } + + if (QQ_GetEntryCnt(&pDevice->RxPacketFreeQ.Container)) { + LM_QueueRxPackets(pDevice); + } +#endif + + clear_bit(0, (void*)&pUmDevice->interrupt); + bcm5700_intr_unlock(pUmDevice); + if (pUmDevice->tx_queued) { + pUmDevice->tx_queued = 0; + netif_wake_queue(dev); + } + return; +} + + +STATIC void +bcm5700_tasklet(unsigned long data) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK)data; + + /* RH 7.2 Beta 3 tasklets are reentrant */ + if (test_and_set_bit(0, &pUmDevice->tasklet_busy)) { + pUmDevice->tasklet_pending = 0; + return; + } + + pUmDevice->tasklet_pending = 0; + replenish_rx_buffers(pUmDevice); + clear_bit(0, &pUmDevice->tasklet_busy); +} + +STATIC int +bcm5700_close(struct net_device *dev) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK)dev->priv; + PLM_DEVICE_BLOCK pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + +#if (LINUX_VERSION_CODE < 0x02032b) + dev->start = 0; +#endif + netif_stop_queue(dev); + pUmDevice->opened = 0; + + if (tigon3_debug > 1) + printk(KERN_DEBUG "%s: Shutting down Tigon3\n", + dev->name); + + bcm5700_intr_off(pUmDevice); + netif_carrier_off(dev); +#ifdef TASKLET +// tasklet_disable(&pUmDevice->tasklet); + tasklet_kill(&pUmDevice->tasklet); +#endif + LM_Halt(pDevice); + pDevice->InitDone = 0; + del_timer(&pUmDevice->timer); + + free_irq(dev->irq, dev); +#if (LINUX_VERSION_CODE < 0x020300) + MOD_DEC_USE_COUNT; +#endif + LM_SetPowerState(pDevice, LM_POWER_STATE_D3); + bcm5700_freemem(dev); + + return 0; +} + +STATIC int +bcm5700_freemem(struct net_device *dev) +{ + int i; + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK)dev->priv; + + for (i = 0; i < pUmDevice->mem_list_num; i++) { + if (pUmDevice->mem_size_list[i] == 0) { + kfree(pUmDevice->mem_list[i]); + } + else { + pci_free_consistent(pUmDevice->pdev, + (size_t) pUmDevice->mem_size_list[i], + pUmDevice->mem_list[i], + pUmDevice->dma_list[i]); + } + } + pUmDevice->mem_list_num = 0; + return 0; +} + +LM_UINT32 +bcm5700_crc_count(PUM_DEVICE_BLOCK pUmDevice) +{ + PLM_DEVICE_BLOCK pDevice = &pUmDevice->lm_dev; + LM_UINT32 Value32; + PT3_STATS_BLOCK pStats = (PT3_STATS_BLOCK) pDevice->pStatsBlkVirt; + unsigned long flags; + +#if INCLUDE_TBI_SUPPORT + if(pDevice->EnableTbi) + return (pStats->dot3StatsFCSErrors.Low); +#endif + if (T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 || + T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) { + + if (!pUmDevice->opened || pUmDevice->adapter_just_inited) + return 0; + + /* regulate MDIO access during run time */ + if (pUmDevice->crc_counter_expiry > 0) + return pDevice->PhyCrcCount; + + pUmDevice->crc_counter_expiry = (5 * HZ) / + pUmDevice->timer_interval; + + flags = bcm5700_phy_lock(pUmDevice); + LM_ReadPhy(pDevice, 0x1e, &Value32); + if ((Value32 & 0x8000) == 0) + LM_WritePhy(pDevice, 0x1e, Value32 | 0x8000); + LM_ReadPhy(pDevice, 0x14, &Value32); + bcm5700_phy_unlock(pUmDevice, flags); + /* Sometimes data on the MDIO bus can be corrupted */ + if (Value32 != 0xffff) + pDevice->PhyCrcCount += Value32; + return pDevice->PhyCrcCount; + } + else if (pStats == 0) { + return 0; + } + else { + return (pStats->dot3StatsFCSErrors.Low); + } +} + +STATIC struct net_device_stats * +bcm5700_get_stats(struct net_device *dev) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK)dev->priv; + PLM_DEVICE_BLOCK pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + PT3_STATS_BLOCK pStats = (PT3_STATS_BLOCK) pDevice->pStatsBlkVirt; + struct net_device_stats *p_netstats = &pUmDevice->stats; + + if (pStats == 0) + return p_netstats; + + /* Get stats from LM */ + p_netstats->rx_packets = pStats->ifHCInUcastPkts.Low + + pStats->ifHCInMulticastPkts.Low + + pStats->ifHCInBroadcastPkts.Low; + p_netstats->tx_packets = pStats->COSIfHCOutPkts[0].Low; + p_netstats->rx_bytes = pStats->ifHCInOctets.Low; + p_netstats->tx_bytes = pStats->ifHCOutOctets.Low; + p_netstats->tx_errors = pStats->dot3StatsInternalMacTransmitErrors.Low + + pStats->dot3StatsCarrierSenseErrors.Low + + pStats->ifOutDiscards.Low + + pStats->ifOutErrors.Low; + p_netstats->multicast = pStats->ifHCInMulticastPkts.Low; + p_netstats->collisions = pStats->etherStatsCollisions.Low; + p_netstats->rx_length_errors = pStats->dot3StatsFramesTooLong.Low + + pStats->etherStatsUndersizePkts.Low; + p_netstats->rx_over_errors = pStats->nicNoMoreRxBDs.Low; + p_netstats->rx_frame_errors = pStats->dot3StatsAlignmentErrors.Low; + p_netstats->rx_crc_errors = bcm5700_crc_count(pUmDevice); + p_netstats->rx_errors = p_netstats->rx_length_errors + + p_netstats->rx_over_errors + + p_netstats->rx_frame_errors + + p_netstats->rx_crc_errors + + pStats->etherStatsFragments.Low + + pStats->etherStatsJabbers.Low; + + p_netstats->tx_aborted_errors = pStats->ifOutDiscards.Low; + p_netstats->tx_carrier_errors = pStats->dot3StatsCarrierSenseErrors.Low; + + return p_netstats; +} + +#ifdef SIOCETHTOOL +static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr) +{ + struct ethtool_cmd ethcmd; + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK)dev->priv; + PLM_DEVICE_BLOCK pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + + if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd))) + return -EFAULT; + + switch (ethcmd.cmd) { +#ifdef ETHTOOL_GDRVINFO + case ETHTOOL_GDRVINFO: { + struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO}; + + strcpy(info.driver, bcm5700_driver); +#if INCLUDE_5701_AX_FIX + if(pDevice->ChipRevId == T3_CHIP_ID_5701_A0) { + extern int t3FwReleaseMajor; + extern int t3FwReleaseMinor; + extern int t3FwReleaseFix; + + sprintf(info.fw_version, "%i.%i.%i", + t3FwReleaseMajor, t3FwReleaseMinor, + t3FwReleaseFix); + } +#endif + strcpy(info.version, bcm5700_version); + strcpy(info.bus_info, pUmDevice->pdev->slot_name); + if (copy_to_user(useraddr, &info, sizeof(info))) + return -EFAULT; + return 0; + } +#endif + case ETHTOOL_GSET: { + if (pDevice->EnableTbi) { + ethcmd.supported = + (SUPPORTED_1000baseT_Full | + SUPPORTED_Autoneg); + ethcmd.supported |= SUPPORTED_FIBRE; + ethcmd.port = PORT_FIBRE; + } + else { + ethcmd.supported = + (SUPPORTED_10baseT_Half | + SUPPORTED_10baseT_Full | + SUPPORTED_100baseT_Half | + SUPPORTED_100baseT_Full | + SUPPORTED_1000baseT_Half | + SUPPORTED_1000baseT_Full | + SUPPORTED_Autoneg); + ethcmd.supported |= SUPPORTED_TP; + ethcmd.port = PORT_TP; + } + + ethcmd.transceiver = XCVR_INTERNAL; + ethcmd.phy_address = 0; + + if (pUmDevice->line_speed == 1000) + ethcmd.speed = SPEED_1000; + else if (pUmDevice->line_speed == 100) + ethcmd.speed = SPEED_100; + else if (pUmDevice->line_speed == 10) + ethcmd.speed = SPEED_10; + else + ethcmd.speed = 0; + + if (pDevice->DuplexMode == LM_DUPLEX_MODE_FULL) + ethcmd.duplex = DUPLEX_FULL; + else + ethcmd.duplex = DUPLEX_HALF; + + if (pDevice->DisableAutoNeg == FALSE) { + ethcmd.autoneg = AUTONEG_ENABLE; + ethcmd.advertising = ADVERTISED_Autoneg; + if (pDevice->EnableTbi) { + ethcmd.advertising |= + ADVERTISED_1000baseT_Full | + ADVERTISED_FIBRE; + } + else { + ethcmd.advertising |= + ADVERTISED_TP; + if (pDevice->advertising & + PHY_AN_AD_10BASET_HALF) { + + ethcmd.advertising |= + ADVERTISED_10baseT_Half; + } + if (pDevice->advertising & + PHY_AN_AD_10BASET_FULL) { + + ethcmd.advertising |= + ADVERTISED_10baseT_Full; + } + if (pDevice->advertising & + PHY_AN_AD_100BASETX_HALF) { + + ethcmd.advertising |= + ADVERTISED_100baseT_Half; + } + if (pDevice->advertising & + PHY_AN_AD_100BASETX_FULL) { + + ethcmd.advertising |= + ADVERTISED_100baseT_Full; + } + if (pDevice->advertising1000 & + BCM540X_AN_AD_1000BASET_HALF) { + + ethcmd.advertising |= + ADVERTISED_1000baseT_Half; + } + if (pDevice->advertising1000 & + BCM540X_AN_AD_1000BASET_FULL) { + + ethcmd.advertising |= + ADVERTISED_1000baseT_Full; + } + } + } + else { + ethcmd.autoneg = AUTONEG_DISABLE; + ethcmd.advertising = 0; + } + + ethcmd.maxtxpkt = pDevice->TxMaxCoalescedFrames; + ethcmd.maxrxpkt = pDevice->RxMaxCoalescedFrames; + + if(copy_to_user(useraddr, ðcmd, sizeof(ethcmd))) + return -EFAULT; + return 0; + } + case ETHTOOL_SSET: { + long flags; + + if(!capable(CAP_NET_ADMIN)) + return -EPERM; + if (ethcmd.autoneg == AUTONEG_ENABLE) { + if (pDevice->EnableTbi) { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_AUTO; + } + else { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_UTP_AUTO; + } + pDevice->DisableAutoNeg = FALSE; + } + else if (ethcmd.speed == SPEED_1000) { + if (!pDevice->EnableTbi) + return -EINVAL; + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_UTP_1000MBPS_FULL_DUPLEX; + pDevice->DisableAutoNeg = TRUE; + } + else if (ethcmd.speed == SPEED_100) { + if (ethcmd.duplex == DUPLEX_FULL) { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_UTP_100MBPS_FULL_DUPLEX; + } + else { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_UTP_100MBPS; + } + pDevice->DisableAutoNeg = TRUE; + } + else if (ethcmd.speed == SPEED_10) { + if (ethcmd.duplex == DUPLEX_FULL) { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS_FULL_DUPLEX; + } + else { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS; + } + pDevice->DisableAutoNeg = TRUE; + } + else { + return -EINVAL; + } + flags = bcm5700_phy_lock(pUmDevice); + LM_SetupPhy(pDevice); + bcm5700_phy_unlock(pUmDevice, flags); + return 0; + } +#ifdef ETHTOOL_GWOL + case ETHTOOL_GWOL: { + struct ethtool_wolinfo wol = {ETHTOOL_GWOL}; + + if (pDevice->EnableTbi) { + wol.supported = 0; + wol.wolopts = 0; + } + else { + wol.supported = WAKE_MAGIC; + if (pDevice->WakeUpMode == LM_WAKE_UP_MODE_MAGIC_PACKET) + { + wol.wolopts = WAKE_MAGIC; + } + else { + wol.wolopts = 0; + } + } + if (copy_to_user(useraddr, &wol, sizeof(wol))) + return -EFAULT; + return 0; + } + case ETHTOOL_SWOL: { + struct ethtool_wolinfo wol; + + if(!capable(CAP_NET_ADMIN)) + return -EPERM; + if (copy_from_user(&wol, useraddr, sizeof(wol))) + return -EFAULT; + if (pDevice->EnableTbi && wol.wolopts) + return -EINVAL; + + if ((wol.wolopts & ~WAKE_MAGIC) != 0) { + return -EINVAL; + } + if (wol.wolopts & WAKE_MAGIC) { + pDevice->WakeUpModeCap = LM_WAKE_UP_MODE_MAGIC_PACKET; + pDevice->WakeUpMode = LM_WAKE_UP_MODE_MAGIC_PACKET; + } + else { + pDevice->WakeUpModeCap = LM_WAKE_UP_MODE_NONE; + pDevice->WakeUpMode = LM_WAKE_UP_MODE_NONE; + } + return 0; + } +#endif +#ifdef ETHTOOL_GLINK + case ETHTOOL_GLINK: { + struct ethtool_value edata = {ETHTOOL_GLINK}; + + if (pDevice->LinkStatus == LM_STATUS_LINK_ACTIVE) + edata.data = 1; + else + edata.data = 0; + if (copy_to_user(useraddr, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } +#endif +#ifdef ETHTOOL_NWAY_RST + case ETHTOOL_NWAY_RST: { + LM_UINT32 phyctrl; + long flags; + + if (pDevice->DisableAutoNeg) { + return -EINVAL; + } + flags = bcm5700_phy_lock(pUmDevice); + if (pDevice->EnableTbi) { + LM_SetupPhy(pDevice); + } + else { + LM_ReadPhy(pDevice, PHY_CTRL_REG, &phyctrl); + LM_WritePhy(pDevice, PHY_CTRL_REG, phyctrl | + PHY_CTRL_AUTO_NEG_ENABLE | + PHY_CTRL_RESTART_AUTO_NEG); + } + bcm5700_phy_unlock(pUmDevice, flags); + return 0; + } +#endif + } + + return -EOPNOTSUPP; +} +#endif + +/* Provide ioctl() calls to examine the MII xcvr state. */ +STATIC int bcm5700_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK)dev->priv; + PLM_DEVICE_BLOCK pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + u16 *data = (u16 *)&rq->ifr_data; + u32 value; + unsigned long flags; + + switch(cmd) { + case SIOCDEVPRIVATE: /* Get the address of the PHY in use. */ + data[0] = pDevice->PhyAddr; + case SIOCDEVPRIVATE+1: /* Read the specified MII register. */ + flags = bcm5700_phy_lock(pUmDevice); + LM_ReadPhy(pDevice, data[1] & 0x1f, (LM_UINT32 *) &value); + bcm5700_phy_unlock(pUmDevice, flags); + data[3] = value & 0xffff; + return 0; + case SIOCDEVPRIVATE+2: /* Write the specified MII register */ + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + flags = bcm5700_phy_lock(pUmDevice); + LM_WritePhy(pDevice, data[1] & 0x1f, data[2]); + bcm5700_phy_unlock(pUmDevice, flags); + return 0; +#ifdef NICE_SUPPORT + case SIOCNICE: + { + struct nice_req* nrq; + + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + + nrq = (struct nice_req*)&rq->ifr_ifru; + if( nrq->cmd == NICE_CMD_QUERY_SUPPORT ) { + nrq->nrq_magic = NICE_DEVICE_MAGIC; + nrq->nrq_support_rx = 1; + nrq->nrq_support_vlan = 1; + nrq->nrq_support_get_speed = 1; + return 0; + } + else if( nrq->cmd == NICE_CMD_SET_RX ) { + pUmDevice->nice_rx = nrq->nrq_rx; + pUmDevice->nice_ctx = nrq->nrq_ctx; + return 0; + } + else if( nrq->cmd == NICE_CMD_GET_RX ) { + nrq->nrq_rx = pUmDevice->nice_rx; + nrq->nrq_ctx = pUmDevice->nice_ctx; + return 0; + } + else if( nrq->cmd == NICE_CMD_GET_SPEED ) { + nrq->nrq_speed = pUmDevice->line_speed; + return 0; + } + else if( nrq->cmd == NICE_CMD_BLINK_LED ) { + return LM_BlinkLED(pDevice, nrq->nrq_blink_time); + } + break; + } +#endif /* NICE_SUPPORT */ +#ifdef SIOCETHTOOL + case SIOCETHTOOL: + return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); +#endif + default: + return -EOPNOTSUPP; + } + return -EOPNOTSUPP; +} + +STATIC void bcm5700_set_rx_mode(struct net_device *dev) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK)dev->priv; + PLM_DEVICE_BLOCK pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + int i; + struct dev_mc_list *mclist; + + LM_MulticastClear(pDevice); + for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; + i++, mclist = mclist->next) { + LM_MulticastAdd(pDevice, (PLM_UINT8) &mclist->dmi_addr); + } + if (dev->flags & IFF_ALLMULTI) { + if (!(pDevice->ReceiveMask & LM_ACCEPT_ALL_MULTICAST)) { + LM_SetReceiveMask(pDevice, + pDevice->ReceiveMask | LM_ACCEPT_ALL_MULTICAST); + } + } + else if (pDevice->ReceiveMask & LM_ACCEPT_ALL_MULTICAST) { + LM_SetReceiveMask(pDevice, + pDevice->ReceiveMask & ~LM_ACCEPT_ALL_MULTICAST); + } + if (dev->flags & IFF_PROMISC) { + if (!(pDevice->RxMode & RX_MODE_PROMISCUOUS_MODE)) { + LM_SetReceiveMask(pDevice, + pDevice->ReceiveMask | LM_PROMISCUOUS_MODE); + } + } + else if (pDevice->RxMode & RX_MODE_PROMISCUOUS_MODE) { + LM_SetReceiveMask(pDevice, + pDevice->ReceiveMask & ~LM_PROMISCUOUS_MODE); + } +} + +/* + * Set the hardware MAC address. + */ +STATIC int bcm5700_set_mac_addr(struct net_device *dev, void *p) +{ + struct sockaddr *addr=p; + PLM_DEVICE_BLOCK pDevice = (PLM_DEVICE_BLOCK) dev->priv; + + if (netif_running(dev)) + return -EBUSY; + memcpy(dev->dev_addr, addr->sa_data,dev->addr_len); + LM_SetMacAddress(pDevice, dev->dev_addr); + return 0; +} + + +#if (LINUX_VERSION_CODE < 0x020300) +#ifdef MODULE +int init_module(void) +{ + return bcm5700_probe(NULL); +} + +void cleanup_module(void) +{ + struct net_device *next_dev; + PUM_DEVICE_BLOCK pUmDevice; + + /* No need to check MOD_IN_USE, as sys_delete_module() checks. */ + while (root_tigon3_dev) { + pUmDevice = (PUM_DEVICE_BLOCK)root_tigon3_dev->priv; +#ifdef CONFIG_PROC_FS + bcm5700_proc_remove_dev(root_tigon3_dev); +#endif + next_dev = pUmDevice->next_module; + unregister_netdev(root_tigon3_dev); + if (pUmDevice->lm_dev.pMappedMemBase) + iounmap(pUmDevice->lm_dev.pMappedMemBase); + kfree(root_tigon3_dev); + root_tigon3_dev = next_dev; + } +} + +#endif /* MODULE */ +#else /* LINUX_VERSION_CODE < 0x020300 */ + +#if (LINUX_VERSION_CODE >= 0x020406) +static int bcm5700_suspend (struct pci_dev *pdev, u32 state) +#else +static void bcm5700_suspend (struct pci_dev *pdev) +#endif +{ + struct net_device *dev = (struct net_device *) pci_get_drvdata(pdev); + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) dev->priv; + PLM_DEVICE_BLOCK pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + + if (!netif_running(dev)) +#if (LINUX_VERSION_CODE >= 0x020406) + return 0; +#else + return; +#endif + + bcm5700_intr_off(pUmDevice); + netif_carrier_off(dev); + netif_device_detach (dev); + + /* Disable interrupts, stop Tx and Rx. */ + LM_Halt(pDevice); + pDevice->InitDone = 0; + LM_SetPowerState(pDevice, LM_POWER_STATE_D3); + +/* pci_power_off(pdev, -1);*/ +#if (LINUX_VERSION_CODE >= 0x020406) + return 0; +#endif +} + + +#if (LINUX_VERSION_CODE >= 0x020406) +static int bcm5700_resume(struct pci_dev *pdev) +#else +static void bcm5700_resume(struct pci_dev *pdev) +#endif +{ + struct net_device *dev = (struct net_device *) pci_get_drvdata(pdev); + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) dev->priv; + PLM_DEVICE_BLOCK pDevice = &pUmDevice->lm_dev; + + if (!netif_running(dev)) +#if (LINUX_VERSION_CODE >= 0x020406) + return 0; +#else + return; +#endif +/* pci_power_on(pdev);*/ + netif_device_attach(dev); + LM_InitializeAdapter(pDevice); + if (memcmp(dev->dev_addr, pDevice->NodeAddress, 6)) { + LM_SetMacAddress(pDevice, dev->dev_addr); + } + atomic_set(&pUmDevice->intr_sem, 0); + LM_EnableInterrupt(pDevice); +#if (LINUX_VERSION_CODE >= 0x020406) + return 0; +#endif +} + + +static struct pci_driver bcm5700_pci_driver = { + name: bcm5700_driver, + id_table: bcm5700_pci_tbl, + probe: bcm5700_init_one, + remove: bcm5700_remove_one, + suspend: bcm5700_suspend, + resume: bcm5700_resume, +}; + + +static int __init bcm5700_init_module (void) +{ + return pci_module_init(&bcm5700_pci_driver); +} + + +static void __exit bcm5700_cleanup_module (void) +{ + pci_unregister_driver(&bcm5700_pci_driver); +} + + +module_init(bcm5700_init_module); +module_exit(bcm5700_cleanup_module); +#endif + +/* + * Middle Module + * + */ + + +LM_STATUS +MM_ReadConfig16(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset, + LM_UINT16 *pValue16) +{ + UM_DEVICE_BLOCK *pUmDevice; + + pUmDevice = (UM_DEVICE_BLOCK *) pDevice; + pci_read_config_word(pUmDevice->pdev, Offset, (u16 *) pValue16); + return LM_STATUS_SUCCESS; +} + +LM_STATUS +MM_ReadConfig32(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset, + LM_UINT32 *pValue32) +{ + UM_DEVICE_BLOCK *pUmDevice; + + pUmDevice = (UM_DEVICE_BLOCK *) pDevice; + pci_read_config_dword(pUmDevice->pdev, Offset, (u32 *) pValue32); + return LM_STATUS_SUCCESS; +} + +LM_STATUS +MM_WriteConfig16(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset, + LM_UINT16 Value16) +{ + UM_DEVICE_BLOCK *pUmDevice; + + pUmDevice = (UM_DEVICE_BLOCK *) pDevice; + pci_write_config_word(pUmDevice->pdev, Offset, Value16); + return LM_STATUS_SUCCESS; +} + +LM_STATUS +MM_WriteConfig32(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset, + LM_UINT32 Value32) +{ + UM_DEVICE_BLOCK *pUmDevice; + + pUmDevice = (UM_DEVICE_BLOCK *) pDevice; + pci_write_config_dword(pUmDevice->pdev, Offset, Value32); + return LM_STATUS_SUCCESS; +} + +LM_STATUS +MM_AllocateSharedMemory(PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlockSize, + PLM_VOID *pMemoryBlockVirt, PLM_PHYSICAL_ADDRESS pMemoryBlockPhy, + LM_BOOL Cached) +{ + PLM_VOID pvirt; + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice; + dma_addr_t mapping; + + pvirt = pci_alloc_consistent(pUmDevice->pdev, BlockSize, + &mapping); + if (!pvirt) { + return LM_STATUS_FAILURE; + } + pUmDevice->mem_list[pUmDevice->mem_list_num] = pvirt; + pUmDevice->dma_list[pUmDevice->mem_list_num] = mapping; + pUmDevice->mem_size_list[pUmDevice->mem_list_num++] = BlockSize; + memset(pvirt, 0, BlockSize); + *pMemoryBlockVirt = (PLM_VOID) pvirt; + bcm_set_addr(pMemoryBlockPhy, mapping); + return LM_STATUS_SUCCESS; +} + +LM_STATUS +MM_AllocateMemory(PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlockSize, + PLM_VOID *pMemoryBlockVirt) +{ + PLM_VOID pvirt; + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice; + + + /* Maximum in slab.c */ + if (BlockSize > 131072) { + goto MM_Alloc_error; + } + + pvirt = kmalloc(BlockSize, GFP_KERNEL); + if (!pvirt) { + goto MM_Alloc_error; + } + pUmDevice->mem_list[pUmDevice->mem_list_num] = pvirt; + pUmDevice->dma_list[pUmDevice->mem_list_num] = 0; + pUmDevice->mem_size_list[pUmDevice->mem_list_num++] = 0; + /* mem_size_list[i] == 0 indicates that the memory should be freed */ + /* using kfree */ + memset(pvirt, 0, BlockSize); + *pMemoryBlockVirt = pvirt; + return LM_STATUS_SUCCESS; + +MM_Alloc_error: + printk(KERN_WARNING "%s: Memory allocation failed - buffer parameters may be set too high\n", pUmDevice->dev->name); + return LM_STATUS_FAILURE; +} + +LM_STATUS +MM_MapMemBase(PLM_DEVICE_BLOCK pDevice) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice; + + pDevice->pMappedMemBase = ioremap_nocache( + pci_resource_start(pUmDevice->pdev, 0), pDevice->MemBaseSize); + return LM_STATUS_SUCCESS; +} + +LM_STATUS +MM_InitializeUmPackets(PLM_DEVICE_BLOCK pDevice) +{ + int i; + struct sk_buff *skb; + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice; + PUM_PACKET pUmPacket; + PLM_PACKET pPacket; + dma_addr_t map; + + for (i = 0; i < pDevice->RxPacketDescCnt; i++) { + pPacket = QQ_PopHead(&pDevice->RxPacketFreeQ.Container); + pUmPacket = (PUM_PACKET) pPacket; + if (pPacket == 0) { + printk(KERN_DEBUG "Bad RxPacketFreeQ\n"); + } + skb = dev_alloc_skb(pPacket->u.Rx.RxBufferSize + 2); + if (skb == 0) { + pUmPacket->skbuff = 0; + QQ_PushTail(&pUmDevice->rx_out_of_buf_q.Container, pPacket); + continue; + } + pUmPacket->skbuff = skb; + skb->dev = pUmDevice->dev; + skb_reserve(skb, pUmDevice->rx_buf_align); + map = pci_map_single(pUmDevice->pdev, skb->tail, + pPacket->u.Rx.RxBufferSize, PCI_DMA_FROMDEVICE); + pci_unmap_addr_set(pUmPacket, map[0], map); + bcm_set_addr(&pPacket->u.Rx.RxBufferPhy, map); + QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket); + } + if (T3_ASIC_REV(pUmDevice->lm_dev.ChipRevId) == T3_ASIC_REV_5700) { + /* reallocate buffers in the ISR */ + pUmDevice->rx_buf_repl_thresh = 0; + pUmDevice->rx_buf_repl_panic_thresh = 0; + } + else { + pUmDevice->rx_buf_repl_thresh = pDevice->RxPacketDescCnt / 8; + pUmDevice->rx_buf_repl_panic_thresh = + pDevice->RxPacketDescCnt / 2; + + if (pDevice->RxJumboDescCnt != 0) { + if (pUmDevice->rx_buf_repl_thresh >= + pDevice->RxJumboDescCnt) { + + pUmDevice->rx_buf_repl_thresh = + pUmDevice->rx_buf_repl_panic_thresh = + pDevice->RxJumboDescCnt - 1; + } + if (pUmDevice->rx_buf_repl_thresh >= + pDevice->RxStdDescCnt) { + + pUmDevice->rx_buf_repl_thresh = + pUmDevice->rx_buf_repl_panic_thresh = + pDevice->RxStdDescCnt - 1; + } + } + } + return LM_STATUS_SUCCESS; +} + +LM_STATUS +MM_GetConfig(PLM_DEVICE_BLOCK pDevice) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice; + int index = pUmDevice->index; + + if (auto_speed[index] == 0) + pDevice->DisableAutoNeg = TRUE; + else + pDevice->DisableAutoNeg = FALSE; + + if (line_speed[index] == 0) { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_AUTO; + pDevice->DisableAutoNeg = FALSE; + } + else { + if (line_speed[index] == 1000) { + if (pDevice->EnableTbi) { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_FIBER_1000MBPS_FULL_DUPLEX; + } + else if (full_duplex[index]) { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_UTP_1000MBPS_FULL_DUPLEX; + } + else { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_UTP_1000MBPS; + } + if (!pDevice->EnableTbi) + pDevice->DisableAutoNeg = FALSE; + } + else if (line_speed[index] == 100) { + if (full_duplex[index]) { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_UTP_100MBPS_FULL_DUPLEX; + } + else { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_UTP_100MBPS; + } + } + else if (line_speed[index] == 10) { + if (full_duplex[index]) { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS_FULL_DUPLEX; + } + else { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS; + } + } + else { + pDevice->RequestedMediaType = + LM_REQUESTED_MEDIA_TYPE_AUTO; + pDevice->DisableAutoNeg = FALSE; + printk(KERN_WARNING "%s: Invalid line_speed parameter (%d), using 0\n", pUmDevice->dev->name, line_speed[index]); + } + + } + pDevice->FlowControlCap = 0; + if (rx_flow_control[index] != 0) { + pDevice->FlowControlCap |= LM_FLOW_CONTROL_RECEIVE_PAUSE; + } + if (tx_flow_control[index] != 0) { + pDevice->FlowControlCap |= LM_FLOW_CONTROL_TRANSMIT_PAUSE; + } + if (auto_flow_control[index] != 0) { + if (pDevice->DisableAutoNeg == FALSE) { + + pDevice->FlowControlCap |= LM_FLOW_CONTROL_AUTO_PAUSE; + if ((tx_flow_control[index] == 0) && + (rx_flow_control[index] == 0)) { + + pDevice->FlowControlCap |= + LM_FLOW_CONTROL_TRANSMIT_PAUSE | + LM_FLOW_CONTROL_RECEIVE_PAUSE; + } + } + else { + printk(KERN_WARNING "%s: Conflicting auto_flow_control parameter (%d), using 0\n", + pUmDevice->dev->name, auto_flow_control[index]); + } + + } + + if (pUmDevice->dev->mtu > 1500) { + pDevice->RxMtu = pUmDevice->dev->mtu + 14; + } + + if (T3_ASIC_REV(pDevice->ChipRevId) != T3_ASIC_REV_5700) { + pDevice->UseTaggedStatus = TRUE; + pUmDevice->timer_interval = HZ; + } + else { + pUmDevice->timer_interval = HZ/10; + } + + if ((tx_pkt_desc_cnt[index] == 0) || + (tx_pkt_desc_cnt[index] > MAX_TX_PACKET_DESC_COUNT)) { + + printk(KERN_WARNING "%s: Invalid tx_pkt_desc_cnt parameter (%d), using %d\n", + pUmDevice->dev->name, tx_pkt_desc_cnt[index], + DEFAULT_TX_PACKET_DESC_COUNT); + + tx_pkt_desc_cnt[index] = DEFAULT_TX_PACKET_DESC_COUNT; + } + pDevice->TxPacketDescCnt = tx_pkt_desc_cnt[index]; + if ((rx_std_desc_cnt[index] == 0) || + (rx_std_desc_cnt[index] >= T3_STD_RCV_RCB_ENTRY_COUNT)) { + + printk(KERN_WARNING "%s: Invalid rx_std_desc_cnt parameter (%d), using %d\n", + pUmDevice->dev->name, rx_std_desc_cnt[index], + DEFAULT_RX_PACKET_DESC_COUNT); + + rx_std_desc_cnt[index] = DEFAULT_RX_PACKET_DESC_COUNT; + } + pDevice->RxStdDescCnt = rx_std_desc_cnt[index]; + + if (mtu[index] <= 1514) { + rx_jumbo_desc_cnt[index] = 0; + } + else if ((rx_jumbo_desc_cnt[index] == 0) || + (rx_jumbo_desc_cnt[index] >= T3_JUMBO_RCV_RCB_ENTRY_COUNT)) { + + printk(KERN_WARNING "%s: Invalid rx_jumbo_desc_cnt parameter (%d), using %d\n", + pUmDevice->dev->name, rx_jumbo_desc_cnt[index], + DEFAULT_JUMBO_RCV_DESC_COUNT); + + rx_jumbo_desc_cnt[index] = DEFAULT_JUMBO_RCV_DESC_COUNT; + } + pDevice->RxJumboDescCnt = rx_jumbo_desc_cnt[index]; + +#if INCLUDE_EXT_MEMORY_SUPPORT + if ((rx_mini_desc_cnt[index] == 0) || + (rx_mini_desc_cnt[index] >= T3_MINI_RCV_RCB_ENTRY_COUNT)) { + + printk(KERN_WARNING "%s: Invalid rx_mini_desc_cnt parameter (%d), using %d\n", + pUmDevice->dev->name, rx_mini_desc_cnt[index], + DEFAULT_MINI_RCV_DESC_COUNT); + + rx_mini_desc_cnt[index] = DEFAULT_MINI_RCV_DESC_COUNT; + } + pDevice->RxMiniDescCnt = rx_mini_desc_cnt[index]; +#endif + + pUmDevice->adaptive_coalesce = adaptive_coalesce[index]; + if (!pUmDevice->adaptive_coalesce) { + if (rx_coalesce_ticks[index] > MAX_RX_COALESCING_TICKS) { + + printk(KERN_WARNING "%s: Invalid rx_coalesce_ticks parameter (%d), using %d\n", + pUmDevice->dev->name, + rx_coalesce_ticks[index], + MAX_RX_COALESCING_TICKS); + + rx_coalesce_ticks[index] = MAX_RX_COALESCING_TICKS; + } + else if ((rx_coalesce_ticks[index] == 0) && + (rx_max_coalesce_frames[index] == 0)) { + + printk(KERN_WARNING "%s: Conflicting rx_coalesce_ticks (0) and rx_max_coalesce_frames (0) parameters, using %d and %d respectively\n", + pUmDevice->dev->name, + DEFAULT_RX_COALESCING_TICKS, + DEFAULT_RX_MAX_COALESCED_FRAMES); + + rx_coalesce_ticks[index] = DEFAULT_RX_COALESCING_TICKS; + rx_max_coalesce_frames[index] = + DEFAULT_RX_MAX_COALESCED_FRAMES; + } + pDevice->RxCoalescingTicks = rx_coalesce_ticks[index]; + pUmDevice->rx_curr_coalesce_ticks = pDevice->RxCoalescingTicks; + + if (rx_max_coalesce_frames[index] > MAX_RX_MAX_COALESCED_FRAMES) + { + printk(KERN_WARNING "%s: Invalid rx_max_coalesce_frames parameter (%d), using %d\n", + pUmDevice->dev->name, + rx_max_coalesce_frames[index], + MAX_RX_MAX_COALESCED_FRAMES); + + rx_max_coalesce_frames[index] = + MAX_RX_MAX_COALESCED_FRAMES; + } + pDevice->RxMaxCoalescedFrames = rx_max_coalesce_frames[index]; + pUmDevice->rx_curr_coalesce_frames = + pDevice->RxMaxCoalescedFrames; + + if (tx_coalesce_ticks[index] > MAX_TX_COALESCING_TICKS) { + printk(KERN_WARNING "%s: Invalid tx_coalesce_ticks parameter (%d), using %d\n", + pUmDevice->dev->name, + tx_coalesce_ticks[index], + MAX_TX_COALESCING_TICKS); + + tx_coalesce_ticks[index] = MAX_TX_COALESCING_TICKS; + } + else if ((tx_coalesce_ticks[index] == 0) && + (tx_max_coalesce_frames[index] == 0)) { + + printk(KERN_WARNING "%s: Conflicting tx_coalesce_ticks (0) and tx_max_coalesce_frames (0) parameters, using %d and %d respectively\n", + pUmDevice->dev->name, + DEFAULT_TX_COALESCING_TICKS, + DEFAULT_TX_MAX_COALESCED_FRAMES); + + tx_coalesce_ticks[index] = DEFAULT_TX_COALESCING_TICKS; + tx_max_coalesce_frames[index] = + DEFAULT_TX_MAX_COALESCED_FRAMES; + } + pDevice->TxCoalescingTicks = tx_coalesce_ticks[index]; + if (tx_max_coalesce_frames[index] > MAX_TX_MAX_COALESCED_FRAMES) { + printk(KERN_WARNING "%s: Invalid tx_max_coalesce_frames parameter (%d), using %d\n", + pUmDevice->dev->name, + tx_max_coalesce_frames[index], + MAX_TX_MAX_COALESCED_FRAMES); + + tx_max_coalesce_frames[index] = MAX_TX_MAX_COALESCED_FRAMES; + } + pDevice->TxMaxCoalescedFrames = tx_max_coalesce_frames[index]; + pUmDevice->tx_curr_coalesce_frames = + pDevice->TxMaxCoalescedFrames; + + if (stats_coalesce_ticks[index] > MAX_STATS_COALESCING_TICKS) { + printk(KERN_WARNING "%s: Invalid stats_coalesce_ticks parameter (%d), using %d\n", + pUmDevice->dev->name, + stats_coalesce_ticks[index], + MAX_STATS_COALESCING_TICKS); + + stats_coalesce_ticks[index] = + MAX_STATS_COALESCING_TICKS; + } + pDevice->StatsCoalescingTicks = stats_coalesce_ticks[index]; + } + else { + pUmDevice->rx_curr_coalesce_frames = + DEFAULT_RX_MAX_COALESCED_FRAMES; + pUmDevice->rx_curr_coalesce_ticks = + DEFAULT_RX_COALESCING_TICKS; + pUmDevice->tx_curr_coalesce_frames = + DEFAULT_TX_MAX_COALESCED_FRAMES; + } + + if (enable_wol[index]) { + pDevice->WakeUpModeCap = LM_WAKE_UP_MODE_MAGIC_PACKET; + pDevice->WakeUpMode = LM_WAKE_UP_MODE_MAGIC_PACKET; + } + if (pDevice->EnablePciXFix) + pDevice->NicSendBd = FALSE; + else + pDevice->NicSendBd = TRUE; +#ifdef BCM_VLAN + pDevice->NicSendBd = FALSE; +#endif +#if INCLUDE_TBI_SUPPORT + pDevice->PollTbiLink = TRUE; +#endif +#if INCLUDE_EXT_MEMORY_SUPPORT + pDevice->EnableExtMemory = TRUE; +#endif + return LM_STATUS_SUCCESS; +} + +LM_STATUS +MM_StartTxDma(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket) +{ + return LM_STATUS_SUCCESS; +} + +LM_STATUS +MM_CompleteTxDma(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket) +{ + return LM_STATUS_SUCCESS; +} + +LM_STATUS +MM_IndicateRxPackets(PLM_DEVICE_BLOCK pDevice) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice; + PLM_PACKET pPacket; + PUM_PACKET pUmPacket; + struct sk_buff *skb; + int size; + + while (1) { + pPacket = (PLM_PACKET) + QQ_PopHead(&pDevice->RxPacketReceivedQ.Container); + if (pPacket == 0) + break; + pUmPacket = (PUM_PACKET) pPacket; +#if ! defined(NO_PCI_UNMAP) + pci_unmap_single(pUmDevice->pdev, + pci_unmap_addr(pUmPacket, map[0]), + pPacket->u.Rx.RxBufferSize, + PCI_DMA_FROMDEVICE); +#endif + if ((pPacket->PacketStatus != LM_STATUS_SUCCESS) || + ((size = pPacket->PacketSize) > pDevice->RxMtu)) { + + /* reuse skb */ +#ifdef TASKLET + QQ_PushTail(&pUmDevice->rx_out_of_buf_q.Container, pPacket); +#else + QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket); +#endif + pUmDevice->rx_misc_errors++; + continue; + } + skb = pUmPacket->skbuff; + skb_put(skb, size); + skb->pkt_type = 0; + skb->protocol = eth_type_trans(skb, skb->dev); + if ((pPacket->Flags & RCV_BD_FLAG_TCP_UDP_CHKSUM_FIELD) && + (pDevice->TaskToOffload & + LM_TASK_OFFLOAD_RX_TCP_CHECKSUM)) { + if (pPacket->u.Rx.TcpUdpChecksum == 0xffff) { + + skb->ip_summed = CHECKSUM_UNNECESSARY; +#if TIGON3_DEBUG + pUmDevice->rx_good_chksum_count++; +#endif + } + else { + skb->ip_summed = CHECKSUM_NONE; + pUmDevice->rx_bad_chksum_count++; + } + } + else { + skb->ip_summed = CHECKSUM_NONE; + } +#ifdef NICE_SUPPORT + if( pUmDevice->nice_rx ) { + vlan_tag_t *vlan_tag; + + vlan_tag = (vlan_tag_t *) &skb->cb[0]; + if (pPacket->Flags & RCV_BD_FLAG_VLAN_TAG) { + vlan_tag->signature = 0x7777; + vlan_tag->tag = pPacket->VlanTag; + } + else { + vlan_tag->signature = 0; + } + pUmDevice->nice_rx(skb, pUmDevice->nice_ctx); + } + else +#endif + { +#ifdef BCM_VLAN + if (pUmDevice->vlgrp && + (pPacket->Flags & RCV_BD_FLAG_VLAN_TAG)) { + + vlan_hwaccel_rx(skb, pUmDevice->vlgrp, + pPacket->VlanTag); + } + else +#endif + { + netif_rx(skb); + } + } + + +#ifdef TASKLET + pUmPacket->skbuff = 0; + QQ_PushTail(&pUmDevice->rx_out_of_buf_q.Container, pPacket); +#else + skb = dev_alloc_skb(pPacket->u.Rx.RxBufferSize + 2); + if (skb == 0) { + pUmPacket->skbuff = 0; + QQ_PushTail(&pUmDevice->rx_out_of_buf_q.Container, pPacket); + } + else { + pUmPacket->skbuff = skb; + skb->dev = pUmDevice->dev; + skb_reserve(skb, pUmDevice->rx_buf_align); + map = pci_map_single(pUmDevice->pdev, skb->tail, + pPacket->u.Rx.RxBufferSize, PCI_DMA_FROMDEVICE); + pci_unmap_addr_set(pUmPacket, map[0], map); + bcm_set_addr(&pPacket->u.Rx.RxBufferPhy, map); + QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket); + } +#endif + } + return LM_STATUS_SUCCESS; +} + +/* Returns 1 if not all buffers are allocated */ +STATIC int +replenish_rx_buffers(PUM_DEVICE_BLOCK pUmDevice) +{ + PLM_PACKET pPacket; + PUM_PACKET pUmPacket; + PLM_DEVICE_BLOCK pDevice = (PLM_DEVICE_BLOCK) pUmDevice; + struct sk_buff *skb; + int queue_rx = 0; + int ret = 0; + dma_addr_t map; + + while ((pUmPacket = (PUM_PACKET) + QQ_PopHead(&pUmDevice->rx_out_of_buf_q.Container)) != 0) { + pPacket = (PLM_PACKET) pUmPacket; + if (pUmPacket->skbuff) { + /* reuse an old skb */ + QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket); + queue_rx = 1; + continue; + } + if ((skb = dev_alloc_skb(pPacket->u.Rx.RxBufferSize + 2)) == 0) { + QQ_PushHead(&pUmDevice->rx_out_of_buf_q.Container, + pPacket); + ret = 1; + break; + } + pUmPacket->skbuff = skb; + skb->dev = pUmDevice->dev; + skb_reserve(skb, pUmDevice->rx_buf_align); + map = pci_map_single(pUmDevice->pdev, skb->tail, + pPacket->u.Rx.RxBufferSize, PCI_DMA_FROMDEVICE); + pci_unmap_addr_set(pUmPacket, map[0], map); + bcm_set_addr(&pPacket->u.Rx.RxBufferPhy, map); + QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket); + queue_rx = 1; + } + if (queue_rx) { + LM_QueueRxPackets(pDevice); + } + return ret; +} + +LM_STATUS +MM_IndicateTxPackets(PLM_DEVICE_BLOCK pDevice) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice; + PLM_PACKET pPacket; + PUM_PACKET pUmPacket; + struct sk_buff *skb; +#if ! defined(NO_PCI_UNMAP) && MAX_SKB_FRAGS + int i; +#endif + + while (1) { + pPacket = (PLM_PACKET) + QQ_PopHead(&pDevice->TxPacketXmittedQ.Container); + if (pPacket == 0) + break; + pUmPacket = (PUM_PACKET) pPacket; + skb = pUmPacket->skbuff; +#if ! defined(NO_PCI_UNMAP) + pci_unmap_single(pUmDevice->pdev, + pci_unmap_addr(pUmPacket, map[0]), + pci_unmap_len(pUmPacket, map_len[0]), + PCI_DMA_TODEVICE); +#if MAX_SKB_FRAGS + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { + pci_unmap_page(pUmDevice->pdev, + pci_unmap_addr(pUmPacket, map[i + 1]), + pci_unmap_len(pUmPacket, map_len[i + 1]), + PCI_DMA_TODEVICE); + } +#endif +#endif + dev_kfree_skb_irq(skb); + pUmPacket->skbuff = 0; + QQ_PushTail(&pDevice->TxPacketFreeQ.Container, pPacket); + } + if (pUmDevice->tx_full) { + if (QQ_GetEntryCnt(&pDevice->TxPacketFreeQ.Container) >= + (pDevice->TxPacketDescCnt >> 1)) { + + pUmDevice->tx_full = 0; + netif_wake_queue(pUmDevice->dev); + } + } + return LM_STATUS_SUCCESS; +} + +LM_STATUS +MM_IndicateStatus(PLM_DEVICE_BLOCK pDevice, LM_STATUS Status) +{ + PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice; + struct net_device *dev = pUmDevice->dev; + LM_FLOW_CONTROL flow_control; + + if (!pUmDevice->opened) + return LM_STATUS_SUCCESS; + + if (pUmDevice->delayed_link_ind > 0) { + pUmDevice->delayed_link_ind = 0; + if (Status == LM_STATUS_LINK_DOWN) { + pUmDevice->line_speed = 0; + netif_carrier_off(dev); + printk(KERN_ERR "%s: %s NIC Link is DOWN\n", bcm5700_driver, dev->name); + } + else if (Status == LM_STATUS_LINK_ACTIVE) { + netif_carrier_on(dev); + printk(KERN_INFO "%s: %s NIC Link is UP, ", bcm5700_driver, dev->name); + } + } + else { + if (Status == LM_STATUS_LINK_DOWN) { + pUmDevice->line_speed = 0; + netif_carrier_off(dev); + printk(KERN_ERR "%s: %s NIC Link is Down\n", bcm5700_driver, dev->name); + } + else if (Status == LM_STATUS_LINK_ACTIVE) { + netif_carrier_on(dev); + printk(KERN_INFO "%s: %s NIC Link is Up, ", bcm5700_driver, dev->name); + } + } + + if (Status == LM_STATUS_LINK_ACTIVE) { + if (pDevice->LineSpeed == LM_LINE_SPEED_1000MBPS) + pUmDevice->line_speed = 1000; + else if (pDevice->LineSpeed == LM_LINE_SPEED_100MBPS) + pUmDevice->line_speed = 100; + else if (pDevice->LineSpeed == LM_LINE_SPEED_10MBPS) + pUmDevice->line_speed = 10; + + printk("%d Mbps ", pUmDevice->line_speed); + + if (pDevice->DuplexMode == LM_DUPLEX_MODE_FULL) + printk("full duplex"); + else + printk("half duplex"); + + flow_control = pDevice->FlowControl & + (LM_FLOW_CONTROL_RECEIVE_PAUSE | + LM_FLOW_CONTROL_TRANSMIT_PAUSE); + if (flow_control) { + if (flow_control & LM_FLOW_CONTROL_RECEIVE_PAUSE) { + printk(", receive "); + if (flow_control & LM_FLOW_CONTROL_TRANSMIT_PAUSE) + printk("& transmit "); + } + else { + printk(", transmit "); + } + printk("flow control ON"); + } + printk("\n"); + } + return LM_STATUS_SUCCESS; +} + +LM_STATUS +MM_FreeRxBuffer(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket) +{ + PUM_PACKET pUmPacket; + struct sk_buff *skb; + + if (pPacket == 0) + return LM_STATUS_SUCCESS; + pUmPacket = (PUM_PACKET) pPacket; + if ((skb = pUmPacket->skbuff)) + dev_kfree_skb(skb); + pUmPacket->skbuff = 0; + return LM_STATUS_SUCCESS; +} + + diff -urN linux-2.4.18/drivers/net/bcm/bits.h lia64-2.4/drivers/net/bcm/bits.h --- linux-2.4.18/drivers/net/bcm/bits.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/bits.h Wed Feb 27 14:16:55 2002 @@ -0,0 +1,62 @@ + +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/* History: */ +/* 02/25/00 Hav Khauv Initial version. */ +/******************************************************************************/ + +#ifndef BITS_H +#define BITS_H + + + +/******************************************************************************/ +/* Bit Mask definitions */ +/******************************************************************************/ + +#define BIT_NONE 0x00 +#define BIT_0 0x01 +#define BIT_1 0x02 +#define BIT_2 0x04 +#define BIT_3 0x08 +#define BIT_4 0x10 +#define BIT_5 0x20 +#define BIT_6 0x40 +#define BIT_7 0x80 +#define BIT_8 0x0100 +#define BIT_9 0x0200 +#define BIT_10 0x0400 +#define BIT_11 0x0800 +#define BIT_12 0x1000 +#define BIT_13 0x2000 +#define BIT_14 0x4000 +#define BIT_15 0x8000 +#define BIT_16 0x010000 +#define BIT_17 0x020000 +#define BIT_18 0x040000 +#define BIT_19 0x080000 +#define BIT_20 0x100000 +#define BIT_21 0x200000 +#define BIT_22 0x400000 +#define BIT_23 0x800000 +#define BIT_24 0x01000000 +#define BIT_25 0x02000000 +#define BIT_26 0x04000000 +#define BIT_27 0x08000000 +#define BIT_28 0x10000000 +#define BIT_29 0x20000000 +#define BIT_30 0x40000000 +#define BIT_31 0x80000000 + + + +#endif /* BITS_H */ + diff -urN linux-2.4.18/drivers/net/bcm/debug.h lia64-2.4/drivers/net/bcm/debug.h --- linux-2.4.18/drivers/net/bcm/debug.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/debug.h Wed Feb 27 14:16:55 2002 @@ -0,0 +1,108 @@ + +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/* History: */ +/* 02/25/00 Hav Khauv Initial version. */ +/******************************************************************************/ + +#ifndef DEBUG_H +#define DEBUG_H + + + +/******************************************************************************/ +/* Debug macros */ +/******************************************************************************/ + +/* Code path for controlling output debug messages. */ +/* Define your code path here. */ +#define CP_INIT 0x010000 +#define CP_SEND 0x020000 +#define CP_RCV 0x040000 +#define CP_INT 0x080000 +#define CP_UINIT 0x100000 +#define CP_RESET 0x200000 + +#define CP_ALL (CP_INIT | CP_SEND | CP_RCV | CP_INT | \ + CP_RESET | CP_UINIT) + +#define CP_MASK 0xffff0000 + + +/* Debug message levels. */ +#define LV_VERBOSE 0x03 +#define LV_INFORM 0x02 +#define LV_WARN 0x01 +#define LV_FATAL 0x00 + +#define LV_MASK 0xffff + + +/* Code path and messsage level combined. These are the first argument of */ +/* the DbgMessage macro. */ +#define INIT_V (CP_INIT | LV_VERBOSE) +#define INIT_I (CP_INIT | LV_INFORM) +#define INIT_W (CP_INIT | LV_WARN) +#define SEND_V (CP_SEND | LV_VERBOSE) +#define SEND_I (CP_SEND | LV_INFORM) +#define SEND_W (CP_SEND | LV_WARN) +#define RCV_V (CP_RCV | LV_VERBOSE) +#define RCV_I (CP_RCV | LV_INFORM) +#define RCV_W (CP_RCV | LV_WARN) +#define INT_V (CP_INT | LV_VERBOSE) +#define INT_I (CP_INT | LV_INFORM) +#define INT_W (CP_INT | LV_WARN) +#define UINIT_V (CP_UINIT | LV_VERBOSE) +#define UINIT_I (CP_UINIT | LV_INFORM) +#define UINIT_W (CP_UINIT | LV_WARN) +#define RESET_V (CP_RESET | LV_VERBOSE) +#define RESET_I (CP_RESET | LV_INFORM) +#define RESET_W (CP_RESET | LV_WARN) +#define CPALL_V (CP_ALL | LV_VERBOSE) +#define CPALL_I (CP_ALL | LV_INFORM) +#define CPALL_W (CP_ALL | LV_WARN) + + +/* All code path message levels. */ +#define FATAL (CP_ALL | LV_FATAL) +#define WARN (CP_ALL | LV_WARN) +#define INFORM (CP_ALL | LV_INFORM) +#define VERBOSE (CP_ALL | LV_VERBOSE) + + +/* These constants control the message output. */ +/* Set your debug message output level and code path here. */ +#ifndef DBG_MSG_CP +#define DBG_MSG_CP CP_ALL /* Where to output messages. */ +#endif + +#ifndef DBG_MSG_LV +#define DBG_MSG_LV LV_VERBOSE /* Level of message output. */ +#endif + + +/* DbgMessage macro. */ +#if DBG +#define DbgMessage(CNTRL, MESSAGE) \ + if((CNTRL & DBG_MSG_CP) && ((CNTRL & LV_MASK) <= DBG_MSG_LV)) \ + DbgPrint MESSAGE +#define DbgBreak() DbgBreakPoint() +#define STATIC +#else +#define DbgMessage(CNTRL, MESSAGE) +#define DbgBreak() +#define STATIC static +#endif /* DBG */ + + + +#endif /* DEBUG_H */ + diff -urN linux-2.4.18/drivers/net/bcm/lm.h lia64-2.4/drivers/net/bcm/lm.h --- linux-2.4.18/drivers/net/bcm/lm.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/lm.h Fri Jul 19 17:24:26 2002 @@ -0,0 +1,478 @@ + +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/* History: */ +/* 02/25/00 Hav Khauv Initial version. */ +/******************************************************************************/ + +#ifndef LM_H +#define LM_H + +#include "debug.h" +#include "queue.h" +#include "bits.h" +#include "lmcfg.h" + + + +/******************************************************************************/ +/* Basic types. */ +/******************************************************************************/ + +typedef char LM_CHAR, *PLM_CHAR; +typedef unsigned int LM_UINT, *PLM_UINT; +typedef unsigned char LM_UINT8, *PLM_UINT8; +typedef unsigned short LM_UINT16, *PLM_UINT16; +typedef unsigned int LM_UINT32, *PLM_UINT32; +typedef unsigned int LM_COUNTER, *PLM_COUNTER; +typedef void LM_VOID, *PLM_VOID; +typedef char LM_BOOL, *PLM_BOOL; + +/* 64bit value. */ +typedef struct { +#ifdef BIG_ENDIAN_HOST + LM_UINT32 High; + LM_UINT32 Low; +#else /* BIG_ENDIAN_HOST */ + LM_UINT32 Low; + LM_UINT32 High; +#endif /* !BIG_ENDIAN_HOST */ +} LM_UINT64, *PLM_UINT64; + +typedef LM_UINT64 LM_PHYSICAL_ADDRESS, *PLM_PHYSICAL_ADDRESS; + +/* void LM_INC_PHYSICAL_ADDRESS(PLM_PHYSICAL_ADDRESS pAddr,LM_UINT32 IncSize) */ +#define LM_INC_PHYSICAL_ADDRESS(pAddr, IncSize) \ + { \ + LM_UINT32 OrgLow; \ + \ + OrgLow = (pAddr)->Low; \ + (pAddr)->Low += IncSize; \ + if((pAddr)->Low < OrgLow) { \ + (pAddr)->High++; /* Wrap around. */ \ + } \ + } + + +#ifndef TRUE +#define TRUE 1 +#endif /* TRUE */ + +#ifndef FALSE +#define FALSE 0 +#endif /* FALSE */ + +#ifndef NULL +#define NULL ((void *) 0) +#endif /* NULL */ + +#ifndef OFFSETOF +#define OFFSETOF(_s, _m) (MM_UINT_PTR(&(((_s *) 0)->_m))) +#endif /* OFFSETOF */ + + + +/******************************************************************************/ +/* Simple macros. */ +/******************************************************************************/ + +#define IS_ETH_BROADCAST(_pEthAddr) \ + (((unsigned char *) (_pEthAddr))[0] == ((unsigned char) 0xff)) + +#define IS_ETH_MULTICAST(_pEthAddr) \ + (((unsigned char *) (_pEthAddr))[0] & ((unsigned char) 0x01)) + +#define IS_ETH_ADDRESS_EQUAL(_pEtherAddr1, _pEtherAddr2) \ + ((((unsigned char *) (_pEtherAddr1))[0] == \ + ((unsigned char *) (_pEtherAddr2))[0]) && \ + (((unsigned char *) (_pEtherAddr1))[1] == \ + ((unsigned char *) (_pEtherAddr2))[1]) && \ + (((unsigned char *) (_pEtherAddr1))[2] == \ + ((unsigned char *) (_pEtherAddr2))[2]) && \ + (((unsigned char *) (_pEtherAddr1))[3] == \ + ((unsigned char *) (_pEtherAddr2))[3]) && \ + (((unsigned char *) (_pEtherAddr1))[4] == \ + ((unsigned char *) (_pEtherAddr2))[4]) && \ + (((unsigned char *) (_pEtherAddr1))[5] == \ + ((unsigned char *) (_pEtherAddr2))[5])) + +#define COPY_ETH_ADDRESS(_Src, _Dst) \ + ((unsigned char *) (_Dst))[0] = ((unsigned char *) (_Src))[0]; \ + ((unsigned char *) (_Dst))[1] = ((unsigned char *) (_Src))[1]; \ + ((unsigned char *) (_Dst))[2] = ((unsigned char *) (_Src))[2]; \ + ((unsigned char *) (_Dst))[3] = ((unsigned char *) (_Src))[3]; \ + ((unsigned char *) (_Dst))[4] = ((unsigned char *) (_Src))[4]; \ + ((unsigned char *) (_Dst))[5] = ((unsigned char *) (_Src))[5]; + + + +/******************************************************************************/ +/* Constants. */ +/******************************************************************************/ + +#define ETHERNET_ADDRESS_SIZE 6 +#define ETHERNET_PACKET_HEADER_SIZE 14 +#define MIN_ETHERNET_PACKET_SIZE 64 /* with 4 byte crc. */ +#define MAX_ETHERNET_PACKET_SIZE 1518 /* with 4 byte crc. */ +#define MIN_ETHERNET_PACKET_SIZE_NO_CRC 60 +#define MAX_ETHERNET_PACKET_SIZE_NO_CRC 1514 +#define MAX_ETHERNET_PACKET_BUFFER_SIZE 1536 /* A nice even number. */ + +#ifndef LM_MAX_MC_TABLE_SIZE +#define LM_MAX_MC_TABLE_SIZE 32 +#endif /* LM_MAX_MC_TABLE_SIZE */ +#define LM_MC_ENTRY_SIZE (ETHERNET_ADDRESS_SIZE+1) +#define LM_MC_INSTANCE_COUNT_INDEX (LM_MC_ENTRY_SIZE-1) + + +/* Receive filter masks. */ +#define LM_ACCEPT_UNICAST 0x0001 +#define LM_ACCEPT_MULTICAST 0x0002 +#define LM_ACCEPT_ALL_MULTICAST 0x0004 +#define LM_ACCEPT_BROADCAST 0x0008 +#define LM_ACCEPT_ERROR_PACKET 0x0010 + +#define LM_PROMISCUOUS_MODE 0x10000 + + + +/******************************************************************************/ +/* PCI registers. */ +/******************************************************************************/ + +#define PCI_VENDOR_ID_REG 0x00 +#define PCI_DEVICE_ID_REG 0x02 + +#define PCI_COMMAND_REG 0x04 +#define PCI_IO_SPACE_ENABLE 0x0001 +#define PCI_MEM_SPACE_ENABLE 0x0002 +#define PCI_BUSMASTER_ENABLE 0x0004 +#define PCI_MEMORY_WRITE_INVALIDATE 0x0010 +#define PCI_PARITY_ERROR_ENABLE 0x0040 +#define PCI_SYSTEM_ERROR_ENABLE 0x0100 +#define PCI_FAST_BACK_TO_BACK_ENABLE 0x0200 + +#define PCI_STATUS_REG 0x06 +#define PCI_REV_ID_REG 0x08 + +#define PCI_CACHE_LINE_SIZE_REG 0x0c + +#define PCI_IO_BASE_ADDR_REG 0x10 +#define PCI_IO_BASE_ADDR_MASK 0xfffffff0 + +#define PCI_MEM_BASE_ADDR_LOW 0x10 +#define PCI_MEM_BASE_ADDR_HIGH 0x14 + +#define PCI_SUBSYSTEM_VENDOR_ID_REG 0x2c +#define PCI_SUBSYSTEM_ID_REG 0x2e +#define PCI_INT_LINE_REG 0x3c + +#define PCIX_CAP_REG 0x40 +#define PCIX_ENABLE_RELAXED_ORDERING BIT_17 + +/******************************************************************************/ +/* Fragment structure. */ +/******************************************************************************/ + +typedef struct { + LM_UINT32 FragSize; + LM_PHYSICAL_ADDRESS FragBuf; +} LM_FRAG, *PLM_FRAG; + +typedef struct { + /* FragCount is initialized for the caller to the maximum array size, on */ + /* return FragCount is the number of the actual fragments in the array. */ + LM_UINT32 FragCount; + + /* Total buffer size. */ + LM_UINT32 TotalSize; + + /* Fragment array buffer. */ + LM_FRAG Fragments[1]; +} LM_FRAG_LIST, *PLM_FRAG_LIST; + +#define DECLARE_FRAG_LIST_BUFFER_TYPE(_FRAG_LIST_TYPE_NAME, _MAX_FRAG_COUNT) \ + typedef struct { \ + LM_FRAG_LIST FragList; \ + LM_FRAG FragListBuffer[_MAX_FRAG_COUNT-1]; \ + } _FRAG_LIST_TYPE_NAME, *P##_FRAG_LIST_TYPE_NAME + + + +/******************************************************************************/ +/* Status codes. */ +/******************************************************************************/ + +#define LM_STATUS_SUCCESS 0 +#define LM_STATUS_FAILURE 1 + +#define LM_STATUS_INTERRUPT_ACTIVE 2 +#define LM_STATUS_INTERRUPT_NOT_ACTIVE 3 + +#define LM_STATUS_LINK_ACTIVE 4 +#define LM_STATUS_LINK_DOWN 5 +#define LM_STATUS_LINK_SETTING_MISMATCH 6 + +#define LM_STATUS_TOO_MANY_FRAGMENTS 7 +#define LM_STATUS_TRANSMIT_ABORTED 8 +#define LM_STATUS_TRANSMIT_ERROR 9 +#define LM_STATUS_RECEIVE_ABORTED 10 +#define LM_STATUS_RECEIVE_ERROR 11 +#define LM_STATUS_INVALID_PACKET_SIZE 12 +#define LM_STATUS_OUT_OF_MAP_REGISTERS 13 +#define LM_STATUS_UNKNOWN_ADAPTER 14 + +typedef LM_UINT LM_STATUS, *PLM_STATUS; + + + +/******************************************************************************/ +/* Requested media type. */ +/******************************************************************************/ + +#define LM_REQUESTED_MEDIA_TYPE_AUTO 0 +#define LM_REQUESTED_MEDIA_TYPE_BNC 1 +#define LM_REQUESTED_MEDIA_TYPE_UTP_AUTO 2 +#define LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS 3 +#define LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS_FULL_DUPLEX 4 +#define LM_REQUESTED_MEDIA_TYPE_UTP_100MBPS 5 +#define LM_REQUESTED_MEDIA_TYPE_UTP_100MBPS_FULL_DUPLEX 6 +#define LM_REQUESTED_MEDIA_TYPE_UTP_1000MBPS 7 +#define LM_REQUESTED_MEDIA_TYPE_UTP_1000MBPS_FULL_DUPLEX 8 +#define LM_REQUESTED_MEDIA_TYPE_FIBER_100MBPS 9 +#define LM_REQUESTED_MEDIA_TYPE_FIBER_100MBPS_FULL_DUPLEX 10 +#define LM_REQUESTED_MEDIA_TYPE_FIBER_1000MBPS 11 +#define LM_REQUESTED_MEDIA_TYPE_FIBER_1000MBPS_FULL_DUPLEX 12 +#define LM_REQUESTED_MEDIA_TYPE_MAC_LOOPBACK 0xfffe +#define LM_REQUESTED_MEDIA_TYPE_PHY_LOOPBACK 0xffff + +typedef LM_UINT32 LM_REQUESTED_MEDIA_TYPE, *PLM_REQUESTED_MEDIA_TYPE; + + + +/******************************************************************************/ +/* Media type. */ +/******************************************************************************/ + +#define LM_MEDIA_TYPE_UNKNOWN -1 +#define LM_MEDIA_TYPE_AUTO 0 +#define LM_MEDIA_TYPE_UTP 1 +#define LM_MEDIA_TYPE_BNC 2 +#define LM_MEDIA_TYPE_AUI 3 +#define LM_MEDIA_TYPE_FIBER 4 + +typedef LM_UINT32 LM_MEDIA_TYPE, *PLM_MEDIA_TYPE; + + + +/******************************************************************************/ +/* Line speed. */ +/******************************************************************************/ + +#define LM_LINE_SPEED_UNKNOWN 0 +#define LM_LINE_SPEED_10MBPS 1 +#define LM_LINE_SPEED_100MBPS 2 +#define LM_LINE_SPEED_1000MBPS 3 + +typedef LM_UINT32 LM_LINE_SPEED, *PLM_LINE_SPEED; + + + +/******************************************************************************/ +/* Duplex mode. */ +/******************************************************************************/ + +#define LM_DUPLEX_MODE_UNKNOWN 0 +#define LM_DUPLEX_MODE_HALF 1 +#define LM_DUPLEX_MODE_FULL 2 + +typedef LM_UINT32 LM_DUPLEX_MODE, *PLM_DUPLEX_MODE; + + + +/******************************************************************************/ +/* Power state. */ +/******************************************************************************/ + +#define LM_POWER_STATE_D0 0 +#define LM_POWER_STATE_D1 1 +#define LM_POWER_STATE_D2 2 +#define LM_POWER_STATE_D3 3 + +typedef LM_UINT32 LM_POWER_STATE, *PLM_POWER_STATE; + + + +/******************************************************************************/ +/* Task offloading. */ +/******************************************************************************/ + +#define LM_TASK_OFFLOAD_NONE 0x0000 +#define LM_TASK_OFFLOAD_TX_IP_CHECKSUM 0x0001 +#define LM_TASK_OFFLOAD_RX_IP_CHECKSUM 0x0002 +#define LM_TASK_OFFLOAD_TX_TCP_CHECKSUM 0x0004 +#define LM_TASK_OFFLOAD_RX_TCP_CHECKSUM 0x0008 +#define LM_TASK_OFFLOAD_TX_UDP_CHECKSUM 0x0010 +#define LM_TASK_OFFLOAD_RX_UDP_CHECKSUM 0x0020 +#define LM_TASK_OFFLOAD_TCP_SEGMENTATION 0x0040 + +typedef LM_UINT32 LM_TASK_OFFLOAD, *PLM_TASK_OFFLOAD; + + + +/******************************************************************************/ +/* Flow control. */ +/******************************************************************************/ + +#define LM_FLOW_CONTROL_NONE 0x00 +#define LM_FLOW_CONTROL_RECEIVE_PAUSE 0x01 +#define LM_FLOW_CONTROL_TRANSMIT_PAUSE 0x02 +#define LM_FLOW_CONTROL_RX_TX_PAUSE (LM_FLOW_CONTROL_RECEIVE_PAUSE | \ + LM_FLOW_CONTROL_TRANSMIT_PAUSE) + +/* This value can be or-ed with RECEIVE_PAUSE and TRANSMIT_PAUSE. If the */ +/* auto-negotiation is disabled and the RECEIVE_PAUSE and TRANSMIT_PAUSE */ +/* bits are set, then flow control is enabled regardless of link partner's */ +/* flow control capability. */ +#define LM_FLOW_CONTROL_AUTO_PAUSE 0x80000000 + +typedef LM_UINT32 LM_FLOW_CONTROL, *PLM_FLOW_CONTROL; + + + +/******************************************************************************/ +/* Wake up mode. */ +/******************************************************************************/ + +#define LM_WAKE_UP_MODE_NONE 0 +#define LM_WAKE_UP_MODE_MAGIC_PACKET 1 +#define LM_WAKE_UP_MODE_NWUF 2 +#define LM_WAKE_UP_MODE_LINK_CHANGE 4 + +typedef LM_UINT32 LM_WAKE_UP_MODE, *PLM_WAKE_UP_MODE; + + + +/******************************************************************************/ +/* Counters. */ +/******************************************************************************/ + +#define LM_COUNTER_FRAMES_XMITTED_OK 0 +#define LM_COUNTER_FRAMES_RECEIVED_OK 1 +#define LM_COUNTER_ERRORED_TRANSMIT_COUNT 2 +#define LM_COUNTER_ERRORED_RECEIVE_COUNT 3 +#define LM_COUNTER_RCV_CRC_ERROR 4 +#define LM_COUNTER_ALIGNMENT_ERROR 5 +#define LM_COUNTER_SINGLE_COLLISION_FRAMES 6 +#define LM_COUNTER_MULTIPLE_COLLISION_FRAMES 7 +#define LM_COUNTER_FRAMES_DEFERRED 8 +#define LM_COUNTER_MAX_COLLISIONS 9 +#define LM_COUNTER_RCV_OVERRUN 10 +#define LM_COUNTER_XMIT_UNDERRUN 11 +#define LM_COUNTER_UNICAST_FRAMES_XMIT 12 +#define LM_COUNTER_MULTICAST_FRAMES_XMIT 13 +#define LM_COUNTER_BROADCAST_FRAMES_XMIT 14 +#define LM_COUNTER_UNICAST_FRAMES_RCV 15 +#define LM_COUNTER_MULTICAST_FRAMES_RCV 16 +#define LM_COUNTER_BROADCAST_FRAMES_RCV 17 + +typedef LM_UINT32 LM_COUNTER_TYPE, *PLM_COUNTER_TYPE; + + + +/******************************************************************************/ +/* Forward definition. */ +/******************************************************************************/ + +typedef struct _LM_DEVICE_BLOCK *PLM_DEVICE_BLOCK; +typedef struct _LM_PACKET *PLM_PACKET; + + + +/******************************************************************************/ +/* Function prototypes. */ +/******************************************************************************/ + +LM_STATUS LM_GetAdapterInfo(PLM_DEVICE_BLOCK pDevice); +LM_STATUS LM_InitializeAdapter(PLM_DEVICE_BLOCK pDevice); +LM_STATUS LM_ResetAdapter(PLM_DEVICE_BLOCK pDevice); +LM_STATUS LM_DisableInterrupt(PLM_DEVICE_BLOCK pDevice); +LM_STATUS LM_EnableInterrupt(PLM_DEVICE_BLOCK pDevice); +LM_STATUS LM_SendPacket(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket); +LM_STATUS LM_ServiceInterrupts(PLM_DEVICE_BLOCK pDevice); +LM_STATUS LM_QueueRxPackets(PLM_DEVICE_BLOCK pDevice); +LM_STATUS LM_SetReceiveMask(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Mask); +LM_STATUS LM_Halt(PLM_DEVICE_BLOCK pDevice); +LM_STATUS LM_Abort(PLM_DEVICE_BLOCK pDevice); +LM_STATUS LM_MulticastAdd(PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pMcAddress); +LM_STATUS LM_MulticastDel(PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pMcAddress); +LM_STATUS LM_MulticastClear(PLM_DEVICE_BLOCK pDevice); +LM_STATUS LM_SetMacAddress(PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pMacAddress); +LM_STATUS LM_LoopbackAddress(PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pAddress); + +LM_UINT32 LM_GetCrcCounter(PLM_DEVICE_BLOCK pDevice); + +LM_WAKE_UP_MODE LM_PMCapabilities(PLM_DEVICE_BLOCK pDevice); +LM_STATUS LM_NwufAdd(PLM_DEVICE_BLOCK pDevice, LM_UINT32 ByteMaskSize, + LM_UINT8 *pByteMask, LM_UINT8 *pPattern); +LM_STATUS LM_NwufRemove(PLM_DEVICE_BLOCK pDevice, LM_UINT32 ByteMaskSize, + LM_UINT8 *pByteMask, LM_UINT8 *pPattern); +LM_STATUS LM_SetPowerState(PLM_DEVICE_BLOCK pDevice, LM_POWER_STATE PowerLevel); + +LM_VOID LM_ReadPhy(PLM_DEVICE_BLOCK pDevice, LM_UINT32 PhyReg, + PLM_UINT32 pData32); +LM_VOID LM_WritePhy(PLM_DEVICE_BLOCK pDevice, LM_UINT32 PhyReg, + LM_UINT32 Data32); + +LM_STATUS LM_ControlLoopBack(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Control); +LM_STATUS LM_SetupPhy(PLM_DEVICE_BLOCK pDevice); +int LM_BlinkLED(PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlinkDuration); + + + +/******************************************************************************/ +/* These are the OS specific functions called by LMAC. */ +/******************************************************************************/ + +LM_STATUS MM_ReadConfig16(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset, + LM_UINT16 *pValue16); +LM_STATUS MM_WriteConfig16(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset, + LM_UINT16 Value16); +LM_STATUS MM_ReadConfig32(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset, + LM_UINT32 *pValue32); +LM_STATUS MM_WriteConfig32(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset, + LM_UINT32 Value32); +LM_STATUS MM_MapMemBase(PLM_DEVICE_BLOCK pDevice); +LM_STATUS MM_MapIoBase(PLM_DEVICE_BLOCK pDevice); +LM_STATUS MM_IndicateRxPackets(PLM_DEVICE_BLOCK pDevice); +LM_STATUS MM_IndicateTxPackets(PLM_DEVICE_BLOCK pDevice); +LM_STATUS MM_StartTxDma(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket); +LM_STATUS MM_CompleteTxDma(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket); +LM_STATUS MM_AllocateMemory(PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlockSize, + PLM_VOID *pMemoryBlockVirt); +LM_STATUS MM_AllocateSharedMemory(PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlockSize, + PLM_VOID *pMemoryBlockVirt, PLM_PHYSICAL_ADDRESS pMemoryBlockPhy, + LM_BOOL Cached); +LM_STATUS MM_GetConfig(PLM_DEVICE_BLOCK pDevice); +LM_STATUS MM_IndicateStatus(PLM_DEVICE_BLOCK pDevice, LM_STATUS Status); +LM_STATUS MM_InitializeUmPackets(PLM_DEVICE_BLOCK pDevice); +LM_STATUS MM_FreeRxBuffer(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket); +LM_STATUS LM_MbufWorkAround(PLM_DEVICE_BLOCK pDevice); +LM_STATUS LM_SetLinkSpeed(PLM_DEVICE_BLOCK pDevice, + LM_REQUESTED_MEDIA_TYPE RequestedMediaType); + +#if INCLUDE_5703_A0_FIX +LM_STATUS LM_Load5703DmaWFirmware(PLM_DEVICE_BLOCK pDevice); +#endif + + +#endif /* LM_H */ + diff -urN linux-2.4.18/drivers/net/bcm/lmcfg.h lia64-2.4/drivers/net/bcm/lmcfg.h --- linux-2.4.18/drivers/net/bcm/lmcfg.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/lmcfg.h Wed Feb 27 14:16:55 2002 @@ -0,0 +1,39 @@ + +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/* History: */ +/* 02/25/00 Hav Khauv Initial version. */ +/******************************************************************************/ + +#ifndef LMCFG_H +#define LMCFG_H + + + +/******************************************************************************/ +/* Configurable constants */ +/******************************************************************************/ + +#define LM_MAJOR_VER 1 +#define LM_MINOR_VER 0 + +#define LM_SHORT_COMPANY_NAME_STR "Broadcom" +#define LM_LONG_COMPANY_NAME_STR "Broadcom Corporation" + +#define LM_LONG_COPYRIGHT_STR "Copyright \251 2000 Broadcom Corporation. All rights reserved." +#define LM_SHORT_COPYRIGHT_STR "Copyright \251 2000 Broadcom Corporation." + +#define LM_DRV_PRODUCT_NAME_STR "Gigabit Ethernet Driver" + + + +#endif /* LMCFG_H */ + diff -urN linux-2.4.18/drivers/net/bcm/mm.h lia64-2.4/drivers/net/bcm/mm.h --- linux-2.4.18/drivers/net/bcm/mm.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/mm.h Fri Jul 19 18:32:29 2002 @@ -0,0 +1,213 @@ + +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/******************************************************************************/ + +#ifndef MM_H +#define MM_H + +#include +#if defined(CONFIG_SMP) && ! defined(__SMP__) +#define __SMP__ +#endif +#if defined(CONFIG_MODVERSIONS) && defined(MODULE) && ! defined(MODVERSIONS) +#define MODVERSIONS +#endif + +#ifndef B57UM +#define __NO_VERSION__ +#endif +#include +#ifdef MODULE +#ifdef MODVERSIONS +#include +#endif +#include +#else +#define MOD_INC_USE_COUNT +#define MOD_DEC_USE_COUNT +#define SET_MODULE_OWNER(dev) +#define MODULE_DEVICE_TABLE(pci, pci_tbl) +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* Processor type for cache alignment. */ +#include +#include +#include +#include +#include +#include +#if (LINUX_VERSION_CODE >= 0x020400) +#include +#include +#endif +#ifdef CONFIG_PROC_FS +#include +#include +#endif +#ifdef NETIF_F_HW_VLAN_TX +#include +#define BCM_VLAN 1 +#endif + +#ifdef __BIG_ENDIAN +#define BIG_ENDIAN_HOST 1 +#endif + +#if (LINUX_VERSION_CODE < 0x020327) +#define __raw_readl readl +#define __raw_writel writel +#endif + +#include "lm.h" +#include "queue.h" +#include "tigon3.h" + +extern int MM_Packet_Desc_Size; + +#define MM_PACKET_DESC_SIZE MM_Packet_Desc_Size + +DECLARE_QUEUE_TYPE(UM_RX_PACKET_Q, MAX_RX_PACKET_DESC_COUNT+1); + +#define MAX_MEM 16 + +#if (LINUX_VERSION_CODE < 0x020211) +typedef u32 dma_addr_t; +#endif + +#if (LINUX_VERSION_CODE < 0x02030e) +#define net_device device +#define netif_carrier_on(dev) +#define netif_carrier_off(dev) +#endif + +#if (LINUX_VERSION_CODE < 0x02032b) +#define tasklet_struct tq_struct +#endif + +typedef struct _UM_DEVICE_BLOCK { + LM_DEVICE_BLOCK lm_dev; + struct net_device *dev; + struct pci_dev *pdev; + struct net_device *next_module; + char *name; +#ifdef CONFIG_PROC_FS + struct proc_dir_entry *pfs_entry; + char pfs_name[32]; +#endif + void *mem_list[MAX_MEM]; + dma_addr_t dma_list[MAX_MEM]; + int mem_size_list[MAX_MEM]; + int mem_list_num; + int index; + int opened; + int delayed_link_ind; /* Delay link status during initial load */ + int adapter_just_inited; /* the first few seconds after init. */ + int spurious_int; + int timer_interval; + int adaptive_expiry; + int crc_counter_expiry; + int poll_tbi_expiry; + int tx_full; + int tx_queued; + int line_speed; /* in Mbps, 0 if link is down */ + UM_RX_PACKET_Q rx_out_of_buf_q; + int rx_out_of_buf; + int rx_buf_repl_thresh; + int rx_buf_repl_panic_thresh; + int rx_buf_align; + struct timer_list timer; + int do_global_lock; + spinlock_t global_lock; + spinlock_t undi_lock; + spinlock_t phy_lock; + long undi_flags; + volatile unsigned long interrupt; + atomic_t intr_sem; + int tasklet_pending; + int tasklet_busy; + struct tasklet_struct tasklet; + struct net_device_stats stats; +#ifdef NICE_SUPPORT + void (*nice_rx)( struct sk_buff*, void* ); + void* nice_ctx; +#endif /* NICE_SUPPORT */ +#ifdef NETIF_F_HW_VLAN_TX + struct vlan_group *vlgrp; +#endif + int adaptive_coalesce; + uint rx_last_cnt; + uint tx_last_cnt; + uint rx_curr_coalesce_frames; + uint rx_curr_coalesce_ticks; + uint tx_curr_coalesce_frames; +#if TIGON3_DEBUG + uint tx_zc_count; + uint tx_chksum_count; + uint tx_himem_count; + uint rx_good_chksum_count; +#endif + uint rx_bad_chksum_count; + uint rx_misc_errors; +} UM_DEVICE_BLOCK, *PUM_DEVICE_BLOCK; + +#define MM_ACQUIRE_UNDI_LOCK(_pDevice) \ + if (!(((PUM_DEVICE_BLOCK)(_pDevice))->do_global_lock)) { \ + long flags; \ + spin_lock_irqsave(&((PUM_DEVICE_BLOCK)(_pDevice))->undi_lock, flags); \ + ((PUM_DEVICE_BLOCK)(_pDevice))->undi_flags = flags; \ + } + +#define MM_RELEASE_UNDI_LOCK(_pDevice) \ + if (!(((PUM_DEVICE_BLOCK)(_pDevice))->do_global_lock)) { \ + long flags = ((PUM_DEVICE_BLOCK) (_pDevice))->undi_flags; \ + spin_unlock_irqrestore(&((PUM_DEVICE_BLOCK)(_pDevice))->undi_lock, flags); \ + } + +#define MM_ACQUIRE_PHY_LOCK_IN_IRQ(_pDevice) \ + if (!(((PUM_DEVICE_BLOCK)(_pDevice))->do_global_lock)) { \ + spin_lock(&((PUM_DEVICE_BLOCK)(_pDevice))->phy_lock); \ + } + +#define MM_RELEASE_PHY_LOCK_IN_IRQ(_pDevice) \ + if (!(((PUM_DEVICE_BLOCK)(_pDevice))->do_global_lock)) { \ + spin_unlock(&((PUM_DEVICE_BLOCK)(_pDevice))->phy_lock); \ + } + +#define MM_ACQUIRE_INT_LOCK(_pDevice) \ + while (((PUM_DEVICE_BLOCK) _pDevice)->interrupt) + +#define MM_RELEASE_INT_LOCK(_pDevice) + +#define MM_UINT_PTR(_ptr) ((unsigned long) (_ptr)) + +#define DbgPrint(fmt, arg...) printk(KERN_WARNING fmt, ##arg) +#if defined(CONFIG_X86) +#define DbgBreakPoint() __asm__("int $129") +#else +#define DbgBreakPoint() +#endif +#define MM_Wait(time) udelay(time) + +#endif diff -urN linux-2.4.18/drivers/net/bcm/nicext.h lia64-2.4/drivers/net/bcm/nicext.h --- linux-2.4.18/drivers/net/bcm/nicext.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/nicext.h Thu Apr 11 16:38:51 2002 @@ -0,0 +1,110 @@ +/**************************************************************************** + * Copyright(c) 2000-2001 Broadcom Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * Name: nicext.h + * + * Description: Broadcom Network Interface Card Extension (NICE) is an + * extension to Linux NET device kernel mode drivers. + * NICE is designed to provide additional functionalities, + * such as receive packet intercept. To support Broadcom NICE, + * the network device driver can be modified by adding an + * device ioctl handler and by indicating receiving packets + * to the NICE receive handler. Broadcom NICE will only be + * enabled by a NICE-aware intermediate driver, such as + * Broadcom Advanced Server Program Driver (BASP). When NICE + * is not enabled, the modified network device drivers + * functions exactly as other non-NICE aware drivers. + * + * Author: Frankie Fan + * + * Created: September 17, 2000 + * + ****************************************************************************/ +#ifndef _nicext_h_ +#define _nicext_h_ + +/* + * ioctl for NICE + */ +#define SIOCNICE SIOCDEVPRIVATE+7 + +/* + * SIOCNICE: + * + * The following structure needs to be less than IFNAMSIZ (16 bytes) because + * we're overloading ifreq.ifr_ifru. + * + * If 16 bytes is not enough, we should consider relaxing this because + * this is no field after ifr_ifru in the ifreq structure. But we may + * run into future compatiability problem in case of changing struct ifreq. + */ +struct nice_req +{ + __u32 cmd; + + union + { +#ifdef __KERNEL__ + /* cmd = NICE_CMD_SET_RX or NICE_CMD_GET_RX */ + struct + { + void (*nrqus1_rx)( struct sk_buff*, void* ); + void* nrqus1_ctx; + } nrqu_nrqus1; + + /* cmd = NICE_CMD_QUERY_SUPPORT */ + struct + { + __u32 nrqus2_magic; + __u32 nrqus2_support_rx:1; + __u32 nrqus2_support_vlan:1; + __u32 nrqus2_support_get_speed:1; + } nrqu_nrqus2; +#endif + + /* cmd = NICE_CMD_GET_SPEED */ + struct + { + unsigned int nrqus3_speed; /* 0 if link is down, */ + /* otherwise speed in Mbps */ + } nrqu_nrqus3; + + /* cmd = NICE_CMD_BLINK_LED */ + struct + { + unsigned int nrqus4_blink_time; /* blink duration in seconds */ + } nrqu_nrqus4; + + } nrq_nrqu; +}; + +#define nrq_rx nrq_nrqu.nrqu_nrqus1.nrqus1_rx +#define nrq_ctx nrq_nrqu.nrqu_nrqus1.nrqus1_ctx +#define nrq_support_rx nrq_nrqu.nrqu_nrqus2.nrqus2_support_rx +#define nrq_magic nrq_nrqu.nrqu_nrqus2.nrqus2_magic +#define nrq_support_vlan nrq_nrqu.nrqu_nrqus2.nrqus2_support_vlan +#define nrq_support_get_speed nrq_nrqu.nrqu_nrqus2.nrqus2_support_get_speed +#define nrq_speed nrq_nrqu.nrqu_nrqus3.nrqus3_speed +#define nrq_blink_time nrq_nrqu.nrqu_nrqus4.nrqus4_blink_time + +/* + * magic constants + */ +#define NICE_REQUESTOR_MAGIC 0x4543494E // NICE in ascii +#define NICE_DEVICE_MAGIC 0x4E494345 // ECIN in ascii + +/* + * command field + */ +#define NICE_CMD_QUERY_SUPPORT 0x00000001 +#define NICE_CMD_SET_RX 0x00000002 +#define NICE_CMD_GET_RX 0x00000003 +#define NICE_CMD_GET_SPEED 0x00000004 +#define NICE_CMD_BLINK_LED 0x00000005 + +#endif // _nicext_h_ + diff -urN linux-2.4.18/drivers/net/bcm/queue.h lia64-2.4/drivers/net/bcm/queue.h --- linux-2.4.18/drivers/net/bcm/queue.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/queue.h Fri Jul 19 17:18:48 2002 @@ -0,0 +1,342 @@ + +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/* Queue functions. */ +/* void QQ_InitQueue(PQQ_CONTAINER pQueue) */ +/* char QQ_Full(PQQ_CONTAINER pQueue) */ +/* char QQ_Empty(PQQ_CONTAINER pQueue) */ +/* unsigned int QQ_GetSize(PQQ_CONTAINER pQueue) */ +/* unsigned int QQ_GetEntryCnt(PQQ_CONTAINER pQueue) */ +/* char QQ_PushHead(PQQ_CONTAINER pQueue, PQQ_ENTRY pEntry) */ +/* char QQ_PushTail(PQQ_CONTAINER pQueue, PQQ_ENTRY pEntry) */ +/* PQQ_ENTRY QQ_PopHead(PQQ_CONTAINER pQueue) */ +/* PQQ_ENTRY QQ_PopTail(PQQ_CONTAINER pQueue) */ +/* PQQ_ENTRY QQ_GetHead(PQQ_CONTAINER pQueue, unsigned int Idx) */ +/* PQQ_ENTRY QQ_GetTail(PQQ_CONTAINER pQueue, unsigned int Idx) */ +/* */ +/* */ +/* History: */ +/* 02/25/00 Hav Khauv Initial version. */ +/******************************************************************************/ + +#ifndef BCM_QUEUE_H +#define BCM_QUEUE_H + + + +/******************************************************************************/ +/* Queue definitions. */ +/******************************************************************************/ + +/* Entry for queueing. */ +typedef void *PQQ_ENTRY; + + +/* Queue header -- base type. */ +typedef struct { + unsigned int Head; + unsigned int Tail; + unsigned int Size; + atomic_t EntryCnt; + PQQ_ENTRY Array[1]; +} QQ_CONTAINER, *PQQ_CONTAINER; + + +/* Declare queue type macro. */ +#define DECLARE_QUEUE_TYPE(_QUEUE_TYPE, _QUEUE_SIZE) \ + \ + typedef struct { \ + QQ_CONTAINER Container; \ + PQQ_ENTRY EntryBuffer[_QUEUE_SIZE]; \ + } _QUEUE_TYPE, *P##_QUEUE_TYPE + + + +/******************************************************************************/ +/* Compilation switches. */ +/******************************************************************************/ + +#if DBG +#undef QQ_NO_OVERFLOW_CHECK +#undef QQ_NO_UNDERFLOW_CHECK +#endif /* DBG */ + +#ifdef QQ_USE_MACROS +/* notdone */ +#else + +#ifdef QQ_NO_INLINE +#define __inline +#endif /* QQ_NO_INLINE */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +__inline static void +QQ_InitQueue( +PQQ_CONTAINER pQueue, +unsigned int QueueSize) { + pQueue->Head = 0; + pQueue->Tail = 0; + pQueue->Size = QueueSize+1; + atomic_set(&pQueue->EntryCnt, 0); +} /* QQ_InitQueue */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +__inline static char +QQ_Full( +PQQ_CONTAINER pQueue) { + unsigned int NewHead; + + NewHead = (pQueue->Head + 1) % pQueue->Size; + + return(NewHead == pQueue->Tail); +} /* QQ_Full */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +__inline static char +QQ_Empty( +PQQ_CONTAINER pQueue) { + return(pQueue->Head == pQueue->Tail); +} /* QQ_Empty */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +__inline static unsigned int +QQ_GetSize( +PQQ_CONTAINER pQueue) { + return pQueue->Size; +} /* QQ_GetSize */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +__inline static unsigned int +QQ_GetEntryCnt( +PQQ_CONTAINER pQueue) { + return atomic_read(&pQueue->EntryCnt); +} /* QQ_GetEntryCnt */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/* TRUE entry was added successfully. */ +/* FALSE queue is full. */ +/******************************************************************************/ +__inline static char +QQ_PushHead( +PQQ_CONTAINER pQueue, +PQQ_ENTRY pEntry) { + unsigned int Head; + + Head = (pQueue->Head + 1) % pQueue->Size; + +#if !defined(QQ_NO_OVERFLOW_CHECK) + if(Head == pQueue->Tail) { + return 0; + } /* if */ +#endif /* QQ_NO_OVERFLOW_CHECK */ + + pQueue->Array[pQueue->Head] = pEntry; + wmb(); + pQueue->Head = Head; + atomic_inc(&pQueue->EntryCnt); + + return -1; +} /* QQ_PushHead */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/* TRUE entry was added successfully. */ +/* FALSE queue is full. */ +/******************************************************************************/ +__inline static char +QQ_PushTail( +PQQ_CONTAINER pQueue, +PQQ_ENTRY pEntry) { + unsigned int Tail; + + Tail = pQueue->Tail; + if(Tail == 0) { + Tail = pQueue->Size; + } /* if */ + Tail--; + +#if !defined(QQ_NO_OVERFLOW_CHECK) + if(Tail == pQueue->Head) { + return 0; + } /* if */ +#endif /* QQ_NO_OVERFLOW_CHECK */ + + pQueue->Array[Tail] = pEntry; + wmb(); + pQueue->Tail = Tail; + atomic_inc(&pQueue->EntryCnt); + + return -1; +} /* QQ_PushTail */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +__inline static PQQ_ENTRY +QQ_PopHead( +PQQ_CONTAINER pQueue) { + unsigned int Head; + PQQ_ENTRY Entry; + + Head = pQueue->Head; + +#if !defined(QQ_NO_UNDERFLOW_CHECK) + if(Head == pQueue->Tail) { + return (PQQ_ENTRY) 0; + } /* if */ +#endif /* QQ_NO_UNDERFLOW_CHECK */ + + if(Head == 0) { + Head = pQueue->Size; + } /* if */ + Head--; + + Entry = pQueue->Array[Head]; + mb(); + pQueue->Head = Head; + atomic_dec(&pQueue->EntryCnt); + + return Entry; +} /* QQ_PopHead */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +__inline static PQQ_ENTRY +QQ_PopTail( +PQQ_CONTAINER pQueue) { + unsigned int Tail; + PQQ_ENTRY Entry; + + Tail = pQueue->Tail; + +#if !defined(QQ_NO_UNDERFLOW_CHECK) + if(Tail == pQueue->Head) { + return (PQQ_ENTRY) 0; + } /* if */ +#endif /* QQ_NO_UNDERFLOW_CHECK */ + + Entry = pQueue->Array[Tail]; + mb(); + pQueue->Tail = (Tail + 1) % pQueue->Size; + atomic_dec(&pQueue->EntryCnt); + + return Entry; +} /* QQ_PopTail */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +__inline static PQQ_ENTRY +QQ_GetHead( + PQQ_CONTAINER pQueue, + unsigned int Idx) +{ + if(Idx >= atomic_read(&pQueue->EntryCnt)) + { + return (PQQ_ENTRY) 0; + } + + if(pQueue->Head > Idx) + { + Idx = pQueue->Head - Idx; + } + else + { + Idx = pQueue->Size - (Idx - pQueue->Head); + } + Idx--; + + return pQueue->Array[Idx]; +} + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +__inline static PQQ_ENTRY +QQ_GetTail( + PQQ_CONTAINER pQueue, + unsigned int Idx) +{ + if(Idx >= atomic_read(&pQueue->EntryCnt)) + { + return (PQQ_ENTRY) 0; + } + + Idx += pQueue->Tail; + if(Idx >= pQueue->Size) + { + Idx = Idx - pQueue->Size; + } + + return pQueue->Array[Idx]; +} + +#endif /* QQ_USE_MACROS */ + + + +#endif /* QUEUE_H */ diff -urN linux-2.4.18/drivers/net/bcm/tigon3.c lia64-2.4/drivers/net/bcm/tigon3.c --- linux-2.4.18/drivers/net/bcm/tigon3.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/tigon3.c Fri Jul 19 17:19:01 2002 @@ -0,0 +1,6037 @@ +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/* History: */ +/******************************************************************************/ + +#include "mm.h" + + + +/******************************************************************************/ +/* Local functions. */ +/******************************************************************************/ + +LM_STATUS LM_Abort(PLM_DEVICE_BLOCK pDevice); +LM_STATUS LM_QueueRxPackets(PLM_DEVICE_BLOCK pDevice); + +static LM_STATUS LM_TranslateRequestedMediaType( + LM_REQUESTED_MEDIA_TYPE RequestedMediaType, + PLM_MEDIA_TYPE pMediaType, PLM_LINE_SPEED pLineSpeed, + PLM_DUPLEX_MODE pDuplexMode); + +static LM_STATUS LM_InitBcm540xPhy(PLM_DEVICE_BLOCK pDevice); + +__inline static LM_VOID LM_ServiceRxInterrupt(PLM_DEVICE_BLOCK pDevice); +__inline static LM_VOID LM_ServiceTxInterrupt(PLM_DEVICE_BLOCK pDevice); + +static LM_STATUS LM_ForceAutoNegBcm540xPhy(PLM_DEVICE_BLOCK pDevice, + LM_REQUESTED_MEDIA_TYPE RequestedMediaType, LM_BOOL WaitForLink); +static LM_STATUS LM_ForceAutoNeg(PLM_DEVICE_BLOCK pDevice, + LM_REQUESTED_MEDIA_TYPE RequestedMediaType, LM_BOOL WaitForLink); +static LM_UINT32 GetPhyAdFlowCntrlSettings(PLM_DEVICE_BLOCK pDevice); +STATIC LM_STATUS LM_SetFlowControl(PLM_DEVICE_BLOCK pDevice, + LM_UINT32 LocalPhyAd, LM_UINT32 RemotePhyAd); +STATIC LM_STATUS LM_SetupFiberPhy(PLM_DEVICE_BLOCK pDevice); +STATIC LM_STATUS LM_SetupCopperPhy(PLM_DEVICE_BLOCK pDevice); +STATIC LM_STATUS LM_InitBcm800xPhy(PLM_DEVICE_BLOCK pDevice); +STATIC PLM_ADAPTER_INFO LM_GetAdapterInfoBySsid(LM_UINT16 Svid, LM_UINT16 Ssid); +STATIC LM_STATUS LM_DmaTest(PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pBufferVirt, + LM_PHYSICAL_ADDRESS BufferPhy, LM_UINT32 BufferSize); +STATIC LM_STATUS LM_HaltCpu(PLM_DEVICE_BLOCK pDevice,LM_UINT32 cpu_number); +STATIC LM_STATUS LM_ResetChip(PLM_DEVICE_BLOCK pDevice); + + +/******************************************************************************/ +/* External functions. */ +/******************************************************************************/ + +LM_STATUS LM_LoadRlsFirmware(PLM_DEVICE_BLOCK pDevice); + + +LM_UINT32 +LM_RegRd(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Register) +{ +#if PCIX_TARGET_WORKAROUND + if (pDevice->UndiFix) + { + return (LM_RegRdInd(pDevice, Register)); + } + else +#endif + { + return (REG_RD_OFFSET(pDevice, Register)); + } +} + +LM_VOID +LM_RegWr(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Register, LM_UINT32 Value32) +{ +#if PCIX_TARGET_WORKAROUND + if (pDevice->EnablePciXFix) + { + LM_RegWrInd(pDevice, Register, Value32); + } + else +#endif + { + REG_WR_OFFSET(pDevice, Register, Value32); + } +} + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_UINT32 +LM_RegRdInd( +PLM_DEVICE_BLOCK pDevice, +LM_UINT32 Register) { + LM_UINT32 Value32; + +#if PCIX_TARGET_WORKAROUND + MM_ACQUIRE_UNDI_LOCK(pDevice); +#endif + MM_WriteConfig32(pDevice, T3_PCI_REG_ADDR_REG, Register); + MM_ReadConfig32(pDevice, T3_PCI_REG_DATA_REG, &Value32); +#if PCIX_TARGET_WORKAROUND + MM_RELEASE_UNDI_LOCK(pDevice); +#endif + + return Value32; +} /* LM_RegRdInd */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_VOID +LM_RegWrInd( +PLM_DEVICE_BLOCK pDevice, +LM_UINT32 Register, +LM_UINT32 Value32) { + +#if PCIX_TARGET_WORKAROUND + MM_ACQUIRE_UNDI_LOCK(pDevice); +#endif + MM_WriteConfig32(pDevice, T3_PCI_REG_ADDR_REG, Register); + MM_WriteConfig32(pDevice, T3_PCI_REG_DATA_REG, Value32); +#if PCIX_TARGET_WORKAROUND + MM_RELEASE_UNDI_LOCK(pDevice); +#endif +} /* LM_RegWrInd */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_UINT32 +LM_MemRdInd( +PLM_DEVICE_BLOCK pDevice, +LM_UINT32 MemAddr) { + LM_UINT32 Value32; + + MM_ACQUIRE_UNDI_LOCK(pDevice); +#ifdef BIG_ENDIAN_HOST + MM_WriteConfig32(pDevice, T3_PCI_MEM_WIN_ADDR_REG, MemAddr); + Value32 = REG_RD(pDevice, PciCfg.MemWindowData); + /* Value32 = REG_RD(pDevice,uIntMem.Mbuf[(MemAddr & 0x7fff)/4]); */ +#else + MM_WriteConfig32(pDevice, T3_PCI_MEM_WIN_ADDR_REG, MemAddr); + MM_ReadConfig32(pDevice, T3_PCI_MEM_WIN_DATA_REG, &Value32); +#endif + MM_RELEASE_UNDI_LOCK(pDevice); + + return Value32; +} /* LM_MemRdInd */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_VOID +LM_MemWrInd( +PLM_DEVICE_BLOCK pDevice, +LM_UINT32 MemAddr, +LM_UINT32 Value32) { + MM_ACQUIRE_UNDI_LOCK(pDevice); +#ifdef BIG_ENDIAN_HOST + REG_WR(pDevice,PciCfg.MemWindowBaseAddr,MemAddr); + REG_WR(pDevice,uIntMem.Mbuf[(MemAddr & 0x7fff)/4],Value32); +#else + MM_WriteConfig32(pDevice, T3_PCI_MEM_WIN_ADDR_REG, MemAddr); + MM_WriteConfig32(pDevice, T3_PCI_MEM_WIN_DATA_REG, Value32); +#endif + MM_RELEASE_UNDI_LOCK(pDevice); +} /* LM_MemWrInd */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_STATUS +LM_QueueRxPackets( +PLM_DEVICE_BLOCK pDevice) { + LM_STATUS Lmstatus; + PLM_PACKET pPacket; + PT3_RCV_BD pRcvBd; + LM_UINT32 StdBdAdded = 0; +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + LM_UINT32 JumboBdAdded = 0; +#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */ + + Lmstatus = LM_STATUS_SUCCESS; + + pPacket = (PLM_PACKET) QQ_PopHead(&pDevice->RxPacketFreeQ.Container); + while(pPacket) { + switch(pPacket->u.Rx.RcvProdRing) { +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + case T3_JUMBO_RCV_PROD_RING: /* Jumbo Receive Ring. */ + /* Initialize the buffer descriptor. */ + pRcvBd = + &pDevice->pRxJumboBdVirt[pDevice->RxJumboProdIdx]; + pRcvBd->Flags = RCV_BD_FLAG_END | RCV_BD_FLAG_JUMBO_RING; + pRcvBd->Len = (LM_UINT16) pDevice->RxJumboBufferSize; + + /* Initialize the receive buffer pointer */ + pRcvBd->HostAddr.Low = pPacket->u.Rx.RxBufferPhy.Low; + pRcvBd->HostAddr.High = pPacket->u.Rx.RxBufferPhy.High; + + /* The opaque field may point to an offset from a fix addr. */ + pRcvBd->Opaque = (LM_UINT32) (MM_UINT_PTR(pPacket) - + MM_UINT_PTR(pDevice->pPacketDescBase)); + + /* Update the producer index. */ + pDevice->RxJumboProdIdx = (pDevice->RxJumboProdIdx + 1) & + T3_JUMBO_RCV_RCB_ENTRY_COUNT_MASK; + + JumboBdAdded++; + break; +#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */ + + case T3_STD_RCV_PROD_RING: /* Standard Receive Ring. */ + /* Initialize the buffer descriptor. */ + pRcvBd = &pDevice->pRxStdBdVirt[pDevice->RxStdProdIdx]; + pRcvBd->Flags = RCV_BD_FLAG_END; + pRcvBd->Len = MAX_STD_RCV_BUFFER_SIZE; + + /* Initialize the receive buffer pointer */ + pRcvBd->HostAddr.Low = pPacket->u.Rx.RxBufferPhy.Low; + pRcvBd->HostAddr.High = pPacket->u.Rx.RxBufferPhy.High; + + /* The opaque field may point to an offset from a fix addr. */ + pRcvBd->Opaque = (LM_UINT32) (MM_UINT_PTR(pPacket) - + MM_UINT_PTR(pDevice->pPacketDescBase)); + + /* Update the producer index. */ + pDevice->RxStdProdIdx = (pDevice->RxStdProdIdx + 1) & + T3_STD_RCV_RCB_ENTRY_COUNT_MASK; + + StdBdAdded++; + break; + + case T3_UNKNOWN_RCV_PROD_RING: + default: + Lmstatus = LM_STATUS_FAILURE; + break; + } /* switch */ + + /* Bail out if there is any error. */ + if(Lmstatus != LM_STATUS_SUCCESS) + { + break; + } + + pPacket = (PLM_PACKET) QQ_PopHead(&pDevice->RxPacketFreeQ.Container); + } /* while */ + + wmb(); + /* Update the procedure index. */ + if(StdBdAdded) + { + MB_REG_WR(pDevice, Mailbox.RcvStdProdIdx.Low, pDevice->RxStdProdIdx); + } +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + if(JumboBdAdded) + { + MB_REG_WR(pDevice, Mailbox.RcvJumboProdIdx.Low, + pDevice->RxJumboProdIdx); + } +#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */ + + return Lmstatus; +} /* LM_QueueRxPackets */ + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +STATIC LM_VOID +LM_NvramInit( + PLM_DEVICE_BLOCK pDevice) +{ + LM_UINT32 Value32; + LM_UINT32 j; + + /* Intialize clock period and state machine. */ + Value32 = SEEPROM_ADDR_CLK_PERD(SEEPROM_CLOCK_PERIOD) | + SEEPROM_ADDR_FSM_RESET; + REG_WR(pDevice, Grc.EepromAddr, Value32); + + for(j = 0; j < 100; j++) + { + MM_Wait(10); + } + + /* Serial eeprom access using the Grc.EepromAddr/EepromData registers. */ + Value32 = REG_RD(pDevice, Grc.LocalCtrl); + REG_WR(pDevice, Grc.LocalCtrl, Value32 | GRC_MISC_LOCAL_CTRL_AUTO_SEEPROM); + + /* Set the 5701 compatibility mode if we are using EEPROM. */ + if(T3_ASIC_REV(pDevice->ChipRevId) != T3_ASIC_REV_5700 && + T3_ASIC_REV(pDevice->ChipRevId) != T3_ASIC_REV_5701) + { + Value32 = REG_RD(pDevice, Nvram.Config1); + if((Value32 & FLASH_INTERFACE_ENABLE) == 0) + { + /* Use the new interface to read EEPROM. */ + Value32 &= ~FLASH_COMPAT_BYPASS; + + REG_WR(pDevice, Nvram.Config1, Value32); + } + } + for(j = 0; j < 100; j++) + { + MM_Wait(10); + } + +} /* LM_NvRamInit */ + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +STATIC LM_STATUS +LM_EepromRead( + PLM_DEVICE_BLOCK pDevice, + LM_UINT32 Offset, + LM_UINT32 *pData) +{ + LM_UINT32 Value32; + LM_UINT32 Addr; + LM_UINT32 Dev; + LM_UINT32 j; + + if(Offset > SEEPROM_CHIP_SIZE) + { + return LM_STATUS_FAILURE; + } + + Dev = Offset / SEEPROM_CHIP_SIZE; + Addr = Offset % SEEPROM_CHIP_SIZE; + + Value32 = REG_RD(pDevice, Grc.EepromAddr); + Value32 &= ~(SEEPROM_ADDR_ADDRESS_MASK | SEEPROM_ADDR_DEV_ID_MASK | + SEEPROM_ADDR_RW_MASK); + REG_WR(pDevice, Grc.EepromAddr, Value32 | SEEPROM_ADDR_DEV_ID(Dev) | + SEEPROM_ADDR_ADDRESS(Addr) | SEEPROM_ADDR_START | SEEPROM_ADDR_READ); + + for(j = 0; j < 2000; j++) + { + Value32 = REG_RD(pDevice, Grc.EepromAddr); + if(Value32 & SEEPROM_ADDR_COMPLETE) + { + break; + } + MM_Wait(10); + } + + if(Value32 & SEEPROM_ADDR_COMPLETE) + { + Value32 = REG_RD(pDevice, Grc.EepromData); + *pData = Value32; + + return LM_STATUS_SUCCESS; + } + + return LM_STATUS_FAILURE; +} /* LM_EepromRead */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +STATIC LM_STATUS +LM_NvramRead( + PLM_DEVICE_BLOCK pDevice, + LM_UINT32 Offset, + LM_UINT32 *pData) +{ + LM_UINT32 Value32; + LM_STATUS Status; + LM_UINT32 j; + + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 || + T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) + { + Status = LM_EepromRead(pDevice, Offset, pData); + } + else + { + /* Determine if we have flash or EEPROM. */ + Value32 = REG_RD(pDevice, Nvram.Config1); + if(Value32 & FLASH_INTERFACE_ENABLE) + { + if(Value32 & FLASH_SSRAM_BUFFERRED_MODE) + { + Offset = ((Offset/BUFFERED_FLASH_PAGE_SIZE) << + BUFFERED_FLASH_PAGE_POS) + + (Offset % BUFFERED_FLASH_PAGE_SIZE); + } + } + + REG_WR(pDevice, Nvram.SwArb, SW_ARB_REQ_SET1); + for (j = 0; j < 1000; j++) + { + if (REG_RD(pDevice, Nvram.SwArb) & SW_ARB_GNT1) + { + break; + } + MM_Wait(20); + } + if (j == 1000) + { + return LM_STATUS_FAILURE; + } + + /* Read from flash or EEPROM with the new 5703/02 interface. */ + REG_WR(pDevice, Nvram.Addr, Offset & NVRAM_ADDRESS_MASK); + + REG_WR(pDevice, Nvram.Cmd, NVRAM_CMD_RD | NVRAM_CMD_DO_IT | + NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_DONE); + + /* Wait for the done bit to clear. */ + for(j = 0; j < 500; j++) + { + MM_Wait(10); + + Value32 = REG_RD(pDevice, Nvram.Cmd); + if(!(Value32 & NVRAM_CMD_DONE)) + { + break; + } + } + + /* Wait for the done bit. */ + if(!(Value32 & NVRAM_CMD_DONE)) + { + for(j = 0; j < 500; j++) + { + MM_Wait(10); + + Value32 = REG_RD(pDevice, Nvram.Cmd); + if(Value32 & NVRAM_CMD_DONE) + { + MM_Wait(10); + + *pData = REG_RD(pDevice, Nvram.ReadData); + + /* Change the endianess. */ + *pData = ((*pData & 0xff) << 24)| ((*pData & 0xff00) << 8)| + ((*pData & 0xff0000) >> 8) | ((*pData >> 24) & 0xff); + + break; + } + } + } + + REG_WR(pDevice, Nvram.SwArb, SW_ARB_REQ_CLR1); + if(Value32 & NVRAM_CMD_DONE) + { + Status = LM_STATUS_SUCCESS; + } + else + { + Status = LM_STATUS_FAILURE; + } + } + + return Status; +} /* LM_NvramRead */ + + + +STATIC void +LM_ReadVPD(PLM_DEVICE_BLOCK pDevice) +{ + LM_UINT8 Vpd[256]; + LM_UINT32 *Vpd_dptr = (LM_UINT32 *) Vpd; + LM_UINT32 Value32; + unsigned int j; + + /* Read PN from VPD */ + for (j = 0; j < 256; j += 4, Vpd_dptr++ ) + { + if (LM_NvramRead(pDevice, 0x100 + j, &Value32) != LM_STATUS_SUCCESS) { + printk(KERN_ERR "VPD read failed\n"); + return; + } + *Vpd_dptr = cpu_to_le32(Value32); + } + for (j = 0; j < 256; ) + { + unsigned int Vpd_r_len; + unsigned int Vpd_r_end; + + if ((Vpd[j] == 0x82) || (Vpd[j] == 0x91)) + { + j = j + 3 + Vpd[j + 1] + (Vpd[j + 2] << 8); + } + else if (Vpd[j] == 0x90) + { + Vpd_r_len = Vpd[j + 1] + (Vpd[j + 2] << 8); + j += 3; + Vpd_r_end = Vpd_r_len + j; + while (j < Vpd_r_end) + { + if ((Vpd[j] == 'P') && (Vpd[j + 1] == 'N')) + { + unsigned int len = Vpd[j + 2]; + + if (len <= 24) + { + memcpy(pDevice->PartNo, &Vpd[j + 3], len); + } + break; + } + else + { + if (Vpd[j + 2] == 0) + { + break; + } + j = j + Vpd[j + 2]; + } + } + break; + } + else { + break; + } + } +} + +STATIC void +LM_ReadBootCodeVersion(PLM_DEVICE_BLOCK pDevice) +{ + LM_UINT32 Value32, offset, ver_offset; + int i; + + if (LM_NvramRead(pDevice, 0x0, &Value32) != LM_STATUS_SUCCESS) + return; + if (Value32 != 0xaa559966) + return; + if (LM_NvramRead(pDevice, 0xc, &offset) != LM_STATUS_SUCCESS) + return; + + offset = ((offset & 0xff) << 24)| ((offset & 0xff00) << 8)| + ((offset & 0xff0000) >> 8) | ((offset >> 24) & 0xff); + if (LM_NvramRead(pDevice, offset, &Value32) != LM_STATUS_SUCCESS) + return; + if ((Value32 == 0x0300000e) && + (LM_NvramRead(pDevice, offset + 4, &Value32) == LM_STATUS_SUCCESS) && + (Value32 == 0)) { + + if (LM_NvramRead(pDevice, offset + 8, &ver_offset) != LM_STATUS_SUCCESS) + return; + ver_offset = ((ver_offset & 0xff0000) >> 8) | + ((ver_offset >> 24) & 0xff); + for (i = 0; i < 16; i += 4) { + if (LM_NvramRead(pDevice, offset + ver_offset + i, &Value32) != + LM_STATUS_SUCCESS) + { + return; + } + *((LM_UINT32 *) &pDevice->BootCodeVer[i]) = cpu_to_le32(Value32); + } + } + else { + char c; + + if (LM_NvramRead(pDevice, 0x94, &Value32) != LM_STATUS_SUCCESS) + return; + + i = 0; + c = ((Value32 & 0xff0000) >> 16); + + if (c < 10) { + pDevice->BootCodeVer[i++] = c + '0'; + } + else { + pDevice->BootCodeVer[i++] = (c / 10) + '0'; + pDevice->BootCodeVer[i++] = (c % 10) + '0'; + } + pDevice->BootCodeVer[i++] = '.'; + c = (Value32 & 0xff000000) >> 24; + if (c < 10) { + pDevice->BootCodeVer[i++] = c + '0'; + } + else { + pDevice->BootCodeVer[i++] = (c / 10) + '0'; + pDevice->BootCodeVer[i++] = (c % 10) + '0'; + } + pDevice->BootCodeVer[i] = 0; + } +} + +STATIC void +LM_GetBusSpeed(PLM_DEVICE_BLOCK pDevice) +{ + LM_UINT32 PciState = pDevice->PciState; + LM_UINT32 ClockCtrl; + char *SpeedStr = ""; + + if (PciState & T3_PCI_STATE_32BIT_PCI_BUS) + { + strcpy(pDevice->BusSpeedStr, "32-bit "); + } + else + { + strcpy(pDevice->BusSpeedStr, "64-bit "); + } + if (PciState & T3_PCI_STATE_CONVENTIONAL_PCI_MODE) + { + strcat(pDevice->BusSpeedStr, "PCI "); + if (PciState & T3_PCI_STATE_HIGH_BUS_SPEED) + { + SpeedStr = "66MHz"; + } + else + { + SpeedStr = "33MHz"; + } + } + else + { + strcat(pDevice->BusSpeedStr, "PCIX "); + ClockCtrl = REG_RD(pDevice, PciCfg.ClockCtrl) & 0x1f; + switch (ClockCtrl) + { + case 0: + SpeedStr = "33MHz"; + break; + + case 2: + SpeedStr = "50MHz"; + break; + + case 4: + SpeedStr = "66MHz"; + break; + + case 6: + SpeedStr = "100MHz"; + break; + + case 7: + SpeedStr = "133MHz"; + break; + } + } + strcat(pDevice->BusSpeedStr, SpeedStr); +} + +/******************************************************************************/ +/* Description: */ +/* This routine initializes default parameters and reads the PCI */ +/* configurations. */ +/* */ +/* Return: */ +/* LM_STATUS_SUCCESS */ +/******************************************************************************/ +LM_STATUS +LM_GetAdapterInfo( +PLM_DEVICE_BLOCK pDevice) +{ + PLM_ADAPTER_INFO pAdapterInfo; + LM_UINT32 Value32; + LM_STATUS Status; + LM_UINT32 j; + LM_UINT32 EeSigFound; + LM_UINT32 EePhyTypeSerdes = 0; + LM_UINT32 EePhyLedMode = 0; + LM_UINT32 EePhyId = 0; + + /* Get Device Id and Vendor Id */ + Status = MM_ReadConfig32(pDevice, PCI_VENDOR_ID_REG, &Value32); + if(Status != LM_STATUS_SUCCESS) + { + return Status; + } + pDevice->PciVendorId = (LM_UINT16) Value32; + pDevice->PciDeviceId = (LM_UINT16) (Value32 >> 16); + + /* If we are not getting the write adapter, exit. */ + if((Value32 != T3_PCI_ID_BCM5700) && + (Value32 != T3_PCI_ID_BCM5701) && + (Value32 != T3_PCI_ID_BCM5702) && + (Value32 != T3_PCI_ID_BCM5702x) && + (Value32 != T3_PCI_ID_BCM5702FE) && + (Value32 != T3_PCI_ID_BCM5703) && + (Value32 != T3_PCI_ID_BCM5703x)) + { + return LM_STATUS_FAILURE; + } + + Status = MM_ReadConfig32(pDevice, PCI_REV_ID_REG, &Value32); + if(Status != LM_STATUS_SUCCESS) + { + return Status; + } + pDevice->PciRevId = (LM_UINT8) Value32; + + /* Get IRQ. */ + Status = MM_ReadConfig32(pDevice, PCI_INT_LINE_REG, &Value32); + if(Status != LM_STATUS_SUCCESS) + { + return Status; + } + pDevice->Irq = (LM_UINT8) Value32; + + /* Get interrupt pin. */ + pDevice->IntPin = (LM_UINT8) (Value32 >> 8); + + /* Get chip revision id. */ + Status = MM_ReadConfig32(pDevice, T3_PCI_MISC_HOST_CTRL_REG, &Value32); + pDevice->ChipRevId = Value32 >> 16; + + /* Get subsystem vendor. */ + Status = MM_ReadConfig32(pDevice, PCI_SUBSYSTEM_VENDOR_ID_REG, &Value32); + if(Status != LM_STATUS_SUCCESS) + { + return Status; + } + pDevice->SubsystemVendorId = (LM_UINT16) Value32; + + /* Get PCI subsystem id. */ + pDevice->SubsystemId = (LM_UINT16) (Value32 >> 16); + + /* Get the cache line size. */ + MM_ReadConfig32(pDevice, PCI_CACHE_LINE_SIZE_REG, &Value32); + pDevice->CacheLineSize = (LM_UINT8) Value32; + pDevice->SavedCacheLineReg = Value32; + + /* Get PCI memory base. */ + MM_ReadConfig32(pDevice, PCI_MEM_BASE_ADDR_HIGH, &Value32); + pDevice->MemBaseHigh = Value32; + + MM_ReadConfig32(pDevice, PCI_MEM_BASE_ADDR_LOW, &Value32); + Value32 &= 0xfffffff0; + pDevice->MemBaseLow = Value32; + + /* Initialize require MemBase Size */ + pDevice->MemBaseSize = sizeof(T3_STD_MEM_MAP); + + if(pDevice->ChipRevId != T3_CHIP_ID_5703_A1 && + pDevice->ChipRevId != T3_CHIP_ID_5703_A2) + { + pDevice->UndiFix = FALSE; + } +#if !PCIX_TARGET_WORKAROUND + pDevice->UndiFix = FALSE; +#endif + /* Map the memory base to system address space. */ + if (!pDevice->UndiFix) + { + Status = MM_MapMemBase(pDevice); + if(Status != LM_STATUS_SUCCESS) + { + return Status; + } + /* Initialize the memory view pointer. */ + pDevice->pMemView = (PT3_STD_MEM_MAP) pDevice->pMappedMemBase; + } + +#if PCIX_TARGET_WORKAROUND + /* store whether we are in PCI are PCI-X mode */ + pDevice->EnablePciXFix = FALSE; + + MM_ReadConfig32(pDevice, T3_PCI_STATE_REG, &Value32); + if((Value32 & T3_PCI_STATE_CONVENTIONAL_PCI_MODE) == 0) + { + /* Enable PCI-X workaround only if we are running on 5700 BX. */ + if(T3_CHIP_REV(pDevice->ChipRevId) == T3_CHIP_REV_5700_BX) + { + pDevice->EnablePciXFix = TRUE; + } + } + if (pDevice->UndiFix) + { + pDevice->EnablePciXFix = TRUE; + } +#endif + /* Bx bug: due to the "byte_enable bug" in PCI-X mode, the power */ + /* management register may be clobbered which may cause the */ + /* BCM5700 to go into D3 state. While in this state, we will */ + /* not have memory mapped register access. As a workaround, we */ + /* need to restore the device to D0 state. */ + MM_ReadConfig32(pDevice, T3_PCI_PM_STATUS_CTRL_REG, &Value32); + Value32 |= T3_PM_PME_ASSERTED; + Value32 &= ~T3_PM_POWER_STATE_MASK; + Value32 |= T3_PM_POWER_STATE_D0; + MM_WriteConfig32(pDevice, T3_PCI_PM_STATUS_CTRL_REG, Value32); + + /* read the current PCI command word */ + MM_ReadConfig32(pDevice, PCI_COMMAND_REG, &Value32); + + /* Make sure bus-mastering is enabled. */ + Value32 |= PCI_BUSMASTER_ENABLE; + +#if PCIX_TARGET_WORKAROUND + /* if we are in PCI-X mode, also make sure mem-mapping and SERR#/PERR# + are enabled */ + if (pDevice->EnablePciXFix == TRUE) + { + Value32 |= (PCI_MEM_SPACE_ENABLE | PCI_SYSTEM_ERROR_ENABLE | + PCI_PARITY_ERROR_ENABLE); + } + if (pDevice->UndiFix) + { + Value32 &= ~PCI_MEM_SPACE_ENABLE; + } + +#endif + + if(pDevice->EnableMWI) + { + Value32 |= PCI_MEMORY_WRITE_INVALIDATE; + } + else { + Value32 &= (~PCI_MEMORY_WRITE_INVALIDATE); + } + + /* save the value we are going to write into the PCI command word */ + pDevice->PciCommandStatusWords = Value32; + + Status = MM_WriteConfig32(pDevice, PCI_COMMAND_REG, Value32); + if(Status != LM_STATUS_SUCCESS) + { + return Status; + } + + /* Set power state to D0. */ + LM_SetPowerState(pDevice, LM_POWER_STATE_D0); + + /* Setup the mode registers. */ + pDevice->MiscHostCtrl = + MISC_HOST_CTRL_MASK_PCI_INT | + MISC_HOST_CTRL_ENABLE_ENDIAN_WORD_SWAP | +#ifdef BIG_ENDIAN_HOST + MISC_HOST_CTRL_ENABLE_ENDIAN_BYTE_SWAP | +#endif /* BIG_ENDIAN_HOST */ + MISC_HOST_CTRL_ENABLE_INDIRECT_ACCESS | + MISC_HOST_CTRL_ENABLE_PCI_STATE_REG_RW; + /* write to PCI misc host ctr first in order to enable indirect accesses */ + MM_WriteConfig32(pDevice, T3_PCI_MISC_HOST_CTRL_REG, pDevice->MiscHostCtrl); + + REG_WR(pDevice, PciCfg.MiscHostCtrl, pDevice->MiscHostCtrl); + +#ifdef BIG_ENDIAN_HOST + Value32 = GRC_MODE_BYTE_SWAP_NON_FRAME_DATA | + GRC_MODE_WORD_SWAP_NON_FRAME_DATA; +#else + Value32 = GRC_MODE_BYTE_SWAP_NON_FRAME_DATA | GRC_MODE_BYTE_SWAP_DATA; +#endif + REG_WR(pDevice, Grc.Mode, Value32); + + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700) + { + REG_WR(pDevice, Grc.LocalCtrl, GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT1 | + GRC_MISC_LOCAL_CTRL_GPIO_OE1); + } + MM_Wait(40); + + /* Enable indirect memory access */ + REG_WR(pDevice, MemArbiter.Mode, T3_MEM_ARBITER_MODE_ENABLE); + + if (REG_RD(pDevice, PciCfg.ClockCtrl) & T3_PCI_44MHZ_CORE_CLOCK) + { + REG_WR(pDevice, PciCfg.ClockCtrl, T3_PCI_44MHZ_CORE_CLOCK | + T3_PCI_SELECT_ALTERNATE_CLOCK); + MM_Wait(40); /* required delay is 27usec */ + REG_WR(pDevice, PciCfg.ClockCtrl, T3_PCI_SELECT_ALTERNATE_CLOCK); + MM_Wait(40); /* required delay is 27usec */ + } + REG_WR(pDevice, PciCfg.ClockCtrl, 0); + MM_Wait(40); /* required delay is 27usec */ + REG_WR(pDevice, PciCfg.MemWindowBaseAddr, 0); + +#if PCIX_TARGET_WORKAROUND + MM_ReadConfig32(pDevice, T3_PCI_STATE_REG, &Value32); + if ((pDevice->EnablePciXFix == FALSE) && + ((Value32 & T3_PCI_STATE_CONVENTIONAL_PCI_MODE) == 0)) + { + if (pDevice->ChipRevId == T3_CHIP_ID_5701_A0 || + pDevice->ChipRevId == T3_CHIP_ID_5701_B0 || + pDevice->ChipRevId == T3_CHIP_ID_5701_B2 || + pDevice->ChipRevId == T3_CHIP_ID_5701_B5) + { + __raw_writel(0, &(pDevice->pMemView->uIntMem.MemBlock32K[0x300])); + __raw_writel(0, &(pDevice->pMemView->uIntMem.MemBlock32K[0x301])); + __raw_writel(0xffffffff, &(pDevice->pMemView->uIntMem.MemBlock32K[0x301])); + if (__raw_readl(&(pDevice->pMemView->uIntMem.MemBlock32K[0x300]))) + { + pDevice->EnablePciXFix = TRUE; + } + } + } +#endif + + LM_NvramInit(pDevice); + + /* Get the node address. First try to get in from the shared memory. */ + /* If the signature is not present, then get it from the NVRAM. */ + Value32 = MEM_RD_OFFSET(pDevice, T3_MAC_ADDR_HIGH_MAILBOX); + if((Value32 >> 16) == 0x484b) + { + + pDevice->NodeAddress[0] = (LM_UINT8) (Value32 >> 8); + pDevice->NodeAddress[1] = (LM_UINT8) Value32; + + Value32 = MEM_RD_OFFSET(pDevice, T3_MAC_ADDR_LOW_MAILBOX); + + pDevice->NodeAddress[2] = (LM_UINT8) (Value32 >> 24); + pDevice->NodeAddress[3] = (LM_UINT8) (Value32 >> 16); + pDevice->NodeAddress[4] = (LM_UINT8) (Value32 >> 8); + pDevice->NodeAddress[5] = (LM_UINT8) Value32; + + Status = LM_STATUS_SUCCESS; + } + else + { + Status = LM_NvramRead(pDevice, 0x7c, &Value32); + if(Status == LM_STATUS_SUCCESS) + { + pDevice->NodeAddress[0] = (LM_UINT8) (Value32 >> 16); + pDevice->NodeAddress[1] = (LM_UINT8) (Value32 >> 24); + + Status = LM_NvramRead(pDevice, 0x80, &Value32); + + pDevice->NodeAddress[2] = (LM_UINT8) Value32; + pDevice->NodeAddress[3] = (LM_UINT8) (Value32 >> 8); + pDevice->NodeAddress[4] = (LM_UINT8) (Value32 >> 16); + pDevice->NodeAddress[5] = (LM_UINT8) (Value32 >> 24); + } + } + + /* Assign a default address. */ + if(Status != LM_STATUS_SUCCESS) + { + printk(KERN_ERR "Cannot get MAC addr from NVRAM\n"); + return LM_STATUS_FAILURE; + } + + pDevice->PermanentNodeAddress[0] = pDevice->NodeAddress[0]; + pDevice->PermanentNodeAddress[1] = pDevice->NodeAddress[1]; + pDevice->PermanentNodeAddress[2] = pDevice->NodeAddress[2]; + pDevice->PermanentNodeAddress[3] = pDevice->NodeAddress[3]; + pDevice->PermanentNodeAddress[4] = pDevice->NodeAddress[4]; + pDevice->PermanentNodeAddress[5] = pDevice->NodeAddress[5]; + + /* Initialize the default values. */ + pDevice->NoTxPseudoHdrChksum = FALSE; + pDevice->NoRxPseudoHdrChksum = FALSE; + pDevice->NicSendBd = FALSE; + pDevice->TxPacketDescCnt = DEFAULT_TX_PACKET_DESC_COUNT; + pDevice->RxStdDescCnt = DEFAULT_STD_RCV_DESC_COUNT; + pDevice->RxCoalescingTicks = DEFAULT_RX_COALESCING_TICKS; + pDevice->TxCoalescingTicks = DEFAULT_TX_COALESCING_TICKS; + pDevice->RxMaxCoalescedFrames = DEFAULT_RX_MAX_COALESCED_FRAMES; + pDevice->TxMaxCoalescedFrames = DEFAULT_TX_MAX_COALESCED_FRAMES; + pDevice->RxCoalescingTicksDuringInt = BAD_DEFAULT_VALUE; + pDevice->TxCoalescingTicksDuringInt = BAD_DEFAULT_VALUE; + pDevice->RxMaxCoalescedFramesDuringInt = BAD_DEFAULT_VALUE; + pDevice->TxMaxCoalescedFramesDuringInt = BAD_DEFAULT_VALUE; + pDevice->StatsCoalescingTicks = DEFAULT_STATS_COALESCING_TICKS; + pDevice->EnableMWI = FALSE; + pDevice->TxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC; + pDevice->RxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC; + pDevice->DisableAutoNeg = FALSE; + pDevice->PhyIntMode = T3_PHY_INT_MODE_AUTO; + pDevice->LinkChngMode = T3_LINK_CHNG_MODE_AUTO; + pDevice->LedMode = LED_MODE_AUTO; + pDevice->ResetPhyOnInit = TRUE; + pDevice->DelayPciGrant = TRUE; + pDevice->UseTaggedStatus = FALSE; + pDevice->OneDmaAtOnce = BAD_DEFAULT_VALUE; + + pDevice->DmaMbufLowMark = T3_DEF_DMA_MBUF_LOW_WMARK_JUMBO; + pDevice->RxMacMbufLowMark = T3_DEF_RX_MAC_MBUF_LOW_WMARK_JUMBO; + pDevice->MbufHighMark = T3_DEF_MBUF_HIGH_WMARK_JUMBO; + + pDevice->RequestedMediaType = LM_REQUESTED_MEDIA_TYPE_AUTO; + pDevice->TaskOffloadCap = LM_TASK_OFFLOAD_NONE; + pDevice->FlowControlCap = LM_FLOW_CONTROL_AUTO_PAUSE; + pDevice->EnableTbi = FALSE; +#if INCLUDE_TBI_SUPPORT + pDevice->PollTbiLink = BAD_DEFAULT_VALUE; +#endif + + pDevice->MbufBase = T3_NIC_MBUF_POOL_ADDR; + pDevice->MbufSize = T3_NIC_MBUF_POOL_SIZE; + + pDevice->LinkStatus = LM_STATUS_LINK_DOWN; + pDevice->QueueRxPackets = TRUE; + + pDevice->EnableWireSpeed = TRUE; + +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + pDevice->RxJumboDescCnt = DEFAULT_JUMBO_RCV_DESC_COUNT; +#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */ + + /* Make this is a known adapter. */ + pAdapterInfo = LM_GetAdapterInfoBySsid(pDevice->SubsystemVendorId, + pDevice->SubsystemId); + + pDevice->BondId = REG_RD(pDevice, Grc.MiscCfg) & GRC_MISC_BD_ID_MASK; + if(((T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) && + ((pDevice->BondId == 0x10000) || (pDevice->BondId == 0x18000))) || + ((T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5703) && + ((pDevice->BondId == 0x14000) || (pDevice->BondId == 0x1c000)))) + { + return LM_STATUS_UNKNOWN_ADAPTER; + } + + /* Get Eeprom info. */ + Value32 = MEM_RD_OFFSET(pDevice, T3_NIC_DATA_SIG_ADDR); + if (Value32 == T3_NIC_DATA_SIG) + { + EeSigFound = TRUE; + Value32 = MEM_RD_OFFSET(pDevice, T3_NIC_DATA_NIC_CFG_ADDR); + + /* Determine PHY type. */ + switch (Value32 & T3_NIC_CFG_PHY_TYPE_MASK) + { + case T3_NIC_CFG_PHY_TYPE_COPPER: + EePhyTypeSerdes = FALSE; + break; + + case T3_NIC_CFG_PHY_TYPE_FIBER: + EePhyTypeSerdes = TRUE; + break; + + default: + EePhyTypeSerdes = FALSE; + break; + } + + /* Determine PHY led mode. */ + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 || + T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) + { + switch(Value32 & T3_NIC_CFG_LED_MODE_MASK) + { + case T3_NIC_CFG_LED_MODE_TRIPLE_SPEED: + EePhyLedMode = LED_MODE_THREE_LINK; + break; + + case T3_NIC_CFG_LED_MODE_LINK_SPEED: + EePhyLedMode = LED_MODE_LINK10; + break; + + default: + EePhyLedMode = LED_MODE_AUTO; + break; + } + } + else + { + switch(Value32 & T3_NIC_CFG_LED_MODE_MASK) + { + case T3_NIC_CFG_LED_MODE_OPEN_DRAIN: + EePhyLedMode = LED_MODE_OPEN_DRAIN; + break; + + case T3_NIC_CFG_LED_MODE_OUTPUT: + EePhyLedMode = LED_MODE_OUTPUT; + break; + + default: + EePhyLedMode = LED_MODE_AUTO; + break; + } + } + if(pDevice->ChipRevId == T3_CHIP_ID_5703_A1 || + pDevice->ChipRevId == T3_CHIP_ID_5703_A2) + { + /* Enable EEPROM write protection. */ + if(Value32 & T3_NIC_EEPROM_WP) + { + pDevice->EepromWp = TRUE; + } + } + + /* Get the PHY Id. */ + Value32 = MEM_RD_OFFSET(pDevice, T3_NIC_DATA_PHY_ID_ADDR); + if (Value32) + { + EePhyId = (((Value32 & T3_NIC_PHY_ID1_MASK) >> 16) & + PHY_ID1_OUI_MASK) << 10; + + Value32 = Value32 & T3_NIC_PHY_ID2_MASK; + + EePhyId |= ((Value32 & PHY_ID2_OUI_MASK) << 16) | + (Value32 & PHY_ID2_MODEL_MASK) | (Value32 & PHY_ID2_REV_MASK); + } + else + { + EePhyId = 0; + } + } + else + { + EeSigFound = FALSE; + } + + /* Set the PHY address. */ + pDevice->PhyAddr = PHY_DEVICE_ID; + + /* Disable auto polling. */ + pDevice->MiMode = 0xc0000; + REG_WR(pDevice, MacCtrl.MiMode, pDevice->MiMode); + MM_Wait(40); + + /* Get the PHY id. */ + LM_ReadPhy(pDevice, PHY_ID1_REG, &Value32); + pDevice->PhyId = (Value32 & PHY_ID1_OUI_MASK) << 10; + + LM_ReadPhy(pDevice, PHY_ID2_REG, &Value32); + pDevice->PhyId |= ((Value32 & PHY_ID2_OUI_MASK) << 16) | + (Value32 & PHY_ID2_MODEL_MASK) | (Value32 & PHY_ID2_REV_MASK); + + /* Set the EnableTbi flag to false if we have a copper PHY. */ + switch(pDevice->PhyId & PHY_ID_MASK) + { + case PHY_BCM5400_PHY_ID: + pDevice->EnableTbi = FALSE; + break; + + case PHY_BCM5401_PHY_ID: + pDevice->EnableTbi = FALSE; + break; + + case PHY_BCM5411_PHY_ID: + pDevice->EnableTbi = FALSE; + break; + + case PHY_BCM5701_PHY_ID: + pDevice->EnableTbi = FALSE; + break; + + case PHY_BCM5703_PHY_ID: + pDevice->EnableTbi = FALSE; + break; + + case PHY_BCM8002_PHY_ID: + pDevice->EnableTbi = TRUE; + break; + + default: + + if (pAdapterInfo) + { + pDevice->PhyId = pAdapterInfo->PhyId; + pDevice->EnableTbi = pAdapterInfo->Serdes; + } + else if (EeSigFound) + { + pDevice->PhyId = EePhyId; + pDevice->EnableTbi = EePhyTypeSerdes; + } + break; + } + + /* Bail out if we don't know the copper PHY id. */ + if(UNKNOWN_PHY_ID(pDevice->PhyId) && !pDevice->EnableTbi) + { + return LM_STATUS_FAILURE; + } + + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5703) + { + if((pDevice->SavedCacheLineReg & 0xff00) < 0x4000) + { + pDevice->SavedCacheLineReg &= 0xffff00ff; + pDevice->SavedCacheLineReg |= 0x4000; + } + } + /* Change driver parameters. */ + Status = MM_GetConfig(pDevice); + if(Status != LM_STATUS_SUCCESS) + { + return Status; + } + +#if INCLUDE_5701_AX_FIX + if (pDevice->ChipRevId == T3_CHIP_ID_5701_A0 || + pDevice->ChipRevId == T3_CHIP_ID_5701_B0) + { + pDevice->ResetPhyOnInit = TRUE; + } +#endif + + /* Save the current phy link status. */ + if(!pDevice->EnableTbi) + { + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + + /* If we don't have link reset the PHY. */ + if(!(Value32 & PHY_STATUS_LINK_PASS) || pDevice->ResetPhyOnInit) + { + + LM_WritePhy(pDevice, PHY_CTRL_REG, PHY_CTRL_PHY_RESET); + + for(j = 0; j < 100; j++) + { + MM_Wait(10); + + LM_ReadPhy(pDevice, PHY_CTRL_REG, &Value32); + if(Value32 && !(Value32 & PHY_CTRL_PHY_RESET)) + { + MM_Wait(40); + break; + } + } + + +#if INCLUDE_5701_AX_FIX + /* 5701_AX_BX bug: only advertises 10mb speed. */ + if(pDevice->ChipRevId == T3_CHIP_ID_5701_A0 || + pDevice->ChipRevId == T3_CHIP_ID_5701_B0) + { + + Value32 = PHY_AN_AD_PROTOCOL_802_3_CSMA_CD | + PHY_AN_AD_10BASET_HALF | PHY_AN_AD_10BASET_FULL | + PHY_AN_AD_100BASETX_FULL | PHY_AN_AD_100BASETX_HALF; + Value32 |= GetPhyAdFlowCntrlSettings(pDevice); + LM_WritePhy(pDevice, PHY_AN_AD_REG, Value32); + pDevice->advertising = Value32; + + Value32 = BCM540X_AN_AD_1000BASET_HALF | + BCM540X_AN_AD_1000BASET_FULL | BCM540X_CONFIG_AS_MASTER | + BCM540X_ENABLE_CONFIG_AS_MASTER; + LM_WritePhy(pDevice, BCM540X_1000BASET_CTRL_REG, Value32); + pDevice->advertising1000 = Value32; + + LM_WritePhy(pDevice, PHY_CTRL_REG, PHY_CTRL_AUTO_NEG_ENABLE | + PHY_CTRL_RESTART_AUTO_NEG); + } +#endif + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5703) + { + LM_WritePhy(pDevice, 0x18, 0x0c00); + LM_WritePhy(pDevice, 0x17, 0x201f); + LM_WritePhy(pDevice, 0x15, 0x2aaa); + } + /* Enable Ethernet@WireSpeed. */ + if(pDevice->EnableWireSpeed) + { + LM_WritePhy(pDevice, 0x18, 0x7007); + LM_ReadPhy(pDevice, 0x18, &Value32); + LM_WritePhy(pDevice, 0x18, Value32 | BIT_15 | BIT_4); + } + } + } + + /* Turn off tap power management. */ + if((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5401_PHY_ID) + { + LM_WritePhy(pDevice, BCM5401_AUX_CTRL, 0x0c20); + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x0012); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x1804); + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x0013); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x1204); + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x8006); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x0132); + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x8006); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x0232); + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x201f); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x0a20); + + MM_Wait(40); + } + +#if INCLUDE_TBI_SUPPORT + if(pDevice->EnableTbi) + { + pDevice->WakeUpModeCap = LM_WAKE_UP_MODE_NONE; + pDevice->PhyIntMode = T3_PHY_INT_MODE_LINK_READY; + if ((pDevice->PollTbiLink == BAD_DEFAULT_VALUE) || + pDevice->DisableAutoNeg) + { + pDevice->PollTbiLink = FALSE; + } + } + else + { + pDevice->PollTbiLink = FALSE; + } +#endif /* INCLUDE_TBI_SUPPORT */ + + /* UseTaggedStatus is only valid for 5701 and later. */ + if (T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700) + { + pDevice->UseTaggedStatus = FALSE; + + pDevice->CoalesceMode = 0; + } + else + { + pDevice->CoalesceMode = HOST_COALESCE_CLEAR_TICKS_ON_RX_BD_EVENT | + HOST_COALESCE_CLEAR_TICKS_ON_TX_BD_EVENT; + } + + /* Set the status block size. */ + if(T3_CHIP_REV(pDevice->ChipRevId) != T3_CHIP_REV_5700_AX && + T3_CHIP_REV(pDevice->ChipRevId) != T3_CHIP_REV_5700_BX) + { + pDevice->CoalesceMode |= HOST_COALESCE_32_BYTE_STATUS_MODE; + } + + /* Check the DURING_INT coalescing ticks parameters. */ + if(pDevice->UseTaggedStatus) + { + if(pDevice->RxCoalescingTicksDuringInt == BAD_DEFAULT_VALUE) + { + pDevice->RxCoalescingTicksDuringInt = + DEFAULT_RX_COALESCING_TICKS_DURING_INT; + } + + if(pDevice->TxCoalescingTicksDuringInt == BAD_DEFAULT_VALUE) + { + pDevice->TxCoalescingTicksDuringInt = + DEFAULT_TX_COALESCING_TICKS_DURING_INT; + } + + if(pDevice->RxMaxCoalescedFramesDuringInt == BAD_DEFAULT_VALUE) + { + pDevice->RxMaxCoalescedFramesDuringInt = + DEFAULT_RX_MAX_COALESCED_FRAMES_DURING_INT; + } + + if(pDevice->TxMaxCoalescedFramesDuringInt == BAD_DEFAULT_VALUE) + { + pDevice->TxMaxCoalescedFramesDuringInt = + DEFAULT_TX_MAX_COALESCED_FRAMES_DURING_INT; + } + } + else + { + if(pDevice->RxCoalescingTicksDuringInt == BAD_DEFAULT_VALUE) + { + pDevice->RxCoalescingTicksDuringInt = 0; + } + + if(pDevice->TxCoalescingTicksDuringInt == BAD_DEFAULT_VALUE) + { + pDevice->TxCoalescingTicksDuringInt = 0; + } + + if(pDevice->RxMaxCoalescedFramesDuringInt == BAD_DEFAULT_VALUE) + { + pDevice->RxMaxCoalescedFramesDuringInt = 0; + } + + if(pDevice->TxMaxCoalescedFramesDuringInt == BAD_DEFAULT_VALUE) + { + pDevice->TxMaxCoalescedFramesDuringInt = 0; + } + } + +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + if(pDevice->RxMtu <= (MAX_STD_RCV_BUFFER_SIZE - 8 /* CRC */)) + { + pDevice->RxJumboDescCnt = 0; + if(pDevice->RxMtu <= MAX_ETHERNET_PACKET_SIZE_NO_CRC) + { + pDevice->RxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC; + } + } + else + { + pDevice->RxJumboBufferSize = (pDevice->RxMtu + 8 /* CRC + VLAN */ + + COMMON_CACHE_LINE_SIZE-1) & ~COMMON_CACHE_LINE_MASK; + + if(pDevice->RxJumboBufferSize > MAX_JUMBO_RCV_BUFFER_SIZE) + { + pDevice->RxJumboBufferSize = DEFAULT_JUMBO_RCV_BUFFER_SIZE; + pDevice->RxMtu = pDevice->RxJumboBufferSize - 8 /* CRC + VLAN */; + } + pDevice->TxMtu = pDevice->RxMtu; + + } +#else + pDevice->RxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC; +#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */ + + pDevice->RxPacketDescCnt = +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + pDevice->RxJumboDescCnt + +#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */ + pDevice->RxStdDescCnt; + + if(pDevice->TxMtu < MAX_ETHERNET_PACKET_SIZE_NO_CRC) + { + pDevice->TxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC; + } + + if(pDevice->TxMtu > MAX_JUMBO_TX_BUFFER_SIZE) + { + pDevice->TxMtu = MAX_JUMBO_TX_BUFFER_SIZE; + } + + /* Configure the proper ways to get link change interrupt. */ + if(pDevice->PhyIntMode == T3_PHY_INT_MODE_AUTO) + { + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700) + { + pDevice->PhyIntMode = T3_PHY_INT_MODE_MI_INTERRUPT; + } + else + { + pDevice->PhyIntMode = T3_PHY_INT_MODE_LINK_READY; + } + } + else if(pDevice->PhyIntMode == T3_PHY_INT_MODE_AUTO_POLLING) + { + /* Auto-polling does not work on 5700_AX and 5700_BX. */ + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700) + { + pDevice->PhyIntMode = T3_PHY_INT_MODE_MI_INTERRUPT; + } + } + + /* Determine the method to get link change status. */ + if(pDevice->LinkChngMode == T3_LINK_CHNG_MODE_AUTO) + { + /* The link status bit in the status block does not work on 5700_AX */ + /* and 5700_BX chips. */ + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700) + { + pDevice->LinkChngMode = T3_LINK_CHNG_MODE_USE_STATUS_REG; + } + else + { + pDevice->LinkChngMode = T3_LINK_CHNG_MODE_USE_STATUS_BLOCK; + } + } + + if(pDevice->PhyIntMode == T3_PHY_INT_MODE_MI_INTERRUPT || + T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700) + { + pDevice->LinkChngMode = T3_LINK_CHNG_MODE_USE_STATUS_REG; + } + + /* Configure PHY led mode. */ + if(pDevice->LedMode == LED_MODE_AUTO) + { + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 || + T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) + { + if(pDevice->SubsystemVendorId == T3_SVID_DELL) + { + pDevice->LedMode = LED_MODE_LINK10; + } + else + { + pDevice->LedMode = LED_MODE_THREE_LINK; + + if(EeSigFound && EePhyLedMode != LED_MODE_AUTO) + { + pDevice->LedMode = EePhyLedMode; + } + } + + /* bug? 5701 in LINK10 mode does not seem to work when */ + /* PhyIntMode is LINK_READY. */ + if(T3_ASIC_REV(pDevice->ChipRevId) != T3_ASIC_REV_5700 && +#if INCLUDE_TBI_SUPPORT + pDevice->EnableTbi == FALSE && +#endif + pDevice->LedMode == LED_MODE_LINK10) + { + pDevice->PhyIntMode = T3_PHY_INT_MODE_MI_INTERRUPT; + pDevice->LinkChngMode = T3_LINK_CHNG_MODE_USE_STATUS_REG; + } + + if(pDevice->EnableTbi) + { + pDevice->LedMode = LED_MODE_THREE_LINK; + } + } + else + { + if(EeSigFound && EePhyLedMode != LED_MODE_AUTO) + { + pDevice->LedMode = EePhyLedMode; + } + else + { + pDevice->LedMode = LED_MODE_OPEN_DRAIN; + } + } + } + + /* Enable OneDmaAtOnce. */ + if(pDevice->OneDmaAtOnce == BAD_DEFAULT_VALUE) + { + pDevice->OneDmaAtOnce = FALSE; + } + + if (T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 || + pDevice->ChipRevId == T3_CHIP_ID_5701_A0 || + pDevice->ChipRevId == T3_CHIP_ID_5701_B0 || + pDevice->ChipRevId == T3_CHIP_ID_5701_B2) + { + pDevice->WolSpeed = WOL_SPEED_10MB; + } + else + { + pDevice->WolSpeed = WOL_SPEED_100MB; + } + + /* Offloadings. */ + pDevice->TaskToOffload = LM_TASK_OFFLOAD_NONE; + + /* Turn off task offloading on Ax. */ + if(pDevice->ChipRevId == T3_CHIP_ID_5700_B0) + { + pDevice->TaskOffloadCap &= ~(LM_TASK_OFFLOAD_TX_TCP_CHECKSUM | + LM_TASK_OFFLOAD_TX_UDP_CHECKSUM); + } + pDevice->PciState = REG_RD(pDevice, PciCfg.PciState); + LM_ReadVPD(pDevice); + LM_ReadBootCodeVersion(pDevice); + LM_GetBusSpeed(pDevice); + + return LM_STATUS_SUCCESS; +} /* LM_GetAdapterInfo */ + +STATIC PLM_ADAPTER_INFO +LM_GetAdapterInfoBySsid( + LM_UINT16 Svid, + LM_UINT16 Ssid) +{ + static LM_ADAPTER_INFO AdapterArr[] = + { + { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95700A6, PHY_BCM5401_PHY_ID, 0}, + { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701A5, PHY_BCM5701_PHY_ID, 0}, + { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95700T6, PHY_BCM8002_PHY_ID, 1}, + { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95700A9, 0, 1 }, + { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701T1, PHY_BCM5701_PHY_ID, 0}, + { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701T8, PHY_BCM5701_PHY_ID, 0}, + { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701A7, 0, 1}, + { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701A10, PHY_BCM5701_PHY_ID, 0}, + { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701A12, PHY_BCM5701_PHY_ID, 0}, + { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95703Ax1, PHY_BCM5701_PHY_ID, 0}, + { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95703Ax2, PHY_BCM5701_PHY_ID, 0}, + + { T3_SVID_3COM, T3_SSID_3COM_3C996T, PHY_BCM5401_PHY_ID, 0 }, + { T3_SVID_3COM, T3_SSID_3COM_3C996BT, PHY_BCM5701_PHY_ID, 0 }, + { T3_SVID_3COM, T3_SSID_3COM_3C996SX, 0, 1 }, + { T3_SVID_3COM, T3_SSID_3COM_3C1000T, PHY_BCM5701_PHY_ID, 0 }, + { T3_SVID_3COM, T3_SSID_3COM_3C940BR01, PHY_BCM5701_PHY_ID, 0 }, + + { T3_SVID_DELL, T3_SSID_DELL_VIPER, PHY_BCM5401_PHY_ID, 0 }, + { T3_SVID_DELL, T3_SSID_DELL_JAGUAR, PHY_BCM5401_PHY_ID, 0 }, + { T3_SVID_DELL, T3_SSID_DELL_MERLOT, PHY_BCM5411_PHY_ID, 0 }, + { T3_SVID_DELL, T3_SSID_DELL_SLIM_MERLOT, PHY_BCM5411_PHY_ID, 0 }, + + { T3_SVID_COMPAQ, T3_SSID_COMPAQ_BANSHEE, PHY_BCM5701_PHY_ID, 0 }, + { T3_SVID_COMPAQ, T3_SSID_COMPAQ_BANSHEE_2, PHY_BCM5701_PHY_ID, 0 }, + { T3_SVID_COMPAQ, T3_SSID_COMPAQ_CHANGELING, 0, 1 }, + { T3_SVID_COMPAQ, T3_SSID_COMPAQ_NC7780, PHY_BCM5701_PHY_ID, 0 }, + { T3_SVID_COMPAQ, T3_SSID_COMPAQ_NC7780_2, PHY_BCM5701_PHY_ID, 0 }, + + }; + LM_UINT32 j; + + for(j = 0; j < sizeof(AdapterArr)/sizeof(LM_ADAPTER_INFO); j++) + { + if(AdapterArr[j].Svid == Svid && AdapterArr[j].Ssid == Ssid) + { + return &AdapterArr[j]; + } + } + + return NULL; +} + + +/******************************************************************************/ +/* Description: */ +/* This routine sets up receive/transmit buffer descriptions queues. */ +/* */ +/* Return: */ +/* LM_STATUS_SUCCESS */ +/******************************************************************************/ +LM_STATUS +LM_InitializeAdapter( +PLM_DEVICE_BLOCK pDevice) +{ + LM_PHYSICAL_ADDRESS MemPhy; + PLM_UINT8 pMemVirt; + PLM_PACKET pPacket; + LM_STATUS Status; + LM_UINT32 Size; + LM_UINT32 j; + + /* Set power state to D0. */ + LM_SetPowerState(pDevice, LM_POWER_STATE_D0); + + /* Intialize the queues. */ + QQ_InitQueue(&pDevice->RxPacketReceivedQ.Container, + MAX_RX_PACKET_DESC_COUNT); + QQ_InitQueue(&pDevice->RxPacketFreeQ.Container, + MAX_RX_PACKET_DESC_COUNT); + + QQ_InitQueue(&pDevice->TxPacketFreeQ.Container,MAX_TX_PACKET_DESC_COUNT); + QQ_InitQueue(&pDevice->TxPacketActiveQ.Container,MAX_TX_PACKET_DESC_COUNT); + QQ_InitQueue(&pDevice->TxPacketXmittedQ.Container,MAX_TX_PACKET_DESC_COUNT); + + /* Allocate shared memory for: status block, the buffers for receive */ + /* rings -- standard, mini, jumbo, and return rings. */ + Size = T3_STATUS_BLOCK_SIZE + sizeof(T3_STATS_BLOCK) + + T3_STD_RCV_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD) + +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + T3_JUMBO_RCV_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD) + +#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */ + T3_RCV_RETURN_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD); + + /* Memory for host based Send BD. */ + if(pDevice->NicSendBd == FALSE) + { + Size += sizeof(T3_SND_BD) * T3_SEND_RCB_ENTRY_COUNT; + } + + /* Allocate the memory block. */ + Status = MM_AllocateSharedMemory(pDevice, Size, (PLM_VOID) &pMemVirt, &MemPhy, FALSE); + if(Status != LM_STATUS_SUCCESS) + { + return Status; + } + + /* Program DMA Read/Write */ + if (pDevice->PciState & T3_PCI_STATE_NOT_PCI_X_BUS) + { + pDevice->DmaReadWriteCtrl = 0x763f000f; + } + else + { + LM_UINT32 Value32; + + pDevice->DmaReadWriteCtrl = 0x761b000f; + Value32 = REG_RD(pDevice, PciCfg.ClockCtrl) & 0x1f; + if((T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5703) && + ((Value32 == 6) || (Value32 == 7))) + { + pDevice->OneDmaAtOnce = TRUE; + } + } + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5703) + { + pDevice->DmaReadWriteCtrl &= 0xfffffff0; + } + + if(pDevice->OneDmaAtOnce) + { + pDevice->DmaReadWriteCtrl |= DMA_CTRL_WRITE_ONE_DMA_AT_ONCE; + } + REG_WR(pDevice, PciCfg.DmaReadWriteCtrl, pDevice->DmaReadWriteCtrl); + + if (LM_DmaTest(pDevice, pMemVirt, MemPhy, 0x400) != LM_STATUS_SUCCESS) + { + return LM_STATUS_FAILURE; + } + + /* Status block. */ + pDevice->pStatusBlkVirt = (PT3_STATUS_BLOCK) pMemVirt; + pDevice->StatusBlkPhy = MemPhy; + pMemVirt += T3_STATUS_BLOCK_SIZE; + LM_INC_PHYSICAL_ADDRESS(&MemPhy, T3_STATUS_BLOCK_SIZE); + + /* Statistics block. */ + pDevice->pStatsBlkVirt = (PT3_STATS_BLOCK) pMemVirt; + pDevice->StatsBlkPhy = MemPhy; + pMemVirt += sizeof(T3_STATS_BLOCK); + LM_INC_PHYSICAL_ADDRESS(&MemPhy, sizeof(T3_STATS_BLOCK)); + + /* Receive standard BD buffer. */ + pDevice->pRxStdBdVirt = (PT3_RCV_BD) pMemVirt; + pDevice->RxStdBdPhy = MemPhy; + + pMemVirt += T3_STD_RCV_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD); + LM_INC_PHYSICAL_ADDRESS(&MemPhy, + T3_STD_RCV_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD)); + +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + /* Receive jumbo BD buffer. */ + pDevice->pRxJumboBdVirt = (PT3_RCV_BD) pMemVirt; + pDevice->RxJumboBdPhy = MemPhy; + + pMemVirt += T3_JUMBO_RCV_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD); + LM_INC_PHYSICAL_ADDRESS(&MemPhy, + T3_JUMBO_RCV_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD)); +#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */ + + /* Receive return BD buffer. */ + pDevice->pRcvRetBdVirt = (PT3_RCV_BD) pMemVirt; + pDevice->RcvRetBdPhy = MemPhy; + + pMemVirt += T3_RCV_RETURN_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD); + LM_INC_PHYSICAL_ADDRESS(&MemPhy, + T3_RCV_RETURN_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD)); + + /* Set up Send BD. */ + if(pDevice->NicSendBd == FALSE) + { + pDevice->pSendBdVirt = (PT3_SND_BD) pMemVirt; + pDevice->SendBdPhy = MemPhy; + + pMemVirt += sizeof(T3_SND_BD) * T3_SEND_RCB_ENTRY_COUNT; + LM_INC_PHYSICAL_ADDRESS(&MemPhy, + sizeof(T3_SND_BD) * T3_SEND_RCB_ENTRY_COUNT); + } + else + { + pDevice->pSendBdVirt = (PT3_SND_BD) + pDevice->pMemView->uIntMem.First32k.BufferDesc; + pDevice->SendBdPhy.High = 0; + pDevice->SendBdPhy.Low = T3_NIC_SND_BUFFER_DESC_ADDR; + } + + /* Allocate memory for packet descriptors. */ + Size = (pDevice->RxPacketDescCnt + + pDevice->TxPacketDescCnt) * MM_PACKET_DESC_SIZE; + Status = MM_AllocateMemory(pDevice, Size, (PLM_VOID *) &pPacket); + if(Status != LM_STATUS_SUCCESS) + { + return Status; + } + pDevice->pPacketDescBase = (PLM_VOID) pPacket; + + /* Create transmit packet descriptors from the memory block and add them */ + /* to the TxPacketFreeQ for each send ring. */ + for(j = 0; j < pDevice->TxPacketDescCnt; j++) + { + /* Ring index. */ + pPacket->Flags = 0; + + /* Queue the descriptor in the TxPacketFreeQ of the 'k' ring. */ + QQ_PushTail(&pDevice->TxPacketFreeQ.Container, pPacket); + + /* Get the pointer to the next descriptor. MM_PACKET_DESC_SIZE */ + /* is the total size of the packet descriptor including the */ + /* os-specific extensions in the UM_PACKET structure. */ + pPacket = (PLM_PACKET) ((PLM_UINT8) pPacket + MM_PACKET_DESC_SIZE); + } /* for(j.. */ + + /* Create receive packet descriptors from the memory block and add them */ + /* to the RxPacketFreeQ. Create the Standard packet descriptors. */ + for(j = 0; j < pDevice->RxStdDescCnt; j++) + { + /* Receive producer ring. */ + pPacket->u.Rx.RcvProdRing = T3_STD_RCV_PROD_RING; + + /* Receive buffer size. */ + pPacket->u.Rx.RxBufferSize = MAX_STD_RCV_BUFFER_SIZE; + + /* Add the descriptor to RxPacketFreeQ. */ + QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket); + + /* Get the pointer to the next descriptor. MM_PACKET_DESC_SIZE */ + /* is the total size of the packet descriptor including the */ + /* os-specific extensions in the UM_PACKET structure. */ + pPacket = (PLM_PACKET) ((PLM_UINT8) pPacket + MM_PACKET_DESC_SIZE); + } /* for */ + +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + /* Create the Jumbo packet descriptors. */ + for(j = 0; j < pDevice->RxJumboDescCnt; j++) + { + /* Receive producer ring. */ + pPacket->u.Rx.RcvProdRing = T3_JUMBO_RCV_PROD_RING; + + /* Receive buffer size. */ + pPacket->u.Rx.RxBufferSize = pDevice->RxJumboBufferSize; + + /* Add the descriptor to RxPacketFreeQ. */ + QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket); + + /* Get the pointer to the next descriptor. MM_PACKET_DESC_SIZE */ + /* is the total size of the packet descriptor including the */ + /* os-specific extensions in the UM_PACKET structure. */ + pPacket = (PLM_PACKET) ((PLM_UINT8) pPacket + MM_PACKET_DESC_SIZE); + } /* for */ +#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */ + + /* Initialize the rest of the packet descriptors. */ + Status = MM_InitializeUmPackets(pDevice); + if(Status != LM_STATUS_SUCCESS) + { + return Status; + } /* if */ + + /* Default receive mask. */ + pDevice->ReceiveMask = LM_ACCEPT_MULTICAST | LM_ACCEPT_BROADCAST | + LM_ACCEPT_UNICAST; + + /* Make sure we are in the first 32k memory window or NicSendBd. */ + REG_WR(pDevice, PciCfg.MemWindowBaseAddr, 0); + + /* Initialize the hardware. */ + Status = LM_ResetAdapter(pDevice); + if(Status != LM_STATUS_SUCCESS) + { + return Status; + } + + /* We are done with initialization. */ + pDevice->InitDone = TRUE; + + return LM_STATUS_SUCCESS; +} /* LM_InitializeAdapter */ + + + +/******************************************************************************/ +/* Description: */ +/* This function Enables/Disables a given block. */ +/* */ +/* Return: */ +/* LM_STATUS_SUCCESS */ +/******************************************************************************/ +LM_STATUS +LM_CntrlBlock( +PLM_DEVICE_BLOCK pDevice, +LM_UINT32 mask,LM_UINT32 cntrl) +{ + LM_UINT32 j,i,data; + LM_UINT32 MaxWaitCnt; + + MaxWaitCnt = 2; + j = 0; + + for(i = 0 ; i < 32; i++) + { + if(!(mask & (1 << i))) + continue; + + switch (1 << i) + { + case T3_BLOCK_DMA_RD: + data = REG_RD(pDevice, DmaRead.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~DMA_READ_MODE_ENABLE; + REG_WR(pDevice, DmaRead.Mode, data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, DmaRead.Mode) & DMA_READ_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, DmaRead.Mode, data | DMA_READ_MODE_ENABLE); + break; + + case T3_BLOCK_DMA_COMP: + data = REG_RD(pDevice,DmaComp.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~DMA_COMP_MODE_ENABLE; + REG_WR(pDevice, DmaComp.Mode, data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, DmaComp.Mode) & DMA_COMP_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, DmaComp.Mode, data | DMA_COMP_MODE_ENABLE); + break; + + case T3_BLOCK_RX_BD_INITIATOR: + data = REG_RD(pDevice, RcvBdIn.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~RCV_BD_IN_MODE_ENABLE; + REG_WR(pDevice, RcvBdIn.Mode,data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, RcvBdIn.Mode) & RCV_BD_IN_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, RcvBdIn.Mode,data | RCV_BD_IN_MODE_ENABLE); + break; + + case T3_BLOCK_RX_BD_COMP: + data = REG_RD(pDevice, RcvBdComp.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~RCV_BD_COMP_MODE_ENABLE; + REG_WR(pDevice, RcvBdComp.Mode,data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, RcvBdComp.Mode) & RCV_BD_COMP_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, RcvBdComp.Mode,data | RCV_BD_COMP_MODE_ENABLE); + break; + + case T3_BLOCK_DMA_WR: + data = REG_RD(pDevice, DmaWrite.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~DMA_WRITE_MODE_ENABLE; + REG_WR(pDevice, DmaWrite.Mode,data); + + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, DmaWrite.Mode) & DMA_WRITE_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, DmaWrite.Mode,data | DMA_WRITE_MODE_ENABLE); + break; + + case T3_BLOCK_MSI_HANDLER: + data = REG_RD(pDevice, Msi.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~MSI_MODE_ENABLE; + REG_WR(pDevice, Msi.Mode, data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, Msi.Mode) & MSI_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, Msi.Mode, data |MSI_MODE_ENABLE); + break; + + case T3_BLOCK_RX_LIST_PLMT: + data = REG_RD(pDevice, RcvListPlmt.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~RCV_LIST_PLMT_MODE_ENABLE; + REG_WR(pDevice, RcvListPlmt.Mode,data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, RcvListPlmt.Mode) & RCV_LIST_PLMT_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, RcvListPlmt.Mode,data | RCV_LIST_PLMT_MODE_ENABLE); + break; + + case T3_BLOCK_RX_LIST_SELECTOR: + data = REG_RD(pDevice, RcvListSel.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~RCV_LIST_SEL_MODE_ENABLE; + REG_WR(pDevice, RcvListSel.Mode,data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, RcvListSel.Mode) & RCV_LIST_SEL_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, RcvListSel.Mode,data |RCV_LIST_SEL_MODE_ENABLE); + break; + + case T3_BLOCK_RX_DATA_INITIATOR: + data = REG_RD(pDevice, RcvDataBdIn.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~RCV_DATA_BD_IN_MODE_ENABLE; + REG_WR(pDevice, RcvDataBdIn.Mode,data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, RcvDataBdIn.Mode) & RCV_DATA_BD_IN_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, RcvDataBdIn.Mode, data | RCV_DATA_BD_IN_MODE_ENABLE); + break; + + case T3_BLOCK_RX_DATA_COMP: + data = REG_RD(pDevice, RcvDataComp.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~RCV_DATA_COMP_MODE_ENABLE; + REG_WR(pDevice, RcvDataComp.Mode,data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, RcvDataBdIn.Mode) & RCV_DATA_COMP_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, RcvDataComp.Mode,data | RCV_DATA_COMP_MODE_ENABLE); + break; + + case T3_BLOCK_HOST_COALESING: + data = REG_RD(pDevice, HostCoalesce.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~HOST_COALESCE_ENABLE; + REG_WR(pDevice, HostCoalesce.Mode, data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, SndBdIn.Mode) & HOST_COALESCE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, HostCoalesce.Mode, data | HOST_COALESCE_ENABLE); + break; + + case T3_BLOCK_MAC_RX_ENGINE: + if(cntrl == LM_DISABLE) + { + pDevice->RxMode &= ~RX_MODE_ENABLE; + REG_WR(pDevice, MacCtrl.RxMode, pDevice->RxMode); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, MacCtrl.RxMode) & RX_MODE_ENABLE)) + { + break; + } + MM_Wait(10); + } + } + else + { + pDevice->RxMode |= RX_MODE_ENABLE; + REG_WR(pDevice, MacCtrl.RxMode, pDevice->RxMode); + } + break; + + case T3_BLOCK_MBUF_CLUSTER_FREE: + data = REG_RD(pDevice, MbufClusterFree.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~MBUF_CLUSTER_FREE_MODE_ENABLE; + REG_WR(pDevice, MbufClusterFree.Mode,data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, MbufClusterFree.Mode) & MBUF_CLUSTER_FREE_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, MbufClusterFree.Mode, data | MBUF_CLUSTER_FREE_MODE_ENABLE); + break; + + case T3_BLOCK_SEND_BD_INITIATOR: + data = REG_RD(pDevice, SndBdIn.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~SND_BD_IN_MODE_ENABLE; + REG_WR(pDevice, SndBdIn.Mode, data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, SndBdIn.Mode) & SND_BD_IN_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, SndBdIn.Mode, data | SND_BD_IN_MODE_ENABLE); + break; + + case T3_BLOCK_SEND_BD_COMP: + data = REG_RD(pDevice, SndBdComp.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~SND_BD_COMP_MODE_ENABLE; + REG_WR(pDevice, SndBdComp.Mode, data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, SndBdComp.Mode) & SND_BD_COMP_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, SndBdComp.Mode, data | SND_BD_COMP_MODE_ENABLE); + break; + + case T3_BLOCK_SEND_BD_SELECTOR: + data = REG_RD(pDevice, SndBdSel.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~SND_BD_SEL_MODE_ENABLE; + REG_WR(pDevice, SndBdSel.Mode, data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, SndBdSel.Mode) & SND_BD_SEL_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, SndBdSel.Mode, data | SND_BD_SEL_MODE_ENABLE); + break; + + case T3_BLOCK_SEND_DATA_INITIATOR: + data = REG_RD(pDevice, SndDataIn.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~T3_SND_DATA_IN_MODE_ENABLE; + REG_WR(pDevice, SndDataIn.Mode,data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, SndDataIn.Mode) & T3_SND_DATA_IN_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, SndDataIn.Mode,data | T3_SND_DATA_IN_MODE_ENABLE); + break; + + case T3_BLOCK_SEND_DATA_COMP: + data = REG_RD(pDevice, SndDataComp.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~SND_DATA_COMP_MODE_ENABLE; + REG_WR(pDevice, SndDataComp.Mode, data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, SndDataComp.Mode) & SND_DATA_COMP_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, SndDataComp.Mode,data | SND_DATA_COMP_MODE_ENABLE); + break; + + case T3_BLOCK_MAC_TX_ENGINE: + if(cntrl == LM_DISABLE) + { + pDevice->TxMode &= ~TX_MODE_ENABLE; + REG_WR(pDevice, MacCtrl.TxMode, pDevice->TxMode); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, MacCtrl.TxMode) & TX_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + { + pDevice->TxMode |= TX_MODE_ENABLE; + REG_WR(pDevice, MacCtrl.TxMode, pDevice->TxMode); + } + break; + + case T3_BLOCK_MEM_ARBITOR: + data = REG_RD(pDevice, MemArbiter.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~T3_MEM_ARBITER_MODE_ENABLE; + REG_WR(pDevice, MemArbiter.Mode, data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, MemArbiter.Mode) & T3_MEM_ARBITER_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, MemArbiter.Mode,data|T3_MEM_ARBITER_MODE_ENABLE); + break; + + case T3_BLOCK_MBUF_MANAGER: + data = REG_RD(pDevice, BufMgr.Mode); + if (cntrl == LM_DISABLE) + { + data &= ~BUFMGR_MODE_ENABLE; + REG_WR(pDevice, BufMgr.Mode,data); + for(j = 0; j < MaxWaitCnt; j++) + { + if(!(REG_RD(pDevice, BufMgr.Mode) & BUFMGR_MODE_ENABLE)) + break; + MM_Wait(10); + } + } + else + REG_WR(pDevice, BufMgr.Mode,data | BUFMGR_MODE_ENABLE); + break; + + case T3_BLOCK_MAC_GLOBAL: + if(cntrl == LM_DISABLE) + { + pDevice->MacMode &= ~(MAC_MODE_ENABLE_TDE | + MAC_MODE_ENABLE_RDE | + MAC_MODE_ENABLE_FHDE); + } + else + { + pDevice->MacMode |= (MAC_MODE_ENABLE_TDE | + MAC_MODE_ENABLE_RDE | + MAC_MODE_ENABLE_FHDE); + } + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode); + break; + + default: + return LM_STATUS_FAILURE; + } /* switch */ + + if(j >= MaxWaitCnt) + { + return LM_STATUS_FAILURE; + } + } + + return LM_STATUS_SUCCESS; +} + +/******************************************************************************/ +/* Description: */ +/* This function reinitializes the adapter. */ +/* */ +/* Return: */ +/* LM_STATUS_SUCCESS */ +/******************************************************************************/ +LM_STATUS +LM_ResetAdapter( +PLM_DEVICE_BLOCK pDevice) +{ + LM_UINT32 Value32; + LM_UINT32 j, k; + + /* Disable interrupt. */ + LM_DisableInterrupt(pDevice); + + /* May get a spurious interrupt */ + pDevice->pStatusBlkVirt->Status = STATUS_BLOCK_UPDATED; + + /* Disable transmit and receive DMA engines. Abort all pending requests. */ + if(pDevice->InitDone) + { + LM_Abort(pDevice); + } + + pDevice->ShuttingDown = FALSE; + + LM_ResetChip(pDevice); + + /* Bug: Athlon fix for B3 silicon only. This bit does not do anything */ + /* in other chip revisions. */ + if(pDevice->DelayPciGrant) + { + Value32 = REG_RD(pDevice, PciCfg.ClockCtrl); + REG_WR(pDevice, PciCfg.ClockCtrl, Value32 | BIT_31); + } + + /* Enable TaggedStatus mode. */ + if(pDevice->UseTaggedStatus) + { + pDevice->MiscHostCtrl |= MISC_HOST_CTRL_ENABLE_TAGGED_STATUS_MODE; + } + + /* Restore PCI configuration registers. */ + MM_WriteConfig32(pDevice, PCI_CACHE_LINE_SIZE_REG, + pDevice->SavedCacheLineReg); +// LM_RegWrInd(pDevice, PCI_SUBSYSTEM_VENDOR_ID_REG, +// (pDevice->SubsystemId << 16) | pDevice->SubsystemVendorId); + MM_WriteConfig32(pDevice, PCI_SUBSYSTEM_VENDOR_ID_REG, + (pDevice->SubsystemId << 16) | pDevice->SubsystemVendorId); + + /* Clear the statistics block. */ + for(j = 0x0300; j < 0x0b00; j++) + { + MEM_WR_OFFSET(pDevice, j, 0); + } + + /* Initialize the statistis Block */ + pDevice->pStatusBlkVirt->Status = 0; + pDevice->pStatusBlkVirt->RcvStdConIdx = 0; + pDevice->pStatusBlkVirt->RcvJumboConIdx = 0; + pDevice->pStatusBlkVirt->RcvMiniConIdx = 0; + + for(j = 0; j < 16; j++) + { + pDevice->pStatusBlkVirt->Idx[j].RcvProdIdx = 0; + pDevice->pStatusBlkVirt->Idx[j].SendConIdx = 0; + } + + for(k = 0; k < T3_STD_RCV_RCB_ENTRY_COUNT ;k++) + { + pDevice->pRxStdBdVirt[k].HostAddr.High = 0; + pDevice->pRxStdBdVirt[k].HostAddr.Low = 0; + } + +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + /* Receive jumbo BD buffer. */ + for(k = 0; k < T3_JUMBO_RCV_RCB_ENTRY_COUNT; k++) + { + pDevice->pRxJumboBdVirt[k].HostAddr.High = 0; + pDevice->pRxJumboBdVirt[k].HostAddr.Low = 0; + } +#endif + + REG_WR(pDevice, PciCfg.DmaReadWriteCtrl, pDevice->DmaReadWriteCtrl); + + /* GRC mode control register. */ + Value32 = +#ifdef BIG_ENDIAN_HOST + GRC_MODE_BYTE_SWAP_NON_FRAME_DATA | + GRC_MODE_WORD_SWAP_NON_FRAME_DATA | + GRC_MODE_BYTE_SWAP_DATA | + GRC_MODE_WORD_SWAP_DATA | +#else + GRC_MODE_WORD_SWAP_NON_FRAME_DATA | + GRC_MODE_BYTE_SWAP_DATA | + GRC_MODE_WORD_SWAP_DATA | +#endif + GRC_MODE_INT_ON_MAC_ATTN | + GRC_MODE_HOST_STACK_UP; + + /* Configure send BD mode. */ + if(pDevice->NicSendBd == FALSE) + { + Value32 |= GRC_MODE_HOST_SEND_BDS; + } + else + { + Value32 |= GRC_MODE_4X_NIC_BASED_SEND_RINGS; + } + + /* Configure pseudo checksum mode. */ + if(pDevice->NoTxPseudoHdrChksum) + { + Value32 |= GRC_MODE_TX_NO_PSEUDO_HEADER_CHKSUM; + } + + if(pDevice->NoRxPseudoHdrChksum) + { + Value32 |= GRC_MODE_RX_NO_PSEUDO_HEADER_CHKSUM; + } + + REG_WR(pDevice, Grc.Mode, Value32); + + /* Setup the timer prescalar register. */ + REG_WR(pDevice, Grc.MiscCfg, 65 << 1); /* Clock is alwasy 66Mhz. */ + + /* Set up the MBUF pool base address and size. */ + REG_WR(pDevice, BufMgr.MbufPoolAddr, pDevice->MbufBase); + REG_WR(pDevice, BufMgr.MbufPoolSize, pDevice->MbufSize); + + /* Set up the DMA descriptor pool base address and size. */ + REG_WR(pDevice, BufMgr.DmaDescPoolAddr, T3_NIC_DMA_DESC_POOL_ADDR); + REG_WR(pDevice, BufMgr.DmaDescPoolSize, T3_NIC_DMA_DESC_POOL_SIZE); + + /* Configure MBUF and Threshold watermarks */ + /* Configure the DMA read MBUF low water mark. */ + if(pDevice->DmaMbufLowMark) + { + REG_WR(pDevice, BufMgr.MbufReadDmaLowWaterMark, + pDevice->DmaMbufLowMark); + } + else + { + if(pDevice->TxMtu < MAX_ETHERNET_PACKET_BUFFER_SIZE) + { + REG_WR(pDevice, BufMgr.MbufReadDmaLowWaterMark, + T3_DEF_DMA_MBUF_LOW_WMARK); + } + else + { + REG_WR(pDevice, BufMgr.MbufReadDmaLowWaterMark, + T3_DEF_DMA_MBUF_LOW_WMARK_JUMBO); + } + } + + /* Configure the MAC Rx MBUF low water mark. */ + if(pDevice->RxMacMbufLowMark) + { + REG_WR(pDevice, BufMgr.MbufMacRxLowWaterMark, + pDevice->RxMacMbufLowMark); + } + else + { + if(pDevice->TxMtu < MAX_ETHERNET_PACKET_BUFFER_SIZE) + { + REG_WR(pDevice, BufMgr.MbufMacRxLowWaterMark, + T3_DEF_RX_MAC_MBUF_LOW_WMARK); + } + else + { + REG_WR(pDevice, BufMgr.MbufMacRxLowWaterMark, + T3_DEF_RX_MAC_MBUF_LOW_WMARK_JUMBO); + } + } + + /* Configure the MBUF high water mark. */ + if(pDevice->MbufHighMark) + { + REG_WR(pDevice, BufMgr.MbufHighWaterMark, pDevice->MbufHighMark); + } + else + { + if(pDevice->TxMtu < MAX_ETHERNET_PACKET_BUFFER_SIZE) + { + REG_WR(pDevice, BufMgr.MbufHighWaterMark, + T3_DEF_MBUF_HIGH_WMARK); + } + else + { + REG_WR(pDevice, BufMgr.MbufHighWaterMark, + T3_DEF_MBUF_HIGH_WMARK_JUMBO); + } + } + + REG_WR(pDevice, BufMgr.DmaLowWaterMark, T3_DEF_DMA_DESC_LOW_WMARK); + REG_WR(pDevice, BufMgr.DmaHighWaterMark, T3_DEF_DMA_DESC_HIGH_WMARK); + + /* Enable buffer manager. */ + REG_WR(pDevice, BufMgr.Mode, BUFMGR_MODE_ENABLE | BUFMGR_MODE_ATTN_ENABLE); + + for(j = 0 ;j < 2000; j++) + { + if(REG_RD(pDevice, BufMgr.Mode) & BUFMGR_MODE_ENABLE) + break; + MM_Wait(10); + } + + if(j >= 2000) + { + return LM_STATUS_FAILURE; + } + + /* Enable the FTQs. */ + REG_WR(pDevice, Ftq.Reset, 0xffffffff); + REG_WR(pDevice, Ftq.Reset, 0); + + /* Wait until FTQ is ready */ + for(j = 0; j < 2000; j++) + { + if(REG_RD(pDevice, Ftq.Reset) == 0) + break; + MM_Wait(10); + } + + if(j >= 2000) + { + return LM_STATUS_FAILURE; + } + + /* Initialize the Standard Receive RCB. */ + REG_WR(pDevice, RcvDataBdIn.StdRcvRcb.HostRingAddr.High, + pDevice->RxStdBdPhy.High); + REG_WR(pDevice, RcvDataBdIn.StdRcvRcb.HostRingAddr.Low, + pDevice->RxStdBdPhy.Low); + REG_WR(pDevice, RcvDataBdIn.StdRcvRcb.u.MaxLen_Flags, + MAX_STD_RCV_BUFFER_SIZE << 16); + + /* Initialize the Jumbo Receive RCB. */ + REG_WR(pDevice, RcvDataBdIn.JumboRcvRcb.u.MaxLen_Flags, + T3_RCB_FLAG_RING_DISABLED); +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + REG_WR(pDevice, RcvDataBdIn.JumboRcvRcb.HostRingAddr.High, + pDevice->RxJumboBdPhy.High); + REG_WR(pDevice, RcvDataBdIn.JumboRcvRcb.HostRingAddr.Low, + pDevice->RxJumboBdPhy.Low); + + REG_WR(pDevice, RcvDataBdIn.JumboRcvRcb.u.MaxLen_Flags, 0); + +#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */ + + /* Initialize the Mini Receive RCB. */ + REG_WR(pDevice, RcvDataBdIn.MiniRcvRcb.u.MaxLen_Flags, + T3_RCB_FLAG_RING_DISABLED); + + { + REG_WR(pDevice, RcvDataBdIn.StdRcvRcb.NicRingAddr, + (LM_UINT32) T3_NIC_STD_RCV_BUFFER_DESC_ADDR); + REG_WR(pDevice, RcvDataBdIn.JumboRcvRcb.NicRingAddr, + (LM_UINT32) T3_NIC_JUMBO_RCV_BUFFER_DESC_ADDR); + } + + /* Receive BD Ring replenish threshold. */ + REG_WR(pDevice, RcvBdIn.StdRcvThreshold, pDevice->RxStdDescCnt/8); +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + REG_WR(pDevice, RcvBdIn.JumboRcvThreshold, pDevice->RxJumboDescCnt/8); +#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */ + + /* Disable all the unused rings. */ + for(j = 0; j < T3_MAX_SEND_RCB_COUNT; j++) { + MEM_WR(pDevice, SendRcb[j].u.MaxLen_Flags, T3_RCB_FLAG_RING_DISABLED); + } /* for */ + + /* Initialize the indices. */ + pDevice->SendProdIdx = 0; + pDevice->SendConIdx = 0; + + MB_REG_WR(pDevice, Mailbox.SendHostProdIdx[0].Low, 0); + MB_REG_WR(pDevice, Mailbox.SendNicProdIdx[0].Low, 0); + + /* Set up host or NIC based send RCB. */ + if(pDevice->NicSendBd == FALSE) + { + MEM_WR(pDevice, SendRcb[0].HostRingAddr.High, + pDevice->SendBdPhy.High); + MEM_WR(pDevice, SendRcb[0].HostRingAddr.Low, + pDevice->SendBdPhy.Low); + + /* Set up the NIC ring address in the RCB. */ + MEM_WR(pDevice, SendRcb[0].NicRingAddr,T3_NIC_SND_BUFFER_DESC_ADDR); + + /* Setup the RCB. */ + MEM_WR(pDevice, SendRcb[0].u.MaxLen_Flags, + T3_SEND_RCB_ENTRY_COUNT << 16); + + for(k = 0; k < T3_SEND_RCB_ENTRY_COUNT; k++) + { + pDevice->pSendBdVirt[k].HostAddr.High = 0; + pDevice->pSendBdVirt[k].HostAddr.Low = 0; + } + } + else + { + MEM_WR(pDevice, SendRcb[0].HostRingAddr.High, 0); + MEM_WR(pDevice, SendRcb[0].HostRingAddr.Low, 0); + MEM_WR(pDevice, SendRcb[0].NicRingAddr, + pDevice->SendBdPhy.Low); + + for(k = 0; k < T3_SEND_RCB_ENTRY_COUNT; k++) + { + __raw_writel(0, &(pDevice->pSendBdVirt[k].HostAddr.High)); + __raw_writel(0, &(pDevice->pSendBdVirt[k].HostAddr.Low)); + __raw_writel(0, &(pDevice->pSendBdVirt[k].u1.Len_Flags)); + pDevice->ShadowSendBd[k].HostAddr.High = 0; + pDevice->ShadowSendBd[k].u1.Len_Flags = 0; + } + } + atomic_set(&pDevice->SendBdLeft, T3_SEND_RCB_ENTRY_COUNT-1); + + /* Configure the receive return rings. */ + for(j = 0; j < T3_MAX_RCV_RETURN_RCB_COUNT; j++) + { + MEM_WR(pDevice, RcvRetRcb[j].u.MaxLen_Flags, T3_RCB_FLAG_RING_DISABLED); + } + + pDevice->RcvRetConIdx = 0; + + MEM_WR(pDevice, RcvRetRcb[0].HostRingAddr.High, + pDevice->RcvRetBdPhy.High); + MEM_WR(pDevice, RcvRetRcb[0].HostRingAddr.Low, + pDevice->RcvRetBdPhy.Low); + + /* Set up the NIC ring address in the RCB. */ + /* Not very clear from the spec. I am guessing that for Receive */ + /* Return Ring, NicRingAddr is not used. */ + MEM_WR(pDevice, RcvRetRcb[0].NicRingAddr, 0); + + /* Setup the RCB. */ + MEM_WR(pDevice, RcvRetRcb[0].u.MaxLen_Flags, + T3_RCV_RETURN_RCB_ENTRY_COUNT << 16); + + /* Reinitialize RX ring producer index */ + MB_REG_WR(pDevice, Mailbox.RcvStdProdIdx.Low, 0); + MB_REG_WR(pDevice, Mailbox.RcvJumboProdIdx.Low, 0); + MB_REG_WR(pDevice, Mailbox.RcvMiniProdIdx.Low, 0); + +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + pDevice->RxJumboProdIdx = 0; + pDevice->RxJumboQueuedCnt = 0; +#endif + + /* Reinitialize our copy of the indices. */ + pDevice->RxStdProdIdx = 0; + pDevice->RxStdQueuedCnt = 0; + +#if T3_JUMBO_RCV_ENTRY_COUNT + pDevice->RxJumboProdIdx = 0; +#endif /* T3_JUMBO_RCV_ENTRY_COUNT */ + + /* Configure the MAC address. */ + LM_SetMacAddress(pDevice, pDevice->NodeAddress); + + /* Initialize the transmit random backoff seed. */ + Value32 = (pDevice->NodeAddress[0] + pDevice->NodeAddress[1] + + pDevice->NodeAddress[2] + pDevice->NodeAddress[3] + + pDevice->NodeAddress[4] + pDevice->NodeAddress[5]) & + MAC_TX_BACKOFF_SEED_MASK; + REG_WR(pDevice, MacCtrl.TxBackoffSeed, Value32); + + /* Receive MTU. Frames larger than the MTU is marked as oversized. */ + REG_WR(pDevice, MacCtrl.MtuSize, pDevice->RxMtu + 8); /* CRC + VLAN. */ + + /* Configure Time slot/IPG per 802.3 */ + REG_WR(pDevice, MacCtrl.TxLengths, 0x2620); + + /* + * Configure Receive Rules so that packets don't match + * Programmble rule will be queued to Return Ring 1 + */ + REG_WR(pDevice, MacCtrl.RcvRuleCfg, RX_RULE_DEFAULT_CLASS); + + /* + * Configure to have 16 Classes of Services (COS) and one + * queue per class. Bad frames are queued to RRR#1. + * And frames don't match rules are also queued to COS#1. + */ + REG_WR(pDevice, RcvListPlmt.Config, 0x181); + + /* Enable Receive Placement Statistics */ + REG_WR(pDevice, RcvListPlmt.StatsEnableMask,0xffffff); + REG_WR(pDevice, RcvListPlmt.StatsCtrl, RCV_LIST_STATS_ENABLE); + + /* Enable Send Data Initator Statistics */ + REG_WR(pDevice, SndDataIn.StatsEnableMask,0xffffff); + REG_WR(pDevice, SndDataIn.StatsCtrl, + T3_SND_DATA_IN_STATS_CTRL_ENABLE | \ + T3_SND_DATA_IN_STATS_CTRL_FASTER_UPDATE); + + /* Disable the host coalescing state machine before configuring it's */ + /* parameters. */ + REG_WR(pDevice, HostCoalesce.Mode, 0); + for(j = 0; j < 2000; j++) + { + Value32 = REG_RD(pDevice, HostCoalesce.Mode); + if(!(Value32 & HOST_COALESCE_ENABLE)) + { + break; + } + MM_Wait(10); + } + + /* Host coalescing configurations. */ + REG_WR(pDevice, HostCoalesce.RxCoalescingTicks, pDevice->RxCoalescingTicks); + REG_WR(pDevice, HostCoalesce.TxCoalescingTicks, pDevice->TxCoalescingTicks); + REG_WR(pDevice, HostCoalesce.RxMaxCoalescedFrames, + pDevice->RxMaxCoalescedFrames); + REG_WR(pDevice, HostCoalesce.TxMaxCoalescedFrames, + pDevice->TxMaxCoalescedFrames); + REG_WR(pDevice, HostCoalesce.RxCoalescedTickDuringInt, + pDevice->RxCoalescingTicksDuringInt); + REG_WR(pDevice, HostCoalesce.TxCoalescedTickDuringInt, + pDevice->TxCoalescingTicksDuringInt); + REG_WR(pDevice, HostCoalesce.RxMaxCoalescedFramesDuringInt, + pDevice->RxMaxCoalescedFramesDuringInt); + REG_WR(pDevice, HostCoalesce.TxMaxCoalescedFramesDuringInt, + pDevice->TxMaxCoalescedFramesDuringInt); + + /* Initialize the address of the status block. The NIC will DMA */ + /* the status block to this memory which resides on the host. */ + REG_WR(pDevice, HostCoalesce.StatusBlkHostAddr.High, + pDevice->StatusBlkPhy.High); + REG_WR(pDevice, HostCoalesce.StatusBlkHostAddr.Low, + pDevice->StatusBlkPhy.Low); + + /* Initialize the address of the statistics block. The NIC will DMA */ + /* the statistics to this block of memory. */ + REG_WR(pDevice, HostCoalesce.StatsBlkHostAddr.High, + pDevice->StatsBlkPhy.High); + REG_WR(pDevice, HostCoalesce.StatsBlkHostAddr.Low, + pDevice->StatsBlkPhy.Low); + + REG_WR(pDevice, HostCoalesce.StatsCoalescingTicks, + pDevice->StatsCoalescingTicks); + + REG_WR(pDevice, HostCoalesce.StatsBlkNicAddr, 0x300); + REG_WR(pDevice, HostCoalesce.StatusBlkNicAddr,0xb00); + + /* Enable Host Coalesing state machine */ + REG_WR(pDevice, HostCoalesce.Mode, HOST_COALESCE_ENABLE | + pDevice->CoalesceMode); + + /* Enable the Receive BD Completion state machine. */ + REG_WR(pDevice, RcvBdComp.Mode, RCV_BD_COMP_MODE_ENABLE | + RCV_BD_COMP_MODE_ATTN_ENABLE); + + /* Enable the Receive List Placement state machine. */ + REG_WR(pDevice, RcvListPlmt.Mode, RCV_LIST_PLMT_MODE_ENABLE); + + /* Enable the Receive List Selector state machine. */ + REG_WR(pDevice, RcvListSel.Mode, RCV_LIST_SEL_MODE_ENABLE | + RCV_LIST_SEL_MODE_ATTN_ENABLE); + + /* Enable transmit DMA, clear statistics. */ + pDevice->MacMode = MAC_MODE_ENABLE_TX_STATISTICS | + MAC_MODE_ENABLE_RX_STATISTICS | MAC_MODE_ENABLE_TDE | + MAC_MODE_ENABLE_RDE | MAC_MODE_ENABLE_FHDE; + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode | + MAC_MODE_CLEAR_RX_STATISTICS | MAC_MODE_CLEAR_TX_STATISTICS); + + /* GRC miscellaneous local control register. */ + pDevice->GrcLocalCtrl = GRC_MISC_LOCAL_CTRL_INT_ON_ATTN | + GRC_MISC_LOCAL_CTRL_AUTO_SEEPROM; + + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700) + { + pDevice->GrcLocalCtrl |= GRC_MISC_LOCAL_CTRL_GPIO_OE1 | + GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT1; + } + + REG_WR(pDevice, Grc.LocalCtrl, pDevice->GrcLocalCtrl); + MM_Wait(40); + + /* Reset RX counters. */ + for(j = 0; j < sizeof(LM_RX_COUNTERS); j++) + { + ((PLM_UINT8) &pDevice->RxCounters)[j] = 0; + } + + /* Reset TX counters. */ + for(j = 0; j < sizeof(LM_TX_COUNTERS); j++) + { + ((PLM_UINT8) &pDevice->TxCounters)[j] = 0; + } + + MB_REG_WR(pDevice, Mailbox.Interrupt[0].Low, 0); + + /* Enable the DMA Completion state machine. */ + REG_WR(pDevice, DmaComp.Mode, DMA_COMP_MODE_ENABLE); + + /* Enable the DMA Write state machine. */ + Value32 = DMA_WRITE_MODE_ENABLE | + DMA_WRITE_MODE_TARGET_ABORT_ATTN_ENABLE | + DMA_WRITE_MODE_MASTER_ABORT_ATTN_ENABLE | + DMA_WRITE_MODE_PARITY_ERROR_ATTN_ENABLE | + DMA_WRITE_MODE_ADDR_OVERFLOW_ATTN_ENABLE | + DMA_WRITE_MODE_FIFO_OVERRUN_ATTN_ENABLE | + DMA_WRITE_MODE_FIFO_UNDERRUN_ATTN_ENABLE | + DMA_WRITE_MODE_FIFO_OVERREAD_ATTN_ENABLE | + DMA_WRITE_MODE_LONG_READ_ATTN_ENABLE; + REG_WR(pDevice, DmaWrite.Mode, Value32); + + /* Enable the Read DMA state machine. */ + Value32 = DMA_READ_MODE_ENABLE | + DMA_READ_MODE_TARGET_ABORT_ATTN_ENABLE | + DMA_READ_MODE_MASTER_ABORT_ATTN_ENABLE | + DMA_READ_MODE_PARITY_ERROR_ATTN_ENABLE | + DMA_READ_MODE_ADDR_OVERFLOW_ATTN_ENABLE | + DMA_READ_MODE_FIFO_OVERRUN_ATTN_ENABLE | + DMA_READ_MODE_FIFO_UNDERRUN_ATTN_ENABLE | + DMA_READ_MODE_FIFO_OVERREAD_ATTN_ENABLE | + DMA_READ_MODE_LONG_READ_ATTN_ENABLE; + REG_WR(pDevice, DmaRead.Mode, Value32); + + /* Enable the Receive Data Completion state machine. */ + REG_WR(pDevice, RcvDataComp.Mode, RCV_DATA_COMP_MODE_ENABLE | + RCV_DATA_COMP_MODE_ATTN_ENABLE); + + /* Enable the Mbuf Cluster Free state machine. */ + REG_WR(pDevice, MbufClusterFree.Mode, MBUF_CLUSTER_FREE_MODE_ENABLE); + + /* Enable the Send Data Completion state machine. */ + REG_WR(pDevice, SndDataComp.Mode, SND_DATA_COMP_MODE_ENABLE); + + /* Enable the Send BD Completion state machine. */ + REG_WR(pDevice, SndBdComp.Mode, SND_BD_COMP_MODE_ENABLE | + SND_BD_COMP_MODE_ATTN_ENABLE); + + /* Enable the Receive BD Initiator state machine. */ + REG_WR(pDevice, RcvBdIn.Mode, RCV_BD_IN_MODE_ENABLE | + RCV_BD_IN_MODE_BD_IN_DIABLED_RCB_ATTN_ENABLE); + + /* Enable the Receive Data and Receive BD Initiator state machine. */ + REG_WR(pDevice, RcvDataBdIn.Mode, RCV_DATA_BD_IN_MODE_ENABLE | + RCV_DATA_BD_IN_MODE_INVALID_RING_SIZE); + + /* Enable the Send Data Initiator state machine. */ + REG_WR(pDevice, SndDataIn.Mode, T3_SND_DATA_IN_MODE_ENABLE); + + /* Enable the Send BD Initiator state machine. */ + REG_WR(pDevice, SndBdIn.Mode, SND_BD_IN_MODE_ENABLE | + SND_BD_IN_MODE_ATTN_ENABLE); + + /* Enable the Send BD Selector state machine. */ + REG_WR(pDevice, SndBdSel.Mode, SND_BD_SEL_MODE_ENABLE | + SND_BD_SEL_MODE_ATTN_ENABLE); + +#if INCLUDE_5701_AX_FIX + /* Load the firmware for the 5701_A0 workaround. */ + if(pDevice->ChipRevId == T3_CHIP_ID_5701_A0) + { + LM_LoadRlsFirmware(pDevice); + } +#endif + + /* Enable the transmitter. */ + pDevice->TxMode = TX_MODE_ENABLE; + REG_WR(pDevice, MacCtrl.TxMode, pDevice->TxMode); + + /* Enable the receiver. */ + pDevice->RxMode = RX_MODE_ENABLE; + REG_WR(pDevice, MacCtrl.RxMode, pDevice->RxMode); + + if (pDevice->RestoreOnWakeUp) + { + pDevice->RestoreOnWakeUp = FALSE; + pDevice->DisableAutoNeg = pDevice->WakeUpDisableAutoNeg; + pDevice->RequestedMediaType = pDevice->WakeUpRequestedMediaType; + } + + /* Disable auto polling. */ + pDevice->MiMode = 0xc0000; + REG_WR(pDevice, MacCtrl.MiMode, pDevice->MiMode); + + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 || + T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) + { + Value32 = LED_CTRL_PHY_MODE_1; + } + else + { + if(pDevice->LedMode == LED_MODE_OUTPUT) + { + Value32 = LED_CTRL_PHY_MODE_2; + } + else + { + Value32 = LED_CTRL_PHY_MODE_1; + } + } + REG_WR(pDevice, MacCtrl.LedCtrl, Value32); + + /* Activate Link to enable MAC state machine */ + REG_WR(pDevice, MacCtrl.MiStatus, MI_STATUS_ENABLE_LINK_STATUS_ATTN); + + if (pDevice->EnableTbi) + { + REG_WR(pDevice, MacCtrl.RxMode, RX_MODE_RESET); + MM_Wait(10); + REG_WR(pDevice, MacCtrl.RxMode, pDevice->RxMode); + if (pDevice->ChipRevId == T3_CHIP_ID_5703_A1) + { + REG_WR(pDevice, MacCtrl.SerdesCfg, 0x616000); + } + } + /* Setup the phy chip. */ + LM_SetupPhy(pDevice); + + if (!pDevice->EnableTbi) { + /* Clear CRC stats */ + LM_ReadPhy(pDevice, 0x1e, &Value32); + LM_WritePhy(pDevice, 0x1e, Value32 | 0x8000); + LM_ReadPhy(pDevice, 0x14, &Value32); + } + + /* Set up the receive mask. */ + LM_SetReceiveMask(pDevice, pDevice->ReceiveMask); + + /* Queue Rx packet buffers. */ + if(pDevice->QueueRxPackets) + { + LM_QueueRxPackets(pDevice); + } + + return LM_STATUS_SUCCESS; +} /* LM_ResetAdapter */ + + +/******************************************************************************/ +/* Description: */ +/* This routine disables the adapter from generating interrupts. */ +/* */ +/* Return: */ +/* LM_STATUS_SUCCESS */ +/******************************************************************************/ +LM_STATUS +LM_DisableInterrupt( + PLM_DEVICE_BLOCK pDevice) +{ + REG_WR(pDevice, PciCfg.MiscHostCtrl, pDevice->MiscHostCtrl | + MISC_HOST_CTRL_MASK_PCI_INT); + MB_REG_WR(pDevice, Mailbox.Interrupt[0].Low, 1); + + return LM_STATUS_SUCCESS; +} + + + +/******************************************************************************/ +/* Description: */ +/* This routine enables the adapter to generate interrupts. */ +/* */ +/* Return: */ +/* LM_STATUS_SUCCESS */ +/******************************************************************************/ +LM_STATUS +LM_EnableInterrupt( + PLM_DEVICE_BLOCK pDevice) +{ + REG_WR(pDevice, PciCfg.MiscHostCtrl, pDevice->MiscHostCtrl & + ~MISC_HOST_CTRL_MASK_PCI_INT); + MB_REG_WR(pDevice, Mailbox.Interrupt[0].Low, 0); + + if(pDevice->pStatusBlkVirt->Status & STATUS_BLOCK_UPDATED) + { + REG_WR(pDevice, Grc.LocalCtrl, pDevice->GrcLocalCtrl | + GRC_MISC_LOCAL_CTRL_SET_INT); + } + + return LM_STATUS_SUCCESS; +} + + + +/******************************************************************************/ +/* Description: */ +/* This routine puts a packet on the wire if there is a transmit DMA */ +/* descriptor available; otherwise the packet is queued for later */ +/* transmission. If the second argue is NULL, this routine will put */ +/* the queued packet on the wire if possible. */ +/* */ +/* Return: */ +/* LM_STATUS_SUCCESS */ +/******************************************************************************/ +LM_STATUS +LM_SendPacket(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket) +{ + LM_UINT32 FragCount; + PT3_SND_BD pSendBd; + PT3_SND_BD pShadowSendBd; + LM_UINT32 Value32; + LM_UINT32 Idx; + + /* Update the SendBdLeft count. */ + atomic_sub(pPacket->u.Tx.FragCount, &pDevice->SendBdLeft); + + /* Initalize the send buffer descriptors. */ + Idx = pDevice->SendProdIdx; + + pSendBd = &pDevice->pSendBdVirt[Idx]; + + /* Next producer index. */ + if (pDevice->NicSendBd == TRUE) + { + pShadowSendBd = &pDevice->ShadowSendBd[Idx]; + for(FragCount = 0; ; ) + { + /* Initialize the pointer to the send buffer fragment. */ + Value32 = + pPacket->u.Tx.pFraglist->Fragments[FragCount].FragBuf.High; + if (Value32 != pShadowSendBd->HostAddr.High) + { + __raw_writel(Value32, &(pSendBd->HostAddr.High)); + pShadowSendBd->HostAddr.High = Value32; + } + __raw_writel(pPacket->u.Tx.pFraglist->Fragments[FragCount].FragBuf.Low, + &(pSendBd->HostAddr.Low)); + + /* Setup the control flags and send buffer size. */ + Value32 = (pPacket->u.Tx.pFraglist->Fragments[FragCount]. + FragSize << 16) | pPacket->Flags; + + Idx = (Idx + 1) & T3_SEND_RCB_ENTRY_COUNT_MASK; + + FragCount++; + if (FragCount >= pPacket->u.Tx.FragCount) + { + Value32 |= SND_BD_FLAG_END; + if (Value32 != pShadowSendBd->u1.Len_Flags) + { + __raw_writel(Value32, &(pSendBd->u1.Len_Flags)); + pShadowSendBd->u1.Len_Flags = Value32; + } + if (pPacket->Flags & SND_BD_FLAG_VLAN_TAG) { + __raw_writel(pPacket->VlanTag, &(pSendBd->u2.VlanTag)); + } + break; + } + else + { + if (Value32 != pShadowSendBd->u1.Len_Flags) + { + __raw_writel(Value32, &(pSendBd->u1.Len_Flags)); + pShadowSendBd->u1.Len_Flags = Value32; + } + if (pPacket->Flags & SND_BD_FLAG_VLAN_TAG) { + __raw_writel(pPacket->VlanTag, &(pSendBd->u2.VlanTag)); + } + } + + pSendBd++; + pShadowSendBd++; + if (Idx == 0) + { + pSendBd = &pDevice->pSendBdVirt[0]; + pShadowSendBd = &pDevice->ShadowSendBd[0]; + } + } /* for */ + + /* Put the packet descriptor in the ActiveQ. */ + QQ_PushTail(&pDevice->TxPacketActiveQ.Container, pPacket); + + wmb(); + MB_REG_WR(pDevice, Mailbox.SendNicProdIdx[0].Low, Idx); + + if(T3_CHIP_REV(pDevice->ChipRevId) == T3_CHIP_REV_5700_BX) + { + MB_REG_WR(pDevice, Mailbox.SendNicProdIdx[0].Low, Idx); + } + } + else + { + for(FragCount = 0; ; ) + { + /* Initialize the pointer to the send buffer fragment. */ + pSendBd->HostAddr.High = + pPacket->u.Tx.pFraglist->Fragments[FragCount].FragBuf.High; + pSendBd->HostAddr.Low = + pPacket->u.Tx.pFraglist->Fragments[FragCount].FragBuf.Low; + + /* Setup the control flags and send buffer size. */ + Value32 = (pPacket->u.Tx.pFraglist->Fragments[FragCount]. + FragSize << 16) | pPacket->Flags; + + Idx = (Idx + 1) & T3_SEND_RCB_ENTRY_COUNT_MASK; + + FragCount++; + if (FragCount >= pPacket->u.Tx.FragCount) + { + pSendBd->u1.Len_Flags = Value32 | SND_BD_FLAG_END; + if (pPacket->Flags & SND_BD_FLAG_VLAN_TAG) + pSendBd->u2.VlanTag = pPacket->VlanTag; + break; + } + else + { + pSendBd->u1.Len_Flags = Value32; + if (pPacket->Flags & SND_BD_FLAG_VLAN_TAG) + pSendBd->u2.VlanTag = pPacket->VlanTag; + } + pSendBd++; + if (Idx == 0) + { + pSendBd = &pDevice->pSendBdVirt[0]; + } + } /* for */ + + /* Put the packet descriptor in the ActiveQ. */ + QQ_PushTail(&pDevice->TxPacketActiveQ.Container, pPacket); + + wmb(); + MB_REG_WR(pDevice, Mailbox.SendHostProdIdx[0].Low, Idx); + + if(T3_CHIP_REV(pDevice->ChipRevId) == T3_CHIP_REV_5700_BX) + { + MB_REG_WR(pDevice, Mailbox.SendHostProdIdx[0].Low, Idx); + } + } + + /* Update the producer index. */ + pDevice->SendProdIdx = Idx; + + return LM_STATUS_SUCCESS; +} + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +__inline static unsigned long +ComputeCrc32( +unsigned char *pBuffer, +unsigned long BufferSize) { + unsigned long Reg; + unsigned long Tmp; + unsigned long j, k; + + Reg = 0xffffffff; + + for(j = 0; j < BufferSize; j++) + { + Reg ^= pBuffer[j]; + + for(k = 0; k < 8; k++) + { + Tmp = Reg & 0x01; + + Reg >>= 1; + + if(Tmp) + { + Reg ^= 0xedb88320; + } + } + } + + return ~Reg; +} /* ComputeCrc32 */ + + + +/******************************************************************************/ +/* Description: */ +/* This routine sets the receive control register according to ReceiveMask */ +/* */ +/* Return: */ +/* LM_STATUS_SUCCESS */ +/******************************************************************************/ +LM_STATUS +LM_SetReceiveMask( +PLM_DEVICE_BLOCK pDevice, +LM_UINT32 Mask) { + LM_UINT32 ReceiveMask; + LM_UINT32 RxMode; + LM_UINT32 j, k; + + ReceiveMask = Mask; + + RxMode = pDevice->RxMode; + + if(Mask & LM_ACCEPT_UNICAST) + { + Mask &= ~LM_ACCEPT_UNICAST; + } + + if(Mask & LM_ACCEPT_MULTICAST) + { + Mask &= ~LM_ACCEPT_MULTICAST; + } + + if(Mask & LM_ACCEPT_ALL_MULTICAST) + { + Mask &= ~LM_ACCEPT_ALL_MULTICAST; + } + + if(Mask & LM_ACCEPT_BROADCAST) + { + Mask &= ~LM_ACCEPT_BROADCAST; + } + + RxMode &= ~RX_MODE_PROMISCUOUS_MODE; + if(Mask & LM_PROMISCUOUS_MODE) + { + RxMode |= RX_MODE_PROMISCUOUS_MODE; + Mask &= ~LM_PROMISCUOUS_MODE; + } + + RxMode &= ~(RX_MODE_ACCEPT_RUNTS | RX_MODE_ACCEPT_OVERSIZED); + if(Mask & LM_ACCEPT_ERROR_PACKET) + { + RxMode |= RX_MODE_ACCEPT_RUNTS | RX_MODE_ACCEPT_OVERSIZED; + Mask &= ~LM_ACCEPT_ERROR_PACKET; + } + + /* Make sure all the bits are valid before committing changes. */ + if(Mask) + { + return LM_STATUS_FAILURE; + } + + /* Commit the new filter. */ + pDevice->RxMode = RxMode; + REG_WR(pDevice, MacCtrl.RxMode, RxMode); + + pDevice->ReceiveMask = ReceiveMask; + + /* Set up the MC hash table. */ + if(ReceiveMask & LM_ACCEPT_ALL_MULTICAST) + { + for(k = 0; k < 4; k++) + { + REG_WR(pDevice, MacCtrl.HashReg[k], 0xffffffff); + } + } + else if(ReceiveMask & LM_ACCEPT_MULTICAST) + { + LM_UINT32 HashReg[4]; + + HashReg[0] = 0; HashReg[1] = 0; HashReg[2] = 0; HashReg[3] = 0; + for(j = 0; j < pDevice->McEntryCount; j++) + { + LM_UINT32 RegIndex; + LM_UINT32 Bitpos; + LM_UINT32 Crc32; + + Crc32 = ComputeCrc32(pDevice->McTable[j], ETHERNET_ADDRESS_SIZE); + + /* The most significant 7 bits of the CRC32 (no inversion), */ + /* are used to index into one of the possible 128 bit positions. */ + Bitpos = ~Crc32 & 0x7f; + + /* Hash register index. */ + RegIndex = (Bitpos & 0x60) >> 5; + + /* Bit to turn on within a hash register. */ + Bitpos &= 0x1f; + + /* Enable the multicast bit. */ + HashReg[RegIndex] |= (1 << Bitpos); + } + + /* REV_AX has problem with multicast filtering where it uses both */ + /* DA and SA to perform hashing. */ + for(k = 0; k < 4; k++) + { + REG_WR(pDevice, MacCtrl.HashReg[k], HashReg[k]); + } + } + else + { + /* Reject all multicast frames. */ + for(j = 0; j < 4; j++) + { + REG_WR(pDevice, MacCtrl.HashReg[j], 0); + } + } + + /* By default, Tigon3 will accept broadcast frames. We need to setup */ + if(ReceiveMask & LM_ACCEPT_BROADCAST) + { + REG_WR(pDevice, MacCtrl.RcvRules[RCV_RULE1_REJECT_BROADCAST_IDX].Rule, + REJECT_BROADCAST_RULE1_RULE & RCV_DISABLE_RULE_MASK); + REG_WR(pDevice, MacCtrl.RcvRules[RCV_RULE1_REJECT_BROADCAST_IDX].Value, + REJECT_BROADCAST_RULE1_VALUE & RCV_DISABLE_RULE_MASK); + REG_WR(pDevice, MacCtrl.RcvRules[RCV_RULE2_REJECT_BROADCAST_IDX].Rule, + REJECT_BROADCAST_RULE1_RULE & RCV_DISABLE_RULE_MASK); + REG_WR(pDevice, MacCtrl.RcvRules[RCV_RULE2_REJECT_BROADCAST_IDX].Value, + REJECT_BROADCAST_RULE1_VALUE & RCV_DISABLE_RULE_MASK); + } + else + { + REG_WR(pDevice, MacCtrl.RcvRules[RCV_RULE1_REJECT_BROADCAST_IDX].Rule, + REJECT_BROADCAST_RULE1_RULE); + REG_WR(pDevice, MacCtrl.RcvRules[RCV_RULE1_REJECT_BROADCAST_IDX].Value, + REJECT_BROADCAST_RULE1_VALUE); + REG_WR(pDevice, MacCtrl.RcvRules[RCV_RULE2_REJECT_BROADCAST_IDX].Rule, + REJECT_BROADCAST_RULE2_RULE); + REG_WR(pDevice, MacCtrl.RcvRules[RCV_RULE2_REJECT_BROADCAST_IDX].Value, + REJECT_BROADCAST_RULE2_VALUE); + } + + /* disable the rest of the rules. */ + for(j = RCV_LAST_RULE_IDX; j < 16; j++) + { + REG_WR(pDevice, MacCtrl.RcvRules[j].Rule, 0); + REG_WR(pDevice, MacCtrl.RcvRules[j].Value, 0); + } + + return LM_STATUS_SUCCESS; +} /* LM_SetReceiveMask */ + + + +/******************************************************************************/ +/* Description: */ +/* Disable the interrupt and put the transmitter and receiver engines in */ +/* an idle state. Also aborts all pending send requests and receive */ +/* buffers. */ +/* */ +/* Return: */ +/* LM_STATUS_SUCCESS */ +/******************************************************************************/ +LM_STATUS +LM_Abort( +PLM_DEVICE_BLOCK pDevice) +{ + PLM_PACKET pPacket; + LM_UINT Idx; + + LM_DisableInterrupt(pDevice); + + /* Disable all the state machines. */ + LM_CntrlBlock(pDevice,T3_BLOCK_MAC_RX_ENGINE,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_RX_BD_INITIATOR,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_RX_LIST_PLMT,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_RX_LIST_SELECTOR,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_RX_DATA_INITIATOR,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_RX_DATA_COMP,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_RX_BD_COMP,LM_DISABLE); + + LM_CntrlBlock(pDevice,T3_BLOCK_SEND_BD_SELECTOR,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_SEND_BD_INITIATOR,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_SEND_DATA_INITIATOR,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_DMA_RD,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_SEND_DATA_COMP,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_DMA_COMP,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_SEND_BD_COMP,LM_DISABLE); + + /* Clear TDE bit */ + pDevice->MacMode &= ~MAC_MODE_ENABLE_TDE; + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode); + + LM_CntrlBlock(pDevice,T3_BLOCK_MAC_TX_ENGINE,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_HOST_COALESING,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_DMA_WR,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_MBUF_CLUSTER_FREE,LM_DISABLE); + + /* Reset all FTQs */ + REG_WR(pDevice, Ftq.Reset, 0xffffffff); + REG_WR(pDevice, Ftq.Reset, 0x0); + + LM_CntrlBlock(pDevice,T3_BLOCK_MBUF_MANAGER,LM_DISABLE); + LM_CntrlBlock(pDevice,T3_BLOCK_MEM_ARBITOR,LM_DISABLE); + + MM_ACQUIRE_INT_LOCK(pDevice); + + /* Abort packets that have already queued to go out. */ + pPacket = (PLM_PACKET) QQ_PopHead(&pDevice->TxPacketActiveQ.Container); + while(pPacket) + { +// MM_CompleteTxDma(pDevice, pPacket); + + pPacket->PacketStatus = LM_STATUS_TRANSMIT_ABORTED; + pDevice->TxCounters.TxPacketAbortedCnt++; + + atomic_add(pPacket->u.Tx.FragCount, &pDevice->SendBdLeft); + + QQ_PushTail(&pDevice->TxPacketXmittedQ.Container, pPacket); + + pPacket = (PLM_PACKET) + QQ_PopHead(&pDevice->TxPacketActiveQ.Container); + } + + /* Cleanup the receive return rings. */ + LM_ServiceRxInterrupt(pDevice); + + /* Don't want to indicate rx packets in Ndis miniport shutdown context. */ + /* Doing so may cause system crash. */ + if(!pDevice->ShuttingDown) + { + /* Indicate packets to the protocol. */ + MM_IndicateTxPackets(pDevice); + + /* Indicate received packets to the protocols. */ + MM_IndicateRxPackets(pDevice); + } + else + { + /* Move the receive packet descriptors in the ReceivedQ to the */ + /* free queue. */ + for(; ;) + { + pPacket = (PLM_PACKET) QQ_PopHead( + &pDevice->RxPacketReceivedQ.Container); + if(pPacket == NULL) + { + break; + } + QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket); + } + } + + /* Clean up the Std Receive Producer ring. */ + Idx = pDevice->pStatusBlkVirt->RcvStdConIdx; + + while(Idx != pDevice->RxStdProdIdx) { + pPacket = (PLM_PACKET) (MM_UINT_PTR(pDevice->pPacketDescBase) + + MM_UINT_PTR(pDevice->pRxStdBdVirt[Idx].Opaque)); + + QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket); + + Idx = (Idx + 1) & T3_STD_RCV_RCB_ENTRY_COUNT_MASK; + } /* while */ + + /* Reinitialize our copy of the indices. */ + pDevice->RxStdProdIdx = 0; + +#if T3_JUMBO_RCV_RCB_ENTRY_COUNT + /* Clean up the Jumbo Receive Producer ring. */ + Idx = pDevice->pStatusBlkVirt->RcvJumboConIdx; + + while(Idx != pDevice->RxJumboProdIdx) { + pPacket = (PLM_PACKET) (MM_UINT_PTR(pDevice->pPacketDescBase) + + MM_UINT_PTR(pDevice->pRxJumboBdVirt[Idx].Opaque)); + + QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket); + + Idx = (Idx + 1) & T3_JUMBO_RCV_RCB_ENTRY_COUNT_MASK; + } /* while */ + + /* Reinitialize our copy of the indices. */ + pDevice->RxJumboProdIdx = 0; +#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */ + + MM_RELEASE_INT_LOCK(pDevice); + + /* Initialize the statistis Block */ + pDevice->pStatusBlkVirt->Status = 0; + pDevice->pStatusBlkVirt->RcvStdConIdx = 0; + pDevice->pStatusBlkVirt->RcvJumboConIdx = 0; + pDevice->pStatusBlkVirt->RcvMiniConIdx = 0; + + return LM_STATUS_SUCCESS; +} /* LM_Abort */ + + + +/******************************************************************************/ +/* Description: */ +/* Disable the interrupt and put the transmitter and receiver engines in */ +/* an idle state. Aborts all pending send requests and receive buffers. */ +/* Also free all the receive buffers. */ +/* */ +/* Return: */ +/* LM_STATUS_SUCCESS */ +/******************************************************************************/ +LM_STATUS +LM_Halt( +PLM_DEVICE_BLOCK pDevice) { + PLM_PACKET pPacket; + LM_UINT32 EntryCnt; + + LM_Abort(pDevice); + + /* Get the number of entries in the queue. */ + EntryCnt = QQ_GetEntryCnt(&pDevice->RxPacketFreeQ.Container); + + /* Make sure all the packets have been accounted for. */ + for(EntryCnt = 0; EntryCnt < pDevice->RxPacketDescCnt; EntryCnt++) + { + pPacket = (PLM_PACKET) QQ_PopHead(&pDevice->RxPacketFreeQ.Container); + if (pPacket == 0) + break; + + MM_FreeRxBuffer(pDevice, pPacket); + + QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket); + } + + LM_ResetChip(pDevice); + + /* Restore PCI configuration registers. */ + MM_WriteConfig32(pDevice, PCI_CACHE_LINE_SIZE_REG, + pDevice->SavedCacheLineReg); + LM_RegWrInd(pDevice, PCI_SUBSYSTEM_VENDOR_ID_REG, + (pDevice->SubsystemId << 16) | pDevice->SubsystemVendorId); + + /* Reprogram the MAC address. */ + LM_SetMacAddress(pDevice, pDevice->NodeAddress); + + return LM_STATUS_SUCCESS; +} /* LM_Halt */ + + +STATIC LM_STATUS +LM_ResetChip(PLM_DEVICE_BLOCK pDevice) +{ + LM_UINT32 Value32; + LM_UINT32 j; + + /* Wait for access to the nvram interface before resetting. This is */ + /* a workaround to prevent EEPROM corruption. */ + if(T3_ASIC_REV(pDevice->ChipRevId) != T3_ASIC_REV_5700 && + T3_ASIC_REV(pDevice->ChipRevId) != T3_ASIC_REV_5701) + { + /* Request access to the flash interface. */ + REG_WR(pDevice, Nvram.SwArb, SW_ARB_REQ_SET1); + + for(j = 0; j < 100000; j++) + { + Value32 = REG_RD(pDevice, Nvram.SwArb); + if(Value32 & SW_ARB_GNT1) + { + break; + } + MM_Wait(10); + } + } + + /* Global reset. */ + REG_WR(pDevice, Grc.MiscCfg, GRC_MISC_CFG_CORE_CLOCK_RESET); + MM_Wait(40); MM_Wait(40); MM_Wait(40); + + /* make sure we re-enable indirect accesses */ + MM_WriteConfig32(pDevice, T3_PCI_MISC_HOST_CTRL_REG, + pDevice->MiscHostCtrl); + + /* Set MAX PCI retry to zero. */ + MM_WriteConfig32(pDevice, T3_PCI_STATE_REG, + T3_PCI_STATE_PCI_ROM_ENABLE | T3_PCI_STATE_PCI_ROM_RETRY_ENABLE); + + /* Restore PCI command register. */ + MM_WriteConfig32(pDevice, PCI_COMMAND_REG, + pDevice->PciCommandStatusWords); + + /* Disable PCI-X relaxed ordering bit. */ + MM_ReadConfig32(pDevice, PCIX_CAP_REG, &Value32); + Value32 &= ~PCIX_ENABLE_RELAXED_ORDERING; + MM_WriteConfig32(pDevice, PCIX_CAP_REG, Value32); + + /* Enable memory arbiter. */ + REG_WR(pDevice, MemArbiter.Mode, T3_MEM_ARBITER_MODE_ENABLE); + +#ifdef BIG_ENDIAN_HOST + /* Reconfigure the mode register. */ + Value32 = GRC_MODE_BYTE_SWAP_NON_FRAME_DATA | + GRC_MODE_WORD_SWAP_NON_FRAME_DATA | + GRC_MODE_BYTE_SWAP_DATA | + GRC_MODE_WORD_SWAP_DATA; +#else + /* Reconfigure the mode register. */ + Value32 = GRC_MODE_BYTE_SWAP_NON_FRAME_DATA | GRC_MODE_BYTE_SWAP_DATA; +#endif + REG_WR(pDevice, Grc.Mode, Value32); + + /* Prevent PXE from restarting. */ + MEM_WR_OFFSET(pDevice, 0x0b50, T3_MAGIC_NUM); + + if(pDevice->EnableTbi) { + pDevice->MacMode = MAC_MODE_PORT_MODE_TBI; + REG_WR(pDevice, MacCtrl.Mode, MAC_MODE_PORT_MODE_TBI); + } + else { + REG_WR(pDevice, MacCtrl.Mode, 0); + } + + /* Wait for the firmware to finish initialization. */ + for(j = 0; j < 100000; j++) + { + MM_Wait(10); + + Value32 = MEM_RD_OFFSET(pDevice, 0x0b50); + if(Value32 == ~T3_MAGIC_NUM) + { + break; + } + } + return LM_STATUS_SUCCESS; +} + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +__inline static void +LM_ServiceTxInterrupt( +PLM_DEVICE_BLOCK pDevice) { + PLM_PACKET pPacket; + LM_UINT32 HwConIdx; + LM_UINT32 SwConIdx; + + HwConIdx = pDevice->pStatusBlkVirt->Idx[0].SendConIdx; + + /* Get our copy of the consumer index. The buffer descriptors */ + /* that are in between the consumer indices are freed. */ + SwConIdx = pDevice->SendConIdx; + + /* Move the packets from the TxPacketActiveQ that are sent out to */ + /* the TxPacketXmittedQ. Packets that are sent use the */ + /* descriptors that are between SwConIdx and HwConIdx. */ + while(SwConIdx != HwConIdx) + { + /* Get the packet that was sent from the TxPacketActiveQ. */ + pPacket = (PLM_PACKET) QQ_PopHead( + &pDevice->TxPacketActiveQ.Container); + + /* Set the return status. */ + pPacket->PacketStatus = LM_STATUS_SUCCESS; + + /* Complete the transmit with a call to MM_CompleteTxDma. */ +// MM_CompleteTxDma(pDevice, pPacket); + + /* Put the packet in the TxPacketXmittedQ for indication later. */ + QQ_PushTail(&pDevice->TxPacketXmittedQ.Container, pPacket); + + /* Move to the next packet's BD. */ + SwConIdx = (SwConIdx + pPacket->u.Tx.FragCount) & + T3_SEND_RCB_ENTRY_COUNT_MASK; + + /* Update the number of unused BDs. */ + atomic_add(pPacket->u.Tx.FragCount, &pDevice->SendBdLeft); + + /* Get the new updated HwConIdx. */ + HwConIdx = pDevice->pStatusBlkVirt->Idx[0].SendConIdx; + } /* while */ + + /* Save the new SwConIdx. */ + pDevice->SendConIdx = SwConIdx; + +} /* LM_ServiceTxInterrupt */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +__inline static void +LM_ServiceRxInterrupt( +PLM_DEVICE_BLOCK pDevice) { + PLM_PACKET pPacket; + PT3_RCV_BD pRcvBd; + LM_UINT32 HwRcvRetProdIdx; + LM_UINT32 SwRcvRetConIdx; + + /* Loop thru the receive return rings for received packets. */ + HwRcvRetProdIdx = pDevice->pStatusBlkVirt->Idx[0].RcvProdIdx; + + SwRcvRetConIdx = pDevice->RcvRetConIdx; + while(SwRcvRetConIdx != HwRcvRetProdIdx) + { + pRcvBd = &pDevice->pRcvRetBdVirt[SwRcvRetConIdx]; + + /* Get the received packet descriptor. */ + pPacket = (PLM_PACKET) (MM_UINT_PTR(pDevice->pPacketDescBase) + + MM_UINT_PTR(pRcvBd->Opaque)); + + /* Check the error flag. */ + if(pRcvBd->ErrorFlag && + pRcvBd->ErrorFlag != RCV_BD_ERR_ODD_NIBBLED_RCVD_MII) + { + pPacket->PacketStatus = LM_STATUS_FAILURE; + + pDevice->RxCounters.RxPacketErrCnt++; + + if(pRcvBd->ErrorFlag & RCV_BD_ERR_BAD_CRC) + { + pDevice->RxCounters.RxErrCrcCnt++; + } + + if(pRcvBd->ErrorFlag & RCV_BD_ERR_COLL_DETECT) + { + pDevice->RxCounters.RxErrCollCnt++; + } + + if(pRcvBd->ErrorFlag & RCV_BD_ERR_LINK_LOST_DURING_PKT) + { + pDevice->RxCounters.RxErrLinkLostCnt++; + } + + if(pRcvBd->ErrorFlag & RCV_BD_ERR_PHY_DECODE_ERR) + { + pDevice->RxCounters.RxErrPhyDecodeCnt++; + } + + if(pRcvBd->ErrorFlag & RCV_BD_ERR_ODD_NIBBLED_RCVD_MII) + { + pDevice->RxCounters.RxErrOddNibbleCnt++; + } + + if(pRcvBd->ErrorFlag & RCV_BD_ERR_MAC_ABORT) + { + pDevice->RxCounters.RxErrMacAbortCnt++; + } + + if(pRcvBd->ErrorFlag & RCV_BD_ERR_LEN_LT_64) + { + pDevice->RxCounters.RxErrShortPacketCnt++; + } + + if(pRcvBd->ErrorFlag & RCV_BD_ERR_TRUNC_NO_RESOURCES) + { + pDevice->RxCounters.RxErrNoResourceCnt++; + } + + if(pRcvBd->ErrorFlag & RCV_BD_ERR_GIANT_FRAME_RCVD) + { + pDevice->RxCounters.RxErrLargePacketCnt++; + } + } + else + { + pPacket->PacketStatus = LM_STATUS_SUCCESS; + pPacket->PacketSize = pRcvBd->Len - 4; + + pPacket->Flags = pRcvBd->Flags; + if(pRcvBd->Flags & RCV_BD_FLAG_VLAN_TAG) + { + pPacket->VlanTag = pRcvBd->VlanTag; + } + + pPacket->u.Rx.TcpUdpChecksum = pRcvBd->TcpUdpCksum; + } + + /* Put the packet descriptor containing the received packet */ + /* buffer in the RxPacketReceivedQ for indication later. */ + QQ_PushTail(&pDevice->RxPacketReceivedQ.Container, pPacket); + + /* Go to the next buffer descriptor. */ + SwRcvRetConIdx = (SwRcvRetConIdx + 1) & + T3_RCV_RETURN_RCB_ENTRY_COUNT_MASK; + + /* Get the updated HwRcvRetProdIdx. */ + HwRcvRetProdIdx = pDevice->pStatusBlkVirt->Idx[0].RcvProdIdx; + } /* while */ + + pDevice->RcvRetConIdx = SwRcvRetConIdx; + + /* Update the receive return ring consumer index. */ + MB_REG_WR(pDevice, Mailbox.RcvRetConIdx[0].Low, SwRcvRetConIdx); +} /* LM_ServiceRxInterrupt */ + + + +/******************************************************************************/ +/* Description: */ +/* This is the interrupt event handler routine. It acknowledges all */ +/* pending interrupts and process all pending events. */ +/* */ +/* Return: */ +/* LM_STATUS_SUCCESS */ +/******************************************************************************/ +LM_STATUS +LM_ServiceInterrupts( + PLM_DEVICE_BLOCK pDevice) +{ + LM_UINT32 Value32; + int ServicePhyInt = FALSE; + + /* Setup the phy chip whenever the link status changes. */ + if(pDevice->LinkChngMode == T3_LINK_CHNG_MODE_USE_STATUS_REG) + { + Value32 = REG_RD(pDevice, MacCtrl.Status); + if(pDevice->PhyIntMode == T3_PHY_INT_MODE_MI_INTERRUPT) + { + if (Value32 & MAC_STATUS_MI_INTERRUPT) + { + ServicePhyInt = TRUE; + } + } + else if(Value32 & MAC_STATUS_LINK_STATE_CHANGED) + { + ServicePhyInt = TRUE; + } + } + else + { + if(pDevice->pStatusBlkVirt->Status & STATUS_BLOCK_LINK_CHANGED_STATUS) + { + pDevice->pStatusBlkVirt->Status = STATUS_BLOCK_UPDATED | + (pDevice->pStatusBlkVirt->Status & ~STATUS_BLOCK_LINK_CHANGED_STATUS); + ServicePhyInt = TRUE; + } + } +#if INCLUDE_TBI_SUPPORT + if (pDevice->IgnoreTbiLinkChange == TRUE) + { + ServicePhyInt = FALSE; + } +#endif + if (ServicePhyInt == TRUE) + { + MM_ACQUIRE_PHY_LOCK_IN_IRQ(pDevice); + LM_SetupPhy(pDevice); + MM_RELEASE_PHY_LOCK_IN_IRQ(pDevice); + } + + /* Service receive and transmit interrupts. */ + LM_ServiceRxInterrupt(pDevice); + LM_ServiceTxInterrupt(pDevice); + + /* No spinlock for this queue since this routine is serialized. */ + if(!QQ_Empty(&pDevice->RxPacketReceivedQ.Container)) + { + /* Indicate receive packets. */ + MM_IndicateRxPackets(pDevice); +// LM_QueueRxPackets(pDevice); + } + + /* No spinlock for this queue since this routine is serialized. */ + if(!QQ_Empty(&pDevice->TxPacketXmittedQ.Container)) + { + MM_IndicateTxPackets(pDevice); + } + + return LM_STATUS_SUCCESS; +} /* LM_ServiceInterrupts */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_STATUS +LM_MulticastAdd( +PLM_DEVICE_BLOCK pDevice, +PLM_UINT8 pMcAddress) { + PLM_UINT8 pEntry; + LM_UINT32 j; + + pEntry = pDevice->McTable[0]; + for(j = 0; j < pDevice->McEntryCount; j++) + { + if(IS_ETH_ADDRESS_EQUAL(pEntry, pMcAddress)) + { + /* Found a match, increment the instance count. */ + pEntry[LM_MC_INSTANCE_COUNT_INDEX] += 1; + + return LM_STATUS_SUCCESS; + } + + pEntry += LM_MC_ENTRY_SIZE; + } + + if(pDevice->McEntryCount >= LM_MAX_MC_TABLE_SIZE) + { + return LM_STATUS_FAILURE; + } + + pEntry = pDevice->McTable[pDevice->McEntryCount]; + + COPY_ETH_ADDRESS(pMcAddress, pEntry); + pEntry[LM_MC_INSTANCE_COUNT_INDEX] = 1; + + pDevice->McEntryCount++; + + LM_SetReceiveMask(pDevice, pDevice->ReceiveMask | LM_ACCEPT_MULTICAST); + + return LM_STATUS_SUCCESS; +} /* LM_MulticastAdd */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_STATUS +LM_MulticastDel( +PLM_DEVICE_BLOCK pDevice, +PLM_UINT8 pMcAddress) { + PLM_UINT8 pEntry; + LM_UINT32 j; + + pEntry = pDevice->McTable[0]; + for(j = 0; j < pDevice->McEntryCount; j++) + { + if(IS_ETH_ADDRESS_EQUAL(pEntry, pMcAddress)) + { + /* Found a match, decrement the instance count. */ + pEntry[LM_MC_INSTANCE_COUNT_INDEX] -= 1; + + /* No more instance left, remove the address from the table. */ + /* Move the last entry in the table to the delete slot. */ + if(pEntry[LM_MC_INSTANCE_COUNT_INDEX] == 0 && + pDevice->McEntryCount > 1) + { + + COPY_ETH_ADDRESS( + pDevice->McTable[pDevice->McEntryCount-1], pEntry); + pEntry[LM_MC_INSTANCE_COUNT_INDEX] = + pDevice->McTable[pDevice->McEntryCount-1] + [LM_MC_INSTANCE_COUNT_INDEX]; + } + pDevice->McEntryCount--; + + /* Update the receive mask if the table is empty. */ + if(pDevice->McEntryCount == 0) + { + LM_SetReceiveMask(pDevice, + pDevice->ReceiveMask & ~LM_ACCEPT_MULTICAST); + } + + return LM_STATUS_SUCCESS; + } + + pEntry += LM_MC_ENTRY_SIZE; + } + + return LM_STATUS_FAILURE; +} /* LM_MulticastDel */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_STATUS +LM_MulticastClear( +PLM_DEVICE_BLOCK pDevice) { + pDevice->McEntryCount = 0; + + LM_SetReceiveMask(pDevice, pDevice->ReceiveMask & ~LM_ACCEPT_MULTICAST); + + return LM_STATUS_SUCCESS; +} /* LM_MulticastClear */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_STATUS +LM_SetMacAddress( + PLM_DEVICE_BLOCK pDevice, + PLM_UINT8 pMacAddress) +{ + LM_UINT32 j; + + for(j = 0; j < 4; j++) + { + REG_WR(pDevice, MacCtrl.MacAddr[j].High, + (pMacAddress[0] << 8) | pMacAddress[1]); + REG_WR(pDevice, MacCtrl.MacAddr[j].Low, + (pMacAddress[2] << 24) | (pMacAddress[3] << 16) | + (pMacAddress[4] << 8) | pMacAddress[5]); + } + + return LM_STATUS_SUCCESS; +} + + +/******************************************************************************/ +/* Description: */ +/* Sets up the default line speed, and duplex modes based on the requested */ +/* media type. */ +/* */ +/* Return: */ +/* None. */ +/******************************************************************************/ +static LM_STATUS +LM_TranslateRequestedMediaType( +LM_REQUESTED_MEDIA_TYPE RequestedMediaType, +PLM_MEDIA_TYPE pMediaType, +PLM_LINE_SPEED pLineSpeed, +PLM_DUPLEX_MODE pDuplexMode) { + *pMediaType = LM_MEDIA_TYPE_AUTO; + *pLineSpeed = LM_LINE_SPEED_UNKNOWN; + *pDuplexMode = LM_DUPLEX_MODE_UNKNOWN; + + /* determine media type */ + switch(RequestedMediaType) { + case LM_REQUESTED_MEDIA_TYPE_BNC: + *pMediaType = LM_MEDIA_TYPE_BNC; + *pLineSpeed = LM_LINE_SPEED_10MBPS; + *pDuplexMode = LM_DUPLEX_MODE_HALF; + break; + + case LM_REQUESTED_MEDIA_TYPE_UTP_AUTO: + *pMediaType = LM_MEDIA_TYPE_UTP; + break; + + case LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS: + *pMediaType = LM_MEDIA_TYPE_UTP; + *pLineSpeed = LM_LINE_SPEED_10MBPS; + *pDuplexMode = LM_DUPLEX_MODE_HALF; + break; + + case LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS_FULL_DUPLEX: + *pMediaType = LM_MEDIA_TYPE_UTP; + *pLineSpeed = LM_LINE_SPEED_10MBPS; + *pDuplexMode = LM_DUPLEX_MODE_FULL; + break; + + case LM_REQUESTED_MEDIA_TYPE_UTP_100MBPS: + *pMediaType = LM_MEDIA_TYPE_UTP; + *pLineSpeed = LM_LINE_SPEED_100MBPS; + *pDuplexMode = LM_DUPLEX_MODE_HALF; + break; + + case LM_REQUESTED_MEDIA_TYPE_UTP_100MBPS_FULL_DUPLEX: + *pMediaType = LM_MEDIA_TYPE_UTP; + *pLineSpeed = LM_LINE_SPEED_100MBPS; + *pDuplexMode = LM_DUPLEX_MODE_FULL; + break; + + case LM_REQUESTED_MEDIA_TYPE_UTP_1000MBPS: + *pMediaType = LM_MEDIA_TYPE_UTP; + *pLineSpeed = LM_LINE_SPEED_1000MBPS; + *pDuplexMode = LM_DUPLEX_MODE_HALF; + break; + + case LM_REQUESTED_MEDIA_TYPE_UTP_1000MBPS_FULL_DUPLEX: + *pMediaType = LM_MEDIA_TYPE_UTP; + *pLineSpeed = LM_LINE_SPEED_1000MBPS; + *pDuplexMode = LM_DUPLEX_MODE_FULL; + break; + + case LM_REQUESTED_MEDIA_TYPE_FIBER_100MBPS: + *pMediaType = LM_MEDIA_TYPE_FIBER; + *pLineSpeed = LM_LINE_SPEED_100MBPS; + *pDuplexMode = LM_DUPLEX_MODE_HALF; + break; + + case LM_REQUESTED_MEDIA_TYPE_FIBER_100MBPS_FULL_DUPLEX: + *pMediaType = LM_MEDIA_TYPE_FIBER; + *pLineSpeed = LM_LINE_SPEED_100MBPS; + *pDuplexMode = LM_DUPLEX_MODE_FULL; + break; + + case LM_REQUESTED_MEDIA_TYPE_FIBER_1000MBPS: + *pMediaType = LM_MEDIA_TYPE_FIBER; + *pLineSpeed = LM_LINE_SPEED_1000MBPS; + *pDuplexMode = LM_DUPLEX_MODE_HALF; + break; + + case LM_REQUESTED_MEDIA_TYPE_FIBER_1000MBPS_FULL_DUPLEX: + *pMediaType = LM_MEDIA_TYPE_FIBER; + *pLineSpeed = LM_LINE_SPEED_1000MBPS; + *pDuplexMode = LM_DUPLEX_MODE_FULL; + break; + + default: + break; + } /* switch */ + + return LM_STATUS_SUCCESS; +} /* LM_TranslateRequestedMediaType */ + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/* LM_STATUS_LINK_ACTIVE */ +/* LM_STATUS_LINK_DOWN */ +/******************************************************************************/ +static LM_STATUS +LM_InitBcm540xPhy( +PLM_DEVICE_BLOCK pDevice) +{ + LM_LINE_SPEED CurrentLineSpeed; + LM_DUPLEX_MODE CurrentDuplexMode; + LM_STATUS CurrentLinkStatus; + LM_UINT32 Value32; + LM_UINT32 j; + + if((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5401_PHY_ID) + { + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + + if(!pDevice->InitDone) + { + Value32 = 0; + } + + if(!(Value32 & PHY_STATUS_LINK_PASS)) + { + LM_WritePhy(pDevice, BCM5401_AUX_CTRL, 0x0c20); + + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x0012); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x1804); + + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x0013); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x1204); + + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x8006); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x0132); + + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x8006); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x0232); + + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x201f); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x0a20); + + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + for(j = 0; j < 1000; j++) + { + MM_Wait(10); + + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + if(Value32 & PHY_STATUS_LINK_PASS) + { + MM_Wait(40); + break; + } + } + + if((pDevice->PhyId & PHY_ID_REV_MASK) == PHY_BCM5401_B0_REV) + { + if(!(Value32 & PHY_STATUS_LINK_PASS) && + (pDevice->OldLineSpeed == LM_LINE_SPEED_1000MBPS)) + { + LM_WritePhy(pDevice, PHY_CTRL_REG, PHY_CTRL_PHY_RESET); + for(j = 0; j < 100; j++) + { + MM_Wait(10); + + LM_ReadPhy(pDevice, PHY_CTRL_REG, &Value32); + if(!(Value32 & PHY_CTRL_PHY_RESET)) + { + MM_Wait(40); + break; + } + } + + LM_WritePhy(pDevice, BCM5401_AUX_CTRL, 0x0c20); + + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x0012); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x1804); + + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x0013); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x1204); + + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x8006); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x0132); + + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x8006); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x0232); + + LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x201f); + LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x0a20); + } + } + } + } + else if(pDevice->ChipRevId == T3_CHIP_ID_5701_A0 || + pDevice->ChipRevId == T3_CHIP_ID_5701_B0) + { + /* Bug: 5701 A0, B0 TX CRC workaround. */ + LM_WritePhy(pDevice, 0x15, 0x0a75); + LM_WritePhy(pDevice, 0x1c, 0x8c68); + LM_WritePhy(pDevice, 0x1c, 0x8d68); + LM_WritePhy(pDevice, 0x1c, 0x8c68); + } + + /* Acknowledge interrupts. */ + LM_ReadPhy(pDevice, BCM540X_INT_STATUS_REG, &Value32); + LM_ReadPhy(pDevice, BCM540X_INT_STATUS_REG, &Value32); + + /* Configure the interrupt mask. */ + if(pDevice->PhyIntMode == T3_PHY_INT_MODE_MI_INTERRUPT) + { + LM_WritePhy(pDevice, BCM540X_INT_MASK_REG, ~BCM540X_INT_LINK_CHANGE); + } + + /* Configure PHY led mode. */ + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701 || + (T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700)) + { + if(pDevice->LedMode == LED_MODE_THREE_LINK) + { + LM_WritePhy(pDevice, BCM540X_EXT_CTRL_REG, + BCM540X_EXT_CTRL_LINK3_LED_MODE); + } + else + { + LM_WritePhy(pDevice, BCM540X_EXT_CTRL_REG, 0); + } + } + + CurrentLinkStatus = LM_STATUS_LINK_DOWN; + + /* Get current link and duplex mode. */ + for(j = 0; j < 100; j++) + { + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + + if(Value32 & PHY_STATUS_LINK_PASS) + { + break; + } + MM_Wait(40); + } + + if(Value32 & PHY_STATUS_LINK_PASS) + { + + /* Determine the current line and duplex settings. */ + LM_ReadPhy(pDevice, BCM540X_AUX_STATUS_REG, &Value32); + for(j = 0; j < 2000; j++) + { + MM_Wait(10); + + LM_ReadPhy(pDevice, BCM540X_AUX_STATUS_REG, &Value32); + if(Value32) + { + break; + } + } + + switch(Value32 & BCM540X_AUX_SPEED_MASK) + { + case BCM540X_AUX_10BASET_HD: + CurrentLineSpeed = LM_LINE_SPEED_10MBPS; + CurrentDuplexMode = LM_DUPLEX_MODE_HALF; + break; + + case BCM540X_AUX_10BASET_FD: + CurrentLineSpeed = LM_LINE_SPEED_10MBPS; + CurrentDuplexMode = LM_DUPLEX_MODE_FULL; + break; + + case BCM540X_AUX_100BASETX_HD: + CurrentLineSpeed = LM_LINE_SPEED_100MBPS; + CurrentDuplexMode = LM_DUPLEX_MODE_HALF; + break; + + case BCM540X_AUX_100BASETX_FD: + CurrentLineSpeed = LM_LINE_SPEED_100MBPS; + CurrentDuplexMode = LM_DUPLEX_MODE_FULL; + break; + + case BCM540X_AUX_100BASET_HD: + CurrentLineSpeed = LM_LINE_SPEED_1000MBPS; + CurrentDuplexMode = LM_DUPLEX_MODE_HALF; + break; + + case BCM540X_AUX_100BASET_FD: + CurrentLineSpeed = LM_LINE_SPEED_1000MBPS; + CurrentDuplexMode = LM_DUPLEX_MODE_FULL; + break; + + default: + + CurrentLineSpeed = LM_LINE_SPEED_UNKNOWN; + CurrentDuplexMode = LM_DUPLEX_MODE_UNKNOWN; + break; + } + + /* Make sure we are in auto-neg mode. */ + for (j = 0; j < 200; j++) + { + LM_ReadPhy(pDevice, PHY_CTRL_REG, &Value32); + if(Value32 && Value32 != 0x7fff) + { + break; + } + + if(Value32 == 0 && pDevice->RequestedMediaType == + LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS) + { + break; + } + + MM_Wait(10); + } + + /* Use the current line settings for "auto" mode. */ + if(pDevice->RequestedMediaType == LM_REQUESTED_MEDIA_TYPE_AUTO || + pDevice->RequestedMediaType == LM_REQUESTED_MEDIA_TYPE_UTP_AUTO) + { + if(Value32 & PHY_CTRL_AUTO_NEG_ENABLE) + { + CurrentLinkStatus = LM_STATUS_LINK_ACTIVE; + + /* We may be exiting low power mode and the link is in */ + /* 10mb. In this case, we need to restart autoneg. */ + LM_ReadPhy(pDevice, BCM540X_1000BASET_CTRL_REG, &Value32); + pDevice->advertising1000 = Value32; + /* 5702FE supports 10/100Mb only. */ + if(T3_ASIC_REV(pDevice->ChipRevId) != T3_ASIC_REV_5703 || + pDevice->BondId != GRC_MISC_BD_ID_5702FE) + { + if(!(Value32 & (BCM540X_AN_AD_1000BASET_HALF | + BCM540X_AN_AD_1000BASET_FULL))) + { + CurrentLinkStatus = LM_STATUS_LINK_SETTING_MISMATCH; + } + } + } + else + { + CurrentLinkStatus = LM_STATUS_LINK_SETTING_MISMATCH; + } + } + else + { + /* Force line settings. */ + /* Use the current setting if it matches the user's requested */ + /* setting. */ + LM_ReadPhy(pDevice, PHY_CTRL_REG, &Value32); + if((pDevice->LineSpeed == CurrentLineSpeed) && + (pDevice->DuplexMode == CurrentDuplexMode)) + { + if ((pDevice->DisableAutoNeg && + !(Value32 & PHY_CTRL_AUTO_NEG_ENABLE)) || + (!pDevice->DisableAutoNeg && + (Value32 & PHY_CTRL_AUTO_NEG_ENABLE))) + { + CurrentLinkStatus = LM_STATUS_LINK_ACTIVE; + } + else + { + CurrentLinkStatus = LM_STATUS_LINK_SETTING_MISMATCH; + } + } + else + { + CurrentLinkStatus = LM_STATUS_LINK_SETTING_MISMATCH; + } + } + + /* Save line settings. */ + pDevice->LineSpeed = CurrentLineSpeed; + pDevice->DuplexMode = CurrentDuplexMode; + pDevice->MediaType = LM_MEDIA_TYPE_UTP; + } + + return CurrentLinkStatus; +} /* LM_InitBcm540xPhy */ + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_STATUS +LM_SetFlowControl( + PLM_DEVICE_BLOCK pDevice, + LM_UINT32 LocalPhyAd, + LM_UINT32 RemotePhyAd) +{ + LM_FLOW_CONTROL FlowCap; + + /* Resolve flow control. */ + FlowCap = LM_FLOW_CONTROL_NONE; + + /* See Table 28B-3 of 802.3ab-1999 spec. */ + if(pDevice->FlowControlCap & LM_FLOW_CONTROL_AUTO_PAUSE) + { + if(LocalPhyAd & PHY_AN_AD_PAUSE_CAPABLE) + { + if(LocalPhyAd & PHY_AN_AD_ASYM_PAUSE) + { + if(RemotePhyAd & PHY_LINK_PARTNER_PAUSE_CAPABLE) + { + FlowCap = LM_FLOW_CONTROL_TRANSMIT_PAUSE | + LM_FLOW_CONTROL_RECEIVE_PAUSE; + } + else if(RemotePhyAd & PHY_LINK_PARTNER_ASYM_PAUSE) + { + FlowCap = LM_FLOW_CONTROL_RECEIVE_PAUSE; + } + } + else + { + if(RemotePhyAd & PHY_LINK_PARTNER_PAUSE_CAPABLE) + { + FlowCap = LM_FLOW_CONTROL_TRANSMIT_PAUSE | + LM_FLOW_CONTROL_RECEIVE_PAUSE; + } + } + } + else if(LocalPhyAd & PHY_AN_AD_ASYM_PAUSE) + { + if((RemotePhyAd & PHY_LINK_PARTNER_PAUSE_CAPABLE) && + (RemotePhyAd & PHY_LINK_PARTNER_ASYM_PAUSE)) + { + FlowCap = LM_FLOW_CONTROL_TRANSMIT_PAUSE; + } + } + } + else + { + FlowCap = pDevice->FlowControlCap; + } + + /* Enable/disable rx PAUSE. */ + pDevice->RxMode &= ~RX_MODE_ENABLE_FLOW_CONTROL; + if(FlowCap & LM_FLOW_CONTROL_RECEIVE_PAUSE && + (pDevice->FlowControlCap == LM_FLOW_CONTROL_AUTO_PAUSE || + pDevice->FlowControlCap & LM_FLOW_CONTROL_RECEIVE_PAUSE)) + { + pDevice->FlowControl |= LM_FLOW_CONTROL_RECEIVE_PAUSE; + pDevice->RxMode |= RX_MODE_ENABLE_FLOW_CONTROL; + + } + REG_WR(pDevice, MacCtrl.RxMode, pDevice->RxMode); + + /* Enable/disable tx PAUSE. */ + pDevice->TxMode &= ~TX_MODE_ENABLE_FLOW_CONTROL; + if(FlowCap & LM_FLOW_CONTROL_TRANSMIT_PAUSE && + (pDevice->FlowControlCap == LM_FLOW_CONTROL_AUTO_PAUSE || + pDevice->FlowControlCap & LM_FLOW_CONTROL_TRANSMIT_PAUSE)) + { + pDevice->FlowControl |= LM_FLOW_CONTROL_TRANSMIT_PAUSE; + pDevice->TxMode |= TX_MODE_ENABLE_FLOW_CONTROL; + + } + REG_WR(pDevice, MacCtrl.TxMode, pDevice->TxMode); + + return LM_STATUS_SUCCESS; +} + + +#if INCLUDE_TBI_SUPPORT +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +STATIC LM_STATUS +LM_InitBcm800xPhy( + PLM_DEVICE_BLOCK pDevice) +{ + LM_UINT32 Value32; + LM_UINT32 j; + + Value32 = REG_RD(pDevice, MacCtrl.Status); + + /* Reset the SERDES during init and when we have link. */ + if(!pDevice->InitDone || Value32 & MAC_STATUS_PCS_SYNCED) + { + /* Set PLL lock range. */ + LM_WritePhy(pDevice, 0x16, 0x8007); + + /* Software reset. */ + LM_WritePhy(pDevice, 0x00, 0x8000); + + /* Wait for reset to complete. */ + for(j = 0; j < 500; j++) + { + MM_Wait(10); + } + +#if DBG + /* Verify lock (if cable attached). Should be 0x8001. */ + LM_ReadPhy(pDevice, 0x10, &Value32); + DbgMessage(INFORM, ("FiberPhy 0x10 = 0x%x\n", Value32)); +#endif + + /* Config mode; seletct PMA/Ch 1 regs. */ + LM_WritePhy(pDevice, 0x10, 0x8411); + + /* Enable auto-lock and comdet, select txclk for tx. */ + LM_WritePhy(pDevice, 0x11, 0x0a10); + + LM_WritePhy(pDevice, 0x18, 0x00a0); + LM_WritePhy(pDevice, 0x16, 0x41ff); + + /* Assert and deassert POR. */ + LM_WritePhy(pDevice, 0x13, 0x0400); + MM_Wait(40); + LM_WritePhy(pDevice, 0x13, 0x0000); + + LM_WritePhy(pDevice, 0x11, 0x0a50); + MM_Wait(40); + LM_WritePhy(pDevice, 0x11, 0x0a10); + + /* Delay for signal to stabilize. */ + for(j = 0; j < 15000; j++) + { + MM_Wait(10); + } + + /* Deselect the channel register so we can read the PHY id later. */ + LM_WritePhy(pDevice, 0x10, 0x8011); + } + + return LM_STATUS_SUCCESS; +} + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +STATIC LM_STATUS +LM_SetupFiberPhy( + PLM_DEVICE_BLOCK pDevice) +{ + LM_STATUS CurrentLinkStatus; + AUTONEG_STATUS AnStatus = 0; + LM_UINT32 Value32; + LM_UINT32 Cnt; + LM_UINT32 j, k; + + pDevice->MacMode &= ~(MAC_MODE_HALF_DUPLEX | MAC_MODE_PORT_MODE_MASK); + + /* Initialize the send_config register. */ + REG_WR(pDevice, MacCtrl.TxAutoNeg, 0); + + /* Enable TBI and full duplex mode. */ + pDevice->MacMode |= MAC_MODE_PORT_MODE_TBI; + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode); + + /* Initialize the BCM8002 SERDES PHY. */ + switch(pDevice->PhyId & PHY_ID_MASK) + { + case PHY_BCM8002_PHY_ID: + LM_InitBcm800xPhy(pDevice); + break; + + default: + break; + } + + /* Enable link change interrupt. */ + REG_WR(pDevice, MacCtrl.MacEvent, MAC_EVENT_ENABLE_LINK_STATE_CHANGED_ATTN); + + /* Default to link down. */ + CurrentLinkStatus = LM_STATUS_LINK_DOWN; + + /* Get the link status. */ + Value32 = REG_RD(pDevice, MacCtrl.Status); + if(Value32 & MAC_STATUS_PCS_SYNCED) + { + if((pDevice->RequestedMediaType == LM_REQUESTED_MEDIA_TYPE_AUTO) || + (pDevice->DisableAutoNeg == FALSE)) + { + /* auto-negotiation mode. */ + /* Initialize the autoneg default capaiblities. */ + AutonegInit(&pDevice->AnInfo); + + /* Set the context pointer to point to the main device structure. */ + pDevice->AnInfo.pContext = pDevice; + + /* Setup flow control advertisement register. */ + Value32 = GetPhyAdFlowCntrlSettings(pDevice); + if(Value32 & PHY_AN_AD_PAUSE_CAPABLE) + { + pDevice->AnInfo.mr_adv_sym_pause = 1; + } + else + { + pDevice->AnInfo.mr_adv_sym_pause = 0; + } + + if(Value32 & PHY_AN_AD_ASYM_PAUSE) + { + pDevice->AnInfo.mr_adv_asym_pause = 1; + } + else + { + pDevice->AnInfo.mr_adv_asym_pause = 0; + } + + /* Try to autoneg up to six times. */ + if (pDevice->IgnoreTbiLinkChange) + { + Cnt = 1; + } + else + { + Cnt = 6; + } + for (j = 0; j < Cnt; j++) + { + REG_WR(pDevice, MacCtrl.TxAutoNeg, 0); + + Value32 = pDevice->MacMode & ~MAC_MODE_PORT_MODE_MASK; + REG_WR(pDevice, MacCtrl.Mode, Value32); + MM_Wait(20); + + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode | + MAC_MODE_SEND_CONFIGS); + + MM_Wait(20); + + pDevice->AnInfo.State = AN_STATE_UNKNOWN; + pDevice->AnInfo.CurrentTime_us = 0; + + REG_WR(pDevice, Grc.Timer, 0); + for(k = 0; (pDevice->AnInfo.CurrentTime_us < 75000) && + (k < 75000); k++) + { + AnStatus = Autoneg8023z(&pDevice->AnInfo); + + if((AnStatus == AUTONEG_STATUS_DONE) || + (AnStatus == AUTONEG_STATUS_FAILED)) + { + break; + } + + pDevice->AnInfo.CurrentTime_us = REG_RD(pDevice, Grc.Timer); + + } + if((AnStatus == AUTONEG_STATUS_DONE) || + (AnStatus == AUTONEG_STATUS_FAILED)) + { + break; + } + if (j >= 1) + { + if (!(REG_RD(pDevice, MacCtrl.Status) & + MAC_STATUS_PCS_SYNCED)) { + break; + } + } + } + + /* Stop sending configs. */ + MM_AnTxIdle(&pDevice->AnInfo); + + /* Resolve flow control settings. */ + if((AnStatus == AUTONEG_STATUS_DONE) && + pDevice->AnInfo.mr_an_complete && pDevice->AnInfo.mr_link_ok && + pDevice->AnInfo.mr_lp_adv_full_duplex) + { + LM_UINT32 RemotePhyAd; + LM_UINT32 LocalPhyAd; + + LocalPhyAd = 0; + if(pDevice->AnInfo.mr_adv_sym_pause) + { + LocalPhyAd |= PHY_AN_AD_PAUSE_CAPABLE; + } + + if(pDevice->AnInfo.mr_adv_asym_pause) + { + LocalPhyAd |= PHY_AN_AD_ASYM_PAUSE; + } + + RemotePhyAd = 0; + if(pDevice->AnInfo.mr_lp_adv_sym_pause) + { + RemotePhyAd |= PHY_LINK_PARTNER_PAUSE_CAPABLE; + } + + if(pDevice->AnInfo.mr_lp_adv_asym_pause) + { + RemotePhyAd |= PHY_LINK_PARTNER_ASYM_PAUSE; + } + + LM_SetFlowControl(pDevice, LocalPhyAd, RemotePhyAd); + + CurrentLinkStatus = LM_STATUS_LINK_ACTIVE; + } + for (j = 0; j < 30; j++) + { + MM_Wait(20); + REG_WR(pDevice, MacCtrl.Status, MAC_STATUS_SYNC_CHANGED | + MAC_STATUS_CFG_CHANGED); + MM_Wait(20); + if ((REG_RD(pDevice, MacCtrl.Status) & + (MAC_STATUS_SYNC_CHANGED | MAC_STATUS_CFG_CHANGED)) == 0) + break; + } + if (pDevice->PollTbiLink) + { + Value32 = REG_RD(pDevice, MacCtrl.Status); + if (Value32 & MAC_STATUS_RECEIVING_CFG) + { + pDevice->IgnoreTbiLinkChange = TRUE; + } + else + { + pDevice->IgnoreTbiLinkChange = FALSE; + } + } + Value32 = REG_RD(pDevice, MacCtrl.Status); + if (CurrentLinkStatus == LM_STATUS_LINK_DOWN && + (Value32 & MAC_STATUS_PCS_SYNCED) && + ((Value32 & MAC_STATUS_RECEIVING_CFG) == 0)) + { + CurrentLinkStatus = LM_STATUS_LINK_ACTIVE; + } + } + else + { + /* We are forcing line speed. */ + pDevice->FlowControlCap &= ~LM_FLOW_CONTROL_AUTO_PAUSE; + LM_SetFlowControl(pDevice, 0, 0); + + CurrentLinkStatus = LM_STATUS_LINK_ACTIVE; + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode | + MAC_MODE_SEND_CONFIGS); + } + } + /* Set the link polarity bit. */ + pDevice->MacMode &= ~MAC_MODE_LINK_POLARITY; + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode); + + pDevice->pStatusBlkVirt->Status = STATUS_BLOCK_UPDATED | + (pDevice->pStatusBlkVirt->Status & ~STATUS_BLOCK_LINK_CHANGED_STATUS); + + for (j = 0; j < 100; j++) + { + REG_WR(pDevice, MacCtrl.Status, MAC_STATUS_SYNC_CHANGED | + MAC_STATUS_CFG_CHANGED); + MM_Wait(5); + if ((REG_RD(pDevice, MacCtrl.Status) & + (MAC_STATUS_SYNC_CHANGED | MAC_STATUS_CFG_CHANGED)) == 0) + break; + } + + Value32 = REG_RD(pDevice, MacCtrl.Status); + if((Value32 & MAC_STATUS_PCS_SYNCED) == 0) + { + CurrentLinkStatus = LM_STATUS_LINK_DOWN; + if (pDevice->DisableAutoNeg == FALSE) + { + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode | + MAC_MODE_SEND_CONFIGS); + MM_Wait(1); + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode); + } + } + + /* Initialize the current link status. */ + if(CurrentLinkStatus == LM_STATUS_LINK_ACTIVE) + { + pDevice->LineSpeed = LM_LINE_SPEED_1000MBPS; + pDevice->DuplexMode = LM_DUPLEX_MODE_FULL; + REG_WR(pDevice, MacCtrl.LedCtrl, LED_CTRL_OVERRIDE_LINK_LED | + LED_CTRL_1000MBPS_LED_ON); + } + else + { + pDevice->LineSpeed = LM_LINE_SPEED_UNKNOWN; + pDevice->DuplexMode = LM_DUPLEX_MODE_UNKNOWN; + REG_WR(pDevice, MacCtrl.LedCtrl, LED_CTRL_OVERRIDE_LINK_LED | + LED_CTRL_OVERRIDE_TRAFFIC_LED); + } + + /* Indicate link status. */ + if (pDevice->LinkStatus != CurrentLinkStatus) { + pDevice->LinkStatus = CurrentLinkStatus; + MM_IndicateStatus(pDevice, CurrentLinkStatus); + } + + return LM_STATUS_SUCCESS; +} +#endif /* INCLUDE_TBI_SUPPORT */ + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_STATUS +LM_SetupCopperPhy( + PLM_DEVICE_BLOCK pDevice) +{ + LM_STATUS CurrentLinkStatus; + LM_UINT32 Value32; + + /* Assume there is not link first. */ + CurrentLinkStatus = LM_STATUS_LINK_DOWN; + + /* Disable phy link change attention. */ + REG_WR(pDevice, MacCtrl.MacEvent, 0); + + /* Clear link change attention. */ + REG_WR(pDevice, MacCtrl.Status, MAC_STATUS_SYNC_CHANGED | + MAC_STATUS_CFG_CHANGED); + + /* Disable auto-polling for the moment. */ + pDevice->MiMode = 0xc0000; + REG_WR(pDevice, MacCtrl.MiMode, pDevice->MiMode); + MM_Wait(40); + + /* Determine the requested line speed and duplex. */ + pDevice->OldLineSpeed = pDevice->LineSpeed; + LM_TranslateRequestedMediaType(pDevice->RequestedMediaType, + &pDevice->MediaType, &pDevice->LineSpeed, &pDevice->DuplexMode); + + /* Initialize the phy chip. */ + switch(pDevice->PhyId & PHY_ID_MASK) + { + case PHY_BCM5400_PHY_ID: + case PHY_BCM5401_PHY_ID: + case PHY_BCM5411_PHY_ID: + case PHY_BCM5701_PHY_ID: + case PHY_BCM5703_PHY_ID: + CurrentLinkStatus = LM_InitBcm540xPhy(pDevice); + break; + + default: + break; + } + + if(CurrentLinkStatus == LM_STATUS_LINK_SETTING_MISMATCH) + { + CurrentLinkStatus = LM_STATUS_LINK_DOWN; + } + + /* Setup flow control. */ + pDevice->FlowControl = LM_FLOW_CONTROL_NONE; + if(CurrentLinkStatus == LM_STATUS_LINK_ACTIVE) + { + LM_FLOW_CONTROL FlowCap; /* Flow control capability. */ + + FlowCap = LM_FLOW_CONTROL_NONE; + + if(pDevice->DuplexMode == LM_DUPLEX_MODE_FULL) + { + if(pDevice->DisableAutoNeg == FALSE || + pDevice->RequestedMediaType == LM_REQUESTED_MEDIA_TYPE_AUTO || + pDevice->RequestedMediaType == LM_REQUESTED_MEDIA_TYPE_UTP_AUTO) + { + LM_UINT32 ExpectedPhyAd; + LM_UINT32 LocalPhyAd; + LM_UINT32 RemotePhyAd; + + LM_ReadPhy(pDevice, PHY_AN_AD_REG, &LocalPhyAd); + pDevice->advertising = LocalPhyAd; + LocalPhyAd &= (PHY_AN_AD_ASYM_PAUSE | PHY_AN_AD_PAUSE_CAPABLE); + + ExpectedPhyAd = GetPhyAdFlowCntrlSettings(pDevice); + + if(LocalPhyAd != ExpectedPhyAd) + { + CurrentLinkStatus = LM_STATUS_LINK_DOWN; + } + else + { + LM_ReadPhy(pDevice, PHY_LINK_PARTNER_ABILITY_REG, + &RemotePhyAd); + + LM_SetFlowControl(pDevice, LocalPhyAd, RemotePhyAd); + } + } + else + { + pDevice->FlowControlCap &= ~LM_FLOW_CONTROL_AUTO_PAUSE; + LM_SetFlowControl(pDevice, 0, 0); + } + } + } + + if(CurrentLinkStatus == LM_STATUS_LINK_DOWN) + { + LM_ForceAutoNeg(pDevice, pDevice->RequestedMediaType, FALSE); + + /* If we force line speed, we make get link right away. */ + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + if(Value32 & PHY_STATUS_LINK_PASS) + { + CurrentLinkStatus = LM_STATUS_LINK_ACTIVE; + } + } + + /* GMII interface. */ + pDevice->MacMode &= ~MAC_MODE_PORT_MODE_MASK; + if(CurrentLinkStatus == LM_STATUS_LINK_ACTIVE) + { + if(pDevice->LineSpeed == LM_LINE_SPEED_100MBPS || + pDevice->LineSpeed == LM_LINE_SPEED_10MBPS) + { + pDevice->MacMode |= MAC_MODE_PORT_MODE_MII; + } + else + { + pDevice->MacMode |= MAC_MODE_PORT_MODE_GMII; + } + } + else { + pDevice->MacMode |= MAC_MODE_PORT_MODE_GMII; + } + + /* Set the MAC to operate in the appropriate duplex mode. */ + pDevice->MacMode &= ~MAC_MODE_HALF_DUPLEX; + if(pDevice->DuplexMode == LM_DUPLEX_MODE_HALF) + { + pDevice->MacMode |= MAC_MODE_HALF_DUPLEX; + } + + /* Set the link polarity bit. */ + pDevice->MacMode &= ~MAC_MODE_LINK_POLARITY; + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700) + { + if((pDevice->LedMode == LED_MODE_LINK10) || + (CurrentLinkStatus == LM_STATUS_LINK_ACTIVE && + pDevice->LineSpeed == LM_LINE_SPEED_10MBPS)) + { + pDevice->MacMode |= MAC_MODE_LINK_POLARITY; + } + } + else + { + if (CurrentLinkStatus == LM_STATUS_LINK_ACTIVE) + { + pDevice->MacMode |= MAC_MODE_LINK_POLARITY; + } + + /* Set LED mode. */ + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 || + T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) + { + Value32 = LED_CTRL_PHY_MODE_1; + } + else + { + if(pDevice->LedMode == LED_MODE_OUTPUT) + { + Value32 = LED_CTRL_PHY_MODE_2; + } + else + { + Value32 = LED_CTRL_PHY_MODE_1; + } + } + REG_WR(pDevice, MacCtrl.LedCtrl, Value32); + } + + REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode); + + /* Enable auto polling. */ + if(pDevice->PhyIntMode == T3_PHY_INT_MODE_AUTO_POLLING) + { + pDevice->MiMode |= MI_MODE_AUTO_POLLING_ENABLE; + REG_WR(pDevice, MacCtrl.MiMode, pDevice->MiMode); + } + + /* Enable phy link change attention. */ + if(pDevice->PhyIntMode == T3_PHY_INT_MODE_MI_INTERRUPT) + { + REG_WR(pDevice, MacCtrl.MacEvent, MAC_EVENT_ENABLE_MI_INTERRUPT); + } + else + { + REG_WR(pDevice, MacCtrl.MacEvent, + MAC_EVENT_ENABLE_LINK_STATE_CHANGED_ATTN); + } + if ((T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700) && + (CurrentLinkStatus == LM_STATUS_LINK_ACTIVE) && + (pDevice->LineSpeed == LM_LINE_SPEED_1000MBPS) && + (((pDevice->PciState & T3_PCI_STATE_CONVENTIONAL_PCI_MODE) && + (pDevice->PciState & T3_PCI_STATE_BUS_SPEED_HIGH)) || + !(pDevice->PciState & T3_PCI_STATE_CONVENTIONAL_PCI_MODE))) + { + MM_Wait(120); + REG_WR(pDevice, MacCtrl.Status, MAC_STATUS_SYNC_CHANGED | + MAC_STATUS_CFG_CHANGED); + MEM_WR_OFFSET(pDevice, T3_FIRMWARE_MAILBOX, + T3_MAGIC_NUM_DISABLE_DMAW_ON_LINK_CHANGE); + } + + /* Indicate link status. */ + if (pDevice->LinkStatus != CurrentLinkStatus) { + pDevice->LinkStatus = CurrentLinkStatus; + MM_IndicateStatus(pDevice, CurrentLinkStatus); + } + + return LM_STATUS_SUCCESS; +} /* LM_SetupCopperPhy */ + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_STATUS +LM_SetupPhy( + PLM_DEVICE_BLOCK pDevice) +{ + LM_STATUS LmStatus; + +#if INCLUDE_TBI_SUPPORT + if(pDevice->EnableTbi) + { + LmStatus = LM_SetupFiberPhy(pDevice); + } + else +#endif /* INCLUDE_TBI_SUPPORT */ + { + LmStatus = LM_SetupCopperPhy(pDevice); + } + if ((pDevice->LineSpeed == LM_LINE_SPEED_1000MBPS) && + (pDevice->DuplexMode == LM_DUPLEX_MODE_HALF)) + { + REG_WR(pDevice, MacCtrl.TxLengths, 0x26ff); + } + else + { + REG_WR(pDevice, MacCtrl.TxLengths, 0x2620); + } + + return LmStatus; +} + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_VOID +LM_ReadPhy( +PLM_DEVICE_BLOCK pDevice, +LM_UINT32 PhyReg, +PLM_UINT32 pData32) { + LM_UINT32 Value32; + LM_UINT32 j; + + if(pDevice->PhyIntMode == T3_PHY_INT_MODE_AUTO_POLLING) + { + REG_WR(pDevice, MacCtrl.MiMode, pDevice->MiMode & + ~MI_MODE_AUTO_POLLING_ENABLE); + MM_Wait(40); + } + + Value32 = (pDevice->PhyAddr << MI_COM_FIRST_PHY_ADDR_BIT) | + ((PhyReg & MI_COM_PHY_REG_ADDR_MASK) << MI_COM_FIRST_PHY_REG_ADDR_BIT) | + MI_COM_CMD_READ | MI_COM_START; + + REG_WR(pDevice, MacCtrl.MiCom, Value32); + + for(j = 0; j < 20; j++) + { + MM_Wait(25); + + Value32 = REG_RD(pDevice, MacCtrl.MiCom); + + if(!(Value32 & MI_COM_BUSY)) + { + MM_Wait(5); + Value32 = REG_RD(pDevice, MacCtrl.MiCom); + Value32 &= MI_COM_PHY_DATA_MASK; + break; + } + } + + if(Value32 & MI_COM_BUSY) + { + Value32 = 0; + } + + *pData32 = Value32; + + if(pDevice->PhyIntMode == T3_PHY_INT_MODE_AUTO_POLLING) + { + REG_WR(pDevice, MacCtrl.MiMode, pDevice->MiMode); + MM_Wait(40); + } +} /* LM_ReadPhy */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_VOID +LM_WritePhy( +PLM_DEVICE_BLOCK pDevice, +LM_UINT32 PhyReg, +LM_UINT32 Data32) { + LM_UINT32 Value32; + LM_UINT32 j; + + if(pDevice->PhyIntMode == T3_PHY_INT_MODE_AUTO_POLLING) + { + REG_WR(pDevice, MacCtrl.MiMode, pDevice->MiMode & + ~MI_MODE_AUTO_POLLING_ENABLE); + MM_Wait(40); + } + + Value32 = (pDevice->PhyAddr << MI_COM_FIRST_PHY_ADDR_BIT) | + ((PhyReg & MI_COM_PHY_REG_ADDR_MASK) << MI_COM_FIRST_PHY_REG_ADDR_BIT) | + (Data32 & MI_COM_PHY_DATA_MASK) | MI_COM_CMD_WRITE | MI_COM_START; + + REG_WR(pDevice, MacCtrl.MiCom, Value32); + + for(j = 0; j < 20; j++) + { + MM_Wait(25); + + Value32 = REG_RD(pDevice, MacCtrl.MiCom); + + if(!(Value32 & MI_COM_BUSY)) + { + MM_Wait(5); + break; + } + } + + if(pDevice->PhyIntMode == T3_PHY_INT_MODE_AUTO_POLLING) + { + REG_WR(pDevice, MacCtrl.MiMode, pDevice->MiMode); + MM_Wait(40); + } +} /* LM_WritePhy */ + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_STATUS +LM_SetPowerState( +PLM_DEVICE_BLOCK pDevice, +LM_POWER_STATE PowerLevel) { + LM_UINT32 PmeSupport; + LM_UINT32 Value32; + LM_UINT32 PmCtrl; + + /* make sureindirect accesses are enabled*/ + MM_WriteConfig32(pDevice, T3_PCI_MISC_HOST_CTRL_REG, pDevice->MiscHostCtrl); + + /* Clear the PME_ASSERT bit and the power state bits. Also enable */ + /* the PME bit. */ + MM_ReadConfig32(pDevice, T3_PCI_PM_STATUS_CTRL_REG, &PmCtrl); + + PmCtrl |= T3_PM_PME_ASSERTED; + PmCtrl &= ~T3_PM_POWER_STATE_MASK; + + /* Set the appropriate power state. */ + if(PowerLevel == LM_POWER_STATE_D0) + { + + /* Bring the card out of low power mode. */ + PmCtrl |= T3_PM_POWER_STATE_D0; + MM_WriteConfig32(pDevice, T3_PCI_PM_STATUS_CTRL_REG, PmCtrl); + + REG_WR(pDevice, Grc.LocalCtrl, pDevice->GrcLocalCtrl); + MM_Wait(40); /* Required delay is about 20us. */ + LM_WritePhy(pDevice, BCM5401_AUX_CTRL, 0x02); + + return LM_STATUS_SUCCESS; + } + else if(PowerLevel == LM_POWER_STATE_D1) + { + PmCtrl |= T3_PM_POWER_STATE_D1; + } + else if(PowerLevel == LM_POWER_STATE_D2) + { + PmCtrl |= T3_PM_POWER_STATE_D2; + } + else if(PowerLevel == LM_POWER_STATE_D3) + { + PmCtrl |= T3_PM_POWER_STATE_D3; + } + else + { + return LM_STATUS_FAILURE; + } + PmCtrl |= T3_PM_PME_ENABLE; + +#if 0 + /* No WOL. */ + if(pDevice->WakeUpModeCap == LM_WAKE_UP_MODE_NONE) + { + DbgMessage(INFORM, ("No power capabilities.\n")); + return LM_STATUS_FAILURE; + } +#endif + + /* Mask out all interrupts so LM_SetupPhy won't be called while we are */ + /* setting new line speed. */ + Value32 = REG_RD(pDevice, PciCfg.MiscHostCtrl); + REG_WR(pDevice, PciCfg.MiscHostCtrl, Value32 | MISC_HOST_CTRL_MASK_PCI_INT); + + if(!pDevice->RestoreOnWakeUp) + { + pDevice->RestoreOnWakeUp = TRUE; + pDevice->WakeUpDisableAutoNeg = pDevice->DisableAutoNeg; + pDevice->WakeUpRequestedMediaType = pDevice->RequestedMediaType; + } + + /* Force auto-negotiation to 10 line speed. */ + pDevice->DisableAutoNeg = FALSE; + pDevice->RequestedMediaType = LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS; + LM_SetupPhy(pDevice); + + /* Put the driver in the initial state, and go through the power down */ + /* sequence. */ + LM_Halt(pDevice); + + MM_ReadConfig32(pDevice, T3_PCI_PM_CAP_REG, &PmeSupport); + + if (pDevice->WakeUpModeCap != LM_WAKE_UP_MODE_NONE) + { + + /* Enable WOL. */ + LM_WritePhy(pDevice, BCM5401_AUX_CTRL, 0x5a); + MM_Wait(40); + + /* Set LED mode. */ + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 || + T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) + { + Value32 = LED_CTRL_PHY_MODE_1; + } + else + { + if(pDevice->LedMode == LED_MODE_OUTPUT) + { + Value32 = LED_CTRL_PHY_MODE_2; + } + else + { + Value32 = LED_CTRL_PHY_MODE_1; + } + } + + Value32 = MAC_MODE_PORT_MODE_MII; + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700) + { + if(pDevice->LedMode == LED_MODE_LINK10 || + pDevice->WolSpeed == WOL_SPEED_10MB) + { + Value32 |= MAC_MODE_LINK_POLARITY; + } + } + else + { + Value32 |= MAC_MODE_LINK_POLARITY; + } + + /* Always enable magic packet wake-up if we have vaux. */ + if((PmeSupport & T3_PCI_PM_CAP_PME_D3COLD) && + (pDevice->WakeUpModeCap & LM_WAKE_UP_MODE_MAGIC_PACKET)) + { + Value32 |= MAC_MODE_DETECT_MAGIC_PACKET_ENABLE; + } + + REG_WR(pDevice, MacCtrl.Mode, Value32); + + /* Enable the receiver. */ + REG_WR(pDevice, MacCtrl.RxMode, RX_MODE_ENABLE); + } + + /* Disable tx/rx clocks, and seletect an alternate clock. */ + if(pDevice->WolSpeed == WOL_SPEED_100MB) + { + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 || + T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) + { + Value32 = T3_PCI_DISABLE_RX_CLOCK | T3_PCI_DISABLE_TX_CLOCK | + T3_PCI_SELECT_ALTERNATE_CLOCK; + } + else + { + Value32 = T3_PCI_SELECT_ALTERNATE_CLOCK; + } + REG_WR(pDevice, PciCfg.ClockCtrl, Value32); + + MM_Wait(40); + + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 || + T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) + { + Value32 = T3_PCI_DISABLE_RX_CLOCK | T3_PCI_DISABLE_TX_CLOCK | + T3_PCI_SELECT_ALTERNATE_CLOCK | T3_PCI_44MHZ_CORE_CLOCK; + } + else + { + Value32 = T3_PCI_SELECT_ALTERNATE_CLOCK | + T3_PCI_44MHZ_CORE_CLOCK; + } + + REG_WR(pDevice, PciCfg.ClockCtrl, Value32); + + MM_Wait(40); + + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 || + T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) + { + Value32 = T3_PCI_DISABLE_RX_CLOCK | T3_PCI_DISABLE_TX_CLOCK | + T3_PCI_44MHZ_CORE_CLOCK; + } + else + { + Value32 = T3_PCI_44MHZ_CORE_CLOCK; + } + + REG_WR(pDevice, PciCfg.ClockCtrl, Value32); + } + else + { + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 || + T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) + { + Value32 = T3_PCI_DISABLE_RX_CLOCK | T3_PCI_DISABLE_TX_CLOCK | + T3_PCI_SELECT_ALTERNATE_CLOCK | + T3_PCI_POWER_DOWN_PCI_PLL133; + } + else + { + Value32 = T3_PCI_SELECT_ALTERNATE_CLOCK | + T3_PCI_POWER_DOWN_PCI_PLL133; + } + + REG_WR(pDevice, PciCfg.ClockCtrl, Value32); + } + + MM_Wait(40); + + if(!pDevice->EepromWp && (pDevice->WakeUpModeCap != LM_WAKE_UP_MODE_NONE)) + { + /* Switch adapter to auxilliary power. */ + if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 || + T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) + { + /* GPIO0 = 1, GPIO1 = 1, GPIO2 = 0. */ + REG_WR(pDevice, Grc.LocalCtrl, pDevice->GrcLocalCtrl | + GRC_MISC_LOCAL_CTRL_GPIO_OE0 | + GRC_MISC_LOCAL_CTRL_GPIO_OE1 | + GRC_MISC_LOCAL_CTRL_GPIO_OE2 | + GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT0 | + GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT1); + MM_Wait(40); + } + else + { + /* GPIO0 = 0, GPIO1 = 1, GPIO2 = 1. */ + REG_WR(pDevice, Grc.LocalCtrl, pDevice->GrcLocalCtrl | + GRC_MISC_LOCAL_CTRL_GPIO_OE0 | + GRC_MISC_LOCAL_CTRL_GPIO_OE1 | + GRC_MISC_LOCAL_CTRL_GPIO_OE2 | + GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT1 | + GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT2); + MM_Wait(40); + + /* GPIO0 = 1, GPIO1 = 1, GPIO2 = 1. */ + REG_WR(pDevice, Grc.LocalCtrl, pDevice->GrcLocalCtrl | + GRC_MISC_LOCAL_CTRL_GPIO_OE0 | + GRC_MISC_LOCAL_CTRL_GPIO_OE1 | + GRC_MISC_LOCAL_CTRL_GPIO_OE2 | + GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT0 | + GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT1 | + GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT2); + MM_Wait(40); + + /* GPIO0 = 1, GPIO1 = 1, GPIO2 = 0. */ + REG_WR(pDevice, Grc.LocalCtrl, pDevice->GrcLocalCtrl | + GRC_MISC_LOCAL_CTRL_GPIO_OE0 | + GRC_MISC_LOCAL_CTRL_GPIO_OE1 | + GRC_MISC_LOCAL_CTRL_GPIO_OE2 | + GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT0 | + GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT1); + MM_Wait(40); + } + } + + /* Set the phy to low power mode. */ + /* Put the the hardware in low power mode. */ + MM_WriteConfig32(pDevice, T3_PCI_PM_STATUS_CTRL_REG, PmCtrl); + + return LM_STATUS_SUCCESS; +} /* LM_SetPowerState */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +static LM_UINT32 +GetPhyAdFlowCntrlSettings( + PLM_DEVICE_BLOCK pDevice) +{ + LM_UINT32 Value32; + + Value32 = 0; + + /* Auto negotiation flow control only when autonegotiation is enabled. */ + if(pDevice->DisableAutoNeg == FALSE || + pDevice->RequestedMediaType == LM_REQUESTED_MEDIA_TYPE_AUTO || + pDevice->RequestedMediaType == LM_REQUESTED_MEDIA_TYPE_UTP_AUTO) + { + /* Please refer to Table 28B-3 of the 802.3ab-1999 spec. */ + if((pDevice->FlowControlCap == LM_FLOW_CONTROL_AUTO_PAUSE) || + ((pDevice->FlowControlCap & LM_FLOW_CONTROL_RECEIVE_PAUSE) && + (pDevice->FlowControlCap & LM_FLOW_CONTROL_TRANSMIT_PAUSE))) + { + Value32 |= PHY_AN_AD_PAUSE_CAPABLE; + } + else if(pDevice->FlowControlCap & LM_FLOW_CONTROL_TRANSMIT_PAUSE) + { + Value32 |= PHY_AN_AD_ASYM_PAUSE; + } + else if(pDevice->FlowControlCap & LM_FLOW_CONTROL_RECEIVE_PAUSE) + { + Value32 |= PHY_AN_AD_PAUSE_CAPABLE | PHY_AN_AD_ASYM_PAUSE; + } + } + + return Value32; +} + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/* LM_STATUS_FAILURE */ +/* LM_STATUS_SUCCESS */ +/* */ +/* If WaitForLink is TRUE, the return code is one of the following. */ +/* LM_STATUS_LINK_DOWN */ +/* LM_STATUS_LINK_ACTIVE */ +/******************************************************************************/ +static LM_STATUS +LM_ForceAutoNegBcm540xPhy( +PLM_DEVICE_BLOCK pDevice, +LM_REQUESTED_MEDIA_TYPE RequestedMediaType, +LM_BOOL WaitForLink) +{ + LM_MEDIA_TYPE MediaType; + LM_LINE_SPEED LineSpeed; + LM_DUPLEX_MODE DuplexMode; + LM_UINT32 NewPhyCtrl; + LM_STATUS LmStatus; + LM_UINT32 Value32; + LM_UINT32 Cnt; + + /* Get the interface type, line speed, and duplex mode. */ + LM_TranslateRequestedMediaType(RequestedMediaType, &MediaType, &LineSpeed, + &DuplexMode); + + if (pDevice->RestoreOnWakeUp) + { + LM_WritePhy(pDevice, BCM540X_1000BASET_CTRL_REG, 0); + pDevice->advertising1000 = 0; + Value32 = PHY_AN_AD_10BASET_FULL | PHY_AN_AD_10BASET_HALF; + if (pDevice->WolSpeed == WOL_SPEED_100MB) + { + Value32 |= PHY_AN_AD_100BASETX_FULL | PHY_AN_AD_100BASETX_HALF; + } + Value32 |= PHY_AN_AD_PROTOCOL_802_3_CSMA_CD; + Value32 |= GetPhyAdFlowCntrlSettings(pDevice); + LM_WritePhy(pDevice, PHY_AN_AD_REG, Value32); + pDevice->advertising = Value32; + } + /* Setup the auto-negotiation advertisement register. */ + else if(LineSpeed == LM_LINE_SPEED_UNKNOWN) + { + /* Setup the 10/100 Mbps auto-negotiation advertisement register. */ + Value32 = PHY_AN_AD_PROTOCOL_802_3_CSMA_CD | + PHY_AN_AD_10BASET_HALF | PHY_AN_AD_10BASET_FULL | + PHY_AN_AD_100BASETX_FULL | PHY_AN_AD_100BASETX_HALF; + Value32 |= GetPhyAdFlowCntrlSettings(pDevice); + + LM_WritePhy(pDevice, PHY_AN_AD_REG, Value32); + pDevice->advertising = Value32; + + /* Advertise 1000Mbps */ + Value32 = BCM540X_AN_AD_1000BASET_HALF | BCM540X_AN_AD_1000BASET_FULL; + +#if INCLUDE_5701_AX_FIX + /* Bug: workaround for CRC error in gigabit mode when we are in */ + /* slave mode. This will force the PHY to operate in */ + /* master mode. */ + if(pDevice->ChipRevId == T3_CHIP_ID_5701_A0 || + pDevice->ChipRevId == T3_CHIP_ID_5701_B0) + { + Value32 |= BCM540X_CONFIG_AS_MASTER | + BCM540X_ENABLE_CONFIG_AS_MASTER; + } +#endif + + LM_WritePhy(pDevice, BCM540X_1000BASET_CTRL_REG, Value32); + pDevice->advertising1000 = Value32; + } + else + { + if(LineSpeed == LM_LINE_SPEED_1000MBPS) + { + Value32 = PHY_AN_AD_PROTOCOL_802_3_CSMA_CD; + Value32 |= GetPhyAdFlowCntrlSettings(pDevice); + + LM_WritePhy(pDevice, PHY_AN_AD_REG, Value32); + pDevice->advertising = Value32; + + if(DuplexMode != LM_DUPLEX_MODE_FULL) + { + Value32 = BCM540X_AN_AD_1000BASET_HALF; + } + else + { + Value32 = BCM540X_AN_AD_1000BASET_FULL; + } + + LM_WritePhy(pDevice, BCM540X_1000BASET_CTRL_REG, Value32); + pDevice->advertising1000 = Value32; + } + else if(LineSpeed == LM_LINE_SPEED_100MBPS) + { + LM_WritePhy(pDevice, BCM540X_1000BASET_CTRL_REG, 0); + pDevice->advertising1000 = 0; + + if(DuplexMode != LM_DUPLEX_MODE_FULL) + { + Value32 = PHY_AN_AD_100BASETX_HALF; + } + else + { + Value32 = PHY_AN_AD_100BASETX_FULL; + } + + Value32 |= PHY_AN_AD_PROTOCOL_802_3_CSMA_CD; + Value32 |= GetPhyAdFlowCntrlSettings(pDevice); + + LM_WritePhy(pDevice, PHY_AN_AD_REG, Value32); + pDevice->advertising = Value32; + } + else if(LineSpeed == LM_LINE_SPEED_10MBPS) + { + LM_WritePhy(pDevice, BCM540X_1000BASET_CTRL_REG, 0); + pDevice->advertising1000 = 0; + + if(DuplexMode != LM_DUPLEX_MODE_FULL) + { + Value32 = PHY_AN_AD_10BASET_HALF; + } + else + { + Value32 = PHY_AN_AD_10BASET_FULL; + } + + Value32 |= PHY_AN_AD_PROTOCOL_802_3_CSMA_CD; + Value32 |= GetPhyAdFlowCntrlSettings(pDevice); + + LM_WritePhy(pDevice, PHY_AN_AD_REG, Value32); + pDevice->advertising = Value32; + } + } + + /* Force line speed if auto-negotiation is disabled. */ + if(pDevice->DisableAutoNeg && LineSpeed != LM_LINE_SPEED_UNKNOWN) + { + /* This code path is executed only when there is link. */ + pDevice->MediaType = MediaType; + pDevice->LineSpeed = LineSpeed; + pDevice->DuplexMode = DuplexMode; + + /* Force line seepd. */ + NewPhyCtrl = 0; + switch(LineSpeed) + { + case LM_LINE_SPEED_10MBPS: + NewPhyCtrl |= PHY_CTRL_SPEED_SELECT_10MBPS; + break; + case LM_LINE_SPEED_100MBPS: + NewPhyCtrl |= PHY_CTRL_SPEED_SELECT_100MBPS; + break; + case LM_LINE_SPEED_1000MBPS: + NewPhyCtrl |= PHY_CTRL_SPEED_SELECT_1000MBPS; + break; + default: + NewPhyCtrl |= PHY_CTRL_SPEED_SELECT_1000MBPS; + break; + } + + if(DuplexMode == LM_DUPLEX_MODE_FULL) + { + NewPhyCtrl |= PHY_CTRL_FULL_DUPLEX_MODE; + } + + /* Don't do anything if the PHY_CTRL is already what we wanted. */ + LM_ReadPhy(pDevice, PHY_CTRL_REG, &Value32); + if(Value32 != NewPhyCtrl) + { + /* Temporary bring the link down before forcing line speed. */ + LM_WritePhy(pDevice, PHY_CTRL_REG, PHY_CTRL_LOOPBACK_MODE); + + /* Wait for link to go down. */ + for(Cnt = 0; Cnt < 15000; Cnt++) + { + MM_Wait(10); + + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + + if(!(Value32 & PHY_STATUS_LINK_PASS)) + { + MM_Wait(40); + break; + } + } + + LM_WritePhy(pDevice, PHY_CTRL_REG, NewPhyCtrl); + MM_Wait(40); + } + } + else + { + LM_WritePhy(pDevice, PHY_CTRL_REG, PHY_CTRL_AUTO_NEG_ENABLE | + PHY_CTRL_RESTART_AUTO_NEG); + } + + /* Wait for link. */ + LmStatus = LM_STATUS_SUCCESS; + if(WaitForLink) + { + LmStatus = LM_STATUS_LINK_DOWN; + + /* Wait for link up to 3 seconds. */ + for(Cnt = 0; Cnt < 300000; Cnt++) + { + MM_Wait(10); + + /* Get the current PHY status. */ + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32); + + /* Link ok? */ + if(Value32 & PHY_STATUS_LINK_PASS) + { + LmStatus = LM_STATUS_LINK_ACTIVE; + pDevice->MediaType = LM_MEDIA_TYPE_UTP; + + /* Determine the current line and duplex settings. */ + LM_ReadPhy(pDevice, BCM540X_AUX_STATUS_REG, &Value32); + LM_ReadPhy(pDevice, BCM540X_AUX_STATUS_REG, &Value32); + + switch(Value32 & BCM540X_AUX_SPEED_MASK) + { + case BCM540X_AUX_10BASET_HD: + pDevice->LineSpeed = LM_LINE_SPEED_10MBPS; + pDevice->DuplexMode = LM_DUPLEX_MODE_HALF; + break; + + case BCM540X_AUX_10BASET_FD: + pDevice->LineSpeed = LM_LINE_SPEED_10MBPS; + pDevice->DuplexMode = LM_DUPLEX_MODE_FULL; + break; + + case BCM540X_AUX_100BASETX_HD: + pDevice->LineSpeed = LM_LINE_SPEED_100MBPS; + pDevice->DuplexMode = LM_DUPLEX_MODE_HALF; + break; + + case BCM540X_AUX_100BASETX_FD: + pDevice->LineSpeed = LM_LINE_SPEED_100MBPS; + pDevice->DuplexMode = LM_DUPLEX_MODE_FULL; + break; + + case BCM540X_AUX_100BASET_HD: + pDevice->LineSpeed = LM_LINE_SPEED_1000MBPS; + pDevice->DuplexMode = LM_DUPLEX_MODE_HALF; + break; + + case BCM540X_AUX_100BASET_FD: + pDevice->LineSpeed = LM_LINE_SPEED_1000MBPS; + pDevice->DuplexMode = LM_DUPLEX_MODE_FULL; + break; + + default: + LmStatus = LM_STATUS_LINK_DOWN; + break; + } + + break; + } + } + + /* Acknowledge interrupts. */ + LM_ReadPhy(pDevice, BCM540X_INT_STATUS_REG, &Value32); + LM_ReadPhy(pDevice, BCM540X_INT_STATUS_REG, &Value32); + } + + return LmStatus; +} /* LM_ForceAutoNegBcm540xPhy */ + + + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +static LM_STATUS +LM_ForceAutoNeg( +PLM_DEVICE_BLOCK pDevice, +LM_REQUESTED_MEDIA_TYPE RequestedMediaType, +LM_BOOL WaitForLink) { + LM_STATUS LmStatus; + + /* Initialize the phy chip. */ + switch(pDevice->PhyId & PHY_ID_MASK) + { + case PHY_BCM5400_PHY_ID: + case PHY_BCM5401_PHY_ID: + case PHY_BCM5411_PHY_ID: + case PHY_BCM5701_PHY_ID: + case PHY_BCM5703_PHY_ID: + LmStatus = LM_ForceAutoNegBcm540xPhy(pDevice, RequestedMediaType, + WaitForLink); + break; + + default: + LmStatus = LM_STATUS_FAILURE; + break; + } + + return LmStatus; +} /* LM_ForceAutoNeg */ + +/******************************************************************************/ +/* Description: */ +/* */ +/* Return: */ +/******************************************************************************/ +LM_STATUS LM_LoadFirmware(PLM_DEVICE_BLOCK pDevice, + PT3_FWIMG_INFO pFwImg, + LM_UINT32 LoadCpu, + LM_UINT32 StartCpu) +{ + LM_UINT32 i; + LM_UINT32 address; + + if (LoadCpu & T3_RX_CPU_ID) + { + if (LM_HaltCpu(pDevice,T3_RX_CPU_ID) != LM_STATUS_SUCCESS) + { + return LM_STATUS_FAILURE; + } + + /* First of all clear scrach pad memory */ + for (i = 0; i < T3_RX_CPU_SPAD_SIZE; i+=4) + { + LM_RegWrInd(pDevice,T3_RX_CPU_SPAD_ADDR+i,0); + } + + /* Copy code first */ + address = T3_RX_CPU_SPAD_ADDR + (pFwImg->Text.Offset & 0xffff); + for (i = 0; i <= pFwImg->Text.Length; i+=4) + { + LM_RegWrInd(pDevice,address+i, + ((LM_UINT32 *)pFwImg->Text.Buffer)[i/4]); + } + + address = T3_RX_CPU_SPAD_ADDR + (pFwImg->ROnlyData.Offset & 0xffff); + for (i = 0; i <= pFwImg->ROnlyData.Length; i+=4) + { + LM_RegWrInd(pDevice,address+i, + ((LM_UINT32 *)pFwImg->ROnlyData.Buffer)[i/4]); + } + + address = T3_RX_CPU_SPAD_ADDR + (pFwImg->Data.Offset & 0xffff); + for (i= 0; i <= pFwImg->Data.Length; i+=4) + { + LM_RegWrInd(pDevice,address+i, + ((LM_UINT32 *)pFwImg->Data.Buffer)[i/4]); + } + } + + if (LoadCpu & T3_TX_CPU_ID) + { + if (LM_HaltCpu(pDevice,T3_TX_CPU_ID) != LM_STATUS_SUCCESS) + { + return LM_STATUS_FAILURE; + } + + /* First of all clear scrach pad memory */ + for (i = 0; i < T3_TX_CPU_SPAD_SIZE; i+=4) + { + LM_RegWrInd(pDevice,T3_TX_CPU_SPAD_ADDR+i,0); + } + + /* Copy code first */ + address = T3_TX_CPU_SPAD_ADDR + (pFwImg->Text.Offset & 0xffff); + for (i= 0; i <= pFwImg->Text.Length; i+=4) + { + LM_RegWrInd(pDevice,address+i, + ((LM_UINT32 *)pFwImg->Text.Buffer)[i/4]); + } + + address = T3_TX_CPU_SPAD_ADDR + (pFwImg->ROnlyData.Offset & 0xffff); + for (i= 0; i <= pFwImg->ROnlyData.Length; i+=4) + { + LM_RegWrInd(pDevice,address+i, + ((LM_UINT32 *)pFwImg->ROnlyData.Buffer)[i/4]); + } + + address = T3_TX_CPU_SPAD_ADDR + (pFwImg->Data.Offset & 0xffff); + for (i= 0; i <= pFwImg->Data.Length; i+=4) + { + LM_RegWrInd(pDevice,address+i, + ((LM_UINT32 *)pFwImg->Data.Buffer)[i/4]); + } + } + + if (StartCpu & T3_RX_CPU_ID) + { + /* Start Rx CPU */ + REG_WR(pDevice,rxCpu.reg.state, 0xffffffff); + REG_WR(pDevice,rxCpu.reg.PC,pFwImg->StartAddress); + for (i = 0 ; i < 5; i++) + { + if (pFwImg->StartAddress == REG_RD(pDevice,rxCpu.reg.PC)) + break; + + REG_WR(pDevice,rxCpu.reg.state, 0xffffffff); + REG_WR(pDevice,rxCpu.reg.mode,CPU_MODE_HALT); + REG_WR(pDevice,rxCpu.reg.PC,pFwImg->StartAddress); + MM_Wait(1000); + } + + REG_WR(pDevice,rxCpu.reg.state, 0xffffffff); + REG_WR(pDevice,rxCpu.reg.mode, 0); + } + + if (StartCpu & T3_TX_CPU_ID) + { + /* Start Tx CPU */ + REG_WR(pDevice,txCpu.reg.state, 0xffffffff); + REG_WR(pDevice,txCpu.reg.PC,pFwImg->StartAddress); + for (i = 0 ; i < 5; i++) + { + if (pFwImg->StartAddress == REG_RD(pDevice,txCpu.reg.PC)) + break; + + REG_WR(pDevice,txCpu.reg.state, 0xffffffff); + REG_WR(pDevice,txCpu.reg.mode,CPU_MODE_HALT); + REG_WR(pDevice,txCpu.reg.PC,pFwImg->StartAddress); + MM_Wait(1000); + } + + REG_WR(pDevice,txCpu.reg.state, 0xffffffff); + REG_WR(pDevice,txCpu.reg.mode, 0); + } + + return LM_STATUS_SUCCESS; +} + +STATIC LM_STATUS LM_HaltCpu(PLM_DEVICE_BLOCK pDevice,LM_UINT32 cpu_number) +{ + LM_UINT32 i; + + if (cpu_number == T3_RX_CPU_ID) + { + for (i = 0 ; i < 10000; i++) + { + REG_WR(pDevice,rxCpu.reg.state, 0xffffffff); + REG_WR(pDevice,rxCpu.reg.mode,CPU_MODE_HALT); + + if (REG_RD(pDevice,rxCpu.reg.mode) & CPU_MODE_HALT) + break; + } + + REG_WR(pDevice,rxCpu.reg.state, 0xffffffff); + REG_WR(pDevice,rxCpu.reg.mode,CPU_MODE_HALT); + MM_Wait(10); + } + else + { + for (i = 0 ; i < 10000; i++) + { + REG_WR(pDevice,txCpu.reg.state, 0xffffffff); + REG_WR(pDevice,txCpu.reg.mode,CPU_MODE_HALT); + + if (REG_RD(pDevice,txCpu.reg.mode) & CPU_MODE_HALT) + break; + } + } + + return (( i == 10000) ? LM_STATUS_FAILURE : LM_STATUS_SUCCESS); +} + + +int +LM_BlinkLED(PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlinkDurationSec) +{ + LM_UINT32 Oldcfg; + int j; + int ret = 0; + + if(BlinkDurationSec == 0) + { + return 0; + } + if(BlinkDurationSec > 120) + { + BlinkDurationSec = 120; + } + + Oldcfg = REG_RD(pDevice, MacCtrl.LedCtrl); + for(j = 0; j < BlinkDurationSec * 2; j++) + { + if(j % 2) + { + // Turn on the LEDs. + REG_WR(pDevice, MacCtrl.LedCtrl, + LED_CTRL_OVERRIDE_LINK_LED | + LED_CTRL_1000MBPS_LED_ON | + LED_CTRL_100MBPS_LED_ON | + LED_CTRL_10MBPS_LED_ON | + LED_CTRL_OVERRIDE_TRAFFIC_LED | + LED_CTRL_BLINK_TRAFFIC_LED | + LED_CTRL_TRAFFIC_LED); + } + else + { + // Turn off the LEDs. + REG_WR(pDevice, MacCtrl.LedCtrl, + LED_CTRL_OVERRIDE_LINK_LED | + LED_CTRL_OVERRIDE_TRAFFIC_LED); + } + current->state = TASK_INTERRUPTIBLE; + if (schedule_timeout(HZ/2) != 0) { + ret = -EINTR; + break; + } + } + REG_WR(pDevice, MacCtrl.LedCtrl, Oldcfg); + return ret; +} + +int t3_do_dma(PLM_DEVICE_BLOCK pDevice, + LM_PHYSICAL_ADDRESS host_addr_phy, int length, + int dma_read) +{ + T3_DMA_DESC dma_desc; + int i; + LM_UINT32 dma_desc_addr; + LM_UINT32 value32; + + REG_WR(pDevice, BufMgr.Mode, 0); + REG_WR(pDevice, Ftq.Reset, 0); + + dma_desc.host_addr.High = host_addr_phy.High; + dma_desc.host_addr.Low = host_addr_phy.Low; + dma_desc.nic_mbuf = 0x2100; + dma_desc.len = length; + dma_desc.flags = 0x00000004; /* Generate Rx-CPU event */ + + if (dma_read) + { + dma_desc.cqid_sqid = (T3_QID_RX_BD_COMP << 8) | + T3_QID_DMA_HIGH_PRI_READ; + REG_WR(pDevice, DmaRead.Mode, DMA_READ_MODE_ENABLE); + } + else + { + dma_desc.cqid_sqid = (T3_QID_RX_DATA_COMP << 8) | + T3_QID_DMA_HIGH_PRI_WRITE; + REG_WR(pDevice, DmaWrite.Mode, DMA_WRITE_MODE_ENABLE); + } + + dma_desc_addr = T3_NIC_DMA_DESC_POOL_ADDR; + + /* Writing this DMA descriptor to DMA memory */ + for (i = 0; i < sizeof(T3_DMA_DESC); i += 4) + { + value32 = *((PLM_UINT32) (((PLM_UINT8) &dma_desc) + i)); + MM_WriteConfig32(pDevice, T3_PCI_MEM_WIN_ADDR_REG, dma_desc_addr+i); + MM_WriteConfig32(pDevice, T3_PCI_MEM_WIN_DATA_REG, cpu_to_le32(value32)); + } + MM_WriteConfig32(pDevice, T3_PCI_MEM_WIN_ADDR_REG, 0); + + if (dma_read) + REG_WR(pDevice, Ftq.DmaHighReadFtqFifoEnqueueDequeue, dma_desc_addr); + else + REG_WR(pDevice, Ftq.DmaHighWriteFtqFifoEnqueueDequeue, dma_desc_addr); + + for (i = 0; i < 40; i++) + { + if (dma_read) + value32 = REG_RD(pDevice, Ftq.RcvBdCompFtqFifoEnqueueDequeue); + else + value32 = REG_RD(pDevice, Ftq.RcvDataCompFtqFifoEnqueueDequeue); + + if ((value32 & 0xffff) == dma_desc_addr) + break; + + MM_Wait(10); + } + + return LM_STATUS_SUCCESS; +} + +STATIC LM_STATUS +LM_DmaTest(PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pBufferVirt, + LM_PHYSICAL_ADDRESS BufferPhy, LM_UINT32 BufferSize) +{ + int j; + LM_UINT32 *ptr; + int dma_success = 0; + LM_STATUS ret = LM_STATUS_FAILURE; + + if(T3_ASIC_REV(pDevice->ChipRevId) != T3_ASIC_REV_5700 && + T3_ASIC_REV(pDevice->ChipRevId) != T3_ASIC_REV_5701) + { + return LM_STATUS_SUCCESS; + } + while (!dma_success) + { + /* Fill data with incremental patterns */ + ptr = (LM_UINT32 *)pBufferVirt; + for (j = 0; j < BufferSize/4; j++) + *ptr++ = j; + + if (t3_do_dma(pDevice,BufferPhy,BufferSize, 1) == LM_STATUS_FAILURE) + { + goto LM_DmaTestDone; + } + + MM_Wait(40); + ptr = (LM_UINT32 *)pBufferVirt; + /* Fill data with zero */ + for (j = 0; j < BufferSize/4; j++) + *ptr++ = 0; + + if (t3_do_dma(pDevice,BufferPhy,BufferSize, 0) == LM_STATUS_FAILURE) + { + goto LM_DmaTestDone; + } + + MM_Wait(40); + /* Check for data */ + ptr = (LM_UINT32 *)pBufferVirt; + for (j = 0; j < BufferSize/4; j++) + { + if (*ptr++ != j) + { + if ((pDevice->DmaReadWriteCtrl & DMA_CTRL_WRITE_BOUNDARY_MASK) + == DMA_CTRL_WRITE_BOUNDARY_DISABLE) + { + pDevice->DmaReadWriteCtrl = (pDevice->DmaReadWriteCtrl & + ~DMA_CTRL_WRITE_BOUNDARY_MASK) | + DMA_CTRL_WRITE_BOUNDARY_16; + REG_WR(pDevice, PciCfg.DmaReadWriteCtrl, + pDevice->DmaReadWriteCtrl); + break; + } + else + { + goto LM_DmaTestDone; + } + } + } + if (j == (BufferSize/4)) + dma_success = 1; + } + ret = LM_STATUS_SUCCESS; +LM_DmaTestDone: + memset(pBufferVirt, 0, BufferSize); + return ret; +} + diff -urN linux-2.4.18/drivers/net/bcm/tigon3.h lia64-2.4/drivers/net/bcm/tigon3.h --- linux-2.4.18/drivers/net/bcm/tigon3.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/bcm/tigon3.h Fri Jul 19 17:24:26 2002 @@ -0,0 +1,3402 @@ + +/******************************************************************************/ +/* */ +/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */ +/* Corporation. */ +/* All rights reserved. */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, located in the file LICENSE. */ +/* */ +/* History: */ +/* */ +/******************************************************************************/ + +#ifndef TIGON3_H +#define TIGON3_H + +#include "lm.h" +#if INCLUDE_TBI_SUPPORT +#include "autoneg.h" +#endif + + + +/******************************************************************************/ +/* Constants. */ +/******************************************************************************/ + +/* Maxim number of packet descriptors used for sending packets. */ +#define MAX_TX_PACKET_DESC_COUNT 600 +#define DEFAULT_TX_PACKET_DESC_COUNT 100 + +/* Maximum number of packet descriptors used for receiving packets. */ +#if T3_JUMBO_RCB_ENTRY_COUNT +#define MAX_RX_PACKET_DESC_COUNT \ + (T3_STD_RCV_RCB_ENTRY_COUNT + T3_JUMBO_RCV_RCB_ENTRY_COUNT) +#else +#define MAX_RX_PACKET_DESC_COUNT 800 +#endif +#define DEFAULT_RX_PACKET_DESC_COUNT 200 + +/* Threshhold for double copying small tx packets. 0 will disable double */ +/* copying of small Tx packets. */ +#define DEFAULT_TX_COPY_BUFFER_SIZE 0 +#define MIN_TX_COPY_BUFFER_SIZE 64 +#define MAX_TX_COPY_BUFFER_SIZE 512 + +/* Cache line. */ +#define COMMON_CACHE_LINE_SIZE 0x20 +#define COMMON_CACHE_LINE_MASK (COMMON_CACHE_LINE_SIZE-1) + +/* Maximum number of fragment we can handle. */ +#ifndef MAX_FRAGMENT_COUNT +#define MAX_FRAGMENT_COUNT 32 +#endif + +/* B0 bug. */ +#define BCM5700_BX_MIN_FRAG_SIZE 10 +#define BCM5700_BX_MIN_FRAG_BUF_SIZE 16 /* nice aligned size. */ +#define BCM5700_BX_MIN_FRAG_BUF_SIZE_MASK (BCM5700_BX_MIN_FRAG_BUF_SIZE-1) +#define BCM5700_BX_TX_COPY_BUF_SIZE (BCM5700_BX_MIN_FRAG_BUF_SIZE * \ + MAX_FRAGMENT_COUNT) + +/* MAGIC number. */ +//#define T3_MAGIC_NUM 'KevT' +#define T3_FIRMWARE_MAILBOX 0x0b50 +#define T3_MAGIC_NUM 0x4B657654 +#define T3_MAGIC_NUM_DISABLE_DMAW_ON_LINK_CHANGE 0x4861764b + +#define T3_NIC_DATA_SIG_ADDR 0x0b54 +#define T3_NIC_DATA_SIG 0x4b657654 + +#define T3_NIC_DATA_NIC_CFG_ADDR 0x0b58 +#define T3_NIC_CFG_LED_MODE_UNKNOWN BIT_NONE +#define T3_NIC_CFG_LED_MODE_TRIPLE_SPEED BIT_2 +#define T3_NIC_CFG_LED_MODE_LINK_SPEED BIT_3 +#define T3_NIC_CFG_LED_MODE_OPEN_DRAIN BIT_2 +#define T3_NIC_CFG_LED_MODE_OUTPUT BIT_3 +#define T3_NIC_CFG_LED_MODE_MASK (BIT_2 | BIT_3) +#define T3_NIC_CFG_PHY_TYPE_UNKNOWN BIT_NONE +#define T3_NIC_CFG_PHY_TYPE_COPPER BIT_4 +#define T3_NIC_CFG_PHY_TYPE_FIBER BIT_5 +#define T3_NIC_CFG_PHY_TYPE_MASK (BIT_4 | BIT_5) +#define T3_NIC_CFG_ENABLE_WOL BIT_6 +#define T3_NIC_CFG_ENABLE_ASF BIT_7 +#define T3_NIC_EEPROM_WP BIT_8 + +#define T3_NIC_DATA_PHY_ID_ADDR 0x0b74 +#define T3_NIC_PHY_ID1_MASK 0xffff0000 +#define T3_NIC_PHY_ID2_MASK 0x0000ffff + +#define T3_CMD_MAILBOX 0x0b78 +#define T3_CMD_NICDRV_ALIVE 0x01 +#define T3_CMD_NICDRV_PAUSE_FW 0x02 +#define T3_CMD_NICDRV_IPV4ADDR_CHANGE 0x03 +#define T3_CMD_NICDRV_IPV6ADDR_CHANGE 0x04 +#define T3_CMD_5703A0_FIX_DMAFW_DMAR 0x05 +#define T3_CMD_5703A0_FIX_DMAFW_DMAW 0x06 + +#define T3_CMD_LENGTH_MAILBOX 0x0b7c +#define T3_CMD_DATA_MAILBOX 0x0b80 + +#define T3_ASF_FW_STATUS_MAILBOX 0x0c00 + +#define T3_DRV_STATE_MAILBOX 0x0c04 +#define T3_DRV_STATE_START 0x01 +#define T3_DRV_STATE_UNLOAD 0x02 +#define T3_DRV_STATE_WOL 0x03 +#define T3_DRV_STATE_SUSPEND 0x04 + +#define T3_FW_RESET_TYPE_MAILBOX 0x0c08 + +#define T3_MAC_ADDR_HIGH_MAILBOX 0x0c14 +#define T3_MAC_ADDR_LOW_MAILBOX 0x0c18 + +/******************************************************************************/ +/* Hardware constants. */ +/******************************************************************************/ + +/* Number of entries in the send ring: must be 512. */ +#define T3_SEND_RCB_ENTRY_COUNT 512 +#define T3_SEND_RCB_ENTRY_COUNT_MASK (T3_SEND_RCB_ENTRY_COUNT-1) + +/* Number of send RCBs. May be 1-16 but for now, only support one. */ +#define T3_MAX_SEND_RCB_COUNT 16 + +/* Number of entries in the Standard Receive RCB. Must be 512 entries. */ +#define T3_STD_RCV_RCB_ENTRY_COUNT 512 +#define T3_STD_RCV_RCB_ENTRY_COUNT_MASK (T3_STD_RCV_RCB_ENTRY_COUNT-1) +#define DEFAULT_STD_RCV_DESC_COUNT 200 /* Must be < 512. */ +#define MAX_STD_RCV_BUFFER_SIZE 0x600 + +/* Number of entries in the Mini Receive RCB. This value can either be */ +/* 0, 1024. Currently Mini Receive RCB is disabled. */ +#ifndef T3_MINI_RCV_RCB_ENTRY_COUNT +#define T3_MINI_RCV_RCB_ENTRY_COUNT 0 +#endif /* T3_MINI_RCV_RCB_ENTRY_COUNT */ +#define T3_MINI_RCV_RCB_ENTRY_COUNT_MASK (T3_MINI_RCV_RCB_ENTRY_COUNT-1) +#define MAX_MINI_RCV_BUFFER_SIZE 512 +#define DEFAULT_MINI_RCV_BUFFER_SIZE 64 +#define DEFAULT_MINI_RCV_DESC_COUNT 100 /* Must be < 1024. */ + +/* Number of entries in the Jumbo Receive RCB. This value must 256 or 0. */ +/* Currently, Jumbo Receive RCB is disabled. */ +#ifndef T3_JUMBO_RCV_RCB_ENTRY_COUNT +#define T3_JUMBO_RCV_RCB_ENTRY_COUNT 0 +#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */ +#define T3_JUMBO_RCV_RCB_ENTRY_COUNT_MASK (T3_JUMBO_RCV_RCB_ENTRY_COUNT-1) + +#define MAX_JUMBO_RCV_BUFFER_SIZE (10 * 1024) /* > 1514 */ +#define DEFAULT_JUMBO_RCV_BUFFER_SIZE (4 * 1024) /* > 1514 */ +#define DEFAULT_JUMBO_RCV_DESC_COUNT 128 /* Must be < 256. */ + +#define MAX_JUMBO_TX_BUFFER_SIZE (8 * 1024) /* > 1514 */ +#define DEFAULT_JUMBO_TX_BUFFER_SIZE (4 * 1024) /* > 1514 */ + +/* Number of receive return RCBs. Maybe 1-16 but for now, only support one. */ +#define T3_MAX_RCV_RETURN_RCB_COUNT 16 + +/* Number of entries in a Receive Return ring. This value is either 1024 */ +/* or 2048. */ +#ifndef T3_RCV_RETURN_RCB_ENTRY_COUNT +#define T3_RCV_RETURN_RCB_ENTRY_COUNT 1024 +#endif /* T3_RCV_RETURN_RCB_ENTRY_COUNT */ +#define T3_RCV_RETURN_RCB_ENTRY_COUNT_MASK (T3_RCV_RETURN_RCB_ENTRY_COUNT-1) + + +/* Default coalescing parameters. */ +#define DEFAULT_RX_COALESCING_TICKS 100 +#define MAX_RX_COALESCING_TICKS 500 +#define DEFAULT_TX_COALESCING_TICKS 400 +#define MAX_TX_COALESCING_TICKS 500 +#define DEFAULT_RX_MAX_COALESCED_FRAMES 10 +#define MAX_RX_MAX_COALESCED_FRAMES 100 +#define ADAPTIVE_LO_RX_MAX_COALESCED_FRAMES 5 +#define ADAPTIVE_HI_RX_MAX_COALESCED_FRAMES 42 +#define ADAPTIVE_LO_RX_COALESCING_TICKS 50 +#define ADAPTIVE_HI_RX_COALESCING_TICKS 300 +#define ADAPTIVE_LO_PKT_THRESH 30000 +#define ADAPTIVE_HI_PKT_THRESH 74000 +#define DEFAULT_TX_MAX_COALESCED_FRAMES 40 +#define ADAPTIVE_LO_TX_MAX_COALESCED_FRAMES 25 +#define ADAPTIVE_HI_TX_MAX_COALESCED_FRAMES 75 +#define MAX_TX_MAX_COALESCED_FRAMES 100 + +#define DEFAULT_RX_COALESCING_TICKS_DURING_INT 25 +#define DEFAULT_TX_COALESCING_TICKS_DURING_INT 25 +#define DEFAULT_RX_MAX_COALESCED_FRAMES_DURING_INT 5 +#define DEFAULT_TX_MAX_COALESCED_FRAMES_DURING_INT 5 + +#define BAD_DEFAULT_VALUE 0xffffffff + +#define DEFAULT_STATS_COALESCING_TICKS 1000000 +#define MAX_STATS_COALESCING_TICKS 3600000000U + + +/* Receive BD Replenish thresholds. */ +#define DEFAULT_RCV_STD_BD_REPLENISH_THRESHOLD 4 +#define DEFAULT_RCV_JUMBO_BD_REPLENISH_THRESHOLD 4 + + +/* Maximum physical fragment size. */ +#define MAX_FRAGMENT_SIZE (64 * 1024) + + +/* Standard view. */ +#define T3_STD_VIEW_SIZE (64 * 1024) +#define T3_FLAT_VIEW_SIZE (32 * 1024 * 1024) + + +/* Buffer descriptor base address on the NIC's memory. */ + +#define T3_NIC_SND_BUFFER_DESC_ADDR 0x4000 +#define T3_NIC_STD_RCV_BUFFER_DESC_ADDR 0x6000 +#define T3_NIC_JUMBO_RCV_BUFFER_DESC_ADDR 0x7000 + +#define T3_NIC_STD_RCV_BUFFER_DESC_ADDR_EXT_MEM 0xc000 +#define T3_NIC_JUMBO_RCV_BUFFER_DESC_ADDR_EXT_MEM 0xd000 +#define T3_NIC_MINI_RCV_BUFFER_DESC_ADDR_EXT_MEM 0xe000 + +#define T3_NIC_SND_BUFFER_DESC_SIZE (T3_SEND_RCB_ENTRY_COUNT * \ + sizeof(T3_SND_BD) / 4) + +#define T3_NIC_STD_RCV_BUFFER_DESC_SIZE (T3_STD_RCV_RCB_ENTRY_COUNT * \ + sizeof(T3_RCV_BD) / 4) + +#define T3_NIC_JUMBO_RCV_BUFFER_DESC_SIZE (T3_JUMBO_RCV_RCB_ENTRY_COUNT * \ + sizeof(T3_EXT_RCV_BD) / 4) + + +/* MBUF pool. */ +#define T3_NIC_MBUF_POOL_ADDR 0x8000 +#define T3_NIC_MBUF_POOL_SIZE 0x18000 + +#define T3_NIC_MBUF_POOL_ADDR_EXT_MEM 0x20000 + +/* DMA descriptor pool */ +#define T3_NIC_DMA_DESC_POOL_ADDR 0x2000 +#define T3_NIC_DMA_DESC_POOL_SIZE 0x2000 /* 8KB. */ + +#define T3_DEF_DMA_MBUF_LOW_WMARK 0x40 +#define T3_DEF_RX_MAC_MBUF_LOW_WMARK 0x20 +#define T3_DEF_MBUF_HIGH_WMARK 0x60 + +#define T3_DEF_DMA_MBUF_LOW_WMARK_JUMBO 304 +#define T3_DEF_RX_MAC_MBUF_LOW_WMARK_JUMBO 152 +#define T3_DEF_MBUF_HIGH_WMARK_JUMBO 380 + +#define T3_DEF_DMA_DESC_LOW_WMARK 5 +#define T3_DEF_DMA_DESC_HIGH_WMARK 10 + +/* Maximum size of giant TCP packet can be sent */ +#define T3_TCP_SEG_MAX_OFFLOAD_SIZE 64*1000 +#define T3_TCP_SEG_MIN_NUM_SEG 20 + +#define T3_RX_CPU_ID 0x1 +#define T3_TX_CPU_ID 0x2 +#define T3_RX_CPU_SPAD_ADDR 0x30000 +#define T3_RX_CPU_SPAD_SIZE 0x4000 +#define T3_TX_CPU_SPAD_ADDR 0x34000 +#define T3_TX_CPU_SPAD_SIZE 0x4000 + +typedef struct T3_DIR_ENTRY +{ + PLM_UINT8 Buffer; + LM_UINT32 Offset; + LM_UINT32 Length; +} T3_DIR_ENTRY,*PT3_DIR_ENTRY; + +typedef struct T3_FWIMG_INFO +{ + LM_UINT32 StartAddress; + T3_DIR_ENTRY Text; + T3_DIR_ENTRY ROnlyData; + T3_DIR_ENTRY Data; + T3_DIR_ENTRY Sbss; + T3_DIR_ENTRY Bss; +} T3_FWIMG_INFO, *PT3_FWIMG_INFO; + + + +/******************************************************************************/ +/* Tigon3 PCI Registers. */ +/******************************************************************************/ +#define T3_PCI_ID_BCM5700 0x164414e4 +#define T3_PCI_ID_BCM5701 0x164514e4 +#define T3_PCI_ID_BCM5702 0x164614e4 +#define T3_PCI_ID_BCM5702x 0x16A614e4 +#define T3_PCI_ID_BCM5703 0x164714e4 +#define T3_PCI_ID_BCM5703x 0x16A714e4 +#define T3_PCI_ID_BCM5702FE 0x164D14e4 + +#define T3_PCI_VENDOR_ID (T3_PCI_ID & 0xffff) +#define T3_PCI_DEVICE_ID (T3_PCI_ID >> 16) + +#define T3_PCI_MISC_HOST_CTRL_REG 0x68 + +/* The most significant 16bit of register 0x68. */ +/* ChipId:4, ChipRev:4, MetalRev:8 */ +#define T3_CHIP_ID_5700_A0 0x7000 +#define T3_CHIP_ID_5700_A1 0x7001 +#define T3_CHIP_ID_5700_B0 0x7100 +#define T3_CHIP_ID_5700_B1 0x7101 +#define T3_CHIP_ID_5700_C0 0x7200 + +#define T3_CHIP_ID_5701_A0 0x0000 +#define T3_CHIP_ID_5701_B0 0x0100 +#define T3_CHIP_ID_5701_B2 0x0102 +#define T3_CHIP_ID_5701_B5 0x0105 + +#define T3_CHIP_ID_5703_A0 0x1000 +#define T3_CHIP_ID_5703_A1 0x1001 +#define T3_CHIP_ID_5703_A2 0x1002 + +/* Chip Id. */ +#define T3_ASIC_REV(_ChipRevId) ((_ChipRevId) >> 12) +#define T3_ASIC_REV_5700 0x07 +#define T3_ASIC_REV_5701 0x00 +#define T3_ASIC_REV_5703 0x01 + +/* Chip id and revision. */ +#define T3_CHIP_REV(_ChipRevId) ((_ChipRevId) >> 8) +#define T3_CHIP_REV_5700_AX 0x70 +#define T3_CHIP_REV_5700_BX 0x71 +#define T3_CHIP_REV_5700_CX 0x72 +#define T3_CHIP_REV_5701_AX 0x00 + +/* Metal revision. */ +#define T3_METAL_REV(_ChipRevId) ((_ChipRevId) & 0xff) +#define T3_METAL_REV_A0 0x00 +#define T3_METAL_REV_A1 0x01 +#define T3_METAL_REV_B0 0x00 +#define T3_METAL_REV_B1 0x01 +#define T3_METAL_REV_B2 0x02 + +#define T3_PCI_REG_CLOCK_CTRL 0x74 + +#define T3_PCI_DISABLE_RX_CLOCK BIT_10 +#define T3_PCI_DISABLE_TX_CLOCK BIT_11 +#define T3_PCI_SELECT_ALTERNATE_CLOCK BIT_12 +#define T3_PCI_POWER_DOWN_PCI_PLL133 BIT_15 +#define T3_PCI_44MHZ_CORE_CLOCK BIT_18 + + +#define T3_PCI_REG_ADDR_REG 0x78 +#define T3_PCI_REG_DATA_REG 0x80 + +#define T3_PCI_MEM_WIN_ADDR_REG 0x7c +#define T3_PCI_MEM_WIN_DATA_REG 0x84 + +#define T3_PCI_PM_CAP_REG 0x48 + +#define T3_PCI_PM_CAP_PME_D3COLD BIT_31 +#define T3_PCI_PM_CAP_PME_D3HOT BIT_30 + +#define T3_PCI_PM_STATUS_CTRL_REG 0x4c + +#define T3_PM_POWER_STATE_MASK (BIT_0 | BIT_1) +#define T3_PM_POWER_STATE_D0 BIT_NONE +#define T3_PM_POWER_STATE_D1 BIT_0 +#define T3_PM_POWER_STATE_D2 BIT_1 +#define T3_PM_POWER_STATE_D3 (BIT_0 | BIT_1) + +#define T3_PM_PME_ENABLE BIT_8 +#define T3_PM_PME_ASSERTED BIT_15 + + +/* PCI state register. */ +#define T3_PCI_STATE_REG 0x70 + +#define T3_PCI_STATE_FORCE_RESET BIT_0 +#define T3_PCI_STATE_INT_NOT_ACTIVE BIT_1 +#define T3_PCI_STATE_CONVENTIONAL_PCI_MODE BIT_2 +#define T3_PCI_STATE_BUS_SPEED_HIGH BIT_3 +#define T3_PCI_STATE_32BIT_PCI_BUS BIT_4 + + +/* Broadcom subsystem/subvendor IDs. */ +#define T3_SVID_BROADCOM 0x14e4 + +#define T3_SSID_BROADCOM_BCM95700A6 0x1644 +#define T3_SSID_BROADCOM_BCM95701A5 0x0001 +#define T3_SSID_BROADCOM_BCM95700T6 0x0002 /* BCM8002 */ +#define T3_SSID_BROADCOM_BCM95700A9 0x0003 /* Agilent */ +#define T3_SSID_BROADCOM_BCM95701T1 0x0005 +#define T3_SSID_BROADCOM_BCM95701T8 0x0006 +#define T3_SSID_BROADCOM_BCM95701A7 0x0007 /* Agilent */ +#define T3_SSID_BROADCOM_BCM95701A10 0x0008 +#define T3_SSID_BROADCOM_BCM95701A12 0x8008 +#define T3_SSID_BROADCOM_BCM95703Ax1 0x0009 +#define T3_SSID_BROADCOM_BCM95703Ax2 0x8009 + +/* 3COM subsystem/subvendor IDs. */ +#define T3_SVID_3COM 0x10b7 + +#define T3_SSID_3COM_3C996T 0x1000 +#define T3_SSID_3COM_3C996BT 0x1006 +#define T3_SSID_3COM_3C996CT 0x1002 +#define T3_SSID_3COM_3C997T 0x1003 +#define T3_SSID_3COM_3C1000T 0x1007 +#define T3_SSID_3COM_3C940BR01 0x1008 + +/* Fiber boards. */ +#define T3_SSID_3COM_3C996SX 0x1004 +#define T3_SSID_3COM_3C997SX 0x1005 + + +/* Dell subsystem/subvendor IDs. */ + +#define T3_SVID_DELL 0x1028 + +#define T3_SSID_DELL_VIPER 0x00d1 +#define T3_SSID_DELL_JAGUAR 0x0106 +#define T3_SSID_DELL_MERLOT 0x0109 +#define T3_SSID_DELL_SLIM_MERLOT 0x010a + +/* Compaq subsystem/subvendor IDs */ + +#define T3_SVID_COMPAQ 0x0e11 + +#define T3_SSID_COMPAQ_BANSHEE 0x007c +#define T3_SSID_COMPAQ_BANSHEE_2 0x009a +#define T3_SSID_COMPAQ_CHANGELING 0x007d +#define T3_SSID_COMPAQ_NC7780 0x0085 +#define T3_SSID_COMPAQ_NC7780_2 0x0099 + + +/******************************************************************************/ +/* MII registers. */ +/******************************************************************************/ + +/* Control register. */ +#define PHY_CTRL_REG 0x00 + +#define PHY_CTRL_SPEED_MASK (BIT_6 | BIT_13) +#define PHY_CTRL_SPEED_SELECT_10MBPS BIT_NONE +#define PHY_CTRL_SPEED_SELECT_100MBPS BIT_13 +#define PHY_CTRL_SPEED_SELECT_1000MBPS BIT_6 +#define PHY_CTRL_COLLISION_TEST_ENABLE BIT_7 +#define PHY_CTRL_FULL_DUPLEX_MODE BIT_8 +#define PHY_CTRL_RESTART_AUTO_NEG BIT_9 +#define PHY_CTRL_ISOLATE_PHY BIT_10 +#define PHY_CTRL_LOWER_POWER_MODE BIT_11 +#define PHY_CTRL_AUTO_NEG_ENABLE BIT_12 +#define PHY_CTRL_LOOPBACK_MODE BIT_14 +#define PHY_CTRL_PHY_RESET BIT_15 + + +/* Status register. */ +#define PHY_STATUS_REG 0x01 + +#define PHY_STATUS_LINK_PASS BIT_2 +#define PHY_STATUS_AUTO_NEG_COMPLETE BIT_5 + + +/* Phy Id registers. */ +#define PHY_ID1_REG 0x02 +#define PHY_ID1_OUI_MASK 0xffff + +#define PHY_ID2_REG 0x03 +#define PHY_ID2_REV_MASK 0x000f +#define PHY_ID2_MODEL_MASK 0x03f0 +#define PHY_ID2_OUI_MASK 0xfc00 + + +/* Auto-negotiation advertisement register. */ +#define PHY_AN_AD_REG 0x04 + +#define PHY_AN_AD_ASYM_PAUSE BIT_11 +#define PHY_AN_AD_PAUSE_CAPABLE BIT_10 +#define PHY_AN_AD_10BASET_HALF BIT_5 +#define PHY_AN_AD_10BASET_FULL BIT_6 +#define PHY_AN_AD_100BASETX_HALF BIT_7 +#define PHY_AN_AD_100BASETX_FULL BIT_8 +#define PHY_AN_AD_PROTOCOL_802_3_CSMA_CD 0x01 + + +/* Auto-negotiation Link Partner Ability register. */ +#define PHY_LINK_PARTNER_ABILITY_REG 0x05 + +#define PHY_LINK_PARTNER_ASYM_PAUSE BIT_11 +#define PHY_LINK_PARTNER_PAUSE_CAPABLE BIT_10 + + +/* Auto-negotiation expansion register. */ +#define PHY_AN_EXPANSION_REG 0x06 + + + +/******************************************************************************/ +/* BCM5400 and BCM5401 phy info. */ +/******************************************************************************/ + +#define PHY_DEVICE_ID 1 + +/* OUI: bit 31-10; Model#: bit 9-4; Rev# bit 3-0. */ +#define PHY_UNKNOWN_PHY 0x00000000 +#define PHY_BCM5400_PHY_ID 0x60008040 +#define PHY_BCM5401_PHY_ID 0x60008050 +#define PHY_BCM5411_PHY_ID 0x60008070 +#define PHY_BCM5701_PHY_ID 0x60008110 +#define PHY_BCM5703_PHY_ID 0x60008160 +#define PHY_BCM8002_PHY_ID 0x60010140 + +#define PHY_BCM5401_B0_REV 0x1 +#define PHY_BCM5401_B2_REV 0x3 +#define PHY_BCM5401_C0_REV 0x6 + +#define PHY_ID_OUI_MASK 0xfffffc00 +#define PHY_ID_MODEL_MASK 0x000003f0 +#define PHY_ID_REV_MASK 0x0000000f +#define PHY_ID_MASK (PHY_ID_OUI_MASK | \ + PHY_ID_MODEL_MASK) + + +#define UNKNOWN_PHY_ID(x) ((((x) & PHY_ID_MASK) != PHY_BCM5400_PHY_ID) && \ + (((x) & PHY_ID_MASK) != PHY_BCM5401_PHY_ID) && \ + (((x) & PHY_ID_MASK) != PHY_BCM5411_PHY_ID) && \ + (((x) & PHY_ID_MASK) != PHY_BCM5701_PHY_ID) && \ + (((x) & PHY_ID_MASK) != PHY_BCM5703_PHY_ID) && \ + (((x) & PHY_ID_MASK) != PHY_BCM8002_PHY_ID)) + + + +/* 1000Base-T control register. */ +#define BCM540X_1000BASET_CTRL_REG 0x09 + +#define BCM540X_AN_AD_1000BASET_HALF BIT_8 +#define BCM540X_AN_AD_1000BASET_FULL BIT_9 +#define BCM540X_CONFIG_AS_MASTER BIT_11 +#define BCM540X_ENABLE_CONFIG_AS_MASTER BIT_12 + + +/* Extended control register. */ +#define BCM540X_EXT_CTRL_REG 0x10 + +#define BCM540X_EXT_CTRL_LINK3_LED_MODE BIT_1 +#define BCM540X_EXT_CTRL_TBI BIT_15 + +/* PHY extended status register. */ +#define BCM540X_EXT_STATUS_REG 0x11 + +#define BCM540X_EXT_STATUS_LINK_PASS BIT_8 + + +/* DSP Coefficient Read/Write Port. */ +#define BCM540X_DSP_RW_PORT 0x15 + + +/* DSP Coeficient Address Register. */ +#define BCM540X_DSP_ADDRESS_REG 0x17 + +#define BCM540X_DSP_TAP_NUMBER_MASK 0x00 +#define BCM540X_DSP_AGC_A 0x00 +#define BCM540X_DSP_AGC_B 0x01 +#define BCM540X_DSP_MSE_PAIR_STATUS 0x02 +#define BCM540X_DSP_SOFT_DECISION 0x03 +#define BCM540X_DSP_PHASE_REG 0x04 +#define BCM540X_DSP_SKEW 0x05 +#define BCM540X_DSP_POWER_SAVER_UPPER_BOUND 0x06 +#define BCM540X_DSP_POWER_SAVER_LOWER_BOUND 0x07 +#define BCM540X_DSP_LAST_ECHO 0x08 +#define BCM540X_DSP_FREQUENCY 0x09 +#define BCM540X_DSP_PLL_BANDWIDTH 0x0a +#define BCM540X_DSP_PLL_PHASE_OFFSET 0x0b + +#define BCM540X_DSP_FILTER_DCOFFSET (BIT_10 | BIT_11) +#define BCM540X_DSP_FILTER_FEXT3 (BIT_8 | BIT_9 | BIT_11) +#define BCM540X_DSP_FILTER_FEXT2 (BIT_9 | BIT_11) +#define BCM540X_DSP_FILTER_FEXT1 (BIT_8 | BIT_11) +#define BCM540X_DSP_FILTER_FEXT0 BIT_11 +#define BCM540X_DSP_FILTER_NEXT3 (BIT_8 | BIT_9 | BIT_10) +#define BCM540X_DSP_FILTER_NEXT2 (BIT_9 | BIT_10) +#define BCM540X_DSP_FILTER_NEXT1 (BIT_8 | BIT_10) +#define BCM540X_DSP_FILTER_NEXT0 BIT_10 +#define BCM540X_DSP_FILTER_ECHO (BIT_8 | BIT_9) +#define BCM540X_DSP_FILTER_DFE BIT_9 +#define BCM540X_DSP_FILTER_FFE BIT_8 + +#define BCM540X_DSP_CONTROL_ALL_FILTERS BIT_12 + +#define BCM540X_DSP_SEL_CH_0 BIT_NONE +#define BCM540X_DSP_SEL_CH_1 BIT_13 +#define BCM540X_DSP_SEL_CH_2 BIT_14 +#define BCM540X_DSP_SEL_CH_3 (BIT_13 | BIT_14) + +#define BCM540X_CONTROL_ALL_CHANNELS BIT_15 + + +/* Auxilliary Control Register (Shadow Register) */ +#define BCM5401_AUX_CTRL 0x18 + +#define BCM5401_SHADOW_SEL_MASK 0x7 +#define BCM5401_SHADOW_SEL_NORMAL 0x00 +#define BCM5401_SHADOW_SEL_10BASET 0x01 +#define BCM5401_SHADOW_SEL_POWER_CONTROL 0x02 +#define BCM5401_SHADOW_SEL_IP_PHONE 0x03 +#define BCM5401_SHADOW_SEL_MISC_TEST1 0x04 +#define BCM5401_SHADOW_SEL_MISC_TEST2 0x05 +#define BCM5401_SHADOW_SEL_IP_PHONE_SEED 0x06 + + +/* Shadow register selector == '000' */ +#define BCM5401_SHDW_NORMAL_DIAG_MODE BIT_3 +#define BCM5401_SHDW_NORMAL_DISABLE_MBP BIT_4 +#define BCM5401_SHDW_NORMAL_DISABLE_LOW_PWR BIT_5 +#define BCM5401_SHDW_NORMAL_DISABLE_INV_PRF BIT_6 +#define BCM5401_SHDW_NORMAL_DISABLE_PRF BIT_7 +#define BCM5401_SHDW_NORMAL_RX_SLICING_NORMAL BIT_NONE +#define BCM5401_SHDW_NORMAL_RX_SLICING_4D BIT_8 +#define BCM5401_SHDW_NORMAL_RX_SLICING_3LVL_1D BIT_9 +#define BCM5401_SHDW_NORMAL_RX_SLICING_5LVL_1D (BIT_8 | BIT_9) +#define BCM5401_SHDW_NORMAL_TX_6DB_CODING BIT_10 +#define BCM5401_SHDW_NORMAL_ENABLE_SM_DSP_CLOCK BIT_11 +#define BCM5401_SHDW_NORMAL_EDGERATE_CTRL_4NS BIT_NONE +#define BCM5401_SHDW_NORMAL_EDGERATE_CTRL_5NS BIT_12 +#define BCM5401_SHDW_NORMAL_EDGERATE_CTRL_3NS BIT_13 +#define BCM5401_SHDW_NORMAL_EDGERATE_CTRL_0NS (BIT_12 | BIT_13) +#define BCM5401_SHDW_NORMAL_EXT_PACKET_LENGTH BIT_14 +#define BCM5401_SHDW_NORMAL_EXTERNAL_LOOPBACK BIT_15 + + +/* Auxilliary status summary. */ +#define BCM540X_AUX_STATUS_REG 0x19 + +#define BCM540X_AUX_LINK_PASS BIT_2 +#define BCM540X_AUX_SPEED_MASK (BIT_8 | BIT_9 | BIT_10) +#define BCM540X_AUX_10BASET_HD BIT_8 +#define BCM540X_AUX_10BASET_FD BIT_9 +#define BCM540X_AUX_100BASETX_HD (BIT_8 | BIT_9) +#define BCM540X_AUX_100BASET4 BIT_10 +#define BCM540X_AUX_100BASETX_FD (BIT_8 | BIT_10) +#define BCM540X_AUX_100BASET_HD (BIT_9 | BIT_10) +#define BCM540X_AUX_100BASET_FD (BIT_8 | BIT_9 | BIT_10) + + +/* Interrupt status. */ +#define BCM540X_INT_STATUS_REG 0x1a + +#define BCM540X_INT_LINK_CHANGE BIT_1 +#define BCM540X_INT_SPEED_CHANGE BIT_2 +#define BCM540X_INT_DUPLEX_CHANGE BIT_3 +#define BCM540X_INT_AUTO_NEG_PAGE_RX BIT_10 + + +/* Interrupt mask register. */ +#define BCM540X_INT_MASK_REG 0x1b + + + +/******************************************************************************/ +/* Register definitions. */ +/******************************************************************************/ + +typedef volatile LM_UINT8 T3_8BIT_REGISTER, *PT3_8BIT_REGISTER; +typedef volatile LM_UINT16 T3_16BIT_REGISTER, *PT3_16BIT_REGISTER; +typedef volatile LM_UINT32 T3_32BIT_REGISTER, *PT3_32BIT_REGISTER; + +typedef struct { + /* Big endian format. */ + T3_32BIT_REGISTER High; + T3_32BIT_REGISTER Low; +} T3_64BIT_REGISTER, *PT3_64BIT_REGISTER; + +typedef T3_64BIT_REGISTER T3_64BIT_HOST_ADDR, *PT3_64BIT_HOST_ADDR; + +#define T3_NUM_OF_DMA_DESC 256 +#define T3_NUM_OF_MBUF 768 + +typedef struct +{ + T3_64BIT_REGISTER host_addr; + T3_32BIT_REGISTER nic_mbuf; + T3_16BIT_REGISTER len; + T3_16BIT_REGISTER cqid_sqid; + T3_32BIT_REGISTER flags; + T3_32BIT_REGISTER opaque1; + T3_32BIT_REGISTER opaque2; + T3_32BIT_REGISTER opaque3; +}T3_DMA_DESC, *PT3_DMA_DESC; + + + +/******************************************************************************/ +/* Ring control block. */ +/******************************************************************************/ + +typedef struct { + T3_64BIT_REGISTER HostRingAddr; + + union { + struct { +#ifdef BIG_ENDIAN_HOST + T3_16BIT_REGISTER MaxLen; + T3_16BIT_REGISTER Flags; +#else /* BIG_ENDIAN_HOST */ + T3_16BIT_REGISTER Flags; + T3_16BIT_REGISTER MaxLen; +#endif + } s; + + T3_32BIT_REGISTER MaxLen_Flags; + } u; + + T3_32BIT_REGISTER NicRingAddr; +} T3_RCB, *PT3_RCB; + +#define T3_RCB_FLAG_USE_EXT_RECV_BD BIT_0 +#define T3_RCB_FLAG_RING_DISABLED BIT_1 + + + +/******************************************************************************/ +/* Status block. */ +/******************************************************************************/ + +/* + * Size of status block is actually 0x50 bytes. Use 0x80 bytes for + * cache line alignment. + */ +#define T3_STATUS_BLOCK_SIZE 0x80 + +typedef struct { + volatile LM_UINT32 Status; + #define STATUS_BLOCK_UPDATED BIT_0 + #define STATUS_BLOCK_LINK_CHANGED_STATUS BIT_1 + #define STATUS_BLOCK_ERROR BIT_2 + + volatile LM_UINT32 StatusTag; + +#ifdef BIG_ENDIAN_HOST + volatile LM_UINT16 RcvStdConIdx; + volatile LM_UINT16 RcvJumboConIdx; + + volatile LM_UINT16 Reserved2; + volatile LM_UINT16 RcvMiniConIdx; + + struct { + volatile LM_UINT16 SendConIdx; /* Send consumer index. */ + volatile LM_UINT16 RcvProdIdx; /* Receive producer index. */ + } Idx[16]; +#else /* BIG_ENDIAN_HOST */ + volatile LM_UINT16 RcvJumboConIdx; + volatile LM_UINT16 RcvStdConIdx; + + volatile LM_UINT16 RcvMiniConIdx; + volatile LM_UINT16 Reserved2; + + struct { + volatile LM_UINT16 RcvProdIdx; /* Receive producer index. */ + volatile LM_UINT16 SendConIdx; /* Send consumer index. */ + } Idx[16]; +#endif +} T3_STATUS_BLOCK, *PT3_STATUS_BLOCK; + + + +/******************************************************************************/ +/* Receive buffer descriptors. */ +/******************************************************************************/ + +typedef struct { + T3_64BIT_HOST_ADDR HostAddr; + +#ifdef BIG_ENDIAN_HOST + volatile LM_UINT16 Index; + volatile LM_UINT16 Len; + + volatile LM_UINT16 Type; + volatile LM_UINT16 Flags; + + volatile LM_UINT16 IpCksum; + volatile LM_UINT16 TcpUdpCksum; + + volatile LM_UINT16 ErrorFlag; + volatile LM_UINT16 VlanTag; +#else /* BIG_ENDIAN_HOST */ + volatile LM_UINT16 Len; + volatile LM_UINT16 Index; + + volatile LM_UINT16 Flags; + volatile LM_UINT16 Type; + + volatile LM_UINT16 TcpUdpCksum; + volatile LM_UINT16 IpCksum; + + volatile LM_UINT16 VlanTag; + volatile LM_UINT16 ErrorFlag; +#endif + + volatile LM_UINT32 Reserved; + volatile LM_UINT32 Opaque; +} T3_RCV_BD, *PT3_RCV_BD; + + +typedef struct { + T3_64BIT_HOST_ADDR HostAddr[3]; + +#ifdef BIG_ENDIAN_HOST + LM_UINT16 Len1; + LM_UINT16 Len2; + + LM_UINT16 Len3; + LM_UINT16 Reserved1; +#else /* BIG_ENDIAN_HOST */ + LM_UINT16 Len2; + LM_UINT16 Len1; + + LM_UINT16 Reserved1; + LM_UINT16 Len3; +#endif + + T3_RCV_BD StdRcvBd; +} T3_EXT_RCV_BD, *PT3_EXT_RCV_BD; + + +/* Error flags. */ +#define RCV_BD_ERR_BAD_CRC 0x0001 +#define RCV_BD_ERR_COLL_DETECT 0x0002 +#define RCV_BD_ERR_LINK_LOST_DURING_PKT 0x0004 +#define RCV_BD_ERR_PHY_DECODE_ERR 0x0008 +#define RCV_BD_ERR_ODD_NIBBLED_RCVD_MII 0x0010 +#define RCV_BD_ERR_MAC_ABORT 0x0020 +#define RCV_BD_ERR_LEN_LT_64 0x0040 +#define RCV_BD_ERR_TRUNC_NO_RESOURCES 0x0080 +#define RCV_BD_ERR_GIANT_FRAME_RCVD 0x0100 + + +/* Buffer descriptor flags. */ +#define RCV_BD_FLAG_END 0x0004 +#define RCV_BD_FLAG_JUMBO_RING 0x0020 +#define RCV_BD_FLAG_VLAN_TAG 0x0040 +#define RCV_BD_FLAG_FRAME_HAS_ERROR 0x0400 +#define RCV_BD_FLAG_MINI_RING 0x0800 +#define RCV_BD_FLAG_IP_CHKSUM_FIELD 0x1000 +#define RCV_BD_FLAG_TCP_UDP_CHKSUM_FIELD 0x2000 +#define RCV_BD_FLAG_TCP_PACKET 0x4000 + + + +/******************************************************************************/ +/* Send buffer descriptor. */ +/******************************************************************************/ + +typedef struct { + T3_64BIT_HOST_ADDR HostAddr; + + union { + struct { +#ifdef BIG_ENDIAN_HOST + LM_UINT16 Len; + LM_UINT16 Flags; +#else /* BIG_ENDIAN_HOST */ + LM_UINT16 Flags; + LM_UINT16 Len; +#endif + } s1; + + LM_UINT32 Len_Flags; + } u1; + + union { + struct { +#ifdef BIG_ENDIAN_HOST + LM_UINT16 Reserved; + LM_UINT16 VlanTag; +#else /* BIG_ENDIAN_HOST */ + LM_UINT16 VlanTag; + LM_UINT16 Reserved; +#endif + } s2; + + LM_UINT32 VlanTag; + } u2; +} T3_SND_BD, *PT3_SND_BD; + + +/* Send buffer descriptor flags. */ +#define SND_BD_FLAG_TCP_UDP_CKSUM 0x0001 +#define SND_BD_FLAG_IP_CKSUM 0x0002 +#define SND_BD_FLAG_END 0x0004 +#define SND_BD_FLAG_IP_FRAG 0x0008 +#define SND_BD_FLAG_IP_FRAG_END 0x0010 +#define SND_BD_FLAG_VLAN_TAG 0x0040 +#define SND_BD_FLAG_COAL_NOW 0x0080 +#define SND_BD_FLAG_CPU_PRE_DMA 0x0100 +#define SND_BD_FLAG_CPU_POST_DMA 0x0200 +#define SND_BD_FLAG_INSERT_SRC_ADDR 0x1000 +#define SND_BD_FLAG_CHOOSE_SRC_ADDR 0x6000 +#define SND_BD_FLAG_DONT_GEN_CRC 0x8000 + +/* MBUFs */ +typedef struct T3_MBUF_FRAME_DESC { +#ifdef BIG_ENDIAN_HOST + LM_UINT32 status_control; + union { + struct { + LM_UINT8 cqid; + LM_UINT8 reserved1; + LM_UINT16 length; + }s1; + LM_UINT32 word; + }u1; + union { + struct + { + LM_UINT16 ip_hdr_start; + LM_UINT16 tcp_udp_hdr_start; + }s2; + + LM_UINT32 word; + }u2; + + union { + struct { + LM_UINT16 data_start; + LM_UINT16 vlan_id; + }s3; + + LM_UINT32 word; + }u3; + + union { + struct { + LM_UINT16 ip_checksum; + LM_UINT16 tcp_udp_checksum; + }s4; + + LM_UINT32 word; + }u4; + + union { + struct { + LM_UINT16 pseudo_checksum; + LM_UINT16 checksum_status; + }s5; + + LM_UINT32 word; + }u5; + + union { + struct { + LM_UINT16 rule_match; + LM_UINT8 class; + LM_UINT8 rupt; + }s6; + + LM_UINT32 word; + }u6; + + union { + struct { + LM_UINT16 reserved2; + LM_UINT16 mbuf_num; + }s7; + + LM_UINT32 word; + }u7; + + LM_UINT32 reserved3; + LM_UINT32 reserved4; +#else + LM_UINT32 status_control; + union { + struct { + LM_UINT16 length; + LM_UINT8 reserved1; + LM_UINT8 cqid; + }s1; + LM_UINT32 word; + }u1; + union { + struct + { + LM_UINT16 tcp_udp_hdr_start; + LM_UINT16 ip_hdr_start; + }s2; + + LM_UINT32 word; + }u2; + + union { + struct { + LM_UINT16 vlan_id; + LM_UINT16 data_start; + }s3; + + LM_UINT32 word; + }u3; + + union { + struct { + LM_UINT16 tcp_udp_checksum; + LM_UINT16 ip_checksum; + }s4; + + LM_UINT32 word; + }u4; + + union { + struct { + LM_UINT16 checksum_status; + LM_UINT16 pseudo_checksum; + }s5; + + LM_UINT32 word; + }u5; + + union { + struct { + LM_UINT8 rupt; + LM_UINT8 class; + LM_UINT16 rule_match; + }s6; + + LM_UINT32 word; + }u6; + + union { + struct { + LM_UINT16 mbuf_num; + LM_UINT16 reserved2; + }s7; + + LM_UINT32 word; + }u7; + + LM_UINT32 reserved3; + LM_UINT32 reserved4; +#endif +}T3_MBUF_FRAME_DESC,*PT3_MBUF_FRAME_DESC; + +typedef struct T3_MBUF_HDR { + union { + struct { + unsigned int C:1; + unsigned int F:1; + unsigned int reserved1:7; + unsigned int next_mbuf:16; + unsigned int length:7; + }s1; + + LM_UINT32 word; + }u1; + + LM_UINT32 next_frame_ptr; +}T3_MBUF_HDR, *PT3_MBUF_HDR; + +typedef struct T3_MBUF +{ + T3_MBUF_HDR hdr; + union + { + struct { + T3_MBUF_FRAME_DESC frame_hdr; + LM_UINT32 data[20]; + }s1; + + struct { + LM_UINT32 data[30]; + }s2; + }body; +}T3_MBUF, *PT3_MBUF; + +#define T3_MBUF_BASE (T3_NIC_MBUF_POOL_ADDR >> 7) +#define T3_MBUF_END ((T3_NIC_MBUF_POOL_ADDR + T3_NIC_MBUF_POOL_SIZE) >> 7) + + + +/******************************************************************************/ +/* Statistics block. */ +/******************************************************************************/ + +typedef struct { + LM_UINT8 Reserved0[0x400-0x300]; + + /* Statistics maintained by Receive MAC. */ + T3_64BIT_REGISTER ifHCInOctets; + T3_64BIT_REGISTER Reserved1; + T3_64BIT_REGISTER etherStatsFragments; + T3_64BIT_REGISTER ifHCInUcastPkts; + T3_64BIT_REGISTER ifHCInMulticastPkts; + T3_64BIT_REGISTER ifHCInBroadcastPkts; + T3_64BIT_REGISTER dot3StatsFCSErrors; + T3_64BIT_REGISTER dot3StatsAlignmentErrors; + T3_64BIT_REGISTER xonPauseFramesReceived; + T3_64BIT_REGISTER xoffPauseFramesReceived; + T3_64BIT_REGISTER macControlFramesReceived; + T3_64BIT_REGISTER xoffStateEntered; + T3_64BIT_REGISTER dot3StatsFramesTooLong; + T3_64BIT_REGISTER etherStatsJabbers; + T3_64BIT_REGISTER etherStatsUndersizePkts; + T3_64BIT_REGISTER inRangeLengthError; + T3_64BIT_REGISTER outRangeLengthError; + T3_64BIT_REGISTER etherStatsPkts64Octets; + T3_64BIT_REGISTER etherStatsPkts65Octetsto127Octets; + T3_64BIT_REGISTER etherStatsPkts128Octetsto255Octets; + T3_64BIT_REGISTER etherStatsPkts256Octetsto511Octets; + T3_64BIT_REGISTER etherStatsPkts512Octetsto1023Octets; + T3_64BIT_REGISTER etherStatsPkts1024Octetsto1522Octets; + T3_64BIT_REGISTER etherStatsPkts1523Octetsto2047Octets; + T3_64BIT_REGISTER etherStatsPkts2048Octetsto4095Octets; + T3_64BIT_REGISTER etherStatsPkts4096Octetsto8191Octets; + T3_64BIT_REGISTER etherStatsPkts8192Octetsto9022Octets; + + T3_64BIT_REGISTER Unused1[37]; + + /* Statistics maintained by Transmit MAC. */ + T3_64BIT_REGISTER ifHCOutOctets; + T3_64BIT_REGISTER Reserved2; + T3_64BIT_REGISTER etherStatsCollisions; + T3_64BIT_REGISTER outXonSent; + T3_64BIT_REGISTER outXoffSent; + T3_64BIT_REGISTER flowControlDone; + T3_64BIT_REGISTER dot3StatsInternalMacTransmitErrors; + T3_64BIT_REGISTER dot3StatsSingleCollisionFrames; + T3_64BIT_REGISTER dot3StatsMultipleCollisionFrames; + T3_64BIT_REGISTER dot3StatsDeferredTransmissions; + T3_64BIT_REGISTER Reserved3; + T3_64BIT_REGISTER dot3StatsExcessiveCollisions; + T3_64BIT_REGISTER dot3StatsLateCollisions; + T3_64BIT_REGISTER dot3Collided2Times; + T3_64BIT_REGISTER dot3Collided3Times; + T3_64BIT_REGISTER dot3Collided4Times; + T3_64BIT_REGISTER dot3Collided5Times; + T3_64BIT_REGISTER dot3Collided6Times; + T3_64BIT_REGISTER dot3Collided7Times; + T3_64BIT_REGISTER dot3Collided8Times; + T3_64BIT_REGISTER dot3Collided9Times; + T3_64BIT_REGISTER dot3Collided10Times; + T3_64BIT_REGISTER dot3Collided11Times; + T3_64BIT_REGISTER dot3Collided12Times; + T3_64BIT_REGISTER dot3Collided13Times; + T3_64BIT_REGISTER dot3Collided14Times; + T3_64BIT_REGISTER dot3Collided15Times; + T3_64BIT_REGISTER ifHCOutUcastPkts; + T3_64BIT_REGISTER ifHCOutMulticastPkts; + T3_64BIT_REGISTER ifHCOutBroadcastPkts; + T3_64BIT_REGISTER dot3StatsCarrierSenseErrors; + T3_64BIT_REGISTER ifOutDiscards; + T3_64BIT_REGISTER ifOutErrors; + + T3_64BIT_REGISTER Unused2[31]; + + /* Statistics maintained by Receive List Placement. */ + T3_64BIT_REGISTER COSIfHCInPkts[16]; + T3_64BIT_REGISTER COSFramesDroppedDueToFilters; + T3_64BIT_REGISTER nicDmaWriteQueueFull; + T3_64BIT_REGISTER nicDmaWriteHighPriQueueFull; + T3_64BIT_REGISTER nicNoMoreRxBDs; + T3_64BIT_REGISTER ifInDiscards; + T3_64BIT_REGISTER ifInErrors; + T3_64BIT_REGISTER nicRecvThresholdHit; + + T3_64BIT_REGISTER Unused3[9]; + + /* Statistics maintained by Send Data Initiator. */ + T3_64BIT_REGISTER COSIfHCOutPkts[16]; + T3_64BIT_REGISTER nicDmaReadQueueFull; + T3_64BIT_REGISTER nicDmaReadHighPriQueueFull; + T3_64BIT_REGISTER nicSendDataCompQueueFull; + + /* Statistics maintained by Host Coalescing. */ + T3_64BIT_REGISTER nicRingSetSendProdIndex; + T3_64BIT_REGISTER nicRingStatusUpdate; + T3_64BIT_REGISTER nicInterrupts; + T3_64BIT_REGISTER nicAvoidedInterrupts; + T3_64BIT_REGISTER nicSendThresholdHit; + + LM_UINT8 Reserved4[0xb00-0x9c0]; +} T3_STATS_BLOCK, *PT3_STATS_BLOCK; + + + +/******************************************************************************/ +/* PCI configuration registers. */ +/******************************************************************************/ + +typedef struct { + T3_16BIT_REGISTER VendorId; + T3_16BIT_REGISTER DeviceId; + + T3_16BIT_REGISTER Command; + T3_16BIT_REGISTER Status; + + T3_32BIT_REGISTER ClassCodeRevId; + + T3_8BIT_REGISTER CacheLineSize; + T3_8BIT_REGISTER LatencyTimer; + T3_8BIT_REGISTER HeaderType; + T3_8BIT_REGISTER Bist; + + T3_32BIT_REGISTER MemBaseAddrLow; + T3_32BIT_REGISTER MemBaseAddrHigh; + + LM_UINT8 Unused1[20]; + + T3_16BIT_REGISTER SubsystemVendorId; + T3_16BIT_REGISTER SubsystemId; + + T3_32BIT_REGISTER RomBaseAddr; + + T3_8BIT_REGISTER PciXCapiblityPtr; + LM_UINT8 Unused2[7]; + + T3_8BIT_REGISTER IntLine; + T3_8BIT_REGISTER IntPin; + T3_8BIT_REGISTER MinGnt; + T3_8BIT_REGISTER MaxLat; + + T3_8BIT_REGISTER PciXCapabilities; + T3_8BIT_REGISTER PmCapabilityPtr; + T3_16BIT_REGISTER PciXCommand; + + T3_32BIT_REGISTER PciXStatus; + + T3_8BIT_REGISTER PmCapabilityId; + T3_8BIT_REGISTER VpdCapabilityPtr; + T3_16BIT_REGISTER PmCapabilities; + + T3_16BIT_REGISTER PmCtrlStatus; + #define PM_CTRL_PME_STATUS BIT_15 + #define PM_CTRL_PME_ENABLE BIT_8 + #define PM_CTRL_PME_POWER_STATE_D0 0 + #define PM_CTRL_PME_POWER_STATE_D1 1 + #define PM_CTRL_PME_POWER_STATE_D2 2 + #define PM_CTRL_PME_POWER_STATE_D3H 3 + + T3_8BIT_REGISTER BridgeSupportExt; + T3_8BIT_REGISTER PmData; + + T3_8BIT_REGISTER VpdCapabilityId; + T3_8BIT_REGISTER MsiCapabilityPtr; + T3_16BIT_REGISTER VpdAddrFlag; + #define VPD_FLAG_WRITE (1 << 15) + #define VPD_FLAG_RW_MASK (1 << 15) + #define VPD_FLAG_READ 0 + + + T3_32BIT_REGISTER VpdData; + + T3_8BIT_REGISTER MsiCapabilityId; + T3_8BIT_REGISTER NextCapabilityPtr; + T3_16BIT_REGISTER MsiCtrl; + #define MSI_CTRL_64BIT_CAP (1 << 7) + #define MSI_CTRL_MSG_ENABLE(x) (x << 4) + #define MSI_CTRL_MSG_CAP(x) (x << 1) + #define MSI_CTRL_ENABLE (1 << 0) + + + T3_32BIT_REGISTER MsiAddrLow; + T3_32BIT_REGISTER MsiAddrHigh; + + T3_16BIT_REGISTER MsiData; + T3_16BIT_REGISTER Unused3; + + T3_32BIT_REGISTER MiscHostCtrl; + #define MISC_HOST_CTRL_CLEAR_INT BIT_0 + #define MISC_HOST_CTRL_MASK_PCI_INT BIT_1 + #define MISC_HOST_CTRL_ENABLE_ENDIAN_BYTE_SWAP BIT_2 + #define MISC_HOST_CTRL_ENABLE_ENDIAN_WORD_SWAP BIT_3 + #define MISC_HOST_CTRL_ENABLE_PCI_STATE_REG_RW BIT_4 + #define MISC_HOST_CTRL_ENABLE_CLK_REG_RW BIT_5 + #define MISC_HOST_CTRL_ENABLE_REG_WORD_SWAP BIT_6 + #define MISC_HOST_CTRL_ENABLE_INDIRECT_ACCESS BIT_7 + #define MISC_HOST_CTRL_ENABLE_INT_MASK_MODE BIT_8 + #define MISC_HOST_CTRL_ENABLE_TAGGED_STATUS_MODE BIT_9 + + T3_32BIT_REGISTER DmaReadWriteCtrl; + #define DMA_CTRL_WRITE_BOUNDARY_MASK (BIT_11 | BIT_12 | BIT_13) + #define DMA_CTRL_WRITE_BOUNDARY_DISABLE 0 + #define DMA_CTRL_WRITE_BOUNDARY_16 BIT_11 + #define DMA_CTRL_WRITE_BOUNDARY_32 BIT_12 + #define DMA_CTRL_WRITE_BOUNDARY_64 (BIT_12 | BIT_11) + #define DMA_CTRL_WRITE_BOUNDARY_128 BIT_13 + #define DMA_CTRL_WRITE_BOUNDARY_256 (BIT_13 | BIT_11) + #define DMA_CTRL_WRITE_BOUNDARY_512 (BIT_13 | BIT_12) + #define DMA_CTRL_WRITE_BOUNDARY_1024 (BIT_13 | BIT_12 | BIT_11) + #define DMA_CTRL_WRITE_ONE_DMA_AT_ONCE BIT_14 + + + T3_32BIT_REGISTER PciState; + #define T3_PCI_STATE_FORCE_PCI_RESET BIT_0 + #define T3_PCI_STATE_INTERRUPT_NOT_ACTIVE BIT_1 + #define T3_PCI_STATE_NOT_PCI_X_BUS BIT_2 + #define T3_PCI_STATE_HIGH_BUS_SPEED BIT_3 + #define T3_PCI_STATE_32BIT_PCI_BUS BIT_4 + #define T3_PCI_STATE_PCI_ROM_ENABLE BIT_5 + #define T3_PCI_STATE_PCI_ROM_RETRY_ENABLE BIT_6 + #define T3_PCI_STATE_FLAT_VIEW BIT_8 + + T3_32BIT_REGISTER ClockCtrl; + #define T3_PCI_CLKCTRL_TXCPU_CLK_DISABLE BIT_11 + #define T3_PCI_CLKCTRL_RXCPU_CLK_DISABLE BIT_10 + #define T3_PCI_CLKCTRL_CORE_CLK_DISABLE BIT_9 + + T3_32BIT_REGISTER RegBaseAddr; + + T3_32BIT_REGISTER MemWindowBaseAddr; + +#ifdef NIC_CPU_VIEW + /* These registers are ONLY visible to NIC CPU */ + T3_32BIT_REGISTER PowerConsumed; + T3_32BIT_REGISTER PowerDissipated; +#else /* NIC_CPU_VIEW */ + T3_32BIT_REGISTER RegData; + T3_32BIT_REGISTER MemWindowData; +#endif /* !NIC_CPU_VIEW */ + + T3_32BIT_REGISTER ModeCtrl; + + T3_32BIT_REGISTER MiscCfg; + + T3_32BIT_REGISTER MiscLocalCtrl; + + T3_32BIT_REGISTER Unused4; + + /* NOTE: Big/Little-endian clarification needed. Are these register */ + /* in big or little endian formate. */ + T3_64BIT_REGISTER StdRingProdIdx; + T3_64BIT_REGISTER RcvRetRingConIdx; + T3_64BIT_REGISTER SndProdIdx; + + LM_UINT8 Unused5[80]; +} T3_PCI_CONFIGURATION, *PT3_PCI_CONFIGURATION; + + + +/******************************************************************************/ +/* Mac control registers. */ +/******************************************************************************/ + +typedef struct { + /* MAC mode control. */ + T3_32BIT_REGISTER Mode; + #define MAC_MODE_GLOBAL_RESET BIT_0 + #define MAC_MODE_HALF_DUPLEX BIT_1 + #define MAC_MODE_PORT_MODE_MASK (BIT_2 | BIT_3) + #define MAC_MODE_PORT_MODE_TBI (BIT_2 | BIT_3) + #define MAC_MODE_PORT_MODE_GMII BIT_3 + #define MAC_MODE_PORT_MODE_MII BIT_2 + #define MAC_MODE_PORT_MODE_NONE BIT_NONE + #define MAC_MODE_PORT_INTERNAL_LOOPBACK BIT_4 + #define MAC_MODE_TAGGED_MAC_CONTROL BIT_7 + #define MAC_MODE_TX_BURSTING BIT_8 + #define MAC_MODE_MAX_DEFER BIT_9 + #define MAC_MODE_LINK_POLARITY BIT_10 + #define MAC_MODE_ENABLE_RX_STATISTICS BIT_11 + #define MAC_MODE_CLEAR_RX_STATISTICS BIT_12 + #define MAC_MODE_FLUSH_RX_STATISTICS BIT_13 + #define MAC_MODE_ENABLE_TX_STATISTICS BIT_14 + #define MAC_MODE_CLEAR_TX_STATISTICS BIT_15 + #define MAC_MODE_FLUSH_TX_STATISTICS BIT_16 + #define MAC_MODE_SEND_CONFIGS BIT_17 + #define MAC_MODE_DETECT_MAGIC_PACKET_ENABLE BIT_18 + #define MAC_MODE_ACPI_POWER_ON_ENABLE BIT_19 + #define MAC_MODE_ENABLE_MIP BIT_20 + #define MAC_MODE_ENABLE_TDE BIT_21 + #define MAC_MODE_ENABLE_RDE BIT_22 + #define MAC_MODE_ENABLE_FHDE BIT_23 + + /* MAC status */ + T3_32BIT_REGISTER Status; + #define MAC_STATUS_PCS_SYNCED BIT_0 + #define MAC_STATUS_SIGNAL_DETECTED BIT_1 + #define MAC_STATUS_RECEIVING_CFG BIT_2 + #define MAC_STATUS_CFG_CHANGED BIT_3 + #define MAC_STATUS_SYNC_CHANGED BIT_4 + #define MAC_STATUS_PORT_DECODE_ERROR BIT_10 + #define MAC_STATUS_LINK_STATE_CHANGED BIT_12 + #define MAC_STATUS_MI_COMPLETION BIT_22 + #define MAC_STATUS_MI_INTERRUPT BIT_23 + #define MAC_STATUS_AP_ERROR BIT_24 + #define MAC_STATUS_ODI_ERROR BIT_25 + #define MAC_STATUS_RX_STATS_OVERRUN BIT_26 + #define MAC_STATUS_TX_STATS_OVERRUN BIT_27 + + /* Event Enable */ + T3_32BIT_REGISTER MacEvent; + #define MAC_EVENT_ENABLE_PORT_DECODE_ERR BIT_10 + #define MAC_EVENT_ENABLE_LINK_STATE_CHANGED_ATTN BIT_12 + #define MAC_EVENT_ENABLE_MI_COMPLETION BIT_22 + #define MAC_EVENT_ENABLE_MI_INTERRUPT BIT_23 + #define MAC_EVENT_ENABLE_AP_ERROR BIT_24 + #define MAC_EVENT_ENABLE_ODI_ERROR BIT_25 + #define MAC_EVENT_ENABLE_RX_STATS_OVERRUN BIT_26 + #define MAC_EVENT_ENABLE_TX_STATS_OVERRUN BIT_27 + + /* Led control. */ + T3_32BIT_REGISTER LedCtrl; + #define LED_CTRL_OVERRIDE_LINK_LED BIT_0 + #define LED_CTRL_1000MBPS_LED_ON BIT_1 + #define LED_CTRL_100MBPS_LED_ON BIT_2 + #define LED_CTRL_10MBPS_LED_ON BIT_3 + #define LED_CTRL_OVERRIDE_TRAFFIC_LED BIT_4 + #define LED_CTRL_BLINK_TRAFFIC_LED BIT_5 + #define LED_CTRL_TRAFFIC_LED BIT_6 + #define LED_CTRL_1000MBPS_LED_STATUS BIT_7 + #define LED_CTRL_100MBPS_LED_STATUS BIT_8 + #define LED_CTRL_10MBPS_LED_STATUS BIT_9 + #define LED_CTRL_TRAFFIC_LED_STATUS BIT_10 + #define LED_CTRL_MAC_MODE BIT_NONE + #define LED_CTRL_PHY_MODE_1 BIT_11 + #define LED_CTRL_PHY_MODE_2 BIT_12 + #define LED_CTRL_BLINK_RATE_MASK 0x7ff80000 + #define LED_CTRL_OVERRIDE_BLINK_PERIOD BIT_19 + #define LED_CTRL_OVERRIDE_BLINK_RATE BIT_31 + + /* MAC addresses. */ + struct { + T3_32BIT_REGISTER High; /* Upper 2 bytes. */ + T3_32BIT_REGISTER Low; /* Lower 4 bytes. */ + } MacAddr[4]; + + /* ACPI Mbuf pointer. */ + T3_32BIT_REGISTER AcpiMbufPtr; + + /* ACPI Length and Offset. */ + T3_32BIT_REGISTER AcpiLengthOffset; + #define ACPI_LENGTH_MASK 0xffff + #define ACPI_OFFSET_MASK 0x0fff0000 + #define ACPI_LENGTH(x) x + #define ACPI_OFFSET(x) ((x) << 16) + + /* Transmit random backoff. */ + T3_32BIT_REGISTER TxBackoffSeed; + #define MAC_TX_BACKOFF_SEED_MASK 0x3ff + + /* Receive MTU */ + T3_32BIT_REGISTER MtuSize; + #define MAC_RX_MTU_MASK 0xffff + + /* Gigabit PCS Test. */ + T3_32BIT_REGISTER PcsTest; + #define MAC_PCS_TEST_DATA_PATTERN_MASK 0x0fffff + #define MAC_PCS_TEST_ENABLE BIT_20 + + /* Transmit Gigabit Auto-Negotiation. */ + T3_32BIT_REGISTER TxAutoNeg; + #define MAC_AN_TX_AN_DATA_MASK 0xffff + + /* Receive Gigabit Auto-Negotiation. */ + T3_32BIT_REGISTER RxAutoNeg; + #define MAC_AN_RX_AN_DATA_MASK 0xffff + + /* MI Communication. */ + T3_32BIT_REGISTER MiCom; + #define MI_COM_CMD_MASK (BIT_26 | BIT_27) + #define MI_COM_CMD_WRITE BIT_26 + #define MI_COM_CMD_READ BIT_27 + #define MI_COM_READ_FAILED BIT_28 + #define MI_COM_START BIT_29 + #define MI_COM_BUSY BIT_29 + + #define MI_COM_PHY_ADDR_MASK 0x1f + #define MI_COM_FIRST_PHY_ADDR_BIT 21 + + #define MI_COM_PHY_REG_ADDR_MASK 0x1f + #define MI_COM_FIRST_PHY_REG_ADDR_BIT 16 + + #define MI_COM_PHY_DATA_MASK 0xffff + + /* MI Status. */ + T3_32BIT_REGISTER MiStatus; + #define MI_STATUS_ENABLE_LINK_STATUS_ATTN BIT_0 + + /* MI Mode. */ + T3_32BIT_REGISTER MiMode; + #define MI_MODE_CLOCK_SPEED_10MHZ BIT_0 + #define MI_MODE_USE_SHORT_PREAMBLE BIT_1 + #define MI_MODE_AUTO_POLLING_ENABLE BIT_4 + #define MI_MODE_CORE_CLOCK_SPEED_62MHZ BIT_15 + + /* Auto-polling status. */ + T3_32BIT_REGISTER AutoPollStatus; + #define AUTO_POLL_ERROR BIT_0 + + /* Transmit MAC mode. */ + T3_32BIT_REGISTER TxMode; + #define TX_MODE_RESET BIT_0 + #define TX_MODE_ENABLE BIT_1 + #define TX_MODE_ENABLE_FLOW_CONTROL BIT_4 + #define TX_MODE_ENABLE_BIG_BACKOFF BIT_5 + #define TX_MODE_ENABLE_LONG_PAUSE BIT_6 + + /* Transmit MAC status. */ + T3_32BIT_REGISTER TxStatus; + #define TX_STATUS_RX_CURRENTLY_XOFFED BIT_0 + #define TX_STATUS_SENT_XOFF BIT_1 + #define TX_STATUS_SENT_XON BIT_2 + #define TX_STATUS_LINK_UP BIT_3 + #define TX_STATUS_ODI_UNDERRUN BIT_4 + #define TX_STATUS_ODI_OVERRUN BIT_5 + + /* Transmit MAC length. */ + T3_32BIT_REGISTER TxLengths; + #define TX_LEN_SLOT_TIME_MASK 0xff + #define TX_LEN_IPG_MASK 0x0f00 + #define TX_LEN_IPG_CRS_MASK (BIT_12 | BIT_13) + + /* Receive MAC mode. */ + T3_32BIT_REGISTER RxMode; + #define RX_MODE_RESET BIT_0 + #define RX_MODE_ENABLE BIT_1 + #define RX_MODE_ENABLE_FLOW_CONTROL BIT_2 + #define RX_MODE_KEEP_MAC_CONTROL BIT_3 + #define RX_MODE_KEEP_PAUSE BIT_4 + #define RX_MODE_ACCEPT_OVERSIZED BIT_5 + #define RX_MODE_ACCEPT_RUNTS BIT_6 + #define RX_MODE_LENGTH_CHECK BIT_7 + #define RX_MODE_PROMISCUOUS_MODE BIT_8 + #define RX_MODE_NO_CRC_CHECK BIT_9 + #define RX_MODE_KEEP_VLAN_TAG BIT_10 + + /* Receive MAC status. */ + T3_32BIT_REGISTER RxStatus; + #define RX_STATUS_REMOTE_TRANSMITTER_XOFFED BIT_0 + #define RX_STATUS_XOFF_RECEIVED BIT_1 + #define RX_STATUS_XON_RECEIVED BIT_2 + + /* Hash registers. */ + T3_32BIT_REGISTER HashReg[4]; + + /* Receive placement rules registers. */ + struct { + T3_32BIT_REGISTER Rule; + T3_32BIT_REGISTER Value; + } RcvRules[16]; + + #define RCV_DISABLE_RULE_MASK 0x7fffffff + + #define RCV_RULE1_REJECT_BROADCAST_IDX 0x00 + #define REJECT_BROADCAST_RULE1_RULE 0xc2000000 + #define REJECT_BROADCAST_RULE1_VALUE 0xffffffff + + #define RCV_RULE2_REJECT_BROADCAST_IDX 0x01 + #define REJECT_BROADCAST_RULE2_RULE 0x86000004 + #define REJECT_BROADCAST_RULE2_VALUE 0xffffffff + +#if INCLUDE_5701_AX_FIX + #define RCV_LAST_RULE_IDX 0x04 +#else + #define RCV_LAST_RULE_IDX 0x02 +#endif + + T3_32BIT_REGISTER RcvRuleCfg; + #define RX_RULE_DEFAULT_CLASS (1 << 3) + + LM_UINT8 Reserved1[140]; + + T3_32BIT_REGISTER SerdesCfg; + T3_32BIT_REGISTER SerdesStatus; + + LM_UINT8 Reserved2[104]; + + volatile LM_UINT8 TxMacState[16]; + volatile LM_UINT8 RxMacState[20]; + + LM_UINT8 Reserved3[476]; + + T3_32BIT_REGISTER RxStats[26]; + + LM_UINT8 Reserved4[24]; + + T3_32BIT_REGISTER TxStats[28]; + + LM_UINT8 Reserved5[784]; +} T3_MAC_CONTROL, *PT3_MAC_CONTROL; + + + +/******************************************************************************/ +/* Send data initiator control registers. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; + #define T3_SND_DATA_IN_MODE_RESET BIT_0 + #define T3_SND_DATA_IN_MODE_ENABLE BIT_1 + #define T3_SND_DATA_IN_MODE_STATS_OFLW_ATTN_ENABLE BIT_2 + + T3_32BIT_REGISTER Status; + #define T3_SND_DATA_IN_STATUS_STATS_OFLW_ATTN BIT_2 + + T3_32BIT_REGISTER StatsCtrl; + #define T3_SND_DATA_IN_STATS_CTRL_ENABLE BIT_0 + #define T3_SND_DATA_IN_STATS_CTRL_FASTER_UPDATE BIT_1 + #define T3_SND_DATA_IN_STATS_CTRL_CLEAR BIT_2 + #define T3_SND_DATA_IN_STATS_CTRL_FLUSH BIT_3 + #define T3_SND_DATA_IN_STATS_CTRL_FORCE_ZERO BIT_4 + + T3_32BIT_REGISTER StatsEnableMask; + T3_32BIT_REGISTER StatsIncMask; + + LM_UINT8 Reserved[108]; + + T3_32BIT_REGISTER ClassOfServCnt[16]; + T3_32BIT_REGISTER DmaReadQFullCnt; + T3_32BIT_REGISTER DmaPriorityReadQFullCnt; + T3_32BIT_REGISTER SdcQFullCnt; + + T3_32BIT_REGISTER NicRingSetSendProdIdxCnt; + T3_32BIT_REGISTER StatusUpdatedCnt; + T3_32BIT_REGISTER InterruptsCnt; + T3_32BIT_REGISTER AvoidInterruptsCnt; + T3_32BIT_REGISTER SendThresholdHitCnt; + + /* Unused space. */ + LM_UINT8 Unused[800]; +} T3_SEND_DATA_INITIATOR, *PT3_SEND_DATA_INITIATOR; + + + +/******************************************************************************/ +/* Send data completion control registers. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; + #define SND_DATA_COMP_MODE_RESET BIT_0 + #define SND_DATA_COMP_MODE_ENABLE BIT_1 + + /* Unused space. */ + LM_UINT8 Unused[1020]; +} T3_SEND_DATA_COMPLETION, *PT3_SEND_DATA_COMPLETION; + + + +/******************************************************************************/ +/* Send BD Ring Selector Control Registers. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; + #define SND_BD_SEL_MODE_RESET BIT_0 + #define SND_BD_SEL_MODE_ENABLE BIT_1 + #define SND_BD_SEL_MODE_ATTN_ENABLE BIT_2 + + T3_32BIT_REGISTER Status; + #define SND_BD_SEL_STATUS_ERROR_ATTN BIT_2 + + T3_32BIT_REGISTER HwDiag; + + /* Unused space. */ + LM_UINT8 Unused1[52]; + + /* Send BD Ring Selector Local NIC Send BD Consumer Index. */ + T3_32BIT_REGISTER NicSendBdSelConIdx[16]; + + /* Unused space. */ + LM_UINT8 Unused2[896]; +} T3_SEND_BD_SELECTOR, *PT3_SEND_BD_SELECTOR; + + + +/******************************************************************************/ +/* Send BD initiator control registers. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; + #define SND_BD_IN_MODE_RESET BIT_0 + #define SND_BD_IN_MODE_ENABLE BIT_1 + #define SND_BD_IN_MODE_ATTN_ENABLE BIT_2 + + T3_32BIT_REGISTER Status; + #define SND_BD_IN_STATUS_ERROR_ATTN BIT_2 + + /* Send BD initiator local NIC send BD producer index. */ + T3_32BIT_REGISTER NicSendBdInProdIdx[16]; + + /* Unused space. */ + LM_UINT8 Unused2[952]; +} T3_SEND_BD_INITIATOR, *PT3_SEND_BD_INITIATOR; + + + +/******************************************************************************/ +/* Send BD Completion Control. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; + #define SND_BD_COMP_MODE_RESET BIT_0 + #define SND_BD_COMP_MODE_ENABLE BIT_1 + #define SND_BD_COMP_MODE_ATTN_ENABLE BIT_2 + + /* Unused space. */ + LM_UINT8 Unused2[1020]; +} T3_SEND_BD_COMPLETION, *PT3_SEND_BD_COMPLETION; + + + +/******************************************************************************/ +/* Receive list placement control registers. */ +/******************************************************************************/ + +typedef struct { + /* Mode. */ + T3_32BIT_REGISTER Mode; + #define RCV_LIST_PLMT_MODE_RESET BIT_0 + #define RCV_LIST_PLMT_MODE_ENABLE BIT_1 + #define RCV_LIST_PLMT_MODE_CLASS0_ATTN_ENABLE BIT_2 + #define RCV_LIST_PLMT_MODE_MAPPING_OOR_ATTN_ENABLE BIT_3 + #define RCV_LIST_PLMT_MODE_STATS_OFLOW_ATTN_ENABLE BIT_4 + + /* Status. */ + T3_32BIT_REGISTER Status; + #define RCV_LIST_PLMT_STATUS_CLASS0_ATTN BIT_2 + #define RCV_LIST_PLMT_STATUS_MAPPING_ATTN BIT_3 + #define RCV_LIST_PLMT_STATUS_STATS_OFLOW_ATTN BIT_4 + + /* Receive selector list lock register. */ + T3_32BIT_REGISTER Lock; + #define RCV_LIST_SEL_LOCK_REQUEST_MASK 0xffff + #define RCV_LIST_SEL_LOCK_GRANT_MASK 0xffff0000 + + /* Selector non-empty bits. */ + T3_32BIT_REGISTER NonEmptyBits; + #define RCV_LIST_SEL_NON_EMPTY_MASK 0xffff + + /* Receive list placement configuration register. */ + T3_32BIT_REGISTER Config; + + /* Receive List Placement statistics Control. */ + T3_32BIT_REGISTER StatsCtrl; +#define RCV_LIST_STATS_ENABLE BIT_0 +#define RCV_LIST_STATS_FAST_UPDATE BIT_1 + + /* Receive List Placement statistics Enable Mask. */ + T3_32BIT_REGISTER StatsEnableMask; + + /* Receive List Placement statistics Increment Mask. */ + T3_32BIT_REGISTER StatsIncMask; + + /* Unused space. */ + LM_UINT8 Unused1[224]; + + struct { + T3_32BIT_REGISTER Head; + T3_32BIT_REGISTER Tail; + T3_32BIT_REGISTER Count; + + /* Unused space. */ + LM_UINT8 Unused[4]; + } RcvSelectorList[16]; + + /* Local statistics counter. */ + T3_32BIT_REGISTER ClassOfServCnt[16]; + + T3_32BIT_REGISTER DropDueToFilterCnt; + T3_32BIT_REGISTER DmaWriteQFullCnt; + T3_32BIT_REGISTER DmaHighPriorityWriteQFullCnt; + T3_32BIT_REGISTER NoMoreReceiveBdCnt; + T3_32BIT_REGISTER IfInDiscardsCnt; + T3_32BIT_REGISTER IfInErrorsCnt; + T3_32BIT_REGISTER RcvThresholdHitCnt; + + /* Another unused space. */ + LM_UINT8 Unused2[420]; +} T3_RCV_LIST_PLACEMENT, *PT3_RCV_LIST_PLACEMENT; + + + +/******************************************************************************/ +/* Receive Data and Receive BD Initiator Control. */ +/******************************************************************************/ + +typedef struct { + /* Mode. */ + T3_32BIT_REGISTER Mode; + #define RCV_DATA_BD_IN_MODE_RESET BIT_0 + #define RCV_DATA_BD_IN_MODE_ENABLE BIT_1 + #define RCV_DATA_BD_IN_MODE_JUMBO_BD_NEEDED BIT_2 + #define RCV_DATA_BD_IN_MODE_FRAME_TOO_BIG BIT_3 + #define RCV_DATA_BD_IN_MODE_INVALID_RING_SIZE BIT_4 + + /* Status. */ + T3_32BIT_REGISTER Status; + #define RCV_DATA_BD_IN_STATUS_JUMBO_BD_NEEDED BIT_2 + #define RCV_DATA_BD_IN_STATUS_FRAME_TOO_BIG BIT_3 + #define RCV_DATA_BD_IN_STATUS_INVALID_RING_SIZE BIT_4 + + /* Split frame minium size. */ + T3_32BIT_REGISTER SplitFrameMinSize; + + /* Unused space. */ + LM_UINT8 Unused1[0x2440-0x240c]; + + /* Receive RCBs. */ + T3_RCB JumboRcvRcb; + T3_RCB StdRcvRcb; + T3_RCB MiniRcvRcb; + + /* Receive Data and Receive BD Ring Initiator Local NIC Receive */ + /* BD Consumber Index. */ + T3_32BIT_REGISTER NicJumboConIdx; + T3_32BIT_REGISTER NicStdConIdx; + T3_32BIT_REGISTER NicMiniConIdx; + + /* Unused space. */ + LM_UINT8 Unused2[4]; + + /* Receive Data and Receive BD Initiator Local Receive Return ProdIdx. */ + T3_32BIT_REGISTER RcvDataBdProdIdx[16]; + + /* Receive Data and Receive BD Initiator Hardware Diagnostic. */ + T3_32BIT_REGISTER HwDiag; + + /* Unused space. */ + LM_UINT8 Unused3[828]; +} T3_RCV_DATA_BD_INITIATOR, *PT3_RCV_DATA_BD_INITIATOR; + + + +/******************************************************************************/ +/* Receive Data Completion Control Registes. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; + #define RCV_DATA_COMP_MODE_RESET BIT_0 + #define RCV_DATA_COMP_MODE_ENABLE BIT_1 + #define RCV_DATA_COMP_MODE_ATTN_ENABLE BIT_2 + + /* Unused spaced. */ + LM_UINT8 Unused[1020]; +} T3_RCV_DATA_COMPLETION, *PT3_RCV_DATA_COMPLETION; + + + +/******************************************************************************/ +/* Receive BD Initiator Control. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; + #define RCV_BD_IN_MODE_RESET BIT_0 + #define RCV_BD_IN_MODE_ENABLE BIT_1 + #define RCV_BD_IN_MODE_BD_IN_DIABLED_RCB_ATTN_ENABLE BIT_2 + + T3_32BIT_REGISTER Status; + #define RCV_BD_IN_STATUS_BD_IN_DIABLED_RCB_ATTN BIT_2 + + T3_32BIT_REGISTER NicJumboRcvProdIdx; + T3_32BIT_REGISTER NicStdRcvProdIdx; + T3_32BIT_REGISTER NicMiniRcvProdIdx; + + T3_32BIT_REGISTER MiniRcvThreshold; + T3_32BIT_REGISTER StdRcvThreshold; + T3_32BIT_REGISTER JumboRcvThreshold; + + /* Unused space. */ + LM_UINT8 Unused[992]; +} T3_RCV_BD_INITIATOR, *PT3_RCV_BD_INITIATOR; + + + +/******************************************************************************/ +/* Receive BD Completion Control Registers. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; + #define RCV_BD_COMP_MODE_RESET BIT_0 + #define RCV_BD_COMP_MODE_ENABLE BIT_1 + #define RCV_BD_COMP_MODE_ATTN_ENABLE BIT_2 + + T3_32BIT_REGISTER Status; + #define RCV_BD_COMP_STATUS_ERROR_ATTN BIT_2 + + T3_32BIT_REGISTER NicJumboRcvBdProdIdx; + T3_32BIT_REGISTER NicStdRcvBdProdIdx; + T3_32BIT_REGISTER NicMiniRcvBdProdIdx; + + /* Unused space. */ + LM_UINT8 Unused[1004]; +} T3_RCV_BD_COMPLETION, *PT3_RCV_BD_COMPLETION; + + + +/******************************************************************************/ +/* Receive list selector control register. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; + #define RCV_LIST_SEL_MODE_RESET BIT_0 + #define RCV_LIST_SEL_MODE_ENABLE BIT_1 + #define RCV_LIST_SEL_MODE_ATTN_ENABLE BIT_2 + + T3_32BIT_REGISTER Status; + #define RCV_LIST_SEL_STATUS_ERROR_ATTN BIT_2 + + /* Unused space. */ + LM_UINT8 Unused[1016]; +} T3_RCV_LIST_SELECTOR, *PT3_RCV_LIST_SELECTOR; + + + +/******************************************************************************/ +/* Mbuf cluster free registers. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; +#define MBUF_CLUSTER_FREE_MODE_RESET BIT_0 +#define MBUF_CLUSTER_FREE_MODE_ENABLE BIT_1 + + T3_32BIT_REGISTER Status; + + /* Unused space. */ + LM_UINT8 Unused[1016]; +} T3_MBUF_CLUSTER_FREE, *PT3_MBUF_CLUSTER_FREE; + + + +/******************************************************************************/ +/* Host coalescing control registers. */ +/******************************************************************************/ + +typedef struct { + /* Mode. */ + T3_32BIT_REGISTER Mode; + #define HOST_COALESCE_RESET BIT_0 + #define HOST_COALESCE_ENABLE BIT_1 + #define HOST_COALESCE_ATTN BIT_2 + #define HOST_COALESCE_NOW BIT_3 + #define HOST_COALESCE_FULL_STATUS_MODE BIT_NONE + #define HOST_COALESCE_64_BYTE_STATUS_MODE BIT_7 + #define HOST_COALESCE_32_BYTE_STATUS_MODE BIT_8 + #define HOST_COALESCE_CLEAR_TICKS_ON_RX_BD_EVENT BIT_9 + #define HOST_COALESCE_CLEAR_TICKS_ON_TX_BD_EVENT BIT_10 + #define HOST_COALESCE_NO_INT_ON_COALESCE_NOW_MODE BIT_11 + #define HOST_COALESCE_NO_INT_ON_FORCE_DMAD_MODE BIT_12 + + /* Status. */ + T3_32BIT_REGISTER Status; + #define HOST_COALESCE_ERROR_ATTN BIT_2 + + /* Receive coalescing ticks. */ + T3_32BIT_REGISTER RxCoalescingTicks; + + /* Send coalescing ticks. */ + T3_32BIT_REGISTER TxCoalescingTicks; + + /* Receive max coalesced frames. */ + T3_32BIT_REGISTER RxMaxCoalescedFrames; + + /* Send max coalesced frames. */ + T3_32BIT_REGISTER TxMaxCoalescedFrames; + + /* Receive coalescing ticks during interrupt. */ + T3_32BIT_REGISTER RxCoalescedTickDuringInt; + + /* Send coalescing ticks during interrupt. */ + T3_32BIT_REGISTER TxCoalescedTickDuringInt; + + /* Receive max coalesced frames during interrupt. */ + T3_32BIT_REGISTER RxMaxCoalescedFramesDuringInt; + + /* Send max coalesced frames during interrupt. */ + T3_32BIT_REGISTER TxMaxCoalescedFramesDuringInt; + + /* Statistics tick. */ + T3_32BIT_REGISTER StatsCoalescingTicks; + + /* Unused space. */ + LM_UINT8 Unused2[4]; + + /* Statistics host address. */ + T3_64BIT_REGISTER StatsBlkHostAddr; + + /* Status block host address.*/ + T3_64BIT_REGISTER StatusBlkHostAddr; + + /* Statistics NIC address. */ + T3_32BIT_REGISTER StatsBlkNicAddr; + + /* Statust block NIC address. */ + T3_32BIT_REGISTER StatusBlkNicAddr; + + /* Flow attention registers. */ + T3_32BIT_REGISTER FlowAttn; + + /* Unused space. */ + LM_UINT8 Unused3[4]; + + T3_32BIT_REGISTER NicJumboRcvBdConIdx; + T3_32BIT_REGISTER NicStdRcvBdConIdx; + T3_32BIT_REGISTER NicMiniRcvBdConIdx; + + /* Unused space. */ + LM_UINT8 Unused4[36]; + + T3_32BIT_REGISTER NicRetProdIdx[16]; + T3_32BIT_REGISTER NicSndBdConIdx[16]; + + /* Unused space. */ + LM_UINT8 Unused5[768]; +} T3_HOST_COALESCING, *PT3_HOST_COALESCING; + + + +/******************************************************************************/ +/* Memory arbiter registers. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; +#define T3_MEM_ARBITER_MODE_RESET BIT_0 +#define T3_MEM_ARBITER_MODE_ENABLE BIT_1 + + T3_32BIT_REGISTER Status; + + T3_32BIT_REGISTER ArbTrapAddrLow; + T3_32BIT_REGISTER ArbTrapAddrHigh; + + /* Unused space. */ + LM_UINT8 Unused[1008]; +} T3_MEM_ARBITER, *PT3_MEM_ARBITER; + + + +/******************************************************************************/ +/* Buffer manager control register. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; + #define BUFMGR_MODE_RESET BIT_0 + #define BUFMGR_MODE_ENABLE BIT_1 + #define BUFMGR_MODE_ATTN_ENABLE BIT_2 + #define BUFMGR_MODE_BM_TEST BIT_3 + #define BUFMGR_MODE_MBUF_LOW_ATTN_ENABLE BIT_4 + + T3_32BIT_REGISTER Status; + #define BUFMGR_STATUS_ERROR BIT_2 + #define BUFMGR_STATUS_MBUF_LOW BIT_4 + + T3_32BIT_REGISTER MbufPoolAddr; + T3_32BIT_REGISTER MbufPoolSize; + T3_32BIT_REGISTER MbufReadDmaLowWaterMark; + T3_32BIT_REGISTER MbufMacRxLowWaterMark; + T3_32BIT_REGISTER MbufHighWaterMark; + + T3_32BIT_REGISTER RxCpuMbufAllocReq; + #define BUFMGR_MBUF_ALLOC_BIT BIT_31 + T3_32BIT_REGISTER RxCpuMbufAllocResp; + T3_32BIT_REGISTER TxCpuMbufAllocReq; + T3_32BIT_REGISTER TxCpuMbufAllocResp; + + T3_32BIT_REGISTER DmaDescPoolAddr; + T3_32BIT_REGISTER DmaDescPoolSize; + T3_32BIT_REGISTER DmaLowWaterMark; + T3_32BIT_REGISTER DmaHighWaterMark; + + T3_32BIT_REGISTER RxCpuDmaAllocReq; + T3_32BIT_REGISTER RxCpuDmaAllocResp; + T3_32BIT_REGISTER TxCpuDmaAllocReq; + T3_32BIT_REGISTER TxCpuDmaAllocResp; + + T3_32BIT_REGISTER Hwdiag[3]; + + /* Unused space. */ + LM_UINT8 Unused[936]; +} T3_BUFFER_MANAGER, *PT3_BUFFER_MANAGER; + + + +/******************************************************************************/ +/* Read DMA control registers. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; + #define DMA_READ_MODE_RESET BIT_0 + #define DMA_READ_MODE_ENABLE BIT_1 + #define DMA_READ_MODE_TARGET_ABORT_ATTN_ENABLE BIT_2 + #define DMA_READ_MODE_MASTER_ABORT_ATTN_ENABLE BIT_3 + #define DMA_READ_MODE_PARITY_ERROR_ATTN_ENABLE BIT_4 + #define DMA_READ_MODE_ADDR_OVERFLOW_ATTN_ENABLE BIT_5 + #define DMA_READ_MODE_FIFO_OVERRUN_ATTN_ENABLE BIT_6 + #define DMA_READ_MODE_FIFO_UNDERRUN_ATTN_ENABLE BIT_7 + #define DMA_READ_MODE_FIFO_OVERREAD_ATTN_ENABLE BIT_8 + #define DMA_READ_MODE_LONG_READ_ATTN_ENABLE BIT_9 + + T3_32BIT_REGISTER Status; + #define DMA_READ_STATUS_TARGET_ABORT_ATTN BIT_2 + #define DMA_READ_STATUS_MASTER_ABORT_ATTN BIT_3 + #define DMA_READ_STATUS_PARITY_ERROR_ATTN BIT_4 + #define DMA_READ_STATUS_ADDR_OVERFLOW_ATTN BIT_5 + #define DMA_READ_STATUS_FIFO_OVERRUN_ATTN BIT_6 + #define DMA_READ_STATUS_FIFO_UNDERRUN_ATTN BIT_7 + #define DMA_READ_STATUS_FIFO_OVERREAD_ATTN BIT_8 + #define DMA_READ_STATUS_LONG_READ_ATTN BIT_9 + + /* Unused space. */ + LM_UINT8 Unused[1016]; +} T3_DMA_READ, *PT3_DMA_READ; + +typedef union T3_CPU +{ + struct + { + T3_32BIT_REGISTER mode; + #define CPU_MODE_HALT BIT_10 + #define CPU_MODE_RESET BIT_0 + T3_32BIT_REGISTER state; + T3_32BIT_REGISTER EventMask; + T3_32BIT_REGISTER reserved1[4]; + T3_32BIT_REGISTER PC; + T3_32BIT_REGISTER Instruction; + T3_32BIT_REGISTER SpadUnderflow; + T3_32BIT_REGISTER WatchdogClear; + T3_32BIT_REGISTER WatchdogVector; + T3_32BIT_REGISTER WatchdogSavedPC; + T3_32BIT_REGISTER HardwareBp; + T3_32BIT_REGISTER reserved2[3]; + T3_32BIT_REGISTER WatchdogSavedState; + T3_32BIT_REGISTER LastBrchAddr; + T3_32BIT_REGISTER SpadUnderflowSet; + T3_32BIT_REGISTER reserved3[(0x200-0x50)/4]; + T3_32BIT_REGISTER Regs[32]; + T3_32BIT_REGISTER reserved4[(0x400-0x280)/4]; + }reg; +}T3_CPU, *PT3_CPU; + +/******************************************************************************/ +/* Write DMA control registers. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; + #define DMA_WRITE_MODE_RESET BIT_0 + #define DMA_WRITE_MODE_ENABLE BIT_1 + #define DMA_WRITE_MODE_TARGET_ABORT_ATTN_ENABLE BIT_2 + #define DMA_WRITE_MODE_MASTER_ABORT_ATTN_ENABLE BIT_3 + #define DMA_WRITE_MODE_PARITY_ERROR_ATTN_ENABLE BIT_4 + #define DMA_WRITE_MODE_ADDR_OVERFLOW_ATTN_ENABLE BIT_5 + #define DMA_WRITE_MODE_FIFO_OVERRUN_ATTN_ENABLE BIT_6 + #define DMA_WRITE_MODE_FIFO_UNDERRUN_ATTN_ENABLE BIT_7 + #define DMA_WRITE_MODE_FIFO_OVERREAD_ATTN_ENABLE BIT_8 + #define DMA_WRITE_MODE_LONG_READ_ATTN_ENABLE BIT_9 + + T3_32BIT_REGISTER Status; + #define DMA_WRITE_STATUS_TARGET_ABORT_ATTN BIT_2 + #define DMA_WRITE_STATUS_MASTER_ABORT_ATTN BIT_3 + #define DMA_WRITE_STATUS_PARITY_ERROR_ATTN BIT_4 + #define DMA_WRITE_STATUS_ADDR_OVERFLOW_ATTN BIT_5 + #define DMA_WRITE_STATUS_FIFO_OVERRUN_ATTN BIT_6 + #define DMA_WRITE_STATUS_FIFO_UNDERRUN_ATTN BIT_7 + #define DMA_WRITE_STATUS_FIFO_OVERREAD_ATTN BIT_8 + #define DMA_WRITE_STATUS_LONG_READ_ATTN BIT_9 + + /* Unused space. */ + LM_UINT8 Unused[1016]; +} T3_DMA_WRITE, *PT3_DMA_WRITE; + + + +/******************************************************************************/ +/* Mailbox registers. */ +/******************************************************************************/ + +typedef struct { + /* Interrupt mailbox registers. */ + T3_64BIT_REGISTER Interrupt[4]; + + /* General mailbox registers. */ + T3_64BIT_REGISTER General[8]; + + /* Reload statistics mailbox. */ + T3_64BIT_REGISTER ReloadStat; + + /* Receive BD ring producer index registers. */ + T3_64BIT_REGISTER RcvStdProdIdx; + T3_64BIT_REGISTER RcvJumboProdIdx; + T3_64BIT_REGISTER RcvMiniProdIdx; + + /* Receive return ring consumer index registers. */ + T3_64BIT_REGISTER RcvRetConIdx[16]; + + /* Send BD ring host producer index registers. */ + T3_64BIT_REGISTER SendHostProdIdx[16]; + + /* Send BD ring nic producer index registers. */ + T3_64BIT_REGISTER SendNicProdIdx[16]; +}T3_MAILBOX, *PT3_MAILBOX; + +typedef struct { + T3_MAILBOX Mailbox; + + /* Priority mailbox registers. */ + T3_32BIT_REGISTER HighPriorityEventVector; + T3_32BIT_REGISTER HighPriorityEventMask; + T3_32BIT_REGISTER LowPriorityEventVector; + T3_32BIT_REGISTER LowPriorityEventMask; + + /* Unused space. */ + LM_UINT8 Unused[496]; +} T3_GRC_MAILBOX, *PT3_GRC_MAILBOX; + + +/******************************************************************************/ +/* Flow through queues. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Reset; + + LM_UINT8 Unused[12]; + + T3_32BIT_REGISTER DmaNormalReadFtqCtrl; + T3_32BIT_REGISTER DmaNormalReadFtqFullCnt; + T3_32BIT_REGISTER DmaNormalReadFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER DmaNormalReadFtqFifoWritePeek; + + T3_32BIT_REGISTER DmaHighReadFtqCtrl; + T3_32BIT_REGISTER DmaHighReadFtqFullCnt; + T3_32BIT_REGISTER DmaHighReadFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER DmaHighReadFtqFifoWritePeek; + + T3_32BIT_REGISTER DmaCompDiscardFtqCtrl; + T3_32BIT_REGISTER DmaCompDiscardFtqFullCnt; + T3_32BIT_REGISTER DmaCompDiscardFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER DmaCompDiscardFtqFifoWritePeek; + + T3_32BIT_REGISTER SendBdCompFtqCtrl; + T3_32BIT_REGISTER SendBdCompFtqFullCnt; + T3_32BIT_REGISTER SendBdCompFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER SendBdCompFtqFifoWritePeek; + + T3_32BIT_REGISTER SendDataInitiatorFtqCtrl; + T3_32BIT_REGISTER SendDataInitiatorFtqFullCnt; + T3_32BIT_REGISTER SendDataInitiatorFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER SendDataInitiatorFtqFifoWritePeek; + + T3_32BIT_REGISTER DmaNormalWriteFtqCtrl; + T3_32BIT_REGISTER DmaNormalWriteFtqFullCnt; + T3_32BIT_REGISTER DmaNormalWriteFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER DmaNormalWriteFtqFifoWritePeek; + + T3_32BIT_REGISTER DmaHighWriteFtqCtrl; + T3_32BIT_REGISTER DmaHighWriteFtqFullCnt; + T3_32BIT_REGISTER DmaHighWriteFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER DmaHighWriteFtqFifoWritePeek; + + T3_32BIT_REGISTER SwType1FtqCtrl; + T3_32BIT_REGISTER SwType1FtqFullCnt; + T3_32BIT_REGISTER SwType1FtqFifoEnqueueDequeue; + T3_32BIT_REGISTER SwType1FtqFifoWritePeek; + + T3_32BIT_REGISTER SendDataCompFtqCtrl; + T3_32BIT_REGISTER SendDataCompFtqFullCnt; + T3_32BIT_REGISTER SendDataCompFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER SendDataCompFtqFifoWritePeek; + + T3_32BIT_REGISTER HostCoalesceFtqCtrl; + T3_32BIT_REGISTER HostCoalesceFtqFullCnt; + T3_32BIT_REGISTER HostCoalesceFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER HostCoalesceFtqFifoWritePeek; + + T3_32BIT_REGISTER MacTxFtqCtrl; + T3_32BIT_REGISTER MacTxFtqFullCnt; + T3_32BIT_REGISTER MacTxFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER MacTxFtqFifoWritePeek; + + T3_32BIT_REGISTER MbufClustFreeFtqCtrl; + T3_32BIT_REGISTER MbufClustFreeFtqFullCnt; + T3_32BIT_REGISTER MbufClustFreeFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER MbufClustFreeFtqFifoWritePeek; + + T3_32BIT_REGISTER RcvBdCompFtqCtrl; + T3_32BIT_REGISTER RcvBdCompFtqFullCnt; + T3_32BIT_REGISTER RcvBdCompFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER RcvBdCompFtqFifoWritePeek; + + T3_32BIT_REGISTER RcvListPlmtFtqCtrl; + T3_32BIT_REGISTER RcvListPlmtFtqFullCnt; + T3_32BIT_REGISTER RcvListPlmtFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER RcvListPlmtFtqFifoWritePeek; + + T3_32BIT_REGISTER RcvDataBdInitiatorFtqCtrl; + T3_32BIT_REGISTER RcvDataBdInitiatorFtqFullCnt; + T3_32BIT_REGISTER RcvDataBdInitiatorFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER RcvDataBdInitiatorFtqFifoWritePeek; + + T3_32BIT_REGISTER RcvDataCompFtqCtrl; + T3_32BIT_REGISTER RcvDataCompFtqFullCnt; + T3_32BIT_REGISTER RcvDataCompFtqFifoEnqueueDequeue; + T3_32BIT_REGISTER RcvDataCompFtqFifoWritePeek; + + T3_32BIT_REGISTER SwType2FtqCtrl; + T3_32BIT_REGISTER SwType2FtqFullCnt; + T3_32BIT_REGISTER SwType2FtqFifoEnqueueDequeue; + T3_32BIT_REGISTER SwType2FtqFifoWritePeek; + + /* Unused space. */ + LM_UINT8 Unused2[736]; +} T3_FTQ, *PT3_FTQ; + + + +/******************************************************************************/ +/* Message signaled interrupt registers. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; +#define MSI_MODE_RESET BIT_0 +#define MSI_MODE_ENABLE BIT_1 + T3_32BIT_REGISTER Status; + + T3_32BIT_REGISTER MsiFifoAccess; + + /* Unused space. */ + LM_UINT8 Unused[1012]; +} T3_MSG_SIGNALED_INT, *PT3_MSG_SIGNALED_INT; + + + +/******************************************************************************/ +/* DMA Completion registes. */ +/******************************************************************************/ + +typedef struct { + T3_32BIT_REGISTER Mode; + #define DMA_COMP_MODE_RESET BIT_0 + #define DMA_COMP_MODE_ENABLE BIT_1 + + /* Unused space. */ + LM_UINT8 Unused[1020]; +} T3_DMA_COMPLETION, *PT3_DMA_COMPLETION; + + + +/******************************************************************************/ +/* GRC registers. */ +/******************************************************************************/ + +typedef struct { + /* Mode control register. */ + T3_32BIT_REGISTER Mode; + #define GRC_MODE_UPDATE_ON_COALESCING BIT_0 + #define GRC_MODE_BYTE_SWAP_NON_FRAME_DATA BIT_1 + #define GRC_MODE_WORD_SWAP_NON_FRAME_DATA BIT_2 + #define GRC_MODE_BYTE_SWAP_DATA BIT_4 + #define GRC_MODE_WORD_SWAP_DATA BIT_5 + #define GRC_MODE_SPLIT_HEADER_MODE BIT_8 + #define GRC_MODE_NO_FRAME_CRACKING BIT_9 + #define GRC_MODE_INCLUDE_CRC BIT_10 + #define GRC_MODE_ALLOW_BAD_FRAMES BIT_11 + #define GRC_MODE_NO_INTERRUPT_ON_SENDS BIT_13 + #define GRC_MODE_NO_INTERRUPT_ON_RECEIVE BIT_14 + #define GRC_MODE_FORCE_32BIT_PCI_BUS_MODE BIT_15 + #define GRC_MODE_HOST_STACK_UP BIT_16 + #define GRC_MODE_HOST_SEND_BDS BIT_17 + #define GRC_MODE_TX_NO_PSEUDO_HEADER_CHKSUM BIT_20 + #define GRC_MODE_RX_NO_PSEUDO_HEADER_CHKSUM BIT_23 + #define GRC_MODE_INT_ON_TX_CPU_ATTN BIT_24 + #define GRC_MODE_INT_ON_RX_CPU_ATTN BIT_25 + #define GRC_MODE_INT_ON_MAC_ATTN BIT_26 + #define GRC_MODE_INT_ON_DMA_ATTN BIT_27 + #define GRC_MODE_INT_ON_FLOW_ATTN BIT_28 + #define GRC_MODE_4X_NIC_BASED_SEND_RINGS BIT_29 + #define GRC_MODE_MULTICAST_FRAME_ENABLE BIT_30 + + /* Misc configuration register. */ + T3_32BIT_REGISTER MiscCfg; + #define GRC_MISC_CFG_CORE_CLOCK_RESET BIT_0 + #define GRC_MISC_PRESCALAR_TIMER_MASK 0xfe + #define GRC_MISC_BD_ID_MASK 0x0001e000 + #define GRC_MISC_BD_ID_5700 0x0001e000 + #define GRC_MISC_BD_ID_5701 0x00000000 + #define GRC_MISC_BD_ID_5703 0x00000000 + #define GRC_MISC_BD_ID_5703S 0x00002000 + #define GRC_MISC_BD_ID_5702FE 0x00004000 + + /* Miscellaneous local control register. */ + T3_32BIT_REGISTER LocalCtrl; + #define GRC_MISC_LOCAL_CTRL_INT_ACTIVE BIT_0 + #define GRC_MISC_LOCAL_CTRL_CLEAR_INT BIT_1 + #define GRC_MISC_LOCAL_CTRL_SET_INT BIT_2 + #define GRC_MISC_LOCAL_CTRL_INT_ON_ATTN BIT_3 + #define GRC_MISC_LOCAL_CTRL_GPIO_INPUT0 BIT_8 + #define GRC_MISC_LOCAL_CTRL_GPIO_INPUT1 BIT_9 + #define GRC_MISC_LOCAL_CTRL_GPIO_INPUT2 BIT_10 + #define GRC_MISC_LOCAL_CTRL_GPIO_OE0 BIT_11 + #define GRC_MISC_LOCAL_CTRL_GPIO_OE1 BIT_12 + #define GRC_MISC_LOCAL_CTRL_GPIO_OE2 BIT_13 + #define GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT0 BIT_14 + #define GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT1 BIT_15 + #define GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT2 BIT_16 + #define GRC_MISC_LOCAL_CTRL_ENABLE_EXT_MEMORY BIT_17 + #define GRC_MISC_LOCAL_CTRL_BANK_SELECT BIT_21 + #define GRC_MISC_LOCAL_CTRL_SSRAM_TYPE BIT_22 + + #define GRC_MISC_MEMSIZE_256K 0 + #define GRC_MISC_MEMSIZE_512K (1 << 18) + #define GRC_MISC_MEMSIZE_1024K (2 << 18) + #define GRC_MISC_MEMSIZE_2048K (3 << 18) + #define GRC_MISC_MEMSIZE_4096K (4 << 18) + #define GRC_MISC_MEMSIZE_8192K (5 << 18) + #define GRC_MISC_MEMSIZE_16M (6 << 18) + #define GRC_MISC_LOCAL_CTRL_AUTO_SEEPROM BIT_24 + + + T3_32BIT_REGISTER Timer; + + T3_32BIT_REGISTER RxCpuEvent; + T3_32BIT_REGISTER RxTimerRef; + T3_32BIT_REGISTER RxCpuSemaphore; + T3_32BIT_REGISTER RemoteRxCpuAttn; + + T3_32BIT_REGISTER TxCpuEvent; + T3_32BIT_REGISTER TxTimerRef; + T3_32BIT_REGISTER TxCpuSemaphore; + T3_32BIT_REGISTER RemoteTxCpuAttn; + + T3_64BIT_REGISTER MemoryPowerUp; + + T3_32BIT_REGISTER EepromAddr; + #define SEEPROM_ADDR_WRITE 0 + #define SEEPROM_ADDR_READ (1 << 31) + #define SEEPROM_ADDR_RW_MASK 0x80000000 + #define SEEPROM_ADDR_COMPLETE (1 << 30) + #define SEEPROM_ADDR_FSM_RESET (1 << 29) + #define SEEPROM_ADDR_DEV_ID(x) (x << 26) + #define SEEPROM_ADDR_DEV_ID_MASK 0x1c000000 + #define SEEPROM_ADDR_START (1 << 25) + #define SEEPROM_ADDR_CLK_PERD(x) (x << 16) + #define SEEPROM_ADDR_ADDRESS(x) (x & 0xfffc) + #define SEEPROM_ADDR_ADDRESS_MASK 0x0000ffff + + #define SEEPROM_CLOCK_PERIOD 60 + #define SEEPROM_CHIP_SIZE (64 * 1024) + + T3_32BIT_REGISTER EepromData; + T3_32BIT_REGISTER EepromCtrl; + + T3_32BIT_REGISTER MdiCtrl; + T3_32BIT_REGISTER SepromDelay; + + /* Unused space. */ + LM_UINT8 Unused[948]; +} T3_GRC, *PT3_GRC; + + +/******************************************************************************/ +/* NVRAM control registers. */ +/******************************************************************************/ + +typedef struct +{ + T3_32BIT_REGISTER Cmd; + #define NVRAM_CMD_RESET BIT_0 + #define NVRAM_CMD_DONE BIT_3 + #define NVRAM_CMD_DO_IT BIT_4 + #define NVRAM_CMD_WR BIT_5 + #define NVRAM_CMD_RD BIT_NONE + #define NVRAM_CMD_ERASE BIT_6 + #define NVRAM_CMD_FIRST BIT_7 + #define NVRAM_CMD_LAST BIT_8 + + T3_32BIT_REGISTER Status; + T3_32BIT_REGISTER WriteData; + + T3_32BIT_REGISTER Addr; + #define NVRAM_ADDRESS_MASK 0xffffff + + T3_32BIT_REGISTER ReadData; + + /* Flash config 1 register. */ + T3_32BIT_REGISTER Config1; + #define FLASH_INTERFACE_ENABLE BIT_0 + #define FLASH_SSRAM_BUFFERRED_MODE BIT_1 + #define FLASH_PASS_THRU_MODE BIT_2 + #define FLASH_BIT_BANG_MODE BIT_3 + #define FLASH_COMPAT_BYPASS BIT_31 + + /* Buffered flash (Atmel: AT45DB011B) specific information */ + #define BUFFERED_FLASH_PAGE_POS 9 + #define BUFFERED_FLASH_BYTE_ADDR_MASK ((1<UndiFix) ? \ + LM_RegWrInd(pDevice, OFFSETOF(T3_STD_MEM_MAP, OffsetName)+0x5600, \ + Value32) : \ + (void) __raw_writel(Value32, &((pDevice)->pMemView->OffsetName)) + +#define MB_REG_RD(pDevice, OffsetName) \ + (((pDevice)->UndiFix) ? \ + LM_RegRdInd(pDevice, OFFSETOF(T3_STD_MEM_MAP, OffsetName)+0x5600) : \ + __raw_readl(&((pDevice)->pMemView->OffsetName))) + +#define REG_RD(pDevice, OffsetName) \ + LM_RegRd(pDevice, OFFSETOF(T3_STD_MEM_MAP, OffsetName)) + +#define REG_WR(pDevice, OffsetName, Value32) \ + LM_RegWr(pDevice, OFFSETOF(T3_STD_MEM_MAP, OffsetName), Value32) + +#define REG_RD_OFFSET(pDevice, Offset) \ + __raw_readl(((LM_UINT8 *) (pDevice)->pMemView + Offset)) + +#define REG_WR_OFFSET(pDevice, Offset, Value32) \ + __raw_writel(Value32, ((LM_UINT8 *) (pDevice)->pMemView + Offset)) + +#define MEM_RD(pDevice, AddrName) \ + LM_MemRdInd(pDevice, OFFSETOF(T3_FIRST_32K_SRAM, AddrName)) +#define MEM_WR(pDevice, AddrName, Value32) \ + LM_MemWrInd(pDevice, OFFSETOF(T3_FIRST_32K_SRAM, AddrName), Value32) + +#define MEM_RD_OFFSET(pDevice, Offset) \ + LM_MemRdInd(pDevice, Offset) +#define MEM_WR_OFFSET(pDevice, Offset, Value32) \ + LM_MemWrInd(pDevice, Offset, Value32) + + +#if 0 +/* MAC register access. */ +LM_UINT32 LM_RegRdInd(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Register); +LM_VOID LM_RegWrInd(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Register, + LM_UINT32 Value32); + +/* MAC memory access. */ +LM_UINT32 LM_MemRdInd(PLM_DEVICE_BLOCK pDevice, LM_UINT32 MemAddr); +LM_VOID LM_MemWrInd(PLM_DEVICE_BLOCK pDevice, LM_UINT32 MemAddr, + LM_UINT32 Value32); + +#define MB_REG_WR(pDevice, OffsetName, Value32) \ + ((pDevice)->UndiFix) ? \ + LM_RegWrInd(pDevice, OFFSETOF(T3_STD_MEM_MAP, OffsetName)+0x5600, \ + Value32) : \ + (void) __raw_writel(Value32, &((pDevice)->pMemView->OffsetName)) + +#define MB_REG_RD(pDevice, OffsetName) \ + (((pDevice)->UndiFix) ? \ + LM_RegRdInd(pDevice, OFFSETOF(T3_STD_MEM_MAP, OffsetName)+0x5600) : \ + __raw_readl(&((pDevice)->pMemView->OffsetName))) + +#define REG_RD(pDevice, OffsetName) \ + (((pDevice)->UndiFix) ? \ + LM_RegRdInd(pDevice, OFFSETOF(T3_STD_MEM_MAP, OffsetName)) : \ + __raw_readl(&((pDevice)->pMemView->OffsetName))) + +#if PCIX_TARGET_WORKAROUND + +/* use memor-mapped accesses for mailboxes and reads, UNDI accesses + for writes to all other registers */ +#define REG_WR(pDevice, OffsetName, Value32) \ + ((pDevice)->EnablePciXFix == FALSE) ? \ + (void) __raw_writel(Value32, &((pDevice)->pMemView->OffsetName)) : \ + LM_RegWrInd(pDevice, OFFSETOF(T3_STD_MEM_MAP, OffsetName), Value32) + + +#define MEM_RD(pDevice, AddrName) \ + LM_MemRdInd(pDevice, OFFSETOF(T3_FIRST_32K_SRAM, AddrName)) +#define MEM_WR(pDevice, AddrName, Value32) \ + LM_MemWrInd(pDevice, OFFSETOF(T3_FIRST_32K_SRAM, AddrName), Value32) + +#define MEM_RD_OFFSET(pDevice, Offset) \ + LM_MemRdInd(pDevice, Offset) +#define MEM_WR_OFFSET(pDevice, Offset, Value32) \ + LM_MemWrInd(pDevice, Offset, Value32) + +#else /* normal target access path below */ + +/* Register access. */ +#define REG_RD(pDevice, OffsetName) \ + __raw_readl(&((pDevice)->pMemView->OffsetName)) +#define REG_WR(pDevice, OffsetName, Value32) \ + __raw_writel(Value32, &((pDevice)->pMemView->OffsetName)) + +/* There could be problem access the memory window directly. For now, */ +/* we have to go through the PCI configuration register. */ +#define MEM_RD(pDevice, AddrName) \ + LM_MemRdInd(pDevice, OFFSETOF(T3_FIRST_32K_SRAM, AddrName)) +#define MEM_WR(pDevice, AddrName, Value32) \ + LM_MemWrInd(pDevice, OFFSETOF(T3_FIRST_32K_SRAM, AddrName), Value32) + +#define MEM_RD_OFFSET(pDevice, Offset) \ + LM_MemRdInd(pDevice, Offset) +#define MEM_WR_OFFSET(pDevice, Offset, Value32) \ + LM_MemWrInd(pDevice, Offset, Value32) + +#endif /* PCIX_TARGET_WORKAROUND */ + +#endif +#endif /* TIGON3_H */ + diff -urN linux-2.4.18/drivers/net/e1000/Makefile lia64-2.4/drivers/net/e1000/Makefile --- linux-2.4.18/drivers/net/e1000/Makefile Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/e1000/Makefile Fri Jul 19 17:19:35 2002 @@ -0,0 +1,92 @@ +################################################################################ +# +# This software program is available to you under a choice of one of two +# licenses. You may choose to be licensed under either the GNU General Public +# License (GPL) Version 2, June 1991, available at +# http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the +# text of which follows: +# +# Recipient has requested a license and Intel Corporation ("Intel") is willing +# to grant a license for the software entitled Linux Base Driver for the +# Intel(R) PRO/1000 Family of Adapters (e1000) (the "Software") being provided +# by Intel Corporation. The following definitions apply to this license: +# +# "Licensed Patents" means patent claims licensable by Intel Corporation which +# are necessarily infringed by the use of sale of the Software alone or when +# combined with the operating system referred to below. +# +# "Recipient" means the party to whom Intel delivers this Software. +# +# "Licensee" means Recipient and those third parties that receive a license to +# any operating system available under the GNU Public License version 2.0 or +# later. +# +# Copyright (c) 1999 - 2002 Intel Corporation. +# All rights reserved. +# +# The license is provided to Recipient and Recipient's Licensees under the +# following terms. +# +# Redistribution and use in source and binary forms of the Software, with or +# without modification, are permitted provided that the following conditions +# are met: +# +# Redistributions of source code of the Software may retain the above +# copyright notice, this list of conditions and the following disclaimer. +# +# Redistributions in binary form of the Software may reproduce the above +# copyright notice, this list of conditions and the following disclaimer in +# the documentation and/or materials provided with the distribution. +# +# Neither the name of Intel Corporation nor the names of its contributors +# shall be used to endorse or promote products derived from this Software +# without specific prior written permission. +# +# Intel hereby grants Recipient and Licensees a non-exclusive, worldwide, +# royalty-free patent license under Licensed Patents to make, use, sell, offer +# to sell, import and otherwise transfer the Software, if any, in source code +# and object code form. This license shall include changes to the Software +# that are error corrections or other minor changes to the Software that do +# not add functionality or features when the Software is incorporated in any +# version of an operating system that has been distributed under the GNU +# General Public License 2.0 or later. This patent license shall apply to the +# combination of the Software and any operating system licensed under the GNU +# Public License version 2.0 or later if, at the time Intel provides the +# Software to Recipient, such addition of the Software to the then publicly +# available versions of such operating systems available under the GNU Public +# License version 2.0 or later (whether in gold, beta or alpha form) causes +# such combination to be covered by the Licensed Patents. The patent license +# shall not apply to any other combinations which include the Software. NO +# hardware per se is licensed hereunder. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR IT CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# ANY LOSS OF USE; DATA, OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR +# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +################################################################################ + +########################################################################### +# Configuration Section + +# Optional features - set to 'y' for on, anything else for off +# Intel(R) Advanced Network Services +IANS := n +# Intel(R) PRO Diagnostics +IDIAG := n + +########################################################################### +# Driver files + +# core driver files +O_TARGET := e1000.o +obj-y := e1000_main.o e1000_mac.o e1000_phy.o e1000_proc.o +obj-m := $(O_TARGET) + +include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/drivers/net/e1000/e1000.h lia64-2.4/drivers/net/e1000/e1000.h --- linux-2.4.18/drivers/net/e1000/e1000.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/e1000/e1000.h Fri Jul 19 18:51:03 2002 @@ -0,0 +1,362 @@ +/******************************************************************************* + + This software program is available to you under a choice of one of two + licenses. You may choose to be licensed under either the GNU General Public + License (GPL) Version 2, June 1991, available at + http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the + text of which follows: + + Recipient has requested a license and Intel Corporation ("Intel") is willing + to grant a license for the software entitled Linux Base Driver for the + Intel(R) PRO/1000 Family of Adapters (e1000) (the "Software") being provided + by Intel Corporation. The following definitions apply to this license: + + "Licensed Patents" means patent claims licensable by Intel Corporation which + are necessarily infringed by the use of sale of the Software alone or when + combined with the operating system referred to below. + + "Recipient" means the party to whom Intel delivers this Software. + + "Licensee" means Recipient and those third parties that receive a license to + any operating system available under the GNU Public License version 2.0 or + later. + + Copyright (c) 1999 - 2002 Intel Corporation. + All rights reserved. + + The license is provided to Recipient and Recipient's Licensees under the + following terms. + + Redistribution and use in source and binary forms of the Software, with or + without modification, are permitted provided that the following conditions + are met: + + Redistributions of source code of the Software may retain the above + copyright notice, this list of conditions and the following disclaimer. + + Redistributions in binary form of the Software may reproduce the above + copyright notice, this list of conditions and the following disclaimer in + the documentation and/or materials provided with the distribution. + + Neither the name of Intel Corporation nor the names of its contributors + shall be used to endorse or promote products derived from this Software + without specific prior written permission. + + Intel hereby grants Recipient and Licensees a non-exclusive, worldwide, + royalty-free patent license under Licensed Patents to make, use, sell, offer + to sell, import and otherwise transfer the Software, if any, in source code + and object code form. This license shall include changes to the Software + that are error corrections or other minor changes to the Software that do + not add functionality or features when the Software is incorporated in any + version of an operating system that has been distributed under the GNU + General Public License 2.0 or later. This patent license shall apply to the + combination of the Software and any operating system licensed under the GNU + Public License version 2.0 or later if, at the time Intel provides the + Software to Recipient, such addition of the Software to the then publicly + available versions of such operating systems available under the GNU Public + License version 2.0 or later (whether in gold, beta or alpha form) causes + such combination to be covered by the Licensed Patents. The patent license + shall not apply to any other combinations which include the Software. NO + hardware per se is licensed hereunder. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR IT CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + ANY LOSS OF USE; DATA, OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + + +/* Linux PRO/1000 Ethernet Driver main header file */ + +#ifndef _E1000_H_ +#define _E1000_H_ + +#ifndef __E1000_MAIN__ +#define __NO_VERSION__ +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* ethtool support */ +#ifdef SIOCETHTOOL +#include +#include +#define E1000_ETHTOOL_COPPER_INTERFACE_SUPPORTS (SUPPORTED_10baseT_Half | \ + SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Half | \ + SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Full | \ + SUPPORTED_Autoneg | SUPPORTED_MII) +#define E1000_ETHTOOL_COPPER_INTERFACE_ADVERTISE (ADVERTISED_10baseT_Half | \ + ADVERTISED_10baseT_Full | ADVERTISED_100baseT_Half | \ + ADVERTISED_100baseT_Full | ADVERTISED_1000baseT_Full | \ + ADVERTISED_Autoneg | ADVERTISED_MII) +#define E1000_ETHTOOL_FIBER_INTERFACE_SUPPORTS (SUPPORTED_Autoneg | \ + SUPPORTED_FIBRE) +#define E1000_ETHTOOL_FIBER_INTERFACE_ADVERTISE (ADVERTISED_Autoneg | \ + ADVERTISED_FIBRE) +#endif /* SIOCETHTOOL */ + + + +struct e1000_adapter; + +#include "e1000_mac.h" +#include "e1000_phy.h" + +#ifdef IANS +#include "base_comm.h" +#include "ans_driver.h" +#include "ans.h" +#endif + +#ifdef IDIAG +#include "idiag_pro.h" +#include "idiag_e1000.h" +#endif + +#define BAR_0 0 + +/* 8254x can use Dual Address Cycles for 64-bit addressing */ + +/* Advertise that we can DMA from any address location */ +#define E1000_DMA_MASK (~0x0UL) +#define E1000_DBG(args...) +// #define E1000_DBG(args...) printk("e1000: " args) +#define E1000_ERR(args...) printk(KERN_ERR "e1000: " args) +#ifdef CONFIG_PPC +#define E1000_MAX_INTR 1 +#else +#define E1000_MAX_INTR 10 +#endif +#define MAX_NUM_MULTICAST_ADDRESSES 128 + +/* command line options defaults */ +#define DEFAULT_TXD 256 +#define MAX_TXD 256 +#define MIN_TXD 80 +#define MAX_82544_TXD 4096 +#define DEFAULT_RXD 256 +#define MAX_RXD 256 +#define MIN_RXD 80 +#define MAX_82544_RXD 4096 +#define DEFAULT_TIDV 64 +#define MAX_TIDV 0xFFFF +#define MIN_TIDV 0 +#define DEFAULT_RIDV 64 +#define MAX_RIDV 0xFFFF +#define MIN_RIDV 0 +#define DEFAULT_MDIX 0 +#define MAX_MDIX 3 +#define MIN_MDIX 0 + +#define OPTION_UNSET -1 +#define OPTION_DISABLED 0 +#define OPTION_ENABLED 1 +#define XSUMRX_DEFAULT OPTION_ENABLED +#define WAITFORLINK_DEFAULT OPTION_ENABLED +#define AUTONEG_ADV_DEFAULT 0x2F +#define AUTONEG_ADV_MASK 0x2F +#define FLOW_CONTROL_DEFAULT FLOW_CONTROL_FULL + +#define E1000_REPORT_TX_EARLY 2 + +/* Supported RX Buffer Sizes */ +#define E1000_RXBUFFER_2048 2048 +#define E1000_RXBUFFER_4096 4096 +#define E1000_RXBUFFER_8192 8192 +#define E1000_RXBUFFER_16384 16384 + +#define E1000_JUMBO_PBA 0x00000028 +#define E1000_DEFAULT_PBA 0x00000030 + +/* Round size up to the next multiple of unit */ +#define E1000_ROUNDUP(size, unit) ((((size) + (unit) - 1) / (unit)) * (unit)) + +/* This is better, but only works for unit sizes that are powers of 2 */ +#define E1000_ROUNDUP2(size, unit) (((size) + (unit) - 1) & ~((unit) - 1)) + +/* wrapper around a pointer to a socket buffer, + * so a DMA handle can be stored along with the buffer */ +struct e1000_buffer { + struct sk_buff *skb; + uint64_t dma; + unsigned long length; +}; + +/* Adapter->flags definitions */ +#define E1000_BOARD_OPEN 0 +#define E1000_RX_REFILL 1 +#define E1000_DIAG_OPEN 2 +#define E1000_LINK_STATUS_CHANGED 3 + +typedef enum _XSUM_CONTEXT_T { + OFFLOAD_NONE, + OFFLOAD_TCP_IP, + OFFLOAD_UDP_IP +} XSUM_CONTEXT_T; + +struct e1000_desc_ring { + void *desc; /* pointer to the descriptor ring memory */ + dma_addr_t dma; /* physical address of the descriptor ring */ + unsigned int size; /* length of descriptor ring in bytes */ + unsigned int count; /* number of descriptors in the ring */ + atomic_t unused; /* number of descriptors with no buffer */ + unsigned int next_to_use; /* next descriptor to associate a buffer with */ + unsigned int next_to_clean; /* next descriptor to check for DD status bit */ + struct e1000_buffer *buffer_info; /* array of buffer information structs */ +}; + +#define E1000_RX_DESC(ring, i) \ + (&(((struct e1000_rx_desc *)(ring.desc))[i])) + +#define E1000_TX_DESC(ring, i) \ + (&(((struct e1000_tx_desc *)(ring.desc))[i])) + +#define E1000_CONTEXT_DESC(ring, i) \ + (&(((struct e1000_context_desc *)(ring.desc))[i])) + +/* board specific private data structure */ + +struct e1000_adapter { + struct e1000_adapter *next; + struct e1000_adapter *prev; + + struct e1000_shared_adapter shared; + +#ifdef IANS + void *iANSReserved; + piANSsupport_t iANSdata; + uint32_t ans_link; + uint32_t ans_speed; + uint32_t ans_duplex; + uint32_t ans_suspend; + IANS_BD_TAGGING_MODE tag_mode; +#endif + + spinlock_t stats_lock; + spinlock_t rx_fill_lock; + + unsigned long flags; + uint32_t bd_number; + struct timer_list timer_id; + + /* Ethernet Node Address */ + uint8_t perm_net_addr[ETH_LENGTH_OF_ADDRESS]; + + /* Status Flags */ + boolean_t link_active; + uint16_t link_speed; + uint16_t link_duplex; + uint32_t rx_buffer_len; + + /* PCI Device Info */ + uint16_t vendor_id; + uint16_t device_id; + uint8_t rev_id; + uint16_t subven_id; + uint16_t subsys_id; + + uint32_t part_num; + + uint32_t int_mask; + + /* driver specific */ + struct tasklet_struct rx_fill_tasklet; + + struct e1000_desc_ring tx_ring; + uint32_t tx_int_delay; + uint32_t TxdCmd; + atomic_t tx_timeout; + + struct e1000_desc_ring rx_ring; + uint32_t rx_int_delay; + + uint64_t XsumRXGood; + uint64_t XsumRXError; + + /* Linux driver specific */ + struct net_device *netdev; + struct pci_dev *pdev; + struct net_device_stats net_stats; + char *id_string; + boolean_t RxChecksum; + XSUM_CONTEXT_T ActiveChecksumContext; + + struct e1000_phy_info phy_info; + struct e1000_shared_stats stats; + + /* PHY Statistics */ + struct e1000_phy_stats phy_stats; +}; + +/* Prototypes */ + +/* e1000_main.c */ +extern int e1000_init_module(void); +extern int e1000_probe_all(void); +extern void e1000_exit_module(void); +extern int e1000_probe(struct pci_dev *pdev, + const struct pci_device_id *ent); +extern void e1000_remove(struct pci_dev *pdev); +extern void e1000_delete(struct e1000_adapter *Adapter); +extern int e1000_open(struct net_device *netdev); +extern int e1000_close(struct net_device *netdev); +extern void e1000_set_multi(struct net_device *netdev); +extern int e1000_xmit_frame(struct sk_buff *skb, + struct net_device *netdev); +extern struct net_device_stats *e1000_get_stats(struct net_device *netdev); +extern int e1000_change_mtu(struct net_device *netdev, + int new_mtu); +extern int e1000_set_mac(struct net_device *netdev, + void *p); +extern void e1000_intr(int irq, + void *data, + struct pt_regs *regs); +extern int e1000_ioctl(struct net_device *netdev, + struct ifreq *ifr, + int cmd); +extern void e1000_watchdog(unsigned long data); +extern void e1000_diag_ioctl(struct net_device *netdev, + struct ifreq *ifr); + +#ifdef CONFIG_PROC_FS +#include "e1000_proc.h" +#endif +#ifdef IDIAG +#include "e1000_idiag.h" +#endif +#endif /* _E1000_H_ */ diff -urN linux-2.4.18/drivers/net/e1000/e1000_mac.c lia64-2.4/drivers/net/e1000/e1000_mac.c --- linux-2.4.18/drivers/net/e1000/e1000_mac.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/e1000/e1000_mac.c Fri Jul 19 17:19:35 2002 @@ -0,0 +1,2093 @@ +/******************************************************************************* + + This software program is available to you under a choice of one of two + licenses. You may choose to be licensed under either the GNU General Public + License (GPL) Version 2, June 1991, available at + http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the + text of which follows: + + Recipient has requested a license and Intel Corporation ("Intel") is willing + to grant a license for the software entitled Linux Base Driver for the + Intel(R) PRO/1000 Family of Adapters (e1000) (the "Software") being provided + by Intel Corporation. The following definitions apply to this license: + + "Licensed Patents" means patent claims licensable by Intel Corporation which + are necessarily infringed by the use of sale of the Software alone or when + combined with the operating system referred to below. + + "Recipient" means the party to whom Intel delivers this Software. + + "Licensee" means Recipient and those third parties that receive a license to + any operating system available under the GNU Public License version 2.0 or + later. + + Copyright (c) 1999 - 2002 Intel Corporation. + All rights reserved. + + The license is provided to Recipient and Recipient's Licensees under the + following terms. + + Redistribution and use in source and binary forms of the Software, with or + without modification, are permitted provided that the following conditions + are met: + + Redistributions of source code of the Software may retain the above + copyright notice, this list of conditions and the following disclaimer. + + Redistributions in binary form of the Software may reproduce the above + copyright notice, this list of conditions and the following disclaimer in + the documentation and/or materials provided with the distribution. + + Neither the name of Intel Corporation nor the names of its contributors + shall be used to endorse or promote products derived from this Software + without specific prior written permission. + + Intel hereby grants Recipient and Licensees a non-exclusive, worldwide, + royalty-free patent license under Licensed Patents to make, use, sell, offer + to sell, import and otherwise transfer the Software, if any, in source code + and object code form. This license shall include changes to the Software + that are error corrections or other minor changes to the Software that do + not add functionality or features when the Software is incorporated in any + version of an operating system that has been distributed under the GNU + General Public License 2.0 or later. This patent license shall apply to the + combination of the Software and any operating system licensed under the GNU + Public License version 2.0 or later if, at the time Intel provides the + Software to Recipient, such addition of the Software to the then publicly + available versions of such operating systems available under the GNU Public + License version 2.0 or later (whether in gold, beta or alpha form) causes + such combination to be covered by the Licensed Patents. The patent license + shall not apply to any other combinations which include the Software. NO + hardware per se is licensed hereunder. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR IT CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + ANY LOSS OF USE; DATA, OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + +/* e1000_mac.c + * Shared functions for accessing and configuring the MAC + */ + +#include "e1000_mac.h" +#include "e1000_phy.h" + +/****************************************************************************** + * Raises the EEPROM's clock input. + * + * shared - Struct containing variables accessed by shared code + * eecd_reg - EECD's current value + *****************************************************************************/ +static void +e1000_raise_clock(struct e1000_shared_adapter *shared, + uint32_t *eecd_reg) +{ + /* Raise the clock input to the EEPROM (by setting the SK bit), and then + * wait 50 microseconds. + */ + *eecd_reg = *eecd_reg | E1000_EECD_SK; + E1000_WRITE_REG(shared, EECD, *eecd_reg); + usec_delay(50); + return; +} + +/****************************************************************************** + * Lowers the EEPROM's clock input. + * + * shared - Struct containing variables accessed by shared code + * eecd_reg - EECD's current value + *****************************************************************************/ +static void +e1000_lower_clock(struct e1000_shared_adapter *shared, + uint32_t *eecd_reg) +{ + /* Lower the clock input to the EEPROM (by clearing the SK bit), and then + * wait 50 microseconds. + */ + *eecd_reg = *eecd_reg & ~E1000_EECD_SK; + E1000_WRITE_REG(shared, EECD, *eecd_reg); + usec_delay(50); + return; +} + +/****************************************************************************** + * Shift data bits out to the EEPROM. + * + * shared - Struct containing variables accessed by shared code + * data - data to send to the EEPROM + * count - number of bits to shift out + *****************************************************************************/ +static void +e1000_shift_out_bits(struct e1000_shared_adapter *shared, + uint16_t data, + uint16_t count) +{ + uint32_t eecd_reg; + uint32_t mask; + + /* We need to shift "count" bits out to the EEPROM. So, value in the + * "data" parameter will be shifted out to the EEPROM one bit at a time. + * In order to do this, "data" must be broken down into bits. + */ + mask = 0x01 << (count - 1); + eecd_reg = E1000_READ_REG(shared, EECD); + eecd_reg &= ~(E1000_EECD_DO | E1000_EECD_DI); + do { + /* A "1" is shifted out to the EEPROM by setting bit "DI" to a "1", + * and then raising and then lowering the clock (the SK bit controls + * the clock input to the EEPROM). A "0" is shifted out to the EEPROM + * by setting "DI" to "0" and then raising and then lowering the clock. + */ + eecd_reg &= ~E1000_EECD_DI; + + if(data & mask) + eecd_reg |= E1000_EECD_DI; + + E1000_WRITE_REG(shared, EECD, eecd_reg); + + usec_delay(50); + + e1000_raise_clock(shared, &eecd_reg); + e1000_lower_clock(shared, &eecd_reg); + + mask = mask >> 1; + + } while(mask); + + /* We leave the "DI" bit set to "0" when we leave this routine. */ + eecd_reg &= ~E1000_EECD_DI; + E1000_WRITE_REG(shared, EECD, eecd_reg); + return; +} + +/****************************************************************************** + * Shift data bits in from the EEPROM + * + * shared - Struct containing variables accessed by shared code + *****************************************************************************/ +static uint16_t +e1000_shift_in_bits(struct e1000_shared_adapter *shared) +{ + uint32_t eecd_reg; + uint32_t i; + uint16_t data; + + /* In order to read a register from the EEPROM, we need to shift 16 bits + * in from the EEPROM. Bits are "shifted in" by raising the clock input to + * the EEPROM (setting the SK bit), and then reading the value of the "DO" + * bit. During this "shifting in" process the "DI" bit should always be + * clear.. + */ + + eecd_reg = E1000_READ_REG(shared, EECD); + + eecd_reg &= ~(E1000_EECD_DO | E1000_EECD_DI); + data = 0; + + for(i = 0; i < 16; i++) { + data = data << 1; + e1000_raise_clock(shared, &eecd_reg); + + eecd_reg = E1000_READ_REG(shared, EECD); + + eecd_reg &= ~(E1000_EECD_DI); + if(eecd_reg & E1000_EECD_DO) + data |= 1; + + e1000_lower_clock(shared, &eecd_reg); + } + + return data; +} + +/****************************************************************************** + * Prepares EEPROM for access + * + * shared - Struct containing variables accessed by shared code + * + * Lowers EEPROM clock. Clears input pin. Sets the chip select pin. This + * function should be called before issuing a command to the EEPROM. + *****************************************************************************/ +static void +e1000_setup_eeprom(struct e1000_shared_adapter *shared) +{ + uint32_t eecd_reg; + + eecd_reg = E1000_READ_REG(shared, EECD); + + /* Clear SK and DI */ + eecd_reg &= ~(E1000_EECD_SK | E1000_EECD_DI); + E1000_WRITE_REG(shared, EECD, eecd_reg); + + /* Set CS */ + eecd_reg |= E1000_EECD_CS; + E1000_WRITE_REG(shared, EECD, eecd_reg); + return; +} + +/****************************************************************************** + * Returns EEPROM to a "standby" state + * + * shared - Struct containing variables accessed by shared code + *****************************************************************************/ +static void +e1000_standby_eeprom(struct e1000_shared_adapter *shared) +{ + uint32_t eecd_reg; + + eecd_reg = E1000_READ_REG(shared, EECD); + + /* Deselct EEPROM */ + eecd_reg &= ~(E1000_EECD_CS | E1000_EECD_SK); + E1000_WRITE_REG(shared, EECD, eecd_reg); + usec_delay(50); + + /* Clock high */ + eecd_reg |= E1000_EECD_SK; + E1000_WRITE_REG(shared, EECD, eecd_reg); + usec_delay(50); + + /* Select EEPROM */ + eecd_reg |= E1000_EECD_CS; + E1000_WRITE_REG(shared, EECD, eecd_reg); + usec_delay(50); + + /* Clock low */ + eecd_reg &= ~E1000_EECD_SK; + E1000_WRITE_REG(shared, EECD, eecd_reg); + usec_delay(50); + return; +} + +/****************************************************************************** + * Raises then lowers the EEPROM's clock pin + * + * shared - Struct containing variables accessed by shared code + *****************************************************************************/ +static void +e1000_clock_eeprom(struct e1000_shared_adapter *shared) +{ + uint32_t eecd_reg; + + eecd_reg = E1000_READ_REG(shared, EECD); + + /* Rising edge of clock */ + eecd_reg |= E1000_EECD_SK; + E1000_WRITE_REG(shared, EECD, eecd_reg); + usec_delay(50); + + /* Falling edge of clock */ + eecd_reg &= ~E1000_EECD_SK; + E1000_WRITE_REG(shared, EECD, eecd_reg); + usec_delay(50); + return; +} + +/****************************************************************************** + * Terminates a command by lowering the EEPROM's chip select pin + * + * shared - Struct containing variables accessed by shared code + *****************************************************************************/ +static void +e1000_cleanup_eeprom(struct e1000_shared_adapter *shared) +{ + uint32_t eecd_reg; + + eecd_reg = E1000_READ_REG(shared, EECD); + + eecd_reg &= ~(E1000_EECD_CS | E1000_EECD_DI); + + E1000_WRITE_REG(shared, EECD, eecd_reg); + + e1000_clock_eeprom(shared); + return; +} + +/****************************************************************************** + * Waits for the EEPROM to finish the current command. + * + * shared - Struct containing variables accessed by shared code + * + * The command is done when the EEPROM's data out pin goes high. + *****************************************************************************/ +static uint16_t +e1000_wait_eeprom_command(struct e1000_shared_adapter *shared) +{ + uint32_t eecd_reg; + uint32_t i; + + + /* Toggle the CS line. This in effect tells to EEPROM to actually execute + * the command in question. + */ + e1000_standby_eeprom(shared); + + /* Now read DO repeatedly until is high (equal to '1'). The EEEPROM will + * signal that the command has been completed by raising the DO signal. + * If DO does not go high in 10 milliseconds, then error out. + */ + for(i = 0; i < 200; i++) { + eecd_reg = E1000_READ_REG(shared, EECD); + + if(eecd_reg & E1000_EECD_DO) + return (TRUE); + + usec_delay(50); + } + ASSERT(0); + return (FALSE); +} + +/****************************************************************************** + * Forces the MAC's flow control settings. + * + * shared - Struct containing variables accessed by shared code + * + * Sets the TFCE and RFCE bits in the device control register to reflect + * the adapter settings. TFCE and RFCE need to be explicitly set by + * software when a Copper PHY is used because autonegotiation is managed + * by the PHY rather than the MAC. Software must also configure these + * bits when link is forced on a fiber connection. + *****************************************************************************/ +static void +e1000_force_mac_fc(struct e1000_shared_adapter *shared) +{ + uint32_t ctrl_reg; + + DEBUGFUNC("e1000_force_mac_fc"); + + /* Get the current configuration of the Device Control Register */ + ctrl_reg = E1000_READ_REG(shared, CTRL); + + /* Because we didn't get link via the internal auto-negotiation + * mechanism (we either forced link or we got link via PHY + * auto-neg), we have to manually enable/disable transmit an + * receive flow control. + * + * The "Case" statement below enables/disable flow control + * according to the "shared->fc" parameter. + * + * The possible values of the "fc" parameter are: + * 0: Flow control is completely disabled + * 1: Rx flow control is enabled (we can receive pause + * frames but not send pause frames). + * 2: Tx flow control is enabled (we can send pause frames + * frames but we do not receive pause frames). + * 3: Both Rx and TX flow control (symmetric) is enabled. + * other: No other values should be possible at this point. + */ + + switch (shared->fc) { + case e1000_fc_none: + ctrl_reg &= (~(E1000_CTRL_TFCE | E1000_CTRL_RFCE)); + break; + case e1000_fc_rx_pause: + ctrl_reg &= (~E1000_CTRL_TFCE); + ctrl_reg |= E1000_CTRL_RFCE; + break; + case e1000_fc_tx_pause: + ctrl_reg &= (~E1000_CTRL_RFCE); + ctrl_reg |= E1000_CTRL_TFCE; + break; + case e1000_fc_full: + ctrl_reg |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE); + break; + default: + DEBUGOUT("Flow control param set incorrectly\n"); + ASSERT(0); + break; + } + + /* Disable TX Flow Control for 82542 (rev 2.0) */ + if(shared->mac_type == e1000_82542_rev2_0) + ctrl_reg &= (~E1000_CTRL_TFCE); + + + E1000_WRITE_REG(shared, CTRL, ctrl_reg); + return; +} + +/****************************************************************************** + * Reset the transmit and receive units; mask and clear all interrupts. + * + * shared - Struct containing variables accessed by shared code + *****************************************************************************/ +void +e1000_adapter_stop(struct e1000_shared_adapter *shared) +{ +#if DBG + uint32_t ctrl_reg; +#endif + uint32_t ctrl_ext_reg; + uint32_t icr_reg; + uint16_t pci_cmd_word; + + DEBUGFUNC("e1000_shared_adapter_stop"); + + /* If we are stopped or resetting exit gracefully and wait to be + * started again before accessing the hardware. + */ + if(shared->adapter_stopped) { + DEBUGOUT("Exiting because the adapter is already stopped!!!\n"); + return; + } + + /* Set the Adapter Stopped flag so other driver functions stop + * touching the Hardware. + */ + shared->adapter_stopped = TRUE; + + /* For 82542 (rev 2.0), disable MWI before issuing a device reset */ + if(shared->mac_type == e1000_82542_rev2_0) { + if(shared->pci_cmd_word & CMD_MEM_WRT_INVALIDATE) { + DEBUGOUT("Disabling MWI on 82542 rev 2.0\n"); + + pci_cmd_word = shared->pci_cmd_word & ~CMD_MEM_WRT_INVALIDATE; + + e1000_write_pci_cfg(shared, PCI_COMMAND_REGISTER, &pci_cmd_word); + } + } + + /* Clear interrupt mask to stop board from generating interrupts */ + DEBUGOUT("Masking off all interrupts\n"); + E1000_WRITE_REG(shared, IMC, 0xffffffff); + + /* Disable the Transmit and Receive units. Then delay to allow + * any pending transactions to complete before we hit the MAC with + * the global reset. + */ + E1000_WRITE_REG(shared, RCTL, 0); + E1000_WRITE_REG(shared, TCTL, E1000_TCTL_PSP); + + /* The tbi_compatibility_on Flag must be cleared when Rctl is cleared. */ + shared->tbi_compatibility_on = FALSE; + + msec_delay(10); + + /* Issue a global reset to the MAC. This will reset the chip's + * transmit, receive, DMA, and link units. It will not effect + * the current PCI configuration. The global reset bit is self- + * clearing, and should clear within a microsecond. + */ + DEBUGOUT("Issuing a global reset to MAC\n"); + E1000_WRITE_REG(shared, CTRL, E1000_CTRL_RST); + + /* Delay a few ms just to allow the reset to complete */ + msec_delay(10); + +#if DBG + /* Make sure the self-clearing global reset bit did self clear */ + ctrl_reg = E1000_READ_REG(shared, CTRL); + + ASSERT(!(ctrl_reg & E1000_CTRL_RST)); +#endif + + /* Force a reload from the EEPROM */ + ctrl_ext_reg = E1000_READ_REG(shared, CTRL_EXT); + ctrl_ext_reg |= E1000_CTRL_EXT_EE_RST; + E1000_WRITE_REG(shared, CTRL_EXT, ctrl_ext_reg); + msec_delay(2); + + /* Clear interrupt mask to stop board from generating interrupts */ + DEBUGOUT("Masking off all interrupts\n"); + E1000_WRITE_REG(shared, IMC, 0xffffffff); + + /* Clear any pending interrupt events. */ + icr_reg = E1000_READ_REG(shared, ICR); + + /* If MWI was previously enabled, reenable it. */ + if(shared->mac_type == e1000_82542_rev2_0) { + if(shared->pci_cmd_word & CMD_MEM_WRT_INVALIDATE) { + e1000_write_pci_cfg(shared, + PCI_COMMAND_REGISTER, &shared->pci_cmd_word); + } + } + return; +} + +/****************************************************************************** + * Performs basic configuration of the adapter. + * + * shared - Struct containing variables accessed by shared code + * + * Assumes that the controller has previously been reset and is in a + * post-reset uninitialized state. Initializes the receive address registers, + * multicast table, and VLAN filter table. Calls routines to setup link + * configuration and flow control settings. Clears all on-chip counters. Leaves + * the transmit and receive units disabled and uninitialized. + *****************************************************************************/ +boolean_t +e1000_init_hw(struct e1000_shared_adapter *shared) +{ + uint32_t status_reg; + uint32_t i; + uint16_t pci_cmd_word; + boolean_t status; + + DEBUGFUNC("e1000_init_hw"); + + /* Set the Media Type and exit with error if it is not valid. */ + if(shared->mac_type != e1000_82543) { + /* tbi_compatibility is only valid on 82543 */ + shared->tbi_compatibility_en = FALSE; + } + + if(shared->mac_type >= e1000_82543) { + status_reg = E1000_READ_REG(shared, STATUS); + if(status_reg & E1000_STATUS_TBIMODE) { + shared->media_type = e1000_media_type_fiber; + /* tbi_compatibility not valid on fiber */ + shared->tbi_compatibility_en = FALSE; + } else { + shared->media_type = e1000_media_type_copper; + } + } else { + /* This is an 82542 (fiber only) */ + shared->media_type = e1000_media_type_fiber; + } + + /* Disabling VLAN filtering. */ + DEBUGOUT("Initializing the IEEE VLAN\n"); + E1000_WRITE_REG(shared, VET, 0); + + e1000_clear_vfta(shared); + + /* For 82542 (rev 2.0), disable MWI and put the receiver into reset */ + if(shared->mac_type == e1000_82542_rev2_0) { + if(shared->pci_cmd_word & CMD_MEM_WRT_INVALIDATE) { + DEBUGOUT("Disabling MWI on 82542 rev 2.0\n"); + pci_cmd_word = shared->pci_cmd_word & ~CMD_MEM_WRT_INVALIDATE; + e1000_write_pci_cfg(shared, PCI_COMMAND_REGISTER, &pci_cmd_word); + } + E1000_WRITE_REG(shared, RCTL, E1000_RCTL_RST); + + msec_delay(5); + } + + /* Setup the receive address. This involves initializing all of the Receive + * Address Registers (RARs 0 - 15). + */ + e1000_init_rx_addrs(shared); + + /* For 82542 (rev 2.0), take the receiver out of reset and enable MWI */ + if(shared->mac_type == e1000_82542_rev2_0) { + E1000_WRITE_REG(shared, RCTL, 0); + + msec_delay(1); + + if(shared->pci_cmd_word & CMD_MEM_WRT_INVALIDATE) { + e1000_write_pci_cfg(shared, + PCI_COMMAND_REGISTER, &shared->pci_cmd_word); + } + } + + /* Zero out the Multicast HASH table */ + DEBUGOUT("Zeroing the MTA\n"); + for(i = 0; i < E1000_MC_TBL_SIZE; i++) + E1000_WRITE_REG_ARRAY(shared, MTA, i, 0); + + /* Call a subroutine to configure the link and setup flow control. */ + status = e1000_setup_fc_and_link(shared); + + /* Clear all of the statistics registers (clear on read). It is + * important that we do this after we have tried to establish link + * because the symbol error count will increment wildly if there + * is no link. + */ + e1000_clear_hw_cntrs(shared); + + shared->low_profile = FALSE; + if(shared->mac_type == e1000_82544) { + if(e1000_read_eeprom(shared, E1000_EEPROM_LED_LOGIC) & + E1000_EEPROM_SWDPIN0) + shared->low_profile = TRUE; + } + + return (status); +} + +/****************************************************************************** + * Initializes receive address filters. + * + * shared - Struct containing variables accessed by shared code + * + * Places the MAC address in receive address register 0 and clears the rest + * of the receive addresss registers. Clears the multicast table. Assumes + * the receiver is in reset when the routine is called. + *****************************************************************************/ +void +e1000_init_rx_addrs(struct e1000_shared_adapter *shared) +{ + uint32_t i; + uint32_t addr_low; + uint32_t addr_high; + + DEBUGFUNC("e1000_init_rx_addrs"); + + /* Setup the receive address. */ + DEBUGOUT("Programming MAC Address into RAR[0]\n"); + addr_low = (shared->mac_addr[0] | + (shared->mac_addr[1] << 8) | + (shared->mac_addr[2] << 16) | (shared->mac_addr[3] << 24)); + + addr_high = (shared->mac_addr[4] | + (shared->mac_addr[5] << 8) | E1000_RAH_AV); + + E1000_WRITE_REG_ARRAY(shared, RA, 0, addr_low); + E1000_WRITE_REG_ARRAY(shared, RA, 1, addr_high); + + /* Zero out the other 15 receive addresses. */ + DEBUGOUT("Clearing RAR[1-15]\n"); + for(i = 1; i < E1000_RAR_ENTRIES; i++) { + E1000_WRITE_REG_ARRAY(shared, RA, (i << 1), 0); + E1000_WRITE_REG_ARRAY(shared, RA, ((i << 1) + 1), 0); + } + + return; +} + +/****************************************************************************** + * Updates the MAC's list of multicast addresses. + * + * shared - Struct containing variables accessed by shared code + * mc_addr_list - the list of new multicast addresses + * mc_addr_count - number of addresses + * pad - number of bytes between addresses in the list + * + * The given list replaces any existing list. Clears the last 15 receive + * address registers and the multicast table. Uses receive address registers + * for the first 15 multicast addresses, and hashes the rest into the + * multicast table. + *****************************************************************************/ +void +e1000_mc_addr_list_update(struct e1000_shared_adapter *shared, + uint8_t *mc_addr_list, + uint32_t mc_addr_count, + uint32_t pad) +{ + uint32_t hash_value; + uint32_t i; + uint32_t rar_used_count = 1; /* RAR[0] is used for our MAC address */ + + DEBUGFUNC("e1000_mc_addr_list_update"); + + /* Set the new number of MC addresses that we are being requested to use. */ + shared->num_mc_addrs = mc_addr_count; + + /* Clear RAR[1-15] */ + DEBUGOUT(" Clearing RAR[1-15]\n"); + for(i = rar_used_count; i < E1000_RAR_ENTRIES; i++) { + E1000_WRITE_REG_ARRAY(shared, RA, (i << 1), 0); + E1000_WRITE_REG_ARRAY(shared, RA, ((i << 1) + 1), 0); + } + + /* Clear the MTA */ + DEBUGOUT(" Clearing MTA\n"); + for(i = 0; i < E1000_NUM_MTA_REGISTERS; i++) { + E1000_WRITE_REG_ARRAY(shared, MTA, i, 0); + } + + /* Add the new addresses */ + for(i = 0; i < mc_addr_count; i++) { + DEBUGOUT(" Adding the multicast addresses:\n"); + DEBUGOUT7(" MC Addr #%d =%.2X %.2X %.2X %.2X %.2X %.2X\n", i, + mc_addr_list[i * (ETH_LENGTH_OF_ADDRESS + pad)], + mc_addr_list[i * (ETH_LENGTH_OF_ADDRESS + pad) + 1], + mc_addr_list[i * (ETH_LENGTH_OF_ADDRESS + pad) + 2], + mc_addr_list[i * (ETH_LENGTH_OF_ADDRESS + pad) + 3], + mc_addr_list[i * (ETH_LENGTH_OF_ADDRESS + pad) + 4], + mc_addr_list[i * (ETH_LENGTH_OF_ADDRESS + pad) + 5]); + + hash_value = e1000_hash_mc_addr(shared, + mc_addr_list + + (i * (ETH_LENGTH_OF_ADDRESS + pad))); + + DEBUGOUT1(" Hash value = 0x%03X\n", hash_value); + + /* Place this multicast address in the RAR if there is room, * + * else put it in the MTA + */ + if(rar_used_count < E1000_RAR_ENTRIES) { + e1000_rar_set(shared, + mc_addr_list + (i * (ETH_LENGTH_OF_ADDRESS + pad)), + rar_used_count); + rar_used_count++; + } else { + e1000_mta_set(shared, hash_value); + } + } + + DEBUGOUT("MC Update Complete\n"); + return; +} + +/****************************************************************************** + * Hashes an address to determine its location in the multicast table + * + * shared - Struct containing variables accessed by shared code + * mc_addr - the multicast address to hash + *****************************************************************************/ +uint32_t +e1000_hash_mc_addr(struct e1000_shared_adapter *shared, + uint8_t *mc_addr) +{ + uint32_t hash_value = 0; + + /* The portion of the address that is used for the hash table is + * determined by the mc_filter_type setting. + */ + switch (shared->mc_filter_type) { + /* [0] [1] [2] [3] [4] [5] + * 01 AA 00 12 34 56 + * LSB MSB - According to H/W docs */ + case 0: + /* [47:36] i.e. 0x563 for above example address */ + hash_value = ((mc_addr[4] >> 4) | (((uint16_t) mc_addr[5]) << 4)); + break; + case 1: /* [46:35] i.e. 0xAC6 for above example address */ + hash_value = ((mc_addr[4] >> 3) | (((uint16_t) mc_addr[5]) << 5)); + break; + case 2: /* [45:34] i.e. 0x5D8 for above example address */ + hash_value = ((mc_addr[4] >> 2) | (((uint16_t) mc_addr[5]) << 6)); + break; + case 3: /* [43:32] i.e. 0x634 for above example address */ + hash_value = ((mc_addr[4]) | (((uint16_t) mc_addr[5]) << 8)); + break; + } + + hash_value &= 0xFFF; + return (hash_value); +} + +/****************************************************************************** + * Sets the bit in the multicast table corresponding to the hash value. + * + * shared - Struct containing variables accessed by shared code + * hash_value - Multicast address hash value + *****************************************************************************/ +void +e1000_mta_set(struct e1000_shared_adapter *shared, + uint32_t hash_value) +{ + uint32_t hash_bit, hash_reg; + uint32_t mta_reg; + uint32_t temp; + + /* The MTA is a register array of 128 32-bit registers. + * It is treated like an array of 4096 bits. We want to set + * bit BitArray[hash_value]. So we figure out what register + * the bit is in, read it, OR in the new bit, then write + * back the new value. The register is determined by the + * upper 7 bits of the hash value and the bit within that + * register are determined by the lower 5 bits of the value. + */ + hash_reg = (hash_value >> 5) & 0x7F; + hash_bit = hash_value & 0x1F; + + mta_reg = E1000_READ_REG_ARRAY(shared, MTA, hash_reg); + + mta_reg |= (1 << hash_bit); + + /* If we are on an 82544 and we are trying to write an odd offset + * in the MTA, save off the previous entry before writing and + * restore the old value after writing. + */ + if((shared->mac_type == e1000_82544) && ((hash_reg & 0x1) == 1)) { + temp = E1000_READ_REG_ARRAY(shared, MTA, (hash_reg - 1)); + E1000_WRITE_REG_ARRAY(shared, MTA, hash_reg, mta_reg); + E1000_WRITE_REG_ARRAY(shared, MTA, (hash_reg - 1), temp); + } else { + E1000_WRITE_REG_ARRAY(shared, MTA, hash_reg, mta_reg); + } + return; +} + +/****************************************************************************** + * Puts an ethernet address into a receive address register. + * + * shared - Struct containing variables accessed by shared code + * addr - Address to put into receive address register + * index - Receive address register to write + *****************************************************************************/ +void +e1000_rar_set(struct e1000_shared_adapter *shared, + uint8_t *addr, + uint32_t index) +{ + uint32_t rar_low, rar_high; + + /* HW expects these in little endian so we reverse the byte order + * from network order (big endian) to little endian + */ + rar_low = ((uint32_t) addr[0] | + ((uint32_t) addr[1] << 8) | + ((uint32_t) addr[2] << 16) | ((uint32_t) addr[3] << 24)); + + rar_high = ((uint32_t) addr[4] | ((uint32_t) addr[5] << 8) | E1000_RAH_AV); + + E1000_WRITE_REG_ARRAY(shared, RA, (index << 1), rar_low); + E1000_WRITE_REG_ARRAY(shared, RA, ((index << 1) + 1), rar_high); + return; +} + +/****************************************************************************** + * Writes a value to the specified offset in the VLAN filter table. + * + * shared - Struct containing variables accessed by shared code + * offset - Offset in VLAN filer table to write + * value - Value to write into VLAN filter table + *****************************************************************************/ +void +e1000_write_vfta(struct e1000_shared_adapter *shared, + uint32_t offset, + uint32_t value) +{ + uint32_t temp; + + if((shared->mac_type == e1000_82544) && ((offset & 0x1) == 1)) { + temp = E1000_READ_REG_ARRAY(shared, VFTA, (offset - 1)); + E1000_WRITE_REG_ARRAY(shared, VFTA, offset, value); + E1000_WRITE_REG_ARRAY(shared, VFTA, (offset - 1), temp); + } else { + E1000_WRITE_REG_ARRAY(shared, VFTA, offset, value); + } + return; +} + +/****************************************************************************** + * Clears the VLAN filer table + * + * shared - Struct containing variables accessed by shared code + *****************************************************************************/ +void +e1000_clear_vfta(struct e1000_shared_adapter *shared) +{ + uint32_t offset; + + for(offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) + E1000_WRITE_REG_ARRAY(shared, VFTA, offset, 0); + return; +} + +/****************************************************************************** + * Configures flow control and link settings. + * + * shared - Struct containing variables accessed by shared code + * + * Determines which flow control settings to use. Calls the apropriate media- + * specific link configuration function. Configures the flow control settings. + * Assuming the adapter has a valid link partner, a valid link should be + * established. Assumes the hardware has previously been reset and the + * transmitter and receiver are not enabled. + *****************************************************************************/ +boolean_t +e1000_setup_fc_and_link(struct e1000_shared_adapter *shared) +{ + uint32_t ctrl_reg; + uint32_t eecd_reg; + uint32_t ctrl_ext_reg; + boolean_t status = TRUE; + + DEBUGFUNC("e1000_setup_fc_and_link"); + + /* Read the SWDPIO bits and the ILOS bit out of word 0x0A in the + * EEPROM. Store these bits in a variable that we will later write + * to the Device Control Register (CTRL). + */ + eecd_reg = e1000_read_eeprom(shared, EEPROM_INIT_CONTROL1_REG); + + ctrl_reg = + (((eecd_reg & EEPROM_WORD0A_SWDPIO) << SWDPIO_SHIFT) | + ((eecd_reg & EEPROM_WORD0A_ILOS) << ILOS_SHIFT)); + + /* Set the PCI priority bit correctly in the CTRL register. This + * determines if the adapter gives priority to receives, or if it + * gives equal priority to transmits and receives. + */ + if(shared->dma_fairness) + ctrl_reg |= E1000_CTRL_PRIOR; + + /* Read and store word 0x0F of the EEPROM. This word contains bits + * that determine the hardware's default PAUSE (flow control) mode, + * a bit that determines whether the HW defaults to enabling or + * disabling auto-negotiation, and the direction of the + * SW defined pins. If there is no SW over-ride of the flow + * control setting, then the variable shared->fc will + * be initialized based on a value in the EEPROM. + */ + eecd_reg = e1000_read_eeprom(shared, EEPROM_INIT_CONTROL2_REG); + + if(shared->fc > e1000_fc_full) { + if((eecd_reg & EEPROM_WORD0F_PAUSE_MASK) == 0) + shared->fc = e1000_fc_none; + else if((eecd_reg & EEPROM_WORD0F_PAUSE_MASK) == EEPROM_WORD0F_ASM_DIR) + shared->fc = e1000_fc_tx_pause; + else + shared->fc = e1000_fc_full; + } + + /* We want to save off the original Flow Control configuration just + * in case we get disconnected and then reconnected into a different + * hub or switch with different Flow Control capabilities. + */ + shared->original_fc = shared->fc; + + if(shared->mac_type == e1000_82542_rev2_0) + shared->fc &= (~e1000_fc_tx_pause); + + if((shared->mac_type < e1000_82543) && (shared->report_tx_early == 1)) + shared->fc &= (~e1000_fc_rx_pause); + + DEBUGOUT1("After fix-ups FlowControl is now = %x\n", shared->fc); + + /* Take the 4 bits from EEPROM word 0x0F that determine the initial + * polarity value for the SW controlled pins, and setup the + * Extended Device Control reg with that info. + * This is needed because one of the SW controlled pins is used for + * signal detection. So this should be done before e1000_setup_pcs_link() + * or e1000_phy_setup() is called. + */ + if(shared->mac_type == e1000_82543) { + ctrl_ext_reg = ((eecd_reg & EEPROM_WORD0F_SWPDIO_EXT) + << SWDPIO__EXT_SHIFT); + E1000_WRITE_REG(shared, CTRL_EXT, ctrl_ext_reg); + } + + /* Call the necessary subroutine to configure the link. */ + if(shared->media_type == e1000_media_type_fiber) + status = e1000_setup_pcs_link(shared, ctrl_reg); + else + status = e1000_phy_setup(shared, ctrl_reg); + + /* Initialize the flow control address, type, and PAUSE timer + * registers to their default values. This is done even if flow + * control is disabled, because it does not hurt anything to + * initialize these registers. + */ + DEBUGOUT("Initializing the Flow Control address, type and timer regs\n"); + + E1000_WRITE_REG(shared, FCAL, FLOW_CONTROL_ADDRESS_LOW); + E1000_WRITE_REG(shared, FCAH, FLOW_CONTROL_ADDRESS_HIGH); + E1000_WRITE_REG(shared, FCT, FLOW_CONTROL_TYPE); + E1000_WRITE_REG(shared, FCTTV, shared->fc_pause_time); + + /* Set the flow control receive threshold registers. Normally, + * these registers will be set to a default threshold that may be + * adjusted later by the driver's runtime code. However, if the + * ability to transmit pause frames in not enabled, then these + * registers will be set to 0. + */ + if(!(shared->fc & e1000_fc_tx_pause)) { + E1000_WRITE_REG(shared, FCRTL, 0); + E1000_WRITE_REG(shared, FCRTH, 0); + } else { + /* We need to set up the Receive Threshold high and low water marks + * as well as (optionally) enabling the transmission of XON frames. + */ + if(shared->fc_send_xon) { + E1000_WRITE_REG(shared, FCRTL, + (shared->fc_low_water | E1000_FCRTL_XONE)); + E1000_WRITE_REG(shared, FCRTH, shared->fc_high_water); + } else { + E1000_WRITE_REG(shared, FCRTL, shared->fc_low_water); + E1000_WRITE_REG(shared, FCRTH, shared->fc_high_water); + } + } + return (status); +} + +/****************************************************************************** + * Sets up link for a fiber based adapter + * + * shared - Struct containing variables accessed by shared code + * ctrl_reg - Current value of the device control register + * + * Manipulates Physical Coding Sublayer functions in order to configure + * link. Assumes the hardware has been previously reset and the transmitter + * and receiver are not enabled. + *****************************************************************************/ +boolean_t +e1000_setup_pcs_link(struct e1000_shared_adapter *shared, + uint32_t ctrl_reg) +{ + uint32_t status_reg; + uint32_t tctl_reg; + uint32_t txcw_reg = 0; + uint32_t i; + + DEBUGFUNC("e1000_setup_pcs_link"); + + /* Setup the collsion distance. Since this is configuring the + * TBI it is assumed that we are in Full Duplex. + */ + tctl_reg = E1000_READ_REG(shared, TCTL); + i = E1000_FDX_COLLISION_DISTANCE; + i <<= E1000_COLD_SHIFT; + tctl_reg |= i; + E1000_WRITE_REG(shared, TCTL, tctl_reg); + + /* Check for a software override of the flow control settings, and + * setup the device accordingly. If auto-negotiation is enabled, + * then software will have to set the "PAUSE" bits to the correct + * value in the Tranmsit Config Word Register (TXCW) and re-start + * auto-negotiation. However, if auto-negotiation is disabled, + * then software will have to manually configure the two flow + * control enable bits in the CTRL register. + * + * The possible values of the "fc" parameter are: + * 0: Flow control is completely disabled + * 1: Rx flow control is enabled (we can receive pause frames + * but not send pause frames). + * 2: Tx flow control is enabled (we can send pause frames + * but we do not support receiving pause frames). + * 3: Both Rx and TX flow control (symmetric) are enabled. + * other: No software override. The flow control configuration + * in the EEPROM is used. + */ + switch (shared->fc) { + case e1000_fc_none: /* 0 */ + /* Flow control (RX & TX) is completely disabled by a + * software over-ride. + */ + txcw_reg = (E1000_TXCW_ANE | E1000_TXCW_FD); + break; + case e1000_fc_rx_pause: /* 1 */ + /* RX Flow control is enabled, and TX Flow control is + * disabled, by a software over-ride. + */ + /* Since there really isn't a way to advertise that we are + * capable of RX Pause ONLY, we will advertise that we + * support both symmetric and asymmetric RX PAUSE. Later + * we will disable the adapter's ability to send PAUSE + * frames. + */ + txcw_reg = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); + break; + case e1000_fc_tx_pause: /* 2 */ + /* TX Flow control is enabled, and RX Flow control is + * disabled, by a software over-ride. + */ + txcw_reg = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_ASM_DIR); + break; + case e1000_fc_full: /* 3 */ + /* Flow control (both RX and TX) is enabled by a software + * over-ride. + */ + txcw_reg = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); + break; + default: + /* We should never get here. The value should be 0-3. */ + DEBUGOUT("Flow control param set incorrectly\n"); + ASSERT(0); + break; + } + + /* Since auto-negotiation is enabled, take the link out of reset. + * (the link will be in reset, because we previously reset the + * chip). This will restart auto-negotiation. If auto-neogtiation + * is successful then the link-up status bit will be set and the + * flow control enable bits (RFCE and TFCE) will be set according + * to their negotiated value. + */ + DEBUGOUT("Auto-negotiation enabled\n"); + + E1000_WRITE_REG(shared, TXCW, txcw_reg); + E1000_WRITE_REG(shared, CTRL, ctrl_reg); + + shared->txcw_reg = txcw_reg; + msec_delay(1); + + /* If we have a signal then poll for a "Link-Up" indication in the + * Device Status Register. Time-out if a link isn't seen in 500 + * milliseconds seconds (Auto-negotiation should complete in less + * than 500 milliseconds even if the other end is doing it in SW). + */ + if(!(E1000_READ_REG(shared, CTRL) & E1000_CTRL_SWDPIN1)) { + + DEBUGOUT("Looking for Link\n"); + for(i = 0; i < (LINK_UP_TIMEOUT / 10); i++) { + msec_delay(10); + status_reg = E1000_READ_REG(shared, STATUS); + if(status_reg & E1000_STATUS_LU) + break; + } + + if(i == (LINK_UP_TIMEOUT / 10)) { + /* AutoNeg failed to achieve a link, so we'll call the + * "CheckForLink" routine. This routine will force the link + * up if we have "signal-detect". This will allow us to + * communicate with non-autonegotiating link partners. + */ + DEBUGOUT("Never got a valid link from auto-neg!!!\n"); + + shared->autoneg_failed = 1; + e1000_check_for_link(shared); + shared->autoneg_failed = 0; + } else { + shared->autoneg_failed = 0; + DEBUGOUT("Valid Link Found\n"); + } + } else { + DEBUGOUT("No Signal Detected\n"); + } + + return (TRUE); +} + +/****************************************************************************** + * Configures flow control settings after link is established + * + * shared - Struct containing variables accessed by shared code + * + * Should be called immediately after a valid link has been established. + * Forces MAC flow control settings if link was forced. When in MII/GMII mode + * and autonegotiation is enabled, the MAC flow control settings will be set + * based on the flow control negotiated by the PHY. In TBI mode, the TFCE + * and RFCE bits will be automaticaly set to the negotiated flow control mode. + *****************************************************************************/ +void +e1000_config_fc_after_link_up(struct e1000_shared_adapter *shared) +{ + uint16_t mii_status_reg; + uint16_t mii_nway_adv_reg; + uint16_t mii_nway_lp_ability_reg; + uint16_t speed; + uint16_t duplex; + + DEBUGFUNC("e1000_config_fc_after_link_up"); + + /* Check for the case where we have fiber media and auto-neg failed + * so we had to force link. In this case, we need to force the + * configuration of the MAC to match the "fc" parameter. + */ + if(((shared->media_type == e1000_media_type_fiber) + && (shared->autoneg_failed)) + || ((shared->media_type == e1000_media_type_copper) + && (!shared->autoneg))) { + e1000_force_mac_fc(shared); + } + + /* Check for the case where we have copper media and auto-neg is + * enabled. In this case, we need to check and see if Auto-Neg + * has completed, and if so, how the PHY and link partner has + * flow control configured. + */ + if((shared->media_type == e1000_media_type_copper) && shared->autoneg) { + /* Read the MII Status Register and check to see if AutoNeg + * has completed. We read this twice because this reg has + * some "sticky" (latched) bits. + */ + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + + if(mii_status_reg & MII_SR_AUTONEG_COMPLETE) { + /* The AutoNeg process has completed, so we now need to + * read both the Auto Negotiation Advertisement Register + * (Address 4) and the Auto_Negotiation Base Page Ability + * Register (Address 5) to determine how flow control was + * negotiated. + */ + mii_nway_adv_reg = e1000_read_phy_reg(shared, + PHY_AUTONEG_ADV); + mii_nway_lp_ability_reg = e1000_read_phy_reg(shared, + PHY_LP_ABILITY); + + /* Two bits in the Auto Negotiation Advertisement Register + * (Address 4) and two bits in the Auto Negotiation Base + * Page Ability Register (Address 5) determine flow control + * for both the PHY and the link partner. The following + * table, taken out of the IEEE 802.3ab/D6.0 dated March 25, + * 1999, describes these PAUSE resolution bits and how flow + * control is determined based upon these settings. + * NOTE: DC = Don't Care + * + * LOCAL DEVICE | LINK PARTNER + * PAUSE | ASM_DIR | PAUSE | ASM_DIR | NIC Resolution + *-------|---------|-------|---------|-------------------- + * 0 | 0 | DC | DC | e1000_fc_none + * 0 | 1 | 0 | DC | e1000_fc_none + * 0 | 1 | 1 | 0 | e1000_fc_none + * 0 | 1 | 1 | 1 | e1000_fc_tx_pause + * 1 | 0 | 0 | DC | e1000_fc_none + * 1 | DC | 1 | DC | e1000_fc_full + * 1 | 1 | 0 | 0 | e1000_fc_none + * 1 | 1 | 0 | 1 | e1000_fc_rx_pause + * + */ + /* Are both PAUSE bits set to 1? If so, this implies + * Symmetric Flow Control is enabled at both ends. The + * ASM_DIR bits are irrelevant per the spec. + * + * For Symmetric Flow Control: + * + * LOCAL DEVICE | LINK PARTNER + * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result + *-------|---------|-------|---------|-------------------- + * 1 | DC | 1 | DC | e1000_fc_full + * + */ + if((mii_nway_adv_reg & NWAY_AR_PAUSE) && + (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE)) { + /* Now we need to check if the user selected RX ONLY + * of pause frames. In this case, we had to advertise + * FULL flow control because we could not advertise RX + * ONLY. Hence, we must now check to see if we need to + * turn OFF the TRANSMISSION of PAUSE frames. + */ + if(shared->original_fc == e1000_fc_full) { + shared->fc = e1000_fc_full; + DEBUGOUT("Flow Control = FULL.\r\n"); + } else { + shared->fc = e1000_fc_rx_pause; + DEBUGOUT("Flow Control = RX PAUSE frames only.\r\n"); + } + } + /* For receiving PAUSE frames ONLY. + * + * LOCAL DEVICE | LINK PARTNER + * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result + *-------|---------|-------|---------|-------------------- + * 0 | 1 | 1 | 1 | e1000_fc_tx_pause + * + */ + else if(!(mii_nway_adv_reg & NWAY_AR_PAUSE) && + (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && + (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && + (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { + shared->fc = e1000_fc_tx_pause; + DEBUGOUT("Flow Control = TX PAUSE frames only.\r\n"); + } + /* For transmitting PAUSE frames ONLY. + * + * LOCAL DEVICE | LINK PARTNER + * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result + *-------|---------|-------|---------|-------------------- + * 1 | 1 | 0 | 1 | e1000_fc_rx_pause + * + */ + else if((mii_nway_adv_reg & NWAY_AR_PAUSE) && + (mii_nway_adv_reg & NWAY_AR_ASM_DIR) && + !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && + (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { + shared->fc = e1000_fc_rx_pause; + DEBUGOUT("Flow Control = RX PAUSE frames only.\r\n"); + } + /* Per the IEEE spec, at this point flow control should be + * disabled. However, we want to consider that we could + * be connected to a legacy switch that doesn't advertise + * desired flow control, but can be forced on the link + * partner. So if we advertised no flow control, that is + * what we will resolve to. If we advertised some kind of + * receive capability (Rx Pause Only or Full Flow Control) + * and the link partner advertised none, we will configure + * ourselves to enable Rx Flow Control only. We can do + * this safely for two reasons: If the link partner really + * didn't want flow control enabled, and we enable Rx, no + * harm done since we won't be receiving any PAUSE frames + * anyway. If the intent on the link partner was to have + * flow control enabled, then by us enabling RX only, we + * can at least receive pause frames and process them. + * This is a good idea because in most cases, since we are + * predominantly a server NIC, more times than not we will + * be asked to delay transmission of packets than asking + * our link partner to pause transmission of frames. + */ + else if(shared->original_fc == e1000_fc_none || + shared->original_fc == e1000_fc_tx_pause) { + shared->fc = e1000_fc_none; + DEBUGOUT("Flow Control = NONE.\r\n"); + } else { + shared->fc = e1000_fc_rx_pause; + DEBUGOUT("Flow Control = RX PAUSE frames only.\r\n"); + } + + /* Now we need to do one last check... If we auto- + * negotiated to HALF DUPLEX, flow control should not be + * enabled per IEEE 802.3 spec. + */ + e1000_get_speed_and_duplex(shared, &speed, &duplex); + + if(duplex == HALF_DUPLEX) + shared->fc = e1000_fc_none; + + /* Now we call a subroutine to actually force the MAC + * controller to use the correct flow control settings. + */ + e1000_force_mac_fc(shared); + } else { + DEBUGOUT("Copper PHY and Auto Neg has not completed.\r\n"); + } + } + return; +} + +/****************************************************************************** + * Checks to see if the link status of the hardware has changed. + * + * shared - Struct containing variables accessed by shared code + * + * Called by any function that needs to check the link status of the adapter. + *****************************************************************************/ +void +e1000_check_for_link(struct e1000_shared_adapter *shared) +{ + uint32_t rxcw_reg; + uint32_t ctrl_reg; + uint32_t status_reg; + uint32_t rctl_reg; + uint16_t phy_data; + uint16_t lp_capability; + + DEBUGFUNC("e1000_check_for_link"); + + ctrl_reg = E1000_READ_REG(shared, CTRL); + status_reg = E1000_READ_REG(shared, STATUS); + rxcw_reg = E1000_READ_REG(shared, RXCW); + + /* If we have a copper PHY then we only want to go out to the PHY + * registers to see if Auto-Neg has completed and/or if our link + * status has changed. The get_link_status flag will be set if we + * receive a Link Status Change interrupt or we have Rx Sequence + * Errors. + */ + if(shared->media_type == e1000_media_type_copper + && shared->get_link_status) { + /* First we want to see if the MII Status Register reports + * link. If so, then we want to get the current speed/duplex + * of the PHY. + * Read the register twice since the link bit is sticky. + */ + phy_data = e1000_read_phy_reg(shared, PHY_STATUS); + phy_data = e1000_read_phy_reg(shared, PHY_STATUS); + + if(phy_data & MII_SR_LINK_STATUS) { + shared->get_link_status = FALSE; + } else { + DEBUGOUT("**** CFL - No link detected. ****\r\n"); + return; + } + + /* If we are forcing speed/duplex, then we simply return since + * we have already determined whether we have link or not. + */ + if(!shared->autoneg) { + return; + } + + switch (shared->phy_id) { + case M88E1000_12_PHY_ID: + case M88E1000_14_PHY_ID: + case M88E1000_I_PHY_ID: + case M88E1011_I_PHY_ID: + /* We have a M88E1000 PHY and Auto-Neg is enabled. If we + * have Si on board that is 82544 or newer, Auto + * Speed Detection takes care of MAC speed/duplex + * configuration. So we only need to configure Collision + * Distance in the MAC. Otherwise, we need to force + * speed/duplex on the MAC to the current PHY speed/duplex + * settings. + */ + if(shared->mac_type >= e1000_82544) { + DEBUGOUT("CFL - Auto-Neg complete."); + DEBUGOUT("Configuring Collision Distance."); + e1000_config_collision_dist(shared); + } else { + /* Read the Phy Specific Status register to get the + * resolved speed/duplex settings. Then call + * e1000_config_mac_to_phy which will retrieve + * PHY register information and configure the MAC to + * equal the negotiated speed/duplex. + */ + phy_data = e1000_read_phy_reg(shared, + M88E1000_PHY_SPEC_STATUS); + + DEBUGOUT1("CFL - Auto-Neg complete. phy_data = %x\r\n", + phy_data); + e1000_config_mac_to_phy(shared, phy_data); + } + + /* Configure Flow Control now that Auto-Neg has completed. + * We need to first restore the users desired Flow + * Control setting since we may have had to re-autoneg + * with a different link partner. + */ + e1000_config_fc_after_link_up(shared); + break; + + default: + DEBUGOUT("CFL - Invalid PHY detected.\r\n"); + + } /* end switch statement */ + + /* At this point we know that we are on copper, link is up, + * and we are auto-neg'd. These are pre-conditions for checking + * the link parter capabilities register. We use the link partner + * capabilities to determine if TBI Compatibility needs to be turned on + * or turned off. If the link partner advertises any speed in addition + * to Gigabit, then we assume that they are GMII-based and TBI + * compatibility is not needed. + * If no other speeds are advertised, then we assume the link partner + * is TBI-based and we turn on TBI Compatibility. + */ + if(shared->tbi_compatibility_en) { + lp_capability = e1000_read_phy_reg(shared, PHY_LP_ABILITY); + if(lp_capability & (NWAY_LPAR_10T_HD_CAPS | + NWAY_LPAR_10T_FD_CAPS | + NWAY_LPAR_100TX_HD_CAPS | + NWAY_LPAR_100TX_FD_CAPS | + NWAY_LPAR_100T4_CAPS)) { + /* If our link partner advertises below Gig, then they do not + * need the special Tbi Compatibility mode. + */ + if(shared->tbi_compatibility_on) { + /* If we previously were in the mode, turn it off, now. */ + rctl_reg = E1000_READ_REG(shared, RCTL); + rctl_reg &= ~E1000_RCTL_SBP; + E1000_WRITE_REG(shared, RCTL, rctl_reg); + shared->tbi_compatibility_on = FALSE; + } + } else { + /* If the mode is was previously off, turn it on. + * For compatibility with a suspected Tbi link partners, + * we will store bad packets. + * (Certain frames have an additional byte on the end and will + * look like CRC errors to to the hardware). + */ + if(!shared->tbi_compatibility_on) { + shared->tbi_compatibility_on = TRUE; + rctl_reg = E1000_READ_REG(shared, RCTL); + rctl_reg |= E1000_RCTL_SBP; + E1000_WRITE_REG(shared, RCTL, rctl_reg); + } + } + } + } /* end if e1000_media_type_copper statement */ + /* If we don't have link (auto-negotiation failed or link partner + * cannot auto-negotiate) and the cable is plugged in since we don't + * have Loss-Of-Signal (we HAVE a signal) and our link partner is + * not trying to AutoNeg with us (we are receiving idles/data + * then we need to force our link to connect to a non + * auto-negotiating link partner. We also need to give + * auto-negotiation time to complete in case the cable was just + * plugged in. The autoneg_failed flag does this. + */ + else if((shared->media_type == e1000_media_type_fiber) && /* Fiber PHY */ + (!(status_reg & E1000_STATUS_LU)) && /* no link and */ + (!(ctrl_reg & E1000_CTRL_SWDPIN1)) && /* we have signal */ + (!(rxcw_reg & E1000_RXCW_C))) { /* and rxing idle/data */ + if(shared->autoneg_failed == 0) { /* given AutoNeg time */ + shared->autoneg_failed = 1; + return; + } + + DEBUGOUT("NOT RXing /C/, disable AutoNeg and force link.\r\n"); + + /* Disable auto-negotiation in the TXCW register */ + E1000_WRITE_REG(shared, TXCW, (shared->txcw_reg & ~E1000_TXCW_ANE)); + + /* Force link-up and also force full-duplex. */ + ctrl_reg = E1000_READ_REG(shared, CTRL); + ctrl_reg |= (E1000_CTRL_SLU | E1000_CTRL_FD); + E1000_WRITE_REG(shared, CTRL, ctrl_reg); + + /* Configure Flow Control after forcing link up. */ + e1000_config_fc_after_link_up(shared); + + } else if((shared->media_type == e1000_media_type_fiber) && /* Fiber */ + (ctrl_reg & E1000_CTRL_SLU) && /* we have forced link */ + (rxcw_reg & E1000_RXCW_C)) { /* and Rxing /C/ ordered sets */ + /* If we are forcing link and we are receiving /C/ ordered sets, + * then re-enable auto-negotiation in the RXCW register and + * disable forced link in the Device Control register in an attempt + * to AutoNeg with our link partner. + */ + DEBUGOUT("RXing /C/, enable AutoNeg and stop forcing link.\r\n"); + + /* Enable auto-negotiation in the TXCW register and stop + * forcing link. + */ + E1000_WRITE_REG(shared, TXCW, shared->txcw_reg); + + E1000_WRITE_REG(shared, CTRL, (ctrl_reg & ~E1000_CTRL_SLU)); + } + + return; +} + +/****************************************************************************** + * Clears all hardware statistics counters. + * + * shared - Struct containing variables accessed by shared code + *****************************************************************************/ +void +e1000_clear_hw_cntrs(struct e1000_shared_adapter *shared) +{ + volatile uint32_t temp_reg; + + DEBUGFUNC("e1000_clear_hw_cntrs"); + + /* if we are stopped or resetting exit gracefully */ + if(shared->adapter_stopped) { + DEBUGOUT("Exiting because the adapter is stopped!!!\n"); + return; + } + + temp_reg = E1000_READ_REG(shared, CRCERRS); + temp_reg = E1000_READ_REG(shared, SYMERRS); + temp_reg = E1000_READ_REG(shared, MPC); + temp_reg = E1000_READ_REG(shared, SCC); + temp_reg = E1000_READ_REG(shared, ECOL); + temp_reg = E1000_READ_REG(shared, MCC); + temp_reg = E1000_READ_REG(shared, LATECOL); + temp_reg = E1000_READ_REG(shared, COLC); + temp_reg = E1000_READ_REG(shared, DC); + temp_reg = E1000_READ_REG(shared, SEC); + temp_reg = E1000_READ_REG(shared, RLEC); + temp_reg = E1000_READ_REG(shared, XONRXC); + temp_reg = E1000_READ_REG(shared, XONTXC); + temp_reg = E1000_READ_REG(shared, XOFFRXC); + temp_reg = E1000_READ_REG(shared, XOFFTXC); + temp_reg = E1000_READ_REG(shared, FCRUC); + temp_reg = E1000_READ_REG(shared, PRC64); + temp_reg = E1000_READ_REG(shared, PRC127); + temp_reg = E1000_READ_REG(shared, PRC255); + temp_reg = E1000_READ_REG(shared, PRC511); + temp_reg = E1000_READ_REG(shared, PRC1023); + temp_reg = E1000_READ_REG(shared, PRC1522); + temp_reg = E1000_READ_REG(shared, GPRC); + temp_reg = E1000_READ_REG(shared, BPRC); + temp_reg = E1000_READ_REG(shared, MPRC); + temp_reg = E1000_READ_REG(shared, GPTC); + temp_reg = E1000_READ_REG(shared, GORCL); + temp_reg = E1000_READ_REG(shared, GORCH); + temp_reg = E1000_READ_REG(shared, GOTCL); + temp_reg = E1000_READ_REG(shared, GOTCH); + temp_reg = E1000_READ_REG(shared, RNBC); + temp_reg = E1000_READ_REG(shared, RUC); + temp_reg = E1000_READ_REG(shared, RFC); + temp_reg = E1000_READ_REG(shared, ROC); + temp_reg = E1000_READ_REG(shared, RJC); + temp_reg = E1000_READ_REG(shared, TORL); + temp_reg = E1000_READ_REG(shared, TORH); + temp_reg = E1000_READ_REG(shared, TOTL); + temp_reg = E1000_READ_REG(shared, TOTH); + temp_reg = E1000_READ_REG(shared, TPR); + temp_reg = E1000_READ_REG(shared, TPT); + temp_reg = E1000_READ_REG(shared, PTC64); + temp_reg = E1000_READ_REG(shared, PTC127); + temp_reg = E1000_READ_REG(shared, PTC255); + temp_reg = E1000_READ_REG(shared, PTC511); + temp_reg = E1000_READ_REG(shared, PTC1023); + temp_reg = E1000_READ_REG(shared, PTC1522); + temp_reg = E1000_READ_REG(shared, MPTC); + temp_reg = E1000_READ_REG(shared, BPTC); + + if(shared->mac_type < e1000_82543) + return; + + temp_reg = E1000_READ_REG(shared, ALGNERRC); + temp_reg = E1000_READ_REG(shared, RXERRC); + temp_reg = E1000_READ_REG(shared, TNCRS); + temp_reg = E1000_READ_REG(shared, CEXTERR); + temp_reg = E1000_READ_REG(shared, TSCTC); + temp_reg = E1000_READ_REG(shared, TSCTFC); + return; +} + +/****************************************************************************** + * Detects the current speed and duplex settings of the hardware. + * + * shared - Struct containing variables accessed by shared code + * speed - Speed of the connection + * duplex - Duplex setting of the connection + *****************************************************************************/ +void +e1000_get_speed_and_duplex(struct e1000_shared_adapter *shared, + uint16_t *speed, + uint16_t *duplex) +{ + uint32_t status_reg; +#if DBG + uint16_t phy_data; +#endif + + DEBUGFUNC("e1000_get_speed_and_duplex"); + + /* If the adapter is stopped we don't have a speed or duplex */ + if(shared->adapter_stopped) { + *speed = 0; + *duplex = 0; + return; + } + + if(shared->mac_type >= e1000_82543) { + status_reg = E1000_READ_REG(shared, STATUS); + if(status_reg & E1000_STATUS_SPEED_1000) { + *speed = SPEED_1000; + DEBUGOUT("1000 Mbs, "); + } else if(status_reg & E1000_STATUS_SPEED_100) { + *speed = SPEED_100; + DEBUGOUT("100 Mbs, "); + } else { + *speed = SPEED_10; + DEBUGOUT("10 Mbs, "); + } + + if(status_reg & E1000_STATUS_FD) { + *duplex = FULL_DUPLEX; + DEBUGOUT("Full Duplex\r\n"); + } else { + *duplex = HALF_DUPLEX; + DEBUGOUT(" Half Duplex\r\n"); + } + } else { + DEBUGOUT("1000 Mbs, Full Duplex\r\n"); + *speed = SPEED_1000; + *duplex = FULL_DUPLEX; + } + +#if DBG + if(shared->phy_id == M88E1000_12_PHY_ID || + shared->phy_id == M88E1000_14_PHY_ID || + shared->phy_id == M88E1000_I_PHY_ID || + shared->phy_id == M88E1011_I_PHY_ID) { + /* read the phy specific status register */ + phy_data = e1000_read_phy_reg(shared, M88E1000_PHY_SPEC_STATUS); + DEBUGOUT1("M88E1000 Phy Specific Status Reg contents = %x\n", phy_data); + phy_data = e1000_read_phy_reg(shared, PHY_STATUS); + DEBUGOUT1("Phy MII Status Reg contents = %x\n", phy_data); + DEBUGOUT1("Device Status Reg contents = %x\n", + E1000_READ_REG(shared, STATUS)); + } +#endif + return; +} + +/****************************************************************************** + * Reads a 16 bit word from the EEPROM. + * + * shared - Struct containing variables accessed by shared code + * offset - offset of 16 bit word in the EEPROM to read + *****************************************************************************/ +uint16_t +e1000_read_eeprom(struct e1000_shared_adapter *shared, + uint16_t offset) +{ + boolean_t large_eeprom = FALSE; + uint16_t data; + uint32_t eecd_reg; + uint32_t tmp = 0; + + if((shared->mac_type > e1000_82544) && + (E1000_READ_REG(shared, EECD) & E1000_EECD_SIZE)) large_eeprom = TRUE; + + /* Request EEPROM Access */ + if(shared->mac_type > e1000_82544) { + E1000_WRITE_REG(shared, EECD, (uint32_t) E1000_EECD_REQ); + eecd_reg = E1000_READ_REG(shared, EECD); + while((!(eecd_reg & E1000_EECD_GNT)) && (tmp < 100)) { + tmp++; + usec_delay(5); + eecd_reg = E1000_READ_REG(shared, EECD); + } + if(!(eecd_reg & E1000_EECD_GNT)) return(FALSE); + } + + /* Prepare the EEPROM for reading */ + e1000_setup_eeprom(shared); + + /* Send the READ command (opcode + addr) */ + e1000_shift_out_bits(shared, EEPROM_READ_OPCODE, 3); + /* If we have a 256 word EEPROM, there are 8 address bits + * if we have a 64 word EEPROM, there are 6 address bits + */ + if(large_eeprom) + e1000_shift_out_bits(shared, offset, 8); + else + e1000_shift_out_bits(shared, offset, 6); + + /* Read the data */ + data = e1000_shift_in_bits(shared); + + /* End this read operation */ + e1000_standby_eeprom(shared); + + /* Stop requestiong EEPROM access */ + if(shared->mac_type > e1000_82544) + E1000_WRITE_REG(shared, EECD, (uint32_t) 0); + + return (data); +} + +/****************************************************************************** + * Verifies that the EEPROM has a valid checksum + * + * shared - Struct containing variables accessed by shared code + * + * Reads the first 64 16 bit words of the EEPROM and sums the values read. + * If the the sum of the 64 16 bit words is 0xBABA, the EEPROM's checksum is + * valid. + *****************************************************************************/ +boolean_t +e1000_validate_eeprom_checksum(struct e1000_shared_adapter *shared) +{ + uint16_t checksum = 0; + uint16_t i; + + for(i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++) + checksum += e1000_read_eeprom(shared, i); + + if(checksum == (uint16_t) EEPROM_SUM) + return (TRUE); + else + return (FALSE); +} + +/****************************************************************************** + * Calculates the EEPROM checksum and writes it to the EEPROM + * + * shared - Struct containing variables accessed by shared code + * + * Sums the first 63 16 bit words of the EEPROM. Subtracts the sum from 0xBABA. + * Writes the difference to word offset 63 of the EEPROM. + *****************************************************************************/ +void +e1000_update_eeprom_checksum(struct e1000_shared_adapter *shared) +{ + uint16_t checksum = 0; + uint16_t i; + + for(i = 0; i < EEPROM_CHECKSUM_REG; i++) + checksum += e1000_read_eeprom(shared, i); + + checksum = (uint16_t) EEPROM_SUM - checksum; + + e1000_write_eeprom(shared, EEPROM_CHECKSUM_REG, checksum); + return; +} + +/****************************************************************************** + * Writes a 16 bit word to a given offset in the EEPROM. + * + * shared - Struct containing variables accessed by shared code + * offset - offset within the EEPROM to be written to + * data - 16 bit word to be writen to the EEPROM + * + * If e1000_update_eeprom_checksum is not called after this function, the + * EEPROM will most likely contain an invalid checksum. + *****************************************************************************/ +boolean_t +e1000_write_eeprom(struct e1000_shared_adapter *shared, + uint16_t offset, + uint16_t data) +{ + boolean_t large_eeprom = FALSE; + uint32_t eecd_reg; + uint32_t tmp = 0; + + if((shared->mac_type > e1000_82544) && + (E1000_READ_REG(shared, EECD) & E1000_EECD_SIZE)) large_eeprom = TRUE; + + /* Request EEPROM Access */ + if(shared->mac_type > e1000_82544) { + E1000_WRITE_REG(shared, EECD, (uint32_t) E1000_EECD_REQ); + eecd_reg = E1000_READ_REG(shared, EECD); + while((!(eecd_reg & E1000_EECD_GNT)) && (tmp < 100)) { + tmp++; + usec_delay(5); + eecd_reg = E1000_READ_REG(shared, EECD); + } + if(!(eecd_reg & E1000_EECD_GNT)) return(FALSE); + } + + /* Prepare the EEPROM for writing */ + e1000_setup_eeprom(shared); + + /* Send the 9-bit (or 11-bit on large EEPROM) EWEN (write enable) + * command to the EEPROM (5-bit opcode plus 4/6-bit dummy). + * This puts the EEPROM into write/erase mode. + */ + e1000_shift_out_bits(shared, EEPROM_EWEN_OPCODE, 5); + if(large_eeprom) + e1000_shift_out_bits(shared, 0, 6); + else + e1000_shift_out_bits(shared, 0, 4); + + /* Prepare the EEPROM */ + e1000_standby_eeprom(shared); + + /* Send the Write command (3-bit opcode + addr) */ + e1000_shift_out_bits(shared, EEPROM_WRITE_OPCODE, 3); + /* If we have a 256 word EEPROM, there are 8 address bits + * if we have a 64 word EEPROM, there are 6 address bits + */ + if(large_eeprom) + e1000_shift_out_bits(shared, offset, 8); + else + e1000_shift_out_bits(shared, offset, 6); + + /* Send the data */ + e1000_shift_out_bits(shared, data, 16); + e1000_wait_eeprom_command(shared); + + /* Recover from write */ + e1000_standby_eeprom(shared); + + /* Send the 9-bit (or 11-bit on large EEPROM) EWDS (write disable) + * command to the EEPROM (5-bit opcode plus 4/6-bit dummy). + * This takes the EEPROM out of write/erase mode. + */ + e1000_shift_out_bits(shared, EEPROM_EWDS_OPCODE, 5); + if(large_eeprom) + e1000_shift_out_bits(shared, 0, 6); + else + e1000_shift_out_bits(shared, 0, 4); + + /* Done with writing */ + e1000_cleanup_eeprom(shared); + + /* Stop requestiong EEPROM access */ + if(shared->mac_type > e1000_82544) + E1000_WRITE_REG(shared, EECD, (uint32_t) 0); + + return (TRUE); +} + +/****************************************************************************** + * Reads the adapter's part number from the EEPROM + * + * shared - Struct containing variables accessed by shared code + * part_num - Adapter's part number + *****************************************************************************/ +boolean_t +e1000_read_part_num(struct e1000_shared_adapter *shared, + uint32_t *part_num) +{ + uint16_t eeprom_word; + + DEBUGFUNC("e1000_read_part_num"); + + /* Don't read the EEPROM if we are stopped */ + if(shared->adapter_stopped) { + *part_num = 0; + return (FALSE); + } + + /* Get word 0 from EEPROM */ + eeprom_word = e1000_read_eeprom(shared, (uint16_t) (EEPROM_PBA_BYTE_1)); + + DEBUGOUT("Read first part number word\n"); + + /* Save word 0 in upper half is PartNumber */ + *part_num = (uint32_t) eeprom_word; + *part_num = *part_num << 16; + + /* Get word 1 from EEPROM */ + eeprom_word = + e1000_read_eeprom(shared, (uint16_t) (EEPROM_PBA_BYTE_1 + 1)); + + DEBUGOUT("Read second part number word\n"); + + /* Save word 1 in lower half of PartNumber */ + *part_num |= eeprom_word; + + /* read a valid part number */ + return (TRUE); +} + +/****************************************************************************** + * Turns on the software controllable LED + * + * shared - Struct containing variables accessed by shared code + *****************************************************************************/ +void +e1000_led_on(struct e1000_shared_adapter *shared) +{ + uint32_t ctrl_reg; + + /* if we're stopped don't touch the hardware */ + if(shared->adapter_stopped) + return; + + /* Read the content of the device control reg */ + ctrl_reg = E1000_READ_REG(shared, CTRL); + + /* Set the LED control pin to an output */ + ctrl_reg |= E1000_CTRL_SWDPIO0; + + /* Drive it high on normal boards, low on low profile boards */ + if(shared->low_profile) + ctrl_reg &= ~E1000_CTRL_SWDPIN0; + else + ctrl_reg |= E1000_CTRL_SWDPIN0; + + E1000_WRITE_REG(shared, CTRL, ctrl_reg); + return; +} + +/****************************************************************************** + * Turns off the software controllable LED + * + * shared - Struct containing variables accessed by shared code + *****************************************************************************/ +void +e1000_led_off(struct e1000_shared_adapter *shared) +{ + uint32_t ctrl_reg; + + /* if we're stopped don't touch the hardware */ + if(shared->adapter_stopped) + return; + + /* Read the content of the device control reg */ + ctrl_reg = E1000_READ_REG(shared, CTRL); + + /* Set the LED control pin to an output */ + ctrl_reg |= E1000_CTRL_SWDPIO0; + + /* Drive it low on normal boards, high on low profile boards */ + if(shared->low_profile) + ctrl_reg |= E1000_CTRL_SWDPIN0; + else + ctrl_reg &= ~E1000_CTRL_SWDPIN0; + + /* Write the device control reg. back */ + E1000_WRITE_REG(shared, CTRL, ctrl_reg); + return; +} + +/****************************************************************************** + * Adjusts the statistic counters when a frame is accepted by TBI_ACCEPT + * + * shared - Struct containing variables accessed by shared code + * frame_len - The length of the frame in question + * mac_addr - The Ethernet destination address of the frame in question + *****************************************************************************/ +uint32_t +e1000_tbi_adjust_stats(struct e1000_shared_adapter *shared, + struct e1000_shared_stats *stats, + uint32_t frame_len, + uint8_t *mac_addr) +{ + uint64_t carry_bit; + + /* First adjust the frame length. */ + frame_len--; + /* We need to adjust the statistics counters, since the hardware + * counters overcount this packet as a CRC error and undercount + * the packet as a good packet + */ + /* This packet should not be counted as a CRC error. */ + stats->crcerrs--; + /* This packet does count as a Good Packet Received. */ + stats->gprc++; + + /* Adjust the Good Octets received counters */ + carry_bit = 0x80000000 & stats->gorcl; + stats->gorcl += frame_len; + /* If the high bit of Gorcl (the low 32 bits of the Good Octets + * Received Count) was one before the addition, + * AND it is zero after, then we lost the carry out, + * need to add one to Gorch (Good Octets Received Count High). + * This could be simplified if all environments supported + * 64-bit integers. + */ + if(carry_bit && ((stats->gorcl & 0x80000000) == 0)) + stats->gorch++; + /* Is this a broadcast or multicast? Check broadcast first, + * since the test for a multicast frame will test positive on + * a broadcast frame. + */ + if((mac_addr[0] == (uint8_t) 0xff) && (mac_addr[1] == (uint8_t) 0xff)) + /* Broadcast packet */ + stats->bprc++; + else if(*mac_addr & 0x01) + /* Multicast packet */ + stats->mprc++; + + if(frame_len == shared->max_frame_size) { + /* In this case, the hardware has overcounted the number of + * oversize frames. + */ + if(stats->roc > 0) + stats->roc--; + } + + /* Adjust the bin counters when the extra byte put the frame in the + * wrong bin. Remember that the frame_len was adjusted above. + */ + if(frame_len == 64) { + stats->prc64++; + stats->prc127--; + } else if(frame_len == 127) { + stats->prc127++; + stats->prc255--; + } else if(frame_len == 255) { + stats->prc255++; + stats->prc511--; + } else if(frame_len == 511) { + stats->prc511++; + stats->prc1023--; + } else if(frame_len == 1023) { + stats->prc1023++; + stats->prc1522--; + } else if(frame_len == 1522) { + stats->prc1522++; + } + return frame_len; +} + +/****************************************************************************** + * Gets the current PCI bus type, speed, and width of the hardware + * + * shared - Struct containing variables accessed by shared code + *****************************************************************************/ +void +e1000_get_bus_info(struct e1000_shared_adapter *shared) +{ + uint32_t status_reg; + + if(shared->mac_type < e1000_82543) { + shared->bus_type = e1000_bus_type_unknown; + shared->bus_speed = e1000_bus_speed_unknown; + shared->bus_width = e1000_bus_width_unknown; + return; + } + + status_reg = E1000_READ_REG(shared, STATUS); + + shared->bus_type = (status_reg & E1000_STATUS_PCIX_MODE) ? + e1000_bus_type_pcix : e1000_bus_type_pci; + + if(shared->bus_type == e1000_bus_type_pci) { + shared->bus_speed = (status_reg & E1000_STATUS_PCI66) ? + e1000_bus_speed_66 : e1000_bus_speed_33; + } else { + switch (status_reg & E1000_STATUS_PCIX_SPEED) { + case E1000_STATUS_PCIX_SPEED_66: + shared->bus_speed = e1000_bus_speed_66; + break; + case E1000_STATUS_PCIX_SPEED_100: + shared->bus_speed = e1000_bus_speed_100; + break; + case E1000_STATUS_PCIX_SPEED_133: + shared->bus_speed = e1000_bus_speed_133; + break; + default: + shared->bus_speed = e1000_bus_speed_reserved; + break; + } + } + + shared->bus_width = (status_reg & E1000_STATUS_BUS64) ? + e1000_bus_width_64 : e1000_bus_width_32; + + return; +} diff -urN linux-2.4.18/drivers/net/e1000/e1000_mac.h lia64-2.4/drivers/net/e1000/e1000_mac.h --- linux-2.4.18/drivers/net/e1000/e1000_mac.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/e1000/e1000_mac.h Fri Jul 19 18:51:03 2002 @@ -0,0 +1,1381 @@ +/******************************************************************************* + + This software program is available to you under a choice of one of two + licenses. You may choose to be licensed under either the GNU General Public + License (GPL) Version 2, June 1991, available at + http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the + text of which follows: + + Recipient has requested a license and Intel Corporation ("Intel") is willing + to grant a license for the software entitled Linux Base Driver for the + Intel(R) PRO/1000 Family of Adapters (e1000) (the "Software") being provided + by Intel Corporation. The following definitions apply to this license: + + "Licensed Patents" means patent claims licensable by Intel Corporation which + are necessarily infringed by the use of sale of the Software alone or when + combined with the operating system referred to below. + + "Recipient" means the party to whom Intel delivers this Software. + + "Licensee" means Recipient and those third parties that receive a license to + any operating system available under the GNU Public License version 2.0 or + later. + + Copyright (c) 1999 - 2002 Intel Corporation. + All rights reserved. + + The license is provided to Recipient and Recipient's Licensees under the + following terms. + + Redistribution and use in source and binary forms of the Software, with or + without modification, are permitted provided that the following conditions + are met: + + Redistributions of source code of the Software may retain the above + copyright notice, this list of conditions and the following disclaimer. + + Redistributions in binary form of the Software may reproduce the above + copyright notice, this list of conditions and the following disclaimer in + the documentation and/or materials provided with the distribution. + + Neither the name of Intel Corporation nor the names of its contributors + shall be used to endorse or promote products derived from this Software + without specific prior written permission. + + Intel hereby grants Recipient and Licensees a non-exclusive, worldwide, + royalty-free patent license under Licensed Patents to make, use, sell, offer + to sell, import and otherwise transfer the Software, if any, in source code + and object code form. This license shall include changes to the Software + that are error corrections or other minor changes to the Software that do + not add functionality or features when the Software is incorporated in any + version of an operating system that has been distributed under the GNU + General Public License 2.0 or later. This patent license shall apply to the + combination of the Software and any operating system licensed under the GNU + Public License version 2.0 or later if, at the time Intel provides the + Software to Recipient, such addition of the Software to the then publicly + available versions of such operating systems available under the GNU Public + License version 2.0 or later (whether in gold, beta or alpha form) causes + such combination to be covered by the Licensed Patents. The patent license + shall not apply to any other combinations which include the Software. NO + hardware per se is licensed hereunder. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR IT CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + ANY LOSS OF USE; DATA, OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + +/* e1000_mac.h + * Structures, enums, and macros for the MAC + */ + +#ifndef _E1000_MAC_H_ +#define _E1000_MAC_H_ + +#include "e1000_osdep.h" + +/* Forward declarations of structures used by the shared code */ +struct e1000_shared_adapter; +struct e1000_shared_stats; + +/* Enumerated types specific to the e1000 hardware */ +/* Media Access Controlers */ +typedef enum { + e1000_82542_rev2_0 = 0, + e1000_82542_rev2_1, + e1000_82543, + e1000_82544, + e1000_82540, + e1000_num_macs +} e1000_mac_type; + +/* Media Types */ +typedef enum { + e1000_media_type_copper = 0, + e1000_media_type_fiber = 1, + e1000_num_media_types +} e1000_media_type; + +typedef enum { + e1000_10_half = 0, + e1000_10_full = 1, + e1000_100_half = 2, + e1000_100_full = 3 +} e1000_speed_duplex_type; + +/* Flow Control Settings */ +typedef enum { + e1000_fc_none = 0, + e1000_fc_rx_pause = 1, + e1000_fc_tx_pause = 2, + e1000_fc_full = 3, + e1000_fc_default = 0xFF +} e1000_fc_type; + +/* PCI bus types */ +typedef enum { + e1000_bus_type_unknown = 0, + e1000_bus_type_pci, + e1000_bus_type_pcix +} e1000_bus_type; + +/* PCI bus speeds */ +typedef enum { + e1000_bus_speed_unknown = 0, + e1000_bus_speed_33, + e1000_bus_speed_66, + e1000_bus_speed_100, + e1000_bus_speed_133, + e1000_bus_speed_reserved +} e1000_bus_speed; + +/* PCI bus widths */ +typedef enum { + e1000_bus_width_unknown = 0, + e1000_bus_width_32, + e1000_bus_width_64 +} e1000_bus_width; + + + +/* Function prototypes */ +/* Setup */ +void e1000_adapter_stop(struct e1000_shared_adapter *shared); +boolean_t e1000_init_hw(struct e1000_shared_adapter *shared); +void e1000_init_rx_addrs(struct e1000_shared_adapter *shared); + +/* Filters (multicast, vlan, receive) */ +void e1000_mc_addr_list_update(struct e1000_shared_adapter *shared, uint8_t * mc_addr_list, uint32_t mc_addr_count, uint32_t pad); +uint32_t e1000_hash_mc_addr(struct e1000_shared_adapter *shared, uint8_t * mc_addr); +void e1000_mta_set(struct e1000_shared_adapter *shared, uint32_t hash_value); +void e1000_rar_set(struct e1000_shared_adapter *shared, uint8_t * mc_addr, uint32_t rar_index); +void e1000_write_vfta(struct e1000_shared_adapter *shared, uint32_t offset, uint32_t value); +void e1000_clear_vfta(struct e1000_shared_adapter *shared); + +/* Link layer setup functions */ +boolean_t e1000_setup_fc_and_link(struct e1000_shared_adapter *shared); +boolean_t e1000_setup_pcs_link(struct e1000_shared_adapter *shared, uint32_t dev_ctrl_reg); +void e1000_config_fc_after_link_up(struct e1000_shared_adapter *shared); +void e1000_check_for_link(struct e1000_shared_adapter *shared); +void e1000_get_speed_and_duplex(struct e1000_shared_adapter *shared, uint16_t * speed, uint16_t * duplex); + +/* EEPROM Functions */ +uint16_t e1000_read_eeprom(struct e1000_shared_adapter *shared, uint16_t reg); +boolean_t e1000_validate_eeprom_checksum(struct e1000_shared_adapter *shared); +void e1000_update_eeprom_checksum(struct e1000_shared_adapter *shared); +boolean_t e1000_write_eeprom(struct e1000_shared_adapter *shared, uint16_t reg, uint16_t data); + +/* Everything else */ +void e1000_clear_hw_cntrs(struct e1000_shared_adapter *shared); +boolean_t e1000_read_part_num(struct e1000_shared_adapter *shared, uint32_t * part_num); +void e1000_led_on(struct e1000_shared_adapter *shared); +void e1000_led_off(struct e1000_shared_adapter *shared); +void e1000_get_bus_info(struct e1000_shared_adapter *shared); +uint32_t e1000_tbi_adjust_stats(struct e1000_shared_adapter *shared, struct e1000_shared_stats *stats, uint32_t frame_len, uint8_t * mac_addr); +void e1000_write_pci_cfg(struct e1000_shared_adapter *shared, uint32_t reg, uint16_t * value); + +/* PCI Device IDs */ +#define E1000_DEV_ID_82542 0x1000 +#define E1000_DEV_ID_82543GC_FIBER 0x1001 +#define E1000_DEV_ID_82543GC_COPPER 0x1004 +#define E1000_DEV_ID_82544EI_COPPER 0x1008 +#define E1000_DEV_ID_82544EI_FIBER 0x1009 +#define E1000_DEV_ID_82544GC_COPPER 0x100C +#define E1000_DEV_ID_82544GC_LOM 0x100D +#define E1000_DEV_ID_82540EM 0x100E +#define NUM_DEV_IDS 8 + +#define NODE_ADDRESS_SIZE 6 +#define ETH_LENGTH_OF_ADDRESS 6 + +/* MAC decode size is 128K - This is the size of BAR0 */ +#define MAC_DECODE_SIZE (128 * 1024) + +#define E1000_82542_2_0_REV_ID 2 +#define E1000_82542_2_1_REV_ID 3 + +#define SPEED_10 10 +#define SPEED_100 100 +#define SPEED_1000 1000 +#define HALF_DUPLEX 1 +#define FULL_DUPLEX 2 + +/* The sizes (in bytes) of a ethernet packet */ +#define ENET_HEADER_SIZE 14 +#define MAXIMUM_ETHERNET_PACKET_SIZE 1514 /* Without FCS */ +#define MINIMUM_ETHERNET_PACKET_SIZE 60 /* Without FCS */ +#define CRC_LENGTH 4 +#define MAX_JUMBO_FRAME_SIZE 0x3F00 + + +/* 802.1q VLAN Packet Sizes */ +#define VLAN_TAG_SIZE 4 /* 802.3ac tag (not DMAed) */ + +/* Ethertype field values */ +#define ETHERNET_IEEE_VLAN_TYPE 0x8100 /* 802.3ac packet */ +#define ETHERNET_IP_TYPE 0x0800 /* IP packets */ +#define ETHERNET_ARP_TYPE 0x0806 /* Address Resolution Protocol (ARP) */ + +/* Packet Header defines */ +#define IP_PROTOCOL_TCP 6 +#define IP_PROTOCOL_UDP 0x11 + +/* This defines the bits that are set in the Interrupt Mask + * Set/Read Register. Each bit is documented below: + * o RXDMT0 = Receive Descriptor Minimum Threshold hit (ring 0) + * o RXSEQ = Receive Sequence Error + */ +#define POLL_IMS_ENABLE_MASK ( \ + E1000_IMS_RXDMT0 | \ + E1000_IMS_RXSEQ) + +/* This defines the bits that are set in the Interrupt Mask + * Set/Read Register. Each bit is documented below: + * o RXT0 = Receiver Timer Interrupt (ring 0) + * o TXDW = Transmit Descriptor Written Back + * o RXDMT0 = Receive Descriptor Minimum Threshold hit (ring 0) + * o RXSEQ = Receive Sequence Error + * o LSC = Link Status Change + */ +#define IMS_ENABLE_MASK ( \ + E1000_IMS_RXT0 | \ + E1000_IMS_TXDW | \ + E1000_IMS_RXDMT0 | \ + E1000_IMS_RXSEQ | \ + E1000_IMS_LSC) + +/* The number of high/low register pairs in the RAR. The RAR (Receive Address + * Registers) holds the directed and multicast addresses that we monitor. We + * reserve one of these spots for our directed address, allowing us room for + * E1000_RAR_ENTRIES - 1 multicast addresses. + */ +#define E1000_RAR_ENTRIES 16 + +#define MIN_NUMBER_OF_DESCRIPTORS 8 +#define MAX_NUMBER_OF_DESCRIPTORS 0xFFF8 + +/* Receive Descriptor */ +struct e1000_rx_desc { + uint64_t buffer_addr; /* Address of the descriptor's data buffer */ + uint16_t length; /* Length of data DMAed into data buffer */ + uint16_t csum; /* Packet checksum */ + uint8_t status; /* Descriptor status */ + uint8_t errors; /* Descriptor Errors */ + uint16_t special; +}; + +/* Receive Decriptor bit definitions */ +#define E1000_RXD_STAT_DD 0x01 /* Descriptor Done */ +#define E1000_RXD_STAT_EOP 0x02 /* End of Packet */ +#define E1000_RXD_STAT_IXSM 0x04 /* Ignore checksum */ +#define E1000_RXD_STAT_VP 0x08 /* IEEE VLAN Packet */ +#define E1000_RXD_STAT_TCPCS 0x20 /* TCP xsum calculated */ +#define E1000_RXD_STAT_IPCS 0x40 /* IP xsum calculated */ +#define E1000_RXD_STAT_PIF 0x80 /* passed in-exact filter */ +#define E1000_RXD_ERR_CE 0x01 /* CRC Error */ +#define E1000_RXD_ERR_SE 0x02 /* Symbol Error */ +#define E1000_RXD_ERR_SEQ 0x04 /* Sequence Error */ +#define E1000_RXD_ERR_CXE 0x10 /* Carrier Extension Error */ +#define E1000_RXD_ERR_TCPE 0x20 /* TCP/UDP Checksum Error */ +#define E1000_RXD_ERR_IPE 0x40 /* IP Checksum Error */ +#define E1000_RXD_ERR_RXE 0x80 /* Rx Data Error */ +#define E1000_RXD_SPC_VLAN_MASK 0x0FFF /* VLAN ID is in lower 12 bits */ +#define E1000_RXD_SPC_PRI_MASK 0xE000 /* Priority is in upper 3 bits */ +#define E1000_RXD_SPC_PRI_SHIFT 0x000D /* Priority is in upper 3 of 16 */ +#define E1000_RXD_SPC_CFI_MASK 0x1000 /* CFI is bit 12 */ +#define E1000_RXD_SPC_CFI_SHIFT 0x000C /* CFI is bit 12 */ + +/* mask to determine if packets should be dropped due to frame errors */ +#define E1000_RXD_ERR_FRAME_ERR_MASK ( \ + E1000_RXD_ERR_CE | \ + E1000_RXD_ERR_SE | \ + E1000_RXD_ERR_SEQ | \ + E1000_RXD_ERR_CXE | \ + E1000_RXD_ERR_RXE) + +/* Transmit Descriptor */ +struct e1000_tx_desc { + uint64_t buffer_addr; /* Address of the descriptor's data buffer */ + union { + uint32_t data; + struct { + uint16_t length; /* Data buffer length */ + uint8_t cso; /* Checksum offset */ + uint8_t cmd; /* Descriptor control */ + } flags; + } lower; + union { + uint32_t data; + struct { + uint8_t status; /* Descriptor status */ + uint8_t css; /* Checksum start */ + uint16_t special; + } fields; + } upper; +}; + +/* Transmit Descriptor bit definitions */ +#define E1000_TXD_DTYP_D 0x00100000 /* Data Descriptor */ +#define E1000_TXD_DTYP_C 0x00000000 /* Context Descriptor */ +#define E1000_TXD_POPTS_IXSM 0x01 /* Insert IP checksum */ +#define E1000_TXD_POPTS_TXSM 0x02 /* Insert TCP/UDP checksum */ +#define E1000_TXD_CMD_EOP 0x01000000 /* End of Packet */ +#define E1000_TXD_CMD_IFCS 0x02000000 /* Insert FCS (Ethernet CRC) */ +#define E1000_TXD_CMD_IC 0x04000000 /* Insert Checksum */ +#define E1000_TXD_CMD_RS 0x08000000 /* Report Status */ +#define E1000_TXD_CMD_RPS 0x10000000 /* Report Packet Sent */ +#define E1000_TXD_CMD_DEXT 0x20000000 /* Descriptor extension (0 = legacy) */ +#define E1000_TXD_CMD_VLE 0x40000000 /* Add VLAN tag */ +#define E1000_TXD_CMD_IDE 0x80000000 /* Enable Tidv register */ +#define E1000_TXD_STAT_DD 0x00000001 /* Descriptor Done */ +#define E1000_TXD_STAT_EC 0x00000002 /* Excess Collisions */ +#define E1000_TXD_STAT_LC 0x00000004 /* Late Collisions */ +#define E1000_TXD_STAT_TU 0x00000008 /* Transmit underrun */ +#define E1000_TXD_CMD_TCP 0x01000000 /* TCP packet */ +#define E1000_TXD_CMD_IP 0x02000000 /* IP packet */ +#define E1000_TXD_CMD_TSE 0x04000000 /* TCP Seg enable */ +#define E1000_TXD_STAT_TC 0x00000004 /* Tx Underrun */ + +/* Offload Context Descriptor */ +struct e1000_context_desc { + union { + uint32_t ip_config; + struct { + uint8_t ipcss; /* IP checksum start */ + uint8_t ipcso; /* IP checksum offset */ + uint16_t ipcse; /* IP checksum end */ + } ip_fields; + } lower_setup; + union { + uint32_t tcp_config; + struct { + uint8_t tucss; /* TCP checksum start */ + uint8_t tucso; /* TCP checksum offset */ + uint16_t tucse; /* TCP checksum end */ + } tcp_fields; + } upper_setup; + uint32_t cmd_and_length; /* */ + union { + uint32_t data; + struct { + uint8_t status; /* Descriptor status */ + uint8_t hdr_len; /* Header length */ + uint16_t mss; /* Maximum segment size */ + } fields; + } tcp_seg_setup; +}; + +/* Offload data descriptor */ +struct e1000_data_desc { + uint64_t buffer_addr; /* Address of the descriptor's buffer address */ + union { + uint32_t data; + struct { + uint16_t length; /* Data buffer length */ + uint8_t typ_len_ext; /* */ + uint8_t cmd; /* */ + } flags; + } lower; + union { + uint32_t data; + struct { + uint8_t status; /* Descriptor status */ + uint8_t popts; /* Packet Options */ + uint16_t special; /* */ + } fields; + } upper; +}; + +/* Filters */ +#define E1000_NUM_UNICAST 16 /* Unicast filter entries */ +#define E1000_MC_TBL_SIZE 128 /* Multicast Filter Table (4096 bits) */ +#define E1000_VLAN_FILTER_TBL_SIZE 128 /* VLAN Filter Table (4096 bits) */ + + +/* Receive Address Register */ +struct e1000_rar { + volatile uint32_t low; /* receive address low */ + volatile uint32_t high; /* receive address high */ +}; + +/* The number of entries in the Multicast Table Array (MTA). */ +#define E1000_NUM_MTA_REGISTERS 128 + +/* IPv4 Address Table Entry */ +struct e1000_ipv4_at_entry { + volatile uint32_t ipv4_addr; /* IP Address (RW) */ + volatile uint32_t reserved; +}; + +/* Four wakeup IP addresses are supported */ +#define E1000_WAKEUP_IP_ADDRESS_COUNT_MAX 4 +#define E1000_IP4AT_SIZE E1000_WAKEUP_IP_ADDRESS_COUNT_MAX +#define E1000_IP6AT_SIZE 1 + +/* IPv6 Address Table Entry */ +struct e1000_ipv6_at_entry { + volatile uint8_t ipv6_addr[16]; +}; + +/* Flexible Filter Length Table Entry */ +struct e1000_fflt_entry { + volatile uint32_t length; /* Flexible Filter Length (RW) */ + volatile uint32_t reserved; +}; + +/* Flexible Filter Mask Table Entry */ +struct e1000_ffmt_entry { + volatile uint32_t mask; /* Flexible Filter Mask (RW) */ + volatile uint32_t reserved; +}; + +/* Flexible Filter Value Table Entry */ +struct e1000_ffvt_entry { + volatile uint32_t value; /* Flexible Filter Value (RW) */ + volatile uint32_t reserved; +}; + +/* Four Flexible Filters are supported */ +#define E1000_FLEXIBLE_FILTER_COUNT_MAX 4 + +/* Each Flexible Filter is at most 128 (0x80) bytes in length */ +#define E1000_FLEXIBLE_FILTER_SIZE_MAX 128 + +#define E1000_FFLT_SIZE E1000_FLEXIBLE_FILTER_COUNT_MAX +#define E1000_FFMT_SIZE E1000_FLEXIBLE_FILTER_SIZE_MAX +#define E1000_FFVT_SIZE E1000_FLEXIBLE_FILTER_SIZE_MAX + +/* Register Set. (82543, 82544) + * + * Registers are defined to be 32 bits and should be accessed as 32 bit values. + * These registers are physically located on the NIC, but are mapped into the + * host memory address space. + * + * RW - register is both readable and writable + * RO - register is read only + * WO - register is write only + * R/clr - register is read only and is cleared when read + * A - register array + */ +#define E1000_CTRL 0x00000 /* Device Control - RW */ +#define E1000_STATUS 0x00008 /* Device Status - RO */ +#define E1000_EECD 0x00010 /* EEPROM/Flash Control - RW */ +#define E1000_EERD 0x00014 /* EEPROM Read - RW */ +#define E1000_CTRL_EXT 0x00018 /* Extended Device Control - RW */ +#define E1000_MDIC 0x00020 /* MDI Control - RW */ +#define E1000_FCAL 0x00028 /* Flow Control Address Low - RW */ +#define E1000_FCAH 0x0002C /* Flow Control Address High -RW */ +#define E1000_FCT 0x00030 /* Flow Control Type - RW */ +#define E1000_VET 0x00038 /* VLAN Ether Type - RW */ +#define E1000_ICR 0x000C0 /* Interrupt Cause Read - R/clr */ +#define E1000_ITR 0x000C4 /* Interrupt Throttling Rate - RW */ +#define E1000_ICS 0x000C8 /* Interrupt Cause Set - WO */ +#define E1000_IMS 0x000D0 /* Interrupt Mask Set - RW */ +#define E1000_IMC 0x000D8 /* Interrupt Mask Clear - WO */ +#define E1000_RCTL 0x00100 /* RX Control - RW */ +#define E1000_FCTTV 0x00170 /* Flow Control Transmit Timer Value - RW */ +#define E1000_TXCW 0x00178 /* TX Configuration Word - RW */ +#define E1000_RXCW 0x00180 /* RX Configuration Word - RO */ +#define E1000_TCTL 0x00400 /* TX Control - RW */ +#define E1000_TIPG 0x00410 /* TX Inter-packet gap -RW */ +#define E1000_TBT 0x00448 /* TX Burst Timer - RW */ +#define E1000_LEDCTL 0x00E00 /* LED Control - RW */ +#define E1000_PBA 0x01000 /* Packet Buffer Allocation - RW */ +#define E1000_FCRTL 0x02160 /* Flow Control Receive Threshold Low - RW */ +#define E1000_FCRTH 0x02168 /* Flow Control Receive Threshold High - RW */ +#define E1000_RDBAL 0x02800 /* RX Descriptor Base Address Low - RW */ +#define E1000_RDBAH 0x02804 /* RX Descriptor Base Address High - RW */ +#define E1000_RDLEN 0x02808 /* RX Descriptor Length - RW */ +#define E1000_RDH 0x02810 /* RX Descriptor Head - RW */ +#define E1000_RDT 0x02818 /* RX Descriptor Tail - RW */ +#define E1000_RDTR 0x02820 /* RX Delay Timer - RW */ +#define E1000_RXDCTL 0x02828 /* RX Descriptor Control - RW */ +#define E1000_RADV 0x0282C /* RX Interrupt Absolute Delay Timer - RW */ +#define E1000_RSRPD 0x02C00 /* RX Small Packet Detect - RW */ +#define E1000_TXDMAC 0x03000 /* TX DMA Control - RW */ +#define E1000_TDBAL 0x03800 /* TX Descriptor Base Address Low - RW */ +#define E1000_TDBAH 0x03804 /* TX Descriptor Base Address High - RW */ +#define E1000_TDLEN 0x03808 /* TX Descriptor Length - RW */ +#define E1000_TDH 0x03810 /* TX Descriptor Head - RW */ +#define E1000_TDT 0x03818 /* TX Descripotr Tail - RW */ +#define E1000_TIDV 0x03820 /* TX Interrupt Delay Value - RW */ +#define E1000_TXDCTL 0x03828 /* TX Descriptor Control - RW */ +#define E1000_TADV 0x0382C /* TX Interrupt Absolute Delay Val - RW */ +#define E1000_TSPMT 0x03830 /* TCP Segmentation PAD & Min Threshold - RW */ +#define E1000_CRCERRS 0x04000 /* CRC Error Count - R/clr */ +#define E1000_ALGNERRC 0x04004 /* Alignment Error Count - R/clr */ +#define E1000_SYMERRS 0x04008 /* Symbol Error Count - R/clr */ +#define E1000_RXERRC 0x0400C /* Receive Error Count - R/clr */ +#define E1000_MPC 0x04010 /* Missed Packet Count - R/clr */ +#define E1000_SCC 0x04014 /* Single Collision Count - R/clr */ +#define E1000_ECOL 0x04018 /* Excessive Collision Count - R/clr */ +#define E1000_MCC 0x0401C /* Multiple Collision Count - R/clr */ +#define E1000_LATECOL 0x04020 /* Late Collision Count - R/clr */ +#define E1000_COLC 0x04028 /* Collision Count - R/clr */ +#define E1000_DC 0x04030 /* Defer Count - R/clr */ +#define E1000_TNCRS 0x04034 /* TX-No CRS - R/clr */ +#define E1000_SEC 0x04038 /* Sequence Error Count - R/clr */ +#define E1000_CEXTERR 0x0403C /* Carrier Extension Error Count - R/clr */ +#define E1000_RLEC 0x04040 /* Receive Length Error Count - R/clr */ +#define E1000_XONRXC 0x04048 /* XON RX Count - R/clr */ +#define E1000_XONTXC 0x0404C /* XON TX Count - R/clr */ +#define E1000_XOFFRXC 0x04050 /* XOFF RX Count - R/clr */ +#define E1000_XOFFTXC 0x04054 /* XOFF TX Count - R/clr */ +#define E1000_FCRUC 0x04058 /* Flow Control RX Unsupported Count- R/clr */ +#define E1000_PRC64 0x0405C /* Packets RX (64 bytes) - R/clr */ +#define E1000_PRC127 0x04060 /* Packets RX (65-127 bytes) - R/clr */ +#define E1000_PRC255 0x04064 /* Packets RX (128-255 bytes) - R/clr */ +#define E1000_PRC511 0x04068 /* Packets RX (255-511 bytes) - R/clr */ +#define E1000_PRC1023 0x0406C /* Packets RX (512-1023 bytes) - R/clr */ +#define E1000_PRC1522 0x04070 /* Packets RX (1024-1522 bytes) - R/clr */ +#define E1000_GPRC 0x04074 /* Good Packets RX Count - R/clr */ +#define E1000_BPRC 0x04078 /* Broadcast Packets RX Count - R/clr */ +#define E1000_MPRC 0x0407C /* Multicast Packets RX Count - R/clr */ +#define E1000_GPTC 0x04080 /* Good Packets TX Count - R/clr */ +#define E1000_GORCL 0x04088 /* Good Octets RX Count Low - R/clr */ +#define E1000_GORCH 0x0408C /* Good Octets RX Count High - R/clr */ +#define E1000_GOTCL 0x04090 /* Good Octets TX Count Low - R/clr */ +#define E1000_GOTCH 0x04094 /* Good Octets TX Count High - R/clr */ +#define E1000_RNBC 0x040A0 /* RX No Buffers Count - R/clr */ +#define E1000_RUC 0x040A4 /* RX Undersize Count - R/clr */ +#define E1000_RFC 0x040A8 /* RX Fragment Count - R/clr */ +#define E1000_ROC 0x040AC /* RX Oversize Count - R/clr */ +#define E1000_RJC 0x040B0 /* RX Jabber Count - R/clr */ +#define E1000_MGTPRC 0x040B4 /* Management Packets RX Count - R/clr */ +#define E1000_MGTPDC 0x040B8 /* Management Packets Dropped Count - R/clr */ +#define E1000_MGTPTC 0x040BC /* Management Packets TX Count - R/clr */ +#define E1000_TORL 0x040C0 /* Total Octets RX Low - R/clr */ +#define E1000_TORH 0x040C4 /* Total Octets RX High - R/clr */ +#define E1000_TOTL 0x040C8 /* Total Octets TX Low - R/clr */ +#define E1000_TOTH 0x040CC /* Total Octets TX High - R/clr */ +#define E1000_TPR 0x040D0 /* Total Packets RX - R/clr */ +#define E1000_TPT 0x040D4 /* Total Packets TX - R/clr */ +#define E1000_PTC64 0x040D8 /* Packets TX (64 bytes) - R/clr */ +#define E1000_PTC127 0x040DC /* Packets TX (65-127 bytes) - R/clr */ +#define E1000_PTC255 0x040E0 /* Packets TX (128-255 bytes) - R/clr */ +#define E1000_PTC511 0x040E4 /* Packets TX (256-511 bytes) - R/clr */ +#define E1000_PTC1023 0x040E8 /* Packets TX (512-1023 bytes) - R/clr */ +#define E1000_PTC1522 0x040EC /* Packets TX (1024-1522 Bytes) - R/clr */ +#define E1000_MPTC 0x040F0 /* Multicast Packets TX Count - R/clr */ +#define E1000_BPTC 0x040F4 /* Broadcast Packets TX Count - R/clr */ +#define E1000_TSCTC 0x040F8 /* TCP Segmentation Context TX - R/clr */ +#define E1000_TSCTFC 0x040FC /* TCP Segmentation Context TX Fail - R/clr */ +#define E1000_RXCSUM 0x05000 /* RX Checksum Control - RW */ +#define E1000_MTA 0x05200 /* Multicast Table Array - RW Array */ +#define E1000_RA 0x05400 /* Receive Address - RW Array */ +#define E1000_VFTA 0x05600 /* VLAN Filter Table Array - RW Array */ +#define E1000_WUC 0x05800 /* Wakeup Control - RW */ +#define E1000_WUFC 0x05808 /* Wakeup Filter Control - RW */ +#define E1000_WUS 0x05810 /* Wakeup Status - RO */ +#define E1000_MANC 0x05820 /* Management Control - RW */ +#define E1000_IPAV 0x05838 /* IP Address Valid - RW */ +#define E1000_IP4AT 0x05840 /* IPv4 Address Table - RW Array */ +#define E1000_IP6AT 0x05880 /* IPv6 Address Table - RW Array */ +#define E1000_WUPL 0x05900 /* Wakeup Packet Length - RW */ +#define E1000_WUPM 0x05A00 /* Wakeup Packet Memory - RO A */ +#define E1000_FFLT 0x05F00 /* Flexible Filter Length Table - RW Array */ +#define E1000_FFMT 0x09000 /* Flexible Filter Mask Table - RW Array */ +#define E1000_FFVT 0x09800 /* Flexible Filter Value Table - RW Array */ + +/* Register Set (82542) + * + * Some of the 82542 registers are located at different offsets than they are + * in more current versions of the 8254x. Despite the difference in location, + * the registers function in the same manner. + */ +#define E1000_82542_CTRL E1000_CTRL +#define E1000_82542_STATUS E1000_STATUS +#define E1000_82542_EECD E1000_EECD +#define E1000_82542_EERD E1000_EERD +#define E1000_82542_CTRL_EXT E1000_CTRL_EXT +#define E1000_82542_MDIC E1000_MDIC +#define E1000_82542_FCAL E1000_FCAL +#define E1000_82542_FCAH E1000_FCAH +#define E1000_82542_FCT E1000_FCT +#define E1000_82542_VET E1000_VET +#define E1000_82542_RA 0x00040 +#define E1000_82542_ICR E1000_ICR +#define E1000_82542_ITR E1000_ITR +#define E1000_82542_ICS E1000_ICS +#define E1000_82542_IMS E1000_IMS +#define E1000_82542_IMC E1000_IMC +#define E1000_82542_RCTL E1000_RCTL +#define E1000_82542_RDTR 0x00108 +#define E1000_82542_RDBAL 0x00110 +#define E1000_82542_RDBAH 0x00114 +#define E1000_82542_RDLEN 0x00118 +#define E1000_82542_RDH 0x00120 +#define E1000_82542_RDT 0x00128 +#define E1000_82542_FCRTH 0x00160 +#define E1000_82542_FCRTL 0x00168 +#define E1000_82542_FCTTV E1000_FCTTV +#define E1000_82542_TXCW E1000_TXCW +#define E1000_82542_RXCW E1000_RXCW +#define E1000_82542_MTA 0x00200 +#define E1000_82542_TCTL E1000_TCTL +#define E1000_82542_TIPG E1000_TIPG +#define E1000_82542_TDBAL 0x00420 +#define E1000_82542_TDBAH 0x00424 +#define E1000_82542_TDLEN 0x00428 +#define E1000_82542_TDH 0x00430 +#define E1000_82542_TDT 0x00438 +#define E1000_82542_TIDV 0x00440 +#define E1000_82542_TBT E1000_TBT +#define E1000_82542_VFTA 0x00600 +#define E1000_82542_LEDCTL E1000_LEDCTL +#define E1000_82542_PBA E1000_PBA +#define E1000_82542_RXDCTL E1000_RXDCTL +#define E1000_82542_RADV E1000_RADV +#define E1000_82542_RSRPD E1000_RSRPD +#define E1000_82542_TXDMAC E1000_TXDMAC +#define E1000_82542_TXDCTL E1000_TXDCTL +#define E1000_82542_TADV E1000_TADV +#define E1000_82542_TSPMT E1000_TSPMT +#define E1000_82542_CRCERRS E1000_CRCERRS +#define E1000_82542_ALGNERRC E1000_ALGNERRC +#define E1000_82542_SYMERRS E1000_SYMERRS +#define E1000_82542_RXERRC E1000_RXERRC +#define E1000_82542_MPC E1000_MPC +#define E1000_82542_SCC E1000_SCC +#define E1000_82542_ECOL E1000_ECOL +#define E1000_82542_MCC E1000_MCC +#define E1000_82542_LATECOL E1000_LATECOL +#define E1000_82542_COLC E1000_COLC +#define E1000_82542_DC E1000_DC +#define E1000_82542_TNCRS E1000_TNCRS +#define E1000_82542_SEC E1000_SEC +#define E1000_82542_CEXTERR E1000_CEXTERR +#define E1000_82542_RLEC E1000_RLEC +#define E1000_82542_XONRXC E1000_XONRXC +#define E1000_82542_XONTXC E1000_XONTXC +#define E1000_82542_XOFFRXC E1000_XOFFRXC +#define E1000_82542_XOFFTXC E1000_XOFFTXC +#define E1000_82542_FCRUC E1000_FCRUC +#define E1000_82542_PRC64 E1000_PRC64 +#define E1000_82542_PRC127 E1000_PRC127 +#define E1000_82542_PRC255 E1000_PRC255 +#define E1000_82542_PRC511 E1000_PRC511 +#define E1000_82542_PRC1023 E1000_PRC1023 +#define E1000_82542_PRC1522 E1000_PRC1522 +#define E1000_82542_GPRC E1000_GPRC +#define E1000_82542_BPRC E1000_BPRC +#define E1000_82542_MPRC E1000_MPRC +#define E1000_82542_GPTC E1000_GPTC +#define E1000_82542_GORCL E1000_GORCL +#define E1000_82542_GORCH E1000_GORCH +#define E1000_82542_GOTCL E1000_GOTCL +#define E1000_82542_GOTCH E1000_GOTCH +#define E1000_82542_RNBC E1000_RNBC +#define E1000_82542_RUC E1000_RUC +#define E1000_82542_RFC E1000_RFC +#define E1000_82542_ROC E1000_ROC +#define E1000_82542_RJC E1000_RJC +#define E1000_82542_MGTPRC E1000_MGTPRC +#define E1000_82542_MGTPDC E1000_MGTPDC +#define E1000_82542_MGTPTC E1000_MGTPTC +#define E1000_82542_TORL E1000_TORL +#define E1000_82542_TORH E1000_TORH +#define E1000_82542_TOTL E1000_TOTL +#define E1000_82542_TOTH E1000_TOTH +#define E1000_82542_TPR E1000_TPR +#define E1000_82542_TPT E1000_TPT +#define E1000_82542_PTC64 E1000_PTC64 +#define E1000_82542_PTC127 E1000_PTC127 +#define E1000_82542_PTC255 E1000_PTC255 +#define E1000_82542_PTC511 E1000_PTC511 +#define E1000_82542_PTC1023 E1000_PTC1023 +#define E1000_82542_PTC1522 E1000_PTC1522 +#define E1000_82542_MPTC E1000_MPTC +#define E1000_82542_BPTC E1000_BPTC +#define E1000_82542_TSCTC E1000_TSCTC +#define E1000_82542_TSCTFC E1000_TSCTFC +#define E1000_82542_RXCSUM E1000_RXCSUM +#define E1000_82542_WUC E1000_WUC +#define E1000_82542_WUFC E1000_WUFC +#define E1000_82542_WUS E1000_WUS +#define E1000_82542_MANC E1000_MANC +#define E1000_82542_IPAV E1000_IPAV +#define E1000_82542_IP4AT E1000_IP4AT +#define E1000_82542_IP6AT E1000_IP6AT +#define E1000_82542_WUPL E1000_WUPL +#define E1000_82542_WUPM E1000_WUPM +#define E1000_82542_FFLT E1000_FFLT +#define E1000_82542_FFMT E1000_FFMT +#define E1000_82542_FFVT E1000_FFVT + +/* Statistics counters collected by the MAC */ +struct e1000_shared_stats { + uint64_t crcerrs; + uint64_t algnerrc; + uint64_t symerrs; + uint64_t rxerrc; + uint64_t mpc; + uint64_t scc; + uint64_t ecol; + uint64_t mcc; + uint64_t latecol; + uint64_t colc; + uint64_t dc; + uint64_t tncrs; + uint64_t sec; + uint64_t cexterr; + uint64_t rlec; + uint64_t xonrxc; + uint64_t xontxc; + uint64_t xoffrxc; + uint64_t xofftxc; + uint64_t fcruc; + uint64_t prc64; + uint64_t prc127; + uint64_t prc255; + uint64_t prc511; + uint64_t prc1023; + uint64_t prc1522; + uint64_t gprc; + uint64_t bprc; + uint64_t mprc; + uint64_t gptc; + uint64_t gorcl; + uint64_t gorch; + uint64_t gotcl; + uint64_t gotch; + uint64_t rnbc; + uint64_t ruc; + uint64_t rfc; + uint64_t roc; + uint64_t rjc; + uint64_t mgprc; + uint64_t mgpdc; + uint64_t mgptc; + uint64_t torl; + uint64_t torh; + uint64_t totl; + uint64_t toth; + uint64_t tpr; + uint64_t tpt; + uint64_t ptc64; + uint64_t ptc127; + uint64_t ptc255; + uint64_t ptc511; + uint64_t ptc1023; + uint64_t ptc1522; + uint64_t mptc; + uint64_t bptc; + uint64_t tsctc; + uint64_t tsctfc; +}; + +/* Structure containing variables used by the shared code (e1000_mac.c and + * e1000_phy.c) + */ +struct e1000_shared_adapter { + uint8_t *hw_addr; + e1000_mac_type mac_type; + e1000_media_type media_type; + void *back; + e1000_fc_type fc; + e1000_bus_speed bus_speed; + e1000_bus_width bus_width; + e1000_bus_type bus_type; + uint32_t phy_id; + uint32_t phy_addr; + uint32_t original_fc; + uint32_t txcw_reg; + uint32_t autoneg_failed; + uint32_t max_frame_size; + uint32_t min_frame_size; + uint32_t mc_filter_type; + uint32_t num_mc_addrs; + uint16_t autoneg_advertised; + uint16_t pci_cmd_word; + uint16_t fc_high_water; + uint16_t fc_low_water; + uint16_t fc_pause_time; + uint16_t device_id; + uint16_t vendor_id; + uint16_t subsystem_id; + uint16_t subsystem_vendor_id; + uint8_t revision_id; + boolean_t disable_polarity_correction; + boolean_t get_link_status; + boolean_t tbi_compatibility_en; + boolean_t tbi_compatibility_on; + boolean_t adapter_stopped; + boolean_t fc_send_xon; + boolean_t report_tx_early; + boolean_t low_profile; + uint8_t autoneg; + uint8_t mdix; + uint8_t forced_speed_duplex; + uint8_t wait_autoneg_complete; + uint8_t dma_fairness; + uint8_t mac_addr[NODE_ADDRESS_SIZE]; +}; + + +#define E1000_EEPROM_SWDPIN0 0x0001 /* SWDPIN 0 EEPROM Value */ +#define E1000_EEPROM_LED_LOGIC 0x0020 /* Led Logic Word */ + +/* Register Bit Masks */ +/* Device Control */ +#define E1000_CTRL_FD 0x00000001 /* Full duplex.0=half; 1=full */ +#define E1000_CTRL_BEM 0x00000002 /* Endian Mode.0=little,1=big */ +#define E1000_CTRL_PRIOR 0x00000004 /* Priority on PCI. 0=rx,1=fair */ +#define E1000_CTRL_LRST 0x00000008 /* Link reset. 0=normal,1=reset */ +#define E1000_CTRL_TME 0x00000010 /* Test mode. 0=normal,1=test */ +#define E1000_CTRL_SLE 0x00000020 /* Serial Link on 0=dis,1=en */ +#define E1000_CTRL_ASDE 0x00000020 /* Auto-speed detect enable */ +#define E1000_CTRL_SLU 0x00000040 /* Set link up (Force Link) */ +#define E1000_CTRL_ILOS 0x00000080 /* Invert Loss-Of Signal */ +#define E1000_CTRL_SPD_SEL 0x00000300 /* Speed Select Mask */ +#define E1000_CTRL_SPD_10 0x00000000 /* Force 10Mb */ +#define E1000_CTRL_SPD_100 0x00000100 /* Force 100Mb */ +#define E1000_CTRL_SPD_1000 0x00000200 /* Force 1Gb */ +#define E1000_CTRL_BEM32 0x00000400 /* Big Endian 32 mode */ +#define E1000_CTRL_FRCSPD 0x00000800 /* Force Speed */ +#define E1000_CTRL_FRCDPX 0x00001000 /* Force Duplex */ +#define E1000_CTRL_SWDPIN0 0x00040000 /* SWDPIN 0 value */ +#define E1000_CTRL_SWDPIN1 0x00080000 /* SWDPIN 1 value */ +#define E1000_CTRL_SWDPIN2 0x00100000 /* SWDPIN 2 value */ +#define E1000_CTRL_SWDPIN3 0x00200000 /* SWDPIN 3 value */ +#define E1000_CTRL_SWDPIO0 0x00400000 /* SWDPIN 0 Input or output */ +#define E1000_CTRL_SWDPIO1 0x00800000 /* SWDPIN 1 input or output */ +#define E1000_CTRL_SWDPIO2 0x01000000 /* SWDPIN 2 input or output */ +#define E1000_CTRL_SWDPIO3 0x02000000 /* SWDPIN 3 input or output */ +#define E1000_CTRL_RST 0x04000000 /* Global reset */ +#define E1000_CTRL_RFCE 0x08000000 /* Receive Flow Control enable */ +#define E1000_CTRL_TFCE 0x10000000 /* Transmit flow control enable */ +#define E1000_CTRL_RTE 0x20000000 /* Routing tag enable */ +#define E1000_CTRL_VME 0x40000000 /* IEEE VLAN mode enable */ +#define E1000_CTRL_PHY_RST 0x80000000 /* PHY Reset */ + +/* Device Status */ +#define E1000_STATUS_FD 0x00000001 /* Full duplex.0=half,1=full */ +#define E1000_STATUS_LU 0x00000002 /* Link up.0=no,1=link */ +#define E1000_STATUS_FUNC_MASK 0x0000000C /* PCI Function Mask */ +#define E1000_STATUS_FUNC_0 0x00000000 /* Function 0 */ +#define E1000_STATUS_FUNC_1 0x00000004 /* Function 1 */ +#define E1000_STATUS_TXOFF 0x00000010 /* transmission paused */ +#define E1000_STATUS_TBIMODE 0x00000020 /* TBI mode */ +#define E1000_STATUS_SPEED_MASK 0x000000C0 +#define E1000_STATUS_SPEED_10 0x00000000 /* Speed 10Mb/s */ +#define E1000_STATUS_SPEED_100 0x00000040 /* Speed 100Mb/s */ +#define E1000_STATUS_SPEED_1000 0x00000080 /* Speed 1000Mb/s */ +#define E1000_STATUS_ASDV 0x00000300 /* Auto speed detect value */ +#define E1000_STATUS_MTXCKOK 0x00000400 /* MTX clock running OK */ +#define E1000_STATUS_PCI66 0x00000800 /* In 66Mhz slot */ +#define E1000_STATUS_BUS64 0x00001000 /* In 64 bit slot */ +#define E1000_STATUS_PCIX_MODE 0x00002000 /* PCI-X mode */ +#define E1000_STATUS_PCIX_SPEED 0x0000C000 /* PCI-X bus speed */ + +/* Constants used to intrepret the masked PCI-X bus speed. */ +#define E1000_STATUS_PCIX_SPEED_66 0x00000000 /* PCI-X bus speed 50-66 MHz */ +#define E1000_STATUS_PCIX_SPEED_100 0x00004000 /* PCI-X bus speed 66-100 MHz */ +#define E1000_STATUS_PCIX_SPEED_133 0x00008000 /* PCI-X bus speed 100-133 MHz */ + +/* EEPROM/Flash Control */ +#define E1000_EECD_SK 0x00000001 /* EEPROM Clock */ +#define E1000_EECD_CS 0x00000002 /* EEPROM Chip Select */ +#define E1000_EECD_DI 0x00000004 /* EEPROM Data In */ +#define E1000_EECD_DO 0x00000008 /* EEPROM Data Out */ +#define E1000_EECD_FWE_MASK 0x00000030 +#define E1000_EECD_FWE_DIS 0x00000010 /* Disable FLASH writes */ +#define E1000_EECD_FWE_EN 0x00000020 /* Enable FLASH writes */ +#define E1000_EECD_FWE_SHIFT 4 +#define E1000_EECD_SIZE 0x00000200 /* EEPROM Size (0=64 word 1=256 word) */ +#define E1000_EECD_REQ 0x00000040 /* EEPROM Access Request */ +#define E1000_EECD_GNT 0x00000080 /* EEPROM Access Grant */ +#define E1000_EECD_PRES 0x00000100 /* EEPROM Present */ + +/* EEPROM Read */ +#define E1000_EERD_START 0x00000001 /* Start Read */ +#define E1000_EERD_DONE 0x00000010 /* Read Done */ +#define E1000_EERD_ADDR_SHIFT 8 +#define E1000_EERD_ADDR_MASK 0x0000FF00 /* Read Address */ +#define E1000_EERD_DATA_SHIFT 16 +#define E1000_EERD_DATA_MASK 0xFFFF0000 /* Read Data */ + +/* Extended Device Control */ +#define E1000_CTRL_EXT_GPI0_EN 0x00000001 /* Maps SDP4 to GPI0 */ +#define E1000_CTRL_EXT_GPI1_EN 0x00000002 /* Maps SDP5 to GPI1 */ +#define E1000_CTRL_EXT_PHYINT_EN E1000_CTRL_EXT_GPI1_EN +#define E1000_CTRL_EXT_GPI2_EN 0x00000004 /* Maps SDP6 to GPI2 */ +#define E1000_CTRL_EXT_GPI3_EN 0x00000008 /* Maps SDP7 to GPI3 */ +#define E1000_CTRL_EXT_SDP4_DATA 0x00000010 /* Value of SW Defineable Pin 4 */ +#define E1000_CTRL_EXT_SDP5_DATA 0x00000020 /* Value of SW Defineable Pin 5 */ +#define E1000_CTRL_EXT_PHY_INT E1000_CTRL_EXT_SDP5_DATA +#define E1000_CTRL_EXT_SDP6_DATA 0x00000040 /* Value of SW Defineable Pin 6 */ +#define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Defineable Pin 7 */ +#define E1000_CTRL_EXT_SDP4_DIR 0x00000100 /* Direction of SDP4 0=in 1=out */ +#define E1000_CTRL_EXT_SDP5_DIR 0x00000200 /* Direction of SDP5 0=in 1=out */ +#define E1000_CTRL_EXT_SDP6_DIR 0x00000400 /* Direction of SDP6 0=in 1=out */ +#define E1000_CTRL_EXT_SDP7_DIR 0x00000800 /* Direction of SDP7 0=in 1=out */ +#define E1000_CTRL_EXT_ASDCHK 0x00001000 /* Initiate an ASD sequence */ +#define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */ +#define E1000_CTRL_EXT_IPS 0x00004000 /* Invert Power State */ +#define E1000_CTRL_EXT_SPD_BYPS 0x00008000 /* Speed Select Bypass */ +#define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000 +#define E1000_CTRL_EXT_LINK_MODE_GMII 0x00000000 +#define E1000_CTRL_EXT_LINK_MODE_TBI 0x00C00000 +#define E1000_CTRL_EXT_WR_WMARK_MASK 0x03000000 +#define E1000_CTRL_EXT_WR_WMARK_256 0x00000000 +#define E1000_CTRL_EXT_WR_WMARK_320 0x01000000 +#define E1000_CTRL_EXT_WR_WMARK_384 0x02000000 +#define E1000_CTRL_EXT_WR_WMARK_448 0x03000000 + +/* MDI Control */ +#define E1000_MDIC_DATA_MASK 0x0000FFFF +#define E1000_MDIC_REG_MASK 0x001F0000 +#define E1000_MDIC_REG_SHIFT 16 +#define E1000_MDIC_PHY_MASK 0x03E00000 +#define E1000_MDIC_PHY_SHIFT 21 +#define E1000_MDIC_OP_WRITE 0x04000000 +#define E1000_MDIC_OP_READ 0x08000000 +#define E1000_MDIC_READY 0x10000000 +#define E1000_MDIC_INT_EN 0x20000000 +#define E1000_MDIC_ERROR 0x40000000 + +/* LED Control */ +#define E1000_LEDCTL_LED0_MODE_MASK 0x0000000F +#define E1000_LEDCTL_LED0_MODE_SHIFT 0 +#define E1000_LEDCTL_LED0_IVRT 0x00000040 +#define E1000_LEDCTL_LED0_BLINK 0x00000080 +#define E1000_LEDCTL_LED1_MODE_MASK 0x00000F00 +#define E1000_LEDCTL_LED1_MODE_SHIFT 8 +#define E1000_LEDCTL_LED1_IVRT 0x00004000 +#define E1000_LEDCTL_LED1_BLINK 0x00008000 +#define E1000_LEDCTL_LED2_MODE_MASK 0x000F0000 +#define E1000_LEDCTL_LED2_MODE_SHIFT 16 +#define E1000_LEDCTL_LED2_IVRT 0x00400000 +#define E1000_LEDCTL_LED2_BLINK 0x00800000 +#define E1000_LEDCTL_LED3_MODE_MASK 0x0F000000 +#define E1000_LEDCTL_LED3_MODE_SHIFT 24 +#define E1000_LEDCTL_LED3_IVRT 0x40000000 +#define E1000_LEDCTL_LED3_BLINK 0x80000000 + +#define E1000_LEDCTL_MODE_LINK_10_1000 0x0 +#define E1000_LEDCTL_MODE_LINK_100_1000 0x1 +#define E1000_LEDCTL_MODE_LINK_UP 0x2 +#define E1000_LEDCTL_MODE_ACTIVITY 0x3 +#define E1000_LEDCTL_MODE_LINK_ACTIVITY 0x4 +#define E1000_LEDCTL_MODE_LINK_10 0x5 +#define E1000_LEDCTL_MODE_LINK_100 0x6 +#define E1000_LEDCTL_MODE_LINK_1000 0x7 +#define E1000_LEDCTL_MODE_PCIX_MODE 0x8 +#define E1000_LEDCTL_MODE_FULL_DUPLEX 0x9 +#define E1000_LEDCTL_MODE_COLLISION 0xA +#define E1000_LEDCTL_MODE_BUS_SPEED 0xB +#define E1000_LEDCTL_MODE_BUS_SIZE 0xC +#define E1000_LEDCTL_MODE_PAUSED 0xD +#define E1000_LEDCTL_MODE_LED_ON 0xE +#define E1000_LEDCTL_MODE_LED_OFF 0xF + +/* Receive Address */ +#define E1000_RAH_AV 0x80000000 /* Receive descriptor valid */ + +/* Interrupt Cause Read */ +#define E1000_ICR_TXDW 0x00000001 /* Transmit desc written back */ +#define E1000_ICR_TXQE 0x00000002 /* Transmit Queue empty */ +#define E1000_ICR_LSC 0x00000004 /* Link Status Change */ +#define E1000_ICR_RXSEQ 0x00000008 /* rx sequence error */ +#define E1000_ICR_RXDMT0 0x00000010 /* rx desc min. threshold (0) */ +#define E1000_ICR_RXO 0x00000040 /* rx overrun */ +#define E1000_ICR_RXT0 0x00000080 /* rx timer intr (ring 0) */ +#define E1000_ICR_MDAC 0x00000200 /* MDIO access complete */ +#define E1000_ICR_RXCFG 0x00000400 /* RX /c/ ordered set */ +#define E1000_ICR_GPI_EN0 0x00000800 /* GP Int 0 */ +#define E1000_ICR_GPI_EN1 0x00001000 /* GP Int 1 */ +#define E1000_ICR_GPI_EN2 0x00002000 /* GP Int 2 */ +#define E1000_ICR_GPI_EN3 0x00004000 /* GP Int 3 */ +#define E1000_ICR_TXD_LOW 0x00008000 +#define E1000_ICR_SRPD 0x00010000 + +/* Interrupt Cause Set */ +#define E1000_ICS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ +#define E1000_ICS_TXQE E1000_ICR_TXQE /* Transmit Queue empty */ +#define E1000_ICS_LSC E1000_ICR_LSC /* Link Status Change */ +#define E1000_ICS_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */ +#define E1000_ICS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ +#define E1000_ICS_RXO E1000_ICR_RXO /* rx overrun */ +#define E1000_ICS_RXT0 E1000_ICR_RXT0 /* rx timer intr */ +#define E1000_ICS_MDAC E1000_ICR_MDAC /* MDIO access complete */ +#define E1000_ICS_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */ +#define E1000_ICS_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */ +#define E1000_ICS_GPI_EN1 E1000_ICR_GPI_EN1 /* GP Int 1 */ +#define E1000_ICS_GPI_EN2 E1000_ICR_GPI_EN2 /* GP Int 2 */ +#define E1000_ICS_GPI_EN3 E1000_ICR_GPI_EN3 /* GP Int 3 */ +#define E1000_ICS_TXD_LOW E1000_ICR_TXD_LOW +#define E1000_ICS_SRPD E1000_ICR_SRPD + +/* Interrupt Mask Set */ +#define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ +#define E1000_IMS_TXQE E1000_ICR_TXQE /* Transmit Queue empty */ +#define E1000_IMS_LSC E1000_ICR_LSC /* Link Status Change */ +#define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */ +#define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ +#define E1000_IMS_RXO E1000_ICR_RXO /* rx overrun */ +#define E1000_IMS_RXT0 E1000_ICR_RXT0 /* rx timer intr */ +#define E1000_IMS_MDAC E1000_ICR_MDAC /* MDIO access complete */ +#define E1000_IMS_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */ +#define E1000_IMS_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */ +#define E1000_IMS_GPI_EN1 E1000_ICR_GPI_EN1 /* GP Int 1 */ +#define E1000_IMS_GPI_EN2 E1000_ICR_GPI_EN2 /* GP Int 2 */ +#define E1000_IMS_GPI_EN3 E1000_ICR_GPI_EN3 /* GP Int 3 */ +#define E1000_IMS_TXD_LOW E1000_ICR_TXD_LOW +#define E1000_IMS_SRPD E1000_ICR_SRPD + +/* Interrupt Mask Clear */ +#define E1000_IMC_TXDW E1000_ICR_TXDW /* Transmit desc written back */ +#define E1000_IMC_TXQE E1000_ICR_TXQE /* Transmit Queue empty */ +#define E1000_IMC_LSC E1000_ICR_LSC /* Link Status Change */ +#define E1000_IMC_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */ +#define E1000_IMC_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ +#define E1000_IMC_RXO E1000_ICR_RXO /* rx overrun */ +#define E1000_IMC_RXT0 E1000_ICR_RXT0 /* rx timer intr */ +#define E1000_IMC_MDAC E1000_ICR_MDAC /* MDIO access complete */ +#define E1000_IMC_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */ +#define E1000_IMC_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */ +#define E1000_IMC_GPI_EN1 E1000_ICR_GPI_EN1 /* GP Int 1 */ +#define E1000_IMC_GPI_EN2 E1000_ICR_GPI_EN2 /* GP Int 2 */ +#define E1000_IMC_GPI_EN3 E1000_ICR_GPI_EN3 /* GP Int 3 */ +#define E1000_IMC_TXD_LOW E1000_ICR_TXD_LOW +#define E1000_IMC_SRPD E1000_ICR_SRPD + +/* Receive Control */ +#define E1000_RCTL_RST 0x00000001 /* Software reset */ +#define E1000_RCTL_EN 0x00000002 /* enable */ +#define E1000_RCTL_SBP 0x00000004 /* store bad packet */ +#define E1000_RCTL_UPE 0x00000008 /* unicast promiscuous enable */ +#define E1000_RCTL_MPE 0x00000010 /* multicast promiscuous enab */ +#define E1000_RCTL_LPE 0x00000020 /* long packet enable */ +#define E1000_RCTL_LBM_NO 0x00000000 /* no loopback mode */ +#define E1000_RCTL_LBM_MAC 0x00000040 /* MAC loopback mode */ +#define E1000_RCTL_LBM_SLP 0x00000080 /* serial link loopback mode */ +#define E1000_RCTL_LBM_TCVR 0x000000C0 /* tcvr loopback mode */ +#define E1000_RCTL_RDMTS_HALF 0x00000000 /* rx desc min threshold size */ +#define E1000_RCTL_RDMTS_QUAT 0x00000100 /* rx desc min threshold size */ +#define E1000_RCTL_RDMTS_EIGTH 0x00000200 /* rx desc min threshold size */ +#define E1000_RCTL_MO_SHIFT 12 /* multicast offset shift */ +#define E1000_RCTL_MO_0 0x00000000 /* multicast offset 11:0 */ +#define E1000_RCTL_MO_1 0x00001000 /* multicast offset 12:1 */ +#define E1000_RCTL_MO_2 0x00002000 /* multicast offset 13:2 */ +#define E1000_RCTL_MO_3 0x00003000 /* multicast offset 15:4 */ +#define E1000_RCTL_MDR 0x00004000 /* multicast desc ring 0 */ +#define E1000_RCTL_BAM 0x00008000 /* broadcast enable */ +/* these buffer sizes are valid if E1000_RCTL_BSEX is 0 */ +#define E1000_RCTL_SZ_2048 0x00000000 /* rx buffer size 2048 */ +#define E1000_RCTL_SZ_1024 0x00010000 /* rx buffer size 1024 */ +#define E1000_RCTL_SZ_512 0x00020000 /* rx buffer size 512 */ +#define E1000_RCTL_SZ_256 0x00030000 /* rx buffer size 256 */ +/* these buffer sizes are valid if E1000_RCTL_BSEX is 1 */ +#define E1000_RCTL_SZ_16384 0x00010000 /* rx buffer size 16384 */ +#define E1000_RCTL_SZ_8192 0x00020000 /* rx buffer size 8192 */ +#define E1000_RCTL_SZ_4096 0x00030000 /* rx buffer size 4096 */ +#define E1000_RCTL_VFE 0x00040000 /* vlan filter enable */ +#define E1000_RCTL_CFIEN 0x00080000 /* canonical form enable */ +#define E1000_RCTL_CFI 0x00100000 /* canonical form indicator */ +#define E1000_RCTL_DPF 0x00400000 /* discard pause frames */ +#define E1000_RCTL_PMCF 0x00800000 /* pass MAC control frames */ +#define E1000_RCTL_BSEX 0x02000000 /* Buffer size extension */ + +/* Receive Descriptor */ +#define E1000_RDT_DELAY 0x0000ffff /* Delay timer (1=1024us) */ +#define E1000_RDT_FPDB 0x80000000 /* Flush descriptor block */ +#define E1000_RDLEN_LEN 0x0007ff80 /* descriptor length */ +#define E1000_RDH_RDH 0x0000ffff /* receive descriptor head */ +#define E1000_RDT_RDT 0x0000ffff /* receive descriptor tail */ + +/* Flow Control */ +#define E1000_FCRTH_RTH 0x0000FFF8 /* Mask Bits[15:3] for RTH */ +#define E1000_FCRTH_XFCE 0x80000000 /* External Flow Control Enable */ +#define E1000_FCRTL_RTL 0x0000FFF8 /* Mask Bits[15:3] for RTL */ +#define E1000_FCRTL_XONE 0x80000000 /* Enable XON frame transmission */ + +/* Receive Descriptor Control */ +#define E1000_RXDCTL_PTHRESH 0x0000003F /* RXDCTL Prefetch Threshold */ +#define E1000_RXDCTL_HTHRESH 0x00003F00 /* RXDCTL Host Threshold */ +#define E1000_RXDCTL_WTHRESH 0x003F0000 /* RXDCTL Writeback Threshold */ +#define E1000_RXDCTL_GRAN 0x01000000 /* RXDCTL Granularity */ + +/* Transmit Descriptor Control */ +#define E1000_TXDCTL_PTHRESH 0x000000FF /* TXDCTL Prefetch Threshold */ +#define E1000_TXDCTL_HTHRESH 0x0000FF00 /* TXDCTL Host Threshold */ +#define E1000_TXDCTL_WTHRESH 0x00FF0000 /* TXDCTL Writeback Threshold */ +#define E1000_TXDCTL_GRAN 0x01000000 /* TXDCTL Granularity */ +#define E1000_TXDCTL_LWTHRESH 0xFE000000 /* TXDCTL Low Threshold */ + +/* Transmit Configuration Word */ +#define E1000_TXCW_FD 0x00000020 /* TXCW full duplex */ +#define E1000_TXCW_HD 0x00000040 /* TXCW half duplex */ +#define E1000_TXCW_PAUSE 0x00000080 /* TXCW sym pause request */ +#define E1000_TXCW_ASM_DIR 0x00000100 /* TXCW astm pause direction */ +#define E1000_TXCW_PAUSE_MASK 0x00000180 /* TXCW pause request mask */ +#define E1000_TXCW_RF 0x00003000 /* TXCW remote fault */ +#define E1000_TXCW_NP 0x00008000 /* TXCW next page */ +#define E1000_TXCW_CW 0x0000ffff /* TxConfigWord mask */ +#define E1000_TXCW_TXC 0x40000000 /* Transmit Config control */ +#define E1000_TXCW_ANE 0x80000000 /* Auto-neg enable */ + +/* Receive Configuration Word */ +#define E1000_RXCW_CW 0x0000ffff /* RxConfigWord mask */ +#define E1000_RXCW_NC 0x04000000 /* Receive config no carrier */ +#define E1000_RXCW_IV 0x08000000 /* Receive config invalid */ +#define E1000_RXCW_CC 0x10000000 /* Receive config change */ +#define E1000_RXCW_C 0x20000000 /* Receive config */ +#define E1000_RXCW_SYNCH 0x40000000 /* Receive config synch */ +#define E1000_RXCW_ANC 0x80000000 /* Auto-neg complete */ + +/* Transmit Control */ +#define E1000_TCTL_RST 0x00000001 /* software reset */ +#define E1000_TCTL_EN 0x00000002 /* enable tx */ +#define E1000_TCTL_BCE 0x00000004 /* busy check enable */ +#define E1000_TCTL_PSP 0x00000008 /* pad short packets */ +#define E1000_TCTL_CT 0x00000ff0 /* collision threshold */ +#define E1000_TCTL_COLD 0x003ff000 /* collision distance */ +#define E1000_TCTL_SWXOFF 0x00400000 /* SW Xoff transmission */ +#define E1000_TCTL_PBE 0x00800000 /* Packet Burst Enable */ +#define E1000_TCTL_RTLC 0x01000000 /* Re-transmit on late collision */ +#define E1000_TCTL_NRTU 0x02000000 /* No Re-transmit on underrun */ + +/* Receive Checksum Control */ +#define E1000_RXCSUM_PCSS_MASK 0x000000FF /* Packet Checksum Start */ +#define E1000_RXCSUM_IPOFL 0x00000100 /* IPv4 checksum offload */ +#define E1000_RXCSUM_TUOFL 0x00000200 /* TCP / UDP checksum offload */ +#define E1000_RXCSUM_IPV6OFL 0x00000400 /* IPv6 checksum offload */ + +/* Definitions for power management and wakeup registers */ +/* Wake Up Control */ +#define E1000_WUC_APME 0x00000001 /* APM Enable */ +#define E1000_WUC_PME_EN 0x00000002 /* PME Enable */ +#define E1000_WUC_PME_STATUS 0x00000004 /* PME Status */ +#define E1000_WUC_APMPME 0x00000008 /* Assert PME on APM Wakeup */ + +/* Wake Up Filter Control */ +#define E1000_WUFC_LNKC 0x00000001 /* Link Status Change Wakeup Enable */ +#define E1000_WUFC_MAG 0x00000002 /* Magic Packet Wakeup Enable */ +#define E1000_WUFC_EX 0x00000004 /* Directed Exact Wakeup Enable */ +#define E1000_WUFC_MC 0x00000008 /* Directed Multicast Wakeup Enable */ +#define E1000_WUFC_BC 0x00000010 /* Broadcast Wakeup Enable */ +#define E1000_WUFC_ARP 0x00000020 /* ARP Request Packet Wakeup Enable */ +#define E1000_WUFC_IPV4 0x00000040 /* Directed IPv4 Packet Wakeup Enable */ +#define E1000_WUFC_IPV6 0x00000080 /* Directed IPv6 Packet Wakeup Enable */ +#define E1000_WUFC_FLX0 0x00010000 /* Flexible Filter 0 Enable */ +#define E1000_WUFC_FLX1 0x00020000 /* Flexible Filter 1 Enable */ +#define E1000_WUFC_FLX2 0x00040000 /* Flexible Filter 2 Enable */ +#define E1000_WUFC_FLX3 0x00080000 /* Flexible Filter 3 Enable */ +#define E1000_WUFC_ALL_FILTERS 0x000F00FF /* Mask for all wakeup filters */ +#define E1000_WUFC_FLX_OFFSET 16 /* Offset to the Flexible Filters bits */ +#define E1000_WUFC_FLX_FILTERS 0x000F0000 /* Mask for the 4 flexible filters */ + +/* Wake Up Status */ +#define E1000_WUS_LNKC 0x00000001 /* Link Status Changed */ +#define E1000_WUS_MAG 0x00000002 /* Magic Packet Received */ +#define E1000_WUS_EX 0x00000004 /* Directed Exact Received */ +#define E1000_WUS_MC 0x00000008 /* Directed Multicast Received */ +#define E1000_WUS_BC 0x00000010 /* Broadcast Received */ +#define E1000_WUS_ARP 0x00000020 /* ARP Request Packet Received */ +#define E1000_WUS_IPV4 0x00000040 /* Directed IPv4 Packet Wakeup Received */ +#define E1000_WUS_IPV6 0x00000080 /* Directed IPv6 Packet Wakeup Received */ +#define E1000_WUS_FLX0 0x00010000 /* Flexible Filter 0 Match */ +#define E1000_WUS_FLX1 0x00020000 /* Flexible Filter 1 Match */ +#define E1000_WUS_FLX2 0x00040000 /* Flexible Filter 2 Match */ +#define E1000_WUS_FLX3 0x00080000 /* Flexible Filter 3 Match */ +#define E1000_WUS_FLX_FILTERS 0x000F0000 /* Mask for the 4 flexible filters */ + +/* Management Control */ +#define E1000_MANC_SMBUS_EN 0x00000001 /* SMBus Enabled - RO */ +#define E1000_MANC_ASF_EN 0x00000002 /* ASF Enabled - RO */ +#define E1000_MANC_R_ON_FORCE 0x00000004 /* Reset on Force TCO - RO */ +#define E1000_MANC_RMCP_EN 0x00000100 /* Enable RCMP 026Fh Filtering */ +#define E1000_MANC_0298_EN 0x00000200 /* Enable RCMP 0298h Filtering */ +#define E1000_MANC_IPV4_EN 0x00000400 /* Enable IPv4 */ +#define E1000_MANC_IPV6_EN 0x00000800 /* Enable IPv6 */ +#define E1000_MANC_SNAP_EN 0x00001000 /* Accept LLC/SNAP */ +#define E1000_MANC_ARP_EN 0x00002000 /* Enable ARP Request Filtering */ +#define E1000_MANC_NEIGHBOR_EN 0x00004000 /* Enable Neighbor Discovery + * Filtering */ +#define E1000_MANC_TCO_RESET 0x00010000 /* TCO Reset Occurred */ +#define E1000_MANC_RCV_TCO_EN 0x00020000 /* Receive TCO Packets Enabled */ +#define E1000_MANC_REPORT_STATUS 0x00040000 /* Status Reporting Enabled */ +#define E1000_MANC_SMB_REQ 0x01000000 /* SMBus Request */ +#define E1000_MANC_SMB_GNT 0x02000000 /* SMBus Grant */ +#define E1000_MANC_SMB_CLK_IN 0x04000000 /* SMBus Clock In */ +#define E1000_MANC_SMB_DATA_IN 0x08000000 /* SMBus Data In */ +#define E1000_MANC_SMB_DATA_OUT 0x10000000 /* SMBus Data Out */ +#define E1000_MANC_SMB_CLK_OUT 0x20000000 /* SMBus Clock Out */ + +#define E1000_MANC_SMB_DATA_OUT_SHIFT 28 /* SMBus Data Out Shift */ +#define E1000_MANC_SMB_CLK_OUT_SHIFT 29 /* SMBus Clock Out Shift */ + +/* Wake Up Packet Length */ +#define E1000_WUPL_LENGTH_MASK 0x0FFF /* Only the lower 12 bits are valid */ + +#define E1000_MDALIGN 4096 + +/* EEPROM Commands */ +#define EEPROM_READ_OPCODE 0x6 /* EERPOM read opcode */ +#define EEPROM_WRITE_OPCODE 0x5 /* EERPOM write opcode */ +#define EEPROM_ERASE_OPCODE 0x7 /* EERPOM erase opcode */ +#define EEPROM_EWEN_OPCODE 0x13 /* EERPOM erase/write enable */ +#define EEPROM_EWDS_OPCODE 0x10 /* EERPOM erast/write disable */ + +/* EEPROM Word Offsets */ +#define EEPROM_INIT_CONTROL1_REG 0x000A +#define EEPROM_INIT_CONTROL2_REG 0x000F +#define EEPROM_FLASH_VERSION 0x0032 +#define EEPROM_CHECKSUM_REG 0x003F + +/* Mask bits for fields in Word 0x0a of the EEPROM */ +#define EEPROM_WORD0A_ILOS 0x0010 +#define EEPROM_WORD0A_SWDPIO 0x01E0 +#define EEPROM_WORD0A_LRST 0x0200 +#define EEPROM_WORD0A_FD 0x0400 +#define EEPROM_WORD0A_66MHZ 0x0800 + +/* Mask bits for fields in Word 0x0f of the EEPROM */ +#define EEPROM_WORD0F_PAUSE_MASK 0x3000 +#define EEPROM_WORD0F_PAUSE 0x1000 +#define EEPROM_WORD0F_ASM_DIR 0x2000 +#define EEPROM_WORD0F_ANE 0x0800 +#define EEPROM_WORD0F_SWPDIO_EXT 0x00F0 + +/* For checksumming, the sum of all words in the EEPROM should equal 0xBABA. */ +#define EEPROM_SUM 0xBABA + +/* EEPROM Map defines (WORD OFFSETS)*/ +#define EEPROM_NODE_ADDRESS_BYTE_0 0 +#define EEPROM_PBA_BYTE_1 8 + +/* EEPROM Map Sizes (Byte Counts) */ +#define PBA_SIZE 4 + +/* Collision related configuration parameters */ +#define E1000_COLLISION_THRESHOLD 16 +#define E1000_CT_SHIFT 4 +#define E1000_FDX_COLLISION_DISTANCE 64 +#define E1000_HDX_COLLISION_DISTANCE 64 +#define E1000_GB_HDX_COLLISION_DISTANCE 512 +#define E1000_COLD_SHIFT 12 + +/* The number of Transmit and Receive Descriptors must be a multiple of 8 */ +#define REQ_TX_DESCRIPTOR_MULTIPLE 8 +#define REQ_RX_DESCRIPTOR_MULTIPLE 8 + +/* Default values for the transmit IPG register */ +#define DEFAULT_82542_TIPG_IPGT 10 +#define DEFAULT_82543_TIPG_IPGT_FIBER 9 +#define DEFAULT_82543_TIPG_IPGT_COPPER 8 + +#define E1000_TIPG_IPGT_MASK 0x000003FF +#define E1000_TIPG_IPGR1_MASK 0x000FFC00 +#define E1000_TIPG_IPGR2_MASK 0x3FF00000 + +#define DEFAULT_82542_TIPG_IPGR1 2 +#define DEFAULT_82543_TIPG_IPGR1 8 +#define E1000_TIPG_IPGR1_SHIFT 10 + +#define DEFAULT_82542_TIPG_IPGR2 10 +#define DEFAULT_82543_TIPG_IPGR2 6 +#define E1000_TIPG_IPGR2_SHIFT 20 + +#define E1000_TXDMAC_DPP 0x00000001 + +/* PBA constants */ +#define E1000_PBA_16K 0x0010 /* 16KB, default TX allocation */ +#define E1000_PBA_24K 0x0018 +#define E1000_PBA_40K 0x0028 +#define E1000_PBA_48K 0x0030 /* 48KB, default RX allocation */ + +/* Flow Control Constants */ +#define FLOW_CONTROL_ADDRESS_LOW 0x00C28001 +#define FLOW_CONTROL_ADDRESS_HIGH 0x00000100 +#define FLOW_CONTROL_TYPE 0x8808 + +/* The historical defaults for the flow control values are given below. */ +#define FC_DEFAULT_HI_THRESH (0x8000) /* 32KB */ +#define FC_DEFAULT_LO_THRESH (0x4000) /* 16KB */ +#define FC_DEFAULT_TX_TIMER (0x100) /* ~130 us */ + + +/* The number of bits that we need to shift right to move the "pause" + * bits from the EEPROM (bits 13:12) to the "pause" (bits 8:7) field + * in the TXCW register + */ +#define PAUSE_SHIFT 5 + +/* The number of bits that we need to shift left to move the "SWDPIO" + * bits from the EEPROM (bits 8:5) to the "SWDPIO" (bits 25:22) field + * in the CTRL register + */ +#define SWDPIO_SHIFT 17 + +/* The number of bits that we need to shift left to move the "SWDPIO_EXT" + * bits from the EEPROM word F (bits 7:4) to the bits 11:8 of The + * Extended CTRL register. + * in the CTRL register + */ +#define SWDPIO__EXT_SHIFT 4 + +/* The number of bits that we need to shift left to move the "ILOS" + * bit from the EEPROM (bit 4) to the "ILOS" (bit 7) field + * in the CTRL register + */ +#define ILOS_SHIFT 3 + + +#define RECEIVE_BUFFER_ALIGN_SIZE (256) + +/* The number of milliseconds we wait for auto-negotiation to complete */ +#define LINK_UP_TIMEOUT 500 + +#define E1000_TX_BUFFER_SIZE ((uint32_t)1514) + +/* The carrier extension symbol, as received by the NIC. */ +#define CARRIER_EXTENSION 0x0F + +/* TBI_ACCEPT macro definition: + * + * This macro requires: + * adapter = a pointer to struct e1000_shared_adapter + * status = the 8 bit status field of the RX descriptor with EOP set + * error = the 8 bit error field of the RX descriptor with EOP set + * length = the sum of all the length fields of the RX descriptors that + * make up the current frame + * last_byte = the last byte of the frame DMAed by the hardware + * max_frame_length = the maximum frame length we want to accept. + * min_frame_length = the minimum frame length we want to accept. + * + * This macro is a conditional that should be used in the interrupt + * handler's Rx processing routine when RxErrors have been detected. + * + * Typical use: + * ... + * if (TBI_ACCEPT) { + * accept_frame = TRUE; + * e1000_tbi_adjust_stats(adapter, MacAddress); + * frame_length--; + * } else { + * accept_frame = FALSE; + * } + * ... + */ + +#define TBI_ACCEPT(adapter, status, errors, length, last_byte) \ + ((adapter)->tbi_compatibility_on && \ + (((errors) & E1000_RXD_ERR_FRAME_ERR_MASK) == E1000_RXD_ERR_CE) && \ + ((last_byte) == CARRIER_EXTENSION) && \ + (((status) & E1000_RXD_STAT_VP) ? \ + (((length) > ((adapter)->min_frame_size - VLAN_TAG_SIZE)) && \ + ((length) <= ((adapter)->max_frame_size + 1))) : \ + (((length) > (adapter)->min_frame_size) && \ + ((length) <= ((adapter)->max_frame_size + VLAN_TAG_SIZE + 1))))) + + +#endif /* _E1000_MAC_H_ */ diff -urN linux-2.4.18/drivers/net/e1000/e1000_main.c lia64-2.4/drivers/net/e1000/e1000_main.c --- linux-2.4.18/drivers/net/e1000/e1000_main.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/e1000/e1000_main.c Fri Jul 19 17:19:35 2002 @@ -0,0 +1,3780 @@ +/******************************************************************************* + + This software program is available to you under a choice of one of two + licenses. You may choose to be licensed under either the GNU General Public + License (GPL) Version 2, June 1991, available at + http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the + text of which follows: + + Recipient has requested a license and Intel Corporation ("Intel") is willing + to grant a license for the software entitled Linux Base Driver for the + Intel(R) PRO/1000 Family of Adapters (e1000) (the "Software") being provided + by Intel Corporation. The following definitions apply to this license: + + "Licensed Patents" means patent claims licensable by Intel Corporation which + are necessarily infringed by the use of sale of the Software alone or when + combined with the operating system referred to below. + + "Recipient" means the party to whom Intel delivers this Software. + + "Licensee" means Recipient and those third parties that receive a license to + any operating system available under the GNU Public License version 2.0 or + later. + + Copyright (c) 1999 - 2002 Intel Corporation. + All rights reserved. + + The license is provided to Recipient and Recipient's Licensees under the + following terms. + + Redistribution and use in source and binary forms of the Software, with or + without modification, are permitted provided that the following conditions + are met: + + Redistributions of source code of the Software may retain the above + copyright notice, this list of conditions and the following disclaimer. + + Redistributions in binary form of the Software may reproduce the above + copyright notice, this list of conditions and the following disclaimer in + the documentation and/or materials provided with the distribution. + + Neither the name of Intel Corporation nor the names of its contributors + shall be used to endorse or promote products derived from this Software + without specific prior written permission. + + Intel hereby grants Recipient and Licensees a non-exclusive, worldwide, + royalty-free patent license under Licensed Patents to make, use, sell, offer + to sell, import and otherwise transfer the Software, if any, in source code + and object code form. This license shall include changes to the Software + that are error corrections or other minor changes to the Software that do + not add functionality or features when the Software is incorporated in any + version of an operating system that has been distributed under the GNU + General Public License 2.0 or later. This patent license shall apply to the + combination of the Software and any operating system licensed under the GNU + Public License version 2.0 or later if, at the time Intel provides the + Software to Recipient, such addition of the Software to the then publicly + available versions of such operating systems available under the GNU Public + License version 2.0 or later (whether in gold, beta or alpha form) causes + such combination to be covered by the Licensed Patents. The patent license + shall not apply to any other combinations which include the Software. NO + hardware per se is licensed hereunder. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR IT CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + ANY LOSS OF USE; DATA, OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + + +#define __E1000_MAIN__ +#ifdef IANS +#define _IANS_MAIN_MODULE_C_ +#endif +#include "e1000.h" + +/* Driver name string */ +char e1000_driver_name[] = "e1000"; + +/* Driver ID string, displayed when loading */ +char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; + +/* Driver version */ +char e1000_driver_version[] = "4.1.7"; + +/* Copyright string, displayed when loading */ +char e1000_copyright[] = "Copyright (c) 1999-2002 Intel Corporation."; + +/* Linked list of board private structures for all NICs found */ +struct e1000_adapter *e1000_adapter_list = NULL; + +/* e1000_strings - PCI Device ID Table + * + * for selecting devices to load on + * private driver_data field (last one) stores an index + * into e1000_strings + * Wildcard entries (PCI_ANY_ID) should come last + * Last entry must be all 0s + * + * { Vendor ID, Device ID, SubVendor ID, SubDevice ID, + * Class, Class Mask, String Index } + */ +static struct pci_device_id e1000_pci_table[] = { + /* Intel(R) PRO/1000 Network Connection */ + {0x8086, 0x1000, 0x8086, 0x1000, 0, 0, 0}, + {0x8086, 0x1001, 0x8086, 0x1003, 0, 0, 0}, + {0x8086, 0x1004, 0x8086, 0x1004, 0, 0, 0}, + {0x8086, 0x1008, 0x8086, 0x1107, 0, 0, 0}, + {0x8086, 0x1009, 0x8086, 0x1109, 0, 0, 0}, + {0x8086, 0x100C, 0x8086, 0x1112, 0, 0, 0}, + {0x8086, 0x100E, 0x8086, 0x001E, 0, 0, 0}, + /* Compaq Gigabit Ethernet Server Adapter */ + {0x8086, 0x1000, 0x0E11, PCI_ANY_ID, 0, 0, 1}, + {0x8086, 0x1001, 0x0E11, PCI_ANY_ID, 0, 0, 1}, + {0x8086, 0x1004, 0x0E11, PCI_ANY_ID, 0, 0, 1}, + /* IBM Mobile, Desktop & Server Adapters */ + {0x8086, 0x1000, 0x1014, PCI_ANY_ID, 0, 0, 2}, + {0x8086, 0x1001, 0x1014, PCI_ANY_ID, 0, 0, 2}, + {0x8086, 0x1004, 0x1014, PCI_ANY_ID, 0, 0, 2}, + /* Generic */ + {0x8086, 0x1000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x100C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x100D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x100E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + /* required last entry */ + {0,} +}; + +MODULE_DEVICE_TABLE(pci, e1000_pci_table); + +/* e1000_pci_table - Table of branding strings for all supported NICs. */ + +static char *e1000_strings[] = { + "Intel(R) PRO/1000 Network Connection", + "Compaq Gigabit Ethernet Server Adapter", + "IBM Mobile, Desktop & Server Adapters" +}; + +/* PCI driver information (Linux 2.4 driver API) */ +static struct pci_driver e1000_driver = { + name: e1000_driver_name, + id_table: e1000_pci_table, + probe: e1000_probe, + remove: e1000_remove, + /* Power Managment Hooks */ + suspend: NULL, + resume: NULL +}; + +/* Module Parameters are always initialized to -1, so that the driver + * can tell the difference between no user specified value or the + * user asking for the default value. + * The true default values are loaded in when e1000_check_options is called. + */ + +/* This is the only thing that needs to be changed to adjust the + * maximum number of ports that the driver can manage. + */ + +#define E1000_MAX_NIC 8 + +/* This is a GCC extension to ANSI C. + * See the item "Labeled Elements in Initializers" in the section + * "Extensions to the C Language Family" of the GCC documentation. + */ + +#define E1000_OPTION_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET } + +/* Transmit Descriptor Count + * + * Valid Range: 80-256 for 82542 and 82543 gigabit ethernet controllers + * Valid Range: 80-4096 for 82544 + * + * Default Value: 256 + */ + +static int TxDescriptors[E1000_MAX_NIC + 1] = E1000_OPTION_INIT; + +/* Receive Descriptor Count + * + * Valid Range: 80-256 for 82542 and 82543 gigabit ethernet controllers + * Valid Range: 80-4096 for 82544 + * + * Default Value: 256 + */ + +static int RxDescriptors[E1000_MAX_NIC + 1] = E1000_OPTION_INIT; + +/* User Specified Speed Override + * + * Valid Range: 0, 10, 100, 1000 + * - 0 - auto-negotiate at all supported speeds + * - 10 - only link at 10 Mbps + * - 100 - only link at 100 Mbps + * - 1000 - only link at 1000 Mbps + * + * Default Value: 0 + */ + +static int Speed[E1000_MAX_NIC + 1] = E1000_OPTION_INIT; + +/* User Specified Duplex Override + * + * Valid Range: 0-2 + * - 0 - auto-negotiate for duplex + * - 1 - only link at half duplex + * - 2 - only link at full duplex + * + * Default Value: 0 + */ + +static int Duplex[E1000_MAX_NIC + 1] = E1000_OPTION_INIT; + +/* Auto-negotiation Advertisement Override + * + * Valid Range: 0x00-0x0F, 0x20-0x2F + * + * The AutoNeg value is a bit mask describing which speed and duplex + * combinations should be advertised during auto-negotiation. + * The supported speed and duplex modes are listed below + * + * Bit 7 6 5 4 3 2 1 0 + * Speed (Mbps) N/A N/A 1000 N/A 100 100 10 10 + * Duplex Full Full Half Full Half + * + * Default Value: 0x2F + */ + +static int AutoNeg[E1000_MAX_NIC + 1] = E1000_OPTION_INIT; + +/* User Specified Flow Control Override + * + * Valid Range: 0-3 + * - 0 - No Flow Control + * - 1 - Rx only, respond to PAUSE frames but do not generate them + * - 2 - Tx only, generate PAUSE frames but ignore them on receive + * - 3 - Full Flow Control Support + * + * Default Value: Read flow control settings from the EEPROM + */ + +static int FlowControl[E1000_MAX_NIC + 1] = E1000_OPTION_INIT; + +/* XsumRX - Receive Checksum Offload Enable/Disable + * + * Valid Range: 0, 1 + * - 0 - disables all checksum offload + * - 1 - enables receive IP/TCP/UDP checksum offload + * on 82543 based NICs + * + * Default Value: 1 + */ + +static int XsumRX[E1000_MAX_NIC + 1] = E1000_OPTION_INIT; + +/* Transmit Interrupt Delay in units of 1.024 microseconds + * + * Valid Range: 0-65535 + * + * Default Value: 64 + */ + +static int TxIntDelay[E1000_MAX_NIC + 1] = E1000_OPTION_INIT; + +/* Receive Interrupt Delay in units of 1.024 microseconds + * + * Valid Range: 0-65535 + * + * Default Value: 64 + */ + +static int RxIntDelay[E1000_MAX_NIC + 1] = E1000_OPTION_INIT; + +/* MDI-X Support Enable/Disable - Applies only to Copper PHY + * + * Valid Range: 0, 3 + * - 0 - Auto in all modes + * - 1 - MDI + * - 2 - MDI-X + * - 3 - Auto in 1000 Base-T mode (MDI in 10 Base-T and 100 Base-T) + * + * Default Value: 0 (Auto) + */ + +static int MdiX[E1000_MAX_NIC + 1] = E1000_OPTION_INIT; + +/* Automatic Correction of Reversed Cable Polarity Enable/Disable + * This setting applies only to Copper PHY + * + * Valid Range: 0, 1 + * - 0 - Disabled + * - 1 - Enabled + * + * Default Value: 1 (Enabled) + */ + +static int DisablePolarityCorrection[E1000_MAX_NIC + 1] = E1000_OPTION_INIT; + +#ifdef MODULE + +MODULE_AUTHOR("Intel Corporation, "); +MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver"); + +#if defined(MODULE_LICENSE) +MODULE_LICENSE("BSD with patent grant"); +#endif + +MODULE_PARM(TxDescriptors, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); +MODULE_PARM(RxDescriptors, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); +MODULE_PARM(Speed, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); +MODULE_PARM(Duplex, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); +MODULE_PARM(AutoNeg, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); +MODULE_PARM(XsumRX, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); +MODULE_PARM(FlowControl, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); +MODULE_PARM(TxIntDelay, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); +MODULE_PARM(RxIntDelay, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); +MODULE_PARM(MdiX, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); +MODULE_PARM(DisablePolarityCorrection, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); + +MODULE_PARM_DESC(TxDescriptors, "Number of transmit descriptors"); +MODULE_PARM_DESC(RxDescriptors, "Number of receive descriptors"); +MODULE_PARM_DESC(Speed, "Speed setting"); +MODULE_PARM_DESC(Duplex, "Duplex setting"); +MODULE_PARM_DESC(AutoNeg, "Advertised auto-negotiation setting"); +MODULE_PARM_DESC(XsumRX, "Disable or enable Receive Checksum offload"); +MODULE_PARM_DESC(FlowControl, "Flow Control setting"); +MODULE_PARM_DESC(TxIntDelay, "Transmit Interrupt Delay"); +MODULE_PARM_DESC(RxIntDelay, "Receive Interrupt Delay"); +MODULE_PARM_DESC(MdiX, "Set MDI/MDI-X Mode"); +MODULE_PARM_DESC(DisablePolarityCorrection, + "Disable or enable Automatic Correction for Reversed Cable Polarity"); + +#ifdef EXPORT_SYMTAB +/*EXPORT_SYMBOL(e1000_init_module); +EXPORT_SYMBOL(e1000_exit_module); +EXPORT_SYMBOL(e1000_probe); +EXPORT_SYMBOL(e1000_remove); +EXPORT_SYMBOL(e1000_open); +EXPORT_SYMBOL(e1000_close); +EXPORT_SYMBOL(e1000_xmit_frame); +EXPORT_SYMBOL(e1000_intr); +EXPORT_SYMBOL(e1000_set_multi); +EXPORT_SYMBOL(e1000_change_mtu); +EXPORT_SYMBOL(e1000_set_mac); +EXPORT_SYMBOL(e1000_get_stats); +EXPORT_SYMBOL(e1000_watchdog); +EXPORT_SYMBOL(e1000_ioctl); +EXPORT_SYMBOL(e1000_adapter_list);*/ +#endif + +#endif + +/* Local Function Prototypes */ + +static void e1000_check_options(struct e1000_adapter *adapter); +static void e1000_check_fiber_options(struct e1000_adapter *adapter); +static void e1000_check_copper_options(struct e1000_adapter *adapter); +static int e1000_sw_init(struct e1000_adapter *adapter); +static int e1000_hw_init(struct e1000_adapter *adapter); +static void e1000_read_address(struct e1000_adapter *adapter, + uint8_t *addr); +static int e1000_setup_tx_resources(struct e1000_adapter *adapter); +static int e1000_setup_rx_resources(struct e1000_adapter *adapter); +static void e1000_setup_rctl(struct e1000_adapter *adapter); +static void e1000_configure_rx(struct e1000_adapter *adapter); +static void e1000_configure_tx(struct e1000_adapter *adapter); +static void e1000_free_tx_resources(struct e1000_adapter *adapter); +static void e1000_free_rx_resources(struct e1000_adapter *adapter); +static void e1000_update_stats(struct e1000_adapter *adapter); +static inline void e1000_irq_disable(struct e1000_adapter *adapter); +static inline void e1000_irq_enable(struct e1000_adapter *adapter); +static void e1000_clean_tx_irq(struct e1000_adapter *adapter); +static void e1000_clean_rx_irq(struct e1000_adapter *adapter); +static inline void e1000_rx_checksum(struct e1000_adapter *adapter, + struct e1000_rx_desc *rx_desc, + struct sk_buff *skb); +static void e1000_alloc_rx_buffers(unsigned long data); +static void e1000_clean_tx_ring(struct e1000_adapter *adapter); +static void e1000_clean_rx_ring(struct e1000_adapter *adapter); +void e1000_hibernate_adapter(struct net_device *netdev); +void e1000_wakeup_adapter(struct net_device *netdev); +static void e1000_enable_WOL(struct e1000_adapter *adapter); + +#ifdef SIOCETHTOOL +static int e1000_ethtool_ioctl(struct net_device *netdev, + struct ifreq *ifr); +#endif +#ifdef IDIAG +static int e1000_check_lbtest_frame(struct sk_buff *skb, + unsigned int frame_size); +#endif + +/** + * e1000_init_module - Driver Registration Routine + * + * e1000_init_module is the first routine called when the driver is + * loaded. All it does is register with the PCI subsystem. + **/ + +int +e1000_init_module() +{ + E1000_DBG("e1000_init_module\n"); + + /* Print the driver ID string and copyright notice */ + + printk("%s - version %s\n%s\n", e1000_driver_string, e1000_driver_version, + e1000_copyright); + + /* register the driver with the PCI subsystem */ + + return pci_module_init(&e1000_driver); +} + +/* this macro creates a special symbol in the object file that + * identifies the driver initialization routine + */ +module_init(e1000_init_module); + +/** + * e1000_exit_module - Driver Exit Cleanup Routine + * + * e1000_exit_module is called just before the driver is removed + * from memory. + **/ + +void +e1000_exit_module() +{ +#ifdef CONFIG_PROC_FS + struct proc_dir_entry *de; +#endif + + E1000_DBG("e1000_exit_module\n"); + + pci_unregister_driver(&e1000_driver); + +#ifdef CONFIG_PROC_FS + /* if there is no e1000_proc_dir (proc creation failure on load) + * then we're done + */ + if(e1000_proc_dir == NULL) + return; + + /* If ADAPTERS_PROC_DIR (/proc/net/PRO_LAN_Adapters) is empty + * it can be removed now (might still be in use by e100) + */ + for(de = e1000_proc_dir->subdir; de; de = de->next) { + + /* ignore . and .. */ + + if(*(de->name) == '.') + continue; + break; + } + if(de) + return; + remove_proc_entry(ADAPTERS_PROC_DIR, proc_net); +#endif + + return; +} + +/* this macro creates a special symbol in the object file that + * identifies the driver cleanup routine + */ +module_exit(e1000_exit_module); + +/** + * e1000_probe - Device Initialization Routine + * @pdev: PCI device information struct + * @ent: entry in e1000_pci_table + * + * Returns 0 on success, negative on failure + * + * e1000_probe initializes an adapter identified by a pci_dev + * structure. The OS initialization is handled here, and + * e1000_sw_init and e1000_hw_init are called to handle the driver + * specific software structures and hardware initialization + * respectively. + **/ + +int +e1000_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + struct net_device *netdev = NULL; + struct e1000_adapter *adapter; + static int cards_found = 0; + +#ifdef CONFIG_PROC_FS + int len; +#endif + + E1000_DBG("e1000_probe\n"); + + /* Make sure the PCI device has the proper resources available */ + + if(pci_enable_device(pdev) != 0) { + E1000_ERR("pci_enable_device failed\n"); + return -ENODEV; + } + + /* Make sure we are enabled as a bus mastering device */ + + pci_set_master(pdev); + + /* Check to see if our PCI addressing needs are supported */ + if(pci_set_dma_mask(pdev, E1000_DMA_MASK) < 0) { + E1000_ERR("PCI DMA not supported by the system\n"); + return -ENODEV; + } + + /* Allocate private data structure (struct e1000_adapter) + */ + netdev = alloc_etherdev(sizeof(struct e1000_adapter)); + + if(netdev == NULL) { + E1000_ERR("Unable to allocate net_device struct\n"); + return -ENOMEM; + } + + /* Calling alloc_etherdev with sizeof(struct e1000_adapter) allocates + * a single buffer of size net_device + struct e1000_adapter + + * alignment. If this is not done then the struct e1000_adapter needs + * to be allocated and freed separately. + */ + adapter = (struct e1000_adapter *) netdev->priv; + memset(adapter, 0, sizeof(struct e1000_adapter)); + adapter->netdev = netdev; + adapter->pdev = pdev; + + /* link the struct e1000_adapter into the list */ + + if(e1000_adapter_list != NULL) + e1000_adapter_list->prev = adapter; + adapter->next = e1000_adapter_list; + e1000_adapter_list = adapter; + adapter->shared.back = (void *) adapter; + + /* reserve the MMIO region as ours */ + + if(!request_mem_region + (pci_resource_start(pdev, BAR_0), pci_resource_len(pdev, BAR_0), + e1000_driver_name)) { + E1000_ERR("request_mem_region failed\n"); + e1000_remove(pdev); + return -ENODEV; + } + + /* map the MMIO region into the kernel virtual address space */ + + adapter->shared.hw_addr = + ioremap(pci_resource_start(pdev, BAR_0), pci_resource_len(pdev, BAR_0)); + + if(adapter->shared.hw_addr == NULL) { + E1000_ERR("ioremap failed\n"); + release_mem_region(pci_resource_start(pdev, BAR_0), + pci_resource_len(pdev, BAR_0)); + e1000_remove(pdev); + return -ENOMEM; + } + + /* don't actually register the interrupt handler until e1000_open */ + + netdev->irq = pdev->irq; + + /* Set the MMIO base address for the NIC */ + +#ifdef IANS + netdev->base_addr = pci_resource_start(pdev, BAR_0); +#endif + netdev->mem_start = pci_resource_start(pdev, BAR_0); + netdev->mem_end = netdev->mem_start + pci_resource_len(pdev, BAR_0); + + /* set up function pointers to driver entry points */ + + netdev->open = &e1000_open; + netdev->stop = &e1000_close; + netdev->hard_start_xmit = &e1000_xmit_frame; + netdev->get_stats = &e1000_get_stats; + netdev->set_multicast_list = &e1000_set_multi; + netdev->set_mac_address = &e1000_set_mac; + netdev->change_mtu = &e1000_change_mtu; + netdev->do_ioctl = &e1000_ioctl; + + /* set up the struct e1000_adapter */ + + adapter->bd_number = cards_found; + adapter->id_string = e1000_strings[ent->driver_data]; + printk("\n%s\n", adapter->id_string); + + /* Order is important here. e1000_sw_init also identifies the + * hardware, so that e1000_check_options can treat command line parameters + * differently depending on the hardware. + */ + e1000_sw_init(adapter); + e1000_check_options(adapter); + +#ifdef MAX_SKB_FRAGS + if(adapter->shared.mac_type >= e1000_82543) { + netdev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_HIGHDMA; + } else { + netdev->features = NETIF_F_SG | NETIF_F_HIGHDMA; + } +#endif + +#ifdef IANS + adapter->iANSdata = kmalloc(sizeof(iANSsupport_t), GFP_KERNEL); + if(adapter->iANSdata == NULL) { + e1000_remove(pdev); + return -ENOMEM; + } + memset(adapter->iANSdata, 0, sizeof(iANSsupport_t)); + bd_ans_drv_InitANS(adapter, adapter->iANSdata); +#endif + + /* finally, we get around to setting up the hardware */ + + if(e1000_hw_init(adapter) < 0) { + e1000_remove(pdev); + return -ENODEV; + } + cards_found++; + + /* reset stats */ + + e1000_clear_hw_cntrs(&adapter->shared); + e1000_phy_get_info(&adapter->shared, &adapter->phy_info); + + /* Then register the net device once everything initializes + */ + register_netdev(netdev); + +#ifdef CONFIG_PROC_FS + /* set up the proc fs entry */ + + len = strlen(ADAPTERS_PROC_DIR); + + for(e1000_proc_dir = proc_net->subdir; e1000_proc_dir; + e1000_proc_dir = e1000_proc_dir->next) { + if((e1000_proc_dir->namelen == len) && + (memcmp(e1000_proc_dir->name, ADAPTERS_PROC_DIR, len) == 0)) + break; + } + + if(e1000_proc_dir == NULL) + e1000_proc_dir = + create_proc_entry(ADAPTERS_PROC_DIR, S_IFDIR, proc_net); + + if(e1000_proc_dir != NULL) + if(e1000_create_proc_dev(adapter) < 0) { + e1000_remove_proc_dev(adapter->netdev); + } +#endif + + /* print the link status */ + + if(adapter->link_active == 1) + printk("%s: Mem:0x%p IRQ:%d Speed:%d Mbps Duplex:%s\n", + netdev->name, (void *) netdev->mem_start, netdev->irq, + adapter->link_speed, + adapter->link_duplex == FULL_DUPLEX ? "Full" : "Half"); + else + printk("%s: Mem:0x%p IRQ:%d Speed:N/A Duplex:N/A\n", netdev->name, + (void *) netdev->mem_start, netdev->irq); + + return 0; +} + +/** + * e1000_remove - Device Removal Routine + * @pdev: PCI device information struct + * + * e1000_remove is called by the PCI subsystem to alert the driver + * that it should release a PCI device. The could be caused by a + * Hot-Plug event, or because the driver is going to be removed from + * memory. + * + * This routine is also called to clean up from a failure in + * e1000_probe. The Adapter struct and netdev will always exist, + * all other pointers must be checked for NULL before freeing. + **/ + +void +e1000_remove(struct pci_dev *pdev) +{ + struct net_device *netdev; + struct e1000_adapter *adapter; + + /* find the Adapter struct that matches this PCI device */ + + for(adapter = e1000_adapter_list; adapter != NULL; adapter = adapter->next) { + if(adapter->pdev == pdev) + break; + } + if(adapter == NULL) + return; + + netdev = adapter->netdev; + + /* this must be called before freeing anything, + * otherwise there is a case where the open entry point can be + * running at the same time as remove. Calling unregister_netdev on an + * open interface results in a call to dev_close, which locks + * properly against the other netdev entry points, so this takes + * care of the hotplug issue of removing an active interface as well. + */ + unregister_netdev(netdev); + + e1000_phy_hw_reset(&adapter->shared); + +#ifdef CONFIG_PROC_FS + /* remove the proc nodes */ + + if(e1000_proc_dir != NULL) + e1000_remove_proc_dev(adapter->netdev); +#endif + + /* remove from the adapter list */ + + if(e1000_adapter_list == adapter) + e1000_adapter_list = adapter->next; + if(adapter->next != NULL) + adapter->next->prev = adapter->prev; + if(adapter->prev != NULL) + adapter->prev->next = adapter->next; + + /* free system resources */ + +#ifdef IANS + if(adapter->iANSdata != NULL) + kfree(adapter->iANSdata); +#endif + + if(adapter->shared.hw_addr != NULL) { + iounmap((void *) adapter->shared.hw_addr); + release_mem_region(pci_resource_start(pdev, BAR_0), + pci_resource_len(pdev, BAR_0)); + } + + /* free the net_device _and_ struct e1000_adapter memory */ + + kfree(netdev); + + return; +} + +/** + * e1000_check_options - Range Checking for Command Line Parameters + * @adapter: board private structure + * + * This routine checks all command line paramters for valid user + * input. If an invalid value is given, or if no user specified + * value exists, a default value is used. The final value is stored + * in a variable in the Adapter structure. + **/ + +static void +e1000_check_options(struct e1000_adapter *adapter) +{ + int board = adapter->bd_number; + + if(board >= E1000_MAX_NIC) { + printk("Warning: no configuration for board #%i\n", board); + printk("Using defaults for all values\n"); + board = E1000_MAX_NIC; + } + + E1000_DBG("e1000_check_options\n"); + + /* Transmit Descriptor Count */ + + if(TxDescriptors[board] == OPTION_UNSET) { + adapter->tx_ring.count = DEFAULT_TXD; + TxDescriptors[board] = DEFAULT_TXD; + } else + if(((TxDescriptors[board] > MAX_TXD) || + (TxDescriptors[board] < MIN_TXD)) && + (adapter->shared.mac_type <= e1000_82543)) { + printk("Invalid TxDescriptors specified (%i), using default %i\n", + TxDescriptors[board], DEFAULT_TXD); + adapter->tx_ring.count = DEFAULT_TXD; + } else + if(((TxDescriptors[board] > MAX_82544_TXD) || + (TxDescriptors[board] < MIN_TXD)) && + (adapter->shared.mac_type > e1000_82543)) { + printk("Invalid TxDescriptors specified (%i), using default %i\n", + TxDescriptors[board], DEFAULT_TXD); + adapter->tx_ring.count = DEFAULT_TXD; + } else { + printk("Using specified value of %i TxDescriptors\n", + TxDescriptors[board]); + adapter->tx_ring.count = TxDescriptors[board]; + } + + /* tx_ring.count must be a multiple of 8 */ + + adapter->tx_ring.count = E1000_ROUNDUP2(adapter->tx_ring.count, + REQ_TX_DESCRIPTOR_MULTIPLE); + + /* Receive Descriptor Count */ + + if(RxDescriptors[board] == OPTION_UNSET) { + adapter->rx_ring.count = DEFAULT_RXD; + RxDescriptors[board] = DEFAULT_RXD; + } else + if(((RxDescriptors[board] > MAX_RXD) || + (RxDescriptors[board] < MIN_RXD)) && + (adapter->shared.mac_type <= e1000_82543)) { + printk("Invalid RxDescriptors specified (%i), using default %i\n", + RxDescriptors[board], DEFAULT_RXD); + adapter->rx_ring.count = DEFAULT_RXD; + } else + if(((RxDescriptors[board] > MAX_82544_RXD) || + (RxDescriptors[board] < MIN_RXD)) && + (adapter->shared.mac_type > e1000_82543)) { + printk("Invalid RxDescriptors specified (%i), using default %i\n", + RxDescriptors[board], DEFAULT_RXD); + adapter->rx_ring.count = DEFAULT_RXD; + } else { + printk("Using specified value of %i RxDescriptors\n", + RxDescriptors[board]); + adapter->rx_ring.count = RxDescriptors[board]; + } + + /* rx_ring.count must be a multiple of 8 */ + + adapter->rx_ring.count = + E1000_ROUNDUP2(adapter->rx_ring.count, REQ_RX_DESCRIPTOR_MULTIPLE); + + /* Receive Checksum Offload Enable */ + + if(XsumRX[board] == OPTION_UNSET) { + adapter->RxChecksum = XSUMRX_DEFAULT; + XsumRX[board] = XSUMRX_DEFAULT; + } else if((XsumRX[board] != OPTION_ENABLED) && + (XsumRX[board] != OPTION_DISABLED)) { + printk("Invalid XsumRX specified (%i), using default of %i\n", + XsumRX[board], XSUMRX_DEFAULT); + adapter->RxChecksum = XSUMRX_DEFAULT; + } else { + printk("Receive Checksum Offload %s\n", + XsumRX[board] == OPTION_ENABLED ? "Enabled" : "Disabled"); + adapter->RxChecksum = XsumRX[board]; + } + + /* Flow Control */ + + if(FlowControl[board] == OPTION_UNSET) { + adapter->shared.fc = e1000_fc_default; + FlowControl[board] = e1000_fc_default; + } else if((FlowControl[board] > e1000_fc_full) || + (FlowControl[board] < e1000_fc_none)) { + printk("Invalid FlowControl specified (%i), " + "reading default settings from the EEPROM\n", + FlowControl[board]); + adapter->shared.fc = e1000_fc_default; + } else { + adapter->shared.fc = FlowControl[board]; + switch (adapter->shared.fc) { + case e1000_fc_none: + printk("Flow Control Disabled\n"); + break; + case e1000_fc_rx_pause: + printk("Flow Control Receive Only\n"); + break; + case e1000_fc_tx_pause: + printk("Flow Control Transmit Only\n"); + break; + case e1000_fc_full: + printk("Flow Control Enabled\n"); + case e1000_fc_default: + printk("Flow Control Hardware Default\n"); + } + } + + /* Transmit Interrupt Delay */ + + if(TxIntDelay[board] == OPTION_UNSET) { + adapter->tx_int_delay = DEFAULT_TIDV; + TxIntDelay[board] = DEFAULT_TIDV; + } else if((TxIntDelay[board] > MAX_TIDV) || (TxIntDelay[board] < MIN_TIDV)) { + printk("Invalid TxIntDelay specified (%i), using default %i\n", + TxIntDelay[board], DEFAULT_TIDV); + adapter->tx_int_delay = DEFAULT_TIDV; + } else { + printk("Using specified TxIntDelay of %i\n", TxIntDelay[board]); + adapter->tx_int_delay = TxIntDelay[board]; + } + + /* Receive Interrupt Delay */ + + if(RxIntDelay[board] == OPTION_UNSET) { + adapter->rx_int_delay = DEFAULT_RIDV; + RxIntDelay[board] = DEFAULT_RIDV; + } else if((RxIntDelay[board] > MAX_RIDV) || (RxIntDelay[board] < MIN_RIDV)) { + printk("Invalid RxIntDelay specified (%i), using default %i\n", + RxIntDelay[board], DEFAULT_RIDV); + adapter->rx_int_delay = DEFAULT_RIDV; + } else { + printk("Using specified RxIntDelay of %i\n", RxIntDelay[board]); + adapter->rx_int_delay = RxIntDelay[board]; + } + + if(adapter->shared.media_type == e1000_media_type_copper) { + /* MDI/MDI-X Support */ + + if(MdiX[board] == OPTION_UNSET) { + adapter->shared.mdix = DEFAULT_MDIX; + MdiX[board] = DEFAULT_MDIX; + } else if((MdiX[board] > MAX_MDIX) || (MdiX[board] < MIN_MDIX)) { + printk("Invalid MDI/MDI-X specified (%i), using default %i\n", + MdiX[board], DEFAULT_MDIX); + adapter->shared.mdix = DEFAULT_MDIX; + } else { + printk("Using specified MDI/MDI-X of %i\n", MdiX[board]); + adapter->shared.mdix = MdiX[board]; + } + + /* Automatic Correction for Reverse Cable Polarity */ + + if(DisablePolarityCorrection[board] == OPTION_UNSET) { + adapter->shared.disable_polarity_correction = OPTION_DISABLED; + DisablePolarityCorrection[board] = OPTION_DISABLED; + } else if((DisablePolarityCorrection[board] != OPTION_ENABLED) && + (DisablePolarityCorrection[board] != OPTION_DISABLED)) { + printk("Invalid polarity correction specified (%i)," + " using default %i\n", DisablePolarityCorrection[board], + OPTION_DISABLED); + adapter->shared.disable_polarity_correction = OPTION_DISABLED; + } else { + printk("Using specified polarity correction of %i\n", + DisablePolarityCorrection[board]); + adapter->shared.disable_polarity_correction = + DisablePolarityCorrection[board]; + } + } + + /* Speed, Duplex, and AutoNeg */ + + switch (adapter->shared.media_type) { + + case e1000_media_type_fiber: + e1000_check_fiber_options(adapter); + break; + + case e1000_media_type_copper: + e1000_check_copper_options(adapter); + break; + + default: + printk("Unknown Media Type\n"); + break; + } + + return; +} + +/** + * e1000_check_fiber_options - Range Checking for Link Options, Fiber Version + * @adapter: board private structure + * + * Handles speed and duplex options on fiber based adapters + **/ + +static void +e1000_check_fiber_options(struct e1000_adapter *adapter) +{ + int board = + adapter->bd_number > E1000_MAX_NIC ? E1000_MAX_NIC : adapter->bd_number; + + E1000_DBG("CheckSpeedDuplexFiber\n"); + + /* Speed, Duplex, and AutoNeg are not valid on fiber NICs */ + + if((Speed[board] != OPTION_UNSET)) { + Speed[board] = 0; + printk("Warning: Speed not valid for fiber adapters\n"); + printk("Speed Parameter Ignored\n"); + } + if((Duplex[board] != OPTION_UNSET)) { + Duplex[board] = 0; + printk("Warning: Duplex not valid for fiber adapters\n"); + printk("Duplex Parameter Ignored\n"); + } + if((AutoNeg[board] != OPTION_UNSET)) { + AutoNeg[board] = AUTONEG_ADV_DEFAULT; + printk("Warning: AutoNeg not valid for fiber adapters\n"); + printk("AutoNeg Parameter Ignored\n"); + } + + return; +} + +/** + * e1000_check_copper_options - Range Checking for Link Options, Copper Version + * @adapter: board private structure + * + * Handles speed and duplex options on copper based adapters + **/ + +static void +e1000_check_copper_options(struct e1000_adapter *adapter) +{ + int board = + adapter->bd_number > E1000_MAX_NIC ? E1000_MAX_NIC : adapter->bd_number; + int speed, duplex; + boolean_t all_default = TRUE; + + E1000_DBG("CheckSpeedDuplexCopper\n"); + + /* User Specified Auto-negotiation Settings */ + + if(AutoNeg[board] == OPTION_UNSET) { + + adapter->shared.autoneg_advertised = AUTONEG_ADV_DEFAULT; + AutoNeg[board] = AUTONEG_ADV_DEFAULT; + + } else if((Speed[board] != 0 && Speed[board] != OPTION_UNSET) || + (Duplex[board] != 0 && Duplex[board] != OPTION_UNSET)) { + + printk("Warning: AutoNeg specified along with Speed or Duplex\n"); + printk("AutoNeg Parameter Ignored\n"); + + adapter->shared.autoneg_advertised = AUTONEG_ADV_DEFAULT; + + } else { + + if(AutoNeg[board] & ~AUTONEG_ADV_MASK) { + + printk("Invalid AutoNeg Specified (0x%X), Parameter Ignored\n", + AutoNeg[board]); + + adapter->shared.autoneg_advertised = AUTONEG_ADV_DEFAULT; + + } else { + + adapter->shared.autoneg_advertised = AutoNeg[board]; + } + + printk("AutoNeg Advertising "); + if(adapter->shared.autoneg_advertised & ADVERTISE_1000_FULL) { + printk("1000/FD"); + if(adapter->shared.autoneg_advertised & (ADVERTISE_1000_FULL - 1)) + printk(", "); + } + if(adapter->shared.autoneg_advertised & ADVERTISE_1000_HALF) { + printk("1000/HD"); + if(adapter->shared.autoneg_advertised & (ADVERTISE_1000_HALF - 1)) + printk(", "); + } + if(adapter->shared.autoneg_advertised & ADVERTISE_100_FULL) { + printk("100/FD"); + if(adapter->shared.autoneg_advertised & (ADVERTISE_100_FULL - 1)) + printk(", "); + } + if(adapter->shared.autoneg_advertised & ADVERTISE_100_HALF) { + printk("100/HD"); + if(adapter->shared.autoneg_advertised & (ADVERTISE_100_HALF - 1)) + printk(", "); + } + if(adapter->shared.autoneg_advertised & ADVERTISE_10_FULL) { + printk("10/FD"); + if(adapter->shared.autoneg_advertised & (ADVERTISE_10_FULL - 1)) + printk(", "); + } + if(adapter->shared.autoneg_advertised & ADVERTISE_10_HALF) + printk("10/HD"); + printk("\n"); + } + + /* Forced Speed and Duplex */ + + switch (Speed[board]) { + default: + printk("Invalid Speed Specified (%i), Parameter Ignored\n", + Speed[board]); + all_default = FALSE; + case OPTION_UNSET: + speed = 0; + Speed[board] = 0; + break; + case 0: + case 10: + case 100: + case 1000: + speed = Speed[board]; + all_default = FALSE; + break; + } + + switch (Duplex[board]) { + default: + printk("Invalid Duplex Specified (%i), Parameter Ignored\n", + Duplex[board]); + all_default = FALSE; + case OPTION_UNSET: + duplex = 0; + Duplex[board] = 0; + break; + case 0: + case 1: + case 2: + duplex = Duplex[board]; + all_default = FALSE; + break; + } + + switch (speed + duplex) { + case 0: + if(all_default == FALSE) + printk("Speed and Duplex Auto-negotiation Enabled\n"); + adapter->shared.autoneg = 1; + break; + case 1: + printk("Warning: Half Duplex specified without Speed\n"); + printk("Using Auto-negotiation at Half Duplex only\n"); + adapter->shared.autoneg = 1; + adapter->shared.autoneg_advertised = + ADVERTISE_10_HALF | ADVERTISE_100_HALF; + break; + case 2: + printk("Warning: Full Duplex specified without Speed\n"); + printk("Using Auto-negotiation at Full Duplex only\n"); + adapter->shared.autoneg = 1; + adapter->shared.autoneg_advertised = + ADVERTISE_10_FULL | ADVERTISE_100_FULL | ADVERTISE_1000_FULL; + break; + case 10: + printk("Warning: 10 Mbps Speed specified without Duplex\n"); + printk("Using Auto-negotiation at 10 Mbps only\n"); + adapter->shared.autoneg = 1; + adapter->shared.autoneg_advertised = + ADVERTISE_10_HALF | ADVERTISE_10_FULL; + break; + case 11: + printk("Forcing to 10 Mbps Half Duplex\n"); + adapter->shared.autoneg = 0; + adapter->shared.forced_speed_duplex = e1000_10_half; + adapter->shared.autoneg_advertised = 0; + break; + case 12: + printk("Forcing to 10 Mbps Full Duplex\n"); + adapter->shared.autoneg = 0; + adapter->shared.forced_speed_duplex = e1000_10_full; + adapter->shared.autoneg_advertised = 0; + break; + case 100: + printk("Warning: 100 Mbps Speed specified without Duplex\n"); + printk("Using Auto-negotiation at 100 Mbps only\n"); + adapter->shared.autoneg = 1; + adapter->shared.autoneg_advertised = + ADVERTISE_100_HALF | ADVERTISE_100_FULL; + break; + case 101: + printk("Forcing to 100 Mbps Half Duplex\n"); + adapter->shared.autoneg = 0; + adapter->shared.forced_speed_duplex = e1000_100_half; + adapter->shared.autoneg_advertised = 0; + break; + case 102: + printk("Forcing to 100 Mbps Full Duplex\n"); + adapter->shared.autoneg = 0; + adapter->shared.forced_speed_duplex = e1000_100_full; + adapter->shared.autoneg_advertised = 0; + break; + case 1000: + printk("Warning: 1000 Mbps Speed specified without Duplex\n"); + printk("Using Auto-negotiation at 1000 Mbps Full Duplex only\n"); + adapter->shared.autoneg = 1; + adapter->shared.autoneg_advertised = ADVERTISE_1000_FULL; + break; + case 1001: + printk("Warning: Half Duplex is not supported at 1000 Mbps\n"); + printk("Using Auto-negotiation at 1000 Mbps Full Duplex only\n"); + adapter->shared.autoneg = 1; + adapter->shared.autoneg_advertised = ADVERTISE_1000_FULL; + break; + case 1002: + printk("Using Auto-negotiation at 1000 Mbps Full Duplex only\n"); + adapter->shared.autoneg = 1; + adapter->shared.autoneg_advertised = ADVERTISE_1000_FULL; + break; + default: + panic("something is wrong in e1000_check_copper_options"); + } + + /* Speed, AutoNeg and MDI/MDI-X */ + if (!e1000_validate_mdi_setting(&(adapter->shared))) { + printk ("Speed, AutoNeg and MDI-X specifications are incompatible." + " Setting MDI-X to a compatible value.\n"); + } + + return; +} + +/** + * e1000_sw_init - Initialize general software structures (struct e1000_adapter) + * @adapter: board private structure to initialize + * + * Returns 0 on success, negative on failure + * + * e1000_sw_init initializes the Adapter private data structure. + * Fields are initialized based on PCI device information and + * OS network device settings (MTU size). + **/ + +static int +e1000_sw_init(struct e1000_adapter *adapter) +{ + struct net_device *netdev = adapter->netdev; + struct pci_dev *pdev = adapter->pdev; + uint32_t status; + + E1000_DBG("e1000_sw_init\n"); + + /* PCI config space info */ + + pci_read_config_word(pdev, PCI_VENDOR_ID, &adapter->vendor_id); + pci_read_config_word(pdev, PCI_DEVICE_ID, &adapter->device_id); + pci_read_config_byte(pdev, PCI_REVISION_ID, &adapter->rev_id); + pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &adapter->subven_id); + pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &adapter->subsys_id); + pci_read_config_word(pdev, PCI_COMMAND, &adapter->shared.pci_cmd_word); + adapter->shared.vendor_id = adapter->vendor_id; + adapter->shared.device_id = adapter->device_id; + adapter->shared.revision_id = adapter->rev_id; + adapter->shared.subsystem_vendor_id = adapter->subven_id; + adapter->shared.subsystem_id = adapter->subsys_id; + + /* Initial Receive Buffer Length */ + + if((netdev->mtu + ENET_HEADER_SIZE + CRC_LENGTH) < E1000_RXBUFFER_2048) + adapter->rx_buffer_len = E1000_RXBUFFER_2048; + else if((netdev->mtu + ENET_HEADER_SIZE + CRC_LENGTH) < E1000_RXBUFFER_4096) + adapter->rx_buffer_len = E1000_RXBUFFER_4096; + else if((netdev->mtu + ENET_HEADER_SIZE + CRC_LENGTH) < E1000_RXBUFFER_8192) + adapter->rx_buffer_len = E1000_RXBUFFER_8192; + else + adapter->rx_buffer_len = E1000_RXBUFFER_16384; + + adapter->shared.max_frame_size = + netdev->mtu + ENET_HEADER_SIZE + CRC_LENGTH; + adapter->shared.min_frame_size = MINIMUM_ETHERNET_PACKET_SIZE + CRC_LENGTH; + + /* MAC and Phy settings */ + + switch (adapter->device_id) { + case E1000_DEV_ID_82542: + switch (adapter->rev_id) { + case E1000_82542_2_0_REV_ID: + adapter->shared.mac_type = e1000_82542_rev2_0; + break; + case E1000_82542_2_1_REV_ID: + adapter->shared.mac_type = e1000_82542_rev2_1; + break; + default: + adapter->shared.mac_type = e1000_82542_rev2_0; + E1000_ERR("Could not identify 82542 revision\n"); + } + break; + case E1000_DEV_ID_82543GC_FIBER: + case E1000_DEV_ID_82543GC_COPPER: + adapter->shared.mac_type = e1000_82543; + break; + case E1000_DEV_ID_82544EI_COPPER: + case E1000_DEV_ID_82544EI_FIBER: + case E1000_DEV_ID_82544GC_COPPER: + case E1000_DEV_ID_82544GC_LOM: + adapter->shared.mac_type = e1000_82544; + break; + case E1000_DEV_ID_82540EM: + adapter->shared.mac_type = e1000_82540; + break; + default: + E1000_ERR("Could not identify hardware\n"); + return -ENODEV; + } + + adapter->shared.fc_high_water = FC_DEFAULT_HI_THRESH; + adapter->shared.fc_low_water = FC_DEFAULT_LO_THRESH; + adapter->shared.fc_pause_time = FC_DEFAULT_TX_TIMER; + adapter->shared.fc_send_xon = 1; + + /* Identify the Hardware - this is done by the gigabit shared code + * in e1000_init_hw, but it would help to identify the NIC + * before bringing the hardware online for use in e1000_check_options. + */ + if(adapter->shared.mac_type >= e1000_82543) { + status = E1000_READ_REG(&adapter->shared, STATUS); + if(status & E1000_STATUS_TBIMODE) { + adapter->shared.media_type = e1000_media_type_fiber; + } else { + adapter->shared.media_type = e1000_media_type_copper; + } + } else { + adapter->shared.media_type = e1000_media_type_fiber; + } + + if((E1000_REPORT_TX_EARLY == 0) || (E1000_REPORT_TX_EARLY == 1)) { + adapter->shared.report_tx_early = E1000_REPORT_TX_EARLY; + } else { + if(adapter->shared.mac_type < e1000_82543) { + + adapter->shared.report_tx_early = 0; + } else { + adapter->shared.report_tx_early = 1; + } + } + + adapter->shared.wait_autoneg_complete = WAITFORLINK_DEFAULT; + + adapter->shared.tbi_compatibility_en = 1; + + atomic_set(&adapter->tx_timeout, 0); + + spin_lock_init(&adapter->stats_lock); + spin_lock_init(&adapter->rx_fill_lock); + + return 0; +} + +/** + * e1000_hw_init - prepare the hardware + * @adapter: board private struct containing configuration + * + * Returns 0 on success, negative on failure + * + * Initialize the hardware to a configuration as specified by the + * Adapter structure. The controler is reset, the EEPROM is + * verified, the MAC address is set, then the shared initilization + * routines are called. + **/ + +static int +e1000_hw_init(struct e1000_adapter *adapter) +{ + struct net_device *netdev = adapter->netdev; + + E1000_DBG("e1000_hw_init\n"); + + /* Repartition Pba for greater than 9k mtu + * To take effect Ctrl_Rst is required. + */ + if(adapter->rx_buffer_len > E1000_RXBUFFER_8192) + E1000_WRITE_REG(&adapter->shared, PBA, E1000_JUMBO_PBA); + else + E1000_WRITE_REG(&adapter->shared, PBA, E1000_DEFAULT_PBA); + + /* Issue a global reset */ + + adapter->shared.adapter_stopped = 0; + e1000_adapter_stop(&adapter->shared); + adapter->shared.adapter_stopped = 0; + + /* make sure the EEPROM is good */ + + if(!e1000_validate_eeprom_checksum(&adapter->shared)) { + E1000_ERR("The EEPROM Checksum Is Not Valid\n"); + return -1; + } + + /* copy the MAC address out of the EEPROM */ + + e1000_read_address(adapter, adapter->perm_net_addr); + memcpy(netdev->dev_addr, adapter->perm_net_addr, netdev->addr_len); + memcpy(adapter->shared.mac_addr, netdev->dev_addr, netdev->addr_len); + + e1000_read_part_num(&adapter->shared, &(adapter->part_num)); + + if(!e1000_init_hw(&adapter->shared)) { + E1000_ERR("Hardware Initialization Failed\n"); + return -1; + } + + e1000_enable_WOL(adapter); + + adapter->shared.get_link_status = 1; + e1000_check_for_link(&adapter->shared); + + if(E1000_READ_REG(&adapter->shared, STATUS) & E1000_STATUS_LU) + adapter->link_active = TRUE; + else + adapter->link_active = FALSE; + + if(adapter->link_active == TRUE) { + e1000_get_speed_and_duplex(&adapter->shared, &adapter->link_speed, + &adapter->link_duplex); + } else { + adapter->link_speed = 0; + adapter->link_duplex = 0; + } + + e1000_get_bus_info(&adapter->shared); + + return 0; +} + +/** + * e1000_read_address - Reads the MAC address from the EEPROM + * @adapter: board private structure + * @addr: pointer to an array of bytes + **/ + +static void +e1000_read_address(struct e1000_adapter *adapter, + uint8_t *addr) +{ + uint16_t eeprom_word; + int i; + + E1000_DBG("e1000_read_address\n"); + + for(i = 0; i < NODE_ADDRESS_SIZE; i += 2) { + eeprom_word = + e1000_read_eeprom(&adapter->shared, + EEPROM_NODE_ADDRESS_BYTE_0 + (i / 2)); + addr[i] = (uint8_t) (eeprom_word & 0x00FF); + addr[i + 1] = (uint8_t) (eeprom_word >> 8); + } + + return; +} + +/** + * e1000_open - Called when a network interface is made active + * @netdev: network interface device structure + * + * Returns 0 on success, negative value on failure + * + * The open entry point is called when a network interface is made + * active by the system (IFF_UP). At this point all resources needed + * for transmit and receive operations are allocated, the interrupt + * handler is registered with the OS, the watchdog timer is started, + * and the stack is notified that the interface is ready. + **/ + +int +e1000_open(struct net_device *netdev) +{ + struct e1000_adapter *adapter = netdev->priv; + + E1000_DBG("e1000_open\n"); + + /* prevent multiple opens when dealing with iANS */ + + if(test_and_set_bit(E1000_BOARD_OPEN, &adapter->flags)) { + return -EBUSY; + } + + adapter->shared.fc = adapter->shared.original_fc; + + /* e1000_close issues a global reset (e1000_adapter_stop) + * so e1000_hw_init must be called again or the hardware + * will resume in it's default state + */ + if(e1000_hw_init(adapter) < 0) { + clear_bit(E1000_BOARD_OPEN, &adapter->flags); + return -EBUSY; + } +#ifdef IANS + /* restore VLAN settings */ + if((IANS_BD_TAGGING_MODE) (ANS_PRIVATE_DATA_FIELD(adapter)->tag_mode) != + IANS_BD_TAGGING_NONE) + bd_ans_hw_EnableVLAN(adapter); +#endif + + adapter->shared.adapter_stopped = 0; + + /* allocate transmit descriptors */ + + if(e1000_setup_tx_resources(adapter) != 0) { + e1000_adapter_stop(&adapter->shared); + clear_bit(E1000_BOARD_OPEN, &adapter->flags); + return -ENOMEM; + } + e1000_configure_tx(adapter); + + /* allocate receive descriptors and buffers */ + + if(e1000_setup_rx_resources(adapter) != 0) { + e1000_adapter_stop(&adapter->shared); + e1000_free_tx_resources(adapter); + clear_bit(E1000_BOARD_OPEN, &adapter->flags); + return -ENOMEM; + } + e1000_setup_rctl(adapter); + e1000_configure_rx(adapter); + + /* hook the interrupt */ + + if(request_irq(netdev->irq, &e1000_intr, + SA_SHIRQ, e1000_driver_name, netdev) != 0) { + clear_bit(E1000_BOARD_OPEN, &adapter->flags); + e1000_adapter_stop(&adapter->shared); + e1000_free_tx_resources(adapter); + e1000_free_rx_resources(adapter); + clear_bit(E1000_BOARD_OPEN, &adapter->flags); + return -EBUSY; + } + + /* fill Rx ring with sk_buffs */ + + tasklet_init(&adapter->rx_fill_tasklet, e1000_alloc_rx_buffers, + (unsigned long) adapter); + + tasklet_schedule(&adapter->rx_fill_tasklet); + + /* Set the watchdog timer for 2 seconds */ + + init_timer(&adapter->timer_id); + adapter->timer_id.function = &e1000_watchdog; + adapter->timer_id.data = (unsigned long) netdev; + mod_timer(&adapter->timer_id, (jiffies + 2 * HZ)); + + /* stats accumulated while down are dropped + * this does not clear the running total + */ + + e1000_clear_hw_cntrs(&adapter->shared); + + adapter->int_mask = IMS_ENABLE_MASK; + e1000_irq_enable(adapter); + netif_start_queue(netdev); + +#ifdef MODULE + + /* Incrementing the module use count prevents a driver from being + * unloaded while an active network interface is using it. + */ + MOD_INC_USE_COUNT; + +#endif + + return 0; +} + +/** + * e1000_close - Disables a network interface + * @netdev: network interface device structure + * + * Returns 0, this is not allowed to fail + * + * The close entry point is called when an interface is de-activated + * by the OS. The hardware is still under the drivers control, but + * needs to be disabled. A global MAC reset is issued to stop the + * hardware, and all transmit and receive resources are freed. + **/ + +int +e1000_close(struct net_device *netdev) +{ + struct e1000_adapter *adapter = netdev->priv; + + E1000_DBG("e1000_close\n"); + + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + return 0; + + /* Issue a global reset */ + + e1000_adapter_stop((&adapter->shared)); + + /* Enable receiver unit after Global reset + * for WOL, so that receiver can still recive + * wake up packet and will not drop it. + */ + if(adapter->shared.mac_type > e1000_82543) + E1000_WRITE_REG(&adapter->shared, RCTL, E1000_RCTL_EN); + + /* free OS resources */ + + netif_stop_queue(netdev); + free_irq(netdev->irq, netdev); + del_timer_sync(&adapter->timer_id); + + /* Make sure the tasklet won't be left after ifconfig down */ + + /* + * Assumption: tasklet is ALREADY enabled, ie, t->count == 0. + * Otherwise, tasklet is still left in the tasklet list, and, + * tasklet_kill will not be able to return (hang). + */ + tasklet_kill(&adapter->rx_fill_tasklet); + + /* free software resources */ + + e1000_free_tx_resources(adapter); + e1000_free_rx_resources(adapter); + +#ifdef MODULE + + /* decrement the module usage count + * so that the driver can be unloaded + */ + MOD_DEC_USE_COUNT; + +#endif + + clear_bit(E1000_BOARD_OPEN, &adapter->flags); + return 0; +} + +/** + * e1000_setup_tx_resources - allocate Tx resources (Descriptors) + * @adapter: board private structure + * + * Return 0 on success, negative on failure + * + * e1000_setup_tx_resources allocates all software transmit resources + * and enabled the Tx unit of the MAC. + **/ + +static int +e1000_setup_tx_resources(struct e1000_adapter *adapter) +{ + struct pci_dev *pdev = adapter->pdev; + int size; + + E1000_DBG("e1000_setup_tx_resources\n"); + + size = sizeof(struct e1000_buffer) * adapter->tx_ring.count; + adapter->tx_ring.buffer_info = kmalloc(size, GFP_KERNEL); + if(adapter->tx_ring.buffer_info == NULL) { + return -ENOMEM; + } + memset(adapter->tx_ring.buffer_info, 0, size); + + /* round up to nearest 4K */ + + adapter->tx_ring.size = E1000_ROUNDUP2(adapter->tx_ring.count * + sizeof(struct e1000_tx_desc), + 4096); + + adapter->tx_ring.desc = pci_alloc_consistent(pdev, adapter->tx_ring.size, + &adapter->tx_ring.dma); + if(adapter->tx_ring.desc == NULL) { + kfree(adapter->tx_ring.buffer_info); + return -ENOMEM; + } + memset(adapter->tx_ring.desc, 0, adapter->tx_ring.size); + + atomic_set(&adapter->tx_ring.unused, adapter->tx_ring.count); + adapter->tx_ring.next_to_use = 0; + adapter->tx_ring.next_to_clean = 0; + + return 0; +} + +/** + * e1000_configure_tx - Configure 8254x Transmit Unit after Reset + * @adapter: board private structure + * + * Configure the Tx unit of the MAC after a reset. + **/ + +static void +e1000_configure_tx(struct e1000_adapter *adapter) +{ + uint32_t tctl, tipg; + + /* Setup the Base and Length of the Rx Descriptor Ring */ + /* tx_ring.dma can be either a 32 or 64 bit value */ + +#if (BITS_PER_LONG == 32) + E1000_WRITE_REG(&adapter->shared, TDBAL, adapter->tx_ring.dma); + E1000_WRITE_REG(&adapter->shared, TDBAH, 0); +#elif ( BITS_PER_LONG == 64) + E1000_WRITE_REG(&adapter->shared, TDBAL, + (uint32_t) (adapter->tx_ring.dma & 0x00000000FFFFFFFF)); + E1000_WRITE_REG(&adapter->shared, TDBAH, + (uint32_t) (adapter->tx_ring.dma >> 32)); +#else +#error "Unsupported System - does not use 32 or 64 bit pointers!" +#endif + + E1000_WRITE_REG(&adapter->shared, TDLEN, + adapter->tx_ring.count * sizeof(struct e1000_tx_desc)); + + /* Setup the HW Tx Head and Tail descriptor pointers */ + + E1000_WRITE_REG(&adapter->shared, TDH, 0); + E1000_WRITE_REG(&adapter->shared, TDT, 0); + + /* Set the default values for the Tx Inter Packet Gap timer */ + + switch (adapter->shared.mac_type) { + case e1000_82543: + case e1000_82544: + case e1000_82540: + if(adapter->shared.media_type == e1000_media_type_fiber) + tipg = DEFAULT_82543_TIPG_IPGT_FIBER; + else + tipg = DEFAULT_82543_TIPG_IPGT_COPPER; + tipg |= DEFAULT_82543_TIPG_IPGR1 << E1000_TIPG_IPGR1_SHIFT; + tipg |= DEFAULT_82543_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; + break; + case e1000_82542_rev2_0: + case e1000_82542_rev2_1: + default: + tipg = DEFAULT_82542_TIPG_IPGT; + tipg |= DEFAULT_82542_TIPG_IPGR1 << E1000_TIPG_IPGR1_SHIFT; + tipg |= DEFAULT_82542_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; + break; + } + E1000_WRITE_REG(&adapter->shared, TIPG, tipg); + + /* Set the Tx Interrupt Delay register */ + + E1000_WRITE_REG(&adapter->shared, TIDV, adapter->tx_int_delay); + + /* Program the Transmit Control Register */ + + tctl = + E1000_TCTL_PSP | E1000_TCTL_EN | (E1000_COLLISION_THRESHOLD << + E1000_CT_SHIFT); + if(adapter->link_duplex == FULL_DUPLEX) { + tctl |= E1000_FDX_COLLISION_DISTANCE << E1000_COLD_SHIFT; + } else { + tctl |= E1000_HDX_COLLISION_DISTANCE << E1000_COLD_SHIFT; + } + E1000_WRITE_REG(&adapter->shared, TCTL, tctl); + +#ifdef CONFIG_PPC + if(adapter->shared.mac_type >= e1000_82543) { + E1000_WRITE_REG(&adapter->shared, TXDCTL, 0x00020000); + } +#endif + + /* Setup Transmit Descriptor Settings for this adapter */ + adapter->TxdCmd = E1000_TXD_CMD_IFCS; + + if(adapter->tx_int_delay > 0) + adapter->TxdCmd |= E1000_TXD_CMD_IDE; + if(adapter->shared.report_tx_early == 1) + adapter->TxdCmd |= E1000_TXD_CMD_RS; + else + adapter->TxdCmd |= E1000_TXD_CMD_RPS; + + adapter->ActiveChecksumContext = OFFLOAD_NONE; + + return; +} + +/** + * e1000_setup_rx_resources - allocate Rx resources (Descriptors, receive SKBs) + * @adapter: board private structure + * + * Returns 0 on success, negative on failure + * + * e1000_setup_rx_resources allocates all software receive resources + * and network buffers, and enables the Rx unit of the MAC. + **/ + +static int +e1000_setup_rx_resources(struct e1000_adapter *adapter) +{ + struct pci_dev *pdev = adapter->pdev; + int size; + + E1000_DBG("e1000_setup_rx_resources\n"); + + size = sizeof(struct e1000_buffer) * adapter->rx_ring.count; + adapter->rx_ring.buffer_info = kmalloc(size, GFP_KERNEL); + if(adapter->rx_ring.buffer_info == NULL) { + return -ENOMEM; + } + memset(adapter->rx_ring.buffer_info, 0, size); + + /* Round up to nearest 4K */ + + adapter->rx_ring.size = E1000_ROUNDUP2(adapter->rx_ring.count * + sizeof(struct e1000_rx_desc), + 4096); + + adapter->rx_ring.desc = pci_alloc_consistent(pdev, adapter->rx_ring.size, + &adapter->rx_ring.dma); + + if(adapter->rx_ring.desc == NULL) { + kfree(adapter->rx_ring.buffer_info); + return -ENOMEM; + } + memset(adapter->rx_ring.desc, 0, adapter->rx_ring.size); + + adapter->rx_ring.next_to_clean = 0; + atomic_set(&adapter->rx_ring.unused, adapter->rx_ring.count); + + adapter->rx_ring.next_to_use = 0; + + return 0; +} + +/** + * e1000_setup_rctl - configure the receive control register + * @adapter: Board private structure + **/ + +static void +e1000_setup_rctl(struct e1000_adapter *adapter) +{ + uint32_t rctl; + + /* Setup the Receive Control Register */ + rctl = + E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_LBM_NO | + E1000_RCTL_RDMTS_HALF | (adapter->shared. + mc_filter_type << E1000_RCTL_MO_SHIFT); + + if(adapter->shared.tbi_compatibility_on == 1) + rctl |= E1000_RCTL_SBP; + + switch (adapter->rx_buffer_len) { + case E1000_RXBUFFER_2048: + default: + rctl |= E1000_RCTL_SZ_2048; + break; + case E1000_RXBUFFER_4096: + rctl |= E1000_RCTL_SZ_4096 | E1000_RCTL_BSEX | E1000_RCTL_LPE; + break; + case E1000_RXBUFFER_8192: + rctl |= E1000_RCTL_SZ_8192 | E1000_RCTL_BSEX | E1000_RCTL_LPE; + break; + case E1000_RXBUFFER_16384: + rctl |= E1000_RCTL_SZ_16384 | E1000_RCTL_BSEX | E1000_RCTL_LPE; + break; + } + + E1000_WRITE_REG(&adapter->shared, RCTL, rctl); +} + +/** + * e1000_configure_rx - Configure 8254x Receive Unit after Reset + * @adapter: board private structure + * + * Configure the Rx unit of the MAC after a reset. + **/ + +static void +e1000_configure_rx(struct e1000_adapter *adapter) +{ + uint32_t rctl; + uint32_t rxcsum; + + /* make sure receives are disabled while setting up the descriptor ring */ + rctl = E1000_READ_REG(&adapter->shared, RCTL); + E1000_WRITE_REG(&adapter->shared, RCTL, rctl & ~E1000_RCTL_EN); + + /* set the Receive Delay Timer Register */ + E1000_WRITE_REG(&adapter->shared, RDTR, + adapter->rx_int_delay | E1000_RDT_FPDB); + + /* Setup the Base and Length of the Rx Descriptor Ring */ + /* rx_ring.dma can be either a 32 or 64 bit value */ + +#if (BITS_PER_LONG == 32) + E1000_WRITE_REG(&adapter->shared, RDBAL, adapter->rx_ring.dma); + E1000_WRITE_REG(&adapter->shared, RDBAH, 0); +#elif ( BITS_PER_LONG == 64) + E1000_WRITE_REG(&adapter->shared, RDBAL, + (uint32_t) (adapter->rx_ring.dma & 0x00000000FFFFFFFF)); + E1000_WRITE_REG(&adapter->shared, RDBAH, + (uint32_t) (adapter->rx_ring.dma >> 32)); +#else +#error "Unsupported System - does not use 32 or 64 bit pointers!" +#endif + + E1000_WRITE_REG(&adapter->shared, RDLEN, + adapter->rx_ring.count * sizeof(struct e1000_rx_desc)); + + /* Setup the HW Rx Head and Tail Descriptor Pointers */ + E1000_WRITE_REG(&adapter->shared, RDH, 0); + E1000_WRITE_REG(&adapter->shared, RDT, 0); + + /* Enable 82543 Receive Checksum Offload for TCP and UDP */ + if((adapter->shared.mac_type >= e1000_82543) && + (adapter->RxChecksum == TRUE)) { + rxcsum = E1000_READ_REG(&adapter->shared, RXCSUM); + rxcsum |= E1000_RXCSUM_TUOFL; + E1000_WRITE_REG(&adapter->shared, RXCSUM, rxcsum); + } +#ifdef CONFIG_PPC + if(adapter->shared.mac_type >= e1000_82543) { + E1000_WRITE_REG(&adapter->shared, RXDCTL, 0x00020000); + } +#endif + + /* Enable Receives */ + E1000_WRITE_REG(&adapter->shared, RCTL, rctl); + + return; +} + +/** + * e1000_free_tx_resources - Free Tx Resources + * @adapter: board private structure + * + * Free all transmit software resources + **/ + +static void +e1000_free_tx_resources(struct e1000_adapter *adapter) +{ + struct pci_dev *pdev = adapter->pdev; + + E1000_DBG("e1000_free_tx_resources\n"); + + e1000_clean_tx_ring(adapter); + + kfree(adapter->tx_ring.buffer_info); + adapter->tx_ring.buffer_info = NULL; + + pci_free_consistent(pdev, adapter->tx_ring.size, adapter->tx_ring.desc, + adapter->tx_ring.dma); + + adapter->tx_ring.desc = NULL; + + return; +} + +/** + * e1000_clean_tx_ring - Free Tx Buffers + * @adapter: board private structure + **/ + +static void +e1000_clean_tx_ring(struct e1000_adapter *adapter) +{ + struct pci_dev *pdev = adapter->pdev; + unsigned long size; + int i; + + /* Free all the Tx ring sk_buffs */ + + for(i = 0; i < adapter->tx_ring.count; i++) { + if(adapter->tx_ring.buffer_info[i].skb != NULL) { + + pci_unmap_page(pdev, adapter->tx_ring.buffer_info[i].dma, + adapter->tx_ring.buffer_info[i].length, + PCI_DMA_TODEVICE); + + dev_kfree_skb(adapter->tx_ring.buffer_info[i].skb); + + adapter->tx_ring.buffer_info[i].skb = NULL; + } + } + + size = sizeof(struct e1000_buffer) * adapter->tx_ring.count; + memset(adapter->tx_ring.buffer_info, 0, size); + + /* Zero out the descriptor ring */ + + memset(adapter->tx_ring.desc, 0, adapter->tx_ring.size); + + atomic_set(&adapter->tx_ring.unused, adapter->tx_ring.count); + adapter->tx_ring.next_to_use = 0; + adapter->tx_ring.next_to_clean = 0; + + return; +} + +/** + * e1000_free_rx_resources - Free Rx Resources + * @adapter: board private structure + * + * Free all receive software resources + **/ + +static void +e1000_free_rx_resources(struct e1000_adapter *adapter) +{ + struct pci_dev *pdev = adapter->pdev; + + E1000_DBG("e1000_free_rx_resources\n"); + + tasklet_disable(&adapter->rx_fill_tasklet); + + e1000_clean_rx_ring(adapter); + + kfree(adapter->rx_ring.buffer_info); + adapter->rx_ring.buffer_info = NULL; + + pci_free_consistent(pdev, adapter->rx_ring.size, adapter->rx_ring.desc, + adapter->rx_ring.dma); + + adapter->rx_ring.desc = NULL; + + return; +} + +/** + * e1000_clean_rx_ring - Free Rx Buffers + * @adapter: board private structure + **/ + +static void +e1000_clean_rx_ring(struct e1000_adapter *adapter) +{ + struct pci_dev *pdev = adapter->pdev; + unsigned long size; + int i; + + /* Free all the Rx ring sk_buffs */ + + for(i = 0; i < adapter->rx_ring.count; i++) { + if(adapter->rx_ring.buffer_info[i].skb != NULL) { + + pci_unmap_single(pdev, adapter->rx_ring.buffer_info[i].dma, + adapter->rx_ring.buffer_info[i].length, + PCI_DMA_FROMDEVICE); + + dev_kfree_skb(adapter->rx_ring.buffer_info[i].skb); + + adapter->rx_ring.buffer_info[i].skb = NULL; + } + } + + size = sizeof(struct e1000_buffer) * adapter->rx_ring.count; + memset(adapter->rx_ring.buffer_info, 0, size); + + /* Zero out the descriptor ring */ + + memset(adapter->rx_ring.desc, 0, adapter->rx_ring.size); + + atomic_set(&adapter->rx_ring.unused, adapter->rx_ring.count); + adapter->rx_ring.next_to_clean = 0; + adapter->rx_ring.next_to_use = 0; + + return; +} + +/** + * e1000_set_multi - Multicast and Promiscuous mode set + * @netdev: network interface device structure + * + * The set_multi entry point is called whenever the multicast address + * list or the network interface flags are updated. This routine is + * resposible for configuring the hardware for proper multicast, + * promiscuous mode, and all-multi behavior. + **/ + +void +e1000_set_multi(struct net_device *netdev) +{ + struct e1000_adapter *adapter = netdev->priv; + struct pci_dev *pdev = adapter->pdev; + uint32_t rctl; + uint8_t mta[MAX_NUM_MULTICAST_ADDRESSES * ETH_LENGTH_OF_ADDRESS]; + uint16_t pci_command_word; + struct dev_mc_list *mc_ptr; + int i; + + E1000_DBG("e1000_set_multi\n"); + + rctl = E1000_READ_REG(&adapter->shared, RCTL); + + if(adapter->shared.mac_type == e1000_82542_rev2_0) { + if(adapter->shared.pci_cmd_word & PCI_COMMAND_INVALIDATE) { + pci_command_word = + adapter->shared.pci_cmd_word & ~PCI_COMMAND_INVALIDATE; + pci_write_config_word(pdev, PCI_COMMAND, pci_command_word); + } + rctl |= E1000_RCTL_RST; + E1000_WRITE_REG(&adapter->shared, RCTL, rctl); + mdelay(5); + if(test_bit(E1000_BOARD_OPEN, &adapter->flags)) { + tasklet_disable(&adapter->rx_fill_tasklet); + e1000_clean_rx_ring(adapter); + } + } + + /* Check for Promiscuous and All Multicast modes */ + + if(netdev->flags & IFF_PROMISC) { + rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); + } else if(netdev->flags & IFF_ALLMULTI) { + rctl |= E1000_RCTL_MPE; + rctl &= ~E1000_RCTL_UPE; + } else { + rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE); + } + + if(netdev->mc_count > MAX_NUM_MULTICAST_ADDRESSES) { + rctl |= E1000_RCTL_MPE; + E1000_WRITE_REG(&adapter->shared, RCTL, rctl); + } else { + E1000_WRITE_REG(&adapter->shared, RCTL, rctl); + for(i = 0, mc_ptr = netdev->mc_list; mc_ptr; i++, mc_ptr = mc_ptr->next) + memcpy(&mta[i * ETH_LENGTH_OF_ADDRESS], mc_ptr->dmi_addr, + ETH_LENGTH_OF_ADDRESS); + e1000_mc_addr_list_update(&adapter->shared, mta, netdev->mc_count, 0); + } + + if(adapter->shared.mac_type == e1000_82542_rev2_0) { + rctl = E1000_READ_REG(&adapter->shared, RCTL); + rctl &= ~E1000_RCTL_RST; + E1000_WRITE_REG(&adapter->shared, RCTL, rctl); + mdelay(5); + if(adapter->shared.pci_cmd_word & PCI_COMMAND_INVALIDATE) { + pci_write_config_word(pdev, PCI_COMMAND, + adapter->shared.pci_cmd_word); + } + if(test_bit(E1000_BOARD_OPEN, &adapter->flags)) { + e1000_configure_rx(adapter); + tasklet_enable(&adapter->rx_fill_tasklet); + } + } + + return; +} + +#ifdef IANS + +/* flush Tx queue without link */ +static void +e1000_tx_flush(struct e1000_adapter *adapter) +{ + uint32_t ctrl, txcw, icr; + + adapter->int_mask = 0; + e1000_irq_disable(adapter); + synchronize_irq(); + + if(adapter->shared.mac_type < e1000_82543) { + /* Transmit Unit Reset */ + E1000_WRITE_REG(&adapter->shared, TCTL, E1000_TCTL_RST); + E1000_WRITE_REG(&adapter->shared, TCTL, 0); + e1000_clean_tx_ring(adapter); + e1000_configure_tx(adapter); + } else { + /* turn off autoneg, set link up, and invert loss of signal */ + txcw = E1000_READ_REG(&adapter->shared, TXCW); + ctrl = E1000_READ_REG(&adapter->shared, CTRL); + E1000_WRITE_REG(&adapter->shared, TXCW, txcw & ~E1000_TXCW_ANE); + E1000_WRITE_REG(&adapter->shared, CTRL, + (ctrl | E1000_CTRL_SLU | E1000_CTRL_ILOS)); + /* delay to flush queue, then clean up */ + mdelay(20); + e1000_clean_tx_irq(adapter); + E1000_WRITE_REG(&adapter->shared, CTRL, ctrl); + E1000_WRITE_REG(&adapter->shared, TXCW, txcw); + /* clear the link status change interrupts this caused */ + icr = E1000_READ_REG(&adapter->shared, ICR); + } + + adapter->int_mask = IMS_ENABLE_MASK; + e1000_irq_enable(adapter); + return; +} +#endif + +/** + * e1000_watchdog - Timer Call-back + * @data: pointer to netdev cast into an unsigned long + **/ + +void +e1000_watchdog(unsigned long data) +{ + struct net_device *netdev = (struct net_device *) data; + struct e1000_adapter *adapter = netdev->priv; + +#ifdef IANS +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)) + int flags; +#endif +#endif + + e1000_check_for_link(&adapter->shared); + + if (test_and_clear_bit(E1000_LINK_STATUS_CHANGED, &adapter->flags)) + e1000_phy_get_info(&adapter->shared, &adapter->phy_info); + + if(E1000_READ_REG(&adapter->shared, STATUS) & E1000_STATUS_LU) { + if(adapter->link_active != TRUE) { + +#ifdef IANS + if((adapter->iANSdata->iANS_status == IANS_COMMUNICATION_UP) && + (adapter->iANSdata->reporting_mode == IANS_STATUS_REPORTING_ON)) + if(ans_notify) + ans_notify(netdev, IANS_IND_XMIT_QUEUE_READY); +#endif + netif_wake_queue(netdev); + + e1000_get_speed_and_duplex(&adapter->shared, &adapter->link_speed, + &adapter->link_duplex); + printk(KERN_ERR "e1000: %s NIC Link is Up %d Mbps %s\n", + netdev->name, adapter->link_speed, + adapter->link_duplex == + FULL_DUPLEX ? "Full Duplex" : "Half Duplex"); + + adapter->link_active = TRUE; + set_bit(E1000_LINK_STATUS_CHANGED, &adapter->flags); + } + } else { + if(adapter->link_active != FALSE) { + adapter->link_speed = 0; + adapter->link_duplex = 0; + printk(KERN_ERR "e1000: %s NIC Link is Down\n", netdev->name); + adapter->link_active = FALSE; + atomic_set(&adapter->tx_timeout, 0); + } + } + + e1000_update_stats(adapter); + + if(atomic_read(&adapter->tx_timeout) > 1) + atomic_dec(&adapter->tx_timeout); + + if((adapter->link_active == TRUE) && + (atomic_read(&adapter->tx_timeout) == 1)) { + + if(E1000_READ_REG(&adapter->shared, STATUS) & E1000_STATUS_TXOFF) { + atomic_set(&adapter->tx_timeout, 3); + } else { + + e1000_hibernate_adapter(netdev); + +#ifdef IANS + if((adapter->iANSdata->iANS_status == IANS_COMMUNICATION_UP) && + (adapter->iANSdata->reporting_mode == IANS_STATUS_REPORTING_ON)) { + adapter->link_active = FALSE; + bd_ans_os_Watchdog(netdev, adapter); + adapter->link_active = TRUE; + } +#endif + atomic_set(&adapter->tx_timeout, 0); + e1000_wakeup_adapter(netdev); + } + } +#ifdef IANS + if(adapter->iANSdata->iANS_status == IANS_COMMUNICATION_UP) { + + if(adapter->iANSdata->reporting_mode == IANS_STATUS_REPORTING_ON) + bd_ans_os_Watchdog(netdev, adapter); + + if(adapter->link_active == FALSE) { + /* don't sit on SKBs while link is down */ + + if(atomic_read(&adapter->tx_ring.unused) < adapter->tx_ring.count) { + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)) + spin_lock_irqsave(&netdev->xmit_lock, flags); + e1000_tx_flush(adapter); + spin_unlock_irqrestore(&netdev->xmit_lock, flags); +#else + e1000_tx_flush(adapter); +#endif + } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)) + spin_lock_irqsave(&netdev->queue_lock, flags); + qdisc_reset(netdev->qdisc); + spin_unlock_irqrestore(&netdev->queue_lock, flags); +#else + qdisc_reset(netdev->qdisc); +#endif + } + } +#endif + + if(test_bit(E1000_RX_REFILL, &adapter->flags)) { + tasklet_schedule(&adapter->rx_fill_tasklet); + } + + /* Reset the timer */ + mod_timer(&adapter->timer_id, jiffies + 2 * HZ); + + return; +} + +/** + * e1000_tx_checksum_setup + * @adapter: + * @skb: + * @txd_upper: + * @txd_lower: + **/ + +static inline void +e1000_tx_checksum_setup(struct e1000_adapter *adapter, + struct sk_buff *skb, + uint32_t *txd_upper, + uint32_t *txd_lower) +{ + + struct e1000_context_desc *desc; + int i; + + if(skb->protocol != __constant_htons(ETH_P_IP)) { + *txd_upper = 0; + *txd_lower = adapter->TxdCmd; + return; + } + + switch (skb->nh.iph->protocol) { + case IPPROTO_TCP: + /* Offload TCP checksum */ + *txd_upper = E1000_TXD_POPTS_TXSM << 8; + *txd_lower = adapter->TxdCmd | E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_D; + if(adapter->ActiveChecksumContext == OFFLOAD_TCP_IP) + return; + else + adapter->ActiveChecksumContext = OFFLOAD_TCP_IP; + break; + case IPPROTO_UDP: + /* Offload UDP checksum */ + *txd_upper = E1000_TXD_POPTS_TXSM << 8; + *txd_lower = adapter->TxdCmd | E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_D; + if(adapter->ActiveChecksumContext == OFFLOAD_UDP_IP) + return; + else + adapter->ActiveChecksumContext = OFFLOAD_UDP_IP; + break; + default: + /* no checksum to offload */ + *txd_upper = 0; + *txd_lower = adapter->TxdCmd; + return; + } + + /* If we reach this point, the checksum offload context + * needs to be reset + */ + + i = adapter->tx_ring.next_to_use; + desc = E1000_CONTEXT_DESC(adapter->tx_ring, i); + + desc->lower_setup.ip_fields.ipcss = skb->nh.raw - skb->data; + desc->lower_setup.ip_fields.ipcso = + ((skb->nh.raw + offsetof(struct iphdr, check)) - skb->data); + desc->lower_setup.ip_fields.ipcse = cpu_to_le16(skb->h.raw - skb->data - 1); + + desc->upper_setup.tcp_fields.tucss = (skb->h.raw - skb->data); + desc->upper_setup.tcp_fields.tucso = ((skb->h.raw + skb->csum) - skb->data); + desc->upper_setup.tcp_fields.tucse = 0; + + desc->tcp_seg_setup.data = 0; + desc->cmd_and_length = cpu_to_le32(E1000_TXD_CMD_DEXT) | adapter->TxdCmd; + + i = (i + 1) % adapter->tx_ring.count; + atomic_dec(&adapter->tx_ring.unused); + adapter->tx_ring.next_to_use = i; + E1000_WRITE_REG(&adapter->shared, TDT, adapter->tx_ring.next_to_use); + return; +} + +/** + * e1000_xmit_frame - Transmit entry point + * @skb: buffer with frame data to transmit + * @netdev: network interface device structure + * + * Returns 0 on success, negative on error + * + * e1000_xmit_frame is called by the stack to initiate a transmit. + * The out of resource condition is checked after each successful Tx + * so that the stack can be notified, preventing the driver from + * ever needing to drop a frame. The atomic operations on + * tx_ring.unused are used to syncronize with the transmit + * interrupt processing code without the need for a spinlock. + **/ + +int +e1000_xmit_frame(struct sk_buff *skb, + struct net_device *netdev) +{ + struct e1000_adapter *adapter = netdev->priv; + struct pci_dev *pdev = adapter->pdev; + struct e1000_tx_desc *tx_desc; + int i, len, offset, txd_needed; + uint32_t txd_upper, txd_lower; + +#define TXD_USE_COUNT(x) (((x) >> 12) + ((x) & 0x0fff ? 1 : 0)) + +#ifdef MAX_SKB_FRAGS + int f; + skb_frag_t *frag; +#endif + + E1000_DBG("e1000_xmit_frame\n"); + + if(adapter->link_active == FALSE) { +#ifdef IANS + if((adapter->iANSdata->iANS_status == IANS_COMMUNICATION_UP) && + (adapter->iANSdata->reporting_mode == IANS_STATUS_REPORTING_ON)) + if(ans_notify) + ans_notify(netdev, IANS_IND_XMIT_QUEUE_FULL); +#endif + netif_stop_queue(netdev); + return 1; + } + +#ifdef MAX_SKB_FRAGS + txd_needed = TXD_USE_COUNT(skb->len - skb->data_len); + for(f = 0; f < skb_shinfo(skb)->nr_frags; f++) { + frag = &skb_shinfo(skb)->frags[f]; + txd_needed += TXD_USE_COUNT(frag->size); + } +#else + txd_needed = TXD_USE_COUNT(skb->len); +#endif + + /* make sure there are enough Tx descriptors available in the ring */ + if(atomic_read(&adapter->tx_ring.unused) <= (txd_needed + 1)) { + adapter->net_stats.tx_dropped++; +#ifdef IANS + if((adapter->iANSdata->iANS_status == IANS_COMMUNICATION_UP) && + (adapter->iANSdata->reporting_mode == IANS_STATUS_REPORTING_ON)) + if(ans_notify) + ans_notify(netdev, IANS_IND_XMIT_QUEUE_FULL); +#endif + netif_stop_queue(netdev); + + return 1; + } + + if(skb->ip_summed == CHECKSUM_HW) { + e1000_tx_checksum_setup(adapter, skb, &txd_upper, &txd_lower); + } else { + txd_upper = 0; + txd_lower = adapter->TxdCmd; + } + + i = adapter->tx_ring.next_to_use; + tx_desc = E1000_TX_DESC(adapter->tx_ring, i); + +#ifdef IANS + if(adapter->iANSdata->iANS_status == IANS_COMMUNICATION_UP) { + tx_desc->lower.data = cpu_to_le32(txd_lower); + tx_desc->upper.data = cpu_to_le32(txd_upper); + if(bd_ans_os_Transmit(adapter, tx_desc, &skb) == BD_ANS_FAILURE) { + return 1; + } + txd_lower = le32_to_cpu(tx_desc->lower.data); + txd_upper = le32_to_cpu(tx_desc->upper.data); + } +#endif + +#ifdef MAX_SKB_FRAGS + len = skb->len - skb->data_len; +#else + len = skb->len; +#endif + offset = 0; + + while(len > 4096) { + adapter->tx_ring.buffer_info[i].length = 4096; + adapter->tx_ring.buffer_info[i].dma = + pci_map_page(pdev, virt_to_page(skb->data + offset), + (unsigned long) (skb->data + offset) & ~PAGE_MASK, + 4096, PCI_DMA_TODEVICE); + + tx_desc->buffer_addr = cpu_to_le64(adapter->tx_ring.buffer_info[i].dma); + tx_desc->lower.data = cpu_to_le32(txd_lower | 4096); + tx_desc->upper.data = cpu_to_le32(txd_upper); + + len -= 4096; + offset += 4096; + i = (i + 1) % adapter->tx_ring.count; + atomic_dec(&adapter->tx_ring.unused); + tx_desc = E1000_TX_DESC(adapter->tx_ring, i); + } + adapter->tx_ring.buffer_info[i].length = len; + adapter->tx_ring.buffer_info[i].dma = + pci_map_page(pdev, virt_to_page(skb->data + offset), + (unsigned long) (skb->data + offset) & ~PAGE_MASK, len, + PCI_DMA_TODEVICE); + + tx_desc->buffer_addr = cpu_to_le64(adapter->tx_ring.buffer_info[i].dma); + tx_desc->lower.data = cpu_to_le32(txd_lower | len); + tx_desc->upper.data = cpu_to_le32(txd_upper); + +#ifdef MAX_SKB_FRAGS + for(f = 0; f < skb_shinfo(skb)->nr_frags; f++) { + frag = &skb_shinfo(skb)->frags[f]; + i = (i + 1) % adapter->tx_ring.count; + atomic_dec(&adapter->tx_ring.unused); + tx_desc = E1000_TX_DESC(adapter->tx_ring, i); + + len = frag->size; + offset = 0; + + while(len > 4096) { + adapter->tx_ring.buffer_info[i].length = 4096; + adapter->tx_ring.buffer_info[i].dma = + pci_map_page(pdev, frag->page, frag->page_offset + offset, + 4096, PCI_DMA_TODEVICE); + + tx_desc->buffer_addr = + cpu_to_le64(adapter->tx_ring.buffer_info[i].dma); + tx_desc->lower.data = cpu_to_le32(txd_lower | 4096); + tx_desc->upper.data = cpu_to_le32(txd_upper); + + len -= 4096; + offset += 4096; + i = (i + 1) % adapter->tx_ring.count; + atomic_dec(&adapter->tx_ring.unused); + tx_desc = E1000_TX_DESC(adapter->tx_ring, i); + } + adapter->tx_ring.buffer_info[i].length = len; + adapter->tx_ring.buffer_info[i].dma = + pci_map_page(pdev, frag->page, frag->page_offset + offset, len, + PCI_DMA_TODEVICE); + tx_desc->buffer_addr = + cpu_to_le64(adapter->tx_ring.buffer_info[i].dma); + + tx_desc->lower.data = cpu_to_le32(txd_lower | len); + tx_desc->upper.data = cpu_to_le32(txd_upper); + } +#endif + + /* EOP and SKB pointer go with the last fragment */ + tx_desc->lower.data |= cpu_to_le32(E1000_TXD_CMD_EOP); + adapter->tx_ring.buffer_info[i].skb = skb; + + i = (i + 1) % adapter->tx_ring.count; + atomic_dec(&adapter->tx_ring.unused); + + /* Move the HW Tx Tail Pointer */ + adapter->tx_ring.next_to_use = i; + + E1000_WRITE_REG(&adapter->shared, TDT, adapter->tx_ring.next_to_use); + + if(atomic_read(&adapter->tx_timeout) == 0) + atomic_set(&adapter->tx_timeout, 3); + + netdev->trans_start = jiffies; + + return 0; +} + +/** + * e1000_get_stats - Get System Network Statistics + * @netdev: network interface device structure + * + * Returns the address of the device statistics structure. + * The statistics are actually updated from the timer callback. + **/ + +struct net_device_stats * +e1000_get_stats(struct net_device *netdev) +{ + struct e1000_adapter *adapter = netdev->priv; + + E1000_DBG("e1000_get_stats\n"); + + return &adapter->net_stats; +} + +/** + * e1000_change_mtu - Change the Maximum Transfer Unit + * @netdev: network interface device structure + * @new_mtu: new value for maximum frame size + * + * Returns 0 on success, negative on failure + **/ + +int +e1000_change_mtu(struct net_device *netdev, + int new_mtu) +{ + struct e1000_adapter *adapter = netdev->priv; + uint32_t old_mtu = adapter->rx_buffer_len; + + E1000_DBG("e1000_change_mtu\n"); + if((new_mtu < MINIMUM_ETHERNET_PACKET_SIZE - ENET_HEADER_SIZE) || + (new_mtu > MAX_JUMBO_FRAME_SIZE - ENET_HEADER_SIZE)) { + E1000_ERR("Invalid MTU setting\n"); + return -EINVAL; + } + + if(new_mtu <= MAXIMUM_ETHERNET_PACKET_SIZE - ENET_HEADER_SIZE) { + /* 2k buffers */ + adapter->rx_buffer_len = E1000_RXBUFFER_2048; + + } else if(adapter->shared.mac_type < e1000_82543) { + E1000_ERR("Jumbo Frames not supported on 82542\n"); + return -EINVAL; + + } else if(new_mtu <= E1000_RXBUFFER_4096 - ENET_HEADER_SIZE - CRC_LENGTH) { + /* 4k buffers */ + adapter->rx_buffer_len = E1000_RXBUFFER_4096; + + } else if(new_mtu <= E1000_RXBUFFER_8192 - ENET_HEADER_SIZE - CRC_LENGTH) { + /* 8k buffers */ + adapter->rx_buffer_len = E1000_RXBUFFER_8192; + + } else { + /* 16k buffers */ + adapter->rx_buffer_len = E1000_RXBUFFER_16384; + } + + if(old_mtu != adapter->rx_buffer_len && + test_bit(E1000_BOARD_OPEN, &adapter->flags)) { + + /* stop */ + tasklet_disable(&adapter->rx_fill_tasklet); + netif_stop_queue(netdev); + adapter->shared.adapter_stopped = 0; + e1000_adapter_stop(&adapter->shared); + + /* clean out old buffers */ + e1000_clean_rx_ring(adapter); + e1000_clean_tx_ring(adapter); + + /* reset hardware */ + adapter->shared.adapter_stopped = 0; + e1000_hw_init(adapter); + + /* go */ + e1000_setup_rctl(adapter); + e1000_configure_rx(adapter); + e1000_configure_tx(adapter); +#ifdef IANS + /* restore VLAN settings */ + if((IANS_BD_TAGGING_MODE) (ANS_PRIVATE_DATA_FIELD(adapter)->tag_mode) + != IANS_BD_TAGGING_NONE) + bd_ans_hw_EnableVLAN(adapter); +#endif + tasklet_enable(&adapter->rx_fill_tasklet); + tasklet_schedule(&adapter->rx_fill_tasklet); + e1000_irq_enable(adapter); + netif_start_queue(netdev); + } + + netdev->mtu = new_mtu; + adapter->shared.max_frame_size = new_mtu + ENET_HEADER_SIZE + CRC_LENGTH; + + return 0; +} + +/** + * e1000_set_mac - Change the Ethernet Address of the NIC + * @netdev: network interface device structure + * @p: pointer to an address structure + * + * Returns 0 on success, negative on failure + **/ + +int +e1000_set_mac(struct net_device *netdev, + void *p) +{ + struct e1000_adapter *adapter = netdev->priv; + struct pci_dev *pdev = adapter->pdev; + struct sockaddr *addr = (struct sockaddr *) p; + uint32_t pci_command; + uint32_t rctl; + + E1000_DBG("e1000_set_mac\n"); + + rctl = E1000_READ_REG(&adapter->shared, RCTL); + + if(adapter->shared.mac_type == e1000_82542_rev2_0) { + if(adapter->shared.pci_cmd_word & PCI_COMMAND_INVALIDATE) { + pci_command = + adapter->shared.pci_cmd_word & ~PCI_COMMAND_INVALIDATE; + pci_write_config_word(pdev, PCI_COMMAND, pci_command); + } + E1000_WRITE_REG(&adapter->shared, RCTL, rctl | E1000_RCTL_RST); + mdelay(5); + if(test_bit(E1000_BOARD_OPEN, &adapter->flags)) { + tasklet_disable(&adapter->rx_fill_tasklet); + e1000_clean_rx_ring(adapter); + } + } + + memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); + memcpy(adapter->shared.mac_addr, addr->sa_data, netdev->addr_len); + + e1000_rar_set(&adapter->shared, adapter->shared.mac_addr, 0); + + if(adapter->shared.mac_type == e1000_82542_rev2_0) { + E1000_WRITE_REG(&adapter->shared, RCTL, rctl); + mdelay(5); + if(adapter->shared.pci_cmd_word & PCI_COMMAND_INVALIDATE) { + pci_write_config_word(pdev, PCI_COMMAND, + adapter->shared.pci_cmd_word); + } + if(test_bit(E1000_BOARD_OPEN, &adapter->flags)) { + e1000_configure_rx(adapter); + tasklet_enable(&adapter->rx_fill_tasklet); + } + } + + return 0; +} + +/** + * e1000_update_stats - Update the board statistics counters + * @adapter: board private structure + **/ + +static void +e1000_update_stats(struct e1000_adapter *adapter) +{ + unsigned long flags; + +#define PHY_IDLE_ERROR_COUNT_MASK 0x00FF + + spin_lock_irqsave(&adapter->stats_lock, flags); + + adapter->stats.crcerrs += E1000_READ_REG(&adapter->shared, CRCERRS); + adapter->stats.symerrs += E1000_READ_REG(&adapter->shared, SYMERRS); + adapter->stats.mpc += E1000_READ_REG(&adapter->shared, MPC); + adapter->stats.scc += E1000_READ_REG(&adapter->shared, SCC); + adapter->stats.ecol += E1000_READ_REG(&adapter->shared, ECOL); + adapter->stats.mcc += E1000_READ_REG(&adapter->shared, MCC); + adapter->stats.latecol += E1000_READ_REG(&adapter->shared, LATECOL); + adapter->stats.colc += E1000_READ_REG(&adapter->shared, COLC); + adapter->stats.dc += E1000_READ_REG(&adapter->shared, DC); + adapter->stats.sec += E1000_READ_REG(&adapter->shared, SEC); + adapter->stats.rlec += E1000_READ_REG(&adapter->shared, RLEC); + adapter->stats.xonrxc += E1000_READ_REG(&adapter->shared, XONRXC); + adapter->stats.xontxc += E1000_READ_REG(&adapter->shared, XONTXC); + adapter->stats.xoffrxc += E1000_READ_REG(&adapter->shared, XOFFRXC); + adapter->stats.xofftxc += E1000_READ_REG(&adapter->shared, XOFFTXC); + adapter->stats.fcruc += E1000_READ_REG(&adapter->shared, FCRUC); + adapter->stats.prc64 += E1000_READ_REG(&adapter->shared, PRC64); + adapter->stats.prc127 += E1000_READ_REG(&adapter->shared, PRC127); + adapter->stats.prc255 += E1000_READ_REG(&adapter->shared, PRC255); + adapter->stats.prc511 += E1000_READ_REG(&adapter->shared, PRC511); + adapter->stats.prc1023 += E1000_READ_REG(&adapter->shared, PRC1023); + adapter->stats.prc1522 += E1000_READ_REG(&adapter->shared, PRC1522); + adapter->stats.gprc += E1000_READ_REG(&adapter->shared, GPRC); + adapter->stats.bprc += E1000_READ_REG(&adapter->shared, BPRC); + adapter->stats.mprc += E1000_READ_REG(&adapter->shared, MPRC); + adapter->stats.gptc += E1000_READ_REG(&adapter->shared, GPTC); + + /* for the 64-bit byte counters the low dword must be read first */ + /* both registers clear on the read of the high dword */ + + adapter->stats.gorcl += E1000_READ_REG(&adapter->shared, GORCL); + adapter->stats.gorch += E1000_READ_REG(&adapter->shared, GORCH); + adapter->stats.gotcl += E1000_READ_REG(&adapter->shared, GOTCL); + adapter->stats.gotch += E1000_READ_REG(&adapter->shared, GOTCH); + + adapter->stats.rnbc += E1000_READ_REG(&adapter->shared, RNBC); + adapter->stats.ruc += E1000_READ_REG(&adapter->shared, RUC); + adapter->stats.rfc += E1000_READ_REG(&adapter->shared, RFC); + adapter->stats.roc += E1000_READ_REG(&adapter->shared, ROC); + adapter->stats.rjc += E1000_READ_REG(&adapter->shared, RJC); + + adapter->stats.torl += E1000_READ_REG(&adapter->shared, TORL); + adapter->stats.torh += E1000_READ_REG(&adapter->shared, TORH); + adapter->stats.totl += E1000_READ_REG(&adapter->shared, TOTL); + adapter->stats.toth += E1000_READ_REG(&adapter->shared, TOTH); + + adapter->stats.tpr += E1000_READ_REG(&adapter->shared, TPR); + adapter->stats.tpt += E1000_READ_REG(&adapter->shared, TPT); + adapter->stats.ptc64 += E1000_READ_REG(&adapter->shared, PTC64); + adapter->stats.ptc127 += E1000_READ_REG(&adapter->shared, PTC127); + adapter->stats.ptc255 += E1000_READ_REG(&adapter->shared, PTC255); + adapter->stats.ptc511 += E1000_READ_REG(&adapter->shared, PTC511); + adapter->stats.ptc1023 += E1000_READ_REG(&adapter->shared, PTC1023); + adapter->stats.ptc1522 += E1000_READ_REG(&adapter->shared, PTC1522); + adapter->stats.mptc += E1000_READ_REG(&adapter->shared, MPTC); + adapter->stats.bptc += E1000_READ_REG(&adapter->shared, BPTC); + + if(adapter->shared.mac_type >= e1000_82543) { + adapter->stats.algnerrc += E1000_READ_REG(&adapter->shared, ALGNERRC); + adapter->stats.rxerrc += E1000_READ_REG(&adapter->shared, RXERRC); + adapter->stats.tncrs += E1000_READ_REG(&adapter->shared, TNCRS); + adapter->stats.cexterr += E1000_READ_REG(&adapter->shared, CEXTERR); + adapter->stats.tsctc += E1000_READ_REG(&adapter->shared, TSCTC); + adapter->stats.tsctfc += E1000_READ_REG(&adapter->shared, TSCTFC); + } + + /* Fill out the OS statistics structure */ + + adapter->net_stats.rx_packets = adapter->stats.gprc; + adapter->net_stats.tx_packets = adapter->stats.gptc; + adapter->net_stats.rx_bytes = adapter->stats.gorcl; + adapter->net_stats.tx_bytes = adapter->stats.gotcl; + adapter->net_stats.multicast = adapter->stats.mprc; + adapter->net_stats.collisions = adapter->stats.colc; + + /* Rx Errors */ + + adapter->net_stats.rx_errors = + adapter->stats.rxerrc + adapter->stats.crcerrs + + adapter->stats.algnerrc + adapter->stats.rlec + adapter->stats.rnbc + + adapter->stats.mpc + adapter->stats.cexterr; + adapter->net_stats.rx_dropped = adapter->stats.rnbc; + adapter->net_stats.rx_length_errors = adapter->stats.rlec; + adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs; + adapter->net_stats.rx_frame_errors = adapter->stats.algnerrc; + adapter->net_stats.rx_fifo_errors = adapter->stats.mpc; + adapter->net_stats.rx_missed_errors = adapter->stats.mpc; + + /* Tx Errors */ + + adapter->net_stats.tx_errors = adapter->stats.ecol + adapter->stats.latecol; + adapter->net_stats.tx_aborted_errors = adapter->stats.ecol; + adapter->net_stats.tx_window_errors = adapter->stats.latecol; + + /* Tx Dropped needs to be maintained elsewhere */ + + if(adapter->shared.media_type == e1000_media_type_copper) { + adapter->phy_stats.idle_errors += + (e1000_read_phy_reg(&adapter->shared, PHY_1000T_STATUS) + & PHY_IDLE_ERROR_COUNT_MASK); + adapter->phy_stats.receive_errors += + e1000_read_phy_reg(&adapter->shared, M88E1000_RX_ERR_CNTR); + } + + spin_unlock_irqrestore(&adapter->stats_lock, flags); + return; +} + +/** + * e1000_irq_disable - Mask off interrupt generation on the NIC + * @adapter: board private structure + **/ + +static inline void +e1000_irq_disable(struct e1000_adapter *adapter) +{ + E1000_DBG("e1000_irq_disable\n"); + + /* Mask off all interrupts */ + + E1000_WRITE_REG(&adapter->shared, IMC, ~0); + return; +} + +/** + * e1000_irq_enable - Enable default interrupt generation settings + * @adapter: board private structure + **/ + +static inline void +e1000_irq_enable(struct e1000_adapter *adapter) +{ + E1000_DBG("e1000_irq_enable\n"); + + E1000_WRITE_REG(&adapter->shared, IMS, adapter->int_mask); + return; +} + +/** + * e1000_intr - Interrupt Handler + * @irq: interrupt number + * @data: pointer to a network interface device structure + * @pt_regs: CPU registers structure + **/ + +void +e1000_intr(int irq, + void *data, + struct pt_regs *regs) +{ + struct net_device *netdev = (struct net_device *) data; + struct e1000_adapter *adapter = netdev->priv; + uint32_t icr; + uint loop_count = E1000_MAX_INTR; + + E1000_DBG("e1000_intr\n"); + + e1000_irq_disable(adapter); + + while(loop_count > 0 && (icr = E1000_READ_REG(&adapter->shared, ICR)) != 0) { + + if(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { + adapter->shared.get_link_status = 1; + set_bit(E1000_LINK_STATUS_CHANGED, &adapter->flags); + /* run the watchdog ASAP */ + mod_timer(&adapter->timer_id, jiffies); + } + + e1000_clean_rx_irq(adapter); + e1000_clean_tx_irq(adapter); + loop_count--; + } + + e1000_irq_enable(adapter); + + return; +} + +/** + * e1000_clean_tx_irq - Reclaim resources after transmit completes + * @adapter: board private structure + **/ + +static void +e1000_clean_tx_irq(struct e1000_adapter *adapter) +{ + struct pci_dev *pdev = adapter->pdev; + int i; + + struct e1000_tx_desc *tx_desc; + struct net_device *netdev = adapter->netdev; + + E1000_DBG("e1000_clean_tx_irq\n"); + + i = adapter->tx_ring.next_to_clean; + tx_desc = E1000_TX_DESC(adapter->tx_ring, i); + + while(tx_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) { + + if(adapter->tx_ring.buffer_info[i].dma != 0) { + pci_unmap_page(pdev, adapter->tx_ring.buffer_info[i].dma, + adapter->tx_ring.buffer_info[i].length, + PCI_DMA_TODEVICE); + adapter->tx_ring.buffer_info[i].dma = 0; + } + + if(adapter->tx_ring.buffer_info[i].skb != NULL) { + dev_kfree_skb_irq(adapter->tx_ring.buffer_info[i].skb); + adapter->tx_ring.buffer_info[i].skb = NULL; + } + + atomic_inc(&adapter->tx_ring.unused); + i = (i + 1) % adapter->tx_ring.count; + + tx_desc->upper.data = 0; + tx_desc = E1000_TX_DESC(adapter->tx_ring, i); + } + + adapter->tx_ring.next_to_clean = i; + + if(adapter->tx_ring.next_to_clean == adapter->tx_ring.next_to_use) + atomic_set(&adapter->tx_timeout, 0); + else + atomic_set(&adapter->tx_timeout, 3); + + if(netif_queue_stopped(netdev) && + (atomic_read(&adapter->tx_ring.unused) > + (adapter->tx_ring.count * 3 / 4))) { + +#ifdef IANS + if((adapter->iANSdata->iANS_status == IANS_COMMUNICATION_UP) && + (adapter->iANSdata->reporting_mode == IANS_STATUS_REPORTING_ON)) + if(ans_notify) + ans_notify(netdev, IANS_IND_XMIT_QUEUE_READY); +#endif + netif_wake_queue(netdev); + } + + return; +} + +/** + * e1000_clean_rx_irq - Send received data up the network stack, + * @adapter: board private structure + **/ + +static void +e1000_clean_rx_irq(struct e1000_adapter *adapter) +{ + struct net_device *netdev = adapter->netdev; + struct pci_dev *pdev = adapter->pdev; + struct e1000_rx_desc *rx_desc; + int i; + uint32_t length; + struct sk_buff *skb; + uint8_t last_byte; + unsigned long flags; + + E1000_DBG("e1000_clean_rx_irq\n"); + + i = adapter->rx_ring.next_to_clean; + rx_desc = E1000_RX_DESC(adapter->rx_ring, i); + + while(rx_desc->status & E1000_RXD_STAT_DD) { + pci_unmap_single(pdev, adapter->rx_ring.buffer_info[i].dma, + adapter->rx_ring.buffer_info[i].length, + PCI_DMA_FROMDEVICE); + + skb = adapter->rx_ring.buffer_info[i].skb; + length = le16_to_cpu(rx_desc->length); + + if(!(rx_desc->status & E1000_RXD_STAT_EOP)) { + + /* All receives must fit into a single buffer */ + + E1000_DBG("Receive packet consumed multiple buffers\n"); + + dev_kfree_skb_irq(skb); + memset(rx_desc, 0, 16); + mb(); + adapter->rx_ring.buffer_info[i].skb = NULL; + + atomic_inc(&adapter->rx_ring.unused); + + i = (i + 1) % adapter->rx_ring.count; + + rx_desc = E1000_RX_DESC(adapter->rx_ring, i); + continue; + } + + if(rx_desc->errors & E1000_RXD_ERR_FRAME_ERR_MASK) { + + last_byte = *(skb->data + length - 1); + + if(TBI_ACCEPT + (&adapter->shared, rx_desc->status, rx_desc->errors, length, + last_byte)) { + spin_lock_irqsave(&adapter->stats_lock, flags); + e1000_tbi_adjust_stats(&adapter->shared, &adapter->stats, + length, skb->data); + spin_unlock_irqrestore(&adapter->stats_lock, flags); + length--; + } else { + + E1000_DBG("Receive Errors Reported by Hardware\n"); + + dev_kfree_skb_irq(skb); + memset(rx_desc, 0, 16); + mb(); + adapter->rx_ring.buffer_info[i].skb = NULL; + + atomic_inc(&adapter->rx_ring.unused); + i = (i + 1) % adapter->rx_ring.count; + + rx_desc = E1000_RX_DESC(adapter->rx_ring, i); + continue; + } + } + + /* Good Receive */ + skb_put(skb, length - CRC_LENGTH); + + /* Adjust socket buffer accounting to only cover the ethernet frame + * Not what the stack intends, but there exist TCP problems that + * break NFS for network interfaces that need 2k receive buffers + */ + skb->truesize = skb->len; + + /* Receive Checksum Offload */ + e1000_rx_checksum(adapter, rx_desc, skb); + +#ifdef IANS + if(adapter->iANSdata->iANS_status == IANS_COMMUNICATION_UP) { + if(bd_ans_os_Receive(adapter, rx_desc, skb) == BD_ANS_FAILURE) + dev_kfree_skb_irq(skb); + else + netif_rx(skb); + } else { + skb->protocol = eth_type_trans(skb, netdev); + netif_rx(skb); + } +#else + skb->protocol = eth_type_trans(skb, netdev); + netif_rx(skb); +#endif + memset(rx_desc, 0, 16); + mb(); + adapter->rx_ring.buffer_info[i].skb = NULL; + + atomic_inc(&adapter->rx_ring.unused); + + i = (i + 1) % adapter->rx_ring.count; + + rx_desc = E1000_RX_DESC(adapter->rx_ring, i); + } + + /* if the Rx ring is less than 3/4 full, allocate more sk_buffs */ + + if(atomic_read(&adapter->rx_ring.unused) > (adapter->rx_ring.count / 4)) { + tasklet_schedule(&adapter->rx_fill_tasklet); + } + adapter->rx_ring.next_to_clean = i; + + return; +} + +/** + * e1000_alloc_rx_buffers - Replace used receive buffers + * @data: address of board private structure + **/ + +static void +e1000_alloc_rx_buffers(unsigned long data) +{ + struct e1000_adapter *adapter = (struct e1000_adapter *) data; + struct net_device *netdev = adapter->netdev; + struct pci_dev *pdev = adapter->pdev; + struct e1000_rx_desc *rx_desc; + struct sk_buff *skb; + int i; + int reserve_len; + + E1000_DBG("e1000_alloc_rx_buffers\n"); + + /* kernel 2.4.7 seems to be broken with respect to tasklet locking */ + if(!spin_trylock(&adapter->rx_fill_lock)) + return; + + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) { + spin_unlock(&adapter->rx_fill_lock); + return; + } + +#ifdef IANS + reserve_len = E1000_ROUNDUP2(BD_ANS_INFO_SIZE, 16) + 2; +#else + reserve_len = 2; +#endif + + i = adapter->rx_ring.next_to_use; + + while(adapter->rx_ring.buffer_info[i].skb == NULL) { + rx_desc = E1000_RX_DESC(adapter->rx_ring, i); + + skb = alloc_skb(adapter->rx_buffer_len + reserve_len, GFP_ATOMIC); + + if(skb == NULL) { + /* Alloc Failed; If we could not allocate a + * skb during this schedule. Wait for a while before + * tasklet to allocate skb is called again. + */ + set_bit(E1000_RX_REFILL, &adapter->flags); + break; + } + + /* Make buffer alignment 2 beyond a 16 byte boundary + * this will result in a 16 byte aligned IP header after + * the 14 byte MAC header is removed + */ + skb_reserve(skb, reserve_len); + + skb->dev = netdev; + + adapter->rx_ring.buffer_info[i].skb = skb; + adapter->rx_ring.buffer_info[i].length = adapter->rx_buffer_len; + adapter->rx_ring.buffer_info[i].dma = + pci_map_single(pdev, skb->data, adapter->rx_buffer_len, + PCI_DMA_FROMDEVICE); + + rx_desc->buffer_addr = cpu_to_le64(adapter->rx_ring.buffer_info[i].dma); + + /* move tail */ + E1000_WRITE_REG(&adapter->shared, RDT, i); + + atomic_dec(&adapter->rx_ring.unused); + + i = (i + 1) % adapter->rx_ring.count; + + if(test_and_clear_bit(E1000_RX_REFILL, &adapter->flags)) { + /* Trigger Soft Interrupt */ + E1000_WRITE_REG(&adapter->shared, ICS, E1000_ICS_RXT0); + } + } + + adapter->rx_ring.next_to_use = i; + + spin_unlock(&adapter->rx_fill_lock); + return; +} + +/** + * e1000_ioctl - + * @netdev: + * @ifreq: + * @cmd: + **/ + +int +e1000_ioctl(struct net_device *netdev, + struct ifreq *ifr, + int cmd) +{ +#ifdef IANS + IANS_BD_PARAM_HEADER *header; +#endif + + E1000_DBG("e1000_do_ioctl\n"); + + switch (cmd) { + +#ifdef IANS + case IANS_BASE_SIOC: + header = (IANS_BD_PARAM_HEADER *) ifr->ifr_data; + if((header->Opcode != IANS_OP_EXT_GET_STATUS) && + (!capable(CAP_NET_ADMIN))) + return -EPERM; + return bd_ans_os_Ioctl(netdev, ifr, cmd); + break; +#endif + +#ifdef IDIAG + case IDIAG_PRO_BASE_SIOC: + if(!capable(CAP_NET_ADMIN)) + return -EPERM; + +#ifdef DIAG_DEBUG + printk("Entering diagnostics\n"); +#endif + e1000_diag_ioctl(netdev, ifr); + break; +#endif /* IDIAG */ + +#ifdef SIOCETHTOOL + case SIOCETHTOOL: + + return e1000_ethtool_ioctl(netdev, ifr); + + break; +#endif + + default: + return -EOPNOTSUPP; + } + + return 0; +} + +/** + * e1000_rx_checksum - Receive Checksum Offload for 82543 + * @adapter: board private structure + * @rx_desc: receive descriptor + * @sk_buff: socket buffer with received data + **/ + +static inline void +e1000_rx_checksum(struct e1000_adapter *adapter, + struct e1000_rx_desc *rx_desc, + struct sk_buff *skb) +{ + /* 82543 or newer only */ + if((adapter->shared.mac_type < e1000_82543) || + /* Ignore Checksum bit is set */ + (rx_desc->status & E1000_RXD_STAT_IXSM) || + /* TCP Checksum has not been calculated */ + (!(rx_desc->status & E1000_RXD_STAT_TCPCS))) { + + skb->ip_summed = CHECKSUM_NONE; + return; + } + + /* At this point we know the hardware did the TCP checksum */ + /* now look at the TCP checksum error bit */ + if(rx_desc->errors & E1000_RXD_ERR_TCPE) { + /* let the stack verify checksum errors */ + skb->ip_summed = CHECKSUM_NONE; + adapter->XsumRXError++; + } else { + /* TCP checksum is good */ + skb->ip_summed = CHECKSUM_UNNECESSARY; + adapter->XsumRXGood++; + } + + return; +} + +void +e1000_hibernate_adapter(struct net_device *netdev) +{ + uint32_t icr; + struct e1000_adapter *adapter = netdev->priv; + + e1000_irq_disable(adapter); + netif_stop_queue(netdev); + adapter->shared.adapter_stopped = 0; + e1000_adapter_stop(&adapter->shared); + + if(test_bit(E1000_BOARD_OPEN, &adapter->flags)) { + + /* Disable tasklet only when interface is opened. */ + tasklet_disable(&adapter->rx_fill_tasklet); + + /* clean out old buffers */ + e1000_clean_rx_ring(adapter); + e1000_clean_tx_ring(adapter); + + /* Delete watchdog timer */ + del_timer(&adapter->timer_id); + + /* Unhook irq */ + e1000_irq_disable(adapter); + icr = E1000_READ_REG(&adapter->shared, ICR); + free_irq(netdev->irq, netdev); + } +} + +void +e1000_wakeup_adapter(struct net_device *netdev) +{ + uint32_t icr; + struct e1000_adapter *adapter = netdev->priv; + + adapter->shared.adapter_stopped = 0; + e1000_adapter_stop(&adapter->shared); + adapter->shared.adapter_stopped = 0; + adapter->shared.fc = adapter->shared.original_fc; + + if(!e1000_init_hw(&adapter->shared)) + printk("Hardware Init Failed at wakeup\n"); + + if(test_bit(E1000_BOARD_OPEN, &adapter->flags)) { + + /* Setup Rctl */ + e1000_setup_rctl(adapter); + e1000_configure_rx(adapter); + e1000_alloc_rx_buffers((unsigned long) adapter); + e1000_set_multi(netdev); + e1000_configure_tx(adapter); + +#ifdef IANS + if((IANS_BD_TAGGING_MODE) (ANS_PRIVATE_DATA_FIELD(adapter)->tag_mode) + != IANS_BD_TAGGING_NONE) + bd_ans_hw_EnableVLAN(adapter); +#endif + + /* Set the watchdog timer for 2 seconds */ + init_timer(&adapter->timer_id); + adapter->timer_id.function = &e1000_watchdog; + adapter->timer_id.data = (unsigned long) netdev; + mod_timer(&adapter->timer_id, (jiffies + 2 * HZ)); + + tasklet_enable(&adapter->rx_fill_tasklet); + + /* Hook irq */ + e1000_irq_disable(adapter); + icr = E1000_READ_REG(&adapter->shared, ICR); + if(request_irq + (netdev->irq, &e1000_intr, SA_SHIRQ, e1000_driver_name, netdev) != 0) + printk(KERN_ERR "e1000: Unable to hook irq.\n"); + + e1000_irq_enable(adapter); + netif_start_queue(netdev); + } +} + +#ifdef IDIAG +int +e1000_xmit_lbtest_frame(struct sk_buff *skb, + struct e1000_adapter *adapter) +{ + /*struct e1000_adapter *adapter = netdev->priv; */ + struct pci_dev *pdev = adapter->pdev; + struct e1000_tx_desc *tx_desc; + int i; + + i = adapter->tx_ring.next_to_use; + tx_desc = E1000_TX_DESC(adapter->tx_ring, i); + + adapter->tx_ring.buffer_info[i].skb = skb; + adapter->tx_ring.buffer_info[i].length = skb->len; + adapter->tx_ring.buffer_info[i].dma = + pci_map_page(pdev, virt_to_page(skb->data), + (unsigned long) skb->data & ~PAGE_MASK, skb->len, + PCI_DMA_TODEVICE); + + tx_desc->buffer_addr = cpu_to_le64(adapter->tx_ring.buffer_info[i].dma); + tx_desc->lower.data = cpu_to_le32(skb->len); + + /* zero out the status field in the descriptor */ + + tx_desc->upper.data = 0; + + tx_desc->lower.data |= E1000_TXD_CMD_EOP; + tx_desc->lower.data |= E1000_TXD_CMD_IFCS; + tx_desc->lower.data |= E1000_TXD_CMD_IDE; + + if(adapter->shared.report_tx_early == 1) + tx_desc->lower.data |= E1000_TXD_CMD_RS; + else + tx_desc->lower.data |= E1000_TXD_CMD_RPS; + + /* Move the HW Tx Tail Pointer */ + + adapter->tx_ring.next_to_use++; + adapter->tx_ring.next_to_use %= adapter->tx_ring.count; + + E1000_WRITE_REG(&adapter->shared, TDT, adapter->tx_ring.next_to_use); + mdelay(10); + + atomic_dec(&adapter->tx_ring.unused); + + if(atomic_read(&adapter->tx_ring.unused) <= 1) { + + /* this driver never actually drops transmits, + * so use tx_dropped count to indicate the number of times + * netif_stop_queue is called due to no available descriptors + */ + + adapter->net_stats.tx_dropped++; + return (0); + } + return (1); +} + +int +e1000_rcv_lbtest_frame(struct e1000_adapter *adapter, + unsigned int frame_size) +{ + struct pci_dev *pdev = adapter->pdev; + struct e1000_rx_desc *rx_desc; + int i, j = 0, rcved_pkt = 0; + uint32_t Length; + struct sk_buff *skb; + + mdelay(500); + i = adapter->rx_ring.next_to_clean; + rx_desc = E1000_RX_DESC(adapter->rx_ring, i); + + while(rx_desc->status & E1000_RXD_STAT_DD) { + Length = le16_to_cpu(rx_desc->length) - CRC_LENGTH; + skb = adapter->rx_ring.buffer_info[i].skb; + + /* Snoop the packet for pattern */ + rcved_pkt = e1000_check_lbtest_frame(skb, frame_size); + + pci_unmap_single(pdev, adapter->rx_ring.buffer_info[i].dma, + adapter->rx_ring.buffer_info[i].length, + PCI_DMA_FROMDEVICE); + + dev_kfree_skb_irq(skb); + adapter->rx_ring.buffer_info[i].skb = NULL; + + rx_desc->status = 0; + atomic_inc(&adapter->rx_ring.unused); + + i++; + i %= adapter->rx_ring.count; + rx_desc = E1000_RX_DESC(adapter->rx_ring, i); + + if(rcved_pkt) + break; + + /* waited enough */ + if(j++ >= adapter->rx_ring.count) + return 0; + + mdelay(5); + + } + + adapter->rx_ring.next_to_clean = i; + + return (rcved_pkt); + +} + +void +e1000_selective_wakeup_adapter(struct net_device *netdev) +{ + struct e1000_adapter *adapter = netdev->priv; + uint32_t ctrl, txcw; + + e1000_init_hw(&adapter->shared); + + if((adapter->link_active == FALSE) && + (adapter->shared.mac_type == e1000_82543)) { + + txcw = E1000_READ_REG(&adapter->shared, TXCW); + ctrl = E1000_READ_REG(&adapter->shared, CTRL); + E1000_WRITE_REG(&adapter->shared, TXCW, txcw & ~E1000_TXCW_ANE); + E1000_WRITE_REG(&adapter->shared, CTRL, + (ctrl | E1000_CTRL_SLU | E1000_CTRL_ILOS | + E1000_CTRL_FD)); + mdelay(20); + } + + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) { + set_bit(E1000_BOARD_OPEN, &adapter->flags); + set_bit(E1000_DIAG_OPEN, &adapter->flags); + e1000_setup_tx_resources(adapter); + e1000_setup_rx_resources(adapter); + } + e1000_setup_rctl(adapter); + e1000_configure_rx(adapter); + e1000_alloc_rx_buffers((unsigned long) adapter); + e1000_configure_tx(adapter); +} + +void +e1000_selective_hibernate_adapter(struct net_device *netdev) +{ + struct e1000_adapter *adapter = netdev->priv; + uint32_t ctrl, txcw; + + if((adapter->link_active == FALSE) && + (adapter->shared.mac_type == e1000_82543)) { + + txcw = E1000_READ_REG(&adapter->shared, TXCW); + ctrl = E1000_READ_REG(&adapter->shared, CTRL); + ctrl &= ~E1000_CTRL_SLU & ~E1000_CTRL_ILOS; + E1000_WRITE_REG(&adapter->shared, TXCW, txcw | E1000_TXCW_ANE); + E1000_WRITE_REG(&adapter->shared, CTRL, ctrl); + mdelay(20); + } + /* clean out old buffers */ + e1000_clean_rx_ring(adapter); + e1000_clean_tx_ring(adapter); + if(test_and_clear_bit(E1000_DIAG_OPEN, &adapter->flags)) { + e1000_free_tx_resources(adapter); + e1000_free_rx_resources(adapter); + clear_bit(E1000_BOARD_OPEN, &adapter->flags); + } +} + +static int +e1000_check_lbtest_frame(struct sk_buff *skb, + unsigned int frame_size) +{ + frame_size = (frame_size % 2) ? (frame_size - 1) : frame_size; + if(*(skb->data + 3) == 0xFF) { + if((*(skb->data + frame_size / 2 + 10) == 0xBE) && + (*(skb->data + frame_size / 2 + 12) == 0xAF)) { + return 1; + } + } + return 0; +} +#endif /* IDIAG */ + +#ifdef SIOCETHTOOL +/** + * e1000_ethtool_ioctl - Ethtool Ioctl Support + * @netdev: net device structure + * @ifr: interface request structure + **/ + +static int +e1000_ethtool_ioctl(struct net_device *netdev, + struct ifreq *ifr) +{ + struct ethtool_cmd eth_cmd; + struct e1000_adapter *adapter = netdev->priv; + boolean_t re_initiate = FALSE; + +#ifdef ETHTOOL_GLINK + struct ethtool_value eth_e1000_linkinfo; +#endif +#ifdef ETHTOOL_GDRVINFO + struct ethtool_drvinfo eth_e1000_info; +#endif +#ifdef ETHTOOL_GWOL + struct ethtool_wolinfo eth_e1000_wolinfo; +#endif + + /* Get the data structure */ + if(copy_from_user(ð_cmd, ifr->ifr_data, sizeof(eth_cmd))) + return -EFAULT; + + switch (eth_cmd.cmd) { + /* Get the information */ + case ETHTOOL_GSET: + if(adapter->shared.media_type == e1000_media_type_copper) { + eth_cmd.supported = E1000_ETHTOOL_COPPER_INTERFACE_SUPPORTS; + eth_cmd.advertising = E1000_ETHTOOL_COPPER_INTERFACE_ADVERTISE; + eth_cmd.port = PORT_MII; + eth_cmd.phy_address = adapter->shared.phy_addr; + eth_cmd.transceiver = + (adapter->shared.mac_type > + e1000_82543) ? XCVR_INTERNAL : XCVR_EXTERNAL; + } else { + eth_cmd.supported = E1000_ETHTOOL_FIBER_INTERFACE_SUPPORTS; + eth_cmd.advertising = E1000_ETHTOOL_FIBER_INTERFACE_ADVERTISE; + eth_cmd.port = PORT_FIBRE; + } + + if(adapter->link_active == TRUE) { + e1000_get_speed_and_duplex(&adapter->shared, &adapter->link_speed, + &adapter->link_duplex); + eth_cmd.speed = adapter->link_speed; + eth_cmd.duplex = + (adapter->link_duplex == + FULL_DUPLEX) ? DUPLEX_FULL : DUPLEX_HALF; + } else { + eth_cmd.speed = 0; + eth_cmd.duplex = 0; + } + + if(adapter->shared.autoneg) + eth_cmd.autoneg = AUTONEG_ENABLE; + else + eth_cmd.autoneg = AUTONEG_DISABLE; + + if(copy_to_user(ifr->ifr_data, ð_cmd, sizeof(eth_cmd))) + return -EFAULT; + + break; + + /* set information */ + case ETHTOOL_SSET: + /* need proper permission to do set */ + if(!capable(CAP_NET_ADMIN)) + return -EPERM; + + /* Cannot Force speed/duplex and at the same time autoneg. + * Autoneg will override forcing. + * For example to force speed/duplex pass in + * 'speed 100 duplex half autoneg off' + * pass in 'autoneg on' to start autoneg. + */ + printk("e1000: Requested link to be forced to %d Speed, %s Duplex " + "%s\n", eth_cmd.speed, (eth_cmd.duplex ? "Full" : "Half"), + (eth_cmd.autoneg ? "and Autonegotiate" : ".")); + + if(eth_cmd.autoneg && eth_cmd.speed) + printk("e1000: Autoneg request will over-ride speed forcing\n"); + + /* if not in autoneg mode and have been asked to enable autoneg */ + if(eth_cmd.autoneg) { + if(adapter->shared.autoneg && + adapter->shared.autoneg_advertised == AUTONEG_ADV_DEFAULT) + /* If already in Autoneg */ + return 0; + else { + adapter->shared.autoneg = 1; + adapter->shared.autoneg_advertised = AUTONEG_ADV_DEFAULT; + re_initiate = TRUE; + } + } + /* Force link to whatever speed and duplex */ + /* Also turning off Autoneg in case of non-gig speeds */ + else if(eth_cmd.speed) { + /* Check for invalid request */ + if(((eth_cmd.speed != SPEED_10) && (eth_cmd.speed != SPEED_100) && + (eth_cmd.speed != SPEED_1000)) || + ((eth_cmd.duplex != DUPLEX_HALF) && + (eth_cmd.duplex != DUPLEX_FULL)) || + (adapter->shared.media_type == e1000_media_type_fiber)) + return -EINVAL; + + e1000_get_speed_and_duplex(&adapter->shared, &adapter->link_speed, + &adapter->link_duplex); + /* If we are already forced to requested speed and duplex + * Donot do anything, just return + */ + if(!adapter->shared.autoneg && + (adapter->link_speed == eth_cmd.speed) && + (adapter->link_duplex == (eth_cmd.duplex + 1))) + + return 0; + + adapter->shared.autoneg = 0; + adapter->shared.autoneg_advertised = 0; + re_initiate = TRUE; + switch (eth_cmd.speed + eth_cmd.duplex) { + case (SPEED_10 + DUPLEX_HALF): + adapter->shared.forced_speed_duplex = e1000_10_half; + break; + case (SPEED_100 + DUPLEX_HALF): + adapter->shared.forced_speed_duplex = e1000_100_half; + break; + case (SPEED_10 + DUPLEX_FULL): + adapter->shared.forced_speed_duplex = e1000_10_full; + break; + case (SPEED_100 + DUPLEX_FULL): + adapter->shared.forced_speed_duplex = e1000_100_full; + break; + case (SPEED_1000 + DUPLEX_HALF): + printk("Half Duplex is not supported at 1000 Mbps\n"); + case (SPEED_1000 + DUPLEX_FULL): + printk("Using Auto-neg at 1000 Mbps Full Duplex\n"); + default: + adapter->shared.autoneg = 1; + adapter->shared.autoneg_advertised = ADVERTISE_1000_FULL; + break; + } + } + + /* End of force */ + /* Put the adapter to new settings */ + if(re_initiate == TRUE) { + e1000_hibernate_adapter(netdev); + e1000_wakeup_adapter(netdev); + } else if(!eth_cmd.autoneg && !eth_cmd.speed) { + printk("Cannot turn off autoneg without " + "knowing what speed to force the link\n"); + printk("Speed specified was %dMbps\n", eth_cmd.speed); + return -EINVAL; + } + /* We donot support setting of + * whatever else that was requested */ + else + return -EOPNOTSUPP; + + break; + +#ifdef ETHTOOL_NWAY_RST + case ETHTOOL_NWAY_RST: + /* need proper permission to restart auto-negotiation */ + if(!capable(CAP_NET_ADMIN)) + return -EPERM; + + adapter->shared.autoneg = 1; + adapter->shared.autoneg_advertised = AUTONEG_ADV_DEFAULT; + e1000_hibernate_adapter(netdev); + e1000_wakeup_adapter(netdev); + + break; +#endif + +#ifdef ETHTOOL_GLINK + case ETHTOOL_GLINK: + eth_e1000_linkinfo.data = adapter->link_active; + if(copy_to_user(ifr->ifr_data, ð_e1000_linkinfo, sizeof(eth_e1000_linkinfo))) + return -EFAULT; + break; +#endif + +#ifdef ETHTOOL_GDRVINFO + case ETHTOOL_GDRVINFO: + strcpy(eth_e1000_info.driver, e1000_driver_name); + strcpy(eth_e1000_info.version, e1000_driver_version); + strcpy(eth_e1000_info.fw_version, "None"); + strcpy(eth_e1000_info.bus_info, adapter->pdev->slot_name); + if(copy_to_user(ifr->ifr_data, ð_e1000_info, sizeof(eth_e1000_info))) + return -EFAULT; + break; +#endif + +#ifdef ETHTOOL_GWOL + case ETHTOOL_GWOL: + eth_e1000_wolinfo.supported = eth_e1000_wolinfo.wolopts = WAKE_MAGIC; + if(copy_to_user + (ifr->ifr_data, ð_e1000_wolinfo, sizeof(eth_e1000_wolinfo))) + return -EFAULT; + break; +#endif + + default: + return -EOPNOTSUPP; + } + + return 0; + +} +#endif /* SIOCETHTOOL */ + +/** + * e1000_enable_WOL - Wake On Lan Support (Magic Pkt) + * @adapter: Adapter structure + **/ + +static void +e1000_enable_WOL(struct e1000_adapter *adapter) +{ + uint32_t wuc_val; + + if(adapter->shared.mac_type <= e1000_82543) + return; + + /* Set up Wake-Up Ctrl reg */ + wuc_val = E1000_READ_REG(&adapter->shared, WUC); + wuc_val &= ~(E1000_WUC_APME | E1000_WUC_APMPME); + wuc_val |= (E1000_WUC_PME_STATUS | E1000_WUC_PME_EN); + + E1000_WRITE_REG(&adapter->shared, WUC, wuc_val); + + /* Set up Wake-up Filter */ + E1000_WRITE_REG(&adapter->shared, WUFC, E1000_WUFC_MAG); + + return; +} + +/** + * e1000_write_pci_cg - + * @shared: + * @reg: + * @value: + **/ + +void +e1000_write_pci_cfg(struct e1000_shared_adapter *shared, + uint32_t reg, + uint16_t *value) +{ + struct e1000_adapter *adapter = (struct e1000_adapter *) shared->back; + + pci_write_config_word(adapter->pdev, reg, *value); + return; +} + +/* e1000_main.c */ diff -urN linux-2.4.18/drivers/net/e1000/e1000_osdep.h lia64-2.4/drivers/net/e1000/e1000_osdep.h --- linux-2.4.18/drivers/net/e1000/e1000_osdep.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/e1000/e1000_osdep.h Fri Jul 19 18:51:03 2002 @@ -0,0 +1,138 @@ +/******************************************************************************* + + This software program is available to you under a choice of one of two + licenses. You may choose to be licensed under either the GNU General Public + License (GPL) Version 2, June 1991, available at + http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the + text of which follows: + + Recipient has requested a license and Intel Corporation ("Intel") is willing + to grant a license for the software entitled Linux Base Driver for the + Intel(R) PRO/1000 Family of Adapters (e1000) (the "Software") being provided + by Intel Corporation. The following definitions apply to this license: + + "Licensed Patents" means patent claims licensable by Intel Corporation which + are necessarily infringed by the use of sale of the Software alone or when + combined with the operating system referred to below. + + "Recipient" means the party to whom Intel delivers this Software. + + "Licensee" means Recipient and those third parties that receive a license to + any operating system available under the GNU Public License version 2.0 or + later. + + Copyright (c) 1999 - 2002 Intel Corporation. + All rights reserved. + + The license is provided to Recipient and Recipient's Licensees under the + following terms. + + Redistribution and use in source and binary forms of the Software, with or + without modification, are permitted provided that the following conditions + are met: + + Redistributions of source code of the Software may retain the above + copyright notice, this list of conditions and the following disclaimer. + + Redistributions in binary form of the Software may reproduce the above + copyright notice, this list of conditions and the following disclaimer in + the documentation and/or materials provided with the distribution. + + Neither the name of Intel Corporation nor the names of its contributors + shall be used to endorse or promote products derived from this Software + without specific prior written permission. + + Intel hereby grants Recipient and Licensees a non-exclusive, worldwide, + royalty-free patent license under Licensed Patents to make, use, sell, offer + to sell, import and otherwise transfer the Software, if any, in source code + and object code form. This license shall include changes to the Software + that are error corrections or other minor changes to the Software that do + not add functionality or features when the Software is incorporated in any + version of an operating system that has been distributed under the GNU + General Public License 2.0 or later. This patent license shall apply to the + combination of the Software and any operating system licensed under the GNU + Public License version 2.0 or later if, at the time Intel provides the + Software to Recipient, such addition of the Software to the then publicly + available versions of such operating systems available under the GNU Public + License version 2.0 or later (whether in gold, beta or alpha form) causes + such combination to be covered by the Licensed Patents. The patent license + shall not apply to any other combinations which include the Software. NO + hardware per se is licensed hereunder. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR IT CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + ANY LOSS OF USE; DATA, OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + + +/* glue for the OS independant part of e1000 + * includes register access macros + */ + +#ifndef _E1000_OSDEP_H_ +#define _E1000_OSDEP_H_ + +#include +#include +#include +#include + +#define usec_delay(x) udelay(x) +#define msec_delay(x) mdelay(x) + +#define PCI_COMMAND_REGISTER PCI_COMMAND +#define CMD_MEM_WRT_INVALIDATE PCI_COMMAND_INVALIDATE + +typedef enum { + FALSE = 0, + TRUE = 1 +} boolean_t; + +#if DBG +#define ASSERT(x) if(!(x)) panic("E1000: x") +#define DEBUGOUT(S) printk(S "\n") +#define DEBUGOUT1(S,A) printk(S "\n",A) +#define DEBUGOUT2(S,A,B) printk(S "\n",A,B) +#define DEBUGOUT3(S,A,B,C) printk(S "\n",A,B,C) +#define DEBUGOUT7(S,A,B,C,D,E,F,G) printk(S "\n",A,B,C,D,E,F,G) +#else +#define ASSERT(x) +#define DEBUGOUT(S) +#define DEBUGOUT1(S,A) +#define DEBUGOUT2(S,A,B) +#define DEBUGOUT3(S,A,B,C) +#define DEBUGOUT7(S,A,B,C,D,E,F,G) +#endif + +#define MSGOUT(S, A, B) printk(S "\n", A, B) +#define DEBUGFUNC(F) DEBUGOUT(F) + +#define E1000_WRITE_REG(a, reg, value) ( \ + ((a)->mac_type >= e1000_82543) ? \ + (writel((value), ((a)->hw_addr + E1000_##reg))) : \ + (writel((value), ((a)->hw_addr + E1000_82542_##reg)))) + +#define E1000_READ_REG(a, reg) ( \ + ((a)->mac_type >= e1000_82543) ? \ + readl((a)->hw_addr + E1000_##reg) : \ + readl((a)->hw_addr + E1000_82542_##reg)) + +#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) ( \ + ((a)->mac_type >= e1000_82543) ? \ + writel((value), ((a)->hw_addr + E1000_##reg + ((offset) << 2))) : \ + writel((value), ((a)->hw_addr + E1000_82542_##reg + ((offset) << 2)))) + +#define E1000_READ_REG_ARRAY(a, reg, offset) ( \ + ((a)->mac_type >= e1000_82543) ? \ + readl((a)->hw_addr + E1000_##reg + ((offset) << 2)) : \ + readl((a)->hw_addr + E1000_82542_##reg + ((offset) << 2))) + +#endif /* _E1000_OSDEP_H_ */ diff -urN linux-2.4.18/drivers/net/e1000/e1000_phy.c lia64-2.4/drivers/net/e1000/e1000_phy.c --- linux-2.4.18/drivers/net/e1000/e1000_phy.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/e1000/e1000_phy.c Fri Jul 19 17:19:35 2002 @@ -0,0 +1,1576 @@ +/******************************************************************************* + + This software program is available to you under a choice of one of two + licenses. You may choose to be licensed under either the GNU General Public + License (GPL) Version 2, June 1991, available at + http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the + text of which follows: + + Recipient has requested a license and Intel Corporation ("Intel") is willing + to grant a license for the software entitled Linux Base Driver for the + Intel(R) PRO/1000 Family of Adapters (e1000) (the "Software") being provided + by Intel Corporation. The following definitions apply to this license: + + "Licensed Patents" means patent claims licensable by Intel Corporation which + are necessarily infringed by the use of sale of the Software alone or when + combined with the operating system referred to below. + + "Recipient" means the party to whom Intel delivers this Software. + + "Licensee" means Recipient and those third parties that receive a license to + any operating system available under the GNU Public License version 2.0 or + later. + + Copyright (c) 1999 - 2002 Intel Corporation. + All rights reserved. + + The license is provided to Recipient and Recipient's Licensees under the + following terms. + + Redistribution and use in source and binary forms of the Software, with or + without modification, are permitted provided that the following conditions + are met: + + Redistributions of source code of the Software may retain the above + copyright notice, this list of conditions and the following disclaimer. + + Redistributions in binary form of the Software may reproduce the above + copyright notice, this list of conditions and the following disclaimer in + the documentation and/or materials provided with the distribution. + + Neither the name of Intel Corporation nor the names of its contributors + shall be used to endorse or promote products derived from this Software + without specific prior written permission. + + Intel hereby grants Recipient and Licensees a non-exclusive, worldwide, + royalty-free patent license under Licensed Patents to make, use, sell, offer + to sell, import and otherwise transfer the Software, if any, in source code + and object code form. This license shall include changes to the Software + that are error corrections or other minor changes to the Software that do + not add functionality or features when the Software is incorporated in any + version of an operating system that has been distributed under the GNU + General Public License 2.0 or later. This patent license shall apply to the + combination of the Software and any operating system licensed under the GNU + Public License version 2.0 or later if, at the time Intel provides the + Software to Recipient, such addition of the Software to the then publicly + available versions of such operating systems available under the GNU Public + License version 2.0 or later (whether in gold, beta or alpha form) causes + such combination to be covered by the Licensed Patents. The patent license + shall not apply to any other combinations which include the Software. NO + hardware per se is licensed hereunder. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR IT CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + ANY LOSS OF USE; DATA, OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + +/* e1000_phy.c + * Shared functions for accessing and configuring the PHY + */ + +#include "e1000_mac.h" +#include "e1000_phy.h" + +/****************************************************************************** +* Raises the Management Data Clock +* +* shared - Struct containing variables accessed by shared code +* ctrl_reg - Device control register's current value +******************************************************************************/ +static void +e1000_raise_mdc(struct e1000_shared_adapter *shared, + uint32_t *ctrl_reg) +{ + /* Raise the clock input to the Management Data Clock (by setting + * the MDC bit), and then delay 2 microseconds. + */ + E1000_WRITE_REG(shared, CTRL, (*ctrl_reg | E1000_CTRL_MDC)); + usec_delay(2); + return; +} + +/****************************************************************************** +* Lowers the Management Data Clock +* +* shared - Struct containing variables accessed by shared code +* ctrl_reg - Device control register's current value +******************************************************************************/ +static void +e1000_lower_mdc(struct e1000_shared_adapter *shared, + uint32_t *ctrl_reg) +{ + /* Lower the clock input to the Management Data Clock (by clearing + * the MDC bit), and then delay 2 microseconds. + */ + E1000_WRITE_REG(shared, CTRL, (*ctrl_reg & ~E1000_CTRL_MDC)); + usec_delay(2); + return; +} + +/****************************************************************************** +* Shifts data bits out to the PHY +* +* shared - Struct containing variables accessed by shared code +* data - Data to send out to the PHY +* count - Number of bits to shift out +* +* Bits are shifted out in MSB to LSB order. +******************************************************************************/ +static void +e1000_phy_shift_out(struct e1000_shared_adapter *shared, + uint32_t data, + uint16_t count) +{ + uint32_t ctrl_reg; + uint32_t mask; + + ASSERT(count <= 32); + + /* We need to shift "count" number of bits out to the PHY. So, the + * value in the "Data" parameter will be shifted out to the PHY + * one bit at a time. In order to do this, "Data" must be broken + * down into bits, which is what the "while" logic does below. + */ + mask = 0x01; + mask <<= (count - 1); + + ctrl_reg = E1000_READ_REG(shared, CTRL); + + /* Set MDIO_DIR (SWDPIO1) and MDC_DIR (SWDPIO2) direction bits to + * be used as output pins. + */ + ctrl_reg |= (E1000_CTRL_MDIO_DIR | E1000_CTRL_MDC_DIR); + + while(mask) { + /* A "1" is shifted out to the PHY by setting the MDIO bit to + * "1" and then raising and lowering the Management Data Clock + * (MDC). A "0" is shifted out to the PHY by setting the MDIO + * bit to "0" and then raising and lowering the clock. + */ + if(data & mask) + ctrl_reg |= E1000_CTRL_MDIO; + else + ctrl_reg &= ~E1000_CTRL_MDIO; + + E1000_WRITE_REG(shared, CTRL, ctrl_reg); + + usec_delay(2); + + e1000_raise_mdc(shared, &ctrl_reg); + e1000_lower_mdc(shared, &ctrl_reg); + + mask = mask >> 1; + } + + /* Clear the data bit just before leaving this routine. */ + ctrl_reg &= ~E1000_CTRL_MDIO; + return; +} + +/****************************************************************************** +* Shifts data bits in from the PHY +* +* shared - Struct containing variables accessed by shared code +* +* Bits are shifted in in MSB to LSB order. +******************************************************************************/ +static uint16_t +e1000_phy_shift_in(struct e1000_shared_adapter *shared) +{ + uint32_t ctrl_reg; + uint16_t data = 0; + uint8_t i; + + /* In order to read a register from the PHY, we need to shift in a + * total of 18 bits from the PHY. The first two bit (TurnAround) + * times are used to avoid contention on the MDIO pin when a read + * operation is performed. These two bits are ignored by us and + * thrown away. Bits are "shifted in" by raising the clock input + * to the Management Data Clock (setting the MDC bit), and then + * reading the value of the MDIO bit. + */ + ctrl_reg = E1000_READ_REG(shared, CTRL); + + /* Clear MDIO_DIR (SWDPIO1) to indicate this bit is to be used as + * input. + */ + ctrl_reg &= ~E1000_CTRL_MDIO_DIR; + ctrl_reg &= ~E1000_CTRL_MDIO; + + E1000_WRITE_REG(shared, CTRL, ctrl_reg); + + /* Raise and Lower the clock before reading in the data. This + * accounts for the TurnAround bits. The first clock occurred + * when we clocked out the last bit of the Register Address. + */ + e1000_raise_mdc(shared, &ctrl_reg); + e1000_lower_mdc(shared, &ctrl_reg); + + for(data = 0, i = 0; i < 16; i++) { + data = data << 1; + e1000_raise_mdc(shared, &ctrl_reg); + + ctrl_reg = E1000_READ_REG(shared, CTRL); + + /* Check to see if we shifted in a "1". */ + if(ctrl_reg & E1000_CTRL_MDIO) + data |= 1; + + e1000_lower_mdc(shared, &ctrl_reg); + } + + e1000_raise_mdc(shared, &ctrl_reg); + e1000_lower_mdc(shared, &ctrl_reg); + + /* Clear the MDIO bit just before leaving this routine. */ + ctrl_reg &= ~E1000_CTRL_MDIO; + + return (data); +} + +/****************************************************************************** +* Force PHY speed and duplex settings to shared->forced_speed_duplex +* +* shared - Struct containing variables accessed by shared code +******************************************************************************/ +static void +e1000_phy_force_speed_duplex(struct e1000_shared_adapter *shared) +{ + uint32_t tctl_reg; + uint32_t ctrl_reg; + uint32_t shift; + uint16_t mii_ctrl_reg; + uint16_t mii_status_reg; + uint16_t phy_data; + uint16_t i; + + DEBUGFUNC("e1000_phy_force_speed_duplex"); + + /* Turn off Flow control if we are forcing speed and duplex. */ + shared->fc = e1000_fc_none; + + DEBUGOUT1("shared->fc = %d\n", shared->fc); + + /* Read the Device Control Register. */ + ctrl_reg = E1000_READ_REG(shared, CTRL); + + /* Set the bits to Force Speed and Duplex in the Device Ctrl Reg. */ + ctrl_reg |= (E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); + ctrl_reg &= ~(DEVICE_SPEED_MASK); + + /* Clear the Auto Speed Detect Enable bit. */ + ctrl_reg &= ~E1000_CTRL_ASDE; + + /* Read the MII Control Register. */ + mii_ctrl_reg = e1000_read_phy_reg(shared, PHY_CTRL); + + /* We need to disable autoneg in order to force link and duplex. */ + + mii_ctrl_reg &= ~MII_CR_AUTO_NEG_EN; + + /* Are we forcing Full or Half Duplex? */ + if(shared->forced_speed_duplex == e1000_100_full || + shared->forced_speed_duplex == e1000_10_full) { + + /* We want to force full duplex so we SET the full duplex bits + * in the Device and MII Control Registers. + */ + ctrl_reg |= E1000_CTRL_FD; + mii_ctrl_reg |= MII_CR_FULL_DUPLEX; + + DEBUGOUT("Full Duplex\n"); + } else { + + /* We want to force half duplex so we CLEAR the full duplex + * bits in the Device and MII Control Registers. + */ + ctrl_reg &= ~E1000_CTRL_FD; + mii_ctrl_reg &= ~MII_CR_FULL_DUPLEX; /* Do this implies HALF */ + + DEBUGOUT("Half Duplex\n"); + } + + /* Are we forcing 100Mbps??? */ + if(shared->forced_speed_duplex == e1000_100_full || + shared->forced_speed_duplex == e1000_100_half) { + + /* Set the 100Mb bit and turn off the 1000Mb and 10Mb bits. */ + ctrl_reg |= E1000_CTRL_SPD_100; + mii_ctrl_reg |= MII_CR_SPEED_100; + mii_ctrl_reg &= ~(MII_CR_SPEED_1000 | MII_CR_SPEED_10); + + DEBUGOUT("Forcing 100mb "); + } else { /* Force 10MB Full or Half */ + + /* Set the 10Mb bit and turn off the 1000Mb and 100Mb bits. */ + ctrl_reg &= ~(E1000_CTRL_SPD_1000 | E1000_CTRL_SPD_100); + mii_ctrl_reg |= MII_CR_SPEED_10; + mii_ctrl_reg &= ~(MII_CR_SPEED_1000 | MII_CR_SPEED_100); + + DEBUGOUT("Forcing 10mb "); + } + + /* Now we need to configure the Collision Distance. We need to read + * the Transmit Control Register to do this. + * Note: This must be done for both Half or Full Duplex. + */ + tctl_reg = E1000_READ_REG(shared, TCTL); + DEBUGOUT1("tctl_reg = %x\n", tctl_reg); + + if(!(mii_ctrl_reg & MII_CR_FULL_DUPLEX)) { + + /* We are in Half Duplex mode so we need to set up our collision + * distance for 10/100. + */ + tctl_reg &= ~E1000_TCTL_COLD; + shift = E1000_HDX_COLLISION_DISTANCE; + shift <<= E1000_COLD_SHIFT; + tctl_reg |= shift; + } else { + /* We are in Full Duplex mode. We have the same collision + * distance regardless of speed. + */ + tctl_reg &= ~E1000_TCTL_COLD; + shift = E1000_FDX_COLLISION_DISTANCE; + shift <<= E1000_COLD_SHIFT; + tctl_reg |= shift; + } + + /* Write the configured values back to the Transmit Control Reg. */ + E1000_WRITE_REG(shared, TCTL, tctl_reg); + + /* Write the configured values back to the Device Control Reg. */ + E1000_WRITE_REG(shared, CTRL, ctrl_reg); + + /* Write the MII Control Register with the new PHY configuration. */ + phy_data = e1000_read_phy_reg(shared, M88E1000_PHY_SPEC_CTRL); + + /* Clear Auto-Crossover to force MDI manually. + * M88E1000 requires MDI forced whenever speed/duplex is forced + */ + phy_data &= ~M88E1000_PSCR_AUTO_X_MODE; + + e1000_write_phy_reg(shared, M88E1000_PHY_SPEC_CTRL, phy_data); + + DEBUGOUT1("M88E1000 PSCR: %x \n", phy_data); + + /* Need to reset the PHY or these bits will get ignored. */ + mii_ctrl_reg |= MII_CR_RESET; + + e1000_write_phy_reg(shared, PHY_CTRL, mii_ctrl_reg); + + /* The wait_autoneg_complete flag may be a little misleading here. + * Since we are forcing speed and duplex, Auto-Neg is not enabled. + * But we do want to delay for a period while forcing only so we + * don't generate false No Link messages. So we will wait here + * only if the user has set wait_autoneg_complete to 1, which is + * the default. + */ + if(shared->wait_autoneg_complete) { + /* We will wait for autoneg to complete. */ + DEBUGOUT("Waiting for forced speed/duplex link.\n"); + mii_status_reg = 0; + + /* We will wait for autoneg to complete or 4.5 seconds to expire. */ + for(i = PHY_FORCE_TIME; i > 0; i--) { + /* Read the MII Status Register and wait for Auto-Neg + * Complete bit to be set. + */ + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + + if(mii_status_reg & MII_SR_LINK_STATUS) + break; + + msec_delay(100); + } /* end for loop */ + + if(i == 0) { /* We didn't get link */ + + /* Reset the DSP and wait again for link. */ + e1000_phy_reset_dsp(shared); + } + + /* This loop will early-out if the link condition has been met. */ + for(i = PHY_FORCE_TIME; i > 0; i--) { + if(mii_status_reg & MII_SR_LINK_STATUS) + break; + + msec_delay(100); + /* Read the MII Status Register and wait for Auto-Neg + * Complete bit to be set. + */ + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + + } /* end for loop */ + } /* end if wait_autoneg_complete */ + /* + * Because we reset the PHY above, we need to re-force TX_CLK in the + * Extended PHY Specific Control Register to 25MHz clock. This + * value defaults back to a 2.5MHz clock when the PHY is reset. + */ + phy_data = e1000_read_phy_reg(shared, M88E1000_EXT_PHY_SPEC_CTRL); + + phy_data |= M88E1000_EPSCR_TX_CLK_25; + + e1000_write_phy_reg(shared, M88E1000_EXT_PHY_SPEC_CTRL, phy_data); + + /* In addition, because of the s/w reset above, we need to enable + * CRS on TX. This must be set for both full and half duplex + * operation. + */ + phy_data = e1000_read_phy_reg(shared, M88E1000_PHY_SPEC_CTRL); + + phy_data |= M88E1000_PSCR_ASSERT_CRS_ON_TX; + + e1000_write_phy_reg(shared, M88E1000_PHY_SPEC_CTRL, phy_data); + DEBUGOUT1("M88E1000 Phy Specific Ctrl Reg = %4x\r\n", phy_data); + + return; +} + +/***************************************************************************** +* Reads the value from a PHY register +* +* shared - Struct containing variables accessed by shared code +* reg_addr - address of the PHY register to read +******************************************************************************/ +uint16_t +e1000_read_phy_reg(struct e1000_shared_adapter *shared, + uint32_t reg_addr) +{ + uint32_t i; + uint32_t data = 0; + uint32_t command = 0; + + ASSERT(reg_addr <= MAX_PHY_REG_ADDRESS); + + if(shared->mac_type > e1000_82543) { + /* Set up Op-code, Phy Address, and + * register address in the MDI Control register. The MAC will + * take care of interfacing with the PHY to retrieve the + * desired data. + */ + command = ((reg_addr << E1000_MDIC_REG_SHIFT) | + (shared->phy_addr << E1000_MDIC_PHY_SHIFT) | + (E1000_MDIC_OP_READ)); + + E1000_WRITE_REG(shared, MDIC, command); + + /* Check every 10 usec to see if the read completed. The read + * may take as long as 64 usecs (we'll wait 100 usecs max) + * from the CPU Write to the Ready bit assertion. + */ + for(i = 0; i < 64; i++) { + usec_delay(10); + + data = E1000_READ_REG(shared, MDIC); + + if(data & E1000_MDIC_READY) + break; + } + } else { + /* We must first send a preamble through the MDIO pin to signal the + * beginning of an MII instruction. This is done by sending 32 + * consecutive "1" bits. + */ + e1000_phy_shift_out(shared, PHY_PREAMBLE, PHY_PREAMBLE_SIZE); + + /* Now combine the next few fields that are required for a read + * operation. We use this method instead of calling the + * e1000_phy_shift_out routine five different times. The format of + * a MII read instruction consists of a shift out of 14 bits and is + * defined as follows: + * + * followed by a shift in of 18 bits. This first two bits shifted + * in are TurnAround bits used to avoid contention on the MDIO pin + * when a READ operation is performed. These two bits are thrown + * away followed by a shift in of 16 bits which contains the + * desired data. + */ + command = ((reg_addr) | + (shared->phy_addr << 5) | + (PHY_OP_READ << 10) | (PHY_SOF << 12)); + + e1000_phy_shift_out(shared, command, 14); + + /* Now that we've shifted out the read command to the MII, we need + * to "shift in" the 16-bit value (18 total bits) of the requested + * PHY register address. + */ + data = (uint32_t) e1000_phy_shift_in(shared); + } + + ASSERT(!(data & E1000_MDIC_ERROR)); + + return ((uint16_t) data); +} + +/****************************************************************************** +* Writes a value to a PHY register +* +* shared - Struct containing variables accessed by shared code +* reg_addr - address of the PHY register to write +* data - data to write to the PHY +******************************************************************************/ +void +e1000_write_phy_reg(struct e1000_shared_adapter *shared, + uint32_t reg_addr, + uint16_t data) +{ + uint32_t i; + uint32_t command = 0; + uint32_t mdic_reg; + + ASSERT(reg_addr <= MAX_PHY_REG_ADDRESS); + + if(shared->mac_type > e1000_82543) { + /* Set up Op-code, Phy Address, register + * address, and data intended for the PHY register in the MDI + * Control register. The MAC will take care of interfacing + * with the PHY to send the desired data. + */ + command = (((uint32_t) data) | + (reg_addr << E1000_MDIC_REG_SHIFT) | + (shared->phy_addr << E1000_MDIC_PHY_SHIFT) | + (E1000_MDIC_OP_WRITE)); + + E1000_WRITE_REG(shared, MDIC, command); + + /* Check every 10 usec to see if the read completed. The read + * may take as long as 64 usecs (we'll wait 100 usecs max) + * from the CPU Write to the Ready bit assertion. + */ + for(i = 0; i < 10; i++) { + usec_delay(10); + + mdic_reg = E1000_READ_REG(shared, MDIC); + + if(mdic_reg & E1000_MDIC_READY) + break; + } + } else { + /* We'll need to use the SW defined pins to shift the write command + * out to the PHY. We first send a preamble to the PHY to signal the + * beginning of the MII instruction. This is done by sending 32 + * consecutive "1" bits. + */ + e1000_phy_shift_out(shared, PHY_PREAMBLE, PHY_PREAMBLE_SIZE); + + /* Now combine the remaining required fields that will indicate + * a write operation. We use this method instead of calling the + * e1000_phy_shift_out routine for each field in the command. The + * format of a MII write instruction is as follows: + * . + */ + command = ((PHY_TURNAROUND) | + (reg_addr << 2) | + (shared->phy_addr << 7) | + (PHY_OP_WRITE << 12) | (PHY_SOF << 14)); + command <<= 16; + command |= ((uint32_t) data); + + e1000_phy_shift_out(shared, command, 32); + } + return; +} + +/****************************************************************************** +* Returns the PHY to the power-on reset state +* +* shared - Struct containing variables accessed by shared code +******************************************************************************/ +void +e1000_phy_hw_reset(struct e1000_shared_adapter *shared) +{ + uint32_t ctrl_reg; + uint32_t ctrl_ext_reg; + + DEBUGFUNC("e1000_phy_hw_reset"); + + DEBUGOUT("Resetting Phy...\n"); + + if(shared->mac_type > e1000_82543) { + /* Read the device control register and assert the + * E1000_CTRL_PHY_RST bit. Hold for 20ms and then take it out + * of reset. + */ + ctrl_reg = E1000_READ_REG(shared, CTRL); + + ctrl_reg |= E1000_CTRL_PHY_RST; + + E1000_WRITE_REG(shared, CTRL, ctrl_reg); + + msec_delay(20); + + ctrl_reg &= ~E1000_CTRL_PHY_RST; + + E1000_WRITE_REG(shared, CTRL, ctrl_reg); + + msec_delay(20); + } else { + /* Read the Extended Device Control Register, assert the + * PHY_RESET_DIR bit. Then clock it out to the PHY. + */ + ctrl_ext_reg = E1000_READ_REG(shared, CTRL_EXT); + + ctrl_ext_reg |= E1000_CTRL_PHY_RESET_DIR4; + + E1000_WRITE_REG(shared, CTRL_EXT, ctrl_ext_reg); + + msec_delay(20); + + /* Set the reset bit in the device control register and clock + * it out to the PHY. + */ + ctrl_ext_reg = E1000_READ_REG(shared, CTRL_EXT); + + ctrl_ext_reg &= ~E1000_CTRL_PHY_RESET4; + + E1000_WRITE_REG(shared, CTRL_EXT, ctrl_ext_reg); + + msec_delay(20); + + ctrl_ext_reg = E1000_READ_REG(shared, CTRL_EXT); + + ctrl_ext_reg |= E1000_CTRL_PHY_RESET4; + + E1000_WRITE_REG(shared, CTRL_EXT, ctrl_ext_reg); + + msec_delay(20); + } + return; +} + +/****************************************************************************** +* Resets the PHY +* +* shared - Struct containing variables accessed by shared code +* +* Sets bit 15 of the MII Control regiser +******************************************************************************/ +boolean_t +e1000_phy_reset(struct e1000_shared_adapter *shared) +{ + uint16_t reg_data; + uint16_t i; + + DEBUGFUNC("e1000_phy_reset"); + + /* Read the MII control register, set the reset bit and write the + * value back by clocking it out to the PHY. + */ + reg_data = e1000_read_phy_reg(shared, PHY_CTRL); + + reg_data |= MII_CR_RESET; + + e1000_write_phy_reg(shared, PHY_CTRL, reg_data); + + /* Wait for bit 15 of the MII Control Register to be cleared + * indicating the PHY has been reset. + */ + i = 0; + while((reg_data & MII_CR_RESET) && i++ < 500) { + reg_data = e1000_read_phy_reg(shared, PHY_CTRL); + usec_delay(1); + } + + if(i >= 500) { + DEBUGOUT("Timeout waiting for PHY to reset.\n"); + return FALSE; + } + return TRUE; +} + +/****************************************************************************** +* Detects which PHY is present and the speed and duplex +* +* shared - Struct containing variables accessed by shared code +* ctrl_reg - current value of the device control register +******************************************************************************/ +boolean_t +e1000_phy_setup(struct e1000_shared_adapter *shared, + uint32_t ctrl_reg) +{ + uint16_t mii_ctrl_reg; + uint16_t mii_status_reg; + uint16_t phy_specific_ctrl_reg; + uint16_t mii_autoneg_adv_reg; + uint16_t mii_1000t_ctrl_reg; + uint16_t i; + uint16_t data; + uint16_t autoneg_hw_setting; + uint16_t autoneg_fc_setting; + boolean_t restart_autoneg = FALSE; + boolean_t force_autoneg_restart = FALSE; + + DEBUGFUNC("e1000_phy_setup"); + + /* We want to enable the Auto-Speed Detection bit in the Device + * Control Register. When set to 1, the MAC automatically detects + * the resolved speed of the link and self-configures appropriately. + * The Set Link Up bit must also be set for this behavior work + * properly. + */ + /* Nothing but 82543 and newer */ + ASSERT(shared->mac_type >= e1000_82543); + + /* With 82543, we need to force speed/duplex + * on the MAC equal to what the PHY speed/duplex configuration is. + * In addition, on 82543, we need to perform a hardware reset + * on the PHY to take it out of reset. + */ + if(shared->mac_type >= e1000_82544) { + ctrl_reg |= E1000_CTRL_SLU; + E1000_WRITE_REG(shared, CTRL, ctrl_reg); + } else { + ctrl_reg |= (E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX | E1000_CTRL_SLU); + E1000_WRITE_REG(shared, CTRL, ctrl_reg); + + if(shared->mac_type == e1000_82543) + e1000_phy_hw_reset(shared); + } + + if(!e1000_detect_gig_phy(shared)) { + /* No PHY detected, return FALSE */ + DEBUGOUT("PhySetup failure, did not detect valid phy.\n"); + return (FALSE); + } + + DEBUGOUT1("Phy ID = %x \n", shared->phy_id); + + /* Read the MII Control Register. */ + mii_ctrl_reg = e1000_read_phy_reg(shared, PHY_CTRL); + + DEBUGOUT1("MII Ctrl Reg contents = %x\n", mii_ctrl_reg); + + /* Check to see if the Auto Neg Enable bit is set in the MII Control + * Register. If not, we could be in a situation where a driver was + * loaded previously and was forcing speed and duplex. Then the + * driver was unloaded but a e1000_phy_hw_reset was not performed, so + * link was still being forced and link was still achieved. Then + * the driver was reloaded with the intention to auto-negotiate, but + * since link is already established we end up not restarting + * auto-neg. So if the auto-neg bit is not enabled and the driver + * is being loaded with the desire to auto-neg, we set this flag to + * to ensure the restart of the auto-neg engine later in the logic. + */ + if(!(mii_ctrl_reg & MII_CR_AUTO_NEG_EN)) + force_autoneg_restart = TRUE; + + /* Clear the isolate bit for normal operation and write it back to + * the MII Control Reg. Although the spec says this doesn't need + * to be done when the PHY address is not equal to zero, we do it + * anyway just to be safe. + */ + mii_ctrl_reg &= ~(MII_CR_ISOLATE); + + e1000_write_phy_reg(shared, PHY_CTRL, mii_ctrl_reg); + + data = e1000_read_phy_reg(shared, M88E1000_PHY_SPEC_CTRL); + + /* Enable CRS on TX. This must be set for half-duplex operation. */ + data |= M88E1000_PSCR_ASSERT_CRS_ON_TX; + + DEBUGOUT1("M88E1000 PSCR: %x \n", data); + + e1000_write_phy_reg(shared, M88E1000_PHY_SPEC_CTRL, data); + + data = e1000_read_phy_reg(shared, M88E1000_EXT_PHY_SPEC_CTRL); + + /* Force TX_CLK in the Extended PHY Specific Control Register + * to 25MHz clock. + */ + data |= M88E1000_EPSCR_TX_CLK_25; + + e1000_write_phy_reg(shared, M88E1000_EXT_PHY_SPEC_CTRL, data); + + /* Certain PHYs will set the default of MII register 4 differently. + * We need to check this against our fc value. If it is + * different, we need to setup up register 4 correctly and restart + * autonegotiation. + */ + /* Read the MII Auto-Neg Advertisement Register (Address 4). */ + mii_autoneg_adv_reg = e1000_read_phy_reg(shared, PHY_AUTONEG_ADV); + + /* Shift right to put 10T-Half bit in bit 0 + * Isolate the four bits for 100/10 Full/Half. + */ + autoneg_hw_setting = (mii_autoneg_adv_reg >> 5) & 0xF; + + /* Get the 1000T settings. */ + mii_1000t_ctrl_reg = e1000_read_phy_reg(shared, PHY_1000T_CTRL); + + /* Isolate and OR in the 1000T settings. */ + autoneg_hw_setting |= ((mii_1000t_ctrl_reg & 0x0300) >> 4); + + /* mask all bits in the MII Auto-Neg Advertisement Register + * except for ASM_DIR and PAUSE and shift. This value + * will be used later to see if we need to restart Auto-Negotiation. + */ + autoneg_fc_setting = ((mii_autoneg_adv_reg & 0x0C00) >> 10); + + /* Perform some bounds checking on the shared->autoneg_advertised + * parameter. If this variable is zero, then set it to the default. + */ + shared->autoneg_advertised &= AUTONEG_ADVERTISE_SPEED_DEFAULT; + + /* If autoneg_advertised is zero, we assume it was not defaulted + * by the calling code so we set to advertise full capability. + */ + if(shared->autoneg_advertised == 0) + shared->autoneg_advertised = AUTONEG_ADVERTISE_SPEED_DEFAULT; + + /* We could be in the situation where Auto-Neg has already completed + * and the user has not indicated any overrides. In this case we + * simply need to call e1000_get_speed_and_duplex to obtain the Auto- + * Negotiated speed and duplex, then return. + */ + if(!force_autoneg_restart && shared->autoneg && + (shared->autoneg_advertised == autoneg_hw_setting) && + (shared->fc == autoneg_fc_setting)) { + + DEBUGOUT("No overrides - Reading MII Status Reg..\n"); + + /* Read the MII Status Register. We read this twice because + * certain bits are "sticky" and need to be read twice. + */ + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + + DEBUGOUT1("MII Status Reg contents = %x\n", mii_status_reg); + + /* Do we have link now? (if so, auto-neg has completed) */ + if(mii_status_reg & MII_SR_LINK_STATUS) { + data = e1000_read_phy_reg(shared, M88E1000_PHY_SPEC_STATUS); + DEBUGOUT1("M88E1000 Phy Specific Status Reg contents = %x\n", data); + + /* We have link, so we need to finish the config process: + * 1) Set up the MAC to the current PHY speed/duplex + * if we are on 82543. If we + * are on newer silicon, we only need to configure + * collision distance in the Transmit Control Register. + * 2) Set up flow control on the MAC to that established + * with the link partner. + */ + if(shared->mac_type >= e1000_82544) + e1000_config_collision_dist(shared); + else + e1000_config_mac_to_phy(shared, data); + + e1000_config_fc_after_link_up(shared); + + return (TRUE); + } + } + + /* Options: + * MDI/MDI-X = 0 (default) + * 0 - Auto for all speeds + * 1 - MDI mode + * 2 - MDI-X mode + * 3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes) + */ + phy_specific_ctrl_reg = e1000_read_phy_reg(shared, M88E1000_PHY_SPEC_CTRL); + + phy_specific_ctrl_reg &= ~M88E1000_PSCR_AUTO_X_MODE; + + switch (shared->mdix) { + case 1: + phy_specific_ctrl_reg |= M88E1000_PSCR_MDI_MANUAL_MODE; + break; + case 2: + phy_specific_ctrl_reg |= M88E1000_PSCR_MDIX_MANUAL_MODE; + break; + case 3: + phy_specific_ctrl_reg |= M88E1000_PSCR_AUTO_X_1000T; + break; + case 0: + default: + phy_specific_ctrl_reg |= M88E1000_PSCR_AUTO_X_MODE; + break; + } + + e1000_write_phy_reg(shared, M88E1000_PHY_SPEC_CTRL, phy_specific_ctrl_reg); + + /* Options: + * disable_polarity_correction = 0 (default) + * Automatic Correction for Reversed Cable Polarity + * 0 - Disabled + * 1 - Enabled + */ + phy_specific_ctrl_reg = e1000_read_phy_reg(shared, M88E1000_PHY_SPEC_CTRL); + + phy_specific_ctrl_reg &= ~M88E1000_PSCR_POLARITY_REVERSAL; + + if(shared->disable_polarity_correction == 1) + phy_specific_ctrl_reg |= M88E1000_PSCR_POLARITY_REVERSAL; + + e1000_write_phy_reg(shared, M88E1000_PHY_SPEC_CTRL, phy_specific_ctrl_reg); + + /* Options: + * autoneg = 1 (default) + * PHY will advertise value(s) parsed from + * autoneg_advertised and fc + * autoneg = 0 + * PHY will be set to 10H, 10F, 100H, or 100F + * depending on value parsed from forced_speed_duplex. + */ + + /* Is autoneg enabled? This is enabled by default or by software override. + * If so, call e1000_phy_setup_autoneg routine to parse the + * autoneg_advertised and fc options. If autoneg is NOT enabled, then the + * user should have provided a speed/duplex override. If so, then call + * e1000_phy_force_speed_duplex to parse and set this up. Otherwise, + * we are in an error situation and need to bail. + */ + if(shared->autoneg) { + DEBUGOUT("Reconfiguring auto-neg advertisement params\n"); + restart_autoneg = e1000_phy_setup_autoneg(shared); + } else { + DEBUGOUT("Forcing speed and duplex\n"); + e1000_phy_force_speed_duplex(shared); + } + + /* Based on information parsed above, check the flag to indicate + * whether we need to restart Auto-Neg. + */ + if(restart_autoneg) { + DEBUGOUT("Restarting Auto-Neg\n"); + + /* Read the MII Control Register. */ + mii_ctrl_reg = e1000_read_phy_reg(shared, PHY_CTRL); + + /* Restart auto-negotiation by setting the Auto Neg Enable bit and + * the Auto Neg Restart bit. + */ + mii_ctrl_reg |= (MII_CR_AUTO_NEG_EN | MII_CR_RESTART_AUTO_NEG); + + e1000_write_phy_reg(shared, PHY_CTRL, mii_ctrl_reg); + + /* Does the user want to wait for Auto-Neg to complete here, or + * check at a later time (for example, callback routine). + */ + if(shared->wait_autoneg_complete) + e1000_wait_autoneg(shared); + } /* end if restart_autoneg */ + + /* Read the MII Status Register. */ + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + + DEBUGOUT1("Checking for link status - MII Status Reg contents = %x\n", + mii_status_reg); + + /* Check link status. Wait up to 100 microseconds for link to + * become valid. + */ + for(i = 0; i < 10; i++) { + if(mii_status_reg & MII_SR_LINK_STATUS) + break; + usec_delay(10); + DEBUGOUT(". "); + + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + } + + if(mii_status_reg & MII_SR_LINK_STATUS) { + /* Yes, so configure MAC to PHY settings as well as flow control + * registers. + */ + data = e1000_read_phy_reg(shared, M88E1000_PHY_SPEC_STATUS); + + DEBUGOUT1("M88E1000 Phy Specific Status Reg contents = %x\n", data); + + /* We have link, so we need to finish the config process: + * 1) Set up the MAC to the current PHY speed/duplex + * if we are on 82543. If we + * are on newer silicon, we only need to configure + * collision distance in the Transmit Control Register. + * 2) Set up flow control on the MAC to that established with + * the link partner. + */ + if(shared->mac_type >= e1000_82544) + e1000_config_collision_dist(shared); + else + e1000_config_mac_to_phy(shared, data); + + e1000_config_fc_after_link_up(shared); + + DEBUGOUT("Valid link established!!!\n"); + } else { + DEBUGOUT("Unable to establish link!!!\n"); + } + + return (TRUE); +} + +/****************************************************************************** +* Configures PHY autoneg and flow control advertisement settings +* +* shared - Struct containing variables accessed by shared code +******************************************************************************/ +boolean_t +e1000_phy_setup_autoneg(struct e1000_shared_adapter *shared) +{ + uint16_t mii_autoneg_adv_reg; + uint16_t mii_1000t_ctrl_reg; + + DEBUGFUNC("e1000_phy_setup_autoneg"); + + /* Read the MII Auto-Neg Advertisement Register (Address 4). */ + mii_autoneg_adv_reg = e1000_read_phy_reg(shared, PHY_AUTONEG_ADV); + + /* Read the MII 1000Base-T Control Register (Address 9). */ + mii_1000t_ctrl_reg = e1000_read_phy_reg(shared, PHY_1000T_CTRL); + + /* Need to parse both autoneg_advertised and fc and set up + * the appropriate PHY registers. First we will parse for + * autoneg_advertised software override. Since we can advertise + * a plethora of combinations, we need to check each bit + * individually. + */ + + /* First we clear all the 10/100 mb speed bits in the Auto-Neg + * Advertisement Register (Address 4) and the 1000 mb speed bits in + * the 1000Base-T Control Register (Address 9). + */ + mii_autoneg_adv_reg &= ~REG4_SPEED_MASK; + mii_1000t_ctrl_reg &= ~REG9_SPEED_MASK; + + DEBUGOUT1("autoneg_advertised %x\n", shared->autoneg_advertised); + + /* Do we want to advertise 10 Mb Half Duplex? */ + if(shared->autoneg_advertised & ADVERTISE_10_HALF) { + DEBUGOUT("Advertise 10mb Half duplex\n"); + mii_autoneg_adv_reg |= NWAY_AR_10T_HD_CAPS; + } + + /* Do we want to advertise 10 Mb Full Duplex? */ + if(shared->autoneg_advertised & ADVERTISE_10_FULL) { + DEBUGOUT("Advertise 10mb Full duplex\n"); + mii_autoneg_adv_reg |= NWAY_AR_10T_FD_CAPS; + } + + /* Do we want to advertise 100 Mb Half Duplex? */ + if(shared->autoneg_advertised & ADVERTISE_100_HALF) { + DEBUGOUT("Advertise 100mb Half duplex\n"); + mii_autoneg_adv_reg |= NWAY_AR_100TX_HD_CAPS; + } + + /* Do we want to advertise 100 Mb Full Duplex? */ + if(shared->autoneg_advertised & ADVERTISE_100_FULL) { + DEBUGOUT("Advertise 100mb Full duplex\n"); + mii_autoneg_adv_reg |= NWAY_AR_100TX_FD_CAPS; + } + + /* We do not allow the Phy to advertise 1000 Mb Half Duplex */ + if(shared->autoneg_advertised & ADVERTISE_1000_HALF) { + DEBUGOUT("Advertise 1000mb Half duplex requested, request denied!\n"); + } + + /* Do we want to advertise 1000 Mb Full Duplex? */ + if(shared->autoneg_advertised & ADVERTISE_1000_FULL) { + DEBUGOUT("Advertise 1000mb Full duplex\n"); + mii_1000t_ctrl_reg |= CR_1000T_FD_CAPS; + } + + /* Check for a software override of the flow control settings, and + * setup the PHY advertisement registers accordingly. If + * auto-negotiation is enabled, then software will have to set the + * "PAUSE" bits to the correct value in the Auto-Negotiation + * Advertisement Register (PHY_AUTONEG_ADV) and re-start auto-negotiation. + * + * The possible values of the "fc" parameter are: + * 0: Flow control is completely disabled + * 1: Rx flow control is enabled (we can receive pause frames + * but not send pause frames). + * 2: Tx flow control is enabled (we can send pause frames + * but we do not support receiving pause frames). + * 3: Both Rx and TX flow control (symmetric) are enabled. + * other: No software override. The flow control configuration + * in the EEPROM is used. + */ + switch (shared->fc) { + case e1000_fc_none: /* 0 */ + /* Flow control (RX & TX) is completely disabled by a + * software over-ride. + */ + mii_autoneg_adv_reg &= ~(NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); + break; + case e1000_fc_rx_pause: /* 1 */ + /* RX Flow control is enabled, and TX Flow control is + * disabled, by a software over-ride. + */ + + /* Since there really isn't a way to advertise that we are + * capable of RX Pause ONLY, we will advertise that we + * support both symmetric and asymmetric RX PAUSE. Later + * (in e1000_config_fc_after_link_up) we will disable the + *shared's ability to send PAUSE frames. + */ + mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); + break; + case e1000_fc_tx_pause: /* 2 */ + /* TX Flow control is enabled, and RX Flow control is + * disabled, by a software over-ride. + */ + mii_autoneg_adv_reg |= NWAY_AR_ASM_DIR; + mii_autoneg_adv_reg &= ~NWAY_AR_PAUSE; + break; + case e1000_fc_full: /* 3 */ + /* Flow control (both RX and TX) is enabled by a software + * over-ride. + */ + mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); + break; + default: + /* We should never get here. The value should be 0-3. */ + DEBUGOUT("Flow control param set incorrectly\n"); + ASSERT(0); + break; + } + + /* Write the MII Auto-Neg Advertisement Register (Address 4). */ + e1000_write_phy_reg(shared, PHY_AUTONEG_ADV, mii_autoneg_adv_reg); + + DEBUGOUT1("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg); + + /* Write the MII 1000Base-T Control Register (Address 9). */ + e1000_write_phy_reg(shared, PHY_1000T_CTRL, mii_1000t_ctrl_reg); + return (TRUE); +} + +/****************************************************************************** +* Sets MAC speed and duplex settings to reflect the those in the PHY +* +* shared - Struct containing variables accessed by shared code +* mii_reg - data to write to the MII control register +* +* The contents of the PHY register containing the needed information need to +* be passed in. +******************************************************************************/ +void +e1000_config_mac_to_phy(struct e1000_shared_adapter *shared, + uint16_t mii_reg) +{ + uint32_t ctrl_reg; + uint32_t tctl_reg; + uint32_t shift; + + DEBUGFUNC("e1000_config_mac_to_phy"); + + /* We need to read the Transmit Control register to configure the + * collision distance. + * Note: This must be done for both Half or Full Duplex. + */ + tctl_reg = E1000_READ_REG(shared, TCTL); + DEBUGOUT1("tctl_reg = %x\n", tctl_reg); + + /* Read the Device Control Register and set the bits to Force Speed + * and Duplex. + */ + ctrl_reg = E1000_READ_REG(shared, CTRL); + + ctrl_reg |= (E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); + ctrl_reg &= ~(DEVICE_SPEED_MASK); + + DEBUGOUT1("MII Register Data = %x\r\n", mii_reg); + + /* Clear the ILOS bit. */ + ctrl_reg &= ~E1000_CTRL_ILOS; + + /* Set up duplex in the Device Control and Transmit Control + * registers depending on negotiated values. + */ + if(mii_reg & M88E1000_PSSR_DPLX) { + ctrl_reg |= E1000_CTRL_FD; + + /* We are in Full Duplex mode. We have the same collision + * distance regardless of speed. + */ + tctl_reg &= ~E1000_TCTL_COLD; + shift = E1000_FDX_COLLISION_DISTANCE; + shift <<= E1000_COLD_SHIFT; + tctl_reg |= shift; + } else { + ctrl_reg &= ~E1000_CTRL_FD; + + /* We are in Half Duplex mode. Our Half Duplex collision + * distance is different for Gigabit than for 10/100 so we will + * set accordingly. + */ + if((mii_reg & M88E1000_PSSR_SPEED) == M88E1000_PSSR_1000MBS) { + /* 1000Mbs HDX */ + tctl_reg &= ~E1000_TCTL_COLD; + shift = E1000_GB_HDX_COLLISION_DISTANCE; + shift <<= E1000_COLD_SHIFT; + tctl_reg |= shift; + tctl_reg |= E1000_TCTL_PBE; /* Enable Packet Bursting */ + } else { + /* 10/100Mbs HDX */ + tctl_reg &= ~E1000_TCTL_COLD; + shift = E1000_HDX_COLLISION_DISTANCE; + shift <<= E1000_COLD_SHIFT; + tctl_reg |= shift; + } + } + + /* Set up speed in the Device Control register depending on + * negotiated values. + */ + if((mii_reg & M88E1000_PSSR_SPEED) == M88E1000_PSSR_1000MBS) + ctrl_reg |= E1000_CTRL_SPD_1000; + else if((mii_reg & M88E1000_PSSR_SPEED) == M88E1000_PSSR_100MBS) + ctrl_reg |= E1000_CTRL_SPD_100; + else + ctrl_reg &= ~(E1000_CTRL_SPD_1000 | E1000_CTRL_SPD_100); + + /* Write the configured values back to the Transmit Control Reg. */ + E1000_WRITE_REG(shared, TCTL, tctl_reg); + + /* Write the configured values back to the Device Control Reg. */ + E1000_WRITE_REG(shared, CTRL, ctrl_reg); + + return; +} + +/****************************************************************************** +* Sets the collision distance in the Transmit Control register +* +* shared - Struct containing variables accessed by shared code +* +* Link should have been established previously. Reads the speed and duplex +* information from the Device Status register. +******************************************************************************/ +void +e1000_config_collision_dist(struct e1000_shared_adapter *shared) +{ + uint32_t tctl_reg; + uint16_t speed; + uint16_t duplex; + uint32_t shift; + + DEBUGFUNC("e1000_config_collision_dist"); + + /* Get our current speed and duplex from the Device Status Register. */ + e1000_get_speed_and_duplex(shared, &speed, &duplex); + + /* We need to configure the Collision Distance for both Full or + * Half Duplex. + */ + tctl_reg = E1000_READ_REG(shared, TCTL); + DEBUGOUT1("tctl_reg = %x\n", tctl_reg); + + /* mask the Collision Distance bits in the Transmit Control Reg. */ + tctl_reg &= ~E1000_TCTL_COLD; + + if(duplex == FULL_DUPLEX) { + /* We are in Full Duplex mode. Therefore, the collision distance + * is the same regardless of speed. + */ + shift = E1000_FDX_COLLISION_DISTANCE; + shift <<= E1000_COLD_SHIFT; + tctl_reg |= shift; + } else { + /* We are in Half Duplex mode. Half Duplex collision distance is + * different for Gigabit vs. 10/100, so we will set accordingly. + */ + if(speed == SPEED_1000) { /* 1000Mbs HDX */ + shift = E1000_GB_HDX_COLLISION_DISTANCE; + shift <<= E1000_COLD_SHIFT; + tctl_reg |= shift; + tctl_reg |= E1000_TCTL_PBE; /* Enable Packet Bursting */ + } else { /* 10/100Mbs HDX */ + shift = E1000_HDX_COLLISION_DISTANCE; + shift <<= E1000_COLD_SHIFT; + tctl_reg |= shift; + } + } + + /* Write the configured values back to the Transmit Control Reg. */ + E1000_WRITE_REG(shared, TCTL, tctl_reg); + + return; +} + +#if DBG +/****************************************************************************** +* Displays the contents of all of the MII registers +* +* shared - Struct containing variables accessed by shared code +* +* For debugging. +******************************************************************************/ +void +e1000_display_mii(struct e1000_shared_adapter *shared) +{ + uint16_t data; + uint16_t phy_id_high; + uint16_t phy_id_low; + uint32_t phy_id; + + DEBUGFUNC("e1000_display_mii"); + + DEBUGOUT1("adapter Base Address = %x\n", shared->hw_addr); + + /* This will read each PHY Reg address and display its contents. */ + + data = e1000_read_phy_reg(shared, PHY_CTRL); + DEBUGOUT1("MII Ctrl Reg contents = %x\n", data); + + data = e1000_read_phy_reg(shared, PHY_STATUS); + data = e1000_read_phy_reg(shared, PHY_STATUS); + DEBUGOUT1("MII Status Reg contents = %x\n", data); + + phy_id_high = e1000_read_phy_reg(shared, PHY_ID1); + usec_delay(2); + phy_id_low = e1000_read_phy_reg(shared, PHY_ID2); + phy_id = (phy_id_low | (phy_id_high << 16)) & PHY_REVISION_MASK; + DEBUGOUT1("Phy ID = %x \n", phy_id); + + data = e1000_read_phy_reg(shared, PHY_AUTONEG_ADV); + DEBUGOUT1("Reg 4 contents = %x\n", data); + + data = e1000_read_phy_reg(shared, PHY_LP_ABILITY); + DEBUGOUT1("Reg 5 contents = %x\n", data); + + data = e1000_read_phy_reg(shared, PHY_AUTONEG_EXP); + DEBUGOUT1("Reg 6 contents = %x\n", data); + + data = e1000_read_phy_reg(shared, PHY_NEXT_PAGE_TX); + DEBUGOUT1("Reg 7 contents = %x\n", data); + + data = e1000_read_phy_reg(shared, PHY_LP_NEXT_PAGE); + DEBUGOUT1("Reg 8 contents = %x\n", data); + + data = e1000_read_phy_reg(shared, PHY_1000T_CTRL); + DEBUGOUT1("Reg 9 contents = %x\n", data); + + data = e1000_read_phy_reg(shared, PHY_1000T_STATUS); + DEBUGOUT1("Reg A contents = %x\n", data); + + data = e1000_read_phy_reg(shared, PHY_EXT_STATUS); + DEBUGOUT1("Reg F contents = %x\n", data); + + data = e1000_read_phy_reg(shared, M88E1000_PHY_SPEC_CTRL); + DEBUGOUT1("M88E1000 Specific Control Reg (0x10) = %x\n", data); + + data = e1000_read_phy_reg(shared, M88E1000_PHY_SPEC_STATUS); + DEBUGOUT1("M88E1000 Specific Status Reg (0x11) = %x\n", data); + + /* + * data = e1000_read_phy_reg(shared, M88E1000_INT_ENABLE_REG); + * DEBUGOUT1("M88E1000 Interrupt Enable Reg (0x12) = %x\n", data); + */ + + /* + * data = e1000_read_phy_reg(shared, M88E1000_INT_STATUS_REG); + * DEBUGOUT1("M88E1000 Interrupt Status Reg (0x13) = %x\n", data); + */ + + data = e1000_read_phy_reg(shared, M88E1000_EXT_PHY_SPEC_CTRL); + DEBUGOUT1("M88E1000 Ext. Phy Specific Control (0x14) = %x\n", data); + + data = e1000_read_phy_reg(shared, M88E1000_RX_ERR_CNTR); + DEBUGOUT1("M88E1000 Receive Error Counter (0x15) = %x\n", data); + + /* + * data = e1000_read_phy_reg(shared, M88E1000_LED_CTRL_REG); + * DEBUGOUT1("M88E1000 LED control reg (0x18) = %x\n", data); + */ + + return; +} +#endif // DBG + +/****************************************************************************** +* Probes the expected PHY address for known PHY IDs +* +* shared - Struct containing variables accessed by shared code +******************************************************************************/ +boolean_t +e1000_detect_gig_phy(struct e1000_shared_adapter *shared) +{ + uint32_t phy_id_high; + uint16_t phy_id_low; + + DEBUGFUNC("e1000_detect_gig_phy"); + + /* Read the PHY ID Registers to identify which PHY is onboard. */ + shared->phy_addr = 1; + + phy_id_high = e1000_read_phy_reg(shared, PHY_ID1); + + usec_delay(2); + + phy_id_low = e1000_read_phy_reg(shared, PHY_ID2); + + shared->phy_id = (phy_id_low | (phy_id_high << 16)) & PHY_REVISION_MASK; + + if(shared->phy_id == M88E1000_12_PHY_ID || + shared->phy_id == M88E1000_14_PHY_ID || + shared->phy_id == M88E1000_I_PHY_ID || + shared->phy_id == M88E1011_I_PHY_ID) { + + DEBUGOUT2("phy_id 0x%x detected at address 0x%x\n", + shared->phy_id, shared->phy_addr); + return (TRUE); + } else { + DEBUGOUT("Could not auto-detect Phy!\n"); + return (FALSE); + } +} + +/****************************************************************************** +* Resets the PHY's DSP +* +* shared - Struct containing variables accessed by shared code +******************************************************************************/ +void +e1000_phy_reset_dsp(struct e1000_shared_adapter *shared) +{ + e1000_write_phy_reg(shared, 29, 0x1d); + e1000_write_phy_reg(shared, 30, 0xc1); + e1000_write_phy_reg(shared, 30, 0x00); + return; +} + +/****************************************************************************** +* Blocks until autoneg completes or times out (~4.5 seconds) +* +* shared - Struct containing variables accessed by shared code +******************************************************************************/ +boolean_t +e1000_wait_autoneg(struct e1000_shared_adapter *shared) +{ + uint16_t i; + uint16_t mii_status_reg; + boolean_t autoneg_complete = FALSE; + + DEBUGFUNC("e1000_wait_autoneg"); + + /* We will wait for autoneg to complete. */ + DEBUGOUT("Waiting for Auto-Neg to complete.\n"); + mii_status_reg = 0; + + /* We will wait for autoneg to complete or 4.5 seconds to expire. */ + + for(i = PHY_AUTO_NEG_TIME; i > 0; i--) { + /* Read the MII Status Register and wait for Auto-Neg + * Complete bit to be set. + */ + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + + if(mii_status_reg & MII_SR_AUTONEG_COMPLETE) { + autoneg_complete = TRUE; + break; + } + + msec_delay(100); + } + + return (autoneg_complete); +} + +/****************************************************************************** +* Get PHY information from various PHY registers +* +* shared - Struct containing variables accessed by shared code +* phy_status_info - PHY information structure +******************************************************************************/ +boolean_t +e1000_phy_get_info(struct e1000_shared_adapter *shared, + struct e1000_phy_info *phy_status_info) +{ + uint16_t phy_mii_status_reg; + uint16_t phy_specific_ctrl_reg; + uint16_t phy_specific_status_reg; + uint16_t phy_specific_ext_ctrl_reg; + uint16_t phy_1000t_stat_reg; + + phy_status_info->cable_length = e1000_cable_length_undefined; + phy_status_info->extended_10bt_distance = + e1000_10bt_ext_dist_enable_undefined; + phy_status_info->cable_polarity = e1000_rev_polarity_undefined; + phy_status_info->polarity_correction = e1000_polarity_reversal_undefined; + phy_status_info->link_reset = e1000_down_no_idle_undefined; + phy_status_info->mdix_mode = e1000_auto_x_mode_undefined; + phy_status_info->local_rx = e1000_1000t_rx_status_undefined; + phy_status_info->remote_rx = e1000_1000t_rx_status_undefined; + + /* PHY info only valid for copper media. */ + if(shared == NULL || shared->media_type != e1000_media_type_copper) + return FALSE; + + /* PHY info only valid for LINK UP. Read MII status reg + * back-to-back to get link status. + */ + phy_mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + phy_mii_status_reg = e1000_read_phy_reg(shared, PHY_STATUS); + if((phy_mii_status_reg & MII_SR_LINK_STATUS) != MII_SR_LINK_STATUS) + return FALSE; + + /* Read various PHY registers to get the PHY info. */ + phy_specific_ctrl_reg = e1000_read_phy_reg(shared, M88E1000_PHY_SPEC_CTRL); + phy_specific_status_reg = + e1000_read_phy_reg(shared, M88E1000_PHY_SPEC_STATUS); + phy_specific_ext_ctrl_reg = + e1000_read_phy_reg(shared, M88E1000_EXT_PHY_SPEC_CTRL); + phy_1000t_stat_reg = e1000_read_phy_reg(shared, PHY_1000T_STATUS); + + phy_status_info->cable_length = + ((phy_specific_status_reg & M88E1000_PSSR_CABLE_LENGTH) >> + M88E1000_PSSR_CABLE_LENGTH_SHIFT); + + phy_status_info->extended_10bt_distance = + (phy_specific_ctrl_reg & M88E1000_PSCR_10BT_EXT_DIST_ENABLE) >> + M88E1000_PSCR_10BT_EXT_DIST_ENABLE_SHIFT; + + phy_status_info->cable_polarity = + (phy_specific_status_reg & M88E1000_PSSR_REV_POLARITY) >> + M88E1000_PSSR_REV_POLARITY_SHIFT; + + phy_status_info->polarity_correction = + (phy_specific_ctrl_reg & M88E1000_PSCR_POLARITY_REVERSAL) >> + M88E1000_PSCR_POLARITY_REVERSAL_SHIFT; + + phy_status_info->link_reset = + (phy_specific_ext_ctrl_reg & M88E1000_EPSCR_DOWN_NO_IDLE) >> + M88E1000_EPSCR_DOWN_NO_IDLE_SHIFT; + + phy_status_info->mdix_mode = + (phy_specific_status_reg & M88E1000_PSSR_MDIX) >> + M88E1000_PSSR_MDIX_SHIFT; + + phy_status_info->local_rx = + (phy_1000t_stat_reg & SR_1000T_LOCAL_RX_STATUS) >> + SR_1000T_LOCAL_RX_STATUS_SHIFT; + + phy_status_info->remote_rx = + (phy_1000t_stat_reg & SR_1000T_REMOTE_RX_STATUS) >> + SR_1000T_REMOTE_RX_STATUS_SHIFT; + + return TRUE; +} + +boolean_t +e1000_validate_mdi_setting(struct e1000_shared_adapter *shared) +{ + if(!shared->autoneg && (shared->mdix == 0 || shared->mdix == 3)) { + shared->mdix = 1; + return FALSE; + } + return TRUE; +} diff -urN linux-2.4.18/drivers/net/e1000/e1000_phy.h lia64-2.4/drivers/net/e1000/e1000_phy.h --- linux-2.4.18/drivers/net/e1000/e1000_phy.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/e1000/e1000_phy.h Fri Jul 19 18:51:03 2002 @@ -0,0 +1,424 @@ +/******************************************************************************* + + This software program is available to you under a choice of one of two + licenses. You may choose to be licensed under either the GNU General Public + License (GPL) Version 2, June 1991, available at + http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the + text of which follows: + + Recipient has requested a license and Intel Corporation ("Intel") is willing + to grant a license for the software entitled Linux Base Driver for the + Intel(R) PRO/1000 Family of Adapters (e1000) (the "Software") being provided + by Intel Corporation. The following definitions apply to this license: + + "Licensed Patents" means patent claims licensable by Intel Corporation which + are necessarily infringed by the use of sale of the Software alone or when + combined with the operating system referred to below. + + "Recipient" means the party to whom Intel delivers this Software. + + "Licensee" means Recipient and those third parties that receive a license to + any operating system available under the GNU Public License version 2.0 or + later. + + Copyright (c) 1999 - 2002 Intel Corporation. + All rights reserved. + + The license is provided to Recipient and Recipient's Licensees under the + following terms. + + Redistribution and use in source and binary forms of the Software, with or + without modification, are permitted provided that the following conditions + are met: + + Redistributions of source code of the Software may retain the above + copyright notice, this list of conditions and the following disclaimer. + + Redistributions in binary form of the Software may reproduce the above + copyright notice, this list of conditions and the following disclaimer in + the documentation and/or materials provided with the distribution. + + Neither the name of Intel Corporation nor the names of its contributors + shall be used to endorse or promote products derived from this Software + without specific prior written permission. + + Intel hereby grants Recipient and Licensees a non-exclusive, worldwide, + royalty-free patent license under Licensed Patents to make, use, sell, offer + to sell, import and otherwise transfer the Software, if any, in source code + and object code form. This license shall include changes to the Software + that are error corrections or other minor changes to the Software that do + not add functionality or features when the Software is incorporated in any + version of an operating system that has been distributed under the GNU + General Public License 2.0 or later. This patent license shall apply to the + combination of the Software and any operating system licensed under the GNU + Public License version 2.0 or later if, at the time Intel provides the + Software to Recipient, such addition of the Software to the then publicly + available versions of such operating systems available under the GNU Public + License version 2.0 or later (whether in gold, beta or alpha form) causes + such combination to be covered by the Licensed Patents. The patent license + shall not apply to any other combinations which include the Software. NO + hardware per se is licensed hereunder. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR IT CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + ANY LOSS OF USE; DATA, OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + +/* e1000_phy.h + * Structures, enums, and macros for the PHY + */ + +#ifndef _E1000_PHY_H_ +#define _E1000_PHY_H_ + +#include "e1000_osdep.h" + +/* PHY status info structure and supporting enums */ +typedef enum { + e1000_cable_length_50 = 0, + e1000_cable_length_50_80, + e1000_cable_length_80_110, + e1000_cable_length_110_140, + e1000_cable_length_140, + e1000_cable_length_undefined = 0xFF +} e1000_cable_length; + +typedef enum { + e1000_10bt_ext_dist_enable_normal = 0, + e1000_10bt_ext_dist_enable_lower, + e1000_10bt_ext_dist_enable_undefined = 0xFF +} e1000_10bt_ext_dist_enable; + +typedef enum { + e1000_rev_polarity_normal = 0, + e1000_rev_polarity_reversed, + e1000_rev_polarity_undefined = 0xFF +} e1000_rev_polarity; + +typedef enum { + e1000_polarity_reversal_enabled = 0, + e1000_polarity_reversal_disabled, + e1000_polarity_reversal_undefined = 0xFF +} e1000_polarity_reversal; + +typedef enum { + e1000_down_no_idle_no_detect = 0, + e1000_down_no_idle_detect, + e1000_down_no_idle_undefined = 0xFF +} e1000_down_no_idle; + +typedef enum { + e1000_auto_x_mode_manual_mdi = 0, + e1000_auto_x_mode_manual_mdix, + e1000_auto_x_mode_auto1, + e1000_auto_x_mode_auto2, + e1000_auto_x_mode_undefined = 0xFF +} e1000_auto_x_mode; + +typedef enum { + e1000_1000t_rx_status_not_ok = 0, + e1000_1000t_rx_status_ok, + e1000_1000t_rx_status_undefined = 0xFF +} e1000_1000t_rx_status; + +struct e1000_phy_info { + e1000_cable_length cable_length; + e1000_10bt_ext_dist_enable extended_10bt_distance; + e1000_rev_polarity cable_polarity; + e1000_polarity_reversal polarity_correction; + e1000_down_no_idle link_reset; + e1000_auto_x_mode mdix_mode; + e1000_1000t_rx_status local_rx; + e1000_1000t_rx_status remote_rx; +}; + +struct e1000_phy_stats { + uint32_t idle_errors; + uint32_t receive_errors; +}; + +/* Function Prototypes */ +uint16_t e1000_read_phy_reg(struct e1000_shared_adapter *shared, uint32_t reg_addr); +void e1000_write_phy_reg(struct e1000_shared_adapter *shared, uint32_t reg_addr, uint16_t data); +void e1000_phy_hw_reset(struct e1000_shared_adapter *shared); +boolean_t e1000_phy_reset(struct e1000_shared_adapter *shared); +boolean_t e1000_phy_setup(struct e1000_shared_adapter *shared, uint32_t ctrl_reg); +boolean_t e1000_phy_setup_autoneg(struct e1000_shared_adapter *shared); +void e1000_config_mac_to_phy(struct e1000_shared_adapter *shared, uint16_t mii_reg); +void e1000_config_collision_dist(struct e1000_shared_adapter *shared); +void e1000_display_mii(struct e1000_shared_adapter *shared); +boolean_t e1000_detect_gig_phy(struct e1000_shared_adapter *shared); +void e1000_phy_reset_dsp(struct e1000_shared_adapter *shared); +boolean_t e1000_wait_autoneg(struct e1000_shared_adapter *shared); +boolean_t e1000_phy_get_info(struct e1000_shared_adapter *shared, struct e1000_phy_info *phy_status_info); +boolean_t e1000_validate_mdi_setting(struct e1000_shared_adapter *shared); + +/* Bit definitions for the Management Data IO (MDIO) and Management Data + * Clock (MDC) pins in the Device Control Register. + */ +#define E1000_CTRL_PHY_RESET_DIR E1000_CTRL_SWDPIO0 +#define E1000_CTRL_PHY_RESET E1000_CTRL_SWDPIN0 +#define E1000_CTRL_MDIO_DIR E1000_CTRL_SWDPIO2 +#define E1000_CTRL_MDIO E1000_CTRL_SWDPIN2 +#define E1000_CTRL_MDC_DIR E1000_CTRL_SWDPIO3 +#define E1000_CTRL_MDC E1000_CTRL_SWDPIN3 +#define E1000_CTRL_PHY_RESET_DIR4 E1000_CTRL_EXT_SDP4_DIR +#define E1000_CTRL_PHY_RESET4 E1000_CTRL_EXT_SDP4_DATA + +/* PHY 1000 MII Register/Bit Definitions */ +/* PHY Registers defined by IEEE */ +#define PHY_CTRL 0x00 /* Control Register */ +#define PHY_STATUS 0x01 /* Status Regiser */ +#define PHY_ID1 0x02 /* Phy Id Reg (word 1) */ +#define PHY_ID2 0x03 /* Phy Id Reg (word 2) */ +#define PHY_AUTONEG_ADV 0x04 /* Autoneg Advertisement */ +#define PHY_LP_ABILITY 0x05 /* Link Partner Ability (Base Page) */ +#define PHY_AUTONEG_EXP 0x06 /* Autoneg Expansion Reg */ +#define PHY_NEXT_PAGE_TX 0x07 /* Next Page TX */ +#define PHY_LP_NEXT_PAGE 0x08 /* Link Partner Next Page */ +#define PHY_1000T_CTRL 0x09 /* 1000Base-T Control Reg */ +#define PHY_1000T_STATUS 0x0A /* 1000Base-T Status Reg */ +#define PHY_EXT_STATUS 0x0F /* Extended Status Reg */ + +/* M88E1000 Specific Registers */ +#define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Register */ +#define M88E1000_PHY_SPEC_STATUS 0x11 /* PHY Specific Status Register */ +#define M88E1000_INT_ENABLE 0x12 /* Interrupt Enable Register */ +#define M88E1000_INT_STATUS 0x13 /* Interrupt Status Register */ +#define M88E1000_EXT_PHY_SPEC_CTRL 0x14 /* Extended PHY Specific Control */ +#define M88E1000_RX_ERR_CNTR 0x15 /* Receive Error Counter */ + +#define MAX_PHY_REG_ADDRESS 0x1F /* 5 bit address bus (0-0x1F) */ + +/* PHY Control Register */ +#define MII_CR_SPEED_SELECT_MSB 0x0040 /* bits 6,13: 10=1000, 01=100, 00=10 */ +#define MII_CR_COLL_TEST_ENABLE 0x0080 /* Collision test enable */ +#define MII_CR_FULL_DUPLEX 0x0100 /* FDX =1, half duplex =0 */ +#define MII_CR_RESTART_AUTO_NEG 0x0200 /* Restart auto negotiation */ +#define MII_CR_ISOLATE 0x0400 /* Isolate PHY from MII */ +#define MII_CR_POWER_DOWN 0x0800 /* Power down */ +#define MII_CR_AUTO_NEG_EN 0x1000 /* Auto Neg Enable */ +#define MII_CR_SPEED_SELECT_LSB 0x2000 /* bits 6,13: 10=1000, 01=100, 00=10 */ +#define MII_CR_LOOPBACK 0x4000 /* 0 = normal, 1 = loopback */ +#define MII_CR_RESET 0x8000 /* 0 = normal, 1 = PHY reset */ + +/* PHY Status Register */ +#define MII_SR_EXTENDED_CAPS 0x0001 /* Extended register capabilities */ +#define MII_SR_JABBER_DETECT 0x0002 /* Jabber Detected */ +#define MII_SR_LINK_STATUS 0x0004 /* Link Status 1 = link */ +#define MII_SR_AUTONEG_CAPS 0x0008 /* Auto Neg Capable */ +#define MII_SR_REMOTE_FAULT 0x0010 /* Remote Fault Detect */ +#define MII_SR_AUTONEG_COMPLETE 0x0020 /* Auto Neg Complete */ +#define MII_SR_PREAMBLE_SUPPRESS 0x0040 /* Preamble may be suppressed */ +#define MII_SR_EXTENDED_STATUS 0x0100 /* Ext. status info in Reg 0x0F */ +#define MII_SR_100T2_HD_CAPS 0x0200 /* 100T2 Half Duplex Capable */ +#define MII_SR_100T2_FD_CAPS 0x0400 /* 100T2 Full Duplex Capable */ +#define MII_SR_10T_HD_CAPS 0x0800 /* 10T Half Duplex Capable */ +#define MII_SR_10T_FD_CAPS 0x1000 /* 10T Full Duplex Capable */ +#define MII_SR_100X_HD_CAPS 0x2000 /* 100X Half Duplex Capable */ +#define MII_SR_100X_FD_CAPS 0x4000 /* 100X Full Duplex Capable */ +#define MII_SR_100T4_CAPS 0x8000 /* 100T4 Capable */ + +/* Autoneg Advertisement Register */ +#define NWAY_AR_SELECTOR_FIELD 0x0001 /* indicates IEEE 802.3 CSMA/CD */ +#define NWAY_AR_10T_HD_CAPS 0x0020 /* 10T Half Duplex Capable */ +#define NWAY_AR_10T_FD_CAPS 0x0040 /* 10T Full Duplex Capable */ +#define NWAY_AR_100TX_HD_CAPS 0x0080 /* 100TX Half Duplex Capable */ +#define NWAY_AR_100TX_FD_CAPS 0x0100 /* 100TX Full Duplex Capable */ +#define NWAY_AR_100T4_CAPS 0x0200 /* 100T4 Capable */ +#define NWAY_AR_PAUSE 0x0400 /* Pause operation desired */ +#define NWAY_AR_ASM_DIR 0x0800 /* Asymmetric Pause Direction bit */ +#define NWAY_AR_REMOTE_FAULT 0x2000 /* Remote Fault detected */ +#define NWAY_AR_NEXT_PAGE 0x8000 /* Next Page ability supported */ + +/* Link Partner Ability Register (Base Page) */ +#define NWAY_LPAR_SELECTOR_FIELD 0x0000 /* LP protocol selector field */ +#define NWAY_LPAR_10T_HD_CAPS 0x0020 /* LP is 10T Half Duplex Capable */ +#define NWAY_LPAR_10T_FD_CAPS 0x0040 /* LP is 10T Full Duplex Capable */ +#define NWAY_LPAR_100TX_HD_CAPS 0x0080 /* LP is 100TX Half Duplex Capable */ +#define NWAY_LPAR_100TX_FD_CAPS 0x0100 /* LP is 100TX Full Duplex Capable */ +#define NWAY_LPAR_100T4_CAPS 0x0200 /* LP is 100T4 Capable */ +#define NWAY_LPAR_PAUSE 0x0400 /* LP Pause operation desired */ +#define NWAY_LPAR_ASM_DIR 0x0800 /* LP Asymmetric Pause Direction bit */ +#define NWAY_LPAR_REMOTE_FAULT 0x2000 /* LP has detected Remote Fault */ +#define NWAY_LPAR_ACKNOWLEDGE 0x4000 /* LP has rx'd link code word */ +#define NWAY_LPAR_NEXT_PAGE 0x8000 /* Next Page ability supported */ + +/* Autoneg Expansion Register */ +#define NWAY_ER_LP_NWAY_CAPS 0x0001 /* LP has Auto Neg Capability */ +#define NWAY_ER_PAGE_RXD 0x0002 /* LP is 10T Half Duplex Capable */ +#define NWAY_ER_NEXT_PAGE_CAPS 0x0004 /* LP is 10T Full Duplex Capable */ +#define NWAY_ER_LP_NEXT_PAGE_CAPS 0x0008 /* LP is 100TX Half Duplex Capable */ +#define NWAY_ER_PAR_DETECT_FAULT 0x0100 /* LP is 100TX Full Duplex Capable */ + +/* Next Page TX Register */ +#define NPTX_MSG_CODE_FIELD 0x0001 /* NP msg code or unformatted data */ +#define NPTX_TOGGLE 0x0800 /* Toggles between exchanges + * of different NP + */ +#define NPTX_ACKNOWLDGE2 0x1000 /* 1 = will comply with msg + * 0 = cannot comply with msg + */ +#define NPTX_MSG_PAGE 0x2000 /* formatted(1)/unformatted(0) pg */ +#define NPTX_NEXT_PAGE 0x8000 /* 1 = addition NP will follow + * 0 = sending last NP + */ + +/* Link Partner Next Page Register */ +#define LP_RNPR_MSG_CODE_FIELD 0x0001 /* NP msg code or unformatted data */ +#define LP_RNPR_TOGGLE 0x0800 /* Toggles between exchanges + * of different NP + */ +#define LP_RNPR_ACKNOWLDGE2 0x1000 /* 1 = will comply with msg + * 0 = cannot comply with msg + */ +#define LP_RNPR_MSG_PAGE 0x2000 /* formatted(1)/unformatted(0) pg */ +#define LP_RNPR_ACKNOWLDGE 0x4000 /* 1 = ACK / 0 = NO ACK */ +#define LP_RNPR_NEXT_PAGE 0x8000 /* 1 = addition NP will follow + * 0 = sending last NP + */ + +/* 1000BASE-T Control Register */ +#define CR_1000T_ASYM_PAUSE 0x0080 /* Advertise asymmetric pause bit */ +#define CR_1000T_HD_CAPS 0x0100 /* Advertise 1000T HD capability */ +#define CR_1000T_FD_CAPS 0x0200 /* Advertise 1000T FD capability */ +#define CR_1000T_REPEATER_DTE 0x0400 /* 1=Repeater/switch device port */ + /* 0=DTE device */ +#define CR_1000T_MS_VALUE 0x0800 /* 1=Configure PHY as Master */ + /* 0=Configure PHY as Slave */ +#define CR_1000T_MS_ENABLE 0x1000 /* 1=Master/Slave manual config value */ + /* 0=Automatic Master/Slave config */ +#define CR_1000T_TEST_MODE_NORMAL 0x0000 /* Normal Operation */ +#define CR_1000T_TEST_MODE_1 0x2000 /* Transmit Waveform test */ +#define CR_1000T_TEST_MODE_2 0x4000 /* Master Transmit Jitter test */ +#define CR_1000T_TEST_MODE_3 0x6000 /* Slave Transmit Jitter test */ +#define CR_1000T_TEST_MODE_4 0x8000 /* Transmitter Distortion test */ + +/* 1000BASE-T Status Register */ +#define SR_1000T_IDLE_ERROR_CNT 0x00FF /* Num idle errors since last read */ +#define SR_1000T_ASYM_PAUSE_DIR 0x0100 /* LP asymmetric pause direction bit */ +#define SR_1000T_LP_HD_CAPS 0x0400 /* LP is 1000T HD capable */ +#define SR_1000T_LP_FD_CAPS 0x0800 /* LP is 1000T FD capable */ +#define SR_1000T_REMOTE_RX_STATUS 0x1000 /* Remote receiver OK */ +#define SR_1000T_LOCAL_RX_STATUS 0x2000 /* Local receiver OK */ +#define SR_1000T_MS_CONFIG_RES 0x4000 /* 1=Local TX is Master, 0=Slave */ +#define SR_1000T_MS_CONFIG_FAULT 0x8000 /* Master/Slave config fault */ +#define SR_1000T_REMOTE_RX_STATUS_SHIFT 12 +#define SR_1000T_LOCAL_RX_STATUS_SHIFT 13 + +/* Extended Status Register */ +#define IEEE_ESR_1000T_HD_CAPS 0x1000 /* 1000T HD capable */ +#define IEEE_ESR_1000T_FD_CAPS 0x2000 /* 1000T FD capable */ +#define IEEE_ESR_1000X_HD_CAPS 0x4000 /* 1000X HD capable */ +#define IEEE_ESR_1000X_FD_CAPS 0x8000 /* 1000X FD capable */ + +#define PHY_TX_POLARITY_MASK 0x0100 /* register 10h bit 8 (polarity bit) */ +#define PHY_TX_NORMAL_POLARITY 0 /* register 10h bit 8 (normal polarity) */ + +#define AUTO_POLARITY_DISABLE 0x0010 /* register 11h bit 4 */ + /* (0=enable, 1=disable) */ + +/* M88E1000 PHY Specific Control Register */ +#define M88E1000_PSCR_JABBER_DISABLE 0x0001 /* 1=Jabber Function disabled */ +#define M88E1000_PSCR_POLARITY_REVERSAL 0x0002 /* 1=Polarity Reversal enabled */ +#define M88E1000_PSCR_SQE_TEST 0x0004 /* 1=SQE Test enabled */ +#define M88E1000_PSCR_CLK125_DISABLE 0x0010 /* 1=CLK125 low, + * 0=CLK125 toggling + */ +#define M88E1000_PSCR_MDI_MANUAL_MODE 0x0000 /* MDI Crossover Mode bits 6:5 */ + /* Manual MDI configuration */ +#define M88E1000_PSCR_MDIX_MANUAL_MODE 0x0020 /* Manual MDIX configuration */ +#define M88E1000_PSCR_AUTO_X_1000T 0x0040 /* 1000BASE-T: Auto crossover, + * 100BASE-TX/10BASE-T: + * MDI Mode + */ +#define M88E1000_PSCR_AUTO_X_MODE 0x0060 /* Auto crossover enabled + * all speeds. + */ +#define M88E1000_PSCR_10BT_EXT_DIST_ENABLE 0x0080 + /* 1=Enable Extended 10BASE-T distance + * (Lower 10BASE-T RX Threshold) + * 0=Normal 10BASE-T RX Threshold */ +#define M88E1000_PSCR_MII_5BIT_ENABLE 0x0100 + /* 1=5-Bit interface in 100BASE-TX + * 0=MII interface in 100BASE-TX */ +#define M88E1000_PSCR_SCRAMBLER_DISABLE 0x0200 /* 1=Scrambler disable */ +#define M88E1000_PSCR_FORCE_LINK_GOOD 0x0400 /* 1=Force link good */ +#define M88E1000_PSCR_ASSERT_CRS_ON_TX 0x0800 /* 1=Assert CRS on Transmit */ + +#define M88E1000_PSCR_POLARITY_REVERSAL_SHIFT 1 +#define M88E1000_PSCR_AUTO_X_MODE_SHIFT 5 +#define M88E1000_PSCR_10BT_EXT_DIST_ENABLE_SHIFT 7 + +/* M88E1000 PHY Specific Status Register */ +#define M88E1000_PSSR_JABBER 0x0001 /* 1=Jabber */ +#define M88E1000_PSSR_REV_POLARITY 0x0002 /* 1=Polarity reversed */ +#define M88E1000_PSSR_MDIX 0x0040 /* 1=MDIX; 0=MDI */ +#define M88E1000_PSSR_CABLE_LENGTH 0x0380 /* 0=<50M;1=50-80M;2=80-110M; + * 3=110-140M;4=>140M */ +#define M88E1000_PSSR_LINK 0x0400 /* 1=Link up, 0=Link down */ +#define M88E1000_PSSR_SPD_DPLX_RESOLVED 0x0800 /* 1=Speed & Duplex resolved */ +#define M88E1000_PSSR_PAGE_RCVD 0x1000 /* 1=Page received */ +#define M88E1000_PSSR_DPLX 0x2000 /* 1=Duplex 0=Half Duplex */ +#define M88E1000_PSSR_SPEED 0xC000 /* Speed, bits 14:15 */ +#define M88E1000_PSSR_10MBS 0x0000 /* 00=10Mbs */ +#define M88E1000_PSSR_100MBS 0x4000 /* 01=100Mbs */ +#define M88E1000_PSSR_1000MBS 0x8000 /* 10=1000Mbs */ + +#define M88E1000_PSSR_REV_POLARITY_SHIFT 1 +#define M88E1000_PSSR_MDIX_SHIFT 6 +#define M88E1000_PSSR_CABLE_LENGTH_SHIFT 7 + +/* M88E1000 Extended PHY Specific Control Register */ +#define M88E1000_EPSCR_FIBER_LOOPBACK 0x4000 /* 1=Fiber loopback */ +#define M88E1000_EPSCR_DOWN_NO_IDLE 0x8000 /* 1=Lost lock detect enabled. + * Will assert lost lock and bring + * link down if idle not seen + * within 1ms in 1000BASE-T + */ +#define M88E1000_EPSCR_TX_CLK_2_5 0x0060 /* 2.5 MHz TX_CLK */ +#define M88E1000_EPSCR_TX_CLK_25 0x0070 /* 25 MHz TX_CLK */ +#define M88E1000_EPSCR_TX_CLK_0 0x0000 /* NO TX_CLK */ + +#define M88E1000_EPSCR_DOWN_NO_IDLE_SHIFT 15 + +/* Bit definitions for valid PHY IDs. */ +#define M88E1000_12_PHY_ID 0x01410C50 +#define M88E1000_14_PHY_ID 0x01410C40 +#define M88E1000_I_PHY_ID 0x01410C30 +#define M88E1011_I_PHY_ID 0x01410C20 + +/* Miscellaneous PHY bit definitions. */ +#define PHY_PREAMBLE 0xFFFFFFFF +#define PHY_SOF 0x01 +#define PHY_OP_READ 0x02 +#define PHY_OP_WRITE 0x01 +#define PHY_TURNAROUND 0x02 +#define PHY_PREAMBLE_SIZE 32 +#define MII_CR_SPEED_1000 0x0040 +#define MII_CR_SPEED_100 0x2000 +#define MII_CR_SPEED_10 0x0000 +#define E1000_PHY_ADDRESS 0x01 +#define PHY_AUTO_NEG_TIME 45 /* 4.5 Seconds */ +#define PHY_FORCE_TIME 20 /* 2.0 Seconds */ +#define PHY_REVISION_MASK 0xFFFFFFF0 +#define DEVICE_SPEED_MASK 0x00000300 /* Device Ctrl Reg Speed Mask */ +#define REG4_SPEED_MASK 0x01E0 +#define REG9_SPEED_MASK 0x0300 +#define ADVERTISE_10_HALF 0x0001 +#define ADVERTISE_10_FULL 0x0002 +#define ADVERTISE_100_HALF 0x0004 +#define ADVERTISE_100_FULL 0x0008 +#define ADVERTISE_1000_HALF 0x0010 +#define ADVERTISE_1000_FULL 0x0020 +#define AUTONEG_ADVERTISE_SPEED_DEFAULT 0x002F /* Everything but 1000-Half */ + +#endif /* _E1000_PHY_H_ */ diff -urN linux-2.4.18/drivers/net/e1000/e1000_proc.c lia64-2.4/drivers/net/e1000/e1000_proc.c --- linux-2.4.18/drivers/net/e1000/e1000_proc.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/e1000/e1000_proc.c Fri Jul 19 17:19:35 2002 @@ -0,0 +1,1437 @@ +/******************************************************************************* + + This software program is available to you under a choice of one of two + licenses. You may choose to be licensed under either the GNU General Public + License (GPL) Version 2, June 1991, available at + http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the + text of which follows: + + Recipient has requested a license and Intel Corporation ("Intel") is willing + to grant a license for the software entitled Linux Base Driver for the + Intel(R) PRO/1000 Family of Adapters (e1000) (the "Software") being provided + by Intel Corporation. The following definitions apply to this license: + + "Licensed Patents" means patent claims licensable by Intel Corporation which + are necessarily infringed by the use of sale of the Software alone or when + combined with the operating system referred to below. + + "Recipient" means the party to whom Intel delivers this Software. + + "Licensee" means Recipient and those third parties that receive a license to + any operating system available under the GNU Public License version 2.0 or + later. + + Copyright (c) 1999 - 2002 Intel Corporation. + All rights reserved. + + The license is provided to Recipient and Recipient's Licensees under the + following terms. + + Redistribution and use in source and binary forms of the Software, with or + without modification, are permitted provided that the following conditions + are met: + + Redistributions of source code of the Software may retain the above + copyright notice, this list of conditions and the following disclaimer. + + Redistributions in binary form of the Software may reproduce the above + copyright notice, this list of conditions and the following disclaimer in + the documentation and/or materials provided with the distribution. + + Neither the name of Intel Corporation nor the names of its contributors + shall be used to endorse or promote products derived from this Software + without specific prior written permission. + + Intel hereby grants Recipient and Licensees a non-exclusive, worldwide, + royalty-free patent license under Licensed Patents to make, use, sell, offer + to sell, import and otherwise transfer the Software, if any, in source code + and object code form. This license shall include changes to the Software + that are error corrections or other minor changes to the Software that do + not add functionality or features when the Software is incorporated in any + version of an operating system that has been distributed under the GNU + General Public License 2.0 or later. This patent license shall apply to the + combination of the Software and any operating system licensed under the GNU + Public License version 2.0 or later if, at the time Intel provides the + Software to Recipient, such addition of the Software to the then publicly + available versions of such operating systems available under the GNU Public + License version 2.0 or later (whether in gold, beta or alpha form) causes + such combination to be covered by the Licensed Patents. The patent license + shall not apply to any other combinations which include the Software. NO + hardware per se is licensed hereunder. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR IT CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + ANY LOSS OF USE; DATA, OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + +/***************************************************************************/ +/* /proc File System Interaface Support Functions */ +/***************************************************************************/ + +#include "e1000.h" +extern char e1000_driver_name[]; +extern char e1000_driver_version[]; +#include "e1000_proc.h" +#include + +struct proc_dir_entry *e1000_proc_dir; + +#define CABLE_LENGTH_TO_STRING() \ + msg = \ + (adapter->phy_info.cable_length == e1000_cable_length_50) ? "0-50 Meters (+/- 20 Meters)" : \ + (adapter->phy_info.cable_length == e1000_cable_length_50_80) ? "50-80 Meters (+/- 20 Meters)" : \ + (adapter->phy_info.cable_length == e1000_cable_length_80_110) ? "80-110 Meters (+/- 20 Meters)" : \ + (adapter->phy_info.cable_length == e1000_cable_length_110_140) ? "110-140 Meters (+/- 20 Meters)" : \ + (adapter->phy_info.cable_length == e1000_cable_length_140) ? "> 140 Meters (+/- 20 Meters)" : \ + "Unknown"; + +#define EXTENDED_10BASE_T_DISTANCE_TO_STRING() \ + msg = \ + (adapter->phy_info.extended_10bt_distance == \ + e1000_10bt_ext_dist_enable_normal) ? "Disabled" : \ + (adapter->phy_info.extended_10bt_distance == \ + e1000_10bt_ext_dist_enable_lower) ? "Enabled" : "Unknown"; + +#define CABLE_POLARITY_TO_STRING() \ + msg = \ + (adapter->phy_info.cable_polarity == e1000_rev_polarity_normal) ? "Normal" : \ + (adapter->phy_info.cable_polarity == e1000_rev_polarity_reversed) ? \ + "Reversed" : "Unknown"; + +#define POLARITY_CORRECTION_TO_STRING() \ + msg = \ + (adapter->phy_info.polarity_correction == \ + e1000_polarity_reversal_enabled) ? "Disabled" : \ + (adapter->phy_info.polarity_correction == \ + e1000_polarity_reversal_disabled) ? "Enabled" : "Undefined"; + +#define LINK_RESET_TO_STRING() \ + msg = \ + (adapter->phy_info.link_reset == e1000_down_no_idle_no_detect) ? "Disabled" : \ + (adapter->phy_info.link_reset == e1000_down_no_idle_detect) ? "Enabled" : \ + "Unknown"; + +#define MDI_X_MODE_TO_STRING() \ + msg = (adapter->phy_info.mdix_mode == 0) ? "MDI" : "MDI-X"; + +#define LOCAL_RECEIVER_STATUS_TO_STRING() \ + msg = \ + (adapter->phy_info.local_rx == e1000_1000t_rx_status_not_ok) ? "NOT_OK" : \ + (adapter->phy_info.local_rx == e1000_1000t_rx_status_ok) ? "OK" : \ + "Unknown"; + +#define REMOTE_RECEIVER_STATUS_TO_STRING() \ + msg = \ + (adapter->phy_info.remote_rx == e1000_1000t_rx_status_not_ok) ? "NOT_OK" : \ + (adapter->phy_info.remote_rx == e1000_1000t_rx_status_ok) ? "OK" : \ + "Unknown"; + +static void e1000_link_update(struct e1000_adapter * adapter) { + + e1000_check_for_link(&adapter->shared); + if(E1000_READ_REG(&adapter->shared, STATUS) & E1000_STATUS_LU) + adapter->link_active = 1; + else + adapter->link_active = 0; + + if (adapter->link_active) { + e1000_get_speed_and_duplex(&adapter->shared, &adapter->link_speed, &adapter->link_duplex); + } else { + adapter->link_speed = 0; + adapter->link_duplex = 0; + } + return; +} + +static int e1000_generic_read(char *page, char **start, off_t off, + int count, int *eof) +{ + int len; + + len = strlen(page); + page[len++] = '\n'; + + if (len <= off + count) + *eof = 1; + *start = page + off; + len -= off; + if (len > count) + len = count; + if (len < 0) + len = 0; + return len; +} + +static int e1000_read_ulong(char *page, char **start, off_t off, + int count, int *eof, unsigned long l) +{ + sprintf(page, "%lu", l); + + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_ulong_hex(char *page, char **start, off_t off, + int count, int *eof, unsigned long l) +{ + sprintf(page, "0x%04lx", l); + + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_ullong(char *page, char **start, off_t off, + int count, int *eof, unsigned long long l) +{ + sprintf(page, "%Lu", l); + + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_hwaddr(char *page, char **start, off_t off, + int count, int *eof, unsigned char *hwaddr) +{ + sprintf(page, "%02X:%02X:%02X:%02X:%02X:%02X", + hwaddr[0], hwaddr[1], hwaddr[2], + hwaddr[3], hwaddr[4], hwaddr[5]); + + return e1000_generic_read(page, start, off, count, eof); +} + +/* need to check page boundaries !!! */ +static int e1000_read_info(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + struct net_device_stats *stats = &adapter->net_stats; + unsigned char *hwaddr; + char *pagep = page; + char *msg; + + page += sprintf(page, "%-32s %s\n", DESCRIPTION_TAG, adapter->id_string); + page += sprintf(page, "%-32s %06lx-%03x\n", + PART_NUMBER_TAG, + (unsigned long )adapter->part_num >> 8, + adapter->part_num & 0x000000FF); + + page += sprintf(page, "%-32s %s\n", DRVR_NAME_TAG, e1000_driver_name); + + page += sprintf(page, "%-32s %s\n", DRVR_VERSION_TAG, e1000_driver_version); + + page += sprintf(page, "%-32s 0x%04lx\n", + PCI_VENDOR_TAG, (unsigned long) adapter->vendor_id); + page += sprintf(page, "%-32s 0x%04lx\n", + PCI_DEVICE_ID_TAG, (unsigned long) adapter->device_id); + page += sprintf(page, "%-32s 0x%04lx\n", + PCI_SUBSYSTEM_VENDOR_TAG, + (unsigned long) adapter->subven_id); + page += sprintf(page, "%-32s 0x%04lx\n", + PCI_SUBSYSTEM_ID_TAG, + (unsigned long) adapter->subsys_id); + page += sprintf(page, "%-32s 0x%02lx\n", + PCI_REVISION_ID_TAG, + (unsigned long) adapter->rev_id); + + page += sprintf(page, "%-32s %lu\n", + PCI_BUS_TAG, + (unsigned long) (adapter->pdev->bus->number)); + page += sprintf(page, "%-32s %lu\n", + PCI_SLOT_TAG, + (unsigned + long) (PCI_SLOT((adapter->pdev->devfn)))); + + if(adapter->shared.mac_type >= e1000_82543) { + page += sprintf(page, "%-32s %s\n", + PCI_BUS_TYPE_TAG, + (adapter->shared.bus_type == e1000_bus_type_pci) ? "PCI" : + (adapter->shared.bus_type == e1000_bus_type_pcix) ? "PCI-X" : + "UNKNOWN"); + + page += sprintf(page, "%-32s %s\n", + PCI_BUS_SPEED_TAG, + (adapter->shared.bus_speed == e1000_bus_speed_33) ? "33MHz" : + (adapter->shared.bus_speed == e1000_bus_speed_66) ? "66MHz" : + (adapter->shared.bus_speed == e1000_bus_speed_100) ? "100MHz" : + (adapter->shared.bus_speed == e1000_bus_speed_133) ? "133MHz" : + "UNKNOWN"); + + page += sprintf(page, "%-32s %s\n", + PCI_BUS_WIDTH_TAG, + (adapter->shared.bus_width == e1000_bus_width_32) ? "32-bit" : + (adapter->shared.bus_width == e1000_bus_width_64) ? "64-bit" : + "UNKNOWN"); + } + + page += + sprintf(page, "%-32s %lu\n", IRQ_TAG, + (unsigned long) (adapter->pdev->irq)); + page += + sprintf(page, "%-32s %s\n", SYSTEM_DEVICE_NAME_TAG, + adapter->netdev->name); + + hwaddr = adapter->netdev->dev_addr; + page += sprintf(page, "%-32s %02X:%02X:%02X:%02X:%02X:%02X\n", + CURRENT_HWADDR_TAG, + hwaddr[0], hwaddr[1], hwaddr[2], + hwaddr[3], hwaddr[4], hwaddr[5]); + + hwaddr = adapter->perm_net_addr; + page += sprintf(page, "%-32s %02X:%02X:%02X:%02X:%02X:%02X\n", + PERMANENT_HWADDR_TAG, + hwaddr[0], hwaddr[1], hwaddr[2], + hwaddr[3], hwaddr[4], hwaddr[5]); + + page += sprintf(page, "\n"); + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + if (adapter->link_active == 1) + msg = "up"; + else + msg = "down"; + page += sprintf(page, "%-32s %s\n", LINK_TAG, msg); + + if (adapter->link_speed) + page += sprintf(page, "%-32s %lu\n", + SPEED_TAG, + (unsigned long) (adapter->link_speed)); + else + page += sprintf(page, "%-32s %s\n", SPEED_TAG, "N/A"); + + msg = adapter->link_duplex == FULL_DUPLEX ? "full" : + ((adapter->link_duplex == 0) ? "N/A" : "half"); + page += sprintf(page, "%-32s %s\n", DUPLEX_TAG, msg); + + if (adapter->netdev->flags & IFF_UP) + msg = "up"; + else + msg = "down"; + page += sprintf(page, "%-32s %s\n", STATE_TAG, msg); + + page += sprintf(page, "\n"); + + page += sprintf(page, "%-32s %lu\n", + RX_PACKETS_TAG, (unsigned long) stats->rx_packets); + page += sprintf(page, "%-32s %lu\n", + TX_PACKETS_TAG, (unsigned long) stats->tx_packets); + page += sprintf(page, "%-32s %lu\n", + RX_BYTES_TAG, (unsigned long) stats->rx_bytes); + page += sprintf(page, "%-32s %lu\n", + TX_BYTES_TAG, (unsigned long) stats->tx_bytes); + page += sprintf(page, "%-32s %lu\n", + RX_ERRORS_TAG, (unsigned long) stats->rx_errors); + page += sprintf(page, "%-32s %lu\n", + TX_ERRORS_TAG, (unsigned long) stats->tx_errors); + page += sprintf(page, "%-32s %lu\n", + RX_DROPPED_TAG, (unsigned long) stats->rx_dropped); + page += sprintf(page, "%-32s %lu\n", + TX_DROPPED_TAG, (unsigned long) stats->tx_dropped); + page += sprintf(page, "%-32s %lu\n", + MULTICAST_TAG, (unsigned long) stats->multicast); + page += sprintf(page, "%-32s %lu\n", + COLLISIONS_TAG, (unsigned long) stats->collisions); + page += sprintf(page, "%-32s %lu\n", + RX_LENGTH_ERRORS_TAG, + (unsigned long) stats->rx_length_errors); + page += sprintf(page, "%-32s %lu\n", + RX_OVER_ERRORS_TAG, + (unsigned long) stats->rx_over_errors); + page += sprintf(page, "%-32s %lu\n", + RX_CRC_ERRORS_TAG, + (unsigned long) stats->rx_crc_errors); + page += sprintf(page, "%-32s %lu\n", + RX_FRAME_ERRORS_TAG, + (unsigned long) stats->rx_frame_errors); + page += sprintf(page, "%-32s %lu\n", + RX_FIFO_ERRORS_TAG, + (unsigned long) stats->rx_fifo_errors); + page += sprintf(page, "%-32s %lu\n", + RX_MISSED_ERRORS_TAG, + (unsigned long) stats->rx_missed_errors); + page += sprintf(page, "%-32s %lu\n", + TX_ABORTED_ERRORS_TAG, + (unsigned long) stats->tx_aborted_errors); + page += sprintf(page, "%-32s %lu\n", + TX_CARRIER_ERRORS_TAG, + (unsigned long) stats->tx_carrier_errors); + page += sprintf(page, "%-32s %lu\n", + TX_FIFO_ERRORS_TAG, + (unsigned long) stats->tx_fifo_errors); + page += sprintf(page, "%-32s %lu\n", + TX_HEARTBEAT_ERRORS_TAG, + (unsigned long) stats->tx_heartbeat_errors); + page += sprintf(page, "%-32s %lu\n", + TX_WINDOW_ERRORS_TAG, + (unsigned long) stats->tx_window_errors); + + page += sprintf(page, "\n"); + + /* 8254x specific stats */ + page += sprintf(page, "%-32s %Lu\n", + TX_LATE_COLL_TAG, + (unsigned long long)adapter->stats.latecol); + page += sprintf(page, "%-32s %Lu\n", + TX_DEFERRED_TAG, + (unsigned long long)adapter->stats.dc); + page += sprintf(page, "%-32s %Lu\n", + TX_SINGLE_COLL_TAG, + (unsigned long long)adapter->stats.scc); + page += sprintf(page, "%-32s %Lu\n", + TX_MULTI_COLL_TAG, + (unsigned long long)adapter->stats.mcc); + page += sprintf(page, "%-32s %Lu\n", + RX_LONG_ERRORS_TAG, + (unsigned long long)adapter->stats.roc); + page += sprintf(page, "%-32s %Lu\n", + RX_SHORT_ERRORS_TAG, + (unsigned long long)adapter->stats.ruc); + /* The 82542 does not have an alignment error count register */ + /* ALGNERRC is only valid in MII mode at 10 or 100 Mbps */ + if(adapter->shared.mac_type >= e1000_82543) + page += sprintf(page, "%-32s %Lu\n", + RX_ALIGN_ERRORS_TAG, + (unsigned long long)adapter->stats.algnerrc); + page += sprintf(page, "%-32s %Lu\n", + RX_XON_TAG, + (unsigned long long)adapter->stats.xonrxc); + page += sprintf(page, "%-32s %Lu\n", + RX_XOFF_TAG, + (unsigned long long)adapter->stats.xoffrxc); + page += sprintf(page, "%-32s %Lu\n", + TX_XON_TAG, + (unsigned long long)adapter->stats.xontxc); + page += sprintf(page, "%-32s %Lu\n", + TX_XOFF_TAG, + (unsigned long long)adapter->stats.xofftxc); + page += sprintf(page, "%-32s %Lu\n", + RX_CSUM_GOOD_TAG, + (unsigned long long)adapter->XsumRXGood); + page += sprintf(page, "%-32s %Lu\n", + RX_CSUM_ERROR_TAG, + (unsigned long long)adapter->XsumRXError); + + if (adapter->shared.media_type == e1000_media_type_copper) + msg = "Copper"; + else + msg = "Fiber"; + page += sprintf(page, "\n%-32s %s\n", MEDIA_TYPE_TAG, msg); + + if (adapter->shared.media_type == e1000_media_type_copper) { + CABLE_LENGTH_TO_STRING(); + page += sprintf(page, "%-32s %s\n", CABLE_LENGTH_TAG, msg); + + EXTENDED_10BASE_T_DISTANCE_TO_STRING(); + page += sprintf(page, "%-32s %s\n", EXTENDED_10BASE_T_DISTANCE_TAG, msg); + + CABLE_POLARITY_TO_STRING(); + page += sprintf(page, "%-32s %s\n", CABLE_POLARITY_TAG, msg); + + POLARITY_CORRECTION_TO_STRING(); + page += sprintf(page, "%-32s %s\n", CABLE_POLARITY_CORRECTION_TAG, msg); + + page += sprintf(page, "%-32s %lu\n", IDLE_ERRORS_TAG, (unsigned long)adapter->phy_stats.idle_errors ); + + LINK_RESET_TO_STRING(); + page += sprintf(page, "%-32s %s\n", LINK_RESET_ENABLED_TAG, msg); + + page += sprintf(page, "%-32s %lu\n", RECEIVE_ERRORS_TAG, (unsigned long)adapter->phy_stats.receive_errors); + + MDI_X_MODE_TO_STRING(); + page += sprintf(page, "%-32s %s\n", MDI_X_ENABLED_TAG, msg); + + LOCAL_RECEIVER_STATUS_TO_STRING(); + page += sprintf(page, "%-32s %s\n", LOCAL_RECEIVER_STATUS_TAG, msg); + + REMOTE_RECEIVER_STATUS_TO_STRING(); + page += sprintf(page, "%-32s %s\n", REMOTE_RECEIVER_STATUS_TAG, msg); + } + + *page = 0; + return e1000_generic_read(pagep, start, off, count, eof); +} + +static int e1000_read_descr(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + strncpy(page, adapter->id_string, PAGE_SIZE); + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_partnum(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + sprintf(page, "%06lx-%03x", + (unsigned long)adapter->part_num >> 8, + adapter->part_num & 0x000000FF); + + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_drvr_name(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + strncpy(page, e1000_driver_name, PAGE_SIZE); + + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_drvr_ver(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + strncpy(page, e1000_driver_version, PAGE_SIZE); + + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_pci_vendor(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong_hex(page, start, off, count, eof, + (unsigned long) adapter->vendor_id); +} + +static int e1000_read_pci_device(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong_hex(page, start, off, count, eof, + (unsigned long) adapter->device_id); +} + +static int e1000_read_pci_sub_vendor(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong_hex(page, start, off, count, eof, + (unsigned long) adapter->subven_id); +} + +static int e1000_read_pci_sub_device(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong_hex(page, start, off, count, eof, + (unsigned long) adapter->subsys_id); +} + +static int e1000_read_pci_revision(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong_hex(page, start, off, count, eof, + (unsigned long) adapter->rev_id); +} + +static int e1000_read_dev_name(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + strncpy(page, adapter->netdev->name, PAGE_SIZE); + + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_pci_bus(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) (adapter->pdev->bus->number)); +} + +static int e1000_read_pci_slot(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned + long) (PCI_SLOT((adapter->pdev->devfn)))); +} + +static int e1000_read_pci_bus_type(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + strncpy(page, + (adapter->shared.bus_type == e1000_bus_type_pci) ? "PCI" : + (adapter->shared.bus_type == e1000_bus_type_pcix) ? "PCI-X" : + "UNKNOWN", PAGE_SIZE); + + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_pci_bus_speed(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + strncpy(page, + (adapter->shared.bus_speed == e1000_bus_speed_33) ? "33MHz" : + (adapter->shared.bus_speed == e1000_bus_speed_66) ? "66MHz" : + (adapter->shared.bus_speed == e1000_bus_speed_100) ? "100MHz" : + (adapter->shared.bus_speed == e1000_bus_speed_133) ? "133MHz" : + "UNKNOWN", PAGE_SIZE); + + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_pci_bus_width(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + strncpy(page, + (adapter->shared.bus_width == e1000_bus_width_32) ? "32-bit" : + (adapter->shared.bus_width == e1000_bus_width_64) ? "64-bit" : + "UNKNOWN", PAGE_SIZE); + + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_irq(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) (adapter->pdev->irq)); +} + +static int e1000_read_current_hwaddr(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + unsigned char *hwaddr = adapter->netdev->dev_addr; + + return e1000_read_hwaddr(page, start, off, count, eof, hwaddr); +} + +static int e1000_read_permanent_hwaddr(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + unsigned char *hwaddr = adapter->perm_net_addr; + + return e1000_read_hwaddr(page, start, off, count, eof, hwaddr); +} + +static int e1000_read_link_status(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + if (adapter->link_active == 1) + strncpy(page, "up", PAGE_SIZE); + else + strncpy(page, "down", PAGE_SIZE); + + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_speed(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + if (adapter->link_speed) + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) (adapter->link_speed)); + strncpy(page, "N/A", PAGE_SIZE); + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_dplx_mode(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + char *dplx_mode; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + dplx_mode = adapter->link_duplex == FULL_DUPLEX ? "full" : + ((adapter->link_duplex == 0) ? "N/A" : "half"); + strncpy(page, dplx_mode, PAGE_SIZE); + + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_state(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + if (adapter->netdev->flags & IFF_UP) + strncpy(page, "up", PAGE_SIZE); + else + strncpy(page, "down", PAGE_SIZE); + + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_rx_packets(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.rx_packets); +} + +static int e1000_read_tx_packets(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.tx_packets); +} + +static int e1000_read_rx_bytes(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.rx_bytes); +} + +static int e1000_read_tx_bytes(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.tx_bytes); +} + +static int e1000_read_rx_errors(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.rx_errors); +} + +static int e1000_read_tx_errors(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.tx_errors); +} + +static int e1000_read_rx_dropped(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.rx_dropped); +} + +static int e1000_read_tx_dropped(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.tx_dropped); +} + +static int e1000_read_rx_multicast_packets(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.multicast); +} + +static int e1000_read_collisions(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.collisions); +} + +static int e1000_read_rx_length_errors(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.rx_length_errors); +} + +static int e1000_read_rx_over_errors(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.rx_over_errors); +} + +static int e1000_read_rx_crc_errors(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.rx_crc_errors); +} + +static int e1000_read_rx_frame_errors(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.rx_frame_errors); +} + +static int e1000_read_rx_fifo_errors(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.rx_fifo_errors); +} + +static int e1000_read_rx_missed_errors(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.rx_missed_errors); +} + +static int e1000_read_tx_aborted_errors(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.tx_aborted_errors); +} + +static int e1000_read_tx_carrier_errors(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.tx_carrier_errors); +} + +static int e1000_read_tx_fifo_errors(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.tx_fifo_errors); +} + +static int e1000_read_tx_heartbeat_errors(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.tx_heartbeat_errors); +} + +static int e1000_read_tx_window_errors(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + return e1000_read_ulong(page, start, off, count, eof, + (unsigned long) adapter->net_stats.tx_window_errors); +} + +/* 8254x specific stats */ +static int e1000_read_tx_late_coll(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + return e1000_read_ullong(page, start, off, count, eof, adapter->stats.latecol); +} + +static int e1000_read_tx_defer_events(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + return e1000_read_ullong(page, start, off, count, eof, adapter->stats.dc); +} +static int e1000_read_tx_single_coll(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + return e1000_read_ullong(page, start, off, count, eof, adapter->stats.scc); +} +static int e1000_read_tx_multi_coll(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + return e1000_read_ullong(page, start, off, count, eof, adapter->stats.mcc); +} +static int e1000_read_rx_oversize(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + return e1000_read_ullong(page, start, off, count, eof, adapter->stats.roc); +} +static int e1000_read_rx_undersize(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + return e1000_read_ullong(page, start, off, count, eof, adapter->stats.ruc); +} +static int e1000_read_rx_align_err(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + return e1000_read_ullong(page, start, off, count, eof, adapter->stats.algnerrc); +} +static int e1000_read_rx_xon(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + return e1000_read_ullong(page, start, off, count, eof, adapter->stats.xonrxc); +} +static int e1000_read_rx_xoff(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + return e1000_read_ullong(page, start, off, count, eof, adapter->stats.xoffrxc); +} +static int e1000_read_tx_xon(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + return e1000_read_ullong(page, start, off, count, eof, adapter->stats.xontxc); +} +static int e1000_read_tx_xoff(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + return e1000_read_ullong(page, start, off, count, eof, adapter->stats.xofftxc); +} + +static struct proc_dir_entry *e1000_create_proc_read(char *name, + struct e1000_adapter * adapter, + struct proc_dir_entry *parent, + read_proc_t * read_proc) +{ + struct proc_dir_entry *pdep; + + if (!(pdep = create_proc_entry(name, S_IFREG, parent))) + return NULL; + pdep->read_proc = read_proc; + pdep->data = adapter; + return pdep; +} + +static int e1000_read_cable_length (char *page, char **start, + off_t off, int count, int *eof, void *data) +{ + char *msg; + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + CABLE_LENGTH_TO_STRING(); + strncpy (page, msg, PAGE_SIZE); + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_media_type (char *page, char **start, + off_t off, int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + switch (adapter->shared.media_type) { + case e1000_media_type_copper: strncpy(page,"Copper", PAGE_SIZE); break; + case e1000_media_type_fiber: strncpy(page, "Fiber", PAGE_SIZE); break; + default: strncpy(page, "Unknown", PAGE_SIZE); + } + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_extended_10base_t_distance (char *page, char **start, + off_t off, int count, int *eof, void *data) +{ + char *msg; + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + EXTENDED_10BASE_T_DISTANCE_TO_STRING(); + strncpy (page, msg, PAGE_SIZE); + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_cable_polarity (char *page, char **start, + off_t off, int count, int *eof, void *data) +{ + char *msg; + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + CABLE_POLARITY_TO_STRING(); + strncpy (page, msg, PAGE_SIZE); + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_cable_polarity_correction (char *page, char **start, + off_t off, int count, int *eof, void *data) +{ + char *msg; + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + POLARITY_CORRECTION_TO_STRING(); + strncpy (page, msg, PAGE_SIZE); + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_idle_errors (char *page, char **start, + off_t off, int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + return e1000_read_ulong(page, start, off, count, eof, adapter->phy_stats.idle_errors); +} + +static int e1000_read_link_reset_enabled (char *page, char **start, + off_t off, int count, int *eof, void *data) +{ + char *msg; + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + LINK_RESET_TO_STRING(); + strncpy (page, msg, PAGE_SIZE); + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_receive_errors (char *page, char **start, + off_t off, int count, int *eof, void *data) +{ + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + return e1000_read_ulong(page, start, off, count, eof, adapter->phy_stats.receive_errors); +} + +static int e1000_read_mdi_x_enabled (char *page, char **start, + off_t off, int count, int *eof, void *data) +{ + char *msg; + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + MDI_X_MODE_TO_STRING(); + strncpy (page, msg, PAGE_SIZE); + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_local_receiver_status (char *page, char **start, + off_t off, int count, int *eof, void *data) +{ + char *msg; + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + LOCAL_RECEIVER_STATUS_TO_STRING(); + strncpy (page, msg, PAGE_SIZE); + return e1000_generic_read(page, start, off, count, eof); +} + +static int e1000_read_remote_receiver_status (char *page, char **start, + off_t off, int count, int *eof, void *data) +{ + char *msg; + struct e1000_adapter * adapter = (struct e1000_adapter *) data; + + /* If board is not open yet, */ + if(!test_bit(E1000_BOARD_OPEN, &adapter->flags)) + e1000_link_update(adapter); + + REMOTE_RECEIVER_STATUS_TO_STRING(); + strncpy (page, msg, PAGE_SIZE); + return e1000_generic_read(page, start, off, count, eof); +} + +int e1000_create_proc_dev(struct e1000_adapter * adapter) +{ + struct proc_dir_entry *dev_dir; + char info[256]; + int len; + + dev_dir = create_proc_entry(adapter->netdev->name, S_IFDIR, e1000_proc_dir); + + strncpy(info, adapter->netdev->name, sizeof(info)); + len = strlen(info); + strncat(info + len, ".info", sizeof(info) - len); + + /* info */ + if (!(e1000_create_proc_read(info, adapter, e1000_proc_dir, e1000_read_info))) + return -1; + + /* description */ + if (!(e1000_create_proc_read(DESCRIPTION_TAG, adapter, dev_dir, e1000_read_descr))) + return -1; + /* part number */ + if (!(e1000_create_proc_read(PART_NUMBER_TAG, adapter, dev_dir, e1000_read_partnum))) + return -1; + /* driver name */ + if (!(e1000_create_proc_read(DRVR_NAME_TAG, adapter, dev_dir, e1000_read_drvr_name))) + return -1; + /* driver version */ + if (!(e1000_create_proc_read(DRVR_VERSION_TAG, adapter, dev_dir, e1000_read_drvr_ver))) + return -1; + /* pci vendor */ + if (!(e1000_create_proc_read(PCI_VENDOR_TAG, adapter, dev_dir, e1000_read_pci_vendor))) + return -1; + /* pci device id */ + if (!(e1000_create_proc_read(PCI_DEVICE_ID_TAG, adapter, dev_dir, + e1000_read_pci_device))) return -1; + /* pci sub vendor */ + if (!(e1000_create_proc_read(PCI_SUBSYSTEM_VENDOR_TAG, adapter, dev_dir, + e1000_read_pci_sub_vendor))) return -1; + /* pci sub device id */ + if (!(e1000_create_proc_read(PCI_SUBSYSTEM_ID_TAG, adapter, dev_dir, + e1000_read_pci_sub_device))) return -1; + /* pci revision id */ + if (!(e1000_create_proc_read(PCI_REVISION_ID_TAG, adapter, dev_dir, + e1000_read_pci_revision))) return -1; + /* device name */ + if (!(e1000_create_proc_read(SYSTEM_DEVICE_NAME_TAG, adapter, dev_dir, + e1000_read_dev_name))) return -1; + /* pci bus */ + if (!(e1000_create_proc_read(PCI_BUS_TAG, adapter, dev_dir, e1000_read_pci_bus))) + return -1; + /* pci slot */ + if (!(e1000_create_proc_read(PCI_SLOT_TAG, adapter, dev_dir, e1000_read_pci_slot))) + return -1; + /* pci bus type */ + if (!(e1000_create_proc_read(PCI_BUS_TYPE_TAG, adapter, dev_dir, + e1000_read_pci_bus_type))) return -1; + /* pci bus speed */ + if (!(e1000_create_proc_read(PCI_BUS_SPEED_TAG, adapter, dev_dir, + e1000_read_pci_bus_speed))) return -1; + /* pci bus width */ + if (!(e1000_create_proc_read(PCI_BUS_WIDTH_TAG, adapter, dev_dir, + e1000_read_pci_bus_width))) return -1; + /* irq */ + if (!(e1000_create_proc_read(IRQ_TAG, adapter, dev_dir, e1000_read_irq))) + return -1; + /* current hwaddr */ + if (!(e1000_create_proc_read(CURRENT_HWADDR_TAG, adapter, dev_dir, + e1000_read_current_hwaddr))) return -1; + /* permanent hwaddr */ + if (!(e1000_create_proc_read(PERMANENT_HWADDR_TAG, adapter, dev_dir, + e1000_read_permanent_hwaddr))) return -1; + + /* link status */ + if (!(e1000_create_proc_read(LINK_TAG, adapter, dev_dir, e1000_read_link_status))) + return -1; + /* speed */ + if (!(e1000_create_proc_read(SPEED_TAG, adapter, dev_dir, e1000_read_speed))) + return -1; + /* duplex mode */ + if (!(e1000_create_proc_read(DUPLEX_TAG, adapter, dev_dir, e1000_read_dplx_mode))) + return -1; + /* state */ + if (!(e1000_create_proc_read(STATE_TAG, adapter, dev_dir, e1000_read_state))) + return -1; + /* rx packets */ + if (!(e1000_create_proc_read(RX_PACKETS_TAG, adapter, dev_dir, e1000_read_rx_packets))) + return -1; + /* tx packets */ + if (!(e1000_create_proc_read(TX_PACKETS_TAG, adapter, dev_dir, e1000_read_tx_packets))) + return -1; + /* rx bytes */ + if (!(e1000_create_proc_read(RX_BYTES_TAG, adapter, dev_dir, e1000_read_rx_bytes))) + return -1; + /* tx bytes */ + if (!(e1000_create_proc_read(TX_BYTES_TAG, adapter, dev_dir, e1000_read_tx_bytes))) + return -1; + /* rx errors */ + if (!(e1000_create_proc_read(RX_ERRORS_TAG, adapter, dev_dir, e1000_read_rx_errors))) + return -1; + /* tx errors */ + if (!(e1000_create_proc_read(TX_ERRORS_TAG, adapter, dev_dir, e1000_read_tx_errors))) + return -1; + /* rx dropped */ + if (!(e1000_create_proc_read(RX_DROPPED_TAG, adapter, dev_dir, e1000_read_rx_dropped))) + return -1; + /* tx dropped */ + if (!(e1000_create_proc_read(TX_DROPPED_TAG, adapter, dev_dir, e1000_read_tx_dropped))) + return -1; + /* multicast packets */ + if (!(e1000_create_proc_read(MULTICAST_TAG, adapter, dev_dir, + e1000_read_rx_multicast_packets))) + return -1; + + /* collisions */ + if (!(e1000_create_proc_read (COLLISIONS_TAG, adapter, dev_dir, e1000_read_collisions))) + return -1; + + /* rx length errors */ + if (!(e1000_create_proc_read(RX_LENGTH_ERRORS_TAG, adapter, dev_dir, + e1000_read_rx_length_errors))) return -1; + /* rx over errors */ + if (!(e1000_create_proc_read(RX_OVER_ERRORS_TAG, adapter, dev_dir, + e1000_read_rx_over_errors))) return -1; + /* rx crc errors */ + if (!(e1000_create_proc_read(RX_CRC_ERRORS_TAG, adapter, dev_dir, + e1000_read_rx_crc_errors))) return -1; + /* rx frame errors */ + if (!(e1000_create_proc_read(RX_FRAME_ERRORS_TAG, adapter, dev_dir, + e1000_read_rx_frame_errors))) return -1; + /* rx fifo errors */ + if (!(e1000_create_proc_read(RX_FIFO_ERRORS_TAG, adapter, dev_dir, + e1000_read_rx_fifo_errors))) return -1; + /* rx missed errors */ + if (!(e1000_create_proc_read(RX_MISSED_ERRORS_TAG, adapter, dev_dir, + e1000_read_rx_missed_errors))) return -1; + /* tx aborted errors */ + if (!(e1000_create_proc_read(TX_ABORTED_ERRORS_TAG, adapter, dev_dir, + e1000_read_tx_aborted_errors))) return -1; + /* tx carrier errors */ + if (!(e1000_create_proc_read(TX_CARRIER_ERRORS_TAG, adapter, dev_dir, + e1000_read_tx_carrier_errors))) return -1; + /* tx fifo errors */ + if (!(e1000_create_proc_read(TX_FIFO_ERRORS_TAG, adapter, dev_dir, + e1000_read_tx_fifo_errors))) return -1; + /* tx heartbeat errors */ + if (!(e1000_create_proc_read(TX_HEARTBEAT_ERRORS_TAG, adapter, dev_dir, + e1000_read_tx_heartbeat_errors))) return -1; + /* tx window errors */ + if (!(e1000_create_proc_read(TX_WINDOW_ERRORS_TAG, adapter, dev_dir, + e1000_read_tx_window_errors))) return -1; + + if (!(e1000_create_proc_read(TX_LATE_COLL_TAG, adapter, dev_dir, + e1000_read_tx_late_coll))) return -1; + if (!(e1000_create_proc_read(TX_DEFERRED_TAG, adapter, dev_dir, + e1000_read_tx_defer_events))) return -1; + if (!(e1000_create_proc_read(TX_SINGLE_COLL_TAG, adapter, dev_dir, + e1000_read_tx_single_coll))) return -1; + if (!(e1000_create_proc_read(TX_MULTI_COLL_TAG, adapter, dev_dir, + e1000_read_tx_multi_coll))) return -1; + if (!(e1000_create_proc_read(RX_LONG_ERRORS_TAG, adapter, dev_dir, + e1000_read_rx_oversize))) return -1; + if (!(e1000_create_proc_read(RX_SHORT_ERRORS_TAG, adapter, dev_dir, + e1000_read_rx_undersize))) return -1; + if(adapter->shared.mac_type >= e1000_82543) + if (!(e1000_create_proc_read(RX_ALIGN_ERRORS_TAG, adapter, dev_dir, + e1000_read_rx_align_err))) return -1; + if (!(e1000_create_proc_read(RX_XON_TAG, adapter, dev_dir, + e1000_read_rx_xon))) return -1; + if (!(e1000_create_proc_read(RX_XOFF_TAG, adapter, dev_dir, + e1000_read_rx_xoff))) return -1; + if (!(e1000_create_proc_read(TX_XON_TAG, adapter, dev_dir, + e1000_read_tx_xon))) return -1; + if (!(e1000_create_proc_read(TX_XOFF_TAG, adapter, dev_dir, + e1000_read_tx_xoff))) return -1; + + if (!(e1000_create_proc_read(MEDIA_TYPE_TAG, adapter, dev_dir, + e1000_read_media_type))) return -1; + + if (adapter->shared.media_type == e1000_media_type_copper) { + if (!(e1000_create_proc_read(CABLE_LENGTH_TAG, adapter, dev_dir, + e1000_read_cable_length))) return -1; + + if (!(e1000_create_proc_read(EXTENDED_10BASE_T_DISTANCE_TAG, + adapter, dev_dir, + e1000_read_extended_10base_t_distance))) return -1; + + if (!(e1000_create_proc_read(CABLE_POLARITY_TAG, adapter, dev_dir, + e1000_read_cable_polarity))) return -1; + + if (!(e1000_create_proc_read(CABLE_POLARITY_CORRECTION_TAG, adapter, dev_dir, + e1000_read_cable_polarity_correction))) return -1; + + if (!(e1000_create_proc_read(IDLE_ERRORS_TAG, adapter, dev_dir, + e1000_read_idle_errors))) return -1; + + if (!(e1000_create_proc_read(LINK_RESET_ENABLED_TAG, adapter, dev_dir, + e1000_read_link_reset_enabled))) return -1; + + if (!(e1000_create_proc_read(RECEIVE_ERRORS_TAG, adapter, dev_dir, + e1000_read_receive_errors))) return -1; + + if (!(e1000_create_proc_read(MDI_X_ENABLED_TAG, adapter, dev_dir, + e1000_read_mdi_x_enabled))) return -1; + + if (!(e1000_create_proc_read(LOCAL_RECEIVER_STATUS_TAG, adapter, dev_dir, + e1000_read_local_receiver_status))) return -1; + + if (!(e1000_create_proc_read(REMOTE_RECEIVER_STATUS_TAG, adapter, dev_dir, + e1000_read_remote_receiver_status))) return -1; + } + + return 0; +} + +void e1000_remove_proc_dev(struct net_device *dev) +{ + struct proc_dir_entry *de; + struct e1000_adapter * adapter = dev->priv; + char info[256]; + int len; + + len = strlen(dev->name); + strncpy(info, dev->name, sizeof(info)); + strncat(info + len, ".info", sizeof(info) - len); + + for (de = e1000_proc_dir->subdir; de; de = de->next) { + if ((de->namelen == len) && (!memcmp(de->name, dev->name, len))) + break; + } + if (de) { + remove_proc_entry(DESCRIPTION_TAG, de); + remove_proc_entry(PART_NUMBER_TAG, de); + remove_proc_entry(DRVR_NAME_TAG, de); + remove_proc_entry(DRVR_VERSION_TAG, de); + remove_proc_entry(PCI_VENDOR_TAG, de); + remove_proc_entry(PCI_DEVICE_ID_TAG, de); + remove_proc_entry(PCI_SUBSYSTEM_VENDOR_TAG, de); + remove_proc_entry(PCI_SUBSYSTEM_ID_TAG, de); + remove_proc_entry(PCI_REVISION_ID_TAG, de); + remove_proc_entry(SYSTEM_DEVICE_NAME_TAG, de); + remove_proc_entry(PCI_BUS_TAG, de); + remove_proc_entry(PCI_SLOT_TAG, de); + remove_proc_entry(PCI_BUS_TYPE_TAG, de); + remove_proc_entry(PCI_BUS_SPEED_TAG, de); + remove_proc_entry(PCI_BUS_WIDTH_TAG, de); + remove_proc_entry(IRQ_TAG, de); + remove_proc_entry(CURRENT_HWADDR_TAG, de); + remove_proc_entry(PERMANENT_HWADDR_TAG, de); + + remove_proc_entry(LINK_TAG, de); + remove_proc_entry(SPEED_TAG, de); + remove_proc_entry(DUPLEX_TAG, de); + remove_proc_entry(STATE_TAG, de); + + remove_proc_entry(RX_PACKETS_TAG, de); + remove_proc_entry(TX_PACKETS_TAG, de); + remove_proc_entry(RX_BYTES_TAG, de); + remove_proc_entry(TX_BYTES_TAG, de); + remove_proc_entry(RX_ERRORS_TAG, de); + remove_proc_entry(TX_ERRORS_TAG, de); + remove_proc_entry(RX_DROPPED_TAG, de); + remove_proc_entry(TX_DROPPED_TAG, de); + remove_proc_entry(MULTICAST_TAG, de); + remove_proc_entry(COLLISIONS_TAG, de); + remove_proc_entry(RX_LENGTH_ERRORS_TAG, de); + remove_proc_entry(RX_OVER_ERRORS_TAG, de); + remove_proc_entry(RX_CRC_ERRORS_TAG, de); + remove_proc_entry(RX_FRAME_ERRORS_TAG, de); + remove_proc_entry(RX_FIFO_ERRORS_TAG, de); + remove_proc_entry(RX_MISSED_ERRORS_TAG, de); + remove_proc_entry(TX_ABORTED_ERRORS_TAG, de); + remove_proc_entry(TX_CARRIER_ERRORS_TAG, de); + remove_proc_entry(TX_FIFO_ERRORS_TAG, de); + remove_proc_entry(TX_HEARTBEAT_ERRORS_TAG, de); + remove_proc_entry(TX_WINDOW_ERRORS_TAG, de); + remove_proc_entry(TX_LATE_COLL_TAG, de); + remove_proc_entry(TX_DEFERRED_TAG, de); + remove_proc_entry(TX_SINGLE_COLL_TAG, de); + remove_proc_entry(TX_MULTI_COLL_TAG, de); + remove_proc_entry(RX_LONG_ERRORS_TAG, de); + remove_proc_entry(RX_SHORT_ERRORS_TAG, de); + remove_proc_entry(RX_XON_TAG, de); + remove_proc_entry(RX_XOFF_TAG, de); + remove_proc_entry(TX_XON_TAG, de); + remove_proc_entry(TX_XOFF_TAG, de); + + remove_proc_entry(MEDIA_TYPE_TAG, de); + if (adapter->shared.media_type == e1000_media_type_copper) { + remove_proc_entry(CABLE_LENGTH_TAG, de); + remove_proc_entry(EXTENDED_10BASE_T_DISTANCE_TAG, de); + remove_proc_entry(CABLE_POLARITY_TAG, de); + remove_proc_entry(CABLE_POLARITY_CORRECTION_TAG, de); + remove_proc_entry(IDLE_ERRORS_TAG, de); + remove_proc_entry(LINK_RESET_ENABLED_TAG, de); + remove_proc_entry(RECEIVE_ERRORS_TAG, de); + remove_proc_entry(MDI_X_ENABLED_TAG, de); + remove_proc_entry(LOCAL_RECEIVER_STATUS_TAG, de); + remove_proc_entry(REMOTE_RECEIVER_STATUS_TAG, de); + } + } + + remove_proc_entry(info, e1000_proc_dir); + remove_proc_entry(dev->name, e1000_proc_dir); +} diff -urN linux-2.4.18/drivers/net/e1000/e1000_proc.h lia64-2.4/drivers/net/e1000/e1000_proc.h --- linux-2.4.18/drivers/net/e1000/e1000_proc.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/e1000/e1000_proc.h Fri Jul 19 18:51:03 2002 @@ -0,0 +1,181 @@ +/******************************************************************************* + + This software program is available to you under a choice of one of two + licenses. You may choose to be licensed under either the GNU General Public + License (GPL) Version 2, June 1991, available at + http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the + text of which follows: + + Recipient has requested a license and Intel Corporation ("Intel") is willing + to grant a license for the software entitled Linux Base Driver for the + Intel(R) PRO/1000 Family of Adapters (e1000) (the "Software") being provided + by Intel Corporation. The following definitions apply to this license: + + "Licensed Patents" means patent claims licensable by Intel Corporation which + are necessarily infringed by the use of sale of the Software alone or when + combined with the operating system referred to below. + + "Recipient" means the party to whom Intel delivers this Software. + + "Licensee" means Recipient and those third parties that receive a license to + any operating system available under the GNU Public License version 2.0 or + later. + + Copyright (c) 1999 - 2002 Intel Corporation. + All rights reserved. + + The license is provided to Recipient and Recipient's Licensees under the + following terms. + + Redistribution and use in source and binary forms of the Software, with or + without modification, are permitted provided that the following conditions + are met: + + Redistributions of source code of the Software may retain the above + copyright notice, this list of conditions and the following disclaimer. + + Redistributions in binary form of the Software may reproduce the above + copyright notice, this list of conditions and the following disclaimer in + the documentation and/or materials provided with the distribution. + + Neither the name of Intel Corporation nor the names of its contributors + shall be used to endorse or promote products derived from this Software + without specific prior written permission. + + Intel hereby grants Recipient and Licensees a non-exclusive, worldwide, + royalty-free patent license under Licensed Patents to make, use, sell, offer + to sell, import and otherwise transfer the Software, if any, in source code + and object code form. This license shall include changes to the Software + that are error corrections or other minor changes to the Software that do + not add functionality or features when the Software is incorporated in any + version of an operating system that has been distributed under the GNU + General Public License 2.0 or later. This patent license shall apply to the + combination of the Software and any operating system licensed under the GNU + Public License version 2.0 or later if, at the time Intel provides the + Software to Recipient, such addition of the Software to the then publicly + available versions of such operating systems available under the GNU Public + License version 2.0 or later (whether in gold, beta or alpha form) causes + such combination to be covered by the Licensed Patents. The patent license + shall not apply to any other combinations which include the Software. NO + hardware per se is licensed hereunder. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR IT CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + ANY LOSS OF USE; DATA, OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*******************************************************************************/ + +/* /proc definitions */ +#include + +#define ADAPTERS_PROC_DIR "PRO_LAN_Adapters" + +#define DESCRIPTION_TAG "Description" +#define PART_NUMBER_TAG "Part_Number" +#define DRVR_NAME_TAG "Driver_Name" +#define DRVR_VERSION_TAG "Driver_Version" +#define PCI_VENDOR_TAG "PCI_Vendor" +#define PCI_DEVICE_ID_TAG "PCI_Device_ID" +#define PCI_SUBSYSTEM_VENDOR_TAG "PCI_Subsystem_Vendor" +#define PCI_SUBSYSTEM_ID_TAG "PCI_Subsystem_ID" +#define PCI_REVISION_ID_TAG "PCI_Revision_ID" +#define PCI_BUS_TAG "PCI_Bus" +#define PCI_SLOT_TAG "PCI_Slot" +#define PCI_BUS_TYPE_TAG "PCI_Bus_Type" +#define PCI_BUS_SPEED_TAG "PCI_Bus_Speed" +#define PCI_BUS_WIDTH_TAG "PCI_Bus_Width" +#define IRQ_TAG "IRQ" +#define SYSTEM_DEVICE_NAME_TAG "System_Device_Name" +#define CURRENT_HWADDR_TAG "Current_HWaddr" +#define PERMANENT_HWADDR_TAG "Permanent_HWaddr" + +#define LINK_TAG "Link" +#define SPEED_TAG "Speed" +#define DUPLEX_TAG "Duplex" +#define STATE_TAG "State" + +#define RX_PACKETS_TAG "Rx_Packets" +#define TX_PACKETS_TAG "Tx_Packets" +#define RX_BYTES_TAG "Rx_Bytes" +#define TX_BYTES_TAG "Tx_Bytes" +#define RX_ERRORS_TAG "Rx_Errors" +#define TX_ERRORS_TAG "Tx_Errors" +#define RX_DROPPED_TAG "Rx_Dropped" +#define TX_DROPPED_TAG "Tx_Dropped" +#define MULTICAST_TAG "Multicast" +#define COLLISIONS_TAG "Collisions" +#define RX_LENGTH_ERRORS_TAG "Rx_Length_Errors" +#define RX_OVER_ERRORS_TAG "Rx_Over_Errors" +#define RX_CRC_ERRORS_TAG "Rx_CRC_Errors" +#define RX_FRAME_ERRORS_TAG "Rx_Frame_Errors" +#define RX_FIFO_ERRORS_TAG "Rx_FIFO_Errors" +#define RX_MISSED_ERRORS_TAG "Rx_Missed_Errors" +#define TX_ABORTED_ERRORS_TAG "Tx_Aborted_Errors" +#define TX_CARRIER_ERRORS_TAG "Tx_Carrier_Errors" +#define TX_FIFO_ERRORS_TAG "Tx_FIFO_Errors" +#define TX_HEARTBEAT_ERRORS_TAG "Tx_Heartbeat_Errors" +#define TX_WINDOW_ERRORS_TAG "Tx_Window_Errors" + +#define RX_TCP_CHECKSUM_GOOD_TAG "Rx_TCP_Checksum_Good" +#define RX_TCP_CHECKSUM_BAD_TAG "Rx_TCP_Checksum_Bad" +#define TX_TCP_CHECKSUM_GOOD_TAG "Tx_TCP_Checksum_Good" +#define TX_TCP_CHECKSUM_BAD_TAG "Tx_TCP_Checksum_Bad" + +#define TX_LATE_COLL_TAG "Tx_Abort_Late_Coll" +#define TX_DEFERRED_TAG "Tx_Deferred_Ok" +#define TX_SINGLE_COLL_TAG "Tx_Single_Coll_Ok" +#define TX_MULTI_COLL_TAG "Tx_Multi_Coll_Ok" +#define RX_LONG_ERRORS_TAG "Rx_Long_Length_Errors" +#define RX_SHORT_ERRORS_TAG "Rx_Short_Length_Errors" +#define RX_ALIGN_ERRORS_TAG "Rx_Align_Errors" +#define RX_XON_TAG "Rx_Flow_Control_XON" +#define RX_XOFF_TAG "Rx_Flow_Control_XOFF" +#define TX_XON_TAG "Tx_Flow_Control_XON" +#define TX_XOFF_TAG "Tx_Flow_Control_XOFF" +#define RX_CSUM_GOOD_TAG "Rx_Csum_Offload_Good" +#define RX_CSUM_ERROR_TAG "Rx_Csum_Offload_Errors" + +/* what is the cable length (only for 100/1000 modes)? - 50, 50-80, 80-110, 110-140 and > 140 meters */ +#define CABLE_LENGTH_TAG "PHY_Cable_Length" + +/* Media Type Copper/Fiber */ +#define MEDIA_TYPE_TAG "PHY_Media_Type" + +/* Is extended 10 Base-T distance feature enabled? This is done by lowering the receive threshold - enabled/disabled */ +#define EXTENDED_10BASE_T_DISTANCE_TAG "PHY_Extended_10Base_T_Distance" + +/* Cable polarity Normal/Reversed */ +#define CABLE_POLARITY_TAG "PHY_Cable_Polarity" + +/* Is Polarity reversal enabled? Enabled/Disabled */ +#define CABLE_POLARITY_CORRECTION_TAG "PHY_Disable_Polarity_Correction" + +/* Number of IDLE Errors */ +#define IDLE_ERRORS_TAG "PHY_Idle_Errors" + +/* Should the link be brought down if an IDLE is not seen within 1 msec while in 1000mbps mode? Enabled/Disabled */ +#define LINK_RESET_ENABLED_TAG "PHY_Link_Reset_Enabled" + +/* Number of receive errors */ +#define RECEIVE_ERRORS_TAG "PHY_Receive_Errors" + +/* MDI-X Support Enabled? Auto, Manual(MDI) or Manual(MDI-X) */ +#define MDI_X_ENABLED_TAG "PHY_MDI_X_Enabled" + +/* Local Receiver OK? OK/NOT_OK */ +#define LOCAL_RECEIVER_STATUS_TAG "PHY_Local_Receiver_Status" + +/* Remote Receiver OK? OK/NOT_OK */ +#define REMOTE_RECEIVER_STATUS_TAG "PHY_Remote_Receiver_Status" + +/* symbols exported to e1000_main */ +extern struct proc_dir_entry *e1000_proc_dir; +extern int e1000_create_proc_dev(struct e1000_adapter * Adapter); +extern void e1000_remove_proc_dev(struct net_device *dev); diff -urN linux-2.4.18/drivers/net/eepro100.c lia64-2.4/drivers/net/eepro100.c --- linux-2.4.18/drivers/net/eepro100.c Tue Feb 26 11:04:20 2002 +++ lia64-2.4/drivers/net/eepro100.c Mon Jul 22 18:10:40 2002 @@ -25,6 +25,8 @@ Disabled FC and ER, to avoid lockups when when we get FCP interrupts. 2000 Jul 17 Goutham Rao PCI DMA API fixes, adding pci_dma_sync_single calls where neccesary + 2000 Aug 31 David Mosberger + RX_ALIGN support: enables rx DMA without causing unaligned accesses. */ static const char *version = @@ -41,14 +43,18 @@ static int txdmacount = 128; static int rxdmacount /* = 0 */; +#if defined(__ia64__) || defined(__alpha__) || defined(__sparc__) || defined(__mips__) || \ + defined(__arm__) + /* align rx buffers to 2 bytes so that IP header is aligned */ +# define RX_ALIGN +# define RxFD_ALIGNMENT __attribute__ ((aligned (2), packed)) +#else +# define RxFD_ALIGNMENT +#endif + /* Set the copy breakpoint for the copy-only-tiny-buffer Rx method. Lower values use more memory, but are faster. */ -#if defined(__alpha__) || defined(__sparc__) || defined(__mips__) || \ - defined(__arm__) -static int rx_copybreak = 1518; -#else static int rx_copybreak = 200; -#endif /* Maximum events (Rx packets, etc.) to handle at each interrupt. */ static int max_interrupt_work = 20; @@ -378,18 +384,18 @@ /* The Speedo3 Rx and Tx frame/buffer descriptors. */ struct descriptor { /* A generic descriptor. */ - s32 cmd_status; /* All command and status fields. */ + volatile s32 cmd_status; /* All command and status fields. */ u32 link; /* struct descriptor * */ unsigned char params[0]; }; /* The Speedo3 Rx and Tx buffer descriptors. */ struct RxFD { /* Receive frame descriptor. */ - s32 status; + volatile s32 status; u32 link; /* struct RxFD * */ u32 rx_buf_addr; /* void * */ u32 count; -}; +} RxFD_ALIGNMENT; /* Selected elements of the Tx/RxFD.status word. */ enum RxFD_bits { @@ -1074,6 +1080,50 @@ outw(CUStart | SCBMaskEarlyRx | SCBMaskFlowCtl, ioaddr + SCBCmd); } +/* + * Sometimes the receiver stops making progress. This routine knows how to + * get it going again, without losing packets or being otherwise nasty like + * a chip reset would be. Previously the driver had a whole sequence + * of if RxSuspended, if it's no buffers do one thing, if it's no resources, + * do another, etc. But those things don't really matter. Separate logic + * in the ISR provides for allocating buffers--the other half of operation + * is just making sure the receiver is active. speedo_rx_soft_reset does that. + * This problem with the old, more involved algorithm is shown up under + * ping floods on the order of 60K packets/second on a 100Mbps fdx network. + */ +static void +speedo_rx_soft_reset(struct net_device *dev) +{ + struct speedo_private *sp = dev->priv; + struct RxFD *rfd; + long ioaddr; + + ioaddr = dev->base_addr; + wait_for_cmd_done(ioaddr + SCBCmd); + if (inb(ioaddr + SCBCmd) != 0) { + printk("%s: previous command stalled\n", dev->name); + return; + } + /* + * Put the hardware into a known state. + */ + outb(RxAbort, ioaddr + SCBCmd); + + rfd = sp->rx_ringp[sp->cur_rx % RX_RING_SIZE]; + + rfd->rx_buf_addr = 0xffffffff; + + wait_for_cmd_done(ioaddr + SCBCmd); + + if (inb(ioaddr + SCBCmd) != 0) { + printk("%s: RxAbort command stalled\n", dev->name); + return; + } + outl(sp->rx_ring_dma[sp->cur_rx % RX_RING_SIZE], + ioaddr + SCBPointer); + outb(RxStart, ioaddr + SCBCmd); +} + /* Media monitoring and control. */ static void speedo_timer(unsigned long data) { @@ -1187,6 +1237,9 @@ for (i = 0; i < RX_RING_SIZE; i++) { struct sk_buff *skb; skb = dev_alloc_skb(PKT_BUF_SZ + sizeof(struct RxFD)); +#ifdef RX_ALIGN + skb_reserve(skb, 2); /* Align IP on 16 byte boundary */ +#endif sp->rx_skbuff[i] = skb; if (skb == NULL) break; /* OK. Just initially short of Rx bufs. */ @@ -1507,82 +1560,37 @@ if ((status & 0xfc00) == 0) break; - /* Always check if all rx buffers are allocated. --SAW */ - speedo_refill_rx_buffers(dev, 0); - if ((status & 0x5000) || /* Packet received, or Rx error. */ (sp->rx_ring_state&(RrNoMem|RrPostponed)) == RrPostponed) /* Need to gather the postponed packet. */ speedo_rx(dev); - if (status & 0x1000) { - spin_lock(&sp->lock); - if ((status & 0x003c) == 0x0028) { /* No more Rx buffers. */ - struct RxFD *rxf; - printk(KERN_WARNING "%s: card reports no RX buffers.\n", - dev->name); - rxf = sp->rx_ringp[sp->cur_rx % RX_RING_SIZE]; - if (rxf == NULL) { - if (speedo_debug > 2) - printk(KERN_DEBUG - "%s: NULL cur_rx in speedo_interrupt().\n", - dev->name); - sp->rx_ring_state |= RrNoMem|RrNoResources; - } else if (rxf == sp->last_rxf) { - if (speedo_debug > 2) - printk(KERN_DEBUG - "%s: cur_rx is last in speedo_interrupt().\n", - dev->name); - sp->rx_ring_state |= RrNoMem|RrNoResources; - } else - outb(RxResumeNoResources, ioaddr + SCBCmd); - } else if ((status & 0x003c) == 0x0008) { /* No resources. */ - struct RxFD *rxf; - printk(KERN_WARNING "%s: card reports no resources.\n", - dev->name); - rxf = sp->rx_ringp[sp->cur_rx % RX_RING_SIZE]; - if (rxf == NULL) { - if (speedo_debug > 2) - printk(KERN_DEBUG - "%s: NULL cur_rx in speedo_interrupt().\n", - dev->name); - sp->rx_ring_state |= RrNoMem|RrNoResources; - } else if (rxf == sp->last_rxf) { - if (speedo_debug > 2) - printk(KERN_DEBUG - "%s: cur_rx is last in speedo_interrupt().\n", - dev->name); - sp->rx_ring_state |= RrNoMem|RrNoResources; - } else { - /* Restart the receiver. */ - outl(sp->rx_ring_dma[sp->cur_rx % RX_RING_SIZE], - ioaddr + SCBPointer); - outb(RxStart, ioaddr + SCBCmd); - } - } - sp->stats.rx_errors++; - spin_unlock(&sp->lock); - } + /* Always check if all rx buffers are allocated. --SAW */ + speedo_refill_rx_buffers(dev, 0); - if ((sp->rx_ring_state&(RrNoMem|RrNoResources)) == RrNoResources) { - printk(KERN_WARNING - "%s: restart the receiver after a possible hang.\n", - dev->name); - spin_lock(&sp->lock); - /* Restart the receiver. - I'm not sure if it's always right to restart the receiver - here but I don't know another way to prevent receiver hangs. - 1999/12/25 SAW */ - outl(sp->rx_ring_dma[sp->cur_rx % RX_RING_SIZE], - ioaddr + SCBPointer); - outb(RxStart, ioaddr + SCBCmd); - sp->rx_ring_state &= ~RrNoResources; - spin_unlock(&sp->lock); + spin_lock(&sp->lock); + /* + * The chip may have suspended reception for various reasons. + * Check for that, and re-prime it should this be the case. + */ + switch ((status >> 2) & 0xf) { + case 0: /* Idle */ + break; + case 1: /* Suspended */ + case 2: /* No resources (RxFDs) */ + case 9: /* Suspended with no more RBDs */ + case 10: /* No resources due to no RBDs */ + case 12: /* Ready with no RBDs */ + speedo_rx_soft_reset(dev); + break; + case 3: case 5: case 6: case 7: case 8: + case 11: case 13: case 14: case 15: + /* these are all reserved values */ + break; } /* User interrupt, Command/Tx unit interrupt or CU not active. */ if (status & 0xA400) { - spin_lock(&sp->lock); speedo_tx_buffer_gc(dev); if (sp->tx_full && (int)(sp->cur_tx - sp->dirty_tx) < TX_QUEUE_UNFULL) { @@ -1590,8 +1598,8 @@ sp->tx_full = 0; netif_wake_queue(dev); /* Attention: under a spinlock. --SAW */ } - spin_unlock(&sp->lock); } + spin_unlock(&sp->lock); if (--boguscnt < 0) { printk(KERN_ERR "%s: Too much work at interrupt, status=0x%4.4x.\n", @@ -1619,6 +1627,9 @@ struct sk_buff *skb; /* Get a fresh skbuff to replace the consumed one. */ skb = dev_alloc_skb(PKT_BUF_SZ + sizeof(struct RxFD)); +#ifdef RX_ALIGN + skb_reserve(skb, 2); /* Align IP on 16 byte boundary */ +#endif sp->rx_skbuff[entry] = skb; if (skb == NULL) { sp->rx_ringp[entry] = NULL; @@ -1709,6 +1720,7 @@ int entry = sp->cur_rx % RX_RING_SIZE; int rx_work_limit = sp->dirty_rx + RX_RING_SIZE - sp->cur_rx; int alloc_ok = 1; + int npkts = 0; if (speedo_debug > 4) printk(KERN_DEBUG " In speedo_rx().\n"); @@ -1775,6 +1787,7 @@ memcpy(skb_put(skb, pkt_len), sp->rx_skbuff[entry]->tail, pkt_len); #endif + npkts++; } else { /* Pass up the already-filled skbuff. */ skb = sp->rx_skbuff[entry]; @@ -1785,6 +1798,7 @@ } sp->rx_skbuff[entry] = NULL; skb_put(skb, pkt_len); + npkts++; sp->rx_ringp[entry] = NULL; pci_unmap_single(sp->pdev, sp->rx_ring_dma[entry], PKT_BUF_SZ + sizeof(struct RxFD), PCI_DMA_FROMDEVICE); @@ -1805,7 +1819,8 @@ /* Try hard to refill the recently taken buffers. */ speedo_refill_rx_buffers(dev, 1); - sp->last_rx_time = jiffies; + if (npkts) + sp->last_rx_time = jiffies; return 0; } diff -urN linux-2.4.18/drivers/net/simeth.c lia64-2.4/drivers/net/simeth.c --- linux-2.4.18/drivers/net/simeth.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/simeth.c Fri Dec 14 14:36:09 2001 @@ -0,0 +1,533 @@ +/* + * Simulated Ethernet Driver + * + * Copyright (C) 1999-2001 Hewlett-Packard Co + * Copyright (C) 1999-2001 Stephane Eranain + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SIMETH_RECV_MAX 10 + +/* + * Maximum possible received frame for Ethernet. + * We preallocate an sk_buff of that size to avoid costly + * memcpy for temporary buffer into sk_buff. We do basically + * what's done in other drivers, like eepro with a ring. + * The difference is, of course, that we don't have real DMA !!! + */ +#define SIMETH_FRAME_SIZE ETH_FRAME_LEN + + +#define SSC_NETDEV_PROBE 100 +#define SSC_NETDEV_SEND 101 +#define SSC_NETDEV_RECV 102 +#define SSC_NETDEV_ATTACH 103 +#define SSC_NETDEV_DETACH 104 + +#define NETWORK_INTR 8 + +struct simeth_local { + struct net_device_stats stats; + int simfd; /* descriptor in the simulator */ +}; + +static int simeth_probe1(void); +static int simeth_open(struct net_device *dev); +static int simeth_close(struct net_device *dev); +static int simeth_tx(struct sk_buff *skb, struct net_device *dev); +static int simeth_rx(struct net_device *dev); +static struct net_device_stats *simeth_get_stats(struct net_device *dev); +static void simeth_interrupt(int irq, void *dev_id, struct pt_regs * regs); +static void set_multicast_list(struct net_device *dev); +static int simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr); + +static char *simeth_version="0.3"; + +/* + * This variable is used to establish a mapping between the Linux/ia64 kernel + * and the host linux kernel. + * + * As of today, we support only one card, even though most of the code + * is ready for many more. The mapping is then: + * linux/ia64 -> linux/x86 + * eth0 -> eth1 + * + * In the future, we some string operations, we could easily support up + * to 10 cards (0-9). + * + * The default mapping can be changed on the kernel command line by + * specifying simeth=ethX (or whatever string you want). + */ +static char *simeth_device="eth0"; /* default host interface to use */ + + + +static volatile unsigned int card_count; /* how many cards "found" so far */ +static int simeth_debug; /* set to 1 to get debug information */ + +/* + * Used to catch IFF_UP & IFF_DOWN events + */ +static struct notifier_block simeth_dev_notifier = { + simeth_device_event, + 0 +}; + + +/* + * Function used when using a kernel command line option. + * + * Format: simeth=interface_name (like eth0) + */ +static int __init +simeth_setup(char *str) +{ + simeth_device = str; + return 1; +} + +__setup("simeth=", simeth_setup); + +/* + * Function used to probe for simeth devices when not installed + * as a loadable module + */ + +int __init +simeth_probe (void) +{ + int r; + + printk("simeth: v%s\n", simeth_version); + + r = simeth_probe1(); + + if (r == 0) register_netdevice_notifier(&simeth_dev_notifier); + + return r; +} + +extern long ia64_ssc (long, long, long, long, int); +extern void ia64_ssc_connect_irq (long intr, long irq); + +static inline int +netdev_probe(char *name, unsigned char *ether) +{ + return ia64_ssc(__pa(name), __pa(ether), 0,0, SSC_NETDEV_PROBE); +} + + +static inline int +netdev_connect(int irq) +{ + /* XXX Fix me + * this does not support multiple cards + * also no return value + */ + ia64_ssc_connect_irq(NETWORK_INTR, irq); + return 0; +} + +static inline int +netdev_attach(int fd, int irq, unsigned int ipaddr) +{ + /* this puts the host interface in the right mode (start interupting) */ + return ia64_ssc(fd, ipaddr, 0,0, SSC_NETDEV_ATTACH); +} + + +static inline int +netdev_detach(int fd) +{ + /* + * inactivate the host interface (don't interrupt anymore) */ + return ia64_ssc(fd, 0,0,0, SSC_NETDEV_DETACH); +} + +static inline int +netdev_send(int fd, unsigned char *buf, unsigned int len) +{ + return ia64_ssc(fd, __pa(buf), len, 0, SSC_NETDEV_SEND); +} + +static inline int +netdev_read(int fd, unsigned char *buf, unsigned int len) +{ + return ia64_ssc(fd, __pa(buf), len, 0, SSC_NETDEV_RECV); +} + +/* + * Function shared with module code, so cannot be in init section + * + * So far this function "detects" only one card (test_&_set) but could + * be extended easily. + * + * Return: + * - -ENODEV is no device found + * - -ENOMEM is no more memory + * - 0 otherwise + */ +static int +simeth_probe1(void) +{ + unsigned char mac_addr[ETH_ALEN]; + struct simeth_local *local; + struct net_device *dev; + int fd, i; + + /* + * XXX Fix me + * let's support just one card for now + */ + if (test_and_set_bit(0, &card_count)) + return -ENODEV; + + /* + * check with the simulator for the device + */ + fd = netdev_probe(simeth_device, mac_addr); + if (fd == -1) + return -ENODEV; + + dev = init_etherdev(NULL, sizeof(struct simeth_local)); + if (!dev) + return -ENOMEM; + + memcpy(dev->dev_addr, mac_addr, sizeof(mac_addr)); + + dev->irq = ia64_alloc_irq(); + + /* + * attach the interrupt in the simulator, this does enable interrupts + * until a netdev_attach() is called + */ + netdev_connect(dev->irq); + + memset(dev->priv, 0, sizeof(struct simeth_local)); + + local = dev->priv; + local->simfd = fd; /* keep track of underlying file descriptor */ + + dev->open = simeth_open; + dev->stop = simeth_close; + dev->hard_start_xmit = simeth_tx; + dev->get_stats = simeth_get_stats; + dev->set_multicast_list = set_multicast_list; /* no yet used */ + + /* Fill in the fields of the device structure with ethernet-generic values. */ + ether_setup(dev); + + printk("%s: hosteth=%s simfd=%d, HwAddr", dev->name, simeth_device, local->simfd); + for(i = 0; i < ETH_ALEN; i++) { + printk(" %2.2x", dev->dev_addr[i]); + } + printk(", IRQ %d\n", dev->irq); + + return 0; +} + +/* + * actually binds the device to an interrupt vector + */ +static int +simeth_open(struct net_device *dev) +{ + if (request_irq(dev->irq, simeth_interrupt, 0, "simeth", dev)) { + printk ("simeth: unable to get IRQ %d.\n", dev->irq); + return -EAGAIN; + } + + netif_start_queue(dev); + + return 0; +} + +/* copied from lapbether.c */ +static __inline__ int dev_is_ethdev(struct net_device *dev) +{ + return ( dev->type == ARPHRD_ETHER && strncmp(dev->name, "dummy", 5)); +} + + +/* + * Handler for IFF_UP or IFF_DOWN + * + * The reason for that is that we don't want to be interrupted when the + * interface is down. There is no way to unconnect in the simualtor. Instead + * we use this function to shutdown packet processing in the frame filter + * in the simulator. Thus no interrupts are generated + * + * + * That's also the place where we pass the IP address of this device to the + * simulator so that that we can start filtering packets for it + * + * There may be a better way of doing this, but I don't know which yet. + */ +static int +simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr) +{ + struct net_device *dev = (struct net_device *)ptr; + struct simeth_local *local; + struct in_device *in_dev; + struct in_ifaddr **ifap = NULL; + struct in_ifaddr *ifa = NULL; + int r; + + + if ( ! dev ) { + printk(KERN_WARNING "simeth_device_event dev=0\n"); + return NOTIFY_DONE; + } + + if ( event != NETDEV_UP && event != NETDEV_DOWN ) return NOTIFY_DONE; + + /* + * Check whether or not it's for an ethernet device + * + * XXX Fixme: This works only as long as we support one + * type of ethernet device. + */ + if ( !dev_is_ethdev(dev) ) return NOTIFY_DONE; + + if ((in_dev=dev->ip_ptr) != NULL) { + for (ifap=&in_dev->ifa_list; (ifa=*ifap) != NULL; ifap=&ifa->ifa_next) + if (strcmp(dev->name, ifa->ifa_label) == 0) break; + } + if ( ifa == NULL ) { + printk("simeth_open: can't find device %s's ifa\n", dev->name); + return NOTIFY_DONE; + } + + printk("simeth_device_event: %s ipaddr=0x%x\n", dev->name, htonl(ifa->ifa_local)); + + /* + * XXX Fix me + * if the device was up, and we're simply reconfiguring it, not sure + * we get DOWN then UP. + */ + + local = dev->priv; + /* now do it for real */ + r = event == NETDEV_UP ? + netdev_attach(local->simfd, dev->irq, htonl(ifa->ifa_local)): + netdev_detach(local->simfd); + + printk("simeth: netdev_attach/detach: event=%s ->%d\n", event == NETDEV_UP ? "attach":"detach", r); + + return NOTIFY_DONE; +} + +static int +simeth_close(struct net_device *dev) +{ + netif_stop_queue(dev); + + free_irq(dev->irq, dev); + + return 0; +} + +/* + * Only used for debug + */ +static void +frame_print(unsigned char *from, unsigned char *frame, int len) +{ + int i; + + printk("%s: (%d) %02x", from, len, frame[0] & 0xff); + for(i=1; i < 6; i++ ) { + printk(":%02x", frame[i] &0xff); + } + printk(" %2x", frame[6] &0xff); + for(i=7; i < 12; i++ ) { + printk(":%02x", frame[i] &0xff); + } + printk(" [%02x%02x]\n", frame[12], frame[13]); + + for(i=14; i < len; i++ ) { + printk("%02x ", frame[i] &0xff); + if ( (i%10)==0) printk("\n"); + } + printk("\n"); +} + + +/* + * Function used to transmit of frame, very last one on the path before + * going to the simulator. + */ +static int +simeth_tx(struct sk_buff *skb, struct net_device *dev) +{ + struct simeth_local *local = (struct simeth_local *)dev->priv; + +#if 0 + /* ensure we have at least ETH_ZLEN bytes (min frame size) */ + unsigned int length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; + /* Where do the extra padding bytes comes from inthe skbuff ? */ +#else + /* the real driver in the host system is going to take care of that + * or maybe it's the NIC itself. + */ + unsigned int length = skb->len; +#endif + + local->stats.tx_bytes += skb->len; + local->stats.tx_packets++; + + + if (simeth_debug > 5) frame_print("simeth_tx", skb->data, length); + + netdev_send(local->simfd, skb->data, length); + + /* + * we are synchronous on write, so we don't simulate a + * trasnmit complete interrupt, thus we don't need to arm a tx + */ + + dev_kfree_skb(skb); + return 0; +} + +static inline struct sk_buff * +make_new_skb(struct net_device *dev) +{ + struct sk_buff *nskb; + + /* + * The +2 is used to make sure that the IP header is nicely + * aligned (on 4byte boundary I assume 14+2=16) + */ + nskb = dev_alloc_skb(SIMETH_FRAME_SIZE + 2); + if ( nskb == NULL ) { + printk(KERN_NOTICE "%s: memory squeeze. dropping packet.\n", dev->name); + return NULL; + } + nskb->dev = dev; + + skb_reserve(nskb, 2); /* Align IP on 16 byte boundaries */ + + skb_put(nskb,SIMETH_FRAME_SIZE); + + return nskb; +} + +/* + * called from interrupt handler to process a received frame + */ +static int +simeth_rx(struct net_device *dev) +{ + struct simeth_local *local; + struct sk_buff *skb; + int len; + int rcv_count = SIMETH_RECV_MAX; + + local = (struct simeth_local *)dev->priv; + /* + * the loop concept has been borrowed from other drivers + * looks to me like it's a throttling thing to avoid pushing to many + * packets at one time into the stack. Making sure we can process them + * upstream and make forward progress overall + */ + do { + if ( (skb=make_new_skb(dev)) == NULL ) { + printk(KERN_NOTICE "%s: memory squeeze. dropping packet.\n", dev->name); + local->stats.rx_dropped++; + return 0; + } + /* + * Read only one frame at a time + */ + len = netdev_read(local->simfd, skb->data, SIMETH_FRAME_SIZE); + if ( len == 0 ) { + if ( simeth_debug > 0 ) printk(KERN_WARNING "%s: count=%d netdev_read=0\n", dev->name, SIMETH_RECV_MAX-rcv_count); + break; + } +#if 0 + /* + * XXX Fix me + * Should really do a csum+copy here + */ + memcpy(skb->data, frame, len); +#endif + skb->protocol = eth_type_trans(skb, dev); + + if ( simeth_debug > 6 ) frame_print("simeth_rx", skb->data, len); + + /* + * push the packet up & trigger software interrupt + */ + netif_rx(skb); + + local->stats.rx_packets++; + local->stats.rx_bytes += len; + + } while ( --rcv_count ); + + return len; /* 0 = nothing left to read, otherwise, we can try again */ +} + +/* + * Interrupt handler (Yes, we can do it too !!!) + */ +static void +simeth_interrupt(int irq, void *dev_id, struct pt_regs * regs) +{ + struct net_device *dev = dev_id; + + if ( dev == NULL ) { + printk(KERN_WARNING "simeth: irq %d for unknown device\n", irq); + return; + } + + /* + * very simple loop because we get interrupts only when receving + */ + while (simeth_rx(dev)); +} + +static struct net_device_stats * +simeth_get_stats(struct net_device *dev) +{ + struct simeth_local *local = (struct simeth_local *) dev->priv; + + return &local->stats; +} + +/* fake multicast ability */ +static void +set_multicast_list(struct net_device *dev) +{ + printk(KERN_WARNING "%s: set_multicast_list called\n", dev->name); +} + +#ifdef CONFIG_NET_FASTROUTE +static int +simeth_accept_fastpath(struct net_device *dev, struct dst_entry *dst) +{ + printk(KERN_WARNING "%s: simeth_accept_fastpath called\n", dev->name); + return -1; +} +#endif + +__initcall(simeth_probe); diff -urN linux-2.4.18/drivers/net/tg3.c lia64-2.4/drivers/net/tg3.c --- linux-2.4.18/drivers/net/tg3.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/tg3.c Fri Jul 19 17:20:15 2002 @@ -0,0 +1,6535 @@ +/* $Id: tg3.c,v 1.43.2.80 2002/03/14 00:10:04 davem Exp $ + * tg3.c: Broadcom Tigon3 ethernet driver. + * + * Copyright (C) 2001, 2002 David S. Miller (davem@redhat.com) + * Copyright (C) 2001, 2002 Jeff Garzik (jgarzik@mandrakesoft.com) + */ + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifndef PCI_DMA_BUS_IS_PHYS +#define PCI_DMA_BUS_IS_PHYS 1 +#endif + +/* Either I can't figure out how they secretly implemented it (ie. RXD flags + * for mini ring, where it should go in NIC sram, and how many entries the NIC + * firmware expects) or it isn't really fully implemented. Perhaps Broadcom + * wants people to pay for a "performance enhanced" version of their firmware + + * binary-only driver that has the mini ring actually implemented. + * These kids today... -DaveM + */ +#define TG3_MINI_RING_WORKS 0 + +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) +#define TG3_VLAN_TAG_USED 1 +#else +#define TG3_VLAN_TAG_USED 0 +#endif + +#include "tg3.h" + +#define DRV_MODULE_NAME "tg3" +#define PFX DRV_MODULE_NAME ": " +#define DRV_MODULE_VERSION "0.99" +#define DRV_MODULE_RELDATE "Jun 11, 2002" + +#define TG3_DEF_MAC_MODE 0 +#define TG3_DEF_RX_MODE 0 +#define TG3_DEF_TX_MODE 0 +#define TG3_DEF_MSG_ENABLE \ + (NETIF_MSG_DRV | \ + NETIF_MSG_PROBE | \ + NETIF_MSG_LINK | \ + NETIF_MSG_TIMER | \ + NETIF_MSG_IFDOWN | \ + NETIF_MSG_IFUP | \ + NETIF_MSG_RX_ERR | \ + NETIF_MSG_TX_ERR) + +/* length of time before we decide the hardware is borked, + * and dev->tx_timeout() should be called to fix the problem + */ +#define TG3_TX_TIMEOUT (5 * HZ) + +/* hardware minimum and maximum for a single frame's data payload */ +#define TG3_MIN_MTU 60 +#define TG3_MAX_MTU 9000 + +/* These numbers seem to be hard coded in the NIC firmware somehow. + * You can't change the ring sizes, but you can change where you place + * them in the NIC onboard memory. + */ +#define TG3_RX_RING_SIZE 512 +#define TG3_DEF_RX_RING_PENDING 200 +#if TG3_MINI_RING_WORKS +#define TG3_RX_MINI_RING_SIZE 256 /* ??? */ +#define TG3_DEF_RX_MINI_RING_PENDING 100 +#endif +#define TG3_RX_JUMBO_RING_SIZE 256 +#define TG3_DEF_RX_JUMBO_RING_PENDING 100 +#define TG3_RX_RCB_RING_SIZE 1024 +#define TG3_TX_RING_SIZE 512 +#define TG3_DEF_TX_RING_PENDING (TG3_TX_RING_SIZE - 1) + +#define TG3_RX_RING_BYTES (sizeof(struct tg3_rx_buffer_desc) * \ + TG3_RX_RING_SIZE) +#if TG3_MINI_RING_WORKS +#define TG3_RX_MINI_RING_BYTES (sizeof(struct tg3_rx_buffer_desc) * \ + TG3_RX_MINI_RING_SIZE) +#endif +#define TG3_RX_JUMBO_RING_BYTES (sizeof(struct tg3_rx_buffer_desc) * \ + TG3_RX_JUMBO_RING_SIZE) +#define TG3_RX_RCB_RING_BYTES (sizeof(struct tg3_rx_buffer_desc) * \ + TG3_RX_RCB_RING_SIZE) +#define TG3_TX_RING_BYTES (sizeof(struct tg3_tx_buffer_desc) * \ + TG3_TX_RING_SIZE) +#define TX_RING_GAP(TP) \ + (TG3_TX_RING_SIZE - (TP)->tx_pending) +#define TX_BUFFS_AVAIL(TP) \ + (((TP)->tx_cons <= (TP)->tx_prod) ? \ + (TP)->tx_cons + (TP)->tx_pending - (TP)->tx_prod : \ + (TP)->tx_cons - (TP)->tx_prod - TX_RING_GAP(TP)) +#define NEXT_TX(N) (((N) + 1) & (TG3_TX_RING_SIZE - 1)) + +#define RX_PKT_BUF_SZ (1536 + tp->rx_offset + 64) +#if TG3_MINI_RING_WORKS +#define RX_MINI_PKT_BUF_SZ (256 + tp->rx_offset + 64) +#endif +#define RX_JUMBO_PKT_BUF_SZ (9046 + tp->rx_offset + 64) + +/* minimum number of free TX descriptors required to wake up TX process */ +#define TG3_TX_WAKEUP_THRESH (TG3_TX_RING_SIZE / 4) + +static char version[] __devinitdata = + DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; + +MODULE_AUTHOR("David S. Miller (davem@redhat.com) and Jeff Garzik (jgarzik@mandrakesoft.com)"); +MODULE_DESCRIPTION("Broadcom Tigon3 ethernet driver"); +MODULE_LICENSE("GPL"); +MODULE_PARM(tg3_debug, "i"); +MODULE_PARM_DESC(tg3_debug, "Tigon3 bitmapped debugging message enable value"); + +static int tg3_debug = -1; /* -1 == use TG3_DEF_MSG_ENABLE as value */ + +static struct pci_device_id tg3_pci_tbl[] __devinitdata = { + { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5700, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, + { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5701, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, + { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, + { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5703, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, + { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702FE, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, + { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702X, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, + { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5703X, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, + { PCI_VENDOR_ID_SYSKONNECT, 0x4400, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, + { PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, + { PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC9100, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, + { 0, } +}; + +MODULE_DEVICE_TABLE(pci, tg3_pci_tbl); + +static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val) +{ + if ((tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) != 0) { + unsigned long flags; + + spin_lock_irqsave(&tp->indirect_lock, flags); + pci_write_config_dword(tp->pdev, TG3PCI_REG_BASE_ADDR, off); + pci_write_config_dword(tp->pdev, TG3PCI_REG_DATA, val); + spin_unlock_irqrestore(&tp->indirect_lock, flags); + } else { + writel(val, tp->regs + off); + } +} + +#define tw32(reg,val) tg3_write_indirect_reg32(tp,(reg),(val)) +#define tw32_mailbox(reg, val) writel(((val) & 0xffffffff), tp->regs + (reg)) +#define tw16(reg,val) writew(((val) & 0xffff), tp->regs + (reg)) +#define tw8(reg,val) writeb(((val) & 0xff), tp->regs + (reg)) +#define tr32(reg) readl(tp->regs + (reg)) +#define tr16(reg) readw(tp->regs + (reg)) +#define tr8(reg) readb(tp->regs + (reg)) + +static void tg3_write_mem(struct tg3 *tp, u32 off, u32 val) +{ + unsigned long flags; + + spin_lock_irqsave(&tp->indirect_lock, flags); + pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off); + pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val); + + /* Always leave this as zero. */ + pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0); + spin_unlock_irqrestore(&tp->indirect_lock, flags); +} + +static void tg3_read_mem(struct tg3 *tp, u32 off, u32 *val) +{ + unsigned long flags; + + spin_lock_irqsave(&tp->indirect_lock, flags); + pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off); + pci_read_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val); + + /* Always leave this as zero. */ + pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0); + spin_unlock_irqrestore(&tp->indirect_lock, flags); +} + +static void tg3_disable_ints(struct tg3 *tp) +{ + tw32(TG3PCI_MISC_HOST_CTRL, + (tp->misc_host_ctrl | MISC_HOST_CTRL_MASK_PCI_INT)); + tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001); +} + +static void tg3_enable_ints(struct tg3 *tp) +{ + tw32(TG3PCI_MISC_HOST_CTRL, + (tp->misc_host_ctrl & ~MISC_HOST_CTRL_MASK_PCI_INT)); + tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000000); + + if (tp->hw_status->status & SD_STATUS_UPDATED) + tw32(GRC_LOCAL_CTRL, + tp->grc_local_ctrl | GRC_LCLCTRL_SETINT); +} + +#define PHY_BUSY_LOOPS 5000 + +static int tg3_readphy(struct tg3 *tp, int reg, u32 *val) +{ + u32 frame_val; + int loops, ret; + + if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) { + tw32(MAC_MI_MODE, + (tp->mi_mode & ~MAC_MI_MODE_AUTO_POLL)); + udelay(40); + } + + *val = 0xffffffff; + + frame_val = ((PHY_ADDR << MI_COM_PHY_ADDR_SHIFT) & + MI_COM_PHY_ADDR_MASK); + frame_val |= ((reg << MI_COM_REG_ADDR_SHIFT) & + MI_COM_REG_ADDR_MASK); + frame_val |= (MI_COM_CMD_READ | MI_COM_START); + + tw32(MAC_MI_COM, frame_val); + + loops = PHY_BUSY_LOOPS; + while (loops-- > 0) { + frame_val = tr32(MAC_MI_COM); + + if ((frame_val & MI_COM_BUSY) == 0) { + udelay(5); + frame_val = tr32(MAC_MI_COM); + break; + } + udelay(10); + } + + ret = -EBUSY; + if (loops > 0) { + *val = frame_val & MI_COM_DATA_MASK; + ret = 0; + } + + if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) { + tw32(MAC_MI_MODE, tp->mi_mode); + udelay(40); + } + + return ret; +} + +static int tg3_writephy(struct tg3 *tp, int reg, u32 val) +{ + u32 frame_val; + int loops, ret; + + if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) { + tw32(MAC_MI_MODE, + (tp->mi_mode & ~MAC_MI_MODE_AUTO_POLL)); + udelay(40); + } + + frame_val = ((PHY_ADDR << MI_COM_PHY_ADDR_SHIFT) & + MI_COM_PHY_ADDR_MASK); + frame_val |= ((reg << MI_COM_REG_ADDR_SHIFT) & + MI_COM_REG_ADDR_MASK); + frame_val |= (val & MI_COM_DATA_MASK); + frame_val |= (MI_COM_CMD_WRITE | MI_COM_START); + + tw32(MAC_MI_COM, frame_val); + + loops = PHY_BUSY_LOOPS; + while (loops-- > 0) { + frame_val = tr32(MAC_MI_COM); + if ((frame_val & MI_COM_BUSY) == 0) { + udelay(5); + frame_val = tr32(MAC_MI_COM); + break; + } + udelay(10); + } + + ret = -EBUSY; + if (loops > 0) + ret = 0; + + if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) { + tw32(MAC_MI_MODE, tp->mi_mode); + udelay(40); + } + + return ret; +} + +/* This will reset the tigon3 PHY if there is no valid + * link unless the FORCE argument is non-zero. + */ +static int tg3_phy_reset(struct tg3 *tp, int force) +{ + u32 phy_status, phy_control; + int err, limit; + + err = tg3_readphy(tp, MII_BMSR, &phy_status); + err |= tg3_readphy(tp, MII_BMSR, &phy_status); + if (err != 0) + return -EBUSY; + + /* If we have link, and not forcing a reset, then nothing + * to do. + */ + if ((phy_status & BMSR_LSTATUS) != 0 && (force == 0)) + return 0; + + /* OK, reset it, and poll the BMCR_RESET bit until it + * clears or we time out. + */ + phy_control = BMCR_RESET; + err = tg3_writephy(tp, MII_BMCR, phy_control); + if (err != 0) + return -EBUSY; + + limit = 5000; + while (limit--) { + err = tg3_readphy(tp, MII_BMCR, &phy_control); + if (err != 0) + return -EBUSY; + + if ((phy_control & BMCR_RESET) == 0) { + udelay(40); + return 0; + } + udelay(10); + } + + return -EBUSY; +} + +static int tg3_setup_phy(struct tg3 *); +static int tg3_halt(struct tg3 *); + +static int tg3_set_power_state(struct tg3 *tp, int state) +{ + u32 misc_host_ctrl; + u16 power_control, power_caps; + int pm = tp->pm_cap; + + /* Make sure register accesses (indirect or otherwise) + * will function correctly. + */ + pci_write_config_dword(tp->pdev, + TG3PCI_MISC_HOST_CTRL, + tp->misc_host_ctrl); + + pci_read_config_word(tp->pdev, + pm + PCI_PM_CTRL, + &power_control); + power_control |= PCI_PM_CTRL_PME_STATUS; + power_control &= ~(PCI_PM_CTRL_STATE_MASK); + switch (state) { + case 0: + power_control |= 0; + pci_write_config_word(tp->pdev, + pm + PCI_PM_CTRL, + power_control); + tw32(GRC_LOCAL_CTRL, tp->grc_local_ctrl); + tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x02); + return 0; + + case 1: + power_control |= 1; + break; + + case 2: + power_control |= 2; + break; + + case 3: + power_control |= 3; + break; + + default: + printk(KERN_WARNING "%s: Invalid power state (%d) requested.\n", + tp->dev->name, state); + return -EINVAL; + }; + + power_control |= PCI_PM_CTRL_PME_ENABLE; + + misc_host_ctrl = tr32(TG3PCI_MISC_HOST_CTRL); + tw32(TG3PCI_MISC_HOST_CTRL, + misc_host_ctrl | MISC_HOST_CTRL_MASK_PCI_INT); + + if (tp->link_config.phy_is_low_power == 0) { + tp->link_config.phy_is_low_power = 1; + tp->link_config.orig_speed = tp->link_config.speed; + tp->link_config.orig_duplex = tp->link_config.duplex; + tp->link_config.orig_autoneg = tp->link_config.autoneg; + } + + tp->link_config.speed = SPEED_10; + tp->link_config.autoneg = AUTONEG_ENABLE; + tg3_setup_phy(tp); + + tg3_halt(tp); + + pci_read_config_word(tp->pdev, pm + PCI_PM_PMC, &power_caps); + + if (tp->tg3_flags & TG3_FLAG_WOL_ENABLE) { + u32 mac_mode; + + tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x5a); + + mac_mode = MAC_MODE_PORT_MODE_MII | + MAC_MODE_LINK_POLARITY; + + if (((power_caps & PCI_PM_CAP_PME_D3cold) && + (tp->tg3_flags & TG3_FLAG_WOL_ENABLE))) + mac_mode |= MAC_MODE_MAGIC_PKT_ENABLE; + + tw32(MAC_MODE, mac_mode); + tw32(MAC_RX_MODE, RX_MODE_ENABLE); + } + + if (tp->tg3_flags & TG3_FLAG_WOL_SPEED_100MB) { + tw32(TG3PCI_CLOCK_CTRL, + (CLOCK_CTRL_RXCLK_DISABLE | + CLOCK_CTRL_TXCLK_DISABLE | + CLOCK_CTRL_ALTCLK)); + tw32(TG3PCI_CLOCK_CTRL, + (CLOCK_CTRL_RXCLK_DISABLE | + CLOCK_CTRL_TXCLK_DISABLE | + CLOCK_CTRL_44MHZ_CORE)); + tw32(TG3PCI_CLOCK_CTRL, + (CLOCK_CTRL_RXCLK_DISABLE | + CLOCK_CTRL_TXCLK_DISABLE | + CLOCK_CTRL_ALTCLK | + CLOCK_CTRL_44MHZ_CORE)); + } else { + tw32(TG3PCI_CLOCK_CTRL, + (CLOCK_CTRL_RXCLK_DISABLE | + CLOCK_CTRL_TXCLK_DISABLE | + CLOCK_CTRL_ALTCLK | + CLOCK_CTRL_PWRDOWN_PLL133)); + } + + udelay(40); + + if ((power_caps & PCI_PM_CAP_PME_D3cold) && + (tp->tg3_flags & TG3_FLAG_WOL_ENABLE)) { + /* Move to auxilliary power. */ + tw32(GRC_LOCAL_CTRL, + (GRC_LCLCTRL_GPIO_OE0 | + GRC_LCLCTRL_GPIO_OE1 | + GRC_LCLCTRL_GPIO_OE2 | + GRC_LCLCTRL_GPIO_OUTPUT0 | + GRC_LCLCTRL_GPIO_OUTPUT1)); + } + + /* Finally, set the new power state. */ + pci_write_config_word(tp->pdev, pm + PCI_PM_CTRL, power_control); + + return 0; +} + +static void tg3_link_report(struct tg3 *tp) +{ + if (!netif_carrier_ok(tp->dev)) { + printk("%s: Link is down.\n", tp->dev->name); + } else { + printk("%s: Link is up at %d Mbps, %s duplex.\n", + tp->dev->name, + (tp->link_config.active_speed == SPEED_1000 ? + 1000 : + (tp->link_config.active_speed == SPEED_100 ? + 100 : 10)), + (tp->link_config.active_duplex == DUPLEX_FULL ? + "full" : "half")); + + printk("%s: Flow control is %s for TX and %s for RX.\n", + tp->dev->name, + (tp->tg3_flags & TG3_FLAG_TX_PAUSE) ? "on" : "off", + (tp->tg3_flags & TG3_FLAG_RX_PAUSE) ? "on" : "off"); + } +} + +static void tg3_setup_flow_control(struct tg3 *tp, u32 local_adv, u32 remote_adv) +{ + u32 new_tg3_flags = 0; + + if (local_adv & ADVERTISE_PAUSE_CAP) { + if (local_adv & ADVERTISE_PAUSE_ASYM) { + if (remote_adv & LPA_PAUSE_CAP) + new_tg3_flags |= + (TG3_FLAG_RX_PAUSE | + TG3_FLAG_TX_PAUSE); + else if (remote_adv & LPA_PAUSE_ASYM) + new_tg3_flags |= + (TG3_FLAG_RX_PAUSE); + } else { + if (remote_adv & LPA_PAUSE_CAP) + new_tg3_flags |= + (TG3_FLAG_RX_PAUSE | + TG3_FLAG_TX_PAUSE); + } + } else if (local_adv & ADVERTISE_PAUSE_ASYM) { + if ((remote_adv & LPA_PAUSE_CAP) && + (remote_adv & LPA_PAUSE_ASYM)) + new_tg3_flags |= TG3_FLAG_TX_PAUSE; + } + + tp->tg3_flags &= ~(TG3_FLAG_RX_PAUSE | TG3_FLAG_TX_PAUSE); + tp->tg3_flags |= new_tg3_flags; + + if (new_tg3_flags & TG3_FLAG_RX_PAUSE) + tp->rx_mode |= RX_MODE_FLOW_CTRL_ENABLE; + else + tp->rx_mode &= ~RX_MODE_FLOW_CTRL_ENABLE; + + if (new_tg3_flags & TG3_FLAG_TX_PAUSE) + tp->tx_mode |= TX_MODE_FLOW_CTRL_ENABLE; + else + tp->tx_mode &= ~TX_MODE_FLOW_CTRL_ENABLE; +} + +static void tg3_aux_stat_to_speed_duplex(struct tg3 *tp, u32 val, u16 *speed, u8 *duplex) +{ + switch (val & MII_TG3_AUX_STAT_SPDMASK) { + case MII_TG3_AUX_STAT_10HALF: + *speed = SPEED_10; + *duplex = DUPLEX_HALF; + break; + + case MII_TG3_AUX_STAT_10FULL: + *speed = SPEED_10; + *duplex = DUPLEX_FULL; + break; + + case MII_TG3_AUX_STAT_100HALF: + *speed = SPEED_100; + *duplex = DUPLEX_HALF; + break; + + case MII_TG3_AUX_STAT_100FULL: + *speed = SPEED_100; + *duplex = DUPLEX_FULL; + break; + + case MII_TG3_AUX_STAT_1000HALF: + *speed = SPEED_1000; + *duplex = DUPLEX_HALF; + break; + + case MII_TG3_AUX_STAT_1000FULL: + *speed = SPEED_1000; + *duplex = DUPLEX_FULL; + break; + + default: + *speed = SPEED_INVALID; + *duplex = DUPLEX_INVALID; + break; + }; +} + +static int tg3_phy_copper_begin(struct tg3 *tp, int wait_for_link) +{ + u32 new_adv; + int i; + + if (tp->link_config.phy_is_low_power) { + /* Entering low power mode. Disable gigabit and + * 100baseT advertisements. + */ + tg3_writephy(tp, MII_TG3_CTRL, 0); + + new_adv = (ADVERTISE_10HALF | ADVERTISE_10FULL | + ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP); + if (tp->tg3_flags & TG3_FLAG_WOL_SPEED_100MB) + new_adv |= (ADVERTISE_100HALF | ADVERTISE_100FULL); + + tg3_writephy(tp, MII_ADVERTISE, new_adv); + } else if (tp->link_config.speed == SPEED_INVALID) { + tp->link_config.advertising = + (ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full | + ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full | + ADVERTISED_1000baseT_Half | ADVERTISED_1000baseT_Full | + ADVERTISED_Autoneg | ADVERTISED_MII); + + if (tp->tg3_flags & TG3_FLAG_10_100_ONLY) + tp->link_config.advertising &= + ~(ADVERTISED_1000baseT_Half | + ADVERTISED_1000baseT_Full); + + new_adv = (ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP); + if (tp->link_config.advertising & ADVERTISED_10baseT_Half) + new_adv |= ADVERTISE_10HALF; + if (tp->link_config.advertising & ADVERTISED_10baseT_Full) + new_adv |= ADVERTISE_10FULL; + if (tp->link_config.advertising & ADVERTISED_100baseT_Half) + new_adv |= ADVERTISE_100HALF; + if (tp->link_config.advertising & ADVERTISED_100baseT_Full) + new_adv |= ADVERTISE_100FULL; + tg3_writephy(tp, MII_ADVERTISE, new_adv); + + if (tp->link_config.advertising & + (ADVERTISED_1000baseT_Half | ADVERTISED_1000baseT_Full)) { + new_adv = 0; + if (tp->link_config.advertising & ADVERTISED_1000baseT_Half) + new_adv |= MII_TG3_CTRL_ADV_1000_HALF; + if (tp->link_config.advertising & ADVERTISED_1000baseT_Full) + new_adv |= MII_TG3_CTRL_ADV_1000_FULL; + if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0 || + tp->pci_chip_rev_id == CHIPREV_ID_5701_B0) + new_adv |= (MII_TG3_CTRL_AS_MASTER | + MII_TG3_CTRL_ENABLE_AS_MASTER); + tg3_writephy(tp, MII_TG3_CTRL, new_adv); + } else { + tg3_writephy(tp, MII_TG3_CTRL, 0); + } + } else { + /* Asking for a specific link mode. */ + if (tp->link_config.speed == SPEED_1000) { + new_adv = ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP; + tg3_writephy(tp, MII_ADVERTISE, new_adv); + + if (tp->link_config.duplex == DUPLEX_FULL) + new_adv = MII_TG3_CTRL_ADV_1000_FULL; + else + new_adv = MII_TG3_CTRL_ADV_1000_HALF; + if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0 || + tp->pci_chip_rev_id == CHIPREV_ID_5701_B0) + new_adv |= (MII_TG3_CTRL_AS_MASTER | + MII_TG3_CTRL_ENABLE_AS_MASTER); + tg3_writephy(tp, MII_TG3_CTRL, new_adv); + } else { + tg3_writephy(tp, MII_TG3_CTRL, 0); + + new_adv = ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP; + if (tp->link_config.speed == SPEED_100) { + if (tp->link_config.duplex == DUPLEX_FULL) + new_adv |= ADVERTISE_100FULL; + else + new_adv |= ADVERTISE_100HALF; + } else { + if (tp->link_config.duplex == DUPLEX_FULL) + new_adv |= ADVERTISE_10FULL; + else + new_adv |= ADVERTISE_10HALF; + } + tg3_writephy(tp, MII_ADVERTISE, new_adv); + } + } + + if (tp->link_config.autoneg == AUTONEG_DISABLE && + tp->link_config.speed != SPEED_INVALID) { + u32 bmcr, orig_bmcr; + + tp->link_config.active_speed = tp->link_config.speed; + tp->link_config.active_duplex = tp->link_config.duplex; + + bmcr = 0; + switch (tp->link_config.speed) { + default: + case SPEED_10: + break; + + case SPEED_100: + bmcr |= BMCR_SPEED100; + break; + + case SPEED_1000: + bmcr |= TG3_BMCR_SPEED1000; + break; + }; + + if (tp->link_config.duplex == DUPLEX_FULL) + bmcr |= BMCR_FULLDPLX; + + tg3_readphy(tp, MII_BMCR, &orig_bmcr); + if (bmcr != orig_bmcr) { + tg3_writephy(tp, MII_BMCR, BMCR_LOOPBACK); + for (i = 0; i < 15000; i++) { + u32 tmp; + + udelay(10); + tg3_readphy(tp, MII_BMSR, &tmp); + tg3_readphy(tp, MII_BMSR, &tmp); + if (!(tmp & BMSR_LSTATUS)) { + udelay(40); + break; + } + } + tg3_writephy(tp, MII_BMCR, bmcr); + udelay(40); + } + } else { + tg3_writephy(tp, MII_BMCR, + BMCR_ANENABLE | BMCR_ANRESTART); + } + + if (wait_for_link) { + tp->link_config.active_speed = SPEED_INVALID; + tp->link_config.active_duplex = DUPLEX_INVALID; + for (i = 0; i < 300000; i++) { + u32 tmp; + + udelay(10); + tg3_readphy(tp, MII_BMSR, &tmp); + tg3_readphy(tp, MII_BMSR, &tmp); + if (!(tmp & BMSR_LSTATUS)) + continue; + + tg3_readphy(tp, MII_TG3_AUX_STAT, &tmp); + tg3_aux_stat_to_speed_duplex(tp, tmp, + &tp->link_config.active_speed, + &tp->link_config.active_duplex); + } + if (tp->link_config.active_speed == SPEED_INVALID) + return -EINVAL; + } + + return 0; +} + +static int tg3_init_5401phy_dsp(struct tg3 *tp) +{ + int err; + + /* Turn off tap power management. */ + err = tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c20); + + err |= tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x0012); + err |= tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x1804); + + err |= tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x0013); + err |= tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x1204); + + err |= tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x8006); + err |= tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x0132); + + err |= tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x8006); + err |= tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x0232); + + err |= tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x201f); + err |= tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x0a20); + + udelay(40); + + return err; +} + +static int tg3_setup_copper_phy(struct tg3 *tp) +{ + int current_link_up; + u32 bmsr, dummy; + u16 current_speed; + u8 current_duplex; + int i, err; + + tw32(MAC_STATUS, + (MAC_STATUS_SYNC_CHANGED | + MAC_STATUS_CFG_CHANGED)); + + tp->mi_mode = MAC_MI_MODE_BASE; + tw32(MAC_MI_MODE, tp->mi_mode); + udelay(40); + + if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401) { + tg3_readphy(tp, MII_BMSR, &bmsr); + tg3_readphy(tp, MII_BMSR, &bmsr); + + if (!(tp->tg3_flags & TG3_FLAG_INIT_COMPLETE)) + bmsr = 0; + + if (!(bmsr & BMSR_LSTATUS)) { + err = tg3_init_5401phy_dsp(tp); + if (err) + return err; + + tg3_readphy(tp, MII_BMSR, &bmsr); + for (i = 0; i < 1000; i++) { + udelay(10); + tg3_readphy(tp, MII_BMSR, &bmsr); + if (bmsr & BMSR_LSTATUS) { + udelay(40); + break; + } + } + + if ((tp->phy_id & PHY_ID_REV_MASK) == PHY_REV_BCM5401_B0 && + !(bmsr & BMSR_LSTATUS) && + tp->link_config.active_speed == SPEED_1000) { + err = tg3_phy_reset(tp, 1); + if (!err) + err = tg3_init_5401phy_dsp(tp); + if (err) + return err; + } + } + } else if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0 || + tp->pci_chip_rev_id == CHIPREV_ID_5701_B0) { + /* 5701 {A0,B0} CRC bug workaround */ + tg3_writephy(tp, 0x15, 0x0a75); + tg3_writephy(tp, 0x1c, 0x8c68); + tg3_writephy(tp, 0x1c, 0x8d68); + tg3_writephy(tp, 0x1c, 0x8c68); + } + + /* Clear pending interrupts... */ + tg3_readphy(tp, MII_TG3_ISTAT, &dummy); + tg3_readphy(tp, MII_TG3_ISTAT, &dummy); + + if (tp->tg3_flags & TG3_FLAG_USE_MI_INTERRUPT) + tg3_writephy(tp, MII_TG3_IMASK, ~MII_TG3_INT_LINKCHG); + else + tg3_writephy(tp, MII_TG3_IMASK, ~0); + + if (tp->led_mode == led_mode_three_link) + tg3_writephy(tp, MII_TG3_EXT_CTRL, + MII_TG3_EXT_CTRL_LNK3_LED_MODE); + else + tg3_writephy(tp, MII_TG3_EXT_CTRL, 0); + + current_link_up = 0; + current_speed = SPEED_INVALID; + current_duplex = DUPLEX_INVALID; + + tg3_readphy(tp, MII_BMSR, &bmsr); + tg3_readphy(tp, MII_BMSR, &bmsr); + + if (bmsr & BMSR_LSTATUS) { + u32 aux_stat, bmcr; + + tg3_readphy(tp, MII_TG3_AUX_STAT, &aux_stat); + for (i = 0; i < 2000; i++) { + udelay(10); + tg3_readphy(tp, MII_TG3_AUX_STAT, &aux_stat); + if (aux_stat) + break; + } + + tg3_aux_stat_to_speed_duplex(tp, aux_stat, + ¤t_speed, + ¤t_duplex); + tg3_readphy(tp, MII_BMCR, &bmcr); + tg3_readphy(tp, MII_BMCR, &bmcr); + if (tp->link_config.autoneg == AUTONEG_ENABLE) { + if (bmcr & BMCR_ANENABLE) { + u32 gig_ctrl; + + current_link_up = 1; + + /* Force autoneg restart if we are exiting + * low power mode. + */ + tg3_readphy(tp, MII_TG3_CTRL, &gig_ctrl); + if (!(gig_ctrl & (MII_TG3_CTRL_ADV_1000_HALF | + MII_TG3_CTRL_ADV_1000_FULL))) { + current_link_up = 0; + } + } else { + current_link_up = 0; + } + } else { + if (!(bmcr & BMCR_ANENABLE) && + tp->link_config.speed == current_speed && + tp->link_config.duplex == current_duplex) { + current_link_up = 1; + } else { + current_link_up = 0; + } + } + + tp->link_config.active_speed = current_speed; + tp->link_config.active_duplex = current_duplex; + } + + if (current_link_up == 1 && + (tp->link_config.active_duplex == DUPLEX_FULL) && + (tp->link_config.autoneg == AUTONEG_ENABLE)) { + u32 local_adv, remote_adv; + + tg3_readphy(tp, MII_ADVERTISE, &local_adv); + local_adv &= (ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM); + + tg3_readphy(tp, MII_LPA, &remote_adv); + remote_adv &= (LPA_PAUSE_CAP | LPA_PAUSE_ASYM); + + /* If we are not advertising full pause capability, + * something is wrong. Bring the link down and reconfigure. + */ + if (local_adv != ADVERTISE_PAUSE_CAP) { + current_link_up = 0; + } else { + tg3_setup_flow_control(tp, local_adv, remote_adv); + } + } + + if (current_link_up == 0) { + u32 tmp; + + tg3_phy_copper_begin(tp, 0); + + tg3_readphy(tp, MII_BMSR, &tmp); + tg3_readphy(tp, MII_BMSR, &tmp); + if (tmp & BMSR_LSTATUS) + current_link_up = 1; + } + + tp->mac_mode &= ~MAC_MODE_PORT_MODE_MASK; + if (current_link_up == 1) { + if (tp->link_config.active_speed == SPEED_100 || + tp->link_config.active_speed == SPEED_10) + tp->mac_mode |= MAC_MODE_PORT_MODE_MII; + else + tp->mac_mode |= MAC_MODE_PORT_MODE_GMII; + } else + tp->mac_mode |= MAC_MODE_PORT_MODE_GMII; + + tp->mac_mode &= ~MAC_MODE_HALF_DUPLEX; + if (tp->link_config.active_duplex == DUPLEX_HALF) + tp->mac_mode |= MAC_MODE_HALF_DUPLEX; + + tp->mac_mode &= ~MAC_MODE_LINK_POLARITY; + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 || + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703) { + if (current_link_up == 1) + tp->mac_mode |= MAC_MODE_LINK_POLARITY; + tw32(MAC_LED_CTRL, LED_CTRL_PHY_MODE_1); + } else { + if ((tp->led_mode == led_mode_link10) || + (current_link_up == 1 && + tp->link_config.active_speed == SPEED_10)) + tp->mac_mode |= MAC_MODE_LINK_POLARITY; + } + + /* ??? Without this setting Netgear GA302T PHY does not + * ??? send/receive packets... + */ + if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5411 && + tp->pci_chip_rev_id == CHIPREV_ID_5700_ALTIMA) { + tp->mi_mode |= MAC_MI_MODE_AUTO_POLL; + tw32(MAC_MI_MODE, tp->mi_mode); + udelay(40); + } + + tw32(MAC_MODE, tp->mac_mode); + + if (tp->tg3_flags & + (TG3_FLAG_USE_LINKCHG_REG | + TG3_FLAG_POLL_SERDES)) { + /* Polled via timer. */ + tw32(MAC_EVENT, 0); + } else { + tw32(MAC_EVENT, MAC_EVENT_LNKSTATE_CHANGED); + } + + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 && + current_link_up == 1 && + tp->link_config.active_speed == SPEED_1000 && + ((tp->tg3_flags & TG3_FLAG_PCIX_MODE) || + (tp->tg3_flags & TG3_FLAG_PCI_HIGH_SPEED))) { + udelay(120); + tw32(MAC_STATUS, + (MAC_STATUS_SYNC_CHANGED | + MAC_STATUS_CFG_CHANGED)); + tg3_write_mem(tp, + NIC_SRAM_FIRMWARE_MBOX, + NIC_SRAM_FIRMWARE_MBOX_MAGIC2); + } + + if (current_link_up != netif_carrier_ok(tp->dev)) { + if (current_link_up) + netif_carrier_on(tp->dev); + else + netif_carrier_off(tp->dev); + tg3_link_report(tp); + } + + return 0; +} + +struct tg3_fiber_aneginfo { + int state; +#define ANEG_STATE_UNKNOWN 0 +#define ANEG_STATE_AN_ENABLE 1 +#define ANEG_STATE_RESTART_INIT 2 +#define ANEG_STATE_RESTART 3 +#define ANEG_STATE_DISABLE_LINK_OK 4 +#define ANEG_STATE_ABILITY_DETECT_INIT 5 +#define ANEG_STATE_ABILITY_DETECT 6 +#define ANEG_STATE_ACK_DETECT_INIT 7 +#define ANEG_STATE_ACK_DETECT 8 +#define ANEG_STATE_COMPLETE_ACK_INIT 9 +#define ANEG_STATE_COMPLETE_ACK 10 +#define ANEG_STATE_IDLE_DETECT_INIT 11 +#define ANEG_STATE_IDLE_DETECT 12 +#define ANEG_STATE_LINK_OK 13 +#define ANEG_STATE_NEXT_PAGE_WAIT_INIT 14 +#define ANEG_STATE_NEXT_PAGE_WAIT 15 + + u32 flags; +#define MR_AN_ENABLE 0x00000001 +#define MR_RESTART_AN 0x00000002 +#define MR_AN_COMPLETE 0x00000004 +#define MR_PAGE_RX 0x00000008 +#define MR_NP_LOADED 0x00000010 +#define MR_TOGGLE_TX 0x00000020 +#define MR_LP_ADV_FULL_DUPLEX 0x00000040 +#define MR_LP_ADV_HALF_DUPLEX 0x00000080 +#define MR_LP_ADV_SYM_PAUSE 0x00000100 +#define MR_LP_ADV_ASYM_PAUSE 0x00000200 +#define MR_LP_ADV_REMOTE_FAULT1 0x00000400 +#define MR_LP_ADV_REMOTE_FAULT2 0x00000800 +#define MR_LP_ADV_NEXT_PAGE 0x00001000 +#define MR_TOGGLE_RX 0x00002000 +#define MR_NP_RX 0x00004000 + +#define MR_LINK_OK 0x80000000 + + unsigned long link_time, cur_time; + + u32 ability_match_cfg; + int ability_match_count; + + char ability_match, idle_match, ack_match; + + u32 txconfig, rxconfig; +#define ANEG_CFG_NP 0x00000080 +#define ANEG_CFG_ACK 0x00000040 +#define ANEG_CFG_RF2 0x00000020 +#define ANEG_CFG_RF1 0x00000010 +#define ANEG_CFG_PS2 0x00000001 +#define ANEG_CFG_PS1 0x00008000 +#define ANEG_CFG_HD 0x00004000 +#define ANEG_CFG_FD 0x00002000 +#define ANEG_CFG_INVAL 0x00001f06 + +}; +#define ANEG_OK 0 +#define ANEG_DONE 1 +#define ANEG_TIMER_ENAB 2 +#define ANEG_FAILED -1 + +#define ANEG_STATE_SETTLE_TIME 10000 + +static int tg3_fiber_aneg_smachine(struct tg3 *tp, + struct tg3_fiber_aneginfo *ap) +{ + unsigned long delta; + u32 rx_cfg_reg; + int ret; + + if (ap->state == ANEG_STATE_UNKNOWN) { + ap->rxconfig = 0; + ap->link_time = 0; + ap->cur_time = 0; + ap->ability_match_cfg = 0; + ap->ability_match_count = 0; + ap->ability_match = 0; + ap->idle_match = 0; + ap->ack_match = 0; + } + ap->cur_time++; + + if (tr32(MAC_STATUS) & MAC_STATUS_RCVD_CFG) { + rx_cfg_reg = tr32(MAC_RX_AUTO_NEG); + + if (rx_cfg_reg != ap->ability_match_cfg) { + ap->ability_match_cfg = rx_cfg_reg; + ap->ability_match = 0; + ap->ability_match_count = 0; + } else { + if (++ap->ability_match_count > 1) { + ap->ability_match = 1; + ap->ability_match_cfg = rx_cfg_reg; + } + } + if (rx_cfg_reg & ANEG_CFG_ACK) + ap->ack_match = 1; + else + ap->ack_match = 0; + + ap->idle_match = 0; + } else { + ap->idle_match = 1; + ap->ability_match_cfg = 0; + ap->ability_match_count = 0; + ap->ability_match = 0; + ap->ack_match = 0; + + rx_cfg_reg = 0; + } + + ap->rxconfig = rx_cfg_reg; + ret = ANEG_OK; + + switch(ap->state) { + case ANEG_STATE_UNKNOWN: + if (ap->flags & (MR_AN_ENABLE | MR_RESTART_AN)) + ap->state = ANEG_STATE_AN_ENABLE; + + /* fallthru */ + case ANEG_STATE_AN_ENABLE: + ap->flags &= ~(MR_AN_COMPLETE | MR_PAGE_RX); + if (ap->flags & MR_AN_ENABLE) { + ap->link_time = 0; + ap->cur_time = 0; + ap->ability_match_cfg = 0; + ap->ability_match_count = 0; + ap->ability_match = 0; + ap->idle_match = 0; + ap->ack_match = 0; + + ap->state = ANEG_STATE_RESTART_INIT; + } else { + ap->state = ANEG_STATE_DISABLE_LINK_OK; + } + break; + + case ANEG_STATE_RESTART_INIT: + ap->link_time = ap->cur_time; + ap->flags &= ~(MR_NP_LOADED); + ap->txconfig = 0; + tw32(MAC_TX_AUTO_NEG, 0); + tp->mac_mode |= MAC_MODE_SEND_CONFIGS; + tw32(MAC_MODE, tp->mac_mode); + ret = ANEG_TIMER_ENAB; + ap->state = ANEG_STATE_RESTART; + + /* fallthru */ + case ANEG_STATE_RESTART: + delta = ap->cur_time - ap->link_time; + if (delta > ANEG_STATE_SETTLE_TIME) { + ap->state = ANEG_STATE_ABILITY_DETECT_INIT; + } else { + ret = ANEG_TIMER_ENAB; + } + break; + + case ANEG_STATE_DISABLE_LINK_OK: + ret = ANEG_DONE; + break; + + case ANEG_STATE_ABILITY_DETECT_INIT: + ap->flags &= ~(MR_TOGGLE_TX); + ap->txconfig = (ANEG_CFG_FD | ANEG_CFG_PS1); + tw32(MAC_TX_AUTO_NEG, ap->txconfig); + tp->mac_mode |= MAC_MODE_SEND_CONFIGS; + tw32(MAC_MODE, tp->mac_mode); + + ap->state = ANEG_STATE_ABILITY_DETECT; + break; + + case ANEG_STATE_ABILITY_DETECT: + if (ap->ability_match != 0 && ap->rxconfig != 0) { + ap->state = ANEG_STATE_ACK_DETECT_INIT; + } + break; + + case ANEG_STATE_ACK_DETECT_INIT: + ap->txconfig |= ANEG_CFG_ACK; + tw32(MAC_TX_AUTO_NEG, ap->txconfig); + tp->mac_mode |= MAC_MODE_SEND_CONFIGS; + tw32(MAC_MODE, tp->mac_mode); + + ap->state = ANEG_STATE_ACK_DETECT; + + /* fallthru */ + case ANEG_STATE_ACK_DETECT: + if (ap->ack_match != 0) { + if ((ap->rxconfig & ~ANEG_CFG_ACK) == + (ap->ability_match_cfg & ~ANEG_CFG_ACK)) { + ap->state = ANEG_STATE_COMPLETE_ACK_INIT; + } else { + ap->state = ANEG_STATE_AN_ENABLE; + } + } else if (ap->ability_match != 0 && + ap->rxconfig == 0) { + ap->state = ANEG_STATE_AN_ENABLE; + } + break; + + case ANEG_STATE_COMPLETE_ACK_INIT: + if (ap->rxconfig & ANEG_CFG_INVAL) { + ret = ANEG_FAILED; + break; + } + ap->flags &= ~(MR_LP_ADV_FULL_DUPLEX | + MR_LP_ADV_HALF_DUPLEX | + MR_LP_ADV_SYM_PAUSE | + MR_LP_ADV_ASYM_PAUSE | + MR_LP_ADV_REMOTE_FAULT1 | + MR_LP_ADV_REMOTE_FAULT2 | + MR_LP_ADV_NEXT_PAGE | + MR_TOGGLE_RX | + MR_NP_RX); + if (ap->rxconfig & ANEG_CFG_FD) + ap->flags |= MR_LP_ADV_FULL_DUPLEX; + if (ap->rxconfig & ANEG_CFG_HD) + ap->flags |= MR_LP_ADV_HALF_DUPLEX; + if (ap->rxconfig & ANEG_CFG_PS1) + ap->flags |= MR_LP_ADV_SYM_PAUSE; + if (ap->rxconfig & ANEG_CFG_PS2) + ap->flags |= MR_LP_ADV_ASYM_PAUSE; + if (ap->rxconfig & ANEG_CFG_RF1) + ap->flags |= MR_LP_ADV_REMOTE_FAULT1; + if (ap->rxconfig & ANEG_CFG_RF2) + ap->flags |= MR_LP_ADV_REMOTE_FAULT2; + if (ap->rxconfig & ANEG_CFG_NP) + ap->flags |= MR_LP_ADV_NEXT_PAGE; + + ap->link_time = ap->cur_time; + + ap->flags ^= (MR_TOGGLE_TX); + if (ap->rxconfig & 0x0008) + ap->flags |= MR_TOGGLE_RX; + if (ap->rxconfig & ANEG_CFG_NP) + ap->flags |= MR_NP_RX; + ap->flags |= MR_PAGE_RX; + + ap->state = ANEG_STATE_COMPLETE_ACK; + ret = ANEG_TIMER_ENAB; + break; + + case ANEG_STATE_COMPLETE_ACK: + if (ap->ability_match != 0 && + ap->rxconfig == 0) { + ap->state = ANEG_STATE_AN_ENABLE; + break; + } + delta = ap->cur_time - ap->link_time; + if (delta > ANEG_STATE_SETTLE_TIME) { + if (!(ap->flags & (MR_LP_ADV_NEXT_PAGE))) { + ap->state = ANEG_STATE_IDLE_DETECT_INIT; + } else { + if ((ap->txconfig & ANEG_CFG_NP) == 0 && + !(ap->flags & MR_NP_RX)) { + ap->state = ANEG_STATE_IDLE_DETECT_INIT; + } else { + ret = ANEG_FAILED; + } + } + } + break; + + case ANEG_STATE_IDLE_DETECT_INIT: + ap->link_time = ap->cur_time; + tp->mac_mode &= ~MAC_MODE_SEND_CONFIGS; + tw32(MAC_MODE, tp->mac_mode); + + ap->state = ANEG_STATE_IDLE_DETECT; + ret = ANEG_TIMER_ENAB; + break; + + case ANEG_STATE_IDLE_DETECT: + if (ap->ability_match != 0 && + ap->rxconfig == 0) { + ap->state = ANEG_STATE_AN_ENABLE; + break; + } + delta = ap->cur_time - ap->link_time; + if (delta > ANEG_STATE_SETTLE_TIME) { + /* XXX another gem from the Broadcom driver :( */ + ap->state = ANEG_STATE_LINK_OK; + } + break; + + case ANEG_STATE_LINK_OK: + ap->flags |= (MR_AN_COMPLETE | MR_LINK_OK); + ret = ANEG_DONE; + break; + + case ANEG_STATE_NEXT_PAGE_WAIT_INIT: + /* ??? unimplemented */ + break; + + case ANEG_STATE_NEXT_PAGE_WAIT: + /* ??? unimplemented */ + break; + + default: + ret = ANEG_FAILED; + break; + }; + + return ret; +} + +static int tg3_setup_fiber_phy(struct tg3 *tp) +{ + u32 orig_pause_cfg; + u16 orig_active_speed; + u8 orig_active_duplex; + int current_link_up; + int i; + + orig_pause_cfg = + (tp->tg3_flags & (TG3_FLAG_RX_PAUSE | + TG3_FLAG_TX_PAUSE)); + orig_active_speed = tp->link_config.active_speed; + orig_active_duplex = tp->link_config.active_duplex; + + tp->mac_mode &= ~(MAC_MODE_PORT_MODE_MASK | MAC_MODE_HALF_DUPLEX); + tp->mac_mode |= MAC_MODE_PORT_MODE_TBI; + tw32(MAC_MODE, tp->mac_mode); + udelay(40); + + /* Reset when initting first time or we have a link. */ + if (!(tp->tg3_flags & TG3_FLAG_INIT_COMPLETE) || + (tr32(MAC_STATUS) & MAC_STATUS_PCS_SYNCED)) { + /* Set PLL lock range. */ + tg3_writephy(tp, 0x16, 0x8007); + + /* SW reset */ + tg3_writephy(tp, MII_BMCR, BMCR_RESET); + + /* Wait for reset to complete. */ + /* XXX schedule_timeout() ... */ + for (i = 0; i < 500; i++) + udelay(10); + + /* Config mode; select PMA/Ch 1 regs. */ + tg3_writephy(tp, 0x10, 0x8411); + + /* Enable auto-lock and comdet, select txclk for tx. */ + tg3_writephy(tp, 0x11, 0x0a10); + + tg3_writephy(tp, 0x18, 0x00a0); + tg3_writephy(tp, 0x16, 0x41ff); + + /* Assert and deassert POR. */ + tg3_writephy(tp, 0x13, 0x0400); + udelay(40); + tg3_writephy(tp, 0x13, 0x0000); + + tg3_writephy(tp, 0x11, 0x0a50); + udelay(40); + tg3_writephy(tp, 0x11, 0x0a10); + + /* Wait for signal to stabilize */ + /* XXX schedule_timeout() ... */ + for (i = 0; i < 15000; i++) + udelay(10); + + /* Deselect the channel register so we can read the PHYID + * later. + */ + tg3_writephy(tp, 0x10, 0x8011); + } + + /* Enable link change interrupt unless serdes polling. */ + if (!(tp->tg3_flags & TG3_FLAG_POLL_SERDES)) + tw32(MAC_EVENT, MAC_EVENT_LNKSTATE_CHANGED); + else + tw32(MAC_EVENT, 0); + + current_link_up = 0; + if (tr32(MAC_STATUS) & MAC_STATUS_PCS_SYNCED) { + if (tp->link_config.autoneg == AUTONEG_ENABLE && + !(tp->tg3_flags & TG3_FLAG_GOT_SERDES_FLOWCTL)) { + struct tg3_fiber_aneginfo aninfo; + int status = ANEG_FAILED; + unsigned int tick; + u32 tmp; + + memset(&aninfo, 0, sizeof(aninfo)); + aninfo.flags |= (MR_AN_ENABLE); + + tw32(MAC_TX_AUTO_NEG, 0); + + tmp = tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK; + tw32(MAC_MODE, tmp | MAC_MODE_PORT_MODE_GMII); + udelay(20); + + tw32(MAC_MODE, tp->mac_mode | MAC_MODE_SEND_CONFIGS); + + aninfo.state = ANEG_STATE_UNKNOWN; + aninfo.cur_time = 0; + tick = 0; + while (++tick < 195000) { + status = tg3_fiber_aneg_smachine(tp, &aninfo); + if (status == ANEG_DONE || + status == ANEG_FAILED) + break; + + udelay(1); + } + + tp->mac_mode &= ~MAC_MODE_SEND_CONFIGS; + tw32(MAC_MODE, tp->mac_mode); + + if (status == ANEG_DONE && + (aninfo.flags & + (MR_AN_COMPLETE | MR_LINK_OK | + MR_LP_ADV_FULL_DUPLEX))) { + u32 local_adv, remote_adv; + + local_adv = ADVERTISE_PAUSE_CAP; + remote_adv = 0; + if (aninfo.flags & MR_LP_ADV_SYM_PAUSE) + remote_adv |= LPA_PAUSE_CAP; + if (aninfo.flags & MR_LP_ADV_ASYM_PAUSE) + remote_adv |= LPA_PAUSE_ASYM; + + tg3_setup_flow_control(tp, local_adv, remote_adv); + + tp->tg3_flags |= + TG3_FLAG_GOT_SERDES_FLOWCTL; + current_link_up = 1; + } + for (i = 0; i < 60; i++) { + udelay(20); + tw32(MAC_STATUS, + (MAC_STATUS_SYNC_CHANGED | + MAC_STATUS_CFG_CHANGED)); + + udelay(20); + if ((tr32(MAC_STATUS) & + (MAC_STATUS_SYNC_CHANGED | + MAC_STATUS_CFG_CHANGED)) == 0) + break; + } + if (current_link_up == 0 && + (tr32(MAC_STATUS) & MAC_STATUS_PCS_SYNCED)) { + current_link_up = 1; + } + } else { + /* Forcing 1000FD link up. */ + current_link_up = 1; + } + } + + tp->mac_mode &= ~MAC_MODE_LINK_POLARITY; + tw32(MAC_MODE, tp->mac_mode); + + tp->hw_status->status = + (SD_STATUS_UPDATED | + (tp->hw_status->status & ~SD_STATUS_LINK_CHG)); + + for (i = 0; i < 100; i++) { + udelay(20); + tw32(MAC_STATUS, + (MAC_STATUS_SYNC_CHANGED | + MAC_STATUS_CFG_CHANGED)); + + udelay(20); + if ((tr32(MAC_STATUS) & + (MAC_STATUS_SYNC_CHANGED | + MAC_STATUS_CFG_CHANGED)) == 0) + break; + } + + if ((tr32(MAC_STATUS) & MAC_STATUS_PCS_SYNCED) == 0) + current_link_up = 0; + + if (current_link_up == 1) { + tp->link_config.active_speed = SPEED_1000; + tp->link_config.active_duplex = DUPLEX_FULL; + } else { + tp->link_config.active_speed = SPEED_INVALID; + tp->link_config.active_duplex = DUPLEX_INVALID; + } + + if (current_link_up != netif_carrier_ok(tp->dev)) { + if (current_link_up) + netif_carrier_on(tp->dev); + else + netif_carrier_off(tp->dev); + tg3_link_report(tp); + } else { + u32 now_pause_cfg = + tp->tg3_flags & (TG3_FLAG_RX_PAUSE | + TG3_FLAG_TX_PAUSE); + if (orig_pause_cfg != now_pause_cfg || + orig_active_speed != tp->link_config.active_speed || + orig_active_duplex != tp->link_config.active_duplex) + tg3_link_report(tp); + } + + if ((tr32(MAC_STATUS) & MAC_STATUS_PCS_SYNCED) == 0) { + tw32(MAC_MODE, tp->mac_mode | MAC_MODE_LINK_POLARITY); + if (tp->tg3_flags & TG3_FLAG_INIT_COMPLETE) { + udelay(1); + tw32(MAC_MODE, tp->mac_mode); + } + } + + return 0; +} + +static int tg3_setup_phy(struct tg3 *tp) +{ + int err; + + if (tp->phy_id == PHY_ID_SERDES) { + err = tg3_setup_fiber_phy(tp); + } else { + err = tg3_setup_copper_phy(tp); + } + + if (tp->link_config.active_speed == SPEED_1000 && + tp->link_config.active_duplex == DUPLEX_HALF) + tw32(MAC_TX_LENGTHS, + ((2 << TX_LENGTHS_IPG_CRS_SHIFT) | + (6 << TX_LENGTHS_IPG_SHIFT) | + (0xff << TX_LENGTHS_SLOT_TIME_SHIFT))); + else + tw32(MAC_TX_LENGTHS, + ((2 << TX_LENGTHS_IPG_CRS_SHIFT) | + (6 << TX_LENGTHS_IPG_SHIFT) | + (32 << TX_LENGTHS_SLOT_TIME_SHIFT))); + + return err; +} + +/* Tigon3 never reports partial packet sends. So we do not + * need special logic to handle SKBs that have not had all + * of their frags sent yet, like SunGEM does. + */ +static void tg3_tx(struct tg3 *tp) +{ + u32 hw_idx = tp->hw_status->idx[0].tx_consumer; + u32 sw_idx = tp->tx_cons; + + while (sw_idx != hw_idx) { + struct ring_info *ri = &tp->tx_buffers[sw_idx]; + struct sk_buff *skb = ri->skb; + int i; + + if (unlikely(skb == NULL)) + BUG(); + + pci_unmap_single(tp->pdev, + pci_unmap_addr(ri, mapping), + (skb->len - skb->data_len), + PCI_DMA_TODEVICE); + + ri->skb = NULL; + + sw_idx = NEXT_TX(sw_idx); + + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { + if (unlikely(sw_idx == hw_idx)) + BUG(); + + ri = &tp->tx_buffers[sw_idx]; + if (unlikely(ri->skb != NULL)) + BUG(); + + pci_unmap_page(tp->pdev, + pci_unmap_addr(ri, mapping), + skb_shinfo(skb)->frags[i].size, + PCI_DMA_TODEVICE); + + sw_idx = NEXT_TX(sw_idx); + } + + dev_kfree_skb_irq(skb); + } + + tp->tx_cons = sw_idx; + + if (netif_queue_stopped(tp->dev) && + (TX_BUFFS_AVAIL(tp) > TG3_TX_WAKEUP_THRESH)) + netif_wake_queue(tp->dev); +} + +/* Returns size of skb allocated or < 0 on error. + * + * We only need to fill in the address because the other members + * of the RX descriptor are invariant, see tg3_init_rings. + * + * Note the purposeful assymetry of cpu vs. chip accesses. For + * posting buffers we only dirty the first cache line of the RX + * descriptor (containing the address). Whereas for the RX status + * buffers the cpu only reads the last cacheline of the RX descriptor + * (to fetch the error flags, vlan tag, checksum, and opaque cookie). + */ +static int tg3_alloc_rx_skb(struct tg3 *tp, u32 opaque_key, + int src_idx, u32 dest_idx_unmasked) +{ + struct tg3_rx_buffer_desc *desc; + struct ring_info *map, *src_map; + struct sk_buff *skb; + dma_addr_t mapping; + int skb_size, dest_idx; + + src_map = NULL; + switch (opaque_key) { + case RXD_OPAQUE_RING_STD: + dest_idx = dest_idx_unmasked % TG3_RX_RING_SIZE; + desc = &tp->rx_std[dest_idx]; + map = &tp->rx_std_buffers[dest_idx]; + if (src_idx >= 0) + src_map = &tp->rx_std_buffers[src_idx]; + skb_size = RX_PKT_BUF_SZ; + break; + + case RXD_OPAQUE_RING_JUMBO: + dest_idx = dest_idx_unmasked % TG3_RX_JUMBO_RING_SIZE; + desc = &tp->rx_jumbo[dest_idx]; + map = &tp->rx_jumbo_buffers[dest_idx]; + if (src_idx >= 0) + src_map = &tp->rx_jumbo_buffers[src_idx]; + skb_size = RX_JUMBO_PKT_BUF_SZ; + break; +#if TG3_MINI_RING_WORKS + case RXD_OPAQUE_RING_MINI: + dest_idx = dest_idx_unmasked % TG3_RX_MINI_RING_SIZE; + desc = &tp->rx_mini[dest_idx]; + map = &tp->rx_mini_buffers[dest_idx]; + if (src_idx >= 0) + src_map = &tp->rx_mini_buffers[src_idx]; + skb_size = RX_MINI_PKT_BUF_SZ; + break; +#endif + default: + return -EINVAL; + }; + + /* Do not overwrite any of the map or rp information + * until we are sure we can commit to a new buffer. + * + * Callers depend upon this behavior and assume that + * we leave everything unchanged if we fail. + */ + skb = dev_alloc_skb(skb_size); + if (skb == NULL) + return -ENOMEM; + + skb->dev = tp->dev; + skb_reserve(skb, tp->rx_offset); + + mapping = pci_map_single(tp->pdev, skb->data, + skb_size - tp->rx_offset, + PCI_DMA_FROMDEVICE); + + map->skb = skb; + pci_unmap_addr_set(map, mapping, mapping); + + if (src_map != NULL) + src_map->skb = NULL; + + desc->addr_hi = ((u64)mapping >> 32); + desc->addr_lo = ((u64)mapping & 0xffffffff); + + return skb_size; +} + +/* We only need to move over in the address because the other + * members of the RX descriptor are invariant. See notes above + * tg3_alloc_rx_skb for full details. + */ +static void tg3_recycle_rx(struct tg3 *tp, u32 opaque_key, + int src_idx, u32 dest_idx_unmasked) +{ + struct tg3_rx_buffer_desc *src_desc, *dest_desc; + struct ring_info *src_map, *dest_map; + int dest_idx; + + switch (opaque_key) { + case RXD_OPAQUE_RING_STD: + dest_idx = dest_idx_unmasked % TG3_RX_RING_SIZE; + dest_desc = &tp->rx_std[dest_idx]; + dest_map = &tp->rx_std_buffers[dest_idx]; + src_desc = &tp->rx_std[src_idx]; + src_map = &tp->rx_std_buffers[src_idx]; + break; + + case RXD_OPAQUE_RING_JUMBO: + dest_idx = dest_idx_unmasked % TG3_RX_JUMBO_RING_SIZE; + dest_desc = &tp->rx_jumbo[dest_idx]; + dest_map = &tp->rx_jumbo_buffers[dest_idx]; + src_desc = &tp->rx_jumbo[src_idx]; + src_map = &tp->rx_jumbo_buffers[src_idx]; + break; +#if TG3_MINI_RING_WORKS + case RXD_OPAQUE_RING_MINI: + dest_idx = dest_idx_unmasked % TG3_RX_MINI_RING_SIZE; + dest_desc = &tp->rx_mini[dest_idx]; + dest_map = &tp->rx_mini_buffers[dest_idx]; + src_desc = &tp->rx_mini[src_idx]; + src_map = &tp->rx_mini_buffers[src_idx]; + break; +#endif + default: + return; + }; + + dest_map->skb = src_map->skb; + pci_unmap_addr_set(dest_map, mapping, + pci_unmap_addr(src_map, mapping)); + dest_desc->addr_hi = src_desc->addr_hi; + dest_desc->addr_lo = src_desc->addr_lo; + + src_map->skb = NULL; +} + +#if TG3_VLAN_TAG_USED +static int tg3_vlan_rx(struct tg3 *tp, struct sk_buff *skb, u16 vlan_tag) +{ + return vlan_hwaccel_rx(skb, tp->vlgrp, vlan_tag); +} +#endif + +/* The RX ring scheme is composed of multiple rings which post fresh + * buffers to the chip, and one special ring the chip uses to report + * status back to the host. + * + * The special ring reports the status of received packets to the + * host. The chip does not write into the original descriptor the + * RX buffer was obtained from. The chip simply takes the original + * descriptor as provided by the host, updates the status and length + * field, then writes this into the next status ring entry. + * + * Each ring the host uses to post buffers to the chip is described + * by a TG3_BDINFO entry in the chips SRAM area. When a packet arrives, + * it is first placed into the on-chip ram. When the packet's length + * is known, it walks down the TG3_BDINFO entries to select the ring. + * Each TG3_BDINFO specifies a MAXLEN field and the first TG3_BDINFO + * which is within the range of the new packet's length is chosen. + * + * The "seperate ring for rx status" scheme may sound queer, but it makes + * sense from a cache coherency perspective. If only the host writes + * to the buffer post rings, and only the chip writes to the rx status + * rings, then cache lines never move beyond shared-modified state. + * If both the host and chip were to write into the same ring, cache line + * eviction could occur since both entities want it in an exclusive state. + */ +static void tg3_rx(struct tg3 *tp) +{ + u32 work_mask; + u32 rx_rcb_ptr = tp->rx_rcb_ptr; + u16 hw_idx, sw_idx; + + hw_idx = tp->hw_status->idx[0].rx_producer; + sw_idx = rx_rcb_ptr % TG3_RX_RCB_RING_SIZE; + work_mask = 0; + while (sw_idx != hw_idx) { + struct tg3_rx_buffer_desc *desc = &tp->rx_rcb[sw_idx]; + unsigned int len; + struct sk_buff *skb; + dma_addr_t dma_addr; + u32 opaque_key, desc_idx, *post_ptr; + + desc_idx = desc->opaque & RXD_OPAQUE_INDEX_MASK; + opaque_key = desc->opaque & RXD_OPAQUE_RING_MASK; + if (opaque_key == RXD_OPAQUE_RING_STD) { + dma_addr = pci_unmap_addr(&tp->rx_std_buffers[desc_idx], + mapping); + skb = tp->rx_std_buffers[desc_idx].skb; + post_ptr = &tp->rx_std_ptr; + } else if (opaque_key == RXD_OPAQUE_RING_JUMBO) { + dma_addr = pci_unmap_addr(&tp->rx_jumbo_buffers[desc_idx], + mapping); + skb = tp->rx_jumbo_buffers[desc_idx].skb; + post_ptr = &tp->rx_jumbo_ptr; + } +#if TG3_MINI_RING_WORKS + else if (opaque_key == RXD_OPAQUE_RING_MINI) { + dma_addr = pci_unmap_addr(&tp->rx_mini_buffers[desc_idx], + mapping); + skb = tp->rx_mini_buffers[desc_idx].skb; + post_ptr = &tp->rx_mini_ptr; + } +#endif + else { + goto next_pkt_nopost; + } + + work_mask |= opaque_key; + + if ((desc->err_vlan & RXD_ERR_MASK) != 0 && + (desc->err_vlan != RXD_ERR_ODD_NIBBLE_RCVD_MII)) { + drop_it: + tg3_recycle_rx(tp, opaque_key, + desc_idx, *post_ptr); + drop_it_no_recycle: + /* Other statistics kept track of by card. */ + tp->net_stats.rx_dropped++; + goto next_pkt; + } + + len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */ + + /* Kill the copy case if we ever get the mini ring working. */ + if (len > RX_COPY_THRESHOLD) { + int skb_size; + + skb_size = tg3_alloc_rx_skb(tp, opaque_key, + desc_idx, *post_ptr); + if (skb_size < 0) + goto drop_it; + + pci_unmap_single(tp->pdev, dma_addr, + skb_size - tp->rx_offset, + PCI_DMA_FROMDEVICE); + + skb_put(skb, len); + } else { + struct sk_buff *copy_skb; + + tg3_recycle_rx(tp, opaque_key, + desc_idx, *post_ptr); + + copy_skb = dev_alloc_skb(len + 2); + if (copy_skb == NULL) + goto drop_it_no_recycle; + + copy_skb->dev = tp->dev; + skb_reserve(copy_skb, 2); + skb_put(copy_skb, len); + pci_dma_sync_single(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); + memcpy(copy_skb->data, skb->data, len); + + /* We'll reuse the original ring buffer. */ + skb = copy_skb; + } + + if ((tp->tg3_flags & TG3_FLAG_RX_CHECKSUMS) && + (desc->type_flags & RXD_FLAG_TCPUDP_CSUM)) { + skb->csum = htons((desc->ip_tcp_csum & RXD_TCPCSUM_MASK) + >> RXD_TCPCSUM_SHIFT); + skb->ip_summed = CHECKSUM_HW; + } else { + skb->ip_summed = CHECKSUM_NONE; + } + + skb->protocol = eth_type_trans(skb, tp->dev); +#if TG3_VLAN_TAG_USED + if (tp->vlgrp != NULL && + desc->type_flags & RXD_FLAG_VLAN) { + tg3_vlan_rx(tp, skb, + desc->err_vlan & RXD_VLAN_MASK); + } else +#endif + netif_rx(skb); + + tp->dev->last_rx = jiffies; + +next_pkt: + (*post_ptr)++; +next_pkt_nopost: + rx_rcb_ptr++; + sw_idx = rx_rcb_ptr % TG3_RX_RCB_RING_SIZE; + } + + /* ACK the status ring. */ + tp->rx_rcb_ptr = rx_rcb_ptr; + tw32_mailbox(MAILBOX_RCVRET_CON_IDX_0 + TG3_64BIT_REG_LOW, + (rx_rcb_ptr % TG3_RX_RCB_RING_SIZE)); + + /* Refill RX ring(s). */ + if (work_mask & RXD_OPAQUE_RING_STD) { + sw_idx = tp->rx_std_ptr % TG3_RX_RING_SIZE; + tw32_mailbox(MAILBOX_RCV_STD_PROD_IDX + TG3_64BIT_REG_LOW, + sw_idx); + } + if (work_mask & RXD_OPAQUE_RING_JUMBO) { + sw_idx = tp->rx_jumbo_ptr % TG3_RX_JUMBO_RING_SIZE; + tw32_mailbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW, + sw_idx); + } +#if TG3_MINI_RING_WORKS + if (work_mask & RXD_OPAQUE_RING_MINI) { + sw_idx = tp->rx_mini_ptr % TG3_RX_MINI_RING_SIZE; + tw32_mailbox(MAILBOX_RCV_MINI_PROD_IDX + TG3_64BIT_REG_LOW, + sw_idx); + } +#endif +} + +#define PKT_RATE_LOW 22000 +#define PKT_RATE_HIGH 61000 + +static void tg3_rate_sample(struct tg3 *tp, unsigned long ticks) +{ + u32 delta, rx_now, tx_now; + int new_vals, do_tx, do_rx; + + rx_now = tp->hw_stats->rx_ucast_packets.low; + tx_now = tp->hw_stats->COS_out_packets[0].low; + + delta = (rx_now - tp->last_rx_count); + delta += (tx_now - tp->last_tx_count); + delta /= (ticks / tp->coalesce_config.rate_sample_jiffies); + + tp->last_rx_count = rx_now; + tp->last_tx_count = tx_now; + + new_vals = 0; + do_tx = (tp->tg3_flags & TG3_FLAG_ADAPTIVE_TX) != 0; + do_rx = (tp->tg3_flags & TG3_FLAG_ADAPTIVE_RX) != 0; + if (delta < tp->coalesce_config.pkt_rate_low) { + if (do_rx && + tp->coalesce_config.rx_max_coalesced_frames != + tp->coalesce_config.rx_max_coalesced_frames_low) { + tp->coalesce_config.rx_max_coalesced_frames = + LOW_RXMAX_FRAMES; + tp->coalesce_config.rx_coalesce_ticks = + LOW_RXCOL_TICKS; + new_vals = 1; + } + if (do_tx && + tp->coalesce_config.tx_max_coalesced_frames != + tp->coalesce_config.tx_max_coalesced_frames_low) { + tp->coalesce_config.tx_max_coalesced_frames = + tp->coalesce_config.tx_max_coalesced_frames_low; + tp->coalesce_config.tx_coalesce_ticks = + tp->coalesce_config.tx_coalesce_ticks_low; + new_vals = 1; + } + } else if (delta < tp->coalesce_config.pkt_rate_high) { + if (do_rx && + tp->coalesce_config.rx_max_coalesced_frames != + tp->coalesce_config.rx_max_coalesced_frames_def) { + tp->coalesce_config.rx_max_coalesced_frames = + tp->coalesce_config.rx_max_coalesced_frames_def; + tp->coalesce_config.rx_coalesce_ticks = + tp->coalesce_config.rx_coalesce_ticks_def; + new_vals = 1; + } + if (do_tx && + tp->coalesce_config.tx_max_coalesced_frames != + tp->coalesce_config.tx_max_coalesced_frames_def) { + tp->coalesce_config.tx_max_coalesced_frames = + tp->coalesce_config.tx_max_coalesced_frames_def; + tp->coalesce_config.tx_coalesce_ticks = + tp->coalesce_config.tx_coalesce_ticks_def; + new_vals = 1; + } + } else { + if (do_rx && + tp->coalesce_config.rx_max_coalesced_frames != + tp->coalesce_config.rx_max_coalesced_frames_high) { + tp->coalesce_config.rx_max_coalesced_frames = + tp->coalesce_config.rx_max_coalesced_frames_high; + tp->coalesce_config.rx_coalesce_ticks = + tp->coalesce_config.rx_coalesce_ticks_high; + new_vals = 1; + } + if (do_tx && + tp->coalesce_config.tx_max_coalesced_frames != + tp->coalesce_config.tx_max_coalesced_frames_high) { + tp->coalesce_config.tx_max_coalesced_frames = + tp->coalesce_config.tx_max_coalesced_frames_high; + tp->coalesce_config.tx_coalesce_ticks = + tp->coalesce_config.tx_coalesce_ticks_high; + new_vals = 1; + } + } + + if (new_vals) { + if (do_rx) { + tw32(HOSTCC_RXCOL_TICKS, + tp->coalesce_config.rx_coalesce_ticks); + tw32(HOSTCC_RXMAX_FRAMES, + tp->coalesce_config.rx_max_coalesced_frames); + } + if (do_tx) { + tw32(HOSTCC_TXCOL_TICKS, + tp->coalesce_config.tx_coalesce_ticks); + tw32(HOSTCC_TXMAX_FRAMES, + tp->coalesce_config.tx_max_coalesced_frames); + } + } + + tp->last_rate_sample = jiffies; +} + +static void tg3_interrupt_main_work(struct tg3 *tp) +{ + struct tg3_hw_status *sblk = tp->hw_status; + int did_pkts; + + if (!(tp->tg3_flags & + (TG3_FLAG_USE_LINKCHG_REG | + TG3_FLAG_POLL_SERDES))) { + if (sblk->status & SD_STATUS_LINK_CHG) { + sblk->status = SD_STATUS_UPDATED | + (sblk->status & ~SD_STATUS_LINK_CHG); + tg3_setup_phy(tp); + } + } + + did_pkts = 0; + if (sblk->idx[0].rx_producer != tp->rx_rcb_ptr) { + tg3_rx(tp); + did_pkts = 1; + } + + if (sblk->idx[0].tx_consumer != tp->tx_cons) { + tg3_tx(tp); + did_pkts = 1; + } + + if (did_pkts && + (tp->tg3_flags & (TG3_FLAG_ADAPTIVE_RX | TG3_FLAG_ADAPTIVE_TX))) { + unsigned long ticks = jiffies - tp->last_rate_sample; + + if (ticks >= tp->coalesce_config.rate_sample_jiffies) + tg3_rate_sample(tp, ticks); + } +} + +static void tg3_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + struct net_device *dev = dev_id; + struct tg3 *tp = dev->priv; + struct tg3_hw_status *sblk = tp->hw_status; + + spin_lock(&tp->lock); + + while (sblk->status & SD_STATUS_UPDATED) { + tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, + 0x00000001); + sblk->status &= ~SD_STATUS_UPDATED; + + tg3_interrupt_main_work(tp); + + tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, + 0x00000000); + tr32(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW); + } + + spin_unlock(&tp->lock); +} + +static void tg3_interrupt_tagged(int irq, void *dev_id, struct pt_regs *regs) +{ + struct net_device *dev = dev_id; + struct tg3 *tp = dev->priv; + struct tg3_hw_status *sblk = tp->hw_status; + + spin_lock(&tp->lock); + + if (sblk->status & SD_STATUS_UPDATED) { + u32 oldtag; + + tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, + 0x00000001); + oldtag = sblk->status_tag; + + while (1) { + u32 newtag; + + sblk->status &= ~SD_STATUS_UPDATED; + barrier(); + + tg3_interrupt_main_work(tp); + + newtag = sblk->status_tag; + if (newtag == oldtag) { + tw32_mailbox(MAILBOX_INTERRUPT_0 + + TG3_64BIT_REG_LOW, + newtag << 24); + break; + } + oldtag = newtag; + } + } + + spin_unlock(&tp->lock); +} + +static void tg3_init_rings(struct tg3 *); +static int tg3_init_hw(struct tg3 *); + +static void tg3_tx_timeout(struct net_device *dev) +{ + struct tg3 *tp = dev->priv; + + printk(KERN_ERR "%s: transmit timed out, resetting\n", + dev->name); + + spin_lock_irq(&tp->lock); + + tg3_halt(tp); + tg3_init_rings(tp); + tg3_init_hw(tp); + + spin_unlock_irq(&tp->lock); + + netif_wake_queue(dev); +} + +#if !PCI_DMA_BUS_IS_PHYS +static void tg3_set_txd_addr(struct tg3 *tp, int entry, dma_addr_t mapping) +{ + if (tp->tg3_flags & TG3_FLAG_HOST_TXDS) { + struct tg3_tx_buffer_desc *txd = &tp->tx_ring[entry]; + + txd->addr_hi = ((u64) mapping >> 32); + txd->addr_lo = ((u64) mapping & 0xffffffff); + } else { + unsigned long txd; + + txd = (tp->regs + + NIC_SRAM_WIN_BASE + + NIC_SRAM_TX_BUFFER_DESC); + txd += (entry * TXD_SIZE); + + if (sizeof(dma_addr_t) != sizeof(u32)) + writel(((u64) mapping >> 32), + txd + TXD_ADDR + TG3_64BIT_REG_HIGH); + + writel(((u64) mapping & 0xffffffff), + txd + TXD_ADDR + TG3_64BIT_REG_LOW); + } +} +#endif + +static void tg3_set_txd(struct tg3 *, int, dma_addr_t, int, u32, int); + +static int tigon3_4gb_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, + u32 guilty_entry, int guilty_len, + u32 last_plus_one, u32 *start) +{ + dma_addr_t new_addr; + u32 entry = *start; + int i; + +#if !PCI_DMA_BUS_IS_PHYS + /* IOMMU, just map the guilty area again which is guarenteed to + * use different addresses. + */ + + i = 0; + while (entry != guilty_entry) { + entry = NEXT_TX(entry); + i++; + } + if (i == 0) { + new_addr = pci_map_single(tp->pdev, skb->data, guilty_len, + PCI_DMA_TODEVICE); + } else { + skb_frag_t *frag = &skb_shinfo(skb)->frags[i - 1]; + + new_addr = pci_map_page(tp->pdev, + frag->page, frag->page_offset, + guilty_len, PCI_DMA_TODEVICE); + } + pci_unmap_single(tp->pdev, pci_unmap_addr(&tp->tx_buffers[guilty_entry], + mapping), + guilty_len, PCI_DMA_TODEVICE); + tg3_set_txd_addr(tp, guilty_entry, new_addr); + pci_unmap_addr_set(&tp->tx_buffers[guilty_entry], mapping, + new_addr); + *start = last_plus_one; +#else + /* Oh well, no IOMMU, have to allocate a whole new SKB. */ + struct sk_buff *new_skb = skb_copy(skb, GFP_ATOMIC); + + if (!new_skb) { + dev_kfree_skb(skb); + return -1; + } + + /* NOTE: Broadcom's driver botches this case up really bad. + * This is especially true if any of the frag pages + * are in highmem. It will instantly oops in that case. + */ + + /* New SKB is guarenteed to be linear. */ + entry = *start; + new_addr = pci_map_single(tp->pdev, new_skb->data, new_skb->len, + PCI_DMA_TODEVICE); + tg3_set_txd(tp, entry, new_addr, new_skb->len, + (skb->ip_summed == CHECKSUM_HW) ? + TXD_FLAG_TCPUDP_CSUM : 0, 1); + *start = NEXT_TX(entry); + + /* Now clean up the sw ring entries. */ + i = 0; + while (entry != last_plus_one) { + int len; + + if (i == 0) + len = skb->len - skb->data_len; + else + len = skb_shinfo(skb)->frags[i-1].size; + pci_unmap_single(tp->pdev, + pci_unmap_addr(&tp->tx_buffers[entry], mapping), + len, PCI_DMA_TODEVICE); + if (i == 0) { + tp->tx_buffers[entry].skb = new_skb; + pci_unmap_addr_set(&tp->tx_buffers[entry], mapping, new_addr); + } else { + tp->tx_buffers[entry].skb = NULL; + } + entry = NEXT_TX(entry); + } + + dev_kfree_skb(skb); +#endif + + return 0; +} + +static void tg3_set_txd(struct tg3 *tp, int entry, + dma_addr_t mapping, int len, u32 flags, + int is_end) +{ +#if TG3_VLAN_TAG_USED + u16 vlan_tag = 0; +#endif + + if (is_end) + flags |= TXD_FLAG_END; +#if TG3_VLAN_TAG_USED + if (flags & TXD_FLAG_VLAN) { + vlan_tag = flags >> 16; + flags &= 0xffff; + } +#endif + if (tp->tg3_flags & TG3_FLAG_HOST_TXDS) { + struct tg3_tx_buffer_desc *txd = &tp->tx_ring[entry]; + + txd->addr_hi = ((u64) mapping >> 32); + txd->addr_lo = ((u64) mapping & 0xffffffff); + txd->len_flags = (len << TXD_LEN_SHIFT) | flags; +#if TG3_VLAN_TAG_USED + txd->vlan_tag = vlan_tag << TXD_VLAN_TAG_SHIFT; +#endif + } else { + unsigned long txd; + + txd = (tp->regs + + NIC_SRAM_WIN_BASE + + NIC_SRAM_TX_BUFFER_DESC); + txd += (entry * TXD_SIZE); + + /* Save some PIOs */ + if (sizeof(dma_addr_t) != sizeof(u32)) + writel(((u64) mapping >> 32), + txd + TXD_ADDR + TG3_64BIT_REG_HIGH); + + writel(((u64) mapping & 0xffffffff), + txd + TXD_ADDR + TG3_64BIT_REG_LOW); + writel(len << TXD_LEN_SHIFT | flags, txd + TXD_LEN_FLAGS); +#if TG3_VLAN_TAG_USED + writel(vlan_tag << TXD_VLAN_TAG_SHIFT, txd + TXD_VLAN_TAG); +#endif + } +} + +static inline int tg3_4g_overflow_test(dma_addr_t mapping, int len) +{ + u32 base = (u32) mapping & 0xffffffff; + + return ((base > 0xffffdcc0) && + ((u64) mapping >> 32) == 0 && + (base + len + 8 < base)); +} + +static int tg3_start_xmit_4gbug(struct sk_buff *skb, struct net_device *dev) +{ + struct tg3 *tp = dev->priv; + dma_addr_t mapping; + unsigned int i; + u32 len, entry, base_flags; + int would_hit_hwbug; + + len = (skb->len - skb->data_len); + + spin_lock_irq(&tp->lock); + + /* This is a hard error, log it. */ + if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) { + netif_stop_queue(dev); + spin_unlock_irq(&tp->lock); + printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", + dev->name); + return 1; + } + + entry = tp->tx_prod; + base_flags = 0; + if (skb->ip_summed == CHECKSUM_HW) + base_flags |= TXD_FLAG_TCPUDP_CSUM; +#if TG3_VLAN_TAG_USED + if (tp->vlgrp != NULL && vlan_tx_tag_present(skb)) + base_flags |= (TXD_FLAG_VLAN | + (vlan_tx_tag_get(skb) << 16)); +#endif + + /* Queue skb data, a.k.a. the main skb fragment. */ + mapping = pci_map_single(tp->pdev, skb->data, len, PCI_DMA_TODEVICE); + + tp->tx_buffers[entry].skb = skb; + pci_unmap_addr_set(&tp->tx_buffers[entry], mapping, mapping); + + would_hit_hwbug = 0; + + if (tg3_4g_overflow_test(mapping, len)) + would_hit_hwbug = entry + 1; + + tg3_set_txd(tp, entry, mapping, len, base_flags, + (skb_shinfo(skb)->nr_frags == 0)); + + entry = NEXT_TX(entry); + + /* Now loop through additional data fragments, and queue them. */ + if (skb_shinfo(skb)->nr_frags > 0) { + unsigned int i, last; + + last = skb_shinfo(skb)->nr_frags - 1; + for (i = 0; i <= last; i++) { + skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; + + len = frag->size; + mapping = pci_map_page(tp->pdev, + frag->page, + frag->page_offset, + len, PCI_DMA_TODEVICE); + + tp->tx_buffers[entry].skb = NULL; + pci_unmap_addr_set(&tp->tx_buffers[entry], mapping, mapping); + + if (tg3_4g_overflow_test(mapping, len)) { + /* Only one should match. */ + if (would_hit_hwbug) + BUG(); + would_hit_hwbug = entry + 1; + } + + tg3_set_txd(tp, entry, mapping, len, + base_flags, (i == last)); + + entry = NEXT_TX(entry); + } + } + + if (would_hit_hwbug) { + u32 last_plus_one = entry; + u32 start; + unsigned int len = 0; + + would_hit_hwbug -= 1; + entry = entry - 1 - skb_shinfo(skb)->nr_frags; + entry &= (TG3_TX_RING_SIZE - 1); + start = entry; + i = 0; + while (entry != last_plus_one) { + if (i == 0) + len = skb->len - skb->data_len; + else + len = skb_shinfo(skb)->frags[i-1].size; + + if (entry == would_hit_hwbug) + break; + + i++; + entry = NEXT_TX(entry); + + } + + /* If the workaround fails due to memory/mapping + * failure, silently drop this packet. + */ + if (tigon3_4gb_hwbug_workaround(tp, skb, + entry, len, + last_plus_one, + &start)) + goto out_unlock; + + entry = start; + } + + /* Packets are ready, update Tx producer idx local and on card. */ + if (tp->tg3_flags & TG3_FLAG_HOST_TXDS) { + tw32_mailbox((MAILBOX_SNDHOST_PROD_IDX_0 + + TG3_64BIT_REG_LOW), entry); + if (tp->tg3_flags & TG3_FLAG_TXD_MBOX_HWBUG) + tw32_mailbox((MAILBOX_SNDHOST_PROD_IDX_0 + + TG3_64BIT_REG_LOW), entry); + } else { + tw32_mailbox((MAILBOX_SNDNIC_PROD_IDX_0 + + TG3_64BIT_REG_LOW), entry); + if (tp->tg3_flags & TG3_FLAG_TXD_MBOX_HWBUG) + tw32_mailbox((MAILBOX_SNDNIC_PROD_IDX_0 + + TG3_64BIT_REG_LOW), entry); + } + + tp->tx_prod = entry; + if (TX_BUFFS_AVAIL(tp) <= (MAX_SKB_FRAGS + 1)) + netif_stop_queue(dev); + +out_unlock: + spin_unlock_irq(&tp->lock); + + dev->trans_start = jiffies; + + return 0; +} + +static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) +{ + struct tg3 *tp = dev->priv; + dma_addr_t mapping; + u32 len, entry, base_flags; + + len = (skb->len - skb->data_len); + + spin_lock_irq(&tp->lock); + + /* This is a hard error, log it. */ + if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) { + netif_stop_queue(dev); + spin_unlock_irq(&tp->lock); + printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", + dev->name); + return 1; + } + + entry = tp->tx_prod; + base_flags = 0; + if (skb->ip_summed == CHECKSUM_HW) + base_flags |= TXD_FLAG_TCPUDP_CSUM; +#if TG3_VLAN_TAG_USED + if (tp->vlgrp != NULL && vlan_tx_tag_present(skb)) + base_flags |= (TXD_FLAG_VLAN | + (vlan_tx_tag_get(skb) << 16)); +#endif + + /* Queue skb data, a.k.a. the main skb fragment. */ + mapping = pci_map_single(tp->pdev, skb->data, len, PCI_DMA_TODEVICE); + + tp->tx_buffers[entry].skb = skb; + pci_unmap_addr_set(&tp->tx_buffers[entry], mapping, mapping); + + tg3_set_txd(tp, entry, mapping, len, base_flags, + (skb_shinfo(skb)->nr_frags == 0)); + + entry = NEXT_TX(entry); + + /* Now loop through additional data fragments, and queue them. */ + if (skb_shinfo(skb)->nr_frags > 0) { + unsigned int i, last; + + last = skb_shinfo(skb)->nr_frags - 1; + for (i = 0; i <= last; i++) { + skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; + + + len = frag->size; + mapping = pci_map_page(tp->pdev, + frag->page, + frag->page_offset, + len, PCI_DMA_TODEVICE); + + tp->tx_buffers[entry].skb = NULL; + pci_unmap_addr_set(&tp->tx_buffers[entry], mapping, mapping); + + tg3_set_txd(tp, entry, mapping, len, + base_flags, (i == last)); + + entry = NEXT_TX(entry); + } + } + + /* Packets are ready, update Tx producer idx local and on card. + * We know this is not a 5700 (by virtue of not being a chip + * requiring the 4GB overflow workaround) so we can safely omit + * the double-write bug tests. + */ + if (tp->tg3_flags & TG3_FLAG_HOST_TXDS) { + tw32_mailbox((MAILBOX_SNDHOST_PROD_IDX_0 + + TG3_64BIT_REG_LOW), entry); + } else { + tw32_mailbox((MAILBOX_SNDNIC_PROD_IDX_0 + + TG3_64BIT_REG_LOW), entry); + } + + tp->tx_prod = entry; + if (TX_BUFFS_AVAIL(tp) <= (MAX_SKB_FRAGS + 1)) + netif_stop_queue(dev); + + spin_unlock_irq(&tp->lock); + + dev->trans_start = jiffies; + + return 0; +} + +static int tg3_change_mtu(struct net_device *dev, int new_mtu) +{ + struct tg3 *tp = dev->priv; + + if (new_mtu < TG3_MIN_MTU || new_mtu > TG3_MAX_MTU) + return -EINVAL; + + if (!netif_running(dev)) { + /* We'll just catch it later when the + * device is up'd. + */ + dev->mtu = new_mtu; + return 0; + } + + spin_lock_irq(&tp->lock); + + tg3_halt(tp); + + dev->mtu = new_mtu; + + if (new_mtu > ETH_DATA_LEN) + tp->tg3_flags |= TG3_FLAG_JUMBO_ENABLE; + else + tp->tg3_flags &= ~TG3_FLAG_JUMBO_ENABLE; + + tg3_init_rings(tp); + tg3_init_hw(tp); + + spin_unlock_irq(&tp->lock); + + return 0; +} + +/* Free up pending packets in all rx/tx rings. + * + * The chip has been shut down and the driver detached from + * the networking, so no interrupts or new tx packets will + * end up in the driver. tp->lock is not held and we are not + * in an interrupt context and thus may sleep. + */ +static void tg3_free_rings(struct tg3 *tp) +{ + struct ring_info *rxp; + int i; + + for (i = 0; i < TG3_RX_RING_SIZE; i++) { + rxp = &tp->rx_std_buffers[i]; + + if (rxp->skb == NULL) + continue; + pci_unmap_single(tp->pdev, + pci_unmap_addr(rxp, mapping), + RX_PKT_BUF_SZ - tp->rx_offset, + PCI_DMA_FROMDEVICE); + dev_kfree_skb(rxp->skb); + rxp->skb = NULL; + } +#if TG3_MINI_RING_WORKS + for (i = 0; i < TG3_RX_MINI_RING_SIZE; i++) { + rxp = &tp->rx_mini_buffers[i]; + + if (rxp->skb == NULL) + continue; + pci_unmap_single(tp->pdev, + pci_unmap_addr(rxp, mapping), + RX_MINI_PKT_BUF_SZ - tp->rx_offset, + PCI_DMA_FROMDEVICE); + dev_kfree_skb(rxp->skb); + rxp->skb = NULL; + } +#endif + for (i = 0; i < TG3_RX_JUMBO_RING_SIZE; i++) { + rxp = &tp->rx_jumbo_buffers[i]; + + if (rxp->skb == NULL) + continue; + pci_unmap_single(tp->pdev, + pci_unmap_addr(rxp, mapping), + RX_JUMBO_PKT_BUF_SZ - tp->rx_offset, + PCI_DMA_FROMDEVICE); + dev_kfree_skb(rxp->skb); + rxp->skb = NULL; + } + + for (i = 0; i < TG3_TX_RING_SIZE; ) { + struct ring_info *txp; + struct sk_buff *skb; + int j; + + txp = &tp->tx_buffers[i]; + skb = txp->skb; + + if (skb == NULL) { + i++; + continue; + } + + pci_unmap_single(tp->pdev, + pci_unmap_addr(txp, mapping), + (skb->len - skb->data_len), + PCI_DMA_TODEVICE); + txp->skb = NULL; + + i++; + + for (j = 0; j < skb_shinfo(skb)->nr_frags; j++) { + txp = &tp->tx_buffers[i & (TG3_TX_RING_SIZE - 1)]; + pci_unmap_page(tp->pdev, + pci_unmap_addr(txp, mapping), + skb_shinfo(skb)->frags[j].size, + PCI_DMA_TODEVICE); + i++; + } + + dev_kfree_skb_any(skb); + } +} + +/* Initialize tx/rx rings for packet processing. + * + * The chip has been shut down and the driver detached from + * the networking, so no interrupts or new tx packets will + * end up in the driver. tp->lock is not held and we are not + * in an interrupt context and thus may sleep. + */ +static void tg3_init_rings(struct tg3 *tp) +{ + unsigned long start, end; + u32 i; + + /* Free up all the SKBs. */ + tg3_free_rings(tp); + + /* Zero out all descriptors. */ + memset(tp->rx_std, 0, TG3_RX_RING_BYTES); +#if TG3_MINI_RING_WORKS + memset(tp->rx_mini, 0, TG3_RX_MINI_RING_BYTES); +#endif + memset(tp->rx_jumbo, 0, TG3_RX_JUMBO_RING_BYTES); + memset(tp->rx_rcb, 0, TG3_RX_RCB_RING_BYTES); + + if (tp->tg3_flags & TG3_FLAG_HOST_TXDS) { + memset(tp->tx_ring, 0, TG3_TX_RING_BYTES); + } else { + start = (tp->regs + + NIC_SRAM_WIN_BASE + + NIC_SRAM_TX_BUFFER_DESC); + end = start + TG3_TX_RING_BYTES; + while (start < end) { + writel(0, start); + start += 4; + } + } + + /* Initialize invariants of the rings, we only set this + * stuff once. This works because the card does not + * write into the rx buffer posting rings. + */ + for (i = 0; i < TG3_RX_RING_SIZE; i++) { + struct tg3_rx_buffer_desc *rxd; + + rxd = &tp->rx_std[i]; + rxd->idx_len = (RX_PKT_BUF_SZ - tp->rx_offset - 64) + << RXD_LEN_SHIFT; + rxd->type_flags = (RXD_FLAG_END << RXD_FLAGS_SHIFT); + rxd->opaque = (RXD_OPAQUE_RING_STD | + (i << RXD_OPAQUE_INDEX_SHIFT)); + } +#if TG3_MINI_RING_WORKS + for (i = 0; i < TG3_RX_MINI_RING_SIZE; i++) { + struct tg3_rx_buffer_desc *rxd; + + rxd = &tp->rx_mini[i]; + rxd->idx_len = (RX_MINI_PKT_BUF_SZ - tp->rx_offset - 64) + << RXD_LEN_SHIFT; + rxd->type_flags = (RXD_FLAG_END << RXD_FLAGS_SHIFT) | + RXD_FLAG_MINI; + rxd->opaque = (RXD_OPAQUE_RING_MINI | + (i << RXD_OPAQUE_INDEX_SHIFT)); + } +#endif + if (tp->tg3_flags & TG3_FLAG_JUMBO_ENABLE) { + for (i = 0; i < TG3_RX_JUMBO_RING_SIZE; i++) { + struct tg3_rx_buffer_desc *rxd; + + rxd = &tp->rx_jumbo[i]; + rxd->idx_len = (RX_JUMBO_PKT_BUF_SZ - tp->rx_offset - 64) + << RXD_LEN_SHIFT; + rxd->type_flags = (RXD_FLAG_END << RXD_FLAGS_SHIFT) | + RXD_FLAG_JUMBO; + rxd->opaque = (RXD_OPAQUE_RING_JUMBO | + (i << RXD_OPAQUE_INDEX_SHIFT)); + } + } + + /* Now allocate fresh SKBs for each rx ring. */ + for (i = 0; i < tp->rx_pending; i++) { + if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_STD, + -1, i) < 0) + break; + } + +#if TG3_MINI_RING_WORKS + for (i = 0; i < tp->rx_mini_pending; i++) { + if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_MINI, + -1, i) < 0) + break; + } +#endif + + if (tp->tg3_flags & TG3_FLAG_JUMBO_ENABLE) { + for (i = 0; i < tp->rx_jumbo_pending; i++) { + if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_JUMBO, + -1, i) < 0) + break; + } + } +} + +/* + * Must not be invoked with interrupt sources disabled and + * the hardware shutdown down. + */ +static void tg3_free_consistent(struct tg3 *tp) +{ + if (tp->rx_std_buffers) { + kfree(tp->rx_std_buffers); + tp->rx_std_buffers = NULL; + } + if (tp->rx_std) { + pci_free_consistent(tp->pdev, TG3_RX_RING_BYTES, + tp->rx_std, tp->rx_std_mapping); + tp->rx_std = NULL; + } +#if TG3_MINI_RING_WORKS + if (tp->rx_mini) { + pci_free_consistent(tp->pdev, TG3_RX_MINI_RING_BYTES, + tp->rx_mini, tp->rx_mini_mapping); + tp->rx_mini = NULL; + } +#endif + if (tp->rx_jumbo) { + pci_free_consistent(tp->pdev, TG3_RX_JUMBO_RING_BYTES, + tp->rx_jumbo, tp->rx_jumbo_mapping); + tp->rx_jumbo = NULL; + } + if (tp->rx_rcb) { + pci_free_consistent(tp->pdev, TG3_RX_RCB_RING_BYTES, + tp->rx_rcb, tp->rx_rcb_mapping); + tp->rx_rcb = NULL; + } + if (tp->tx_ring) { + pci_free_consistent(tp->pdev, TG3_TX_RING_BYTES, + tp->tx_ring, tp->tx_desc_mapping); + tp->tx_ring = NULL; + } + if (tp->hw_status) { + pci_free_consistent(tp->pdev, TG3_HW_STATUS_SIZE, + tp->hw_status, tp->status_mapping); + tp->hw_status = NULL; + } + if (tp->hw_stats) { + pci_free_consistent(tp->pdev, sizeof(struct tg3_hw_stats), + tp->hw_stats, tp->stats_mapping); + tp->hw_stats = NULL; + } +} + +/* + * Must not be invoked with interrupt sources disabled and + * the hardware shutdown down. Can sleep. + */ +static int tg3_alloc_consistent(struct tg3 *tp) +{ + tp->rx_std_buffers = kmalloc(sizeof(struct ring_info) * + (TG3_RX_RING_SIZE + +#if TG3_MINI_RING_WORKS + TG3_RX_MINI_RING_SIZE + +#endif + TG3_RX_JUMBO_RING_SIZE + + TG3_TX_RING_SIZE), + GFP_KERNEL); + if (!tp->rx_std_buffers) + return -ENOMEM; + +#if TG3_MINI_RING_WORKS + memset(tp->rx_std_buffers, 0, + (sizeof(struct ring_info) * + (TG3_RX_RING_SIZE + + TG3_RX_MINI_RING_SIZE + + TG3_RX_JUMBO_RING_SIZE + + TG3_TX_RING_SIZE))); +#else + memset(tp->rx_std_buffers, 0, + (sizeof(struct ring_info) * + (TG3_RX_RING_SIZE + + TG3_RX_JUMBO_RING_SIZE + + TG3_TX_RING_SIZE))); +#endif + +#if TG3_MINI_RING_WORKS + tp->rx_mini_buffers = &tp->rx_std_buffers[TG3_RX_RING_SIZE]; + tp->rx_jumbo_buffers = &tp->rx_mini_buffers[TG3_RX_MINI_RING_SIZE]; +#else + tp->rx_jumbo_buffers = &tp->rx_std_buffers[TG3_RX_RING_SIZE]; +#endif + tp->tx_buffers = &tp->rx_jumbo_buffers[TG3_RX_JUMBO_RING_SIZE]; + + tp->rx_std = pci_alloc_consistent(tp->pdev, TG3_RX_RING_BYTES, + &tp->rx_std_mapping); + if (!tp->rx_std) + goto err_out; + +#if TG3_MINI_RING_WORKS + tp->rx_mini = pci_alloc_consistent(tp->pdev, TG3_RX_MINI_RING_BYTES, + &tp->rx_mini_mapping); + + if (!tp->rx_mini) + goto err_out; +#endif + + tp->rx_jumbo = pci_alloc_consistent(tp->pdev, TG3_RX_JUMBO_RING_BYTES, + &tp->rx_jumbo_mapping); + + if (!tp->rx_jumbo) + goto err_out; + + tp->rx_rcb = pci_alloc_consistent(tp->pdev, TG3_RX_RCB_RING_BYTES, + &tp->rx_rcb_mapping); + if (!tp->rx_rcb) + goto err_out; + + if (tp->tg3_flags & TG3_FLAG_HOST_TXDS) { + tp->tx_ring = pci_alloc_consistent(tp->pdev, TG3_TX_RING_BYTES, + &tp->tx_desc_mapping); + if (!tp->tx_ring) + goto err_out; + } else { + tp->tx_ring = NULL; + tp->tx_desc_mapping = 0; + } + + tp->hw_status = pci_alloc_consistent(tp->pdev, + TG3_HW_STATUS_SIZE, + &tp->status_mapping); + if (!tp->hw_status) + goto err_out; + + tp->hw_stats = pci_alloc_consistent(tp->pdev, + sizeof(struct tg3_hw_stats), + &tp->stats_mapping); + if (!tp->hw_stats) + goto err_out; + + memset(tp->hw_status, 0, TG3_HW_STATUS_SIZE); + memset(tp->hw_stats, 0, sizeof(struct tg3_hw_stats)); + + return 0; + +err_out: + tg3_free_consistent(tp); + return -ENOMEM; +} + +#define MAX_WAIT_CNT 1000 + +/* To stop a block, clear the enable bit and poll till it + * clears. tp->lock is held. + */ +static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit) +{ + unsigned int i; + u32 val; + + val = tr32(ofs); + val &= ~enable_bit; + tw32(ofs, val); + + for (i = 0; i < MAX_WAIT_CNT; i++) { + val = tr32(ofs); + + if ((val & enable_bit) == 0) + break; + udelay(100); + } + + if (i == MAX_WAIT_CNT) { + printk(KERN_ERR PFX "tg3_stop_block timed out, " + "ofs=%lx enable_bit=%x\n", + ofs, enable_bit); + return -ENODEV; + } + + return 0; +} + +/* tp->lock is held. */ +static int tg3_abort_hw(struct tg3 *tp) +{ + int i, err; + + tg3_disable_ints(tp); + + tp->rx_mode &= ~RX_MODE_ENABLE; + tw32(MAC_RX_MODE, tp->rx_mode); + + err = tg3_stop_block(tp, RCVBDI_MODE, RCVBDI_MODE_ENABLE); + err |= tg3_stop_block(tp, RCVLPC_MODE, RCVLPC_MODE_ENABLE); + err |= tg3_stop_block(tp, RCVLSC_MODE, RCVLSC_MODE_ENABLE); + err |= tg3_stop_block(tp, RCVDBDI_MODE, RCVDBDI_MODE_ENABLE); + err |= tg3_stop_block(tp, RCVDCC_MODE, RCVDCC_MODE_ENABLE); + err |= tg3_stop_block(tp, RCVCC_MODE, RCVCC_MODE_ENABLE); + + err |= tg3_stop_block(tp, SNDBDS_MODE, SNDBDS_MODE_ENABLE); + err |= tg3_stop_block(tp, SNDBDI_MODE, SNDBDI_MODE_ENABLE); + err |= tg3_stop_block(tp, SNDDATAI_MODE, SNDDATAI_MODE_ENABLE); + err |= tg3_stop_block(tp, RDMAC_MODE, RDMAC_MODE_ENABLE); + err |= tg3_stop_block(tp, SNDDATAC_MODE, SNDDATAC_MODE_ENABLE); + err |= tg3_stop_block(tp, SNDBDC_MODE, SNDBDC_MODE_ENABLE); + if (err) + goto out; + + tp->mac_mode &= ~MAC_MODE_TDE_ENABLE; + tw32(MAC_MODE, tp->mac_mode); + + tp->tx_mode &= ~TX_MODE_ENABLE; + tw32(MAC_TX_MODE, tp->tx_mode); + for (i = 0; i < MAX_WAIT_CNT; i++) { + udelay(100); + if (!(tr32(MAC_TX_MODE) & TX_MODE_ENABLE)) + break; + } + if (i >= MAX_WAIT_CNT) { + printk(KERN_ERR PFX "tg3_abort_hw timed out for %s, " + "TX_MODE_ENABLE will not clear MAC_TX_MODE=%08x\n", + tp->dev->name, tr32(MAC_TX_MODE)); + return -ENODEV; + } + + err = tg3_stop_block(tp, HOSTCC_MODE, HOSTCC_MODE_ENABLE); + err |= tg3_stop_block(tp, WDMAC_MODE, WDMAC_MODE_ENABLE); + err |= tg3_stop_block(tp, MBFREE_MODE, MBFREE_MODE_ENABLE); + + tw32(FTQ_RESET, 0xffffffff); + tw32(FTQ_RESET, 0x00000000); + + err |= tg3_stop_block(tp, BUFMGR_MODE, BUFMGR_MODE_ENABLE); + err |= tg3_stop_block(tp, MEMARB_MODE, MEMARB_MODE_ENABLE); + if (err) + goto out; + + memset(tp->hw_status, 0, TG3_HW_STATUS_SIZE); + +out: + return err; +} + +/* tp->lock is held. */ +static void tg3_chip_reset(struct tg3 *tp) +{ + u32 val; + + /* Force NVRAM to settle. + * This deals with a chip bug which can result in EEPROM + * corruption. + */ + if (tp->tg3_flags & TG3_FLAG_NVRAM) { + int i; + + tw32(NVRAM_SWARB, SWARB_REQ_SET1); + for (i = 0; i < 100000; i++) { + if (tr32(NVRAM_SWARB) & SWARB_GNT1) + break; + udelay(10); + } + } + + tw32(GRC_MISC_CFG, GRC_MISC_CFG_CORECLK_RESET); + udelay(40); + udelay(40); + udelay(40); + + /* Re-enable indirect register accesses. */ + pci_write_config_dword(tp->pdev, TG3PCI_MISC_HOST_CTRL, + tp->misc_host_ctrl); + + /* Set MAX PCI retry to zero. */ + pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE, + (PCISTATE_ROM_ENABLE | + PCISTATE_ROM_RETRY_ENABLE)); + + pci_restore_state(tp->pdev, tp->pci_cfg_state); + + /* Make sure PCI-X relaxed ordering bit is clear. */ + pci_read_config_dword(tp->pdev, TG3PCI_X_CAPS, &val); + val &= ~PCIX_CAPS_RELAXED_ORDERING; + pci_write_config_dword(tp->pdev, TG3PCI_X_CAPS, val); + + tw32(MEMARB_MODE, MEMARB_MODE_ENABLE); + + tw32(TG3PCI_MISC_HOST_CTRL, tp->misc_host_ctrl); +} + +/* tp->lock is held. */ +static int tg3_halt(struct tg3 *tp) +{ + u32 val; + int i; + + tg3_abort_hw(tp); + tg3_chip_reset(tp); + tg3_write_mem(tp, + NIC_SRAM_FIRMWARE_MBOX, + NIC_SRAM_FIRMWARE_MBOX_MAGIC1); + for (i = 0; i < 100000; i++) { + tg3_read_mem(tp, NIC_SRAM_FIRMWARE_MBOX, &val); + if (val == ~NIC_SRAM_FIRMWARE_MBOX_MAGIC1) + break; + udelay(10); + } + + if (i >= 100000) { + printk(KERN_ERR PFX "tg3_halt timed out for %s, " + "firmware will not restart magic=%08x\n", + tp->dev->name, val); + return -ENODEV; + } + + return 0; +} + +#define TG3_FW_RELEASE_MAJOR 0x0 +#define TG3_FW_RELASE_MINOR 0x0 +#define TG3_FW_RELEASE_FIX 0x0 +#define TG3_FW_START_ADDR 0x08000000 +#define TG3_FW_TEXT_ADDR 0x08000000 +#define TG3_FW_TEXT_LEN 0x9c0 +#define TG3_FW_RODATA_ADDR 0x080009c0 +#define TG3_FW_RODATA_LEN 0x60 +#define TG3_FW_DATA_ADDR 0x08000a40 +#define TG3_FW_DATA_LEN 0x20 +#define TG3_FW_SBSS_ADDR 0x08000a60 +#define TG3_FW_SBSS_LEN 0xc +#define TG3_FW_BSS_ADDR 0x08000a70 +#define TG3_FW_BSS_LEN 0x10 + +static u32 t3FwText[(TG3_FW_TEXT_LEN / sizeof(u32)) + 1] = { + 0x00000000, 0x10000003, 0x00000000, 0x0000000d, 0x0000000d, 0x3c1d0800, + 0x37bd3ffc, 0x03a0f021, 0x3c100800, 0x26100000, 0x0e000018, 0x00000000, + 0x0000000d, 0x3c1d0800, 0x37bd3ffc, 0x03a0f021, 0x3c100800, 0x26100034, + 0x0e00021c, 0x00000000, 0x0000000d, 0x00000000, 0x00000000, 0x00000000, + 0x27bdffe0, 0x3c1cc000, 0xafbf0018, 0xaf80680c, 0x0e00004c, 0x241b2105, + 0x97850000, 0x97870002, 0x9782002c, 0x9783002e, 0x3c040800, 0x248409c0, + 0xafa00014, 0x00021400, 0x00621825, 0x00052c00, 0xafa30010, 0x8f860010, + 0x00e52825, 0x0e000060, 0x24070102, 0x3c02ac00, 0x34420100, 0x3c03ac01, + 0x34630100, 0xaf820490, 0x3c02ffff, 0xaf820494, 0xaf830498, 0xaf82049c, + 0x24020001, 0xaf825ce0, 0x0e00003f, 0xaf825d00, 0x0e000140, 0x00000000, + 0x8fbf0018, 0x03e00008, 0x27bd0020, 0x2402ffff, 0xaf825404, 0x8f835400, + 0x34630400, 0xaf835400, 0xaf825404, 0x3c020800, 0x24420034, 0xaf82541c, + 0x03e00008, 0xaf805400, 0x00000000, 0x00000000, 0x3c020800, 0x34423000, + 0x3c030800, 0x34633000, 0x3c040800, 0x348437ff, 0x3c010800, 0xac220a64, + 0x24020040, 0x3c010800, 0xac220a68, 0x3c010800, 0xac200a60, 0xac600000, + 0x24630004, 0x0083102b, 0x5040fffd, 0xac600000, 0x03e00008, 0x00000000, + 0x00804821, 0x8faa0010, 0x3c020800, 0x8c420a60, 0x3c040800, 0x8c840a68, + 0x8fab0014, 0x24430001, 0x0044102b, 0x3c010800, 0xac230a60, 0x14400003, + 0x00004021, 0x3c010800, 0xac200a60, 0x3c020800, 0x8c420a60, 0x3c030800, + 0x8c630a64, 0x91240000, 0x00021140, 0x00431021, 0x00481021, 0x25080001, + 0xa0440000, 0x29020008, 0x1440fff4, 0x25290001, 0x3c020800, 0x8c420a60, + 0x3c030800, 0x8c630a64, 0x8f84680c, 0x00021140, 0x00431021, 0xac440008, + 0xac45000c, 0xac460010, 0xac470014, 0xac4a0018, 0x03e00008, 0xac4b001c, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0x02000008, 0x00000000, 0x0a0001e3, 0x3c0a0001, 0x0a0001e3, 0x3c0a0002, + 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, + 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, + 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, + 0x0a0001e3, 0x3c0a0007, 0x0a0001e3, 0x3c0a0008, 0x0a0001e3, 0x3c0a0009, + 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x3c0a000b, + 0x0a0001e3, 0x3c0a000c, 0x0a0001e3, 0x3c0a000d, 0x0a0001e3, 0x00000000, + 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x3c0a000e, 0x0a0001e3, 0x00000000, + 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, + 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x00000000, + 0x0a0001e3, 0x00000000, 0x0a0001e3, 0x3c0a0013, 0x0a0001e3, 0x3c0a0014, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0x27bdffe0, 0x00001821, 0x00001021, 0xafbf0018, 0xafb10014, 0xafb00010, + 0x3c010800, 0x00220821, 0xac200a70, 0x3c010800, 0x00220821, 0xac200a74, + 0x3c010800, 0x00220821, 0xac200a78, 0x24630001, 0x1860fff5, 0x2442000c, + 0x24110001, 0x8f906810, 0x32020004, 0x14400005, 0x24040001, 0x3c020800, + 0x8c420a78, 0x18400003, 0x00002021, 0x0e000182, 0x00000000, 0x32020001, + 0x10400003, 0x00000000, 0x0e000169, 0x00000000, 0x0a000153, 0xaf915028, + 0x8fbf0018, 0x8fb10014, 0x8fb00010, 0x03e00008, 0x27bd0020, 0x3c050800, + 0x8ca50a70, 0x3c060800, 0x8cc60a80, 0x3c070800, 0x8ce70a78, 0x27bdffe0, + 0x3c040800, 0x248409d0, 0xafbf0018, 0xafa00010, 0x0e000060, 0xafa00014, + 0x0e00017b, 0x00002021, 0x8fbf0018, 0x03e00008, 0x27bd0020, 0x24020001, + 0x8f836810, 0x00821004, 0x00021027, 0x00621824, 0x03e00008, 0xaf836810, + 0x27bdffd8, 0xafbf0024, 0x1080002e, 0xafb00020, 0x8f825cec, 0xafa20018, + 0x8f825cec, 0x3c100800, 0x26100a78, 0xafa2001c, 0x34028000, 0xaf825cec, + 0x8e020000, 0x18400016, 0x00000000, 0x3c020800, 0x94420a74, 0x8fa3001c, + 0x000221c0, 0xac830004, 0x8fa2001c, 0x3c010800, 0x0e000201, 0xac220a74, + 0x10400005, 0x00000000, 0x8e020000, 0x24420001, 0x0a0001df, 0xae020000, + 0x3c020800, 0x8c420a70, 0x00021c02, 0x000321c0, 0x0a0001c5, 0xafa2001c, + 0x0e000201, 0x00000000, 0x1040001f, 0x00000000, 0x8e020000, 0x8fa3001c, + 0x24420001, 0x3c010800, 0xac230a70, 0x3c010800, 0xac230a74, 0x0a0001df, + 0xae020000, 0x3c100800, 0x26100a78, 0x8e020000, 0x18400028, 0x00000000, + 0x0e000201, 0x00000000, 0x14400024, 0x00000000, 0x8e020000, 0x3c030800, + 0x8c630a70, 0x2442ffff, 0xafa3001c, 0x18400006, 0xae020000, 0x00031402, + 0x000221c0, 0x8c820004, 0x3c010800, 0xac220a70, 0x97a2001e, 0x2442ff00, + 0x2c420300, 0x1440000b, 0x24024000, 0x3c040800, 0x248409dc, 0xafa00010, + 0xafa00014, 0x8fa6001c, 0x24050008, 0x0e000060, 0x00003821, 0x0a0001df, + 0x00000000, 0xaf825cf8, 0x3c020800, 0x8c420a40, 0x8fa3001c, 0x24420001, + 0xaf835cf8, 0x3c010800, 0xac220a40, 0x8fbf0024, 0x8fb00020, 0x03e00008, + 0x27bd0028, 0x27bdffe0, 0x3c040800, 0x248409e8, 0x00002821, 0x00003021, + 0x00003821, 0xafbf0018, 0xafa00010, 0x0e000060, 0xafa00014, 0x8fbf0018, + 0x03e00008, 0x27bd0020, 0x8f82680c, 0x8f85680c, 0x00021827, 0x0003182b, + 0x00031823, 0x00431024, 0x00441021, 0x00a2282b, 0x10a00006, 0x00000000, + 0x00401821, 0x8f82680c, 0x0043102b, 0x1440fffd, 0x00000000, 0x03e00008, + 0x00000000, 0x3c040800, 0x8c840000, 0x3c030800, 0x8c630a40, 0x0064102b, + 0x54400002, 0x00831023, 0x00641023, 0x2c420008, 0x03e00008, 0x38420001, + 0x27bdffe0, 0x00802821, 0x3c040800, 0x24840a00, 0x00003021, 0x00003821, + 0xafbf0018, 0xafa00010, 0x0e000060, 0xafa00014, 0x0a000216, 0x00000000, + 0x8fbf0018, 0x03e00008, 0x27bd0020, 0x00000000, 0x27bdffe0, 0x3c1cc000, + 0xafbf0018, 0x0e00004c, 0xaf80680c, 0x3c040800, 0x24840a10, 0x03802821, + 0x00003021, 0x00003821, 0xafa00010, 0x0e000060, 0xafa00014, 0x2402ffff, + 0xaf825404, 0x3c0200aa, 0x0e000234, 0xaf825434, 0x8fbf0018, 0x03e00008, + 0x27bd0020, 0x00000000, 0x00000000, 0x00000000, 0x27bdffe8, 0xafb00010, + 0x24100001, 0xafbf0014, 0x3c01c003, 0xac200000, 0x8f826810, 0x30422000, + 0x10400003, 0x00000000, 0x0e000246, 0x00000000, 0x0a00023a, 0xaf905428, + 0x8fbf0014, 0x8fb00010, 0x03e00008, 0x27bd0018, 0x27bdfff8, 0x8f845d0c, + 0x3c0200ff, 0x3c030800, 0x8c630a50, 0x3442fff8, 0x00821024, 0x1043001e, + 0x3c0500ff, 0x34a5fff8, 0x3c06c003, 0x3c074000, 0x00851824, 0x8c620010, + 0x3c010800, 0xac230a50, 0x30420008, 0x10400005, 0x00871025, 0x8cc20000, + 0x24420001, 0xacc20000, 0x00871025, 0xaf825d0c, 0x8fa20000, 0x24420001, + 0xafa20000, 0x8fa20000, 0x8fa20000, 0x24420001, 0xafa20000, 0x8fa20000, + 0x8f845d0c, 0x3c030800, 0x8c630a50, 0x00851024, 0x1443ffe8, 0x00851824, + 0x27bd0008, 0x03e00008, 0x00000000, 0x00000000, 0x00000000 +}; + +static u32 t3FwRodata[(TG3_FW_RODATA_LEN / sizeof(u32)) + 1] = { + 0x35373031, 0x726c7341, 0x00000000, 0x00000000, 0x53774576, 0x656e7430, + 0x00000000, 0x726c7045, 0x76656e74, 0x31000000, 0x556e6b6e, 0x45766e74, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66617461, 0x6c457272, + 0x00000000, 0x00000000, 0x4d61696e, 0x43707542, 0x00000000, 0x00000000, + 0x00000000 +}; + +#if 0 /* All zeros, dont eat up space with it. */ +u32 t3FwData[(TG3_FW_DATA_LEN / sizeof(u32)) + 1] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000 +}; +#endif + +#define RX_CPU_SCRATCH_BASE 0x30000 +#define RX_CPU_SCRATCH_SIZE 0x04000 +#define TX_CPU_SCRATCH_BASE 0x34000 +#define TX_CPU_SCRATCH_SIZE 0x04000 + +/* tp->lock is held. */ +static int tg3_reset_cpu(struct tg3 *tp, u32 offset) +{ + int i; + + tw32(offset + CPU_STATE, 0xffffffff); + tw32(offset + CPU_MODE, CPU_MODE_RESET); + if (offset == RX_CPU_BASE) { + for (i = 0; i < 10000; i++) + if (!(tr32(offset + CPU_MODE) & CPU_MODE_RESET)) + break; + tw32(offset + CPU_STATE, 0xffffffff); + tw32(offset + CPU_MODE, CPU_MODE_RESET); + udelay(10); + } else { + for (i = 0; i < 10000; i++) { + if (!(tr32(offset + CPU_MODE) & CPU_MODE_RESET)) + break; + tw32(offset + CPU_STATE, 0xffffffff); + tw32(offset + CPU_MODE, CPU_MODE_RESET); + udelay(10); + } + } + + if (i >= 10000) { + printk(KERN_ERR PFX "tg3_reset_cpu timed out for %s, " + "and %s CPU\n", + tp->dev->name, + (offset == RX_CPU_BASE ? "RX" : "TX")); + return -ENODEV; + } + return 0; +} + +/* tp->lock is held. */ +static int tg3_load_firmware_cpu(struct tg3 *tp, u32 cpu_base, u32 cpu_scratch_base, + int cpu_scratch_size) +{ + int err, i; + + err = tg3_reset_cpu(tp, cpu_base); + if (err) + return err; + + for (i = 0; i < cpu_scratch_size; i += sizeof(u32)) + tg3_write_indirect_reg32(tp, cpu_scratch_base + i, 0); + tw32(cpu_base + CPU_STATE, 0xffffffff); + tw32(cpu_base + CPU_MODE, tr32(cpu_base+CPU_MODE)|CPU_MODE_HALT); + for (i = 0; i < (TG3_FW_TEXT_LEN / sizeof(u32)); i++) + tg3_write_indirect_reg32(tp, (cpu_scratch_base + + (TG3_FW_TEXT_ADDR & 0xffff) + + (i * sizeof(u32))), + t3FwText[i]); + for (i = 0; i < (TG3_FW_RODATA_LEN / sizeof(u32)); i++) + tg3_write_indirect_reg32(tp, (cpu_scratch_base + + (TG3_FW_RODATA_ADDR & 0xffff) + + (i * sizeof(u32))), + t3FwRodata[i]); + for (i = 0; i < (TG3_FW_DATA_LEN / sizeof(u32)); i++) + tg3_write_indirect_reg32(tp, (cpu_scratch_base + + (TG3_FW_DATA_ADDR & 0xffff) + + (i * sizeof(u32))), + 0); + + return 0; +} + +/* tp->lock is held. */ +static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp) +{ + int err, i; + + err = tg3_load_firmware_cpu(tp, RX_CPU_BASE, + RX_CPU_SCRATCH_BASE, RX_CPU_SCRATCH_SIZE); + if (err) + return err; + + err = tg3_load_firmware_cpu(tp, TX_CPU_BASE, + TX_CPU_SCRATCH_BASE, TX_CPU_SCRATCH_SIZE); + if (err) + return err; + + /* Now startup only the RX cpu. */ + tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff); + tw32(RX_CPU_BASE + CPU_PC, TG3_FW_TEXT_ADDR); + + /* Flush posted writes. */ + tr32(RX_CPU_BASE + CPU_PC); + for (i = 0; i < 5; i++) { + if (tr32(RX_CPU_BASE + CPU_PC) == TG3_FW_TEXT_ADDR) + break; + tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff); + tw32(RX_CPU_BASE + CPU_MODE, CPU_MODE_HALT); + tw32(RX_CPU_BASE + CPU_PC, TG3_FW_TEXT_ADDR); + + /* Flush posted writes. */ + tr32(RX_CPU_BASE + CPU_PC); + + udelay(1000); + } + if (i >= 5) { + printk(KERN_ERR PFX "tg3_load_firmware fails for %s " + "to set RX CPU PC, is %08x should be %08x\n", + tp->dev->name, tr32(RX_CPU_BASE + CPU_PC), + TG3_FW_TEXT_ADDR); + return -ENODEV; + } + tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff); + tw32(RX_CPU_BASE + CPU_MODE, 0x00000000); + + /* Flush posted writes. */ + tr32(RX_CPU_BASE + CPU_MODE); + + return 0; +} + +/* tp->lock is held. */ +static void __tg3_set_mac_addr(struct tg3 *tp) +{ + u32 addr_high, addr_low; + int i; + + addr_high = ((tp->dev->dev_addr[0] << 8) | + tp->dev->dev_addr[1]); + addr_low = ((tp->dev->dev_addr[2] << 24) | + (tp->dev->dev_addr[3] << 16) | + (tp->dev->dev_addr[4] << 8) | + (tp->dev->dev_addr[5] << 0)); + for (i = 0; i < 4; i++) { + tw32(MAC_ADDR_0_HIGH + (i * 8), addr_high); + tw32(MAC_ADDR_0_LOW + (i * 8), addr_low); + } + + addr_high = (tp->dev->dev_addr[0] + + tp->dev->dev_addr[1] + + tp->dev->dev_addr[2] + + tp->dev->dev_addr[3] + + tp->dev->dev_addr[4] + + tp->dev->dev_addr[5]) & + TX_BACKOFF_SEED_MASK; + tw32(MAC_TX_BACKOFF_SEED, addr_high); +} + +static int tg3_set_mac_addr(struct net_device *dev, void *p) +{ + struct tg3 *tp = dev->priv; + struct sockaddr *addr = p; + + if (netif_running(dev)) + return -EBUSY; + + memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); + + spin_lock_irq(&tp->lock); + __tg3_set_mac_addr(tp); + spin_unlock_irq(&tp->lock); + + return 0; +} + +/* tp->lock is held. */ +static void tg3_set_bdinfo(struct tg3 *tp, u32 bdinfo_addr, + dma_addr_t mapping, u32 maxlen_flags, + u32 nic_addr) +{ + tg3_write_mem(tp, + (bdinfo_addr + + TG3_BDINFO_HOST_ADDR + + TG3_64BIT_REG_HIGH), + ((u64) mapping >> 32)); + tg3_write_mem(tp, + (bdinfo_addr + + TG3_BDINFO_HOST_ADDR + + TG3_64BIT_REG_LOW), + ((u64) mapping & 0xffffffff)); + tg3_write_mem(tp, + (bdinfo_addr + + TG3_BDINFO_MAXLEN_FLAGS), + maxlen_flags); + tg3_write_mem(tp, + (bdinfo_addr + + TG3_BDINFO_NIC_ADDR), + nic_addr); +} + +static void __tg3_set_rx_mode(struct net_device *); + +/* tp->lock is held. */ +static int tg3_reset_hw(struct tg3 *tp) +{ + u32 val; + int i, err; + + tg3_disable_ints(tp); + + if (tp->tg3_flags & TG3_FLAG_INIT_COMPLETE) { + err = tg3_abort_hw(tp); + if (err) + return err; + } + + tg3_chip_reset(tp); + + tw32(GRC_MODE, tp->grc_mode); + tg3_write_mem(tp, + NIC_SRAM_FIRMWARE_MBOX, + NIC_SRAM_FIRMWARE_MBOX_MAGIC1); + if (tp->phy_id == PHY_ID_SERDES) { + tp->mac_mode = MAC_MODE_PORT_MODE_TBI; + tw32(MAC_MODE, tp->mac_mode); + } else + tw32(MAC_MODE, 0); + + /* Wait for firmware initialization to complete. */ + for (i = 0; i < 100000; i++) { + tg3_read_mem(tp, NIC_SRAM_FIRMWARE_MBOX, &val); + if (val == ~NIC_SRAM_FIRMWARE_MBOX_MAGIC1) + break; + udelay(10); + } + if (i >= 100000) { + printk(KERN_ERR PFX "tg3_reset_hw timed out for %s, " + "firmware will not restart magic=%08x\n", + tp->dev->name, val); + return -ENODEV; + } + + /* This works around an issue with Athlon chipsets on + * B3 tigon3 silicon. This bit has no effect on any + * other revision. + */ + val = tr32(TG3PCI_CLOCK_CTRL); + val |= CLOCK_CTRL_DELAY_PCI_GRANT; + tw32(TG3PCI_CLOCK_CTRL, val); + + /* Clear statistics/status block in chip, and status block in ram. */ + for (i = NIC_SRAM_STATS_BLK; + i < NIC_SRAM_STATUS_BLK + TG3_HW_STATUS_SIZE; + i += sizeof(u32)) + tg3_write_mem(tp, i, 0); + memset(tp->hw_status, 0, TG3_HW_STATUS_SIZE); + + /* This value is determined during the probe time DMA + * engine test, tg3_test_dma. + */ + tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl); + + tp->grc_mode &= ~(GRC_MODE_HOST_SENDBDS | + GRC_MODE_4X_NIC_SEND_RINGS | + GRC_MODE_NO_TX_PHDR_CSUM | + GRC_MODE_NO_RX_PHDR_CSUM); + if (tp->tg3_flags & TG3_FLAG_HOST_TXDS) + tp->grc_mode |= GRC_MODE_HOST_SENDBDS; + else + tp->grc_mode |= GRC_MODE_4X_NIC_SEND_RINGS; + if (tp->tg3_flags & TG3_FLAG_NO_TX_PSEUDO_CSUM) + tp->grc_mode |= GRC_MODE_NO_TX_PHDR_CSUM; + if (tp->tg3_flags & TG3_FLAG_NO_RX_PSEUDO_CSUM) + tp->grc_mode |= GRC_MODE_NO_RX_PHDR_CSUM; + + tw32(GRC_MODE, + tp->grc_mode | + (GRC_MODE_IRQ_ON_MAC_ATTN | GRC_MODE_HOST_STACKUP)); + + /* Setup the timer prescalar register. Clock is always 66Mhz. */ + tw32(GRC_MISC_CFG, + (65 << GRC_MISC_CFG_PRESCALAR_SHIFT)); + + /* Initialize MBUF/DESC pool. */ + tw32(BUFMGR_MB_POOL_ADDR, NIC_SRAM_MBUF_POOL_BASE); + tw32(BUFMGR_MB_POOL_SIZE, NIC_SRAM_MBUF_POOL_SIZE); + tw32(BUFMGR_DMA_DESC_POOL_ADDR, NIC_SRAM_DMA_DESC_POOL_BASE); + tw32(BUFMGR_DMA_DESC_POOL_SIZE, NIC_SRAM_DMA_DESC_POOL_SIZE); + + if (!(tp->tg3_flags & TG3_FLAG_JUMBO_ENABLE)) { + tw32(BUFMGR_MB_RDMA_LOW_WATER, + tp->bufmgr_config.mbuf_read_dma_low_water); + tw32(BUFMGR_MB_MACRX_LOW_WATER, + tp->bufmgr_config.mbuf_mac_rx_low_water); + tw32(BUFMGR_MB_HIGH_WATER, + tp->bufmgr_config.mbuf_high_water); + } else { + tw32(BUFMGR_MB_RDMA_LOW_WATER, + tp->bufmgr_config.mbuf_read_dma_low_water_jumbo); + tw32(BUFMGR_MB_MACRX_LOW_WATER, + tp->bufmgr_config.mbuf_mac_rx_low_water_jumbo); + tw32(BUFMGR_MB_HIGH_WATER, + tp->bufmgr_config.mbuf_high_water_jumbo); + } + tw32(BUFMGR_DMA_LOW_WATER, + tp->bufmgr_config.dma_low_water); + tw32(BUFMGR_DMA_HIGH_WATER, + tp->bufmgr_config.dma_high_water); + + tw32(BUFMGR_MODE, BUFMGR_MODE_ENABLE | BUFMGR_MODE_ATTN_ENABLE); + for (i = 0; i < 2000; i++) { + if (tr32(BUFMGR_MODE) & BUFMGR_MODE_ENABLE) + break; + udelay(10); + } + if (i >= 2000) { + printk(KERN_ERR PFX "tg3_reset_hw cannot enable BUFMGR for %s.\n", + tp->dev->name); + return -ENODEV; + } + + tw32(FTQ_RESET, 0xffffffff); + tw32(FTQ_RESET, 0x00000000); + for (i = 0; i < 2000; i++) { + if (tr32(FTQ_RESET) == 0x00000000) + break; + udelay(10); + } + if (i >= 2000) { + printk(KERN_ERR PFX "tg3_reset_hw cannot reset FTQ for %s.\n", + tp->dev->name); + return -ENODEV; + } + + /* Initialize TG3_BDINFO's at: + * RCVDBDI_STD_BD: standard eth size rx ring + * RCVDBDI_JUMBO_BD: jumbo frame rx ring + * RCVDBDI_MINI_BD: small frame rx ring (??? does not work) + * + * like so: + * TG3_BDINFO_HOST_ADDR: high/low parts of DMA address of ring + * TG3_BDINFO_MAXLEN_FLAGS: (rx max buffer size << 16) | + * ring attribute flags + * TG3_BDINFO_NIC_ADDR: location of descriptors in nic SRAM + * + * Standard receive ring @ NIC_SRAM_RX_BUFFER_DESC, 512 entries. + * Jumbo receive ring @ NIC_SRAM_RX_JUMBO_BUFFER_DESC, 256 entries. + * + * ??? No space allocated for mini receive ring? :( + * + * The size of each ring is fixed in the firmware, but the location is + * configurable. + */ + tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_HIGH, + ((u64) tp->rx_std_mapping >> 32)); + tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW, + ((u64) tp->rx_std_mapping & 0xffffffff)); + tw32(RCVDBDI_STD_BD + TG3_BDINFO_MAXLEN_FLAGS, + RX_STD_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT); + tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR, + NIC_SRAM_RX_BUFFER_DESC); + +#if TG3_MINI_RING_WORKS + tw32(RCVDBDI_MINI_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_HIGH, + ((u64) tp->rx_mini_mapping >> 32)); + tw32(RCVDBDI_MINI_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW, + ((u64) tp->rx_mini_mapping & 0xffffffff)); + tw32(RCVDBDI_MINI_BD + TG3_BDINFO_MAXLEN_FLAGS, + RX_MINI_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT); + tw32(RCVDBDI_MINI_BD + TG3_BDINFO_NIC_ADDR, + NIC_SRAM_RX_MINI_BUFFER_DESC); +#else + tw32(RCVDBDI_MINI_BD + TG3_BDINFO_MAXLEN_FLAGS, + BDINFO_FLAGS_DISABLED); +#endif + + if (tp->tg3_flags & TG3_FLAG_JUMBO_ENABLE) { + tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_HIGH, + ((u64) tp->rx_jumbo_mapping >> 32)); + tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW, + ((u64) tp->rx_jumbo_mapping & 0xffffffff)); + tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_MAXLEN_FLAGS, + RX_JUMBO_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT); + tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_NIC_ADDR, + NIC_SRAM_RX_JUMBO_BUFFER_DESC); + } else { + tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_MAXLEN_FLAGS, + BDINFO_FLAGS_DISABLED); + } + + /* Setup replenish thresholds. */ + tw32(RCVBDI_STD_THRESH, tp->rx_pending / 8); +#if TG3_MINI_RING_WORKS + tw32(RCVBDI_MINI_THRESH, tp->rx_mini_pending / 8); +#endif + tw32(RCVBDI_JUMBO_THRESH, tp->rx_jumbo_pending / 8); + + /* Clear out send RCB ring in SRAM. */ + for (i = NIC_SRAM_SEND_RCB; i < NIC_SRAM_RCV_RET_RCB; i += TG3_BDINFO_SIZE) + tg3_write_mem(tp, i + TG3_BDINFO_MAXLEN_FLAGS, BDINFO_FLAGS_DISABLED); + + tp->tx_prod = 0; + tp->tx_cons = 0; + tw32_mailbox(MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW, 0); + tw32_mailbox(MAILBOX_SNDNIC_PROD_IDX_0 + TG3_64BIT_REG_LOW, 0); + + if (tp->tg3_flags & TG3_FLAG_HOST_TXDS) { + tg3_set_bdinfo(tp, NIC_SRAM_SEND_RCB, + tp->tx_desc_mapping, + (TG3_TX_RING_SIZE << + BDINFO_FLAGS_MAXLEN_SHIFT), + NIC_SRAM_TX_BUFFER_DESC); + } else { + tg3_set_bdinfo(tp, NIC_SRAM_SEND_RCB, + 0, + BDINFO_FLAGS_DISABLED, + NIC_SRAM_TX_BUFFER_DESC); + } + + for (i = NIC_SRAM_RCV_RET_RCB; i < NIC_SRAM_STATS_BLK; i += TG3_BDINFO_SIZE) { + tg3_write_mem(tp, i + TG3_BDINFO_MAXLEN_FLAGS, + BDINFO_FLAGS_DISABLED); + } + + tp->rx_rcb_ptr = 0; + tw32_mailbox(MAILBOX_RCVRET_CON_IDX_0 + TG3_64BIT_REG_LOW, 0); + + tg3_set_bdinfo(tp, NIC_SRAM_RCV_RET_RCB, + tp->rx_rcb_mapping, + (TG3_RX_RCB_RING_SIZE << + BDINFO_FLAGS_MAXLEN_SHIFT), + 0); + + tp->rx_std_ptr = tp->rx_pending; + tw32_mailbox(MAILBOX_RCV_STD_PROD_IDX + TG3_64BIT_REG_LOW, + tp->rx_std_ptr); +#if TG3_MINI_RING_WORKS + tp->rx_mini_ptr = tp->rx_mini_pending; + tw32_mailbox(MAILBOX_RCV_MINI_PROD_IDX + TG3_64BIT_REG_LOW, + tp->rx_mini_ptr); +#endif + + if (tp->tg3_flags & TG3_FLAG_JUMBO_ENABLE) + tp->rx_jumbo_ptr = tp->rx_jumbo_pending; + else + tp->rx_jumbo_ptr = 0; + tw32_mailbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW, + tp->rx_jumbo_ptr); + + /* Initialize MAC address and backoff seed. */ + __tg3_set_mac_addr(tp); + + /* MTU + ethernet header + FCS + optional VLAN tag */ + tw32(MAC_RX_MTU_SIZE, tp->dev->mtu + ETH_HLEN + 8); + + /* The slot time is changed by tg3_setup_phy if we + * run at gigabit with half duplex. + */ + tw32(MAC_TX_LENGTHS, + (2 << TX_LENGTHS_IPG_CRS_SHIFT) | + (6 << TX_LENGTHS_IPG_SHIFT) | + (32 << TX_LENGTHS_SLOT_TIME_SHIFT)); + + /* Receive rules. */ + tw32(MAC_RCV_RULE_CFG, RCV_RULE_CFG_DEFAULT_CLASS); + tw32(RCVLPC_CONFIG, 0x0181); + + /* Receive/send statistics. */ + tw32(RCVLPC_STATS_ENABLE, 0xffffff); + tw32(RCVLPC_STATSCTRL, RCVLPC_STATSCTRL_ENABLE); + tw32(SNDDATAI_STATSENAB, 0xffffff); + tw32(SNDDATAI_STATSCTRL, + (SNDDATAI_SCTRL_ENABLE | + SNDDATAI_SCTRL_FASTUPD)); + + /* Setup host coalescing engine. */ + tw32(HOSTCC_MODE, 0); + for (i = 0; i < 2000; i++) { + if (!(tr32(HOSTCC_MODE) & HOSTCC_MODE_ENABLE)) + break; + udelay(10); + } + + tw32(HOSTCC_RXCOL_TICKS, + tp->coalesce_config.rx_coalesce_ticks); + tw32(HOSTCC_RXMAX_FRAMES, + tp->coalesce_config.rx_max_coalesced_frames); + tw32(HOSTCC_RXCOAL_TICK_INT, + tp->coalesce_config.rx_coalesce_ticks_during_int); + tw32(HOSTCC_RXCOAL_MAXF_INT, + tp->coalesce_config.rx_max_coalesced_frames_during_int); + tw32(HOSTCC_TXCOL_TICKS, + tp->coalesce_config.tx_coalesce_ticks); + tw32(HOSTCC_TXMAX_FRAMES, + tp->coalesce_config.tx_max_coalesced_frames); + tw32(HOSTCC_TXCOAL_TICK_INT, + tp->coalesce_config.tx_coalesce_ticks_during_int); + tw32(HOSTCC_TXCOAL_MAXF_INT, + tp->coalesce_config.tx_max_coalesced_frames_during_int); + tw32(HOSTCC_STAT_COAL_TICKS, + tp->coalesce_config.stats_coalesce_ticks); + + /* Status/statistics block address. */ + tw32(HOSTCC_STATS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH, + ((u64) tp->stats_mapping >> 32)); + tw32(HOSTCC_STATS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW, + ((u64) tp->stats_mapping & 0xffffffff)); + tw32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH, + ((u64) tp->status_mapping >> 32)); + tw32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW, + ((u64) tp->status_mapping & 0xffffffff)); + tw32(HOSTCC_STATS_BLK_NIC_ADDR, NIC_SRAM_STATS_BLK); + tw32(HOSTCC_STATUS_BLK_NIC_ADDR, NIC_SRAM_STATUS_BLK); + + tw32(HOSTCC_MODE, HOSTCC_MODE_ENABLE | tp->coalesce_mode); + + tw32(RCVCC_MODE, RCVCC_MODE_ENABLE | RCVCC_MODE_ATTN_ENABLE); + tw32(RCVLPC_MODE, RCVLPC_MODE_ENABLE); + tw32(RCVLSC_MODE, RCVLSC_MODE_ENABLE | RCVLSC_MODE_ATTN_ENABLE); + + tp->mac_mode = MAC_MODE_TXSTAT_ENABLE | MAC_MODE_RXSTAT_ENABLE | + MAC_MODE_TDE_ENABLE | MAC_MODE_RDE_ENABLE | MAC_MODE_FHDE_ENABLE; + tw32(MAC_MODE, tp->mac_mode | MAC_MODE_RXSTAT_CLEAR | MAC_MODE_TXSTAT_CLEAR); + + tp->grc_local_ctrl = GRC_LCLCTRL_INT_ON_ATTN | GRC_LCLCTRL_GPIO_OE1 | + GRC_LCLCTRL_GPIO_OUTPUT1 | GRC_LCLCTRL_AUTO_SEEPROM; + tw32(GRC_LOCAL_CTRL, tp->grc_local_ctrl); + + tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0); + + tw32(DMAC_MODE, DMAC_MODE_ENABLE); + + tw32(WDMAC_MODE, (WDMAC_MODE_ENABLE | WDMAC_MODE_TGTABORT_ENAB | + WDMAC_MODE_MSTABORT_ENAB | WDMAC_MODE_PARITYERR_ENAB | + WDMAC_MODE_ADDROFLOW_ENAB | WDMAC_MODE_FIFOOFLOW_ENAB | + WDMAC_MODE_FIFOURUN_ENAB | WDMAC_MODE_FIFOOREAD_ENAB | + WDMAC_MODE_LNGREAD_ENAB)); + tw32(RDMAC_MODE, (RDMAC_MODE_ENABLE | RDMAC_MODE_TGTABORT_ENAB | + RDMAC_MODE_MSTABORT_ENAB | RDMAC_MODE_PARITYERR_ENAB | + RDMAC_MODE_ADDROFLOW_ENAB | RDMAC_MODE_FIFOOFLOW_ENAB | + RDMAC_MODE_FIFOURUN_ENAB | RDMAC_MODE_FIFOOREAD_ENAB | + RDMAC_MODE_LNGREAD_ENAB)); + + tw32(RCVDCC_MODE, RCVDCC_MODE_ENABLE | RCVDCC_MODE_ATTN_ENABLE); + tw32(MBFREE_MODE, MBFREE_MODE_ENABLE); + tw32(SNDDATAC_MODE, SNDDATAC_MODE_ENABLE); + tw32(SNDBDC_MODE, SNDBDC_MODE_ENABLE | SNDBDC_MODE_ATTN_ENABLE); + tw32(RCVBDI_MODE, RCVBDI_MODE_ENABLE | RCVBDI_MODE_RCB_ATTN_ENAB); + tw32(RCVDBDI_MODE, RCVDBDI_MODE_ENABLE | RCVDBDI_MODE_INV_RING_SZ); + tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE); + tw32(SNDBDI_MODE, SNDBDI_MODE_ENABLE | SNDBDI_MODE_ATTN_ENABLE); + tw32(SNDBDS_MODE, SNDBDS_MODE_ENABLE | SNDBDS_MODE_ATTN_ENABLE); + + if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) { + err = tg3_load_5701_a0_firmware_fix(tp); + if (err) + return err; + } + + tp->tx_mode = TX_MODE_ENABLE; + tw32(MAC_TX_MODE, tp->tx_mode); + tp->rx_mode = RX_MODE_ENABLE; + tw32(MAC_RX_MODE, tp->rx_mode); + + if (tp->link_config.phy_is_low_power) { + tp->link_config.phy_is_low_power = 0; + tp->link_config.speed = tp->link_config.orig_speed; + tp->link_config.duplex = tp->link_config.orig_duplex; + tp->link_config.autoneg = tp->link_config.orig_autoneg; + } + + tp->mi_mode = MAC_MI_MODE_BASE; + tw32(MAC_MI_MODE, tp->mi_mode); + tw32(MAC_LED_CTRL, 0); + tw32(MAC_MI_STAT, MAC_MI_STAT_LNKSTAT_ATTN_ENAB); + tw32(MAC_RX_MODE, RX_MODE_RESET); + udelay(10); + tw32(MAC_RX_MODE, tp->rx_mode); + + if (tp->pci_chip_rev_id == CHIPREV_ID_5703_A1) + tw32(MAC_SERDES_CFG, 0x616000); + + err = tg3_setup_phy(tp); + if (err) + return err; + + if (tp->phy_id != PHY_ID_SERDES) { + u32 tmp; + + /* Clear CRC stats. */ + tg3_readphy(tp, 0x1e, &tmp); + tg3_writephy(tp, 0x1e, tmp | 0x8000); + tg3_readphy(tp, 0x14, &tmp); + } + + __tg3_set_rx_mode(tp->dev); + + /* Initialize receive rules. */ + tw32(MAC_RCV_RULE_0, 0xc2000000 & RCV_RULE_DISABLE_MASK); + tw32(MAC_RCV_VALUE_0, 0xffffffff & RCV_RULE_DISABLE_MASK); + tw32(MAC_RCV_RULE_1, 0x86000004 & RCV_RULE_DISABLE_MASK); + tw32(MAC_RCV_VALUE_1, 0xffffffff & RCV_RULE_DISABLE_MASK); +#if 0 + tw32(MAC_RCV_RULE_2, 0); tw32(MAC_RCV_VALUE_2, 0); + tw32(MAC_RCV_RULE_3, 0); tw32(MAC_RCV_VALUE_3, 0); +#endif + tw32(MAC_RCV_RULE_4, 0); tw32(MAC_RCV_VALUE_4, 0); + tw32(MAC_RCV_RULE_5, 0); tw32(MAC_RCV_VALUE_5, 0); + tw32(MAC_RCV_RULE_6, 0); tw32(MAC_RCV_VALUE_6, 0); + tw32(MAC_RCV_RULE_7, 0); tw32(MAC_RCV_VALUE_7, 0); + tw32(MAC_RCV_RULE_8, 0); tw32(MAC_RCV_VALUE_8, 0); + tw32(MAC_RCV_RULE_9, 0); tw32(MAC_RCV_VALUE_9, 0); + tw32(MAC_RCV_RULE_10, 0); tw32(MAC_RCV_VALUE_10, 0); + tw32(MAC_RCV_RULE_11, 0); tw32(MAC_RCV_VALUE_11, 0); + tw32(MAC_RCV_RULE_12, 0); tw32(MAC_RCV_VALUE_12, 0); + tw32(MAC_RCV_RULE_13, 0); tw32(MAC_RCV_VALUE_13, 0); + tw32(MAC_RCV_RULE_14, 0); tw32(MAC_RCV_VALUE_14, 0); + tw32(MAC_RCV_RULE_15, 0); tw32(MAC_RCV_VALUE_15, 0); + + if (tp->tg3_flags & TG3_FLAG_INIT_COMPLETE) + tg3_enable_ints(tp); + + return 0; +} + +/* Called at device open time to get the chip ready for + * packet processing. Invoked with tp->lock held. + */ +static int tg3_init_hw(struct tg3 *tp) +{ + int err; + + /* Force the chip into D0. */ + err = tg3_set_power_state(tp, 0); + if (err) + goto out; + + tw32(TG3PCI_MEM_WIN_BASE_ADDR, 0); + + err = tg3_reset_hw(tp); + +out: + return err; +} + +static void tg3_timer(unsigned long __opaque) +{ + struct tg3 *tp = (struct tg3 *) __opaque; + + spin_lock_irq(&tp->lock); + + if (!(tp->tg3_flags & TG3_FLAG_TAGGED_IRQ_STATUS)) { + /* All of this garbage is because on the 5700 the + * mailbox/status_block protocol the chip uses with + * the cpu is race prone. + */ + if (tp->hw_status->status & SD_STATUS_UPDATED) { + tw32(GRC_LOCAL_CTRL, + tp->grc_local_ctrl | GRC_LCLCTRL_SETINT); + } else { + tw32(HOSTCC_MODE, + (HOSTCC_MODE_ENABLE | HOSTCC_MODE_NOW)); + } + + if (!(tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { + tg3_halt(tp); + tg3_init_rings(tp); + tg3_init_hw(tp); + } + } + + /* This part only runs once per second. */ + if (!--tp->timer_counter) { + if (tp->tg3_flags & TG3_FLAG_USE_LINKCHG_REG) { + u32 mac_stat; + int phy_event; + + mac_stat = tr32(MAC_STATUS); + + phy_event = 0; + if (tp->tg3_flags & TG3_FLAG_USE_MI_INTERRUPT) { + if (mac_stat & MAC_STATUS_MI_INTERRUPT) + phy_event = 1; + } else if (mac_stat & MAC_STATUS_LNKSTATE_CHANGED) + phy_event = 1; + + if (phy_event) + tg3_setup_phy(tp); + } else if (tp->tg3_flags & TG3_FLAG_POLL_SERDES) { + u32 mac_stat = tr32(MAC_STATUS); + int need_setup = 0; + + if (netif_carrier_ok(tp->dev) && + (mac_stat & MAC_STATUS_LNKSTATE_CHANGED)) { + need_setup = 1; + } + if (! netif_carrier_ok(tp->dev) && + (mac_stat & MAC_STATUS_PCS_SYNCED)) { + need_setup = 1; + } + if (need_setup) { + tw32(MAC_MODE, + (tp->mac_mode & + ~MAC_MODE_PORT_MODE_MASK)); + udelay(40); + tw32(MAC_MODE, tp->mac_mode); + tg3_setup_phy(tp); + } + } + + tp->timer_counter = tp->timer_multiplier; + } + + spin_unlock_irq(&tp->lock); + + tp->timer.expires = jiffies + tp->timer_offset; + add_timer(&tp->timer); +} + +static int tg3_open(struct net_device *dev) +{ + struct tg3 *tp = dev->priv; + int err; + + spin_lock_irq(&tp->lock); + + tg3_disable_ints(tp); + tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; + + spin_unlock_irq(&tp->lock); + + /* If you move this call, make sure TG3_FLAG_HOST_TXDS in + * tp->tg3_flags is accurate at that new place. + */ + err = tg3_alloc_consistent(tp); + if (err) + return err; + + if (tp->tg3_flags & TG3_FLAG_TAGGED_IRQ_STATUS) + err = request_irq(dev->irq, tg3_interrupt_tagged, + SA_SHIRQ, dev->name, dev); + else + err = request_irq(dev->irq, tg3_interrupt, + SA_SHIRQ, dev->name, dev); + + if (err) { + tg3_free_consistent(tp); + return err; + } + + spin_lock_irq(&tp->lock); + + tg3_init_rings(tp); + + err = tg3_init_hw(tp); + if (err) { + tg3_halt(tp); + tg3_free_rings(tp); + } else { + if (tp->tg3_flags & TG3_FLAG_TAGGED_IRQ_STATUS) { + tp->timer_offset = HZ; + tp->timer_counter = tp->timer_multiplier = 1; + } else { + tp->timer_offset = HZ / 10; + tp->timer_counter = tp->timer_multiplier = 10; + } + + init_timer(&tp->timer); + tp->timer.expires = jiffies + tp->timer_offset; + tp->timer.data = (unsigned long) tp; + tp->timer.function = tg3_timer; + add_timer(&tp->timer); + + tp->last_rate_sample = jiffies; + tp->last_rx_count = 0; + tp->last_tx_count = 0; + + tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; + } + + spin_unlock_irq(&tp->lock); + + if (err) { + free_irq(dev->irq, dev); + tg3_free_consistent(tp); + return err; + } + + netif_start_queue(dev); + + spin_lock_irq(&tp->lock); + + tg3_enable_ints(tp); + + spin_unlock_irq(&tp->lock); + + return 0; +} + +#if 0 +/*static*/ void tg3_dump_state(struct tg3 *tp) +{ + u32 val32, val32_2, val32_3, val32_4, val32_5; + u16 val16; + int i; + + pci_read_config_word(tp->pdev, PCI_STATUS, &val16); + pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE, &val32); + printk("DEBUG: PCI status [%04x] TG3PCI state[%08x]\n", + val16, val32); + + /* MAC block */ + printk("DEBUG: MAC_MODE[%08x] MAC_STATUS[%08x]\n", + tr32(MAC_MODE), tr32(MAC_STATUS)); + printk(" MAC_EVENT[%08x] MAC_LED_CTRL[%08x]\n", + tr32(MAC_EVENT), tr32(MAC_LED_CTRL)); + printk("DEBUG: MAC_TX_MODE[%08x] MAC_TX_STATUS[%08x]\n", + tr32(MAC_TX_MODE), tr32(MAC_TX_STATUS)); + printk(" MAC_RX_MODE[%08x] MAC_RX_STATUS[%08x]\n", + tr32(MAC_RX_MODE), tr32(MAC_RX_STATUS)); + + /* Send data initiator control block */ + printk("DEBUG: SNDDATAI_MODE[%08x] SNDDATAI_STATUS[%08x]\n", + tr32(SNDDATAI_MODE), tr32(SNDDATAI_STATUS)); + printk(" SNDDATAI_STATSCTRL[%08x]\n", + tr32(SNDDATAI_STATSCTRL)); + + /* Send data completion control block */ + printk("DEBUG: SNDDATAC_MODE[%08x]\n", tr32(SNDDATAC_MODE)); + + /* Send BD ring selector block */ + printk("DEBUG: SNDBDS_MODE[%08x] SNDBDS_STATUS[%08x]\n", + tr32(SNDBDS_MODE), tr32(SNDBDS_STATUS)); + + /* Send BD initiator control block */ + printk("DEBUG: SNDBDI_MODE[%08x] SNDBDI_STATUS[%08x]\n", + tr32(SNDBDI_MODE), tr32(SNDBDI_STATUS)); + + /* Send BD completion control block */ + printk("DEBUG: SNDBDC_MODE[%08x]\n", tr32(SNDBDC_MODE)); + + /* Receive list placement control block */ + printk("DEBUG: RCVLPC_MODE[%08x] RCVLPC_STATUS[%08x]\n", + tr32(RCVLPC_MODE), tr32(RCVLPC_STATUS)); + printk(" RCVLPC_STATSCTRL[%08x]\n", + tr32(RCVLPC_STATSCTRL)); + + /* Receive data and receive BD initiator control block */ + printk("DEBUG: RCVDBDI_MODE[%08x] RCVDBDI_STATUS[%08x]\n", + tr32(RCVDBDI_MODE), tr32(RCVDBDI_STATUS)); + + /* Receive data completion control block */ + printk("DEBUG: RCVDCC_MODE[%08x]\n", + tr32(RCVDCC_MODE)); + + /* Receive BD initiator control block */ + printk("DEBUG: RCVBDI_MODE[%08x] RCVBDI_STATUS[%08x]\n", + tr32(RCVBDI_MODE), tr32(RCVBDI_STATUS)); + + /* Receive BD completion control block */ + printk("DEBUG: RCVCC_MODE[%08x] RCVCC_STATUS[%08x]\n", + tr32(RCVCC_MODE), tr32(RCVCC_STATUS)); + + /* Receive list selector control block */ + printk("DEBUG: RCVLSC_MODE[%08x] RCVLSC_STATUS[%08x]\n", + tr32(RCVLSC_MODE), tr32(RCVLSC_STATUS)); + + /* Mbuf cluster free block */ + printk("DEBUG: MBFREE_MODE[%08x] MBFREE_STATUS[%08x]\n", + tr32(MBFREE_MODE), tr32(MBFREE_STATUS)); + + /* Host coalescing control block */ + printk("DEBUG: HOSTCC_MODE[%08x] HOSTCC_STATUS[%08x]\n", + tr32(HOSTCC_MODE), tr32(HOSTCC_STATUS)); + printk("DEBUG: HOSTCC_STATS_BLK_HOST_ADDR[%08x%08x]\n", + tr32(HOSTCC_STATS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH), + tr32(HOSTCC_STATS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW)); + printk("DEBUG: HOSTCC_STATUS_BLK_HOST_ADDR[%08x%08x]\n", + tr32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH), + tr32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW)); + printk("DEBUG: HOSTCC_STATS_BLK_NIC_ADDR[%08x]\n", + tr32(HOSTCC_STATS_BLK_NIC_ADDR)); + printk("DEBUG: HOSTCC_STATUS_BLK_NIC_ADDR[%08x]\n", + tr32(HOSTCC_STATUS_BLK_NIC_ADDR)); + + /* Memory arbiter control block */ + printk("DEBUG: MEMARB_MODE[%08x] MEMARB_STATUS[%08x]\n", + tr32(MEMARB_MODE), tr32(MEMARB_STATUS)); + + /* Buffer manager control block */ + printk("DEBUG: BUFMGR_MODE[%08x] BUFMGR_STATUS[%08x]\n", + tr32(BUFMGR_MODE), tr32(BUFMGR_STATUS)); + printk("DEBUG: BUFMGR_MB_POOL_ADDR[%08x] BUFMGR_MB_POOL_SIZE[%08x]\n", + tr32(BUFMGR_MB_POOL_ADDR), tr32(BUFMGR_MB_POOL_SIZE)); + printk("DEBUG: BUFMGR_DMA_DESC_POOL_ADDR[%08x] " + "BUFMGR_DMA_DESC_POOL_SIZE[%08x]\n", + tr32(BUFMGR_DMA_DESC_POOL_ADDR), + tr32(BUFMGR_DMA_DESC_POOL_SIZE)); + + /* Read DMA control block */ + printk("DEBUG: RDMAC_MODE[%08x] RDMAC_STATUS[%08x]\n", + tr32(RDMAC_MODE), tr32(RDMAC_STATUS)); + + /* Write DMA control block */ + printk("DEBUG: WDMAC_MODE[%08x] WDMAC_STATUS[%08x]\n", + tr32(WDMAC_MODE), tr32(WDMAC_STATUS)); + + /* DMA completion block */ + printk("DEBUG: DMAC_MODE[%08x]\n", + tr32(DMAC_MODE)); + + /* GRC block */ + printk("DEBUG: GRC_MODE[%08x] GRC_MISC_CFG[%08x]\n", + tr32(GRC_MODE), tr32(GRC_MISC_CFG)); + printk("DEBUG: GRC_LOCAL_CTRL[%08x]\n", + tr32(GRC_LOCAL_CTRL)); + + /* TG3_BDINFOs */ + printk("DEBUG: RCVDBDI_JUMBO_BD[%08x%08x:%08x:%08x]\n", + tr32(RCVDBDI_JUMBO_BD + 0x0), + tr32(RCVDBDI_JUMBO_BD + 0x4), + tr32(RCVDBDI_JUMBO_BD + 0x8), + tr32(RCVDBDI_JUMBO_BD + 0xc)); + printk("DEBUG: RCVDBDI_STD_BD[%08x%08x:%08x:%08x]\n", + tr32(RCVDBDI_STD_BD + 0x0), + tr32(RCVDBDI_STD_BD + 0x4), + tr32(RCVDBDI_STD_BD + 0x8), + tr32(RCVDBDI_STD_BD + 0xc)); + printk("DEBUG: RCVDBDI_MINI_BD[%08x%08x:%08x:%08x]\n", + tr32(RCVDBDI_MINI_BD + 0x0), + tr32(RCVDBDI_MINI_BD + 0x4), + tr32(RCVDBDI_MINI_BD + 0x8), + tr32(RCVDBDI_MINI_BD + 0xc)); + + tg3_read_mem(tp, NIC_SRAM_SEND_RCB + 0x0, &val32); + tg3_read_mem(tp, NIC_SRAM_SEND_RCB + 0x4, &val32_2); + tg3_read_mem(tp, NIC_SRAM_SEND_RCB + 0x8, &val32_3); + tg3_read_mem(tp, NIC_SRAM_SEND_RCB + 0xc, &val32_4); + printk("DEBUG: SRAM_SEND_RCB_0[%08x%08x:%08x:%08x]\n", + val32, val32_2, val32_3, val32_4); + + tg3_read_mem(tp, NIC_SRAM_RCV_RET_RCB + 0x0, &val32); + tg3_read_mem(tp, NIC_SRAM_RCV_RET_RCB + 0x4, &val32_2); + tg3_read_mem(tp, NIC_SRAM_RCV_RET_RCB + 0x8, &val32_3); + tg3_read_mem(tp, NIC_SRAM_RCV_RET_RCB + 0xc, &val32_4); + printk("DEBUG: SRAM_RCV_RET_RCB_0[%08x%08x:%08x:%08x]\n", + val32, val32_2, val32_3, val32_4); + + tg3_read_mem(tp, NIC_SRAM_STATUS_BLK + 0x0, &val32); + tg3_read_mem(tp, NIC_SRAM_STATUS_BLK + 0x4, &val32_2); + tg3_read_mem(tp, NIC_SRAM_STATUS_BLK + 0x8, &val32_3); + tg3_read_mem(tp, NIC_SRAM_STATUS_BLK + 0xc, &val32_4); + tg3_read_mem(tp, NIC_SRAM_STATUS_BLK + 0x10, &val32_5); + printk("DEBUG: SRAM_STATUS_BLK[%08x:%08x:%08x:%08x:%08x]\n", + val32, val32_2, val32_3, val32_4, val32_5); + + /* SW status block */ + printk("DEBUG: Host status block [%08x:%08x:(%04x:%04x:%04x):(%04x:%04x)]\n", + tp->hw_status->status, + tp->hw_status->status_tag, + tp->hw_status->rx_jumbo_consumer, + tp->hw_status->rx_consumer, + tp->hw_status->rx_mini_consumer, + tp->hw_status->idx[0].rx_producer, + tp->hw_status->idx[0].tx_consumer); + + /* SW statistics block */ + printk("DEBUG: Host statistics block [%08x:%08x:%08x:%08x]\n", + ((u32 *)tp->hw_stats)[0], + ((u32 *)tp->hw_stats)[1], + ((u32 *)tp->hw_stats)[2], + ((u32 *)tp->hw_stats)[3]); + + /* Mailboxes */ + printk("DEBUG: SNDHOST_PROD[%08x%08x] SNDNIC_PROD[%08x%08x]\n", + tr32(MAILBOX_SNDHOST_PROD_IDX_0 + 0x0), + tr32(MAILBOX_SNDHOST_PROD_IDX_0 + 0x4), + tr32(MAILBOX_SNDNIC_PROD_IDX_0 + 0x0), + tr32(MAILBOX_SNDNIC_PROD_IDX_0 + 0x4)); + + /* NIC side send descriptors. */ + for (i = 0; i < 6; i++) { + unsigned long txd; + + txd = tp->regs + NIC_SRAM_WIN_BASE + NIC_SRAM_TX_BUFFER_DESC + + (i * sizeof(struct tg3_tx_buffer_desc)); + printk("DEBUG: NIC TXD(%d)[%08x:%08x:%08x:%08x]\n", + i, + readl(txd + 0x0), readl(txd + 0x4), + readl(txd + 0x8), readl(txd + 0xc)); + } + + /* NIC side RX descriptors. */ + for (i = 0; i < 6; i++) { + unsigned long rxd; + + rxd = tp->regs + NIC_SRAM_WIN_BASE + NIC_SRAM_RX_BUFFER_DESC + + (i * sizeof(struct tg3_rx_buffer_desc)); + printk("DEBUG: NIC RXD_STD(%d)[0][%08x:%08x:%08x:%08x]\n", + i, + readl(rxd + 0x0), readl(rxd + 0x4), + readl(rxd + 0x8), readl(rxd + 0xc)); + rxd += (4 * sizeof(u32)); + printk("DEBUG: NIC RXD_STD(%d)[1][%08x:%08x:%08x:%08x]\n", + i, + readl(rxd + 0x0), readl(rxd + 0x4), + readl(rxd + 0x8), readl(rxd + 0xc)); + } +#if TG3_MINI_RING_WORKS + for (i = 0; i < 6; i++) { + unsigned long rxd; + + rxd = tp->regs + NIC_SRAM_WIN_BASE + NIC_SRAM_RX_MINI_BUFFER_DESC + + (i * sizeof(struct tg3_rx_buffer_desc)); + printk("DEBUG: NIC RXD_MINI(%d)[0][%08x:%08x:%08x:%08x]\n", + i, + readl(rxd + 0x0), readl(rxd + 0x4), + readl(rxd + 0x8), readl(rxd + 0xc)); + rxd += (4 * sizeof(u32)); + printk("DEBUG: NIC RXD_MINI(%d)[1][%08x:%08x:%08x:%08x]\n", + i, + readl(rxd + 0x0), readl(rxd + 0x4), + readl(rxd + 0x8), readl(rxd + 0xc)); + } +#endif + + for (i = 0; i < 6; i++) { + unsigned long rxd; + + rxd = tp->regs + NIC_SRAM_WIN_BASE + NIC_SRAM_RX_JUMBO_BUFFER_DESC + + (i * sizeof(struct tg3_rx_buffer_desc)); + printk("DEBUG: NIC RXD_JUMBO(%d)[0][%08x:%08x:%08x:%08x]\n", + i, + readl(rxd + 0x0), readl(rxd + 0x4), + readl(rxd + 0x8), readl(rxd + 0xc)); + rxd += (4 * sizeof(u32)); + printk("DEBUG: NIC RXD_JUMBO(%d)[1][%08x:%08x:%08x:%08x]\n", + i, + readl(rxd + 0x0), readl(rxd + 0x4), + readl(rxd + 0x8), readl(rxd + 0xc)); + } +} +#endif + +static struct net_device_stats *tg3_get_stats(struct net_device *); + +static int tg3_close(struct net_device *dev) +{ + struct tg3 *tp = dev->priv; + + netif_stop_queue(dev); + + del_timer_sync(&tp->timer); + + spin_lock_irq(&tp->lock); +#if 0 + tg3_dump_state(tp); +#endif + + tg3_disable_ints(tp); + + tg3_halt(tp); + tg3_free_rings(tp); + tp->tg3_flags &= + ~(TG3_FLAG_INIT_COMPLETE | + TG3_FLAG_GOT_SERDES_FLOWCTL); + netif_carrier_off(tp->dev); + + spin_unlock_irq(&tp->lock); + + free_irq(dev->irq, dev); + + memcpy(&tp->net_stats_prev, tg3_get_stats(tp->dev), + sizeof(tp->net_stats_prev)); + + tg3_free_consistent(tp); + + return 0; +} + +static inline unsigned long get_stat64(tg3_stat64_t *val) +{ + unsigned long ret; + +#if (BITS_PER_LONG == 32) + if (val->high != 0) + ret = ~0UL; + else + ret = val->low; +#else + ret = ((u64)val->high << 32) | ((u64)val->low); +#endif + return ret; +} + +static unsigned long calc_crc_errors(struct tg3 *tp) +{ + struct tg3_hw_stats *hw_stats = tp->hw_stats; + + if (tp->phy_id != PHY_ID_SERDES && + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)) { + unsigned long flags; + u32 val; + + spin_lock_irqsave(&tp->lock, flags); + tg3_readphy(tp, 0x1e, &val); + tg3_writephy(tp, 0x1e, val | 0x8000); + tg3_readphy(tp, 0x14, &val); + spin_unlock_irqrestore(&tp->lock, flags); + + tp->phy_crc_errors += val; + + return tp->phy_crc_errors; + } + + return get_stat64(&hw_stats->rx_fcs_errors); +} + +static struct net_device_stats *tg3_get_stats(struct net_device *dev) +{ + struct tg3 *tp = dev->priv; + struct net_device_stats *stats = &tp->net_stats; + struct net_device_stats *old_stats = &tp->net_stats_prev; + struct tg3_hw_stats *hw_stats = tp->hw_stats; + + if (!hw_stats) + return old_stats; + + stats->rx_packets = old_stats->rx_packets + + get_stat64(&hw_stats->rx_ucast_packets) + + get_stat64(&hw_stats->rx_mcast_packets) + + get_stat64(&hw_stats->rx_bcast_packets); + + stats->tx_packets = old_stats->tx_packets + + get_stat64(&hw_stats->COS_out_packets[0]); + + stats->rx_bytes = old_stats->rx_bytes + + get_stat64(&hw_stats->rx_octets); + stats->tx_bytes = old_stats->tx_bytes + + get_stat64(&hw_stats->tx_octets); + + stats->rx_errors = old_stats->rx_errors + + get_stat64(&hw_stats->rx_errors); + stats->tx_errors = old_stats->tx_errors + + get_stat64(&hw_stats->tx_errors) + + get_stat64(&hw_stats->tx_mac_errors) + + get_stat64(&hw_stats->tx_carrier_sense_errors) + + get_stat64(&hw_stats->tx_discards); + + stats->multicast = old_stats->multicast + + get_stat64(&hw_stats->rx_mcast_packets); + stats->collisions = old_stats->collisions + + get_stat64(&hw_stats->tx_collisions); + + stats->rx_length_errors = old_stats->rx_length_errors + + get_stat64(&hw_stats->rx_frame_too_long_errors) + + get_stat64(&hw_stats->rx_undersize_packets); + + stats->rx_over_errors = old_stats->rx_over_errors + + get_stat64(&hw_stats->rxbds_empty); + stats->rx_frame_errors = old_stats->rx_frame_errors + + get_stat64(&hw_stats->rx_align_errors); + stats->tx_aborted_errors = old_stats->tx_aborted_errors + + get_stat64(&hw_stats->tx_discards); + stats->tx_carrier_errors = old_stats->tx_carrier_errors + + get_stat64(&hw_stats->tx_carrier_sense_errors); + + stats->rx_crc_errors = old_stats->rx_crc_errors + + calc_crc_errors(tp); + + return stats; +} + +static inline u32 calc_crc(unsigned char *buf, int len) +{ + u32 reg; + u32 tmp; + int j, k; + + reg = 0xffffffff; + + for (j = 0; j < len; j++) { + reg ^= buf[j]; + + for (k = 0; k < 8; k++) { + tmp = reg & 0x01; + + reg >>= 1; + + if (tmp) { + reg ^= 0xedb88320; + } + } + } + + return ~reg; +} + +static void tg3_set_multi(struct tg3 *tp, unsigned int accept_all) +{ + /* accept or reject all multicast frames */ + tw32 (MAC_HASH_REG_0, accept_all ? 0xffffffff : 0); + tw32 (MAC_HASH_REG_1, accept_all ? 0xffffffff : 0); + tw32 (MAC_HASH_REG_2, accept_all ? 0xffffffff : 0); + tw32 (MAC_HASH_REG_3, accept_all ? 0xffffffff : 0); +} + +static void __tg3_set_rx_mode(struct net_device *dev) +{ + struct tg3 *tp = dev->priv; + u32 rx_mode; + + rx_mode = tp->rx_mode & ~RX_MODE_PROMISC; + + if (dev->flags & IFF_PROMISC) { + /* Promiscuous mode. */ + rx_mode |= RX_MODE_PROMISC; + } else if (dev->flags & IFF_ALLMULTI) { + /* Accept all multicast. */ + tg3_set_multi (tp, 1); + } else if (dev->mc_count < 1) { + /* Reject all multicast. */ + tg3_set_multi (tp, 0); + } else { + /* Accept one or more multicast(s). */ + struct dev_mc_list *mclist; + unsigned int i; + u32 mc_filter[4] = { 0, }; + u32 regidx; + u32 bit; + u32 crc; + + for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; + i++, mclist = mclist->next) { + + crc = calc_crc (mclist->dmi_addr, ETH_ALEN); + bit = ~crc & 0x7f; + regidx = (bit & 0x60) >> 5; + bit &= 0x1f; + mc_filter[regidx] |= (1 << bit); + } + + tw32 (MAC_HASH_REG_0, mc_filter[0]); + tw32 (MAC_HASH_REG_1, mc_filter[1]); + tw32 (MAC_HASH_REG_2, mc_filter[2]); + tw32 (MAC_HASH_REG_3, mc_filter[3]); + } + + if (rx_mode != tp->rx_mode) { + tp->rx_mode = rx_mode; + tw32 (MAC_RX_MODE, rx_mode); + } +} + +static void tg3_set_rx_mode(struct net_device *dev) +{ + struct tg3 *tp = dev->priv; + + spin_lock_irq(&tp->lock); + __tg3_set_rx_mode(dev); + spin_unlock_irq(&tp->lock); +} + +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,18)) +#define TG3_REGDUMP_LEN (32 * 1024) + +static u8 *tg3_get_regs(struct tg3 *tp) +{ + u8 *orig_p = kmalloc(TG3_REGDUMP_LEN, GFP_KERNEL); + u8 *p; + int i; + + if (orig_p == NULL) + return NULL; + + memset(orig_p, 0, TG3_REGDUMP_LEN); + + spin_lock_irq(&tp->lock); + +#define __GET_REG32(reg) (*((u32 *)(p))++ = tr32(reg)) +#define GET_REG32_LOOP(base,len) \ +do { p = orig_p + (base); \ + for (i = 0; i < len; i += 4) \ + __GET_REG32((base) + i); \ +} while (0) +#define GET_REG32_1(reg) \ +do { p = orig_p + (reg); \ + __GET_REG32((reg)); \ +} while (0) + + GET_REG32_LOOP(TG3PCI_VENDOR, 0xb0); + GET_REG32_LOOP(MAILBOX_INTERRUPT_0, 0x200); + GET_REG32_LOOP(MAC_MODE, 0x4f0); + GET_REG32_LOOP(SNDDATAI_MODE, 0xe0); + GET_REG32_1(SNDDATAC_MODE); + GET_REG32_LOOP(SNDBDS_MODE, 0x80); + GET_REG32_LOOP(SNDBDI_MODE, 0x48); + GET_REG32_1(SNDBDC_MODE); + GET_REG32_LOOP(RCVLPC_MODE, 0x20); + GET_REG32_LOOP(RCVLPC_SELLST_BASE, 0x15c); + GET_REG32_LOOP(RCVDBDI_MODE, 0x0c); + GET_REG32_LOOP(RCVDBDI_JUMBO_BD, 0x3c); + GET_REG32_LOOP(RCVDBDI_BD_PROD_IDX_0, 0x44); + GET_REG32_1(RCVDCC_MODE); + GET_REG32_LOOP(RCVBDI_MODE, 0x20); + GET_REG32_LOOP(RCVCC_MODE, 0x14); + GET_REG32_LOOP(RCVLSC_MODE, 0x08); + GET_REG32_1(MBFREE_MODE); + GET_REG32_LOOP(HOSTCC_MODE, 0x100); + GET_REG32_LOOP(MEMARB_MODE, 0x10); + GET_REG32_LOOP(BUFMGR_MODE, 0x58); + GET_REG32_LOOP(RDMAC_MODE, 0x08); + GET_REG32_LOOP(WDMAC_MODE, 0x08); + GET_REG32_LOOP(RX_CPU_BASE, 0x280); + GET_REG32_LOOP(TX_CPU_BASE, 0x280); + GET_REG32_LOOP(GRCMBOX_INTERRUPT_0, 0x110); + GET_REG32_LOOP(FTQ_RESET, 0x120); + GET_REG32_LOOP(MSGINT_MODE, 0x0c); + GET_REG32_1(DMAC_MODE); + GET_REG32_LOOP(GRC_MODE, 0x4c); + GET_REG32_LOOP(NVRAM_CMD, 0x24); + +#undef __GET_REG32 +#undef GET_REG32_LOOP +#undef GET_REG32_1 + + spin_unlock_irq(&tp->lock); + + return orig_p; +} + +static void tg3_to_ethtool_coal(struct tg3 *tp, + struct ethtool_coalesce *ecoal) +{ + ecoal->rx_coalesce_usecs = + tp->coalesce_config.rx_coalesce_ticks_def; + ecoal->rx_max_coalesced_frames = + tp->coalesce_config.rx_max_coalesced_frames_def; + ecoal->rx_coalesce_usecs_irq = + tp->coalesce_config.rx_coalesce_ticks_during_int_def; + ecoal->rx_max_coalesced_frames_irq = + tp->coalesce_config.rx_max_coalesced_frames_during_int_def; + + ecoal->tx_coalesce_usecs = + tp->coalesce_config.tx_coalesce_ticks_def; + ecoal->tx_max_coalesced_frames = + tp->coalesce_config.tx_max_coalesced_frames_def; + ecoal->tx_coalesce_usecs_irq = + tp->coalesce_config.tx_coalesce_ticks_during_int_def; + ecoal->tx_max_coalesced_frames_irq = + tp->coalesce_config.tx_max_coalesced_frames_during_int_def; + + ecoal->stats_block_coalesce_usecs = + tp->coalesce_config.stats_coalesce_ticks_def; + + ecoal->use_adaptive_rx_coalesce = + (tp->tg3_flags & TG3_FLAG_ADAPTIVE_RX) != 0; + ecoal->use_adaptive_tx_coalesce = + (tp->tg3_flags & TG3_FLAG_ADAPTIVE_TX) != 0; + + ecoal->pkt_rate_low = + tp->coalesce_config.pkt_rate_low; + ecoal->rx_coalesce_usecs_low = + tp->coalesce_config.rx_coalesce_ticks_low; + ecoal->rx_max_coalesced_frames_low = + tp->coalesce_config.rx_max_coalesced_frames_low; + ecoal->tx_coalesce_usecs_low = + tp->coalesce_config.tx_coalesce_ticks_low; + ecoal->tx_max_coalesced_frames_low = + tp->coalesce_config.tx_max_coalesced_frames_low; + + ecoal->pkt_rate_high = + tp->coalesce_config.pkt_rate_high; + ecoal->rx_coalesce_usecs_high = + tp->coalesce_config.rx_coalesce_ticks_high; + ecoal->rx_max_coalesced_frames_high = + tp->coalesce_config.rx_max_coalesced_frames_high; + ecoal->tx_coalesce_usecs_high = + tp->coalesce_config.tx_coalesce_ticks_high; + ecoal->tx_max_coalesced_frames_high = + tp->coalesce_config.tx_max_coalesced_frames_high; + + ecoal->rate_sample_interval = + tp->coalesce_config.rate_sample_jiffies / HZ; +} + +static int tg3_from_ethtool_coal(struct tg3 *tp, + struct ethtool_coalesce *ecoal) +{ + /* Make sure we are not getting garbage. */ + if ((ecoal->rx_coalesce_usecs == 0 && + ecoal->rx_max_coalesced_frames == 0) || + (ecoal->tx_coalesce_usecs == 0 && + ecoal->tx_max_coalesced_frames == 0) || + ecoal->stats_block_coalesce_usecs == 0) + return -EINVAL; + if (ecoal->use_adaptive_rx_coalesce || + ecoal->use_adaptive_tx_coalesce) { + if (ecoal->pkt_rate_low > ecoal->pkt_rate_high) + return -EINVAL; + if (ecoal->rate_sample_interval == 0) + return -EINVAL; + if (ecoal->use_adaptive_rx_coalesce && + ((ecoal->rx_coalesce_usecs_low == 0 && + ecoal->rx_max_coalesced_frames_low == 0) || + (ecoal->rx_coalesce_usecs_high == 0 && + ecoal->rx_max_coalesced_frames_high == 0))) + return -EINVAL; + if (ecoal->use_adaptive_tx_coalesce && + ((ecoal->tx_coalesce_usecs_low == 0 && + ecoal->tx_max_coalesced_frames_low == 0) || + (ecoal->tx_coalesce_usecs_high == 0 && + ecoal->tx_max_coalesced_frames_high == 0))) + return -EINVAL; + } + + /* Looks good, let it rip. */ + spin_lock_irq(&tp->lock); + tp->coalesce_config.rx_coalesce_ticks = + tp->coalesce_config.rx_coalesce_ticks_def = + ecoal->rx_coalesce_usecs; + tp->coalesce_config.rx_max_coalesced_frames = + tp->coalesce_config.rx_max_coalesced_frames_def = + ecoal->rx_max_coalesced_frames; + tp->coalesce_config.rx_coalesce_ticks_during_int = + tp->coalesce_config.rx_coalesce_ticks_during_int_def = + ecoal->rx_coalesce_usecs_irq; + tp->coalesce_config.rx_max_coalesced_frames_during_int = + tp->coalesce_config.rx_max_coalesced_frames_during_int_def = + ecoal->rx_max_coalesced_frames_irq; + tp->coalesce_config.tx_coalesce_ticks = + tp->coalesce_config.tx_coalesce_ticks_def = + ecoal->tx_coalesce_usecs; + tp->coalesce_config.tx_max_coalesced_frames = + tp->coalesce_config.tx_max_coalesced_frames_def = + ecoal->tx_max_coalesced_frames; + tp->coalesce_config.tx_coalesce_ticks_during_int = + tp->coalesce_config.tx_coalesce_ticks_during_int_def = + ecoal->tx_coalesce_usecs_irq; + tp->coalesce_config.tx_max_coalesced_frames_during_int = + tp->coalesce_config.tx_max_coalesced_frames_during_int_def = + ecoal->tx_max_coalesced_frames_irq; + tp->coalesce_config.stats_coalesce_ticks = + tp->coalesce_config.stats_coalesce_ticks_def = + ecoal->stats_block_coalesce_usecs; + + if (ecoal->use_adaptive_rx_coalesce) + tp->tg3_flags |= TG3_FLAG_ADAPTIVE_RX; + else + tp->tg3_flags &= ~TG3_FLAG_ADAPTIVE_RX; + if (ecoal->use_adaptive_tx_coalesce) + tp->tg3_flags |= TG3_FLAG_ADAPTIVE_TX; + else + tp->tg3_flags &= ~TG3_FLAG_ADAPTIVE_TX; + + tp->coalesce_config.pkt_rate_low = ecoal->pkt_rate_low; + tp->coalesce_config.pkt_rate_high = ecoal->pkt_rate_high; + tp->coalesce_config.rate_sample_jiffies = + ecoal->rate_sample_interval * HZ; + + tp->coalesce_config.rx_coalesce_ticks_low = + ecoal->rx_coalesce_usecs_low; + tp->coalesce_config.rx_max_coalesced_frames_low = + ecoal->rx_max_coalesced_frames_low; + tp->coalesce_config.tx_coalesce_ticks_low = + ecoal->tx_coalesce_usecs_low; + tp->coalesce_config.tx_max_coalesced_frames_low = + ecoal->tx_max_coalesced_frames_low; + + tp->coalesce_config.rx_coalesce_ticks_high = + ecoal->rx_coalesce_usecs_high; + tp->coalesce_config.rx_max_coalesced_frames_high = + ecoal->rx_max_coalesced_frames_high; + tp->coalesce_config.tx_coalesce_ticks_high = + ecoal->tx_coalesce_usecs_high; + tp->coalesce_config.tx_max_coalesced_frames_high = + ecoal->tx_max_coalesced_frames_high; + + tw32(HOSTCC_RXCOL_TICKS, + tp->coalesce_config.rx_coalesce_ticks_def); + tw32(HOSTCC_RXMAX_FRAMES, + tp->coalesce_config.rx_max_coalesced_frames_def); + tw32(HOSTCC_RXCOAL_TICK_INT, + tp->coalesce_config.rx_coalesce_ticks_during_int_def); + tw32(HOSTCC_RXCOAL_MAXF_INT, + tp->coalesce_config.rx_max_coalesced_frames_during_int_def); + tw32(HOSTCC_TXCOL_TICKS, + tp->coalesce_config.tx_coalesce_ticks_def); + tw32(HOSTCC_TXMAX_FRAMES, + tp->coalesce_config.tx_max_coalesced_frames_def); + tw32(HOSTCC_TXCOAL_TICK_INT, + tp->coalesce_config.tx_coalesce_ticks_during_int_def); + tw32(HOSTCC_TXCOAL_MAXF_INT, + tp->coalesce_config.tx_max_coalesced_frames_during_int_def); + tw32(HOSTCC_STAT_COAL_TICKS, + tp->coalesce_config.stats_coalesce_ticks_def); + + spin_unlock_irq(&tp->lock); + + return 0; +} + +static int tg3_ethtool_ioctl (struct net_device *dev, void *useraddr) +{ + struct tg3 *tp = dev->priv; + struct pci_dev *pci_dev = tp->pdev; + u32 ethcmd; + + if (copy_from_user (ðcmd, useraddr, sizeof (ethcmd))) + return -EFAULT; + + switch (ethcmd) { + case ETHTOOL_GDRVINFO:{ + struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; + strcpy (info.driver, DRV_MODULE_NAME); + strcpy (info.version, DRV_MODULE_VERSION); + memset(&info.fw_version, 0, sizeof(info.fw_version)); + strcpy (info.bus_info, pci_dev->slot_name); + info.eedump_len = 0; + info.regdump_len = TG3_REGDUMP_LEN; + if (copy_to_user (useraddr, &info, sizeof (info))) + return -EFAULT; + return 0; + } + + case ETHTOOL_GSET: { + struct ethtool_cmd cmd = { ETHTOOL_GSET }; + + if (!(tp->tg3_flags & TG3_FLAG_INIT_COMPLETE) || + tp->link_config.phy_is_low_power) + return -EAGAIN; + cmd.supported = (SUPPORTED_Autoneg); + + if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY)) + cmd.supported |= (SUPPORTED_1000baseT_Half | + SUPPORTED_1000baseT_Full); + + if (tp->phy_id != PHY_ID_SERDES) + cmd.supported |= (SUPPORTED_100baseT_Half | + SUPPORTED_100baseT_Full | + SUPPORTED_10baseT_Half | + SUPPORTED_10baseT_Full | + SUPPORTED_MII); + else + cmd.supported |= SUPPORTED_FIBRE; + + cmd.advertising = tp->link_config.advertising; + cmd.speed = tp->link_config.active_speed; + cmd.duplex = tp->link_config.active_duplex; + cmd.port = 0; + cmd.phy_address = PHY_ADDR; + cmd.transceiver = 0; + cmd.autoneg = tp->link_config.autoneg; + cmd.maxtxpkt = tp->coalesce_config.tx_max_coalesced_frames_def; + cmd.maxrxpkt = tp->coalesce_config.rx_max_coalesced_frames_def; + if (copy_to_user(useraddr, &cmd, sizeof(cmd))) + return -EFAULT; + return 0; + } + case ETHTOOL_SSET: { + struct ethtool_cmd cmd; + + if (!(tp->tg3_flags & TG3_FLAG_INIT_COMPLETE) || + tp->link_config.phy_is_low_power) + return -EAGAIN; + + if (copy_from_user(&cmd, useraddr, sizeof(cmd))) + return -EFAULT; + + /* Fiber PHY only supports 1000 full/half */ + if (cmd.autoneg == AUTONEG_ENABLE) { + if (tp->phy_id == PHY_ID_SERDES && + (cmd.advertising & + (ADVERTISED_10baseT_Half | + ADVERTISED_10baseT_Full | + ADVERTISED_100baseT_Half | + ADVERTISED_100baseT_Full))) + return -EINVAL; + if ((tp->tg3_flags & TG3_FLAG_10_100_ONLY) && + (cmd.advertising & + (ADVERTISED_1000baseT_Half | + ADVERTISED_1000baseT_Full))) + return -EINVAL; + } else { + if (tp->phy_id == PHY_ID_SERDES && + (cmd.speed == SPEED_10 || + cmd.speed == SPEED_100)) + return -EINVAL; + if ((tp->tg3_flags & TG3_FLAG_10_100_ONLY) && + (cmd.speed == SPEED_10 || + cmd.speed == SPEED_100)) + return -EINVAL; + } + + spin_lock_irq(&tp->lock); + + tp->link_config.autoneg = cmd.autoneg; + if (cmd.autoneg == AUTONEG_ENABLE) { + tp->link_config.advertising = cmd.advertising; + tp->link_config.speed = SPEED_INVALID; + tp->link_config.duplex = DUPLEX_INVALID; + } else { + tp->link_config.speed = cmd.speed; + tp->link_config.duplex = cmd.duplex; + } + + if (cmd.maxtxpkt || cmd.maxrxpkt) { + tp->coalesce_config.tx_max_coalesced_frames_def = + tp->coalesce_config.tx_max_coalesced_frames = + cmd.maxtxpkt; + tp->coalesce_config.rx_max_coalesced_frames_def = + tp->coalesce_config.rx_max_coalesced_frames = + cmd.maxrxpkt; + + /* Coalescing config bits can be updated without + * a full chip reset. + */ + tw32(HOSTCC_TXMAX_FRAMES, + tp->coalesce_config.tx_max_coalesced_frames); + tw32(HOSTCC_RXMAX_FRAMES, + tp->coalesce_config.rx_max_coalesced_frames); + } + tg3_setup_phy(tp); + spin_unlock_irq(&tp->lock); + + return 0; + } + + case ETHTOOL_GREGS: { + struct ethtool_regs regs; + u8 *regbuf; + int ret; + + if (copy_from_user(®s, useraddr, sizeof(regs))) + return -EFAULT; + if (regs.len > TG3_REGDUMP_LEN) + regs.len = TG3_REGDUMP_LEN; + regs.version = 0; + if (copy_to_user(useraddr, ®s, sizeof(regs))) + return -EFAULT; + + regbuf = tg3_get_regs(tp); + if (!regbuf) + return -ENOMEM; + + useraddr += offsetof(struct ethtool_regs, data); + ret = 0; + if (copy_to_user(useraddr, regbuf, regs.len)) + ret = -EFAULT; + kfree(regbuf); + return ret; + } + case ETHTOOL_GWOL: { + struct ethtool_wolinfo wol = { ETHTOOL_GWOL }; + + wol.supported = WAKE_MAGIC; + wol.wolopts = 0; + if (tp->tg3_flags & TG3_FLAG_WOL_ENABLE) + wol.wolopts = WAKE_MAGIC; + memset(&wol.sopass, 0, sizeof(wol.sopass)); + if (copy_to_user(useraddr, &wol, sizeof(wol))) + return -EFAULT; + return 0; + } + case ETHTOOL_SWOL: { + struct ethtool_wolinfo wol; + + if (copy_from_user(&wol, useraddr, sizeof(wol))) + return -EFAULT; + if (wol.wolopts & ~WAKE_MAGIC) + return -EINVAL; + spin_lock_irq(&tp->lock); + if (wol.wolopts & WAKE_MAGIC) + tp->tg3_flags |= TG3_FLAG_WOL_ENABLE; + else + tp->tg3_flags &= ~TG3_FLAG_WOL_ENABLE; + spin_unlock_irq(&tp->lock); + + return 0; + } + case ETHTOOL_GMSGLVL: { + struct ethtool_value edata = { ETHTOOL_GMSGLVL }; + edata.data = tp->msg_enable; + if (copy_to_user(useraddr, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } + case ETHTOOL_SMSGLVL: { + struct ethtool_value edata; + if (copy_from_user(&edata, useraddr, sizeof(edata))) + return -EFAULT; + tp->msg_enable = edata.data; + return 0; + } + case ETHTOOL_NWAY_RST: { + u32 bmcr; + int r; + + spin_lock_irq(&tp->lock); + tg3_readphy(tp, MII_BMCR, &bmcr); + tg3_readphy(tp, MII_BMCR, &bmcr); + r = -EINVAL; + if (bmcr & BMCR_ANENABLE) { + tg3_writephy(tp, MII_BMCR, + bmcr | BMCR_ANRESTART); + r = 0; + } + spin_unlock_irq(&tp->lock); + + return r; + } + case ETHTOOL_GLINK: { + struct ethtool_value edata = { ETHTOOL_GLINK }; + edata.data = netif_carrier_ok(tp->dev) ? 1 : 0; + if (copy_to_user(useraddr, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } + case ETHTOOL_GCOALESCE: { + struct ethtool_coalesce ecoal = { ETHTOOL_GCOALESCE }; + + tg3_to_ethtool_coal(tp, &ecoal); + if (copy_to_user(useraddr, &ecoal, sizeof(ecoal))) + return -EFAULT; + return 0; + } + case ETHTOOL_SCOALESCE: { + struct ethtool_coalesce ecoal; + + if (copy_from_user(&ecoal, useraddr, sizeof(ecoal))) + return -EINVAL; + + return tg3_from_ethtool_coal(tp, &ecoal); + } + case ETHTOOL_GRINGPARAM: { + struct ethtool_ringparam ering = { ETHTOOL_GRINGPARAM }; + + ering.rx_max_pending = TG3_RX_RING_SIZE - 1; +#if TG3_MINI_RING_WORKS + ering.rx_mini_max_pending = TG3_RX_MINI_RING_SIZE - 1; +#else + ering.rx_mini_max_pending = 0; +#endif + ering.rx_jumbo_max_pending = TG3_RX_JUMBO_RING_SIZE - 1; + + ering.rx_pending = tp->rx_pending; +#if TG3_MINI_RING_WORKS + ering.rx_mini_pending = tp->rx_mini_pending; +#else + ering.rx_mini_pending = 0; +#endif + ering.rx_jumbo_pending = tp->rx_jumbo_pending; + ering.tx_pending = tp->tx_pending; + + if (copy_to_user(useraddr, &ering, sizeof(ering))) + return -EFAULT; + return 0; + } + case ETHTOOL_SRINGPARAM: { + struct ethtool_ringparam ering; + + if (copy_from_user(&ering, useraddr, sizeof(ering))) + return -EFAULT; + + if ((ering.rx_pending > TG3_RX_RING_SIZE - 1) || +#if TG3_MINI_RING_WORKS + (ering.rx_mini_pending > TG3_RX_MINI_RING_SIZE - 1) || +#endif + (ering.rx_jumbo_pending > TG3_RX_JUMBO_RING_SIZE - 1) || + (ering.tx_pending > TG3_TX_RING_SIZE - 1)) + return -EINVAL; + + spin_lock_irq(&tp->lock); + + tp->rx_pending = ering.rx_pending; +#if TG3_MINI_RING_WORKS + tp->rx_mini_pending = ering.rx_mini_pending; +#endif + tp->rx_jumbo_pending = ering.rx_jumbo_pending; + tp->tx_pending = ering.tx_pending; + + tg3_halt(tp); + tg3_init_rings(tp); + tg3_init_hw(tp); + netif_wake_queue(tp->dev); + spin_unlock_irq(&tp->lock); + + return 0; + } + case ETHTOOL_GPAUSEPARAM: { + struct ethtool_pauseparam epause = { ETHTOOL_GPAUSEPARAM }; + + epause.autoneg = + (tp->tg3_flags & TG3_FLAG_PAUSE_AUTONEG) != 0; + epause.rx_pause = + (tp->tg3_flags & TG3_FLAG_PAUSE_RX) != 0; + epause.tx_pause = + (tp->tg3_flags & TG3_FLAG_PAUSE_TX) != 0; + if (copy_to_user(useraddr, &epause, sizeof(epause))) + return -EFAULT; + return 0; + } + case ETHTOOL_SPAUSEPARAM: { + struct ethtool_pauseparam epause; + + if (copy_from_user(&epause, useraddr, sizeof(epause))) + return -EFAULT; + + spin_lock_irq(&tp->lock); + if (epause.autoneg) + tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG; + else + tp->tg3_flags &= ~TG3_FLAG_PAUSE_AUTONEG; + if (epause.rx_pause) + tp->tg3_flags |= TG3_FLAG_PAUSE_RX; + else + tp->tg3_flags &= ~TG3_FLAG_PAUSE_RX; + if (epause.tx_pause) + tp->tg3_flags |= TG3_FLAG_PAUSE_TX; + else + tp->tg3_flags &= ~TG3_FLAG_PAUSE_TX; + tg3_halt(tp); + tg3_init_rings(tp); + tg3_init_hw(tp); + spin_unlock_irq(&tp->lock); + + return 0; + } + case ETHTOOL_GRXCSUM: { + struct ethtool_value edata = { ETHTOOL_GRXCSUM }; + + edata.data = + (tp->tg3_flags & TG3_FLAG_RX_CHECKSUMS) != 0; + if (copy_to_user(useraddr, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } + case ETHTOOL_SRXCSUM: { + struct ethtool_value edata; + + if (copy_from_user(&edata, useraddr, sizeof(edata))) + return -EFAULT; + + if (tp->tg3_flags & TG3_FLAG_BROKEN_CHECKSUMS) { + if (edata.data != 0) + return -EINVAL; + return 0; + } + + spin_lock_irq(&tp->lock); + if (edata.data) + tp->tg3_flags |= TG3_FLAG_RX_CHECKSUMS; + else + tp->tg3_flags &= ~TG3_FLAG_RX_CHECKSUMS; + spin_unlock_irq(&tp->lock); + + return 0; + } + case ETHTOOL_GTXCSUM: { + struct ethtool_value edata = { ETHTOOL_GTXCSUM }; + + edata.data = + (tp->dev->features & NETIF_F_IP_CSUM) != 0; + if (copy_to_user(useraddr, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } + case ETHTOOL_STXCSUM: { + struct ethtool_value edata; + + if (copy_from_user(&edata, useraddr, sizeof(edata))) + return -EFAULT; + + if (tp->tg3_flags & TG3_FLAG_BROKEN_CHECKSUMS) { + if (edata.data != 0) + return -EINVAL; + return 0; + } + + if (edata.data) + tp->dev->features |= NETIF_F_IP_CSUM; + else + tp->dev->features &= ~NETIF_F_IP_CSUM; + + return 0; + } + case ETHTOOL_GSG: { + struct ethtool_value edata = { ETHTOOL_GSG }; + + edata.data = + (tp->dev->features & NETIF_F_SG) != 0; + if (copy_to_user(useraddr, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } + case ETHTOOL_SSG: { + struct ethtool_value edata; + + if (copy_from_user(&edata, useraddr, sizeof(edata))) + return -EFAULT; + + if (edata.data) + tp->dev->features |= NETIF_F_SG; + else + tp->dev->features &= ~NETIF_F_SG; + + return 0; + } + }; + + return -EOPNOTSUPP; +} +#endif /* KERNEL_VERSION > 2.4.18 */ + + +static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +{ + struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data; + struct tg3 *tp = dev->priv; + int err; + + switch(cmd) { +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,18)) + case SIOCETHTOOL: + return tg3_ethtool_ioctl(dev, (void *) ifr->ifr_data); +#endif + case SIOCGMIIPHY: + data->phy_id = PHY_ADDR; + + /* fallthru */ + case SIOCGMIIREG: { + u32 mii_regval; + + spin_lock_irq(&tp->lock); + err = tg3_readphy(tp, data->reg_num & 0x1f, &mii_regval); + spin_unlock_irq(&tp->lock); + + data->val_out = mii_regval; + + return err; + } + + case SIOCSMIIREG: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + + spin_lock_irq(&tp->lock); + err = tg3_writephy(tp, data->reg_num & 0x1f, data->val_in); + spin_unlock_irq(&tp->lock); + + return err; + + default: + /* do nothing */ + break; + } + return -EOPNOTSUPP; +} + +#if TG3_VLAN_TAG_USED +static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) +{ + struct tg3 *tp = dev->priv; + + spin_lock_irq(&tp->lock); + tp->vlgrp = grp; + spin_unlock_irq(&tp->lock); +} + +static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) +{ + struct tg3 *tp = dev->priv; + + spin_lock_irq(&tp->lock); + if (tp->vlgrp) + tp->vlgrp->vlan_devices[vid] = NULL; + spin_unlock_irq(&tp->lock); +} +#endif + +/* Chips other than 5700/5701 use the NVRAM for fetching info. */ +static void __devinit tg3_nvram_init(struct tg3 *tp) +{ + int j; + + tw32(GRC_EEPROM_ADDR, + (EEPROM_ADDR_FSM_RESET | + (EEPROM_DEFAULT_CLOCK_PERIOD << + EEPROM_ADDR_CLKPERD_SHIFT))); + + /* XXX schedule_timeout() ... */ + for (j = 0; j < 100; j++) + udelay(10); + + /* Enable seeprom accesses. */ + tw32(GRC_LOCAL_CTRL, + tr32(GRC_LOCAL_CTRL) | GRC_LCLCTRL_AUTO_SEEPROM); + udelay(100); + + if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700 && + GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) { + u32 nvcfg1 = tr32(NVRAM_CFG1); + + tp->tg3_flags |= TG3_FLAG_NVRAM; + if (nvcfg1 & NVRAM_CFG1_FLASHIF_ENAB) { + if (nvcfg1 & NVRAM_CFG1_BUFFERED_MODE) + tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED; + } else { + nvcfg1 &= ~NVRAM_CFG1_COMPAT_BYPASS; + tw32(NVRAM_CFG1, nvcfg1); + } + + } else { + tp->tg3_flags &= ~(TG3_FLAG_NVRAM | TG3_FLAG_NVRAM_BUFFERED); + } +} + +static int __devinit tg3_nvram_read_using_eeprom(struct tg3 *tp, + u32 offset, u32 *val) +{ + u32 tmp; + int i; + + if (offset > EEPROM_ADDR_ADDR_MASK || + (offset % 4) != 0) + return -EINVAL; + + tmp = tr32(GRC_EEPROM_ADDR) & ~(EEPROM_ADDR_ADDR_MASK | + EEPROM_ADDR_DEVID_MASK | + EEPROM_ADDR_READ); + tw32(GRC_EEPROM_ADDR, + tmp | + (0 << EEPROM_ADDR_DEVID_SHIFT) | + ((offset << EEPROM_ADDR_ADDR_SHIFT) & + EEPROM_ADDR_ADDR_MASK) | + EEPROM_ADDR_READ | EEPROM_ADDR_START); + + for (i = 0; i < 10000; i++) { + tmp = tr32(GRC_EEPROM_ADDR); + + if (tmp & EEPROM_ADDR_COMPLETE) + break; + udelay(100); + } + if (!(tmp & EEPROM_ADDR_COMPLETE)) + return -EBUSY; + + *val = tr32(GRC_EEPROM_DATA); + return 0; +} + +static int __devinit tg3_nvram_read(struct tg3 *tp, + u32 offset, u32 *val) +{ + int i, saw_done_clear; + + if (!(tp->tg3_flags & TG3_FLAG_NVRAM)) + return tg3_nvram_read_using_eeprom(tp, offset, val); + + if (tp->tg3_flags & TG3_FLAG_NVRAM_BUFFERED) + offset = ((offset / NVRAM_BUFFERED_PAGE_SIZE) << + NVRAM_BUFFERED_PAGE_POS) + + (offset % NVRAM_BUFFERED_PAGE_SIZE); + + if (offset > NVRAM_ADDR_MSK) + return -EINVAL; + + tw32(NVRAM_SWARB, SWARB_REQ_SET1); + for (i = 0; i < 1000; i++) { + if (tr32(NVRAM_SWARB) & SWARB_GNT1) + break; + udelay(20); + } + + tw32(NVRAM_ADDR, offset); + tw32(NVRAM_CMD, + NVRAM_CMD_RD | NVRAM_CMD_GO | + NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_DONE); + + /* Wait for done bit to clear then set again. */ + saw_done_clear = 0; + for (i = 0; i < 1000; i++) { + udelay(10); + if (!saw_done_clear && + !(tr32(NVRAM_CMD) & NVRAM_CMD_DONE)) + saw_done_clear = 1; + else if (saw_done_clear && + (tr32(NVRAM_CMD) & NVRAM_CMD_DONE)) + break; + } + if (i >= 1000) { + tw32(NVRAM_SWARB, SWARB_REQ_CLR1); + return -EBUSY; + } + + *val = swab32(tr32(NVRAM_RDDATA)); + tw32(NVRAM_SWARB, 0x20); + + return 0; +} + +struct subsys_tbl_ent { + u16 subsys_vendor, subsys_devid; + u32 phy_id; +}; + +static struct subsys_tbl_ent subsys_id_to_phy_id[] = { + /* Broadcom boards. */ + { 0x14e4, 0x1644, PHY_ID_BCM5401 }, /* BCM95700A6 */ + { 0x14e4, 0x0001, PHY_ID_BCM5701 }, /* BCM95701A5 */ + { 0x14e4, 0x0002, PHY_ID_BCM8002 }, /* BCM95700T6 */ + { 0x14e4, 0x0003, PHY_ID_SERDES }, /* BCM95700A9 */ + { 0x14e4, 0x0005, PHY_ID_BCM5701 }, /* BCM95701T1 */ + { 0x14e4, 0x0006, PHY_ID_BCM5701 }, /* BCM95701T8 */ + { 0x14e4, 0x0007, PHY_ID_SERDES }, /* BCM95701A7 */ + { 0x14e4, 0x0008, PHY_ID_BCM5701 }, /* BCM95701A10 */ + { 0x14e4, 0x8008, PHY_ID_BCM5701 }, /* BCM95701A12 */ + { 0x14e4, 0x0009, PHY_ID_BCM5701 }, /* BCM95703Ax1 */ + { 0x14e4, 0x8009, PHY_ID_BCM5701 }, /* BCM95703Ax2 */ + + /* 3com boards. */ + { PCI_VENDOR_ID_3COM, 0x1000, PHY_ID_BCM5401 }, /* 3C996T */ + { PCI_VENDOR_ID_3COM, 0x1006, PHY_ID_BCM5701 }, /* 3C996BT */ + /* { PCI_VENDOR_ID_3COM, 0x1002, PHY_ID_XXX }, 3C996CT */ + /* { PCI_VENDOR_ID_3COM, 0x1003, PHY_ID_XXX }, 3C997T */ + { PCI_VENDOR_ID_3COM, 0x1004, PHY_ID_SERDES }, /* 3C996SX */ + /* { PCI_VENDOR_ID_3COM, 0x1005, PHY_ID_XXX }, 3C997SZ */ + { PCI_VENDOR_ID_3COM, 0x1007, PHY_ID_BCM5701 }, /* 3C1000T */ + { PCI_VENDOR_ID_3COM, 0x1008, PHY_ID_BCM5701 }, /* 3C940BR01 */ + + /* DELL boards. */ + { PCI_VENDOR_ID_DELL, 0x00d1, PHY_ID_BCM5401 }, /* VIPER */ + { PCI_VENDOR_ID_DELL, 0x0106, PHY_ID_BCM5401 }, /* JAGUAR */ + { PCI_VENDOR_ID_DELL, 0x0109, PHY_ID_BCM5411 }, /* MERLOT */ + { PCI_VENDOR_ID_DELL, 0x010a, PHY_ID_BCM5411 }, /* SLIM_MERLOT */ + + /* Compaq boards. */ + { PCI_VENDOR_ID_COMPAQ, 0x007c, PHY_ID_BCM5701 }, /* BANSHEE */ + { PCI_VENDOR_ID_COMPAQ, 0x009a, PHY_ID_BCM5701 }, /* BANSHEE_2 */ + { PCI_VENDOR_ID_COMPAQ, 0x007d, PHY_ID_SERDES }, /* CHANGELING */ + { PCI_VENDOR_ID_COMPAQ, 0x0085, PHY_ID_BCM5701 }, /* NC7780 */ + { PCI_VENDOR_ID_COMPAQ, 0x0099, PHY_ID_BCM5701 } /* NC7780_2 */ +}; + +static int __devinit tg3_phy_probe(struct tg3 *tp) +{ + u32 eeprom_phy_id, hw_phy_id_1, hw_phy_id_2; + u32 hw_phy_id, hw_phy_id_masked; + enum phy_led_mode eeprom_led_mode; + u32 val; + int i, eeprom_signature_found, err; + + tp->phy_id = PHY_ID_INVALID; + for (i = 0; i < ARRAY_SIZE(subsys_id_to_phy_id); i++) { + if ((subsys_id_to_phy_id[i].subsys_vendor == + tp->pdev->subsystem_vendor) && + (subsys_id_to_phy_id[i].subsys_devid == + tp->pdev->subsystem_device)) { + tp->phy_id = subsys_id_to_phy_id[i].phy_id; + break; + } + } + + eeprom_phy_id = PHY_ID_INVALID; + eeprom_led_mode = led_mode_auto; + eeprom_signature_found = 0; + tg3_read_mem(tp, NIC_SRAM_DATA_SIG, &val); + if (val == NIC_SRAM_DATA_SIG_MAGIC) { + u32 nic_cfg; + + tg3_read_mem(tp, NIC_SRAM_DATA_CFG, &nic_cfg); + + eeprom_signature_found = 1; + + if ((nic_cfg & NIC_SRAM_DATA_CFG_PHY_TYPE_MASK) == + NIC_SRAM_DATA_CFG_PHY_TYPE_FIBER) { + eeprom_phy_id = PHY_ID_SERDES; + } else { + u32 nic_phy_id; + + tg3_read_mem(tp, NIC_SRAM_DATA_PHY_ID, &nic_phy_id); + if (nic_phy_id != 0) { + u32 id1 = nic_phy_id & NIC_SRAM_DATA_PHY_ID1_MASK; + u32 id2 = nic_phy_id & NIC_SRAM_DATA_PHY_ID2_MASK; + + eeprom_phy_id = (id1 >> 16) << 10; + eeprom_phy_id |= (id2 & 0xfc00) << 16; + eeprom_phy_id |= (id2 & 0x03ff) << 0; + } + } + + switch (nic_cfg & NIC_SRAM_DATA_CFG_LED_MODE_MASK) { + case NIC_SRAM_DATA_CFG_LED_TRIPLE_SPD: + eeprom_led_mode = led_mode_three_link; + break; + + case NIC_SRAM_DATA_CFG_LED_LINK_SPD: + eeprom_led_mode = led_mode_link10; + break; + + default: + eeprom_led_mode = led_mode_auto; + break; + }; + } + + err = tg3_phy_reset(tp, 0); + if (err) + return err; + + /* Now read the physical PHY_ID from the chip and verify + * that it is sane. If it doesn't look good, we fall back + * to either the hard-coded table based PHY_ID and failing + * that the value found in the eeprom area. + */ + err = tg3_readphy(tp, MII_PHYSID1, &hw_phy_id_1); + err |= tg3_readphy(tp, MII_PHYSID2, &hw_phy_id_2); + + hw_phy_id = (hw_phy_id_1 & 0xffff) << 10; + hw_phy_id |= (hw_phy_id_2 & 0xfc00) << 16; + hw_phy_id |= (hw_phy_id_2 & 0x03ff) << 0; + + hw_phy_id_masked = hw_phy_id & PHY_ID_MASK; + + if (!err && KNOWN_PHY_ID(hw_phy_id_masked)) { + tp->phy_id = hw_phy_id; + } else { + /* phy_id currently holds the value found in the + * subsys_id_to_phy_id[] table or PHY_ID_INVALID + * if a match was not found there. + */ + if (tp->phy_id == PHY_ID_INVALID) { + if (!eeprom_signature_found || + !KNOWN_PHY_ID(eeprom_phy_id & PHY_ID_MASK)) + return -ENODEV; + tp->phy_id = eeprom_phy_id; + } + } + + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703) { + tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00); + tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x201f); + tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x2aaa); + } + + if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0 || + tp->pci_chip_rev_id == CHIPREV_ID_5701_B0) + tp->tg3_flags |= TG3_FLAG_PHY_RESET_ON_INIT; + + if (tp->tg3_flags & TG3_FLAG_PHY_RESET_ON_INIT) { + u32 mii_tg3_ctrl; + + err = tg3_phy_reset(tp, 1); + if (err) + return err; + + /* These chips, when reset, only advertise 10Mb capabilities. + * Fix that. + */ + err = tg3_writephy(tp, MII_ADVERTISE, + (ADVERTISE_CSMA | + ADVERTISE_10HALF | ADVERTISE_10FULL | + ADVERTISE_100HALF | ADVERTISE_100FULL)); + mii_tg3_ctrl = (MII_TG3_CTRL_ADV_1000_HALF | + MII_TG3_CTRL_ADV_1000_FULL | + MII_TG3_CTRL_AS_MASTER | + MII_TG3_CTRL_ENABLE_AS_MASTER); + if (tp->tg3_flags & TG3_FLAG_10_100_ONLY) + mii_tg3_ctrl = 0; + + err |= tg3_writephy(tp, MII_TG3_CTRL, mii_tg3_ctrl); + err |= tg3_writephy(tp, MII_BMCR, + (BMCR_ANRESTART | BMCR_ANENABLE)); + } + + if (!err && ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401)) { + err = tg3_init_5401phy_dsp(tp); + } + + /* Determine the PHY led mode. */ + if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL) { + tp->led_mode = led_mode_link10; + } else { + tp->led_mode = led_mode_three_link; + if (eeprom_signature_found && + eeprom_led_mode != led_mode_auto) + tp->led_mode = eeprom_led_mode; + } + + if (tp->phy_id == PHY_ID_SERDES) + tp->link_config.advertising = + (ADVERTISED_1000baseT_Half | + ADVERTISED_1000baseT_Full | + ADVERTISED_Autoneg | + ADVERTISED_FIBRE); + if (tp->tg3_flags & TG3_FLAG_10_100_ONLY) + tp->link_config.advertising &= + ~(ADVERTISED_1000baseT_Half | + ADVERTISED_1000baseT_Full); + + return err; +} + +static void __devinit tg3_read_partno(struct tg3 *tp) +{ + unsigned char vpd_data[256]; + int i; + + for (i = 0; i < 256; i += 4) { + u32 tmp; + + if (tg3_nvram_read(tp, 0x100 + i, &tmp)) + goto out_not_found; + + vpd_data[i + 0] = ((tmp >> 0) & 0xff); + vpd_data[i + 1] = ((tmp >> 8) & 0xff); + vpd_data[i + 2] = ((tmp >> 16) & 0xff); + vpd_data[i + 3] = ((tmp >> 24) & 0xff); + } + + /* Now parse and find the part number. */ + for (i = 0; i < 256; ) { + unsigned char val = vpd_data[i]; + int block_end; + + if (val == 0x82 || val == 0x91) { + i = (i + 3 + + (vpd_data[i + 1] + + (vpd_data[i + 2] << 8))); + continue; + } + + if (val != 0x90) + goto out_not_found; + + block_end = (i + 3 + + (vpd_data[i + 1] + + (vpd_data[i + 2] << 8))); + i += 3; + while (i < block_end) { + if (vpd_data[i + 0] == 'P' && + vpd_data[i + 1] == 'N') { + int partno_len = vpd_data[i + 2]; + + if (partno_len > 24) + goto out_not_found; + + memcpy(tp->board_part_number, + &vpd_data[i + 3], + partno_len); + + /* Success. */ + return; + } + } + + /* Part number not found. */ + goto out_not_found; + } + +out_not_found: + strcpy(tp->board_part_number, "none"); +} + +static int __devinit tg3_get_invariants(struct tg3 *tp) +{ + u32 misc_ctrl_reg; + u32 cacheline_sz_reg; + u32 pci_state_reg, grc_misc_cfg; + u16 pci_cmd; + int err; + + /* Force memory write invalidate off. If we leave it on, + * then on 5700_BX chips we have to enable a workaround. + * The workaround is to set the TG3PCI_DMA_RW_CTRL boundry + * to match the cacheline size. The Broadcom driver have this + * workaround but turns MWI off all the times so never uses + * it. This seems to suggest that the workaround is insufficient. + */ + pci_read_config_word(tp->pdev, PCI_COMMAND, &pci_cmd); + pci_cmd &= ~PCI_COMMAND_INVALIDATE; + pci_write_config_word(tp->pdev, PCI_COMMAND, pci_cmd); + + pci_read_config_dword(tp->pdev, TG3PCI_MISC_HOST_CTRL, + &misc_ctrl_reg); + + tp->pci_chip_rev_id = (misc_ctrl_reg >> + MISC_HOST_CTRL_CHIPREV_SHIFT); + + pci_read_config_dword(tp->pdev, TG3PCI_CACHELINESZ, + &cacheline_sz_reg); + + tp->pci_cacheline_sz = (cacheline_sz_reg >> 0) & 0xff; + tp->pci_lat_timer = (cacheline_sz_reg >> 8) & 0xff; + tp->pci_hdr_type = (cacheline_sz_reg >> 16) & 0xff; + tp->pci_bist = (cacheline_sz_reg >> 24) & 0xff; + + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703 && + tp->pci_lat_timer < 64) { + tp->pci_lat_timer = 64; + + cacheline_sz_reg = ((tp->pci_cacheline_sz & 0xff) << 0); + cacheline_sz_reg |= ((tp->pci_lat_timer & 0xff) << 8); + cacheline_sz_reg |= ((tp->pci_hdr_type & 0xff) << 16); + cacheline_sz_reg |= ((tp->pci_bist & 0xff) << 24); + + pci_write_config_dword(tp->pdev, TG3PCI_CACHELINESZ, + cacheline_sz_reg); + } + + pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE, + &pci_state_reg); + + if ((pci_state_reg & PCISTATE_CONV_PCI_MODE) == 0) { + tp->tg3_flags |= TG3_FLAG_PCIX_MODE; + + /* If this is a 5700 BX chipset, and we are in PCI-X + * mode, enable register write workaround. + * + * The workaround is to use indirect register accesses + * for all chip writes not to mailbox registers. + */ + if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5700_BX) { + u32 pm_reg; + u16 pci_cmd; + + tp->tg3_flags |= TG3_FLAG_PCIX_TARGET_HWBUG; + + /* The chip can have it's power management PCI config + * space registers clobbered due to this bug. + * So explicitly force the chip into D0 here. + */ + pci_read_config_dword(tp->pdev, TG3PCI_PM_CTRL_STAT, + &pm_reg); + pm_reg &= ~PCI_PM_CTRL_STATE_MASK; + pm_reg |= PCI_PM_CTRL_PME_ENABLE | 0 /* D0 */; + pci_write_config_dword(tp->pdev, TG3PCI_PM_CTRL_STAT, + pm_reg); + + /* Also, force SERR#/PERR# in PCI command. */ + pci_read_config_word(tp->pdev, PCI_COMMAND, &pci_cmd); + pci_cmd |= PCI_COMMAND_PARITY | PCI_COMMAND_SERR; + pci_write_config_word(tp->pdev, PCI_COMMAND, pci_cmd); + } + } + if ((pci_state_reg & PCISTATE_BUS_SPEED_HIGH) != 0) + tp->tg3_flags |= TG3_FLAG_PCI_HIGH_SPEED; + if ((pci_state_reg & PCISTATE_BUS_32BIT) != 0) + tp->tg3_flags |= TG3_FLAG_PCI_32BIT; + + /* Force the chip into D0. */ + err = tg3_set_power_state(tp, 0); + if (err) + return err; + + /* 5700 B0 chips do not support checksumming correctly due + * to hardware bugs. + */ + if (tp->pci_chip_rev_id == CHIPREV_ID_5700_B0) + tp->tg3_flags |= TG3_FLAG_BROKEN_CHECKSUMS; + + /* Regardless of whether checksums work or not, we configure + * the StrongARM chips to not compute the pseudo header checksums + * in either direction. Because of the way Linux checksum support + * works we do not need the chips to do this, and taking the load + * off of the TX/RX onboard StrongARM cpus means that they will not be + * the bottleneck. Whoever wrote Broadcom's driver did not + * understand the situation at all. He could have bothered + * to read Jes's Acenic driver because the logic (and this part of + * the Tigon2 hardware/firmware) is pretty much identical. + */ + tp->tg3_flags |= TG3_FLAG_NO_TX_PSEUDO_CSUM; + tp->tg3_flags |= TG3_FLAG_NO_RX_PSEUDO_CSUM; + + /* Derive initial jumbo mode from MTU assigned in + * ether_setup() via the alloc_etherdev() call + */ + if (tp->dev->mtu > ETH_DATA_LEN) + tp->tg3_flags |= TG3_FLAG_JUMBO_ENABLE; + + /* Determine WakeOnLan speed to use. */ + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || + tp->pci_chip_rev_id == CHIPREV_ID_5701_A0 || + tp->pci_chip_rev_id == CHIPREV_ID_5701_B0 || + tp->pci_chip_rev_id == CHIPREV_ID_5701_B2) { + tp->tg3_flags &= ~(TG3_FLAG_WOL_SPEED_100MB); + } else { + tp->tg3_flags |= TG3_FLAG_WOL_SPEED_100MB; + } + + /* Only 5701 and later support tagged irq status mode. */ + if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700) { + tp->tg3_flags |= TG3_FLAG_TAGGED_IRQ_STATUS; + tp->misc_host_ctrl |= MISC_HOST_CTRL_TAGGED_STATUS; + + /* ??? Due to a glitch Broadcom's driver ALWAYS sets + * ??? these bits in coalesce_mode. Because MM_GetConfig + * ??? always sets pDevice->UseTaggedStatus correctly + * ??? the following test at tigon3.c:LM_GetAdapterInfo() + * ??? + * ??? pDevice->UseTaggedStatus && + * ??? (pDevice->ChipRevId == T3_CHIP_ID_5700_C0 || + * ??? T3_CHIP_REV(pDevice->ChipRevId) == T3_CHIP_REV_5700_AX || + * ??? T3_CHIP_REV(pDevice->ChipRevId) == T3_CHIP_REV_5700_BX) + * ??? + * ??? will never pass and thus pDevice->CoalesceMode will never + * ??? get set to zero. For now I'll mirror what I believe is + * ??? the intention of their driver. + * ??? + * ??? Update: This is fixed in Broadcom's 2.2.3 and later + * ??? drivers. All the current 2.0.x drivers still + * ??? have the bug. + */ + tp->coalesce_mode = (HOSTCC_MODE_CLRTICK_RXBD | + HOSTCC_MODE_CLRTICK_TXBD); + } else { + tp->coalesce_mode = 0; + + /* If not using tagged status, set the *_during_int + * coalesce default config values to zero. + */ + tp->coalesce_config.rx_coalesce_ticks_during_int_def = 0; + tp->coalesce_config.rx_max_coalesced_frames_during_int_def = 0; + tp->coalesce_config.tx_coalesce_ticks_during_int_def = 0; + tp->coalesce_config.tx_max_coalesced_frames_during_int_def = 0; + } + + if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_AX && + GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_BX) + tp->coalesce_mode |= HOSTCC_MODE_32BYTE; + + /* Initialize misc host control in PCI block. */ + tp->misc_host_ctrl |= (misc_ctrl_reg & + MISC_HOST_CTRL_CHIPREV); + pci_write_config_dword(tp->pdev, TG3PCI_MISC_HOST_CTRL, + tp->misc_host_ctrl); + + /* Initialize MAC MI mode, polling disabled. */ + tw32(MAC_MI_MODE, tp->mi_mode); + udelay(40); + + /* Initialize data/descriptor byte/word swapping. */ + tw32(GRC_MODE, tp->grc_mode); + + /* Clear these out for sanity. */ + tw32(TG3PCI_CLOCK_CTRL, 0); + tw32(TG3PCI_MEM_WIN_BASE_ADDR, 0); + + pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE, + &pci_state_reg); + if ((pci_state_reg & PCISTATE_CONV_PCI_MODE) == 0 && + (tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) == 0) { + u32 chiprevid = GET_CHIP_REV_ID(tp->misc_host_ctrl); + + if (chiprevid == CHIPREV_ID_5701_A0 || + chiprevid == CHIPREV_ID_5701_B0 || + chiprevid == CHIPREV_ID_5701_B2 || + chiprevid == CHIPREV_ID_5701_B5) { + unsigned long sram_base; + + /* Write some dummy words into the SRAM status block + * area, see if it reads back correctly. If the return + * value is bad, force enable the PCIX workaround. + */ + sram_base = tp->regs + NIC_SRAM_WIN_BASE + NIC_SRAM_STATS_BLK; + + writel(0x00000000, sram_base); + writel(0x00000000, sram_base + 4); + writel(0xffffffff, sram_base + 4); + if (readl(sram_base) != 0x00000000) + tp->tg3_flags |= TG3_FLAG_PCIX_TARGET_HWBUG; + } + } + + udelay(50); + tg3_nvram_init(tp); + + /* Determine if TX descriptors will reside in + * main memory or in the chip SRAM. + */ + if (tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) + tp->tg3_flags |= TG3_FLAG_HOST_TXDS; + + /* Quick sanity check. Make sure we see an expected + * value here. + */ + grc_misc_cfg = tr32(GRC_MISC_CFG); + grc_misc_cfg &= GRC_MISC_CFG_BOARD_ID_MASK; + if (grc_misc_cfg != GRC_MISC_CFG_BOARD_ID_5700 && + grc_misc_cfg != GRC_MISC_CFG_BOARD_ID_5701 && + grc_misc_cfg != GRC_MISC_CFG_BOARD_ID_5702FE && + grc_misc_cfg != GRC_MISC_CFG_BOARD_ID_5703 && + grc_misc_cfg != GRC_MISC_CFG_BOARD_ID_5703S && + grc_misc_cfg != GRC_MISC_CFG_BOARD_ID_AC91002A1) + return -ENODEV; + + /* ROFL, you should see Broadcom's driver code implementing + * this, stuff like "if (a || b)" where a and b are always + * mutually exclusive. DaveM finds like 6 bugs today, hello! + */ + if (grc_misc_cfg == GRC_MISC_CFG_BOARD_ID_5702FE) + tp->tg3_flags |= TG3_FLAG_10_100_ONLY; + + err = tg3_phy_probe(tp); + + tg3_read_partno(tp); + + if (tp->phy_id == PHY_ID_SERDES) { + tp->tg3_flags &= ~TG3_FLAG_USE_MI_INTERRUPT; + + /* And override led_mode in case Dell ever makes + * a fibre board. + */ + tp->led_mode = led_mode_three_link; + } else { + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700) + tp->tg3_flags |= TG3_FLAG_USE_MI_INTERRUPT; + else + tp->tg3_flags &= ~TG3_FLAG_USE_MI_INTERRUPT; + } + + /* 5700 {AX,BX} chips have a broken status block link + * change bit implementation, so we must use the + * status register in those cases. + */ + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700) + tp->tg3_flags |= TG3_FLAG_USE_LINKCHG_REG; + else + tp->tg3_flags &= ~TG3_FLAG_USE_LINKCHG_REG; + + /* The led_mode is set during tg3_phy_probe, here we might + * have to force the link status polling mechanism based + * upon subsystem IDs. + */ + if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL && + tp->phy_id != PHY_ID_SERDES) { + tp->tg3_flags |= (TG3_FLAG_USE_MI_INTERRUPT | + TG3_FLAG_USE_LINKCHG_REG); + } + + /* For all SERDES we poll the MAC status register. */ + if (tp->phy_id == PHY_ID_SERDES) + tp->tg3_flags |= TG3_FLAG_POLL_SERDES; + else + tp->tg3_flags &= ~TG3_FLAG_POLL_SERDES; + + /* 5700 BX chips need to have their TX producer index mailboxes + * written twice to workaround a bug. + */ + if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5700_BX) + tp->tg3_flags |= TG3_FLAG_TXD_MBOX_HWBUG; + else + tp->tg3_flags &= ~TG3_FLAG_TXD_MBOX_HWBUG; + + /* 5700 chips can get confused if TX buffers straddle the + * 4GB address boundary in some cases. + */ + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700) { + /* ROFL! Latest Broadcom driver disables NETIF_F_HIGHDMA + * in this case instead of fixing their workaround code. + * + * Like, hey, there is this skb_copy() thing guys, + * use it. Oh I can't stop laughing... + */ + tp->dev->hard_start_xmit = tg3_start_xmit_4gbug; + } else { + tp->dev->hard_start_xmit = tg3_start_xmit; + } + + tp->rx_offset = 2; + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 && + (tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0) + tp->rx_offset = 0; + + return err; +} + +static int __devinit tg3_get_device_address(struct tg3 *tp) +{ + struct net_device *dev = tp->dev; + u32 hi, lo; + + /* First try to get it from MAC address mailbox. */ + tg3_read_mem(tp, NIC_SRAM_MAC_ADDR_HIGH_MBOX, &hi); + if ((hi >> 16) == 0x484b) { + dev->dev_addr[0] = (hi >> 8) & 0xff; + dev->dev_addr[1] = (hi >> 0) & 0xff; + + tg3_read_mem(tp, NIC_SRAM_MAC_ADDR_LOW_MBOX, &lo); + dev->dev_addr[2] = (lo >> 24) & 0xff; + dev->dev_addr[3] = (lo >> 16) & 0xff; + dev->dev_addr[4] = (lo >> 8) & 0xff; + dev->dev_addr[5] = (lo >> 0) & 0xff; + } + /* Next, try NVRAM. */ + else if (!tg3_nvram_read(tp, 0x7c, &hi) && + !tg3_nvram_read(tp, 0x80, &lo)) { + dev->dev_addr[0] = ((hi >> 16) & 0xff); + dev->dev_addr[1] = ((hi >> 24) & 0xff); + dev->dev_addr[2] = ((lo >> 0) & 0xff); + dev->dev_addr[3] = ((lo >> 8) & 0xff); + dev->dev_addr[4] = ((lo >> 16) & 0xff); + dev->dev_addr[5] = ((lo >> 24) & 0xff); + } + /* Finally just fetch it out of the MAC control regs. */ + else { + hi = tr32(MAC_ADDR_0_HIGH); + lo = tr32(MAC_ADDR_0_LOW); + + dev->dev_addr[5] = lo & 0xff; + dev->dev_addr[4] = (lo >> 8) & 0xff; + dev->dev_addr[3] = (lo >> 16) & 0xff; + dev->dev_addr[2] = (lo >> 24) & 0xff; + dev->dev_addr[1] = hi & 0xff; + dev->dev_addr[0] = (hi >> 8) & 0xff; + } + + if (!is_valid_ether_addr(&dev->dev_addr[0])) + return -EINVAL; + + return 0; +} + +static int __devinit tg3_do_test_dma(struct tg3 *tp, u32 *buf, dma_addr_t buf_dma, int size, int to_device) +{ + struct tg3_internal_buffer_desc test_desc; + u32 sram_dma_descs; + int i, ret; + + sram_dma_descs = NIC_SRAM_DMA_DESC_POOL_BASE; + + tw32(FTQ_RCVBD_COMP_FIFO_ENQDEQ, 0); + tw32(FTQ_RCVDATA_COMP_FIFO_ENQDEQ, 0); + tw32(RDMAC_STATUS, 0); + tw32(WDMAC_STATUS, 0); + + tw32(BUFMGR_MODE, 0); + tw32(FTQ_RESET, 0); + + /* pci_alloc_consistent gives only non-DAC addresses */ + test_desc.addr_hi = 0; + test_desc.addr_lo = buf_dma & 0xffffffff; + test_desc.nic_mbuf = 0x00002100; + test_desc.len = size; + if (to_device) { + test_desc.cqid_sqid = (13 << 8) | 2; + tw32(RDMAC_MODE, RDMAC_MODE_RESET); + tw32(RDMAC_MODE, RDMAC_MODE_ENABLE); + } else { + test_desc.cqid_sqid = (16 << 8) | 7; + tw32(WDMAC_MODE, WDMAC_MODE_RESET); + tw32(WDMAC_MODE, WDMAC_MODE_ENABLE); + } + test_desc.flags = 0x00000004; + + for (i = 0; i < (sizeof(test_desc) / sizeof(u32)); i++) { + u32 val; + + val = *(((u32 *)&test_desc) + i); + pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, + sram_dma_descs + (i * sizeof(u32))); + pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val); + } + pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0); + + if (to_device) { + tw32(FTQ_DMA_HIGH_READ_FIFO_ENQDEQ, sram_dma_descs); + } else { + tw32(FTQ_DMA_HIGH_WRITE_FIFO_ENQDEQ, sram_dma_descs); + } + + ret = -ENODEV; + for (i = 0; i < 40; i++) { + u32 val; + + if (to_device) + val = tr32(FTQ_RCVBD_COMP_FIFO_ENQDEQ); + else + val = tr32(FTQ_RCVDATA_COMP_FIFO_ENQDEQ); + if ((val & 0xffff) == sram_dma_descs) { + ret = 0; + break; + } + + udelay(100); + } + + return ret; +} + +#define TEST_BUFFER_SIZE 0x400 + +static int __devinit tg3_test_dma(struct tg3 *tp) +{ + dma_addr_t buf_dma; + u32 *buf; + int ret; + + buf = pci_alloc_consistent(tp->pdev, TEST_BUFFER_SIZE, &buf_dma); + if (!buf) { + ret = -ENOMEM; + goto out_nofree; + } + + tw32(TG3PCI_CLOCK_CTRL, 0); + + if ((tp->tg3_flags & TG3_FLAG_PCIX_MODE) == 0) { + tp->dma_rwctrl = + (0x7 << DMA_RWCTRL_PCI_WRITE_CMD_SHIFT) | + (0x6 << DMA_RWCTRL_PCI_READ_CMD_SHIFT) | + (0x7 << DMA_RWCTRL_WRITE_WATER_SHIFT) | + (0x7 << DMA_RWCTRL_READ_WATER_SHIFT) | + (0x0f << DMA_RWCTRL_MIN_DMA_SHIFT); + } else { + tp->dma_rwctrl = + (0x7 << DMA_RWCTRL_PCI_WRITE_CMD_SHIFT) | + (0x6 << DMA_RWCTRL_PCI_READ_CMD_SHIFT) | + (0x3 << DMA_RWCTRL_WRITE_WATER_SHIFT) | + (0x3 << DMA_RWCTRL_READ_WATER_SHIFT) | + (0x0f << DMA_RWCTRL_MIN_DMA_SHIFT); + + /* Wheee, some more chip bugs... */ + if (tp->pci_chip_rev_id == CHIPREV_ID_5703_A1 || + tp->pci_chip_rev_id == CHIPREV_ID_5703_A2) + tp->dma_rwctrl |= DMA_RWCTRL_ONE_DMA; + } + + /* We don't do this on x86 because it seems to hurt performace. + * It does help things on other platforms though. + */ +#ifndef CONFIG_X86 + { + u8 byte; + int cacheline_size; + pci_read_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE, &byte); + + if (byte == 0) + cacheline_size = 1024; + else + cacheline_size = (int) byte * 4; + + tp->dma_rwctrl &= ~(DMA_RWCTRL_READ_BNDRY_MASK | + DMA_RWCTRL_WRITE_BNDRY_MASK); + + switch (cacheline_size) { + case 16: + tp->dma_rwctrl |= + (DMA_RWCTRL_READ_BNDRY_16 | + DMA_RWCTRL_WRITE_BNDRY_16); + break; + + case 32: + tp->dma_rwctrl |= + (DMA_RWCTRL_READ_BNDRY_32 | + DMA_RWCTRL_WRITE_BNDRY_32); + break; + + case 64: + tp->dma_rwctrl |= + (DMA_RWCTRL_READ_BNDRY_64 | + DMA_RWCTRL_WRITE_BNDRY_64); + break; + + case 128: + tp->dma_rwctrl |= + (DMA_RWCTRL_READ_BNDRY_128 | + DMA_RWCTRL_WRITE_BNDRY_128); + break; + + case 256: + tp->dma_rwctrl |= + (DMA_RWCTRL_READ_BNDRY_256 | + DMA_RWCTRL_WRITE_BNDRY_256); + break; + + case 512: + tp->dma_rwctrl |= + (DMA_RWCTRL_READ_BNDRY_512 | + DMA_RWCTRL_WRITE_BNDRY_512); + break; + + case 1024: + tp->dma_rwctrl |= + (DMA_RWCTRL_READ_BNDRY_1024 | + DMA_RWCTRL_WRITE_BNDRY_1024); + break; + }; + } +#endif + + /* Remove this if it causes problems for some boards. */ + tp->dma_rwctrl |= DMA_RWCTRL_USE_MEM_READ_MULT; + + tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl); + + if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700 && + GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) + return 0; + + ret = 0; + while (1) { + u32 *p, i; + + p = buf; + for (i = 0; i < TEST_BUFFER_SIZE / sizeof(u32); i++) + p[i] = i; + + /* Send the buffer to the chip. */ + ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 1); + if (ret) + break; + + p = buf; + for (i = 0; i < TEST_BUFFER_SIZE / sizeof(u32); i++) + p[i] = 0; + + /* Now read it back. */ + ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 0); + if (ret) + break; + + /* Verify it. */ + p = buf; + for (i = 0; i < TEST_BUFFER_SIZE / sizeof(u32); i++) { + if (p[i] == i) + continue; + + if ((tp->dma_rwctrl & DMA_RWCTRL_WRITE_BNDRY_MASK) == + DMA_RWCTRL_WRITE_BNDRY_DISAB) { + tp->dma_rwctrl |= DMA_RWCTRL_WRITE_BNDRY_16; + tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl); + break; + } else { + ret = -ENODEV; + goto out; + } + } + + if (i == (TEST_BUFFER_SIZE / sizeof(u32))) { + /* Success. */ + ret = 0; + break; + } + } + +out: + pci_free_consistent(tp->pdev, TEST_BUFFER_SIZE, buf, buf_dma); +out_nofree: + return ret; +} + +static void __devinit tg3_init_link_config(struct tg3 *tp) +{ + tp->link_config.advertising = + (ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full | + ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full | + ADVERTISED_1000baseT_Half | ADVERTISED_1000baseT_Full | + ADVERTISED_Autoneg | ADVERTISED_MII); + tp->link_config.speed = SPEED_INVALID; + tp->link_config.duplex = DUPLEX_INVALID; + tp->link_config.autoneg = AUTONEG_ENABLE; + netif_carrier_off(tp->dev); + tp->link_config.active_speed = SPEED_INVALID; + tp->link_config.active_duplex = DUPLEX_INVALID; + tp->link_config.phy_is_low_power = 0; + tp->link_config.orig_speed = SPEED_INVALID; + tp->link_config.orig_duplex = DUPLEX_INVALID; + tp->link_config.orig_autoneg = AUTONEG_INVALID; +} + +static void __devinit tg3_init_coalesce_config(struct tg3 *tp) +{ + tp->coalesce_config.rx_coalesce_ticks_def = DEFAULT_RXCOL_TICKS; + tp->coalesce_config.rx_max_coalesced_frames_def = DEFAULT_RXMAX_FRAMES; + tp->coalesce_config.rx_coalesce_ticks_during_int_def = + DEFAULT_RXCOAL_TICK_INT; + tp->coalesce_config.rx_max_coalesced_frames_during_int_def = + DEFAULT_RXCOAL_MAXF_INT; + tp->coalesce_config.tx_coalesce_ticks_def = DEFAULT_TXCOL_TICKS; + tp->coalesce_config.tx_max_coalesced_frames_def = DEFAULT_TXMAX_FRAMES; + tp->coalesce_config.tx_coalesce_ticks_during_int_def = + DEFAULT_TXCOAL_TICK_INT; + tp->coalesce_config.tx_max_coalesced_frames_during_int_def = + DEFAULT_TXCOAL_MAXF_INT; + tp->coalesce_config.stats_coalesce_ticks_def = + DEFAULT_STAT_COAL_TICKS; + + tp->coalesce_config.rx_coalesce_ticks_low = + LOW_RXCOL_TICKS; + tp->coalesce_config.rx_max_coalesced_frames_low = + LOW_RXMAX_FRAMES; + tp->coalesce_config.tx_coalesce_ticks_low = + LOW_TXCOL_TICKS; + tp->coalesce_config.tx_max_coalesced_frames_low = + LOW_TXMAX_FRAMES; + + tp->coalesce_config.rx_coalesce_ticks_high = + HIGH_RXCOL_TICKS; + tp->coalesce_config.rx_max_coalesced_frames_high = + HIGH_RXMAX_FRAMES; + tp->coalesce_config.tx_coalesce_ticks_high = + HIGH_TXCOL_TICKS; + tp->coalesce_config.tx_max_coalesced_frames_high = + HIGH_TXMAX_FRAMES; + + /* Active == default */ + tp->coalesce_config.rx_coalesce_ticks = + tp->coalesce_config.rx_coalesce_ticks_def; + tp->coalesce_config.rx_max_coalesced_frames = + tp->coalesce_config.rx_max_coalesced_frames_def; + tp->coalesce_config.tx_coalesce_ticks = + tp->coalesce_config.tx_coalesce_ticks_def; + tp->coalesce_config.tx_max_coalesced_frames = + tp->coalesce_config.tx_max_coalesced_frames_def; + tp->coalesce_config.stats_coalesce_ticks = + tp->coalesce_config.stats_coalesce_ticks_def; + + tp->coalesce_config.rate_sample_jiffies = (1 * HZ); + tp->coalesce_config.pkt_rate_low = 22000; + tp->coalesce_config.pkt_rate_high = 61000; + + tp->tg3_flags |= TG3_FLAG_ADAPTIVE_RX; + tp->tg3_flags &= ~(TG3_FLAG_ADAPTIVE_TX); +} + +static void __devinit tg3_init_bufmgr_config(struct tg3 *tp) +{ + tp->bufmgr_config.mbuf_read_dma_low_water = + DEFAULT_MB_RDMA_LOW_WATER; + tp->bufmgr_config.mbuf_mac_rx_low_water = + DEFAULT_MB_MACRX_LOW_WATER; + tp->bufmgr_config.mbuf_high_water = + DEFAULT_MB_HIGH_WATER; + + tp->bufmgr_config.mbuf_read_dma_low_water_jumbo = + DEFAULT_MB_RDMA_LOW_WATER_JUMBO; + tp->bufmgr_config.mbuf_mac_rx_low_water_jumbo = + DEFAULT_MB_MACRX_LOW_WATER_JUMBO; + tp->bufmgr_config.mbuf_high_water_jumbo = + DEFAULT_MB_HIGH_WATER_JUMBO; + + tp->bufmgr_config.dma_low_water = DEFAULT_DMA_LOW_WATER; + tp->bufmgr_config.dma_high_water = DEFAULT_DMA_HIGH_WATER; +} + +static char * __devinit tg3_phy_string(struct tg3 *tp) +{ + switch (tp->phy_id & PHY_ID_MASK) { + case PHY_ID_BCM5400: return "5400"; + case PHY_ID_BCM5401: return "5401"; + case PHY_ID_BCM5411: return "5411"; + case PHY_ID_BCM5701: return "5701"; + case PHY_ID_BCM5703: return "5703"; + case PHY_ID_BCM8002: return "8002"; + case PHY_ID_SERDES: return "serdes"; + default: return "unknown"; + }; +} + +static int __devinit tg3_init_one(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + static int tg3_version_printed = 0; + unsigned long tg3reg_base, tg3reg_len; + struct net_device *dev; + struct tg3 *tp; + int i, err, pci_using_dac, pm_cap; + + if (tg3_version_printed++ == 0) + printk(KERN_INFO "%s", version); + + err = pci_enable_device(pdev); + if (err) { + printk(KERN_ERR PFX "Cannot enable PCI device, " + "aborting.\n"); + return err; + } + + if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { + printk(KERN_ERR PFX "Cannot find proper PCI device " + "base address, aborting.\n"); + err = -ENODEV; + goto err_out_disable_pdev; + } + + err = pci_request_regions(pdev, DRV_MODULE_NAME); + if (err) { + printk(KERN_ERR PFX "Cannot obtain PCI resources, " + "aborting.\n"); + goto err_out_disable_pdev; + } + + pci_set_master(pdev); + + /* Find power-management capability. */ + pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM); + if (pm_cap == 0) { + printk(KERN_ERR PFX "Cannot find PowerManagement capability, " + "aborting.\n"); + goto err_out_free_res; + } + + /* Configure DMA attributes. */ + if (!pci_set_dma_mask(pdev, (u64) 0xffffffffffffffff)) { + pci_using_dac = 1; + } else { + err = pci_set_dma_mask(pdev, (u64) 0xffffffff); + if (err) { + printk(KERN_ERR PFX "No usable DMA configuration, " + "aborting.\n"); + goto err_out_free_res; + } + pci_using_dac = 0; + } + + tg3reg_base = pci_resource_start(pdev, 0); + tg3reg_len = pci_resource_len(pdev, 0); + + dev = alloc_etherdev(sizeof(*tp)); + if (!dev) { + printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n"); + err = -ENOMEM; + goto err_out_free_res; + } + + SET_MODULE_OWNER(dev); + + if (pci_using_dac) + dev->features |= NETIF_F_HIGHDMA; +#if TG3_VLAN_TAG_USED + dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; + dev->vlan_rx_register = tg3_vlan_rx_register; + dev->vlan_rx_kill_vid = tg3_vlan_rx_kill_vid; +#endif + + tp = dev->priv; + tp->pdev = pdev; + tp->dev = dev; + tp->pm_cap = pm_cap; + tp->mac_mode = TG3_DEF_MAC_MODE; + tp->rx_mode = TG3_DEF_RX_MODE; + tp->tx_mode = TG3_DEF_TX_MODE; + tp->mi_mode = MAC_MI_MODE_BASE; + if (tg3_debug > 0) + tp->msg_enable = tg3_debug; + else + tp->msg_enable = TG3_DEF_MSG_ENABLE; + + /* The word/byte swap controls here control register access byte + * swapping. DMA data byte swapping is controlled in the GRC_MODE + * setting below. + */ + tp->misc_host_ctrl = + MISC_HOST_CTRL_MASK_PCI_INT | + MISC_HOST_CTRL_WORD_SWAP | + MISC_HOST_CTRL_INDIR_ACCESS | + MISC_HOST_CTRL_PCISTATE_RW; + + /* The NONFRM (non-frame) byte/word swap controls take effect + * on descriptor entries, anything which isn't packet data. + * + * The StrongARM chips on the board (one for tx, one for rx) + * are running in big-endian mode. + */ + tp->grc_mode = (GRC_MODE_WSWAP_DATA | GRC_MODE_BSWAP_DATA | + GRC_MODE_WSWAP_NONFRM_DATA); +#ifdef __BIG_ENDIAN + tp->grc_mode |= GRC_MODE_BSWAP_NONFRM_DATA; +#endif + spin_lock_init(&tp->lock); + spin_lock_init(&tp->indirect_lock); + + tp->regs = (unsigned long) ioremap(tg3reg_base, tg3reg_len); + if (tp->regs == 0UL) { + printk(KERN_ERR PFX "Cannot map device registers, " + "aborting.\n"); + err = -ENOMEM; + goto err_out_free_dev; + } + + tg3_init_link_config(tp); + + tg3_init_coalesce_config(tp); + + tg3_init_bufmgr_config(tp); + + tp->rx_pending = TG3_DEF_RX_RING_PENDING; +#if TG3_MINI_RING_WORKS + tp->rx_mini_pending = TG3_DEF_RX_MINI_RING_PENDING; +#endif + tp->rx_jumbo_pending = TG3_DEF_RX_JUMBO_RING_PENDING; + tp->tx_pending = TG3_DEF_TX_RING_PENDING; + + dev->open = tg3_open; + dev->stop = tg3_close; + dev->get_stats = tg3_get_stats; + dev->set_multicast_list = tg3_set_rx_mode; + dev->set_mac_address = tg3_set_mac_addr; + dev->do_ioctl = tg3_ioctl; + dev->tx_timeout = tg3_tx_timeout; + dev->watchdog_timeo = TG3_TX_TIMEOUT; + dev->change_mtu = tg3_change_mtu; + dev->irq = pdev->irq; + + err = tg3_get_invariants(tp); + if (err) { + printk(KERN_ERR PFX "Problem fetching invariants of chip, " + "aborting.\n"); + goto err_out_iounmap; + } + + err = tg3_get_device_address(tp); + if (err) { + printk(KERN_ERR PFX "Could not obtain valid ethernet address, " + "aborting.\n"); + goto err_out_iounmap; + } + + err = tg3_test_dma(tp); + if (err) { + printk(KERN_ERR PFX "DMA engine test failed, aborting.\n"); + goto err_out_iounmap; + } + + /* Tigon3 can do ipv4 only... and some chips have buggy + * checksumming. + */ + if ((tp->tg3_flags & TG3_FLAG_BROKEN_CHECKSUMS) == 0) { + dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; + tp->tg3_flags |= TG3_FLAG_RX_CHECKSUMS; + } else + tp->tg3_flags &= ~TG3_FLAG_RX_CHECKSUMS; + + err = register_netdev(dev); + if (err) { + printk(KERN_ERR PFX "Cannot register net device, " + "aborting.\n"); + goto err_out_iounmap; + } + + pci_set_drvdata(pdev, dev); + + /* Now that we have fully setup the chip, save away a snapshot + * of the PCI config space. We need to restore this after + * GRC_MISC_CFG core clock resets and some resume events. + */ + pci_save_state(tp->pdev, tp->pci_cfg_state); + + printk(KERN_INFO "%s: Tigon3 [partno(%s) rev %04x PHY(%s)] (PCI%s:%s:%s) %sBaseT Ethernet ", + dev->name, + tp->board_part_number, + tp->pci_chip_rev_id, + tg3_phy_string(tp), + ((tp->tg3_flags & TG3_FLAG_PCIX_MODE) ? "X" : ""), + ((tp->tg3_flags & TG3_FLAG_PCI_HIGH_SPEED) ? + ((tp->tg3_flags & TG3_FLAG_PCIX_MODE) ? "133MHz" : "66MHz") : + ((tp->tg3_flags & TG3_FLAG_PCIX_MODE) ? "100MHz" : "33MHz")), + ((tp->tg3_flags & TG3_FLAG_PCI_32BIT) ? "32-bit" : "64-bit"), + (tp->tg3_flags & TG3_FLAG_10_100_ONLY) ? "10/100" : "10/100/1000"); + + for (i = 0; i < 6; i++) + printk("%2.2x%c", dev->dev_addr[i], + i == 5 ? '\n' : ':'); + + return 0; + +err_out_iounmap: + iounmap((void *) tp->regs); + +err_out_free_dev: + kfree(dev); + +err_out_free_res: + pci_release_regions(pdev); + +err_out_disable_pdev: + pci_disable_device(pdev); + pci_set_drvdata(pdev, NULL); + return err; +} + +static void __devexit tg3_remove_one(struct pci_dev *pdev) +{ + struct net_device *dev = pci_get_drvdata(pdev); + + if (dev) { + unregister_netdev(dev); + iounmap((void *) ((struct tg3 *)(dev->priv))->regs); + kfree(dev); + pci_release_regions(pdev); + pci_disable_device(pdev); + pci_set_drvdata(pdev, NULL); + } +} + +static int tg3_suspend(struct pci_dev *pdev, u32 state) +{ + struct net_device *dev = pci_get_drvdata(pdev); + struct tg3 *tp = dev->priv; + int err; + + if (!netif_running(dev)) + return 0; + + spin_lock_irq(&tp->lock); + tg3_disable_ints(tp); + spin_unlock_irq(&tp->lock); + + netif_device_detach(dev); + + spin_lock_irq(&tp->lock); + tg3_halt(tp); + spin_unlock_irq(&tp->lock); + + err = tg3_set_power_state(tp, state); + if (err) { + spin_lock_irq(&tp->lock); + + tg3_init_rings(tp); + tg3_init_hw(tp); + + spin_unlock_irq(&tp->lock); + + netif_device_attach(dev); + } + + return err; +} + +static int tg3_resume(struct pci_dev *pdev) +{ + struct net_device *dev = pci_get_drvdata(pdev); + struct tg3 *tp = dev->priv; + int err; + + if (!netif_running(dev)) + return 0; + + err = tg3_set_power_state(tp, 0); + if (err) + return err; + + netif_device_attach(dev); + + spin_lock_irq(&tp->lock); + + tg3_init_rings(tp); + tg3_init_hw(tp); + tg3_enable_ints(tp); + + spin_unlock_irq(&tp->lock); + + return 0; +} + +static struct pci_driver tg3_driver = { + name: DRV_MODULE_NAME, + id_table: tg3_pci_tbl, + probe: tg3_init_one, + remove: __devexit_p(tg3_remove_one), + suspend: tg3_suspend, + resume: tg3_resume +}; + +static int __init tg3_init(void) +{ + return pci_module_init(&tg3_driver); +} + +static void __exit tg3_cleanup(void) +{ + pci_unregister_driver(&tg3_driver); +} + +module_init(tg3_init); +module_exit(tg3_cleanup); diff -urN linux-2.4.18/drivers/net/tg3.h lia64-2.4/drivers/net/tg3.h --- linux-2.4.18/drivers/net/tg3.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/net/tg3.h Fri Jul 19 17:20:29 2002 @@ -0,0 +1,1910 @@ +/* $Id: tg3.h,v 1.37.2.32 2002/03/11 12:18:18 davem Exp $ + * tg3.h: Definitions for Broadcom Tigon3 ethernet driver. + * + * Copyright (C) 2001, 2002 David S. Miller (davem@redhat.com) + * Copyright (C) 2001 Jeff Garzik (jgarzik@mandrakesoft.com) + */ + +#ifndef _T3_H +#define _T3_H + +#if (LINUX_VERSION_CODE < 0x020412) +#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME; +#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME; +#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME) +#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME) +#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL)) +#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL)) +#endif + + +#define TG3_64BIT_REG_HIGH 0x00UL +#define TG3_64BIT_REG_LOW 0x04UL + +/* Descriptor block info. */ +#define TG3_BDINFO_HOST_ADDR 0x0UL /* 64-bit */ +#define TG3_BDINFO_MAXLEN_FLAGS 0x8UL /* 32-bit */ +#define BDINFO_FLAGS_USE_EXT_RECV 0x00000001 /* ext rx_buffer_desc */ +#define BDINFO_FLAGS_DISABLED 0x00000002 +#define BDINFO_FLAGS_MAXLEN_MASK 0xffff0000 +#define BDINFO_FLAGS_MAXLEN_SHIFT 16 +#define TG3_BDINFO_NIC_ADDR 0xcUL /* 32-bit */ +#define TG3_BDINFO_SIZE 0x10UL + +#define RX_COPY_THRESHOLD 256 + +#define RX_STD_MAX_SIZE 1536 +#define RX_JUMBO_MAX_SIZE 0xdeadbeef /* XXX */ +#if TG3_MINI_RING_WORKS +#define RX_MINI_MAX_SIZE 256 +#endif + +/* First 256 bytes are a mirror of PCI config space. */ +#define TG3PCI_VENDOR 0x00000000 +#define TG3PCI_VENDOR_BROADCOM 0x14e4 +#define TG3PCI_DEVICE 0x00000002 +#define TG3PCI_DEVICE_TIGON3_1 0x1644 /* BCM5700 */ +#define TG3PCI_DEVICE_TIGON3_2 0x1645 /* BCM5701 */ +#define TG3PCI_DEVICE_TIGON3_3 0x1646 /* BCM5702 */ +#define TG3PCI_DEVICE_TIGON3_4 0x1647 /* BCM5703 */ +#define TG3PCI_COMMAND 0x00000004 +#define TG3PCI_STATUS 0x00000006 +#define TG3PCI_CCREVID 0x00000008 +#define TG3PCI_CACHELINESZ 0x0000000c +#define TG3PCI_LATTIMER 0x0000000d +#define TG3PCI_HEADERTYPE 0x0000000e +#define TG3PCI_BIST 0x0000000f +#define TG3PCI_BASE0_LOW 0x00000010 +#define TG3PCI_BASE0_HIGH 0x00000014 +/* 0x18 --> 0x2c unused */ +#define TG3PCI_SUBSYSVENID 0x0000002c +#define TG3PCI_SUBSYSID 0x0000002e +#define TG3PCI_ROMADDR 0x00000030 +#define TG3PCI_CAPLIST 0x00000034 +/* 0x35 --> 0x3c unused */ +#define TG3PCI_IRQ_LINE 0x0000003c +#define TG3PCI_IRQ_PIN 0x0000003d +#define TG3PCI_MIN_GNT 0x0000003e +#define TG3PCI_MAX_LAT 0x0000003f +#define TG3PCI_X_CAPS 0x00000040 +#define PCIX_CAPS_RELAXED_ORDERING 0x00020000 +#define TG3PCI_PM_CAP_PTR 0x00000041 +#define TG3PCI_X_COMMAND 0x00000042 +#define TG3PCI_X_STATUS 0x00000044 +#define TG3PCI_PM_CAP_ID 0x00000048 +#define TG3PCI_VPD_CAP_PTR 0x00000049 +#define TG3PCI_PM_CAPS 0x0000004a +#define TG3PCI_PM_CTRL_STAT 0x0000004c +#define TG3PCI_BR_SUPP_EXT 0x0000004e +#define TG3PCI_PM_DATA 0x0000004f +#define TG3PCI_VPD_CAP_ID 0x00000050 +#define TG3PCI_MSI_CAP_PTR 0x00000051 +#define TG3PCI_VPD_ADDR_FLAG 0x00000052 +#define VPD_ADDR_FLAG_WRITE 0x00008000 +#define TG3PCI_VPD_DATA 0x00000054 +#define TG3PCI_MSI_CAP_ID 0x00000058 +#define TG3PCI_NXT_CAP_PTR 0x00000059 +#define TG3PCI_MSI_CTRL 0x0000005a +#define TG3PCI_MSI_ADDR_LOW 0x0000005c +#define TG3PCI_MSI_ADDR_HIGH 0x00000060 +#define TG3PCI_MSI_DATA 0x00000064 +/* 0x66 --> 0x68 unused */ +#define TG3PCI_MISC_HOST_CTRL 0x00000068 +#define MISC_HOST_CTRL_CLEAR_INT 0x00000001 +#define MISC_HOST_CTRL_MASK_PCI_INT 0x00000002 +#define MISC_HOST_CTRL_BYTE_SWAP 0x00000004 +#define MISC_HOST_CTRL_WORD_SWAP 0x00000008 +#define MISC_HOST_CTRL_PCISTATE_RW 0x00000010 +#define MISC_HOST_CTRL_CLKREG_RW 0x00000020 +#define MISC_HOST_CTRL_REGWORD_SWAP 0x00000040 +#define MISC_HOST_CTRL_INDIR_ACCESS 0x00000080 +#define MISC_HOST_CTRL_IRQ_MASK_MODE 0x00000100 +#define MISC_HOST_CTRL_TAGGED_STATUS 0x00000200 +#define MISC_HOST_CTRL_CHIPREV 0xffff0000 +#define MISC_HOST_CTRL_CHIPREV_SHIFT 16 +#define GET_CHIP_REV_ID(MISC_HOST_CTRL) \ + (((MISC_HOST_CTRL) & MISC_HOST_CTRL_CHIPREV) >> \ + MISC_HOST_CTRL_CHIPREV_SHIFT) +#define CHIPREV_ID_5700_A0 0x7000 +#define CHIPREV_ID_5700_A1 0x7001 +#define CHIPREV_ID_5700_B0 0x7100 +#define CHIPREV_ID_5700_B1 0x7101 +#define CHIPREV_ID_5700_B3 0x7102 +#define CHIPREV_ID_5700_ALTIMA 0x7104 +#define CHIPREV_ID_5700_C0 0x7200 +#define CHIPREV_ID_5701_A0 0x0000 +#define CHIPREV_ID_5701_B0 0x0100 +#define CHIPREV_ID_5701_B2 0x0102 +#define CHIPREV_ID_5701_B5 0x0105 +#define CHIPREV_ID_5703_A0 0x1000 +#define CHIPREV_ID_5703_A1 0x1001 +#define CHIPREV_ID_5703_A2 0x1002 +#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12) +#define ASIC_REV_5700 0x07 +#define ASIC_REV_5701 0x00 +#define ASIC_REV_5703 0x01 +#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) +#define CHIPREV_5700_AX 0x70 +#define CHIPREV_5700_BX 0x71 +#define CHIPREV_5700_CX 0x72 +#define CHIPREV_5701_AX 0x00 +#define GET_METAL_REV(CHIP_REV_ID) ((CHIP_REV_ID) & 0xff) +#define METAL_REV_A0 0x00 +#define METAL_REV_A1 0x01 +#define METAL_REV_B0 0x00 +#define METAL_REV_B1 0x01 +#define METAL_REV_B2 0x02 +#define TG3PCI_DMA_RW_CTRL 0x0000006c +#define DMA_RWCTRL_MIN_DMA 0x000000ff +#define DMA_RWCTRL_MIN_DMA_SHIFT 0 +#define DMA_RWCTRL_READ_BNDRY_MASK 0x00000700 +#define DMA_RWCTRL_READ_BNDRY_DISAB 0x00000000 +#define DMA_RWCTRL_READ_BNDRY_16 0x00000100 +#define DMA_RWCTRL_READ_BNDRY_32 0x00000200 +#define DMA_RWCTRL_READ_BNDRY_64 0x00000300 +#define DMA_RWCTRL_READ_BNDRY_128 0x00000400 +#define DMA_RWCTRL_READ_BNDRY_256 0x00000500 +#define DMA_RWCTRL_READ_BNDRY_512 0x00000600 +#define DMA_RWCTRL_READ_BNDRY_1024 0x00000700 +#define DMA_RWCTRL_WRITE_BNDRY_MASK 0x00003800 +#define DMA_RWCTRL_WRITE_BNDRY_DISAB 0x00000000 +#define DMA_RWCTRL_WRITE_BNDRY_16 0x00000800 +#define DMA_RWCTRL_WRITE_BNDRY_32 0x00001000 +#define DMA_RWCTRL_WRITE_BNDRY_64 0x00001800 +#define DMA_RWCTRL_WRITE_BNDRY_128 0x00002000 +#define DMA_RWCTRL_WRITE_BNDRY_256 0x00002800 +#define DMA_RWCTRL_WRITE_BNDRY_512 0x00003000 +#define DMA_RWCTRL_WRITE_BNDRY_1024 0x00003800 +#define DMA_RWCTRL_ONE_DMA 0x00004000 +#define DMA_RWCTRL_READ_WATER 0x00070000 +#define DMA_RWCTRL_READ_WATER_SHIFT 16 +#define DMA_RWCTRL_WRITE_WATER 0x00380000 +#define DMA_RWCTRL_WRITE_WATER_SHIFT 19 +#define DMA_RWCTRL_USE_MEM_READ_MULT 0x00400000 +#define DMA_RWCTRL_ASSERT_ALL_BE 0x00800000 +#define DMA_RWCTRL_PCI_READ_CMD 0x0f000000 +#define DMA_RWCTRL_PCI_READ_CMD_SHIFT 24 +#define DMA_RWCTRL_PCI_WRITE_CMD 0xf0000000 +#define DMA_RWCTRL_PCI_WRITE_CMD_SHIFT 28 +#define TG3PCI_PCISTATE 0x00000070 +#define PCISTATE_FORCE_RESET 0x00000001 +#define PCISTATE_INT_NOT_ACTIVE 0x00000002 +#define PCISTATE_CONV_PCI_MODE 0x00000004 +#define PCISTATE_BUS_SPEED_HIGH 0x00000008 +#define PCISTATE_BUS_32BIT 0x00000010 +#define PCISTATE_ROM_ENABLE 0x00000020 +#define PCISTATE_ROM_RETRY_ENABLE 0x00000040 +#define PCISTATE_FLAT_VIEW 0x00000100 +#define TG3PCI_CLOCK_CTRL 0x00000074 +#define CLOCK_CTRL_CORECLK_DISABLE 0x00000200 +#define CLOCK_CTRL_RXCLK_DISABLE 0x00000400 +#define CLOCK_CTRL_TXCLK_DISABLE 0x00000800 +#define CLOCK_CTRL_ALTCLK 0x00001000 +#define CLOCK_CTRL_PWRDOWN_PLL133 0x00008000 +#define CLOCK_CTRL_44MHZ_CORE 0x00040000 +#define CLOCK_CTRL_DELAY_PCI_GRANT 0x80000000 +#define TG3PCI_REG_BASE_ADDR 0x00000078 +#define TG3PCI_MEM_WIN_BASE_ADDR 0x0000007c +#define TG3PCI_REG_DATA 0x00000080 +#define TG3PCI_MEM_WIN_DATA 0x00000084 +#define TG3PCI_MODE_CTRL 0x00000088 +#define TG3PCI_MISC_CFG 0x0000008c +#define TG3PCI_MISC_LOCAL_CTRL 0x00000090 +/* 0x94 --> 0x98 unused */ +#define TG3PCI_STD_RING_PROD_IDX 0x00000098 /* 64-bit */ +#define TG3PCI_RCV_RET_RING_CON_IDX 0x000000a0 /* 64-bit */ +#define TG3PCI_SND_PROD_IDX 0x000000a8 /* 64-bit */ +/* 0xb0 --> 0x100 unused */ + +/* 0x100 --> 0x200 unused */ + +/* Mailbox registers */ +#define MAILBOX_INTERRUPT_0 0x00000200 /* 64-bit */ +#define MAILBOX_INTERRUPT_1 0x00000208 /* 64-bit */ +#define MAILBOX_INTERRUPT_2 0x00000210 /* 64-bit */ +#define MAILBOX_INTERRUPT_3 0x00000218 /* 64-bit */ +#define MAILBOX_GENERAL_0 0x00000220 /* 64-bit */ +#define MAILBOX_GENERAL_1 0x00000228 /* 64-bit */ +#define MAILBOX_GENERAL_2 0x00000230 /* 64-bit */ +#define MAILBOX_GENERAL_3 0x00000238 /* 64-bit */ +#define MAILBOX_GENERAL_4 0x00000240 /* 64-bit */ +#define MAILBOX_GENERAL_5 0x00000248 /* 64-bit */ +#define MAILBOX_GENERAL_6 0x00000250 /* 64-bit */ +#define MAILBOX_GENERAL_7 0x00000258 /* 64-bit */ +#define MAILBOX_RELOAD_STAT 0x00000260 /* 64-bit */ +#define MAILBOX_RCV_STD_PROD_IDX 0x00000268 /* 64-bit */ +#define MAILBOX_RCV_JUMBO_PROD_IDX 0x00000270 /* 64-bit */ +#define MAILBOX_RCV_MINI_PROD_IDX 0x00000278 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_0 0x00000280 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_1 0x00000288 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_2 0x00000290 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_3 0x00000298 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_4 0x000002a0 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_5 0x000002a8 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_6 0x000002b0 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_7 0x000002b8 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_8 0x000002c0 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_9 0x000002c8 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_10 0x000002d0 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_11 0x000002d8 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_12 0x000002e0 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_13 0x000002e8 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_14 0x000002f0 /* 64-bit */ +#define MAILBOX_RCVRET_CON_IDX_15 0x000002f8 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_0 0x00000300 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_1 0x00000308 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_2 0x00000310 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_3 0x00000318 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_4 0x00000320 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_5 0x00000328 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_6 0x00000330 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_7 0x00000338 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_8 0x00000340 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_9 0x00000348 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_10 0x00000350 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_11 0x00000358 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_12 0x00000360 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_13 0x00000368 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_14 0x00000370 /* 64-bit */ +#define MAILBOX_SNDHOST_PROD_IDX_15 0x00000378 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_0 0x00000380 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_1 0x00000388 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_2 0x00000390 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_3 0x00000398 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_4 0x000003a0 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_5 0x000003a8 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_6 0x000003b0 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_7 0x000003b8 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_8 0x000003c0 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_9 0x000003c8 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_10 0x000003d0 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_11 0x000003d8 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_12 0x000003e0 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_13 0x000003e8 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_14 0x000003f0 /* 64-bit */ +#define MAILBOX_SNDNIC_PROD_IDX_15 0x000003f8 /* 64-bit */ + +/* MAC control registers */ +#define MAC_MODE 0x00000400 +#define MAC_MODE_RESET 0x00000001 +#define MAC_MODE_HALF_DUPLEX 0x00000002 +#define MAC_MODE_PORT_MODE_MASK 0x0000000c +#define MAC_MODE_PORT_MODE_TBI 0x0000000c +#define MAC_MODE_PORT_MODE_GMII 0x00000008 +#define MAC_MODE_PORT_MODE_MII 0x00000004 +#define MAC_MODE_PORT_MODE_NONE 0x00000000 +#define MAC_MODE_PORT_INT_LPBACK 0x00000010 +#define MAC_MODE_TAGGED_MAC_CTRL 0x00000080 +#define MAC_MODE_TX_BURSTING 0x00000100 +#define MAC_MODE_MAX_DEFER 0x00000200 +#define MAC_MODE_LINK_POLARITY 0x00000400 +#define MAC_MODE_RXSTAT_ENABLE 0x00000800 +#define MAC_MODE_RXSTAT_CLEAR 0x00001000 +#define MAC_MODE_RXSTAT_FLUSH 0x00002000 +#define MAC_MODE_TXSTAT_ENABLE 0x00004000 +#define MAC_MODE_TXSTAT_CLEAR 0x00008000 +#define MAC_MODE_TXSTAT_FLUSH 0x00010000 +#define MAC_MODE_SEND_CONFIGS 0x00020000 +#define MAC_MODE_MAGIC_PKT_ENABLE 0x00040000 +#define MAC_MODE_ACPI_ENABLE 0x00080000 +#define MAC_MODE_MIP_ENABLE 0x00100000 +#define MAC_MODE_TDE_ENABLE 0x00200000 +#define MAC_MODE_RDE_ENABLE 0x00400000 +#define MAC_MODE_FHDE_ENABLE 0x00800000 +#define MAC_STATUS 0x00000404 +#define MAC_STATUS_PCS_SYNCED 0x00000001 +#define MAC_STATUS_SIGNAL_DET 0x00000002 +#define MAC_STATUS_RCVD_CFG 0x00000004 +#define MAC_STATUS_CFG_CHANGED 0x00000008 +#define MAC_STATUS_SYNC_CHANGED 0x00000010 +#define MAC_STATUS_PORT_DEC_ERR 0x00000400 +#define MAC_STATUS_LNKSTATE_CHANGED 0x00001000 +#define MAC_STATUS_MI_COMPLETION 0x00400000 +#define MAC_STATUS_MI_INTERRUPT 0x00800000 +#define MAC_STATUS_AP_ERROR 0x01000000 +#define MAC_STATUS_ODI_ERROR 0x02000000 +#define MAC_STATUS_RXSTAT_OVERRUN 0x04000000 +#define MAC_STATUS_TXSTAT_OVERRUN 0x08000000 +#define MAC_EVENT 0x00000408 +#define MAC_EVENT_PORT_DECODE_ERR 0x00000400 +#define MAC_EVENT_LNKSTATE_CHANGED 0x00001000 +#define MAC_EVENT_MI_COMPLETION 0x00400000 +#define MAC_EVENT_MI_INTERRUPT 0x00800000 +#define MAC_EVENT_AP_ERROR 0x01000000 +#define MAC_EVENT_ODI_ERROR 0x02000000 +#define MAC_EVENT_RXSTAT_OVERRUN 0x04000000 +#define MAC_EVENT_TXSTAT_OVERRUN 0x08000000 +#define MAC_LED_CTRL 0x0000040c +#define LED_CTRL_LNKLED_OVERRIDE 0x00000001 +#define LED_CTRL_1000MBPS_ON 0x00000002 +#define LED_CTRL_100MBPS_ON 0x00000004 +#define LED_CTRL_10MBPS_ON 0x00000008 +#define LED_CTRL_TRAFFIC_OVERRIDE 0x00000010 +#define LED_CTRL_TRAFFIC_BLINK 0x00000020 +#define LED_CTRL_TRAFFIC_LED 0x00000040 +#define LED_CTRL_1000MBPS_STATUS 0x00000080 +#define LED_CTRL_100MBPS_STATUS 0x00000100 +#define LED_CTRL_10MBPS_STATUS 0x00000200 +#define LED_CTRL_TRAFFIC_STATUS 0x00000400 +#define LED_CTRL_MAC_MODE 0x00000000 +#define LED_CTRL_PHY_MODE_1 0x00000800 +#define LED_CTRL_PHY_MODE_2 0x00001000 +#define LED_CTRL_BLINK_RATE_MASK 0x7ff80000 +#define LED_CTRL_BLINK_RATE_SHIFT 19 +#define LED_CTRL_BLINK_PER_OVERRIDE 0x00080000 +#define LED_CTRL_BLINK_RATE_OVERRIDE 0x80000000 +#define MAC_ADDR_0_HIGH 0x00000410 /* upper 2 bytes */ +#define MAC_ADDR_0_LOW 0x00000414 /* lower 4 bytes */ +#define MAC_ADDR_1_HIGH 0x00000418 /* upper 2 bytes */ +#define MAC_ADDR_1_LOW 0x0000041c /* lower 4 bytes */ +#define MAC_ADDR_2_HIGH 0x00000420 /* upper 2 bytes */ +#define MAC_ADDR_2_LOW 0x00000424 /* lower 4 bytes */ +#define MAC_ADDR_3_HIGH 0x00000428 /* upper 2 bytes */ +#define MAC_ADDR_3_LOW 0x0000042c /* lower 4 bytes */ +#define MAC_ACPI_MBUF_PTR 0x00000430 +#define MAC_ACPI_LEN_OFFSET 0x00000434 +#define ACPI_LENOFF_LEN_MASK 0x0000ffff +#define ACPI_LENOFF_LEN_SHIFT 0 +#define ACPI_LENOFF_OFF_MASK 0x0fff0000 +#define ACPI_LENOFF_OFF_SHIFT 16 +#define MAC_TX_BACKOFF_SEED 0x00000438 +#define TX_BACKOFF_SEED_MASK 0x000003ff +#define MAC_RX_MTU_SIZE 0x0000043c +#define RX_MTU_SIZE_MASK 0x0000ffff +#define MAC_PCS_TEST 0x00000440 +#define PCS_TEST_PATTERN_MASK 0x000fffff +#define PCS_TEST_PATTERN_SHIFT 0 +#define PCS_TEST_ENABLE 0x00100000 +#define MAC_TX_AUTO_NEG 0x00000444 +#define TX_AUTO_NEG_MASK 0x0000ffff +#define TX_AUTO_NEG_SHIFT 0 +#define MAC_RX_AUTO_NEG 0x00000448 +#define RX_AUTO_NEG_MASK 0x0000ffff +#define RX_AUTO_NEG_SHIFT 0 +#define MAC_MI_COM 0x0000044c +#define MI_COM_CMD_MASK 0x0c000000 +#define MI_COM_CMD_WRITE 0x04000000 +#define MI_COM_CMD_READ 0x08000000 +#define MI_COM_READ_FAILED 0x10000000 +#define MI_COM_START 0x20000000 +#define MI_COM_BUSY 0x20000000 +#define MI_COM_PHY_ADDR_MASK 0x03e00000 +#define MI_COM_PHY_ADDR_SHIFT 21 +#define MI_COM_REG_ADDR_MASK 0x001f0000 +#define MI_COM_REG_ADDR_SHIFT 16 +#define MI_COM_DATA_MASK 0x0000ffff +#define MAC_MI_STAT 0x00000450 +#define MAC_MI_STAT_LNKSTAT_ATTN_ENAB 0x00000001 +#define MAC_MI_MODE 0x00000454 +#define MAC_MI_MODE_CLK_10MHZ 0x00000001 +#define MAC_MI_MODE_SHORT_PREAMBLE 0x00000002 +#define MAC_MI_MODE_AUTO_POLL 0x00000010 +#define MAC_MI_MODE_CORE_CLK_62MHZ 0x00008000 +#define MAC_MI_MODE_BASE 0x000c0000 /* XXX magic values XXX */ +#define MAC_AUTO_POLL_STATUS 0x00000458 +#define MAC_AUTO_POLL_ERROR 0x00000001 +#define MAC_TX_MODE 0x0000045c +#define TX_MODE_RESET 0x00000001 +#define TX_MODE_ENABLE 0x00000002 +#define TX_MODE_FLOW_CTRL_ENABLE 0x00000010 +#define TX_MODE_BIG_BCKOFF_ENABLE 0x00000020 +#define TX_MODE_LONG_PAUSE_ENABLE 0x00000040 +#define MAC_TX_STATUS 0x00000460 +#define TX_STATUS_XOFFED 0x00000001 +#define TX_STATUS_SENT_XOFF 0x00000002 +#define TX_STATUS_SENT_XON 0x00000004 +#define TX_STATUS_LINK_UP 0x00000008 +#define TX_STATUS_ODI_UNDERRUN 0x00000010 +#define TX_STATUS_ODI_OVERRUN 0x00000020 +#define MAC_TX_LENGTHS 0x00000464 +#define TX_LENGTHS_SLOT_TIME_MASK 0x000000ff +#define TX_LENGTHS_SLOT_TIME_SHIFT 0 +#define TX_LENGTHS_IPG_MASK 0x00000f00 +#define TX_LENGTHS_IPG_SHIFT 8 +#define TX_LENGTHS_IPG_CRS_MASK 0x00003000 +#define TX_LENGTHS_IPG_CRS_SHIFT 12 +#define MAC_RX_MODE 0x00000468 +#define RX_MODE_RESET 0x00000001 +#define RX_MODE_ENABLE 0x00000002 +#define RX_MODE_FLOW_CTRL_ENABLE 0x00000004 +#define RX_MODE_KEEP_MAC_CTRL 0x00000008 +#define RX_MODE_KEEP_PAUSE 0x00000010 +#define RX_MODE_ACCEPT_OVERSIZED 0x00000020 +#define RX_MODE_ACCEPT_RUNTS 0x00000040 +#define RX_MODE_LEN_CHECK 0x00000080 +#define RX_MODE_PROMISC 0x00000100 +#define RX_MODE_NO_CRC_CHECK 0x00000200 +#define RX_MODE_KEEP_VLAN_TAG 0x00000400 +#define MAC_RX_STATUS 0x0000046c +#define RX_STATUS_REMOTE_TX_XOFFED 0x00000001 +#define RX_STATUS_XOFF_RCVD 0x00000002 +#define RX_STATUS_XON_RCVD 0x00000004 +#define MAC_HASH_REG_0 0x00000470 +#define MAC_HASH_REG_1 0x00000474 +#define MAC_HASH_REG_2 0x00000478 +#define MAC_HASH_REG_3 0x0000047c +#define MAC_RCV_RULE_0 0x00000480 +#define MAC_RCV_VALUE_0 0x00000484 +#define MAC_RCV_RULE_1 0x00000488 +#define MAC_RCV_VALUE_1 0x0000048c +#define MAC_RCV_RULE_2 0x00000490 +#define MAC_RCV_VALUE_2 0x00000494 +#define MAC_RCV_RULE_3 0x00000498 +#define MAC_RCV_VALUE_3 0x0000049c +#define MAC_RCV_RULE_4 0x000004a0 +#define MAC_RCV_VALUE_4 0x000004a4 +#define MAC_RCV_RULE_5 0x000004a8 +#define MAC_RCV_VALUE_5 0x000004ac +#define MAC_RCV_RULE_6 0x000004b0 +#define MAC_RCV_VALUE_6 0x000004b4 +#define MAC_RCV_RULE_7 0x000004b8 +#define MAC_RCV_VALUE_7 0x000004bc +#define MAC_RCV_RULE_8 0x000004c0 +#define MAC_RCV_VALUE_8 0x000004c4 +#define MAC_RCV_RULE_9 0x000004c8 +#define MAC_RCV_VALUE_9 0x000004cc +#define MAC_RCV_RULE_10 0x000004d0 +#define MAC_RCV_VALUE_10 0x000004d4 +#define MAC_RCV_RULE_11 0x000004d8 +#define MAC_RCV_VALUE_11 0x000004dc +#define MAC_RCV_RULE_12 0x000004e0 +#define MAC_RCV_VALUE_12 0x000004e4 +#define MAC_RCV_RULE_13 0x000004e8 +#define MAC_RCV_VALUE_13 0x000004ec +#define MAC_RCV_RULE_14 0x000004f0 +#define MAC_RCV_VALUE_14 0x000004f4 +#define MAC_RCV_RULE_15 0x000004f8 +#define MAC_RCV_VALUE_15 0x000004fc +#define RCV_RULE_DISABLE_MASK 0x7fffffff +#define MAC_RCV_RULE_CFG 0x00000500 +#define RCV_RULE_CFG_DEFAULT_CLASS 0x00000008 +/* 0x504 --> 0x590 unused */ +#define MAC_SERDES_CFG 0x00000590 +#define MAC_SERDES_STAT 0x00000594 +/* 0x598 --> 0x600 unused */ +#define MAC_TX_MAC_STATE_BASE 0x00000600 /* 16 bytes */ +#define MAC_RX_MAC_STATE_BASE 0x00000610 /* 20 bytes */ +/* 0x624 --> 0x800 unused */ +#define MAC_RX_STATS_BASE 0x00000800 /* 26 32-bit words */ +/* 0x868 --> 0x880 unused */ +#define MAC_TX_STATS_BASE 0x00000880 /* 28 32-bit words */ +/* 0x8f0 --> 0xc00 unused */ + +/* Send data initiator control registers */ +#define SNDDATAI_MODE 0x00000c00 +#define SNDDATAI_MODE_RESET 0x00000001 +#define SNDDATAI_MODE_ENABLE 0x00000002 +#define SNDDATAI_MODE_STAT_OFLOW_ENAB 0x00000004 +#define SNDDATAI_STATUS 0x00000c04 +#define SNDDATAI_STATUS_STAT_OFLOW 0x00000004 +#define SNDDATAI_STATSCTRL 0x00000c08 +#define SNDDATAI_SCTRL_ENABLE 0x00000001 +#define SNDDATAI_SCTRL_FASTUPD 0x00000002 +#define SNDDATAI_SCTRL_CLEAR 0x00000004 +#define SNDDATAI_SCTRL_FLUSH 0x00000008 +#define SNDDATAI_SCTRL_FORCE_ZERO 0x00000010 +#define SNDDATAI_STATSENAB 0x00000c0c +#define SNDDATAI_STATSINCMASK 0x00000c10 +/* 0xc14 --> 0xc80 unused */ +#define SNDDATAI_COS_CNT_0 0x00000c80 +#define SNDDATAI_COS_CNT_1 0x00000c84 +#define SNDDATAI_COS_CNT_2 0x00000c88 +#define SNDDATAI_COS_CNT_3 0x00000c8c +#define SNDDATAI_COS_CNT_4 0x00000c90 +#define SNDDATAI_COS_CNT_5 0x00000c94 +#define SNDDATAI_COS_CNT_6 0x00000c98 +#define SNDDATAI_COS_CNT_7 0x00000c9c +#define SNDDATAI_COS_CNT_8 0x00000ca0 +#define SNDDATAI_COS_CNT_9 0x00000ca4 +#define SNDDATAI_COS_CNT_10 0x00000ca8 +#define SNDDATAI_COS_CNT_11 0x00000cac +#define SNDDATAI_COS_CNT_12 0x00000cb0 +#define SNDDATAI_COS_CNT_13 0x00000cb4 +#define SNDDATAI_COS_CNT_14 0x00000cb8 +#define SNDDATAI_COS_CNT_15 0x00000cbc +#define SNDDATAI_DMA_RDQ_FULL_CNT 0x00000cc0 +#define SNDDATAI_DMA_PRIO_RDQ_FULL_CNT 0x00000cc4 +#define SNDDATAI_SDCQ_FULL_CNT 0x00000cc8 +#define SNDDATAI_NICRNG_SSND_PIDX_CNT 0x00000ccc +#define SNDDATAI_STATS_UPDATED_CNT 0x00000cd0 +#define SNDDATAI_INTERRUPTS_CNT 0x00000cd4 +#define SNDDATAI_AVOID_INTERRUPTS_CNT 0x00000cd8 +#define SNDDATAI_SND_THRESH_HIT_CNT 0x00000cdc +/* 0xce0 --> 0x1000 unused */ + +/* Send data completion control registers */ +#define SNDDATAC_MODE 0x00001000 +#define SNDDATAC_MODE_RESET 0x00000001 +#define SNDDATAC_MODE_ENABLE 0x00000002 +/* 0x1004 --> 0x1400 unused */ + +/* Send BD ring selector */ +#define SNDBDS_MODE 0x00001400 +#define SNDBDS_MODE_RESET 0x00000001 +#define SNDBDS_MODE_ENABLE 0x00000002 +#define SNDBDS_MODE_ATTN_ENABLE 0x00000004 +#define SNDBDS_STATUS 0x00001404 +#define SNDBDS_STATUS_ERROR_ATTN 0x00000004 +#define SNDBDS_HWDIAG 0x00001408 +/* 0x140c --> 0x1440 */ +#define SNDBDS_SEL_CON_IDX_0 0x00001440 +#define SNDBDS_SEL_CON_IDX_1 0x00001444 +#define SNDBDS_SEL_CON_IDX_2 0x00001448 +#define SNDBDS_SEL_CON_IDX_3 0x0000144c +#define SNDBDS_SEL_CON_IDX_4 0x00001450 +#define SNDBDS_SEL_CON_IDX_5 0x00001454 +#define SNDBDS_SEL_CON_IDX_6 0x00001458 +#define SNDBDS_SEL_CON_IDX_7 0x0000145c +#define SNDBDS_SEL_CON_IDX_8 0x00001460 +#define SNDBDS_SEL_CON_IDX_9 0x00001464 +#define SNDBDS_SEL_CON_IDX_10 0x00001468 +#define SNDBDS_SEL_CON_IDX_11 0x0000146c +#define SNDBDS_SEL_CON_IDX_12 0x00001470 +#define SNDBDS_SEL_CON_IDX_13 0x00001474 +#define SNDBDS_SEL_CON_IDX_14 0x00001478 +#define SNDBDS_SEL_CON_IDX_15 0x0000147c +/* 0x1480 --> 0x1800 unused */ + +/* Send BD initiator control registers */ +#define SNDBDI_MODE 0x00001800 +#define SNDBDI_MODE_RESET 0x00000001 +#define SNDBDI_MODE_ENABLE 0x00000002 +#define SNDBDI_MODE_ATTN_ENABLE 0x00000004 +#define SNDBDI_STATUS 0x00001804 +#define SNDBDI_STATUS_ERROR_ATTN 0x00000004 +#define SNDBDI_IN_PROD_IDX_0 0x00001808 +#define SNDBDI_IN_PROD_IDX_1 0x0000180c +#define SNDBDI_IN_PROD_IDX_2 0x00001810 +#define SNDBDI_IN_PROD_IDX_3 0x00001814 +#define SNDBDI_IN_PROD_IDX_4 0x00001818 +#define SNDBDI_IN_PROD_IDX_5 0x0000181c +#define SNDBDI_IN_PROD_IDX_6 0x00001820 +#define SNDBDI_IN_PROD_IDX_7 0x00001824 +#define SNDBDI_IN_PROD_IDX_8 0x00001828 +#define SNDBDI_IN_PROD_IDX_9 0x0000182c +#define SNDBDI_IN_PROD_IDX_10 0x00001830 +#define SNDBDI_IN_PROD_IDX_11 0x00001834 +#define SNDBDI_IN_PROD_IDX_12 0x00001838 +#define SNDBDI_IN_PROD_IDX_13 0x0000183c +#define SNDBDI_IN_PROD_IDX_14 0x00001840 +#define SNDBDI_IN_PROD_IDX_15 0x00001844 +/* 0x1848 --> 0x1c00 unused */ + +/* Send BD completion control registers */ +#define SNDBDC_MODE 0x00001c00 +#define SNDBDC_MODE_RESET 0x00000001 +#define SNDBDC_MODE_ENABLE 0x00000002 +#define SNDBDC_MODE_ATTN_ENABLE 0x00000004 +/* 0x1c04 --> 0x2000 unused */ + +/* Receive list placement control registers */ +#define RCVLPC_MODE 0x00002000 +#define RCVLPC_MODE_RESET 0x00000001 +#define RCVLPC_MODE_ENABLE 0x00000002 +#define RCVLPC_MODE_CLASS0_ATTN_ENAB 0x00000004 +#define RCVLPC_MODE_MAPOOR_AATTN_ENAB 0x00000008 +#define RCVLPC_MODE_STAT_OFLOW_ENAB 0x00000010 +#define RCVLPC_STATUS 0x00002004 +#define RCVLPC_STATUS_CLASS0 0x00000004 +#define RCVLPC_STATUS_MAPOOR 0x00000008 +#define RCVLPC_STATUS_STAT_OFLOW 0x00000010 +#define RCVLPC_LOCK 0x00002008 +#define RCVLPC_LOCK_REQ_MASK 0x0000ffff +#define RCVLPC_LOCK_REQ_SHIFT 0 +#define RCVLPC_LOCK_GRANT_MASK 0xffff0000 +#define RCVLPC_LOCK_GRANT_SHIFT 16 +#define RCVLPC_NON_EMPTY_BITS 0x0000200c +#define RCVLPC_NON_EMPTY_BITS_MASK 0x0000ffff +#define RCVLPC_CONFIG 0x00002010 +#define RCVLPC_STATSCTRL 0x00002014 +#define RCVLPC_STATSCTRL_ENABLE 0x00000001 +#define RCVLPC_STATSCTRL_FASTUPD 0x00000002 +#define RCVLPC_STATS_ENABLE 0x00002018 +#define RCVLPC_STATS_INCMASK 0x0000201c +/* 0x2020 --> 0x2100 unused */ +#define RCVLPC_SELLST_BASE 0x00002100 /* 16 16-byte entries */ +#define SELLST_TAIL 0x00000004 +#define SELLST_CONT 0x00000008 +#define SELLST_UNUSED 0x0000000c +#define RCVLPC_COS_CNTL_BASE 0x00002200 /* 16 4-byte entries */ +#define RCVLPC_DROP_FILTER_CNT 0x00002240 +#define RCVLPC_DMA_WQ_FULL_CNT 0x00002244 +#define RCVLPC_DMA_HIPRIO_WQ_FULL_CNT 0x00002248 +#define RCVLPC_NO_RCV_BD_CNT 0x0000224c +#define RCVLPC_IN_DISCARDS_CNT 0x00002250 +#define RCVLPC_IN_ERRORS_CNT 0x00002254 +#define RCVLPC_RCV_THRESH_HIT_CNT 0x00002258 +/* 0x225c --> 0x2400 unused */ + +/* Receive Data and Receive BD Initiator Control */ +#define RCVDBDI_MODE 0x00002400 +#define RCVDBDI_MODE_RESET 0x00000001 +#define RCVDBDI_MODE_ENABLE 0x00000002 +#define RCVDBDI_MODE_JUMBOBD_NEEDED 0x00000004 +#define RCVDBDI_MODE_FRM_TOO_BIG 0x00000008 +#define RCVDBDI_MODE_INV_RING_SZ 0x00000010 +#define RCVDBDI_STATUS 0x00002404 +#define RCVDBDI_STATUS_JUMBOBD_NEEDED 0x00000004 +#define RCVDBDI_STATUS_FRM_TOO_BIG 0x00000008 +#define RCVDBDI_STATUS_INV_RING_SZ 0x00000010 +#define RCVDBDI_SPLIT_FRAME_MINSZ 0x00002408 +/* 0x240c --> 0x2440 unused */ +#define RCVDBDI_JUMBO_BD 0x00002440 /* TG3_BDINFO_... */ +#define RCVDBDI_STD_BD 0x00002450 /* TG3_BDINFO_... */ +#define RCVDBDI_MINI_BD 0x00002460 /* TG3_BDINFO_... */ +#define RCVDBDI_JUMBO_CON_IDX 0x00002470 +#define RCVDBDI_STD_CON_IDX 0x00002474 +#define RCVDBDI_MINI_CON_IDX 0x00002478 +/* 0x247c --> 0x2480 unused */ +#define RCVDBDI_BD_PROD_IDX_0 0x00002480 +#define RCVDBDI_BD_PROD_IDX_1 0x00002484 +#define RCVDBDI_BD_PROD_IDX_2 0x00002488 +#define RCVDBDI_BD_PROD_IDX_3 0x0000248c +#define RCVDBDI_BD_PROD_IDX_4 0x00002490 +#define RCVDBDI_BD_PROD_IDX_5 0x00002494 +#define RCVDBDI_BD_PROD_IDX_6 0x00002498 +#define RCVDBDI_BD_PROD_IDX_7 0x0000249c +#define RCVDBDI_BD_PROD_IDX_8 0x000024a0 +#define RCVDBDI_BD_PROD_IDX_9 0x000024a4 +#define RCVDBDI_BD_PROD_IDX_10 0x000024a8 +#define RCVDBDI_BD_PROD_IDX_11 0x000024ac +#define RCVDBDI_BD_PROD_IDX_12 0x000024b0 +#define RCVDBDI_BD_PROD_IDX_13 0x000024b4 +#define RCVDBDI_BD_PROD_IDX_14 0x000024b8 +#define RCVDBDI_BD_PROD_IDX_15 0x000024bc +#define RCVDBDI_HWDIAG 0x000024c0 +/* 0x24c4 --> 0x2800 unused */ + +/* Receive Data Completion Control */ +#define RCVDCC_MODE 0x00002800 +#define RCVDCC_MODE_RESET 0x00000001 +#define RCVDCC_MODE_ENABLE 0x00000002 +#define RCVDCC_MODE_ATTN_ENABLE 0x00000004 +/* 0x2804 --> 0x2c00 unused */ + +/* Receive BD Initiator Control Registers */ +#define RCVBDI_MODE 0x00002c00 +#define RCVBDI_MODE_RESET 0x00000001 +#define RCVBDI_MODE_ENABLE 0x00000002 +#define RCVBDI_MODE_RCB_ATTN_ENAB 0x00000004 +#define RCVBDI_STATUS 0x00002c04 +#define RCVBDI_STATUS_RCB_ATTN 0x00000004 +#define RCVBDI_JUMBO_PROD_IDX 0x00002c08 +#define RCVBDI_STD_PROD_IDX 0x00002c0c +#define RCVBDI_MINI_PROD_IDX 0x00002c10 +#define RCVBDI_MINI_THRESH 0x00002c14 +#define RCVBDI_STD_THRESH 0x00002c18 +#define RCVBDI_JUMBO_THRESH 0x00002c1c +/* 0x2c20 --> 0x3000 unused */ + +/* Receive BD Completion Control Registers */ +#define RCVCC_MODE 0x00003000 +#define RCVCC_MODE_RESET 0x00000001 +#define RCVCC_MODE_ENABLE 0x00000002 +#define RCVCC_MODE_ATTN_ENABLE 0x00000004 +#define RCVCC_STATUS 0x00003004 +#define RCVCC_STATUS_ERROR_ATTN 0x00000004 +#define RCVCC_JUMP_PROD_IDX 0x00003008 +#define RCVCC_STD_PROD_IDX 0x0000300c +#define RCVCC_MINI_PROD_IDX 0x00003010 +/* 0x3014 --> 0x3400 unused */ + +/* Receive list selector control registers */ +#define RCVLSC_MODE 0x00003400 +#define RCVLSC_MODE_RESET 0x00000001 +#define RCVLSC_MODE_ENABLE 0x00000002 +#define RCVLSC_MODE_ATTN_ENABLE 0x00000004 +#define RCVLSC_STATUS 0x00003404 +#define RCVLSC_STATUS_ERROR_ATTN 0x00000004 +/* 0x3408 --> 0x3800 unused */ + +/* Mbuf cluster free registers */ +#define MBFREE_MODE 0x00003800 +#define MBFREE_MODE_RESET 0x00000001 +#define MBFREE_MODE_ENABLE 0x00000002 +#define MBFREE_STATUS 0x00003804 +/* 0x3808 --> 0x3c00 unused */ + +/* Host coalescing control registers */ +#define HOSTCC_MODE 0x00003c00 +#define HOSTCC_MODE_RESET 0x00000001 +#define HOSTCC_MODE_ENABLE 0x00000002 +#define HOSTCC_MODE_ATTN 0x00000004 +#define HOSTCC_MODE_NOW 0x00000008 +#define HOSTCC_MODE_FULL_STATUS 0x00000000 +#define HOSTCC_MODE_64BYTE 0x00000080 +#define HOSTCC_MODE_32BYTE 0x00000100 +#define HOSTCC_MODE_CLRTICK_RXBD 0x00000200 +#define HOSTCC_MODE_CLRTICK_TXBD 0x00000400 +#define HOSTCC_MODE_NOINT_ON_NOW 0x00000800 +#define HOSTCC_MODE_NOINT_ON_FORCE 0x00001000 +#define HOSTCC_STATUS 0x00003c04 +#define HOSTCC_STATUS_ERROR_ATTN 0x00000004 +#define HOSTCC_RXCOL_TICKS 0x00003c08 +#define LOW_RXCOL_TICKS 0x00000032 +#define DEFAULT_RXCOL_TICKS 0x00000048 +#define HIGH_RXCOL_TICKS 0x00000096 +#define HOSTCC_TXCOL_TICKS 0x00003c0c +#define LOW_TXCOL_TICKS 0x00000096 +#define DEFAULT_TXCOL_TICKS 0x0000012c +#define HIGH_TXCOL_TICKS 0x00000145 +#define HOSTCC_RXMAX_FRAMES 0x00003c10 +#define LOW_RXMAX_FRAMES 0x00000005 +#define DEFAULT_RXMAX_FRAMES 0x00000008 +#define HIGH_RXMAX_FRAMES 0x00000012 +#define HOSTCC_TXMAX_FRAMES 0x00003c14 +#define LOW_TXMAX_FRAMES 0x00000035 +#define DEFAULT_TXMAX_FRAMES 0x0000004b +#define HIGH_TXMAX_FRAMES 0x00000052 +#define HOSTCC_RXCOAL_TICK_INT 0x00003c18 +#define DEFAULT_RXCOAL_TICK_INT 0x00000019 +#define HOSTCC_TXCOAL_TICK_INT 0x00003c1c +#define DEFAULT_TXCOAL_TICK_INT 0x00000019 +#define HOSTCC_RXCOAL_MAXF_INT 0x00003c20 +#define DEFAULT_RXCOAL_MAXF_INT 0x00000005 +#define HOSTCC_TXCOAL_MAXF_INT 0x00003c24 +#define DEFAULT_TXCOAL_MAXF_INT 0x00000005 +#define HOSTCC_STAT_COAL_TICKS 0x00003c28 +#define DEFAULT_STAT_COAL_TICKS 0x000f4240 +/* 0x3c2c --> 0x3c30 unused */ +#define HOSTCC_STATS_BLK_HOST_ADDR 0x00003c30 /* 64-bit */ +#define HOSTCC_STATUS_BLK_HOST_ADDR 0x00003c38 /* 64-bit */ +#define HOSTCC_STATS_BLK_NIC_ADDR 0x00003c40 +#define HOSTCC_STATUS_BLK_NIC_ADDR 0x00003c44 +#define HOSTCC_FLOW_ATTN 0x00003c48 +/* 0x3c4c --> 0x3c50 unused */ +#define HOSTCC_JUMBO_CON_IDX 0x00003c50 +#define HOSTCC_STD_CON_IDX 0x00003c54 +#define HOSTCC_MINI_CON_IDX 0x00003c58 +/* 0x3c5c --> 0x3c80 unused */ +#define HOSTCC_RET_PROD_IDX_0 0x00003c80 +#define HOSTCC_RET_PROD_IDX_1 0x00003c84 +#define HOSTCC_RET_PROD_IDX_2 0x00003c88 +#define HOSTCC_RET_PROD_IDX_3 0x00003c8c +#define HOSTCC_RET_PROD_IDX_4 0x00003c90 +#define HOSTCC_RET_PROD_IDX_5 0x00003c94 +#define HOSTCC_RET_PROD_IDX_6 0x00003c98 +#define HOSTCC_RET_PROD_IDX_7 0x00003c9c +#define HOSTCC_RET_PROD_IDX_8 0x00003ca0 +#define HOSTCC_RET_PROD_IDX_9 0x00003ca4 +#define HOSTCC_RET_PROD_IDX_10 0x00003ca8 +#define HOSTCC_RET_PROD_IDX_11 0x00003cac +#define HOSTCC_RET_PROD_IDX_12 0x00003cb0 +#define HOSTCC_RET_PROD_IDX_13 0x00003cb4 +#define HOSTCC_RET_PROD_IDX_14 0x00003cb8 +#define HOSTCC_RET_PROD_IDX_15 0x00003cbc +#define HOSTCC_SND_CON_IDX_0 0x00003cc0 +#define HOSTCC_SND_CON_IDX_1 0x00003cc4 +#define HOSTCC_SND_CON_IDX_2 0x00003cc8 +#define HOSTCC_SND_CON_IDX_3 0x00003ccc +#define HOSTCC_SND_CON_IDX_4 0x00003cd0 +#define HOSTCC_SND_CON_IDX_5 0x00003cd4 +#define HOSTCC_SND_CON_IDX_6 0x00003cd8 +#define HOSTCC_SND_CON_IDX_7 0x00003cdc +#define HOSTCC_SND_CON_IDX_8 0x00003ce0 +#define HOSTCC_SND_CON_IDX_9 0x00003ce4 +#define HOSTCC_SND_CON_IDX_10 0x00003ce8 +#define HOSTCC_SND_CON_IDX_11 0x00003cec +#define HOSTCC_SND_CON_IDX_12 0x00003cf0 +#define HOSTCC_SND_CON_IDX_13 0x00003cf4 +#define HOSTCC_SND_CON_IDX_14 0x00003cf8 +#define HOSTCC_SND_CON_IDX_15 0x00003cfc +/* 0x3d00 --> 0x4000 unused */ + +/* Memory arbiter control registers */ +#define MEMARB_MODE 0x00004000 +#define MEMARB_MODE_RESET 0x00000001 +#define MEMARB_MODE_ENABLE 0x00000002 +#define MEMARB_STATUS 0x00004004 +#define MEMARB_TRAP_ADDR_LOW 0x00004008 +#define MEMARB_TRAP_ADDR_HIGH 0x0000400c +/* 0x4010 --> 0x4400 unused */ + +/* Buffer manager control registers */ +#define BUFMGR_MODE 0x00004400 +#define BUFMGR_MODE_RESET 0x00000001 +#define BUFMGR_MODE_ENABLE 0x00000002 +#define BUFMGR_MODE_ATTN_ENABLE 0x00000004 +#define BUFMGR_MODE_BM_TEST 0x00000008 +#define BUFMGR_MODE_MBLOW_ATTN_ENAB 0x00000010 +#define BUFMGR_STATUS 0x00004404 +#define BUFMGR_STATUS_ERROR 0x00000004 +#define BUFMGR_STATUS_MBLOW 0x00000010 +#define BUFMGR_MB_POOL_ADDR 0x00004408 +#define BUFMGR_MB_POOL_SIZE 0x0000440c +#define BUFMGR_MB_RDMA_LOW_WATER 0x00004410 +#define DEFAULT_MB_RDMA_LOW_WATER 0x00000040 +#define DEFAULT_MB_RDMA_LOW_WATER_JUMBO 0x00000130 +#define BUFMGR_MB_MACRX_LOW_WATER 0x00004414 +#define DEFAULT_MB_MACRX_LOW_WATER 0x00000020 +#define DEFAULT_MB_MACRX_LOW_WATER_JUMBO 0x00000098 +#define BUFMGR_MB_HIGH_WATER 0x00004418 +#define DEFAULT_MB_HIGH_WATER 0x00000060 +#define DEFAULT_MB_HIGH_WATER_JUMBO 0x0000017c +#define BUFMGR_RX_MB_ALLOC_REQ 0x0000441c +#define BUFMGR_MB_ALLOC_BIT 0x10000000 +#define BUFMGR_RX_MB_ALLOC_RESP 0x00004420 +#define BUFMGR_TX_MB_ALLOC_REQ 0x00004424 +#define BUFMGR_TX_MB_ALLOC_RESP 0x00004428 +#define BUFMGR_DMA_DESC_POOL_ADDR 0x0000442c +#define BUFMGR_DMA_DESC_POOL_SIZE 0x00004430 +#define BUFMGR_DMA_LOW_WATER 0x00004434 +#define DEFAULT_DMA_LOW_WATER 0x00000005 +#define BUFMGR_DMA_HIGH_WATER 0x00004438 +#define DEFAULT_DMA_HIGH_WATER 0x0000000a +#define BUFMGR_RX_DMA_ALLOC_REQ 0x0000443c +#define BUFMGR_RX_DMA_ALLOC_RESP 0x00004440 +#define BUFMGR_TX_DMA_ALLOC_REQ 0x00004444 +#define BUFMGR_TX_DMA_ALLOC_RESP 0x00004448 +#define BUFMGR_HWDIAG_0 0x0000444c +#define BUFMGR_HWDIAG_1 0x00004450 +#define BUFMGR_HWDIAG_2 0x00004454 +/* 0x4458 --> 0x4800 unused */ + +/* Read DMA control registers */ +#define RDMAC_MODE 0x00004800 +#define RDMAC_MODE_RESET 0x00000001 +#define RDMAC_MODE_ENABLE 0x00000002 +#define RDMAC_MODE_TGTABORT_ENAB 0x00000004 +#define RDMAC_MODE_MSTABORT_ENAB 0x00000008 +#define RDMAC_MODE_PARITYERR_ENAB 0x00000010 +#define RDMAC_MODE_ADDROFLOW_ENAB 0x00000020 +#define RDMAC_MODE_FIFOOFLOW_ENAB 0x00000040 +#define RDMAC_MODE_FIFOURUN_ENAB 0x00000080 +#define RDMAC_MODE_FIFOOREAD_ENAB 0x00000100 +#define RDMAC_MODE_LNGREAD_ENAB 0x00000200 +#define RDMAC_STATUS 0x00004804 +#define RDMAC_STATUS_TGTABORT 0x00000004 +#define RDMAC_STATUS_MSTABORT 0x00000008 +#define RDMAC_STATUS_PARITYERR 0x00000010 +#define RDMAC_STATUS_ADDROFLOW 0x00000020 +#define RDMAC_STATUS_FIFOOFLOW 0x00000040 +#define RDMAC_STATUS_FIFOURUN 0x00000080 +#define RDMAC_STATUS_FIFOOREAD 0x00000100 +#define RDMAC_STATUS_LNGREAD 0x00000200 +/* 0x4808 --> 0x4c00 unused */ + +/* Write DMA control registers */ +#define WDMAC_MODE 0x00004c00 +#define WDMAC_MODE_RESET 0x00000001 +#define WDMAC_MODE_ENABLE 0x00000002 +#define WDMAC_MODE_TGTABORT_ENAB 0x00000004 +#define WDMAC_MODE_MSTABORT_ENAB 0x00000008 +#define WDMAC_MODE_PARITYERR_ENAB 0x00000010 +#define WDMAC_MODE_ADDROFLOW_ENAB 0x00000020 +#define WDMAC_MODE_FIFOOFLOW_ENAB 0x00000040 +#define WDMAC_MODE_FIFOURUN_ENAB 0x00000080 +#define WDMAC_MODE_FIFOOREAD_ENAB 0x00000100 +#define WDMAC_MODE_LNGREAD_ENAB 0x00000200 +#define WDMAC_STATUS 0x00004c04 +#define WDMAC_STATUS_TGTABORT 0x00000004 +#define WDMAC_STATUS_MSTABORT 0x00000008 +#define WDMAC_STATUS_PARITYERR 0x00000010 +#define WDMAC_STATUS_ADDROFLOW 0x00000020 +#define WDMAC_STATUS_FIFOOFLOW 0x00000040 +#define WDMAC_STATUS_FIFOURUN 0x00000080 +#define WDMAC_STATUS_FIFOOREAD 0x00000100 +#define WDMAC_STATUS_LNGREAD 0x00000200 +/* 0x4c08 --> 0x5000 unused */ + +/* Per-cpu register offsets (arm9) */ +#define CPU_MODE 0x00000000 +#define CPU_MODE_RESET 0x00000001 +#define CPU_MODE_HALT 0x00000400 +#define CPU_STATE 0x00000004 +#define CPU_EVTMASK 0x00000008 +/* 0xc --> 0x1c reserved */ +#define CPU_PC 0x0000001c +#define CPU_INSN 0x00000020 +#define CPU_SPAD_UFLOW 0x00000024 +#define CPU_WDOG_CLEAR 0x00000028 +#define CPU_WDOG_VECTOR 0x0000002c +#define CPU_WDOG_PC 0x00000030 +#define CPU_HW_BP 0x00000034 +/* 0x38 --> 0x44 unused */ +#define CPU_WDOG_SAVED_STATE 0x00000044 +#define CPU_LAST_BRANCH_ADDR 0x00000048 +#define CPU_SPAD_UFLOW_SET 0x0000004c +/* 0x50 --> 0x200 unused */ +#define CPU_R0 0x00000200 +#define CPU_R1 0x00000204 +#define CPU_R2 0x00000208 +#define CPU_R3 0x0000020c +#define CPU_R4 0x00000210 +#define CPU_R5 0x00000214 +#define CPU_R6 0x00000218 +#define CPU_R7 0x0000021c +#define CPU_R8 0x00000220 +#define CPU_R9 0x00000224 +#define CPU_R10 0x00000228 +#define CPU_R11 0x0000022c +#define CPU_R12 0x00000230 +#define CPU_R13 0x00000234 +#define CPU_R14 0x00000238 +#define CPU_R15 0x0000023c +#define CPU_R16 0x00000240 +#define CPU_R17 0x00000244 +#define CPU_R18 0x00000248 +#define CPU_R19 0x0000024c +#define CPU_R20 0x00000250 +#define CPU_R21 0x00000254 +#define CPU_R22 0x00000258 +#define CPU_R23 0x0000025c +#define CPU_R24 0x00000260 +#define CPU_R25 0x00000264 +#define CPU_R26 0x00000268 +#define CPU_R27 0x0000026c +#define CPU_R28 0x00000270 +#define CPU_R29 0x00000274 +#define CPU_R30 0x00000278 +#define CPU_R31 0x0000027c +/* 0x280 --> 0x400 unused */ + +#define RX_CPU_BASE 0x00005000 +#define TX_CPU_BASE 0x00005400 + +/* Mailboxes */ +#define GRCMBOX_INTERRUPT_0 0x00005800 /* 64-bit */ +#define GRCMBOX_INTERRUPT_1 0x00005808 /* 64-bit */ +#define GRCMBOX_INTERRUPT_2 0x00005810 /* 64-bit */ +#define GRCMBOX_INTERRUPT_3 0x00005818 /* 64-bit */ +#define GRCMBOX_GENERAL_0 0x00005820 /* 64-bit */ +#define GRCMBOX_GENERAL_1 0x00005828 /* 64-bit */ +#define GRCMBOX_GENERAL_2 0x00005830 /* 64-bit */ +#define GRCMBOX_GENERAL_3 0x00005838 /* 64-bit */ +#define GRCMBOX_GENERAL_4 0x00005840 /* 64-bit */ +#define GRCMBOX_GENERAL_5 0x00005848 /* 64-bit */ +#define GRCMBOX_GENERAL_6 0x00005850 /* 64-bit */ +#define GRCMBOX_GENERAL_7 0x00005858 /* 64-bit */ +#define GRCMBOX_RELOAD_STAT 0x00005860 /* 64-bit */ +#define GRCMBOX_RCVSTD_PROD_IDX 0x00005868 /* 64-bit */ +#define GRCMBOX_RCVJUMBO_PROD_IDX 0x00005870 /* 64-bit */ +#define GRCMBOX_RCVMINI_PROD_IDX 0x00005878 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_0 0x00005880 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_1 0x00005888 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_2 0x00005890 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_3 0x00005898 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_4 0x000058a0 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_5 0x000058a8 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_6 0x000058b0 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_7 0x000058b8 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_8 0x000058c0 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_9 0x000058c8 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_10 0x000058d0 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_11 0x000058d8 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_12 0x000058e0 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_13 0x000058e8 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_14 0x000058f0 /* 64-bit */ +#define GRCMBOX_RCVRET_CON_IDX_15 0x000058f8 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_0 0x00005900 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_1 0x00005908 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_2 0x00005910 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_3 0x00005918 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_4 0x00005920 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_5 0x00005928 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_6 0x00005930 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_7 0x00005938 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_8 0x00005940 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_9 0x00005948 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_10 0x00005950 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_11 0x00005958 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_12 0x00005960 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_13 0x00005968 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_14 0x00005970 /* 64-bit */ +#define GRCMBOX_SNDHOST_PROD_IDX_15 0x00005978 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_0 0x00005980 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_1 0x00005988 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_2 0x00005990 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_3 0x00005998 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_4 0x000059a0 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_5 0x000059a8 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_6 0x000059b0 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_7 0x000059b8 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_8 0x000059c0 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_9 0x000059c8 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_10 0x000059d0 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_11 0x000059d8 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_12 0x000059e0 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_13 0x000059e8 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_14 0x000059f0 /* 64-bit */ +#define GRCMBOX_SNDNIC_PROD_IDX_15 0x000059f8 /* 64-bit */ +#define GRCMBOX_HIGH_PRIO_EV_VECTOR 0x00005a00 +#define GRCMBOX_HIGH_PRIO_EV_MASK 0x00005a04 +#define GRCMBOX_LOW_PRIO_EV_VEC 0x00005a08 +#define GRCMBOX_LOW_PRIO_EV_MASK 0x00005a0c +/* 0x5a10 --> 0x5c00 */ + +/* Flow Through queues */ +#define FTQ_RESET 0x00005c00 +/* 0x5c04 --> 0x5c10 unused */ +#define FTQ_DMA_NORM_READ_CTL 0x00005c10 +#define FTQ_DMA_NORM_READ_FULL_CNT 0x00005c14 +#define FTQ_DMA_NORM_READ_FIFO_ENQDEQ 0x00005c18 +#define FTQ_DMA_NORM_READ_WRITE_PEEK 0x00005c1c +#define FTQ_DMA_HIGH_READ_CTL 0x00005c20 +#define FTQ_DMA_HIGH_READ_FULL_CNT 0x00005c24 +#define FTQ_DMA_HIGH_READ_FIFO_ENQDEQ 0x00005c28 +#define FTQ_DMA_HIGH_READ_WRITE_PEEK 0x00005c2c +#define FTQ_DMA_COMP_DISC_CTL 0x00005c30 +#define FTQ_DMA_COMP_DISC_FULL_CNT 0x00005c34 +#define FTQ_DMA_COMP_DISC_FIFO_ENQDEQ 0x00005c38 +#define FTQ_DMA_COMP_DISC_WRITE_PEEK 0x00005c3c +#define FTQ_SEND_BD_COMP_CTL 0x00005c40 +#define FTQ_SEND_BD_COMP_FULL_CNT 0x00005c44 +#define FTQ_SEND_BD_COMP_FIFO_ENQDEQ 0x00005c48 +#define FTQ_SEND_BD_COMP_WRITE_PEEK 0x00005c4c +#define FTQ_SEND_DATA_INIT_CTL 0x00005c50 +#define FTQ_SEND_DATA_INIT_FULL_CNT 0x00005c54 +#define FTQ_SEND_DATA_INIT_FIFO_ENQDEQ 0x00005c58 +#define FTQ_SEND_DATA_INIT_WRITE_PEEK 0x00005c5c +#define FTQ_DMA_NORM_WRITE_CTL 0x00005c60 +#define FTQ_DMA_NORM_WRITE_FULL_CNT 0x00005c64 +#define FTQ_DMA_NORM_WRITE_FIFO_ENQDEQ 0x00005c68 +#define FTQ_DMA_NORM_WRITE_WRITE_PEEK 0x00005c6c +#define FTQ_DMA_HIGH_WRITE_CTL 0x00005c70 +#define FTQ_DMA_HIGH_WRITE_FULL_CNT 0x00005c74 +#define FTQ_DMA_HIGH_WRITE_FIFO_ENQDEQ 0x00005c78 +#define FTQ_DMA_HIGH_WRITE_WRITE_PEEK 0x00005c7c +#define FTQ_SWTYPE1_CTL 0x00005c80 +#define FTQ_SWTYPE1_FULL_CNT 0x00005c84 +#define FTQ_SWTYPE1_FIFO_ENQDEQ 0x00005c88 +#define FTQ_SWTYPE1_WRITE_PEEK 0x00005c8c +#define FTQ_SEND_DATA_COMP_CTL 0x00005c90 +#define FTQ_SEND_DATA_COMP_FULL_CNT 0x00005c94 +#define FTQ_SEND_DATA_COMP_FIFO_ENQDEQ 0x00005c98 +#define FTQ_SEND_DATA_COMP_WRITE_PEEK 0x00005c9c +#define FTQ_HOST_COAL_CTL 0x00005ca0 +#define FTQ_HOST_COAL_FULL_CNT 0x00005ca4 +#define FTQ_HOST_COAL_FIFO_ENQDEQ 0x00005ca8 +#define FTQ_HOST_COAL_WRITE_PEEK 0x00005cac +#define FTQ_MAC_TX_CTL 0x00005cb0 +#define FTQ_MAC_TX_FULL_CNT 0x00005cb4 +#define FTQ_MAC_TX_FIFO_ENQDEQ 0x00005cb8 +#define FTQ_MAC_TX_WRITE_PEEK 0x00005cbc +#define FTQ_MB_FREE_CTL 0x00005cc0 +#define FTQ_MB_FREE_FULL_CNT 0x00005cc4 +#define FTQ_MB_FREE_FIFO_ENQDEQ 0x00005cc8 +#define FTQ_MB_FREE_WRITE_PEEK 0x00005ccc +#define FTQ_RCVBD_COMP_CTL 0x00005cd0 +#define FTQ_RCVBD_COMP_FULL_CNT 0x00005cd4 +#define FTQ_RCVBD_COMP_FIFO_ENQDEQ 0x00005cd8 +#define FTQ_RCVBD_COMP_WRITE_PEEK 0x00005cdc +#define FTQ_RCVLST_PLMT_CTL 0x00005ce0 +#define FTQ_RCVLST_PLMT_FULL_CNT 0x00005ce4 +#define FTQ_RCVLST_PLMT_FIFO_ENQDEQ 0x00005ce8 +#define FTQ_RCVLST_PLMT_WRITE_PEEK 0x00005cec +#define FTQ_RCVDATA_INI_CTL 0x00005cf0 +#define FTQ_RCVDATA_INI_FULL_CNT 0x00005cf4 +#define FTQ_RCVDATA_INI_FIFO_ENQDEQ 0x00005cf8 +#define FTQ_RCVDATA_INI_WRITE_PEEK 0x00005cfc +#define FTQ_RCVDATA_COMP_CTL 0x00005d00 +#define FTQ_RCVDATA_COMP_FULL_CNT 0x00005d04 +#define FTQ_RCVDATA_COMP_FIFO_ENQDEQ 0x00005d08 +#define FTQ_RCVDATA_COMP_WRITE_PEEK 0x00005d0c +#define FTQ_SWTYPE2_CTL 0x00005d10 +#define FTQ_SWTYPE2_FULL_CNT 0x00005d14 +#define FTQ_SWTYPE2_FIFO_ENQDEQ 0x00005d18 +#define FTQ_SWTYPE2_WRITE_PEEK 0x00005d1c +/* 0x5d20 --> 0x6000 unused */ + +/* Message signaled interrupt registers */ +#define MSGINT_MODE 0x00006000 +#define MSGINT_MODE_RESET 0x00000001 +#define MSGINT_MODE_ENABLE 0x00000002 +#define MSGINT_STATUS 0x00006004 +#define MSGINT_FIFO 0x00006008 +/* 0x600c --> 0x6400 unused */ + +/* DMA completion registers */ +#define DMAC_MODE 0x00006400 +#define DMAC_MODE_RESET 0x00000001 +#define DMAC_MODE_ENABLE 0x00000002 +/* 0x6404 --> 0x6800 unused */ + +/* GRC registers */ +#define GRC_MODE 0x00006800 +#define GRC_MODE_UPD_ON_COAL 0x00000001 +#define GRC_MODE_BSWAP_NONFRM_DATA 0x00000002 +#define GRC_MODE_WSWAP_NONFRM_DATA 0x00000004 +#define GRC_MODE_BSWAP_DATA 0x00000010 +#define GRC_MODE_WSWAP_DATA 0x00000020 +#define GRC_MODE_SPLITHDR 0x00000100 +#define GRC_MODE_NOFRM_CRACKING 0x00000200 +#define GRC_MODE_INCL_CRC 0x00000400 +#define GRC_MODE_ALLOW_BAD_FRMS 0x00000800 +#define GRC_MODE_NOIRQ_ON_SENDS 0x00002000 +#define GRC_MODE_NOIRQ_ON_RCV 0x00004000 +#define GRC_MODE_FORCE_PCI32BIT 0x00008000 +#define GRC_MODE_HOST_STACKUP 0x00010000 +#define GRC_MODE_HOST_SENDBDS 0x00020000 +#define GRC_MODE_NO_TX_PHDR_CSUM 0x00100000 +#define GRC_MODE_NO_RX_PHDR_CSUM 0x00800000 +#define GRC_MODE_IRQ_ON_TX_CPU_ATTN 0x01000000 +#define GRC_MODE_IRQ_ON_RX_CPU_ATTN 0x02000000 +#define GRC_MODE_IRQ_ON_MAC_ATTN 0x04000000 +#define GRC_MODE_IRQ_ON_DMA_ATTN 0x08000000 +#define GRC_MODE_IRQ_ON_FLOW_ATTN 0x10000000 +#define GRC_MODE_4X_NIC_SEND_RINGS 0x20000000 +#define GRC_MODE_MCAST_FRM_ENABLE 0x40000000 +#define GRC_MISC_CFG 0x00006804 +#define GRC_MISC_CFG_CORECLK_RESET 0x00000001 +#define GRC_MISC_CFG_PRESCALAR_MASK 0x000000fe +#define GRC_MISC_CFG_PRESCALAR_SHIFT 1 +#define GRC_MISC_CFG_BOARD_ID_MASK 0x0001e000 +#define GRC_MISC_CFG_BOARD_ID_5700 0x0001e000 +#define GRC_MISC_CFG_BOARD_ID_5701 0x00000000 +#define GRC_MISC_CFG_BOARD_ID_5702FE 0x00004000 +#define GRC_MISC_CFG_BOARD_ID_5703 0x00000000 +#define GRC_MISC_CFG_BOARD_ID_5703S 0x00002000 +#define GRC_MISC_CFG_BOARD_ID_AC91002A1 0x00018000 +#define GRC_LOCAL_CTRL 0x00006808 +#define GRC_LCLCTRL_INT_ACTIVE 0x00000001 +#define GRC_LCLCTRL_CLEARINT 0x00000002 +#define GRC_LCLCTRL_SETINT 0x00000004 +#define GRC_LCLCTRL_INT_ON_ATTN 0x00000008 +#define GRC_LCLCTRL_GPIO_INPUT0 0x00000100 +#define GRC_LCLCTRL_GPIO_INPUT1 0x00000200 +#define GRC_LCLCTRL_GPIO_INPUT2 0x00000400 +#define GRC_LCLCTRL_GPIO_OE0 0x00000800 +#define GRC_LCLCTRL_GPIO_OE1 0x00001000 +#define GRC_LCLCTRL_GPIO_OE2 0x00002000 +#define GRC_LCLCTRL_GPIO_OUTPUT0 0x00004000 +#define GRC_LCLCTRL_GPIO_OUTPUT1 0x00008000 +#define GRC_LCLCTRL_GPIO_OUTPUT2 0x00010000 +#define GRC_LCLCTRL_EXTMEM_ENABLE 0x00020000 +#define GRC_LCLCTRL_MEMSZ_MASK 0x001c0000 +#define GRC_LCLCTRL_MEMSZ_256K 0x00000000 +#define GRC_LCLCTRL_MEMSZ_512K 0x00040000 +#define GRC_LCLCTRL_MEMSZ_1M 0x00080000 +#define GRC_LCLCTRL_MEMSZ_2M 0x000c0000 +#define GRC_LCLCTRL_MEMSZ_4M 0x00100000 +#define GRC_LCLCTRL_MEMSZ_8M 0x00140000 +#define GRC_LCLCTRL_MEMSZ_16M 0x00180000 +#define GRC_LCLCTRL_BANK_SELECT 0x00200000 +#define GRC_LCLCTRL_SSRAM_TYPE 0x00400000 +#define GRC_LCLCTRL_AUTO_SEEPROM 0x01000000 +#define GRC_TIMER 0x0000680c +#define GRC_RX_CPU_EVENT 0x00006810 +#define GRC_RX_TIMER_REF 0x00006814 +#define GRC_RX_CPU_SEM 0x00006818 +#define GRC_REMOTE_RX_CPU_ATTN 0x0000681c +#define GRC_TX_CPU_EVENT 0x00006820 +#define GRC_TX_TIMER_REF 0x00006824 +#define GRC_TX_CPU_SEM 0x00006828 +#define GRC_REMOTE_TX_CPU_ATTN 0x0000682c +#define GRC_MEM_POWER_UP 0x00006830 /* 64-bit */ +#define GRC_EEPROM_ADDR 0x00006838 +#define EEPROM_ADDR_WRITE 0x00000000 +#define EEPROM_ADDR_READ 0x80000000 +#define EEPROM_ADDR_COMPLETE 0x40000000 +#define EEPROM_ADDR_FSM_RESET 0x20000000 +#define EEPROM_ADDR_DEVID_MASK 0x1c000000 +#define EEPROM_ADDR_DEVID_SHIFT 26 +#define EEPROM_ADDR_START 0x02000000 +#define EEPROM_ADDR_CLKPERD_SHIFT 16 +#define EEPROM_ADDR_ADDR_MASK 0x0000ffff +#define EEPROM_ADDR_ADDR_SHIFT 0 +#define EEPROM_DEFAULT_CLOCK_PERIOD 0x60 +#define EEPROM_CHIP_SIZE (64 * 1024) +#define GRC_EEPROM_DATA 0x0000683c +#define GRC_EEPROM_CTRL 0x00006840 +#define GRC_MDI_CTRL 0x00006844 +#define GRC_SEEPROM_DELAY 0x00006848 +/* 0x684c --> 0x6c00 unused */ + +/* 0x6c00 --> 0x7000 unused */ + +/* NVRAM Control registers */ +#define NVRAM_CMD 0x00007000 +#define NVRAM_CMD_RESET 0x00000001 +#define NVRAM_CMD_DONE 0x00000008 +#define NVRAM_CMD_GO 0x00000010 +#define NVRAM_CMD_WR 0x00000020 +#define NVRAM_CMD_RD 0x00000000 +#define NVRAM_CMD_ERASE 0x00000040 +#define NVRAM_CMD_FIRST 0x00000080 +#define NVRAM_CMD_LAST 0x00000100 +#define NVRAM_STAT 0x00007004 +#define NVRAM_WRDATA 0x00007008 +#define NVRAM_ADDR 0x0000700c +#define NVRAM_ADDR_MSK 0x00ffffff +#define NVRAM_RDDATA 0x00007010 +#define NVRAM_CFG1 0x00007014 +#define NVRAM_CFG1_FLASHIF_ENAB 0x00000001 +#define NVRAM_CFG1_BUFFERED_MODE 0x00000002 +#define NVRAM_CFG1_PASS_THRU 0x00000004 +#define NVRAM_CFG1_BIT_BANG 0x00000008 +#define NVRAM_CFG1_COMPAT_BYPASS 0x80000000 +#define NVRAM_CFG2 0x00007018 +#define NVRAM_CFG3 0x0000701c +#define NVRAM_SWARB 0x00007020 +#define SWARB_REQ_SET0 0x00000001 +#define SWARB_REQ_SET1 0x00000002 +#define SWARB_REQ_SET2 0x00000004 +#define SWARB_REQ_SET3 0x00000008 +#define SWARB_REQ_CLR0 0x00000010 +#define SWARB_REQ_CLR1 0x00000020 +#define SWARB_REQ_CLR2 0x00000040 +#define SWARB_REQ_CLR3 0x00000080 +#define SWARB_GNT0 0x00000100 +#define SWARB_GNT1 0x00000200 +#define SWARB_GNT2 0x00000400 +#define SWARB_GNT3 0x00000800 +#define SWARB_REQ0 0x00001000 +#define SWARB_REQ1 0x00002000 +#define SWARB_REQ2 0x00004000 +#define SWARB_REQ3 0x00008000 +#define NVRAM_BUFFERED_PAGE_SIZE 264 +#define NVRAM_BUFFERED_PAGE_POS 9 +/* 0x7024 --> 0x7400 unused */ + +/* 0x7400 --> 0x8000 unused */ + +/* 32K Window into NIC internal memory */ +#define NIC_SRAM_WIN_BASE 0x00008000 + +/* Offsets into first 32k of NIC internal memory. */ +#define NIC_SRAM_PAGE_ZERO 0x00000000 +#define NIC_SRAM_SEND_RCB 0x00000100 /* 16 * TG3_BDINFO_... */ +#define NIC_SRAM_RCV_RET_RCB 0x00000200 /* 16 * TG3_BDINFO_... */ +#define NIC_SRAM_STATS_BLK 0x00000300 +#define NIC_SRAM_STATUS_BLK 0x00000b00 + +#define NIC_SRAM_FIRMWARE_MBOX 0x00000b50 +#define NIC_SRAM_FIRMWARE_MBOX_MAGIC1 0x4B657654 +#define NIC_SRAM_FIRMWARE_MBOX_MAGIC2 0x4861764b /* !dma on linkchg */ + +#define NIC_SRAM_DATA_SIG 0x00000b54 +#define NIC_SRAM_DATA_SIG_MAGIC 0x4b657654 /* ascii for 'KevT' */ + +#define NIC_SRAM_DATA_CFG 0x00000b58 +#define NIC_SRAM_DATA_CFG_PHY_TYPE_MASK 0x0000000c +#define NIC_SRAM_DATA_CFG_PHY_TYPE_UNKNOWN 0x00000000 +#define NIC_SRAM_DATA_CFG_PHY_TYPE_COPPER 0x00000004 +#define NIC_SRAM_DATA_CFG_PHY_TYPE_FIBER 0x00000008 +#define NIC_SRAM_DATA_CFG_LED_MODE_MASK 0x00000030 +#define NIC_SRAM_DATA_CFG_LED_MODE_UNKNOWN 0x00000000 +#define NIC_SRAM_DATA_CFG_LED_TRIPLE_SPD 0x00000010 +#define NIC_SRAM_DATA_CFG_LED_LINK_SPD 0x00000020 + +#define NIC_SRAM_DATA_PHY_ID 0x00000b74 +#define NIC_SRAM_DATA_PHY_ID1_MASK 0xffff0000 +#define NIC_SRAM_DATA_PHY_ID2_MASK 0x0000ffff + +#define NIC_SRAM_FW_CMD_MBOX 0x00000b78 +#define FWCMD_NICDRV_ALIVE 0x00000001 +#define FWCMD_NICDRV_PAUSE_FW 0x00000002 +#define FWCMD_NICDRV_IPV4ADDR_CHG 0x00000003 +#define FWCMD_NICDRV_IPV6ADDR_CHG 0x00000004 +#define FWCMD_NICDRV_FIX_DMAR 0x00000005 +#define FWCMD_NICDRV_FIX_DMAW 0x00000006 +#define NIC_SRAM_FW_CMD_LEN_MBOX 0x00000b7c +#define NIC_SRAM_FW_CMD_DATA_MBOX 0x00000b80 +#define NIC_SRAM_FW_ASF_STATUS_MBOX 0x00000c00 +#define NIC_SRAM_FW_DRV_STATE_MBOX 0x00000c04 +#define DRV_STATE_START 0x00000001 +#define DRV_STATE_UNLOAD 0x00000002 +#define DRV_STATE_WOL 0x00000003 +#define DRV_STATE_SUSPEND 0x00000004 + +#define NIC_SRAM_FW_RESET_TYPE_MBOX 0x00000c08 + +#define NIC_SRAM_MAC_ADDR_HIGH_MBOX 0x00000c14 +#define NIC_SRAM_MAC_ADDR_LOW_MBOX 0x00000c18 + +#if TG3_MINI_RING_WORKS +#define NIC_SRAM_RX_MINI_BUFFER_DESC 0x00001000 +#endif + +#define NIC_SRAM_DMA_DESC_POOL_BASE 0x00002000 +#define NIC_SRAM_DMA_DESC_POOL_SIZE 0x00002000 +#define NIC_SRAM_TX_BUFFER_DESC 0x00004000 /* 512 entries */ +#define NIC_SRAM_RX_BUFFER_DESC 0x00006000 /* 256 entries */ +#define NIC_SRAM_RX_JUMBO_BUFFER_DESC 0x00007000 /* 256 entries */ +#define NIC_SRAM_MBUF_POOL_BASE 0x00008000 +#define NIC_SRAM_MBUF_POOL_SIZE 0x00018000 + +/* Currently this is fixed. */ +#define PHY_ADDR 0x01 + +/* Tigon3 specific PHY MII registers. */ +#define TG3_BMCR_SPEED1000 0x0040 + +#define MII_TG3_CTRL 0x09 /* 1000-baseT control register */ +#define MII_TG3_CTRL_ADV_1000_HALF 0x0100 +#define MII_TG3_CTRL_ADV_1000_FULL 0x0200 +#define MII_TG3_CTRL_AS_MASTER 0x0800 +#define MII_TG3_CTRL_ENABLE_AS_MASTER 0x1000 + +#define MII_TG3_EXT_CTRL 0x10 /* Extended control register */ +#define MII_TG3_EXT_CTRL_LNK3_LED_MODE 0x0002 +#define MII_TG3_EXT_CTRL_TBI 0x8000 + +#define MII_TG3_EXT_STAT 0x11 /* Extended status register */ +#define MII_TG3_EXT_STAT_LPASS 0x0100 + +#define MII_TG3_DSP_RW_PORT 0x15 /* DSP coefficient read/write port */ + +#define MII_TG3_DSP_ADDRESS 0x17 /* DSP address register */ + +#define MII_TG3_AUX_CTRL 0x18 /* auxilliary control register */ + +#define MII_TG3_AUX_STAT 0x19 /* auxilliary status register */ +#define MII_TG3_AUX_STAT_LPASS 0x0004 +#define MII_TG3_AUX_STAT_SPDMASK 0x0700 +#define MII_TG3_AUX_STAT_10HALF 0x0100 +#define MII_TG3_AUX_STAT_10FULL 0x0200 +#define MII_TG3_AUX_STAT_100HALF 0x0300 +#define MII_TG3_AUX_STAT_100_4 0x0400 +#define MII_TG3_AUX_STAT_100FULL 0x0500 +#define MII_TG3_AUX_STAT_1000HALF 0x0600 +#define MII_TG3_AUX_STAT_1000FULL 0x0700 + +#define MII_TG3_ISTAT 0x1a /* IRQ status register */ +#define MII_TG3_IMASK 0x1b /* IRQ mask register */ + +/* ISTAT/IMASK event bits */ +#define MII_TG3_INT_LINKCHG 0x0002 +#define MII_TG3_INT_SPEEDCHG 0x0004 +#define MII_TG3_INT_DUPLEXCHG 0x0008 +#define MII_TG3_INT_ANEG_PAGE_RX 0x0400 + +/* XXX Add this to mii.h */ +#ifndef ADVERTISE_PAUSE +#define ADVERTISE_PAUSE_CAP 0x0400 +#endif +#ifndef ADVERTISE_PAUSE_ASYM +#define ADVERTISE_PAUSE_ASYM 0x0800 +#endif +#ifndef LPA_PAUSE +#define LPA_PAUSE_CAP 0x0400 +#endif +#ifndef LPA_PAUSE_ASYM +#define LPA_PAUSE_ASYM 0x0800 +#endif + +/* There are two ways to manage the TX descriptors on the tigon3. + * Either the descriptors are in host DMA'able memory, or they + * exist only in the cards on-chip SRAM. All 16 send bds are under + * the same mode, they may not be configured individually. + * + * The mode we use is controlled by TG3_FLAG_HOST_TXDS in tp->tg3_flags. + * + * To use host memory TX descriptors: + * 1) Set GRC_MODE_HOST_SENDBDS in GRC_MODE register. + * Make sure GRC_MODE_4X_NIC_SEND_RINGS is clear. + * 2) Allocate DMA'able memory. + * 3) In NIC_SRAM_SEND_RCB (of desired index) of on-chip SRAM: + * a) Set TG3_BDINFO_HOST_ADDR to DMA address of memory + * obtained in step 2 + * b) Set TG3_BDINFO_NIC_ADDR to NIC_SRAM_TX_BUFFER_DESC. + * c) Set len field of TG3_BDINFO_MAXLEN_FLAGS to number + * of TX descriptors. Leave flags field clear. + * 4) Access TX descriptors via host memory. The chip + * will refetch into local SRAM as needed when producer + * index mailboxes are updated. + * + * To use on-chip TX descriptors: + * 1) Set GRC_MODE_4X_NIC_SEND_RINGS in GRC_MODE register. + * Make sure GRC_MODE_HOST_SENDBDS is clear. + * 2) In NIC_SRAM_SEND_RCB (of desired index) of on-chip SRAM: + * a) Set TG3_BDINFO_HOST_ADDR to zero. + * b) Set TG3_BDINFO_NIC_ADDR to NIC_SRAM_TX_BUFFER_DESC + * c) TG3_BDINFO_MAXLEN_FLAGS is don't care. + * 3) Access TX descriptors directly in on-chip SRAM + * using normal {read,write}l(). (and not using + * pointer dereferencing of ioremap()'d memory like + * the broken Broadcom driver does) + * + * Note that BDINFO_FLAGS_DISABLED should be set in the flags field of + * TG3_BDINFO_MAXLEN_FLAGS of all unused SEND_RCB indices. + */ +struct tg3_tx_buffer_desc { + u32 addr_hi; + u32 addr_lo; + + u32 len_flags; +#define TXD_FLAG_TCPUDP_CSUM 0x0001 +#define TXD_FLAG_IP_CSUM 0x0002 +#define TXD_FLAG_END 0x0004 +#define TXD_FLAG_IP_FRAG 0x0008 +#define TXD_FLAG_IP_FRAG_END 0x0010 +#define TXD_FLAG_VLAN 0x0040 +#define TXD_FLAG_COAL_NOW 0x0080 +#define TXD_FLAG_CPU_PRE_DMA 0x0100 +#define TXD_FLAG_CPU_POST_DMA 0x0200 +#define TXD_FLAG_ADD_SRC_ADDR 0x1000 +#define TXD_FLAG_CHOOSE_SRC_ADDR 0x6000 +#define TXD_FLAG_NO_CRC 0x8000 +#define TXD_LEN_SHIFT 16 + + u32 vlan_tag; +#define TXD_VLAN_TAG_SHIFT 0 +}; + +#define TXD_ADDR 0x00UL /* 64-bit */ +#define TXD_LEN_FLAGS 0x08UL /* 32-bit (upper 16-bits are len) */ +#define TXD_VLAN_TAG 0x0cUL /* 32-bit (upper 16-bits are tag) */ +#define TXD_SIZE 0x10UL + +struct tg3_rx_buffer_desc { + u32 addr_hi; + u32 addr_lo; + + u32 idx_len; +#define RXD_IDX_MASK 0xffff0000 +#define RXD_IDX_SHIFT 16 +#define RXD_LEN_MASK 0x0000ffff +#define RXD_LEN_SHIFT 0 + + u32 type_flags; +#define RXD_TYPE_SHIFT 16 +#define RXD_FLAGS_SHIFT 0 + +#define RXD_FLAG_END 0x0004 +#if TG3_MINI_RING_WORKS +#define RXD_FLAG_MINI 0x0800 +#endif +#define RXD_FLAG_JUMBO 0x0020 +#define RXD_FLAG_VLAN 0x0040 +#define RXD_FLAG_ERROR 0x0400 +#define RXD_FLAG_IP_CSUM 0x1000 +#define RXD_FLAG_TCPUDP_CSUM 0x2000 +#define RXD_FLAG_IS_TCP 0x4000 + + u32 ip_tcp_csum; +#define RXD_IPCSUM_MASK 0xffff0000 +#define RXD_IPCSUM_SHIFT 16 +#define RXD_TCPCSUM_MASK 0x0000ffff +#define RXD_TCPCSUM_SHIFT 0 + + u32 err_vlan; + +#define RXD_VLAN_MASK 0x0000ffff + +#define RXD_ERR_BAD_CRC 0x00010000 +#define RXD_ERR_COLLISION 0x00020000 +#define RXD_ERR_LINK_LOST 0x00040000 +#define RXD_ERR_PHY_DECODE 0x00080000 +#define RXD_ERR_ODD_NIBBLE_RCVD_MII 0x00100000 +#define RXD_ERR_MAC_ABRT 0x00200000 +#define RXD_ERR_TOO_SMALL 0x00400000 +#define RXD_ERR_NO_RESOURCES 0x00800000 +#define RXD_ERR_HUGE_FRAME 0x01000000 +#define RXD_ERR_MASK 0xffff0000 + + u32 reserved; + u32 opaque; +#define RXD_OPAQUE_INDEX_MASK 0x0000ffff +#define RXD_OPAQUE_INDEX_SHIFT 0 +#define RXD_OPAQUE_RING_STD 0x00010000 +#define RXD_OPAQUE_RING_JUMBO 0x00020000 +#if TG3_MINI_RING_WORKS +#define RXD_OPAQUE_RING_MINI 0x00040000 +#endif +#define RXD_OPAQUE_RING_MASK 0x00070000 +}; + +struct tg3_ext_rx_buffer_desc { + struct { + u32 addr_hi; + u32 addr_lo; + } addrlist[3]; + u32 len2_len1; + u32 resv_len3; + struct tg3_rx_buffer_desc std; +}; + +/* We only use this when testing out the DMA engine + * at probe time. This is the internal format of buffer + * descriptors used by the chip at NIC_SRAM_DMA_DESCS. + */ +struct tg3_internal_buffer_desc { + u32 addr_hi; + u32 addr_lo; + u32 nic_mbuf; + /* XXX FIX THIS */ +#ifdef __BIG_ENDIAN + u16 cqid_sqid; + u16 len; +#else + u16 len; + u16 cqid_sqid; +#endif + u32 flags; + u32 __cookie1; + u32 __cookie2; + u32 __cookie3; +}; + +#define TG3_HW_STATUS_SIZE 0x80 +struct tg3_hw_status { + u32 status; +#define SD_STATUS_UPDATED 0x00000001 +#define SD_STATUS_LINK_CHG 0x00000002 +#define SD_STATUS_ERROR 0x00000004 + + u32 status_tag; + +#ifdef __BIG_ENDIAN + u16 rx_consumer; + u16 rx_jumbo_consumer; +#else + u16 rx_jumbo_consumer; + u16 rx_consumer; +#endif + +#ifdef __BIG_ENDIAN + u16 reserved; + u16 rx_mini_consumer; +#else + u16 rx_mini_consumer; + u16 reserved; +#endif + struct { +#ifdef __BIG_ENDIAN + u16 tx_consumer; + u16 rx_producer; +#else + u16 rx_producer; + u16 tx_consumer; +#endif + } idx[16]; +}; + +typedef struct { + u32 high, low; +} tg3_stat64_t; + +struct tg3_hw_stats { + u8 __reserved0[0x400-0x300]; + + /* Statistics maintained by Receive MAC. */ + tg3_stat64_t rx_octets; + u64 __reserved1; + tg3_stat64_t rx_fragments; + tg3_stat64_t rx_ucast_packets; + tg3_stat64_t rx_mcast_packets; + tg3_stat64_t rx_bcast_packets; + tg3_stat64_t rx_fcs_errors; + tg3_stat64_t rx_align_errors; + tg3_stat64_t rx_xon_pause_rcvd; + tg3_stat64_t rx_xoff_pause_rcvd; + tg3_stat64_t rx_mac_ctrl_rcvd; + tg3_stat64_t rx_xoff_entered; + tg3_stat64_t rx_frame_too_long_errors; + tg3_stat64_t rx_jabbers; + tg3_stat64_t rx_undersize_packets; + tg3_stat64_t rx_in_length_errors; + tg3_stat64_t rx_out_length_errors; + tg3_stat64_t rx_64_or_less_octet_packets; + tg3_stat64_t rx_65_to_127_octet_packets; + tg3_stat64_t rx_128_to_255_octet_packets; + tg3_stat64_t rx_256_to_511_octet_packets; + tg3_stat64_t rx_512_to_1023_octet_packets; + tg3_stat64_t rx_1024_to_1522_octet_packets; + tg3_stat64_t rx_1523_to_2047_octet_packets; + tg3_stat64_t rx_2048_to_4095_octet_packets; + tg3_stat64_t rx_4096_to_8191_octet_packets; + tg3_stat64_t rx_8192_to_9022_octet_packets; + + u64 __unused0[37]; + + /* Statistics maintained by Transmit MAC. */ + tg3_stat64_t tx_octets; + u64 __reserved2; + tg3_stat64_t tx_collisions; + tg3_stat64_t tx_xon_sent; + tg3_stat64_t tx_xoff_sent; + tg3_stat64_t tx_flow_control; + tg3_stat64_t tx_mac_errors; + tg3_stat64_t tx_single_collisions; + tg3_stat64_t tx_mult_collisions; + tg3_stat64_t tx_deferred; + u64 __reserved3; + tg3_stat64_t tx_excessive_collisions; + tg3_stat64_t tx_late_collisions; + tg3_stat64_t tx_collide_2times; + tg3_stat64_t tx_collide_3times; + tg3_stat64_t tx_collide_4times; + tg3_stat64_t tx_collide_5times; + tg3_stat64_t tx_collide_6times; + tg3_stat64_t tx_collide_7times; + tg3_stat64_t tx_collide_8times; + tg3_stat64_t tx_collide_9times; + tg3_stat64_t tx_collide_10times; + tg3_stat64_t tx_collide_11times; + tg3_stat64_t tx_collide_12times; + tg3_stat64_t tx_collide_13times; + tg3_stat64_t tx_collide_14times; + tg3_stat64_t tx_collide_15times; + tg3_stat64_t tx_ucast_packets; + tg3_stat64_t tx_mcast_packets; + tg3_stat64_t tx_bcast_packets; + tg3_stat64_t tx_carrier_sense_errors; + tg3_stat64_t tx_discards; + tg3_stat64_t tx_errors; + + u64 __unused1[31]; + + /* Statistics maintained by Receive List Placement. */ + tg3_stat64_t COS_rx_packets[16]; + tg3_stat64_t COS_rx_filter_dropped; + tg3_stat64_t dma_writeq_full; + tg3_stat64_t dma_write_prioq_full; + tg3_stat64_t rxbds_empty; + tg3_stat64_t rx_discards; + tg3_stat64_t rx_errors; + tg3_stat64_t rx_threshold_hit; + + u64 __unused2[9]; + + /* Statistics maintained by Send Data Initiator. */ + tg3_stat64_t COS_out_packets[16]; + tg3_stat64_t dma_readq_full; + tg3_stat64_t dma_read_prioq_full; + tg3_stat64_t tx_comp_queue_full; + + /* Statistics maintained by Host Coalescing. */ + tg3_stat64_t ring_set_send_prod_index; + tg3_stat64_t ring_status_update; + tg3_stat64_t nic_irqs; + tg3_stat64_t nic_avoided_irqs; + tg3_stat64_t nic_tx_threshold_hit; + + u8 __reserved4[0xb00-0x9c0]; +}; + +enum phy_led_mode { + led_mode_auto, + led_mode_three_link, + led_mode_link10 +}; + +/* 'mapping' is superfluous as the chip does not write into + * the tx/rx post rings so we could just fetch it from there. + * But the cache behavior is better how we are doing it now. + */ +struct ring_info { + struct sk_buff *skb; + DECLARE_PCI_UNMAP_ADDR(mapping) +}; + +struct tg3_config_info { + u32 flags; +}; + +struct tg3_link_config { + /* Describes what we're trying to get. */ + u32 advertising; + u16 speed; + u8 duplex; + u8 autoneg; + + /* Describes what we actually have. */ + u16 active_speed; + u8 active_duplex; +#define SPEED_INVALID 0xffff +#define DUPLEX_INVALID 0xff +#define AUTONEG_INVALID 0xff + + /* When we go in and out of low power mode we need + * to swap with this state. + */ + int phy_is_low_power; + u16 orig_speed; + u8 orig_duplex; + u8 orig_autoneg; +}; + +struct tg3_coalesce_config { + /* Current settings. */ + u32 rx_coalesce_ticks; + u32 rx_max_coalesced_frames; + u32 rx_coalesce_ticks_during_int; + u32 rx_max_coalesced_frames_during_int; + u32 tx_coalesce_ticks; + u32 tx_max_coalesced_frames; + u32 tx_coalesce_ticks_during_int; + u32 tx_max_coalesced_frames_during_int; + u32 stats_coalesce_ticks; + + /* Default settings. */ + u32 rx_coalesce_ticks_def; + u32 rx_max_coalesced_frames_def; + u32 rx_coalesce_ticks_during_int_def; + u32 rx_max_coalesced_frames_during_int_def; + u32 tx_coalesce_ticks_def; + u32 tx_max_coalesced_frames_def; + u32 tx_coalesce_ticks_during_int_def; + u32 tx_max_coalesced_frames_during_int_def; + u32 stats_coalesce_ticks_def; + + /* Adaptive RX/TX coalescing parameters. */ + u32 rate_sample_jiffies; + u32 pkt_rate_low; + u32 pkt_rate_high; + + u32 rx_coalesce_ticks_low; + u32 rx_max_coalesced_frames_low; + u32 tx_coalesce_ticks_low; + u32 tx_max_coalesced_frames_low; + + u32 rx_coalesce_ticks_high; + u32 rx_max_coalesced_frames_high; + u32 tx_coalesce_ticks_high; + u32 tx_max_coalesced_frames_high; +}; + +struct tg3_bufmgr_config { + u32 mbuf_read_dma_low_water; + u32 mbuf_mac_rx_low_water; + u32 mbuf_high_water; + + u32 mbuf_read_dma_low_water_jumbo; + u32 mbuf_mac_rx_low_water_jumbo; + u32 mbuf_high_water_jumbo; + + u32 dma_low_water; + u32 dma_high_water; +}; + +struct tg3 { + spinlock_t lock; + u32 tx_prod; + u32 tx_cons; + u32 rx_rcb_ptr; + u32 rx_std_ptr; + u32 rx_jumbo_ptr; +#if TG3_MINI_RING_WORKS + u32 rx_mini_ptr; +#endif + spinlock_t indirect_lock; + + struct net_device_stats net_stats; + struct net_device_stats net_stats_prev; + unsigned long phy_crc_errors; + + /* Adaptive coalescing engine. */ + unsigned long last_rate_sample; + u32 last_rx_count; + u32 last_tx_count; + + u32 rx_offset; + u32 tg3_flags; +#define TG3_FLAG_HOST_TXDS 0x00000001 +#define TG3_FLAG_TXD_MBOX_HWBUG 0x00000002 +#define TG3_FLAG_RX_CHECKSUMS 0x00000004 +#define TG3_FLAG_USE_LINKCHG_REG 0x00000008 +#define TG3_FLAG_USE_MI_INTERRUPT 0x00000010 +#define TG3_FLAG_ADAPTIVE_RX 0x00000020 +#define TG3_FLAG_ADAPTIVE_TX 0x00000040 +#define TG3_FLAG_POLL_SERDES 0x00000080 +#define TG3_FLAG_PHY_RESET_ON_INIT 0x00000100 +#define TG3_FLAG_PCIX_TARGET_HWBUG 0x00000200 +#define TG3_FLAG_TAGGED_IRQ_STATUS 0x00000400 +#define TG3_FLAG_WOL_SPEED_100MB 0x00000800 +#define TG3_FLAG_WOL_ENABLE 0x00001000 +#define TG3_FLAG_NVRAM 0x00002000 +#define TG3_FLAG_NVRAM_BUFFERED 0x00004000 +#define TG3_FLAG_RX_PAUSE 0x00008000 +#define TG3_FLAG_TX_PAUSE 0x00010000 +#define TG3_FLAG_PCIX_MODE 0x00020000 +#define TG3_FLAG_PCI_HIGH_SPEED 0x00040000 +#define TG3_FLAG_PCI_32BIT 0x00080000 +#define TG3_FLAG_NO_TX_PSEUDO_CSUM 0x00100000 +#define TG3_FLAG_NO_RX_PSEUDO_CSUM 0x00200000 +#define TG3_FLAG_AUTONEG_DISABLE 0x00400000 +#define TG3_FLAG_JUMBO_ENABLE 0x00800000 +#define TG3_FLAG_10_100_ONLY 0x01000000 +#define TG3_FLAG_PAUSE_AUTONEG 0x02000000 +#define TG3_FLAG_PAUSE_RX 0x04000000 +#define TG3_FLAG_PAUSE_TX 0x08000000 +#define TG3_FLAG_BROKEN_CHECKSUMS 0x10000000 +#define TG3_FLAG_GOT_SERDES_FLOWCTL 0x20000000 +#define TG3_FLAG_INIT_COMPLETE 0x80000000 + + u32 msg_enable; + + struct timer_list timer; + u16 timer_counter; + u16 timer_multiplier; + u32 timer_offset; + + struct tg3_link_config link_config; + struct tg3_coalesce_config coalesce_config; + struct tg3_bufmgr_config bufmgr_config; + + u32 rx_pending; +#if TG3_MINI_RING_WORKS + u32 rx_mini_pending; +#endif + u32 rx_jumbo_pending; + u32 tx_pending; + + /* cache h/w values, often passed straight to h/w */ + u32 rx_mode; + u32 tx_mode; + u32 mac_mode; + u32 mi_mode; + u32 misc_host_ctrl; + u32 grc_mode; + u32 grc_local_ctrl; + u32 dma_rwctrl; + u32 coalesce_mode; + + /* PCI block */ + u16 pci_chip_rev_id; + u8 pci_cacheline_sz; + u8 pci_lat_timer; + u8 pci_hdr_type; + u8 pci_bist; + u32 pci_cfg_state[64 / sizeof(u32)]; + + int pm_cap; + + /* PHY info */ + u32 phy_id; +#define PHY_ID_MASK 0xfffffff0 +#define PHY_ID_BCM5400 0x60008040 +#define PHY_ID_BCM5401 0x60008050 +#define PHY_ID_BCM5411 0x60008070 +#define PHY_ID_BCM5701 0x60008110 +#define PHY_ID_BCM5703 0x60008160 +#define PHY_ID_BCM8002 0x60010140 +#define PHY_ID_SERDES 0xfeedbee0 +#define PHY_ID_INVALID 0xffffffff +#define PHY_ID_REV_MASK 0x0000000f +#define PHY_REV_BCM5401_B0 0x1 +#define PHY_REV_BCM5401_B2 0x3 +#define PHY_REV_BCM5401_C0 0x6 +#define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */ + + enum phy_led_mode led_mode; + + char board_part_number[24]; + + /* This macro assumes the passed PHY ID is already masked + * with PHY_ID_MASK. + */ +#define KNOWN_PHY_ID(X) \ + ((X) == PHY_ID_BCM5400 || (X) == PHY_ID_BCM5401 || \ + (X) == PHY_ID_BCM5411 || (X) == PHY_ID_BCM5701 || \ + (X) == PHY_ID_BCM5703 || \ + (X) == PHY_ID_BCM8002 || (X) == PHY_ID_SERDES) + + unsigned long regs; + struct pci_dev *pdev; + struct net_device *dev; +#if TG3_VLAN_TAG_USED + struct vlan_group *vlgrp; +#endif + + struct tg3_rx_buffer_desc *rx_std; + struct ring_info *rx_std_buffers; + dma_addr_t rx_std_mapping; +#if TG3_MINI_RING_WORKS + struct tg3_rx_buffer_desc *rx_mini; + struct ring_info *rx_mini_buffers; + dma_addr_t rx_mini_mapping; +#endif + struct tg3_rx_buffer_desc *rx_jumbo; + struct ring_info *rx_jumbo_buffers; + dma_addr_t rx_jumbo_mapping; + + struct tg3_rx_buffer_desc *rx_rcb; + dma_addr_t rx_rcb_mapping; + + /* TX descs are only used if TG3_FLAG_HOST_TXDS is set. */ + struct tg3_tx_buffer_desc *tx_ring; + struct ring_info *tx_buffers; + dma_addr_t tx_desc_mapping; + + struct tg3_hw_status *hw_status; + dma_addr_t status_mapping; + + struct tg3_hw_stats *hw_stats; + dma_addr_t stats_mapping; +}; + +#endif /* !(_T3_H) */ diff -urN linux-2.4.18/drivers/net/tulip/media.c lia64-2.4/drivers/net/tulip/media.c --- linux-2.4.18/drivers/net/tulip/media.c Tue Jul 17 18:53:55 2001 +++ lia64-2.4/drivers/net/tulip/media.c Fri May 10 16:00:54 2002 @@ -284,6 +284,10 @@ for (i = 0; i < init_length; i++) outl(init_sequence[i], ioaddr + CSR12); } + + (void) inl(ioaddr + CSR6); /* flush CSR12 writes */ + udelay(500); /* Give MII time to recover */ + tmp_info = get_u16(&misc_info[1]); if (tmp_info) tp->advertising[phy_num] = tmp_info | 1; diff -urN linux-2.4.18/drivers/pci/pci.c lia64-2.4/drivers/pci/pci.c --- linux-2.4.18/drivers/pci/pci.c Mon Nov 26 11:18:48 2001 +++ lia64-2.4/drivers/pci/pci.c Mon Nov 26 11:21:43 2001 @@ -1565,10 +1565,10 @@ switch (rqst) { case PM_SAVE_STATE: - error = pci_pm_save_state((u32)data); + error = pci_pm_save_state((unsigned long)data); break; case PM_SUSPEND: - error = pci_pm_suspend((u32)data); + error = pci_pm_suspend((unsigned long)data); break; case PM_RESUME: error = pci_pm_resume(); @@ -1886,16 +1886,16 @@ int map, block; if ((page = pool_find_page (pool, dma)) == 0) { - printk (KERN_ERR "pci_pool_free %s/%s, %p/%x (bad dma)\n", + printk (KERN_ERR "pci_pool_free %s/%s, %p/%lx (bad dma)\n", pool->dev ? pool->dev->slot_name : NULL, - pool->name, vaddr, (int) (dma & 0xffffffff)); + pool->name, vaddr, (unsigned long) dma); return; } #ifdef CONFIG_PCIPOOL_DEBUG if (((dma - page->dma) + (void *)page->vaddr) != vaddr) { printk (KERN_ERR "pci_pool_free %s/%s, %p (bad vaddr)/%x\n", pool->dev ? pool->dev->slot_name : NULL, - pool->name, vaddr, (int) (dma & 0xffffffff)); + pool->name, vaddr, dma); return; } #endif diff -urN linux-2.4.18/drivers/pci/pci.ids lia64-2.4/drivers/pci/pci.ids --- linux-2.4.18/drivers/pci/pci.ids Tue Feb 26 11:04:31 2002 +++ lia64-2.4/drivers/pci/pci.ids Fri Jul 19 23:03:04 2002 @@ -917,6 +917,9 @@ 121a NetServer SMIC Controller 121b NetServer Legacy COM Port Decoder 121c NetServer PCI COM Port Decoder + 1229 zx1 System Bus Adapter + 122a zx1 I/O Controller + 122e zx1 Local Bus Adapter 2910 E2910A 2925 E2925A 103e Solliday Engineering @@ -1931,6 +1934,7 @@ 0153 NV15 GL (Quadro2 Pro) 0200 NV20 (GeForce3) 0203 Quadro DCC + 0258 NV25 (Quadro4 900XGL) 10df Emulex Corporation 10df Light Pulse Fibre Channel Adapter 1ae5 LP6000 Fibre Channel Host Adapter diff -urN linux-2.4.18/drivers/scsi/Config.in lia64-2.4/drivers/scsi/Config.in --- linux-2.4.18/drivers/scsi/Config.in Tue Feb 26 11:04:36 2002 +++ lia64-2.4/drivers/scsi/Config.in Tue Feb 26 11:38:15 2002 @@ -182,6 +182,7 @@ bool ' Include loadable firmware in driver' CONFIG_SCSI_QLOGIC_FC_FIRMWARE fi dep_tristate 'Qlogic QLA 1280 SCSI support' CONFIG_SCSI_QLOGIC_1280 $CONFIG_SCSI + dep_tristate 'Qlogic QLA 2100 driver support' CONFIG_SCSI_QLOGIC_QLA2100 $CONFIG_SCSI fi if [ "$CONFIG_X86" = "y" ]; then dep_tristate 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE $CONFIG_SCSI diff -urN linux-2.4.18/drivers/scsi/Makefile lia64-2.4/drivers/scsi/Makefile --- linux-2.4.18/drivers/scsi/Makefile Tue Feb 26 11:04:36 2002 +++ lia64-2.4/drivers/scsi/Makefile Tue Feb 26 11:38:15 2002 @@ -53,6 +53,7 @@ obj-$(CONFIG_SUN3_SCSI) += sun3_scsi.o obj-$(CONFIG_MVME16x_SCSI) += mvme16x.o 53c7xx.o obj-$(CONFIG_BVME6000_SCSI) += bvme6000.o 53c7xx.o +obj-$(CONFIG_SCSI_SIM) += simscsi.o obj-$(CONFIG_SCSI_SIM710) += sim710.o obj-$(CONFIG_SCSI_ADVANSYS) += advansys.o obj-$(CONFIG_SCSI_PCI2000) += pci2000.o @@ -84,6 +85,7 @@ obj-$(CONFIG_SCSI_QLOGIC_ISP) += qlogicisp.o obj-$(CONFIG_SCSI_QLOGIC_FC) += qlogicfc.o obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o +obj-$(CONFIG_SCSI_QLOGIC_QLA2100) += qla2x00.o obj-$(CONFIG_SCSI_PAS16) += pas16.o obj-$(CONFIG_SCSI_SEAGATE) += seagate.o obj-$(CONFIG_SCSI_FD_8xx) += seagate.o diff -urN linux-2.4.18/drivers/scsi/megaraid.c lia64-2.4/drivers/scsi/megaraid.c --- linux-2.4.18/drivers/scsi/megaraid.c Tue Feb 26 11:04:38 2002 +++ lia64-2.4/drivers/scsi/megaraid.c Fri May 10 15:55:45 2002 @@ -2032,9 +2032,6 @@ #if DEBUG -static unsigned int cum_time = 0; -static unsigned int cum_time_cnt = 0; - static void showMbox (mega_scb * pScb) { mega_mailbox *mbox; @@ -2043,7 +2040,7 @@ return; mbox = (mega_mailbox *) pScb->mboxData; - printk ("%u cmd:%x id:%x #scts:%x lba:%x addr:%x logdrv:%x #sg:%x\n", + printk ("%lu cmd:%x id:%x #scts:%x lba:%x addr:%x logdrv:%x #sg:%x\n", pScb->SCpnt->pid, mbox->cmd, mbox->cmdid, mbox->numsectors, mbox->lba, mbox->xferaddr, mbox->logdrv, mbox->numsgelements); @@ -2288,10 +2285,6 @@ phys_mbox = virt_to_bus (megaCfg->mbox); #endif -#if DEBUG - ShowMbox (pScb); -#endif - /* Wait until mailbox is free */ if (mega_busyWaitMbox (megaCfg)) { printk ("Blocked mailbox......!!\n"); @@ -3032,9 +3025,7 @@ sizeof (mega_mailbox64), &(megaCfg->dma_handle64)); - mega_register_mailbox (megaCfg, - virt_to_bus ((void *) megaCfg-> - mailbox64ptr)); + mega_register_mailbox (megaCfg, megaCfg->dma_handle64); #else mega_register_mailbox (megaCfg, virt_to_bus ((void *) &megaCfg-> @@ -3355,9 +3346,13 @@ mbox[0] = IS_BIOS_ENABLED; mbox[2] = GET_BIOS; - mboxpnt->xferaddr = virt_to_bus ((void *) megacfg->mega_buffer); + mboxpnt->xferaddr = pci_map_single(megacfg->dev, + (void *) megacfg->mega_buffer, (2 * 1024L), + PCI_DMA_FROMDEVICE); ret = megaIssueCmd (megacfg, mbox, NULL, 0); + + pci_unmap_single(megacfg->dev, mboxpnt->xferaddr, 2 * 1024L, PCI_DMA_FROMDEVICE); return (*(char *) megacfg->mega_buffer); } diff -urN linux-2.4.18/drivers/scsi/ql12160_fw.h lia64-2.4/drivers/scsi/ql12160_fw.h --- linux-2.4.18/drivers/scsi/ql12160_fw.h Mon Feb 7 19:45:28 2000 +++ lia64-2.4/drivers/scsi/ql12160_fw.h Mon Oct 30 22:17:11 2000 @@ -1,56 +1,93 @@ /* + ************************************************************************ + * * + * --- ISP12160 Initiator Firmware --- * + * 32 LUN Support * + * * + ************************************************************************ + * * + * Copyright (C) 1999,2000 Qlogic, Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted provided + * that the following conditions are met: + * 1. Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. - * 2. The name of the author may not be used to endorse or promote products + + * 2. Redistribution in binary form must reproduce the above copyright + + * notice, this list of conditions and the following disclaimer in the + + * documentation and/or other materials provided with the distribution. + + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * * + ************************************************************************ + */ + /* - * Firmware Version 10.01.19 (12:38 Oct 12, 1999) + * Firmware Version 10.04.08 (11:30 May 31, 2000) */ #ifdef UNIQUE_FW_NAME -unsigned short fw12160i_version = 10*1024+1; +unsigned short fw12160i_version = 10*1024+4; #else -unsigned short risc_code_version = 10*1024+1; +unsigned short risc_code_version = 10*1024+4; #endif #ifdef UNIQUE_FW_NAME -unsigned char fw12160i_version_str[] = {10,1,19}; +unsigned char fw12160i_version_str[] = {10,4,8}; #else -unsigned char firmware_version[] = {10,1,19}; +unsigned char firmware_version[] = {10,4,8}; #endif #ifdef UNIQUE_FW_NAME -#define fw12160i_VERSION_STRING "10.1.19" +#define fw12160i_VERSION_STRING "10.04.08" #else -#define FW_VERSION_STRING "10.1.19" +#define FW_VERSION_STRING "10.04.08" #endif #ifdef UNIQUE_FW_NAME @@ -64,1326 +101,1383 @@ #else unsigned short risc_code01[] = { #endif - 0x0804, 0x1041, 0x0000, 0x32f8, 0x0000, 0x2043, 0x4f50, 0x5952, + 0x0804, 0x1041, 0x0000, 0x34e5, 0x0000, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932, 0x2c31, 0x3939, 0x332c, 0x3139, 0x3934, 0x2051, 0x4c4f, 0x4749, 0x4320, 0x434f, 0x5250, 0x4f52, 0x4154, 0x494f, 0x4e00, 0x2049, 0x5350, 0x3132, 0x3136, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056, - 0x6572, 0x7369, 0x6f6e, 0x2031, 0x302e, 0x3031, 0x2020, 0x2043, + 0x6572, 0x7369, 0x6f6e, 0x2031, 0x302e, 0x3034, 0x2020, 0x2043, 0x7573, 0x746f, 0x6d65, 0x7220, 0x4e6f, 0x2e20, 0x3030, 0x2050, 0x726f, 0x6475, 0x6374, 0x204e, 0x6f2e, 0x2020, 0x3030, 0x2020, - 0x2400, 0x20c9, 0x8cff, 0x2071, 0x0200, 0x70a0, 0x70a2, 0x2001, + 0x2400, 0x20c9, 0x8eff, 0x2071, 0x0200, 0x70a0, 0x70a2, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1120, 0x2071, 0x0100, 0x70a0, 0x70a2, - 0x20c1, 0x0020, 0x2089, 0x1223, 0x2071, 0x0010, 0x70c3, 0x0004, + 0x20c1, 0x0020, 0x2089, 0x1221, 0x2071, 0x0010, 0x70c3, 0x0004, 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 0x000a, 0x2001, 0x04fd, 0x2004, 0x70d6, 0x2009, 0xfeff, 0x2130, 0x2128, - 0xa1a2, 0x4300, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, - 0xa192, 0x8d00, 0x2009, 0x0000, 0x2001, 0x0032, 0x080c, 0x1d83, - 0x2218, 0x2079, 0x4300, 0x2fa0, 0x2408, 0x2011, 0x0000, 0x20a9, + 0xa1a2, 0x4500, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, + 0xa192, 0x8f00, 0x2009, 0x0000, 0x2001, 0x0032, 0x080c, 0x1dcf, + 0x2218, 0x2079, 0x4500, 0x2fa0, 0x2408, 0x2011, 0x0000, 0x20a9, 0x0040, 0x42a4, 0x8109, 0x1dd8, 0x2009, 0xff00, 0x3400, 0xa102, 0x0218, 0x0110, 0x20a8, 0x42a4, 0x781b, 0x0064, 0x7814, 0xc0cd, - 0xc0d5, 0x7816, 0x2071, 0x0200, 0x00d6, 0x2069, 0x4340, 0x080c, - 0x42d8, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1130, 0x2069, 0x4380, - 0x2071, 0x0100, 0x080c, 0x42d8, 0x7814, 0xc0d4, 0x7816, 0x00de, + 0xc0d5, 0x7816, 0x2071, 0x0200, 0x00d6, 0x2069, 0x4540, 0x080c, + 0x44bd, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1130, 0x2069, 0x4580, + 0x2071, 0x0100, 0x080c, 0x44bd, 0x7814, 0xc0d4, 0x7816, 0x00de, 0x7eca, 0x7cc2, 0x7bc6, 0x7867, 0x0000, 0x7800, 0xc08d, 0x7802, 0x2031, 0x0030, 0x78af, 0x0101, 0x7823, 0x0002, 0x7827, 0x0002, - 0x2009, 0x0002, 0x2069, 0x4340, 0x681b, 0x0003, 0x6823, 0x0007, - 0x6827, 0x00fa, 0x682b, 0x0008, 0x682f, 0x0028, 0x6837, 0x0000, - 0x683b, 0x0006, 0x6833, 0x0008, 0x683f, 0x0000, 0x8109, 0x0500, - 0x68d3, 0x000a, 0x68c3, 0x43c0, 0x2079, 0x4300, 0x68d7, 0x762d, - 0x68c7, 0x48c0, 0x68cb, 0x47c0, 0x68cf, 0x88c0, 0x68ab, 0x8b44, - 0x68af, 0x8b49, 0x68b3, 0x8b44, 0x68b7, 0x8b44, 0x68a7, 0x0001, - 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x11c8, 0x2069, 0x4380, 0x0860, - 0x68d3, 0x000a, 0x68c3, 0x45c0, 0x68d7, 0x7839, 0x68c7, 0x68c0, - 0x68cb, 0x4840, 0x68cf, 0x89d0, 0x68ab, 0x8b49, 0x68af, 0x8b4e, - 0x68b3, 0x8b49, 0x68b7, 0x8b49, 0x68a7, 0x0001, 0x00e6, 0x2069, - 0x47c0, 0x2071, 0x0200, 0x70ec, 0xd0e4, 0x2019, 0x1c09, 0x2021, - 0x0009, 0x1120, 0x2019, 0x1c0c, 0x2021, 0x000c, 0x080c, 0x1cf3, - 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1188, 0x2069, 0x4840, 0x2071, - 0x0100, 0x70ec, 0xd0e4, 0x2019, 0x1c09, 0x2021, 0x0009, 0x1120, - 0x2019, 0x1c0c, 0x2021, 0x000c, 0x080c, 0x1cf3, 0x00ee, 0x2011, - 0x0002, 0x2069, 0x48c0, 0x2009, 0x0002, 0x20a9, 0x0100, 0x6837, - 0x0000, 0x680b, 0x0040, 0x7bc8, 0xa386, 0xfeff, 0x1128, 0x6817, - 0x0100, 0x681f, 0x0064, 0x0020, 0x6817, 0x0064, 0x681f, 0x0002, - 0xade8, 0x0010, 0x1f04, 0x1137, 0x8109, 0x1d38, 0x2001, 0x01ff, - 0x2004, 0xd0fc, 0x1128, 0x8211, 0x0118, 0x2069, 0x68c0, 0x08d8, - 0x080c, 0x2254, 0x080c, 0x3e39, 0x080c, 0x1b0f, 0x080c, 0x42a0, - 0x2091, 0x2200, 0x2079, 0x4300, 0x2071, 0x0050, 0x2091, 0x2400, - 0x2079, 0x4300, 0x2071, 0x0020, 0x2091, 0x2600, 0x2079, 0x0200, - 0x2071, 0x4340, 0x2091, 0x2800, 0x2079, 0x0100, 0x2071, 0x4380, - 0x2091, 0x2000, 0x2079, 0x4300, 0x2071, 0x0010, 0x3200, 0xa085, - 0x303d, 0x2090, 0x2071, 0x0010, 0x70c3, 0x0000, 0x1004, 0x118e, - 0x70c0, 0xa086, 0x0002, 0x1110, 0x080c, 0x13a3, 0x2039, 0x0000, - 0x080c, 0x129c, 0x78ac, 0xa005, 0x1180, 0x0e04, 0x119c, 0x786c, - 0xa065, 0x0110, 0x080c, 0x1ffe, 0x080c, 0x1da4, 0x0e04, 0x11b1, - 0x786c, 0xa065, 0x0110, 0x080c, 0x1ffe, 0x0e04, 0x11b1, 0x2009, - 0x4347, 0x2011, 0x4387, 0x2104, 0x220c, 0xa105, 0x0110, 0x080c, - 0x1c21, 0x2071, 0x4340, 0x70a4, 0xa005, 0x01e8, 0x7450, 0xa485, - 0x0000, 0x01c8, 0x2079, 0x0200, 0x2091, 0x8000, 0x72d4, 0xa28c, - 0x303d, 0x2190, 0x080c, 0x260d, 0x2091, 0x8000, 0x2091, 0x303d, - 0x0e04, 0x11d3, 0x2079, 0x4300, 0x786c, 0xa065, 0x0120, 0x2071, - 0x0010, 0x080c, 0x1ffe, 0x1d04, 0x11db, 0x2079, 0x4300, 0x2071, - 0x0010, 0x080c, 0x40ed, 0x2071, 0x4380, 0x70a4, 0xa005, 0x0188, - 0x7050, 0xa025, 0x0170, 0x2079, 0x0100, 0x2091, 0x8000, 0x72d4, - 0xa28c, 0x303d, 0x2190, 0x080c, 0x260d, 0x2091, 0x8000, 0x2091, - 0x303d, 0x2079, 0x4300, 0x2071, 0x0010, 0x0e04, 0x11fc, 0x786c, - 0xa065, 0x0110, 0x080c, 0x1ffe, 0x1d04, 0x1190, 0x080c, 0x40ed, - 0x0804, 0x1190, 0x3c00, 0xa084, 0x0007, 0x0002, 0x120e, 0x120e, - 0x1210, 0x1210, 0x1215, 0x1215, 0x121a, 0x121a, 0x080c, 0x243b, - 0x2091, 0x2400, 0x080c, 0x3e9c, 0x0005, 0x2091, 0x2200, 0x080c, - 0x3e9c, 0x0005, 0x2091, 0x2200, 0x080c, 0x3e9c, 0x2091, 0x2400, - 0x080c, 0x3e9c, 0x0005, 0x1243, 0x1243, 0x1244, 0x1244, 0x124f, - 0x124f, 0x124f, 0x124f, 0x1258, 0x1258, 0x1263, 0x1263, 0x124f, - 0x124f, 0x124f, 0x124f, 0x1272, 0x1272, 0x1272, 0x1272, 0x1272, - 0x1272, 0x1272, 0x1272, 0x1272, 0x1272, 0x1272, 0x1272, 0x1272, - 0x1272, 0x1272, 0x1272, 0x0cf8, 0x0006, 0x0106, 0x0126, 0x2091, - 0x2800, 0x080c, 0x2458, 0x012e, 0x010e, 0x000e, 0x000d, 0x0006, - 0x0106, 0x0126, 0x080c, 0x1202, 0x012e, 0x010e, 0x000e, 0x000d, - 0x0006, 0x0106, 0x0126, 0x2091, 0x2600, 0x080c, 0x2458, 0x012e, - 0x010e, 0x000e, 0x000d, 0x0006, 0x0106, 0x0126, 0x2091, 0x2600, - 0x080c, 0x2458, 0x2091, 0x2800, 0x080c, 0x2458, 0x012e, 0x010e, - 0x000e, 0x000d, 0x0006, 0x0106, 0x0126, 0x00e6, 0x00f6, 0x2079, - 0x4300, 0x2071, 0x0200, 0x2069, 0x4340, 0x3d00, 0xd08c, 0x1120, - 0x2069, 0x4380, 0x2071, 0x0100, 0x080c, 0x42d8, 0x00fe, 0x00ee, - 0x012e, 0x010e, 0x000e, 0x000d, 0x7008, 0x800b, 0x1240, 0x7007, - 0x0002, 0xa08c, 0x01e0, 0x1120, 0xd09c, 0x0108, 0x0887, 0x0897, - 0x70c3, 0x4002, 0x0804, 0x13a6, 0x0e04, 0x1308, 0x2061, 0x0000, - 0x6018, 0xd084, 0x1904, 0x1308, 0x7828, 0xa005, 0x1120, 0x0004, - 0x1309, 0x0804, 0x1308, 0xd0fc, 0x0148, 0x0006, 0x080c, 0x1aa9, - 0x000e, 0x0168, 0x2001, 0x4007, 0x0804, 0x13a5, 0x0006, 0x080c, - 0x1a9b, 0x000e, 0x0120, 0x2001, 0x4007, 0x0804, 0x13a5, 0x7910, - 0xd0fc, 0x1128, 0x2061, 0x4340, 0xc19c, 0xc7fc, 0x0020, 0x2061, - 0x4380, 0xc19d, 0xc7fd, 0x6064, 0xa005, 0x15d0, 0x7912, 0x6083, - 0x0000, 0x7828, 0xc0fc, 0xa086, 0x0018, 0x1120, 0x00c6, 0x080c, - 0x18c9, 0x00ce, 0x782b, 0x0000, 0x607c, 0xa065, 0x0190, 0x00c6, - 0x609c, 0x080c, 0x1b76, 0x00ce, 0x609f, 0x0000, 0x080c, 0x19db, - 0x2009, 0x0018, 0x6087, 0x0103, 0x080c, 0x1ab7, 0x1198, 0x080c, - 0x1b02, 0x7810, 0xd09c, 0x1118, 0x2061, 0x4340, 0x0020, 0x2061, - 0x4380, 0xc09c, 0x7812, 0x607f, 0x0000, 0x60d4, 0xd0c4, 0x0130, - 0xc0c4, 0x60d6, 0x2001, 0x4005, 0x0804, 0x13a5, 0x0804, 0x13a3, - 0x0005, 0xa006, 0x70c2, 0x70c6, 0x70ca, 0x70ce, 0x70da, 0x70c0, - 0xa08a, 0x0040, 0x1a04, 0x1355, 0x0002, 0x13a3, 0x13f1, 0x13bf, - 0x1425, 0x1459, 0x1459, 0x13b7, 0x19f3, 0x1463, 0x13b1, 0x13c3, - 0x13c4, 0x13c5, 0x13c6, 0x19f7, 0x13b1, 0x1470, 0x14c5, 0x18e4, - 0x19ed, 0x13c7, 0x1795, 0x17cb, 0x17fa, 0x183d, 0x1752, 0x175f, - 0x1772, 0x1784, 0x159a, 0x13b1, 0x14f7, 0x1502, 0x1510, 0x151e, - 0x1535, 0x1543, 0x1546, 0x1554, 0x1562, 0x156c, 0x1580, 0x158c, - 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x15a7, 0x15b8, 0x15d2, 0x1606, - 0x162f, 0x1641, 0x1644, 0x1677, 0x16aa, 0x16bc, 0x1720, 0x1730, - 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x1742, 0x2100, 0xa08a, 0x0040, - 0x1a04, 0x13b1, 0x0002, 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, - 0x1a19, 0x1a1f, 0x13b1, 0x13b1, 0x13b1, 0x1a23, 0x1a63, 0x13b1, - 0x13b1, 0x13b1, 0x13b1, 0x13ec, 0x1454, 0x146b, 0x14c0, 0x18df, - 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x1a67, 0x1a0b, 0x1a15, 0x13b1, - 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, - 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, - 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, - 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, 0x13b1, - 0x13b1, 0x13b1, 0x13b1, 0x72ca, 0x71c6, 0x2001, 0x4006, 0x0028, - 0x73ce, 0x72ca, 0x71c6, 0x2001, 0x4000, 0x70c2, 0x0e04, 0x13a6, + 0x2009, 0x0002, 0x2069, 0x4540, 0x681b, 0x0003, 0x6823, 0x0007, + 0x6827, 0x00fa, 0x682b, 0x0008, 0x682f, 0x0028, 0x6837, 0x0006, + 0x6833, 0x0008, 0x683b, 0x0000, 0x8109, 0x0500, 0x68cf, 0x000a, + 0x68bf, 0x45c0, 0x2079, 0x4500, 0x68d3, 0x762d, 0x68c3, 0x4ac0, + 0x68c7, 0x49c0, 0x68cb, 0x8ac0, 0x68a7, 0x8d44, 0x68ab, 0x8d49, + 0x68af, 0x8d44, 0x68b3, 0x8d44, 0x68a3, 0x0001, 0x2001, 0x01ff, + 0x2004, 0xd0fc, 0x11c8, 0x2069, 0x4580, 0x0870, 0x68cf, 0x000a, + 0x68bf, 0x47c0, 0x68d3, 0x7839, 0x68c3, 0x6ac0, 0x68c7, 0x4a40, + 0x68cb, 0x8bd0, 0x68a7, 0x8d49, 0x68ab, 0x8d4e, 0x68af, 0x8d49, + 0x68b3, 0x8d49, 0x68a3, 0x0001, 0x00e6, 0x2069, 0x49c0, 0x2071, + 0x0200, 0x70ec, 0xd0e4, 0x2019, 0x1c09, 0x2021, 0x0009, 0x1120, + 0x2019, 0x1c0c, 0x2021, 0x000c, 0x080c, 0x1d3f, 0x2001, 0x01ff, + 0x2004, 0xd0fc, 0x1188, 0x2069, 0x4a40, 0x2071, 0x0100, 0x70ec, + 0xd0e4, 0x2019, 0x1c09, 0x2021, 0x0009, 0x1120, 0x2019, 0x1c0c, + 0x2021, 0x000c, 0x080c, 0x1d3f, 0x00ee, 0x2011, 0x0002, 0x2069, + 0x4ac0, 0x2009, 0x0002, 0x20a9, 0x0100, 0x6837, 0x0000, 0x680b, + 0x0040, 0x7bc8, 0xa386, 0xfeff, 0x1128, 0x6817, 0x0100, 0x681f, + 0x0064, 0x0020, 0x6817, 0x0064, 0x681f, 0x0002, 0xade8, 0x0010, + 0x1f04, 0x1135, 0x8109, 0x1d38, 0x2001, 0x01ff, 0x2004, 0xd0fc, + 0x1128, 0x8211, 0x0118, 0x2069, 0x6ac0, 0x08d8, 0x080c, 0x22b7, + 0x080c, 0x3fba, 0x080c, 0x1b51, 0x080c, 0x4489, 0x2091, 0x2200, + 0x2079, 0x4500, 0x2071, 0x0050, 0x2091, 0x2400, 0x2079, 0x4500, + 0x2071, 0x0020, 0x2091, 0x2600, 0x2079, 0x0200, 0x2071, 0x4540, + 0x2091, 0x2800, 0x2079, 0x0100, 0x2071, 0x4580, 0x2091, 0x2000, + 0x2079, 0x4500, 0x2071, 0x0010, 0x3200, 0xa085, 0x303d, 0x2090, + 0x2071, 0x0010, 0x70c3, 0x0000, 0x1004, 0x118c, 0x70c0, 0xa086, + 0x0002, 0x1110, 0x080c, 0x13b3, 0x2039, 0x0000, 0x080c, 0x12ab, + 0x78ac, 0xa005, 0x1180, 0x0e04, 0x119a, 0x786c, 0xa065, 0x0110, + 0x080c, 0x2061, 0x080c, 0x1df0, 0x0e04, 0x11af, 0x786c, 0xa065, + 0x0110, 0x080c, 0x2061, 0x0e04, 0x11af, 0x2009, 0x4547, 0x2011, + 0x4587, 0x2104, 0x220c, 0xa105, 0x0110, 0x080c, 0x1c63, 0x2071, + 0x4540, 0x70a0, 0xa005, 0x01e8, 0x744c, 0xa485, 0x0000, 0x01c8, + 0x2079, 0x0200, 0x2091, 0x8000, 0x72d0, 0xa28c, 0x303d, 0x2190, + 0x080c, 0x26ff, 0x2091, 0x8000, 0x2091, 0x303d, 0x0e04, 0x11d1, + 0x2079, 0x4500, 0x786c, 0xa065, 0x0120, 0x2071, 0x0010, 0x080c, + 0x2061, 0x1d04, 0x11d9, 0x2079, 0x4500, 0x2071, 0x0010, 0x080c, + 0x42c7, 0x2071, 0x4580, 0x70a0, 0xa005, 0x0188, 0x704c, 0xa025, + 0x0170, 0x2079, 0x0100, 0x2091, 0x8000, 0x72d0, 0xa28c, 0x303d, + 0x2190, 0x080c, 0x26ff, 0x2091, 0x8000, 0x2091, 0x303d, 0x2079, + 0x4500, 0x2071, 0x0010, 0x0e04, 0x11fa, 0x786c, 0xa065, 0x0110, + 0x080c, 0x2061, 0x1d04, 0x118e, 0x080c, 0x42c7, 0x0804, 0x118e, + 0x3c00, 0xa084, 0x0007, 0x0002, 0x120c, 0x120c, 0x120e, 0x120e, + 0x1213, 0x1213, 0x1218, 0x1218, 0x080c, 0x252b, 0x2091, 0x2400, + 0x080c, 0x4052, 0x0005, 0x2091, 0x2200, 0x080c, 0x4052, 0x0005, + 0x2091, 0x2200, 0x080c, 0x4052, 0x2091, 0x2400, 0x080c, 0x4052, + 0x0005, 0x1241, 0x1241, 0x1242, 0x1242, 0x124d, 0x124d, 0x124d, + 0x124d, 0x1256, 0x1256, 0x1261, 0x1261, 0x124d, 0x124d, 0x124d, + 0x124d, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, + 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, + 0x1270, 0x0cf8, 0x0006, 0x0106, 0x0126, 0x2091, 0x2800, 0x080c, + 0x2548, 0x012e, 0x010e, 0x000e, 0x000d, 0x0006, 0x0106, 0x0126, + 0x080c, 0x1200, 0x012e, 0x010e, 0x000e, 0x000d, 0x0006, 0x0106, + 0x0126, 0x2091, 0x2600, 0x080c, 0x2548, 0x012e, 0x010e, 0x000e, + 0x000d, 0x0006, 0x0106, 0x0126, 0x2091, 0x2600, 0x080c, 0x2548, + 0x2091, 0x2800, 0x080c, 0x2548, 0x012e, 0x010e, 0x000e, 0x000d, + 0x0006, 0x0106, 0x0126, 0x00d6, 0x00e6, 0x00f6, 0x2079, 0x4500, + 0x2071, 0x0200, 0x2069, 0x4540, 0x3d00, 0xd08c, 0x0130, 0x70ec, + 0xa084, 0x1c00, 0x78e2, 0x080c, 0x44bd, 0x3d00, 0xd084, 0x0150, + 0x2069, 0x4580, 0x2071, 0x0100, 0x70ec, 0xa084, 0x1c00, 0x78e6, + 0x080c, 0x44bd, 0x080c, 0x24dc, 0x00fe, 0x00ee, 0x00de, 0x012e, + 0x010e, 0x000e, 0x000d, 0x7008, 0x800b, 0x1240, 0x7007, 0x0002, + 0xa08c, 0x01e0, 0x1120, 0xd09c, 0x0108, 0x0887, 0x0897, 0x70c3, + 0x4002, 0x0804, 0x13b6, 0x0e04, 0x1317, 0x2061, 0x0000, 0x6018, + 0xd084, 0x1904, 0x1317, 0x7828, 0xa005, 0x1120, 0x0004, 0x1318, + 0x0804, 0x1317, 0xd0fc, 0x0148, 0x0006, 0x080c, 0x1aeb, 0x000e, + 0x0168, 0x2001, 0x4007, 0x0804, 0x13b5, 0x0006, 0x080c, 0x1add, + 0x000e, 0x0120, 0x2001, 0x4007, 0x0804, 0x13b5, 0x7910, 0xd0fc, + 0x1128, 0x2061, 0x4540, 0xc19c, 0xc7fc, 0x0020, 0x2061, 0x4580, + 0xc19d, 0xc7fd, 0x6060, 0xa005, 0x15d0, 0x7912, 0x607f, 0x0000, + 0x7828, 0xc0fc, 0xa086, 0x0018, 0x1120, 0x00c6, 0x080c, 0x190a, + 0x00ce, 0x782b, 0x0000, 0x6078, 0xa065, 0x0190, 0x00c6, 0x609c, + 0x080c, 0x1bb8, 0x00ce, 0x609f, 0x0000, 0x080c, 0x1a1b, 0x2009, + 0x0018, 0x6087, 0x0103, 0x080c, 0x1af9, 0x1198, 0x080c, 0x1b44, + 0x7810, 0xd09c, 0x1118, 0x2061, 0x4540, 0x0020, 0x2061, 0x4580, + 0xc09c, 0x7812, 0x607b, 0x0000, 0x60d0, 0xd0c4, 0x0130, 0xc0c4, + 0x60d2, 0x2001, 0x4005, 0x0804, 0x13b5, 0x0804, 0x13b3, 0x0005, + 0xa006, 0x70c2, 0x70c6, 0x70ca, 0x70ce, 0x70da, 0x70c0, 0xa03d, + 0xa08a, 0x0040, 0x1a04, 0x1365, 0x0002, 0x13b3, 0x1401, 0x13cf, + 0x1435, 0x1469, 0x1469, 0x13c7, 0x1a33, 0x1473, 0x13c1, 0x13d3, + 0x13d4, 0x13d5, 0x13d6, 0x1a37, 0x13c1, 0x1480, 0x14d5, 0x1925, + 0x1a2d, 0x13d7, 0x17b4, 0x17ea, 0x1819, 0x185c, 0x1771, 0x177e, + 0x1791, 0x17a3, 0x15aa, 0x13c1, 0x1507, 0x1512, 0x1520, 0x152e, + 0x1545, 0x1553, 0x1556, 0x1564, 0x1572, 0x157c, 0x1590, 0x159c, + 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x15b7, 0x15c8, 0x15e2, 0x1616, + 0x163f, 0x1651, 0x1654, 0x167f, 0x16b8, 0x16ca, 0x173f, 0x174f, + 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x1761, 0x2100, 0xa08a, 0x0040, + 0x1a04, 0x13c1, 0x0002, 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, + 0x1a59, 0x1a5f, 0x13c1, 0x13c1, 0x13c1, 0x1a63, 0x1aa3, 0x13c1, + 0x13c1, 0x13c1, 0x13c1, 0x13fc, 0x1464, 0x147b, 0x14d0, 0x1920, + 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x1aa7, 0x1a4b, 0x1a55, 0x18ef, + 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, + 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, + 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, + 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, 0x13c1, + 0x13c1, 0x13c1, 0x13c1, 0x72ca, 0x71c6, 0x2001, 0x4006, 0x0028, + 0x73ce, 0x72ca, 0x71c6, 0x2001, 0x4000, 0x70c2, 0x0e04, 0x13b6, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x0005, 0x70c3, 0x4001, 0x0c90, 0x70c3, 0x4006, 0x0c78, 0x2099, 0x0041, 0x20a1, 0x0041, 0x20a9, 0x0005, 0x53a3, 0x0c20, 0x70c4, 0x70c3, 0x0004, 0x0807, 0x08f8, 0x08f0, 0x08e8, 0x08e0, 0x2091, 0x8000, 0x70c3, 0x0004, 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf, - 0x2020, 0x70d3, 0x000a, 0x2001, 0x0001, 0x70d6, 0x2079, 0x0000, + 0x2020, 0x70d3, 0x000a, 0x2001, 0x0004, 0x70d6, 0x2079, 0x0000, 0x781b, 0x0001, 0x2031, 0x0030, 0x2059, 0x1000, 0x2029, 0x041a, 0x2051, 0x0445, 0x2061, 0x0447, 0x20c1, 0x0020, 0x2091, 0x5000, 0x2091, 0x4080, 0x0804, 0x0418, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0018, 0x2029, 0x0000, 0x2520, 0x71d0, 0x72c8, 0x73cc, 0x70c4, 0x20a0, 0x2099, 0x0030, 0x7003, 0x0001, 0x7007, 0x0006, 0x731a, - 0x721e, 0x7422, 0x7526, 0x2021, 0x0040, 0x81ff, 0x0904, 0x13a3, + 0x721e, 0x7422, 0x7526, 0x2021, 0x0040, 0x81ff, 0x0904, 0x13b3, 0xa182, 0x0040, 0x1210, 0x2120, 0xa006, 0x2008, 0x8403, 0x7012, 0x7007, 0x0004, 0x7007, 0x0001, 0x7008, 0xd0fc, 0x0de8, 0x7007, - 0x0002, 0xa084, 0x01e0, 0x0120, 0x70c3, 0x4002, 0x0804, 0x13a6, - 0x24a8, 0x53a5, 0x0c10, 0x0804, 0x13a3, 0x2029, 0x0000, 0x2520, + 0x0002, 0xa084, 0x01e0, 0x0120, 0x70c3, 0x4002, 0x0804, 0x13b6, + 0x24a8, 0x53a5, 0x0c10, 0x0804, 0x13b3, 0x2029, 0x0000, 0x2520, 0x71d0, 0x72c8, 0x73cc, 0x70c4, 0x2098, 0x20a1, 0x0030, 0x7003, 0x0000, 0x7007, 0x0006, 0x731a, 0x721e, 0x7422, 0x7526, 0x2021, - 0x0040, 0x7007, 0x0006, 0x81ff, 0x0904, 0x13a3, 0xa182, 0x0040, + 0x0040, 0x7007, 0x0006, 0x81ff, 0x0904, 0x13b3, 0xa182, 0x0040, 0x1210, 0x2120, 0xa006, 0x2008, 0x8403, 0x7012, 0x24a8, 0x53a6, 0x7007, 0x0001, 0x7008, 0xd0fc, 0x0de8, 0xa084, 0x01e0, 0x0d48, - 0x70c3, 0x4002, 0x0804, 0x13a6, 0x75d8, 0x74dc, 0x75da, 0x74de, + 0x70c3, 0x4002, 0x0804, 0x13b6, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0878, 0x71c4, 0x70c8, 0x2114, 0xa79e, 0x0004, 0x1108, 0x200a, - 0x72ca, 0x0804, 0x13a2, 0x70c7, 0x000a, 0x70cb, 0x0001, 0x70cf, - 0x0013, 0x0804, 0x13a3, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0018, + 0x72ca, 0x0804, 0x13b2, 0x70c7, 0x000a, 0x70cb, 0x0004, 0x70cf, + 0x0008, 0x0804, 0x13b3, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0018, 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d0, 0x70c6, 0x72ca, 0x73ce, 0x74d2, 0xa005, 0x05f0, 0xa40a, 0x0110, 0x1a04, - 0x13a5, 0x8001, 0x7872, 0xa084, 0xfc00, 0x0138, 0x78ac, 0xc085, - 0x78ae, 0x2001, 0x4005, 0x0804, 0x13a5, 0x7b7e, 0x7a7a, 0x7e86, + 0x13b5, 0x8001, 0x7872, 0xa084, 0xfc00, 0x0138, 0x78ac, 0xc085, + 0x78ae, 0x2001, 0x4005, 0x0804, 0x13b5, 0x7b7e, 0x7a7a, 0x7e86, 0x7d82, 0x7c76, 0xa48c, 0xff00, 0x0170, 0x8407, 0x8004, 0x8004, 0x810c, 0x810c, 0x810f, 0xa118, 0xa291, 0x0000, 0xa6b1, 0x0000, 0xa581, 0x0000, 0x0050, 0x8407, 0x8004, 0x8004, 0xa318, 0xa291, 0x0000, 0xa6b1, 0x0000, 0xa581, 0x0000, 0x731a, 0x721e, 0x7622, 0x7026, 0xa605, 0x0118, 0x7a10, 0xc2c5, 0x7a12, 0x78ac, 0xa084, - 0xfffc, 0x78ae, 0x0018, 0x78ac, 0xc085, 0x78ae, 0x0804, 0x13a3, + 0xfffc, 0x78ae, 0x0018, 0x78ac, 0xc085, 0x78ae, 0x0804, 0x13b3, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0018, 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d4, 0x70c6, 0x72ca, 0x73ce, 0x74d6, - 0xa005, 0x0500, 0xa40a, 0x0110, 0x1a04, 0x13a5, 0x8001, 0x7892, + 0xa005, 0x0500, 0xa40a, 0x0110, 0x1a04, 0x13b5, 0x8001, 0x7892, 0xa084, 0xfc00, 0x0138, 0x78ac, 0xc0c5, 0x78ae, 0x2001, 0x4005, - 0x0804, 0x13a5, 0x7a9a, 0x7b9e, 0x7da2, 0x7ea6, 0x2600, 0xa505, + 0x0804, 0x13b5, 0x7a9a, 0x7b9e, 0x7da2, 0x7ea6, 0x2600, 0xa505, 0x0118, 0x7a10, 0xc2c5, 0x7a12, 0x7c96, 0x78ac, 0xa084, 0xfcff, - 0x78ae, 0x0018, 0x78ac, 0xc0c5, 0x78ae, 0x0804, 0x13a3, 0x2009, + 0x78ae, 0x0018, 0x78ac, 0xc0c5, 0x78ae, 0x0804, 0x13b3, 0x2009, 0x0000, 0x786c, 0xa065, 0x0118, 0x8108, 0x6000, 0x0cd8, 0x7ac4, - 0x0804, 0x13a1, 0x2009, 0x4348, 0x210c, 0x2001, 0x01ff, 0x2004, - 0xd0fc, 0x1904, 0x13a2, 0x2011, 0x4388, 0x2214, 0x0804, 0x13a1, - 0x2009, 0x4349, 0x210c, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, - 0x13a2, 0x2011, 0x4389, 0x2214, 0x0804, 0x13a1, 0x2061, 0x4340, + 0x0804, 0x13b1, 0x2009, 0x4548, 0x210c, 0x2001, 0x01ff, 0x2004, + 0xd0fc, 0x1904, 0x13b2, 0x2011, 0x4588, 0x2214, 0x0804, 0x13b1, + 0x2009, 0x4549, 0x210c, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, + 0x13b2, 0x2011, 0x4589, 0x2214, 0x0804, 0x13b1, 0x2061, 0x4540, 0x6128, 0x622c, 0x8214, 0x8214, 0x8214, 0x2001, 0x01ff, 0x2004, - 0xd0fc, 0x1148, 0x2061, 0x4380, 0x6328, 0x73da, 0x632c, 0x831c, - 0x831c, 0x831c, 0x73de, 0x0804, 0x13a1, 0x2009, 0x434c, 0x210c, - 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13a2, 0x2011, 0x438c, - 0x2214, 0x0804, 0x13a1, 0x7918, 0x0804, 0x13a2, 0x2009, 0x434d, - 0x210c, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13a2, 0x2011, - 0x438d, 0x2214, 0x0804, 0x13a1, 0x2009, 0x434e, 0x210c, 0x2001, - 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13a2, 0x2011, 0x438e, 0x2214, - 0x0804, 0x13a1, 0x7920, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, - 0x13a2, 0x7a24, 0x0804, 0x13a1, 0x2011, 0x4840, 0x71c4, 0xd1fc, - 0x1110, 0x2011, 0x47c0, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, - 0x8003, 0xa268, 0x6a00, 0x6b08, 0x6c1c, 0x74da, 0x0804, 0x13a0, - 0x77c4, 0x080c, 0x1b1d, 0x2091, 0x8000, 0x6b1c, 0x6a14, 0x2091, - 0x8001, 0x2708, 0x0804, 0x13a0, 0x2061, 0x4340, 0x6118, 0x2001, - 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13a2, 0x2061, 0x4380, 0x6218, - 0x0804, 0x13a1, 0x77c4, 0x080c, 0x1b1d, 0x2091, 0x8000, 0x6908, - 0x6a18, 0x6b10, 0x77da, 0x2091, 0x8001, 0x0804, 0x13a0, 0x71c4, - 0x2110, 0xa294, 0x000f, 0xa282, 0x0010, 0x1a04, 0x139c, 0x080c, - 0x230e, 0xa384, 0x4000, 0x0110, 0xa295, 0x0020, 0x0804, 0x13a0, - 0x71c4, 0x2100, 0xc0bc, 0xa082, 0x0010, 0x1a04, 0x139c, 0xd1bc, - 0x1120, 0x2011, 0x4348, 0x2204, 0x0020, 0x2011, 0x4388, 0x2204, - 0xc0bd, 0x0006, 0x2100, 0xc0bc, 0x2012, 0x080c, 0x22b4, 0x001e, - 0x0804, 0x13a2, 0x71c4, 0x2021, 0x4349, 0x2404, 0x70c6, 0x2019, - 0x0000, 0x0030, 0x71c8, 0x2021, 0x4389, 0x2404, 0x70ca, 0xc3fd, - 0x2011, 0x15fe, 0x20a9, 0x0008, 0x2204, 0xa106, 0x0138, 0x8210, - 0x1f04, 0x15e4, 0x71c4, 0x72c8, 0x0804, 0x139b, 0xa292, 0x15fe, - 0x0026, 0x2122, 0x001e, 0x080c, 0x22c6, 0x2001, 0x01ff, 0x2004, - 0xd0fc, 0x1110, 0xd3fc, 0x09f0, 0x0804, 0x13a3, 0x03e8, 0x00fa, - 0x01f4, 0x02ee, 0x0064, 0x0019, 0x0032, 0x004b, 0x2061, 0x4340, + 0xd0fc, 0x1148, 0x2061, 0x4580, 0x6328, 0x73da, 0x632c, 0x831c, + 0x831c, 0x831c, 0x73de, 0x0804, 0x13b1, 0x2009, 0x454c, 0x210c, + 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b2, 0x2011, 0x458c, + 0x2214, 0x0804, 0x13b1, 0x7918, 0x0804, 0x13b2, 0x2009, 0x0202, + 0x210c, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b2, 0x2011, + 0x0102, 0x2214, 0x0804, 0x13b1, 0x2009, 0x454d, 0x210c, 0x2001, + 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b2, 0x2011, 0x458d, 0x2214, + 0x0804, 0x13b1, 0x7920, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, + 0x13b2, 0x7a24, 0x0804, 0x13b1, 0x2011, 0x4a40, 0x71c4, 0xd1fc, + 0x1110, 0x2011, 0x49c0, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, + 0x8003, 0xa268, 0x6a00, 0x6b08, 0x6c1c, 0x74da, 0x0804, 0x13b0, + 0x77c4, 0x080c, 0x1b5f, 0x2091, 0x8000, 0x6b1c, 0x6a14, 0x2091, + 0x8001, 0x2708, 0x0804, 0x13b0, 0x2061, 0x4540, 0x6118, 0x2001, + 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b2, 0x2061, 0x4580, 0x6218, + 0x0804, 0x13b1, 0x77c4, 0x080c, 0x1b5f, 0x2091, 0x8000, 0x6908, + 0x6a18, 0x6b10, 0x77da, 0x2091, 0x8001, 0x0804, 0x13b0, 0x71c4, + 0x2110, 0xa294, 0x000f, 0xa282, 0x0010, 0x1a04, 0x13ac, 0x080c, + 0x2373, 0xa384, 0x4000, 0x0110, 0xa295, 0x0020, 0x0804, 0x13b0, + 0x71c4, 0x2100, 0xc0bc, 0xa082, 0x0010, 0x1a04, 0x13ac, 0xd1bc, + 0x1120, 0x2011, 0x4548, 0x2204, 0x0020, 0x2011, 0x4588, 0x2204, + 0xc0bd, 0x0006, 0x2100, 0xc0bc, 0x2012, 0x080c, 0x2319, 0x001e, + 0x0804, 0x13b2, 0x71c4, 0x2021, 0x4549, 0x2404, 0x70c6, 0x2019, + 0x0000, 0x0030, 0x71c8, 0x2021, 0x4589, 0x2404, 0x70ca, 0xc3fd, + 0x2011, 0x160e, 0x20a9, 0x0008, 0x2204, 0xa106, 0x0138, 0x8210, + 0x1f04, 0x15f4, 0x71c4, 0x72c8, 0x0804, 0x13ab, 0xa292, 0x160e, + 0x0026, 0x2122, 0x001e, 0x080c, 0x232b, 0x2001, 0x01ff, 0x2004, + 0xd0fc, 0x1110, 0xd3fc, 0x09f0, 0x0804, 0x13b3, 0x03e8, 0x00fa, + 0x01f4, 0x02ee, 0x0064, 0x0019, 0x0032, 0x004b, 0x2061, 0x4540, 0x6128, 0x622c, 0x8214, 0x8214, 0x8214, 0x70c4, 0x602a, 0x70c8, 0x8003, 0x8003, 0x8003, 0x602e, 0x2001, 0x01ff, 0x2004, 0xd0fc, - 0x11a0, 0x0026, 0x0016, 0x2061, 0x4380, 0x6128, 0x622c, 0x8214, + 0x11a0, 0x0026, 0x0016, 0x2061, 0x4580, 0x6128, 0x622c, 0x8214, 0x8214, 0x8214, 0x70d8, 0x602a, 0x70dc, 0x8003, 0x8003, 0x8003, - 0x602e, 0x71da, 0x72de, 0x001e, 0x002e, 0x0804, 0x13a1, 0x2061, - 0x4340, 0x6130, 0x70c4, 0x6032, 0x2001, 0x01ff, 0x2004, 0xd0fc, - 0x1904, 0x13a2, 0x2061, 0x4380, 0x6230, 0x70c8, 0x6032, 0x0804, - 0x13a1, 0x7918, 0x0804, 0x13a2, 0x71c4, 0xa184, 0xffcf, 0x0148, - 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x139c, 0x72c8, 0x0804, - 0x139b, 0x2011, 0x434d, 0x2204, 0x2112, 0x0006, 0x2019, 0x0000, - 0x080c, 0x2302, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x0118, 0x001e, - 0x0804, 0x13a2, 0x71c8, 0xa184, 0xffcf, 0x0128, 0x0006, 0x2110, - 0x71c4, 0x0804, 0x139b, 0x2011, 0x438d, 0x2204, 0x2112, 0x0006, - 0xc3fd, 0x080c, 0x2302, 0x002e, 0x001e, 0x0804, 0x13a1, 0x71c4, + 0x602e, 0x71da, 0x72de, 0x001e, 0x002e, 0x0804, 0x13b1, 0x2061, + 0x4540, 0x6130, 0x70c4, 0x6032, 0x2001, 0x01ff, 0x2004, 0xd0fc, + 0x1904, 0x13b2, 0x2061, 0x4580, 0x6230, 0x70c8, 0x6032, 0x0804, + 0x13b1, 0x7918, 0x0804, 0x13b2, 0x71c4, 0xa184, 0xf0cf, 0x0148, + 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13ac, 0x72c8, 0x0804, + 0x13ab, 0x0006, 0x2019, 0x0000, 0x080c, 0x2367, 0x2001, 0x01ff, + 0x2004, 0xd0fc, 0x0118, 0x001e, 0x0804, 0x13b2, 0x71c8, 0xa184, + 0xf0cf, 0x0128, 0x0006, 0x2110, 0x71c4, 0x0804, 0x13ab, 0x0006, + 0xc3fd, 0x080c, 0x2367, 0x002e, 0x001e, 0x0804, 0x13b1, 0x71c4, 0xa182, 0x0010, 0x0248, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, - 0x139c, 0x72c8, 0x0804, 0x139b, 0x2011, 0x434e, 0x2204, 0x0006, - 0x2112, 0x2019, 0x0000, 0x080c, 0x22ef, 0x2001, 0x01ff, 0x2004, - 0xd0fc, 0x0118, 0x001e, 0x0804, 0x13a2, 0x71c8, 0xa182, 0x0010, - 0x0228, 0x0006, 0x2110, 0x71c4, 0x0804, 0x139b, 0x2011, 0x438e, - 0x2204, 0x0006, 0x2112, 0xc3fd, 0x080c, 0x22ef, 0x002e, 0x001e, - 0x0804, 0x13a1, 0x71c4, 0x72c8, 0xa184, 0xfffd, 0x1904, 0x139b, - 0xa284, 0xfffd, 0x1904, 0x139b, 0x2100, 0x7920, 0x7822, 0x2200, - 0x7a24, 0x7826, 0x0804, 0x13a1, 0x2011, 0x4840, 0x71c4, 0xd1fc, - 0x1110, 0x2011, 0x47c0, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, - 0x8003, 0xa268, 0x72c8, 0x73cc, 0x74d8, 0x71c6, 0x6800, 0x70ca, - 0x73ce, 0x74da, 0x2091, 0x8000, 0x6a02, 0xd2ac, 0x1118, 0x2021, - 0x0000, 0x0078, 0xa484, 0x00ff, 0xa082, 0x0002, 0x16e8, 0x843f, - 0xa7bc, 0x00ff, 0x0130, 0xa786, 0x0002, 0x15b0, 0xa484, 0x00ff, - 0x0598, 0x2061, 0x0200, 0xd1fc, 0x0110, 0x2061, 0x0100, 0x2029, - 0x0009, 0x2031, 0x0062, 0x843f, 0xa7bc, 0x00ff, 0x0130, 0x8307, - 0xa084, 0x00ff, 0x1110, 0xa73d, 0x11f8, 0x2041, 0x001d, 0x8307, - 0xa084, 0x00ff, 0x0150, 0xa842, 0x02b8, 0xa3bc, 0x00ff, 0x2500, - 0xa702, 0x0290, 0x2600, 0xa702, 0x1278, 0x2039, 0x003a, 0x6804, - 0xa705, 0x6806, 0x6b0a, 0x6b0c, 0x73ce, 0x681c, 0x70da, 0x6c1e, - 0x2091, 0x8001, 0x0804, 0x13a3, 0x2091, 0x8001, 0x0804, 0x139d, - 0x77c4, 0x080c, 0x1b1d, 0x2091, 0x8000, 0x6a14, 0x6b1c, 0x2091, - 0x8001, 0x70c8, 0x6816, 0x70cc, 0x681e, 0x2708, 0x0804, 0x13a0, - 0x70c4, 0x2061, 0x4340, 0x6118, 0x601a, 0x2001, 0x01ff, 0x2004, - 0xd0fc, 0x1904, 0x13a2, 0x70c8, 0x2061, 0x4380, 0x6218, 0x601a, - 0x0804, 0x13a1, 0x71c4, 0x72c8, 0x73cc, 0xa182, 0x0010, 0x1a04, - 0x139c, 0x080c, 0x2332, 0xa384, 0x4000, 0x0110, 0xa295, 0x0020, - 0x0804, 0x13a0, 0x77c4, 0x080c, 0x1b1d, 0x2091, 0x8000, 0x6a08, - 0xc28d, 0x6a0a, 0x2091, 0x8001, 0x2708, 0x0804, 0x13a1, 0x77c4, - 0x080c, 0x1b1d, 0x2091, 0x8000, 0x6a08, 0xa294, 0xfff9, 0x6a0a, - 0x6804, 0xa005, 0x0110, 0x080c, 0x2233, 0x2091, 0x8001, 0x2708, - 0x0804, 0x13a1, 0x77c4, 0x080c, 0x1b1d, 0x2091, 0x8000, 0x6a08, - 0xc295, 0x6a0a, 0x6804, 0xa005, 0x0110, 0x080c, 0x2233, 0x2091, - 0x8001, 0x2708, 0x0804, 0x13a1, 0x77c4, 0x2041, 0x0001, 0x2049, - 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 0x080c, 0x1b35, 0x2091, - 0x8001, 0x2708, 0x6a08, 0x0804, 0x13a1, 0x77c4, 0xd7fc, 0x0128, - 0x080c, 0x1aa9, 0x0138, 0x0804, 0x13a5, 0x080c, 0x1a9b, 0x0110, - 0x0804, 0x13a5, 0x73c8, 0x72cc, 0x77c6, 0x73ca, 0x72ce, 0x080c, - 0x1bad, 0x11e8, 0x6818, 0xa005, 0x01a0, 0x2708, 0x0076, 0x080c, - 0x2351, 0x007e, 0x1170, 0x2001, 0x0015, 0xd7fc, 0x1118, 0x2061, - 0x4340, 0x0018, 0xc0fd, 0x2061, 0x4380, 0x782a, 0x2091, 0x8001, - 0x0005, 0x2091, 0x8001, 0x2001, 0x4005, 0x0804, 0x13a5, 0x2091, - 0x8001, 0x0804, 0x13a3, 0x77c4, 0xd7fc, 0x0128, 0x080c, 0x1aa9, - 0x0138, 0x0804, 0x13a5, 0x080c, 0x1a9b, 0x0110, 0x0804, 0x13a5, - 0x77c6, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, - 0x8000, 0x080c, 0x1b35, 0x2009, 0x0016, 0xd7fc, 0x1118, 0x2061, - 0x4340, 0x0018, 0x2061, 0x4380, 0xc1fd, 0x6067, 0x0003, 0x607f, - 0x0000, 0x6776, 0x6083, 0x000f, 0x792a, 0x080c, 0x2233, 0x2091, - 0x8001, 0x0005, 0x77c8, 0x77ca, 0x77c4, 0x77c6, 0xd7fc, 0x0128, - 0x080c, 0x1aa9, 0x0138, 0x0804, 0x13a5, 0x080c, 0x1a9b, 0x0110, - 0x0804, 0x13a5, 0xa7bc, 0xff00, 0x2091, 0x8000, 0x2009, 0x0017, - 0xd7fc, 0x1118, 0x2061, 0x4340, 0x0018, 0x2061, 0x4380, 0xc1fd, - 0x607f, 0x0000, 0x6067, 0x0002, 0x6776, 0x6083, 0x000f, 0x792a, - 0x080c, 0x2233, 0x2091, 0x8001, 0x2041, 0x0021, 0x2049, 0x0005, - 0x2051, 0x0010, 0x2091, 0x8000, 0x70c8, 0xa005, 0x0118, 0x60d4, - 0xc0fd, 0x60d6, 0x080c, 0x1b35, 0x70c8, 0x6836, 0x8738, 0xa784, - 0x001f, 0x1dc0, 0x2091, 0x8001, 0x0005, 0x72c8, 0xd284, 0x0128, - 0x080c, 0x1aa9, 0x0138, 0x0804, 0x13a5, 0x080c, 0x1a9b, 0x0110, - 0x0804, 0x13a5, 0x72c8, 0x72ca, 0x78ac, 0xa084, 0x0003, 0x1508, - 0x2039, 0x0000, 0xd284, 0x0108, 0xc7fd, 0x2041, 0x0021, 0x2049, - 0x0004, 0x2051, 0x0008, 0x080c, 0x1b1d, 0x2091, 0x8000, 0x6808, - 0xc0d4, 0xa80d, 0x690a, 0x2091, 0x8001, 0x8738, 0xa784, 0x001f, - 0x1d90, 0xa7bc, 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, - 0x1d50, 0x2091, 0x8000, 0x72c8, 0x2069, 0x0100, 0xd284, 0x1110, - 0x2069, 0x0200, 0x6808, 0xa084, 0xfffd, 0x680a, 0x6830, 0xd0b4, - 0x01b0, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848, 0xd094, 0x0110, - 0x1f04, 0x1885, 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xd084, - 0x0110, 0x1f04, 0x188e, 0x20a9, 0x00fa, 0x1f04, 0x1895, 0x2079, - 0x4300, 0x2009, 0x0018, 0x72c8, 0xd284, 0x1118, 0x2061, 0x4340, - 0x0018, 0x2061, 0x4380, 0xc1fd, 0x792a, 0x6067, 0x0001, 0x6083, - 0x000f, 0x60a7, 0x0000, 0x60a8, 0x60b2, 0x60b6, 0x60d4, 0xd0b4, - 0x0160, 0xc0b4, 0x60d6, 0x00c6, 0x60b8, 0xa065, 0x6008, 0xc0d4, - 0x600a, 0x6018, 0x8001, 0x601a, 0x00ce, 0x60d4, 0xa084, 0x7eff, - 0x60d6, 0x78ac, 0xc08d, 0x78ae, 0x681b, 0x0054, 0x2091, 0x8001, - 0x0005, 0xd7fc, 0x1118, 0x2069, 0x4340, 0x0010, 0x2069, 0x4380, - 0x71c4, 0x71c6, 0x6916, 0x81ff, 0x1110, 0x68a7, 0x0001, 0x78ac, - 0xc08c, 0x78ae, 0xd084, 0x1110, 0x080c, 0x1c00, 0x0005, 0x75d8, - 0x74dc, 0x75da, 0x74de, 0x0018, 0x2029, 0x0000, 0x2520, 0x71c4, - 0x73c8, 0x72cc, 0x71c6, 0x73ca, 0x72ce, 0x2079, 0x4300, 0x7dde, - 0x7cda, 0x7bd6, 0x7ad2, 0x080c, 0x1afa, 0x0904, 0x19d7, 0x20a9, - 0x0005, 0x20a1, 0x4314, 0x2091, 0x8000, 0x41a1, 0x2091, 0x8001, - 0x2009, 0x0040, 0x080c, 0x1cbf, 0x0120, 0x080c, 0x1b02, 0x0804, - 0x19d7, 0x6004, 0xa08c, 0x00ff, 0xa18e, 0x0009, 0x1120, 0x0006, - 0x080c, 0x1fe3, 0x000e, 0xa084, 0xff00, 0x8007, 0x8009, 0x0904, - 0x1981, 0x00c6, 0x2c68, 0x080c, 0x1afa, 0x05a8, 0x2c00, 0x689e, - 0x8109, 0x1dc0, 0x609f, 0x0000, 0x00ce, 0x00c6, 0x7ddc, 0x7cd8, - 0x7bd4, 0x7ad0, 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000, - 0xa5a9, 0x0000, 0x7dde, 0x7cda, 0x7bd6, 0x7ad2, 0x2c68, 0x689c, - 0xa065, 0x0904, 0x1980, 0x2009, 0x0040, 0x080c, 0x1cbf, 0x1550, - 0x6004, 0xa084, 0x00ff, 0xa086, 0x0002, 0x1168, 0x6004, 0xa084, - 0x00ff, 0xa086, 0x000a, 0x1120, 0x0016, 0x080c, 0x1fe0, 0x001e, - 0x2d00, 0x6002, 0x0898, 0x00ce, 0x00c6, 0x609c, 0x080c, 0x1b76, - 0x00ce, 0x609f, 0x0000, 0x080c, 0x19db, 0x2009, 0x0018, 0x6008, - 0xc0cd, 0x600a, 0x6004, 0x6086, 0x080c, 0x1ab7, 0x080c, 0x1b02, - 0x0804, 0x19d7, 0x00ce, 0x00c6, 0x609c, 0x080c, 0x1b76, 0x00ce, - 0x609f, 0x0000, 0x080c, 0x19db, 0x2009, 0x0018, 0x6087, 0x0103, - 0x601b, 0x0003, 0x080c, 0x1ab7, 0x080c, 0x1b02, 0x0804, 0x19d7, - 0x00ce, 0x6114, 0xd1fc, 0x0120, 0x080c, 0x1aa9, 0x01b8, 0x0018, - 0x080c, 0x1a9b, 0x0198, 0x2029, 0x0000, 0x2520, 0x2009, 0x0018, - 0x73c8, 0x72cc, 0x6087, 0x0103, 0x601b, 0x0021, 0x080c, 0x1ab7, - 0x080c, 0x1b02, 0x2001, 0x4007, 0x0804, 0x13a5, 0x74c4, 0x73c8, - 0x72cc, 0x6014, 0x2091, 0x8000, 0x00e6, 0x2009, 0x0012, 0xd0fc, - 0x1118, 0x2071, 0x4340, 0x0018, 0x2071, 0x4380, 0xc1fd, 0x792a, - 0x7067, 0x0005, 0x71d4, 0xa18c, 0xfe7f, 0x71d6, 0x736a, 0x726e, - 0x7472, 0x7076, 0x707b, 0x0000, 0x2c00, 0x707e, 0xa02e, 0x2530, - 0x611c, 0xa184, 0x0060, 0x0110, 0x080c, 0x3de5, 0x00ee, 0x6596, + 0x13ac, 0x72c8, 0x0804, 0x13ab, 0x2011, 0x454d, 0x2204, 0x0006, + 0x8104, 0x1208, 0x8108, 0x2112, 0x2019, 0x0000, 0x080c, 0x2354, + 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x0118, 0x001e, 0x0804, 0x13b2, + 0x71c8, 0xa182, 0x0010, 0x0228, 0x0006, 0x2110, 0x71c4, 0x0804, + 0x13ab, 0x2011, 0x458d, 0x2204, 0x0006, 0x8104, 0x1208, 0x8108, + 0x2112, 0xc3fd, 0x080c, 0x2354, 0x002e, 0x001e, 0x0804, 0x13b1, + 0x71c4, 0x72c8, 0xa184, 0xfffd, 0x1904, 0x13ab, 0xa284, 0xfffd, + 0x1904, 0x13ab, 0x2100, 0x7920, 0x7822, 0x2200, 0x7a24, 0x7826, + 0x0804, 0x13b1, 0x2011, 0x4a40, 0x71c4, 0xd1fc, 0x1110, 0x2011, + 0x49c0, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa268, + 0x72c8, 0x73cc, 0x74d8, 0x71c6, 0x6800, 0x70ca, 0x73ce, 0x74da, + 0x2091, 0x8000, 0x6a02, 0xd2ac, 0x1118, 0x2021, 0x0000, 0x0090, + 0xa484, 0x00ff, 0xa082, 0x0002, 0x1a04, 0x173b, 0x843f, 0xa7bc, + 0x00ff, 0x0140, 0xa786, 0x0002, 0x1904, 0x173b, 0xa484, 0x00ff, + 0x0904, 0x173b, 0x2061, 0x0200, 0xd1fc, 0x0110, 0x2061, 0x0100, + 0x2029, 0x0009, 0x2031, 0x0062, 0x843f, 0xa7bc, 0x00ff, 0x0130, + 0x8307, 0xa084, 0x00ff, 0x1110, 0xa73d, 0x1138, 0x2041, 0x001d, + 0xa384, 0x00ff, 0xa082, 0x001a, 0x0210, 0xa4a4, 0x00ff, 0x8307, + 0xa084, 0x00ff, 0x0188, 0xa842, 0x02f0, 0xa086, 0x0010, 0x1120, + 0xa39c, 0x00ff, 0xa39d, 0x0f00, 0xa3bc, 0x00ff, 0x2500, 0xa702, + 0x0290, 0x2600, 0xa702, 0x1278, 0x2039, 0x003a, 0x6804, 0xa705, + 0x6806, 0x6b0a, 0x6b0c, 0x73ce, 0x681c, 0x70da, 0x6c1e, 0x2091, + 0x8001, 0x0804, 0x13b3, 0x2091, 0x8001, 0x0804, 0x13ad, 0x77c4, + 0x080c, 0x1b5f, 0x2091, 0x8000, 0x6a14, 0x6b1c, 0x2091, 0x8001, + 0x70c8, 0x6816, 0x70cc, 0x681e, 0x2708, 0x0804, 0x13b0, 0x70c4, + 0x2061, 0x4540, 0x6118, 0x601a, 0x2001, 0x01ff, 0x2004, 0xd0fc, + 0x1904, 0x13b2, 0x70c8, 0x2061, 0x4580, 0x6218, 0x601a, 0x0804, + 0x13b1, 0x71c4, 0x72c8, 0x73cc, 0xa182, 0x0010, 0x1a04, 0x13ac, + 0x080c, 0x2397, 0xa384, 0x4000, 0x0110, 0xa295, 0x0020, 0x0804, + 0x13b0, 0x77c4, 0x080c, 0x1b5f, 0x2091, 0x8000, 0x6a08, 0xc28d, + 0x6a0a, 0x2091, 0x8001, 0x2708, 0x0804, 0x13b1, 0x77c4, 0x080c, + 0x1b5f, 0x2091, 0x8000, 0x6a08, 0xa294, 0xfff9, 0x6a0a, 0x6804, + 0xa005, 0x0110, 0x080c, 0x2296, 0x2091, 0x8001, 0x2708, 0x0804, + 0x13b1, 0x77c4, 0x080c, 0x1b5f, 0x2091, 0x8000, 0x6a08, 0xc295, + 0x6a0a, 0x6804, 0xa005, 0x0110, 0x080c, 0x2296, 0x2091, 0x8001, + 0x2708, 0x0804, 0x13b1, 0x77c4, 0x2041, 0x0001, 0x2049, 0x0005, + 0x2051, 0x0020, 0x2091, 0x8000, 0x080c, 0x1b77, 0x2091, 0x8001, + 0x2708, 0x6a08, 0x0804, 0x13b1, 0x77c4, 0xd7fc, 0x0128, 0x080c, + 0x1aeb, 0x0138, 0x0804, 0x13b5, 0x080c, 0x1add, 0x0110, 0x0804, + 0x13b5, 0x73c8, 0x72cc, 0x77c6, 0x73ca, 0x72ce, 0x080c, 0x1bef, + 0x11e8, 0x6818, 0xa005, 0x01a0, 0x2708, 0x0076, 0x080c, 0x23b6, + 0x007e, 0x1170, 0x2001, 0x0015, 0xd7fc, 0x1118, 0x2061, 0x4540, + 0x0018, 0xc0fd, 0x2061, 0x4580, 0x782a, 0x2091, 0x8001, 0x0005, + 0x2091, 0x8001, 0x2001, 0x4005, 0x0804, 0x13b5, 0x2091, 0x8001, + 0x0804, 0x13b3, 0x77c4, 0xd7fc, 0x0128, 0x080c, 0x1aeb, 0x0138, + 0x0804, 0x13b5, 0x080c, 0x1add, 0x0110, 0x0804, 0x13b5, 0x77c6, + 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, + 0x080c, 0x1b77, 0x2009, 0x0016, 0xd7fc, 0x1118, 0x2061, 0x4540, + 0x0018, 0x2061, 0x4580, 0xc1fd, 0x6063, 0x0003, 0x607b, 0x0000, + 0x6772, 0x607f, 0x000f, 0x792a, 0x080c, 0x2296, 0x2091, 0x8001, + 0x0005, 0x77c8, 0x77ca, 0x77c4, 0x77c6, 0xd7fc, 0x0128, 0x080c, + 0x1aeb, 0x0138, 0x0804, 0x13b5, 0x080c, 0x1add, 0x0110, 0x0804, + 0x13b5, 0xa7bc, 0xff00, 0x2091, 0x8000, 0x2009, 0x0017, 0xd7fc, + 0x1118, 0x2061, 0x4540, 0x0018, 0x2061, 0x4580, 0xc1fd, 0x607b, + 0x0000, 0x6063, 0x0002, 0x6772, 0x607f, 0x000f, 0x792a, 0x080c, + 0x2296, 0x2091, 0x8001, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, + 0x0010, 0x2091, 0x8000, 0x70c8, 0xa005, 0x0118, 0x60d0, 0xc0fd, + 0x60d2, 0x080c, 0x1b77, 0x70c8, 0x6836, 0x8738, 0xa784, 0x001f, + 0x1dc0, 0x2091, 0x8001, 0x0005, 0x2019, 0x0000, 0x72c8, 0xd284, + 0x0128, 0x080c, 0x1aeb, 0x0138, 0x0804, 0x13b5, 0x080c, 0x1add, + 0x0110, 0x0804, 0x13b5, 0x72c8, 0x72ca, 0x78ac, 0xa084, 0x0003, + 0x1508, 0x2039, 0x0000, 0xd284, 0x0108, 0xc7fd, 0x2041, 0x0021, + 0x2049, 0x0004, 0x2051, 0x0008, 0x080c, 0x1b5f, 0x2091, 0x8000, + 0x6808, 0xc0d4, 0xa80d, 0x690a, 0x2091, 0x8001, 0x8738, 0xa784, + 0x001f, 0x1d90, 0xa7bc, 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, + 0x0f00, 0x1d50, 0x2091, 0x8000, 0x72c8, 0x2069, 0x0100, 0xd284, + 0x1110, 0x2069, 0x0200, 0x6808, 0xa084, 0xfffd, 0x680a, 0x6830, + 0xd0b4, 0x01b0, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848, 0xd094, + 0x0110, 0x1f04, 0x18a6, 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, + 0xd084, 0x0110, 0x1f04, 0x18af, 0x20a9, 0x00fa, 0x1f04, 0x18b6, + 0x2079, 0x4500, 0x2009, 0x0018, 0x72c8, 0xd284, 0x1118, 0x2061, + 0x4540, 0x0018, 0x2061, 0x4580, 0xc1fd, 0x607b, 0x0000, 0x792a, + 0x6063, 0x0001, 0x607f, 0x000f, 0x60a3, 0x0000, 0x60a4, 0x60ae, + 0x60b2, 0x60d0, 0xd0b4, 0x0160, 0xc0b4, 0x60d2, 0x00c6, 0x60b4, + 0xa065, 0x6008, 0xc0d4, 0x600a, 0x6018, 0x8001, 0x601a, 0x00ce, + 0x60d0, 0xa084, 0x7eff, 0x60d2, 0x78ac, 0xc08d, 0x78ae, 0x83ff, + 0x0108, 0x0005, 0x681b, 0x0054, 0x2091, 0x8001, 0x0005, 0x73cc, + 0x080c, 0x185e, 0x69ec, 0x6a48, 0xa185, 0x1800, 0x684a, 0xa185, + 0x0040, 0x68ee, 0x73cc, 0x2021, 0x0004, 0x20a9, 0x09ff, 0x1f04, + 0x18ff, 0x8421, 0x1dd0, 0x8319, 0x1db0, 0x69ee, 0x6a4a, 0x2091, + 0x8001, 0x0005, 0xd7fc, 0x1118, 0x2069, 0x4540, 0x0010, 0x2069, + 0x4580, 0x71c4, 0x71c6, 0x6916, 0x81ff, 0x1110, 0x68a3, 0x0001, + 0x78ac, 0xc08c, 0x78ae, 0xd084, 0x1110, 0x080c, 0x1c42, 0x0005, + 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0018, 0x2029, 0x0000, 0x2520, + 0x71c4, 0x73c8, 0x72cc, 0x71c6, 0x73ca, 0x72ce, 0x2079, 0x4500, + 0x7dde, 0x7cda, 0x7bd6, 0x7ad2, 0x080c, 0x1b3c, 0x0904, 0x1a17, + 0x20a9, 0x0005, 0x20a1, 0x4514, 0x2091, 0x8000, 0x41a1, 0x2091, + 0x8001, 0x2009, 0x0040, 0x080c, 0x1d0b, 0x0120, 0x080c, 0x1b44, + 0x0804, 0x1a17, 0x6004, 0xa08c, 0x00ff, 0xa18e, 0x0009, 0x1120, + 0x0006, 0x080c, 0x2046, 0x000e, 0xa084, 0xff00, 0x8007, 0x8009, + 0x0904, 0x19c2, 0x00c6, 0x2c68, 0x080c, 0x1b3c, 0x05a8, 0x2c00, + 0x689e, 0x8109, 0x1dc0, 0x609f, 0x0000, 0x00ce, 0x00c6, 0x7ddc, + 0x7cd8, 0x7bd4, 0x7ad0, 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, + 0x0000, 0xa5a9, 0x0000, 0x7dde, 0x7cda, 0x7bd6, 0x7ad2, 0x2c68, + 0x689c, 0xa065, 0x0904, 0x19c1, 0x2009, 0x0040, 0x080c, 0x1d0b, + 0x1550, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0002, 0x1168, 0x6004, + 0xa084, 0x00ff, 0xa086, 0x000a, 0x1120, 0x0016, 0x080c, 0x2043, + 0x001e, 0x2d00, 0x6002, 0x0898, 0x00ce, 0x00c6, 0x609c, 0x080c, + 0x1bb8, 0x00ce, 0x609f, 0x0000, 0x080c, 0x1a1b, 0x2009, 0x0018, + 0x6008, 0xc0cd, 0x600a, 0x6004, 0x6086, 0x080c, 0x1af9, 0x080c, + 0x1b44, 0x0804, 0x1a17, 0x00ce, 0x00c6, 0x609c, 0x080c, 0x1bb8, + 0x00ce, 0x609f, 0x0000, 0x080c, 0x1a1b, 0x2009, 0x0018, 0x6087, + 0x0103, 0x601b, 0x0003, 0x080c, 0x1af9, 0x080c, 0x1b44, 0x0804, + 0x1a17, 0x00ce, 0x6114, 0xd1fc, 0x0120, 0x080c, 0x1aeb, 0x01b8, + 0x0018, 0x080c, 0x1add, 0x0198, 0x2029, 0x0000, 0x2520, 0x2009, + 0x0018, 0x73c8, 0x72cc, 0x6087, 0x0103, 0x601b, 0x0021, 0x080c, + 0x1af9, 0x080c, 0x1b44, 0x2001, 0x4007, 0x0804, 0x13b5, 0x74c4, + 0x73c8, 0x72cc, 0x6014, 0x2091, 0x8000, 0x00e6, 0x2009, 0x0012, + 0xd0fc, 0x1118, 0x2071, 0x4540, 0x0018, 0x2071, 0x4580, 0xc1fd, + 0x792a, 0x7063, 0x0005, 0x71d0, 0xc1c4, 0x71d2, 0x7366, 0x726a, + 0x746e, 0x7072, 0x7077, 0x0000, 0x2c00, 0x707a, 0xa02e, 0x2530, + 0x611c, 0xa184, 0x0060, 0x0110, 0x080c, 0x3f66, 0x00ee, 0x6596, 0x65a6, 0x669a, 0x66aa, 0x60af, 0x0000, 0x60b3, 0x0000, 0x6714, - 0x6023, 0x0000, 0x080c, 0x2233, 0x2091, 0x8001, 0x0005, 0x70c3, - 0x4005, 0x0804, 0x13a6, 0x20a9, 0x0005, 0x2099, 0x4314, 0x2091, + 0x6023, 0x0000, 0x080c, 0x2296, 0x2091, 0x8001, 0x0005, 0x70c3, + 0x4005, 0x0804, 0x13b6, 0x20a9, 0x0005, 0x2099, 0x4514, 0x2091, 0x8000, 0x530a, 0x2091, 0x8001, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x0005, 0x71c4, 0x70c7, 0x0000, - 0x791e, 0x0804, 0x13a3, 0x71c4, 0x71c6, 0x2168, 0x0010, 0x2069, + 0x791e, 0x0804, 0x13b3, 0x71c4, 0x71c6, 0x2168, 0x0010, 0x2069, 0x1000, 0x690c, 0xa016, 0x2d04, 0xa210, 0x8d68, 0x8109, 0x1dd8, 0xa285, 0x0000, 0x1118, 0x70c3, 0x4000, 0x0010, 0x70c3, 0x4003, - 0x70ca, 0x0804, 0x13a6, 0x7964, 0x71c6, 0x71c4, 0xa182, 0x0003, - 0x1a04, 0x139c, 0x7966, 0x0804, 0x13a3, 0x7964, 0x71c6, 0x0804, - 0x13a3, 0x7900, 0x71c6, 0x71c4, 0x7902, 0x0804, 0x13a3, 0x7900, - 0x71c6, 0x0804, 0x13a3, 0x70c4, 0x2011, 0x0000, 0xa08c, 0x000d, + 0x70ca, 0x0804, 0x13b6, 0x7964, 0x71c6, 0x71c4, 0xa182, 0x0003, + 0x1a04, 0x13ac, 0x7966, 0x0804, 0x13b3, 0x7964, 0x71c6, 0x0804, + 0x13b3, 0x7900, 0x71c6, 0x71c4, 0x7902, 0x0804, 0x13b3, 0x7900, + 0x71c6, 0x0804, 0x13b3, 0x70c4, 0x2011, 0x0000, 0xa08c, 0x000d, 0x0160, 0x810c, 0x0230, 0x8210, 0x810c, 0x810c, 0x0210, 0x8210, - 0x810c, 0x81ff, 0x1904, 0x139d, 0x8210, 0x7a0e, 0xd28c, 0x0538, + 0x810c, 0x81ff, 0x1904, 0x13ad, 0x8210, 0x7a0e, 0xd28c, 0x0538, 0x7910, 0xc1cd, 0x7912, 0x2009, 0x0021, 0x2019, 0x0003, 0xd284, - 0x01c0, 0x8108, 0x2019, 0x0041, 0x2011, 0x8b4e, 0x2312, 0x2019, + 0x01c0, 0x8108, 0x2019, 0x0041, 0x2011, 0x8d4e, 0x2312, 0x2019, 0x0042, 0x8210, 0x2312, 0x2019, 0x0043, 0x8210, 0x2312, 0x2019, 0x0046, 0x8210, 0x2312, 0x2019, 0x0047, 0x8210, 0x2312, 0x2019, - 0x0006, 0x2011, 0x8b53, 0x2112, 0x2011, 0x8b73, 0x2312, 0x7904, - 0x7806, 0x0804, 0x13a2, 0x7804, 0x70c6, 0x0804, 0x13a3, 0x71c4, - 0xd1fc, 0x1118, 0x2011, 0x47c0, 0x0010, 0x2011, 0x4840, 0x8107, + 0x0006, 0x2011, 0x8d53, 0x2112, 0x2011, 0x8d73, 0x2312, 0x7904, + 0x7806, 0x0804, 0x13b2, 0x7804, 0x70c6, 0x0804, 0x13b3, 0x71c4, + 0xd1fc, 0x1118, 0x2011, 0x49c0, 0x0010, 0x2011, 0x4a40, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa268, 0x2011, 0x0000, 0x6814, 0xd0fc, 0x0110, 0xa295, 0x0200, 0xd0b4, 0x0110, 0xa295, - 0x0001, 0x6b0c, 0x0804, 0x13a0, 0x0016, 0x7814, 0xd0f4, 0x0138, - 0x2001, 0x4007, 0x70db, 0x0000, 0xa18d, 0x0001, 0x0050, 0xd0fc, - 0x0138, 0x2001, 0x4007, 0x70db, 0x0001, 0xa18d, 0x0001, 0x0008, - 0xa006, 0x001e, 0x0005, 0x0016, 0x7814, 0xd0f4, 0x0138, 0x2001, - 0x4007, 0x70db, 0x0000, 0xa18d, 0x0001, 0x0008, 0xa006, 0x001e, - 0x0005, 0x0016, 0x7814, 0xd0fc, 0x0138, 0x2001, 0x4007, 0x70db, - 0x0001, 0xa18d, 0x0001, 0x0008, 0xa006, 0x001e, 0x0005, 0x7112, - 0x721a, 0x731e, 0x7810, 0xd0c4, 0x0110, 0x7422, 0x7526, 0xac80, - 0x0001, 0x8108, 0x810c, 0x81a9, 0x8098, 0x20a1, 0x0030, 0x7003, - 0x0000, 0x6084, 0x20a2, 0x53a6, 0x7007, 0x0001, 0x7974, 0xa184, - 0xff00, 0x0140, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, - 0xa100, 0x0018, 0x8107, 0x8004, 0x8004, 0x797c, 0xa108, 0x7a78, - 0xa006, 0xa211, 0x7d10, 0xd5c4, 0x0120, 0x7b84, 0xa319, 0x7c80, - 0xa421, 0x7008, 0xd0fc, 0x0de8, 0x7003, 0x0001, 0x7007, 0x0006, - 0x711a, 0x721e, 0x7d10, 0xd5c4, 0x0110, 0x7322, 0x7426, 0xa084, - 0x01e0, 0x0005, 0x7848, 0xa065, 0x0120, 0x2c04, 0x784a, 0x2063, - 0x0000, 0x0005, 0x00f6, 0x2079, 0x4300, 0x7848, 0x2062, 0x2c00, - 0xa005, 0x1110, 0x080c, 0x243b, 0x784a, 0x00fe, 0x0005, 0x2011, - 0x8d00, 0x7a4a, 0x7bc4, 0x8319, 0x0128, 0xa280, 0x0032, 0x2012, - 0x2010, 0x0cc8, 0x2013, 0x0000, 0x0005, 0x0016, 0x0026, 0xd7fc, - 0x1118, 0x2011, 0x48c0, 0x0010, 0x2011, 0x68c0, 0xa784, 0x0f00, - 0x800b, 0xa784, 0x001f, 0x0120, 0x8003, 0x8003, 0x8003, 0x8003, - 0xa105, 0xa268, 0x002e, 0x001e, 0x0005, 0x0c39, 0x2900, 0x682a, - 0x2a00, 0x682e, 0x6808, 0xa084, 0xf9ef, 0xa80d, 0x690a, 0x00e6, - 0xd7fc, 0x1128, 0x2009, 0x4353, 0x2071, 0x4340, 0x0020, 0x2009, - 0x4393, 0x2071, 0x4380, 0x210c, 0x6804, 0xa005, 0x0148, 0xa116, - 0x1138, 0x2060, 0x6000, 0x6806, 0x0016, 0x200b, 0x0000, 0x0018, - 0x2009, 0x0000, 0x0016, 0x6804, 0xa065, 0x0178, 0x6000, 0x6806, - 0x0421, 0x080c, 0x1d30, 0x6810, 0x7908, 0x8109, 0x790a, 0x8001, - 0x6812, 0x1d88, 0x7910, 0xc1a5, 0x7912, 0x001e, 0x6902, 0x6906, - 0x2d00, 0x2060, 0x080c, 0x2580, 0x00ee, 0x0005, 0xa065, 0x0160, - 0x2008, 0x609c, 0xa005, 0x0128, 0x2062, 0x609f, 0x0000, 0xa065, - 0x0cc0, 0x7848, 0x794a, 0x2062, 0x0005, 0x6007, 0x0103, 0x608f, - 0x0000, 0x20a9, 0x001c, 0xac80, 0x0005, 0x20a0, 0x2001, 0x0000, - 0x40a4, 0x6828, 0x601a, 0x682c, 0x6022, 0x0005, 0x00e6, 0xd7fc, - 0x1128, 0x2071, 0x4340, 0x2031, 0x43c0, 0x0020, 0x2071, 0x4380, - 0x2031, 0x45c0, 0x7050, 0xa08c, 0x0200, 0x1128, 0xa608, 0x2d0a, - 0x8000, 0x7052, 0xa006, 0x00ee, 0x0005, 0x00f6, 0xd7fc, 0x1118, - 0x2079, 0x4340, 0x0010, 0x2079, 0x4380, 0x080c, 0x1b1d, 0x2091, - 0x8000, 0x6804, 0x780a, 0xa065, 0x0904, 0x1bfe, 0x0030, 0x2c00, - 0x780a, 0x2060, 0x6000, 0xa065, 0x05c8, 0x6010, 0xa306, 0x1db8, - 0x600c, 0xa206, 0x1da0, 0x2c28, 0x784c, 0xac06, 0x1108, 0x0458, - 0x6804, 0xac06, 0x1140, 0x6000, 0x2060, 0x6806, 0xa005, 0x1118, - 0x6803, 0x0000, 0x0048, 0x6400, 0x7808, 0x2060, 0x6402, 0xa486, - 0x0000, 0x1110, 0x2c00, 0x6802, 0x2560, 0x00fe, 0x080c, 0x1b85, - 0x00f6, 0x601b, 0x0005, 0x6023, 0x0020, 0x00fe, 0x080c, 0x1d30, - 0x00f6, 0x7908, 0x8109, 0x790a, 0x6810, 0x8001, 0x6812, 0x1118, - 0x7810, 0xc0a5, 0x7812, 0x2001, 0xffff, 0xa005, 0x00fe, 0x0005, - 0x0076, 0x2700, 0x2039, 0x0000, 0xd0fc, 0x0108, 0xc7fd, 0x2041, - 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 0x2091, 0x8000, 0x080c, - 0x1b35, 0x8738, 0xa784, 0x001f, 0x1dd0, 0xa7bc, 0xff00, 0x873f, - 0x8738, 0x873f, 0xa784, 0x0f00, 0x1d90, 0x2091, 0x8001, 0x007e, - 0x0005, 0x786c, 0x2009, 0x8b74, 0x210c, 0xa10d, 0x0118, 0xa065, - 0x0804, 0x1ffe, 0x2061, 0x0000, 0x6018, 0xd084, 0x11b8, 0x7810, - 0xd08c, 0x0130, 0xc08c, 0x7812, 0xc7fc, 0x2069, 0x4340, 0x0028, - 0xc08d, 0x7812, 0x2069, 0x4380, 0xc7fd, 0x2091, 0x8000, 0x681c, - 0x681f, 0x0000, 0x2091, 0x8001, 0xa005, 0x1108, 0x0005, 0xa08c, - 0xfff0, 0x0110, 0x080c, 0x243b, 0x0002, 0x1c5d, 0x1c60, 0x1c66, - 0x1c6a, 0x1c5e, 0x1c6e, 0x1c5e, 0x1c5e, 0x1c5e, 0x1c73, 0x1c9f, - 0x1ca2, 0x1ca7, 0x1c5e, 0x1c5e, 0x1c5e, 0x0005, 0x080c, 0x243b, - 0x080c, 0x1c00, 0x2001, 0x8001, 0x0804, 0x1cb0, 0x2001, 0x8003, - 0x0804, 0x1cb0, 0x2001, 0x8004, 0x0804, 0x1cb0, 0x080c, 0x1c00, - 0x2001, 0x8006, 0x04e8, 0x2091, 0x8000, 0x0076, 0xd7fc, 0x1128, - 0x2069, 0x4340, 0x2039, 0x0009, 0x0020, 0x2069, 0x4380, 0x2039, - 0x0009, 0x6800, 0xa086, 0x0000, 0x0128, 0x000e, 0x6f1e, 0x2091, - 0x8001, 0x0005, 0x6874, 0x007e, 0xa0bc, 0xff00, 0x2041, 0x0021, - 0x2049, 0x0004, 0x2051, 0x0010, 0x080c, 0x1b35, 0x8738, 0xa784, - 0x001f, 0x1dd0, 0x2091, 0x8001, 0x2001, 0x800a, 0x0088, 0x2001, - 0x800c, 0x0070, 0x080c, 0x1c00, 0x2001, 0x800d, 0x0048, 0xd7fc, - 0x0110, 0x78ec, 0x0008, 0x78e4, 0x70c6, 0x2001, 0x800e, 0x0000, - 0x70c2, 0xd7fc, 0x1118, 0x70db, 0x0000, 0x0010, 0x70db, 0x0001, - 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x4080, 0x0005, 0xac80, - 0x0001, 0x81ff, 0x0518, 0x2099, 0x0030, 0x20a0, 0x700c, 0xa084, - 0x07ff, 0x0100, 0x7018, 0x0006, 0x701c, 0x0006, 0x7020, 0x0006, - 0x7024, 0x0006, 0x7112, 0x81ac, 0x721a, 0x731e, 0x7422, 0x7526, - 0x7003, 0x0001, 0x7007, 0x0001, 0x7008, 0x800b, 0x1ee8, 0x7007, - 0x0002, 0xa08c, 0x01e0, 0x1110, 0x53a5, 0xa006, 0x7003, 0x0000, - 0x7007, 0x0004, 0x000e, 0x7026, 0x000e, 0x7022, 0x000e, 0x701e, - 0x000e, 0x701a, 0x0005, 0x2011, 0x0020, 0x2009, 0x0010, 0x6b0a, - 0x6c0e, 0x681f, 0x0201, 0x6803, 0xfd20, 0x6807, 0x0038, 0x6a1a, - 0x2d00, 0xa0e8, 0x0008, 0xa290, 0x0004, 0x8109, 0x1d80, 0x0005, - 0x70ec, 0xd0dc, 0x1520, 0x2029, 0x0001, 0x7814, 0xd0cc, 0x1160, - 0x70ec, 0xd0e4, 0x2019, 0x0c0a, 0x2021, 0x000a, 0x1120, 0x2019, - 0x0c0c, 0x2021, 0x000c, 0x0070, 0x70ec, 0xd0e4, 0x1128, 0x2019, - 0x1c0c, 0x2021, 0x000c, 0x0030, 0x2019, 0x1c09, 0x2021, 0x0009, - 0xa5ad, 0x0200, 0x6b0a, 0x6c0e, 0x6d1e, 0x6807, 0x0038, 0x0005, - 0x6004, 0x6086, 0x2c08, 0x2063, 0x0000, 0x7868, 0xa005, 0x796a, - 0x0110, 0x2c02, 0x0008, 0x796e, 0x0005, 0x00c6, 0x2061, 0x4300, - 0x6887, 0x0103, 0x2d08, 0x206b, 0x0000, 0x6068, 0xa005, 0x616a, - 0x0110, 0x2d02, 0x0008, 0x616e, 0x00ce, 0x0005, 0x2091, 0x8000, - 0x2c04, 0x786e, 0xa005, 0x1108, 0x786a, 0x2091, 0x8001, 0x609c, - 0xa005, 0x0188, 0x00c6, 0x2060, 0x2008, 0x609c, 0xa005, 0x0138, - 0x2062, 0x609f, 0x0000, 0xa065, 0x609c, 0xa005, 0x1dc8, 0x7848, - 0x794a, 0x2062, 0x00ce, 0x7848, 0x2062, 0x609f, 0x0000, 0xac85, - 0x0000, 0x1110, 0x080c, 0x243b, 0x784a, 0x0005, 0x20a9, 0x0010, - 0xa006, 0x8004, 0x8086, 0x818e, 0x1208, 0xa200, 0x1f04, 0x1d7a, - 0x8086, 0x818e, 0x0005, 0x0156, 0x20a9, 0x0010, 0xa005, 0x01b8, - 0xa11a, 0x12a8, 0x8213, 0x818d, 0x0228, 0xa11a, 0x1220, 0x1f04, - 0x1d8a, 0x0028, 0xa11a, 0x2308, 0x8210, 0x1f04, 0x1d8a, 0x0006, - 0x3200, 0xa084, 0xefff, 0x2080, 0x000e, 0x015e, 0x0005, 0x0006, - 0x3200, 0xa085, 0x1000, 0x0cb8, 0x7d74, 0x70d0, 0xa506, 0x0904, - 0x1e5b, 0x7810, 0x2050, 0x7800, 0xd08c, 0x0100, 0x080c, 0x1afa, - 0x0904, 0x1e5b, 0xa046, 0x7970, 0x2500, 0x8000, 0xa112, 0x2009, - 0x0040, 0x1208, 0x0030, 0x72d0, 0xa206, 0x0118, 0x8840, 0x2009, - 0x0080, 0x00c6, 0x7112, 0x7007, 0x0001, 0x2099, 0x0030, 0x20a9, - 0x0020, 0xac80, 0x0001, 0x20a0, 0x2061, 0x0000, 0x88ff, 0x0110, - 0x080c, 0x1afa, 0x7008, 0xd0fc, 0x0de8, 0x7007, 0x0002, 0x2091, - 0x8001, 0xa08c, 0x01e0, 0x1538, 0x53a5, 0x8cff, 0x1120, 0x88ff, - 0x0904, 0x1e48, 0x0050, 0x2c00, 0x788e, 0x20a9, 0x0020, 0xac80, - 0x0001, 0x20a0, 0x53a5, 0x0804, 0x1e48, 0xa046, 0x7218, 0x731c, - 0xdac4, 0x0110, 0x7420, 0x7524, 0xa292, 0x0040, 0xa39b, 0x0000, - 0xa4a3, 0x0000, 0xa5ab, 0x0000, 0x721a, 0x731e, 0xdac4, 0x0118, - 0x7422, 0x7526, 0xa006, 0x7007, 0x0004, 0x0904, 0x1e48, 0x8cff, - 0x0110, 0x080c, 0x1b02, 0x00ce, 0x080c, 0x1b02, 0xa046, 0x7888, - 0x8000, 0x788a, 0xa086, 0x0002, 0x01c0, 0x7a7c, 0x7b78, 0xdac4, - 0x0110, 0x7c84, 0x7d80, 0x7974, 0x8107, 0x8004, 0x8004, 0xa210, - 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x721a, 0x731e, - 0xdac4, 0x0588, 0x7422, 0x7526, 0x0470, 0x6014, 0xd0fc, 0x1118, - 0x2069, 0x4340, 0x0010, 0x2069, 0x4380, 0x2091, 0x8000, 0x681f, - 0x0002, 0x88ff, 0x0120, 0xa046, 0x788c, 0x2060, 0x0c70, 0x788b, - 0x0000, 0x78ac, 0xa085, 0x0003, 0x78ae, 0x2091, 0x8001, 0x0098, - 0x00ce, 0x788b, 0x0000, 0x080c, 0x1fb9, 0x6004, 0xa084, 0x000f, - 0x0059, 0x88ff, 0x0130, 0x788c, 0x2060, 0x6004, 0xa084, 0x000f, - 0x0019, 0x0804, 0x1da4, 0x0005, 0x0002, 0x1e6d, 0x1e88, 0x1ea1, - 0x1e6d, 0x1eae, 0x1e7e, 0x1e6d, 0x1e6d, 0x1e6d, 0x1e86, 0x1e9f, - 0x1e6d, 0x1e6d, 0x1e6d, 0x1e6d, 0x1e6d, 0x2039, 0x0400, 0x78bc, - 0xa705, 0x78be, 0x6008, 0xa705, 0x600a, 0x080c, 0x1eea, 0x609c, - 0x78ba, 0x609f, 0x0000, 0x080c, 0x1fa5, 0x0005, 0x78bc, 0xd0c4, - 0x0108, 0x0c58, 0x601c, 0xc0bd, 0x601e, 0x0030, 0x080c, 0x1fe3, - 0x78bc, 0xd0c4, 0x0108, 0x0c08, 0x78bf, 0x0000, 0x6004, 0x8007, - 0xa084, 0x00ff, 0x78b2, 0x8001, 0x0138, 0x080c, 0x1eea, 0x0120, - 0x78bc, 0xc0c5, 0x78be, 0x0010, 0x0804, 0x1f05, 0x0005, 0x080c, - 0x1fe0, 0x78bc, 0xa08c, 0x0e00, 0x1110, 0xd0c4, 0x1108, 0x0828, - 0x080c, 0x1eea, 0x1110, 0x0804, 0x1f05, 0x0005, 0x78bc, 0xd0c4, - 0x0110, 0x0804, 0x1e6d, 0x78bf, 0x0000, 0x6714, 0x2011, 0x0001, - 0x22a8, 0x6018, 0xa084, 0x00ff, 0xa005, 0x0188, 0xa7bc, 0xff00, - 0x20a9, 0x0020, 0xa08e, 0x0001, 0x0150, 0xa7bc, 0x8000, 0x2011, - 0x0002, 0x20a9, 0x0100, 0xa08e, 0x0002, 0x0108, 0x00c0, 0x080c, - 0x1b1d, 0x2d00, 0x2091, 0x8000, 0x682b, 0x0000, 0x682f, 0x0000, - 0x6808, 0xa084, 0xffde, 0x680a, 0xade8, 0x0010, 0x2091, 0x8001, - 0x1f04, 0x1ed2, 0x8211, 0x0118, 0x20a9, 0x0100, 0x0c58, 0x080c, - 0x1b02, 0x0005, 0x609f, 0x0000, 0x78b4, 0xa06d, 0x2c00, 0x78b6, - 0x1110, 0x78ba, 0x0038, 0x689e, 0x2d00, 0x6002, 0x78b8, 0xad06, - 0x1108, 0x6002, 0x78b0, 0x8001, 0x78b2, 0x1130, 0x78bc, 0xc0c4, - 0x78be, 0x78b8, 0x2060, 0xa006, 0x0005, 0x00e6, 0xa02e, 0x2530, - 0x7dba, 0x7db6, 0x65ae, 0x65b2, 0x601c, 0x60a2, 0x2048, 0xa984, - 0xe1ff, 0x601e, 0xa984, 0x0060, 0x0110, 0x080c, 0x3de5, 0x6596, - 0x65a6, 0x669a, 0x66aa, 0x6714, 0x2071, 0x4380, 0xd7fc, 0x1110, - 0x2071, 0x4340, 0xa784, 0x0f00, 0x800b, 0xa784, 0x001f, 0x0120, - 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0x71c4, 0xa168, 0x2700, - 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0x71c8, 0xa100, - 0x60c2, 0x2091, 0x8000, 0x6e08, 0xd684, 0x0170, 0xd9fc, 0x1160, - 0x2091, 0x8001, 0x080c, 0x1b85, 0x2091, 0x8000, 0x080c, 0x1d30, - 0x2091, 0x8001, 0x0804, 0x1fa3, 0x6024, 0xa096, 0x0001, 0x1110, - 0x8000, 0x6026, 0x6a10, 0x6814, 0xa202, 0x0268, 0x0160, 0x2091, - 0x8001, 0x2039, 0x0200, 0x609c, 0x78ba, 0x609f, 0x0000, 0x080c, - 0x1fa5, 0x0804, 0x1fa3, 0x2c08, 0xd9fc, 0x01f0, 0x6800, 0xa065, - 0x01d8, 0x6a04, 0x7000, 0xa084, 0x0002, 0x0168, 0x704c, 0xa206, - 0x1150, 0x6b04, 0x2160, 0x2304, 0x6002, 0xa005, 0x1108, 0x6902, - 0x2260, 0x6102, 0x0098, 0x2d00, 0x2060, 0x080c, 0x2580, 0x6e08, - 0x2160, 0x6202, 0x6906, 0x0050, 0x6800, 0x6902, 0xa065, 0x0110, - 0x6102, 0x0008, 0x6906, 0x2160, 0x6003, 0x0000, 0x2160, 0xd9fc, - 0x0118, 0xa6b4, 0xfffc, 0x6e0a, 0x6810, 0x7d08, 0x8528, 0x7d0a, - 0x8000, 0x6812, 0x2091, 0x8001, 0xd6b4, 0x0128, 0xa6b6, 0x0040, - 0x6e0a, 0x080c, 0x1b96, 0x00ee, 0x0005, 0x6008, 0xa705, 0x600a, - 0x2091, 0x8000, 0x080c, 0x1d30, 0x2091, 0x8001, 0x78b8, 0xa065, - 0x0128, 0x609c, 0x78ba, 0x609f, 0x0000, 0x0c78, 0x78b6, 0x78ba, - 0x0005, 0x7970, 0x7874, 0x2818, 0xd384, 0x0118, 0x8000, 0xa112, - 0x0220, 0x8000, 0xa112, 0x1278, 0xc384, 0x7a7c, 0x721a, 0x7a78, - 0x721e, 0xdac4, 0x0120, 0x7a84, 0x7222, 0x7a80, 0x7226, 0xa006, - 0xd384, 0x0108, 0x8000, 0x7876, 0x70d2, 0x781c, 0xa005, 0x0138, - 0x8001, 0x781e, 0x1120, 0x0e04, 0x1fdf, 0x2091, 0x4080, 0x0005, - 0x2039, 0x1ff5, 0x0010, 0x2039, 0x1ffb, 0x2704, 0xa005, 0x0160, - 0xac00, 0x2068, 0x6908, 0x6810, 0x6912, 0x680a, 0x690c, 0x6814, - 0x6916, 0x680e, 0x8738, 0x0c88, 0x0005, 0x0003, 0x0009, 0x000f, - 0x0015, 0x001b, 0x0000, 0x0015, 0x001b, 0x0000, 0x2041, 0x0000, - 0x780c, 0x0002, 0x21a7, 0x2182, 0x2006, 0x2076, 0x2039, 0x8b74, - 0x2734, 0x7d10, 0x00c0, 0x6084, 0xa086, 0x0103, 0x1904, 0x2060, - 0x6114, 0x6018, 0xa105, 0x0120, 0x86ff, 0x11d8, 0x0804, 0x2060, - 0x8603, 0xa080, 0x8b55, 0x620c, 0x2202, 0x8000, 0x6210, 0x2202, - 0x080c, 0x1d4e, 0x8630, 0xa68e, 0x000f, 0x0904, 0x20e1, 0x786c, - 0xa065, 0x1d08, 0x7808, 0xa602, 0x1220, 0xd5ac, 0x1110, 0x263a, - 0x0005, 0xa682, 0x0003, 0x1a04, 0x20e1, 0x2091, 0x8000, 0x2069, - 0x0000, 0x6818, 0xd084, 0x11f8, 0x2011, 0x8b55, 0x2204, 0x70c6, - 0x8210, 0x2204, 0x70ca, 0xd684, 0x1130, 0x8210, 0x2204, 0x70da, - 0x8210, 0x2204, 0x70de, 0xa685, 0x8020, 0x70c2, 0x681b, 0x0001, - 0x2091, 0x4080, 0x7810, 0xa084, 0xffcf, 0x7812, 0x2091, 0x8001, - 0x203b, 0x0000, 0x0005, 0x7810, 0xc0ad, 0x7812, 0x0804, 0x20e1, - 0x263a, 0x080c, 0x21ad, 0x1904, 0x21c9, 0x786c, 0xa065, 0x1904, - 0x200b, 0x2091, 0x8000, 0x7810, 0xa084, 0xffcf, 0x86ff, 0x0108, - 0xc0ad, 0x7812, 0x2091, 0x8001, 0x0804, 0x21c9, 0x2039, 0x8b74, - 0x2734, 0x7d10, 0x00a0, 0x6084, 0xa086, 0x0103, 0x1904, 0x20cb, - 0x6114, 0x6018, 0xa105, 0x0120, 0x86ff, 0x11b8, 0x0804, 0x20cb, - 0xa680, 0x8b55, 0x620c, 0x2202, 0x080c, 0x1d4e, 0x8630, 0xa68e, - 0x001e, 0x0904, 0x20e1, 0x786c, 0xa065, 0x1d28, 0x7808, 0xa602, - 0x1220, 0xd5ac, 0x1110, 0x263a, 0x0005, 0xa682, 0x0006, 0x1a04, - 0x20e1, 0x2091, 0x8000, 0x2069, 0x0000, 0x6818, 0xd084, 0x11f8, - 0x2011, 0x8b55, 0x2009, 0x8b4e, 0x26a8, 0x211c, 0x2204, 0x201a, - 0x8108, 0x8210, 0x1f04, 0x20ad, 0xa685, 0x8030, 0x70c2, 0x681b, - 0x0001, 0x2091, 0x4080, 0x7810, 0xa084, 0xffcf, 0x7812, 0x2091, - 0x8001, 0xa006, 0x2009, 0x8b75, 0x200a, 0x203a, 0x0005, 0x7810, - 0xc0ad, 0x7812, 0x00b0, 0x263a, 0x080c, 0x21ad, 0x1904, 0x21c9, - 0x786c, 0xa065, 0x1904, 0x207b, 0x2091, 0x8000, 0x7810, 0xa084, - 0xffcf, 0x86ff, 0x0108, 0xc0ad, 0x7812, 0x2091, 0x8001, 0x0804, - 0x21c9, 0x2091, 0x8000, 0x7007, 0x0004, 0x7994, 0x70d4, 0xa102, - 0x0228, 0x0168, 0x7b90, 0xa302, 0x1150, 0x0010, 0x8002, 0x1138, - 0x263a, 0x7810, 0xc0ad, 0x7812, 0x2091, 0x8001, 0x0005, 0xa184, - 0xff00, 0x0140, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, - 0xa100, 0x0018, 0x8107, 0x8004, 0x8004, 0x7a9c, 0xa210, 0x721a, - 0x7a98, 0xa006, 0xa211, 0x721e, 0xd4c4, 0x0130, 0x7aa4, 0xa211, - 0x7222, 0x7aa0, 0xa211, 0x7226, 0x20a1, 0x0030, 0x7003, 0x0000, - 0x2009, 0x8b54, 0x260a, 0x8109, 0x2198, 0x2104, 0xd084, 0x0108, - 0x8633, 0xa6b0, 0x0002, 0x26a8, 0x53a6, 0x8603, 0x7012, 0x7007, - 0x0001, 0x7990, 0x7894, 0x8000, 0xa10a, 0x1208, 0xa006, 0x2028, + 0x0001, 0x6b0c, 0x6800, 0x70da, 0x0804, 0x13b0, 0x0016, 0x7814, + 0xd0f4, 0x0138, 0x2001, 0x4007, 0x70db, 0x0000, 0xa18d, 0x0001, + 0x0050, 0xd0fc, 0x0138, 0x2001, 0x4007, 0x70db, 0x0001, 0xa18d, + 0x0001, 0x0008, 0xa006, 0x001e, 0x0005, 0x0016, 0x7814, 0xd0f4, + 0x0138, 0x2001, 0x4007, 0x70db, 0x0000, 0xa18d, 0x0001, 0x0008, + 0xa006, 0x001e, 0x0005, 0x0016, 0x7814, 0xd0fc, 0x0138, 0x2001, + 0x4007, 0x70db, 0x0001, 0xa18d, 0x0001, 0x0008, 0xa006, 0x001e, + 0x0005, 0x7112, 0x721a, 0x731e, 0x7810, 0xd0c4, 0x0110, 0x7422, + 0x7526, 0xac80, 0x0001, 0x8108, 0x810c, 0x81a9, 0x8098, 0x20a1, + 0x0030, 0x7003, 0x0000, 0x6084, 0x20a2, 0x53a6, 0x7007, 0x0001, 0x7974, 0xa184, 0xff00, 0x0140, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0018, 0x8107, 0x8004, 0x8004, 0x797c, - 0xa108, 0x7a78, 0xa006, 0xa211, 0xd4c4, 0x0120, 0x7b84, 0xa319, - 0x7c80, 0xa421, 0x7008, 0xd0fc, 0x0de8, 0xa084, 0x01e0, 0x01d0, - 0x7d10, 0x2031, 0x8b54, 0x2634, 0x78a8, 0x8000, 0x78aa, 0xd08c, - 0x1138, 0x7007, 0x0006, 0x7004, 0xd094, 0x1de8, 0x0804, 0x20e3, - 0x2069, 0x4347, 0x206b, 0x0003, 0x78ac, 0xa085, 0x0300, 0x78ae, - 0xa006, 0x0048, 0x2030, 0x75d6, 0x2091, 0x4080, 0x7d96, 0x7d10, - 0xa5ac, 0xffcf, 0x7d12, 0x2091, 0x8001, 0x78aa, 0x7007, 0x0006, - 0x263a, 0x7003, 0x0001, 0x711a, 0x721e, 0xd5c4, 0x0110, 0x7322, - 0x7426, 0x0005, 0x6084, 0xa086, 0x0103, 0x11d8, 0x6114, 0x6018, - 0xa105, 0x11b8, 0x2069, 0x0000, 0x6818, 0xd084, 0x1190, 0x600c, - 0x70c6, 0x6010, 0x70ca, 0x70c3, 0x8020, 0x681b, 0x0001, 0x2091, - 0x4080, 0x080c, 0x1d4e, 0x0e04, 0x21a0, 0x786c, 0xa065, 0x1d10, - 0x0005, 0x0059, 0x1530, 0x786c, 0xa065, 0x19e0, 0x0410, 0x0029, - 0x1500, 0x786c, 0xa065, 0x1dd8, 0x00e0, 0x6084, 0xa086, 0x0103, - 0x1168, 0x6018, 0xc0fc, 0x601a, 0xa086, 0x0004, 0x1138, 0x7804, - 0xd0a4, 0x0120, 0x080c, 0x1d4e, 0xa006, 0x0005, 0x0079, 0x1118, - 0xa085, 0x0001, 0x0005, 0x00b9, 0x1110, 0x2041, 0x0001, 0x7d10, - 0x0005, 0x88ff, 0x0110, 0x2091, 0x4080, 0x0005, 0x7b90, 0x7994, - 0x70d4, 0xa102, 0x1118, 0xa385, 0x0000, 0x0005, 0x0210, 0xa302, - 0x0005, 0x8002, 0x0005, 0xa184, 0xff00, 0x0140, 0x810f, 0x810c, - 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0018, 0x8107, 0x8004, - 0x8004, 0x7a9c, 0x7b98, 0x7ca4, 0x7da0, 0xa210, 0xa006, 0xa319, - 0xa421, 0xa529, 0x2009, 0x0018, 0x6028, 0xa005, 0x0110, 0x2009, - 0x0040, 0x080c, 0x1ab7, 0x01d0, 0x78a8, 0x8000, 0x78aa, 0xd08c, - 0x1510, 0x6014, 0xd0fc, 0x1118, 0x2069, 0x4340, 0x0010, 0x2069, - 0x4380, 0x2091, 0x8000, 0x681f, 0x0003, 0x78ab, 0x0000, 0x78ac, - 0xa085, 0x0300, 0x78ae, 0x2091, 0x8001, 0x0068, 0x78ab, 0x0000, - 0x080c, 0x1d4e, 0x7990, 0x7894, 0x8000, 0xa10a, 0x1208, 0xa006, - 0x7896, 0x70d6, 0xa006, 0x2071, 0x0010, 0x2091, 0x8001, 0x0005, - 0x2138, 0xd7fc, 0x1118, 0x2009, 0x4359, 0x0010, 0x2009, 0x4399, - 0x2091, 0x8000, 0x200a, 0x00f6, 0x2009, 0x4380, 0x2079, 0x0100, - 0xd7fc, 0x1120, 0x2009, 0x4340, 0x2079, 0x0200, 0x2104, 0xa086, - 0x0000, 0x1180, 0xd7fc, 0x1118, 0x2009, 0x4345, 0x0010, 0x2009, - 0x4385, 0x2104, 0xa005, 0x1130, 0x7830, 0xa084, 0x00c0, 0x1110, - 0x781b, 0x0052, 0x00fe, 0x0005, 0x2009, 0x0002, 0x2069, 0x4300, - 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x22a9, 0x2071, 0x4380, - 0x2079, 0x0100, 0x2021, 0x45bf, 0x784b, 0x000f, 0x2001, 0x01ff, - 0x2004, 0xd0fc, 0x0118, 0x2019, 0x3c3b, 0x0030, 0x20a1, 0x012b, - 0x2019, 0x3c3b, 0xd184, 0x0110, 0x20a1, 0x022b, 0x2304, 0xa005, - 0x0140, 0x789a, 0x8318, 0x23ac, 0x8318, 0x2398, 0x53a6, 0x3318, - 0x0ca8, 0x789b, 0x0000, 0x789b, 0x0020, 0x20a9, 0x0010, 0x78af, - 0x0000, 0x78af, 0x2020, 0x1f04, 0x2287, 0x7003, 0x0000, 0x0016, - 0xd18c, 0x2009, 0x0000, 0x0108, 0xc1bd, 0x080c, 0x23bd, 0x001e, - 0x7020, 0xa084, 0x000f, 0xa085, 0x6300, 0x7806, 0x780f, 0x9000, - 0x7843, 0x00d8, 0x7853, 0x0090, 0x780b, 0x0308, 0x7456, 0x7053, - 0x0000, 0x8109, 0x0140, 0x2071, 0x4340, 0x2079, 0x0200, 0x2021, - 0x43bf, 0x0804, 0x2264, 0x0005, 0x0016, 0x2011, 0x0101, 0xd1bc, - 0x1110, 0x2011, 0x0201, 0xa18c, 0x000f, 0x2204, 0xa084, 0xfff0, - 0xa105, 0x2012, 0x001e, 0x080c, 0x23bd, 0x0005, 0x2011, 0x0101, - 0xd3fc, 0x1110, 0x2011, 0x0201, 0x20a9, 0x0009, 0x810b, 0x1f04, - 0x22ce, 0xa18c, 0x0e00, 0x2204, 0xa084, 0xf1ff, 0xa105, 0x2012, - 0x0005, 0x2019, 0x0002, 0x2009, 0x0101, 0x20a9, 0x0005, 0x8213, - 0x1f04, 0x22df, 0xa294, 0x00e0, 0x2104, 0xa084, 0xff1f, 0xa205, - 0x200a, 0x8319, 0x0118, 0x2009, 0x0201, 0x0c78, 0x0005, 0x2011, - 0x0101, 0xd3fc, 0x1110, 0x2011, 0x0201, 0x20a9, 0x000c, 0x810b, - 0x1f04, 0x22f7, 0xa18c, 0xf000, 0x2204, 0xa084, 0x0fff, 0xa105, - 0x2012, 0x0005, 0x2011, 0x0102, 0xd3fc, 0x1110, 0x2011, 0x0202, - 0x2204, 0xa084, 0xffcf, 0xa105, 0x2012, 0x0005, 0x00c6, 0x2061, - 0x0100, 0xd1bc, 0x1110, 0x2061, 0x0200, 0xc1bc, 0x8103, 0x8003, - 0xa080, 0x0020, 0x609a, 0x62ac, 0x63ac, 0x00ce, 0x0005, 0x00c6, + 0xa108, 0x7a78, 0xa006, 0xa211, 0x7d10, 0xd5c4, 0x0120, 0x7b84, + 0xa319, 0x7c80, 0xa421, 0x7008, 0xd0fc, 0x0de8, 0x7003, 0x0001, + 0x7007, 0x0006, 0x711a, 0x721e, 0x7d10, 0xd5c4, 0x0110, 0x7322, + 0x7426, 0xa084, 0x01e0, 0x0005, 0x7848, 0xa065, 0x0120, 0x2c04, + 0x784a, 0x2063, 0x0000, 0x0005, 0x00f6, 0x2079, 0x4500, 0x7848, + 0x2062, 0x2c00, 0xa005, 0x1110, 0x080c, 0x252b, 0x784a, 0x00fe, + 0x0005, 0x2011, 0x8f00, 0x7a4a, 0x7bc4, 0x8319, 0x0128, 0xa280, + 0x0032, 0x2012, 0x2010, 0x0cc8, 0x2013, 0x0000, 0x0005, 0x0016, + 0x0026, 0xd7fc, 0x1118, 0x2011, 0x4ac0, 0x0010, 0x2011, 0x6ac0, + 0xa784, 0x0f00, 0x800b, 0xa784, 0x001f, 0x0120, 0x8003, 0x8003, + 0x8003, 0x8003, 0xa105, 0xa268, 0x002e, 0x001e, 0x0005, 0x0c39, + 0x2900, 0x682a, 0x2a00, 0x682e, 0x6808, 0xa084, 0xf9ef, 0xa80d, + 0x690a, 0x00e6, 0xd7fc, 0x1128, 0x2009, 0x4552, 0x2071, 0x4540, + 0x0020, 0x2009, 0x4592, 0x2071, 0x4580, 0x210c, 0x6804, 0xa005, + 0x0148, 0xa116, 0x1138, 0x2060, 0x6000, 0x6806, 0x0016, 0x200b, + 0x0000, 0x0018, 0x2009, 0x0000, 0x0016, 0x6804, 0xa065, 0x0178, + 0x6000, 0x6806, 0x0421, 0x080c, 0x1d7c, 0x6810, 0x7908, 0x8109, + 0x790a, 0x8001, 0x6812, 0x1d88, 0x7910, 0xc1a5, 0x7912, 0x001e, + 0x6902, 0x6906, 0x2d00, 0x2060, 0x080c, 0x2672, 0x00ee, 0x0005, + 0xa065, 0x0160, 0x2008, 0x609c, 0xa005, 0x0128, 0x2062, 0x609f, + 0x0000, 0xa065, 0x0cc0, 0x7848, 0x794a, 0x2062, 0x0005, 0x6007, + 0x0103, 0x608f, 0x0000, 0x20a9, 0x001c, 0xac80, 0x0005, 0x20a0, + 0x2001, 0x0000, 0x40a4, 0x6828, 0x601a, 0x682c, 0x6022, 0x0005, + 0x00e6, 0xd7fc, 0x1128, 0x2071, 0x4540, 0x2031, 0x45c0, 0x0020, + 0x2071, 0x4580, 0x2031, 0x47c0, 0x704c, 0xa08c, 0x0200, 0x1128, + 0xa608, 0x2d0a, 0x8000, 0x704e, 0xa006, 0x00ee, 0x0005, 0x00f6, + 0xd7fc, 0x1118, 0x2079, 0x4540, 0x0010, 0x2079, 0x4580, 0x080c, + 0x1b5f, 0x2091, 0x8000, 0x6804, 0x780a, 0xa065, 0x0904, 0x1c40, + 0x0030, 0x2c00, 0x780a, 0x2060, 0x6000, 0xa065, 0x05c8, 0x6010, + 0xa306, 0x1db8, 0x600c, 0xa206, 0x1da0, 0x2c28, 0x7848, 0xac06, + 0x1108, 0x0458, 0x6804, 0xac06, 0x1140, 0x6000, 0x2060, 0x6806, + 0xa005, 0x1118, 0x6803, 0x0000, 0x0048, 0x6400, 0x7808, 0x2060, + 0x6402, 0xa486, 0x0000, 0x1110, 0x2c00, 0x6802, 0x2560, 0x00fe, + 0x080c, 0x1bc7, 0x00f6, 0x601b, 0x0005, 0x6023, 0x0020, 0x00fe, + 0x080c, 0x1d7c, 0x00f6, 0x7908, 0x8109, 0x790a, 0x6810, 0x8001, + 0x6812, 0x1118, 0x7810, 0xc0a5, 0x7812, 0x2001, 0xffff, 0xa005, + 0x00fe, 0x0005, 0x0076, 0x2700, 0x2039, 0x0000, 0xd0fc, 0x0108, + 0xc7fd, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 0x2091, + 0x8000, 0x080c, 0x1b77, 0x8738, 0xa784, 0x001f, 0x1dd0, 0xa7bc, + 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, 0x1d90, 0x2091, + 0x8001, 0x007e, 0x0005, 0x786c, 0x2009, 0x8d74, 0x210c, 0xa10d, + 0x0118, 0xa065, 0x0804, 0x2061, 0x2061, 0x0000, 0x6018, 0xd084, + 0x11b8, 0x7810, 0xd08c, 0x0130, 0xc08c, 0x7812, 0xc7fc, 0x2069, + 0x4540, 0x0028, 0xc08d, 0x7812, 0x2069, 0x4580, 0xc7fd, 0x2091, + 0x8000, 0x681c, 0x681f, 0x0000, 0x2091, 0x8001, 0xa005, 0x1108, + 0x0005, 0xa08c, 0xfff0, 0x0110, 0x080c, 0x252b, 0x0002, 0x1c9f, + 0x1ca2, 0x1ca8, 0x1cac, 0x1ca0, 0x1cb0, 0x1ca0, 0x1ca0, 0x1ca0, + 0x1cb6, 0x1ce2, 0x1ce5, 0x1cea, 0x1cf3, 0x1ca0, 0x1ca0, 0x0005, + 0x080c, 0x252b, 0x080c, 0x1c42, 0x2001, 0x8001, 0x0804, 0x1cfc, + 0x2001, 0x8003, 0x0804, 0x1cfc, 0x2001, 0x8004, 0x0804, 0x1cfc, + 0x080c, 0x1c42, 0x2001, 0x8006, 0x0804, 0x1cfc, 0x2091, 0x8000, + 0x0076, 0xd7fc, 0x1128, 0x2069, 0x4540, 0x2039, 0x0009, 0x0020, + 0x2069, 0x4580, 0x2039, 0x0009, 0x6800, 0xa086, 0x0000, 0x0128, + 0x000e, 0x6f1e, 0x2091, 0x8001, 0x0005, 0x6870, 0x007e, 0xa0bc, + 0xff00, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0010, 0x080c, + 0x1b77, 0x8738, 0xa784, 0x001f, 0x1dd0, 0x2091, 0x8001, 0x2001, + 0x800a, 0x00d0, 0x2001, 0x800c, 0x00b8, 0x080c, 0x1c42, 0x2001, + 0x800d, 0x0090, 0xd7fc, 0x0110, 0x78e4, 0x0008, 0x78e0, 0x70c6, + 0x2001, 0x800e, 0x0048, 0xd7fc, 0x0110, 0x78ec, 0x0008, 0x78e8, + 0x70c6, 0x2001, 0x000d, 0x0000, 0x70c2, 0xd7fc, 0x1118, 0x70db, + 0x0000, 0x0010, 0x70db, 0x0001, 0x2061, 0x0000, 0x601b, 0x0001, + 0x2091, 0x4080, 0x0005, 0xac80, 0x0001, 0x81ff, 0x0518, 0x2099, + 0x0030, 0x20a0, 0x700c, 0xa084, 0x07ff, 0x0100, 0x7018, 0x0006, + 0x701c, 0x0006, 0x7020, 0x0006, 0x7024, 0x0006, 0x7112, 0x81ac, + 0x721a, 0x731e, 0x7422, 0x7526, 0x7003, 0x0001, 0x7007, 0x0001, + 0x7008, 0x800b, 0x1ee8, 0x7007, 0x0002, 0xa08c, 0x01e0, 0x1110, + 0x53a5, 0xa006, 0x7003, 0x0000, 0x7007, 0x0004, 0x000e, 0x7026, + 0x000e, 0x7022, 0x000e, 0x701e, 0x000e, 0x701a, 0x0005, 0x2011, + 0x0020, 0x2009, 0x0010, 0x6b0a, 0x6c0e, 0x681f, 0x0201, 0x6803, + 0xfd20, 0x6807, 0x0038, 0x6a1a, 0x2d00, 0xa0e8, 0x0008, 0xa290, + 0x0004, 0x8109, 0x1d80, 0x0005, 0x70ec, 0xd0dc, 0x1520, 0x2029, + 0x0001, 0x7814, 0xd0cc, 0x1160, 0x70ec, 0xd0e4, 0x2019, 0x0c0a, + 0x2021, 0x000a, 0x1120, 0x2019, 0x0c0c, 0x2021, 0x000c, 0x0070, + 0x70ec, 0xd0e4, 0x1128, 0x2019, 0x1c0c, 0x2021, 0x000c, 0x0030, + 0x2019, 0x1c09, 0x2021, 0x0009, 0xa5ad, 0x0200, 0x6b0a, 0x6c0e, + 0x6d1e, 0x6807, 0x0038, 0x0005, 0x6004, 0x6086, 0x2c08, 0x2063, + 0x0000, 0x7868, 0xa005, 0x796a, 0x0110, 0x2c02, 0x0008, 0x796e, + 0x0005, 0x00c6, 0x2061, 0x4500, 0x6887, 0x0103, 0x2d08, 0x206b, + 0x0000, 0x6068, 0xa005, 0x616a, 0x0110, 0x2d02, 0x0008, 0x616e, + 0x00ce, 0x0005, 0x2091, 0x8000, 0x2c04, 0x786e, 0xa005, 0x1108, + 0x786a, 0x2091, 0x8001, 0x609c, 0xa005, 0x0188, 0x00c6, 0x2060, + 0x2008, 0x609c, 0xa005, 0x0138, 0x2062, 0x609f, 0x0000, 0xa065, + 0x609c, 0xa005, 0x1dc8, 0x7848, 0x794a, 0x2062, 0x00ce, 0x7848, + 0x2062, 0x609f, 0x0000, 0xac85, 0x0000, 0x1110, 0x080c, 0x252b, + 0x784a, 0x0005, 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086, 0x818e, + 0x1208, 0xa200, 0x1f04, 0x1dc6, 0x8086, 0x818e, 0x0005, 0x0156, + 0x20a9, 0x0010, 0xa005, 0x01b8, 0xa11a, 0x12a8, 0x8213, 0x818d, + 0x0228, 0xa11a, 0x1220, 0x1f04, 0x1dd6, 0x0028, 0xa11a, 0x2308, + 0x8210, 0x1f04, 0x1dd6, 0x0006, 0x3200, 0xa084, 0xefff, 0x2080, + 0x000e, 0x015e, 0x0005, 0x0006, 0x3200, 0xa085, 0x1000, 0x0cb8, + 0x7d74, 0x70d0, 0xa506, 0x0904, 0x1ea4, 0x7810, 0x2050, 0x080c, + 0x1b3c, 0x0904, 0x1ea4, 0xa046, 0x7970, 0x2500, 0x8000, 0xa112, + 0x2009, 0x0040, 0x1208, 0x0030, 0x72d0, 0xa206, 0x0118, 0x8840, + 0x2009, 0x0080, 0x00c6, 0x7112, 0x7007, 0x0001, 0x2099, 0x0030, + 0x20a9, 0x0020, 0xac80, 0x0001, 0x20a0, 0x2061, 0x0000, 0x88ff, + 0x0110, 0x080c, 0x1b3c, 0x7008, 0xd0fc, 0x0de8, 0x7007, 0x0002, + 0x2091, 0x8001, 0xa08c, 0x01e0, 0x1538, 0x53a5, 0x8cff, 0x1120, + 0x88ff, 0x0904, 0x1e91, 0x0050, 0x2c00, 0x788e, 0x20a9, 0x0020, + 0xac80, 0x0001, 0x20a0, 0x53a5, 0x0804, 0x1e91, 0xa046, 0x7218, + 0x731c, 0xdac4, 0x0110, 0x7420, 0x7524, 0xa292, 0x0040, 0xa39b, + 0x0000, 0xa4a3, 0x0000, 0xa5ab, 0x0000, 0x721a, 0x731e, 0xdac4, + 0x0118, 0x7422, 0x7526, 0xa006, 0x7007, 0x0004, 0x0904, 0x1e91, + 0x8cff, 0x0110, 0x080c, 0x1b44, 0x00ce, 0x080c, 0x1b44, 0xa046, + 0x7888, 0x8000, 0x788a, 0xa086, 0x0002, 0x01c0, 0x7a7c, 0x7b78, + 0xdac4, 0x0110, 0x7c84, 0x7d80, 0x7974, 0x8107, 0x8004, 0x8004, + 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x721a, + 0x731e, 0xdac4, 0x0588, 0x7422, 0x7526, 0x0470, 0x6014, 0xd0fc, + 0x1118, 0x2069, 0x4540, 0x0010, 0x2069, 0x4580, 0x2091, 0x8000, + 0x681f, 0x0002, 0x88ff, 0x0120, 0xa046, 0x788c, 0x2060, 0x0c70, + 0x788b, 0x0000, 0x78ac, 0xa085, 0x0003, 0x78ae, 0x2091, 0x8001, + 0x0098, 0x00ce, 0x788b, 0x0000, 0x080c, 0x201c, 0x6004, 0xa084, + 0x000f, 0x0059, 0x88ff, 0x0130, 0x788c, 0x2060, 0x6004, 0xa084, + 0x000f, 0x0019, 0x0804, 0x1df0, 0x0005, 0x0002, 0x1eb6, 0x1ed1, + 0x1eea, 0x1eb6, 0x1ef7, 0x1ec7, 0x1eb6, 0x1eb6, 0x1eb6, 0x1ecf, + 0x1ee8, 0x1eb6, 0x1eb6, 0x1eb6, 0x1eb6, 0x1eb6, 0x2039, 0x0400, + 0x78bc, 0xa705, 0x78be, 0x6008, 0xa705, 0x600a, 0x080c, 0x1f33, + 0x609c, 0x78ba, 0x609f, 0x0000, 0x080c, 0x2008, 0x0005, 0x78bc, + 0xd0c4, 0x0108, 0x0c58, 0x601c, 0xc0bd, 0x601e, 0x0030, 0x080c, + 0x2046, 0x78bc, 0xd0c4, 0x0108, 0x0c08, 0x78bf, 0x0000, 0x6004, + 0x8007, 0xa084, 0x00ff, 0x78b2, 0x8001, 0x0138, 0x080c, 0x1f33, + 0x0120, 0x78bc, 0xc0c5, 0x78be, 0x0010, 0x0804, 0x1f4e, 0x0005, + 0x080c, 0x2043, 0x78bc, 0xa08c, 0x0e00, 0x1110, 0xd0c4, 0x1108, + 0x0828, 0x080c, 0x1f33, 0x1110, 0x0804, 0x1f4e, 0x0005, 0x78bc, + 0xd0c4, 0x0110, 0x0804, 0x1eb6, 0x78bf, 0x0000, 0x6714, 0x2011, + 0x0001, 0x22a8, 0x6018, 0xa084, 0x00ff, 0xa005, 0x0188, 0xa7bc, + 0xff00, 0x20a9, 0x0020, 0xa08e, 0x0001, 0x0150, 0xa7bc, 0x8000, + 0x2011, 0x0002, 0x20a9, 0x0100, 0xa08e, 0x0002, 0x0108, 0x00c0, + 0x080c, 0x1b5f, 0x2d00, 0x2091, 0x8000, 0x682b, 0x0000, 0x682f, + 0x0000, 0x6808, 0xa084, 0xffde, 0x680a, 0xade8, 0x0010, 0x2091, + 0x8001, 0x1f04, 0x1f1b, 0x8211, 0x0118, 0x20a9, 0x0100, 0x0c58, + 0x080c, 0x1b44, 0x0005, 0x609f, 0x0000, 0x78b4, 0xa06d, 0x2c00, + 0x78b6, 0x1110, 0x78ba, 0x0038, 0x689e, 0x2d00, 0x6002, 0x78b8, + 0xad06, 0x1108, 0x6002, 0x78b0, 0x8001, 0x78b2, 0x1130, 0x78bc, + 0xc0c4, 0x78be, 0x78b8, 0x2060, 0xa006, 0x0005, 0x00e6, 0xa02e, + 0x2530, 0x7dba, 0x7db6, 0x65ae, 0x65b2, 0x601c, 0x60a2, 0x2048, + 0xa984, 0xe1ff, 0x601e, 0xa984, 0x0060, 0x0110, 0x080c, 0x3f66, + 0x6596, 0x65a6, 0x669a, 0x66aa, 0x6714, 0x2071, 0x4580, 0xd7fc, + 0x1110, 0x2071, 0x4540, 0xa784, 0x0f00, 0x800b, 0xa784, 0x001f, + 0x0120, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0x71c0, 0xa168, + 0x2700, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0x71c4, + 0xa100, 0x60c2, 0x2091, 0x8000, 0x7814, 0xd0c4, 0x0138, 0xd7fc, + 0x1118, 0xd0f4, 0x1140, 0x0010, 0xd0fc, 0x1128, 0x6e08, 0xd684, + 0x01f0, 0xd9fc, 0x11e0, 0x2091, 0x8001, 0x080c, 0x1bc7, 0x2091, + 0x8000, 0x080c, 0x1d7c, 0x2091, 0x8001, 0x7814, 0xd0c4, 0x0904, + 0x2006, 0xd7fc, 0x1120, 0xd0f4, 0x1130, 0x0804, 0x2006, 0xd0fc, + 0x1110, 0x0804, 0x2006, 0x601b, 0x0021, 0x0804, 0x2006, 0x6024, + 0xa096, 0x0001, 0x1110, 0x8000, 0x6026, 0x6a10, 0x6814, 0xa202, + 0x0268, 0x0160, 0x2091, 0x8001, 0x2039, 0x0200, 0x609c, 0x78ba, + 0x609f, 0x0000, 0x080c, 0x2008, 0x0804, 0x2006, 0x2c08, 0xd9fc, + 0x01f0, 0x6800, 0xa065, 0x01d8, 0x6a04, 0x7000, 0xa084, 0x0002, + 0x0168, 0x7048, 0xa206, 0x1150, 0x6b04, 0x2160, 0x2304, 0x6002, + 0xa005, 0x1108, 0x6902, 0x2260, 0x6102, 0x0098, 0x2d00, 0x2060, + 0x080c, 0x2672, 0x6e08, 0x2160, 0x6202, 0x6906, 0x0050, 0x6800, + 0x6902, 0xa065, 0x0110, 0x6102, 0x0008, 0x6906, 0x2160, 0x6003, + 0x0000, 0x2160, 0xd9fc, 0x0118, 0xa6b4, 0xfffc, 0x6e0a, 0x6810, + 0x7d08, 0x8528, 0x7d0a, 0x8000, 0x6812, 0x2091, 0x8001, 0xd6b4, + 0x0128, 0xa6b6, 0x0040, 0x6e0a, 0x080c, 0x1bd8, 0x00ee, 0x0005, + 0x6008, 0xa705, 0x600a, 0x2091, 0x8000, 0x080c, 0x1d7c, 0x2091, + 0x8001, 0x78b8, 0xa065, 0x0128, 0x609c, 0x78ba, 0x609f, 0x0000, + 0x0c78, 0x78b6, 0x78ba, 0x0005, 0x7970, 0x7874, 0x2818, 0xd384, + 0x0118, 0x8000, 0xa112, 0x0220, 0x8000, 0xa112, 0x1278, 0xc384, + 0x7a7c, 0x721a, 0x7a78, 0x721e, 0xdac4, 0x0120, 0x7a84, 0x7222, + 0x7a80, 0x7226, 0xa006, 0xd384, 0x0108, 0x8000, 0x7876, 0x70d2, + 0x781c, 0xa005, 0x0138, 0x8001, 0x781e, 0x1120, 0x0e04, 0x2042, + 0x2091, 0x4080, 0x0005, 0x2039, 0x2058, 0x0010, 0x2039, 0x205e, + 0x2704, 0xa005, 0x0160, 0xac00, 0x2068, 0x6908, 0x6810, 0x6912, + 0x680a, 0x690c, 0x6814, 0x6916, 0x680e, 0x8738, 0x0c88, 0x0005, + 0x0003, 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0015, 0x001b, + 0x0000, 0x2041, 0x0000, 0x780c, 0x0002, 0x220a, 0x21e5, 0x2069, + 0x20d9, 0x2039, 0x8d74, 0x2734, 0x7d10, 0x00c0, 0x6084, 0xa086, + 0x0103, 0x1904, 0x20c3, 0x6114, 0x6018, 0xa105, 0x0120, 0x86ff, + 0x11d8, 0x0804, 0x20c3, 0x8603, 0xa080, 0x8d55, 0x620c, 0x2202, + 0x8000, 0x6210, 0x2202, 0x080c, 0x1d9a, 0x8630, 0xa68e, 0x000f, + 0x0904, 0x2144, 0x786c, 0xa065, 0x1d08, 0x7808, 0xa602, 0x1220, + 0xd5ac, 0x1110, 0x263a, 0x0005, 0xa682, 0x0003, 0x1a04, 0x2144, + 0x2091, 0x8000, 0x2069, 0x0000, 0x6818, 0xd084, 0x11f8, 0x2011, + 0x8d55, 0x2204, 0x70c6, 0x8210, 0x2204, 0x70ca, 0xd684, 0x1130, + 0x8210, 0x2204, 0x70da, 0x8210, 0x2204, 0x70de, 0xa685, 0x8020, + 0x70c2, 0x681b, 0x0001, 0x2091, 0x4080, 0x7810, 0xa084, 0xffcf, + 0x7812, 0x2091, 0x8001, 0x203b, 0x0000, 0x0005, 0x7810, 0xc0ad, + 0x7812, 0x0804, 0x2144, 0x263a, 0x080c, 0x2210, 0x1904, 0x222c, + 0x786c, 0xa065, 0x1904, 0x206e, 0x2091, 0x8000, 0x7810, 0xa084, + 0xffcf, 0x86ff, 0x0108, 0xc0ad, 0x7812, 0x2091, 0x8001, 0x0804, + 0x222c, 0x2039, 0x8d74, 0x2734, 0x7d10, 0x00a0, 0x6084, 0xa086, + 0x0103, 0x1904, 0x212e, 0x6114, 0x6018, 0xa105, 0x0120, 0x86ff, + 0x11b8, 0x0804, 0x212e, 0xa680, 0x8d55, 0x620c, 0x2202, 0x080c, + 0x1d9a, 0x8630, 0xa68e, 0x001e, 0x0904, 0x2144, 0x786c, 0xa065, + 0x1d28, 0x7808, 0xa602, 0x1220, 0xd5ac, 0x1110, 0x263a, 0x0005, + 0xa682, 0x0006, 0x1a04, 0x2144, 0x2091, 0x8000, 0x2069, 0x0000, + 0x6818, 0xd084, 0x11f8, 0x2011, 0x8d55, 0x2009, 0x8d4e, 0x26a8, + 0x211c, 0x2204, 0x201a, 0x8108, 0x8210, 0x1f04, 0x2110, 0xa685, + 0x8030, 0x70c2, 0x681b, 0x0001, 0x2091, 0x4080, 0x7810, 0xa084, + 0xffcf, 0x7812, 0x2091, 0x8001, 0xa006, 0x2009, 0x8d75, 0x200a, + 0x203a, 0x0005, 0x7810, 0xc0ad, 0x7812, 0x00b0, 0x263a, 0x080c, + 0x2210, 0x1904, 0x222c, 0x786c, 0xa065, 0x1904, 0x20de, 0x2091, + 0x8000, 0x7810, 0xa084, 0xffcf, 0x86ff, 0x0108, 0xc0ad, 0x7812, + 0x2091, 0x8001, 0x0804, 0x222c, 0x2091, 0x8000, 0x7007, 0x0004, + 0x7994, 0x70d4, 0xa102, 0x0228, 0x0168, 0x7b90, 0xa302, 0x1150, + 0x0010, 0x8002, 0x1138, 0x263a, 0x7810, 0xc0ad, 0x7812, 0x2091, + 0x8001, 0x0005, 0xa184, 0xff00, 0x0140, 0x810f, 0x810c, 0x810c, + 0x8004, 0x8004, 0x8007, 0xa100, 0x0018, 0x8107, 0x8004, 0x8004, + 0x7a9c, 0xa210, 0x721a, 0x7a98, 0xa006, 0xa211, 0x721e, 0xd4c4, + 0x0130, 0x7aa4, 0xa211, 0x7222, 0x7aa0, 0xa211, 0x7226, 0x20a1, + 0x0030, 0x7003, 0x0000, 0x2009, 0x8d54, 0x260a, 0x8109, 0x2198, + 0x2104, 0xd084, 0x0108, 0x8633, 0xa6b0, 0x0002, 0x26a8, 0x53a6, + 0x8603, 0x7012, 0x7007, 0x0001, 0x7990, 0x7894, 0x8000, 0xa10a, + 0x1208, 0xa006, 0x2028, 0x7974, 0xa184, 0xff00, 0x0140, 0x810f, + 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0018, 0x8107, + 0x8004, 0x8004, 0x797c, 0xa108, 0x7a78, 0xa006, 0xa211, 0xd4c4, + 0x0120, 0x7b84, 0xa319, 0x7c80, 0xa421, 0x7008, 0xd0fc, 0x0de8, + 0xa084, 0x01e0, 0x01d0, 0x7d10, 0x2031, 0x8d54, 0x2634, 0x78a8, + 0x8000, 0x78aa, 0xd08c, 0x1138, 0x7007, 0x0006, 0x7004, 0xd094, + 0x1de8, 0x0804, 0x2146, 0x2069, 0x4547, 0x206b, 0x0003, 0x78ac, + 0xa085, 0x0300, 0x78ae, 0xa006, 0x0048, 0x2030, 0x75d6, 0x2091, + 0x4080, 0x7d96, 0x7d10, 0xa5ac, 0xffcf, 0x7d12, 0x2091, 0x8001, + 0x78aa, 0x7007, 0x0006, 0x263a, 0x7003, 0x0001, 0x711a, 0x721e, + 0xd5c4, 0x0110, 0x7322, 0x7426, 0x0005, 0x6084, 0xa086, 0x0103, + 0x11d8, 0x6114, 0x6018, 0xa105, 0x11b8, 0x2069, 0x0000, 0x6818, + 0xd084, 0x1190, 0x600c, 0x70c6, 0x6010, 0x70ca, 0x70c3, 0x8020, + 0x681b, 0x0001, 0x2091, 0x4080, 0x080c, 0x1d9a, 0x0e04, 0x2203, + 0x786c, 0xa065, 0x1d10, 0x0005, 0x0059, 0x1530, 0x786c, 0xa065, + 0x19e0, 0x0410, 0x0029, 0x1500, 0x786c, 0xa065, 0x1dd8, 0x00e0, + 0x6084, 0xa086, 0x0103, 0x1168, 0x6018, 0xc0fc, 0x601a, 0xa086, + 0x0004, 0x1138, 0x7804, 0xd0a4, 0x0120, 0x080c, 0x1d9a, 0xa006, + 0x0005, 0x0079, 0x1118, 0xa085, 0x0001, 0x0005, 0x00b9, 0x1110, + 0x2041, 0x0001, 0x7d10, 0x0005, 0x88ff, 0x0110, 0x2091, 0x4080, + 0x0005, 0x7b90, 0x7994, 0x70d4, 0xa102, 0x1118, 0xa385, 0x0000, + 0x0005, 0x0210, 0xa302, 0x0005, 0x8002, 0x0005, 0xa184, 0xff00, + 0x0140, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, + 0x0018, 0x8107, 0x8004, 0x8004, 0x7a9c, 0x7b98, 0x7ca4, 0x7da0, + 0xa210, 0xa006, 0xa319, 0xa421, 0xa529, 0x2009, 0x0018, 0x6028, + 0xa005, 0x0110, 0x2009, 0x0040, 0x080c, 0x1af9, 0x01d0, 0x78a8, + 0x8000, 0x78aa, 0xd08c, 0x1510, 0x6014, 0xd0fc, 0x1118, 0x2069, + 0x4540, 0x0010, 0x2069, 0x4580, 0x2091, 0x8000, 0x681f, 0x0003, + 0x78ab, 0x0000, 0x78ac, 0xa085, 0x0300, 0x78ae, 0x2091, 0x8001, + 0x0068, 0x78ab, 0x0000, 0x080c, 0x1d9a, 0x7990, 0x7894, 0x8000, + 0xa10a, 0x1208, 0xa006, 0x7896, 0x70d6, 0xa006, 0x2071, 0x0010, + 0x2091, 0x8001, 0x0005, 0x2138, 0xd7fc, 0x1118, 0x2009, 0x4558, + 0x0010, 0x2009, 0x4598, 0x2091, 0x8000, 0x200a, 0x00f6, 0x2009, + 0x4580, 0x2079, 0x0100, 0xd7fc, 0x1120, 0x2009, 0x4540, 0x2079, + 0x0200, 0x2104, 0xa086, 0x0000, 0x1180, 0xd7fc, 0x1118, 0x2009, + 0x4545, 0x0010, 0x2009, 0x4585, 0x2104, 0xa005, 0x1130, 0x7830, + 0xa084, 0x00c0, 0x1110, 0x781b, 0x0052, 0x00fe, 0x0005, 0x2009, + 0x0002, 0x2069, 0x4500, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, + 0x230c, 0x2071, 0x4580, 0x2079, 0x0100, 0x2021, 0x47bf, 0x784b, + 0x000f, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x0118, 0x2019, 0x3dc2, + 0x0030, 0x20a1, 0x012b, 0x2019, 0x3dc2, 0xd184, 0x0110, 0x20a1, + 0x022b, 0x2304, 0xa005, 0x0140, 0x789a, 0x8318, 0x23ac, 0x8318, + 0x2398, 0x53a6, 0x3318, 0x0ca8, 0x789b, 0x0000, 0x789b, 0x0020, + 0x20a9, 0x0010, 0x78af, 0x0000, 0x78af, 0x2020, 0x1f04, 0x22ea, + 0x7003, 0x0000, 0x0016, 0xd18c, 0x2009, 0x0000, 0x0108, 0xc1bd, + 0x080c, 0x2422, 0x001e, 0x7020, 0xa084, 0x000f, 0xa085, 0x6300, + 0x7806, 0x780f, 0x9000, 0x7843, 0x00d8, 0x7853, 0x0090, 0x780b, + 0x2f08, 0x7452, 0x704f, 0x0000, 0x8109, 0x0140, 0x2071, 0x4540, + 0x2079, 0x0200, 0x2021, 0x45bf, 0x0804, 0x22c7, 0x080c, 0x24dc, + 0x0005, 0x0016, 0x2011, 0x0101, 0xd1bc, 0x1110, 0x2011, 0x0201, + 0xa18c, 0x000f, 0x2204, 0xa084, 0xfff0, 0xa105, 0x2012, 0x001e, + 0x080c, 0x2422, 0x0005, 0x2011, 0x0101, 0xd3fc, 0x1110, 0x2011, + 0x0201, 0x20a9, 0x0009, 0x810b, 0x1f04, 0x2333, 0xa18c, 0x0e00, + 0x2204, 0xa084, 0xf1ff, 0xa105, 0x2012, 0x0005, 0x2019, 0x0002, + 0x2009, 0x0101, 0x20a9, 0x0005, 0x8213, 0x1f04, 0x2344, 0xa294, + 0x00e0, 0x2104, 0xa084, 0xff1f, 0xa205, 0x200a, 0x8319, 0x0118, + 0x2009, 0x0201, 0x0c78, 0x0005, 0x2011, 0x0101, 0xd3fc, 0x1110, + 0x2011, 0x0201, 0x20a9, 0x000c, 0x810b, 0x1f04, 0x235c, 0xa18c, + 0xf000, 0x2204, 0xa084, 0x0fff, 0xa105, 0x2012, 0x0005, 0x2011, + 0x0102, 0xd3fc, 0x1110, 0x2011, 0x0202, 0x2204, 0xa084, 0xf0cf, + 0xa105, 0x2012, 0x0005, 0x00c6, 0x2061, 0x0100, 0xd1bc, 0x1110, + 0x2061, 0x0200, 0xc1bc, 0x8103, 0x8003, 0xa080, 0x0020, 0x609a, + 0x62ac, 0x63ac, 0x00ce, 0x0005, 0x00c6, 0x2061, 0x0100, 0xd1bc, + 0x1110, 0x2061, 0x0200, 0xc1bc, 0x8103, 0x8003, 0xa080, 0x0022, + 0x609a, 0x60a4, 0xa084, 0xffdf, 0x60ae, 0x00ce, 0x0005, 0x00c6, 0x2061, 0x0100, 0xd1bc, 0x1110, 0x2061, 0x0200, 0xc1bc, 0x8103, - 0x8003, 0xa080, 0x0022, 0x609a, 0x60a4, 0xa084, 0xffdf, 0x60ae, - 0x00ce, 0x0005, 0x00c6, 0x2061, 0x0100, 0xd1bc, 0x1110, 0x2061, - 0x0200, 0xc1bc, 0x8103, 0x8003, 0xa080, 0x0020, 0x609a, 0x60a4, - 0xa28c, 0x0020, 0x0118, 0xc2ac, 0xa39d, 0x4000, 0xc3ec, 0xd3b4, - 0x1108, 0xc3ed, 0x62ae, 0x2010, 0x60a4, 0x63ae, 0x2018, 0x00ce, - 0x0005, 0x2091, 0x8000, 0x00c6, 0x00e6, 0x6818, 0xa005, 0x0904, - 0x23a1, 0xd1fc, 0x0118, 0x2061, 0x8ad0, 0x0010, 0x2061, 0x89c0, - 0x080c, 0x23a9, 0x0538, 0x20a9, 0x0101, 0xd1fc, 0x0118, 0x2061, - 0x89d0, 0x0010, 0x2061, 0x88c0, 0x00c6, 0x04d9, 0x0128, 0x00ce, - 0x8c60, 0x1f04, 0x236c, 0x0468, 0x000e, 0xd1fc, 0x0128, 0xa082, - 0x89d0, 0x2071, 0x4380, 0x0020, 0xa082, 0x88c0, 0x2071, 0x4340, - 0x707a, 0x7176, 0x2001, 0x0004, 0x7066, 0x7083, 0x000f, 0x080c, - 0x2228, 0x00a0, 0xd1fc, 0x1118, 0x2071, 0x4340, 0x0010, 0x2071, - 0x4380, 0x6020, 0xc0dd, 0x6022, 0x7176, 0x2c00, 0x707e, 0x2001, - 0x0006, 0x7066, 0x7083, 0x000f, 0x080c, 0x2228, 0x2001, 0x0000, - 0x0010, 0x2001, 0x0001, 0x2091, 0x8001, 0xa005, 0x00ee, 0x00ce, - 0x0005, 0x2c04, 0xa005, 0x0170, 0x2060, 0x6010, 0xa306, 0x1140, - 0x600c, 0xa206, 0x1128, 0x6014, 0xa106, 0x1110, 0xa006, 0x0020, - 0x6000, 0x0c80, 0xa085, 0x0001, 0x0005, 0x00f6, 0x00e6, 0x0016, - 0x2079, 0x4380, 0x2071, 0x0100, 0xd1bc, 0x1120, 0x2079, 0x4340, - 0x2071, 0x0200, 0x7920, 0xa18c, 0x000f, 0x70ec, 0xd0c4, 0x1110, - 0x001e, 0x0060, 0x810b, 0x810b, 0x810b, 0x810b, 0x000e, 0xa18d, - 0x0800, 0xd0bc, 0x1110, 0xa18d, 0x0f00, 0x2104, 0x00ee, 0x00fe, - 0x0005, 0x00e6, 0x2001, 0x4301, 0x2004, 0xd0ac, 0x1904, 0x2439, - 0x68e4, 0xd0ac, 0x0904, 0x2439, 0xa084, 0x0006, 0x1904, 0x2439, - 0x6014, 0xd0fc, 0x1118, 0x2071, 0x47c0, 0x0010, 0x2071, 0x4840, - 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xae70, 0x7004, - 0xa084, 0x000a, 0x15b0, 0x7108, 0xa194, 0xff00, 0x0590, 0xa18c, - 0x00ff, 0x2001, 0x000a, 0xa106, 0x01a8, 0x2001, 0x000c, 0xa106, - 0x01a0, 0x2001, 0x0012, 0xa106, 0x0198, 0x2001, 0x0014, 0xa106, - 0x0190, 0x2001, 0x0019, 0xa106, 0x0188, 0x2001, 0x0032, 0xa106, - 0x0180, 0x0090, 0x2009, 0x000c, 0x0088, 0x2009, 0x0012, 0x0070, - 0x2009, 0x0014, 0x0058, 0x2009, 0x0019, 0x0040, 0x2009, 0x0020, - 0x0028, 0x2009, 0x003f, 0x0010, 0x2011, 0x0000, 0x2100, 0xa205, - 0x700a, 0x00ee, 0x0005, 0x0e04, 0x243b, 0x2091, 0x8000, 0x2071, + 0x8003, 0xa080, 0x0020, 0x609a, 0x60a4, 0xa28c, 0x0020, 0x0118, + 0xc2ac, 0xa39d, 0x4000, 0xc3ec, 0xd3b4, 0x1108, 0xc3ed, 0x62ae, + 0x2010, 0x60a4, 0x63ae, 0x2018, 0x00ce, 0x0005, 0x2091, 0x8000, + 0x00c6, 0x00e6, 0x6818, 0xa005, 0x0904, 0x2406, 0xd1fc, 0x0118, + 0x2061, 0x8cd0, 0x0010, 0x2061, 0x8bc0, 0x080c, 0x240e, 0x0538, + 0x20a9, 0x0101, 0xd1fc, 0x0118, 0x2061, 0x8bd0, 0x0010, 0x2061, + 0x8ac0, 0x00c6, 0x04d9, 0x0128, 0x00ce, 0x8c60, 0x1f04, 0x23d1, + 0x0468, 0x000e, 0xd1fc, 0x0128, 0xa082, 0x8bd0, 0x2071, 0x4580, + 0x0020, 0xa082, 0x8ac0, 0x2071, 0x4540, 0x7076, 0x7172, 0x2001, + 0x0004, 0x7062, 0x707f, 0x000f, 0x080c, 0x228b, 0x00a0, 0xd1fc, + 0x1118, 0x2071, 0x4540, 0x0010, 0x2071, 0x4580, 0x6020, 0xc0dd, + 0x6022, 0x7172, 0x2c00, 0x707a, 0x2001, 0x0006, 0x7062, 0x707f, + 0x000f, 0x080c, 0x228b, 0x2001, 0x0000, 0x0010, 0x2001, 0x0001, + 0x2091, 0x8001, 0xa005, 0x00ee, 0x00ce, 0x0005, 0x2c04, 0xa005, + 0x0170, 0x2060, 0x6010, 0xa306, 0x1140, 0x600c, 0xa206, 0x1128, + 0x6014, 0xa106, 0x1110, 0xa006, 0x0020, 0x6000, 0x0c80, 0xa085, + 0x0001, 0x0005, 0x00f6, 0x00e6, 0x0016, 0x2079, 0x4580, 0x2071, + 0x0100, 0xd1bc, 0x1120, 0x2079, 0x4540, 0x2071, 0x0200, 0x7920, + 0xa18c, 0x000f, 0x70ec, 0xd0c4, 0x1110, 0x001e, 0x0060, 0x810b, + 0x810b, 0x810b, 0x810b, 0x000e, 0xa18d, 0x0800, 0xd0bc, 0x1110, + 0xa18d, 0x0f00, 0x2104, 0x00ee, 0x00fe, 0x0005, 0x2001, 0x4501, + 0x2004, 0xd0ac, 0x1138, 0x68e4, 0xd0ac, 0x0120, 0xa084, 0x0006, + 0x1108, 0x0009, 0x0005, 0x6014, 0x00e6, 0x0036, 0x2018, 0x2071, + 0x4a40, 0xd0fc, 0x1110, 0x2071, 0x49c0, 0x8007, 0xa084, 0x000f, + 0x8003, 0x8003, 0x8003, 0xae70, 0x7004, 0xa084, 0x000a, 0x1904, + 0x24d9, 0x7108, 0xa194, 0xff00, 0x0904, 0x24d9, 0xa18c, 0x00ff, + 0x701c, 0xa084, 0xff00, 0x01c0, 0x7004, 0xa085, 0x003a, 0x7006, + 0x2001, 0x0009, 0xa102, 0x16d8, 0x2001, 0x000a, 0xa102, 0x16d0, + 0x2001, 0x000c, 0xa102, 0x16c8, 0x701c, 0xa084, 0x00ff, 0x701e, + 0x7004, 0xa084, 0xffdf, 0x7006, 0x2001, 0x000a, 0xa106, 0x01a8, + 0x2001, 0x000c, 0xa106, 0x01a0, 0x2001, 0x0012, 0xa106, 0x0198, + 0x2001, 0x0014, 0xa106, 0x0190, 0x2001, 0x0019, 0xa106, 0x0188, + 0x2001, 0x0032, 0xa106, 0x0180, 0x00d8, 0x2009, 0x000c, 0x00d0, + 0x2009, 0x0012, 0x00b8, 0x2009, 0x0014, 0x00a0, 0x2009, 0x0019, + 0x0088, 0x2009, 0x0020, 0x0070, 0x2009, 0x003f, 0x0058, 0x2009, + 0x000a, 0x0040, 0x2009, 0x000c, 0x0028, 0x2009, 0x0019, 0x0010, + 0x2011, 0x0000, 0x2100, 0xa205, 0x700a, 0x7004, 0xa085, 0x000a, + 0x7006, 0x2071, 0x4500, 0x7004, 0xd0bc, 0x0158, 0xd3fc, 0x1120, + 0x73ea, 0x2071, 0x4540, 0x0018, 0x73ee, 0x2071, 0x4580, 0x701f, + 0x800f, 0x003e, 0x00ee, 0x0005, 0x2001, 0x01ff, 0x2004, 0xd0fc, + 0x11d0, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x12a0, 0x2071, + 0x0200, 0x71ec, 0xa18c, 0x1c00, 0x810f, 0x810c, 0x810c, 0x2079, + 0x0100, 0x78ec, 0xa084, 0x1c00, 0x8007, 0x8004, 0x8004, 0xa105, + 0xa08a, 0x0007, 0x0208, 0x0005, 0x0002, 0x252a, 0x2511, 0x252a, + 0x2511, 0x2504, 0x251e, 0x2504, 0x7008, 0xa084, 0xc3ff, 0xa085, + 0x3000, 0x700a, 0x7808, 0xa084, 0xc3ff, 0xa085, 0x3000, 0x780a, + 0x0005, 0x7008, 0xa084, 0xc3ff, 0xa085, 0x2000, 0x700a, 0x7808, + 0xa084, 0xc3ff, 0xa085, 0x2000, 0x780a, 0x0005, 0x7008, 0xa084, + 0xc3ff, 0xa085, 0x0c00, 0x700a, 0x7808, 0xa084, 0xc3ff, 0xa085, + 0x0c00, 0x780a, 0x0005, 0x0e04, 0x252b, 0x2091, 0x8000, 0x2071, 0x0000, 0x0006, 0x7018, 0xd084, 0x1de8, 0x000e, 0x2071, 0x0010, - 0x70ca, 0x000e, 0x70c6, 0x70c3, 0x8002, 0x70db, 0x0a01, 0x70df, - 0x0013, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0cf8, - 0x7f3c, 0x7e58, 0x7c30, 0x7d38, 0x78a0, 0x708e, 0x7592, 0x7496, - 0x769a, 0x779e, 0xa594, 0x003f, 0xd4f4, 0x0138, 0xd7bc, 0x1128, - 0xa784, 0x007d, 0x1904, 0x3ace, 0x0871, 0xa49c, 0x000f, 0xa382, + 0x70ca, 0x000e, 0x70c6, 0x70c3, 0x8002, 0x70db, 0x0a04, 0x70df, + 0x0008, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0cf8, + 0x7f3c, 0x7e58, 0x7c30, 0x7d38, 0x78a0, 0x708a, 0x758e, 0x7492, + 0x7696, 0x779a, 0xa594, 0x003f, 0xd4f4, 0x0138, 0xd7bc, 0x1128, + 0xa784, 0x007d, 0x1904, 0x3c3a, 0x0871, 0xa49c, 0x000f, 0xa382, 0x0004, 0x0320, 0xa3a6, 0x0007, 0x1930, 0x2418, 0x8507, 0xa084, - 0x000f, 0x0002, 0x2a4f, 0x2b10, 0x2b38, 0x2d71, 0x30cc, 0x3112, - 0x31a7, 0x3220, 0x32db, 0x33a6, 0x248d, 0x248a, 0x285b, 0x295c, - 0x30a0, 0x248a, 0x080c, 0x243b, 0x0005, 0xa006, 0x0038, 0x7808, - 0xc08d, 0x780a, 0xa006, 0x7002, 0x704e, 0x7046, 0x70d2, 0x7060, - 0xa005, 0x1904, 0x25d9, 0x7064, 0xa084, 0x0007, 0x0002, 0x24a7, - 0x2513, 0x251b, 0x2524, 0x252d, 0x25bf, 0x2536, 0x2513, 0x7830, - 0xd0bc, 0x1d10, 0x71d4, 0xd1b4, 0x1904, 0x24f0, 0x70a4, 0xa086, - 0x0001, 0x09d0, 0x70b4, 0xa06d, 0x6800, 0xa065, 0xa055, 0x789b, - 0x0080, 0x6b0c, 0x7baa, 0x6808, 0xa045, 0x6d10, 0x6804, 0xa06d, - 0xa05d, 0xa886, 0x0001, 0x0118, 0x69bc, 0x7daa, 0x79aa, 0x68c0, - 0xa04d, 0x6e1c, 0x2001, 0x0010, 0x0804, 0x270a, 0x7060, 0xa005, - 0x1904, 0x248c, 0x00c6, 0x00d6, 0x70b4, 0xa06d, 0x6800, 0xa065, + 0x000f, 0x0002, 0x2b40, 0x2c01, 0x2c29, 0x2e64, 0x31f1, 0x3243, + 0x32e8, 0x3361, 0x341f, 0x34f6, 0x257d, 0x257a, 0x294d, 0x2a4d, + 0x31c5, 0x257a, 0x080c, 0x252b, 0x0005, 0xa006, 0x0038, 0x7808, + 0xc08d, 0x780a, 0xa006, 0x7002, 0x704a, 0x7042, 0x70ce, 0x705c, + 0xa005, 0x1904, 0x26cb, 0x7060, 0xa084, 0x0007, 0x0002, 0x2597, + 0x2605, 0x260d, 0x2616, 0x261f, 0x26b1, 0x2628, 0x2605, 0x7830, + 0xd0bc, 0x1d10, 0x71d0, 0xd1bc, 0x19f8, 0xd1b4, 0x1904, 0x25e2, + 0x70a0, 0xa086, 0x0001, 0x09c0, 0x70b0, 0xa06d, 0x6800, 0xa065, 0xa055, 0x789b, 0x0080, 0x6b0c, 0x7baa, 0x6808, 0xa045, 0x6d10, 0x6804, 0xa06d, 0xa05d, 0xa886, 0x0001, 0x0118, 0x69bc, 0x7daa, - 0x79aa, 0x68c0, 0xa04d, 0x6e1c, 0x2001, 0x0020, 0x0804, 0x270a, - 0x080c, 0x3a8d, 0x1904, 0x248c, 0x781b, 0x0068, 0x70bc, 0xa06d, + 0x79aa, 0x68c0, 0xa04d, 0x6e1c, 0x2001, 0x0010, 0x0804, 0x27fc, + 0x705c, 0xa005, 0x1904, 0x257c, 0x00c6, 0x00d6, 0x70b0, 0xa06d, + 0x6800, 0xa065, 0xa055, 0x789b, 0x0080, 0x6b0c, 0x7baa, 0x6808, + 0xa045, 0x6d10, 0x6804, 0xa06d, 0xa05d, 0xa886, 0x0001, 0x0118, + 0x69bc, 0x7daa, 0x79aa, 0x68c0, 0xa04d, 0x6e1c, 0x2001, 0x0020, + 0x0804, 0x27fc, 0x080c, 0x3bf9, 0x1904, 0x257c, 0x781b, 0x0068, + 0x70b8, 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, + 0x78d2, 0x78da, 0x7808, 0xc08d, 0x780a, 0x68bc, 0x703e, 0xc1b4, + 0x71d2, 0x70b4, 0xa065, 0x68c0, 0x7056, 0x7003, 0x0002, 0x2d00, + 0x704a, 0xad80, 0x0009, 0x7042, 0x0005, 0x080c, 0x3bf9, 0x1120, + 0x781b, 0x0054, 0x7003, 0x0004, 0x0005, 0x080c, 0x3bf9, 0x1128, + 0x2011, 0x000c, 0x0419, 0x7003, 0x0004, 0x0005, 0x080c, 0x3bf9, + 0x1128, 0x2011, 0x0006, 0x00d1, 0x7003, 0x0004, 0x0005, 0x080c, + 0x3bf9, 0x1128, 0x2011, 0x000d, 0x0089, 0x7003, 0x0004, 0x0005, + 0x080c, 0x3bf9, 0x1150, 0x2011, 0x0006, 0x0041, 0x7078, 0x707b, + 0x0000, 0x2068, 0x704a, 0x7003, 0x0001, 0x0005, 0x7170, 0xc1fc, + 0x8107, 0x7882, 0x789b, 0x0080, 0xa286, 0x000c, 0x1120, 0x7aaa, + 0x2001, 0x0001, 0x0098, 0xa18c, 0x001f, 0xa18d, 0x00c0, 0x79aa, + 0xa286, 0x000d, 0x0120, 0x7aaa, 0x2001, 0x0002, 0x0038, 0x78ab, + 0x0020, 0x7174, 0x79aa, 0x7aaa, 0x2001, 0x0004, 0x789b, 0x0060, + 0x78aa, 0x785b, 0x0004, 0x781b, 0x0113, 0x080c, 0x3c0c, 0x707f, + 0x000f, 0x70d0, 0xd0b4, 0x0168, 0xc0b4, 0x70d2, 0x00c6, 0x70b4, + 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, + 0x00ce, 0x0005, 0x7014, 0xa005, 0x1138, 0x70d0, 0xd0b4, 0x0128, + 0x70b4, 0xac06, 0x1110, 0x0c29, 0x0005, 0x0016, 0x71a0, 0xa186, + 0x0001, 0x0528, 0x00d6, 0x0026, 0x2100, 0x2011, 0x0001, 0xa212, + 0x70b0, 0x2068, 0x6800, 0xac06, 0x0120, 0x8211, 0x01b0, 0x00c9, + 0x0cc8, 0x00c6, 0x2100, 0x2011, 0x0001, 0xa212, 0x70b0, 0x2068, + 0x6800, 0x2060, 0x6008, 0xa084, 0xfbef, 0x600a, 0x8211, 0x0110, + 0x0041, 0x0cb0, 0x70a3, 0x0001, 0x00ce, 0x002e, 0x00de, 0x001e, + 0x0005, 0xade8, 0x0005, 0x70a8, 0xad06, 0x1110, 0x70a4, 0x2068, + 0x0005, 0x080c, 0x3bf9, 0x1904, 0x257c, 0x7078, 0x2068, 0x7770, + 0x080c, 0x3b35, 0x2c50, 0x080c, 0x3c94, 0x789b, 0x0080, 0x6814, + 0xa084, 0x001f, 0xc0bd, 0x78aa, 0x6e1c, 0x2041, 0x0001, 0x2001, + 0x0004, 0x0804, 0x2801, 0x080c, 0x3bf9, 0x1904, 0x257c, 0x789b, + 0x0080, 0x705c, 0x2068, 0x6f14, 0x70d0, 0xd0b4, 0x0168, 0xc0b4, + 0x70d2, 0x00c6, 0x70b4, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, + 0x6018, 0x8001, 0x601a, 0x00ce, 0x080c, 0x3b35, 0x2c50, 0x080c, + 0x3c94, 0x6824, 0xa005, 0x0130, 0xa082, 0x0006, 0x0208, 0x0010, + 0x6827, 0x0005, 0x6814, 0xa084, 0x001f, 0xc0bd, 0x78aa, 0x2031, + 0x0020, 0x2041, 0x0001, 0x2001, 0x0003, 0x0804, 0x2801, 0xc28d, + 0x72d2, 0x72bc, 0xa200, 0xa015, 0x7150, 0x8108, 0xa12a, 0x0208, + 0x71bc, 0x2164, 0x6504, 0x85ff, 0x1170, 0x7152, 0x8421, 0x1da8, + 0x70d0, 0xd08c, 0x0128, 0x70cc, 0xa005, 0x1110, 0x70cf, 0x000a, + 0x0005, 0x2200, 0x0c90, 0x70d0, 0xc08c, 0x70d2, 0x70cf, 0x0000, + 0x6034, 0xa005, 0x1db0, 0x6708, 0xa784, 0x073f, 0x01d0, 0xd7d4, + 0x1d80, 0xa784, 0x0021, 0x1d68, 0xa784, 0x0002, 0x0130, 0xa784, + 0x0004, 0x0d38, 0xa7bc, 0xfffb, 0x670a, 0xa784, 0x0218, 0x1d08, + 0xa784, 0x0100, 0x0130, 0x6018, 0xa005, 0x19d8, 0xa7bc, 0xfeff, + 0x670a, 0x2568, 0x6823, 0x0000, 0x6e1c, 0xa684, 0x000e, 0x6318, + 0x0128, 0x601c, 0xa302, 0x0220, 0x0118, 0x0858, 0x83ff, 0x1948, + 0x2d58, 0x2c50, 0x7152, 0xd7bc, 0x1110, 0x7028, 0x6022, 0xc7bc, + 0x670a, 0x68c0, 0xa065, 0xa04d, 0x6100, 0x2a60, 0x2041, 0x0001, + 0x6b14, 0xa39c, 0x001f, 0xa39d, 0x00c0, 0xd1fc, 0x0110, 0xd684, + 0x0110, 0xa39c, 0xffbf, 0xd6a4, 0x0110, 0xa39d, 0x0020, 0xa684, + 0x000e, 0x1904, 0x27b3, 0xc7a5, 0x670a, 0x2c00, 0x68c6, 0x77a0, + 0xa786, 0x0001, 0x1178, 0x70d0, 0xd0b4, 0x1160, 0x7000, 0xa082, + 0x0002, 0x1240, 0x7830, 0xd0bc, 0x1128, 0x789b, 0x0080, 0x7baa, + 0x0804, 0x27fa, 0x8739, 0x77a2, 0x2750, 0x77ac, 0xa7b0, 0x0005, + 0x70a8, 0xa606, 0x1108, 0x76a4, 0x76ae, 0x2c3a, 0x8738, 0x2d3a, + 0x8738, 0x283a, 0x8738, 0x233a, 0x8738, 0x253a, 0x7830, 0xd0bc, + 0x0150, 0x2091, 0x8000, 0x2091, 0x303d, 0x70d0, 0xa084, 0x303d, + 0x2091, 0x8000, 0x2090, 0xaad5, 0x0000, 0x0120, 0x8421, 0x2200, + 0x1904, 0x2704, 0x0005, 0xd1dc, 0x0904, 0x3796, 0x2029, 0x0020, + 0xd69c, 0x1120, 0x8528, 0xd68c, 0x1108, 0x8528, 0x8840, 0x6f14, + 0x610c, 0x8108, 0xa18c, 0x00ff, 0x70c8, 0xa160, 0x2c64, 0x8cff, + 0x0188, 0x6014, 0xa706, 0x1dd0, 0x60b8, 0x8001, 0x60ba, 0x1d88, + 0x2a60, 0x6008, 0xa085, 0x0100, 0x600a, 0x2200, 0x8421, 0x1904, + 0x2704, 0x0005, 0x2a60, 0x610e, 0x69be, 0x2c00, 0x68c6, 0x8840, + 0x6008, 0xc0d5, 0x600a, 0x77a0, 0xa786, 0x0001, 0x1904, 0x278a, + 0x70d0, 0xd0b4, 0x1904, 0x278a, 0x7000, 0xa082, 0x0002, 0x1a04, + 0x278a, 0x7830, 0xd0bc, 0x1904, 0x278a, 0x789b, 0x0080, 0x7baa, + 0x7daa, 0x79aa, 0x2001, 0x0002, 0x0006, 0x6018, 0x8000, 0x601a, + 0x0008, 0x0006, 0x2960, 0x6104, 0x2a60, 0x080c, 0x3ca7, 0x1590, + 0xa184, 0x0018, 0x0180, 0xa184, 0x0010, 0x0118, 0x080c, 0x393d, + 0x1548, 0xa184, 0x0008, 0x0138, 0x69a0, 0xa184, 0x0600, 0x1118, + 0x080c, 0x385d, 0x00f8, 0x69a0, 0xa184, 0x1e00, 0x0528, 0xa184, + 0x0800, 0x0178, 0x00c6, 0x2960, 0x6000, 0xa085, 0x2000, 0x6002, + 0x6104, 0xa18d, 0x0010, 0x6106, 0x00ce, 0x080c, 0x393d, 0x1150, + 0x69a0, 0xa184, 0x0200, 0x0118, 0x080c, 0x38a0, 0x0018, 0xa184, + 0x0400, 0x19f0, 0x69a0, 0xa184, 0x1000, 0x0130, 0x6914, 0xa18c, + 0xff00, 0x810f, 0x080c, 0x2384, 0x002e, 0xa68c, 0x00e0, 0xa684, + 0x0060, 0x0128, 0xa086, 0x0060, 0x1110, 0xa18d, 0x4000, 0xa18d, + 0x0104, 0x69b6, 0x789b, 0x0060, 0x2800, 0x78aa, 0x6818, 0xc0fd, + 0x681a, 0xd6bc, 0x0168, 0xc0fc, 0x7083, 0x0000, 0xa08a, 0x000d, + 0x0328, 0xa08a, 0x000c, 0x7182, 0x2001, 0x000c, 0x800c, 0x7186, + 0x78aa, 0x3518, 0x3340, 0x3428, 0x8000, 0x80ac, 0xaf80, 0x002b, + 0x20a0, 0x789b, 0x0000, 0xad80, 0x000b, 0x2098, 0x53a6, 0x23a8, + 0x2898, 0x25a0, 0xa286, 0x0020, 0x1508, 0x70d0, 0xc0b5, 0x70d2, + 0x2c00, 0x70b6, 0x2d00, 0x70ba, 0x6814, 0xc0fc, 0x8007, 0x7882, + 0xa286, 0x0002, 0x0904, 0x28d2, 0x70a0, 0x8000, 0x70a2, 0x74b0, + 0xa498, 0x0005, 0x70a8, 0xa306, 0x1108, 0x73a4, 0x73b2, 0xa286, + 0x0010, 0x0904, 0x257c, 0x00de, 0x00ce, 0x0005, 0x7000, 0xa005, + 0x19e0, 0xa286, 0x0002, 0x1904, 0x28e9, 0x080c, 0x3bf9, 0x19a8, + 0x6814, 0xc0fc, 0x8007, 0x7882, 0x2091, 0x8000, 0x781b, 0x0068, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, - 0x7808, 0xc08d, 0x780a, 0x68bc, 0x7042, 0xc1b4, 0x71d6, 0x70b8, - 0xa065, 0x68c0, 0x705a, 0x7003, 0x0002, 0x2d00, 0x704e, 0xad80, - 0x0009, 0x7046, 0x0005, 0x080c, 0x3a8d, 0x1120, 0x781b, 0x0054, - 0x7003, 0x0004, 0x0005, 0x080c, 0x3a8d, 0x1128, 0x2011, 0x000c, - 0x0419, 0x7003, 0x0004, 0x0005, 0x080c, 0x3a8d, 0x1128, 0x2011, - 0x0006, 0x00d1, 0x7003, 0x0004, 0x0005, 0x080c, 0x3a8d, 0x1128, - 0x2011, 0x000d, 0x0089, 0x7003, 0x0004, 0x0005, 0x080c, 0x3a8d, - 0x1150, 0x2011, 0x0006, 0x0041, 0x707c, 0x707f, 0x0000, 0x2068, - 0x704e, 0x7003, 0x0001, 0x0005, 0x7174, 0xc1fc, 0x8107, 0x7882, - 0x789b, 0x0080, 0xa286, 0x000c, 0x1120, 0x7aaa, 0x2001, 0x0001, - 0x0098, 0xa18c, 0x001f, 0xa18d, 0x00c0, 0x79aa, 0xa286, 0x000d, - 0x0120, 0x7aaa, 0x2001, 0x0002, 0x0038, 0x78ab, 0x0020, 0x7178, - 0x79aa, 0x7aaa, 0x2001, 0x0004, 0x789b, 0x0060, 0x78aa, 0x785b, - 0x0004, 0x781b, 0x0113, 0x080c, 0x3aa0, 0x7083, 0x000f, 0x70d4, - 0xd0b4, 0x0168, 0xc0b4, 0x70d6, 0x00c6, 0x70b8, 0xa065, 0x6008, - 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x00ce, 0x0005, - 0x7014, 0xa005, 0x1138, 0x70d4, 0xd0b4, 0x0128, 0x70b8, 0xac06, - 0x1110, 0x0c29, 0x0005, 0x0016, 0x71a4, 0xa186, 0x0001, 0x0528, - 0x00d6, 0x0026, 0x2100, 0x2011, 0x0001, 0xa212, 0x70b4, 0x2068, - 0x6800, 0xac06, 0x0120, 0x8211, 0x01b0, 0x00c9, 0x0cc8, 0x00c6, - 0x2100, 0x2011, 0x0001, 0xa212, 0x70b4, 0x2068, 0x6800, 0x2060, - 0x6008, 0xa084, 0xfbef, 0x600a, 0x8211, 0x0110, 0x0041, 0x0cb0, - 0x70a7, 0x0001, 0x00ce, 0x002e, 0x00de, 0x001e, 0x0005, 0xade8, - 0x0005, 0x70ac, 0xad06, 0x1110, 0x70a8, 0x2068, 0x0005, 0x080c, - 0x3a8d, 0x1904, 0x248c, 0x707c, 0x2068, 0x7774, 0x080c, 0x396d, - 0x2c50, 0x080c, 0x3b28, 0x789b, 0x0080, 0x6814, 0xa084, 0x001f, - 0xc0bd, 0x78aa, 0x6e1c, 0x2041, 0x0001, 0x2001, 0x0004, 0x0804, - 0x270f, 0x080c, 0x3a8d, 0x1904, 0x248c, 0x789b, 0x0080, 0x7060, - 0x2068, 0x6f14, 0x70d4, 0xd0b4, 0x0168, 0xc0b4, 0x70d6, 0x00c6, - 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, - 0x601a, 0x00ce, 0x080c, 0x396d, 0x2c50, 0x080c, 0x3b28, 0x6824, - 0xa005, 0x0130, 0xa082, 0x0006, 0x0208, 0x0010, 0x6827, 0x0005, - 0x6814, 0xa084, 0x001f, 0xc0bd, 0x78aa, 0x2031, 0x0020, 0x2041, - 0x0001, 0x2001, 0x0003, 0x0804, 0x270f, 0xc28d, 0x72d6, 0x72c0, - 0xa200, 0xa015, 0x7154, 0x8108, 0xa12a, 0x0208, 0x71c0, 0x2164, - 0x6504, 0x85ff, 0x1170, 0x7156, 0x8421, 0x1da8, 0x70d4, 0xd08c, - 0x0128, 0x70d0, 0xa005, 0x1110, 0x70d3, 0x000a, 0x0005, 0x2200, - 0x0c90, 0x70d4, 0xc08c, 0x70d6, 0x70d3, 0x0000, 0x6034, 0xa005, - 0x1db0, 0x6708, 0xa784, 0x073f, 0x01d0, 0xd7d4, 0x1d80, 0xa784, - 0x0021, 0x1d68, 0xa784, 0x0002, 0x0130, 0xa784, 0x0004, 0x0d38, - 0xa7bc, 0xfffb, 0x670a, 0xa784, 0x0218, 0x1d08, 0xa784, 0x0100, - 0x0130, 0x6018, 0xa005, 0x19d8, 0xa7bc, 0xfeff, 0x670a, 0x2568, - 0x6823, 0x0000, 0x6e1c, 0xa684, 0x000e, 0x6318, 0x0128, 0x601c, - 0xa302, 0x0220, 0x0118, 0x0858, 0x83ff, 0x1948, 0x2d58, 0x2c50, - 0x7156, 0xd7bc, 0x1110, 0x7028, 0x6022, 0xc7bc, 0x670a, 0x68c0, - 0xa065, 0xa04d, 0x6100, 0x2a60, 0x2041, 0x0001, 0x6b14, 0xa39c, - 0x001f, 0xa39d, 0x00c0, 0xd1fc, 0x0110, 0xd684, 0x0110, 0xa39c, - 0xffbf, 0xd6a4, 0x0110, 0xa39d, 0x0020, 0xa684, 0x000e, 0x1904, - 0x26c1, 0xc7a5, 0x670a, 0x2c00, 0x68c6, 0x77a4, 0xa786, 0x0001, - 0x1178, 0x70d4, 0xd0b4, 0x1160, 0x7000, 0xa082, 0x0002, 0x1240, - 0x7830, 0xd0bc, 0x1128, 0x789b, 0x0080, 0x7baa, 0x0804, 0x2708, - 0x8739, 0x77a6, 0x2750, 0x77b0, 0xa7b0, 0x0005, 0x70ac, 0xa606, - 0x1108, 0x76a8, 0x76b2, 0x2c3a, 0x8738, 0x2d3a, 0x8738, 0x283a, - 0x8738, 0x233a, 0x8738, 0x253a, 0x7830, 0xd0bc, 0x0150, 0x2091, - 0x8000, 0x2091, 0x303d, 0x70d4, 0xa084, 0x303d, 0x2091, 0x8000, - 0x2090, 0xaad5, 0x0000, 0x0120, 0x8421, 0x2200, 0x1904, 0x2612, - 0x0005, 0xd1dc, 0x0904, 0x35d5, 0x2029, 0x0020, 0xd69c, 0x1120, - 0x8528, 0xd68c, 0x1108, 0x8528, 0x8840, 0x6f14, 0x610c, 0x8108, - 0xa18c, 0x00ff, 0x70cc, 0xa160, 0x2c64, 0x8cff, 0x0188, 0x6014, - 0xa706, 0x1dd0, 0x60b8, 0x8001, 0x60ba, 0x1d88, 0x2a60, 0x6008, - 0xa085, 0x0100, 0x600a, 0x2200, 0x8421, 0x1904, 0x2612, 0x0005, - 0x2a60, 0x610e, 0x69be, 0x2c00, 0x68c6, 0x8840, 0x6008, 0xc0d5, - 0x600a, 0x77a4, 0xa786, 0x0001, 0x1904, 0x2698, 0x70d4, 0xd0b4, - 0x1904, 0x2698, 0x7000, 0xa082, 0x0002, 0x1a04, 0x2698, 0x7830, - 0xd0bc, 0x1904, 0x2698, 0x789b, 0x0080, 0x7baa, 0x7daa, 0x79aa, - 0x2001, 0x0002, 0x0006, 0x6018, 0x8000, 0x601a, 0x0008, 0x0006, - 0x2960, 0x6104, 0x2a60, 0x080c, 0x3b3b, 0x1590, 0xa184, 0x0018, - 0x0180, 0xa184, 0x0010, 0x0118, 0x080c, 0x3776, 0x1548, 0xa184, - 0x0008, 0x0138, 0x69a0, 0xa184, 0x0600, 0x1118, 0x080c, 0x3696, - 0x00f8, 0x69a0, 0xa184, 0x1e00, 0x0528, 0xa184, 0x0800, 0x0178, - 0x00c6, 0x2960, 0x6000, 0xa085, 0x2000, 0x6002, 0x6104, 0xa18d, - 0x0010, 0x6106, 0x00ce, 0x080c, 0x3776, 0x1150, 0x69a0, 0xa184, - 0x0200, 0x0118, 0x080c, 0x36d9, 0x0018, 0xa184, 0x0400, 0x19f0, - 0x69a0, 0xa184, 0x1000, 0x0130, 0x6914, 0xa18c, 0xff00, 0x810f, - 0x080c, 0x231f, 0x002e, 0xa68c, 0x00e0, 0xa684, 0x0060, 0x0128, - 0xa086, 0x0060, 0x1110, 0xa18d, 0x4000, 0xa18d, 0x0104, 0x69b6, - 0x789b, 0x0060, 0x2800, 0x78aa, 0x6818, 0xc0fd, 0x681a, 0xd6bc, - 0x0168, 0xc0fc, 0x7087, 0x0000, 0xa08a, 0x000d, 0x0328, 0xa08a, - 0x000c, 0x7186, 0x2001, 0x000c, 0x800c, 0x718a, 0x78aa, 0x3518, - 0x3340, 0x3428, 0x8000, 0x80ac, 0xaf80, 0x002b, 0x20a0, 0x789b, - 0x0000, 0xad80, 0x000b, 0x2098, 0x53a6, 0x23a8, 0x2898, 0x25a0, - 0xa286, 0x0020, 0x1508, 0x70d4, 0xc0b5, 0x70d6, 0x2c00, 0x70ba, - 0x2d00, 0x70be, 0x6814, 0xc0fc, 0x8007, 0x7882, 0xa286, 0x0002, - 0x0904, 0x27e0, 0x70a4, 0x8000, 0x70a6, 0x74b4, 0xa498, 0x0005, - 0x70ac, 0xa306, 0x1108, 0x73a8, 0x73b6, 0xa286, 0x0010, 0x0904, - 0x248c, 0x00de, 0x00ce, 0x0005, 0x7000, 0xa005, 0x19e0, 0xa286, - 0x0002, 0x1904, 0x27f7, 0x080c, 0x3a8d, 0x19a8, 0x6814, 0xc0fc, - 0x8007, 0x7882, 0x2091, 0x8000, 0x781b, 0x0068, 0x68b4, 0x785a, - 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0x2091, 0x8001, - 0x7808, 0xc08d, 0x780a, 0x0126, 0x00d6, 0x00c6, 0x70d4, 0xa084, - 0x2e00, 0x2090, 0x00ce, 0x00de, 0x012e, 0x2900, 0x705a, 0x68bc, - 0x7042, 0x7003, 0x0002, 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, - 0x7830, 0xd0bc, 0x0140, 0x2091, 0x303d, 0x70d4, 0xa084, 0x303d, - 0x2091, 0x8000, 0x2090, 0x70a4, 0xa005, 0x1108, 0x0005, 0x8421, - 0x0de8, 0x7250, 0x70c0, 0xa200, 0xa015, 0x0804, 0x2612, 0xa286, - 0x0010, 0x1560, 0x080c, 0x3a8d, 0x1904, 0x278b, 0x6814, 0xc0fc, - 0x8007, 0x7882, 0x781b, 0x0068, 0x68b4, 0x785a, 0x6894, 0x78d6, - 0x78de, 0x6898, 0x78d2, 0x78da, 0x7808, 0xc08d, 0x780a, 0x70a4, - 0x8000, 0x70a6, 0x74b4, 0xa490, 0x0005, 0x70ac, 0xa206, 0x1108, - 0x72a8, 0x72b6, 0x2900, 0x705a, 0x68bc, 0x7042, 0x7003, 0x0002, - 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, 0x0005, 0x6bb4, 0xa39d, - 0x2000, 0x7b5a, 0x6814, 0xc0fc, 0x8007, 0x7882, 0x6b94, 0x7bd6, - 0x7bde, 0x6e98, 0x7ed2, 0x7eda, 0x781b, 0x0068, 0x2900, 0x705a, - 0x7202, 0x7808, 0xc08d, 0x780a, 0x2300, 0xa605, 0x0170, 0x70d4, - 0xa084, 0x2e00, 0xa086, 0x2600, 0x1118, 0x2009, 0x0000, 0x0010, - 0x2009, 0x0001, 0xa284, 0x000f, 0x0023, 0xad80, 0x0009, 0x7046, - 0x0005, 0x2859, 0x3fb8, 0x3fb8, 0x3fa6, 0x3fb8, 0x2859, 0x2859, - 0x2859, 0x080c, 0x243b, 0x7808, 0xa084, 0xfffd, 0x780a, 0x00f6, - 0x2079, 0x4300, 0x78ac, 0x00fe, 0xd084, 0x01c0, 0x7064, 0xa086, - 0x0001, 0x1118, 0x7066, 0x0804, 0x293a, 0x7064, 0xa086, 0x0005, - 0x1158, 0x707c, 0x2068, 0x681b, 0x0004, 0x6817, 0x0000, 0x6820, - 0xa084, 0x00ff, 0xc09d, 0x6822, 0x7067, 0x0000, 0x70a7, 0x0000, - 0x70a8, 0x70b2, 0x70b6, 0x080c, 0x256f, 0x0156, 0x2011, 0x0004, - 0x7164, 0xa186, 0x0001, 0x0170, 0xa186, 0x0007, 0x1118, 0x701f, - 0x0005, 0x0040, 0x701f, 0x0001, 0x7067, 0x0000, 0x70d4, 0xc0c5, - 0x70d6, 0x0010, 0x7067, 0x0000, 0x2001, 0x430a, 0x2004, 0xa084, - 0x00ff, 0xa086, 0x0018, 0x0130, 0x7018, 0x7016, 0xa005, 0x1110, - 0x70a7, 0x0001, 0x0066, 0x080c, 0x3d52, 0x20a9, 0x0010, 0x2039, - 0x0000, 0x080c, 0x3861, 0xa7b8, 0x0100, 0x1f04, 0x28b1, 0x006e, - 0x7000, 0x0002, 0x28ee, 0x28cc, 0x28cc, 0x28c4, 0x28ee, 0x28ee, - 0x28ee, 0x28c2, 0x080c, 0x243b, 0x7060, 0xa005, 0x0538, 0xad06, - 0x1118, 0x6800, 0x7062, 0x0080, 0x6820, 0xd084, 0x1148, 0x6f14, - 0x080c, 0x396d, 0x6008, 0xc0d4, 0x600a, 0x080c, 0x35ab, 0x0020, - 0x705c, 0x2060, 0x6800, 0x6002, 0xa684, 0x5f00, 0x681e, 0x6818, - 0xd0fc, 0x0108, 0x6a1a, 0x6817, 0x0000, 0x682b, 0x0000, 0x6820, - 0xa084, 0x00ff, 0xc09d, 0x6822, 0x080c, 0x1d3d, 0xb284, 0x0800, - 0x0118, 0x2021, 0x8ad0, 0x0010, 0x2021, 0x89c0, 0x080c, 0x293f, - 0xb284, 0x0800, 0x0118, 0x2021, 0x4398, 0x0010, 0x2021, 0x4358, - 0x04f1, 0x20a9, 0x0101, 0xb284, 0x0800, 0x0118, 0x2021, 0x89d0, - 0x0010, 0x2021, 0x88c0, 0x0499, 0x8420, 0x1f04, 0x290b, 0xb284, - 0x0600, 0x0118, 0x2061, 0x48c0, 0x0010, 0x2061, 0x68c0, 0x2021, - 0x0002, 0x20a9, 0x0100, 0x6110, 0x81ff, 0x0198, 0x6018, 0x0016, - 0x0006, 0x2011, 0x4302, 0x220c, 0xa102, 0x2012, 0x000e, 0x001e, - 0xa102, 0x0338, 0x6012, 0x1128, 0x2011, 0x4304, 0x2204, 0xc0a5, - 0x2012, 0x601b, 0x0000, 0xace0, 0x0010, 0x1f04, 0x291b, 0x8421, - 0x1d00, 0x015e, 0x7003, 0x0000, 0x704f, 0x0000, 0x0005, 0x0046, - 0x2404, 0xa005, 0x01a8, 0x2068, 0x6800, 0x0006, 0x6a1a, 0x6817, + 0x2091, 0x8001, 0x7808, 0xc08d, 0x780a, 0x0126, 0x00d6, 0x00c6, + 0x70d0, 0xa084, 0x2e00, 0x2090, 0x00ce, 0x00de, 0x012e, 0x2900, + 0x7056, 0x68bc, 0x703e, 0x7003, 0x0002, 0x2d00, 0x704a, 0xad80, + 0x0009, 0x7042, 0x7830, 0xd0bc, 0x0140, 0x2091, 0x303d, 0x70d0, + 0xa084, 0x303d, 0x2091, 0x8000, 0x2090, 0x70a0, 0xa005, 0x1108, + 0x0005, 0x8421, 0x0de8, 0x724c, 0x70bc, 0xa200, 0xa015, 0x0804, + 0x2704, 0xa286, 0x0010, 0x1560, 0x080c, 0x3bf9, 0x1904, 0x287d, + 0x6814, 0xc0fc, 0x8007, 0x7882, 0x781b, 0x0068, 0x68b4, 0x785a, + 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0x7808, 0xc08d, + 0x780a, 0x70a0, 0x8000, 0x70a2, 0x74b0, 0xa490, 0x0005, 0x70a8, + 0xa206, 0x1108, 0x72a4, 0x72b2, 0x2900, 0x7056, 0x68bc, 0x703e, + 0x7003, 0x0002, 0x2d00, 0x704a, 0xad80, 0x0009, 0x7042, 0x0005, + 0x6bb4, 0xa39d, 0x2000, 0x7b5a, 0x6814, 0xc0fc, 0x8007, 0x7882, + 0x6b94, 0x7bd6, 0x7bde, 0x6e98, 0x7ed2, 0x7eda, 0x781b, 0x0068, + 0x2900, 0x7056, 0x7202, 0x7808, 0xc08d, 0x780a, 0x2300, 0xa605, + 0x0170, 0x70d0, 0xa084, 0x2e00, 0xa086, 0x2600, 0x1118, 0x2009, + 0x0000, 0x0010, 0x2009, 0x0001, 0xa284, 0x000f, 0x0023, 0xad80, + 0x0009, 0x7042, 0x0005, 0x294b, 0x4180, 0x4180, 0x416e, 0x4180, + 0x294b, 0x294b, 0x294b, 0x080c, 0x252b, 0x7808, 0xa084, 0xfffd, + 0x780a, 0x00f6, 0x2079, 0x4500, 0x78ac, 0x00fe, 0xd084, 0x01b0, + 0x7060, 0xa086, 0x0001, 0x0904, 0x2a29, 0x7060, 0xa086, 0x0005, + 0x1158, 0x7078, 0x2068, 0x681b, 0x0004, 0x6817, 0x0000, 0x6820, + 0xa084, 0x00ff, 0xc09d, 0x6822, 0x7063, 0x0000, 0x70a3, 0x0000, + 0x70a4, 0x70ae, 0x70b2, 0x080c, 0x2661, 0x0156, 0x2011, 0x0004, + 0x7160, 0xa186, 0x0001, 0x0160, 0xa186, 0x0007, 0x1118, 0x701f, + 0x0005, 0x0030, 0x701f, 0x0001, 0x70d0, 0xc0c5, 0x70d2, 0x0000, + 0x2001, 0x450a, 0x2004, 0xa084, 0x00ff, 0xa086, 0x0018, 0x0130, + 0x7018, 0x7016, 0xa005, 0x1110, 0x70a3, 0x0001, 0x0066, 0x080c, + 0x3ed9, 0x20a9, 0x0010, 0x2039, 0x0000, 0x080c, 0x3a29, 0xa7b8, + 0x0100, 0x1f04, 0x299d, 0x006e, 0x7000, 0x0002, 0x29da, 0x29b8, + 0x29b8, 0x29b0, 0x29da, 0x29da, 0x29da, 0x29ae, 0x080c, 0x252b, + 0x705c, 0xa005, 0x0538, 0xad06, 0x1118, 0x6800, 0x705e, 0x0080, + 0x6820, 0xd084, 0x1148, 0x6f14, 0x080c, 0x3b35, 0x6008, 0xc0d4, + 0x600a, 0x080c, 0x376c, 0x0020, 0x7058, 0x2060, 0x6800, 0x6002, + 0xa684, 0x5f00, 0x681e, 0x6818, 0xd0fc, 0x0108, 0x6a1a, 0x6817, + 0x0000, 0x682b, 0x0000, 0x6820, 0xa084, 0x00ff, 0xc09d, 0x6822, + 0x080c, 0x1d89, 0x2011, 0x0004, 0xb284, 0x0800, 0x0118, 0x2021, + 0x8cd0, 0x0010, 0x2021, 0x8bc0, 0x080c, 0x2a30, 0xb284, 0x0800, + 0x0118, 0x2021, 0x4597, 0x0010, 0x2021, 0x4557, 0x080c, 0x2a30, + 0x20a9, 0x0101, 0xb284, 0x0800, 0x0118, 0x2021, 0x8bd0, 0x0010, + 0x2021, 0x8ac0, 0x04a9, 0x8420, 0x1f04, 0x29fa, 0xb284, 0x0600, + 0x0118, 0x2061, 0x4ac0, 0x0010, 0x2061, 0x6ac0, 0x2021, 0x0002, + 0x20a9, 0x0100, 0x6110, 0x81ff, 0x0198, 0x6018, 0x0016, 0x0006, + 0x2011, 0x4502, 0x220c, 0xa102, 0x2012, 0x000e, 0x001e, 0xa102, + 0x0338, 0x6012, 0x1128, 0x2011, 0x4504, 0x2204, 0xc0a5, 0x2012, + 0x601b, 0x0000, 0xace0, 0x0010, 0x1f04, 0x2a0a, 0x8421, 0x1d00, + 0x015e, 0x7063, 0x0000, 0x7003, 0x0000, 0x704b, 0x0000, 0x0005, + 0x0046, 0x2404, 0xa005, 0x01a8, 0x2068, 0x6800, 0x0006, 0x6a1a, + 0x6817, 0x0000, 0x682b, 0x0000, 0x68b4, 0xa084, 0x5f00, 0x681e, + 0x6820, 0xa084, 0x00ff, 0xc09d, 0x6822, 0x080c, 0x1d89, 0x000e, + 0x0c48, 0x004e, 0x2023, 0x0000, 0x0005, 0xa282, 0x0003, 0x0310, + 0x080c, 0x252b, 0x2300, 0x0002, 0x2a57, 0x2ad4, 0x2aee, 0xa282, + 0x0002, 0x0110, 0x080c, 0x252b, 0x7060, 0x7063, 0x0000, 0x707f, + 0x0000, 0x0022, 0x77d0, 0xc7c5, 0x77d2, 0x0002, 0x2a6e, 0x2a6e, + 0x2a70, 0x2aa8, 0x37a0, 0x2a6e, 0x2aa8, 0x2a6e, 0x080c, 0x252b, + 0x7770, 0x080c, 0x3a29, 0x7770, 0xa7bc, 0x8f00, 0x080c, 0x3b35, + 0x6018, 0xa005, 0x0528, 0xd7fc, 0x1118, 0x2021, 0x8bc0, 0x0010, + 0x2021, 0x8cd0, 0x2009, 0x0005, 0x2011, 0x0010, 0x080c, 0x2b08, + 0x01b8, 0x0156, 0x20a9, 0x0101, 0xd7fc, 0x1118, 0x2021, 0x8ac0, + 0x0010, 0x2021, 0x8bd0, 0x0046, 0x2009, 0x0005, 0x2011, 0x0010, + 0x080c, 0x2b08, 0x004e, 0x0118, 0x8420, 0x1f04, 0x2a93, 0x015e, + 0x8738, 0xa784, 0x001f, 0x1990, 0x0804, 0x257f, 0x0804, 0x257f, + 0x7770, 0x080c, 0x3b35, 0x6018, 0xa005, 0x0520, 0xd7fc, 0x1118, + 0x2021, 0x8bc0, 0x0010, 0x2021, 0x8cd0, 0x2009, 0x0005, 0x2011, + 0x0020, 0x080c, 0x2b08, 0x01b0, 0x0156, 0x20a9, 0x0101, 0xd7fc, + 0x1118, 0x2021, 0x8ac0, 0x0010, 0x2021, 0x8bd0, 0x0046, 0x2009, + 0x0005, 0x2011, 0x0020, 0x04e1, 0x004e, 0x0118, 0x8420, 0x1f04, + 0x2ac6, 0x015e, 0x0804, 0x257f, 0x2200, 0x0002, 0x2ad9, 0x2adb, + 0x2adb, 0x080c, 0x252b, 0x2009, 0x0012, 0x7060, 0xa086, 0x0002, + 0x0110, 0x2009, 0x000e, 0x6818, 0xd0fc, 0x0108, 0x691a, 0x7063, + 0x0000, 0x70d0, 0xc0c5, 0x70d2, 0x0804, 0x3bab, 0x2200, 0x0002, + 0x2af5, 0x2adb, 0x2af3, 0x080c, 0x252b, 0x080c, 0x3ed9, 0x7000, + 0xa086, 0x0002, 0x1904, 0x3725, 0x080c, 0x3786, 0x6008, 0xa084, + 0xfbef, 0x600a, 0x080c, 0x3717, 0x0904, 0x3725, 0x0804, 0x257f, + 0x2404, 0xa005, 0x0590, 0x2068, 0x2d04, 0x0006, 0x6814, 0xa706, + 0x0118, 0x2d20, 0x000e, 0x0ca8, 0x000e, 0x2022, 0x691a, 0x6817, 0x0000, 0x682b, 0x0000, 0x68b4, 0xa084, 0x5f00, 0x681e, 0x6820, - 0xa084, 0x00ff, 0xc09d, 0x6822, 0x080c, 0x1d3d, 0x000e, 0x0c48, - 0x004e, 0x2023, 0x0000, 0x0005, 0xa282, 0x0003, 0x0310, 0x080c, - 0x243b, 0x2300, 0x0002, 0x2966, 0x29e3, 0x29fd, 0xa282, 0x0002, - 0x0110, 0x080c, 0x243b, 0x7064, 0x7067, 0x0000, 0x7083, 0x0000, - 0x0022, 0x77d4, 0xc7c5, 0x77d6, 0x0002, 0x297d, 0x297d, 0x297f, - 0x29b7, 0x35df, 0x297d, 0x29b7, 0x297d, 0x080c, 0x243b, 0x7774, - 0x080c, 0x3861, 0x7774, 0xa7bc, 0x8f00, 0x080c, 0x396d, 0x6018, - 0xa005, 0x0528, 0xd7fc, 0x1118, 0x2021, 0x89c0, 0x0010, 0x2021, - 0x8ad0, 0x2009, 0x0005, 0x2011, 0x0010, 0x080c, 0x2a17, 0x01b8, - 0x0156, 0x20a9, 0x0101, 0xd7fc, 0x1118, 0x2021, 0x88c0, 0x0010, - 0x2021, 0x89d0, 0x0046, 0x2009, 0x0005, 0x2011, 0x0010, 0x080c, - 0x2a17, 0x004e, 0x0118, 0x8420, 0x1f04, 0x29a2, 0x015e, 0x8738, - 0xa784, 0x001f, 0x1990, 0x0804, 0x248f, 0x0804, 0x248f, 0x7774, - 0x080c, 0x396d, 0x6018, 0xa005, 0x0520, 0xd7fc, 0x1118, 0x2021, - 0x89c0, 0x0010, 0x2021, 0x8ad0, 0x2009, 0x0005, 0x2011, 0x0020, - 0x080c, 0x2a17, 0x01b0, 0x0156, 0x20a9, 0x0101, 0xd7fc, 0x1118, - 0x2021, 0x88c0, 0x0010, 0x2021, 0x89d0, 0x0046, 0x2009, 0x0005, - 0x2011, 0x0020, 0x04e1, 0x004e, 0x0118, 0x8420, 0x1f04, 0x29d5, - 0x015e, 0x0804, 0x248f, 0x2200, 0x0002, 0x29e8, 0x29ea, 0x29ea, - 0x080c, 0x243b, 0x2009, 0x0012, 0x7064, 0xa086, 0x0002, 0x0110, - 0x2009, 0x000e, 0x6818, 0xd0fc, 0x0108, 0x691a, 0x7067, 0x0000, - 0x70d4, 0xc0c5, 0x70d6, 0x0804, 0x3a3f, 0x2200, 0x0002, 0x2a04, - 0x29ea, 0x2a02, 0x080c, 0x243b, 0x080c, 0x3d52, 0x7000, 0xa086, - 0x0002, 0x1904, 0x356d, 0x080c, 0x35c5, 0x6008, 0xa084, 0xfbef, - 0x600a, 0x080c, 0x355f, 0x0904, 0x356d, 0x0804, 0x248f, 0x2404, - 0xa005, 0x0590, 0x2068, 0x2d04, 0x0006, 0x6814, 0xa706, 0x0118, - 0x2d20, 0x000e, 0x0ca8, 0x000e, 0x2022, 0x691a, 0x6817, 0x0000, - 0x682b, 0x0000, 0x68b4, 0xa084, 0x5f00, 0x681e, 0x6820, 0xa084, - 0x00ff, 0xa205, 0x6822, 0x080c, 0x1d3d, 0x2021, 0x4302, 0x241c, - 0x8319, 0x2322, 0x6010, 0x8001, 0x6012, 0x1128, 0x2021, 0x4304, - 0x2404, 0xc0a5, 0x2022, 0x6008, 0xa084, 0xf9ef, 0x600a, 0x080c, - 0x258b, 0x080c, 0x35c5, 0x0005, 0xa085, 0x0001, 0x0ce0, 0x2300, - 0x0002, 0x2a56, 0x2a54, 0x2abc, 0x080c, 0x243b, 0x78e4, 0xa005, - 0x1708, 0x3208, 0xa18c, 0x0800, 0x0118, 0x0104, 0x248c, 0x0010, - 0x0304, 0x248c, 0x2008, 0xa084, 0x0030, 0x1110, 0x0804, 0x30a0, - 0x78ec, 0xa084, 0x0003, 0x0dd0, 0x2100, 0xa084, 0x0007, 0x0002, - 0x2a9f, 0x2aa8, 0x2a95, 0x2a78, 0x3a83, 0x3a83, 0x2a78, 0x2ab2, - 0x080c, 0x243b, 0x7000, 0xa086, 0x0004, 0x1190, 0x7064, 0xa086, - 0x0002, 0x1130, 0x2011, 0x0002, 0x2019, 0x0000, 0x0804, 0x295c, - 0x7064, 0xa086, 0x0006, 0x0db0, 0x7064, 0xa086, 0x0004, 0x0d90, - 0x79e4, 0x2001, 0x0003, 0x0804, 0x2daa, 0x6818, 0xd0fc, 0x0110, - 0x681b, 0x001d, 0x080c, 0x3837, 0x781b, 0x006e, 0x0005, 0x6818, - 0xd0fc, 0x0110, 0x681b, 0x001d, 0x080c, 0x3837, 0x0804, 0x3a61, - 0x6818, 0xd0fc, 0x0110, 0x681b, 0x001d, 0x080c, 0x3837, 0x781b, - 0x00fa, 0x0005, 0x6818, 0xd0fc, 0x0110, 0x681b, 0x001d, 0x080c, - 0x3837, 0x781b, 0x00cb, 0x0005, 0xa584, 0x000f, 0x11c0, 0x7000, - 0x0002, 0x248f, 0x2ac9, 0x2acb, 0x356d, 0x356d, 0x356d, 0x2ac9, - 0x2ac9, 0x080c, 0x243b, 0x080c, 0x35c5, 0x6008, 0xa084, 0xfbef, - 0x600a, 0x080c, 0x355f, 0x0904, 0x356d, 0x0804, 0x248f, 0x78e4, - 0xa005, 0x1b04, 0x2a7a, 0x3208, 0xa18c, 0x0800, 0x0118, 0x0104, - 0x2a7a, 0x0010, 0x0304, 0x2a7a, 0x2008, 0xa084, 0x0030, 0x1118, - 0x781b, 0x0068, 0x0005, 0x78ec, 0xa084, 0x0003, 0x0dc8, 0x2100, - 0xa184, 0x0007, 0x0002, 0x2b02, 0x2b06, 0x2afd, 0x2afb, 0x3a83, - 0x3a83, 0x2afb, 0x3a7d, 0x080c, 0x243b, 0x080c, 0x383d, 0x781b, - 0x006e, 0x0005, 0x080c, 0x383d, 0x0804, 0x3a61, 0x080c, 0x383d, - 0x781b, 0x00fa, 0x0005, 0x080c, 0x383d, 0x781b, 0x00cb, 0x0005, - 0x2300, 0x0002, 0x2b17, 0x2b15, 0x2b19, 0x080c, 0x243b, 0x0804, - 0x3220, 0x681b, 0x0016, 0x78a3, 0x0000, 0x79e4, 0xa184, 0x0030, - 0x0904, 0x3220, 0x78ec, 0xa084, 0x0003, 0x0904, 0x3220, 0xa184, - 0x0100, 0x0d98, 0xa184, 0x0007, 0x0002, 0x2b35, 0x2b06, 0x2a95, - 0x3a3f, 0x3a83, 0x3a83, 0x3a3f, 0x3a7d, 0x080c, 0x3a4b, 0x0005, - 0xa282, 0x0005, 0x0310, 0x080c, 0x243b, 0x7898, 0x2040, 0x2300, - 0x0002, 0x2b44, 0x2d41, 0x2d4b, 0x2200, 0x0002, 0x2b60, 0x2b4d, - 0x2b60, 0x2b4b, 0x2d25, 0x080c, 0x243b, 0x789b, 0x0018, 0x78a8, - 0x2010, 0xa084, 0x00ff, 0xa082, 0x0020, 0x0a04, 0x3809, 0xa08a, - 0x0004, 0x1a04, 0x3809, 0x0002, 0x3809, 0x3809, 0x3809, 0x37bf, - 0x789b, 0x0018, 0x79a8, 0xa184, 0x0080, 0x0148, 0x0804, 0x3809, - 0x7000, 0xa005, 0x1dd8, 0x2011, 0x0004, 0x0804, 0x33b2, 0xa184, - 0x00ff, 0xa08a, 0x0010, 0x1a04, 0x3809, 0x0002, 0x2b88, 0x2b86, - 0x2b9a, 0x2b9e, 0x2c3c, 0x3809, 0x3809, 0x2c3e, 0x3809, 0x3809, - 0x2d21, 0x2d21, 0x3809, 0x3809, 0x3809, 0x2d23, 0x080c, 0x243b, - 0xd6e4, 0x0140, 0x2001, 0x0300, 0x8000, 0x8000, 0x783a, 0x781b, - 0x00c6, 0x0005, 0x6818, 0xd0fc, 0x0118, 0x681b, 0x001d, 0x0c90, - 0x0804, 0x3a3f, 0x681b, 0x001d, 0x0804, 0x3831, 0x6920, 0x6922, - 0xa684, 0x1800, 0x15e0, 0x6820, 0xd084, 0x1904, 0x2be7, 0x6818, - 0xa086, 0x0008, 0x1110, 0x681b, 0x0000, 0xd6d4, 0x0568, 0xd6bc, - 0x0558, 0x7087, 0x0000, 0x6818, 0xa084, 0x003f, 0xa08a, 0x000d, - 0x0718, 0xa08a, 0x000c, 0x7186, 0x2001, 0x000c, 0x800c, 0x718a, - 0x789b, 0x0061, 0x78aa, 0x0156, 0x0136, 0x0146, 0x0016, 0x3208, - 0xa18c, 0x0600, 0x0118, 0x20a1, 0x022b, 0x0010, 0x20a1, 0x012b, - 0x001e, 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, - 0x53a6, 0x014e, 0x013e, 0x015e, 0x781b, 0x0071, 0x0005, 0xd6e4, - 0x0130, 0x781b, 0x0083, 0x0005, 0x781b, 0x0083, 0x0005, 0xa684, - 0x0060, 0x0dd0, 0xd6dc, 0x0dc0, 0xd6fc, 0x01a0, 0xc6fc, 0x7e5a, - 0x6eb6, 0x7adc, 0x79d8, 0x78d0, 0x8007, 0xa084, 0x007f, 0xa108, - 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, - 0xa303, 0x68ae, 0xd6f4, 0x0118, 0xc6f4, 0x7e5a, 0x6eb6, 0x7000, - 0xa086, 0x0003, 0x1148, 0x0006, 0x080c, 0x3d52, 0x080c, 0x3fb8, - 0x000e, 0x781b, 0x0080, 0x0005, 0xa006, 0x080c, 0x4083, 0x6ab0, - 0x69ac, 0x6c98, 0x6b94, 0x2200, 0xa105, 0x0120, 0x2200, 0xa422, - 0x2100, 0xa31b, 0x6caa, 0x7cd2, 0x7cda, 0x6ba6, 0x7bd6, 0x7bde, - 0x2300, 0xa405, 0x1130, 0xc6f5, 0x7e5a, 0x6eb6, 0x781b, 0x0080, - 0x0005, 0x781b, 0x0080, 0x2200, 0xa115, 0x1118, 0x080c, 0x3fb8, - 0x0005, 0x080c, 0x3fe5, 0x0005, 0x080c, 0x243b, 0x0804, 0x2cbd, - 0x00c6, 0x7058, 0x2060, 0x7aa8, 0xa294, 0x00ff, 0xa286, 0x0004, - 0x11d8, 0x6920, 0xd1e4, 0x1170, 0x2039, 0x0000, 0x2041, 0x0000, - 0x2031, 0x0000, 0xa006, 0x2010, 0x080c, 0x36f6, 0x080c, 0x379a, - 0x0804, 0x2cb1, 0xa18c, 0xecff, 0x6922, 0x6104, 0xa18c, 0xffdd, - 0x6106, 0x6000, 0xc0ac, 0x6002, 0xa286, 0x0003, 0x01d0, 0x6104, - 0xa18c, 0x0010, 0x0548, 0x080c, 0x3969, 0x080c, 0x3776, 0x88ff, - 0x0518, 0x00ce, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, 0xc695, - 0x7e5a, 0xd6d4, 0x1118, 0x781b, 0x006e, 0x0005, 0x781b, 0x0082, - 0x0005, 0x6920, 0xd1cc, 0x0130, 0xa18c, 0xfdff, 0x6922, 0x6000, - 0xc0ec, 0x6002, 0x2039, 0x0000, 0x2041, 0x0000, 0x2031, 0x0000, - 0xa006, 0x2010, 0x080c, 0x379a, 0xa286, 0x0001, 0x0158, 0x6104, - 0xa18c, 0x0008, 0x01b0, 0x080c, 0x3969, 0x080c, 0x3696, 0x88ff, - 0x1980, 0x0078, 0x6920, 0xd1c4, 0x0130, 0xa18c, 0xfeff, 0x6922, - 0x6000, 0xc0e4, 0x6002, 0x2031, 0x0000, 0xa006, 0x2010, 0x080c, - 0x36f6, 0x00ce, 0x7e58, 0xd6d4, 0x1118, 0x781b, 0x0071, 0x0005, - 0x781b, 0x0083, 0x0005, 0x0804, 0x382d, 0x2808, 0x789b, 0x0080, - 0x2019, 0x0080, 0x78a8, 0xa094, 0x00ff, 0xa286, 0x0001, 0x1188, - 0x7ca8, 0xa4a4, 0x00ff, 0xa480, 0x0002, 0xa300, 0x2018, 0xa102, - 0x0a04, 0x2c40, 0x0904, 0x2c40, 0x24a8, 0x7aa8, 0x1f04, 0x2cd5, - 0x0c48, 0xa284, 0x00f0, 0xa082, 0x0020, 0x06b8, 0x2200, 0xa082, - 0x0021, 0x1698, 0x7aa8, 0x8318, 0x8318, 0x2100, 0xa302, 0x0ad0, - 0xa286, 0x0023, 0x0980, 0x681c, 0xa084, 0xfff1, 0x681e, 0x7e58, - 0xa684, 0xfff1, 0xc0a5, 0x2030, 0x7e5a, 0x6008, 0xc0a5, 0x600a, - 0x78a0, 0x8001, 0x0904, 0x2cb1, 0x20a8, 0x7998, 0x789b, 0x0060, - 0x78aa, 0x2011, 0x0080, 0x799a, 0x78a8, 0x7998, 0x7a9a, 0x78aa, - 0x7a98, 0x1f04, 0x2d03, 0xc695, 0x7e5a, 0xd6d4, 0x1118, 0x781b, - 0x006e, 0x0005, 0x781b, 0x0082, 0x0005, 0x8318, 0x2100, 0xa302, - 0x0a04, 0x2cc2, 0xa284, 0x0080, 0x1904, 0x3831, 0x78a0, 0xa005, - 0x08c8, 0x0804, 0x3831, 0x0804, 0x3809, 0x7058, 0xa04d, 0x789b, - 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa08e, 0x0001, 0x0110, 0x080c, - 0x243b, 0x7aa8, 0xa294, 0x00ff, 0x78a8, 0xa084, 0x00ff, 0xa08a, - 0x0005, 0x1a04, 0x3809, 0x0002, 0x3809, 0x3615, 0x3809, 0x3726, - 0x3b83, 0xa282, 0x0000, 0x1110, 0x080c, 0x243b, 0x080c, 0x3837, - 0x781b, 0x0082, 0x0005, 0xa282, 0x0003, 0x1110, 0x080c, 0x243b, - 0xd4fc, 0x11d0, 0x7064, 0xa005, 0x0110, 0x080c, 0x243b, 0x6f14, - 0x7776, 0xa7bc, 0x8f00, 0x080c, 0x396d, 0x6008, 0xa085, 0x0021, - 0x600a, 0x8738, 0xa784, 0x001f, 0x1db0, 0x080c, 0x383a, 0x7067, - 0x0002, 0x701f, 0x0009, 0x0010, 0x080c, 0x3846, 0x781b, 0x0082, - 0x0005, 0xa282, 0x0004, 0x0310, 0x080c, 0x243b, 0x2300, 0x0002, - 0x2d7b, 0x2eff, 0x2f3b, 0xa286, 0x0003, 0x0560, 0x7200, 0x7cd8, - 0x7ddc, 0x7fd0, 0x71d4, 0xd1b4, 0x00f0, 0x7868, 0xa084, 0x00ff, - 0x11d0, 0xa282, 0x0002, 0x12b8, 0x00d6, 0x783b, 0x8300, 0x781b, - 0x0059, 0x70bc, 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, - 0x6898, 0x78d2, 0x78da, 0xc1b4, 0x71d6, 0x7003, 0x0030, 0x00de, - 0x2001, 0x0000, 0x0058, 0x783b, 0x1300, 0x781b, 0x0057, 0x2001, - 0x0000, 0x0020, 0x7200, 0x7cd8, 0x7ddc, 0x7fd0, 0x704a, 0x68a0, - 0xd0ec, 0x0118, 0x6008, 0xc08d, 0x600a, 0xa284, 0x000f, 0x0002, - 0x2ee0, 0x2dc5, 0x2dc2, 0x3012, 0x3085, 0x248f, 0x2dc0, 0x2dc0, - 0x080c, 0x243b, 0x6008, 0xc0d4, 0x600a, 0xd6e4, 0x0120, 0x7048, - 0xa086, 0x0014, 0x11e8, 0x080c, 0x3d52, 0x2009, 0x0000, 0x6818, - 0xd0fc, 0x0108, 0x7048, 0xa086, 0x0014, 0x0168, 0x6818, 0xa086, - 0x0008, 0x1904, 0x2ea2, 0x7858, 0xd09c, 0x0904, 0x2ea2, 0x6820, - 0xd0ac, 0x0904, 0x2ea2, 0x681b, 0x0014, 0x2009, 0x0002, 0x04a8, - 0x7868, 0xa08c, 0x00ff, 0x0588, 0xa186, 0x0008, 0x1158, 0x6008, - 0xc0a4, 0x600a, 0x080c, 0x355f, 0x0540, 0x080c, 0x35c5, 0x080c, - 0x3d52, 0x0060, 0xa186, 0x0028, 0x1500, 0x6018, 0xa005, 0x0d78, - 0x8001, 0x0d68, 0x8001, 0x0d58, 0x601e, 0x0c48, 0x6820, 0xd084, - 0x0904, 0x248f, 0xc084, 0x6822, 0x080c, 0x2580, 0x705c, 0x00c6, - 0x2060, 0x6800, 0x6002, 0x00ce, 0x6004, 0x6802, 0xa005, 0x2d00, - 0x1108, 0x6002, 0x6006, 0x0804, 0x248f, 0x0016, 0x81ff, 0x15e0, - 0x7000, 0xa086, 0x0030, 0x05c0, 0x71d4, 0xd1b4, 0x11e8, 0x7060, - 0xa005, 0x1590, 0x70a4, 0xa086, 0x0001, 0x0570, 0x7003, 0x0000, - 0x0046, 0x0056, 0x0076, 0x0066, 0x00c6, 0x00d6, 0x080c, 0x24b2, - 0x00de, 0x00ce, 0x006e, 0x007e, 0x005e, 0x004e, 0x71d4, 0xd1b4, - 0x11d8, 0x7003, 0x0040, 0x00c0, 0x080c, 0x3a8d, 0x11a8, 0x781b, - 0x0068, 0x00d6, 0x70bc, 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6, - 0x78de, 0x6898, 0x78d2, 0x78da, 0xc1b4, 0x71d6, 0x7003, 0x0030, - 0x7808, 0xc08d, 0x780a, 0x00de, 0x080c, 0x2f63, 0x001e, 0x81ff, - 0x0904, 0x2ea2, 0xa684, 0xdf00, 0x681e, 0x682b, 0x0000, 0x6f14, - 0xa186, 0x0002, 0x15c0, 0x6818, 0xa086, 0x0014, 0x1130, 0x2008, - 0xd6e4, 0x0118, 0x7868, 0xa08c, 0x00ff, 0x080c, 0x3850, 0x080c, - 0x258b, 0x6820, 0xd0dc, 0x1538, 0x8717, 0xa294, 0x000f, 0x8213, - 0x8213, 0x8213, 0xb284, 0x0600, 0x0118, 0xa290, 0x47c0, 0x0010, - 0xa290, 0x4840, 0xa290, 0x0000, 0x221c, 0xd3c4, 0x0130, 0x8210, - 0x2204, 0xa085, 0x0038, 0x2012, 0x8211, 0xd3d4, 0x0138, 0x68a0, - 0xd0c4, 0x1120, 0x080c, 0x2fcb, 0x0804, 0x248f, 0x6008, 0xc08d, - 0x600a, 0x0008, 0x692a, 0x6916, 0x6818, 0xd0fc, 0x0110, 0x7048, - 0x681a, 0xa68c, 0xdf00, 0x691e, 0x6410, 0x84ff, 0x0168, 0x2009, - 0x4302, 0x2104, 0x8001, 0x200a, 0x8421, 0x6412, 0x1128, 0x2021, - 0x4304, 0x2404, 0xc0a5, 0x2022, 0x6018, 0xa005, 0x0118, 0x8001, - 0x601a, 0x1118, 0x6008, 0xc0a4, 0x600a, 0x6820, 0xd084, 0x1130, - 0x6800, 0xa005, 0x1108, 0x6002, 0x6006, 0x0020, 0x705c, 0x2060, - 0x6800, 0x6002, 0x2061, 0x4300, 0x6887, 0x0103, 0x2d08, 0x206b, - 0x0000, 0x6068, 0xa005, 0x616a, 0x0110, 0x2d02, 0x0008, 0x616e, - 0x7200, 0xa286, 0x0030, 0x0158, 0xa286, 0x0040, 0x1904, 0x248f, - 0x7003, 0x0002, 0x704c, 0x2068, 0x68c4, 0x2060, 0x0005, 0x7003, - 0x0002, 0x70bc, 0xa06d, 0x68bc, 0x7042, 0x70b8, 0xa065, 0x68c0, - 0x705a, 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, 0x0005, 0xa282, - 0x0004, 0x0210, 0x080c, 0x243b, 0x2200, 0x0002, 0x2f0a, 0x2f19, - 0x2f25, 0x2f19, 0xa586, 0x1300, 0x0160, 0xa586, 0x8300, 0x1d90, - 0x7003, 0x0000, 0x6018, 0x8001, 0x601a, 0x6008, 0xa084, 0xfbef, - 0x600a, 0x7000, 0xa086, 0x0005, 0x0128, 0x080c, 0x3837, 0x781b, - 0x0082, 0x0005, 0x781b, 0x0083, 0x0005, 0x7890, 0x8007, 0x8001, - 0xa084, 0x0007, 0xa080, 0x0018, 0x789a, 0x79a8, 0xa18c, 0x00ff, - 0xa186, 0x0003, 0x0128, 0xa186, 0x0000, 0x0110, 0x0804, 0x3809, - 0x781b, 0x0083, 0x0005, 0x6820, 0xc095, 0x6822, 0x82ff, 0x1118, - 0x080c, 0x3837, 0x0030, 0x8211, 0x0110, 0x080c, 0x243b, 0x080c, - 0x3846, 0x781b, 0x0082, 0x0005, 0x080c, 0x3aa0, 0x7830, 0xa084, - 0x00c0, 0x1170, 0x0016, 0x3208, 0xa18c, 0x0800, 0x001e, 0x0118, - 0x0104, 0x2f60, 0x0010, 0x0304, 0x2f60, 0x791a, 0xa006, 0x0005, - 0xa085, 0x0001, 0x0005, 0xa684, 0x0060, 0x1130, 0x682f, 0x0000, - 0x6833, 0x0000, 0x0804, 0x2fca, 0xd6dc, 0x1198, 0x68b4, 0xd0dc, - 0x1180, 0x6998, 0x6a94, 0x692e, 0x6a32, 0x7048, 0xa005, 0x1130, - 0x2200, 0xa105, 0x0904, 0x3d52, 0x704b, 0x0015, 0x0804, 0x3d52, - 0x0005, 0xd6ac, 0x01f0, 0xd6f4, 0x0130, 0x682f, 0x0000, 0x6833, - 0x0000, 0x0804, 0x3d52, 0x68b4, 0xa084, 0x4000, 0xa635, 0xd6f4, - 0x1da0, 0x7048, 0xa005, 0x1110, 0x704b, 0x0015, 0xd6dc, 0x1128, - 0x68b4, 0xd0dc, 0x0110, 0x6ca8, 0x6da4, 0x6c2e, 0x6d32, 0x0804, - 0x3d52, 0xd6f4, 0x0130, 0x682f, 0x0000, 0x6833, 0x0000, 0x0804, - 0x3d52, 0x68b4, 0xa084, 0x4800, 0xa635, 0xd6f4, 0x1da0, 0x7048, - 0xa005, 0x1110, 0x704b, 0x0015, 0x2408, 0x2510, 0x2700, 0x8007, - 0xa084, 0x007f, 0xa108, 0xa291, 0x0000, 0x692e, 0x6a32, 0x2100, - 0xa205, 0x1110, 0x0804, 0x3d52, 0x7000, 0xa086, 0x0006, 0x0110, - 0x0804, 0x3d52, 0x0005, 0x6946, 0x6008, 0xc0cd, 0xd3cc, 0x0108, - 0xc08d, 0x600a, 0x6818, 0x683a, 0x681b, 0x0006, 0x688f, 0x0000, - 0x6893, 0x0000, 0x6a30, 0x692c, 0x6a3e, 0x6942, 0x682f, 0x0003, - 0x6833, 0x0000, 0x6837, 0x0020, 0x6897, 0x0000, 0x689b, 0x0020, - 0x7000, 0x0002, 0x248f, 0x2ffa, 0x2ff4, 0x2ff2, 0x2ff2, 0x2ff2, - 0x2ff2, 0x2ff2, 0x080c, 0x243b, 0x6820, 0xd084, 0x1118, 0x080c, - 0x35ab, 0x0030, 0x705c, 0x2c50, 0x2060, 0x6800, 0x6002, 0x2a60, - 0x3208, 0xa18c, 0x0600, 0x0118, 0x2021, 0x4358, 0x0010, 0x2021, - 0x4398, 0x2404, 0xa005, 0x0110, 0x2020, 0x0cd8, 0x2d22, 0x206b, - 0x0000, 0x0005, 0x080c, 0x35b1, 0x080c, 0x35c5, 0x6008, 0xc0cc, - 0x600a, 0x682b, 0x0000, 0x789b, 0x000e, 0x6f14, 0x6938, 0x691a, - 0x6944, 0x6916, 0x3208, 0xa18c, 0x0600, 0x0118, 0x2009, 0x0000, - 0x0010, 0x2009, 0x0001, 0x080c, 0x40b1, 0xd6dc, 0x0118, 0x691c, - 0xc1ed, 0x691e, 0x6818, 0xd0fc, 0x0148, 0x7868, 0xa08c, 0x00ff, - 0x0118, 0x681b, 0x001e, 0x0010, 0x681b, 0x0000, 0xb284, 0x0600, - 0x1118, 0x2021, 0x4398, 0x0010, 0x2021, 0x4358, 0x6800, 0x2022, - 0x6a3c, 0x6940, 0x6a32, 0x692e, 0x68c0, 0x2060, 0x6000, 0xd0a4, - 0x0580, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x00d6, - 0x00f6, 0x0156, 0x0146, 0x2079, 0x4300, 0x080c, 0x1b35, 0x014e, - 0x015e, 0x00fe, 0x70cc, 0x2010, 0x2009, 0x0101, 0x0026, 0x2204, - 0xa06d, 0x0140, 0x6814, 0xa706, 0x0110, 0x6800, 0x0cc8, 0x6820, - 0xc0d5, 0x6822, 0x002e, 0x8210, 0x8109, 0x1d80, 0x00de, 0x7067, - 0x0003, 0x707f, 0x0000, 0x7776, 0x7083, 0x000f, 0x71d4, 0xc1c4, - 0x71d6, 0x080c, 0x1d3d, 0x0804, 0x248f, 0x7cd8, 0x7ddc, 0x7fd0, - 0x080c, 0x2f63, 0x682b, 0x0000, 0x789b, 0x000e, 0x6f14, 0x080c, - 0x3aa4, 0xa08c, 0x00ff, 0x6916, 0x6818, 0xd0fc, 0x0110, 0x7048, - 0x681a, 0xa68c, 0xdf00, 0x691e, 0x7067, 0x0000, 0x0804, 0x248f, - 0x7000, 0xa005, 0x1110, 0x0804, 0x248f, 0xa006, 0x080c, 0x3d52, - 0x6920, 0xd1ac, 0x1110, 0x681b, 0x0014, 0xa68c, 0xdf00, 0x691e, - 0x682b, 0x0000, 0x6820, 0xa084, 0x00ff, 0x6822, 0x7000, 0x0002, - 0x248f, 0x30c2, 0x30c2, 0x30c5, 0x30c5, 0x30c5, 0x30c0, 0x30c0, - 0x080c, 0x243b, 0x6818, 0x0804, 0x2daa, 0x6008, 0xc0a4, 0x600a, - 0x6817, 0x0000, 0x0804, 0x357a, 0x2300, 0x0002, 0x30d1, 0x30d3, - 0x3110, 0x080c, 0x243b, 0xd6fc, 0x1904, 0x2bee, 0x7000, 0xa00d, - 0x0002, 0x248f, 0x30e3, 0x30e3, 0x3104, 0x30e3, 0x310d, 0x30e1, - 0x30e1, 0x080c, 0x243b, 0xa684, 0x0060, 0xa086, 0x0060, 0x11d0, - 0xc6ac, 0xc6f4, 0xc6ed, 0x7e5a, 0x681c, 0xc0ac, 0x681e, 0xa186, - 0x0002, 0x0110, 0x080c, 0x3d52, 0x080c, 0x3fb8, 0x781b, 0x0083, - 0x71d4, 0xd1b4, 0x1904, 0x248c, 0x70a4, 0xa086, 0x0001, 0x1904, - 0x24ce, 0x0005, 0xd6ec, 0x0d30, 0x6818, 0xd0fc, 0x0130, 0x681b, - 0x0015, 0xd6f4, 0x0110, 0x681b, 0x0007, 0x080c, 0x3a4b, 0x0005, - 0x080c, 0x243b, 0x2300, 0x0002, 0x3119, 0x3134, 0x3182, 0x080c, - 0x243b, 0x7000, 0x0002, 0x3123, 0x3125, 0x3125, 0x3123, 0x3123, - 0x3123, 0x3123, 0x3123, 0x080c, 0x243b, 0x080c, 0x3fb8, 0x681c, - 0xc0b4, 0x681e, 0x70d4, 0xd0b4, 0x1904, 0x248c, 0x70a4, 0xa086, - 0x0001, 0x1904, 0x24ce, 0x0005, 0xd6fc, 0x15e0, 0x7000, 0xa00d, - 0x0002, 0x248f, 0x3149, 0x3143, 0x316a, 0x3149, 0x316f, 0x3141, - 0x3141, 0x080c, 0x243b, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, - 0x78da, 0xa684, 0x0060, 0xa086, 0x0060, 0x11d0, 0xa6b4, 0xbfbf, - 0xc6ed, 0x7e5a, 0xa186, 0x0002, 0x0110, 0x080c, 0x3d52, 0x080c, - 0x3fb8, 0x781b, 0x0083, 0x681c, 0xc0b4, 0x681e, 0x71d4, 0xd1b4, - 0x1904, 0x248c, 0x70a4, 0xa086, 0x0001, 0x1904, 0x24ce, 0x0005, - 0xd6ec, 0x0d30, 0x6818, 0xd0fc, 0x0110, 0x681b, 0x0007, 0x781b, - 0x00fb, 0x0005, 0xc6fc, 0x7e5a, 0x7adc, 0x79d8, 0x6b98, 0x2100, - 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x79d2, 0x781b, - 0x0083, 0x0005, 0xd6dc, 0x0130, 0x782b, 0x3009, 0x781b, 0x0083, - 0x0804, 0x248c, 0x7884, 0xc0ac, 0x7886, 0x78e4, 0xa084, 0x0008, - 0x1150, 0xa484, 0x0200, 0x0108, 0xc6f5, 0xc6dd, 0x7e5a, 0x781b, - 0x0083, 0x0804, 0x248c, 0x6820, 0xc095, 0x6822, 0x080c, 0x39ca, - 0xc6dd, 0x080c, 0x3837, 0x781b, 0x0082, 0x0804, 0x248c, 0x2300, - 0x0002, 0x31ac, 0x31ae, 0x31b0, 0x080c, 0x243b, 0x0804, 0x3831, - 0x7d98, 0xd6d4, 0x11f8, 0x79e4, 0xd1ac, 0x0130, 0x78ec, 0xa084, - 0x0003, 0x0110, 0x782b, 0x3009, 0x789b, 0x0060, 0x78ab, 0x0000, - 0xa684, 0xfffb, 0x785a, 0x7d9a, 0x79e4, 0xd1ac, 0x0120, 0x78ec, - 0xa084, 0x0003, 0x1120, 0x2001, 0x0014, 0x0804, 0x2daa, 0xa184, - 0x0007, 0x04c2, 0x7a90, 0xa294, 0x0007, 0x789b, 0x0060, 0x79a8, - 0x81ff, 0x0568, 0x789b, 0x0080, 0x7ba8, 0xa384, 0x0001, 0x11d0, - 0x7ba8, 0x7ba8, 0xa386, 0x0004, 0x1118, 0x2009, 0xffdf, 0x0058, - 0xa386, 0x0001, 0x1118, 0x2009, 0xfff7, 0x0028, 0xa386, 0x0003, - 0x1148, 0x2009, 0xffef, 0x00c6, 0x7058, 0x2060, 0x6004, 0xa104, - 0x6006, 0x00ce, 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb, - 0x785a, 0x782b, 0x3009, 0x6920, 0xa18c, 0xecff, 0x6922, 0x7d9a, - 0x0804, 0x3a3f, 0x2a9f, 0x2aa8, 0x3214, 0x321a, 0x3212, 0x3212, - 0x3a3f, 0x3a3f, 0x080c, 0x243b, 0x6920, 0xa18c, 0xfcff, 0x6922, - 0x0804, 0x3a45, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0804, 0x3a3f, - 0x79e4, 0xa184, 0x0030, 0x0120, 0x78ec, 0xa084, 0x0003, 0x1558, - 0x7000, 0xa086, 0x0004, 0x1190, 0x7064, 0xa086, 0x0002, 0x1130, - 0x2011, 0x0002, 0x2019, 0x0000, 0x0804, 0x295c, 0x7064, 0xa086, - 0x0006, 0x0db0, 0x7064, 0xa086, 0x0004, 0x0d90, 0x7000, 0xa086, - 0x0000, 0x0904, 0x248c, 0x6920, 0xa184, 0x0420, 0x0128, 0xc1d4, - 0x6922, 0x6818, 0x0804, 0x2daa, 0x6818, 0xc0fd, 0x681a, 0x2001, - 0x0014, 0x0804, 0x2daa, 0xa184, 0x0007, 0x0002, 0x3a3f, 0x3a3f, - 0x325e, 0x3a3f, 0x3a83, 0x3a83, 0x3a3f, 0x3a3f, 0xd6bc, 0x0570, - 0x7184, 0x81ff, 0x0558, 0xa182, 0x000d, 0x1318, 0x7087, 0x0000, - 0x0028, 0xa182, 0x000c, 0x7086, 0x2009, 0x000c, 0x789b, 0x0061, - 0x79aa, 0x0156, 0x0136, 0x0146, 0x7088, 0x8114, 0xa210, 0x728a, - 0xa080, 0x000b, 0xad00, 0x2098, 0xb284, 0x0600, 0x0118, 0x20a1, - 0x022b, 0x0010, 0x20a1, 0x012b, 0x789b, 0x0000, 0x8108, 0x81ac, - 0x53a6, 0x014e, 0x013e, 0x015e, 0x0804, 0x3a45, 0xd6d4, 0x1904, - 0x32d1, 0x6820, 0xd084, 0x0904, 0x3a45, 0xa68c, 0x0060, 0xa684, - 0x0060, 0x0120, 0xa086, 0x0060, 0x1108, 0xc1f5, 0xc194, 0x795a, - 0x69b6, 0x789b, 0x0060, 0x78ab, 0x0000, 0x789b, 0x0061, 0x6818, - 0xc0fd, 0x681a, 0x78aa, 0x8008, 0x810c, 0x0904, 0x35da, 0xa18c, - 0x00f8, 0x1904, 0x35da, 0x0156, 0x0136, 0x0146, 0x0016, 0x20a1, - 0x012b, 0x3208, 0xa18c, 0x0600, 0x0110, 0x20a1, 0x022b, 0x001e, - 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, - 0x014e, 0x013e, 0x015e, 0x6814, 0xc0fc, 0x8007, 0x7882, 0x0804, - 0x3a45, 0x6818, 0xd0fc, 0x0110, 0x681b, 0x0008, 0x080c, 0x3837, - 0x781b, 0x00ed, 0x0005, 0x2300, 0x0002, 0x32e2, 0x3398, 0x32e0, - 0x080c, 0x243b, 0x7cd8, 0x7ddc, 0x7fd0, 0x82ff, 0x11f0, 0x7200, - 0xa286, 0x0003, 0x0904, 0x2d7f, 0x71d4, 0xd1b4, 0x00c0, 0x00d6, - 0x783b, 0x8800, 0x781b, 0x0059, 0x70bc, 0xa06d, 0x68b4, 0xc0a5, - 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0xc1b4, - 0x71d6, 0x7003, 0x0030, 0x00de, 0x0030, 0x7200, 0x0020, 0x783b, - 0x1800, 0x781b, 0x0057, 0xa284, 0x000f, 0x0002, 0x3383, 0x3344, - 0x3318, 0x2da7, 0x3316, 0x3383, 0x3316, 0x3316, 0x080c, 0x243b, - 0x681c, 0xd0ec, 0x0118, 0x6008, 0xc08d, 0x600a, 0x6920, 0xc185, - 0x6922, 0x6800, 0x6006, 0xa005, 0x1108, 0x6002, 0x6008, 0xc0d4, - 0x600a, 0x681c, 0xa084, 0x000e, 0x1148, 0xb284, 0x0600, 0x0118, - 0x2009, 0x89c0, 0x0040, 0x2009, 0x8ad0, 0x0028, 0x7030, 0x68ba, - 0x7140, 0x70cc, 0xa108, 0x2104, 0x6802, 0x2d0a, 0x715e, 0xd6dc, - 0x1118, 0xc6fc, 0x6eb6, 0x04f8, 0x6eb6, 0xa684, 0x0060, 0x05d8, + 0xa084, 0x00ff, 0xa205, 0x6822, 0x080c, 0x1d89, 0x2021, 0x4502, + 0x241c, 0x8319, 0x2322, 0x6010, 0x8001, 0x6012, 0x1128, 0x2021, + 0x4504, 0x2404, 0xc0a5, 0x2022, 0x6008, 0xa084, 0xf9ef, 0x600a, + 0x080c, 0x267d, 0x080c, 0x3786, 0x0005, 0xa085, 0x0001, 0x0ce0, + 0x2300, 0x0002, 0x2b47, 0x2b45, 0x2bad, 0x080c, 0x252b, 0x78e4, + 0xa005, 0x1708, 0x3208, 0xa18c, 0x0800, 0x0118, 0x0104, 0x257c, + 0x0010, 0x0304, 0x257c, 0x2008, 0xa084, 0x0030, 0x1110, 0x0804, + 0x31c5, 0x78ec, 0xa084, 0x0003, 0x0dd0, 0x2100, 0xa084, 0x0007, + 0x0002, 0x2b90, 0x2b99, 0x2b86, 0x2b69, 0x3bef, 0x3bef, 0x2b69, + 0x2ba3, 0x080c, 0x252b, 0x7000, 0xa086, 0x0004, 0x1190, 0x7060, + 0xa086, 0x0002, 0x1130, 0x2011, 0x0002, 0x2019, 0x0000, 0x0804, + 0x2a4d, 0x7060, 0xa086, 0x0006, 0x0db0, 0x7060, 0xa086, 0x0004, + 0x0d90, 0x79e4, 0x2001, 0x0003, 0x0804, 0x2ea4, 0x6818, 0xd0fc, + 0x0110, 0x681b, 0x001d, 0x080c, 0x39ff, 0x781b, 0x006e, 0x0005, + 0x6818, 0xd0fc, 0x0110, 0x681b, 0x001d, 0x080c, 0x39ff, 0x0804, + 0x3bcd, 0x6818, 0xd0fc, 0x0110, 0x681b, 0x001d, 0x080c, 0x39ff, + 0x781b, 0x00fa, 0x0005, 0x6818, 0xd0fc, 0x0110, 0x681b, 0x001d, + 0x080c, 0x39ff, 0x781b, 0x00cb, 0x0005, 0xa584, 0x000f, 0x11c0, + 0x7000, 0x0002, 0x257f, 0x2bba, 0x2bbc, 0x3725, 0x3725, 0x3725, + 0x2bba, 0x2bba, 0x080c, 0x252b, 0x080c, 0x3786, 0x6008, 0xa084, + 0xfbef, 0x600a, 0x080c, 0x3717, 0x0904, 0x3725, 0x0804, 0x257f, + 0x78e4, 0xa005, 0x1b04, 0x2b6b, 0x3208, 0xa18c, 0x0800, 0x0118, + 0x0104, 0x2b6b, 0x0010, 0x0304, 0x2b6b, 0x2008, 0xa084, 0x0030, + 0x1118, 0x781b, 0x0068, 0x0005, 0x78ec, 0xa084, 0x0003, 0x0dc8, + 0x2100, 0xa184, 0x0007, 0x0002, 0x2bf3, 0x2bf7, 0x2bee, 0x2bec, + 0x3bef, 0x3bef, 0x2bec, 0x3be9, 0x080c, 0x252b, 0x080c, 0x3a05, + 0x781b, 0x006e, 0x0005, 0x080c, 0x3a05, 0x0804, 0x3bcd, 0x080c, + 0x3a05, 0x781b, 0x00fa, 0x0005, 0x080c, 0x3a05, 0x781b, 0x00cb, + 0x0005, 0x2300, 0x0002, 0x2c08, 0x2c06, 0x2c0a, 0x080c, 0x252b, + 0x0804, 0x3361, 0x681b, 0x0016, 0x78a3, 0x0000, 0x79e4, 0xa184, + 0x0030, 0x0904, 0x3361, 0x78ec, 0xa084, 0x0003, 0x0904, 0x3361, + 0xa184, 0x0100, 0x0d98, 0xa184, 0x0007, 0x0002, 0x2c26, 0x2bf7, + 0x2b86, 0x3bab, 0x3bef, 0x3bef, 0x3bab, 0x3be9, 0x080c, 0x3bb7, + 0x0005, 0xa282, 0x0005, 0x0310, 0x080c, 0x252b, 0x7898, 0x2040, + 0x2300, 0x0002, 0x2c35, 0x2e34, 0x2e3e, 0x2200, 0x0002, 0x2c51, + 0x2c3e, 0x2c51, 0x2c3c, 0x2e16, 0x080c, 0x252b, 0x789b, 0x0018, + 0x78a8, 0x2010, 0xa084, 0x00ff, 0xa082, 0x0020, 0x0a04, 0x39d0, + 0xa08a, 0x0004, 0x1a04, 0x39d0, 0x0002, 0x39d0, 0x39d0, 0x39d0, + 0x3986, 0x789b, 0x0018, 0x79a8, 0xa184, 0x0080, 0x0148, 0x0804, + 0x39d0, 0x7000, 0xa005, 0x1dd8, 0x2011, 0x0004, 0x0804, 0x3502, + 0xa184, 0x00ff, 0xa08a, 0x0010, 0x1a04, 0x39d0, 0x0002, 0x2c79, + 0x2c77, 0x2c8b, 0x2c8f, 0x2d2d, 0x39d0, 0x39d0, 0x2d2f, 0x39d0, + 0x39d0, 0x2e12, 0x2e12, 0x39d0, 0x39d0, 0x39d0, 0x2e14, 0x080c, + 0x252b, 0xd6e4, 0x0140, 0x2001, 0x0300, 0x8000, 0x8000, 0x783a, + 0x781b, 0x00c7, 0x0005, 0x6818, 0xd0fc, 0x0118, 0x681b, 0x001d, + 0x0c90, 0x0804, 0x3bab, 0x681b, 0x001d, 0x0804, 0x39f9, 0x6920, + 0x6922, 0xa684, 0x1800, 0x15e0, 0x6820, 0xd084, 0x1904, 0x2cd8, + 0x6818, 0xa086, 0x0008, 0x1110, 0x681b, 0x0000, 0xd6d4, 0x0568, + 0xd6bc, 0x0558, 0x7083, 0x0000, 0x6818, 0xa084, 0x003f, 0xa08a, + 0x000d, 0x0718, 0xa08a, 0x000c, 0x7182, 0x2001, 0x000c, 0x800c, + 0x7186, 0x789b, 0x0061, 0x78aa, 0x0156, 0x0136, 0x0146, 0x0016, + 0x3208, 0xa18c, 0x0600, 0x0118, 0x20a1, 0x022b, 0x0010, 0x20a1, + 0x012b, 0x001e, 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b, + 0x2098, 0x53a6, 0x014e, 0x013e, 0x015e, 0x781b, 0x0071, 0x0005, + 0xd6e4, 0x0130, 0x781b, 0x0083, 0x0005, 0x781b, 0x0083, 0x0005, + 0xa684, 0x0060, 0x0dd0, 0xd6dc, 0x0dc0, 0xd6fc, 0x01a0, 0xc6fc, + 0x7e5a, 0x6eb6, 0x7adc, 0x79d8, 0x78d0, 0x8007, 0xa084, 0x007f, + 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, + 0x2200, 0xa303, 0x68ae, 0xd6f4, 0x0118, 0xc6f4, 0x7e5a, 0x6eb6, + 0x7000, 0xa086, 0x0003, 0x1148, 0x0006, 0x080c, 0x3ed9, 0x080c, + 0x4180, 0x000e, 0x781b, 0x0080, 0x0005, 0xa006, 0x080c, 0x425d, + 0x6ab0, 0x69ac, 0x6c98, 0x6b94, 0x2200, 0xa105, 0x0120, 0x2200, + 0xa422, 0x2100, 0xa31b, 0x6caa, 0x7cd2, 0x7cda, 0x6ba6, 0x7bd6, + 0x7bde, 0x2300, 0xa405, 0x1130, 0xc6f5, 0x7e5a, 0x6eb6, 0x781b, + 0x0080, 0x0005, 0x781b, 0x0080, 0x2200, 0xa115, 0x1118, 0x080c, + 0x4180, 0x0005, 0x080c, 0x41ad, 0x0005, 0x080c, 0x252b, 0x0804, + 0x2dae, 0x00c6, 0x7054, 0x2060, 0x7aa8, 0xa294, 0x00ff, 0xa286, + 0x0004, 0x11d8, 0x6920, 0xd1e4, 0x1170, 0x2039, 0x0000, 0x2041, + 0x0000, 0x2031, 0x0000, 0xa006, 0x2010, 0x080c, 0x38bd, 0x080c, + 0x3961, 0x0804, 0x2da2, 0xa18c, 0xecff, 0x6922, 0x6104, 0xa18c, + 0xffdd, 0x6106, 0x6000, 0xc0ac, 0x6002, 0xa286, 0x0003, 0x01d0, + 0x6104, 0xa184, 0x0010, 0x0548, 0x080c, 0x3b31, 0x080c, 0x393d, + 0x88ff, 0x0518, 0x00ce, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, + 0xc695, 0x7e5a, 0xd6d4, 0x1118, 0x781b, 0x006e, 0x0005, 0x781b, + 0x0082, 0x0005, 0x6920, 0xd1cc, 0x0130, 0xa18c, 0xfdff, 0x6922, + 0x6000, 0xc0ec, 0x6002, 0x2039, 0x0000, 0x2041, 0x0000, 0x2031, + 0x0000, 0xa006, 0x2010, 0x080c, 0x3961, 0xa286, 0x0001, 0x0158, + 0x6104, 0xa184, 0x0008, 0x01b0, 0x080c, 0x3b31, 0x080c, 0x385d, + 0x88ff, 0x1980, 0x0078, 0x6920, 0xd1c4, 0x0130, 0xa18c, 0xfeff, + 0x6922, 0x6000, 0xc0e4, 0x6002, 0x2031, 0x0000, 0xa006, 0x2010, + 0x080c, 0x38bd, 0x00ce, 0x7e58, 0xd6d4, 0x1118, 0x781b, 0x0071, + 0x0005, 0x781b, 0x0083, 0x0005, 0x0804, 0x39f5, 0x2808, 0x789b, + 0x0080, 0x2019, 0x0080, 0x78a8, 0xa094, 0x00ff, 0xa286, 0x0001, + 0x1188, 0x7ca8, 0xa4a4, 0x00ff, 0xa480, 0x0002, 0xa300, 0x2018, + 0xa102, 0x0a04, 0x2d31, 0x0904, 0x2d31, 0x24a8, 0x7aa8, 0x1f04, + 0x2dc6, 0x0c48, 0xa284, 0x00f0, 0xa082, 0x0020, 0x06b8, 0x2200, + 0xa082, 0x0021, 0x1698, 0x7aa8, 0x8318, 0x8318, 0x2100, 0xa302, + 0x0ad0, 0xa286, 0x0023, 0x0980, 0x681c, 0xa084, 0xfff1, 0x681e, + 0x7e58, 0xa684, 0xfff1, 0xc0a5, 0x2030, 0x7e5a, 0x6008, 0xc0a5, + 0x600a, 0x78a0, 0x8001, 0x0904, 0x2da2, 0x20a8, 0x7998, 0x789b, + 0x0060, 0x78aa, 0x2011, 0x0080, 0x799a, 0x78a8, 0x7998, 0x7a9a, + 0x78aa, 0x7a98, 0x1f04, 0x2df4, 0xc695, 0x7e5a, 0xd6d4, 0x1118, + 0x781b, 0x006e, 0x0005, 0x781b, 0x0082, 0x0005, 0x8318, 0x2100, + 0xa302, 0x0a04, 0x2db3, 0xa284, 0x0080, 0x1904, 0x39f9, 0x78a0, + 0xa005, 0x08c8, 0x0804, 0x39f9, 0x0804, 0x39d0, 0x7054, 0xa04d, + 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa08e, 0x0001, 0x0110, + 0x080c, 0x252b, 0x7aa8, 0xa294, 0x00ff, 0x784b, 0x0008, 0x78a8, + 0xa084, 0x00ff, 0xa08a, 0x0005, 0x1a04, 0x39d0, 0x0002, 0x39d0, + 0x37d4, 0x39d0, 0x38ed, 0x3cef, 0xa282, 0x0000, 0x1110, 0x080c, + 0x252b, 0x080c, 0x39ff, 0x781b, 0x0082, 0x0005, 0xa282, 0x0003, + 0x1110, 0x080c, 0x252b, 0xd4fc, 0x11d0, 0x7060, 0xa005, 0x0110, + 0x080c, 0x252b, 0x6f14, 0x7772, 0xa7bc, 0x8f00, 0x080c, 0x3b35, + 0x6008, 0xa085, 0x0021, 0x600a, 0x8738, 0xa784, 0x001f, 0x1db0, + 0x080c, 0x3a02, 0x7063, 0x0002, 0x701f, 0x0009, 0x0010, 0x080c, + 0x3a0e, 0x781b, 0x0082, 0x0005, 0xa282, 0x0004, 0x0310, 0x080c, + 0x252b, 0x2300, 0x0002, 0x2e6e, 0x3004, 0x3040, 0xa286, 0x0003, + 0x0598, 0x7200, 0x7cd8, 0x7ddc, 0x7fd0, 0x71d0, 0xd1bc, 0x1528, + 0xd1b4, 0x0518, 0x2001, 0x4501, 0x2004, 0xd0c4, 0x11f0, 0x7868, + 0xa084, 0x00ff, 0x11d0, 0xa282, 0x0002, 0x12b8, 0x00d6, 0x783b, + 0x8300, 0x781b, 0x0059, 0x70b8, 0xa06d, 0x68b4, 0x785a, 0x6894, + 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0xc1b4, 0x71d2, 0x7003, + 0x0030, 0x00de, 0x2001, 0x0000, 0x0058, 0x783b, 0x1300, 0x781b, + 0x0057, 0x2001, 0x0000, 0x0020, 0x7200, 0x7cd8, 0x7ddc, 0x7fd0, + 0x7046, 0x68a0, 0xd0ec, 0x0118, 0x6008, 0xc08d, 0x600a, 0xa284, + 0x000f, 0x0002, 0x2fe5, 0x2ebf, 0x2ebc, 0x3117, 0x31aa, 0x257f, + 0x2eba, 0x2eba, 0x080c, 0x252b, 0x6008, 0xc0d4, 0x600a, 0xd6e4, + 0x0120, 0x7044, 0xa086, 0x0014, 0x11e8, 0x080c, 0x3ed9, 0x2009, + 0x0000, 0x6818, 0xd0fc, 0x0108, 0x7044, 0xa086, 0x0014, 0x0168, + 0x6818, 0xa086, 0x0008, 0x1904, 0x2fa7, 0x7858, 0xd09c, 0x0904, + 0x2fa7, 0x6820, 0xd0ac, 0x0904, 0x2fa7, 0x681b, 0x0014, 0x2009, + 0x0002, 0x04a8, 0x7868, 0xa08c, 0x00ff, 0x0588, 0xa186, 0x0008, + 0x1158, 0x6008, 0xc0a4, 0x600a, 0x080c, 0x3717, 0x0540, 0x080c, + 0x3786, 0x080c, 0x3ed9, 0x0060, 0xa186, 0x0028, 0x1500, 0x6018, + 0xa005, 0x0d78, 0x8001, 0x0d68, 0x8001, 0x0d58, 0x601e, 0x0c48, + 0x6820, 0xd084, 0x0904, 0x257f, 0xc084, 0x6822, 0x080c, 0x2672, + 0x7058, 0x00c6, 0x2060, 0x6800, 0x6002, 0x00ce, 0x6004, 0x6802, + 0xa005, 0x2d00, 0x1108, 0x6002, 0x6006, 0x0804, 0x257f, 0x0016, + 0x81ff, 0x15f0, 0x7000, 0xa086, 0x0030, 0x05d0, 0x71d0, 0xd1bc, + 0x15b8, 0xd1b4, 0x11e8, 0x705c, 0xa005, 0x1590, 0x70a0, 0xa086, + 0x0001, 0x0570, 0x7003, 0x0000, 0x0046, 0x0056, 0x0076, 0x0066, + 0x00c6, 0x00d6, 0x080c, 0x25a4, 0x00de, 0x00ce, 0x006e, 0x007e, + 0x005e, 0x004e, 0x71d0, 0xd1b4, 0x11d8, 0x7003, 0x0040, 0x00c0, + 0x080c, 0x3bf9, 0x11a8, 0x781b, 0x0068, 0x00d6, 0x70b8, 0xa06d, + 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, + 0xc1b4, 0x71d2, 0x7003, 0x0030, 0x7808, 0xc08d, 0x780a, 0x00de, + 0x080c, 0x3068, 0x001e, 0x81ff, 0x0904, 0x2fa7, 0xa684, 0xdf00, + 0x681e, 0x682b, 0x0000, 0x6f14, 0xa186, 0x0002, 0x1904, 0x2fa8, + 0x6818, 0xa086, 0x0014, 0x1130, 0x2008, 0xd6e4, 0x0118, 0x7868, + 0xa08c, 0x00ff, 0x080c, 0x3a18, 0x080c, 0x267d, 0x6820, 0xd0dc, + 0x1578, 0x8717, 0xa294, 0x000f, 0x8213, 0x8213, 0x8213, 0xb284, + 0x0600, 0x0118, 0xa290, 0x49c0, 0x0010, 0xa290, 0x4a40, 0xa290, + 0x0000, 0x221c, 0xd3c4, 0x0170, 0x6820, 0xd0e4, 0x0128, 0xa084, + 0xefff, 0x6822, 0xc3ac, 0x2312, 0x8210, 0x2204, 0xa085, 0x0038, + 0x2012, 0x8211, 0xd3d4, 0x0138, 0x68a0, 0xd0c4, 0x1120, 0x080c, + 0x30d0, 0x0804, 0x257f, 0x6008, 0xc08d, 0x600a, 0x0008, 0x692a, + 0x6916, 0x6818, 0xd0fc, 0x0110, 0x7044, 0x681a, 0xa68c, 0xdf00, + 0x691e, 0x6410, 0x84ff, 0x0168, 0x2009, 0x4502, 0x2104, 0x8001, + 0x200a, 0x8421, 0x6412, 0x1128, 0x2021, 0x4504, 0x2404, 0xc0a5, + 0x2022, 0x6018, 0xa005, 0x0118, 0x8001, 0x601a, 0x1118, 0x6008, + 0xc0a4, 0x600a, 0x6820, 0xd084, 0x1130, 0x6800, 0xa005, 0x1108, + 0x6002, 0x6006, 0x0020, 0x7058, 0x2060, 0x6800, 0x6002, 0x2061, + 0x4500, 0x6887, 0x0103, 0x2d08, 0x206b, 0x0000, 0x6068, 0xa005, + 0x616a, 0x0110, 0x2d02, 0x0008, 0x616e, 0x7200, 0xa286, 0x0030, + 0x0158, 0xa286, 0x0040, 0x1904, 0x257f, 0x7003, 0x0002, 0x7048, + 0x2068, 0x68c4, 0x2060, 0x0005, 0x7003, 0x0002, 0x70b8, 0xa06d, + 0x68bc, 0x703e, 0x70b4, 0xa065, 0x68c0, 0x7056, 0x2d00, 0x704a, + 0xad80, 0x0009, 0x7042, 0x0005, 0xa282, 0x0004, 0x0210, 0x080c, + 0x252b, 0x2200, 0x0002, 0x300f, 0x301e, 0x302a, 0x301e, 0xa586, + 0x1300, 0x0160, 0xa586, 0x8300, 0x1d90, 0x7003, 0x0000, 0x6018, + 0x8001, 0x601a, 0x6008, 0xa084, 0xfbef, 0x600a, 0x7000, 0xa086, + 0x0005, 0x0128, 0x080c, 0x39ff, 0x781b, 0x0082, 0x0005, 0x781b, + 0x0083, 0x0005, 0x7890, 0x8007, 0x8001, 0xa084, 0x0007, 0xa080, + 0x0018, 0x789a, 0x79a8, 0xa18c, 0x00ff, 0xa186, 0x0003, 0x0128, + 0xa186, 0x0000, 0x0110, 0x0804, 0x39d0, 0x781b, 0x0083, 0x0005, + 0x6820, 0xc095, 0x6822, 0x82ff, 0x1118, 0x080c, 0x39ff, 0x0030, + 0x8211, 0x0110, 0x080c, 0x252b, 0x080c, 0x3a0e, 0x781b, 0x0082, + 0x0005, 0x080c, 0x3c0c, 0x7830, 0xa084, 0x00c0, 0x1170, 0x0016, + 0x3208, 0xa18c, 0x0800, 0x001e, 0x0118, 0x0104, 0x3065, 0x0010, + 0x0304, 0x3065, 0x791a, 0xa006, 0x0005, 0xa085, 0x0001, 0x0005, + 0xa684, 0x0060, 0x1130, 0x682f, 0x0000, 0x6833, 0x0000, 0x0804, + 0x30cf, 0xd6dc, 0x1198, 0x68b4, 0xd0dc, 0x1180, 0x6998, 0x6a94, + 0x692e, 0x6a32, 0x7044, 0xa005, 0x1130, 0x2200, 0xa105, 0x0904, + 0x3ed9, 0x7047, 0x0015, 0x0804, 0x3ed9, 0x0005, 0xd6ac, 0x01f0, + 0xd6f4, 0x0130, 0x682f, 0x0000, 0x6833, 0x0000, 0x0804, 0x3ed9, + 0x68b4, 0xa084, 0x4000, 0xa635, 0xd6f4, 0x1da0, 0x7044, 0xa005, + 0x1110, 0x7047, 0x0015, 0xd6dc, 0x1128, 0x68b4, 0xd0dc, 0x0110, + 0x6ca8, 0x6da4, 0x6c2e, 0x6d32, 0x0804, 0x3ed9, 0xd6f4, 0x0130, + 0x682f, 0x0000, 0x6833, 0x0000, 0x0804, 0x3ed9, 0x68b4, 0xa084, + 0x4800, 0xa635, 0xd6f4, 0x1da0, 0x7044, 0xa005, 0x1110, 0x7047, + 0x0015, 0x2408, 0x2510, 0x2700, 0x8007, 0xa084, 0x007f, 0xa108, + 0xa291, 0x0000, 0x692e, 0x6a32, 0x2100, 0xa205, 0x1110, 0x0804, + 0x3ed9, 0x7000, 0xa086, 0x0006, 0x0110, 0x0804, 0x3ed9, 0x0005, + 0x6946, 0x6008, 0xc0cd, 0xd3cc, 0x0108, 0xc08d, 0x600a, 0x6818, + 0x683a, 0x681b, 0x0006, 0x688f, 0x0000, 0x6893, 0x0000, 0x6a30, + 0x692c, 0x6a3e, 0x6942, 0x682f, 0x0003, 0x6833, 0x0000, 0x6837, + 0x0020, 0x6897, 0x0000, 0x689b, 0x0020, 0x7000, 0x0002, 0x257f, + 0x30ff, 0x30f9, 0x30f7, 0x30f7, 0x30f7, 0x30f7, 0x30f7, 0x080c, + 0x252b, 0x6820, 0xd084, 0x1118, 0x080c, 0x376c, 0x0030, 0x7058, + 0x2c50, 0x2060, 0x6800, 0x6002, 0x2a60, 0x3208, 0xa18c, 0x0600, + 0x0118, 0x2021, 0x4557, 0x0010, 0x2021, 0x4597, 0x2404, 0xa005, + 0x0110, 0x2020, 0x0cd8, 0x2d22, 0x206b, 0x0000, 0x0005, 0x080c, + 0x3772, 0x080c, 0x3786, 0x6008, 0xc0cc, 0x600a, 0x682b, 0x0000, + 0x789b, 0x000e, 0x6f14, 0x6938, 0x691a, 0x6944, 0x6916, 0x3208, + 0xa18c, 0x0600, 0x0118, 0x2009, 0x0000, 0x0010, 0x2009, 0x0001, + 0x080c, 0x428b, 0xd6dc, 0x01c8, 0x691c, 0xc1ed, 0x691e, 0x6828, + 0xa082, 0x000e, 0x0290, 0x6848, 0xa084, 0x000f, 0xa086, 0x000b, + 0x1160, 0x685c, 0xa086, 0x0047, 0x1140, 0x2001, 0x4501, 0x2004, + 0xd0ac, 0x1118, 0x2700, 0x080c, 0x2454, 0x6818, 0xd0fc, 0x0140, + 0x681b, 0x0000, 0x7868, 0xa08c, 0x00ff, 0x0110, 0x681b, 0x001e, + 0xb284, 0x0600, 0x1118, 0x2021, 0x4597, 0x0010, 0x2021, 0x4557, + 0x6800, 0x2022, 0x6a3c, 0x6940, 0x6a32, 0x692e, 0x68c0, 0x2060, + 0x6000, 0xd0a4, 0x0580, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, + 0x0020, 0x00d6, 0x00f6, 0x0156, 0x0146, 0x2079, 0x4500, 0x080c, + 0x1b77, 0x014e, 0x015e, 0x00fe, 0x70c8, 0x2010, 0x2009, 0x0101, + 0x0026, 0x2204, 0xa06d, 0x0140, 0x6814, 0xa706, 0x0110, 0x6800, + 0x0cc8, 0x6820, 0xc0d5, 0x6822, 0x002e, 0x8210, 0x8109, 0x1d80, + 0x00de, 0x7063, 0x0003, 0x707b, 0x0000, 0x7772, 0x707f, 0x000f, + 0x71d0, 0xc1c4, 0x71d2, 0x6818, 0xa086, 0x0002, 0x1138, 0x6817, + 0x0000, 0x682b, 0x0000, 0x681c, 0xc0ec, 0x681e, 0x080c, 0x1d89, + 0x0804, 0x257f, 0x7cd8, 0x7ddc, 0x7fd0, 0x080c, 0x3068, 0x682b, + 0x0000, 0x789b, 0x000e, 0x6f14, 0x080c, 0x3c10, 0xa08c, 0x00ff, + 0x6916, 0x6818, 0xd0fc, 0x0110, 0x7044, 0x681a, 0xa68c, 0xdf00, + 0x691e, 0x7063, 0x0000, 0x0804, 0x257f, 0x7000, 0xa005, 0x1110, + 0x0804, 0x257f, 0xa006, 0x080c, 0x3ed9, 0x6920, 0xd1ac, 0x1110, + 0x681b, 0x0014, 0xa68c, 0xdf00, 0x691e, 0x682b, 0x0000, 0x6820, + 0xa084, 0x00ff, 0x6822, 0x7000, 0x0002, 0x257f, 0x31e7, 0x31e7, + 0x31ea, 0x31ea, 0x31ea, 0x31e5, 0x31e5, 0x080c, 0x252b, 0x6818, + 0x0804, 0x2ea4, 0x6008, 0xc0a4, 0x600a, 0x6817, 0x0000, 0x0804, + 0x373a, 0x2300, 0x0002, 0x31f6, 0x31f8, 0x3241, 0x080c, 0x252b, + 0xd6fc, 0x1904, 0x2cdf, 0x7000, 0xa00d, 0x0002, 0x257f, 0x3208, + 0x3208, 0x3231, 0x3208, 0x323e, 0x3206, 0x3206, 0x080c, 0x252b, + 0xa684, 0x0060, 0x0530, 0xa086, 0x0060, 0x1508, 0xc6ac, 0xc6f4, + 0xc6ed, 0x7e5a, 0x681c, 0xc0ac, 0x681e, 0xa186, 0x0002, 0x0148, + 0x080c, 0x3ed9, 0x69ac, 0x68b0, 0xa115, 0x0118, 0x080c, 0x41ad, + 0x0010, 0x080c, 0x4180, 0x781b, 0x0083, 0x71d0, 0xd1b4, 0x1904, + 0x257c, 0x70a0, 0xa086, 0x0001, 0x1904, 0x25c0, 0x0005, 0xd6ec, + 0x09f8, 0x6818, 0xd0fc, 0x0150, 0xd6f4, 0x1130, 0x681b, 0x0015, + 0x781b, 0x0083, 0x0804, 0x257c, 0x681b, 0x0007, 0x080c, 0x3bb7, + 0x0005, 0x080c, 0x252b, 0x2300, 0x0002, 0x324a, 0x326c, 0x32c3, + 0x080c, 0x252b, 0x7000, 0x0002, 0x3254, 0x3256, 0x325d, 0x3254, + 0x3254, 0x3254, 0x3254, 0x3254, 0x080c, 0x252b, 0x69ac, 0x68b0, + 0xa115, 0x0118, 0x080c, 0x41ad, 0x0010, 0x080c, 0x4180, 0x681c, + 0xc0b4, 0x681e, 0x70d0, 0xd0b4, 0x1904, 0x257c, 0x70a0, 0xa086, + 0x0001, 0x1904, 0x25c0, 0x0005, 0xd6fc, 0x1904, 0x32b3, 0x7000, + 0xa00d, 0x0002, 0x257f, 0x3282, 0x327c, 0x32ab, 0x3282, 0x32b0, + 0x327a, 0x327a, 0x080c, 0x252b, 0x6894, 0x78d6, 0x78de, 0x6898, + 0x78d2, 0x78da, 0xa684, 0x0060, 0x0530, 0xa086, 0x0060, 0x1508, + 0xa6b4, 0xbfbf, 0xc6ed, 0x7e5a, 0xa186, 0x0002, 0x0148, 0x080c, + 0x3ed9, 0x69ac, 0x68b0, 0xa115, 0x0118, 0x080c, 0x41ad, 0x0010, + 0x080c, 0x4180, 0x781b, 0x0083, 0x681c, 0xc0b4, 0x681e, 0x71d0, + 0xd1b4, 0x1904, 0x257c, 0x70a0, 0xa086, 0x0001, 0x1904, 0x25c0, + 0x0005, 0xd6ec, 0x09f8, 0x6818, 0xd0fc, 0x0110, 0x681b, 0x0007, + 0x781b, 0x00fb, 0x0005, 0xc6fc, 0x7e5a, 0x7adc, 0x79d8, 0x6b98, + 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x79d2, + 0x781b, 0x0083, 0x0005, 0xd6dc, 0x0130, 0x782b, 0x3009, 0x781b, + 0x0083, 0x0804, 0x257c, 0x7884, 0xc0ac, 0x7886, 0x78e4, 0xa084, + 0x0008, 0x1150, 0xa484, 0x0200, 0x0108, 0xc6f5, 0xc6dd, 0x7e5a, + 0x781b, 0x0083, 0x0804, 0x257c, 0x6820, 0xc095, 0x6822, 0x080c, + 0x3ba2, 0xc6dd, 0x080c, 0x39ff, 0x781b, 0x0082, 0x0804, 0x257c, + 0x2300, 0x0002, 0x32ed, 0x32ef, 0x32f1, 0x080c, 0x252b, 0x0804, + 0x39f9, 0x7d98, 0xd6d4, 0x11f8, 0x79e4, 0xd1ac, 0x0130, 0x78ec, + 0xa084, 0x0003, 0x0110, 0x782b, 0x3009, 0x789b, 0x0060, 0x78ab, + 0x0000, 0xa684, 0xfffb, 0x785a, 0x7d9a, 0x79e4, 0xd1ac, 0x0120, + 0x78ec, 0xa084, 0x0003, 0x1120, 0x2001, 0x0014, 0x0804, 0x2ea4, + 0xa184, 0x0007, 0x04c2, 0x7a90, 0xa294, 0x0007, 0x789b, 0x0060, + 0x79a8, 0x81ff, 0x0568, 0x789b, 0x0080, 0x7ba8, 0xa384, 0x0001, + 0x11d0, 0x7ba8, 0x7ba8, 0xa386, 0x0004, 0x1118, 0x2009, 0xffdf, + 0x0058, 0xa386, 0x0001, 0x1118, 0x2009, 0xfff7, 0x0028, 0xa386, + 0x0003, 0x1148, 0x2009, 0xffef, 0x00c6, 0x7054, 0x2060, 0x6004, + 0xa104, 0x6006, 0x00ce, 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, + 0xfffb, 0x785a, 0x782b, 0x3009, 0x6920, 0xa18c, 0xecff, 0x6922, + 0x7d9a, 0x0804, 0x3bab, 0x2b90, 0x2b99, 0x3355, 0x335b, 0x3353, + 0x3353, 0x3bab, 0x3bab, 0x080c, 0x252b, 0x6920, 0xa18c, 0xfcff, + 0x6922, 0x0804, 0x3bb1, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0804, + 0x3bab, 0x79e4, 0xa184, 0x0030, 0x0120, 0x78ec, 0xa084, 0x0003, + 0x1570, 0x7000, 0xa086, 0x0004, 0x1190, 0x7060, 0xa086, 0x0002, + 0x1130, 0x2011, 0x0002, 0x2019, 0x0000, 0x0804, 0x2a4d, 0x7060, + 0xa086, 0x0006, 0x0db0, 0x7060, 0xa086, 0x0004, 0x0d90, 0x7000, + 0xa086, 0x0000, 0x0904, 0x257c, 0x6920, 0xa184, 0x0420, 0x0128, + 0xc1d4, 0x6922, 0x6818, 0x0804, 0x2ea4, 0x6818, 0xa08e, 0x0002, + 0x0120, 0xc0fd, 0x681a, 0x2001, 0x0014, 0x0804, 0x2ea4, 0xa184, + 0x0007, 0x0002, 0x3bab, 0x3bab, 0x33a2, 0x3bab, 0x3bef, 0x3bef, + 0x3bab, 0x3bab, 0xd6bc, 0x0570, 0x7180, 0x81ff, 0x0558, 0xa182, + 0x000d, 0x1318, 0x7083, 0x0000, 0x0028, 0xa182, 0x000c, 0x7082, + 0x2009, 0x000c, 0x789b, 0x0061, 0x79aa, 0x0156, 0x0136, 0x0146, + 0x7084, 0x8114, 0xa210, 0x7286, 0xa080, 0x000b, 0xad00, 0x2098, + 0xb284, 0x0600, 0x0118, 0x20a1, 0x022b, 0x0010, 0x20a1, 0x012b, + 0x789b, 0x0000, 0x8108, 0x81ac, 0x53a6, 0x014e, 0x013e, 0x015e, + 0x0804, 0x3bb1, 0xd6d4, 0x1904, 0x3415, 0x6820, 0xd084, 0x0904, + 0x3bb1, 0xa68c, 0x0060, 0xa684, 0x0060, 0x0120, 0xa086, 0x0060, + 0x1108, 0xc1f5, 0xc194, 0x795a, 0x69b6, 0x789b, 0x0060, 0x78ab, + 0x0000, 0x789b, 0x0061, 0x6818, 0xc0fd, 0x681a, 0x78aa, 0x8008, + 0x810c, 0x0904, 0x379b, 0xa18c, 0x00f8, 0x1904, 0x379b, 0x0156, + 0x0136, 0x0146, 0x0016, 0x20a1, 0x012b, 0x3208, 0xa18c, 0x0600, + 0x0110, 0x20a1, 0x022b, 0x001e, 0x789b, 0x0000, 0x8000, 0x80ac, + 0xad80, 0x000b, 0x2098, 0x53a6, 0x014e, 0x013e, 0x015e, 0x6814, + 0xc0fc, 0x8007, 0x7882, 0x0804, 0x3bb1, 0x6818, 0xd0fc, 0x0110, + 0x681b, 0x0008, 0x080c, 0x39ff, 0x781b, 0x00ed, 0x0005, 0x2300, + 0x0002, 0x3426, 0x34e8, 0x3424, 0x080c, 0x252b, 0x7cd8, 0x7ddc, + 0x7fd0, 0x82ff, 0x1528, 0x7200, 0xa286, 0x0003, 0x0904, 0x2e72, + 0x71d0, 0xd1bc, 0x11f8, 0xd1b4, 0x01e8, 0x2001, 0x4501, 0x2004, + 0xd0c4, 0x11c0, 0x00d6, 0x783b, 0x8800, 0x781b, 0x0059, 0x70b8, + 0xa06d, 0x68b4, 0xc0a5, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, + 0x78d2, 0x78da, 0xc1b4, 0x71d2, 0x7003, 0x0030, 0x00de, 0x0030, + 0x7200, 0x0020, 0x783b, 0x1800, 0x781b, 0x0057, 0xa284, 0x000f, + 0x0002, 0x34d3, 0x3490, 0x3463, 0x2ea1, 0x3461, 0x34d3, 0x3461, + 0x3461, 0x080c, 0x252b, 0x681c, 0xd0ec, 0x0118, 0x6008, 0xc08d, + 0x600a, 0x6920, 0xc185, 0x6922, 0x6800, 0x6006, 0xa005, 0x1108, + 0x6002, 0x6008, 0xc0d4, 0x600a, 0x681c, 0xa084, 0x000e, 0x1148, + 0xb284, 0x0600, 0x0118, 0x2009, 0x8bc0, 0x0040, 0x2009, 0x8cd0, + 0x0028, 0x7030, 0x68ba, 0x713c, 0x70c8, 0xa108, 0x2104, 0x6802, + 0x2d0a, 0x715a, 0xd6dc, 0x1120, 0xc6fc, 0x6eb6, 0x0804, 0x34d3, + 0x6eb6, 0xa684, 0x0060, 0x1120, 0xa684, 0x7fff, 0x68b6, 0x04d8, 0xd6dc, 0x1150, 0xa684, 0x7fff, 0x68b6, 0x6894, 0x68a6, 0x6898, - 0x68aa, 0x080c, 0x3d52, 0x0478, 0xd6ac, 0x0140, 0xa006, 0x080c, - 0x3d52, 0x2408, 0x2510, 0x69aa, 0x6aa6, 0x0068, 0x2408, 0x2510, + 0x68aa, 0x080c, 0x3ed9, 0x0478, 0xd6ac, 0x0140, 0xa006, 0x080c, + 0x3ed9, 0x2408, 0x2510, 0x69aa, 0x6aa6, 0x0068, 0x2408, 0x2510, 0x2700, 0x8007, 0xa084, 0x007f, 0xa108, 0xa291, 0x0000, 0x69aa, - 0x6aa6, 0x080c, 0x3d52, 0xd6fc, 0x01b0, 0xa684, 0x7fff, 0x68b6, + 0x6aa6, 0x080c, 0x3ed9, 0xd6fc, 0x01b0, 0xa684, 0x7fff, 0x68b6, 0x2510, 0x2408, 0xd6ac, 0x1138, 0x2700, 0x8007, 0xa084, 0x007f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, - 0x2200, 0xa303, 0x68ae, 0x7000, 0xa086, 0x0030, 0x1904, 0x248f, - 0x7003, 0x0002, 0x70bc, 0xa06d, 0x68bc, 0x7042, 0x70b8, 0xa065, - 0x68c0, 0x705a, 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, 0x0005, + 0x2200, 0xa303, 0x68ae, 0x7000, 0xa086, 0x0030, 0x1904, 0x257f, + 0x7003, 0x0002, 0x70b8, 0xa06d, 0x68bc, 0x703e, 0x70b4, 0xa065, + 0x68c0, 0x7056, 0x2d00, 0x704a, 0xad80, 0x0009, 0x7042, 0x0005, 0xa586, 0x8800, 0x1148, 0x7003, 0x0000, 0x6018, 0x8001, 0x601a, - 0x6008, 0xa084, 0xfbef, 0x600a, 0x0804, 0x3831, 0x7047, 0x0000, - 0xa282, 0x0006, 0x0310, 0x080c, 0x243b, 0x2300, 0x0002, 0x33b2, - 0x33e4, 0x340f, 0x2200, 0x0002, 0x33ba, 0x3831, 0x33bc, 0x33ba, - 0x343f, 0x349d, 0x080c, 0x243b, 0x7003, 0x0005, 0xb284, 0x0600, - 0x0118, 0x2001, 0x8ae0, 0x0010, 0x2001, 0x8b12, 0x2068, 0x704e, - 0x0156, 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, 0x1f04, 0x33cb, + 0x6008, 0xa084, 0xfbef, 0x600a, 0x0804, 0x39f9, 0x7043, 0x0000, + 0xa282, 0x0006, 0x0310, 0x080c, 0x252b, 0x2300, 0x0002, 0x3502, + 0x3534, 0x355f, 0x2200, 0x0002, 0x350a, 0x39f9, 0x350c, 0x350a, + 0x358f, 0x35f9, 0x080c, 0x252b, 0x7003, 0x0005, 0xb284, 0x0600, + 0x0118, 0x2001, 0x8ce0, 0x0010, 0x2001, 0x8d12, 0x2068, 0x704a, + 0x0156, 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, 0x1f04, 0x351b, 0x015e, 0xb284, 0x0600, 0x0118, 0x6817, 0x0000, 0x0010, 0x6817, - 0x8000, 0xad80, 0x0009, 0x7046, 0x68b7, 0x0700, 0x6823, 0x0800, - 0x6827, 0x0003, 0x0804, 0x3809, 0x7000, 0xa086, 0x0002, 0x1150, - 0x080c, 0x35c5, 0x0010, 0x080c, 0x3d52, 0x6008, 0xa084, 0xfbef, + 0x8000, 0xad80, 0x0009, 0x7042, 0x68b7, 0x0700, 0x6823, 0x0800, + 0x6827, 0x0003, 0x0804, 0x39d0, 0x7000, 0xa086, 0x0002, 0x1150, + 0x080c, 0x3786, 0x0010, 0x080c, 0x3ed9, 0x6008, 0xa084, 0xfbef, 0x600a, 0x0020, 0x7000, 0xa086, 0x0003, 0x0da8, 0x7003, 0x0005, - 0xb284, 0x0600, 0x0118, 0x2001, 0x8ae0, 0x0010, 0x2001, 0x8b12, - 0x2068, 0x704e, 0xad80, 0x0009, 0x7046, 0x2200, 0x0002, 0x3831, - 0x340d, 0x340d, 0x343f, 0x340d, 0x3831, 0x080c, 0x243b, 0x7000, - 0xa086, 0x0002, 0x1150, 0x080c, 0x35c5, 0x0010, 0x080c, 0x3d52, + 0xb284, 0x0600, 0x0118, 0x2001, 0x8ce0, 0x0010, 0x2001, 0x8d12, + 0x2068, 0x704a, 0xad80, 0x0009, 0x7042, 0x2200, 0x0002, 0x39f9, + 0x355d, 0x355d, 0x358f, 0x355d, 0x39f9, 0x080c, 0x252b, 0x7000, + 0xa086, 0x0002, 0x1150, 0x080c, 0x3786, 0x0010, 0x080c, 0x3ed9, 0x6008, 0xa084, 0xfbef, 0x600a, 0x0020, 0x7000, 0xa086, 0x0003, - 0x0da8, 0x7003, 0x0005, 0xb284, 0x0600, 0x0118, 0x2001, 0x8ae0, - 0x0010, 0x2001, 0x8b12, 0x2068, 0x704e, 0xad80, 0x0009, 0x7046, - 0x2200, 0x0002, 0x343a, 0x3438, 0x3438, 0x343a, 0x3438, 0x343a, - 0x080c, 0x243b, 0x080c, 0x3846, 0x781b, 0x0082, 0x0005, 0x7000, - 0xa086, 0x0002, 0x1158, 0x70d4, 0xc0b5, 0x70d6, 0x2c00, 0x70ba, - 0x2d00, 0x70be, 0x0038, 0x080c, 0x3d52, 0x0020, 0x7000, 0xa086, + 0x0da8, 0x7003, 0x0005, 0xb284, 0x0600, 0x0118, 0x2001, 0x8ce0, + 0x0010, 0x2001, 0x8d12, 0x2068, 0x704a, 0xad80, 0x0009, 0x7042, + 0x2200, 0x0002, 0x358a, 0x3588, 0x3588, 0x358a, 0x3588, 0x358a, + 0x080c, 0x252b, 0x080c, 0x3a0e, 0x781b, 0x0082, 0x0005, 0x7000, + 0xa086, 0x0002, 0x1158, 0x70d0, 0xc0b5, 0x70d2, 0x2c00, 0x70b6, + 0x2d00, 0x70ba, 0x0038, 0x080c, 0x3ed9, 0x0020, 0x7000, 0xa086, 0x0003, 0x0dc8, 0x7003, 0x0001, 0x7a80, 0xa294, 0x0f00, 0x789b, - 0x0018, 0x7ca8, 0xa484, 0x001f, 0xa215, 0x2069, 0x89c0, 0xb284, - 0x0600, 0x1118, 0xc2fd, 0x2069, 0x8ad0, 0x2d04, 0x2d08, 0x715e, + 0x0018, 0x7ca8, 0xa484, 0x001f, 0xa215, 0x2069, 0x8bc0, 0xb284, + 0x0600, 0x1118, 0xc2fd, 0x2069, 0x8cd0, 0x2d04, 0x2d08, 0x715a, 0xa06d, 0x0128, 0x6814, 0xa206, 0x0500, 0x6800, 0x0cb8, 0x7003, - 0x0005, 0xd2fc, 0x1118, 0x2001, 0x8ae0, 0x0010, 0x2001, 0x8b12, - 0x2068, 0x704e, 0x0156, 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, - 0x1f04, 0x347d, 0x015e, 0xad80, 0x0009, 0x7046, 0x6a16, 0x68b7, + 0x0005, 0xd2fc, 0x1118, 0x2001, 0x8ce0, 0x0010, 0x2001, 0x8d12, + 0x2068, 0x704a, 0x0156, 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, + 0x1f04, 0x35cd, 0x015e, 0xad80, 0x0009, 0x7042, 0x6a16, 0x68b7, 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, 0x6eb4, 0x7e5a, 0x6920, - 0xa184, 0x0c00, 0x0904, 0x3507, 0x681b, 0x0005, 0xc1ad, 0xc1d4, - 0x6922, 0x080c, 0x383d, 0x0804, 0x3507, 0x7200, 0xa286, 0x0002, - 0x1158, 0x70d4, 0xc0b5, 0x70d6, 0x2c00, 0x70ba, 0x2d00, 0x70be, - 0x0030, 0x080c, 0x3d52, 0x0018, 0xa286, 0x0003, 0x0dd0, 0x7003, - 0x0001, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, - 0x001f, 0xa215, 0xb284, 0x0600, 0x1108, 0xc2fd, 0x79a8, 0x79a8, - 0xa18c, 0x00ff, 0x70cc, 0xa168, 0x2d04, 0x2d08, 0x715e, 0xa06d, - 0x0128, 0x6814, 0xa206, 0x0538, 0x6800, 0x0cb8, 0x7003, 0x0005, - 0xb284, 0x0600, 0x0118, 0x2001, 0x8ae0, 0x0010, 0x2001, 0x8b12, - 0x2068, 0x704e, 0x0156, 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, - 0x1f04, 0x34dd, 0x015e, 0xb284, 0x0600, 0x0110, 0xc2fc, 0x0008, - 0xc2fd, 0x6a16, 0xad80, 0x0009, 0x7046, 0x68b7, 0x0700, 0x6823, - 0x0800, 0x6827, 0x0003, 0x6eb4, 0x6920, 0xa184, 0x0c00, 0x0178, - 0xd0dc, 0x0118, 0x080c, 0x3843, 0x0050, 0x681b, 0x0005, 0xc1ad, - 0xc1d4, 0x6922, 0x080c, 0x383d, 0x707f, 0x0000, 0x0000, 0xa6ac, - 0x0060, 0x05c8, 0x6b98, 0x6c94, 0x69ac, 0x68b0, 0xa105, 0x11c0, - 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0xa6b4, 0xb7ff, 0xa586, 0x0060, - 0x0550, 0xc6ed, 0x7e5a, 0x2009, 0x0083, 0xd69c, 0x0128, 0x2009, - 0x0082, 0x2019, 0x0000, 0x2320, 0x791a, 0x080c, 0x3fb8, 0x0418, - 0x68b0, 0xa31a, 0x2100, 0xa423, 0x2400, 0xa305, 0x01a0, 0x7bd2, - 0x7bda, 0x7cd6, 0x7cde, 0x68b0, 0xc6f4, 0x7e5a, 0x2011, 0x0083, - 0xd69c, 0x0128, 0x2011, 0x0082, 0x2019, 0x0000, 0x2320, 0x7a1a, - 0x080c, 0x3fe5, 0x0040, 0x7e5a, 0x2009, 0x0083, 0xd69c, 0x0110, - 0x2009, 0x0082, 0x791a, 0x68c0, 0x705a, 0x2d00, 0x704e, 0x68c4, - 0x2060, 0x71d4, 0xd1b4, 0x1904, 0x248c, 0x2300, 0xa405, 0x0904, - 0x248c, 0x70a4, 0xa086, 0x0001, 0x1904, 0x24ce, 0x0005, 0x6020, + 0xa184, 0x0c00, 0x0904, 0x3670, 0x7060, 0xa086, 0x0006, 0x1128, + 0x7070, 0xa206, 0x1110, 0x7062, 0x707a, 0x681b, 0x0005, 0xc1ad, + 0x681b, 0x0005, 0xc1ad, 0xc1d4, 0x6922, 0x080c, 0x3a05, 0x0804, + 0x3670, 0x7200, 0xa286, 0x0002, 0x1158, 0x70d0, 0xc0b5, 0x70d2, + 0x2c00, 0x70b6, 0x2d00, 0x70ba, 0x0030, 0x080c, 0x3ed9, 0x0018, + 0xa286, 0x0003, 0x0dd0, 0x7003, 0x0001, 0x7a80, 0xa294, 0x0f00, + 0x789b, 0x0018, 0x7ca8, 0xa484, 0x001f, 0xa215, 0xb284, 0x0600, + 0x1108, 0xc2fd, 0x79a8, 0x79a8, 0xa18c, 0x00ff, 0x2118, 0x70c8, + 0xa168, 0x2d04, 0x2d08, 0x715a, 0xa06d, 0x0128, 0x6814, 0xa206, + 0x0538, 0x6800, 0x0cb8, 0x7003, 0x0005, 0xb284, 0x0600, 0x0118, + 0x2001, 0x8ce0, 0x0010, 0x2001, 0x8d12, 0x2068, 0x704a, 0x0156, + 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, 0x1f04, 0x363a, 0x015e, + 0xb284, 0x0600, 0x0110, 0xc2fc, 0x0008, 0xc2fd, 0x6a16, 0xad80, + 0x0009, 0x7042, 0x68b7, 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, + 0x6eb4, 0x6920, 0xa184, 0x0c00, 0x01d8, 0xd0dc, 0x0178, 0x7060, + 0xa086, 0x0004, 0x1140, 0x7070, 0xa206, 0x1128, 0x7074, 0xa306, + 0x1110, 0x7062, 0x707a, 0x080c, 0x3a0b, 0x0050, 0x681b, 0x0005, + 0xc1ad, 0xc1d4, 0x6922, 0x080c, 0x3a05, 0x707b, 0x0000, 0x0000, + 0xc6ec, 0xa6ac, 0x0060, 0x0904, 0x36b7, 0x6b98, 0x6c94, 0x69ac, + 0x68b0, 0xa105, 0x11e0, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0xa586, + 0x0060, 0x05c8, 0xd6f4, 0x1108, 0xc6ed, 0xa6b4, 0xb7ff, 0x7e5a, + 0x2009, 0x0083, 0xd69c, 0x0128, 0x2009, 0x0082, 0x2019, 0x0000, + 0x2320, 0x791a, 0xd6ec, 0x0588, 0x080c, 0x4180, 0x0470, 0x68b0, + 0xa31a, 0x2100, 0xa423, 0x2400, 0xa305, 0x01f8, 0x7bd2, 0x7bda, + 0x7cd6, 0x7cde, 0x68b0, 0xd6f4, 0x1108, 0xc6ed, 0xc6f4, 0x7e5a, + 0x2011, 0x0083, 0xd69c, 0x0128, 0x2011, 0x0082, 0x2019, 0x0000, + 0x2320, 0x7a1a, 0xd6ec, 0x0188, 0x080c, 0x41ad, 0x0070, 0x2019, + 0x0000, 0x2320, 0x0010, 0xa6b4, 0xb7ff, 0x7e5a, 0x2009, 0x0083, + 0xd69c, 0x0110, 0x2009, 0x0082, 0x791a, 0x68c0, 0x7056, 0x2d00, + 0x704a, 0x68c4, 0x2060, 0x71d0, 0x2001, 0x4501, 0x2004, 0xd0c4, + 0x15c8, 0x70d4, 0xa02d, 0x01b8, 0xd1bc, 0x0548, 0x7a80, 0xa294, + 0x0f00, 0x70d8, 0xa206, 0x0118, 0x78e0, 0xa504, 0x1558, 0x70d6, + 0xc1bc, 0x71d2, 0x0438, 0x2031, 0x0001, 0x852c, 0x0218, 0x8633, + 0x8210, 0x0cd8, 0x0005, 0x7de0, 0xa594, 0xff00, 0x0130, 0x2011, + 0x0008, 0x852f, 0x0c81, 0x8637, 0x0008, 0x0c69, 0x8217, 0x7880, + 0xa084, 0x0f00, 0xa206, 0x0170, 0x72da, 0x76d6, 0x0058, 0x7a80, + 0xa294, 0x0f00, 0x70d8, 0xa236, 0x0dc0, 0x78e0, 0xa534, 0x0da8, + 0xc1bd, 0x71d2, 0xd1b4, 0x1904, 0x257c, 0x2300, 0xa405, 0x0904, + 0x257c, 0x70a0, 0xa086, 0x0001, 0x1904, 0x25c0, 0x0005, 0x6020, 0xa005, 0x0150, 0x8001, 0x6022, 0x6008, 0xa085, 0x0008, 0x600a, - 0x700f, 0x0100, 0x702c, 0x6026, 0x0005, 0xa006, 0x080c, 0x3d52, + 0x700f, 0x0100, 0x702c, 0x6026, 0x0005, 0xa006, 0x080c, 0x3ed9, + 0x7000, 0xa086, 0x0002, 0x0120, 0x7060, 0xa086, 0x0005, 0x1150, 0x682b, 0x0000, 0x6817, 0x0000, 0x681b, 0x0001, 0x6823, 0x0040, - 0x681f, 0x0100, 0x7000, 0xa084, 0x000f, 0x0002, 0x248f, 0x358b, - 0x3588, 0x35a7, 0x3594, 0x248f, 0x3586, 0x3586, 0x080c, 0x243b, - 0x0441, 0x0409, 0x0028, 0x0429, 0x705c, 0x2060, 0x6800, 0x6002, - 0x080c, 0x1d3d, 0x0804, 0x248f, 0x7064, 0x7067, 0x0000, 0x7083, - 0x0000, 0x0002, 0x35a3, 0x35a3, 0x35a2, 0x35a2, 0x35a2, 0x35a3, - 0x35a2, 0x35a3, 0x2971, 0x7067, 0x0000, 0x0804, 0x248f, 0x681b, - 0x0000, 0x0804, 0x3012, 0x6800, 0xa005, 0x1108, 0x6002, 0x6006, - 0x0005, 0x6410, 0x84ff, 0x0168, 0x2009, 0x4302, 0x2104, 0x8001, - 0x200a, 0x8421, 0x6412, 0x1128, 0x2021, 0x4304, 0x2404, 0xc0a5, - 0x2022, 0x6008, 0xc0a4, 0x600a, 0x0005, 0x6018, 0xa005, 0x0110, - 0x8001, 0x601a, 0x0005, 0x080c, 0x3aa0, 0x681b, 0x0018, 0x04a0, - 0x080c, 0x3aa0, 0x681b, 0x0019, 0x0478, 0x080c, 0x3aa0, 0x681b, - 0x001a, 0x0450, 0x080c, 0x3aa0, 0x681b, 0x0003, 0x0428, 0x7774, - 0x080c, 0x396d, 0x7178, 0xa18c, 0x00ff, 0x3210, 0xa294, 0x0600, - 0x0118, 0xa1e8, 0x88c0, 0x0010, 0xa1e8, 0x89d0, 0x2d04, 0x2d08, - 0x2068, 0xa005, 0x1118, 0x707e, 0x0804, 0x248f, 0x6814, 0xc0fc, - 0x7274, 0xc2fc, 0xa206, 0x0110, 0x6800, 0x0c88, 0x6800, 0x200a, - 0x681b, 0x0005, 0x707f, 0x0000, 0x080c, 0x35b1, 0x6820, 0xd084, - 0x1110, 0x080c, 0x35ab, 0x080c, 0x35c5, 0x681f, 0x0000, 0x6823, - 0x0020, 0x080c, 0x1d3d, 0x0804, 0x248f, 0xa282, 0x0003, 0x1904, - 0x380d, 0x7da8, 0xa5ac, 0x00ff, 0x7ea8, 0xa6b4, 0x00ff, 0x6920, - 0xc1bd, 0x6922, 0xd1c4, 0x0590, 0xc1c4, 0x6922, 0xa6b4, 0x00ff, - 0x0510, 0xa682, 0x001c, 0x0218, 0x0110, 0x2031, 0x001c, 0x852b, - 0x852b, 0x2041, 0x0000, 0x080c, 0x38c6, 0x0118, 0x080c, 0x36f6, - 0x00a0, 0x080c, 0x3892, 0x080c, 0x36f3, 0x6920, 0xc1c5, 0x6922, + 0x681f, 0x0100, 0x7000, 0xa084, 0x000f, 0x0002, 0x257f, 0x374b, + 0x3748, 0x3768, 0x3754, 0x257f, 0x3746, 0x3746, 0x080c, 0x252b, + 0x0449, 0x0411, 0x0028, 0x0431, 0x7058, 0x2060, 0x6800, 0x6002, + 0x080c, 0x1d89, 0x0804, 0x257f, 0x7060, 0x7063, 0x0000, 0x707f, + 0x0000, 0x0002, 0x3764, 0x3764, 0x3762, 0x3762, 0x3762, 0x3764, + 0x3762, 0x3764, 0x0804, 0x2a62, 0x7063, 0x0000, 0x0804, 0x257f, + 0x681b, 0x0000, 0x0804, 0x3117, 0x6800, 0xa005, 0x1108, 0x6002, + 0x6006, 0x0005, 0x6410, 0x84ff, 0x0168, 0x2009, 0x4502, 0x2104, + 0x8001, 0x200a, 0x8421, 0x6412, 0x1128, 0x2021, 0x4504, 0x2404, + 0xc0a5, 0x2022, 0x6008, 0xc0a4, 0x600a, 0x0005, 0x6018, 0xa005, + 0x0110, 0x8001, 0x601a, 0x0005, 0x080c, 0x3c0c, 0x681b, 0x0018, + 0x0490, 0x080c, 0x3c0c, 0x681b, 0x0019, 0x0468, 0x080c, 0x3c0c, + 0x681b, 0x001a, 0x0440, 0x080c, 0x3c0c, 0x681b, 0x0003, 0x0418, + 0x7770, 0x080c, 0x3b35, 0x7174, 0xa18c, 0x00ff, 0x3210, 0xa294, + 0x0600, 0x0118, 0xa1e8, 0x8ac0, 0x0010, 0xa1e8, 0x8bd0, 0x2d04, + 0x2d08, 0x2068, 0xa005, 0x1118, 0x707a, 0x0804, 0x257f, 0x6814, + 0x7270, 0xa206, 0x0110, 0x6800, 0x0c98, 0x6800, 0x200a, 0x681b, + 0x0005, 0x707b, 0x0000, 0x080c, 0x3772, 0x6820, 0xd084, 0x1110, + 0x080c, 0x376c, 0x080c, 0x3786, 0x681f, 0x0000, 0x6823, 0x0020, + 0x080c, 0x1d89, 0x0804, 0x257f, 0xa282, 0x0003, 0x1904, 0x39d5, + 0x7da8, 0xa5ac, 0x00ff, 0x7ea8, 0xa6b4, 0x00ff, 0x6920, 0xc1bd, + 0x6922, 0xd1c4, 0x05b0, 0xc1c4, 0x6922, 0xa6b4, 0x00ff, 0x0530, + 0xa682, 0x001c, 0x0218, 0x0110, 0x2031, 0x001c, 0xa686, 0x0010, + 0x1108, 0x8630, 0x852b, 0x852b, 0x2041, 0x0000, 0x080c, 0x3a8e, + 0x0118, 0x080c, 0x38bd, 0x00a0, 0x080c, 0x3a5a, 0x080c, 0x38ba, + 0x6920, 0xc1c5, 0x6922, 0x7e58, 0xc695, 0x7e5a, 0xd6d4, 0x1118, + 0x781b, 0x006e, 0x0005, 0x781b, 0x0082, 0x0005, 0x080c, 0x38ba, + 0x7e58, 0xd6d4, 0x1118, 0x781b, 0x0071, 0x0005, 0x781b, 0x0083, + 0x0005, 0x00c6, 0x7054, 0x2060, 0x6100, 0xd1e4, 0x0598, 0x6208, + 0x8217, 0xa294, 0x00ff, 0xa282, 0x001c, 0x0218, 0x0110, 0x2011, + 0x001c, 0x2600, 0xa202, 0x1208, 0x2230, 0xa686, 0x0010, 0x1108, + 0x8630, 0x6208, 0xa294, 0x00ff, 0x78ec, 0xd0e4, 0x0130, 0xa282, + 0x000a, 0x1240, 0x2011, 0x000a, 0x0028, 0xa282, 0x000c, 0x1210, + 0x2011, 0x000c, 0x2200, 0xa502, 0x1208, 0x2228, 0x080c, 0x3a5e, + 0x852b, 0x852b, 0x2041, 0x0000, 0x080c, 0x3a8e, 0x0118, 0x080c, + 0x38bd, 0x0020, 0x080c, 0x3a5a, 0x080c, 0x38ba, 0x7858, 0xc095, + 0x785a, 0x00ce, 0x781b, 0x0082, 0x0005, 0x00c6, 0x2960, 0x6000, + 0xd0e4, 0x1178, 0x6010, 0xa084, 0x000f, 0x1130, 0x6104, 0xa18c, + 0xfff5, 0x6106, 0x00ce, 0x0005, 0x2011, 0x0032, 0x2019, 0x0000, + 0x00f0, 0x68a0, 0xd0cc, 0x1dc0, 0x6208, 0xa294, 0x00ff, 0x78ec, + 0xd0e4, 0x0130, 0xa282, 0x000b, 0x1218, 0x2011, 0x000a, 0x0028, + 0xa282, 0x000c, 0x1210, 0x2011, 0x000c, 0x6308, 0x831f, 0xa39c, + 0x00ff, 0xa382, 0x001c, 0x0218, 0x0110, 0x2019, 0x001c, 0x78ab, + 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, + 0x0005, 0x6820, 0xc0c5, 0x6822, 0x080c, 0x3a18, 0x00ce, 0x0005, + 0x00c6, 0x2960, 0x6104, 0xa18c, 0xfff5, 0x6106, 0x2011, 0x0032, + 0x2019, 0x0000, 0x0000, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, + 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005, 0x6820, 0xc0c5, 0x6822, + 0x00ce, 0x0005, 0xa006, 0x2030, 0x2010, 0x00c6, 0x7154, 0x2160, + 0x2018, 0x2008, 0xa084, 0xffe0, 0xa635, 0x7e86, 0x6018, 0x789a, + 0x7eae, 0x6612, 0x78a4, 0xa084, 0x7770, 0xa18c, 0x000f, 0xa105, + 0x2029, 0x4505, 0x252c, 0xd5cc, 0x0140, 0xd3a4, 0x0110, 0xa085, + 0x0800, 0xd3fc, 0x0110, 0xa085, 0x8080, 0x78a6, 0x6016, 0x788a, + 0xa6b4, 0x001f, 0x8637, 0x8204, 0x8004, 0xa605, 0x600e, 0x6004, + 0xa084, 0xffd5, 0x6006, 0x00ce, 0x0005, 0xa282, 0x0002, 0x1904, + 0x39de, 0x7aa8, 0x6920, 0xc1bd, 0x6922, 0xd1cc, 0x0568, 0xc1cc, + 0x6922, 0xa294, 0x00ff, 0xa282, 0x0002, 0x1a04, 0x39d0, 0x080c, + 0x3963, 0x080c, 0x38ba, 0xa980, 0x0001, 0x200c, 0x080c, 0x3b31, + 0x080c, 0x385d, 0x88ff, 0x0178, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, 0xc695, 0x7e5a, 0xd6d4, 0x1118, 0x781b, 0x006e, 0x0005, - 0x781b, 0x0082, 0x0005, 0x080c, 0x36f3, 0x7e58, 0xd6d4, 0x1118, - 0x781b, 0x0071, 0x0005, 0x781b, 0x0083, 0x0005, 0x00c6, 0x7058, - 0x2060, 0x6100, 0xd1e4, 0x0578, 0x6208, 0x8217, 0xa294, 0x00ff, - 0xa282, 0x001c, 0x0218, 0x0110, 0x2011, 0x001c, 0x2600, 0xa202, - 0x1208, 0x2230, 0x6208, 0xa294, 0x00ff, 0x78ec, 0xd0e4, 0x0130, - 0xa282, 0x000a, 0x1240, 0x2011, 0x000a, 0x0028, 0xa282, 0x000c, - 0x1210, 0x2011, 0x000c, 0x2200, 0xa502, 0x1208, 0x2228, 0x080c, - 0x3896, 0x852b, 0x852b, 0x2041, 0x0000, 0x080c, 0x38c6, 0x0118, - 0x080c, 0x36f6, 0x0020, 0x080c, 0x3892, 0x080c, 0x36f3, 0x7858, - 0xc095, 0x785a, 0x00ce, 0x781b, 0x0082, 0x0005, 0x00c6, 0x2960, - 0x6000, 0xd0e4, 0x1178, 0x6010, 0xa084, 0x000f, 0x1130, 0x6104, - 0xa18c, 0xfff5, 0x6106, 0x00ce, 0x0005, 0x2011, 0x0032, 0x2019, - 0x0000, 0x00f0, 0x68a0, 0xd0cc, 0x1dc0, 0x6208, 0xa294, 0x00ff, - 0x78ec, 0xd0e4, 0x0130, 0xa282, 0x000b, 0x1218, 0x2011, 0x000a, - 0x0028, 0xa282, 0x000c, 0x1210, 0x2011, 0x000c, 0x6308, 0x831f, - 0xa39c, 0x00ff, 0xa382, 0x001c, 0x0218, 0x0110, 0x2019, 0x001c, - 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, - 0xa8c0, 0x0005, 0x6820, 0xc0c5, 0x6822, 0x080c, 0x3850, 0x00ce, - 0x0005, 0x00c6, 0x2960, 0x6104, 0xa18c, 0xfff5, 0x6106, 0x2011, - 0x0032, 0x2019, 0x0000, 0x0000, 0x78ab, 0x0001, 0x78ab, 0x0003, - 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005, 0x6820, 0xc0c5, - 0x6822, 0x00ce, 0x0005, 0xa006, 0x2030, 0x2010, 0x00c6, 0x7158, - 0x2160, 0x2018, 0x2008, 0xa084, 0xffe0, 0xa635, 0x7e86, 0x6018, - 0x789a, 0x7eae, 0x6612, 0x78a4, 0xa084, 0x7770, 0xa18c, 0x000f, - 0xa105, 0x2029, 0x4305, 0x252c, 0xd5cc, 0x0140, 0xd3a4, 0x0110, - 0xa085, 0x0800, 0xd3fc, 0x0110, 0xa085, 0x8080, 0x78a6, 0x6016, - 0x788a, 0xa6b4, 0x001f, 0x8637, 0x8204, 0x8004, 0xa605, 0x600e, - 0x6004, 0xa084, 0xffd5, 0x6006, 0x00ce, 0x0005, 0xa282, 0x0002, - 0x1904, 0x3816, 0x7aa8, 0x6920, 0xc1bd, 0x6922, 0xd1cc, 0x0568, - 0xc1cc, 0x6922, 0xa294, 0x00ff, 0xa282, 0x0002, 0x1a04, 0x3809, - 0x080c, 0x379c, 0x080c, 0x36f3, 0xa980, 0x0001, 0x200c, 0x080c, - 0x3969, 0x080c, 0x3696, 0x88ff, 0x0178, 0x789b, 0x0060, 0x2800, - 0x78aa, 0x7e58, 0xc695, 0x7e5a, 0xd6d4, 0x1118, 0x781b, 0x006e, - 0x0005, 0x781b, 0x0082, 0x0005, 0x7e58, 0xd6d4, 0x1118, 0x781b, - 0x0071, 0x0005, 0x781b, 0x0083, 0x0005, 0xa282, 0x0002, 0x1218, - 0xa284, 0x0001, 0x0140, 0x7158, 0xa188, 0x0000, 0x210c, 0xd1ec, - 0x1110, 0x2011, 0x0000, 0x080c, 0x3883, 0x0471, 0x080c, 0x36f3, - 0x7858, 0xc095, 0x785a, 0x781b, 0x0082, 0x0005, 0x00c6, 0x0026, - 0x2960, 0x6000, 0x2011, 0x0001, 0xd0ec, 0x1150, 0x6014, 0xa084, - 0x0040, 0x1120, 0xc1a4, 0x6106, 0xa006, 0x0088, 0x2011, 0x0000, - 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0xa8c0, - 0x0004, 0x080c, 0x3850, 0x6820, 0xa085, 0x0200, 0x6822, 0x002e, - 0x00ce, 0x0005, 0x8807, 0xa715, 0x00c6, 0x2009, 0x0000, 0x7058, - 0x2060, 0x82ff, 0x0110, 0x2009, 0x0040, 0x6018, 0xa080, 0x0002, - 0x789a, 0x78a4, 0xa084, 0xff9f, 0xa105, 0xc0ec, 0xd0b4, 0x1108, - 0xc0ed, 0x6100, 0xd1f4, 0x0110, 0xa085, 0x0020, 0x78a6, 0x6016, - 0x788a, 0x6004, 0xa084, 0xffef, 0x6006, 0x00ce, 0x0005, 0x0006, - 0x7000, 0xa086, 0x0003, 0x0110, 0x000e, 0x0010, 0x000e, 0x0488, - 0xd6ac, 0x0578, 0x7888, 0xa084, 0x0040, 0x0558, 0x7bb8, 0x8307, - 0xa084, 0x007f, 0x1508, 0x8207, 0xa084, 0x00ff, 0xa09e, 0x0001, - 0x1904, 0x382d, 0xd6f4, 0x11d0, 0x79d8, 0x7adc, 0xa108, 0xa291, - 0x0000, 0x79d2, 0x79da, 0x7ad6, 0x7ade, 0x080c, 0x4083, 0x781b, - 0x0080, 0xb284, 0x0600, 0x0118, 0x2001, 0x0000, 0x0010, 0x2001, - 0x0001, 0x080c, 0x3f50, 0x0005, 0x080c, 0x243b, 0x781b, 0x0080, - 0x0005, 0x781b, 0x0083, 0x0005, 0x2039, 0x0000, 0x2041, 0x0000, - 0x2031, 0x0000, 0xa006, 0x2010, 0x080c, 0x36f6, 0x080c, 0x379a, - 0x7e58, 0x04f9, 0x781b, 0x0082, 0x0005, 0x0cd9, 0x6820, 0xc0c4, - 0x6822, 0x00c6, 0x7058, 0x2060, 0x0804, 0x3720, 0x0c91, 0x6820, - 0xc0cc, 0x6822, 0x00c6, 0x7058, 0x2060, 0x0804, 0x37b9, 0x0c49, - 0x6820, 0xa084, 0xecff, 0x6822, 0x00c6, 0x7058, 0x2060, 0x6004, + 0x781b, 0x0082, 0x0005, 0x7e58, 0xd6d4, 0x1118, 0x781b, 0x0071, + 0x0005, 0x781b, 0x0083, 0x0005, 0xa282, 0x0002, 0x1218, 0xa284, + 0x0001, 0x0140, 0x7154, 0xa188, 0x0000, 0x210c, 0xd1ec, 0x1110, + 0x2011, 0x0000, 0x080c, 0x3a4b, 0x0471, 0x080c, 0x38ba, 0x7858, + 0xc095, 0x785a, 0x781b, 0x0082, 0x0005, 0x00c6, 0x0026, 0x2960, + 0x6000, 0x2011, 0x0001, 0xd0ec, 0x1150, 0x6014, 0xa084, 0x0040, + 0x1120, 0xc1a4, 0x6106, 0xa006, 0x0088, 0x2011, 0x0000, 0x78ab, + 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0xa8c0, 0x0004, + 0x080c, 0x3a18, 0x6820, 0xa085, 0x0200, 0x6822, 0x002e, 0x00ce, + 0x0005, 0x8807, 0xa715, 0x00c6, 0x2009, 0x0000, 0x7054, 0x2060, + 0x82ff, 0x0110, 0x2009, 0x0040, 0x6018, 0xa080, 0x0002, 0x789a, + 0x78a4, 0xa084, 0xff9f, 0xa105, 0xc0ec, 0xd0b4, 0x1108, 0xc0ed, + 0x6100, 0xd1f4, 0x0110, 0xa085, 0x0020, 0x78a6, 0x6016, 0x788a, + 0x6004, 0xa084, 0xffef, 0x6006, 0x00ce, 0x0005, 0x0006, 0x7000, + 0xa086, 0x0003, 0x0110, 0x000e, 0x0010, 0x000e, 0x0488, 0xd6ac, + 0x0578, 0x7888, 0xa084, 0x0040, 0x0558, 0x7bb8, 0x8307, 0xa084, + 0x007f, 0x1508, 0x8207, 0xa084, 0x00ff, 0xa09e, 0x0001, 0x1904, + 0x39f5, 0xd6f4, 0x11d0, 0x79d8, 0x7adc, 0xa108, 0xa291, 0x0000, + 0x79d2, 0x79da, 0x7ad6, 0x7ade, 0x080c, 0x425d, 0x781b, 0x0080, + 0xb284, 0x0600, 0x0118, 0x2001, 0x0000, 0x0010, 0x2001, 0x0001, + 0x080c, 0x4118, 0x0005, 0x080c, 0x252b, 0x781b, 0x0080, 0x0005, + 0x781b, 0x0083, 0x0005, 0x2039, 0x0000, 0x2041, 0x0000, 0x2031, + 0x0000, 0xa006, 0x2010, 0x080c, 0x38bd, 0x080c, 0x3961, 0x7e58, + 0x080c, 0x3a11, 0x781b, 0x0082, 0x0005, 0x0cd1, 0x6820, 0xc0c4, + 0x6822, 0x00c6, 0x7054, 0x2060, 0x0804, 0x38e7, 0x0c89, 0x6820, + 0xc0cc, 0x6822, 0x00c6, 0x7054, 0x2060, 0x0804, 0x3980, 0x0c41, + 0x6820, 0xa084, 0xecff, 0x6822, 0x00c6, 0x7054, 0x2060, 0x6004, 0xa084, 0xffc5, 0x6006, 0x00ce, 0x0005, 0x0049, 0x781b, 0x0082, 0x0005, 0x6827, 0x0002, 0x0049, 0x781b, 0x0082, 0x0005, 0x2001, 0x0005, 0x0088, 0x2001, 0x000c, 0x0070, 0x6820, 0xc0d5, 0x6822, 0x2001, 0x0006, 0x0040, 0x2001, 0x000d, 0x0028, 0x2001, 0x0009, 0x0010, 0x2001, 0x0007, 0x789b, 0x007e, 0x78aa, 0xc69d, 0x7e5a, - 0x70d4, 0xd0b4, 0x0168, 0xc0b4, 0x70d6, 0x00c6, 0x70b8, 0xa065, + 0x70d0, 0xd0b4, 0x0168, 0xc0b4, 0x70d2, 0x00c6, 0x70b4, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x00ce, 0x0005, 0x0076, 0x873f, 0xa7bc, 0x000f, 0x873b, 0x873b, 0x8703, - 0xb28c, 0x0600, 0x0118, 0xa0e0, 0x47c0, 0x0010, 0xa0e0, 0x4840, + 0xb28c, 0x0600, 0x0118, 0xa0e0, 0x49c0, 0x0010, 0xa0e0, 0x4a40, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, 0xa184, 0x7fe0, 0x78ae, 0x6012, 0x79a4, 0xa184, 0x773f, 0x78a6, 0x6016, 0x6004, 0xa085, 0x0038, 0x6006, 0x007e, 0x0005, 0x789b, 0x0080, 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0060, 0x78ab, 0x0004, - 0x0804, 0x3850, 0x2031, 0x0000, 0x2029, 0x0032, 0x789b, 0x0080, + 0x0804, 0x3a18, 0x2031, 0x0000, 0x2029, 0x0032, 0x789b, 0x0080, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa, 0x7eaa, - 0x789b, 0x0060, 0x78ab, 0x0005, 0x0804, 0x3850, 0x0156, 0x8007, + 0x789b, 0x0060, 0x78ab, 0x0005, 0x0804, 0x3a18, 0x0156, 0x8007, 0xa084, 0x00ff, 0x8003, 0x8003, 0xa080, 0x0020, 0x789a, 0x79a4, - 0xa18c, 0xffe0, 0x2021, 0x3952, 0x2019, 0x0011, 0x20a9, 0x000e, + 0xa18c, 0xffe0, 0x2021, 0x3b1a, 0x2019, 0x0011, 0x20a9, 0x000e, 0x2011, 0x0032, 0x2404, 0xa084, 0xffe0, 0xa106, 0x0128, 0x8420, - 0x2300, 0xa210, 0x1f04, 0x38ba, 0x015e, 0x0005, 0x0156, 0x0804, - 0x3908, 0x2021, 0x3960, 0x20a9, 0x0009, 0x2011, 0x0029, 0xa582, + 0x2300, 0xa210, 0x1f04, 0x3a82, 0x015e, 0x0005, 0x0156, 0x0804, + 0x3ad0, 0x2021, 0x3b28, 0x20a9, 0x0009, 0x2011, 0x0029, 0xa582, 0x0028, 0x0550, 0x8420, 0x95a9, 0x2011, 0x0033, 0xa582, 0x0033, 0x0618, 0x8420, 0x95a9, 0x2019, 0x000a, 0x2011, 0x0065, 0x2200, - 0xa502, 0x02d0, 0x8420, 0x2300, 0xa210, 0x1f04, 0x38df, 0x015e, - 0x0088, 0x2021, 0x3952, 0x2019, 0x0011, 0x20a9, 0x000e, 0x2011, + 0xa502, 0x02d0, 0x8420, 0x2300, 0xa210, 0x1f04, 0x3aa7, 0x015e, + 0x0088, 0x2021, 0x3b1a, 0x2019, 0x0011, 0x20a9, 0x000e, 0x2011, 0x0033, 0x2200, 0xa502, 0x0240, 0x8420, 0x2300, 0xa210, 0x1f04, - 0x38f1, 0x015e, 0xa006, 0x0005, 0x8211, 0x015e, 0xa582, 0x0064, + 0x3ab9, 0x015e, 0xa006, 0x0005, 0x8211, 0x015e, 0xa582, 0x0064, 0x1220, 0x7808, 0xa085, 0x0070, 0x780a, 0x2404, 0xa005, 0x0005, - 0xa886, 0x0002, 0x01e8, 0x2021, 0x393e, 0x20a9, 0x000d, 0x2011, + 0xa886, 0x0002, 0x01e8, 0x2021, 0x3b06, 0x20a9, 0x000d, 0x2011, 0x0028, 0xa582, 0x0028, 0x0d48, 0x8420, 0x2019, 0x0019, 0x2011, 0x0033, 0x2200, 0xa502, 0x0e00, 0x8420, 0x2300, 0xa210, 0x1f04, - 0x3919, 0x015e, 0x2011, 0x0184, 0xa582, 0x0185, 0x0ab0, 0x0890, - 0x2021, 0x394d, 0x20a9, 0x0003, 0x2011, 0x0024, 0xa586, 0x0024, + 0x3ae1, 0x015e, 0x2011, 0x0184, 0xa582, 0x0185, 0x0ab0, 0x0890, + 0x2021, 0x3b15, 0x20a9, 0x0003, 0x2011, 0x0024, 0xa586, 0x0024, 0x0960, 0x8420, 0x2011, 0x0028, 0xa586, 0x0028, 0x0930, 0x8420, - 0x2019, 0x0019, 0x2011, 0x0033, 0x0804, 0x38f1, 0x1021, 0x2202, + 0x2019, 0x0019, 0x2011, 0x0033, 0x0804, 0x3ab9, 0x1021, 0x2202, 0x3403, 0x4604, 0x5805, 0x6a06, 0x7c07, 0x4610, 0x4612, 0x5812, 0x5a12, 0x6a14, 0x6c14, 0x6e14, 0x7e17, 0x9021, 0xb002, 0xe204, 0xe210, 0xe210, 0x1209, 0x3002, 0x3202, 0x4203, 0x4403, 0x5404, @@ -1391,314 +1485,319 @@ 0x10e1, 0x330a, 0x5805, 0x5a05, 0x6a06, 0x6c06, 0x7c07, 0x7e07, 0x0e00, 0x789b, 0x0080, 0xa046, 0x0005, 0xa784, 0x0f00, 0x800b, 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xd7fc, - 0x0118, 0xa0e0, 0x68c0, 0x0010, 0xa0e0, 0x48c0, 0x0005, 0x00e6, - 0x00f6, 0xd084, 0x0138, 0x2079, 0x0100, 0x2009, 0x4380, 0x2071, - 0x4380, 0x0030, 0x2009, 0x4340, 0x2079, 0x0200, 0x2071, 0x4340, - 0x2091, 0x8000, 0x2104, 0xa084, 0x000f, 0x0002, 0x39c5, 0x39a0, - 0x39a0, 0x39a0, 0x39a0, 0x39a0, 0x399e, 0x399e, 0x080c, 0x243b, - 0x784b, 0x0004, 0x7848, 0xa084, 0x0004, 0x1de0, 0x784b, 0x0008, - 0x7848, 0xa084, 0x0008, 0x1de0, 0x68b4, 0xc0f5, 0x68b6, 0x7858, - 0xc0f5, 0x785a, 0x7830, 0xd0bc, 0x1180, 0xb284, 0x0800, 0x0118, - 0x0104, 0x39c5, 0x0010, 0x0304, 0x39c5, 0x681c, 0xd0ac, 0x1118, - 0x080c, 0x3a4b, 0x0010, 0x781b, 0x00fb, 0x2091, 0x8001, 0x00fe, - 0x00ee, 0x0005, 0x00c6, 0x2001, 0x4301, 0x2004, 0xd0ac, 0x1904, - 0x3a3d, 0x6814, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, - 0xb28c, 0x0600, 0x0118, 0xa0e0, 0x47c0, 0x0010, 0xa0e0, 0x4840, - 0x6004, 0xa084, 0x000a, 0x1904, 0x3a3d, 0x6108, 0xa194, 0xff00, - 0x0904, 0x3a3d, 0xa18c, 0x00ff, 0x601c, 0xa084, 0xff00, 0x0180, - 0x2001, 0x0009, 0xa102, 0x16b8, 0x2001, 0x000a, 0xa102, 0x16b0, - 0x2001, 0x000c, 0xa102, 0x16a8, 0x601c, 0xa084, 0x00ff, 0x601e, - 0x2001, 0x000a, 0xa106, 0x01a8, 0x2001, 0x000c, 0xa106, 0x01a0, - 0x2001, 0x0012, 0xa106, 0x0198, 0x2001, 0x0014, 0xa106, 0x0190, - 0x2001, 0x0019, 0xa106, 0x0188, 0x2001, 0x0032, 0xa106, 0x0180, - 0x00d8, 0x2009, 0x000c, 0x00d0, 0x2009, 0x0012, 0x00b8, 0x2009, - 0x0014, 0x00a0, 0x2009, 0x0019, 0x0088, 0x2009, 0x0020, 0x0070, - 0x2009, 0x003f, 0x0058, 0x2009, 0x000a, 0x0040, 0x2009, 0x000c, - 0x0028, 0x2009, 0x0019, 0x0010, 0x2011, 0x0000, 0x2100, 0xa205, - 0x600a, 0x6004, 0xa085, 0x0002, 0x6006, 0x00ce, 0x0005, 0x781b, - 0x0083, 0x0005, 0x781b, 0x0082, 0x0005, 0x781b, 0x0071, 0x0005, - 0x781b, 0x006e, 0x0005, 0x2009, 0x4319, 0x210c, 0xa186, 0x0000, - 0x0150, 0xa186, 0x0001, 0x0150, 0x701f, 0x000b, 0x7067, 0x0001, - 0x781b, 0x0054, 0x0005, 0x781b, 0x00f3, 0x0005, 0x701f, 0x000a, - 0x0005, 0x2009, 0x4319, 0x210c, 0xa186, 0x0000, 0x0168, 0xa186, - 0x0001, 0x0138, 0x701f, 0x000b, 0x7067, 0x0001, 0x781b, 0x0054, - 0x0005, 0x701f, 0x000a, 0x0005, 0x781b, 0x00f2, 0x0005, 0x781b, - 0x00fb, 0x0005, 0x781b, 0x00fa, 0x0005, 0x781b, 0x00cc, 0x0005, - 0x781b, 0x00cb, 0x0005, 0x6818, 0xd0fc, 0x0110, 0x681b, 0x001d, - 0x7067, 0x0001, 0x781b, 0x0054, 0x0005, 0x7830, 0xa084, 0x00c0, - 0x1170, 0x7808, 0xc08c, 0x780a, 0xe000, 0xe000, 0xe000, 0xe000, - 0x78ec, 0xa084, 0x0021, 0x0118, 0x7808, 0xc08d, 0x780a, 0x0005, - 0x7808, 0xc08d, 0x780a, 0x0005, 0x7830, 0xa084, 0x0040, 0x1de0, - 0xb284, 0x0800, 0x0118, 0x1104, 0x3ab2, 0x0010, 0x1304, 0x3ab2, - 0x78ac, 0x0005, 0x7808, 0xa084, 0xfffd, 0x780a, 0xe000, 0xe000, - 0xe000, 0xe000, 0x78ec, 0xa084, 0x0021, 0x0140, 0xb284, 0x0800, - 0x0118, 0x1104, 0x3ac1, 0x0010, 0x1304, 0x3ac4, 0x78ac, 0x0006, - 0x7808, 0xa085, 0x0002, 0x780a, 0x000e, 0x0005, 0xa784, 0x0001, - 0x1904, 0x30a0, 0xa784, 0x0070, 0x0140, 0x00c6, 0x2d60, 0x2f68, - 0x080c, 0x23e1, 0x2d78, 0x2c68, 0x00ce, 0xa784, 0x0008, 0x0148, - 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0904, 0x248f, 0x0804, - 0x3a3f, 0xa784, 0x0004, 0x01c8, 0x78b8, 0xa084, 0x8000, 0x01a8, - 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0904, 0x248f, 0x78e4, - 0xa084, 0x0007, 0xa086, 0x0001, 0x1140, 0x78c0, 0xa685, 0x4800, - 0x2030, 0x7e5a, 0x781b, 0x00fb, 0x0005, 0xa784, 0x0080, 0x0140, - 0x7884, 0xd0fc, 0x0128, 0x080c, 0x382d, 0x681b, 0x0022, 0x0005, - 0x681b, 0x0003, 0x7858, 0xa084, 0x3f00, 0x681e, 0x682f, 0x0000, - 0x6833, 0x0000, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0904, - 0x2a7a, 0xb284, 0x0800, 0x0110, 0x0104, 0x248c, 0x0304, 0x248c, - 0x6b14, 0x8307, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xd3fc, - 0x0118, 0xa080, 0x4840, 0x0010, 0xa080, 0x47c0, 0x2060, 0x2048, - 0x705a, 0x2a60, 0x0005, 0x00c6, 0x2960, 0x6000, 0xd0ac, 0x0904, - 0x3b81, 0xd1ac, 0x05e0, 0x6108, 0x8117, 0xa18c, 0x00ff, 0x631c, - 0x832f, 0x68a0, 0xd0cc, 0x11c8, 0xa584, 0x00ff, 0x0138, 0x78ec, - 0xd0e4, 0x0110, 0x8213, 0x00b8, 0x2029, 0x0000, 0xa182, 0x000c, - 0x1290, 0x78ec, 0xd0e4, 0x1118, 0x2009, 0x000c, 0x0060, 0xa182, - 0x000b, 0x1248, 0x2009, 0x000a, 0x0030, 0x2009, 0x0032, 0x2011, - 0x0000, 0x2029, 0x0000, 0x78ab, 0x0001, 0x78ab, 0x0006, 0x78ab, - 0x0004, 0x79aa, 0x78ab, 0x0000, 0x7aaa, 0x7baa, 0x7daa, 0xa8c0, - 0x0008, 0x6820, 0xa085, 0x1000, 0x6822, 0x080c, 0x3850, 0xa085, - 0x0001, 0x00ce, 0x0005, 0xa282, 0x0006, 0x1904, 0x381f, 0x7da8, - 0x7eac, 0x8637, 0xa5ac, 0x00ff, 0xa6b4, 0x00ff, 0x7fac, 0x8747, - 0xa7bc, 0x00ff, 0xa8c4, 0x00ff, 0x6920, 0xc1bd, 0x6922, 0xd1e4, - 0x05c8, 0xa18c, 0xecff, 0x6922, 0xa782, 0x0002, 0x1a04, 0x37fc, - 0xa6b4, 0x00ff, 0x0560, 0xa682, 0x0039, 0x1a04, 0x37fc, 0xa582, - 0x0009, 0x0a04, 0x37fc, 0xa882, 0x0003, 0x1a04, 0x37fc, 0xa886, - 0x0002, 0x0128, 0xa886, 0x0000, 0x0138, 0x0804, 0x37fc, 0xa786, - 0x0000, 0x0904, 0x37fc, 0x8634, 0x852b, 0x852b, 0x080c, 0x38c6, - 0x0904, 0x37fc, 0x080c, 0x36f6, 0x080c, 0x379a, 0x7e58, 0xd6d4, - 0x1118, 0x781b, 0x0071, 0x0005, 0x781b, 0x0083, 0x0005, 0x080c, - 0x36f3, 0x0c90, 0xa886, 0x0002, 0x1108, 0x8634, 0x7158, 0xa188, - 0x0000, 0x210c, 0xd1ac, 0x0904, 0x37fc, 0xd1ec, 0x1120, 0x2039, - 0x0000, 0x2041, 0x0000, 0xd1e4, 0x1120, 0x2031, 0x0000, 0x2041, - 0x0000, 0xa782, 0x0002, 0x12c8, 0x621c, 0xa284, 0x00ff, 0xa706, - 0x0110, 0x2039, 0x0000, 0xa605, 0x0190, 0x6108, 0x811f, 0xa39c, - 0x00ff, 0x0168, 0xa302, 0x1208, 0x2330, 0x8807, 0xa705, 0xa086, - 0x0201, 0x0160, 0xa886, 0x0000, 0x0168, 0x2039, 0x0000, 0x2041, - 0x0000, 0x2031, 0x0000, 0xa006, 0x2010, 0x0070, 0xa284, 0xff00, - 0x1108, 0x2040, 0xa184, 0x00ff, 0xa502, 0x0108, 0x2128, 0x852b, - 0x852b, 0x080c, 0x38c6, 0x0d58, 0x080c, 0x36f6, 0x080c, 0x379a, - 0x789b, 0x0080, 0x78ab, 0x0001, 0x78ab, 0x0006, 0x78ab, 0x0004, - 0x78ab, 0x0000, 0x7daa, 0x7eaa, 0x7faa, 0x2800, 0x78aa, 0x789b, - 0x0060, 0x78ab, 0x0005, 0x080c, 0x3850, 0x7858, 0xc095, 0x785a, - 0x781b, 0x0082, 0x0005, 0x0020, 0x0020, 0x0000, 0x0020, 0x0000, - 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, - 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, - 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, - 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0062, 0x0009, 0x0014, - 0x0014, 0x9855, 0x984d, 0x0014, 0x9911, 0x98ff, 0x0014, 0x0014, - 0x0090, 0x00e7, 0x0100, 0x0402, 0x2008, 0xf880, 0x0018, 0x0017, - 0x840f, 0xd8c1, 0x0014, 0x0016, 0xa20a, 0x0014, 0x300b, 0xa20c, - 0x0014, 0x2500, 0x0013, 0x2500, 0x0010, 0x0010, 0x0010, 0x0010, + 0x0118, 0xa0e0, 0x6ac0, 0x0010, 0xa0e0, 0x4ac0, 0x0005, 0x00e6, + 0x00f6, 0xd084, 0x0138, 0x2079, 0x0100, 0x2009, 0x4580, 0x2071, + 0x4580, 0x0030, 0x2009, 0x4540, 0x2079, 0x0200, 0x2071, 0x4540, + 0x2091, 0x8000, 0x2104, 0xa084, 0x000f, 0x0002, 0x3b68, 0x3b68, + 0x3b68, 0x3b68, 0x3b68, 0x3b68, 0x3b66, 0x3b66, 0x080c, 0x252b, + 0x69b4, 0xc1f5, 0xa18c, 0xff9f, 0x69b6, 0xa005, 0x0580, 0x7858, + 0xa084, 0xff9f, 0xa085, 0x6000, 0x785a, 0x7828, 0xa086, 0x1814, + 0x1530, 0x784b, 0x0004, 0x7848, 0xa084, 0x0004, 0x1de0, 0x784b, + 0x0008, 0x7848, 0xa084, 0x0008, 0x1de0, 0x7830, 0xd0bc, 0x11b8, + 0xb284, 0x0800, 0x0118, 0x0104, 0x3b9f, 0x0010, 0x0304, 0x3b9f, + 0x79e4, 0xa184, 0x0030, 0x0158, 0x78ec, 0xa084, 0x0003, 0x0138, + 0x681c, 0xd0ac, 0x1110, 0x00d9, 0x0010, 0x781b, 0x00fb, 0x00fe, + 0x00ee, 0x0005, 0x2001, 0x4501, 0x2004, 0xd0ac, 0x1118, 0x6814, + 0x080c, 0x2454, 0x0005, 0x781b, 0x0083, 0x0005, 0x781b, 0x0082, + 0x0005, 0x781b, 0x0071, 0x0005, 0x781b, 0x006e, 0x0005, 0x2009, + 0x4519, 0x210c, 0xa186, 0x0000, 0x0150, 0xa186, 0x0001, 0x0150, + 0x701f, 0x000b, 0x7063, 0x0001, 0x781b, 0x0054, 0x0005, 0x781b, + 0x00f3, 0x0005, 0x701f, 0x000a, 0x0005, 0x2009, 0x4519, 0x210c, + 0xa186, 0x0000, 0x0168, 0xa186, 0x0001, 0x0138, 0x701f, 0x000b, + 0x7063, 0x0001, 0x781b, 0x0054, 0x0005, 0x701f, 0x000a, 0x0005, + 0x781b, 0x00f2, 0x0005, 0x781b, 0x00fb, 0x0005, 0x781b, 0x00fa, + 0x0005, 0x781b, 0x00cc, 0x0005, 0x781b, 0x00cb, 0x0005, 0x6818, + 0xd0fc, 0x0110, 0x681b, 0x001d, 0x7063, 0x0001, 0x781b, 0x0054, + 0x0005, 0x7830, 0xa084, 0x00c0, 0x1170, 0x7808, 0xc08c, 0x780a, + 0xe000, 0xe000, 0xe000, 0xe000, 0x78ec, 0xa084, 0x0021, 0x0118, + 0x7808, 0xc08d, 0x780a, 0x0005, 0x7808, 0xc08d, 0x780a, 0x0005, + 0x7830, 0xa084, 0x0040, 0x1de0, 0xb284, 0x0800, 0x0118, 0x1104, + 0x3c1e, 0x0010, 0x1304, 0x3c1e, 0x78ac, 0x0005, 0x7808, 0xa084, + 0xfffd, 0x780a, 0xe000, 0xe000, 0xe000, 0xe000, 0x78ec, 0xa084, + 0x0021, 0x0140, 0xb284, 0x0800, 0x0118, 0x1104, 0x3c2d, 0x0010, + 0x1304, 0x3c30, 0x78ac, 0x0006, 0x7808, 0xa085, 0x0002, 0x780a, + 0x000e, 0x0005, 0xa784, 0x0001, 0x1904, 0x31c5, 0xa784, 0x0070, + 0x0140, 0x00c6, 0x2d60, 0x2f68, 0x080c, 0x2446, 0x2d78, 0x2c68, + 0x00ce, 0xa784, 0x0008, 0x0148, 0x784b, 0x0008, 0x78ec, 0xa084, + 0x0003, 0x0904, 0x31c5, 0x0804, 0x3bab, 0xa784, 0x0004, 0x01c8, + 0x78b8, 0xa084, 0x8000, 0x01a8, 0x784b, 0x0008, 0x78ec, 0xa084, + 0x0003, 0x0904, 0x31c5, 0x78e4, 0xa084, 0x0007, 0xa086, 0x0001, + 0x1140, 0x78c0, 0xa685, 0x4800, 0x2030, 0x7e5a, 0x781b, 0x00fb, + 0x0005, 0xa784, 0x0080, 0x0140, 0x7884, 0xd0fc, 0x0128, 0x080c, + 0x39f5, 0x681b, 0x0022, 0x0005, 0x681b, 0x0003, 0x7858, 0xa084, + 0x5f00, 0x681e, 0x682f, 0x0000, 0x6833, 0x0000, 0x784b, 0x0008, + 0x78ec, 0xa084, 0x0003, 0x0904, 0x2b6b, 0xb284, 0x0800, 0x0110, + 0x0104, 0x257c, 0x0304, 0x257c, 0x6b14, 0x8307, 0xa084, 0x000f, + 0x8003, 0x8003, 0x8003, 0xd3fc, 0x0118, 0xa080, 0x4a40, 0x0010, + 0xa080, 0x49c0, 0x2060, 0x2048, 0x7056, 0x2a60, 0x0005, 0x00c6, + 0x2960, 0x6000, 0xd0ac, 0x0904, 0x3ced, 0xd1ac, 0x05e0, 0x6108, + 0x8117, 0xa18c, 0x00ff, 0x631c, 0x832f, 0x68a0, 0xd0cc, 0x11c8, + 0xa584, 0x00ff, 0x0138, 0x78ec, 0xd0e4, 0x0110, 0x8213, 0x00b8, + 0x2029, 0x0000, 0xa182, 0x000c, 0x1290, 0x78ec, 0xd0e4, 0x1118, + 0x2009, 0x000c, 0x0060, 0xa182, 0x000b, 0x1248, 0x2009, 0x000a, + 0x0030, 0x2009, 0x0032, 0x2011, 0x0000, 0x2029, 0x0000, 0x78ab, + 0x0001, 0x78ab, 0x0006, 0x78ab, 0x0004, 0x79aa, 0x78ab, 0x0000, + 0x7aaa, 0x7baa, 0x7daa, 0xa8c0, 0x0008, 0x6820, 0xa085, 0x1000, + 0x6822, 0x080c, 0x3a18, 0xa085, 0x0001, 0x00ce, 0x0005, 0xa282, + 0x0006, 0x1904, 0x39e7, 0x7da8, 0x7eac, 0x8637, 0xa5ac, 0x00ff, + 0xa6b4, 0x00ff, 0x7fac, 0x8747, 0xa7bc, 0x00ff, 0xa8c4, 0x00ff, + 0x6920, 0xc1bd, 0x6922, 0xd1e4, 0x0904, 0x3d59, 0xa18c, 0xecff, + 0x6922, 0xa782, 0x0002, 0x1a04, 0x39c3, 0xa6b4, 0x00ff, 0x0904, + 0x3d56, 0xa682, 0x0039, 0x1a04, 0x39c3, 0xa582, 0x0009, 0x0a04, + 0x39c3, 0xa882, 0x0003, 0x1a04, 0x39c3, 0xa886, 0x0002, 0x01d0, + 0xa886, 0x0000, 0x1904, 0x39c3, 0x2001, 0x000c, 0x79ec, 0xd1e4, + 0x0110, 0x2001, 0x000a, 0xa502, 0x1290, 0x080c, 0x39c3, 0x00c6, + 0x2960, 0x6004, 0xa085, 0x001a, 0x6006, 0x6000, 0xc0ac, 0x6002, + 0x00ce, 0x0005, 0xa786, 0x0000, 0x0904, 0x39c3, 0x8634, 0xa686, + 0x0010, 0x1108, 0x8630, 0x852b, 0x852b, 0x080c, 0x3a8e, 0x0904, + 0x39c3, 0x080c, 0x38bd, 0x080c, 0x3961, 0x7e58, 0xd6d4, 0x1118, + 0x781b, 0x0071, 0x0005, 0x781b, 0x0083, 0x0005, 0x080c, 0x38ba, + 0x0c90, 0xa886, 0x0002, 0x1108, 0x8634, 0x7154, 0xa188, 0x0000, + 0x210c, 0xd1ac, 0x0904, 0x39c3, 0xd1ec, 0x1120, 0x2039, 0x0000, + 0x2041, 0x0000, 0xd1e4, 0x1120, 0x2031, 0x0000, 0x2041, 0x0000, + 0xa782, 0x0002, 0x12c8, 0x621c, 0xa284, 0x00ff, 0xa706, 0x0110, + 0x2039, 0x0000, 0xa605, 0x0190, 0x6108, 0x811f, 0xa39c, 0x00ff, + 0x0168, 0xa302, 0x1208, 0x2330, 0x8807, 0xa705, 0xa086, 0x0201, + 0x0160, 0xa886, 0x0000, 0x0168, 0x2039, 0x0000, 0x2041, 0x0000, + 0x2031, 0x0000, 0xa006, 0x2010, 0x0070, 0xa284, 0xff00, 0x1108, + 0x2040, 0xa184, 0x00ff, 0xa502, 0x0108, 0x2128, 0x852b, 0x852b, + 0x080c, 0x3a8e, 0x0d58, 0x080c, 0x38bd, 0x080c, 0x3961, 0x789b, + 0x0080, 0x78ab, 0x0001, 0x78ab, 0x0006, 0x78ab, 0x0004, 0x78ab, + 0x0000, 0x7daa, 0x7eaa, 0x7faa, 0x2800, 0x78aa, 0x789b, 0x0060, + 0x78ab, 0x0005, 0x080c, 0x3a18, 0x7858, 0xc095, 0x785a, 0x781b, + 0x0082, 0x0005, 0x0020, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, + 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, + 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, + 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, + 0x0000, 0x0020, 0x0000, 0x0020, 0x0062, 0x0009, 0x0014, 0x0014, + 0x9855, 0x984d, 0x0014, 0x9911, 0x98ff, 0x0014, 0x0014, 0x0090, + 0x00e7, 0x0100, 0x0402, 0x2008, 0xf880, 0x0018, 0x0017, 0x840f, + 0xd8c1, 0x0014, 0x0016, 0xa20a, 0x0014, 0x300b, 0xa20c, 0x0014, + 0x2500, 0x0013, 0x2500, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, - 0x0010, 0x0010, 0xa200, 0x3806, 0x8839, 0x20c4, 0x0864, 0xa84f, - 0x3008, 0x28c1, 0x9d18, 0xa201, 0x300c, 0x2847, 0x8161, 0x846a, - 0x8000, 0x84a4, 0x1856, 0x883a, 0xa808, 0x28e2, 0x9cce, 0xa8f3, - 0x0864, 0xa83d, 0x300c, 0xa801, 0x3008, 0x28e1, 0x9cce, 0x2021, - 0xa818, 0xa205, 0x870c, 0xd8de, 0x64a0, 0x6de0, 0x6fc0, 0x67a4, - 0x6c80, 0x0212, 0xa205, 0x883d, 0x882b, 0x1814, 0x883b, 0x7027, - 0x85f2, 0xa737, 0xa532, 0xf003, 0x8576, 0x8677, 0xa814, 0x883e, - 0xa812, 0x280a, 0xa204, 0x64c0, 0x6de0, 0x67a0, 0x6fc0, 0x1814, - 0x883b, 0x7027, 0x8576, 0x8677, 0xa806, 0x796d, 0xa8da, 0x796b, - 0xa8f1, 0x7861, 0x883e, 0x206b, 0x28c1, 0x9d18, 0x2044, 0x2103, - 0x20b4, 0x2095, 0xa8ca, 0xa207, 0x2901, 0xa80a, 0x0014, 0xa203, + 0x0010, 0xa200, 0x3806, 0x8839, 0x20c4, 0x0864, 0xa850, 0x3008, + 0x28c1, 0x9d18, 0xa201, 0x300c, 0x2847, 0x8161, 0x846a, 0x8000, + 0x84a4, 0x1856, 0x883a, 0xa808, 0x28e2, 0x9cce, 0xa8f3, 0x0864, + 0xa83e, 0x300c, 0xa801, 0x3008, 0x28e1, 0x9cce, 0x28a1, 0x7162, + 0x2021, 0xa818, 0xa205, 0x870c, 0xd8de, 0x64a0, 0x6de0, 0x6fc0, + 0x67a4, 0x6c80, 0x0212, 0xa205, 0x883d, 0x882b, 0x1814, 0x883b, + 0x7027, 0x85f2, 0xa737, 0xa532, 0xf003, 0x8576, 0x8677, 0xa812, + 0x883e, 0xa810, 0x2881, 0x7161, 0x280a, 0xa204, 0x64c0, 0x6de0, + 0x67a0, 0x6fc0, 0x1814, 0x883b, 0x7023, 0x8576, 0x8677, 0xa802, + 0x7861, 0x883e, 0x206c, 0x28c1, 0x9d18, 0x2044, 0x2103, 0x20a2, + 0x2081, 0xa8ca, 0x2902, 0xa20e, 0xa80b, 0xa207, 0x0014, 0xa203, 0x8000, 0x85a4, 0x1872, 0x879a, 0x883c, 0x1fe2, 0xf601, 0xa208, - 0x856e, 0x866f, 0x7121, 0x0014, 0x0704, 0x3008, 0x9cce, 0x0014, - 0xa202, 0x8000, 0x85a4, 0x3009, 0x84a8, 0x19e2, 0xf844, 0x856e, - 0x883f, 0x08e6, 0xa8f5, 0xf861, 0xa8ea, 0xf801, 0x0014, 0xf881, - 0x0016, 0x85b2, 0x80f0, 0x9532, 0xfaa2, 0x1de2, 0x0014, 0x8532, - 0xf221, 0x0014, 0x1de2, 0x84a8, 0xd6e0, 0x1fe6, 0x0014, 0x3008, - 0x8000, 0x2849, 0x1011, 0xa8fc, 0x3008, 0x8000, 0xa000, 0x2081, - 0x2802, 0x1011, 0xa8fc, 0xa889, 0x3008, 0x20a1, 0x283c, 0x1011, - 0xa8fc, 0xa209, 0x0017, 0x300c, 0x8000, 0x85a4, 0x1de2, 0xdac1, - 0x0014, 0x0210, 0xa801, 0x0014, 0x26e0, 0x873a, 0xfaa3, 0x19f2, - 0x26e0, 0x18f2, 0x0014, 0xa20b, 0x0014, 0xa20d, 0x3806, 0x0210, - 0x9d22, 0x0704, 0xa206, 0x6865, 0x817e, 0x842a, 0x1dc1, 0x8823, - 0x0016, 0x6042, 0x8008, 0xa8fa, 0x8160, 0x842a, 0x8180, 0xf021, - 0x3008, 0x84a8, 0x11d7, 0x7042, 0x20dd, 0x0011, 0x20d5, 0x8822, - 0x0016, 0x0000, 0x0126, 0x70d4, 0xa084, 0x4c00, 0x8004, 0x2090, - 0x7204, 0x7008, 0xc09c, 0xa205, 0x1178, 0x720c, 0x82ff, 0x0128, - 0x8aff, 0x1150, 0x7200, 0xd284, 0x1138, 0x7007, 0x0004, 0x7003, - 0x0008, 0x012e, 0x2000, 0x0005, 0x7000, 0xa084, 0x0003, 0x7002, - 0xc69c, 0xd084, 0x05b8, 0x2001, 0x4301, 0x2004, 0xd0b4, 0x0904, - 0x3dcf, 0x7108, 0xe000, 0x7008, 0xa106, 0x1dd8, 0xa184, 0x0003, - 0x0904, 0x3dcf, 0xa184, 0x01e0, 0x1904, 0x3dcf, 0xd1f4, 0x1d88, - 0xa184, 0x3000, 0xa086, 0x1000, 0x0d60, 0x2011, 0x0180, 0x710c, - 0x8211, 0x0130, 0x7008, 0xd0f4, 0x1d20, 0x700c, 0xa106, 0x0dc0, - 0x7007, 0x0012, 0x7108, 0xe000, 0x7008, 0xa106, 0x1dd8, 0xa184, - 0x0003, 0x0568, 0xd194, 0x0db0, 0xd1f4, 0x0548, 0x7007, 0x0002, - 0x0880, 0x0428, 0x7108, 0xd1fc, 0x0130, 0x080c, 0x3e9e, 0x8aff, - 0x0904, 0x3d58, 0x0cb8, 0x700c, 0xa08c, 0x07ff, 0x01e8, 0x7004, - 0xd084, 0x0178, 0x7014, 0xa005, 0x1148, 0x7010, 0x7310, 0xa306, - 0x1de0, 0x2300, 0xa005, 0x0128, 0xa102, 0x1e20, 0x7007, 0x0010, - 0x0030, 0x8aff, 0x0148, 0x080c, 0x4046, 0x1de8, 0x09d8, 0x080c, - 0x3e58, 0x012e, 0x2000, 0x0005, 0x7204, 0x7108, 0xc19c, 0x8103, - 0x1218, 0x080c, 0x3e9e, 0x0cc0, 0xa205, 0x1d88, 0x7007, 0x0004, - 0x7003, 0x0008, 0x012e, 0x2000, 0x0005, 0x6428, 0x84ff, 0x0508, - 0x2c70, 0x7004, 0xa0bc, 0x000f, 0xa7b8, 0x3e19, 0x273c, 0x87fb, - 0x1148, 0x0210, 0x080c, 0x243b, 0x609c, 0xa075, 0x0190, 0x0c88, - 0x2039, 0x3e0e, 0x2704, 0xae68, 0x6808, 0xa630, 0x680c, 0xa529, - 0x8421, 0x0138, 0x8738, 0x2704, 0xa005, 0x1da8, 0x709c, 0xa075, - 0x1d00, 0x0005, 0x0000, 0x0005, 0x0009, 0x000d, 0x0011, 0x0015, - 0x0019, 0x001d, 0x0000, 0x0003, 0x0009, 0x000f, 0x0015, 0x001b, - 0x0000, 0x0000, 0x3e0e, 0x3e0b, 0x0000, 0x0000, 0x8000, 0x0000, - 0x3e0e, 0x0000, 0x3e16, 0x3e13, 0x0000, 0x0000, 0x0000, 0x0000, - 0x3e16, 0x0000, 0x3e11, 0x3e11, 0x0000, 0x0000, 0x8000, 0x0000, - 0x3e11, 0x0000, 0x3e17, 0x3e17, 0x0000, 0x0000, 0x0000, 0x0000, - 0x3e17, 0x2079, 0x4300, 0x2071, 0x0010, 0x7007, 0x000a, 0x7007, - 0x0002, 0x7003, 0x0001, 0x2009, 0x0002, 0x2071, 0x0050, 0x7007, - 0x000a, 0x7007, 0x0002, 0x7003, 0x0000, 0x2001, 0x01ff, 0x2004, - 0xd0fc, 0x1128, 0x8109, 0x0118, 0x2071, 0x0020, 0x0c80, 0x0005, - 0x7004, 0x8004, 0x1690, 0x7007, 0x0012, 0x2019, 0x0000, 0x7108, - 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0, 0x0110, 0x080c, 0x243b, - 0xa19c, 0x300c, 0xa386, 0x2004, 0x0130, 0xa386, 0x0008, 0x0160, - 0xa386, 0x200c, 0x1d60, 0x7200, 0x8204, 0x0230, 0x730c, 0xa384, - 0x07ff, 0x0110, 0x080c, 0x243b, 0x7007, 0x0012, 0x7000, 0xd084, - 0x1160, 0x7008, 0xa084, 0x01e0, 0x1140, 0x7310, 0x7014, 0xa305, - 0x0120, 0x710c, 0xa184, 0x07ff, 0x1958, 0x7007, 0x0012, 0x7007, - 0x0008, 0x7004, 0xd09c, 0x1de8, 0x7007, 0x0012, 0x7108, 0x8103, - 0x0ed8, 0x7003, 0x0008, 0x0005, 0x7108, 0x0000, 0xa184, 0x01e0, - 0x1550, 0x7108, 0xa184, 0x01e0, 0x1530, 0xa184, 0x0007, 0x0002, - 0x3eb2, 0x3ec0, 0x3eb0, 0x3ec0, 0x3eb0, 0x3f06, 0x3eb0, 0x3f05, - 0x080c, 0x243b, 0x7004, 0xa084, 0x0010, 0xc08d, 0x7006, 0x8aff, - 0x1118, 0x2049, 0x0000, 0x0005, 0x080c, 0x4046, 0x1de8, 0x0005, - 0x7004, 0xa084, 0x0010, 0xc08d, 0x7006, 0x8aff, 0x0118, 0x080c, - 0x4046, 0x1de8, 0x0005, 0x7007, 0x0012, 0x7108, 0x1d04, 0x3ece, - 0x2091, 0x6000, 0x1d04, 0x3ed2, 0x2091, 0x6000, 0x7007, 0x0012, + 0x856e, 0x7121, 0x0014, 0x0704, 0x3008, 0x9cce, 0x0014, 0xa202, + 0x8000, 0x85a4, 0x3009, 0x84a8, 0x19e2, 0xf844, 0x856e, 0x883f, + 0x08e6, 0xa8f5, 0xf861, 0xa8eb, 0xf801, 0x0014, 0xf881, 0x0016, + 0x85b2, 0x80f0, 0x9532, 0xfaa2, 0x1de2, 0x0014, 0x8532, 0xf221, + 0x0014, 0x1de2, 0x84a8, 0xd6e0, 0x1fe6, 0x0014, 0x3008, 0x8000, + 0x2849, 0x1011, 0xa8fc, 0x3008, 0x8000, 0xa000, 0x2081, 0x2802, + 0x1011, 0xa8fc, 0xa889, 0x3008, 0x20a1, 0x283c, 0x1011, 0xa8fc, + 0xa209, 0x0017, 0x300c, 0x8000, 0x85a4, 0x1de2, 0xdac1, 0x0014, + 0x0210, 0xa801, 0x0014, 0x26e0, 0x873a, 0xfaa3, 0x19f2, 0x26e0, + 0x18f2, 0x0014, 0xa20b, 0x0014, 0xa20d, 0x3806, 0x0210, 0x9d22, + 0x0704, 0xa206, 0x6865, 0x817e, 0x842a, 0x1dc1, 0x8823, 0x0016, + 0x6042, 0x8008, 0xa8fa, 0x8160, 0x842a, 0x8180, 0xf021, 0x3008, + 0x84a8, 0x11d7, 0x7042, 0x20dd, 0x0011, 0x20d5, 0x8822, 0x0016, + 0x0000, 0x0126, 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x7204, + 0x7008, 0xc09c, 0xa205, 0x1178, 0x720c, 0x82ff, 0x0128, 0x8aff, + 0x1150, 0x7200, 0xd284, 0x1138, 0x7007, 0x0004, 0x7003, 0x0008, + 0x012e, 0x2000, 0x0005, 0x7000, 0xa084, 0x0003, 0x7002, 0xc69c, + 0xd084, 0x0588, 0x7108, 0xe000, 0x7008, 0xa106, 0x1dd8, 0xa184, + 0x0003, 0x0904, 0x3f50, 0xa184, 0x01e0, 0x1904, 0x3f50, 0xd1f4, + 0x1d88, 0xa184, 0x3000, 0xa086, 0x1000, 0x0d60, 0x2011, 0x0180, + 0x710c, 0x8211, 0x0130, 0x7008, 0xd0f4, 0x1d20, 0x700c, 0xa106, + 0x0dc0, 0x7007, 0x0012, 0x7108, 0xe000, 0x7008, 0xa106, 0x1dd8, + 0xa184, 0x0003, 0x0568, 0xd194, 0x0db0, 0xd1f4, 0x0548, 0x7007, + 0x0002, 0x0880, 0x0428, 0x7108, 0xd1fc, 0x0130, 0x080c, 0x4053, + 0x8aff, 0x0904, 0x3edf, 0x0cb8, 0x700c, 0xa08c, 0x07ff, 0x01e8, + 0x7004, 0xd084, 0x0178, 0x7014, 0xa005, 0x1148, 0x7010, 0x7310, + 0xa306, 0x1de0, 0x2300, 0xa005, 0x0128, 0xa102, 0x1e20, 0x7007, + 0x0010, 0x0030, 0x8aff, 0x0148, 0x080c, 0x4212, 0x1de8, 0x09d8, + 0x080c, 0x3fd9, 0x012e, 0x2000, 0x0005, 0x7204, 0x7108, 0xc19c, + 0x8103, 0x1218, 0x7007, 0x0002, 0x0cc0, 0xa205, 0x1d88, 0x7007, + 0x0004, 0x7003, 0x0008, 0x012e, 0x2000, 0x0005, 0x6428, 0x84ff, + 0x0508, 0x2c70, 0x7004, 0xa0bc, 0x000f, 0xa7b8, 0x3f9a, 0x273c, + 0x87fb, 0x1148, 0x0210, 0x080c, 0x252b, 0x609c, 0xa075, 0x0190, + 0x0c88, 0x2039, 0x3f8f, 0x2704, 0xae68, 0x6808, 0xa630, 0x680c, + 0xa529, 0x8421, 0x0138, 0x8738, 0x2704, 0xa005, 0x1da8, 0x709c, + 0xa075, 0x1d00, 0x0005, 0x0000, 0x0005, 0x0009, 0x000d, 0x0011, + 0x0015, 0x0019, 0x001d, 0x0000, 0x0003, 0x0009, 0x000f, 0x0015, + 0x001b, 0x0000, 0x0000, 0x3f8f, 0x3f8c, 0x0000, 0x0000, 0x8000, + 0x0000, 0x3f8f, 0x0000, 0x3f97, 0x3f94, 0x0000, 0x0000, 0x0000, + 0x0000, 0x3f97, 0x0000, 0x3f92, 0x3f92, 0x0000, 0x0000, 0x8000, + 0x0000, 0x3f92, 0x0000, 0x3f98, 0x3f98, 0x0000, 0x0000, 0x0000, + 0x0000, 0x3f98, 0x2079, 0x4500, 0x2071, 0x0010, 0x7007, 0x000a, + 0x7007, 0x0002, 0x7003, 0x0001, 0x2009, 0x0002, 0x2071, 0x0050, + 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, 0x0000, 0x2001, 0x01ff, + 0x2004, 0xd0fc, 0x1128, 0x8109, 0x0118, 0x2071, 0x0020, 0x0c80, + 0x0005, 0x7004, 0x8004, 0x1a04, 0x402f, 0x7108, 0x7008, 0xa106, + 0x1de0, 0xa184, 0x01e0, 0x0120, 0x080c, 0x408b, 0x0804, 0x404f, + 0x7007, 0x0012, 0x2019, 0x0000, 0x7108, 0x7008, 0xa106, 0x1de0, + 0xa184, 0x01e0, 0x0120, 0x080c, 0x408b, 0x0804, 0x404f, 0xa19c, + 0x300c, 0xa386, 0x2004, 0x0190, 0xa386, 0x0008, 0x01c0, 0x7004, + 0xd084, 0x1148, 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184, 0x0003, + 0x0110, 0x0804, 0x408b, 0xa386, 0x200c, 0x19f0, 0x7200, 0x8204, + 0x0230, 0x730c, 0xa384, 0x07ff, 0x0110, 0x080c, 0x252b, 0x7108, + 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0, 0x0118, 0x080c, 0x408b, + 0x0470, 0x7007, 0x0012, 0x7000, 0xd084, 0x1148, 0x7310, 0x7014, + 0xa305, 0x0128, 0x710c, 0xa184, 0x07ff, 0x1904, 0x3fd9, 0x7108, + 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0, 0x0118, 0x080c, 0x408b, + 0x00b0, 0x7007, 0x0012, 0x7007, 0x0008, 0x7004, 0xd09c, 0x1de8, + 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0, 0x0118, 0x080c, + 0x408b, 0x0028, 0x7007, 0x0012, 0x7108, 0x8103, 0x0e88, 0x7003, + 0x0008, 0x0005, 0x7108, 0xa184, 0x01e0, 0x15a8, 0x7108, 0xa184, + 0x01e0, 0x1588, 0xa184, 0x0007, 0x0002, 0x4067, 0x4075, 0x4065, + 0x4075, 0x4065, 0x40c5, 0x4065, 0x40c3, 0x080c, 0x252b, 0x7004, + 0xa084, 0x0010, 0xc08d, 0x7006, 0x8aff, 0x1118, 0x2049, 0x0000, + 0x0005, 0x080c, 0x4212, 0x1de8, 0x0005, 0x7004, 0xa084, 0x0010, + 0xc08d, 0x7006, 0x7004, 0xd084, 0x1140, 0x7108, 0x7008, 0xa106, + 0x1de0, 0xa184, 0x0003, 0x0108, 0x0030, 0x8aff, 0x0118, 0x080c, + 0x4212, 0x1de8, 0x0005, 0x7007, 0x0012, 0x7108, 0x1d04, 0x408e, + 0x2091, 0x6000, 0x1d04, 0x4092, 0x2091, 0x6000, 0x7007, 0x0012, 0x7007, 0x0008, 0x7004, 0xd09c, 0x1de8, 0x7007, 0x0012, 0x7108, 0xd1fc, 0x1dd8, 0x7003, 0x0000, 0x7000, 0xa005, 0x1130, 0x7004, 0xa005, 0x1118, 0x700c, 0xa005, 0x0108, 0x0c40, 0x2049, 0x0000, 0xb284, 0x0200, 0x0118, 0x2001, 0x0000, 0x0010, 0x2001, 0x0001, - 0x080c, 0x397f, 0x6818, 0xa084, 0x8000, 0x0110, 0x681b, 0x0002, - 0x0005, 0x080c, 0x243b, 0x080c, 0x243b, 0x04b9, 0x7210, 0x7114, - 0x700c, 0xa09c, 0x07ff, 0x2800, 0xa300, 0xa211, 0xa189, 0x0000, - 0x0461, 0x2704, 0x2c58, 0xac60, 0x6308, 0x2200, 0xa322, 0x630c, - 0x2100, 0xa31b, 0x2400, 0xa305, 0x0140, 0x1238, 0x8412, 0x8210, - 0x830a, 0xa189, 0x0000, 0x2b60, 0x0c58, 0x2b60, 0x8a07, 0x0006, - 0x6004, 0xa084, 0x0008, 0x0118, 0xa7ba, 0x3e13, 0x0010, 0xa7ba, - 0x3e0b, 0x000e, 0xa73d, 0x2c00, 0x6886, 0x6f8a, 0x6c92, 0x6b8e, - 0x7007, 0x0012, 0x080c, 0x3e58, 0x0005, 0x8a50, 0x8739, 0x2704, + 0x080c, 0x3b47, 0x681b, 0x0002, 0x2051, 0x0000, 0x0005, 0x080c, + 0x252b, 0x080c, 0x252b, 0x080c, 0x4105, 0x7210, 0x7114, 0x700c, + 0xa09c, 0x07ff, 0x2800, 0xa300, 0xa211, 0xa189, 0x0000, 0x04a9, + 0x2704, 0x2c58, 0xac60, 0x6308, 0x2200, 0xa322, 0x630c, 0x2100, + 0xa31b, 0x2400, 0xa305, 0x0140, 0x1238, 0x8412, 0x8210, 0x830a, + 0xa189, 0x0000, 0x2b60, 0x0c58, 0x2b60, 0x8a07, 0x0006, 0x6004, + 0xa084, 0x0008, 0x0118, 0xa7ba, 0x3f94, 0x0010, 0xa7ba, 0x3f8c, + 0x000e, 0xa73d, 0x2c00, 0x6886, 0x6f8a, 0x6c92, 0x6b8e, 0x7108, + 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0, 0x0110, 0x080c, 0x408b, + 0x7007, 0x0012, 0x080c, 0x3fd9, 0x0005, 0x8a50, 0x8739, 0x2704, 0xa004, 0x1168, 0x6000, 0xa064, 0x1108, 0x2d60, 0x6004, 0xa084, - 0x000f, 0xa080, 0x3e29, 0x203c, 0x87fb, 0x090c, 0x243b, 0x0005, - 0x0126, 0x00d6, 0x70d4, 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de, + 0x000f, 0xa080, 0x3faa, 0x203c, 0x87fb, 0x090c, 0x252b, 0x0005, + 0x0126, 0x00d6, 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de, 0x6884, 0x2060, 0x6888, 0x6b8c, 0x6c90, 0x8057, 0xaad4, 0x00ff, 0xa084, 0x00ff, 0x0006, 0x6804, 0xa084, 0x0008, 0x000e, 0x0118, - 0xa0b8, 0x3e13, 0x0010, 0xa0b8, 0x3e0b, 0xb284, 0x0200, 0x0110, + 0xa0b8, 0x3f94, 0x0010, 0xa0b8, 0x3f8c, 0xb284, 0x0200, 0x0110, 0x7e20, 0x0008, 0x7e24, 0xa6b5, 0x000c, 0x681c, 0xd0b4, 0x0108, 0xc685, 0x2400, 0xa305, 0x0520, 0x2c58, 0x2704, 0x6104, 0xac60, 0x6000, 0xa400, 0x701a, 0x6004, 0xa301, 0x701e, 0xa184, 0x0008, 0x0140, 0x6010, 0xa081, 0x0000, 0x7022, 0x6014, 0xa081, 0x0000, 0x7026, 0x6208, 0x2400, 0xa202, 0x7012, 0x620c, 0x2300, 0xa203, - 0x7016, 0x7602, 0x7007, 0x0001, 0x2b60, 0x080c, 0x4067, 0x0010, - 0x080c, 0x4046, 0x1de8, 0x012e, 0x2000, 0x0005, 0x0126, 0x00d6, - 0x70d4, 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de, 0x7007, 0x0004, + 0x7016, 0x7602, 0x7007, 0x0001, 0x2b60, 0x080c, 0x423a, 0x0010, + 0x080c, 0x4212, 0x1de8, 0x012e, 0x2000, 0x0005, 0x0126, 0x00d6, + 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de, 0x7007, 0x0004, 0x7004, 0xd094, 0x1de8, 0x7003, 0x0008, 0x012e, 0x2000, 0x0005, - 0x0126, 0x00d6, 0x70d4, 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de, + 0x0126, 0x00d6, 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de, 0x7e20, 0xb284, 0x0200, 0x1108, 0x7e24, 0xa6b5, 0x000c, 0x681c, 0xd0ac, 0x1118, 0xc685, 0x7003, 0x0000, 0x6828, 0x2050, 0x2d60, - 0x6004, 0xa0bc, 0x000f, 0xa7b8, 0x3e19, 0x273c, 0x87fb, 0x1138, - 0x0210, 0x080c, 0x243b, 0x689c, 0xa065, 0x0120, 0x0c88, 0x080c, - 0x4046, 0x1de8, 0x012e, 0x2000, 0x0005, 0x0126, 0x0006, 0x0016, - 0x00d6, 0x70d4, 0xa084, 0x4c00, 0x8004, 0x2090, 0x7e20, 0xb284, + 0x6004, 0xa0bc, 0x000f, 0xa7b8, 0x3f9a, 0x273c, 0x87fb, 0x1138, + 0x0210, 0x080c, 0x252b, 0x689c, 0xa065, 0x0120, 0x0c88, 0x080c, + 0x4212, 0x1de8, 0x012e, 0x2000, 0x0005, 0x0126, 0x0006, 0x0016, + 0x00d6, 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x7e20, 0xb284, 0x0200, 0x1108, 0x7e24, 0x00de, 0x003e, 0x004e, 0xa6b5, 0x000c, 0x681c, 0xd0b4, 0x0128, 0xc685, 0x7003, 0x0000, 0x7007, 0x0004, - 0x2049, 0x3fe5, 0x6828, 0xa055, 0x05f0, 0x2d70, 0x2e60, 0x7004, - 0xa0bc, 0x000f, 0xa7b8, 0x3e19, 0x273c, 0x87fb, 0x1140, 0x0210, - 0x080c, 0x243b, 0x709c, 0xa075, 0x2060, 0x0568, 0x0c80, 0x2704, - 0xae68, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0268, 0x8a51, 0x1110, - 0x080c, 0x243b, 0x8738, 0x2704, 0xa005, 0x1d90, 0x709c, 0xa075, - 0x2060, 0x01c8, 0x08e0, 0x8422, 0x8420, 0x831a, 0xa399, 0x0000, - 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1210, 0x080c, - 0x243b, 0xb284, 0x0200, 0x0118, 0x2071, 0x0050, 0x0010, 0x2071, - 0x0020, 0x0804, 0x3f79, 0x012e, 0x2000, 0x0005, 0x7008, 0xa084, - 0x0003, 0xa086, 0x0003, 0x1108, 0x0005, 0x2704, 0xac78, 0x7800, - 0x701a, 0x7804, 0x701e, 0x7808, 0x7012, 0x780c, 0x7016, 0x6004, - 0xa084, 0x0008, 0x0120, 0x7810, 0x7022, 0x7814, 0x7026, 0x7602, - 0x7004, 0xa084, 0x0010, 0xc085, 0x7006, 0x2079, 0x4300, 0x8a51, - 0x01b0, 0x8738, 0x2704, 0xa005, 0x1168, 0x609c, 0xa005, 0x0180, - 0x2060, 0x6004, 0xa084, 0x000f, 0xa080, 0x3e19, 0x203c, 0x87fb, - 0x090c, 0x243b, 0x7008, 0xa084, 0x0003, 0xa086, 0x0003, 0x0005, - 0x2051, 0x0000, 0x0005, 0x0126, 0x0006, 0x00d6, 0x70d4, 0xa084, - 0x4c00, 0x8004, 0x2090, 0x00de, 0x008e, 0x7108, 0xa184, 0x0003, - 0x1128, 0x6828, 0xa005, 0x0178, 0x0804, 0x3d6c, 0x7108, 0xd1fc, - 0x0118, 0x080c, 0x3e9e, 0x0c88, 0x7007, 0x0010, 0x7108, 0xd1fc, - 0x0de8, 0x080c, 0x3e9e, 0x7008, 0xa086, 0x0008, 0x1d30, 0x7000, - 0xa005, 0x1d18, 0x7003, 0x0000, 0x2049, 0x0000, 0x012e, 0x2000, - 0x0005, 0x0126, 0x0146, 0x0136, 0x0156, 0x00c6, 0x00d6, 0x70d4, - 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de, 0x2049, 0x40b1, 0xad80, - 0x0011, 0x20a0, 0xb284, 0x0200, 0x0118, 0x2099, 0x0032, 0x0010, - 0x2099, 0x0031, 0x700c, 0xa084, 0x07ff, 0x682a, 0x7007, 0x0008, - 0x7007, 0x0002, 0x7003, 0x0001, 0x0118, 0x8000, 0x80ac, 0x53a5, - 0x700c, 0xa084, 0x07ff, 0x0130, 0x7007, 0x0004, 0x7004, 0xa084, - 0x0004, 0x1de0, 0x00ce, 0x2049, 0x0000, 0x7003, 0x0000, 0x015e, - 0x013e, 0x014e, 0x012e, 0x2000, 0x0005, 0x2091, 0x8000, 0x2091, - 0x6000, 0x78ac, 0xa005, 0x1168, 0x7974, 0x70d0, 0xa106, 0x1148, - 0x781c, 0xa005, 0x0130, 0x781f, 0x0000, 0x0e04, 0x4101, 0x2091, - 0x4080, 0x7830, 0x8001, 0x7832, 0x1904, 0x416b, 0x7834, 0x7832, - 0x2061, 0x68c0, 0x2069, 0x4380, 0xc7fd, 0x68d0, 0xa005, 0x0128, - 0x8001, 0x68d2, 0x1110, 0x080c, 0x42c4, 0x6800, 0xa084, 0x000f, - 0x0168, 0xa086, 0x0001, 0x0150, 0x6844, 0xa00d, 0x0138, 0x2104, - 0xa005, 0x0120, 0x8001, 0x200a, 0x0904, 0x425f, 0x6814, 0xa005, - 0x01a8, 0x8001, 0x6816, 0x1190, 0x68a7, 0x0001, 0x00f6, 0xd7fc, - 0x1118, 0x2079, 0x0200, 0x0010, 0x2079, 0x0100, 0x080c, 0x3aa0, - 0x00fe, 0x6864, 0xa005, 0x0110, 0x080c, 0x2233, 0x6880, 0xa005, - 0x0140, 0x8001, 0x6882, 0x1128, 0x6867, 0x0000, 0x68d4, 0xc0c5, - 0x68d6, 0x68d4, 0xd0fc, 0x01b0, 0xc0fc, 0x68d6, 0x20a9, 0x0200, - 0x6034, 0xa005, 0x0158, 0x8001, 0x6036, 0x68d4, 0xc0fd, 0x68d6, - 0x1128, 0x6010, 0xa005, 0x0110, 0x080c, 0x2233, 0xace0, 0x0010, - 0x1f04, 0x4150, 0xd7fc, 0x0138, 0x2061, 0x48c0, 0x2069, 0x4340, - 0xc7fc, 0x0804, 0x410d, 0x0459, 0x7838, 0x8001, 0x783a, 0x11a0, - 0x783c, 0x783a, 0x2061, 0x48c0, 0x2069, 0x4340, 0xc7fc, 0x680c, - 0xa005, 0x0110, 0x080c, 0x41c9, 0xd7fc, 0x1130, 0x2061, 0x68c0, - 0x2069, 0x4380, 0xc7fd, 0x0c98, 0x7810, 0xd0cc, 0x0168, 0xd0ac, - 0x1120, 0xd0a4, 0x0148, 0xc0ad, 0x7812, 0x2091, 0x8001, 0x0e04, - 0x4193, 0x080c, 0x1ffe, 0x0005, 0x2091, 0x8001, 0x0005, 0x7840, - 0x8001, 0x7842, 0x1568, 0x7844, 0x7842, 0x2091, 0x8000, 0x2061, - 0x48c0, 0x2069, 0x4340, 0xc7fc, 0x6810, 0xa005, 0x1110, 0x2001, - 0x0101, 0x8001, 0x6812, 0xd7fc, 0x0118, 0xa080, 0x89d0, 0x0010, - 0xa080, 0x88c0, 0x2040, 0x2004, 0xa065, 0x0150, 0x6024, 0xa005, - 0x0120, 0x8001, 0x6026, 0x0904, 0x4207, 0x6000, 0x2c40, 0x0ca0, - 0xd7fc, 0x1130, 0x2061, 0x68c0, 0x2069, 0x4380, 0xc7fd, 0x08e0, - 0x0005, 0x2009, 0x0000, 0x20a9, 0x0200, 0x6008, 0xd09c, 0x0540, - 0x6024, 0xa005, 0x0118, 0x8001, 0x6026, 0x0400, 0x6008, 0xc09c, - 0xd084, 0x1110, 0xd0ac, 0x01a8, 0x600a, 0x6004, 0xa06d, 0x01c0, - 0x00c6, 0x0016, 0x6010, 0x8001, 0x6012, 0x080c, 0x35ab, 0x2d00, - 0x2c68, 0x2060, 0x080c, 0x1b85, 0x080c, 0x1d30, 0x001e, 0x00ce, - 0x0038, 0xc0bd, 0x600a, 0xa18d, 0x0001, 0x0010, 0xa18d, 0x0100, - 0xace0, 0x0010, 0x1f04, 0x41cd, 0xa184, 0x0001, 0x0130, 0xa18c, - 0xfffe, 0x690e, 0x080c, 0x2233, 0x0008, 0x690e, 0x0005, 0x6800, - 0xa005, 0x0120, 0x684c, 0xac06, 0x0904, 0x425f, 0x6864, 0xa005, - 0x0120, 0x6027, 0x0001, 0x0804, 0x425c, 0x2c00, 0x687e, 0x6714, - 0x6f76, 0x6017, 0x0000, 0x602b, 0x0000, 0x601b, 0x0006, 0x60b4, - 0xa084, 0x3f00, 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085, 0x0060, - 0x6022, 0x6000, 0x2042, 0x080c, 0x1b1d, 0x6818, 0xa005, 0x0110, - 0x8001, 0x681a, 0x6808, 0xc0a4, 0x680a, 0x6810, 0x7908, 0x8109, - 0x790a, 0x8001, 0x1310, 0x080c, 0x243b, 0x6812, 0x1118, 0x7910, - 0xc1a5, 0x7912, 0x602f, 0x0000, 0x6033, 0x0000, 0x2c68, 0x080c, - 0x1d3d, 0xd7fc, 0x1118, 0x2069, 0x4340, 0x0010, 0x2069, 0x4380, - 0x6910, 0xa184, 0x0100, 0x2001, 0x0006, 0x1118, 0x697a, 0x2001, - 0x0004, 0x2708, 0x080c, 0x2228, 0x2091, 0x8001, 0x0005, 0x00d6, - 0x694c, 0x2160, 0xd7fc, 0x1118, 0x2069, 0x0200, 0x0010, 0x2069, - 0x0100, 0x080c, 0x23e1, 0x601b, 0x0006, 0x6858, 0xa084, 0x3f00, - 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085, 0x0048, 0x6022, 0x602f, - 0x0000, 0x6033, 0x0000, 0x6830, 0xd0b4, 0x01b0, 0x684b, 0x0004, - 0x20a9, 0x0014, 0x6848, 0xd094, 0x0110, 0x1f04, 0x4282, 0x684b, - 0x0009, 0x20a9, 0x0014, 0x6848, 0xd084, 0x0110, 0x1f04, 0x428b, - 0x20a9, 0x00fa, 0x1f04, 0x4292, 0x6808, 0xa084, 0xfffd, 0x680a, - 0x681b, 0x0054, 0x00de, 0x6867, 0x0007, 0x2091, 0x8001, 0x0005, - 0x2079, 0x4300, 0x00e1, 0x0089, 0x00a9, 0x2009, 0x0002, 0x2069, - 0x4380, 0x680f, 0x0000, 0x6813, 0x0000, 0x6817, 0x0000, 0x8109, - 0x0118, 0x2069, 0x4340, 0x0ca8, 0x0005, 0x2019, 0x00a3, 0x7b3a, - 0x7b3e, 0x0005, 0x2019, 0x0033, 0x7b42, 0x7b46, 0x0005, 0x2019, - 0x32dd, 0x7b32, 0x7b36, 0x0005, 0x6950, 0xa185, 0x0000, 0x0178, - 0x00c6, 0x6ac0, 0x2264, 0x602b, 0x0000, 0x602f, 0x0000, 0x6008, - 0xc0b5, 0x600a, 0x8210, 0x8109, 0x1da8, 0x6952, 0x00ce, 0x0005, - 0x70ec, 0xd0dc, 0x1118, 0xd0d4, 0x0180, 0x0088, 0xae8e, 0x0100, - 0x0130, 0x7814, 0xc0f5, 0x7816, 0xd0d4, 0x1170, 0x0050, 0x7814, - 0xc0fd, 0x7816, 0xd0d4, 0x1140, 0x0020, 0xd0e4, 0x0138, 0x70a0, - 0x70a2, 0x7804, 0xd08c, 0x0110, 0x681f, 0x000c, 0x0005, 0xaf67 + 0x2049, 0x41ad, 0x6828, 0xa055, 0x00d6, 0x0904, 0x420e, 0x2d70, + 0x2e60, 0x7004, 0xa0bc, 0x000f, 0xa7b8, 0x3f9a, 0x273c, 0x87fb, + 0x1140, 0x0210, 0x080c, 0x252b, 0x709c, 0xa075, 0x2060, 0x0570, + 0x0c80, 0x2704, 0xae68, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0268, + 0x8a51, 0x1110, 0x080c, 0x252b, 0x8738, 0x2704, 0xa005, 0x1d90, + 0x709c, 0xa075, 0x2060, 0x01d0, 0x08e0, 0x8422, 0x8420, 0x831a, + 0xa399, 0x0000, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, + 0x1210, 0x080c, 0x252b, 0xb284, 0x0200, 0x0118, 0x2071, 0x0050, + 0x0010, 0x2071, 0x0020, 0x00de, 0x0804, 0x4141, 0x00de, 0x012e, + 0x2000, 0x0005, 0x7008, 0x0006, 0xa084, 0x01e0, 0x000e, 0x0110, + 0xa006, 0x0005, 0xa084, 0x0003, 0xa086, 0x0003, 0x1108, 0x0005, + 0x2704, 0xac78, 0x7800, 0x701a, 0x7804, 0x701e, 0x7808, 0x7012, + 0x780c, 0x7016, 0x6004, 0xa084, 0x0008, 0x0120, 0x7810, 0x7022, + 0x7814, 0x7026, 0x7602, 0x7004, 0xa084, 0x0010, 0xc085, 0x7006, + 0x2079, 0x4500, 0x8a51, 0x01e8, 0x8738, 0x2704, 0xa005, 0x1168, + 0x609c, 0xa005, 0x01b8, 0x2060, 0x6004, 0xa084, 0x000f, 0xa080, + 0x3f9a, 0x203c, 0x87fb, 0x090c, 0x252b, 0x7008, 0x0006, 0xa084, + 0x01e0, 0x000e, 0x0110, 0xa006, 0x0028, 0xa084, 0x0003, 0xa086, + 0x0003, 0x0005, 0x2051, 0x0000, 0x0005, 0x0126, 0x0006, 0x00d6, + 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de, 0x008e, 0x7108, + 0xa184, 0x0003, 0x1128, 0x6828, 0xa005, 0x0178, 0x0804, 0x3ef3, + 0x7108, 0xd1fc, 0x0118, 0x080c, 0x4053, 0x0c88, 0x7007, 0x0010, + 0x7108, 0xd1fc, 0x0de8, 0x080c, 0x4053, 0x7008, 0xa086, 0x0008, + 0x1d30, 0x7000, 0xa005, 0x1d18, 0x7003, 0x0000, 0x2049, 0x0000, + 0x012e, 0x2000, 0x0005, 0x0126, 0x0146, 0x0136, 0x0156, 0x00c6, + 0x00d6, 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de, 0x2049, + 0x428b, 0xad80, 0x0011, 0x20a0, 0xb284, 0x0200, 0x0118, 0x2099, + 0x0032, 0x0010, 0x2099, 0x0031, 0x700c, 0xa084, 0x07ff, 0x682a, + 0x7007, 0x0008, 0x7007, 0x0002, 0x7003, 0x0001, 0x0118, 0x8000, + 0x80ac, 0x53a5, 0x700c, 0xa084, 0x07ff, 0x0130, 0x7007, 0x0004, + 0x7004, 0xa084, 0x0004, 0x1de0, 0x00ce, 0x2049, 0x0000, 0x7003, + 0x0000, 0x015e, 0x013e, 0x014e, 0x012e, 0x2000, 0x0005, 0x2091, + 0x8000, 0x2091, 0x6000, 0x78ac, 0xa005, 0x1168, 0x7974, 0x70d0, + 0xa106, 0x1148, 0x781c, 0xa005, 0x0130, 0x781f, 0x0000, 0x0e04, + 0x42db, 0x2091, 0x4080, 0x7830, 0x8001, 0x7832, 0x1904, 0x4345, + 0x7834, 0x7832, 0x2061, 0x6ac0, 0x2069, 0x4580, 0xc7fd, 0x68cc, + 0xa005, 0x0128, 0x8001, 0x68ce, 0x1110, 0x080c, 0x44ad, 0x6800, + 0xa084, 0x000f, 0x0168, 0xa086, 0x0001, 0x0150, 0x6840, 0xa00d, + 0x0138, 0x2104, 0xa005, 0x0120, 0x8001, 0x200a, 0x0904, 0x444a, + 0x6814, 0xa005, 0x01a8, 0x8001, 0x6816, 0x1190, 0x68a3, 0x0001, + 0x00f6, 0xd7fc, 0x1118, 0x2079, 0x0200, 0x0010, 0x2079, 0x0100, + 0x080c, 0x3c0c, 0x00fe, 0x6860, 0xa005, 0x0110, 0x080c, 0x2296, + 0x687c, 0xa005, 0x0140, 0x8001, 0x687e, 0x1128, 0x6863, 0x0000, + 0x68d0, 0xc0c5, 0x68d2, 0x68d0, 0xd0fc, 0x01b0, 0xc0fc, 0x68d2, + 0x20a9, 0x0200, 0x6034, 0xa005, 0x0158, 0x8001, 0x6036, 0x68d0, + 0xc0fd, 0x68d2, 0x1128, 0x6010, 0xa005, 0x0110, 0x080c, 0x2296, + 0xace0, 0x0010, 0x1f04, 0x432a, 0xd7fc, 0x0138, 0x2061, 0x4ac0, + 0x2069, 0x4540, 0xc7fc, 0x0804, 0x42e7, 0x0459, 0x7838, 0x8001, + 0x783a, 0x11a0, 0x783c, 0x783a, 0x2061, 0x4ac0, 0x2069, 0x4540, + 0xc7fc, 0x680c, 0xa005, 0x0110, 0x080c, 0x43c1, 0xd7fc, 0x1130, + 0x2061, 0x6ac0, 0x2069, 0x4580, 0xc7fd, 0x0c98, 0x7810, 0xd0cc, + 0x0168, 0xd0ac, 0x1120, 0xd0a4, 0x0148, 0xc0ad, 0x7812, 0x2091, + 0x8001, 0x0e04, 0x436d, 0x080c, 0x2061, 0x0005, 0x2091, 0x8001, + 0x0005, 0x7840, 0x8001, 0x7842, 0x1904, 0x43c0, 0x7844, 0x7842, + 0x2069, 0x4540, 0xc7fc, 0x2079, 0x0200, 0x68d4, 0xa005, 0x0138, + 0x7de0, 0xa504, 0x1120, 0x68d6, 0x68d0, 0xc0bc, 0x68d2, 0x2079, + 0x4500, 0x6810, 0xa005, 0x1110, 0x2001, 0x0101, 0x8001, 0x6812, + 0xd7fc, 0x0118, 0xa080, 0x8bd0, 0x0010, 0xa080, 0x8ac0, 0x2040, + 0x2004, 0xa065, 0x01e0, 0x6024, 0xa005, 0x01b0, 0x8001, 0x6026, + 0x1198, 0x6800, 0xa005, 0x0130, 0x6848, 0xac06, 0x1118, 0x080c, + 0x444a, 0x0068, 0x6860, 0xa005, 0x0118, 0x6027, 0x0001, 0x0020, + 0x080c, 0x4402, 0x2804, 0x0c28, 0x6000, 0x2c40, 0x0c10, 0xd7fc, + 0x1138, 0x2069, 0x4580, 0xc7fd, 0x2079, 0x0100, 0x0804, 0x437d, + 0x0005, 0x2009, 0x0000, 0x20a9, 0x0200, 0x6008, 0xd09c, 0x0558, + 0x6024, 0xa005, 0x0118, 0x8001, 0x6026, 0x0418, 0x6008, 0xc09c, + 0xd084, 0x1110, 0xd0ac, 0x01c0, 0x600a, 0x6004, 0xa005, 0x01d8, + 0x00d6, 0x00c6, 0x0016, 0x2068, 0x6010, 0x8001, 0x6012, 0x080c, + 0x376c, 0x2d00, 0x2c68, 0x2060, 0x080c, 0x1bc7, 0x080c, 0x1d7c, + 0x001e, 0x00ce, 0x00de, 0x0038, 0xc0bd, 0x600a, 0xa18d, 0x0001, + 0x0010, 0xa18d, 0x0100, 0xace0, 0x0010, 0x1f04, 0x43c5, 0xa184, + 0x0001, 0x0130, 0xa18c, 0xfffe, 0x690e, 0x080c, 0x2296, 0x0008, + 0x690e, 0x0005, 0x2c00, 0x687a, 0x6714, 0x6f72, 0x6017, 0x0000, + 0x602b, 0x0000, 0x601b, 0x0006, 0x60b4, 0xa084, 0x5f00, 0x601e, + 0x6020, 0xa084, 0x00ff, 0xa085, 0x0060, 0x6022, 0x6000, 0x2042, + 0x080c, 0x1b5f, 0x6818, 0xa005, 0x0110, 0x8001, 0x681a, 0x6808, + 0xc0a4, 0x680a, 0x6810, 0x7908, 0x8109, 0x790a, 0x8001, 0x1310, + 0x080c, 0x252b, 0x6812, 0x1118, 0x7910, 0xc1a5, 0x7912, 0x602f, + 0x0000, 0x6033, 0x0000, 0x2c68, 0x080c, 0x1d89, 0xd7fc, 0x1118, + 0x2069, 0x4540, 0x0010, 0x2069, 0x4580, 0x6910, 0xa184, 0x0100, + 0x2001, 0x0006, 0x1118, 0x6976, 0x2001, 0x0004, 0x2708, 0x080c, + 0x228b, 0x0005, 0x00d6, 0x6948, 0x2160, 0xd7fc, 0x1118, 0x2069, + 0x0200, 0x0010, 0x2069, 0x0100, 0x080c, 0x2446, 0x601b, 0x0006, + 0x6858, 0xa084, 0x5f00, 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085, + 0x0048, 0x6022, 0x602f, 0x0000, 0x6033, 0x0000, 0x6808, 0xa084, + 0xfffd, 0x680a, 0x6830, 0xd0b4, 0x01b0, 0x684b, 0x0004, 0x20a9, + 0x0014, 0x6848, 0xd094, 0x0110, 0x1f04, 0x4471, 0x684b, 0x0009, + 0x20a9, 0x0014, 0x6848, 0xd084, 0x0110, 0x1f04, 0x447a, 0x20a9, + 0x00fa, 0x1f04, 0x4481, 0x681b, 0x0054, 0x00de, 0x6863, 0x0007, + 0x0005, 0x2079, 0x4500, 0x00e1, 0x0089, 0x00a9, 0x2009, 0x0002, + 0x2069, 0x4580, 0x680f, 0x0000, 0x6813, 0x0000, 0x6817, 0x0000, + 0x8109, 0x0118, 0x2069, 0x4540, 0x0ca8, 0x0005, 0x2019, 0x00a3, + 0x7b3a, 0x7b3e, 0x0005, 0x2019, 0x0033, 0x7b42, 0x7b46, 0x0005, + 0x2019, 0x32dd, 0x7b32, 0x7b36, 0x0005, 0x694c, 0xa185, 0x0000, + 0x0158, 0x00c6, 0x6abc, 0x2264, 0x6008, 0xc0b5, 0x600a, 0x8210, + 0x8109, 0x1dc8, 0x694e, 0x00ce, 0x0005, 0x70ec, 0xd0dc, 0x1118, + 0xd0d4, 0x0190, 0x0098, 0xae8e, 0x0100, 0x0138, 0x7814, 0xc0f5, + 0xc0c5, 0x7816, 0xd0d4, 0x11a8, 0x0088, 0x7814, 0xc0fd, 0xc0c5, + 0x7816, 0xd0d4, 0x1170, 0x0050, 0xd0e4, 0x0168, 0x70e4, 0xa084, + 0x01ff, 0xa086, 0x01ff, 0x0d38, 0x70a0, 0x70a2, 0x7804, 0xd08c, + 0x0110, 0x681f, 0x000c, 0x0005, 0x69ca }; #ifdef UNIQUE_FW_NAME -unsigned short fw12160i_length01 = 0x32f8; +unsigned short fw12160i_length01 = 0x34e5; #else -unsigned short risc_code_length01 = 0x32f8; +unsigned short risc_code_length01 = 0x34e5; #endif diff -urN linux-2.4.18/drivers/scsi/ql1280_fw.h lia64-2.4/drivers/scsi/ql1280_fw.h --- linux-2.4.18/drivers/scsi/ql1280_fw.h Mon Feb 7 19:45:28 2000 +++ lia64-2.4/drivers/scsi/ql1280_fw.h Mon Oct 30 22:17:11 2000 @@ -1,59 +1,117 @@ /************************************************************************ + * * + * --- ISP1240/1080/1280 Initiator Firmware --- * + * 32 LUN Support * + * * + ************************************************************************ - * Copyright (C) 1999,2000 Qlogic, Corporation. + + * * + + * Copyright (C) 1999,2000 Qlogic, Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted provided + * that the following conditions are met: + * 1. Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. - * 2. The name of the author may not be used to endorse or promote products + + * 2. Redistribution in binary form must reproduce the above copyright + + * notice, this list of conditions and the following disclaimer in the + + * documentation and/or other materials provided with the distribution. + + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * * + ************************************************************************ + */ /* - * Firmware Version 8.09.00 (18:29 Apr 16, 1999) + * Firmware Version 8.13.08 (10:53 Jan 14, 2000) */ -unsigned short fw1280ei_version = 8*1024+9; +#ifdef UNIQUE_FW_NAME +unsigned short fw1280ei_version = 8*1024+13; +#else +unsigned short risc_code_version = 8*1024+13; +#endif + +#ifdef UNIQUE_FW_NAME +unsigned char fw1280ei_version_str[] = {8,13,8}; +#else +unsigned char firmware_version[] = {8,13,8}; +#endif -unsigned char fw1280ei_version_str[] = {8,9,0}; +#ifdef UNIQUE_FW_NAME +#define fw1280ei_VERSION_STRING "8.13.8" +#else +#define FW_VERSION_STRING "8.13.8" +#endif +#ifdef UNIQUE_FW_NAME unsigned short fw1280ei_addr01 = 0x1000 ; +#else +unsigned short risc_code_addr01 = 0x1000 ; +#endif +#ifdef UNIQUE_FW_NAME unsigned short fw1280ei_code01[] = { - 0x0078, 0x1041, 0x0000, 0x39e3, 0x0000, 0x2043, 0x4f50, 0x5952, +#else +unsigned short risc_code01[] = { +#endif + 0x0078, 0x1041, 0x0000, 0x3c71, 0x0000, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932, 0x2c31, 0x3939, 0x332c, 0x3139, 0x3934, 0x2051, 0x4c4f, 0x4749, 0x4320, 0x434f, 0x5250, 0x4f52, 0x4154, 0x494f, 0x4e00, 0x2049, 0x5350, 0x3132, 0x3430, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056, - 0x6572, 0x7369, 0x6f6e, 0x2030, 0x382e, 0x3039, 0x2020, 0x2043, + 0x6572, 0x7369, 0x6f6e, 0x2030, 0x382e, 0x3133, 0x2020, 0x2043, 0x7573, 0x746f, 0x6d65, 0x7220, 0x4e6f, 0x2e20, 0x3030, 0x2050, 0x726f, 0x6475, 0x6374, 0x204e, 0x6f2e, 0x2020, 0x3030, 0x2020, - 0x2400, 0x20c9, 0x93ff, 0x2001, 0x04fc, 0x2004, 0xa086, 0x1080, + 0x2400, 0x20c9, 0x96ff, 0x2001, 0x04fc, 0x2004, 0xa086, 0x1080, 0x00c0, 0x1054, 0x2071, 0x0100, 0x70a0, 0x70a2, 0x20c1, 0x0010, - 0x2089, 0x136a, 0x0078, 0x106d, 0x2001, 0x04fc, 0x2004, 0xa086, + 0x2089, 0x1374, 0x0078, 0x106d, 0x2001, 0x04fc, 0x2004, 0xa086, 0x1280, 0x00c0, 0x1069, 0x2071, 0x0200, 0x70a0, 0x70a2, 0x2071, - 0x0100, 0x70a0, 0x70a2, 0x20c1, 0x0010, 0x2089, 0x13ea, 0x0078, - 0x106d, 0x20c1, 0x0020, 0x2089, 0x1312, 0x2071, 0x0010, 0x70c3, + 0x0100, 0x70a0, 0x70a2, 0x20c1, 0x0010, 0x2089, 0x13f8, 0x0078, + 0x106d, 0x20c1, 0x0020, 0x2089, 0x131c, 0x2071, 0x0010, 0x70c3, 0x0004, 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 0x0008, 0x2001, 0x04fe, 0x70d6, 0x20c1, 0x0021, 0x2019, 0x0000, 0x2009, 0xfeff, 0x2100, 0x200b, 0xa5a5, 0xa1ec, 0x7fff, 0x2d64, @@ -61,1838 +119,1924 @@ 0xa286, 0xa5a5, 0x0040, 0x10a4, 0xa386, 0x000f, 0x0040, 0x10a0, 0x2c6a, 0x2a5a, 0x20c1, 0x0020, 0x2019, 0x000f, 0x0078, 0x1080, 0x2c6a, 0x2a5a, 0x0078, 0x10a2, 0x2c6a, 0x2a5a, 0x2130, 0x2128, - 0xa1a2, 0x4a00, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, - 0xa192, 0x9400, 0x2009, 0x0000, 0x2001, 0x0032, 0x1078, 0x2078, - 0x2218, 0x2079, 0x4a00, 0x2fa0, 0x2408, 0x2011, 0x0000, 0x20a9, - 0x0040, 0x42a4, 0x8109, 0x00c0, 0x10bf, 0x2001, 0x04fc, 0x2004, - 0xa086, 0x1080, 0x00c0, 0x10db, 0x2071, 0x0100, 0x0d7e, 0x2069, - 0x4a40, 0x1078, 0x49ae, 0x0d7f, 0x7810, 0xc0ed, 0x7812, 0x781b, - 0x0064, 0x0078, 0x1100, 0x2001, 0x04fc, 0x2004, 0xa086, 0x1280, - 0x00c0, 0x10fb, 0x7814, 0xc0ed, 0xc0d5, 0x7816, 0x781b, 0x0064, - 0x2071, 0x0200, 0x0d7e, 0x2069, 0x4a40, 0x1078, 0x49ae, 0x2069, - 0x4a80, 0x2071, 0x0100, 0x1078, 0x49ae, 0x7814, 0xc0d4, 0x7816, - 0x0d7f, 0x0078, 0x1100, 0x7814, 0xc0e5, 0x7816, 0x781b, 0x003c, - 0x7eca, 0x7cc2, 0x7bc6, 0x7867, 0x0000, 0x7800, 0xc08d, 0x7802, - 0x2031, 0x0030, 0x78af, 0x0101, 0x7823, 0x0002, 0x7827, 0x0002, - 0x2009, 0x0002, 0x2069, 0x4a40, 0x681b, 0x0003, 0x6823, 0x0007, - 0x6827, 0x00fa, 0x682b, 0x0008, 0x682f, 0x0028, 0x6837, 0x0000, - 0x683b, 0x0006, 0x6833, 0x0008, 0x683f, 0x0000, 0x8109, 0x0040, - 0x1154, 0x68d3, 0x000a, 0x68c3, 0x4ac0, 0x2079, 0x4a00, 0x7814, - 0xd0e4, 0x00c0, 0x113a, 0xd0ec, 0x00c0, 0x113e, 0x68d7, 0x7329, - 0x0078, 0x1140, 0x68d7, 0x730d, 0x0078, 0x1140, 0x68d7, 0x7329, - 0x68c7, 0x4fc0, 0x68cb, 0x4ec0, 0x68cf, 0x8fc0, 0x68ab, 0x9244, - 0x68af, 0x9249, 0x68b3, 0x9244, 0x68b7, 0x9244, 0x68a7, 0x0001, - 0x2069, 0x4a80, 0x0078, 0x1114, 0x68d3, 0x000a, 0x68c3, 0x4cc0, - 0x7814, 0xd0e4, 0x00c0, 0x1160, 0x68d7, 0x7439, 0x0078, 0x1162, - 0x68d7, 0x7419, 0x68c7, 0x6fc0, 0x68cb, 0x4f40, 0x68cf, 0x90d0, - 0x68ab, 0x9249, 0x68af, 0x924e, 0x68b3, 0x9249, 0x68b7, 0x9249, - 0x68a7, 0x0001, 0x7810, 0xd0ec, 0x00c0, 0x11b8, 0x7814, 0xd0e4, - 0x00c0, 0x11aa, 0x0e7e, 0x2069, 0x4ec0, 0x2071, 0x0200, 0x70ec, - 0xd0e4, 0x00c0, 0x118b, 0x2019, 0x0c0c, 0x2021, 0x000c, 0x1078, - 0x2007, 0x0078, 0x1191, 0x2019, 0x0c0a, 0x2021, 0x000a, 0x1078, - 0x2007, 0x2069, 0x4f40, 0x2071, 0x0100, 0x70ec, 0xd0e4, 0x00c0, - 0x11a1, 0x2019, 0x0c0c, 0x2021, 0x000c, 0x1078, 0x2007, 0x0078, - 0x11a7, 0x2019, 0x0c0a, 0x2021, 0x000a, 0x1078, 0x2007, 0x0e7f, - 0x0078, 0x11d1, 0x2019, 0x0c0c, 0x2021, 0x000c, 0x2069, 0x4ec0, - 0x1078, 0x2007, 0x2069, 0x4f40, 0x1078, 0x2007, 0x0078, 0x11d1, - 0x2069, 0x4ec0, 0x0e7e, 0x2071, 0x0100, 0x70ec, 0xd0e4, 0x00c0, - 0x11ca, 0x2019, 0x0c0c, 0x2021, 0x000c, 0x1078, 0x2007, 0x0e7f, - 0x0078, 0x11d1, 0x2019, 0x0c0a, 0x2021, 0x000a, 0x1078, 0x2007, - 0x0e7f, 0x2011, 0x0002, 0x2069, 0x4fc0, 0x2009, 0x0002, 0x20a9, - 0x0100, 0x683f, 0x0000, 0x680b, 0x0040, 0x7bc8, 0xa386, 0xfeff, - 0x00c0, 0x11e8, 0x6817, 0x0100, 0x681f, 0x0064, 0x0078, 0x11ec, - 0x6817, 0x0064, 0x681f, 0x0002, 0xade8, 0x0010, 0x00f0, 0x11d9, - 0x8109, 0x00c0, 0x11d7, 0x8211, 0x0040, 0x11fa, 0x2069, 0x6fc0, - 0x0078, 0x11d5, 0x1078, 0x2611, 0x1078, 0x441d, 0x1078, 0x1df2, - 0x1078, 0x4957, 0x2091, 0x2100, 0x2079, 0x4a00, 0x7810, 0xd0ec, - 0x0040, 0x120e, 0x2071, 0x0020, 0x0078, 0x1210, 0x2071, 0x0050, - 0x2091, 0x2200, 0x2079, 0x4a00, 0x2071, 0x0020, 0x2091, 0x2300, - 0x2079, 0x4a00, 0x7810, 0xd0ec, 0x0040, 0x1222, 0x2079, 0x0100, - 0x0078, 0x1224, 0x2079, 0x0200, 0x2071, 0x4a40, 0x2091, 0x2400, - 0x2079, 0x0100, 0x2071, 0x4a80, 0x2091, 0x2000, 0x2079, 0x4a00, - 0x2071, 0x0010, 0x3200, 0xa085, 0x303d, 0x2090, 0x2071, 0x0010, - 0x70c3, 0x0000, 0x0090, 0x1243, 0x70c0, 0xa086, 0x0002, 0x00c0, - 0x1243, 0x1078, 0x159d, 0x2039, 0x0000, 0x7810, 0xd0ec, 0x00c0, - 0x12c5, 0x1078, 0x1472, 0x78ac, 0xa005, 0x00c0, 0x1261, 0x0068, - 0x1257, 0x786c, 0xa065, 0x0040, 0x1257, 0x1078, 0x2368, 0x1078, - 0x209f, 0x0068, 0x126e, 0x786c, 0xa065, 0x0040, 0x1261, 0x1078, - 0x2368, 0x0068, 0x126e, 0x2009, 0x4a47, 0x2011, 0x4a87, 0x2104, - 0x220c, 0xa105, 0x0040, 0x126e, 0x1078, 0x1f1e, 0x2071, 0x4a40, - 0x70a4, 0xa005, 0x0040, 0x1293, 0x7450, 0xa485, 0x0000, 0x0040, - 0x1293, 0x2079, 0x0200, 0x2091, 0x8000, 0x72d4, 0xa28c, 0x303d, - 0x2190, 0x1078, 0x2a9c, 0x2091, 0x8000, 0x2091, 0x303d, 0x0068, - 0x1293, 0x2079, 0x4a00, 0x786c, 0xa065, 0x0040, 0x1293, 0x2071, - 0x0010, 0x1078, 0x2368, 0x00e0, 0x129b, 0x2079, 0x4a00, 0x2071, - 0x0010, 0x1078, 0x4765, 0x2071, 0x4a80, 0x70a4, 0xa005, 0x0040, - 0x12b3, 0x7050, 0xa025, 0x0040, 0x12b3, 0x2079, 0x0100, 0x2091, - 0x8000, 0x72d4, 0xa28c, 0x303d, 0x2190, 0x1078, 0x2a9c, 0x2091, - 0x8000, 0x2091, 0x303d, 0x2079, 0x4a00, 0x2071, 0x0010, 0x0068, - 0x12bf, 0x786c, 0xa065, 0x0040, 0x12bf, 0x1078, 0x2368, 0x00e0, - 0x1249, 0x1078, 0x4765, 0x0078, 0x1249, 0x1078, 0x1472, 0x78ac, - 0xa005, 0x00c0, 0x12dd, 0x0068, 0x12d3, 0x786c, 0xa065, 0x0040, - 0x12d3, 0x1078, 0x2368, 0x1078, 0x209f, 0x0068, 0x12e7, 0x786c, - 0xa065, 0x0040, 0x12dd, 0x1078, 0x2368, 0x0068, 0x12e7, 0x2009, - 0x4a47, 0x2104, 0xa005, 0x0040, 0x12e7, 0x1078, 0x1f1e, 0x2071, - 0x4a40, 0x70a4, 0xa005, 0x0040, 0x1302, 0x7450, 0xa485, 0x0000, - 0x0040, 0x1302, 0x2079, 0x0100, 0x2091, 0x8000, 0x72d4, 0xa28c, - 0x303d, 0x2190, 0x1078, 0x2a9c, 0x2091, 0x8000, 0x2091, 0x303d, - 0x2079, 0x4a00, 0x2071, 0x0010, 0x0068, 0x130c, 0x786c, 0xa065, - 0x0040, 0x130c, 0x1078, 0x2368, 0x00e0, 0x12c5, 0x1078, 0x4765, - 0x0078, 0x12c5, 0x1332, 0x1332, 0x1334, 0x1334, 0x1341, 0x1341, - 0x1341, 0x1341, 0x134c, 0x134c, 0x1359, 0x1359, 0x1341, 0x1341, - 0x1341, 0x1341, 0x1332, 0x1332, 0x1334, 0x1334, 0x1341, 0x1341, - 0x1341, 0x1341, 0x134c, 0x134c, 0x1359, 0x1359, 0x1341, 0x1341, - 0x1341, 0x1341, 0x0078, 0x1332, 0x007e, 0x107e, 0x127e, 0x2091, - 0x2400, 0x1078, 0x290b, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, - 0x007c, 0x007e, 0x107e, 0x127e, 0x1078, 0x13ba, 0x127f, 0x107f, - 0x007f, 0x2091, 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x2091, - 0x2300, 0x1078, 0x290b, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, - 0x007c, 0x007e, 0x107e, 0x127e, 0x2091, 0x2300, 0x1078, 0x290b, - 0x2091, 0x2400, 0x1078, 0x290b, 0x127f, 0x107f, 0x007f, 0x2091, - 0x8001, 0x007c, 0x138a, 0x138a, 0x138c, 0x138c, 0x1399, 0x1399, - 0x1399, 0x1399, 0x13a4, 0x13a4, 0x138c, 0x138c, 0x1399, 0x1399, - 0x1399, 0x1399, 0x13a5, 0x13a5, 0x13a5, 0x13a5, 0x13a5, 0x13a5, - 0x13a5, 0x13a5, 0x13a5, 0x13a5, 0x13a5, 0x13a5, 0x13a5, 0x13a5, - 0x13a5, 0x13a5, 0x0078, 0x138a, 0x007e, 0x107e, 0x127e, 0x2091, - 0x2300, 0x1078, 0x290b, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, - 0x007c, 0x007e, 0x107e, 0x127e, 0x1078, 0x13c7, 0x127f, 0x107f, - 0x007f, 0x2091, 0x8001, 0x007c, 0x007c, 0x107e, 0x127e, 0x0d7e, - 0x0e7e, 0x0f7e, 0x007e, 0x2071, 0x0100, 0x2069, 0x4a40, 0x2079, - 0x4a00, 0x1078, 0x49ae, 0x007f, 0x0f7f, 0x0e7f, 0x0d7f, 0x127f, - 0x107f, 0x007c, 0x3c00, 0xa084, 0x0007, 0x0079, 0x13bf, 0x13d0, - 0x13d0, 0x13d2, 0x13d2, 0x13d7, 0x13d7, 0x13dc, 0x13dc, 0x3c00, - 0xa084, 0x0003, 0x0079, 0x13cc, 0x13d0, 0x13d0, 0x13e5, 0x13e5, - 0x1078, 0x28ec, 0x2091, 0x2200, 0x1078, 0x44b7, 0x007c, 0x2091, - 0x2100, 0x1078, 0x44b7, 0x007c, 0x2091, 0x2100, 0x1078, 0x44b7, - 0x2091, 0x2200, 0x1078, 0x44b7, 0x007c, 0x2091, 0x2100, 0x1078, - 0x44b7, 0x007c, 0x140a, 0x140a, 0x140c, 0x140c, 0x1419, 0x1419, - 0x1419, 0x1419, 0x1424, 0x1424, 0x1431, 0x1431, 0x1419, 0x1419, - 0x1419, 0x1419, 0x1442, 0x1442, 0x1442, 0x1442, 0x1442, 0x1442, - 0x1442, 0x1442, 0x1442, 0x1442, 0x1442, 0x1442, 0x1442, 0x1442, - 0x1442, 0x1442, 0x0078, 0x140a, 0x007e, 0x107e, 0x127e, 0x2091, - 0x2400, 0x1078, 0x290b, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, - 0x007c, 0x007e, 0x107e, 0x127e, 0x1078, 0x13ba, 0x127f, 0x107f, - 0x007f, 0x2091, 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x2091, - 0x2300, 0x1078, 0x290b, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, - 0x007c, 0x007e, 0x107e, 0x127e, 0x2091, 0x2300, 0x1078, 0x290b, - 0x2091, 0x2400, 0x1078, 0x290b, 0x127f, 0x107f, 0x007f, 0x2091, - 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x0d7e, 0x0e7e, 0x0f7e, - 0x2079, 0x4a00, 0x2071, 0x0200, 0x2069, 0x4a40, 0x3d00, 0xd08c, - 0x00c0, 0x1456, 0x2069, 0x4a80, 0x2071, 0x0100, 0x1078, 0x49ae, - 0x0f7f, 0x0e7f, 0x0d7f, 0x127f, 0x107f, 0x007f, 0x007c, 0x7008, - 0x800b, 0x00c8, 0x146d, 0x7007, 0x0002, 0xa08c, 0x01e0, 0x00c0, - 0x146e, 0xd09c, 0x0040, 0x146d, 0x087a, 0x097a, 0x70c3, 0x4002, - 0x0078, 0x15a0, 0x0068, 0x14f7, 0x2061, 0x0000, 0x6018, 0xd084, - 0x00c0, 0x14f7, 0x7828, 0xa005, 0x00c0, 0x1482, 0x0010, 0x14f8, - 0x0078, 0x14f7, 0x7910, 0xd1f4, 0x0040, 0x148a, 0x2001, 0x4007, - 0x0078, 0x159f, 0x7914, 0xd1ec, 0x0040, 0x14a5, 0xd0fc, 0x0040, - 0x149b, 0x007e, 0x1078, 0x1d82, 0x007f, 0x0040, 0x14a5, 0x2001, - 0x4007, 0x0078, 0x159f, 0x007e, 0x1078, 0x1d72, 0x007f, 0x0040, - 0x14a5, 0x2001, 0x4007, 0x0078, 0x159f, 0x7910, 0xd0fc, 0x00c0, - 0x14af, 0x2061, 0x4a40, 0xc19c, 0xc7fc, 0x0078, 0x14b3, 0x2061, - 0x4a80, 0xc19d, 0xc7fd, 0x6064, 0xa005, 0x00c0, 0x14f7, 0x7912, - 0x6083, 0x0000, 0x7828, 0xc0fc, 0xa086, 0x0018, 0x00c0, 0x14c4, - 0x0c7e, 0x1078, 0x1b13, 0x0c7f, 0x782b, 0x0000, 0x607c, 0xa065, - 0x0040, 0x14dd, 0x0c7e, 0x609c, 0x1078, 0x1e5d, 0x0c7f, 0x609f, - 0x0000, 0x1078, 0x1c3f, 0x2009, 0x0018, 0x6087, 0x0103, 0x1078, - 0x1d92, 0x00c0, 0x14f1, 0x1078, 0x1de4, 0x7810, 0xd09c, 0x00c0, - 0x14e5, 0x2061, 0x4a40, 0x0078, 0x14e9, 0x2061, 0x4a80, 0xc09c, - 0x7812, 0x607f, 0x0000, 0x60d4, 0xd0dc, 0x0040, 0x14f5, 0xc0dc, - 0x60d6, 0x2001, 0x4005, 0x0078, 0x159f, 0x0078, 0x159d, 0x007c, - 0x7810, 0xd0f4, 0x0040, 0x1500, 0x2001, 0x4007, 0x0078, 0x159f, - 0xa006, 0x70c2, 0x70c6, 0x70ca, 0x70ce, 0x70da, 0x70c0, 0xa08a, - 0x0040, 0x00c8, 0x150d, 0x0079, 0x1514, 0x2100, 0xa08a, 0x0040, - 0x00c8, 0x15ab, 0x0079, 0x1554, 0x159d, 0x15f3, 0x15bc, 0x162b, - 0x1663, 0x1663, 0x15b3, 0x1c57, 0x166e, 0x15ab, 0x15c0, 0x15c2, - 0x15c4, 0x15c6, 0x1c5c, 0x15ab, 0x167c, 0x16d4, 0x1b35, 0x1c51, - 0x15c8, 0x19a7, 0x19e9, 0x1a1f, 0x1a6b, 0x1962, 0x196f, 0x1983, - 0x1996, 0x17a4, 0x1cdc, 0x1706, 0x1713, 0x171f, 0x172b, 0x1741, - 0x174d, 0x1750, 0x175c, 0x1768, 0x1770, 0x178c, 0x1798, 0x15ab, - 0x15ab, 0x15ab, 0x15ab, 0x17b1, 0x17c3, 0x17df, 0x1815, 0x183d, - 0x184d, 0x1850, 0x1881, 0x18b2, 0x18c4, 0x1931, 0x1941, 0x1d32, - 0x15ab, 0x15ab, 0x15ab, 0x1951, 0x15ab, 0x15ab, 0x15ab, 0x15ab, - 0x15ab, 0x1c81, 0x1c87, 0x15ab, 0x15ab, 0x15ab, 0x1c8b, 0x1cd8, - 0x15ab, 0x15ab, 0x1ce8, 0x1cf7, 0x15ed, 0x165d, 0x1676, 0x16ce, - 0x1b2f, 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x1d39, 0x1c73, 0x1c7d, - 0x15ab, 0x15ab, 0x1d02, 0x1d1b, 0x15ab, 0x15ab, 0x15ab, 0x15ab, - 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x15ab, - 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x15ab, - 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x15ab, - 0x15ab, 0x15ab, 0x15ab, 0x15ab, 0x72ca, 0x71c6, 0x2001, 0x4006, - 0x0078, 0x159f, 0x73ce, 0x72ca, 0x71c6, 0x2001, 0x4000, 0x70c2, - 0x0068, 0x15a0, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x5000, - 0x2091, 0x4080, 0x007c, 0x70c3, 0x4001, 0x0078, 0x15a0, 0x70c3, - 0x4006, 0x0078, 0x15a0, 0x2099, 0x0041, 0x20a1, 0x0041, 0x20a9, - 0x0005, 0x53a3, 0x0078, 0x159d, 0x70c4, 0x70c3, 0x0004, 0x007a, - 0x0078, 0x159d, 0x0078, 0x159d, 0x0078, 0x159d, 0x0078, 0x159d, - 0x2091, 0x8000, 0x70c3, 0x0004, 0x70c7, 0x4953, 0x70cb, 0x5020, - 0x70cf, 0x2020, 0x70d3, 0x0008, 0x2001, 0x0009, 0x70d6, 0x2079, - 0x0000, 0x781b, 0x0001, 0x2031, 0x0030, 0x2059, 0x1000, 0x2029, - 0x041a, 0x2051, 0x0445, 0x2061, 0x0447, 0x20c1, 0x0020, 0x2091, - 0x5000, 0x2091, 0x4080, 0x0078, 0x0418, 0x75d8, 0x74dc, 0x75da, - 0x74de, 0x0078, 0x15f6, 0x2029, 0x0000, 0x2520, 0x71d0, 0x72c8, - 0x73cc, 0x70c4, 0x20a0, 0x2099, 0x0030, 0x7003, 0x0001, 0x7007, - 0x0006, 0x731a, 0x721e, 0x7422, 0x7526, 0x2021, 0x0040, 0x81ff, - 0x0040, 0x159d, 0xa182, 0x0040, 0x00c8, 0x1610, 0x2120, 0xa006, - 0x2008, 0x8403, 0x7012, 0x7007, 0x0004, 0x7007, 0x0001, 0x7008, - 0xd0fc, 0x0040, 0x1617, 0x7007, 0x0002, 0xa084, 0x01e0, 0x0040, - 0x1625, 0x70c3, 0x4002, 0x0078, 0x15a0, 0x24a8, 0x53a5, 0x0078, - 0x1607, 0x0078, 0x159d, 0x2029, 0x0000, 0x2520, 0x71d0, 0x72c8, - 0x73cc, 0x70c4, 0x2098, 0x20a1, 0x0030, 0x7003, 0x0000, 0x7007, - 0x0006, 0x731a, 0x721e, 0x7422, 0x7526, 0x2021, 0x0040, 0x7007, - 0x0006, 0x81ff, 0x0040, 0x159d, 0xa182, 0x0040, 0x00c8, 0x164a, - 0x2120, 0xa006, 0x2008, 0x8403, 0x7012, 0x24a8, 0x53a6, 0x7007, - 0x0001, 0x7008, 0xd0fc, 0x0040, 0x1651, 0xa084, 0x01e0, 0x0040, - 0x163f, 0x70c3, 0x4002, 0x0078, 0x15a0, 0x75d8, 0x74dc, 0x75da, - 0x74de, 0x0078, 0x162e, 0x71c4, 0x70c8, 0x2114, 0xa79e, 0x0004, - 0x00c0, 0x166b, 0x200a, 0x72ca, 0x0078, 0x159c, 0x70c7, 0x0008, - 0x70cb, 0x0009, 0x70cf, 0x0000, 0x0078, 0x159d, 0x75d8, 0x76dc, - 0x75da, 0x76de, 0x0078, 0x167f, 0x2029, 0x0000, 0x2530, 0x70c4, - 0x72c8, 0x73cc, 0x74d0, 0x70c6, 0x72ca, 0x73ce, 0x74d2, 0xa005, - 0x0040, 0x16c9, 0x8001, 0x7872, 0xa084, 0xfc00, 0x0040, 0x1697, - 0x78ac, 0xc085, 0x78ae, 0x2001, 0x4005, 0x0078, 0x159f, 0x7b7e, - 0x7a7a, 0x7e86, 0x7d82, 0x7c76, 0xa48c, 0xff00, 0x0040, 0x16af, - 0x8407, 0x8004, 0x8004, 0x810c, 0x810c, 0x810f, 0xa118, 0xa291, - 0x0000, 0xa6b1, 0x0000, 0xa581, 0x0000, 0x0078, 0x16b9, 0x8407, - 0x8004, 0x8004, 0xa318, 0xa291, 0x0000, 0xa6b1, 0x0000, 0xa581, - 0x0000, 0x731a, 0x721e, 0x7622, 0x7026, 0xa605, 0x0040, 0x16c3, - 0x7a10, 0xc2c5, 0x7a12, 0x78ac, 0xa084, 0xfffc, 0x78ae, 0x0078, - 0x16cc, 0x78ac, 0xc085, 0x78ae, 0x0078, 0x159d, 0x75d8, 0x76dc, - 0x75da, 0x76de, 0x0078, 0x16d7, 0x2029, 0x0000, 0x2530, 0x70c4, - 0x72c8, 0x73cc, 0x74d4, 0x70c6, 0x72ca, 0x73ce, 0x74d6, 0xa005, - 0x0040, 0x1701, 0x8001, 0x7892, 0xa084, 0xfc00, 0x0040, 0x16ef, - 0x78ac, 0xc0c5, 0x78ae, 0x2001, 0x4005, 0x0078, 0x159f, 0x7a9a, - 0x7b9e, 0x7da2, 0x7ea6, 0x2600, 0xa505, 0x0040, 0x16fa, 0x7a10, - 0xc2c5, 0x7a12, 0x7c96, 0x78ac, 0xa084, 0xfcff, 0x78ae, 0x0078, - 0x1704, 0x78ac, 0xc0c5, 0x78ae, 0x0078, 0x159d, 0x2009, 0x0000, - 0x786c, 0xa065, 0x0040, 0x1710, 0x8108, 0x6000, 0x0078, 0x1709, - 0x7ac4, 0x0078, 0x159b, 0x2009, 0x4a48, 0x210c, 0x7810, 0xd0ec, - 0x00c0, 0x159c, 0x2011, 0x4a88, 0x2214, 0x0078, 0x159b, 0x2009, - 0x4a49, 0x210c, 0x7810, 0xd0ec, 0x00c0, 0x159c, 0x2011, 0x4a89, - 0x2214, 0x0078, 0x159b, 0x2061, 0x4a40, 0x6128, 0x622c, 0x8214, - 0x8214, 0x8214, 0x7810, 0xd0ec, 0x00c0, 0x173f, 0x2061, 0x4a80, - 0x6328, 0x73da, 0x632c, 0x831c, 0x831c, 0x831c, 0x73de, 0x0078, - 0x159b, 0x2009, 0x4a4c, 0x210c, 0x7810, 0xd0ec, 0x00c0, 0x159c, - 0x2011, 0x4a8c, 0x2214, 0x0078, 0x159b, 0x7918, 0x0078, 0x159c, - 0x2009, 0x4a4d, 0x210c, 0x7810, 0xd0ec, 0x00c0, 0x159c, 0x2011, - 0x4a8d, 0x2214, 0x0078, 0x159b, 0x2009, 0x4a4e, 0x210c, 0x7810, - 0xd0ec, 0x00c0, 0x159c, 0x2011, 0x4a8e, 0x2214, 0x0078, 0x159b, - 0x7920, 0x7810, 0xd0ec, 0x00c0, 0x159c, 0x7a24, 0x0078, 0x159b, - 0x71c4, 0xd1fc, 0x00c0, 0x1778, 0x2011, 0x4ec0, 0x0078, 0x177a, - 0x2011, 0x4f40, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, - 0xa268, 0x6a00, 0x6804, 0xd09c, 0x0040, 0x1789, 0x6b08, 0x0078, - 0x178a, 0x6b0c, 0x0078, 0x159a, 0x77c4, 0x1078, 0x1e02, 0x2091, - 0x8000, 0x6b1c, 0x6a14, 0x2091, 0x8001, 0x2708, 0x0078, 0x159a, - 0x2061, 0x4a40, 0x6118, 0x7810, 0xd0ec, 0x00c0, 0x159c, 0x2061, - 0x4a80, 0x6218, 0x0078, 0x159b, 0x77c4, 0x1078, 0x1e02, 0x2091, - 0x8000, 0x6908, 0x6a18, 0x6b10, 0x77da, 0x2091, 0x8001, 0x0078, - 0x159a, 0x71c4, 0x2110, 0xa294, 0x000f, 0xa282, 0x0010, 0x00c8, - 0x1595, 0x1078, 0x2729, 0xa384, 0x4000, 0x0040, 0x17c1, 0xa295, - 0x0020, 0x0078, 0x159a, 0x71c4, 0x2100, 0xc0bc, 0xa082, 0x0010, - 0x00c8, 0x1595, 0xd1bc, 0x00c0, 0x17d2, 0x2011, 0x4a48, 0x2204, - 0x0078, 0x17d6, 0x2011, 0x4a88, 0x2204, 0xc0bd, 0x007e, 0x2100, - 0xc0bc, 0x2012, 0x1078, 0x2686, 0x017f, 0x0078, 0x159c, 0x71c4, - 0x2021, 0x4a49, 0x2404, 0x70c6, 0x2019, 0x0000, 0x0078, 0x17ee, - 0x71c8, 0x2021, 0x4a89, 0x2404, 0x70ca, 0xc3fd, 0x2011, 0x180d, - 0x20a9, 0x0008, 0x2204, 0xa106, 0x0040, 0x17fd, 0x8210, 0x00f0, - 0x17f2, 0x71c4, 0x72c8, 0x0078, 0x1594, 0xa292, 0x180d, 0x027e, - 0x2122, 0x017f, 0x1078, 0x26a7, 0x7810, 0xd0ec, 0x00c0, 0x180b, - 0xd3fc, 0x0040, 0x17e8, 0x0078, 0x159d, 0x03e8, 0x00fa, 0x01f4, - 0x02ee, 0x0064, 0x0019, 0x0032, 0x004b, 0x2061, 0x4a40, 0x6128, - 0x622c, 0x8214, 0x8214, 0x8214, 0x70c4, 0x602a, 0x70c8, 0x8003, - 0x8003, 0x8003, 0x602e, 0x7810, 0xd0ec, 0x00c0, 0x183b, 0x027e, - 0x017e, 0x2061, 0x4a80, 0x6128, 0x622c, 0x8214, 0x8214, 0x8214, - 0x70d8, 0x602a, 0x70dc, 0x8003, 0x8003, 0x8003, 0x602e, 0x71da, - 0x72de, 0x017f, 0x027f, 0x0078, 0x159b, 0x2061, 0x4a40, 0x6130, - 0x70c4, 0x6032, 0x7810, 0xd0ec, 0x00c0, 0x159c, 0x2061, 0x4a80, - 0x6230, 0x70c8, 0x6032, 0x0078, 0x159b, 0x7918, 0x0078, 0x159c, - 0x71c4, 0xa184, 0xffcf, 0x0040, 0x185c, 0x7810, 0xd0ec, 0x00c0, - 0x1595, 0x72c8, 0x0078, 0x1594, 0x2011, 0x4a4d, 0x2204, 0x2112, - 0x007e, 0x2019, 0x0000, 0x1078, 0x270e, 0x7810, 0xd0ec, 0x0040, - 0x186c, 0x017f, 0x0078, 0x159c, 0x71c8, 0xa184, 0xffcf, 0x0040, - 0x1875, 0x2110, 0x71c4, 0x0078, 0x1594, 0x2011, 0x4a8d, 0x2204, - 0x2112, 0x007e, 0xc3fd, 0x1078, 0x270e, 0x027f, 0x017f, 0x0078, - 0x159b, 0x71c4, 0xa182, 0x0010, 0x0048, 0x188d, 0x7810, 0xd0ec, - 0x00c0, 0x1595, 0x72c8, 0x0078, 0x1594, 0x2011, 0x4a4e, 0x2204, - 0x007e, 0x2112, 0x2019, 0x0000, 0x1078, 0x26ec, 0x7810, 0xd0ec, - 0x0040, 0x189d, 0x017f, 0x0078, 0x159c, 0x71c8, 0xa182, 0x0010, - 0x0048, 0x18a6, 0x2110, 0x71c4, 0x0078, 0x1594, 0x2011, 0x4a8e, - 0x2204, 0x007e, 0x2112, 0xc3fd, 0x1078, 0x26ec, 0x027f, 0x017f, - 0x0078, 0x159b, 0x71c4, 0x72c8, 0xa184, 0xfffd, 0x00c0, 0x1594, - 0xa284, 0xfffd, 0x00c0, 0x1594, 0x2100, 0x7920, 0x7822, 0x2200, - 0x7a24, 0x7826, 0x0078, 0x159b, 0x71c4, 0xd1fc, 0x00c0, 0x18cc, - 0x2011, 0x4ec0, 0x0078, 0x18ce, 0x2011, 0x4f40, 0x8107, 0xa084, - 0x000f, 0x8003, 0x8003, 0x8003, 0xa268, 0x2019, 0x0000, 0x72c8, - 0xa284, 0x0080, 0x0040, 0x18e2, 0x6c14, 0x84ff, 0x00c0, 0x18e2, - 0x6817, 0x0040, 0xa284, 0x0040, 0x0040, 0x18ec, 0x6c10, 0x84ff, - 0x00c0, 0x18ec, 0x6813, 0x0001, 0x6800, 0x007e, 0xa226, 0x0040, - 0x1909, 0x6a02, 0xd4ec, 0x0040, 0x18f6, 0xc3a5, 0xd4e4, 0x0040, - 0x18fa, 0xc39d, 0xd4f4, 0x0040, 0x1909, 0x810f, 0xd2f4, 0x0040, - 0x1905, 0x1078, 0x276b, 0x0078, 0x1909, 0x1078, 0x2749, 0x0078, - 0x1909, 0x72cc, 0x6808, 0xa206, 0x0040, 0x1929, 0xa2a4, 0x00ff, - 0x7814, 0xd0e4, 0x00c0, 0x191c, 0xa482, 0x0028, 0x0048, 0x1926, - 0x0040, 0x1926, 0x0078, 0x1920, 0xa482, 0x0043, 0x0048, 0x1926, - 0x71c4, 0x71c6, 0x027f, 0x72ca, 0x0078, 0x1596, 0x6a0a, 0xa39d, - 0x000a, 0x6804, 0xa305, 0x6806, 0x027f, 0x6b0c, 0x71c4, 0x0078, - 0x159a, 0x77c4, 0x1078, 0x1e02, 0x2091, 0x8000, 0x6a14, 0x6b1c, - 0x2091, 0x8001, 0x70c8, 0x6816, 0x70cc, 0x681e, 0x2708, 0x0078, - 0x159a, 0x70c4, 0x2061, 0x4a40, 0x6118, 0x601a, 0x7810, 0xd0ec, - 0x00c0, 0x159c, 0x70c8, 0x2061, 0x4a80, 0x6218, 0x601a, 0x0078, - 0x159b, 0x71c4, 0x72c8, 0x73cc, 0xa182, 0x0010, 0x00c8, 0x1595, - 0x1078, 0x278d, 0xa384, 0x4000, 0x0040, 0x1960, 0xa295, 0x0020, - 0x0078, 0x159a, 0x77c4, 0x1078, 0x1e02, 0x2091, 0x8000, 0x6a08, - 0xc28d, 0x6a0a, 0x2091, 0x8001, 0x2708, 0x0078, 0x159b, 0x77c4, - 0x1078, 0x1e02, 0x2091, 0x8000, 0x6a08, 0xa294, 0xfff9, 0x6a0a, - 0x6804, 0xa005, 0x0040, 0x197e, 0x1078, 0x25de, 0x2091, 0x8001, - 0x2708, 0x0078, 0x159b, 0x77c4, 0x1078, 0x1e02, 0x2091, 0x8000, - 0x6a08, 0xc295, 0x6a0a, 0x6804, 0xa005, 0x0040, 0x1991, 0x1078, - 0x25de, 0x2091, 0x8001, 0x2708, 0x0078, 0x159b, 0x77c4, 0x2041, - 0x0001, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 0x1078, - 0x1e1d, 0x2091, 0x8001, 0x2708, 0x6a08, 0x0078, 0x159b, 0x77c4, - 0x7814, 0xd0e4, 0x00c0, 0x19bb, 0xd7fc, 0x0040, 0x19b5, 0x1078, - 0x1d82, 0x0040, 0x19bb, 0x0078, 0x159f, 0x1078, 0x1d72, 0x0040, - 0x19bb, 0x0078, 0x159f, 0x73c8, 0x72cc, 0x77c6, 0x73ca, 0x72ce, - 0x1078, 0x1e9a, 0x00c0, 0x19e5, 0x6818, 0xa005, 0x0040, 0x19df, - 0x2708, 0x077e, 0x1078, 0x27bd, 0x077f, 0x00c0, 0x19df, 0x2001, - 0x0015, 0xd7fc, 0x00c0, 0x19d8, 0x2061, 0x4a40, 0x0078, 0x19db, - 0xc0fd, 0x2061, 0x4a80, 0x782a, 0x2091, 0x8001, 0x007c, 0x2091, - 0x8001, 0x2001, 0x4005, 0x0078, 0x159f, 0x2091, 0x8001, 0x0078, - 0x159d, 0x77c4, 0x7814, 0xd0e4, 0x00c0, 0x19fd, 0xd7fc, 0x0040, - 0x19f7, 0x1078, 0x1d82, 0x0040, 0x19fd, 0x0078, 0x159f, 0x1078, - 0x1d72, 0x0040, 0x19fd, 0x0078, 0x159f, 0x77c6, 0x2041, 0x0021, - 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 0x1078, 0x1e1d, - 0x2009, 0x0016, 0xd7fc, 0x00c0, 0x1a11, 0x2061, 0x4a40, 0x0078, - 0x1a14, 0x2061, 0x4a80, 0xc1fd, 0x6067, 0x0003, 0x6776, 0x6083, - 0x000f, 0x792a, 0x1078, 0x25de, 0x2091, 0x8001, 0x007c, 0x77c8, - 0x77ca, 0x77c4, 0x77c6, 0x7814, 0xd0e4, 0x00c0, 0x1a36, 0xd7fc, - 0x0040, 0x1a30, 0x1078, 0x1d82, 0x0040, 0x1a36, 0x0078, 0x159f, - 0x1078, 0x1d72, 0x0040, 0x1a36, 0x0078, 0x159f, 0xa7bc, 0xff00, - 0x2091, 0x8000, 0x2009, 0x0017, 0xd7fc, 0x00c0, 0x1a43, 0x2061, - 0x4a40, 0x0078, 0x1a46, 0x2061, 0x4a80, 0xc1fd, 0x6067, 0x0002, - 0x6776, 0x6083, 0x000f, 0x792a, 0x1078, 0x25de, 0x2091, 0x8001, - 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, 0x0010, 0x2091, 0x8000, - 0x70c8, 0xa005, 0x0040, 0x1a5f, 0x60d4, 0xc0fd, 0x60d6, 0x1078, - 0x1e1d, 0x70c8, 0x683e, 0x8738, 0xa784, 0x001f, 0x00c0, 0x1a5f, - 0x2091, 0x8001, 0x007c, 0x7814, 0xd0e4, 0x00c0, 0x1a7f, 0x72c8, - 0xd284, 0x0040, 0x1a79, 0x1078, 0x1d82, 0x0040, 0x1a7f, 0x0078, - 0x159f, 0x1078, 0x1d72, 0x0040, 0x1a7f, 0x0078, 0x159f, 0x72c8, - 0x72ca, 0x78ac, 0xa084, 0x0003, 0x00c0, 0x1aaa, 0x2039, 0x0000, - 0xd284, 0x0040, 0x1a8c, 0xc7fd, 0x2041, 0x0021, 0x2049, 0x0004, - 0x2051, 0x0008, 0x1078, 0x1e02, 0x2091, 0x8000, 0x6808, 0xc0d4, - 0xa80d, 0x690a, 0x2091, 0x8001, 0x8738, 0xa784, 0x001f, 0x00c0, - 0x1a92, 0xa7bc, 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, - 0x00c0, 0x1a92, 0x2091, 0x8000, 0x72c8, 0xd284, 0x00c0, 0x1abc, - 0x7810, 0xd0ec, 0x0040, 0x1ab8, 0x2069, 0x0100, 0x0078, 0x1abe, - 0x2069, 0x0200, 0x0078, 0x1abe, 0x2069, 0x0100, 0x6830, 0xd0b4, - 0x0040, 0x1ada, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848, 0xd094, - 0x0040, 0x1acc, 0x00f0, 0x1ac6, 0x684b, 0x0009, 0x20a9, 0x0014, - 0x6848, 0xd084, 0x0040, 0x1ad6, 0x00f0, 0x1ad0, 0x20a9, 0x00fa, - 0x00f0, 0x1ad8, 0x2079, 0x4a00, 0x2009, 0x0018, 0x72c8, 0xd284, - 0x00c0, 0x1ae6, 0x2061, 0x4a40, 0x0078, 0x1ae9, 0x2061, 0x4a80, - 0xc1fd, 0x792a, 0x6067, 0x0001, 0x6083, 0x000f, 0x60a7, 0x0000, - 0x60a8, 0x60b2, 0x60b6, 0x60d4, 0xd0b4, 0x0040, 0x1b03, 0xc0b4, - 0x60d6, 0x0c7e, 0x60b8, 0xa065, 0x6008, 0xc0d4, 0x600a, 0x6018, - 0x8001, 0x601a, 0x0c7f, 0x60d4, 0xa084, 0x77ff, 0x60d6, 0x78ac, - 0xc08d, 0x78ae, 0x6808, 0xa084, 0xfffd, 0x680a, 0x681b, 0x0047, - 0x2091, 0x8001, 0x007c, 0xd7fc, 0x00c0, 0x1b1a, 0x2069, 0x4a40, - 0x0078, 0x1b1c, 0x2069, 0x4a80, 0x78ac, 0xc08c, 0x78ae, 0xd084, - 0x00c0, 0x1b26, 0x0d7e, 0x1078, 0x1efa, 0x0d7f, 0x71c4, 0x71c6, - 0x6916, 0x81ff, 0x00c0, 0x1b2e, 0x68a7, 0x0001, 0x007c, 0x75d8, - 0x74dc, 0x75da, 0x74de, 0x0078, 0x1b38, 0x2029, 0x0000, 0x2520, - 0x71c4, 0x73c8, 0x72cc, 0x71c6, 0x73ca, 0x72ce, 0x2079, 0x4a00, - 0x7dde, 0x7cda, 0x7bd6, 0x7ad2, 0x1078, 0x1ddb, 0x0040, 0x1c3b, - 0x20a9, 0x0005, 0x20a1, 0x4a14, 0x2091, 0x8000, 0x41a1, 0x2091, - 0x8001, 0x2009, 0x0040, 0x1078, 0x1fcf, 0x0040, 0x1b5b, 0x1078, - 0x1de4, 0x0078, 0x1c3b, 0x6004, 0xa08c, 0x00ff, 0xa18e, 0x0009, - 0x00c0, 0x1b66, 0x007e, 0x1078, 0x234b, 0x007f, 0xa084, 0xff00, - 0x8007, 0x8009, 0x0040, 0x1bda, 0x0c7e, 0x2c68, 0x1078, 0x1ddb, - 0x0040, 0x1bac, 0x2c00, 0x689e, 0x8109, 0x00c0, 0x1b6d, 0x609f, - 0x0000, 0x0c7f, 0x0c7e, 0x7ddc, 0x7cd8, 0x7bd4, 0x7ad0, 0xa290, - 0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x7dde, - 0x7cda, 0x7bd6, 0x7ad2, 0x2c68, 0x689c, 0xa065, 0x0040, 0x1bd9, - 0x2009, 0x0040, 0x1078, 0x1fcf, 0x00c0, 0x1bc3, 0x6004, 0xa084, - 0x00ff, 0xa086, 0x0002, 0x00c0, 0x1bac, 0x6004, 0xa084, 0x00ff, - 0xa086, 0x000a, 0x00c0, 0x1ba8, 0x017e, 0x1078, 0x2347, 0x017f, - 0x2d00, 0x6002, 0x0078, 0x1b7b, 0x0c7f, 0x0c7e, 0x609c, 0x1078, - 0x1e5d, 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1c3f, 0x2009, 0x0018, - 0x6008, 0xc0cd, 0x600a, 0x6004, 0x6086, 0x1078, 0x1d92, 0x1078, - 0x1de4, 0x0078, 0x1c3b, 0x0c7f, 0x0c7e, 0x609c, 0x1078, 0x1e5d, - 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1c3f, 0x2009, 0x0018, 0x6087, - 0x0103, 0x601b, 0x0003, 0x1078, 0x1d92, 0x1078, 0x1de4, 0x0078, - 0x1c3b, 0x0c7f, 0x7814, 0xd0e4, 0x00c0, 0x1bff, 0x6114, 0xd1fc, - 0x0040, 0x1be8, 0x1078, 0x1d82, 0x0040, 0x1bff, 0x0078, 0x1bec, - 0x1078, 0x1d72, 0x0040, 0x1bff, 0x2029, 0x0000, 0x2520, 0x2009, - 0x0018, 0x73c8, 0x72cc, 0x6087, 0x0103, 0x601b, 0x0021, 0x1078, - 0x1d92, 0x1078, 0x1de4, 0x2001, 0x4007, 0x0078, 0x159f, 0x74c4, - 0x73c8, 0x72cc, 0x6014, 0x2091, 0x8000, 0x0e7e, 0x2009, 0x0012, - 0xd0fc, 0x00c0, 0x1c0f, 0x2071, 0x4a40, 0x0078, 0x1c12, 0x2071, - 0x4a80, 0xc1fd, 0x792a, 0x7067, 0x0005, 0x71d4, 0xa18c, 0xf77f, - 0x71d6, 0x736a, 0x726e, 0x7472, 0x7076, 0x707b, 0x0000, 0x2c00, - 0x707e, 0xa02e, 0x2530, 0x611c, 0xa184, 0x0060, 0x0040, 0x1c2a, - 0x1078, 0x43c1, 0x0e7f, 0x6596, 0x65a6, 0x669a, 0x66aa, 0x60af, - 0x0000, 0x60b3, 0x0000, 0x6714, 0x6023, 0x0000, 0x1078, 0x25de, - 0x2091, 0x8001, 0x007c, 0x70c3, 0x4005, 0x0078, 0x15a0, 0x20a9, - 0x0005, 0x2099, 0x4a14, 0x2091, 0x8000, 0x530a, 0x2091, 0x8001, - 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, - 0x007c, 0x71c4, 0x70c7, 0x0000, 0x791e, 0x0078, 0x159d, 0x71c4, - 0x71c6, 0x2168, 0x0078, 0x1c5e, 0x2069, 0x1000, 0x690c, 0xa016, - 0x2d04, 0xa210, 0x8d68, 0x8109, 0x00c0, 0x1c60, 0xa285, 0x0000, - 0x00c0, 0x1c6e, 0x70c3, 0x4000, 0x0078, 0x1c70, 0x70c3, 0x4003, - 0x70ca, 0x0078, 0x15a0, 0x7964, 0x71c6, 0x71c4, 0xa182, 0x0003, - 0x00c8, 0x1595, 0x7966, 0x0078, 0x159d, 0x7964, 0x71c6, 0x0078, - 0x159d, 0x7900, 0x71c6, 0x71c4, 0x7902, 0x0078, 0x159d, 0x7900, - 0x71c6, 0x0078, 0x159d, 0x70c4, 0xd08c, 0x0040, 0x1c94, 0x7a10, - 0xd2ec, 0x00c0, 0x1c94, 0xc08c, 0x2011, 0x0000, 0xa08c, 0x000d, - 0x0040, 0x1ca8, 0x810c, 0x0048, 0x1ca4, 0x8210, 0x810c, 0x810c, - 0x0048, 0x1ca4, 0x8210, 0x810c, 0x81ff, 0x00c0, 0x1596, 0x8210, - 0x7a0e, 0xd28c, 0x0040, 0x1cd4, 0x7910, 0xc1cd, 0x7912, 0x2009, - 0x0021, 0x2019, 0x0003, 0xd284, 0x0040, 0x1cce, 0x8108, 0x2019, - 0x0041, 0x2011, 0x924e, 0x2312, 0x2019, 0x0042, 0x8210, 0x2312, - 0x2019, 0x0043, 0x8210, 0x2312, 0x2019, 0x0046, 0x8210, 0x2312, - 0x2019, 0x0047, 0x8210, 0x2312, 0x2019, 0x0006, 0x2011, 0x9253, - 0x2112, 0x2011, 0x9273, 0x2312, 0x7904, 0x7806, 0x0078, 0x159c, - 0x7804, 0x70c6, 0x0078, 0x159d, 0x2091, 0x8000, 0x2019, 0x0000, - 0x2011, 0x0000, 0x2009, 0x0000, 0x2091, 0x8001, 0x0078, 0x159a, - 0x77c4, 0x1078, 0x1e02, 0x2091, 0x8000, 0x6830, 0xa084, 0xff00, - 0x8007, 0x2010, 0x2091, 0x8001, 0x2708, 0x0078, 0x159b, 0x77c4, - 0x1078, 0x1e02, 0x2091, 0x8000, 0x6a34, 0x2091, 0x8001, 0x2708, - 0x0078, 0x159b, 0x77c4, 0x077e, 0xa7bc, 0xff00, 0x20a9, 0x0008, - 0x72c8, 0x8217, 0x1078, 0x1e02, 0x2091, 0x8000, 0x6c30, 0x6a32, - 0x2091, 0x8001, 0x8738, 0x00f0, 0x1d0a, 0x077f, 0x2708, 0x8427, - 0x2410, 0x0078, 0x159b, 0x77c4, 0x077e, 0xa7bc, 0xff00, 0x20a9, - 0x0008, 0x72c8, 0x1078, 0x1e02, 0x2091, 0x8000, 0x6c34, 0x6a36, - 0x2091, 0x8001, 0x8738, 0x00f0, 0x1d22, 0x077f, 0x2708, 0x2410, - 0x0078, 0x159b, 0x2011, 0x4a3c, 0x220c, 0x70c4, 0x2012, 0x0078, - 0x159c, 0x71c4, 0xd1fc, 0x00c0, 0x1d41, 0x2011, 0x4ec0, 0x0078, - 0x1d43, 0x2011, 0x4f40, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, - 0x8003, 0xa268, 0x6a14, 0xd2b4, 0x0040, 0x1d52, 0x2011, 0x0001, - 0x0078, 0x1d54, 0x2011, 0x0000, 0x6b0c, 0x0078, 0x159a, 0x017e, - 0x7814, 0xd0f4, 0x0040, 0x1d64, 0x2001, 0x4007, 0x70db, 0x0000, - 0xa18d, 0x0001, 0x0078, 0x1d70, 0xd0fc, 0x0040, 0x1d6f, 0x2001, - 0x4007, 0x70db, 0x0001, 0xa18d, 0x0001, 0x0078, 0x1d70, 0xa006, - 0x017f, 0x007c, 0x017e, 0x7814, 0xd0f4, 0x0040, 0x1d7f, 0x2001, - 0x4007, 0x70db, 0x0000, 0xa18d, 0x0001, 0x0078, 0x1d80, 0xa006, - 0x017f, 0x007c, 0x017e, 0x7814, 0xd0fc, 0x0040, 0x1d8f, 0x2001, - 0x4007, 0x70db, 0x0001, 0xa18d, 0x0001, 0x0078, 0x1d90, 0xa006, - 0x017f, 0x007c, 0x7112, 0x721a, 0x731e, 0x7810, 0xd0c4, 0x0040, - 0x1d9b, 0x7422, 0x7526, 0xac80, 0x0001, 0x8108, 0x810c, 0x81a9, - 0x8098, 0x20a1, 0x0030, 0x7003, 0x0000, 0x6084, 0x20a2, 0x53a6, - 0x7007, 0x0001, 0x7974, 0xa184, 0xff00, 0x0040, 0x1db8, 0x810f, - 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0078, 0x1dbb, - 0x8107, 0x8004, 0x8004, 0x797c, 0xa108, 0x7a78, 0xa006, 0xa211, - 0x7d10, 0xd5c4, 0x0040, 0x1dc8, 0x7b84, 0xa319, 0x7c80, 0xa421, - 0x7008, 0xd0fc, 0x0040, 0x1dc8, 0x7003, 0x0001, 0x7007, 0x0006, - 0x711a, 0x721e, 0x7d10, 0xd5c4, 0x0040, 0x1dd8, 0x7322, 0x7426, - 0xa084, 0x01e0, 0x007c, 0x7848, 0xa065, 0x0040, 0x1de3, 0x2c04, - 0x784a, 0x2063, 0x0000, 0x007c, 0x0f7e, 0x2079, 0x4a00, 0x7848, - 0x2062, 0x2c00, 0xa005, 0x00c0, 0x1def, 0x1078, 0x28ec, 0x784a, - 0x0f7f, 0x007c, 0x2011, 0x9400, 0x7a4a, 0x7bc4, 0x8319, 0x0040, - 0x1dff, 0xa280, 0x0032, 0x2012, 0x2010, 0x0078, 0x1df6, 0x2013, - 0x0000, 0x007c, 0x017e, 0x027e, 0xd7fc, 0x00c0, 0x1e0b, 0x2011, - 0x4fc0, 0x0078, 0x1e0d, 0x2011, 0x6fc0, 0xa784, 0x0f00, 0x800b, - 0xa784, 0x001f, 0x0040, 0x1e18, 0x8003, 0x8003, 0x8003, 0x8003, - 0xa105, 0xa268, 0x027f, 0x017f, 0x007c, 0x1078, 0x1e02, 0x2900, - 0x682a, 0x2a00, 0x682e, 0x6808, 0xa084, 0xf9ef, 0xa80d, 0x690a, - 0xd7fc, 0x00c0, 0x1e2f, 0x2009, 0x4a53, 0x0078, 0x1e31, 0x2009, - 0x4a93, 0x210c, 0x6804, 0xa005, 0x0040, 0x1e41, 0xa116, 0x00c0, - 0x1e41, 0x2060, 0x6000, 0x6806, 0x017e, 0x200b, 0x0000, 0x0078, - 0x1e44, 0x2009, 0x0000, 0x017e, 0x6804, 0xa065, 0x0040, 0x1e59, - 0x6000, 0x6806, 0x1078, 0x1e6f, 0x1078, 0x201b, 0x6810, 0x7908, - 0x8109, 0x790a, 0x8001, 0x6812, 0x00c0, 0x1e44, 0x7910, 0xc1a5, - 0x7912, 0x017f, 0x6902, 0x6906, 0x007c, 0xa065, 0x0040, 0x1e6e, - 0x2008, 0x609c, 0xa005, 0x0040, 0x1e6b, 0x2062, 0x609f, 0x0000, - 0xa065, 0x0078, 0x1e61, 0x7848, 0x794a, 0x2062, 0x007c, 0x6007, - 0x0103, 0x608f, 0x0000, 0x20a9, 0x001c, 0xac80, 0x0005, 0x20a0, - 0x2001, 0x0000, 0x40a4, 0x6828, 0x601a, 0x682c, 0x6022, 0x007c, - 0x0e7e, 0xd7fc, 0x00c0, 0x1e8a, 0x2071, 0x4a40, 0x2031, 0x4ac0, - 0x0078, 0x1e8e, 0x2071, 0x4a80, 0x2031, 0x4cc0, 0x7050, 0xa08c, - 0x0200, 0x00c0, 0x1e98, 0xa608, 0x2d0a, 0x8000, 0x7052, 0xa006, - 0x0e7f, 0x007c, 0x0f7e, 0xd7fc, 0x00c0, 0x1ea2, 0x2079, 0x4a40, - 0x0078, 0x1ea4, 0x2079, 0x4a80, 0x1078, 0x1e02, 0x2091, 0x8000, - 0x6804, 0x780a, 0xa065, 0x0040, 0x1ef8, 0x0078, 0x1eb6, 0x2c00, - 0x780a, 0x2060, 0x6000, 0xa065, 0x0040, 0x1ef8, 0x6010, 0xa306, - 0x00c0, 0x1eaf, 0x600c, 0xa206, 0x00c0, 0x1eaf, 0x2c28, 0x784c, - 0xac06, 0x00c0, 0x1ec5, 0x0078, 0x1ef5, 0x6804, 0xac06, 0x00c0, - 0x1ed3, 0x6000, 0x2060, 0x6806, 0xa005, 0x00c0, 0x1ed3, 0x6803, - 0x0000, 0x0078, 0x1edd, 0x6400, 0x7808, 0x2060, 0x6402, 0xa486, - 0x0000, 0x00c0, 0x1edd, 0x2c00, 0x6802, 0x2560, 0x0f7f, 0x1078, - 0x1e6f, 0x0f7e, 0x601b, 0x0005, 0x6023, 0x0020, 0x0f7f, 0x1078, - 0x201b, 0x0f7e, 0x7908, 0x8109, 0x790a, 0x6810, 0x8001, 0x6812, - 0x00c0, 0x1ef5, 0x7810, 0xc0a5, 0x7812, 0x2001, 0xffff, 0xa005, - 0x0f7f, 0x007c, 0x077e, 0x2700, 0x2039, 0x0000, 0xd0fc, 0x0040, - 0x1f02, 0xc7fd, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, - 0x2091, 0x8000, 0x1078, 0x1e1d, 0x8738, 0xa784, 0x001f, 0x00c0, - 0x1f0a, 0xa7bc, 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, - 0x00c0, 0x1f0a, 0x2091, 0x8001, 0x077f, 0x007c, 0x2061, 0x0000, - 0x6018, 0xd084, 0x00c0, 0x1f3e, 0x7810, 0xd08c, 0x0040, 0x1f2f, - 0xc08c, 0x7812, 0xc7fc, 0x2069, 0x4a40, 0x0078, 0x1f34, 0xc08d, - 0x7812, 0x2069, 0x4a80, 0xc7fd, 0x2091, 0x8000, 0x681c, 0x681f, - 0x0000, 0x2091, 0x8001, 0xa005, 0x00c0, 0x1f3f, 0x007c, 0xa08c, - 0xfff0, 0x0040, 0x1f45, 0x1078, 0x28ec, 0x0079, 0x1f47, 0x1f57, - 0x1f5a, 0x1f60, 0x1f64, 0x1f58, 0x1f68, 0x1f58, 0x1f58, 0x1f58, - 0x1f6e, 0x1f9f, 0x1fa3, 0x1fa9, 0x1f58, 0x1f58, 0x1f58, 0x007c, - 0x1078, 0x28ec, 0x1078, 0x1efa, 0x2001, 0x8001, 0x0078, 0x1fbe, - 0x2001, 0x8003, 0x0078, 0x1fbe, 0x2001, 0x8004, 0x0078, 0x1fbe, - 0x1078, 0x1efa, 0x2001, 0x8006, 0x0078, 0x1fbe, 0x2091, 0x8000, - 0x077e, 0xd7fc, 0x00c0, 0x1f7a, 0x2069, 0x4a40, 0x2039, 0x0009, - 0x0078, 0x1f7e, 0x2069, 0x4a80, 0x2039, 0x0009, 0x6800, 0xa086, - 0x0000, 0x0040, 0x1f88, 0x007f, 0x6f1e, 0x2091, 0x8001, 0x007c, - 0x6874, 0x077f, 0xa0bc, 0xff00, 0x2041, 0x0021, 0x2049, 0x0004, - 0x2051, 0x0010, 0x1078, 0x1e1d, 0x8738, 0xa784, 0x001f, 0x00c0, - 0x1f92, 0x2091, 0x8001, 0x2001, 0x800a, 0x0078, 0x1fbe, 0x2001, - 0x800c, 0x0078, 0x1fbe, 0x1078, 0x1efa, 0x2001, 0x800d, 0x0078, - 0x1fbe, 0x7814, 0xd0e4, 0x00c0, 0x1fbc, 0xd0ec, 0x0040, 0x1fb6, - 0xd7fc, 0x0040, 0x1fb6, 0x78ec, 0x0078, 0x1fb7, 0x78e4, 0x70c6, - 0x2001, 0x800e, 0x0078, 0x1fbe, 0x0078, 0x1f58, 0x70c2, 0xd7fc, - 0x00c0, 0x1fc6, 0x70db, 0x0000, 0x0078, 0x1fc8, 0x70db, 0x0001, - 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x4080, 0x007c, 0xac80, - 0x0001, 0x81ff, 0x0040, 0x1ffa, 0x2099, 0x0030, 0x20a0, 0x700c, - 0xa084, 0x03ff, 0x0040, 0x1fdc, 0x7018, 0x007e, 0x701c, 0x007e, - 0x7020, 0x007e, 0x7024, 0x007e, 0x7112, 0x81ac, 0x721a, 0x731e, - 0x7422, 0x7526, 0x7003, 0x0001, 0x7007, 0x0001, 0x7008, 0x800b, - 0x00c8, 0x1fee, 0x7007, 0x0002, 0xa08c, 0x01e0, 0x00c0, 0x1ffa, - 0x53a5, 0xa006, 0x7003, 0x0000, 0x7007, 0x0004, 0x007f, 0x7026, - 0x007f, 0x7022, 0x007f, 0x701e, 0x007f, 0x701a, 0x007c, 0x2011, - 0x0020, 0x2009, 0x0010, 0x6b0a, 0x6c0e, 0x6803, 0xfd00, 0x6807, - 0x0018, 0x6a1a, 0x2d00, 0xa0e8, 0x0008, 0xa290, 0x0004, 0x8109, - 0x00c0, 0x200b, 0x007c, 0x6004, 0x6086, 0x2c08, 0x2063, 0x0000, - 0x7868, 0xa005, 0x796a, 0x0040, 0x2028, 0x2c02, 0x0078, 0x2029, - 0x796e, 0x007c, 0x0c7e, 0x2061, 0x4a00, 0x6887, 0x0103, 0x2d08, - 0x206b, 0x0000, 0x6068, 0xa005, 0x616a, 0x0040, 0x203a, 0x2d02, - 0x0078, 0x203b, 0x616e, 0x0c7f, 0x007c, 0x2091, 0x8000, 0x2c04, - 0x786e, 0xa005, 0x00c0, 0x2045, 0x786a, 0x2091, 0x8001, 0x609c, - 0xa005, 0x0040, 0x205e, 0x0c7e, 0x2060, 0x2008, 0x609c, 0xa005, - 0x0040, 0x205a, 0x2062, 0x609f, 0x0000, 0xa065, 0x609c, 0xa005, - 0x00c0, 0x2052, 0x7848, 0x794a, 0x2062, 0x0c7f, 0x7848, 0x2062, - 0x609f, 0x0000, 0xac85, 0x0000, 0x00c0, 0x2068, 0x1078, 0x28ec, - 0x784a, 0x007c, 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086, 0x818e, - 0x00c8, 0x2073, 0xa200, 0x00f0, 0x206e, 0x8086, 0x818e, 0x007c, - 0x157e, 0x20a9, 0x0010, 0xa005, 0x0040, 0x2099, 0xa11a, 0x00c8, - 0x2099, 0x8213, 0x818d, 0x0048, 0x208c, 0xa11a, 0x00c8, 0x208d, - 0x00f0, 0x2081, 0x0078, 0x2091, 0xa11a, 0x2308, 0x8210, 0x00f0, - 0x2081, 0x007e, 0x3200, 0xa084, 0xf7ff, 0x2080, 0x007f, 0x157f, - 0x007c, 0x007e, 0x3200, 0xa085, 0x0800, 0x0078, 0x2095, 0x7d74, - 0x70d0, 0xa506, 0x0040, 0x2185, 0x7810, 0x2050, 0x7800, 0xd08c, - 0x0040, 0x20c1, 0xdaec, 0x0040, 0x20c1, 0x0e7e, 0x2091, 0x8000, - 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0, 0x20be, 0x7008, 0x0e7f, - 0xa086, 0x0008, 0x0040, 0x20c1, 0x0078, 0x2185, 0x0e7f, 0x0078, - 0x2185, 0x1078, 0x1ddb, 0x0040, 0x2185, 0xa046, 0x7970, 0x2500, - 0x8000, 0xa112, 0x2009, 0x0040, 0x00c8, 0x20d0, 0x0078, 0x20d7, - 0x72d0, 0xa206, 0x0040, 0x20d7, 0x8840, 0x2009, 0x0080, 0x0c7e, - 0x7112, 0x7007, 0x0001, 0x2099, 0x0030, 0x20a9, 0x0020, 0xac80, - 0x0001, 0x20a0, 0x2061, 0x0000, 0x88ff, 0x0040, 0x20e9, 0x1078, - 0x1ddb, 0x7008, 0xd0fc, 0x0040, 0x20e9, 0x7007, 0x0002, 0x2091, - 0x8001, 0xa08c, 0x01e0, 0x00c0, 0x2120, 0x53a5, 0x8cff, 0x00c0, - 0x20fe, 0x88ff, 0x0040, 0x216f, 0x0078, 0x2108, 0x2c00, 0x788e, - 0x20a9, 0x0020, 0xac80, 0x0001, 0x20a0, 0x53a5, 0x0078, 0x216f, - 0xa046, 0x7218, 0x731c, 0xdac4, 0x0040, 0x2110, 0x7420, 0x7524, - 0xa292, 0x0040, 0xa39b, 0x0000, 0xa4a3, 0x0000, 0xa5ab, 0x0000, - 0x721a, 0x731e, 0xdac4, 0x0040, 0x2120, 0x7422, 0x7526, 0xa006, - 0x7007, 0x0004, 0x0040, 0x216f, 0x8cff, 0x0040, 0x2129, 0x1078, - 0x1de4, 0x0c7f, 0x1078, 0x1de4, 0xa046, 0x7888, 0x8000, 0x788a, - 0xa086, 0x0002, 0x0040, 0x214f, 0x7a7c, 0x7b78, 0xdac4, 0x0040, - 0x213b, 0x7c84, 0x7d80, 0x7974, 0x8107, 0x8004, 0x8004, 0xa210, - 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x721a, 0x731e, - 0xdac4, 0x0040, 0x2185, 0x7422, 0x7526, 0x0078, 0x2185, 0x6014, - 0xd0fc, 0x00c0, 0x2157, 0x2069, 0x4a40, 0x0078, 0x2159, 0x2069, - 0x4a80, 0x2091, 0x8000, 0x681f, 0x0002, 0x88ff, 0x0040, 0x2165, - 0xa046, 0x788c, 0x2060, 0x0078, 0x214f, 0x788b, 0x0000, 0x78ac, - 0xa085, 0x0003, 0x78ae, 0x2091, 0x8001, 0x0078, 0x2185, 0x0c7f, - 0x788b, 0x0000, 0x1078, 0x2319, 0x6004, 0xa084, 0x000f, 0x1078, - 0x2186, 0x88ff, 0x0040, 0x2183, 0x788c, 0x2060, 0x6004, 0xa084, - 0x000f, 0x1078, 0x2186, 0x0078, 0x209f, 0x007c, 0x0079, 0x2188, - 0x2198, 0x21b6, 0x21d4, 0x2198, 0x21e5, 0x21a9, 0x2198, 0x2198, - 0x2198, 0x21b4, 0x21d2, 0x2198, 0x2198, 0x2198, 0x2198, 0x2198, - 0x2039, 0x0400, 0x78bc, 0xa705, 0x78be, 0x6008, 0xa705, 0x600a, - 0x1078, 0x2228, 0x609c, 0x78ba, 0x609f, 0x0000, 0x1078, 0x2303, - 0x007c, 0x78bc, 0xd0c4, 0x0040, 0x21af, 0x0078, 0x2198, 0x601c, - 0xc0bd, 0x601e, 0x0078, 0x21bc, 0x1078, 0x234b, 0x78bc, 0xd0c4, - 0x0040, 0x21bc, 0x0078, 0x2198, 0x78bf, 0x0000, 0x6004, 0x8007, - 0xa084, 0x00ff, 0x78b2, 0x8001, 0x0040, 0x21cf, 0x1078, 0x2228, - 0x0040, 0x21cf, 0x78bc, 0xc0c5, 0x78be, 0x0078, 0x21d1, 0x0078, - 0x2247, 0x007c, 0x1078, 0x2347, 0x78bc, 0xa08c, 0x0e00, 0x00c0, - 0x21dc, 0xd0c4, 0x00c0, 0x21de, 0x0078, 0x2198, 0x1078, 0x2228, - 0x00c0, 0x21e4, 0x0078, 0x2247, 0x007c, 0x78bc, 0xd0c4, 0x0040, - 0x21eb, 0x0078, 0x2198, 0x78bf, 0x0000, 0x6714, 0x2011, 0x0001, - 0x22a8, 0x6018, 0xa084, 0x00ff, 0xa005, 0x0040, 0x220b, 0xa7bc, - 0xff00, 0x20a9, 0x0020, 0xa08e, 0x0001, 0x0040, 0x220b, 0xa7bc, - 0x8000, 0x2011, 0x0002, 0x20a9, 0x0100, 0xa08e, 0x0002, 0x0040, - 0x220b, 0x0078, 0x2225, 0x1078, 0x1e02, 0x2d00, 0x2091, 0x8000, - 0x682b, 0x0000, 0x682f, 0x0000, 0x6808, 0xa084, 0xffde, 0x680a, - 0xade8, 0x0010, 0x2091, 0x8001, 0x00f0, 0x220e, 0x8211, 0x0040, - 0x2225, 0x20a9, 0x0100, 0x0078, 0x220e, 0x1078, 0x1de4, 0x007c, - 0x609f, 0x0000, 0x78b4, 0xa06d, 0x2c00, 0x78b6, 0x00c0, 0x2233, - 0x78ba, 0x0078, 0x223b, 0x689e, 0x2d00, 0x6002, 0x78b8, 0xad06, - 0x00c0, 0x223b, 0x6002, 0x78b0, 0x8001, 0x78b2, 0x00c0, 0x2246, - 0x78bc, 0xc0c4, 0x78be, 0x78b8, 0x2060, 0xa006, 0x007c, 0x0e7e, - 0xa02e, 0x2530, 0x7dba, 0x7db6, 0x65ae, 0x65b2, 0x601c, 0x60a2, - 0x2048, 0xa984, 0xe1ff, 0x601e, 0xa984, 0x0060, 0x0040, 0x225a, - 0x1078, 0x43c1, 0x6596, 0x65a6, 0x669a, 0x66aa, 0x6714, 0x2071, - 0x4a80, 0xd7fc, 0x00c0, 0x2266, 0x2071, 0x4a40, 0xa784, 0x0f00, - 0x800b, 0xa784, 0x001f, 0x0040, 0x2271, 0x8003, 0x8003, 0x8003, - 0x8003, 0xa105, 0x71c4, 0xa168, 0x2700, 0x8007, 0xa084, 0x000f, - 0x8003, 0x8003, 0x8003, 0x71c8, 0xa100, 0x60c2, 0x2091, 0x8000, - 0x7810, 0xd0f4, 0x00c0, 0x228b, 0x6e08, 0xd684, 0x0040, 0x22a1, - 0xd9fc, 0x00c0, 0x22a1, 0x2091, 0x8001, 0x1078, 0x1e6f, 0x2091, - 0x8000, 0x1078, 0x201b, 0x2091, 0x8001, 0x7814, 0xd0e4, 0x00c0, - 0x2301, 0x7810, 0xd0f4, 0x0040, 0x2301, 0x601b, 0x0021, 0x0078, - 0x2301, 0x6024, 0xa096, 0x0001, 0x00c0, 0x22a8, 0x8000, 0x6026, - 0x6a10, 0x6814, 0xa202, 0x0048, 0x22bb, 0x0040, 0x22bb, 0x2091, - 0x8001, 0x2039, 0x0200, 0x609c, 0x78ba, 0x609f, 0x0000, 0x1078, - 0x2303, 0x0078, 0x2301, 0x2c08, 0xd9fc, 0x0040, 0x22de, 0x6800, - 0xa065, 0x0040, 0x22de, 0x6a04, 0x7000, 0xa084, 0x0002, 0x0040, - 0x22d9, 0x704c, 0xa206, 0x00c0, 0x22d9, 0x6b04, 0x2160, 0x2304, - 0x6002, 0xa005, 0x00c0, 0x22d5, 0x6902, 0x2260, 0x6102, 0x0078, - 0x22ea, 0x2160, 0x6202, 0x6906, 0x0078, 0x22ea, 0x6800, 0x6902, - 0xa065, 0x0040, 0x22e6, 0x6102, 0x0078, 0x22e7, 0x6906, 0x2160, - 0x6003, 0x0000, 0x2160, 0xd9fc, 0x0040, 0x22f1, 0xa6b4, 0xfffc, - 0x6e0a, 0x6810, 0x7d08, 0x8528, 0x7d0a, 0x8000, 0x6812, 0x2091, - 0x8001, 0xd6b4, 0x0040, 0x2301, 0xa6b6, 0x0040, 0x6e0a, 0x1078, - 0x1e80, 0x0e7f, 0x007c, 0x6008, 0xa705, 0x600a, 0x2091, 0x8000, - 0x1078, 0x201b, 0x2091, 0x8001, 0x78b8, 0xa065, 0x0040, 0x2316, - 0x609c, 0x78ba, 0x609f, 0x0000, 0x0078, 0x2303, 0x78b6, 0x78ba, - 0x007c, 0x7970, 0x7874, 0x2818, 0xd384, 0x0040, 0x2323, 0x8000, - 0xa112, 0x0048, 0x2328, 0x8000, 0xa112, 0x00c8, 0x2338, 0xc384, - 0x7a7c, 0x721a, 0x7a78, 0x721e, 0xdac4, 0x0040, 0x2333, 0x7a84, - 0x7222, 0x7a80, 0x7226, 0xa006, 0xd384, 0x0040, 0x2338, 0x8000, - 0x7876, 0x70d2, 0x781c, 0xa005, 0x0040, 0x2346, 0x8001, 0x781e, - 0x00c0, 0x2346, 0x0068, 0x2346, 0x2091, 0x4080, 0x007c, 0x2039, - 0x235f, 0x0078, 0x234d, 0x2039, 0x2365, 0x2704, 0xa005, 0x0040, - 0x235e, 0xac00, 0x2068, 0x6908, 0x6810, 0x6912, 0x680a, 0x690c, - 0x6814, 0x6916, 0x680e, 0x8738, 0x0078, 0x234d, 0x007c, 0x0003, - 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0015, 0x001b, 0x0000, - 0x2041, 0x0000, 0x780c, 0x0079, 0x236d, 0x2535, 0x2508, 0x2371, - 0x23e5, 0x2039, 0x9274, 0x2734, 0x7d10, 0x0078, 0x238c, 0x6084, - 0xa086, 0x0103, 0x00c0, 0x23ce, 0x6114, 0x6018, 0xa105, 0x00c0, - 0x23ce, 0x8603, 0xa080, 0x9255, 0x620c, 0x2202, 0x8000, 0x6210, - 0x2202, 0x1078, 0x203d, 0x8630, 0xa68e, 0x000f, 0x0040, 0x2454, - 0x786c, 0xa065, 0x00c0, 0x2377, 0x7808, 0xa602, 0x00c8, 0x239d, - 0xd5ac, 0x00c0, 0x239d, 0x263a, 0x007c, 0xa682, 0x0003, 0x00c8, - 0x2454, 0x2091, 0x8000, 0x2069, 0x0000, 0x6818, 0xd084, 0x00c0, - 0x23c9, 0x2011, 0x9255, 0x2204, 0x70c6, 0x8210, 0x2204, 0x70ca, - 0xd684, 0x00c0, 0x23b9, 0x8210, 0x2204, 0x70da, 0x8210, 0x2204, - 0x70de, 0xa685, 0x8020, 0x70c2, 0x681b, 0x0001, 0x2091, 0x4080, - 0x7810, 0xa084, 0xffcf, 0x7812, 0x2091, 0x8001, 0x203b, 0x0000, - 0x007c, 0x7810, 0xc0ad, 0x7812, 0x0078, 0x2454, 0x263a, 0x1078, - 0x253f, 0x00c0, 0x254e, 0x786c, 0xa065, 0x00c0, 0x2377, 0x2091, - 0x8000, 0x7810, 0xa084, 0xffcf, 0x86ff, 0x0040, 0x23e0, 0xc0ad, - 0x7812, 0x2091, 0x8001, 0x0078, 0x254e, 0x2039, 0x9274, 0x2734, - 0x7d10, 0x0078, 0x23fc, 0x6084, 0xa086, 0x0103, 0x00c0, 0x243d, - 0x6114, 0x6018, 0xa105, 0x00c0, 0x243d, 0xa680, 0x9255, 0x620c, - 0x2202, 0x1078, 0x203d, 0x8630, 0xa68e, 0x001e, 0x0040, 0x2454, - 0x786c, 0xa065, 0x00c0, 0x23eb, 0x7808, 0xa602, 0x00c8, 0x240d, - 0xd5ac, 0x00c0, 0x240d, 0x263a, 0x007c, 0xa682, 0x0006, 0x00c8, - 0x2454, 0x2091, 0x8000, 0x2069, 0x0000, 0x6818, 0xd084, 0x00c0, - 0x2438, 0x2011, 0x9255, 0x2009, 0x924e, 0x26a8, 0x211c, 0x2204, - 0x201a, 0x8108, 0x8210, 0x00f0, 0x241e, 0xa685, 0x8030, 0x70c2, + 0xa1a2, 0x4d00, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, + 0xa192, 0x9700, 0x2009, 0x0000, 0x2001, 0x0032, 0x1078, 0x2061, + 0x2218, 0x2079, 0x4d00, 0x2fa0, 0x2408, 0x2011, 0x0000, 0x20a9, + 0x0040, 0x42a4, 0x8109, 0x00c0, 0x10bf, 0x2009, 0xff00, 0x3400, + 0xa102, 0x0048, 0x10cf, 0x0040, 0x10cf, 0x20a8, 0x42a4, 0x2001, + 0x04fc, 0x2004, 0xa086, 0x1080, 0x00c0, 0x10e5, 0x2071, 0x0100, + 0x0d7e, 0x2069, 0x4d40, 0x1078, 0x4c38, 0x0d7f, 0x7810, 0xc0ed, + 0x7812, 0x781b, 0x0064, 0x0078, 0x110a, 0x2001, 0x04fc, 0x2004, + 0xa086, 0x1280, 0x00c0, 0x1105, 0x7814, 0xc0ed, 0xc0d5, 0x7816, + 0x781b, 0x0064, 0x2071, 0x0200, 0x0d7e, 0x2069, 0x4d40, 0x1078, + 0x4c38, 0x2069, 0x4d80, 0x2071, 0x0100, 0x1078, 0x4c38, 0x7814, + 0xc0d4, 0x7816, 0x0d7f, 0x0078, 0x110a, 0x7814, 0xc0e5, 0x7816, + 0x781b, 0x003c, 0x7eca, 0x7cc2, 0x7bc6, 0x7867, 0x0000, 0x7800, + 0xc08d, 0x7802, 0x2031, 0x0030, 0x78af, 0x0101, 0x7823, 0x0002, + 0x7827, 0x0002, 0x2009, 0x0002, 0x2069, 0x4d40, 0x681b, 0x0003, + 0x6823, 0x0007, 0x6827, 0x00fa, 0x682b, 0x0008, 0x682f, 0x0028, + 0x6837, 0x0000, 0x683b, 0x0006, 0x6833, 0x0008, 0x683f, 0x0000, + 0x8109, 0x0040, 0x115e, 0x68d3, 0x000a, 0x68c3, 0x4dc0, 0x2079, + 0x4d00, 0x7814, 0xd0e4, 0x00c0, 0x1144, 0xd0ec, 0x00c0, 0x1148, + 0x68d7, 0x7329, 0x0078, 0x114a, 0x68d7, 0x730d, 0x0078, 0x114a, + 0x68d7, 0x732d, 0x68c7, 0x52c0, 0x68cb, 0x51c0, 0x68cf, 0x92c0, + 0x68ab, 0x9544, 0x68af, 0x9549, 0x68b3, 0x9544, 0x68b7, 0x9544, + 0x68a7, 0x0001, 0x2069, 0x4d80, 0x0078, 0x111e, 0x68d3, 0x000a, + 0x68c3, 0x4fc0, 0x7814, 0xd0e4, 0x00c0, 0x116a, 0x68d7, 0x7439, + 0x0078, 0x116c, 0x68d7, 0x7419, 0x68c7, 0x72c0, 0x68cb, 0x5240, + 0x68cf, 0x93d0, 0x68ab, 0x9549, 0x68af, 0x954e, 0x68b3, 0x9549, + 0x68b7, 0x9549, 0x68a7, 0x0001, 0x7810, 0xd0ec, 0x00c0, 0x11c2, + 0x7814, 0xd0e4, 0x00c0, 0x11b4, 0x0e7e, 0x2069, 0x51c0, 0x2071, + 0x0200, 0x70ec, 0xd0e4, 0x00c0, 0x1195, 0x2019, 0x0c0c, 0x2021, + 0x000c, 0x1078, 0x1ff0, 0x0078, 0x119b, 0x2019, 0x0c0a, 0x2021, + 0x000a, 0x1078, 0x1ff0, 0x2069, 0x5240, 0x2071, 0x0100, 0x70ec, + 0xd0e4, 0x00c0, 0x11ab, 0x2019, 0x0c0c, 0x2021, 0x000c, 0x1078, + 0x1ff0, 0x0078, 0x11b1, 0x2019, 0x0c0a, 0x2021, 0x000a, 0x1078, + 0x1ff0, 0x0e7f, 0x0078, 0x11db, 0x2019, 0x0c0c, 0x2021, 0x000c, + 0x2069, 0x51c0, 0x1078, 0x1ff0, 0x2069, 0x5240, 0x1078, 0x1ff0, + 0x0078, 0x11db, 0x2069, 0x51c0, 0x0e7e, 0x2071, 0x0100, 0x70ec, + 0xd0e4, 0x00c0, 0x11d4, 0x2019, 0x0c0c, 0x2021, 0x000c, 0x1078, + 0x1ff0, 0x0e7f, 0x0078, 0x11db, 0x2019, 0x0c0a, 0x2021, 0x000a, + 0x1078, 0x1ff0, 0x0e7f, 0x2011, 0x0002, 0x2069, 0x52c0, 0x2009, + 0x0002, 0x20a9, 0x0100, 0x6837, 0x0000, 0x680b, 0x0040, 0x7bc8, + 0xa386, 0xfeff, 0x00c0, 0x11f2, 0x6817, 0x0100, 0x681f, 0x0064, + 0x0078, 0x11f6, 0x6817, 0x0064, 0x681f, 0x0002, 0xade8, 0x0010, + 0x00f0, 0x11e3, 0x8109, 0x00c0, 0x11e1, 0x8211, 0x0040, 0x1204, + 0x2069, 0x72c0, 0x0078, 0x11df, 0x1078, 0x261d, 0x1078, 0x4603, + 0x1078, 0x1dbb, 0x1078, 0x4be1, 0x2091, 0x2100, 0x2079, 0x4d00, + 0x7810, 0xd0ec, 0x0040, 0x1218, 0x2071, 0x0020, 0x0078, 0x121a, + 0x2071, 0x0050, 0x2091, 0x2200, 0x2079, 0x4d00, 0x2071, 0x0020, + 0x2091, 0x2300, 0x2079, 0x4d00, 0x7810, 0xd0ec, 0x0040, 0x122c, + 0x2079, 0x0100, 0x0078, 0x122e, 0x2079, 0x0200, 0x2071, 0x4d40, + 0x2091, 0x2400, 0x2079, 0x0100, 0x2071, 0x4d80, 0x2091, 0x2000, + 0x2079, 0x4d00, 0x2071, 0x0010, 0x3200, 0xa085, 0x303d, 0x2090, + 0x2071, 0x0010, 0x70c3, 0x0000, 0x0090, 0x124d, 0x70c0, 0xa086, + 0x0002, 0x00c0, 0x124d, 0x1078, 0x15ba, 0x2039, 0x0000, 0x7810, + 0xd0ec, 0x00c0, 0x12cf, 0x1078, 0x148e, 0x78ac, 0xa005, 0x00c0, + 0x126b, 0x0068, 0x1261, 0x786c, 0xa065, 0x0040, 0x1261, 0x1078, + 0x2356, 0x1078, 0x2088, 0x0068, 0x1278, 0x786c, 0xa065, 0x0040, + 0x126b, 0x1078, 0x2356, 0x0068, 0x1278, 0x2009, 0x4d47, 0x2011, + 0x4d87, 0x2104, 0x220c, 0xa105, 0x0040, 0x1278, 0x1078, 0x1ef1, + 0x2071, 0x4d40, 0x70a4, 0xa005, 0x0040, 0x129d, 0x7450, 0xa485, + 0x0000, 0x0040, 0x129d, 0x2079, 0x0200, 0x2091, 0x8000, 0x72d4, + 0xa28c, 0x303d, 0x2190, 0x1078, 0x2b0b, 0x2091, 0x8000, 0x2091, + 0x303d, 0x0068, 0x129d, 0x2079, 0x4d00, 0x786c, 0xa065, 0x0040, + 0x129d, 0x2071, 0x0010, 0x1078, 0x2356, 0x00e0, 0x12a5, 0x2079, + 0x4d00, 0x2071, 0x0010, 0x1078, 0x49ba, 0x2071, 0x4d80, 0x70a4, + 0xa005, 0x0040, 0x12bd, 0x7050, 0xa025, 0x0040, 0x12bd, 0x2079, + 0x0100, 0x2091, 0x8000, 0x72d4, 0xa28c, 0x303d, 0x2190, 0x1078, + 0x2b0b, 0x2091, 0x8000, 0x2091, 0x303d, 0x2079, 0x4d00, 0x2071, + 0x0010, 0x0068, 0x12c9, 0x786c, 0xa065, 0x0040, 0x12c9, 0x1078, + 0x2356, 0x00e0, 0x1253, 0x1078, 0x49ba, 0x0078, 0x1253, 0x1078, + 0x148e, 0x78ac, 0xa005, 0x00c0, 0x12e7, 0x0068, 0x12dd, 0x786c, + 0xa065, 0x0040, 0x12dd, 0x1078, 0x2356, 0x1078, 0x2088, 0x0068, + 0x12f1, 0x786c, 0xa065, 0x0040, 0x12e7, 0x1078, 0x2356, 0x0068, + 0x12f1, 0x2009, 0x4d47, 0x2104, 0xa005, 0x0040, 0x12f1, 0x1078, + 0x1ef1, 0x2071, 0x4d40, 0x70a4, 0xa005, 0x0040, 0x130c, 0x7450, + 0xa485, 0x0000, 0x0040, 0x130c, 0x2079, 0x0100, 0x2091, 0x8000, + 0x72d4, 0xa28c, 0x303d, 0x2190, 0x1078, 0x2b0b, 0x2091, 0x8000, + 0x2091, 0x303d, 0x2079, 0x4d00, 0x2071, 0x0010, 0x0068, 0x1316, + 0x786c, 0xa065, 0x0040, 0x1316, 0x1078, 0x2356, 0x00e0, 0x12cf, + 0x1078, 0x49ba, 0x0078, 0x12cf, 0x133c, 0x133c, 0x133e, 0x133e, + 0x134b, 0x134b, 0x134b, 0x134b, 0x1356, 0x1356, 0x1363, 0x1363, + 0x134b, 0x134b, 0x134b, 0x134b, 0x133c, 0x133c, 0x133e, 0x133e, + 0x134b, 0x134b, 0x134b, 0x134b, 0x1356, 0x1356, 0x1363, 0x1363, + 0x134b, 0x134b, 0x134b, 0x134b, 0x0078, 0x133c, 0x007e, 0x107e, + 0x127e, 0x2091, 0x2400, 0x1078, 0x292b, 0x127f, 0x107f, 0x007f, + 0x2091, 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x1078, 0x13c8, + 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, 0x007e, 0x107e, + 0x127e, 0x2091, 0x2300, 0x1078, 0x292b, 0x127f, 0x107f, 0x007f, + 0x2091, 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x2091, 0x2300, + 0x1078, 0x292b, 0x2091, 0x2400, 0x1078, 0x292b, 0x127f, 0x107f, + 0x007f, 0x2091, 0x8001, 0x007c, 0x1394, 0x1394, 0x1396, 0x1396, + 0x13a3, 0x13a3, 0x13a3, 0x13a3, 0x13ae, 0x13ae, 0x1396, 0x1396, + 0x13a3, 0x13a3, 0x13a3, 0x13a3, 0x13af, 0x13af, 0x13af, 0x13af, + 0x13af, 0x13af, 0x13af, 0x13af, 0x13af, 0x13af, 0x13af, 0x13af, + 0x13af, 0x13af, 0x13af, 0x13af, 0x0078, 0x1394, 0x007e, 0x107e, + 0x127e, 0x2091, 0x2300, 0x1078, 0x292b, 0x127f, 0x107f, 0x007f, + 0x2091, 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x1078, 0x13d5, + 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, 0x007c, 0x107e, + 0x127e, 0x0d7e, 0x0e7e, 0x0f7e, 0x007e, 0x2071, 0x0100, 0x2069, + 0x4d40, 0x2079, 0x4d00, 0x70ec, 0xa084, 0x1c00, 0x78e2, 0x1078, + 0x4c38, 0x007f, 0x0f7f, 0x0e7f, 0x0d7f, 0x127f, 0x107f, 0x007c, + 0x3c00, 0xa084, 0x0007, 0x0079, 0x13cd, 0x13de, 0x13de, 0x13e0, + 0x13e0, 0x13e5, 0x13e5, 0x13ea, 0x13ea, 0x3c00, 0xa084, 0x0003, + 0x0079, 0x13da, 0x13de, 0x13de, 0x13f3, 0x13f3, 0x1078, 0x290c, + 0x2091, 0x2200, 0x1078, 0x46dd, 0x007c, 0x2091, 0x2100, 0x1078, + 0x46dd, 0x007c, 0x2091, 0x2100, 0x1078, 0x46dd, 0x2091, 0x2200, + 0x1078, 0x46dd, 0x007c, 0x2091, 0x2100, 0x1078, 0x46dd, 0x007c, + 0x1418, 0x1418, 0x141a, 0x141a, 0x1427, 0x1427, 0x1427, 0x1427, + 0x1432, 0x1432, 0x143f, 0x143f, 0x1427, 0x1427, 0x1427, 0x1427, + 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, + 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, + 0x0078, 0x1418, 0x007e, 0x107e, 0x127e, 0x2091, 0x2400, 0x1078, + 0x292b, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, 0x007e, + 0x107e, 0x127e, 0x1078, 0x13c8, 0x127f, 0x107f, 0x007f, 0x2091, + 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x2091, 0x2300, 0x1078, + 0x292b, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, 0x007e, + 0x107e, 0x127e, 0x2091, 0x2300, 0x1078, 0x292b, 0x2091, 0x2400, + 0x1078, 0x292b, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, + 0x007e, 0x107e, 0x127e, 0x0d7e, 0x0e7e, 0x0f7e, 0x2079, 0x4d00, + 0x2071, 0x0200, 0x2069, 0x4d40, 0x3d00, 0xd08c, 0x0040, 0x1466, + 0x70ec, 0xa084, 0x1c00, 0x78e2, 0x1078, 0x4c38, 0x3d00, 0xd084, + 0x0040, 0x1474, 0x2069, 0x4d80, 0x2071, 0x0100, 0x70ec, 0xa084, + 0x1c00, 0x78e6, 0x1078, 0x4c38, 0x0f7f, 0x0e7f, 0x0d7f, 0x127f, + 0x107f, 0x007f, 0x007c, 0x7008, 0x800b, 0x00c8, 0x1489, 0x7007, + 0x0002, 0xa08c, 0x01e0, 0x00c0, 0x148a, 0xd09c, 0x0040, 0x1489, + 0x087a, 0x097a, 0x70c3, 0x4002, 0x0078, 0x15bd, 0x0068, 0x1513, + 0x2061, 0x0000, 0x6018, 0xd084, 0x00c0, 0x1513, 0x7828, 0xa005, + 0x00c0, 0x149e, 0x0010, 0x1514, 0x0078, 0x1513, 0x7910, 0xd1f4, + 0x0040, 0x14a6, 0x2001, 0x4007, 0x0078, 0x15bc, 0x7914, 0xd1ec, + 0x0040, 0x14c1, 0xd0fc, 0x0040, 0x14b7, 0x007e, 0x1078, 0x1d4b, + 0x007f, 0x0040, 0x14c1, 0x2001, 0x4007, 0x0078, 0x15bc, 0x007e, + 0x1078, 0x1d3b, 0x007f, 0x0040, 0x14c1, 0x2001, 0x4007, 0x0078, + 0x15bc, 0x7910, 0xd0fc, 0x00c0, 0x14cb, 0x2061, 0x4d40, 0xc19c, + 0xc7fc, 0x0078, 0x14cf, 0x2061, 0x4d80, 0xc19d, 0xc7fd, 0x6064, + 0xa005, 0x00c0, 0x1513, 0x7912, 0x6083, 0x0000, 0x7828, 0xc0fc, + 0xa086, 0x0018, 0x00c0, 0x14e0, 0x0c7e, 0x1078, 0x1b44, 0x0c7f, + 0x782b, 0x0000, 0x607c, 0xa065, 0x0040, 0x14f9, 0x0c7e, 0x609c, + 0x1078, 0x1e30, 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1c6d, 0x2009, + 0x0018, 0x6087, 0x0103, 0x1078, 0x1d5b, 0x00c0, 0x150d, 0x1078, + 0x1dad, 0x7810, 0xd09c, 0x00c0, 0x1501, 0x2061, 0x4d40, 0x0078, + 0x1505, 0x2061, 0x4d80, 0xc09c, 0x7812, 0x607f, 0x0000, 0x60d4, + 0xd0dc, 0x0040, 0x1511, 0xc0dc, 0x60d6, 0x2001, 0x4005, 0x0078, + 0x15bc, 0x0078, 0x15ba, 0x007c, 0x7810, 0xd0f4, 0x0040, 0x151c, + 0x2001, 0x4007, 0x0078, 0x15bc, 0xa006, 0x70c2, 0x70c6, 0x70ca, + 0x70ce, 0x70da, 0x70c0, 0xa03d, 0xa08a, 0x0040, 0x00c8, 0x152a, + 0x0079, 0x1531, 0x2100, 0xa08a, 0x0040, 0x00c8, 0x15c8, 0x0079, + 0x1571, 0x15ba, 0x1610, 0x15d9, 0x1648, 0x1680, 0x1680, 0x15d0, + 0x1c85, 0x168b, 0x15c8, 0x15dd, 0x15df, 0x15e1, 0x15e3, 0x1c8a, + 0x15c8, 0x1699, 0x16f6, 0x1b64, 0x1c7f, 0x15e5, 0x19d4, 0x1a16, + 0x1a4e, 0x1a9c, 0x198f, 0x199c, 0x19b0, 0x19c3, 0x17cb, 0x15c8, + 0x172d, 0x173a, 0x1746, 0x1752, 0x1768, 0x1774, 0x1777, 0x1783, + 0x178f, 0x1797, 0x17b3, 0x17bf, 0x15c8, 0x15c8, 0x15c8, 0x15c8, + 0x17d8, 0x17ea, 0x1806, 0x183c, 0x1864, 0x1874, 0x1877, 0x18a8, + 0x18d9, 0x18eb, 0x195e, 0x196e, 0x15c8, 0x15c8, 0x15c8, 0x15c8, + 0x197e, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x1caf, 0x1cb5, + 0x15c8, 0x15c8, 0x15c8, 0x1cb9, 0x1cfe, 0x15c8, 0x15c8, 0x15c8, + 0x15c8, 0x160a, 0x167a, 0x1693, 0x16f0, 0x1b5e, 0x15c8, 0x15c8, + 0x15c8, 0x15c8, 0x1d02, 0x1ca1, 0x1cab, 0x15c8, 0x15c8, 0x15c8, + 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, + 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, + 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, + 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, + 0x15c8, 0x72ca, 0x71c6, 0x2001, 0x4006, 0x0078, 0x15bc, 0x73ce, + 0x72ca, 0x71c6, 0x2001, 0x4000, 0x70c2, 0x0068, 0x15bd, 0x2061, + 0x0000, 0x601b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x007c, + 0x70c3, 0x4001, 0x0078, 0x15bd, 0x70c3, 0x4006, 0x0078, 0x15bd, + 0x2099, 0x0041, 0x20a1, 0x0041, 0x20a9, 0x0005, 0x53a3, 0x0078, + 0x15ba, 0x70c4, 0x70c3, 0x0004, 0x007a, 0x0078, 0x15ba, 0x0078, + 0x15ba, 0x0078, 0x15ba, 0x0078, 0x15ba, 0x2091, 0x8000, 0x70c3, + 0x0004, 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, + 0x0008, 0x2001, 0x000d, 0x70d6, 0x2079, 0x0000, 0x781b, 0x0001, + 0x2031, 0x0030, 0x2059, 0x1000, 0x2029, 0x041a, 0x2051, 0x0445, + 0x2061, 0x0447, 0x20c1, 0x0020, 0x2091, 0x5000, 0x2091, 0x4080, + 0x0078, 0x0418, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x1613, + 0x2029, 0x0000, 0x2520, 0x71d0, 0x72c8, 0x73cc, 0x70c4, 0x20a0, + 0x2099, 0x0030, 0x7003, 0x0001, 0x7007, 0x0006, 0x731a, 0x721e, + 0x7422, 0x7526, 0x2021, 0x0040, 0x81ff, 0x0040, 0x15ba, 0xa182, + 0x0040, 0x00c8, 0x162d, 0x2120, 0xa006, 0x2008, 0x8403, 0x7012, + 0x7007, 0x0004, 0x7007, 0x0001, 0x7008, 0xd0fc, 0x0040, 0x1634, + 0x7007, 0x0002, 0xa084, 0x01e0, 0x0040, 0x1642, 0x70c3, 0x4002, + 0x0078, 0x15bd, 0x24a8, 0x53a5, 0x0078, 0x1624, 0x0078, 0x15ba, + 0x2029, 0x0000, 0x2520, 0x71d0, 0x72c8, 0x73cc, 0x70c4, 0x2098, + 0x20a1, 0x0030, 0x7003, 0x0000, 0x7007, 0x0006, 0x731a, 0x721e, + 0x7422, 0x7526, 0x2021, 0x0040, 0x7007, 0x0006, 0x81ff, 0x0040, + 0x15ba, 0xa182, 0x0040, 0x00c8, 0x1667, 0x2120, 0xa006, 0x2008, + 0x8403, 0x7012, 0x24a8, 0x53a6, 0x7007, 0x0001, 0x7008, 0xd0fc, + 0x0040, 0x166e, 0xa084, 0x01e0, 0x0040, 0x165c, 0x70c3, 0x4002, + 0x0078, 0x15bd, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x164b, + 0x71c4, 0x70c8, 0x2114, 0xa79e, 0x0004, 0x00c0, 0x1688, 0x200a, + 0x72ca, 0x0078, 0x15b9, 0x70c7, 0x0008, 0x70cb, 0x000d, 0x70cf, + 0x0008, 0x0078, 0x15ba, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078, + 0x169c, 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d0, + 0x70c6, 0x72ca, 0x73ce, 0x74d2, 0xa005, 0x0040, 0x16eb, 0xa40a, + 0x0040, 0x16ac, 0x00c8, 0x15bc, 0x8001, 0x7872, 0xa084, 0xfc00, + 0x0040, 0x16b9, 0x78ac, 0xc085, 0x78ae, 0x2001, 0x4005, 0x0078, + 0x15bc, 0x7b7e, 0x7a7a, 0x7e86, 0x7d82, 0x7c76, 0xa48c, 0xff00, + 0x0040, 0x16d1, 0x8407, 0x8004, 0x8004, 0x810c, 0x810c, 0x810f, + 0xa118, 0xa291, 0x0000, 0xa6b1, 0x0000, 0xa581, 0x0000, 0x0078, + 0x16db, 0x8407, 0x8004, 0x8004, 0xa318, 0xa291, 0x0000, 0xa6b1, + 0x0000, 0xa581, 0x0000, 0x731a, 0x721e, 0x7622, 0x7026, 0xa605, + 0x0040, 0x16e5, 0x7a10, 0xc2c5, 0x7a12, 0x78ac, 0xa084, 0xfffc, + 0x78ae, 0x0078, 0x16ee, 0x78ac, 0xc085, 0x78ae, 0x0078, 0x15ba, + 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078, 0x16f9, 0x2029, 0x0000, + 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d4, 0x70c6, 0x72ca, 0x73ce, + 0x74d6, 0xa005, 0x0040, 0x1728, 0xa40a, 0x0040, 0x1709, 0x00c8, + 0x15bc, 0x8001, 0x7892, 0xa084, 0xfc00, 0x0040, 0x1716, 0x78ac, + 0xc0c5, 0x78ae, 0x2001, 0x4005, 0x0078, 0x15bc, 0x7a9a, 0x7b9e, + 0x7da2, 0x7ea6, 0x2600, 0xa505, 0x0040, 0x1721, 0x7a10, 0xc2c5, + 0x7a12, 0x7c96, 0x78ac, 0xa084, 0xfcff, 0x78ae, 0x0078, 0x172b, + 0x78ac, 0xc0c5, 0x78ae, 0x0078, 0x15ba, 0x2009, 0x0000, 0x786c, + 0xa065, 0x0040, 0x1737, 0x8108, 0x6000, 0x0078, 0x1730, 0x7ac4, + 0x0078, 0x15b8, 0x2009, 0x4d48, 0x210c, 0x7810, 0xd0ec, 0x00c0, + 0x15b9, 0x2011, 0x4d88, 0x2214, 0x0078, 0x15b8, 0x2009, 0x4d49, + 0x210c, 0x7810, 0xd0ec, 0x00c0, 0x15b9, 0x2011, 0x4d89, 0x2214, + 0x0078, 0x15b8, 0x2061, 0x4d40, 0x6128, 0x622c, 0x8214, 0x8214, + 0x8214, 0x7810, 0xd0ec, 0x00c0, 0x1766, 0x2061, 0x4d80, 0x6328, + 0x73da, 0x632c, 0x831c, 0x831c, 0x831c, 0x73de, 0x0078, 0x15b8, + 0x2009, 0x4d4c, 0x210c, 0x7810, 0xd0ec, 0x00c0, 0x15b9, 0x2011, + 0x4d8c, 0x2214, 0x0078, 0x15b8, 0x7918, 0x0078, 0x15b9, 0x2009, + 0x4d4d, 0x210c, 0x7810, 0xd0ec, 0x00c0, 0x15b9, 0x2011, 0x4d8d, + 0x2214, 0x0078, 0x15b8, 0x2009, 0x4d4e, 0x210c, 0x7810, 0xd0ec, + 0x00c0, 0x15b9, 0x2011, 0x4d8e, 0x2214, 0x0078, 0x15b8, 0x7920, + 0x7810, 0xd0ec, 0x00c0, 0x15b9, 0x7a24, 0x0078, 0x15b8, 0x71c4, + 0xd1fc, 0x00c0, 0x179f, 0x2011, 0x51c0, 0x0078, 0x17a1, 0x2011, + 0x5240, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa268, + 0x6a00, 0x6804, 0xd09c, 0x0040, 0x17b0, 0x6b08, 0x0078, 0x17b1, + 0x6b0c, 0x0078, 0x15b7, 0x77c4, 0x1078, 0x1dcb, 0x2091, 0x8000, + 0x6b1c, 0x6a14, 0x2091, 0x8001, 0x2708, 0x0078, 0x15b7, 0x2061, + 0x4d40, 0x6118, 0x7810, 0xd0ec, 0x00c0, 0x15b9, 0x2061, 0x4d80, + 0x6218, 0x0078, 0x15b8, 0x77c4, 0x1078, 0x1dcb, 0x2091, 0x8000, + 0x6908, 0x6a18, 0x6b10, 0x77da, 0x2091, 0x8001, 0x0078, 0x15b7, + 0x71c4, 0x2110, 0xa294, 0x000f, 0xa282, 0x0010, 0x00c8, 0x15b2, + 0x1078, 0x2735, 0xa384, 0x4000, 0x0040, 0x17e8, 0xa295, 0x0020, + 0x0078, 0x15b7, 0x71c4, 0x2100, 0xc0bc, 0xa082, 0x0010, 0x00c8, + 0x15b2, 0xd1bc, 0x00c0, 0x17f9, 0x2011, 0x4d48, 0x2204, 0x0078, + 0x17fd, 0x2011, 0x4d88, 0x2204, 0xc0bd, 0x007e, 0x2100, 0xc0bc, + 0x2012, 0x1078, 0x2692, 0x017f, 0x0078, 0x15b9, 0x71c4, 0x2021, + 0x4d49, 0x2404, 0x70c6, 0x2019, 0x0000, 0x0078, 0x1815, 0x71c8, + 0x2021, 0x4d89, 0x2404, 0x70ca, 0xc3fd, 0x2011, 0x1834, 0x20a9, + 0x0008, 0x2204, 0xa106, 0x0040, 0x1824, 0x8210, 0x00f0, 0x1819, + 0x71c4, 0x72c8, 0x0078, 0x15b1, 0xa292, 0x1834, 0x027e, 0x2122, + 0x017f, 0x1078, 0x26b3, 0x7810, 0xd0ec, 0x00c0, 0x1832, 0xd3fc, + 0x0040, 0x180f, 0x0078, 0x15ba, 0x03e8, 0x00fa, 0x01f4, 0x02ee, + 0x0064, 0x0019, 0x0032, 0x004b, 0x2061, 0x4d40, 0x6128, 0x622c, + 0x8214, 0x8214, 0x8214, 0x70c4, 0x602a, 0x70c8, 0x8003, 0x8003, + 0x8003, 0x602e, 0x7810, 0xd0ec, 0x00c0, 0x1862, 0x027e, 0x017e, + 0x2061, 0x4d80, 0x6128, 0x622c, 0x8214, 0x8214, 0x8214, 0x70d8, + 0x602a, 0x70dc, 0x8003, 0x8003, 0x8003, 0x602e, 0x71da, 0x72de, + 0x017f, 0x027f, 0x0078, 0x15b8, 0x2061, 0x4d40, 0x6130, 0x70c4, + 0x6032, 0x7810, 0xd0ec, 0x00c0, 0x15b9, 0x2061, 0x4d80, 0x6230, + 0x70c8, 0x6032, 0x0078, 0x15b8, 0x7918, 0x0078, 0x15b9, 0x71c4, + 0xa184, 0xffcf, 0x0040, 0x1883, 0x7810, 0xd0ec, 0x00c0, 0x15b2, + 0x72c8, 0x0078, 0x15b1, 0x2011, 0x4d4d, 0x2204, 0x2112, 0x007e, + 0x2019, 0x0000, 0x1078, 0x271a, 0x7810, 0xd0ec, 0x0040, 0x1893, + 0x017f, 0x0078, 0x15b9, 0x71c8, 0xa184, 0xffcf, 0x0040, 0x189c, + 0x2110, 0x71c4, 0x0078, 0x15b1, 0x2011, 0x4d8d, 0x2204, 0x2112, + 0x007e, 0xc3fd, 0x1078, 0x271a, 0x027f, 0x017f, 0x0078, 0x15b8, + 0x71c4, 0xa182, 0x0010, 0x0048, 0x18b4, 0x7810, 0xd0ec, 0x00c0, + 0x15b2, 0x72c8, 0x0078, 0x15b1, 0x2011, 0x4d4e, 0x2204, 0x007e, + 0x2112, 0x2019, 0x0000, 0x1078, 0x26f8, 0x7810, 0xd0ec, 0x0040, + 0x18c4, 0x017f, 0x0078, 0x15b9, 0x71c8, 0xa182, 0x0010, 0x0048, + 0x18cd, 0x2110, 0x71c4, 0x0078, 0x15b1, 0x2011, 0x4d8e, 0x2204, + 0x007e, 0x2112, 0xc3fd, 0x1078, 0x26f8, 0x027f, 0x017f, 0x0078, + 0x15b8, 0x71c4, 0x72c8, 0xa184, 0xfffd, 0x00c0, 0x15b1, 0xa284, + 0xfffd, 0x00c0, 0x15b1, 0x2100, 0x7920, 0x7822, 0x2200, 0x7a24, + 0x7826, 0x0078, 0x15b8, 0x71c4, 0xd1fc, 0x00c0, 0x18f3, 0x2011, + 0x51c0, 0x0078, 0x18f5, 0x2011, 0x5240, 0x8107, 0xa084, 0x000f, + 0x8003, 0x8003, 0x8003, 0xa268, 0x2019, 0x0000, 0x72c8, 0x2091, + 0x8000, 0xa284, 0x0080, 0x0040, 0x190b, 0x6c14, 0x84ff, 0x00c0, + 0x190b, 0x6817, 0x0040, 0xa284, 0x0040, 0x0040, 0x1915, 0x6c10, + 0x84ff, 0x00c0, 0x1915, 0x6813, 0x0001, 0x6800, 0x007e, 0xa226, + 0x0040, 0x1932, 0x6a02, 0xd4ec, 0x0040, 0x191f, 0xc3a5, 0xd4e4, + 0x0040, 0x1923, 0xc39d, 0xd4f4, 0x0040, 0x1932, 0x810f, 0xd2f4, + 0x0040, 0x192e, 0x1078, 0x2777, 0x0078, 0x1932, 0x1078, 0x2755, + 0x0078, 0x1932, 0x72cc, 0x6808, 0xa206, 0x0040, 0x1954, 0xa2a4, + 0x00ff, 0x7814, 0xd0e4, 0x00c0, 0x1945, 0xa482, 0x0028, 0x0048, + 0x1951, 0x0040, 0x1951, 0x0078, 0x1949, 0xa482, 0x0043, 0x0048, + 0x1951, 0x71c4, 0x71c6, 0x027f, 0x72ca, 0x2091, 0x8001, 0x0078, + 0x15b3, 0x6a0a, 0xa39d, 0x000a, 0x6804, 0xa305, 0x6806, 0x027f, + 0x6b0c, 0x71c4, 0x2091, 0x8001, 0x0078, 0x15b7, 0x77c4, 0x1078, + 0x1dcb, 0x2091, 0x8000, 0x6a14, 0x6b1c, 0x2091, 0x8001, 0x70c8, + 0x6816, 0x70cc, 0x681e, 0x2708, 0x0078, 0x15b7, 0x70c4, 0x2061, + 0x4d40, 0x6118, 0x601a, 0x7810, 0xd0ec, 0x00c0, 0x15b9, 0x70c8, + 0x2061, 0x4d80, 0x6218, 0x601a, 0x0078, 0x15b8, 0x71c4, 0x72c8, + 0x73cc, 0xa182, 0x0010, 0x00c8, 0x15b2, 0x1078, 0x2799, 0xa384, + 0x4000, 0x0040, 0x198d, 0xa295, 0x0020, 0x0078, 0x15b7, 0x77c4, + 0x1078, 0x1dcb, 0x2091, 0x8000, 0x6a08, 0xc28d, 0x6a0a, 0x2091, + 0x8001, 0x2708, 0x0078, 0x15b8, 0x77c4, 0x1078, 0x1dcb, 0x2091, + 0x8000, 0x6a08, 0xa294, 0xfff9, 0x6a0a, 0x6804, 0xa005, 0x0040, + 0x19ab, 0x1078, 0x25ea, 0x2091, 0x8001, 0x2708, 0x0078, 0x15b8, + 0x77c4, 0x1078, 0x1dcb, 0x2091, 0x8000, 0x6a08, 0xc295, 0x6a0a, + 0x6804, 0xa005, 0x0040, 0x19be, 0x1078, 0x25ea, 0x2091, 0x8001, + 0x2708, 0x0078, 0x15b8, 0x77c4, 0x2041, 0x0001, 0x2049, 0x0005, + 0x2051, 0x0020, 0x2091, 0x8000, 0x1078, 0x1de6, 0x2091, 0x8001, + 0x2708, 0x6a08, 0x0078, 0x15b8, 0x77c4, 0x7814, 0xd0e4, 0x00c0, + 0x19e8, 0xd7fc, 0x0040, 0x19e2, 0x1078, 0x1d4b, 0x0040, 0x19e8, + 0x0078, 0x15bc, 0x1078, 0x1d3b, 0x0040, 0x19e8, 0x0078, 0x15bc, + 0x73c8, 0x72cc, 0x77c6, 0x73ca, 0x72ce, 0x1078, 0x1e6d, 0x00c0, + 0x1a12, 0x6818, 0xa005, 0x0040, 0x1a0c, 0x2708, 0x077e, 0x1078, + 0x27c9, 0x077f, 0x00c0, 0x1a0c, 0x2001, 0x0015, 0xd7fc, 0x00c0, + 0x1a05, 0x2061, 0x4d40, 0x0078, 0x1a08, 0xc0fd, 0x2061, 0x4d80, + 0x782a, 0x2091, 0x8001, 0x007c, 0x2091, 0x8001, 0x2001, 0x4005, + 0x0078, 0x15bc, 0x2091, 0x8001, 0x0078, 0x15ba, 0x77c4, 0x7814, + 0xd0e4, 0x00c0, 0x1a2a, 0xd7fc, 0x0040, 0x1a24, 0x1078, 0x1d4b, + 0x0040, 0x1a2a, 0x0078, 0x15bc, 0x1078, 0x1d3b, 0x0040, 0x1a2a, + 0x0078, 0x15bc, 0x77c6, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, + 0x0020, 0x2091, 0x8000, 0x1078, 0x1de6, 0x2009, 0x0016, 0xd7fc, + 0x00c0, 0x1a3e, 0x2061, 0x4d40, 0x0078, 0x1a41, 0x2061, 0x4d80, + 0xc1fd, 0x6067, 0x0003, 0x607f, 0x0000, 0x6776, 0x6083, 0x000f, + 0x792a, 0x1078, 0x25ea, 0x2091, 0x8001, 0x007c, 0x77c8, 0x77ca, + 0x77c4, 0x77c6, 0x7814, 0xd0e4, 0x00c0, 0x1a65, 0xd7fc, 0x0040, + 0x1a5f, 0x1078, 0x1d4b, 0x0040, 0x1a65, 0x0078, 0x15bc, 0x1078, + 0x1d3b, 0x0040, 0x1a65, 0x0078, 0x15bc, 0xa7bc, 0xff00, 0x2091, + 0x8000, 0x2009, 0x0017, 0xd7fc, 0x00c0, 0x1a72, 0x2061, 0x4d40, + 0x0078, 0x1a75, 0x2061, 0x4d80, 0xc1fd, 0x607f, 0x0000, 0x6067, + 0x0002, 0x6776, 0x6083, 0x000f, 0x792a, 0x1078, 0x25ea, 0x2091, + 0x8001, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, 0x0010, 0x2091, + 0x8000, 0x70c8, 0xa005, 0x0040, 0x1a90, 0x60d4, 0xc0fd, 0x60d6, + 0x1078, 0x1de6, 0x70c8, 0x6836, 0x8738, 0xa784, 0x001f, 0x00c0, + 0x1a90, 0x2091, 0x8001, 0x007c, 0x7814, 0xd0e4, 0x00c0, 0x1ab0, + 0x72c8, 0xd284, 0x0040, 0x1aaa, 0x1078, 0x1d4b, 0x0040, 0x1ab0, + 0x0078, 0x15bc, 0x1078, 0x1d3b, 0x0040, 0x1ab0, 0x0078, 0x15bc, + 0x72c8, 0x72ca, 0x78ac, 0xa084, 0x0003, 0x00c0, 0x1adb, 0x2039, + 0x0000, 0xd284, 0x0040, 0x1abd, 0xc7fd, 0x2041, 0x0021, 0x2049, + 0x0004, 0x2051, 0x0008, 0x1078, 0x1dcb, 0x2091, 0x8000, 0x6808, + 0xc0d4, 0xa80d, 0x690a, 0x2091, 0x8001, 0x8738, 0xa784, 0x001f, + 0x00c0, 0x1ac3, 0xa7bc, 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, + 0x0f00, 0x00c0, 0x1ac3, 0x2091, 0x8000, 0x72c8, 0xd284, 0x00c0, + 0x1aed, 0x7810, 0xd0ec, 0x0040, 0x1ae9, 0x2069, 0x0100, 0x0078, + 0x1aef, 0x2069, 0x0200, 0x0078, 0x1aef, 0x2069, 0x0100, 0x6808, + 0xa084, 0xfffd, 0x680a, 0x6830, 0xd0b4, 0x0040, 0x1b0f, 0x684b, + 0x0004, 0x20a9, 0x0014, 0x6848, 0xd094, 0x0040, 0x1b01, 0x00f0, + 0x1afb, 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xd084, 0x0040, + 0x1b0b, 0x00f0, 0x1b05, 0x20a9, 0x00fa, 0x00f0, 0x1b0d, 0x2079, + 0x4d00, 0x2009, 0x0018, 0x72c8, 0xd284, 0x00c0, 0x1b1b, 0x2061, + 0x4d40, 0x0078, 0x1b1e, 0x2061, 0x4d80, 0xc1fd, 0x792a, 0x6067, + 0x0001, 0x6083, 0x000f, 0x60a7, 0x0000, 0x60a8, 0x60b2, 0x60b6, + 0x60d4, 0xd0b4, 0x0040, 0x1b38, 0xc0b4, 0x60d6, 0x0c7e, 0x60b8, + 0xa065, 0x6008, 0xc0d4, 0x600a, 0x6018, 0x8001, 0x601a, 0x0c7f, + 0x60d4, 0xa084, 0x77ff, 0x60d6, 0x78ac, 0xc08d, 0x78ae, 0x681b, + 0x0047, 0x2091, 0x8001, 0x007c, 0xd7fc, 0x00c0, 0x1b4b, 0x2069, + 0x4d40, 0x0078, 0x1b4d, 0x2069, 0x4d80, 0x71c4, 0x71c6, 0x6916, + 0x81ff, 0x00c0, 0x1b55, 0x68a7, 0x0001, 0x78ac, 0xc08c, 0x78ae, + 0xd084, 0x00c0, 0x1b5d, 0x1078, 0x1ecd, 0x007c, 0x75d8, 0x74dc, + 0x75da, 0x74de, 0x0078, 0x1b67, 0x2029, 0x0000, 0x2520, 0x71c4, + 0x73c8, 0x72cc, 0x71c6, 0x73ca, 0x72ce, 0x2079, 0x4d00, 0x7dde, + 0x7cda, 0x7bd6, 0x7ad2, 0x1078, 0x1da4, 0x0040, 0x1c69, 0x20a9, + 0x0005, 0x20a1, 0x4d14, 0x2091, 0x8000, 0x41a1, 0x2091, 0x8001, + 0x2009, 0x0040, 0x1078, 0x1fb8, 0x0040, 0x1b8a, 0x1078, 0x1dad, + 0x0078, 0x1c69, 0x6004, 0xa08c, 0x00ff, 0xa18e, 0x0009, 0x00c0, + 0x1b95, 0x007e, 0x1078, 0x2339, 0x007f, 0xa084, 0xff00, 0x8007, + 0x8009, 0x0040, 0x1c09, 0x0c7e, 0x2c68, 0x1078, 0x1da4, 0x0040, + 0x1bdb, 0x2c00, 0x689e, 0x8109, 0x00c0, 0x1b9c, 0x609f, 0x0000, + 0x0c7f, 0x0c7e, 0x7ddc, 0x7cd8, 0x7bd4, 0x7ad0, 0xa290, 0x0040, + 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x7dde, 0x7cda, + 0x7bd6, 0x7ad2, 0x2c68, 0x689c, 0xa065, 0x0040, 0x1c08, 0x2009, + 0x0040, 0x1078, 0x1fb8, 0x00c0, 0x1bf2, 0x6004, 0xa084, 0x00ff, + 0xa086, 0x0002, 0x00c0, 0x1bdb, 0x6004, 0xa084, 0x00ff, 0xa086, + 0x000a, 0x00c0, 0x1bd7, 0x017e, 0x1078, 0x2335, 0x017f, 0x2d00, + 0x6002, 0x0078, 0x1baa, 0x0c7f, 0x0c7e, 0x609c, 0x1078, 0x1e30, + 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1c6d, 0x2009, 0x0018, 0x6008, + 0xc0cd, 0x600a, 0x6004, 0x6086, 0x1078, 0x1d5b, 0x1078, 0x1dad, + 0x0078, 0x1c69, 0x0c7f, 0x0c7e, 0x609c, 0x1078, 0x1e30, 0x0c7f, + 0x609f, 0x0000, 0x1078, 0x1c6d, 0x2009, 0x0018, 0x6087, 0x0103, + 0x601b, 0x0003, 0x1078, 0x1d5b, 0x1078, 0x1dad, 0x0078, 0x1c69, + 0x0c7f, 0x7814, 0xd0e4, 0x00c0, 0x1c2e, 0x6114, 0xd1fc, 0x0040, + 0x1c17, 0x1078, 0x1d4b, 0x0040, 0x1c2e, 0x0078, 0x1c1b, 0x1078, + 0x1d3b, 0x0040, 0x1c2e, 0x2029, 0x0000, 0x2520, 0x2009, 0x0018, + 0x73c8, 0x72cc, 0x6087, 0x0103, 0x601b, 0x0021, 0x1078, 0x1d5b, + 0x1078, 0x1dad, 0x2001, 0x4007, 0x0078, 0x15bc, 0x74c4, 0x73c8, + 0x72cc, 0x6014, 0x2091, 0x8000, 0x0e7e, 0x2009, 0x0012, 0xd0fc, + 0x00c0, 0x1c3e, 0x2071, 0x4d40, 0x0078, 0x1c41, 0x2071, 0x4d80, + 0xc1fd, 0x792a, 0x7067, 0x0005, 0x71d4, 0xc1dc, 0x71d6, 0x736a, + 0x726e, 0x7472, 0x7076, 0x707b, 0x0000, 0x2c00, 0x707e, 0xa02e, + 0x2530, 0x611c, 0xa184, 0x0060, 0x0040, 0x1c58, 0x1078, 0x45a7, + 0x0e7f, 0x6596, 0x65a6, 0x669a, 0x66aa, 0x60af, 0x0000, 0x60b3, + 0x0000, 0x6714, 0x6023, 0x0000, 0x1078, 0x25ea, 0x2091, 0x8001, + 0x007c, 0x70c3, 0x4005, 0x0078, 0x15bd, 0x20a9, 0x0005, 0x2099, + 0x4d14, 0x2091, 0x8000, 0x530a, 0x2091, 0x8001, 0x2100, 0xa210, + 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x007c, 0x71c4, + 0x70c7, 0x0000, 0x791e, 0x0078, 0x15ba, 0x71c4, 0x71c6, 0x2168, + 0x0078, 0x1c8c, 0x2069, 0x1000, 0x690c, 0xa016, 0x2d04, 0xa210, + 0x8d68, 0x8109, 0x00c0, 0x1c8e, 0xa285, 0x0000, 0x00c0, 0x1c9c, + 0x70c3, 0x4000, 0x0078, 0x1c9e, 0x70c3, 0x4003, 0x70ca, 0x0078, + 0x15bd, 0x7964, 0x71c6, 0x71c4, 0xa182, 0x0003, 0x00c8, 0x15b2, + 0x7966, 0x0078, 0x15ba, 0x7964, 0x71c6, 0x0078, 0x15ba, 0x7900, + 0x71c6, 0x71c4, 0x7902, 0x0078, 0x15ba, 0x7900, 0x71c6, 0x0078, + 0x15ba, 0x70c4, 0x2011, 0x0000, 0xa08c, 0x000d, 0x0040, 0x1cce, + 0x810c, 0x0048, 0x1cca, 0x8210, 0x810c, 0x810c, 0x0048, 0x1cca, + 0x8210, 0x810c, 0x81ff, 0x00c0, 0x15b3, 0x8210, 0x7a0e, 0xd28c, + 0x0040, 0x1cfa, 0x7910, 0xc1cd, 0x7912, 0x2009, 0x0021, 0x2019, + 0x0003, 0xd284, 0x0040, 0x1cf4, 0x8108, 0x2019, 0x0041, 0x2011, + 0x954e, 0x2312, 0x2019, 0x0042, 0x8210, 0x2312, 0x2019, 0x0043, + 0x8210, 0x2312, 0x2019, 0x0046, 0x8210, 0x2312, 0x2019, 0x0047, + 0x8210, 0x2312, 0x2019, 0x0006, 0x2011, 0x9553, 0x2112, 0x2011, + 0x9573, 0x2312, 0x7904, 0x7806, 0x0078, 0x15b9, 0x7804, 0x70c6, + 0x0078, 0x15ba, 0x71c4, 0xd1fc, 0x00c0, 0x1d0a, 0x2011, 0x51c0, + 0x0078, 0x1d0c, 0x2011, 0x5240, 0x8107, 0xa084, 0x000f, 0x8003, + 0x8003, 0x8003, 0xa268, 0x6a14, 0xd2b4, 0x0040, 0x1d1b, 0x2011, + 0x0001, 0x0078, 0x1d1d, 0x2011, 0x0000, 0x6b0c, 0x0078, 0x15b7, + 0x017e, 0x7814, 0xd0f4, 0x0040, 0x1d2d, 0x2001, 0x4007, 0x70db, + 0x0000, 0xa18d, 0x0001, 0x0078, 0x1d39, 0xd0fc, 0x0040, 0x1d38, + 0x2001, 0x4007, 0x70db, 0x0001, 0xa18d, 0x0001, 0x0078, 0x1d39, + 0xa006, 0x017f, 0x007c, 0x017e, 0x7814, 0xd0f4, 0x0040, 0x1d48, + 0x2001, 0x4007, 0x70db, 0x0000, 0xa18d, 0x0001, 0x0078, 0x1d49, + 0xa006, 0x017f, 0x007c, 0x017e, 0x7814, 0xd0fc, 0x0040, 0x1d58, + 0x2001, 0x4007, 0x70db, 0x0001, 0xa18d, 0x0001, 0x0078, 0x1d59, + 0xa006, 0x017f, 0x007c, 0x7112, 0x721a, 0x731e, 0x7810, 0xd0c4, + 0x0040, 0x1d64, 0x7422, 0x7526, 0xac80, 0x0001, 0x8108, 0x810c, + 0x81a9, 0x8098, 0x20a1, 0x0030, 0x7003, 0x0000, 0x6084, 0x20a2, + 0x53a6, 0x7007, 0x0001, 0x7974, 0xa184, 0xff00, 0x0040, 0x1d81, + 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0078, + 0x1d84, 0x8107, 0x8004, 0x8004, 0x797c, 0xa108, 0x7a78, 0xa006, + 0xa211, 0x7d10, 0xd5c4, 0x0040, 0x1d91, 0x7b84, 0xa319, 0x7c80, + 0xa421, 0x7008, 0xd0fc, 0x0040, 0x1d91, 0x7003, 0x0001, 0x7007, + 0x0006, 0x711a, 0x721e, 0x7d10, 0xd5c4, 0x0040, 0x1da1, 0x7322, + 0x7426, 0xa084, 0x01e0, 0x007c, 0x7848, 0xa065, 0x0040, 0x1dac, + 0x2c04, 0x784a, 0x2063, 0x0000, 0x007c, 0x0f7e, 0x2079, 0x4d00, + 0x7848, 0x2062, 0x2c00, 0xa005, 0x00c0, 0x1db8, 0x1078, 0x290c, + 0x784a, 0x0f7f, 0x007c, 0x2011, 0x9700, 0x7a4a, 0x7bc4, 0x8319, + 0x0040, 0x1dc8, 0xa280, 0x0032, 0x2012, 0x2010, 0x0078, 0x1dbf, + 0x2013, 0x0000, 0x007c, 0x017e, 0x027e, 0xd7fc, 0x00c0, 0x1dd4, + 0x2011, 0x52c0, 0x0078, 0x1dd6, 0x2011, 0x72c0, 0xa784, 0x0f00, + 0x800b, 0xa784, 0x001f, 0x0040, 0x1de1, 0x8003, 0x8003, 0x8003, + 0x8003, 0xa105, 0xa268, 0x027f, 0x017f, 0x007c, 0x1078, 0x1dcb, + 0x2900, 0x682a, 0x2a00, 0x682e, 0x6808, 0xa084, 0xf9ef, 0xa80d, + 0x690a, 0x0e7e, 0xd7fc, 0x00c0, 0x1dfb, 0x2009, 0x4d53, 0x2071, + 0x4d40, 0x0078, 0x1dff, 0x2009, 0x4d93, 0x2071, 0x4d80, 0x210c, + 0x6804, 0xa005, 0x0040, 0x1e0f, 0xa116, 0x00c0, 0x1e0f, 0x2060, + 0x6000, 0x6806, 0x017e, 0x200b, 0x0000, 0x0078, 0x1e12, 0x2009, + 0x0000, 0x017e, 0x6804, 0xa065, 0x0040, 0x1e27, 0x6000, 0x6806, + 0x1078, 0x1e42, 0x1078, 0x2004, 0x6810, 0x7908, 0x8109, 0x790a, + 0x8001, 0x6812, 0x00c0, 0x1e12, 0x7910, 0xc1a5, 0x7912, 0x017f, + 0x6902, 0x6906, 0x2d00, 0x2060, 0x1078, 0x2a6d, 0x0e7f, 0x007c, + 0xa065, 0x0040, 0x1e41, 0x2008, 0x609c, 0xa005, 0x0040, 0x1e3e, + 0x2062, 0x609f, 0x0000, 0xa065, 0x0078, 0x1e34, 0x7848, 0x794a, + 0x2062, 0x007c, 0x6007, 0x0103, 0x608f, 0x0000, 0x20a9, 0x001c, + 0xac80, 0x0005, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x6828, 0x601a, + 0x682c, 0x6022, 0x007c, 0x0e7e, 0xd7fc, 0x00c0, 0x1e5d, 0x2071, + 0x4d40, 0x2031, 0x4dc0, 0x0078, 0x1e61, 0x2071, 0x4d80, 0x2031, + 0x4fc0, 0x7050, 0xa08c, 0x0200, 0x00c0, 0x1e6b, 0xa608, 0x2d0a, + 0x8000, 0x7052, 0xa006, 0x0e7f, 0x007c, 0x0f7e, 0xd7fc, 0x00c0, + 0x1e75, 0x2079, 0x4d40, 0x0078, 0x1e77, 0x2079, 0x4d80, 0x1078, + 0x1dcb, 0x2091, 0x8000, 0x6804, 0x780a, 0xa065, 0x0040, 0x1ecb, + 0x0078, 0x1e89, 0x2c00, 0x780a, 0x2060, 0x6000, 0xa065, 0x0040, + 0x1ecb, 0x6010, 0xa306, 0x00c0, 0x1e82, 0x600c, 0xa206, 0x00c0, + 0x1e82, 0x2c28, 0x784c, 0xac06, 0x00c0, 0x1e98, 0x0078, 0x1ec8, + 0x6804, 0xac06, 0x00c0, 0x1ea6, 0x6000, 0x2060, 0x6806, 0xa005, + 0x00c0, 0x1ea6, 0x6803, 0x0000, 0x0078, 0x1eb0, 0x6400, 0x7808, + 0x2060, 0x6402, 0xa486, 0x0000, 0x00c0, 0x1eb0, 0x2c00, 0x6802, + 0x2560, 0x0f7f, 0x1078, 0x1e42, 0x0f7e, 0x601b, 0x0005, 0x6023, + 0x0020, 0x0f7f, 0x1078, 0x2004, 0x0f7e, 0x7908, 0x8109, 0x790a, + 0x6810, 0x8001, 0x6812, 0x00c0, 0x1ec8, 0x7810, 0xc0a5, 0x7812, + 0x2001, 0xffff, 0xa005, 0x0f7f, 0x007c, 0x077e, 0x2700, 0x2039, + 0x0000, 0xd0fc, 0x0040, 0x1ed5, 0xc7fd, 0x2041, 0x0021, 0x2049, + 0x0004, 0x2051, 0x0008, 0x2091, 0x8000, 0x1078, 0x1de6, 0x8738, + 0xa784, 0x001f, 0x00c0, 0x1edd, 0xa7bc, 0xff00, 0x873f, 0x8738, + 0x873f, 0xa784, 0x0f00, 0x00c0, 0x1edd, 0x2091, 0x8001, 0x077f, + 0x007c, 0x786c, 0x2009, 0x9574, 0x210c, 0xa10d, 0x0040, 0x1efb, + 0xa065, 0x0078, 0x2356, 0x2061, 0x0000, 0x6018, 0xd084, 0x00c0, + 0x1f1b, 0x7810, 0xd08c, 0x0040, 0x1f0c, 0xc08c, 0x7812, 0xc7fc, + 0x2069, 0x4d40, 0x0078, 0x1f11, 0xc08d, 0x7812, 0x2069, 0x4d80, + 0xc7fd, 0x2091, 0x8000, 0x681c, 0x681f, 0x0000, 0x2091, 0x8001, + 0xa005, 0x00c0, 0x1f1c, 0x007c, 0xa08c, 0xfff0, 0x0040, 0x1f22, + 0x1078, 0x290c, 0x0079, 0x1f24, 0x1f34, 0x1f37, 0x1f3d, 0x1f41, + 0x1f35, 0x1f45, 0x1f35, 0x1f35, 0x1f35, 0x1f4b, 0x1f7c, 0x1f80, + 0x1f86, 0x1f9b, 0x1f35, 0x1f35, 0x007c, 0x1078, 0x290c, 0x1078, + 0x1ecd, 0x2001, 0x8001, 0x0078, 0x1fa7, 0x2001, 0x8003, 0x0078, + 0x1fa7, 0x2001, 0x8004, 0x0078, 0x1fa7, 0x1078, 0x1ecd, 0x2001, + 0x8006, 0x0078, 0x1fa7, 0x2091, 0x8000, 0x077e, 0xd7fc, 0x00c0, + 0x1f57, 0x2069, 0x4d40, 0x2039, 0x0009, 0x0078, 0x1f5b, 0x2069, + 0x4d80, 0x2039, 0x0009, 0x6800, 0xa086, 0x0000, 0x0040, 0x1f65, + 0x007f, 0x6f1e, 0x2091, 0x8001, 0x007c, 0x6874, 0x077f, 0xa0bc, + 0xff00, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0010, 0x1078, + 0x1de6, 0x8738, 0xa784, 0x001f, 0x00c0, 0x1f6f, 0x2091, 0x8001, + 0x2001, 0x800a, 0x0078, 0x1fa7, 0x2001, 0x800c, 0x0078, 0x1fa7, + 0x1078, 0x1ecd, 0x2001, 0x800d, 0x0078, 0x1fa7, 0x7814, 0xd0e4, + 0x00c0, 0x1f99, 0xd0ec, 0x0040, 0x1f93, 0xd7fc, 0x0040, 0x1f93, + 0x78e4, 0x0078, 0x1f94, 0x78e0, 0x70c6, 0x2001, 0x800e, 0x0078, + 0x1fa7, 0x0078, 0x1f35, 0xd7fc, 0x0040, 0x1fa1, 0x78ec, 0x0078, + 0x1fa2, 0x78e8, 0x70c6, 0x2001, 0x000d, 0x0078, 0x1fa7, 0x70c2, + 0xd7fc, 0x00c0, 0x1faf, 0x70db, 0x0000, 0x0078, 0x1fb1, 0x70db, + 0x0001, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x4080, 0x007c, + 0xac80, 0x0001, 0x81ff, 0x0040, 0x1fe3, 0x2099, 0x0030, 0x20a0, + 0x700c, 0xa084, 0x03ff, 0x0040, 0x1fc5, 0x7018, 0x007e, 0x701c, + 0x007e, 0x7020, 0x007e, 0x7024, 0x007e, 0x7112, 0x81ac, 0x721a, + 0x731e, 0x7422, 0x7526, 0x7003, 0x0001, 0x7007, 0x0001, 0x7008, + 0x800b, 0x00c8, 0x1fd7, 0x7007, 0x0002, 0xa08c, 0x01e0, 0x00c0, + 0x1fe3, 0x53a5, 0xa006, 0x7003, 0x0000, 0x7007, 0x0004, 0x007f, + 0x7026, 0x007f, 0x7022, 0x007f, 0x701e, 0x007f, 0x701a, 0x007c, + 0x2011, 0x0020, 0x2009, 0x0010, 0x6b0a, 0x6c0e, 0x6803, 0xfd00, + 0x6807, 0x0018, 0x6a1a, 0x2d00, 0xa0e8, 0x0008, 0xa290, 0x0004, + 0x8109, 0x00c0, 0x1ff4, 0x007c, 0x6004, 0x6086, 0x2c08, 0x2063, + 0x0000, 0x7868, 0xa005, 0x796a, 0x0040, 0x2011, 0x2c02, 0x0078, + 0x2012, 0x796e, 0x007c, 0x0c7e, 0x2061, 0x4d00, 0x6887, 0x0103, + 0x2d08, 0x206b, 0x0000, 0x6068, 0xa005, 0x616a, 0x0040, 0x2023, + 0x2d02, 0x0078, 0x2024, 0x616e, 0x0c7f, 0x007c, 0x2091, 0x8000, + 0x2c04, 0x786e, 0xa005, 0x00c0, 0x202e, 0x786a, 0x2091, 0x8001, + 0x609c, 0xa005, 0x0040, 0x2047, 0x0c7e, 0x2060, 0x2008, 0x609c, + 0xa005, 0x0040, 0x2043, 0x2062, 0x609f, 0x0000, 0xa065, 0x609c, + 0xa005, 0x00c0, 0x203b, 0x7848, 0x794a, 0x2062, 0x0c7f, 0x7848, + 0x2062, 0x609f, 0x0000, 0xac85, 0x0000, 0x00c0, 0x2051, 0x1078, + 0x290c, 0x784a, 0x007c, 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086, + 0x818e, 0x00c8, 0x205c, 0xa200, 0x00f0, 0x2057, 0x8086, 0x818e, + 0x007c, 0x157e, 0x20a9, 0x0010, 0xa005, 0x0040, 0x2082, 0xa11a, + 0x00c8, 0x2082, 0x8213, 0x818d, 0x0048, 0x2075, 0xa11a, 0x00c8, + 0x2076, 0x00f0, 0x206a, 0x0078, 0x207a, 0xa11a, 0x2308, 0x8210, + 0x00f0, 0x206a, 0x007e, 0x3200, 0xa084, 0xf7ff, 0x2080, 0x007f, + 0x157f, 0x007c, 0x007e, 0x3200, 0xa085, 0x0800, 0x0078, 0x207e, + 0x7d74, 0x70d0, 0xa506, 0x0040, 0x216e, 0x7810, 0x2050, 0x7800, + 0xd08c, 0x0040, 0x20aa, 0xdaec, 0x0040, 0x20aa, 0x0e7e, 0x2091, + 0x8000, 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0, 0x20a7, 0x7008, + 0x0e7f, 0xa086, 0x0008, 0x0040, 0x20aa, 0x0078, 0x216e, 0x0e7f, + 0x0078, 0x216e, 0x1078, 0x1da4, 0x0040, 0x216e, 0xa046, 0x7970, + 0x2500, 0x8000, 0xa112, 0x2009, 0x0040, 0x00c8, 0x20b9, 0x0078, + 0x20c0, 0x72d0, 0xa206, 0x0040, 0x20c0, 0x8840, 0x2009, 0x0080, + 0x0c7e, 0x7112, 0x7007, 0x0001, 0x2099, 0x0030, 0x20a9, 0x0020, + 0xac80, 0x0001, 0x20a0, 0x2061, 0x0000, 0x88ff, 0x0040, 0x20d2, + 0x1078, 0x1da4, 0x7008, 0xd0fc, 0x0040, 0x20d2, 0x7007, 0x0002, + 0x2091, 0x8001, 0xa08c, 0x01e0, 0x00c0, 0x2109, 0x53a5, 0x8cff, + 0x00c0, 0x20e7, 0x88ff, 0x0040, 0x2158, 0x0078, 0x20f1, 0x2c00, + 0x788e, 0x20a9, 0x0020, 0xac80, 0x0001, 0x20a0, 0x53a5, 0x0078, + 0x2158, 0xa046, 0x7218, 0x731c, 0xdac4, 0x0040, 0x20f9, 0x7420, + 0x7524, 0xa292, 0x0040, 0xa39b, 0x0000, 0xa4a3, 0x0000, 0xa5ab, + 0x0000, 0x721a, 0x731e, 0xdac4, 0x0040, 0x2109, 0x7422, 0x7526, + 0xa006, 0x7007, 0x0004, 0x0040, 0x2158, 0x8cff, 0x0040, 0x2112, + 0x1078, 0x1dad, 0x0c7f, 0x1078, 0x1dad, 0xa046, 0x7888, 0x8000, + 0x788a, 0xa086, 0x0002, 0x0040, 0x2138, 0x7a7c, 0x7b78, 0xdac4, + 0x0040, 0x2124, 0x7c84, 0x7d80, 0x7974, 0x8107, 0x8004, 0x8004, + 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x721a, + 0x731e, 0xdac4, 0x0040, 0x216e, 0x7422, 0x7526, 0x0078, 0x216e, + 0x6014, 0xd0fc, 0x00c0, 0x2140, 0x2069, 0x4d40, 0x0078, 0x2142, + 0x2069, 0x4d80, 0x2091, 0x8000, 0x681f, 0x0002, 0x88ff, 0x0040, + 0x214e, 0xa046, 0x788c, 0x2060, 0x0078, 0x2138, 0x788b, 0x0000, + 0x78ac, 0xa085, 0x0003, 0x78ae, 0x2091, 0x8001, 0x0078, 0x216e, + 0x0c7f, 0x788b, 0x0000, 0x1078, 0x2307, 0x6004, 0xa084, 0x000f, + 0x1078, 0x216f, 0x88ff, 0x0040, 0x216c, 0x788c, 0x2060, 0x6004, + 0xa084, 0x000f, 0x1078, 0x216f, 0x0078, 0x2088, 0x007c, 0x0079, + 0x2171, 0x2181, 0x219f, 0x21bd, 0x2181, 0x21ce, 0x2192, 0x2181, + 0x2181, 0x2181, 0x219d, 0x21bb, 0x2181, 0x2181, 0x2181, 0x2181, + 0x2181, 0x2039, 0x0400, 0x78bc, 0xa705, 0x78be, 0x6008, 0xa705, + 0x600a, 0x1078, 0x2211, 0x609c, 0x78ba, 0x609f, 0x0000, 0x1078, + 0x22f1, 0x007c, 0x78bc, 0xd0c4, 0x0040, 0x2198, 0x0078, 0x2181, + 0x601c, 0xc0bd, 0x601e, 0x0078, 0x21a5, 0x1078, 0x2339, 0x78bc, + 0xd0c4, 0x0040, 0x21a5, 0x0078, 0x2181, 0x78bf, 0x0000, 0x6004, + 0x8007, 0xa084, 0x00ff, 0x78b2, 0x8001, 0x0040, 0x21b8, 0x1078, + 0x2211, 0x0040, 0x21b8, 0x78bc, 0xc0c5, 0x78be, 0x0078, 0x21ba, + 0x0078, 0x2230, 0x007c, 0x1078, 0x2335, 0x78bc, 0xa08c, 0x0e00, + 0x00c0, 0x21c5, 0xd0c4, 0x00c0, 0x21c7, 0x0078, 0x2181, 0x1078, + 0x2211, 0x00c0, 0x21cd, 0x0078, 0x2230, 0x007c, 0x78bc, 0xd0c4, + 0x0040, 0x21d4, 0x0078, 0x2181, 0x78bf, 0x0000, 0x6714, 0x2011, + 0x0001, 0x22a8, 0x6018, 0xa084, 0x00ff, 0xa005, 0x0040, 0x21f4, + 0xa7bc, 0xff00, 0x20a9, 0x0020, 0xa08e, 0x0001, 0x0040, 0x21f4, + 0xa7bc, 0x8000, 0x2011, 0x0002, 0x20a9, 0x0100, 0xa08e, 0x0002, + 0x0040, 0x21f4, 0x0078, 0x220e, 0x1078, 0x1dcb, 0x2d00, 0x2091, + 0x8000, 0x682b, 0x0000, 0x682f, 0x0000, 0x6808, 0xa084, 0xffde, + 0x680a, 0xade8, 0x0010, 0x2091, 0x8001, 0x00f0, 0x21f7, 0x8211, + 0x0040, 0x220e, 0x20a9, 0x0100, 0x0078, 0x21f7, 0x1078, 0x1dad, + 0x007c, 0x609f, 0x0000, 0x78b4, 0xa06d, 0x2c00, 0x78b6, 0x00c0, + 0x221c, 0x78ba, 0x0078, 0x2224, 0x689e, 0x2d00, 0x6002, 0x78b8, + 0xad06, 0x00c0, 0x2224, 0x6002, 0x78b0, 0x8001, 0x78b2, 0x00c0, + 0x222f, 0x78bc, 0xc0c4, 0x78be, 0x78b8, 0x2060, 0xa006, 0x007c, + 0x0e7e, 0xa02e, 0x2530, 0x7dba, 0x7db6, 0x65ae, 0x65b2, 0x601c, + 0x60a2, 0x2048, 0xa984, 0xe1ff, 0x601e, 0xa984, 0x0060, 0x0040, + 0x2243, 0x1078, 0x45a7, 0x6596, 0x65a6, 0x669a, 0x66aa, 0x6714, + 0x2071, 0x4d80, 0xd7fc, 0x00c0, 0x224f, 0x2071, 0x4d40, 0xa784, + 0x0f00, 0x800b, 0xa784, 0x001f, 0x0040, 0x225a, 0x8003, 0x8003, + 0x8003, 0x8003, 0xa105, 0x71c4, 0xa168, 0x2700, 0x8007, 0xa084, + 0x000f, 0x8003, 0x8003, 0x8003, 0x71c8, 0xa100, 0x60c2, 0x2091, + 0x8000, 0x7810, 0xd0f4, 0x00c0, 0x2274, 0x6e08, 0xd684, 0x0040, + 0x228a, 0xd9fc, 0x00c0, 0x228a, 0x2091, 0x8001, 0x1078, 0x1e42, + 0x2091, 0x8000, 0x1078, 0x2004, 0x2091, 0x8001, 0x7814, 0xd0e4, + 0x00c0, 0x22ef, 0x7810, 0xd0f4, 0x0040, 0x22ef, 0x601b, 0x0021, + 0x0078, 0x22ef, 0x6024, 0xa096, 0x0001, 0x00c0, 0x2291, 0x8000, + 0x6026, 0x6a10, 0x6814, 0xa202, 0x0048, 0x22a4, 0x0040, 0x22a4, + 0x2091, 0x8001, 0x2039, 0x0200, 0x609c, 0x78ba, 0x609f, 0x0000, + 0x1078, 0x22f1, 0x0078, 0x22ef, 0x2c08, 0xd9fc, 0x0040, 0x22cc, + 0x6800, 0xa065, 0x0040, 0x22cc, 0x6a04, 0x7000, 0xa084, 0x0002, + 0x0040, 0x22c2, 0x704c, 0xa206, 0x00c0, 0x22c2, 0x6b04, 0x2160, + 0x2304, 0x6002, 0xa005, 0x00c0, 0x22be, 0x6902, 0x2260, 0x6102, + 0x0078, 0x22d8, 0x2d00, 0x2060, 0x1078, 0x2a6d, 0x6e08, 0x2160, + 0x6202, 0x6906, 0x0078, 0x22d8, 0x6800, 0x6902, 0xa065, 0x0040, + 0x22d4, 0x6102, 0x0078, 0x22d5, 0x6906, 0x2160, 0x6003, 0x0000, + 0x2160, 0xd9fc, 0x0040, 0x22df, 0xa6b4, 0xfffc, 0x6e0a, 0x6810, + 0x7d08, 0x8528, 0x7d0a, 0x8000, 0x6812, 0x2091, 0x8001, 0xd6b4, + 0x0040, 0x22ef, 0xa6b6, 0x0040, 0x6e0a, 0x1078, 0x1e53, 0x0e7f, + 0x007c, 0x6008, 0xa705, 0x600a, 0x2091, 0x8000, 0x1078, 0x2004, + 0x2091, 0x8001, 0x78b8, 0xa065, 0x0040, 0x2304, 0x609c, 0x78ba, + 0x609f, 0x0000, 0x0078, 0x22f1, 0x78b6, 0x78ba, 0x007c, 0x7970, + 0x7874, 0x2818, 0xd384, 0x0040, 0x2311, 0x8000, 0xa112, 0x0048, + 0x2316, 0x8000, 0xa112, 0x00c8, 0x2326, 0xc384, 0x7a7c, 0x721a, + 0x7a78, 0x721e, 0xdac4, 0x0040, 0x2321, 0x7a84, 0x7222, 0x7a80, + 0x7226, 0xa006, 0xd384, 0x0040, 0x2326, 0x8000, 0x7876, 0x70d2, + 0x781c, 0xa005, 0x0040, 0x2334, 0x8001, 0x781e, 0x00c0, 0x2334, + 0x0068, 0x2334, 0x2091, 0x4080, 0x007c, 0x2039, 0x234d, 0x0078, + 0x233b, 0x2039, 0x2353, 0x2704, 0xa005, 0x0040, 0x234c, 0xac00, + 0x2068, 0x6908, 0x6810, 0x6912, 0x680a, 0x690c, 0x6814, 0x6916, + 0x680e, 0x8738, 0x0078, 0x233b, 0x007c, 0x0003, 0x0009, 0x000f, + 0x0015, 0x001b, 0x0000, 0x0015, 0x001b, 0x0000, 0x2041, 0x0000, + 0x780c, 0x0079, 0x235b, 0x252d, 0x2500, 0x235f, 0x23d8, 0x2039, + 0x9574, 0x2734, 0x7d10, 0x0078, 0x237f, 0x6084, 0xa086, 0x0103, + 0x00c0, 0x23c1, 0x6114, 0x6018, 0xa105, 0x0040, 0x2374, 0x86ff, + 0x00c0, 0x2390, 0x0078, 0x23c1, 0x8603, 0xa080, 0x9555, 0x620c, + 0x2202, 0x8000, 0x6210, 0x2202, 0x1078, 0x2026, 0x8630, 0xa68e, + 0x000f, 0x0040, 0x244c, 0x786c, 0xa065, 0x00c0, 0x2365, 0x7808, + 0xa602, 0x00c8, 0x2390, 0xd5ac, 0x00c0, 0x2390, 0x263a, 0x007c, + 0xa682, 0x0003, 0x00c8, 0x244c, 0x2091, 0x8000, 0x2069, 0x0000, + 0x6818, 0xd084, 0x00c0, 0x23bc, 0x2011, 0x9555, 0x2204, 0x70c6, + 0x8210, 0x2204, 0x70ca, 0xd684, 0x00c0, 0x23ac, 0x8210, 0x2204, + 0x70da, 0x8210, 0x2204, 0x70de, 0xa685, 0x8020, 0x70c2, 0x681b, + 0x0001, 0x2091, 0x4080, 0x7810, 0xa084, 0xffcf, 0x7812, 0x2091, + 0x8001, 0x203b, 0x0000, 0x007c, 0x7810, 0xc0ad, 0x7812, 0x0078, + 0x244c, 0x263a, 0x1078, 0x2537, 0x00c0, 0x255a, 0x786c, 0xa065, + 0x00c0, 0x2365, 0x2091, 0x8000, 0x7810, 0xa084, 0xffcf, 0x86ff, + 0x0040, 0x23d3, 0xc0ad, 0x7812, 0x2091, 0x8001, 0x0078, 0x255a, + 0x2039, 0x9574, 0x2734, 0x7d10, 0x0078, 0x23f4, 0x6084, 0xa086, + 0x0103, 0x00c0, 0x2435, 0x6114, 0x6018, 0xa105, 0x0040, 0x23ed, + 0x86ff, 0x00c0, 0x2405, 0x0078, 0x2435, 0xa680, 0x9555, 0x620c, + 0x2202, 0x1078, 0x2026, 0x8630, 0xa68e, 0x001e, 0x0040, 0x244c, + 0x786c, 0xa065, 0x00c0, 0x23de, 0x7808, 0xa602, 0x00c8, 0x2405, + 0xd5ac, 0x00c0, 0x2405, 0x263a, 0x007c, 0xa682, 0x0006, 0x00c8, + 0x244c, 0x2091, 0x8000, 0x2069, 0x0000, 0x6818, 0xd084, 0x00c0, + 0x2430, 0x2011, 0x9555, 0x2009, 0x954e, 0x26a8, 0x211c, 0x2204, + 0x201a, 0x8108, 0x8210, 0x00f0, 0x2416, 0xa685, 0x8030, 0x70c2, 0x681b, 0x0001, 0x2091, 0x4080, 0x7810, 0xa084, 0xffcf, 0x7812, - 0x2091, 0x8001, 0xa006, 0x2009, 0x9275, 0x200a, 0x203a, 0x007c, - 0x7810, 0xc0ad, 0x7812, 0x0078, 0x2454, 0x263a, 0x1078, 0x253f, - 0x00c0, 0x254e, 0x786c, 0xa065, 0x00c0, 0x23eb, 0x2091, 0x8000, - 0x7810, 0xa084, 0xffcf, 0x86ff, 0x0040, 0x244f, 0xc0ad, 0x7812, - 0x2091, 0x8001, 0x0078, 0x254e, 0x2091, 0x8000, 0x7007, 0x0004, - 0x7994, 0x70d4, 0xa102, 0x0048, 0x2465, 0x0040, 0x246f, 0x7b90, - 0xa302, 0x00c0, 0x246f, 0x0078, 0x2468, 0x8002, 0x00c0, 0x246f, + 0x2091, 0x8001, 0xa006, 0x2009, 0x9575, 0x200a, 0x203a, 0x007c, + 0x7810, 0xc0ad, 0x7812, 0x0078, 0x244c, 0x263a, 0x1078, 0x2537, + 0x00c0, 0x255a, 0x786c, 0xa065, 0x00c0, 0x23de, 0x2091, 0x8000, + 0x7810, 0xa084, 0xffcf, 0x86ff, 0x0040, 0x2447, 0xc0ad, 0x7812, + 0x2091, 0x8001, 0x0078, 0x255a, 0x2091, 0x8000, 0x7007, 0x0004, + 0x7994, 0x70d4, 0xa102, 0x0048, 0x245d, 0x0040, 0x2467, 0x7b90, + 0xa302, 0x00c0, 0x2467, 0x0078, 0x2460, 0x8002, 0x00c0, 0x2467, 0x263a, 0x7810, 0xc0ad, 0x7812, 0x2091, 0x8001, 0x007c, 0xa184, - 0xff00, 0x0040, 0x247c, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, - 0x8007, 0xa100, 0x0078, 0x247f, 0x8107, 0x8004, 0x8004, 0x7a9c, + 0xff00, 0x0040, 0x2474, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, + 0x8007, 0xa100, 0x0078, 0x2477, 0x8107, 0x8004, 0x8004, 0x7a9c, 0xa210, 0x721a, 0x7a98, 0xa006, 0xa211, 0x721e, 0xd4c4, 0x0040, - 0x248f, 0x7aa4, 0xa211, 0x7222, 0x7aa0, 0xa211, 0x7226, 0x20a1, - 0x0030, 0x7003, 0x0000, 0x2009, 0x9254, 0x260a, 0x8109, 0x2198, - 0x2104, 0xd084, 0x0040, 0x249d, 0x8633, 0xa6b0, 0x0002, 0x26a8, + 0x2487, 0x7aa4, 0xa211, 0x7222, 0x7aa0, 0xa211, 0x7226, 0x20a1, + 0x0030, 0x7003, 0x0000, 0x2009, 0x9554, 0x260a, 0x8109, 0x2198, + 0x2104, 0xd084, 0x0040, 0x2495, 0x8633, 0xa6b0, 0x0002, 0x26a8, 0x53a6, 0x8603, 0x7012, 0x7007, 0x0001, 0x7990, 0x7894, 0x8000, - 0xa10a, 0x00c8, 0x24ac, 0xa006, 0x2028, 0x7974, 0xa184, 0xff00, - 0x0040, 0x24bb, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, - 0xa100, 0x0078, 0x24be, 0x8107, 0x8004, 0x8004, 0x797c, 0xa108, - 0x7a78, 0xa006, 0xa211, 0xd4c4, 0x0040, 0x24ca, 0x7b84, 0xa319, - 0x7c80, 0xa421, 0x7008, 0xd0fc, 0x0040, 0x24ca, 0xa084, 0x01e0, - 0x0040, 0x24ef, 0x7d10, 0x2031, 0x9254, 0x2634, 0x78a8, 0x8000, - 0x78aa, 0xd08c, 0x00c0, 0x24e4, 0x7007, 0x0006, 0x7004, 0xd094, - 0x00c0, 0x24de, 0x0078, 0x2456, 0x2069, 0x4a47, 0x206b, 0x0003, - 0x78ac, 0xa085, 0x0300, 0x78ae, 0xa006, 0x0078, 0x24f8, 0x2030, + 0xa10a, 0x00c8, 0x24a4, 0xa006, 0x2028, 0x7974, 0xa184, 0xff00, + 0x0040, 0x24b3, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, + 0xa100, 0x0078, 0x24b6, 0x8107, 0x8004, 0x8004, 0x797c, 0xa108, + 0x7a78, 0xa006, 0xa211, 0xd4c4, 0x0040, 0x24c2, 0x7b84, 0xa319, + 0x7c80, 0xa421, 0x7008, 0xd0fc, 0x0040, 0x24c2, 0xa084, 0x01e0, + 0x0040, 0x24e7, 0x7d10, 0x2031, 0x9554, 0x2634, 0x78a8, 0x8000, + 0x78aa, 0xd08c, 0x00c0, 0x24dc, 0x7007, 0x0006, 0x7004, 0xd094, + 0x00c0, 0x24d6, 0x0078, 0x244e, 0x2069, 0x4d47, 0x206b, 0x0003, + 0x78ac, 0xa085, 0x0300, 0x78ae, 0xa006, 0x0078, 0x24f0, 0x2030, 0x75d6, 0x2091, 0x4080, 0x7d96, 0x7d10, 0xa5ac, 0xffcf, 0x7d12, 0x2091, 0x8001, 0x78aa, 0x7007, 0x0006, 0x263a, 0x7003, 0x0001, - 0x711a, 0x721e, 0xd5c4, 0x0040, 0x2507, 0x7322, 0x7426, 0x007c, - 0x6084, 0xa086, 0x0103, 0x00c0, 0x252b, 0x6114, 0x6018, 0xa105, - 0x00c0, 0x252b, 0x2069, 0x0000, 0x6818, 0xd084, 0x00c0, 0x252b, + 0x711a, 0x721e, 0xd5c4, 0x0040, 0x24ff, 0x7322, 0x7426, 0x007c, + 0x6084, 0xa086, 0x0103, 0x00c0, 0x2523, 0x6114, 0x6018, 0xa105, + 0x00c0, 0x2523, 0x2069, 0x0000, 0x6818, 0xd084, 0x00c0, 0x2523, 0x600c, 0x70c6, 0x6010, 0x70ca, 0x70c3, 0x8020, 0x681b, 0x0001, - 0x2091, 0x4080, 0x1078, 0x203d, 0x0068, 0x252a, 0x786c, 0xa065, - 0x00c0, 0x2508, 0x007c, 0x1078, 0x253f, 0x00c0, 0x254e, 0x786c, - 0xa065, 0x00c0, 0x2508, 0x0078, 0x254e, 0x1078, 0x253f, 0x00c0, - 0x254e, 0x786c, 0xa065, 0x00c0, 0x2535, 0x0078, 0x254e, 0x1078, - 0x2554, 0x00c0, 0x2546, 0xa085, 0x0001, 0x007c, 0x1078, 0x2563, - 0x00c0, 0x254c, 0x2041, 0x0001, 0x7d10, 0x007c, 0x88ff, 0x0040, - 0x2553, 0x2091, 0x4080, 0x007c, 0x7b90, 0x7994, 0x70d4, 0xa102, - 0x00c0, 0x255d, 0xa385, 0x0000, 0x007c, 0x0048, 0x2561, 0xa302, - 0x007c, 0x8002, 0x007c, 0x7810, 0xd0ec, 0x0040, 0x257b, 0x0e7e, - 0x2091, 0x8000, 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0, 0x2578, - 0x7008, 0x0e7f, 0xa086, 0x0008, 0x0040, 0x257b, 0x0078, 0x25cc, - 0x0e7f, 0x0078, 0x25cc, 0xa184, 0xff00, 0x0040, 0x2588, 0x810f, - 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0078, 0x258b, - 0x8107, 0x8004, 0x8004, 0x7a9c, 0x7b98, 0x7ca4, 0x7da0, 0xa210, - 0xa006, 0xa319, 0xa421, 0xa529, 0x2009, 0x0018, 0x6028, 0xa005, - 0x0040, 0x259c, 0x2009, 0x0040, 0x1078, 0x1d92, 0x0040, 0x25be, - 0x78a8, 0x8000, 0x78aa, 0xd08c, 0x00c0, 0x25cc, 0x6014, 0xd0fc, - 0x00c0, 0x25ae, 0x2069, 0x4a40, 0x0078, 0x25b0, 0x2069, 0x4a80, - 0x2091, 0x8000, 0x681f, 0x0003, 0x78ab, 0x0000, 0x78ac, 0xa085, - 0x0300, 0x78ae, 0x2091, 0x8001, 0x0078, 0x25cc, 0x78ab, 0x0000, - 0x1078, 0x203d, 0x7990, 0x7894, 0x8000, 0xa10a, 0x00c8, 0x25c9, - 0xa006, 0x7896, 0x70d6, 0xa006, 0x2071, 0x0010, 0x2091, 0x8001, - 0x007c, 0x2138, 0xd7fc, 0x00c0, 0x25d9, 0x2009, 0x4a59, 0x0078, - 0x25db, 0x2009, 0x4a99, 0x2091, 0x8000, 0x200a, 0x0f7e, 0xd7fc, - 0x00c0, 0x25f2, 0x2009, 0x4a40, 0x2001, 0x4a04, 0x2004, 0xd0ec, - 0x0040, 0x25ee, 0x2079, 0x0100, 0x0078, 0x25f6, 0x2079, 0x0200, - 0x0078, 0x25f6, 0x2009, 0x4a80, 0x2079, 0x0100, 0x2104, 0xa086, - 0x0000, 0x00c0, 0x260f, 0xd7fc, 0x00c0, 0x2602, 0x2009, 0x4a45, - 0x0078, 0x2604, 0x2009, 0x4a85, 0x2104, 0xa005, 0x00c0, 0x260f, - 0x7830, 0xa084, 0x00c0, 0x00c0, 0x260f, 0x781b, 0x0045, 0x0f7f, - 0x007c, 0x2009, 0x0002, 0x2069, 0x4a00, 0x6810, 0xd0ec, 0x00c0, - 0x2672, 0x2071, 0x4a80, 0x2079, 0x0100, 0x2021, 0x4cbf, 0x784b, - 0x000f, 0x2019, 0x4205, 0xd184, 0x0040, 0x2632, 0x6810, 0xd0ec, - 0x0040, 0x262e, 0x20a1, 0x012b, 0x0078, 0x2634, 0x20a1, 0x022b, - 0x0078, 0x2634, 0x20a1, 0x012b, 0x2304, 0xa005, 0x0040, 0x2641, - 0x789a, 0x8318, 0x23ac, 0x8318, 0x2398, 0x53a6, 0x3318, 0x0078, - 0x2634, 0x789b, 0x0020, 0x20a9, 0x0010, 0x78af, 0x0000, 0x78af, - 0x8020, 0x00f0, 0x2645, 0x7003, 0x0000, 0x017e, 0xd18c, 0x2009, - 0x0000, 0x0040, 0x2654, 0xc1bd, 0x1078, 0x283d, 0x017f, 0x7020, - 0xa084, 0x000f, 0x007e, 0x6814, 0xd0e4, 0x007f, 0x00c0, 0x2664, - 0xa085, 0x6340, 0x0078, 0x2666, 0xa085, 0x62c0, 0x7806, 0x780f, - 0x9200, 0x7843, 0x00d8, 0x7853, 0x0080, 0x780b, 0x0008, 0x7456, - 0x7053, 0x0000, 0x8109, 0x0040, 0x2685, 0x2071, 0x4a40, 0x6810, - 0xd0ec, 0x0040, 0x267f, 0x2079, 0x0100, 0x0078, 0x2681, 0x2079, - 0x0200, 0x2021, 0x4abf, 0x0078, 0x261f, 0x007c, 0x017e, 0xd1bc, - 0x00c0, 0x269a, 0x007e, 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x007f, - 0x0040, 0x2696, 0x2011, 0x0101, 0x0078, 0x269c, 0x2011, 0x0201, - 0x0078, 0x269c, 0x2011, 0x0101, 0xa18c, 0x000f, 0x2204, 0xa084, - 0xfff0, 0xa105, 0x2012, 0x017f, 0x1078, 0x283d, 0x007c, 0xd3fc, - 0x00c0, 0x26ba, 0x007e, 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x007f, - 0x0040, 0x26b6, 0x2011, 0x0101, 0x0078, 0x26bc, 0x2011, 0x0201, - 0x0078, 0x26bc, 0x2011, 0x0101, 0x20a9, 0x0009, 0x810b, 0x00f0, - 0x26be, 0xa18c, 0x0e00, 0x2204, 0xa084, 0xf1ff, 0xa105, 0x2012, - 0x007c, 0x2019, 0x0002, 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x0040, - 0x26d6, 0x8319, 0x2009, 0x0101, 0x0078, 0x26d8, 0x2009, 0x0101, - 0x20a9, 0x0005, 0x8213, 0x00f0, 0x26da, 0xa294, 0x00e0, 0x2104, - 0xa084, 0xff1f, 0xa205, 0x200a, 0x8319, 0x0040, 0x26eb, 0x2009, - 0x0201, 0x0078, 0x26d8, 0x007c, 0xd3fc, 0x00c0, 0x26ff, 0x007e, - 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x26fb, 0x2011, - 0x0101, 0x0078, 0x2701, 0x2011, 0x0201, 0x0078, 0x2701, 0x2011, - 0x0101, 0x20a9, 0x000c, 0x810b, 0x00f0, 0x2703, 0xa18c, 0xf000, - 0x2204, 0xa084, 0x0fff, 0xa105, 0x2012, 0x007c, 0xd3fc, 0x00c0, - 0x2721, 0x007e, 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x007f, 0x0040, - 0x271d, 0x2011, 0x0102, 0x0078, 0x2723, 0x2011, 0x0202, 0x0078, - 0x2723, 0x2011, 0x0102, 0x2204, 0xa084, 0xffcf, 0xa105, 0x2012, - 0x007c, 0x0c7e, 0xd1bc, 0x00c0, 0x273d, 0x007e, 0x2001, 0x4a04, - 0x2004, 0xd0ec, 0x007f, 0x0040, 0x2739, 0x2061, 0x0100, 0x0078, - 0x273f, 0x2061, 0x0200, 0x0078, 0x273f, 0x2061, 0x0100, 0xc1bc, - 0x8103, 0x8003, 0xa080, 0x0020, 0x609a, 0x62ac, 0x63ac, 0x0c7f, - 0x007c, 0x0c7e, 0xd1bc, 0x00c0, 0x275d, 0x007e, 0x2001, 0x4a04, - 0x2004, 0xd0ec, 0x007f, 0x0040, 0x2759, 0x2061, 0x0100, 0x0078, - 0x275f, 0x2061, 0x0200, 0x0078, 0x275f, 0x2061, 0x0100, 0xc1bc, - 0x8103, 0x8003, 0xa080, 0x0022, 0x609a, 0x60a4, 0xa084, 0xffdf, - 0x60ae, 0x0c7f, 0x007c, 0x0c7e, 0xd1bc, 0x00c0, 0x277f, 0x007e, - 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x277b, 0x2061, - 0x0100, 0x0078, 0x2781, 0x2061, 0x0200, 0x0078, 0x2781, 0x2061, - 0x0100, 0xc1bc, 0x8103, 0x8003, 0xa080, 0x0022, 0x609a, 0x60a4, - 0xa085, 0x0020, 0x60ae, 0x0c7f, 0x007c, 0x0c7e, 0xd1bc, 0x00c0, - 0x27a1, 0x007e, 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x007f, 0x0040, - 0x279d, 0x2061, 0x0100, 0x0078, 0x27a3, 0x2061, 0x0200, 0x0078, - 0x27a3, 0x2061, 0x0100, 0xc1bc, 0x8103, 0x8003, 0xa080, 0x0020, - 0x609a, 0x60a4, 0xa28c, 0x0020, 0x0040, 0x27b1, 0xc2ac, 0xa39d, - 0x4000, 0xc3fc, 0xd3b4, 0x00c0, 0x27b6, 0xc3fd, 0x62ae, 0x2010, - 0x60a4, 0x63ae, 0x2018, 0x0c7f, 0x007c, 0x2091, 0x8000, 0x0c7e, - 0x0e7e, 0x6818, 0xa005, 0x0040, 0x281b, 0xd1fc, 0x0040, 0x27cc, - 0x2061, 0x91d0, 0x0078, 0x27ce, 0x2061, 0x90c0, 0x1078, 0x2823, - 0x0040, 0x2801, 0x20a9, 0x0101, 0xd1fc, 0x0040, 0x27db, 0x2061, - 0x90d0, 0x0078, 0x27dd, 0x2061, 0x8fc0, 0x0c7e, 0x1078, 0x2823, - 0x0040, 0x27e8, 0x0c7f, 0x8c60, 0x00f0, 0x27dd, 0x0078, 0x281b, - 0x007f, 0xd1fc, 0x0040, 0x27f2, 0xa082, 0x90d0, 0x2071, 0x4a80, - 0x0078, 0x27f6, 0xa082, 0x8fc0, 0x2071, 0x4a40, 0x707a, 0x7176, - 0x2001, 0x0004, 0x7066, 0x7083, 0x000f, 0x1078, 0x25d1, 0x0078, - 0x2817, 0xd1fc, 0x00c0, 0x2808, 0x2071, 0x4a40, 0x0078, 0x280a, - 0x2071, 0x4a80, 0x6020, 0xc0dd, 0x6022, 0x7176, 0x2c00, 0x707e, - 0x2001, 0x0006, 0x7066, 0x7083, 0x000f, 0x1078, 0x25d1, 0x2001, - 0x0000, 0x0078, 0x281d, 0x2001, 0x0001, 0x2091, 0x8001, 0xa005, - 0x0e7f, 0x0c7f, 0x007c, 0x2c04, 0xa005, 0x0040, 0x283a, 0x2060, - 0x6010, 0xa306, 0x00c0, 0x2837, 0x600c, 0xa206, 0x00c0, 0x2837, - 0x6014, 0xa106, 0x00c0, 0x2837, 0xa006, 0x0078, 0x283c, 0x6000, - 0x0078, 0x2824, 0xa085, 0x0001, 0x007c, 0x0f7e, 0x0e7e, 0x017e, - 0xd1bc, 0x00c0, 0x2855, 0x2079, 0x4a40, 0x007e, 0x2001, 0x4a04, - 0x2004, 0xd0ec, 0x007f, 0x0040, 0x2851, 0x2071, 0x0100, 0x0078, - 0x2859, 0x2071, 0x0200, 0x0078, 0x2859, 0x2079, 0x4a80, 0x2071, - 0x0100, 0x7920, 0xa18c, 0x000f, 0x70ec, 0xd0c4, 0x00c0, 0x2863, - 0x017f, 0x0078, 0x287e, 0x810b, 0x810b, 0x810b, 0x810b, 0x007f, - 0xd0bc, 0x00c0, 0x287b, 0x007e, 0x2001, 0x4a04, 0x2004, 0xd0ec, - 0x007f, 0x0040, 0x2877, 0xa18d, 0x0f00, 0x0078, 0x287d, 0xa18d, - 0x0f00, 0x0078, 0x287d, 0xa18d, 0x0800, 0x2104, 0x0e7f, 0x0f7f, - 0x007c, 0x0e7e, 0x2001, 0x4a01, 0x2004, 0xd0ac, 0x00c0, 0x28ea, - 0x68e4, 0xd0ac, 0x0040, 0x28ea, 0xa084, 0x0006, 0x00c0, 0x28ea, - 0x6014, 0xd0fc, 0x00c0, 0x2898, 0x2071, 0x4ec0, 0x0078, 0x289a, - 0x2071, 0x4f40, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, - 0xae70, 0x7004, 0xa084, 0x000a, 0x00c0, 0x28ea, 0x7108, 0xa194, - 0xff00, 0x0040, 0x28ea, 0xa18c, 0x00ff, 0x2001, 0x000a, 0xa106, - 0x0040, 0x28cd, 0x2001, 0x000c, 0xa106, 0x0040, 0x28d1, 0x2001, - 0x0012, 0xa106, 0x0040, 0x28d5, 0x2001, 0x0014, 0xa106, 0x0040, - 0x28d9, 0x2001, 0x0019, 0xa106, 0x0040, 0x28dd, 0x2001, 0x0032, - 0xa106, 0x0040, 0x28e1, 0x0078, 0x28e5, 0x2009, 0x000c, 0x0078, - 0x28e7, 0x2009, 0x0012, 0x0078, 0x28e7, 0x2009, 0x0014, 0x0078, - 0x28e7, 0x2009, 0x0019, 0x0078, 0x28e7, 0x2009, 0x0020, 0x0078, - 0x28e7, 0x2009, 0x003f, 0x0078, 0x28e7, 0x2011, 0x0000, 0x2100, - 0xa205, 0x700a, 0x0e7f, 0x007c, 0x0068, 0x28ec, 0x2091, 0x8000, - 0x2071, 0x0000, 0x007e, 0x7018, 0xd084, 0x00c0, 0x28f3, 0x007f, + 0x2091, 0x4080, 0x1078, 0x2026, 0x0068, 0x2522, 0x786c, 0xa065, + 0x00c0, 0x2500, 0x007c, 0x1078, 0x2537, 0x00c0, 0x255a, 0x786c, + 0xa065, 0x00c0, 0x2500, 0x0078, 0x255a, 0x1078, 0x2537, 0x00c0, + 0x255a, 0x786c, 0xa065, 0x00c0, 0x252d, 0x0078, 0x255a, 0x6084, + 0xa086, 0x0103, 0x00c0, 0x254b, 0x6018, 0xc0fc, 0x601a, 0xa086, + 0x0004, 0x00c0, 0x254b, 0x7804, 0xd0a4, 0x0040, 0x254b, 0x1078, + 0x2026, 0xa006, 0x007c, 0x1078, 0x2560, 0x00c0, 0x2552, 0xa085, + 0x0001, 0x007c, 0x1078, 0x256f, 0x00c0, 0x2558, 0x2041, 0x0001, + 0x7d10, 0x007c, 0x88ff, 0x0040, 0x255f, 0x2091, 0x4080, 0x007c, + 0x7b90, 0x7994, 0x70d4, 0xa102, 0x00c0, 0x2569, 0xa385, 0x0000, + 0x007c, 0x0048, 0x256d, 0xa302, 0x007c, 0x8002, 0x007c, 0x7810, + 0xd0ec, 0x0040, 0x2587, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x0020, + 0x7004, 0xa005, 0x00c0, 0x2584, 0x7008, 0x0e7f, 0xa086, 0x0008, + 0x0040, 0x2587, 0x0078, 0x25d8, 0x0e7f, 0x0078, 0x25d8, 0xa184, + 0xff00, 0x0040, 0x2594, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, + 0x8007, 0xa100, 0x0078, 0x2597, 0x8107, 0x8004, 0x8004, 0x7a9c, + 0x7b98, 0x7ca4, 0x7da0, 0xa210, 0xa006, 0xa319, 0xa421, 0xa529, + 0x2009, 0x0018, 0x6028, 0xa005, 0x0040, 0x25a8, 0x2009, 0x0040, + 0x1078, 0x1d5b, 0x0040, 0x25ca, 0x78a8, 0x8000, 0x78aa, 0xd08c, + 0x00c0, 0x25d8, 0x6014, 0xd0fc, 0x00c0, 0x25ba, 0x2069, 0x4d40, + 0x0078, 0x25bc, 0x2069, 0x4d80, 0x2091, 0x8000, 0x681f, 0x0003, + 0x78ab, 0x0000, 0x78ac, 0xa085, 0x0300, 0x78ae, 0x2091, 0x8001, + 0x0078, 0x25d8, 0x78ab, 0x0000, 0x1078, 0x2026, 0x7990, 0x7894, + 0x8000, 0xa10a, 0x00c8, 0x25d5, 0xa006, 0x7896, 0x70d6, 0xa006, + 0x2071, 0x0010, 0x2091, 0x8001, 0x007c, 0x2138, 0xd7fc, 0x00c0, + 0x25e5, 0x2009, 0x4d59, 0x0078, 0x25e7, 0x2009, 0x4d99, 0x2091, + 0x8000, 0x200a, 0x0f7e, 0xd7fc, 0x00c0, 0x25fe, 0x2009, 0x4d40, + 0x2001, 0x4d04, 0x2004, 0xd0ec, 0x0040, 0x25fa, 0x2079, 0x0100, + 0x0078, 0x2602, 0x2079, 0x0200, 0x0078, 0x2602, 0x2009, 0x4d80, + 0x2079, 0x0100, 0x2104, 0xa086, 0x0000, 0x00c0, 0x261b, 0xd7fc, + 0x00c0, 0x260e, 0x2009, 0x4d45, 0x0078, 0x2610, 0x2009, 0x4d85, + 0x2104, 0xa005, 0x00c0, 0x261b, 0x7830, 0xa084, 0x00c0, 0x00c0, + 0x261b, 0x781b, 0x0045, 0x0f7f, 0x007c, 0x2009, 0x0002, 0x2069, + 0x4d00, 0x6810, 0xd0ec, 0x00c0, 0x267e, 0x2071, 0x4d80, 0x2079, + 0x0100, 0x2021, 0x4fbf, 0x784b, 0x000f, 0x2019, 0x43d2, 0xd184, + 0x0040, 0x263e, 0x6810, 0xd0ec, 0x0040, 0x263a, 0x20a1, 0x012b, + 0x0078, 0x2640, 0x20a1, 0x022b, 0x0078, 0x2640, 0x20a1, 0x012b, + 0x2304, 0xa005, 0x0040, 0x264d, 0x789a, 0x8318, 0x23ac, 0x8318, + 0x2398, 0x53a6, 0x3318, 0x0078, 0x2640, 0x789b, 0x0020, 0x20a9, + 0x0010, 0x78af, 0x0000, 0x78af, 0x8020, 0x00f0, 0x2651, 0x7003, + 0x0000, 0x017e, 0xd18c, 0x2009, 0x0000, 0x0040, 0x2660, 0xc1bd, + 0x1078, 0x2849, 0x017f, 0x7020, 0xa084, 0x000f, 0x007e, 0x6814, + 0xd0e4, 0x007f, 0x00c0, 0x2670, 0xa085, 0x6340, 0x0078, 0x2672, + 0xa085, 0x62c0, 0x7806, 0x780f, 0x9200, 0x7843, 0x00d8, 0x7853, + 0x0080, 0x780b, 0x0008, 0x7456, 0x7053, 0x0000, 0x8109, 0x0040, + 0x2691, 0x2071, 0x4d40, 0x6810, 0xd0ec, 0x0040, 0x268b, 0x2079, + 0x0100, 0x0078, 0x268d, 0x2079, 0x0200, 0x2021, 0x4dbf, 0x0078, + 0x262b, 0x007c, 0x017e, 0xd1bc, 0x00c0, 0x26a6, 0x007e, 0x2001, + 0x4d04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x26a2, 0x2011, 0x0101, + 0x0078, 0x26a8, 0x2011, 0x0201, 0x0078, 0x26a8, 0x2011, 0x0101, + 0xa18c, 0x000f, 0x2204, 0xa084, 0xfff0, 0xa105, 0x2012, 0x017f, + 0x1078, 0x2849, 0x007c, 0xd3fc, 0x00c0, 0x26c6, 0x007e, 0x2001, + 0x4d04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x26c2, 0x2011, 0x0101, + 0x0078, 0x26c8, 0x2011, 0x0201, 0x0078, 0x26c8, 0x2011, 0x0101, + 0x20a9, 0x0009, 0x810b, 0x00f0, 0x26ca, 0xa18c, 0x0e00, 0x2204, + 0xa084, 0xf1ff, 0xa105, 0x2012, 0x007c, 0x2019, 0x0002, 0x2001, + 0x4d04, 0x2004, 0xd0ec, 0x0040, 0x26e2, 0x8319, 0x2009, 0x0101, + 0x0078, 0x26e4, 0x2009, 0x0101, 0x20a9, 0x0005, 0x8213, 0x00f0, + 0x26e6, 0xa294, 0x00e0, 0x2104, 0xa084, 0xff1f, 0xa205, 0x200a, + 0x8319, 0x0040, 0x26f7, 0x2009, 0x0201, 0x0078, 0x26e4, 0x007c, + 0xd3fc, 0x00c0, 0x270b, 0x007e, 0x2001, 0x4d04, 0x2004, 0xd0ec, + 0x007f, 0x0040, 0x2707, 0x2011, 0x0101, 0x0078, 0x270d, 0x2011, + 0x0201, 0x0078, 0x270d, 0x2011, 0x0101, 0x20a9, 0x000c, 0x810b, + 0x00f0, 0x270f, 0xa18c, 0xf000, 0x2204, 0xa084, 0x0fff, 0xa105, + 0x2012, 0x007c, 0xd3fc, 0x00c0, 0x272d, 0x007e, 0x2001, 0x4d04, + 0x2004, 0xd0ec, 0x007f, 0x0040, 0x2729, 0x2011, 0x0102, 0x0078, + 0x272f, 0x2011, 0x0202, 0x0078, 0x272f, 0x2011, 0x0102, 0x2204, + 0xa084, 0xffcf, 0xa105, 0x2012, 0x007c, 0x0c7e, 0xd1bc, 0x00c0, + 0x2749, 0x007e, 0x2001, 0x4d04, 0x2004, 0xd0ec, 0x007f, 0x0040, + 0x2745, 0x2061, 0x0100, 0x0078, 0x274b, 0x2061, 0x0200, 0x0078, + 0x274b, 0x2061, 0x0100, 0xc1bc, 0x8103, 0x8003, 0xa080, 0x0020, + 0x609a, 0x62ac, 0x63ac, 0x0c7f, 0x007c, 0x0c7e, 0xd1bc, 0x00c0, + 0x2769, 0x007e, 0x2001, 0x4d04, 0x2004, 0xd0ec, 0x007f, 0x0040, + 0x2765, 0x2061, 0x0100, 0x0078, 0x276b, 0x2061, 0x0200, 0x0078, + 0x276b, 0x2061, 0x0100, 0xc1bc, 0x8103, 0x8003, 0xa080, 0x0022, + 0x609a, 0x60a4, 0xa084, 0xffdf, 0x60ae, 0x0c7f, 0x007c, 0x0c7e, + 0xd1bc, 0x00c0, 0x278b, 0x007e, 0x2001, 0x4d04, 0x2004, 0xd0ec, + 0x007f, 0x0040, 0x2787, 0x2061, 0x0100, 0x0078, 0x278d, 0x2061, + 0x0200, 0x0078, 0x278d, 0x2061, 0x0100, 0xc1bc, 0x8103, 0x8003, + 0xa080, 0x0022, 0x609a, 0x60a4, 0xa085, 0x0020, 0x60ae, 0x0c7f, + 0x007c, 0x0c7e, 0xd1bc, 0x00c0, 0x27ad, 0x007e, 0x2001, 0x4d04, + 0x2004, 0xd0ec, 0x007f, 0x0040, 0x27a9, 0x2061, 0x0100, 0x0078, + 0x27af, 0x2061, 0x0200, 0x0078, 0x27af, 0x2061, 0x0100, 0xc1bc, + 0x8103, 0x8003, 0xa080, 0x0020, 0x609a, 0x60a4, 0xa28c, 0x0020, + 0x0040, 0x27bd, 0xc2ac, 0xa39d, 0x4000, 0xc3fc, 0xd3b4, 0x00c0, + 0x27c2, 0xc3fd, 0x62ae, 0x2010, 0x60a4, 0x63ae, 0x2018, 0x0c7f, + 0x007c, 0x2091, 0x8000, 0x0c7e, 0x0e7e, 0x6818, 0xa005, 0x0040, + 0x2827, 0xd1fc, 0x0040, 0x27d8, 0x2061, 0x94d0, 0x0078, 0x27da, + 0x2061, 0x93c0, 0x1078, 0x282f, 0x0040, 0x280d, 0x20a9, 0x0101, + 0xd1fc, 0x0040, 0x27e7, 0x2061, 0x93d0, 0x0078, 0x27e9, 0x2061, + 0x92c0, 0x0c7e, 0x1078, 0x282f, 0x0040, 0x27f4, 0x0c7f, 0x8c60, + 0x00f0, 0x27e9, 0x0078, 0x2827, 0x007f, 0xd1fc, 0x0040, 0x27fe, + 0xa082, 0x93d0, 0x2071, 0x4d80, 0x0078, 0x2802, 0xa082, 0x92c0, + 0x2071, 0x4d40, 0x707a, 0x7176, 0x2001, 0x0004, 0x7066, 0x7083, + 0x000f, 0x1078, 0x25dd, 0x0078, 0x2823, 0xd1fc, 0x00c0, 0x2814, + 0x2071, 0x4d40, 0x0078, 0x2816, 0x2071, 0x4d80, 0x6020, 0xc0dd, + 0x6022, 0x7176, 0x2c00, 0x707e, 0x2001, 0x0006, 0x7066, 0x7083, + 0x000f, 0x1078, 0x25dd, 0x2001, 0x0000, 0x0078, 0x2829, 0x2001, + 0x0001, 0x2091, 0x8001, 0xa005, 0x0e7f, 0x0c7f, 0x007c, 0x2c04, + 0xa005, 0x0040, 0x2846, 0x2060, 0x6010, 0xa306, 0x00c0, 0x2843, + 0x600c, 0xa206, 0x00c0, 0x2843, 0x6014, 0xa106, 0x00c0, 0x2843, + 0xa006, 0x0078, 0x2848, 0x6000, 0x0078, 0x2830, 0xa085, 0x0001, + 0x007c, 0x0f7e, 0x0e7e, 0x017e, 0xd1bc, 0x00c0, 0x2861, 0x2079, + 0x4d40, 0x007e, 0x2001, 0x4d04, 0x2004, 0xd0ec, 0x007f, 0x0040, + 0x285d, 0x2071, 0x0100, 0x0078, 0x2865, 0x2071, 0x0200, 0x0078, + 0x2865, 0x2079, 0x4d80, 0x2071, 0x0100, 0x7920, 0xa18c, 0x000f, + 0x70ec, 0xd0c4, 0x00c0, 0x286f, 0x017f, 0x0078, 0x288a, 0x810b, + 0x810b, 0x810b, 0x810b, 0x007f, 0xd0bc, 0x00c0, 0x2887, 0x007e, + 0x2001, 0x4d04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x2883, 0xa18d, + 0x0f00, 0x0078, 0x2889, 0xa18d, 0x0f00, 0x0078, 0x2889, 0xa18d, + 0x0800, 0x2104, 0x0e7f, 0x0f7f, 0x007c, 0x0e7e, 0x2001, 0x4d01, + 0x2004, 0xd0ac, 0x00c0, 0x290a, 0x68e4, 0xd0ac, 0x0040, 0x290a, + 0xa084, 0x0006, 0x00c0, 0x290a, 0x6014, 0xd0fc, 0x00c0, 0x28a4, + 0x2071, 0x51c0, 0x0078, 0x28a6, 0x2071, 0x5240, 0x8007, 0xa084, + 0x000f, 0x8003, 0x8003, 0x8003, 0xae70, 0x7004, 0xa084, 0x000a, + 0x00c0, 0x290a, 0x7108, 0xa194, 0xff00, 0x0040, 0x290a, 0xa18c, + 0x00ff, 0x2001, 0x000a, 0xa106, 0x0040, 0x28d9, 0x2001, 0x000c, + 0xa106, 0x0040, 0x28dd, 0x2001, 0x0012, 0xa106, 0x0040, 0x28e1, + 0x2001, 0x0014, 0xa106, 0x0040, 0x28e5, 0x2001, 0x0019, 0xa106, + 0x0040, 0x28e9, 0x2001, 0x0032, 0xa106, 0x0040, 0x28ed, 0x0078, + 0x28f1, 0x2009, 0x000c, 0x0078, 0x28f3, 0x2009, 0x0012, 0x0078, + 0x28f3, 0x2009, 0x0014, 0x0078, 0x28f3, 0x2009, 0x0019, 0x0078, + 0x28f3, 0x2009, 0x0020, 0x0078, 0x28f3, 0x2009, 0x003f, 0x0078, + 0x28f3, 0x2011, 0x0000, 0x2100, 0xa205, 0x700a, 0x2071, 0x4d00, + 0x7004, 0xd0bc, 0x0040, 0x290a, 0x6014, 0xd0fc, 0x00c0, 0x2905, + 0x70ea, 0x2071, 0x4d40, 0x0078, 0x2908, 0x70ee, 0x2071, 0x4d80, + 0x701f, 0x800f, 0x0e7f, 0x007c, 0x0068, 0x290c, 0x2091, 0x8000, + 0x2071, 0x0000, 0x007e, 0x7018, 0xd084, 0x00c0, 0x2913, 0x007f, 0x2071, 0x0010, 0x70ca, 0x007f, 0x70c6, 0x70c3, 0x8002, 0x70db, - 0x0809, 0x70df, 0x0000, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, - 0x4080, 0x0078, 0x2909, 0x7f3c, 0x7e58, 0x7c30, 0x7d38, 0x78a0, + 0x080d, 0x70df, 0x0008, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, + 0x4080, 0x0078, 0x2929, 0x7f3c, 0x7e58, 0x7c30, 0x7d38, 0x78a0, 0x708e, 0x7592, 0x7496, 0x769a, 0x779e, 0xa594, 0x003f, 0xd4f4, - 0x0040, 0x2920, 0xa784, 0x007d, 0x00c0, 0x417b, 0x1078, 0x28ec, - 0xa49c, 0x000f, 0xa382, 0x0004, 0x0050, 0x292b, 0xa3a6, 0x0007, - 0x00c0, 0x28ec, 0x2418, 0x8507, 0xa084, 0x000f, 0x0079, 0x2930, - 0x2f45, 0x3035, 0x3060, 0x32c1, 0x363b, 0x36a1, 0x3741, 0x37bd, - 0x38a1, 0x398a, 0x2943, 0x2940, 0x2d2a, 0x2e43, 0x360e, 0x2940, - 0x1078, 0x28ec, 0x007c, 0xa006, 0x0078, 0x294d, 0x7808, 0xc08d, + 0x0040, 0x2940, 0xa784, 0x007d, 0x00c0, 0x4348, 0x1078, 0x290c, + 0xa49c, 0x000f, 0xa382, 0x0004, 0x0050, 0x294b, 0xa3a6, 0x0007, + 0x00c0, 0x290c, 0x2418, 0x8507, 0xa084, 0x000f, 0x0079, 0x2950, + 0x2fc6, 0x30b5, 0x30e0, 0x3341, 0x372a, 0x379f, 0x3853, 0x38cf, + 0x39bd, 0x3aac, 0x2963, 0x2960, 0x2d99, 0x2eba, 0x36fb, 0x2960, + 0x1078, 0x290c, 0x007c, 0xa006, 0x0078, 0x296d, 0x7808, 0xc08d, 0x780a, 0xa006, 0x7002, 0x704e, 0x7046, 0x70d2, 0x7060, 0xa005, - 0x00c0, 0x2a64, 0x7064, 0xa084, 0x0007, 0x0079, 0x2957, 0x295f, - 0x29cf, 0x29d8, 0x29e3, 0x29ee, 0x2a4a, 0x29f9, 0x29cf, 0x7830, - 0xd0bc, 0x00c0, 0x2942, 0x71d4, 0xd1b4, 0x00c0, 0x29ac, 0x70a4, - 0xa086, 0x0001, 0x0040, 0x2942, 0x70b4, 0xa06d, 0x6800, 0xa065, - 0xa055, 0x789b, 0x0010, 0x6b0c, 0x7baa, 0x6808, 0xa045, 0x6d10, - 0x6804, 0xa06d, 0xa05d, 0xa886, 0x0001, 0x0040, 0x2982, 0x69bc, - 0x7daa, 0x79aa, 0x68c0, 0xa04d, 0x6e1c, 0x2001, 0x0010, 0x0078, - 0x2bbd, 0x7060, 0xa005, 0x00c0, 0x2942, 0x0c7e, 0x0d7e, 0x70b4, + 0x00c0, 0x2ad3, 0x7064, 0xa084, 0x0007, 0x0079, 0x2977, 0x297f, + 0x29f2, 0x29fb, 0x2a06, 0x2a11, 0x2ab9, 0x2a1c, 0x29f2, 0x7830, + 0xd0bc, 0x00c0, 0x2962, 0x71d4, 0xd1bc, 0x00c0, 0x2962, 0xd1b4, + 0x00c0, 0x29cf, 0x70a4, 0xa086, 0x0001, 0x0040, 0x2962, 0x70b4, 0xa06d, 0x6800, 0xa065, 0xa055, 0x789b, 0x0010, 0x6b0c, 0x7baa, 0x6808, 0xa045, 0x6d10, 0x6804, 0xa06d, 0xa05d, 0xa886, 0x0001, 0x0040, 0x29a5, 0x69bc, 0x7daa, 0x79aa, 0x68c0, 0xa04d, 0x6e1c, - 0x2001, 0x0020, 0x0078, 0x2bbd, 0x1078, 0x411c, 0x00c0, 0x2942, - 0x781b, 0x005b, 0x70bc, 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6, - 0x78de, 0x6898, 0x78d2, 0x78da, 0x7808, 0xc08d, 0x780a, 0x68bc, - 0x7042, 0xc1b4, 0x71d6, 0x70b8, 0xa065, 0x68c0, 0x705a, 0x7003, - 0x0002, 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, 0x007c, 0x1078, - 0x411c, 0x00c0, 0x29d7, 0x781b, 0x0047, 0x7003, 0x0004, 0x007c, - 0x1078, 0x411c, 0x00c0, 0x29e2, 0x2011, 0x000c, 0x1078, 0x2a09, - 0x7003, 0x0004, 0x007c, 0x1078, 0x411c, 0x00c0, 0x29ed, 0x2011, - 0x0006, 0x1078, 0x2a09, 0x7003, 0x0004, 0x007c, 0x1078, 0x411c, - 0x00c0, 0x29f8, 0x2011, 0x000d, 0x1078, 0x2a09, 0x7003, 0x0004, - 0x007c, 0x1078, 0x411c, 0x00c0, 0x2a08, 0x2011, 0x0006, 0x1078, - 0x2a09, 0x707c, 0x707f, 0x0000, 0x2068, 0x704e, 0x7003, 0x0001, - 0x007c, 0x7174, 0xc1fc, 0x8107, 0x7882, 0x789b, 0x0010, 0xa286, - 0x000c, 0x00c0, 0x2a18, 0x7aaa, 0x2001, 0x0001, 0x0078, 0x2a2d, - 0xa18c, 0x001f, 0xa18d, 0x00c0, 0x79aa, 0xa286, 0x000d, 0x0040, - 0x2a26, 0x7aaa, 0x2001, 0x0002, 0x0078, 0x2a2d, 0x78ab, 0x0020, - 0x7178, 0x79aa, 0x7aaa, 0x2001, 0x0004, 0x789b, 0x0060, 0x78aa, - 0x785b, 0x0004, 0x781b, 0x0108, 0x1078, 0x4131, 0x7083, 0x000f, - 0x70d4, 0xd0b4, 0x0040, 0x2a49, 0xc0b4, 0x70d6, 0x0c7e, 0x70b8, - 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, - 0x0c7f, 0x007c, 0x1078, 0x411c, 0x00c0, 0x2942, 0x707c, 0x2068, - 0x7774, 0x1078, 0x3fe1, 0x2c50, 0x1078, 0x41f0, 0x789b, 0x0010, - 0x6814, 0xa084, 0x001f, 0xc0bd, 0x78aa, 0x6e1c, 0x2041, 0x0001, - 0x2001, 0x0004, 0x0078, 0x2bc3, 0x1078, 0x411c, 0x00c0, 0x2942, - 0x789b, 0x0010, 0x7060, 0x2068, 0x6f14, 0x70d4, 0xd0b4, 0x0040, - 0x2a7e, 0xc0b4, 0x70d6, 0x0c7e, 0x70b8, 0xa065, 0x6008, 0xa084, - 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x0c7f, 0x1078, 0x3fe1, - 0x2c50, 0x1078, 0x41f0, 0x6824, 0xa005, 0x0040, 0x2a8f, 0xa082, - 0x0006, 0x0048, 0x2a8d, 0x0078, 0x2a8f, 0x6827, 0x0005, 0x6814, - 0xa084, 0x001f, 0xc0bd, 0x78aa, 0x2031, 0x0020, 0x2041, 0x0001, - 0x2001, 0x0003, 0x0078, 0x2bc3, 0xc28d, 0x72d6, 0x72c0, 0xa200, - 0xa015, 0x7154, 0x8108, 0xa12a, 0x0048, 0x2aa7, 0x71c0, 0x2164, - 0x6504, 0x85ff, 0x00c0, 0x2abe, 0x7156, 0x8421, 0x00c0, 0x2aa2, - 0x70d4, 0xd08c, 0x0040, 0x2aba, 0x70d0, 0xa005, 0x00c0, 0x2aba, - 0x70d3, 0x000a, 0x007c, 0x2200, 0x0078, 0x2aac, 0x70d4, 0xc08c, - 0x70d6, 0x70d3, 0x0000, 0x603c, 0xa005, 0x00c0, 0x2abb, 0x6708, - 0xa784, 0x073f, 0x0040, 0x2aed, 0xd7d4, 0x00c0, 0x2abb, 0xa784, - 0x0021, 0x00c0, 0x2abb, 0xa784, 0x0002, 0x0040, 0x2ade, 0xa784, - 0x0004, 0x0040, 0x2abb, 0xa7bc, 0xfffb, 0x670a, 0xa784, 0x0218, - 0x00c0, 0x2abb, 0xa784, 0x0100, 0x0040, 0x2aed, 0x6018, 0xa005, - 0x00c0, 0x2abb, 0xa7bc, 0xfeff, 0x670a, 0x2568, 0x6823, 0x0000, - 0x6e1c, 0xa684, 0x000e, 0x6318, 0x0040, 0x2afe, 0x601c, 0xa302, - 0x0048, 0x2b01, 0x0040, 0x2b01, 0x0078, 0x2abb, 0x83ff, 0x00c0, - 0x2abb, 0x2d58, 0x2c50, 0x7156, 0xd7bc, 0x00c0, 0x2b09, 0x7028, - 0x6022, 0xc7bc, 0x670a, 0x68c0, 0xa065, 0xa04d, 0x6100, 0x2a60, - 0x2041, 0x0001, 0x6b14, 0xa39c, 0x001f, 0xa39d, 0x00c0, 0xd1fc, - 0x0040, 0x2b1d, 0xd684, 0x0040, 0x2b1f, 0xa39c, 0xffbf, 0xd6a4, - 0x0040, 0x2b24, 0xa39d, 0x0020, 0xa684, 0x000e, 0x00c0, 0x2b6f, - 0xc7a5, 0x670a, 0x2c00, 0x68c6, 0x77a4, 0xa786, 0x0001, 0x00c0, - 0x2b43, 0x70d4, 0xd0b4, 0x00c0, 0x2b43, 0x7000, 0xa082, 0x0002, - 0x00c8, 0x2b43, 0x7830, 0xd0bc, 0x00c0, 0x2b43, 0x789b, 0x0010, - 0x7baa, 0x0078, 0x2bbb, 0x8739, 0x77a6, 0x2750, 0x77b0, 0xa7b0, - 0x0005, 0x70ac, 0xa606, 0x00c0, 0x2b4e, 0x76a8, 0x76b2, 0x2c3a, - 0x8738, 0x2d3a, 0x8738, 0x283a, 0x8738, 0x233a, 0x8738, 0x253a, - 0x7830, 0xd0bc, 0x0040, 0x2b66, 0x2091, 0x8000, 0x2091, 0x303d, - 0x70d4, 0xa084, 0x303d, 0x2091, 0x8000, 0x2090, 0xaad5, 0x0000, - 0x0040, 0x2b6e, 0x8421, 0x2200, 0x00c0, 0x2aa1, 0x007c, 0xd1dc, - 0x0040, 0x3be5, 0x2029, 0x0020, 0xd69c, 0x00c0, 0x2b7c, 0x8528, - 0xd68c, 0x00c0, 0x2b7c, 0x8528, 0x8840, 0x6f14, 0x610c, 0x8108, - 0xa18c, 0x00ff, 0x70cc, 0xa160, 0x2c64, 0x8cff, 0x0040, 0x2b9b, - 0x6014, 0xa706, 0x00c0, 0x2b84, 0x60b8, 0x8001, 0x60ba, 0x00c0, - 0x2b7f, 0x2a60, 0x6008, 0xa085, 0x0100, 0x600a, 0x2200, 0x8421, - 0x00c0, 0x2aa1, 0x007c, 0x2a60, 0x610e, 0x69be, 0x2c00, 0x68c6, - 0x8840, 0x6008, 0xc0d5, 0x600a, 0x77a4, 0xa786, 0x0001, 0x00c0, - 0x2b43, 0x70d4, 0xd0b4, 0x00c0, 0x2b43, 0x7000, 0xa082, 0x0002, - 0x00c8, 0x2b43, 0x7830, 0xd0bc, 0x00c0, 0x2b43, 0x789b, 0x0010, - 0x7baa, 0x7daa, 0x79aa, 0x2001, 0x0002, 0x007e, 0x6018, 0x8000, - 0x601a, 0x0078, 0x2bc4, 0x007e, 0x2960, 0x6104, 0x2a60, 0xa184, - 0x0018, 0x0040, 0x2be0, 0xa184, 0x0010, 0x0040, 0x2bd3, 0x1078, - 0x3df6, 0x00c0, 0x2c05, 0xa184, 0x0008, 0x0040, 0x2be0, 0x69a0, - 0xa184, 0x0600, 0x00c0, 0x2be0, 0x1078, 0x3cda, 0x0078, 0x2c05, - 0x69a0, 0xa184, 0x1e00, 0x0040, 0x2c10, 0xa184, 0x0800, 0x0040, - 0x2bf9, 0x0c7e, 0x2960, 0x6000, 0xa085, 0x2000, 0x6002, 0x6104, - 0xa18d, 0x0010, 0x6106, 0x0c7f, 0x1078, 0x3df6, 0x00c0, 0x2c05, - 0x69a0, 0xa184, 0x0200, 0x0040, 0x2c01, 0x1078, 0x3d3a, 0x0078, - 0x2c05, 0xa184, 0x0400, 0x00c0, 0x2bdc, 0x69a0, 0xa184, 0x1000, - 0x0040, 0x2c10, 0x6914, 0xa18c, 0xff00, 0x810f, 0x1078, 0x2749, - 0x027f, 0xa68c, 0x00e0, 0xa684, 0x0060, 0x0040, 0x2c1d, 0xa086, - 0x0060, 0x00c0, 0x2c1d, 0xa18d, 0x4000, 0xa18d, 0x0104, 0x69b6, - 0x789b, 0x0060, 0x2800, 0x78aa, 0x6818, 0xc0fd, 0x681a, 0xd6bc, - 0x0040, 0x2c38, 0xc0fc, 0x7087, 0x0000, 0xa08a, 0x000d, 0x0050, - 0x2c36, 0xa08a, 0x000c, 0x7186, 0x2001, 0x000c, 0x800c, 0x718a, - 0x78aa, 0x3518, 0x3340, 0x3428, 0x8000, 0x80ac, 0xaf80, 0x002b, - 0x20a0, 0x789b, 0x0000, 0xad80, 0x000b, 0x2098, 0x53a6, 0x23a8, - 0x2898, 0x25a0, 0xa286, 0x0020, 0x00c0, 0x2c70, 0x70d4, 0xc0b5, - 0x70d6, 0x2c00, 0x70ba, 0x2d00, 0x70be, 0x6814, 0xc0fc, 0x8007, - 0x7882, 0xa286, 0x0002, 0x0040, 0x2ca6, 0x70a4, 0x8000, 0x70a6, - 0x74b4, 0xa498, 0x0005, 0x70ac, 0xa306, 0x00c0, 0x2c68, 0x73a8, - 0x73b6, 0xa286, 0x0010, 0x0040, 0x2942, 0x0d7f, 0x0c7f, 0x007c, - 0x7000, 0xa005, 0x00c0, 0x2c4e, 0xa286, 0x0002, 0x00c0, 0x2cc0, - 0x1078, 0x411c, 0x00c0, 0x2c4e, 0x6814, 0xc0fc, 0x8007, 0x7882, - 0x2091, 0x8000, 0x781b, 0x005b, 0x68b4, 0x785a, 0x6894, 0x78d6, - 0x78de, 0x6898, 0x78d2, 0x78da, 0x2091, 0x8001, 0x7808, 0xc08d, - 0x780a, 0x127e, 0x0d7e, 0x0c7e, 0x70d4, 0xa084, 0x2700, 0x2090, - 0x0c7f, 0x0d7f, 0x127f, 0x2900, 0x705a, 0x68bc, 0x7042, 0x7003, - 0x0002, 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, 0x7830, 0xd0bc, - 0x0040, 0x2cb2, 0x2091, 0x303d, 0x70d4, 0xa084, 0x303d, 0x2091, - 0x8000, 0x2090, 0x70a4, 0xa005, 0x00c0, 0x2cb7, 0x007c, 0x8421, - 0x0040, 0x2cb6, 0x7250, 0x70c0, 0xa200, 0xa015, 0x0078, 0x2aa1, - 0xa286, 0x0010, 0x00c0, 0x2cf1, 0x1078, 0x411c, 0x00c0, 0x2c4e, - 0x6814, 0xc0fc, 0x8007, 0x7882, 0x781b, 0x005b, 0x68b4, 0x785a, - 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0x7808, 0xc08d, - 0x780a, 0x70a4, 0x8000, 0x70a6, 0x74b4, 0xa490, 0x0005, 0x70ac, - 0xa206, 0x00c0, 0x2ce4, 0x72a8, 0x72b6, 0x2900, 0x705a, 0x68bc, - 0x7042, 0x7003, 0x0002, 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, - 0x007c, 0x6bb4, 0xa39d, 0x2000, 0x7b5a, 0x6814, 0xc0fc, 0x8007, - 0x7882, 0x6b94, 0x7bd6, 0x7bde, 0x6e98, 0x7ed2, 0x7eda, 0x781b, - 0x005b, 0x2900, 0x705a, 0x7202, 0x7808, 0xc08d, 0x780a, 0x2300, - 0xa605, 0x0040, 0x2d1c, 0x70d4, 0xa084, 0x2700, 0xa086, 0x2300, - 0x00c0, 0x2d16, 0x2009, 0x0000, 0x0078, 0x2d18, 0x2009, 0x0001, - 0xa284, 0x000f, 0x1079, 0x2d20, 0xad80, 0x0009, 0x7046, 0x007c, - 0x2d28, 0x45f7, 0x45f7, 0x45e4, 0x45f7, 0x2d28, 0x2d28, 0x2d28, - 0x1078, 0x28ec, 0x7808, 0xa084, 0xfffd, 0x780a, 0x0f7e, 0x2079, - 0x4a00, 0x78ac, 0x0f7f, 0xd084, 0x0040, 0x2d4e, 0x7064, 0xa086, - 0x0001, 0x00c0, 0x2d3e, 0x7066, 0x0078, 0x2e27, 0x7064, 0xa086, - 0x0005, 0x00c0, 0x2d4c, 0x707c, 0x2068, 0x681b, 0x0004, 0x6817, - 0x0000, 0x6820, 0xc09d, 0x6822, 0x7067, 0x0000, 0x70a7, 0x0000, - 0x70a8, 0x70b2, 0x70b6, 0x70d4, 0xd0b4, 0x0040, 0x2d64, 0xc0b4, + 0x2001, 0x0010, 0x0078, 0x2c2c, 0x7060, 0xa005, 0x00c0, 0x2962, + 0x0c7e, 0x0d7e, 0x70b4, 0xa06d, 0x6800, 0xa065, 0xa055, 0x789b, + 0x0010, 0x6b0c, 0x7baa, 0x6808, 0xa045, 0x6d10, 0x6804, 0xa06d, + 0xa05d, 0xa886, 0x0001, 0x0040, 0x29c8, 0x69bc, 0x7daa, 0x79aa, + 0x68c0, 0xa04d, 0x6e1c, 0x2001, 0x0020, 0x0078, 0x2c2c, 0x1078, + 0x42e9, 0x00c0, 0x2962, 0x781b, 0x005b, 0x70bc, 0xa06d, 0x68b4, + 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0x7808, + 0xc08d, 0x780a, 0x68bc, 0x7042, 0xc1b4, 0x71d6, 0x70b8, 0xa065, + 0x68c0, 0x705a, 0x7003, 0x0002, 0x2d00, 0x704e, 0xad80, 0x0009, + 0x7046, 0x007c, 0x1078, 0x42e9, 0x00c0, 0x29fa, 0x781b, 0x0047, + 0x7003, 0x0004, 0x007c, 0x1078, 0x42e9, 0x00c0, 0x2a05, 0x2011, + 0x000c, 0x1078, 0x2a2c, 0x7003, 0x0004, 0x007c, 0x1078, 0x42e9, + 0x00c0, 0x2a10, 0x2011, 0x0006, 0x1078, 0x2a2c, 0x7003, 0x0004, + 0x007c, 0x1078, 0x42e9, 0x00c0, 0x2a1b, 0x2011, 0x000d, 0x1078, + 0x2a2c, 0x7003, 0x0004, 0x007c, 0x1078, 0x42e9, 0x00c0, 0x2a2b, + 0x2011, 0x0006, 0x1078, 0x2a2c, 0x707c, 0x707f, 0x0000, 0x2068, + 0x704e, 0x7003, 0x0001, 0x007c, 0x7174, 0xc1fc, 0x8107, 0x7882, + 0x789b, 0x0010, 0xa286, 0x000c, 0x00c0, 0x2a3b, 0x7aaa, 0x2001, + 0x0001, 0x0078, 0x2a50, 0xa18c, 0x001f, 0xa18d, 0x00c0, 0x79aa, + 0xa286, 0x000d, 0x0040, 0x2a49, 0x7aaa, 0x2001, 0x0002, 0x0078, + 0x2a50, 0x78ab, 0x0020, 0x7178, 0x79aa, 0x7aaa, 0x2001, 0x0004, + 0x789b, 0x0060, 0x78aa, 0x785b, 0x0004, 0x781b, 0x0110, 0x1078, + 0x42fe, 0x7083, 0x000f, 0x70d4, 0xd0b4, 0x0040, 0x2a6c, 0xc0b4, 0x70d6, 0x0c7e, 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, - 0x6018, 0x8001, 0x601a, 0x0c7f, 0x157e, 0x2011, 0x0004, 0x7164, - 0xa186, 0x0001, 0x0040, 0x2d7d, 0xa186, 0x0007, 0x00c0, 0x2d74, - 0x701f, 0x0005, 0x0078, 0x2d7d, 0x701f, 0x0001, 0x7067, 0x0000, - 0x70d4, 0xc0dd, 0x70d6, 0x0078, 0x2d7f, 0x7067, 0x0000, 0x2001, - 0x4a0a, 0x2004, 0xa084, 0x00ff, 0xa086, 0x0018, 0x0040, 0x2d8f, - 0x7018, 0x7016, 0xa005, 0x00c0, 0x2d8f, 0x70a7, 0x0001, 0x1078, - 0x4326, 0x20a9, 0x0010, 0x2039, 0x0000, 0x1078, 0x3edb, 0xa7b8, - 0x0100, 0x00f0, 0x2d95, 0x7000, 0x0079, 0x2d9e, 0x2dcd, 0x2db3, - 0x2db3, 0x2da8, 0x2dcd, 0x2dcd, 0x2dcd, 0x2da6, 0x1078, 0x28ec, - 0x7060, 0xa005, 0x0040, 0x2dcd, 0xad06, 0x00c0, 0x2db3, 0x6800, - 0x7062, 0x0078, 0x2dc5, 0x6820, 0xd084, 0x00c0, 0x2dc1, 0x6f14, - 0x1078, 0x3fe1, 0x6008, 0xc0d4, 0x600a, 0x1078, 0x3bb5, 0x0078, - 0x2dc5, 0x705c, 0x2060, 0x6800, 0x6002, 0x6a1a, 0x6817, 0x0000, - 0x6820, 0xc09d, 0x6822, 0x1078, 0x202a, 0xb284, 0x0400, 0x0040, - 0x2dd5, 0x2021, 0x91d0, 0x0078, 0x2dd7, 0x2021, 0x90c0, 0x1078, - 0x2e2c, 0xb284, 0x0400, 0x0040, 0x2de1, 0x2021, 0x4a98, 0x0078, - 0x2de3, 0x2021, 0x4a58, 0x1078, 0x2e2c, 0x20a9, 0x0101, 0xb284, - 0x0400, 0x0040, 0x2def, 0x2021, 0x90d0, 0x0078, 0x2df1, 0x2021, - 0x8fc0, 0x1078, 0x2e2c, 0x8420, 0x00f0, 0x2df1, 0xb284, 0x0300, - 0x0040, 0x2dfe, 0x2061, 0x4fc0, 0x0078, 0x2e00, 0x2061, 0x6fc0, - 0x2021, 0x0002, 0x20a9, 0x0100, 0x6110, 0x81ff, 0x0040, 0x2e1d, - 0x6018, 0x017e, 0x007e, 0x2011, 0x4a02, 0x220c, 0xa102, 0x2012, - 0x007f, 0x017f, 0xa102, 0x0050, 0x2e1d, 0x6012, 0x00c0, 0x2e1d, - 0x2011, 0x4a04, 0x2204, 0xc0a5, 0x2012, 0x601b, 0x0000, 0xace0, - 0x0010, 0x00f0, 0x2e04, 0x8421, 0x00c0, 0x2e02, 0x157f, 0x7003, - 0x0000, 0x704f, 0x0000, 0x007c, 0x047e, 0x2404, 0xa005, 0x0040, - 0x2e3f, 0x2068, 0x6800, 0x007e, 0x6a1a, 0x6817, 0x0000, 0x6820, - 0xc09d, 0x6822, 0x1078, 0x202a, 0x007f, 0x0078, 0x2e2e, 0x047f, - 0x2023, 0x0000, 0x007c, 0xa282, 0x0003, 0x0050, 0x2e49, 0x1078, - 0x28ec, 0x2300, 0x0079, 0x2e4c, 0x2e4f, 0x2eda, 0x2ef7, 0xa282, - 0x0002, 0x0040, 0x2e55, 0x1078, 0x28ec, 0x7064, 0x7067, 0x0000, - 0x7083, 0x0000, 0x0079, 0x2e5c, 0x2e64, 0x2e64, 0x2e66, 0x2ea6, - 0x3bf1, 0x2e64, 0x2ea6, 0x2e64, 0x1078, 0x28ec, 0x7774, 0x1078, - 0x3edb, 0x7774, 0xa7bc, 0x8f00, 0x1078, 0x3fe1, 0x6018, 0xa005, - 0x0040, 0x2e9d, 0xd7fc, 0x00c0, 0x2e79, 0x2021, 0x90c0, 0x0078, - 0x2e7b, 0x2021, 0x91d0, 0x2009, 0x0005, 0x2011, 0x0010, 0x1078, - 0x2f12, 0x0040, 0x2e9d, 0x157e, 0x20a9, 0x0101, 0xd7fc, 0x00c0, - 0x2e8d, 0x2021, 0x8fc0, 0x0078, 0x2e8f, 0x2021, 0x90d0, 0x047e, - 0x2009, 0x0005, 0x2011, 0x0010, 0x1078, 0x2f12, 0x047f, 0x0040, - 0x2e9c, 0x8420, 0x00f0, 0x2e8f, 0x157f, 0x8738, 0xa784, 0x001f, - 0x00c0, 0x2e6c, 0x0078, 0x2946, 0x0078, 0x2946, 0x7774, 0x1078, - 0x3fe1, 0x6018, 0xa005, 0x0040, 0x2ed8, 0xd7fc, 0x00c0, 0x2eb4, - 0x2021, 0x90c0, 0x0078, 0x2eb6, 0x2021, 0x91d0, 0x2009, 0x0005, - 0x2011, 0x0020, 0x1078, 0x2f12, 0x0040, 0x2ed8, 0x157e, 0x20a9, - 0x0101, 0xd7fc, 0x00c0, 0x2ec8, 0x2021, 0x8fc0, 0x0078, 0x2eca, - 0x2021, 0x90d0, 0x047e, 0x2009, 0x0005, 0x2011, 0x0020, 0x1078, - 0x2f12, 0x047f, 0x0040, 0x2ed7, 0x8420, 0x00f0, 0x2eca, 0x157f, - 0x0078, 0x2946, 0x2200, 0x0079, 0x2edd, 0x2ee0, 0x2ee2, 0x2ee2, - 0x1078, 0x28ec, 0x2009, 0x0012, 0x7064, 0xa086, 0x0002, 0x0040, - 0x2eeb, 0x2009, 0x000e, 0x6818, 0xd0fc, 0x0040, 0x2ef0, 0x691a, - 0x7067, 0x0000, 0x70d4, 0xc0dd, 0x70d6, 0x0078, 0x40c9, 0x2200, - 0x0079, 0x2efa, 0x2eff, 0x2ee2, 0x2efd, 0x1078, 0x28ec, 0x1078, - 0x4326, 0x7000, 0xa086, 0x0002, 0x00c0, 0x3b7a, 0x1078, 0x3bd2, - 0x6008, 0xa084, 0xfbef, 0x600a, 0x1078, 0x3b6b, 0x0040, 0x3b7a, - 0x0078, 0x2946, 0x2404, 0xa005, 0x0040, 0x2f41, 0x2068, 0x2d04, - 0x007e, 0x6814, 0xa706, 0x0040, 0x2f21, 0x2d20, 0x007f, 0x0078, - 0x2f13, 0x007f, 0x2022, 0x691a, 0x6817, 0x0000, 0x6820, 0xa205, - 0x6822, 0x1078, 0x202a, 0x2021, 0x4a02, 0x241c, 0x8319, 0x2322, - 0x6010, 0x8001, 0x6012, 0x00c0, 0x2f3a, 0x2021, 0x4a04, 0x2404, - 0xc0a5, 0x2022, 0x6008, 0xa084, 0xf9ef, 0x600a, 0x1078, 0x3bd2, - 0x007c, 0xa085, 0x0001, 0x0078, 0x2f40, 0x2300, 0x0079, 0x2f48, - 0x2f4d, 0x2f4b, 0x2fce, 0x1078, 0x28ec, 0x78e4, 0xa005, 0x00d0, - 0x2f84, 0x3208, 0x007e, 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x007f, - 0x0040, 0x2f5e, 0xa18c, 0x0300, 0x0078, 0x2f60, 0xa18c, 0x0400, - 0x0040, 0x2f66, 0x0018, 0x2942, 0x0078, 0x2f68, 0x0028, 0x2942, - 0x2008, 0xa084, 0x0030, 0x00c0, 0x2f70, 0x781b, 0x005b, 0x007c, - 0x78ec, 0xa084, 0x0003, 0x0040, 0x2f6d, 0x2100, 0xa084, 0x0007, - 0x0079, 0x2f7a, 0x2fae, 0x2fb8, 0x2fa3, 0x2f82, 0x4111, 0x4111, - 0x2f82, 0x2fc3, 0x1078, 0x28ec, 0x7000, 0xa086, 0x0004, 0x00c0, - 0x2f9e, 0x7064, 0xa086, 0x0002, 0x00c0, 0x2f94, 0x2011, 0x0002, - 0x2019, 0x0000, 0x0078, 0x2e43, 0x7064, 0xa086, 0x0006, 0x0040, - 0x2f8e, 0x7064, 0xa086, 0x0004, 0x0040, 0x2f8e, 0x79e4, 0x2001, - 0x0003, 0x0078, 0x3304, 0x6818, 0xd0fc, 0x0040, 0x2fa9, 0x681b, - 0x001d, 0x1078, 0x3eae, 0x781b, 0x0061, 0x007c, 0x6818, 0xd0fc, - 0x0040, 0x2fb4, 0x681b, 0x001d, 0x1078, 0x3eae, 0x0078, 0x40ed, - 0x6818, 0xd0fc, 0x0040, 0x2fbe, 0x681b, 0x001d, 0x1078, 0x3eae, - 0x781b, 0x00ef, 0x007c, 0x6818, 0xd0fc, 0x0040, 0x2fc9, 0x681b, - 0x001d, 0x1078, 0x3eae, 0x781b, 0x00bf, 0x007c, 0xa584, 0x000f, - 0x00c0, 0x2feb, 0x7000, 0x0079, 0x2fd5, 0x2946, 0x2fdd, 0x2fdf, - 0x3b7a, 0x3b7a, 0x3b7a, 0x2fdd, 0x2fdd, 0x1078, 0x28ec, 0x1078, - 0x3bd2, 0x6008, 0xa084, 0xfbef, 0x600a, 0x1078, 0x3b6b, 0x0040, - 0x3b7a, 0x0078, 0x2946, 0x78e4, 0xa005, 0x00d0, 0x2f84, 0x3208, - 0x007e, 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x2ffc, - 0xa18c, 0x0300, 0x0078, 0x2ffe, 0xa18c, 0x0400, 0x0040, 0x3004, - 0x0018, 0x2f84, 0x0078, 0x3006, 0x0028, 0x2f84, 0x2008, 0xa084, - 0x0030, 0x00c0, 0x300e, 0x781b, 0x005b, 0x007c, 0x78ec, 0xa084, - 0x0003, 0x0040, 0x300b, 0x2100, 0xa184, 0x0007, 0x0079, 0x3018, - 0x3027, 0x302b, 0x3022, 0x3020, 0x4111, 0x4111, 0x3020, 0x410b, - 0x1078, 0x28ec, 0x1078, 0x3eb6, 0x781b, 0x0061, 0x007c, 0x1078, - 0x3eb6, 0x0078, 0x40ed, 0x1078, 0x3eb6, 0x781b, 0x00ef, 0x007c, - 0x1078, 0x3eb6, 0x781b, 0x00bf, 0x007c, 0x2300, 0x0079, 0x3038, - 0x303d, 0x303b, 0x303f, 0x1078, 0x28ec, 0x0078, 0x37bd, 0x681b, - 0x0016, 0x78a3, 0x0000, 0x79e4, 0xa184, 0x0030, 0x0040, 0x37bd, - 0x78ec, 0xa084, 0x0003, 0x0040, 0x37bd, 0xa184, 0x0100, 0x0040, - 0x3043, 0xa184, 0x0007, 0x0079, 0x3055, 0x305d, 0x302b, 0x2fa3, - 0x40c9, 0x4111, 0x4111, 0x40c9, 0x410b, 0x1078, 0x40d5, 0x007c, - 0xa282, 0x0005, 0x0050, 0x3066, 0x1078, 0x28ec, 0x2300, 0x0079, - 0x3069, 0x306c, 0x328b, 0x3296, 0x2200, 0x0079, 0x306f, 0x3089, - 0x3076, 0x3089, 0x3074, 0x326e, 0x1078, 0x28ec, 0x789b, 0x0018, - 0x78a8, 0xa084, 0x00ff, 0xa082, 0x0020, 0x0048, 0x3e9d, 0xa08a, - 0x0004, 0x00c8, 0x3e9d, 0x0079, 0x3085, 0x3e9d, 0x3e9d, 0x3e9d, - 0x3e47, 0x789b, 0x0018, 0x79a8, 0xa184, 0x0080, 0x0040, 0x309a, - 0x0078, 0x3e9d, 0x7000, 0xa005, 0x00c0, 0x3090, 0x2011, 0x0004, - 0x0078, 0x3998, 0xa184, 0x00ff, 0xa08a, 0x0010, 0x00c8, 0x3e9d, - 0x0079, 0x30a2, 0x30b4, 0x30b2, 0x30c9, 0x30cd, 0x318f, 0x3e9d, - 0x3e9d, 0x3191, 0x3e9d, 0x3e9d, 0x326a, 0x326a, 0x3e9d, 0x3e9d, - 0x3e9d, 0x326c, 0x1078, 0x28ec, 0xd6e4, 0x0040, 0x30bf, 0x2001, - 0x0300, 0x8000, 0x8000, 0x783a, 0x781b, 0x00ba, 0x007c, 0x6818, - 0xd0fc, 0x0040, 0x30c7, 0x681b, 0x001d, 0x0078, 0x30b7, 0x0078, - 0x40c9, 0x681b, 0x001d, 0x0078, 0x3ea7, 0x6920, 0x6922, 0xa684, - 0x1800, 0x00c0, 0x3121, 0x6820, 0xd084, 0x00c0, 0x3127, 0x6818, - 0xa086, 0x0008, 0x00c0, 0x30de, 0x681b, 0x0000, 0xd6d4, 0x0040, - 0x318c, 0xd6bc, 0x0040, 0x311e, 0x7087, 0x0000, 0x6818, 0xa084, - 0x003f, 0xa08a, 0x000d, 0x0050, 0x311e, 0xa08a, 0x000c, 0x7186, + 0x6018, 0x8001, 0x601a, 0x0c7f, 0x007c, 0x7014, 0xa005, 0x00c0, + 0x2a7b, 0x70d4, 0xd0b4, 0x0040, 0x2a7c, 0x70b8, 0xac06, 0x00c0, + 0x2a7c, 0x1078, 0x2a5b, 0x007c, 0x017e, 0x71a4, 0xa186, 0x0001, + 0x0040, 0x2aae, 0x0d7e, 0x027e, 0x2100, 0x2011, 0x0001, 0xa212, + 0x70b4, 0x2068, 0x6800, 0xac06, 0x0040, 0x2a95, 0x8211, 0x0040, + 0x2aac, 0x1078, 0x2ab0, 0x0078, 0x2a8a, 0x0c7e, 0x2100, 0x2011, + 0x0001, 0xa212, 0x70b4, 0x2068, 0x6800, 0x2060, 0x6008, 0xa084, + 0xfbef, 0x600a, 0x8211, 0x0040, 0x2aa9, 0x1078, 0x2ab0, 0x0078, + 0x2a9c, 0x70a7, 0x0001, 0x0c7f, 0x027f, 0x0d7f, 0x017f, 0x007c, + 0xade8, 0x0005, 0x70ac, 0xad06, 0x00c0, 0x2ab8, 0x70a8, 0x2068, + 0x007c, 0x1078, 0x42e9, 0x00c0, 0x2962, 0x707c, 0x2068, 0x7774, + 0x1078, 0x4187, 0x2c50, 0x1078, 0x43bd, 0x789b, 0x0010, 0x6814, + 0xa084, 0x001f, 0xc0bd, 0x78aa, 0x6e1c, 0x2041, 0x0001, 0x2001, + 0x0004, 0x0078, 0x2c32, 0x1078, 0x42e9, 0x00c0, 0x2962, 0x789b, + 0x0010, 0x7060, 0x2068, 0x6f14, 0x70d4, 0xd0b4, 0x0040, 0x2aed, + 0xc0b4, 0x70d6, 0x0c7e, 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, + 0x600a, 0x6018, 0x8001, 0x601a, 0x0c7f, 0x1078, 0x4187, 0x2c50, + 0x1078, 0x43bd, 0x6824, 0xa005, 0x0040, 0x2afe, 0xa082, 0x0006, + 0x0048, 0x2afc, 0x0078, 0x2afe, 0x6827, 0x0005, 0x6814, 0xa084, + 0x001f, 0xc0bd, 0x78aa, 0x2031, 0x0020, 0x2041, 0x0001, 0x2001, + 0x0003, 0x0078, 0x2c32, 0xc28d, 0x72d6, 0x72c0, 0xa200, 0xa015, + 0x7154, 0x8108, 0xa12a, 0x0048, 0x2b16, 0x71c0, 0x2164, 0x6504, + 0x85ff, 0x00c0, 0x2b2d, 0x7156, 0x8421, 0x00c0, 0x2b11, 0x70d4, + 0xd08c, 0x0040, 0x2b29, 0x70d0, 0xa005, 0x00c0, 0x2b29, 0x70d3, + 0x000a, 0x007c, 0x2200, 0x0078, 0x2b1b, 0x70d4, 0xc08c, 0x70d6, + 0x70d3, 0x0000, 0x6034, 0xa005, 0x00c0, 0x2b2a, 0x6708, 0xa784, + 0x073f, 0x0040, 0x2b5c, 0xd7d4, 0x00c0, 0x2b2a, 0xa784, 0x0021, + 0x00c0, 0x2b2a, 0xa784, 0x0002, 0x0040, 0x2b4d, 0xa784, 0x0004, + 0x0040, 0x2b2a, 0xa7bc, 0xfffb, 0x670a, 0xa784, 0x0218, 0x00c0, + 0x2b2a, 0xa784, 0x0100, 0x0040, 0x2b5c, 0x6018, 0xa005, 0x00c0, + 0x2b2a, 0xa7bc, 0xfeff, 0x670a, 0x2568, 0x6823, 0x0000, 0x6e1c, + 0xa684, 0x000e, 0x6318, 0x0040, 0x2b6d, 0x601c, 0xa302, 0x0048, + 0x2b70, 0x0040, 0x2b70, 0x0078, 0x2b2a, 0x83ff, 0x00c0, 0x2b2a, + 0x2d58, 0x2c50, 0x7156, 0xd7bc, 0x00c0, 0x2b78, 0x7028, 0x6022, + 0xc7bc, 0x670a, 0x68c0, 0xa065, 0xa04d, 0x6100, 0x2a60, 0x2041, + 0x0001, 0x6b14, 0xa39c, 0x001f, 0xa39d, 0x00c0, 0xd1fc, 0x0040, + 0x2b8c, 0xd684, 0x0040, 0x2b8e, 0xa39c, 0xffbf, 0xd6a4, 0x0040, + 0x2b93, 0xa39d, 0x0020, 0xa684, 0x000e, 0x00c0, 0x2bde, 0xc7a5, + 0x670a, 0x2c00, 0x68c6, 0x77a4, 0xa786, 0x0001, 0x00c0, 0x2bb2, + 0x70d4, 0xd0b4, 0x00c0, 0x2bb2, 0x7000, 0xa082, 0x0002, 0x00c8, + 0x2bb2, 0x7830, 0xd0bc, 0x00c0, 0x2bb2, 0x789b, 0x0010, 0x7baa, + 0x0078, 0x2c2a, 0x8739, 0x77a6, 0x2750, 0x77b0, 0xa7b0, 0x0005, + 0x70ac, 0xa606, 0x00c0, 0x2bbd, 0x76a8, 0x76b2, 0x2c3a, 0x8738, + 0x2d3a, 0x8738, 0x283a, 0x8738, 0x233a, 0x8738, 0x253a, 0x7830, + 0xd0bc, 0x0040, 0x2bd5, 0x2091, 0x8000, 0x2091, 0x303d, 0x70d4, + 0xa084, 0x303d, 0x2091, 0x8000, 0x2090, 0xaad5, 0x0000, 0x0040, + 0x2bdd, 0x8421, 0x2200, 0x00c0, 0x2b10, 0x007c, 0xd1dc, 0x0040, + 0x3d86, 0x2029, 0x0020, 0xd69c, 0x00c0, 0x2beb, 0x8528, 0xd68c, + 0x00c0, 0x2beb, 0x8528, 0x8840, 0x6f14, 0x610c, 0x8108, 0xa18c, + 0x00ff, 0x70cc, 0xa160, 0x2c64, 0x8cff, 0x0040, 0x2c0a, 0x6014, + 0xa706, 0x00c0, 0x2bf3, 0x60b8, 0x8001, 0x60ba, 0x00c0, 0x2bee, + 0x2a60, 0x6008, 0xa085, 0x0100, 0x600a, 0x2200, 0x8421, 0x00c0, + 0x2b10, 0x007c, 0x2a60, 0x610e, 0x69be, 0x2c00, 0x68c6, 0x8840, + 0x6008, 0xc0d5, 0x600a, 0x77a4, 0xa786, 0x0001, 0x00c0, 0x2bb2, + 0x70d4, 0xd0b4, 0x00c0, 0x2bb2, 0x7000, 0xa082, 0x0002, 0x00c8, + 0x2bb2, 0x7830, 0xd0bc, 0x00c0, 0x2bb2, 0x789b, 0x0010, 0x7baa, + 0x7daa, 0x79aa, 0x2001, 0x0002, 0x007e, 0x6018, 0x8000, 0x601a, + 0x0078, 0x2c33, 0x007e, 0x2960, 0x6104, 0x2a60, 0xa184, 0x0018, + 0x0040, 0x2c4f, 0xa184, 0x0010, 0x0040, 0x2c42, 0x1078, 0x3f99, + 0x00c0, 0x2c74, 0xa184, 0x0008, 0x0040, 0x2c4f, 0x69a0, 0xa184, + 0x0600, 0x00c0, 0x2c4f, 0x1078, 0x3e7c, 0x0078, 0x2c74, 0x69a0, + 0xa184, 0x1e00, 0x0040, 0x2c7f, 0xa184, 0x0800, 0x0040, 0x2c68, + 0x0c7e, 0x2960, 0x6000, 0xa085, 0x2000, 0x6002, 0x6104, 0xa18d, + 0x0010, 0x6106, 0x0c7f, 0x1078, 0x3f99, 0x00c0, 0x2c74, 0x69a0, + 0xa184, 0x0200, 0x0040, 0x2c70, 0x1078, 0x3edc, 0x0078, 0x2c74, + 0xa184, 0x0400, 0x00c0, 0x2c4b, 0x69a0, 0xa184, 0x1000, 0x0040, + 0x2c7f, 0x6914, 0xa18c, 0xff00, 0x810f, 0x1078, 0x2755, 0x027f, + 0xa68c, 0x00e0, 0xa684, 0x0060, 0x0040, 0x2c8c, 0xa086, 0x0060, + 0x00c0, 0x2c8c, 0xa18d, 0x4000, 0xa18d, 0x0104, 0x69b6, 0x789b, + 0x0060, 0x2800, 0x78aa, 0x6818, 0xc0fd, 0x681a, 0xd6bc, 0x0040, + 0x2ca7, 0xc0fc, 0x7087, 0x0000, 0xa08a, 0x000d, 0x0050, 0x2ca5, + 0xa08a, 0x000c, 0x7186, 0x2001, 0x000c, 0x800c, 0x718a, 0x78aa, + 0x3518, 0x3340, 0x3428, 0x8000, 0x80ac, 0xaf80, 0x002b, 0x20a0, + 0x789b, 0x0000, 0xad80, 0x000b, 0x2098, 0x53a6, 0x23a8, 0x2898, + 0x25a0, 0xa286, 0x0020, 0x00c0, 0x2cdf, 0x70d4, 0xc0b5, 0x70d6, + 0x2c00, 0x70ba, 0x2d00, 0x70be, 0x6814, 0xc0fc, 0x8007, 0x7882, + 0xa286, 0x0002, 0x0040, 0x2d15, 0x70a4, 0x8000, 0x70a6, 0x74b4, + 0xa498, 0x0005, 0x70ac, 0xa306, 0x00c0, 0x2cd7, 0x73a8, 0x73b6, + 0xa286, 0x0010, 0x0040, 0x2962, 0x0d7f, 0x0c7f, 0x007c, 0x7000, + 0xa005, 0x00c0, 0x2cbd, 0xa286, 0x0002, 0x00c0, 0x2d2f, 0x1078, + 0x42e9, 0x00c0, 0x2cbd, 0x6814, 0xc0fc, 0x8007, 0x7882, 0x2091, + 0x8000, 0x781b, 0x005b, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, + 0x6898, 0x78d2, 0x78da, 0x2091, 0x8001, 0x7808, 0xc08d, 0x780a, + 0x127e, 0x0d7e, 0x0c7e, 0x70d4, 0xa084, 0x2700, 0x2090, 0x0c7f, + 0x0d7f, 0x127f, 0x2900, 0x705a, 0x68bc, 0x7042, 0x7003, 0x0002, + 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, 0x7830, 0xd0bc, 0x0040, + 0x2d21, 0x2091, 0x303d, 0x70d4, 0xa084, 0x303d, 0x2091, 0x8000, + 0x2090, 0x70a4, 0xa005, 0x00c0, 0x2d26, 0x007c, 0x8421, 0x0040, + 0x2d25, 0x7250, 0x70c0, 0xa200, 0xa015, 0x0078, 0x2b10, 0xa286, + 0x0010, 0x00c0, 0x2d60, 0x1078, 0x42e9, 0x00c0, 0x2cbd, 0x6814, + 0xc0fc, 0x8007, 0x7882, 0x781b, 0x005b, 0x68b4, 0x785a, 0x6894, + 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0x7808, 0xc08d, 0x780a, + 0x70a4, 0x8000, 0x70a6, 0x74b4, 0xa490, 0x0005, 0x70ac, 0xa206, + 0x00c0, 0x2d53, 0x72a8, 0x72b6, 0x2900, 0x705a, 0x68bc, 0x7042, + 0x7003, 0x0002, 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, 0x007c, + 0x6bb4, 0xa39d, 0x2000, 0x7b5a, 0x6814, 0xc0fc, 0x8007, 0x7882, + 0x6b94, 0x7bd6, 0x7bde, 0x6e98, 0x7ed2, 0x7eda, 0x781b, 0x005b, + 0x2900, 0x705a, 0x7202, 0x7808, 0xc08d, 0x780a, 0x2300, 0xa605, + 0x0040, 0x2d8b, 0x70d4, 0xa084, 0x2700, 0xa086, 0x2300, 0x00c0, + 0x2d85, 0x2009, 0x0000, 0x0078, 0x2d87, 0x2009, 0x0001, 0xa284, + 0x000f, 0x1079, 0x2d8f, 0xad80, 0x0009, 0x7046, 0x007c, 0x2d97, + 0x4834, 0x4834, 0x4821, 0x4834, 0x2d97, 0x2d97, 0x2d97, 0x1078, + 0x290c, 0x7808, 0xa084, 0xfffd, 0x780a, 0x0f7e, 0x2079, 0x4d00, + 0x78ac, 0x0f7f, 0xd084, 0x0040, 0x2dbf, 0x7064, 0xa086, 0x0001, + 0x00c0, 0x2dad, 0x7066, 0x0078, 0x2e96, 0x7064, 0xa086, 0x0005, + 0x00c0, 0x2dbd, 0x707c, 0x2068, 0x681b, 0x0004, 0x6817, 0x0000, + 0x6820, 0xa084, 0x00ff, 0xc09d, 0x6822, 0x7067, 0x0000, 0x70a7, + 0x0000, 0x70a8, 0x70b2, 0x70b6, 0x1078, 0x2a5b, 0x157e, 0x2011, + 0x0004, 0x7164, 0xa186, 0x0001, 0x0040, 0x2ddf, 0xa186, 0x0007, + 0x00c0, 0x2dd6, 0x701f, 0x0005, 0x0078, 0x2ddf, 0x701f, 0x0001, + 0x7067, 0x0000, 0x70d4, 0xc0dd, 0x70d6, 0x0078, 0x2de1, 0x7067, + 0x0000, 0x2001, 0x4d0a, 0x2004, 0xa084, 0x00ff, 0xa086, 0x0018, + 0x0040, 0x2df1, 0x7018, 0x7016, 0xa005, 0x00c0, 0x2df1, 0x70a7, + 0x0001, 0x067e, 0x1078, 0x44fb, 0x20a9, 0x0010, 0x2039, 0x0000, + 0x1078, 0x4081, 0xa7b8, 0x0100, 0x00f0, 0x2df8, 0x067f, 0x7000, + 0x0079, 0x2e02, 0x2e3c, 0x2e17, 0x2e17, 0x2e0c, 0x2e3c, 0x2e3c, + 0x2e3c, 0x2e0a, 0x1078, 0x290c, 0x7060, 0xa005, 0x0040, 0x2e3c, + 0xad06, 0x00c0, 0x2e17, 0x6800, 0x7062, 0x0078, 0x2e29, 0x6820, + 0xd084, 0x00c0, 0x2e25, 0x6f14, 0x1078, 0x4187, 0x6008, 0xc0d4, + 0x600a, 0x1078, 0x3d56, 0x0078, 0x2e29, 0x705c, 0x2060, 0x6800, + 0x6002, 0xa684, 0x5f00, 0x681e, 0x6818, 0xd0fc, 0x0040, 0x2e31, + 0x6a1a, 0x6817, 0x0000, 0x682b, 0x0000, 0x6820, 0xa084, 0x00ff, + 0xc09d, 0x6822, 0x1078, 0x2013, 0xb284, 0x0400, 0x0040, 0x2e44, + 0x2021, 0x94d0, 0x0078, 0x2e46, 0x2021, 0x93c0, 0x1078, 0x2e9b, + 0xb284, 0x0400, 0x0040, 0x2e50, 0x2021, 0x4d98, 0x0078, 0x2e52, + 0x2021, 0x4d58, 0x1078, 0x2e9b, 0x20a9, 0x0101, 0xb284, 0x0400, + 0x0040, 0x2e5e, 0x2021, 0x93d0, 0x0078, 0x2e60, 0x2021, 0x92c0, + 0x1078, 0x2e9b, 0x8420, 0x00f0, 0x2e60, 0xb284, 0x0300, 0x0040, + 0x2e6d, 0x2061, 0x52c0, 0x0078, 0x2e6f, 0x2061, 0x72c0, 0x2021, + 0x0002, 0x20a9, 0x0100, 0x6110, 0x81ff, 0x0040, 0x2e8c, 0x6018, + 0x017e, 0x007e, 0x2011, 0x4d02, 0x220c, 0xa102, 0x2012, 0x007f, + 0x017f, 0xa102, 0x0050, 0x2e8c, 0x6012, 0x00c0, 0x2e8c, 0x2011, + 0x4d04, 0x2204, 0xc0a5, 0x2012, 0x601b, 0x0000, 0xace0, 0x0010, + 0x00f0, 0x2e73, 0x8421, 0x00c0, 0x2e71, 0x157f, 0x7003, 0x0000, + 0x704f, 0x0000, 0x007c, 0x047e, 0x2404, 0xa005, 0x0040, 0x2eb6, + 0x2068, 0x6800, 0x007e, 0x6a1a, 0x6817, 0x0000, 0x682b, 0x0000, + 0x68b4, 0xa084, 0x5f00, 0x681e, 0x6820, 0xa084, 0x00ff, 0xc09d, + 0x6822, 0x1078, 0x2013, 0x007f, 0x0078, 0x2e9d, 0x047f, 0x2023, + 0x0000, 0x007c, 0xa282, 0x0003, 0x0050, 0x2ec0, 0x1078, 0x290c, + 0x2300, 0x0079, 0x2ec3, 0x2ec6, 0x2f51, 0x2f6e, 0xa282, 0x0002, + 0x0040, 0x2ecc, 0x1078, 0x290c, 0x7064, 0x7067, 0x0000, 0x7083, + 0x0000, 0x0079, 0x2ed3, 0x2edb, 0x2edb, 0x2edd, 0x2f1d, 0x3d92, + 0x2edb, 0x2f1d, 0x2edb, 0x1078, 0x290c, 0x7774, 0x1078, 0x4081, + 0x7774, 0xa7bc, 0x8f00, 0x1078, 0x4187, 0x6018, 0xa005, 0x0040, + 0x2f14, 0xd7fc, 0x00c0, 0x2ef0, 0x2021, 0x93c0, 0x0078, 0x2ef2, + 0x2021, 0x94d0, 0x2009, 0x0005, 0x2011, 0x0010, 0x1078, 0x2f89, + 0x0040, 0x2f14, 0x157e, 0x20a9, 0x0101, 0xd7fc, 0x00c0, 0x2f04, + 0x2021, 0x92c0, 0x0078, 0x2f06, 0x2021, 0x93d0, 0x047e, 0x2009, + 0x0005, 0x2011, 0x0010, 0x1078, 0x2f89, 0x047f, 0x0040, 0x2f13, + 0x8420, 0x00f0, 0x2f06, 0x157f, 0x8738, 0xa784, 0x001f, 0x00c0, + 0x2ee3, 0x0078, 0x2966, 0x0078, 0x2966, 0x7774, 0x1078, 0x4187, + 0x6018, 0xa005, 0x0040, 0x2f4f, 0xd7fc, 0x00c0, 0x2f2b, 0x2021, + 0x93c0, 0x0078, 0x2f2d, 0x2021, 0x94d0, 0x2009, 0x0005, 0x2011, + 0x0020, 0x1078, 0x2f89, 0x0040, 0x2f4f, 0x157e, 0x20a9, 0x0101, + 0xd7fc, 0x00c0, 0x2f3f, 0x2021, 0x92c0, 0x0078, 0x2f41, 0x2021, + 0x93d0, 0x047e, 0x2009, 0x0005, 0x2011, 0x0020, 0x1078, 0x2f89, + 0x047f, 0x0040, 0x2f4e, 0x8420, 0x00f0, 0x2f41, 0x157f, 0x0078, + 0x2966, 0x2200, 0x0079, 0x2f54, 0x2f57, 0x2f59, 0x2f59, 0x1078, + 0x290c, 0x2009, 0x0012, 0x7064, 0xa086, 0x0002, 0x0040, 0x2f62, + 0x2009, 0x000e, 0x6818, 0xd0fc, 0x0040, 0x2f67, 0x691a, 0x7067, + 0x0000, 0x70d4, 0xc0dd, 0x70d6, 0x0078, 0x4296, 0x2200, 0x0079, + 0x2f71, 0x2f76, 0x2f59, 0x2f74, 0x1078, 0x290c, 0x1078, 0x44fb, + 0x7000, 0xa086, 0x0002, 0x00c0, 0x3d04, 0x1078, 0x3d73, 0x6008, + 0xa084, 0xfbef, 0x600a, 0x1078, 0x3cf5, 0x0040, 0x3d04, 0x0078, + 0x2966, 0x2404, 0xa005, 0x0040, 0x2fc2, 0x2068, 0x2d04, 0x007e, + 0x6814, 0xa706, 0x0040, 0x2f98, 0x2d20, 0x007f, 0x0078, 0x2f8a, + 0x007f, 0x2022, 0x691a, 0x6817, 0x0000, 0x682b, 0x0000, 0x68b4, + 0xa084, 0x5f00, 0x681e, 0x6820, 0xa084, 0x00ff, 0xa205, 0x6822, + 0x1078, 0x2013, 0x2021, 0x4d02, 0x241c, 0x8319, 0x2322, 0x6010, + 0x8001, 0x6012, 0x00c0, 0x2fb9, 0x2021, 0x4d04, 0x2404, 0xc0a5, + 0x2022, 0x6008, 0xa084, 0xf9ef, 0x600a, 0x1078, 0x2a7c, 0x1078, + 0x3d73, 0x007c, 0xa085, 0x0001, 0x0078, 0x2fc1, 0x2300, 0x0079, + 0x2fc9, 0x2fce, 0x2fcc, 0x304e, 0x1078, 0x290c, 0x78e4, 0xa005, + 0x00d0, 0x3004, 0x3208, 0x007e, 0x2001, 0x4d04, 0x2004, 0xd0ec, + 0x007f, 0x0040, 0x2fdf, 0xa18c, 0x0300, 0x0078, 0x2fe1, 0xa18c, + 0x0400, 0x0040, 0x2fe7, 0x0018, 0x2962, 0x0078, 0x2fe9, 0x0028, + 0x2962, 0x2008, 0xa084, 0x0030, 0x00c0, 0x2ff0, 0x0078, 0x36fb, + 0x78ec, 0xa084, 0x0003, 0x0040, 0x2fee, 0x2100, 0xa084, 0x0007, + 0x0079, 0x2ffa, 0x302e, 0x3038, 0x3023, 0x3002, 0x42de, 0x42de, + 0x3002, 0x3043, 0x1078, 0x290c, 0x7000, 0xa086, 0x0004, 0x00c0, + 0x301e, 0x7064, 0xa086, 0x0002, 0x00c0, 0x3014, 0x2011, 0x0002, + 0x2019, 0x0000, 0x0078, 0x2eba, 0x7064, 0xa086, 0x0006, 0x0040, + 0x300e, 0x7064, 0xa086, 0x0004, 0x0040, 0x300e, 0x79e4, 0x2001, + 0x0003, 0x0078, 0x3385, 0x6818, 0xd0fc, 0x0040, 0x3029, 0x681b, + 0x001d, 0x1078, 0x4051, 0x781b, 0x0061, 0x007c, 0x6818, 0xd0fc, + 0x0040, 0x3034, 0x681b, 0x001d, 0x1078, 0x4051, 0x0078, 0x42ba, + 0x6818, 0xd0fc, 0x0040, 0x303e, 0x681b, 0x001d, 0x1078, 0x4051, + 0x781b, 0x00f5, 0x007c, 0x6818, 0xd0fc, 0x0040, 0x3049, 0x681b, + 0x001d, 0x1078, 0x4051, 0x781b, 0x00c5, 0x007c, 0xa584, 0x000f, + 0x00c0, 0x306b, 0x7000, 0x0079, 0x3055, 0x2966, 0x305d, 0x305f, + 0x3d04, 0x3d04, 0x3d04, 0x305d, 0x305d, 0x1078, 0x290c, 0x1078, + 0x3d73, 0x6008, 0xa084, 0xfbef, 0x600a, 0x1078, 0x3cf5, 0x0040, + 0x3d04, 0x0078, 0x2966, 0x78e4, 0xa005, 0x00d0, 0x3004, 0x3208, + 0x007e, 0x2001, 0x4d04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x307c, + 0xa18c, 0x0300, 0x0078, 0x307e, 0xa18c, 0x0400, 0x0040, 0x3084, + 0x0018, 0x3004, 0x0078, 0x3086, 0x0028, 0x3004, 0x2008, 0xa084, + 0x0030, 0x00c0, 0x308e, 0x781b, 0x005b, 0x007c, 0x78ec, 0xa084, + 0x0003, 0x0040, 0x308b, 0x2100, 0xa184, 0x0007, 0x0079, 0x3098, + 0x30a7, 0x30ab, 0x30a2, 0x30a0, 0x42de, 0x42de, 0x30a0, 0x42d8, + 0x1078, 0x290c, 0x1078, 0x4059, 0x781b, 0x0061, 0x007c, 0x1078, + 0x4059, 0x0078, 0x42ba, 0x1078, 0x4059, 0x781b, 0x00f5, 0x007c, + 0x1078, 0x4059, 0x781b, 0x00c5, 0x007c, 0x2300, 0x0079, 0x30b8, + 0x30bd, 0x30bb, 0x30bf, 0x1078, 0x290c, 0x0078, 0x38cf, 0x681b, + 0x0016, 0x78a3, 0x0000, 0x79e4, 0xa184, 0x0030, 0x0040, 0x38cf, + 0x78ec, 0xa084, 0x0003, 0x0040, 0x38cf, 0xa184, 0x0100, 0x0040, + 0x30c3, 0xa184, 0x0007, 0x0079, 0x30d5, 0x30dd, 0x30ab, 0x3023, + 0x4296, 0x42de, 0x42de, 0x4296, 0x42d8, 0x1078, 0x42a2, 0x007c, + 0xa282, 0x0005, 0x0050, 0x30e6, 0x1078, 0x290c, 0x2300, 0x0079, + 0x30e9, 0x30ec, 0x330b, 0x3316, 0x2200, 0x0079, 0x30ef, 0x3109, + 0x30f6, 0x3109, 0x30f4, 0x32ee, 0x1078, 0x290c, 0x789b, 0x0018, + 0x78a8, 0xa084, 0x00ff, 0xa082, 0x0020, 0x0048, 0x4040, 0xa08a, + 0x0004, 0x00c8, 0x4040, 0x0079, 0x3105, 0x4040, 0x4040, 0x4040, + 0x3fea, 0x789b, 0x0018, 0x79a8, 0xa184, 0x0080, 0x0040, 0x311a, + 0x0078, 0x4040, 0x7000, 0xa005, 0x00c0, 0x3110, 0x2011, 0x0004, + 0x0078, 0x3aba, 0xa184, 0x00ff, 0xa08a, 0x0010, 0x00c8, 0x4040, + 0x0079, 0x3122, 0x3134, 0x3132, 0x3149, 0x314d, 0x320f, 0x4040, + 0x4040, 0x3211, 0x4040, 0x4040, 0x32ea, 0x32ea, 0x4040, 0x4040, + 0x4040, 0x32ec, 0x1078, 0x290c, 0xd6e4, 0x0040, 0x313f, 0x2001, + 0x0300, 0x8000, 0x8000, 0x783a, 0x781b, 0x00c0, 0x007c, 0x6818, + 0xd0fc, 0x0040, 0x3147, 0x681b, 0x001d, 0x0078, 0x3137, 0x0078, + 0x4296, 0x681b, 0x001d, 0x0078, 0x404a, 0x6920, 0x6922, 0xa684, + 0x1800, 0x00c0, 0x31a1, 0x6820, 0xd084, 0x00c0, 0x31a7, 0x6818, + 0xa086, 0x0008, 0x00c0, 0x315e, 0x681b, 0x0000, 0xd6d4, 0x0040, + 0x320c, 0xd6bc, 0x0040, 0x319e, 0x7087, 0x0000, 0x6818, 0xa084, + 0x003f, 0xa08a, 0x000d, 0x0050, 0x319e, 0xa08a, 0x000c, 0x7186, 0x2001, 0x000c, 0x800c, 0x718a, 0x789b, 0x0061, 0x78aa, 0x157e, - 0x137e, 0x147e, 0x017e, 0x3208, 0xa18c, 0x0300, 0x0040, 0x3110, - 0x007e, 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x310c, - 0x20a1, 0x012b, 0x0078, 0x3112, 0x20a1, 0x022b, 0x0078, 0x3112, + 0x137e, 0x147e, 0x017e, 0x3208, 0xa18c, 0x0300, 0x0040, 0x3190, + 0x007e, 0x2001, 0x4d04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x318c, + 0x20a1, 0x012b, 0x0078, 0x3192, 0x20a1, 0x022b, 0x0078, 0x3192, 0x20a1, 0x012b, 0x017f, 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 0x781b, 0x0064, - 0x007c, 0xd6e4, 0x0040, 0x3127, 0x781b, 0x0076, 0x007c, 0xa684, - 0x0060, 0x0040, 0x3189, 0xd6dc, 0x0040, 0x3189, 0xd6fc, 0x00c0, - 0x3133, 0x0078, 0x314a, 0xc6fc, 0x7e5a, 0x6eb6, 0x7adc, 0x79d8, - 0x78d0, 0x801b, 0x00c8, 0x313d, 0x8000, 0xa084, 0x003f, 0xa108, + 0x007c, 0xd6e4, 0x0040, 0x31a7, 0x781b, 0x0076, 0x007c, 0xa684, + 0x0060, 0x0040, 0x3209, 0xd6dc, 0x0040, 0x3209, 0xd6fc, 0x00c0, + 0x31b3, 0x0078, 0x31ca, 0xc6fc, 0x7e5a, 0x6eb6, 0x7adc, 0x79d8, + 0x78d0, 0x801b, 0x00c8, 0x31bd, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, - 0xa303, 0x68ae, 0xd6f4, 0x0040, 0x3150, 0xc6f4, 0x7e5a, 0x6eb6, - 0x7000, 0xa086, 0x0003, 0x00c0, 0x315e, 0x007e, 0x1078, 0x4326, - 0x1078, 0x45f7, 0x007f, 0x781b, 0x0073, 0x007c, 0xa006, 0x1078, - 0x46e5, 0x6ab0, 0x69ac, 0x6c98, 0x6b94, 0x2200, 0xa105, 0x0040, - 0x316d, 0x2200, 0xa422, 0x2100, 0xa31b, 0x6caa, 0x7cd2, 0x7cda, - 0x6ba6, 0x7bd6, 0x7bde, 0x2300, 0xa405, 0x00c0, 0x317d, 0xc6f5, + 0xa303, 0x68ae, 0xd6f4, 0x0040, 0x31d0, 0xc6f4, 0x7e5a, 0x6eb6, + 0x7000, 0xa086, 0x0003, 0x00c0, 0x31de, 0x007e, 0x1078, 0x44fb, + 0x1078, 0x4834, 0x007f, 0x781b, 0x0073, 0x007c, 0xa006, 0x1078, + 0x493a, 0x6ab0, 0x69ac, 0x6c98, 0x6b94, 0x2200, 0xa105, 0x0040, + 0x31ed, 0x2200, 0xa422, 0x2100, 0xa31b, 0x6caa, 0x7cd2, 0x7cda, + 0x6ba6, 0x7bd6, 0x7bde, 0x2300, 0xa405, 0x00c0, 0x31fd, 0xc6f5, 0x7e5a, 0x6eb6, 0x781b, 0x0073, 0x007c, 0x781b, 0x0073, 0x2200, - 0xa115, 0x00c0, 0x3186, 0x1078, 0x45f7, 0x007c, 0x1078, 0x462d, + 0xa115, 0x00c0, 0x3206, 0x1078, 0x4834, 0x007c, 0x1078, 0x486c, 0x007c, 0x781b, 0x0076, 0x007c, 0x781b, 0x0064, 0x007c, 0x1078, - 0x28ec, 0x0078, 0x31dd, 0x6920, 0xd1c4, 0x0040, 0x31a6, 0xc1c4, + 0x290c, 0x0078, 0x325d, 0x6920, 0xd1c4, 0x0040, 0x3226, 0xc1c4, 0x6922, 0x0c7e, 0x7058, 0x2060, 0x6000, 0xc0e4, 0x6002, 0x6004, - 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x0078, 0x31d1, 0xd1cc, 0x0040, - 0x31d1, 0xc1cc, 0x6922, 0x0c7e, 0x7058, 0x2060, 0x6000, 0xc0ec, + 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x0078, 0x3251, 0xd1cc, 0x0040, + 0x3251, 0xc1cc, 0x6922, 0x0c7e, 0x7058, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x6004, 0xc0a4, 0x6006, 0x2008, 0x2c48, 0x0c7f, 0xd19c, - 0x0040, 0x31d1, 0x1078, 0x3fdd, 0x1078, 0x3cda, 0x88ff, 0x0040, - 0x31d1, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, 0xc695, 0x7e5a, - 0xd6d4, 0x00c0, 0x31ce, 0x781b, 0x0061, 0x007c, 0x781b, 0x0075, - 0x007c, 0x7e58, 0xd6d4, 0x00c0, 0x31d8, 0x781b, 0x0064, 0x007c, - 0x781b, 0x0076, 0x007c, 0x0078, 0x3ea2, 0x2019, 0x0000, 0x7990, - 0xa18c, 0x0007, 0x00c0, 0x31eb, 0x6820, 0xa084, 0x0100, 0x0040, - 0x31db, 0x2009, 0x0008, 0x789b, 0x0010, 0x78a8, 0xa094, 0x00ff, - 0xa286, 0x0001, 0x00c0, 0x3207, 0x2300, 0x7ca8, 0xa400, 0x2018, - 0xa102, 0x0040, 0x31ff, 0x0048, 0x31ff, 0x0078, 0x3201, 0x0078, - 0x3193, 0x24a8, 0x7aa8, 0x00f0, 0x3201, 0x0078, 0x31ed, 0xa284, - 0x00f0, 0xa086, 0x0020, 0x00c0, 0x325b, 0x8318, 0x8318, 0x2300, - 0xa102, 0x0040, 0x3217, 0x0048, 0x3217, 0x0078, 0x3258, 0xa286, - 0x0023, 0x0040, 0x31db, 0x681c, 0xa084, 0xfff1, 0x681e, 0x7e58, + 0x0040, 0x3251, 0x1078, 0x4183, 0x1078, 0x3e7c, 0x88ff, 0x0040, + 0x3251, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, 0xc695, 0x7e5a, + 0xd6d4, 0x00c0, 0x324e, 0x781b, 0x0061, 0x007c, 0x781b, 0x0075, + 0x007c, 0x7e58, 0xd6d4, 0x00c0, 0x3258, 0x781b, 0x0064, 0x007c, + 0x781b, 0x0076, 0x007c, 0x0078, 0x4045, 0x2019, 0x0000, 0x7990, + 0xa18c, 0x0007, 0x00c0, 0x326b, 0x6820, 0xa084, 0x0100, 0x0040, + 0x325b, 0x2009, 0x0008, 0x789b, 0x0010, 0x78a8, 0xa094, 0x00ff, + 0xa286, 0x0001, 0x00c0, 0x3287, 0x2300, 0x7ca8, 0xa400, 0x2018, + 0xa102, 0x0040, 0x327f, 0x0048, 0x327f, 0x0078, 0x3281, 0x0078, + 0x3213, 0x24a8, 0x7aa8, 0x00f0, 0x3281, 0x0078, 0x326d, 0xa284, + 0x00f0, 0xa086, 0x0020, 0x00c0, 0x32db, 0x8318, 0x8318, 0x2300, + 0xa102, 0x0040, 0x3297, 0x0048, 0x3297, 0x0078, 0x32d8, 0xa286, + 0x0023, 0x0040, 0x325b, 0x681c, 0xa084, 0xfff1, 0x681e, 0x7e58, 0xa684, 0xfff1, 0xc0a5, 0x2030, 0x7e5a, 0x6008, 0xc0a5, 0x600a, 0x0c7e, 0x7058, 0x2060, 0x6004, 0x2008, 0x2c48, 0x0c7f, 0xd1a4, - 0x0040, 0x3238, 0x1078, 0x3fdd, 0x1078, 0x3df6, 0x0078, 0x3246, + 0x0040, 0x32b8, 0x1078, 0x4183, 0x1078, 0x3f99, 0x0078, 0x32c6, 0x0c7e, 0x7058, 0x2060, 0x6004, 0x2008, 0x2c48, 0x0c7f, 0xd19c, - 0x0040, 0x31d1, 0x1078, 0x3fdd, 0x1078, 0x3cda, 0x88ff, 0x0040, - 0x31d1, 0x789b, 0x0060, 0x2800, 0x78aa, 0xc695, 0x7e5a, 0xd6d4, - 0x00c0, 0x3255, 0x781b, 0x0061, 0x007c, 0x781b, 0x0075, 0x007c, - 0x7aa8, 0x0078, 0x31ed, 0x8318, 0x2300, 0xa102, 0x0040, 0x3264, - 0x0048, 0x3264, 0x0078, 0x31ed, 0xa284, 0x0080, 0x00c0, 0x3ea7, - 0x0078, 0x3ea2, 0x0078, 0x3ea7, 0x0078, 0x3e9d, 0x7058, 0xa04d, + 0x0040, 0x3251, 0x1078, 0x4183, 0x1078, 0x3e7c, 0x88ff, 0x0040, + 0x3251, 0x789b, 0x0060, 0x2800, 0x78aa, 0xc695, 0x7e5a, 0xd6d4, + 0x00c0, 0x32d5, 0x781b, 0x0061, 0x007c, 0x781b, 0x0075, 0x007c, + 0x7aa8, 0x0078, 0x326d, 0x8318, 0x2300, 0xa102, 0x0040, 0x32e4, + 0x0048, 0x32e4, 0x0078, 0x326d, 0xa284, 0x0080, 0x00c0, 0x404a, + 0x0078, 0x4045, 0x0078, 0x404a, 0x0078, 0x4040, 0x7058, 0xa04d, 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa08e, 0x0001, 0x0040, - 0x327b, 0x1078, 0x28ec, 0x7aa8, 0xa294, 0x00ff, 0x78a8, 0xa084, - 0x00ff, 0xa08a, 0x0004, 0x00c8, 0x3e9d, 0x0079, 0x3287, 0x3e9d, - 0x3c2c, 0x3e9d, 0x3d9e, 0xa282, 0x0000, 0x00c0, 0x3291, 0x1078, - 0x28ec, 0x1078, 0x3eae, 0x781b, 0x0075, 0x007c, 0xa282, 0x0003, - 0x00c0, 0x329c, 0x1078, 0x28ec, 0xd4fc, 0x00c0, 0x32bc, 0x7064, - 0xa005, 0x0040, 0x32a5, 0x1078, 0x28ec, 0x6f14, 0x7776, 0xa7bc, - 0x8f00, 0x1078, 0x3fe1, 0x6008, 0xa085, 0x0021, 0x600a, 0x8738, - 0xa784, 0x001f, 0x00c0, 0x32a9, 0x1078, 0x3eb2, 0x7067, 0x0002, - 0x701f, 0x0009, 0x0078, 0x32be, 0x1078, 0x3ebe, 0x781b, 0x0075, - 0x007c, 0xa282, 0x0004, 0x0050, 0x32c7, 0x1078, 0x28ec, 0x2300, - 0x0079, 0x32ca, 0x32cd, 0x346b, 0x34ae, 0xa286, 0x0003, 0x0040, - 0x3304, 0x7200, 0x7cd8, 0x7ddc, 0x7fd0, 0x71d4, 0xd1b4, 0x0078, - 0x32fc, 0x0040, 0x32fc, 0x7868, 0xa084, 0x00ff, 0x00c0, 0x32fc, - 0xa282, 0x0002, 0x00c8, 0x32fc, 0x0d7e, 0x783b, 0x8300, 0x781b, - 0x004c, 0x70bc, 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, - 0x6898, 0x78d2, 0x78da, 0xc1b4, 0x71d6, 0x7003, 0x0030, 0x0d7f, - 0x2001, 0x0000, 0x0078, 0x3308, 0x783b, 0x1300, 0x781b, 0x004a, - 0x2001, 0x0000, 0x0078, 0x3308, 0x7200, 0x7cd8, 0x7ddc, 0x7fd0, - 0x704a, 0x68a0, 0xd0ec, 0x0040, 0x3310, 0x6008, 0xc08d, 0x600a, - 0xa284, 0x000f, 0x0079, 0x3314, 0x344b, 0x3321, 0x331e, 0x35ae, - 0x35f2, 0x2946, 0x331c, 0x331c, 0x1078, 0x28ec, 0x6008, 0xc0d4, - 0x600a, 0xd6e4, 0x00c0, 0x3328, 0x1078, 0x4326, 0x0040, 0x3404, - 0x7868, 0xa08c, 0x00ff, 0x0040, 0x3369, 0xa186, 0x0008, 0x00c0, - 0x333e, 0x1078, 0x3bd2, 0x6008, 0xc0a4, 0x600a, 0x1078, 0x3b6b, - 0x0040, 0x3369, 0x1078, 0x4326, 0x0078, 0x3353, 0xa186, 0x0028, - 0x00c0, 0x3369, 0x1078, 0x4326, 0x6008, 0xc0a4, 0x600a, 0x6018, - 0xa005, 0x0040, 0x3353, 0x8001, 0x601a, 0x0040, 0x3353, 0x8001, - 0x0040, 0x3353, 0x601e, 0x6820, 0xd084, 0x0040, 0x2946, 0xc084, - 0x6822, 0x705c, 0x0c7e, 0x2060, 0x6800, 0x6002, 0x0c7f, 0x6004, - 0x6802, 0xa005, 0x2d00, 0x00c0, 0x3366, 0x6002, 0x6006, 0x0078, - 0x2946, 0x017e, 0x81ff, 0x00c0, 0x33b0, 0x7000, 0xa086, 0x0030, - 0x0040, 0x33b0, 0x71d4, 0xd1b4, 0x00c0, 0x3397, 0x7060, 0xa005, - 0x00c0, 0x33b0, 0x70a4, 0xa086, 0x0001, 0x0040, 0x33b0, 0x7003, - 0x0000, 0x047e, 0x057e, 0x077e, 0x067e, 0x0c7e, 0x0d7e, 0x1078, - 0x296c, 0x0d7f, 0x0c7f, 0x067f, 0x077f, 0x057f, 0x047f, 0x71d4, - 0xd1b4, 0x00c0, 0x33b0, 0x7003, 0x0040, 0x0078, 0x33b0, 0x1078, - 0x411c, 0x00c0, 0x33b0, 0x781b, 0x005b, 0x0d7e, 0x70bc, 0xa06d, - 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, - 0xc1b4, 0x71d6, 0x7003, 0x0030, 0x7808, 0xc08d, 0x780a, 0x0d7f, - 0x1078, 0x34e8, 0x017f, 0x81ff, 0x0040, 0x3403, 0xa684, 0xdf00, - 0x681e, 0x682b, 0x0000, 0x6f14, 0xa186, 0x0002, 0x00c0, 0x3404, - 0x70d4, 0xd0b4, 0x0040, 0x33d1, 0xc0b4, 0x70d6, 0x0c7e, 0x70b8, - 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, - 0x0c7f, 0x6820, 0xd0dc, 0x00c0, 0x3404, 0x8717, 0xa294, 0x000f, - 0x8213, 0x8213, 0x8213, 0xb284, 0x0300, 0x0040, 0x33e3, 0xa290, - 0x4ec0, 0x0078, 0x33e5, 0xa290, 0x4f40, 0xa290, 0x0000, 0x221c, - 0xd3c4, 0x00c0, 0x33ed, 0x0078, 0x33f3, 0x8210, 0x2204, 0xa085, - 0x0018, 0x2012, 0x8211, 0xd3d4, 0x0040, 0x33fe, 0x68a0, 0xd0c4, - 0x00c0, 0x33fe, 0x1078, 0x3562, 0x0078, 0x2946, 0x6008, 0xc08d, - 0x600a, 0x0078, 0x3404, 0x692a, 0x6916, 0x6818, 0xd0fc, 0x0040, - 0x340b, 0x7048, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x6410, 0x84ff, - 0x0040, 0x3420, 0x2009, 0x4a02, 0x2104, 0x8001, 0x200a, 0x8421, - 0x6412, 0x00c0, 0x3420, 0x2021, 0x4a04, 0x2404, 0xc0a5, 0x2022, - 0x6018, 0xa005, 0x0040, 0x3428, 0x8001, 0x601a, 0x00c0, 0x342b, - 0x6008, 0xc0a4, 0x600a, 0x6820, 0xd084, 0x00c0, 0x3437, 0x6800, - 0xa005, 0x00c0, 0x3434, 0x6002, 0x6006, 0x0078, 0x343b, 0x705c, - 0x2060, 0x6800, 0x6002, 0x2061, 0x4a00, 0x6887, 0x0103, 0x2d08, - 0x206b, 0x0000, 0x6068, 0xa005, 0x616a, 0x0040, 0x344a, 0x2d02, - 0x0078, 0x344b, 0x616e, 0x7200, 0xa286, 0x0030, 0x0040, 0x345b, - 0xa286, 0x0040, 0x00c0, 0x2946, 0x7003, 0x0002, 0x704c, 0x2068, - 0x68c4, 0x2060, 0x007c, 0x7003, 0x0002, 0x70bc, 0xa06d, 0x68bc, - 0x7042, 0x70b8, 0xa065, 0x68c0, 0x705a, 0x2d00, 0x704e, 0xad80, - 0x0009, 0x7046, 0x007c, 0xa282, 0x0004, 0x0048, 0x3471, 0x1078, - 0x28ec, 0x2200, 0x0079, 0x3474, 0x3478, 0x3489, 0x3496, 0x3489, - 0xa586, 0x1300, 0x0040, 0x3489, 0xa586, 0x8300, 0x00c0, 0x346f, - 0x7003, 0x0000, 0x6018, 0x8001, 0x601a, 0x6008, 0xa084, 0xfbef, - 0x600a, 0x7000, 0xa086, 0x0005, 0x0040, 0x3493, 0x1078, 0x3eae, - 0x781b, 0x0075, 0x007c, 0x781b, 0x0076, 0x007c, 0x7890, 0x8007, - 0x8001, 0xa084, 0x0007, 0xa080, 0x0018, 0x789a, 0x79a8, 0xa18c, - 0x00ff, 0xa186, 0x0003, 0x0040, 0x34ab, 0xa186, 0x0000, 0x0040, - 0x34ab, 0x0078, 0x3e9d, 0x781b, 0x0076, 0x007c, 0x6820, 0xc095, - 0x6822, 0x82ff, 0x00c0, 0x34b8, 0x1078, 0x3eae, 0x0078, 0x34bf, - 0x8211, 0x0040, 0x34bd, 0x1078, 0x28ec, 0x1078, 0x3ebe, 0x781b, - 0x0075, 0x007c, 0x1078, 0x4131, 0x7830, 0xa084, 0x00c0, 0x00c0, - 0x34e5, 0x017e, 0x3208, 0x007e, 0x2001, 0x4a04, 0x2004, 0xd0ec, - 0x007f, 0x0040, 0x34d7, 0xa18c, 0x0300, 0x0078, 0x34d9, 0xa18c, - 0x0400, 0x017f, 0x0040, 0x34e0, 0x0018, 0x34e5, 0x0078, 0x34e2, - 0x0028, 0x34e5, 0x791a, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, - 0xa684, 0x0060, 0x00c0, 0x34f2, 0x682f, 0x0000, 0x6833, 0x0000, - 0x0078, 0x3561, 0xd6dc, 0x00c0, 0x350a, 0x68b4, 0xd0dc, 0x00c0, - 0x350a, 0x6998, 0x6a94, 0x692e, 0x6a32, 0x7048, 0xa005, 0x00c0, - 0x3507, 0x2200, 0xa105, 0x0040, 0x4326, 0x704b, 0x0015, 0x0078, - 0x4326, 0x007c, 0xd6ac, 0x0040, 0x3530, 0xd6f4, 0x0040, 0x3516, - 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x4326, 0x68b4, 0xa084, - 0x4000, 0xa635, 0xd6f4, 0x00c0, 0x3510, 0x7048, 0xa005, 0x00c0, - 0x3523, 0x704b, 0x0015, 0xd6dc, 0x00c0, 0x352c, 0x68b4, 0xd0dc, - 0x0040, 0x352c, 0x6ca8, 0x6da4, 0x6c2e, 0x6d32, 0x0078, 0x4326, - 0xd6f4, 0x0040, 0x3539, 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, - 0x4326, 0x68b4, 0xa084, 0x4800, 0xa635, 0xd6f4, 0x00c0, 0x3533, - 0x7048, 0xa005, 0x00c0, 0x3546, 0x704b, 0x0015, 0x2408, 0x2510, - 0x2700, 0x80fb, 0x00c8, 0x354d, 0x8000, 0xa084, 0x003f, 0xa108, - 0xa291, 0x0000, 0x692e, 0x6a32, 0x2100, 0xa205, 0x00c0, 0x355a, - 0x0078, 0x4326, 0x7000, 0xa086, 0x0006, 0x0040, 0x3561, 0x0078, - 0x4326, 0x007c, 0x6008, 0xc0cd, 0xd3cc, 0x0040, 0x3568, 0xc08d, - 0x600a, 0x681b, 0x0006, 0x688f, 0x0000, 0x6893, 0x0000, 0x6a30, - 0x692c, 0x6a3e, 0x6942, 0x682f, 0x0003, 0x6833, 0x0000, 0x6837, - 0x0020, 0x6897, 0x0000, 0x689b, 0x0020, 0x7000, 0x0079, 0x3580, - 0x2946, 0x3592, 0x358a, 0x3588, 0x3588, 0x3588, 0x3588, 0x3588, - 0x1078, 0x28ec, 0x6820, 0xd084, 0x00c0, 0x3592, 0x1078, 0x3bb5, - 0x0078, 0x3598, 0x705c, 0x2c50, 0x2060, 0x6800, 0x6002, 0x2a60, - 0x3208, 0xa18c, 0x0300, 0x0040, 0x35a1, 0x2021, 0x4a58, 0x0078, - 0x35a3, 0x2021, 0x4a98, 0x2404, 0xa005, 0x0040, 0x35aa, 0x2020, - 0x0078, 0x35a3, 0x2d22, 0x206b, 0x0000, 0x007c, 0x1078, 0x3bbc, - 0x1078, 0x3bd2, 0x6008, 0xc0cc, 0x600a, 0x682b, 0x0000, 0x789b, - 0x000e, 0x6f14, 0x6817, 0x0002, 0x3208, 0xa18c, 0x0300, 0x0040, - 0x35c5, 0x2009, 0x0000, 0x0078, 0x35c7, 0x2009, 0x0001, 0x1078, - 0x471a, 0xd6dc, 0x0040, 0x35cf, 0x691c, 0xc1ed, 0x691e, 0x6818, - 0xd0fc, 0x0040, 0x35de, 0x7868, 0xa08c, 0x00ff, 0x0040, 0x35dc, - 0x681b, 0x001e, 0x0078, 0x35de, 0x681b, 0x0000, 0xb284, 0x0300, - 0x00c0, 0x35e6, 0x2021, 0x4a98, 0x0078, 0x35e8, 0x2021, 0x4a58, - 0x6800, 0x2022, 0x6a3c, 0x6940, 0x6a32, 0x692e, 0x1078, 0x202a, - 0x0078, 0x2946, 0x7cd8, 0x7ddc, 0x7fd0, 0x1078, 0x34e8, 0x682b, - 0x0000, 0x789b, 0x000e, 0x6f14, 0x1078, 0x4135, 0xa08c, 0x00ff, - 0x6916, 0x6818, 0xd0fc, 0x0040, 0x3607, 0x7048, 0x681a, 0xa68c, - 0xdf00, 0x691e, 0x7067, 0x0000, 0x0078, 0x2946, 0x7000, 0xa005, - 0x00c0, 0x3614, 0x0078, 0x2946, 0xa006, 0x1078, 0x4326, 0x6817, - 0x0000, 0x681b, 0x0014, 0xa68c, 0xdf00, 0x691e, 0x682b, 0x0000, - 0x6820, 0xa084, 0x00ff, 0x6822, 0x7000, 0x0079, 0x3627, 0x2946, - 0x3634, 0x3631, 0x3636, 0x3636, 0x3636, 0x362f, 0x362f, 0x1078, - 0x28ec, 0x6008, 0xc0d4, 0x600a, 0x1078, 0x3bd2, 0x6008, 0xc0a4, - 0x600a, 0x0078, 0x3b85, 0x2300, 0x0079, 0x363e, 0x3641, 0x3643, - 0x369f, 0x1078, 0x28ec, 0xd6fc, 0x00c0, 0x3686, 0x7000, 0xa00d, - 0x0079, 0x364a, 0x2946, 0x3654, 0x3654, 0x3678, 0x3654, 0x3683, - 0x3652, 0x3652, 0x1078, 0x28ec, 0xa684, 0x0060, 0xa086, 0x0060, - 0x00c0, 0x3675, 0xc6ac, 0xc6f4, 0xc6ed, 0x7e5a, 0x681c, 0xc0ac, - 0x681e, 0xa186, 0x0002, 0x0040, 0x3667, 0x1078, 0x4326, 0x1078, - 0x45f7, 0x781b, 0x0076, 0x71d4, 0xd1b4, 0x00c0, 0x2942, 0x70a4, - 0xa086, 0x0001, 0x00c0, 0x2989, 0x007c, 0xd6ec, 0x0040, 0x365c, - 0x6818, 0xd0fc, 0x0040, 0x3683, 0x681b, 0x0015, 0xd6f4, 0x0040, - 0x3683, 0x681b, 0x0007, 0x1078, 0x40d5, 0x007c, 0xc6fc, 0x7e5a, - 0x7adc, 0x79d8, 0x78d0, 0x801b, 0x00c8, 0x368f, 0x8000, 0xa084, - 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2, - 0x6b94, 0x2200, 0xa303, 0x68ae, 0x781b, 0x0076, 0x007c, 0x1078, - 0x28ec, 0x2300, 0x0079, 0x36a4, 0x36a9, 0x36c5, 0x3719, 0x1078, - 0x28ec, 0x7000, 0x0079, 0x36ac, 0x36b4, 0x36b6, 0x36b6, 0x36b4, - 0x36b4, 0x36b4, 0x36b4, 0x36b4, 0x1078, 0x28ec, 0x1078, 0x45f7, - 0x681c, 0xc0b4, 0x681e, 0x70d4, 0xd0b4, 0x00c0, 0x2942, 0x70a4, - 0xa086, 0x0001, 0x00c0, 0x2989, 0x007c, 0xd6fc, 0x00c0, 0x3709, - 0x7000, 0xa00d, 0x0079, 0x36cc, 0x2946, 0x36dc, 0x36d6, 0x3700, - 0x36dc, 0x3706, 0x36d4, 0x36d4, 0x1078, 0x28ec, 0x6894, 0x78d6, - 0x78de, 0x6898, 0x78d2, 0x78da, 0xa684, 0x0060, 0xa086, 0x0060, - 0x00c0, 0x36fd, 0xa6b4, 0xbfbf, 0xc6ed, 0x7e5a, 0xa186, 0x0002, - 0x0040, 0x36ec, 0x1078, 0x4326, 0x1078, 0x45f7, 0x781b, 0x0076, - 0x681c, 0xc0b4, 0x681e, 0x71d4, 0xd1b4, 0x00c0, 0x2942, 0x70a4, - 0xa086, 0x0001, 0x00c0, 0x2989, 0x007c, 0xd6ec, 0x0040, 0x36e4, - 0x6818, 0xd0fc, 0x0040, 0x3706, 0x681b, 0x0007, 0x781b, 0x00f0, - 0x007c, 0xc6fc, 0x7e5a, 0x7adc, 0x79d8, 0x6b98, 0x2100, 0xa302, - 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x79d2, 0x781b, 0x0076, - 0x007c, 0xd6dc, 0x0040, 0x3722, 0x782b, 0x3009, 0x781b, 0x0076, - 0x0078, 0x2942, 0x7884, 0xc0ac, 0x7886, 0x78e4, 0xa084, 0x0008, - 0x00c0, 0x3735, 0xa484, 0x0200, 0x0040, 0x372f, 0xc6f5, 0xc6dd, - 0x7e5a, 0x781b, 0x0076, 0x0078, 0x2942, 0x6820, 0xc095, 0x6822, - 0x1078, 0x4062, 0xc6dd, 0x1078, 0x3eae, 0x781b, 0x0075, 0x0078, - 0x2942, 0x2300, 0x0079, 0x3744, 0x3747, 0x3749, 0x374b, 0x1078, - 0x28ec, 0x0078, 0x3ea7, 0xd6d4, 0x00c0, 0x3771, 0x79e4, 0xd1ac, - 0x0040, 0x3759, 0x78ec, 0xa084, 0x0003, 0x0040, 0x3759, 0x782b, - 0x3009, 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, - 0x79e4, 0xd1ac, 0x0040, 0x3769, 0x78ec, 0xa084, 0x0003, 0x00c0, - 0x376d, 0x2001, 0x0014, 0x0078, 0x3304, 0xa184, 0x0007, 0x0079, - 0x37a7, 0x7a90, 0xa294, 0x0007, 0x789b, 0x0060, 0x79a8, 0x81ff, - 0x0040, 0x37a5, 0x789b, 0x0010, 0x7ba8, 0xa384, 0x0001, 0x00c0, - 0x3798, 0x7ba8, 0x7ba8, 0xa386, 0x0001, 0x00c0, 0x378b, 0x2009, - 0xfff7, 0x0078, 0x3791, 0xa386, 0x0003, 0x00c0, 0x3798, 0x2009, - 0xffef, 0x0c7e, 0x7058, 0x2060, 0x6004, 0xa104, 0x6006, 0x0c7f, - 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, 0x782b, - 0x3009, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0078, 0x40c9, 0x2fae, - 0x2fb8, 0x37b1, 0x37b7, 0x37af, 0x37af, 0x40c9, 0x40c9, 0x1078, - 0x28ec, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0078, 0x40cf, 0x6920, - 0xa18c, 0xfcff, 0x6922, 0x0078, 0x40c9, 0x79e4, 0xa184, 0x0030, - 0x0040, 0x37c7, 0x78ec, 0xa084, 0x0003, 0x00c0, 0x37f1, 0x7000, - 0xa086, 0x0004, 0x00c0, 0x37e1, 0x7064, 0xa086, 0x0002, 0x00c0, - 0x37d7, 0x2011, 0x0002, 0x2019, 0x0000, 0x0078, 0x2e43, 0x7064, - 0xa086, 0x0006, 0x0040, 0x37d1, 0x7064, 0xa086, 0x0004, 0x0040, - 0x37d1, 0x7000, 0xa086, 0x0000, 0x0040, 0x2942, 0x6820, 0xd0ac, - 0x00c0, 0x37ed, 0x6818, 0xc0fd, 0x681a, 0x2001, 0x0014, 0x0078, - 0x3304, 0xa184, 0x0007, 0x0079, 0x37f5, 0x40c9, 0x40c9, 0x37fd, - 0x40c9, 0x4111, 0x4111, 0x40c9, 0x40c9, 0xd6bc, 0x0040, 0x383f, - 0x7184, 0x81ff, 0x0040, 0x383f, 0xa182, 0x000d, 0x00d0, 0x380c, - 0x7087, 0x0000, 0x0078, 0x3811, 0xa182, 0x000c, 0x7086, 0x2009, - 0x000c, 0x789b, 0x0061, 0x79aa, 0x157e, 0x137e, 0x147e, 0x7088, - 0x8114, 0xa210, 0x728a, 0xa080, 0x000b, 0xad00, 0x2098, 0xb284, - 0x0300, 0x0040, 0x3833, 0x007e, 0x2001, 0x4a04, 0x2004, 0xd0ec, - 0x007f, 0x0040, 0x382f, 0x20a1, 0x012b, 0x0078, 0x3835, 0x20a1, - 0x022b, 0x0078, 0x3835, 0x20a1, 0x012b, 0x789b, 0x0000, 0x8108, - 0x81ac, 0x53a6, 0x147f, 0x137f, 0x157f, 0x0078, 0x40cf, 0xd6d4, - 0x00c0, 0x3893, 0x6820, 0xd084, 0x0040, 0x40cf, 0xa68c, 0x0060, - 0xa684, 0x0060, 0x0040, 0x3851, 0xa086, 0x0060, 0x00c0, 0x3851, - 0xc1f5, 0xc194, 0x795a, 0x69b6, 0x789b, 0x0060, 0x78ab, 0x0000, - 0x789b, 0x0061, 0x6818, 0xc0fd, 0x681a, 0x78aa, 0x8008, 0x810c, - 0x0040, 0x3beb, 0xa18c, 0x00f8, 0x00c0, 0x3beb, 0x157e, 0x137e, - 0x147e, 0x017e, 0x3208, 0xa18c, 0x0300, 0x0040, 0x387f, 0x007e, - 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x387b, 0x20a1, - 0x012b, 0x0078, 0x3881, 0x20a1, 0x022b, 0x0078, 0x3881, 0x20a1, - 0x012b, 0x017f, 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b, - 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 0x6814, 0xc0fc, 0x8007, - 0x7882, 0x0078, 0x40cf, 0x6818, 0xd0fc, 0x0040, 0x3899, 0x681b, - 0x0008, 0x6820, 0xc0ad, 0x6822, 0x1078, 0x3eb6, 0x781b, 0x00e1, - 0x007c, 0x2300, 0x0079, 0x38a4, 0x38a9, 0x397b, 0x38a7, 0x1078, - 0x28ec, 0x7cd8, 0x7ddc, 0x7fd0, 0x82ff, 0x00c0, 0x38d1, 0x7200, - 0xa286, 0x0003, 0x0040, 0x32d2, 0x71d4, 0xd1b4, 0x0078, 0x38d4, - 0x0040, 0x38d4, 0x0d7e, 0x783b, 0x8800, 0x781b, 0x004c, 0x70bc, - 0xa06d, 0x68b4, 0xc0a5, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, - 0x78d2, 0x78da, 0xc1b4, 0x71d6, 0x7003, 0x0030, 0x0d7f, 0x0078, - 0x38d8, 0x7200, 0x0078, 0x38d8, 0x783b, 0x1800, 0x781b, 0x004a, - 0xa284, 0x000f, 0x0079, 0x38dc, 0x3966, 0x391a, 0x38e6, 0x3300, - 0x38e4, 0x3966, 0x38e4, 0x38e4, 0x1078, 0x28ec, 0x681c, 0xd0ec, - 0x0040, 0x38ed, 0x6008, 0xc08d, 0x600a, 0x6920, 0xc185, 0x6922, - 0x6800, 0x6006, 0xa005, 0x00c0, 0x38f6, 0x6002, 0x6008, 0xc0d4, - 0x600a, 0x681c, 0xa084, 0x000e, 0x00c0, 0x390a, 0xb284, 0x0300, - 0x0040, 0x3906, 0x2009, 0x90c0, 0x0078, 0x390f, 0x2009, 0x91d0, - 0x0078, 0x390f, 0x7030, 0x68ba, 0x7140, 0x70cc, 0xa108, 0x2104, - 0x6802, 0x2d0a, 0x715e, 0xd6dc, 0x00c0, 0x391a, 0xc6fc, 0x6eb6, - 0x0078, 0x3966, 0x6eb6, 0xa684, 0x0060, 0x0040, 0x3966, 0xd6dc, - 0x00c0, 0x392d, 0xa684, 0x7fff, 0x68b6, 0x6894, 0x68a6, 0x6898, - 0x68aa, 0x1078, 0x4326, 0x0078, 0x3966, 0xd6ac, 0x0040, 0x3939, - 0xa006, 0x1078, 0x4326, 0x2408, 0x2510, 0x69aa, 0x6aa6, 0x0078, - 0x3949, 0x2408, 0x2510, 0x2700, 0x801b, 0x00c8, 0x3940, 0x8000, - 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x69aa, 0x6aa6, 0x1078, - 0x4326, 0xd6fc, 0x0040, 0x3966, 0xa684, 0x7fff, 0x68b6, 0x2510, - 0x2408, 0xd6ac, 0x00c0, 0x395e, 0x2700, 0x801b, 0x00c8, 0x3959, - 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, - 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x7000, 0xa086, - 0x0030, 0x00c0, 0x2946, 0x7003, 0x0002, 0x70bc, 0xa06d, 0x68bc, - 0x7042, 0x70b8, 0xa065, 0x68c0, 0x705a, 0x2d00, 0x704e, 0xad80, - 0x0009, 0x7046, 0x007c, 0xa586, 0x8800, 0x00c0, 0x3988, 0x7003, - 0x0000, 0x6018, 0x8001, 0x601a, 0x6008, 0xa084, 0xfbef, 0x600a, - 0x0078, 0x3ea7, 0x7047, 0x0000, 0xa282, 0x0006, 0x0050, 0x3992, - 0x1078, 0x28ec, 0x2300, 0x0079, 0x3995, 0x3998, 0x39cf, 0x3a01, - 0x2200, 0x0079, 0x399b, 0x39a1, 0x3ea7, 0x39a3, 0x39a1, 0x3a38, - 0x3a9b, 0x1078, 0x28ec, 0x7003, 0x0005, 0xb284, 0x0300, 0x0040, - 0x39ad, 0x2001, 0x91e0, 0x0078, 0x39af, 0x2001, 0x9212, 0x2068, + 0x32fb, 0x1078, 0x290c, 0x7aa8, 0xa294, 0x00ff, 0x78a8, 0xa084, + 0x00ff, 0xa08a, 0x0004, 0x00c8, 0x4040, 0x0079, 0x3307, 0x4040, + 0x3dce, 0x4040, 0x3f41, 0xa282, 0x0000, 0x00c0, 0x3311, 0x1078, + 0x290c, 0x1078, 0x4051, 0x781b, 0x0075, 0x007c, 0xa282, 0x0003, + 0x00c0, 0x331c, 0x1078, 0x290c, 0xd4fc, 0x00c0, 0x333c, 0x7064, + 0xa005, 0x0040, 0x3325, 0x1078, 0x290c, 0x6f14, 0x7776, 0xa7bc, + 0x8f00, 0x1078, 0x4187, 0x6008, 0xa085, 0x0021, 0x600a, 0x8738, + 0xa784, 0x001f, 0x00c0, 0x3329, 0x1078, 0x4055, 0x7067, 0x0002, + 0x701f, 0x0009, 0x0078, 0x333e, 0x1078, 0x4064, 0x781b, 0x0075, + 0x007c, 0xa282, 0x0004, 0x0050, 0x3347, 0x1078, 0x290c, 0x2300, + 0x0079, 0x334a, 0x334d, 0x350d, 0x3550, 0xa286, 0x0003, 0x0040, + 0x3385, 0x7200, 0x7cd8, 0x7ddc, 0x7fd0, 0x71d4, 0xd1bc, 0x00c0, + 0x337d, 0xd1b4, 0x0040, 0x337d, 0x7868, 0xa084, 0x00ff, 0x00c0, + 0x337d, 0xa282, 0x0002, 0x00c8, 0x337d, 0x0d7e, 0x783b, 0x8300, + 0x781b, 0x004c, 0x70bc, 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6, + 0x78de, 0x6898, 0x78d2, 0x78da, 0xc1b4, 0x71d6, 0x7003, 0x0030, + 0x0d7f, 0x2001, 0x0000, 0x0078, 0x3389, 0x783b, 0x1300, 0x781b, + 0x004a, 0x2001, 0x0000, 0x0078, 0x3389, 0x7200, 0x7cd8, 0x7ddc, + 0x7fd0, 0x704a, 0x68a0, 0xd0ec, 0x0040, 0x3391, 0x6008, 0xc08d, + 0x600a, 0xa284, 0x000f, 0x0079, 0x3395, 0x34ed, 0x33a2, 0x339f, + 0x3653, 0x36df, 0x2966, 0x339d, 0x339d, 0x1078, 0x290c, 0x6008, + 0xc0d4, 0x600a, 0xd6e4, 0x0040, 0x33aa, 0x7048, 0xa086, 0x0014, + 0x00c0, 0x33ca, 0x1078, 0x44fb, 0x2009, 0x0000, 0x6818, 0xd0fc, + 0x0040, 0x33b3, 0x7048, 0xa086, 0x0014, 0x0040, 0x33c4, 0x6818, + 0xa086, 0x0008, 0x00c0, 0x34a5, 0x7858, 0xd09c, 0x0040, 0x34a5, + 0x6820, 0xd0ac, 0x0040, 0x34a5, 0x681b, 0x0014, 0x2009, 0x0002, + 0x0078, 0x3409, 0x7868, 0xa08c, 0x00ff, 0x0040, 0x3409, 0xa186, + 0x0008, 0x00c0, 0x33e0, 0x6008, 0xc0a4, 0x600a, 0x1078, 0x3cf5, + 0x0040, 0x3409, 0x1078, 0x3d73, 0x1078, 0x44fb, 0x0078, 0x33f1, + 0xa186, 0x0028, 0x00c0, 0x3409, 0x6018, 0xa005, 0x0040, 0x33d3, + 0x8001, 0x0040, 0x33d3, 0x8001, 0x0040, 0x33d3, 0x601e, 0x0078, + 0x33d3, 0x6820, 0xd084, 0x0040, 0x2966, 0xc084, 0x6822, 0x1078, + 0x2a6d, 0x705c, 0x0c7e, 0x2060, 0x6800, 0x6002, 0x0c7f, 0x6004, + 0x6802, 0xa005, 0x2d00, 0x00c0, 0x3406, 0x6002, 0x6006, 0x0078, + 0x2966, 0x017e, 0x81ff, 0x00c0, 0x3453, 0x7000, 0xa086, 0x0030, + 0x0040, 0x3453, 0x71d4, 0xd1bc, 0x00c0, 0x3453, 0xd1b4, 0x00c0, + 0x343a, 0x7060, 0xa005, 0x00c0, 0x3453, 0x70a4, 0xa086, 0x0001, + 0x0040, 0x3453, 0x7003, 0x0000, 0x047e, 0x057e, 0x077e, 0x067e, + 0x0c7e, 0x0d7e, 0x1078, 0x298f, 0x0d7f, 0x0c7f, 0x067f, 0x077f, + 0x057f, 0x047f, 0x71d4, 0xd1b4, 0x00c0, 0x3453, 0x7003, 0x0040, + 0x0078, 0x3453, 0x1078, 0x42e9, 0x00c0, 0x3453, 0x781b, 0x005b, + 0x0d7e, 0x70bc, 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, + 0x6898, 0x78d2, 0x78da, 0xc1b4, 0x71d6, 0x7003, 0x0030, 0x7808, + 0xc08d, 0x780a, 0x0d7f, 0x1078, 0x358a, 0x017f, 0x81ff, 0x0040, + 0x34a5, 0xa684, 0xdf00, 0x681e, 0x682b, 0x0000, 0x6f14, 0xa186, + 0x0002, 0x00c0, 0x34a6, 0x6818, 0xa086, 0x0014, 0x00c0, 0x346f, + 0x2008, 0xd6e4, 0x0040, 0x346f, 0x7868, 0xa08c, 0x00ff, 0x1078, + 0x2a5b, 0x1078, 0x2a7c, 0x6820, 0xd0dc, 0x00c0, 0x34a6, 0x8717, + 0xa294, 0x000f, 0x8213, 0x8213, 0x8213, 0xb284, 0x0300, 0x0040, + 0x3485, 0xa290, 0x51c0, 0x0078, 0x3487, 0xa290, 0x5240, 0xa290, + 0x0000, 0x221c, 0xd3c4, 0x00c0, 0x348f, 0x0078, 0x3495, 0x8210, + 0x2204, 0xa085, 0x0018, 0x2012, 0x8211, 0xd3d4, 0x0040, 0x34a0, + 0x68a0, 0xd0c4, 0x00c0, 0x34a0, 0x1078, 0x3604, 0x0078, 0x2966, + 0x6008, 0xc08d, 0x600a, 0x0078, 0x34a6, 0x692a, 0x6916, 0x6818, + 0xd0fc, 0x0040, 0x34ad, 0x7048, 0x681a, 0xa68c, 0xdf00, 0x691e, + 0x6410, 0x84ff, 0x0040, 0x34c2, 0x2009, 0x4d02, 0x2104, 0x8001, + 0x200a, 0x8421, 0x6412, 0x00c0, 0x34c2, 0x2021, 0x4d04, 0x2404, + 0xc0a5, 0x2022, 0x6018, 0xa005, 0x0040, 0x34ca, 0x8001, 0x601a, + 0x00c0, 0x34cd, 0x6008, 0xc0a4, 0x600a, 0x6820, 0xd084, 0x00c0, + 0x34d9, 0x6800, 0xa005, 0x00c0, 0x34d6, 0x6002, 0x6006, 0x0078, + 0x34dd, 0x705c, 0x2060, 0x6800, 0x6002, 0x2061, 0x4d00, 0x6887, + 0x0103, 0x2d08, 0x206b, 0x0000, 0x6068, 0xa005, 0x616a, 0x0040, + 0x34ec, 0x2d02, 0x0078, 0x34ed, 0x616e, 0x7200, 0xa286, 0x0030, + 0x0040, 0x34fd, 0xa286, 0x0040, 0x00c0, 0x2966, 0x7003, 0x0002, + 0x704c, 0x2068, 0x68c4, 0x2060, 0x007c, 0x7003, 0x0002, 0x70bc, + 0xa06d, 0x68bc, 0x7042, 0x70b8, 0xa065, 0x68c0, 0x705a, 0x2d00, + 0x704e, 0xad80, 0x0009, 0x7046, 0x007c, 0xa282, 0x0004, 0x0048, + 0x3513, 0x1078, 0x290c, 0x2200, 0x0079, 0x3516, 0x351a, 0x352b, + 0x3538, 0x352b, 0xa586, 0x1300, 0x0040, 0x352b, 0xa586, 0x8300, + 0x00c0, 0x3511, 0x7003, 0x0000, 0x6018, 0x8001, 0x601a, 0x6008, + 0xa084, 0xfbef, 0x600a, 0x7000, 0xa086, 0x0005, 0x0040, 0x3535, + 0x1078, 0x4051, 0x781b, 0x0075, 0x007c, 0x781b, 0x0076, 0x007c, + 0x7890, 0x8007, 0x8001, 0xa084, 0x0007, 0xa080, 0x0018, 0x789a, + 0x79a8, 0xa18c, 0x00ff, 0xa186, 0x0003, 0x0040, 0x354d, 0xa186, + 0x0000, 0x0040, 0x354d, 0x0078, 0x4040, 0x781b, 0x0076, 0x007c, + 0x6820, 0xc095, 0x6822, 0x82ff, 0x00c0, 0x355a, 0x1078, 0x4051, + 0x0078, 0x3561, 0x8211, 0x0040, 0x355f, 0x1078, 0x290c, 0x1078, + 0x4064, 0x781b, 0x0075, 0x007c, 0x1078, 0x42fe, 0x7830, 0xa084, + 0x00c0, 0x00c0, 0x3587, 0x017e, 0x3208, 0x007e, 0x2001, 0x4d04, + 0x2004, 0xd0ec, 0x007f, 0x0040, 0x3579, 0xa18c, 0x0300, 0x0078, + 0x357b, 0xa18c, 0x0400, 0x017f, 0x0040, 0x3582, 0x0018, 0x3587, + 0x0078, 0x3584, 0x0028, 0x3587, 0x791a, 0xa006, 0x007c, 0xa085, + 0x0001, 0x007c, 0xa684, 0x0060, 0x00c0, 0x3594, 0x682f, 0x0000, + 0x6833, 0x0000, 0x0078, 0x3603, 0xd6dc, 0x00c0, 0x35ac, 0x68b4, + 0xd0dc, 0x00c0, 0x35ac, 0x6998, 0x6a94, 0x692e, 0x6a32, 0x7048, + 0xa005, 0x00c0, 0x35a9, 0x2200, 0xa105, 0x0040, 0x44fb, 0x704b, + 0x0015, 0x0078, 0x44fb, 0x007c, 0xd6ac, 0x0040, 0x35d2, 0xd6f4, + 0x0040, 0x35b8, 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x44fb, + 0x68b4, 0xa084, 0x4000, 0xa635, 0xd6f4, 0x00c0, 0x35b2, 0x7048, + 0xa005, 0x00c0, 0x35c5, 0x704b, 0x0015, 0xd6dc, 0x00c0, 0x35ce, + 0x68b4, 0xd0dc, 0x0040, 0x35ce, 0x6ca8, 0x6da4, 0x6c2e, 0x6d32, + 0x0078, 0x44fb, 0xd6f4, 0x0040, 0x35db, 0x682f, 0x0000, 0x6833, + 0x0000, 0x0078, 0x44fb, 0x68b4, 0xa084, 0x4800, 0xa635, 0xd6f4, + 0x00c0, 0x35d5, 0x7048, 0xa005, 0x00c0, 0x35e8, 0x704b, 0x0015, + 0x2408, 0x2510, 0x2700, 0x80fb, 0x00c8, 0x35ef, 0x8000, 0xa084, + 0x003f, 0xa108, 0xa291, 0x0000, 0x692e, 0x6a32, 0x2100, 0xa205, + 0x00c0, 0x35fc, 0x0078, 0x44fb, 0x7000, 0xa086, 0x0006, 0x0040, + 0x3603, 0x0078, 0x44fb, 0x007c, 0x6946, 0x6008, 0xc0cd, 0xd3cc, + 0x0040, 0x360b, 0xc08d, 0x600a, 0x6818, 0x683a, 0x681b, 0x0006, + 0x688f, 0x0000, 0x6893, 0x0000, 0x6a30, 0x692c, 0x6a3e, 0x6942, + 0x682f, 0x0003, 0x6833, 0x0000, 0x6837, 0x0020, 0x6897, 0x0000, + 0x689b, 0x0020, 0x7000, 0x0079, 0x3625, 0x2966, 0x3637, 0x362f, + 0x362d, 0x362d, 0x362d, 0x362d, 0x362d, 0x1078, 0x290c, 0x6820, + 0xd084, 0x00c0, 0x3637, 0x1078, 0x3d56, 0x0078, 0x363d, 0x705c, + 0x2c50, 0x2060, 0x6800, 0x6002, 0x2a60, 0x3208, 0xa18c, 0x0300, + 0x0040, 0x3646, 0x2021, 0x4d58, 0x0078, 0x3648, 0x2021, 0x4d98, + 0x2404, 0xa005, 0x0040, 0x364f, 0x2020, 0x0078, 0x3648, 0x2d22, + 0x206b, 0x0000, 0x007c, 0x1078, 0x3d5d, 0x1078, 0x3d73, 0x6008, + 0xc0cc, 0x600a, 0x682b, 0x0000, 0x789b, 0x000e, 0x6f14, 0x6938, + 0x691a, 0x6944, 0x6916, 0x3208, 0xa18c, 0x0300, 0x0040, 0x366c, + 0x2009, 0x0000, 0x0078, 0x366e, 0x2009, 0x0001, 0x1078, 0x496f, + 0xd6dc, 0x0040, 0x3676, 0x691c, 0xc1ed, 0x691e, 0x6818, 0xd0fc, + 0x0040, 0x3685, 0x7868, 0xa08c, 0x00ff, 0x0040, 0x3683, 0x681b, + 0x001e, 0x0078, 0x3685, 0x681b, 0x0000, 0xb284, 0x0300, 0x00c0, + 0x368d, 0x2021, 0x4d98, 0x0078, 0x368f, 0x2021, 0x4d58, 0x6800, + 0x2022, 0x6a3c, 0x6940, 0x6a32, 0x692e, 0x68c0, 0x2060, 0x6000, + 0xd0a4, 0x0040, 0x36cf, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, + 0x0020, 0x0d7e, 0x0f7e, 0x157e, 0x147e, 0x2079, 0x4d00, 0x1078, + 0x1de6, 0x147f, 0x157f, 0x0f7f, 0x70cc, 0x2010, 0x2009, 0x0101, + 0x027e, 0x2204, 0xa06d, 0x0040, 0x36bf, 0x6814, 0xa706, 0x0040, + 0x36bc, 0x6800, 0x0078, 0x36b2, 0x6820, 0xc0d5, 0x6822, 0x027f, + 0x8210, 0x8109, 0x00c0, 0x36b0, 0x0d7f, 0x7067, 0x0003, 0x707f, + 0x0000, 0x7776, 0x7083, 0x000f, 0x71d4, 0xc1dc, 0x71d6, 0x6818, + 0xa086, 0x0002, 0x00c0, 0x36db, 0x6817, 0x0000, 0x682b, 0x0000, + 0x681c, 0xc0ec, 0x681e, 0x1078, 0x2013, 0x0078, 0x2966, 0x7cd8, + 0x7ddc, 0x7fd0, 0x1078, 0x358a, 0x682b, 0x0000, 0x789b, 0x000e, + 0x6f14, 0x1078, 0x4302, 0xa08c, 0x00ff, 0x6916, 0x6818, 0xd0fc, + 0x0040, 0x36f4, 0x7048, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x7067, + 0x0000, 0x0078, 0x2966, 0x7000, 0xa005, 0x00c0, 0x3701, 0x0078, + 0x2966, 0xa006, 0x1078, 0x44fb, 0x6920, 0xd1ac, 0x00c0, 0x370a, + 0x681b, 0x0014, 0xa68c, 0xdf00, 0x691e, 0x682b, 0x0000, 0x6820, + 0xa084, 0x00ff, 0x6822, 0x7000, 0x0079, 0x3716, 0x2966, 0x3720, + 0x3720, 0x3723, 0x3723, 0x3723, 0x371e, 0x371e, 0x1078, 0x290c, + 0x6818, 0x0078, 0x3385, 0x6008, 0xc0a4, 0x600a, 0x6817, 0x0000, + 0x0078, 0x3d1b, 0x2300, 0x0079, 0x372d, 0x3730, 0x3732, 0x379d, + 0x1078, 0x290c, 0xd6fc, 0x00c0, 0x3784, 0x7000, 0xa00d, 0x0079, + 0x3739, 0x2966, 0x3743, 0x3743, 0x3772, 0x3743, 0x3781, 0x3741, + 0x3741, 0x1078, 0x290c, 0xa684, 0x0060, 0x0040, 0x3772, 0xa086, + 0x0060, 0x00c0, 0x376f, 0xc6ac, 0xc6f4, 0xc6ed, 0x7e5a, 0x681c, + 0xc0ac, 0x681e, 0xa186, 0x0002, 0x0040, 0x3761, 0x1078, 0x44fb, + 0x69ac, 0x68b0, 0xa115, 0x0040, 0x3761, 0x1078, 0x486c, 0x0078, + 0x3763, 0x1078, 0x4834, 0x781b, 0x0076, 0x71d4, 0xd1b4, 0x00c0, + 0x2962, 0x70a4, 0xa086, 0x0001, 0x00c0, 0x29ac, 0x007c, 0xd6ec, + 0x0040, 0x374d, 0x6818, 0xd0fc, 0x0040, 0x3781, 0xd6f4, 0x00c0, + 0x377f, 0x681b, 0x0015, 0x781b, 0x0076, 0x0078, 0x2962, 0x681b, + 0x0007, 0x1078, 0x42a2, 0x007c, 0xc6fc, 0x7e5a, 0x7adc, 0x79d8, + 0x78d0, 0x801b, 0x00c8, 0x378d, 0x8000, 0xa084, 0x003f, 0xa108, + 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, + 0xa303, 0x68ae, 0x781b, 0x0076, 0x007c, 0x1078, 0x290c, 0x2300, + 0x0079, 0x37a2, 0x37a7, 0x37cc, 0x382b, 0x1078, 0x290c, 0x7000, + 0x0079, 0x37aa, 0x37b2, 0x37b4, 0x37bd, 0x37b2, 0x37b2, 0x37b2, + 0x37b2, 0x37b2, 0x1078, 0x290c, 0x69ac, 0x68b0, 0xa115, 0x0040, + 0x37bd, 0x1078, 0x486c, 0x0078, 0x37bf, 0x1078, 0x4834, 0x681c, + 0xc0b4, 0x681e, 0x70d4, 0xd0b4, 0x00c0, 0x2962, 0x70a4, 0xa086, + 0x0001, 0x00c0, 0x29ac, 0x007c, 0xd6fc, 0x00c0, 0x381b, 0x7000, + 0xa00d, 0x0079, 0x37d3, 0x2966, 0x37e3, 0x37dd, 0x3812, 0x37e3, + 0x3818, 0x37db, 0x37db, 0x1078, 0x290c, 0x6894, 0x78d6, 0x78de, + 0x6898, 0x78d2, 0x78da, 0xa684, 0x0060, 0x0040, 0x3812, 0xa086, + 0x0060, 0x00c0, 0x380f, 0xa6b4, 0xbfbf, 0xc6ed, 0x7e5a, 0xa186, + 0x0002, 0x0040, 0x37fe, 0x1078, 0x44fb, 0x69ac, 0x68b0, 0xa115, + 0x0040, 0x37fe, 0x1078, 0x486c, 0x0078, 0x3800, 0x1078, 0x4834, + 0x781b, 0x0076, 0x681c, 0xc0b4, 0x681e, 0x71d4, 0xd1b4, 0x00c0, + 0x2962, 0x70a4, 0xa086, 0x0001, 0x00c0, 0x29ac, 0x007c, 0xd6ec, + 0x0040, 0x37ed, 0x6818, 0xd0fc, 0x0040, 0x3818, 0x681b, 0x0007, + 0x781b, 0x00f6, 0x007c, 0xc6fc, 0x7e5a, 0x7adc, 0x79d8, 0x6b98, + 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x79d2, + 0x781b, 0x0076, 0x007c, 0xd6dc, 0x0040, 0x3834, 0x782b, 0x3009, + 0x781b, 0x0076, 0x0078, 0x2962, 0x7884, 0xc0ac, 0x7886, 0x78e4, + 0xa084, 0x0008, 0x00c0, 0x3847, 0xa484, 0x0200, 0x0040, 0x3841, + 0xc6f5, 0xc6dd, 0x7e5a, 0x781b, 0x0076, 0x0078, 0x2962, 0x6820, + 0xc095, 0x6822, 0x1078, 0x421b, 0xc6dd, 0x1078, 0x4051, 0x781b, + 0x0075, 0x0078, 0x2962, 0x2300, 0x0079, 0x3856, 0x3859, 0x385b, + 0x385d, 0x1078, 0x290c, 0x0078, 0x404a, 0xd6d4, 0x00c0, 0x3883, + 0x79e4, 0xd1ac, 0x0040, 0x386b, 0x78ec, 0xa084, 0x0003, 0x0040, + 0x386b, 0x782b, 0x3009, 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, + 0xfffb, 0x785a, 0x79e4, 0xd1ac, 0x0040, 0x387b, 0x78ec, 0xa084, + 0x0003, 0x00c0, 0x387f, 0x2001, 0x0014, 0x0078, 0x3385, 0xa184, + 0x0007, 0x0079, 0x38b9, 0x7a90, 0xa294, 0x0007, 0x789b, 0x0060, + 0x79a8, 0x81ff, 0x0040, 0x38b7, 0x789b, 0x0010, 0x7ba8, 0xa384, + 0x0001, 0x00c0, 0x38aa, 0x7ba8, 0x7ba8, 0xa386, 0x0001, 0x00c0, + 0x389d, 0x2009, 0xfff7, 0x0078, 0x38a3, 0xa386, 0x0003, 0x00c0, + 0x38aa, 0x2009, 0xffef, 0x0c7e, 0x7058, 0x2060, 0x6004, 0xa104, + 0x6006, 0x0c7f, 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb, + 0x785a, 0x782b, 0x3009, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0078, + 0x4296, 0x302e, 0x3038, 0x38c3, 0x38c9, 0x38c1, 0x38c1, 0x4296, + 0x4296, 0x1078, 0x290c, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0078, + 0x429c, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0078, 0x4296, 0x79e4, + 0xa184, 0x0030, 0x0040, 0x38d9, 0x78ec, 0xa084, 0x0003, 0x00c0, + 0x390d, 0x7000, 0xa086, 0x0004, 0x00c0, 0x38f3, 0x7064, 0xa086, + 0x0002, 0x00c0, 0x38e9, 0x2011, 0x0002, 0x2019, 0x0000, 0x0078, + 0x2eba, 0x7064, 0xa086, 0x0006, 0x0040, 0x38e3, 0x7064, 0xa086, + 0x0004, 0x0040, 0x38e3, 0x7000, 0xa086, 0x0000, 0x0040, 0x2962, + 0x6920, 0xa184, 0x0420, 0x0040, 0x3902, 0xc1d4, 0x6922, 0x6818, + 0x0078, 0x3385, 0x6818, 0xa08e, 0x0002, 0x0040, 0x390b, 0xc0fd, + 0x681a, 0x2001, 0x0014, 0x0078, 0x3385, 0xa184, 0x0007, 0x0079, + 0x3911, 0x4296, 0x4296, 0x3919, 0x4296, 0x42de, 0x42de, 0x4296, + 0x4296, 0xd6bc, 0x0040, 0x395b, 0x7184, 0x81ff, 0x0040, 0x395b, + 0xa182, 0x000d, 0x00d0, 0x3928, 0x7087, 0x0000, 0x0078, 0x392d, + 0xa182, 0x000c, 0x7086, 0x2009, 0x000c, 0x789b, 0x0061, 0x79aa, + 0x157e, 0x137e, 0x147e, 0x7088, 0x8114, 0xa210, 0x728a, 0xa080, + 0x000b, 0xad00, 0x2098, 0xb284, 0x0300, 0x0040, 0x394f, 0x007e, + 0x2001, 0x4d04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x394b, 0x20a1, + 0x012b, 0x0078, 0x3951, 0x20a1, 0x022b, 0x0078, 0x3951, 0x20a1, + 0x012b, 0x789b, 0x0000, 0x8108, 0x81ac, 0x53a6, 0x147f, 0x137f, + 0x157f, 0x0078, 0x429c, 0xd6d4, 0x00c0, 0x39af, 0x6820, 0xd084, + 0x0040, 0x429c, 0xa68c, 0x0060, 0xa684, 0x0060, 0x0040, 0x396d, + 0xa086, 0x0060, 0x00c0, 0x396d, 0xc1f5, 0xc194, 0x795a, 0x69b6, + 0x789b, 0x0060, 0x78ab, 0x0000, 0x789b, 0x0061, 0x6818, 0xc0fd, + 0x681a, 0x78aa, 0x8008, 0x810c, 0x0040, 0x3d8c, 0xa18c, 0x00f8, + 0x00c0, 0x3d8c, 0x157e, 0x137e, 0x147e, 0x017e, 0x3208, 0xa18c, + 0x0300, 0x0040, 0x399b, 0x007e, 0x2001, 0x4d04, 0x2004, 0xd0ec, + 0x007f, 0x0040, 0x3997, 0x20a1, 0x012b, 0x0078, 0x399d, 0x20a1, + 0x022b, 0x0078, 0x399d, 0x20a1, 0x012b, 0x017f, 0x789b, 0x0000, + 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f, + 0x157f, 0x6814, 0xc0fc, 0x8007, 0x7882, 0x0078, 0x429c, 0x6818, + 0xd0fc, 0x0040, 0x39b5, 0x681b, 0x0008, 0x6820, 0xc0ad, 0x6822, + 0x1078, 0x4059, 0x781b, 0x00e7, 0x007c, 0x2300, 0x0079, 0x39c0, + 0x39c5, 0x3a9d, 0x39c3, 0x1078, 0x290c, 0x7cd8, 0x7ddc, 0x7fd0, + 0x82ff, 0x00c0, 0x39ee, 0x7200, 0xa286, 0x0003, 0x0040, 0x3352, + 0x71d4, 0xd1bc, 0x00c0, 0x39f1, 0xd1b4, 0x0040, 0x39f1, 0x0d7e, + 0x783b, 0x8800, 0x781b, 0x004c, 0x70bc, 0xa06d, 0x68b4, 0xc0a5, + 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0xc1b4, + 0x71d6, 0x7003, 0x0030, 0x0d7f, 0x0078, 0x39f5, 0x7200, 0x0078, + 0x39f5, 0x783b, 0x1800, 0x781b, 0x004a, 0xa284, 0x000f, 0x0079, + 0x39f9, 0x3a88, 0x3a37, 0x3a03, 0x3381, 0x3a01, 0x3a88, 0x3a01, + 0x3a01, 0x1078, 0x290c, 0x681c, 0xd0ec, 0x0040, 0x3a0a, 0x6008, + 0xc08d, 0x600a, 0x6920, 0xc185, 0x6922, 0x6800, 0x6006, 0xa005, + 0x00c0, 0x3a13, 0x6002, 0x6008, 0xc0d4, 0x600a, 0x681c, 0xa084, + 0x000e, 0x00c0, 0x3a27, 0xb284, 0x0300, 0x0040, 0x3a23, 0x2009, + 0x93c0, 0x0078, 0x3a2c, 0x2009, 0x94d0, 0x0078, 0x3a2c, 0x7030, + 0x68ba, 0x7140, 0x70cc, 0xa108, 0x2104, 0x6802, 0x2d0a, 0x715e, + 0xd6dc, 0x00c0, 0x3a37, 0xc6fc, 0x6eb6, 0x0078, 0x3a88, 0x6eb6, + 0xa684, 0x0060, 0x00c0, 0x3a41, 0xa684, 0x7fff, 0x68b6, 0x0078, + 0x3a88, 0xd6dc, 0x00c0, 0x3a4f, 0xa684, 0x7fff, 0x68b6, 0x6894, + 0x68a6, 0x6898, 0x68aa, 0x1078, 0x44fb, 0x0078, 0x3a88, 0xd6ac, + 0x0040, 0x3a5b, 0xa006, 0x1078, 0x44fb, 0x2408, 0x2510, 0x69aa, + 0x6aa6, 0x0078, 0x3a6b, 0x2408, 0x2510, 0x2700, 0x801b, 0x00c8, + 0x3a62, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x69aa, + 0x6aa6, 0x1078, 0x44fb, 0xd6fc, 0x0040, 0x3a88, 0xa684, 0x7fff, + 0x68b6, 0x2510, 0x2408, 0xd6ac, 0x00c0, 0x3a80, 0x2700, 0x801b, + 0x00c8, 0x3a7b, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, + 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, + 0x7000, 0xa086, 0x0030, 0x00c0, 0x2966, 0x7003, 0x0002, 0x70bc, + 0xa06d, 0x68bc, 0x7042, 0x70b8, 0xa065, 0x68c0, 0x705a, 0x2d00, + 0x704e, 0xad80, 0x0009, 0x7046, 0x007c, 0xa586, 0x8800, 0x00c0, + 0x3aaa, 0x7003, 0x0000, 0x6018, 0x8001, 0x601a, 0x6008, 0xa084, + 0xfbef, 0x600a, 0x0078, 0x404a, 0x7047, 0x0000, 0xa282, 0x0006, + 0x0050, 0x3ab4, 0x1078, 0x290c, 0x2300, 0x0079, 0x3ab7, 0x3aba, + 0x3af1, 0x3b23, 0x2200, 0x0079, 0x3abd, 0x3ac3, 0x404a, 0x3ac5, + 0x3ac3, 0x3b5a, 0x3bc2, 0x1078, 0x290c, 0x7003, 0x0005, 0xb284, + 0x0300, 0x0040, 0x3acf, 0x2001, 0x94e0, 0x0078, 0x3ad1, 0x2001, + 0x9512, 0x2068, 0x704e, 0x157e, 0x20a9, 0x0032, 0x2003, 0x0000, + 0x8000, 0x00f0, 0x3ad6, 0x157f, 0xb284, 0x0300, 0x0040, 0x3ae4, + 0x6817, 0x0000, 0x0078, 0x3ae6, 0x6817, 0x8000, 0xad80, 0x0009, + 0x7046, 0x68b7, 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, 0x0078, + 0x4040, 0x7000, 0xa086, 0x0002, 0x00c0, 0x3b02, 0x1078, 0x3d73, + 0x0078, 0x3afc, 0x1078, 0x44fb, 0x6008, 0xa084, 0xfbef, 0x600a, + 0x0078, 0x3b07, 0x7000, 0xa086, 0x0003, 0x0040, 0x3afa, 0x7003, + 0x0005, 0xb284, 0x0300, 0x0040, 0x3b11, 0x2001, 0x94e0, 0x0078, + 0x3b13, 0x2001, 0x9512, 0x2068, 0x704e, 0xad80, 0x0009, 0x7046, + 0x2200, 0x0079, 0x3b1b, 0x404a, 0x3b21, 0x3b21, 0x3b5a, 0x3b21, + 0x404a, 0x1078, 0x290c, 0x7000, 0xa086, 0x0002, 0x00c0, 0x3b34, + 0x1078, 0x3d73, 0x0078, 0x3b2e, 0x1078, 0x44fb, 0x6008, 0xa084, + 0xfbef, 0x600a, 0x0078, 0x3b39, 0x7000, 0xa086, 0x0003, 0x0040, + 0x3b2c, 0x7003, 0x0005, 0xb284, 0x0300, 0x0040, 0x3b43, 0x2001, + 0x94e0, 0x0078, 0x3b45, 0x2001, 0x9512, 0x2068, 0x704e, 0xad80, + 0x0009, 0x7046, 0x2200, 0x0079, 0x3b4d, 0x3b55, 0x3b53, 0x3b53, + 0x3b55, 0x3b53, 0x3b55, 0x1078, 0x290c, 0x1078, 0x4064, 0x781b, + 0x0075, 0x007c, 0x7000, 0xa086, 0x0002, 0x00c0, 0x3b6c, 0x70d4, + 0xc0b5, 0x70d6, 0x2c00, 0x70ba, 0x2d00, 0x70be, 0x0078, 0x3b71, + 0x1078, 0x44fb, 0x0078, 0x3b71, 0x7000, 0xa086, 0x0003, 0x0040, + 0x3b68, 0x7003, 0x0001, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, + 0x7ca8, 0xa484, 0x001f, 0xa215, 0x2069, 0x93c0, 0xb284, 0x0300, + 0x00c0, 0x3b85, 0xc2fd, 0x2069, 0x94d0, 0x2d04, 0x2d08, 0x715e, + 0xa06d, 0x0040, 0x3b92, 0x6814, 0xa206, 0x0040, 0x3bb2, 0x6800, + 0x0078, 0x3b86, 0x7003, 0x0005, 0xd2fc, 0x00c0, 0x3b9b, 0x2001, + 0x94e0, 0x0078, 0x3b9d, 0x2001, 0x9512, 0x2068, 0x704e, 0x157e, + 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, 0x00f0, 0x3ba2, 0x157f, + 0xad80, 0x0009, 0x7046, 0x6a16, 0x68b7, 0x0700, 0x6823, 0x0800, + 0x6827, 0x0003, 0x6eb4, 0x7e5a, 0x6920, 0xa184, 0x0c00, 0x0040, + 0x3c3c, 0x681b, 0x0005, 0xc1ad, 0xc1d4, 0x6922, 0x1078, 0x4059, + 0x0078, 0x3c3c, 0x7200, 0xa286, 0x0002, 0x00c0, 0x3bd4, 0x70d4, + 0xc0b5, 0x70d6, 0x2c00, 0x70ba, 0x2d00, 0x70be, 0x0078, 0x3bd8, + 0x1078, 0x44fb, 0x0078, 0x3bd8, 0xa286, 0x0003, 0x0040, 0x3bd0, + 0x7003, 0x0001, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, + 0xa484, 0x001f, 0xa215, 0xb284, 0x0300, 0x00c0, 0x3be8, 0xc2fd, + 0x79a8, 0x79a8, 0xa18c, 0x00ff, 0x70cc, 0xa168, 0x2d04, 0x2d08, + 0x715e, 0xa06d, 0x0040, 0x3bfb, 0x6814, 0xa206, 0x0040, 0x3c24, + 0x6800, 0x0078, 0x3bef, 0x7003, 0x0005, 0xb284, 0x0300, 0x0040, + 0x3c05, 0x2001, 0x94e0, 0x0078, 0x3c07, 0x2001, 0x9512, 0x2068, 0x704e, 0x157e, 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, 0x00f0, - 0x39b4, 0x157f, 0xb284, 0x0300, 0x0040, 0x39c2, 0x6817, 0x0000, - 0x0078, 0x39c4, 0x6817, 0x8000, 0xad80, 0x0009, 0x7046, 0x68b7, - 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, 0x0078, 0x3e9d, 0x7000, - 0xa086, 0x0002, 0x00c0, 0x39e0, 0x1078, 0x3bd2, 0x0078, 0x39da, - 0x1078, 0x4326, 0x6008, 0xa084, 0xfbef, 0x600a, 0x0078, 0x39e5, - 0x7000, 0xa086, 0x0003, 0x0040, 0x39d8, 0x7003, 0x0005, 0xb284, - 0x0300, 0x0040, 0x39ef, 0x2001, 0x91e0, 0x0078, 0x39f1, 0x2001, - 0x9212, 0x2068, 0x704e, 0xad80, 0x0009, 0x7046, 0x2200, 0x0079, - 0x39f9, 0x3ea7, 0x39ff, 0x39ff, 0x3a38, 0x39ff, 0x3ea7, 0x1078, - 0x28ec, 0x7000, 0xa086, 0x0002, 0x00c0, 0x3a12, 0x1078, 0x3bd2, - 0x0078, 0x3a0c, 0x1078, 0x4326, 0x6008, 0xa084, 0xfbef, 0x600a, - 0x0078, 0x3a17, 0x7000, 0xa086, 0x0003, 0x0040, 0x3a0a, 0x7003, - 0x0005, 0xb284, 0x0300, 0x0040, 0x3a21, 0x2001, 0x91e0, 0x0078, - 0x3a23, 0x2001, 0x9212, 0x2068, 0x704e, 0xad80, 0x0009, 0x7046, - 0x2200, 0x0079, 0x3a2b, 0x3a33, 0x3a31, 0x3a31, 0x3a33, 0x3a31, - 0x3a33, 0x1078, 0x28ec, 0x1078, 0x3ebe, 0x781b, 0x0075, 0x007c, - 0x7000, 0xa086, 0x0002, 0x00c0, 0x3a4a, 0x70d4, 0xc0b5, 0x70d6, - 0x2c00, 0x70ba, 0x2d00, 0x70be, 0x0078, 0x3a4f, 0x1078, 0x4326, - 0x0078, 0x3a4f, 0x7000, 0xa086, 0x0003, 0x0040, 0x3a46, 0x7003, - 0x0001, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, - 0x001f, 0xa215, 0x2069, 0x90c0, 0xb284, 0x0300, 0x00c0, 0x3a63, - 0xc2fd, 0x2069, 0x91d0, 0x2d04, 0x2d08, 0x715e, 0xa06d, 0x0040, - 0x3a70, 0x6814, 0xa206, 0x0040, 0x3a90, 0x6800, 0x0078, 0x3a64, - 0x7003, 0x0005, 0xd2fc, 0x00c0, 0x3a79, 0x2001, 0x91e0, 0x0078, - 0x3a7b, 0x2001, 0x9212, 0x2068, 0x704e, 0x157e, 0x20a9, 0x0032, - 0x2003, 0x0000, 0x8000, 0x00f0, 0x3a80, 0x157f, 0xad80, 0x0009, - 0x7046, 0x6a16, 0x68b7, 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, - 0x6eb4, 0x7e5a, 0x6820, 0xa084, 0x0c00, 0x0040, 0x3b10, 0x1078, - 0x3eb6, 0x0078, 0x3b10, 0x7200, 0xa286, 0x0002, 0x00c0, 0x3aad, - 0x70d4, 0xc0b5, 0x70d6, 0x2c00, 0x70ba, 0x2d00, 0x70be, 0x0078, - 0x3ab1, 0x1078, 0x4326, 0x0078, 0x3ab1, 0xa286, 0x0003, 0x0040, - 0x3aa9, 0x7003, 0x0001, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, - 0x7ca8, 0xa484, 0x001f, 0xa215, 0xb284, 0x0300, 0x00c0, 0x3ac1, - 0xc2fd, 0x79a8, 0x79a8, 0xa18c, 0x00ff, 0x70cc, 0xa168, 0x2d04, - 0x2d08, 0x715e, 0xa06d, 0x0040, 0x3ad4, 0x6814, 0xa206, 0x0040, - 0x3afd, 0x6800, 0x0078, 0x3ac8, 0x7003, 0x0005, 0xb284, 0x0300, - 0x0040, 0x3ade, 0x2001, 0x91e0, 0x0078, 0x3ae0, 0x2001, 0x9212, - 0x2068, 0x704e, 0x157e, 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, - 0x00f0, 0x3ae5, 0x157f, 0xb284, 0x0300, 0x0040, 0x3af2, 0xc2fc, - 0x0078, 0x3af3, 0xc2fd, 0x6a16, 0xad80, 0x0009, 0x7046, 0x68b7, - 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, 0x6eb4, 0x6820, 0xa084, - 0x0c00, 0x0040, 0x3b10, 0xd0dc, 0x0040, 0x3b0a, 0x1078, 0x3eba, - 0x0078, 0x3b10, 0x1078, 0x3eb6, 0x707f, 0x0000, 0x0078, 0x3b10, - 0xa6ac, 0x0060, 0x0040, 0x3b4e, 0x6b98, 0x6c94, 0x69ac, 0x68b0, - 0xa105, 0x00c0, 0x3b33, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0xa6b4, - 0xb7ff, 0xa586, 0x0060, 0x0040, 0x3b4e, 0xc6ed, 0x7e5a, 0x2009, - 0x0076, 0xd69c, 0x0040, 0x3b2e, 0x2009, 0x0075, 0x791a, 0x1078, - 0x45f7, 0x0078, 0x3b57, 0x68b0, 0xa31a, 0x2100, 0xa423, 0x2400, - 0xa305, 0x0040, 0x3b4e, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0x68b0, - 0xc6f4, 0x7e5a, 0x2011, 0x0076, 0xd69c, 0x0040, 0x3b49, 0x2011, - 0x0075, 0x7a1a, 0x1078, 0x462d, 0x0078, 0x3b57, 0x7e5a, 0x2009, - 0x0076, 0xd69c, 0x0040, 0x3b56, 0x2009, 0x0075, 0x791a, 0x68c0, - 0x705a, 0x2d00, 0x704e, 0x68c4, 0x2060, 0x71d4, 0xd1b4, 0x00c0, - 0x2942, 0x2300, 0xa405, 0x0040, 0x2942, 0x70a4, 0xa086, 0x0001, - 0x00c0, 0x2989, 0x007c, 0x6020, 0xa005, 0x0040, 0x3b79, 0x8001, - 0x6022, 0x6008, 0xa085, 0x0008, 0x600a, 0x700f, 0x0100, 0x702c, - 0x6026, 0x007c, 0xa006, 0x1078, 0x4326, 0x6817, 0x0000, 0x681b, - 0x0001, 0x6823, 0x0040, 0x681f, 0x0100, 0x7000, 0xa084, 0x000f, - 0x0079, 0x3b8a, 0x2946, 0x3b94, 0x3b94, 0x3bb1, 0x3b9c, 0x2946, - 0x3b92, 0x3b92, 0x1078, 0x28ec, 0x1078, 0x3bbc, 0x1078, 0x3bb5, - 0x1078, 0x202a, 0x0078, 0x2946, 0x7064, 0x7067, 0x0000, 0x7083, - 0x0000, 0x0079, 0x3ba3, 0x3bad, 0x3bad, 0x3bab, 0x3bab, 0x3bab, - 0x3bad, 0x3bab, 0x3bad, 0x0079, 0x2e5c, 0x7067, 0x0000, 0x0078, - 0x2946, 0x681b, 0x0000, 0x0078, 0x35ae, 0x6800, 0xa005, 0x00c0, - 0x3bba, 0x6002, 0x6006, 0x007c, 0x6410, 0x84ff, 0x0040, 0x3bce, - 0x2009, 0x4a02, 0x2104, 0x8001, 0x200a, 0x8421, 0x6412, 0x00c0, - 0x3bce, 0x2021, 0x4a04, 0x2404, 0xc0a5, 0x2022, 0x6008, 0xc0a4, - 0x600a, 0x007c, 0x6018, 0xa005, 0x0040, 0x3bd8, 0x8001, 0x601a, - 0x007c, 0x1078, 0x4131, 0x681b, 0x0018, 0x0078, 0x3c1a, 0x1078, - 0x4131, 0x681b, 0x0019, 0x0078, 0x3c1a, 0x1078, 0x4131, 0x681b, - 0x001a, 0x0078, 0x3c1a, 0x1078, 0x4131, 0x681b, 0x0003, 0x0078, - 0x3c1a, 0x7774, 0x1078, 0x3fe1, 0x7178, 0xa18c, 0x00ff, 0x3210, - 0xa294, 0x0300, 0x0040, 0x3c00, 0xa1e8, 0x8fc0, 0x0078, 0x3c02, - 0xa1e8, 0x90d0, 0x2d04, 0x2d08, 0x2068, 0xa005, 0x00c0, 0x3c0a, - 0x0078, 0x2946, 0x6814, 0xc0fc, 0x7274, 0xc2fc, 0xa206, 0x0040, - 0x3c14, 0x6800, 0x0078, 0x3c03, 0x6800, 0x200a, 0x681b, 0x0005, - 0x707f, 0x0000, 0x1078, 0x3bbc, 0x6820, 0xd084, 0x00c0, 0x3c22, - 0x1078, 0x3bb5, 0x1078, 0x3bd2, 0x681f, 0x0000, 0x6823, 0x0020, - 0x1078, 0x202a, 0x0078, 0x2946, 0xa282, 0x0003, 0x00c0, 0x3e9d, - 0x7da8, 0xa5ac, 0x00ff, 0x7ea8, 0xa6b4, 0x00ff, 0x6920, 0xc1bd, - 0x6922, 0xd1c4, 0x0040, 0x3c86, 0xc1c4, 0x6922, 0xa6b4, 0x00ff, - 0x0040, 0x3c73, 0xa682, 0x000c, 0x0048, 0x3c4a, 0x0040, 0x3c4a, - 0x2031, 0x000c, 0x2500, 0xa086, 0x000a, 0x0040, 0x3c51, 0x852b, - 0x852b, 0x1078, 0x3f73, 0x0040, 0x3c59, 0x1078, 0x3d55, 0x0078, - 0x3c7c, 0x1078, 0x3f2e, 0x0c7e, 0x2960, 0x6004, 0xa084, 0xfff5, - 0x6006, 0x1078, 0x3d8a, 0x0c7f, 0x6920, 0xc1c5, 0x6922, 0x7e58, - 0xc695, 0x7e5a, 0xd6d4, 0x00c0, 0x3c70, 0x781b, 0x0061, 0x007c, - 0x781b, 0x0075, 0x007c, 0x0c7e, 0x2960, 0x6004, 0xa084, 0xfff5, - 0x6006, 0x1078, 0x3d8a, 0x0c7f, 0x7e58, 0xd6d4, 0x00c0, 0x3c83, - 0x781b, 0x0064, 0x007c, 0x781b, 0x0076, 0x007c, 0x0c7e, 0x7058, - 0x2060, 0x6100, 0xd1e4, 0x0040, 0x3ccf, 0x6208, 0x8217, 0xa294, - 0x00ff, 0xa282, 0x000c, 0x0048, 0x3c99, 0x0040, 0x3c99, 0x2011, - 0x000c, 0x2600, 0xa202, 0x00c8, 0x3c9e, 0x2230, 0x6208, 0xa294, - 0x00ff, 0x2001, 0x4a05, 0x2004, 0xd0e4, 0x00c0, 0x3cb3, 0x78ec, - 0xd0e4, 0x0040, 0x3cb3, 0xa282, 0x000a, 0x00c8, 0x3cb9, 0x2011, - 0x000a, 0x0078, 0x3cb9, 0xa282, 0x000c, 0x00c8, 0x3cb9, 0x2011, - 0x000c, 0x2200, 0xa502, 0x00c8, 0x3cbe, 0x2228, 0x1078, 0x3f32, - 0x2500, 0xa086, 0x000a, 0x0040, 0x3cc7, 0x852b, 0x852b, 0x1078, - 0x3f73, 0x0040, 0x3ccf, 0x1078, 0x3d55, 0x0078, 0x3cd3, 0x1078, - 0x3f2e, 0x1078, 0x3d8a, 0x7858, 0xc095, 0x785a, 0x0c7f, 0x781b, - 0x0075, 0x007c, 0x0c7e, 0x2960, 0x6000, 0xd0e4, 0x00c0, 0x3cf1, - 0x6010, 0xa084, 0x000f, 0x00c0, 0x3ceb, 0x6104, 0xa18c, 0xfff5, - 0x6106, 0x0c7f, 0x007c, 0x2011, 0x0032, 0x2019, 0x0000, 0x0078, - 0x3d1c, 0x68a0, 0xd0cc, 0x00c0, 0x3ceb, 0x6208, 0xa294, 0x00ff, - 0x2001, 0x4a05, 0x2004, 0xd0e4, 0x00c0, 0x3d0a, 0x78ec, 0xd0e4, - 0x0040, 0x3d0a, 0xa282, 0x000a, 0x00c0, 0x3d0a, 0x2011, 0x000a, - 0x0078, 0x3d10, 0xa282, 0x000c, 0x00c8, 0x3d10, 0x2011, 0x000c, - 0x6308, 0x831f, 0xa39c, 0x00ff, 0xa382, 0x000c, 0x0048, 0x3d1c, - 0x0040, 0x3d1c, 0x2019, 0x000c, 0x78ab, 0x0001, 0x78ab, 0x0003, - 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005, 0x6820, 0xc0c5, - 0x6822, 0x70d4, 0xd0b4, 0x0040, 0x3d38, 0xc0b4, 0x70d6, 0x70b8, - 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, - 0x0c7f, 0x007c, 0x0c7e, 0x2960, 0x6104, 0xa18c, 0xfff5, 0x6106, - 0x2011, 0x0032, 0x2019, 0x0000, 0x0078, 0x3d46, 0x78ab, 0x0001, + 0x3c0c, 0x157f, 0xb284, 0x0300, 0x0040, 0x3c19, 0xc2fc, 0x0078, + 0x3c1a, 0xc2fd, 0x6a16, 0xad80, 0x0009, 0x7046, 0x68b7, 0x0700, + 0x6823, 0x0800, 0x6827, 0x0003, 0x6eb4, 0x6920, 0xa184, 0x0c00, + 0x0040, 0x3c3c, 0xd0dc, 0x0040, 0x3c31, 0x1078, 0x4060, 0x0078, + 0x3c3c, 0x681b, 0x0005, 0xc1ad, 0xc1d4, 0x6922, 0x1078, 0x4059, + 0x707f, 0x0000, 0x0078, 0x3c3c, 0xc6ec, 0xa6ac, 0x0060, 0x0040, + 0x3c90, 0x6b98, 0x6c94, 0x69ac, 0x68b0, 0xa105, 0x00c0, 0x3c69, + 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0xa586, 0x0060, 0x0040, 0x3c8e, + 0xd6f4, 0x00c0, 0x3c54, 0xc6ed, 0xa6b4, 0xb7ff, 0x7e5a, 0x2009, + 0x0076, 0xd69c, 0x0040, 0x3c61, 0x2009, 0x0075, 0x2019, 0x0000, + 0x2320, 0x791a, 0xd6ec, 0x0040, 0x3c99, 0x1078, 0x4834, 0x0078, + 0x3c99, 0x68b0, 0xa31a, 0x2100, 0xa423, 0x2400, 0xa305, 0x0040, + 0x3c90, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0x68b0, 0xd6f4, 0x00c0, + 0x3c7a, 0xc6ed, 0xc6f4, 0x7e5a, 0x2011, 0x0076, 0xd69c, 0x0040, + 0x3c86, 0x2011, 0x0075, 0x2019, 0x0000, 0x2320, 0x7a1a, 0xd6ec, + 0x0040, 0x3c99, 0x1078, 0x486c, 0x0078, 0x3c99, 0xa6b4, 0xb7ff, + 0x7e5a, 0x2009, 0x0076, 0xd69c, 0x0040, 0x3c98, 0x2009, 0x0075, + 0x791a, 0x68c0, 0x705a, 0x2d00, 0x704e, 0x68c4, 0x2060, 0x71d4, + 0x70d8, 0xa02d, 0x0040, 0x3cc1, 0xd1bc, 0x0040, 0x3cdb, 0x7a80, + 0xa294, 0x0f00, 0x70dc, 0xa206, 0x0040, 0x3cb2, 0x78e0, 0xa504, + 0x00c0, 0x3ce8, 0x70da, 0xc1bc, 0x71d6, 0x0078, 0x3ce8, 0x2031, + 0x0001, 0x852c, 0x0048, 0x3cc0, 0x8633, 0x8210, 0x0078, 0x3cb9, + 0x007c, 0x7de0, 0xa594, 0xff00, 0x0040, 0x3cce, 0x2011, 0x0008, + 0x852f, 0x1078, 0x3cb7, 0x8637, 0x0078, 0x3cd0, 0x1078, 0x3cb7, + 0x8217, 0x7880, 0xa084, 0x0f00, 0xa206, 0x0040, 0x3ce8, 0x72de, + 0x76da, 0x0078, 0x3ce8, 0x7a80, 0xa294, 0x0f00, 0x70dc, 0xa236, + 0x0040, 0x3cd8, 0x78e0, 0xa534, 0x0040, 0x3cd8, 0xc1bd, 0x71d6, + 0xd1b4, 0x00c0, 0x2962, 0x2300, 0xa405, 0x0040, 0x2962, 0x70a4, + 0xa086, 0x0001, 0x00c0, 0x29ac, 0x007c, 0x6020, 0xa005, 0x0040, + 0x3d03, 0x8001, 0x6022, 0x6008, 0xa085, 0x0008, 0x600a, 0x700f, + 0x0100, 0x702c, 0x6026, 0x007c, 0xa006, 0x1078, 0x44fb, 0x7000, + 0xa086, 0x0002, 0x0040, 0x3d11, 0x7064, 0xa086, 0x0005, 0x00c0, + 0x3d1b, 0x682b, 0x0000, 0x6817, 0x0000, 0x681b, 0x0001, 0x6823, + 0x0040, 0x681f, 0x0100, 0x7000, 0xa084, 0x000f, 0x0079, 0x3d20, + 0x2966, 0x3d30, 0x3d2a, 0x3d52, 0x3d3a, 0x2966, 0x3d28, 0x3d28, + 0x1078, 0x290c, 0x1078, 0x3d5d, 0x1078, 0x3d56, 0x0078, 0x3d36, + 0x1078, 0x3d5d, 0x705c, 0x2060, 0x6800, 0x6002, 0x1078, 0x2013, + 0x0078, 0x2966, 0x7064, 0x7067, 0x0000, 0x7083, 0x0000, 0x0079, + 0x3d41, 0x3d4e, 0x3d4e, 0x3d49, 0x3d49, 0x3d49, 0x3d4e, 0x3d49, + 0x3d4e, 0x77d4, 0xc7dd, 0x77d6, 0x0079, 0x2ed3, 0x7067, 0x0000, + 0x0078, 0x2966, 0x681b, 0x0000, 0x0078, 0x3653, 0x6800, 0xa005, + 0x00c0, 0x3d5b, 0x6002, 0x6006, 0x007c, 0x6410, 0x84ff, 0x0040, + 0x3d6f, 0x2009, 0x4d02, 0x2104, 0x8001, 0x200a, 0x8421, 0x6412, + 0x00c0, 0x3d6f, 0x2021, 0x4d04, 0x2404, 0xc0a5, 0x2022, 0x6008, + 0xc0a4, 0x600a, 0x007c, 0x6018, 0xa005, 0x0040, 0x3d79, 0x8001, + 0x601a, 0x007c, 0x1078, 0x42fe, 0x681b, 0x0018, 0x0078, 0x3dbc, + 0x1078, 0x42fe, 0x681b, 0x0019, 0x0078, 0x3dbc, 0x1078, 0x42fe, + 0x681b, 0x001a, 0x0078, 0x3dbc, 0x1078, 0x42fe, 0x681b, 0x0003, + 0x0078, 0x3dbc, 0x7774, 0x1078, 0x4187, 0x7178, 0xa18c, 0x00ff, + 0x3210, 0xa294, 0x0300, 0x0040, 0x3da1, 0xa1e8, 0x92c0, 0x0078, + 0x3da3, 0xa1e8, 0x93d0, 0x2d04, 0x2d08, 0x2068, 0xa005, 0x00c0, + 0x3dac, 0x707e, 0x0078, 0x2966, 0x6814, 0xc0fc, 0x7274, 0xc2fc, + 0xa206, 0x0040, 0x3db6, 0x6800, 0x0078, 0x3da4, 0x6800, 0x200a, + 0x681b, 0x0005, 0x707f, 0x0000, 0x1078, 0x3d5d, 0x6820, 0xd084, + 0x00c0, 0x3dc4, 0x1078, 0x3d56, 0x1078, 0x3d73, 0x681f, 0x0000, + 0x6823, 0x0020, 0x1078, 0x2013, 0x0078, 0x2966, 0xa282, 0x0003, + 0x00c0, 0x4040, 0x7da8, 0xa5ac, 0x00ff, 0x7ea8, 0xa6b4, 0x00ff, + 0x6920, 0xc1bd, 0x6922, 0xd1c4, 0x0040, 0x3e28, 0xc1c4, 0x6922, + 0xa6b4, 0x00ff, 0x0040, 0x3e15, 0xa682, 0x000c, 0x0048, 0x3dec, + 0x0040, 0x3dec, 0x2031, 0x000c, 0x2500, 0xa086, 0x000a, 0x0040, + 0x3df3, 0x852b, 0x852b, 0x1078, 0x4119, 0x0040, 0x3dfb, 0x1078, + 0x3ef7, 0x0078, 0x3e1e, 0x1078, 0x40d4, 0x0c7e, 0x2960, 0x6004, + 0xa084, 0xfff5, 0x6006, 0x1078, 0x3f2d, 0x0c7f, 0x6920, 0xc1c5, + 0x6922, 0x7e58, 0xc695, 0x7e5a, 0xd6d4, 0x00c0, 0x3e12, 0x781b, + 0x0061, 0x007c, 0x781b, 0x0075, 0x007c, 0x0c7e, 0x2960, 0x6004, + 0xa084, 0xfff5, 0x6006, 0x1078, 0x3f2d, 0x0c7f, 0x7e58, 0xd6d4, + 0x00c0, 0x3e25, 0x781b, 0x0064, 0x007c, 0x781b, 0x0076, 0x007c, + 0x0c7e, 0x7058, 0x2060, 0x6100, 0xd1e4, 0x0040, 0x3e71, 0x6208, + 0x8217, 0xa294, 0x00ff, 0xa282, 0x000c, 0x0048, 0x3e3b, 0x0040, + 0x3e3b, 0x2011, 0x000c, 0x2600, 0xa202, 0x00c8, 0x3e40, 0x2230, + 0x6208, 0xa294, 0x00ff, 0x2001, 0x4d05, 0x2004, 0xd0e4, 0x00c0, + 0x3e55, 0x78ec, 0xd0e4, 0x0040, 0x3e55, 0xa282, 0x000a, 0x00c8, + 0x3e5b, 0x2011, 0x000a, 0x0078, 0x3e5b, 0xa282, 0x000c, 0x00c8, + 0x3e5b, 0x2011, 0x000c, 0x2200, 0xa502, 0x00c8, 0x3e60, 0x2228, + 0x1078, 0x40d8, 0x2500, 0xa086, 0x000a, 0x0040, 0x3e69, 0x852b, + 0x852b, 0x1078, 0x4119, 0x0040, 0x3e71, 0x1078, 0x3ef7, 0x0078, + 0x3e75, 0x1078, 0x40d4, 0x1078, 0x3f2d, 0x7858, 0xc095, 0x785a, + 0x0c7f, 0x781b, 0x0075, 0x007c, 0x0c7e, 0x2960, 0x6000, 0xd0e4, + 0x00c0, 0x3e93, 0x6010, 0xa084, 0x000f, 0x00c0, 0x3e8d, 0x6104, + 0xa18c, 0xfff5, 0x6106, 0x0c7f, 0x007c, 0x2011, 0x0032, 0x2019, + 0x0000, 0x0078, 0x3ebe, 0x68a0, 0xd0cc, 0x00c0, 0x3e8d, 0x6208, + 0xa294, 0x00ff, 0x2001, 0x4d05, 0x2004, 0xd0e4, 0x00c0, 0x3eac, + 0x78ec, 0xd0e4, 0x0040, 0x3eac, 0xa282, 0x000b, 0x00c8, 0x3eac, + 0x2011, 0x000a, 0x0078, 0x3eb2, 0xa282, 0x000c, 0x00c8, 0x3eb2, + 0x2011, 0x000c, 0x6308, 0x831f, 0xa39c, 0x00ff, 0xa382, 0x000c, + 0x0048, 0x3ebe, 0x0040, 0x3ebe, 0x2019, 0x000c, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005, - 0x6820, 0xc0c5, 0x6822, 0x0c7f, 0x007c, 0x0c7e, 0x7158, 0x2160, - 0x2018, 0xa08c, 0x0020, 0x0040, 0x3d5e, 0xc0ac, 0x2008, 0xa084, - 0xfff0, 0xa635, 0x7e86, 0x6018, 0x789a, 0x7eae, 0x6612, 0x78a4, - 0xa084, 0xfff0, 0xa18c, 0x000f, 0xa105, 0xa39c, 0x0020, 0x0040, - 0x3d73, 0xa085, 0x4000, 0xc0fc, 0xd0b4, 0x00c0, 0x3d78, 0xc0fd, - 0x78a6, 0x6016, 0x788a, 0xa6b4, 0x000f, 0x8637, 0x8204, 0x8004, - 0xa084, 0x00ff, 0xa605, 0x600e, 0x6004, 0xa084, 0xfff5, 0x6006, - 0x0c7f, 0x007c, 0x0c7e, 0x7058, 0x2060, 0x6018, 0x789a, 0x78a4, - 0xa084, 0xfff0, 0x78a6, 0x6012, 0x7884, 0xa084, 0xfff0, 0x7886, - 0x600c, 0xa084, 0x00ff, 0x600e, 0x0c7f, 0x007c, 0xa282, 0x0002, - 0x00c0, 0x3e9d, 0x7aa8, 0x6920, 0xc1bd, 0x6922, 0xd1cc, 0x0040, - 0x3dd9, 0xc1cc, 0x6922, 0xa294, 0x00ff, 0xa282, 0x0002, 0x00c8, - 0x3e9d, 0x1078, 0x3e2a, 0x1078, 0x3d8a, 0xa980, 0x0001, 0x200c, - 0x1078, 0x3fdd, 0x1078, 0x3cda, 0x88ff, 0x0040, 0x3dcf, 0x789b, - 0x0060, 0x2800, 0x78aa, 0x7e58, 0xc695, 0x7e5a, 0xd6d4, 0x00c0, - 0x3dcc, 0x781b, 0x0061, 0x007c, 0x781b, 0x0075, 0x007c, 0x7e58, - 0xd6d4, 0x00c0, 0x3dd6, 0x781b, 0x0064, 0x007c, 0x781b, 0x0076, - 0x007c, 0xa282, 0x0002, 0x00c8, 0x3de1, 0xa284, 0x0001, 0x0040, - 0x3dea, 0x7158, 0xa188, 0x0000, 0x210c, 0xd1ec, 0x00c0, 0x3dea, - 0x2011, 0x0000, 0x1078, 0x3f0f, 0x1078, 0x3e2a, 0x1078, 0x3d8a, - 0x7858, 0xc095, 0x785a, 0x781b, 0x0075, 0x007c, 0x0c7e, 0x027e, - 0x2960, 0x6000, 0x2011, 0x0001, 0xd0ec, 0x00c0, 0x3e0b, 0x6014, - 0xa084, 0x0040, 0x00c0, 0x3e09, 0xc1a4, 0x6106, 0xa006, 0x0078, - 0x3e27, 0x2011, 0x0000, 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, - 0x0003, 0x7aaa, 0xa8c0, 0x0004, 0x70d4, 0xd0b4, 0x0040, 0x3e23, - 0xc0b4, 0x70d6, 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, - 0x6018, 0x8001, 0x601a, 0x6820, 0xa085, 0x0200, 0x6822, 0x027f, - 0x0c7f, 0x007c, 0x0c7e, 0x7058, 0x2060, 0x82ff, 0x0040, 0x3e32, - 0x2011, 0x0040, 0x6018, 0xa080, 0x0002, 0x789a, 0x78a4, 0xa084, - 0xffbf, 0xa205, 0xc0fc, 0xd0b4, 0x00c0, 0x3e3f, 0xc0fd, 0x78a6, - 0x6016, 0x788a, 0x6004, 0xc0a4, 0x6006, 0x0c7f, 0x007c, 0x007e, - 0x7000, 0xa086, 0x0003, 0x0040, 0x3e50, 0x007f, 0x0078, 0x3e53, - 0x007f, 0x0078, 0x3e9a, 0xd6ac, 0x0040, 0x3e9a, 0x7888, 0xa084, - 0x0040, 0x0040, 0x3e9a, 0x7bb8, 0xa384, 0x003f, 0x831b, 0x00c8, - 0x3e62, 0x8000, 0xa005, 0x0040, 0x3e77, 0x831b, 0x00c8, 0x3e6b, - 0x8001, 0x0040, 0x3e97, 0xd6f4, 0x0040, 0x3e77, 0x78b8, 0x801b, - 0x00c8, 0x3e73, 0x8000, 0xa084, 0x003f, 0x00c0, 0x3e97, 0xc6f4, - 0x7e5a, 0x79d8, 0x7adc, 0x2001, 0x0001, 0xa108, 0x00c8, 0x3e82, - 0xa291, 0x0000, 0x79d2, 0x79da, 0x7ad6, 0x7ade, 0x1078, 0x46e5, - 0x781b, 0x0073, 0xb284, 0x0300, 0x0040, 0x3e92, 0x2001, 0x0000, - 0x0078, 0x3e94, 0x2001, 0x0001, 0x1078, 0x4585, 0x007c, 0x781b, - 0x0073, 0x007c, 0x781b, 0x0076, 0x007c, 0x1078, 0x3ec2, 0x781b, - 0x0075, 0x007c, 0x1078, 0x3eae, 0x781b, 0x0075, 0x007c, 0x6827, - 0x0002, 0x1078, 0x3eb6, 0x781b, 0x0075, 0x007c, 0x2001, 0x0005, - 0x0078, 0x3ec4, 0x2001, 0x000c, 0x0078, 0x3ec4, 0x2001, 0x0006, - 0x0078, 0x3ec4, 0x2001, 0x000d, 0x0078, 0x3ec4, 0x2001, 0x0009, - 0x0078, 0x3ec4, 0x2001, 0x0007, 0x789b, 0x007e, 0x78aa, 0xc69d, - 0x7e5a, 0x70d4, 0xd0b4, 0x0040, 0x3eda, 0xc0b4, 0x70d6, 0x0c7e, - 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, - 0x601a, 0x0c7f, 0x007c, 0x077e, 0x873f, 0xa7bc, 0x000f, 0x873b, - 0x873b, 0x8703, 0x017e, 0xb28c, 0x0300, 0x0040, 0x3eeb, 0xa0e0, - 0x4ec0, 0x0078, 0x3eed, 0xa0e0, 0x4f40, 0x017f, 0xa7b8, 0x0020, - 0x7f9a, 0x79a4, 0xa184, 0x000f, 0x0040, 0x3efd, 0xa184, 0xfff0, - 0x78a6, 0x6012, 0x6004, 0xc09d, 0x6006, 0x8738, 0x8738, 0x7f9a, - 0x79a4, 0xa184, 0x0040, 0x0040, 0x3f0d, 0xa184, 0xffbf, 0xc0fd, - 0x78a6, 0x6016, 0x6004, 0xc0a5, 0x6006, 0x077f, 0x007c, 0x789b, - 0x0010, 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, - 0x789b, 0x0060, 0x78ab, 0x0004, 0x70d4, 0xd0b4, 0x0040, 0x3f2d, - 0xc0b4, 0x70d6, 0x0c7e, 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, - 0x600a, 0x6018, 0x8001, 0x601a, 0x0c7f, 0x007c, 0x2031, 0x0000, - 0x2029, 0x0032, 0x789b, 0x0010, 0x78ab, 0x0001, 0x78ab, 0x0003, - 0x78ab, 0x0001, 0x7daa, 0x7eaa, 0x789b, 0x0060, 0x78ab, 0x0005, - 0x70d4, 0xd0b4, 0x0040, 0x3f51, 0xc0b4, 0x70d6, 0x0c7e, 0x70b8, - 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, - 0x0c7f, 0x007c, 0x157e, 0x8007, 0xa084, 0x00ff, 0x8003, 0x8003, - 0xa080, 0x0020, 0x789a, 0x79a4, 0xa18c, 0xfff0, 0x2021, 0x3fc6, - 0x2019, 0x0011, 0x20a9, 0x000e, 0x2011, 0x0032, 0x2404, 0xa084, - 0xfff0, 0xa106, 0x0040, 0x3f71, 0x8420, 0x2300, 0xa210, 0x00f0, - 0x3f66, 0x157f, 0x007c, 0x157e, 0x2001, 0x4a05, 0x2004, 0xd0e4, - 0x00c0, 0x3fa4, 0x2021, 0x3fd4, 0x20a9, 0x0009, 0x2011, 0x0028, - 0xa582, 0x0019, 0x0040, 0x3fba, 0x0048, 0x3fba, 0x8420, 0x95a9, - 0x2011, 0x0032, 0xa582, 0x0032, 0x0040, 0x3fba, 0x0048, 0x3fba, - 0x8420, 0x95a9, 0x2019, 0x000a, 0x2011, 0x0064, 0x2200, 0xa502, - 0x0040, 0x3fba, 0x0048, 0x3fba, 0x8420, 0x2300, 0xa210, 0x00f0, - 0x3f96, 0x157f, 0x0078, 0x3fb8, 0x2021, 0x3fc6, 0x2019, 0x0011, - 0x20a9, 0x000e, 0x2011, 0x0032, 0x2200, 0xa502, 0x0040, 0x3fba, - 0x0048, 0x3fba, 0x8420, 0x2300, 0xa210, 0x00f0, 0x3fac, 0x157f, - 0xa006, 0x007c, 0x157f, 0xa582, 0x0064, 0x00c8, 0x3fc3, 0x7808, - 0xa085, 0x0070, 0x780a, 0x2404, 0xa005, 0x007c, 0x1209, 0x3002, - 0x3202, 0x4203, 0x4403, 0x5404, 0x5604, 0x6605, 0x6805, 0x7806, - 0x7a06, 0x0c07, 0x0c07, 0x0e07, 0x10e1, 0x330a, 0x5805, 0x5a05, - 0x6a06, 0x6c06, 0x7c07, 0x7e07, 0x0e00, 0x789b, 0x0010, 0xa046, - 0x007c, 0xa784, 0x0f00, 0x800b, 0xa784, 0x001f, 0x8003, 0x8003, - 0x8003, 0x8003, 0xa105, 0xd7fc, 0x0040, 0x3ff2, 0xa0e0, 0x6fc0, - 0x0078, 0x3ff4, 0xa0e0, 0x4fc0, 0x007c, 0x0e7e, 0x0f7e, 0xd084, - 0x0040, 0x4002, 0x2079, 0x0100, 0x2009, 0x4a80, 0x2071, 0x4a80, - 0x0078, 0x4014, 0x2009, 0x4a40, 0x007e, 0x2001, 0x4a04, 0x2004, - 0xd0ec, 0x007f, 0x0040, 0x4010, 0x2079, 0x0100, 0x0078, 0x4014, - 0x2079, 0x0200, 0x2071, 0x4a40, 0x2091, 0x8000, 0x2104, 0xa084, - 0x000f, 0x0079, 0x401b, 0x405d, 0x4025, 0x4025, 0x4025, 0x4025, - 0x4025, 0x4023, 0x4023, 0x1078, 0x28ec, 0x784b, 0x0004, 0x7848, - 0xa084, 0x0004, 0x00c0, 0x4027, 0x784b, 0x0008, 0x7848, 0xa084, - 0x0008, 0x00c0, 0x402e, 0x68b4, 0xc0f5, 0x68b6, 0x7858, 0xc0f5, - 0x785a, 0x7830, 0xd0bc, 0x00c0, 0x405d, 0x007e, 0x2001, 0x4a04, - 0x2004, 0xd0ec, 0x007f, 0x0040, 0x4049, 0xb284, 0x0300, 0x0078, - 0x404b, 0xb284, 0x0400, 0x0040, 0x4051, 0x0018, 0x405d, 0x0078, - 0x4053, 0x0028, 0x405d, 0x681c, 0xd0ac, 0x00c0, 0x405b, 0x1078, - 0x40d5, 0x0078, 0x405d, 0x781b, 0x00f0, 0x2091, 0x8001, 0x0f7f, - 0x0e7f, 0x007c, 0x0c7e, 0x2001, 0x4a01, 0x2004, 0xd0ac, 0x00c0, - 0x40c7, 0x6814, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, - 0xb28c, 0x0300, 0x0040, 0x4078, 0xa0e0, 0x4ec0, 0x0078, 0x407a, - 0xa0e0, 0x4f40, 0x6004, 0xa084, 0x000a, 0x00c0, 0x40c7, 0x6108, - 0xa194, 0xff00, 0x0040, 0x40c7, 0xa18c, 0x00ff, 0x2001, 0x000a, - 0xa106, 0x0040, 0x40a6, 0x2001, 0x000c, 0xa106, 0x0040, 0x40aa, - 0x2001, 0x0012, 0xa106, 0x0040, 0x40ae, 0x2001, 0x0014, 0xa106, - 0x0040, 0x40b2, 0x2001, 0x0019, 0xa106, 0x0040, 0x40b6, 0x2001, - 0x0032, 0xa106, 0x0040, 0x40ba, 0x0078, 0x40be, 0x2009, 0x000c, - 0x0078, 0x40c0, 0x2009, 0x0012, 0x0078, 0x40c0, 0x2009, 0x0014, - 0x0078, 0x40c0, 0x2009, 0x0019, 0x0078, 0x40c0, 0x2009, 0x0020, - 0x0078, 0x40c0, 0x2009, 0x003f, 0x0078, 0x40c0, 0x2011, 0x0000, - 0x2100, 0xa205, 0x600a, 0x6004, 0xa085, 0x0002, 0x6006, 0x0c7f, - 0x007c, 0x781b, 0x0076, 0x007c, 0x781b, 0x0075, 0x007c, 0x781b, - 0x0064, 0x007c, 0x781b, 0x0061, 0x007c, 0x2009, 0x4a19, 0x210c, - 0xa186, 0x0000, 0x0040, 0x40e7, 0xa186, 0x0001, 0x0040, 0x40ea, - 0x701f, 0x000b, 0x7067, 0x0001, 0x781b, 0x0047, 0x007c, 0x781b, - 0x00e7, 0x007c, 0x701f, 0x000a, 0x007c, 0x2009, 0x4a19, 0x210c, - 0xa186, 0x0000, 0x0040, 0x4102, 0xa186, 0x0001, 0x0040, 0x40ff, - 0x701f, 0x000b, 0x7067, 0x0001, 0x781b, 0x0047, 0x007c, 0x701f, - 0x000a, 0x007c, 0x781b, 0x00e6, 0x007c, 0x781b, 0x00f0, 0x007c, - 0x781b, 0x00ef, 0x007c, 0x781b, 0x00c0, 0x007c, 0x781b, 0x00bf, - 0x007c, 0x6818, 0xd0fc, 0x0040, 0x4117, 0x681b, 0x001d, 0x7067, - 0x0001, 0x781b, 0x0047, 0x007c, 0x7830, 0xa084, 0x00c0, 0x00c0, - 0x4130, 0x7808, 0xc08c, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005, - 0x78ec, 0xa084, 0x0021, 0x0040, 0x4130, 0x7808, 0xc08d, 0x780a, - 0x007c, 0x7808, 0xc08d, 0x780a, 0x007c, 0x7830, 0xa084, 0x0040, - 0x00c0, 0x4135, 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x0040, 0x4144, - 0xb284, 0x0300, 0x0078, 0x4146, 0xb284, 0x0400, 0x0040, 0x414c, - 0x0098, 0x4150, 0x0078, 0x414e, 0x00a8, 0x4150, 0x78ac, 0x007c, - 0x7808, 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005, - 0x78ec, 0xa084, 0x0021, 0x0040, 0x4173, 0x007e, 0x2001, 0x4a04, - 0x2004, 0xd0ec, 0x007f, 0x0040, 0x4169, 0xb284, 0x0300, 0x0078, - 0x416b, 0xb284, 0x0400, 0x0040, 0x4171, 0x0098, 0x416d, 0x0078, - 0x4173, 0x00a8, 0x4171, 0x78ac, 0x007e, 0x7808, 0xa085, 0x0002, - 0x780a, 0x007f, 0x007c, 0xa784, 0x0001, 0x00c0, 0x360e, 0xa784, - 0x0070, 0x0040, 0x418b, 0x0c7e, 0x2d60, 0x2f68, 0x1078, 0x2881, - 0x2d78, 0x2c68, 0x0c7f, 0xa784, 0x0008, 0x0040, 0x4198, 0x784b, - 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x2946, 0x0078, 0x40c9, - 0xa784, 0x0004, 0x0040, 0x41c7, 0x78b8, 0xa084, 0x4001, 0x0040, - 0x41c7, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x2946, - 0x78e4, 0xa084, 0x0007, 0xa086, 0x0001, 0x00c0, 0x41c7, 0x78c0, - 0xa685, 0x4800, 0x2030, 0x7e5a, 0x781b, 0x00f0, 0x007c, 0x784b, - 0x0008, 0x6818, 0xd0fc, 0x0040, 0x41c4, 0x681b, 0x0015, 0xd6f4, - 0x0040, 0x41c4, 0x681b, 0x0007, 0x1078, 0x40d5, 0x007c, 0x681b, - 0x0003, 0x7858, 0xa084, 0x3f00, 0x681e, 0x682f, 0x0000, 0x6833, - 0x0000, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x2f84, - 0x007e, 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x41e4, - 0xb284, 0x0300, 0x0078, 0x41e6, 0xb284, 0x0400, 0x0040, 0x41ec, - 0x0018, 0x2942, 0x0078, 0x41ee, 0x0028, 0x2942, 0x0078, 0x3ea2, - 0x6b14, 0x8307, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xd3fc, - 0x0040, 0x41fe, 0xa080, 0x4f40, 0x0078, 0x4200, 0xa080, 0x4ec0, - 0x2060, 0x2048, 0x705a, 0x2a60, 0x007c, 0x0020, 0x0020, 0x0000, - 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, - 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, - 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, - 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0062, - 0x0009, 0x0014, 0x0014, 0x9848, 0x0014, 0x0014, 0x9906, 0x98f4, - 0x0014, 0x0014, 0x0080, 0x00f1, 0x0100, 0x0402, 0x2008, 0xf880, - 0x0018, 0xa20a, 0x0014, 0x300b, 0xa20c, 0x0014, 0x2500, 0x0013, - 0x2500, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, - 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0xa200, - 0x3806, 0x8839, 0x20c4, 0x0864, 0xa850, 0x3008, 0x28c1, 0x9d0d, - 0xa201, 0x300c, 0x2847, 0x8161, 0x846a, 0x8000, 0x84a4, 0x1856, - 0x883a, 0xa808, 0x28e2, 0x9cc2, 0xa8f3, 0x0864, 0xa83e, 0x300c, - 0xa801, 0x3008, 0x28e1, 0x9cc2, 0x2021, 0xa81b, 0xa205, 0x870c, - 0xd8de, 0x64a0, 0x6de0, 0x6fc0, 0x63a4, 0x6c80, 0x0212, 0xa205, - 0x883d, 0x9d25, 0x882b, 0x1814, 0x883b, 0x9d2b, 0x883b, 0x7027, - 0x85f2, 0xa737, 0xa532, 0xf003, 0x8576, 0x8677, 0xa812, 0x883e, - 0xa810, 0x280c, 0xa204, 0x64c0, 0x6de0, 0x67a0, 0x6fc0, 0x9d25, - 0x1814, 0x9d2b, 0x883b, 0x7023, 0x8576, 0x8677, 0xa802, 0x7861, - 0x883e, 0x206b, 0x28c1, 0x9d0d, 0x2044, 0x2103, 0x20a2, 0x2081, - 0xa8c9, 0xa207, 0x2901, 0xa80a, 0x0014, 0xa203, 0x8000, 0x85a4, - 0x1872, 0x879a, 0x883c, 0x1fe2, 0xf601, 0xa208, 0x856e, 0x866f, - 0x7161, 0x0014, 0x0704, 0x3008, 0x9cc2, 0x0014, 0xa202, 0x8000, - 0x85a4, 0x3009, 0x84a8, 0x19e2, 0xf844, 0x856e, 0x883f, 0x08e6, - 0xa8f5, 0xf861, 0xa8ea, 0xf801, 0x0014, 0xf881, 0x0016, 0x85b2, - 0x80f0, 0x9532, 0xfaa2, 0x1de2, 0x0014, 0x8532, 0xf221, 0x0014, - 0x1de2, 0x84a8, 0xd6e0, 0x1fe6, 0x0014, 0x3008, 0x8000, 0x284a, - 0x1011, 0xa8fc, 0x3008, 0x9d25, 0x8000, 0xa000, 0x2802, 0x1011, - 0xa8fd, 0x9d2b, 0xa887, 0x3008, 0x9d25, 0x283b, 0x1011, 0xa8fd, - 0xa209, 0x0017, 0x300c, 0x8000, 0x85a4, 0x1de2, 0xdac1, 0x0014, - 0x0210, 0xa801, 0x0014, 0x26e0, 0x873a, 0xfaa3, 0x19f2, 0x26e0, - 0x18f2, 0x0014, 0xa20b, 0x0014, 0xa20d, 0x3806, 0x0210, 0x9d17, - 0x0704, 0xa206, 0x6865, 0x817e, 0x842a, 0x1dc1, 0x8823, 0x0016, - 0x6042, 0x8008, 0xa8fa, 0x8000, 0x84a4, 0x8160, 0x842a, 0xf021, - 0x3008, 0x84a8, 0x11d6, 0x7042, 0x20dd, 0x0011, 0x20d4, 0x8822, - 0x0016, 0x7944, 0x8421, 0xa020, 0xa532, 0x84a1, 0x0016, 0x7944, - 0x8421, 0xa0df, 0x9532, 0x84a1, 0x0016, 0x0000, 0x127e, 0x70d4, - 0xa084, 0x4600, 0x8004, 0x2090, 0x7204, 0x7008, 0xc09c, 0xa205, - 0x00c0, 0x4342, 0x720c, 0x82ff, 0x0040, 0x433d, 0x8aff, 0x00c0, - 0x4342, 0x7200, 0xd284, 0x00c0, 0x4342, 0x7003, 0x0008, 0x127f, - 0x2000, 0x007c, 0x7000, 0xa084, 0x0003, 0x7002, 0xc69c, 0xd084, - 0x0040, 0x4374, 0x2001, 0x4a05, 0x2004, 0xd0ec, 0x00c0, 0x43a5, - 0xd0e4, 0x00c0, 0x435a, 0x2001, 0x04fd, 0x2004, 0xa086, 0x0003, - 0x0040, 0x43a5, 0x0e7e, 0x2071, 0x0010, 0x2009, 0x0007, 0x7008, - 0xa084, 0x3000, 0x00c0, 0x435d, 0x8109, 0x00c0, 0x435f, 0x0e7f, - 0x2009, 0x0007, 0x7008, 0xa084, 0x3000, 0x00c0, 0x435a, 0x8109, - 0x00c0, 0x436a, 0x0078, 0x43a5, 0x7108, 0xd1fc, 0x0040, 0x437f, - 0x1078, 0x44ba, 0x8aff, 0x0040, 0x432c, 0x0078, 0x4374, 0x700c, - 0xa08c, 0x03ff, 0x0040, 0x43aa, 0x7004, 0xd084, 0x0040, 0x439c, - 0x7014, 0xa005, 0x00c0, 0x4398, 0x7010, 0x7310, 0xa306, 0x00c0, - 0x438c, 0x2300, 0xa005, 0x0040, 0x439c, 0xa102, 0x00c8, 0x4374, - 0x7007, 0x0010, 0x0078, 0x43a5, 0x8aff, 0x0040, 0x43aa, 0x1078, - 0x46a3, 0x00c0, 0x439f, 0x0040, 0x4374, 0x1078, 0x4443, 0x127f, - 0x2000, 0x007c, 0x7204, 0x7108, 0xc19c, 0x8103, 0x00c8, 0x43b9, - 0x1078, 0x44ba, 0x0078, 0x43aa, 0x7003, 0x0008, 0x127f, 0x2000, - 0x007c, 0xa205, 0x00c0, 0x43a5, 0x7003, 0x0008, 0x127f, 0x2000, - 0x007c, 0x6428, 0x84ff, 0x0040, 0x43ed, 0x2c70, 0x7004, 0xa0bc, - 0x000f, 0xa7b8, 0x43fd, 0x273c, 0x87fb, 0x00c0, 0x43db, 0x0048, - 0x43d3, 0x1078, 0x28ec, 0x609c, 0xa075, 0x0040, 0x43ed, 0x0078, - 0x43c6, 0x2039, 0x43f2, 0x2704, 0xae68, 0x6808, 0xa630, 0x680c, - 0xa529, 0x8421, 0x0040, 0x43ed, 0x8738, 0x2704, 0xa005, 0x00c0, - 0x43dc, 0x709c, 0xa075, 0x00c0, 0x43c6, 0x007c, 0x0000, 0x0005, - 0x0009, 0x000d, 0x0011, 0x0015, 0x0019, 0x001d, 0x0000, 0x0003, - 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0000, 0x43f2, 0x43ef, - 0x0000, 0x0000, 0x8000, 0x0000, 0x43f2, 0x0000, 0x43fa, 0x43f7, - 0x0000, 0x0000, 0x0000, 0x0000, 0x43fa, 0x0000, 0x43f5, 0x43f5, - 0x0000, 0x0000, 0x8000, 0x0000, 0x43f5, 0x0000, 0x43fb, 0x43fb, - 0x0000, 0x0000, 0x0000, 0x0000, 0x43fb, 0x2079, 0x4a00, 0x2071, - 0x0010, 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, 0x0001, 0x7810, - 0xd0ec, 0x0040, 0x4431, 0x2009, 0x0001, 0x2071, 0x0020, 0x0078, - 0x4435, 0x2009, 0x0002, 0x2071, 0x0050, 0x7007, 0x000a, 0x7007, - 0x0002, 0x7003, 0x0000, 0x8109, 0x0040, 0x4442, 0x2071, 0x0020, - 0x0078, 0x4435, 0x007c, 0x7004, 0x8004, 0x00c8, 0x44a6, 0x7007, - 0x0012, 0x2019, 0x0000, 0x7108, 0x7008, 0xa106, 0x00c0, 0x444b, - 0xa184, 0x01e0, 0x0040, 0x4456, 0x1078, 0x28ec, 0x7810, 0xd0ec, - 0x0040, 0x4470, 0x2001, 0x04fd, 0x2004, 0xa086, 0x0003, 0x00c0, - 0x4474, 0xa184, 0x4000, 0x0040, 0x4478, 0xa382, 0x0003, 0x00c8, - 0x4478, 0xa184, 0x0004, 0x0040, 0x444b, 0x8318, 0x0078, 0x444b, - 0x7814, 0xd0ec, 0x00c0, 0x4478, 0xa184, 0x4000, 0x00c0, 0x444b, - 0xa19c, 0x300c, 0xa386, 0x2004, 0x0040, 0x4486, 0xa386, 0x0008, - 0x0040, 0x4491, 0xa386, 0x200c, 0x00c0, 0x444b, 0x7200, 0x8204, - 0x0048, 0x4491, 0x730c, 0xa384, 0x03ff, 0x0040, 0x4491, 0x1078, - 0x28ec, 0x7007, 0x0012, 0x7000, 0xd084, 0x00c0, 0x44a6, 0x7008, - 0xa084, 0x01e0, 0x00c0, 0x44a6, 0x7310, 0x7014, 0xa305, 0x0040, - 0x44a6, 0x710c, 0xa184, 0x03ff, 0x00c0, 0x4443, 0x7007, 0x0012, - 0x7007, 0x0008, 0x7004, 0xd09c, 0x00c0, 0x44aa, 0x7007, 0x0012, - 0x7108, 0x8103, 0x0048, 0x44ae, 0x7003, 0x0008, 0x007c, 0x7108, - 0x0078, 0x44ba, 0xa184, 0x01e0, 0x00c0, 0x44ee, 0x7108, 0xa184, - 0x01e0, 0x00c0, 0x44ee, 0xa184, 0x0007, 0x0079, 0x44c7, 0x44d1, - 0x44e1, 0x44cf, 0x44e1, 0x44cf, 0x4533, 0x44cf, 0x4531, 0x1078, - 0x28ec, 0x7004, 0xa084, 0x0010, 0xc08d, 0x7006, 0x8aff, 0x00c0, - 0x44dc, 0x2049, 0x0000, 0x007c, 0x1078, 0x46a3, 0x00c0, 0x44dc, - 0x007c, 0x7004, 0xa084, 0x0010, 0xc08d, 0x7006, 0x8aff, 0x0040, - 0x44ed, 0x1078, 0x46a3, 0x00c0, 0x44e9, 0x007c, 0x7007, 0x0012, - 0x7108, 0x00e0, 0x44f1, 0x2091, 0x6000, 0x00e0, 0x44f5, 0x2091, - 0x6000, 0x7007, 0x0012, 0x7007, 0x0008, 0x7004, 0xd09c, 0x00c0, - 0x44fd, 0x7007, 0x0012, 0x7108, 0xd1fc, 0x00c0, 0x4501, 0x7003, - 0x0000, 0x7000, 0xa005, 0x00c0, 0x4515, 0x7004, 0xa005, 0x00c0, - 0x4515, 0x700c, 0xa005, 0x0040, 0x4517, 0x0078, 0x44f9, 0x2049, - 0x0000, 0xb284, 0x0100, 0x0040, 0x4521, 0x2001, 0x0000, 0x0078, - 0x4523, 0x2001, 0x0001, 0x1078, 0x3ff5, 0x6818, 0xa084, 0x8000, - 0x0040, 0x452c, 0x681b, 0x0002, 0x007c, 0x1078, 0x28ec, 0x1078, - 0x28ec, 0x1078, 0x4570, 0x7210, 0x7114, 0x700c, 0xa09c, 0x03ff, - 0x2800, 0xa300, 0xa211, 0xa189, 0x0000, 0x1078, 0x4570, 0x2704, - 0x2c58, 0xac60, 0x6308, 0x2200, 0xa322, 0x630c, 0x2100, 0xa31b, - 0x2400, 0xa305, 0x0040, 0x4556, 0x00c8, 0x4556, 0x8412, 0x8210, - 0x830a, 0xa189, 0x0000, 0x2b60, 0x0078, 0x453d, 0x2b60, 0x8a07, - 0x007e, 0x6004, 0xa084, 0x0008, 0x0040, 0x4562, 0xa7ba, 0x43f7, - 0x0078, 0x4564, 0xa7ba, 0x43ef, 0x007f, 0xa73d, 0x2c00, 0x6886, - 0x6f8a, 0x6c92, 0x6b8e, 0x7007, 0x0012, 0x1078, 0x4443, 0x007c, - 0x8a50, 0x8739, 0x2704, 0xa004, 0x00c0, 0x4584, 0x6000, 0xa064, - 0x00c0, 0x457b, 0x2d60, 0x6004, 0xa084, 0x000f, 0xa080, 0x440d, - 0x203c, 0x87fb, 0x1040, 0x28ec, 0x007c, 0x127e, 0x0d7e, 0x70d4, - 0xa084, 0x4600, 0x8004, 0x2090, 0x0d7f, 0x6884, 0x2060, 0x6888, - 0x6b8c, 0x6c90, 0x8057, 0xaad4, 0x00ff, 0xa084, 0x00ff, 0x007e, - 0x6804, 0xa084, 0x0008, 0x007f, 0x0040, 0x45a2, 0xa0b8, 0x43f7, - 0x0078, 0x45a4, 0xa0b8, 0x43ef, 0xb284, 0x0100, 0x0040, 0x45ab, - 0x7e20, 0x0078, 0x45ac, 0x7e24, 0xa6b5, 0x000c, 0x681c, 0xd0b4, - 0x0040, 0x45b3, 0xc685, 0x2400, 0xa305, 0x0040, 0x45dd, 0x2c58, - 0x2704, 0x6104, 0xac60, 0x6000, 0xa400, 0x701a, 0x6004, 0xa301, - 0x701e, 0xa184, 0x0008, 0x0040, 0x45cd, 0x6010, 0xa081, 0x0000, - 0x7022, 0x6014, 0xa081, 0x0000, 0x7026, 0x6208, 0x2400, 0xa202, - 0x7012, 0x620c, 0x2300, 0xa203, 0x7016, 0x7602, 0x7007, 0x0001, - 0x2b60, 0x1078, 0x46c6, 0x0078, 0x45df, 0x1078, 0x46a3, 0x00c0, - 0x45dd, 0x127f, 0x2000, 0x007c, 0x127e, 0x0d7e, 0x70d4, 0xa084, - 0x4600, 0x8004, 0x2090, 0x0d7f, 0x7007, 0x0004, 0x7004, 0xd094, - 0x00c0, 0x45ee, 0x7003, 0x0008, 0x127f, 0x2000, 0x007c, 0x127e, - 0x0d7e, 0x70d4, 0xa084, 0x4600, 0x8004, 0x2090, 0x0d7f, 0x7e20, - 0xb284, 0x0100, 0x00c0, 0x4605, 0x7e24, 0xa6b5, 0x000c, 0x681c, - 0xd0ac, 0x00c0, 0x4610, 0xc685, 0x7003, 0x0000, 0x7007, 0x0004, - 0x6828, 0x2050, 0x2d60, 0x6004, 0xa0bc, 0x000f, 0xa7b8, 0x43fd, - 0x273c, 0x87fb, 0x00c0, 0x4626, 0x0048, 0x4620, 0x1078, 0x28ec, - 0x689c, 0xa065, 0x0040, 0x462a, 0x0078, 0x4613, 0x1078, 0x46a3, - 0x00c0, 0x4626, 0x127f, 0x2000, 0x007c, 0x127e, 0x007e, 0x017e, - 0x0d7e, 0x70d4, 0xa084, 0x4600, 0x8004, 0x2090, 0x7e20, 0xb284, - 0x0100, 0x00c0, 0x463c, 0x7e24, 0x0d7f, 0x037f, 0x047f, 0xa6b5, - 0x000c, 0x681c, 0xd0b4, 0x0040, 0x464a, 0xc685, 0x7003, 0x0000, - 0x7007, 0x0004, 0x2049, 0x462d, 0x6828, 0xa055, 0x0040, 0x46a0, - 0x2d70, 0x2e60, 0x7004, 0xa0bc, 0x000f, 0xa7b8, 0x43fd, 0x273c, - 0x87fb, 0x00c0, 0x4666, 0x0048, 0x465f, 0x1078, 0x28ec, 0x709c, - 0xa075, 0x2060, 0x0040, 0x46a0, 0x0078, 0x4652, 0x2704, 0xae68, - 0x6808, 0xa422, 0x680c, 0xa31b, 0x0048, 0x467f, 0x8a51, 0x00c0, - 0x4673, 0x1078, 0x28ec, 0x8738, 0x2704, 0xa005, 0x00c0, 0x4667, - 0x709c, 0xa075, 0x2060, 0x0040, 0x46a0, 0x0078, 0x4652, 0x8422, - 0x8420, 0x831a, 0xa399, 0x0000, 0x6908, 0x2400, 0xa122, 0x690c, - 0x2300, 0xa11b, 0x00c8, 0x468e, 0x1078, 0x28ec, 0xb284, 0x0100, - 0x0040, 0x469c, 0x2001, 0x4a04, 0x2004, 0xd0ec, 0x00c0, 0x469c, - 0x2071, 0x0050, 0x0078, 0x469e, 0x2071, 0x0020, 0x0078, 0x45b3, - 0x127f, 0x2000, 0x007c, 0x7008, 0xa084, 0x0003, 0xa086, 0x0003, - 0x00c0, 0x46ab, 0x007c, 0x2704, 0xac78, 0x7800, 0x701a, 0x7804, - 0x701e, 0x7808, 0x7012, 0x780c, 0x7016, 0x6004, 0xa084, 0x0008, - 0x0040, 0x46be, 0x7810, 0x7022, 0x7814, 0x7026, 0x7602, 0x7004, - 0xa084, 0x0010, 0xc085, 0x7006, 0x2079, 0x4a00, 0x8a51, 0x0040, - 0x46e1, 0x8738, 0x2704, 0xa005, 0x00c0, 0x46dc, 0x609c, 0xa005, - 0x0040, 0x46e2, 0x2060, 0x6004, 0xa084, 0x000f, 0xa080, 0x43fd, - 0x203c, 0x87fb, 0x1040, 0x28ec, 0x7008, 0xa084, 0x0003, 0xa086, - 0x0003, 0x007c, 0x2051, 0x0000, 0x007c, 0x127e, 0x007e, 0x0d7e, - 0x70d4, 0xa084, 0x4600, 0x8004, 0x2090, 0x0d7f, 0x087f, 0x7108, - 0xa184, 0x0003, 0x00c0, 0x46fa, 0x6828, 0xa005, 0x0040, 0x470a, - 0x0078, 0x4342, 0x7108, 0xd1fc, 0x0040, 0x4702, 0x1078, 0x44ba, - 0x0078, 0x46ef, 0x7007, 0x0010, 0x7108, 0xd1fc, 0x0040, 0x4704, - 0x1078, 0x44ba, 0x7008, 0xa086, 0x0008, 0x00c0, 0x46ef, 0x7000, - 0xa005, 0x00c0, 0x46ef, 0x7003, 0x0000, 0x2049, 0x0000, 0x127f, - 0x2000, 0x007c, 0x127e, 0x147e, 0x137e, 0x157e, 0x0c7e, 0x0d7e, - 0x70d4, 0xa084, 0x4600, 0x8004, 0x2090, 0x0d7f, 0x2049, 0x471a, - 0xad80, 0x0011, 0x20a0, 0xb284, 0x0100, 0x0040, 0x473d, 0x2001, - 0x4a04, 0x2004, 0xd0ec, 0x0040, 0x4739, 0x2099, 0x0031, 0x0078, - 0x473f, 0x2099, 0x0032, 0x0078, 0x473f, 0x2099, 0x0031, 0x700c, - 0xa084, 0x03ff, 0x682a, 0x7007, 0x0008, 0x7007, 0x0002, 0x7003, - 0x0001, 0x0040, 0x474e, 0x8000, 0x80ac, 0x53a5, 0x700c, 0xa084, - 0x03ff, 0x0040, 0x475a, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, - 0x00c0, 0x4755, 0x0c7f, 0x2049, 0x0000, 0x7003, 0x0000, 0x157f, - 0x137f, 0x147f, 0x127f, 0x2000, 0x007c, 0x2091, 0x8000, 0x2091, - 0x6000, 0x78ac, 0xa005, 0x00c0, 0x477c, 0x7974, 0x70d0, 0xa106, - 0x00c0, 0x477c, 0x781c, 0xa005, 0x0040, 0x477c, 0x781f, 0x0000, - 0x0068, 0x477c, 0x2091, 0x4080, 0x7830, 0x8001, 0x7832, 0x00c0, - 0x4804, 0x7834, 0x7832, 0x7810, 0xd0ec, 0x00c0, 0x47fd, 0x2061, - 0x6fc0, 0x2069, 0x4a80, 0xc7fd, 0x68d0, 0xa005, 0x0040, 0x4796, - 0x8001, 0x68d2, 0x00c0, 0x4796, 0x1078, 0x4998, 0x6800, 0xa084, - 0x000f, 0x0040, 0x47ab, 0xa086, 0x0001, 0x0040, 0x47ab, 0x6844, - 0xa00d, 0x0040, 0x47ab, 0x2104, 0xa005, 0x0040, 0x47ab, 0x8001, - 0x200a, 0x0040, 0x4909, 0x6814, 0xa005, 0x0040, 0x47d0, 0x8001, - 0x6816, 0x00c0, 0x47d0, 0x68a7, 0x0001, 0x0f7e, 0xd7fc, 0x00c0, - 0x47c5, 0x7810, 0xd0ec, 0x0040, 0x47c1, 0x2079, 0x0100, 0x0078, - 0x47c7, 0x2079, 0x0200, 0x0078, 0x47c7, 0x2079, 0x0100, 0x1078, - 0x4131, 0x0f7f, 0x6864, 0xa005, 0x0040, 0x47d0, 0x1078, 0x25de, - 0x6880, 0xa005, 0x0040, 0x47dd, 0x8001, 0x6882, 0x00c0, 0x47dd, - 0x6867, 0x0000, 0x68d4, 0xc0dd, 0x68d6, 0x68d4, 0xd0fc, 0x0040, - 0x47fa, 0xc0fc, 0x68d6, 0x20a9, 0x0200, 0x603c, 0xa005, 0x0040, - 0x47f6, 0x8001, 0x603e, 0x68d4, 0xc0fd, 0x68d6, 0x00c0, 0x47f6, - 0x6010, 0xa005, 0x0040, 0x47f6, 0x1078, 0x25de, 0xace0, 0x0010, - 0x00f0, 0x47e5, 0xd7fc, 0x0040, 0x4804, 0x2061, 0x4fc0, 0x2069, - 0x4a40, 0xc7fc, 0x0078, 0x478c, 0x1078, 0x4840, 0x7838, 0x8001, - 0x783a, 0x00c0, 0x4826, 0x783c, 0x783a, 0x2061, 0x4fc0, 0x2069, - 0x4a40, 0xc7fc, 0x680c, 0xa005, 0x0040, 0x4818, 0x1078, 0x487f, - 0xd7fc, 0x00c0, 0x4826, 0x7810, 0xd0ec, 0x00c0, 0x4826, 0x2061, - 0x6fc0, 0x2069, 0x4a80, 0xc7fd, 0x0078, 0x4812, 0x7814, 0xd0e4, - 0x00c0, 0x482a, 0x7810, 0xd0cc, 0x0040, 0x483d, 0xd0ac, 0x00c0, - 0x4836, 0xd0a4, 0x0040, 0x483d, 0xc0ad, 0x7812, 0x2091, 0x8001, - 0x0068, 0x483c, 0x1078, 0x2368, 0x007c, 0x2091, 0x8001, 0x007c, - 0x7840, 0x8001, 0x7842, 0x00c0, 0x487e, 0x7844, 0x7842, 0x2091, - 0x8000, 0x2061, 0x4fc0, 0x2069, 0x4a40, 0xc7fc, 0x6810, 0xa005, - 0x00c0, 0x4854, 0x2001, 0x0101, 0x8001, 0x6812, 0xd7fc, 0x0040, - 0x485d, 0xa080, 0x90d0, 0x0078, 0x485f, 0xa080, 0x8fc0, 0x2040, - 0x2004, 0xa065, 0x0040, 0x4870, 0x6024, 0xa005, 0x0040, 0x486c, - 0x8001, 0x6026, 0x0040, 0x48ad, 0x6000, 0x2c40, 0x0078, 0x4861, - 0xd7fc, 0x00c0, 0x487e, 0x7810, 0xd0ec, 0x00c0, 0x487e, 0x2061, - 0x6fc0, 0x2069, 0x4a80, 0xc7fd, 0x0078, 0x484e, 0x007c, 0x2009, - 0x0000, 0x20a9, 0x0200, 0x6008, 0xd09c, 0x0040, 0x4899, 0x6024, - 0xa005, 0x0040, 0x488f, 0x8001, 0x6026, 0x0078, 0x4897, 0x6008, - 0xc09c, 0xc0bd, 0x600a, 0xa18d, 0x0001, 0x0078, 0x4899, 0xa18d, - 0x0100, 0xace0, 0x0010, 0x00f0, 0x4883, 0xa184, 0x0001, 0x0040, - 0x48a8, 0xa18c, 0xfffe, 0x690e, 0x1078, 0x25de, 0x0078, 0x48a9, - 0x690e, 0x007c, 0x00c0, 0x48a9, 0x786c, 0x6800, 0xa005, 0x0040, - 0x48b5, 0x684c, 0xac06, 0x0040, 0x4909, 0x6864, 0xa005, 0x0040, - 0x48bd, 0x6027, 0x0001, 0x0078, 0x4906, 0x2c00, 0x687e, 0x601b, + 0x6820, 0xc0c5, 0x6822, 0x70d4, 0xd0b4, 0x0040, 0x3eda, 0xc0b4, + 0x70d6, 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, + 0x8001, 0x601a, 0x0c7f, 0x007c, 0x0c7e, 0x2960, 0x6104, 0xa18c, + 0xfff5, 0x6106, 0x2011, 0x0032, 0x2019, 0x0000, 0x0078, 0x3ee8, + 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, + 0xa8c0, 0x0005, 0x6820, 0xc0c5, 0x6822, 0x0c7f, 0x007c, 0x0c7e, + 0x7158, 0x2160, 0x2018, 0xa08c, 0x0020, 0x0040, 0x3f00, 0xc0ac, + 0x2008, 0xa084, 0xfff0, 0xa635, 0x7e86, 0x6018, 0x789a, 0x7eae, + 0x6612, 0x78a4, 0xa084, 0xfff0, 0xa18c, 0x000f, 0xa105, 0xc0f4, + 0xa39c, 0x0020, 0x0040, 0x3f16, 0xa085, 0x4000, 0xc0fc, 0xd0b4, + 0x00c0, 0x3f1b, 0xc0fd, 0x78a6, 0x6016, 0x788a, 0xa6b4, 0x000f, + 0x8637, 0x8204, 0x8004, 0xa084, 0x00ff, 0xa605, 0x600e, 0x6004, + 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x007c, 0x0c7e, 0x7058, 0x2060, + 0x6018, 0x789a, 0x78a4, 0xa084, 0xfff0, 0x78a6, 0x6012, 0x7884, + 0xa084, 0xfff0, 0x7886, 0x600c, 0xa084, 0x00ff, 0x600e, 0x0c7f, + 0x007c, 0xa282, 0x0002, 0x00c0, 0x4040, 0x7aa8, 0x6920, 0xc1bd, + 0x6922, 0xd1cc, 0x0040, 0x3f7c, 0xc1cc, 0x6922, 0xa294, 0x00ff, + 0xa282, 0x0002, 0x00c8, 0x4040, 0x1078, 0x3fcd, 0x1078, 0x3f2d, + 0xa980, 0x0001, 0x200c, 0x1078, 0x4183, 0x1078, 0x3e7c, 0x88ff, + 0x0040, 0x3f72, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, 0xc695, + 0x7e5a, 0xd6d4, 0x00c0, 0x3f6f, 0x781b, 0x0061, 0x007c, 0x781b, + 0x0075, 0x007c, 0x7e58, 0xd6d4, 0x00c0, 0x3f79, 0x781b, 0x0064, + 0x007c, 0x781b, 0x0076, 0x007c, 0xa282, 0x0002, 0x00c8, 0x3f84, + 0xa284, 0x0001, 0x0040, 0x3f8d, 0x7158, 0xa188, 0x0000, 0x210c, + 0xd1ec, 0x00c0, 0x3f8d, 0x2011, 0x0000, 0x1078, 0x40b5, 0x1078, + 0x3fcd, 0x1078, 0x3f2d, 0x7858, 0xc095, 0x785a, 0x781b, 0x0075, + 0x007c, 0x0c7e, 0x027e, 0x2960, 0x6000, 0x2011, 0x0001, 0xd0ec, + 0x00c0, 0x3fae, 0x6014, 0xa084, 0x0040, 0x00c0, 0x3fac, 0xc1a4, + 0x6106, 0xa006, 0x0078, 0x3fca, 0x2011, 0x0000, 0x78ab, 0x0001, + 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0xa8c0, 0x0004, 0x70d4, + 0xd0b4, 0x0040, 0x3fc6, 0xc0b4, 0x70d6, 0x70b8, 0xa065, 0x6008, + 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x6820, 0xa085, + 0x0200, 0x6822, 0x027f, 0x0c7f, 0x007c, 0x0c7e, 0x7058, 0x2060, + 0x82ff, 0x0040, 0x3fd5, 0x2011, 0x0040, 0x6018, 0xa080, 0x0002, + 0x789a, 0x78a4, 0xa084, 0xffbf, 0xa205, 0xc0fc, 0xd0b4, 0x00c0, + 0x3fe2, 0xc0fd, 0x78a6, 0x6016, 0x788a, 0x6004, 0xc0a4, 0x6006, + 0x0c7f, 0x007c, 0x007e, 0x7000, 0xa086, 0x0003, 0x0040, 0x3ff3, + 0x007f, 0x0078, 0x3ff6, 0x007f, 0x0078, 0x403d, 0xd6ac, 0x0040, + 0x403d, 0x7888, 0xa084, 0x0040, 0x0040, 0x403d, 0x7bb8, 0xa384, + 0x003f, 0x831b, 0x00c8, 0x4005, 0x8000, 0xa005, 0x0040, 0x401a, + 0x831b, 0x00c8, 0x400e, 0x8001, 0x0040, 0x403a, 0xd6f4, 0x0040, + 0x401a, 0x78b8, 0x801b, 0x00c8, 0x4016, 0x8000, 0xa084, 0x003f, + 0x00c0, 0x403a, 0xc6f4, 0x7e5a, 0x79d8, 0x7adc, 0x2001, 0x0001, + 0xa108, 0x00c8, 0x4025, 0xa291, 0x0000, 0x79d2, 0x79da, 0x7ad6, + 0x7ade, 0x1078, 0x493a, 0x781b, 0x0073, 0xb284, 0x0300, 0x0040, + 0x4035, 0x2001, 0x0000, 0x0078, 0x4037, 0x2001, 0x0001, 0x1078, + 0x47c2, 0x007c, 0x781b, 0x0073, 0x007c, 0x781b, 0x0076, 0x007c, + 0x1078, 0x4068, 0x781b, 0x0075, 0x007c, 0x1078, 0x4051, 0x781b, + 0x0075, 0x007c, 0x6827, 0x0002, 0x1078, 0x4059, 0x781b, 0x0075, + 0x007c, 0x2001, 0x0005, 0x0078, 0x406a, 0x2001, 0x000c, 0x0078, + 0x406a, 0x6820, 0xc0d5, 0x6822, 0x2001, 0x0006, 0x0078, 0x406a, + 0x2001, 0x000d, 0x0078, 0x406a, 0x2001, 0x0009, 0x0078, 0x406a, + 0x2001, 0x0007, 0x789b, 0x007e, 0x78aa, 0xc69d, 0x7e5a, 0x70d4, + 0xd0b4, 0x0040, 0x4080, 0xc0b4, 0x70d6, 0x0c7e, 0x70b8, 0xa065, + 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x0c7f, + 0x007c, 0x077e, 0x873f, 0xa7bc, 0x000f, 0x873b, 0x873b, 0x8703, + 0x017e, 0xb28c, 0x0300, 0x0040, 0x4091, 0xa0e0, 0x51c0, 0x0078, + 0x4093, 0xa0e0, 0x5240, 0x017f, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, + 0xa184, 0x000f, 0x0040, 0x40a3, 0xa184, 0xfff0, 0x78a6, 0x6012, + 0x6004, 0xc09d, 0x6006, 0x8738, 0x8738, 0x7f9a, 0x79a4, 0xa184, + 0x0040, 0x0040, 0x40b3, 0xa184, 0xffbf, 0xc0fd, 0x78a6, 0x6016, + 0x6004, 0xc0a5, 0x6006, 0x077f, 0x007c, 0x789b, 0x0010, 0x78ab, + 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0060, + 0x78ab, 0x0004, 0x70d4, 0xd0b4, 0x0040, 0x40d3, 0xc0b4, 0x70d6, + 0x0c7e, 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, + 0x8001, 0x601a, 0x0c7f, 0x007c, 0x2031, 0x0000, 0x2029, 0x0032, + 0x789b, 0x0010, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, + 0x7daa, 0x7eaa, 0x789b, 0x0060, 0x78ab, 0x0005, 0x70d4, 0xd0b4, + 0x0040, 0x40f7, 0xc0b4, 0x70d6, 0x0c7e, 0x70b8, 0xa065, 0x6008, + 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x0c7f, 0x007c, + 0x157e, 0x8007, 0xa084, 0x00ff, 0x8003, 0x8003, 0xa080, 0x0020, + 0x789a, 0x79a4, 0xa18c, 0xfff0, 0x2021, 0x416c, 0x2019, 0x0011, + 0x20a9, 0x000e, 0x2011, 0x0032, 0x2404, 0xa084, 0xfff0, 0xa106, + 0x0040, 0x4117, 0x8420, 0x2300, 0xa210, 0x00f0, 0x410c, 0x157f, + 0x007c, 0x157e, 0x2001, 0x4d05, 0x2004, 0xd0e4, 0x00c0, 0x414a, + 0x2021, 0x417a, 0x20a9, 0x0009, 0x2011, 0x0028, 0xa582, 0x0019, + 0x0040, 0x4160, 0x0048, 0x4160, 0x8420, 0x95a9, 0x2011, 0x0032, + 0xa582, 0x0032, 0x0040, 0x4160, 0x0048, 0x4160, 0x8420, 0x95a9, + 0x2019, 0x000a, 0x2011, 0x0064, 0x2200, 0xa502, 0x0040, 0x4160, + 0x0048, 0x4160, 0x8420, 0x2300, 0xa210, 0x00f0, 0x413c, 0x157f, + 0x0078, 0x415e, 0x2021, 0x416c, 0x2019, 0x0011, 0x20a9, 0x000e, + 0x2011, 0x0032, 0x2200, 0xa502, 0x0040, 0x4160, 0x0048, 0x4160, + 0x8420, 0x2300, 0xa210, 0x00f0, 0x4152, 0x157f, 0xa006, 0x007c, + 0x157f, 0xa582, 0x0064, 0x00c8, 0x4169, 0x7808, 0xa085, 0x0070, + 0x780a, 0x2404, 0xa005, 0x007c, 0x1209, 0x3002, 0x3202, 0x4203, + 0x4403, 0x5404, 0x5604, 0x6605, 0x6805, 0x7806, 0x7a06, 0x0c07, + 0x0c07, 0x0e07, 0x10e1, 0x330a, 0x5805, 0x5a05, 0x6a06, 0x6c06, + 0x7c07, 0x7e07, 0x0e00, 0x789b, 0x0010, 0xa046, 0x007c, 0xa784, + 0x0f00, 0x800b, 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, 0x8003, + 0xa105, 0xd7fc, 0x0040, 0x4198, 0xa0e0, 0x72c0, 0x0078, 0x419a, + 0xa0e0, 0x52c0, 0x007c, 0x0e7e, 0x0f7e, 0xd084, 0x0040, 0x41a8, + 0x2079, 0x0100, 0x2009, 0x4d80, 0x2071, 0x4d80, 0x0078, 0x41b8, + 0x2009, 0x4d40, 0x2071, 0x4d40, 0x2001, 0x4d04, 0x2004, 0xd0ec, + 0x0040, 0x41b6, 0x2079, 0x0100, 0x0078, 0x41b8, 0x2079, 0x0200, + 0x2091, 0x8000, 0x2104, 0xa084, 0x000f, 0x0079, 0x41bf, 0x41c9, + 0x41c9, 0x41c9, 0x41c9, 0x41c9, 0x41c9, 0x41c7, 0x41c7, 0x1078, + 0x290c, 0x69b4, 0xc1f5, 0xa18c, 0xff9f, 0x69b6, 0xa005, 0x0040, + 0x4218, 0x7858, 0xa084, 0xff9f, 0xa085, 0x6000, 0x785a, 0x7828, + 0xa086, 0x1814, 0x00c0, 0x4218, 0x784b, 0x0004, 0x7848, 0xa084, + 0x0004, 0x00c0, 0x41de, 0x784b, 0x0008, 0x7848, 0xa084, 0x0008, + 0x00c0, 0x41e5, 0x7830, 0xd0bc, 0x00c0, 0x4218, 0x007e, 0x2001, + 0x4d04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x41fa, 0xb284, 0x0300, + 0x0078, 0x41fc, 0xb284, 0x0400, 0x0040, 0x4202, 0x0018, 0x4218, + 0x0078, 0x4204, 0x0028, 0x4218, 0x79e4, 0xa184, 0x0030, 0x0040, + 0x4218, 0x78ec, 0xa084, 0x0003, 0x0040, 0x4218, 0x681c, 0xd0ac, + 0x00c0, 0x4216, 0x1078, 0x42a2, 0x0078, 0x4218, 0x781b, 0x00f6, + 0x0f7f, 0x0e7f, 0x007c, 0x0c7e, 0x2001, 0x4d01, 0x2004, 0xd0ac, + 0x00c0, 0x4294, 0x6814, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, + 0x8003, 0xb28c, 0x0300, 0x0040, 0x4231, 0xa0e0, 0x51c0, 0x0078, + 0x4233, 0xa0e0, 0x5240, 0x6004, 0xa084, 0x000a, 0x00c0, 0x4294, + 0x6108, 0xa194, 0xff00, 0x0040, 0x4294, 0xa18c, 0x00ff, 0x2001, + 0x000a, 0xa106, 0x0040, 0x425f, 0x2001, 0x000c, 0xa106, 0x0040, + 0x4263, 0x2001, 0x0012, 0xa106, 0x0040, 0x4267, 0x2001, 0x0014, + 0xa106, 0x0040, 0x426b, 0x2001, 0x0019, 0xa106, 0x0040, 0x426f, + 0x2001, 0x0032, 0xa106, 0x0040, 0x4273, 0x0078, 0x4277, 0x2009, + 0x000c, 0x0078, 0x4279, 0x2009, 0x0012, 0x0078, 0x4279, 0x2009, + 0x0014, 0x0078, 0x4279, 0x2009, 0x0019, 0x0078, 0x4279, 0x2009, + 0x0020, 0x0078, 0x4279, 0x2009, 0x003f, 0x0078, 0x4279, 0x2011, + 0x0000, 0x2100, 0xa205, 0x600a, 0x6004, 0xa085, 0x0002, 0x6006, + 0x2061, 0x4d00, 0x6004, 0xd0bc, 0x0040, 0x4294, 0x6814, 0xd0fc, + 0x00c0, 0x428f, 0x60ea, 0x2061, 0x4d40, 0x0078, 0x4292, 0x60ee, + 0x2061, 0x4d80, 0x601f, 0x800f, 0x0c7f, 0x007c, 0x781b, 0x0076, + 0x007c, 0x781b, 0x0075, 0x007c, 0x781b, 0x0064, 0x007c, 0x781b, + 0x0061, 0x007c, 0x2009, 0x4d19, 0x210c, 0xa186, 0x0000, 0x0040, + 0x42b4, 0xa186, 0x0001, 0x0040, 0x42b7, 0x701f, 0x000b, 0x7067, + 0x0001, 0x781b, 0x0047, 0x007c, 0x781b, 0x00ed, 0x007c, 0x701f, + 0x000a, 0x007c, 0x2009, 0x4d19, 0x210c, 0xa186, 0x0000, 0x0040, + 0x42cf, 0xa186, 0x0001, 0x0040, 0x42cc, 0x701f, 0x000b, 0x7067, + 0x0001, 0x781b, 0x0047, 0x007c, 0x701f, 0x000a, 0x007c, 0x781b, + 0x00ec, 0x007c, 0x781b, 0x00f6, 0x007c, 0x781b, 0x00f5, 0x007c, + 0x781b, 0x00c6, 0x007c, 0x781b, 0x00c5, 0x007c, 0x6818, 0xd0fc, + 0x0040, 0x42e4, 0x681b, 0x001d, 0x7067, 0x0001, 0x781b, 0x0047, + 0x007c, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x42fd, 0x7808, 0xc08c, + 0x780a, 0x0005, 0x0005, 0x0005, 0x0005, 0x78ec, 0xa084, 0x0021, + 0x0040, 0x42fd, 0x7808, 0xc08d, 0x780a, 0x007c, 0x7808, 0xc08d, + 0x780a, 0x007c, 0x7830, 0xa084, 0x0040, 0x00c0, 0x4302, 0x2001, + 0x4d04, 0x2004, 0xd0ec, 0x0040, 0x4311, 0xb284, 0x0300, 0x0078, + 0x4313, 0xb284, 0x0400, 0x0040, 0x4319, 0x0098, 0x431d, 0x0078, + 0x431b, 0x00a8, 0x431d, 0x78ac, 0x007c, 0x7808, 0xa084, 0xfffd, + 0x780a, 0x0005, 0x0005, 0x0005, 0x0005, 0x78ec, 0xa084, 0x0021, + 0x0040, 0x4340, 0x007e, 0x2001, 0x4d04, 0x2004, 0xd0ec, 0x007f, + 0x0040, 0x4336, 0xb284, 0x0300, 0x0078, 0x4338, 0xb284, 0x0400, + 0x0040, 0x433e, 0x0098, 0x433a, 0x0078, 0x4340, 0x00a8, 0x433e, + 0x78ac, 0x007e, 0x7808, 0xa085, 0x0002, 0x780a, 0x007f, 0x007c, + 0xa784, 0x0001, 0x00c0, 0x36fb, 0xa784, 0x0070, 0x0040, 0x4358, + 0x0c7e, 0x2d60, 0x2f68, 0x1078, 0x288d, 0x2d78, 0x2c68, 0x0c7f, + 0xa784, 0x0008, 0x0040, 0x4365, 0x784b, 0x0008, 0x78ec, 0xa084, + 0x0003, 0x0040, 0x2966, 0x0078, 0x4296, 0xa784, 0x0004, 0x0040, + 0x4394, 0x78b8, 0xa084, 0x4001, 0x0040, 0x4394, 0x784b, 0x0008, + 0x78ec, 0xa084, 0x0003, 0x0040, 0x2966, 0x78e4, 0xa084, 0x0007, + 0xa086, 0x0001, 0x00c0, 0x4394, 0x78c0, 0xa685, 0x4800, 0x2030, + 0x7e5a, 0x781b, 0x00f6, 0x007c, 0x784b, 0x0008, 0x6818, 0xd0fc, + 0x0040, 0x4391, 0x681b, 0x0015, 0xd6f4, 0x0040, 0x4391, 0x681b, + 0x0007, 0x1078, 0x42a2, 0x007c, 0x681b, 0x0003, 0x7858, 0xa084, + 0x3f00, 0x681e, 0x682f, 0x0000, 0x6833, 0x0000, 0x784b, 0x0008, + 0x78ec, 0xa084, 0x0003, 0x0040, 0x3004, 0x007e, 0x2001, 0x4d04, + 0x2004, 0xd0ec, 0x007f, 0x0040, 0x43b1, 0xb284, 0x0300, 0x0078, + 0x43b3, 0xb284, 0x0400, 0x0040, 0x43b9, 0x0018, 0x2962, 0x0078, + 0x43bb, 0x0028, 0x2962, 0x0078, 0x4045, 0x6b14, 0x8307, 0xa084, + 0x000f, 0x8003, 0x8003, 0x8003, 0xd3fc, 0x0040, 0x43cb, 0xa080, + 0x5240, 0x0078, 0x43cd, 0xa080, 0x51c0, 0x2060, 0x2048, 0x705a, + 0x2a60, 0x007c, 0x0020, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, + 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, + 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, + 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, + 0x0000, 0x0020, 0x0000, 0x0020, 0x0062, 0x0009, 0x0014, 0x0014, + 0x9848, 0x0014, 0x0014, 0x990e, 0x98fa, 0x0014, 0x0014, 0x0080, + 0x00f9, 0x0100, 0x0402, 0x2008, 0xf880, 0x0018, 0xa20a, 0x0014, + 0x300b, 0xa20c, 0x0014, 0x2500, 0x0013, 0x2500, 0x0010, 0x0010, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, + 0x0010, 0x0010, 0x0010, 0x0010, 0xa200, 0x3806, 0x8839, 0x20c4, + 0x0864, 0xa856, 0x3008, 0x28c1, 0x9d15, 0xa201, 0x300c, 0x2847, + 0x8161, 0x846a, 0x8000, 0x84a4, 0x1856, 0x883a, 0xa808, 0x28e2, + 0x9cc8, 0xa8f3, 0x0864, 0xa844, 0x300c, 0xa801, 0x3008, 0x28e1, + 0x9cc8, 0x2021, 0xa81d, 0xa205, 0x870c, 0xd8de, 0x64a0, 0x6de0, + 0x6fc0, 0x63a4, 0x6c80, 0x0212, 0xa205, 0x883d, 0x7942, 0x8020, + 0xa4a1, 0x882b, 0x1814, 0x883b, 0x80df, 0x94a1, 0x7027, 0x85f2, + 0xa737, 0xa532, 0xf003, 0x8576, 0x8677, 0xa816, 0x883e, 0xa814, + 0x2001, 0xa812, 0xa204, 0x64c0, 0x6de0, 0x67a0, 0x6fc0, 0x7942, + 0x8020, 0xa4a1, 0x1814, 0x80df, 0x94a1, 0x883b, 0x7023, 0x8576, + 0x8677, 0xa802, 0x7861, 0x883e, 0x206b, 0x28c1, 0x9d15, 0x2044, + 0x2103, 0x20a2, 0x2081, 0xa8c3, 0xa207, 0x2901, 0xa80a, 0x0014, + 0xa203, 0x8000, 0x85a4, 0x1872, 0x879a, 0x883c, 0x1fe2, 0xf601, + 0xa208, 0x856e, 0x866f, 0x7161, 0x0014, 0x0704, 0x3008, 0x9cc8, + 0x0014, 0xa202, 0x8000, 0x85a4, 0x3009, 0x84a8, 0x19e2, 0xf844, + 0x856e, 0x883f, 0x08e6, 0xa8f5, 0xf861, 0xa8ea, 0xf801, 0x0014, + 0xf881, 0x0016, 0x85b2, 0x80f0, 0x9532, 0xfaa2, 0x1de2, 0x0014, + 0x8532, 0xf221, 0x0014, 0x1de2, 0x84a8, 0xd6e0, 0x1fe6, 0x0014, + 0x3008, 0x8000, 0x284a, 0x1011, 0xa8fc, 0x3008, 0x9d2d, 0x8000, + 0xa000, 0x2802, 0x1011, 0xa8fd, 0x9d33, 0xa8bd, 0x3008, 0x9d2d, + 0x283b, 0x1011, 0xa8fd, 0xa209, 0x0017, 0x300c, 0xa209, 0x8000, + 0x85a4, 0x1de2, 0xa209, 0xdac1, 0x0014, 0x0210, 0xa801, 0x0014, + 0x26e0, 0x873a, 0xfaa3, 0x19f2, 0x26e0, 0x18f2, 0x0014, 0xa20b, + 0x0014, 0xa20d, 0x3806, 0x0210, 0x9d1f, 0x0704, 0xa206, 0x6865, + 0x817e, 0x842a, 0x1dc1, 0x8823, 0x0016, 0x6042, 0x8008, 0xa8fa, + 0x8000, 0x84a4, 0x8160, 0x842a, 0xf021, 0x3008, 0x84a8, 0x11d6, + 0x7042, 0x20dd, 0x0011, 0x20d4, 0x8822, 0x0016, 0x7944, 0x8421, + 0xa020, 0xa532, 0x84a1, 0x0016, 0x7944, 0x8421, 0xa0df, 0x9532, + 0x84a1, 0x0016, 0x0000, 0x127e, 0x70d4, 0xa084, 0x4600, 0x8004, + 0x2090, 0x7204, 0x7008, 0xc09c, 0xa205, 0x00c0, 0x4517, 0x720c, + 0x82ff, 0x0040, 0x4512, 0x8aff, 0x00c0, 0x4517, 0x7200, 0xd284, + 0x00c0, 0x4517, 0x7003, 0x0008, 0x127f, 0x2000, 0x007c, 0x7000, + 0xa084, 0x0003, 0x7002, 0xc69c, 0xd084, 0x0040, 0x455a, 0x7108, + 0x0005, 0x7008, 0xa106, 0x00c0, 0x451f, 0xa184, 0x0003, 0x0040, + 0x458b, 0xa184, 0x01e0, 0x00c0, 0x458b, 0xd1f4, 0x00c0, 0x451f, + 0xa184, 0x3000, 0xa086, 0x1000, 0x0040, 0x451f, 0x2011, 0x0180, + 0x710c, 0x8211, 0x0040, 0x4544, 0x7008, 0xd0f4, 0x00c0, 0x451f, + 0x700c, 0xa106, 0x0040, 0x4539, 0x7007, 0x0012, 0x7108, 0x0005, + 0x7008, 0xa106, 0x00c0, 0x4546, 0xa184, 0x0003, 0x0040, 0x458b, + 0xd194, 0x0040, 0x4546, 0xd1f4, 0x0040, 0x458b, 0x7007, 0x0002, + 0x0078, 0x451f, 0x7108, 0xd1fc, 0x0040, 0x4565, 0x1078, 0x46e0, + 0x8aff, 0x0040, 0x4501, 0x0078, 0x455a, 0x700c, 0xa08c, 0x03ff, + 0x0040, 0x4590, 0x7004, 0xd084, 0x0040, 0x4582, 0x7014, 0xa005, + 0x00c0, 0x457e, 0x7010, 0x7310, 0xa306, 0x00c0, 0x4572, 0x2300, + 0xa005, 0x0040, 0x4582, 0xa102, 0x00c8, 0x455a, 0x7007, 0x0010, + 0x0078, 0x458b, 0x8aff, 0x0040, 0x4590, 0x1078, 0x48e7, 0x00c0, + 0x4585, 0x0040, 0x455a, 0x1078, 0x4629, 0x127f, 0x2000, 0x007c, + 0x7204, 0x7108, 0xc19c, 0x8103, 0x00c8, 0x459f, 0x1078, 0x46e0, + 0x0078, 0x4590, 0x7003, 0x0008, 0x127f, 0x2000, 0x007c, 0xa205, + 0x00c0, 0x458b, 0x7003, 0x0008, 0x127f, 0x2000, 0x007c, 0x6428, + 0x84ff, 0x0040, 0x45d3, 0x2c70, 0x7004, 0xa0bc, 0x000f, 0xa7b8, + 0x45e3, 0x273c, 0x87fb, 0x00c0, 0x45c1, 0x0048, 0x45b9, 0x1078, + 0x290c, 0x609c, 0xa075, 0x0040, 0x45d3, 0x0078, 0x45ac, 0x2039, + 0x45d8, 0x2704, 0xae68, 0x6808, 0xa630, 0x680c, 0xa529, 0x8421, + 0x0040, 0x45d3, 0x8738, 0x2704, 0xa005, 0x00c0, 0x45c2, 0x709c, + 0xa075, 0x00c0, 0x45ac, 0x007c, 0x0000, 0x0005, 0x0009, 0x000d, + 0x0011, 0x0015, 0x0019, 0x001d, 0x0000, 0x0003, 0x0009, 0x000f, + 0x0015, 0x001b, 0x0000, 0x0000, 0x45d8, 0x45d5, 0x0000, 0x0000, + 0x8000, 0x0000, 0x45d8, 0x0000, 0x45e0, 0x45dd, 0x0000, 0x0000, + 0x0000, 0x0000, 0x45e0, 0x0000, 0x45db, 0x45db, 0x0000, 0x0000, + 0x8000, 0x0000, 0x45db, 0x0000, 0x45e1, 0x45e1, 0x0000, 0x0000, + 0x0000, 0x0000, 0x45e1, 0x2079, 0x4d00, 0x2071, 0x0010, 0x7007, + 0x000a, 0x7007, 0x0002, 0x7003, 0x0001, 0x7810, 0xd0ec, 0x0040, + 0x4617, 0x2009, 0x0001, 0x2071, 0x0020, 0x0078, 0x461b, 0x2009, + 0x0002, 0x2071, 0x0050, 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, + 0x0000, 0x8109, 0x0040, 0x4628, 0x2071, 0x0020, 0x0078, 0x461b, + 0x007c, 0x7004, 0x8004, 0x00c8, 0x46b2, 0x7108, 0x7008, 0xa106, + 0x00c0, 0x462d, 0xa184, 0x01e0, 0x0040, 0x463a, 0x1078, 0x4723, + 0x0078, 0x46da, 0x7007, 0x0012, 0x2019, 0x0000, 0x7108, 0x7008, + 0xa106, 0x00c0, 0x463e, 0xa184, 0x01e0, 0x0040, 0x464b, 0x1078, + 0x4723, 0x0078, 0x46da, 0x7810, 0xd0ec, 0x0040, 0x4665, 0x2001, + 0x04fd, 0x2004, 0xa086, 0x0003, 0x00c0, 0x4669, 0xa184, 0x4000, + 0x0040, 0x466d, 0xa382, 0x0003, 0x00c8, 0x466d, 0xa184, 0x0004, + 0x0040, 0x463e, 0x8318, 0x0078, 0x463e, 0x7814, 0xd0ec, 0x00c0, + 0x466d, 0xa184, 0x4000, 0x00c0, 0x463e, 0xa19c, 0x300c, 0xa386, + 0x2004, 0x0040, 0x468a, 0xa386, 0x0008, 0x0040, 0x4695, 0x7004, + 0xd084, 0x00c0, 0x4686, 0x7108, 0x7008, 0xa106, 0x00c0, 0x467b, + 0xa184, 0x0003, 0x0040, 0x4686, 0x0078, 0x4723, 0xa386, 0x200c, + 0x00c0, 0x463e, 0x7200, 0x8204, 0x0048, 0x4695, 0x730c, 0xa384, + 0x03ff, 0x0040, 0x4695, 0x1078, 0x290c, 0x7108, 0x7008, 0xa106, + 0x00c0, 0x4695, 0xa184, 0x01e0, 0x0040, 0x46a2, 0x1078, 0x4723, + 0x0078, 0x46da, 0x7007, 0x0012, 0x7000, 0xd084, 0x00c0, 0x46b2, + 0x7310, 0x7014, 0xa305, 0x0040, 0x46b2, 0x710c, 0xa184, 0x03ff, + 0x00c0, 0x4629, 0x7108, 0x7008, 0xa106, 0x00c0, 0x46b2, 0xa184, + 0x01e0, 0x0040, 0x46bf, 0x1078, 0x4723, 0x0078, 0x46da, 0x7007, + 0x0012, 0x7007, 0x0008, 0x7004, 0xd09c, 0x00c0, 0x46c3, 0x7108, + 0x7008, 0xa106, 0x00c0, 0x46c7, 0xa184, 0x01e0, 0x0040, 0x46d4, + 0x1078, 0x4723, 0x0078, 0x46da, 0x7007, 0x0012, 0x7108, 0x8103, + 0x0048, 0x46c7, 0x7003, 0x0008, 0x007c, 0x7108, 0x0078, 0x46e0, + 0xa184, 0x01e0, 0x00c0, 0x4723, 0x7108, 0xa184, 0x01e0, 0x00c0, + 0x4723, 0xa184, 0x0007, 0x0079, 0x46ed, 0x46f7, 0x4707, 0x46f5, + 0x4707, 0x46f5, 0x4765, 0x46f5, 0x4763, 0x1078, 0x290c, 0x7004, + 0xa084, 0x0010, 0xc08d, 0x7006, 0x8aff, 0x00c0, 0x4702, 0x2049, + 0x0000, 0x007c, 0x1078, 0x48e7, 0x00c0, 0x4702, 0x007c, 0x7004, + 0xa084, 0x0010, 0xc08d, 0x7006, 0x7004, 0xd084, 0x00c0, 0x471b, + 0x7108, 0x7008, 0xa106, 0x00c0, 0x4710, 0xa184, 0x0003, 0x0040, + 0x471b, 0x0078, 0x4723, 0x8aff, 0x0040, 0x4722, 0x1078, 0x48e7, + 0x00c0, 0x471e, 0x007c, 0x7007, 0x0012, 0x7108, 0x00e0, 0x4726, + 0x2091, 0x6000, 0x00e0, 0x472a, 0x2091, 0x6000, 0x7007, 0x0012, + 0x7007, 0x0008, 0x7004, 0xd09c, 0x00c0, 0x4732, 0x7007, 0x0012, + 0x7108, 0xd1fc, 0x00c0, 0x4736, 0x7003, 0x0000, 0x7000, 0xa005, + 0x00c0, 0x474a, 0x7004, 0xa005, 0x00c0, 0x474a, 0x700c, 0xa005, + 0x0040, 0x474c, 0x0078, 0x472e, 0x2049, 0x0000, 0xb284, 0x0100, + 0x0040, 0x4756, 0x2001, 0x0000, 0x0078, 0x4758, 0x2001, 0x0001, + 0x1078, 0x419b, 0x681b, 0x0002, 0x2051, 0x0000, 0x007c, 0x1078, + 0x290c, 0x1078, 0x290c, 0x1078, 0x47ad, 0x7210, 0x7114, 0x700c, + 0xa09c, 0x03ff, 0x2800, 0xa300, 0xa211, 0xa189, 0x0000, 0x1078, + 0x47ad, 0x2704, 0x2c58, 0xac60, 0x6308, 0x2200, 0xa322, 0x630c, + 0x2100, 0xa31b, 0x2400, 0xa305, 0x0040, 0x4788, 0x00c8, 0x4788, + 0x8412, 0x8210, 0x830a, 0xa189, 0x0000, 0x2b60, 0x0078, 0x476f, + 0x2b60, 0x8a07, 0x007e, 0x6004, 0xa084, 0x0008, 0x0040, 0x4794, + 0xa7ba, 0x45dd, 0x0078, 0x4796, 0xa7ba, 0x45d5, 0x007f, 0xa73d, + 0x2c00, 0x6886, 0x6f8a, 0x6c92, 0x6b8e, 0x7108, 0x7008, 0xa106, + 0x00c0, 0x479d, 0xa184, 0x01e0, 0x0040, 0x47a8, 0x1078, 0x4723, + 0x7007, 0x0012, 0x1078, 0x4629, 0x007c, 0x8a50, 0x8739, 0x2704, + 0xa004, 0x00c0, 0x47c1, 0x6000, 0xa064, 0x00c0, 0x47b8, 0x2d60, + 0x6004, 0xa084, 0x000f, 0xa080, 0x45f3, 0x203c, 0x87fb, 0x1040, + 0x290c, 0x007c, 0x127e, 0x0d7e, 0x70d4, 0xa084, 0x4600, 0x8004, + 0x2090, 0x0d7f, 0x6884, 0x2060, 0x6888, 0x6b8c, 0x6c90, 0x8057, + 0xaad4, 0x00ff, 0xa084, 0x00ff, 0x007e, 0x6804, 0xa084, 0x0008, + 0x007f, 0x0040, 0x47df, 0xa0b8, 0x45dd, 0x0078, 0x47e1, 0xa0b8, + 0x45d5, 0xb284, 0x0100, 0x0040, 0x47e8, 0x7e20, 0x0078, 0x47e9, + 0x7e24, 0xa6b5, 0x000c, 0x681c, 0xd0b4, 0x0040, 0x47f0, 0xc685, + 0x2400, 0xa305, 0x0040, 0x481a, 0x2c58, 0x2704, 0x6104, 0xac60, + 0x6000, 0xa400, 0x701a, 0x6004, 0xa301, 0x701e, 0xa184, 0x0008, + 0x0040, 0x480a, 0x6010, 0xa081, 0x0000, 0x7022, 0x6014, 0xa081, + 0x0000, 0x7026, 0x6208, 0x2400, 0xa202, 0x7012, 0x620c, 0x2300, + 0xa203, 0x7016, 0x7602, 0x7007, 0x0001, 0x2b60, 0x1078, 0x4912, + 0x0078, 0x481c, 0x1078, 0x48e7, 0x00c0, 0x481a, 0x127f, 0x2000, + 0x007c, 0x127e, 0x0d7e, 0x70d4, 0xa084, 0x4600, 0x8004, 0x2090, + 0x0d7f, 0x7007, 0x0004, 0x7004, 0xd094, 0x00c0, 0x482b, 0x7003, + 0x0008, 0x127f, 0x2000, 0x007c, 0x127e, 0x0d7e, 0x70d4, 0xa084, + 0x4600, 0x8004, 0x007e, 0x2090, 0x007f, 0x0d7f, 0x7e20, 0xb284, + 0x0100, 0x00c0, 0x4844, 0x7e24, 0xa6b5, 0x000c, 0x681c, 0xd0ac, + 0x00c0, 0x484f, 0xc685, 0x7003, 0x0000, 0x7007, 0x0004, 0x6828, + 0x2050, 0x2d60, 0x6004, 0xa0bc, 0x000f, 0xa7b8, 0x45e3, 0x273c, + 0x87fb, 0x00c0, 0x4865, 0x0048, 0x485f, 0x1078, 0x290c, 0x689c, + 0xa065, 0x0040, 0x4869, 0x0078, 0x4852, 0x1078, 0x48e7, 0x00c0, + 0x4865, 0x127f, 0x2000, 0x007c, 0x127e, 0x007e, 0x017e, 0x0d7e, + 0x70d4, 0xa084, 0x4600, 0x8004, 0x007e, 0x2090, 0x007f, 0x7e20, + 0xb284, 0x0100, 0x00c0, 0x487d, 0x7e24, 0x0d7f, 0x037f, 0x047f, + 0xa6b5, 0x000c, 0x681c, 0xd0b4, 0x0040, 0x488b, 0xc685, 0x7003, + 0x0000, 0x7007, 0x0004, 0x2049, 0x486c, 0x6828, 0xa055, 0x0d7e, + 0x0040, 0x48e3, 0x2d70, 0x2e60, 0x7004, 0xa0bc, 0x000f, 0xa7b8, + 0x45e3, 0x273c, 0x87fb, 0x00c0, 0x48a8, 0x0048, 0x48a1, 0x1078, + 0x290c, 0x709c, 0xa075, 0x2060, 0x0040, 0x48e3, 0x0078, 0x4894, + 0x2704, 0xae68, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0048, 0x48c1, + 0x8a51, 0x00c0, 0x48b5, 0x1078, 0x290c, 0x8738, 0x2704, 0xa005, + 0x00c0, 0x48a9, 0x709c, 0xa075, 0x2060, 0x0040, 0x48e3, 0x0078, + 0x4894, 0x8422, 0x8420, 0x831a, 0xa399, 0x0000, 0x6908, 0x2400, + 0xa122, 0x690c, 0x2300, 0xa11b, 0x00c8, 0x48d0, 0x1078, 0x290c, + 0xb284, 0x0100, 0x0040, 0x48de, 0x2001, 0x4d04, 0x2004, 0xd0ec, + 0x00c0, 0x48de, 0x2071, 0x0050, 0x0078, 0x48e0, 0x2071, 0x0020, + 0x0d7f, 0x0078, 0x47f0, 0x0d7f, 0x127f, 0x2000, 0x007c, 0x7008, + 0x007e, 0xa084, 0x01e0, 0x007f, 0x0040, 0x48f0, 0xa006, 0x007c, + 0xa084, 0x0003, 0xa086, 0x0003, 0x00c0, 0x48f7, 0x007c, 0x2704, + 0xac78, 0x7800, 0x701a, 0x7804, 0x701e, 0x7808, 0x7012, 0x780c, + 0x7016, 0x6004, 0xa084, 0x0008, 0x0040, 0x490a, 0x7810, 0x7022, + 0x7814, 0x7026, 0x7602, 0x7004, 0xa084, 0x0010, 0xc085, 0x7006, + 0x2079, 0x4d00, 0x8a51, 0x0040, 0x4936, 0x8738, 0x2704, 0xa005, + 0x00c0, 0x4928, 0x609c, 0xa005, 0x0040, 0x4937, 0x2060, 0x6004, + 0xa084, 0x000f, 0xa080, 0x45e3, 0x203c, 0x87fb, 0x1040, 0x290c, + 0x7008, 0x007e, 0xa084, 0x01e0, 0x007f, 0x0040, 0x4932, 0xa006, + 0x0078, 0x4937, 0xa084, 0x0003, 0xa086, 0x0003, 0x007c, 0x2051, + 0x0000, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x70d4, 0xa084, 0x4600, + 0x8004, 0x2090, 0x0d7f, 0x087f, 0x7108, 0xa184, 0x0003, 0x00c0, + 0x494f, 0x6828, 0xa005, 0x0040, 0x495f, 0x0078, 0x4517, 0x7108, + 0xd1fc, 0x0040, 0x4957, 0x1078, 0x46e0, 0x0078, 0x4944, 0x7007, + 0x0010, 0x7108, 0xd1fc, 0x0040, 0x4959, 0x1078, 0x46e0, 0x7008, + 0xa086, 0x0008, 0x00c0, 0x4944, 0x7000, 0xa005, 0x00c0, 0x4944, + 0x7003, 0x0000, 0x2049, 0x0000, 0x127f, 0x2000, 0x007c, 0x127e, + 0x147e, 0x137e, 0x157e, 0x0c7e, 0x0d7e, 0x70d4, 0xa084, 0x4600, + 0x8004, 0x2090, 0x0d7f, 0x2049, 0x496f, 0xad80, 0x0011, 0x20a0, + 0xb284, 0x0100, 0x0040, 0x4992, 0x2001, 0x4d04, 0x2004, 0xd0ec, + 0x0040, 0x498e, 0x2099, 0x0031, 0x0078, 0x4994, 0x2099, 0x0032, + 0x0078, 0x4994, 0x2099, 0x0031, 0x700c, 0xa084, 0x03ff, 0x682a, + 0x7007, 0x0008, 0x7007, 0x0002, 0x7003, 0x0001, 0x0040, 0x49a3, + 0x8000, 0x80ac, 0x53a5, 0x700c, 0xa084, 0x03ff, 0x0040, 0x49af, + 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x49aa, 0x0c7f, + 0x2049, 0x0000, 0x7003, 0x0000, 0x157f, 0x137f, 0x147f, 0x127f, + 0x2000, 0x007c, 0x2091, 0x8000, 0x2091, 0x6000, 0x78ac, 0xa005, + 0x00c0, 0x49d1, 0x7974, 0x70d0, 0xa106, 0x00c0, 0x49d1, 0x781c, + 0xa005, 0x0040, 0x49d1, 0x781f, 0x0000, 0x0068, 0x49d1, 0x2091, + 0x4080, 0x7830, 0x8001, 0x7832, 0x00c0, 0x4a59, 0x7834, 0x7832, + 0x7810, 0xd0ec, 0x00c0, 0x4a52, 0x2061, 0x72c0, 0x2069, 0x4d80, + 0xc7fd, 0x68d0, 0xa005, 0x0040, 0x49eb, 0x8001, 0x68d2, 0x00c0, + 0x49eb, 0x1078, 0x4c22, 0x6800, 0xa084, 0x000f, 0x0040, 0x4a00, + 0xa086, 0x0001, 0x0040, 0x4a00, 0x6844, 0xa00d, 0x0040, 0x4a00, + 0x2104, 0xa005, 0x0040, 0x4a00, 0x8001, 0x200a, 0x0040, 0x4b95, + 0x6814, 0xa005, 0x0040, 0x4a25, 0x8001, 0x6816, 0x00c0, 0x4a25, + 0x68a7, 0x0001, 0x0f7e, 0xd7fc, 0x00c0, 0x4a1a, 0x7810, 0xd0ec, + 0x0040, 0x4a16, 0x2079, 0x0100, 0x0078, 0x4a1c, 0x2079, 0x0200, + 0x0078, 0x4a1c, 0x2079, 0x0100, 0x1078, 0x42fe, 0x0f7f, 0x6864, + 0xa005, 0x0040, 0x4a25, 0x1078, 0x25ea, 0x6880, 0xa005, 0x0040, + 0x4a32, 0x8001, 0x6882, 0x00c0, 0x4a32, 0x6867, 0x0000, 0x68d4, + 0xc0dd, 0x68d6, 0x68d4, 0xd0fc, 0x0040, 0x4a4f, 0xc0fc, 0x68d6, + 0x20a9, 0x0200, 0x6034, 0xa005, 0x0040, 0x4a4b, 0x8001, 0x6036, + 0x68d4, 0xc0fd, 0x68d6, 0x00c0, 0x4a4b, 0x6010, 0xa005, 0x0040, + 0x4a4b, 0x1078, 0x25ea, 0xace0, 0x0010, 0x00f0, 0x4a3a, 0xd7fc, + 0x0040, 0x4a59, 0x2061, 0x52c0, 0x2069, 0x4d40, 0xc7fc, 0x0078, + 0x49e1, 0x1078, 0x4a95, 0x7838, 0x8001, 0x783a, 0x00c0, 0x4a7b, + 0x783c, 0x783a, 0x2061, 0x52c0, 0x2069, 0x4d40, 0xc7fc, 0x680c, + 0xa005, 0x0040, 0x4a6d, 0x1078, 0x4aec, 0xd7fc, 0x00c0, 0x4a7b, + 0x7810, 0xd0ec, 0x00c0, 0x4a7b, 0x2061, 0x72c0, 0x2069, 0x4d80, + 0xc7fd, 0x0078, 0x4a67, 0x7814, 0xd0e4, 0x00c0, 0x4a7f, 0x7810, + 0xd0cc, 0x0040, 0x4a92, 0xd0ac, 0x00c0, 0x4a8b, 0xd0a4, 0x0040, + 0x4a92, 0xc0ad, 0x7812, 0x2091, 0x8001, 0x0068, 0x4a91, 0x1078, + 0x2356, 0x007c, 0x2091, 0x8001, 0x007c, 0x7840, 0x8001, 0x7842, + 0x00c0, 0x4aeb, 0x7844, 0x7842, 0x2091, 0x8000, 0x2061, 0x52c0, + 0x2069, 0x4d40, 0xc7fc, 0x7810, 0x2079, 0x0200, 0xd0ec, 0x0040, + 0x4aab, 0x2079, 0x0100, 0x68d8, 0xa005, 0x0040, 0x4ab7, 0x7de0, + 0xa504, 0x00c0, 0x4ab7, 0x68da, 0x68d4, 0xc0bc, 0x68d6, 0x2079, + 0x4d00, 0x6810, 0xa005, 0x00c0, 0x4abf, 0x2001, 0x0101, 0x8001, + 0x6812, 0xd7fc, 0x0040, 0x4ac8, 0xa080, 0x93d0, 0x0078, 0x4aca, + 0xa080, 0x92c0, 0x2040, 0x2004, 0xa065, 0x0040, 0x4adb, 0x6024, + 0xa005, 0x0040, 0x4ad7, 0x8001, 0x6026, 0x0040, 0x4b37, 0x6000, + 0x2c40, 0x0078, 0x4acc, 0xd7fc, 0x00c0, 0x4aeb, 0x7810, 0xd0ec, + 0x00c0, 0x4aeb, 0x2061, 0x72c0, 0x2069, 0x4d80, 0xc7fd, 0x2079, + 0x0200, 0x0078, 0x4aab, 0x007c, 0x2009, 0x0000, 0x20a9, 0x0200, + 0x6008, 0xd09c, 0x0040, 0x4b23, 0x6024, 0xa005, 0x0040, 0x4afc, + 0x8001, 0x6026, 0x0078, 0x4b21, 0x6008, 0xc09c, 0xd084, 0x00c0, + 0x4b04, 0xd0ac, 0x0040, 0x4b1b, 0x600a, 0x6004, 0xa06d, 0x0040, + 0x4b23, 0x0c7e, 0x017e, 0x6010, 0x8001, 0x6012, 0x1078, 0x3d56, + 0x2d00, 0x2c68, 0x2060, 0x1078, 0x1e42, 0x1078, 0x2004, 0x017f, + 0x0c7f, 0x0078, 0x4b23, 0xc0bd, 0x600a, 0xa18d, 0x0001, 0x0078, + 0x4b23, 0xa18d, 0x0100, 0xace0, 0x0010, 0x00f0, 0x4af0, 0xa184, + 0x0001, 0x0040, 0x4b32, 0xa18c, 0xfffe, 0x690e, 0x1078, 0x25ea, + 0x0078, 0x4b33, 0x690e, 0x007c, 0x00c0, 0x4b33, 0x786c, 0x6800, + 0xa005, 0x0040, 0x4b3f, 0x684c, 0xac06, 0x0040, 0x4b95, 0x6864, + 0xa005, 0x0040, 0x4b47, 0x6027, 0x0001, 0x0078, 0x4b94, 0x2c00, + 0x687e, 0x6714, 0x6f76, 0x6017, 0x0000, 0x602b, 0x0000, 0x601b, 0x0006, 0x60b4, 0xa084, 0x3f00, 0x601e, 0x6020, 0xa084, 0x00ff, - 0xa085, 0x0060, 0x6022, 0x6000, 0x2042, 0x6714, 0x6f76, 0x1078, - 0x1e02, 0x6818, 0xa005, 0x0040, 0x48d7, 0x8001, 0x681a, 0x6808, - 0xc0a4, 0x680a, 0x6810, 0x7908, 0x8109, 0x790a, 0x8001, 0x00d0, - 0x48e3, 0x1078, 0x28ec, 0x6812, 0x00c0, 0x48e9, 0x7910, 0xc1a5, - 0x7912, 0x602f, 0x0000, 0x6033, 0x0000, 0x2c68, 0x1078, 0x202a, - 0xd7fc, 0x00c0, 0x48f7, 0x2069, 0x4a40, 0x0078, 0x48f9, 0x2069, - 0x4a80, 0x6910, 0xa184, 0x0100, 0x2001, 0x0006, 0x00c0, 0x4903, - 0x697a, 0x2001, 0x0004, 0x2708, 0x1078, 0x25d1, 0x2091, 0x8001, - 0x007c, 0x0d7e, 0x694c, 0x2160, 0xd7fc, 0x00c0, 0x491b, 0x7810, - 0xd0ec, 0x0040, 0x4917, 0x2069, 0x0100, 0x0078, 0x491d, 0x2069, - 0x0200, 0x0078, 0x491d, 0x2069, 0x0100, 0x1078, 0x2881, 0x601b, - 0x0006, 0x6858, 0xa084, 0x3f00, 0x601e, 0x6020, 0xa084, 0x00ff, - 0xa085, 0x0048, 0x6022, 0x602f, 0x0000, 0x6033, 0x0000, 0x6830, - 0xd0b4, 0x0040, 0x494b, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848, - 0xd094, 0x0040, 0x493d, 0x00f0, 0x4937, 0x684b, 0x0009, 0x20a9, - 0x0014, 0x6848, 0xd084, 0x0040, 0x4947, 0x00f0, 0x4941, 0x20a9, - 0x00fa, 0x00f0, 0x4949, 0x6808, 0xa084, 0xfffd, 0x680a, 0x681b, - 0x0047, 0x0d7f, 0x6867, 0x0007, 0x2091, 0x8001, 0x007c, 0x2079, - 0x4a00, 0x1078, 0x498b, 0x1078, 0x4971, 0x1078, 0x497e, 0x2009, - 0x0002, 0x2069, 0x4a80, 0x680f, 0x0000, 0x6813, 0x0000, 0x6817, - 0x0000, 0x8109, 0x0040, 0x4970, 0x2069, 0x4a40, 0x0078, 0x4963, - 0x007c, 0x7810, 0xd0ec, 0x0040, 0x4979, 0x2019, 0x00cc, 0x0078, - 0x497b, 0x2019, 0x007b, 0x7b3a, 0x7b3e, 0x007c, 0x7814, 0xd0e4, - 0x00c0, 0x4986, 0x2019, 0x0040, 0x0078, 0x4988, 0x2019, 0x0026, - 0x7b42, 0x7b46, 0x007c, 0x7814, 0xd0e4, 0x00c0, 0x4993, 0x2019, - 0x3f94, 0x0078, 0x4995, 0x2019, 0x2624, 0x7b32, 0x7b36, 0x007c, - 0x6950, 0xa185, 0x0000, 0x0040, 0x49ad, 0x0c7e, 0x6ac0, 0x2264, - 0x602b, 0x0000, 0x602f, 0x0000, 0x6008, 0xc0b5, 0x600a, 0x8210, - 0x8109, 0x00c0, 0x499f, 0x6952, 0x0c7f, 0x007c, 0x70ec, 0xd0dc, - 0x00c0, 0x49b7, 0xd0d4, 0x0040, 0x49d6, 0x0078, 0x49d9, 0x7810, - 0xd0ec, 0x0040, 0x49c2, 0xc0f5, 0x7812, 0xd0ec, 0x0040, 0x49dd, - 0x0078, 0x49d9, 0xae8e, 0x0100, 0x0040, 0x49ce, 0x7814, 0xc0f5, - 0x7816, 0xd0d4, 0x00c0, 0x49dd, 0x0078, 0x49d9, 0x7814, 0xc0fd, - 0x7816, 0xd0d4, 0x00c0, 0x49dd, 0x0078, 0x49d9, 0xd0e4, 0x0040, - 0x49df, 0x7804, 0xd08c, 0x0040, 0x49df, 0x681f, 0x000c, 0x70a0, - 0x70a2, 0x007c, 0x699a + 0xa085, 0x0060, 0x6022, 0x6000, 0x2042, 0x1078, 0x1dcb, 0x6818, + 0xa005, 0x0040, 0x4b65, 0x8001, 0x681a, 0x6808, 0xc0a4, 0x680a, + 0x6810, 0x7908, 0x8109, 0x790a, 0x8001, 0x00d0, 0x4b71, 0x1078, + 0x290c, 0x6812, 0x00c0, 0x4b77, 0x7910, 0xc1a5, 0x7912, 0x602f, + 0x0000, 0x6033, 0x0000, 0x2c68, 0x1078, 0x2013, 0xd7fc, 0x00c0, + 0x4b85, 0x2069, 0x4d40, 0x0078, 0x4b87, 0x2069, 0x4d80, 0x6910, + 0xa184, 0x0100, 0x2001, 0x0006, 0x00c0, 0x4b91, 0x697a, 0x2001, + 0x0004, 0x2708, 0x1078, 0x25dd, 0x007c, 0x0d7e, 0x694c, 0x2160, + 0xd7fc, 0x00c0, 0x4ba7, 0x7810, 0xd0ec, 0x0040, 0x4ba3, 0x2069, + 0x0100, 0x0078, 0x4ba9, 0x2069, 0x0200, 0x0078, 0x4ba9, 0x2069, + 0x0100, 0x1078, 0x288d, 0x601b, 0x0006, 0x6858, 0xa084, 0x3f00, + 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085, 0x0048, 0x6022, 0x602f, + 0x0000, 0x6033, 0x0000, 0x6808, 0xa084, 0xfffd, 0x680a, 0x6830, + 0xd0b4, 0x0040, 0x4bdb, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848, + 0xd094, 0x0040, 0x4bcd, 0x00f0, 0x4bc7, 0x684b, 0x0009, 0x20a9, + 0x0014, 0x6848, 0xd084, 0x0040, 0x4bd7, 0x00f0, 0x4bd1, 0x20a9, + 0x00fa, 0x00f0, 0x4bd9, 0x681b, 0x0047, 0x0d7f, 0x6867, 0x0007, + 0x007c, 0x2079, 0x4d00, 0x1078, 0x4c15, 0x1078, 0x4bfb, 0x1078, + 0x4c08, 0x2009, 0x0002, 0x2069, 0x4d80, 0x680f, 0x0000, 0x6813, + 0x0000, 0x6817, 0x0000, 0x8109, 0x0040, 0x4bfa, 0x2069, 0x4d40, + 0x0078, 0x4bed, 0x007c, 0x7810, 0xd0ec, 0x0040, 0x4c03, 0x2019, + 0x00cc, 0x0078, 0x4c05, 0x2019, 0x007b, 0x7b3a, 0x7b3e, 0x007c, + 0x7814, 0xd0e4, 0x00c0, 0x4c10, 0x2019, 0x0040, 0x0078, 0x4c12, + 0x2019, 0x0026, 0x7b42, 0x7b46, 0x007c, 0x7814, 0xd0e4, 0x00c0, + 0x4c1d, 0x2019, 0x3f94, 0x0078, 0x4c1f, 0x2019, 0x2624, 0x7b32, + 0x7b36, 0x007c, 0x6950, 0xa185, 0x0000, 0x0040, 0x4c37, 0x0c7e, + 0x6ac0, 0x2264, 0x602b, 0x0000, 0x602f, 0x0000, 0x6008, 0xc0b5, + 0x600a, 0x8210, 0x8109, 0x00c0, 0x4c29, 0x6952, 0x0c7f, 0x007c, + 0x70ec, 0xd0dc, 0x00c0, 0x4c41, 0xd0d4, 0x0040, 0x4c64, 0x0078, + 0x4c67, 0x2008, 0x7810, 0xd0ec, 0x0040, 0x4c50, 0xd1c4, 0x00c0, + 0x4c6f, 0xc0f5, 0x7812, 0xd0ec, 0x0040, 0x4c6b, 0x0078, 0x4c67, + 0xae8e, 0x0100, 0x0040, 0x4c5c, 0x7814, 0xc0f5, 0x7816, 0xd0d4, + 0x00c0, 0x4c6b, 0x0078, 0x4c67, 0x7814, 0xc0fd, 0x7816, 0xd0d4, + 0x00c0, 0x4c6b, 0x0078, 0x4c67, 0xd0e4, 0x0040, 0x4c6d, 0x7804, + 0xd08c, 0x0040, 0x4c6d, 0x681f, 0x000c, 0x70a0, 0x70a2, 0x007c, + 0x3782 }; -unsigned short fw1280ei_length01 = 0x39e3; +#ifdef UNIQUE_FW_NAME +unsigned short fw1280ei_length01 = 0x3c71; +#else +unsigned short risc_code_length01 = 0x3c71; +#endif diff -urN linux-2.4.18/drivers/scsi/ql2100_fw.h lia64-2.4/drivers/scsi/ql2100_fw.h --- linux-2.4.18/drivers/scsi/ql2100_fw.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/scsi/ql2100_fw.h Mon Jul 23 14:11:58 2001 @@ -0,0 +1,4740 @@ +/************************************************************************ + * * + * --- ISP2100 Fabric Initiator/Target Firmware --- * + * with expanded LUN addressing * + * and FcTape (FCP-2) support * + * * + * * + ************************************************************************ + Copyright (C) 2000 and 2001 Qlogic Corporation + (www.qlogic.com) + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. +************************************************************************/ +/* + * Firmware Version 1.19.16 (10:36 Nov 02, 2000) + */ + +#ifdef UNIQUE_FW_NAME +unsigned short fw2100tp_version = 1*1024+19; +#else +unsigned short risc_code_version = 1*1024+19; +#endif + +#ifdef UNIQUE_FW_NAME +unsigned char fw2100tp_version_str[] = {1,19,16}; +#else +unsigned char firmware_version[] = {1,19,16}; +#endif + +#ifdef UNIQUE_FW_NAME +#define fw2100tp_VERSION_STRING "1.19.16" +#else +#define FW_VERSION_STRING "1.19.16" +#endif + +#ifdef UNIQUE_FW_NAME +unsigned short fw2100tp_addr01 = 0x1000 ; +#else +unsigned short risc_code_addr01 = 0x1000 ; +#endif + +#ifdef UNIQUE_FW_NAME +unsigned short fw2100tp_code01[] = { +#else +unsigned short risc_code01[] = { +#endif + 0x0078, 0x102d, 0x0000, 0x9260, 0x0000, 0x0001, 0x0013, 0x0010, + 0x0017, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2031, 0x3939, + 0x3920, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241, + 0x5449, 0x4f4e, 0x2049, 0x5350, 0x3231, 0x3030, 0x2046, 0x6972, + 0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030, + 0x312e, 0x3139, 0x2020, 0x2020, 0x2400, 0x2091, 0x2000, 0x20c1, + 0x0021, 0x2039, 0xffff, 0x2019, 0xaaaa, 0x2760, 0x2069, 0x7fff, + 0x20c1, 0x0020, 0x2c2c, 0x2d34, 0x2762, 0x236a, 0x2c24, 0x2d04, + 0x266a, 0x2562, 0xa406, 0x00c0, 0x1052, 0x20c1, 0x0021, 0x2c2c, + 0x2362, 0x2c04, 0x2562, 0xa306, 0x0040, 0x1052, 0x20c1, 0x0020, + 0x2039, 0x8fff, 0x20a1, 0xaa00, 0x2708, 0x810d, 0x810d, 0x810d, + 0x810d, 0xa18c, 0x000f, 0x2001, 0x000a, 0xa112, 0xa00e, 0x21a8, + 0x41a4, 0x3400, 0x8211, 0x00c0, 0x105f, 0x2708, 0x3400, 0xa102, + 0x0040, 0x106f, 0x0048, 0x106f, 0x20a8, 0xa00e, 0x41a4, 0x20a1, + 0xa260, 0x2009, 0x0000, 0x20a9, 0x07a0, 0x41a4, 0x3400, 0x20c9, + 0xa7ff, 0x2059, 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x255d, + 0x2051, 0xa300, 0x2a70, 0x775e, 0xa786, 0x8fff, 0x0040, 0x1092, + 0x705b, 0xca00, 0x7057, 0xc9f1, 0x7063, 0x0200, 0x7067, 0x0200, + 0x0078, 0x109a, 0x7057, 0xba01, 0x7063, 0x0100, 0x7067, 0x0100, + 0x705b, 0xba00, 0x1078, 0x12df, 0x1078, 0x13c0, 0x1078, 0x1569, + 0x1078, 0x1ca4, 0x1078, 0x4229, 0x1078, 0x74cf, 0x1078, 0x134b, + 0x1078, 0x2a3f, 0x1078, 0x4da2, 0x1078, 0x48b2, 0x1078, 0x57df, + 0x1078, 0x21f7, 0x1078, 0x5abf, 0x1078, 0x5369, 0x1078, 0x210d, + 0x1078, 0x21d4, 0x2091, 0x3009, 0x7823, 0x0000, 0x0090, 0x10cf, + 0x7820, 0xa086, 0x0002, 0x00c0, 0x10cf, 0x7823, 0x4000, 0x0068, + 0x10c7, 0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, + 0x7003, 0x0000, 0x2001, 0x017f, 0x2003, 0x0000, 0x2a70, 0x7000, + 0xa08e, 0x0003, 0x00c0, 0x10ef, 0x1078, 0x35bc, 0x1078, 0x2a67, + 0x1078, 0x4df2, 0x1078, 0x4a75, 0x2009, 0x0100, 0x2104, 0xa082, + 0x0002, 0x0048, 0x10f3, 0x1078, 0x57fb, 0x0078, 0x10d6, 0x1079, + 0x10f7, 0x0078, 0x10dc, 0x1078, 0x6fa9, 0x0078, 0x10eb, 0x1101, + 0x1102, 0x11be, 0x10ff, 0x1246, 0x12dc, 0x12dd, 0x12de, 0x1078, + 0x1328, 0x007c, 0x127e, 0x0f7e, 0x2091, 0x8000, 0x7000, 0xa086, + 0x0001, 0x00c0, 0x1198, 0x1078, 0x3a43, 0x2079, 0x0100, 0x7844, + 0xa005, 0x00c0, 0x1198, 0x2011, 0x4129, 0x1078, 0x58d4, 0x1078, + 0x1ab1, 0x780f, 0x00ff, 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011, + 0x8010, 0x73c0, 0x1078, 0x3579, 0x2001, 0xffff, 0x1078, 0x5975, + 0x7238, 0xc284, 0x723a, 0x2001, 0xa30c, 0x2014, 0xc2ac, 0x2202, + 0x1078, 0x6db5, 0x2011, 0x0004, 0x1078, 0x8a59, 0x1078, 0x47ce, + 0x1078, 0x4211, 0x0040, 0x1144, 0x7083, 0x0001, 0x70bb, 0x0000, + 0x1078, 0x3bf5, 0x0078, 0x1198, 0x1078, 0x4897, 0x0040, 0x114d, + 0x7a0c, 0xc2b4, 0x7a0e, 0x0078, 0x1159, 0x1078, 0x8ddf, 0x70c8, + 0xd09c, 0x00c0, 0x1159, 0x7094, 0xa005, 0x0040, 0x1159, 0x1078, + 0x41f5, 0x70d3, 0x0000, 0x70cf, 0x0000, 0x72c8, 0x2079, 0xa351, + 0x7804, 0xd0ac, 0x0040, 0x1165, 0xc295, 0x72ca, 0xa296, 0x0004, + 0x0040, 0x1186, 0x2011, 0x0001, 0x1078, 0x8a59, 0x708f, 0x0000, + 0x7093, 0xffff, 0x7003, 0x0002, 0x0f7f, 0x1078, 0x260d, 0x2011, + 0x0005, 0x1078, 0x6ef2, 0x1078, 0x6109, 0x0c7e, 0x2061, 0x0100, + 0x60e3, 0x0008, 0x0c7f, 0x127f, 0x0078, 0x119a, 0x708f, 0x0000, + 0x7093, 0xffff, 0x7003, 0x0002, 0x2011, 0x0005, 0x1078, 0x6ef2, + 0x1078, 0x6109, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, + 0x0f7f, 0x127f, 0x007c, 0x0c7e, 0x20a9, 0x0082, 0x2009, 0x007e, + 0x017e, 0x027e, 0x037e, 0x2110, 0x027e, 0x2019, 0x0029, 0x1078, + 0x71e0, 0x027f, 0x1078, 0xa190, 0x037f, 0x027f, 0x017f, 0x1078, + 0x2921, 0x8108, 0x00f0, 0x11a0, 0x0c7f, 0x706b, 0x0000, 0x706c, + 0xa084, 0x00ff, 0x706e, 0x7097, 0x0000, 0x007c, 0x127e, 0x2091, + 0x8000, 0x7000, 0xa086, 0x0002, 0x00c0, 0x1244, 0x7090, 0xa086, + 0xffff, 0x0040, 0x11d1, 0x1078, 0x260d, 0x1078, 0x6109, 0x0078, + 0x1244, 0x70c8, 0xd09c, 0x0040, 0x11fd, 0xd084, 0x0040, 0x11fd, + 0x0f7e, 0x2079, 0x0100, 0x790c, 0xc1b5, 0x790e, 0x0f7f, 0xd08c, + 0x0040, 0x11fd, 0x70cc, 0xa086, 0xffff, 0x0040, 0x11f9, 0x1078, + 0x278a, 0x1078, 0x6109, 0x70c8, 0xd094, 0x00c0, 0x1244, 0x2011, + 0x0001, 0x2019, 0x0000, 0x1078, 0x27c2, 0x1078, 0x6109, 0x0078, + 0x1244, 0x70d0, 0xa005, 0x00c0, 0x1244, 0x708c, 0xa005, 0x00c0, + 0x1244, 0x1078, 0x4897, 0x00c0, 0x1244, 0x2001, 0xa352, 0x2004, + 0xd0ac, 0x0040, 0x1227, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009, + 0x0000, 0x017e, 0x1078, 0x4501, 0x00c0, 0x121a, 0x6000, 0xd0ec, + 0x00c0, 0x1222, 0x017f, 0x8108, 0x00f0, 0x1211, 0x0c7f, 0x157f, + 0x0078, 0x1227, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x1244, 0x7003, + 0x0003, 0x7093, 0xffff, 0x2001, 0x0000, 0x1078, 0x2480, 0x1078, + 0x35f7, 0x2001, 0xa5ac, 0x2004, 0xa086, 0x0005, 0x00c0, 0x123c, + 0x2011, 0x0000, 0x1078, 0x6ef2, 0x2011, 0x0000, 0x1078, 0x6efc, + 0x1078, 0x6109, 0x1078, 0x61d3, 0x127f, 0x007c, 0x017e, 0x0f7e, + 0x127e, 0x2091, 0x8000, 0x2079, 0x0100, 0x2009, 0x00f7, 0x1078, + 0x41de, 0x7940, 0xa18c, 0x0010, 0x7942, 0x7924, 0xd1b4, 0x0040, + 0x125b, 0x7827, 0x0040, 0xd19c, 0x0040, 0x1260, 0x7827, 0x0008, + 0x007e, 0x037e, 0x157e, 0xa006, 0x1078, 0x5975, 0x7900, 0xa18a, + 0x0003, 0x0050, 0x1289, 0x7954, 0xd1ac, 0x00c0, 0x1289, 0x2009, + 0x00f8, 0x1078, 0x41de, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9, + 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x1281, 0x7824, 0xd0ac, 0x00c0, + 0x12ca, 0x00f0, 0x1279, 0x2001, 0x0001, 0x1078, 0x2480, 0x0078, + 0x12d5, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9, 0x0050, 0x00e0, + 0x128f, 0x2091, 0x6000, 0x00f0, 0x128f, 0x7853, 0x0400, 0x782f, + 0x0000, 0x2009, 0x00f8, 0x1078, 0x41de, 0x20a9, 0x000e, 0x0005, + 0x00f0, 0x129f, 0x7853, 0x1400, 0x7843, 0x0090, 0x7843, 0x0010, + 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040, 0x12b4, + 0x7824, 0xd0ac, 0x00c0, 0x12ca, 0x8319, 0x00c0, 0x12aa, 0x2009, + 0xa331, 0x2104, 0x8000, 0x200a, 0xa084, 0xfff0, 0x0040, 0x12c4, + 0x200b, 0x0000, 0x1078, 0x251e, 0x2001, 0x0001, 0x1078, 0x2480, + 0x0078, 0x12d3, 0x2001, 0xa331, 0x2003, 0x0000, 0x7828, 0xc09d, + 0x782a, 0x7827, 0x0048, 0x7853, 0x0400, 0x157f, 0x037f, 0x007f, + 0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c, 0x007c, 0x2a70, + 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048, 0x12eb, 0x704f, + 0xffff, 0x0078, 0x12ed, 0x704f, 0x0000, 0x7053, 0xffff, 0x706b, + 0x0000, 0x706f, 0x0000, 0x1078, 0x8ddf, 0x2061, 0xa58c, 0x6003, + 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, 0x0200, 0x6013, + 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f, 0x07d0, 0x2061, + 0xa594, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, 0x0000, 0x600f, + 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, 0x0001, 0x601f, + 0x0000, 0x2061, 0xa5a3, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, + 0x4943, 0x600f, 0x2020, 0x2001, 0xa325, 0x2003, 0x0000, 0x007c, + 0x2091, 0x8000, 0x0068, 0x132a, 0x007e, 0x017e, 0x2079, 0x0000, + 0x7818, 0xd084, 0x00c0, 0x1330, 0x017f, 0x792e, 0x007f, 0x782a, + 0x007f, 0x7826, 0x3900, 0x783a, 0x7823, 0x8002, 0x781b, 0x0001, + 0x2091, 0x5000, 0x2091, 0x4080, 0x2079, 0xa300, 0x7803, 0x0005, + 0x0078, 0x1348, 0x007c, 0x2071, 0xa300, 0x7158, 0x712e, 0x2021, + 0x0001, 0xa190, 0x002d, 0xa298, 0x002d, 0x0048, 0x1361, 0x705c, + 0xa302, 0x00c8, 0x1361, 0x220a, 0x2208, 0x2310, 0x8420, 0x0078, + 0x1353, 0x200b, 0x0000, 0x74a6, 0x74aa, 0x007c, 0x0e7e, 0x127e, + 0x2091, 0x8000, 0x2071, 0xa300, 0x70a8, 0xa0ea, 0x0010, 0x00c8, + 0x1374, 0xa06e, 0x0078, 0x137e, 0x8001, 0x70aa, 0x702c, 0x2068, + 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, + 0x007c, 0x0e7e, 0x2071, 0xa300, 0x127e, 0x2091, 0x8000, 0x70a8, + 0x8001, 0x00c8, 0x138e, 0xa06e, 0x0078, 0x1397, 0x70aa, 0x702c, + 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, + 0x0e7f, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0xa300, + 0x702c, 0x206a, 0x2d00, 0x702e, 0x70a8, 0x8000, 0x70aa, 0x127f, + 0x0e7f, 0x007c, 0x8dff, 0x0040, 0x13b6, 0x6804, 0x6807, 0x0000, + 0x007e, 0x1078, 0x139a, 0x0d7f, 0x0078, 0x13aa, 0x007c, 0x0e7e, + 0x2071, 0xa300, 0x70a8, 0xa08a, 0x0010, 0xa00d, 0x0e7f, 0x007c, + 0x0e7e, 0x2071, 0xa5d0, 0x7007, 0x0000, 0x701b, 0x0000, 0x701f, + 0x0000, 0x2071, 0x0000, 0x7010, 0xa085, 0x8004, 0x7012, 0x0e7f, + 0x007c, 0x0e7e, 0x2270, 0x700b, 0x0000, 0x2071, 0xa5d0, 0x7018, + 0xa088, 0xa5d9, 0x220a, 0x8000, 0xa084, 0x0007, 0x701a, 0x7004, + 0xa005, 0x00c0, 0x13e9, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13fa, + 0x0f7f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0xa5d0, 0x7004, 0xa005, + 0x00c0, 0x13f8, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13fa, 0x0f7f, + 0x0e7f, 0x007c, 0x7000, 0x0079, 0x13fd, 0x1401, 0x146b, 0x1488, + 0x1488, 0x7018, 0x711c, 0xa106, 0x00c0, 0x1409, 0x7007, 0x0000, + 0x007c, 0x0d7e, 0xa180, 0xa5d9, 0x2004, 0x700a, 0x2068, 0x8108, + 0xa18c, 0x0007, 0x711e, 0x7803, 0x0026, 0x6824, 0x7832, 0x6828, + 0x7836, 0x682c, 0x783a, 0x6830, 0x783e, 0x6810, 0x700e, 0x680c, + 0x7016, 0x6804, 0x0d7f, 0xd084, 0x0040, 0x142b, 0x7007, 0x0001, + 0x1078, 0x1430, 0x007c, 0x7007, 0x0002, 0x1078, 0x1446, 0x007c, + 0x017e, 0x027e, 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, + 0x143b, 0x2110, 0xa006, 0x700e, 0x7212, 0x8203, 0x7822, 0x7803, + 0x0020, 0x7803, 0x0041, 0x027f, 0x017f, 0x007c, 0x017e, 0x027e, + 0x137e, 0x147e, 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014, 0x7803, + 0x0026, 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x145a, + 0x2110, 0xa006, 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822, 0x7803, + 0x0020, 0x3300, 0x7016, 0x7803, 0x0001, 0x157f, 0x147f, 0x137f, + 0x027f, 0x017f, 0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0xa3f9, + 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, + 0x2091, 0x8000, 0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, + 0x7002, 0x700b, 0xa3f4, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, + 0x137e, 0x147e, 0x157e, 0x2001, 0xa428, 0x209c, 0x20a1, 0x0014, + 0x7803, 0x0026, 0x2001, 0xa429, 0x20ac, 0x53a6, 0x2099, 0xa42a, + 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, + 0x2091, 0x8000, 0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c, + 0x7002, 0x700b, 0xa425, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, + 0x017e, 0x0e7e, 0x2071, 0xa5d0, 0x0f7e, 0x2079, 0x0010, 0x7904, + 0x7803, 0x0002, 0xd1fc, 0x0040, 0x14c2, 0xa18c, 0x0700, 0x7004, + 0x1079, 0x14c6, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x13fa, 0x14ce, + 0x14fb, 0x1523, 0x1556, 0x14cc, 0x0078, 0x14cc, 0xa18c, 0x0700, + 0x00c0, 0x14f4, 0x137e, 0x147e, 0x157e, 0x7014, 0x20a0, 0x2099, + 0x0014, 0x7803, 0x0040, 0x7010, 0x20a8, 0x53a5, 0x3400, 0x7016, + 0x157f, 0x147f, 0x137f, 0x700c, 0xa005, 0x0040, 0x1510, 0x1078, + 0x1430, 0x007c, 0x7008, 0xa080, 0x0002, 0x2003, 0x0100, 0x7007, + 0x0000, 0x1078, 0x13fa, 0x007c, 0x7008, 0xa080, 0x0002, 0x2003, + 0x0200, 0x0078, 0x14ef, 0xa18c, 0x0700, 0x00c0, 0x1506, 0x700c, + 0xa005, 0x0040, 0x1510, 0x1078, 0x1446, 0x007c, 0x7008, 0xa080, + 0x0002, 0x2003, 0x0200, 0x7007, 0x0000, 0x1078, 0x13fa, 0x007c, + 0x0d7e, 0x7008, 0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838, + 0x682e, 0x783c, 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000, + 0x1078, 0x13fa, 0x007c, 0xa18c, 0x0700, 0x00c0, 0x1550, 0x137e, + 0x147e, 0x157e, 0x2001, 0xa3f7, 0x2004, 0xa080, 0x000d, 0x20a0, + 0x2099, 0x0014, 0x7803, 0x0040, 0x20a9, 0x0020, 0x53a5, 0x2001, + 0xa3f9, 0x2004, 0xd0bc, 0x0040, 0x1546, 0x2001, 0xa402, 0x2004, + 0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020, 0x53a5, 0x157f, 0x147f, + 0x137f, 0x7007, 0x0000, 0x1078, 0x4e9b, 0x1078, 0x13fa, 0x007c, + 0x2011, 0x8003, 0x1078, 0x3579, 0x0078, 0x1554, 0xa18c, 0x0700, + 0x00c0, 0x1563, 0x2001, 0xa427, 0x2003, 0x0100, 0x7007, 0x0000, + 0x1078, 0x13fa, 0x007c, 0x2011, 0x8004, 0x1078, 0x3579, 0x0078, + 0x1567, 0x127e, 0x2091, 0x2100, 0x2079, 0x0030, 0x2071, 0xa5e1, + 0x7803, 0x0004, 0x7003, 0x0000, 0x700f, 0xa5e7, 0x7013, 0xa5e7, + 0x780f, 0x0076, 0x7803, 0x0004, 0x127f, 0x007c, 0x6934, 0xa184, + 0x0007, 0x0079, 0x1583, 0x158b, 0x15d1, 0x158b, 0x158b, 0x158b, + 0x15b6, 0x159a, 0x158f, 0xa085, 0x0001, 0x0078, 0x15eb, 0x684c, + 0xd0bc, 0x0040, 0x158b, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858, + 0x0078, 0x15d9, 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0, 0x158b, + 0x684c, 0xd0bc, 0x0040, 0x158b, 0x6860, 0x682e, 0x685c, 0x682a, + 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, + 0x2015, 0x2004, 0x6832, 0x6858, 0x0078, 0x15e1, 0xa18c, 0x00ff, + 0xa186, 0x0015, 0x00c0, 0x158b, 0x684c, 0xd0ac, 0x0040, 0x158b, + 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, + 0x2015, 0x2004, 0x6832, 0xa006, 0x682e, 0x682a, 0x6858, 0x0078, + 0x15e1, 0x684c, 0xd0ac, 0x0040, 0x158b, 0xa006, 0x682e, 0x682a, + 0x6858, 0xa18c, 0x000f, 0xa188, 0x2015, 0x210c, 0x6932, 0x2d08, + 0x691a, 0x6826, 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a, 0x697c, + 0x6912, 0x6980, 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1, 0x2000, + 0x2001, 0x020a, 0x2004, 0x82ff, 0x0040, 0x160e, 0xa280, 0x0004, + 0x0d7e, 0x206c, 0x684c, 0xd0dc, 0x00c0, 0x160a, 0x1078, 0x157e, + 0x0040, 0x160a, 0x0d7f, 0xa280, 0x0000, 0x2003, 0x0002, 0xa016, + 0x0078, 0x160e, 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e, + 0x037e, 0x027e, 0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000, + 0xa005, 0x00c0, 0x1622, 0x7206, 0x2001, 0x1643, 0x007e, 0x2260, + 0x0078, 0x17be, 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, + 0x8108, 0xa182, 0xa602, 0x0048, 0x162f, 0x2009, 0xa5e7, 0x710e, + 0x7010, 0xa102, 0xa082, 0x0009, 0x0040, 0x163a, 0xa080, 0x001b, + 0x00c0, 0x163d, 0x2009, 0x0138, 0x200a, 0x7000, 0xa005, 0x00c0, + 0x1643, 0x1078, 0x179f, 0x127f, 0x007c, 0x127e, 0x027e, 0x037e, + 0x0c7e, 0x007e, 0x2091, 0x2100, 0x007f, 0x047f, 0x037f, 0x027f, + 0x0d7e, 0x0c7e, 0x2460, 0x6110, 0x2168, 0x6a62, 0x6b5e, 0xa005, + 0x0040, 0x16cf, 0x6808, 0xa005, 0x0040, 0x173c, 0x7000, 0xa005, + 0x00c0, 0x1664, 0x0078, 0x16c4, 0x700c, 0x7110, 0xa106, 0x00c0, + 0x1745, 0x7004, 0xa406, 0x00c0, 0x16c4, 0x2001, 0x0005, 0x2004, + 0xd08c, 0x0040, 0x1681, 0x047e, 0x1078, 0x18e2, 0x047f, 0x2460, + 0x6010, 0xa080, 0x0002, 0x2004, 0xa005, 0x0040, 0x173c, 0x0078, + 0x165e, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x166d, 0x7804, + 0xa084, 0x6000, 0x0040, 0x1692, 0xa086, 0x6000, 0x0040, 0x1692, + 0x0078, 0x166d, 0x7100, 0xa186, 0x0002, 0x00c0, 0x16b2, 0x0e7e, + 0x2b68, 0x6818, 0x2060, 0x1078, 0x1fea, 0x2804, 0xac70, 0x6034, + 0xd09c, 0x00c0, 0x16a7, 0x7108, 0x720c, 0x0078, 0x16a9, 0x7110, + 0x7214, 0x6810, 0xa100, 0x6812, 0x6814, 0xa201, 0x6816, 0x0e7f, + 0x0078, 0x16b6, 0xa186, 0x0001, 0x00c0, 0x16be, 0x7820, 0x6910, + 0xa100, 0x6812, 0x7824, 0x6914, 0xa101, 0x6816, 0x7803, 0x0004, + 0x7003, 0x0000, 0x7004, 0x2060, 0x6100, 0xa18e, 0x0004, 0x00c0, + 0x1745, 0x2009, 0x0048, 0x1078, 0x756c, 0x0078, 0x1745, 0x6808, + 0xa005, 0x0040, 0x173c, 0x7000, 0xa005, 0x00c0, 0x16d9, 0x0078, + 0x173c, 0x700c, 0x7110, 0xa106, 0x00c0, 0x16e2, 0x7004, 0xa406, + 0x00c0, 0x173c, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040, 0x16f6, + 0x047e, 0x1078, 0x18e2, 0x047f, 0x2460, 0x6010, 0xa080, 0x0002, + 0x2004, 0xa005, 0x0040, 0x173c, 0x0078, 0x16d3, 0x2001, 0x0207, + 0x2004, 0xd09c, 0x00c0, 0x16e2, 0x2001, 0x0005, 0x2004, 0xd08c, + 0x00c0, 0x16e8, 0x7804, 0xa084, 0x6000, 0x0040, 0x170d, 0xa086, + 0x6000, 0x0040, 0x170d, 0x0078, 0x16e2, 0x7007, 0x0000, 0xa016, + 0x2218, 0x7000, 0xa08e, 0x0001, 0x0040, 0x172e, 0xa08e, 0x0002, + 0x00c0, 0x173c, 0x0c7e, 0x0e7e, 0x6818, 0x2060, 0x1078, 0x1fea, + 0x2804, 0xac70, 0x6034, 0xd09c, 0x00c0, 0x172a, 0x7308, 0x720c, + 0x0078, 0x172c, 0x7310, 0x7214, 0x0e7f, 0x0c7f, 0x7820, 0xa318, + 0x7824, 0xa211, 0x6810, 0xa300, 0x6812, 0x6814, 0xa201, 0x6816, + 0x7803, 0x0004, 0x7003, 0x0000, 0x6100, 0xa18e, 0x0004, 0x00c0, + 0x1745, 0x2009, 0x0048, 0x1078, 0x756c, 0x0c7f, 0x0d7f, 0x127f, + 0x007c, 0x0f7e, 0x0e7e, 0x027e, 0x037e, 0x047e, 0x1078, 0x1af7, + 0x027e, 0x2071, 0xa5e1, 0x7000, 0xa086, 0x0000, 0x0040, 0x1790, + 0x7004, 0xac06, 0x00c0, 0x1781, 0x2079, 0x0030, 0x7000, 0xa086, + 0x0003, 0x0040, 0x1781, 0x7804, 0xd0fc, 0x00c0, 0x177d, 0x2001, + 0x0207, 0x2004, 0xd09c, 0x00c0, 0x1763, 0x7803, 0x0004, 0x7804, + 0xd0ac, 0x00c0, 0x176f, 0x7803, 0x0002, 0x7803, 0x0009, 0x7003, + 0x0003, 0x7007, 0x0000, 0x0078, 0x1781, 0x1078, 0x18e2, 0x0078, + 0x1753, 0x157e, 0x20a9, 0x0009, 0x2009, 0xa5e7, 0x2104, 0xac06, + 0x00c0, 0x178b, 0x200a, 0xa188, 0x0003, 0x00f0, 0x1786, 0x157f, + 0x027f, 0x2001, 0x015d, 0x201c, 0x831a, 0x2302, 0x2001, 0x0138, + 0x2202, 0x047f, 0x037f, 0x027f, 0x0e7f, 0x0f7f, 0x007c, 0x700c, + 0x7110, 0xa106, 0x00c0, 0x17a7, 0x7003, 0x0000, 0x007c, 0x2104, + 0x7006, 0x2060, 0x8108, 0x211c, 0x8108, 0x2124, 0x8108, 0xa182, + 0xa602, 0x0048, 0x17b5, 0x2009, 0xa5e7, 0x7112, 0x700c, 0xa106, + 0x00c0, 0x17be, 0x2001, 0x0138, 0x2003, 0x0008, 0x8cff, 0x00c0, + 0x17c5, 0x1078, 0x1b22, 0x0078, 0x1823, 0x6010, 0x2068, 0x2d58, + 0x6828, 0xa406, 0x00c0, 0x17d0, 0x682c, 0xa306, 0x0040, 0x17fe, + 0x601c, 0xa086, 0x0008, 0x0040, 0x17fe, 0x6024, 0xd0f4, 0x00c0, + 0x17fa, 0xd0d4, 0x0040, 0x17f6, 0x6038, 0xa402, 0x6034, 0xa303, + 0x0040, 0x17e4, 0x00c8, 0x17f6, 0x643a, 0x6336, 0x6c2a, 0x6b2e, + 0x047e, 0x037e, 0x2400, 0x6c7c, 0xa402, 0x6812, 0x2300, 0x6b80, + 0xa303, 0x6816, 0x037f, 0x047f, 0x0078, 0x17fa, 0x1078, 0x8d8e, + 0x0040, 0x17c1, 0x1078, 0x2035, 0x00c0, 0x17c1, 0x0c7e, 0x7004, + 0x2060, 0x6024, 0xc0d4, 0x6026, 0x0c7f, 0x684c, 0xd0f4, 0x0040, + 0x180f, 0x6817, 0xffff, 0x6813, 0xffff, 0x0078, 0x17c1, 0x6824, + 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, + 0x2009, 0x0011, 0x1078, 0x1824, 0x0040, 0x1822, 0x2009, 0x0001, + 0x1078, 0x1824, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x18bb, 0xa03e, + 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x1846, 0xd0f4, 0x00c0, 0x1856, + 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1836, 0x189d, 0x185d, + 0x185d, 0x189d, 0x189d, 0x1895, 0x189d, 0x185d, 0x189d, 0x1863, + 0x1863, 0x189d, 0x189d, 0x189d, 0x188c, 0x1863, 0xc0fc, 0x6852, + 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0x0d7e, 0xd99c, 0x0040, 0x18a0, + 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x18a0, 0xc0f4, 0x6852, + 0x6b6c, 0x6a70, 0x0d7e, 0x0078, 0x18a7, 0x6b08, 0x6a0c, 0x6d00, + 0x6c04, 0x0078, 0x18a0, 0x7b0c, 0xd3bc, 0x0040, 0x1884, 0x7004, + 0x0e7e, 0x2070, 0x701c, 0x0e7f, 0xa086, 0x0008, 0x00c0, 0x1884, + 0x7b08, 0xa39c, 0x0fff, 0x2d20, 0x0d7f, 0x0d7e, 0x6a14, 0x82ff, + 0x00c0, 0x187f, 0x6810, 0xa302, 0x0048, 0x187f, 0x6b10, 0x2011, + 0x0000, 0x2468, 0x0078, 0x1886, 0x6b10, 0x6a14, 0x6d00, 0x6c04, + 0x6f08, 0x6e0c, 0x0078, 0x18a0, 0x0d7f, 0x0d7e, 0x6834, 0xa084, + 0x00ff, 0xa086, 0x001e, 0x00c0, 0x189d, 0x0d7f, 0x1078, 0x1fd1, + 0x00c0, 0x1824, 0xa00e, 0x0078, 0x18bb, 0x0d7f, 0x1078, 0x1328, + 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, + 0x8000, 0x7002, 0x0d7f, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, + 0x682e, 0x2300, 0x6b10, 0xa302, 0x6812, 0x2200, 0x6a14, 0xa203, + 0x6816, 0x1078, 0x1fd1, 0x007c, 0x1078, 0x1328, 0x1078, 0x1c52, + 0x7004, 0x2060, 0x0d7e, 0x6010, 0x2068, 0x7003, 0x0000, 0x1078, + 0x1ac6, 0x1078, 0x8a44, 0x0040, 0x18db, 0x6808, 0x8001, 0x680a, + 0x697c, 0x6912, 0x6980, 0x6916, 0x682b, 0xffff, 0x682f, 0xffff, + 0x6850, 0xc0bd, 0x6852, 0x0d7f, 0x1078, 0x8758, 0x0078, 0x1aad, + 0x1078, 0x1328, 0x127e, 0x2091, 0x2100, 0x007e, 0x017e, 0x2b68, + 0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, + 0x18be, 0xa184, 0x0003, 0xa086, 0x0003, 0x0040, 0x18e0, 0x7000, + 0x0079, 0x18fa, 0x1902, 0x1904, 0x1a06, 0x1a84, 0x1a9b, 0x1902, + 0x1902, 0x1902, 0x1078, 0x1328, 0x8001, 0x7002, 0xa184, 0x0880, + 0x00c0, 0x1919, 0x8aff, 0x0040, 0x199b, 0x2009, 0x0001, 0x1078, + 0x1824, 0x0040, 0x1aad, 0x2009, 0x0001, 0x1078, 0x1824, 0x0078, + 0x1aad, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1bc, 0x00c0, 0x1979, + 0x027e, 0x037e, 0x7808, 0xd0ec, 0x00c0, 0x1930, 0x7c20, 0x7d24, + 0x7e30, 0x7f34, 0x7803, 0x0009, 0x7003, 0x0004, 0x0078, 0x1932, + 0x1078, 0x1b9f, 0x6b28, 0x6a2c, 0x2400, 0x686e, 0xa31a, 0x2500, + 0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x0c7e, 0x7004, 0x2060, 0x6024, + 0xd0f4, 0x00c0, 0x1945, 0x633a, 0x6236, 0x0c7f, 0x2400, 0x6910, + 0xa100, 0x6812, 0x2500, 0x6914, 0xa101, 0x6816, 0x037f, 0x027f, + 0x2600, 0x681e, 0x2700, 0x6822, 0x1078, 0x1fea, 0x2a00, 0x6826, + 0x2c00, 0x681a, 0x2800, 0x6832, 0x6850, 0xc0fd, 0x6852, 0x6808, + 0x8001, 0x680a, 0x00c0, 0x196e, 0x684c, 0xd0e4, 0x0040, 0x196e, + 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x756c, 0x7000, 0xa086, + 0x0004, 0x0040, 0x1aad, 0x7003, 0x0000, 0x1078, 0x179f, 0x0078, + 0x1aad, 0x057e, 0x7d0c, 0xd5bc, 0x00c0, 0x1980, 0x1078, 0xa20c, + 0x057f, 0x1078, 0x1ac6, 0x0f7e, 0x7004, 0x2078, 0x1078, 0x4893, + 0x0040, 0x198d, 0x7824, 0xc0f5, 0x7826, 0x0f7f, 0x682b, 0xffff, + 0x682f, 0xffff, 0x6808, 0x8001, 0x680a, 0x697c, 0x6912, 0x6980, + 0x6916, 0x0078, 0x1aad, 0x7004, 0x0c7e, 0x2060, 0x6024, 0x0c7f, + 0xd0f4, 0x0040, 0x19a8, 0x6808, 0x8001, 0x680a, 0x0078, 0x1aad, + 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005, 0x00c0, 0x19c0, 0x7003, + 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0, 0x19bc, 0x7004, 0x2060, + 0x2009, 0x0048, 0x1078, 0x756c, 0x1078, 0x179f, 0x0078, 0x1aad, + 0x7814, 0x6910, 0xa102, 0x6812, 0x6914, 0xa183, 0x0000, 0x6816, + 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa188, 0x0007, 0x8114, 0x8214, + 0x8214, 0xa10a, 0x8104, 0x8004, 0x8004, 0xa20a, 0x810b, 0x810b, + 0x810b, 0x1078, 0x1b4d, 0x7803, 0x0004, 0x780f, 0xffff, 0x7803, + 0x0001, 0x7804, 0xd0fc, 0x0040, 0x19e1, 0x7803, 0x0002, 0x7803, + 0x0004, 0x780f, 0x0076, 0x7004, 0x7007, 0x0000, 0x2060, 0x2009, + 0x0048, 0x1078, 0x756c, 0x1078, 0x1b81, 0x0040, 0x19bc, 0x7908, + 0xd1ec, 0x00c0, 0x19ff, 0x2009, 0x0009, 0x0078, 0x1a01, 0x2009, + 0x0019, 0x7902, 0x7003, 0x0003, 0x0078, 0x1aad, 0x8001, 0x7002, + 0xd194, 0x0040, 0x1a18, 0x7804, 0xd0fc, 0x00c0, 0x18ea, 0x8aff, + 0x0040, 0x1aad, 0x2009, 0x0001, 0x1078, 0x1824, 0x0078, 0x1aad, + 0xa184, 0x0880, 0x00c0, 0x1a25, 0x8aff, 0x0040, 0x1aad, 0x2009, + 0x0001, 0x1078, 0x1824, 0x0078, 0x1aad, 0x7803, 0x0004, 0x7003, + 0x0000, 0xd1bc, 0x00c0, 0x1a65, 0x027e, 0x037e, 0x7808, 0xd0ec, + 0x00c0, 0x1a38, 0x7803, 0x0009, 0x7003, 0x0004, 0x0078, 0x1a3a, + 0x1078, 0x1b9f, 0x6b28, 0x6a2c, 0x1078, 0x1fea, 0x0d7e, 0x0f7e, + 0x2d78, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1a55, 0x6808, + 0x2008, 0xa31a, 0x680c, 0xa213, 0x7810, 0xa100, 0x7812, 0x690c, + 0x7814, 0xa101, 0x7816, 0x0078, 0x1a61, 0x6810, 0x2008, 0xa31a, + 0x6814, 0xa213, 0x7810, 0xa100, 0x7812, 0x6914, 0x7814, 0xa101, + 0x7816, 0x0f7f, 0x0d7f, 0x0078, 0x1934, 0x057e, 0x7d0c, 0x1078, + 0xa20c, 0x057f, 0x1078, 0x1ac6, 0x0f7e, 0x7004, 0x2078, 0x1078, + 0x4893, 0x0040, 0x1a76, 0x7824, 0xc0f5, 0x7826, 0x0f7f, 0x682b, + 0xffff, 0x682f, 0xffff, 0x6808, 0x8001, 0x680a, 0x697c, 0x6912, + 0x6980, 0x6916, 0x0078, 0x1aad, 0x7803, 0x0004, 0x7003, 0x0000, + 0x7004, 0xa00d, 0x0040, 0x1a97, 0x6808, 0x8001, 0x680a, 0x00c0, + 0x1a97, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x756c, 0x1078, + 0x179f, 0x0078, 0x1aad, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, + 0x2060, 0x6010, 0xa005, 0x0040, 0x1a97, 0x2068, 0x6808, 0x8000, + 0x680a, 0x6c28, 0x6b2c, 0x1078, 0x17be, 0x017f, 0x007f, 0x127f, + 0x007c, 0x127e, 0x2091, 0x2100, 0x7000, 0xa086, 0x0003, 0x00c0, + 0x1ac4, 0x700c, 0x7110, 0xa106, 0x0040, 0x1ac4, 0x20e1, 0x9028, + 0x700f, 0xa5e7, 0x7013, 0xa5e7, 0x127f, 0x007c, 0x0c7e, 0x1078, + 0x1af7, 0x20e1, 0x9028, 0x700c, 0x7110, 0xa106, 0x0040, 0x1aed, + 0x2104, 0xa005, 0x0040, 0x1ada, 0x2060, 0x6010, 0x2060, 0x6008, + 0x8001, 0x600a, 0xa188, 0x0003, 0xa182, 0xa602, 0x0048, 0x1ae2, + 0x2009, 0xa5e7, 0x7112, 0x700c, 0xa106, 0x00c0, 0x1acb, 0x2001, + 0x0138, 0x2003, 0x0008, 0x0078, 0x1acb, 0x2001, 0x015d, 0x200c, + 0x810a, 0x2102, 0x2001, 0x0138, 0x2202, 0x0c7f, 0x007c, 0x2001, + 0x0138, 0x2014, 0x2003, 0x0000, 0x2021, 0xb015, 0x2001, 0x0141, + 0x201c, 0xd3dc, 0x00c0, 0x1b14, 0x2001, 0x0109, 0x201c, 0xa39c, + 0x0048, 0x00c0, 0x1b14, 0x2001, 0x0111, 0x201c, 0x83ff, 0x00c0, + 0x1b14, 0x8421, 0x00c0, 0x1afe, 0x007c, 0x2011, 0x0201, 0x2009, + 0x003c, 0x2204, 0xa005, 0x00c0, 0x1b21, 0x8109, 0x00c0, 0x1b19, + 0x007c, 0x007c, 0x1078, 0x1b15, 0x0040, 0x1b4a, 0x7908, 0xd1ec, + 0x00c0, 0x1b3a, 0x1078, 0x1b81, 0x0040, 0x1b3a, 0x7803, 0x0009, + 0x7904, 0xd1fc, 0x0040, 0x1b30, 0x7803, 0x0006, 0x1078, 0x1b15, + 0x0040, 0x1b4a, 0x780c, 0xd0a4, 0x00c0, 0x1b4a, 0x7007, 0x0000, + 0x1078, 0x1b81, 0x0040, 0x1b4c, 0x7803, 0x0019, 0x7003, 0x0003, + 0x0078, 0x1b4c, 0x1078, 0x1ac6, 0x007c, 0x0e7e, 0x2071, 0x0200, + 0x7808, 0xa084, 0xf000, 0xa10d, 0x1078, 0x1af7, 0x2019, 0x5000, + 0x8319, 0x0040, 0x1b6b, 0x2001, 0xa602, 0x2004, 0xa086, 0x0000, + 0x0040, 0x1b6b, 0x2001, 0x0021, 0xd0fc, 0x0040, 0x1b58, 0x1078, + 0x1e5d, 0x0078, 0x1b56, 0x20e1, 0x7000, 0x7324, 0x7420, 0x7028, + 0x7028, 0x7426, 0x7037, 0x0001, 0x810f, 0x712e, 0x702f, 0x0100, + 0x7037, 0x0008, 0x7326, 0x7422, 0x2001, 0x0138, 0x2202, 0x0e7f, + 0x007c, 0x7908, 0xa18c, 0x0fff, 0xa182, 0x0009, 0x0048, 0x1b8c, + 0xa085, 0x0001, 0x0078, 0x1b9e, 0x2001, 0x020a, 0x81ff, 0x0040, + 0x1b97, 0x20e1, 0x6000, 0x200c, 0x200c, 0x200c, 0x200c, 0x20e1, + 0x7000, 0x200c, 0x200c, 0x7003, 0x0000, 0xa006, 0x007c, 0x7c20, + 0x7d24, 0x7e30, 0x7f34, 0x700c, 0x7110, 0xa106, 0x0040, 0x1c24, + 0x7004, 0x017e, 0x210c, 0xa106, 0x017f, 0x0040, 0x1c24, 0x0d7e, + 0x0c7e, 0x216c, 0x2d00, 0xa005, 0x0040, 0x1c22, 0x6824, 0xd0d4, + 0x00c0, 0x1c22, 0x6810, 0x2068, 0x6850, 0xd0fc, 0x0040, 0x1bec, + 0x8108, 0x2104, 0x6b2c, 0xa306, 0x00c0, 0x1c22, 0x8108, 0x2104, + 0x6a28, 0xa206, 0x00c0, 0x1c22, 0x6850, 0xc0fc, 0xc0f5, 0x6852, + 0x686c, 0x7822, 0x6870, 0x7826, 0x681c, 0x7832, 0x6820, 0x7836, + 0x6818, 0x2060, 0x6034, 0xd09c, 0x0040, 0x1be7, 0x6830, 0x2004, + 0xac68, 0x6808, 0x783a, 0x680c, 0x783e, 0x0078, 0x1c20, 0xa006, + 0x783a, 0x783e, 0x0078, 0x1c20, 0x8108, 0x2104, 0xa005, 0x00c0, + 0x1c22, 0x8108, 0x2104, 0xa005, 0x00c0, 0x1c22, 0x6850, 0xc0f5, + 0x6852, 0x6830, 0x2004, 0x6918, 0xa160, 0xa180, 0x000d, 0x2004, + 0xd09c, 0x00c0, 0x1c12, 0x6008, 0x7822, 0x686e, 0x600c, 0x7826, + 0x6872, 0x6000, 0x7832, 0x6004, 0x7836, 0xa006, 0x783a, 0x783e, + 0x0078, 0x1c20, 0x6010, 0x7822, 0x686e, 0x6014, 0x7826, 0x6872, + 0x6000, 0x7832, 0x6004, 0x7836, 0x6008, 0x783a, 0x600c, 0x783e, + 0x7803, 0x0011, 0x0c7f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e, 0x017e, + 0x027e, 0x2071, 0xa5e1, 0x2079, 0x0030, 0x2011, 0x0050, 0x7000, + 0xa086, 0x0000, 0x0040, 0x1c4d, 0x8211, 0x0040, 0x1c4b, 0x2001, + 0x0005, 0x2004, 0xd08c, 0x0040, 0x1c34, 0x7904, 0xa18c, 0x0780, + 0x017e, 0x1078, 0x18e2, 0x017f, 0x81ff, 0x00c0, 0x1c4b, 0x2011, + 0x0050, 0x0078, 0x1c2f, 0xa085, 0x0001, 0x027f, 0x017f, 0x0e7f, + 0x0f7f, 0x007c, 0x7803, 0x0004, 0x2009, 0x0064, 0x7804, 0xd0ac, + 0x0040, 0x1ca3, 0x8109, 0x00c0, 0x1c56, 0x2009, 0x0100, 0x210c, + 0xa18a, 0x0003, 0x1048, 0x1328, 0x1078, 0x1f75, 0x0e7e, 0x0f7e, + 0x2071, 0xa5d0, 0x2079, 0x0010, 0x7004, 0xa086, 0x0000, 0x0040, + 0x1c9b, 0x7800, 0x007e, 0x7820, 0x007e, 0x7830, 0x007e, 0x7834, + 0x007e, 0x7838, 0x007e, 0x783c, 0x007e, 0x7803, 0x0004, 0x7823, + 0x0000, 0x0005, 0x0005, 0x2079, 0x0030, 0x7804, 0xd0ac, 0x10c0, + 0x1328, 0x2079, 0x0010, 0x007f, 0x783e, 0x007f, 0x783a, 0x007f, + 0x7836, 0x007f, 0x7832, 0x007f, 0x7822, 0x007f, 0x7802, 0x0f7f, + 0x0e7f, 0x0078, 0x1ca1, 0x0f7f, 0x0e7f, 0x7804, 0xd0ac, 0x10c0, + 0x1328, 0x1078, 0x61d3, 0x007c, 0x0e7e, 0x2071, 0xa602, 0x7003, + 0x0000, 0x0e7f, 0x007c, 0x0d7e, 0xa280, 0x0004, 0x206c, 0x694c, + 0xd1dc, 0x00c0, 0x1d26, 0x6934, 0xa184, 0x0007, 0x0079, 0x1cb8, + 0x1cc0, 0x1d11, 0x1cc0, 0x1cc0, 0x1cc0, 0x1cf6, 0x1cd3, 0x1cc2, + 0x1078, 0x1328, 0x684c, 0xd0b4, 0x0040, 0x1e34, 0x6860, 0x682e, + 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a, 0x6880, 0x680e, + 0x6958, 0x0078, 0x1d19, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, + 0x00c0, 0x1cc0, 0x684c, 0xd0b4, 0x0040, 0x1e34, 0x6860, 0x682e, + 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a, 0x6880, 0x680e, + 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, + 0x2015, 0x2004, 0x6832, 0x6958, 0x0078, 0x1d22, 0xa18c, 0x00ff, + 0xa186, 0x0015, 0x00c0, 0x1d26, 0x684c, 0xd0b4, 0x0040, 0x1e34, + 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, + 0x2015, 0x2004, 0x6832, 0x6958, 0xa006, 0x682e, 0x682a, 0x0078, + 0x1d22, 0x684c, 0xd0b4, 0x0040, 0x18bc, 0x6958, 0xa006, 0x682e, + 0x682a, 0x2d00, 0x681a, 0x6834, 0xa084, 0x000f, 0xa080, 0x2015, + 0x2004, 0x6832, 0x6926, 0x684c, 0xc0dd, 0x684e, 0x0d7f, 0x007c, + 0x0f7e, 0x2079, 0x0020, 0x7804, 0xd0fc, 0x10c0, 0x1e5d, 0x0e7e, + 0x0d7e, 0x2071, 0xa602, 0x7000, 0xa005, 0x00c0, 0x1dab, 0x0c7e, + 0x7206, 0xa280, 0x0004, 0x205c, 0x7004, 0x2068, 0x7803, 0x0004, + 0x6818, 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890, 0x0f7e, 0x20e1, + 0x9040, 0x2079, 0x0200, 0x781a, 0x2079, 0x0100, 0x8004, 0x78d6, + 0x0f7f, 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818, 0x2060, 0x6830, + 0x2040, 0x6034, 0xa0cc, 0x000f, 0x6908, 0x2001, 0x04fd, 0x2004, + 0xa086, 0x0007, 0x0040, 0x1d6d, 0xa184, 0x0007, 0x0040, 0x1d6d, + 0x017e, 0x2009, 0x0008, 0xa102, 0x017f, 0xa108, 0x791a, 0x7116, + 0x701e, 0x680c, 0xa081, 0x0000, 0x781e, 0x701a, 0xa006, 0x700e, + 0x7012, 0x7004, 0x692c, 0x6814, 0xa106, 0x00c0, 0x1d84, 0x6928, + 0x6810, 0xa106, 0x0040, 0x1d91, 0x037e, 0x047e, 0x6b14, 0x6c10, + 0x1078, 0x2035, 0x047f, 0x037f, 0x0040, 0x1d91, 0x0c7f, 0x0078, + 0x1dab, 0x8aff, 0x00c0, 0x1d99, 0x0c7f, 0xa085, 0x0001, 0x0078, + 0x1dab, 0x127e, 0x2091, 0x8000, 0x2079, 0x0020, 0x2009, 0x0001, + 0x1078, 0x1daf, 0x0040, 0x1da8, 0x2009, 0x0001, 0x1078, 0x1daf, + 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x077e, + 0x067e, 0x057e, 0x047e, 0x037e, 0x027e, 0x8aff, 0x0040, 0x1e2d, + 0x700c, 0x7214, 0xa23a, 0x7010, 0x7218, 0xa203, 0x0048, 0x1e2c, + 0xa705, 0x0040, 0x1e2c, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, + 0x1ddf, 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1dcf, 0x1e0e, + 0x1def, 0x1def, 0x1e0e, 0x1e0e, 0x1e06, 0x1e0e, 0x1def, 0x1e0e, + 0x1df5, 0x1df5, 0x1e0e, 0x1e0e, 0x1e0e, 0x1dfd, 0x1df5, 0xc0fc, + 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1e12, + 0x0d7e, 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1e11, 0x6b08, + 0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x1e11, 0x6b10, 0x6a14, 0x6d00, + 0x6c04, 0x6f08, 0x6e0c, 0x0078, 0x1e11, 0x0d7f, 0x0d7e, 0x6834, + 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x1e0e, 0x0d7f, 0x1078, + 0x1fd1, 0x00c0, 0x1db5, 0xa00e, 0x0078, 0x1e2d, 0x0d7f, 0x1078, + 0x1328, 0x0d7f, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, + 0x7902, 0x7000, 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c, + 0xa201, 0x682e, 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012, + 0x1078, 0x1fd1, 0x0078, 0x1e2d, 0xa006, 0x027f, 0x037f, 0x047f, + 0x057f, 0x067f, 0x077f, 0x007c, 0x1078, 0x1328, 0x027e, 0x2001, + 0x0105, 0x2003, 0x0010, 0x20e1, 0x9040, 0x7803, 0x0004, 0x7003, + 0x0000, 0x7004, 0x2060, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x8a44, + 0x0040, 0x1e4d, 0x6850, 0xc0bd, 0x6852, 0x0d7f, 0x1078, 0x8758, + 0x20e1, 0x9040, 0x1078, 0x719a, 0x2011, 0x0000, 0x1078, 0x6efc, + 0x1078, 0x61d3, 0x027f, 0x0078, 0x1f29, 0x127e, 0x2091, 0x2200, + 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x2079, 0x0020, + 0x2071, 0xa602, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002, + 0xa184, 0x0700, 0x00c0, 0x1e36, 0x7000, 0x0079, 0x1e77, 0x1f29, + 0x1e7b, 0x1ef6, 0x1f27, 0x8001, 0x7002, 0xd19c, 0x00c0, 0x1e8f, + 0x8aff, 0x0040, 0x1eae, 0x2009, 0x0001, 0x1078, 0x1daf, 0x0040, + 0x1f29, 0x2009, 0x0001, 0x1078, 0x1daf, 0x0078, 0x1f29, 0x7803, + 0x0004, 0xd194, 0x0040, 0x1e9f, 0x6850, 0xc0fc, 0x6852, 0x8aff, + 0x00c0, 0x1ea4, 0x684c, 0xc0f5, 0x684e, 0x0078, 0x1ea4, 0x1078, + 0x1fea, 0x6850, 0xc0fd, 0x6852, 0x2a00, 0x6826, 0x2c00, 0x681a, + 0x2800, 0x6832, 0x7003, 0x0000, 0x0078, 0x1f29, 0x711c, 0x81ff, + 0x0040, 0x1ec4, 0x7918, 0x7922, 0x7827, 0x0000, 0x7803, 0x0001, + 0x7000, 0x8000, 0x7002, 0x700c, 0xa100, 0x700e, 0x7010, 0xa081, + 0x0000, 0x7012, 0x0078, 0x1f29, 0x0f7e, 0x027e, 0x781c, 0x007e, + 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14, 0xa284, 0x0004, 0xa085, + 0x0012, 0x7816, 0x037e, 0x2019, 0x1000, 0x8319, 0x1040, 0x1328, + 0x7820, 0xd0bc, 0x00c0, 0x1ed5, 0x037f, 0x79c8, 0x007f, 0xa102, + 0x017f, 0x007e, 0x017e, 0x79c4, 0x007f, 0xa103, 0x78c6, 0x007f, + 0x78ca, 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f, + 0x7803, 0x0008, 0x7003, 0x0000, 0x0078, 0x1f29, 0x8001, 0x7002, + 0xd194, 0x0040, 0x1f0b, 0x7804, 0xd0fc, 0x00c0, 0x1e6d, 0xd19c, + 0x00c0, 0x1f25, 0x8aff, 0x0040, 0x1f29, 0x2009, 0x0001, 0x1078, + 0x1daf, 0x0078, 0x1f29, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, + 0x1fea, 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1f1e, + 0x6808, 0xa31a, 0x680c, 0xa213, 0x0078, 0x1f22, 0x6810, 0xa31a, + 0x6814, 0xa213, 0x0d7f, 0x0078, 0x1e9f, 0x0078, 0x1e9f, 0x1078, + 0x1328, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f, + 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0xa602, 0x7000, 0xa086, 0x0000, + 0x0040, 0x1f72, 0x2079, 0x0020, 0x017e, 0x2009, 0x0207, 0x210c, + 0xd194, 0x0040, 0x1f4f, 0x2009, 0x020c, 0x210c, 0xa184, 0x0003, + 0x0040, 0x1f4f, 0x20e1, 0x9040, 0x2001, 0x020c, 0x2102, 0x2009, + 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0xa106, 0x00c0, 0x1f5a, + 0x20e1, 0x9040, 0x7804, 0xd0fc, 0x0040, 0x1f3d, 0x1078, 0x1e5d, + 0x7000, 0xa086, 0x0000, 0x00c0, 0x1f3d, 0x017f, 0x7803, 0x0004, + 0x7804, 0xd0ac, 0x00c0, 0x1f68, 0x20e1, 0x9040, 0x7803, 0x0002, + 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c, 0x027e, 0x0c7e, 0x0d7e, + 0x0e7e, 0x0f7e, 0x2071, 0xa602, 0x2079, 0x0020, 0x7000, 0xa086, + 0x0000, 0x0040, 0x1fae, 0x7004, 0x2060, 0x6010, 0x2068, 0x1078, + 0x8a44, 0x0040, 0x1f98, 0x6850, 0xc0b5, 0x6852, 0x680c, 0x7a1c, + 0xa206, 0x00c0, 0x1f98, 0x6808, 0x7a18, 0xa206, 0x0040, 0x1fb4, + 0x2001, 0x0105, 0x2003, 0x0010, 0x20e1, 0x9040, 0x7803, 0x0004, + 0x7003, 0x0000, 0x7004, 0x2060, 0x1078, 0x8758, 0x20e1, 0x9040, + 0x1078, 0x719a, 0x2011, 0x0000, 0x1078, 0x6efc, 0x0f7f, 0x0e7f, + 0x0d7f, 0x0c7f, 0x027f, 0x007c, 0x6810, 0x6a14, 0xa205, 0x00c0, + 0x1f98, 0x684c, 0xc0dc, 0x684e, 0x2c10, 0x1078, 0x1cab, 0x2001, + 0x0105, 0x2003, 0x0010, 0x20e1, 0x9040, 0x7803, 0x0004, 0x7003, + 0x0000, 0x2069, 0xa5ab, 0x6833, 0x0000, 0x683f, 0x0000, 0x0078, + 0x1fae, 0x8840, 0x2804, 0xa005, 0x00c0, 0x1fe5, 0x6004, 0xa005, + 0x0040, 0x1fe7, 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, + 0x2015, 0x2044, 0x88ff, 0x1040, 0x1328, 0x8a51, 0x007c, 0x2051, + 0x0000, 0x007c, 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x2004, + 0x2c00, 0xad06, 0x0040, 0x1ff9, 0x6000, 0xa005, 0x00c0, 0x1ff9, + 0x2d00, 0x2060, 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x2025, + 0x2044, 0x88ff, 0x1040, 0x1328, 0x007c, 0x0000, 0x0011, 0x0015, + 0x0019, 0x001d, 0x0021, 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, + 0x001b, 0x0021, 0x0027, 0x0000, 0x0000, 0x0000, 0x200a, 0x2006, + 0x0000, 0x0000, 0x2014, 0x0000, 0x200a, 0x0000, 0x2011, 0x200e, + 0x0000, 0x0000, 0x0000, 0x2014, 0x2011, 0x0000, 0x200c, 0x200c, + 0x0000, 0x0000, 0x2014, 0x0000, 0x200c, 0x0000, 0x2012, 0x2012, + 0x0000, 0x0000, 0x0000, 0x2014, 0x2012, 0x0a7e, 0x097e, 0x087e, + 0x6b2e, 0x6c2a, 0x6858, 0xa055, 0x0040, 0x20d8, 0x2d60, 0x6034, + 0xa0cc, 0x000f, 0xa9c0, 0x2015, 0xa986, 0x0007, 0x0040, 0x2050, + 0xa986, 0x000e, 0x0040, 0x2050, 0xa986, 0x000f, 0x00c0, 0x2054, + 0x605c, 0xa422, 0x6060, 0xa31a, 0x2804, 0xa045, 0x00c0, 0x2062, + 0x0050, 0x205c, 0x0078, 0x20d8, 0x6004, 0xa065, 0x0040, 0x20d8, + 0x0078, 0x203f, 0x2804, 0xa005, 0x0040, 0x2080, 0xac68, 0xd99c, + 0x00c0, 0x2070, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0078, 0x2074, + 0x6810, 0xa422, 0x6814, 0xa31b, 0x0048, 0x209f, 0x2300, 0xa405, + 0x0040, 0x2086, 0x8a51, 0x0040, 0x20d8, 0x8840, 0x0078, 0x2062, + 0x6004, 0xa065, 0x0040, 0x20d8, 0x0078, 0x203f, 0x8a51, 0x0040, + 0x20d8, 0x8840, 0x2804, 0xa005, 0x00c0, 0x2099, 0x6004, 0xa065, + 0x0040, 0x20d8, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x2015, 0x2804, + 0x2040, 0x2b68, 0x6850, 0xc0fc, 0x6852, 0x0078, 0x20cc, 0x8422, + 0x8420, 0x831a, 0xa399, 0x0000, 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, + 0x0d7f, 0xd99c, 0x00c0, 0x20ba, 0x6908, 0x2400, 0xa122, 0x690c, + 0x2300, 0xa11b, 0x1048, 0x1328, 0x6800, 0xa420, 0x6804, 0xa319, + 0x0078, 0x20c6, 0x6910, 0x2400, 0xa122, 0x6914, 0x2300, 0xa11b, + 0x1048, 0x1328, 0x6800, 0xa420, 0x6804, 0xa319, 0x2b68, 0x6c1e, + 0x6b22, 0x6850, 0xc0fd, 0x6852, 0x2c00, 0x681a, 0x2800, 0x6832, + 0x2a00, 0x6826, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078, 0x20dd, + 0x087f, 0x097f, 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0005, + 0x2004, 0xa084, 0x0007, 0x0079, 0x20e5, 0x20ed, 0x20ee, 0x20f1, + 0x20f4, 0x20f9, 0x20fc, 0x2101, 0x2106, 0x007c, 0x1078, 0x1e5d, + 0x007c, 0x1078, 0x18e2, 0x007c, 0x1078, 0x18e2, 0x1078, 0x1e5d, + 0x007c, 0x1078, 0x14b0, 0x007c, 0x1078, 0x1e5d, 0x1078, 0x14b0, + 0x007c, 0x1078, 0x18e2, 0x1078, 0x14b0, 0x007c, 0x1078, 0x18e2, + 0x1078, 0x1e5d, 0x1078, 0x14b0, 0x007c, 0x127e, 0x2091, 0x2300, + 0x2079, 0x0200, 0x2071, 0xa880, 0x2069, 0xa300, 0x2009, 0x0004, + 0x7912, 0x7817, 0x0004, 0x1078, 0x24b5, 0x781b, 0x0002, 0x20e1, + 0x8700, 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x781c, 0xa084, + 0x0007, 0x0079, 0x212b, 0x214f, 0x2133, 0x2137, 0x213b, 0x2141, + 0x2145, 0x2149, 0x214d, 0x1078, 0x5372, 0x0078, 0x214f, 0x1078, + 0x53b3, 0x0078, 0x214f, 0x1078, 0x5372, 0x1078, 0x53b3, 0x0078, + 0x214f, 0x1078, 0x2151, 0x0078, 0x214f, 0x1078, 0x2151, 0x0078, + 0x214f, 0x1078, 0x2151, 0x0078, 0x214f, 0x1078, 0x2151, 0x127f, + 0x007c, 0x007e, 0x017e, 0x027e, 0x7930, 0xa184, 0x0003, 0x0040, + 0x215d, 0x20e1, 0x9040, 0x0078, 0x2186, 0xa184, 0x0030, 0x0040, + 0x216e, 0x6a00, 0xa286, 0x0003, 0x00c0, 0x2168, 0x0078, 0x216a, + 0x1078, 0x4171, 0x20e1, 0x9010, 0x0078, 0x2186, 0xa184, 0x00c0, + 0x0040, 0x2180, 0x0e7e, 0x037e, 0x047e, 0x057e, 0x2071, 0xa5e1, + 0x1078, 0x1ac6, 0x057f, 0x047f, 0x037f, 0x0e7f, 0x0078, 0x2186, + 0xa184, 0x0300, 0x0040, 0x2186, 0x20e1, 0x9020, 0x7932, 0x027f, + 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e, 0x2071, 0xa300, + 0x7128, 0x2001, 0xa58f, 0x2102, 0x2001, 0xa597, 0x2102, 0xa182, + 0x0211, 0x00c8, 0x219f, 0x2009, 0x0008, 0x0078, 0x21c9, 0xa182, + 0x0259, 0x00c8, 0x21a7, 0x2009, 0x0007, 0x0078, 0x21c9, 0xa182, + 0x02c1, 0x00c8, 0x21af, 0x2009, 0x0006, 0x0078, 0x21c9, 0xa182, + 0x0349, 0x00c8, 0x21b7, 0x2009, 0x0005, 0x0078, 0x21c9, 0xa182, + 0x0421, 0x00c8, 0x21bf, 0x2009, 0x0004, 0x0078, 0x21c9, 0xa182, + 0x0581, 0x00c8, 0x21c7, 0x2009, 0x0003, 0x0078, 0x21c9, 0x2009, + 0x0002, 0x2079, 0x0200, 0x7912, 0x7817, 0x0004, 0x1078, 0x24b5, + 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091, 0x2200, 0x2061, + 0x0100, 0x2071, 0xa300, 0x6024, 0x6026, 0x6053, 0x0030, 0x6033, + 0x00ef, 0x60e7, 0x0000, 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b, + 0xf7f7, 0x6043, 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, + 0x0eaf, 0x600f, 0x00ff, 0x602b, 0x002f, 0x127f, 0x007c, 0x2001, + 0xa32f, 0x2003, 0x0000, 0x2001, 0xa32e, 0x2003, 0x0001, 0x007c, + 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e, 0x6124, 0xa184, + 0x002c, 0x00c0, 0x220f, 0xa184, 0x0007, 0x0079, 0x2215, 0xa195, + 0x0004, 0xa284, 0x0007, 0x0079, 0x2215, 0x2241, 0x221d, 0x2221, + 0x2225, 0x222b, 0x222f, 0x2235, 0x223b, 0x1078, 0x5ad2, 0x0078, + 0x2241, 0x1078, 0x5bc1, 0x0078, 0x2241, 0x1078, 0x5bc1, 0x1078, + 0x5ad2, 0x0078, 0x2241, 0x1078, 0x2246, 0x0078, 0x2241, 0x1078, + 0x5ad2, 0x1078, 0x2246, 0x0078, 0x2241, 0x1078, 0x5bc1, 0x1078, + 0x2246, 0x0078, 0x2241, 0x1078, 0x5bc1, 0x1078, 0x5ad2, 0x1078, + 0x2246, 0x027f, 0x017f, 0x007f, 0x127f, 0x007c, 0x6124, 0xd1ac, + 0x0040, 0x2342, 0x017e, 0x047e, 0x0c7e, 0x644c, 0xa486, 0xf0f0, + 0x00c0, 0x2259, 0x2061, 0x0100, 0x644a, 0x6043, 0x0090, 0x6043, + 0x0010, 0x74c2, 0xa48c, 0xff00, 0x7034, 0xd084, 0x0040, 0x2271, + 0xa186, 0xf800, 0x00c0, 0x2271, 0x7038, 0xd084, 0x00c0, 0x2271, + 0xc085, 0x703a, 0x037e, 0x2418, 0x2011, 0x8016, 0x1078, 0x3579, + 0x037f, 0xa196, 0xff00, 0x0040, 0x22b3, 0x6030, 0xa084, 0x00ff, + 0x810f, 0xa116, 0x0040, 0x22b3, 0x7130, 0xd184, 0x00c0, 0x22b3, + 0x2011, 0xa352, 0x2214, 0xd2ec, 0x0040, 0x228e, 0xc18d, 0x7132, + 0x2011, 0xa352, 0x2214, 0xd2ac, 0x00c0, 0x22b3, 0x6240, 0xa294, + 0x0010, 0x0040, 0x229a, 0x6248, 0xa294, 0xff00, 0xa296, 0xff00, + 0x0040, 0x22b3, 0x7030, 0xd08c, 0x0040, 0x2305, 0x7034, 0xd08c, + 0x00c0, 0x22aa, 0x2001, 0xa30c, 0x200c, 0xd1ac, 0x00c0, 0x2305, + 0xc1ad, 0x2102, 0x037e, 0x73c0, 0x2011, 0x8013, 0x1078, 0x3579, + 0x037f, 0x0078, 0x2305, 0x7034, 0xd08c, 0x00c0, 0x22bf, 0x2001, + 0xa30c, 0x200c, 0xd1ac, 0x00c0, 0x2305, 0xc1ad, 0x2102, 0x037e, + 0x73c0, 0x2011, 0x8013, 0x1078, 0x3579, 0x037f, 0x7130, 0xc185, + 0x7132, 0x2011, 0xa352, 0x220c, 0xd1a4, 0x0040, 0x22e9, 0x017e, + 0x2009, 0x0001, 0x2011, 0x0100, 0x1078, 0x5a6d, 0x2019, 0x000e, + 0x1078, 0x9e3b, 0xa484, 0x00ff, 0xa080, 0x293f, 0x200c, 0xa18c, + 0xff00, 0x810f, 0x8127, 0xa006, 0x2009, 0x000e, 0x1078, 0x9ec0, + 0x017f, 0xd1ac, 0x00c0, 0x22f6, 0x017e, 0x2009, 0x0000, 0x2019, + 0x0004, 0x1078, 0x27e2, 0x017f, 0x0078, 0x2305, 0x157e, 0x20a9, + 0x007f, 0x2009, 0x0000, 0x1078, 0x4501, 0x00c0, 0x2301, 0x1078, + 0x4235, 0x8108, 0x00f0, 0x22fb, 0x157f, 0x0c7f, 0x047f, 0x0f7e, + 0x2079, 0xa5be, 0x783c, 0xa086, 0x0000, 0x0040, 0x2317, 0x6027, + 0x0004, 0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x0000, 0x0f7f, + 0x2011, 0x0003, 0x1078, 0x6ef2, 0x2011, 0x0002, 0x1078, 0x6efc, + 0x1078, 0x6dda, 0x1078, 0x595a, 0x037e, 0x2019, 0x0000, 0x1078, + 0x6e6c, 0x037f, 0x60e3, 0x0000, 0x017f, 0x2001, 0xa300, 0x2014, + 0xa296, 0x0004, 0x00c0, 0x233a, 0xd19c, 0x00c0, 0x233a, 0x6228, + 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0xa321, 0x2003, 0x0000, + 0x6027, 0x0020, 0xd194, 0x0040, 0x2426, 0x0f7e, 0x2079, 0xa5be, + 0x783c, 0xa086, 0x0001, 0x00c0, 0x2366, 0x017e, 0x6027, 0x0004, + 0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x1000, 0x7803, 0x0000, + 0x2079, 0xa5ab, 0x7807, 0x0000, 0x7833, 0x0000, 0x1078, 0x6109, + 0x1078, 0x61d3, 0x017f, 0x0f7f, 0x0078, 0x2426, 0x0f7f, 0x017e, + 0x3900, 0xa082, 0xa6cd, 0x00c8, 0x2371, 0x017e, 0x1078, 0x728a, + 0x017f, 0x6220, 0xd2b4, 0x0040, 0x23dc, 0x1078, 0x595a, 0x1078, + 0x6c41, 0x6027, 0x0004, 0x0f7e, 0x2019, 0xa5b4, 0x2304, 0xa07d, + 0x0040, 0x23b2, 0x7804, 0xa086, 0x0032, 0x00c0, 0x23b2, 0x0d7e, + 0x0c7e, 0x0e7e, 0x2069, 0x0140, 0x618c, 0x6288, 0x7818, 0x608e, + 0x7808, 0x608a, 0x6043, 0x0002, 0x2001, 0x0003, 0x8001, 0x00c0, + 0x2396, 0x6043, 0x0000, 0x6803, 0x1000, 0x6803, 0x0000, 0x618e, + 0x628a, 0x1078, 0x6010, 0x1078, 0x6109, 0x7810, 0x2070, 0x7037, + 0x0103, 0x2f60, 0x1078, 0x753d, 0x0e7f, 0x0c7f, 0x0d7f, 0x0f7f, + 0x017f, 0x007c, 0x0f7f, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, + 0x4000, 0x0040, 0x23bf, 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, + 0x0c7e, 0x2061, 0xa5ab, 0x6028, 0xa09a, 0x00c8, 0x00c8, 0x23cf, + 0x8000, 0x602a, 0x0c7f, 0x1078, 0x6c33, 0x0078, 0x2425, 0x2019, + 0xa5b4, 0x2304, 0xa065, 0x0040, 0x23d9, 0x2009, 0x0027, 0x1078, + 0x756c, 0x0c7f, 0x0078, 0x2425, 0xd2bc, 0x0040, 0x2425, 0x1078, + 0x5967, 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, + 0x6804, 0xa084, 0x4000, 0x0040, 0x23f1, 0x6803, 0x1000, 0x6803, + 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0xa5ab, 0x6044, 0xa09a, 0x00c8, + 0x00c8, 0x2414, 0x8000, 0x6046, 0x603c, 0x0c7f, 0xa005, 0x0040, + 0x2425, 0x2009, 0x07d0, 0x1078, 0x595f, 0xa080, 0x0007, 0x2004, + 0xa086, 0x0006, 0x00c0, 0x2410, 0x6017, 0x0012, 0x0078, 0x2425, + 0x6017, 0x0016, 0x0078, 0x2425, 0x037e, 0x2019, 0x0001, 0x1078, + 0x6e6c, 0x037f, 0x2019, 0xa5ba, 0x2304, 0xa065, 0x0040, 0x2424, + 0x2009, 0x004f, 0x1078, 0x756c, 0x0c7f, 0x017f, 0xd19c, 0x0040, + 0x247c, 0x7034, 0xd0ac, 0x00c0, 0x2457, 0x017e, 0x157e, 0x6027, + 0x0008, 0x602f, 0x0020, 0x20a9, 0x000a, 0x00f0, 0x2435, 0x602f, + 0x0000, 0x6150, 0xa185, 0x1400, 0x6052, 0x20a9, 0x0320, 0x00e0, + 0x243f, 0x2091, 0x6000, 0x6020, 0xd09c, 0x00c0, 0x244e, 0x157f, + 0x6152, 0x017f, 0x6027, 0x0008, 0x0078, 0x247c, 0x1078, 0x250d, + 0x00f0, 0x243f, 0x157f, 0x6152, 0x017f, 0x6027, 0x0008, 0x017e, + 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078, 0x6ef2, 0x2011, + 0x0002, 0x1078, 0x6efc, 0x1078, 0x6dda, 0x1078, 0x595a, 0x037e, + 0x2019, 0x0000, 0x1078, 0x6e6c, 0x037f, 0x60e3, 0x0000, 0x1078, + 0xa22a, 0x1078, 0xa248, 0x2001, 0xa300, 0x2003, 0x0004, 0x6027, + 0x0008, 0x1078, 0x1246, 0x017f, 0xa18c, 0xffd0, 0x6126, 0x007c, + 0x007e, 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091, 0x8000, + 0x2071, 0xa300, 0x71b8, 0x70ba, 0xa116, 0x0040, 0x24ae, 0x81ff, + 0x0040, 0x2498, 0x2011, 0x8011, 0x1078, 0x3579, 0x0078, 0x24ae, + 0x2011, 0x8012, 0x1078, 0x3579, 0x2001, 0xa371, 0x2004, 0xd0fc, + 0x00c0, 0x24ae, 0x037e, 0x0c7e, 0x2061, 0x0100, 0x2019, 0x0028, + 0x2009, 0x0000, 0x1078, 0x27e2, 0x0c7f, 0x037f, 0x127f, 0x0f7f, + 0x0e7f, 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x0f7e, 0x007e, + 0x027e, 0x2061, 0x0100, 0xa190, 0x24d1, 0x2204, 0x60f2, 0x2011, + 0x24de, 0x6000, 0xa082, 0x0003, 0x00c8, 0x24ca, 0x2001, 0x00ff, + 0x0078, 0x24cb, 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f, 0x0c7f, + 0x007c, 0x0840, 0x0840, 0x0840, 0x0580, 0x0420, 0x0348, 0x02c0, + 0x0258, 0x0210, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140, 0x00f8, + 0x00d0, 0x00b0, 0x00a0, 0x2028, 0xa18c, 0x00ff, 0x2130, 0xa094, + 0xff00, 0x00c0, 0x24ee, 0x81ff, 0x0040, 0x24f2, 0x1078, 0x5623, + 0x0078, 0x24f9, 0xa080, 0x293f, 0x200c, 0xa18c, 0xff00, 0x810f, + 0xa006, 0x007c, 0xa080, 0x293f, 0x200c, 0xa18c, 0x00ff, 0x007c, + 0x0c7e, 0x2061, 0xa300, 0x6030, 0x0040, 0x2509, 0xc09d, 0x0078, + 0x250a, 0xc09c, 0x6032, 0x0c7f, 0x007c, 0x007e, 0x157e, 0x0f7e, + 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd08c, 0x00c0, 0x251a, + 0x00f0, 0x2514, 0x0f7f, 0x157f, 0x007f, 0x007c, 0x0c7e, 0x007e, + 0x2061, 0x0100, 0x6030, 0x007e, 0x6048, 0x007e, 0x60e4, 0x007e, + 0x60e8, 0x007e, 0x6050, 0x007e, 0x60f0, 0x007e, 0x60ec, 0x007e, + 0x600c, 0x007e, 0x6004, 0x007e, 0x6028, 0x007e, 0x60e0, 0x007e, + 0x602f, 0x0100, 0x602f, 0x0000, 0x0005, 0x0005, 0x0005, 0x0005, + 0x602f, 0x0040, 0x602f, 0x0000, 0x007f, 0x60e2, 0x007f, 0x602a, + 0x007f, 0x6006, 0x007f, 0x600e, 0x007f, 0x60ee, 0x007f, 0x60f2, + 0x007f, 0x6052, 0x007f, 0x60ea, 0x007f, 0x60e6, 0x007f, 0x604a, + 0x007f, 0x6032, 0x007f, 0x0c7f, 0x007c, 0x257d, 0x2581, 0x2585, + 0x258b, 0x2591, 0x2597, 0x259d, 0x25a5, 0x25ad, 0x25b3, 0x25b9, + 0x25c1, 0x25c9, 0x25d1, 0x25d9, 0x25e3, 0x25ed, 0x25ed, 0x25ed, + 0x25ed, 0x25ed, 0x25ed, 0x25ed, 0x25ed, 0x25ed, 0x25ed, 0x25ed, + 0x25ed, 0x25ed, 0x25ed, 0x25ed, 0x25ed, 0x107e, 0x007e, 0x0078, + 0x2606, 0x107e, 0x007e, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078, + 0x2200, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078, 0x2200, 0x0078, + 0x2606, 0x107e, 0x007e, 0x1078, 0x20de, 0x0078, 0x2606, 0x107e, + 0x007e, 0x1078, 0x20de, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078, + 0x2200, 0x1078, 0x20de, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078, + 0x2200, 0x1078, 0x20de, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078, + 0x2123, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078, 0x2123, 0x0078, + 0x2606, 0x107e, 0x007e, 0x1078, 0x2200, 0x1078, 0x2123, 0x0078, + 0x2606, 0x107e, 0x007e, 0x1078, 0x2200, 0x1078, 0x2123, 0x0078, + 0x2606, 0x107e, 0x007e, 0x1078, 0x20de, 0x1078, 0x2123, 0x0078, + 0x2606, 0x107e, 0x007e, 0x1078, 0x20de, 0x1078, 0x2123, 0x0078, + 0x2606, 0x107e, 0x007e, 0x1078, 0x2200, 0x1078, 0x20de, 0x1078, + 0x2123, 0x0078, 0x2606, 0x107e, 0x007e, 0x1078, 0x2200, 0x1078, + 0x20de, 0x1078, 0x2123, 0x0078, 0x2606, 0x0005, 0x0078, 0x25ed, + 0xb084, 0x003c, 0x8004, 0x8004, 0x0079, 0x25f6, 0x2606, 0x2583, + 0x2587, 0x258d, 0x2593, 0x2599, 0x259f, 0x25a7, 0x25af, 0x25b5, + 0x25bb, 0x25c3, 0x25cb, 0x25d3, 0x25db, 0x25e5, 0x0008, 0x25f0, + 0x007f, 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e, 0x027e, 0x047e, + 0x2021, 0x0000, 0x1078, 0x4897, 0x00c0, 0x2705, 0x70c8, 0xd09c, + 0x0040, 0x2624, 0xd084, 0x00c0, 0x2624, 0xd0bc, 0x00c0, 0x2705, + 0x1078, 0x2709, 0x0078, 0x2705, 0xd094, 0x0040, 0x262b, 0x7093, + 0xffff, 0x0078, 0x2705, 0x2001, 0x010c, 0x203c, 0x7280, 0xd284, + 0x0040, 0x2694, 0xd28c, 0x00c0, 0x2694, 0x037e, 0x7390, 0xa38e, + 0xffff, 0x0040, 0x263e, 0x83ff, 0x00c0, 0x2640, 0x2019, 0x0001, + 0x8314, 0xa2e0, 0xa9c0, 0x2c04, 0xa38c, 0x0001, 0x0040, 0x264d, + 0xa084, 0xff00, 0x8007, 0x0078, 0x264f, 0xa084, 0x00ff, 0xa70e, + 0x0040, 0x2689, 0xa08e, 0x0000, 0x0040, 0x2689, 0xa08e, 0x00ff, + 0x00c0, 0x2666, 0x7230, 0xd284, 0x00c0, 0x268f, 0x7280, 0xc28d, + 0x7282, 0x7093, 0xffff, 0x037f, 0x0078, 0x2694, 0x2009, 0x0000, + 0x1078, 0x24e3, 0x1078, 0x4499, 0x00c0, 0x268c, 0x6004, 0xa084, + 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2683, 0x7030, 0xd08c, 0x0040, + 0x267d, 0x6000, 0xd0bc, 0x0040, 0x2683, 0x1078, 0x271f, 0x0040, + 0x268c, 0x0078, 0x2689, 0x1078, 0x2857, 0x1078, 0x274c, 0x0040, + 0x268c, 0x8318, 0x0078, 0x2640, 0x7392, 0x0078, 0x2691, 0x7093, + 0xffff, 0x037f, 0x0078, 0x2705, 0xa780, 0x293f, 0x203c, 0xa7bc, + 0xff00, 0x873f, 0x2041, 0x007e, 0x7090, 0xa096, 0xffff, 0x00c0, + 0x26a6, 0x2009, 0x0000, 0x28a8, 0x0078, 0x26b2, 0xa812, 0x0048, + 0x26ae, 0x2008, 0xa802, 0x20a8, 0x0078, 0x26b2, 0x7093, 0xffff, + 0x0078, 0x2705, 0x2700, 0x157e, 0x017e, 0xa106, 0x0040, 0x26f9, + 0xc484, 0x1078, 0x4501, 0x0040, 0x26c3, 0x1078, 0x4499, 0x00c0, + 0x2702, 0x0078, 0x26c4, 0xc485, 0x6004, 0xa084, 0x00ff, 0xa086, + 0x0006, 0x00c0, 0x26d3, 0x7030, 0xd08c, 0x0040, 0x26f1, 0x6000, + 0xd0bc, 0x00c0, 0x26f1, 0x7280, 0xd28c, 0x0040, 0x26e9, 0x6004, + 0xa084, 0x00ff, 0xa082, 0x0006, 0x0048, 0x26f9, 0xd484, 0x00c0, + 0x26e5, 0x1078, 0x44bc, 0x0078, 0x26e7, 0x1078, 0x2921, 0x0078, + 0x26f9, 0x1078, 0x2857, 0x1078, 0x274c, 0x0040, 0x2702, 0x0078, + 0x26f9, 0x1078, 0x28ec, 0x0040, 0x26f9, 0x1078, 0x271f, 0x0040, + 0x2702, 0x017f, 0x8108, 0x157f, 0x00f0, 0x26b2, 0x7093, 0xffff, + 0x0078, 0x2705, 0x017f, 0x157f, 0x7192, 0x047f, 0x027f, 0x0c7f, + 0x007c, 0x0c7e, 0x017e, 0x7093, 0x0000, 0x2009, 0x007e, 0x1078, + 0x4499, 0x00c0, 0x271c, 0x1078, 0x2857, 0x1078, 0x274c, 0x0040, + 0x271c, 0x70c8, 0xc0bd, 0x70ca, 0x017f, 0x0c7f, 0x007c, 0x017e, + 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x2001, 0xa356, 0x2004, 0xa084, + 0x00ff, 0x6842, 0x1078, 0x74d7, 0x0040, 0x2747, 0x2d00, 0x601a, + 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x442b, 0x2001, 0x0000, + 0x1078, 0x443f, 0x127e, 0x2091, 0x8000, 0x708c, 0x8000, 0x708e, + 0x127f, 0x2009, 0x0004, 0x1078, 0x756c, 0xa085, 0x0001, 0x0c7f, + 0x0d7f, 0x077f, 0x017f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, + 0x2c68, 0x2001, 0xa356, 0x2004, 0xa084, 0x00ff, 0x6842, 0x1078, + 0x74d7, 0x0040, 0x2785, 0x2d00, 0x601a, 0x6800, 0xc0c4, 0x6802, + 0x68a0, 0xa086, 0x007e, 0x0040, 0x276e, 0x6804, 0xa084, 0x00ff, + 0xa086, 0x0006, 0x00c0, 0x276e, 0x1078, 0x2813, 0x601f, 0x0001, + 0x2001, 0x0000, 0x1078, 0x442b, 0x2001, 0x0002, 0x1078, 0x443f, + 0x127e, 0x2091, 0x8000, 0x708c, 0x8000, 0x708e, 0x127f, 0x2009, + 0x0002, 0x1078, 0x756c, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, + 0x017f, 0x007c, 0x0c7e, 0x027e, 0x2009, 0x0080, 0x1078, 0x4499, + 0x00c0, 0x2798, 0x1078, 0x279b, 0x0040, 0x2798, 0x70cf, 0xffff, + 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, + 0x1078, 0x74d7, 0x0040, 0x27bd, 0x2d00, 0x601a, 0x601f, 0x0001, + 0x2001, 0x0000, 0x1078, 0x442b, 0x2001, 0x0002, 0x1078, 0x443f, + 0x127e, 0x2091, 0x8000, 0x70d0, 0x8000, 0x70d2, 0x127f, 0x2009, + 0x0002, 0x1078, 0x756c, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, + 0x017f, 0x007c, 0x0c7e, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2009, + 0x007f, 0x1078, 0x4499, 0x00c0, 0x27de, 0x2c68, 0x1078, 0x74d7, + 0x0040, 0x27de, 0x2d00, 0x601a, 0x6312, 0x601f, 0x0001, 0x620a, + 0x2009, 0x0022, 0x1078, 0x756c, 0xa085, 0x0001, 0x127f, 0x0d7f, + 0x0c7f, 0x007c, 0x0e7e, 0x0c7e, 0x067e, 0x037e, 0x027e, 0x1078, + 0x5d60, 0x1078, 0x5d02, 0x1078, 0x7ddf, 0x2130, 0x81ff, 0x0040, + 0x27f7, 0x20a9, 0x007e, 0x2009, 0x0000, 0x0078, 0x27fb, 0x20a9, + 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x4501, 0x00c0, 0x2804, + 0x1078, 0x471b, 0x1078, 0x4235, 0x017f, 0x8108, 0x00f0, 0x27fb, + 0x86ff, 0x00c0, 0x280d, 0x1078, 0x119b, 0x027f, 0x037f, 0x067f, + 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e, + 0x6218, 0x2270, 0x72a0, 0x027e, 0x2019, 0x0029, 0x1078, 0x5d53, + 0x077e, 0x2039, 0x0000, 0x1078, 0x5c78, 0x2c08, 0x1078, 0x9c38, + 0x077f, 0x017f, 0x2e60, 0x1078, 0x471b, 0x6210, 0x6314, 0x1078, + 0x4235, 0x6212, 0x6316, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, + 0x007c, 0x0e7e, 0x007e, 0x6018, 0xa080, 0x0028, 0x2004, 0xd0bc, + 0x00c0, 0x284d, 0x2071, 0xa300, 0x708c, 0xa005, 0x0040, 0x284a, + 0x8001, 0x708e, 0x007f, 0x0e7f, 0x007c, 0x2071, 0xa300, 0x70d0, + 0xa005, 0x0040, 0x284a, 0x8001, 0x70d2, 0x0078, 0x284a, 0x6000, + 0xc08c, 0x6002, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x037e, 0x027e, + 0x017e, 0x157e, 0x2178, 0x81ff, 0x00c0, 0x286a, 0x20a9, 0x0001, + 0x0078, 0x2885, 0x2001, 0xa352, 0x2004, 0xd0c4, 0x0040, 0x2881, + 0xd0a4, 0x0040, 0x2881, 0x047e, 0x6018, 0xa080, 0x0028, 0x2024, + 0xa4a4, 0x00ff, 0x8427, 0xa006, 0x2009, 0x002d, 0x1078, 0x9ec0, + 0x047f, 0x20a9, 0x00ff, 0x2011, 0x0000, 0x027e, 0xa28e, 0x007e, + 0x0040, 0x28c9, 0xa28e, 0x007f, 0x0040, 0x28c9, 0xa28e, 0x0080, + 0x0040, 0x28c9, 0xa288, 0xa434, 0x210c, 0x81ff, 0x0040, 0x28c9, + 0x8fff, 0x1040, 0x28d5, 0x0c7e, 0x2160, 0x2001, 0x0001, 0x1078, + 0x48a2, 0x0c7f, 0x2019, 0x0029, 0x1078, 0x5d53, 0x077e, 0x2039, + 0x0000, 0x1078, 0x5c78, 0x0c7e, 0x027e, 0x2160, 0x6204, 0xa294, + 0x00ff, 0xa286, 0x0006, 0x00c0, 0x28b9, 0x6007, 0x0404, 0x0078, + 0x28be, 0x2001, 0x0004, 0x8007, 0xa215, 0x6206, 0x027f, 0x0c7f, + 0x017e, 0x2c08, 0x1078, 0x9c38, 0x017f, 0x077f, 0x2160, 0x1078, + 0x471b, 0x027f, 0x8210, 0x00f0, 0x2885, 0x157f, 0x017f, 0x027f, + 0x037f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x047e, 0x027e, 0x017e, + 0x2001, 0xa352, 0x2004, 0xd0c4, 0x0040, 0x28e8, 0xd0a4, 0x0040, + 0x28e8, 0xa006, 0x2220, 0x8427, 0x2009, 0x0029, 0x1078, 0x9ec0, + 0x017f, 0x027f, 0x047f, 0x007c, 0x017e, 0x027e, 0x037e, 0x0c7e, + 0x7280, 0x82ff, 0x0040, 0x291a, 0xa290, 0xa352, 0x2214, 0xd2ac, + 0x00c0, 0x291a, 0x2100, 0x1078, 0x24fa, 0x81ff, 0x0040, 0x291c, + 0x2019, 0x0001, 0x8314, 0xa2e0, 0xa9c0, 0x2c04, 0xd384, 0x0040, + 0x290e, 0xa084, 0xff00, 0x8007, 0x0078, 0x2910, 0xa084, 0x00ff, + 0xa116, 0x0040, 0x291c, 0xa096, 0x00ff, 0x0040, 0x291a, 0x8318, + 0x0078, 0x2902, 0xa085, 0x0001, 0x0c7f, 0x037f, 0x027f, 0x017f, + 0x007c, 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0xa180, 0xa434, + 0x2004, 0xa065, 0x0040, 0x293b, 0x017e, 0x0c7e, 0x1078, 0x8ec0, + 0x017f, 0x1040, 0x1328, 0x611a, 0x1078, 0x2813, 0x1078, 0x753d, + 0x017f, 0x1078, 0x44bc, 0x127f, 0x0c7f, 0x017f, 0x007c, 0x7eef, + 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9, + 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd, + 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3, + 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2, + 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7, + 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098, + 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, 0x8081, 0x8080, + 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072, + 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067, + 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, 0x8056, 0x8055, + 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b, + 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a, + 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e, + 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, 0x8026, 0x8025, + 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010, + 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, 0x8000, 0x3800, + 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, 0x8000, 0x3400, + 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3300, 0x3200, + 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3100, 0x3000, + 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000, + 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000, + 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, 0x8000, 0x8000, + 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000, + 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, 0x8000, 0x8000, + 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, 0x1500, 0x8000, + 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000, + 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000, + 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, 0x8000, 0x0500, + 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, 0x8000, 0x0100, + 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x8000, + 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, + 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x2071, + 0xa381, 0x7003, 0x0002, 0xa006, 0x7012, 0x7016, 0x703a, 0x703e, + 0x7033, 0xa391, 0x7037, 0xa391, 0x7007, 0x0001, 0x2061, 0xa3d1, + 0x6003, 0x0002, 0x007c, 0x0090, 0x2a66, 0x0068, 0x2a66, 0x2071, + 0xa381, 0x2b78, 0x7818, 0xd084, 0x00c0, 0x2a66, 0x2a60, 0x7820, + 0xa08e, 0x0069, 0x00c0, 0x2b56, 0x0079, 0x2aea, 0x007c, 0x2071, + 0xa381, 0x7004, 0x0079, 0x2a6c, 0x2a70, 0x2a71, 0x2a7b, 0x2a8d, + 0x007c, 0x0090, 0x2a7a, 0x0068, 0x2a7a, 0x2b78, 0x7818, 0xd084, + 0x0040, 0x2a99, 0x007c, 0x2b78, 0x2061, 0xa3d1, 0x6008, 0xa08e, + 0x0100, 0x0040, 0x2a88, 0xa086, 0x0200, 0x0040, 0x2b4e, 0x007c, + 0x7014, 0x2068, 0x2a60, 0x7018, 0x007a, 0x7010, 0x2068, 0x6834, + 0xa086, 0x0103, 0x0040, 0x2a95, 0x007c, 0x2a60, 0x2b78, 0x7018, + 0x007a, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x00c8, 0x2aa2, 0x61b8, + 0x0079, 0x2aaa, 0x2100, 0xa08a, 0x003f, 0x00c8, 0x2b4a, 0x61b8, + 0x0079, 0x2aea, 0x2b2c, 0x2b5e, 0x2b66, 0x2b6a, 0x2b72, 0x2b78, + 0x2b7c, 0x2b88, 0x2b8c, 0x2b96, 0x2b9a, 0x2b4a, 0x2b4a, 0x2b4a, + 0x2b9e, 0x2b4a, 0x2bae, 0x2bc5, 0x2bdc, 0x2c58, 0x2c5d, 0x2c8a, + 0x2ce4, 0x2cf5, 0x2d13, 0x2d54, 0x2d5e, 0x2d6b, 0x2d7e, 0x2d9d, + 0x2da6, 0x2de3, 0x2de9, 0x2b4a, 0x2e05, 0x2b4a, 0x2b4a, 0x2b4a, + 0x2b4a, 0x2b4a, 0x2e0c, 0x2e16, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, + 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2e1e, 0x2b4a, 0x2b4a, 0x2b4a, + 0x2b4a, 0x2b4a, 0x2e30, 0x2e47, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, + 0x2b4a, 0x2b4a, 0x2e59, 0x2eb0, 0x2f0e, 0x2f1f, 0x2b4a, 0x2b4a, + 0x2b4a, 0x38f1, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, + 0x2b4a, 0x2b4a, 0x2b96, 0x2b9a, 0x2f36, 0x2b4a, 0x2f43, 0x397d, + 0x39da, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, + 0x2b4a, 0x2b4a, 0x2f90, 0x30c5, 0x30e1, 0x30ed, 0x3150, 0x31a9, + 0x31b4, 0x31f3, 0x3202, 0x3211, 0x3214, 0x2f47, 0x3238, 0x3284, + 0x3291, 0x33a2, 0x34cd, 0x34f7, 0x3604, 0x3614, 0x3621, 0x365b, + 0x372a, 0x2b4a, 0x2b4a, 0x2b4a, 0x2b4a, 0x3792, 0x37ae, 0x3828, + 0x38e2, 0x713c, 0x0078, 0x2b2c, 0x2021, 0x4000, 0x1078, 0x3553, + 0x127e, 0x2091, 0x8000, 0x0068, 0x2b39, 0x7818, 0xd084, 0x0040, + 0x2b3c, 0x127f, 0x0078, 0x2b30, 0x7c22, 0x7926, 0x7a2a, 0x7b2e, + 0x781b, 0x0001, 0x2091, 0x4080, 0x7007, 0x0001, 0x2091, 0x5000, + 0x127f, 0x007c, 0x2021, 0x4001, 0x0078, 0x2b2e, 0x2021, 0x4002, + 0x0078, 0x2b2e, 0x2021, 0x4003, 0x0078, 0x2b2e, 0x2021, 0x4005, + 0x0078, 0x2b2e, 0x2021, 0x4006, 0x0078, 0x2b2e, 0xa02e, 0x2520, + 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078, 0x3562, 0x7823, 0x0004, + 0x7824, 0x007a, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, + 0x0078, 0x3566, 0x7924, 0x7828, 0x2114, 0x200a, 0x0078, 0x2b2c, + 0x7924, 0x2114, 0x0078, 0x2b2c, 0x2099, 0x0009, 0x20a1, 0x0009, + 0x20a9, 0x0007, 0x53a3, 0x7924, 0x7a28, 0x7b2c, 0x0078, 0x2b2c, + 0x7824, 0x2060, 0x0078, 0x2ba0, 0x2009, 0x0001, 0x2011, 0x0013, + 0x2019, 0x0010, 0x783b, 0x0017, 0x0078, 0x2b2c, 0x7d38, 0x7c3c, + 0x0078, 0x2b60, 0x7d38, 0x7c3c, 0x0078, 0x2b6c, 0x2061, 0x1000, + 0x610c, 0xa006, 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0, 0x2ba2, + 0x2010, 0xa005, 0x0040, 0x2b2c, 0x0078, 0x2b52, 0x2069, 0xa351, + 0x7824, 0x7930, 0xa11a, 0x00c8, 0x2b5a, 0x8019, 0x0040, 0x2b5a, + 0x684a, 0x6942, 0x782c, 0x6852, 0x7828, 0x6856, 0xa006, 0x685a, + 0x685e, 0x1078, 0x4dbd, 0x0078, 0x2b2c, 0x2069, 0xa351, 0x7824, + 0x7934, 0xa11a, 0x00c8, 0x2b5a, 0x8019, 0x0040, 0x2b5a, 0x684e, + 0x6946, 0x782c, 0x6862, 0x7828, 0x6866, 0xa006, 0x686a, 0x686e, + 0x1078, 0x494d, 0x0078, 0x2b2c, 0xa02e, 0x2520, 0x81ff, 0x00c0, + 0x2b56, 0x7924, 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1, 0xa388, + 0x41a1, 0x1078, 0x3518, 0x0040, 0x2b56, 0x2009, 0x0020, 0x1078, + 0x3562, 0x701b, 0x2bf4, 0x007c, 0x6834, 0x2008, 0xa084, 0x00ff, + 0xa096, 0x0011, 0x0040, 0x2c00, 0xa096, 0x0019, 0x00c0, 0x2b56, + 0x810f, 0xa18c, 0x00ff, 0x0040, 0x2b56, 0x710e, 0x700c, 0x8001, + 0x0040, 0x2c31, 0x700e, 0x1078, 0x3518, 0x0040, 0x2b56, 0x2009, + 0x0020, 0x2061, 0xa3d1, 0x6224, 0x6328, 0x642c, 0x6530, 0xa290, + 0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x1078, + 0x3562, 0x701b, 0x2c24, 0x007c, 0x6834, 0xa084, 0x00ff, 0xa096, + 0x0002, 0x0040, 0x2c2f, 0xa096, 0x000a, 0x00c0, 0x2b56, 0x0078, + 0x2c06, 0x7010, 0x2068, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x436e, + 0x00c0, 0x2c3f, 0x7007, 0x0003, 0x701b, 0x2c41, 0x007c, 0x1078, + 0x4a60, 0x127e, 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099, 0xa388, + 0x530a, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, + 0x0000, 0xad80, 0x000d, 0x2009, 0x0020, 0x127f, 0x0078, 0x3566, + 0x61a0, 0x7824, 0x60a2, 0x0078, 0x2b2c, 0x2091, 0x8000, 0x7823, + 0x4000, 0x7827, 0x4953, 0x782b, 0x5020, 0x782f, 0x2020, 0x2009, + 0x017f, 0x2104, 0x7832, 0x3f00, 0x7836, 0x2061, 0x0100, 0x6200, + 0x2061, 0x0200, 0x603c, 0x8007, 0xa205, 0x783a, 0x2009, 0x04fd, + 0x2104, 0x783e, 0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, + 0x2071, 0x0010, 0x20c1, 0x00f0, 0xa08a, 0x0003, 0x00c8, 0x0427, + 0x0078, 0x0423, 0x81ff, 0x00c0, 0x2b56, 0x7924, 0x810f, 0xa18c, + 0x00ff, 0x1078, 0x4501, 0x00c0, 0x2b5a, 0x7e38, 0xa684, 0x3fff, + 0xa082, 0x4000, 0x0048, 0x2c9e, 0x0078, 0x2b5a, 0x7c28, 0x7d2c, + 0x1078, 0x46d6, 0xd28c, 0x00c0, 0x2ca9, 0x1078, 0x466a, 0x0078, + 0x2cab, 0x1078, 0x46a4, 0x00c0, 0x2cd5, 0x2061, 0xaa00, 0x127e, + 0x2091, 0x8000, 0x6000, 0xa086, 0x0000, 0x0040, 0x2cc3, 0x6010, + 0xa06d, 0x0040, 0x2cc3, 0x683c, 0xa406, 0x00c0, 0x2cc3, 0x6840, + 0xa506, 0x0040, 0x2cce, 0x127f, 0xace0, 0x0010, 0x2001, 0xa315, + 0x2004, 0xac02, 0x00c8, 0x2b56, 0x0078, 0x2caf, 0x1078, 0x8758, + 0x127f, 0x0040, 0x2b56, 0x0078, 0x2b2c, 0xa00e, 0x2001, 0x0005, + 0x1078, 0x4a60, 0x127e, 0x2091, 0x8000, 0x1078, 0x8cc0, 0x1078, + 0x4982, 0x127f, 0x0078, 0x2b2c, 0x81ff, 0x00c0, 0x2b56, 0x1078, + 0x3530, 0x0040, 0x2b5a, 0x1078, 0x45a7, 0x0040, 0x2b56, 0x1078, + 0x46e4, 0x0040, 0x2b56, 0x0078, 0x2b2c, 0x81ff, 0x00c0, 0x2b56, + 0x1078, 0x3542, 0x0040, 0x2b5a, 0x1078, 0x475f, 0x0040, 0x2b56, + 0x2019, 0x0005, 0x1078, 0x4705, 0x0040, 0x2b56, 0x7828, 0xa08a, + 0x1000, 0x00c8, 0x2b5a, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, + 0x58e1, 0x0078, 0x2b2c, 0x127e, 0x2091, 0x8000, 0x81ff, 0x0040, + 0x2d1d, 0x2009, 0x0001, 0x0078, 0x2d4e, 0x2029, 0x00ff, 0x644c, + 0x2400, 0xa506, 0x0040, 0x2d48, 0x2508, 0x1078, 0x4501, 0x00c0, + 0x2d48, 0x1078, 0x475f, 0x00c0, 0x2d33, 0x2009, 0x0002, 0x62a8, + 0x2518, 0x0078, 0x2d4e, 0x2019, 0x0004, 0x1078, 0x4705, 0x00c0, + 0x2d3d, 0x2009, 0x0006, 0x0078, 0x2d4e, 0x7824, 0xa08a, 0x1000, + 0x00c8, 0x2d51, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x58e1, + 0x8529, 0x00c8, 0x2d20, 0x127f, 0x0078, 0x2b2c, 0x127f, 0x0078, + 0x2b56, 0x127f, 0x0078, 0x2b5a, 0x1078, 0x3530, 0x0040, 0x2b5a, + 0x1078, 0x461b, 0x1078, 0x46d6, 0x0078, 0x2b2c, 0x81ff, 0x00c0, + 0x2b56, 0x1078, 0x3530, 0x0040, 0x2b5a, 0x1078, 0x460a, 0x1078, + 0x46d6, 0x0078, 0x2b2c, 0x81ff, 0x00c0, 0x2b56, 0x1078, 0x3530, + 0x0040, 0x2b5a, 0x1078, 0x46a7, 0x0040, 0x2b56, 0x1078, 0x43c1, + 0x1078, 0x4663, 0x1078, 0x46d6, 0x0078, 0x2b2c, 0x1078, 0x3530, + 0x0040, 0x2b5a, 0x1078, 0x45a7, 0x0040, 0x2b56, 0x62a0, 0x2019, + 0x0005, 0x0c7e, 0x1078, 0x471b, 0x0c7f, 0x1078, 0x5d53, 0x077e, + 0x2039, 0x0000, 0x1078, 0x5c78, 0x2009, 0x0000, 0x1078, 0x9c38, + 0x077f, 0x1078, 0x46d6, 0x0078, 0x2b2c, 0x1078, 0x3530, 0x0040, + 0x2b5a, 0x1078, 0x46d6, 0x2208, 0x0078, 0x2b2c, 0x157e, 0x0d7e, + 0x0e7e, 0x2069, 0xa413, 0x6810, 0x6914, 0xa10a, 0x00c8, 0x2db2, + 0x2009, 0x0000, 0x6816, 0x2011, 0x0000, 0x2019, 0x0000, 0x20a9, + 0x00ff, 0x2069, 0xa434, 0x2d04, 0xa075, 0x0040, 0x2dc7, 0x704c, + 0x1078, 0x2dd1, 0xa210, 0x7080, 0x1078, 0x2dd1, 0xa318, 0x8d68, + 0x00f0, 0x2dbb, 0x2300, 0xa218, 0x0e7f, 0x0d7f, 0x157f, 0x0078, + 0x2b2c, 0x0f7e, 0x017e, 0xa07d, 0x0040, 0x2de0, 0x2001, 0x0000, + 0x8000, 0x2f0c, 0x81ff, 0x0040, 0x2de0, 0x2178, 0x0078, 0x2dd8, + 0x017f, 0x0f7f, 0x007c, 0x2069, 0xa413, 0x6910, 0x62a4, 0x0078, + 0x2b2c, 0x81ff, 0x00c0, 0x2b56, 0x614c, 0xa190, 0x293f, 0x2214, + 0xa294, 0x00ff, 0x606c, 0xa084, 0xff00, 0xa215, 0x6368, 0x67c8, + 0xd79c, 0x0040, 0x2dff, 0x2031, 0x0001, 0x0078, 0x2e01, 0x2031, + 0x0000, 0x7e3a, 0x7f3e, 0x0078, 0x2b2c, 0x613c, 0x6240, 0x2019, + 0xa5a0, 0x231c, 0x0078, 0x2b2c, 0x127e, 0x2091, 0x8000, 0x6134, + 0xa006, 0x2010, 0x2018, 0x127f, 0x0078, 0x2b2c, 0x1078, 0x3542, + 0x0040, 0x2b5a, 0x6244, 0x6338, 0x0078, 0x2b2c, 0x613c, 0x6240, + 0x7824, 0x603e, 0x7b28, 0x6342, 0x2069, 0xa351, 0x831f, 0xa305, + 0x6816, 0x782c, 0x2069, 0xa5a0, 0x2d1c, 0x206a, 0x0078, 0x2b2c, + 0x017e, 0x127e, 0x2091, 0x8000, 0x7824, 0x6036, 0xd094, 0x0040, + 0x2e43, 0x7828, 0xa085, 0x0001, 0x2009, 0xa5a9, 0x200a, 0x2001, + 0xffff, 0x1078, 0x5975, 0x127f, 0x017f, 0x0078, 0x2b2c, 0x1078, + 0x3542, 0x0040, 0x2b5a, 0x7828, 0xa00d, 0x0040, 0x2b5a, 0x782c, + 0xa005, 0x0040, 0x2b5a, 0x6244, 0x6146, 0x6338, 0x603a, 0x0078, + 0x2b2c, 0x2001, 0xa300, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2b56, + 0x0c7e, 0x2061, 0x0100, 0x7924, 0x810f, 0xa18c, 0x00ff, 0xa196, + 0x00ff, 0x00c0, 0x2e70, 0x6030, 0xa085, 0xff00, 0x0078, 0x2e7f, + 0xa182, 0x007f, 0x00c8, 0x2ea9, 0xa188, 0x293f, 0x210c, 0xa18c, + 0x00ff, 0x6030, 0xa116, 0x0040, 0x2ea9, 0x810f, 0xa105, 0x127e, + 0x2091, 0x8000, 0x007e, 0x1078, 0x74d7, 0x007f, 0x0040, 0x2ea5, + 0x601a, 0x600b, 0xbc09, 0x601f, 0x0001, 0x1078, 0x3518, 0x0040, + 0x2eac, 0x6837, 0x0000, 0x7007, 0x0003, 0x6833, 0x0000, 0x6838, + 0xc0fd, 0x683a, 0x701b, 0x2f07, 0x2d00, 0x6012, 0x2009, 0x0032, + 0x1078, 0x756c, 0x127f, 0x0c7f, 0x007c, 0x127f, 0x0c7f, 0x0078, + 0x2b56, 0x0c7f, 0x0078, 0x2b5a, 0x1078, 0x753d, 0x0078, 0x2ea5, + 0x2001, 0xa300, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2b56, 0x0c7e, + 0x2061, 0x0100, 0x7924, 0x810f, 0xa18c, 0x00ff, 0xa196, 0x00ff, + 0x00c0, 0x2ec7, 0x6030, 0xa085, 0xff00, 0x0078, 0x2ed6, 0xa182, + 0x007f, 0x00c8, 0x2f00, 0xa188, 0x293f, 0x210c, 0xa18c, 0x00ff, + 0x6030, 0xa116, 0x0040, 0x2f00, 0x810f, 0xa105, 0x127e, 0x2091, + 0x8000, 0x007e, 0x1078, 0x74d7, 0x007f, 0x0040, 0x2efc, 0x601a, + 0x600b, 0xbc05, 0x601f, 0x0001, 0x1078, 0x3518, 0x0040, 0x2f03, + 0x6837, 0x0000, 0x7007, 0x0003, 0x6833, 0x0000, 0x6838, 0xc0fd, + 0x683a, 0x701b, 0x2f07, 0x2d00, 0x6012, 0x2009, 0x0032, 0x1078, + 0x756c, 0x127f, 0x0c7f, 0x007c, 0x127f, 0x0c7f, 0x0078, 0x2b56, + 0x0c7f, 0x0078, 0x2b5a, 0x1078, 0x753d, 0x0078, 0x2efc, 0x6830, + 0xa086, 0x0100, 0x0040, 0x2b56, 0x0078, 0x2b2c, 0x2061, 0xa62d, + 0x127e, 0x2091, 0x8000, 0x6000, 0xd084, 0x0040, 0x2f1c, 0x6104, + 0x6208, 0x127f, 0x0078, 0x2b2c, 0x127f, 0x0078, 0x2b5a, 0x81ff, + 0x00c0, 0x2b56, 0x127e, 0x2091, 0x8000, 0x6244, 0x6060, 0xa202, + 0x0048, 0x2f33, 0xa085, 0x0001, 0x1078, 0x2500, 0x1078, 0x3bf5, + 0x127f, 0x0078, 0x2b2c, 0x127f, 0x0078, 0x2b5a, 0x127e, 0x2091, + 0x8000, 0x20a9, 0x0011, 0x2001, 0xa340, 0x20a0, 0xa006, 0x40a4, + 0x127f, 0x0078, 0x2b2c, 0x7d38, 0x7c3c, 0x0078, 0x2bde, 0x7824, + 0xa09c, 0x00ff, 0xa39a, 0x0003, 0x00c8, 0x2b56, 0x624c, 0xa084, + 0xff00, 0x8007, 0xa206, 0x00c0, 0x2f5f, 0x2001, 0xa340, 0x2009, + 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x3566, 0x81ff, + 0x00c0, 0x2b56, 0x1078, 0x3542, 0x0040, 0x2b5a, 0x6004, 0xa084, + 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2b56, 0x0c7e, 0x1078, 0x3518, + 0x0c7f, 0x0040, 0x2b56, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, + 0x1078, 0x8b85, 0x0040, 0x2b56, 0x7007, 0x0003, 0x701b, 0x2f81, + 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2b56, 0xad80, 0x000e, + 0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x3566, + 0x1078, 0x3518, 0x0040, 0x2b56, 0x1078, 0x421a, 0x2009, 0x001c, + 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x3562, 0x701b, 0x2fa1, + 0x007c, 0xade8, 0x000d, 0x6800, 0xa005, 0x0040, 0x2b5a, 0x6804, + 0xd0ac, 0x0040, 0x2fae, 0xd0a4, 0x0040, 0x2b5a, 0xd094, 0x0040, + 0x2fb9, 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18c, 0xffdf, 0x6106, + 0x0c7f, 0xd08c, 0x0040, 0x2fc4, 0x0c7e, 0x2061, 0x0100, 0x6104, + 0xa18d, 0x0010, 0x6106, 0x0c7f, 0x2009, 0x0100, 0x210c, 0xa18a, + 0x0002, 0x0048, 0x2fd9, 0xd084, 0x0040, 0x2fd9, 0x6a28, 0xa28a, + 0x007f, 0x00c8, 0x2b5a, 0xa288, 0x293f, 0x210c, 0xa18c, 0x00ff, + 0x6152, 0xd0dc, 0x0040, 0x2fe2, 0x6828, 0xa08a, 0x007f, 0x00c8, + 0x2b5a, 0x604e, 0x6808, 0xa08a, 0x0100, 0x0048, 0x2b5a, 0xa08a, + 0x0841, 0x00c8, 0x2b5a, 0xa084, 0x0007, 0x00c0, 0x2b5a, 0x680c, + 0xa005, 0x0040, 0x2b5a, 0x6810, 0xa005, 0x0040, 0x2b5a, 0x6848, + 0x6940, 0xa10a, 0x00c8, 0x2b5a, 0x8001, 0x0040, 0x2b5a, 0x684c, + 0x6944, 0xa10a, 0x00c8, 0x2b5a, 0x8001, 0x0040, 0x2b5a, 0x6804, + 0xd0fc, 0x0040, 0x3038, 0x1078, 0x3518, 0x0040, 0x2b56, 0x2009, + 0x0014, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0xa290, 0x0038, 0xa399, + 0x0000, 0x1078, 0x3562, 0x701b, 0x301e, 0x007c, 0xade8, 0x000d, + 0x20a9, 0x0014, 0x2d98, 0x2069, 0xa36d, 0x2da0, 0x53a3, 0x7010, + 0xa0e8, 0x000d, 0x2001, 0xa371, 0x200c, 0xd1e4, 0x0040, 0x3038, + 0x0c7e, 0x2061, 0x0100, 0x6004, 0xa085, 0x0b00, 0x6006, 0x0c7f, + 0x20a9, 0x001c, 0x2d98, 0x2069, 0xa351, 0x2da0, 0x53a3, 0x6814, + 0xa08c, 0x00ff, 0x613e, 0x8007, 0xa084, 0x00ff, 0x6042, 0x1078, + 0x4dbd, 0x1078, 0x48dd, 0x1078, 0x494d, 0x6000, 0xa086, 0x0000, + 0x00c0, 0x30c3, 0x6808, 0x602a, 0x1078, 0x218b, 0x6818, 0x691c, + 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a, + 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0040, 0x3070, 0x6830, 0x6934, + 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0078, 0x3072, + 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x1078, 0x59a8, + 0x6904, 0xd1fc, 0x0040, 0x30a5, 0x0c7e, 0x2009, 0x0000, 0x20a9, + 0x0001, 0x6b70, 0xd384, 0x0040, 0x30a2, 0x0078, 0x308c, 0x839d, + 0x00c8, 0x30a2, 0x3508, 0x8109, 0x1078, 0x5364, 0x6878, 0x6016, + 0x6874, 0x2008, 0xa084, 0xff00, 0x8007, 0x600a, 0xa184, 0x00ff, + 0x6006, 0x8108, 0x00c0, 0x30a0, 0x6003, 0x0003, 0x0078, 0x30a2, + 0x6003, 0x0001, 0x00f0, 0x3087, 0x0c7f, 0x0c7e, 0x2061, 0x0100, + 0x602f, 0x0040, 0x602f, 0x0000, 0x0c7f, 0x1078, 0x3784, 0x0040, + 0x30b3, 0x1078, 0x2500, 0x60bc, 0xa005, 0x0040, 0x30bf, 0x6003, + 0x0001, 0x2091, 0x301d, 0x1078, 0x4171, 0x0078, 0x30c3, 0x6003, + 0x0004, 0x2091, 0x301d, 0x0078, 0x2b2c, 0x6000, 0xa086, 0x0000, + 0x0040, 0x2b56, 0x2069, 0xa351, 0x7830, 0x6842, 0x7834, 0x6846, + 0x6804, 0xd0fc, 0x0040, 0x30d8, 0x2009, 0x0030, 0x0078, 0x30da, + 0x2009, 0x001c, 0x2d00, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, + 0x3566, 0xa006, 0x1078, 0x2500, 0x81ff, 0x00c0, 0x2b56, 0x1078, + 0x421a, 0x1078, 0x4171, 0x0078, 0x2b2c, 0x81ff, 0x00c0, 0x2b56, + 0x6180, 0x81ff, 0x0040, 0x3107, 0x703f, 0x0000, 0x2001, 0xa9c0, + 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x127e, 0x2091, + 0x8000, 0x1078, 0x3566, 0x701b, 0x2b29, 0x127f, 0x007c, 0x703f, + 0x0001, 0x0d7e, 0x2069, 0xa9c0, 0x20a9, 0x0040, 0x20a1, 0xa9c0, + 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588, 0x293f, 0x210c, 0xa18c, + 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002, 0x2100, 0xa506, 0x0040, + 0x3139, 0x1078, 0x4501, 0x00c0, 0x3139, 0x6014, 0x821c, 0x0048, + 0x3131, 0xa398, 0xa9c0, 0xa085, 0xff00, 0x8007, 0x201a, 0x0078, + 0x3138, 0xa398, 0xa9c0, 0x2324, 0xa4a4, 0xff00, 0xa405, 0x201a, + 0x8210, 0x8108, 0xa182, 0x0080, 0x00c8, 0x3140, 0x0078, 0x311d, + 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a, 0x0d7f, 0x20a9, 0x0040, + 0x20a1, 0xa9c0, 0x2099, 0xa9c0, 0x1078, 0x41be, 0x0078, 0x30f6, + 0x1078, 0x3542, 0x0040, 0x2b5a, 0x0c7e, 0x1078, 0x3518, 0x0c7f, + 0x00c0, 0x315e, 0x2009, 0x0002, 0x0078, 0x2b56, 0x2001, 0xa352, + 0x2004, 0xd0b4, 0x0040, 0x3185, 0x6000, 0xd08c, 0x00c0, 0x3185, + 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x3185, 0x6837, + 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x8bd9, 0x00c0, 0x317c, + 0x2009, 0x0003, 0x0078, 0x2b56, 0x7007, 0x0003, 0x701b, 0x3181, + 0x007c, 0x1078, 0x3542, 0x0040, 0x2b5a, 0x20a9, 0x002b, 0x2c98, + 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9, 0x0004, 0xac80, 0x0006, + 0x2098, 0xad80, 0x0006, 0x20a0, 0x1078, 0x41be, 0x20a9, 0x0004, + 0xac80, 0x000a, 0x2098, 0xad80, 0x000a, 0x20a0, 0x1078, 0x41be, + 0x2d00, 0x2009, 0x002b, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, + 0x3566, 0x81ff, 0x00c0, 0x2b56, 0x1078, 0x3530, 0x0040, 0x2b5a, + 0x1078, 0x46ef, 0x0078, 0x2b2c, 0x81ff, 0x00c0, 0x2b56, 0x7828, + 0xa08a, 0x1000, 0x00c8, 0x2b5a, 0x1078, 0x3542, 0x0040, 0x2b5a, + 0x1078, 0x475f, 0x0040, 0x2b56, 0x2019, 0x0004, 0x1078, 0x4705, + 0x7924, 0x810f, 0x7a28, 0x1078, 0x31cf, 0x0078, 0x2b2c, 0xa186, + 0x00ff, 0x0040, 0x31d7, 0x1078, 0x31e7, 0x0078, 0x31e6, 0x2029, + 0x007e, 0x2061, 0xa300, 0x644c, 0x2400, 0xa506, 0x0040, 0x31e3, + 0x2508, 0x1078, 0x31e7, 0x8529, 0x00c8, 0x31dc, 0x007c, 0x1078, + 0x4501, 0x00c0, 0x31f2, 0x2200, 0x8003, 0x800b, 0x810b, 0xa108, + 0x1078, 0x58e1, 0x007c, 0x81ff, 0x00c0, 0x2b56, 0x1078, 0x3530, + 0x0040, 0x2b5a, 0x1078, 0x45a7, 0x0040, 0x2b56, 0x1078, 0x46fa, + 0x0078, 0x2b2c, 0x81ff, 0x00c0, 0x2b56, 0x1078, 0x3530, 0x0040, + 0x2b5a, 0x1078, 0x45a7, 0x0040, 0x2b56, 0x1078, 0x46e4, 0x0078, + 0x2b2c, 0x6100, 0x0078, 0x2b2c, 0x1078, 0x3542, 0x0040, 0x2b5a, + 0x2001, 0xa300, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2b56, 0x0d7e, + 0xace8, 0x000a, 0x7924, 0xd184, 0x0040, 0x3228, 0xace8, 0x0006, + 0x680c, 0x8007, 0x783e, 0x6808, 0x8007, 0x783a, 0x6b04, 0x831f, + 0x6a00, 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200, 0x0078, 0x2b2c, + 0xa006, 0x1078, 0x2500, 0x7824, 0xa084, 0x00ff, 0xa086, 0x00ff, + 0x0040, 0x3245, 0x81ff, 0x00c0, 0x2b56, 0x1078, 0x421a, 0x7828, + 0xa08a, 0x1000, 0x00c8, 0x2b5a, 0x7924, 0xa18c, 0xff00, 0x810f, + 0xa186, 0x00ff, 0x0040, 0x325b, 0xa182, 0x007f, 0x00c8, 0x2b5a, + 0x2100, 0x1078, 0x24fa, 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, + 0x2061, 0xa5be, 0x601b, 0x0000, 0x601f, 0x0000, 0x2061, 0x0100, + 0x6030, 0xa084, 0x00ff, 0x810f, 0xa105, 0x604a, 0x6043, 0x0090, + 0x6043, 0x0010, 0x2009, 0x002d, 0x2011, 0x4196, 0x1078, 0x596c, + 0x7924, 0xa18c, 0xff00, 0x810f, 0x7a28, 0x1078, 0x31cf, 0x127f, + 0x0c7f, 0x027f, 0x0078, 0x2b2c, 0x7924, 0xa18c, 0xff00, 0x810f, + 0x0c7e, 0x1078, 0x4499, 0x2c08, 0x0c7f, 0x00c0, 0x2b5a, 0x0078, + 0x2b2c, 0x81ff, 0x0040, 0x3298, 0x2009, 0x0001, 0x0078, 0x2b56, + 0x60c8, 0xd09c, 0x00c0, 0x32a0, 0x2009, 0x0005, 0x0078, 0x2b56, + 0x1078, 0x3518, 0x00c0, 0x32a8, 0x2009, 0x0002, 0x0078, 0x2b56, + 0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x3562, 0x701b, + 0x32b2, 0x007c, 0x2009, 0x0080, 0x1078, 0x4501, 0x00c0, 0x32bf, + 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x0040, 0x32c3, 0x2021, + 0x400a, 0x0078, 0x2b2e, 0x0d7e, 0xade8, 0x000d, 0x6900, 0x6a08, + 0x6b0c, 0x6c10, 0x6d14, 0x6e18, 0x6820, 0xa0be, 0x0100, 0x0040, + 0x3336, 0xa0be, 0x0112, 0x0040, 0x3336, 0xa0be, 0x0113, 0x0040, + 0x3336, 0xa0be, 0x0114, 0x0040, 0x3336, 0xa0be, 0x0117, 0x0040, + 0x3336, 0xa0be, 0x011a, 0x0040, 0x3336, 0xa0be, 0x0121, 0x0040, + 0x332c, 0xa0be, 0x0131, 0x0040, 0x332c, 0xa0be, 0x0171, 0x0040, + 0x3336, 0xa0be, 0x0173, 0x0040, 0x3336, 0xa0be, 0x01a1, 0x00c0, + 0x32fe, 0x6830, 0x8007, 0x6832, 0x0078, 0x333c, 0xa0be, 0x0212, + 0x0040, 0x3332, 0xa0be, 0x0213, 0x0040, 0x3332, 0xa0be, 0x0214, + 0x0040, 0x3324, 0xa0be, 0x0217, 0x0040, 0x331e, 0xa0be, 0x021a, + 0x00c0, 0x3317, 0x6838, 0x8007, 0x683a, 0x0078, 0x3336, 0xa0be, + 0x0300, 0x0040, 0x3336, 0x0d7f, 0x0078, 0x2b5a, 0xad80, 0x0010, + 0x20a9, 0x0007, 0x1078, 0x337e, 0xad80, 0x000e, 0x20a9, 0x0001, + 0x1078, 0x337e, 0x0078, 0x3336, 0xad80, 0x000c, 0x1078, 0x338c, + 0x0078, 0x333c, 0xad80, 0x000e, 0x1078, 0x338c, 0xad80, 0x000c, + 0x20a9, 0x0001, 0x1078, 0x337e, 0x0c7e, 0x1078, 0x3518, 0x0040, + 0x336f, 0x6838, 0xc0fd, 0x683a, 0x6837, 0x0119, 0x6853, 0x0000, + 0x684f, 0x0020, 0x685b, 0x0001, 0x810b, 0x697e, 0x6883, 0x0000, + 0x6a86, 0x6b8a, 0x6c8e, 0x6d92, 0x6996, 0x689b, 0x0000, 0x0c7f, + 0x0d7f, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x6823, 0x0000, + 0x6804, 0x2068, 0x1078, 0x8ba1, 0x00c0, 0x336a, 0x2009, 0x0003, + 0x0078, 0x2b56, 0x7007, 0x0003, 0x701b, 0x3375, 0x007c, 0x0c7f, + 0x0d7f, 0x2009, 0x0002, 0x0078, 0x2b56, 0x6820, 0xa086, 0x8001, + 0x00c0, 0x2b2c, 0x2009, 0x0004, 0x0078, 0x2b56, 0x017e, 0x2008, + 0x2044, 0x8000, 0x204c, 0x8000, 0x290a, 0x8108, 0x280a, 0x8108, + 0x00f0, 0x3380, 0x017f, 0x007c, 0x017e, 0x0a7e, 0x0b7e, 0x2008, + 0x2044, 0x8000, 0x204c, 0x8000, 0x2054, 0x8000, 0x205c, 0x2b0a, + 0x8108, 0x2a0a, 0x8108, 0x290a, 0x8108, 0x280a, 0x0b7f, 0x0a7f, + 0x017f, 0x007c, 0x81ff, 0x0040, 0x33a9, 0x2009, 0x0001, 0x0078, + 0x2b56, 0x7924, 0x2140, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0080, + 0x0048, 0x2b5a, 0xa182, 0x00ff, 0x00c8, 0x2b5a, 0x7a2c, 0x7b28, + 0x6068, 0xa306, 0x00c0, 0x33c4, 0x606c, 0xa24e, 0x0040, 0x2b5a, + 0xa9cc, 0xff00, 0x0040, 0x2b5a, 0x0c7e, 0x1078, 0x346d, 0x2c68, + 0x0c7f, 0x0040, 0x33fc, 0xa0c6, 0x4000, 0x00c0, 0x33e2, 0x0c7e, + 0x007e, 0x2d60, 0x2009, 0x0000, 0x1078, 0x47cb, 0x00c0, 0x33d9, + 0xc185, 0x6000, 0xd0bc, 0x0040, 0x33de, 0xc18d, 0x007f, 0x0c7f, + 0x0078, 0x33f9, 0xa0c6, 0x4007, 0x00c0, 0x33e9, 0x2408, 0x0078, + 0x33f9, 0xa0c6, 0x4008, 0x00c0, 0x33f1, 0x2708, 0x2610, 0x0078, + 0x33f9, 0xa0c6, 0x4009, 0x00c0, 0x33f7, 0x0078, 0x33f9, 0x2001, + 0x4006, 0x2020, 0x0078, 0x2b2e, 0x2d00, 0x7022, 0x017e, 0x0b7e, + 0x0c7e, 0x0e7e, 0x2c70, 0x1078, 0x74d7, 0x0040, 0x3442, 0x2d00, + 0x601a, 0x2001, 0xa356, 0x2004, 0xa084, 0x00ff, 0x6842, 0x2e58, + 0x0e7f, 0x0e7e, 0x0c7e, 0x1078, 0x3518, 0x0c7f, 0x2b70, 0x00c0, + 0x3423, 0x1078, 0x753d, 0x0e7f, 0x0c7f, 0x0b7f, 0x017f, 0x2009, + 0x0002, 0x0078, 0x2b56, 0x6837, 0x0000, 0x2d00, 0x6012, 0x6833, + 0x0000, 0x6838, 0xc0fd, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, + 0x2813, 0x127f, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x442b, + 0x2001, 0x0002, 0x1078, 0x443f, 0x2009, 0x0002, 0x1078, 0x756c, + 0xa085, 0x0001, 0x0e7f, 0x0c7f, 0x0b7f, 0x017f, 0x00c0, 0x344c, + 0x2009, 0x0003, 0x0078, 0x2b56, 0x7007, 0x0003, 0x701b, 0x3451, + 0x007c, 0x6830, 0xa086, 0x0100, 0x7020, 0x2060, 0x00c0, 0x345f, + 0x2009, 0x0004, 0x6204, 0xa294, 0x00ff, 0x0078, 0x2b56, 0x2009, + 0x0000, 0x1078, 0x47cb, 0x00c0, 0x3466, 0xc185, 0x6000, 0xd0bc, + 0x0040, 0x346b, 0xc18d, 0x0078, 0x2b2c, 0x0e7e, 0x0d7e, 0x2029, + 0x0000, 0x2021, 0x0080, 0x20a9, 0x007f, 0x2071, 0xa4b4, 0x2e04, + 0xa005, 0x00c0, 0x3482, 0x2100, 0xa406, 0x00c0, 0x34b3, 0x2428, + 0x0078, 0x34b3, 0x2068, 0x6f10, 0x2700, 0xa306, 0x00c0, 0x34a4, + 0x6e14, 0x2600, 0xa206, 0x00c0, 0x34a4, 0x2400, 0xa106, 0x00c0, + 0x34a0, 0x2d60, 0xd884, 0x0040, 0x34c8, 0x6004, 0xa084, 0x00ff, + 0xa086, 0x0006, 0x00c0, 0x34c8, 0x2001, 0x4000, 0x0078, 0x34c9, + 0x2001, 0x4007, 0x0078, 0x34c9, 0x2400, 0xa106, 0x00c0, 0x34b3, + 0x6e14, 0x87ff, 0x00c0, 0x34af, 0x86ff, 0x0040, 0x347f, 0x2001, + 0x4008, 0x0078, 0x34c9, 0x8420, 0x8e70, 0x00f0, 0x3477, 0x85ff, + 0x00c0, 0x34c2, 0x2001, 0x4009, 0x0078, 0x34c9, 0x2001, 0x0001, + 0x0078, 0x34c9, 0x1078, 0x4499, 0x00c0, 0x34be, 0x6312, 0x6216, + 0xa006, 0xa005, 0x0d7f, 0x0e7f, 0x007c, 0x81ff, 0x00c0, 0x2b56, + 0x1078, 0x3518, 0x0040, 0x2b56, 0x6837, 0x0000, 0x6838, 0xc0fd, + 0x683a, 0x7824, 0xa005, 0x0040, 0x2b5a, 0xa096, 0x00ff, 0x0040, + 0x34e5, 0xa092, 0x0004, 0x00c8, 0x2b5a, 0x2010, 0x2d18, 0x1078, + 0x27c2, 0x0040, 0x2b56, 0x7007, 0x0003, 0x701b, 0x34f0, 0x007c, + 0x6830, 0xa086, 0x0100, 0x0040, 0x2b56, 0x0078, 0x2b2c, 0x7924, + 0xa18c, 0xff00, 0x810f, 0xa182, 0x0080, 0x0048, 0x2b5a, 0xa182, + 0x00ff, 0x00c8, 0x2b5a, 0x127e, 0x2091, 0x8000, 0x1078, 0x8a89, + 0x00c0, 0x3515, 0xa190, 0xa434, 0x2204, 0xa065, 0x0040, 0x3515, + 0x1078, 0x4235, 0x127f, 0x0078, 0x2b2c, 0x127f, 0x0078, 0x2b56, + 0x1078, 0x1381, 0x0040, 0x352f, 0xa006, 0x6802, 0x7010, 0xa005, + 0x00c0, 0x3527, 0x2d00, 0x7012, 0x7016, 0x0078, 0x352d, 0x7014, + 0x6802, 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80, 0x000d, 0x007c, + 0x7924, 0x810f, 0xa18c, 0x00ff, 0x1078, 0x4501, 0x00c0, 0x353f, + 0x7e28, 0xa684, 0x3fff, 0xa082, 0x4000, 0x0048, 0x3540, 0xa066, + 0x8cff, 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x1078, 0x4501, + 0x00c0, 0x3550, 0xa6b4, 0x00ff, 0xa682, 0x4000, 0x0048, 0x3551, + 0xa066, 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff, 0x0040, 0x355e, + 0x2168, 0x6904, 0x1078, 0x139a, 0x0078, 0x3555, 0x7112, 0x7116, + 0x017f, 0x007c, 0x2031, 0x0001, 0x0078, 0x3568, 0x2031, 0x0000, + 0x2061, 0xa3d1, 0x6606, 0x6112, 0x600e, 0x6226, 0x632a, 0x642e, + 0x6532, 0x2c10, 0x1078, 0x13d1, 0x7007, 0x0002, 0x701b, 0x2b2c, + 0x007c, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, + 0xa38f, 0x2004, 0xa005, 0x00c0, 0x3594, 0x0068, 0x3594, 0x7818, + 0xd084, 0x00c0, 0x3594, 0x7a22, 0x7b26, 0x7c2a, 0x781b, 0x0001, + 0x2091, 0x4080, 0x0078, 0x35b9, 0x017e, 0x0c7e, 0x0e7e, 0x2071, + 0xa381, 0x7138, 0xa182, 0x0008, 0x0048, 0x35a2, 0x7030, 0x2060, + 0x0078, 0x35b3, 0x7030, 0xa0e0, 0x0008, 0xac82, 0xa3d1, 0x0048, + 0x35ab, 0x2061, 0xa391, 0x2c00, 0x7032, 0x81ff, 0x00c0, 0x35b1, + 0x7036, 0x8108, 0x713a, 0x2262, 0x6306, 0x640a, 0x0e7f, 0x0c7f, + 0x017f, 0x127f, 0x0f7f, 0x007c, 0x0e7e, 0x2071, 0xa381, 0x7038, + 0xa005, 0x0040, 0x35f5, 0x127e, 0x2091, 0x8000, 0x0068, 0x35f4, + 0x0f7e, 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0, 0x35f3, 0x0c7e, + 0x7034, 0x2060, 0x2c04, 0x7822, 0x6004, 0x7826, 0x6008, 0x782a, + 0x781b, 0x0001, 0x2091, 0x4080, 0x7038, 0x8001, 0x703a, 0xa005, + 0x00c0, 0x35e9, 0x7033, 0xa391, 0x7037, 0xa391, 0x0c7f, 0x0078, + 0x35f3, 0xac80, 0x0008, 0xa0fa, 0xa3d1, 0x0048, 0x35f1, 0x2001, + 0xa391, 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f, 0x007c, 0x027e, + 0x2001, 0xa352, 0x2004, 0xd0c4, 0x0040, 0x3602, 0x2011, 0x8014, + 0x1078, 0x3579, 0x027f, 0x007c, 0x81ff, 0x00c0, 0x2b56, 0x127e, + 0x2091, 0x8000, 0x6030, 0xc08d, 0xc085, 0xc0ac, 0x6032, 0x1078, + 0x4171, 0x127f, 0x0078, 0x2b2c, 0x7824, 0x2008, 0xa18c, 0xfffd, + 0x00c0, 0x361f, 0x61d4, 0xa10d, 0x61d6, 0x0078, 0x2b2c, 0x0078, + 0x2b5a, 0x81ff, 0x00c0, 0x2b56, 0x6000, 0xa086, 0x0003, 0x00c0, + 0x2b56, 0x2001, 0xa352, 0x2004, 0xd0ac, 0x00c0, 0x2b56, 0x1078, + 0x3542, 0x0040, 0x2b5a, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, + 0x00c0, 0x363e, 0x7828, 0xa005, 0x0040, 0x2b2c, 0x0c7e, 0x1078, + 0x3518, 0x0c7f, 0x0040, 0x2b56, 0x6837, 0x0000, 0x6833, 0x0000, + 0x6838, 0xc0fd, 0x683a, 0x1078, 0x8c4d, 0x0040, 0x2b56, 0x7007, + 0x0003, 0x701b, 0x3654, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, + 0x2b56, 0x0078, 0x2b2c, 0x2001, 0xa300, 0x2004, 0xa086, 0x0003, + 0x00c0, 0x2b56, 0x7f24, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, + 0x3518, 0x0040, 0x2b56, 0x2009, 0x0000, 0x2031, 0x0000, 0x7023, + 0x0000, 0x702f, 0x0000, 0xad80, 0x0005, 0x7026, 0x20a0, 0x1078, + 0x4501, 0x00c0, 0x36d8, 0x6004, 0xa0c4, 0x00ff, 0xa8c6, 0x0006, + 0x0040, 0x3688, 0xa0c4, 0xff00, 0xa8c6, 0x0600, 0x00c0, 0x36d8, + 0x2001, 0xa352, 0x2004, 0xd0ac, 0x00c0, 0x3695, 0x1078, 0x47cb, + 0x00c0, 0x3695, 0xd79c, 0x0040, 0x36d8, 0xd794, 0x00c0, 0x369b, + 0xd784, 0x0040, 0x36a7, 0xac80, 0x0006, 0x2098, 0x3400, 0x20a9, + 0x0004, 0x53a3, 0x1078, 0x338c, 0xd794, 0x0040, 0x36b0, 0xac80, + 0x000a, 0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3, 0x1078, 0x338c, + 0x21a2, 0xd794, 0x0040, 0x36d0, 0xac80, 0x0000, 0x2098, 0x94a0, + 0x20a9, 0x0002, 0x53a3, 0xac80, 0x0003, 0x20a6, 0x94a0, 0xac80, + 0x0004, 0x2098, 0x3400, 0x20a9, 0x0002, 0x53a3, 0x1078, 0x337e, + 0xac80, 0x0026, 0x2098, 0x20a9, 0x0002, 0x53a3, 0x0078, 0x36d1, + 0x94a0, 0xd794, 0x0040, 0x36d6, 0xa6b0, 0x000b, 0xa6b0, 0x0005, + 0x8108, 0xd78c, 0x0040, 0x36e2, 0xa186, 0x0100, 0x0040, 0x36f3, + 0x0078, 0x36e6, 0xa186, 0x007e, 0x0040, 0x36f3, 0xd794, 0x0040, + 0x36ed, 0xa686, 0x0020, 0x0078, 0x36ef, 0xa686, 0x0028, 0x0040, + 0x36fc, 0x0078, 0x3677, 0x86ff, 0x00c0, 0x36fa, 0x7120, 0x810b, + 0x0078, 0x2b2c, 0x702f, 0x0001, 0x711e, 0x7020, 0xa600, 0x7022, + 0x772a, 0x2061, 0xa3d1, 0x6007, 0x0000, 0x6612, 0x7024, 0x600e, + 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078, 0x13d1, 0x7007, + 0x0002, 0x701b, 0x3714, 0x007c, 0x702c, 0xa005, 0x00c0, 0x3726, + 0x711c, 0x7024, 0x20a0, 0x7728, 0x2031, 0x0000, 0x2061, 0xa3d1, + 0x6224, 0x6328, 0x642c, 0x6530, 0x0078, 0x3677, 0x7120, 0x810b, + 0x0078, 0x2b2c, 0x2029, 0x007e, 0x7924, 0x7a28, 0x7b2c, 0x7c38, + 0xa184, 0xff00, 0x8007, 0xa0e2, 0x0020, 0x0048, 0x2b5a, 0xa502, + 0x0048, 0x2b5a, 0xa184, 0x00ff, 0xa0e2, 0x0020, 0x0048, 0x2b5a, + 0xa502, 0x0048, 0x2b5a, 0xa284, 0xff00, 0x8007, 0xa0e2, 0x0020, + 0x0048, 0x2b5a, 0xa502, 0x0048, 0x2b5a, 0xa284, 0x00ff, 0xa0e2, + 0x0020, 0x0048, 0x2b5a, 0xa502, 0x0048, 0x2b5a, 0xa384, 0xff00, + 0x8007, 0xa0e2, 0x0020, 0x0048, 0x2b5a, 0xa502, 0x0048, 0x2b5a, + 0xa384, 0x00ff, 0xa0e2, 0x0020, 0x0048, 0x2b5a, 0xa502, 0x0048, + 0x2b5a, 0xa484, 0xff00, 0x8007, 0xa0e2, 0x0020, 0x0048, 0x2b5a, + 0xa502, 0x0048, 0x2b5a, 0xa484, 0x00ff, 0xa0e2, 0x0020, 0x0048, + 0x2b5a, 0xa502, 0x0048, 0x2b5a, 0x2061, 0xa5a3, 0x6102, 0x6206, + 0x630a, 0x640e, 0x0078, 0x2b2c, 0x007e, 0x2001, 0xa352, 0x2004, + 0xd0cc, 0x007f, 0x007c, 0x007e, 0x2001, 0xa371, 0x2004, 0xd0bc, + 0x007f, 0x007c, 0x6160, 0x7a24, 0x6300, 0x82ff, 0x00c0, 0x379b, + 0x7926, 0x0078, 0x2b2c, 0x83ff, 0x00c0, 0x2b5a, 0x2001, 0xfff0, + 0xa200, 0x00c8, 0x2b5a, 0x2019, 0xffff, 0x6064, 0xa302, 0xa200, + 0x0048, 0x2b5a, 0x7926, 0x6262, 0x0078, 0x2b2c, 0x2001, 0xa300, + 0x2004, 0xa086, 0x0003, 0x00c0, 0x2b56, 0x7c28, 0x7d24, 0x7e38, + 0x7f2c, 0x1078, 0x3518, 0x0040, 0x2b56, 0x2009, 0x0000, 0x2019, + 0x0000, 0x7023, 0x0000, 0x702f, 0x0000, 0xad80, 0x0003, 0x7026, + 0x20a0, 0xa1e0, 0xa434, 0x2c64, 0x8cff, 0x0040, 0x37e8, 0x6004, + 0xa084, 0x00ff, 0xa086, 0x0006, 0x0040, 0x37dd, 0x6004, 0xa084, + 0xff00, 0xa086, 0x0600, 0x00c0, 0x37e8, 0x6014, 0x20a2, 0x94a0, + 0x6010, 0x8007, 0xa105, 0x8007, 0x20a2, 0x94a0, 0xa398, 0x0002, + 0x8108, 0xa182, 0x00ff, 0x0040, 0x37f3, 0xa386, 0x002a, 0x0040, + 0x37fc, 0x0078, 0x37c9, 0x83ff, 0x00c0, 0x37fa, 0x7120, 0x810c, + 0x0078, 0x2b2c, 0x702f, 0x0001, 0x711e, 0x7020, 0xa300, 0x7022, + 0x2061, 0xa3d1, 0x6007, 0x0000, 0x6312, 0x7024, 0x600e, 0x6426, + 0x652a, 0x662e, 0x6732, 0x2c10, 0x1078, 0x13d1, 0x7007, 0x0002, + 0x701b, 0x3813, 0x007c, 0x702c, 0xa005, 0x00c0, 0x3824, 0x711c, + 0x7024, 0x20a0, 0x2019, 0x0000, 0x2061, 0xa3d1, 0x6424, 0x6528, + 0x662c, 0x6730, 0x0078, 0x37c9, 0x7120, 0x810c, 0x0078, 0x2b2c, + 0x81ff, 0x00c0, 0x2b56, 0x60c8, 0xd09c, 0x0040, 0x2b56, 0x1078, + 0x3518, 0x0040, 0x2b56, 0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, + 0x1078, 0x3562, 0x701b, 0x383d, 0x007c, 0x0d7e, 0xade8, 0x000d, + 0x6828, 0xa0be, 0x7000, 0x0040, 0x3850, 0xa0be, 0x7100, 0x0040, + 0x3850, 0xa0be, 0x7200, 0x0040, 0x3850, 0x0d7f, 0x0078, 0x2b5a, + 0x6820, 0x6924, 0x1078, 0x24e3, 0x00c0, 0x387b, 0x1078, 0x4499, + 0x00c0, 0x387b, 0x7122, 0x6612, 0x6516, 0x6e18, 0x0c7e, 0x1078, + 0x3518, 0x0040, 0x387b, 0x1078, 0x3518, 0x0040, 0x387b, 0x0c7f, + 0x0d7f, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x6823, 0x0000, + 0x6804, 0x2068, 0x1078, 0x8bbd, 0x0040, 0x2b56, 0x7007, 0x0003, + 0x701b, 0x387e, 0x007c, 0x0d7f, 0x0078, 0x2b56, 0x7120, 0x1078, + 0x2921, 0x6820, 0xa086, 0x8001, 0x0040, 0x2b56, 0x2d00, 0x701e, + 0x6804, 0xa080, 0x0002, 0x007e, 0x20a9, 0x002a, 0x2098, 0x20a0, + 0x1078, 0x41be, 0x007f, 0xade8, 0x000d, 0x6a08, 0x6b0c, 0x6c10, + 0x6d14, 0x2061, 0xa3d1, 0x6007, 0x0000, 0x6e00, 0x6f28, 0xa7c6, + 0x7000, 0x00c0, 0x38a5, 0x0078, 0x38a9, 0xa7c6, 0x7100, 0x00c0, + 0x38b1, 0xa6c2, 0x0004, 0x0048, 0x2b5a, 0x2009, 0x0004, 0x0078, + 0x3566, 0xa7c6, 0x7200, 0x00c0, 0x2b5a, 0xa6c2, 0x0054, 0x0048, + 0x2b5a, 0x600e, 0x6013, 0x002a, 0x6226, 0x632a, 0x642e, 0x6532, + 0x2c10, 0x1078, 0x13d1, 0x7007, 0x0002, 0x701b, 0x38c8, 0x007c, + 0x701c, 0x2068, 0x6804, 0xa080, 0x0001, 0x2004, 0xa080, 0x0002, + 0x007e, 0x20a9, 0x002a, 0x2098, 0x20a0, 0x1078, 0x41be, 0x007f, + 0x2009, 0x002a, 0x2061, 0xa3d1, 0x6224, 0x6328, 0x642c, 0x6530, + 0x0078, 0x3566, 0x81ff, 0x00c0, 0x2b56, 0x1078, 0x3530, 0x0040, + 0x2b5a, 0x1078, 0x45a7, 0x0040, 0x2b56, 0x1078, 0x4710, 0x0078, + 0x2b2c, 0x7824, 0xd084, 0x0040, 0x3150, 0x1078, 0x3542, 0x0040, + 0x2b5a, 0x0c7e, 0x1078, 0x3518, 0x0c7f, 0x00c0, 0x3903, 0x2009, + 0x0002, 0x0078, 0x2b56, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, + 0x0040, 0x3910, 0xa08e, 0x0004, 0x0040, 0x3910, 0xa08e, 0x0005, + 0x00c0, 0x3934, 0x2001, 0xa352, 0x2004, 0xd0b4, 0x0040, 0x3185, + 0x6000, 0xd08c, 0x00c0, 0x3185, 0x6837, 0x0000, 0x6838, 0xc0fd, + 0x683a, 0x1078, 0x8bd9, 0x00c0, 0x3929, 0x2009, 0x0003, 0x0078, + 0x2b56, 0x7007, 0x0003, 0x701b, 0x392e, 0x007c, 0x1078, 0x3542, + 0x0040, 0x2b5a, 0x0078, 0x3185, 0x2009, 0xa32e, 0x210c, 0x81ff, + 0x0040, 0x393e, 0x2009, 0x0001, 0x0078, 0x2b56, 0x2001, 0xa300, + 0x2004, 0xa086, 0x0003, 0x0040, 0x3949, 0x2009, 0x0007, 0x0078, + 0x2b56, 0x2001, 0xa352, 0x2004, 0xd0ac, 0x0040, 0x3953, 0x2009, + 0x0008, 0x0078, 0x2b56, 0x609c, 0xd0a4, 0x00c0, 0x395a, 0xd0ac, + 0x00c0, 0x3185, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, + 0x683a, 0x1078, 0x8c4d, 0x00c0, 0x3969, 0x2009, 0x0003, 0x0078, + 0x2b56, 0x7007, 0x0003, 0x701b, 0x396e, 0x007c, 0x6830, 0xa086, + 0x0100, 0x00c0, 0x3977, 0x2009, 0x0004, 0x0078, 0x2b56, 0x1078, + 0x3542, 0x0040, 0x2b5a, 0x0078, 0x3912, 0x81ff, 0x2009, 0x0001, + 0x00c0, 0x2b56, 0x6000, 0xa086, 0x0003, 0x2009, 0x0007, 0x00c0, + 0x2b56, 0x2001, 0xa352, 0x2004, 0xd0ac, 0x2009, 0x0008, 0x00c0, + 0x2b56, 0x1078, 0x3542, 0x0040, 0x2b5a, 0x6004, 0xa084, 0x00ff, + 0xa086, 0x0006, 0x2009, 0x0009, 0x00c0, 0x2b56, 0x0c7e, 0x1078, + 0x3518, 0x0c7f, 0x2009, 0x0002, 0x0040, 0x2b56, 0x6837, 0x0000, + 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x7928, 0xa194, 0xff00, + 0xa18c, 0x00ff, 0xa006, 0x82ff, 0x00c0, 0x39bc, 0xc0ed, 0x6952, + 0x792c, 0x6956, 0x0078, 0x39c5, 0xa28e, 0x0100, 0x00c0, 0x2b5a, + 0xc0e5, 0x6853, 0x0000, 0x6857, 0x0000, 0x683e, 0x1078, 0x8df6, + 0x2009, 0x0003, 0x0040, 0x2b56, 0x7007, 0x0003, 0x701b, 0x39d1, + 0x007c, 0x6830, 0xa086, 0x0100, 0x2009, 0x0004, 0x0040, 0x2b56, + 0x0078, 0x2b2c, 0x81ff, 0x2009, 0x0001, 0x00c0, 0x2b56, 0x6000, + 0xa086, 0x0003, 0x2009, 0x0007, 0x00c0, 0x2b56, 0x1078, 0x3542, + 0x0040, 0x2b5a, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x2009, + 0x0009, 0x00c0, 0x2b56, 0x0c7e, 0x1078, 0x3518, 0x0c7f, 0x2009, + 0x0002, 0x0040, 0x2b56, 0xad80, 0x000f, 0x2009, 0x0008, 0x7a2c, + 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x3562, 0x701b, 0x3a08, 0x007c, + 0x0d7e, 0xade8, 0x000f, 0x6800, 0xa086, 0x0500, 0x00c0, 0x3a1b, + 0x6804, 0xa005, 0x00c0, 0x3a1b, 0x6808, 0xa084, 0xff00, 0x00c0, + 0x3a1b, 0x0078, 0x3a1e, 0x0d7f, 0x00c0, 0x2b5a, 0x0d7f, 0x6837, + 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x0c7e, 0x1078, + 0x3542, 0x00c0, 0x3a2e, 0x0c7f, 0x0078, 0x2b5a, 0x1078, 0x8e52, + 0x2009, 0x0003, 0x0c7f, 0x0040, 0x2b56, 0x7007, 0x0003, 0x701b, + 0x3a3a, 0x007c, 0x6830, 0xa086, 0x0100, 0x2009, 0x0004, 0x0040, + 0x2b56, 0x0078, 0x2b2c, 0x127e, 0x0c7e, 0x0e7e, 0x2061, 0x0100, + 0x2071, 0xa300, 0x6044, 0xd0a4, 0x00c0, 0x3a6c, 0xd084, 0x0040, + 0x3a55, 0x1078, 0x3bcc, 0x0078, 0x3a68, 0xd08c, 0x0040, 0x3a5c, + 0x1078, 0x3ae3, 0x0078, 0x3a68, 0xd094, 0x0040, 0x3a63, 0x1078, + 0x3ab7, 0x0078, 0x3a68, 0xd09c, 0x0040, 0x3a68, 0x1078, 0x3a76, + 0x0e7f, 0x0c7f, 0x127f, 0x007c, 0x017e, 0x6128, 0xd19c, 0x00c0, + 0x3a73, 0xc19d, 0x612a, 0x017f, 0x0078, 0x3a68, 0x624c, 0xa286, + 0xf0f0, 0x00c0, 0x3a87, 0x6048, 0xa086, 0xf0f0, 0x0040, 0x3a87, + 0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0078, 0x3ab6, 0xa294, + 0xff00, 0xa296, 0xf700, 0x0040, 0x3a9c, 0x7134, 0xd1a4, 0x00c0, + 0x3a9c, 0x6240, 0xa294, 0x0010, 0x0040, 0x3a9c, 0x2009, 0x00f7, + 0x1078, 0x41de, 0x0078, 0x3ab6, 0x6043, 0x0040, 0x6043, 0x0000, + 0x7073, 0x0000, 0x708b, 0x0001, 0x70af, 0x0000, 0x70cb, 0x0000, + 0x2009, 0xa9c0, 0x200b, 0x0000, 0x7083, 0x0000, 0x7077, 0x000f, + 0x2009, 0x000f, 0x2011, 0x4122, 0x1078, 0x596c, 0x007c, 0x157e, + 0x7074, 0xa005, 0x00c0, 0x3ae1, 0x2011, 0x4122, 0x1078, 0x58d4, + 0x6040, 0xa094, 0x0010, 0xa285, 0x0020, 0x6042, 0x20a9, 0x00c8, + 0x6044, 0xd08c, 0x00c0, 0x3ada, 0x00f0, 0x3ac8, 0x6242, 0x7087, + 0x0000, 0x6040, 0xa094, 0x0010, 0xa285, 0x0080, 0x6042, 0x6242, + 0x0078, 0x3ae1, 0x6242, 0x7087, 0x0000, 0x707b, 0x0000, 0x0078, + 0x3ae1, 0x157f, 0x007c, 0x7078, 0xa08a, 0x0003, 0x00c8, 0x3aec, + 0x1079, 0x3aef, 0x0078, 0x3aee, 0x1078, 0x1328, 0x007c, 0x3af2, + 0x3b41, 0x3bcb, 0x0f7e, 0x707b, 0x0001, 0x20e1, 0xa000, 0x20e1, + 0x8700, 0x1078, 0x218b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079, + 0xa800, 0x207b, 0x2200, 0x7807, 0x00ef, 0x780b, 0x0000, 0x780f, + 0x00ef, 0x7813, 0x0138, 0x7817, 0x0000, 0x781b, 0x0000, 0x781f, + 0x0000, 0x7823, 0xffff, 0x7827, 0xffff, 0x782b, 0x0000, 0x782f, + 0x0000, 0x2079, 0xa80c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099, + 0xa305, 0x20a1, 0xa80e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0xa812, + 0x207b, 0x0000, 0x7807, 0x0000, 0x2099, 0xa800, 0x20a1, 0x020b, + 0x20a9, 0x0014, 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x1078, + 0x4158, 0x0f7f, 0x707f, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000, + 0x007c, 0x0d7e, 0x707c, 0x707f, 0x0000, 0xa025, 0x0040, 0x3bb5, + 0x6020, 0xd0b4, 0x00c0, 0x3bb3, 0x7188, 0x81ff, 0x0040, 0x3ba2, + 0xa486, 0x000c, 0x00c0, 0x3bad, 0xa480, 0x0018, 0x8004, 0x20a8, + 0x2011, 0xa880, 0x2019, 0xa800, 0x220c, 0x2304, 0xa106, 0x00c0, + 0x3b79, 0x8210, 0x8318, 0x00f0, 0x3b5c, 0x6043, 0x0004, 0x608b, + 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0006, 0x707b, 0x0002, 0x7087, + 0x0002, 0x2009, 0x07d0, 0x2011, 0x4129, 0x1078, 0x596c, 0x0078, + 0x3bb3, 0x2069, 0xa880, 0x6930, 0xa18e, 0x1101, 0x00c0, 0x3bad, + 0x6834, 0xa005, 0x00c0, 0x3bad, 0x6900, 0xa18c, 0x00ff, 0x00c0, + 0x3b8d, 0x6804, 0xa005, 0x0040, 0x3ba2, 0x2011, 0xa88e, 0x2019, + 0xa305, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102, 0x0048, 0x3ba0, + 0x00c0, 0x3bad, 0x8210, 0x8318, 0x00f0, 0x3b93, 0x0078, 0x3bad, + 0x708b, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0xa880, + 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043, 0x0008, 0x6043, + 0x0000, 0x0078, 0x3bb5, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0, + 0x3bb3, 0x60c3, 0x000c, 0x2011, 0xa5b5, 0x2013, 0x0000, 0x707f, + 0x0000, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, + 0x6c38, 0x0078, 0x3bb3, 0x007c, 0x7084, 0xa08a, 0x001d, 0x00c8, + 0x3bd5, 0x1079, 0x3bd8, 0x0078, 0x3bd7, 0x1078, 0x1328, 0x007c, + 0x3c02, 0x3c11, 0x3c40, 0x3c59, 0x3c85, 0x3cb1, 0x3cdd, 0x3d13, + 0x3d3f, 0x3d67, 0x3daa, 0x3dd4, 0x3df6, 0x3e0c, 0x3e32, 0x3e45, + 0x3e4e, 0x3e7e, 0x3eaa, 0x3ed6, 0x3f02, 0x3f38, 0x3f7d, 0x3fac, + 0x3fce, 0x4010, 0x4036, 0x404f, 0x4050, 0x0c7e, 0x2061, 0xa300, + 0x6003, 0x0007, 0x2061, 0x0100, 0x6004, 0xa084, 0xfff9, 0x6006, + 0x0c7f, 0x007c, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0002, + 0x7087, 0x0001, 0x2009, 0x07d0, 0x2011, 0x4129, 0x1078, 0x596c, + 0x007c, 0x0f7e, 0x707c, 0xa086, 0x0014, 0x00c0, 0x3c3e, 0x6043, + 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x3c3e, 0x2079, 0xa880, 0x7a30, + 0xa296, 0x1102, 0x00c0, 0x3c3c, 0x7834, 0xa005, 0x00c0, 0x3c3c, + 0x7a38, 0xd2fc, 0x0040, 0x3c32, 0x70ac, 0xa005, 0x00c0, 0x3c32, + 0x70af, 0x0001, 0x2011, 0x4129, 0x1078, 0x58d4, 0x7087, 0x0010, + 0x1078, 0x3e4e, 0x0078, 0x3c3e, 0x1078, 0x4171, 0x0f7f, 0x007c, + 0x7087, 0x0003, 0x6043, 0x0004, 0x2011, 0x4129, 0x1078, 0x58d4, + 0x1078, 0x41c6, 0x20a3, 0x1102, 0x20a3, 0x0000, 0x20a9, 0x000a, + 0x20a3, 0x0000, 0x00f0, 0x3c50, 0x60c3, 0x0014, 0x1078, 0x4158, + 0x007c, 0x0f7e, 0x707c, 0xa005, 0x0040, 0x3c83, 0x2011, 0x4129, + 0x1078, 0x58d4, 0xa086, 0x0014, 0x00c0, 0x3c81, 0x2079, 0xa880, + 0x7a30, 0xa296, 0x1102, 0x00c0, 0x3c81, 0x7834, 0xa005, 0x00c0, + 0x3c81, 0x7a38, 0xd2fc, 0x0040, 0x3c7b, 0x70ac, 0xa005, 0x00c0, + 0x3c7b, 0x70af, 0x0001, 0x7087, 0x0004, 0x1078, 0x3c85, 0x0078, + 0x3c83, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x7087, 0x0005, 0x1078, + 0x41c6, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0xa88e, + 0x1078, 0x4211, 0x00c0, 0x3ca3, 0x7070, 0xa005, 0x00c0, 0x3ca3, + 0x714c, 0xa186, 0xffff, 0x0040, 0x3ca3, 0x1078, 0x40ea, 0x0040, + 0x3ca3, 0x1078, 0x41f5, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4158, + 0x007c, 0x0f7e, 0x707c, 0xa005, 0x0040, 0x3cdb, 0x2011, 0x4129, + 0x1078, 0x58d4, 0xa086, 0x0014, 0x00c0, 0x3cd9, 0x2079, 0xa880, + 0x7a30, 0xa296, 0x1103, 0x00c0, 0x3cd9, 0x7834, 0xa005, 0x00c0, + 0x3cd9, 0x7a38, 0xd2fc, 0x0040, 0x3cd3, 0x70ac, 0xa005, 0x00c0, + 0x3cd3, 0x70af, 0x0001, 0x7087, 0x0006, 0x1078, 0x3cdd, 0x0078, + 0x3cdb, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x7087, 0x0007, 0x1078, + 0x41c6, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0xa88e, + 0x1078, 0x4211, 0x00c0, 0x3d05, 0x7070, 0xa005, 0x00c0, 0x3d05, + 0x7150, 0xa186, 0xffff, 0x0040, 0x3d05, 0xa180, 0x293f, 0x200c, + 0xa18c, 0xff00, 0x810f, 0x1078, 0x40ea, 0x0040, 0x3d05, 0x1078, + 0x378b, 0x0040, 0x3d05, 0x1078, 0x2500, 0x20a9, 0x0008, 0x2298, + 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, + 0x1078, 0x4158, 0x007c, 0x0f7e, 0x707c, 0xa005, 0x0040, 0x3d3d, + 0x2011, 0x4129, 0x1078, 0x58d4, 0xa086, 0x0014, 0x00c0, 0x3d3b, + 0x2079, 0xa880, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x3d3b, 0x7834, + 0xa005, 0x00c0, 0x3d3b, 0x7a38, 0xd2fc, 0x0040, 0x3d35, 0x70ac, + 0xa005, 0x00c0, 0x3d35, 0x70af, 0x0001, 0x7087, 0x0008, 0x1078, + 0x3d3f, 0x0078, 0x3d3d, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x7087, + 0x0009, 0x1078, 0x41c6, 0x20a3, 0x1105, 0x20a3, 0x0100, 0x3430, + 0x1078, 0x4211, 0x00c0, 0x3d58, 0x7070, 0xa005, 0x00c0, 0x3d58, + 0x1078, 0x4051, 0x00c0, 0x3d62, 0xa085, 0x0001, 0x1078, 0x2500, + 0x20a9, 0x0008, 0x2099, 0xa88e, 0x26a0, 0x53a6, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4158, 0x007c, 0x0f7e, + 0x707c, 0xa005, 0x0040, 0x3da8, 0x2011, 0x4129, 0x1078, 0x58d4, + 0xa086, 0x0014, 0x00c0, 0x3da6, 0x2079, 0xa880, 0x7a30, 0xa296, + 0x1105, 0x00c0, 0x3da6, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0, + 0x3d91, 0x7a38, 0xd2fc, 0x0040, 0x3d8b, 0x70ac, 0xa005, 0x00c0, + 0x3d8b, 0x70af, 0x0001, 0x7087, 0x000a, 0x1078, 0x3daa, 0x0078, + 0x3da8, 0xa005, 0x00c0, 0x3da6, 0x7a38, 0xd2fc, 0x0040, 0x3d9e, + 0x70ac, 0xa005, 0x00c0, 0x3d9e, 0x70af, 0x0001, 0x7083, 0x0000, + 0x7087, 0x000e, 0x1078, 0x3e32, 0x0078, 0x3da8, 0x1078, 0x4171, + 0x0f7f, 0x007c, 0x7087, 0x000b, 0x2011, 0xa80e, 0x22a0, 0x20a9, + 0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9, 0x0002, 0x2009, 0x0000, + 0x41a4, 0x1078, 0x41c6, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x1078, + 0x4211, 0x0040, 0x3dc7, 0x2013, 0x0000, 0x0078, 0x3dcb, 0x6030, + 0xa085, 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6, 0x60c3, + 0x0084, 0x1078, 0x4158, 0x007c, 0x0f7e, 0x707c, 0xa005, 0x0040, + 0x3df4, 0x2011, 0x4129, 0x1078, 0x58d4, 0xa086, 0x0084, 0x00c0, + 0x3df2, 0x2079, 0xa880, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x3df2, + 0x7834, 0xa005, 0x00c0, 0x3df2, 0x7087, 0x000c, 0x1078, 0x3df6, + 0x0078, 0x3df4, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x7087, 0x000d, + 0x1078, 0x41c6, 0x20a3, 0x1107, 0x20a3, 0x0000, 0x2099, 0xa88e, + 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, + 0x0084, 0x1078, 0x4158, 0x007c, 0x0f7e, 0x707c, 0xa005, 0x0040, + 0x3e30, 0x2011, 0x4129, 0x1078, 0x58d4, 0xa086, 0x0084, 0x00c0, + 0x3e2e, 0x2079, 0xa880, 0x7a30, 0xa296, 0x1107, 0x00c0, 0x3e2e, + 0x7834, 0xa005, 0x00c0, 0x3e2e, 0x7083, 0x0001, 0x1078, 0x41b8, + 0x7087, 0x000e, 0x1078, 0x3e32, 0x0078, 0x3e30, 0x1078, 0x4171, + 0x0f7f, 0x007c, 0x7087, 0x000f, 0x707f, 0x0000, 0x608b, 0xbc85, + 0x608f, 0xb5b5, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0, + 0x2011, 0x4129, 0x1078, 0x58c7, 0x007c, 0x707c, 0xa005, 0x0040, + 0x3e4d, 0x2011, 0x4129, 0x1078, 0x58d4, 0x007c, 0x7087, 0x0011, + 0x1078, 0x4211, 0x00c0, 0x3e67, 0x7168, 0x81ff, 0x0040, 0x3e67, + 0x2009, 0x0000, 0x706c, 0xa084, 0x00ff, 0x1078, 0x24e3, 0xa186, + 0x0080, 0x0040, 0x3e67, 0x2011, 0xa88e, 0x1078, 0x40ea, 0x20e1, + 0x9080, 0x20e1, 0x4000, 0x2099, 0xa880, 0x20a1, 0x020b, 0x747c, + 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8, + 0x53a6, 0x60c3, 0x0014, 0x1078, 0x4158, 0x007c, 0x0f7e, 0x707c, + 0xa005, 0x0040, 0x3ea8, 0x2011, 0x4129, 0x1078, 0x58d4, 0xa086, + 0x0014, 0x00c0, 0x3ea6, 0x2079, 0xa880, 0x7a30, 0xa296, 0x1103, + 0x00c0, 0x3ea6, 0x7834, 0xa005, 0x00c0, 0x3ea6, 0x7a38, 0xd2fc, + 0x0040, 0x3ea0, 0x70ac, 0xa005, 0x00c0, 0x3ea0, 0x70af, 0x0001, + 0x7087, 0x0012, 0x1078, 0x3eaa, 0x0078, 0x3ea8, 0x1078, 0x4171, + 0x0f7f, 0x007c, 0x7087, 0x0013, 0x1078, 0x41d2, 0x20a3, 0x1103, + 0x20a3, 0x0000, 0x3430, 0x2011, 0xa88e, 0x1078, 0x4211, 0x00c0, + 0x3ec8, 0x7070, 0xa005, 0x00c0, 0x3ec8, 0x714c, 0xa186, 0xffff, + 0x0040, 0x3ec8, 0x1078, 0x40ea, 0x0040, 0x3ec8, 0x1078, 0x41f5, + 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x60c3, 0x0014, 0x1078, 0x4158, 0x007c, 0x0f7e, 0x707c, + 0xa005, 0x0040, 0x3f00, 0x2011, 0x4129, 0x1078, 0x58d4, 0xa086, + 0x0014, 0x00c0, 0x3efe, 0x2079, 0xa880, 0x7a30, 0xa296, 0x1104, + 0x00c0, 0x3efe, 0x7834, 0xa005, 0x00c0, 0x3efe, 0x7a38, 0xd2fc, + 0x0040, 0x3ef8, 0x70ac, 0xa005, 0x00c0, 0x3ef8, 0x70af, 0x0001, + 0x7087, 0x0014, 0x1078, 0x3f02, 0x0078, 0x3f00, 0x1078, 0x4171, + 0x0f7f, 0x007c, 0x7087, 0x0015, 0x1078, 0x41d2, 0x20a3, 0x1104, + 0x20a3, 0x0000, 0x3430, 0x2011, 0xa88e, 0x1078, 0x4211, 0x00c0, + 0x3f2a, 0x7070, 0xa005, 0x00c0, 0x3f2a, 0x7150, 0xa186, 0xffff, + 0x0040, 0x3f2a, 0xa180, 0x293f, 0x200c, 0xa18c, 0xff00, 0x810f, + 0x1078, 0x40ea, 0x0040, 0x3f2a, 0x1078, 0x378b, 0x0040, 0x3f2a, + 0x1078, 0x2500, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4158, 0x007c, + 0x0f7e, 0x707c, 0xa005, 0x0040, 0x3f7b, 0x2011, 0x4129, 0x1078, + 0x58d4, 0xa086, 0x0014, 0x00c0, 0x3f79, 0x2079, 0xa880, 0x7a30, + 0xa296, 0x1105, 0x00c0, 0x3f79, 0x7834, 0x2011, 0x0100, 0xa21e, + 0x00c0, 0x3f5e, 0x7a38, 0xd2fc, 0x0040, 0x3f5c, 0x70ac, 0xa005, + 0x00c0, 0x3f5c, 0x70af, 0x0001, 0x0078, 0x3f6d, 0xa005, 0x00c0, + 0x3f79, 0x7a38, 0xd2fc, 0x0040, 0x3f6b, 0x70ac, 0xa005, 0x00c0, + 0x3f6b, 0x70af, 0x0001, 0x7083, 0x0000, 0x7a38, 0xd2f4, 0x0040, + 0x3f73, 0x70cb, 0x0008, 0x7087, 0x0016, 0x1078, 0x3f7d, 0x0078, + 0x3f7b, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x20e1, 0x9080, 0x20e1, + 0x4000, 0x2099, 0xa880, 0x20a1, 0x020b, 0x20a9, 0x000e, 0x53a6, + 0x3430, 0x2011, 0xa88e, 0x7087, 0x0017, 0x1078, 0x4211, 0x00c0, + 0x3f9d, 0x7070, 0xa005, 0x00c0, 0x3f9d, 0x1078, 0x4051, 0x00c0, + 0x3fa7, 0xa085, 0x0001, 0x1078, 0x2500, 0x20a9, 0x0008, 0x2099, + 0xa88e, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, + 0x0014, 0x1078, 0x4158, 0x007c, 0x0f7e, 0x707c, 0xa005, 0x0040, + 0x3fcc, 0x2011, 0x4129, 0x1078, 0x58d4, 0xa086, 0x0084, 0x00c0, + 0x3fca, 0x2079, 0xa880, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x3fca, + 0x7834, 0xa005, 0x00c0, 0x3fca, 0x7087, 0x0018, 0x1078, 0x3fce, + 0x0078, 0x3fcc, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x7087, 0x0019, + 0x1078, 0x41d2, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, + 0xa88e, 0x2039, 0xa80e, 0x27a0, 0x20a9, 0x0040, 0x53a3, 0x1078, + 0x4211, 0x00c0, 0x4002, 0x2728, 0x2514, 0x8207, 0xa084, 0x00ff, + 0x8000, 0x2018, 0xa294, 0x00ff, 0x8007, 0xa205, 0x202a, 0x6030, + 0x2310, 0x8214, 0xa2a0, 0xa80e, 0x2414, 0xa38c, 0x0001, 0x0040, + 0x3ffd, 0xa294, 0xff00, 0x0078, 0x4000, 0xa294, 0x00ff, 0x8007, + 0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9, 0x0040, 0x53a6, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078, 0x4158, 0x007c, + 0x0f7e, 0x707c, 0xa005, 0x0040, 0x4034, 0x2011, 0x4129, 0x1078, + 0x58d4, 0xa086, 0x0084, 0x00c0, 0x4032, 0x2079, 0xa880, 0x7a30, + 0xa296, 0x1107, 0x00c0, 0x4032, 0x7834, 0xa005, 0x00c0, 0x4032, + 0x7083, 0x0001, 0x1078, 0x41b8, 0x7087, 0x001a, 0x1078, 0x4036, + 0x0078, 0x4034, 0x1078, 0x4171, 0x0f7f, 0x007c, 0x7087, 0x001b, + 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0xa880, 0x20a1, 0x020b, + 0x747c, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, + 0x20a8, 0x53a6, 0x60c3, 0x0084, 0x1078, 0x4158, 0x007c, 0x007c, + 0x007c, 0x087e, 0x097e, 0x2029, 0xa352, 0x252c, 0x20a9, 0x0008, + 0x2041, 0xa80e, 0x28a0, 0x2099, 0xa88e, 0x53a3, 0x20a9, 0x0008, + 0x2011, 0x0007, 0xd5d4, 0x0040, 0x4067, 0x2011, 0x0000, 0x2800, + 0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0, 0x4079, 0xd5d4, 0x0040, + 0x4074, 0x8210, 0x0078, 0x4075, 0x8211, 0x00f0, 0x4067, 0x0078, + 0x40e1, 0x82ff, 0x00c0, 0x408b, 0xd5d4, 0x0040, 0x4085, 0xa1a6, + 0x3fff, 0x0040, 0x4071, 0x0078, 0x4089, 0xa1a6, 0x3fff, 0x0040, + 0x40e1, 0xa18d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, + 0x0040, 0x4094, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0040, 0x409b, + 0x8423, 0x0078, 0x409c, 0x8424, 0x00c8, 0x40a9, 0xd5d4, 0x0040, + 0x40a4, 0x8319, 0x0078, 0x40a5, 0x8318, 0x00f0, 0x4095, 0x0078, + 0x40e1, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x00f0, 0x40ad, + 0x2328, 0x8529, 0xa2be, 0x0007, 0x0040, 0x40c1, 0x007e, 0x2039, + 0x0007, 0x2200, 0xa73a, 0x007f, 0x27a8, 0xa5a8, 0x0010, 0x00f0, + 0x40bd, 0x754e, 0xa5c8, 0x293f, 0x292c, 0xa5ac, 0x00ff, 0x6532, + 0x60e7, 0x0000, 0x65ea, 0x706b, 0x0000, 0x756e, 0x2018, 0x2304, + 0xa405, 0x201a, 0x7073, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008, + 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0078, + 0x40e7, 0xa006, 0x0078, 0x40e7, 0xa006, 0x1078, 0x1328, 0x097f, + 0x087f, 0x007c, 0x2118, 0x2021, 0x0000, 0x2001, 0x0007, 0xa39a, + 0x0010, 0x0048, 0x40f7, 0x8420, 0x8001, 0x0078, 0x40ef, 0x2118, + 0x84ff, 0x0040, 0x4100, 0xa39a, 0x0010, 0x8421, 0x00c0, 0x40fb, + 0x2021, 0x0001, 0x83ff, 0x0040, 0x4109, 0x8423, 0x8319, 0x00c0, + 0x4105, 0xa238, 0x2704, 0xa42c, 0x00c0, 0x4121, 0xa405, 0x203a, + 0x714e, 0xa1a0, 0x293f, 0x242c, 0xa5ac, 0x00ff, 0x6532, 0x60e7, + 0x0000, 0x65ea, 0x706b, 0x0000, 0x756e, 0x7073, 0x0001, 0xa084, + 0x0000, 0x007c, 0x0e7e, 0x2071, 0xa300, 0x7077, 0x0000, 0x0e7f, + 0x007c, 0x0e7e, 0x0f7e, 0x2001, 0x0002, 0x1078, 0x5975, 0x2079, + 0x0100, 0x2071, 0x0140, 0x1078, 0x6c41, 0x7004, 0xa084, 0x4000, + 0x0040, 0x413e, 0x7003, 0x1000, 0x7003, 0x0000, 0x127e, 0x2091, + 0x8000, 0x2071, 0xa321, 0x2073, 0x0000, 0x7840, 0x027e, 0x017e, + 0x2009, 0x00f7, 0x1078, 0x41de, 0x017f, 0xa094, 0x0010, 0xa285, + 0x0080, 0x7842, 0x7a42, 0x027f, 0x127f, 0x0f7f, 0x0e7f, 0x007c, + 0x127e, 0x2091, 0x8000, 0x2011, 0xa5b5, 0x2013, 0x0000, 0x707f, + 0x0000, 0x127f, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, + 0x1078, 0x6c38, 0x2009, 0x07d0, 0x2011, 0x4129, 0x1078, 0x596c, + 0x007c, 0x017e, 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x2009, + 0x00f7, 0x1078, 0x41de, 0x2061, 0xa5be, 0x601b, 0x0000, 0x601f, + 0x0000, 0x2061, 0xa300, 0x6003, 0x0001, 0x2061, 0x0100, 0x6043, + 0x0090, 0x6043, 0x0010, 0x2009, 0x002d, 0x2011, 0x4196, 0x1078, + 0x58c7, 0x127f, 0x0c7f, 0x027f, 0x017f, 0x007c, 0x0e7e, 0x007e, + 0x127e, 0x2091, 0x8000, 0x2001, 0x0001, 0x1078, 0x5975, 0x2071, + 0x0100, 0x1078, 0x6c41, 0x2071, 0x0140, 0x7004, 0xa084, 0x4000, + 0x0040, 0x41ae, 0x7003, 0x1000, 0x7003, 0x0000, 0x2001, 0x0001, + 0x1078, 0x2480, 0x1078, 0x4171, 0x127f, 0x007f, 0x0e7f, 0x007c, + 0x20a9, 0x0040, 0x20a1, 0xa9c0, 0x2099, 0xa88e, 0x3304, 0x8007, + 0x20a2, 0x9398, 0x94a0, 0x00f0, 0x41be, 0x007c, 0x20e1, 0x9080, + 0x20e1, 0x4000, 0x2099, 0xa800, 0x20a1, 0x020b, 0x20a9, 0x000c, + 0x53a6, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0xa880, + 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c, 0x0c7e, 0x007e, + 0x2061, 0x0100, 0x810f, 0x2001, 0xa32e, 0x2004, 0xa005, 0x00c0, + 0x41ef, 0x6030, 0xa084, 0x00ff, 0xa105, 0x0078, 0x41f1, 0xa185, + 0x00f7, 0x604a, 0x007f, 0x0c7f, 0x007c, 0x017e, 0x047e, 0x2001, + 0xa352, 0x2004, 0xd0a4, 0x0040, 0x4208, 0xa006, 0x2020, 0x2009, + 0x002a, 0x1078, 0x9ec0, 0x2001, 0xa30c, 0x200c, 0xc195, 0x2102, + 0x2019, 0x002a, 0x2009, 0x0000, 0x1078, 0x27e2, 0x047f, 0x017f, + 0x007c, 0x007e, 0x2001, 0xa30c, 0x2004, 0xd09c, 0x0040, 0x4218, + 0x007f, 0x007c, 0x007e, 0x017e, 0x127e, 0x2091, 0x8000, 0x2001, + 0x0101, 0x200c, 0xa18d, 0x0006, 0x2102, 0x127f, 0x017f, 0x007f, + 0x007c, 0x157e, 0x20a9, 0x00ff, 0x2009, 0xa434, 0xa006, 0x200a, + 0x8108, 0x00f0, 0x422f, 0x157f, 0x007c, 0x0d7e, 0x037e, 0x157e, + 0x137e, 0x147e, 0x2069, 0xa351, 0xa006, 0x6002, 0x6007, 0x0707, + 0x600a, 0x600e, 0x6012, 0xa198, 0x293f, 0x231c, 0xa39c, 0x00ff, + 0x6316, 0x20a9, 0x0004, 0xac98, 0x0006, 0x23a0, 0x40a4, 0x20a9, + 0x0004, 0xac98, 0x000a, 0x23a0, 0x40a4, 0x603e, 0x6042, 0x604e, + 0x6052, 0x6056, 0x605a, 0x605e, 0x6062, 0x6066, 0x606a, 0x606e, + 0x6072, 0x6076, 0x607a, 0x607e, 0x6082, 0x6086, 0x608a, 0x608e, + 0x6092, 0x6096, 0x609a, 0x609e, 0x60ae, 0x61a2, 0x0d7e, 0x60a4, + 0xa06d, 0x0040, 0x4275, 0x1078, 0x139a, 0x60a7, 0x0000, 0x60a8, + 0xa06d, 0x0040, 0x427d, 0x1078, 0x139a, 0x60ab, 0x0000, 0x0d7f, + 0xa006, 0x604a, 0x6810, 0x603a, 0x680c, 0x6046, 0x6814, 0xa084, + 0x00ff, 0x6042, 0x147f, 0x137f, 0x157f, 0x037f, 0x0d7f, 0x007c, + 0x127e, 0x2091, 0x8000, 0x6944, 0x6e48, 0xa684, 0x3fff, 0xa082, + 0x4000, 0x00c8, 0x4361, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff, + 0x00c8, 0x4367, 0x2001, 0xa30c, 0x2004, 0xa084, 0x0003, 0x0040, + 0x42c2, 0x2001, 0xa30c, 0x2004, 0xd084, 0x00c0, 0x4342, 0xa188, + 0xa434, 0x2104, 0xa065, 0x0040, 0x4342, 0x6004, 0xa084, 0x00ff, + 0xa08e, 0x0006, 0x00c0, 0x4342, 0x6000, 0xd0c4, 0x0040, 0x4342, + 0x0078, 0x42cf, 0xa188, 0xa434, 0x2104, 0xa065, 0x0040, 0x4326, + 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x432c, 0x60a4, + 0xa00d, 0x0040, 0x42d7, 0x1078, 0x4749, 0x0040, 0x4320, 0x60a8, + 0xa00d, 0x0040, 0x42f1, 0x1078, 0x479a, 0x00c0, 0x42f1, 0x694c, + 0xd1fc, 0x00c0, 0x42e7, 0x1078, 0x441c, 0x0078, 0x431b, 0x1078, + 0x43d6, 0x694c, 0xd1ec, 0x00c0, 0x431b, 0x1078, 0x460a, 0x0078, + 0x431b, 0x694c, 0xa184, 0xa000, 0x0040, 0x430b, 0xd1ec, 0x0040, + 0x4304, 0xd1fc, 0x0040, 0x4300, 0x1078, 0x461b, 0x0078, 0x4307, + 0x1078, 0x461b, 0x0078, 0x430b, 0xd1fc, 0x0040, 0x430b, 0x1078, + 0x43d6, 0x0078, 0x431b, 0x6050, 0xa00d, 0x0040, 0x4316, 0x2d00, + 0x200a, 0x6803, 0x0000, 0x6052, 0x0078, 0x431b, 0x2d00, 0x6052, + 0x604e, 0x6803, 0x0000, 0x1078, 0x5c17, 0xa006, 0x127f, 0x007c, + 0x2001, 0x0005, 0x2009, 0x0000, 0x0078, 0x436b, 0x2001, 0x0028, + 0x2009, 0x0000, 0x0078, 0x436b, 0xa082, 0x0006, 0x00c8, 0x4342, + 0x60a0, 0xd0bc, 0x00c0, 0x433e, 0x6100, 0xd1fc, 0x0040, 0x42cf, + 0x2001, 0x0029, 0x2009, 0x1000, 0x0078, 0x436b, 0x2001, 0x0028, + 0x0078, 0x435d, 0x2009, 0xa30c, 0x210c, 0xd18c, 0x0040, 0x434c, + 0x2001, 0x0004, 0x0078, 0x435d, 0xd184, 0x0040, 0x4353, 0x2001, + 0x0004, 0x0078, 0x435d, 0x2001, 0x0029, 0x6100, 0xd1fc, 0x0040, + 0x435d, 0x2009, 0x1000, 0x0078, 0x436b, 0x2009, 0x0000, 0x0078, + 0x436b, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x436b, 0x2001, + 0x0029, 0x2009, 0x0000, 0xa005, 0x127f, 0x007c, 0x6944, 0x6e48, + 0xa684, 0x3fff, 0xa082, 0x4000, 0x00c8, 0x43bb, 0xa18c, 0xff00, + 0x810f, 0xa182, 0x00ff, 0x00c8, 0x43a1, 0xa188, 0xa434, 0x2104, + 0xa065, 0x0040, 0x43a1, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, + 0x00c0, 0x43a7, 0x684c, 0xd0ec, 0x0040, 0x4394, 0x1078, 0x461b, + 0x1078, 0x43d6, 0x0078, 0x439c, 0x1078, 0x43d6, 0x684c, 0xd0fc, + 0x0040, 0x439c, 0x1078, 0x460a, 0x1078, 0x4663, 0xa006, 0x0078, + 0x43bf, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x43bf, 0xa082, + 0x0006, 0x00c8, 0x43b5, 0x6100, 0xd1fc, 0x0040, 0x438a, 0x2001, + 0x0029, 0x2009, 0x1000, 0x0078, 0x43bf, 0x2001, 0x0029, 0x2009, + 0x0000, 0x0078, 0x43bf, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005, + 0x007c, 0x127e, 0x2091, 0x8000, 0x6050, 0xa00d, 0x0040, 0x43cf, + 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, 0x127f, 0x007c, 0x2d00, + 0x6052, 0x604e, 0x6803, 0x0000, 0x0078, 0x43cd, 0x127e, 0x2091, + 0x8000, 0x604c, 0xa005, 0x0040, 0x43ec, 0x0e7e, 0x2071, 0xa5ab, + 0x7004, 0xa086, 0x0002, 0x0040, 0x43f3, 0x0e7f, 0x604c, 0x6802, + 0x2d00, 0x604e, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803, + 0x0000, 0x0078, 0x43ea, 0x701c, 0xac06, 0x00c0, 0x43e5, 0x604c, + 0x2070, 0x7000, 0x6802, 0x2d00, 0x7002, 0x0e7f, 0x127f, 0x007c, + 0x127e, 0x2091, 0x8000, 0x604c, 0xa06d, 0x0040, 0x440e, 0x6800, + 0xa005, 0x00c0, 0x440c, 0x6052, 0x604e, 0xad05, 0x127f, 0x007c, + 0x604c, 0xa06d, 0x0040, 0x441b, 0x6800, 0xa005, 0x00c0, 0x4419, + 0x6052, 0x604e, 0xad05, 0x007c, 0x6803, 0x0000, 0x6084, 0xa00d, + 0x0040, 0x4426, 0x2d00, 0x200a, 0x6086, 0x007c, 0x2d00, 0x6086, + 0x6082, 0x0078, 0x4425, 0x127e, 0x0c7e, 0x027e, 0x2091, 0x8000, + 0x6218, 0x2260, 0x6200, 0xa005, 0x0040, 0x4439, 0xc285, 0x0078, + 0x443a, 0xc284, 0x6202, 0x027f, 0x0c7f, 0x127f, 0x007c, 0x127e, + 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6204, 0x007e, 0xa086, + 0x0006, 0x00c0, 0x445e, 0x609c, 0xd0ac, 0x0040, 0x445e, 0x2001, + 0xa352, 0x2004, 0xd0a4, 0x0040, 0x445e, 0xa284, 0xff00, 0x8007, + 0xa086, 0x0007, 0x00c0, 0x445e, 0x2011, 0x0600, 0x007f, 0xa294, + 0xff00, 0xa215, 0x6206, 0x007e, 0xa086, 0x0006, 0x00c0, 0x446e, + 0x6290, 0x82ff, 0x00c0, 0x446e, 0x1078, 0x1328, 0x007f, 0x0c7f, + 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260, + 0x6204, 0x007e, 0xa086, 0x0006, 0x00c0, 0x4490, 0x609c, 0xd0a4, + 0x0040, 0x4490, 0x2001, 0xa352, 0x2004, 0xd0ac, 0x00c0, 0x4490, + 0xa284, 0x00ff, 0xa086, 0x0007, 0x00c0, 0x4490, 0x2011, 0x0006, + 0x007f, 0xa294, 0x00ff, 0x8007, 0xa215, 0x6206, 0x0c7f, 0x127f, + 0x007c, 0x027e, 0xa182, 0x00ff, 0x0048, 0x44a2, 0xa085, 0x0001, + 0x0078, 0x44ba, 0xa190, 0xa434, 0x2204, 0xa065, 0x00c0, 0x44b9, + 0x017e, 0x0d7e, 0x1078, 0x1366, 0x2d60, 0x0d7f, 0x017f, 0x0040, + 0x449e, 0x2c00, 0x2012, 0x60a7, 0x0000, 0x60ab, 0x0000, 0x1078, + 0x4235, 0xa006, 0x027f, 0x007c, 0x127e, 0x2091, 0x8000, 0x027e, + 0xa182, 0x00ff, 0x0048, 0x44c8, 0xa085, 0x0001, 0x0078, 0x44fe, + 0x0d7e, 0xa190, 0xa434, 0x2204, 0xa06d, 0x0040, 0x44fc, 0x2013, + 0x0000, 0x0d7e, 0x0c7e, 0x2d60, 0x60a4, 0xa06d, 0x0040, 0x44da, + 0x1078, 0x139a, 0x60a8, 0xa06d, 0x0040, 0x44e0, 0x1078, 0x139a, + 0x0c7f, 0x0d7f, 0x0d7e, 0x0c7e, 0x68ac, 0x2060, 0x8cff, 0x0040, + 0x44f8, 0x600c, 0x007e, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, + 0x44f3, 0x1078, 0x13aa, 0x1078, 0x753d, 0x0c7f, 0x0078, 0x44e6, + 0x0c7f, 0x0d7f, 0x1078, 0x139a, 0x0d7f, 0xa006, 0x027f, 0x127f, + 0x007c, 0x017e, 0xa182, 0x00ff, 0x0048, 0x450a, 0xa085, 0x0001, + 0x0078, 0x4511, 0xa188, 0xa434, 0x2104, 0xa065, 0x0040, 0x4506, + 0xa006, 0x017f, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x600b, + 0x0000, 0x600f, 0x0000, 0x6000, 0xc08c, 0x6002, 0x2069, 0xa88e, + 0x6808, 0x605e, 0x6810, 0x6062, 0x6138, 0xa10a, 0x0048, 0x4529, + 0x603a, 0x6814, 0x6066, 0x2099, 0xa896, 0xac88, 0x000a, 0x21a0, + 0x20a9, 0x0004, 0x53a3, 0x2099, 0xa89a, 0xac88, 0x0006, 0x21a0, + 0x20a9, 0x0004, 0x53a3, 0x2069, 0xa8ae, 0x6808, 0x606a, 0x690c, + 0x616e, 0x6810, 0x6072, 0x6818, 0x6076, 0xa182, 0x0211, 0x00c8, + 0x454d, 0x2009, 0x0008, 0x0078, 0x4577, 0xa182, 0x0259, 0x00c8, + 0x4555, 0x2009, 0x0007, 0x0078, 0x4577, 0xa182, 0x02c1, 0x00c8, + 0x455d, 0x2009, 0x0006, 0x0078, 0x4577, 0xa182, 0x0349, 0x00c8, + 0x4565, 0x2009, 0x0005, 0x0078, 0x4577, 0xa182, 0x0421, 0x00c8, + 0x456d, 0x2009, 0x0004, 0x0078, 0x4577, 0xa182, 0x0581, 0x00c8, + 0x4575, 0x2009, 0x0003, 0x0078, 0x4577, 0x2009, 0x0002, 0x6192, + 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x017e, 0x027e, 0x0e7e, + 0x2071, 0xa88d, 0x2e04, 0x6896, 0x2071, 0xa88e, 0x7004, 0x689a, + 0x701c, 0x689e, 0x6a00, 0x2009, 0xa371, 0x210c, 0xd0bc, 0x0040, + 0x4597, 0xd1ec, 0x0040, 0x4597, 0xc2ad, 0x0078, 0x4598, 0xc2ac, + 0xd0c4, 0x0040, 0x45a1, 0xd1e4, 0x0040, 0x45a1, 0xc2bd, 0x0078, + 0x45a2, 0xc2bc, 0x6a02, 0x0e7f, 0x027f, 0x017f, 0x007c, 0x0d7e, + 0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d, 0x0040, 0x45cb, 0x6900, + 0x81ff, 0x00c0, 0x45df, 0x6a04, 0xa282, 0x0010, 0x00c8, 0x45e4, + 0xad88, 0x0004, 0x20a9, 0x0010, 0x2104, 0xa086, 0xffff, 0x0040, + 0x45c6, 0x8108, 0x00f0, 0x45bc, 0x1078, 0x1328, 0x260a, 0x8210, + 0x6a06, 0x0078, 0x45df, 0x1078, 0x1381, 0x0040, 0x45e4, 0x2d00, + 0x60a6, 0x6803, 0x0000, 0xad88, 0x0004, 0x20a9, 0x0010, 0x200b, + 0xffff, 0x8108, 0x00f0, 0x45d7, 0x6807, 0x0001, 0x6e12, 0xa085, + 0x0001, 0x127f, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x45e1, 0x127e, + 0x2091, 0x8000, 0x0d7e, 0x60a4, 0xa00d, 0x0040, 0x4607, 0x2168, + 0x6800, 0xa005, 0x00c0, 0x4603, 0x1078, 0x4749, 0x00c0, 0x4607, + 0x200b, 0xffff, 0x6804, 0xa08a, 0x0002, 0x0048, 0x4603, 0x8001, + 0x6806, 0x0078, 0x4607, 0x1078, 0x139a, 0x60a7, 0x0000, 0x0d7f, + 0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x47af, 0x0078, + 0x4613, 0x1078, 0x43c1, 0x1078, 0x46a7, 0x00c0, 0x4611, 0x1078, + 0x4663, 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a8, + 0xa06d, 0x0040, 0x463f, 0x6950, 0x81ff, 0x00c0, 0x4653, 0x6a54, + 0xa282, 0x0010, 0x00c8, 0x4660, 0xad88, 0x0018, 0x20a9, 0x0010, + 0x2104, 0xa086, 0xffff, 0x0040, 0x463a, 0x8108, 0x00f0, 0x4630, + 0x1078, 0x1328, 0x260a, 0x8210, 0x6a56, 0x0078, 0x4653, 0x1078, + 0x1381, 0x0040, 0x4660, 0x2d00, 0x60aa, 0x6853, 0x0000, 0xad88, + 0x0018, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108, 0x00f0, 0x464b, + 0x6857, 0x0001, 0x6e62, 0x0078, 0x4657, 0x1078, 0x441c, 0x1078, + 0x466d, 0x00c0, 0x4655, 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c, + 0xa006, 0x0078, 0x465d, 0x127e, 0x2091, 0x8000, 0x1078, 0x5c17, + 0x127f, 0x007c, 0xa01e, 0x0078, 0x466f, 0x2019, 0x0001, 0xa00e, + 0x127e, 0x2091, 0x8000, 0x604c, 0x2068, 0x6000, 0xd0dc, 0x00c0, + 0x468d, 0x8dff, 0x0040, 0x46a2, 0x83ff, 0x0040, 0x4685, 0x6848, + 0xa606, 0x0040, 0x4692, 0x0078, 0x468d, 0x683c, 0xa406, 0x00c0, + 0x468d, 0x6840, 0xa506, 0x0040, 0x4692, 0x2d08, 0x6800, 0x2068, + 0x0078, 0x4679, 0x6a00, 0x604c, 0xad06, 0x00c0, 0x469a, 0x624e, + 0x0078, 0x469d, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x46a2, + 0x6152, 0x8dff, 0x127f, 0x007c, 0xa01e, 0x0078, 0x46a9, 0x2019, + 0x0001, 0xa00e, 0x6080, 0x2068, 0x8dff, 0x0040, 0x46d5, 0x83ff, + 0x0040, 0x46b8, 0x6848, 0xa606, 0x0040, 0x46c5, 0x0078, 0x46c0, + 0x683c, 0xa406, 0x00c0, 0x46c0, 0x6840, 0xa506, 0x0040, 0x46c5, + 0x2d08, 0x6800, 0x2068, 0x0078, 0x46ac, 0x6a00, 0x6080, 0xad06, + 0x00c0, 0x46cd, 0x6282, 0x0078, 0x46d0, 0xa180, 0x0000, 0x2202, + 0x82ff, 0x00c0, 0x46d5, 0x6186, 0x8dff, 0x007c, 0xa016, 0x1078, + 0x4742, 0x00c0, 0x46dd, 0x2011, 0x0001, 0x1078, 0x4793, 0x00c0, + 0x46e3, 0xa295, 0x0002, 0x007c, 0x1078, 0x47cb, 0x0040, 0x46ec, + 0x1078, 0x8b12, 0x0078, 0x46ee, 0xa085, 0x0001, 0x007c, 0x1078, + 0x47cb, 0x0040, 0x46f7, 0x1078, 0x8aaa, 0x0078, 0x46f9, 0xa085, + 0x0001, 0x007c, 0x1078, 0x47cb, 0x0040, 0x4702, 0x1078, 0x8af4, + 0x0078, 0x4704, 0xa085, 0x0001, 0x007c, 0x1078, 0x47cb, 0x0040, + 0x470d, 0x1078, 0x8ac6, 0x0078, 0x470f, 0xa085, 0x0001, 0x007c, + 0x1078, 0x47cb, 0x0040, 0x4718, 0x1078, 0x8b30, 0x0078, 0x471a, + 0xa085, 0x0001, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091, 0x8000, + 0x6080, 0xa06d, 0x0040, 0x473a, 0x6800, 0x007e, 0x6837, 0x0103, + 0x6b4a, 0x6847, 0x0000, 0x1078, 0x8cb8, 0x007e, 0x6000, 0xd0fc, + 0x0040, 0x4734, 0x1078, 0xa18c, 0x007f, 0x1078, 0x4982, 0x007f, + 0x0078, 0x4721, 0x6083, 0x0000, 0x6087, 0x0000, 0x0d7f, 0x007f, + 0x127f, 0x007c, 0x60a4, 0xa00d, 0x00c0, 0x4749, 0xa085, 0x0001, + 0x007c, 0x0e7e, 0x2170, 0x7000, 0xa005, 0x00c0, 0x475c, 0x20a9, + 0x0010, 0xae88, 0x0004, 0x2104, 0xa606, 0x0040, 0x475c, 0x8108, + 0x00f0, 0x4753, 0xa085, 0x0001, 0xa006, 0x0e7f, 0x007c, 0x0d7e, + 0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d, 0x00c0, 0x476d, 0x1078, + 0x1381, 0x0040, 0x477f, 0x2d00, 0x60a6, 0x6803, 0x0001, 0x6807, + 0x0000, 0xad88, 0x0004, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108, + 0x00f0, 0x4775, 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c, 0xa006, + 0x0078, 0x477c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d, + 0x0040, 0x4790, 0x60a7, 0x0000, 0x1078, 0x139a, 0xa085, 0x0001, + 0x127f, 0x0d7f, 0x007c, 0x60a8, 0xa00d, 0x00c0, 0x479a, 0xa085, + 0x0001, 0x007c, 0x0e7e, 0x2170, 0x7050, 0xa005, 0x00c0, 0x47ad, + 0x20a9, 0x0010, 0xae88, 0x0018, 0x2104, 0xa606, 0x0040, 0x47ad, + 0x8108, 0x00f0, 0x47a4, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x127e, + 0x2091, 0x8000, 0x1078, 0x4793, 0x00c0, 0x47c9, 0x200b, 0xffff, + 0x0d7e, 0x60a8, 0x2068, 0x6854, 0xa08a, 0x0002, 0x0048, 0x47c4, + 0x8001, 0x6856, 0x0078, 0x47c8, 0x1078, 0x139a, 0x60ab, 0x0000, + 0x0d7f, 0x127f, 0x007c, 0x609c, 0xd0a4, 0x007c, 0x0f7e, 0x71ac, + 0x81ff, 0x00c0, 0x47e9, 0x71c8, 0xd19c, 0x0040, 0x47e9, 0x2001, + 0x007e, 0xa080, 0xa434, 0x2004, 0xa07d, 0x0040, 0x47e9, 0x7804, + 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x47e9, 0x7800, 0xc0ed, + 0x7802, 0x2079, 0xa351, 0x7804, 0xd0a4, 0x0040, 0x480f, 0x157e, + 0x0c7e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x4501, + 0x00c0, 0x4809, 0x6004, 0xa084, 0xff00, 0x8007, 0xa096, 0x0004, + 0x0040, 0x4806, 0xa086, 0x0006, 0x00c0, 0x4809, 0x6000, 0xc0ed, + 0x6002, 0x017f, 0x8108, 0x00f0, 0x47f5, 0x0c7f, 0x157f, 0x1078, + 0x4897, 0x0040, 0x4818, 0x2001, 0xa59f, 0x200c, 0x0078, 0x4820, + 0x2079, 0xa351, 0x7804, 0xd0a4, 0x0040, 0x4824, 0x2009, 0x07d0, + 0x2011, 0x4826, 0x1078, 0x596c, 0x0f7f, 0x007c, 0x2011, 0x4826, + 0x1078, 0x58d4, 0x1078, 0x4897, 0x0040, 0x484e, 0x2001, 0xa4b2, + 0x2004, 0xa080, 0x0000, 0x200c, 0xc1ec, 0x2102, 0x2001, 0xa352, + 0x2004, 0xd0a4, 0x0040, 0x4842, 0x2009, 0x07d0, 0x2011, 0x4826, + 0x1078, 0x596c, 0x0e7e, 0x2071, 0xa300, 0x706b, 0x0000, 0x706f, + 0x0000, 0x1078, 0x260d, 0x0e7f, 0x0078, 0x4886, 0x157e, 0x0c7e, + 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x4501, 0x00c0, + 0x4880, 0x6000, 0xd0ec, 0x0040, 0x4880, 0x047e, 0x62a0, 0xa294, + 0x00ff, 0x8227, 0xa006, 0x2009, 0x0029, 0x1078, 0x9ec0, 0x6000, + 0xc0e5, 0xc0ec, 0x6002, 0x6004, 0xa084, 0x00ff, 0xa085, 0x0700, + 0x6006, 0x2019, 0x0029, 0x1078, 0x5d53, 0x077e, 0x2039, 0x0000, + 0x1078, 0x5c78, 0x2009, 0x0000, 0x1078, 0x9c38, 0x077f, 0x047f, + 0x017f, 0x8108, 0x00f0, 0x4854, 0x0c7f, 0x157f, 0x007c, 0x0c7e, + 0x6018, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x0c7f, 0x007c, 0x7818, + 0x2004, 0xd0ac, 0x007c, 0x7818, 0x2004, 0xd0bc, 0x007c, 0x0f7e, + 0x2001, 0xa4b2, 0x2004, 0xa07d, 0x0040, 0x48a0, 0x7800, 0xd0ec, + 0x0f7f, 0x007c, 0x127e, 0x027e, 0x2091, 0x8000, 0x6200, 0xa005, + 0x0040, 0x48ad, 0xc2fd, 0x0078, 0x48ae, 0xc2fc, 0x6202, 0x027f, + 0x127f, 0x007c, 0x2071, 0xa413, 0x7003, 0x0001, 0x7007, 0x0000, + 0x7013, 0x0000, 0x7017, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, + 0x700b, 0x0000, 0x704b, 0x0001, 0x704f, 0x0000, 0x705b, 0x0020, + 0x705f, 0x0040, 0x707f, 0x0000, 0x2071, 0xa57c, 0x7003, 0xa413, + 0x7007, 0x0000, 0x700b, 0x0000, 0x700f, 0xa55c, 0x7013, 0x0020, + 0x7017, 0x0040, 0x7037, 0x0000, 0x007c, 0x017e, 0x0e7e, 0x2071, + 0xa534, 0xa00e, 0x7186, 0x718a, 0x7097, 0x0001, 0x2001, 0xa352, + 0x2004, 0xd0fc, 0x00c0, 0x48f7, 0x2001, 0xa352, 0x2004, 0xa00e, + 0xd09c, 0x0040, 0x48f4, 0x8108, 0x7102, 0x0078, 0x494a, 0x2001, + 0xa371, 0x200c, 0xa184, 0x000f, 0x2009, 0xa372, 0x210c, 0x0079, + 0x4901, 0x48ec, 0x4922, 0x492a, 0x4935, 0x493b, 0x48ec, 0x48ec, + 0x48ec, 0x4911, 0x48ec, 0x48ec, 0x48ec, 0x48ec, 0x48ec, 0x48ec, + 0x48ec, 0x7003, 0x0004, 0x137e, 0x147e, 0x157e, 0x2099, 0xa375, + 0x20a1, 0xa585, 0x20a9, 0x0004, 0x53a3, 0x157f, 0x147f, 0x137f, + 0x0078, 0x494a, 0x708f, 0x0005, 0x7007, 0x0122, 0x2001, 0x0002, + 0x0078, 0x4930, 0x708f, 0x0002, 0x7007, 0x0121, 0x2001, 0x0003, + 0x7002, 0x7097, 0x0001, 0x0078, 0x4947, 0x7007, 0x0122, 0x2001, + 0x0002, 0x0078, 0x493f, 0x7007, 0x0121, 0x2001, 0x0003, 0x7002, + 0xa006, 0x7096, 0x708e, 0xa184, 0xff00, 0x8007, 0x709a, 0xa184, + 0x00ff, 0x7092, 0x0e7f, 0x017f, 0x007c, 0x0e7e, 0x2071, 0xa413, + 0x684c, 0xa005, 0x00c0, 0x495b, 0x7028, 0xc085, 0x702a, 0xa085, + 0x0001, 0x0078, 0x4980, 0x6a60, 0x7236, 0x6b64, 0x733a, 0x6868, + 0x703e, 0x7076, 0x686c, 0x7042, 0x707a, 0x684c, 0x702e, 0x6844, + 0x7032, 0x2009, 0x000d, 0x200a, 0x700b, 0x0000, 0x8007, 0x8006, + 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, + 0x726e, 0x7372, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0xa006, + 0x0e7f, 0x007c, 0x0e7e, 0x027e, 0x6838, 0xd0fc, 0x00c0, 0x49d8, + 0x6804, 0xa00d, 0x0040, 0x499e, 0x0d7e, 0x2071, 0xa300, 0xa016, + 0x702c, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x00c0, + 0x4991, 0x702e, 0x70a8, 0xa200, 0x70aa, 0x0d7f, 0x2071, 0xa413, + 0x701c, 0xa005, 0x00c0, 0x49ea, 0x0068, 0x49e8, 0x2071, 0xa534, + 0x7200, 0x82ff, 0x0040, 0x49e8, 0x6934, 0xa186, 0x0103, 0x00c0, + 0x49fb, 0x6948, 0x6844, 0xa105, 0x00c0, 0x49db, 0x2009, 0x8020, + 0x2200, 0x0079, 0x49bb, 0x49e8, 0x49c0, 0x4a18, 0x4a26, 0x49e8, + 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x49e8, 0x7122, 0x683c, + 0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080, 0x2071, + 0xa300, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70a8, 0x8000, 0x70aa, + 0x027f, 0x0e7f, 0x007c, 0x6844, 0xa086, 0x0100, 0x00c0, 0x49e8, + 0x6868, 0xa005, 0x00c0, 0x49e8, 0x2009, 0x8020, 0x0078, 0x49b8, + 0x2071, 0xa413, 0x2d08, 0x206b, 0x0000, 0x7010, 0x8000, 0x7012, + 0x7018, 0xa06d, 0x711a, 0x0040, 0x49f8, 0x6902, 0x0078, 0x49f9, + 0x711e, 0x0078, 0x49d8, 0xa18c, 0x00ff, 0xa186, 0x0017, 0x0040, + 0x4a09, 0xa186, 0x001e, 0x0040, 0x4a09, 0xa18e, 0x001f, 0x00c0, + 0x49e8, 0x684c, 0xd0cc, 0x0040, 0x49e8, 0x6850, 0xa084, 0x00ff, + 0xa086, 0x0001, 0x00c0, 0x49e8, 0x2009, 0x8021, 0x0078, 0x49b8, + 0x7084, 0x8008, 0xa092, 0x001e, 0x00c8, 0x49e8, 0x7186, 0xae90, + 0x0003, 0xa210, 0x683c, 0x2012, 0x0078, 0x4a36, 0x7084, 0x8008, + 0xa092, 0x000f, 0x00c8, 0x49e8, 0x7186, 0xae90, 0x0003, 0x8003, + 0xa210, 0x683c, 0x2012, 0x8210, 0x6840, 0x2012, 0x7088, 0xa10a, + 0x0048, 0x49cf, 0x718c, 0x7084, 0xa10a, 0x0048, 0x49cf, 0x2071, + 0x0000, 0x7018, 0xd084, 0x00c0, 0x49cf, 0x2071, 0xa534, 0x7000, + 0xa086, 0x0002, 0x00c0, 0x4a56, 0x1078, 0x4cd2, 0x2071, 0x0000, + 0x701b, 0x0001, 0x2091, 0x4080, 0x0078, 0x49cf, 0x1078, 0x4cfd, + 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0078, 0x49cf, + 0x007e, 0x684c, 0x007e, 0x6837, 0x0103, 0x20a9, 0x001c, 0xad80, + 0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x007f, 0xa084, 0x00ff, + 0x684e, 0x007f, 0x684a, 0x6952, 0x007c, 0x2071, 0xa413, 0x7004, + 0x0079, 0x4a7a, 0x4a84, 0x4a95, 0x4ca3, 0x4ca4, 0x4ccb, 0x4cd1, + 0x4a85, 0x4c91, 0x4c32, 0x4cb4, 0x007c, 0x127e, 0x2091, 0x8000, + 0x0068, 0x4a94, 0x2009, 0x000d, 0x7030, 0x200a, 0x2091, 0x4080, + 0x7007, 0x0001, 0x700b, 0x0000, 0x127f, 0x2069, 0xa5be, 0x6844, + 0xa005, 0x0050, 0x4abd, 0x00c0, 0x4abd, 0x127e, 0x2091, 0x8000, + 0x2069, 0x0000, 0x6934, 0x2001, 0xa41f, 0x2004, 0xa10a, 0x0040, + 0x4ab8, 0x0068, 0x4abc, 0x2069, 0x0000, 0x6818, 0xd084, 0x00c0, + 0x4abc, 0x2009, 0x8040, 0x6922, 0x681b, 0x0001, 0x2091, 0x4080, + 0x2069, 0xa5be, 0x6847, 0xffff, 0x127f, 0x2069, 0xa300, 0x6844, + 0x6960, 0xa102, 0x2069, 0xa534, 0x688a, 0x6984, 0x701c, 0xa06d, + 0x0040, 0x4acf, 0x81ff, 0x0040, 0x4b17, 0x0078, 0x4ae5, 0x81ff, + 0x0040, 0x4be9, 0x2071, 0xa534, 0x7184, 0x7088, 0xa10a, 0x00c8, + 0x4ae5, 0x7190, 0x2071, 0xa5be, 0x7040, 0xa005, 0x0040, 0x4ae5, + 0x00d0, 0x4be9, 0x7142, 0x0078, 0x4be9, 0x2071, 0xa534, 0x718c, + 0x127e, 0x2091, 0x8000, 0x7084, 0xa10a, 0x0048, 0x4c06, 0x0068, + 0x4b9b, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x4b9b, 0x2001, + 0xffff, 0x2071, 0xa5be, 0x7042, 0x2071, 0xa534, 0x7000, 0xa086, + 0x0002, 0x00c0, 0x4b0d, 0x1078, 0x4cd2, 0x2071, 0x0000, 0x701b, + 0x0001, 0x2091, 0x4080, 0x0078, 0x4b9b, 0x1078, 0x4cfd, 0x2071, + 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0078, 0x4b9b, 0x2071, + 0xa534, 0x7000, 0xa005, 0x0040, 0x4bc8, 0x6934, 0xa186, 0x0103, + 0x00c0, 0x4b9e, 0x684c, 0xd0bc, 0x00c0, 0x4bc8, 0x6948, 0x6844, + 0xa105, 0x00c0, 0x4bbb, 0x2009, 0x8020, 0x2071, 0xa534, 0x7000, + 0x0079, 0x4b32, 0x4bc8, 0x4b80, 0x4b58, 0x4b6a, 0x4b37, 0x137e, + 0x147e, 0x157e, 0x2099, 0xa375, 0x20a1, 0xa585, 0x20a9, 0x0004, + 0x53a3, 0x157f, 0x147f, 0x137f, 0x2071, 0xa57c, 0xad80, 0x000f, + 0x700e, 0x7013, 0x0002, 0x7007, 0x0002, 0x700b, 0x0000, 0x2e10, + 0x1078, 0x13d1, 0x2071, 0xa413, 0x7007, 0x0009, 0x0078, 0x4be9, + 0x7084, 0x8008, 0xa092, 0x001e, 0x00c8, 0x4be9, 0xae90, 0x0003, + 0xa210, 0x683c, 0x2012, 0x7186, 0x2071, 0xa413, 0x1078, 0x4d5b, + 0x0078, 0x4be9, 0x7084, 0x8008, 0xa092, 0x000f, 0x00c8, 0x4be9, + 0xae90, 0x0003, 0x8003, 0xa210, 0x683c, 0x2012, 0x8210, 0x6840, + 0x2012, 0x7186, 0x2071, 0xa413, 0x1078, 0x4d5b, 0x0078, 0x4be9, + 0x127e, 0x2091, 0x8000, 0x0068, 0x4b9b, 0x2071, 0x0000, 0x7018, + 0xd084, 0x00c0, 0x4b9b, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, + 0x701b, 0x0001, 0x2091, 0x4080, 0x127f, 0x2071, 0xa413, 0x1078, + 0x4d5b, 0x0078, 0x4be9, 0x127f, 0x0078, 0x4be9, 0xa18c, 0x00ff, + 0xa186, 0x0017, 0x0040, 0x4bac, 0xa186, 0x001e, 0x0040, 0x4bac, + 0xa18e, 0x001f, 0x00c0, 0x4bc8, 0x684c, 0xd0cc, 0x0040, 0x4bc8, + 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0, 0x4bc8, 0x2009, + 0x8021, 0x0078, 0x4b2d, 0x6844, 0xa086, 0x0100, 0x00c0, 0x4bc8, + 0x6868, 0xa005, 0x00c0, 0x4bc8, 0x2009, 0x8020, 0x0078, 0x4b2d, + 0x2071, 0xa413, 0x1078, 0x4d6f, 0x0040, 0x4be9, 0x2071, 0xa413, + 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff, 0xa086, 0x0003, 0x00c0, + 0x4be0, 0x810f, 0xa18c, 0x00ff, 0x8101, 0x0040, 0x4be0, 0x710e, + 0x7007, 0x0003, 0x1078, 0x4d8f, 0x7050, 0xa086, 0x0100, 0x0040, + 0x4ca4, 0x127e, 0x2091, 0x8000, 0x2071, 0xa413, 0x7008, 0xa086, + 0x0001, 0x00c0, 0x4c04, 0x0068, 0x4c04, 0x2009, 0x000d, 0x7030, + 0x200a, 0x2091, 0x4080, 0x700b, 0x0000, 0x7004, 0xa086, 0x0006, + 0x00c0, 0x4c04, 0x7007, 0x0001, 0x127f, 0x007c, 0x2071, 0xa413, + 0x1078, 0x4d6f, 0x0040, 0x4c2f, 0x2071, 0xa534, 0x7084, 0x700a, + 0x20a9, 0x0020, 0x2099, 0xa535, 0x20a1, 0xa55c, 0x53a3, 0x7087, + 0x0000, 0x2071, 0xa413, 0x2069, 0xa57c, 0x706c, 0x6826, 0x7070, + 0x682a, 0x7074, 0x682e, 0x7078, 0x6832, 0x2d10, 0x1078, 0x13d1, + 0x7007, 0x0008, 0x2001, 0xffff, 0x2071, 0xa5be, 0x7042, 0x127f, + 0x0078, 0x4be9, 0x2069, 0xa57c, 0x6808, 0xa08e, 0x0000, 0x0040, + 0x4c90, 0xa08e, 0x0200, 0x0040, 0x4c8e, 0xa08e, 0x0100, 0x00c0, + 0x4c90, 0x127e, 0x2091, 0x8000, 0x0068, 0x4c8b, 0x2069, 0x0000, + 0x6818, 0xd084, 0x00c0, 0x4c8b, 0x702c, 0x7130, 0x8108, 0xa102, + 0x0048, 0x4c59, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072, 0x0078, + 0x4c63, 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8, 0x4c63, 0x7070, + 0xa081, 0x0000, 0x7072, 0x7132, 0x6936, 0x700b, 0x0000, 0x2001, + 0xa559, 0x2004, 0xa005, 0x00c0, 0x4c82, 0x6934, 0x2069, 0xa534, + 0x689c, 0x699e, 0x2069, 0xa5be, 0xa102, 0x00c0, 0x4c7b, 0x6844, + 0xa005, 0x00d0, 0x4c89, 0x2001, 0xa55a, 0x200c, 0x810d, 0x6946, + 0x0078, 0x4c89, 0x2009, 0x8040, 0x6922, 0x681b, 0x0001, 0x2091, + 0x4080, 0x7007, 0x0001, 0x127f, 0x0078, 0x4c90, 0x7007, 0x0005, + 0x007c, 0x701c, 0xa06d, 0x0040, 0x4ca2, 0x1078, 0x4d6f, 0x0040, + 0x4ca2, 0x7007, 0x0003, 0x1078, 0x4d8f, 0x7050, 0xa086, 0x0100, + 0x0040, 0x4ca4, 0x007c, 0x007c, 0x7050, 0xa09e, 0x0100, 0x00c0, + 0x4cad, 0x7007, 0x0004, 0x0078, 0x4ccb, 0xa086, 0x0200, 0x00c0, + 0x4cb3, 0x7007, 0x0005, 0x007c, 0x2001, 0xa57e, 0x2004, 0xa08e, + 0x0100, 0x00c0, 0x4cc0, 0x7007, 0x0001, 0x1078, 0x4d5b, 0x007c, + 0xa08e, 0x0000, 0x0040, 0x4cbf, 0xa08e, 0x0200, 0x00c0, 0x4cbf, + 0x7007, 0x0005, 0x007c, 0x1078, 0x4d25, 0x7006, 0x1078, 0x4d5b, + 0x007c, 0x007c, 0x0e7e, 0x157e, 0x2071, 0xa534, 0x7184, 0x81ff, + 0x0040, 0x4cfa, 0xa006, 0x7086, 0xae80, 0x0003, 0x2071, 0x0000, + 0x21a8, 0x2014, 0x7226, 0x8000, 0x0070, 0x4cf7, 0x2014, 0x722a, + 0x8000, 0x0070, 0x4cf7, 0x2014, 0x722e, 0x8000, 0x0070, 0x4cf7, + 0x2014, 0x723a, 0x8000, 0x0070, 0x4cf7, 0x2014, 0x723e, 0xa180, + 0x8030, 0x7022, 0x157f, 0x0e7f, 0x007c, 0x0e7e, 0x157e, 0x2071, + 0xa534, 0x7184, 0x81ff, 0x0040, 0x4d22, 0xa006, 0x7086, 0xae80, + 0x0003, 0x2071, 0x0000, 0x21a8, 0x2014, 0x7226, 0x8000, 0x2014, + 0x722a, 0x8000, 0x0070, 0x4d1b, 0x2014, 0x723a, 0x8000, 0x2014, + 0x723e, 0x0078, 0x4d1f, 0x2001, 0x8020, 0x0078, 0x4d21, 0x2001, + 0x8042, 0x7022, 0x157f, 0x0e7f, 0x007c, 0x702c, 0x7130, 0x8108, + 0xa102, 0x0048, 0x4d32, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072, + 0x0078, 0x4d3c, 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8, 0x4d3c, + 0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c, 0x8001, 0x700e, + 0x00c0, 0x4d52, 0x127e, 0x2091, 0x8000, 0x0068, 0x4d55, 0x2001, + 0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001, 0x700b, 0x0000, + 0x127f, 0x007c, 0x2001, 0x0007, 0x007c, 0x2001, 0x0006, 0x700b, + 0x0001, 0x127f, 0x007c, 0x701c, 0xa06d, 0x0040, 0x4d6e, 0x127e, + 0x2091, 0x8000, 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0xa005, + 0x00c0, 0x4d6b, 0x701a, 0x127f, 0x1078, 0x139a, 0x007c, 0x2019, + 0x000d, 0x2304, 0x230c, 0xa10e, 0x0040, 0x4d7e, 0x2304, 0x230c, + 0xa10e, 0x0040, 0x4d7e, 0xa006, 0x0078, 0x4d8e, 0x732c, 0x8319, + 0x7130, 0xa102, 0x00c0, 0x4d88, 0x2300, 0xa005, 0x0078, 0x4d8e, + 0x0048, 0x4d8d, 0xa302, 0x0078, 0x4d8e, 0x8002, 0x007c, 0x2d00, + 0x7026, 0xa080, 0x000d, 0x7056, 0x7053, 0x0000, 0x127e, 0x2091, + 0x8000, 0x2009, 0xa5d0, 0x2104, 0xc08d, 0x200a, 0x127f, 0x1078, + 0x13eb, 0x007c, 0x2071, 0xa3e1, 0x7003, 0x0000, 0x7007, 0x0000, + 0x700f, 0x0000, 0x702b, 0x0001, 0x704f, 0x0000, 0x7053, 0x0001, + 0x705f, 0x0020, 0x7063, 0x0040, 0x7083, 0x0000, 0x708b, 0x0000, + 0x708f, 0x0001, 0x70bf, 0x0000, 0x007c, 0x0e7e, 0x2071, 0xa3e1, + 0x6848, 0xa005, 0x00c0, 0x4dcb, 0x7028, 0xc085, 0x702a, 0xa085, + 0x0001, 0x0078, 0x4df0, 0x6a50, 0x7236, 0x6b54, 0x733a, 0x6858, + 0x703e, 0x707a, 0x685c, 0x7042, 0x707e, 0x6848, 0x702e, 0x6840, + 0x7032, 0x2009, 0x000c, 0x200a, 0x8007, 0x8006, 0x8006, 0xa08c, + 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, 0x7272, 0x7376, + 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0x700f, 0x0000, 0xa006, + 0x0e7f, 0x007c, 0x2b78, 0x2071, 0xa3e1, 0x7004, 0x1079, 0x4e50, + 0x700c, 0x0079, 0x4dfb, 0x4e00, 0x4df5, 0x4df5, 0x4df5, 0x4df5, + 0x007c, 0x700c, 0x0079, 0x4e04, 0x4e09, 0x4e4e, 0x4e4e, 0x4e4f, + 0x4e4f, 0x7830, 0x7930, 0xa106, 0x0040, 0x4e13, 0x7830, 0x7930, + 0xa106, 0x00c0, 0x4e39, 0x7030, 0xa10a, 0x0040, 0x4e39, 0x00c8, + 0x4e1b, 0x712c, 0xa10a, 0xa18a, 0x0002, 0x00c8, 0x4e3a, 0x1078, + 0x1366, 0x0040, 0x4e39, 0x2d00, 0x705a, 0x7063, 0x0040, 0x2001, + 0x0003, 0x7057, 0x0000, 0x127e, 0x007e, 0x2091, 0x8000, 0x2009, + 0xa5d0, 0x2104, 0xc085, 0x200a, 0x007f, 0x700e, 0x127f, 0x1078, + 0x13eb, 0x007c, 0x1078, 0x1366, 0x0040, 0x4e39, 0x2d00, 0x705a, + 0x1078, 0x1366, 0x00c0, 0x4e46, 0x0078, 0x4e25, 0x2d00, 0x7086, + 0x7063, 0x0080, 0x2001, 0x0004, 0x0078, 0x4e29, 0x007c, 0x007c, + 0x4e61, 0x4e62, 0x4e99, 0x4e9a, 0x4e4e, 0x4ed0, 0x4ed5, 0x4f0c, + 0x4f0d, 0x4f28, 0x4f29, 0x4f2a, 0x4f2b, 0x4f2c, 0x4f2d, 0x4fad, + 0x4fd7, 0x007c, 0x700c, 0x0079, 0x4e65, 0x4e6a, 0x4e6d, 0x4e7d, + 0x4e98, 0x4e98, 0x1078, 0x4e01, 0x007c, 0x127e, 0x8001, 0x700e, + 0x7058, 0x007e, 0x1078, 0x5348, 0x0040, 0x4e7a, 0x2091, 0x8000, + 0x1078, 0x4e01, 0x0d7f, 0x0078, 0x4e86, 0x127e, 0x8001, 0x700e, + 0x1078, 0x5348, 0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, + 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a, 0x0020, 0x00c8, + 0x4e95, 0x1079, 0x4eb0, 0x127f, 0x007c, 0x127f, 0x1078, 0x4f2e, + 0x007c, 0x007c, 0x007c, 0x0e7e, 0x2071, 0xa3e1, 0x700c, 0x0079, + 0x4ea1, 0x4ea6, 0x4ea6, 0x4ea6, 0x4ea8, 0x4eac, 0x0e7f, 0x007c, + 0x700f, 0x0001, 0x0078, 0x4eae, 0x700f, 0x0002, 0x0e7f, 0x007c, + 0x4f2e, 0x4f2e, 0x4f4a, 0x4f2e, 0x5080, 0x4f2e, 0x4f2e, 0x4f2e, + 0x4f2e, 0x4f2e, 0x4f4a, 0x50ca, 0x5117, 0x5170, 0x5186, 0x4f2e, + 0x4f2e, 0x4f66, 0x4f4a, 0x4f2e, 0x4f2e, 0x4f87, 0x5245, 0x5263, + 0x4f2e, 0x4f66, 0x4f2e, 0x4f2e, 0x4f2e, 0x4f2e, 0x4f7c, 0x5263, + 0x7020, 0x2068, 0x1078, 0x139a, 0x007c, 0x700c, 0x0079, 0x4ed8, + 0x4edd, 0x4ee0, 0x4ef0, 0x4f0b, 0x4f0b, 0x1078, 0x4e01, 0x007c, + 0x127e, 0x8001, 0x700e, 0x7058, 0x007e, 0x1078, 0x5348, 0x0040, + 0x4eed, 0x2091, 0x8000, 0x1078, 0x4e01, 0x0d7f, 0x0078, 0x4ef9, + 0x127e, 0x8001, 0x700e, 0x1078, 0x5348, 0x7058, 0x2068, 0x7084, + 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, + 0xa08a, 0x001a, 0x00c8, 0x4f08, 0x1079, 0x4f0e, 0x127f, 0x007c, + 0x127f, 0x1078, 0x4f2e, 0x007c, 0x007c, 0x007c, 0x4f2e, 0x4f4a, + 0x506a, 0x4f2e, 0x4f4a, 0x4f2e, 0x4f4a, 0x4f4a, 0x4f2e, 0x4f4a, + 0x506a, 0x4f4a, 0x4f4a, 0x4f4a, 0x4f4a, 0x4f4a, 0x4f2e, 0x4f4a, + 0x506a, 0x4f2e, 0x4f2e, 0x4f4a, 0x4f2e, 0x4f2e, 0x4f2e, 0x4f4a, + 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x7007, 0x0001, + 0x6838, 0xa084, 0x00ff, 0xc0d5, 0x683a, 0x127e, 0x2091, 0x8000, + 0x1078, 0x4982, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, + 0x00ff, 0xc0e5, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x4982, + 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0ed, + 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x4982, 0x127f, 0x007c, + 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0dd, 0x683a, 0x127e, + 0x2091, 0x8000, 0x1078, 0x4982, 0x127f, 0x007c, 0x6834, 0x8007, + 0xa084, 0x00ff, 0x0040, 0x4f3c, 0x8001, 0x00c0, 0x4f73, 0x7007, + 0x0001, 0x0078, 0x5049, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, + 0x701a, 0x704b, 0x5049, 0x007c, 0x684c, 0xa084, 0x00c0, 0xa086, + 0x00c0, 0x00c0, 0x4f87, 0x7007, 0x0001, 0x0078, 0x5280, 0x2d00, + 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080, 0x0024, 0x2098, 0x20a1, + 0xa40c, 0x53a3, 0x6858, 0x7012, 0xa082, 0x0401, 0x00c8, 0x4f58, + 0x6884, 0xa08a, 0x0002, 0x00c8, 0x4f58, 0x82ff, 0x00c0, 0x4fa9, + 0x6888, 0x698c, 0xa105, 0x0040, 0x4fa9, 0x2001, 0x5019, 0x0078, + 0x4fac, 0xa280, 0x500f, 0x2004, 0x70c6, 0x7010, 0xa015, 0x0040, + 0x4ff7, 0x1078, 0x1366, 0x00c0, 0x4fb8, 0x7007, 0x000f, 0x007c, + 0x2d00, 0x7022, 0x70c4, 0x2060, 0x6000, 0x6836, 0x6004, 0xad00, + 0x7096, 0x6008, 0xa20a, 0x00c8, 0x4fc7, 0xa00e, 0x2200, 0x7112, + 0x620c, 0x8003, 0x800b, 0xa296, 0x0004, 0x0040, 0x4fd0, 0xa108, + 0x719a, 0x810b, 0x719e, 0xae90, 0x0022, 0x1078, 0x13d1, 0x7090, + 0xa08e, 0x0100, 0x0040, 0x4feb, 0xa086, 0x0200, 0x0040, 0x4fe3, + 0x7007, 0x0010, 0x007c, 0x7020, 0x2068, 0x1078, 0x139a, 0x7014, + 0x2068, 0x0078, 0x4f58, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, + 0x0000, 0x2d08, 0x2068, 0x6906, 0x711a, 0x0078, 0x4fad, 0x7014, + 0x2068, 0x7007, 0x0001, 0x6884, 0xa005, 0x00c0, 0x5006, 0x6888, + 0x698c, 0xa105, 0x0040, 0x5006, 0x1078, 0x501d, 0x6834, 0xa084, + 0x00ff, 0xa086, 0x001e, 0x0040, 0x5280, 0x0078, 0x5049, 0x5011, + 0x5015, 0x0002, 0x0011, 0x0007, 0x0004, 0x000a, 0x000f, 0x0005, + 0x0006, 0x000a, 0x0011, 0x0005, 0x0004, 0x0f7e, 0x0e7e, 0x0c7e, + 0x077e, 0x067e, 0x6f88, 0x6e8c, 0x6804, 0x2060, 0xacf0, 0x0021, + 0xacf8, 0x0027, 0x2009, 0x0005, 0x700c, 0x7816, 0x7008, 0x7812, + 0x7004, 0x7806, 0x7000, 0x7802, 0x7e0e, 0x7f0a, 0x8109, 0x0040, + 0x503f, 0xaef2, 0x0004, 0xaffa, 0x0006, 0x0078, 0x502c, 0x6004, + 0xa065, 0x00c0, 0x5026, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x0f7f, + 0x007c, 0x2009, 0xa32e, 0x210c, 0x81ff, 0x00c0, 0x5064, 0x6838, + 0xa084, 0x00ff, 0x683a, 0x1078, 0x4290, 0x00c0, 0x5058, 0x007c, + 0x1078, 0x4a60, 0x127e, 0x2091, 0x8000, 0x1078, 0x8cb8, 0x1078, + 0x4982, 0x127f, 0x0078, 0x5057, 0x2001, 0x0028, 0x2009, 0x0000, + 0x0078, 0x5058, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906, 0x711a, + 0x7010, 0x8001, 0x7012, 0x0040, 0x5079, 0x7007, 0x0006, 0x0078, + 0x507f, 0x7014, 0x2068, 0x7007, 0x0001, 0x7048, 0x107a, 0x007c, + 0x7007, 0x0001, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x6848, 0xa084, + 0x00ff, 0x20a9, 0x0001, 0xa096, 0x0001, 0x0040, 0x50a9, 0x2009, + 0x0000, 0x20a9, 0x00ff, 0xa096, 0x0002, 0x0040, 0x50a9, 0xa005, + 0x00c0, 0x50bc, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x1078, 0x4501, + 0x00c0, 0x50bc, 0x067e, 0x6e50, 0x1078, 0x45e7, 0x067f, 0x0078, + 0x50bc, 0x047e, 0x2011, 0xa30c, 0x2224, 0xc484, 0xc48c, 0x2412, + 0x047f, 0x0c7e, 0x1078, 0x4501, 0x00c0, 0x50b8, 0x1078, 0x4782, + 0x8108, 0x00f0, 0x50b2, 0x0c7f, 0x684c, 0xd084, 0x00c0, 0x50c3, + 0x1078, 0x139a, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x4982, + 0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, + 0xa352, 0x2004, 0xd0a4, 0x0040, 0x510e, 0x2061, 0xa62d, 0x6100, + 0xd184, 0x0040, 0x50ee, 0x6858, 0xa084, 0x00ff, 0x00c0, 0x5111, + 0x6000, 0xd084, 0x0040, 0x510e, 0x6004, 0xa005, 0x00c0, 0x5114, + 0x6003, 0x0000, 0x600b, 0x0000, 0x0078, 0x510b, 0x2011, 0x0001, + 0x6860, 0xa005, 0x00c0, 0x50f6, 0x2001, 0x001e, 0x8000, 0x6016, + 0x6858, 0xa084, 0x00ff, 0x0040, 0x510e, 0x6006, 0x6858, 0x8007, + 0xa084, 0x00ff, 0x0040, 0x510e, 0x600a, 0x6858, 0x8000, 0x00c0, + 0x510a, 0xc28d, 0x6202, 0x127f, 0x0078, 0x5337, 0x127f, 0x0078, + 0x532f, 0x127f, 0x0078, 0x5327, 0x127f, 0x0078, 0x532b, 0x127e, + 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0xa352, 0x2004, 0xd0a4, + 0x0040, 0x516d, 0x2061, 0xa62d, 0x6000, 0xd084, 0x0040, 0x516d, + 0x6204, 0x6308, 0xd08c, 0x00c0, 0x515f, 0x6c48, 0xa484, 0x0003, + 0x0040, 0x5145, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x00c0, 0x513e, + 0x2100, 0xa210, 0x0048, 0x516a, 0x0078, 0x5145, 0x8001, 0x00c0, + 0x516a, 0x2100, 0xa212, 0x0048, 0x516a, 0xa484, 0x000c, 0x0040, + 0x515f, 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004, 0x00c0, + 0x5157, 0x2100, 0xa318, 0x0048, 0x516a, 0x0078, 0x515f, 0xa082, + 0x0004, 0x00c0, 0x516a, 0x2100, 0xa31a, 0x0048, 0x516a, 0x6860, + 0xa005, 0x0040, 0x5165, 0x8000, 0x6016, 0x6206, 0x630a, 0x127f, + 0x0078, 0x5337, 0x127f, 0x0078, 0x5333, 0x127f, 0x0078, 0x532f, + 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0xa62d, 0x6300, + 0xd38c, 0x00c0, 0x5180, 0x6308, 0x8318, 0x0048, 0x5183, 0x630a, + 0x127f, 0x0078, 0x5345, 0x127f, 0x0078, 0x5333, 0x127e, 0x0c7e, + 0x2091, 0x8000, 0x7007, 0x0001, 0x684c, 0xd0ac, 0x0040, 0x519a, + 0x0c7e, 0x2061, 0xa62d, 0x6000, 0xa084, 0xfcff, 0x6002, 0x0c7f, + 0x0078, 0x51c9, 0x6858, 0xa005, 0x0040, 0x51e0, 0x685c, 0xa065, + 0x0040, 0x51dc, 0x2001, 0xa32e, 0x2004, 0xa005, 0x0040, 0x51ac, + 0x1078, 0x8c01, 0x0078, 0x51ba, 0x6013, 0x0400, 0x6037, 0x0000, + 0x694c, 0xd1a4, 0x0040, 0x51b6, 0x6950, 0x6136, 0x2009, 0x0041, + 0x1078, 0x756c, 0x6958, 0xa18c, 0xff00, 0xa186, 0x2000, 0x00c0, + 0x51c9, 0x027e, 0x2009, 0x0000, 0x2011, 0xfdff, 0x1078, 0x5a6d, + 0x027f, 0x684c, 0xd0c4, 0x0040, 0x51d8, 0x2061, 0xa62d, 0x6000, + 0xd08c, 0x00c0, 0x51d8, 0x6008, 0x8000, 0x0048, 0x51dc, 0x600a, + 0x0c7f, 0x127f, 0x0078, 0x5337, 0x0c7f, 0x127f, 0x0078, 0x532f, + 0x6954, 0xa186, 0x0045, 0x0040, 0x5213, 0xa186, 0x002a, 0x00c0, + 0x51f0, 0x2001, 0xa30c, 0x200c, 0xc194, 0x2102, 0x0078, 0x51c9, + 0xa186, 0x0020, 0x0040, 0x5209, 0xa186, 0x0029, 0x0040, 0x51fc, + 0xa186, 0x002d, 0x00c0, 0x51dc, 0x6944, 0xa18c, 0xff00, 0x810f, + 0x1078, 0x4501, 0x00c0, 0x51c9, 0x6000, 0xc0e4, 0x6002, 0x0078, + 0x51c9, 0x685c, 0xa065, 0x0040, 0x51dc, 0x2001, 0xa5a1, 0x2004, + 0x6016, 0x0078, 0x51c9, 0x685c, 0xa065, 0x0040, 0x51dc, 0x0e7e, + 0x6860, 0xa075, 0x2001, 0xa32e, 0x2004, 0xa005, 0x0040, 0x522b, + 0x1078, 0x8c01, 0x8eff, 0x0040, 0x5228, 0x2e60, 0x1078, 0x8c01, + 0x0e7f, 0x0078, 0x51c9, 0x6024, 0xc0dc, 0xc0d5, 0x6026, 0x2e60, + 0x6007, 0x003a, 0x6870, 0xa005, 0x0040, 0x523c, 0x6007, 0x003b, + 0x6874, 0x602a, 0x6878, 0x6012, 0x6003, 0x0001, 0x1078, 0x5bf8, + 0x1078, 0x6109, 0x0e7f, 0x0078, 0x51c9, 0x2061, 0xa62d, 0x6000, + 0xd084, 0x0040, 0x525f, 0xd08c, 0x00c0, 0x5345, 0x2091, 0x8000, + 0x6204, 0x8210, 0x0048, 0x5259, 0x6206, 0x2091, 0x8001, 0x0078, + 0x5345, 0x2091, 0x8001, 0x6853, 0x0016, 0x0078, 0x533e, 0x6853, + 0x0007, 0x0078, 0x533e, 0x6834, 0x8007, 0xa084, 0x00ff, 0x00c0, + 0x526d, 0x1078, 0x4f3c, 0x0078, 0x527f, 0x2030, 0x8001, 0x00c0, + 0x5277, 0x7007, 0x0001, 0x1078, 0x5280, 0x0078, 0x527f, 0x7007, + 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x5280, 0x007c, + 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2009, 0xa32e, 0x210c, 0x81ff, + 0x00c0, 0x530b, 0x2009, 0xa30c, 0x210c, 0xd194, 0x00c0, 0x5315, + 0x6848, 0x2070, 0xae82, 0xaa00, 0x0048, 0x52fb, 0x2001, 0xa315, + 0x2004, 0xae02, 0x00c8, 0x52fb, 0x2061, 0xa62d, 0x6100, 0xa184, + 0x0301, 0xa086, 0x0001, 0x00c0, 0x52de, 0x711c, 0xa186, 0x0006, + 0x00c0, 0x52e6, 0x7018, 0xa005, 0x0040, 0x530b, 0x2004, 0xd0e4, + 0x00c0, 0x530f, 0x7024, 0xd0dc, 0x00c0, 0x5319, 0x6853, 0x0000, + 0x6803, 0x0000, 0x2d08, 0x7010, 0xa005, 0x00c0, 0x52ca, 0x7112, + 0x684c, 0xd0f4, 0x00c0, 0x531d, 0x2e60, 0x1078, 0x59b6, 0x127f, + 0x0e7f, 0x007c, 0x2068, 0x6800, 0xa005, 0x00c0, 0x52ca, 0x6902, + 0x2168, 0x684c, 0xd0f4, 0x00c0, 0x531d, 0x127f, 0x0e7f, 0x007c, + 0x127f, 0x0e7f, 0x6853, 0x0006, 0x0078, 0x533e, 0xd184, 0x0040, + 0x52d8, 0xd1c4, 0x00c0, 0x52ff, 0x0078, 0x5303, 0x6944, 0xa18c, + 0xff00, 0x810f, 0x1078, 0x4501, 0x00c0, 0x530f, 0x6000, 0xd0e4, + 0x00c0, 0x530f, 0x711c, 0xa186, 0x0007, 0x00c0, 0x52fb, 0x6853, + 0x0002, 0x0078, 0x5311, 0x6853, 0x0008, 0x0078, 0x5311, 0x6853, + 0x000e, 0x0078, 0x5311, 0x6853, 0x0017, 0x0078, 0x5311, 0x6853, + 0x0035, 0x0078, 0x5311, 0x6853, 0x0028, 0x0078, 0x5311, 0x6853, + 0x0029, 0x127f, 0x0e7f, 0x0078, 0x533e, 0x6853, 0x002a, 0x0078, + 0x5311, 0x6853, 0x0045, 0x0078, 0x5311, 0x2e60, 0x2019, 0x0002, + 0x6017, 0x0014, 0x1078, 0x9a6a, 0x127f, 0x0e7f, 0x007c, 0x2009, + 0x003e, 0x0078, 0x5339, 0x2009, 0x0004, 0x0078, 0x5339, 0x2009, + 0x0006, 0x0078, 0x5339, 0x2009, 0x0016, 0x0078, 0x5339, 0x2009, + 0x0001, 0x6854, 0xa084, 0xff00, 0xa105, 0x6856, 0x2091, 0x8000, + 0x1078, 0x4982, 0x2091, 0x8001, 0x007c, 0x1078, 0x139a, 0x007c, + 0x702c, 0x7130, 0x8108, 0xa102, 0x0048, 0x5355, 0xa00e, 0x7034, + 0x7072, 0x7038, 0x7076, 0x0078, 0x5361, 0x7070, 0xa080, 0x0040, + 0x7072, 0x00c8, 0x5361, 0x7074, 0xa081, 0x0000, 0x7076, 0xa085, + 0x0001, 0x7932, 0x7132, 0x007c, 0x0d7e, 0x1078, 0x59ad, 0x0d7f, + 0x007c, 0x0d7e, 0x2011, 0x0004, 0x2204, 0xa085, 0x8002, 0x2012, + 0x0d7f, 0x007c, 0x20e1, 0x0002, 0x3d08, 0x20e1, 0x2000, 0x3d00, + 0xa084, 0x7000, 0x0040, 0x5380, 0xa086, 0x1000, 0x00c0, 0x53ac, + 0x20e1, 0x0000, 0x3d00, 0xa094, 0xff00, 0x8217, 0xa084, 0xf000, + 0xa086, 0x3000, 0x00c0, 0x5390, 0x1078, 0x5570, 0x0078, 0x53a7, + 0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x00c0, 0x5397, 0x3e60, 0xac84, + 0x000f, 0x00c0, 0x53ac, 0xac82, 0xaa00, 0x0048, 0x53ac, 0x6854, + 0xac02, 0x00c8, 0x53ac, 0x2009, 0x0047, 0x1078, 0x756c, 0x7a1c, + 0xd284, 0x00c0, 0x5372, 0x007c, 0xa016, 0x1078, 0x15ec, 0x0078, + 0x53a7, 0x0078, 0x53ac, 0x781c, 0xd08c, 0x0040, 0x53db, 0x157e, + 0x137e, 0x147e, 0x20e1, 0x3000, 0x3d20, 0x3e28, 0xa584, 0x0076, + 0x00c0, 0x53f1, 0xa484, 0x7000, 0xa086, 0x1000, 0x00c0, 0x53e0, + 0x1078, 0x540c, 0x0040, 0x53f1, 0x20e1, 0x3000, 0x7828, 0x7828, + 0x1078, 0x542a, 0x147f, 0x137f, 0x157f, 0x2009, 0xa5b3, 0x2104, + 0xa005, 0x00c0, 0x53dc, 0x007c, 0x1078, 0x6109, 0x0078, 0x53db, + 0xa484, 0x7000, 0x00c0, 0x53f1, 0x1078, 0x540c, 0x0040, 0x5403, + 0x7000, 0xa084, 0xff00, 0xa086, 0x8100, 0x0040, 0x53cc, 0x0078, + 0x5403, 0x1078, 0xa1ee, 0xd5a4, 0x0040, 0x53ff, 0x1078, 0x1af7, + 0x20e1, 0x9010, 0x2001, 0x0138, 0x2202, 0x0078, 0x5407, 0x1078, + 0x540c, 0x687f, 0x0000, 0x20e1, 0x3000, 0x7828, 0x7828, 0x147f, + 0x137f, 0x157f, 0x0078, 0x53db, 0xa484, 0x01ff, 0x687e, 0xa005, + 0x0040, 0x541e, 0xa080, 0x001f, 0xa084, 0x03f8, 0x80ac, 0x20e1, + 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0x007c, 0x20a9, 0x000c, + 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0xa085, 0x0001, + 0x0078, 0x541d, 0x7000, 0xa084, 0xff00, 0xa08c, 0xf000, 0x8007, + 0xa196, 0x0000, 0x00c0, 0x5437, 0x0078, 0x567c, 0x007c, 0xa196, + 0x2000, 0x00c0, 0x5448, 0x6900, 0xa18e, 0x0001, 0x00c0, 0x5444, + 0x1078, 0x3a43, 0x0078, 0x5436, 0x1078, 0x5450, 0x0078, 0x5436, + 0xa196, 0x8000, 0x00c0, 0x5436, 0x1078, 0x570c, 0x0078, 0x5436, + 0x0c7e, 0x7110, 0xa18c, 0xff00, 0x810f, 0xa196, 0x0001, 0x0040, + 0x545d, 0xa196, 0x0023, 0x00c0, 0x5568, 0xa08e, 0x0023, 0x00c0, + 0x5492, 0x1078, 0x57b2, 0x0040, 0x5568, 0x7124, 0x610a, 0x7030, + 0xa08e, 0x0200, 0x00c0, 0x5476, 0x7034, 0xa005, 0x00c0, 0x5568, + 0x2009, 0x0015, 0x1078, 0x756c, 0x0078, 0x5568, 0xa08e, 0x0214, + 0x0040, 0x547e, 0xa08e, 0x0210, 0x00c0, 0x5484, 0x2009, 0x0015, + 0x1078, 0x756c, 0x0078, 0x5568, 0xa08e, 0x0100, 0x00c0, 0x5568, + 0x7034, 0xa005, 0x00c0, 0x5568, 0x2009, 0x0016, 0x1078, 0x756c, + 0x0078, 0x5568, 0xa08e, 0x0022, 0x00c0, 0x5568, 0x7030, 0xa08e, + 0x0300, 0x00c0, 0x54a3, 0x7034, 0xa005, 0x00c0, 0x5568, 0x2009, + 0x0017, 0x0078, 0x5534, 0xa08e, 0x0500, 0x00c0, 0x54af, 0x7034, + 0xa005, 0x00c0, 0x5568, 0x2009, 0x0018, 0x0078, 0x5534, 0xa08e, + 0x2010, 0x00c0, 0x54b7, 0x2009, 0x0019, 0x0078, 0x5534, 0xa08e, + 0x2110, 0x00c0, 0x54bf, 0x2009, 0x001a, 0x0078, 0x5534, 0xa08e, + 0x5200, 0x00c0, 0x54cb, 0x7034, 0xa005, 0x00c0, 0x5568, 0x2009, + 0x001b, 0x0078, 0x5534, 0xa08e, 0x5000, 0x00c0, 0x54d7, 0x7034, + 0xa005, 0x00c0, 0x5568, 0x2009, 0x001c, 0x0078, 0x5534, 0xa08e, + 0x1300, 0x00c0, 0x54df, 0x2009, 0x0034, 0x0078, 0x5534, 0xa08e, + 0x1200, 0x00c0, 0x54eb, 0x7034, 0xa005, 0x00c0, 0x5568, 0x2009, + 0x0024, 0x0078, 0x5534, 0xa08c, 0xff00, 0xa18e, 0x2400, 0x00c0, + 0x54f5, 0x2009, 0x002d, 0x0078, 0x5534, 0xa08c, 0xff00, 0xa18e, + 0x5300, 0x00c0, 0x54ff, 0x2009, 0x002a, 0x0078, 0x5534, 0xa08e, + 0x0f00, 0x00c0, 0x5507, 0x2009, 0x0020, 0x0078, 0x5534, 0xa08e, + 0x5300, 0x00c0, 0x550d, 0x0078, 0x552a, 0xa08e, 0x6104, 0x00c0, + 0x552a, 0x2011, 0xa88d, 0x8208, 0x2204, 0xa082, 0x0004, 0x20a8, + 0x95ac, 0x95ac, 0x2011, 0x8015, 0x211c, 0x8108, 0x047e, 0x2124, + 0x1078, 0x3579, 0x047f, 0x8108, 0x00f0, 0x551a, 0x2009, 0x0023, + 0x0078, 0x5534, 0xa08e, 0x6000, 0x00c0, 0x5532, 0x2009, 0x003f, + 0x0078, 0x5534, 0x2009, 0x001d, 0x017e, 0x2011, 0xa883, 0x2204, + 0x8211, 0x220c, 0x1078, 0x24e3, 0x00c0, 0x556a, 0x1078, 0x4499, + 0x00c0, 0x556a, 0x6612, 0x6516, 0x86ff, 0x0040, 0x555a, 0x017f, + 0x017e, 0xa186, 0x0017, 0x00c0, 0x555a, 0x6868, 0xa606, 0x00c0, + 0x555a, 0x686c, 0xa506, 0xa084, 0xff00, 0x00c0, 0x555a, 0x6000, + 0xc0f5, 0x6002, 0x0c7e, 0x1078, 0x74d7, 0x0040, 0x556d, 0x017f, + 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x017f, 0x1078, 0x756c, + 0x0c7f, 0x007c, 0x017f, 0x0078, 0x5568, 0x0c7f, 0x0078, 0x556a, + 0x0c7e, 0x1078, 0x55d4, 0x00c0, 0x55d2, 0xa184, 0xff00, 0x8007, + 0xa086, 0x0008, 0x00c0, 0x55d2, 0xa28e, 0x0033, 0x00c0, 0x55a3, + 0x1078, 0x57b2, 0x0040, 0x55d2, 0x7124, 0x610a, 0x7030, 0xa08e, + 0x0200, 0x00c0, 0x5595, 0x7034, 0xa005, 0x00c0, 0x55d2, 0x2009, + 0x0015, 0x1078, 0x756c, 0x0078, 0x55d2, 0xa08e, 0x0100, 0x00c0, + 0x55d2, 0x7034, 0xa005, 0x00c0, 0x55d2, 0x2009, 0x0016, 0x1078, + 0x756c, 0x0078, 0x55d2, 0xa28e, 0x0032, 0x00c0, 0x55d2, 0x7030, + 0xa08e, 0x1400, 0x00c0, 0x55d2, 0x2009, 0x0038, 0x017e, 0x2011, + 0xa883, 0x2204, 0x8211, 0x220c, 0x1078, 0x24e3, 0x00c0, 0x55d1, + 0x1078, 0x4499, 0x00c0, 0x55d1, 0x6612, 0x6516, 0x0c7e, 0x1078, + 0x74d7, 0x0040, 0x55d0, 0x017f, 0x611a, 0x601f, 0x0004, 0x7120, + 0x610a, 0x017f, 0x1078, 0x756c, 0x1078, 0x6109, 0x0078, 0x55d2, + 0x0c7f, 0x017f, 0x0c7f, 0x007c, 0x0f7e, 0x0d7e, 0x027e, 0x017e, + 0x137e, 0x147e, 0x157e, 0x3c00, 0x007e, 0x2079, 0x0030, 0x2069, + 0x0200, 0x1078, 0x1c25, 0x00c0, 0x5615, 0x1078, 0x1b15, 0x0040, + 0x561f, 0x7908, 0xa18c, 0x1fff, 0xa182, 0x0011, 0x00c8, 0x561f, + 0x20a9, 0x000c, 0x20e1, 0x0000, 0x2ea0, 0x2099, 0x020a, 0x53a5, + 0x20e1, 0x2000, 0x2001, 0x020a, 0x2004, 0x7a0c, 0x7808, 0xa080, + 0x0007, 0xa084, 0x1ff8, 0xa08a, 0x0140, 0x10c8, 0x1328, 0x80ac, + 0x20e1, 0x6000, 0x2099, 0x020a, 0x53a5, 0x20e1, 0x7000, 0x6828, + 0x6828, 0x7803, 0x0004, 0xa294, 0x0070, 0x007f, 0x20e0, 0x157f, + 0x147f, 0x137f, 0x017f, 0x027f, 0x0d7f, 0x0f7f, 0x007c, 0xa085, + 0x0001, 0x0078, 0x5615, 0x047e, 0x0e7e, 0x0d7e, 0x2028, 0x2130, + 0xa696, 0x00ff, 0x00c0, 0x5644, 0xa596, 0xfffd, 0x00c0, 0x5634, + 0x2009, 0x007f, 0x0078, 0x5677, 0xa596, 0xfffe, 0x00c0, 0x563c, + 0x2009, 0x007e, 0x0078, 0x5677, 0xa596, 0xfffc, 0x00c0, 0x5644, + 0x2009, 0x0080, 0x0078, 0x5677, 0x2011, 0x0000, 0x2021, 0x0081, + 0x20a9, 0x007e, 0x2071, 0xa4b5, 0x2e1c, 0x83ff, 0x00c0, 0x5656, + 0x82ff, 0x00c0, 0x566b, 0x2410, 0x0078, 0x566b, 0x2368, 0x6f10, + 0x007e, 0x2100, 0xa706, 0x007f, 0x6b14, 0x00c0, 0x5665, 0xa346, + 0x00c0, 0x5665, 0x2408, 0x0078, 0x5677, 0x87ff, 0x00c0, 0x566b, + 0x83ff, 0x0040, 0x5650, 0x8420, 0x8e70, 0x00f0, 0x564c, 0x82ff, + 0x00c0, 0x5676, 0xa085, 0x0001, 0x0078, 0x5678, 0x2208, 0xa006, + 0x0d7f, 0x0e7f, 0x047f, 0x007c, 0xa084, 0x0007, 0x0079, 0x5681, + 0x007c, 0x5689, 0x5689, 0x5689, 0x57c8, 0x5689, 0x568a, 0x56a3, + 0x56f3, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x56a2, 0x7120, 0x2160, + 0xac8c, 0x000f, 0x00c0, 0x56a2, 0xac8a, 0xaa00, 0x0048, 0x56a2, + 0x6854, 0xac02, 0x00c8, 0x56a2, 0x7124, 0x610a, 0x2009, 0x0046, + 0x1078, 0x756c, 0x007c, 0x0c7e, 0x7110, 0xd1bc, 0x00c0, 0x56f1, + 0x2011, 0xa883, 0x2204, 0x8211, 0x220c, 0x1078, 0x24e3, 0x00c0, + 0x56f1, 0x1078, 0x4499, 0x00c0, 0x56f1, 0x6612, 0x6516, 0x6000, + 0xd0ec, 0x00c0, 0x56f1, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, + 0x0006, 0x00c0, 0x56d6, 0x0c7e, 0x1078, 0x74d7, 0x017f, 0x0040, + 0x56f1, 0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x7130, 0x6122, + 0x2009, 0x0044, 0x1078, 0x756c, 0x0078, 0x56f1, 0x0c7e, 0x1078, + 0x74d7, 0x017f, 0x0040, 0x56f1, 0x611a, 0x601f, 0x0004, 0x7120, + 0x610a, 0xa286, 0x0004, 0x00c0, 0x56e9, 0x6007, 0x0005, 0x0078, + 0x56eb, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x5c45, 0x1078, + 0x6109, 0x0c7f, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x570b, 0x7020, + 0x2060, 0xac84, 0x000f, 0x00c0, 0x570b, 0xac82, 0xaa00, 0x0048, + 0x570b, 0x6854, 0xac02, 0x00c8, 0x570b, 0x7124, 0x610a, 0x2009, + 0x0045, 0x1078, 0x756c, 0x007c, 0x7110, 0xa18c, 0xff00, 0x810f, + 0xa18e, 0x0000, 0x00c0, 0x571c, 0xa084, 0x000f, 0xa08a, 0x0006, + 0x00c8, 0x571c, 0x1079, 0x571d, 0x007c, 0x5723, 0x5724, 0x5723, + 0x5723, 0x5794, 0x57a3, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x572c, + 0x702c, 0xd084, 0x0040, 0x5793, 0x700c, 0x7108, 0x1078, 0x24e3, + 0x00c0, 0x5793, 0x1078, 0x4499, 0x00c0, 0x5793, 0x6612, 0x6516, + 0x6204, 0x7110, 0xd1bc, 0x0040, 0x575e, 0xa28c, 0x00ff, 0xa186, + 0x0004, 0x0040, 0x5747, 0xa186, 0x0006, 0x00c0, 0x5784, 0x0c7e, + 0x1078, 0x57b2, 0x0c7f, 0x0040, 0x5793, 0x0c7e, 0x1078, 0x74d7, + 0x017f, 0x0040, 0x5793, 0x611a, 0x601f, 0x0002, 0x7120, 0x610a, + 0x2009, 0x0088, 0x1078, 0x756c, 0x0078, 0x5793, 0xa28c, 0x00ff, + 0xa186, 0x0006, 0x0040, 0x5773, 0xa186, 0x0004, 0x0040, 0x5773, + 0xa294, 0xff00, 0x8217, 0xa286, 0x0004, 0x0040, 0x5773, 0xa286, + 0x0006, 0x00c0, 0x5784, 0x0c7e, 0x1078, 0x74d7, 0x017f, 0x0040, + 0x5793, 0x611a, 0x601f, 0x0005, 0x7120, 0x610a, 0x2009, 0x0088, + 0x1078, 0x756c, 0x0078, 0x5793, 0x0c7e, 0x1078, 0x74d7, 0x017f, + 0x0040, 0x5793, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x2009, + 0x0001, 0x1078, 0x756c, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x57a2, + 0x1078, 0x57b2, 0x0040, 0x57a2, 0x7124, 0x610a, 0x2009, 0x0089, + 0x1078, 0x756c, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x57b1, 0x1078, + 0x57b2, 0x0040, 0x57b1, 0x7124, 0x610a, 0x2009, 0x008a, 0x1078, + 0x756c, 0x007c, 0x7020, 0x2060, 0xac84, 0x000f, 0x00c0, 0x57c5, + 0xac82, 0xaa00, 0x0048, 0x57c5, 0x2001, 0xa315, 0x2004, 0xac02, + 0x00c8, 0x57c5, 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x57c4, + 0x7110, 0xd1bc, 0x00c0, 0x57de, 0x7024, 0x2060, 0xac84, 0x000f, + 0x00c0, 0x57de, 0xac82, 0xaa00, 0x0048, 0x57de, 0x6854, 0xac02, + 0x00c8, 0x57de, 0x2009, 0x0051, 0x1078, 0x756c, 0x007c, 0x2071, + 0xa5be, 0x7003, 0x0003, 0x700f, 0x0361, 0xa006, 0x701a, 0x7012, + 0x7017, 0xaa00, 0x7007, 0x0000, 0x7026, 0x702b, 0x6c4e, 0x7032, + 0x7037, 0x6ca0, 0x703b, 0x0002, 0x703f, 0x0000, 0x7043, 0xffff, + 0x7047, 0xffff, 0x007c, 0x2071, 0xa5be, 0x00e0, 0x58c1, 0x2091, + 0x6000, 0x700c, 0x8001, 0x700e, 0x00c0, 0x5873, 0x700f, 0x0361, + 0x7007, 0x0001, 0x127e, 0x2091, 0x8000, 0x7138, 0x8109, 0x713a, + 0x00c0, 0x5871, 0x703b, 0x0002, 0x2009, 0x0100, 0x2104, 0xa082, + 0x0003, 0x00c8, 0x5871, 0x703c, 0xa086, 0x0001, 0x00c0, 0x584e, + 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x582c, + 0x6803, 0x1000, 0x0078, 0x5833, 0x6804, 0xa084, 0x1000, 0x0040, + 0x5833, 0x6803, 0x0100, 0x6803, 0x0000, 0x703f, 0x0000, 0x2069, + 0xa5ab, 0x6804, 0xa082, 0x0006, 0x00c0, 0x5840, 0x6807, 0x0000, + 0x6830, 0xa082, 0x0003, 0x00c0, 0x5847, 0x6833, 0x0000, 0x1078, + 0x6109, 0x1078, 0x61d3, 0x0d7f, 0x0078, 0x5871, 0x0d7e, 0x2069, + 0xa300, 0x6944, 0x6860, 0xa102, 0x00c8, 0x5870, 0x2069, 0xa5ab, + 0x6804, 0xa086, 0x0000, 0x00c0, 0x5870, 0x6830, 0xa086, 0x0000, + 0x00c0, 0x5870, 0x703f, 0x0001, 0x6807, 0x0006, 0x6833, 0x0003, + 0x2069, 0x0100, 0x6830, 0x689e, 0x2069, 0x0140, 0x6803, 0x0600, + 0x0d7f, 0x0078, 0x5876, 0x127e, 0x2091, 0x8000, 0x7024, 0xa00d, + 0x0040, 0x588e, 0x7020, 0x8001, 0x7022, 0x00c0, 0x588e, 0x7023, + 0x0009, 0x8109, 0x7126, 0xa186, 0x03e8, 0x00c0, 0x5889, 0x7028, + 0x107a, 0x81ff, 0x00c0, 0x588e, 0x7028, 0x107a, 0x7030, 0xa00d, + 0x0040, 0x589f, 0x702c, 0x8001, 0x702e, 0x00c0, 0x589f, 0x702f, + 0x0009, 0x8109, 0x7132, 0x00c0, 0x589f, 0x7034, 0x107a, 0x7040, + 0xa005, 0x0040, 0x58a7, 0x0050, 0x58a7, 0x8001, 0x7042, 0x7044, + 0xa005, 0x0040, 0x58af, 0x0050, 0x58af, 0x8001, 0x7046, 0x7018, + 0xa00d, 0x0040, 0x58c0, 0x7008, 0x8001, 0x700a, 0x00c0, 0x58c0, + 0x700b, 0x0009, 0x8109, 0x711a, 0x00c0, 0x58c0, 0x701c, 0x107a, + 0x127f, 0x7004, 0x0079, 0x58c4, 0x58eb, 0x58ec, 0x5908, 0x0e7e, + 0x2071, 0xa5be, 0x7018, 0xa005, 0x00c0, 0x58d2, 0x711a, 0x721e, + 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x2071, 0xa5be, + 0x701c, 0xa206, 0x00c0, 0x58de, 0x701a, 0x701e, 0x007f, 0x0e7f, + 0x007c, 0x0e7e, 0x2071, 0xa5be, 0x6088, 0xa102, 0x0048, 0x58e9, + 0x618a, 0x0e7f, 0x007c, 0x007c, 0x7110, 0x1078, 0x4501, 0x00c0, + 0x58fe, 0x6088, 0x8001, 0x0048, 0x58fe, 0x608a, 0x00c0, 0x58fe, + 0x127e, 0x2091, 0x8000, 0x1078, 0x6109, 0x127f, 0x8108, 0xa182, + 0x00ff, 0x0048, 0x5906, 0xa00e, 0x7007, 0x0002, 0x7112, 0x007c, + 0x7014, 0x2060, 0x127e, 0x2091, 0x8000, 0x603c, 0xa005, 0x0040, + 0x5917, 0x8001, 0x603e, 0x00c0, 0x5917, 0x1078, 0x8cd7, 0x6014, + 0xa005, 0x0040, 0x5941, 0x8001, 0x6016, 0x00c0, 0x5941, 0x611c, + 0xa186, 0x0003, 0x0040, 0x5928, 0xa186, 0x0006, 0x00c0, 0x593f, + 0x6010, 0x2068, 0x6854, 0xa08a, 0x199a, 0x0048, 0x593f, 0xa082, + 0x1999, 0x6856, 0xa08a, 0x199a, 0x0048, 0x5938, 0x2001, 0x1999, + 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x0078, 0x5941, 0x1078, + 0x8810, 0x127f, 0xac88, 0x0010, 0x7116, 0x2001, 0xca00, 0xa102, + 0x0048, 0x594e, 0x7017, 0xaa00, 0x7007, 0x0000, 0x007c, 0x0e7e, + 0x2071, 0xa5be, 0x7027, 0x07d0, 0x7023, 0x0009, 0x703b, 0x0002, + 0x0e7f, 0x007c, 0x2001, 0xa5c7, 0x2003, 0x0000, 0x007c, 0x0e7e, + 0x2071, 0xa5be, 0x7132, 0x702f, 0x0009, 0x0e7f, 0x007c, 0x2011, + 0xa5ca, 0x2013, 0x0000, 0x007c, 0x0e7e, 0x2071, 0xa5be, 0x711a, + 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c, 0x027e, 0x0e7e, 0x0f7e, + 0x2079, 0xa300, 0x7a34, 0xd294, 0x0040, 0x59a4, 0x2071, 0xa5aa, + 0x2e14, 0xa0fe, 0x0000, 0x0040, 0x5991, 0xa0fe, 0x0001, 0x0040, + 0x5995, 0xa0fe, 0x0002, 0x00c0, 0x59a0, 0xa292, 0x0085, 0x0078, + 0x5997, 0xa292, 0x0005, 0x0078, 0x5997, 0xa292, 0x0002, 0x2272, + 0x0040, 0x599c, 0x00c8, 0x59a4, 0x2011, 0x8037, 0x1078, 0x3579, + 0x2011, 0xa5a9, 0x2204, 0x2072, 0x0f7f, 0x0e7f, 0x027f, 0x007c, + 0x0c7e, 0x2061, 0xa62d, 0x0c7f, 0x007c, 0xa184, 0x000f, 0x8003, + 0x8003, 0x8003, 0xa080, 0xa62d, 0x2060, 0x007c, 0x6854, 0xa08a, + 0x199a, 0x0048, 0x59bd, 0x2001, 0x1999, 0xa005, 0x00c0, 0x59cc, + 0x0c7e, 0x2061, 0xa62d, 0x6014, 0x0c7f, 0xa005, 0x00c0, 0x59d1, + 0x2001, 0x001e, 0x0078, 0x59d1, 0xa08e, 0xffff, 0x00c0, 0x59d1, + 0xa006, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x684c, 0xa08c, + 0x00c0, 0xa18e, 0x00c0, 0x0040, 0x5a24, 0xd0b4, 0x00c0, 0x59e8, + 0xd0bc, 0x00c0, 0x5a14, 0x2009, 0x0006, 0x1078, 0x5a43, 0x007c, + 0xd0fc, 0x0040, 0x59f3, 0xa084, 0x0003, 0x0040, 0x59f3, 0xa086, + 0x0003, 0x00c0, 0x5a3c, 0x6024, 0xd0d4, 0x0040, 0x59fd, 0xc0d4, + 0x6026, 0x6860, 0x602a, 0x685c, 0x602e, 0x2009, 0xa373, 0x2104, + 0xd084, 0x0040, 0x5a0f, 0x6118, 0xa188, 0x0027, 0x2104, 0xd08c, + 0x00c0, 0x5a0f, 0x2009, 0x0042, 0x1078, 0x756c, 0x007c, 0x2009, + 0x0043, 0x1078, 0x756c, 0x007c, 0xd0fc, 0x0040, 0x5a1f, 0xa084, + 0x0003, 0x0040, 0x5a1f, 0xa086, 0x0003, 0x00c0, 0x5a3c, 0x2009, + 0x0042, 0x1078, 0x756c, 0x007c, 0xd0fc, 0x0040, 0x5a32, 0xa084, + 0x0003, 0xa08e, 0x0002, 0x0040, 0x5a36, 0x2009, 0x0041, 0x1078, + 0x756c, 0x007c, 0x1078, 0x5a41, 0x0078, 0x5a31, 0x2009, 0x0043, + 0x1078, 0x756c, 0x0078, 0x5a31, 0x2009, 0x0004, 0x1078, 0x5a43, + 0x007c, 0x2009, 0x0001, 0x0d7e, 0x6010, 0xa0ec, 0xf000, 0x0040, + 0x5a6b, 0x2068, 0x6952, 0x6800, 0x6012, 0xa186, 0x0001, 0x00c0, + 0x5a65, 0x694c, 0xa18c, 0x8100, 0xa18e, 0x8100, 0x00c0, 0x5a65, + 0x0c7e, 0x2061, 0xa62d, 0x6200, 0xd28c, 0x00c0, 0x5a64, 0x6204, + 0x8210, 0x0048, 0x5a64, 0x6206, 0x0c7f, 0x1078, 0x4982, 0x6010, + 0xa06d, 0x10c0, 0x59b6, 0x0d7f, 0x007c, 0x157e, 0x0c7e, 0x2061, + 0xa62d, 0x6000, 0x81ff, 0x0040, 0x5a78, 0xa205, 0x0078, 0x5a79, + 0xa204, 0x6002, 0x0c7f, 0x157f, 0x007c, 0x6800, 0xd08c, 0x00c0, + 0x5a89, 0x6808, 0xa005, 0x0040, 0x5a89, 0x8001, 0x680a, 0xa085, + 0x0001, 0x007c, 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086, 0x818e, + 0x00c8, 0x5a93, 0xa200, 0x00f0, 0x5a8e, 0x8086, 0x818e, 0x007c, + 0x157e, 0x20a9, 0x0010, 0xa005, 0x0040, 0x5ab9, 0xa11a, 0x00c8, + 0x5ab9, 0x8213, 0x818d, 0x0048, 0x5aac, 0xa11a, 0x00c8, 0x5aad, + 0x00f0, 0x5aa1, 0x0078, 0x5ab1, 0xa11a, 0x2308, 0x8210, 0x00f0, + 0x5aa1, 0x007e, 0x3200, 0xa084, 0xf7ff, 0x2080, 0x007f, 0x157f, + 0x007c, 0x007e, 0x3200, 0xa085, 0x0800, 0x0078, 0x5ab5, 0x127e, + 0x2091, 0x2200, 0x2079, 0xa5ab, 0x127f, 0x0d7e, 0x2069, 0xa5ab, + 0x6803, 0x0005, 0x2069, 0x0004, 0x2d04, 0xa085, 0x8001, 0x206a, + 0x0d7f, 0x007c, 0x0c7e, 0x6027, 0x0001, 0x7804, 0xa084, 0x0007, + 0x0079, 0x5ada, 0x5ae4, 0x5b09, 0x5b64, 0x5aea, 0x5b09, 0x5ae4, + 0x5ae2, 0x5ae2, 0x1078, 0x1328, 0x1078, 0x595a, 0x1078, 0x6109, + 0x0c7f, 0x007c, 0x62c0, 0x82ff, 0x00c0, 0x5af0, 0x0c7f, 0x007c, + 0x2011, 0x4129, 0x1078, 0x58d4, 0x7828, 0xa092, 0x00c8, 0x00c8, + 0x5aff, 0x8000, 0x782a, 0x1078, 0x4168, 0x0078, 0x5aee, 0x1078, + 0x4129, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b, 0x0000, 0x0078, + 0x5aee, 0x1078, 0x595a, 0x3c00, 0x007e, 0x2011, 0x0209, 0x20e1, + 0x4000, 0x2214, 0x007f, 0x20e0, 0x82ff, 0x0040, 0x5b27, 0x62c0, + 0x82ff, 0x00c0, 0x5b27, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, + 0x1328, 0x2009, 0x0013, 0x1078, 0x756c, 0x0c7f, 0x007c, 0x3900, + 0xa082, 0xa6cd, 0x00c8, 0x5b2e, 0x1078, 0x728a, 0x0c7e, 0x7824, + 0xa065, 0x1040, 0x1328, 0x7804, 0xa086, 0x0004, 0x0040, 0x5ba9, + 0x7828, 0xa092, 0x2710, 0x00c8, 0x5b44, 0x8000, 0x782a, 0x0c7f, + 0x1078, 0x6c33, 0x0078, 0x5b25, 0x6104, 0xa186, 0x0003, 0x00c0, + 0x5b5b, 0x0e7e, 0x2071, 0xa300, 0x70d4, 0x0e7f, 0xd08c, 0x0040, + 0x5b5b, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071, 0xa300, 0x1078, + 0x4171, 0x0e7f, 0x0c7f, 0x1078, 0xa241, 0x2009, 0x0014, 0x1078, + 0x756c, 0x0c7f, 0x0078, 0x5b25, 0x2001, 0xa5c7, 0x2003, 0x0000, + 0x62c0, 0x82ff, 0x00c0, 0x5b78, 0x782b, 0x0000, 0x7824, 0xa065, + 0x1040, 0x1328, 0x2009, 0x0013, 0x1078, 0x75c3, 0x0c7f, 0x007c, + 0x0c7e, 0x0d7e, 0x3900, 0xa082, 0xa6cd, 0x00c8, 0x5b81, 0x1078, + 0x728a, 0x7824, 0xa005, 0x1040, 0x1328, 0x781c, 0xa06d, 0x1040, + 0x1328, 0x6800, 0xc0dc, 0x6802, 0x7924, 0x2160, 0x1078, 0x753d, + 0x693c, 0x81ff, 0x1040, 0x1328, 0x8109, 0x693e, 0x6854, 0xa015, + 0x0040, 0x5b9d, 0x7a1e, 0x0078, 0x5b9f, 0x7918, 0x791e, 0x7807, + 0x0000, 0x7827, 0x0000, 0x0d7f, 0x0c7f, 0x1078, 0x6109, 0x0078, + 0x5b76, 0x6104, 0xa186, 0x0002, 0x0040, 0x5bb4, 0xa186, 0x0004, + 0x0040, 0x5bb4, 0x0078, 0x5b38, 0x7808, 0xac06, 0x0040, 0x5b38, + 0x1078, 0x6010, 0x1078, 0x5c45, 0x0c7f, 0x1078, 0x6109, 0x0078, + 0x5b25, 0x0c7e, 0x6027, 0x0002, 0x62c8, 0x82ff, 0x00c0, 0x5bdb, + 0x62c4, 0x82ff, 0x00c0, 0x5bdb, 0x793c, 0xa1e5, 0x0000, 0x0040, + 0x5bd5, 0x2009, 0x0049, 0x1078, 0x756c, 0x2011, 0xa5ca, 0x2013, + 0x0000, 0x0c7f, 0x007c, 0x3908, 0xa192, 0xa6cd, 0x00c8, 0x5be2, + 0x1078, 0x728a, 0x6017, 0x0010, 0x793c, 0x81ff, 0x0040, 0x5bd5, + 0x793c, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x5bf4, + 0x6017, 0x0012, 0x0078, 0x5bd9, 0x6017, 0x0016, 0x0078, 0x5bd9, + 0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f, 0x0000, + 0x2c08, 0x2061, 0xa5ab, 0x6020, 0x8000, 0x6022, 0x6010, 0xa005, + 0x0040, 0x5c13, 0xa080, 0x0003, 0x2102, 0x6112, 0x127f, 0x0c7f, + 0x017f, 0x007f, 0x007c, 0x6116, 0x6112, 0x0078, 0x5c0e, 0x0d7e, + 0x2069, 0xa5ab, 0x6000, 0xd0d4, 0x0040, 0x5c2c, 0x6820, 0x8000, + 0x6822, 0xa086, 0x0001, 0x00c0, 0x5c27, 0x2c00, 0x681e, 0x6804, + 0xa084, 0x0007, 0x0079, 0x6111, 0xc0d5, 0x6002, 0x6818, 0xa005, + 0x0040, 0x5c3e, 0x6056, 0x605b, 0x0000, 0x007e, 0x2c00, 0x681a, + 0x0d7f, 0x685a, 0x2069, 0xa5ab, 0x0078, 0x5c1e, 0x6056, 0x605a, + 0x2c00, 0x681a, 0x681e, 0x0078, 0x5c1e, 0x007e, 0x017e, 0x0c7e, + 0x127e, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0xa5ab, + 0x6020, 0x8000, 0x6022, 0x6008, 0xa005, 0x0040, 0x5c60, 0xa080, + 0x0003, 0x2102, 0x610a, 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, + 0x610e, 0x610a, 0x0078, 0x5c5b, 0x0c7e, 0x600f, 0x0000, 0x2c08, + 0x2061, 0xa5ab, 0x6034, 0xa005, 0x0040, 0x5c74, 0xa080, 0x0003, + 0x2102, 0x6136, 0x0c7f, 0x007c, 0x613a, 0x6136, 0x0078, 0x5c72, + 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x017e, 0x007e, + 0x127e, 0x2071, 0xa5ab, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, + 0x8cff, 0x0040, 0x5ced, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, + 0x00c0, 0x5ce8, 0x87ff, 0x0040, 0x5c99, 0x6020, 0xa106, 0x00c0, + 0x5ce8, 0x703c, 0xac06, 0x00c0, 0x5cab, 0x037e, 0x2019, 0x0001, + 0x1078, 0x6e6c, 0x7033, 0x0000, 0x703f, 0x0000, 0x7043, 0x0000, + 0x7047, 0x0000, 0x037f, 0x7038, 0xac36, 0x00c0, 0x5cb1, 0x660c, + 0x763a, 0x7034, 0xac36, 0x00c0, 0x5cbf, 0x2c00, 0xaf36, 0x0040, + 0x5cbd, 0x2f00, 0x7036, 0x0078, 0x5cbf, 0x7037, 0x0000, 0x660c, + 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5cc8, 0x7e0e, 0x0078, 0x5cc9, + 0x2678, 0x600f, 0x0000, 0x1078, 0x8a44, 0x0040, 0x5ce3, 0x6010, + 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5cf7, 0x6837, 0x0103, + 0x6b4a, 0x6847, 0x0000, 0x1078, 0x8cb8, 0x1078, 0xa181, 0x1078, + 0x4982, 0x1078, 0x8bf4, 0x1078, 0x8c01, 0x0c7f, 0x0078, 0x5c88, + 0x2c78, 0x600c, 0x2060, 0x0078, 0x5c88, 0x127f, 0x007f, 0x017f, + 0x027f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, + 0xa086, 0x0006, 0x00c0, 0x5cd6, 0x1078, 0xa181, 0x1078, 0x9e70, + 0x0078, 0x5ce3, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x0f7e, 0x2031, + 0x0000, 0x127e, 0x2091, 0x8000, 0x2079, 0xa5ab, 0x7838, 0xa065, + 0x0040, 0x5d41, 0x600c, 0x007e, 0x600f, 0x0000, 0x783c, 0xac06, + 0x00c0, 0x5d28, 0x037e, 0x2019, 0x0001, 0x1078, 0x6e6c, 0x7833, + 0x0000, 0x783f, 0x0000, 0x7843, 0x0000, 0x7847, 0x0000, 0x037f, + 0x1078, 0x8a44, 0x0040, 0x5d3c, 0x6010, 0x2068, 0x601c, 0xa086, + 0x0003, 0x00c0, 0x5d4a, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, + 0x1078, 0x4982, 0x1078, 0x8bf4, 0x1078, 0x8c01, 0x007f, 0x0078, + 0x5d0f, 0x7e3a, 0x7e36, 0x127f, 0x0f7f, 0x0d7f, 0x0c7f, 0x067f, + 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x5d33, 0x1078, + 0x9e70, 0x0078, 0x5d3c, 0x017e, 0x027e, 0x087e, 0x2041, 0x0000, + 0x1078, 0x5d6d, 0x1078, 0x5e21, 0x087f, 0x027f, 0x017f, 0x007c, + 0x0f7e, 0x127e, 0x2079, 0xa5ab, 0x2091, 0x8000, 0x1078, 0x5ebc, + 0x1078, 0x5f32, 0x127f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, + 0x0c7e, 0x067e, 0x017e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, + 0xa5ab, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0040, 0x5e01, 0x6018, + 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x5dfc, 0x88ff, 0x0040, + 0x5d8d, 0x6020, 0xa106, 0x00c0, 0x5dfc, 0x7024, 0xac06, 0x00c0, + 0x5dbd, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x5db8, 0x1078, + 0x595a, 0x1078, 0x6c41, 0x68c3, 0x0000, 0x1078, 0x7188, 0x7027, + 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, + 0x5dad, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, + 0xd084, 0x0040, 0x5db5, 0x6827, 0x0001, 0x037f, 0x0078, 0x5dbd, + 0x6003, 0x0009, 0x630a, 0x0078, 0x5dfc, 0x7014, 0xac36, 0x00c0, + 0x5dc3, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0, 0x5dd1, 0x2c00, + 0xaf36, 0x0040, 0x5dcf, 0x2f00, 0x7012, 0x0078, 0x5dd1, 0x7013, + 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5dda, 0x7e0e, + 0x0078, 0x5ddb, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078, + 0x8a44, 0x0040, 0x5df5, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5e0a, + 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x8cb8, 0x1078, + 0xa181, 0x1078, 0x4982, 0x1078, 0x8bf4, 0x1078, 0x8c01, 0x1078, + 0x7045, 0x0c7f, 0x0078, 0x5d7c, 0x2c78, 0x600c, 0x2060, 0x0078, + 0x5d7c, 0x127f, 0x007f, 0x017f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, + 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x5e15, 0x1078, + 0xa181, 0x1078, 0x9e70, 0x0078, 0x5df5, 0x601c, 0xa086, 0x0002, + 0x00c0, 0x5df5, 0x6004, 0xa086, 0x0085, 0x0040, 0x5de8, 0x0078, + 0x5df5, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0xa280, 0xa434, + 0x2004, 0xa065, 0x0040, 0x5eb8, 0x0f7e, 0x0e7e, 0x0d7e, 0x067e, + 0x2071, 0xa5ab, 0x6654, 0x7018, 0xac06, 0x00c0, 0x5e38, 0x761a, + 0x701c, 0xac06, 0x00c0, 0x5e44, 0x86ff, 0x00c0, 0x5e43, 0x7018, + 0x701e, 0x0078, 0x5e44, 0x761e, 0x6058, 0xa07d, 0x0040, 0x5e49, + 0x7e56, 0xa6ed, 0x0000, 0x0040, 0x5e4f, 0x2f00, 0x685a, 0x6057, + 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, + 0x4410, 0x0040, 0x5eb4, 0x7624, 0x86ff, 0x0040, 0x5ea2, 0xa680, + 0x0004, 0x2004, 0xad06, 0x00c0, 0x5ea2, 0x0d7e, 0x2069, 0x0100, + 0x68c0, 0xa005, 0x0040, 0x5e99, 0x1078, 0x595a, 0x1078, 0x6c41, + 0x68c3, 0x0000, 0x1078, 0x7188, 0x7027, 0x0000, 0x037e, 0x2069, + 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x5e82, 0x6803, 0x0100, + 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5e8a, + 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, + 0x5e93, 0x8001, 0x603e, 0x2660, 0x1078, 0x8c01, 0x0c7f, 0x0078, + 0x5ea2, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, + 0x0078, 0x5e57, 0x8dff, 0x0040, 0x5eb0, 0x6837, 0x0103, 0x6b4a, + 0x6847, 0x0000, 0x1078, 0x8cb8, 0x1078, 0xa181, 0x1078, 0x4982, + 0x1078, 0x7045, 0x0078, 0x5e57, 0x067f, 0x0d7f, 0x0e7f, 0x0f7f, + 0x127f, 0x007f, 0x0c7f, 0x007c, 0x007e, 0x067e, 0x0c7e, 0x0d7e, + 0x2031, 0x0000, 0x7814, 0xa065, 0x0040, 0x5f16, 0x600c, 0x007e, + 0x600f, 0x0000, 0x7824, 0xac06, 0x00c0, 0x5efb, 0x2069, 0x0100, + 0x68c0, 0xa005, 0x0040, 0x5ef5, 0x1078, 0x595a, 0x1078, 0x6c41, + 0x68c3, 0x0000, 0x1078, 0x7188, 0x7827, 0x0000, 0x037e, 0x2069, + 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x5eea, 0x6803, 0x0100, + 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5ef2, + 0x6827, 0x0001, 0x037f, 0x0078, 0x5efb, 0x6003, 0x0009, 0x630a, + 0x2c30, 0x0078, 0x5f13, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, + 0x5f0f, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5f1d, 0x6837, 0x0103, + 0x6b4a, 0x6847, 0x0000, 0x1078, 0x4982, 0x1078, 0x8bf4, 0x1078, + 0x8c01, 0x1078, 0x7045, 0x007f, 0x0078, 0x5ec3, 0x7e16, 0x7e12, + 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, + 0x00c0, 0x5f26, 0x1078, 0x9e70, 0x0078, 0x5f0f, 0x601c, 0xa086, + 0x0002, 0x00c0, 0x5f0f, 0x6004, 0xa086, 0x0085, 0x0040, 0x5f06, + 0x0078, 0x5f0f, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x7818, 0xa065, + 0x0040, 0x5fa0, 0x6054, 0x007e, 0x6057, 0x0000, 0x605b, 0x0000, + 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x4410, 0x0040, 0x5f9d, + 0x7e24, 0x86ff, 0x0040, 0x5f8f, 0xa680, 0x0004, 0x2004, 0xad06, + 0x00c0, 0x5f8f, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, + 0x5f86, 0x1078, 0x595a, 0x1078, 0x6c41, 0x68c3, 0x0000, 0x1078, + 0x7188, 0x7827, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, + 0x1000, 0x0040, 0x5f6f, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, + 0x0100, 0x6824, 0xd084, 0x0040, 0x5f77, 0x6827, 0x0001, 0x037f, + 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x5f80, 0x8001, 0x603e, + 0x2660, 0x1078, 0x8c01, 0x0c7f, 0x0078, 0x5f8f, 0x0d7f, 0x0c7e, + 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x5f44, 0x8dff, + 0x0040, 0x5f99, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, + 0x4982, 0x1078, 0x7045, 0x0078, 0x5f44, 0x007f, 0x0078, 0x5f37, + 0x781e, 0x781a, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x0e7e, + 0x0d7e, 0x067e, 0x6000, 0xd0dc, 0x0040, 0x5fc4, 0x604c, 0xa06d, + 0x0040, 0x5fc4, 0x6848, 0xa606, 0x00c0, 0x5fc4, 0x2071, 0xa5ab, + 0x7024, 0xa035, 0x0040, 0x5fc4, 0xa080, 0x0004, 0x2004, 0xad06, + 0x00c0, 0x5fc4, 0x1078, 0x5fc8, 0x067f, 0x0d7f, 0x0e7f, 0x007c, + 0x0f7e, 0x2079, 0x0100, 0x78c0, 0xa005, 0x00c0, 0x5fd7, 0x0c7e, + 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x600e, 0x1078, + 0x6c41, 0x78c3, 0x0000, 0x1078, 0x7188, 0x7027, 0x0000, 0x037e, + 0x2079, 0x0140, 0x7b04, 0xa384, 0x1000, 0x0040, 0x5feb, 0x7803, + 0x0100, 0x7803, 0x0000, 0x2079, 0x0100, 0x7824, 0xd084, 0x0040, + 0x5ff3, 0x7827, 0x0001, 0x1078, 0x7188, 0x037f, 0x1078, 0x4410, + 0x0c7e, 0x603c, 0xa005, 0x0040, 0x5fff, 0x8001, 0x603e, 0x2660, + 0x1078, 0x753d, 0x0c7f, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, + 0x1078, 0x8cb8, 0x1078, 0x4982, 0x1078, 0x7045, 0x0f7f, 0x007c, + 0x0e7e, 0x0c7e, 0x2071, 0xa5ab, 0x7004, 0xa084, 0x0007, 0x0079, + 0x6019, 0x6023, 0x6026, 0x603f, 0x605b, 0x60a0, 0x6023, 0x6023, + 0x6021, 0x1078, 0x1328, 0x0c7f, 0x0e7f, 0x007c, 0x7024, 0xa065, + 0x0040, 0x6034, 0x7020, 0x8001, 0x7022, 0x600c, 0xa015, 0x0040, + 0x603b, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027, 0x0000, + 0x0c7f, 0x0e7f, 0x007c, 0x7216, 0x7212, 0x0078, 0x6034, 0x6018, + 0x2060, 0x1078, 0x4410, 0x6000, 0xc0dc, 0x6002, 0x7020, 0x8001, + 0x7022, 0x0040, 0x6050, 0x6054, 0xa015, 0x0040, 0x6057, 0x721e, + 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7218, + 0x721e, 0x0078, 0x6050, 0x7024, 0xa065, 0x0040, 0x609d, 0x700c, + 0xac06, 0x00c0, 0x6072, 0x1078, 0x7045, 0x600c, 0xa015, 0x0040, + 0x606e, 0x720e, 0x600f, 0x0000, 0x0078, 0x609b, 0x720e, 0x720a, + 0x0078, 0x609b, 0x7014, 0xac06, 0x00c0, 0x6085, 0x1078, 0x7045, + 0x600c, 0xa015, 0x0040, 0x6081, 0x7216, 0x600f, 0x0000, 0x0078, + 0x609b, 0x7216, 0x7212, 0x0078, 0x609b, 0x6018, 0x2060, 0x1078, + 0x4410, 0x6000, 0xc0dc, 0x6002, 0x1078, 0x7045, 0x701c, 0xa065, + 0x0040, 0x609b, 0x6054, 0xa015, 0x0040, 0x6099, 0x721e, 0x0078, + 0x609b, 0x7218, 0x721e, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, + 0x7024, 0xa065, 0x0040, 0x60ad, 0x1078, 0x7045, 0x600c, 0xa015, + 0x0040, 0x60b4, 0x720e, 0x600f, 0x0000, 0x1078, 0x7188, 0x7027, + 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x720e, 0x720a, 0x0078, 0x60ad, + 0x0d7e, 0x2069, 0xa5ab, 0x6830, 0xa084, 0x0003, 0x0079, 0x60c0, + 0x60c6, 0x60c8, 0x60ee, 0x60c6, 0x1078, 0x1328, 0x0d7f, 0x007c, + 0x0c7e, 0x6840, 0xa086, 0x0001, 0x0040, 0x60e4, 0x683c, 0xa065, + 0x0040, 0x60d9, 0x600c, 0xa015, 0x0040, 0x60e0, 0x6a3a, 0x600f, + 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c7f, 0x0d7f, 0x007c, + 0x683a, 0x6836, 0x0078, 0x60d9, 0x6843, 0x0000, 0x6838, 0xa065, + 0x0040, 0x60d9, 0x6003, 0x0003, 0x0078, 0x60d9, 0x0c7e, 0x6843, + 0x0000, 0x6847, 0x0000, 0x683c, 0xa065, 0x0040, 0x6106, 0x600c, + 0xa015, 0x0040, 0x6102, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000, + 0x0078, 0x6106, 0x683f, 0x0000, 0x683a, 0x6836, 0x0c7f, 0x0d7f, + 0x007c, 0x0d7e, 0x2069, 0xa5ab, 0x6804, 0xa084, 0x0007, 0x0079, + 0x6111, 0x611b, 0x61c2, 0x61c2, 0x61c2, 0x61c2, 0x61c4, 0x61c2, + 0x6119, 0x1078, 0x1328, 0x6820, 0xa005, 0x00c0, 0x6121, 0x0d7f, + 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x6130, 0x6807, 0x0004, + 0x6826, 0x682b, 0x0000, 0x1078, 0x620a, 0x0c7f, 0x0d7f, 0x007c, + 0x6814, 0xa065, 0x0040, 0x613e, 0x6807, 0x0001, 0x6826, 0x682b, + 0x0000, 0x1078, 0x620a, 0x0c7f, 0x0d7f, 0x007c, 0x0e7e, 0x037e, + 0x6a1c, 0xa2f5, 0x0000, 0x0040, 0x61bd, 0x704c, 0xa00d, 0x0040, + 0x614d, 0x7088, 0xa005, 0x0040, 0x6165, 0x7054, 0xa075, 0x0040, + 0x6156, 0xa20e, 0x0040, 0x61bd, 0x0078, 0x615b, 0x6818, 0xa20e, + 0x0040, 0x61bd, 0x2070, 0x704c, 0xa00d, 0x0040, 0x614d, 0x7088, + 0xa005, 0x00c0, 0x614d, 0x2e00, 0x681e, 0x733c, 0x7038, 0xa302, + 0x00c8, 0x614d, 0x1078, 0x750c, 0x0040, 0x61bd, 0x8318, 0x733e, + 0x6112, 0x2e10, 0x621a, 0xa180, 0x0014, 0x2004, 0xa084, 0x00ff, + 0x6032, 0xa180, 0x0014, 0x2003, 0x0000, 0xa180, 0x0015, 0x2004, + 0xa08a, 0x199a, 0x0048, 0x6186, 0x2001, 0x1999, 0x8003, 0x801b, + 0x831b, 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78, 0x71a0, 0xd1bc, + 0x0040, 0x619f, 0x7100, 0xd1f4, 0x0040, 0x619b, 0x7114, 0xa18c, + 0x00ff, 0x0078, 0x61a4, 0x2009, 0x0000, 0x0078, 0x61a4, 0xa1e0, + 0x293f, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0x1078, + 0x679b, 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26, + 0x682b, 0x0000, 0x781f, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040, + 0x0f7f, 0x0e7f, 0x0c7f, 0x0d7f, 0x007c, 0x037f, 0x0e7f, 0x0c7f, + 0x0078, 0x61bb, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, + 0x61d0, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x620a, + 0x0c7f, 0x0d7f, 0x007c, 0x0f7e, 0x0d7e, 0x2069, 0xa5ab, 0x6830, + 0xa086, 0x0000, 0x00c0, 0x61f1, 0x6838, 0xa07d, 0x0040, 0x61f1, + 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x127e, 0x0f7e, 0x2091, + 0x2200, 0x027f, 0x1078, 0x1d28, 0x00c0, 0x61f4, 0x127f, 0x1078, + 0x6ae5, 0x0d7f, 0x0f7f, 0x007c, 0x127f, 0x6843, 0x0000, 0x7803, + 0x0002, 0x780c, 0xa015, 0x0040, 0x6206, 0x6a3a, 0x780f, 0x0000, + 0x6833, 0x0000, 0x683f, 0x0000, 0x0078, 0x61f1, 0x683a, 0x6836, + 0x0078, 0x6200, 0x601c, 0xa084, 0x000f, 0x1079, 0x6210, 0x007c, + 0x6219, 0x621e, 0x663f, 0x6758, 0x621e, 0x663f, 0x6758, 0x6219, + 0x621e, 0x1078, 0x6010, 0x1078, 0x6109, 0x007c, 0x157e, 0x137e, + 0x147e, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0044, 0x10c8, 0x1328, + 0x6118, 0x2178, 0x79a0, 0xd1bc, 0x0040, 0x623b, 0x7900, 0xd1f4, + 0x0040, 0x6237, 0x7914, 0xa18c, 0x00ff, 0x0078, 0x6240, 0x2009, + 0x0000, 0x0078, 0x6240, 0xa1f8, 0x293f, 0x2f0c, 0xa18c, 0x00ff, + 0x2c78, 0x2061, 0x0100, 0x619a, 0xa08a, 0x0040, 0x00c8, 0x6292, + 0x1079, 0x6250, 0x0f7f, 0x0c7f, 0x147f, 0x137f, 0x157f, 0x007c, + 0x62f8, 0x6340, 0x6368, 0x6403, 0x6433, 0x643b, 0x6462, 0x6473, + 0x6484, 0x648c, 0x64a4, 0x648c, 0x650f, 0x6473, 0x6530, 0x6538, + 0x6484, 0x6538, 0x6549, 0x6290, 0x6290, 0x6290, 0x6290, 0x6290, + 0x6290, 0x6290, 0x6290, 0x6290, 0x6290, 0x6290, 0x6d05, 0x6d2a, + 0x6d3f, 0x6d62, 0x6d83, 0x6462, 0x6290, 0x6462, 0x648c, 0x6290, + 0x6368, 0x6403, 0x6290, 0x72ac, 0x648c, 0x6290, 0x72cc, 0x648c, + 0x6290, 0x6290, 0x62f3, 0x62a1, 0x6290, 0x72f1, 0x7368, 0x7450, + 0x6290, 0x7461, 0x645c, 0x747d, 0x6290, 0x6d98, 0x6290, 0x6290, + 0x1078, 0x1328, 0x2100, 0x1079, 0x629b, 0x0f7f, 0x0c7f, 0x147f, + 0x137f, 0x157f, 0x007c, 0x629f, 0x629f, 0x629f, 0x62d5, 0x1078, + 0x1328, 0x0d7e, 0x20a1, 0x020b, 0x1078, 0x6567, 0x7810, 0x2068, + 0x20a3, 0x2414, 0x20a3, 0x0018, 0x20a3, 0x0800, 0x683c, 0x20a2, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x6850, 0x20a2, 0x6854, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x60c3, 0x0018, 0x1078, 0x6c2d, 0x0d7f, 0x007c, 0x0d7e, 0x7818, + 0x2068, 0x68a0, 0xa082, 0x007e, 0x0048, 0x62d2, 0xa085, 0x0001, + 0x0d7f, 0x007c, 0xa006, 0x0078, 0x62d0, 0x0d7e, 0x20a1, 0x020b, + 0x1078, 0x6567, 0x20a3, 0x0500, 0x20a3, 0x0000, 0x7810, 0xa0e8, + 0x000f, 0x6808, 0x20a2, 0x680c, 0x20a2, 0x6810, 0x20a2, 0x6814, + 0x20a2, 0x6818, 0x20a2, 0x681c, 0x20a2, 0x60c3, 0x0010, 0x1078, + 0x6c2d, 0x0d7f, 0x007c, 0x6030, 0x609a, 0x1078, 0x6c2d, 0x007c, + 0x20a1, 0x020b, 0x1078, 0x6567, 0x20a3, 0x5200, 0x20a3, 0x0000, + 0x0d7e, 0x2069, 0xa351, 0x6804, 0xd084, 0x0040, 0x6312, 0x6828, + 0x20a3, 0x0000, 0x017e, 0x1078, 0x24fa, 0x21a2, 0x017f, 0x0d7f, + 0x0078, 0x6317, 0x0d7f, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9, + 0x0004, 0x2099, 0xa305, 0x53a6, 0x20a9, 0x0004, 0x2099, 0xa301, + 0x53a6, 0x7818, 0xa080, 0x0028, 0x2004, 0xa082, 0x007f, 0x0048, + 0x6331, 0x2001, 0xa31a, 0x20a6, 0x2001, 0xa31b, 0x20a6, 0x0078, + 0x6337, 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff, 0x20a2, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x6c2d, 0x007c, + 0x20a1, 0x020b, 0x1078, 0x6567, 0x20a3, 0x0500, 0x20a3, 0x0000, + 0x7818, 0xa080, 0x0028, 0x2004, 0xa082, 0x007f, 0x0048, 0x6358, + 0x2001, 0xa31a, 0x20a6, 0x2001, 0xa31b, 0x20a6, 0x0078, 0x635e, + 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff, 0x20a2, 0x20a9, 0x0004, + 0x2099, 0xa305, 0x53a6, 0x60c3, 0x0010, 0x1078, 0x6c2d, 0x007c, + 0x20a1, 0x020b, 0x1078, 0x6567, 0x0c7e, 0x7818, 0x2060, 0x2001, + 0x0000, 0x1078, 0x48a2, 0x0c7f, 0x7818, 0xa080, 0x0028, 0x2004, + 0xa086, 0x007e, 0x00c0, 0x6383, 0x20a3, 0x0400, 0x620c, 0xc2b4, + 0x620e, 0x0078, 0x6385, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x7818, + 0xa080, 0x0028, 0x2004, 0xa086, 0x007e, 0x00c0, 0x63d2, 0x2099, + 0xa58c, 0x33a6, 0x9398, 0x33a6, 0x9398, 0x3304, 0xa084, 0x3fff, + 0x20a2, 0x9398, 0x33a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0xa305, 0x53a6, + 0x20a9, 0x0004, 0x2099, 0xa301, 0x53a6, 0x20a9, 0x0010, 0x20a3, + 0x0000, 0x00f0, 0x63af, 0x2099, 0xa594, 0x3304, 0xc0dd, 0x20a2, + 0x2001, 0xa371, 0x2004, 0xd0e4, 0x0040, 0x63ca, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x9398, 0x9398, 0x9398, 0x33a6, 0x20a9, 0x0004, + 0x0078, 0x63cc, 0x20a9, 0x0007, 0x20a3, 0x0000, 0x00f0, 0x63cc, + 0x0078, 0x63f2, 0x2099, 0xa58c, 0x20a9, 0x0008, 0x53a6, 0x20a9, + 0x0004, 0x2099, 0xa305, 0x53a6, 0x20a9, 0x0004, 0x2099, 0xa301, + 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x63e3, 0x20a9, + 0x0008, 0x20a3, 0x0000, 0x00f0, 0x63e9, 0x2099, 0xa594, 0x20a9, + 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x63f4, + 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x63fa, 0x60c3, 0x0074, + 0x1078, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x1078, 0x6567, 0x20a3, + 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000, 0xa006, + 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0xa351, + 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x641f, 0xa085, 0x0020, 0xd1a4, + 0x0040, 0x6424, 0xa085, 0x0010, 0xa085, 0x0002, 0x0d7e, 0x0078, + 0x64ed, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, + 0x1078, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x1078, 0x6567, 0x20a3, + 0x5000, 0x0078, 0x6385, 0x20a1, 0x020b, 0x1078, 0x6567, 0x20a3, + 0x2110, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, + 0x0014, 0x1078, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x1078, 0x65ef, + 0x0078, 0x6466, 0x20a1, 0x020b, 0x1078, 0x65f8, 0x20a3, 0x0200, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, + 0x1078, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x1078, 0x65f8, 0x20a3, + 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, + 0x0008, 0x1078, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x1078, 0x65f8, + 0x20a3, 0x0200, 0x0078, 0x6385, 0x20a1, 0x020b, 0x1078, 0x65f8, + 0x20a3, 0x0100, 0x20a3, 0x0000, 0x7828, 0xa005, 0x0040, 0x649b, + 0x20a2, 0x0078, 0x649d, 0x20a3, 0x0003, 0x7810, 0x20a2, 0x60c3, + 0x0008, 0x1078, 0x6c2d, 0x007c, 0x0d7e, 0x20a1, 0x020b, 0x1078, + 0x65f8, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x7818, + 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0, 0x64ca, 0x6998, 0xa184, + 0xc000, 0x00c0, 0x64c6, 0xd1ec, 0x0040, 0x64c2, 0x20a3, 0x2100, + 0x0078, 0x64cc, 0x20a3, 0x0100, 0x0078, 0x64cc, 0x20a3, 0x0400, + 0x0078, 0x64cc, 0x20a3, 0x0700, 0xa006, 0x20a2, 0x20a2, 0x20a2, + 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0xa351, 0x7904, 0x0f7f, 0xd1ac, + 0x00c0, 0x64dc, 0xa085, 0x0020, 0xd1a4, 0x0040, 0x64e1, 0xa085, + 0x0010, 0x2009, 0xa373, 0x210c, 0xd184, 0x0040, 0x64eb, 0x699c, + 0xd18c, 0x0040, 0x64ed, 0xa085, 0x0002, 0x027e, 0x2009, 0xa371, + 0x210c, 0xd1e4, 0x0040, 0x64fb, 0xc0c5, 0xa094, 0x0030, 0xa296, + 0x0010, 0x0040, 0x6505, 0xd1ec, 0x0040, 0x6505, 0xa094, 0x0030, + 0xa296, 0x0010, 0x0040, 0x6505, 0xc0bd, 0x027f, 0x20a2, 0x20a2, + 0x20a2, 0x60c3, 0x0014, 0x1078, 0x6c2d, 0x0d7f, 0x007c, 0x20a1, + 0x020b, 0x1078, 0x65f8, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, + 0x0000, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x6c2d, 0x007c, + 0x20a1, 0x020b, 0x1078, 0x65f8, 0x20a3, 0x0200, 0x0078, 0x62fe, + 0x20a1, 0x020b, 0x1078, 0x65f8, 0x20a3, 0x0100, 0x20a3, 0x0000, + 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x1078, 0x6c2d, + 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078, + 0x65f8, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3, + 0x0000, 0x60c3, 0x0008, 0x1078, 0x6c2d, 0x007c, 0x027e, 0x037e, + 0x047e, 0x2019, 0x3200, 0x2021, 0x0800, 0x0078, 0x656e, 0x027e, + 0x037e, 0x047e, 0x2019, 0x2200, 0x2021, 0x0100, 0x20e1, 0x9080, + 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e, + 0x00c0, 0x6581, 0xa385, 0x00ff, 0x20a2, 0x20a3, 0xfffe, 0x0078, + 0x65b6, 0xa286, 0x007f, 0x00c0, 0x658d, 0x0d7e, 0xa385, 0x00ff, + 0x20a2, 0x20a3, 0xfffd, 0x0078, 0x65a4, 0xd2bc, 0x0040, 0x65ac, + 0xa286, 0x0080, 0x0d7e, 0x00c0, 0x659c, 0xa385, 0x00ff, 0x20a2, + 0x20a3, 0xfffc, 0x0078, 0x65a4, 0xa2e8, 0xa434, 0x2d6c, 0x6810, + 0xa305, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a, 0x2da6, 0x8d68, + 0x2da6, 0x0d7f, 0x0078, 0x65ba, 0x0d7e, 0xa2e8, 0xa434, 0x2d6c, + 0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, + 0x6230, 0x22a2, 0xa485, 0x0029, 0x20a2, 0x047f, 0x037f, 0x20a3, + 0x0000, 0x1078, 0x6c1c, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3, + 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x027e, + 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x02ff, 0x2011, 0xfffc, + 0x22a2, 0x0d7e, 0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, + 0x20a3, 0x2029, 0x20a3, 0x0000, 0x0078, 0x65c1, 0x20a3, 0x0100, + 0x20a3, 0x0000, 0x20a3, 0xfc02, 0x20a3, 0x0000, 0x007c, 0x027e, + 0x037e, 0x047e, 0x2019, 0x3300, 0x2021, 0x0800, 0x0078, 0x65ff, + 0x027e, 0x037e, 0x047e, 0x2019, 0x2300, 0x2021, 0x0100, 0x20e1, + 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, + 0x007e, 0x0048, 0x661c, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, + 0xa305, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a, 0x2da6, 0x8d68, + 0x2da6, 0x0d7f, 0x0078, 0x662a, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, + 0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, + 0x6230, 0x22a2, 0xa485, 0x0098, 0x20a2, 0x20a3, 0x0000, 0x047f, + 0x037f, 0x1078, 0x6c1c, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, + 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0c7e, + 0x0f7e, 0x6004, 0xa08a, 0x0085, 0x1048, 0x1328, 0xa08a, 0x008c, + 0x10c8, 0x1328, 0x6118, 0x2178, 0x79a0, 0xd1bc, 0x0040, 0x665d, + 0x7900, 0xd1f4, 0x0040, 0x6659, 0x7914, 0xa18c, 0x00ff, 0x0078, + 0x6662, 0x2009, 0x0000, 0x0078, 0x6662, 0xa1f8, 0x293f, 0x2f0c, + 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0xa082, 0x0085, + 0x1079, 0x666d, 0x0f7f, 0x0c7f, 0x007c, 0x6676, 0x6681, 0x669c, + 0x6674, 0x6674, 0x6674, 0x6676, 0x1078, 0x1328, 0x147e, 0x20a1, + 0x020b, 0x1078, 0x66af, 0x60c3, 0x0000, 0x1078, 0x6c2d, 0x147f, + 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078, 0x66e3, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x7808, 0x20a2, 0x7810, 0x20a2, 0x20a3, 0x0000, + 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x000c, + 0x1078, 0x6c2d, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078, + 0x6724, 0x20a3, 0x0003, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x60c3, 0x0004, 0x1078, 0x6c2d, 0x147f, 0x007c, 0x027e, + 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, + 0xa092, 0x007e, 0x0048, 0x66ce, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, + 0x6810, 0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a, + 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x66dd, 0x0d7e, 0xa0e8, + 0xa434, 0x2d6c, 0x6810, 0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2, + 0x0d7f, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0009, 0x20a3, + 0x0000, 0x0078, 0x65c1, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, + 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x6702, + 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, 0x8400, 0x20a2, + 0x6814, 0x20a2, 0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, + 0x0078, 0x6711, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, + 0x8400, 0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, 0x6230, + 0x22a2, 0x20a3, 0x0099, 0x20a3, 0x0000, 0x1078, 0x6c1c, 0x22a2, + 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x7a10, 0x22a2, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x027f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, + 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, + 0x6743, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, 0x8500, + 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6, + 0x0d7f, 0x0078, 0x6752, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, + 0xa085, 0x8500, 0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, + 0x6230, 0x22a2, 0x20a3, 0x0099, 0x20a3, 0x0000, 0x0078, 0x6715, + 0x0c7e, 0x0f7e, 0x2c78, 0x7804, 0xa08a, 0x0040, 0x1048, 0x1328, + 0xa08a, 0x0053, 0x10c8, 0x1328, 0x7918, 0x2160, 0x61a0, 0xd1bc, + 0x0040, 0x6777, 0x6100, 0xd1f4, 0x0040, 0x6773, 0x6114, 0xa18c, + 0x00ff, 0x0078, 0x677c, 0x2009, 0x0000, 0x0078, 0x677c, 0xa1e0, + 0x293f, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0xa082, + 0x0040, 0x1079, 0x6786, 0x0f7f, 0x0c7f, 0x007c, 0x679b, 0x68a9, + 0x684a, 0x6a59, 0x6799, 0x6799, 0x6799, 0x6799, 0x6799, 0x6799, + 0x6799, 0x6f5e, 0x6f6f, 0x6f80, 0x6f91, 0x6799, 0x748e, 0x6799, + 0x6f4d, 0x1078, 0x1328, 0x0d7e, 0x157e, 0x147e, 0x780b, 0xffff, + 0x20a1, 0x020b, 0x1078, 0x6806, 0x7910, 0x2168, 0x6948, 0x7922, + 0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184, 0x000f, + 0x00c0, 0x67b6, 0x2001, 0x0005, 0x0078, 0x67c0, 0xd184, 0x0040, + 0x67bd, 0x2001, 0x0004, 0x0078, 0x67c0, 0xa084, 0x0006, 0x8004, + 0x017e, 0x2008, 0x7830, 0xa084, 0x00ff, 0x8007, 0xa105, 0x017f, + 0x20a2, 0xd1ac, 0x0040, 0x67d0, 0x20a3, 0x0002, 0x0078, 0x67dc, + 0xd1b4, 0x0040, 0x67d7, 0x20a3, 0x0001, 0x0078, 0x67dc, 0x20a3, + 0x0000, 0x2230, 0x0078, 0x67de, 0x6a80, 0x6e7c, 0x20a9, 0x0008, + 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2, 0x8000, 0x00f0, 0x67e2, + 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, 0x6014, 0xa084, + 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0xa5c7, 0x2003, 0x07d0, + 0x2001, 0xa5c6, 0x2003, 0x0009, 0x2001, 0xa5cc, 0x2003, 0x0002, + 0x1078, 0x157e, 0x147f, 0x157f, 0x0d7f, 0x007c, 0x20e1, 0x9080, + 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, + 0x00ff, 0x2202, 0x8217, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, + 0x0040, 0x682c, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, + 0x0600, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a, 0x2da6, 0x8d68, + 0x2da6, 0x0d7f, 0x0078, 0x683b, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, + 0x6810, 0xa085, 0x0600, 0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3, + 0x0000, 0x6130, 0x21a2, 0x20a3, 0x0829, 0x20a3, 0x0000, 0x22a2, + 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, + 0x1078, 0x686a, 0x7810, 0x2068, 0x6860, 0x20a2, 0x685c, 0x20a2, + 0x6880, 0x20a2, 0x687c, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, + 0x20a2, 0x60c3, 0x000c, 0x1078, 0x6c2d, 0x147f, 0x137f, 0x157f, + 0x0d7f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, + 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x6888, 0x0d7e, 0xa0e8, + 0xa434, 0x2d6c, 0x6810, 0xa085, 0x0500, 0x20a2, 0x6814, 0x20a2, + 0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x6897, + 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, 0x0500, 0x20a2, + 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, + 0x0889, 0x20a3, 0x0000, 0x1078, 0x6c1c, 0x22a2, 0x20a3, 0x0000, + 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, + 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x7810, 0xa06d, 0x1078, + 0x488f, 0x0040, 0x68bd, 0x684c, 0xa084, 0x2020, 0xa086, 0x2020, + 0x00c0, 0x68bd, 0x7824, 0xc0cd, 0x7826, 0x20a1, 0x020b, 0x1078, + 0x6a12, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810, + 0xa084, 0xf000, 0x00c0, 0x68d4, 0x7810, 0xa084, 0x0700, 0x8007, + 0x1079, 0x68dc, 0x0078, 0x68d7, 0xa006, 0x1079, 0x68dc, 0x147f, + 0x137f, 0x157f, 0x0d7f, 0x007c, 0x68e6, 0x697e, 0x6989, 0x69b3, + 0x69c7, 0x69e3, 0x69ee, 0x68e4, 0x1078, 0x1328, 0x017e, 0x037e, + 0x694c, 0xa18c, 0x0003, 0x0040, 0x68f1, 0xa186, 0x0003, 0x00c0, + 0x6900, 0x6b78, 0x7824, 0xd0cc, 0x0040, 0x68f7, 0xc3e5, 0x23a2, + 0x6868, 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f, 0x0078, 0x69be, + 0xa186, 0x0001, 0x10c0, 0x1328, 0x6b78, 0x7824, 0xd0cc, 0x0040, + 0x690a, 0xc3e5, 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x22a2, + 0x6874, 0x20a2, 0x22a2, 0x687c, 0x20a2, 0x2009, 0x0018, 0xa384, + 0x0300, 0x0040, 0x6978, 0xd3c4, 0x0040, 0x6920, 0x687c, 0xa108, + 0xd3cc, 0x0040, 0x6925, 0x6874, 0xa108, 0x157e, 0x20a9, 0x000d, + 0xad80, 0x0020, 0x201c, 0x831f, 0x23a2, 0x8000, 0x00f0, 0x692a, + 0x157f, 0x22a2, 0x22a2, 0x22a2, 0xa184, 0x0003, 0x0040, 0x6978, + 0x20a1, 0x020b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x007e, 0x7818, + 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x6958, 0x0d7e, 0xa0e8, + 0xa434, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2, + 0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x6967, + 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, + 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x007f, + 0x7b24, 0xd3cc, 0x0040, 0x6970, 0x20a3, 0x0889, 0x0078, 0x6972, + 0x20a3, 0x0898, 0x20a2, 0x1078, 0x6c1c, 0x22a2, 0x20a3, 0x0000, + 0x61c2, 0x037f, 0x017f, 0x1078, 0x6c2d, 0x007c, 0x2011, 0x0008, + 0x7824, 0xd0cc, 0x0040, 0x6985, 0xc2e5, 0x22a2, 0xa016, 0x0078, + 0x69bc, 0x2011, 0x0302, 0x7824, 0xd0cc, 0x0040, 0x6990, 0xc2e5, + 0x22a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0012, 0x22a2, + 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x7000, + 0x20a3, 0x0500, 0x22a2, 0x20a3, 0x000a, 0x22a2, 0x22a2, 0x20a3, + 0x2500, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0032, + 0x1078, 0x6c2d, 0x007c, 0x2011, 0x0028, 0x7824, 0xd0cc, 0x0040, + 0x69ba, 0xc2e5, 0x22a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, + 0x22a2, 0x22a2, 0x60c3, 0x0018, 0x1078, 0x6c2d, 0x007c, 0x2011, + 0x0100, 0x7824, 0xd0cc, 0x0040, 0x69ce, 0xc2e5, 0x22a2, 0xa016, + 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2, + 0x7834, 0xa084, 0x00ff, 0x20a2, 0x22a2, 0x22a2, 0x60c3, 0x0020, + 0x1078, 0x6c2d, 0x007c, 0x2011, 0x0008, 0x7824, 0xd0cc, 0x0040, + 0x69ea, 0xc2e5, 0x22a2, 0xa016, 0x0078, 0x69bc, 0x037e, 0x7b10, + 0xa384, 0xff00, 0x7812, 0xa384, 0x00ff, 0x8001, 0x00c0, 0x6a01, + 0x7824, 0xd0cc, 0x0040, 0x69fd, 0xc2e5, 0x22a2, 0x037f, 0x0078, + 0x69bc, 0x047e, 0x2021, 0x0800, 0x007e, 0x7824, 0xd0cc, 0x007f, + 0x0040, 0x6a0b, 0xc4e5, 0x24a2, 0x047f, 0x22a2, 0x20a2, 0x037f, + 0x0078, 0x69be, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, + 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x6a30, 0x0d7e, 0xa0e8, + 0xa434, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2, + 0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x6a3f, + 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, + 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x7824, + 0xd0cc, 0x0040, 0x6a47, 0x20a3, 0x0889, 0x0078, 0x6a49, 0x20a3, + 0x0898, 0x20a3, 0x0000, 0x1078, 0x6c1c, 0x22a2, 0x20a3, 0x0000, + 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, + 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x017e, 0x037e, 0x7810, + 0xa084, 0x0700, 0x8007, 0x1079, 0x6a6c, 0x037f, 0x017f, 0x147f, + 0x137f, 0x157f, 0x0d7f, 0x007c, 0x6a74, 0x6a74, 0x6a76, 0x6a74, + 0x6a74, 0x6a74, 0x6a9b, 0x6a74, 0x1078, 0x1328, 0x7910, 0xa18c, + 0xf8ff, 0xa18d, 0x0600, 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003, + 0x1078, 0x6aa5, 0x0d7e, 0x2069, 0xa351, 0x6804, 0xd0bc, 0x0040, + 0x6a90, 0x682c, 0xa084, 0x00ff, 0x8007, 0x20a2, 0x0078, 0x6a92, + 0x20a3, 0x3f00, 0x0d7f, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001, + 0x1078, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, + 0x6aa5, 0x20a3, 0x7f00, 0x0078, 0x6a93, 0x027e, 0x20e1, 0x9080, + 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, + 0x6ac3, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, 0xa085, 0x0100, + 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a, 0x2da6, 0x8d68, 0x2da6, + 0x0d7f, 0x0078, 0x6ad2, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, 0x6810, + 0xa085, 0x0100, 0x20a2, 0x6814, 0x20a2, 0x0d7f, 0x20a3, 0x0000, + 0x6230, 0x22a2, 0x20a3, 0x0888, 0xa18d, 0x0008, 0x21a2, 0x1078, + 0x6c1c, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, + 0x057e, 0x047e, 0x037e, 0x2061, 0x0100, 0x2071, 0xa300, 0x6130, + 0x7818, 0x2068, 0x68a0, 0x2028, 0xd0bc, 0x00c0, 0x6afc, 0x6910, + 0x6a14, 0x6430, 0x0078, 0x6b00, 0x6910, 0x6a14, 0x7368, 0x746c, + 0x781c, 0xa086, 0x0006, 0x0040, 0x6b5f, 0xd5bc, 0x0040, 0x6b10, + 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x0078, 0x6b17, + 0xa185, 0x0100, 0x6062, 0x6266, 0x606b, 0x0000, 0x646e, 0x6073, + 0x0809, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, + 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, + 0x7810, 0x2070, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, + 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, + 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048, 0x6b49, 0x6a00, 0xd2f4, + 0x0040, 0x6b47, 0x6a14, 0xa294, 0x00ff, 0x0078, 0x6b49, 0x2011, + 0x0000, 0x629e, 0x6017, 0x0016, 0x2009, 0x07d0, 0x60c4, 0xa084, + 0xfff0, 0xa005, 0x0040, 0x6b56, 0x2009, 0x1b58, 0x1078, 0x595f, + 0x037f, 0x047f, 0x057f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x7810, + 0x2070, 0x704c, 0xa084, 0x0003, 0xa086, 0x0002, 0x0040, 0x6bb7, + 0xd5bc, 0x0040, 0x6b73, 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, + 0x646e, 0x0078, 0x6b7a, 0xa185, 0x0100, 0x6062, 0x6266, 0x606b, + 0x0000, 0x646e, 0x6073, 0x0880, 0x6077, 0x0008, 0x688c, 0x8000, + 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, + 0x6086, 0x7808, 0x6082, 0x7060, 0x608a, 0x705c, 0x608e, 0x7080, + 0x60c6, 0x707c, 0x60ca, 0x707c, 0x792c, 0xa108, 0x792e, 0x7080, + 0x7928, 0xa109, 0x792a, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, + 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048, 0x6bb2, 0x6a00, + 0xd2f4, 0x0040, 0x6bb0, 0x6a14, 0xa294, 0x00ff, 0x0078, 0x6bb2, + 0x2011, 0x0000, 0x629e, 0x6017, 0x0012, 0x0078, 0x6b4c, 0xd5bc, + 0x0040, 0x6bc2, 0xa185, 0x0700, 0x6062, 0x6266, 0x636a, 0x646e, + 0x0078, 0x6bc9, 0xa185, 0x0700, 0x6062, 0x6266, 0x606b, 0x0000, + 0x646e, 0x1078, 0x488f, 0x0040, 0x6bdf, 0x0d7e, 0x7810, 0xa06d, + 0x684c, 0x0d7f, 0xa084, 0x2020, 0xa086, 0x2020, 0x00c0, 0x6bdf, + 0x7824, 0xc0cd, 0x7826, 0x6073, 0x0889, 0x0078, 0x6be1, 0x6073, + 0x0898, 0x6077, 0x0000, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, + 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, + 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, + 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, + 0xa582, 0x0080, 0x0048, 0x6c0f, 0x6a00, 0xd2f4, 0x0040, 0x6c0d, + 0x6a14, 0xa294, 0x00ff, 0x0078, 0x6c0f, 0x2011, 0x0000, 0x629e, + 0x7824, 0xd0cc, 0x0040, 0x6c18, 0x6017, 0x0016, 0x0078, 0x6b4c, + 0x6017, 0x0012, 0x0078, 0x6b4c, 0x7a18, 0xa280, 0x0023, 0x2014, + 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217, 0x007c, 0x0d7e, 0x2069, + 0xa5ab, 0x6843, 0x0001, 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x60a3, + 0x0056, 0x60a7, 0x9575, 0x1078, 0x6c38, 0x1078, 0x594f, 0x007c, + 0x007e, 0x6014, 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x007f, + 0x007c, 0x007e, 0x0c7e, 0x2061, 0x0100, 0x6014, 0xa084, 0x0004, + 0xa085, 0x0008, 0x6016, 0x0c7f, 0x007f, 0x007c, 0x0c7e, 0x0d7e, + 0x017e, 0x027e, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, + 0x4000, 0x0040, 0x6c89, 0x1078, 0x6c41, 0x6803, 0x1000, 0x6803, + 0x0000, 0x0c7e, 0x2061, 0xa5ab, 0x6128, 0xa192, 0x00c8, 0x00c8, + 0x6c76, 0x8108, 0x612a, 0x6124, 0x0c7f, 0x81ff, 0x0040, 0x6c84, + 0x1078, 0x594f, 0x1078, 0x6c38, 0x0078, 0x6c84, 0x6124, 0xa1e5, + 0x0000, 0x0040, 0x6c81, 0x1078, 0xa241, 0x2009, 0x0014, 0x1078, + 0x756c, 0x0c7f, 0x0078, 0x6c84, 0x027f, 0x017f, 0x0d7f, 0x0c7f, + 0x007c, 0x2001, 0xa5c7, 0x2004, 0xa005, 0x00c0, 0x6c84, 0x0c7e, + 0x2061, 0xa5ab, 0x6128, 0xa192, 0x0003, 0x00c8, 0x6c76, 0x8108, + 0x612a, 0x0c7f, 0x1078, 0x594f, 0x1078, 0x4171, 0x0078, 0x6c84, + 0x0c7e, 0x0d7e, 0x0e7e, 0x017e, 0x027e, 0x1078, 0x5967, 0x2071, + 0xa5ab, 0x713c, 0x81ff, 0x0040, 0x6cca, 0x2061, 0x0100, 0x2069, + 0x0140, 0x6904, 0xa194, 0x4000, 0x0040, 0x6cd0, 0x6803, 0x1000, + 0x6803, 0x0000, 0x037e, 0x2019, 0x0001, 0x1078, 0x6e6c, 0x037f, + 0x713c, 0x2160, 0x1078, 0xa241, 0x2009, 0x004a, 0x1078, 0x756c, + 0x0078, 0x6cca, 0x027f, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, + 0x0078, 0x6cba, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x057e, 0x047e, + 0x007e, 0x127e, 0x2091, 0x8000, 0x6018, 0x2068, 0x6ca0, 0x2071, + 0xa5ab, 0x7018, 0x2068, 0x8dff, 0x0040, 0x6cfc, 0x68a0, 0xa406, + 0x0040, 0x6cee, 0x6854, 0x2068, 0x0078, 0x6ce3, 0x6010, 0x2060, + 0x643c, 0x6540, 0x6e48, 0x2d60, 0x1078, 0x466a, 0x0040, 0x6cfc, + 0x1078, 0x7045, 0xa085, 0x0001, 0x127f, 0x007f, 0x047f, 0x057f, + 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x20a1, 0x020b, 0x1078, + 0x6567, 0x20a3, 0x1200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x781c, + 0xa086, 0x0004, 0x00c0, 0x6d17, 0x6098, 0x0078, 0x6d18, 0x6030, + 0x20a2, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x20a9, 0x0010, 0xa006, + 0x20a2, 0x00f0, 0x6d20, 0x20a2, 0x20a2, 0x60c3, 0x002c, 0x1078, + 0x6c2d, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x6567, + 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, + 0x60c3, 0x0008, 0x1078, 0x6c2d, 0x147f, 0x157f, 0x007c, 0x157e, + 0x147e, 0x20a1, 0x020b, 0x1078, 0x65f8, 0x20a3, 0x0200, 0x20a3, + 0x0000, 0x20a9, 0x0006, 0x2011, 0xa340, 0x2019, 0xa341, 0x23a6, + 0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x00f0, 0x6d4f, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x6c2d, 0x147f, + 0x157f, 0x007c, 0x157e, 0x147e, 0x017e, 0x027e, 0x20a1, 0x020b, + 0x1078, 0x65cf, 0x1078, 0x65e6, 0x7810, 0xa080, 0x0000, 0x2004, + 0xa080, 0x0015, 0x2098, 0x7808, 0xa088, 0x0002, 0x21a8, 0x53a6, + 0xa080, 0x0004, 0x8003, 0x60c2, 0x1078, 0x6c2d, 0x027f, 0x017f, + 0x147f, 0x157f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, + 0x6567, 0x20a3, 0x6200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, + 0x20a2, 0x60c3, 0x0008, 0x1078, 0x6c2d, 0x147f, 0x157f, 0x007c, + 0x157e, 0x147e, 0x017e, 0x027e, 0x20a1, 0x020b, 0x1078, 0x6567, + 0x7810, 0xa080, 0x0000, 0x2004, 0xa080, 0x0017, 0x2098, 0x7808, + 0xa088, 0x0002, 0x21a8, 0x53a6, 0x8003, 0x60c2, 0x1078, 0x6c2d, + 0x027f, 0x017f, 0x147f, 0x157f, 0x007c, 0x0e7e, 0x0c7e, 0x007e, + 0x127e, 0x2091, 0x8000, 0x2071, 0xa5ab, 0x700c, 0x2060, 0x8cff, + 0x0040, 0x6dd1, 0x1078, 0x8c3b, 0x00c0, 0x6dc8, 0x1078, 0x7a05, + 0x600c, 0x007e, 0x1078, 0x753d, 0x1078, 0x7045, 0x0c7f, 0x0078, + 0x6dbf, 0x700f, 0x0000, 0x700b, 0x0000, 0x127f, 0x007f, 0x0c7f, + 0x0e7f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, + 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, + 0x0140, 0x2071, 0xa5ab, 0x7024, 0x2060, 0x8cff, 0x0040, 0x6e2a, + 0x1078, 0x6c41, 0x68c3, 0x0000, 0x1078, 0x595a, 0x2009, 0x0013, + 0x1078, 0x756c, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x6e0d, + 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x6e1f, 0x7803, + 0x1000, 0x7803, 0x0000, 0x0078, 0x6e1f, 0xd084, 0x0040, 0x6e14, + 0x6827, 0x0001, 0x0078, 0x6e16, 0x00f0, 0x6dfc, 0x7804, 0xa084, + 0x1000, 0x0040, 0x6e1f, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, + 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, + 0x127f, 0x007c, 0x2001, 0xa300, 0x2004, 0xa096, 0x0001, 0x0040, + 0x6e62, 0xa096, 0x0004, 0x0040, 0x6e62, 0x6817, 0x0008, 0x68c3, + 0x0000, 0x2011, 0x4129, 0x1078, 0x58d4, 0x20a9, 0x01f4, 0x6824, + 0xd094, 0x0040, 0x6e50, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, + 0x0040, 0x6e62, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x6e62, + 0xd084, 0x0040, 0x6e57, 0x6827, 0x0001, 0x0078, 0x6e59, 0x00f0, + 0x6e3f, 0x7804, 0xa084, 0x1000, 0x0040, 0x6e62, 0x7803, 0x0100, + 0x7803, 0x0000, 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, + 0x0f7f, 0x157f, 0x127f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, + 0x0d7e, 0x0c7e, 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, + 0x0100, 0x2079, 0x0140, 0x2071, 0xa5ab, 0x703c, 0x2060, 0x8cff, + 0x0040, 0x6ee8, 0x6817, 0x0010, 0x2009, 0x00fa, 0x8109, 0x00c0, + 0x6e86, 0x68c7, 0x0000, 0x68cb, 0x0008, 0x1078, 0x5967, 0x1078, + 0x1f31, 0x047e, 0x057e, 0x2009, 0x017f, 0x212c, 0x200b, 0x00a5, + 0x2021, 0x0169, 0x2404, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, + 0x6eb7, 0x68c7, 0x0000, 0x68cb, 0x0008, 0x0e7e, 0x0f7e, 0x2079, + 0x0020, 0x2071, 0xa602, 0x6814, 0xa084, 0x0004, 0xa085, 0x0012, + 0x6816, 0x7803, 0x0008, 0x7003, 0x0000, 0x0f7f, 0x0e7f, 0x250a, + 0x057f, 0x047f, 0xa39d, 0x0000, 0x00c0, 0x6ec2, 0x2009, 0x0049, + 0x1078, 0x756c, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040, 0x6ed5, + 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x6ee7, 0x7803, + 0x1000, 0x7803, 0x0000, 0x0078, 0x6ee7, 0xd08c, 0x0040, 0x6edc, + 0x6827, 0x0002, 0x0078, 0x6ede, 0x00f0, 0x6ec4, 0x7804, 0xa084, + 0x1000, 0x0040, 0x6ee7, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, + 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, + 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0xa5ab, + 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, + 0x2069, 0xa5ab, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e, + 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0xa5ab, 0x7614, 0x2660, + 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x6f46, 0x601c, 0xa206, + 0x00c0, 0x6f41, 0x7014, 0xac36, 0x00c0, 0x6f20, 0x660c, 0x7616, + 0x7010, 0xac36, 0x00c0, 0x6f2e, 0x2c00, 0xaf36, 0x0040, 0x6f2c, + 0x2f00, 0x7012, 0x0078, 0x6f2e, 0x7013, 0x0000, 0x660c, 0x067e, + 0x2c00, 0xaf06, 0x0040, 0x6f37, 0x7e0e, 0x0078, 0x6f38, 0x2678, + 0x600f, 0x0000, 0x1078, 0x8c01, 0x1078, 0x7045, 0x0c7f, 0x0078, + 0x6f13, 0x2c78, 0x600c, 0x2060, 0x0078, 0x6f13, 0x127f, 0x007f, + 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e, 0x20a1, + 0x020b, 0x1078, 0x6806, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, + 0x20a2, 0x20a2, 0x20a3, 0x1000, 0x0078, 0x6fa0, 0x157e, 0x147e, + 0x20a1, 0x020b, 0x1078, 0x6806, 0x7810, 0x20a2, 0xa006, 0x20a2, + 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x6fa0, 0x157e, + 0x147e, 0x20a1, 0x020b, 0x1078, 0x6806, 0x7810, 0x20a2, 0xa006, + 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x6fa0, + 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x6806, 0x7810, 0x20a2, + 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078, + 0x6fa0, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x6806, 0x7810, + 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200, + 0x1078, 0x7050, 0x60c3, 0x0020, 0x1078, 0x6c2d, 0x147f, 0x157f, + 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120, + 0xd1b4, 0x00c0, 0x6fb8, 0xd1bc, 0x00c0, 0x7002, 0x0078, 0x7042, + 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069, + 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000, + 0x0040, 0x6ff9, 0x6020, 0xd0b4, 0x0040, 0x6ff9, 0x6024, 0xd094, + 0x00c0, 0x6ff9, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, + 0x6ff9, 0x00f0, 0x6fc5, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107, + 0x6130, 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b, + 0xbc91, 0x6043, 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024, + 0xd094, 0x00c0, 0x6ff8, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x6fef, + 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000, + 0x0078, 0x7042, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, + 0x0d7e, 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, + 0xa084, 0x4000, 0x0040, 0x703b, 0x6020, 0xd0bc, 0x0040, 0x703b, + 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x703b, 0x00f0, + 0x700f, 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c, + 0x00ff, 0xa10d, 0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043, + 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000, + 0x00c0, 0x7035, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, + 0x200b, 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0xa5ab, + 0x7020, 0xa005, 0x0040, 0x704e, 0x8001, 0x7022, 0x0e7f, 0x007c, + 0x20a9, 0x0008, 0x20a2, 0x00f0, 0x7052, 0x20a2, 0x20a2, 0x007c, + 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e, + 0x2091, 0x8000, 0x2071, 0xa5ab, 0x7614, 0x2660, 0x2678, 0x2039, + 0x0001, 0x87ff, 0x0040, 0x70f4, 0x8cff, 0x0040, 0x70f4, 0x601c, + 0xa086, 0x0006, 0x00c0, 0x70ef, 0x88ff, 0x0040, 0x707f, 0x2800, + 0xac06, 0x00c0, 0x70ef, 0x2039, 0x0000, 0x0078, 0x708a, 0x6018, + 0xa206, 0x00c0, 0x70ef, 0x85ff, 0x0040, 0x708a, 0x6020, 0xa106, + 0x00c0, 0x70ef, 0x7024, 0xac06, 0x00c0, 0x70ba, 0x2069, 0x0100, + 0x68c0, 0xa005, 0x0040, 0x70b5, 0x1078, 0x595a, 0x6817, 0x0008, + 0x68c3, 0x0000, 0x1078, 0x7188, 0x7027, 0x0000, 0x037e, 0x2069, + 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x70aa, 0x6803, 0x0100, + 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x70b2, + 0x6827, 0x0001, 0x037f, 0x0078, 0x70ba, 0x6003, 0x0009, 0x630a, + 0x0078, 0x70ef, 0x7014, 0xac36, 0x00c0, 0x70c0, 0x660c, 0x7616, + 0x7010, 0xac36, 0x00c0, 0x70ce, 0x2c00, 0xaf36, 0x0040, 0x70cc, + 0x2f00, 0x7012, 0x0078, 0x70ce, 0x7013, 0x0000, 0x660c, 0x067e, + 0x2c00, 0xaf06, 0x0040, 0x70d7, 0x7e0e, 0x0078, 0x70d8, 0x2678, + 0x89ff, 0x00c0, 0x70e7, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078, + 0x8a44, 0x0040, 0x70e5, 0x1078, 0x9e70, 0x1078, 0x8c01, 0x1078, + 0x7045, 0x88ff, 0x00c0, 0x70fe, 0x0c7f, 0x0078, 0x7069, 0x2c78, + 0x600c, 0x2060, 0x0078, 0x7069, 0xa006, 0x127f, 0x007f, 0x067f, + 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000, + 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x70f5, 0x0f7e, 0x0e7e, 0x0d7e, + 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, + 0xa5ab, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040, 0x7177, 0x601c, + 0xa086, 0x0006, 0x00c0, 0x7172, 0x87ff, 0x0040, 0x7125, 0x2700, + 0xac06, 0x00c0, 0x7172, 0x0078, 0x7130, 0x6018, 0xa206, 0x00c0, + 0x7172, 0x85ff, 0x0040, 0x7130, 0x6020, 0xa106, 0x00c0, 0x7172, + 0x703c, 0xac06, 0x00c0, 0x7142, 0x037e, 0x2019, 0x0001, 0x1078, + 0x6e6c, 0x7033, 0x0000, 0x703f, 0x0000, 0x7043, 0x0000, 0x7047, + 0x0000, 0x037f, 0x7038, 0xac36, 0x00c0, 0x7148, 0x660c, 0x763a, + 0x7034, 0xac36, 0x00c0, 0x7156, 0x2c00, 0xaf36, 0x0040, 0x7154, + 0x2f00, 0x7036, 0x0078, 0x7156, 0x7037, 0x0000, 0x660c, 0x067e, + 0x2c00, 0xaf06, 0x0040, 0x715f, 0x7e0e, 0x0078, 0x7160, 0x2678, + 0x600f, 0x0000, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x716a, + 0x1078, 0x9e70, 0x1078, 0x8c01, 0x87ff, 0x00c0, 0x7181, 0x0c7f, + 0x0078, 0x7114, 0x2c78, 0x600c, 0x2060, 0x0078, 0x7114, 0xa006, + 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, + 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa7bd, 0x0001, 0x0078, 0x7178, + 0x0e7e, 0x2071, 0xa5ab, 0x2001, 0xa300, 0x2004, 0xa086, 0x0002, + 0x00c0, 0x7196, 0x7007, 0x0005, 0x0078, 0x7198, 0x7007, 0x0000, + 0x0e7f, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x067e, 0x027e, 0x007e, + 0x127e, 0x2091, 0x8000, 0x2071, 0xa5ab, 0x2c10, 0x7638, 0x2660, + 0x2678, 0x8cff, 0x0040, 0x71d8, 0x2200, 0xac06, 0x00c0, 0x71d3, + 0x7038, 0xac36, 0x00c0, 0x71b6, 0x660c, 0x763a, 0x7034, 0xac36, + 0x00c0, 0x71c4, 0x2c00, 0xaf36, 0x0040, 0x71c2, 0x2f00, 0x7036, + 0x0078, 0x71c4, 0x7037, 0x0000, 0x660c, 0x2c00, 0xaf06, 0x0040, + 0x71cc, 0x7e0e, 0x0078, 0x71cd, 0x2678, 0x600f, 0x0000, 0xa085, + 0x0001, 0x0078, 0x71d8, 0x2c78, 0x600c, 0x2060, 0x0078, 0x71a9, + 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, + 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091, + 0x8000, 0x2071, 0xa5ab, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0040, + 0x7279, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x7274, + 0x7024, 0xac06, 0x00c0, 0x721f, 0x2069, 0x0100, 0x68c0, 0xa005, + 0x0040, 0x724d, 0x1078, 0x6c41, 0x68c3, 0x0000, 0x1078, 0x7188, + 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, + 0x0040, 0x7216, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, + 0x6824, 0xd084, 0x0040, 0x721e, 0x6827, 0x0001, 0x037f, 0x700c, + 0xac36, 0x00c0, 0x7225, 0x660c, 0x760e, 0x7008, 0xac36, 0x00c0, + 0x7233, 0x2c00, 0xaf36, 0x0040, 0x7231, 0x2f00, 0x700a, 0x0078, + 0x7233, 0x700b, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, + 0x723c, 0x7e0e, 0x0078, 0x723d, 0x2678, 0x600f, 0x0000, 0x1078, + 0x8c27, 0x00c0, 0x7251, 0x1078, 0x2839, 0x1078, 0x8c3b, 0x00c0, + 0x726d, 0x1078, 0x7a05, 0x0078, 0x726d, 0x1078, 0x7188, 0x0078, + 0x721f, 0x1078, 0x8c3b, 0x00c0, 0x7259, 0x1078, 0x7a05, 0x0078, + 0x726d, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x726d, 0x601c, + 0xa086, 0x0003, 0x00c0, 0x7281, 0x6837, 0x0103, 0x6b4a, 0x6847, + 0x0000, 0x1078, 0x4982, 0x1078, 0x8bf4, 0x1078, 0x8c01, 0x1078, + 0x7045, 0x0c7f, 0x0078, 0x71ee, 0x2c78, 0x600c, 0x2060, 0x0078, + 0x71ee, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, + 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x726d, 0x1078, 0x9e70, + 0x0078, 0x726d, 0x037e, 0x157e, 0x137e, 0x147e, 0x3908, 0xa006, + 0xa190, 0x0020, 0x221c, 0xa39e, 0x260c, 0x00c0, 0x729b, 0x8210, + 0x8000, 0x0078, 0x7292, 0xa005, 0x0040, 0x72a7, 0x20a9, 0x0020, + 0x2198, 0x8211, 0xa282, 0x0020, 0x20c8, 0x20a0, 0x53a3, 0x147f, + 0x137f, 0x157f, 0x037f, 0x007c, 0x0d7e, 0x20a1, 0x020b, 0x1078, + 0x65f8, 0x20a3, 0x0200, 0x20a3, 0x0014, 0x60c3, 0x0014, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x2099, 0xa5a3, 0x20a9, 0x0004, 0x53a6, + 0x20a3, 0x0004, 0x20a3, 0x7878, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x1078, 0x6c2d, 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078, 0x65f8, + 0x20a3, 0x0214, 0x20a3, 0x0018, 0x20a3, 0x0800, 0x7810, 0xa084, + 0xff00, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x7810, 0xa084, 0x00ff, 0x20a2, 0x7828, 0x20a2, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0018, 0x1078, 0x6c2d, + 0x007c, 0x0d7e, 0x017e, 0x2f68, 0x2009, 0x0035, 0x1078, 0x8ef5, + 0x00c0, 0x7361, 0x20a1, 0x020b, 0x1078, 0x6567, 0x20a3, 0x1300, + 0x20a3, 0x0000, 0x7828, 0x2068, 0x681c, 0xa086, 0x0003, 0x0040, + 0x733d, 0x7818, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e, 0x00c0, + 0x7317, 0x20a3, 0x00ff, 0x20a3, 0xfffe, 0x0078, 0x7352, 0xa286, + 0x007f, 0x00c0, 0x7321, 0x20a3, 0x00ff, 0x20a3, 0xfffd, 0x0078, + 0x7352, 0xd2bc, 0x0040, 0x7337, 0xa286, 0x0080, 0x00c0, 0x732e, + 0x20a3, 0x00ff, 0x20a3, 0xfffc, 0x0078, 0x7352, 0xa2e8, 0xa434, + 0x2d6c, 0x6810, 0x20a2, 0x6814, 0x20a2, 0x0078, 0x7352, 0x20a3, + 0x0000, 0x6098, 0x20a2, 0x0078, 0x7352, 0x7818, 0xa080, 0x0028, + 0x2004, 0xa082, 0x007e, 0x0048, 0x734e, 0x0d7e, 0x2069, 0xa31a, + 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x7352, 0x20a3, 0x0000, + 0x6030, 0x20a2, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x60c3, 0x000c, 0x1078, 0x6c2d, 0x017f, 0x0d7f, + 0x007c, 0x7817, 0x0001, 0x7803, 0x0006, 0x017f, 0x0d7f, 0x007c, + 0x0d7e, 0x027e, 0x7928, 0x2168, 0x691c, 0xa186, 0x0006, 0x0040, + 0x738a, 0xa186, 0x0003, 0x0040, 0x73e5, 0xa186, 0x0005, 0x0040, + 0x73c8, 0xa186, 0x0004, 0x0040, 0x73b8, 0xa186, 0x0008, 0x0040, + 0x73d2, 0x7807, 0x0037, 0x7813, 0x1700, 0x1078, 0x7450, 0x027f, + 0x0d7f, 0x007c, 0x1078, 0x740d, 0x2009, 0x4000, 0x6800, 0x0079, + 0x7391, 0x73a4, 0x73b2, 0x73a6, 0x73b2, 0x73ad, 0x73a4, 0x73a4, + 0x73b2, 0x73b2, 0x73b2, 0x73b2, 0x73a4, 0x73a4, 0x73a4, 0x73a4, + 0x73a4, 0x73b2, 0x73a4, 0x73b2, 0x1078, 0x1328, 0x6824, 0xd0e4, + 0x0040, 0x73ad, 0xd0cc, 0x0040, 0x73b0, 0xa00e, 0x0078, 0x73b2, + 0x2009, 0x2000, 0x6828, 0x20a2, 0x682c, 0x20a2, 0x0078, 0x7403, + 0x1078, 0x740d, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x2009, 0x4000, + 0x6a00, 0xa286, 0x0002, 0x00c0, 0x73c6, 0xa00e, 0x0078, 0x7403, + 0x1078, 0x740d, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x2009, 0x4000, + 0x0078, 0x7403, 0x1078, 0x740d, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x2009, 0x4000, 0xa286, 0x0005, 0x0040, 0x73e2, 0xa286, 0x0002, + 0x00c0, 0x73e3, 0xa00e, 0x0078, 0x7403, 0x1078, 0x740d, 0x6810, + 0x2068, 0x697c, 0x6810, 0xa112, 0x6980, 0x6814, 0xa103, 0x20a2, + 0x22a2, 0x7928, 0xa180, 0x0000, 0x2004, 0xa08e, 0x0002, 0x0040, + 0x7401, 0xa08e, 0x0004, 0x0040, 0x7401, 0x2009, 0x4000, 0x0078, + 0x7403, 0x2009, 0x0000, 0x21a2, 0x20a3, 0x0000, 0x60c3, 0x0018, + 0x1078, 0x6c2d, 0x027f, 0x0d7f, 0x007c, 0x037e, 0x047e, 0x057e, + 0x067e, 0x20a1, 0x020b, 0x1078, 0x65f8, 0xa006, 0x20a3, 0x0200, + 0x20a2, 0x7934, 0x21a2, 0x7938, 0x21a2, 0x7818, 0xa080, 0x0028, + 0x2004, 0xa092, 0x007e, 0x0048, 0x7433, 0x0d7e, 0x2069, 0xa31a, + 0x2d2c, 0x8d68, 0x2d34, 0xa0e8, 0xa434, 0x2d6c, 0x6b10, 0x6c14, + 0x0d7f, 0x0078, 0x7439, 0x2019, 0x0000, 0x6498, 0x2029, 0x0000, + 0x6630, 0x7828, 0xa080, 0x0007, 0x2004, 0xa086, 0x0003, 0x00c0, + 0x7447, 0x25a2, 0x26a2, 0x23a2, 0x24a2, 0x0078, 0x744b, 0x23a2, + 0x24a2, 0x25a2, 0x26a2, 0x067f, 0x057f, 0x047f, 0x037f, 0x007c, + 0x20a1, 0x020b, 0x1078, 0x65f8, 0x20a3, 0x0100, 0x20a3, 0x0000, + 0x20a3, 0x0009, 0x7810, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x6c2d, + 0x007c, 0x20a1, 0x020b, 0x1078, 0x655e, 0x20a3, 0x1400, 0x20a3, + 0x0000, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x7828, 0x20a2, 0x782c, + 0x20a2, 0x7830, 0xa084, 0x00ff, 0x8007, 0x20a2, 0x20a3, 0x0000, + 0x60c3, 0x0010, 0x1078, 0x6c2d, 0x007c, 0x20a1, 0x020b, 0x1078, + 0x65ef, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x7828, 0x20a2, 0x7810, + 0x20a2, 0x60c3, 0x0008, 0x1078, 0x6c2d, 0x007c, 0x147e, 0x20a1, + 0x020b, 0x1078, 0x7499, 0x60c3, 0x0000, 0x1078, 0x6c2d, 0x147f, + 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, + 0x2004, 0xd0bc, 0x0040, 0x74b6, 0x0d7e, 0xa0e8, 0xa434, 0x2d6c, + 0x6810, 0xa085, 0x0300, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xa31a, + 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x74be, 0x20a3, 0x0300, + 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0819, + 0x20a3, 0x0000, 0x1078, 0x6c1c, 0x22a2, 0x20a3, 0x0000, 0x2fa2, + 0x7a08, 0x22a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x007c, 0x2061, + 0xaa00, 0x2a70, 0x7060, 0x7046, 0x704b, 0xaa00, 0x007c, 0x0e7e, + 0x127e, 0x2071, 0xa300, 0x2091, 0x8000, 0x7544, 0xa582, 0x0010, + 0x0048, 0x7509, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, + 0x74f5, 0xace0, 0x0010, 0x7054, 0xac02, 0x00c8, 0x74f1, 0x0078, + 0x74e4, 0x2061, 0xaa00, 0x0078, 0x74e4, 0x6003, 0x0008, 0x8529, + 0x7546, 0xaca8, 0x0010, 0x7054, 0xa502, 0x00c8, 0x7505, 0x754a, + 0xa085, 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0xaa00, 0x0078, + 0x7500, 0xa006, 0x0078, 0x7502, 0x0e7e, 0x2071, 0xa300, 0x7544, + 0xa582, 0x0010, 0x0048, 0x753a, 0x7048, 0x2060, 0x6000, 0xa086, + 0x0000, 0x0040, 0x7527, 0xace0, 0x0010, 0x7054, 0xac02, 0x00c8, + 0x7523, 0x0078, 0x7516, 0x2061, 0xaa00, 0x0078, 0x7516, 0x6003, + 0x0008, 0x8529, 0x7546, 0xaca8, 0x0010, 0x7054, 0xa502, 0x00c8, + 0x7536, 0x754a, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x704b, 0xaa00, + 0x0078, 0x7532, 0xa006, 0x0078, 0x7534, 0xac82, 0xaa00, 0x1048, + 0x1328, 0x2001, 0xa315, 0x2004, 0xac02, 0x10c8, 0x1328, 0xa006, + 0x6006, 0x600a, 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000, + 0x6003, 0x0000, 0x6022, 0x6026, 0x602a, 0x602e, 0x6032, 0x6036, + 0x603a, 0x603e, 0x2061, 0xa300, 0x6044, 0x8000, 0x6046, 0xa086, + 0x0001, 0x0040, 0x7564, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, + 0x6109, 0x127f, 0x0078, 0x7563, 0x601c, 0xa084, 0x000f, 0x0079, + 0x7571, 0x757a, 0x758b, 0x75a7, 0x75c3, 0x8f2d, 0x8f49, 0x8f65, + 0x757a, 0x758b, 0xa186, 0x0013, 0x00c0, 0x7583, 0x1078, 0x6010, + 0x1078, 0x6109, 0x007c, 0xa18e, 0x0047, 0x00c0, 0x758a, 0xa016, + 0x1078, 0x15ec, 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, + 0x1328, 0x1079, 0x7595, 0x067f, 0x007c, 0x75a5, 0x7891, 0x7a34, + 0x75a5, 0x7ab8, 0x75df, 0x75a5, 0x75a5, 0x7823, 0x7e6d, 0x75a5, + 0x75a5, 0x75a5, 0x75a5, 0x75a5, 0x75a5, 0x1078, 0x1328, 0x067e, + 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1328, 0x1079, 0x75b1, 0x067f, + 0x007c, 0x75c1, 0x8522, 0x75c1, 0x75c1, 0x75c1, 0x75c1, 0x75c1, + 0x75c1, 0x84c5, 0x86a8, 0x75c1, 0x8552, 0x85d8, 0x8552, 0x85d8, + 0x75c1, 0x1078, 0x1328, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, + 0x1328, 0x1079, 0x75cd, 0x067f, 0x007c, 0x75dd, 0x7eb4, 0x7f81, + 0x80c6, 0x8242, 0x75dd, 0x75dd, 0x75dd, 0x7e8d, 0x846d, 0x8471, + 0x75dd, 0x75dd, 0x75dd, 0x75dd, 0x84a1, 0x1078, 0x1328, 0xa1b6, + 0x0015, 0x00c0, 0x75e7, 0x1078, 0x753d, 0x0078, 0x75ed, 0xa1b6, + 0x0016, 0x10c0, 0x1328, 0x1078, 0x753d, 0x007c, 0x20a9, 0x000e, + 0x2e98, 0x6010, 0x20a0, 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420, + 0x9398, 0x94a0, 0x3318, 0x3428, 0x222e, 0x2326, 0xa290, 0x0002, + 0xa5a8, 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x75fc, + 0x0e7e, 0x1078, 0x8a44, 0x0040, 0x7613, 0x6010, 0x2070, 0x7007, + 0x0000, 0x7037, 0x0103, 0x0e7f, 0x1078, 0x753d, 0x007c, 0x0d7e, + 0x037e, 0x7330, 0xa386, 0x0200, 0x00c0, 0x7624, 0x6018, 0x2068, + 0x6813, 0x00ff, 0x6817, 0xfffd, 0x6010, 0xa005, 0x0040, 0x762e, + 0x2068, 0x6807, 0x0000, 0x6837, 0x0103, 0x6b32, 0x1078, 0x753d, + 0x037f, 0x0d7f, 0x007c, 0x017e, 0x20a9, 0x002a, 0xae80, 0x000c, + 0x2098, 0x6010, 0xa080, 0x0002, 0x20a0, 0x53a3, 0x20a9, 0x002a, + 0x6010, 0xa080, 0x0001, 0x2004, 0xa080, 0x0002, 0x20a0, 0x53a3, + 0x0e7e, 0x6010, 0x2004, 0x2070, 0x7037, 0x0103, 0x0e7f, 0x1078, + 0x753d, 0x017f, 0x007c, 0x0e7e, 0x0d7e, 0x603f, 0x0000, 0x2c68, + 0x017e, 0x2009, 0x0035, 0x1078, 0x8ef5, 0x017f, 0x00c0, 0x766f, + 0x027e, 0x6228, 0x2268, 0x027f, 0x2071, 0xa88c, 0x6b1c, 0xa386, + 0x0003, 0x0040, 0x7673, 0xa386, 0x0006, 0x0040, 0x7677, 0x1078, + 0x753d, 0x0078, 0x7679, 0x1078, 0x767c, 0x0078, 0x7679, 0x1078, + 0x771e, 0x0d7f, 0x0e7f, 0x007c, 0x0f7e, 0x6810, 0x2078, 0xa186, + 0x0015, 0x0040, 0x7705, 0xa18e, 0x0016, 0x00c0, 0x771c, 0x700c, + 0xa084, 0xff00, 0xa086, 0x1700, 0x00c0, 0x76e0, 0x8fff, 0x0040, + 0x771a, 0x6808, 0xa086, 0xffff, 0x00c0, 0x7709, 0x784c, 0xa084, + 0x0060, 0xa086, 0x0020, 0x00c0, 0x76a7, 0x797c, 0x7810, 0xa106, + 0x00c0, 0x7709, 0x7980, 0x7814, 0xa106, 0x00c0, 0x7709, 0x1078, + 0x8bf4, 0x6830, 0x7852, 0x784c, 0xc0dc, 0xc0f4, 0xc0d4, 0x784e, + 0x027e, 0xa00e, 0x6a14, 0x2001, 0x000a, 0x1078, 0x5a98, 0x7854, + 0xa20a, 0x0048, 0x76bc, 0x8011, 0x7a56, 0x82ff, 0x027f, 0x00c0, + 0x76c8, 0x0c7e, 0x2d60, 0x1078, 0x8832, 0x0c7f, 0x0078, 0x771a, + 0x0c7e, 0x0d7e, 0x2f68, 0x6838, 0xd0fc, 0x00c0, 0x76d3, 0x1078, + 0x4290, 0x0078, 0x76d5, 0x1078, 0x436e, 0x0d7f, 0x0c7f, 0x00c0, + 0x7709, 0x0c7e, 0x2d60, 0x1078, 0x753d, 0x0c7f, 0x0078, 0x771a, + 0x7008, 0xa086, 0x000b, 0x00c0, 0x76fa, 0x6018, 0x200c, 0xc1bc, + 0x2102, 0x0c7e, 0x2d60, 0x7853, 0x0003, 0x6007, 0x0085, 0x6003, + 0x000b, 0x601f, 0x0002, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0c7f, + 0x0078, 0x771a, 0x700c, 0xa086, 0x2a00, 0x00c0, 0x7709, 0x2001, + 0xa5a2, 0x2004, 0x683e, 0x0078, 0x771a, 0x1078, 0x7739, 0x0078, + 0x771c, 0x8fff, 0x1040, 0x1328, 0x0c7e, 0x0d7e, 0x2d60, 0x2f68, + 0x684b, 0x0003, 0x1078, 0x8726, 0x1078, 0x8bf4, 0x1078, 0x8c01, + 0x0d7f, 0x0c7f, 0x1078, 0x753d, 0x0f7f, 0x007c, 0xa186, 0x0015, + 0x00c0, 0x7728, 0x2001, 0xa5a2, 0x2004, 0x683e, 0x0078, 0x7736, + 0xa18e, 0x0016, 0x00c0, 0x7738, 0x0c7e, 0x2d00, 0x2060, 0x1078, + 0xa134, 0x1078, 0x5a41, 0x1078, 0x753d, 0x0c7f, 0x1078, 0x753d, + 0x007c, 0x027e, 0x037e, 0x047e, 0x7228, 0x7c80, 0x7b7c, 0xd2f4, + 0x0040, 0x7748, 0x2001, 0xa5a2, 0x2004, 0x683e, 0x0078, 0x77ac, + 0x0c7e, 0x2d60, 0x1078, 0x874a, 0x0c7f, 0x6804, 0xa086, 0x0050, + 0x00c0, 0x7760, 0x0c7e, 0x2d00, 0x2060, 0x6003, 0x0001, 0x6007, + 0x0050, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0c7f, 0x0078, 0x77ac, + 0x6800, 0xa086, 0x000f, 0x0040, 0x7782, 0x8fff, 0x1040, 0x1328, + 0x6824, 0xd0dc, 0x00c0, 0x7782, 0x6800, 0xa086, 0x0004, 0x00c0, + 0x7787, 0x784c, 0xd0ac, 0x0040, 0x7787, 0x784c, 0xc0dc, 0xc0f4, + 0x784e, 0x7850, 0xc0f4, 0xc0fc, 0x7852, 0x2001, 0x0001, 0x682e, + 0x0078, 0x77a6, 0x2001, 0x0007, 0x682e, 0x0078, 0x77a6, 0x784c, + 0xd0b4, 0x00c0, 0x7794, 0xd0ac, 0x0040, 0x7782, 0x784c, 0xd0f4, + 0x00c0, 0x7782, 0x0078, 0x7775, 0xd2ec, 0x00c0, 0x7782, 0x7024, + 0xa306, 0x00c0, 0x779f, 0x7020, 0xa406, 0x0040, 0x7782, 0x7020, + 0x6836, 0x7024, 0x683a, 0x2001, 0x0005, 0x682e, 0x1078, 0x8d2b, + 0x1078, 0x6109, 0x0078, 0x77ae, 0x1078, 0x753d, 0x047f, 0x037f, + 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x027e, 0x6034, 0x2068, 0x6a1c, + 0xa286, 0x0007, 0x0040, 0x7806, 0xa286, 0x0002, 0x0040, 0x7806, + 0xa286, 0x0000, 0x0040, 0x7806, 0x6808, 0x6338, 0xa306, 0x00c0, + 0x7806, 0x2071, 0xa88c, 0xa186, 0x0015, 0x0040, 0x7800, 0xa18e, + 0x0016, 0x00c0, 0x77e8, 0x6030, 0xa084, 0x00ff, 0xa086, 0x0001, + 0x00c0, 0x77e8, 0x700c, 0xa086, 0x2a00, 0x00c0, 0x77e8, 0x6034, + 0xa080, 0x0009, 0x200c, 0xc1dd, 0xc1f5, 0x2102, 0x0078, 0x7800, + 0x0c7e, 0x6034, 0x2060, 0x6010, 0x2068, 0x1078, 0x8a44, 0x1040, + 0x1328, 0x6853, 0x0003, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, + 0x0002, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0c7f, 0x0078, 0x7806, + 0x6034, 0x2068, 0x2001, 0xa5a2, 0x2004, 0x683e, 0x1078, 0x753d, + 0x027f, 0x0d7f, 0x0e7f, 0x007c, 0x0d7e, 0x20a9, 0x000e, 0x2e98, + 0x6010, 0x20a0, 0x53a3, 0xa1b6, 0x0015, 0x00c0, 0x7820, 0x6018, + 0x2068, 0x7038, 0x680a, 0x703c, 0x680e, 0x6800, 0xc08d, 0x6802, + 0x0d7f, 0x0078, 0x7608, 0x2100, 0xa1b2, 0x0044, 0x10c8, 0x1328, + 0xa1b2, 0x0040, 0x00c8, 0x7888, 0x0079, 0x782e, 0x787c, 0x7870, + 0x787c, 0x787c, 0x787c, 0x787c, 0x786e, 0x786e, 0x786e, 0x786e, + 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, + 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, + 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x787c, 0x786e, 0x787c, + 0x787c, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x787c, 0x786e, + 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, + 0x787c, 0x787c, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, 0x786e, + 0x786e, 0x786e, 0x786e, 0x787c, 0x786e, 0x786e, 0x1078, 0x1328, + 0x6003, 0x0001, 0x6106, 0x1078, 0x5c45, 0x127e, 0x2091, 0x8000, + 0x1078, 0x6109, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, + 0x5c45, 0x127e, 0x2091, 0x8000, 0x1078, 0x6109, 0x127f, 0x007c, + 0x2600, 0x0079, 0x788b, 0x788f, 0x788f, 0x788f, 0x787c, 0x1078, + 0x1328, 0x6004, 0xa0b2, 0x0044, 0x10c8, 0x1328, 0xa1b6, 0x0013, + 0x00c0, 0x78a1, 0xa0b2, 0x0040, 0x00c8, 0x79fb, 0x2008, 0x0079, + 0x7941, 0xa1b6, 0x0027, 0x00c0, 0x78fe, 0x1078, 0x6010, 0x6004, + 0x1078, 0x8c27, 0x0040, 0x78be, 0x1078, 0x8c3b, 0x0040, 0x78f6, + 0xa08e, 0x0021, 0x0040, 0x78fa, 0xa08e, 0x0022, 0x0040, 0x78f6, + 0xa08e, 0x003d, 0x0040, 0x78fa, 0x0078, 0x78f1, 0x1078, 0x2839, + 0x2001, 0x0007, 0x1078, 0x443f, 0x6018, 0xa080, 0x0028, 0x200c, + 0x1078, 0x7a05, 0xa186, 0x007e, 0x00c0, 0x78d3, 0x2001, 0xa332, + 0x2014, 0xc285, 0x2202, 0x017e, 0x027e, 0x037e, 0x2110, 0x2019, + 0x0028, 0x1078, 0x5d53, 0x077e, 0x2039, 0x0000, 0x1078, 0x5c78, + 0x0c7e, 0x6018, 0xa065, 0x0040, 0x78e7, 0x1078, 0x471b, 0x0c7f, + 0x2c08, 0x1078, 0x9c38, 0x077f, 0x037f, 0x027f, 0x017f, 0x1078, + 0x44bc, 0x1078, 0x753d, 0x1078, 0x6109, 0x007c, 0x1078, 0x7a05, + 0x0078, 0x78f1, 0x1078, 0x7a28, 0x0078, 0x78f1, 0xa186, 0x0014, + 0x00c0, 0x78f5, 0x1078, 0x6010, 0x1078, 0x2813, 0x1078, 0x8c27, + 0x00c0, 0x791d, 0x1078, 0x2839, 0x6018, 0xa080, 0x0028, 0x200c, + 0x1078, 0x7a05, 0xa186, 0x007e, 0x00c0, 0x791b, 0x2001, 0xa332, + 0x200c, 0xc185, 0x2102, 0x0078, 0x78f1, 0x1078, 0x8c3b, 0x00c0, + 0x7925, 0x1078, 0x7a05, 0x0078, 0x78f1, 0x6004, 0xa08e, 0x0032, + 0x00c0, 0x7936, 0x0e7e, 0x0f7e, 0x2071, 0xa381, 0x2079, 0x0000, + 0x1078, 0x2b56, 0x0f7f, 0x0e7f, 0x0078, 0x78f1, 0x6004, 0xa08e, + 0x0021, 0x0040, 0x7921, 0xa08e, 0x0022, 0x1040, 0x7a05, 0x0078, + 0x78f1, 0x7983, 0x7985, 0x7989, 0x798d, 0x7991, 0x7995, 0x7981, + 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, + 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, + 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, 0x7999, + 0x79ab, 0x7981, 0x79ad, 0x79ab, 0x7981, 0x7981, 0x7981, 0x7981, + 0x7981, 0x79ab, 0x79ab, 0x7981, 0x7981, 0x7981, 0x7981, 0x7981, + 0x7981, 0x7981, 0x7981, 0x79de, 0x79ab, 0x7981, 0x79a5, 0x7981, + 0x7981, 0x7981, 0x79a7, 0x7981, 0x7981, 0x7981, 0x79ab, 0x7981, + 0x7981, 0x1078, 0x1328, 0x0078, 0x79ab, 0x2001, 0x000b, 0x0078, + 0x79b8, 0x2001, 0x0003, 0x0078, 0x79b8, 0x2001, 0x0005, 0x0078, + 0x79b8, 0x2001, 0x0001, 0x0078, 0x79b8, 0x2001, 0x0009, 0x0078, + 0x79b8, 0x1078, 0x6010, 0x6003, 0x0005, 0x2001, 0xa5a2, 0x2004, + 0x603e, 0x1078, 0x6109, 0x0078, 0x79b7, 0x0078, 0x79ab, 0x0078, + 0x79ab, 0x1078, 0x443f, 0x0078, 0x79f0, 0x1078, 0x6010, 0x6003, + 0x0004, 0x2001, 0xa5a0, 0x2004, 0x6016, 0x1078, 0x6109, 0x007c, + 0x1078, 0x443f, 0x1078, 0x6010, 0x2001, 0xa5a2, 0x2004, 0x603e, + 0x6003, 0x0002, 0x037e, 0x2019, 0xa35c, 0x2304, 0xa084, 0xff00, + 0x00c0, 0x79cf, 0x2019, 0xa5a0, 0x231c, 0x0078, 0x79d8, 0x8007, + 0xa09a, 0x0004, 0x0048, 0x79ca, 0x8003, 0x801b, 0x831b, 0xa318, + 0x6316, 0x037f, 0x1078, 0x6109, 0x0078, 0x79b7, 0x0e7e, 0x0f7e, + 0x2071, 0xa381, 0x2079, 0x0000, 0x1078, 0x2b56, 0x0f7f, 0x0e7f, + 0x1078, 0x6010, 0x1078, 0x753d, 0x1078, 0x6109, 0x0078, 0x79b7, + 0x1078, 0x6010, 0x6003, 0x0002, 0x2001, 0xa5a0, 0x2004, 0x6016, + 0x1078, 0x6109, 0x007c, 0x2600, 0x2008, 0x0079, 0x79ff, 0x7a03, + 0x7a03, 0x7a03, 0x79f0, 0x1078, 0x1328, 0x0e7e, 0x1078, 0x8a44, + 0x0040, 0x7a21, 0x6010, 0x2070, 0x7038, 0xd0fc, 0x0040, 0x7a21, + 0x7007, 0x0000, 0x017e, 0x6004, 0xa08e, 0x0021, 0x0040, 0x7a23, + 0xa08e, 0x003d, 0x0040, 0x7a23, 0x017f, 0x7037, 0x0103, 0x7033, + 0x0100, 0x0e7f, 0x007c, 0x017f, 0x1078, 0x7a28, 0x0078, 0x7a21, + 0x0e7e, 0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103, + 0x7023, 0x8001, 0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, + 0xa084, 0x00ff, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x1328, 0x6604, + 0xa6b6, 0x0043, 0x00c0, 0x7a48, 0x1078, 0x8e6d, 0x0078, 0x7aa7, + 0x6604, 0xa6b6, 0x0033, 0x00c0, 0x7a51, 0x1078, 0x8e11, 0x0078, + 0x7aa7, 0x6604, 0xa6b6, 0x0028, 0x00c0, 0x7a5a, 0x1078, 0x8c6a, + 0x0078, 0x7aa7, 0x6604, 0xa6b6, 0x0029, 0x00c0, 0x7a63, 0x1078, + 0x8c84, 0x0078, 0x7aa7, 0x6604, 0xa6b6, 0x001f, 0x00c0, 0x7a6c, + 0x1078, 0x75ee, 0x0078, 0x7aa7, 0x6604, 0xa6b6, 0x0000, 0x00c0, + 0x7a75, 0x1078, 0x780c, 0x0078, 0x7aa7, 0x6604, 0xa6b6, 0x0022, + 0x00c0, 0x7a7e, 0x1078, 0x7617, 0x0078, 0x7aa7, 0x6604, 0xa6b6, + 0x0035, 0x00c0, 0x7a87, 0x1078, 0x7653, 0x0078, 0x7aa7, 0x6604, + 0xa6b6, 0x0039, 0x00c0, 0x7a90, 0x1078, 0x77b2, 0x0078, 0x7aa7, + 0x6604, 0xa6b6, 0x003d, 0x00c0, 0x7a99, 0x1078, 0x7633, 0x0078, + 0x7aa7, 0xa1b6, 0x0015, 0x00c0, 0x7aa1, 0x1079, 0x7aac, 0x0078, + 0x7aa7, 0xa1b6, 0x0016, 0x00c0, 0x7aa8, 0x1079, 0x7bfd, 0x007c, + 0x1078, 0x7583, 0x0078, 0x7aa7, 0x7ad0, 0x7ad3, 0x7ad0, 0x7b1e, + 0x7ad0, 0x7b91, 0x7c09, 0x7ad0, 0x7ad0, 0x7bd5, 0x7ad0, 0x7beb, + 0xa1b6, 0x0048, 0x0040, 0x7ac4, 0x20e1, 0x0005, 0x3d18, 0x3e20, + 0x2c10, 0x1078, 0x15ec, 0x007c, 0x0e7e, 0xacf0, 0x0004, 0x2e74, + 0x7000, 0x2070, 0x7037, 0x0103, 0x0e7f, 0x1078, 0x753d, 0x007c, + 0x0005, 0x0005, 0x007c, 0x0e7e, 0x2071, 0xa300, 0x707c, 0xa086, + 0x0074, 0x00c0, 0x7b07, 0x1078, 0x9c0c, 0x00c0, 0x7af9, 0x0d7e, + 0x6018, 0x2068, 0x7030, 0xd08c, 0x0040, 0x7aec, 0x6800, 0xd0bc, + 0x0040, 0x7aec, 0xc0c5, 0x6802, 0x1078, 0x7b0b, 0x0d7f, 0x2001, + 0x0006, 0x1078, 0x443f, 0x1078, 0x2839, 0x1078, 0x753d, 0x0078, + 0x7b09, 0x2001, 0x000a, 0x1078, 0x443f, 0x1078, 0x2839, 0x6003, + 0x0001, 0x6007, 0x0001, 0x1078, 0x5c45, 0x0078, 0x7b09, 0x1078, + 0x7b81, 0x0e7f, 0x007c, 0x6800, 0xd084, 0x0040, 0x7b1d, 0x2001, + 0x0000, 0x1078, 0x442b, 0x2069, 0xa351, 0x6804, 0xd0a4, 0x0040, + 0x7b1d, 0x2001, 0x0006, 0x1078, 0x4472, 0x007c, 0x0d7e, 0x2011, + 0xa31f, 0x2204, 0xa086, 0x0074, 0x00c0, 0x7b7d, 0x6018, 0x2068, + 0x6aa0, 0xa286, 0x007e, 0x00c0, 0x7b31, 0x1078, 0x7d17, 0x0078, + 0x7b7f, 0x1078, 0x7d0d, 0x6018, 0x2068, 0xa080, 0x0028, 0x2014, + 0xa286, 0x0080, 0x00c0, 0x7b55, 0x6813, 0x00ff, 0x6817, 0xfffc, + 0x6010, 0xa005, 0x0040, 0x7b4b, 0x2068, 0x6807, 0x0000, 0x6837, + 0x0103, 0x6833, 0x0200, 0x2001, 0x0006, 0x1078, 0x443f, 0x1078, + 0x2839, 0x1078, 0x753d, 0x0078, 0x7b7f, 0x0e7e, 0x2071, 0xa332, + 0x2e04, 0xd09c, 0x0040, 0x7b70, 0x2071, 0xa880, 0x7108, 0x720c, + 0xa18c, 0x00ff, 0x00c0, 0x7b68, 0xa284, 0xff00, 0x0040, 0x7b70, + 0x6018, 0x2070, 0x70a0, 0xd0bc, 0x00c0, 0x7b70, 0x7112, 0x7216, + 0x0e7f, 0x2001, 0x0004, 0x1078, 0x443f, 0x6003, 0x0001, 0x6007, + 0x0003, 0x1078, 0x5c45, 0x0078, 0x7b7f, 0x1078, 0x7b81, 0x0d7f, + 0x007c, 0x2001, 0xa300, 0x2004, 0xa086, 0x0003, 0x0040, 0x7b8c, + 0x2001, 0x0007, 0x1078, 0x443f, 0x1078, 0x2839, 0x1078, 0x753d, + 0x007c, 0x0e7e, 0x2071, 0xa300, 0x707c, 0xa086, 0x0014, 0x00c0, + 0x7bcf, 0x7000, 0xa086, 0x0003, 0x00c0, 0x7ba4, 0x6010, 0xa005, + 0x00c0, 0x7ba4, 0x1078, 0x35f7, 0x0d7e, 0x6018, 0x2068, 0x1078, + 0x457d, 0x1078, 0x7b0b, 0x0d7f, 0x1078, 0x7dba, 0x00c0, 0x7bcf, + 0x0d7e, 0x6018, 0x2068, 0x6890, 0x0d7f, 0xa005, 0x0040, 0x7bcf, + 0x2001, 0x0006, 0x1078, 0x443f, 0x0e7e, 0x6010, 0xa005, 0x0040, + 0x7bc8, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0200, + 0x0e7f, 0x1078, 0x2839, 0x1078, 0x753d, 0x0078, 0x7bd3, 0x1078, + 0x7a05, 0x1078, 0x7b81, 0x0e7f, 0x007c, 0x2011, 0xa31f, 0x2204, + 0xa086, 0x0014, 0x00c0, 0x7be8, 0x2001, 0x0002, 0x1078, 0x443f, + 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x5c45, 0x0078, 0x7bea, + 0x1078, 0x7b81, 0x007c, 0x2011, 0xa31f, 0x2204, 0xa086, 0x0004, + 0x00c0, 0x7bfa, 0x2001, 0x0007, 0x1078, 0x443f, 0x1078, 0x753d, + 0x0078, 0x7bfc, 0x1078, 0x7b81, 0x007c, 0x7ad0, 0x7c11, 0x7ad0, + 0x7c4e, 0x7ad0, 0x7cc0, 0x7c09, 0x7ad0, 0x7ad0, 0x7cd5, 0x7ad0, + 0x7ce8, 0x6604, 0xa6b6, 0x001e, 0x00c0, 0x7c10, 0x1078, 0x753d, + 0x007c, 0x0d7e, 0x0c7e, 0x1078, 0x7cfb, 0x00c0, 0x7c27, 0x2001, + 0x0000, 0x1078, 0x442b, 0x2001, 0x0002, 0x1078, 0x443f, 0x6003, + 0x0001, 0x6007, 0x0002, 0x1078, 0x5c45, 0x0078, 0x7c4b, 0x2009, + 0xa88e, 0x2104, 0xa086, 0x0009, 0x00c0, 0x7c3c, 0x6018, 0x2068, + 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x7c49, 0x8001, 0x6842, + 0x6017, 0x000a, 0x0078, 0x7c4b, 0x2009, 0xa88f, 0x2104, 0xa084, + 0xff00, 0xa086, 0x1900, 0x00c0, 0x7c49, 0x1078, 0x753d, 0x0078, + 0x7c4b, 0x1078, 0x7b81, 0x0c7f, 0x0d7f, 0x007c, 0x1078, 0x7d0a, + 0x00c0, 0x7c62, 0x2001, 0x0000, 0x1078, 0x442b, 0x2001, 0x0002, + 0x1078, 0x443f, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x5c45, + 0x0078, 0x7c8e, 0x1078, 0x7a05, 0x2009, 0xa88e, 0x2134, 0xa6b4, + 0x00ff, 0xa686, 0x0005, 0x0040, 0x7c8f, 0xa686, 0x000b, 0x0040, + 0x7c8c, 0x2009, 0xa88f, 0x2104, 0xa084, 0xff00, 0x00c0, 0x7c7c, + 0xa686, 0x0009, 0x0040, 0x7c8f, 0xa086, 0x1900, 0x00c0, 0x7c8c, + 0xa686, 0x0009, 0x0040, 0x7c8f, 0x2001, 0x0004, 0x1078, 0x443f, + 0x1078, 0x753d, 0x0078, 0x7c8e, 0x1078, 0x7b81, 0x007c, 0x0d7e, + 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x7c9d, 0x6838, 0xd0fc, + 0x0040, 0x7c9d, 0x0d7f, 0x0078, 0x7c8c, 0x6018, 0x2068, 0x6840, + 0xa084, 0x00ff, 0xa005, 0x0040, 0x7cae, 0x8001, 0x6842, 0x6017, + 0x000a, 0x6007, 0x0016, 0x0d7f, 0x0078, 0x7c8e, 0x68a0, 0xa086, + 0x007e, 0x00c0, 0x7cbb, 0x0e7e, 0x2071, 0xa300, 0x1078, 0x41f5, + 0x0e7f, 0x0078, 0x7cbd, 0x1078, 0x2813, 0x0d7f, 0x0078, 0x7c8c, + 0x1078, 0x7d0a, 0x00c0, 0x7cd0, 0x2001, 0x0004, 0x1078, 0x443f, + 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x5c45, 0x0078, 0x7cd4, + 0x1078, 0x7a05, 0x1078, 0x7b81, 0x007c, 0x1078, 0x7d0a, 0x00c0, + 0x7ce5, 0x2001, 0x0008, 0x1078, 0x443f, 0x6003, 0x0001, 0x6007, + 0x0005, 0x1078, 0x5c45, 0x0078, 0x7ce7, 0x1078, 0x7b81, 0x007c, + 0x1078, 0x7d0a, 0x00c0, 0x7cf8, 0x2001, 0x000a, 0x1078, 0x443f, + 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x5c45, 0x0078, 0x7cfa, + 0x1078, 0x7b81, 0x007c, 0x2009, 0xa88e, 0x2104, 0xa086, 0x0003, + 0x00c0, 0x7d09, 0x2009, 0xa88f, 0x2104, 0xa084, 0xff00, 0xa086, + 0x2a00, 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e, 0x017e, 0xac88, + 0x0006, 0x2164, 0x1078, 0x4513, 0x017f, 0x0c7f, 0x007c, 0x0f7e, + 0x0e7e, 0x0d7e, 0x037e, 0x017e, 0x6018, 0x2068, 0x2071, 0xa332, + 0x2e04, 0xa085, 0x0003, 0x2072, 0x1078, 0x7d8b, 0x0040, 0x7d50, + 0x2001, 0xa352, 0x2004, 0xd0a4, 0x0040, 0x7d39, 0xa006, 0x2020, + 0x2009, 0x002a, 0x1078, 0x9ec0, 0x2001, 0xa30c, 0x200c, 0xc195, + 0x2102, 0x2019, 0x002a, 0x2009, 0x0001, 0x1078, 0x27e2, 0x2071, + 0xa300, 0x1078, 0x260d, 0x0c7e, 0x157e, 0x20a9, 0x0081, 0x2009, + 0x007f, 0x1078, 0x2921, 0x8108, 0x00f0, 0x7d49, 0x157f, 0x0c7f, + 0x1078, 0x7d0d, 0x6813, 0x00ff, 0x6817, 0xfffe, 0x2071, 0xa880, + 0x2079, 0x0100, 0x2e04, 0xa084, 0x00ff, 0x2069, 0xa31a, 0x206a, + 0x78e6, 0x007e, 0x8e70, 0x2e04, 0x2069, 0xa31b, 0x206a, 0x78ea, + 0xa084, 0xff00, 0x017f, 0xa105, 0x2009, 0xa325, 0x200a, 0x2069, + 0xa88e, 0x2071, 0xa59c, 0x6810, 0x2072, 0x6814, 0x7006, 0x6818, + 0x700a, 0x681c, 0x700e, 0x1078, 0x8da9, 0x2001, 0x0006, 0x1078, + 0x443f, 0x1078, 0x2839, 0x1078, 0x753d, 0x017f, 0x037f, 0x0d7f, + 0x0e7f, 0x0f7f, 0x007c, 0x027e, 0x037e, 0x0e7e, 0x157e, 0x2019, + 0xa325, 0x231c, 0x83ff, 0x0040, 0x7db5, 0x2071, 0xa880, 0x2e14, + 0xa294, 0x00ff, 0x7004, 0xa084, 0xff00, 0xa205, 0xa306, 0x00c0, + 0x7db5, 0x2011, 0xa896, 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078, + 0x7e55, 0x00c0, 0x7db5, 0x2011, 0xa89a, 0xad98, 0x0006, 0x20a9, + 0x0004, 0x1078, 0x7e55, 0x00c0, 0x7db5, 0x157f, 0x0e7f, 0x037f, + 0x027f, 0x007c, 0x0e7e, 0x2071, 0xa88c, 0x7004, 0xa086, 0x0014, + 0x00c0, 0x7ddd, 0x7008, 0xa086, 0x0800, 0x00c0, 0x7ddd, 0x700c, + 0xd0ec, 0x0040, 0x7ddb, 0xa084, 0x0f00, 0xa086, 0x0100, 0x00c0, + 0x7ddb, 0x7024, 0xd0a4, 0x00c0, 0x7dd8, 0xd0ac, 0x0040, 0x7ddb, + 0xa006, 0x0078, 0x7ddd, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0e7e, + 0x0d7e, 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e, 0x127e, + 0x2091, 0x8000, 0x2029, 0xa5b4, 0x252c, 0x2021, 0xa5ba, 0x2424, + 0x2061, 0xaa00, 0x2071, 0xa300, 0x7244, 0x7060, 0xa202, 0x00c8, + 0x7e43, 0x1078, 0x9ee5, 0x0040, 0x7e3b, 0x671c, 0xa786, 0x0001, + 0x0040, 0x7e3b, 0xa786, 0x0007, 0x0040, 0x7e3b, 0x2500, 0xac06, + 0x0040, 0x7e3b, 0x2400, 0xac06, 0x0040, 0x7e3b, 0x0c7e, 0x6000, + 0xa086, 0x0004, 0x00c0, 0x7e16, 0x1078, 0x1749, 0xa786, 0x0008, + 0x00c0, 0x7e25, 0x1078, 0x8c3b, 0x00c0, 0x7e25, 0x0c7f, 0x1078, + 0x7a05, 0x1078, 0x8c01, 0x0078, 0x7e3b, 0x6010, 0x2068, 0x1078, + 0x8a44, 0x0040, 0x7e38, 0xa786, 0x0003, 0x00c0, 0x7e4d, 0x6837, + 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x4982, 0x1078, 0x8bf4, + 0x1078, 0x8c01, 0x0c7f, 0xace0, 0x0010, 0x7054, 0xac02, 0x00c8, + 0x7e43, 0x0078, 0x7df4, 0x127f, 0x007f, 0x027f, 0x047f, 0x057f, + 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, + 0x7e2f, 0x1078, 0x9e70, 0x0078, 0x7e38, 0x220c, 0x2304, 0xa106, + 0x00c0, 0x7e60, 0x8210, 0x8318, 0x00f0, 0x7e55, 0xa006, 0x007c, + 0x2304, 0xa102, 0x0048, 0x7e68, 0x2001, 0x0001, 0x0078, 0x7e6a, + 0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a, 0x0044, + 0x10c8, 0x1328, 0x1078, 0x8c27, 0x0040, 0x7e7c, 0x1078, 0x8c3b, + 0x0040, 0x7e89, 0x0078, 0x7e82, 0x1078, 0x2839, 0x1078, 0x8c3b, + 0x0040, 0x7e89, 0x1078, 0x6010, 0x1078, 0x753d, 0x1078, 0x6109, + 0x007c, 0x1078, 0x7a05, 0x0078, 0x7e82, 0xa182, 0x0040, 0x0079, + 0x7e91, 0x7ea4, 0x7ea4, 0x7ea4, 0x7ea4, 0x7ea4, 0x7ea4, 0x7ea4, + 0x7ea4, 0x7ea4, 0x7ea4, 0x7ea4, 0x7ea6, 0x7ea6, 0x7ea6, 0x7ea6, + 0x7ea4, 0x7ea4, 0x7ea4, 0x7ea6, 0x1078, 0x1328, 0x600b, 0xffff, + 0x6003, 0x0001, 0x6106, 0x1078, 0x5bf8, 0x127e, 0x2091, 0x8000, + 0x1078, 0x6109, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x7ebd, + 0x6004, 0xa082, 0x0040, 0x0079, 0x7f48, 0xa186, 0x0027, 0x00c0, + 0x7edf, 0x1078, 0x6010, 0x1078, 0x2813, 0x0d7e, 0x6110, 0x2168, + 0x1078, 0x8a44, 0x0040, 0x7ed9, 0x6837, 0x0103, 0x684b, 0x0029, + 0x6847, 0x0000, 0x694c, 0xc1c5, 0x694e, 0x1078, 0x4982, 0x1078, + 0x8bf4, 0x0d7f, 0x1078, 0x753d, 0x1078, 0x6109, 0x007c, 0xa186, + 0x0014, 0x00c0, 0x7ee8, 0x6004, 0xa082, 0x0040, 0x0079, 0x7f10, + 0xa186, 0x0046, 0x0040, 0x7ef4, 0xa186, 0x0045, 0x0040, 0x7ef4, + 0xa186, 0x0047, 0x10c0, 0x1328, 0x2001, 0x0109, 0x2004, 0xd084, + 0x0040, 0x7f0d, 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e, + 0x1078, 0x5ad2, 0x027f, 0x017f, 0x007f, 0x127f, 0x6000, 0xa086, + 0x0002, 0x00c0, 0x7f0d, 0x0078, 0x7f81, 0x1078, 0x7583, 0x007c, + 0x7f25, 0x7f23, 0x7f23, 0x7f23, 0x7f23, 0x7f23, 0x7f23, 0x7f23, + 0x7f23, 0x7f23, 0x7f23, 0x7f41, 0x7f41, 0x7f41, 0x7f41, 0x7f23, + 0x7f41, 0x7f23, 0x7f41, 0x1078, 0x1328, 0x1078, 0x6010, 0x0d7e, + 0x6110, 0x2168, 0x1078, 0x8a44, 0x0040, 0x7f3b, 0x6837, 0x0103, + 0x684b, 0x0006, 0x6847, 0x0000, 0x6850, 0xc0ec, 0x6852, 0x1078, + 0x4982, 0x1078, 0x8bf4, 0x0d7f, 0x1078, 0x753d, 0x1078, 0x6109, + 0x007c, 0x1078, 0x6010, 0x1078, 0x753d, 0x1078, 0x6109, 0x007c, + 0x7f5d, 0x7f5b, 0x7f5b, 0x7f5b, 0x7f5b, 0x7f5b, 0x7f5b, 0x7f5b, + 0x7f5b, 0x7f5b, 0x7f5b, 0x7f6f, 0x7f6f, 0x7f6f, 0x7f6f, 0x7f5b, + 0x7f7a, 0x7f5b, 0x7f6f, 0x1078, 0x1328, 0x1078, 0x6010, 0x2001, + 0xa5a2, 0x2004, 0x603e, 0x6003, 0x0002, 0x1078, 0x6109, 0x6010, + 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x007c, 0x1078, + 0x6010, 0x2001, 0xa5a2, 0x2004, 0x603e, 0x6003, 0x000f, 0x1078, + 0x6109, 0x007c, 0x1078, 0x6010, 0x1078, 0x753d, 0x1078, 0x6109, + 0x007c, 0xa182, 0x0040, 0x0079, 0x7f85, 0x7f98, 0x7f98, 0x7f98, + 0x7f98, 0x7f98, 0x7f9a, 0x8095, 0x80b7, 0x7f98, 0x7f98, 0x7f98, + 0x7f98, 0x7f98, 0x7f98, 0x7f98, 0x7f98, 0x7f98, 0x7f98, 0x7f98, + 0x1078, 0x1328, 0x0e7e, 0x0d7e, 0x603f, 0x0000, 0x2071, 0xa880, + 0x7124, 0x610a, 0x2071, 0xa88c, 0x6110, 0x2168, 0x7614, 0xa6b4, + 0x0fff, 0x86ff, 0x0040, 0x8058, 0xa68c, 0x0c00, 0x0040, 0x7fd1, + 0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0f7f, 0x0040, 0x7fcd, 0x684c, + 0xd0ac, 0x0040, 0x7fcd, 0x6024, 0xd0dc, 0x00c0, 0x7fcd, 0x6850, + 0xd0bc, 0x00c0, 0x7fcd, 0x7318, 0x6814, 0xa306, 0x00c0, 0x806f, + 0x731c, 0x6810, 0xa306, 0x00c0, 0x806f, 0x7318, 0x6b62, 0x731c, + 0x6b5e, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x8004, 0xa186, + 0x0028, 0x00c0, 0x7fe1, 0x1078, 0x8c15, 0x684b, 0x001c, 0x0078, + 0x8006, 0xd6dc, 0x0040, 0x7ffd, 0x684b, 0x0015, 0x684c, 0xd0ac, + 0x0040, 0x7ffb, 0x6914, 0x6a10, 0x2100, 0xa205, 0x0040, 0x7ffb, + 0x7018, 0xa106, 0x00c0, 0x7ff8, 0x701c, 0xa206, 0x0040, 0x7ffb, + 0x6962, 0x6a5e, 0xc6dc, 0x0078, 0x8006, 0xd6d4, 0x0040, 0x8004, + 0x684b, 0x0007, 0x0078, 0x8006, 0x684b, 0x0000, 0x6837, 0x0103, + 0x6e46, 0xa01e, 0xd6c4, 0x0040, 0x802f, 0xa686, 0x0100, 0x00c0, + 0x801a, 0x2001, 0xa899, 0x2004, 0xa005, 0x00c0, 0x801a, 0xc6c4, + 0x0078, 0x7fa9, 0x7328, 0x732c, 0x6b56, 0x83ff, 0x0040, 0x802f, + 0xa38a, 0x0009, 0x0048, 0x8026, 0x2019, 0x0008, 0x037e, 0x2308, + 0x2019, 0xa898, 0xad90, 0x0019, 0x1078, 0x8739, 0x037f, 0xd6cc, + 0x0040, 0x8085, 0x7124, 0x695a, 0x81ff, 0x0040, 0x8085, 0xa192, + 0x0021, 0x00c8, 0x8046, 0x2071, 0xa898, 0x831c, 0x2300, 0xae18, + 0xad90, 0x001d, 0x1078, 0x8739, 0x0078, 0x8085, 0x6838, 0xd0fc, + 0x0040, 0x804f, 0x2009, 0x0020, 0x695a, 0x0078, 0x803b, 0x0f7e, + 0x2d78, 0x1078, 0x86d1, 0x0f7f, 0x1078, 0x8726, 0x0078, 0x8087, + 0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0f7f, 0x0040, 0x8075, 0x684c, + 0xd0ac, 0x0040, 0x8075, 0x6024, 0xd0dc, 0x00c0, 0x8075, 0x6850, + 0xd0bc, 0x00c0, 0x8075, 0x684c, 0xd0f4, 0x00c0, 0x8075, 0x1078, + 0x8cfa, 0x0d7f, 0x0e7f, 0x0078, 0x8094, 0x684b, 0x0000, 0x6837, + 0x0103, 0x6e46, 0x684c, 0xd0ac, 0x0040, 0x8085, 0x6810, 0x6914, + 0xa115, 0x0040, 0x8085, 0x1078, 0x8233, 0x1078, 0x4982, 0x6218, + 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x1078, 0x8cc4, 0x0d7f, 0x0e7f, + 0x00c0, 0x8094, 0x1078, 0x753d, 0x007c, 0x0f7e, 0x6003, 0x0003, + 0x2079, 0xa88c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, + 0x784c, 0xd0ac, 0x0040, 0x80a8, 0x6003, 0x0002, 0x0f7f, 0x007c, + 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x603f, 0x0000, 0x2c10, + 0x1078, 0x1cab, 0x1078, 0x5c64, 0x1078, 0x61d3, 0x007c, 0x2001, + 0xa5a2, 0x2004, 0x603e, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, + 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x15ec, 0x007c, 0xa182, 0x0040, + 0x0079, 0x80ca, 0x80dd, 0x80dd, 0x80dd, 0x80dd, 0x80dd, 0x80df, + 0x8182, 0x80dd, 0x80dd, 0x8198, 0x8209, 0x80dd, 0x80dd, 0x80dd, + 0x80dd, 0x8218, 0x80dd, 0x80dd, 0x80dd, 0x1078, 0x1328, 0x077e, + 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0xa88c, 0x6110, 0x2178, 0x7614, + 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268, + 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x817d, 0xa694, 0xff00, + 0xa284, 0x0c00, 0x0040, 0x8100, 0x7018, 0x7862, 0x701c, 0x785e, + 0xa284, 0x0300, 0x0040, 0x817d, 0x1078, 0x1381, 0x1040, 0x1328, + 0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837, 0x0103, 0x7838, + 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, 0x0c00, + 0x0040, 0x811e, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0xa68c, 0x00ff, + 0xa186, 0x0002, 0x0040, 0x813a, 0xa186, 0x0028, 0x00c0, 0x812c, + 0x684b, 0x001c, 0x0078, 0x813c, 0xd6dc, 0x0040, 0x8133, 0x684b, + 0x0015, 0x0078, 0x813c, 0xd6d4, 0x0040, 0x813a, 0x684b, 0x0007, + 0x0078, 0x813c, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854, + 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x815a, 0x7328, 0x732c, 0x6b56, + 0x83ff, 0x0040, 0x815a, 0xa38a, 0x0009, 0x0048, 0x8151, 0x2019, + 0x0008, 0x037e, 0x2308, 0x2019, 0xa898, 0xad90, 0x0019, 0x1078, + 0x8739, 0x037f, 0xd6cc, 0x0040, 0x817d, 0x7124, 0x695a, 0x81ff, + 0x0040, 0x817d, 0xa192, 0x0021, 0x00c8, 0x8171, 0x2071, 0xa898, + 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x8739, 0x0078, + 0x817d, 0x7838, 0xd0fc, 0x0040, 0x817a, 0x2009, 0x0020, 0x695a, + 0x0078, 0x8166, 0x2d78, 0x1078, 0x86d1, 0x0d7f, 0x0e7f, 0x0f7f, + 0x077f, 0x007c, 0x0f7e, 0x6003, 0x0003, 0x2079, 0xa88c, 0x7c04, + 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, + 0x7d0e, 0x0f7f, 0x2c10, 0x1078, 0x1cab, 0x1078, 0x6c26, 0x007c, + 0x0d7e, 0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0f7f, 0x0040, 0x81a4, + 0x2001, 0xa5a2, 0x2004, 0x603e, 0x6003, 0x0002, 0x1078, 0x60b8, + 0x1078, 0x61d3, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040, 0x8207, + 0xd1cc, 0x0040, 0x81de, 0x6948, 0x6838, 0xd0fc, 0x0040, 0x81d6, + 0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90, 0x000d, 0xa198, + 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304, 0x2012, 0x8318, + 0x8210, 0x00f0, 0x81c5, 0x157f, 0x007f, 0x6852, 0x007f, 0x684e, + 0x017f, 0x2168, 0x1078, 0x13aa, 0x0078, 0x8201, 0x017e, 0x1078, + 0x13aa, 0x0d7f, 0x1078, 0x8726, 0x0078, 0x8201, 0x6837, 0x0103, + 0x6944, 0xa184, 0x00ff, 0xa0b6, 0x0002, 0x0040, 0x81fd, 0xa086, + 0x0028, 0x00c0, 0x81ef, 0x684b, 0x001c, 0x0078, 0x81ff, 0xd1dc, + 0x0040, 0x81f6, 0x684b, 0x0015, 0x0078, 0x81ff, 0xd1d4, 0x0040, + 0x81fd, 0x684b, 0x0007, 0x0078, 0x81ff, 0x684b, 0x0000, 0x1078, + 0x4982, 0x1078, 0x8cc4, 0x00c0, 0x8207, 0x1078, 0x753d, 0x0d7f, + 0x007c, 0x2019, 0x0001, 0x1078, 0x6e6c, 0x6003, 0x0002, 0x2001, + 0xa5a2, 0x2004, 0x603e, 0x1078, 0x60b8, 0x1078, 0x61d3, 0x007c, + 0x1078, 0x60b8, 0x1078, 0x2813, 0x0d7e, 0x6110, 0x2168, 0x1078, + 0x8a44, 0x0040, 0x822d, 0x6837, 0x0103, 0x684b, 0x0029, 0x6847, + 0x0000, 0x1078, 0x4982, 0x1078, 0x8bf4, 0x0d7f, 0x1078, 0x753d, + 0x1078, 0x61d3, 0x007c, 0x684b, 0x0015, 0xd1fc, 0x0040, 0x823f, + 0x684b, 0x0007, 0x8002, 0x8000, 0x810a, 0xa189, 0x0000, 0x6962, + 0x685e, 0x007c, 0xa182, 0x0040, 0x0079, 0x8246, 0x8259, 0x8259, + 0x8259, 0x8259, 0x8259, 0x825b, 0x8259, 0x8333, 0x833f, 0x8259, + 0x8259, 0x8259, 0x8259, 0x8259, 0x8259, 0x8259, 0x8259, 0x8259, + 0x8259, 0x1078, 0x1328, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, + 0xa88c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x0f7e, 0x2c78, + 0x1078, 0x4893, 0x0f7f, 0x0040, 0x827e, 0xa684, 0x00ff, 0x00c0, + 0x827e, 0x6024, 0xd0f4, 0x00c0, 0x827a, 0x7808, 0xa086, 0x0000, + 0x00c0, 0x827e, 0x1078, 0x8cfa, 0x0078, 0x832e, 0x7e46, 0x7f4c, + 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, + 0x0040, 0x8323, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x8294, + 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x8320, + 0xa686, 0x0100, 0x00c0, 0x82a6, 0x2001, 0xa899, 0x2004, 0xa005, + 0x00c0, 0x82a6, 0xc6c4, 0x7e46, 0x0078, 0x8287, 0x1078, 0x1381, + 0x1040, 0x1328, 0x2d00, 0x784a, 0x7f4c, 0xa7bd, 0x0200, 0x7f4e, + 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, + 0x6e46, 0xa68c, 0x0c00, 0x0040, 0x82c1, 0x7318, 0x6b62, 0x731c, + 0x6b5e, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x82dd, 0xa186, + 0x0028, 0x00c0, 0x82cf, 0x684b, 0x001c, 0x0078, 0x82df, 0xd6dc, + 0x0040, 0x82d6, 0x684b, 0x0015, 0x0078, 0x82df, 0xd6d4, 0x0040, + 0x82dd, 0x684b, 0x0007, 0x0078, 0x82df, 0x684b, 0x0000, 0x6f4e, + 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x82fd, + 0x7328, 0x732c, 0x6b56, 0x83ff, 0x0040, 0x82fd, 0xa38a, 0x0009, + 0x0048, 0x82f4, 0x2019, 0x0008, 0x037e, 0x2308, 0x2019, 0xa898, + 0xad90, 0x0019, 0x1078, 0x8739, 0x037f, 0xd6cc, 0x0040, 0x8320, + 0x7124, 0x695a, 0x81ff, 0x0040, 0x8320, 0xa192, 0x0021, 0x00c8, + 0x8314, 0x2071, 0xa898, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, + 0x1078, 0x8739, 0x0078, 0x8320, 0x7838, 0xd0fc, 0x0040, 0x831d, + 0x2009, 0x0020, 0x695a, 0x0078, 0x8309, 0x2d78, 0x1078, 0x86d1, + 0xd6dc, 0x00c0, 0x8326, 0xa006, 0x0078, 0x832c, 0x2001, 0x0001, + 0x2071, 0xa88c, 0x7218, 0x731c, 0x1078, 0x1645, 0x0d7f, 0x0e7f, + 0x0f7f, 0x077f, 0x007c, 0x2001, 0xa5a2, 0x2004, 0x603e, 0x20e1, + 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x15ec, 0x007c, 0x2001, + 0xa5a2, 0x2004, 0x603e, 0x0d7e, 0x6003, 0x0002, 0x6110, 0x2168, + 0x694c, 0xd1e4, 0x0040, 0x846b, 0x603f, 0x0000, 0x0f7e, 0x2c78, + 0x1078, 0x4893, 0x0f7f, 0x0040, 0x8385, 0x6814, 0x6910, 0xa115, + 0x0040, 0x8385, 0x6a60, 0xa206, 0x00c0, 0x8362, 0x685c, 0xa106, + 0x0040, 0x8385, 0x684c, 0xc0e4, 0x684e, 0x6847, 0x0000, 0x6863, + 0x0000, 0x685f, 0x0000, 0x6024, 0xd0f4, 0x00c0, 0x837a, 0x697c, + 0x6810, 0xa102, 0x603a, 0x6980, 0x6814, 0xa103, 0x6036, 0x6024, + 0xc0f5, 0x6026, 0x0d7e, 0x6018, 0x2068, 0x683c, 0x8000, 0x683e, + 0x0d7f, 0x1078, 0x8cfa, 0x0078, 0x846b, 0x694c, 0xd1cc, 0x0040, + 0x8430, 0x6948, 0x6838, 0xd0fc, 0x0040, 0x83ea, 0x017e, 0x684c, + 0x007e, 0x6850, 0x007e, 0x0f7e, 0x2178, 0x7944, 0xa184, 0x00ff, + 0xa0b6, 0x0002, 0x0040, 0x83bf, 0xa086, 0x0028, 0x00c0, 0x83a6, + 0x684b, 0x001c, 0x784b, 0x001c, 0x0078, 0x83ca, 0xd1dc, 0x0040, + 0x83b6, 0x684b, 0x0015, 0x784b, 0x0015, 0x1078, 0x8ea5, 0x0040, + 0x83b4, 0x7944, 0xc1dc, 0x7946, 0x0078, 0x83ca, 0xd1d4, 0x0040, + 0x83bf, 0x684b, 0x0007, 0x784b, 0x0007, 0x0078, 0x83ca, 0x684c, + 0xd0ac, 0x0040, 0x83ca, 0x6810, 0x6914, 0xa115, 0x0040, 0x83ca, + 0x1078, 0x8233, 0x6848, 0x784a, 0x6860, 0x7862, 0x685c, 0x785e, + 0xad90, 0x000d, 0xaf98, 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, + 0x2304, 0x2012, 0x8318, 0x8210, 0x00f0, 0x83d8, 0x157f, 0x0f7f, + 0x007f, 0x6852, 0x007f, 0x684e, 0x017f, 0x2168, 0x1078, 0x13aa, + 0x0078, 0x8465, 0x017e, 0x0f7e, 0x2178, 0x7944, 0xa184, 0x00ff, + 0xa0b6, 0x0002, 0x0040, 0x8417, 0xa086, 0x0028, 0x00c0, 0x83fe, + 0x684b, 0x001c, 0x784b, 0x001c, 0x0078, 0x8422, 0xd1dc, 0x0040, + 0x840e, 0x684b, 0x0015, 0x784b, 0x0015, 0x1078, 0x8ea5, 0x0040, + 0x840c, 0x7944, 0xc1dc, 0x7946, 0x0078, 0x8422, 0xd1d4, 0x0040, + 0x8417, 0x684b, 0x0007, 0x784b, 0x0007, 0x0078, 0x8422, 0x684c, + 0xd0ac, 0x0040, 0x8422, 0x6810, 0x6914, 0xa115, 0x0040, 0x8422, + 0x1078, 0x8233, 0x6860, 0x7862, 0x685c, 0x785e, 0x684c, 0x784e, + 0x0f7f, 0x1078, 0x13aa, 0x0d7f, 0x1078, 0x8726, 0x0078, 0x8465, + 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa0b6, 0x0002, 0x0040, + 0x8456, 0xa086, 0x0028, 0x00c0, 0x8441, 0x684b, 0x001c, 0x0078, + 0x8463, 0xd1dc, 0x0040, 0x844f, 0x684b, 0x0015, 0x1078, 0x8ea5, + 0x0040, 0x844d, 0x6944, 0xc1dc, 0x6946, 0x0078, 0x8463, 0xd1d4, + 0x0040, 0x8456, 0x684b, 0x0007, 0x0078, 0x8463, 0x684b, 0x0000, + 0x684c, 0xd0ac, 0x0040, 0x8463, 0x6810, 0x6914, 0xa115, 0x0040, + 0x8463, 0x1078, 0x8233, 0x1078, 0x4982, 0x1078, 0x8cc4, 0x00c0, + 0x846b, 0x1078, 0x753d, 0x0d7f, 0x007c, 0x1078, 0x6010, 0x0078, + 0x8473, 0x1078, 0x60b8, 0x1078, 0x8a44, 0x0040, 0x8492, 0x0d7e, + 0x6110, 0x2168, 0x6837, 0x0103, 0x2009, 0xa30c, 0x210c, 0xd18c, + 0x00c0, 0x849d, 0xd184, 0x00c0, 0x8499, 0x6108, 0x694a, 0xa18e, + 0x0029, 0x00c0, 0x848d, 0x1078, 0xa181, 0x6847, 0x0000, 0x1078, + 0x4982, 0x0d7f, 0x1078, 0x753d, 0x1078, 0x6109, 0x1078, 0x61d3, + 0x007c, 0x684b, 0x0004, 0x0078, 0x848d, 0x684b, 0x0004, 0x0078, + 0x848d, 0xa182, 0x0040, 0x0079, 0x84a5, 0x84b8, 0x84b8, 0x84b8, + 0x84b8, 0x84b8, 0x84ba, 0x84b8, 0x84bd, 0x84b8, 0x84b8, 0x84b8, + 0x84b8, 0x84b8, 0x84b8, 0x84b8, 0x84b8, 0x84b8, 0x84b8, 0x84b8, + 0x1078, 0x1328, 0x1078, 0x753d, 0x007c, 0x007e, 0x027e, 0xa016, + 0x1078, 0x15ec, 0x027f, 0x007f, 0x007c, 0xa182, 0x0085, 0x0079, + 0x84c9, 0x84d2, 0x84d0, 0x84d0, 0x84de, 0x84d0, 0x84d0, 0x84d0, + 0x1078, 0x1328, 0x6003, 0x0001, 0x6106, 0x1078, 0x5bf8, 0x127e, + 0x2091, 0x8000, 0x1078, 0x6109, 0x127f, 0x007c, 0x027e, 0x057e, + 0x0d7e, 0x0e7e, 0x2071, 0xa880, 0x7224, 0x6212, 0x7220, 0x1078, + 0x8a30, 0x0040, 0x8503, 0x2268, 0x6800, 0xa086, 0x0000, 0x0040, + 0x8503, 0x6018, 0x6d18, 0xa52e, 0x00c0, 0x8503, 0x0c7e, 0x2d60, + 0x1078, 0x874a, 0x0c7f, 0x0040, 0x8503, 0x6803, 0x0002, 0x6007, + 0x0086, 0x0078, 0x8505, 0x6007, 0x0087, 0x6003, 0x0001, 0x1078, + 0x5bf8, 0x1078, 0x6109, 0x0f7e, 0x2278, 0x1078, 0x4893, 0x0f7f, + 0x0040, 0x851d, 0x6824, 0xd0ec, 0x0040, 0x851d, 0x0c7e, 0x2260, + 0x603f, 0x0000, 0x1078, 0x8cfa, 0x0c7f, 0x0e7f, 0x0d7f, 0x057f, + 0x027f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x8533, 0x6004, 0xa08a, + 0x0085, 0x1048, 0x1328, 0xa08a, 0x008c, 0x10c8, 0x1328, 0xa082, + 0x0085, 0x0079, 0x8542, 0xa186, 0x0027, 0x0040, 0x853b, 0xa186, + 0x0014, 0x10c0, 0x1328, 0x1078, 0x6010, 0x1078, 0x8c01, 0x1078, + 0x6109, 0x007c, 0x8549, 0x854b, 0x854b, 0x8549, 0x8549, 0x8549, + 0x8549, 0x1078, 0x1328, 0x1078, 0x6010, 0x1078, 0x8c01, 0x1078, + 0x6109, 0x007c, 0xa186, 0x0013, 0x00c0, 0x855c, 0x6004, 0xa082, + 0x0085, 0x2008, 0x0078, 0x8597, 0xa186, 0x0027, 0x00c0, 0x857f, + 0x1078, 0x6010, 0x1078, 0x2813, 0x0d7e, 0x6010, 0x2068, 0x1078, + 0x8a44, 0x0040, 0x8575, 0x6837, 0x0103, 0x6847, 0x0000, 0x684b, + 0x0029, 0x1078, 0x4982, 0x1078, 0x8bf4, 0x0d7f, 0x1078, 0x753d, + 0x1078, 0x6109, 0x007c, 0x1078, 0x7583, 0x0078, 0x857a, 0xa186, + 0x0014, 0x00c0, 0x857b, 0x1078, 0x6010, 0x0d7e, 0x6010, 0x2068, + 0x1078, 0x8a44, 0x0040, 0x8575, 0x6837, 0x0103, 0x6847, 0x0000, + 0x684b, 0x0006, 0x6850, 0xc0ec, 0x6852, 0x0078, 0x8571, 0x0079, + 0x8599, 0x85a2, 0x85a0, 0x85a0, 0x85a0, 0x85a0, 0x85a0, 0x85bd, + 0x1078, 0x1328, 0x1078, 0x6010, 0x6030, 0xa08c, 0xff00, 0x810f, + 0xa186, 0x0039, 0x0040, 0x85b0, 0xa186, 0x0035, 0x00c0, 0x85b4, + 0x2001, 0xa5a0, 0x0078, 0x85b6, 0x2001, 0xa5a1, 0x2004, 0x6016, + 0x6003, 0x000c, 0x1078, 0x6109, 0x007c, 0x1078, 0x6010, 0x6030, + 0xa08c, 0xff00, 0x810f, 0xa186, 0x0039, 0x0040, 0x85cb, 0xa186, + 0x0035, 0x00c0, 0x85cf, 0x2001, 0xa5a0, 0x0078, 0x85d1, 0x2001, + 0xa5a1, 0x2004, 0x6016, 0x6003, 0x000e, 0x1078, 0x6109, 0x007c, + 0xa182, 0x008c, 0x00c8, 0x85e2, 0xa182, 0x0085, 0x0048, 0x85e2, + 0x0079, 0x85e5, 0x1078, 0x7583, 0x007c, 0x85ec, 0x85ec, 0x85ec, + 0x85ec, 0x85ee, 0x8643, 0x85ec, 0x1078, 0x1328, 0x0f7e, 0x2c78, + 0x1078, 0x4893, 0x0f7f, 0x0040, 0x8601, 0x6030, 0xa08c, 0xff00, + 0x810f, 0xa186, 0x0039, 0x0040, 0x865a, 0xa186, 0x0035, 0x0040, + 0x865a, 0x0d7e, 0x1078, 0x8bf4, 0x1078, 0x8a44, 0x0040, 0x8625, + 0x6010, 0x2068, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040, 0x8616, + 0x684b, 0x0006, 0xc0ec, 0x6852, 0x0078, 0x8621, 0xd0bc, 0x0040, + 0x861d, 0x684b, 0x0002, 0x0078, 0x8621, 0x684b, 0x0005, 0x1078, + 0x8cc0, 0x6847, 0x0000, 0x1078, 0x4982, 0x2c68, 0x1078, 0x74d7, + 0x0040, 0x863e, 0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0xa88e, + 0x210c, 0x6136, 0x2009, 0xa88f, 0x210c, 0x613a, 0x6918, 0x611a, + 0x6920, 0x6122, 0x601f, 0x0001, 0x1078, 0x5bf8, 0x2d60, 0x1078, + 0x753d, 0x0d7f, 0x007c, 0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0f7f, + 0x0040, 0x8680, 0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0035, + 0x0040, 0x865a, 0xa186, 0x001e, 0x0040, 0x865a, 0xa186, 0x0039, + 0x00c0, 0x8680, 0x0d7e, 0x2c68, 0x1078, 0x8ef5, 0x00c0, 0x86a4, + 0x1078, 0x74d7, 0x0040, 0x867d, 0x6106, 0x6003, 0x0001, 0x601f, + 0x0001, 0x6918, 0x611a, 0x6928, 0x612a, 0x692c, 0x612e, 0x6930, + 0xa18c, 0x00ff, 0x6132, 0x6934, 0x6136, 0x6938, 0x613a, 0x6920, + 0x6122, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x2d60, 0x0078, 0x86a4, + 0x0d7e, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x86a4, 0x6837, + 0x0103, 0x6850, 0xd0b4, 0x0040, 0x8693, 0xc0ec, 0x6852, 0x684b, + 0x0006, 0x0078, 0x869e, 0xd0bc, 0x0040, 0x869a, 0x684b, 0x0002, + 0x0078, 0x869e, 0x684b, 0x0005, 0x1078, 0x8cc0, 0x6847, 0x0000, + 0x1078, 0x4982, 0x1078, 0x8bf4, 0x0d7f, 0x1078, 0x753d, 0x007c, + 0x017e, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x86b8, + 0x6837, 0x0103, 0x684b, 0x0028, 0x6847, 0x0000, 0x1078, 0x4982, + 0x0d7f, 0x017f, 0xa186, 0x0013, 0x0040, 0x86ca, 0xa186, 0x0014, + 0x0040, 0x86ca, 0xa186, 0x0027, 0x0040, 0x86ca, 0x1078, 0x7583, + 0x0078, 0x86d0, 0x1078, 0x6010, 0x1078, 0x8c01, 0x1078, 0x6109, + 0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e, 0x2029, 0x0001, 0xa182, + 0x0101, 0x00c8, 0x86dd, 0x0078, 0x86df, 0x2009, 0x0100, 0x2130, + 0x2069, 0xa898, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020, 0xaf90, + 0x001d, 0x1078, 0x8739, 0xa6b2, 0x0020, 0x7804, 0xa06d, 0x0040, + 0x86f3, 0x1078, 0x13aa, 0x1078, 0x1381, 0x0040, 0x871d, 0x8528, + 0x6837, 0x0110, 0x683b, 0x0000, 0x2d20, 0x7c06, 0xa68a, 0x003d, + 0x00c8, 0x8709, 0x2608, 0xad90, 0x000f, 0x1078, 0x8739, 0x0078, + 0x871d, 0xa6b2, 0x003c, 0x2009, 0x003c, 0x2d78, 0xad90, 0x000f, + 0x1078, 0x8739, 0x0078, 0x86f3, 0x0f7f, 0x852f, 0xa5ad, 0x0003, + 0x7d36, 0xa5ac, 0x0000, 0x0078, 0x8722, 0x0f7f, 0x852f, 0xa5ad, + 0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f, 0x007c, 0x0f7e, 0x8dff, + 0x0040, 0x8737, 0x6804, 0xa07d, 0x0040, 0x8735, 0x6807, 0x0000, + 0x1078, 0x4982, 0x2f68, 0x0078, 0x872a, 0x1078, 0x4982, 0x0f7f, + 0x007c, 0x157e, 0xa184, 0x0001, 0x0040, 0x873f, 0x8108, 0x810c, + 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318, 0x8210, 0x00f0, 0x8741, + 0x157f, 0x007c, 0x067e, 0x127e, 0x2091, 0x8000, 0x2031, 0x0001, + 0x601c, 0xa084, 0x000f, 0x1079, 0x8766, 0x127f, 0x067f, 0x007c, + 0x127e, 0x2091, 0x8000, 0x067e, 0x2031, 0x0000, 0x601c, 0xa084, + 0x000f, 0x1079, 0x8766, 0x067f, 0x127f, 0x007c, 0x8780, 0x876e, + 0x877b, 0x879c, 0x876e, 0x877b, 0x879c, 0x877b, 0x1078, 0x1328, + 0x037e, 0x2019, 0x0010, 0x1078, 0x9a6a, 0x601f, 0x0006, 0x6003, + 0x0007, 0x037f, 0x007c, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, + 0x0d7e, 0x86ff, 0x00c0, 0x8797, 0x6010, 0x2068, 0x1078, 0x8a44, + 0x0040, 0x8799, 0xa00e, 0x2001, 0x0005, 0x1078, 0x4a60, 0x1078, + 0x8cc0, 0x1078, 0x4982, 0x1078, 0x753d, 0xa085, 0x0001, 0x0d7f, + 0x007c, 0xa006, 0x0078, 0x8797, 0x6000, 0xa08a, 0x0010, 0x10c8, + 0x1328, 0x1079, 0x87a4, 0x007c, 0x87b4, 0x87d4, 0x87b6, 0x87f7, + 0x87d0, 0x87b4, 0x877b, 0x8780, 0x8780, 0x877b, 0x877b, 0x877b, + 0x877b, 0x877b, 0x877b, 0x877b, 0x1078, 0x1328, 0x86ff, 0x00c0, + 0x87cd, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x87c2, + 0x1078, 0x8cc0, 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, + 0x0002, 0x1078, 0x5bf8, 0x1078, 0x6109, 0xa085, 0x0001, 0x007c, + 0x1078, 0x1749, 0x0078, 0x87b6, 0x0e7e, 0x2071, 0xa5ab, 0x7024, + 0xac06, 0x00c0, 0x87dd, 0x1078, 0x6dda, 0x601c, 0xa084, 0x000f, + 0xa086, 0x0006, 0x00c0, 0x87ef, 0x087e, 0x097e, 0x2049, 0x0001, + 0x2c40, 0x1078, 0x7058, 0x097f, 0x087f, 0x0078, 0x87f1, 0x1078, + 0x6cd2, 0x0e7f, 0x00c0, 0x87b6, 0x1078, 0x877b, 0x007c, 0x037e, + 0x0e7e, 0x2071, 0xa5ab, 0x703c, 0xac06, 0x00c0, 0x8807, 0x2019, + 0x0000, 0x1078, 0x6e6c, 0x0e7f, 0x037f, 0x0078, 0x87b6, 0x1078, + 0x719a, 0x0e7f, 0x037f, 0x00c0, 0x87b6, 0x1078, 0x877b, 0x007c, + 0x0c7e, 0x601c, 0xa084, 0x000f, 0x1079, 0x8818, 0x0c7f, 0x007c, + 0x8827, 0x8895, 0x89cd, 0x8832, 0x8c01, 0x8827, 0x9a5b, 0x753d, + 0x8895, 0x1078, 0x8c3b, 0x00c0, 0x8827, 0x1078, 0x7a05, 0x007c, + 0x1078, 0x6010, 0x1078, 0x6109, 0x1078, 0x753d, 0x007c, 0x6017, + 0x0001, 0x007c, 0x6010, 0xa080, 0x0019, 0x2c02, 0x6000, 0xa08a, + 0x0010, 0x10c8, 0x1328, 0x1079, 0x883e, 0x007c, 0x884e, 0x8850, + 0x8872, 0x8884, 0x8891, 0x884e, 0x8827, 0x8827, 0x8827, 0x8884, + 0x8884, 0x884e, 0x884e, 0x884e, 0x884e, 0x888e, 0x1078, 0x1328, + 0x0e7e, 0x6010, 0x2070, 0x7050, 0xc0b5, 0x7052, 0x2071, 0xa5ab, + 0x7024, 0xac06, 0x0040, 0x886e, 0x1078, 0x6cd2, 0x6007, 0x0085, + 0x6003, 0x000b, 0x601f, 0x0002, 0x2001, 0xa5a1, 0x2004, 0x6016, + 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0e7f, 0x007c, 0x6017, 0x0001, + 0x0078, 0x886c, 0x0d7e, 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852, + 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x1078, + 0x5bf8, 0x1078, 0x6109, 0x007c, 0x0d7e, 0x6017, 0x0001, 0x6010, + 0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x007c, 0x1078, 0x753d, + 0x007c, 0x1078, 0x1749, 0x0078, 0x8872, 0x6000, 0xa08a, 0x0010, + 0x10c8, 0x1328, 0x1079, 0x889d, 0x007c, 0x88ad, 0x882f, 0x88af, + 0x88ad, 0x88af, 0x88af, 0x8828, 0x88ad, 0x8821, 0x8821, 0x88ad, + 0x88ad, 0x88ad, 0x88ad, 0x88ad, 0x88ad, 0x1078, 0x1328, 0x0d7e, + 0x6018, 0x2068, 0x6804, 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c, + 0x10c8, 0x1328, 0x1079, 0x88bd, 0x007c, 0x88c9, 0x8971, 0x88cb, + 0x890b, 0x88cb, 0x890b, 0x88cb, 0x88d8, 0x88c9, 0x890b, 0x88c9, + 0x88f5, 0x1078, 0x1328, 0x6004, 0xa08e, 0x0016, 0x0040, 0x8906, + 0xa08e, 0x0004, 0x0040, 0x8906, 0xa08e, 0x0002, 0x0040, 0x8906, + 0x6004, 0x1078, 0x8c3b, 0x0040, 0x898c, 0xa08e, 0x0021, 0x0040, + 0x8990, 0xa08e, 0x0022, 0x0040, 0x898c, 0xa08e, 0x003d, 0x0040, + 0x8990, 0xa08e, 0x0039, 0x0040, 0x8994, 0xa08e, 0x0035, 0x0040, + 0x8994, 0xa08e, 0x001e, 0x0040, 0x8908, 0xa08e, 0x0001, 0x00c0, + 0x8904, 0x0d7e, 0x6018, 0x2068, 0x6804, 0xa084, 0x00ff, 0x0d7f, + 0xa086, 0x0006, 0x0040, 0x8906, 0x1078, 0x2813, 0x1078, 0x7a05, + 0x1078, 0x8c01, 0x007c, 0x0c7e, 0x0d7e, 0x6104, 0xa186, 0x0016, + 0x0040, 0x8961, 0xa186, 0x0002, 0x00c0, 0x8934, 0x6018, 0x2068, + 0x68a0, 0xd0bc, 0x00c0, 0x89b8, 0x6840, 0xa084, 0x00ff, 0xa005, + 0x0040, 0x8934, 0x8001, 0x6842, 0x6013, 0x0000, 0x601f, 0x0007, + 0x6017, 0x0398, 0x1078, 0x74d7, 0x0040, 0x8934, 0x2d00, 0x601a, + 0x601f, 0x0001, 0x0078, 0x8961, 0x0d7f, 0x0c7f, 0x6004, 0xa08e, + 0x0002, 0x00c0, 0x8952, 0x6018, 0xa080, 0x0028, 0x2004, 0xa086, + 0x007e, 0x00c0, 0x8952, 0x2009, 0xa332, 0x2104, 0xc085, 0x200a, + 0x0e7e, 0x2071, 0xa300, 0x1078, 0x41f5, 0x0e7f, 0x1078, 0x7a05, + 0x0078, 0x8956, 0x1078, 0x7a05, 0x1078, 0x2813, 0x0e7e, 0x127e, + 0x2091, 0x8000, 0x1078, 0x2839, 0x127f, 0x0e7f, 0x1078, 0x8c01, + 0x007c, 0x2001, 0x0002, 0x1078, 0x443f, 0x6003, 0x0001, 0x6007, + 0x0002, 0x1078, 0x5c45, 0x1078, 0x6109, 0x0d7f, 0x0c7f, 0x0078, + 0x8960, 0x0c7e, 0x0d7e, 0x6104, 0xa186, 0x0016, 0x0040, 0x8961, + 0x6018, 0x2068, 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x8934, + 0x8001, 0x6842, 0x6003, 0x0001, 0x1078, 0x5c45, 0x1078, 0x6109, + 0x0d7f, 0x0c7f, 0x0078, 0x8960, 0x1078, 0x7a05, 0x0078, 0x8908, + 0x1078, 0x7a28, 0x0078, 0x8908, 0x0d7e, 0x2c68, 0x6104, 0x1078, + 0x8ef5, 0x0d7f, 0x0040, 0x89a0, 0x1078, 0x753d, 0x0078, 0x89b7, + 0x6004, 0x8007, 0x6130, 0xa18c, 0x00ff, 0xa105, 0x6032, 0x6007, + 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x6038, 0x600a, 0x2001, + 0xa5a1, 0x2004, 0x6016, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x007c, + 0x0d7f, 0x0c7f, 0x1078, 0x7a05, 0x1078, 0x2813, 0x0e7e, 0x127e, + 0x2091, 0x8000, 0x1078, 0x2839, 0x6013, 0x0000, 0x601f, 0x0007, + 0x6017, 0x0398, 0x127f, 0x0e7f, 0x007c, 0x6000, 0xa08a, 0x0010, + 0x10c8, 0x1328, 0x1079, 0x89d5, 0x007c, 0x89e5, 0x89e5, 0x89e5, + 0x89e5, 0x89e5, 0x89e5, 0x89e5, 0x89e5, 0x89e5, 0x8827, 0x89e5, + 0x882f, 0x89e7, 0x882f, 0x89f5, 0x89e5, 0x1078, 0x1328, 0x6004, + 0xa086, 0x008b, 0x0040, 0x89f5, 0x6007, 0x008b, 0x6003, 0x000d, + 0x1078, 0x5bf8, 0x1078, 0x6109, 0x007c, 0x1078, 0x8bf4, 0x1078, + 0x8a44, 0x0040, 0x8a2d, 0x1078, 0x2813, 0x0d7e, 0x1078, 0x8a44, + 0x0040, 0x8a0f, 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006, + 0x6847, 0x0000, 0x6850, 0xc0ed, 0x6852, 0x1078, 0x4982, 0x2c68, + 0x1078, 0x74d7, 0x0040, 0x8a1d, 0x6818, 0x601a, 0x0c7e, 0x2d60, + 0x1078, 0x8c01, 0x0c7f, 0x0078, 0x8a1e, 0x2d60, 0x0d7f, 0x6013, + 0x0000, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, + 0x5c45, 0x1078, 0x6109, 0x0078, 0x8a2f, 0x1078, 0x8c01, 0x007c, + 0xa284, 0x000f, 0x00c0, 0x8a41, 0xa282, 0xaa00, 0x0048, 0x8a41, + 0x2001, 0xa315, 0x2004, 0xa202, 0x00c8, 0x8a41, 0xa085, 0x0001, + 0x007c, 0xa006, 0x0078, 0x8a40, 0x027e, 0x0e7e, 0x2071, 0xa300, + 0x6210, 0x7058, 0xa202, 0x0048, 0x8a56, 0x705c, 0xa202, 0x00c8, + 0x8a56, 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c, 0xa006, 0x0078, + 0x8a53, 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e, 0x2091, 0x8000, + 0x2061, 0xaa00, 0x2071, 0xa300, 0x7344, 0x7060, 0xa302, 0x00c8, + 0x8a83, 0x601c, 0xa206, 0x00c0, 0x8a7b, 0x1078, 0x8d66, 0x0040, + 0x8a7b, 0x1078, 0x8c3b, 0x00c0, 0x8a77, 0x1078, 0x7a05, 0x0c7e, + 0x1078, 0x753d, 0x0c7f, 0xace0, 0x0010, 0x7054, 0xac02, 0x00c8, + 0x8a83, 0x0078, 0x8a64, 0x127f, 0x007f, 0x037f, 0x0c7f, 0x0e7f, + 0x007c, 0x0e7e, 0x0c7e, 0x017e, 0xa188, 0xa434, 0x210c, 0x81ff, + 0x0040, 0x8aa1, 0x2061, 0xaa00, 0x2071, 0xa300, 0x017e, 0x1078, + 0x74d7, 0x017f, 0x0040, 0x8aa4, 0x611a, 0x1078, 0x2813, 0x1078, + 0x753d, 0xa006, 0x0078, 0x8aa6, 0xa085, 0x0001, 0x017f, 0x0c7f, + 0x0e7f, 0x007c, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, + 0x1078, 0x74d7, 0x057f, 0x0040, 0x8ac3, 0x6612, 0x651a, 0x601f, + 0x0003, 0x2009, 0x004b, 0x1078, 0x756c, 0xa085, 0x0001, 0x127f, + 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x8abf, 0x0c7e, 0x057e, + 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x74d7, 0x057f, + 0x0040, 0x8af1, 0x6013, 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, + 0x2560, 0x1078, 0x471b, 0x0c7f, 0x1078, 0x5d53, 0x077e, 0x2039, + 0x0000, 0x1078, 0x5c78, 0x2c08, 0x1078, 0x9c38, 0x077f, 0x2009, + 0x004c, 0x1078, 0x756c, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, + 0x007c, 0xa006, 0x0078, 0x8aed, 0x0f7e, 0x0c7e, 0x047e, 0x0c7e, + 0x1078, 0x74d7, 0x2c78, 0x0c7f, 0x0040, 0x8b0e, 0x7e12, 0x2c00, + 0x781a, 0x781f, 0x0003, 0x2021, 0x0005, 0x1078, 0x8b4e, 0x2f60, + 0x2009, 0x004d, 0x1078, 0x756c, 0xa085, 0x0001, 0x047f, 0x0c7f, + 0x0f7f, 0x007c, 0x0f7e, 0x0c7e, 0x047e, 0x0c7e, 0x1078, 0x74d7, + 0x2c78, 0x0c7f, 0x0040, 0x8b2c, 0x7e12, 0x2c00, 0x781a, 0x781f, + 0x0003, 0x2021, 0x0005, 0x1078, 0x8b4e, 0x2f60, 0x2009, 0x004e, + 0x1078, 0x756c, 0xa085, 0x0001, 0x047f, 0x0c7f, 0x0f7f, 0x007c, + 0x0f7e, 0x0c7e, 0x047e, 0x0c7e, 0x1078, 0x74d7, 0x2c78, 0x0c7f, + 0x0040, 0x8b4a, 0x7e12, 0x2c00, 0x781a, 0x781f, 0x0003, 0x2021, + 0x0004, 0x1078, 0x8b4e, 0x2f60, 0x2009, 0x0052, 0x1078, 0x756c, + 0xa085, 0x0001, 0x047f, 0x0c7f, 0x0f7f, 0x007c, 0x097e, 0x077e, + 0x127e, 0x2091, 0x8000, 0x1078, 0x46a7, 0x0040, 0x8b5b, 0x2001, + 0x8b53, 0x0078, 0x8b61, 0x1078, 0x466d, 0x0040, 0x8b6a, 0x2001, + 0x8b5b, 0x007e, 0xa00e, 0x2400, 0x1078, 0x4a60, 0x1078, 0x4982, + 0x007f, 0x007a, 0x2418, 0x1078, 0x5fa7, 0x62a0, 0x087e, 0x2041, + 0x0001, 0x2039, 0x0001, 0x2608, 0x1078, 0x5d6d, 0x087f, 0x1078, + 0x5c78, 0x2f08, 0x2648, 0x1078, 0x9c38, 0x613c, 0x81ff, 0x1040, + 0x5e21, 0x127f, 0x077f, 0x097f, 0x007c, 0x0c7e, 0x127e, 0x2091, + 0x8000, 0x0c7e, 0x1078, 0x74d7, 0x017f, 0x0040, 0x8b9e, 0x660a, + 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, + 0x756c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, + 0x8b9b, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x74d7, + 0x017f, 0x0040, 0x8bba, 0x660a, 0x611a, 0x601f, 0x0008, 0x2d00, + 0x6012, 0x2009, 0x0021, 0x1078, 0x756c, 0xa085, 0x0001, 0x127f, + 0x0c7f, 0x007c, 0xa006, 0x0078, 0x8bb7, 0x0c7e, 0x127e, 0x2091, + 0x8000, 0x0c7e, 0x1078, 0x74d7, 0x017f, 0x0040, 0x8bd6, 0x660a, + 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x003d, 0x1078, + 0x756c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, + 0x8bd3, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x74d7, + 0x017f, 0x0040, 0x8bf1, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, + 0x2009, 0x0000, 0x1078, 0x756c, 0xa085, 0x0001, 0x127f, 0x0c7f, + 0x007c, 0xa006, 0x0078, 0x8bee, 0x027e, 0x0d7e, 0x6218, 0x2268, + 0x6a3c, 0x82ff, 0x0040, 0x8bfe, 0x8211, 0x6a3e, 0x0d7f, 0x027f, + 0x007c, 0x007e, 0x6000, 0xa086, 0x0000, 0x0040, 0x8c13, 0x6013, + 0x0000, 0x601f, 0x0007, 0x2001, 0xa5a1, 0x2004, 0x6016, 0x1078, + 0xa134, 0x603f, 0x0000, 0x007f, 0x007c, 0x067e, 0x0c7e, 0x0d7e, + 0x2031, 0xa352, 0x2634, 0xd6e4, 0x0040, 0x8c23, 0x6618, 0x2660, + 0x6e48, 0x1078, 0x461b, 0x0d7f, 0x0c7f, 0x067f, 0x007c, 0x007e, + 0x017e, 0x6004, 0xa08e, 0x0002, 0x0040, 0x8c38, 0xa08e, 0x0003, + 0x0040, 0x8c38, 0xa08e, 0x0004, 0x0040, 0x8c38, 0xa085, 0x0001, + 0x017f, 0x007f, 0x007c, 0x007e, 0x0d7e, 0x6010, 0xa06d, 0x0040, + 0x8c48, 0x6838, 0xd0fc, 0x0040, 0x8c48, 0xa006, 0x0078, 0x8c4a, + 0xa085, 0x0001, 0x0d7f, 0x007f, 0x007c, 0x0c7e, 0x127e, 0x2091, + 0x8000, 0x0c7e, 0x1078, 0x74d7, 0x017f, 0x0040, 0x8c67, 0x611a, + 0x601f, 0x0001, 0x2d00, 0x6012, 0x1078, 0x2813, 0x2009, 0x0028, + 0x1078, 0x756c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, + 0x0078, 0x8c64, 0xa186, 0x0015, 0x00c0, 0x8c7f, 0x2011, 0xa31f, + 0x2204, 0xa086, 0x0074, 0x00c0, 0x8c7f, 0x1078, 0x7d0d, 0x6003, + 0x0001, 0x6007, 0x0029, 0x1078, 0x5c45, 0x0078, 0x8c83, 0x1078, + 0x7a05, 0x1078, 0x753d, 0x007c, 0xa186, 0x0016, 0x00c0, 0x8c8e, + 0x2001, 0x0004, 0x1078, 0x443f, 0x0078, 0x8caf, 0xa186, 0x0015, + 0x00c0, 0x8cb3, 0x2011, 0xa31f, 0x2204, 0xa086, 0x0014, 0x00c0, + 0x8cb3, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x457d, 0x0d7f, 0x1078, + 0x7dba, 0x00c0, 0x8cb3, 0x0d7e, 0x6018, 0x2068, 0x6890, 0x0d7f, + 0xa005, 0x0040, 0x8cb3, 0x2001, 0x0006, 0x1078, 0x443f, 0x1078, + 0x7608, 0x0078, 0x8cb7, 0x1078, 0x7a05, 0x1078, 0x753d, 0x007c, + 0x6848, 0xa086, 0x0005, 0x00c0, 0x8cbf, 0x1078, 0x8cc0, 0x007c, + 0x6850, 0xc0ad, 0x6852, 0x007c, 0x0e7e, 0x2071, 0xa88c, 0x7014, + 0xd0e4, 0x0040, 0x8cd5, 0x6013, 0x0000, 0x6003, 0x0001, 0x6007, + 0x0050, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0e7f, 0x007c, 0x0c7e, + 0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0f7f, 0x0040, 0x8ce4, 0x601c, + 0xa084, 0x000f, 0x1079, 0x8ce6, 0x0c7f, 0x007c, 0x8827, 0x8cf1, + 0x8cf4, 0x8cf7, 0x9f00, 0x9f1c, 0x9f1f, 0x8827, 0x8827, 0x1078, + 0x1328, 0x0005, 0x0005, 0x007c, 0x0005, 0x0005, 0x007c, 0x1078, + 0x8cfa, 0x007c, 0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0040, 0x8d29, + 0x1078, 0x74d7, 0x00c0, 0x8d0a, 0x2001, 0xa5a2, 0x2004, 0x783e, + 0x0078, 0x8d29, 0x7818, 0x601a, 0x781c, 0xa086, 0x0003, 0x0040, + 0x8d17, 0x7808, 0x6036, 0x2f00, 0x603a, 0x0078, 0x8d1b, 0x7808, + 0x603a, 0x2f00, 0x6036, 0x602a, 0x601f, 0x0001, 0x6007, 0x0035, + 0x6003, 0x0001, 0x7920, 0x6122, 0x1078, 0x5bf8, 0x1078, 0x6109, + 0x2f60, 0x0f7f, 0x007c, 0x017e, 0x0f7e, 0x682c, 0x6032, 0xa08e, + 0x0001, 0x0040, 0x8d3c, 0xa086, 0x0005, 0x0040, 0x8d40, 0xa006, + 0x602a, 0x602e, 0x0078, 0x8d51, 0x6824, 0xc0f4, 0xc0d5, 0x6826, + 0x6810, 0x2078, 0x787c, 0x6938, 0xa102, 0x7880, 0x6934, 0xa103, + 0x00c8, 0x8d37, 0x6834, 0x602a, 0x6838, 0xa084, 0xfffc, 0x683a, + 0x602e, 0x2d00, 0x6036, 0x6808, 0x603a, 0x6918, 0x611a, 0x6920, + 0x6122, 0x601f, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001, 0x1078, + 0x5bf8, 0x6803, 0x0002, 0x0f7f, 0x017f, 0x007c, 0x007e, 0x017e, + 0x6004, 0xa08e, 0x0034, 0x0040, 0x8d8b, 0xa08e, 0x0035, 0x0040, + 0x8d8b, 0xa08e, 0x0036, 0x0040, 0x8d8b, 0xa08e, 0x0037, 0x0040, + 0x8d8b, 0xa08e, 0x0038, 0x0040, 0x8d8b, 0xa08e, 0x0039, 0x0040, + 0x8d8b, 0xa08e, 0x003a, 0x0040, 0x8d8b, 0xa08e, 0x003b, 0x0040, + 0x8d8b, 0xa085, 0x0001, 0x017f, 0x007f, 0x007c, 0x0f7e, 0x2c78, + 0x1078, 0x4893, 0x00c0, 0x8d98, 0xa085, 0x0001, 0x0078, 0x8da7, + 0x6024, 0xd0f4, 0x00c0, 0x8da6, 0xc0f5, 0x6026, 0x6010, 0x2078, + 0x7828, 0x603a, 0x782c, 0x6036, 0x1078, 0x1749, 0xa006, 0x0f7f, + 0x007c, 0x007e, 0x017e, 0x027e, 0x037e, 0x0e7e, 0x2001, 0xa59c, + 0x200c, 0x8000, 0x2014, 0x2001, 0x0032, 0x1078, 0x5a98, 0x2001, + 0xa5a0, 0x82ff, 0x00c0, 0x8dbe, 0x2011, 0x0002, 0x2202, 0x2001, + 0xa59e, 0x200c, 0x8000, 0x2014, 0x2071, 0xa58c, 0x711a, 0x721e, + 0x2001, 0x0064, 0x1078, 0x5a98, 0x2001, 0xa5a1, 0x82ff, 0x00c0, + 0x8dd3, 0x2011, 0x0002, 0x2202, 0x2009, 0xa5a2, 0xa280, 0x000a, + 0x200a, 0x0e7f, 0x037f, 0x027f, 0x017f, 0x007f, 0x007c, 0x007e, + 0x0e7e, 0x2001, 0xa5a0, 0x2003, 0x0028, 0x2001, 0xa5a1, 0x2003, + 0x0014, 0x2071, 0xa58c, 0x701b, 0x0000, 0x701f, 0x07d0, 0x2001, + 0xa5a2, 0x2003, 0x001e, 0x0e7f, 0x007f, 0x007c, 0x0c7e, 0x127e, + 0x2091, 0x8000, 0x0c7e, 0x1078, 0x74d7, 0x017f, 0x0040, 0x8e0e, + 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0033, 0x1078, + 0x756c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, + 0x8e0b, 0x0d7e, 0x0e7e, 0x0f7e, 0x2071, 0xa300, 0xa186, 0x0015, + 0x00c0, 0x8e40, 0x707c, 0xa086, 0x0018, 0x00c0, 0x8e40, 0x6010, + 0x2068, 0x6a3c, 0xd2e4, 0x00c0, 0x8e34, 0x2c78, 0x1078, 0x62c6, + 0x0040, 0x8e48, 0x7068, 0x6a50, 0xa206, 0x00c0, 0x8e3c, 0x706c, + 0x6a54, 0xa206, 0x00c0, 0x8e3c, 0x6218, 0xa290, 0x0028, 0x2214, + 0x2009, 0x0000, 0x1078, 0x285b, 0x1078, 0x7608, 0x0078, 0x8e44, + 0x1078, 0x7a05, 0x1078, 0x753d, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c, + 0x704c, 0xa080, 0x293f, 0x2004, 0x6a54, 0xa206, 0x0040, 0x8e34, + 0x0078, 0x8e3c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, + 0x74d7, 0x017f, 0x0040, 0x8e6a, 0x611a, 0x601f, 0x0001, 0x2d00, + 0x6012, 0x2009, 0x0043, 0x1078, 0x756c, 0xa085, 0x0001, 0x127f, + 0x0c7f, 0x007c, 0xa006, 0x0078, 0x8e67, 0x0d7e, 0x0e7e, 0x0f7e, + 0x2071, 0xa300, 0xa186, 0x0015, 0x00c0, 0x8e93, 0x707c, 0xa086, + 0x0004, 0x00c0, 0x8e93, 0x6010, 0xa0e8, 0x000f, 0x2c78, 0x1078, + 0x62c6, 0x0040, 0x8e9b, 0x7068, 0x6a08, 0xa206, 0x00c0, 0x8e8f, + 0x706c, 0x6a0c, 0xa206, 0x00c0, 0x8e8f, 0x1078, 0x2813, 0x1078, + 0x7608, 0x0078, 0x8e97, 0x1078, 0x7a05, 0x1078, 0x753d, 0x0f7f, + 0x0e7f, 0x0d7f, 0x007c, 0x704c, 0xa080, 0x293f, 0x2004, 0x6a0c, + 0xa206, 0x0040, 0x8e8d, 0x0078, 0x8e8f, 0x017e, 0x027e, 0x684c, + 0xd0ac, 0x0040, 0x8ebd, 0x6914, 0x6a10, 0x2100, 0xa205, 0x0040, + 0x8ebd, 0x6860, 0xa106, 0x00c0, 0x8eb9, 0x685c, 0xa206, 0x0040, + 0x8ebd, 0x6962, 0x6a5e, 0xa085, 0x0001, 0x027f, 0x017f, 0x007c, + 0x0e7e, 0x127e, 0x2071, 0xa300, 0x2091, 0x8000, 0x7544, 0xa582, + 0x0001, 0x0048, 0x8ef2, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, + 0x0040, 0x8ede, 0xace0, 0x0010, 0x7054, 0xac02, 0x00c8, 0x8eda, + 0x0078, 0x8ecd, 0x2061, 0xaa00, 0x0078, 0x8ecd, 0x6003, 0x0008, + 0x8529, 0x7546, 0xaca8, 0x0010, 0x7054, 0xa502, 0x00c8, 0x8eee, + 0x754a, 0xa085, 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0xaa00, + 0x0078, 0x8ee9, 0xa006, 0x0078, 0x8eeb, 0x0c7e, 0x027e, 0x017e, + 0xa186, 0x0035, 0x0040, 0x8eff, 0x6a34, 0x0078, 0x8f00, 0x6a28, + 0x1078, 0x8a30, 0x0040, 0x8f29, 0x2260, 0x611c, 0xa186, 0x0003, + 0x0040, 0x8f0e, 0xa186, 0x0006, 0x00c0, 0x8f25, 0x6834, 0xa206, + 0x0040, 0x8f1d, 0x6838, 0xa206, 0x00c0, 0x8f25, 0x6108, 0x6834, + 0xa106, 0x00c0, 0x8f25, 0x0078, 0x8f22, 0x6008, 0x6938, 0xa106, + 0x00c0, 0x8f25, 0x6018, 0x6918, 0xa106, 0x017f, 0x027f, 0x0c7f, + 0x007c, 0xa085, 0x0001, 0x0078, 0x8f25, 0x067e, 0x6000, 0xa0b2, + 0x0010, 0x10c8, 0x1328, 0x1079, 0x8f37, 0x067f, 0x007c, 0x8f47, + 0x93bb, 0x94d3, 0x8f47, 0x8f47, 0x8f47, 0x8f47, 0x8f47, 0x8f81, + 0x955e, 0x8f47, 0x8f47, 0x8f47, 0x8f47, 0x8f47, 0x8f47, 0x1078, + 0x1328, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1328, 0x1079, + 0x8f53, 0x067f, 0x007c, 0x8f63, 0x99f6, 0x8f63, 0x8f63, 0x8f63, + 0x8f63, 0x8f63, 0x8f63, 0x99b4, 0x9a44, 0x8f63, 0xa053, 0xa087, + 0xa053, 0xa087, 0x8f63, 0x1078, 0x1328, 0x067e, 0x6000, 0xa0b2, + 0x0010, 0x10c8, 0x1328, 0x1079, 0x8f6f, 0x067f, 0x007c, 0x8f7f, + 0x969f, 0x976a, 0x9798, 0x9813, 0x8f7f, 0x9919, 0x98c1, 0x956a, + 0x9988, 0x999e, 0x8f7f, 0x8f7f, 0x8f7f, 0x8f7f, 0x8f7f, 0x1078, + 0x1328, 0xa1b2, 0x0044, 0x10c8, 0x1328, 0x2100, 0x0079, 0x8f88, + 0x8fc8, 0x919a, 0x8fc8, 0x8fc8, 0x8fc8, 0x91a2, 0x8fc8, 0x8fc8, + 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, + 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fca, + 0x902d, 0x9038, 0x9081, 0x909c, 0x911b, 0x918b, 0x8fc8, 0x8fc8, + 0x91a6, 0x8fc8, 0x8fc8, 0x91b5, 0x91bc, 0x8fc8, 0x8fc8, 0x8fc8, + 0x8fc8, 0x8fc8, 0x91ea, 0x8fc8, 0x8fc8, 0x91f5, 0x8fc8, 0x8fc8, + 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x920a, 0x8fc8, 0x8fc8, 0x8fc8, + 0x9291, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x9305, + 0x1078, 0x1328, 0x1078, 0x4897, 0x00c0, 0x8fd7, 0x2001, 0xa332, + 0x2004, 0xa084, 0x0009, 0xa086, 0x0008, 0x00c0, 0x8fdf, 0x6007, + 0x0009, 0x602b, 0x0009, 0x6013, 0x0000, 0x0078, 0x9195, 0x1078, + 0x4887, 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270, + 0x72a0, 0x027e, 0x2019, 0x0029, 0x1078, 0x5d53, 0x077e, 0x2039, + 0x0000, 0x1078, 0x5c78, 0x2c08, 0x1078, 0x9c38, 0x077f, 0x017f, + 0x2e60, 0x1078, 0x471b, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, + 0x6618, 0x0c7e, 0x2660, 0x1078, 0x4513, 0x0c7f, 0xa6b0, 0x0001, + 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x901f, 0x1078, + 0x9b6c, 0x00c0, 0x907b, 0x1078, 0x9afd, 0x00c0, 0x901b, 0x6007, + 0x0008, 0x0078, 0x9195, 0x6007, 0x0009, 0x0078, 0x9195, 0x1078, + 0x9d45, 0x0040, 0x9029, 0x1078, 0x9b6c, 0x0040, 0x9013, 0x0078, + 0x907b, 0x6013, 0x1900, 0x0078, 0x901b, 0x6106, 0x1078, 0x9aa8, + 0x6007, 0x0006, 0x0078, 0x9195, 0x6007, 0x0007, 0x0078, 0x9195, + 0x1078, 0xa0bf, 0x00c0, 0x9340, 0x0d7e, 0x6618, 0x2668, 0x6e04, + 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x905d, 0xa686, + 0x0004, 0x0040, 0x905d, 0x6e04, 0xa6b4, 0x00ff, 0xa686, 0x0006, + 0x0040, 0x905d, 0xa686, 0x0004, 0x0040, 0x905d, 0xa686, 0x0005, + 0x0040, 0x905d, 0x0d7f, 0x0078, 0x907b, 0x1078, 0x9bd2, 0x00c0, + 0x9076, 0xa686, 0x0006, 0x00c0, 0x906f, 0x027e, 0x6218, 0xa290, + 0x0028, 0x2214, 0x2009, 0x0000, 0x1078, 0x285b, 0x027f, 0x1078, + 0x457d, 0x6007, 0x000a, 0x0d7f, 0x0078, 0x9195, 0x6007, 0x000b, + 0x0d7f, 0x0078, 0x9195, 0x1078, 0x2813, 0x6007, 0x0001, 0x0078, + 0x9195, 0x1078, 0xa0bf, 0x00c0, 0x9340, 0x6618, 0x0d7e, 0x2668, + 0x6e04, 0x0d7f, 0xa686, 0x0707, 0x0040, 0x907b, 0x027e, 0x6218, + 0xa290, 0x0028, 0x2214, 0x2009, 0x0000, 0x1078, 0x285b, 0x027f, + 0x6007, 0x000c, 0x0078, 0x9195, 0x1078, 0x4897, 0x00c0, 0x90a9, + 0x2001, 0xa332, 0x2004, 0xa084, 0x0009, 0xa086, 0x0008, 0x00c0, + 0x90b1, 0x6007, 0x0009, 0x602b, 0x0009, 0x6013, 0x0000, 0x0078, + 0x9195, 0x1078, 0x4887, 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, + 0x00ff, 0xa082, 0x0006, 0x0048, 0x90f5, 0xa6b4, 0xff00, 0x8637, + 0xa686, 0x0004, 0x0040, 0x90c8, 0xa686, 0x0006, 0x00c0, 0x907b, + 0x1078, 0x9be1, 0x00c0, 0x90d0, 0x6007, 0x000e, 0x0078, 0x9195, + 0x047e, 0x6418, 0xa4a0, 0x0028, 0x2424, 0xa4a4, 0x00ff, 0x8427, + 0x047e, 0x1078, 0x2813, 0x047f, 0x017e, 0xa006, 0x2009, 0xa352, + 0x210c, 0xd1a4, 0x0040, 0x90ef, 0x2009, 0x0029, 0x1078, 0x9ec0, + 0x6018, 0x0d7e, 0x2068, 0x6800, 0xc0e5, 0x6802, 0x0d7f, 0x017f, + 0x047f, 0x6007, 0x0001, 0x0078, 0x9195, 0x2001, 0x0001, 0x1078, + 0x442b, 0x157e, 0x017e, 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019, + 0xa305, 0x2011, 0xa890, 0x1078, 0x7e55, 0x037f, 0x027f, 0x017f, + 0x157f, 0xa005, 0x0040, 0x9115, 0xa6b4, 0xff00, 0x8637, 0xa686, + 0x0006, 0x0040, 0x90c8, 0x0078, 0x907b, 0x6013, 0x1900, 0x6007, + 0x0009, 0x0078, 0x9195, 0x1078, 0x4897, 0x00c0, 0x9128, 0x2001, + 0xa332, 0x2004, 0xa084, 0x0009, 0xa086, 0x0008, 0x00c0, 0x9130, + 0x6007, 0x0009, 0x602b, 0x0009, 0x6013, 0x0000, 0x0078, 0x9195, + 0x1078, 0x4887, 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, + 0xa082, 0x0006, 0x0048, 0x9178, 0xa6b4, 0xff00, 0x8637, 0xa686, + 0x0004, 0x0040, 0x9147, 0xa686, 0x0006, 0x00c0, 0x907b, 0x1078, + 0x9c0c, 0x00c0, 0x9153, 0x1078, 0x9afd, 0x00c0, 0x9153, 0x6007, + 0x0010, 0x0078, 0x9195, 0x047e, 0x6418, 0xa4a0, 0x0028, 0x2424, + 0xa4a4, 0x00ff, 0x8427, 0x047e, 0x1078, 0x2813, 0x047f, 0x017e, + 0xa006, 0x2009, 0xa352, 0x210c, 0xd1a4, 0x0040, 0x9172, 0x2009, + 0x0029, 0x1078, 0x9ec0, 0x6018, 0x0d7e, 0x2068, 0x6800, 0xc0e5, + 0x6802, 0x0d7f, 0x017f, 0x047f, 0x6007, 0x0001, 0x0078, 0x9195, + 0x1078, 0x9d45, 0x0040, 0x9185, 0xa6b4, 0xff00, 0x8637, 0xa686, + 0x0006, 0x0040, 0x9147, 0x0078, 0x907b, 0x6013, 0x1900, 0x6007, + 0x0009, 0x0078, 0x9195, 0x1078, 0xa0bf, 0x00c0, 0x9340, 0x1078, + 0x9343, 0x00c0, 0x907b, 0x6007, 0x0012, 0x6003, 0x0001, 0x1078, + 0x5c45, 0x007c, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x5c45, + 0x0078, 0x9199, 0x6007, 0x0005, 0x0078, 0x919c, 0x1078, 0xa0bf, + 0x00c0, 0x9340, 0x1078, 0x9343, 0x00c0, 0x907b, 0x6007, 0x0020, + 0x6003, 0x0001, 0x1078, 0x5c45, 0x007c, 0x6007, 0x0023, 0x6003, + 0x0001, 0x1078, 0x5c45, 0x007c, 0x1078, 0xa0bf, 0x00c0, 0x9340, + 0x1078, 0x9343, 0x00c0, 0x907b, 0x017e, 0x027e, 0x2011, 0xa890, + 0x2214, 0x2c08, 0x1078, 0x9e8c, 0x00c0, 0x91de, 0x2160, 0x6007, + 0x0026, 0x6013, 0x1700, 0x2011, 0xa889, 0x2214, 0xa296, 0xffff, + 0x00c0, 0x91e3, 0x6007, 0x0025, 0x0078, 0x91e3, 0x1078, 0x753d, + 0x2160, 0x6007, 0x0025, 0x6003, 0x0001, 0x1078, 0x5c45, 0x027f, + 0x017f, 0x007c, 0x6106, 0x1078, 0x9363, 0x6007, 0x002b, 0x0078, + 0x9195, 0x6007, 0x002c, 0x0078, 0x9195, 0x1078, 0xa0bf, 0x00c0, + 0x9340, 0x1078, 0x9343, 0x00c0, 0x907b, 0x6106, 0x1078, 0x9368, + 0x00c0, 0x9206, 0x6007, 0x002e, 0x0078, 0x9195, 0x6007, 0x002f, + 0x0078, 0x9195, 0x0e7e, 0x0d7e, 0x0c7e, 0x6018, 0xa080, 0x0001, + 0x200c, 0xa184, 0x00ff, 0xa086, 0x0006, 0x0040, 0x9223, 0xa184, + 0xff00, 0x8007, 0xa086, 0x0006, 0x0040, 0x9223, 0x0c7f, 0x0d7f, + 0x0e7f, 0x0078, 0x919a, 0x2001, 0xa371, 0x2004, 0xd0e4, 0x0040, + 0x928d, 0x2071, 0xa88c, 0x7010, 0x6036, 0x7014, 0x603a, 0x7108, + 0x720c, 0x2001, 0xa352, 0x2004, 0xd0a4, 0x0040, 0x9241, 0x6018, + 0x2068, 0x6810, 0xa106, 0x00c0, 0x9241, 0x6814, 0xa206, 0x0040, + 0x9265, 0x2001, 0xa352, 0x2004, 0xd0ac, 0x00c0, 0x9281, 0x2069, + 0xa300, 0x686c, 0xa206, 0x00c0, 0x9281, 0x6868, 0xa106, 0x00c0, + 0x9281, 0x7210, 0x1078, 0x8a30, 0x0040, 0x9287, 0x1078, 0x9f31, + 0x0040, 0x9287, 0x622a, 0x6007, 0x0036, 0x6003, 0x0001, 0x1078, + 0x5bf8, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x7214, 0xa286, 0xffff, + 0x0040, 0x9277, 0x1078, 0x8a30, 0x0040, 0x9287, 0xa280, 0x0002, + 0x2004, 0x7110, 0xa106, 0x00c0, 0x9287, 0x0078, 0x9252, 0x7210, + 0x2c08, 0x1078, 0x9e8c, 0x2c10, 0x2160, 0x0040, 0x9287, 0x0078, + 0x9252, 0x6007, 0x0037, 0x6013, 0x1500, 0x0078, 0x925d, 0x6007, + 0x0037, 0x6013, 0x1700, 0x0078, 0x925d, 0x6007, 0x0012, 0x0078, + 0x925d, 0x6018, 0xa080, 0x0001, 0x2004, 0xa084, 0xff00, 0x8007, + 0xa086, 0x0006, 0x00c0, 0x919a, 0x0e7e, 0x0d7e, 0x0c7e, 0x2001, + 0xa371, 0x2004, 0xd0e4, 0x0040, 0x92fd, 0x2069, 0xa300, 0x2071, + 0xa88c, 0x7008, 0x6036, 0x720c, 0x623a, 0xa286, 0xffff, 0x00c0, + 0x92ba, 0x7208, 0x0c7e, 0x2c08, 0x1078, 0x9e8c, 0x2c10, 0x0c7f, + 0x0040, 0x92f1, 0x1078, 0x8a30, 0x0040, 0x92f1, 0x0c7e, 0x027e, + 0x2260, 0x1078, 0x874a, 0x027f, 0x0c7f, 0x7118, 0xa18c, 0xff00, + 0x810f, 0xa186, 0x0001, 0x0040, 0x92db, 0xa186, 0x0005, 0x0040, + 0x92d5, 0xa186, 0x0007, 0x00c0, 0x92e5, 0xa280, 0x0004, 0x2004, + 0xa005, 0x0040, 0x92e5, 0x057e, 0x7510, 0x7614, 0x1078, 0x9f46, + 0x057f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x6007, 0x003b, 0x602b, + 0x0009, 0x6013, 0x2a00, 0x6003, 0x0001, 0x1078, 0x5bf8, 0x0078, + 0x92e1, 0x6007, 0x003b, 0x602b, 0x0009, 0x6013, 0x1700, 0x6003, + 0x0001, 0x1078, 0x5bf8, 0x0078, 0x92e1, 0x6007, 0x003b, 0x602b, + 0x000b, 0x6013, 0x0000, 0x0078, 0x925d, 0x0e7e, 0x027e, 0x1078, + 0x4897, 0x0040, 0x933a, 0x1078, 0x4887, 0x1078, 0xa148, 0x00c0, + 0x9338, 0x2071, 0xa300, 0x70c8, 0xc085, 0x70ca, 0x0f7e, 0x2079, + 0x0100, 0x7294, 0xa284, 0x00ff, 0x706a, 0x78e6, 0xa284, 0xff00, + 0x726c, 0xa205, 0x706e, 0x78ea, 0x0f7f, 0x70d3, 0x0000, 0x2001, + 0xa352, 0x2004, 0xd0a4, 0x0040, 0x9331, 0x2011, 0xa5c4, 0x2013, + 0x07d0, 0xd0ac, 0x00c0, 0x933a, 0x1078, 0x260d, 0x0078, 0x933a, + 0x1078, 0xa178, 0x027f, 0x0e7f, 0x1078, 0x753d, 0x0078, 0x9199, + 0x1078, 0x753d, 0x007c, 0x0d7e, 0x067e, 0x6618, 0x2668, 0x6e04, + 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x9360, 0xa686, + 0x0004, 0x0040, 0x9360, 0x6e04, 0xa6b4, 0x00ff, 0xa686, 0x0006, + 0x0040, 0x9360, 0xa686, 0x0004, 0x0040, 0x9360, 0xa085, 0x0001, + 0x067f, 0x0d7f, 0x007c, 0x0d7e, 0x1078, 0x9397, 0x0d7f, 0x007c, + 0x0d7e, 0x1078, 0x93a6, 0x00c0, 0x9390, 0x680c, 0xa08c, 0xff00, + 0x6820, 0xa084, 0x00ff, 0xa115, 0x6212, 0x6824, 0x602a, 0xd1e4, + 0x0040, 0x937e, 0x2009, 0x0001, 0x0078, 0x938c, 0xd1ec, 0x0040, + 0x9390, 0x6920, 0xa18c, 0x00ff, 0x6824, 0x1078, 0x24e3, 0x00c0, + 0x9390, 0x2110, 0x2009, 0x0000, 0x1078, 0x285b, 0x0078, 0x9394, + 0xa085, 0x0001, 0x0078, 0x9395, 0xa006, 0x0d7f, 0x007c, 0x2069, + 0xa88d, 0x6800, 0xa082, 0x0010, 0x00c8, 0x93a4, 0x6013, 0x0000, + 0xa085, 0x0001, 0x0078, 0x93a5, 0xa006, 0x007c, 0x6013, 0x0000, + 0x2069, 0xa88c, 0x6808, 0xa084, 0xff00, 0xa086, 0x0800, 0x00c0, + 0x93ba, 0x6800, 0xa084, 0x00ff, 0xa08e, 0x0014, 0x0040, 0x93ba, + 0xa08e, 0x0010, 0x007c, 0x6004, 0xa0b2, 0x0044, 0x10c8, 0x1328, + 0xa1b6, 0x0013, 0x00c0, 0x93c7, 0x2008, 0x0079, 0x93da, 0xa1b6, + 0x0027, 0x0040, 0x93cf, 0xa1b6, 0x0014, 0x10c0, 0x1328, 0x2001, + 0x0007, 0x1078, 0x4472, 0x1078, 0x6010, 0x1078, 0x8c01, 0x1078, + 0x6109, 0x007c, 0x941a, 0x941c, 0x941a, 0x941a, 0x941a, 0x941c, + 0x9424, 0x94ae, 0x9471, 0x94ae, 0x9485, 0x94ae, 0x9424, 0x94ae, + 0x94a6, 0x94ae, 0x94a6, 0x94ae, 0x94ae, 0x941a, 0x941a, 0x941a, + 0x941a, 0x941a, 0x941a, 0x941a, 0x941a, 0x941a, 0x941a, 0x941a, + 0x941c, 0x941a, 0x94ae, 0x941a, 0x941a, 0x94ae, 0x941a, 0x94ae, + 0x94ae, 0x941a, 0x941a, 0x941a, 0x941a, 0x94ae, 0x94ae, 0x941a, + 0x94ae, 0x94ae, 0x941a, 0x941a, 0x941a, 0x941a, 0x941a, 0x941c, + 0x94ae, 0x94ae, 0x941a, 0x941a, 0x94ae, 0x94ae, 0x941a, 0x941a, + 0x941a, 0x941a, 0x1078, 0x1328, 0x1078, 0x6010, 0x6003, 0x0002, + 0x1078, 0x6109, 0x0078, 0x94b4, 0x0f7e, 0x2079, 0xa351, 0x7804, + 0x0f7f, 0xd0ac, 0x00c0, 0x94ae, 0x2001, 0x0000, 0x1078, 0x442b, + 0x6018, 0xa080, 0x0004, 0x2004, 0xa086, 0x00ff, 0x0040, 0x94ae, + 0x0c7e, 0x6018, 0x2060, 0x6000, 0xd0f4, 0x00c0, 0x9448, 0x6010, + 0xa005, 0x0040, 0x9448, 0x0c7f, 0x1078, 0x35f7, 0x0078, 0x94ae, + 0x0c7f, 0x2001, 0xa300, 0x2004, 0xa086, 0x0002, 0x00c0, 0x9457, + 0x0f7e, 0x2079, 0xa300, 0x788c, 0x8000, 0x788e, 0x0f7f, 0x2001, + 0x0002, 0x1078, 0x443f, 0x1078, 0x6010, 0x601f, 0x0001, 0x6003, + 0x0001, 0x6007, 0x0002, 0x1078, 0x5c45, 0x1078, 0x6109, 0x0c7e, + 0x6118, 0x2160, 0x2009, 0x0001, 0x1078, 0x58e1, 0x0c7f, 0x0078, + 0x94b4, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4, 0xff00, + 0x8637, 0xa686, 0x0006, 0x0040, 0x94ae, 0xa686, 0x0004, 0x0040, + 0x94ae, 0x2001, 0x0004, 0x0078, 0x94ac, 0x2001, 0xa300, 0x2004, + 0xa086, 0x0003, 0x00c0, 0x948e, 0x1078, 0x35f7, 0x2001, 0x0006, + 0x1078, 0x94b5, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4, + 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x94ae, 0x2001, 0x0006, + 0x0078, 0x94ac, 0x2001, 0x0004, 0x0078, 0x94ac, 0x2001, 0x0006, + 0x1078, 0x94b5, 0x0078, 0x94ae, 0x1078, 0x4472, 0x1078, 0x6010, + 0x1078, 0x753d, 0x1078, 0x6109, 0x007c, 0x017e, 0x0d7e, 0x6118, + 0x2168, 0x6900, 0xd184, 0x0040, 0x94d0, 0x6104, 0xa18e, 0x000a, + 0x00c0, 0x94c8, 0x699c, 0xd1a4, 0x00c0, 0x94c8, 0x2001, 0x0007, + 0x1078, 0x443f, 0x2001, 0x0000, 0x1078, 0x442b, 0x1078, 0x2839, + 0x0d7f, 0x017f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084, + 0xff00, 0x8007, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x1328, 0xa1b6, + 0x0015, 0x00c0, 0x94e7, 0x1079, 0x94ee, 0x0078, 0x94ed, 0xa1b6, + 0x0016, 0x10c0, 0x1328, 0x1079, 0x94fa, 0x007c, 0x7ad0, 0x7ad0, + 0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0, 0x9547, 0x9506, 0x7ad0, 0x7ad0, + 0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0, + 0x9547, 0x954f, 0x7ad0, 0x7ad0, 0x7ad0, 0x7ad0, 0x0f7e, 0x2079, + 0xa351, 0x7804, 0xd0ac, 0x00c0, 0x952d, 0x6018, 0xa07d, 0x0040, + 0x952d, 0x7800, 0xd0f4, 0x00c0, 0x9519, 0x7810, 0xa005, 0x00c0, + 0x952d, 0x2001, 0x0000, 0x1078, 0x442b, 0x2001, 0x0002, 0x1078, + 0x443f, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, + 0x5c45, 0x1078, 0x6109, 0x0078, 0x9545, 0x2011, 0xa883, 0x2204, + 0x8211, 0x220c, 0x1078, 0x24e3, 0x00c0, 0x9545, 0x0c7e, 0x1078, + 0x4501, 0x0040, 0x9540, 0x0c7f, 0x1078, 0x753d, 0x0078, 0x9545, + 0x1078, 0x4235, 0x0c7f, 0x1078, 0x753d, 0x0f7f, 0x007c, 0x6604, + 0xa6b6, 0x001e, 0x00c0, 0x954e, 0x1078, 0x753d, 0x007c, 0x1078, + 0x7d0a, 0x00c0, 0x955b, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, + 0x5c45, 0x0078, 0x955d, 0x1078, 0x753d, 0x007c, 0x6004, 0xa08a, + 0x0044, 0x10c8, 0x1328, 0x1078, 0x6010, 0x1078, 0x8c01, 0x1078, + 0x6109, 0x007c, 0xa182, 0x0040, 0x0079, 0x956e, 0x9581, 0x9581, + 0x9581, 0x9581, 0x9583, 0x9581, 0x9581, 0x9581, 0x9581, 0x9581, + 0x9581, 0x9581, 0x9581, 0x9581, 0x9581, 0x9581, 0x9581, 0x9581, + 0x9581, 0x1078, 0x1328, 0x0d7e, 0x0e7e, 0x0f7e, 0x157e, 0x047e, + 0x027e, 0x6218, 0xa280, 0x002b, 0x2004, 0xa005, 0x0040, 0x9594, + 0x2021, 0x0000, 0x1078, 0xa111, 0x6106, 0x2071, 0xa880, 0x7444, + 0xa4a4, 0xff00, 0x0040, 0x95eb, 0xa486, 0x2000, 0x00c0, 0x95a6, + 0x2009, 0x0001, 0x2011, 0x0200, 0x1078, 0x5a6d, 0x1078, 0x1381, + 0x1040, 0x1328, 0x6003, 0x0007, 0x2d00, 0x6837, 0x010d, 0x6803, + 0x0000, 0x683b, 0x0000, 0x6c5a, 0x2c00, 0x685e, 0x6008, 0x68b2, + 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130, 0x694a, 0x017e, 0xa084, + 0xff00, 0x6846, 0x684f, 0x0000, 0x6857, 0x0036, 0x1078, 0x4982, + 0x017f, 0xa486, 0x2000, 0x00c0, 0x95d3, 0x2019, 0x0017, 0x1078, + 0x9e3b, 0x0078, 0x9645, 0xa486, 0x0400, 0x00c0, 0x95dd, 0x2019, + 0x0002, 0x1078, 0x9dec, 0x0078, 0x9645, 0xa486, 0x0200, 0x00c0, + 0x95e3, 0x1078, 0x9dd1, 0xa486, 0x1000, 0x00c0, 0x95e9, 0x1078, + 0x9e20, 0x0078, 0x9645, 0x2069, 0xa62d, 0x6a00, 0xd284, 0x0040, + 0x969b, 0xa284, 0x0300, 0x00c0, 0x9693, 0x6804, 0xa005, 0x0040, + 0x9683, 0x2d78, 0x6003, 0x0007, 0x1078, 0x1366, 0x0040, 0x964c, + 0x7800, 0xd08c, 0x00c0, 0x9607, 0x7804, 0x8001, 0x7806, 0x6013, + 0x0000, 0x6803, 0x0000, 0x6837, 0x0116, 0x683b, 0x0000, 0x6008, + 0x68b2, 0x2c00, 0x684a, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130, + 0x6986, 0x6846, 0x6853, 0x003d, 0x7244, 0xa294, 0x0003, 0xa286, + 0x0002, 0x00c0, 0x9627, 0x684f, 0x0040, 0x0078, 0x9631, 0xa286, + 0x0001, 0x00c0, 0x962f, 0x684f, 0x0080, 0x0078, 0x9631, 0x684f, + 0x0000, 0x20a9, 0x000a, 0x2001, 0xa890, 0xad90, 0x0015, 0x200c, + 0x810f, 0x2112, 0x8000, 0x8210, 0x00f0, 0x9637, 0x200c, 0x6982, + 0x8000, 0x200c, 0x697e, 0x1078, 0x4982, 0x027f, 0x047f, 0x157f, + 0x0f7f, 0x0e7f, 0x0d7f, 0x007c, 0x6013, 0x0100, 0x6003, 0x0001, + 0x6007, 0x0041, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0078, 0x9645, + 0x2069, 0xa892, 0x2d04, 0xa084, 0xff00, 0xa086, 0x1200, 0x00c0, + 0x9677, 0x2069, 0xa880, 0x686c, 0xa084, 0x00ff, 0x017e, 0x6110, + 0xa18c, 0x0700, 0xa10d, 0x6112, 0x017f, 0x6003, 0x0001, 0x6007, + 0x0043, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0078, 0x9645, 0x6013, + 0x0200, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x5bf8, 0x1078, + 0x6109, 0x0078, 0x9645, 0x6013, 0x0300, 0x0078, 0x9689, 0x6013, + 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x5bf8, 0x1078, + 0x6109, 0x0078, 0x9645, 0x6013, 0x0500, 0x0078, 0x9689, 0x6013, + 0x0600, 0x0078, 0x9658, 0x6013, 0x0200, 0x0078, 0x9658, 0xa186, + 0x0013, 0x00c0, 0x96b1, 0x6004, 0xa08a, 0x0040, 0x1048, 0x1328, + 0xa08a, 0x0053, 0x10c8, 0x1328, 0xa082, 0x0040, 0x2008, 0x0079, + 0x9725, 0xa186, 0x0051, 0x0040, 0x96be, 0xa186, 0x0047, 0x00c0, + 0x96d7, 0x6004, 0xa086, 0x0041, 0x0040, 0x96e5, 0x2001, 0x0109, + 0x2004, 0xd084, 0x0040, 0x96e5, 0x127e, 0x2091, 0x2200, 0x007e, + 0x017e, 0x027e, 0x1078, 0x5ad2, 0x027f, 0x017f, 0x007f, 0x127f, + 0x6000, 0xa086, 0x0002, 0x00c0, 0x96e5, 0x0078, 0x976a, 0xa186, + 0x0027, 0x0040, 0x96df, 0xa186, 0x0014, 0x10c0, 0x1328, 0x6004, + 0xa082, 0x0040, 0x2008, 0x0079, 0x96e8, 0x1078, 0x7583, 0x007c, + 0x96fb, 0x96fd, 0x96fd, 0x96fb, 0x96fb, 0x96fb, 0x96fb, 0x96fb, + 0x96fb, 0x96fb, 0x96fb, 0x96fb, 0x96fb, 0x96fb, 0x96fb, 0x96fb, + 0x96fb, 0x96fb, 0x96fb, 0x1078, 0x1328, 0x1078, 0x6010, 0x1078, + 0x6109, 0x037e, 0x0d7e, 0x6010, 0xa06d, 0x0040, 0x9722, 0xad84, + 0xf000, 0x0040, 0x9722, 0x6003, 0x0002, 0x6018, 0x2004, 0xd0bc, + 0x00c0, 0x9722, 0x2019, 0x0004, 0x1078, 0x9e70, 0x6013, 0x0000, + 0x6014, 0xa005, 0x00c0, 0x9720, 0x2001, 0xa5a1, 0x2004, 0x6016, + 0x6003, 0x0007, 0x0d7f, 0x037f, 0x007c, 0x9738, 0x9757, 0x9741, + 0x9764, 0x9738, 0x9738, 0x9738, 0x9738, 0x9738, 0x9738, 0x9738, + 0x9738, 0x9738, 0x9738, 0x9738, 0x9738, 0x9738, 0x9738, 0x9738, + 0x1078, 0x1328, 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, + 0x200a, 0x1078, 0x6010, 0x6010, 0xa080, 0x0013, 0x2004, 0xd0b4, + 0x0040, 0x9752, 0x6003, 0x0007, 0x2009, 0x0043, 0x1078, 0x756c, + 0x0078, 0x9754, 0x6003, 0x0002, 0x1078, 0x6109, 0x007c, 0x1078, + 0x6010, 0x1078, 0xa0c6, 0x00c0, 0x9761, 0x1078, 0x5a41, 0x1078, + 0x753d, 0x1078, 0x6109, 0x007c, 0x1078, 0x6010, 0x2009, 0x0041, + 0x0078, 0x98c1, 0xa182, 0x0040, 0x0079, 0x976e, 0x9781, 0x9783, + 0x9781, 0x9781, 0x9781, 0x9781, 0x9781, 0x9784, 0x9781, 0x9781, + 0x9781, 0x9781, 0x9781, 0x9781, 0x9781, 0x9781, 0x9781, 0x978f, + 0x9781, 0x1078, 0x1328, 0x007c, 0x6003, 0x0004, 0x6110, 0x20e1, + 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x15ec, 0x007c, 0x0d7e, + 0x1078, 0x5a41, 0x0d7f, 0x1078, 0xa134, 0x1078, 0x753d, 0x007c, + 0xa182, 0x0040, 0x0079, 0x979c, 0x97af, 0x97af, 0x97af, 0x97af, + 0x97af, 0x97af, 0x97af, 0x97b1, 0x97af, 0x97b4, 0x97df, 0x97af, + 0x97af, 0x97af, 0x97af, 0x97df, 0x97af, 0x97af, 0x97af, 0x1078, + 0x1328, 0x1078, 0x7583, 0x007c, 0x1078, 0x60b8, 0x1078, 0x61d3, + 0x6010, 0x0d7e, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x97ca, 0xa08c, + 0x0003, 0xa18e, 0x0002, 0x0040, 0x97d2, 0x2009, 0x0041, 0x0d7f, + 0x0078, 0x98c1, 0x6003, 0x0007, 0x6017, 0x0000, 0x1078, 0x5a41, + 0x0d7f, 0x007c, 0x1078, 0xa0c6, 0x0040, 0x97d8, 0x0d7f, 0x007c, + 0x1078, 0x5a41, 0x1078, 0x753d, 0x0d7f, 0x0078, 0x97d1, 0x037e, + 0x1078, 0x60b8, 0x1078, 0x61d3, 0x6010, 0x0d7e, 0x2068, 0x6018, + 0x2004, 0xd0bc, 0x0040, 0x97ff, 0x684c, 0xa084, 0x0003, 0xa086, + 0x0002, 0x0040, 0x97fb, 0x687c, 0x632c, 0xa31a, 0x632e, 0x6880, + 0x6328, 0xa31b, 0x632a, 0x6003, 0x0002, 0x0078, 0x9810, 0x2019, + 0x0004, 0x1078, 0x9e70, 0x6014, 0xa005, 0x00c0, 0x980c, 0x2001, + 0xa5a1, 0x2004, 0x8003, 0x6016, 0x6013, 0x0000, 0x6003, 0x0007, + 0x0d7f, 0x037f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x9821, 0x6004, + 0xa086, 0x0042, 0x10c0, 0x1328, 0x1078, 0x6010, 0x1078, 0x6109, + 0x007c, 0xa186, 0x0027, 0x0040, 0x9829, 0xa186, 0x0014, 0x00c0, + 0x9839, 0x6004, 0xa086, 0x0042, 0x10c0, 0x1328, 0x2001, 0x0007, + 0x1078, 0x4472, 0x1078, 0x6010, 0x1078, 0x8c01, 0x1078, 0x6109, + 0x007c, 0xa182, 0x0040, 0x0079, 0x983d, 0x9850, 0x9850, 0x9850, + 0x9850, 0x9850, 0x9850, 0x9850, 0x9852, 0x985e, 0x9850, 0x9850, + 0x9850, 0x9850, 0x9850, 0x9850, 0x9850, 0x9850, 0x9850, 0x9850, + 0x1078, 0x1328, 0x037e, 0x047e, 0x20e1, 0x0005, 0x3d18, 0x3e20, + 0x2c10, 0x1078, 0x15ec, 0x047f, 0x037f, 0x007c, 0x6010, 0x0d7e, + 0x2068, 0x6810, 0x6a14, 0x6118, 0x210c, 0xd1bc, 0x0040, 0x987d, + 0x6124, 0xd1f4, 0x00c0, 0x987d, 0x007e, 0x047e, 0x057e, 0x6c7c, + 0xa422, 0x6d80, 0x2200, 0xa52b, 0x602c, 0xa420, 0x642e, 0x6028, + 0xa529, 0x652a, 0x057f, 0x047f, 0x007f, 0xa20d, 0x00c0, 0x9891, + 0x684c, 0xd0fc, 0x0040, 0x9889, 0x2009, 0x0041, 0x0d7f, 0x0078, + 0x98c1, 0x6003, 0x0007, 0x6017, 0x0000, 0x1078, 0x5a41, 0x0d7f, + 0x007c, 0x007e, 0x0f7e, 0x2c78, 0x1078, 0x4893, 0x0f7f, 0x007f, + 0x0040, 0x989e, 0x6003, 0x0002, 0x0d7f, 0x007c, 0x2009, 0xa30d, + 0x210c, 0xd19c, 0x0040, 0x98a8, 0x6003, 0x0007, 0x0078, 0x98aa, + 0x6003, 0x0006, 0x1078, 0x98b0, 0x1078, 0x5a43, 0x0d7f, 0x007c, + 0xd2fc, 0x0040, 0x98bc, 0x8002, 0x8000, 0x8212, 0xa291, 0x0000, + 0x2009, 0x0009, 0x0078, 0x98be, 0x2009, 0x0015, 0x6a6a, 0x6866, + 0x007c, 0xa182, 0x0040, 0x0048, 0x98c7, 0x0079, 0x98d4, 0xa186, + 0x0013, 0x0040, 0x98cf, 0xa186, 0x0014, 0x10c0, 0x1328, 0x6024, + 0xd0dc, 0x1040, 0x1328, 0x007c, 0x98e7, 0x98ee, 0x98fa, 0x9906, + 0x98e7, 0x98e7, 0x98e7, 0x9915, 0x98e7, 0x98e9, 0x98e9, 0x98e7, + 0x98e7, 0x98e7, 0x98e7, 0x98e7, 0x98e7, 0x98e7, 0x98e7, 0x1078, + 0x1328, 0x6024, 0xd0dc, 0x1040, 0x1328, 0x007c, 0x6003, 0x0001, + 0x6106, 0x1078, 0x5bf8, 0x127e, 0x2091, 0x8000, 0x1078, 0x6109, + 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x5bf8, 0x127e, + 0x2091, 0x8000, 0x1078, 0x6109, 0x127f, 0x007c, 0x6003, 0x0003, + 0x6106, 0x2c10, 0x1078, 0x1cab, 0x127e, 0x2091, 0x8000, 0x1078, + 0x5c64, 0x1078, 0x61d3, 0x127f, 0x007c, 0xa016, 0x1078, 0x15ec, + 0x007c, 0x127e, 0x2091, 0x8000, 0x037e, 0x0d7e, 0xa182, 0x0040, + 0x1079, 0x9926, 0x0d7f, 0x037f, 0x127f, 0x007c, 0x9936, 0x9938, + 0x994d, 0x996c, 0x9936, 0x9936, 0x9936, 0x9984, 0x9936, 0x9936, + 0x9936, 0x9936, 0x9936, 0x9936, 0x9936, 0x9936, 0x1078, 0x1328, + 0x6010, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x9962, 0xa09c, 0x0003, + 0xa39e, 0x0003, 0x0040, 0x9962, 0x6003, 0x0001, 0x6106, 0x1078, + 0x5bf8, 0x1078, 0x6109, 0x0078, 0x9987, 0x6010, 0x2068, 0x684c, + 0xd0fc, 0x0040, 0x9962, 0xa09c, 0x0003, 0xa39e, 0x0003, 0x0040, + 0x9962, 0x6003, 0x0001, 0x6106, 0x1078, 0x5bf8, 0x1078, 0x6109, + 0x0078, 0x9987, 0x6013, 0x0000, 0x6017, 0x0000, 0x2019, 0x0004, + 0x1078, 0x9e70, 0x0078, 0x9987, 0x6010, 0x2068, 0x684c, 0xd0fc, + 0x0040, 0x9962, 0xa09c, 0x0003, 0xa39e, 0x0003, 0x0040, 0x9962, + 0x6003, 0x0003, 0x6106, 0x2c10, 0x1078, 0x1cab, 0x1078, 0x5c64, + 0x1078, 0x61d3, 0x0078, 0x9987, 0xa016, 0x1078, 0x15ec, 0x007c, + 0x1078, 0x6010, 0x6110, 0x81ff, 0x0040, 0x9999, 0x0d7e, 0x2168, + 0x1078, 0xa181, 0x037e, 0x2019, 0x0029, 0x1078, 0x9e70, 0x037f, + 0x0d7f, 0x1078, 0x8c01, 0x1078, 0x6109, 0x007c, 0x1078, 0x60b8, + 0x6110, 0x81ff, 0x0040, 0x99af, 0x0d7e, 0x2168, 0x1078, 0xa181, + 0x037e, 0x2019, 0x0029, 0x1078, 0x9e70, 0x037f, 0x0d7f, 0x1078, + 0x8c01, 0x1078, 0x61d3, 0x007c, 0xa182, 0x0085, 0x0079, 0x99b8, + 0x99c1, 0x99bf, 0x99bf, 0x99cd, 0x99bf, 0x99bf, 0x99bf, 0x1078, + 0x1328, 0x6003, 0x000b, 0x6106, 0x1078, 0x5bf8, 0x127e, 0x2091, + 0x8000, 0x1078, 0x6109, 0x127f, 0x007c, 0x027e, 0x0e7e, 0x1078, + 0xa0bf, 0x0040, 0x99d7, 0x1078, 0x753d, 0x0078, 0x99f3, 0x2071, + 0xa880, 0x7224, 0x6212, 0x7220, 0x1078, 0x9d10, 0x0040, 0x99e4, + 0x6007, 0x0086, 0x0078, 0x99ed, 0x6007, 0x0087, 0x7224, 0xa296, + 0xffff, 0x00c0, 0x99ed, 0x6007, 0x0086, 0x6003, 0x0001, 0x1078, + 0x5bf8, 0x1078, 0x6109, 0x0e7f, 0x027f, 0x007c, 0xa186, 0x0013, + 0x00c0, 0x9a07, 0x6004, 0xa08a, 0x0085, 0x1048, 0x1328, 0xa08a, + 0x008c, 0x10c8, 0x1328, 0xa082, 0x0085, 0x0079, 0x9a1e, 0xa186, + 0x0027, 0x0040, 0x9a13, 0xa186, 0x0014, 0x0040, 0x9a13, 0x1078, + 0x7583, 0x0078, 0x9a1d, 0x2001, 0x0007, 0x1078, 0x4472, 0x1078, + 0x6010, 0x1078, 0x8c01, 0x1078, 0x6109, 0x007c, 0x9a25, 0x9a27, + 0x9a27, 0x9a25, 0x9a25, 0x9a25, 0x9a25, 0x1078, 0x1328, 0x1078, + 0x6010, 0x1078, 0x8c01, 0x1078, 0x6109, 0x007c, 0xa182, 0x0085, + 0x1048, 0x1328, 0xa182, 0x008c, 0x10c8, 0x1328, 0xa182, 0x0085, + 0x0079, 0x9a3a, 0x9a41, 0x9a41, 0x9a41, 0x9a43, 0x9a41, 0x9a41, + 0x9a41, 0x1078, 0x1328, 0x007c, 0xa186, 0x0013, 0x0040, 0x9a54, + 0xa186, 0x0014, 0x0040, 0x9a54, 0xa186, 0x0027, 0x0040, 0x9a54, + 0x1078, 0x7583, 0x0078, 0x9a5a, 0x1078, 0x6010, 0x1078, 0x8c01, + 0x1078, 0x6109, 0x007c, 0x037e, 0x1078, 0xa134, 0x603f, 0x0000, + 0x2019, 0x000b, 0x1078, 0x9a6a, 0x601f, 0x0006, 0x6003, 0x0007, + 0x037f, 0x007c, 0x127e, 0x037e, 0x2091, 0x8000, 0x087e, 0x2c40, + 0x097e, 0x2049, 0x0000, 0x1078, 0x7058, 0x097f, 0x087f, 0x00c0, + 0x9aa5, 0x077e, 0x2c38, 0x1078, 0x7105, 0x077f, 0x00c0, 0x9aa5, + 0x6000, 0xa086, 0x0000, 0x0040, 0x9aa5, 0x601c, 0xa086, 0x0007, + 0x0040, 0x9aa5, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x9a96, + 0x1078, 0xa134, 0x601f, 0x0007, 0x1078, 0x1749, 0x6010, 0x2068, + 0x1078, 0x8a44, 0x0040, 0x9a9e, 0x1078, 0x9e70, 0x0d7f, 0x6013, + 0x0000, 0x1078, 0xa134, 0x601f, 0x0007, 0x037f, 0x127f, 0x007c, + 0x0f7e, 0x0c7e, 0x037e, 0x157e, 0x2079, 0xa880, 0x7938, 0x783c, + 0x1078, 0x24e3, 0x00c0, 0x9af6, 0x017e, 0x0c7e, 0x1078, 0x4501, + 0x00c0, 0x9af6, 0x2011, 0xa890, 0xac98, 0x000a, 0x20a9, 0x0004, + 0x1078, 0x7e55, 0x00c0, 0x9af6, 0x017f, 0x027f, 0x027e, 0x017e, + 0x2019, 0x0029, 0x1078, 0x71e0, 0x1078, 0x5d53, 0x077e, 0x2039, + 0x0000, 0x1078, 0x5c78, 0x077f, 0x017f, 0x077e, 0x2039, 0x0000, + 0x1078, 0x9c38, 0x077f, 0x1078, 0x471b, 0x027e, 0x6204, 0xa294, + 0xff00, 0x8217, 0xa286, 0x0006, 0x0040, 0x9aea, 0xa286, 0x0004, + 0x00c0, 0x9aed, 0x62a0, 0x1078, 0x28d5, 0x027f, 0x017f, 0x1078, + 0x4235, 0x6612, 0x6516, 0xa006, 0x0078, 0x9af8, 0x0c7f, 0x017f, + 0x157f, 0x037f, 0x0c7f, 0x0f7f, 0x007c, 0x0c7e, 0x0d7e, 0x0e7e, + 0x017e, 0x2009, 0xa31f, 0x2104, 0xa086, 0x0074, 0x00c0, 0x9b60, + 0x2069, 0xa88e, 0x690c, 0xa182, 0x0100, 0x0048, 0x9b50, 0x6908, + 0xa184, 0x8000, 0x0040, 0x9b5c, 0x6018, 0x2070, 0x7010, 0xa084, + 0x00ff, 0x0040, 0x9b1f, 0x7000, 0xd0f4, 0x0040, 0x9b23, 0xa184, + 0x0800, 0x0040, 0x9b5c, 0x6910, 0xa18a, 0x0001, 0x0048, 0x9b54, + 0x6914, 0x2069, 0xa8ae, 0x6904, 0x81ff, 0x00c0, 0x9b48, 0x690c, + 0xa182, 0x0100, 0x0048, 0x9b50, 0x6908, 0x81ff, 0x00c0, 0x9b4c, + 0x6910, 0xa18a, 0x0001, 0x0048, 0x9b54, 0x6918, 0xa18a, 0x0001, + 0x0048, 0x9b5c, 0x0078, 0x9b66, 0x6013, 0x0100, 0x0078, 0x9b62, + 0x6013, 0x0300, 0x0078, 0x9b62, 0x6013, 0x0500, 0x0078, 0x9b62, + 0x6013, 0x0700, 0x0078, 0x9b62, 0x6013, 0x0900, 0x0078, 0x9b62, + 0x6013, 0x0b00, 0x0078, 0x9b62, 0x6013, 0x0f00, 0x0078, 0x9b62, + 0x6013, 0x2d00, 0xa085, 0x0001, 0x0078, 0x9b67, 0xa006, 0x017f, + 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x027e, 0x037e, + 0x157e, 0x6218, 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286, 0x0006, + 0x0040, 0x9b90, 0xa286, 0x0004, 0x0040, 0x9b90, 0xa394, 0xff00, + 0x8217, 0xa286, 0x0006, 0x0040, 0x9b90, 0xa286, 0x0004, 0x0040, + 0x9b90, 0x0c7e, 0x2d60, 0x1078, 0x4513, 0x0c7f, 0x0078, 0x9bcb, + 0x2011, 0xa896, 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x7e55, + 0x00c0, 0x9bcc, 0x2011, 0xa89a, 0xad98, 0x0006, 0x20a9, 0x0004, + 0x1078, 0x7e55, 0x00c0, 0x9bcc, 0x047e, 0x017e, 0x6aa0, 0xa294, + 0x00ff, 0x8227, 0xa006, 0x2009, 0xa352, 0x210c, 0xd1a4, 0x0040, + 0x9bb8, 0x2009, 0x0029, 0x1078, 0x9ec0, 0x6800, 0xc0e5, 0x6802, + 0x2019, 0x0029, 0x1078, 0x5d53, 0x077e, 0x2039, 0x0000, 0x1078, + 0x5c78, 0x2c08, 0x1078, 0x9c38, 0x077f, 0x2001, 0x0007, 0x1078, + 0x4472, 0x017f, 0x047f, 0xa006, 0x157f, 0x037f, 0x027f, 0x0d7f, + 0x0c7f, 0x007c, 0x0d7e, 0x2069, 0xa88e, 0x6800, 0xa086, 0x0800, + 0x0040, 0x9bde, 0x6013, 0x0000, 0x0078, 0x9bdf, 0xa006, 0x0d7f, + 0x007c, 0x0c7e, 0x0f7e, 0x017e, 0x027e, 0x037e, 0x157e, 0x2079, + 0xa88c, 0x7930, 0x7834, 0x1078, 0x24e3, 0x00c0, 0x9c05, 0x1078, + 0x4501, 0x00c0, 0x9c05, 0x2011, 0xa890, 0xac98, 0x000a, 0x20a9, + 0x0004, 0x1078, 0x7e55, 0x00c0, 0x9c05, 0x2011, 0xa894, 0xac98, + 0x0006, 0x20a9, 0x0004, 0x1078, 0x7e55, 0x157f, 0x037f, 0x027f, + 0x017f, 0x0f7f, 0x0c7f, 0x007c, 0x0c7e, 0x007e, 0x017e, 0x027e, + 0x037e, 0x157e, 0x2011, 0xa883, 0x2204, 0x8211, 0x220c, 0x1078, + 0x24e3, 0x00c0, 0x9c31, 0x1078, 0x4501, 0x00c0, 0x9c31, 0x2011, + 0xa896, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x7e55, 0x00c0, + 0x9c31, 0x2011, 0xa89a, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, + 0x7e55, 0x157f, 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f, 0x007c, + 0x0e7e, 0x0c7e, 0x087e, 0x077e, 0x067e, 0x057e, 0x047e, 0x027e, + 0x127e, 0x2091, 0x8000, 0x2740, 0x2029, 0xa5b4, 0x252c, 0x2021, + 0xa5ba, 0x2424, 0x2061, 0xaa00, 0x2071, 0xa300, 0x7644, 0x7060, + 0x81ff, 0x0040, 0x9c59, 0x8001, 0xa602, 0x00c8, 0x9cc3, 0x0078, + 0x9c5c, 0xa606, 0x0040, 0x9cc3, 0x2100, 0xac06, 0x0040, 0x9cb9, + 0x1078, 0x9ee5, 0x0040, 0x9cb9, 0x671c, 0xa786, 0x0001, 0x0040, + 0x9cde, 0xa786, 0x0004, 0x0040, 0x9cde, 0xa786, 0x0007, 0x0040, + 0x9cb9, 0x2500, 0xac06, 0x0040, 0x9cb9, 0x2400, 0xac06, 0x0040, + 0x9cb9, 0x1078, 0x9ef9, 0x00c0, 0x9cb9, 0x88ff, 0x0040, 0x9c84, + 0x6020, 0xa906, 0x00c0, 0x9cb9, 0x0d7e, 0x6000, 0xa086, 0x0004, + 0x00c0, 0x9c8e, 0x017e, 0x1078, 0x1749, 0x017f, 0xa786, 0x0008, + 0x00c0, 0x9c9d, 0x1078, 0x8c3b, 0x00c0, 0x9c9d, 0x1078, 0x7a05, + 0x0d7f, 0x1078, 0x8c01, 0x0078, 0x9cb9, 0x6010, 0x2068, 0x1078, + 0x8a44, 0x0040, 0x9cb6, 0xa786, 0x0003, 0x00c0, 0x9ccd, 0x6837, + 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0xa181, 0x017e, 0x1078, + 0x8cb8, 0x1078, 0x4982, 0x017f, 0x1078, 0x8bf4, 0x0d7f, 0x1078, + 0x8c01, 0xace0, 0x0010, 0x2001, 0xa315, 0x2004, 0xac02, 0x00c8, + 0x9cc3, 0x0078, 0x9c4c, 0x127f, 0x027f, 0x047f, 0x057f, 0x067f, + 0x077f, 0x087f, 0x0c7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, + 0x9ca7, 0xa386, 0x0005, 0x0040, 0x9cdb, 0x1078, 0xa181, 0x1078, + 0x9e70, 0x0078, 0x9cb6, 0x0d7f, 0x0078, 0x9cb9, 0x1078, 0x9ef9, + 0x00c0, 0x9cb9, 0x81ff, 0x0040, 0x9cb9, 0xa180, 0x0001, 0x2004, + 0xa086, 0x0018, 0x0040, 0x9cf3, 0xa180, 0x0001, 0x2004, 0xa086, + 0x002d, 0x00c0, 0x9cb9, 0x6000, 0xa086, 0x0002, 0x00c0, 0x9cb9, + 0x1078, 0x8c27, 0x0040, 0x9d04, 0x1078, 0x8c3b, 0x00c0, 0x9cb9, + 0x1078, 0x7a05, 0x0078, 0x9d0c, 0x1078, 0x2839, 0x1078, 0x8c3b, + 0x00c0, 0x9d0c, 0x1078, 0x7a05, 0x1078, 0x8c01, 0x0078, 0x9cb9, + 0x0c7e, 0x0e7e, 0x017e, 0x2c08, 0x2170, 0x1078, 0x9e8c, 0x017f, + 0x0040, 0x9d1f, 0x601c, 0xa084, 0x000f, 0x1079, 0x9d22, 0x0e7f, + 0x0c7f, 0x007c, 0x9d2a, 0x9d2a, 0x9d2a, 0x9d2a, 0x9d2a, 0x9d2a, + 0x9d2c, 0x9d2a, 0xa006, 0x007c, 0x047e, 0x017e, 0x7018, 0xa080, + 0x0028, 0x2024, 0xa4a4, 0x00ff, 0x8427, 0x2c00, 0x2009, 0x0020, + 0x1078, 0x9ec0, 0x017f, 0x047f, 0x037e, 0x2019, 0x0002, 0x1078, + 0x9a6a, 0x037f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0001, 0x1078, + 0x442b, 0x157e, 0x017e, 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019, + 0xa305, 0x2011, 0xa896, 0x1078, 0x7e55, 0x037f, 0x027f, 0x017f, + 0x157f, 0xa005, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x087e, 0x077e, + 0x067e, 0x027e, 0x127e, 0x2091, 0x8000, 0x2740, 0x2061, 0xaa00, + 0x2079, 0x0001, 0x8fff, 0x0040, 0x9dc3, 0x2071, 0xa300, 0x7644, + 0x7060, 0x8001, 0xa602, 0x00c8, 0x9dc3, 0x88ff, 0x0040, 0x9d7e, + 0x2800, 0xac06, 0x00c0, 0x9db9, 0x2079, 0x0000, 0x1078, 0x9ee5, + 0x0040, 0x9db9, 0x2400, 0xac06, 0x0040, 0x9db9, 0x671c, 0xa786, + 0x0006, 0x00c0, 0x9db9, 0xa786, 0x0007, 0x0040, 0x9db9, 0x88ff, + 0x00c0, 0x9d9d, 0x6018, 0xa206, 0x00c0, 0x9db9, 0x85ff, 0x0040, + 0x9d9d, 0x6020, 0xa106, 0x00c0, 0x9db9, 0x0d7e, 0x6000, 0xa086, + 0x0004, 0x00c0, 0x9da9, 0x1078, 0xa134, 0x601f, 0x0007, 0x1078, + 0x1749, 0x6010, 0x2068, 0x1078, 0x8a44, 0x0040, 0x9db3, 0x047e, + 0x1078, 0x9e70, 0x047f, 0x0d7f, 0x1078, 0x8c01, 0x88ff, 0x00c0, + 0x9dcd, 0xace0, 0x0010, 0x2001, 0xa315, 0x2004, 0xac02, 0x00c8, + 0x9dc3, 0x0078, 0x9d6a, 0xa006, 0x127f, 0x027f, 0x067f, 0x077f, + 0x087f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5, 0x0001, 0x0078, + 0x9dc4, 0x077e, 0x057e, 0x087e, 0x2041, 0x0000, 0x2029, 0x0001, + 0x2c20, 0x2019, 0x0002, 0x6218, 0x097e, 0x2049, 0x0000, 0x1078, + 0x7058, 0x097f, 0x087f, 0x2039, 0x0000, 0x1078, 0x7105, 0x1078, + 0x9d5b, 0x057f, 0x077f, 0x007c, 0x027e, 0x047e, 0x057e, 0x077e, + 0x0c7e, 0x157e, 0x2c20, 0x2128, 0x20a9, 0x007f, 0x2009, 0x0000, + 0x017e, 0x037e, 0x1078, 0x4501, 0x00c0, 0x9e14, 0x2c10, 0x057e, + 0x087e, 0x2041, 0x0000, 0x2508, 0x2029, 0x0001, 0x097e, 0x2049, + 0x0000, 0x1078, 0x7058, 0x097f, 0x087f, 0x2039, 0x0000, 0x1078, + 0x7105, 0x1078, 0x9d5b, 0x057f, 0x037f, 0x017f, 0x8108, 0x00f0, + 0x9df8, 0x157f, 0x0c7f, 0x077f, 0x057f, 0x047f, 0x027f, 0x007c, + 0x077e, 0x057e, 0x6218, 0x087e, 0x2041, 0x0000, 0x2029, 0x0001, + 0x2019, 0x0048, 0x097e, 0x2049, 0x0000, 0x1078, 0x7058, 0x097f, + 0x087f, 0x2039, 0x0000, 0x1078, 0x7105, 0x2c20, 0x1078, 0x9d5b, + 0x057f, 0x077f, 0x007c, 0x027e, 0x047e, 0x057e, 0x077e, 0x0c7e, + 0x157e, 0x2c20, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x037e, + 0x1078, 0x4501, 0x00c0, 0x9e64, 0x2c10, 0x087e, 0x2041, 0x0000, + 0x2828, 0x047e, 0x2021, 0x0001, 0x1078, 0xa111, 0x047f, 0x097e, + 0x2049, 0x0000, 0x1078, 0x7058, 0x097f, 0x087f, 0x2039, 0x0000, + 0x1078, 0x7105, 0x1078, 0x9d5b, 0x037f, 0x017f, 0x8108, 0x00f0, + 0x9e46, 0x157f, 0x0c7f, 0x077f, 0x057f, 0x047f, 0x027f, 0x007c, + 0x017e, 0x0f7e, 0xad82, 0xca00, 0x0048, 0x9e89, 0xad82, 0xffff, + 0x00c8, 0x9e89, 0x6800, 0xa07d, 0x0040, 0x9e86, 0x6803, 0x0000, + 0x6b52, 0x1078, 0x4982, 0x2f68, 0x0078, 0x9e7a, 0x6b52, 0x1078, + 0x4982, 0x0f7f, 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e, 0x2061, + 0xaa00, 0x2071, 0xa300, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, + 0x9ebb, 0x2100, 0xac06, 0x0040, 0x9ead, 0x6000, 0xa086, 0x0000, + 0x0040, 0x9ead, 0x6008, 0xa206, 0x00c0, 0x9ead, 0x6018, 0xa1a0, + 0x0006, 0x2424, 0xa406, 0x0040, 0x9eb7, 0xace0, 0x0010, 0x2001, + 0xa315, 0x2004, 0xac02, 0x00c8, 0x9ebb, 0x0078, 0x9e91, 0xa085, + 0x0001, 0x0078, 0x9ebc, 0xa006, 0x037f, 0x047f, 0x0e7f, 0x007c, + 0x0d7e, 0x007e, 0x1078, 0x1381, 0x007f, 0x1040, 0x1328, 0x6837, + 0x010d, 0x685e, 0x027e, 0x2010, 0x1078, 0x8a30, 0x2001, 0x0000, + 0x0040, 0x9ed6, 0x2200, 0xa080, 0x0008, 0x2004, 0x027f, 0x684a, + 0x6956, 0x6c46, 0x684f, 0x0000, 0xa006, 0x68b2, 0x6802, 0x683a, + 0x685a, 0x1078, 0x4982, 0x0d7f, 0x007c, 0x6700, 0xa786, 0x0000, + 0x0040, 0x9ef8, 0xa786, 0x0001, 0x0040, 0x9ef8, 0xa786, 0x000a, + 0x0040, 0x9ef8, 0xa786, 0x0009, 0x0040, 0x9ef8, 0xa085, 0x0001, + 0x007c, 0x0e7e, 0x6018, 0x2070, 0x70a0, 0xa206, 0x0e7f, 0x007c, + 0x017e, 0x6004, 0xa08e, 0x001e, 0x00c0, 0x9f1a, 0x8007, 0x6130, + 0xa18c, 0x00ff, 0xa105, 0x6032, 0x6007, 0x0085, 0x6003, 0x000b, + 0x601f, 0x0005, 0x2001, 0xa5a1, 0x2004, 0x6016, 0x1078, 0x5bf8, + 0x1078, 0x6109, 0x017f, 0x007c, 0x0005, 0x0005, 0x007c, 0x6024, + 0xd0e4, 0x0040, 0x9f30, 0xd0cc, 0x0040, 0x9f2a, 0x1078, 0x8cfa, + 0x0078, 0x9f30, 0x1078, 0xa134, 0x1078, 0x5a41, 0x1078, 0x753d, + 0x007c, 0xa280, 0x0007, 0x2004, 0xa084, 0x000f, 0x0079, 0x9f38, + 0x9f41, 0x9f41, 0x9f41, 0x9f43, 0x9f41, 0x9f43, 0x9f43, 0x9f41, + 0x9f43, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0xa280, 0x0007, + 0x2004, 0xa084, 0x000f, 0x0079, 0x9f4d, 0x9f56, 0x9f56, 0x9f56, + 0x9f56, 0x9f56, 0x9f56, 0x9f61, 0x9f56, 0x9f56, 0x6007, 0x003b, + 0x602b, 0x0009, 0x6013, 0x2a00, 0x6003, 0x0001, 0x1078, 0x5bf8, + 0x007c, 0x0c7e, 0x2260, 0x1078, 0xa134, 0x603f, 0x0000, 0x6024, + 0xc0f4, 0xc0cc, 0x6026, 0x0c7f, 0x0d7e, 0x2268, 0xa186, 0x0007, + 0x00c0, 0x9fc2, 0x6810, 0xa005, 0x0040, 0x9f7f, 0xa080, 0x0013, + 0x2004, 0xd0fc, 0x00c0, 0x9f7f, 0x0d7f, 0x0078, 0x9f56, 0x6007, + 0x003a, 0x6003, 0x0001, 0x1078, 0x5bf8, 0x1078, 0x6109, 0x0c7e, + 0x2d60, 0x6100, 0xa186, 0x0002, 0x00c0, 0xa050, 0x6010, 0xa005, + 0x00c0, 0x9f99, 0x6000, 0xa086, 0x0007, 0x10c0, 0x1328, 0x0078, + 0xa050, 0xa08c, 0xf000, 0x00c0, 0x9fa5, 0x0078, 0x9fa5, 0x2068, + 0x6800, 0xa005, 0x00c0, 0x9f9f, 0x2d00, 0xa080, 0x0013, 0x2004, + 0xa084, 0x0003, 0xa086, 0x0002, 0x00c0, 0x9fbe, 0x6010, 0x2068, + 0x684c, 0xc0dc, 0xc0f4, 0x684e, 0x6850, 0xc0f4, 0xc0fc, 0x6852, + 0x2009, 0x0043, 0x1078, 0x98c1, 0x0078, 0xa050, 0x2009, 0x0041, + 0x0078, 0xa04a, 0xa186, 0x0005, 0x00c0, 0xa009, 0x6810, 0xa080, + 0x0013, 0x2004, 0xd0bc, 0x00c0, 0x9fd0, 0x0d7f, 0x0078, 0x9f56, + 0xd0b4, 0x0040, 0x9fd8, 0xd0fc, 0x1040, 0x1328, 0x0078, 0x9f72, + 0x6007, 0x003a, 0x6003, 0x0001, 0x1078, 0x5bf8, 0x1078, 0x6109, + 0x0c7e, 0x2d60, 0x6100, 0xa186, 0x0002, 0x0040, 0x9feb, 0xa186, + 0x0004, 0x00c0, 0xa050, 0x2071, 0xa5e1, 0x7000, 0xa086, 0x0003, + 0x00c0, 0x9ff8, 0x7004, 0xac06, 0x00c0, 0x9ff8, 0x7003, 0x0000, + 0x6810, 0xa080, 0x0013, 0x200c, 0xc1f4, 0xc1dc, 0x2102, 0x8000, + 0x200c, 0xc1f4, 0xc1fc, 0xc1bc, 0x2102, 0x2009, 0x0042, 0x0078, + 0xa04a, 0x037e, 0x0d7e, 0x0d7e, 0x1078, 0x1381, 0x037f, 0x1040, + 0x1328, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x685b, + 0x0000, 0x6b5e, 0x6857, 0x0045, 0x2c00, 0x6862, 0x6034, 0x6872, + 0x2360, 0x6024, 0xc0dd, 0x6026, 0x6018, 0xa080, 0x0028, 0x2004, + 0xa084, 0x00ff, 0x8007, 0x6320, 0x6b4a, 0x6846, 0x684f, 0x0000, + 0x6d6a, 0x6e66, 0x686f, 0x0001, 0x1078, 0x4982, 0x2019, 0x0045, + 0x6008, 0x2068, 0x1078, 0x9a6a, 0x2d00, 0x600a, 0x601f, 0x0006, + 0x6003, 0x0007, 0x6017, 0x0000, 0x603f, 0x0000, 0x0d7f, 0x037f, + 0x0078, 0xa051, 0x603f, 0x0000, 0x6003, 0x0007, 0x1078, 0x98c1, + 0x0c7f, 0x0d7f, 0x007c, 0xa186, 0x0013, 0x00c0, 0xa05d, 0x6004, + 0xa082, 0x0085, 0x2008, 0x0079, 0xa077, 0xa186, 0x0027, 0x00c0, + 0xa070, 0x1078, 0x6010, 0x037e, 0x0d7e, 0x6010, 0x2068, 0x2019, + 0x0004, 0x1078, 0x9e70, 0x0d7f, 0x037f, 0x1078, 0x6109, 0x007c, + 0xa186, 0x0014, 0x0040, 0xa061, 0x1078, 0x7583, 0x007c, 0xa080, + 0xa07e, 0xa07e, 0xa07e, 0xa07e, 0xa07e, 0xa080, 0x1078, 0x1328, + 0x1078, 0x6010, 0x6003, 0x000c, 0x1078, 0x6109, 0x007c, 0xa182, + 0x008c, 0x00c8, 0xa091, 0xa182, 0x0085, 0x0048, 0xa091, 0x0079, + 0xa094, 0x1078, 0x7583, 0x007c, 0xa09b, 0xa09b, 0xa09b, 0xa09b, + 0xa09d, 0xa0bc, 0xa09b, 0x1078, 0x1328, 0x0d7e, 0x2c68, 0x1078, + 0x74d7, 0x0040, 0xa0b7, 0x6003, 0x0001, 0x6007, 0x001e, 0x2009, + 0xa88e, 0x210c, 0x6136, 0x2009, 0xa88f, 0x210c, 0x613a, 0x600b, + 0xffff, 0x6918, 0x611a, 0x601f, 0x0004, 0x1078, 0x5bf8, 0x2d60, + 0x1078, 0x753d, 0x0d7f, 0x007c, 0x1078, 0x753d, 0x007c, 0x0e7e, + 0x6018, 0x2070, 0x7000, 0xd0ec, 0x0e7f, 0x007c, 0x6010, 0xa080, + 0x0013, 0x200c, 0xd1ec, 0x0040, 0xa110, 0x2001, 0xa371, 0x2004, + 0xd0ec, 0x0040, 0xa110, 0x6003, 0x0002, 0x6024, 0xc0e5, 0x6026, + 0xd1ac, 0x0040, 0xa0ee, 0x0f7e, 0x2c78, 0x1078, 0x488f, 0x0f7f, + 0x0040, 0xa0ee, 0x2001, 0xa5a2, 0x2004, 0x603e, 0x2009, 0xa371, + 0x210c, 0xd1f4, 0x00c0, 0xa10e, 0x0078, 0xa100, 0x2009, 0xa371, + 0x210c, 0xd1f4, 0x0040, 0xa0fa, 0x6024, 0xc0e4, 0x6026, 0xa006, + 0x0078, 0xa110, 0x2001, 0xa5a2, 0x200c, 0x8103, 0xa100, 0x603e, + 0x6018, 0xa088, 0x002b, 0x2104, 0xa005, 0x0040, 0xa10b, 0xa088, + 0x0003, 0x0078, 0xa103, 0x2c0a, 0x600f, 0x0000, 0xa085, 0x0001, + 0x007c, 0x017e, 0x0c7e, 0x0e7e, 0x6120, 0xa2f0, 0x002b, 0x2e04, + 0x2060, 0x8cff, 0x0040, 0xa130, 0x84ff, 0x00c0, 0xa123, 0x6020, + 0xa106, 0x00c0, 0xa12b, 0x600c, 0x2072, 0x1078, 0x5a41, 0x1078, + 0x753d, 0x0078, 0xa12d, 0xacf0, 0x0003, 0x2e64, 0x0078, 0xa119, + 0x0e7f, 0x0c7f, 0x017f, 0x007c, 0x0d7e, 0x6018, 0xa0e8, 0x002b, + 0x2d04, 0xa005, 0x0040, 0xa146, 0xac06, 0x0040, 0xa144, 0x2d04, + 0xa0e8, 0x0003, 0x0078, 0xa138, 0x600c, 0x206a, 0x0d7f, 0x007c, + 0x027e, 0x037e, 0x157e, 0x2011, 0xa325, 0x2204, 0xa084, 0x00ff, + 0x2019, 0xa88e, 0x2334, 0xa636, 0x00c0, 0xa174, 0x8318, 0x2334, + 0x2204, 0xa084, 0xff00, 0xa636, 0x00c0, 0xa174, 0x2011, 0xa890, + 0x6018, 0xa098, 0x000a, 0x20a9, 0x0004, 0x1078, 0x7e55, 0x00c0, + 0xa174, 0x2011, 0xa894, 0x6018, 0xa098, 0x0006, 0x20a9, 0x0004, + 0x1078, 0x7e55, 0x00c0, 0xa174, 0x157f, 0x037f, 0x027f, 0x007c, + 0x0e7e, 0x2071, 0xa300, 0x1078, 0x41f5, 0x1078, 0x260d, 0x0e7f, + 0x007c, 0x0e7e, 0x6018, 0x2070, 0x7000, 0xd0fc, 0x0040, 0xa18a, + 0x1078, 0xa18c, 0x0e7f, 0x007c, 0x6850, 0xc0e5, 0x6852, 0x007c, + 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x057e, 0x047e, 0x027e, 0x017e, + 0x127e, 0x2091, 0x8000, 0x2029, 0xa5b4, 0x252c, 0x2021, 0xa5ba, + 0x2424, 0x2061, 0xaa00, 0x2071, 0xa300, 0x7644, 0x7060, 0xa606, + 0x0040, 0xa1e4, 0x671c, 0xa786, 0x0001, 0x0040, 0xa1b3, 0xa786, + 0x0008, 0x00c0, 0xa1da, 0x2500, 0xac06, 0x0040, 0xa1da, 0x2400, + 0xac06, 0x0040, 0xa1da, 0x1078, 0x9ee5, 0x0040, 0xa1da, 0x1078, + 0x9ef9, 0x00c0, 0xa1da, 0x6000, 0xa086, 0x0004, 0x00c0, 0xa1cc, + 0x017e, 0x1078, 0x1749, 0x017f, 0x1078, 0x8c27, 0x00c0, 0xa1d2, + 0x1078, 0x2839, 0x1078, 0x8c3b, 0x00c0, 0xa1d8, 0x1078, 0x7a05, + 0x1078, 0x8c01, 0xace0, 0x0010, 0x2001, 0xa315, 0x2004, 0xac02, + 0x00c8, 0xa1e4, 0x0078, 0xa1a3, 0x127f, 0x017f, 0x027f, 0x047f, + 0x057f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0x127e, 0x007e, + 0x0e7e, 0x2091, 0x8000, 0x2071, 0xa340, 0xd5a4, 0x0040, 0xa1fb, + 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040, 0xa201, 0x7030, 0x8000, + 0x7032, 0xd5ac, 0x0040, 0xa208, 0x2071, 0xa34a, 0x1078, 0xa237, + 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, + 0x8000, 0x2071, 0xa340, 0xd5a4, 0x0040, 0xa219, 0x7034, 0x8000, + 0x7036, 0xd5b4, 0x0040, 0xa21f, 0x7030, 0x8000, 0x7032, 0xd5ac, + 0x0040, 0xa226, 0x2071, 0xa34a, 0x1078, 0xa237, 0x0e7f, 0x007f, + 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, + 0xa342, 0x1078, 0xa237, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x2e04, + 0x8000, 0x2072, 0x00c8, 0xa240, 0x8e70, 0x2e04, 0x8000, 0x2072, + 0x007c, 0x0e7e, 0x2071, 0xa340, 0x1078, 0xa237, 0x0e7f, 0x007c, + 0x0e7e, 0x2071, 0xa344, 0x1078, 0xa237, 0x0e7f, 0x007c, 0x0001, + 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, + 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x6286 +}; +#ifdef UNIQUE_FW_NAME +unsigned short fw2100tp_length01 = 0x9260; +#else +unsigned short risc_code_length01 = 0x9260; +#endif + diff -urN linux-2.4.18/drivers/scsi/ql2200_fw.h lia64-2.4/drivers/scsi/ql2200_fw.h --- linux-2.4.18/drivers/scsi/ql2200_fw.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/scsi/ql2200_fw.h Mon Jul 23 14:12:06 2001 @@ -0,0 +1,5179 @@ +/************************************************************************ + * * + * --- ISP2200 Initiator/Target Firmware --- * + * with Fabric (Public Loop), Point-point, and * + * expanded LUN addressing for FCTAPE * + * * + ************************************************************************ + Copyright (C) 2000,2001 Qlogic Corporation + (www.qlogic.com) + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + ************************************************************************/ +/* + * Firmware Version 2.01.34 (18:00 Jun 05, 2001) + */ + +#ifdef UNIQUE_FW_NAME +unsigned short fw2200tp_version = 2*1024+1; +#else +unsigned short risc_code_version = 2*1024+1; +#endif + +#ifdef UNIQUE_FW_NAME +unsigned char fw2200tp_version_str[] = {2,1,34}; +#else +unsigned char firmware_version[] = {2,1,34}; +#endif + +#ifdef UNIQUE_FW_NAME +#define fw2200tp_VERSION_STRING "2.01.34" +#else +#define FW_VERSION_STRING "2.01.34" +#endif + +#ifdef UNIQUE_FW_NAME +unsigned short fw2200tp_addr01 = 0x1000 ; +#else +unsigned short risc_code_addr01 = 0x1000 ; +#endif + +#ifdef UNIQUE_FW_NAME +unsigned short fw2200tp_code01[] = { +#else +unsigned short risc_code01[] = { +#endif + 0x0470, 0x0000, 0x0000, 0xa019, 0x0000, 0x0002, 0x0001, 0x0022, + 0x0017, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030, + 0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241, + 0x5449, 0x4f4e, 0x2049, 0x5350, 0x3232, 0x3030, 0x2046, 0x6972, + 0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030, + 0x322e, 0x3031, 0x2e33, 0x3420, 0x2020, 0x2020, 0x2400, 0x20c1, + 0x0005, 0x2001, 0x017f, 0x2003, 0x0000, 0x20c9, 0xb5ff, 0x2091, + 0x2000, 0x2059, 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x2843, + 0x2051, 0xb100, 0x2a70, 0x2029, 0xe800, 0x2031, 0xffff, 0x2039, + 0xe7e9, 0x2021, 0x0200, 0x0804, 0x144d, 0x20a1, 0xb019, 0xa00e, + 0x20a9, 0x07e7, 0x41a4, 0x3400, 0x755e, 0x7662, 0x775a, 0x7466, + 0x746a, 0x20a1, 0xb800, 0x7160, 0x810d, 0x810d, 0x810d, 0x810d, + 0xa18c, 0x000f, 0x2001, 0x000b, 0xa112, 0xa00e, 0x21a8, 0x41a4, + 0x3400, 0x8211, 0x1dd8, 0x7160, 0x3400, 0xa102, 0x0120, 0x0218, + 0x20a8, 0xa00e, 0x41a4, 0x3800, 0xd08c, 0x01d8, 0x2009, 0xb100, + 0x810d, 0x810d, 0x810d, 0x810d, 0xa18c, 0x000f, 0x2001, 0x0001, + 0xa112, 0x20a1, 0x1000, 0xa00e, 0x21a8, 0x41a4, 0x8211, 0x1de0, + 0x2009, 0xb100, 0x3400, 0xa102, 0x0120, 0x0218, 0x20a8, 0xa00e, + 0x41a4, 0x080c, 0x1400, 0x080c, 0x1617, 0x080c, 0x17b0, 0x080c, + 0x1ebd, 0x080c, 0x4a74, 0x080c, 0x828d, 0x080c, 0x15a0, 0x080c, + 0x2d8c, 0x080c, 0x5b8b, 0x080c, 0x51aa, 0x080c, 0x668a, 0x080c, + 0x23ea, 0x080c, 0x68d4, 0x080c, 0x6194, 0x080c, 0x22de, 0x080c, + 0x23b8, 0x2091, 0x3009, 0x7823, 0x0000, 0x1004, 0x10c5, 0x7820, + 0xa086, 0x0002, 0x1150, 0x7823, 0x4000, 0x0e04, 0x10bd, 0x781b, + 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, 0x7003, 0x0000, + 0x2a70, 0x7000, 0xa08e, 0x0003, 0x1158, 0x080c, 0x3d97, 0x080c, + 0x2db3, 0x080c, 0x5bd9, 0x080c, 0x5359, 0x080c, 0x66b4, 0x0c80, + 0x000b, 0x0c98, 0x10e4, 0x10e5, 0x1207, 0x10e2, 0x12d0, 0x13fd, + 0x13fe, 0x13ff, 0x080c, 0x14fa, 0x0005, 0x0126, 0x00f6, 0x2091, + 0x8000, 0x7000, 0xa086, 0x0001, 0x1904, 0x11d5, 0x080c, 0x156d, + 0x080c, 0x58d5, 0x0150, 0x080c, 0x58fb, 0x15a0, 0x2079, 0x0100, + 0x7828, 0xa085, 0x1800, 0x782a, 0x0468, 0x080c, 0x5816, 0x7000, + 0xa086, 0x0001, 0x1904, 0x11d5, 0x7088, 0xa086, 0x0028, 0x1904, + 0x11d5, 0x2001, 0x0161, 0x2003, 0x0001, 0x2079, 0x0100, 0x7827, + 0xffff, 0x7a28, 0xa295, 0x1e2f, 0x7a2a, 0x2011, 0x57ea, 0x080c, + 0x6742, 0x2011, 0x57f7, 0x080c, 0x6742, 0x2011, 0x494f, 0x080c, + 0x6742, 0x2011, 0x8030, 0x2019, 0x0000, 0x7087, 0x0000, 0x080c, + 0x1d33, 0x00e8, 0x080c, 0x4305, 0x2079, 0x0100, 0x7844, 0xa005, + 0x1904, 0x11d5, 0x2011, 0x494f, 0x080c, 0x6742, 0x2011, 0x57f7, + 0x080c, 0x6742, 0x080c, 0x1d33, 0x2001, 0xb38d, 0x2004, 0x780e, + 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011, 0x8010, 0x73c8, 0x080c, + 0x3d5b, 0x7238, 0xc284, 0x723a, 0x2001, 0xb10c, 0x200c, 0xc1ac, + 0x2102, 0x080c, 0x7c1d, 0x2011, 0x0004, 0x080c, 0x9870, 0x080c, + 0x50bf, 0x080c, 0x58d5, 0x0158, 0x080c, 0x4a5d, 0x0140, 0x7087, + 0x0001, 0x70c3, 0x0000, 0x080c, 0x44a2, 0x0804, 0x11d5, 0x080c, + 0x517b, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x0050, 0x080c, 0x9c16, + 0x70d0, 0xd09c, 0x1128, 0x709c, 0xa005, 0x0110, 0x080c, 0x4a3b, + 0x70db, 0x0000, 0x70d7, 0x0000, 0x72d0, 0x080c, 0x58d5, 0x1178, + 0x2011, 0x0000, 0x0016, 0x080c, 0x27c4, 0x2019, 0xb38f, 0x211a, + 0x001e, 0x704f, 0xffff, 0x7053, 0x00ef, 0x7073, 0x0000, 0x2079, + 0xb152, 0x7804, 0xd0ac, 0x0108, 0xc295, 0x72d2, 0x080c, 0x58d5, + 0x0118, 0xa296, 0x0004, 0x0508, 0x2011, 0x0001, 0x080c, 0x9870, + 0x7097, 0x0000, 0x709b, 0xffff, 0x7003, 0x0002, 0x00fe, 0x080c, + 0x2991, 0x2011, 0x0005, 0x080c, 0x7d52, 0x080c, 0x6e9e, 0x080c, + 0x58d5, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x27c4, + 0x61e2, 0x001e, 0x00ce, 0x012e, 0x00d0, 0x7097, 0x0000, 0x709b, + 0xffff, 0x7003, 0x0002, 0x2011, 0x0005, 0x080c, 0x7d52, 0x080c, + 0x6e9e, 0x080c, 0x58d5, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, + 0x080c, 0x27c4, 0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005, + 0x00c6, 0x080c, 0x58d5, 0x1118, 0x20a9, 0x0100, 0x0010, 0x20a9, + 0x0082, 0x080c, 0x58d5, 0x1118, 0x2009, 0x0000, 0x0010, 0x2009, + 0x007e, 0x0016, 0x0026, 0x0036, 0x2110, 0x0026, 0x2019, 0x0029, + 0x080c, 0x7f67, 0x002e, 0x080c, 0xaf53, 0x003e, 0x002e, 0x001e, + 0x080c, 0x2c6e, 0x8108, 0x1f04, 0x11e9, 0x00ce, 0x706f, 0x0000, + 0x7070, 0xa084, 0x00ff, 0x7072, 0x709f, 0x0000, 0x0005, 0x0126, + 0x2091, 0x8000, 0x7000, 0xa086, 0x0002, 0x1904, 0x12ce, 0x7098, + 0xa086, 0xffff, 0x0130, 0x080c, 0x2991, 0x080c, 0x6e9e, 0x0804, + 0x12ce, 0x70d0, 0xd0ac, 0x1110, 0xd09c, 0x0540, 0xd084, 0x0530, + 0x0006, 0x0016, 0x2001, 0x0103, 0x2009, 0xb38d, 0x210c, 0x2102, + 0x001e, 0x000e, 0xd08c, 0x01d0, 0x70d4, 0xa086, 0xffff, 0x0190, + 0x080c, 0x2af0, 0x080c, 0x6e9e, 0x70d0, 0xd094, 0x1904, 0x12ce, + 0x2011, 0x0001, 0x2019, 0x0000, 0x080c, 0x2b26, 0x080c, 0x6e9e, + 0x0804, 0x12ce, 0x70d8, 0xa005, 0x1904, 0x12ce, 0x7094, 0xa005, + 0x1904, 0x12ce, 0x70d0, 0xd0a4, 0x0118, 0xd0b4, 0x0904, 0x12ce, + 0x080c, 0x517b, 0x1904, 0x12ce, 0x2001, 0xb153, 0x2004, 0xd0ac, + 0x01c8, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x2009, 0x0000, 0x0016, + 0x080c, 0x4e21, 0x1118, 0x6000, 0xd0ec, 0x1138, 0x001e, 0x8108, + 0x1f04, 0x125f, 0x00ce, 0x015e, 0x0028, 0x001e, 0x00ce, 0x015e, + 0x0804, 0x12ce, 0x0006, 0x0016, 0x2001, 0x0103, 0x2009, 0xb38d, + 0x210c, 0x2102, 0x001e, 0x000e, 0xa006, 0x2009, 0x0700, 0x20a9, + 0x0002, 0x20a1, 0xb3c7, 0x40a1, 0x706c, 0x8007, 0x7170, 0x810f, + 0x20a9, 0x0002, 0x40a1, 0x2009, 0x0000, 0x080c, 0x14e0, 0x2001, + 0x0000, 0x810f, 0x20a9, 0x0002, 0x40a1, 0xa006, 0x2009, 0x0200, + 0x20a9, 0x0002, 0x20a1, 0xb3d7, 0x40a1, 0x7030, 0xc08c, 0x7032, + 0x7003, 0x0003, 0x709b, 0xffff, 0x080c, 0x1566, 0xa006, 0x080c, + 0x269e, 0x080c, 0x3dcd, 0x00f6, 0x2079, 0x0100, 0x080c, 0x58fb, + 0x0150, 0x080c, 0x58d5, 0x7828, 0x0118, 0xa084, 0xe1ff, 0x0010, + 0xa084, 0xffdf, 0x782a, 0x00fe, 0x2001, 0xb3da, 0x2004, 0xa086, + 0x0005, 0x1120, 0x2011, 0x0000, 0x080c, 0x7d52, 0x2011, 0x0000, + 0x080c, 0x7d5c, 0x080c, 0x6e9e, 0x080c, 0x6f5b, 0x012e, 0x0005, + 0x0016, 0x0046, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, + 0x2009, 0xb133, 0x2104, 0xa005, 0x1110, 0x080c, 0x27f0, 0x2009, + 0x00f7, 0x080c, 0x4a24, 0x7940, 0xa18c, 0x0010, 0x7942, 0x7924, + 0xd1b4, 0x0110, 0x7827, 0x0040, 0xd19c, 0x0110, 0x7827, 0x0008, + 0x0006, 0x0036, 0x0156, 0x7954, 0xd1ac, 0x1904, 0x133e, 0x080c, + 0x58e7, 0x0158, 0x080c, 0x58fb, 0x1128, 0x2001, 0xb39e, 0x2003, + 0x0000, 0x0070, 0x080c, 0x58dd, 0x0dc0, 0x2001, 0xb39e, 0x2003, + 0xaaaa, 0x2001, 0xb39f, 0x2003, 0x0001, 0x080c, 0x5816, 0x0058, + 0x080c, 0x58d5, 0x0140, 0x2009, 0x00f8, 0x080c, 0x4a24, 0x7843, + 0x0090, 0x7843, 0x0010, 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, + 0x080c, 0x58d5, 0x0138, 0x7824, 0xd0ac, 0x1904, 0x13e4, 0x1f04, + 0x131d, 0x0070, 0x7824, 0x080c, 0x58f1, 0x0118, 0xd0ac, 0x1904, + 0x13e4, 0xa084, 0x1800, 0x0d98, 0x7003, 0x0001, 0x0804, 0x13e4, + 0x2001, 0x0001, 0x080c, 0x269e, 0x0804, 0x13f3, 0x7850, 0xa084, + 0x0180, 0x7852, 0x782f, 0x0020, 0x20a9, 0x0046, 0x1d04, 0x1346, + 0x2091, 0x6000, 0x1f04, 0x1346, 0x7850, 0xa084, 0x0180, 0xa085, + 0x0400, 0x7852, 0x782f, 0x0000, 0x080c, 0x58e7, 0x0158, 0x080c, + 0x58fb, 0x1128, 0x2001, 0xb39e, 0x2003, 0x0000, 0x0070, 0x080c, + 0x58dd, 0x0dc0, 0x2001, 0xb39e, 0x2003, 0xaaaa, 0x2001, 0xb39f, + 0x2003, 0x0001, 0x080c, 0x5816, 0x0020, 0x2009, 0x00f8, 0x080c, + 0x4a24, 0x20a9, 0x000e, 0xe000, 0x1f04, 0x1373, 0x7850, 0xa084, + 0x0180, 0xa085, 0x1400, 0x7852, 0x080c, 0x58d5, 0x0120, 0x7843, + 0x0090, 0x7843, 0x0010, 0x2021, 0xe678, 0x2019, 0xea60, 0x7820, + 0xd09c, 0x1558, 0x080c, 0x58d5, 0x05b8, 0x7824, 0xd0ac, 0x1904, + 0x13e4, 0x080c, 0x58fb, 0x1508, 0x0046, 0x2021, 0x0190, 0x8421, + 0x1df0, 0x004e, 0x8421, 0x11c8, 0x7827, 0x0048, 0x20a9, 0x01f4, + 0x1d04, 0x13a0, 0x2091, 0x6000, 0x1f04, 0x13a0, 0x7824, 0xa084, + 0x0068, 0x15a8, 0x2001, 0xb39e, 0x2003, 0xaaaa, 0x2001, 0xb39f, + 0x2003, 0x0001, 0x7003, 0x0001, 0x0478, 0x8319, 0x1980, 0x2009, + 0xb133, 0x2104, 0x8000, 0x200a, 0xa084, 0xfff0, 0x0120, 0x200b, + 0x0000, 0x080c, 0x27f0, 0x00d8, 0x080c, 0x58e7, 0x1140, 0xa4a2, + 0x0064, 0x1128, 0x080c, 0x58ac, 0x7003, 0x0001, 0x00a8, 0x7827, + 0x1800, 0xe000, 0xe000, 0x7824, 0x080c, 0x58f1, 0x0110, 0xd0ac, + 0x1158, 0xa084, 0x1800, 0x09c8, 0x7003, 0x0001, 0x0028, 0x2001, + 0x0001, 0x080c, 0x269e, 0x0048, 0x2001, 0xb133, 0x2003, 0x0000, + 0x7827, 0x0048, 0x7828, 0xc09d, 0x782a, 0x7850, 0xa084, 0x0180, + 0xa085, 0x0400, 0x7852, 0x015e, 0x003e, 0x000e, 0x080c, 0x153d, + 0x012e, 0x00fe, 0x004e, 0x001e, 0x0005, 0x0005, 0x0005, 0x0005, + 0x2a70, 0x2001, 0xb39e, 0x2003, 0x0000, 0x7087, 0x0000, 0x2009, + 0x0100, 0x2104, 0xa082, 0x0002, 0x0218, 0x704f, 0xffff, 0x0010, + 0x704f, 0x0000, 0x7057, 0xffff, 0x706f, 0x0000, 0x7073, 0x0000, + 0x080c, 0x9c16, 0x2061, 0xb38e, 0x6003, 0x0909, 0x6007, 0x0000, + 0x600b, 0x8800, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0003, + 0x601b, 0x0000, 0x601f, 0x07d0, 0x2061, 0xb396, 0x6003, 0x8000, + 0x6007, 0x0000, 0x600b, 0x0000, 0x600f, 0x0200, 0x6013, 0x00ff, + 0x6017, 0x0000, 0x601b, 0x0001, 0x601f, 0x0000, 0x2061, 0xb3b8, + 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f, 0x2020, + 0x2001, 0xb127, 0x2003, 0x0000, 0x0005, 0x04a0, 0x2011, 0x0000, + 0x81ff, 0x0570, 0xa186, 0x0001, 0x1148, 0x2031, 0x8fff, 0x2039, + 0xd001, 0x2021, 0x0100, 0x2029, 0xd000, 0x00e8, 0xa186, 0x0002, + 0x1118, 0x2011, 0x0000, 0x00b8, 0xa186, 0x0005, 0x1118, 0x2011, + 0x0001, 0x0088, 0xa186, 0x0009, 0x1118, 0x2011, 0x0002, 0x0058, + 0xa186, 0x000a, 0x1118, 0x2011, 0x0002, 0x0028, 0xa186, 0x0055, + 0x1110, 0x2011, 0x0003, 0x3800, 0xa084, 0xfffc, 0xa205, 0x20c0, + 0x0804, 0x104d, 0xa00e, 0x2011, 0x0003, 0x2019, 0x1489, 0x0804, + 0x14da, 0x2019, 0xaaaa, 0x2061, 0xffff, 0x2c14, 0x2362, 0xe000, + 0xe000, 0x2c04, 0xa306, 0x2262, 0x1110, 0xc1b5, 0xc1a5, 0x2011, + 0x0000, 0x2019, 0x149c, 0x04f0, 0x2019, 0xaaaa, 0x2061, 0xffff, + 0x2c14, 0x2362, 0xe000, 0xe000, 0x2c1c, 0x2061, 0x7fff, 0xe000, + 0xe000, 0x2c04, 0x2061, 0xffff, 0x2262, 0xa306, 0x0110, 0xc18d, + 0x0008, 0xc185, 0x2011, 0x0002, 0x2019, 0x14b7, 0x0418, 0x2061, + 0xffff, 0x2019, 0xaaaa, 0x2c14, 0x2362, 0xe000, 0xe000, 0x2c04, + 0x2262, 0xa306, 0x1180, 0x2c14, 0x2362, 0xe000, 0xe000, 0x2c1c, + 0x2061, 0x7fff, 0x2c04, 0x2061, 0xffff, 0x2262, 0xa306, 0x1110, + 0xc195, 0x0008, 0xc19d, 0x2011, 0x0001, 0x2019, 0x14d8, 0x0010, + 0x0804, 0x144e, 0x3800, 0xa084, 0xfffc, 0xa205, 0x20c0, 0x0837, + 0x2011, 0x0000, 0x080c, 0x4e21, 0x1178, 0x6004, 0xa0c4, 0x00ff, + 0xa8c6, 0x0006, 0x0128, 0xa0c4, 0xff00, 0xa8c6, 0x0600, 0x1120, + 0xa186, 0x0080, 0x0108, 0x8210, 0x8108, 0xa186, 0x0100, 0x1d50, + 0x2208, 0x0005, 0x2091, 0x8000, 0x0e04, 0x14fc, 0x0006, 0x0016, + 0x2079, 0x0000, 0x7818, 0xd084, 0x1de8, 0x001e, 0x792e, 0x000e, + 0x782a, 0x000e, 0x7826, 0x3900, 0x783a, 0x7823, 0x8002, 0x781b, + 0x0001, 0x2091, 0x5000, 0x0126, 0x0156, 0x0146, 0x20a9, 0x0010, + 0x20a1, 0xb4fc, 0x2091, 0x2000, 0x40a1, 0x20a9, 0x0010, 0x2091, + 0x2200, 0x40a1, 0x20a9, 0x0010, 0x2091, 0x2400, 0x40a1, 0x20a9, + 0x0010, 0x2091, 0x2600, 0x40a1, 0x20a9, 0x0010, 0x2091, 0x2800, + 0x40a1, 0x014e, 0x015e, 0x012e, 0x2079, 0xb100, 0x7803, 0x0005, + 0x2091, 0x4080, 0x04c9, 0x0cf8, 0x0005, 0x0006, 0x080c, 0x1588, + 0x1518, 0x00f6, 0x2079, 0xb123, 0x2f04, 0x8000, 0x207a, 0xa082, + 0x000f, 0x0258, 0xa006, 0x207a, 0x2079, 0xb125, 0x2f04, 0xa084, + 0x0001, 0xa086, 0x0001, 0x207a, 0x0070, 0x2079, 0xb125, 0x2f7c, + 0x8fff, 0x1128, 0x2001, 0x0c03, 0x2003, 0x0040, 0x0020, 0x2001, + 0x0c03, 0x2003, 0x00c0, 0x00fe, 0x000e, 0x0005, 0x0409, 0x1120, + 0x2001, 0x0c03, 0x2003, 0x0080, 0x0005, 0x00d1, 0x1120, 0x2001, + 0x0c03, 0x2003, 0x0040, 0x0005, 0x0006, 0x0091, 0x1178, 0x2001, + 0x0c03, 0x2003, 0x0040, 0x2009, 0x0fff, 0x00a1, 0x2001, 0x0c03, + 0x2003, 0x0080, 0x2009, 0x0fff, 0x0069, 0x0c88, 0x000e, 0x0005, + 0x00c6, 0x2061, 0x0c00, 0x2c04, 0xa084, 0x00ff, 0xa086, 0x00aa, + 0x00ce, 0x0005, 0x0156, 0x0126, 0xa18c, 0x0fff, 0x21a8, 0x1d04, + 0x1597, 0x2091, 0x6000, 0x1f04, 0x1597, 0x012e, 0x015e, 0x0005, + 0x2071, 0xb100, 0x715c, 0x712e, 0x2021, 0x0001, 0xa190, 0x0030, + 0xa298, 0x0030, 0x0240, 0x7060, 0xa302, 0x1228, 0x220a, 0x2208, + 0x2310, 0x8420, 0x0ca8, 0x3800, 0xd08c, 0x0148, 0x7060, 0xa086, + 0xb100, 0x0128, 0x7063, 0xb100, 0x2011, 0x1000, 0x0c48, 0x200b, + 0x0000, 0x74ae, 0x74b2, 0x0005, 0x00e6, 0x0126, 0x2091, 0x8000, + 0x2071, 0xb100, 0x70b0, 0xa0ea, 0x0010, 0x0268, 0x8001, 0x70b2, + 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, + 0x012e, 0x00ee, 0x0005, 0xa06e, 0x0cd8, 0x00e6, 0x2071, 0xb100, + 0x0126, 0x2091, 0x8000, 0x70b0, 0x8001, 0x0260, 0x70b2, 0x702c, + 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x012e, + 0x00ee, 0x0005, 0xa06e, 0x0cd8, 0x00e6, 0x0126, 0x2091, 0x8000, + 0x2071, 0xb100, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70b0, 0x8000, + 0x70b2, 0x012e, 0x00ee, 0x0005, 0x8dff, 0x0138, 0x6804, 0x6807, + 0x0000, 0x0006, 0x0c49, 0x00de, 0x0cb8, 0x0005, 0x00e6, 0x2071, + 0xb100, 0x70b0, 0xa08a, 0x0010, 0xa00d, 0x00ee, 0x0005, 0x00e6, + 0x2071, 0xb408, 0x7007, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, + 0x2071, 0x0000, 0x7010, 0xa085, 0x8004, 0x7012, 0x00ee, 0x0005, + 0x00e6, 0x2270, 0x700b, 0x0000, 0x2071, 0xb408, 0x7018, 0xa088, + 0xb411, 0x220a, 0x8000, 0xa084, 0x0007, 0x701a, 0x7004, 0xa005, + 0x1128, 0x00f6, 0x2079, 0x0010, 0x0081, 0x00fe, 0x00ee, 0x0005, + 0x00e6, 0x2071, 0xb408, 0x7004, 0xa005, 0x1128, 0x00f6, 0x2079, + 0x0010, 0x0019, 0x00fe, 0x00ee, 0x0005, 0x7000, 0x0002, 0x1653, + 0x16b7, 0x16d4, 0x16d4, 0x7018, 0x711c, 0xa106, 0x1118, 0x7007, + 0x0000, 0x0005, 0x00d6, 0xa180, 0xb411, 0x2004, 0x700a, 0x2068, + 0x8108, 0xa18c, 0x0007, 0x711e, 0x7803, 0x0026, 0x6824, 0x7832, + 0x6828, 0x7836, 0x682c, 0x783a, 0x6830, 0x783e, 0x6810, 0x700e, + 0x680c, 0x7016, 0x6804, 0x00de, 0xd084, 0x0120, 0x7007, 0x0001, + 0x0029, 0x0005, 0x7007, 0x0002, 0x00b1, 0x0005, 0x0016, 0x0026, + 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x1210, 0x2110, 0xa006, + 0x700e, 0x7212, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803, 0x0041, + 0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x0136, 0x0146, 0x0156, + 0x7014, 0x2098, 0x20a1, 0x0014, 0x7803, 0x0026, 0x710c, 0x2011, + 0x0040, 0xa182, 0x0040, 0x1210, 0x2110, 0xa006, 0x700e, 0x22a8, + 0x53a6, 0x8203, 0x7822, 0x7803, 0x0020, 0x3300, 0x7016, 0x7803, + 0x0001, 0x015e, 0x014e, 0x013e, 0x002e, 0x001e, 0x0005, 0x0136, + 0x0146, 0x0156, 0x2099, 0xb1fa, 0x20a1, 0x0018, 0x20a9, 0x0008, + 0x53a3, 0x7803, 0x0020, 0x0126, 0x2091, 0x8000, 0x7803, 0x0041, + 0x7007, 0x0003, 0x7000, 0xc084, 0x7002, 0x700b, 0xb1f5, 0x012e, + 0x015e, 0x014e, 0x013e, 0x0005, 0x0136, 0x0146, 0x0156, 0x2001, + 0xb229, 0x209c, 0x20a1, 0x0014, 0x7803, 0x0026, 0x2001, 0xb22a, + 0x20ac, 0x53a6, 0x2099, 0xb22b, 0x20a1, 0x0018, 0x20a9, 0x0008, + 0x53a3, 0x7803, 0x0020, 0x0126, 0x2091, 0x8000, 0x7803, 0x0001, + 0x7007, 0x0004, 0x7000, 0xc08c, 0x7002, 0x700b, 0xb226, 0x012e, + 0x015e, 0x014e, 0x013e, 0x0005, 0x0016, 0x00e6, 0x2071, 0xb408, + 0x00f6, 0x2079, 0x0010, 0x7904, 0x7803, 0x0002, 0xd1fc, 0x0120, + 0xa18c, 0x0700, 0x7004, 0x0023, 0x00fe, 0x00ee, 0x001e, 0x0005, + 0x164d, 0x1717, 0x1745, 0x176f, 0x179f, 0x1716, 0x0cf8, 0xa18c, + 0x0700, 0x1528, 0x0136, 0x0146, 0x0156, 0x7014, 0x20a0, 0x2099, + 0x0014, 0x7803, 0x0040, 0x7010, 0x20a8, 0x53a5, 0x3400, 0x7016, + 0x015e, 0x014e, 0x013e, 0x700c, 0xa005, 0x0570, 0x7830, 0x7832, + 0x7834, 0x7836, 0x080c, 0x167e, 0x0005, 0x7008, 0xa080, 0x0002, + 0x2003, 0x0100, 0x7007, 0x0000, 0x080c, 0x164d, 0x0005, 0x7008, + 0xa080, 0x0002, 0x2003, 0x0200, 0x0ca8, 0xa18c, 0x0700, 0x1150, + 0x700c, 0xa005, 0x0188, 0x7830, 0x7832, 0x7834, 0x7836, 0x080c, + 0x1693, 0x0005, 0x7008, 0xa080, 0x0002, 0x2003, 0x0200, 0x7007, + 0x0000, 0x080c, 0x164d, 0x0005, 0x00d6, 0x7008, 0x2068, 0x7830, + 0x6826, 0x7834, 0x682a, 0x7838, 0x682e, 0x783c, 0x6832, 0x680b, + 0x0100, 0x00de, 0x7007, 0x0000, 0x080c, 0x164d, 0x0005, 0xa18c, + 0x0700, 0x1540, 0x0136, 0x0146, 0x0156, 0x2001, 0xb1f8, 0x2004, + 0xa080, 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x20a9, + 0x0020, 0x53a5, 0x2001, 0xb1fa, 0x2004, 0xd0bc, 0x0148, 0x2001, + 0xb203, 0x2004, 0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020, 0x53a5, + 0x015e, 0x014e, 0x013e, 0x7007, 0x0000, 0x080c, 0x5c70, 0x080c, + 0x164d, 0x0005, 0x2011, 0x8003, 0x080c, 0x3d5b, 0x0cf8, 0xa18c, + 0x0700, 0x1148, 0x2001, 0xb228, 0x2003, 0x0100, 0x7007, 0x0000, + 0x080c, 0x164d, 0x0005, 0x2011, 0x8004, 0x080c, 0x3d5b, 0x0cf8, + 0x0126, 0x2091, 0x2200, 0x2079, 0x0030, 0x2071, 0xb419, 0x7003, + 0x0000, 0x700f, 0xb41f, 0x7013, 0xb41f, 0x780f, 0x00f6, 0x7803, + 0x0004, 0x012e, 0x0005, 0x6934, 0xa184, 0x0007, 0x0002, 0x17cf, + 0x180d, 0x17cf, 0x17cf, 0x17cf, 0x17f5, 0x17dc, 0x17d3, 0xa085, + 0x0001, 0x0804, 0x1827, 0x684c, 0xd0bc, 0x0dc8, 0x6860, 0x682e, + 0x685c, 0x682a, 0x6858, 0x04c8, 0xa18c, 0x00ff, 0xa186, 0x001e, + 0x1d70, 0x684c, 0xd0bc, 0x0d58, 0x6860, 0x682e, 0x685c, 0x682a, + 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, + 0x21f9, 0x2005, 0x6832, 0x6858, 0x0440, 0xa18c, 0x00ff, 0xa186, + 0x0015, 0x19a8, 0x684c, 0xd0ac, 0x0990, 0x6804, 0x681a, 0xa080, + 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x21f9, 0x2005, 0x6832, + 0xa006, 0x682e, 0x682a, 0x6858, 0x0080, 0x684c, 0xd0ac, 0x0904, + 0x17cf, 0xa006, 0x682e, 0x682a, 0x6858, 0xa18c, 0x000f, 0xa188, + 0x21f9, 0x210d, 0x6932, 0x2d08, 0x691a, 0x6826, 0x684c, 0xc0dd, + 0x684e, 0xa006, 0x680a, 0x697c, 0x6912, 0x6980, 0x6916, 0x0005, + 0x20e1, 0x0007, 0x20e1, 0x2000, 0x2001, 0x020a, 0x2004, 0x82ff, + 0x01a8, 0xa280, 0x0004, 0x00d6, 0x206c, 0x684c, 0xd0dc, 0x1150, + 0x080c, 0x17c3, 0x0138, 0x00de, 0xa280, 0x0000, 0x2003, 0x0002, + 0xa016, 0x0020, 0x6808, 0x8000, 0x680a, 0x00de, 0x0126, 0x0046, + 0x0036, 0x0026, 0x2091, 0x2200, 0x002e, 0x003e, 0x004e, 0x7000, + 0xa005, 0x01d0, 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, + 0x8108, 0xa182, 0xb43a, 0x0210, 0x2009, 0xb41f, 0x710e, 0x7010, + 0xa102, 0xa082, 0x0009, 0x0118, 0xa080, 0x001b, 0x1118, 0x2009, + 0x0138, 0x200a, 0x012e, 0x0005, 0x7206, 0x2001, 0x186a, 0x0006, + 0x2260, 0x0804, 0x1987, 0x0126, 0x0026, 0x0036, 0x00c6, 0x0006, + 0x2091, 0x2200, 0x000e, 0x004e, 0x003e, 0x002e, 0x00d6, 0x00c6, + 0x2460, 0x6110, 0x2168, 0x6a62, 0x6b5e, 0xa005, 0x0904, 0x18cc, + 0x6808, 0xa005, 0x0904, 0x1903, 0x7000, 0xa005, 0x1108, 0x0488, + 0x700c, 0x7110, 0xa106, 0x1904, 0x190b, 0x7004, 0xa406, 0x1548, + 0x2001, 0x0005, 0x2004, 0xd08c, 0x0168, 0x0046, 0x080c, 0x1a86, + 0x004e, 0x2460, 0x6010, 0xa080, 0x0002, 0x2004, 0xa005, 0x0904, + 0x1903, 0x0c10, 0x2001, 0x0207, 0x2004, 0xd09c, 0x1d48, 0x7804, + 0xa084, 0x6000, 0x0120, 0xa086, 0x6000, 0x0108, 0x0c08, 0x7818, + 0x6812, 0x781c, 0x6816, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, + 0x2060, 0x6100, 0xa18e, 0x0004, 0x1904, 0x190b, 0x2009, 0x0048, + 0x080c, 0x831a, 0x0804, 0x190b, 0x6808, 0xa005, 0x05a0, 0x7000, + 0xa005, 0x0588, 0x700c, 0x7110, 0xa106, 0x1118, 0x7004, 0xa406, + 0x1550, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0160, 0x0046, 0x080c, + 0x1a86, 0x004e, 0x2460, 0x6010, 0xa080, 0x0002, 0x2004, 0xa005, + 0x01d0, 0x0c28, 0x2001, 0x0207, 0x2004, 0xd09c, 0x1d50, 0x2001, + 0x0005, 0x2004, 0xd08c, 0x1d50, 0x7804, 0xa084, 0x6000, 0x0118, + 0xa086, 0x6000, 0x19f0, 0x7818, 0x6812, 0x781c, 0x6816, 0x7803, + 0x0004, 0x7003, 0x0000, 0x6100, 0xa18e, 0x0004, 0x1120, 0x2009, + 0x0048, 0x080c, 0x831a, 0x00ce, 0x00de, 0x012e, 0x0005, 0x00f6, + 0x00e6, 0x0026, 0x0036, 0x0046, 0x0056, 0x2071, 0xb419, 0x7000, + 0xa086, 0x0000, 0x0904, 0x1965, 0x7004, 0xac06, 0x15c0, 0x2079, + 0x0030, 0x7000, 0xa086, 0x0003, 0x0590, 0x7804, 0xd0fc, 0x1560, + 0x2001, 0x0207, 0x2004, 0xd09c, 0x1dc0, 0x7804, 0xd0fc, 0x1520, + 0x080c, 0x1db4, 0x0026, 0x0056, 0x7803, 0x0004, 0x7804, 0xd0ac, + 0x1de8, 0x7803, 0x0002, 0x7803, 0x0009, 0x7003, 0x0003, 0x7007, + 0x0000, 0x005e, 0x002e, 0x2001, 0x015d, 0x2003, 0x0000, 0x080c, + 0x58d5, 0x1118, 0x080c, 0x5957, 0x0050, 0x2001, 0x0160, 0x2502, + 0x2001, 0x0138, 0x2202, 0x0018, 0x080c, 0x1a86, 0x0800, 0x0156, + 0x20a9, 0x0009, 0x2009, 0xb41f, 0x2104, 0xac06, 0x1108, 0x200a, + 0xa188, 0x0003, 0x1f04, 0x195c, 0x015e, 0x005e, 0x004e, 0x003e, + 0x002e, 0x00ee, 0x00fe, 0x0005, 0x700c, 0x7110, 0xa106, 0x0904, + 0x19f7, 0x2104, 0x7006, 0x2060, 0x8108, 0x211c, 0x8108, 0x2124, + 0x8108, 0xa182, 0xb43a, 0x0210, 0x2009, 0xb41f, 0x7112, 0x700c, + 0xa106, 0x1128, 0x080c, 0x27c4, 0x2001, 0x0138, 0x2102, 0x8cff, + 0x0598, 0x6010, 0x2068, 0x2d58, 0x6828, 0xa406, 0x1590, 0x682c, + 0xa306, 0x1578, 0x7004, 0x2060, 0x6020, 0xc0d4, 0x6022, 0x684c, + 0xd0f4, 0x0128, 0x6817, 0xffff, 0x6813, 0xffff, 0x00e8, 0x6850, + 0xd0f4, 0x1130, 0x7803, 0x0004, 0x6810, 0x781a, 0x6814, 0x781e, + 0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, + 0x000f, 0x2009, 0x0011, 0x080c, 0x19fa, 0x0120, 0x2009, 0x0001, + 0x080c, 0x19fa, 0x2d58, 0x0005, 0x080c, 0x1d11, 0x0904, 0x196c, + 0x0cd0, 0x6020, 0xd0f4, 0x11e0, 0xd0d4, 0x01b8, 0x6038, 0xa402, + 0x6034, 0xa303, 0x0108, 0x1288, 0x643a, 0x6336, 0x6c2a, 0x6b2e, + 0x0046, 0x0036, 0x2400, 0x6c7c, 0xa402, 0x6812, 0x2300, 0x6b80, + 0xa303, 0x6816, 0x003e, 0x004e, 0x0018, 0x080c, 0x9ba8, 0x09e0, + 0x601c, 0xa08e, 0x0008, 0x0904, 0x1992, 0xa08e, 0x000a, 0x0904, + 0x1992, 0x2001, 0xb174, 0x2004, 0xd0b4, 0x1120, 0x6817, 0xffff, + 0x6813, 0xffff, 0x080c, 0x2219, 0x1938, 0x0804, 0x1992, 0x7003, + 0x0000, 0x0005, 0x8aff, 0x0904, 0x1a60, 0xa03e, 0x2730, 0x6850, + 0xd0fc, 0x11b8, 0xd0f4, 0x1528, 0x00d6, 0x2805, 0xac68, 0x2900, + 0x0002, 0x1a4a, 0x1a2f, 0x1a2f, 0x1a4a, 0x1a4a, 0x1a43, 0x1a4a, + 0x1a2f, 0x1a4a, 0x1a34, 0x1a34, 0x1a4a, 0x1a4a, 0x1a4a, 0x1a3b, + 0x1a34, 0x7803, 0x0004, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c, + 0x6c20, 0x00d6, 0xd99c, 0x0548, 0x2805, 0xac68, 0x6f08, 0x6e0c, + 0x0420, 0xc0f4, 0x6852, 0x6b6c, 0x6a70, 0x00d6, 0x0428, 0x6b08, + 0x6a0c, 0x6d00, 0x6c04, 0x00c8, 0x6b10, 0x6a14, 0x6d00, 0x6c04, + 0x6f08, 0x6e0c, 0x0090, 0x00de, 0x00d6, 0x6834, 0xa084, 0x00ff, + 0xa086, 0x001e, 0x1138, 0x00de, 0x080c, 0x21bb, 0x1904, 0x19fa, + 0xa00e, 0x00b0, 0x00de, 0x080c, 0x14fa, 0x7b22, 0x7a26, 0x7d32, + 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002, 0x00de, + 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x080c, 0x21bb, + 0x0005, 0x080c, 0x14fa, 0x080c, 0x1e70, 0x7004, 0x2060, 0x00d6, + 0x6010, 0x2068, 0x7003, 0x0000, 0x080c, 0x1d48, 0x080c, 0x986a, + 0x0170, 0x6808, 0x8001, 0x680a, 0x697c, 0x6912, 0x6980, 0x6916, + 0x682b, 0xffff, 0x682f, 0xffff, 0x6850, 0xc0bd, 0x6852, 0x00de, + 0x080c, 0x955c, 0x0804, 0x1c7c, 0x080c, 0x14fa, 0x0126, 0x2091, + 0x2200, 0x0006, 0x0016, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, + 0x0002, 0xa184, 0x0700, 0x1978, 0xa184, 0x0003, 0xa086, 0x0003, + 0x0d58, 0x7000, 0x0002, 0x1aa3, 0x1aa9, 0x1bb0, 0x1c57, 0x1c6b, + 0x1aa3, 0x1aa3, 0x1aa3, 0x7804, 0xd09c, 0x1904, 0x1c7c, 0x080c, + 0x14fa, 0x8001, 0x7002, 0xd1bc, 0x11a0, 0xd19c, 0x1904, 0x1b3b, + 0xd1dc, 0x1178, 0x8aff, 0x0904, 0x1b3b, 0x2009, 0x0001, 0x080c, + 0x19fa, 0x0904, 0x1c7c, 0x2009, 0x0001, 0x080c, 0x19fa, 0x0804, + 0x1c7c, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1bc, 0x1904, 0x1b1b, + 0x0026, 0x0036, 0x7c20, 0x7d24, 0x7e30, 0x7f34, 0x7818, 0x6812, + 0x781c, 0x6816, 0x2001, 0x0201, 0x2004, 0xa005, 0x0140, 0x7808, + 0xd0ec, 0x1128, 0x7803, 0x0009, 0x7003, 0x0004, 0x0010, 0x080c, + 0x1c80, 0x6b28, 0x6a2c, 0x2400, 0x686e, 0xa31a, 0x2500, 0x6872, + 0xa213, 0x6b2a, 0x6a2e, 0x00c6, 0x7004, 0x2060, 0x6020, 0xd0f4, + 0x1110, 0x633a, 0x6236, 0x00ce, 0x003e, 0x002e, 0x6e1e, 0x6f22, + 0x080c, 0x21d1, 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, + 0x6850, 0xc0fd, 0x6852, 0x6808, 0x8001, 0x680a, 0x1148, 0x684c, + 0xd0e4, 0x0130, 0x7004, 0x2060, 0x2009, 0x0048, 0x080c, 0x831a, + 0x7000, 0xa086, 0x0004, 0x0904, 0x1c7c, 0x7003, 0x0000, 0x080c, + 0x196c, 0x0804, 0x1c7c, 0x0056, 0x7d0c, 0xd5bc, 0x1110, 0x080c, + 0xafbf, 0x005e, 0x080c, 0x1d48, 0x00f6, 0x7004, 0x2078, 0x080c, + 0x5177, 0x0118, 0x7820, 0xc0f5, 0x7822, 0x00fe, 0x682b, 0xffff, + 0x682f, 0xffff, 0x6808, 0x8001, 0x680a, 0x697c, 0x791a, 0x6980, + 0x791e, 0x0804, 0x1c7c, 0x7004, 0x00c6, 0x2060, 0x6020, 0x00ce, + 0xd0f4, 0x0120, 0x6808, 0x8001, 0x680a, 0x0420, 0x7818, 0x6812, + 0x7a1c, 0x6a16, 0xd19c, 0x0160, 0xa205, 0x0150, 0x7004, 0xa080, + 0x0007, 0x2004, 0xa084, 0xfffd, 0xa086, 0x0008, 0x1904, 0x1ac1, + 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005, 0x1180, 0x7003, 0x0000, + 0x6808, 0x8001, 0x680a, 0x1130, 0x7004, 0x2060, 0x2009, 0x0048, + 0x080c, 0x831a, 0x080c, 0x196c, 0x0804, 0x1c7c, 0x7818, 0x6812, + 0x781c, 0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa192, 0x0841, + 0x1a04, 0x1a63, 0xa188, 0x0007, 0x8114, 0x8214, 0x8214, 0xa10a, + 0x8104, 0x8004, 0x8004, 0xa20a, 0x810b, 0x810b, 0x810b, 0x080c, + 0x1dd7, 0x7803, 0x0004, 0x780f, 0xffff, 0x7803, 0x0001, 0x7804, + 0xd0fc, 0x0de8, 0x7803, 0x0002, 0x7803, 0x0004, 0x780f, 0x00f6, + 0x7004, 0x7007, 0x0000, 0x2060, 0x2009, 0x0048, 0x080c, 0x831a, + 0x080c, 0x1e09, 0x0938, 0x7908, 0xd1ec, 0x1118, 0x2009, 0x0009, + 0x0010, 0x2009, 0x0019, 0x7902, 0x7003, 0x0003, 0x0804, 0x1c7c, + 0x8001, 0x7002, 0xd194, 0x01a8, 0x7804, 0xd0fc, 0x1904, 0x1c4a, + 0xd09c, 0x0130, 0x7804, 0xd0fc, 0x1904, 0x1a8e, 0xd09c, 0x11a8, + 0x8aff, 0x0904, 0x1c7c, 0x2009, 0x0001, 0x080c, 0x19fa, 0x0804, + 0x1c7c, 0xa184, 0x0888, 0x1148, 0x8aff, 0x0904, 0x1c7c, 0x2009, + 0x0001, 0x080c, 0x19fa, 0x0804, 0x1c7c, 0x7818, 0x6812, 0x7a1c, + 0x6a16, 0xa205, 0x0904, 0x1b58, 0x7803, 0x0004, 0x7003, 0x0000, + 0xd1bc, 0x1904, 0x1c2d, 0x6834, 0xa084, 0x00ff, 0xa086, 0x0029, + 0x1118, 0xd19c, 0x1904, 0x1b58, 0x0026, 0x0036, 0x7c20, 0x7d24, + 0x7e30, 0x7f34, 0x7818, 0x6812, 0x781c, 0x6816, 0x2001, 0x0201, + 0x2004, 0xa005, 0x0140, 0x7808, 0xd0ec, 0x1128, 0x7803, 0x0009, + 0x7003, 0x0004, 0x0020, 0x0016, 0x080c, 0x1c80, 0x001e, 0x6b28, + 0x6a2c, 0x080c, 0x21d1, 0x00d6, 0x2805, 0xac68, 0x6034, 0xd09c, + 0x1128, 0x6808, 0xa31a, 0x680c, 0xa213, 0x0020, 0x6810, 0xa31a, + 0x6814, 0xa213, 0x00de, 0xd194, 0x0904, 0x1ae3, 0x2a00, 0x6826, + 0x2c00, 0x681a, 0x2800, 0x6832, 0x6808, 0x8001, 0x680a, 0x6b2a, + 0x6a2e, 0x003e, 0x002e, 0x0804, 0x1b6a, 0x0056, 0x7d0c, 0x080c, + 0xafbf, 0x005e, 0x080c, 0x1d48, 0x00f6, 0x7004, 0x2078, 0x080c, + 0x5177, 0x0118, 0x7820, 0xc0f5, 0x7822, 0x00fe, 0x682b, 0xffff, + 0x682f, 0xffff, 0x6808, 0x8001, 0x680a, 0x697c, 0x791a, 0x6980, + 0x791e, 0x0490, 0x7804, 0xd09c, 0x0904, 0x1a8e, 0x7c20, 0x7824, + 0xa405, 0x1904, 0x1a8e, 0x7803, 0x0002, 0x0804, 0x1bd5, 0x7803, + 0x0004, 0x7003, 0x0000, 0x7004, 0xa00d, 0x0150, 0x6808, 0x8001, + 0x680a, 0x1130, 0x7004, 0x2060, 0x2009, 0x0048, 0x080c, 0x831a, + 0x080c, 0x196c, 0x0088, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, + 0x2060, 0x6010, 0xa005, 0x0da0, 0x2068, 0x6808, 0x8000, 0x680a, + 0x6c28, 0x6b2c, 0x080c, 0x1987, 0x001e, 0x000e, 0x012e, 0x0005, + 0x700c, 0x7110, 0xa106, 0x0904, 0x1d05, 0x7004, 0x0016, 0x210c, + 0xa106, 0x001e, 0x0904, 0x1d05, 0x00d6, 0x00c6, 0x216c, 0x2d00, + 0xa005, 0x0904, 0x1d03, 0x6820, 0xd0d4, 0x1904, 0x1d03, 0x6810, + 0x2068, 0x6850, 0xd0fc, 0x0558, 0x8108, 0x2104, 0x6b2c, 0xa306, + 0x1904, 0x1d03, 0x8108, 0x2104, 0x6a28, 0xa206, 0x1904, 0x1d03, + 0x6850, 0xc0fc, 0xc0f5, 0x6852, 0x686c, 0x7822, 0x6870, 0x7826, + 0x681c, 0x7832, 0x6820, 0x7836, 0x6818, 0x2060, 0x6034, 0xd09c, + 0x0150, 0x6830, 0x2005, 0x00d6, 0xac68, 0x6808, 0x783a, 0x680c, + 0x783e, 0x00de, 0x04d0, 0xa006, 0x783a, 0x783e, 0x04b0, 0x8108, + 0x2104, 0xa005, 0x15c0, 0x6b2c, 0xa306, 0x15a8, 0x8108, 0x2104, + 0xa005, 0x1588, 0x6a28, 0xa206, 0x1570, 0x6850, 0xc0f5, 0x6852, + 0x6830, 0x2005, 0x6918, 0xa160, 0xa180, 0x000d, 0x2004, 0xd09c, + 0x1170, 0x6008, 0x7822, 0x686e, 0x600c, 0x7826, 0x6872, 0x6000, + 0x7832, 0x6004, 0x7836, 0xa006, 0x783a, 0x783e, 0x0070, 0x6010, + 0x7822, 0x686e, 0x6014, 0x7826, 0x6872, 0x6000, 0x7832, 0x6004, + 0x7836, 0x6008, 0x783a, 0x600c, 0x783e, 0x6810, 0x781a, 0x6814, + 0x781e, 0x7803, 0x0011, 0x00ce, 0x00de, 0x0005, 0x2011, 0x0201, + 0x2009, 0x003c, 0x2204, 0xa005, 0x1118, 0x8109, 0x1dd8, 0x0005, + 0x0005, 0x0ca1, 0x01e0, 0x7908, 0xd1ec, 0x1160, 0x080c, 0x1e09, + 0x0148, 0x7803, 0x0009, 0x7904, 0xd1fc, 0x0de8, 0x7803, 0x0006, + 0x0c29, 0x0168, 0x780c, 0xd0a4, 0x1150, 0x7007, 0x0000, 0x080c, + 0x1e09, 0x0140, 0x7803, 0x0019, 0x7003, 0x0003, 0x0018, 0x00c1, + 0xa085, 0x0001, 0x0005, 0x0126, 0x2091, 0x2200, 0x7000, 0xa086, + 0x0003, 0x1160, 0x700c, 0x7110, 0xa106, 0x0140, 0x080c, 0x2835, + 0x20e1, 0x9028, 0x700f, 0xb41f, 0x7013, 0xb41f, 0x012e, 0x0005, + 0x00c6, 0x080c, 0x58d5, 0x1570, 0x2001, 0x0160, 0x2003, 0x0000, + 0x2001, 0x0138, 0x2003, 0x0000, 0x2011, 0x00c8, 0xe000, 0xe000, + 0x8211, 0x1de0, 0x080c, 0x1daa, 0x700c, 0x7110, 0xa106, 0x0190, + 0x2104, 0xa005, 0x0130, 0x2060, 0x6010, 0x2060, 0x6008, 0x8001, + 0x600a, 0xa188, 0x0003, 0xa182, 0xb43a, 0x0210, 0x2009, 0xb41f, + 0x7112, 0x0c50, 0x0066, 0x2031, 0x0000, 0x080c, 0x5957, 0x006e, + 0x00ce, 0x0005, 0x04c9, 0x080c, 0x2835, 0x20e1, 0x9028, 0x700c, + 0x7110, 0xa106, 0x01d0, 0x2104, 0xa005, 0x0130, 0x2060, 0x6010, + 0x2060, 0x6008, 0x8001, 0x600a, 0xa188, 0x0003, 0xa182, 0xb43a, + 0x0210, 0x2009, 0xb41f, 0x7112, 0x700c, 0xa106, 0x1d40, 0x080c, + 0x27c4, 0x2001, 0x0138, 0x2102, 0x0c10, 0x2001, 0x015d, 0x200c, + 0x810a, 0x2102, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202, + 0x00ce, 0x0005, 0x080c, 0x2835, 0x20e1, 0x9028, 0x2001, 0x015d, + 0x200c, 0x810a, 0x2102, 0x0005, 0x2001, 0x0138, 0x2014, 0x2003, + 0x0000, 0x2001, 0x0160, 0x202c, 0x2003, 0x0000, 0x080c, 0x58d5, + 0x1108, 0x0005, 0x2021, 0xb015, 0x2001, 0x0141, 0x201c, 0xd3dc, + 0x1168, 0x2001, 0x0109, 0x201c, 0xa39c, 0x0048, 0x1138, 0x2001, + 0x0111, 0x201c, 0x83ff, 0x1110, 0x8421, 0x1d70, 0x0005, 0x00e6, + 0x2071, 0x0200, 0x7808, 0xa084, 0xf000, 0xa10d, 0x08a9, 0x2019, + 0x5000, 0x8319, 0x0168, 0x2001, 0xb43a, 0x2004, 0xa086, 0x0000, + 0x0138, 0x2001, 0x0021, 0xd0fc, 0x0da0, 0x080c, 0x205e, 0x0c78, + 0x20e1, 0x7000, 0x7324, 0x7420, 0x7028, 0x7028, 0x7426, 0x7037, + 0x0001, 0x810f, 0x712e, 0x702f, 0x0100, 0x7037, 0x0008, 0x7326, + 0x7422, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202, 0x00ee, + 0x0005, 0x0026, 0x2001, 0x015d, 0x200c, 0x810a, 0x2102, 0x7908, + 0xa18c, 0x0fff, 0xa182, 0x0ffd, 0x0210, 0x2009, 0x0000, 0xa190, + 0x0007, 0xa294, 0x1ff8, 0x8214, 0x8214, 0x8214, 0x2001, 0x020a, + 0x82ff, 0x0140, 0x20e1, 0x6000, 0x200c, 0x200c, 0x200c, 0x200c, + 0x8211, 0x1dd0, 0x20e1, 0x7000, 0x200c, 0x200c, 0x7003, 0x0000, + 0x20e1, 0x6000, 0x2001, 0x0208, 0x200c, 0x2001, 0x0209, 0x2004, + 0xa106, 0x0158, 0x080c, 0x1d06, 0x0130, 0x7908, 0xd1ec, 0x1128, + 0x790c, 0xd1a4, 0x0960, 0x080c, 0x1d48, 0xa006, 0x002e, 0x0005, + 0x00f6, 0x00e6, 0x0016, 0x0026, 0x2071, 0xb419, 0x2079, 0x0030, + 0x2011, 0x0050, 0x7000, 0xa086, 0x0000, 0x01a8, 0x8211, 0x0188, + 0x2001, 0x0005, 0x2004, 0xd08c, 0x0dc8, 0x7904, 0xa18c, 0x0780, + 0x0016, 0x080c, 0x1a86, 0x001e, 0x81ff, 0x1118, 0x2011, 0x0050, + 0x0c48, 0xa085, 0x0001, 0x002e, 0x001e, 0x00ee, 0x00fe, 0x0005, + 0x7803, 0x0004, 0x2009, 0x0064, 0x7804, 0xd0ac, 0x0904, 0x1ebc, + 0x8109, 0x1dd0, 0x2009, 0x0100, 0x210c, 0xa18a, 0x0003, 0x0a0c, + 0x14fa, 0x080c, 0x2165, 0x00e6, 0x00f6, 0x2071, 0xb408, 0x2079, + 0x0010, 0x7004, 0xa086, 0x0000, 0x0538, 0x7800, 0x0006, 0x7820, + 0x0006, 0x7830, 0x0006, 0x7834, 0x0006, 0x7838, 0x0006, 0x783c, + 0x0006, 0x7803, 0x0004, 0xe000, 0xe000, 0x2079, 0x0030, 0x7804, + 0xd0ac, 0x190c, 0x14fa, 0x2079, 0x0010, 0x000e, 0x783e, 0x000e, + 0x783a, 0x000e, 0x7836, 0x000e, 0x7832, 0x000e, 0x7822, 0x000e, + 0x7802, 0x00fe, 0x00ee, 0x0030, 0x00fe, 0x00ee, 0x7804, 0xd0ac, + 0x190c, 0x14fa, 0x080c, 0x6f5b, 0x0005, 0x00e6, 0x2071, 0xb43a, + 0x7003, 0x0000, 0x00ee, 0x0005, 0x00d6, 0xa280, 0x0004, 0x206c, + 0x694c, 0xd1dc, 0x1904, 0x1f3a, 0x6934, 0xa184, 0x0007, 0x0002, + 0x1ed8, 0x1f25, 0x1ed8, 0x1ed8, 0x1ed8, 0x1f0c, 0x1eeb, 0x1eda, + 0x080c, 0x14fa, 0x684c, 0xd0b4, 0x0904, 0x2022, 0x6860, 0x682e, + 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a, 0x6880, 0x680e, + 0x6958, 0x0804, 0x1f2d, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, + 0x1d38, 0x684c, 0xd0b4, 0x0904, 0x2022, 0x6860, 0x682e, 0x6816, + 0x685c, 0x682a, 0x6812, 0x687c, 0x680a, 0x6880, 0x680e, 0x6804, + 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x21f9, + 0x2005, 0x6832, 0x6958, 0x0450, 0xa18c, 0x00ff, 0xa186, 0x0015, + 0x1548, 0x684c, 0xd0b4, 0x0904, 0x2022, 0x6804, 0x681a, 0xa080, + 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x21f9, 0x2005, 0x6832, + 0x6958, 0xa006, 0x682e, 0x682a, 0x0088, 0x684c, 0xd0b4, 0x0904, + 0x1a61, 0x6958, 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834, + 0xa084, 0x000f, 0xa080, 0x21f9, 0x2005, 0x6832, 0x6926, 0x684c, + 0xc0dd, 0x684e, 0x00de, 0x0005, 0x00f6, 0x2079, 0x0020, 0x7804, + 0xd0fc, 0x190c, 0x205e, 0x00e6, 0x00d6, 0x2071, 0xb43a, 0x7000, + 0xa005, 0x1904, 0x1fa2, 0x00c6, 0x7206, 0xa280, 0x0004, 0x205c, + 0x7004, 0x2068, 0x7803, 0x0004, 0x6818, 0x00d6, 0x2068, 0x686c, + 0x7812, 0x6890, 0x00f6, 0x20e1, 0x9040, 0x2079, 0x0200, 0x781a, + 0x2079, 0x0100, 0x8004, 0x78d6, 0x00fe, 0x00de, 0x2b68, 0x6824, + 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, + 0x6908, 0x791a, 0x7116, 0x680c, 0x781e, 0x701a, 0xa006, 0x700e, + 0x7012, 0x7004, 0x692c, 0x6814, 0xa106, 0x1120, 0x6928, 0x6810, + 0xa106, 0x0158, 0x0036, 0x0046, 0x6b14, 0x6c10, 0x080c, 0x2219, + 0x004e, 0x003e, 0x0110, 0x00ce, 0x00a8, 0x8aff, 0x1120, 0x00ce, + 0xa085, 0x0001, 0x0078, 0x0126, 0x2091, 0x8000, 0x2079, 0x0020, + 0x2009, 0x0001, 0x0059, 0x0118, 0x2009, 0x0001, 0x0039, 0x012e, + 0x00ce, 0xa006, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x0076, 0x0066, + 0x0056, 0x0046, 0x0036, 0x0026, 0x8aff, 0x0904, 0x201b, 0x700c, + 0x7214, 0xa23a, 0x7010, 0x7218, 0xa203, 0x0a04, 0x201a, 0xa705, + 0x0904, 0x201a, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x11a8, 0x00d6, + 0x2805, 0xac68, 0x2900, 0x0002, 0x1ffd, 0x1fe2, 0x1fe2, 0x1ffd, + 0x1ffd, 0x1ff6, 0x1ffd, 0x1fe2, 0x1ffd, 0x1fe7, 0x1fe7, 0x1ffd, + 0x1ffd, 0x1ffd, 0x1fee, 0x1fe7, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, + 0x6d1c, 0x6c20, 0xd99c, 0x0528, 0x00d6, 0x2805, 0xac68, 0x6f08, + 0x6e0c, 0x00f0, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x00c8, 0x6b10, + 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0090, 0x00de, 0x00d6, + 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x1138, 0x00de, 0x080c, + 0x21bb, 0x1904, 0x1fac, 0xa00e, 0x00f0, 0x00de, 0x080c, 0x14fa, + 0x00de, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, + 0x7000, 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, + 0x682e, 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012, 0x080c, + 0x21bb, 0x0008, 0xa006, 0x002e, 0x003e, 0x004e, 0x005e, 0x006e, + 0x007e, 0x0005, 0x080c, 0x14fa, 0x0026, 0x2001, 0x0105, 0x2003, + 0x0010, 0x20e1, 0x9040, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, + 0x2060, 0x00d6, 0x6010, 0x2068, 0x080c, 0x986a, 0x0118, 0x6850, + 0xc0bd, 0x6852, 0x601c, 0xa086, 0x0006, 0x1180, 0x2061, 0x0100, + 0x62c8, 0x2001, 0x00fa, 0x8001, 0x1df0, 0x60c8, 0xa206, 0x1dc0, + 0x60c4, 0x686a, 0x60c8, 0x6866, 0x7004, 0x2060, 0x00de, 0x080c, + 0x955c, 0x20e1, 0x9040, 0x080c, 0x7f2b, 0x2011, 0x0000, 0x080c, + 0x7d5c, 0x080c, 0x6f5b, 0x002e, 0x0804, 0x2118, 0x0126, 0x2091, + 0x2400, 0x0006, 0x0016, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x2079, + 0x0020, 0x2071, 0xb43a, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, + 0x0002, 0xa184, 0x0700, 0x1904, 0x2024, 0x7000, 0x0002, 0x2118, + 0x207b, 0x20eb, 0x2116, 0x8001, 0x7002, 0xd19c, 0x1170, 0x8aff, + 0x05d0, 0x2009, 0x0001, 0x080c, 0x1fa6, 0x0904, 0x2118, 0x2009, + 0x0001, 0x080c, 0x1fa6, 0x0804, 0x2118, 0x7803, 0x0004, 0xd194, + 0x0148, 0x6850, 0xc0fc, 0x6852, 0x8aff, 0x11d8, 0x684c, 0xc0f5, + 0x684e, 0x00b8, 0x0026, 0x0036, 0x6b28, 0x6a2c, 0x7820, 0x686e, + 0xa31a, 0x7824, 0x6872, 0xa213, 0x7830, 0x681e, 0x7834, 0x6822, + 0x6b2a, 0x6a2e, 0x003e, 0x002e, 0x080c, 0x21d1, 0x6850, 0xc0fd, + 0x6852, 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, + 0x0000, 0x0804, 0x2118, 0x00f6, 0x0026, 0x781c, 0x0006, 0x7818, + 0x0006, 0x2079, 0x0100, 0x7a14, 0xa284, 0x0184, 0xa085, 0x0012, + 0x7816, 0x0036, 0x2019, 0x1000, 0x8319, 0x090c, 0x14fa, 0x7820, + 0xd0bc, 0x1dd0, 0x003e, 0x79c8, 0x000e, 0xa102, 0x001e, 0x0006, + 0x0016, 0x79c4, 0x000e, 0xa103, 0x78c6, 0x000e, 0x78ca, 0xa284, + 0x0184, 0xa085, 0x0012, 0x7816, 0x002e, 0x00fe, 0x7803, 0x0008, + 0x7003, 0x0000, 0x0468, 0x8001, 0x7002, 0xd194, 0x0168, 0x7804, + 0xd0fc, 0x1904, 0x206e, 0xd19c, 0x11f8, 0x8aff, 0x0508, 0x2009, + 0x0001, 0x080c, 0x1fa6, 0x00e0, 0x0026, 0x0036, 0x6b28, 0x6a2c, + 0x080c, 0x21d1, 0x00d6, 0x2805, 0xac68, 0x6034, 0xd09c, 0x1128, + 0x6808, 0xa31a, 0x680c, 0xa213, 0x0020, 0x6810, 0xa31a, 0x6814, + 0xa213, 0x00de, 0x0804, 0x209e, 0x0804, 0x209a, 0x080c, 0x14fa, + 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x001e, 0x000e, 0x012e, 0x0005, + 0x00f6, 0x00e6, 0x2071, 0xb43a, 0x7000, 0xa086, 0x0000, 0x05d0, + 0x2079, 0x0020, 0x0016, 0x2009, 0x0207, 0x210c, 0xd194, 0x0198, + 0x2009, 0x020c, 0x210c, 0xa184, 0x0003, 0x0168, 0x080c, 0xaffa, + 0x2001, 0x0133, 0x2004, 0xa005, 0x090c, 0x14fa, 0x20e1, 0x9040, + 0x2001, 0x020c, 0x2102, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203, + 0x210c, 0xa106, 0x1110, 0x20e1, 0x9040, 0x7804, 0xd0fc, 0x09d8, + 0x080c, 0x205e, 0x7000, 0xa086, 0x0000, 0x19a8, 0x001e, 0x7803, + 0x0004, 0x7804, 0xd0ac, 0x1de8, 0x20e1, 0x9040, 0x7803, 0x0002, + 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x0026, 0x00c6, 0x00d6, + 0x00e6, 0x00f6, 0x2071, 0xb43a, 0x2079, 0x0020, 0x7000, 0xa086, + 0x0000, 0x0540, 0x7004, 0x2060, 0x6010, 0x2068, 0x080c, 0x986a, + 0x0158, 0x6850, 0xc0b5, 0x6852, 0x680c, 0x7a1c, 0xa206, 0x1120, + 0x6808, 0x7a18, 0xa206, 0x01e0, 0x2001, 0x0105, 0x2003, 0x0010, + 0x20e1, 0x9040, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, + 0x080c, 0x955c, 0x20e1, 0x9040, 0x080c, 0x7f2b, 0x2011, 0x0000, + 0x080c, 0x7d5c, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x0005, + 0x6810, 0x6a14, 0xa205, 0x1d00, 0x684c, 0xc0dc, 0x684e, 0x2c10, + 0x080c, 0x1ec4, 0x2001, 0x0105, 0x2003, 0x0010, 0x20e1, 0x9040, + 0x7803, 0x0004, 0x7003, 0x0000, 0x2069, 0xb3d9, 0x6833, 0x0000, + 0x683f, 0x0000, 0x08f8, 0x8840, 0x2805, 0xa005, 0x1170, 0x6004, + 0xa005, 0x0168, 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, + 0x21f9, 0x2045, 0x88ff, 0x090c, 0x14fa, 0x8a51, 0x0005, 0x2050, + 0x0005, 0x8a50, 0x8841, 0x2805, 0xa005, 0x1190, 0x2c00, 0xad06, + 0x0120, 0x6000, 0xa005, 0x1108, 0x2d00, 0x2060, 0x681a, 0x6034, + 0xa084, 0x000f, 0xa080, 0x2209, 0x2045, 0x88ff, 0x090c, 0x14fa, + 0x0005, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d, 0x0021, 0x0025, + 0x0029, 0x0000, 0x000f, 0x0015, 0x001b, 0x0021, 0x0027, 0x0000, + 0x0000, 0x0000, 0x21ee, 0x21ea, 0x0000, 0x0000, 0x21f8, 0x0000, + 0x21ee, 0x0000, 0x21f5, 0x21f2, 0x0000, 0x0000, 0x0000, 0x21f8, + 0x21f5, 0x0000, 0x21f0, 0x21f0, 0x0000, 0x0000, 0x21f8, 0x0000, + 0x21f0, 0x0000, 0x21f6, 0x21f6, 0x0000, 0x0000, 0x0000, 0x21f8, + 0x21f6, 0x00a6, 0x0096, 0x0086, 0x6b2e, 0x6c2a, 0x6858, 0xa055, + 0x0904, 0x22aa, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x21f9, + 0xa986, 0x0007, 0x0130, 0xa986, 0x000e, 0x0118, 0xa986, 0x000f, + 0x1120, 0x605c, 0xa422, 0x6060, 0xa31a, 0x2805, 0xa045, 0x1140, + 0x0310, 0x0804, 0x22aa, 0x6004, 0xa065, 0x0904, 0x22aa, 0x0c18, + 0x2805, 0xa005, 0x01a8, 0xac68, 0xd99c, 0x1128, 0x6808, 0xa422, + 0x680c, 0xa31b, 0x0020, 0x6810, 0xa422, 0x6814, 0xa31b, 0x0620, + 0x2300, 0xa405, 0x0150, 0x8a51, 0x0904, 0x22aa, 0x8840, 0x0c40, + 0x6004, 0xa065, 0x0904, 0x22aa, 0x0830, 0x8a51, 0x0904, 0x22aa, + 0x8840, 0x2805, 0xa005, 0x1158, 0x6004, 0xa065, 0x0904, 0x22aa, + 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x21f9, 0x2805, 0x2040, 0x2b68, + 0x6850, 0xc0fc, 0x6852, 0x0458, 0x8422, 0x8420, 0x831a, 0xa399, + 0x0000, 0x00d6, 0x2b68, 0x6c6e, 0x6b72, 0x00de, 0xd99c, 0x1168, + 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x0a0c, 0x14fa, + 0x6800, 0xa420, 0x6804, 0xa319, 0x0060, 0x6910, 0x2400, 0xa122, + 0x6914, 0x2300, 0xa11b, 0x0a0c, 0x14fa, 0x6800, 0xa420, 0x6804, + 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd, 0x6852, 0x2c00, + 0x681a, 0x2800, 0x6832, 0x2a00, 0x6826, 0x000e, 0x000e, 0x000e, + 0xa006, 0x0028, 0x008e, 0x009e, 0x00ae, 0xa085, 0x0001, 0x0005, + 0x2001, 0x0005, 0x2004, 0xa084, 0x0007, 0x0002, 0x22be, 0x22bf, + 0x22c2, 0x22c5, 0x22ca, 0x22cd, 0x22d2, 0x22d7, 0x0005, 0x080c, + 0x205e, 0x0005, 0x080c, 0x1a86, 0x0005, 0x080c, 0x1a86, 0x080c, + 0x205e, 0x0005, 0x080c, 0x16fc, 0x0005, 0x080c, 0x205e, 0x080c, + 0x16fc, 0x0005, 0x080c, 0x1a86, 0x080c, 0x16fc, 0x0005, 0x080c, + 0x1a86, 0x080c, 0x205e, 0x080c, 0x16fc, 0x0005, 0x0126, 0x2091, + 0x2600, 0x2079, 0x0200, 0x2071, 0xb680, 0x2069, 0xb100, 0x2009, + 0x0004, 0x7912, 0x7817, 0x0004, 0x080c, 0x26d1, 0x781b, 0x0002, + 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a9, 0x0080, 0x782f, 0x0000, + 0x1f04, 0x22f6, 0x20e1, 0x9080, 0x783b, 0x001f, 0x20e1, 0x8700, + 0x012e, 0x0005, 0x0126, 0x2091, 0x2600, 0x781c, 0xd0a4, 0x190c, + 0x23b5, 0xa084, 0x0007, 0x0002, 0x2326, 0x2314, 0x2317, 0x231a, + 0x231f, 0x2321, 0x2323, 0x2325, 0x080c, 0x619d, 0x0078, 0x080c, + 0x61dc, 0x0060, 0x080c, 0x619d, 0x080c, 0x61dc, 0x0038, 0x0041, + 0x0028, 0x0031, 0x0018, 0x0021, 0x0008, 0x0011, 0x012e, 0x0005, + 0x0006, 0x0016, 0x0026, 0x080c, 0xaffa, 0x7930, 0xa184, 0x0003, + 0x0170, 0x2001, 0xb3e8, 0x2004, 0xa005, 0x0130, 0x2001, 0x0133, + 0x2004, 0xa005, 0x090c, 0x14fa, 0x20e1, 0x9040, 0x04a0, 0xa184, + 0x0030, 0x01e0, 0x6a00, 0xa286, 0x0003, 0x1108, 0x00a0, 0x080c, + 0x58d5, 0x1178, 0x2001, 0xb39f, 0x2003, 0x0001, 0x2001, 0xb100, + 0x2003, 0x0001, 0xa085, 0x0001, 0x080c, 0x5919, 0x080c, 0x5816, + 0x0010, 0x080c, 0x4992, 0x20e1, 0x9010, 0x00a8, 0xa184, 0x00c0, + 0x0168, 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0xb419, 0x080c, + 0x1d48, 0x005e, 0x004e, 0x003e, 0x00ee, 0x0028, 0xa184, 0x0300, + 0x0110, 0x20e1, 0x9020, 0x7932, 0x002e, 0x001e, 0x000e, 0x0005, + 0x0016, 0x00e6, 0x00f6, 0x2071, 0xb100, 0x7128, 0x2001, 0xb391, + 0x2102, 0x2001, 0xb399, 0x2102, 0xa182, 0x0211, 0x1218, 0x2009, + 0x0008, 0x0400, 0xa182, 0x0259, 0x1218, 0x2009, 0x0007, 0x00d0, + 0xa182, 0x02c1, 0x1218, 0x2009, 0x0006, 0x00a0, 0xa182, 0x0349, + 0x1218, 0x2009, 0x0005, 0x0070, 0xa182, 0x0421, 0x1218, 0x2009, + 0x0004, 0x0040, 0xa182, 0x0581, 0x1218, 0x2009, 0x0003, 0x0010, + 0x2009, 0x0002, 0x2079, 0x0200, 0x7912, 0x7817, 0x0004, 0x080c, + 0x26d1, 0x00fe, 0x00ee, 0x001e, 0x0005, 0x7938, 0x080c, 0x14fa, + 0x0126, 0x2091, 0x2800, 0x2061, 0x0100, 0x2071, 0xb100, 0x6024, + 0x6026, 0x6053, 0x0030, 0x080c, 0x2710, 0x6050, 0xa084, 0xfe7f, + 0x6052, 0x2009, 0x00ef, 0x6132, 0x6136, 0x080c, 0x2720, 0x60e7, + 0x0000, 0x61ea, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000, + 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x0e9f, 0x601b, 0x001e, + 0x600f, 0x00ff, 0x2001, 0xb38d, 0x2003, 0x00ff, 0x602b, 0x002f, + 0x012e, 0x0005, 0x2001, 0xb131, 0x2003, 0x0000, 0x2001, 0xb130, + 0x2003, 0x0001, 0x0005, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, + 0x0026, 0x6124, 0xa184, 0x1e2c, 0x1118, 0xa184, 0x0007, 0x002a, + 0xa195, 0x0004, 0xa284, 0x0007, 0x0002, 0x2427, 0x240d, 0x2410, + 0x2413, 0x2418, 0x241a, 0x241e, 0x2422, 0x080c, 0x68e7, 0x00b8, + 0x080c, 0x69c2, 0x00a0, 0x080c, 0x69c2, 0x080c, 0x68e7, 0x0078, + 0x0099, 0x0068, 0x080c, 0x68e7, 0x0079, 0x0048, 0x080c, 0x69c2, + 0x0059, 0x0028, 0x080c, 0x69c2, 0x080c, 0x68e7, 0x0029, 0x002e, + 0x001e, 0x000e, 0x012e, 0x0005, 0x6124, 0xd19c, 0x1904, 0x263f, + 0x080c, 0x58d5, 0x0578, 0x7000, 0xa086, 0x0003, 0x0198, 0x6024, + 0xa084, 0x1800, 0x0178, 0x080c, 0x58fb, 0x0118, 0x080c, 0x58e7, + 0x1148, 0x6027, 0x0020, 0x6043, 0x0000, 0x2001, 0xb39e, 0x2003, + 0xaaaa, 0x0458, 0x080c, 0x58fb, 0x15d0, 0x6024, 0xa084, 0x1800, + 0x1108, 0x04a8, 0x2001, 0xb39e, 0x2003, 0xaaaa, 0x2001, 0xb39f, + 0x2003, 0x0001, 0x2001, 0xb100, 0x2003, 0x0001, 0x080c, 0x5816, + 0x0804, 0x263f, 0xd1ac, 0x1518, 0x6024, 0xd0dc, 0x1170, 0xd0e4, + 0x1188, 0xd0d4, 0x11a0, 0xd0cc, 0x0130, 0x7088, 0xa086, 0x0028, + 0x1110, 0x080c, 0x5a64, 0x0804, 0x263f, 0x2001, 0xb39f, 0x2003, + 0x0000, 0x0048, 0x2001, 0xb39f, 0x2003, 0x0002, 0x0020, 0x080c, + 0x59d7, 0x0804, 0x263f, 0x080c, 0x5b04, 0x0804, 0x263f, 0xd1ac, + 0x0904, 0x2587, 0x080c, 0x58d5, 0x11d8, 0x6027, 0x0020, 0x0006, + 0x0026, 0x0036, 0x080c, 0x58f1, 0x1170, 0x2001, 0xb39f, 0x2003, + 0x0001, 0x2001, 0xb100, 0x2003, 0x0001, 0x080c, 0x5816, 0x003e, + 0x002e, 0x000e, 0x0005, 0x003e, 0x002e, 0x000e, 0x080c, 0x58ac, + 0x0016, 0x0046, 0x00c6, 0x644c, 0xa486, 0xf0f0, 0x1138, 0x2061, + 0x0100, 0x644a, 0x6043, 0x0090, 0x6043, 0x0010, 0x74ca, 0xa48c, + 0xff00, 0x7034, 0xd084, 0x0178, 0xa186, 0xf800, 0x1160, 0x7038, + 0xd084, 0x1148, 0xc085, 0x703a, 0x0036, 0x2418, 0x2011, 0x8016, + 0x080c, 0x3d5b, 0x003e, 0xa196, 0xff00, 0x05b8, 0x7050, 0xa084, + 0x00ff, 0x810f, 0xa116, 0x0588, 0x7130, 0xd184, 0x1570, 0x2011, + 0xb153, 0x2214, 0xd2ec, 0x0138, 0xc18d, 0x7132, 0x2011, 0xb153, + 0x2214, 0xd2ac, 0x1510, 0x6240, 0xa294, 0x0010, 0x0130, 0x6248, + 0xa294, 0xff00, 0xa296, 0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904, + 0x2552, 0x7034, 0xd08c, 0x1140, 0x2001, 0xb10c, 0x200c, 0xd1ac, + 0x1904, 0x2552, 0xc1ad, 0x2102, 0x0036, 0x73c8, 0x2011, 0x8013, + 0x080c, 0x3d5b, 0x003e, 0x0804, 0x2552, 0x7034, 0xd08c, 0x1140, + 0x2001, 0xb10c, 0x200c, 0xd1ac, 0x1904, 0x2552, 0xc1ad, 0x2102, + 0x0036, 0x73c8, 0x2011, 0x8013, 0x080c, 0x3d5b, 0x003e, 0x7130, + 0xc185, 0x7132, 0x2011, 0xb153, 0x220c, 0xd1a4, 0x01d0, 0x0016, + 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x688d, 0x2019, 0x000e, + 0x080c, 0xac2b, 0xa484, 0x00ff, 0xa080, 0x2c8c, 0x200d, 0xa18c, + 0xff00, 0x810f, 0x8127, 0xa006, 0x2009, 0x000e, 0x080c, 0xacae, + 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0000, 0x2019, 0x0004, + 0x080c, 0x2b46, 0x001e, 0x0070, 0x0156, 0x20a9, 0x007f, 0x2009, + 0x0000, 0x080c, 0x4e21, 0x1110, 0x080c, 0x4a80, 0x8108, 0x1f04, + 0x2549, 0x015e, 0x00ce, 0x004e, 0x2011, 0x0003, 0x080c, 0x7d52, + 0x2011, 0x0002, 0x080c, 0x7d5c, 0x080c, 0x7c41, 0x080c, 0x67b6, + 0x0036, 0x2019, 0x0000, 0x080c, 0x7cc4, 0x003e, 0x60e3, 0x0000, + 0x001e, 0x2001, 0xb100, 0x2014, 0xa296, 0x0004, 0x1128, 0xd19c, + 0x1118, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0xb122, + 0x2003, 0x0000, 0x6027, 0x0020, 0x080c, 0x58fb, 0x1140, 0x0016, + 0x2009, 0x07d0, 0x2011, 0x57f7, 0x080c, 0x67c8, 0x001e, 0xd194, + 0x0904, 0x263f, 0x0016, 0x6220, 0xd2b4, 0x0904, 0x25f0, 0x080c, + 0x67b6, 0x080c, 0x7a8c, 0x6027, 0x0004, 0x00f6, 0x2019, 0xb3e2, + 0x2304, 0xa07d, 0x0570, 0x7804, 0xa086, 0x0032, 0x1550, 0x00d6, + 0x00c6, 0x00e6, 0x2069, 0x0140, 0x618c, 0x6288, 0x7818, 0x608e, + 0x7808, 0x608a, 0x6043, 0x0002, 0x2001, 0x0003, 0x8001, 0x1df0, + 0x6043, 0x0000, 0x6803, 0x1000, 0x6803, 0x0000, 0x618e, 0x628a, + 0x080c, 0x6dc1, 0x080c, 0x6e9e, 0x7810, 0x2070, 0x7037, 0x0103, + 0x2f60, 0x080c, 0x82eb, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e, + 0x0005, 0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, + 0x0120, 0x6803, 0x1000, 0x6803, 0x0000, 0x00de, 0x00c6, 0x2061, + 0xb3d9, 0x6028, 0xa09a, 0x00c8, 0x1238, 0x8000, 0x602a, 0x00ce, + 0x080c, 0x7a7f, 0x0804, 0x263e, 0x2019, 0xb3e2, 0x2304, 0xa065, + 0x0120, 0x2009, 0x0027, 0x080c, 0x831a, 0x00ce, 0x0804, 0x263e, + 0xd2bc, 0x0904, 0x263e, 0x080c, 0x67c3, 0x6014, 0xa084, 0x0184, + 0xa085, 0x0010, 0x6016, 0x6027, 0x0004, 0x00d6, 0x2069, 0x0140, + 0x6804, 0xa084, 0x4000, 0x0120, 0x6803, 0x1000, 0x6803, 0x0000, + 0x00de, 0x00c6, 0x2061, 0xb3d9, 0x6044, 0xa09a, 0x00c8, 0x12f0, + 0x8000, 0x6046, 0x603c, 0x00ce, 0xa005, 0x0540, 0x2009, 0x07d0, + 0x080c, 0x67bb, 0xa080, 0x0007, 0x2004, 0xa086, 0x0006, 0x1138, + 0x6114, 0xa18c, 0x0184, 0xa18d, 0x0012, 0x6116, 0x00b8, 0x6114, + 0xa18c, 0x0184, 0xa18d, 0x0016, 0x6116, 0x0080, 0x0036, 0x2019, + 0x0001, 0x080c, 0x7cc4, 0x003e, 0x2019, 0xb3e8, 0x2304, 0xa065, + 0x0120, 0x2009, 0x004f, 0x080c, 0x831a, 0x00ce, 0x001e, 0xd19c, + 0x0904, 0x269a, 0x7034, 0xd0ac, 0x1560, 0x0016, 0x0156, 0x6027, + 0x0008, 0x602f, 0x0020, 0x20a9, 0x0006, 0x1d04, 0x264d, 0x2091, + 0x6000, 0x1f04, 0x264d, 0x602f, 0x0000, 0x6150, 0xa185, 0x1400, + 0x6052, 0x20a9, 0x0366, 0x1d04, 0x265b, 0x2091, 0x6000, 0x6020, + 0xd09c, 0x1130, 0x015e, 0x6152, 0x001e, 0x6027, 0x0008, 0x0490, + 0x080c, 0x27e0, 0x1f04, 0x265b, 0x015e, 0x6152, 0x001e, 0x6027, + 0x0008, 0x0016, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x080c, + 0x7d52, 0x2011, 0x0002, 0x080c, 0x7d5c, 0x080c, 0x7c41, 0x080c, + 0x67b6, 0x0036, 0x2019, 0x0000, 0x080c, 0x7cc4, 0x003e, 0x60e3, + 0x0000, 0x080c, 0xafd9, 0x080c, 0xaff4, 0xa085, 0x0001, 0x080c, + 0x5919, 0x2001, 0xb100, 0x2003, 0x0004, 0x6027, 0x0008, 0x080c, + 0x12d0, 0x001e, 0xa18c, 0xffd0, 0x6126, 0x0005, 0x0006, 0x0016, + 0x0026, 0x00e6, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2071, 0xb100, + 0x71c0, 0x70c2, 0xa116, 0x01f0, 0x81ff, 0x0128, 0x2011, 0x8011, + 0x080c, 0x3d5b, 0x00b8, 0x2011, 0x8012, 0x080c, 0x3d5b, 0x2001, + 0xb172, 0x2004, 0xd0fc, 0x1170, 0x0036, 0x00c6, 0x080c, 0x276b, + 0x2061, 0x0100, 0x2019, 0x0028, 0x2009, 0x0000, 0x080c, 0x2b46, + 0x00ce, 0x003e, 0x012e, 0x00fe, 0x00ee, 0x002e, 0x001e, 0x000e, + 0x0005, 0x00c6, 0x00f6, 0x0006, 0x0026, 0x2061, 0x0100, 0xa190, + 0x26e4, 0x2205, 0x60f2, 0x2011, 0x26f1, 0x2205, 0x60ee, 0x002e, + 0x000e, 0x00fe, 0x00ce, 0x0005, 0x0840, 0x0840, 0x0840, 0x0580, + 0x0420, 0x0348, 0x02c0, 0x0258, 0x0210, 0x01a8, 0x01a8, 0x01a8, + 0x01a8, 0x0140, 0x00f8, 0x00d0, 0x00b0, 0x00a0, 0x2028, 0xa18c, + 0x00ff, 0x2130, 0xa094, 0xff00, 0x1110, 0x81ff, 0x0118, 0x080c, + 0x646d, 0x0038, 0xa080, 0x2c8c, 0x200d, 0xa18c, 0xff00, 0x810f, + 0xa006, 0x0005, 0xa080, 0x2c8c, 0x200d, 0xa18c, 0x00ff, 0x0005, + 0x00d6, 0x2069, 0x0140, 0x2001, 0xb114, 0x2003, 0x00ef, 0x20a9, + 0x0010, 0xa006, 0x6852, 0x6856, 0x1f04, 0x271b, 0x00de, 0x0005, + 0x0006, 0x00d6, 0x0026, 0x2069, 0x0140, 0x2001, 0xb114, 0x2102, + 0x8114, 0x8214, 0x8214, 0x8214, 0x20a9, 0x0010, 0x6853, 0x0000, + 0xa006, 0x82ff, 0x1128, 0xa184, 0x000f, 0xa080, 0xb008, 0x2005, + 0x6856, 0x8211, 0x1f04, 0x2730, 0x002e, 0x00de, 0x000e, 0x0005, + 0x00c6, 0x2061, 0xb100, 0x6030, 0x0110, 0xc09d, 0x0008, 0xc09c, + 0x6032, 0x00ce, 0x0005, 0x0156, 0x00d6, 0x0026, 0x0016, 0x0006, + 0x2069, 0x0140, 0x6980, 0xa116, 0x0180, 0xa112, 0x1230, 0x8212, + 0x8210, 0x22a8, 0x2001, 0x0402, 0x0018, 0x22a8, 0x2001, 0x0404, + 0x680e, 0x1f04, 0x2760, 0x680f, 0x0000, 0x000e, 0x001e, 0x002e, + 0x00de, 0x015e, 0x0005, 0x2001, 0xb153, 0x2004, 0xd0c4, 0x0150, + 0xd0a4, 0x0140, 0xa006, 0x0046, 0x2020, 0x2009, 0x002e, 0x080c, + 0xacae, 0x004e, 0x0005, 0x00f6, 0x0016, 0x0026, 0x2079, 0x0140, + 0x78c4, 0xd0dc, 0x0548, 0xa084, 0x0700, 0xa08e, 0x0300, 0x1520, + 0x2011, 0x0000, 0x2009, 0x0002, 0x2300, 0xa080, 0x0020, 0x2018, + 0x2300, 0x080c, 0x68b3, 0x2011, 0x0030, 0x2200, 0x8007, 0xa085, + 0x004c, 0x78c2, 0x2009, 0x0204, 0x210c, 0x2200, 0xa100, 0x2009, + 0x0138, 0x200a, 0x080c, 0x58d5, 0x1118, 0x2009, 0xb38f, 0x200a, + 0x002e, 0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000, 0x0cc8, 0x0126, + 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x2001, 0x0170, 0x200c, + 0x8000, 0x2014, 0xa184, 0x0003, 0x0110, 0x0804, 0x1a84, 0x002e, + 0x001e, 0x000e, 0x012e, 0x0005, 0x0006, 0x2001, 0x0100, 0x2004, + 0xa082, 0x0005, 0x000e, 0x0268, 0x2001, 0x0170, 0x200c, 0xa18c, + 0x00ff, 0xa18e, 0x004c, 0x1128, 0x200c, 0xa18c, 0xff00, 0x810f, + 0x0010, 0x2009, 0x0000, 0x2001, 0x0204, 0x2004, 0xa108, 0x0005, + 0x0006, 0x0156, 0x00f6, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, + 0xd08c, 0x1110, 0x1f04, 0x27e7, 0x00fe, 0x015e, 0x000e, 0x0005, + 0x0016, 0x00c6, 0x0006, 0x2061, 0x0100, 0x6030, 0x0006, 0x6048, + 0x0006, 0x60e4, 0x0006, 0x60e8, 0x0006, 0x6050, 0x0006, 0x60f0, + 0x0006, 0x60ec, 0x0006, 0x600c, 0x0006, 0x6004, 0x0006, 0x6028, + 0x0006, 0x60e0, 0x0006, 0x602f, 0x0100, 0x602f, 0x0000, 0xe000, + 0xe000, 0xe000, 0xe000, 0x602f, 0x0040, 0x602f, 0x0000, 0x000e, + 0x60e2, 0x000e, 0x602a, 0x000e, 0x6006, 0x000e, 0x600e, 0x000e, + 0x60ee, 0x000e, 0x60f2, 0x000e, 0x6052, 0x000e, 0x60ea, 0x000e, + 0x60e6, 0x000e, 0x604a, 0x000e, 0x6032, 0x6036, 0x2008, 0x080c, + 0x2720, 0x000e, 0x00ce, 0x001e, 0x0005, 0x2009, 0x0171, 0x2104, + 0xd0dc, 0x0140, 0x2009, 0x0170, 0x2104, 0x200b, 0x0080, 0xe000, + 0xe000, 0x200a, 0x0005, 0x28d3, 0x28d7, 0x28db, 0x28e1, 0x28e7, + 0x28ed, 0x28f3, 0x28fb, 0x2903, 0x2909, 0x290f, 0x2917, 0x291f, + 0x2927, 0x292f, 0x2939, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, + 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, + 0x2986, 0x2986, 0x2986, 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, + 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, + 0x2943, 0x2943, 0x2943, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, + 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, + 0x2986, 0x2986, 0x2986, 0x2945, 0x2945, 0x294b, 0x294b, 0x2952, + 0x2952, 0x2959, 0x2959, 0x2962, 0x2962, 0x2969, 0x2969, 0x2972, + 0x2972, 0x297b, 0x297b, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, + 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, + 0x2986, 0x2986, 0x2986, 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, + 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, + 0x2943, 0x2943, 0x2943, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, + 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, 0x2986, + 0x2986, 0x2986, 0x2986, 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, + 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, 0x2943, + 0x2943, 0x2943, 0x2943, 0x0106, 0x0006, 0x0804, 0x298e, 0x0106, + 0x0006, 0x0804, 0x298e, 0x0106, 0x0006, 0x080c, 0x23f3, 0x0804, + 0x298e, 0x0106, 0x0006, 0x080c, 0x23f3, 0x0804, 0x298e, 0x0106, + 0x0006, 0x080c, 0x22b0, 0x0804, 0x298e, 0x0106, 0x0006, 0x080c, + 0x22b0, 0x0804, 0x298e, 0x0106, 0x0006, 0x080c, 0x23f3, 0x080c, + 0x22b0, 0x0804, 0x298e, 0x0106, 0x0006, 0x080c, 0x23f3, 0x080c, + 0x22b0, 0x0804, 0x298e, 0x0106, 0x0006, 0x080c, 0x2302, 0x0804, + 0x298e, 0x0106, 0x0006, 0x080c, 0x2302, 0x0804, 0x298e, 0x0106, + 0x0006, 0x080c, 0x23f3, 0x080c, 0x2302, 0x0804, 0x298e, 0x0106, + 0x0006, 0x080c, 0x23f3, 0x080c, 0x2302, 0x0804, 0x298e, 0x0106, + 0x0006, 0x080c, 0x22b0, 0x080c, 0x2302, 0x0804, 0x298e, 0x0106, + 0x0006, 0x080c, 0x22b0, 0x080c, 0x2302, 0x0804, 0x298e, 0x0106, + 0x0006, 0x080c, 0x23f3, 0x080c, 0x22b0, 0x080c, 0x2302, 0x0804, + 0x298e, 0x0106, 0x0006, 0x080c, 0x23f3, 0x080c, 0x22b0, 0x080c, + 0x2302, 0x0804, 0x298e, 0xe000, 0x0cf0, 0x0106, 0x0006, 0x080c, + 0x27af, 0x0804, 0x298e, 0x0106, 0x0006, 0x080c, 0x27af, 0x080c, + 0x23f3, 0x04e0, 0x0106, 0x0006, 0x080c, 0x27af, 0x080c, 0x22b0, + 0x04a8, 0x0106, 0x0006, 0x080c, 0x27af, 0x080c, 0x23f3, 0x080c, + 0x22b0, 0x0460, 0x0106, 0x0006, 0x080c, 0x27af, 0x080c, 0x2302, + 0x0428, 0x0106, 0x0006, 0x080c, 0x27af, 0x080c, 0x23f3, 0x080c, + 0x2302, 0x00e0, 0x0106, 0x0006, 0x080c, 0x27af, 0x080c, 0x22b0, + 0x080c, 0x2302, 0x0098, 0x0106, 0x0006, 0x080c, 0x27af, 0x080c, + 0x23f3, 0x080c, 0x22b0, 0x080c, 0x2302, 0x0040, 0x20d1, 0x0000, + 0x20d1, 0x0001, 0x20d1, 0x0000, 0x080c, 0x14fa, 0x000e, 0x010e, + 0x000d, 0x00c6, 0x0026, 0x0046, 0x2021, 0x0000, 0x080c, 0x517b, + 0x1904, 0x2a6e, 0x72d0, 0x2001, 0xb39e, 0x2004, 0xa005, 0x1110, + 0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904, 0x2a6e, 0x080c, + 0x2a72, 0x0804, 0x2a6e, 0xd2cc, 0x1904, 0x2a6e, 0x080c, 0x58d5, + 0x1120, 0x709b, 0xffff, 0x0804, 0x2a6e, 0xd294, 0x0120, 0x709b, + 0xffff, 0x0804, 0x2a6e, 0x2001, 0xb114, 0x203c, 0x7284, 0xd284, + 0x0904, 0x2a10, 0xd28c, 0x1904, 0x2a10, 0x0036, 0x7398, 0xa38e, + 0xffff, 0x1110, 0x2019, 0x0001, 0x8314, 0xa2e0, 0xb7c0, 0x2c04, + 0xa38c, 0x0001, 0x0120, 0xa084, 0xff00, 0x8007, 0x0010, 0xa084, + 0x00ff, 0xa70e, 0x0560, 0xa08e, 0x0000, 0x0548, 0xa08e, 0x00ff, + 0x1150, 0x7230, 0xd284, 0x1538, 0x7284, 0xc28d, 0x7286, 0x709b, + 0xffff, 0x003e, 0x0428, 0x2009, 0x0000, 0x080c, 0x26f6, 0x080c, + 0x4dc5, 0x11b8, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1150, + 0x7030, 0xd08c, 0x0118, 0x6000, 0xd0bc, 0x0120, 0x080c, 0x2a85, + 0x0140, 0x0028, 0x080c, 0x2bb4, 0x080c, 0x2ab3, 0x0110, 0x8318, + 0x0818, 0x739a, 0x0010, 0x709b, 0xffff, 0x003e, 0x0804, 0x2a6e, + 0xa780, 0x2c8c, 0x203d, 0xa7bc, 0xff00, 0x873f, 0x2041, 0x007e, + 0x7098, 0xa096, 0xffff, 0x1120, 0x2009, 0x0000, 0x28a8, 0x0050, + 0xa812, 0x0220, 0x2008, 0xa802, 0x20a8, 0x0020, 0x709b, 0xffff, + 0x0804, 0x2a6e, 0x2700, 0x0156, 0x0016, 0xa106, 0x05a0, 0xc484, + 0x080c, 0x4e21, 0x0120, 0x080c, 0x4dc5, 0x15a8, 0x0008, 0xc485, + 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1130, 0x7030, 0xd08c, + 0x01e8, 0x6000, 0xd0bc, 0x11d0, 0x7284, 0xd28c, 0x0188, 0x6004, + 0xa084, 0x00ff, 0xa082, 0x0006, 0x02b0, 0xd484, 0x1118, 0x080c, + 0x4de4, 0x0028, 0x080c, 0x2c41, 0x0170, 0x080c, 0x2c6e, 0x0058, + 0x080c, 0x2bb4, 0x080c, 0x2ab3, 0x0170, 0x0028, 0x080c, 0x2c41, + 0x0110, 0x0419, 0x0140, 0x001e, 0x8108, 0x015e, 0x1f04, 0x2a2a, + 0x709b, 0xffff, 0x0018, 0x001e, 0x015e, 0x719a, 0x004e, 0x002e, + 0x00ce, 0x0005, 0x00c6, 0x0016, 0x709b, 0x0001, 0x2009, 0x007e, + 0x080c, 0x4dc5, 0x1138, 0x080c, 0x2bb4, 0x04a9, 0x0118, 0x70d0, + 0xc0bd, 0x70d2, 0x001e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6, + 0x00c6, 0x2c68, 0x2001, 0xb157, 0x2004, 0xa084, 0x00ff, 0x6842, + 0x080c, 0x9ae4, 0x01d8, 0x2d00, 0x601a, 0x080c, 0x9c35, 0x601f, + 0x0001, 0x2001, 0x0000, 0x080c, 0x4d63, 0x2001, 0x0000, 0x080c, + 0x4d75, 0x0126, 0x2091, 0x8000, 0x7094, 0x8000, 0x7096, 0x012e, + 0x2009, 0x0004, 0x080c, 0x831a, 0xa085, 0x0001, 0x00ce, 0x00de, + 0x007e, 0x001e, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2c68, + 0x2001, 0xb157, 0x2004, 0xa084, 0x00ff, 0x6842, 0x080c, 0x9ae4, + 0x0550, 0x2d00, 0x601a, 0x6800, 0xc0c4, 0x6802, 0x68a0, 0xa086, + 0x007e, 0x0140, 0x6804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1110, + 0x080c, 0x2b73, 0x080c, 0x9c35, 0x601f, 0x0001, 0x2001, 0x0000, + 0x080c, 0x4d63, 0x2001, 0x0002, 0x080c, 0x4d75, 0x0126, 0x2091, + 0x8000, 0x7094, 0x8000, 0x7096, 0x012e, 0x2009, 0x0002, 0x080c, + 0x831a, 0xa085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, + 0x00c6, 0x0026, 0x2009, 0x0080, 0x080c, 0x4dc5, 0x1120, 0x0031, + 0x0110, 0x70d7, 0xffff, 0x002e, 0x00ce, 0x0005, 0x0016, 0x0076, + 0x00d6, 0x00c6, 0x2c68, 0x080c, 0x8295, 0x01d8, 0x2d00, 0x601a, + 0x080c, 0x9c35, 0x601f, 0x0001, 0x2001, 0x0000, 0x080c, 0x4d63, + 0x2001, 0x0002, 0x080c, 0x4d75, 0x0126, 0x2091, 0x8000, 0x70d8, + 0x8000, 0x70da, 0x012e, 0x2009, 0x0002, 0x080c, 0x831a, 0xa085, + 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x00d6, + 0x0126, 0x2091, 0x8000, 0x2009, 0x007f, 0x080c, 0x4dc5, 0x1190, + 0x2c68, 0x080c, 0x8295, 0x0170, 0x2d00, 0x601a, 0x6312, 0x601f, + 0x0001, 0x620a, 0x080c, 0x9c35, 0x2009, 0x0022, 0x080c, 0x831a, + 0xa085, 0x0001, 0x012e, 0x00de, 0x00ce, 0x0005, 0x00e6, 0x00c6, + 0x0066, 0x0036, 0x0026, 0x080c, 0x6b41, 0x080c, 0x6aeb, 0x080c, + 0x8cc4, 0x2130, 0x81ff, 0x0128, 0x20a9, 0x007e, 0x2009, 0x0000, + 0x0020, 0x20a9, 0x007f, 0x2009, 0x0000, 0x0016, 0x080c, 0x4e21, + 0x1120, 0x080c, 0x501c, 0x080c, 0x4a80, 0x001e, 0x8108, 0x1f04, + 0x2b5d, 0x86ff, 0x1110, 0x080c, 0x11d8, 0x002e, 0x003e, 0x006e, + 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, + 0x6218, 0x2270, 0x72a0, 0x0026, 0x2019, 0x0029, 0x080c, 0x6b35, + 0x0076, 0x2039, 0x0000, 0x080c, 0x6a6b, 0x2c08, 0x080c, 0xaa51, + 0x007e, 0x001e, 0x2e60, 0x080c, 0x501c, 0x6210, 0x6314, 0x080c, + 0x4a80, 0x6212, 0x6316, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, + 0x0005, 0x00e6, 0x0006, 0x6018, 0xa080, 0x0028, 0x2004, 0xa086, + 0x0080, 0x0150, 0x2071, 0xb100, 0x7094, 0xa005, 0x0110, 0x8001, + 0x7096, 0x000e, 0x00ee, 0x0005, 0x2071, 0xb100, 0x70d8, 0xa005, + 0x0dc0, 0x8001, 0x70da, 0x0ca8, 0x6000, 0xc08c, 0x6002, 0x0005, + 0x00f6, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x0156, 0x2178, + 0x81ff, 0x1118, 0x20a9, 0x0001, 0x0098, 0x2001, 0xb153, 0x2004, + 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0xa006, 0x0046, 0x2020, 0x2009, + 0x002d, 0x080c, 0xacae, 0x004e, 0x20a9, 0x00ff, 0x2011, 0x0000, + 0x0026, 0xa28e, 0x007e, 0x0904, 0x2c20, 0xa28e, 0x007f, 0x0904, + 0x2c20, 0xa28e, 0x0080, 0x05e0, 0xa288, 0xb235, 0x210c, 0x81ff, + 0x05b8, 0x8fff, 0x1148, 0x2001, 0xb3bd, 0x0006, 0x2003, 0x0001, + 0x04d9, 0x000e, 0x2003, 0x0000, 0x00c6, 0x2160, 0x2001, 0x0001, + 0x080c, 0x5185, 0x00ce, 0x2019, 0x0029, 0x080c, 0x6b35, 0x0076, + 0x2039, 0x0000, 0x080c, 0x6a6b, 0x00c6, 0x0026, 0x2160, 0x6204, + 0xa294, 0x00ff, 0xa286, 0x0006, 0x1118, 0x6007, 0x0404, 0x0028, + 0x2001, 0x0004, 0x8007, 0xa215, 0x6206, 0x002e, 0x00ce, 0x0016, + 0x2c08, 0x080c, 0xaa51, 0x001e, 0x007e, 0x2160, 0x080c, 0x501c, + 0x002e, 0x8210, 0x1f04, 0x2bd8, 0x015e, 0x001e, 0x002e, 0x003e, + 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046, 0x0026, 0x0016, 0x2001, + 0xb153, 0x2004, 0xd0c4, 0x0148, 0xd0a4, 0x0138, 0xa006, 0x2220, + 0x8427, 0x2009, 0x0029, 0x080c, 0xacae, 0x001e, 0x002e, 0x004e, + 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7284, 0x82ff, 0x01f8, + 0x2011, 0xb153, 0x2214, 0xd2ac, 0x11d0, 0x2100, 0x080c, 0x270a, + 0x81ff, 0x01b8, 0x2019, 0x0001, 0x8314, 0xa2e0, 0xb7c0, 0x2c04, + 0xd384, 0x0120, 0xa084, 0xff00, 0x8007, 0x0010, 0xa084, 0x00ff, + 0xa116, 0x0138, 0xa096, 0x00ff, 0x0110, 0x8318, 0x0c68, 0xa085, + 0x0001, 0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0016, 0x00c6, + 0x0126, 0x2091, 0x8000, 0xa180, 0xb235, 0x2004, 0xa065, 0x0158, + 0x0016, 0x00c6, 0x2061, 0xb4e4, 0x001e, 0x611a, 0x080c, 0x2b73, + 0x001e, 0x080c, 0x4de4, 0x012e, 0x00ce, 0x001e, 0x0005, 0x2001, + 0xb134, 0x2004, 0xd0cc, 0x0005, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, + 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, + 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, + 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9, + 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad, + 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3, + 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690, 0x658f, + 0x6488, 0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a, 0x8079, + 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d, + 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863, + 0x575c, 0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353, 0x5252, + 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047, + 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35, + 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c, 0x452b, + 0x442a, 0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e, + 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004, + 0x3902, 0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600, 0x8000, + 0x3500, 0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000, 0x8000, + 0x8000, 0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000, 0x8000, + 0x8000, 0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00, + 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00, + 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600, 0x2500, + 0x2400, 0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00, + 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000, + 0x1900, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x1800, + 0x8000, 0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300, 0x1200, + 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00, + 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000, + 0x0600, 0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000, + 0x0200, 0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000, + 0x8000, 0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, + 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, + 0x8000, 0x8000, 0x8000, 0x8000, 0x2071, 0xb182, 0x7003, 0x0002, + 0xa006, 0x7012, 0x7016, 0x703a, 0x703e, 0x7033, 0xb192, 0x7037, + 0xb192, 0x7007, 0x0001, 0x2061, 0xb1d2, 0x6003, 0x0002, 0x0005, + 0x1004, 0x2db2, 0x0e04, 0x2db2, 0x2071, 0xb182, 0x2b78, 0x7818, + 0xd084, 0x1140, 0x2a60, 0x7820, 0xa08e, 0x0069, 0x1904, 0x2e97, + 0x0804, 0x2e30, 0x0005, 0x2071, 0xb182, 0x7004, 0x0002, 0x2dbb, + 0x2dbc, 0x2dc5, 0x2dd6, 0x0005, 0x1004, 0x2dc4, 0x0e04, 0x2dc4, + 0x2b78, 0x7818, 0xd084, 0x01e8, 0x0005, 0x2b78, 0x2061, 0xb1d2, + 0x6008, 0xa08e, 0x0100, 0x0128, 0xa086, 0x0200, 0x0904, 0x2e91, + 0x0005, 0x7014, 0x2068, 0x2a60, 0x7018, 0x0807, 0x7010, 0x2068, + 0x6834, 0xa086, 0x0103, 0x0108, 0x0005, 0x2a60, 0x2b78, 0x7018, + 0x0807, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x1210, 0x61c0, 0x0042, + 0x2100, 0xa08a, 0x003f, 0x1a04, 0x2e8e, 0x61c0, 0x0804, 0x2e30, + 0x2e72, 0x2e9d, 0x2ea5, 0x2ea9, 0x2eb1, 0x2eb7, 0x2ebb, 0x2ec7, + 0x2eca, 0x2ed4, 0x2ed7, 0x2e8e, 0x2e8e, 0x2e8e, 0x2eda, 0x2e8e, + 0x2ee9, 0x2f00, 0x2f17, 0x2f8e, 0x2f93, 0x2fbc, 0x300d, 0x301e, + 0x303d, 0x3075, 0x307f, 0x308c, 0x309f, 0x30c0, 0x30c9, 0x30ff, + 0x3105, 0x2e8e, 0x312e, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, + 0x3135, 0x313f, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, + 0x2e8e, 0x2e8e, 0x3147, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, + 0x3159, 0x3161, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, + 0x0002, 0x318b, 0x31df, 0x323a, 0x324d, 0x2e8e, 0x3267, 0x368e, + 0x40ba, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, + 0x2e8e, 0x2ed4, 0x2ed7, 0x3690, 0x2e8e, 0x369d, 0x414a, 0x41a5, + 0x4209, 0x2e8e, 0x4268, 0x428e, 0x42ad, 0x42df, 0x2e8e, 0x2e8e, + 0x2e8e, 0x36a1, 0x3842, 0x385c, 0x387a, 0x38db, 0x393b, 0x3946, + 0x397e, 0x398d, 0x399c, 0x399f, 0x39c2, 0x3a0c, 0x3a84, 0x3a91, + 0x3b92, 0x3cb2, 0x3cdb, 0x3dd9, 0x3dfb, 0x3e07, 0x3e40, 0x3f04, + 0x2e8e, 0x2e8e, 0x2e8e, 0x2e8e, 0x3f6c, 0x3f87, 0x3ff9, 0x40ab, + 0x713c, 0x0000, 0x2021, 0x4000, 0x080c, 0x3d38, 0x0126, 0x2091, + 0x8000, 0x0e04, 0x2e7e, 0x7818, 0xd084, 0x0110, 0x012e, 0x0cb0, + 0x7c22, 0x7926, 0x7a2a, 0x7b2e, 0x781b, 0x0001, 0x2091, 0x4080, + 0x7007, 0x0001, 0x2091, 0x5000, 0x012e, 0x0005, 0x2021, 0x4001, + 0x0c18, 0x2021, 0x4002, 0x0c00, 0x2021, 0x4003, 0x08e8, 0x2021, + 0x4005, 0x08d0, 0x2021, 0x4006, 0x08b8, 0xa02e, 0x2520, 0x7b28, + 0x7a2c, 0x7824, 0x7930, 0x0804, 0x3d45, 0x7823, 0x0004, 0x7824, + 0x0807, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0804, + 0x3d48, 0x7924, 0x7828, 0x2114, 0x200a, 0x0804, 0x2e72, 0x7924, + 0x2114, 0x0804, 0x2e72, 0x2099, 0x0009, 0x20a1, 0x0009, 0x20a9, + 0x0007, 0x53a3, 0x7924, 0x7a28, 0x7b2c, 0x0804, 0x2e72, 0x7824, + 0x2060, 0x0090, 0x2009, 0x0002, 0x2011, 0x0001, 0x2019, 0x0022, + 0x783b, 0x0017, 0x0804, 0x2e72, 0x7d38, 0x7c3c, 0x0840, 0x7d38, + 0x7c3c, 0x0888, 0x2061, 0x1000, 0xe10c, 0xa006, 0x2c15, 0xa200, + 0x8c60, 0x8109, 0x1dd8, 0x2010, 0xa005, 0x0904, 0x2e72, 0x0804, + 0x2e94, 0x2069, 0xb152, 0x7824, 0x7930, 0xa11a, 0x1a04, 0x2e9a, + 0x8019, 0x0904, 0x2e9a, 0x684a, 0x6942, 0x782c, 0x6852, 0x7828, + 0x6856, 0xa006, 0x685a, 0x685e, 0x080c, 0x5ba6, 0x0804, 0x2e72, + 0x2069, 0xb152, 0x7824, 0x7934, 0xa11a, 0x1a04, 0x2e9a, 0x8019, + 0x0904, 0x2e9a, 0x684e, 0x6946, 0x782c, 0x6862, 0x7828, 0x6866, + 0xa006, 0x686a, 0x686e, 0x080c, 0x523e, 0x0804, 0x2e72, 0xa02e, + 0x2520, 0x81ff, 0x1904, 0x2e97, 0x7924, 0x7b28, 0x7a2c, 0x20a9, + 0x0005, 0x20a1, 0xb189, 0x41a1, 0x080c, 0x3d04, 0x0904, 0x2e97, + 0x2009, 0x0020, 0x080c, 0x3d45, 0x701b, 0x2f2f, 0x0005, 0x6834, + 0x2008, 0xa084, 0x00ff, 0xa096, 0x0011, 0x0120, 0xa096, 0x0019, + 0x1904, 0x2e97, 0x810f, 0xa18c, 0x00ff, 0x0904, 0x2e97, 0x710e, + 0x700c, 0x8001, 0x0528, 0x700e, 0x080c, 0x3d04, 0x0904, 0x2e97, + 0x2009, 0x0020, 0x2061, 0xb1d2, 0x6224, 0x6328, 0x642c, 0x6530, + 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, + 0x080c, 0x3d45, 0x701b, 0x2f5d, 0x0005, 0x6834, 0xa084, 0x00ff, + 0xa096, 0x0002, 0x0120, 0xa096, 0x000a, 0x1904, 0x2e97, 0x08c0, + 0x7010, 0x2068, 0x6838, 0xc0fd, 0x683a, 0x080c, 0x4cc1, 0x1128, + 0x7007, 0x0003, 0x701b, 0x2f77, 0x0005, 0x080c, 0x5344, 0x0126, + 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099, 0xb189, 0x530a, 0x2100, + 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0xad80, + 0x000d, 0x2009, 0x0020, 0x012e, 0x0804, 0x3d48, 0x61a8, 0x7824, + 0x60aa, 0x0804, 0x2e72, 0x2091, 0x8000, 0x7823, 0x4000, 0x7827, + 0x4953, 0x782b, 0x5020, 0x782f, 0x2020, 0x2009, 0x017f, 0x2104, + 0x7832, 0x3f00, 0x7836, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200, + 0x603c, 0x8007, 0xa205, 0x783a, 0x2009, 0x04fd, 0x2104, 0x783e, + 0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2071, 0x0010, + 0x20c1, 0x00f0, 0x0804, 0x0427, 0x81ff, 0x1904, 0x2e97, 0x7924, + 0x810f, 0xa18c, 0x00ff, 0x080c, 0x4e21, 0x1904, 0x2e9a, 0x7e38, + 0xa684, 0x3fff, 0xa082, 0x4000, 0x0210, 0x0804, 0x2e9a, 0x7c28, + 0x7d2c, 0x080c, 0x4fe3, 0xd28c, 0x1118, 0x080c, 0x4f8e, 0x0010, + 0x080c, 0x4fbc, 0x1518, 0x2061, 0xb800, 0x0126, 0x2091, 0x8000, + 0x6000, 0xa086, 0x0000, 0x0148, 0x6010, 0xa06d, 0x0130, 0x683c, + 0xa406, 0x1118, 0x6840, 0xa506, 0x0150, 0x012e, 0xace0, 0x0018, + 0x2001, 0xb116, 0x2004, 0xac02, 0x1a04, 0x2e97, 0x0c30, 0x080c, + 0x955c, 0x012e, 0x0904, 0x2e97, 0x0804, 0x2e72, 0xa00e, 0x2001, + 0x0005, 0x080c, 0x5344, 0x0126, 0x2091, 0x8000, 0x080c, 0x9ae0, + 0x080c, 0x5271, 0x012e, 0x0804, 0x2e72, 0x81ff, 0x1904, 0x2e97, + 0x080c, 0x3d19, 0x0904, 0x2e9a, 0x080c, 0x4ee3, 0x0904, 0x2e97, + 0x080c, 0x4fef, 0x0904, 0x2e97, 0x0804, 0x2e72, 0x81ff, 0x1904, + 0x2e97, 0x080c, 0x3d29, 0x0904, 0x2e9a, 0x080c, 0x505b, 0x0904, + 0x2e97, 0x2019, 0x0005, 0x7924, 0x080c, 0x500a, 0x0904, 0x2e97, + 0x7828, 0xa08a, 0x1000, 0x1a04, 0x2e9a, 0x8003, 0x800b, 0x810b, + 0xa108, 0x080c, 0x674e, 0x0804, 0x2e72, 0x0126, 0x2091, 0x8000, + 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450, 0x2029, 0x00ff, 0x644c, + 0x2400, 0xa506, 0x01f8, 0x2508, 0x080c, 0x4e21, 0x11d8, 0x080c, + 0x505b, 0x1128, 0x2009, 0x0002, 0x62b0, 0x2518, 0x00c0, 0x2019, + 0x0004, 0xa00e, 0x080c, 0x500a, 0x1118, 0x2009, 0x0006, 0x0078, + 0x7824, 0xa08a, 0x1000, 0x1270, 0x8003, 0x800b, 0x810b, 0xa108, + 0x080c, 0x674e, 0x8529, 0x1ae0, 0x012e, 0x0804, 0x2e72, 0x012e, + 0x0804, 0x2e97, 0x012e, 0x0804, 0x2e9a, 0x080c, 0x3d19, 0x0904, + 0x2e9a, 0x080c, 0x4f49, 0x080c, 0x4fe3, 0x0804, 0x2e72, 0x81ff, + 0x1904, 0x2e97, 0x080c, 0x3d19, 0x0904, 0x2e9a, 0x080c, 0x4f3a, + 0x080c, 0x4fe3, 0x0804, 0x2e72, 0x81ff, 0x1904, 0x2e97, 0x080c, + 0x3d19, 0x0904, 0x2e9a, 0x080c, 0x4fbe, 0x0904, 0x2e97, 0x080c, + 0x4d05, 0x080c, 0x4f87, 0x080c, 0x4fe3, 0x0804, 0x2e72, 0x080c, + 0x3d19, 0x0904, 0x2e9a, 0x080c, 0x4ee3, 0x0904, 0x2e97, 0x62a0, + 0x2019, 0x0005, 0x00c6, 0x080c, 0x501c, 0x2061, 0x0000, 0x080c, + 0x6b35, 0x0076, 0x2039, 0x0000, 0x080c, 0x6a6b, 0x2009, 0x0000, + 0x080c, 0xaa51, 0x007e, 0x00ce, 0x080c, 0x4fe3, 0x0804, 0x2e72, + 0x080c, 0x3d19, 0x0904, 0x2e9a, 0x080c, 0x4fe3, 0x2208, 0x0804, + 0x2e72, 0x0156, 0x00d6, 0x00e6, 0x2069, 0xb214, 0x6810, 0x6914, + 0xa10a, 0x1210, 0x2009, 0x0000, 0x6816, 0x2011, 0x0000, 0x2019, + 0x0000, 0x20a9, 0x007e, 0x2069, 0xb235, 0x2d04, 0xa075, 0x0130, + 0x704c, 0x0071, 0xa210, 0x7080, 0x0059, 0xa318, 0x8d68, 0x1f04, + 0x30dd, 0x2300, 0xa218, 0x00ee, 0x00de, 0x015e, 0x0804, 0x2e72, + 0x00f6, 0x0016, 0xa07d, 0x0140, 0x2001, 0x0000, 0x8000, 0x2f0c, + 0x81ff, 0x0110, 0x2178, 0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069, + 0xb214, 0x6910, 0x62ac, 0x0804, 0x2e72, 0x81ff, 0x1904, 0x2e97, + 0x614c, 0xa190, 0x2c8c, 0x2215, 0xa294, 0x00ff, 0x636c, 0x83ff, + 0x0108, 0x6270, 0x67d0, 0xd79c, 0x0118, 0x2031, 0x0001, 0x0090, + 0xd7ac, 0x0118, 0x2031, 0x0003, 0x0068, 0xd7a4, 0x0118, 0x2031, + 0x0002, 0x0040, 0x080c, 0x58d5, 0x1118, 0x2031, 0x0004, 0x0010, + 0x2031, 0x0000, 0x7e3a, 0x7f3e, 0x0804, 0x2e72, 0x613c, 0x6240, + 0x2019, 0xb3b5, 0x231c, 0x0804, 0x2e72, 0x0126, 0x2091, 0x8000, + 0x6134, 0xa006, 0x2010, 0x2018, 0x012e, 0x0804, 0x2e72, 0x080c, + 0x3d29, 0x0904, 0x2e9a, 0x6244, 0x6338, 0x0804, 0x2e72, 0x613c, + 0x6240, 0x7824, 0x603e, 0x7b28, 0x6342, 0x2069, 0xb152, 0x831f, + 0xa305, 0x6816, 0x782c, 0x2069, 0xb3b5, 0x2d1c, 0x206a, 0x0804, + 0x2e72, 0x0126, 0x2091, 0x8000, 0x7824, 0x6036, 0x012e, 0x0804, + 0x2e72, 0x7838, 0xa005, 0x01a8, 0x7828, 0xa025, 0x0904, 0x2e9a, + 0x782c, 0xa02d, 0x0904, 0x2e9a, 0xa00e, 0x080c, 0x4e21, 0x1120, + 0x6244, 0x6338, 0x6446, 0x653a, 0xa186, 0x00ff, 0x0190, 0x8108, + 0x0ca0, 0x080c, 0x3d29, 0x0904, 0x2e9a, 0x7828, 0xa00d, 0x0904, + 0x2e9a, 0x782c, 0xa005, 0x0904, 0x2e9a, 0x6244, 0x6146, 0x6338, + 0x603a, 0x0804, 0x2e72, 0x2001, 0xb100, 0x2004, 0xa086, 0x0003, + 0x1904, 0x2e97, 0x00c6, 0x2061, 0x0100, 0x7924, 0x810f, 0xa18c, + 0x00ff, 0xa196, 0x00ff, 0x1130, 0x2001, 0xb114, 0x2004, 0xa085, + 0xff00, 0x0078, 0xa182, 0x007f, 0x16a0, 0xa188, 0x2c8c, 0x210d, + 0xa18c, 0x00ff, 0x2001, 0xb114, 0x2004, 0xa116, 0x0550, 0x810f, + 0xa105, 0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0x8295, 0x000e, + 0x01e0, 0x601a, 0x600b, 0xbc09, 0x601f, 0x0001, 0x080c, 0x3d04, + 0x01d8, 0x6837, 0x0000, 0x7007, 0x0003, 0x6833, 0x0000, 0x6838, + 0xc0fd, 0x683a, 0x701b, 0x3233, 0x2d00, 0x6012, 0x2009, 0x0032, + 0x080c, 0x831a, 0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, + 0x2e97, 0x00ce, 0x0804, 0x2e9a, 0x080c, 0x82eb, 0x0cb0, 0x2001, + 0xb100, 0x2004, 0xa086, 0x0003, 0x1904, 0x2e97, 0x00c6, 0x2061, + 0x0100, 0x7924, 0x810f, 0xa18c, 0x00ff, 0xa196, 0x00ff, 0x1130, + 0x2001, 0xb114, 0x2004, 0xa085, 0xff00, 0x0078, 0xa182, 0x007f, + 0x16a0, 0xa188, 0x2c8c, 0x210d, 0xa18c, 0x00ff, 0x2001, 0xb114, + 0x2004, 0xa116, 0x0550, 0x810f, 0xa105, 0x0126, 0x2091, 0x8000, + 0x0006, 0x080c, 0x8295, 0x000e, 0x01e0, 0x601a, 0x600b, 0xbc05, + 0x601f, 0x0001, 0x080c, 0x3d04, 0x01d8, 0x6837, 0x0000, 0x7007, + 0x0003, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x701b, 0x3233, + 0x2d00, 0x6012, 0x2009, 0x0032, 0x080c, 0x831a, 0x012e, 0x00ce, + 0x0005, 0x012e, 0x00ce, 0x0804, 0x2e97, 0x00ce, 0x0804, 0x2e9a, + 0x080c, 0x82eb, 0x0cb0, 0x6830, 0xa086, 0x0100, 0x0904, 0x2e97, + 0x0804, 0x2e72, 0x2061, 0xb464, 0x0126, 0x2091, 0x8000, 0x6000, + 0xd084, 0x0140, 0x6104, 0x6208, 0x2019, 0xb111, 0x231c, 0x012e, + 0x0804, 0x2e72, 0x012e, 0x0804, 0x2e9a, 0x81ff, 0x1904, 0x2e97, + 0x080c, 0x58d5, 0x0904, 0x2e97, 0x0126, 0x2091, 0x8000, 0x6244, + 0x6064, 0xa202, 0x0248, 0xa085, 0x0001, 0x080c, 0x2740, 0x080c, + 0x44a2, 0x012e, 0x0804, 0x2e72, 0x012e, 0x0804, 0x2e9a, 0x0126, + 0x2091, 0x8000, 0x7824, 0xa084, 0x0007, 0x0002, 0x3279, 0x3282, + 0x3289, 0x3276, 0x3276, 0x3276, 0x3276, 0x3276, 0x012e, 0x0804, + 0x2e9a, 0x2009, 0x0114, 0x2104, 0xa085, 0x0800, 0x200a, 0x080c, + 0x33f2, 0x0070, 0x2009, 0x010b, 0x200b, 0x0010, 0x080c, 0x33f2, + 0x0038, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x2e74, + 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, + 0x2009, 0x0101, 0x210c, 0x0016, 0x2001, 0x0138, 0x200c, 0x2003, + 0x0001, 0x0016, 0x2001, 0x007a, 0x2034, 0x2001, 0x007b, 0x202c, + 0xa006, 0x2048, 0x2050, 0x2058, 0x080c, 0x3633, 0x080c, 0x359d, + 0xa03e, 0x2720, 0x00f6, 0x00e6, 0x00c6, 0x2d60, 0x2071, 0xb43a, + 0x2079, 0x0020, 0x00d6, 0x2069, 0x0000, 0x6824, 0xd0b4, 0x0140, + 0x2001, 0x007d, 0x2004, 0x783e, 0x2001, 0x007c, 0x2004, 0x783a, + 0x00de, 0x2011, 0x0001, 0x080c, 0x3549, 0x080c, 0x3549, 0x00ce, + 0x00ee, 0x00fe, 0x080c, 0x3498, 0x080c, 0x3571, 0x080c, 0x34ee, + 0x080c, 0x3457, 0x080c, 0x3488, 0x00f6, 0x2079, 0x0100, 0x7824, + 0xd094, 0x0530, 0x7814, 0xa084, 0x0184, 0xa085, 0x0010, 0x7816, + 0x2079, 0x0140, 0x080c, 0x33d0, 0x1110, 0x00fe, 0x0430, 0x7804, + 0xd0dc, 0x0dc0, 0x2079, 0x0100, 0x7827, 0x0086, 0x7814, 0xa084, + 0x0184, 0xa085, 0x0032, 0x7816, 0x080c, 0x33d0, 0x1110, 0x00fe, + 0x00a0, 0x7824, 0xd0bc, 0x0dc0, 0x7827, 0x0080, 0xa026, 0x7c16, + 0x7824, 0xd0ac, 0x0130, 0x8b58, 0x080c, 0x33da, 0x00fe, 0x0804, + 0x339a, 0x00fe, 0x080c, 0x33d0, 0x1150, 0x8948, 0x2001, 0x007a, + 0x2602, 0x2001, 0x007b, 0x2502, 0x080c, 0x33da, 0x0088, 0x87ff, + 0x0140, 0x2001, 0x0201, 0x2004, 0xa005, 0x1904, 0x32d4, 0x8739, + 0x0038, 0x2001, 0xb419, 0x2004, 0xa086, 0x0000, 0x1904, 0x32d4, + 0x2001, 0x0033, 0x2003, 0x00f6, 0x8631, 0x1208, 0x8529, 0x2500, + 0xa605, 0x0904, 0x339a, 0x7824, 0xd0bc, 0x0128, 0x2900, 0xaa05, + 0xab05, 0x1904, 0x339a, 0x6033, 0x000d, 0x2001, 0x0030, 0x2003, + 0x0004, 0x7824, 0xd0ac, 0x1148, 0x2001, 0xb419, 0x2003, 0x0003, + 0x2001, 0x0030, 0x2003, 0x0009, 0x0040, 0x6027, 0x0001, 0x2001, + 0x0075, 0x2004, 0xa005, 0x0108, 0x6026, 0x2c00, 0x601a, 0x20e1, + 0x9040, 0x2d00, 0x681a, 0x6833, 0x000d, 0x7824, 0xd0a4, 0x1180, + 0x6827, 0x0000, 0x00c6, 0x20a9, 0x0004, 0x2061, 0x0020, 0x6003, + 0x0008, 0x2001, 0x0203, 0x2004, 0x1f04, 0x336f, 0x00ce, 0x0040, + 0x6827, 0x0001, 0x2001, 0x0074, 0x2004, 0xa005, 0x0108, 0x6826, + 0x00f6, 0x00c6, 0x2079, 0x0100, 0x2061, 0x0020, 0x7827, 0x0002, + 0x2001, 0x0072, 0x2004, 0xa084, 0xfff8, 0x601a, 0x0006, 0x2001, + 0x0073, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca, 0x00ce, 0x00fe, + 0x0804, 0x32b2, 0x2061, 0x0100, 0x6027, 0x0002, 0x001e, 0x61e2, + 0x001e, 0x6106, 0x7824, 0xa084, 0x0003, 0xa086, 0x0002, 0x0188, + 0x20e1, 0x9028, 0x6050, 0xa084, 0xf7ef, 0x6052, 0x602f, 0x0000, + 0x602c, 0xc0ac, 0x602e, 0x604b, 0xf7f7, 0x6043, 0x0090, 0x6043, + 0x0010, 0x2908, 0x2a10, 0x2b18, 0x2b00, 0xaa05, 0xa905, 0x00fe, + 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x1118, + 0x012e, 0x0804, 0x2e72, 0x012e, 0x2021, 0x400c, 0x0804, 0x2e74, + 0xa085, 0x0001, 0x1d04, 0x33d9, 0x2091, 0x6000, 0x8420, 0xa486, + 0x0064, 0x0005, 0x2001, 0x0105, 0x2003, 0x0010, 0x2001, 0x0030, + 0x2003, 0x0004, 0x2001, 0x0020, 0x2003, 0x0004, 0x2001, 0xb419, + 0x2003, 0x0000, 0x2001, 0xb43a, 0x2003, 0x0000, 0x20e1, 0xf000, + 0xa026, 0x0005, 0x00f6, 0x2079, 0x0100, 0x2001, 0xb114, 0x200c, + 0x7932, 0x7936, 0x080c, 0x2720, 0x7850, 0xa084, 0x0980, 0xa085, + 0x0030, 0x7852, 0x2019, 0x01f4, 0x8319, 0x1df0, 0xa084, 0x0980, + 0x7852, 0x782c, 0xc0ad, 0x782e, 0x20a9, 0x0046, 0x1d04, 0x340e, + 0x2091, 0x6000, 0x1f04, 0x340e, 0x7850, 0xa085, 0x0400, 0x7852, + 0x2001, 0x0009, 0x2004, 0xa084, 0x0003, 0xa086, 0x0001, 0x1118, + 0x782c, 0xc0ac, 0x782e, 0x784b, 0xf7f7, 0x7843, 0x0090, 0x7843, + 0x0010, 0x20a9, 0x000e, 0xe000, 0x1f04, 0x342b, 0x7850, 0xa085, + 0x1400, 0x7852, 0x2019, 0x61a8, 0x7854, 0xe000, 0xe000, 0xd08c, + 0x1110, 0x8319, 0x1dc8, 0x7827, 0x0048, 0x7850, 0xa085, 0x0400, + 0x7852, 0x7843, 0x0040, 0x2019, 0x01f4, 0xe000, 0xe000, 0x8319, + 0x1de0, 0x2001, 0x0140, 0x2003, 0x0100, 0x7827, 0x0020, 0x7843, + 0x0000, 0x2003, 0x0000, 0x7827, 0x0048, 0x00fe, 0x0005, 0x7824, + 0xd0ac, 0x11c8, 0x00f6, 0x00e6, 0x2071, 0xb419, 0x2079, 0x0030, + 0x2001, 0x0201, 0x2004, 0xa005, 0x0160, 0x7000, 0xa086, 0x0000, + 0x1140, 0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003, 0x7803, + 0x0019, 0x00ee, 0x00fe, 0x0005, 0x780c, 0xa08c, 0x0070, 0x0178, + 0x2009, 0x007a, 0x260a, 0x2009, 0x007b, 0x250a, 0xd0b4, 0x0108, + 0x8a50, 0xd0ac, 0x0108, 0x8948, 0xd0a4, 0x0108, 0x8b58, 0x0005, + 0x00f6, 0x2079, 0x0200, 0x781c, 0xd084, 0x0140, 0x20e1, 0x0007, + 0x20e1, 0x2000, 0x2001, 0x020a, 0x2004, 0x0ca8, 0x00fe, 0x0005, + 0x00e6, 0x2071, 0x0100, 0x2009, 0xb114, 0x210c, 0x716e, 0x7063, + 0x0100, 0x7166, 0x719e, 0x706b, 0x0000, 0x7073, 0x0809, 0x7077, + 0x0008, 0x7078, 0xa080, 0x0100, 0x707a, 0x7080, 0x8000, 0x7082, + 0x7087, 0xaaaa, 0xa006, 0x708a, 0x708e, 0x707e, 0x70d6, 0x70ab, + 0x0036, 0x70af, 0x95d5, 0x7027, 0x0080, 0x7014, 0xa084, 0x0184, + 0xa085, 0x0032, 0x7016, 0x080c, 0x3571, 0x080c, 0x33d0, 0x1110, + 0x8421, 0x0028, 0x7024, 0xd0bc, 0x0db0, 0x7027, 0x0080, 0x00f6, + 0x00e6, 0x2071, 0xb419, 0x2079, 0x0030, 0x00d6, 0x2069, 0x0000, + 0x6824, 0xd0b4, 0x0120, 0x683c, 0x783e, 0x6838, 0x783a, 0x00de, + 0x2011, 0x0011, 0x080c, 0x3549, 0x2011, 0x0001, 0x080c, 0x3549, + 0x00ee, 0x00fe, 0x7017, 0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6, + 0x2071, 0xb419, 0x2079, 0x0030, 0x7904, 0xd1fc, 0x0904, 0x3546, + 0x7803, 0x0002, 0xa026, 0xd19c, 0x1904, 0x3542, 0x7000, 0x0002, + 0x3546, 0x3504, 0x3528, 0x3542, 0xd1bc, 0x1150, 0xd1dc, 0x1150, + 0x8001, 0x7002, 0x2011, 0x0001, 0x04e1, 0x05c0, 0x04d1, 0x04b0, + 0x780f, 0x0000, 0x7820, 0x7924, 0x7803, 0x0004, 0x7822, 0x7926, + 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8, 0x080c, 0x3474, 0x2009, + 0x0001, 0x7808, 0xd0ec, 0x0110, 0x2009, 0x0011, 0x7902, 0x00f0, + 0x8001, 0x7002, 0xa184, 0x0880, 0x1138, 0x7804, 0xd0fc, 0x1940, + 0x2011, 0x0001, 0x00b1, 0x0090, 0x6030, 0xa092, 0x0004, 0xa086, + 0x0009, 0x1120, 0x6000, 0x601a, 0x2011, 0x0025, 0x6232, 0xd1dc, + 0x1988, 0x0870, 0x7803, 0x0004, 0x7003, 0x0000, 0x00ee, 0x00fe, + 0x0005, 0x6024, 0xa005, 0x0520, 0x8001, 0x6026, 0x6018, 0x6130, + 0xa140, 0x2804, 0x7832, 0x8840, 0x2804, 0x7836, 0x8840, 0x2804, + 0x7822, 0x8840, 0x2804, 0x7826, 0x8840, 0x7a02, 0x7000, 0x8000, + 0x7002, 0x6018, 0xa802, 0xa08a, 0x0029, 0x1138, 0x6018, 0xa080, + 0x0001, 0x2004, 0x601a, 0x2001, 0x000d, 0x6032, 0xa085, 0x0001, + 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x2071, 0xb43a, 0x2079, 0x0020, + 0x7904, 0xd1fc, 0x01f0, 0x7803, 0x0002, 0x2d60, 0xa026, 0x7000, + 0x0002, 0x3599, 0x3584, 0x3590, 0x8001, 0x7002, 0xd19c, 0x1188, + 0x2011, 0x0001, 0x080c, 0x3549, 0x0160, 0x080c, 0x3549, 0x0048, + 0x8001, 0x7002, 0x7804, 0xd0fc, 0x1d30, 0x2011, 0x0001, 0x080c, + 0x3549, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x00e6, 0x00c6, + 0x2061, 0x0200, 0x601b, 0x0004, 0x2061, 0x0100, 0x60cf, 0x0400, + 0x6004, 0xc0ac, 0xa085, 0x0200, 0x6006, 0x2001, 0x0074, 0x2004, + 0xa005, 0x01f8, 0x2038, 0x2001, 0x0076, 0x2024, 0x2001, 0x0077, + 0x201c, 0x080c, 0x3d04, 0x6833, 0x000d, 0x6f26, 0x2d00, 0x681a, + 0xa78a, 0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, + 0xa03e, 0x6818, 0xa080, 0x000d, 0x04a1, 0x1d90, 0x2d00, 0x681a, + 0x0088, 0x080c, 0x3d04, 0x6833, 0x000d, 0x2070, 0x6827, 0x0001, + 0x2d00, 0x681a, 0x2001, 0x0076, 0x2004, 0x2072, 0x2001, 0x0077, + 0x2004, 0x7006, 0x2061, 0x0020, 0x2079, 0x0100, 0x6013, 0x0400, + 0x20e1, 0x9040, 0x2001, 0x0072, 0x2004, 0xa084, 0xfff8, 0x700a, + 0x601a, 0x0006, 0x2001, 0x0073, 0x2004, 0x700e, 0x601e, 0x78c6, + 0x000e, 0x78ca, 0xa006, 0x603a, 0x603e, 0x00ce, 0x00ee, 0x00fe, + 0x0005, 0x00e6, 0x2071, 0x0010, 0x20a0, 0x2099, 0x0014, 0x7003, + 0x0026, 0x7432, 0x7336, 0xa006, 0x703a, 0x703e, 0x810b, 0x810b, + 0x21a8, 0x810b, 0x7122, 0x7003, 0x0041, 0x7004, 0xd0fc, 0x0de8, + 0x7003, 0x0002, 0x7003, 0x0040, 0x53a5, 0x7430, 0x7334, 0x87ff, + 0x0180, 0x00c6, 0x00d6, 0x2d60, 0x00c6, 0x080c, 0x3d04, 0x00ce, + 0x6018, 0x2070, 0x2d00, 0x7006, 0x601a, 0x00de, 0x00ce, 0xa085, + 0x0001, 0x00ee, 0x0005, 0x00e6, 0x2001, 0x0075, 0x2004, 0xa005, + 0x0508, 0x2038, 0x2001, 0x0078, 0x2024, 0x2001, 0x0079, 0x201c, + 0x080c, 0x3d04, 0x2d60, 0x6833, 0x000d, 0x6f26, 0x2d00, 0x681a, + 0xa78a, 0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, + 0xa03e, 0x6818, 0xa080, 0x000d, 0x080c, 0x3601, 0x1d88, 0x2d00, + 0x681a, 0x00e0, 0x080c, 0x3d04, 0x2d60, 0x6033, 0x000d, 0x2070, + 0x6027, 0x0001, 0x2c00, 0x601a, 0x2001, 0x0078, 0x2004, 0x2072, + 0x2001, 0x0079, 0x2004, 0x7006, 0x2001, 0x0072, 0x2004, 0xa084, + 0xfff8, 0x700a, 0x2001, 0x0073, 0x2004, 0x700e, 0x2001, 0x0030, + 0x2003, 0x0004, 0x7824, 0xd0ac, 0x1178, 0x2001, 0x0101, 0x200c, + 0xc1ed, 0x2102, 0x6027, 0x0000, 0x2001, 0xb419, 0x2003, 0x0003, + 0x2001, 0x0030, 0x2003, 0x0009, 0x00ee, 0x0005, 0x0804, 0x2e72, + 0x0126, 0x2091, 0x8000, 0x20a9, 0x0012, 0x2001, 0xb140, 0x20a0, + 0xa006, 0x40a4, 0x012e, 0x0804, 0x2e72, 0x7d38, 0x7c3c, 0x0804, + 0x2f19, 0x080c, 0x3d04, 0x0904, 0x2e97, 0x080c, 0x58d5, 0x0110, + 0x080c, 0x4a65, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, + 0x080c, 0x3d45, 0x701b, 0x36b5, 0x0005, 0xade8, 0x000d, 0x6800, + 0xa005, 0x0904, 0x2e9a, 0x6804, 0xd0ac, 0x0118, 0xd0a4, 0x0904, + 0x2e9a, 0xd094, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0138, 0x6200, + 0xa292, 0x0005, 0x0218, 0xa18c, 0xffdf, 0x0010, 0xa18d, 0x0020, + 0x6106, 0x00ce, 0xd08c, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0118, + 0xa18d, 0x0010, 0x0010, 0xa18c, 0xffef, 0x6106, 0x00ce, 0x2009, + 0x0100, 0x210c, 0xa18a, 0x0002, 0x0268, 0xd084, 0x0158, 0x6a28, + 0xa28a, 0x007f, 0x1a04, 0x2e9a, 0xa288, 0x2c8c, 0x210d, 0xa18c, + 0x00ff, 0x6156, 0xd0dc, 0x0130, 0x6828, 0xa08a, 0x007f, 0x1a04, + 0x2e9a, 0x604e, 0x6808, 0xa08a, 0x0100, 0x0a04, 0x2e9a, 0xa08a, + 0x0841, 0x1a04, 0x2e9a, 0xa084, 0x0007, 0x1904, 0x2e9a, 0x680c, + 0xa005, 0x0904, 0x2e9a, 0x6810, 0xa005, 0x0904, 0x2e9a, 0x6848, + 0x6940, 0xa10a, 0x1a04, 0x2e9a, 0x8001, 0x0904, 0x2e9a, 0x684c, + 0x6944, 0xa10a, 0x1a04, 0x2e9a, 0x8001, 0x0904, 0x2e9a, 0x6804, + 0xd0fc, 0x0560, 0x080c, 0x3d04, 0x0904, 0x2e97, 0x2009, 0x0014, + 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0xa290, 0x0038, 0xa399, 0x0000, + 0x080c, 0x3d45, 0x701b, 0x3735, 0x0005, 0xade8, 0x000d, 0x20a9, + 0x0014, 0x2d98, 0x2069, 0xb16e, 0x2da0, 0x53a3, 0x7010, 0xa0e8, + 0x000d, 0x2001, 0xb172, 0x200c, 0xd1e4, 0x0140, 0x00c6, 0x2061, + 0x0100, 0x6004, 0xa085, 0x0b00, 0x6006, 0x00ce, 0x2009, 0xb3b0, + 0x200b, 0x0000, 0x2001, 0xb174, 0x2004, 0xd0ac, 0x0158, 0x7824, + 0x200a, 0x2009, 0x017f, 0x200a, 0x3200, 0xa084, 0x003f, 0xa085, + 0x3020, 0x2090, 0x20a9, 0x001c, 0x2d98, 0x2069, 0xb152, 0x2da0, + 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e, 0x8007, 0xa084, 0x00ff, + 0x6042, 0x080c, 0x5ba6, 0x080c, 0x51d5, 0x080c, 0x523e, 0x6000, + 0xa086, 0x0000, 0x1904, 0x382c, 0x6808, 0x602a, 0x080c, 0x2378, + 0x0006, 0x2001, 0x0100, 0x2004, 0xa082, 0x0005, 0x000e, 0x0268, + 0x2009, 0x0170, 0x200b, 0x0080, 0xe000, 0xe000, 0x200b, 0x0000, + 0x0036, 0x6b08, 0x080c, 0x277b, 0x003e, 0x6818, 0x691c, 0x6a20, + 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a, 0x621e, + 0x6322, 0x6c04, 0xd4f4, 0x0148, 0x6830, 0x6934, 0x6a38, 0x6b3c, + 0x8007, 0x810f, 0x8217, 0x831f, 0x0010, 0xa084, 0xf0ff, 0x6006, + 0x610a, 0x620e, 0x6312, 0x8007, 0x810f, 0x8217, 0x831f, 0x20a9, + 0x0004, 0x20a1, 0xb3bf, 0x40a1, 0x080c, 0x67ea, 0x6904, 0xd1fc, + 0x0520, 0x00c6, 0x2009, 0x0000, 0x20a9, 0x0001, 0x6b70, 0xd384, + 0x01c8, 0x0020, 0x839d, 0x12b0, 0x3508, 0x8109, 0x080c, 0x6135, + 0x6878, 0x6016, 0x6874, 0x2008, 0xa084, 0xff00, 0x8007, 0x600a, + 0xa184, 0x00ff, 0x6006, 0x8108, 0x1118, 0x6003, 0x0003, 0x0010, + 0x6003, 0x0001, 0x1f04, 0x37ca, 0x00ce, 0x2069, 0xb152, 0x2001, + 0xb39e, 0x6a80, 0xa294, 0x0030, 0xa28e, 0x0000, 0x0170, 0xa28e, + 0x0010, 0x0118, 0xa28e, 0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c, + 0x27c4, 0x2001, 0xb38f, 0x2102, 0x0008, 0x2102, 0x00c6, 0x2061, + 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c, 0x58d5, + 0x0128, 0x080c, 0x3f5e, 0x0110, 0x080c, 0x2740, 0x60c4, 0xa005, + 0x01b0, 0x6003, 0x0001, 0x2009, 0x3816, 0x00c0, 0x080c, 0x58d5, + 0x1158, 0x2011, 0x57ea, 0x080c, 0x6742, 0x2001, 0xb39f, 0x2003, + 0x0000, 0x080c, 0x5816, 0x0040, 0x080c, 0x4992, 0x0028, 0x6003, + 0x0004, 0x2009, 0x382c, 0x0010, 0x0804, 0x2e72, 0x2001, 0x0100, + 0x2004, 0xa082, 0x0005, 0x0258, 0x2001, 0x0170, 0x2004, 0xa084, + 0x00ff, 0xa086, 0x004c, 0x1118, 0x2091, 0x309d, 0x0817, 0x2091, + 0x301d, 0x0817, 0x6000, 0xa086, 0x0000, 0x0904, 0x2e97, 0x2069, + 0xb152, 0x7830, 0x6842, 0x7834, 0x6846, 0x6804, 0xd0fc, 0x0118, + 0x2009, 0x0030, 0x0010, 0x2009, 0x001c, 0x2d00, 0x7a2c, 0x7b28, + 0x7c3c, 0x7d38, 0x0804, 0x3d48, 0xa006, 0x080c, 0x2740, 0x81ff, + 0x1904, 0x2e97, 0x080c, 0x58d5, 0x1178, 0x2001, 0xb39f, 0x2003, + 0x0001, 0x2001, 0xb100, 0x2003, 0x0001, 0xa085, 0x0001, 0x080c, + 0x5919, 0x080c, 0x5816, 0x0020, 0x080c, 0x4a65, 0x080c, 0x4992, + 0x0804, 0x2e72, 0x81ff, 0x1904, 0x2e97, 0x080c, 0x58d5, 0x1110, + 0x0804, 0x2e97, 0x6184, 0x81ff, 0x0198, 0x703f, 0x0000, 0x2001, + 0xb7c0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0126, + 0x2091, 0x8000, 0x080c, 0x3d48, 0x701b, 0x2e70, 0x012e, 0x0005, + 0x703f, 0x0001, 0x00d6, 0x2069, 0xb7c0, 0x20a9, 0x0040, 0x20a1, + 0xb7c0, 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588, 0x2c8c, 0x210d, + 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002, 0x2100, 0xa506, + 0x01a8, 0x080c, 0x4e21, 0x1190, 0x6014, 0x821c, 0x0238, 0xa398, + 0xb7c0, 0xa085, 0xff00, 0x8007, 0x201a, 0x0038, 0xa398, 0xb7c0, + 0x2324, 0xa4a4, 0xff00, 0xa405, 0x201a, 0x8210, 0x8108, 0xa182, + 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a, + 0x00de, 0x20a9, 0x0040, 0x20a1, 0xb7c0, 0x2099, 0xb7c0, 0x080c, + 0x4a04, 0x0804, 0x3887, 0x080c, 0x3d29, 0x0904, 0x2e9a, 0x00c6, + 0x080c, 0x3d04, 0x00ce, 0x1120, 0x2009, 0x0002, 0x0804, 0x2e97, + 0x2001, 0xb153, 0x2004, 0xd0b4, 0x0550, 0x7824, 0xa084, 0xff00, + 0xa08e, 0x7e00, 0x0520, 0xa08e, 0x7f00, 0x0508, 0xa08e, 0x8000, + 0x01f0, 0x6000, 0xd08c, 0x11d8, 0x6004, 0xa084, 0x00ff, 0xa086, + 0x0006, 0x11a8, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x080c, + 0x99e8, 0x1120, 0x2009, 0x0003, 0x0804, 0x2e97, 0x7007, 0x0003, + 0x701b, 0x3913, 0x0005, 0x080c, 0x3d29, 0x0904, 0x2e9a, 0x20a9, + 0x002b, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9, 0x0004, + 0xac80, 0x0006, 0x2098, 0xad80, 0x0006, 0x20a0, 0x080c, 0x4a04, + 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098, 0xad80, 0x000a, 0x20a0, + 0x080c, 0x4a04, 0x2d00, 0x2009, 0x002b, 0x7a2c, 0x7b28, 0x7c3c, + 0x7d38, 0x0804, 0x3d48, 0x81ff, 0x1904, 0x2e97, 0x080c, 0x3d19, + 0x0904, 0x2e9a, 0x080c, 0x4ff8, 0x0804, 0x2e72, 0x81ff, 0x1904, + 0x2e97, 0x7828, 0xa08a, 0x1000, 0x1a04, 0x2e9a, 0x080c, 0x3d29, + 0x0904, 0x2e9a, 0x080c, 0x505b, 0x0904, 0x2e97, 0x2019, 0x0004, + 0xa00e, 0x080c, 0x500a, 0x7924, 0x810f, 0x7a28, 0x0011, 0x0804, + 0x2e72, 0xa186, 0x00ff, 0x0110, 0x0071, 0x0060, 0x2029, 0x007e, + 0x2061, 0xb100, 0x644c, 0x2400, 0xa506, 0x0110, 0x2508, 0x0019, + 0x8529, 0x1ec8, 0x0005, 0x080c, 0x4e21, 0x1138, 0x2200, 0x8003, + 0x800b, 0x810b, 0xa108, 0x080c, 0x674e, 0x0005, 0x81ff, 0x1904, + 0x2e97, 0x080c, 0x3d19, 0x0904, 0x2e9a, 0x080c, 0x4ee3, 0x0904, + 0x2e97, 0x080c, 0x5001, 0x0804, 0x2e72, 0x81ff, 0x1904, 0x2e97, + 0x080c, 0x3d19, 0x0904, 0x2e9a, 0x080c, 0x4ee3, 0x0904, 0x2e97, + 0x080c, 0x4fef, 0x0804, 0x2e72, 0x6100, 0x0804, 0x2e72, 0x080c, + 0x3d29, 0x0904, 0x2e9a, 0x2001, 0xb100, 0x2004, 0xa086, 0x0003, + 0x1904, 0x2e97, 0x00d6, 0xace8, 0x000a, 0x7924, 0xd184, 0x0110, + 0xace8, 0x0006, 0x680c, 0x8007, 0x783e, 0x6808, 0x8007, 0x783a, + 0x6b04, 0x831f, 0x6a00, 0x8217, 0x00de, 0x6100, 0xa18c, 0x0200, + 0x0804, 0x2e72, 0x7824, 0xa09c, 0x00ff, 0xa39a, 0x0003, 0x1a04, + 0x2e97, 0x624c, 0xa294, 0x00ff, 0xa084, 0xff00, 0x8007, 0xa206, + 0x1150, 0x2001, 0xb140, 0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, + 0x7d38, 0x0804, 0x3d48, 0x81ff, 0x1904, 0x2e97, 0x080c, 0x3d29, + 0x0904, 0x2e9a, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1904, + 0x2e97, 0x00c6, 0x080c, 0x3d04, 0x00ce, 0x0904, 0x2e97, 0x6837, + 0x0000, 0x6838, 0xc0fd, 0x683a, 0x080c, 0x9994, 0x0904, 0x2e97, + 0x7007, 0x0003, 0x701b, 0x39fd, 0x0005, 0x6830, 0xa086, 0x0100, + 0x0904, 0x2e97, 0xad80, 0x000e, 0x2009, 0x000c, 0x7a2c, 0x7b28, + 0x7c3c, 0x7d38, 0x0804, 0x3d48, 0xa006, 0x080c, 0x2740, 0x7824, + 0xa084, 0x00ff, 0xa086, 0x00ff, 0x0118, 0x81ff, 0x1904, 0x2e97, + 0x080c, 0x58d5, 0x0110, 0x080c, 0x4a65, 0x7828, 0xa08a, 0x1000, + 0x1a04, 0x2e9a, 0x7924, 0xa18c, 0xff00, 0x810f, 0xa186, 0x00ff, + 0x0138, 0xa182, 0x007f, 0x1a04, 0x2e9a, 0x2100, 0x080c, 0x270a, + 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2061, 0xb3ec, 0x601b, + 0x0000, 0x601f, 0x0000, 0x080c, 0x58d5, 0x1178, 0x2001, 0xb39f, + 0x2003, 0x0001, 0x2001, 0xb100, 0x2003, 0x0001, 0xa085, 0x0001, + 0x080c, 0x5919, 0x080c, 0x5816, 0x0430, 0x2011, 0x0003, 0x080c, + 0x7d52, 0x2011, 0x0002, 0x080c, 0x7d5c, 0x080c, 0x7c41, 0x080c, + 0x67b6, 0x0036, 0x2019, 0x0000, 0x080c, 0x7cc4, 0x003e, 0x2061, + 0x0100, 0x2001, 0xb114, 0x2004, 0xa084, 0x00ff, 0x810f, 0xa105, + 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x002d, 0x2011, + 0x49c9, 0x080c, 0x67c8, 0x7924, 0xa18c, 0xff00, 0x810f, 0x080c, + 0x58d5, 0x1110, 0x2009, 0x00ff, 0x7a28, 0x080c, 0x3961, 0x012e, + 0x00ce, 0x002e, 0x0804, 0x2e72, 0x7924, 0xa18c, 0xff00, 0x810f, + 0x00c6, 0x080c, 0x4dc5, 0x2c08, 0x00ce, 0x1904, 0x2e9a, 0x0804, + 0x2e72, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x2e97, 0x60d0, + 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x2e97, + 0x080c, 0x3d04, 0x1120, 0x2009, 0x0002, 0x0804, 0x2e97, 0x7924, + 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x080c, 0x3d45, 0x701b, 0x3ab1, + 0x0005, 0x2009, 0x0080, 0x080c, 0x4e21, 0x1130, 0x6004, 0xa084, + 0x00ff, 0xa086, 0x0006, 0x0120, 0x2021, 0x400a, 0x0804, 0x2e74, + 0x00d6, 0xade8, 0x000d, 0x6900, 0x6a08, 0x6b0c, 0x6c10, 0x6d14, + 0x6e18, 0x6820, 0xa0be, 0x0100, 0x0904, 0x3b28, 0xa0be, 0x0112, + 0x0904, 0x3b28, 0xa0be, 0x0113, 0x0904, 0x3b28, 0xa0be, 0x0114, + 0x0904, 0x3b28, 0xa0be, 0x0117, 0x0904, 0x3b28, 0xa0be, 0x011a, + 0x0904, 0x3b28, 0xa0be, 0x011c, 0x0904, 0x3b28, 0xa0be, 0x0121, + 0x05b0, 0xa0be, 0x0131, 0x0598, 0xa0be, 0x0171, 0x05c8, 0xa0be, + 0x0173, 0x05b0, 0xa0be, 0x01a1, 0x1120, 0x6830, 0x8007, 0x6832, + 0x04a8, 0xa0be, 0x0212, 0x0540, 0xa0be, 0x0213, 0x0528, 0xa0be, + 0x0214, 0x01b0, 0xa0be, 0x0217, 0x0168, 0xa0be, 0x021a, 0x1120, + 0x6838, 0x8007, 0x683a, 0x00e0, 0xa0be, 0x0300, 0x01c8, 0x00de, + 0x0804, 0x2e9a, 0xad80, 0x0010, 0x20a9, 0x0007, 0x080c, 0x3b6e, + 0xad80, 0x000e, 0x20a9, 0x0001, 0x080c, 0x3b6e, 0x0048, 0xad80, + 0x000c, 0x080c, 0x3b7c, 0x0050, 0xad80, 0x000e, 0x080c, 0x3b7c, + 0xad80, 0x000c, 0x20a9, 0x0001, 0x080c, 0x3b6e, 0x00c6, 0x080c, + 0x3d04, 0x0568, 0x6838, 0xc0fd, 0x683a, 0x6837, 0x0119, 0x6853, + 0x0000, 0x684f, 0x0020, 0x685b, 0x0001, 0x810b, 0x697e, 0x6883, + 0x0000, 0x6a86, 0x6b8a, 0x6c8e, 0x6d92, 0x6996, 0x689b, 0x0000, + 0x00ce, 0x00de, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x6823, + 0x0000, 0x6804, 0x2068, 0x080c, 0x99b0, 0x1120, 0x2009, 0x0003, + 0x0804, 0x2e97, 0x7007, 0x0003, 0x701b, 0x3b65, 0x0005, 0x00ce, + 0x00de, 0x2009, 0x0002, 0x0804, 0x2e97, 0x6820, 0xa086, 0x8001, + 0x1904, 0x2e72, 0x2009, 0x0004, 0x0804, 0x2e97, 0x0016, 0x2008, + 0x2044, 0x8000, 0x204c, 0x8000, 0x290a, 0x8108, 0x280a, 0x8108, + 0x1f04, 0x3b70, 0x001e, 0x0005, 0x0016, 0x00a6, 0x00b6, 0x2008, + 0x2044, 0x8000, 0x204c, 0x8000, 0x2054, 0x8000, 0x205c, 0x2b0a, + 0x8108, 0x2a0a, 0x8108, 0x290a, 0x8108, 0x280a, 0x00be, 0x00ae, + 0x001e, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x2e97, + 0x7924, 0x2140, 0xa18c, 0xff00, 0x810f, 0x60d0, 0xd0ac, 0x1120, + 0xa182, 0x0080, 0x0a04, 0x2e9a, 0xa182, 0x00ff, 0x1a04, 0x2e9a, + 0x7a2c, 0x7b28, 0x606c, 0xa306, 0x1140, 0x6070, 0xa24e, 0x0904, + 0x2e9a, 0xa9cc, 0xff00, 0x0904, 0x2e9a, 0x00c6, 0x080c, 0x3c52, + 0x2c68, 0x00ce, 0x0538, 0xa0c6, 0x4000, 0x1180, 0x00c6, 0x0006, + 0x2d60, 0x2009, 0x0000, 0x080c, 0x50bc, 0x1108, 0xc185, 0x6000, + 0xd0bc, 0x0108, 0xc18d, 0x000e, 0x00ce, 0x0088, 0xa0c6, 0x4007, + 0x1110, 0x2408, 0x0060, 0xa0c6, 0x4008, 0x1118, 0x2708, 0x2610, + 0x0030, 0xa0c6, 0x4009, 0x1108, 0x0010, 0x2001, 0x4006, 0x2020, + 0x0804, 0x2e74, 0x2d00, 0x7022, 0x0016, 0x00b6, 0x00c6, 0x00e6, + 0x2c70, 0x080c, 0x8295, 0x05d8, 0x2d00, 0x601a, 0x080c, 0x9c35, + 0x2e58, 0x00ee, 0x00e6, 0x00c6, 0x080c, 0x3d04, 0x00ce, 0x2b70, + 0x1150, 0x080c, 0x82eb, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x2009, + 0x0002, 0x0804, 0x2e97, 0x6837, 0x0000, 0x683b, 0x0000, 0x2d00, + 0x6012, 0x6833, 0x0000, 0x6838, 0xc0fd, 0xd88c, 0x0108, 0xc0f5, + 0x683a, 0x0126, 0x2091, 0x8000, 0x080c, 0x2b73, 0x012e, 0x601f, + 0x0001, 0x2001, 0x0000, 0x080c, 0x4d63, 0x2001, 0x0002, 0x080c, + 0x4d75, 0x2009, 0x0002, 0x080c, 0x831a, 0xa085, 0x0001, 0x00ee, + 0x00ce, 0x00be, 0x001e, 0x1120, 0x2009, 0x0003, 0x0804, 0x2e97, + 0x7007, 0x0003, 0x701b, 0x3c35, 0x0005, 0x6830, 0xa086, 0x0100, + 0x7020, 0x2060, 0x1138, 0x2009, 0x0004, 0x6204, 0xa294, 0x00ff, + 0x0804, 0x2e97, 0x2009, 0x0000, 0x6838, 0xd0f4, 0x1904, 0x2e72, + 0x080c, 0x50bc, 0x1108, 0xc185, 0x6000, 0xd0bc, 0x0108, 0xc18d, + 0x0804, 0x2e72, 0x00e6, 0x00d6, 0x2029, 0x0000, 0x2001, 0xb134, + 0x2004, 0xd0ac, 0x0138, 0x2021, 0x0000, 0x20a9, 0x00ff, 0x2071, + 0xb235, 0x0030, 0x2021, 0x0080, 0x20a9, 0x007f, 0x2071, 0xb2b5, + 0x2e04, 0xa005, 0x1130, 0x2100, 0xa406, 0x1570, 0x2428, 0xc5fd, + 0x0458, 0x2068, 0x6f10, 0x2700, 0xa306, 0x11b0, 0x6e14, 0x2600, + 0xa206, 0x1190, 0x2400, 0xa106, 0x1160, 0x2d60, 0xd884, 0x0568, + 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1538, 0x2001, 0x4000, + 0x0428, 0x2001, 0x4007, 0x0410, 0x2400, 0xa106, 0x1168, 0x6e14, + 0x87ff, 0x1138, 0x86ff, 0x09d0, 0x2001, 0xb134, 0x2004, 0xd0ac, + 0x19a8, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x3c68, + 0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001, 0x0030, + 0x080c, 0x4dc5, 0x1dd0, 0x6312, 0x6216, 0xa006, 0xa005, 0x00de, + 0x00ee, 0x0005, 0x81ff, 0x1904, 0x2e97, 0x080c, 0x3d04, 0x0904, + 0x2e97, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x7824, 0xa005, + 0x0904, 0x2e9a, 0xa096, 0x00ff, 0x0120, 0xa092, 0x0004, 0x1a04, + 0x2e9a, 0x2010, 0x2d18, 0x080c, 0x2b26, 0x0904, 0x2e97, 0x7007, + 0x0003, 0x701b, 0x3cd4, 0x0005, 0x6830, 0xa086, 0x0100, 0x0904, + 0x2e97, 0x0804, 0x2e72, 0x7924, 0xa18c, 0xff00, 0x810f, 0x60d0, + 0xd0ac, 0x1120, 0xa182, 0x0080, 0x0a04, 0x2e9a, 0xa182, 0x00ff, + 0x1a04, 0x2e9a, 0x0126, 0x2091, 0x8000, 0x080c, 0x989a, 0x1188, + 0xa190, 0xb235, 0x2204, 0xa065, 0x0160, 0x080c, 0x4a80, 0x2001, + 0xb134, 0x2004, 0xd0ac, 0x0110, 0x6017, 0x0000, 0x012e, 0x0804, + 0x2e72, 0x012e, 0x0804, 0x2e97, 0x080c, 0x15dd, 0x0188, 0xa006, + 0x6802, 0x7010, 0xa005, 0x1120, 0x2d00, 0x7012, 0x7016, 0x0030, + 0x7014, 0x6802, 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80, 0x000d, + 0x0005, 0x7924, 0x810f, 0xa18c, 0x00ff, 0x080c, 0x4e21, 0x1130, + 0x7e28, 0xa684, 0x3fff, 0xa082, 0x4000, 0x0208, 0xa066, 0x8cff, + 0x0005, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x080c, 0x4e21, 0x1128, + 0xa6b4, 0x00ff, 0xa682, 0x4000, 0x0208, 0xa066, 0x8cff, 0x0005, + 0x0016, 0x7110, 0x81ff, 0x0128, 0x2168, 0x6904, 0x080c, 0x15f4, + 0x0cc8, 0x7112, 0x7116, 0x001e, 0x0005, 0x2031, 0x0001, 0x0010, + 0x2031, 0x0000, 0x2061, 0xb1d2, 0x6606, 0x6112, 0x600e, 0x6226, + 0x632a, 0x642e, 0x6532, 0x2c10, 0x080c, 0x1628, 0x7007, 0x0002, + 0x701b, 0x2e72, 0x0005, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, + 0x0000, 0x2001, 0xb190, 0x2004, 0xa005, 0x1168, 0x0e04, 0x3d73, + 0x7818, 0xd084, 0x1140, 0x7a22, 0x7b26, 0x7c2a, 0x781b, 0x0001, + 0x2091, 0x4080, 0x0408, 0x0016, 0x00c6, 0x00e6, 0x2071, 0xb182, + 0x7138, 0xa182, 0x0010, 0x0218, 0x7030, 0x2060, 0x0078, 0x7030, + 0xa0e0, 0x0004, 0xac82, 0xb1d2, 0x0210, 0x2061, 0xb192, 0x2c00, + 0x7032, 0x81ff, 0x1108, 0x7036, 0x8108, 0x713a, 0x2262, 0x6306, + 0x640a, 0x00ee, 0x00ce, 0x001e, 0x012e, 0x00fe, 0x0005, 0x00e6, + 0x2071, 0xb182, 0x7038, 0xa005, 0x0570, 0x0126, 0x2091, 0x8000, + 0x0e04, 0x3dca, 0x00f6, 0x2079, 0x0000, 0x7818, 0xd084, 0x1508, + 0x00c6, 0x7034, 0x2060, 0x2c04, 0x7822, 0x6004, 0x7826, 0x6008, + 0x782a, 0x781b, 0x0001, 0x2091, 0x4080, 0x7038, 0x8001, 0x703a, + 0xa005, 0x1130, 0x7033, 0xb192, 0x7037, 0xb192, 0x00ce, 0x0048, + 0xac80, 0x0004, 0xa0fa, 0xb1d2, 0x0210, 0x2001, 0xb192, 0x7036, + 0x00ce, 0x00fe, 0x012e, 0x00ee, 0x0005, 0x0026, 0x2001, 0xb153, + 0x2004, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x3d5b, 0x002e, + 0x0005, 0x81ff, 0x1904, 0x2e97, 0x0126, 0x2091, 0x8000, 0x6030, + 0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x58d5, 0x1178, 0x2001, + 0xb39f, 0x2003, 0x0001, 0x2001, 0xb100, 0x2003, 0x0001, 0xa085, + 0x0001, 0x080c, 0x5919, 0x080c, 0x5816, 0x0010, 0x080c, 0x4992, + 0x012e, 0x0804, 0x2e72, 0x7824, 0x2008, 0xa18c, 0xfffd, 0x1128, + 0x61dc, 0xa10d, 0x61de, 0x0804, 0x2e72, 0x0804, 0x2e9a, 0x81ff, + 0x1904, 0x2e97, 0x6000, 0xa086, 0x0003, 0x1904, 0x2e97, 0x2001, + 0xb153, 0x2004, 0xd0ac, 0x1904, 0x2e97, 0x080c, 0x3d29, 0x0904, + 0x2e9a, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1120, 0x7828, + 0xa005, 0x0904, 0x2e72, 0x00c6, 0x080c, 0x3d04, 0x00ce, 0x0904, + 0x2e97, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, + 0x080c, 0x9a79, 0x0904, 0x2e97, 0x7007, 0x0003, 0x701b, 0x3e39, + 0x0005, 0x6830, 0xa086, 0x0100, 0x0904, 0x2e97, 0x0804, 0x2e72, + 0x2001, 0xb100, 0x2004, 0xa086, 0x0003, 0x1904, 0x2e97, 0x7f24, + 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x080c, 0x3d04, 0x0904, 0x2e97, + 0x2009, 0x0000, 0x2031, 0x0000, 0x7023, 0x0000, 0x702f, 0x0000, + 0xad80, 0x0005, 0x7026, 0x20a0, 0x080c, 0x4e21, 0x1904, 0x3eb3, + 0x6004, 0xa0c4, 0x00ff, 0xa8c6, 0x0006, 0x0130, 0xa0c4, 0xff00, + 0xa8c6, 0x0600, 0x1904, 0x3eb3, 0x2001, 0xb153, 0x2004, 0xd0ac, + 0x1128, 0x080c, 0x50bc, 0x1110, 0xd79c, 0x05e8, 0xd794, 0x1110, + 0xd784, 0x0158, 0xac80, 0x0006, 0x2098, 0x3400, 0x20a9, 0x0004, + 0x53a3, 0x080c, 0x3b7c, 0xd794, 0x0148, 0xac80, 0x000a, 0x2098, + 0x3400, 0x20a9, 0x0004, 0x53a3, 0x080c, 0x3b7c, 0x21a2, 0xd794, + 0x01d8, 0xac80, 0x0000, 0x2098, 0x94a0, 0x20a9, 0x0002, 0x53a3, + 0xac80, 0x0003, 0x20a6, 0x94a0, 0xac80, 0x0004, 0x2098, 0x3400, + 0x20a9, 0x0002, 0x53a3, 0x080c, 0x3b6e, 0xac80, 0x0026, 0x2098, + 0x20a9, 0x0002, 0x53a3, 0x0008, 0x94a0, 0xd794, 0x0110, 0xa6b0, + 0x000b, 0xa6b0, 0x0005, 0x8108, 0x2001, 0xb134, 0x2004, 0xd0ac, + 0x0118, 0xa186, 0x0100, 0x0040, 0xd78c, 0x0120, 0xa186, 0x0100, + 0x0170, 0x0018, 0xa186, 0x007e, 0x0150, 0xd794, 0x0118, 0xa686, + 0x0020, 0x0010, 0xa686, 0x0028, 0x0150, 0x0804, 0x3e5c, 0x86ff, + 0x1120, 0x7120, 0x810b, 0x0804, 0x2e72, 0x702f, 0x0001, 0x711e, + 0x7020, 0xa600, 0x7022, 0x772a, 0x2061, 0xb1d2, 0x6007, 0x0000, + 0x6612, 0x7024, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, + 0x080c, 0x1628, 0x7007, 0x0002, 0x701b, 0x3eef, 0x0005, 0x702c, + 0xa005, 0x1170, 0x711c, 0x7024, 0x20a0, 0x7728, 0x2031, 0x0000, + 0x2061, 0xb1d2, 0x6224, 0x6328, 0x642c, 0x6530, 0x0804, 0x3e5c, + 0x7120, 0x810b, 0x0804, 0x2e72, 0x2029, 0x007e, 0x7924, 0x7a28, + 0x7b2c, 0x7c38, 0xa184, 0xff00, 0x8007, 0xa0e2, 0x0020, 0x0a04, + 0x2e9a, 0xa502, 0x0a04, 0x2e9a, 0xa184, 0x00ff, 0xa0e2, 0x0020, + 0x0a04, 0x2e9a, 0xa502, 0x0a04, 0x2e9a, 0xa284, 0xff00, 0x8007, + 0xa0e2, 0x0020, 0x0a04, 0x2e9a, 0xa502, 0x0a04, 0x2e9a, 0xa284, + 0x00ff, 0xa0e2, 0x0020, 0x0a04, 0x2e9a, 0xa502, 0x0a04, 0x2e9a, + 0xa384, 0xff00, 0x8007, 0xa0e2, 0x0020, 0x0a04, 0x2e9a, 0xa502, + 0x0a04, 0x2e9a, 0xa384, 0x00ff, 0xa0e2, 0x0020, 0x0a04, 0x2e9a, + 0xa502, 0x0a04, 0x2e9a, 0xa484, 0xff00, 0x8007, 0xa0e2, 0x0020, + 0x0a04, 0x2e9a, 0xa502, 0x0a04, 0x2e9a, 0xa484, 0x00ff, 0xa0e2, + 0x0020, 0x0a04, 0x2e9a, 0xa502, 0x0a04, 0x2e9a, 0x2061, 0xb3b8, + 0x6102, 0x6206, 0x630a, 0x640e, 0x0804, 0x2e72, 0x0006, 0x2001, + 0xb153, 0x2004, 0xd0cc, 0x000e, 0x0005, 0x0006, 0x2001, 0xb172, + 0x2004, 0xd0bc, 0x000e, 0x0005, 0x6164, 0x7a24, 0x6300, 0x82ff, + 0x1118, 0x7926, 0x0804, 0x2e72, 0x83ff, 0x1904, 0x2e9a, 0x2001, + 0xfff0, 0xa200, 0x1a04, 0x2e9a, 0x2019, 0xffff, 0x6068, 0xa302, + 0xa200, 0x0a04, 0x2e9a, 0x7926, 0x6266, 0x0804, 0x2e72, 0x2001, + 0xb100, 0x2004, 0xa086, 0x0003, 0x1904, 0x2e97, 0x7c28, 0x7d24, + 0x7e38, 0x7f2c, 0x080c, 0x3d04, 0x0904, 0x2e97, 0x2009, 0x0000, + 0x2019, 0x0000, 0x7023, 0x0000, 0x702f, 0x0000, 0xad80, 0x0003, + 0x7026, 0x20a0, 0xa1e0, 0xb235, 0x2c64, 0x8cff, 0x01b8, 0x6004, + 0xa084, 0x00ff, 0xa086, 0x0006, 0x0130, 0x6004, 0xa084, 0xff00, + 0xa086, 0x0600, 0x1158, 0x6014, 0x20a2, 0x94a0, 0x6010, 0x8007, + 0xa105, 0x8007, 0x20a2, 0x94a0, 0xa398, 0x0002, 0x8108, 0xa182, + 0x00ff, 0x0120, 0xa386, 0x002a, 0x0148, 0x08e0, 0x83ff, 0x1120, + 0x7120, 0x810c, 0x0804, 0x2e72, 0x702f, 0x0001, 0x711e, 0x7020, + 0xa300, 0x7022, 0x2061, 0xb1d2, 0x6007, 0x0000, 0x6312, 0x7024, + 0x600e, 0x6426, 0x652a, 0x662e, 0x6732, 0x2c10, 0x080c, 0x1628, + 0x7007, 0x0002, 0x701b, 0x3fe5, 0x0005, 0x702c, 0xa005, 0x1168, + 0x711c, 0x7024, 0x20a0, 0x2019, 0x0000, 0x2061, 0xb1d2, 0x6424, + 0x6528, 0x662c, 0x6730, 0x0804, 0x3fa2, 0x7120, 0x810c, 0x0804, + 0x2e72, 0x81ff, 0x1904, 0x2e97, 0x60d0, 0xd0ac, 0x1118, 0xd09c, + 0x0904, 0x2e97, 0x080c, 0x3d04, 0x0904, 0x2e97, 0x7924, 0x7a2c, + 0x7b28, 0x7c3c, 0x7d38, 0x080c, 0x3d45, 0x701b, 0x4010, 0x0005, + 0x00d6, 0xade8, 0x000d, 0x6828, 0xa0be, 0x7000, 0x0148, 0xa0be, + 0x7100, 0x0130, 0xa0be, 0x7200, 0x0118, 0x00de, 0x0804, 0x2e9a, + 0x6820, 0x6924, 0x080c, 0x26f6, 0x1510, 0x080c, 0x4dc5, 0x11f8, + 0x7122, 0x6612, 0x6516, 0x6e18, 0x00c6, 0x080c, 0x3d04, 0x01b8, + 0x080c, 0x3d04, 0x01a0, 0x00ce, 0x00de, 0x6837, 0x0000, 0x6838, + 0xc0fd, 0x683a, 0x6823, 0x0000, 0x6804, 0x2068, 0x080c, 0x99cc, + 0x0904, 0x2e97, 0x7007, 0x0003, 0x701b, 0x404a, 0x0005, 0x00de, + 0x0804, 0x2e97, 0x7120, 0x080c, 0x2c6e, 0x6820, 0xa086, 0x8001, + 0x0904, 0x2e97, 0x2d00, 0x701e, 0x6804, 0xa080, 0x0002, 0x0006, + 0x20a9, 0x002a, 0x2098, 0x20a0, 0x080c, 0x4a04, 0x000e, 0xade8, + 0x000d, 0x6a08, 0x6b0c, 0x6c10, 0x6d14, 0x2061, 0xb1d2, 0x6007, + 0x0000, 0x6e00, 0x6f28, 0xa7c6, 0x7000, 0x1108, 0x0018, 0xa7c6, + 0x7100, 0x1140, 0xa6c2, 0x0004, 0x0a04, 0x2e9a, 0x2009, 0x0004, + 0x0804, 0x3d48, 0xa7c6, 0x7200, 0x1904, 0x2e9a, 0xa6c2, 0x0054, + 0x0a04, 0x2e9a, 0x600e, 0x6013, 0x002a, 0x6226, 0x632a, 0x642e, + 0x6532, 0x2c10, 0x080c, 0x1628, 0x7007, 0x0002, 0x701b, 0x4091, + 0x0005, 0x701c, 0x2068, 0x6804, 0xa080, 0x0001, 0x2004, 0xa080, + 0x0002, 0x0006, 0x20a9, 0x002a, 0x2098, 0x20a0, 0x080c, 0x4a04, + 0x000e, 0x2009, 0x002a, 0x2061, 0xb1d2, 0x6224, 0x6328, 0x642c, + 0x6530, 0x0804, 0x3d48, 0x81ff, 0x1904, 0x2e97, 0x080c, 0x3d19, + 0x0904, 0x2e9a, 0x080c, 0x4ee3, 0x0904, 0x2e97, 0x080c, 0x5013, + 0x0804, 0x2e72, 0x7824, 0xd084, 0x0904, 0x38db, 0x080c, 0x3d29, + 0x0904, 0x2e9a, 0x00c6, 0x080c, 0x3d04, 0x00ce, 0x1120, 0x2009, + 0x0002, 0x0804, 0x2e97, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, + 0x0128, 0xa08e, 0x0004, 0x0110, 0xa08e, 0x0005, 0x1580, 0x2001, + 0xb153, 0x2004, 0xd0b4, 0x0904, 0x3917, 0x7824, 0xa084, 0xff00, + 0xa08e, 0x7e00, 0x0904, 0x3917, 0xa08e, 0x7f00, 0x0904, 0x3917, + 0xa08e, 0x8000, 0x0904, 0x3917, 0x6000, 0xd08c, 0x1904, 0x3917, + 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x080c, 0x99e8, 0x1120, + 0x2009, 0x0003, 0x0804, 0x2e97, 0x7007, 0x0003, 0x701b, 0x4101, + 0x0005, 0x080c, 0x3d29, 0x0904, 0x2e9a, 0x0804, 0x3917, 0x2009, + 0xb130, 0x210c, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x2e97, + 0x2001, 0xb100, 0x2004, 0xa086, 0x0003, 0x0120, 0x2009, 0x0007, + 0x0804, 0x2e97, 0x2001, 0xb153, 0x2004, 0xd0ac, 0x0120, 0x2009, + 0x0008, 0x0804, 0x2e97, 0x609c, 0xd0a4, 0x1118, 0xd0ac, 0x1904, + 0x3917, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, + 0x080c, 0x9a79, 0x1120, 0x2009, 0x0003, 0x0804, 0x2e97, 0x7007, + 0x0003, 0x701b, 0x413c, 0x0005, 0x6830, 0xa086, 0x0100, 0x1120, + 0x2009, 0x0004, 0x0804, 0x2e97, 0x080c, 0x3d29, 0x0904, 0x2e9a, + 0x0804, 0x40d7, 0x81ff, 0x2009, 0x0001, 0x1904, 0x2e97, 0x6000, + 0xa086, 0x0003, 0x2009, 0x0007, 0x1904, 0x2e97, 0x2001, 0xb153, + 0x2004, 0xd0ac, 0x2009, 0x0008, 0x1904, 0x2e97, 0x080c, 0x3d29, + 0x0904, 0x2e9a, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x2009, + 0x0009, 0x1904, 0x2e97, 0x00c6, 0x080c, 0x3d04, 0x00ce, 0x2009, + 0x0002, 0x0904, 0x2e97, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838, + 0xc0fd, 0x683a, 0x7928, 0xa194, 0xff00, 0xa18c, 0x00ff, 0xa006, + 0x82ff, 0x1128, 0xc0ed, 0x6952, 0x792c, 0x6956, 0x0048, 0xa28e, + 0x0100, 0x1904, 0x2e9a, 0xc0e5, 0x6853, 0x0000, 0x6857, 0x0000, + 0x683e, 0x080c, 0x9c36, 0x2009, 0x0003, 0x0904, 0x2e97, 0x7007, + 0x0003, 0x701b, 0x419c, 0x0005, 0x6830, 0xa086, 0x0100, 0x2009, + 0x0004, 0x0904, 0x2e97, 0x0804, 0x2e72, 0x81ff, 0x2009, 0x0001, + 0x1904, 0x2e97, 0x6000, 0xa086, 0x0003, 0x2009, 0x0007, 0x1904, + 0x2e97, 0x080c, 0x3d29, 0x0904, 0x2e9a, 0x6004, 0xa084, 0x00ff, + 0xa086, 0x0006, 0x2009, 0x0009, 0x1904, 0x2e97, 0x00c6, 0x080c, + 0x3d04, 0x00ce, 0x2009, 0x0002, 0x0904, 0x2e97, 0xad80, 0x000f, + 0x2009, 0x0008, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x080c, 0x3d45, + 0x701b, 0x41d3, 0x0005, 0x00d6, 0xade8, 0x000f, 0x6800, 0xa086, + 0x0500, 0x1140, 0x6804, 0xa005, 0x1128, 0x6808, 0xa084, 0xff00, + 0x1108, 0x0018, 0x00de, 0x1904, 0x2e9a, 0x00de, 0x6837, 0x0000, + 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x00c6, 0x080c, 0x3d29, + 0x1118, 0x00ce, 0x0804, 0x2e9a, 0x080c, 0x9c85, 0x2009, 0x0003, + 0x00ce, 0x0904, 0x2e97, 0x7007, 0x0003, 0x701b, 0x4200, 0x0005, + 0x6830, 0xa086, 0x0100, 0x2009, 0x0004, 0x0904, 0x2e97, 0x0804, + 0x2e72, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x2e97, 0x6000, + 0xa086, 0x0003, 0x0120, 0x2009, 0x0007, 0x0804, 0x2e97, 0x7e24, + 0x860f, 0xa18c, 0x00ff, 0xa6b4, 0x00ff, 0x080c, 0x4e21, 0x1904, + 0x2e9a, 0xa186, 0x007f, 0x0150, 0x6004, 0xa084, 0x00ff, 0xa086, + 0x0006, 0x0120, 0x2009, 0x0009, 0x0804, 0x2e97, 0x00c6, 0x080c, + 0x3d04, 0x00ce, 0x1120, 0x2009, 0x0002, 0x0804, 0x2e97, 0x6837, + 0x0000, 0x6838, 0xc0fd, 0x683a, 0x080c, 0x9a03, 0x1120, 0x2009, + 0x0003, 0x0804, 0x2e97, 0x7007, 0x0003, 0x701b, 0x4248, 0x0005, + 0x6808, 0x8007, 0xa086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, + 0x2e97, 0x68b0, 0x6836, 0x6810, 0x8007, 0xa084, 0x00ff, 0x808e, + 0x6814, 0x8007, 0xa084, 0x00ff, 0x8086, 0xa080, 0x0002, 0xa108, + 0xad80, 0x0004, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0804, 0x3d48, + 0x080c, 0x3d04, 0x1120, 0x2009, 0x0002, 0x0804, 0x2e97, 0x7924, + 0xa194, 0xff00, 0xa18c, 0x00ff, 0x8217, 0x82ff, 0x0110, 0x0804, + 0x2e9a, 0x2009, 0x001a, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x080c, + 0x3d45, 0x701b, 0x4284, 0x0005, 0xad80, 0x000d, 0x2098, 0x20a9, + 0x001a, 0x20a1, 0xb3bf, 0x53a3, 0x0804, 0x2e72, 0x080c, 0x3d04, + 0x1120, 0x2009, 0x0002, 0x0804, 0x2e97, 0x7924, 0xa194, 0xff00, + 0xa18c, 0x00ff, 0x8217, 0x82ff, 0x0110, 0x0804, 0x2e9a, 0x2099, + 0xb3bf, 0x20a0, 0x20a9, 0x001a, 0x53a3, 0x2009, 0x001a, 0x7a2c, + 0x7b28, 0x7c3c, 0x7d38, 0x0804, 0x3d48, 0x7824, 0xa08a, 0x1000, + 0x1a04, 0x2e9a, 0x0126, 0x2091, 0x8000, 0x8003, 0x800b, 0x810b, + 0xa108, 0x00c6, 0x2061, 0xb3ec, 0x6142, 0x00ce, 0x012e, 0x0804, + 0x2e72, 0x00c6, 0x080c, 0x58d5, 0x1188, 0x2001, 0xb39f, 0x2003, + 0x0001, 0x2001, 0xb100, 0x2003, 0x0001, 0xa085, 0x0001, 0x080c, + 0x5919, 0x080c, 0x5816, 0x080c, 0x14fa, 0x0038, 0x2061, 0xb100, + 0x6030, 0xc09d, 0x6032, 0x080c, 0x4992, 0x00ce, 0x0005, 0x0126, + 0x2091, 0x8000, 0x00c6, 0x2061, 0xb3ec, 0x7924, 0x6152, 0x614e, + 0x6057, 0x0000, 0x604b, 0x0009, 0x7838, 0x606a, 0x783c, 0x6066, + 0x7828, 0x6062, 0x782c, 0x605e, 0x2061, 0xb3a0, 0x2001, 0xb401, + 0x600e, 0x6013, 0x0001, 0x6017, 0x0002, 0x6007, 0x0000, 0x6037, + 0x0000, 0x00ce, 0x012e, 0x0804, 0x2e72, 0x0126, 0x00c6, 0x00e6, + 0x2061, 0x0100, 0x2071, 0xb100, 0x6044, 0xd0a4, 0x11b0, 0xd084, + 0x0118, 0x080c, 0x447c, 0x0068, 0xd08c, 0x0118, 0x080c, 0x439d, + 0x0040, 0xd094, 0x0118, 0x080c, 0x436e, 0x0018, 0xd09c, 0x0108, + 0x0061, 0x00ee, 0x00ce, 0x012e, 0x0005, 0x0016, 0x6128, 0xd19c, + 0x1110, 0xc19d, 0x612a, 0x001e, 0x0ca0, 0x624c, 0xa286, 0xf0f0, + 0x1150, 0x6048, 0xa086, 0xf0f0, 0x0130, 0x624a, 0x6043, 0x0090, + 0x6043, 0x0010, 0x0490, 0xa294, 0xff00, 0xa296, 0xf700, 0x0178, + 0x7134, 0xd1a4, 0x1160, 0x6240, 0xa295, 0x0100, 0x6242, 0xa294, + 0x0010, 0x0128, 0x2009, 0x00f7, 0x080c, 0x4a24, 0x00f0, 0x6040, + 0xa084, 0x0010, 0xa085, 0x0140, 0x6042, 0x6043, 0x0000, 0x7077, + 0x0000, 0x7093, 0x0001, 0x70b7, 0x0000, 0x70d3, 0x0000, 0x2009, + 0xb7c0, 0x200b, 0x0000, 0x7087, 0x0000, 0x707b, 0x000a, 0x2009, + 0x000a, 0x2011, 0x4948, 0x080c, 0x67c8, 0x0005, 0x0156, 0x2001, + 0xb174, 0x2004, 0xd08c, 0x0110, 0x704f, 0xffff, 0x7078, 0xa005, + 0x1510, 0x2011, 0x4948, 0x080c, 0x6742, 0x6040, 0xa094, 0x0010, + 0xa285, 0x0020, 0x6042, 0x20a9, 0x00c8, 0x6044, 0xd08c, 0x1168, + 0x1f04, 0x4385, 0x6242, 0x708b, 0x0000, 0x6040, 0xa094, 0x0010, + 0xa285, 0x0080, 0x6042, 0x6242, 0x0030, 0x6242, 0x708b, 0x0000, + 0x707f, 0x0000, 0x0000, 0x015e, 0x0005, 0x707c, 0xa08a, 0x0003, + 0x1210, 0x0023, 0x0010, 0x080c, 0x14fa, 0x0005, 0x43a9, 0x43f9, + 0x447b, 0x00f6, 0x707f, 0x0001, 0x20e1, 0xa000, 0xe000, 0x20e1, + 0x8700, 0x080c, 0x2378, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079, + 0xb600, 0x207b, 0x2200, 0x7807, 0x00ef, 0x780b, 0x0000, 0x780f, + 0x00ef, 0x7813, 0x0138, 0x7817, 0x0000, 0x781b, 0x0000, 0x781f, + 0x0000, 0x7823, 0xffff, 0x7827, 0xffff, 0x782b, 0x0000, 0x782f, + 0x0000, 0x2079, 0xb60c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099, + 0xb105, 0x20a1, 0xb60e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0xb612, + 0x207b, 0x0000, 0x7807, 0x0000, 0x2099, 0xb600, 0x20a1, 0x020b, + 0x20a9, 0x0014, 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x080c, + 0x4979, 0x00fe, 0x7083, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000, + 0x0005, 0x00d6, 0x7080, 0x7083, 0x0000, 0xa025, 0x0904, 0x4463, + 0x6020, 0xd0b4, 0x1904, 0x4461, 0x7190, 0x81ff, 0x0904, 0x4451, + 0xa486, 0x000c, 0x1904, 0x445c, 0xa480, 0x0018, 0x8004, 0x20a8, + 0x2011, 0xb680, 0x2019, 0xb600, 0x220c, 0x2304, 0xa106, 0x11b8, + 0x8210, 0x8318, 0x1f04, 0x4414, 0x6043, 0x0004, 0x608b, 0xbc94, + 0x608f, 0xf0f0, 0x6043, 0x0006, 0x707f, 0x0002, 0x708b, 0x0002, + 0x2009, 0x07d0, 0x2011, 0x494f, 0x080c, 0x67c8, 0x0490, 0x2069, + 0xb680, 0x6930, 0xa18e, 0x1101, 0x1538, 0x6834, 0xa005, 0x1520, + 0x6900, 0xa18c, 0x00ff, 0x1118, 0x6804, 0xa005, 0x0190, 0x2011, + 0xb68e, 0x2019, 0xb105, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102, + 0x0230, 0x1190, 0x8210, 0x8318, 0x1f04, 0x4445, 0x0068, 0x7093, + 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0xb680, 0x20a1, + 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043, 0x0008, 0x6043, 0x0000, + 0x0010, 0x00de, 0x0005, 0x6040, 0xa085, 0x0100, 0x6042, 0x6020, + 0xd0b4, 0x1db8, 0x60c3, 0x000c, 0x2011, 0xb3e3, 0x2013, 0x0000, + 0x7083, 0x0000, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, + 0x080c, 0x7a83, 0x0c30, 0x0005, 0x7088, 0xa08a, 0x001d, 0x1210, + 0x0023, 0x0010, 0x080c, 0x14fa, 0x0005, 0x44af, 0x44be, 0x44e6, + 0x44ff, 0x4523, 0x454b, 0x456f, 0x45a0, 0x45c4, 0x45ec, 0x4623, + 0x464b, 0x4667, 0x467d, 0x469d, 0x46b0, 0x46b8, 0x46e5, 0x4709, + 0x4731, 0x4755, 0x4786, 0x47c3, 0x47f2, 0x480e, 0x484d, 0x486d, + 0x4886, 0x4887, 0x00c6, 0x2061, 0xb100, 0x6003, 0x0007, 0x2061, + 0x0100, 0x6004, 0xa084, 0xfff9, 0x6006, 0x00ce, 0x0005, 0x608b, + 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0002, 0x708b, 0x0001, 0x2009, + 0x07d0, 0x2011, 0x494f, 0x080c, 0x67c8, 0x0005, 0x00f6, 0x7080, + 0xa086, 0x0014, 0x1508, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x11e0, + 0x2079, 0xb680, 0x7a30, 0xa296, 0x1102, 0x11a0, 0x7834, 0xa005, + 0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70b4, 0xa005, 0x1110, 0x70b7, + 0x0001, 0x2011, 0x494f, 0x080c, 0x6742, 0x708b, 0x0010, 0x080c, + 0x46b8, 0x0010, 0x080c, 0x4992, 0x00fe, 0x0005, 0x708b, 0x0003, + 0x6043, 0x0004, 0x2011, 0x494f, 0x080c, 0x6742, 0x080c, 0x4a0c, + 0x20a3, 0x1102, 0x20a3, 0x0000, 0x20a9, 0x000a, 0x20a3, 0x0000, + 0x1f04, 0x44f6, 0x60c3, 0x0014, 0x080c, 0x4979, 0x0005, 0x00f6, + 0x7080, 0xa005, 0x01f0, 0x2011, 0x494f, 0x080c, 0x6742, 0xa086, + 0x0014, 0x11a8, 0x2079, 0xb680, 0x7a30, 0xa296, 0x1102, 0x1178, + 0x7834, 0xa005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70b4, 0xa005, + 0x1110, 0x70b7, 0x0001, 0x708b, 0x0004, 0x0029, 0x0010, 0x080c, + 0x4992, 0x00fe, 0x0005, 0x708b, 0x0005, 0x080c, 0x4a0c, 0x20a3, + 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0xb68e, 0x080c, 0x4a5d, + 0x1160, 0x7074, 0xa005, 0x1148, 0x714c, 0xa186, 0xffff, 0x0128, + 0x080c, 0x4913, 0x0110, 0x080c, 0x4a3b, 0x20a9, 0x0008, 0x2298, + 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, + 0x080c, 0x4979, 0x0005, 0x00f6, 0x7080, 0xa005, 0x01f0, 0x2011, + 0x494f, 0x080c, 0x6742, 0xa086, 0x0014, 0x11a8, 0x2079, 0xb680, + 0x7a30, 0xa296, 0x1103, 0x1178, 0x7834, 0xa005, 0x1160, 0x7a38, + 0xd2fc, 0x0128, 0x70b4, 0xa005, 0x1110, 0x70b7, 0x0001, 0x708b, + 0x0006, 0x0029, 0x0010, 0x080c, 0x4992, 0x00fe, 0x0005, 0x708b, + 0x0007, 0x080c, 0x4a0c, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, + 0x2011, 0xb68e, 0x080c, 0x4a5d, 0x11a8, 0x7074, 0xa005, 0x1190, + 0x7154, 0xa186, 0xffff, 0x0170, 0xa180, 0x2c8c, 0x200d, 0xa18c, + 0xff00, 0x810f, 0x080c, 0x4913, 0x0128, 0x080c, 0x3f65, 0x0110, + 0x080c, 0x2740, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x080c, 0x4979, 0x0005, + 0x00f6, 0x7080, 0xa005, 0x01f0, 0x2011, 0x494f, 0x080c, 0x6742, + 0xa086, 0x0014, 0x11a8, 0x2079, 0xb680, 0x7a30, 0xa296, 0x1104, + 0x1178, 0x7834, 0xa005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70b4, + 0xa005, 0x1110, 0x70b7, 0x0001, 0x708b, 0x0008, 0x0029, 0x0010, + 0x080c, 0x4992, 0x00fe, 0x0005, 0x708b, 0x0009, 0x080c, 0x4a0c, + 0x20a3, 0x1105, 0x20a3, 0x0100, 0x3430, 0x080c, 0x4a5d, 0x1150, + 0x7074, 0xa005, 0x1138, 0x080c, 0x4888, 0x1170, 0xa085, 0x0001, + 0x080c, 0x2740, 0x20a9, 0x0008, 0x2099, 0xb68e, 0x26a0, 0x53a6, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x080c, 0x4979, + 0x0010, 0x080c, 0x44a2, 0x0005, 0x00f6, 0x7080, 0xa005, 0x0588, + 0x2011, 0x494f, 0x080c, 0x6742, 0xa086, 0x0014, 0x1540, 0x2079, + 0xb680, 0x7a30, 0xa296, 0x1105, 0x1510, 0x7834, 0x2011, 0x0100, + 0xa21e, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70b4, 0xa005, 0x1110, + 0x70b7, 0x0001, 0x708b, 0x000a, 0x00b1, 0x0098, 0xa005, 0x1178, + 0x7a38, 0xd2fc, 0x0128, 0x70b4, 0xa005, 0x1110, 0x70b7, 0x0001, + 0x7087, 0x0000, 0x708b, 0x000e, 0x080c, 0x469d, 0x0010, 0x080c, + 0x4992, 0x00fe, 0x0005, 0x708b, 0x000b, 0x2011, 0xb60e, 0x22a0, + 0x20a9, 0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9, 0x0002, 0x2009, + 0x0000, 0x41a4, 0x080c, 0x4a0c, 0x20a3, 0x1106, 0x20a3, 0x0000, + 0x080c, 0x4a5d, 0x0118, 0x2013, 0x0000, 0x0020, 0x7050, 0xa085, + 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6, 0x60c3, 0x0084, + 0x080c, 0x4979, 0x0005, 0x00f6, 0x7080, 0xa005, 0x01b0, 0x2011, + 0x494f, 0x080c, 0x6742, 0xa086, 0x0084, 0x1168, 0x2079, 0xb680, + 0x7a30, 0xa296, 0x1106, 0x1138, 0x7834, 0xa005, 0x1120, 0x708b, + 0x000c, 0x0029, 0x0010, 0x080c, 0x4992, 0x00fe, 0x0005, 0x708b, + 0x000d, 0x080c, 0x4a0c, 0x20a3, 0x1107, 0x20a3, 0x0000, 0x2099, + 0xb68e, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x60c3, 0x0084, 0x080c, 0x4979, 0x0005, 0x00f6, 0x7080, 0xa005, + 0x01d0, 0x2011, 0x494f, 0x080c, 0x6742, 0xa086, 0x0084, 0x1188, + 0x2079, 0xb680, 0x7a30, 0xa296, 0x1107, 0x1158, 0x7834, 0xa005, + 0x1140, 0x7087, 0x0001, 0x080c, 0x49fe, 0x708b, 0x000e, 0x0029, + 0x0010, 0x080c, 0x4992, 0x00fe, 0x0005, 0x708b, 0x000f, 0x7083, + 0x0000, 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0005, 0x6043, + 0x0004, 0x2009, 0x07d0, 0x2011, 0x494f, 0x080c, 0x6736, 0x0005, + 0x7080, 0xa005, 0x0120, 0x2011, 0x494f, 0x080c, 0x6742, 0x0005, + 0x708b, 0x0011, 0x080c, 0x4a5d, 0x1188, 0x716c, 0x81ff, 0x0170, + 0x2009, 0x0000, 0x7070, 0xa084, 0x00ff, 0x080c, 0x26f6, 0xa186, + 0x0080, 0x0120, 0x2011, 0xb68e, 0x080c, 0x4913, 0x20e1, 0x9080, + 0x20e1, 0x4000, 0x2099, 0xb680, 0x20a1, 0x020b, 0x7480, 0xa480, + 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, + 0x60c3, 0x0014, 0x080c, 0x4979, 0x0005, 0x00f6, 0x7080, 0xa005, + 0x01f0, 0x2011, 0x494f, 0x080c, 0x6742, 0xa086, 0x0014, 0x11a8, + 0x2079, 0xb680, 0x7a30, 0xa296, 0x1103, 0x1178, 0x7834, 0xa005, + 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70b4, 0xa005, 0x1110, 0x70b7, + 0x0001, 0x708b, 0x0012, 0x0029, 0x0010, 0x080c, 0x4992, 0x00fe, + 0x0005, 0x708b, 0x0013, 0x080c, 0x4a18, 0x20a3, 0x1103, 0x20a3, + 0x0000, 0x3430, 0x2011, 0xb68e, 0x080c, 0x4a5d, 0x1160, 0x7074, + 0xa005, 0x1148, 0x714c, 0xa186, 0xffff, 0x0128, 0x080c, 0x4913, + 0x0110, 0x080c, 0x4a3b, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x080c, 0x4979, + 0x0005, 0x00f6, 0x7080, 0xa005, 0x01f0, 0x2011, 0x494f, 0x080c, + 0x6742, 0xa086, 0x0014, 0x11a8, 0x2079, 0xb680, 0x7a30, 0xa296, + 0x1104, 0x1178, 0x7834, 0xa005, 0x1160, 0x7a38, 0xd2fc, 0x0128, + 0x70b4, 0xa005, 0x1110, 0x70b7, 0x0001, 0x708b, 0x0014, 0x0029, + 0x0010, 0x080c, 0x4992, 0x00fe, 0x0005, 0x708b, 0x0015, 0x080c, + 0x4a18, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0xb68e, + 0x080c, 0x4a5d, 0x11a8, 0x7074, 0xa005, 0x1190, 0x7154, 0xa186, + 0xffff, 0x0170, 0xa180, 0x2c8c, 0x200d, 0xa18c, 0xff00, 0x810f, + 0x080c, 0x4913, 0x0128, 0x080c, 0x3f65, 0x0110, 0x080c, 0x2740, + 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x60c3, 0x0014, 0x080c, 0x4979, 0x0005, 0x00f6, 0x7080, + 0xa005, 0x05b8, 0x2011, 0x494f, 0x080c, 0x6742, 0xa086, 0x0014, + 0x1570, 0x2079, 0xb680, 0x7a30, 0xa296, 0x1105, 0x1540, 0x7834, + 0x2011, 0x0100, 0xa21e, 0x1148, 0x7a38, 0xd2fc, 0x0128, 0x70b4, + 0xa005, 0x1110, 0x70b7, 0x0001, 0x0060, 0xa005, 0x11c0, 0x7a38, + 0xd2fc, 0x0128, 0x70b4, 0xa005, 0x1110, 0x70b7, 0x0001, 0x7087, + 0x0000, 0x7a38, 0xd2f4, 0x0138, 0x2001, 0xb174, 0x2004, 0xd0a4, + 0x1110, 0x70d3, 0x0008, 0x708b, 0x0016, 0x0029, 0x0010, 0x080c, + 0x4992, 0x00fe, 0x0005, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, + 0xb680, 0x20a1, 0x020b, 0x20a9, 0x000e, 0x53a6, 0x3430, 0x2011, + 0xb68e, 0x708b, 0x0017, 0x080c, 0x4a5d, 0x1150, 0x7074, 0xa005, + 0x1138, 0x080c, 0x4888, 0x1170, 0xa085, 0x0001, 0x080c, 0x2740, + 0x20a9, 0x0008, 0x2099, 0xb68e, 0x26a0, 0x53a6, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x60c3, 0x0014, 0x080c, 0x4979, 0x0010, 0x080c, + 0x44a2, 0x0005, 0x00f6, 0x7080, 0xa005, 0x01b0, 0x2011, 0x494f, + 0x080c, 0x6742, 0xa086, 0x0084, 0x1168, 0x2079, 0xb680, 0x7a30, + 0xa296, 0x1106, 0x1138, 0x7834, 0xa005, 0x1120, 0x708b, 0x0018, + 0x0029, 0x0010, 0x080c, 0x4992, 0x00fe, 0x0005, 0x708b, 0x0019, + 0x080c, 0x4a18, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, + 0xb68e, 0x2039, 0xb60e, 0x27a0, 0x20a9, 0x0040, 0x53a3, 0x080c, + 0x4a5d, 0x11e8, 0x2728, 0x2514, 0x8207, 0xa084, 0x00ff, 0x8000, + 0x2018, 0xa294, 0x00ff, 0x8007, 0xa205, 0x202a, 0x7050, 0x2310, + 0x8214, 0xa2a0, 0xb60e, 0x2414, 0xa38c, 0x0001, 0x0118, 0xa294, + 0xff00, 0x0018, 0xa294, 0x00ff, 0x8007, 0xa215, 0x2222, 0x2798, + 0x26a0, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x60c3, 0x0084, 0x080c, 0x4979, 0x0005, 0x00f6, 0x7080, 0xa005, + 0x01d0, 0x2011, 0x494f, 0x080c, 0x6742, 0xa086, 0x0084, 0x1188, + 0x2079, 0xb680, 0x7a30, 0xa296, 0x1107, 0x1158, 0x7834, 0xa005, + 0x1140, 0x7087, 0x0001, 0x080c, 0x49fe, 0x708b, 0x001a, 0x0029, + 0x0010, 0x080c, 0x4992, 0x00fe, 0x0005, 0x708b, 0x001b, 0x20e1, + 0x9080, 0x20e1, 0x4000, 0x2099, 0xb680, 0x20a1, 0x020b, 0x7480, + 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8, + 0x53a6, 0x60c3, 0x0084, 0x080c, 0x4979, 0x0005, 0x0005, 0x0005, + 0x0086, 0x0096, 0x2029, 0xb153, 0x252c, 0x20a9, 0x0008, 0x2041, + 0xb60e, 0x28a0, 0x2099, 0xb68e, 0x53a3, 0x20a9, 0x0008, 0x2011, + 0x0007, 0xd5d4, 0x0110, 0x2011, 0x0000, 0x2800, 0xa200, 0x200c, + 0xa1a6, 0xffff, 0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211, + 0x1f04, 0x489d, 0x0804, 0x490b, 0x82ff, 0x1160, 0xd5d4, 0x0120, + 0xa1a6, 0x3fff, 0x0d90, 0x0020, 0xa1a6, 0x3fff, 0x0904, 0x490b, + 0xa18d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110, + 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424, + 0x1240, 0xd5d4, 0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x48c3, + 0x04d0, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x48d5, + 0x2328, 0x8529, 0xa2be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007, + 0x2200, 0xa73a, 0x000e, 0x27a8, 0xa5a8, 0x0010, 0x1f04, 0x48e4, + 0x754e, 0xa5c8, 0x2c8c, 0x292d, 0xa5ac, 0x00ff, 0x7572, 0x6532, + 0x6536, 0x0016, 0x2508, 0x080c, 0x2720, 0x001e, 0x60e7, 0x0000, + 0x65ea, 0x2018, 0x2304, 0xa405, 0x201a, 0x7077, 0x0001, 0x26a0, + 0x2898, 0x20a9, 0x0008, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0xa085, 0x0001, 0x0028, 0xa006, 0x0018, 0xa006, 0x080c, 0x14fa, + 0x009e, 0x008e, 0x0005, 0x2118, 0x2021, 0x0000, 0x2001, 0x0007, + 0xa39a, 0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0, 0x2118, 0x84ff, + 0x0120, 0xa39a, 0x0010, 0x8421, 0x1de0, 0x2021, 0x0001, 0x83ff, + 0x0118, 0x8423, 0x8319, 0x1de8, 0xa238, 0x2704, 0xa42c, 0x11b8, + 0xa405, 0x203a, 0x714e, 0xa1a0, 0x2c8c, 0x242d, 0xa5ac, 0x00ff, + 0x7572, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x2720, 0x001e, + 0x60e7, 0x0000, 0x65ea, 0x7077, 0x0001, 0xa084, 0x0000, 0x0005, + 0x00e6, 0x2071, 0xb100, 0x707b, 0x0000, 0x00ee, 0x0005, 0x00e6, + 0x00f6, 0x2079, 0x0100, 0x2071, 0x0140, 0x080c, 0x7a8c, 0x7004, + 0xa084, 0x4000, 0x0120, 0x7003, 0x1000, 0x7003, 0x0000, 0x0126, + 0x2091, 0x8000, 0x2071, 0xb122, 0x2073, 0x0000, 0x7840, 0x0026, + 0x0016, 0x2009, 0x00f7, 0x080c, 0x4a24, 0x001e, 0xa094, 0x0010, + 0xa285, 0x0080, 0x7842, 0x7a42, 0x002e, 0x012e, 0x00fe, 0x00ee, + 0x0005, 0x0126, 0x2091, 0x8000, 0x2011, 0xb3e3, 0x2013, 0x0000, + 0x7083, 0x0000, 0x012e, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, + 0x9575, 0x080c, 0x7a83, 0x2009, 0x07d0, 0x2011, 0x494f, 0x080c, + 0x67c8, 0x0005, 0x0016, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, + 0x2011, 0x0003, 0x080c, 0x7d52, 0x2011, 0x0002, 0x080c, 0x7d5c, + 0x080c, 0x7c41, 0x080c, 0x67b6, 0x0036, 0x2019, 0x0000, 0x080c, + 0x7cc4, 0x003e, 0x2009, 0x00f7, 0x080c, 0x4a24, 0x2061, 0xb3ec, + 0x601b, 0x0000, 0x601f, 0x0000, 0x2061, 0xb100, 0x6003, 0x0001, + 0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x002d, + 0x2011, 0x49c9, 0x080c, 0x6736, 0x012e, 0x00ce, 0x002e, 0x001e, + 0x0005, 0x00e6, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x0100, + 0x080c, 0x7a8c, 0x2071, 0x0140, 0x7004, 0xa084, 0x4000, 0x0120, + 0x7003, 0x1000, 0x7003, 0x0000, 0x080c, 0x58dd, 0x01a8, 0x080c, + 0x58fb, 0x1190, 0x2001, 0xb39e, 0x2003, 0xaaaa, 0x0016, 0x080c, + 0x27c4, 0x2001, 0xb38f, 0x2102, 0x001e, 0x2001, 0xb39f, 0x2003, + 0x0000, 0x080c, 0x5816, 0x0030, 0x2001, 0x0001, 0x080c, 0x269e, + 0x080c, 0x4992, 0x012e, 0x000e, 0x00ee, 0x0005, 0x20a9, 0x0040, + 0x20a1, 0xb7c0, 0x2099, 0xb68e, 0x3304, 0x8007, 0x20a2, 0x9398, + 0x94a0, 0x1f04, 0x4a04, 0x0005, 0x20e1, 0x9080, 0x20e1, 0x4000, + 0x2099, 0xb600, 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x0005, + 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0xb680, 0x20a1, 0x020b, + 0x20a9, 0x000c, 0x53a6, 0x0005, 0x00c6, 0x0006, 0x2061, 0x0100, + 0x810f, 0x2001, 0xb130, 0x2004, 0xa005, 0x1138, 0x2001, 0xb114, + 0x2004, 0xa084, 0x00ff, 0xa105, 0x0010, 0xa185, 0x00f7, 0x604a, + 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x2001, 0xb153, 0x2004, + 0xd0a4, 0x0158, 0xa006, 0x2020, 0x2009, 0x002a, 0x080c, 0xacae, + 0x2001, 0xb10c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009, + 0x0000, 0x080c, 0x2b46, 0x004e, 0x001e, 0x0005, 0x080c, 0x4992, + 0x708b, 0x0000, 0x7083, 0x0000, 0x0005, 0x0006, 0x2001, 0xb10c, + 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005, 0x0006, 0x0016, 0x0126, + 0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0xa18d, 0x0006, 0x2102, + 0x012e, 0x001e, 0x000e, 0x0005, 0x0156, 0x20a9, 0x00ff, 0x2009, + 0xb235, 0xa006, 0x200a, 0x8108, 0x1f04, 0x4a7a, 0x015e, 0x0005, + 0x00d6, 0x0036, 0x0156, 0x0136, 0x0146, 0x2069, 0xb152, 0xa006, + 0x6002, 0x6007, 0x0707, 0x600a, 0x600e, 0x6012, 0xa198, 0x2c8c, + 0x231d, 0xa39c, 0x00ff, 0x6316, 0x20a9, 0x0004, 0xac98, 0x0006, + 0x23a0, 0x40a4, 0x20a9, 0x0004, 0xac98, 0x000a, 0x23a0, 0x40a4, + 0x603e, 0x6042, 0x604e, 0x6052, 0x6056, 0x605a, 0x605e, 0x6062, + 0x6066, 0x606a, 0x606e, 0x6072, 0x6076, 0x607a, 0x607e, 0x6082, + 0x6086, 0x608a, 0x608e, 0x6092, 0x6096, 0x609a, 0x609e, 0x60ae, + 0x61a2, 0x00d6, 0x60a4, 0xa06d, 0x0110, 0x080c, 0x15f4, 0x60a7, + 0x0000, 0x60a8, 0xa06d, 0x0110, 0x080c, 0x15f4, 0x60ab, 0x0000, + 0x00de, 0xa006, 0x604a, 0x6810, 0x603a, 0x680c, 0x6046, 0x6814, + 0xa084, 0x00ff, 0x6042, 0x014e, 0x013e, 0x015e, 0x003e, 0x00de, + 0x0005, 0x0126, 0x2091, 0x8000, 0x6944, 0x6e48, 0xa684, 0x3fff, + 0xa082, 0x4000, 0x1a04, 0x4b8f, 0xa18c, 0xff00, 0x810f, 0xa182, + 0x00ff, 0x1a04, 0x4b94, 0x2001, 0xb10c, 0x2004, 0xa084, 0x0003, + 0x01c0, 0x2001, 0xb10c, 0x2004, 0xd084, 0x1904, 0x4b77, 0xa188, + 0xb235, 0x2104, 0xa065, 0x0904, 0x4b77, 0x6004, 0xa084, 0x00ff, + 0xa08e, 0x0006, 0x1904, 0x4b77, 0x6000, 0xd0c4, 0x0904, 0x4b77, + 0x0068, 0xa188, 0xb235, 0x2104, 0xa065, 0x0904, 0x4b5b, 0x6004, + 0xa084, 0x00ff, 0xa08e, 0x0006, 0x1904, 0x4b60, 0x60a4, 0xa00d, + 0x0118, 0x080c, 0x5046, 0x05d0, 0x60a8, 0xa00d, 0x0188, 0x080c, + 0x5091, 0x1170, 0x694c, 0xd1fc, 0x1118, 0x080c, 0x4d56, 0x0448, + 0x080c, 0x4d18, 0x694c, 0xd1ec, 0x1520, 0x080c, 0x4f3a, 0x0408, + 0x694c, 0xa184, 0xa000, 0x0178, 0xd1ec, 0x0140, 0xd1fc, 0x0118, + 0x080c, 0x4f49, 0x0028, 0x080c, 0x4f49, 0x0028, 0xd1fc, 0x0118, + 0x080c, 0x4d18, 0x0070, 0x6050, 0xa00d, 0x0130, 0x2d00, 0x200a, + 0x6803, 0x0000, 0x6052, 0x0028, 0x2d00, 0x6052, 0x604e, 0x6803, + 0x0000, 0x080c, 0x6a13, 0xa006, 0x012e, 0x0005, 0x2001, 0x0005, + 0x2009, 0x0000, 0x04e8, 0x2001, 0x0028, 0x2009, 0x0000, 0x04c0, + 0xa082, 0x0006, 0x12a0, 0x2001, 0xb134, 0x2004, 0xd0ac, 0x1160, + 0x60a0, 0xd0bc, 0x1148, 0x6100, 0xd1fc, 0x0904, 0x4b16, 0x2001, + 0x0029, 0x2009, 0x1000, 0x0420, 0x2001, 0x0028, 0x00a8, 0x2009, + 0xb10c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0068, 0xd184, + 0x0118, 0x2001, 0x0004, 0x0040, 0x2001, 0x0029, 0x6100, 0xd1fc, + 0x0118, 0x2009, 0x1000, 0x0060, 0x2009, 0x0000, 0x0048, 0x2001, + 0x0029, 0x2009, 0x0000, 0x0020, 0x2001, 0x0029, 0x2009, 0x0000, + 0xa005, 0x012e, 0x0005, 0x00e6, 0x0126, 0x2091, 0x8000, 0x6844, + 0x8007, 0xa084, 0x00ff, 0x2008, 0xa182, 0x00ff, 0x1a04, 0x4bee, + 0xa188, 0xb235, 0x2104, 0xa065, 0x01c0, 0x6004, 0xa084, 0x00ff, + 0xa08e, 0x0006, 0x11a8, 0x2c70, 0x080c, 0x8295, 0x05e8, 0x2e00, + 0x601a, 0x2d00, 0x6012, 0x600b, 0xffff, 0x601f, 0x000a, 0x2009, + 0x0003, 0x080c, 0x831a, 0xa006, 0x0460, 0x2001, 0x0028, 0x0440, + 0xa082, 0x0006, 0x1298, 0x2001, 0xb134, 0x2004, 0xd0ac, 0x1158, + 0x60a0, 0xd0bc, 0x1140, 0x6100, 0xd1fc, 0x09e8, 0x2001, 0x0029, + 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028, 0x0090, 0x2009, 0xb10c, + 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0050, 0xd184, 0x0118, + 0x2001, 0x0004, 0x0028, 0x2001, 0x0029, 0x0010, 0x2001, 0x0029, + 0xa005, 0x012e, 0x00ee, 0x0005, 0x2001, 0x002c, 0x0cc8, 0x00f6, + 0x00e6, 0x0126, 0x2091, 0x8000, 0x2011, 0x0000, 0x2079, 0xb100, + 0x6944, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff, 0x1a04, 0x4cbc, + 0x2001, 0xb10c, 0x2004, 0xa084, 0x0003, 0x1904, 0x4caa, 0x080c, + 0x4e21, 0x1180, 0x6004, 0xa084, 0x00ff, 0xa082, 0x0006, 0x1250, + 0x2001, 0xb134, 0x2004, 0xd0ac, 0x1904, 0x4ca5, 0x60a0, 0xd0bc, + 0x1904, 0x4ca5, 0x6864, 0xa0c6, 0x006f, 0x0118, 0x2008, 0x0804, + 0x4c6e, 0x6968, 0x2140, 0xa18c, 0xff00, 0x810f, 0x78d0, 0xd0ac, + 0x1118, 0xa182, 0x0080, 0x06d0, 0xa182, 0x00ff, 0x16b8, 0x6a70, + 0x6b6c, 0x786c, 0xa306, 0x1160, 0x7870, 0xa24e, 0x1118, 0x2208, + 0x2310, 0x0460, 0xa9cc, 0xff00, 0x1118, 0x2208, 0x2310, 0x0430, + 0x080c, 0x3c52, 0x2c70, 0x0550, 0x2009, 0x0000, 0x2011, 0x0000, + 0xa0c6, 0x4000, 0x1160, 0x0006, 0x2e60, 0x080c, 0x50bc, 0x1108, + 0xc185, 0x7000, 0xd0bc, 0x0108, 0xc18d, 0x000e, 0x0088, 0xa0c6, + 0x4007, 0x1110, 0x2408, 0x0060, 0xa0c6, 0x4008, 0x1118, 0x2708, + 0x2610, 0x0030, 0xa0c6, 0x4009, 0x1108, 0x0010, 0x2001, 0x4006, + 0x6866, 0x696a, 0x6a6e, 0x2001, 0x0030, 0x0450, 0x080c, 0x8295, + 0x1138, 0x2001, 0x4005, 0x2009, 0x0003, 0x2011, 0x0000, 0x0c80, + 0x2e00, 0x601a, 0x080c, 0x9c35, 0x2d00, 0x6012, 0x601f, 0x0001, + 0x6838, 0xd88c, 0x0108, 0xc0f5, 0x683a, 0x0126, 0x2091, 0x8000, + 0x080c, 0x2b73, 0x012e, 0x2001, 0x0000, 0x080c, 0x4d63, 0x2001, + 0x0002, 0x080c, 0x4d75, 0x2009, 0x0002, 0x080c, 0x831a, 0xa006, + 0xa005, 0x012e, 0x00ee, 0x00fe, 0x0005, 0x2001, 0x0028, 0x2009, + 0x0000, 0x0cb0, 0x2009, 0xb10c, 0x210c, 0xd18c, 0x0118, 0x2001, + 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001, + 0x0029, 0x2009, 0x0000, 0x0c20, 0x2001, 0x0029, 0x2009, 0x0000, + 0x08f8, 0x6944, 0x6e48, 0xa684, 0x3fff, 0xa082, 0x4000, 0x16b8, + 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff, 0x12e0, 0xa188, 0xb235, + 0x2104, 0xa065, 0x01b8, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, + 0x11b0, 0x684c, 0xd0ec, 0x0120, 0x080c, 0x4f49, 0x04c9, 0x0030, + 0x04b9, 0x684c, 0xd0fc, 0x0110, 0x080c, 0x4f3a, 0x080c, 0x4f87, + 0xa006, 0x00c8, 0x2001, 0x0028, 0x2009, 0x0000, 0x00a0, 0xa082, + 0x0006, 0x1240, 0x6100, 0xd1fc, 0x0d20, 0x2001, 0x0029, 0x2009, + 0x1000, 0x0048, 0x2001, 0x0029, 0x2009, 0x0000, 0x0020, 0x2001, + 0x0029, 0x2009, 0x0000, 0xa005, 0x0005, 0x0126, 0x2091, 0x8000, + 0x6050, 0xa00d, 0x0138, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, + 0x012e, 0x0005, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0cc0, + 0x0126, 0x2091, 0x8000, 0x604c, 0xa005, 0x0170, 0x00e6, 0x2071, + 0xb3d9, 0x7004, 0xa086, 0x0002, 0x0168, 0x00ee, 0x604c, 0x6802, + 0x2d00, 0x604e, 0x012e, 0x0005, 0x2d00, 0x6052, 0x604e, 0x6803, + 0x0000, 0x0cc0, 0x701c, 0xac06, 0x1d80, 0x604c, 0x2070, 0x7000, + 0x6802, 0x2d00, 0x7002, 0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, + 0x8000, 0x604c, 0xa06d, 0x0130, 0x6800, 0xa005, 0x1108, 0x6052, + 0x604e, 0xad05, 0x012e, 0x0005, 0x604c, 0xa06d, 0x0130, 0x6800, + 0xa005, 0x1108, 0x6052, 0x604e, 0xad05, 0x0005, 0x6803, 0x0000, + 0x6084, 0xa00d, 0x0120, 0x2d00, 0x200a, 0x6086, 0x0005, 0x2d00, + 0x6086, 0x6082, 0x0cd8, 0x0126, 0x00c6, 0x0026, 0x2091, 0x8000, + 0x6218, 0x2260, 0x6200, 0xa005, 0x0110, 0xc285, 0x0008, 0xc284, + 0x6202, 0x002e, 0x00ce, 0x012e, 0x0005, 0x0126, 0x00c6, 0x2091, + 0x8000, 0x6218, 0x2260, 0x6204, 0x0006, 0xa086, 0x0006, 0x1180, + 0x609c, 0xd0ac, 0x0168, 0x2001, 0xb153, 0x2004, 0xd0a4, 0x0140, + 0xa284, 0xff00, 0x8007, 0xa086, 0x0007, 0x1110, 0x2011, 0x0600, + 0x000e, 0xa294, 0xff00, 0xa215, 0x6206, 0x0006, 0xa086, 0x0006, + 0x1128, 0x6290, 0x82ff, 0x1110, 0x080c, 0x14fa, 0x000e, 0x00ce, + 0x012e, 0x0005, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6218, 0x2260, + 0x6204, 0x0006, 0xa086, 0x0006, 0x1178, 0x609c, 0xd0a4, 0x0160, + 0x2001, 0xb153, 0x2004, 0xd0ac, 0x1138, 0xa284, 0x00ff, 0xa086, + 0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0xa294, 0x00ff, 0x8007, + 0xa215, 0x6206, 0x00ce, 0x012e, 0x0005, 0x0026, 0xa182, 0x00ff, + 0x0218, 0xa085, 0x0001, 0x00b0, 0xa190, 0xb235, 0x2204, 0xa065, + 0x1180, 0x0016, 0x00d6, 0x080c, 0x15c4, 0x2d60, 0x00de, 0x001e, + 0x0d80, 0x2c00, 0x2012, 0x60a7, 0x0000, 0x60ab, 0x0000, 0x080c, + 0x4a80, 0xa006, 0x002e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0026, + 0xa182, 0x00ff, 0x0218, 0xa085, 0x0001, 0x0480, 0x00d6, 0xa190, + 0xb235, 0x2204, 0xa06d, 0x0540, 0x2013, 0x0000, 0x00d6, 0x00c6, + 0x2d60, 0x60a4, 0xa06d, 0x0110, 0x080c, 0x15f4, 0x60a8, 0xa06d, + 0x0110, 0x080c, 0x15f4, 0x00ce, 0x00de, 0x00d6, 0x00c6, 0x68ac, + 0x2060, 0x8cff, 0x0168, 0x600c, 0x0006, 0x6010, 0x2068, 0x080c, + 0x986a, 0x0110, 0x080c, 0x1604, 0x080c, 0x82eb, 0x00ce, 0x0c88, + 0x00ce, 0x00de, 0x080c, 0x15f4, 0x00de, 0xa006, 0x002e, 0x012e, + 0x0005, 0x0016, 0xa182, 0x00ff, 0x0218, 0xa085, 0x0001, 0x0030, + 0xa188, 0xb235, 0x2104, 0xa065, 0x0dc0, 0xa006, 0x001e, 0x0005, + 0x00d6, 0x0156, 0x0136, 0x0146, 0x600b, 0x0000, 0x600f, 0x0000, + 0x6000, 0xc08c, 0x6002, 0x080c, 0x58d5, 0x1538, 0x60a0, 0xa086, + 0x007e, 0x2069, 0xb690, 0x0130, 0x2001, 0xb134, 0x2004, 0xd0ac, + 0x11e0, 0x0098, 0x2d04, 0xd0e4, 0x01c0, 0x00d6, 0x2069, 0xb68e, + 0x00c6, 0x2061, 0xb3b1, 0x6810, 0x2062, 0x6814, 0x6006, 0x6818, + 0x600a, 0x681c, 0x600e, 0x00ce, 0x00de, 0x8d69, 0x2d04, 0x2069, + 0x0140, 0x6886, 0x2069, 0xb100, 0x68a2, 0x2069, 0xb68e, 0x6808, + 0x605e, 0x6810, 0x6062, 0x6138, 0xa10a, 0x0208, 0x603a, 0x6814, + 0x6066, 0x2099, 0xb696, 0xac88, 0x000a, 0x21a0, 0x20a9, 0x0004, + 0x53a3, 0x2099, 0xb69a, 0xac88, 0x0006, 0x21a0, 0x20a9, 0x0004, + 0x53a3, 0x2069, 0xb6ae, 0x6808, 0x606a, 0x690c, 0x616e, 0x6810, + 0x6072, 0x6818, 0x6076, 0x60a0, 0xa086, 0x007e, 0x1120, 0x2069, + 0xb68e, 0x690c, 0x616e, 0xa182, 0x0211, 0x1218, 0x2009, 0x0008, + 0x0400, 0xa182, 0x0259, 0x1218, 0x2009, 0x0007, 0x00d0, 0xa182, + 0x02c1, 0x1218, 0x2009, 0x0006, 0x00a0, 0xa182, 0x0349, 0x1218, + 0x2009, 0x0005, 0x0070, 0xa182, 0x0421, 0x1218, 0x2009, 0x0004, + 0x0040, 0xa182, 0x0581, 0x1218, 0x2009, 0x0003, 0x0010, 0x2009, + 0x0002, 0x6192, 0x014e, 0x013e, 0x015e, 0x00de, 0x0005, 0x0016, + 0x0026, 0x00e6, 0x2071, 0xb68d, 0x2e04, 0x6896, 0x2071, 0xb68e, + 0x7004, 0x689a, 0x701c, 0x689e, 0x6a00, 0x2009, 0xb172, 0x210c, + 0xd0bc, 0x0120, 0xd1ec, 0x0110, 0xc2ad, 0x0008, 0xc2ac, 0xd0c4, + 0x0120, 0xd1e4, 0x0110, 0xc2bd, 0x0008, 0xc2bc, 0x6a02, 0x00ee, + 0x002e, 0x001e, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x60a4, + 0xa06d, 0x01c0, 0x6900, 0x81ff, 0x1540, 0x6a04, 0xa282, 0x0010, + 0x1648, 0xad88, 0x0004, 0x20a9, 0x0010, 0x2104, 0xa086, 0xffff, + 0x0128, 0x8108, 0x1f04, 0x4ef5, 0x080c, 0x14fa, 0x260a, 0x8210, + 0x6a06, 0x0098, 0x080c, 0x15dd, 0x01a8, 0x2d00, 0x60a6, 0x6803, + 0x0000, 0xad88, 0x0004, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108, + 0x1f04, 0x4f0d, 0x6807, 0x0001, 0x6e12, 0xa085, 0x0001, 0x012e, + 0x00de, 0x0005, 0xa006, 0x0cd8, 0x0126, 0x2091, 0x8000, 0x00d6, + 0x60a4, 0xa00d, 0x01a0, 0x2168, 0x6800, 0xa005, 0x1160, 0x080c, + 0x5046, 0x1168, 0x200b, 0xffff, 0x6804, 0xa08a, 0x0002, 0x0218, + 0x8001, 0x6806, 0x0020, 0x080c, 0x15f4, 0x60a7, 0x0000, 0x00de, + 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x50a4, 0x0010, + 0x080c, 0x4d05, 0x080c, 0x4fbe, 0x1dd8, 0x080c, 0x4f87, 0x012e, + 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x60a8, 0xa06d, 0x01c0, + 0x6950, 0x81ff, 0x1540, 0x6a54, 0xa282, 0x0010, 0x1670, 0xad88, + 0x0018, 0x20a9, 0x0010, 0x2104, 0xa086, 0xffff, 0x0128, 0x8108, + 0x1f04, 0x4f5b, 0x080c, 0x14fa, 0x260a, 0x8210, 0x6a56, 0x0098, + 0x080c, 0x15dd, 0x01d0, 0x2d00, 0x60aa, 0x6853, 0x0000, 0xad88, + 0x0018, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108, 0x1f04, 0x4f73, + 0x6857, 0x0001, 0x6e62, 0x0010, 0x080c, 0x4d56, 0x0089, 0x1de0, + 0xa085, 0x0001, 0x012e, 0x00de, 0x0005, 0xa006, 0x0cd8, 0x0126, + 0x2091, 0x8000, 0x080c, 0x6a13, 0x012e, 0x0005, 0xa01e, 0x0010, + 0x2019, 0x0001, 0xa00e, 0x0126, 0x2091, 0x8000, 0x604c, 0x2068, + 0x6000, 0xd0dc, 0x1170, 0x8dff, 0x01e8, 0x83ff, 0x0120, 0x6848, + 0xa606, 0x0158, 0x0030, 0x683c, 0xa406, 0x1118, 0x6840, 0xa506, + 0x0120, 0x2d08, 0x6800, 0x2068, 0x0c70, 0x6a00, 0x604c, 0xad06, + 0x1110, 0x624e, 0x0018, 0xa180, 0x0000, 0x2202, 0x82ff, 0x1110, + 0x6152, 0x8dff, 0x012e, 0x0005, 0xa01e, 0x0010, 0x2019, 0x0001, + 0xa00e, 0x6080, 0x2068, 0x8dff, 0x01e8, 0x83ff, 0x0120, 0x6848, + 0xa606, 0x0158, 0x0030, 0x683c, 0xa406, 0x1118, 0x6840, 0xa506, + 0x0120, 0x2d08, 0x6800, 0x2068, 0x0c70, 0x6a00, 0x6080, 0xad06, + 0x1110, 0x6282, 0x0018, 0xa180, 0x0000, 0x2202, 0x82ff, 0x1110, + 0x6186, 0x8dff, 0x0005, 0xa016, 0x080c, 0x5040, 0x1110, 0x2011, + 0x0001, 0x080c, 0x508b, 0x1110, 0xa295, 0x0002, 0x0005, 0x080c, + 0x50bc, 0x0118, 0x080c, 0x9928, 0x0010, 0xa085, 0x0001, 0x0005, + 0x080c, 0x50bc, 0x0118, 0x080c, 0x98b8, 0x0010, 0xa085, 0x0001, + 0x0005, 0x080c, 0x50bc, 0x0118, 0x080c, 0x990b, 0x0010, 0xa085, + 0x0001, 0x0005, 0x080c, 0x50bc, 0x0118, 0x080c, 0x98d4, 0x0010, + 0xa085, 0x0001, 0x0005, 0x080c, 0x50bc, 0x0118, 0x080c, 0x9944, + 0x0010, 0xa085, 0x0001, 0x0005, 0x0126, 0x0006, 0x00d6, 0x2091, + 0x8000, 0x6080, 0xa06d, 0x01a0, 0x6800, 0x0006, 0x6837, 0x0103, + 0x6b4a, 0x6847, 0x0000, 0x080c, 0x9ada, 0x0006, 0x6000, 0xd0fc, + 0x0110, 0x080c, 0xaf4f, 0x000e, 0x080c, 0x5271, 0x000e, 0x0c50, + 0x6083, 0x0000, 0x6087, 0x0000, 0x00de, 0x000e, 0x012e, 0x0005, + 0x60a4, 0xa00d, 0x1118, 0xa085, 0x0001, 0x0005, 0x00e6, 0x2170, + 0x7000, 0xa005, 0x1168, 0x20a9, 0x0010, 0xae88, 0x0004, 0x2104, + 0xa606, 0x0130, 0x8108, 0x1f04, 0x504f, 0xa085, 0x0001, 0x0008, + 0xa006, 0x00ee, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x60a4, + 0xa06d, 0x1128, 0x080c, 0x15dd, 0x01a0, 0x2d00, 0x60a6, 0x6803, + 0x0001, 0x6807, 0x0000, 0xad88, 0x0004, 0x20a9, 0x0010, 0x200b, + 0xffff, 0x8108, 0x1f04, 0x506f, 0xa085, 0x0001, 0x012e, 0x00de, + 0x0005, 0xa006, 0x0cd8, 0x00d6, 0x0126, 0x2091, 0x8000, 0x60a4, + 0xa06d, 0x0130, 0x60a7, 0x0000, 0x080c, 0x15f4, 0xa085, 0x0001, + 0x012e, 0x00de, 0x0005, 0x60a8, 0xa00d, 0x1118, 0xa085, 0x0001, + 0x0005, 0x00e6, 0x2170, 0x7050, 0xa005, 0x1160, 0x20a9, 0x0010, + 0xae88, 0x0018, 0x2104, 0xa606, 0x0128, 0x8108, 0x1f04, 0x509a, + 0xa085, 0x0001, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x0c19, + 0x1188, 0x200b, 0xffff, 0x00d6, 0x60a8, 0x2068, 0x6854, 0xa08a, + 0x0002, 0x0218, 0x8001, 0x6856, 0x0020, 0x080c, 0x15f4, 0x60ab, + 0x0000, 0x00de, 0x012e, 0x0005, 0x609c, 0xd0a4, 0x0005, 0x00f6, + 0x080c, 0x58d5, 0x01b0, 0x71b4, 0x81ff, 0x1198, 0x71d0, 0xd19c, + 0x0180, 0x2001, 0x007e, 0xa080, 0xb235, 0x2004, 0xa07d, 0x0148, + 0x7804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x1118, 0x7800, 0xc0ed, + 0x7802, 0x2079, 0xb152, 0x7804, 0xd0a4, 0x01e8, 0x0156, 0x00c6, + 0x20a9, 0x007f, 0x2009, 0x0000, 0x0016, 0x080c, 0x4e21, 0x1168, + 0x6004, 0xa084, 0xff00, 0x8007, 0xa096, 0x0004, 0x0118, 0xa086, + 0x0006, 0x1118, 0x6000, 0xc0ed, 0x6002, 0x001e, 0x8108, 0x1f04, + 0x50e4, 0x00ce, 0x015e, 0x080c, 0x517b, 0x0120, 0x2001, 0xb3b4, + 0x200c, 0x0038, 0x2079, 0xb152, 0x7804, 0xd0a4, 0x0130, 0x2009, + 0x07d0, 0x2011, 0x510f, 0x080c, 0x67c8, 0x00fe, 0x0005, 0x2011, + 0x510f, 0x080c, 0x6742, 0x080c, 0x517b, 0x01f0, 0x2001, 0xb2b3, + 0x2004, 0xa080, 0x0000, 0x200c, 0xc1ec, 0x2102, 0x2001, 0xb153, + 0x2004, 0xd0a4, 0x0130, 0x2009, 0x07d0, 0x2011, 0x510f, 0x080c, + 0x67c8, 0x00e6, 0x2071, 0xb100, 0x706f, 0x0000, 0x7073, 0x0000, + 0x080c, 0x2991, 0x00ee, 0x04b0, 0x0156, 0x00c6, 0x20a9, 0x007f, + 0x2009, 0x0000, 0x0016, 0x080c, 0x4e21, 0x1530, 0x6000, 0xd0ec, + 0x0518, 0x0046, 0x62a0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, + 0x0029, 0x080c, 0xacae, 0x6000, 0xc0e5, 0xc0ec, 0x6002, 0x6004, + 0xa084, 0x00ff, 0xa085, 0x0700, 0x6006, 0x2019, 0x0029, 0x080c, + 0x6b35, 0x0076, 0x2039, 0x0000, 0x080c, 0x6a6b, 0x2009, 0x0000, + 0x080c, 0xaa51, 0x007e, 0x004e, 0x001e, 0x8108, 0x1f04, 0x513a, + 0x00ce, 0x015e, 0x0005, 0x00c6, 0x6018, 0x2060, 0x6000, 0xc0ec, + 0x6002, 0x00ce, 0x0005, 0x7818, 0x2004, 0xd0ac, 0x0005, 0x7818, + 0x2004, 0xd0bc, 0x0005, 0x00f6, 0x2001, 0xb2b3, 0x2004, 0xa07d, + 0x0110, 0x7800, 0xd0ec, 0x00fe, 0x0005, 0x0126, 0x0026, 0x2091, + 0x8000, 0x6200, 0xa005, 0x0110, 0xc2fd, 0x0008, 0xc2fc, 0x6202, + 0x002e, 0x012e, 0x0005, 0x2011, 0xb134, 0x2204, 0xd0cc, 0x0138, + 0x2001, 0xb3b2, 0x200c, 0x2011, 0x51a0, 0x080c, 0x67c8, 0x0005, + 0x2011, 0x51a0, 0x080c, 0x6742, 0x2011, 0xb134, 0x2204, 0xc0cc, + 0x2012, 0x0005, 0x2071, 0xb214, 0x7003, 0x0001, 0x7007, 0x0000, + 0x7013, 0x0000, 0x7017, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, + 0x700b, 0x0000, 0x704b, 0x0001, 0x704f, 0x0000, 0x705b, 0x0020, + 0x705f, 0x0040, 0x707f, 0x0000, 0x2071, 0xb37d, 0x7003, 0xb214, + 0x7007, 0x0000, 0x700b, 0x0000, 0x700f, 0xb35d, 0x7013, 0x0020, + 0x7017, 0x0040, 0x7037, 0x0000, 0x0005, 0x0016, 0x00e6, 0x2071, + 0xb335, 0xa00e, 0x7186, 0x718a, 0x7097, 0x0001, 0x2001, 0xb153, + 0x2004, 0xd0fc, 0x1150, 0x2001, 0xb153, 0x2004, 0xa00e, 0xd09c, + 0x0108, 0x8108, 0x7102, 0x0804, 0x523b, 0x2001, 0xb172, 0x200c, + 0xa184, 0x000f, 0x2009, 0xb173, 0x210c, 0x0002, 0x51e3, 0x5216, + 0x521d, 0x5227, 0x522c, 0x51e3, 0x51e3, 0x51e3, 0x5206, 0x51e3, + 0x51e3, 0x51e3, 0x51e3, 0x51e3, 0x51e3, 0x51e3, 0x7003, 0x0004, + 0x0136, 0x0146, 0x0156, 0x2099, 0xb176, 0x20a1, 0xb386, 0x20a9, + 0x0004, 0x53a3, 0x015e, 0x014e, 0x013e, 0x0428, 0x708f, 0x0005, + 0x7007, 0x0122, 0x2001, 0x0002, 0x0030, 0x708f, 0x0002, 0x7007, + 0x0121, 0x2001, 0x0003, 0x7002, 0x7097, 0x0001, 0x0088, 0x7007, + 0x0122, 0x2001, 0x0002, 0x0020, 0x7007, 0x0121, 0x2001, 0x0003, + 0x7002, 0xa006, 0x7096, 0x708e, 0xa184, 0xff00, 0x8007, 0x709a, + 0xa184, 0x00ff, 0x7092, 0x00ee, 0x001e, 0x0005, 0x00e6, 0x2071, + 0xb214, 0x684c, 0xa005, 0x1130, 0x7028, 0xc085, 0x702a, 0xa085, + 0x0001, 0x0428, 0x6a60, 0x7236, 0x6b64, 0x733a, 0x6868, 0x703e, + 0x7076, 0x686c, 0x7042, 0x707a, 0x684c, 0x702e, 0x6844, 0x7032, + 0x2009, 0x000d, 0x200a, 0x700b, 0x0000, 0x8007, 0x8006, 0x8006, + 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, 0x726e, + 0x7372, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0xa006, 0x00ee, + 0x0005, 0x0156, 0x00e6, 0x0026, 0x6838, 0xd0fc, 0x1904, 0x52ca, + 0x6804, 0xa00d, 0x0188, 0x00d6, 0x2071, 0xb100, 0xa016, 0x702c, + 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x1dc8, 0x702e, + 0x70b0, 0xa200, 0x70b2, 0x00de, 0x2071, 0xb214, 0x701c, 0xa005, + 0x1904, 0x52da, 0x20a9, 0x0032, 0x0f04, 0x52d8, 0x0e04, 0x5294, + 0x2071, 0xb335, 0x7200, 0x82ff, 0x05d8, 0x6934, 0xa186, 0x0103, + 0x1904, 0x52e8, 0x6948, 0x6844, 0xa105, 0x1540, 0x2009, 0x8020, + 0x2200, 0x0002, 0x52d8, 0x52af, 0x5300, 0x530c, 0x52d8, 0x2071, + 0x0000, 0x20a9, 0x0032, 0x0f04, 0x52d8, 0x7018, 0xd084, 0x1dd8, + 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, + 0x4080, 0x2071, 0xb100, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70b0, + 0x8000, 0x70b2, 0x002e, 0x00ee, 0x015e, 0x0005, 0x6844, 0xa086, + 0x0100, 0x1130, 0x6868, 0xa005, 0x1118, 0x2009, 0x8020, 0x0880, + 0x2071, 0xb214, 0x2d08, 0x206b, 0x0000, 0x7010, 0x8000, 0x7012, + 0x7018, 0xa06d, 0x711a, 0x0110, 0x6902, 0x0008, 0x711e, 0x0c10, + 0xa18c, 0x00ff, 0xa186, 0x0017, 0x0130, 0xa186, 0x001e, 0x0118, + 0xa18e, 0x001f, 0x1d28, 0x684c, 0xd0cc, 0x0d10, 0x6850, 0xa084, + 0x00ff, 0xa086, 0x0001, 0x19e0, 0x2009, 0x8021, 0x0804, 0x52a8, + 0x7084, 0x8008, 0xa092, 0x001e, 0x1a98, 0x7186, 0xae90, 0x0003, + 0xa210, 0x683c, 0x2012, 0x0078, 0x7084, 0x8008, 0xa092, 0x000f, + 0x1a38, 0x7186, 0xae90, 0x0003, 0x8003, 0xa210, 0x683c, 0x2012, + 0x8210, 0x6840, 0x2012, 0x7088, 0xa10a, 0x0a04, 0x52c1, 0x718c, + 0x7084, 0xa10a, 0x0a04, 0x52c1, 0x2071, 0x0000, 0x7018, 0xd084, + 0x1904, 0x52c1, 0x2071, 0xb335, 0x7000, 0xa086, 0x0002, 0x1150, + 0x080c, 0x558b, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, + 0x0804, 0x52c1, 0x080c, 0x55b5, 0x2071, 0x0000, 0x701b, 0x0001, + 0x2091, 0x4080, 0x0804, 0x52c1, 0x0006, 0x684c, 0x0006, 0x6837, + 0x0103, 0x20a9, 0x001c, 0xad80, 0x0011, 0x20a0, 0x2001, 0x0000, + 0x40a4, 0x000e, 0xa084, 0x00ff, 0x684e, 0x000e, 0x684a, 0x6952, + 0x0005, 0x2071, 0xb214, 0x7004, 0x0002, 0x5367, 0x5378, 0x5576, + 0x5577, 0x5584, 0x558a, 0x5368, 0x5567, 0x54fd, 0x5553, 0x0005, + 0x0126, 0x2091, 0x8000, 0x0e04, 0x5377, 0x2009, 0x000d, 0x7030, + 0x200a, 0x2091, 0x4080, 0x7007, 0x0001, 0x700b, 0x0000, 0x012e, + 0x2069, 0xb3ec, 0x683c, 0xa005, 0x03f8, 0x11f0, 0x0126, 0x2091, + 0x8000, 0x2069, 0x0000, 0x6934, 0x2001, 0xb220, 0x2004, 0xa10a, + 0x0170, 0x0e04, 0x539b, 0x2069, 0x0000, 0x6818, 0xd084, 0x1158, + 0x2009, 0x8040, 0x6922, 0x681b, 0x0001, 0x2091, 0x4080, 0x2069, + 0xb3ec, 0x683f, 0xffff, 0x012e, 0x2069, 0xb100, 0x6844, 0x6964, + 0xa102, 0x2069, 0xb335, 0x688a, 0x6984, 0x701c, 0xa06d, 0x0120, + 0x81ff, 0x0904, 0x53f1, 0x00a0, 0x81ff, 0x0904, 0x54b7, 0x2071, + 0xb335, 0x7184, 0x7088, 0xa10a, 0x1258, 0x7190, 0x2071, 0xb3ec, + 0x7038, 0xa005, 0x0128, 0x1b04, 0x54b7, 0x713a, 0x0804, 0x54b7, + 0x2071, 0xb335, 0x718c, 0x0126, 0x2091, 0x8000, 0x7084, 0xa10a, + 0x0a04, 0x54d2, 0x0e04, 0x5473, 0x2071, 0x0000, 0x7018, 0xd084, + 0x1904, 0x5473, 0x2001, 0xffff, 0x2071, 0xb3ec, 0x703a, 0x2071, + 0xb335, 0x7000, 0xa086, 0x0002, 0x1150, 0x080c, 0x558b, 0x2071, + 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0804, 0x5473, 0x080c, + 0x55b5, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0804, + 0x5473, 0x2071, 0xb335, 0x7000, 0xa005, 0x0904, 0x5499, 0x6934, + 0xa186, 0x0103, 0x1904, 0x5476, 0x684c, 0xd0bc, 0x1904, 0x5499, + 0x6948, 0x6844, 0xa105, 0x1904, 0x548e, 0x2009, 0x8020, 0x2071, + 0xb335, 0x7000, 0x0002, 0x5499, 0x5459, 0x5431, 0x5443, 0x5410, + 0x0136, 0x0146, 0x0156, 0x2099, 0xb176, 0x20a1, 0xb386, 0x20a9, + 0x0004, 0x53a3, 0x015e, 0x014e, 0x013e, 0x2071, 0xb37d, 0xad80, + 0x000f, 0x700e, 0x7013, 0x0002, 0x7007, 0x0002, 0x700b, 0x0000, + 0x2e10, 0x080c, 0x1628, 0x2071, 0xb214, 0x7007, 0x0009, 0x0804, + 0x54b7, 0x7084, 0x8008, 0xa092, 0x001e, 0x1a04, 0x54b7, 0xae90, + 0x0003, 0xa210, 0x683c, 0x2012, 0x7186, 0x2071, 0xb214, 0x080c, + 0x560c, 0x0804, 0x54b7, 0x7084, 0x8008, 0xa092, 0x000f, 0x1a04, + 0x54b7, 0xae90, 0x0003, 0x8003, 0xa210, 0x683c, 0x2012, 0x8210, + 0x6840, 0x2012, 0x7186, 0x2071, 0xb214, 0x080c, 0x560c, 0x0804, + 0x54b7, 0x0126, 0x2091, 0x8000, 0x0e04, 0x5473, 0x2071, 0x0000, + 0x7018, 0xd084, 0x1180, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, + 0x701b, 0x0001, 0x2091, 0x4080, 0x012e, 0x2071, 0xb214, 0x080c, + 0x560c, 0x0804, 0x54b7, 0x012e, 0x0804, 0x54b7, 0xa18c, 0x00ff, + 0xa186, 0x0017, 0x0130, 0xa186, 0x001e, 0x0118, 0xa18e, 0x001f, + 0x11c0, 0x684c, 0xd0cc, 0x01a8, 0x6850, 0xa084, 0x00ff, 0xa086, + 0x0001, 0x1178, 0x2009, 0x8021, 0x0804, 0x5407, 0x6844, 0xa086, + 0x0100, 0x1138, 0x6868, 0xa005, 0x1120, 0x2009, 0x8020, 0x0804, + 0x5407, 0x2071, 0xb214, 0x080c, 0x561e, 0x01c8, 0x2071, 0xb214, + 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff, 0xa086, 0x0003, 0x1130, + 0x810f, 0xa18c, 0x00ff, 0x8101, 0x0108, 0x710e, 0x7007, 0x0003, + 0x080c, 0x5637, 0x7050, 0xa086, 0x0100, 0x0904, 0x5577, 0x0126, + 0x2091, 0x8000, 0x2071, 0xb214, 0x7008, 0xa086, 0x0001, 0x1180, + 0x0e04, 0x54d0, 0x2009, 0x000d, 0x7030, 0x200a, 0x2091, 0x4080, + 0x700b, 0x0000, 0x7004, 0xa086, 0x0006, 0x1110, 0x7007, 0x0001, + 0x012e, 0x0005, 0x2071, 0xb214, 0x080c, 0x561e, 0x0518, 0x2071, + 0xb335, 0x7084, 0x700a, 0x20a9, 0x0020, 0x2099, 0xb336, 0x20a1, + 0xb35d, 0x53a3, 0x7087, 0x0000, 0x2071, 0xb214, 0x2069, 0xb37d, + 0x706c, 0x6826, 0x7070, 0x682a, 0x7074, 0x682e, 0x7078, 0x6832, + 0x2d10, 0x080c, 0x1628, 0x7007, 0x0008, 0x2001, 0xffff, 0x2071, + 0xb3ec, 0x703a, 0x012e, 0x0804, 0x54b7, 0x2069, 0xb37d, 0x6808, + 0xa08e, 0x0000, 0x0904, 0x5552, 0xa08e, 0x0200, 0x0904, 0x5550, + 0xa08e, 0x0100, 0x1904, 0x5552, 0x0126, 0x2091, 0x8000, 0x0e04, + 0x554e, 0x2069, 0x0000, 0x6818, 0xd084, 0x15c0, 0x702c, 0x7130, + 0x8108, 0xa102, 0x0230, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072, + 0x0048, 0x706c, 0xa080, 0x0040, 0x706e, 0x1220, 0x7070, 0xa081, + 0x0000, 0x7072, 0x7132, 0x6936, 0x700b, 0x0000, 0x2001, 0xb35a, + 0x2004, 0xa005, 0x1190, 0x6934, 0x2069, 0xb335, 0x689c, 0x699e, + 0x2069, 0xb3ec, 0xa102, 0x1118, 0x683c, 0xa005, 0x1368, 0x2001, + 0xb35b, 0x200c, 0x810d, 0x693e, 0x0038, 0x2009, 0x8040, 0x6922, + 0x681b, 0x0001, 0x2091, 0x4080, 0x7007, 0x0001, 0x012e, 0x0010, + 0x7007, 0x0005, 0x0005, 0x2001, 0xb37f, 0x2004, 0xa08e, 0x0100, + 0x1128, 0x7007, 0x0001, 0x080c, 0x560c, 0x0005, 0xa08e, 0x0000, + 0x0de0, 0xa08e, 0x0200, 0x1dc8, 0x7007, 0x0005, 0x0005, 0x701c, + 0xa06d, 0x0158, 0x080c, 0x561e, 0x0140, 0x7007, 0x0003, 0x080c, + 0x5637, 0x7050, 0xa086, 0x0100, 0x0110, 0x0005, 0x0005, 0x7050, + 0xa09e, 0x0100, 0x1118, 0x7007, 0x0004, 0x0030, 0xa086, 0x0200, + 0x1110, 0x7007, 0x0005, 0x0005, 0x080c, 0x55da, 0x7006, 0x080c, + 0x560c, 0x0005, 0x0005, 0x00e6, 0x0156, 0x2071, 0xb335, 0x7184, + 0x81ff, 0x0500, 0xa006, 0x7086, 0xae80, 0x0003, 0x2071, 0x0000, + 0x21a8, 0x2014, 0x7226, 0x8000, 0x0f04, 0x55af, 0x2014, 0x722a, + 0x8000, 0x0f04, 0x55af, 0x2014, 0x722e, 0x8000, 0x0f04, 0x55af, + 0x2014, 0x723a, 0x8000, 0x0f04, 0x55af, 0x2014, 0x723e, 0xa180, + 0x8030, 0x7022, 0x015e, 0x00ee, 0x0005, 0x00e6, 0x0156, 0x2071, + 0xb335, 0x7184, 0x81ff, 0x01d8, 0xa006, 0x7086, 0xae80, 0x0003, + 0x2071, 0x0000, 0x21a8, 0x2014, 0x7226, 0x8000, 0x2014, 0x722a, + 0x8000, 0x0f04, 0x55d1, 0x2014, 0x723a, 0x8000, 0x2014, 0x723e, + 0x0018, 0x2001, 0x8020, 0x0010, 0x2001, 0x8042, 0x7022, 0x015e, + 0x00ee, 0x0005, 0x702c, 0x7130, 0x8108, 0xa102, 0x0230, 0xa00e, + 0x7034, 0x706e, 0x7038, 0x7072, 0x0048, 0x706c, 0xa080, 0x0040, + 0x706e, 0x1220, 0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c, + 0x8001, 0x700e, 0x1180, 0x0126, 0x2091, 0x8000, 0x0e04, 0x5606, + 0x2001, 0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001, 0x700b, + 0x0000, 0x012e, 0x0005, 0x2001, 0x0007, 0x0005, 0x2001, 0x0006, + 0x700b, 0x0001, 0x012e, 0x0005, 0x701c, 0xa06d, 0x0170, 0x0126, + 0x2091, 0x8000, 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0xa005, + 0x1108, 0x701a, 0x012e, 0x080c, 0x15f4, 0x0005, 0x2019, 0x000d, + 0x2304, 0x230c, 0xa10e, 0x0130, 0x2304, 0x230c, 0xa10e, 0x0110, + 0xa006, 0x0060, 0x732c, 0x8319, 0x7130, 0xa102, 0x1118, 0x2300, + 0xa005, 0x0020, 0x0210, 0xa302, 0x0008, 0x8002, 0x0005, 0x2d00, + 0x7026, 0xa080, 0x000d, 0x7056, 0x7053, 0x0000, 0x0126, 0x2091, + 0x8000, 0x2009, 0xb408, 0x2104, 0xc08d, 0x200a, 0x012e, 0x080c, + 0x1640, 0x0005, 0x7088, 0xa08a, 0x0029, 0x1220, 0xa082, 0x001d, + 0x0033, 0x0010, 0x080c, 0x14fa, 0x6027, 0x1e00, 0x0005, 0x573d, + 0x56c0, 0x56d6, 0x5711, 0x5730, 0x5762, 0x5774, 0x56d6, 0x574e, + 0x5664, 0x5692, 0x5663, 0x0005, 0x00d6, 0x2069, 0x0200, 0x6804, + 0xa005, 0x1180, 0x6808, 0xa005, 0x1518, 0x708b, 0x0028, 0x2069, + 0xb3be, 0x2d04, 0x7002, 0x080c, 0x59d7, 0x6028, 0xa085, 0x0600, + 0x602a, 0x00b0, 0x708b, 0x0028, 0x2069, 0xb3be, 0x2d04, 0x7002, + 0x6028, 0xa085, 0x0600, 0x602a, 0x00e6, 0x0036, 0x0046, 0x0056, + 0x2071, 0xb419, 0x080c, 0x1d48, 0x005e, 0x004e, 0x003e, 0x00ee, + 0x00de, 0x0005, 0x00d6, 0x2069, 0x0200, 0x6804, 0xa005, 0x1180, + 0x6808, 0xa005, 0x1518, 0x708b, 0x0028, 0x2069, 0xb3be, 0x2d04, + 0x7002, 0x080c, 0x5a64, 0x6028, 0xa085, 0x0600, 0x602a, 0x00b0, + 0x708b, 0x0028, 0x2069, 0xb3be, 0x2d04, 0x7002, 0x6028, 0xa085, + 0x0600, 0x602a, 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0xb419, + 0x080c, 0x1d48, 0x005e, 0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, + 0x6803, 0x0090, 0x6124, 0xd1e4, 0x1180, 0x080c, 0x57df, 0xd1d4, + 0x1150, 0xd1dc, 0x1128, 0xd1cc, 0x0140, 0x708b, 0x0020, 0x0028, + 0x708b, 0x001d, 0x0010, 0x708b, 0x001f, 0x0005, 0x6803, 0x0088, + 0x6124, 0xd1cc, 0x1580, 0xd1dc, 0x1558, 0xd1e4, 0x1530, 0xa184, + 0x1e00, 0x1570, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, + 0x5905, 0x0156, 0x6803, 0x0100, 0x20a9, 0x0014, 0x6804, 0xd0dc, + 0x1118, 0x1f04, 0x56ee, 0x0048, 0x20a9, 0x0014, 0x6803, 0x0080, + 0x6804, 0xd0d4, 0x1130, 0x1f04, 0x56f8, 0x080c, 0x5926, 0x015e, + 0x0078, 0x015e, 0x708b, 0x0028, 0x0058, 0x708b, 0x001e, 0x0040, + 0x708b, 0x001d, 0x0028, 0x708b, 0x0020, 0x0010, 0x708b, 0x001f, + 0x0005, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x5905, + 0x6803, 0x0080, 0x6124, 0xd1d4, 0x1180, 0xd1dc, 0x1158, 0xd1e4, + 0x1130, 0xa184, 0x1e00, 0x1158, 0x708b, 0x0028, 0x0040, 0x708b, + 0x001e, 0x0028, 0x708b, 0x001d, 0x0010, 0x708b, 0x001f, 0x0005, + 0x6803, 0x00a0, 0x6124, 0xd1dc, 0x1128, 0xd1e4, 0x0128, 0x708b, + 0x001e, 0x0010, 0x708b, 0x001d, 0x0005, 0x080c, 0x5809, 0x6124, + 0xd1dc, 0x1158, 0x080c, 0x57df, 0xd1d4, 0x1128, 0xd1e4, 0x0128, + 0x708b, 0x001e, 0x0010, 0x708b, 0x001f, 0x0005, 0x6803, 0x00a0, + 0x6124, 0xd1d4, 0x1160, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, + 0x0140, 0x708b, 0x001e, 0x0028, 0x708b, 0x001d, 0x0010, 0x708b, + 0x0021, 0x0005, 0x080c, 0x5809, 0x6124, 0xd1d4, 0x1150, 0xd1dc, + 0x1128, 0xd1e4, 0x0140, 0x708b, 0x001e, 0x0028, 0x708b, 0x001d, + 0x0010, 0x708b, 0x001f, 0x0005, 0x6803, 0x0090, 0x6124, 0xd1d4, + 0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x708b, + 0x001e, 0x0040, 0x708b, 0x001d, 0x0028, 0x708b, 0x0020, 0x0010, + 0x708b, 0x001f, 0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126, + 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0xb100, 0x2091, 0x8000, + 0x080c, 0x58d5, 0x11e8, 0x2001, 0xb10c, 0x200c, 0xd1b4, 0x01c0, + 0xc1b4, 0x2102, 0x6027, 0x0200, 0xe000, 0xe000, 0x6024, 0xd0cc, + 0x0158, 0x6803, 0x00a0, 0x2001, 0xb39f, 0x2003, 0x0001, 0x2001, + 0xb100, 0x2003, 0x0001, 0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, + 0x080c, 0x58f1, 0x0150, 0x080c, 0x58e7, 0x1138, 0x2001, 0x0001, + 0x080c, 0x269e, 0x080c, 0x58ac, 0x00a0, 0x080c, 0x5806, 0x0178, + 0x2001, 0x0001, 0x080c, 0x269e, 0x7088, 0xa086, 0x001e, 0x0120, + 0x7088, 0xa086, 0x0022, 0x1118, 0x708b, 0x0025, 0x0010, 0x708b, + 0x0021, 0x012e, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x0005, 0x0016, + 0x0026, 0x2009, 0x0064, 0x2011, 0x57ea, 0x080c, 0x6736, 0x002e, + 0x001e, 0x0005, 0x00e6, 0x00f6, 0x0016, 0x080c, 0x7a8c, 0x2071, + 0xb100, 0x080c, 0x578b, 0x001e, 0x00fe, 0x00ee, 0x0005, 0x2001, + 0xb100, 0x2004, 0xa086, 0x0004, 0x0140, 0x2001, 0xb39e, 0x2003, + 0xaaaa, 0x2001, 0xb39f, 0x2003, 0x0000, 0x0005, 0x6020, 0xd09c, + 0x0005, 0x6803, 0x00c0, 0x0156, 0x20a9, 0x002d, 0x1d04, 0x580e, + 0x2091, 0x6000, 0x1f04, 0x580e, 0x015e, 0x0005, 0x00c6, 0x00d6, + 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0xb100, 0x2001, + 0xb39f, 0x200c, 0xa186, 0x0000, 0x0158, 0xa186, 0x0001, 0x0158, + 0xa186, 0x0002, 0x0158, 0xa186, 0x0003, 0x0158, 0x0804, 0x589a, + 0x708b, 0x0022, 0x0040, 0x708b, 0x0021, 0x0028, 0x708b, 0x0023, + 0x0020, 0x708b, 0x0024, 0x6043, 0x0000, 0x60e3, 0x0000, 0x6887, + 0x0001, 0x2001, 0x0001, 0x080c, 0x274b, 0x0026, 0x2011, 0x0003, + 0x080c, 0x7d52, 0x2011, 0x0002, 0x080c, 0x7d5c, 0x080c, 0x7c41, + 0x080c, 0x67b6, 0x0036, 0x2019, 0x0000, 0x080c, 0x7cc4, 0x003e, + 0x002e, 0x7000, 0xa08e, 0x0004, 0x0118, 0x602b, 0x0028, 0x0010, + 0x602b, 0x0020, 0x0156, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, + 0x6024, 0xd0ac, 0x0118, 0x012e, 0x015e, 0x04d0, 0x6800, 0xa084, + 0x00a0, 0xc0bd, 0x6802, 0x6904, 0xd1d4, 0x1130, 0x6803, 0x0100, + 0x1f04, 0x5868, 0x080c, 0x5926, 0x012e, 0x015e, 0x080c, 0x58e7, + 0x01a8, 0x6044, 0xa005, 0x0168, 0x6050, 0x0006, 0xa085, 0x0020, + 0x6052, 0x080c, 0x5926, 0xa006, 0x8001, 0x1df0, 0x000e, 0x6052, + 0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x5926, 0x2001, 0xb39f, + 0x2003, 0x0004, 0x080c, 0x564a, 0x080c, 0x58e7, 0x0148, 0x6804, + 0xd0d4, 0x1130, 0xd0dc, 0x1100, 0x2001, 0xb39f, 0x2003, 0x0000, + 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, + 0x0100, 0x2069, 0x0140, 0x2071, 0xb100, 0x2001, 0xb39e, 0x2003, + 0x0000, 0x2001, 0xb38f, 0x2003, 0x0000, 0x708b, 0x0000, 0x60e3, + 0x0000, 0x6887, 0x0000, 0x2001, 0x0000, 0x080c, 0x274b, 0x6803, + 0x0000, 0x6043, 0x0090, 0x6043, 0x0010, 0x6027, 0xffff, 0x602b, + 0x182f, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006, 0x2001, 0xb39e, + 0x2004, 0xa086, 0xaaaa, 0x000e, 0x0005, 0x0006, 0x2001, 0xb172, + 0x2004, 0xa084, 0x0030, 0xa086, 0x0000, 0x000e, 0x0005, 0x0006, + 0x2001, 0xb172, 0x2004, 0xa084, 0x0030, 0xa086, 0x0030, 0x000e, + 0x0005, 0x0006, 0x2001, 0xb172, 0x2004, 0xa084, 0x0030, 0xa086, + 0x0010, 0x000e, 0x0005, 0x0006, 0x2001, 0xb172, 0x2004, 0xa084, + 0x0030, 0xa086, 0x0020, 0x000e, 0x0005, 0x2001, 0xb10c, 0x2004, + 0xd0a4, 0x0170, 0x080c, 0x276b, 0x0036, 0x0016, 0x2009, 0x0000, + 0x2019, 0x0028, 0x080c, 0x2b46, 0x001e, 0x003e, 0xa006, 0x0009, + 0x0005, 0x00e6, 0x2071, 0xb10c, 0x2e04, 0x0118, 0xa085, 0x0010, + 0x0010, 0xa084, 0xffef, 0x2072, 0x00ee, 0x0005, 0x6050, 0x0006, + 0x60f0, 0x0006, 0x60ec, 0x0006, 0x600c, 0x0006, 0x6004, 0x0006, + 0x6028, 0x0006, 0x602f, 0x0100, 0x602f, 0x0000, 0x602f, 0x0040, + 0x602f, 0x0000, 0x000e, 0x602a, 0x000e, 0x6006, 0x000e, 0x600e, + 0x000e, 0x60ee, 0x000e, 0x60f2, 0x60e3, 0x0000, 0x6887, 0x0001, + 0x2001, 0x0001, 0x080c, 0x274b, 0x6800, 0xa084, 0x00a0, 0xc0bd, + 0x6802, 0x6803, 0x00a0, 0x000e, 0x6052, 0x6050, 0x0005, 0x0156, + 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, + 0x2069, 0x0140, 0x2071, 0xb100, 0x6020, 0xa084, 0x0080, 0x0138, + 0x2001, 0xb10c, 0x200c, 0xc1bd, 0x2102, 0x0804, 0x59cf, 0x2001, + 0xb10c, 0x200c, 0xc1bc, 0x2102, 0x6028, 0xa084, 0xe1ff, 0x602a, + 0x6027, 0x0200, 0x6803, 0x0090, 0x20a9, 0x0384, 0x6024, 0xd0cc, + 0x1518, 0x1d04, 0x597e, 0x2091, 0x6000, 0x1f04, 0x597e, 0x2011, + 0x0003, 0x080c, 0x7d52, 0x2011, 0x0002, 0x080c, 0x7d5c, 0x080c, + 0x7c41, 0x080c, 0x67b6, 0x2019, 0x0000, 0x080c, 0x7cc4, 0x6803, + 0x00a0, 0x2001, 0xb39f, 0x2003, 0x0001, 0x2001, 0xb100, 0x2003, + 0x0001, 0xa085, 0x0001, 0x0458, 0x86ff, 0x1110, 0x080c, 0x1daa, + 0x60e3, 0x0000, 0x2001, 0xb38f, 0x2004, 0x080c, 0x274b, 0x60e2, + 0x6803, 0x0080, 0x20a9, 0x0384, 0x6027, 0x1e00, 0x2009, 0x1e00, + 0xe000, 0x6024, 0xa10c, 0x0138, 0x1d04, 0x59b4, 0x2091, 0x6000, + 0x1f04, 0x59b4, 0x0820, 0x6028, 0xa085, 0x1e00, 0x602a, 0x70a0, + 0xa005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0xa006, 0x00ee, + 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, + 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, + 0x2071, 0xb100, 0x2069, 0x0140, 0x6020, 0xa084, 0x00c0, 0x0120, + 0x6884, 0xa005, 0x1904, 0x5a2b, 0x6803, 0x0088, 0x60e3, 0x0000, + 0x6887, 0x0000, 0x2001, 0x0000, 0x080c, 0x274b, 0x2069, 0x0200, + 0x6804, 0xa005, 0x1118, 0x6808, 0xa005, 0x01c0, 0x6028, 0xa084, + 0xfbff, 0x602a, 0x6027, 0x0400, 0x2069, 0xb3be, 0x7000, 0x206a, + 0x708b, 0x0026, 0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04, 0x5a0e, + 0x2091, 0x6000, 0x1f04, 0x5a0e, 0x0804, 0x5a5c, 0x2069, 0x0140, + 0x20a9, 0x0384, 0x6027, 0x1e00, 0x2009, 0x1e00, 0xe000, 0x6024, + 0xa10c, 0x0530, 0xa084, 0x1a00, 0x1518, 0x1d04, 0x5a1a, 0x2091, + 0x6000, 0x1f04, 0x5a1a, 0x2011, 0x0003, 0x080c, 0x7d52, 0x2011, + 0x0002, 0x080c, 0x7d5c, 0x080c, 0x7c41, 0x080c, 0x67b6, 0x2019, + 0x0000, 0x080c, 0x7cc4, 0x6803, 0x00a0, 0x2001, 0xb39f, 0x2003, + 0x0001, 0x2001, 0xb100, 0x2003, 0x0001, 0xa085, 0x0001, 0x00a0, + 0x6803, 0x0080, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70a0, 0xa005, + 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0xb38f, 0x2004, + 0x080c, 0x274b, 0x60e2, 0xa006, 0x00ee, 0x00de, 0x00ce, 0x003e, + 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, + 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0xb100, 0x6020, + 0xa084, 0x00c0, 0x01f0, 0x2011, 0x0003, 0x080c, 0x7d52, 0x2011, + 0x0002, 0x080c, 0x7d5c, 0x080c, 0x7c41, 0x080c, 0x67b6, 0x2019, + 0x0000, 0x080c, 0x7cc4, 0x2069, 0x0140, 0x6803, 0x00a0, 0x2001, + 0xb39f, 0x2003, 0x0001, 0x2001, 0xb100, 0x2003, 0x0001, 0x0804, + 0x5afc, 0x2001, 0xb10c, 0x200c, 0xd1b4, 0x1150, 0xc1b5, 0x2102, + 0x080c, 0x57df, 0x2069, 0x0140, 0x6803, 0x0080, 0x60e3, 0x0000, + 0x2069, 0x0200, 0x6804, 0xa005, 0x1118, 0x6808, 0xa005, 0x01b8, + 0x6028, 0xa084, 0xfdff, 0x602a, 0x6027, 0x0200, 0x2069, 0xb3be, + 0x7000, 0x206a, 0x708b, 0x0027, 0x7003, 0x0001, 0x20a9, 0x0002, + 0x1d04, 0x5ab8, 0x2091, 0x6000, 0x1f04, 0x5ab8, 0x04e8, 0x6027, + 0x1e00, 0x2009, 0x1e00, 0xe000, 0x6024, 0xa10c, 0x01c8, 0xa084, + 0x1c00, 0x11b0, 0x1d04, 0x5abf, 0x0006, 0x0016, 0x00c6, 0x00d6, + 0x00e6, 0x080c, 0x66b4, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x000e, + 0x00e6, 0x2071, 0xb3ec, 0x7018, 0x00ee, 0xa005, 0x1d00, 0x01e0, + 0x0026, 0x2011, 0x57ea, 0x080c, 0x6742, 0x002e, 0x2069, 0x0140, + 0x60e3, 0x0000, 0x70a0, 0xa005, 0x1118, 0x6887, 0x0001, 0x0008, + 0x6886, 0x2001, 0xb38f, 0x2004, 0x080c, 0x274b, 0x60e2, 0x2001, + 0xb10c, 0x200c, 0xc1b4, 0x2102, 0x00ee, 0x00de, 0x00ce, 0x003e, + 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, + 0x0046, 0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, 0xb100, 0x7130, + 0xd184, 0x1180, 0x2011, 0xb153, 0x2214, 0xd2ec, 0x0138, 0xc18d, + 0x7132, 0x2011, 0xb153, 0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c, + 0x0904, 0x5b69, 0x7130, 0xc185, 0x7132, 0x2011, 0xb153, 0x220c, + 0xd1a4, 0x0530, 0x0016, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, + 0x688d, 0x2019, 0x000e, 0x080c, 0xac2b, 0x0156, 0x20a9, 0x007f, + 0x2009, 0x0000, 0xa186, 0x007e, 0x0170, 0xa186, 0x0080, 0x0158, + 0x080c, 0x4e21, 0x1140, 0x8127, 0xa006, 0x0016, 0x2009, 0x000e, + 0x080c, 0xacae, 0x001e, 0x8108, 0x1f04, 0x5b3a, 0x015e, 0x001e, + 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0000, 0x2019, 0x0004, 0x080c, + 0x2b46, 0x001e, 0x0070, 0x0156, 0x20a9, 0x007f, 0x2009, 0x0000, + 0x080c, 0x4e21, 0x1110, 0x080c, 0x4a80, 0x8108, 0x1f04, 0x5b60, + 0x015e, 0x2011, 0x0003, 0x080c, 0x7d52, 0x2011, 0x0002, 0x080c, + 0x7d5c, 0x080c, 0x7c41, 0x080c, 0x67b6, 0x0036, 0x2019, 0x0000, + 0x080c, 0x7cc4, 0x003e, 0x60e3, 0x0000, 0x2001, 0xb100, 0x2003, + 0x0001, 0x080c, 0x5816, 0x00ee, 0x00ce, 0x004e, 0x003e, 0x002e, + 0x001e, 0x015e, 0x0005, 0x2071, 0xb1e2, 0x7003, 0x0000, 0x7007, + 0x0000, 0x700f, 0x0000, 0x702b, 0x0001, 0x704f, 0x0000, 0x7053, + 0x0001, 0x705f, 0x0020, 0x7063, 0x0040, 0x7083, 0x0000, 0x708b, + 0x0000, 0x708f, 0x0001, 0x70bf, 0x0000, 0x0005, 0x00e6, 0x2071, + 0xb1e2, 0x6848, 0xa005, 0x1130, 0x7028, 0xc085, 0x702a, 0xa085, + 0x0001, 0x0428, 0x6a50, 0x7236, 0x6b54, 0x733a, 0x6858, 0x703e, + 0x707a, 0x685c, 0x7042, 0x707e, 0x6848, 0x702e, 0x6840, 0x7032, + 0x2009, 0x000c, 0x200a, 0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, + 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, 0x7272, 0x7376, 0x7028, + 0xc084, 0x702a, 0x7007, 0x0001, 0x700f, 0x0000, 0xa006, 0x00ee, + 0x0005, 0x2b78, 0x2071, 0xb1e2, 0x7004, 0x0043, 0x700c, 0x0002, + 0x5be5, 0x5bdc, 0x5bdc, 0x5bdc, 0x5bdc, 0x0005, 0x5c3b, 0x5c3c, + 0x5c6e, 0x5c6f, 0x5c39, 0x5cbd, 0x5cc2, 0x5cf3, 0x5cf4, 0x5d0f, + 0x5d10, 0x5d11, 0x5d12, 0x5d13, 0x5d14, 0x5dca, 0x5df1, 0x700c, + 0x0002, 0x5bfe, 0x5c39, 0x5c39, 0x5c3a, 0x5c3a, 0x7830, 0x7930, + 0xa106, 0x0120, 0x7830, 0x7930, 0xa106, 0x1510, 0x7030, 0xa10a, + 0x01f8, 0x1210, 0x712c, 0xa10a, 0xa18a, 0x0002, 0x12d0, 0x080c, + 0x15c4, 0x01b0, 0x2d00, 0x705a, 0x7063, 0x0040, 0x2001, 0x0003, + 0x7057, 0x0000, 0x0126, 0x0006, 0x2091, 0x8000, 0x2009, 0xb408, + 0x2104, 0xc085, 0x200a, 0x000e, 0x700e, 0x012e, 0x080c, 0x1640, + 0x0005, 0x080c, 0x15c4, 0x0de0, 0x2d00, 0x705a, 0x080c, 0x15c4, + 0x1108, 0x0c10, 0x2d00, 0x7086, 0x7063, 0x0080, 0x2001, 0x0004, + 0x08f8, 0x0005, 0x0005, 0x0005, 0x700c, 0x0002, 0x5c43, 0x5c46, + 0x5c54, 0x5c6d, 0x5c6d, 0x080c, 0x5bf7, 0x0005, 0x0126, 0x8001, + 0x700e, 0x7058, 0x0006, 0x080c, 0x611c, 0x0120, 0x2091, 0x8000, + 0x080c, 0x5bf7, 0x00de, 0x0048, 0x0126, 0x8001, 0x700e, 0x080c, + 0x611c, 0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, + 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a, 0x003a, 0x1218, 0x00db, + 0x012e, 0x0005, 0x012e, 0x080c, 0x5d15, 0x0005, 0x0005, 0x0005, + 0x00e6, 0x2071, 0xb1e2, 0x700c, 0x0002, 0x5c7a, 0x5c7a, 0x5c7a, + 0x5c7c, 0x5c7f, 0x00ee, 0x0005, 0x700f, 0x0001, 0x0010, 0x700f, + 0x0002, 0x00ee, 0x0005, 0x5d15, 0x5d15, 0x5d31, 0x5d15, 0x5eae, + 0x5d15, 0x5d15, 0x5d15, 0x5d15, 0x5d15, 0x5d31, 0x5ef0, 0x5f33, + 0x5f7c, 0x5f90, 0x5d15, 0x5d15, 0x5d4d, 0x5d31, 0x5d15, 0x5d15, + 0x5da7, 0x6039, 0x6054, 0x5d15, 0x5d4d, 0x5d15, 0x5d15, 0x5d15, + 0x5d15, 0x5d9d, 0x6054, 0x5d15, 0x5d15, 0x5d15, 0x5d15, 0x5d15, + 0x5d15, 0x5d15, 0x5d15, 0x5d15, 0x5d61, 0x5d15, 0x5d15, 0x5d15, + 0x5d15, 0x5d15, 0x5d15, 0x5d15, 0x5d15, 0x5d15, 0x613a, 0x5d15, + 0x5d15, 0x5d15, 0x5d15, 0x5d15, 0x5d76, 0x7020, 0x2068, 0x080c, + 0x15f4, 0x0005, 0x700c, 0x0002, 0x5cc9, 0x5ccc, 0x5cda, 0x5cf2, + 0x5cf2, 0x080c, 0x5bf7, 0x0005, 0x0126, 0x8001, 0x700e, 0x7058, + 0x0006, 0x080c, 0x611c, 0x0120, 0x2091, 0x8000, 0x080c, 0x5bf7, + 0x00de, 0x0048, 0x0126, 0x8001, 0x700e, 0x080c, 0x611c, 0x7058, + 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, + 0xa084, 0x00ff, 0xa08a, 0x001a, 0x1218, 0x003b, 0x012e, 0x0005, + 0x012e, 0x0419, 0x0005, 0x0005, 0x0005, 0x5d15, 0x5d31, 0x5e9a, + 0x5d15, 0x5d31, 0x5d15, 0x5d31, 0x5d31, 0x5d15, 0x5d31, 0x5e9a, + 0x5d31, 0x5d31, 0x5d31, 0x5d31, 0x5d31, 0x5d15, 0x5d31, 0x5e9a, + 0x5d15, 0x5d15, 0x5d31, 0x5d15, 0x5d15, 0x5d15, 0x5d31, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x7007, 0x0001, 0x6838, + 0xa084, 0x00ff, 0xc0d5, 0x683a, 0x0126, 0x2091, 0x8000, 0x080c, + 0x5271, 0x012e, 0x0005, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, + 0xc0e5, 0x683a, 0x0126, 0x2091, 0x8000, 0x080c, 0x5271, 0x012e, + 0x0005, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0ed, 0x683a, + 0x0126, 0x2091, 0x8000, 0x080c, 0x5271, 0x012e, 0x0005, 0x7007, + 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0dd, 0x683a, 0x0126, 0x2091, + 0x8000, 0x080c, 0x5271, 0x012e, 0x0005, 0x6834, 0x8007, 0xa084, + 0x00ff, 0x0988, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x5e5a, + 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x5e5a, + 0x0005, 0x6834, 0x8007, 0xa084, 0x00ff, 0x0904, 0x5d23, 0x8001, + 0x1120, 0x7007, 0x0001, 0x0804, 0x5e77, 0x7007, 0x0006, 0x7012, + 0x2d00, 0x7016, 0x701a, 0x704b, 0x5e77, 0x0005, 0x6834, 0x8007, + 0xa084, 0x00ff, 0xa086, 0x0001, 0x1904, 0x5d23, 0x7007, 0x0001, + 0x2009, 0xb130, 0x210c, 0x81ff, 0x11a8, 0x6838, 0xa084, 0x00ff, + 0x683a, 0x6853, 0x0000, 0x080c, 0x4bf7, 0x1108, 0x0005, 0x0126, + 0x2091, 0x8000, 0x6837, 0x0139, 0x684a, 0x6952, 0x080c, 0x5271, + 0x012e, 0x0ca0, 0x2001, 0x0028, 0x0c90, 0x684c, 0xa084, 0x00c0, + 0xa086, 0x00c0, 0x1120, 0x7007, 0x0001, 0x0804, 0x606c, 0x2d00, + 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080, 0x0024, 0x2098, 0x20a1, + 0xb20d, 0x53a3, 0x6858, 0x7012, 0xa082, 0x0401, 0x1a04, 0x5d3f, + 0x6a84, 0xa28a, 0x0002, 0x1a04, 0x5d3f, 0x82ff, 0x1138, 0x6888, + 0x698c, 0xa105, 0x0118, 0x2001, 0x5e2d, 0x0018, 0xa280, 0x5e23, + 0x2005, 0x70c6, 0x7010, 0xa015, 0x0904, 0x5e0f, 0x080c, 0x15c4, + 0x1118, 0x7007, 0x000f, 0x0005, 0x2d00, 0x7022, 0x70c4, 0x2060, + 0x2c05, 0x6836, 0xe004, 0xad00, 0x7096, 0xe008, 0xa20a, 0x1210, + 0xa00e, 0x2200, 0x7112, 0xe20c, 0x8003, 0x800b, 0xa296, 0x0004, + 0x0108, 0xa108, 0x719a, 0x810b, 0x719e, 0xae90, 0x0022, 0x080c, + 0x1628, 0x7090, 0xa08e, 0x0100, 0x0170, 0xa086, 0x0200, 0x0118, + 0x7007, 0x0010, 0x0005, 0x7020, 0x2068, 0x080c, 0x15f4, 0x7014, + 0x2068, 0x0804, 0x5d3f, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, + 0x0000, 0x2d08, 0x2068, 0x6906, 0x711a, 0x0804, 0x5dca, 0x7014, + 0x2068, 0x7007, 0x0001, 0x6884, 0xa005, 0x1128, 0x6888, 0x698c, + 0xa105, 0x0108, 0x00b1, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, + 0x0904, 0x606c, 0x04b8, 0x5e25, 0x5e29, 0x0002, 0x0011, 0x0007, + 0x0004, 0x000a, 0x000f, 0x0005, 0x0006, 0x000a, 0x0011, 0x0005, + 0x0004, 0x00f6, 0x00e6, 0x00c6, 0x0076, 0x0066, 0x6f88, 0x6e8c, + 0x6804, 0x2060, 0xacf0, 0x0021, 0xacf8, 0x0027, 0x2009, 0x0005, + 0x700c, 0x7816, 0x7008, 0x7812, 0x7004, 0x7806, 0x7000, 0x7802, + 0x7e0e, 0x7f0a, 0x8109, 0x0128, 0xaef2, 0x0004, 0xaffa, 0x0006, + 0x0c78, 0x6004, 0xa065, 0x1d30, 0x006e, 0x007e, 0x00ce, 0x00ee, + 0x00fe, 0x0005, 0x2009, 0xb130, 0x210c, 0x81ff, 0x1198, 0x6838, + 0xa084, 0x00ff, 0x683a, 0x080c, 0x4ad9, 0x1108, 0x0005, 0x080c, + 0x5344, 0x0126, 0x2091, 0x8000, 0x080c, 0x9ada, 0x080c, 0x5271, + 0x012e, 0x0ca0, 0x2001, 0x0028, 0x2009, 0x0000, 0x0c80, 0x2009, + 0xb130, 0x210c, 0x81ff, 0x11b0, 0x6858, 0xa005, 0x01c0, 0x6838, + 0xa084, 0x00ff, 0x683a, 0x6853, 0x0000, 0x080c, 0x4b9b, 0x1108, + 0x0005, 0x0126, 0x2091, 0x8000, 0x684a, 0x6952, 0x080c, 0x5271, + 0x012e, 0x0cb0, 0x2001, 0x0028, 0x2009, 0x0000, 0x0c90, 0x2001, + 0x0000, 0x0c78, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906, 0x711a, + 0x7010, 0x8001, 0x7012, 0x0118, 0x7007, 0x0006, 0x0030, 0x7014, + 0x2068, 0x7007, 0x0001, 0x7048, 0x080f, 0x0005, 0x7007, 0x0001, + 0x6944, 0x810f, 0xa18c, 0x00ff, 0x6848, 0xa084, 0x00ff, 0x20a9, + 0x0001, 0xa096, 0x0001, 0x01b0, 0x2009, 0x0000, 0x20a9, 0x00ff, + 0xa096, 0x0002, 0x0178, 0xa005, 0x11f0, 0x6944, 0x810f, 0xa18c, + 0x00ff, 0x080c, 0x4e21, 0x11b8, 0x0066, 0x6e50, 0x080c, 0x4f1c, + 0x006e, 0x0088, 0x0046, 0x2011, 0xb10c, 0x2224, 0xc484, 0x2412, + 0x004e, 0x00c6, 0x080c, 0x4e21, 0x1110, 0x080c, 0x507b, 0x8108, + 0x1f04, 0x5eda, 0x00ce, 0x684c, 0xd084, 0x1118, 0x080c, 0x15f4, + 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x5271, 0x012e, 0x0005, + 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0xb153, 0x2004, + 0xd0a4, 0x0580, 0x2061, 0xb464, 0x6100, 0xd184, 0x0178, 0x6858, + 0xa084, 0x00ff, 0x1550, 0x6000, 0xd084, 0x0520, 0x6004, 0xa005, + 0x1538, 0x6003, 0x0000, 0x600b, 0x0000, 0x00c8, 0x2011, 0x0001, + 0x6860, 0xa005, 0x1110, 0x2001, 0x001e, 0x8000, 0x6016, 0x6858, + 0xa084, 0x00ff, 0x0178, 0x6006, 0x6858, 0x8007, 0xa084, 0x00ff, + 0x0148, 0x600a, 0x6858, 0x8000, 0x1108, 0xc28d, 0x6202, 0x012e, + 0x0804, 0x610b, 0x012e, 0x0804, 0x6105, 0x012e, 0x0804, 0x60ff, + 0x012e, 0x0804, 0x6102, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, + 0x2001, 0xb153, 0x2004, 0xd0a4, 0x05e0, 0x2061, 0xb464, 0x6000, + 0xd084, 0x05b8, 0x6204, 0x6308, 0xd08c, 0x1530, 0x6c48, 0xa484, + 0x0003, 0x0170, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x1120, 0x2100, + 0xa210, 0x0620, 0x0028, 0x8001, 0x1508, 0x2100, 0xa212, 0x02f0, + 0xa484, 0x000c, 0x0188, 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, + 0x0004, 0x1120, 0x2100, 0xa318, 0x0288, 0x0030, 0xa082, 0x0004, + 0x1168, 0x2100, 0xa31a, 0x0250, 0x6860, 0xa005, 0x0110, 0x8000, + 0x6016, 0x6206, 0x630a, 0x012e, 0x0804, 0x610b, 0x012e, 0x0804, + 0x6108, 0x012e, 0x0804, 0x6105, 0x0126, 0x2091, 0x8000, 0x7007, + 0x0001, 0x2061, 0xb464, 0x6300, 0xd38c, 0x1120, 0x6308, 0x8318, + 0x0220, 0x630a, 0x012e, 0x0804, 0x6119, 0x012e, 0x0804, 0x6108, + 0x0126, 0x00c6, 0x2091, 0x8000, 0x7007, 0x0001, 0x684c, 0xd0ac, + 0x0148, 0x00c6, 0x2061, 0xb464, 0x6000, 0xa084, 0xfcff, 0x6002, + 0x00ce, 0x0448, 0x6858, 0xa005, 0x05d0, 0x685c, 0xa065, 0x0598, + 0x2001, 0xb130, 0x2004, 0xa005, 0x0118, 0x080c, 0x9a2b, 0x0068, + 0x6013, 0x0400, 0x6057, 0x0000, 0x694c, 0xd1a4, 0x0110, 0x6950, + 0x6156, 0x2009, 0x0041, 0x080c, 0x831a, 0x6958, 0xa18c, 0xff00, + 0xa186, 0x2000, 0x1140, 0x0026, 0x2009, 0x0000, 0x2011, 0xfdff, + 0x080c, 0x688d, 0x002e, 0x684c, 0xd0c4, 0x0148, 0x2061, 0xb464, + 0x6000, 0xd08c, 0x1120, 0x6008, 0x8000, 0x0208, 0x600a, 0x00ce, + 0x012e, 0x0804, 0x610b, 0x00ce, 0x012e, 0x0804, 0x6105, 0x6954, + 0xa186, 0x002e, 0x0d40, 0xa186, 0x002d, 0x0d28, 0xa186, 0x0045, + 0x0510, 0xa186, 0x002a, 0x1130, 0x2001, 0xb10c, 0x200c, 0xc194, + 0x2102, 0x08c8, 0xa186, 0x0020, 0x0170, 0xa186, 0x0029, 0x1d18, + 0x6944, 0xa18c, 0xff00, 0x810f, 0x080c, 0x4e21, 0x1960, 0x6000, + 0xc0e4, 0x6002, 0x0840, 0x685c, 0xa065, 0x09a8, 0x2001, 0xb3b5, + 0x2004, 0x6016, 0x0800, 0x685c, 0xa065, 0x0968, 0x00e6, 0x6860, + 0xa075, 0x2001, 0xb130, 0x2004, 0xa005, 0x0150, 0x080c, 0x9a2b, + 0x8eff, 0x0118, 0x2e60, 0x080c, 0x9a2b, 0x00ee, 0x0804, 0x5fcb, + 0x6020, 0xc0dc, 0xc0d5, 0x6022, 0x2e60, 0x6007, 0x003a, 0x6870, + 0xa005, 0x0130, 0x6007, 0x003b, 0x6874, 0x602a, 0x6878, 0x6012, + 0x6003, 0x0001, 0x080c, 0x69f6, 0x080c, 0x6e9e, 0x00ee, 0x0804, + 0x5fcb, 0x2061, 0xb464, 0x6000, 0xd084, 0x0190, 0xd08c, 0x1904, + 0x6119, 0x0126, 0x2091, 0x8000, 0x6204, 0x8210, 0x0220, 0x6206, + 0x012e, 0x0804, 0x6119, 0x012e, 0x6853, 0x0016, 0x0804, 0x6112, + 0x6853, 0x0007, 0x0804, 0x6112, 0x6834, 0x8007, 0xa084, 0x00ff, + 0x1118, 0x080c, 0x5d23, 0x0078, 0x2030, 0x8001, 0x1120, 0x7007, + 0x0001, 0x0051, 0x0040, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, + 0x701a, 0x704b, 0x606c, 0x0005, 0x00e6, 0x0126, 0x2091, 0x8000, + 0x2009, 0xb130, 0x210c, 0x81ff, 0x1904, 0x60e7, 0x2009, 0xb10c, + 0x210c, 0xd194, 0x1904, 0x60ef, 0x6848, 0x2070, 0xae82, 0xb800, + 0x0a04, 0x60db, 0x2001, 0xb116, 0x2004, 0xae02, 0x1a04, 0x60db, + 0x2061, 0xb464, 0x6100, 0xa184, 0x0301, 0xa086, 0x0001, 0x15a8, + 0x711c, 0xa186, 0x0006, 0x15b0, 0x7018, 0xa005, 0x0904, 0x60e7, + 0x2004, 0xd0e4, 0x1904, 0x60ea, 0x7020, 0xd0dc, 0x1904, 0x60f2, + 0x6853, 0x0000, 0x6803, 0x0000, 0x2d08, 0x7010, 0xa005, 0x1158, + 0x7112, 0x684c, 0xd0f4, 0x1904, 0x60f5, 0x2e60, 0x080c, 0x67f8, + 0x012e, 0x00ee, 0x0005, 0x2068, 0x6800, 0xa005, 0x1de0, 0x6902, + 0x2168, 0x684c, 0xd0f4, 0x15c8, 0x012e, 0x00ee, 0x0005, 0x012e, + 0x00ee, 0x6853, 0x0006, 0x0804, 0x6112, 0xd184, 0x0dc0, 0xd1c4, + 0x11a8, 0x00b8, 0x6944, 0xa18c, 0xff00, 0x810f, 0x080c, 0x4e21, + 0x11c8, 0x6000, 0xd0e4, 0x11b0, 0x711c, 0xa186, 0x0007, 0x1118, + 0x6853, 0x0002, 0x0088, 0x6853, 0x0008, 0x0070, 0x6853, 0x000e, + 0x0058, 0x6853, 0x0017, 0x0040, 0x6853, 0x0035, 0x0028, 0x6853, + 0x0028, 0x0010, 0x6853, 0x0029, 0x012e, 0x00ee, 0x0418, 0x6853, + 0x002a, 0x0cd0, 0x6853, 0x0045, 0x0cb8, 0x2e60, 0x2019, 0x0002, + 0x6017, 0x0014, 0x080c, 0xa8af, 0x012e, 0x00ee, 0x0005, 0x2009, + 0x003e, 0x0058, 0x2009, 0x0004, 0x0040, 0x2009, 0x0006, 0x0028, + 0x2009, 0x0016, 0x0010, 0x2009, 0x0001, 0x6854, 0xa084, 0xff00, + 0xa105, 0x6856, 0x0126, 0x2091, 0x8000, 0x080c, 0x5271, 0x012e, + 0x0005, 0x080c, 0x15f4, 0x0005, 0x702c, 0x7130, 0x8108, 0xa102, + 0x0230, 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076, 0x0058, 0x7070, + 0xa080, 0x0040, 0x7072, 0x1230, 0x7074, 0xa081, 0x0000, 0x7076, + 0xa085, 0x0001, 0x7932, 0x7132, 0x0005, 0x00d6, 0x080c, 0x67ef, + 0x00de, 0x0005, 0x00d6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x7007, + 0x0001, 0x6a44, 0xa282, 0x0004, 0x1a04, 0x6185, 0xd284, 0x0170, + 0x6a4c, 0xa290, 0xb235, 0x2204, 0xa065, 0x6004, 0x05e0, 0x8007, + 0xa084, 0x00ff, 0xa084, 0x0006, 0x1108, 0x04a8, 0x2c10, 0x080c, + 0x8295, 0x1118, 0x080c, 0x9ae4, 0x05a0, 0x621a, 0x6844, 0x0002, + 0x6164, 0x6169, 0x616c, 0x6172, 0x2019, 0x0002, 0x080c, 0xac2b, + 0x0060, 0x080c, 0xabc2, 0x0048, 0x2019, 0x0002, 0x6950, 0x080c, + 0xabdd, 0x0018, 0x6950, 0x080c, 0xabc2, 0x080c, 0x82eb, 0x6857, + 0x0000, 0x0126, 0x2091, 0x8000, 0x080c, 0x5271, 0x012e, 0x001e, + 0x002e, 0x003e, 0x00ce, 0x00de, 0x0005, 0x6857, 0x0006, 0x0c88, + 0x6857, 0x0002, 0x0c70, 0x6857, 0x0005, 0x0c58, 0x6857, 0x0004, + 0x0c40, 0x6857, 0x0007, 0x0c28, 0x00d6, 0x2011, 0x0004, 0x2204, + 0xa085, 0x8002, 0x2012, 0x00de, 0x0005, 0x20e1, 0x0002, 0x3d08, + 0x20e1, 0x2000, 0x3d00, 0xa084, 0x7000, 0x0118, 0xa086, 0x1000, + 0x1570, 0x20e1, 0x0000, 0x3d00, 0xa094, 0xff00, 0x8217, 0xa084, + 0xf000, 0xa086, 0x3000, 0x1160, 0xa184, 0xff00, 0x8007, 0xa086, + 0x0008, 0x11e8, 0x080c, 0x2c87, 0x11d0, 0x080c, 0x63bf, 0x0098, + 0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x1108, 0x3e60, 0xac84, 0x0007, + 0x1170, 0xac82, 0xb800, 0x0258, 0x6858, 0xac02, 0x1240, 0x2009, + 0x0047, 0x080c, 0x831a, 0x7a1c, 0xd284, 0x1938, 0x0005, 0xa016, + 0x080c, 0x1828, 0x0cc0, 0x0cd8, 0x781c, 0xd08c, 0x0500, 0x0156, + 0x0136, 0x0146, 0x20e1, 0x3000, 0x3d20, 0x3e28, 0xa584, 0x0076, + 0x1530, 0xa484, 0x7000, 0xa086, 0x1000, 0x11a8, 0x080c, 0x623a, + 0x01f0, 0x20e1, 0x3000, 0x7828, 0x7828, 0x080c, 0x6256, 0x014e, + 0x013e, 0x015e, 0x2009, 0xb3e1, 0x2104, 0xa005, 0x1108, 0x0005, + 0x080c, 0x6e9e, 0x0ce0, 0xa484, 0x7000, 0x1518, 0x0499, 0x01b8, + 0x7000, 0xa084, 0xff00, 0xa086, 0x8100, 0x0d18, 0x0080, 0xd5a4, + 0x0158, 0x080c, 0x1db4, 0x20e1, 0x9010, 0x2001, 0x0160, 0x2502, + 0x2001, 0x0138, 0x2202, 0x0048, 0x00e9, 0x6883, 0x0000, 0x080c, + 0xafa5, 0x20e1, 0x3000, 0x7828, 0x7828, 0x014e, 0x013e, 0x015e, + 0x08b0, 0x0081, 0x1130, 0x7000, 0xa084, 0xff00, 0xa086, 0x8100, + 0x1d70, 0x080c, 0xafa5, 0x20e1, 0x3000, 0x7828, 0x7828, 0x080c, + 0x6630, 0x0c58, 0xa484, 0x01ff, 0x6882, 0xa005, 0x0160, 0xa080, + 0x001f, 0xa084, 0x03f8, 0x80ac, 0x20e1, 0x1000, 0x2ea0, 0x2099, + 0x020a, 0x53a5, 0x0005, 0x20a9, 0x000c, 0x20e1, 0x1000, 0x2ea0, + 0x2099, 0x020a, 0x53a5, 0xa085, 0x0001, 0x0ca0, 0x7000, 0xa084, + 0xff00, 0xa08c, 0xf000, 0x8007, 0xa196, 0x0000, 0x1118, 0x0804, + 0x64c4, 0x0005, 0xa196, 0x2000, 0x1148, 0x6900, 0xa18e, 0x0001, + 0x1118, 0x080c, 0x4305, 0x0ca8, 0x0039, 0x0c98, 0xa196, 0x8000, + 0x1d80, 0x080c, 0x6570, 0x0c68, 0x00c6, 0x6a80, 0x82ff, 0x0904, + 0x63b9, 0x7110, 0xa18c, 0xff00, 0x810f, 0xa196, 0x0001, 0x0120, + 0xa196, 0x0023, 0x1904, 0x63b9, 0xa08e, 0x0023, 0x1570, 0x080c, + 0x660b, 0x0904, 0x63b9, 0x7124, 0x610a, 0x7030, 0xa08e, 0x0200, + 0x1150, 0x7034, 0xa005, 0x1904, 0x63b9, 0x2009, 0x0015, 0x080c, + 0x831a, 0x0804, 0x63b9, 0xa08e, 0x0214, 0x0118, 0xa08e, 0x0210, + 0x1130, 0x2009, 0x0015, 0x080c, 0x831a, 0x0804, 0x63b9, 0xa08e, + 0x0100, 0x1904, 0x63b9, 0x7034, 0xa005, 0x1904, 0x63b9, 0x2009, + 0x0016, 0x080c, 0x831a, 0x0804, 0x63b9, 0xa08e, 0x0022, 0x1904, + 0x63b9, 0x7030, 0xa08e, 0x0300, 0x1580, 0x68d0, 0xd0a4, 0x0528, + 0xc0b5, 0x68d2, 0x7100, 0xa18c, 0x00ff, 0x696e, 0x7004, 0x6872, + 0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006, 0xa084, 0x00ff, + 0x0016, 0x2008, 0x080c, 0x2720, 0x7932, 0x7936, 0x001e, 0x000e, + 0x00fe, 0x080c, 0x26f6, 0x694e, 0x703c, 0x00e6, 0x2071, 0x0140, + 0x7086, 0x2071, 0xb100, 0x70a2, 0x00ee, 0x7034, 0xa005, 0x1904, + 0x63b9, 0x2009, 0x0017, 0x0804, 0x637f, 0xa08e, 0x0400, 0x1158, + 0x7034, 0xa005, 0x1904, 0x63b9, 0x68d0, 0xc0a5, 0x68d2, 0x2009, + 0x0030, 0x0804, 0x637f, 0xa08e, 0x0500, 0x1140, 0x7034, 0xa005, + 0x1904, 0x63b9, 0x2009, 0x0018, 0x0804, 0x637f, 0xa08e, 0x2010, + 0x1120, 0x2009, 0x0019, 0x0804, 0x637f, 0xa08e, 0x2110, 0x1120, + 0x2009, 0x001a, 0x0804, 0x637f, 0xa08e, 0x5200, 0x1140, 0x7034, + 0xa005, 0x1904, 0x63b9, 0x2009, 0x001b, 0x0804, 0x637f, 0xa08e, + 0x5000, 0x1140, 0x7034, 0xa005, 0x1904, 0x63b9, 0x2009, 0x001c, + 0x0804, 0x637f, 0xa08e, 0x1300, 0x1120, 0x2009, 0x0034, 0x0804, + 0x637f, 0xa08e, 0x1200, 0x1140, 0x7034, 0xa005, 0x1904, 0x63b9, + 0x2009, 0x0024, 0x0804, 0x637f, 0xa08c, 0xff00, 0xa18e, 0x2400, + 0x1118, 0x2009, 0x002d, 0x04d8, 0xa08c, 0xff00, 0xa18e, 0x5300, + 0x1118, 0x2009, 0x002a, 0x0498, 0xa08e, 0x0f00, 0x1118, 0x2009, + 0x0020, 0x0468, 0xa08e, 0x5300, 0x1108, 0x00d8, 0xa08e, 0x6104, + 0x11c0, 0x2011, 0xb68d, 0x8208, 0x2204, 0xa082, 0x0004, 0x20a8, + 0x95ac, 0x95ac, 0x2011, 0x8015, 0x211c, 0x8108, 0x0046, 0x2124, + 0x080c, 0x3d5b, 0x004e, 0x8108, 0x1f04, 0x6362, 0x2009, 0x0023, + 0x0070, 0xa08e, 0x6000, 0x1118, 0x2009, 0x003f, 0x0040, 0xa08e, + 0x7800, 0x1118, 0x2009, 0x0045, 0x0010, 0x2009, 0x001d, 0x0016, + 0x2011, 0xb683, 0x2204, 0x8211, 0x220c, 0x080c, 0x26f6, 0x1598, + 0x080c, 0x4dc5, 0x1580, 0x6612, 0x6516, 0x86ff, 0x01e8, 0x001e, + 0x0016, 0xa186, 0x0017, 0x1158, 0x686c, 0xa606, 0x11a8, 0x6870, + 0xa506, 0xa084, 0xff00, 0x1180, 0x6000, 0xc0f5, 0x6002, 0xa186, + 0x0046, 0x1150, 0x686c, 0xa606, 0x1138, 0x6870, 0xa506, 0xa084, + 0xff00, 0x1110, 0x001e, 0x0068, 0x00c6, 0x080c, 0x8295, 0x0168, + 0x001e, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c, + 0x831a, 0x00ce, 0x0005, 0x001e, 0x0ce0, 0x00ce, 0x0ce0, 0x00c6, + 0x0046, 0x080c, 0x6413, 0x1904, 0x6410, 0xa28e, 0x0033, 0x11e8, + 0x080c, 0x660b, 0x0904, 0x6410, 0x7124, 0x610a, 0x7030, 0xa08e, + 0x0200, 0x1140, 0x7034, 0xa005, 0x15d8, 0x2009, 0x0015, 0x080c, + 0x831a, 0x04b0, 0xa08e, 0x0100, 0x1598, 0x7034, 0xa005, 0x1580, + 0x2009, 0x0016, 0x080c, 0x831a, 0x0458, 0xa28e, 0x0032, 0x1540, + 0x7030, 0xa08e, 0x1400, 0x1520, 0x2009, 0x0038, 0x0016, 0x2011, + 0xb683, 0x2204, 0x8211, 0x220c, 0x080c, 0x26f6, 0x11c0, 0x080c, + 0x4dc5, 0x11a8, 0x6612, 0x6516, 0x00c6, 0x080c, 0x8295, 0x0170, + 0x001e, 0x611a, 0x080c, 0x9c35, 0x601f, 0x0004, 0x7120, 0x610a, + 0x001e, 0x080c, 0x831a, 0x080c, 0x6e9e, 0x0010, 0x00ce, 0x001e, + 0x004e, 0x00ce, 0x0005, 0x00f6, 0x00d6, 0x0026, 0x0016, 0x0136, + 0x0146, 0x0156, 0x3c00, 0x0006, 0x2079, 0x0030, 0x2069, 0x0200, + 0x080c, 0x1e48, 0x1590, 0x080c, 0x1d06, 0x05e0, 0x04f1, 0x1130, + 0x7908, 0xa18c, 0x1fff, 0xa182, 0x0011, 0x1688, 0x20a9, 0x000c, + 0x20e1, 0x0000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0x20e1, 0x2000, + 0x2001, 0x020a, 0x2004, 0x7a0c, 0x7808, 0xa080, 0x0007, 0xa084, + 0x1ff8, 0x0419, 0x1120, 0xa08a, 0x0140, 0x1a0c, 0x14fa, 0x80ac, + 0x20e1, 0x6000, 0x2099, 0x020a, 0x53a5, 0x20e1, 0x7000, 0x6828, + 0x6828, 0x7803, 0x0004, 0xa294, 0x0070, 0x000e, 0x20e0, 0x015e, + 0x014e, 0x013e, 0x001e, 0x002e, 0x00de, 0x00fe, 0x0005, 0xa016, + 0x080c, 0x1828, 0xa085, 0x0001, 0x0c80, 0x0006, 0x2001, 0x0111, + 0x2004, 0xa084, 0x0003, 0x000e, 0x0005, 0x0046, 0x00e6, 0x00d6, + 0x2028, 0x2130, 0xa696, 0x00ff, 0x1198, 0xa596, 0xfffd, 0x1120, + 0x2009, 0x007f, 0x0804, 0x64bf, 0xa596, 0xfffe, 0x1118, 0x2009, + 0x007e, 0x04e8, 0xa596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04b8, + 0x2011, 0x0000, 0x2019, 0xb134, 0x231c, 0xd3ac, 0x0138, 0x2021, + 0x0000, 0x20a9, 0x00ff, 0x2071, 0xb235, 0x0030, 0x2021, 0x0081, + 0x20a9, 0x007e, 0x2071, 0xb2b6, 0x2e1c, 0x83ff, 0x1128, 0x82ff, + 0x1198, 0x2410, 0xc2fd, 0x0080, 0x2368, 0x6f10, 0x0006, 0x2100, + 0xa706, 0x000e, 0x6b14, 0x1120, 0xa346, 0x1110, 0x2408, 0x0078, + 0x87ff, 0x1110, 0x83ff, 0x0d58, 0x8420, 0x8e70, 0x1f04, 0x649c, + 0x82ff, 0x1118, 0xa085, 0x0001, 0x0018, 0xc2fc, 0x2208, 0xa006, + 0x00de, 0x00ee, 0x004e, 0x0005, 0xa084, 0x0007, 0x000a, 0x0005, + 0x64d0, 0x64d0, 0x64d0, 0x661d, 0x64d0, 0x64d1, 0x64e6, 0x655b, + 0x0005, 0x7110, 0xd1bc, 0x0188, 0x7120, 0x2160, 0xac8c, 0x0007, + 0x1160, 0xac8a, 0xb800, 0x0248, 0x6858, 0xac02, 0x1230, 0x7124, + 0x610a, 0x2009, 0x0046, 0x080c, 0x831a, 0x0005, 0x00c6, 0x7110, + 0xd1bc, 0x1904, 0x6539, 0x2011, 0xb683, 0x2204, 0x8211, 0x220c, + 0x080c, 0x26f6, 0x1904, 0x6539, 0x080c, 0x4dc5, 0x1904, 0x6539, + 0x6612, 0x6516, 0x6000, 0xd0ec, 0x15e0, 0x6204, 0xa294, 0xff00, + 0x8217, 0xa286, 0x0006, 0x0160, 0x080c, 0x58d5, 0x11d0, 0x6204, + 0xa294, 0x00ff, 0xa286, 0x0006, 0x11a0, 0xa295, 0x0600, 0x6206, + 0x00c6, 0x080c, 0x8295, 0x001e, 0x0530, 0x611a, 0x601f, 0x0006, + 0x7120, 0x610a, 0x7130, 0x6152, 0x2009, 0x0044, 0x080c, 0x831a, + 0x00c0, 0x00c6, 0x080c, 0x8295, 0x001e, 0x0198, 0x611a, 0x601f, + 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x1118, 0x6007, 0x0005, + 0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x6a3c, 0x080c, + 0x6e9e, 0x00ce, 0x0005, 0x2001, 0xb10d, 0x2004, 0xd0ec, 0x0120, + 0x2011, 0x8049, 0x080c, 0x3d5b, 0x00c6, 0x080c, 0x9ae4, 0x001e, + 0x0d80, 0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x7130, 0x6152, + 0x6013, 0x0300, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x69f6, + 0x080c, 0x6e9e, 0x08f0, 0x7110, 0xd1bc, 0x0188, 0x7020, 0x2060, + 0xac84, 0x0007, 0x1160, 0xac82, 0xb800, 0x0248, 0x6858, 0xac02, + 0x1230, 0x7124, 0x610a, 0x2009, 0x0045, 0x080c, 0x831a, 0x0005, + 0x0006, 0x080c, 0x2c87, 0x000e, 0x1168, 0x7110, 0xa18c, 0xff00, + 0x810f, 0xa18e, 0x0000, 0x1130, 0xa084, 0x000f, 0xa08a, 0x0006, + 0x1208, 0x000b, 0x0005, 0x6589, 0x658a, 0x6589, 0x6589, 0x65f3, + 0x65ff, 0x0005, 0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, + 0x65f2, 0x700c, 0x7108, 0x080c, 0x26f6, 0x1904, 0x65f2, 0x080c, + 0x4dc5, 0x1904, 0x65f2, 0x6612, 0x6516, 0x6204, 0x7110, 0xd1bc, + 0x01f8, 0xa28c, 0x00ff, 0xa186, 0x0004, 0x0118, 0xa186, 0x0006, + 0x15c8, 0x00c6, 0x080c, 0x660b, 0x00ce, 0x0904, 0x65f2, 0x00c6, + 0x080c, 0x8295, 0x001e, 0x05f0, 0x611a, 0x080c, 0x9c35, 0x601f, + 0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0x831a, 0x0490, + 0xa28c, 0x00ff, 0xa186, 0x0006, 0x0160, 0xa186, 0x0004, 0x0148, + 0xa294, 0xff00, 0x8217, 0xa286, 0x0004, 0x0118, 0xa286, 0x0006, + 0x1188, 0x00c6, 0x080c, 0x8295, 0x001e, 0x01e0, 0x611a, 0x080c, + 0x9c35, 0x601f, 0x0005, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c, + 0x831a, 0x0080, 0x00c6, 0x080c, 0x8295, 0x001e, 0x0158, 0x611a, + 0x080c, 0x9c35, 0x601f, 0x0004, 0x7120, 0x610a, 0x2009, 0x0001, + 0x080c, 0x831a, 0x0005, 0x7110, 0xd1bc, 0x0140, 0x00a1, 0x0130, + 0x7124, 0x610a, 0x2009, 0x0089, 0x080c, 0x831a, 0x0005, 0x7110, + 0xd1bc, 0x0140, 0x0041, 0x0130, 0x7124, 0x610a, 0x2009, 0x008a, + 0x080c, 0x831a, 0x0005, 0x7020, 0x2060, 0xac84, 0x0007, 0x1158, + 0xac82, 0xb800, 0x0240, 0x2001, 0xb116, 0x2004, 0xac02, 0x1218, + 0xa085, 0x0001, 0x0005, 0xa006, 0x0ce8, 0x7110, 0xd1bc, 0x1178, + 0x7024, 0x2060, 0xac84, 0x0007, 0x1150, 0xac82, 0xb800, 0x0238, + 0x6858, 0xac02, 0x1220, 0x2009, 0x0051, 0x080c, 0x831a, 0x0005, + 0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206, 0x0049, 0x0005, + 0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213, 0x0009, 0x0005, + 0x00c6, 0x00d6, 0x00f6, 0x7000, 0xa084, 0xf000, 0xa086, 0xc000, + 0x05b0, 0x080c, 0x8295, 0x0598, 0x0066, 0x00c6, 0x0046, 0x2011, + 0xb683, 0x2204, 0x8211, 0x220c, 0x080c, 0x26f6, 0x1580, 0x080c, + 0x4dc5, 0x1568, 0x6612, 0x6516, 0x2c00, 0x004e, 0x00ce, 0x601a, + 0x080c, 0x9c35, 0x080c, 0x15dd, 0x01f0, 0x2d00, 0x6056, 0x6803, + 0x0000, 0x6837, 0x0000, 0x6c3a, 0xadf8, 0x000f, 0x20a9, 0x000e, + 0x2fa0, 0x2e98, 0x53a3, 0x006e, 0x6612, 0x6007, 0x003e, 0x601f, + 0x0001, 0x6003, 0x0001, 0x080c, 0x6a3c, 0x080c, 0x6e9e, 0x00fe, + 0x00de, 0x00ce, 0x0005, 0x080c, 0x82eb, 0x006e, 0x0cc0, 0x004e, + 0x00ce, 0x0cc8, 0x2071, 0xb3ec, 0x7003, 0x0003, 0x700f, 0x0361, + 0xa006, 0x701a, 0x7012, 0x7017, 0xb800, 0x7007, 0x0000, 0x7026, + 0x702b, 0x7a99, 0x7032, 0x7037, 0x7af9, 0x703b, 0xffff, 0x703f, + 0xffff, 0x7042, 0x7047, 0x42c1, 0x704a, 0x705b, 0x67d1, 0x2001, + 0xb3a0, 0x2003, 0x0003, 0x2001, 0xb3a2, 0x2003, 0x0100, 0x3a00, + 0xa084, 0x0005, 0x706e, 0x0005, 0x2071, 0xb3ec, 0x1d04, 0x6731, + 0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x1518, 0x700f, 0x0361, + 0x7007, 0x0001, 0x0126, 0x2091, 0x8000, 0x7040, 0xa00d, 0x0128, + 0x8109, 0x7142, 0x1110, 0x7044, 0x080f, 0x00c6, 0x2061, 0xb100, + 0x6034, 0x00ce, 0xd0cc, 0x0180, 0x3a00, 0xa084, 0x0005, 0x726c, + 0xa216, 0x0150, 0x706e, 0x2011, 0x8043, 0x2018, 0x080c, 0x3d5b, + 0x0018, 0x0126, 0x2091, 0x8000, 0x7024, 0xa00d, 0x0188, 0x7020, + 0x8001, 0x7022, 0x1168, 0x7023, 0x0009, 0x8109, 0x7126, 0xa186, + 0x03e8, 0x1110, 0x7028, 0x080f, 0x81ff, 0x1110, 0x7028, 0x080f, + 0x7030, 0xa00d, 0x0158, 0x702c, 0x8001, 0x702e, 0x1138, 0x702f, + 0x0009, 0x8109, 0x7132, 0x1110, 0x7034, 0x080f, 0x7038, 0xa005, + 0x0118, 0x0310, 0x8001, 0x703a, 0x703c, 0xa005, 0x0118, 0x0310, + 0x8001, 0x703e, 0x704c, 0xa00d, 0x0168, 0x7048, 0x8001, 0x704a, + 0x1148, 0x704b, 0x0009, 0x8109, 0x714e, 0x1120, 0x7150, 0x714e, + 0x7058, 0x080f, 0x7018, 0xa00d, 0x0158, 0x7008, 0x8001, 0x700a, + 0x1138, 0x700b, 0x0009, 0x8109, 0x711a, 0x1110, 0x701c, 0x080f, + 0x012e, 0x7004, 0x0002, 0x6757, 0x6758, 0x6770, 0x00e6, 0x2071, + 0xb3ec, 0x7018, 0xa005, 0x1120, 0x711a, 0x721e, 0x700b, 0x0009, + 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0xb3ec, 0x701c, 0xa206, + 0x1110, 0x701a, 0x701e, 0x000e, 0x00ee, 0x0005, 0x00e6, 0x2071, + 0xb3ec, 0x6088, 0xa102, 0x0208, 0x618a, 0x00ee, 0x0005, 0x0005, + 0x7110, 0x080c, 0x4e21, 0x1158, 0x6088, 0x8001, 0x0240, 0x608a, + 0x1130, 0x0126, 0x2091, 0x8000, 0x080c, 0x6e9e, 0x012e, 0x8108, + 0xa182, 0x00ff, 0x0218, 0xa00e, 0x7007, 0x0002, 0x7112, 0x0005, + 0x7014, 0x2060, 0x0126, 0x2091, 0x8000, 0x603c, 0xa005, 0x0128, + 0x8001, 0x603e, 0x1110, 0x080c, 0x9b23, 0x6014, 0xa005, 0x0500, + 0x8001, 0x6016, 0x11e8, 0x611c, 0xa186, 0x0003, 0x0118, 0xa186, + 0x0006, 0x11a0, 0x6010, 0x2068, 0x6854, 0xa08a, 0x199a, 0x0270, + 0xa082, 0x1999, 0x6856, 0xa08a, 0x199a, 0x0210, 0x2001, 0x1999, + 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x0010, 0x080c, 0x9617, + 0x012e, 0xac88, 0x0018, 0x7116, 0x2001, 0xe800, 0xa102, 0x0220, + 0x7017, 0xb800, 0x7007, 0x0000, 0x0005, 0x00e6, 0x2071, 0xb3ec, + 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005, 0x2001, 0xb3f5, + 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071, 0xb3ec, 0x7132, 0x702f, + 0x0009, 0x00ee, 0x0005, 0x2011, 0xb3f8, 0x2013, 0x0000, 0x0005, + 0x00e6, 0x2071, 0xb3ec, 0x711a, 0x721e, 0x700b, 0x0009, 0x00ee, + 0x0005, 0x00c6, 0x0026, 0x7054, 0x8000, 0x7056, 0x2061, 0xb3a0, + 0x6008, 0xa086, 0x0000, 0x0158, 0x7068, 0x6032, 0x7064, 0x602e, + 0x7060, 0x602a, 0x705c, 0x6026, 0x2c10, 0x080c, 0x1628, 0x002e, + 0x00ce, 0x0005, 0x00c6, 0x2061, 0xb464, 0x00ce, 0x0005, 0xa184, + 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0xb464, 0x2060, 0x0005, + 0x6854, 0xa08a, 0x199a, 0x0210, 0x2001, 0x1999, 0xa005, 0x1150, + 0x00c6, 0x2061, 0xb464, 0x6014, 0x00ce, 0xa005, 0x1138, 0x2001, + 0x001e, 0x0020, 0xa08e, 0xffff, 0x1108, 0xa006, 0x8003, 0x800b, + 0x810b, 0xa108, 0x6116, 0x684c, 0xa08c, 0x00c0, 0xa18e, 0x00c0, + 0x05b0, 0xd0b4, 0x1138, 0xd0bc, 0x1528, 0x2009, 0x0006, 0x080c, + 0x6868, 0x0005, 0xd0fc, 0x0130, 0xa084, 0x0003, 0x0118, 0xa086, + 0x0003, 0x15c0, 0x6020, 0xd0d4, 0x0130, 0xc0d4, 0x6022, 0x6860, + 0x602a, 0x685c, 0x602e, 0x2009, 0xb174, 0x2104, 0xd084, 0x0128, + 0x2009, 0x0042, 0x080c, 0x831a, 0x0005, 0x2009, 0x0043, 0x080c, + 0x831a, 0x0005, 0xd0fc, 0x0130, 0xa084, 0x0003, 0x0118, 0xa086, + 0x0003, 0x11c0, 0x2009, 0x0042, 0x080c, 0x831a, 0x0005, 0xd0fc, + 0x0150, 0xa084, 0x0003, 0xa08e, 0x0002, 0x0138, 0x2009, 0x0041, + 0x080c, 0x831a, 0x0005, 0x0051, 0x0ce8, 0x2009, 0x0043, 0x080c, + 0x831a, 0x0cc0, 0x2009, 0x0004, 0x0019, 0x0005, 0x2009, 0x0001, + 0x00d6, 0x6010, 0xa0ec, 0xf000, 0x01f0, 0x2068, 0x6952, 0x6800, + 0x6012, 0xa186, 0x0001, 0x1188, 0x694c, 0xa18c, 0x8100, 0xa18e, + 0x8100, 0x1158, 0x00c6, 0x2061, 0xb464, 0x6200, 0xd28c, 0x1120, + 0x6204, 0x8210, 0x0208, 0x6206, 0x00ce, 0x080c, 0x5271, 0x6010, + 0xa06d, 0x190c, 0x67f8, 0x00de, 0x0005, 0x0156, 0x00c6, 0x2061, + 0xb464, 0x6000, 0x81ff, 0x0110, 0xa205, 0x0008, 0xa204, 0x6002, + 0x00ce, 0x015e, 0x0005, 0x6800, 0xd08c, 0x1138, 0x6808, 0xa005, + 0x0120, 0x8001, 0x680a, 0xa085, 0x0001, 0x0005, 0x20a9, 0x0010, + 0xa006, 0x8004, 0x8086, 0x818e, 0x1208, 0xa200, 0x1f04, 0x68aa, + 0x8086, 0x818e, 0x0005, 0x0156, 0x20a9, 0x0010, 0xa005, 0x01b8, + 0xa11a, 0x12a8, 0x8213, 0x818d, 0x0228, 0xa11a, 0x1220, 0x1f04, + 0x68ba, 0x0028, 0xa11a, 0x2308, 0x8210, 0x1f04, 0x68ba, 0x0006, + 0x3200, 0xa084, 0xefff, 0x2080, 0x000e, 0x015e, 0x0005, 0x0006, + 0x3200, 0xa085, 0x1000, 0x0cb8, 0x0126, 0x2091, 0x2800, 0x2079, + 0xb3d9, 0x012e, 0x00d6, 0x2069, 0xb3d9, 0x6803, 0x0005, 0x2069, + 0x0004, 0x2d04, 0xa085, 0x8001, 0x206a, 0x00de, 0x0005, 0x00c6, + 0x6027, 0x0001, 0x7804, 0xa084, 0x0007, 0x0002, 0x68f8, 0x6919, + 0x696c, 0x68fe, 0x6919, 0x68f8, 0x68f6, 0x68f6, 0x080c, 0x14fa, + 0x080c, 0x67b6, 0x080c, 0x6e9e, 0x00ce, 0x0005, 0x62c0, 0x82ff, + 0x1110, 0x00ce, 0x0005, 0x2011, 0x494f, 0x080c, 0x6742, 0x7828, + 0xa092, 0x00c8, 0x1228, 0x8000, 0x782a, 0x080c, 0x4989, 0x0c88, + 0x080c, 0x494f, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b, 0x0000, + 0x0c40, 0x080c, 0x67b6, 0x3c00, 0x0006, 0x2011, 0x0209, 0x20e1, + 0x4000, 0x2214, 0x000e, 0x20e0, 0x82ff, 0x0178, 0x62c0, 0x82ff, + 0x1160, 0x782b, 0x0000, 0x7824, 0xa065, 0x090c, 0x14fa, 0x2009, + 0x0013, 0x080c, 0x831a, 0x00ce, 0x0005, 0x3900, 0xa082, 0xb51c, + 0x1210, 0x080c, 0x8000, 0x00c6, 0x7824, 0xa065, 0x090c, 0x14fa, + 0x7804, 0xa086, 0x0004, 0x0904, 0x69ac, 0x7828, 0xa092, 0x2710, + 0x1230, 0x8000, 0x782a, 0x00ce, 0x080c, 0x7a7f, 0x0c20, 0x6104, + 0xa186, 0x0003, 0x1188, 0x00e6, 0x2071, 0xb100, 0x70dc, 0x00ee, + 0xd08c, 0x0150, 0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, 0xb100, + 0x080c, 0x4992, 0x00ee, 0x00ce, 0x080c, 0xafee, 0x2009, 0x0014, + 0x080c, 0x831a, 0x00ce, 0x0838, 0x2001, 0xb3f5, 0x2003, 0x0000, + 0x62c0, 0x82ff, 0x1160, 0x782b, 0x0000, 0x7824, 0xa065, 0x090c, + 0x14fa, 0x2009, 0x0013, 0x080c, 0x836e, 0x00ce, 0x0005, 0x00c6, + 0x00d6, 0x3900, 0xa082, 0xb51c, 0x1210, 0x080c, 0x8000, 0x7824, + 0xa005, 0x090c, 0x14fa, 0x781c, 0xa06d, 0x090c, 0x14fa, 0x6800, + 0xc0dc, 0x6802, 0x7924, 0x2160, 0x080c, 0x82eb, 0x693c, 0x81ff, + 0x090c, 0x14fa, 0x8109, 0x693e, 0x6854, 0xa015, 0x0110, 0x7a1e, + 0x0010, 0x7918, 0x791e, 0x7807, 0x0000, 0x7827, 0x0000, 0x00de, + 0x00ce, 0x080c, 0x6e9e, 0x0888, 0x6104, 0xa186, 0x0002, 0x0128, + 0xa186, 0x0004, 0x0110, 0x0804, 0x6945, 0x7808, 0xac06, 0x0904, + 0x6945, 0x080c, 0x6dc1, 0x080c, 0x6a3c, 0x00ce, 0x080c, 0x6e9e, + 0x0804, 0x6933, 0x00c6, 0x6027, 0x0002, 0x62c8, 0x60c4, 0xa205, + 0x1178, 0x793c, 0xa1e5, 0x0000, 0x0130, 0x2009, 0x0049, 0x080c, + 0x831a, 0x00ce, 0x0005, 0x2011, 0xb3f8, 0x2013, 0x0000, 0x0cc8, + 0x3908, 0xa192, 0xb51c, 0x1210, 0x080c, 0x8000, 0x793c, 0x81ff, + 0x0d90, 0x793c, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x1138, + 0x6014, 0xa084, 0x0184, 0xa085, 0x0012, 0x6016, 0x0c10, 0x6014, + 0xa084, 0x0184, 0xa085, 0x0016, 0x6016, 0x08d8, 0x0006, 0x0016, + 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, + 0xb3d9, 0x6020, 0x8000, 0x6022, 0x6010, 0xa005, 0x0148, 0xa080, + 0x0003, 0x2102, 0x6112, 0x012e, 0x00ce, 0x001e, 0x000e, 0x0005, + 0x6116, 0x6112, 0x0cc0, 0x00d6, 0x2069, 0xb3d9, 0x6000, 0xd0d4, + 0x0168, 0x6820, 0x8000, 0x6822, 0xa086, 0x0001, 0x1110, 0x2c00, + 0x681e, 0x6804, 0xa084, 0x0007, 0x0804, 0x6ea4, 0xc0d5, 0x6002, + 0x6818, 0xa005, 0x0158, 0x6056, 0x605b, 0x0000, 0x0006, 0x2c00, + 0x681a, 0x00de, 0x685a, 0x2069, 0xb3d9, 0x0c18, 0x6056, 0x605a, + 0x2c00, 0x681a, 0x681e, 0x08e8, 0x0006, 0x0016, 0x00c6, 0x0126, + 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0xb3d9, 0x6020, + 0x8000, 0x6022, 0x6008, 0xa005, 0x0148, 0xa080, 0x0003, 0x2102, + 0x610a, 0x012e, 0x00ce, 0x001e, 0x000e, 0x0005, 0x610e, 0x610a, + 0x0cc0, 0x00c6, 0x600f, 0x0000, 0x2c08, 0x2061, 0xb3d9, 0x6034, + 0xa005, 0x0130, 0xa080, 0x0003, 0x2102, 0x6136, 0x00ce, 0x0005, + 0x613a, 0x6136, 0x0cd8, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, + 0x0066, 0x0026, 0x0016, 0x0006, 0x0126, 0x2071, 0xb3d9, 0x7638, + 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0904, 0x6ad7, 0x6018, + 0xa080, 0x0028, 0x2004, 0xa206, 0x1904, 0x6ad2, 0x87ff, 0x0120, + 0x6050, 0xa106, 0x1904, 0x6ad2, 0x703c, 0xac06, 0x1170, 0x0036, + 0x2019, 0x0001, 0x080c, 0x7cc4, 0x7033, 0x0000, 0x703f, 0x0000, + 0x7043, 0x0000, 0x7047, 0x0000, 0x003e, 0x7038, 0xac36, 0x1110, + 0x660c, 0x763a, 0x7034, 0xac36, 0x1140, 0x2c00, 0xaf36, 0x0118, + 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x0066, 0x2c00, + 0xaf06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, + 0x986a, 0x0198, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x1510, + 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, 0x9ada, 0x080c, + 0xaf46, 0x080c, 0x5271, 0x080c, 0x9a1f, 0x080c, 0x9a2b, 0x00ce, + 0x0804, 0x6a7c, 0x2c78, 0x600c, 0x2060, 0x0804, 0x6a7c, 0x012e, + 0x000e, 0x001e, 0x002e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, + 0x00fe, 0x0005, 0x601c, 0xa086, 0x0006, 0x19d0, 0x080c, 0xaf46, + 0x080c, 0xac5f, 0x0c10, 0x0006, 0x0066, 0x00c6, 0x00d6, 0x00f6, + 0x2031, 0x0000, 0x0126, 0x2091, 0x8000, 0x2079, 0xb3d9, 0x7838, + 0xa065, 0x0558, 0x600c, 0x0006, 0x600f, 0x0000, 0x783c, 0xac06, + 0x1170, 0x0036, 0x2019, 0x0001, 0x080c, 0x7cc4, 0x7833, 0x0000, + 0x783f, 0x0000, 0x7843, 0x0000, 0x7847, 0x0000, 0x003e, 0x080c, + 0x986a, 0x0178, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x11b0, + 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, 0x5271, 0x080c, + 0x9a1f, 0x080c, 0x9a2b, 0x000e, 0x0898, 0x7e3a, 0x7e36, 0x012e, + 0x00fe, 0x00de, 0x00ce, 0x006e, 0x000e, 0x0005, 0x601c, 0xa086, + 0x0006, 0x1d30, 0x080c, 0xac5f, 0x0c60, 0x0016, 0x0026, 0x0086, + 0x2041, 0x0000, 0x0099, 0x080c, 0x6bf7, 0x008e, 0x002e, 0x001e, + 0x0005, 0x00f6, 0x0126, 0x2079, 0xb3d9, 0x2091, 0x8000, 0x080c, + 0x6c84, 0x080c, 0x6cf6, 0x012e, 0x00fe, 0x0005, 0x00f6, 0x00e6, + 0x00d6, 0x00c6, 0x0066, 0x0016, 0x0006, 0x0126, 0x2091, 0x8000, + 0x2071, 0xb3d9, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0904, 0x6bd3, + 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x1904, 0x6bce, 0x88ff, + 0x0120, 0x6050, 0xa106, 0x1904, 0x6bce, 0x7024, 0xac06, 0x1538, + 0x2069, 0x0100, 0x68c0, 0xa005, 0x01f0, 0x080c, 0x67b6, 0x080c, + 0x7a8c, 0x68c3, 0x0000, 0x080c, 0x7f1b, 0x7027, 0x0000, 0x0036, + 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0120, 0x6803, 0x0100, + 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, + 0x0001, 0x003e, 0x0020, 0x6003, 0x0009, 0x630a, 0x04b8, 0x7014, + 0xac36, 0x1110, 0x660c, 0x7616, 0x7010, 0xac36, 0x1140, 0x2c00, + 0xaf36, 0x0118, 0x2f00, 0x7012, 0x0010, 0x7013, 0x0000, 0x660c, + 0x0066, 0x2c00, 0xaf06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, + 0x0000, 0x6010, 0x2068, 0x080c, 0x986a, 0x0188, 0x601c, 0xa086, + 0x0003, 0x1510, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, + 0x9ada, 0x080c, 0xaf46, 0x080c, 0x5271, 0x080c, 0x9a1f, 0x080c, + 0x9a2b, 0x080c, 0x7dfb, 0x00ce, 0x0804, 0x6b5d, 0x2c78, 0x600c, + 0x2060, 0x0804, 0x6b5d, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, + 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601c, 0xa086, 0x0006, 0x1128, + 0x080c, 0xaf46, 0x080c, 0xac5f, 0x0c10, 0x601c, 0xa086, 0x0002, + 0x1128, 0x6004, 0xa086, 0x0085, 0x0968, 0x08c8, 0x601c, 0xa086, + 0x0005, 0x19a8, 0x6004, 0xa086, 0x0085, 0x0d50, 0x0880, 0x00c6, + 0x0006, 0x0126, 0x2091, 0x8000, 0xa280, 0xb235, 0x2004, 0xa065, + 0x0904, 0x6c80, 0x00f6, 0x00e6, 0x00d6, 0x0066, 0x2071, 0xb3d9, + 0x6654, 0x7018, 0xac06, 0x1108, 0x761a, 0x701c, 0xac06, 0x1130, + 0x86ff, 0x1118, 0x7018, 0x701e, 0x0008, 0x761e, 0x6058, 0xa07d, + 0x0108, 0x7e56, 0xa6ed, 0x0000, 0x0110, 0x2f00, 0x685a, 0x6057, + 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x080c, + 0x4d4c, 0x0904, 0x6c7c, 0x7624, 0x86ff, 0x05e8, 0xa680, 0x0004, + 0x2004, 0xad06, 0x15c0, 0x00d6, 0x2069, 0x0100, 0x68c0, 0xa005, + 0x0548, 0x080c, 0x67b6, 0x080c, 0x7a8c, 0x68c3, 0x0000, 0x080c, + 0x7f1b, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0xa384, + 0x1000, 0x0120, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, + 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x00de, 0x00c6, + 0x603c, 0xa005, 0x0110, 0x8001, 0x603e, 0x2660, 0x080c, 0x9a2b, + 0x00ce, 0x0048, 0x00de, 0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, + 0x00ce, 0x0804, 0x6c27, 0x8dff, 0x0158, 0x6837, 0x0103, 0x6b4a, + 0x6847, 0x0000, 0x080c, 0x9ada, 0x080c, 0xaf46, 0x080c, 0x5271, + 0x080c, 0x7dfb, 0x0804, 0x6c27, 0x006e, 0x00de, 0x00ee, 0x00fe, + 0x012e, 0x000e, 0x00ce, 0x0005, 0x0006, 0x0066, 0x00c6, 0x00d6, + 0x2031, 0x0000, 0x7814, 0xa065, 0x0904, 0x6cd6, 0x600c, 0x0006, + 0x600f, 0x0000, 0x7824, 0xac06, 0x1540, 0x2069, 0x0100, 0x68c0, + 0xa005, 0x01f0, 0x080c, 0x67b6, 0x080c, 0x7a8c, 0x68c3, 0x0000, + 0x080c, 0x7f1b, 0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, + 0xa384, 0x1000, 0x0120, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, + 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0028, + 0x6003, 0x0009, 0x630a, 0x2c30, 0x00b0, 0x6010, 0x2068, 0x080c, + 0x986a, 0x0168, 0x601c, 0xa086, 0x0003, 0x11b8, 0x6837, 0x0103, + 0x6b4a, 0x6847, 0x0000, 0x080c, 0x5271, 0x080c, 0x9a1f, 0x080c, + 0x9a2b, 0x080c, 0x7dfb, 0x000e, 0x0804, 0x6c8b, 0x7e16, 0x7e12, + 0x00de, 0x00ce, 0x006e, 0x000e, 0x0005, 0x601c, 0xa086, 0x0006, + 0x1118, 0x080c, 0xac5f, 0x0c58, 0x601c, 0xa086, 0x0002, 0x1128, + 0x6004, 0xa086, 0x0085, 0x09d0, 0x0c10, 0x601c, 0xa086, 0x0005, + 0x19f0, 0x6004, 0xa086, 0x0085, 0x0d60, 0x08c8, 0x0006, 0x0066, + 0x00c6, 0x00d6, 0x7818, 0xa065, 0x0904, 0x6d5c, 0x6054, 0x0006, + 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, + 0x080c, 0x4d4c, 0x0904, 0x6d59, 0x7e24, 0x86ff, 0x05e8, 0xa680, + 0x0004, 0x2004, 0xad06, 0x15c0, 0x00d6, 0x2069, 0x0100, 0x68c0, + 0xa005, 0x0548, 0x080c, 0x67b6, 0x080c, 0x7a8c, 0x68c3, 0x0000, + 0x080c, 0x7f1b, 0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, + 0xa384, 0x1000, 0x0120, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, + 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x00de, + 0x00c6, 0x603c, 0xa005, 0x0110, 0x8001, 0x603e, 0x2660, 0x080c, + 0x9a2b, 0x00ce, 0x0048, 0x00de, 0x00c6, 0x2660, 0x6003, 0x0009, + 0x630a, 0x00ce, 0x0804, 0x6d08, 0x8dff, 0x0138, 0x6837, 0x0103, + 0x6b4a, 0x6847, 0x0000, 0x080c, 0x5271, 0x080c, 0x7dfb, 0x0804, + 0x6d08, 0x000e, 0x0804, 0x6cfb, 0x781e, 0x781a, 0x00de, 0x00ce, + 0x006e, 0x000e, 0x0005, 0x00e6, 0x00d6, 0x0066, 0x6000, 0xd0dc, + 0x0188, 0x604c, 0xa06d, 0x0170, 0x6848, 0xa606, 0x1158, 0x2071, + 0xb3d9, 0x7024, 0xa035, 0x0130, 0xa080, 0x0004, 0x2004, 0xad06, + 0x1108, 0x0021, 0x006e, 0x00de, 0x00ee, 0x0005, 0x00f6, 0x2079, + 0x0100, 0x78c0, 0xa005, 0x1138, 0x00c6, 0x2660, 0x6003, 0x0009, + 0x630a, 0x00ce, 0x04a0, 0x080c, 0x7a8c, 0x78c3, 0x0000, 0x080c, + 0x7f1b, 0x7027, 0x0000, 0x0036, 0x2079, 0x0140, 0x7b04, 0xa384, + 0x1000, 0x0120, 0x7803, 0x0100, 0x7803, 0x0000, 0x2079, 0x0100, + 0x7824, 0xd084, 0x0110, 0x7827, 0x0001, 0x080c, 0x7f1b, 0x003e, + 0x080c, 0x4d4c, 0x00c6, 0x603c, 0xa005, 0x0110, 0x8001, 0x603e, + 0x2660, 0x080c, 0x82eb, 0x00ce, 0x6837, 0x0103, 0x6b4a, 0x6847, + 0x0000, 0x080c, 0x9ada, 0x080c, 0x5271, 0x080c, 0x7dfb, 0x00fe, + 0x0005, 0x00e6, 0x00c6, 0x2071, 0xb3d9, 0x7004, 0xa084, 0x0007, + 0x0002, 0x6dd3, 0x6dd6, 0x6dec, 0x6e05, 0x6e3e, 0x6dd3, 0x6dd1, + 0x6dd1, 0x080c, 0x14fa, 0x00ce, 0x00ee, 0x0005, 0x7024, 0xa065, + 0x0148, 0x7020, 0x8001, 0x7022, 0x600c, 0xa015, 0x0150, 0x7216, + 0x600f, 0x0000, 0x7007, 0x0000, 0x7027, 0x0000, 0x00ce, 0x00ee, + 0x0005, 0x7216, 0x7212, 0x0cb0, 0x6018, 0x2060, 0x080c, 0x4d4c, + 0x6000, 0xc0dc, 0x6002, 0x7020, 0x8001, 0x7022, 0x0120, 0x6054, + 0xa015, 0x0140, 0x721e, 0x7007, 0x0000, 0x7027, 0x0000, 0x00ce, + 0x00ee, 0x0005, 0x7218, 0x721e, 0x0cb0, 0x7024, 0xa065, 0x0598, + 0x700c, 0xac06, 0x1160, 0x080c, 0x7dfb, 0x600c, 0xa015, 0x0120, + 0x720e, 0x600f, 0x0000, 0x0428, 0x720e, 0x720a, 0x0410, 0x7014, + 0xac06, 0x1160, 0x080c, 0x7dfb, 0x600c, 0xa015, 0x0120, 0x7216, + 0x600f, 0x0000, 0x00b0, 0x7216, 0x7212, 0x0098, 0x6018, 0x2060, + 0x080c, 0x4d4c, 0x6000, 0xc0dc, 0x6002, 0x080c, 0x7dfb, 0x701c, + 0xa065, 0x0138, 0x6054, 0xa015, 0x0110, 0x721e, 0x0010, 0x7218, + 0x721e, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x0005, 0x7024, 0xa065, + 0x0140, 0x080c, 0x7dfb, 0x600c, 0xa015, 0x0150, 0x720e, 0x600f, + 0x0000, 0x080c, 0x7f1b, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x0005, + 0x720e, 0x720a, 0x0cb0, 0x00d6, 0x2069, 0xb3d9, 0x6830, 0xa084, + 0x0003, 0x0002, 0x6e60, 0x6e62, 0x6e86, 0x6e5e, 0x080c, 0x14fa, + 0x00de, 0x0005, 0x00c6, 0x6840, 0xa086, 0x0001, 0x01b8, 0x683c, + 0xa065, 0x0130, 0x600c, 0xa015, 0x0170, 0x6a3a, 0x600f, 0x0000, + 0x6833, 0x0000, 0x683f, 0x0000, 0x2011, 0xb3f8, 0x2013, 0x0000, + 0x00ce, 0x00de, 0x0005, 0x683a, 0x6836, 0x0c90, 0x6843, 0x0000, + 0x6838, 0xa065, 0x0d68, 0x6003, 0x0003, 0x0c50, 0x00c6, 0x6843, + 0x0000, 0x6847, 0x0000, 0x683c, 0xa065, 0x0168, 0x600c, 0xa015, + 0x0130, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000, 0x0020, 0x683f, + 0x0000, 0x683a, 0x6836, 0x00ce, 0x00de, 0x0005, 0x00d6, 0x2069, + 0xb3d9, 0x6804, 0xa084, 0x0007, 0x0002, 0x6eaf, 0x6f4b, 0x6f4b, + 0x6f4b, 0x6f4b, 0x6f4d, 0x6ead, 0x6ead, 0x080c, 0x14fa, 0x6820, + 0xa005, 0x1110, 0x00de, 0x0005, 0x00c6, 0x680c, 0xa065, 0x0150, + 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x080c, 0x6f9b, 0x00ce, + 0x00de, 0x0005, 0x6814, 0xa065, 0x0150, 0x6807, 0x0001, 0x6826, + 0x682b, 0x0000, 0x080c, 0x6f9b, 0x00ce, 0x00de, 0x0005, 0x00e6, + 0x0036, 0x6a1c, 0xa2f5, 0x0000, 0x0904, 0x6f47, 0x704c, 0xa00d, + 0x0118, 0x7088, 0xa005, 0x01a0, 0x7054, 0xa075, 0x0120, 0xa20e, + 0x0904, 0x6f47, 0x0028, 0x6818, 0xa20e, 0x0904, 0x6f47, 0x2070, + 0x704c, 0xa00d, 0x0d88, 0x7088, 0xa005, 0x1d70, 0x2e00, 0x681e, + 0x733c, 0x7038, 0xa302, 0x1e40, 0x080c, 0x82c2, 0x0904, 0x6f47, + 0x8318, 0x733e, 0x6112, 0x2e10, 0x621a, 0xa180, 0x0014, 0x2004, + 0xa084, 0x00ff, 0x605a, 0xa180, 0x0014, 0x2003, 0x0000, 0xa180, + 0x0015, 0x2004, 0xa08a, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003, + 0x801b, 0x831b, 0xa318, 0x6316, 0x003e, 0x00f6, 0x2c78, 0x71a0, + 0x2001, 0xb134, 0x2004, 0xd0ac, 0x1110, 0xd1bc, 0x0150, 0x7100, + 0xd1f4, 0x0120, 0x7114, 0xa18c, 0x00ff, 0x0040, 0x2009, 0x0000, + 0x0028, 0xa1e0, 0x2c8c, 0x2c0d, 0xa18c, 0x00ff, 0x2061, 0x0100, + 0x619a, 0x080c, 0x75c4, 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002, + 0x2f18, 0x6b26, 0x682b, 0x0000, 0x781f, 0x0003, 0x7803, 0x0001, + 0x7807, 0x0040, 0x00fe, 0x00ee, 0x00ce, 0x00de, 0x0005, 0x003e, + 0x00ee, 0x00ce, 0x0cd0, 0x00de, 0x0005, 0x00c6, 0x680c, 0xa065, + 0x0138, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x080c, 0x6f9b, + 0x00ce, 0x00de, 0x0005, 0x00f6, 0x00d6, 0x2069, 0xb3d9, 0x6830, + 0xa086, 0x0000, 0x11c0, 0x2001, 0xb10c, 0x200c, 0xd1bc, 0x1550, + 0x6838, 0xa07d, 0x0180, 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, + 0x0126, 0x00f6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1f3c, 0x1130, + 0x012e, 0x080c, 0x78fd, 0x00de, 0x00fe, 0x0005, 0x012e, 0xe000, + 0x6843, 0x0000, 0x7803, 0x0002, 0x780c, 0xa015, 0x0140, 0x6a3a, + 0x780f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c60, 0x683a, + 0x6836, 0x0cc0, 0xc1bc, 0x2102, 0x0066, 0x2031, 0x0001, 0x080c, + 0x5957, 0x006e, 0x0868, 0x601c, 0xa084, 0x000f, 0x000b, 0x0005, + 0x6fa9, 0x6fae, 0x7465, 0x7581, 0x6fae, 0x7465, 0x7581, 0x6fa9, + 0x6fae, 0x080c, 0x6dc1, 0x080c, 0x6e9e, 0x0005, 0x0156, 0x0136, + 0x0146, 0x00c6, 0x00f6, 0x6004, 0xa08a, 0x0080, 0x1a0c, 0x14fa, + 0x6118, 0x2178, 0x79a0, 0x2011, 0xb134, 0x2214, 0xd2ac, 0x1110, + 0xd1bc, 0x0150, 0x7900, 0xd1f4, 0x0120, 0x7914, 0xa18c, 0x00ff, + 0x0040, 0x2009, 0x0000, 0x0028, 0xa1f8, 0x2c8c, 0x2f0d, 0xa18c, + 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0xa08a, 0x0040, 0x1a04, + 0x7022, 0x0033, 0x00fe, 0x00ce, 0x014e, 0x013e, 0x015e, 0x0005, + 0x70d1, 0x711c, 0x7149, 0x7216, 0x7244, 0x724c, 0x7272, 0x7283, + 0x7294, 0x729c, 0x72b2, 0x729c, 0x730c, 0x7283, 0x732d, 0x7335, + 0x7294, 0x7335, 0x7346, 0x7020, 0x7020, 0x7020, 0x7020, 0x7020, + 0x7020, 0x7020, 0x7020, 0x7020, 0x7020, 0x7020, 0x7b6d, 0x7b92, + 0x7ba7, 0x7bca, 0x7beb, 0x7272, 0x7020, 0x7272, 0x729c, 0x7020, + 0x7149, 0x7216, 0x7020, 0x801d, 0x729c, 0x7020, 0x803d, 0x729c, + 0x7020, 0x7294, 0x70ca, 0x7035, 0x7020, 0x8062, 0x80d7, 0x81ae, + 0x7020, 0x81bf, 0x726d, 0x81db, 0x7020, 0x7c00, 0x8236, 0x7020, + 0x080c, 0x14fa, 0x2100, 0x0033, 0x00fe, 0x00ce, 0x014e, 0x013e, + 0x015e, 0x0005, 0x7033, 0x7033, 0x7033, 0x7069, 0x7087, 0x709d, + 0x7033, 0x7033, 0x7033, 0x080c, 0x14fa, 0x00d6, 0x20a1, 0x020b, + 0x080c, 0x7363, 0x7810, 0x2068, 0x20a3, 0x2414, 0x20a3, 0x0018, + 0x20a3, 0x0800, 0x683c, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x6850, 0x20a2, 0x6854, 0x20a2, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0018, 0x080c, 0x7a79, + 0x00de, 0x0005, 0x00d6, 0x7818, 0x2068, 0x68a0, 0x2069, 0xb100, + 0x6ad0, 0xd2ac, 0x1110, 0xd0bc, 0x0110, 0xa085, 0x0001, 0x00de, + 0x0005, 0x00d6, 0x20a1, 0x020b, 0x080c, 0x7363, 0x20a3, 0x0500, + 0x20a3, 0x0000, 0x7810, 0xa0e8, 0x000f, 0x6808, 0x20a2, 0x680c, + 0x20a2, 0x6810, 0x20a2, 0x6814, 0x20a2, 0x6818, 0x20a2, 0x681c, + 0x20a2, 0x60c3, 0x0010, 0x080c, 0x7a79, 0x00de, 0x0005, 0x0156, + 0x0146, 0x20a1, 0x020b, 0x080c, 0x7363, 0x20a3, 0x7800, 0x20a3, + 0x0000, 0x7808, 0x8007, 0x20a2, 0x20a3, 0x0000, 0x60c3, 0x0008, + 0x080c, 0x7a79, 0x014e, 0x015e, 0x0005, 0x0156, 0x0146, 0x20a1, + 0x020b, 0x080c, 0x73ff, 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a3, + 0xdf10, 0x20a3, 0x0034, 0x2099, 0xb105, 0x20a9, 0x0004, 0x53a6, + 0x2099, 0xb101, 0x20a9, 0x0004, 0x53a6, 0x2099, 0xb3bf, 0x20a9, + 0x001a, 0x3304, 0x8007, 0x20a2, 0x9398, 0x1f04, 0x70b9, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x60c3, 0x004c, 0x080c, 0x7a79, 0x014e, + 0x015e, 0x0005, 0x2001, 0xb114, 0x2004, 0x609a, 0x080c, 0x7a79, + 0x0005, 0x20a1, 0x020b, 0x080c, 0x7363, 0x20a3, 0x5200, 0x20a3, + 0x0000, 0x00d6, 0x2069, 0xb152, 0x6804, 0xd084, 0x0150, 0x6828, + 0x20a3, 0x0000, 0x0016, 0x080c, 0x270a, 0x21a2, 0x001e, 0x00de, + 0x0028, 0x00de, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, + 0x2099, 0xb105, 0x53a6, 0x20a9, 0x0004, 0x2099, 0xb101, 0x53a6, + 0x2001, 0xb134, 0x2004, 0xd0ac, 0x1138, 0x7818, 0xa080, 0x0028, + 0x2004, 0xa082, 0x007f, 0x0238, 0x2001, 0xb11b, 0x20a6, 0x2001, + 0xb11c, 0x20a6, 0x0040, 0x20a3, 0x0000, 0x2001, 0xb114, 0x2004, + 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, + 0x001c, 0x080c, 0x7a79, 0x0005, 0x20a1, 0x020b, 0x080c, 0x7363, + 0x20a3, 0x0500, 0x20a3, 0x0000, 0x2001, 0xb134, 0x2004, 0xd0ac, + 0x1138, 0x7818, 0xa080, 0x0028, 0x2004, 0xa082, 0x007f, 0x0238, + 0x2001, 0xb11b, 0x20a6, 0x2001, 0xb11c, 0x20a6, 0x0040, 0x20a3, + 0x0000, 0x2001, 0xb114, 0x2004, 0xa084, 0x00ff, 0x20a2, 0x20a9, + 0x0004, 0x2099, 0xb105, 0x53a6, 0x60c3, 0x0010, 0x080c, 0x7a79, + 0x0005, 0x20a1, 0x020b, 0x080c, 0x7363, 0x00c6, 0x7818, 0x2060, + 0x2001, 0x0000, 0x080c, 0x5185, 0x00ce, 0x7818, 0xa080, 0x0028, + 0x2004, 0xa086, 0x007e, 0x1130, 0x20a3, 0x0400, 0x620c, 0xc2b4, + 0x620e, 0x0010, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x7818, 0xa080, + 0x0028, 0x2004, 0xa086, 0x007e, 0x1904, 0x71d8, 0x2001, 0xb134, + 0x2004, 0xd0a4, 0x01c8, 0x2099, 0xb38e, 0x33a6, 0x9398, 0x20a3, + 0x0000, 0x9398, 0x3304, 0xa084, 0x2000, 0x20a2, 0x9398, 0x33a6, + 0x9398, 0x20a3, 0x0000, 0x9398, 0x2001, 0x2710, 0x20a2, 0x9398, + 0x33a6, 0x9398, 0x33a6, 0x00d0, 0x2099, 0xb38e, 0x33a6, 0x9398, + 0x33a6, 0x9398, 0x3304, 0x080c, 0x58d5, 0x1118, 0xa084, 0x37ff, + 0x0010, 0xa084, 0x3fff, 0x20a2, 0x9398, 0x33a6, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, + 0x2099, 0xb105, 0x53a6, 0x20a9, 0x0004, 0x2099, 0xb101, 0x53a6, + 0x20a9, 0x0008, 0x20a3, 0x0000, 0x1f04, 0x71b2, 0x20a9, 0x0008, + 0x20a3, 0x0000, 0x1f04, 0x71b8, 0x2099, 0xb396, 0x3304, 0xc0dd, + 0x20a2, 0x2001, 0xb172, 0x2004, 0xd0e4, 0x0158, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x9398, 0x9398, 0x9398, 0x33a6, 0x20a9, 0x0004, + 0x0010, 0x20a9, 0x0007, 0x20a3, 0x0000, 0x1f04, 0x71d3, 0x0468, + 0x2001, 0xb134, 0x2004, 0xd0a4, 0x0140, 0x2001, 0xb38f, 0x2004, + 0x60e3, 0x0000, 0x080c, 0x274b, 0x60e2, 0x2099, 0xb38e, 0x20a9, + 0x0008, 0x53a6, 0x20a9, 0x0004, 0x2099, 0xb105, 0x53a6, 0x20a9, + 0x0004, 0x2099, 0xb101, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, + 0x1f04, 0x71f6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x1f04, 0x71fc, + 0x2099, 0xb396, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3, + 0x0000, 0x1f04, 0x7207, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x1f04, + 0x720d, 0x60c3, 0x0074, 0x080c, 0x7a79, 0x0005, 0x20a1, 0x020b, + 0x080c, 0x7363, 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800, + 0x20a3, 0x2000, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, + 0x00f6, 0x2079, 0xb152, 0x7904, 0x00fe, 0xd1ac, 0x1110, 0xa085, + 0x0020, 0xd1a4, 0x0110, 0xa085, 0x0010, 0xa085, 0x0002, 0x00d6, + 0x0804, 0x72ee, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, + 0x0014, 0x080c, 0x7a79, 0x0005, 0x20a1, 0x020b, 0x080c, 0x7363, + 0x20a3, 0x5000, 0x0804, 0x7164, 0x20a1, 0x020b, 0x080c, 0x7363, + 0x20a3, 0x2110, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x60c3, 0x0014, 0x080c, 0x7a79, 0x0005, 0x20a1, 0x020b, 0x080c, + 0x73f7, 0x0020, 0x20a1, 0x020b, 0x080c, 0x73ff, 0x20a3, 0x0200, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, + 0x080c, 0x7a79, 0x0005, 0x20a1, 0x020b, 0x080c, 0x73ff, 0x20a3, + 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, + 0x0008, 0x080c, 0x7a79, 0x0005, 0x20a1, 0x020b, 0x080c, 0x73ff, + 0x20a3, 0x0200, 0x0804, 0x7164, 0x20a1, 0x020b, 0x080c, 0x73ff, + 0x20a3, 0x0100, 0x20a3, 0x0000, 0x7828, 0xa005, 0x0110, 0x20a2, + 0x0010, 0x20a3, 0x0003, 0x7810, 0x20a2, 0x60c3, 0x0008, 0x080c, + 0x7a79, 0x0005, 0x00d6, 0x20a1, 0x020b, 0x080c, 0x73ff, 0x20a3, + 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x7818, 0x2068, 0x6894, + 0xa086, 0x0014, 0x1178, 0x6998, 0xa184, 0xc000, 0x1140, 0xd1ec, + 0x0118, 0x20a3, 0x2100, 0x0040, 0x20a3, 0x0100, 0x0028, 0x20a3, + 0x0400, 0x0010, 0x20a3, 0x0700, 0xa006, 0x20a2, 0x20a2, 0x20a2, + 0x20a2, 0x20a2, 0x00f6, 0x2079, 0xb152, 0x7904, 0x00fe, 0xd1ac, + 0x1110, 0xa085, 0x0020, 0xd1a4, 0x0110, 0xa085, 0x0010, 0x2009, + 0xb174, 0x210c, 0xd184, 0x1110, 0xa085, 0x0002, 0x0026, 0x2009, + 0xb172, 0x210c, 0xd1e4, 0x0130, 0xc0c5, 0xa094, 0x0030, 0xa296, + 0x0010, 0x0140, 0xd1ec, 0x0130, 0xa094, 0x0030, 0xa296, 0x0010, + 0x0108, 0xc0bd, 0x002e, 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x0014, + 0x080c, 0x7a79, 0x00de, 0x0005, 0x20a1, 0x020b, 0x080c, 0x73ff, + 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0100, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x60c3, 0x0014, 0x080c, 0x7a79, 0x0005, 0x20a1, 0x020b, 0x080c, + 0x73ff, 0x20a3, 0x0200, 0x0804, 0x70d7, 0x20a1, 0x020b, 0x080c, + 0x73ff, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, + 0x2a00, 0x60c3, 0x0008, 0x080c, 0x7a79, 0x0005, 0x20e1, 0x9080, + 0x20e1, 0x4000, 0x20a1, 0x020b, 0x080c, 0x73ff, 0x20a3, 0x0100, + 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3, 0x0000, 0x60c3, 0x0008, + 0x080c, 0x7a79, 0x0005, 0x0026, 0x0036, 0x0046, 0x2019, 0x3200, + 0x2021, 0x0800, 0x0038, 0x0026, 0x0036, 0x0046, 0x2019, 0x2200, + 0x2021, 0x0100, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, + 0x0028, 0x2014, 0xa286, 0x007e, 0x11a0, 0xa385, 0x00ff, 0x20a2, + 0x20a3, 0xfffe, 0x20a3, 0x0000, 0x2011, 0xb114, 0x2214, 0x2001, + 0xb39e, 0x2004, 0xa005, 0x0118, 0x2011, 0xb11c, 0x2214, 0x22a2, + 0x04d0, 0xa286, 0x007f, 0x1138, 0x00d6, 0xa385, 0x00ff, 0x20a2, + 0x20a3, 0xfffd, 0x00c8, 0x2001, 0xb134, 0x2004, 0xd0ac, 0x1110, + 0xd2bc, 0x01c8, 0xa286, 0x0080, 0x00d6, 0x1130, 0xa385, 0x00ff, + 0x20a2, 0x20a3, 0xfffc, 0x0040, 0xa2e8, 0xb235, 0x2d6c, 0x6810, + 0xa305, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xb11b, 0x2da6, 0x8d68, + 0x2da6, 0x00de, 0x0080, 0x00d6, 0xa2e8, 0xb235, 0x2d6c, 0x6810, + 0xa305, 0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, + 0xb114, 0x2214, 0x22a2, 0xa485, 0x0029, 0x20a2, 0x004e, 0x003e, + 0x20a3, 0x0000, 0x080c, 0x7a68, 0x22a2, 0x20a3, 0x0000, 0x2fa2, + 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x002e, 0x0005, + 0x0026, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x02ff, 0x2011, + 0xfffc, 0x22a2, 0x00d6, 0x2069, 0xb11b, 0x2da6, 0x8d68, 0x2da6, + 0x00de, 0x20a3, 0x2029, 0x20a3, 0x0000, 0x08e0, 0x20a3, 0x0100, + 0x20a3, 0x0000, 0x20a3, 0xfc02, 0x20a3, 0x0000, 0x0005, 0x0026, + 0x0036, 0x0046, 0x2019, 0x3300, 0x2021, 0x0800, 0x0038, 0x0026, + 0x0036, 0x0046, 0x2019, 0x2300, 0x2021, 0x0100, 0x20e1, 0x9080, + 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0x2011, 0xb134, + 0x2214, 0xd2ac, 0x1118, 0xa092, 0x007e, 0x02d8, 0x00d6, 0xa0e8, + 0xb235, 0x2d6c, 0x6810, 0xa305, 0x20a2, 0x6814, 0x20a2, 0x6810, + 0xa005, 0x1140, 0x6814, 0xa005, 0x1128, 0x20a3, 0x00ff, 0x20a3, + 0xfffe, 0x0028, 0x2069, 0xb11b, 0x2da6, 0x8d68, 0x2da6, 0x00de, + 0x0080, 0x00d6, 0xa0e8, 0xb235, 0x2d6c, 0x6810, 0xa305, 0x20a2, + 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xb114, 0x2214, + 0x22a2, 0xa485, 0x0098, 0x20a2, 0x20a3, 0x0000, 0x004e, 0x003e, + 0x080c, 0x7a68, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x002e, 0x0005, 0x080c, 0x7a68, + 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x7810, 0x20a2, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x002e, 0x0005, 0x00c6, 0x00f6, 0x6004, + 0xa08a, 0x0085, 0x0a0c, 0x14fa, 0xa08a, 0x008c, 0x1a0c, 0x14fa, + 0x6118, 0x2178, 0x79a0, 0x2011, 0xb134, 0x2214, 0xd2ac, 0x1110, + 0xd1bc, 0x0150, 0x7900, 0xd1f4, 0x0120, 0x7914, 0xa18c, 0x00ff, + 0x0040, 0x2009, 0x0000, 0x0028, 0xa1f8, 0x2c8c, 0x2f0d, 0xa18c, + 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0xa082, 0x0085, 0x001b, + 0x00fe, 0x00ce, 0x0005, 0x749c, 0x74a6, 0x74c1, 0x749a, 0x749a, + 0x749a, 0x749c, 0x080c, 0x14fa, 0x0146, 0x20a1, 0x020b, 0x04a1, + 0x60c3, 0x0000, 0x080c, 0x7a79, 0x014e, 0x0005, 0x0146, 0x20a1, + 0x020b, 0x080c, 0x750d, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, + 0x20a2, 0x7810, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0xffff, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x60c3, 0x000c, 0x080c, 0x7a79, 0x014e, + 0x0005, 0x0146, 0x20a1, 0x020b, 0x080c, 0x7547, 0x20a3, 0x0003, + 0x20a3, 0x0300, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, + 0x080c, 0x7a79, 0x014e, 0x0005, 0x0026, 0x20e1, 0x9080, 0x20e1, + 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0x2011, 0xb134, 0x2214, + 0xd2ac, 0x1118, 0xa092, 0x007e, 0x0288, 0x00d6, 0xa0e8, 0xb235, + 0x2d6c, 0x6810, 0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2, 0x2069, + 0xb11b, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0088, 0x00d6, 0xa0e8, + 0xb235, 0x2d6c, 0x6810, 0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2, + 0x00de, 0x20a3, 0x0000, 0x2011, 0xb114, 0x2214, 0x22a2, 0x20a3, + 0x0009, 0x20a3, 0x0000, 0x0804, 0x73ca, 0x0026, 0x20e1, 0x9080, + 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0x2011, 0xb134, + 0x2214, 0xd2ac, 0x1118, 0xa092, 0x007e, 0x0288, 0x00d6, 0xa0e8, + 0xb235, 0x2d6c, 0x6810, 0xa085, 0x8400, 0x20a2, 0x6814, 0x20a2, + 0x2069, 0xb11b, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0088, 0x00d6, + 0xa0e8, 0xb235, 0x2d6c, 0x6810, 0xa085, 0x8400, 0x20a2, 0x6814, + 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xb114, 0x2214, 0x22a2, + 0x2001, 0x0099, 0x20a2, 0x20a3, 0x0000, 0x0804, 0x7456, 0x0026, + 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, + 0x2011, 0xb134, 0x2214, 0xd2ac, 0x1118, 0xa092, 0x007e, 0x0288, + 0x00d6, 0xa0e8, 0xb235, 0x2d6c, 0x6810, 0xa085, 0x8500, 0x20a2, + 0x6814, 0x20a2, 0x2069, 0xb11b, 0x2da6, 0x8d68, 0x2da6, 0x00de, + 0x0088, 0x00d6, 0xa0e8, 0xb235, 0x2d6c, 0x6810, 0xa085, 0x8500, + 0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xb114, + 0x2214, 0x22a2, 0x2001, 0x0099, 0x20a2, 0x20a3, 0x0000, 0x0804, + 0x7456, 0x00c6, 0x00f6, 0x2c78, 0x7804, 0xa08a, 0x0040, 0x0a0c, + 0x14fa, 0xa08a, 0x0053, 0x1a0c, 0x14fa, 0x7918, 0x2160, 0x61a0, + 0x2011, 0xb134, 0x2214, 0xd2ac, 0x1110, 0xd1bc, 0x0150, 0x6100, + 0xd1f4, 0x0120, 0x6114, 0xa18c, 0x00ff, 0x0040, 0x2009, 0x0000, + 0x0028, 0xa1e0, 0x2c8c, 0x2c0d, 0xa18c, 0x00ff, 0x2061, 0x0100, + 0x619a, 0xa082, 0x0040, 0x001b, 0x00fe, 0x00ce, 0x0005, 0x75c4, + 0x76d0, 0x766d, 0x7872, 0x75c2, 0x75c2, 0x75c2, 0x75c2, 0x75c2, + 0x75c2, 0x75c2, 0x7db4, 0x7dc4, 0x7dd4, 0x7de4, 0x75c2, 0x81ec, + 0x75c2, 0x7da3, 0x080c, 0x14fa, 0x00d6, 0x0156, 0x0146, 0x780b, + 0xffff, 0x20a1, 0x020b, 0x080c, 0x7624, 0x7910, 0x2168, 0x6948, + 0x7952, 0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184, + 0x000f, 0x1118, 0x2001, 0x0005, 0x0040, 0xd184, 0x0118, 0x2001, + 0x0004, 0x0018, 0xa084, 0x0006, 0x8004, 0x0016, 0x2008, 0x7858, + 0xa084, 0x00ff, 0x8007, 0xa105, 0x001e, 0x20a2, 0xd1ac, 0x0118, + 0x20a3, 0x0002, 0x0048, 0xd1b4, 0x0118, 0x20a3, 0x0001, 0x0020, + 0x20a3, 0x0000, 0x2230, 0x0010, 0x6a80, 0x6e7c, 0x20a9, 0x0008, + 0x0136, 0xad88, 0x0017, 0x2198, 0x20a1, 0x021b, 0x53a6, 0x013e, + 0x20a1, 0x020b, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, + 0x6014, 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0xb3f5, + 0x2003, 0x07d0, 0x2001, 0xb3f4, 0x2003, 0x0009, 0x080c, 0x17c3, + 0x014e, 0x015e, 0x00de, 0x0005, 0x20e1, 0x9080, 0x20e1, 0x4000, + 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, + 0x8217, 0x7818, 0xa080, 0x0028, 0x2004, 0x2019, 0xb134, 0x231c, + 0xd3ac, 0x1110, 0xd0bc, 0x0188, 0x00d6, 0xa0e8, 0xb235, 0x2d6c, + 0x6810, 0xa085, 0x0600, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xb11b, + 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0088, 0x00d6, 0xa0e8, 0xb235, + 0x2d6c, 0x6810, 0xa085, 0x0600, 0x20a2, 0x6814, 0x20a2, 0x00de, + 0x20a3, 0x0000, 0x2009, 0xb114, 0x210c, 0x21a2, 0x20a3, 0x0829, + 0x20a3, 0x0000, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x0005, 0x00d6, 0x0156, 0x0136, + 0x0146, 0x20a1, 0x020b, 0x00c1, 0x7810, 0x2068, 0x6860, 0x20a2, + 0x685c, 0x20a2, 0x6880, 0x20a2, 0x687c, 0x20a2, 0xa006, 0x20a2, + 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x000c, 0x080c, 0x7a79, 0x014e, + 0x013e, 0x015e, 0x00de, 0x0005, 0x0026, 0x20e1, 0x9080, 0x20e1, + 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0x2011, 0xb134, 0x2214, + 0xd2ac, 0x1110, 0xd0bc, 0x0188, 0x00d6, 0xa0e8, 0xb235, 0x2d6c, + 0x6810, 0xa085, 0x0500, 0x20a2, 0x6814, 0x20a2, 0x2069, 0xb11b, + 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0088, 0x00d6, 0xa0e8, 0xb235, + 0x2d6c, 0x6810, 0xa085, 0x0500, 0x20a2, 0x6814, 0x20a2, 0x00de, + 0x20a3, 0x0000, 0x2011, 0xb114, 0x2214, 0x22a2, 0x20a3, 0x0889, + 0x20a3, 0x0000, 0x080c, 0x7a68, 0x22a2, 0x20a3, 0x0000, 0x7a08, + 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x002e, 0x0005, + 0x00d6, 0x0156, 0x0136, 0x0146, 0x7810, 0xa0ec, 0xf000, 0x0168, + 0xa06d, 0x080c, 0x5173, 0x0148, 0x684c, 0xa084, 0x2020, 0xa086, + 0x2020, 0x1118, 0x7820, 0xc0cd, 0x7822, 0x20a1, 0x020b, 0x080c, + 0x7828, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810, + 0xa084, 0xf000, 0x1130, 0x7810, 0xa084, 0x0700, 0x8007, 0x0043, + 0x0010, 0xa006, 0x002b, 0x014e, 0x013e, 0x015e, 0x00de, 0x0005, + 0x770a, 0x779f, 0x77a8, 0x77d1, 0x77e4, 0x77ff, 0x7808, 0x7708, + 0x080c, 0x14fa, 0x0016, 0x0036, 0x694c, 0xa18c, 0x0003, 0x0118, + 0xa186, 0x0003, 0x1170, 0x6b78, 0x7820, 0xd0cc, 0x0108, 0xc3e5, + 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x003e, 0x001e, 0x0804, + 0x77db, 0xa186, 0x0001, 0x190c, 0x14fa, 0x6b78, 0x7820, 0xd0cc, + 0x0108, 0xc3e5, 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x22a2, + 0x6874, 0x20a2, 0x22a2, 0x687c, 0x20a2, 0x2009, 0x0018, 0xa384, + 0x0300, 0x0904, 0x7799, 0xd3c4, 0x0110, 0x687c, 0xa108, 0xd3cc, + 0x0110, 0x6874, 0xa108, 0x0156, 0x20a9, 0x000d, 0xad80, 0x0020, + 0x201c, 0x831f, 0x23a2, 0x8000, 0x1f04, 0x7748, 0x015e, 0x22a2, + 0x22a2, 0x22a2, 0xa184, 0x0003, 0x0904, 0x7799, 0x20a1, 0x020b, + 0x20e1, 0x9080, 0x20e1, 0x4000, 0x0006, 0x7818, 0xa080, 0x0028, + 0x2004, 0x2011, 0xb134, 0x2214, 0xd2ac, 0x1110, 0xd0bc, 0x0188, + 0x00d6, 0xa0e8, 0xb235, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, + 0x6814, 0x20a2, 0x2069, 0xb11b, 0x2da6, 0x8d68, 0x2da6, 0x00de, + 0x0088, 0x00d6, 0xa0e8, 0xb235, 0x2d6c, 0x6810, 0xa085, 0x0700, + 0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xb114, + 0x2214, 0x22a2, 0x000e, 0x7b20, 0xd3cc, 0x0118, 0x20a3, 0x0889, + 0x0010, 0x20a3, 0x0898, 0x20a2, 0x080c, 0x7a68, 0x22a2, 0x20a3, + 0x0000, 0x61c2, 0x003e, 0x001e, 0x080c, 0x7a79, 0x0005, 0x2011, + 0x0008, 0x7820, 0xd0cc, 0x0108, 0xc2e5, 0x22a2, 0xa016, 0x0488, + 0x2011, 0x0302, 0x7820, 0xd0cc, 0x0108, 0xc2e5, 0x22a2, 0xa016, + 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008, + 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500, + 0x22a2, 0x20a3, 0x000a, 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2, + 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0032, 0x080c, 0x7a79, + 0x0005, 0x2011, 0x0028, 0x7820, 0xd0cc, 0x0108, 0xc2e5, 0x22a2, + 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, + 0x0018, 0x080c, 0x7a79, 0x0005, 0x2011, 0x0100, 0x7820, 0xd0cc, + 0x0108, 0xc2e5, 0x22a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, + 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x7854, 0xa084, 0x00ff, 0x20a2, + 0x22a2, 0x22a2, 0x60c3, 0x0020, 0x080c, 0x7a79, 0x0005, 0x2011, + 0x0008, 0x7820, 0xd0cc, 0x0108, 0xc2e5, 0x22a2, 0xa016, 0x0888, + 0x0036, 0x7b10, 0xa384, 0xff00, 0x7812, 0xa384, 0x00ff, 0x8001, + 0x1138, 0x7820, 0xd0cc, 0x0108, 0xc2e5, 0x22a2, 0x003e, 0x0808, + 0x0046, 0x2021, 0x0800, 0x0006, 0x7820, 0xd0cc, 0x000e, 0x0108, + 0xc4e5, 0x24a2, 0x004e, 0x22a2, 0x20a2, 0x003e, 0x0804, 0x77db, + 0x0026, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, + 0x2004, 0x2011, 0xb134, 0x2214, 0xd2ac, 0x1110, 0xd0bc, 0x0188, + 0x00d6, 0xa0e8, 0xb235, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, + 0x6814, 0x20a2, 0x2069, 0xb11b, 0x2da6, 0x8d68, 0x2da6, 0x00de, + 0x0088, 0x00d6, 0xa0e8, 0xb235, 0x2d6c, 0x6810, 0xa085, 0x0700, + 0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xb114, + 0x2214, 0x22a2, 0x7820, 0xd0cc, 0x0118, 0x20a3, 0x0889, 0x0010, + 0x20a3, 0x0898, 0x20a3, 0x0000, 0x080c, 0x7a68, 0x22a2, 0x20a3, + 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x002e, 0x0005, 0x00d6, 0x0156, 0x0136, 0x0146, 0x0016, 0x0036, + 0x7810, 0xa084, 0x0700, 0x8007, 0x003b, 0x003e, 0x001e, 0x014e, + 0x013e, 0x015e, 0x00de, 0x0005, 0x788c, 0x788c, 0x788e, 0x788c, + 0x788c, 0x788c, 0x78b0, 0x788c, 0x080c, 0x14fa, 0x7910, 0xa18c, + 0xf8ff, 0xa18d, 0x0600, 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003, + 0x00f9, 0x00d6, 0x2069, 0xb152, 0x6804, 0xd0bc, 0x0130, 0x682c, + 0xa084, 0x00ff, 0x8007, 0x20a2, 0x0010, 0x20a3, 0x3f00, 0x00de, + 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x080c, 0x7a79, 0x0005, + 0x20a1, 0x020b, 0x2009, 0x0003, 0x0019, 0x20a3, 0x7f00, 0x0c80, + 0x0026, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, + 0x2004, 0x2011, 0xb134, 0x2214, 0xd2ac, 0x1110, 0xd0bc, 0x0188, + 0x00d6, 0xa0e8, 0xb235, 0x2d6c, 0x6810, 0xa085, 0x0100, 0x20a2, + 0x6814, 0x20a2, 0x2069, 0xb11b, 0x2da6, 0x8d68, 0x2da6, 0x00de, + 0x0088, 0x00d6, 0xa0e8, 0xb235, 0x2d6c, 0x6810, 0xa085, 0x0100, + 0x20a2, 0x6814, 0x20a2, 0x00de, 0x20a3, 0x0000, 0x2011, 0xb114, + 0x2214, 0x22a2, 0x20a3, 0x0888, 0xa18d, 0x0008, 0x21a2, 0x080c, + 0x7a68, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x002e, 0x0005, 0x00e6, 0x00d6, 0x00c6, + 0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0xb100, 0x7150, + 0x7818, 0x2068, 0x68a0, 0x2028, 0x76d0, 0xd6ac, 0x1130, 0xd0bc, + 0x1120, 0x6910, 0x6a14, 0x7450, 0x0020, 0x6910, 0x6a14, 0x736c, + 0x7470, 0x781c, 0xa0be, 0x0006, 0x0904, 0x79b3, 0xa0be, 0x000a, + 0x15e8, 0xa185, 0x0200, 0x6062, 0x6266, 0x636a, 0x646e, 0x6073, + 0x2029, 0x6077, 0x0000, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, + 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, + 0x7810, 0x2070, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, + 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000, + 0x609f, 0x0000, 0x080c, 0x8287, 0x2009, 0x07d0, 0x60c4, 0xa084, + 0xfff0, 0xa005, 0x0110, 0x2009, 0x1b58, 0x080c, 0x67bb, 0x003e, + 0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x70d0, 0xd0ac, + 0x1110, 0xd5bc, 0x0138, 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, + 0x646e, 0x0038, 0xa185, 0x0100, 0x6062, 0x6266, 0x606b, 0x0000, + 0x646e, 0x6073, 0x0809, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, + 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, + 0x7808, 0x6086, 0x7810, 0x2070, 0x7014, 0x608a, 0x7010, 0x608e, + 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60af, 0x95d5, + 0x60d7, 0x0000, 0xa582, 0x0080, 0x0248, 0x6a00, 0xd2f4, 0x0120, + 0x6a14, 0xa294, 0x00ff, 0x0010, 0x2011, 0x0000, 0x629e, 0x080c, + 0x8287, 0x2009, 0x07d0, 0x60c4, 0xa084, 0xfff0, 0xa005, 0x0110, + 0x2009, 0x1b58, 0x080c, 0x67bb, 0x003e, 0x004e, 0x005e, 0x00ce, + 0x00de, 0x00ee, 0x0005, 0x7810, 0x2070, 0x704c, 0xa084, 0x0003, + 0xa086, 0x0002, 0x0904, 0x7a09, 0x2001, 0xb134, 0x2004, 0xd0ac, + 0x1110, 0xd5bc, 0x0138, 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, + 0x646e, 0x0038, 0xa185, 0x0100, 0x6062, 0x6266, 0x606b, 0x0000, + 0x646e, 0x6073, 0x0880, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, + 0x00ff, 0x688e, 0x8007, 0x607a, 0x7834, 0x607e, 0x2f00, 0x6086, + 0x7808, 0x6082, 0x7060, 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6, + 0x707c, 0x60ca, 0x707c, 0x792c, 0xa108, 0x792e, 0x7080, 0x7928, + 0xa109, 0x792a, 0x686c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000, + 0xa582, 0x0080, 0x0248, 0x6a00, 0xd2f4, 0x0120, 0x6a14, 0xa294, + 0x00ff, 0x0010, 0x2011, 0x0000, 0x629e, 0x080c, 0x8284, 0x0804, + 0x79a1, 0x2001, 0xb134, 0x2004, 0xd0ac, 0x1110, 0xd5bc, 0x0138, + 0xa185, 0x0700, 0x6062, 0x6266, 0x636a, 0x646e, 0x0038, 0xa185, + 0x0700, 0x6062, 0x6266, 0x606b, 0x0000, 0x646e, 0x080c, 0x5173, + 0x0180, 0x00d6, 0x7810, 0xa06d, 0x684c, 0x00de, 0xa084, 0x2020, + 0xa086, 0x2020, 0x1130, 0x7820, 0xc0cd, 0x7822, 0x6073, 0x0889, + 0x0010, 0x6073, 0x0898, 0x6077, 0x0000, 0x688c, 0x8000, 0xa084, + 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, + 0x7808, 0x6082, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, + 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000, + 0xa582, 0x0080, 0x0248, 0x6a00, 0xd2f4, 0x0120, 0x6a14, 0xa294, + 0x00ff, 0x0010, 0x2011, 0x0000, 0x629e, 0x7820, 0xd0cc, 0x0120, + 0x080c, 0x8287, 0x0804, 0x79a1, 0x080c, 0x8284, 0x0804, 0x79a1, + 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, + 0x8217, 0x0005, 0x00d6, 0x2069, 0xb3d9, 0x6843, 0x0001, 0x00de, + 0x0005, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x0019, + 0x080c, 0x67ad, 0x0005, 0x0006, 0x6014, 0xa084, 0x0004, 0xa085, + 0x0009, 0x6016, 0x000e, 0x0005, 0x0006, 0x00c6, 0x2061, 0x0100, + 0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016, 0x00ce, 0x000e, + 0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061, 0x0100, 0x2069, + 0x0140, 0x080c, 0x58d5, 0x1198, 0x2001, 0xb3f5, 0x2004, 0xa005, + 0x15b8, 0x0066, 0x2031, 0x0001, 0x080c, 0x5957, 0x006e, 0x1118, + 0x080c, 0x67ad, 0x0468, 0x00c6, 0x2061, 0xb3d9, 0x00d8, 0x6904, + 0xa194, 0x4000, 0x0550, 0x0881, 0x6803, 0x1000, 0x6803, 0x0000, + 0x00c6, 0x2061, 0xb3d9, 0x6128, 0xa192, 0x00c8, 0x1258, 0x8108, + 0x612a, 0x6124, 0x00ce, 0x81ff, 0x0198, 0x080c, 0x67ad, 0x080c, + 0x7a83, 0x0070, 0x6124, 0xa1e5, 0x0000, 0x0140, 0x080c, 0xafee, + 0x2009, 0x0014, 0x080c, 0x831a, 0x080c, 0x67b6, 0x00ce, 0x0000, + 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001, 0xb3f5, 0x2004, + 0xa005, 0x1db0, 0x00c6, 0x2061, 0xb3d9, 0x6128, 0xa192, 0x0003, + 0x1e08, 0x8108, 0x612a, 0x00ce, 0x080c, 0x67ad, 0x080c, 0x4992, + 0x0c38, 0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x67c3, + 0x2071, 0xb3d9, 0x713c, 0x81ff, 0x0590, 0x2061, 0x0100, 0x2069, + 0x0140, 0x080c, 0x58d5, 0x11a8, 0x0036, 0x2019, 0x0002, 0x080c, + 0x7cc4, 0x003e, 0x713c, 0x2160, 0x080c, 0xafee, 0x2009, 0x004a, + 0x080c, 0x831a, 0x0066, 0x2031, 0x0001, 0x080c, 0x5957, 0x006e, + 0x00b0, 0x6904, 0xa194, 0x4000, 0x01c0, 0x6803, 0x1000, 0x6803, + 0x0000, 0x0036, 0x2019, 0x0001, 0x080c, 0x7cc4, 0x003e, 0x713c, + 0x2160, 0x080c, 0xafee, 0x2009, 0x004a, 0x080c, 0x831a, 0x002e, + 0x001e, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0c58, 0x00e6, 0x00d6, + 0x00c6, 0x0066, 0x0056, 0x0046, 0x0006, 0x0126, 0x2091, 0x8000, + 0x6018, 0x2068, 0x6ca0, 0x2071, 0xb3d9, 0x7018, 0x2068, 0x8dff, + 0x0198, 0x68a0, 0xa406, 0x0118, 0x6854, 0x2068, 0x0cc0, 0x6010, + 0x2060, 0x643c, 0x6540, 0x6648, 0x2d60, 0x080c, 0x4f8e, 0x0120, + 0x080c, 0x7dfb, 0xa085, 0x0001, 0x012e, 0x000e, 0x004e, 0x005e, + 0x006e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x20a1, 0x020b, 0x080c, + 0x7363, 0x20a3, 0x1200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x781c, + 0xa086, 0x0004, 0x1110, 0x6098, 0x0018, 0x2001, 0xb114, 0x2004, + 0x20a2, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x20a9, 0x0010, 0xa006, + 0x20a2, 0x1f04, 0x7b88, 0x20a2, 0x20a2, 0x60c3, 0x002c, 0x080c, + 0x7a79, 0x0005, 0x0156, 0x0146, 0x20a1, 0x020b, 0x080c, 0x7363, + 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, + 0x60c3, 0x0008, 0x080c, 0x7a79, 0x014e, 0x015e, 0x0005, 0x0156, + 0x0146, 0x20a1, 0x020b, 0x080c, 0x73ff, 0x20a3, 0x0200, 0x20a3, + 0x0000, 0x20a9, 0x0006, 0x2011, 0xb140, 0x2019, 0xb141, 0x23a6, + 0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x1f04, 0x7bb7, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x080c, 0x7a79, 0x014e, + 0x015e, 0x0005, 0x0156, 0x0146, 0x0016, 0x0026, 0x20a1, 0x020b, + 0x080c, 0x73d8, 0x080c, 0x73ee, 0x7810, 0xa080, 0x0000, 0x2004, + 0xa080, 0x0015, 0x2098, 0x7808, 0xa088, 0x0002, 0x21a8, 0x53a6, + 0xa080, 0x0004, 0x8003, 0x60c2, 0x080c, 0x7a79, 0x002e, 0x001e, + 0x014e, 0x015e, 0x0005, 0x0156, 0x0146, 0x20a1, 0x020b, 0x080c, + 0x7363, 0x20a3, 0x6200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, + 0x20a2, 0x60c3, 0x0008, 0x080c, 0x7a79, 0x014e, 0x015e, 0x0005, + 0x0156, 0x0146, 0x0016, 0x0026, 0x20a1, 0x020b, 0x080c, 0x7363, + 0x7810, 0xa080, 0x0000, 0x2004, 0xa080, 0x0017, 0x2098, 0x7808, + 0xa088, 0x0002, 0x21a8, 0x53a6, 0x8003, 0x60c2, 0x080c, 0x7a79, + 0x002e, 0x001e, 0x014e, 0x015e, 0x0005, 0x00e6, 0x00c6, 0x0006, + 0x0126, 0x2091, 0x8000, 0x2071, 0xb3d9, 0x700c, 0x2060, 0x8cff, + 0x0178, 0x080c, 0x9a66, 0x1110, 0x080c, 0x8890, 0x600c, 0x0006, + 0x080c, 0x9c2d, 0x080c, 0x82eb, 0x080c, 0x7dfb, 0x00ce, 0x0c78, + 0x700f, 0x0000, 0x700b, 0x0000, 0x012e, 0x000e, 0x00ce, 0x00ee, + 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0026, + 0x0016, 0x0006, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140, + 0x2071, 0xb3d9, 0x7024, 0x2060, 0x8cff, 0x05a0, 0x080c, 0x7a8c, + 0x68c3, 0x0000, 0x080c, 0x67b6, 0x2009, 0x0013, 0x080c, 0x831a, + 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0158, 0x6827, 0x0004, 0x7804, + 0xa084, 0x4000, 0x01a0, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, + 0xd084, 0x0118, 0x6827, 0x0001, 0x0010, 0x1f04, 0x7c62, 0x7804, + 0xa084, 0x1000, 0x0120, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, + 0x000e, 0x001e, 0x002e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, + 0x012e, 0x0005, 0x2001, 0xb100, 0x2004, 0xa096, 0x0001, 0x0550, + 0xa096, 0x0004, 0x0538, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011, + 0x494f, 0x080c, 0x6742, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0158, + 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x01a0, 0x7803, 0x1000, + 0x7803, 0x0000, 0x0078, 0xd084, 0x0118, 0x6827, 0x0001, 0x0010, + 0x1f04, 0x7c9d, 0x7804, 0xa084, 0x1000, 0x0120, 0x7803, 0x0100, + 0x7803, 0x0000, 0x000e, 0x001e, 0x002e, 0x00ce, 0x00de, 0x00ee, + 0x00fe, 0x015e, 0x012e, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, + 0x00d6, 0x00c6, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2069, + 0x0100, 0x2079, 0x0140, 0x2071, 0xb3d9, 0x703c, 0x2060, 0x8cff, + 0x0904, 0x7d48, 0x6814, 0xa084, 0x0002, 0x0904, 0x7d48, 0x68af, + 0x95f5, 0x6817, 0x0010, 0x2009, 0x00fa, 0x8109, 0x1df0, 0x68c7, + 0x0000, 0x68cb, 0x0008, 0x080c, 0x67c3, 0x080c, 0x2120, 0x0046, + 0x2009, 0x017f, 0x200b, 0x00a5, 0x2021, 0x0169, 0x2404, 0xa084, + 0x000f, 0xa086, 0x0004, 0x1500, 0x68af, 0x95f5, 0x68c7, 0x0000, + 0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0020, 0x2071, 0xb43a, + 0x6814, 0xa084, 0x0184, 0xa085, 0x0012, 0x6816, 0x7803, 0x0008, + 0x7003, 0x0000, 0x00fe, 0x00ee, 0xa386, 0x0002, 0x1128, 0x7884, + 0xa005, 0x1110, 0x7887, 0x0001, 0x2001, 0xb3b0, 0x2004, 0x200a, + 0x004e, 0xa39d, 0x0000, 0x1120, 0x2009, 0x0049, 0x080c, 0x831a, + 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0158, 0x6827, 0x0004, 0x7804, + 0xa084, 0x4000, 0x01a0, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, + 0xd08c, 0x0118, 0x6827, 0x0002, 0x0010, 0x1f04, 0x7d2a, 0x7804, + 0xa084, 0x1000, 0x0120, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, + 0x000e, 0x001e, 0x002e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, + 0x012e, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0xb3d9, + 0x6a06, 0x012e, 0x00de, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, + 0x2069, 0xb3d9, 0x6a32, 0x012e, 0x00de, 0x0005, 0x00f6, 0x00e6, + 0x00c6, 0x0066, 0x0006, 0x0126, 0x2071, 0xb3d9, 0x7614, 0x2660, + 0x2678, 0x2091, 0x8000, 0x8cff, 0x0538, 0x601c, 0xa206, 0x1500, + 0x7014, 0xac36, 0x1110, 0x660c, 0x7616, 0x7010, 0xac36, 0x1140, + 0x2c00, 0xaf36, 0x0118, 0x2f00, 0x7012, 0x0010, 0x7013, 0x0000, + 0x660c, 0x0066, 0x2c00, 0xaf06, 0x0110, 0x7e0e, 0x0008, 0x2678, + 0x600f, 0x0000, 0x080c, 0x9a2b, 0x080c, 0x7dfb, 0x00ce, 0x08d8, + 0x2c78, 0x600c, 0x2060, 0x08b8, 0x012e, 0x000e, 0x006e, 0x00ce, + 0x00ee, 0x00fe, 0x0005, 0x0156, 0x0146, 0x20a1, 0x020b, 0x080c, + 0x7624, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, + 0x20a3, 0x1000, 0x0804, 0x7df3, 0x0156, 0x0146, 0x20a1, 0x020b, + 0x080c, 0x7624, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, + 0x20a2, 0x20a3, 0x4000, 0x0478, 0x0156, 0x0146, 0x20a1, 0x020b, + 0x080c, 0x7624, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, + 0x20a2, 0x20a3, 0x2000, 0x00f8, 0x0156, 0x0146, 0x20a1, 0x020b, + 0x080c, 0x7624, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, + 0x20a2, 0x20a3, 0x0400, 0x0078, 0x0156, 0x0146, 0x20a1, 0x020b, + 0x080c, 0x7624, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, + 0x20a2, 0x20a3, 0x0200, 0x0089, 0x60c3, 0x0020, 0x080c, 0x7a79, + 0x014e, 0x015e, 0x0005, 0x00e6, 0x2071, 0xb3d9, 0x7020, 0xa005, + 0x0110, 0x8001, 0x7022, 0x00ee, 0x0005, 0x20a9, 0x0008, 0x20a2, + 0x1f04, 0x7e07, 0x20a2, 0x20a2, 0x0005, 0x00f6, 0x00e6, 0x00d6, + 0x00c6, 0x0076, 0x0066, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, + 0xb3d9, 0x7614, 0x2660, 0x2678, 0x2039, 0x0001, 0x87ff, 0x0904, + 0x7e97, 0x8cff, 0x0904, 0x7e97, 0x601c, 0xa086, 0x0006, 0x1904, + 0x7e92, 0x88ff, 0x0138, 0x2800, 0xac06, 0x1904, 0x7e92, 0x2039, + 0x0000, 0x0050, 0x6018, 0xa206, 0x1904, 0x7e92, 0x85ff, 0x0120, + 0x6050, 0xa106, 0x1904, 0x7e92, 0x7024, 0xac06, 0x1538, 0x2069, + 0x0100, 0x68c0, 0xa005, 0x01f0, 0x080c, 0x67b6, 0x6817, 0x0008, + 0x68c3, 0x0000, 0x080c, 0x7f1b, 0x7027, 0x0000, 0x0036, 0x2069, + 0x0140, 0x6b04, 0xa384, 0x1000, 0x0120, 0x6803, 0x0100, 0x6803, + 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, + 0x003e, 0x0020, 0x6003, 0x0009, 0x630a, 0x0460, 0x7014, 0xac36, + 0x1110, 0x660c, 0x7616, 0x7010, 0xac36, 0x1140, 0x2c00, 0xaf36, + 0x0118, 0x2f00, 0x7012, 0x0010, 0x7013, 0x0000, 0x660c, 0x0066, + 0x2c00, 0xaf06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x89ff, 0x1158, + 0x600f, 0x0000, 0x6010, 0x2068, 0x080c, 0x986a, 0x0110, 0x080c, + 0xac5f, 0x080c, 0x9a2b, 0x080c, 0x7dfb, 0x88ff, 0x1190, 0x00ce, + 0x0804, 0x7e1e, 0x2c78, 0x600c, 0x2060, 0x0804, 0x7e1e, 0xa006, + 0x012e, 0x000e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe, + 0x0005, 0x6017, 0x0000, 0x00ce, 0xa8c5, 0x0001, 0x0c88, 0x00f6, + 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, + 0x8000, 0x2071, 0xb3d9, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0904, + 0x7f0b, 0x601c, 0xa086, 0x0006, 0x1904, 0x7f06, 0x87ff, 0x0128, + 0x2700, 0xac06, 0x1904, 0x7f06, 0x0040, 0x6018, 0xa206, 0x15f0, + 0x85ff, 0x0118, 0x6050, 0xa106, 0x15c8, 0x703c, 0xac06, 0x1170, + 0x0036, 0x2019, 0x0001, 0x080c, 0x7cc4, 0x7033, 0x0000, 0x703f, + 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x003e, 0x7038, 0xac36, + 0x1110, 0x660c, 0x763a, 0x7034, 0xac36, 0x1140, 0x2c00, 0xaf36, + 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x0066, + 0x2c00, 0xaf06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, + 0x6010, 0x2068, 0x080c, 0x986a, 0x0110, 0x080c, 0xac5f, 0x080c, + 0x9a2b, 0x87ff, 0x1190, 0x00ce, 0x0804, 0x7eb6, 0x2c78, 0x600c, + 0x2060, 0x0804, 0x7eb6, 0xa006, 0x012e, 0x000e, 0x002e, 0x006e, + 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6017, 0x0000, 0x00ce, + 0xa7bd, 0x0001, 0x0c88, 0x00e6, 0x2071, 0xb3d9, 0x2001, 0xb100, + 0x2004, 0xa086, 0x0002, 0x1118, 0x7007, 0x0005, 0x0010, 0x7007, + 0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0026, + 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0xb3d9, 0x2c10, 0x7638, + 0x2660, 0x2678, 0x8cff, 0x0518, 0x2200, 0xac06, 0x11e0, 0x7038, + 0xac36, 0x1110, 0x660c, 0x763a, 0x7034, 0xac36, 0x1140, 0x2c00, + 0xaf36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c, + 0x2c00, 0xaf06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, + 0xa085, 0x0001, 0x0020, 0x2c78, 0x600c, 0x2060, 0x08d8, 0x012e, + 0x000e, 0x002e, 0x006e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00f6, + 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0006, 0x0126, 0x2091, 0x8000, + 0x2071, 0xb3d9, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0904, 0x7ff1, + 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x1904, 0x7fec, 0x7024, + 0xac06, 0x1508, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0904, 0x7fc8, + 0x080c, 0x7a8c, 0x68c3, 0x0000, 0x080c, 0x7f1b, 0x7027, 0x0000, + 0x0036, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0120, 0x6803, + 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, + 0x6827, 0x0001, 0x003e, 0x700c, 0xac36, 0x1110, 0x660c, 0x760e, + 0x7008, 0xac36, 0x1140, 0x2c00, 0xaf36, 0x0118, 0x2f00, 0x700a, + 0x0010, 0x700b, 0x0000, 0x660c, 0x0066, 0x2c00, 0xaf06, 0x0110, + 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0x9a55, 0x1158, + 0x080c, 0x2b99, 0x080c, 0x9a66, 0x11f0, 0x080c, 0x8890, 0x00d8, + 0x080c, 0x7f1b, 0x08c0, 0x080c, 0x9a66, 0x1118, 0x080c, 0x8890, + 0x0090, 0x6010, 0x2068, 0x080c, 0x986a, 0x0168, 0x601c, 0xa086, + 0x0003, 0x11f8, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, + 0x5271, 0x080c, 0x9a1f, 0x080c, 0x9c2d, 0x080c, 0x9a2b, 0x080c, + 0x7dfb, 0x00ce, 0x0804, 0x7f75, 0x2c78, 0x600c, 0x2060, 0x0804, + 0x7f75, 0x012e, 0x000e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, + 0x0005, 0x601c, 0xa086, 0x0006, 0x1d30, 0x080c, 0xac5f, 0x0c18, + 0x0036, 0x0156, 0x0136, 0x0146, 0x3908, 0xa006, 0xa190, 0x0020, + 0x221c, 0xa39e, 0x2990, 0x1118, 0x8210, 0x8000, 0x0cc8, 0xa005, + 0x0138, 0x20a9, 0x0020, 0x2198, 0xa110, 0x22a0, 0x22c8, 0x53a3, + 0x014e, 0x013e, 0x015e, 0x003e, 0x0005, 0x00d6, 0x20a1, 0x020b, + 0x080c, 0x73ff, 0x20a3, 0x0200, 0x20a3, 0x0014, 0x60c3, 0x0014, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x2099, 0xb3b8, 0x20a9, 0x0004, + 0x53a6, 0x20a3, 0x0004, 0x20a3, 0x7878, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x080c, 0x7a79, 0x00de, 0x0005, 0x20a1, 0x020b, 0x080c, + 0x73ff, 0x20a3, 0x0214, 0x20a3, 0x0018, 0x20a3, 0x0800, 0x7810, + 0xa084, 0xff00, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x7810, 0xa084, 0x00ff, 0x20a2, 0x7828, + 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0018, 0x080c, + 0x7a79, 0x0005, 0x00d6, 0x0016, 0x2f68, 0x2009, 0x0035, 0x080c, + 0x9d16, 0x1904, 0x80d0, 0x20a1, 0x020b, 0x080c, 0x7363, 0x20a3, + 0x1300, 0x20a3, 0x0000, 0x7828, 0x2068, 0x681c, 0xa086, 0x0003, + 0x0580, 0x7818, 0xa080, 0x0028, 0x2014, 0x2001, 0xb134, 0x2004, + 0xd0ac, 0x11d0, 0xa286, 0x007e, 0x1128, 0x20a3, 0x00ff, 0x20a3, + 0xfffe, 0x04b8, 0xa286, 0x007f, 0x1128, 0x20a3, 0x00ff, 0x20a3, + 0xfffd, 0x0478, 0xd2bc, 0x0180, 0xa286, 0x0080, 0x1128, 0x20a3, + 0x00ff, 0x20a3, 0xfffc, 0x0428, 0xa2e8, 0xb235, 0x2d6c, 0x6810, + 0x20a2, 0x6814, 0x20a2, 0x00e8, 0x20a3, 0x0000, 0x6098, 0x20a2, + 0x00c0, 0x2001, 0xb134, 0x2004, 0xd0ac, 0x1138, 0x7818, 0xa080, + 0x0028, 0x2004, 0xa082, 0x007e, 0x0240, 0x00d6, 0x2069, 0xb11b, + 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0020, 0x20a3, 0x0000, 0x6034, + 0x20a2, 0x7834, 0x20a2, 0x7838, 0x20a2, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x60c3, 0x000c, 0x080c, 0x7a79, 0x001e, 0x00de, 0x0005, + 0x7817, 0x0001, 0x7803, 0x0006, 0x001e, 0x00de, 0x0005, 0x00d6, + 0x0026, 0x7928, 0x2168, 0x691c, 0xa186, 0x0006, 0x01c0, 0xa186, + 0x0003, 0x0904, 0x8146, 0xa186, 0x0005, 0x0904, 0x812f, 0xa186, + 0x0004, 0x05b8, 0xa186, 0x0008, 0x0904, 0x8137, 0x7807, 0x0037, + 0x7813, 0x1700, 0x080c, 0x81ae, 0x002e, 0x00de, 0x0005, 0x080c, + 0x816a, 0x2009, 0x4000, 0x6800, 0x0002, 0x8110, 0x811b, 0x8112, + 0x811b, 0x8117, 0x8110, 0x8110, 0x811b, 0x811b, 0x811b, 0x811b, + 0x8110, 0x8110, 0x8110, 0x8110, 0x8110, 0x811b, 0x8110, 0x811b, + 0x080c, 0x14fa, 0x6820, 0xd0e4, 0x0110, 0xd0cc, 0x0110, 0xa00e, + 0x0010, 0x2009, 0x2000, 0x6828, 0x20a2, 0x682c, 0x20a2, 0x0804, + 0x8160, 0x080c, 0x816a, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x2009, + 0x4000, 0x6a00, 0xa286, 0x0002, 0x1108, 0xa00e, 0x0488, 0x04d1, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x2009, 0x4000, 0x0448, 0x0491, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x2009, 0x4000, 0xa286, 0x0005, + 0x0118, 0xa286, 0x0002, 0x1108, 0xa00e, 0x00d0, 0x0419, 0x6810, + 0x2068, 0x697c, 0x6810, 0xa112, 0x6980, 0x6814, 0xa103, 0x20a2, + 0x22a2, 0x7928, 0xa180, 0x0000, 0x2004, 0xa08e, 0x0002, 0x0130, + 0xa08e, 0x0004, 0x0118, 0x2009, 0x4000, 0x0010, 0x2009, 0x0000, + 0x21a2, 0x20a3, 0x0000, 0x60c3, 0x0018, 0x080c, 0x7a79, 0x002e, + 0x00de, 0x0005, 0x0036, 0x0046, 0x0056, 0x0066, 0x20a1, 0x020b, + 0x080c, 0x73ff, 0xa006, 0x20a3, 0x0200, 0x20a2, 0x7934, 0x21a2, + 0x7938, 0x21a2, 0x7818, 0xa080, 0x0028, 0x2004, 0x2011, 0xb134, + 0x2214, 0xd2ac, 0x1118, 0xa092, 0x007e, 0x0268, 0x00d6, 0x2069, + 0xb11b, 0x2d2c, 0x8d68, 0x2d34, 0xa0e8, 0xb235, 0x2d6c, 0x6b10, + 0x6c14, 0x00de, 0x0030, 0x2019, 0x0000, 0x6498, 0x2029, 0x0000, + 0x6634, 0x7828, 0xa080, 0x0007, 0x2004, 0xa086, 0x0003, 0x1128, + 0x25a2, 0x26a2, 0x23a2, 0x24a2, 0x0020, 0x23a2, 0x24a2, 0x25a2, + 0x26a2, 0x006e, 0x005e, 0x004e, 0x003e, 0x0005, 0x20a1, 0x020b, + 0x080c, 0x73ff, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0009, + 0x7810, 0x20a2, 0x60c3, 0x0008, 0x080c, 0x7a79, 0x0005, 0x20a1, + 0x020b, 0x080c, 0x735b, 0x20a3, 0x1400, 0x20a3, 0x0000, 0x7834, + 0x20a2, 0x7838, 0x20a2, 0x7828, 0x20a2, 0x782c, 0x20a2, 0x7830, + 0xa084, 0x00ff, 0x8007, 0x20a2, 0x20a3, 0x0000, 0x60c3, 0x0010, + 0x080c, 0x7a79, 0x0005, 0x20a1, 0x020b, 0x080c, 0x73f7, 0x20a3, + 0x0100, 0x20a3, 0x0000, 0x7828, 0x20a2, 0x7810, 0x20a2, 0x60c3, + 0x0008, 0x080c, 0x7a79, 0x0005, 0x0146, 0x20a1, 0x020b, 0x0031, + 0x60c3, 0x0000, 0x080c, 0x7a79, 0x014e, 0x0005, 0x20e1, 0x9080, + 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0x2011, 0xb134, + 0x2214, 0xd2ac, 0x1110, 0xd0bc, 0x0188, 0x00d6, 0xa0e8, 0xb235, + 0x2d6c, 0x6810, 0xa085, 0x0300, 0x20a2, 0x6814, 0x20a2, 0x2069, + 0xb11b, 0x2da6, 0x8d68, 0x2da6, 0x00de, 0x0078, 0x00d6, 0xa0e8, + 0xb235, 0x2d6c, 0x6810, 0xa085, 0x0300, 0x20a2, 0x6814, 0x20a2, + 0x00de, 0x20a3, 0x0000, 0x6234, 0x22a2, 0x20a3, 0x0819, 0x20a3, + 0x0000, 0x080c, 0x7a68, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x7a08, + 0x22a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x0005, 0x20a1, 0x020b, + 0x0079, 0x7910, 0x21a2, 0x20a3, 0x0000, 0x60c3, 0x0000, 0x20e1, + 0x9080, 0x60a7, 0x9575, 0x080c, 0x7a83, 0x080c, 0x67ad, 0x0005, + 0x0156, 0x0136, 0x0036, 0x00d6, 0x00e6, 0x20e1, 0x9080, 0x20e1, + 0x4000, 0x7854, 0x2068, 0xadf0, 0x000f, 0x7210, 0xa296, 0x00c0, + 0xa294, 0xfffd, 0x7212, 0x7214, 0xa294, 0x0300, 0x7216, 0x7100, + 0xa194, 0x00ff, 0x7308, 0xa384, 0x00ff, 0xa08d, 0xc200, 0x7102, + 0xa384, 0xff00, 0xa215, 0x720a, 0x7004, 0x720c, 0x700e, 0x7206, + 0x20a9, 0x000a, 0x2e98, 0x53a6, 0x60a3, 0x0035, 0x6a38, 0xa294, + 0x7000, 0xa286, 0x3000, 0x0110, 0x60a3, 0x0037, 0x00ee, 0x00de, + 0x003e, 0x013e, 0x015e, 0x0005, 0x2009, 0x0092, 0x0010, 0x2009, + 0x0096, 0x60ab, 0x0036, 0x6116, 0x0005, 0x2061, 0xb800, 0x2a70, + 0x7064, 0x7046, 0x704b, 0xb800, 0x0005, 0x00e6, 0x0126, 0x2071, + 0xb100, 0x2091, 0x8000, 0x7544, 0xa582, 0x0010, 0x0608, 0x7048, + 0x2060, 0x6000, 0xa086, 0x0000, 0x0148, 0xace0, 0x0018, 0x7058, + 0xac02, 0x1208, 0x0cb0, 0x2061, 0xb800, 0x0c98, 0x6003, 0x0008, + 0x8529, 0x7546, 0xaca8, 0x0018, 0x7058, 0xa502, 0x1230, 0x754a, + 0xa085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x704b, 0xb800, 0x0cc0, + 0xa006, 0x0cc0, 0x00e6, 0x2071, 0xb100, 0x7544, 0xa582, 0x0010, + 0x0600, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0148, 0xace0, + 0x0018, 0x7058, 0xac02, 0x1208, 0x0cb0, 0x2061, 0xb800, 0x0c98, + 0x6003, 0x0008, 0x8529, 0x7546, 0xaca8, 0x0018, 0x7058, 0xa502, + 0x1228, 0x754a, 0xa085, 0x0001, 0x00ee, 0x0005, 0x704b, 0xb800, + 0x0cc8, 0xa006, 0x0cc8, 0xac82, 0xb800, 0x0a0c, 0x14fa, 0x2001, + 0xb116, 0x2004, 0xac02, 0x1a0c, 0x14fa, 0xa006, 0x6006, 0x600a, + 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000, 0x6003, 0x0000, + 0x6052, 0x6056, 0x6022, 0x6026, 0x602a, 0x602e, 0x6032, 0x6036, + 0x603a, 0x603e, 0x2061, 0xb100, 0x6044, 0x8000, 0x6046, 0xa086, + 0x0001, 0x0108, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x6e9e, + 0x012e, 0x0cc0, 0x601c, 0xa084, 0x000f, 0x0002, 0x8329, 0x8338, + 0x8353, 0x836e, 0x9d43, 0x9d5e, 0x9d79, 0x8329, 0x8338, 0x8329, + 0x8389, 0xa186, 0x0013, 0x1128, 0x080c, 0x6dc1, 0x080c, 0x6e9e, + 0x0005, 0xa18e, 0x0047, 0x1118, 0xa016, 0x080c, 0x1828, 0x0005, + 0x0066, 0x6000, 0xa0b2, 0x0010, 0x1a0c, 0x14fa, 0x0013, 0x006e, + 0x0005, 0x8351, 0x8722, 0x88ca, 0x8351, 0x893f, 0x8442, 0x8351, + 0x8351, 0x86b4, 0x8d40, 0x8351, 0x8351, 0x8351, 0x8351, 0x8351, + 0x8351, 0x080c, 0x14fa, 0x0066, 0x6000, 0xa0b2, 0x0010, 0x1a0c, + 0x14fa, 0x0013, 0x006e, 0x0005, 0x836c, 0x935a, 0x836c, 0x836c, + 0x836c, 0x836c, 0x836c, 0x836c, 0x9305, 0x94c0, 0x836c, 0x9387, + 0x93fe, 0x9387, 0x93fe, 0x836c, 0x080c, 0x14fa, 0x0066, 0x6000, + 0xa0b2, 0x0010, 0x1a0c, 0x14fa, 0x0013, 0x006e, 0x0005, 0x8387, + 0x8d81, 0x8e47, 0x8f75, 0x90cf, 0x8387, 0x8387, 0x8387, 0x8d5b, + 0x92b5, 0x92b8, 0x8387, 0x8387, 0x8387, 0x8387, 0x92e2, 0x080c, + 0x14fa, 0x0066, 0x6000, 0xa0b2, 0x0010, 0x1a0c, 0x14fa, 0x0013, + 0x006e, 0x0005, 0x83a2, 0x83a2, 0x83a2, 0x83c5, 0x8418, 0x83a2, + 0x83a2, 0x83a2, 0x83a4, 0x83a2, 0x83a2, 0x83a2, 0x83a2, 0x83a2, + 0x83a2, 0x83a2, 0x080c, 0x14fa, 0xa186, 0x0003, 0x190c, 0x14fa, + 0x00d6, 0x6003, 0x0003, 0x6106, 0x6010, 0x2068, 0x684f, 0x0040, + 0x687c, 0x680a, 0x6880, 0x680e, 0x6813, 0x0000, 0x6817, 0x0000, + 0x00de, 0x2c10, 0x080c, 0x1ec4, 0x080c, 0x6a59, 0x0126, 0x2091, + 0x8000, 0x080c, 0x6f5b, 0x012e, 0x0005, 0xa182, 0x0047, 0x0002, + 0x83d1, 0x83d1, 0x83d3, 0x83f2, 0x83d1, 0x83d1, 0x83d1, 0x83d1, + 0x8404, 0x080c, 0x14fa, 0x00d6, 0x0016, 0x080c, 0x6e53, 0x080c, + 0x6f5b, 0x6003, 0x0004, 0x6110, 0x2168, 0x6854, 0x8003, 0x800b, + 0x810b, 0xa108, 0x6116, 0x684f, 0x0020, 0x685c, 0x685a, 0x6874, + 0x687e, 0x6878, 0x6882, 0x6897, 0x0000, 0x689b, 0x0000, 0x001e, + 0x00de, 0x0005, 0x080c, 0x6e53, 0x00d6, 0x6110, 0x2168, 0x080c, + 0x986a, 0x0120, 0x684b, 0x0006, 0x080c, 0x5271, 0x00de, 0x080c, + 0x82eb, 0x080c, 0x6f5b, 0x0005, 0x080c, 0x6e53, 0x080c, 0x2b73, + 0x00d6, 0x6110, 0x2168, 0x080c, 0x986a, 0x0120, 0x684b, 0x0029, + 0x080c, 0x5271, 0x00de, 0x080c, 0x82eb, 0x080c, 0x6f5b, 0x0005, + 0xa182, 0x0047, 0x0002, 0x8426, 0x8435, 0x8424, 0x8424, 0x8424, + 0x8424, 0x8424, 0x8424, 0x8424, 0x080c, 0x14fa, 0x00d6, 0x6010, + 0x2068, 0x684c, 0xc0f4, 0x684e, 0x00de, 0x20e1, 0x0005, 0x3d18, + 0x3e20, 0x2c10, 0x080c, 0x1828, 0x0005, 0x00d6, 0x6110, 0x2168, + 0x684b, 0x0000, 0x6853, 0x0000, 0x080c, 0x5271, 0x00de, 0x080c, + 0x82eb, 0x0005, 0xa1b6, 0x0015, 0x1118, 0x080c, 0x82eb, 0x0030, + 0xa1b6, 0x0016, 0x190c, 0x14fa, 0x080c, 0x82eb, 0x0005, 0x20a9, + 0x000e, 0x2e98, 0x6010, 0x20a0, 0x53a3, 0x20a9, 0x0006, 0x3310, + 0x3420, 0x9398, 0x94a0, 0x3318, 0x3428, 0x222e, 0x2326, 0xa290, + 0x0002, 0xa5a8, 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x1f04, + 0x845d, 0x00e6, 0x080c, 0x986a, 0x0130, 0x6010, 0x2070, 0x7007, + 0x0000, 0x7037, 0x0103, 0x00ee, 0x080c, 0x82eb, 0x0005, 0x00d6, + 0x0036, 0x7330, 0xa386, 0x0200, 0x1130, 0x6018, 0x2068, 0x6813, + 0x00ff, 0x6817, 0xfffd, 0x6010, 0xa005, 0x0130, 0x2068, 0x6807, + 0x0000, 0x6837, 0x0103, 0x6b32, 0x080c, 0x82eb, 0x003e, 0x00de, + 0x0005, 0x0016, 0x20a9, 0x002a, 0xae80, 0x000c, 0x2098, 0x6010, + 0xa080, 0x0002, 0x20a0, 0x53a3, 0x20a9, 0x002a, 0x6010, 0xa080, + 0x0001, 0x2004, 0xa080, 0x0002, 0x20a0, 0x53a3, 0x00e6, 0x6010, + 0x2004, 0x2070, 0x7037, 0x0103, 0x00ee, 0x080c, 0x82eb, 0x001e, + 0x0005, 0x0016, 0x2009, 0x0000, 0x7030, 0xa086, 0x0100, 0x0140, + 0x7038, 0xa084, 0x00ff, 0x808e, 0x703c, 0xa084, 0x00ff, 0x8086, + 0xa080, 0x0004, 0xa108, 0x21a8, 0xae80, 0x000c, 0x2098, 0x6010, + 0xa080, 0x0002, 0x20a0, 0x080c, 0x4a04, 0x00e6, 0x080c, 0x986a, + 0x0140, 0x6010, 0x2070, 0x7007, 0x0000, 0x7034, 0x70b2, 0x7037, + 0x0103, 0x00ee, 0x080c, 0x82eb, 0x001e, 0x0005, 0x00e6, 0x00d6, + 0x603f, 0x0000, 0x2c68, 0x0016, 0x2009, 0x0035, 0x080c, 0x9d16, + 0x001e, 0x1168, 0x0026, 0x6228, 0x2268, 0x002e, 0x2071, 0xb68c, + 0x6b1c, 0xa386, 0x0003, 0x0130, 0xa386, 0x0006, 0x0128, 0x080c, + 0x82eb, 0x0020, 0x0031, 0x0010, 0x080c, 0x85ba, 0x00de, 0x00ee, + 0x0005, 0x00f6, 0x6810, 0x2078, 0xa186, 0x0015, 0x0904, 0x85a3, + 0xa18e, 0x0016, 0x1904, 0x85b8, 0x700c, 0xa084, 0xff00, 0xa086, + 0x1700, 0x1904, 0x8582, 0x8fff, 0x1138, 0x6800, 0xa086, 0x000f, + 0x0904, 0x8566, 0x0804, 0x85b6, 0x6808, 0xa086, 0xffff, 0x1904, + 0x85a5, 0x784c, 0xa084, 0x0060, 0xa086, 0x0020, 0x1150, 0x797c, + 0x7810, 0xa106, 0x1904, 0x85a5, 0x7980, 0x7814, 0xa106, 0x1904, + 0x85a5, 0x080c, 0x9a1f, 0x6858, 0x7852, 0x784c, 0xc0dc, 0xc0f4, + 0xc0d4, 0x784e, 0x0026, 0xa00e, 0x6a14, 0x2001, 0x000a, 0x080c, + 0x68b3, 0x7854, 0xa20a, 0x0208, 0x8011, 0x7a56, 0x82ff, 0x002e, + 0x1138, 0x00c6, 0x2d60, 0x080c, 0x963b, 0x00ce, 0x0804, 0x85b6, + 0x00c6, 0x00d6, 0x2f68, 0x6838, 0xd0fc, 0x1118, 0x080c, 0x4ad9, + 0x0010, 0x080c, 0x4cc1, 0x00de, 0x00ce, 0x1904, 0x85a5, 0x00c6, + 0x2d60, 0x080c, 0x82eb, 0x00ce, 0x0804, 0x85b6, 0x00c6, 0x080c, + 0x9ae4, 0x0190, 0x6013, 0x0000, 0x6818, 0x601a, 0x080c, 0x9c35, + 0x601f, 0x0003, 0x6904, 0x00c6, 0x2d60, 0x080c, 0x82eb, 0x00ce, + 0x080c, 0x831a, 0x00ce, 0x04d0, 0x2001, 0xb3b7, 0x2004, 0x683e, + 0x00ce, 0x04a0, 0x7008, 0xa086, 0x000b, 0x11a0, 0x6018, 0x200c, + 0xc1bc, 0x2102, 0x00c6, 0x2d60, 0x7853, 0x0003, 0x6007, 0x0085, + 0x6003, 0x000b, 0x601f, 0x0002, 0x080c, 0x69f6, 0x080c, 0x6e9e, + 0x00ce, 0x00e0, 0x700c, 0xa086, 0x2a00, 0x1138, 0x2001, 0xb3b7, + 0x2004, 0x683e, 0x0098, 0x0471, 0x0098, 0x8fff, 0x090c, 0x14fa, + 0x00c6, 0x00d6, 0x2d60, 0x2f68, 0x684b, 0x0003, 0x080c, 0x952f, + 0x080c, 0x9a1f, 0x080c, 0x9a2b, 0x00de, 0x00ce, 0x080c, 0x82eb, + 0x00fe, 0x0005, 0xa186, 0x0015, 0x1128, 0x2001, 0xb3b7, 0x2004, + 0x683e, 0x0068, 0xa18e, 0x0016, 0x1160, 0x00c6, 0x2d00, 0x2060, + 0x080c, 0xaf00, 0x080c, 0x6866, 0x080c, 0x82eb, 0x00ce, 0x080c, + 0x82eb, 0x0005, 0x0026, 0x0036, 0x0046, 0x7228, 0x7c80, 0x7b7c, + 0xd2f4, 0x0130, 0x2001, 0xb3b7, 0x2004, 0x683e, 0x0804, 0x8634, + 0x00c6, 0x2d60, 0x080c, 0x954f, 0x00ce, 0x6804, 0xa086, 0x0050, + 0x1168, 0x00c6, 0x2d00, 0x2060, 0x6003, 0x0001, 0x6007, 0x0050, + 0x080c, 0x69f6, 0x080c, 0x6e9e, 0x00ce, 0x04f0, 0x6800, 0xa086, + 0x000f, 0x01c8, 0x8fff, 0x090c, 0x14fa, 0x6820, 0xd0dc, 0x1198, + 0x6800, 0xa086, 0x0004, 0x1198, 0x784c, 0xd0ac, 0x0180, 0x784c, + 0xc0dc, 0xc0f4, 0x784e, 0x7850, 0xc0f4, 0xc0fc, 0x7852, 0x2001, + 0x0001, 0x682e, 0x00e0, 0x2001, 0x0007, 0x682e, 0x00c0, 0x784c, + 0xd0b4, 0x1130, 0xd0ac, 0x0db8, 0x784c, 0xd0f4, 0x1da0, 0x0c38, + 0xd2ec, 0x1d88, 0x7024, 0xa306, 0x1118, 0x7020, 0xa406, 0x0d58, + 0x7020, 0x6836, 0x7024, 0x683a, 0x2001, 0x0005, 0x682e, 0x080c, + 0x9b71, 0x080c, 0x6e9e, 0x0010, 0x080c, 0x82eb, 0x004e, 0x003e, + 0x002e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x6034, 0x2068, 0x6a1c, + 0xa286, 0x0007, 0x0904, 0x8698, 0xa286, 0x0002, 0x0904, 0x8698, + 0xa286, 0x0000, 0x0904, 0x8698, 0x6808, 0x6338, 0xa306, 0x1904, + 0x8698, 0x2071, 0xb68c, 0xa186, 0x0015, 0x05e0, 0xa18e, 0x0016, + 0x1190, 0x6030, 0xa084, 0x00ff, 0xa086, 0x0001, 0x1160, 0x700c, + 0xa086, 0x2a00, 0x1140, 0x6034, 0xa080, 0x0008, 0x200c, 0xc1dd, + 0xc1f5, 0x2102, 0x0438, 0x00c6, 0x6034, 0x2060, 0x6104, 0xa186, + 0x004b, 0x01a0, 0xa186, 0x004c, 0x0188, 0xa186, 0x004d, 0x0170, + 0xa186, 0x004e, 0x0158, 0xa186, 0x0052, 0x0140, 0x6010, 0x2068, + 0x080c, 0x986a, 0x090c, 0x14fa, 0x6853, 0x0003, 0x6007, 0x0085, + 0x6003, 0x000b, 0x601f, 0x0002, 0x080c, 0x69f6, 0x080c, 0x6e9e, + 0x00ce, 0x0030, 0x6034, 0x2070, 0x2001, 0xb3b7, 0x2004, 0x703e, + 0x080c, 0x82eb, 0x002e, 0x00de, 0x00ee, 0x0005, 0x00d6, 0x20a9, + 0x000e, 0x2e98, 0x6010, 0x20a0, 0x53a3, 0xa1b6, 0x0015, 0x1148, + 0x6018, 0x2068, 0x7038, 0x680a, 0x703c, 0x680e, 0x6800, 0xc08d, + 0x6802, 0x00de, 0x0804, 0x8469, 0x2100, 0xa1b2, 0x0080, 0x1a0c, + 0x14fa, 0xa1b2, 0x0040, 0x1a04, 0x8718, 0x0002, 0x870c, 0x8700, + 0x870c, 0x870c, 0x870c, 0x870c, 0x86fe, 0x86fe, 0x86fe, 0x86fe, + 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, + 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, + 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x870c, 0x86fe, 0x870c, + 0x870c, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x870c, 0x86fe, + 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, + 0x870c, 0x870c, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, 0x86fe, + 0x86fe, 0x86fe, 0x86fe, 0x870c, 0x86fe, 0x86fe, 0x080c, 0x14fa, + 0x6003, 0x0001, 0x6106, 0x080c, 0x6a3c, 0x0126, 0x2091, 0x8000, + 0x080c, 0x6e9e, 0x012e, 0x0005, 0x6003, 0x0001, 0x6106, 0x080c, + 0x6a3c, 0x0126, 0x2091, 0x8000, 0x080c, 0x6e9e, 0x012e, 0x0005, + 0x2600, 0x0002, 0x870c, 0x870c, 0x8720, 0x870c, 0x870c, 0x8720, + 0x080c, 0x14fa, 0x6004, 0xa0b2, 0x0080, 0x1a0c, 0x14fa, 0xa1b6, + 0x0013, 0x0904, 0x87c2, 0xa1b6, 0x0027, 0x1904, 0x8788, 0x080c, + 0x6dc1, 0x6004, 0x080c, 0x9a55, 0x0188, 0x080c, 0x9a66, 0x0904, + 0x8782, 0xa08e, 0x0021, 0x0904, 0x8785, 0xa08e, 0x0022, 0x0904, + 0x8782, 0xa08e, 0x003d, 0x0904, 0x8785, 0x04a8, 0x080c, 0x2b99, + 0x2001, 0x0007, 0x080c, 0x4d75, 0x6018, 0xa080, 0x0028, 0x200c, + 0x080c, 0x8890, 0xa186, 0x007e, 0x1148, 0x2001, 0xb134, 0x2014, + 0xc285, 0x080c, 0x58d5, 0x1108, 0xc2ad, 0x2202, 0x0016, 0x0026, + 0x0036, 0x2110, 0x2019, 0x0028, 0x080c, 0x6b35, 0x0076, 0x2039, + 0x0000, 0x080c, 0x6a6b, 0x00c6, 0x6018, 0xa065, 0x0110, 0x080c, + 0x501c, 0x00ce, 0x2c08, 0x080c, 0xaa51, 0x007e, 0x003e, 0x002e, + 0x001e, 0x080c, 0x4de4, 0x080c, 0x9c2d, 0x080c, 0x82eb, 0x080c, + 0x6e9e, 0x0005, 0x080c, 0x8890, 0x0cb0, 0x080c, 0x88be, 0x0c98, + 0xa186, 0x0014, 0x1db0, 0x080c, 0x6dc1, 0x080c, 0x2b73, 0x080c, + 0x9a55, 0x1188, 0x080c, 0x2b99, 0x6018, 0xa080, 0x0028, 0x200c, + 0x080c, 0x8890, 0xa186, 0x007e, 0x1128, 0x2001, 0xb134, 0x200c, + 0xc185, 0x2102, 0x08c0, 0x080c, 0x9a66, 0x1118, 0x080c, 0x8890, + 0x0890, 0x6004, 0xa08e, 0x0032, 0x1158, 0x00e6, 0x00f6, 0x2071, + 0xb182, 0x2079, 0x0000, 0x080c, 0x2e97, 0x00fe, 0x00ee, 0x0818, + 0x6004, 0xa08e, 0x0021, 0x0d50, 0xa08e, 0x0022, 0x090c, 0x8890, + 0x0804, 0x877b, 0xa0b2, 0x0040, 0x1a04, 0x8885, 0x2008, 0x0002, + 0x880a, 0x880b, 0x880e, 0x8811, 0x8814, 0x8817, 0x8808, 0x8808, + 0x8808, 0x8808, 0x8808, 0x8808, 0x8808, 0x8808, 0x8808, 0x8808, + 0x8808, 0x8808, 0x8808, 0x8808, 0x8808, 0x8808, 0x8808, 0x8808, + 0x8808, 0x8808, 0x8808, 0x8808, 0x8808, 0x8808, 0x881a, 0x8829, + 0x8808, 0x882b, 0x8829, 0x8808, 0x8808, 0x8808, 0x8808, 0x8808, + 0x8829, 0x8829, 0x8808, 0x8808, 0x8808, 0x8808, 0x8808, 0x8808, + 0x8808, 0x8808, 0x8865, 0x8829, 0x8808, 0x8825, 0x8808, 0x8808, + 0x8808, 0x8826, 0x8808, 0x8808, 0x8808, 0x8829, 0x885c, 0x8808, + 0x080c, 0x14fa, 0x00f0, 0x2001, 0x000b, 0x0460, 0x2001, 0x0003, + 0x0448, 0x2001, 0x0005, 0x0430, 0x2001, 0x0001, 0x0418, 0x2001, + 0x0009, 0x0400, 0x080c, 0x6dc1, 0x6003, 0x0005, 0x2001, 0xb3b7, + 0x2004, 0x603e, 0x080c, 0x6e9e, 0x00a0, 0x0018, 0x0010, 0x080c, + 0x4d75, 0x0804, 0x8876, 0x080c, 0x6dc1, 0x2001, 0xb3b5, 0x2004, + 0x6016, 0x2001, 0xb3b7, 0x2004, 0x603e, 0x6003, 0x0004, 0x080c, + 0x6e9e, 0x0005, 0x080c, 0x4d75, 0x080c, 0x6dc1, 0x6003, 0x0002, + 0x2001, 0xb3b7, 0x2004, 0x603e, 0x0036, 0x2019, 0xb15d, 0x2304, + 0xa084, 0xff00, 0x1120, 0x2001, 0xb3b5, 0x201c, 0x0040, 0x8007, + 0xa09a, 0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, + 0x003e, 0x080c, 0x6e9e, 0x08e8, 0x080c, 0x6dc1, 0x080c, 0x9c2d, + 0x080c, 0x82eb, 0x080c, 0x6e9e, 0x08a0, 0x00e6, 0x00f6, 0x2071, + 0xb182, 0x2079, 0x0000, 0x080c, 0x2e97, 0x00fe, 0x00ee, 0x080c, + 0x6dc1, 0x080c, 0x82eb, 0x080c, 0x6e9e, 0x0818, 0x080c, 0x6dc1, + 0x2001, 0xb3b7, 0x2004, 0x603e, 0x6003, 0x0002, 0x2001, 0xb3b5, + 0x2004, 0x6016, 0x080c, 0x6e9e, 0x0005, 0x2600, 0x2008, 0x0002, + 0x888e, 0x888e, 0x888e, 0x8876, 0x8876, 0x888e, 0x080c, 0x14fa, + 0x00e6, 0x0026, 0x0016, 0x080c, 0x986a, 0x0508, 0x6010, 0x2070, + 0x7034, 0xa086, 0x0139, 0x1148, 0x2001, 0x0030, 0x2009, 0x0000, + 0x2011, 0x4005, 0x080c, 0x9ce4, 0x0090, 0x7038, 0xd0fc, 0x0178, + 0x7007, 0x0000, 0x0016, 0x6004, 0xa08e, 0x0021, 0x0160, 0xa08e, + 0x003d, 0x0148, 0x001e, 0x7037, 0x0103, 0x7033, 0x0100, 0x001e, + 0x002e, 0x00ee, 0x0005, 0x001e, 0x0009, 0x0cc8, 0x00e6, 0xacf0, + 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103, 0x7023, 0x8001, + 0x00ee, 0x0005, 0x00d6, 0x6618, 0x2668, 0x6804, 0xa084, 0x00ff, + 0x00de, 0xa0b2, 0x000c, 0x1a0c, 0x14fa, 0x6604, 0xa6b6, 0x0043, + 0x1120, 0x080c, 0x9ca0, 0x0804, 0x892f, 0x6604, 0xa6b6, 0x0033, + 0x1120, 0x080c, 0x9c50, 0x0804, 0x892f, 0x6604, 0xa6b6, 0x0028, + 0x1120, 0x080c, 0x9a96, 0x0804, 0x892f, 0x6604, 0xa6b6, 0x0029, + 0x1118, 0x080c, 0x9aad, 0x04d8, 0x6604, 0xa6b6, 0x001f, 0x1118, + 0x080c, 0x844f, 0x04a0, 0x6604, 0xa6b6, 0x0000, 0x1118, 0x080c, + 0x869e, 0x0468, 0x6604, 0xa6b6, 0x0022, 0x1118, 0x080c, 0x8477, + 0x0430, 0x6604, 0xa6b6, 0x0035, 0x1118, 0x080c, 0x84de, 0x00f8, + 0x6604, 0xa6b6, 0x0039, 0x1118, 0x080c, 0x863a, 0x00c0, 0x6604, + 0xa6b6, 0x003d, 0x1118, 0x080c, 0x8491, 0x0088, 0x6604, 0xa6b6, + 0x0044, 0x1118, 0x080c, 0x84b1, 0x0050, 0xa1b6, 0x0015, 0x1110, + 0x0053, 0x0028, 0xa1b6, 0x0016, 0x1118, 0x0804, 0x8aeb, 0x0005, + 0x080c, 0x8331, 0x0ce0, 0x8956, 0x8959, 0x8956, 0x899b, 0x8956, + 0x8a78, 0x8af9, 0x8956, 0x8956, 0x8ac7, 0x8956, 0x8adb, 0xa1b6, + 0x0048, 0x0140, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x080c, + 0x1828, 0x0005, 0x00e6, 0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070, + 0x7037, 0x0103, 0x00ee, 0x080c, 0x82eb, 0x0005, 0xe000, 0xe000, + 0x0005, 0x00e6, 0x2071, 0xb100, 0x7080, 0xa086, 0x0074, 0x1530, + 0x080c, 0xaa28, 0x11b0, 0x00d6, 0x6018, 0x2068, 0x7030, 0xd08c, + 0x0128, 0x6800, 0xd0bc, 0x0110, 0xc0c5, 0x6802, 0x00d9, 0x00de, + 0x2001, 0x0006, 0x080c, 0x4d75, 0x080c, 0x2b99, 0x080c, 0x82eb, + 0x0078, 0x2001, 0x000a, 0x080c, 0x4d75, 0x080c, 0x2b99, 0x6003, + 0x0001, 0x6007, 0x0001, 0x080c, 0x6a3c, 0x0010, 0x080c, 0x8a69, + 0x00ee, 0x0005, 0x6800, 0xd084, 0x0168, 0x2001, 0x0000, 0x080c, + 0x4d63, 0x2069, 0xb152, 0x6804, 0xd0a4, 0x0120, 0x2001, 0x0006, + 0x080c, 0x4da2, 0x0005, 0x00d6, 0x2011, 0xb120, 0x2204, 0xa086, + 0x0074, 0x1904, 0x8a66, 0x6018, 0x2068, 0x6aa0, 0xa286, 0x007e, + 0x1120, 0x080c, 0x8bf7, 0x0804, 0x8a09, 0x080c, 0x8bed, 0x6018, + 0x2068, 0xa080, 0x0028, 0x2014, 0xa286, 0x0080, 0x11c0, 0x6813, + 0x00ff, 0x6817, 0xfffc, 0x6010, 0xa005, 0x0138, 0x2068, 0x6807, + 0x0000, 0x6837, 0x0103, 0x6833, 0x0200, 0x2001, 0x0006, 0x080c, + 0x4d75, 0x080c, 0x2b99, 0x080c, 0x82eb, 0x0804, 0x8a67, 0x00e6, + 0x2071, 0xb134, 0x2e04, 0xd09c, 0x0188, 0x2071, 0xb680, 0x7108, + 0x720c, 0xa18c, 0x00ff, 0x1118, 0xa284, 0xff00, 0x0138, 0x6018, + 0x2070, 0x70a0, 0xd0bc, 0x1110, 0x7112, 0x7216, 0x00ee, 0x6010, + 0xa005, 0x0198, 0x2068, 0x6838, 0xd0f4, 0x0178, 0x6834, 0xa084, + 0x00ff, 0xa086, 0x0039, 0x1958, 0x2001, 0x0000, 0x2009, 0x0000, + 0x2011, 0x4000, 0x080c, 0x9ce4, 0x0840, 0x2001, 0x0004, 0x080c, + 0x4d75, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x6a3c, 0x0804, + 0x8a67, 0x685c, 0xd0e4, 0x01d8, 0x080c, 0x9be0, 0x080c, 0x58d5, + 0x0118, 0xd0dc, 0x1904, 0x89c5, 0x2011, 0xb134, 0x2204, 0xc0ad, + 0x2012, 0x2001, 0xb38f, 0x2004, 0x00f6, 0x2079, 0x0100, 0x78e3, + 0x0000, 0x080c, 0x274b, 0x78e2, 0x00fe, 0x0804, 0x89c5, 0x080c, + 0x9c16, 0x2011, 0xb134, 0x2204, 0xc0a5, 0x2012, 0x0006, 0x080c, + 0xab41, 0x000e, 0x1904, 0x89c5, 0xc0b5, 0x2012, 0x2001, 0x0000, + 0x080c, 0x4d63, 0x00c6, 0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100, + 0x79ea, 0x7932, 0x7936, 0x00fe, 0x080c, 0x2720, 0x00f6, 0x2079, + 0xb100, 0x7972, 0x2100, 0x2009, 0x0000, 0x080c, 0x26f6, 0x794e, + 0x00fe, 0x8108, 0x080c, 0x4dc5, 0x2c00, 0x00ce, 0x1904, 0x89c5, + 0x601a, 0x2001, 0x0002, 0x080c, 0x4d75, 0x601f, 0x0001, 0x6003, + 0x0001, 0x6007, 0x0002, 0x080c, 0x6a3c, 0x0008, 0x0011, 0x00de, + 0x0005, 0x2001, 0xb100, 0x2004, 0xa086, 0x0003, 0x0120, 0x2001, + 0x0007, 0x080c, 0x4d75, 0x080c, 0x2b99, 0x080c, 0x82eb, 0x0005, + 0x00e6, 0x0026, 0x0016, 0x2071, 0xb100, 0x7080, 0xa086, 0x0014, + 0x15f0, 0x7000, 0xa086, 0x0003, 0x1128, 0x6010, 0xa005, 0x1110, + 0x080c, 0x3dcd, 0x00d6, 0x6018, 0x2068, 0x080c, 0x4ebf, 0x080c, + 0x898a, 0x00de, 0x080c, 0x8ca6, 0x1550, 0x00d6, 0x6018, 0x2068, + 0x6890, 0x00de, 0xa005, 0x0518, 0x2001, 0x0006, 0x080c, 0x4d75, + 0x00e6, 0x6010, 0xa075, 0x01a8, 0x7034, 0xa084, 0x00ff, 0xa086, + 0x0039, 0x1148, 0x2001, 0x0000, 0x2009, 0x0000, 0x2011, 0x4000, + 0x080c, 0x9ce4, 0x0030, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, + 0x0200, 0x00ee, 0x080c, 0x2b99, 0x080c, 0x82eb, 0x0020, 0x080c, + 0x8890, 0x080c, 0x8a69, 0x001e, 0x002e, 0x00ee, 0x0005, 0x2011, + 0xb120, 0x2204, 0xa086, 0x0014, 0x1158, 0x2001, 0x0002, 0x080c, + 0x4d75, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x6a3c, 0x0010, + 0x080c, 0x8a69, 0x0005, 0x2011, 0xb120, 0x2204, 0xa086, 0x0004, + 0x1138, 0x2001, 0x0007, 0x080c, 0x4d75, 0x080c, 0x82eb, 0x0010, + 0x080c, 0x8a69, 0x0005, 0x000b, 0x0005, 0x8956, 0x8b00, 0x8956, + 0x8b34, 0x8956, 0x8ba9, 0x8af9, 0x8956, 0x8956, 0x8bbc, 0x8956, + 0x8bcc, 0x6604, 0xa6b6, 0x001e, 0x1110, 0x080c, 0x82eb, 0x0005, + 0x00d6, 0x00c6, 0x080c, 0x8bdc, 0x1178, 0x2001, 0x0000, 0x080c, + 0x4d63, 0x2001, 0x0002, 0x080c, 0x4d75, 0x6003, 0x0001, 0x6007, + 0x0002, 0x080c, 0x6a3c, 0x00e8, 0x2009, 0xb68e, 0x2104, 0xa086, + 0x0009, 0x1160, 0x6018, 0x2068, 0x6840, 0xa084, 0x00ff, 0xa005, + 0x0170, 0x8001, 0x6842, 0x6017, 0x000a, 0x0058, 0x2009, 0xb68f, + 0x2104, 0xa084, 0xff00, 0xa086, 0x1900, 0x1108, 0x08d0, 0x080c, + 0x8a69, 0x00ce, 0x00de, 0x0005, 0x080c, 0x8bea, 0x00d6, 0x2069, + 0xb39e, 0x2d04, 0xa005, 0x0168, 0x6018, 0x2068, 0x68a0, 0xa086, + 0x007e, 0x1138, 0x2069, 0xb11c, 0x2d04, 0x8000, 0x206a, 0x00de, + 0x0010, 0x00de, 0x0078, 0x2001, 0x0000, 0x080c, 0x4d63, 0x2001, + 0x0002, 0x080c, 0x4d75, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, + 0x6a3c, 0x0428, 0x080c, 0x8890, 0x2009, 0xb68e, 0x2134, 0xa6b4, + 0x00ff, 0xa686, 0x0005, 0x01e0, 0xa686, 0x000b, 0x01b0, 0x2009, + 0xb68f, 0x2104, 0xa084, 0xff00, 0x1118, 0xa686, 0x0009, 0x0180, + 0xa086, 0x1900, 0x1150, 0xa686, 0x0009, 0x0150, 0x2001, 0x0004, + 0x080c, 0x4d75, 0x080c, 0x82eb, 0x0010, 0x080c, 0x8a69, 0x0005, + 0x00d6, 0x6010, 0x2068, 0x080c, 0x986a, 0x0128, 0x6838, 0xd0fc, + 0x0110, 0x00de, 0x0c90, 0x6018, 0x2068, 0x6840, 0xa084, 0x00ff, + 0xa005, 0x0140, 0x8001, 0x6842, 0x6017, 0x000a, 0x6007, 0x0016, + 0x00de, 0x0c28, 0x68a0, 0xa086, 0x007e, 0x1138, 0x00e6, 0x2071, + 0xb100, 0x080c, 0x4a3b, 0x00ee, 0x0010, 0x080c, 0x2b73, 0x00de, + 0x08a0, 0x080c, 0x8bea, 0x1158, 0x2001, 0x0004, 0x080c, 0x4d75, + 0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x6a3c, 0x0020, 0x080c, + 0x8890, 0x080c, 0x8a69, 0x0005, 0x0469, 0x1158, 0x2001, 0x0008, + 0x080c, 0x4d75, 0x6003, 0x0001, 0x6007, 0x0005, 0x080c, 0x6a3c, + 0x0010, 0x080c, 0x8a69, 0x0005, 0x00e9, 0x1158, 0x2001, 0x000a, + 0x080c, 0x4d75, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x6a3c, + 0x0010, 0x080c, 0x8a69, 0x0005, 0x2009, 0xb68e, 0x2104, 0xa086, + 0x0003, 0x1138, 0x2009, 0xb68f, 0x2104, 0xa084, 0xff00, 0xa086, + 0x2a00, 0x0005, 0xa085, 0x0001, 0x0005, 0x00c6, 0x0016, 0xac88, + 0x0006, 0x2164, 0x080c, 0x4e30, 0x001e, 0x00ce, 0x0005, 0x00f6, + 0x00e6, 0x00d6, 0x0036, 0x0016, 0x6018, 0x2068, 0x2071, 0xb134, + 0x2e04, 0xa085, 0x0003, 0x2072, 0x080c, 0x8c7b, 0x0560, 0x2009, + 0xb134, 0x2104, 0xc0cd, 0x200a, 0x2001, 0xb153, 0x2004, 0xd0a4, + 0x0158, 0xa006, 0x2020, 0x2009, 0x002a, 0x080c, 0xacae, 0x2001, + 0xb10c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009, 0x0001, + 0x080c, 0x2b46, 0x2071, 0xb100, 0x080c, 0x2991, 0x00c6, 0x0156, + 0x20a9, 0x0081, 0x2009, 0x007f, 0x080c, 0x2c6e, 0x8108, 0x1f04, + 0x8c2c, 0x015e, 0x00ce, 0x080c, 0x8bed, 0x6813, 0x00ff, 0x6817, + 0xfffe, 0x2071, 0xb680, 0x2079, 0x0100, 0x2e04, 0xa084, 0x00ff, + 0x2069, 0xb11b, 0x206a, 0x78e6, 0x0006, 0x8e70, 0x2e04, 0x2069, + 0xb11c, 0x206a, 0x78ea, 0x7832, 0x7836, 0x2010, 0xa084, 0xff00, + 0x001e, 0xa105, 0x2009, 0xb127, 0x200a, 0x2200, 0xa084, 0x00ff, + 0x2008, 0x080c, 0x2720, 0x080c, 0x58d5, 0x0170, 0x2069, 0xb68e, + 0x2071, 0xb3b1, 0x6810, 0x2072, 0x6814, 0x7006, 0x6818, 0x700a, + 0x681c, 0x700e, 0x080c, 0x9be0, 0x0040, 0x2001, 0x0006, 0x080c, + 0x4d75, 0x080c, 0x2b99, 0x080c, 0x82eb, 0x001e, 0x003e, 0x00de, + 0x00ee, 0x00fe, 0x0005, 0x0026, 0x0036, 0x00e6, 0x0156, 0x2019, + 0xb127, 0x231c, 0x83ff, 0x01e8, 0x2071, 0xb680, 0x2e14, 0xa294, + 0x00ff, 0x7004, 0xa084, 0xff00, 0xa205, 0xa306, 0x1190, 0x2011, + 0xb696, 0xad98, 0x000a, 0x20a9, 0x0004, 0x080c, 0x8d2b, 0x1148, + 0x2011, 0xb69a, 0xad98, 0x0006, 0x20a9, 0x0004, 0x080c, 0x8d2b, + 0x1100, 0x015e, 0x00ee, 0x003e, 0x002e, 0x0005, 0x00e6, 0x2071, + 0xb68c, 0x7004, 0xa086, 0x0014, 0x11a8, 0x7008, 0xa086, 0x0800, + 0x1188, 0x700c, 0xd0ec, 0x0160, 0xa084, 0x0f00, 0xa086, 0x0100, + 0x1138, 0x7024, 0xd0a4, 0x1110, 0xd0ac, 0x0110, 0xa006, 0x0010, + 0xa085, 0x0001, 0x00ee, 0x0005, 0x00e6, 0x00d6, 0x00c6, 0x0076, + 0x0056, 0x0046, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2029, + 0xb3e2, 0x252c, 0x2021, 0xb3e8, 0x2424, 0x2061, 0xb800, 0x2071, + 0xb100, 0x7244, 0x7064, 0xa202, 0x16f0, 0x080c, 0xacd6, 0x05a0, + 0x671c, 0xa786, 0x0001, 0x0580, 0xa786, 0x0007, 0x0568, 0x2500, + 0xac06, 0x0550, 0x2400, 0xac06, 0x0538, 0x00c6, 0x6000, 0xa086, + 0x0004, 0x1110, 0x080c, 0x190f, 0xa786, 0x0008, 0x1148, 0x080c, + 0x9a66, 0x1130, 0x00ce, 0x080c, 0x8890, 0x080c, 0x9a2b, 0x00a0, + 0x6010, 0x2068, 0x080c, 0x986a, 0x0160, 0xa786, 0x0003, 0x11e8, + 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, 0x5271, 0x080c, + 0x9a1f, 0x080c, 0x9a2b, 0x00ce, 0xace0, 0x0018, 0x7058, 0xac02, + 0x1210, 0x0804, 0x8cd9, 0x012e, 0x000e, 0x002e, 0x004e, 0x005e, + 0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0xa786, 0x0006, 0x1d00, + 0x080c, 0xac5f, 0x0c30, 0x220c, 0x2304, 0xa106, 0x1130, 0x8210, + 0x8318, 0x1f04, 0x8d2b, 0xa006, 0x0005, 0x2304, 0xa102, 0x0218, + 0x2001, 0x0001, 0x0010, 0x2001, 0x0000, 0xa18d, 0x0001, 0x0005, + 0x6004, 0xa08a, 0x0080, 0x1a0c, 0x14fa, 0x080c, 0x9a55, 0x0120, + 0x080c, 0x9a66, 0x0168, 0x0028, 0x080c, 0x2b99, 0x080c, 0x9a66, + 0x0138, 0x080c, 0x6dc1, 0x080c, 0x82eb, 0x080c, 0x6e9e, 0x0005, + 0x080c, 0x8890, 0x0cb0, 0xa182, 0x0040, 0x0002, 0x8d71, 0x8d71, + 0x8d71, 0x8d71, 0x8d71, 0x8d71, 0x8d71, 0x8d71, 0x8d71, 0x8d71, + 0x8d71, 0x8d73, 0x8d73, 0x8d73, 0x8d73, 0x8d71, 0x8d71, 0x8d71, + 0x8d73, 0x080c, 0x14fa, 0x600b, 0xffff, 0x6003, 0x0001, 0x6106, + 0x080c, 0x69f6, 0x0126, 0x2091, 0x8000, 0x080c, 0x6e9e, 0x012e, + 0x0005, 0xa186, 0x0013, 0x1128, 0x6004, 0xa082, 0x0040, 0x0804, + 0x8e0d, 0xa186, 0x0027, 0x11e8, 0x080c, 0x6dc1, 0x080c, 0x2b73, + 0x00d6, 0x6110, 0x2168, 0x080c, 0x986a, 0x0168, 0x6837, 0x0103, + 0x684b, 0x0029, 0x6847, 0x0000, 0x694c, 0xc1c5, 0x694e, 0x080c, + 0x5271, 0x080c, 0x9a1f, 0x00de, 0x080c, 0x82eb, 0x080c, 0x6e9e, + 0x0005, 0xa186, 0x0014, 0x1120, 0x6004, 0xa082, 0x0040, 0x0428, + 0xa186, 0x0046, 0x0138, 0xa186, 0x0045, 0x0120, 0xa186, 0x0047, + 0x190c, 0x14fa, 0x2001, 0x0109, 0x2004, 0xd084, 0x0198, 0x0126, + 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x68e7, 0x002e, + 0x001e, 0x000e, 0x012e, 0xe000, 0x6000, 0xa086, 0x0002, 0x1110, + 0x0804, 0x8e47, 0x080c, 0x8331, 0x0005, 0x0002, 0x8deb, 0x8de9, + 0x8de9, 0x8de9, 0x8de9, 0x8de9, 0x8de9, 0x8de9, 0x8de9, 0x8de9, + 0x8de9, 0x8e06, 0x8e06, 0x8e06, 0x8e06, 0x8de9, 0x8e06, 0x8de9, + 0x8e06, 0x080c, 0x14fa, 0x080c, 0x6dc1, 0x00d6, 0x6110, 0x2168, + 0x080c, 0x986a, 0x0168, 0x6837, 0x0103, 0x684b, 0x0006, 0x6847, + 0x0000, 0x6850, 0xc0ec, 0x6852, 0x080c, 0x5271, 0x080c, 0x9a1f, + 0x00de, 0x080c, 0x82eb, 0x080c, 0x6e9e, 0x0005, 0x080c, 0x6dc1, + 0x080c, 0x82eb, 0x080c, 0x6e9e, 0x0005, 0x0002, 0x8e23, 0x8e21, + 0x8e21, 0x8e21, 0x8e21, 0x8e21, 0x8e21, 0x8e21, 0x8e21, 0x8e21, + 0x8e21, 0x8e35, 0x8e35, 0x8e35, 0x8e35, 0x8e21, 0x8e40, 0x8e21, + 0x8e35, 0x080c, 0x14fa, 0x080c, 0x6dc1, 0x2001, 0xb3b7, 0x2004, + 0x603e, 0x6003, 0x0002, 0x080c, 0x6e9e, 0x6010, 0xa088, 0x0013, + 0x2104, 0xa085, 0x0400, 0x200a, 0x0005, 0x080c, 0x6dc1, 0x2001, + 0xb3b7, 0x2004, 0x603e, 0x6003, 0x000f, 0x080c, 0x6e9e, 0x0005, + 0x080c, 0x6dc1, 0x080c, 0x82eb, 0x080c, 0x6e9e, 0x0005, 0xa182, + 0x0040, 0x0002, 0x8e5d, 0x8e5d, 0x8e5d, 0x8e5d, 0x8e5d, 0x8e5f, + 0x8f37, 0x8f66, 0x8e5d, 0x8e5d, 0x8e5d, 0x8e5d, 0x8e5d, 0x8e5d, + 0x8e5d, 0x8e5d, 0x8e5d, 0x8e5d, 0x8e5d, 0x080c, 0x14fa, 0x00e6, + 0x00d6, 0x603f, 0x0000, 0x2071, 0xb680, 0x7124, 0x610a, 0x2071, + 0xb68c, 0x6110, 0x2168, 0x7614, 0xa6b4, 0x0fff, 0x86ff, 0x0904, + 0x8f03, 0xa68c, 0x0c00, 0x01e8, 0x00f6, 0x2c78, 0x080c, 0x5177, + 0x00fe, 0x0198, 0x684c, 0xd0ac, 0x0180, 0x6020, 0xd0dc, 0x1168, + 0x6850, 0xd0bc, 0x1150, 0x7318, 0x6814, 0xa306, 0x1904, 0x8f15, + 0x731c, 0x6810, 0xa306, 0x1904, 0x8f15, 0x7318, 0x6b62, 0x731c, + 0x6b5e, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0518, 0xa186, 0x0028, + 0x1128, 0x080c, 0x9a44, 0x684b, 0x001c, 0x00e8, 0xd6dc, 0x01a0, + 0x684b, 0x0015, 0x684c, 0xd0ac, 0x0170, 0x6914, 0x6a10, 0x2100, + 0xa205, 0x0148, 0x7018, 0xa106, 0x1118, 0x701c, 0xa206, 0x0118, + 0x6962, 0x6a5e, 0xc6dc, 0x0038, 0xd6d4, 0x0118, 0x684b, 0x0007, + 0x0010, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0xa01e, 0xd6c4, + 0x01f0, 0xa686, 0x0100, 0x1140, 0x2001, 0xb699, 0x2004, 0xa005, + 0x1118, 0xc6c4, 0x0804, 0x8e6e, 0x7328, 0x732c, 0x6b56, 0x83ff, + 0x0170, 0xa38a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, + 0x2019, 0xb698, 0xad90, 0x0019, 0x080c, 0x953f, 0x003e, 0xd6cc, + 0x0904, 0x8f28, 0x7124, 0x695a, 0x81ff, 0x0904, 0x8f28, 0xa192, + 0x0021, 0x1250, 0x2071, 0xb698, 0x831c, 0x2300, 0xae18, 0xad90, + 0x001d, 0x080c, 0x953f, 0x04a0, 0x6838, 0xd0fc, 0x0120, 0x2009, + 0x0020, 0x695a, 0x0c78, 0x00f6, 0x2d78, 0x080c, 0x94e4, 0x00fe, + 0x080c, 0x952f, 0x0438, 0x00f6, 0x2c78, 0x080c, 0x5177, 0x00fe, + 0x0188, 0x684c, 0xd0ac, 0x0170, 0x6020, 0xd0dc, 0x1158, 0x6850, + 0xd0bc, 0x1140, 0x684c, 0xd0f4, 0x1128, 0x080c, 0x9b43, 0x00de, + 0x00ee, 0x00e0, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0x684c, + 0xd0ac, 0x0130, 0x6810, 0x6914, 0xa115, 0x0110, 0x080c, 0x90c1, + 0x080c, 0x5271, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x080c, + 0x9b11, 0x00de, 0x00ee, 0x1110, 0x080c, 0x82eb, 0x0005, 0x00f6, + 0x6003, 0x0003, 0x2079, 0xb68c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, + 0x6010, 0x2078, 0x784c, 0xd0ac, 0x0138, 0x6003, 0x0002, 0x00fe, + 0x0005, 0x2130, 0x2228, 0x0058, 0x2400, 0x797c, 0xa10a, 0x2300, + 0x7a80, 0xa213, 0x2600, 0xa102, 0x2500, 0xa203, 0x0e90, 0x7c12, + 0x7b16, 0x7e0a, 0x7d0e, 0x00fe, 0x603f, 0x0000, 0x2c10, 0x080c, + 0x1ec4, 0x080c, 0x6a59, 0x080c, 0x6f5b, 0x0005, 0x2001, 0xb3b7, + 0x2004, 0x603e, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, + 0x3e20, 0x2c10, 0x080c, 0x1828, 0x0005, 0xa182, 0x0040, 0x0002, + 0x8f8b, 0x8f8b, 0x8f8b, 0x8f8b, 0x8f8b, 0x8f8d, 0x901e, 0x8f8b, + 0x8f8b, 0x9034, 0x9098, 0x8f8b, 0x8f8b, 0x8f8b, 0x8f8b, 0x90a7, + 0x8f8b, 0x8f8b, 0x8f8b, 0x080c, 0x14fa, 0x0076, 0x00f6, 0x00e6, + 0x00d6, 0x2071, 0xb68c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, + 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, + 0x6a3e, 0x86ff, 0x0904, 0x9019, 0xa694, 0xff00, 0xa284, 0x0c00, + 0x0120, 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0904, + 0x9019, 0x080c, 0x15dd, 0x090c, 0x14fa, 0x2d00, 0x784a, 0x7f4c, + 0xc7cd, 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, + 0x7840, 0x6842, 0x6e46, 0xa68c, 0x0c00, 0x0120, 0x7318, 0x6b62, + 0x731c, 0x6b5e, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0180, 0xa186, + 0x0028, 0x1118, 0x684b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0x684b, + 0x0015, 0x0038, 0xd6d4, 0x0118, 0x684b, 0x0007, 0x0010, 0x684b, + 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, + 0x0198, 0x7328, 0x732c, 0x6b56, 0x83ff, 0x0170, 0xa38a, 0x0009, + 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0xb698, 0xad90, + 0x0019, 0x080c, 0x953f, 0x003e, 0xd6cc, 0x01d8, 0x7124, 0x695a, + 0x81ff, 0x01b8, 0xa192, 0x0021, 0x1250, 0x2071, 0xb698, 0x831c, + 0x2300, 0xae18, 0xad90, 0x001d, 0x080c, 0x953f, 0x0050, 0x7838, + 0xd0fc, 0x0120, 0x2009, 0x0020, 0x695a, 0x0c78, 0x2d78, 0x080c, + 0x94e4, 0x00de, 0x00ee, 0x00fe, 0x007e, 0x0005, 0x00f6, 0x6003, + 0x0003, 0x2079, 0xb68c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010, + 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x00fe, 0x2c10, 0x080c, + 0x1ec4, 0x080c, 0x7a72, 0x0005, 0x00d6, 0x00f6, 0x2c78, 0x080c, + 0x5177, 0x00fe, 0x0120, 0x2001, 0xb3b7, 0x2004, 0x603e, 0x6003, + 0x0002, 0x080c, 0x6e53, 0x080c, 0x6f5b, 0x6110, 0x2168, 0x694c, + 0xd1e4, 0x0904, 0x9096, 0xd1cc, 0x0540, 0x6948, 0x6838, 0xd0fc, + 0x01e8, 0x0016, 0x684c, 0x0006, 0x6850, 0x0006, 0xad90, 0x000d, + 0xa198, 0x000d, 0x2009, 0x0020, 0x0156, 0x21a8, 0x2304, 0x2012, + 0x8318, 0x8210, 0x1f04, 0x905e, 0x015e, 0x000e, 0x6852, 0x000e, + 0x684e, 0x001e, 0x2168, 0x080c, 0x1604, 0x0418, 0x0016, 0x080c, + 0x1604, 0x00de, 0x080c, 0x952f, 0x00e0, 0x6837, 0x0103, 0x6944, + 0xa184, 0x00ff, 0xa0b6, 0x0002, 0x0180, 0xa086, 0x0028, 0x1118, + 0x684b, 0x001c, 0x0060, 0xd1dc, 0x0118, 0x684b, 0x0015, 0x0038, + 0xd1d4, 0x0118, 0x684b, 0x0007, 0x0010, 0x684b, 0x0000, 0x080c, + 0x5271, 0x080c, 0x9b11, 0x1110, 0x080c, 0x82eb, 0x00de, 0x0005, + 0x2019, 0x0001, 0x080c, 0x7cc4, 0x6003, 0x0002, 0x2001, 0xb3b7, + 0x2004, 0x603e, 0x080c, 0x6e53, 0x080c, 0x6f5b, 0x0005, 0x080c, + 0x6e53, 0x080c, 0x2b73, 0x00d6, 0x6110, 0x2168, 0x080c, 0x986a, + 0x0150, 0x6837, 0x0103, 0x684b, 0x0029, 0x6847, 0x0000, 0x080c, + 0x5271, 0x080c, 0x9a1f, 0x00de, 0x080c, 0x82eb, 0x080c, 0x6f5b, + 0x0005, 0x684b, 0x0015, 0xd1fc, 0x0138, 0x684b, 0x0007, 0x8002, + 0x8000, 0x810a, 0xa189, 0x0000, 0x6962, 0x685e, 0x0005, 0xa182, + 0x0040, 0x0002, 0x90e5, 0x90e5, 0x90e5, 0x90e5, 0x90e5, 0x90e7, + 0x90e5, 0x91a0, 0x91ac, 0x90e5, 0x90e5, 0x90e5, 0x90e5, 0x90e5, + 0x90e5, 0x90e5, 0x90e5, 0x90e5, 0x90e5, 0x080c, 0x14fa, 0x0076, + 0x00f6, 0x00e6, 0x00d6, 0x2071, 0xb68c, 0x6110, 0x2178, 0x7614, + 0xa6b4, 0x0fff, 0x00f6, 0x2c78, 0x080c, 0x5177, 0x00fe, 0x0150, + 0xa684, 0x00ff, 0x1138, 0x6020, 0xd0f4, 0x0120, 0x080c, 0x9b43, + 0x0804, 0x919b, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268, + 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0904, 0x9191, 0xa694, 0xff00, + 0xa284, 0x0c00, 0x0120, 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, + 0x0300, 0x0904, 0x918f, 0xa686, 0x0100, 0x1140, 0x2001, 0xb699, + 0x2004, 0xa005, 0x1118, 0xc6c4, 0x7e46, 0x0c28, 0x080c, 0x15dd, + 0x090c, 0x14fa, 0x2d00, 0x784a, 0x7f4c, 0xa7bd, 0x0200, 0x7f4e, + 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, + 0x6e46, 0xa68c, 0x0c00, 0x0120, 0x7318, 0x6b62, 0x731c, 0x6b5e, + 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0180, 0xa186, 0x0028, 0x1118, + 0x684b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0x684b, 0x0015, 0x0038, + 0xd6d4, 0x0118, 0x684b, 0x0007, 0x0010, 0x684b, 0x0000, 0x6f4e, + 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0198, 0x7328, + 0x732c, 0x6b56, 0x83ff, 0x0170, 0xa38a, 0x0009, 0x0210, 0x2019, + 0x0008, 0x0036, 0x2308, 0x2019, 0xb698, 0xad90, 0x0019, 0x080c, + 0x953f, 0x003e, 0xd6cc, 0x01d8, 0x7124, 0x695a, 0x81ff, 0x01b8, + 0xa192, 0x0021, 0x1250, 0x2071, 0xb698, 0x831c, 0x2300, 0xae18, + 0xad90, 0x001d, 0x080c, 0x953f, 0x0050, 0x7838, 0xd0fc, 0x0120, + 0x2009, 0x0020, 0x695a, 0x0c78, 0x2d78, 0x080c, 0x94e4, 0xd6dc, + 0x1110, 0xa006, 0x0030, 0x2001, 0x0001, 0x2071, 0xb68c, 0x7218, + 0x731c, 0x080c, 0x1873, 0x00de, 0x00ee, 0x00fe, 0x007e, 0x0005, + 0x2001, 0xb3b7, 0x2004, 0x603e, 0x20e1, 0x0005, 0x3d18, 0x3e20, + 0x2c10, 0x080c, 0x1828, 0x0005, 0x2001, 0xb3b7, 0x2004, 0x603e, + 0x00d6, 0x6003, 0x0002, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0904, + 0x92b3, 0x603f, 0x0000, 0x00f6, 0x2c78, 0x080c, 0x5177, 0x00fe, + 0x0560, 0x6814, 0x6910, 0xa115, 0x0540, 0x6a60, 0xa206, 0x1118, + 0x685c, 0xa106, 0x0510, 0x684c, 0xc0e4, 0x684e, 0x6847, 0x0000, + 0x6863, 0x0000, 0x685f, 0x0000, 0x6020, 0xd0f4, 0x1158, 0x697c, + 0x6810, 0xa102, 0x603a, 0x6980, 0x6814, 0xa103, 0x6036, 0x6020, + 0xc0f5, 0x6022, 0x00d6, 0x6018, 0x2068, 0x683c, 0x8000, 0x683e, + 0x00de, 0x080c, 0x9b43, 0x0804, 0x92b3, 0x694c, 0xd1cc, 0x0904, + 0x9283, 0x6948, 0x6838, 0xd0fc, 0x0904, 0x9248, 0x0016, 0x684c, + 0x0006, 0x6850, 0x0006, 0x00f6, 0x2178, 0x7944, 0xa184, 0x00ff, + 0xa0b6, 0x0002, 0x01e0, 0xa086, 0x0028, 0x1128, 0x684b, 0x001c, + 0x784b, 0x001c, 0x00e8, 0xd1dc, 0x0158, 0x684b, 0x0015, 0x784b, + 0x0015, 0x080c, 0x9ccd, 0x0118, 0x7944, 0xc1dc, 0x7946, 0x0080, + 0xd1d4, 0x0128, 0x684b, 0x0007, 0x784b, 0x0007, 0x0048, 0x684c, + 0xd0ac, 0x0130, 0x6810, 0x6914, 0xa115, 0x0110, 0x080c, 0x90c1, + 0x6848, 0x784a, 0x6860, 0x7862, 0x685c, 0x785e, 0xad90, 0x000d, + 0xaf98, 0x000d, 0x2009, 0x0020, 0x0156, 0x21a8, 0x2304, 0x2012, + 0x8318, 0x8210, 0x1f04, 0x9236, 0x015e, 0x00fe, 0x000e, 0x6852, + 0x000e, 0x684e, 0x001e, 0x2168, 0x080c, 0x1604, 0x0804, 0x92ae, + 0x0016, 0x00f6, 0x2178, 0x7944, 0xa184, 0x00ff, 0xa0b6, 0x0002, + 0x01e0, 0xa086, 0x0028, 0x1128, 0x684b, 0x001c, 0x784b, 0x001c, + 0x00e8, 0xd1dc, 0x0158, 0x684b, 0x0015, 0x784b, 0x0015, 0x080c, + 0x9ccd, 0x0118, 0x7944, 0xc1dc, 0x7946, 0x0080, 0xd1d4, 0x0128, + 0x684b, 0x0007, 0x784b, 0x0007, 0x0048, 0x684c, 0xd0ac, 0x0130, + 0x6810, 0x6914, 0xa115, 0x0110, 0x080c, 0x90c1, 0x6860, 0x7862, + 0x685c, 0x785e, 0x684c, 0x784e, 0x00fe, 0x080c, 0x1604, 0x00de, + 0x080c, 0x952f, 0x0458, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, + 0xa0b6, 0x0002, 0x01b0, 0xa086, 0x0028, 0x1118, 0x684b, 0x001c, + 0x00d8, 0xd1dc, 0x0148, 0x684b, 0x0015, 0x080c, 0x9ccd, 0x0118, + 0x6944, 0xc1dc, 0x6946, 0x0080, 0xd1d4, 0x0118, 0x684b, 0x0007, + 0x0058, 0x684b, 0x0000, 0x684c, 0xd0ac, 0x0130, 0x6810, 0x6914, + 0xa115, 0x0110, 0x080c, 0x90c1, 0x080c, 0x5271, 0x080c, 0x9b11, + 0x1110, 0x080c, 0x82eb, 0x00de, 0x0005, 0x080c, 0x6dc1, 0x0010, + 0x080c, 0x6e53, 0x080c, 0x986a, 0x01c0, 0x00d6, 0x6110, 0x2168, + 0x6837, 0x0103, 0x2009, 0xb10c, 0x210c, 0xd18c, 0x11c0, 0xd184, + 0x1198, 0x6108, 0x694a, 0xa18e, 0x0029, 0x1110, 0x080c, 0xaf46, + 0x6847, 0x0000, 0x080c, 0x5271, 0x00de, 0x080c, 0x82eb, 0x080c, + 0x6e9e, 0x080c, 0x6f5b, 0x0005, 0x684b, 0x0004, 0x0c88, 0x684b, + 0x0004, 0x0c70, 0xa182, 0x0040, 0x0002, 0x92f8, 0x92f8, 0x92f8, + 0x92f8, 0x92f8, 0x92fa, 0x92f8, 0x92fd, 0x92f8, 0x92f8, 0x92f8, + 0x92f8, 0x92f8, 0x92f8, 0x92f8, 0x92f8, 0x92f8, 0x92f8, 0x92f8, + 0x080c, 0x14fa, 0x080c, 0x82eb, 0x0005, 0x0006, 0x0026, 0xa016, + 0x080c, 0x1828, 0x002e, 0x000e, 0x0005, 0xa182, 0x0085, 0x0002, + 0x9311, 0x930f, 0x930f, 0x931d, 0x930f, 0x930f, 0x930f, 0x080c, + 0x14fa, 0x6003, 0x0001, 0x6106, 0x080c, 0x69f6, 0x0126, 0x2091, + 0x8000, 0x080c, 0x6e9e, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6, + 0x00e6, 0x2071, 0xb680, 0x7224, 0x6212, 0x7220, 0x080c, 0x985a, + 0x01a0, 0x2268, 0x6800, 0xa086, 0x0000, 0x0178, 0x6018, 0x6d18, + 0xa52e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0x954f, 0x00ce, 0x0128, + 0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003, + 0x0001, 0x080c, 0x69f6, 0x080c, 0x6e9e, 0x00f6, 0x2278, 0x080c, + 0x5177, 0x00fe, 0x0150, 0x6820, 0xd0ec, 0x0138, 0x00c6, 0x2260, + 0x603f, 0x0000, 0x080c, 0x9b43, 0x00ce, 0x00ee, 0x00de, 0x005e, + 0x002e, 0x0005, 0xa186, 0x0013, 0x1160, 0x6004, 0xa08a, 0x0085, + 0x0a0c, 0x14fa, 0xa08a, 0x008c, 0x1a0c, 0x14fa, 0xa082, 0x0085, + 0x0072, 0xa186, 0x0027, 0x0120, 0xa186, 0x0014, 0x190c, 0x14fa, + 0x080c, 0x6dc1, 0x080c, 0x9a2b, 0x080c, 0x6e9e, 0x0005, 0x937e, + 0x9380, 0x9380, 0x937e, 0x937e, 0x937e, 0x937e, 0x080c, 0x14fa, + 0x080c, 0x6dc1, 0x080c, 0x9a2b, 0x080c, 0x6e9e, 0x0005, 0xa186, + 0x0013, 0x1128, 0x6004, 0xa082, 0x0085, 0x2008, 0x04a8, 0xa186, + 0x0027, 0x11e8, 0x080c, 0x6dc1, 0x080c, 0x2b73, 0x00d6, 0x6010, + 0x2068, 0x080c, 0x986a, 0x0150, 0x6837, 0x0103, 0x6847, 0x0000, + 0x684b, 0x0029, 0x080c, 0x5271, 0x080c, 0x9a1f, 0x00de, 0x080c, + 0x82eb, 0x080c, 0x6e9e, 0x0005, 0x080c, 0x8331, 0x0ce0, 0xa186, + 0x0014, 0x1dd0, 0x080c, 0x6dc1, 0x00d6, 0x6010, 0x2068, 0x080c, + 0x986a, 0x0d60, 0x6837, 0x0103, 0x6847, 0x0000, 0x684b, 0x0006, + 0x6850, 0xc0ec, 0x6852, 0x08f0, 0x0002, 0x93ce, 0x93cc, 0x93cc, + 0x93cc, 0x93cc, 0x93cc, 0x93e6, 0x080c, 0x14fa, 0x080c, 0x6dc1, + 0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0039, 0x0118, 0xa186, + 0x0035, 0x1118, 0x2001, 0xb3b5, 0x0010, 0x2001, 0xb3b6, 0x2004, + 0x6016, 0x6003, 0x000c, 0x080c, 0x6e9e, 0x0005, 0x080c, 0x6dc1, + 0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0039, 0x0118, 0xa186, + 0x0035, 0x1118, 0x2001, 0xb3b5, 0x0010, 0x2001, 0xb3b6, 0x2004, + 0x6016, 0x6003, 0x000e, 0x080c, 0x6e9e, 0x0005, 0xa182, 0x008c, + 0x1220, 0xa182, 0x0085, 0x0208, 0x001a, 0x080c, 0x8331, 0x0005, + 0x940f, 0x940f, 0x940f, 0x940f, 0x9411, 0x9464, 0x940f, 0x080c, + 0x14fa, 0x00d6, 0x00f6, 0x2c78, 0x080c, 0x5177, 0x00fe, 0x0168, + 0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0039, 0x0118, 0xa186, + 0x0035, 0x1118, 0x00de, 0x0804, 0x9477, 0x080c, 0x9a1f, 0x080c, + 0x986a, 0x01c8, 0x6010, 0x2068, 0x6837, 0x0103, 0x6850, 0xd0b4, + 0x0128, 0x684b, 0x0006, 0xc0ec, 0x6852, 0x0048, 0xd0bc, 0x0118, + 0x684b, 0x0002, 0x0020, 0x684b, 0x0005, 0x080c, 0x9ae0, 0x6847, + 0x0000, 0x080c, 0x5271, 0x2c68, 0x080c, 0x8295, 0x01c0, 0x6003, + 0x0001, 0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0xb68e, 0x210c, + 0x6136, 0x2009, 0xb68f, 0x210c, 0x613a, 0x6918, 0x611a, 0x080c, + 0x9c35, 0x6950, 0x6152, 0x601f, 0x0001, 0x080c, 0x69f6, 0x2d60, + 0x080c, 0x82eb, 0x00de, 0x0005, 0x00f6, 0x2c78, 0x080c, 0x5177, + 0x00fe, 0x0598, 0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, 0x0035, + 0x0130, 0xa186, 0x001e, 0x0118, 0xa186, 0x0039, 0x1530, 0x00d6, + 0x2c68, 0x080c, 0x9d16, 0x1904, 0x94bc, 0x080c, 0x8295, 0x01d8, + 0x6106, 0x6003, 0x0001, 0x601f, 0x0001, 0x6918, 0x611a, 0x6928, + 0x612a, 0x692c, 0x612e, 0x6930, 0xa18c, 0x00ff, 0x6132, 0x6934, + 0x6136, 0x6938, 0x613a, 0x6950, 0x6152, 0x080c, 0x9c35, 0x080c, + 0x69f6, 0x080c, 0x6e9e, 0x2d60, 0x00f8, 0x00d6, 0x6010, 0x2068, + 0x080c, 0x986a, 0x01c8, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0128, + 0xc0ec, 0x6852, 0x684b, 0x0006, 0x0048, 0xd0bc, 0x0118, 0x684b, + 0x0002, 0x0020, 0x684b, 0x0005, 0x080c, 0x9ae0, 0x6847, 0x0000, + 0x080c, 0x5271, 0x080c, 0x9a1f, 0x00de, 0x080c, 0x82eb, 0x0005, + 0x0016, 0x00d6, 0x6010, 0x2068, 0x080c, 0x986a, 0x0140, 0x6837, + 0x0103, 0x684b, 0x0028, 0x6847, 0x0000, 0x080c, 0x5271, 0x00de, + 0x001e, 0xa186, 0x0013, 0x0148, 0xa186, 0x0014, 0x0130, 0xa186, + 0x0027, 0x0118, 0x080c, 0x8331, 0x0030, 0x080c, 0x6dc1, 0x080c, + 0x9a2b, 0x080c, 0x6e9e, 0x0005, 0x0056, 0x0066, 0x00d6, 0x00f6, + 0x2029, 0x0001, 0xa182, 0x0101, 0x1208, 0x0010, 0x2009, 0x0100, + 0x2130, 0x2069, 0xb698, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020, + 0xaf90, 0x001d, 0x080c, 0x953f, 0xa6b2, 0x0020, 0x7804, 0xa06d, + 0x0110, 0x080c, 0x1604, 0x080c, 0x15dd, 0x0500, 0x8528, 0x6837, + 0x0110, 0x683b, 0x0000, 0x2d20, 0x7c06, 0xa68a, 0x003d, 0x1228, + 0x2608, 0xad90, 0x000f, 0x0459, 0x0088, 0xa6b2, 0x003c, 0x2009, + 0x003c, 0x2d78, 0xad90, 0x000f, 0x0411, 0x0c28, 0x00fe, 0x852f, + 0xa5ad, 0x0003, 0x7d36, 0xa5ac, 0x0000, 0x0028, 0x00fe, 0x852f, + 0xa5ad, 0x0003, 0x7d36, 0x00de, 0x006e, 0x005e, 0x0005, 0x00f6, + 0x8dff, 0x0158, 0x6804, 0xa07d, 0x0130, 0x6807, 0x0000, 0x080c, + 0x5271, 0x2f68, 0x0cb8, 0x080c, 0x5271, 0x00fe, 0x0005, 0x0156, + 0xa184, 0x0001, 0x0108, 0x8108, 0x810c, 0x21a8, 0x2304, 0x8007, + 0x2012, 0x8318, 0x8210, 0x1f04, 0x9546, 0x015e, 0x0005, 0x0066, + 0x0126, 0x2091, 0x8000, 0x2031, 0x0001, 0x601c, 0xa084, 0x000f, + 0x0083, 0x012e, 0x006e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0066, + 0x2031, 0x0000, 0x601c, 0xa084, 0x000f, 0x001b, 0x006e, 0x012e, + 0x0005, 0x9586, 0x9586, 0x9581, 0x95a8, 0x9574, 0x9581, 0x95a8, + 0x9581, 0x9581, 0x9574, 0x9581, 0x080c, 0x14fa, 0x0036, 0x2019, + 0x0010, 0x080c, 0xa8af, 0x601f, 0x0006, 0x6003, 0x0007, 0x003e, + 0x0005, 0xa006, 0x0005, 0xa085, 0x0001, 0x0005, 0x00d6, 0x86ff, + 0x11d8, 0x6010, 0x2068, 0x080c, 0x986a, 0x01c0, 0x6834, 0xa086, + 0x0139, 0x1128, 0x684b, 0x0005, 0x6853, 0x0000, 0x0028, 0xa00e, + 0x2001, 0x0005, 0x080c, 0x5344, 0x080c, 0x9ae0, 0x080c, 0x5271, + 0x080c, 0x82eb, 0xa085, 0x0001, 0x00de, 0x0005, 0xa006, 0x0ce0, + 0x6000, 0xa08a, 0x0010, 0x1a0c, 0x14fa, 0x000b, 0x0005, 0x95bf, + 0x95e0, 0x95c1, 0x95ff, 0x95dd, 0x95bf, 0x9581, 0x9586, 0x9586, + 0x9581, 0x9581, 0x9581, 0x9581, 0x9581, 0x9581, 0x9581, 0x080c, + 0x14fa, 0x86ff, 0x11b8, 0x601c, 0xa086, 0x0006, 0x0198, 0x00d6, + 0x6010, 0x2068, 0x080c, 0x986a, 0x0110, 0x080c, 0x9ae0, 0x00de, + 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x080c, 0x69f6, + 0x080c, 0x6e9e, 0xa085, 0x0001, 0x0005, 0x080c, 0x190f, 0x0c08, + 0x00e6, 0x2071, 0xb3d9, 0x7024, 0xac06, 0x1110, 0x080c, 0x7c41, + 0x601c, 0xa084, 0x000f, 0xa086, 0x0006, 0x1150, 0x0086, 0x0096, + 0x2049, 0x0001, 0x2c40, 0x080c, 0x7e0d, 0x009e, 0x008e, 0x0010, + 0x080c, 0x7b3e, 0x00ee, 0x1928, 0x080c, 0x9581, 0x0005, 0x0036, + 0x00e6, 0x2071, 0xb3d9, 0x703c, 0xac06, 0x1140, 0x2019, 0x0000, + 0x080c, 0x7cc4, 0x00ee, 0x003e, 0x0804, 0x95c1, 0x080c, 0x7f2b, + 0x00ee, 0x003e, 0x1904, 0x95c1, 0x080c, 0x9581, 0x0005, 0x00c6, + 0x601c, 0xa084, 0x000f, 0x0013, 0x00ce, 0x0005, 0x9630, 0x969a, + 0x97c8, 0x963b, 0x9a2b, 0x9630, 0xa8a1, 0x82eb, 0x969a, 0x9629, + 0x9833, 0x080c, 0x14fa, 0x080c, 0x9a66, 0x1110, 0x080c, 0x8890, + 0x0005, 0x080c, 0x6dc1, 0x080c, 0x6e9e, 0x080c, 0x82eb, 0x0005, + 0x6017, 0x0001, 0x0005, 0x6010, 0xa080, 0x0019, 0x2c02, 0x6000, + 0xa08a, 0x0010, 0x1a0c, 0x14fa, 0x000b, 0x0005, 0x9656, 0x9658, + 0x9678, 0x968a, 0x9697, 0x9656, 0x9630, 0x9630, 0x9630, 0x968a, + 0x968a, 0x9656, 0x9656, 0x9656, 0x9656, 0x9694, 0x080c, 0x14fa, + 0x00e6, 0x6010, 0x2070, 0x7050, 0xc0b5, 0x7052, 0x2071, 0xb3d9, + 0x7024, 0xac06, 0x0190, 0x080c, 0x7b3e, 0x6007, 0x0085, 0x6003, + 0x000b, 0x601f, 0x0002, 0x2001, 0xb3b6, 0x2004, 0x6016, 0x080c, + 0x69f6, 0x080c, 0x6e9e, 0x00ee, 0x0005, 0x6017, 0x0001, 0x0cd8, + 0x00d6, 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852, 0x00de, 0x6007, + 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x080c, 0x69f6, 0x080c, + 0x6e9e, 0x0005, 0x00d6, 0x6017, 0x0001, 0x6010, 0x2068, 0x6850, + 0xc0b5, 0x6852, 0x00de, 0x0005, 0x080c, 0x82eb, 0x0005, 0x080c, + 0x190f, 0x08f0, 0x6000, 0xa08a, 0x0010, 0x1a0c, 0x14fa, 0x000b, + 0x0005, 0x96b1, 0x9638, 0x96b3, 0x96b1, 0x96b3, 0x96b3, 0x9631, + 0x96b1, 0x962b, 0x962b, 0x96b1, 0x96b1, 0x96b1, 0x96b1, 0x96b1, + 0x96b1, 0x080c, 0x14fa, 0x00d6, 0x6018, 0x2068, 0x6804, 0xa084, + 0x00ff, 0x00de, 0xa08a, 0x000c, 0x1a0c, 0x14fa, 0x000b, 0x0005, + 0x96cc, 0x976e, 0x96ce, 0x9708, 0x96ce, 0x9708, 0x96ce, 0x96d8, + 0x96cc, 0x9708, 0x96cc, 0x96f4, 0x080c, 0x14fa, 0x6004, 0xa08e, + 0x0016, 0x0588, 0xa08e, 0x0004, 0x0570, 0xa08e, 0x0002, 0x0558, + 0x6004, 0x080c, 0x9a66, 0x0904, 0x9787, 0xa08e, 0x0021, 0x0904, + 0x978b, 0xa08e, 0x0022, 0x0904, 0x9787, 0xa08e, 0x003d, 0x0904, + 0x978b, 0xa08e, 0x0039, 0x0904, 0x978f, 0xa08e, 0x0035, 0x0904, + 0x978f, 0xa08e, 0x001e, 0x0188, 0xa08e, 0x0001, 0x1150, 0x00d6, + 0x6018, 0x2068, 0x6804, 0xa084, 0x00ff, 0x00de, 0xa086, 0x0006, + 0x0110, 0x080c, 0x2b73, 0x080c, 0x8890, 0x080c, 0x9a2b, 0x0005, + 0x00c6, 0x00d6, 0x6104, 0xa186, 0x0016, 0x0904, 0x975f, 0xa186, + 0x0002, 0x1518, 0x6018, 0x2068, 0x2001, 0xb134, 0x2004, 0xd0ac, + 0x1904, 0x97b1, 0x68a0, 0xd0bc, 0x1904, 0x97b1, 0x6840, 0xa084, + 0x00ff, 0xa005, 0x0190, 0x8001, 0x6842, 0x6013, 0x0000, 0x601f, + 0x0007, 0x6017, 0x0398, 0x603f, 0x0000, 0x080c, 0x8295, 0x0128, + 0x2d00, 0x601a, 0x601f, 0x0001, 0x0450, 0x00de, 0x00ce, 0x6004, + 0xa08e, 0x0002, 0x11a8, 0x6018, 0xa080, 0x0028, 0x2004, 0xa086, + 0x007e, 0x1170, 0x2009, 0xb134, 0x2104, 0xc085, 0x200a, 0x00e6, + 0x2071, 0xb100, 0x080c, 0x4a3b, 0x00ee, 0x080c, 0x8890, 0x0020, + 0x080c, 0x8890, 0x080c, 0x2b73, 0x00e6, 0x0126, 0x2091, 0x8000, + 0x080c, 0x2b99, 0x012e, 0x00ee, 0x080c, 0x9a2b, 0x0005, 0x2001, + 0x0002, 0x080c, 0x4d75, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, + 0x6a3c, 0x080c, 0x6e9e, 0x00de, 0x00ce, 0x0c80, 0x00c6, 0x00d6, + 0x6104, 0xa186, 0x0016, 0x0d58, 0x6018, 0x2068, 0x6840, 0xa084, + 0x00ff, 0xa005, 0x0904, 0x9735, 0x8001, 0x6842, 0x6003, 0x0001, + 0x080c, 0x6a3c, 0x080c, 0x6e9e, 0x00de, 0x00ce, 0x08b8, 0x080c, + 0x8890, 0x0804, 0x9705, 0x080c, 0x88be, 0x0804, 0x9705, 0x00d6, + 0x2c68, 0x6104, 0x080c, 0x9d16, 0x00de, 0x0118, 0x080c, 0x82eb, + 0x00b8, 0x6004, 0x8007, 0x6130, 0xa18c, 0x00ff, 0xa105, 0x6032, + 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x6038, 0x600a, + 0x2001, 0xb3b6, 0x2004, 0x6016, 0x080c, 0x69f6, 0x080c, 0x6e9e, + 0x0005, 0x00de, 0x00ce, 0x080c, 0x8890, 0x080c, 0x2b73, 0x00e6, + 0x0126, 0x2091, 0x8000, 0x080c, 0x2b99, 0x6013, 0x0000, 0x601f, + 0x0007, 0x6017, 0x0398, 0x603f, 0x0000, 0x012e, 0x00ee, 0x0005, + 0x6000, 0xa08a, 0x0010, 0x1a0c, 0x14fa, 0x000b, 0x0005, 0x97df, + 0x97df, 0x97df, 0x97df, 0x97df, 0x97df, 0x97df, 0x97df, 0x97df, + 0x9630, 0x97df, 0x9638, 0x97e1, 0x9638, 0x97ee, 0x97df, 0x080c, + 0x14fa, 0x6004, 0xa086, 0x008b, 0x0148, 0x6007, 0x008b, 0x6003, + 0x000d, 0x080c, 0x69f6, 0x080c, 0x6e9e, 0x0005, 0x080c, 0x9a1f, + 0x080c, 0x986a, 0x0580, 0x080c, 0x2b73, 0x00d6, 0x080c, 0x986a, + 0x0168, 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006, 0x6847, + 0x0000, 0x6850, 0xc0ed, 0x6852, 0x080c, 0x5271, 0x2c68, 0x080c, + 0x8295, 0x0150, 0x6818, 0x601a, 0x080c, 0x9c35, 0x00c6, 0x2d60, + 0x080c, 0x9a2b, 0x00ce, 0x0008, 0x2d60, 0x00de, 0x6013, 0x0000, + 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x6a3c, + 0x080c, 0x6e9e, 0x0078, 0x6030, 0xa08c, 0xff00, 0x810f, 0xa186, + 0x0039, 0x0118, 0xa186, 0x0035, 0x1118, 0x080c, 0x2b73, 0x08b0, + 0x080c, 0x9a2b, 0x0005, 0x6000, 0xa08a, 0x0010, 0x1a0c, 0x14fa, + 0x000b, 0x0005, 0x984a, 0x984a, 0x984a, 0x984c, 0x984d, 0x984a, + 0x984a, 0x984a, 0x984a, 0x984a, 0x984a, 0x984a, 0x984a, 0x984a, + 0x984a, 0x984a, 0x080c, 0x14fa, 0x0005, 0x080c, 0x7f2b, 0x190c, + 0x14fa, 0x6110, 0x2168, 0x684b, 0x0006, 0x080c, 0x5271, 0x080c, + 0x82eb, 0x0005, 0xa284, 0x0007, 0x1158, 0xa282, 0xb800, 0x0240, + 0x2001, 0xb116, 0x2004, 0xa202, 0x1218, 0xa085, 0x0001, 0x0005, + 0xa006, 0x0ce8, 0x0026, 0x6210, 0xa294, 0xf000, 0x002e, 0x0005, + 0x00e6, 0x00c6, 0x0036, 0x0006, 0x0126, 0x2091, 0x8000, 0x2061, + 0xb800, 0x2071, 0xb100, 0x7344, 0x7064, 0xa302, 0x12a8, 0x601c, + 0xa206, 0x1160, 0x080c, 0x9bc0, 0x0148, 0x080c, 0x9a66, 0x1110, + 0x080c, 0x8890, 0x00c6, 0x080c, 0x82eb, 0x00ce, 0xace0, 0x0018, + 0x7058, 0xac02, 0x1208, 0x0c38, 0x012e, 0x000e, 0x003e, 0x00ce, + 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016, 0xa188, 0xb235, 0x210c, + 0x81ff, 0x0170, 0x2061, 0xb800, 0x2071, 0xb100, 0x0016, 0x080c, + 0x8295, 0x001e, 0x0138, 0x611a, 0x080c, 0x2b73, 0x080c, 0x82eb, + 0xa006, 0x0010, 0xa085, 0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, + 0x00c6, 0x0056, 0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x8295, + 0x005e, 0x0180, 0x6612, 0x651a, 0x080c, 0x9c35, 0x601f, 0x0003, + 0x2009, 0x004b, 0x080c, 0x831a, 0xa085, 0x0001, 0x012e, 0x005e, + 0x00ce, 0x0005, 0xa006, 0x0cd0, 0x00c6, 0x0056, 0x0126, 0x2091, + 0x8000, 0x62a0, 0x00c6, 0x080c, 0x9ae4, 0x005e, 0x0550, 0x6013, + 0x0000, 0x651a, 0x080c, 0x9c35, 0x601f, 0x0003, 0x0016, 0x00c6, + 0x2560, 0x080c, 0x501c, 0x00ce, 0x080c, 0x6b35, 0x0076, 0x2039, + 0x0000, 0x080c, 0x6a6b, 0x2c08, 0x080c, 0xaa51, 0x007e, 0x001e, + 0xd184, 0x0128, 0x080c, 0x82eb, 0xa085, 0x0001, 0x0030, 0x2009, + 0x004c, 0x080c, 0x831a, 0xa085, 0x0001, 0x012e, 0x005e, 0x00ce, + 0x0005, 0xa006, 0x0cd0, 0x00f6, 0x00c6, 0x0046, 0x00c6, 0x080c, + 0x8295, 0x2c78, 0x00ce, 0x0180, 0x7e12, 0x2c00, 0x781a, 0x781f, + 0x0003, 0x2021, 0x0005, 0x080c, 0x9960, 0x2f60, 0x2009, 0x004d, + 0x080c, 0x831a, 0xa085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, + 0x00f6, 0x00c6, 0x0046, 0x00c6, 0x080c, 0x8295, 0x2c78, 0x00ce, + 0x0178, 0x7e12, 0x2c00, 0x781a, 0x781f, 0x0003, 0x2021, 0x0005, + 0x0439, 0x2f60, 0x2009, 0x004e, 0x080c, 0x831a, 0xa085, 0x0001, + 0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046, 0x00c6, + 0x080c, 0x8295, 0x2c78, 0x00ce, 0x0178, 0x7e12, 0x2c00, 0x781a, + 0x781f, 0x0003, 0x2021, 0x0004, 0x0059, 0x2f60, 0x2009, 0x0052, + 0x080c, 0x831a, 0xa085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, + 0x0096, 0x0076, 0x0126, 0x2091, 0x8000, 0x080c, 0x4fbe, 0x0118, + 0x2001, 0x9965, 0x0028, 0x080c, 0x4f90, 0x0158, 0x2001, 0x996b, + 0x0006, 0xa00e, 0x2400, 0x080c, 0x5344, 0x080c, 0x5271, 0x000e, + 0x0807, 0x2418, 0x080c, 0x6d63, 0x62a0, 0x0086, 0x2041, 0x0001, + 0x2039, 0x0001, 0x2608, 0x080c, 0x6b4e, 0x008e, 0x080c, 0x6a6b, + 0x2f08, 0x2648, 0x080c, 0xaa51, 0x613c, 0x81ff, 0x090c, 0x6bf7, + 0x012e, 0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, + 0x00c6, 0x080c, 0x8295, 0x001e, 0x0188, 0x660a, 0x611a, 0x080c, + 0x9c35, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x080c, + 0x831a, 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005, 0xa006, 0x0cd8, + 0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x8295, 0x001e, + 0x0188, 0x660a, 0x611a, 0x080c, 0x9c35, 0x601f, 0x0008, 0x2d00, + 0x6012, 0x2009, 0x0021, 0x080c, 0x831a, 0xa085, 0x0001, 0x012e, + 0x00ce, 0x0005, 0xa006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, + 0x00c6, 0x080c, 0x8295, 0x001e, 0x0188, 0x660a, 0x611a, 0x080c, + 0x9c35, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x003d, 0x080c, + 0x831a, 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005, 0xa006, 0x0cd8, + 0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x9ae4, 0x001e, + 0x0180, 0x611a, 0x080c, 0x9c35, 0x601f, 0x0001, 0x2d00, 0x6012, + 0x2009, 0x0000, 0x080c, 0x831a, 0xa085, 0x0001, 0x012e, 0x00ce, + 0x0005, 0xa006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6, + 0x080c, 0x8295, 0x001e, 0x0188, 0x660a, 0x611a, 0x080c, 0x9c35, + 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0044, 0x080c, 0x831a, + 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005, 0xa006, 0x0cd8, 0x0026, + 0x00d6, 0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0110, 0x8211, 0x6a3e, + 0x00de, 0x002e, 0x0005, 0x0006, 0x6000, 0xa086, 0x0000, 0x0190, + 0x6013, 0x0000, 0x601f, 0x0007, 0x2001, 0xb3b5, 0x2004, 0x0006, + 0xa082, 0x0051, 0x000e, 0x0208, 0x8004, 0x6016, 0x080c, 0xaf00, + 0x603f, 0x0000, 0x000e, 0x0005, 0x0066, 0x00c6, 0x00d6, 0x2031, + 0xb153, 0x2634, 0xd6e4, 0x0128, 0x6618, 0x2660, 0x6e48, 0x080c, + 0x4f49, 0x00de, 0x00ce, 0x006e, 0x0005, 0x0006, 0x0016, 0x6004, + 0xa08e, 0x0002, 0x0140, 0xa08e, 0x0003, 0x0128, 0xa08e, 0x0004, + 0x0110, 0xa085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x00d6, + 0x6010, 0xa06d, 0x0148, 0x6834, 0xa086, 0x0139, 0x0138, 0x6838, + 0xd0fc, 0x0110, 0xa006, 0x0010, 0xa085, 0x0001, 0x00de, 0x000e, + 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x8295, + 0x001e, 0x0190, 0x611a, 0x080c, 0x9c35, 0x601f, 0x0001, 0x2d00, + 0x6012, 0x080c, 0x2b73, 0x2009, 0x0028, 0x080c, 0x831a, 0xa085, + 0x0001, 0x012e, 0x00ce, 0x0005, 0xa006, 0x0cd8, 0xa186, 0x0015, + 0x1178, 0x2011, 0xb120, 0x2204, 0xa086, 0x0074, 0x1148, 0x080c, + 0x8bed, 0x6003, 0x0001, 0x6007, 0x0029, 0x080c, 0x6a3c, 0x0020, + 0x080c, 0x8890, 0x080c, 0x82eb, 0x0005, 0xa186, 0x0016, 0x1128, + 0x2001, 0x0004, 0x080c, 0x4d75, 0x00e8, 0xa186, 0x0015, 0x11e8, + 0x2011, 0xb120, 0x2204, 0xa086, 0x0014, 0x11b8, 0x00d6, 0x6018, + 0x2068, 0x080c, 0x4ebf, 0x00de, 0x080c, 0x8ca6, 0x1170, 0x00d6, + 0x6018, 0x2068, 0x6890, 0x00de, 0xa005, 0x0138, 0x2001, 0x0006, + 0x080c, 0x4d75, 0x080c, 0x8469, 0x0020, 0x080c, 0x8890, 0x080c, + 0x82eb, 0x0005, 0x6848, 0xa086, 0x0005, 0x1108, 0x0009, 0x0005, + 0x6850, 0xc0ad, 0x6852, 0x0005, 0x00e6, 0x0126, 0x2071, 0xb100, + 0x2091, 0x8000, 0x7544, 0xa582, 0x0001, 0x0608, 0x7048, 0x2060, + 0x6000, 0xa086, 0x0000, 0x0148, 0xace0, 0x0018, 0x7058, 0xac02, + 0x1208, 0x0cb0, 0x2061, 0xb800, 0x0c98, 0x6003, 0x0008, 0x8529, + 0x7546, 0xaca8, 0x0018, 0x7058, 0xa502, 0x1230, 0x754a, 0xa085, + 0x0001, 0x012e, 0x00ee, 0x0005, 0x704b, 0xb800, 0x0cc0, 0xa006, + 0x0cc0, 0x00e6, 0x2071, 0xb68c, 0x7014, 0xd0e4, 0x0150, 0x6013, + 0x0000, 0x6003, 0x0001, 0x6007, 0x0050, 0x080c, 0x69f6, 0x080c, + 0x6e9e, 0x00ee, 0x0005, 0x00c6, 0x00f6, 0x2c78, 0x080c, 0x5177, + 0x00fe, 0x0120, 0x601c, 0xa084, 0x000f, 0x0013, 0x00ce, 0x0005, + 0x9630, 0x9b3b, 0x9b3e, 0x9b41, 0xaced, 0xad08, 0xad0b, 0x9630, + 0x9630, 0x080c, 0x14fa, 0xe000, 0xe000, 0x0005, 0xe000, 0xe000, + 0x0005, 0x0009, 0x0005, 0x00f6, 0x2c78, 0x080c, 0x5177, 0x0538, + 0x080c, 0x8295, 0x1128, 0x2001, 0xb3b7, 0x2004, 0x783e, 0x00f8, + 0x7818, 0x601a, 0x080c, 0x9c35, 0x781c, 0xa086, 0x0003, 0x0128, + 0x7808, 0x6036, 0x2f00, 0x603a, 0x0020, 0x7808, 0x603a, 0x2f00, + 0x6036, 0x602a, 0x601f, 0x0001, 0x6007, 0x0035, 0x6003, 0x0001, + 0x7950, 0x6152, 0x080c, 0x69f6, 0x080c, 0x6e9e, 0x2f60, 0x00fe, + 0x0005, 0x0016, 0x00f6, 0x682c, 0x6032, 0xa08e, 0x0001, 0x0138, + 0xa086, 0x0005, 0x0140, 0xa006, 0x602a, 0x602e, 0x00a0, 0x6820, + 0xc0f4, 0xc0d5, 0x6822, 0x6810, 0x2078, 0x787c, 0x6938, 0xa102, + 0x7880, 0x6934, 0xa103, 0x1e78, 0x6834, 0x602a, 0x6838, 0xa084, + 0xfffc, 0x683a, 0x602e, 0x2d00, 0x6036, 0x6808, 0x603a, 0x6918, + 0x611a, 0x6950, 0x6152, 0x601f, 0x0001, 0x6007, 0x0039, 0x6003, + 0x0001, 0x080c, 0x69f6, 0x6803, 0x0002, 0x00fe, 0x001e, 0x0005, + 0x00f6, 0x2c78, 0x080c, 0x5177, 0x1118, 0xa085, 0x0001, 0x0070, + 0x6020, 0xd0f4, 0x1150, 0xc0f5, 0x6022, 0x6010, 0x2078, 0x7828, + 0x603a, 0x782c, 0x6036, 0x080c, 0x190f, 0xa006, 0x00fe, 0x0005, + 0x0006, 0x0016, 0x6004, 0xa08e, 0x0034, 0x01b8, 0xa08e, 0x0035, + 0x01a0, 0xa08e, 0x0036, 0x0188, 0xa08e, 0x0037, 0x0170, 0xa08e, + 0x0038, 0x0158, 0xa08e, 0x0039, 0x0140, 0xa08e, 0x003a, 0x0128, + 0xa08e, 0x003b, 0x0110, 0xa085, 0x0001, 0x001e, 0x000e, 0x0005, + 0x0006, 0x0016, 0x0026, 0x0036, 0x00e6, 0x2001, 0xb3b1, 0x200c, + 0x8000, 0x2014, 0x2001, 0x0032, 0x080c, 0x68b3, 0x2001, 0xb3b5, + 0x82ff, 0x1110, 0x2011, 0x0002, 0x2202, 0x2001, 0xb3b3, 0x200c, + 0x8000, 0x2014, 0x2071, 0xb38e, 0x711a, 0x721e, 0x2001, 0x0064, + 0x080c, 0x68b3, 0x2001, 0xb3b6, 0x82ff, 0x1110, 0x2011, 0x0002, + 0x2202, 0x2009, 0xb3b7, 0xa280, 0x000a, 0x200a, 0x080c, 0x5193, + 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006, 0x00e6, + 0x2001, 0xb3b5, 0x2003, 0x0028, 0x2001, 0xb3b6, 0x2003, 0x0014, + 0x2071, 0xb38e, 0x701b, 0x0000, 0x701f, 0x07d0, 0x2001, 0xb3b7, + 0x2003, 0x001e, 0x00ee, 0x000e, 0x0005, 0x00d6, 0x6054, 0xa06d, + 0x0110, 0x080c, 0x15f4, 0x00de, 0x0005, 0x0005, 0x00c6, 0x0126, + 0x2091, 0x8000, 0x00c6, 0x080c, 0x8295, 0x001e, 0x0178, 0x611a, + 0x0ca1, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0033, 0x080c, + 0x831a, 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005, 0xa006, 0x0cd8, + 0x00d6, 0x00e6, 0x00f6, 0x2071, 0xb100, 0xa186, 0x0015, 0x1500, + 0x7080, 0xa086, 0x0018, 0x11e0, 0x6010, 0x2068, 0x6a3c, 0xd2e4, + 0x1160, 0x2c78, 0x080c, 0x705a, 0x01d8, 0x706c, 0x6a50, 0xa206, + 0x1160, 0x7070, 0x6a54, 0xa206, 0x1140, 0x6218, 0xa290, 0x0028, + 0x2214, 0x2009, 0x0000, 0x080c, 0x2bb8, 0x080c, 0x8469, 0x0020, + 0x080c, 0x8890, 0x080c, 0x82eb, 0x00fe, 0x00ee, 0x00de, 0x0005, + 0x7050, 0x6a54, 0xa206, 0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091, + 0x8000, 0x00c6, 0x080c, 0x8295, 0x001e, 0x0180, 0x611a, 0x080c, + 0x9c35, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0043, 0x080c, + 0x831a, 0xa085, 0x0001, 0x012e, 0x00ce, 0x0005, 0xa006, 0x0cd8, + 0x00d6, 0x00e6, 0x00f6, 0x2071, 0xb100, 0xa186, 0x0015, 0x11c0, + 0x7080, 0xa086, 0x0004, 0x11a0, 0x6010, 0xa0e8, 0x000f, 0x2c78, + 0x080c, 0x705a, 0x01a8, 0x706c, 0x6a08, 0xa206, 0x1130, 0x7070, + 0x6a0c, 0xa206, 0x1110, 0x080c, 0x2b73, 0x080c, 0x8469, 0x0020, + 0x080c, 0x8890, 0x080c, 0x82eb, 0x00fe, 0x00ee, 0x00de, 0x0005, + 0x7050, 0x6a0c, 0xa206, 0x0d78, 0x0c80, 0x0016, 0x0026, 0x684c, + 0xd0ac, 0x0178, 0x6914, 0x6a10, 0x2100, 0xa205, 0x0150, 0x6860, + 0xa106, 0x1118, 0x685c, 0xa206, 0x0120, 0x6962, 0x6a5e, 0xa085, + 0x0001, 0x002e, 0x001e, 0x0005, 0x00d6, 0x0036, 0x6310, 0x2368, + 0x684a, 0x6952, 0xa29e, 0x4000, 0x11a0, 0x00c6, 0x6318, 0x2360, + 0x2009, 0x0000, 0x6838, 0xd0f4, 0x1140, 0x080c, 0x50bc, 0x1108, + 0xc185, 0x6000, 0xd0bc, 0x0108, 0xc18d, 0x6a66, 0x696a, 0x00ce, + 0x0080, 0x6a66, 0x3918, 0xa398, 0x0006, 0x231c, 0x686b, 0x0004, + 0x6b72, 0x00c6, 0x6318, 0x2360, 0x6004, 0xa084, 0x00ff, 0x686e, + 0x00ce, 0x080c, 0x5271, 0x003e, 0x00de, 0x0005, 0x00c6, 0x0026, + 0x0016, 0xa186, 0x0035, 0x0110, 0x6a34, 0x0008, 0x6a28, 0x080c, + 0x985a, 0x01f0, 0x2260, 0x611c, 0xa186, 0x0003, 0x0118, 0xa186, + 0x0006, 0x1190, 0x6834, 0xa206, 0x0140, 0x6838, 0xa206, 0x1160, + 0x6108, 0x6834, 0xa106, 0x1140, 0x0020, 0x6008, 0x6938, 0xa106, + 0x1118, 0x6018, 0x6918, 0xa106, 0x001e, 0x002e, 0x00ce, 0x0005, + 0xa085, 0x0001, 0x0cc8, 0x0066, 0x6000, 0xa0b2, 0x0010, 0x1a0c, + 0x14fa, 0x0013, 0x006e, 0x0005, 0x9d5c, 0xa224, 0xa353, 0x9d5c, + 0x9d5c, 0x9d5c, 0x9d5c, 0x9d5c, 0x9d94, 0xa3cf, 0x9d5c, 0x9d5c, + 0x9d5c, 0x9d5c, 0x9d5c, 0x9d5c, 0x080c, 0x14fa, 0x0066, 0x6000, + 0xa0b2, 0x0010, 0x1a0c, 0x14fa, 0x0013, 0x006e, 0x0005, 0x9d77, + 0xa846, 0x9d77, 0x9d77, 0x9d77, 0x9d77, 0x9d77, 0x9d77, 0xa80a, + 0xa88e, 0x9d77, 0xae32, 0xae62, 0xae32, 0xae62, 0x9d77, 0x080c, + 0x14fa, 0x0066, 0x6000, 0xa0b2, 0x0010, 0x1a0c, 0x14fa, 0x0013, + 0x006e, 0x0005, 0x9d92, 0xa511, 0xa5de, 0xa60b, 0xa68f, 0x9d92, + 0xa77c, 0xa727, 0xa3db, 0xa7e0, 0xa7f5, 0x9d92, 0x9d92, 0x9d92, + 0x9d92, 0x9d92, 0x080c, 0x14fa, 0xa1b2, 0x0080, 0x1a0c, 0x14fa, + 0x2100, 0xa1b2, 0x0040, 0x1a04, 0xa198, 0x0002, 0x9dde, 0x9fa9, + 0x9dde, 0x9dde, 0x9dde, 0x9fb0, 0x9dde, 0x9dde, 0x9dde, 0x9dde, + 0x9dde, 0x9dde, 0x9dde, 0x9dde, 0x9dde, 0x9dde, 0x9dde, 0x9dde, + 0x9dde, 0x9dde, 0x9dde, 0x9dde, 0x9dde, 0x9de0, 0x9e3e, 0x9e4d, + 0x9e9b, 0x9eb9, 0x9f37, 0x9f96, 0x9dde, 0x9dde, 0x9fb3, 0x9dde, + 0x9dde, 0x9fc6, 0x9fd1, 0x9dde, 0x9dde, 0x9dde, 0x9dde, 0x9dde, + 0xa04d, 0x9dde, 0x9dde, 0xa05c, 0x9dde, 0x9dde, 0xa023, 0x9dde, + 0x9dde, 0x9dde, 0xa074, 0x9dde, 0x9dde, 0x9dde, 0xa0ee, 0x9dde, + 0x9dde, 0x9dde, 0x9dde, 0x9dde, 0x9dde, 0xa15f, 0x080c, 0x14fa, + 0x080c, 0x517b, 0x1150, 0x2001, 0xb134, 0x2004, 0xd0cc, 0x1128, + 0xa084, 0x0009, 0xa086, 0x0008, 0x1140, 0x6007, 0x0009, 0x602b, + 0x0009, 0x6013, 0x0000, 0x0804, 0x9fa4, 0x080c, 0x516b, 0x00e6, + 0x00c6, 0x0036, 0x0026, 0x0016, 0x6218, 0x2270, 0x72a0, 0x0026, + 0x2019, 0x0029, 0x080c, 0x6b35, 0x0076, 0x2039, 0x0000, 0x080c, + 0x6a6b, 0x2c08, 0x080c, 0xaa51, 0x007e, 0x001e, 0x2e60, 0x080c, + 0x501c, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, 0x6618, 0x00c6, + 0x2660, 0x080c, 0x4e30, 0x00ce, 0xa6b0, 0x0001, 0x2634, 0xa684, + 0x00ff, 0xa082, 0x0006, 0x0278, 0x080c, 0xa995, 0x1904, 0x9e95, + 0x080c, 0xa935, 0x1120, 0x6007, 0x0008, 0x0804, 0x9fa4, 0x6007, + 0x0009, 0x0804, 0x9fa4, 0x080c, 0xab41, 0x0128, 0x080c, 0xa995, + 0x0d78, 0x0804, 0x9e95, 0x6013, 0x1900, 0x0c88, 0x080c, 0x2c87, + 0x1904, 0xa195, 0x6106, 0x080c, 0xa8ef, 0x6007, 0x0006, 0x0804, + 0x9fa4, 0x6007, 0x0007, 0x0804, 0x9fa4, 0x080c, 0xae96, 0x1904, + 0xa195, 0x080c, 0x2c87, 0x1904, 0xa195, 0x00d6, 0x6618, 0x2668, + 0x6e04, 0xa684, 0x00ff, 0xa082, 0x0006, 0x1220, 0x2001, 0x0001, + 0x080c, 0x4d63, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0188, + 0xa686, 0x0004, 0x0170, 0x6e04, 0xa6b4, 0x00ff, 0xa686, 0x0006, + 0x0140, 0xa686, 0x0004, 0x0128, 0xa686, 0x0005, 0x0110, 0x00de, + 0x00e0, 0x080c, 0xa9f3, 0x11a0, 0xa686, 0x0006, 0x1150, 0x0026, + 0x6218, 0xa290, 0x0028, 0x2214, 0x2009, 0x0000, 0x080c, 0x2bb8, + 0x002e, 0x080c, 0x4ebf, 0x6007, 0x000a, 0x00de, 0x0804, 0x9fa4, + 0x6007, 0x000b, 0x00de, 0x0804, 0x9fa4, 0x080c, 0x2b73, 0x6007, + 0x0001, 0x0804, 0x9fa4, 0x080c, 0xae96, 0x1904, 0xa195, 0x080c, + 0x2c87, 0x1904, 0xa195, 0x6618, 0x00d6, 0x2668, 0x6e04, 0x00de, + 0xa686, 0x0707, 0x0d50, 0x0026, 0x6218, 0xa290, 0x0028, 0x2214, + 0x2009, 0x0000, 0x080c, 0x2bb8, 0x002e, 0x6007, 0x000c, 0x0804, + 0x9fa4, 0x080c, 0x517b, 0x1140, 0x2001, 0xb134, 0x2004, 0xa084, + 0x0009, 0xa086, 0x0008, 0x1110, 0x0804, 0x9ded, 0x080c, 0x516b, + 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, + 0x06e8, 0x1138, 0x0026, 0x2001, 0x0006, 0x080c, 0x4da2, 0x002e, + 0x0050, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0004, 0x0120, 0xa686, + 0x0006, 0x1904, 0x9e95, 0x080c, 0xaa00, 0x1120, 0x6007, 0x000e, + 0x0804, 0x9fa4, 0x0046, 0x6418, 0xa4a0, 0x0028, 0x2424, 0xa4a4, + 0x00ff, 0x8427, 0x0046, 0x080c, 0x2b73, 0x004e, 0x0016, 0xa006, + 0x2009, 0xb153, 0x210c, 0xd1a4, 0x0158, 0x2009, 0x0029, 0x080c, + 0xacae, 0x6018, 0x00d6, 0x2068, 0x6800, 0xc0e5, 0x6802, 0x00de, + 0x001e, 0x004e, 0x6007, 0x0001, 0x0804, 0x9fa4, 0x2001, 0x0001, + 0x080c, 0x4d63, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, + 0x2019, 0xb105, 0x2011, 0xb690, 0x080c, 0x8d2b, 0x003e, 0x002e, + 0x001e, 0x015e, 0xa005, 0x0168, 0xa6b4, 0xff00, 0x8637, 0xa682, + 0x0004, 0x0a04, 0x9e95, 0xa682, 0x0007, 0x0a04, 0x9ee3, 0x0804, + 0x9e95, 0x6013, 0x1900, 0x6007, 0x0009, 0x0804, 0x9fa4, 0x080c, + 0x517b, 0x1140, 0x2001, 0xb134, 0x2004, 0xa084, 0x0009, 0xa086, + 0x0008, 0x1110, 0x0804, 0x9ded, 0x080c, 0x516b, 0x6618, 0xa6b0, + 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x06b8, 0xa6b4, + 0xff00, 0x8637, 0xa686, 0x0004, 0x0120, 0xa686, 0x0006, 0x1904, + 0x9e95, 0x080c, 0xaa28, 0x1138, 0x080c, 0xa935, 0x1120, 0x6007, + 0x0010, 0x0804, 0x9fa4, 0x0046, 0x6418, 0xa4a0, 0x0028, 0x2424, + 0xa4a4, 0x00ff, 0x8427, 0x0046, 0x080c, 0x2b73, 0x004e, 0x0016, + 0xa006, 0x2009, 0xb153, 0x210c, 0xd1a4, 0x0158, 0x2009, 0x0029, + 0x080c, 0xacae, 0x6018, 0x00d6, 0x2068, 0x6800, 0xc0e5, 0x6802, + 0x00de, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c, 0xab41, + 0x0140, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0950, 0x0804, + 0x9e95, 0x6013, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c, 0x2c87, + 0x1904, 0xa195, 0x080c, 0xae96, 0x1904, 0xa195, 0x080c, 0xa1bd, + 0x1904, 0x9e95, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c, 0x6a3c, + 0x0005, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x6a3c, 0x0cc0, + 0x6007, 0x0005, 0x0cc0, 0x080c, 0xae96, 0x1904, 0xa195, 0x080c, + 0x2c87, 0x1904, 0xa195, 0x080c, 0xa1bd, 0x1904, 0x9e95, 0x6007, + 0x0020, 0x6003, 0x0001, 0x080c, 0x6a3c, 0x0005, 0x080c, 0x2c87, + 0x1904, 0xa195, 0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x6a3c, + 0x0005, 0x080c, 0xae96, 0x1904, 0xa195, 0x080c, 0x2c87, 0x1904, + 0xa195, 0x080c, 0xa1bd, 0x1904, 0x9e95, 0x0016, 0x0026, 0x2011, + 0xb691, 0x2214, 0xa286, 0xffff, 0x0190, 0x2c08, 0x080c, 0x985a, + 0x01e0, 0x2260, 0x2011, 0xb690, 0x2214, 0x6008, 0xa206, 0x11a8, + 0x6018, 0xa190, 0x0006, 0x2214, 0xa206, 0x01e8, 0x0070, 0x2011, + 0xb690, 0x2214, 0x2c08, 0xa006, 0x080c, 0xac80, 0x11a0, 0x2011, + 0xb691, 0x2214, 0xa286, 0xffff, 0x01a0, 0x2160, 0x6007, 0x0026, + 0x6013, 0x1700, 0x2011, 0xb689, 0x2214, 0xa296, 0xffff, 0x1160, + 0x6007, 0x0025, 0x0048, 0x601c, 0xa086, 0x0007, 0x1d70, 0x080c, + 0x82eb, 0x2160, 0x6007, 0x0025, 0x6003, 0x0001, 0x080c, 0x6a3c, + 0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x4d63, 0x0156, + 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0xb105, 0x2011, + 0xb696, 0x080c, 0x8d2b, 0x003e, 0x002e, 0x001e, 0x015e, 0x0120, + 0x6007, 0x0031, 0x0804, 0x9fa4, 0x080c, 0x8a69, 0x080c, 0x58d5, + 0x1158, 0x0006, 0x0026, 0x0036, 0x080c, 0x58f1, 0x0110, 0x080c, + 0x58ac, 0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x2c87, 0x1904, + 0xa195, 0x6106, 0x080c, 0xa1d9, 0x6007, 0x002b, 0x0804, 0x9fa4, + 0x6007, 0x002c, 0x0804, 0x9fa4, 0x080c, 0xae96, 0x1904, 0xa195, + 0x080c, 0x2c87, 0x1904, 0xa195, 0x080c, 0xa1bd, 0x1904, 0x9e95, + 0x6106, 0x080c, 0xa1dd, 0x1120, 0x6007, 0x002e, 0x0804, 0x9fa4, + 0x6007, 0x002f, 0x0804, 0x9fa4, 0x080c, 0x2c87, 0x1904, 0xa195, + 0x00e6, 0x00d6, 0x00c6, 0x6018, 0xa080, 0x0001, 0x200c, 0xa184, + 0x00ff, 0xa086, 0x0006, 0x0158, 0xa184, 0xff00, 0x8007, 0xa086, + 0x0006, 0x0128, 0x00ce, 0x00de, 0x00ee, 0x0804, 0x9fa9, 0x2001, + 0xb172, 0x2004, 0xd0e4, 0x0904, 0xa0eb, 0x2071, 0xb68c, 0x7010, + 0x6036, 0x7014, 0x603a, 0x7108, 0x720c, 0x2001, 0xb153, 0x2004, + 0xd0a4, 0x0140, 0x6018, 0x2068, 0x6810, 0xa106, 0x1118, 0x6814, + 0xa206, 0x01f8, 0x2001, 0xb153, 0x2004, 0xd0ac, 0x1590, 0x2069, + 0xb100, 0x6870, 0xa206, 0x1568, 0x686c, 0xa106, 0x1550, 0x7210, + 0x080c, 0x985a, 0x0558, 0x080c, 0xad1a, 0x0540, 0x622a, 0x6007, + 0x0036, 0x6003, 0x0001, 0x080c, 0x69f6, 0x00ce, 0x00de, 0x00ee, + 0x0005, 0x7214, 0xa286, 0xffff, 0x0150, 0x080c, 0x985a, 0x01b0, + 0xa280, 0x0002, 0x2004, 0x7110, 0xa106, 0x1180, 0x0c08, 0x7210, + 0x2c08, 0xa085, 0x0001, 0x080c, 0xac80, 0x2c10, 0x2160, 0x0130, + 0x08b8, 0x6007, 0x0037, 0x6013, 0x1500, 0x08d8, 0x6007, 0x0037, + 0x6013, 0x1700, 0x08b0, 0x6007, 0x0012, 0x0898, 0x080c, 0x2c87, + 0x1904, 0xa195, 0x6018, 0xa080, 0x0001, 0x2004, 0xa084, 0xff00, + 0x8007, 0xa086, 0x0006, 0x1904, 0x9fa9, 0x00e6, 0x00d6, 0x00c6, + 0x2001, 0xb172, 0x2004, 0xd0e4, 0x0904, 0xa157, 0x2069, 0xb100, + 0x2071, 0xb68c, 0x7008, 0x6036, 0x720c, 0x623a, 0xa286, 0xffff, + 0x1150, 0x7208, 0x00c6, 0x2c08, 0xa085, 0x0001, 0x080c, 0xac80, + 0x2c10, 0x00ce, 0x0588, 0x080c, 0x985a, 0x0570, 0x00c6, 0x0026, + 0x2260, 0x080c, 0x954f, 0x002e, 0x00ce, 0x7118, 0xa18c, 0xff00, + 0x810f, 0xa186, 0x0001, 0x0158, 0xa186, 0x0005, 0x0118, 0xa186, + 0x0007, 0x1178, 0xa280, 0x0004, 0x2004, 0xa005, 0x0150, 0x0056, + 0x7510, 0x7614, 0x080c, 0xad31, 0x005e, 0x00ce, 0x00de, 0x00ee, + 0x0005, 0x6007, 0x003b, 0x602b, 0x0009, 0x6013, 0x2a00, 0x6003, + 0x0001, 0x080c, 0x69f6, 0x0c88, 0x6007, 0x003b, 0x602b, 0x0009, + 0x6013, 0x1700, 0x6003, 0x0001, 0x080c, 0x69f6, 0x0c30, 0x6007, + 0x003b, 0x602b, 0x000b, 0x6013, 0x0000, 0x0804, 0xa0c1, 0x00e6, + 0x0026, 0x080c, 0x517b, 0x0558, 0x080c, 0x516b, 0x080c, 0xaf11, + 0x1520, 0x2071, 0xb100, 0x70d0, 0xc085, 0x70d2, 0x00f6, 0x2079, + 0x0100, 0x729c, 0xa284, 0x00ff, 0x706e, 0x78e6, 0xa284, 0xff00, + 0x7270, 0xa205, 0x7072, 0x78ea, 0x00fe, 0x70db, 0x0000, 0x2001, + 0xb153, 0x2004, 0xd0a4, 0x0120, 0x2011, 0xb3f2, 0x2013, 0x07d0, + 0xd0ac, 0x1128, 0x080c, 0x2991, 0x0010, 0x080c, 0xaf3d, 0x002e, + 0x00ee, 0x080c, 0x82eb, 0x0804, 0x9fa8, 0x080c, 0x82eb, 0x0005, + 0x2600, 0x0002, 0xa1a3, 0xa1a3, 0xa1a3, 0xa1a3, 0xa1a3, 0xa1a5, + 0xa1a3, 0xa1a3, 0xa1a3, 0x080c, 0x14fa, 0x080c, 0xae96, 0x1d68, + 0x080c, 0x2c87, 0x1d50, 0x0089, 0x1138, 0x6007, 0x0045, 0x6003, + 0x0001, 0x080c, 0x6a3c, 0x0005, 0x080c, 0x2b73, 0x6007, 0x0001, + 0x6003, 0x0001, 0x080c, 0x6a3c, 0x0005, 0x00d6, 0x0066, 0x6618, + 0x2668, 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0170, + 0xa686, 0x0004, 0x0158, 0x6e04, 0xa6b4, 0x00ff, 0xa686, 0x0006, + 0x0128, 0xa686, 0x0004, 0x0110, 0xa085, 0x0001, 0x006e, 0x00de, + 0x0005, 0x00d6, 0x0449, 0x00de, 0x0005, 0x00d6, 0x0491, 0x11f0, + 0x680c, 0xa08c, 0xff00, 0x6820, 0xa084, 0x00ff, 0xa115, 0x6212, + 0x6824, 0x602a, 0xd1e4, 0x0118, 0x2009, 0x0001, 0x0060, 0xd1ec, + 0x0168, 0x6920, 0xa18c, 0x00ff, 0x6824, 0x080c, 0x26f6, 0x1130, + 0x2110, 0x2009, 0x0000, 0x080c, 0x2bb8, 0x0018, 0xa085, 0x0001, + 0x0008, 0xa006, 0x00de, 0x0005, 0x2069, 0xb68d, 0x6800, 0xa082, + 0x0010, 0x1228, 0x6013, 0x0000, 0xa085, 0x0001, 0x0008, 0xa006, + 0x0005, 0x6013, 0x0000, 0x2069, 0xb68c, 0x6808, 0xa084, 0xff00, + 0xa086, 0x0800, 0x1140, 0x6800, 0xa084, 0x00ff, 0xa08e, 0x0014, + 0x0110, 0xa08e, 0x0010, 0x0005, 0x6004, 0xa0b2, 0x0080, 0x1a0c, + 0x14fa, 0xa1b6, 0x0013, 0x1130, 0x2008, 0xa1b2, 0x0040, 0x1a04, + 0xa324, 0x0092, 0xa1b6, 0x0027, 0x0120, 0xa1b6, 0x0014, 0x190c, + 0x14fa, 0x2001, 0x0007, 0x080c, 0x4da2, 0x080c, 0x6dc1, 0x080c, + 0x9a2b, 0x080c, 0x6e9e, 0x0005, 0xa284, 0xa286, 0xa284, 0xa284, + 0xa284, 0xa286, 0xa298, 0xa31d, 0xa2e8, 0xa31d, 0xa2f9, 0xa31d, + 0xa298, 0xa31d, 0xa315, 0xa31d, 0xa315, 0xa31d, 0xa31d, 0xa284, + 0xa284, 0xa284, 0xa284, 0xa284, 0xa284, 0xa284, 0xa284, 0xa284, + 0xa284, 0xa284, 0xa286, 0xa284, 0xa31d, 0xa284, 0xa284, 0xa31d, + 0xa284, 0xa31a, 0xa31d, 0xa284, 0xa284, 0xa284, 0xa284, 0xa31d, + 0xa31d, 0xa284, 0xa31d, 0xa31d, 0xa284, 0xa292, 0xa284, 0xa284, + 0xa284, 0xa284, 0xa319, 0xa31d, 0xa284, 0xa284, 0xa31d, 0xa31d, + 0xa284, 0xa284, 0xa284, 0xa284, 0x080c, 0x14fa, 0x080c, 0x6dc1, + 0x2001, 0xb3b5, 0x2004, 0x6016, 0x6003, 0x0002, 0x080c, 0x6e9e, + 0x0804, 0xa323, 0x2001, 0x0000, 0x080c, 0x4d63, 0x0804, 0xa31d, + 0x00f6, 0x2079, 0xb152, 0x7804, 0x00fe, 0xd0ac, 0x1904, 0xa31d, + 0x2001, 0x0000, 0x080c, 0x4d63, 0x6018, 0xa080, 0x0004, 0x2004, + 0xa086, 0x00ff, 0x1140, 0x00f6, 0x2079, 0xb100, 0x7894, 0x8000, + 0x7896, 0x00fe, 0x00e0, 0x00c6, 0x6018, 0x2060, 0x6000, 0xd0f4, + 0x1140, 0x6010, 0xa005, 0x0128, 0x00ce, 0x080c, 0x3dcd, 0x0804, + 0xa31d, 0x00ce, 0x2001, 0xb100, 0x2004, 0xa086, 0x0002, 0x1138, + 0x00f6, 0x2079, 0xb100, 0x7894, 0x8000, 0x7896, 0x00fe, 0x2001, + 0x0002, 0x080c, 0x4d75, 0x080c, 0x6dc1, 0x601f, 0x0001, 0x6003, + 0x0001, 0x6007, 0x0002, 0x080c, 0x6a3c, 0x080c, 0x6e9e, 0x00c6, + 0x6118, 0x2160, 0x2009, 0x0001, 0x080c, 0x674e, 0x00ce, 0x04d8, + 0x6618, 0x00d6, 0x2668, 0x6e04, 0x00de, 0xa6b4, 0xff00, 0x8637, + 0xa686, 0x0006, 0x0550, 0xa686, 0x0004, 0x0538, 0x2001, 0x0004, + 0x0410, 0x2001, 0xb100, 0x2004, 0xa086, 0x0003, 0x1110, 0x080c, + 0x3dcd, 0x2001, 0x0006, 0x04a1, 0x6618, 0x00d6, 0x2668, 0x6e04, + 0x00de, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0170, 0x2001, + 0x0006, 0x0048, 0x2001, 0x0004, 0x0030, 0x2001, 0x0006, 0x0401, + 0x0020, 0x0018, 0x0010, 0x080c, 0x4da2, 0x080c, 0x6dc1, 0x080c, + 0x82eb, 0x080c, 0x6e9e, 0x0005, 0x2600, 0x0002, 0xa32f, 0xa32f, + 0xa32f, 0xa32f, 0xa32f, 0xa331, 0xa32f, 0xa32f, 0xa32f, 0x080c, + 0x14fa, 0x080c, 0x6dc1, 0x080c, 0x82eb, 0x080c, 0x6e9e, 0x0005, + 0x0016, 0x00d6, 0x6118, 0x2168, 0x6900, 0xd184, 0x0188, 0x6104, + 0xa18e, 0x000a, 0x1128, 0x699c, 0xd1a4, 0x1110, 0x2001, 0x0007, + 0x080c, 0x4d75, 0x2001, 0x0000, 0x080c, 0x4d63, 0x080c, 0x2b99, + 0x00de, 0x001e, 0x0005, 0x00d6, 0x6618, 0x2668, 0x6804, 0xa084, + 0xff00, 0x8007, 0x00de, 0xa0b2, 0x000c, 0x1a0c, 0x14fa, 0xa1b6, + 0x0015, 0x1110, 0x003b, 0x0028, 0xa1b6, 0x0016, 0x190c, 0x14fa, + 0x006b, 0x0005, 0x8956, 0x8956, 0x8956, 0x8956, 0x8956, 0x8956, + 0xa3bb, 0xa382, 0x8956, 0x8956, 0x8956, 0x8956, 0x8956, 0x8956, + 0x8956, 0x8956, 0x8956, 0x8956, 0xa3bb, 0xa3c2, 0x8956, 0x8956, + 0x8956, 0x8956, 0x00f6, 0x2079, 0xb152, 0x7804, 0xd0ac, 0x11e0, + 0x6018, 0xa07d, 0x01c8, 0x7800, 0xd0f4, 0x1118, 0x7810, 0xa005, + 0x1198, 0x2001, 0x0000, 0x080c, 0x4d63, 0x2001, 0x0002, 0x080c, + 0x4d75, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, + 0x6a3c, 0x080c, 0x6e9e, 0x00a8, 0x2011, 0xb683, 0x2204, 0x8211, + 0x220c, 0x080c, 0x26f6, 0x1168, 0x00c6, 0x080c, 0x4e21, 0x0120, + 0x00ce, 0x080c, 0x82eb, 0x0028, 0x080c, 0x4a80, 0x00ce, 0x080c, + 0x82eb, 0x00fe, 0x0005, 0x6604, 0xa6b6, 0x001e, 0x1110, 0x080c, + 0x82eb, 0x0005, 0x080c, 0x8bea, 0x1138, 0x6003, 0x0001, 0x6007, + 0x0001, 0x080c, 0x6a3c, 0x0010, 0x080c, 0x82eb, 0x0005, 0x6004, + 0xa08a, 0x0080, 0x1a0c, 0x14fa, 0x080c, 0x6dc1, 0x080c, 0x9a2b, + 0x080c, 0x6e9e, 0x0005, 0xa182, 0x0040, 0x0002, 0xa3f1, 0xa3f1, + 0xa3f1, 0xa3f1, 0xa3f3, 0xa3f1, 0xa3f1, 0xa3f1, 0xa3f1, 0xa3f1, + 0xa3f1, 0xa3f1, 0xa3f1, 0xa3f1, 0xa3f1, 0xa3f1, 0xa3f1, 0xa3f1, + 0xa3f1, 0x080c, 0x14fa, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0046, + 0x0026, 0x6218, 0xa280, 0x002b, 0x2004, 0xa005, 0x0120, 0x2021, + 0x0000, 0x080c, 0xaee2, 0x6106, 0x2071, 0xb680, 0x7444, 0xa4a4, + 0xff00, 0x0904, 0xa457, 0xa486, 0x2000, 0x1130, 0x2009, 0x0001, + 0x2011, 0x0200, 0x080c, 0x688d, 0x080c, 0x15dd, 0x090c, 0x14fa, + 0x6003, 0x0007, 0x2d00, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, + 0x0000, 0x6c5a, 0x2c00, 0x685e, 0x6008, 0x68b2, 0x6018, 0x2078, + 0x78a0, 0x8007, 0x7130, 0x694a, 0x0016, 0xa084, 0xff00, 0x6846, + 0x684f, 0x0000, 0x6853, 0x0000, 0x6857, 0x0036, 0x080c, 0x5271, + 0x001e, 0xa486, 0x2000, 0x1130, 0x2019, 0x0017, 0x080c, 0xac2b, + 0x0804, 0xa4b4, 0xa486, 0x0400, 0x1130, 0x2019, 0x0002, 0x080c, + 0xabdd, 0x0804, 0xa4b4, 0xa486, 0x0200, 0x1110, 0x080c, 0xabc2, + 0xa486, 0x1000, 0x1110, 0x080c, 0xac10, 0x0804, 0xa4b4, 0x2069, + 0xb464, 0x6a00, 0xd284, 0x0904, 0xa50d, 0xa284, 0x0300, 0x1904, + 0xa506, 0x6804, 0xa005, 0x0904, 0xa4ee, 0x2d78, 0x6003, 0x0007, + 0x080c, 0x15c4, 0x0904, 0xa4bb, 0x7800, 0xd08c, 0x1118, 0x7804, + 0x8001, 0x7806, 0x6013, 0x0000, 0x6803, 0x0000, 0x6837, 0x0116, + 0x683b, 0x0000, 0x6008, 0x68b2, 0x2c00, 0x684a, 0x6018, 0x2078, + 0x78a0, 0x8007, 0x7130, 0x6986, 0x6846, 0x7928, 0x698a, 0x792c, + 0x698e, 0x7930, 0x6992, 0x7934, 0x6996, 0x6853, 0x003d, 0x7244, + 0xa294, 0x0003, 0xa286, 0x0002, 0x1118, 0x684f, 0x0040, 0x0040, + 0xa286, 0x0001, 0x1118, 0x684f, 0x0080, 0x0010, 0x684f, 0x0000, + 0x20a9, 0x000a, 0x2001, 0xb690, 0xad90, 0x0015, 0x200c, 0x810f, + 0x2112, 0x8000, 0x8210, 0x1f04, 0xa4a6, 0x200c, 0x6982, 0x8000, + 0x200c, 0x697e, 0x080c, 0x5271, 0x002e, 0x004e, 0x015e, 0x00fe, + 0x00ee, 0x00de, 0x0005, 0x6013, 0x0100, 0x6003, 0x0001, 0x6007, + 0x0041, 0x080c, 0x69f6, 0x080c, 0x6e9e, 0x0c70, 0x2069, 0xb692, + 0x2d04, 0xa084, 0xff00, 0xa086, 0x1200, 0x11a8, 0x2069, 0xb680, + 0x686c, 0xa084, 0x00ff, 0x0016, 0x6110, 0xa18c, 0x0700, 0xa10d, + 0x6112, 0x001e, 0x6003, 0x0001, 0x6007, 0x0043, 0x080c, 0x69f6, + 0x080c, 0x6e9e, 0x0888, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007, + 0x0041, 0x080c, 0x69f6, 0x080c, 0x6e9e, 0x0830, 0x2001, 0xb10d, + 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x3d5b, 0x6013, + 0x0300, 0x0010, 0x6013, 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, + 0x080c, 0x69f6, 0x080c, 0x6e9e, 0x0804, 0xa4b4, 0x6013, 0x0500, + 0x0c98, 0x6013, 0x0600, 0x0804, 0xa4c6, 0x6013, 0x0200, 0x0804, + 0xa4c6, 0xa186, 0x0013, 0x1170, 0x6004, 0xa08a, 0x0040, 0x0a0c, + 0x14fa, 0xa08a, 0x0053, 0x1a0c, 0x14fa, 0xa082, 0x0040, 0x2008, + 0x0804, 0xa59b, 0xa186, 0x0051, 0x0138, 0xa186, 0x0047, 0x11d8, + 0x6004, 0xa086, 0x0041, 0x0518, 0x2001, 0x0109, 0x2004, 0xd084, + 0x01f0, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x080c, + 0x68e7, 0x002e, 0x001e, 0x000e, 0x012e, 0x6000, 0xa086, 0x0002, + 0x1170, 0x0804, 0xa5de, 0xa186, 0x0027, 0x0120, 0xa186, 0x0014, + 0x190c, 0x14fa, 0x6004, 0xa082, 0x0040, 0x2008, 0x001a, 0x080c, + 0x8331, 0x0005, 0xa565, 0xa567, 0xa567, 0xa58b, 0xa565, 0xa565, + 0xa565, 0xa565, 0xa565, 0xa565, 0xa565, 0xa565, 0xa565, 0xa565, + 0xa565, 0xa565, 0xa565, 0xa565, 0xa565, 0x080c, 0x14fa, 0x080c, + 0x6dc1, 0x080c, 0x6e9e, 0x0036, 0x00d6, 0x6010, 0xa06d, 0x01c0, + 0xad84, 0xf000, 0x01a8, 0x6003, 0x0002, 0x6018, 0x2004, 0xd0bc, + 0x1178, 0x2019, 0x0004, 0x080c, 0xac5f, 0x6013, 0x0000, 0x6014, + 0xa005, 0x1120, 0x2001, 0xb3b6, 0x2004, 0x6016, 0x6003, 0x0007, + 0x00de, 0x003e, 0x0005, 0x00d6, 0x080c, 0x6dc1, 0x080c, 0x6e9e, + 0x080c, 0x986a, 0x0120, 0x6010, 0x2068, 0x080c, 0x15f4, 0x080c, + 0x9a2b, 0x00de, 0x0005, 0x0002, 0xa5af, 0xa5cc, 0xa5b8, 0xa5d8, + 0xa5af, 0xa5af, 0xa5af, 0xa5af, 0xa5af, 0xa5af, 0xa5af, 0xa5af, + 0xa5af, 0xa5af, 0xa5af, 0xa5af, 0xa5af, 0xa5af, 0xa5af, 0x080c, + 0x14fa, 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, + 0x080c, 0x6dc1, 0x6010, 0xa080, 0x0013, 0x2004, 0xd0b4, 0x0138, + 0x6003, 0x0007, 0x2009, 0x0043, 0x080c, 0x831a, 0x0010, 0x6003, + 0x0002, 0x080c, 0x6e9e, 0x0005, 0x080c, 0x6dc1, 0x080c, 0xae9d, + 0x1120, 0x080c, 0x6866, 0x080c, 0x82eb, 0x080c, 0x6e9e, 0x0005, + 0x080c, 0x6dc1, 0x2009, 0x0041, 0x0804, 0xa727, 0xa182, 0x0040, + 0x0002, 0xa5f4, 0xa5f6, 0xa5f4, 0xa5f4, 0xa5f4, 0xa5f4, 0xa5f4, + 0xa5f7, 0xa5f4, 0xa5f4, 0xa5f4, 0xa5f4, 0xa5f4, 0xa5f4, 0xa5f4, + 0xa5f4, 0xa5f4, 0xa602, 0xa5f4, 0x080c, 0x14fa, 0x0005, 0x6003, + 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x080c, + 0x1828, 0x0005, 0x00d6, 0x080c, 0x6866, 0x00de, 0x080c, 0xaf00, + 0x080c, 0x82eb, 0x0005, 0xa182, 0x0040, 0x0002, 0xa621, 0xa621, + 0xa621, 0xa621, 0xa621, 0xa621, 0xa621, 0xa623, 0xa621, 0xa626, + 0xa65f, 0xa621, 0xa621, 0xa621, 0xa621, 0xa65f, 0xa621, 0xa621, + 0xa621, 0x080c, 0x14fa, 0x080c, 0x8331, 0x0005, 0x2001, 0xb172, + 0x2004, 0xd0e4, 0x0158, 0x2001, 0x0100, 0x2004, 0xa082, 0x0005, + 0x0228, 0x2001, 0x011f, 0x2004, 0x6036, 0x0010, 0x6037, 0x0000, + 0x080c, 0x6e53, 0x080c, 0x6f5b, 0x6010, 0x00d6, 0x2068, 0x684c, + 0xd0fc, 0x0150, 0xa08c, 0x0003, 0xa18e, 0x0002, 0x0168, 0x2009, + 0x0041, 0x00de, 0x0804, 0xa727, 0x6003, 0x0007, 0x6017, 0x0000, + 0x080c, 0x6866, 0x00de, 0x0005, 0x080c, 0xae9d, 0x0110, 0x00de, + 0x0005, 0x080c, 0x6866, 0x080c, 0x82eb, 0x00de, 0x0ca0, 0x0036, + 0x080c, 0x6e53, 0x080c, 0x6f5b, 0x6010, 0x00d6, 0x2068, 0x6018, + 0x2004, 0xd0bc, 0x0188, 0x684c, 0xa084, 0x0003, 0xa086, 0x0002, + 0x0140, 0x687c, 0x632c, 0xa31a, 0x632e, 0x6880, 0x6328, 0xa31b, + 0x632a, 0x6003, 0x0002, 0x0080, 0x2019, 0x0004, 0x080c, 0xac5f, + 0x6014, 0xa005, 0x1128, 0x2001, 0xb3b6, 0x2004, 0x8003, 0x6016, + 0x6013, 0x0000, 0x6003, 0x0007, 0x00de, 0x003e, 0x0005, 0xa186, + 0x0013, 0x1150, 0x6004, 0xa086, 0x0042, 0x190c, 0x14fa, 0x080c, + 0x6dc1, 0x080c, 0x6e9e, 0x0005, 0xa186, 0x0027, 0x0118, 0xa186, + 0x0014, 0x1180, 0x6004, 0xa086, 0x0042, 0x190c, 0x14fa, 0x2001, + 0x0007, 0x080c, 0x4da2, 0x080c, 0x6dc1, 0x080c, 0x9a2b, 0x080c, + 0x6e9e, 0x0005, 0xa182, 0x0040, 0x0002, 0xa6c8, 0xa6c8, 0xa6c8, + 0xa6c8, 0xa6c8, 0xa6c8, 0xa6c8, 0xa6ca, 0xa6d6, 0xa6c8, 0xa6c8, + 0xa6c8, 0xa6c8, 0xa6c8, 0xa6c8, 0xa6c8, 0xa6c8, 0xa6c8, 0xa6c8, + 0x080c, 0x14fa, 0x0036, 0x0046, 0x20e1, 0x0005, 0x3d18, 0x3e20, + 0x2c10, 0x080c, 0x1828, 0x004e, 0x003e, 0x0005, 0x6010, 0x00d6, + 0x2068, 0x6810, 0x6a14, 0x0006, 0x0046, 0x0056, 0x6c7c, 0xa422, + 0x6d80, 0x2200, 0xa52b, 0x602c, 0xa420, 0x642e, 0x6028, 0xa529, + 0x652a, 0x005e, 0x004e, 0x000e, 0xa20d, 0x1178, 0x684c, 0xd0fc, + 0x0120, 0x2009, 0x0041, 0x00de, 0x0490, 0x6003, 0x0007, 0x6017, + 0x0000, 0x080c, 0x6866, 0x00de, 0x0005, 0x0006, 0x00f6, 0x2c78, + 0x080c, 0x5177, 0x00fe, 0x000e, 0x0120, 0x6003, 0x0002, 0x00de, + 0x0005, 0x2009, 0xb10d, 0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, + 0x0010, 0x6003, 0x0006, 0x0021, 0x080c, 0x6868, 0x00de, 0x0005, + 0xd2fc, 0x0140, 0x8002, 0x8000, 0x8212, 0xa291, 0x0000, 0x2009, + 0x0009, 0x0010, 0x2009, 0x0015, 0x6a6a, 0x6866, 0x0005, 0xa182, + 0x0040, 0x0208, 0x0062, 0xa186, 0x0013, 0x0120, 0xa186, 0x0014, + 0x190c, 0x14fa, 0x6020, 0xd0dc, 0x090c, 0x14fa, 0x0005, 0xa74a, + 0xa751, 0xa75d, 0xa769, 0xa74a, 0xa74a, 0xa74a, 0xa778, 0xa74a, + 0xa74c, 0xa74c, 0xa74a, 0xa74a, 0xa74a, 0xa74a, 0xa74c, 0xa74a, + 0xa74c, 0xa74a, 0x080c, 0x14fa, 0x6020, 0xd0dc, 0x090c, 0x14fa, + 0x0005, 0x6003, 0x0001, 0x6106, 0x080c, 0x69f6, 0x0126, 0x2091, + 0x8000, 0x080c, 0x6e9e, 0x012e, 0x0005, 0x6003, 0x0001, 0x6106, + 0x080c, 0x69f6, 0x0126, 0x2091, 0x8000, 0x080c, 0x6e9e, 0x012e, + 0x0005, 0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1ec4, 0x0126, + 0x2091, 0x8000, 0x080c, 0x6a59, 0x080c, 0x6f5b, 0x012e, 0x0005, + 0xa016, 0x080c, 0x1828, 0x0005, 0x0126, 0x2091, 0x8000, 0x0036, + 0x00d6, 0xa182, 0x0040, 0x0023, 0x00de, 0x003e, 0x012e, 0x0005, + 0xa798, 0xa79a, 0xa7ac, 0xa7c7, 0xa798, 0xa798, 0xa798, 0xa7dc, + 0xa798, 0xa798, 0xa798, 0xa798, 0xa798, 0xa798, 0xa798, 0xa798, + 0x080c, 0x14fa, 0x6010, 0x2068, 0x684c, 0xd0fc, 0x01f8, 0xa09c, + 0x0003, 0xa39e, 0x0003, 0x01d0, 0x6003, 0x0001, 0x6106, 0x080c, + 0x69f6, 0x080c, 0x6e9e, 0x0498, 0x6010, 0x2068, 0x684c, 0xd0fc, + 0x0168, 0xa09c, 0x0003, 0xa39e, 0x0003, 0x0140, 0x6003, 0x0001, + 0x6106, 0x080c, 0x69f6, 0x080c, 0x6e9e, 0x0408, 0x6013, 0x0000, + 0x6017, 0x0000, 0x2019, 0x0004, 0x080c, 0xac5f, 0x00c0, 0x6010, + 0x2068, 0x684c, 0xd0fc, 0x0d90, 0xa09c, 0x0003, 0xa39e, 0x0003, + 0x0d68, 0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1ec4, 0x080c, + 0x6a59, 0x080c, 0x6f5b, 0x0018, 0xa016, 0x080c, 0x1828, 0x0005, + 0x080c, 0x6dc1, 0x6110, 0x81ff, 0x0158, 0x00d6, 0x2168, 0x080c, + 0xaf46, 0x0036, 0x2019, 0x0029, 0x080c, 0xac5f, 0x003e, 0x00de, + 0x080c, 0x9a2b, 0x080c, 0x6e9e, 0x0005, 0x080c, 0x6e53, 0x6110, + 0x81ff, 0x0158, 0x00d6, 0x2168, 0x080c, 0xaf46, 0x0036, 0x2019, + 0x0029, 0x080c, 0xac5f, 0x003e, 0x00de, 0x080c, 0x9a2b, 0x080c, + 0x6f5b, 0x0005, 0xa182, 0x0085, 0x0002, 0xa816, 0xa814, 0xa814, + 0xa822, 0xa814, 0xa814, 0xa814, 0x080c, 0x14fa, 0x6003, 0x000b, + 0x6106, 0x080c, 0x69f6, 0x0126, 0x2091, 0x8000, 0x080c, 0x6e9e, + 0x012e, 0x0005, 0x0026, 0x00e6, 0x080c, 0xae96, 0x0118, 0x080c, + 0x82eb, 0x00c8, 0x2071, 0xb680, 0x7224, 0x6212, 0x7220, 0x080c, + 0xab0d, 0x0118, 0x6007, 0x0086, 0x0040, 0x6007, 0x0087, 0x7224, + 0xa296, 0xffff, 0x1110, 0x6007, 0x0086, 0x6003, 0x0001, 0x080c, + 0x69f6, 0x080c, 0x6e9e, 0x00ee, 0x002e, 0x0005, 0xa186, 0x0013, + 0x1160, 0x6004, 0xa08a, 0x0085, 0x0a0c, 0x14fa, 0xa08a, 0x008c, + 0x1a0c, 0x14fa, 0xa082, 0x0085, 0x00a2, 0xa186, 0x0027, 0x0130, + 0xa186, 0x0014, 0x0118, 0x080c, 0x8331, 0x0050, 0x2001, 0x0007, + 0x080c, 0x4da2, 0x080c, 0x6dc1, 0x080c, 0x9a2b, 0x080c, 0x6e9e, + 0x0005, 0xa870, 0xa872, 0xa872, 0xa870, 0xa870, 0xa870, 0xa870, + 0x080c, 0x14fa, 0x080c, 0x6dc1, 0x080c, 0x9a2b, 0x080c, 0x6e9e, + 0x0005, 0xa182, 0x0085, 0x0a0c, 0x14fa, 0xa182, 0x008c, 0x1a0c, + 0x14fa, 0xa182, 0x0085, 0x0002, 0xa88b, 0xa88b, 0xa88b, 0xa88d, + 0xa88b, 0xa88b, 0xa88b, 0x080c, 0x14fa, 0x0005, 0xa186, 0x0013, + 0x0148, 0xa186, 0x0014, 0x0130, 0xa186, 0x0027, 0x0118, 0x080c, + 0x8331, 0x0030, 0x080c, 0x6dc1, 0x080c, 0x9a2b, 0x080c, 0x6e9e, + 0x0005, 0x0036, 0x080c, 0xaf00, 0x603f, 0x0000, 0x2019, 0x000b, + 0x0031, 0x601f, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x0126, + 0x0036, 0x2091, 0x8000, 0x0086, 0x2c40, 0x0096, 0x2049, 0x0000, + 0x080c, 0x7e0d, 0x009e, 0x008e, 0x1578, 0x0076, 0x2c38, 0x080c, + 0x7ea7, 0x007e, 0x1548, 0x6000, 0xa086, 0x0000, 0x0528, 0x601c, + 0xa086, 0x0007, 0x0508, 0x00d6, 0x6000, 0xa086, 0x0004, 0x1150, + 0x080c, 0xaf00, 0x601f, 0x0007, 0x2001, 0xb3b5, 0x2004, 0x6016, + 0x080c, 0x190f, 0x6010, 0x2068, 0x080c, 0x986a, 0x0110, 0x080c, + 0xac5f, 0x00de, 0x6013, 0x0000, 0x080c, 0xaf00, 0x601f, 0x0007, + 0x2001, 0xb3b5, 0x2004, 0x6016, 0x003e, 0x012e, 0x0005, 0x00f6, + 0x00c6, 0x0036, 0x0156, 0x2079, 0xb680, 0x7938, 0x783c, 0x080c, + 0x26f6, 0x15b0, 0x0016, 0x00c6, 0x080c, 0x4e21, 0x1578, 0x001e, + 0x002e, 0x0026, 0x0016, 0x2019, 0x0029, 0x080c, 0x7f67, 0x080c, + 0x6b35, 0x0076, 0x2039, 0x0000, 0x080c, 0x6a6b, 0x007e, 0x001e, + 0x0076, 0x2039, 0x0000, 0x080c, 0xaa51, 0x007e, 0x080c, 0x501c, + 0x0026, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x0118, + 0xa286, 0x0004, 0x1118, 0x62a0, 0x080c, 0x2c2c, 0x002e, 0x001e, + 0x080c, 0x4a80, 0x6612, 0x6516, 0xa006, 0x0010, 0x00ce, 0x001e, + 0x015e, 0x003e, 0x00ce, 0x00fe, 0x0005, 0x00c6, 0x00d6, 0x00e6, + 0x0016, 0x2009, 0xb120, 0x2104, 0xa086, 0x0074, 0x1904, 0xa98a, + 0x2069, 0xb68e, 0x690c, 0xa182, 0x0100, 0x06c0, 0x6908, 0xa184, + 0x8000, 0x05e8, 0x2001, 0xb39e, 0x2004, 0xa005, 0x1160, 0x6018, + 0x2070, 0x7010, 0xa084, 0x00ff, 0x0118, 0x7000, 0xd0f4, 0x0118, + 0xa184, 0x0800, 0x0560, 0x6910, 0xa18a, 0x0001, 0x0610, 0x6914, + 0x2069, 0xb6ae, 0x6904, 0x81ff, 0x1198, 0x690c, 0xa182, 0x0100, + 0x02a8, 0x6908, 0x81ff, 0x1178, 0x6910, 0xa18a, 0x0001, 0x0288, + 0x6918, 0xa18a, 0x0001, 0x0298, 0x00d0, 0x6013, 0x0100, 0x00a0, + 0x6013, 0x0300, 0x0088, 0x6013, 0x0500, 0x0070, 0x6013, 0x0700, + 0x0058, 0x6013, 0x0900, 0x0040, 0x6013, 0x0b00, 0x0028, 0x6013, + 0x0f00, 0x0010, 0x6013, 0x2d00, 0xa085, 0x0001, 0x0008, 0xa006, + 0x001e, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x0026, + 0x0036, 0x0156, 0x6218, 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286, + 0x0006, 0x0190, 0xa286, 0x0004, 0x0178, 0xa394, 0xff00, 0x8217, + 0xa286, 0x0006, 0x0148, 0xa286, 0x0004, 0x0130, 0x00c6, 0x2d60, + 0x080c, 0x4e30, 0x00ce, 0x04c0, 0x2011, 0xb696, 0xad98, 0x000a, + 0x20a9, 0x0004, 0x080c, 0x8d2b, 0x1580, 0x2011, 0xb69a, 0xad98, + 0x0006, 0x20a9, 0x0004, 0x080c, 0x8d2b, 0x1538, 0x0046, 0x0016, + 0x6aa0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0xb153, 0x210c, + 0xd1a4, 0x0138, 0x2009, 0x0029, 0x080c, 0xacae, 0x6800, 0xc0e5, + 0x6802, 0x2019, 0x0029, 0x080c, 0x6b35, 0x0076, 0x2039, 0x0000, + 0x080c, 0x6a6b, 0x2c08, 0x080c, 0xaa51, 0x007e, 0x2001, 0x0007, + 0x080c, 0x4da2, 0x001e, 0x004e, 0xa006, 0x015e, 0x003e, 0x002e, + 0x00de, 0x00ce, 0x0005, 0x00d6, 0x2069, 0xb68e, 0x6800, 0xa086, + 0x0800, 0x0118, 0x6013, 0x0000, 0x0008, 0xa006, 0x00de, 0x0005, + 0x00c6, 0x00f6, 0x0016, 0x0026, 0x0036, 0x0156, 0x2079, 0xb68c, + 0x7930, 0x7834, 0x080c, 0x26f6, 0x11a0, 0x080c, 0x4e21, 0x1188, + 0x2011, 0xb690, 0xac98, 0x000a, 0x20a9, 0x0004, 0x080c, 0x8d2b, + 0x1140, 0x2011, 0xb694, 0xac98, 0x0006, 0x20a9, 0x0004, 0x080c, + 0x8d2b, 0x015e, 0x003e, 0x002e, 0x001e, 0x00fe, 0x00ce, 0x0005, + 0x00c6, 0x0006, 0x0016, 0x0026, 0x0036, 0x0156, 0x2011, 0xb683, + 0x2204, 0x8211, 0x220c, 0x080c, 0x26f6, 0x11a0, 0x080c, 0x4e21, + 0x1188, 0x2011, 0xb696, 0xac98, 0x000a, 0x20a9, 0x0004, 0x080c, + 0x8d2b, 0x1140, 0x2011, 0xb69a, 0xac98, 0x0006, 0x20a9, 0x0004, + 0x080c, 0x8d2b, 0x015e, 0x003e, 0x002e, 0x001e, 0x000e, 0x00ce, + 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x0056, 0x0046, + 0x0026, 0x0126, 0x2091, 0x8000, 0x2740, 0x2029, 0xb3e2, 0x252c, + 0x2021, 0xb3e8, 0x2424, 0x2061, 0xb800, 0x2071, 0xb100, 0x7644, + 0x7064, 0x81ff, 0x0128, 0x8001, 0xa602, 0x1a04, 0xaacd, 0x0018, + 0xa606, 0x0904, 0xaacd, 0x2100, 0xac06, 0x0904, 0xaac4, 0x080c, + 0xacd6, 0x0904, 0xaac4, 0x671c, 0xa786, 0x0001, 0x0904, 0xaae4, + 0xa786, 0x0004, 0x0904, 0xaae4, 0xa786, 0x0007, 0x05e8, 0x2500, + 0xac06, 0x05d0, 0x2400, 0xac06, 0x05b8, 0x080c, 0xace6, 0x15a0, + 0x88ff, 0x0118, 0x6050, 0xa906, 0x1578, 0x00d6, 0x6000, 0xa086, + 0x0004, 0x1120, 0x0016, 0x080c, 0x190f, 0x001e, 0xa786, 0x0008, + 0x1148, 0x080c, 0x9a66, 0x1130, 0x080c, 0x8890, 0x00de, 0x080c, + 0x9a2b, 0x00d0, 0x6010, 0x2068, 0x080c, 0x986a, 0x0190, 0xa786, + 0x0003, 0x1528, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x080c, + 0xaf46, 0x0016, 0x080c, 0x9ada, 0x080c, 0x5271, 0x001e, 0x080c, + 0x9a1f, 0x00de, 0x080c, 0x9a2b, 0xace0, 0x0018, 0x2001, 0xb116, + 0x2004, 0xac02, 0x1210, 0x0804, 0xaa65, 0x012e, 0x002e, 0x004e, + 0x005e, 0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x0005, 0xa786, + 0x0006, 0x19c0, 0xa386, 0x0005, 0x0128, 0x080c, 0xaf46, 0x080c, + 0xac5f, 0x08f8, 0x00de, 0x0c00, 0x080c, 0xace6, 0x19e8, 0x81ff, + 0x09d8, 0xa180, 0x0001, 0x2004, 0xa086, 0x0018, 0x0130, 0xa180, + 0x0001, 0x2004, 0xa086, 0x002d, 0x1978, 0x6000, 0xa086, 0x0002, + 0x1958, 0x080c, 0x9a55, 0x0130, 0x080c, 0x9a66, 0x1928, 0x080c, + 0x8890, 0x0038, 0x080c, 0x2b99, 0x080c, 0x9a66, 0x1110, 0x080c, + 0x8890, 0x080c, 0x9a2b, 0x0804, 0xaac4, 0x00c6, 0x00e6, 0x0016, + 0x2c08, 0x2170, 0xa006, 0x080c, 0xac80, 0x001e, 0x0120, 0x601c, + 0xa084, 0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005, 0xab26, 0xab26, + 0xab26, 0xab26, 0xab26, 0xab26, 0xab28, 0xab26, 0xa006, 0x0005, + 0x0046, 0x0016, 0x7018, 0xa080, 0x0028, 0x2024, 0xa4a4, 0x00ff, + 0x8427, 0x2c00, 0x2009, 0x0020, 0x080c, 0xacae, 0x001e, 0x004e, + 0x0036, 0x2019, 0x0002, 0x080c, 0xa8af, 0x003e, 0xa085, 0x0001, + 0x0005, 0x2001, 0x0001, 0x080c, 0x4d63, 0x0156, 0x0016, 0x0026, + 0x0036, 0x20a9, 0x0004, 0x2019, 0xb105, 0x2011, 0xb696, 0x080c, + 0x8d2b, 0x003e, 0x002e, 0x001e, 0x015e, 0xa005, 0x0005, 0x00f6, + 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x0026, 0x0126, 0x2091, + 0x8000, 0x2740, 0x2061, 0xb800, 0x2079, 0x0001, 0x8fff, 0x0904, + 0xabb5, 0x2071, 0xb100, 0x7644, 0x7064, 0x8001, 0xa602, 0x1a04, + 0xabb5, 0x88ff, 0x0128, 0x2800, 0xac06, 0x15b0, 0x2079, 0x0000, + 0x080c, 0xacd6, 0x0588, 0x2400, 0xac06, 0x0570, 0x671c, 0xa786, + 0x0006, 0x1550, 0xa786, 0x0007, 0x0538, 0x88ff, 0x1140, 0x6018, + 0xa206, 0x1510, 0x85ff, 0x0118, 0x6050, 0xa106, 0x11e8, 0x00d6, + 0x6000, 0xa086, 0x0004, 0x1150, 0x080c, 0xaf00, 0x601f, 0x0007, + 0x2001, 0xb3b5, 0x2004, 0x6016, 0x080c, 0x190f, 0x6010, 0x2068, + 0x080c, 0x986a, 0x0120, 0x0046, 0x080c, 0xac5f, 0x004e, 0x00de, + 0x080c, 0x9a2b, 0x88ff, 0x1198, 0xace0, 0x0018, 0x2001, 0xb116, + 0x2004, 0xac02, 0x1210, 0x0804, 0xab66, 0xa006, 0x012e, 0x002e, + 0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0xa8c5, + 0x0001, 0x0ca0, 0x0076, 0x0056, 0x0086, 0x2041, 0x0000, 0x2029, + 0x0001, 0x2c20, 0x2019, 0x0002, 0x6218, 0x0096, 0x2049, 0x0000, + 0x080c, 0x7e0d, 0x009e, 0x008e, 0x2039, 0x0000, 0x080c, 0x7ea7, + 0x080c, 0xab57, 0x005e, 0x007e, 0x0005, 0x0026, 0x0046, 0x0056, + 0x0076, 0x00c6, 0x0156, 0x2c20, 0x2128, 0x20a9, 0x007f, 0x2009, + 0x0000, 0x0016, 0x0036, 0x080c, 0x4e21, 0x11b0, 0x2c10, 0x0056, + 0x0086, 0x2041, 0x0000, 0x2508, 0x2029, 0x0001, 0x0096, 0x2049, + 0x0000, 0x080c, 0x7e0d, 0x009e, 0x008e, 0x2039, 0x0000, 0x080c, + 0x7ea7, 0x080c, 0xab57, 0x005e, 0x003e, 0x001e, 0x8108, 0x1f04, + 0xabe9, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x002e, 0x0005, + 0x0076, 0x0056, 0x6218, 0x0086, 0x2041, 0x0000, 0x2029, 0x0001, + 0x2019, 0x0048, 0x0096, 0x2049, 0x0000, 0x080c, 0x7e0d, 0x009e, + 0x008e, 0x2039, 0x0000, 0x080c, 0x7ea7, 0x2c20, 0x080c, 0xab57, + 0x005e, 0x007e, 0x0005, 0x0026, 0x0046, 0x0056, 0x0076, 0x00c6, + 0x0156, 0x2c20, 0x20a9, 0x007f, 0x2009, 0x0000, 0x0016, 0x0036, + 0x080c, 0x4e21, 0x11c0, 0x2c10, 0x0086, 0x2041, 0x0000, 0x2828, + 0x0046, 0x2021, 0x0001, 0x080c, 0xaee2, 0x004e, 0x0096, 0x2049, + 0x0000, 0x080c, 0x7e0d, 0x009e, 0x008e, 0x2039, 0x0000, 0x080c, + 0x7ea7, 0x080c, 0xab57, 0x003e, 0x001e, 0x8108, 0x1f04, 0xac36, + 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x002e, 0x0005, 0x0016, + 0x00f6, 0x3800, 0xd08c, 0x0130, 0xad82, 0x1000, 0x02b0, 0xad82, + 0xb100, 0x0230, 0xad82, 0xe800, 0x0280, 0xad82, 0xffff, 0x1268, + 0x6800, 0xa07d, 0x0138, 0x6803, 0x0000, 0x6b52, 0x080c, 0x5271, + 0x2f68, 0x0cb0, 0x6b52, 0x080c, 0x5271, 0x00fe, 0x001e, 0x0005, + 0x00e6, 0x0046, 0x0036, 0x2061, 0xb800, 0xa005, 0x1138, 0x2071, + 0xb100, 0x7444, 0x7064, 0x8001, 0xa402, 0x12d8, 0x2100, 0xac06, + 0x0168, 0x6000, 0xa086, 0x0000, 0x0148, 0x6008, 0xa206, 0x1130, + 0x6018, 0xa1a0, 0x0006, 0x2424, 0xa406, 0x0140, 0xace0, 0x0018, + 0x2001, 0xb116, 0x2004, 0xac02, 0x1220, 0x0c40, 0xa085, 0x0001, + 0x0008, 0xa006, 0x003e, 0x004e, 0x00ee, 0x0005, 0x00d6, 0x0006, + 0x080c, 0x15dd, 0x000e, 0x090c, 0x14fa, 0x6837, 0x010d, 0x685e, + 0x0026, 0x2010, 0x080c, 0x985a, 0x2001, 0x0000, 0x0120, 0x2200, + 0xa080, 0x0014, 0x2004, 0x002e, 0x684a, 0x6956, 0x6c46, 0x684f, + 0x0000, 0x2001, 0xb3bd, 0x2004, 0x6852, 0xa006, 0x68b2, 0x6802, + 0x683a, 0x685a, 0x080c, 0x5271, 0x00de, 0x0005, 0x6700, 0xa786, + 0x0000, 0x0158, 0xa786, 0x0001, 0x0140, 0xa786, 0x000a, 0x0128, + 0xa786, 0x0009, 0x0110, 0xa085, 0x0001, 0x0005, 0x00e6, 0x6018, + 0x2070, 0x70a0, 0xa206, 0x00ee, 0x0005, 0x0016, 0x6004, 0xa08e, + 0x001e, 0x11a0, 0x8007, 0x6130, 0xa18c, 0x00ff, 0xa105, 0x6032, + 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0005, 0x2001, 0xb3b6, + 0x2004, 0x6016, 0x080c, 0x69f6, 0x080c, 0x6e9e, 0x001e, 0x0005, + 0xe000, 0xe000, 0x0005, 0x6020, 0xd0e4, 0x0158, 0xd0cc, 0x0118, + 0x080c, 0x9b43, 0x0030, 0x080c, 0xaf00, 0x080c, 0x6866, 0x080c, + 0x82eb, 0x0005, 0xa280, 0x0007, 0x2004, 0xa084, 0x000f, 0x0002, + 0xad29, 0xad29, 0xad29, 0xad2e, 0xad29, 0xad2b, 0xad2b, 0xad29, + 0xad2b, 0xa006, 0x0005, 0x00c6, 0x2260, 0x00ce, 0xa085, 0x0001, + 0x0005, 0xa280, 0x0007, 0x2004, 0xa084, 0x000f, 0x0002, 0xad40, + 0xad40, 0xad40, 0xad40, 0xad40, 0xad40, 0xad4b, 0xad40, 0xad40, + 0x6007, 0x003b, 0x602b, 0x0009, 0x6013, 0x2a00, 0x6003, 0x0001, + 0x080c, 0x69f6, 0x0005, 0x00c6, 0x2260, 0x080c, 0xaf00, 0x603f, + 0x0000, 0x6020, 0xc0f4, 0xc0cc, 0x6022, 0x6037, 0x0000, 0x00ce, + 0x00d6, 0x2268, 0xa186, 0x0007, 0x1904, 0xada6, 0x6810, 0xa005, + 0x0138, 0xa080, 0x0013, 0x2004, 0xd0fc, 0x1110, 0x00de, 0x08c0, + 0x6007, 0x003a, 0x6003, 0x0001, 0x080c, 0x69f6, 0x080c, 0x6e9e, + 0x00c6, 0x2d60, 0x6100, 0xa186, 0x0002, 0x1904, 0xae2f, 0x6010, + 0xa005, 0x1138, 0x6000, 0xa086, 0x0007, 0x190c, 0x14fa, 0x0804, + 0xae2f, 0xa08c, 0xf000, 0x1130, 0x0028, 0x2068, 0x6800, 0xa005, + 0x1de0, 0x2d00, 0xa080, 0x0013, 0x2004, 0xa084, 0x0003, 0xa086, + 0x0002, 0x1180, 0x6010, 0x2068, 0x684c, 0xc0dc, 0xc0f4, 0x684e, + 0x6850, 0xc0f4, 0xc0fc, 0x6852, 0x2009, 0x0043, 0x080c, 0xa727, + 0x0804, 0xae2f, 0x2009, 0x0041, 0x0804, 0xae29, 0xa186, 0x0005, + 0x15f0, 0x6810, 0xa080, 0x0013, 0x2004, 0xd0bc, 0x1118, 0x00de, + 0x0804, 0xad40, 0xd0b4, 0x0128, 0xd0fc, 0x090c, 0x14fa, 0x0804, + 0xad5e, 0x6007, 0x003a, 0x6003, 0x0001, 0x080c, 0x69f6, 0x080c, + 0x6e9e, 0x00c6, 0x2d60, 0x6100, 0xa186, 0x0002, 0x0120, 0xa186, + 0x0004, 0x1904, 0xae2f, 0x2071, 0xb419, 0x7000, 0xa086, 0x0003, + 0x1128, 0x7004, 0xac06, 0x1110, 0x7003, 0x0000, 0x6810, 0xa080, + 0x0013, 0x200c, 0xc1f4, 0xc1dc, 0x2102, 0x8000, 0x200c, 0xc1f4, + 0xc1fc, 0xc1bc, 0x2102, 0x2009, 0x0042, 0x0804, 0xae29, 0x0036, + 0x00d6, 0x00d6, 0x080c, 0x15dd, 0x003e, 0x090c, 0x14fa, 0x6837, + 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x685b, 0x0000, 0x6b5e, + 0x6857, 0x0045, 0x2c00, 0x6862, 0x6034, 0x6872, 0x2360, 0x6020, + 0xc0dd, 0x6022, 0x6018, 0xa080, 0x0028, 0x2004, 0xa084, 0x00ff, + 0x8007, 0x6350, 0x6b4a, 0x6846, 0x684f, 0x0000, 0x6853, 0x0000, + 0x6d6a, 0x6e66, 0x686f, 0x0001, 0x080c, 0x5271, 0x2019, 0x0045, + 0x6008, 0x2068, 0x080c, 0xa8af, 0x2d00, 0x600a, 0x601f, 0x0006, + 0x6003, 0x0007, 0x6017, 0x0000, 0x603f, 0x0000, 0x00de, 0x003e, + 0x0038, 0x603f, 0x0000, 0x6003, 0x0007, 0x080c, 0xa727, 0x00ce, + 0x00de, 0x0005, 0xa186, 0x0013, 0x1128, 0x6004, 0xa082, 0x0085, + 0x2008, 0x00c2, 0xa186, 0x0027, 0x1178, 0x080c, 0x6dc1, 0x0036, + 0x00d6, 0x6010, 0x2068, 0x2019, 0x0004, 0x080c, 0xac5f, 0x00de, + 0x003e, 0x080c, 0x6e9e, 0x0005, 0xa186, 0x0014, 0x0d70, 0x080c, + 0x8331, 0x0005, 0xae5b, 0xae59, 0xae59, 0xae59, 0xae59, 0xae59, + 0xae5b, 0x080c, 0x14fa, 0x080c, 0x6dc1, 0x6003, 0x000c, 0x080c, + 0x6e9e, 0x0005, 0xa182, 0x008c, 0x1220, 0xa182, 0x0085, 0x0208, + 0x001a, 0x080c, 0x8331, 0x0005, 0xae73, 0xae73, 0xae73, 0xae73, + 0xae75, 0xae93, 0xae73, 0x080c, 0x14fa, 0x00d6, 0x2c68, 0x080c, + 0x8295, 0x01a0, 0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0xb68e, + 0x210c, 0x6136, 0x2009, 0xb68f, 0x210c, 0x613a, 0x600b, 0xffff, + 0x6918, 0x611a, 0x601f, 0x0004, 0x080c, 0x69f6, 0x2d60, 0x080c, + 0x82eb, 0x00de, 0x0005, 0x080c, 0x82eb, 0x0005, 0x00e6, 0x6018, + 0x2070, 0x7000, 0xd0ec, 0x00ee, 0x0005, 0x6010, 0xa08c, 0xf000, + 0x0904, 0xaee1, 0xa080, 0x0013, 0x200c, 0xd1ec, 0x05d0, 0x2001, + 0xb172, 0x2004, 0xd0ec, 0x05a8, 0x6003, 0x0002, 0x6020, 0xc0e5, + 0x6022, 0xd1ac, 0x0180, 0x00f6, 0x2c78, 0x080c, 0x5173, 0x00fe, + 0x0150, 0x2001, 0xb3b7, 0x2004, 0x603e, 0x2009, 0xb172, 0x210c, + 0xd1f4, 0x11e8, 0x0080, 0x2009, 0xb172, 0x210c, 0xd1f4, 0x0128, + 0x6020, 0xc0e4, 0x6022, 0xa006, 0x00a0, 0x2001, 0xb3b7, 0x200c, + 0x8103, 0xa100, 0x603e, 0x6018, 0xa088, 0x002b, 0x2104, 0xa005, + 0x0118, 0xa088, 0x0003, 0x0cd0, 0x2c0a, 0x600f, 0x0000, 0xa085, + 0x0001, 0x0005, 0x0016, 0x00c6, 0x00e6, 0x6150, 0xa2f0, 0x002b, + 0x2e04, 0x2060, 0x8cff, 0x0180, 0x84ff, 0x1118, 0x6050, 0xa106, + 0x1138, 0x600c, 0x2072, 0x080c, 0x6866, 0x080c, 0x82eb, 0x0010, + 0xacf0, 0x0003, 0x2e64, 0x0c70, 0x00ee, 0x00ce, 0x001e, 0x0005, + 0x00d6, 0x6018, 0xa0e8, 0x002b, 0x2d04, 0xa005, 0x0140, 0xac06, + 0x0120, 0x2d04, 0xa0e8, 0x0003, 0x0cb8, 0x600c, 0x206a, 0x00de, + 0x0005, 0x0026, 0x0036, 0x0156, 0x2011, 0xb127, 0x2204, 0xa084, + 0x00ff, 0x2019, 0xb68e, 0x2334, 0xa636, 0x11d8, 0x8318, 0x2334, + 0x2204, 0xa084, 0xff00, 0xa636, 0x11a0, 0x2011, 0xb690, 0x6018, + 0xa098, 0x000a, 0x20a9, 0x0004, 0x080c, 0x8d2b, 0x1150, 0x2011, + 0xb694, 0x6018, 0xa098, 0x0006, 0x20a9, 0x0004, 0x080c, 0x8d2b, + 0x1100, 0x015e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x2071, 0xb100, + 0x080c, 0x4a3b, 0x080c, 0x2991, 0x00ee, 0x0005, 0x00e6, 0x6018, + 0x2070, 0x7000, 0xd0fc, 0x0108, 0x0011, 0x00ee, 0x0005, 0x6850, + 0xc0e5, 0x6852, 0x0005, 0x00e6, 0x00c6, 0x0076, 0x0066, 0x0056, + 0x0046, 0x0026, 0x0016, 0x0126, 0x2091, 0x8000, 0x2029, 0xb3e2, + 0x252c, 0x2021, 0xb3e8, 0x2424, 0x2061, 0xb800, 0x2071, 0xb100, + 0x7644, 0x7064, 0xa606, 0x0578, 0x671c, 0xa786, 0x0001, 0x0118, + 0xa786, 0x0008, 0x1500, 0x2500, 0xac06, 0x01e8, 0x2400, 0xac06, + 0x01d0, 0x080c, 0xacd6, 0x01b8, 0x080c, 0xace6, 0x11a0, 0x6000, + 0xa086, 0x0004, 0x1120, 0x0016, 0x080c, 0x190f, 0x001e, 0x080c, + 0x9a55, 0x1110, 0x080c, 0x2b99, 0x080c, 0x9a66, 0x1110, 0x080c, + 0x8890, 0x080c, 0x9a2b, 0xace0, 0x0018, 0x2001, 0xb116, 0x2004, + 0xac02, 0x1208, 0x0858, 0x012e, 0x001e, 0x002e, 0x004e, 0x005e, + 0x006e, 0x007e, 0x00ce, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, + 0x2091, 0x8000, 0x2071, 0xb140, 0xd5a4, 0x0118, 0x7034, 0x8000, + 0x7036, 0xd5b4, 0x0118, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0118, + 0x2071, 0xb14a, 0x0451, 0x00ee, 0x000e, 0x012e, 0x0005, 0x0126, + 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, 0xb140, 0xd5a4, 0x0118, + 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0118, 0x7030, 0x8000, 0x7032, + 0xd5ac, 0x0118, 0x2071, 0xb14a, 0x0081, 0x00ee, 0x000e, 0x012e, + 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, 0xb142, + 0x0021, 0x00ee, 0x000e, 0x012e, 0x0005, 0x2e04, 0x8000, 0x2072, + 0x1220, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x0005, 0x00e6, 0x2071, + 0xb140, 0x0c99, 0x00ee, 0x0005, 0x00e6, 0x2071, 0xb144, 0x0c69, + 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, + 0xb140, 0x7044, 0x8000, 0x7046, 0x00ee, 0x000e, 0x012e, 0x0005, + 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, + 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, + 0x5790 +}; +#ifdef UNIQUE_FW_NAME +unsigned short fw2200tp_length01 = 0xa019; +#else +unsigned short risc_code_length01 = 0xa019; +#endif + diff -urN linux-2.4.18/drivers/scsi/ql2300_fw.h lia64-2.4/drivers/scsi/ql2300_fw.h --- linux-2.4.18/drivers/scsi/ql2300_fw.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/scsi/ql2300_fw.h Mon Jul 23 14:12:14 2001 @@ -0,0 +1,5486 @@ +/************************************************************************ + * * + * --- ISP2300 Initiator/Target Firmware --- * + * with Fabric (Public Loop), Point-point, and * + * expanded LUN addressing for FCTAPE * + * * + ************************************************************************ + Copyright (C) 2000 and 2001 Qlogic Corporation + (www.qlogic.com) + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + ************************************************************************/ +/* + * Firmware Version 3.00.24 (14:18 Jun 05, 2001) + */ + +#ifdef UNIQUE_FW_NAME +unsigned short fw2300tp_version = 3*1024+0; +#else +unsigned short risc_code_version = 3*1024+0; +#endif + +#ifdef UNIQUE_FW_NAME +unsigned char fw2300tp_version_str[] = {3, 0,24}; +#else +unsigned char firmware_version[] = {3, 0,24}; +#endif + +#ifdef UNIQUE_FW_NAME +#define fw2300tp_VERSION_STRING "3.00.24" +#else +#define FW_VERSION_STRING "3.00.24" +#endif + +#ifdef UNIQUE_FW_NAME +unsigned short fw2300tp_addr01 = 0x0800 ; +#else +unsigned short risc_code_addr01 = 0x0800 ; +#endif + +#ifdef UNIQUE_FW_NAME +unsigned short fw2300tp_code01[] = { +#else +unsigned short risc_code01[] = { +#endif + 0x0470, 0x0000, 0x0000, 0xa9b8, 0x0000, 0x0003, 0x0000, 0x0018, + 0x0017, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030, + 0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241, + 0x5449, 0x4f4e, 0x2049, 0x5350, 0x3233, 0x3030, 0x2046, 0x6972, + 0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030, + 0x332e, 0x3030, 0x2e32, 0x3420, 0x2020, 0x2020, 0x2400, 0x20a9, + 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2200, 0x20a9, 0x000f, + 0x2001, 0x0000, 0x400f, 0x2091, 0x2400, 0x20a9, 0x000f, 0x2001, + 0x0000, 0x400f, 0x2091, 0x2600, 0x20a9, 0x000f, 0x2001, 0x0000, + 0x400f, 0x2091, 0x2800, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, + 0x2091, 0x2a00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, + 0x2c00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2e00, + 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2000, 0x2001, + 0x0000, 0x20c1, 0x0004, 0x2001, 0x017f, 0x2003, 0x0000, 0x20c9, + 0x14ff, 0x2059, 0x0000, 0x2b78, 0x7883, 0x0004, 0x2089, 0x2102, + 0x2051, 0x1100, 0x2a70, 0x20e1, 0x0001, 0x20e9, 0x0001, 0x2029, + 0x45c0, 0x2031, 0xffff, 0x2039, 0x45a9, 0x2021, 0x0200, 0x20e9, + 0x0001, 0x20a1, 0x1000, 0x900e, 0x20a9, 0x05c0, 0x4104, 0x755e, + 0x7662, 0x775a, 0x7466, 0x746a, 0x20a1, 0x15c0, 0x7160, 0x810d, + 0x810d, 0x810d, 0x810d, 0x918c, 0x000f, 0x2001, 0x0001, 0x9112, + 0x900e, 0x21a8, 0x4104, 0x8211, 0x1de0, 0x7160, 0x3400, 0x8001, + 0x9102, 0x0120, 0x0218, 0x20a8, 0x900e, 0x4104, 0x2009, 0x1100, + 0x810d, 0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x001f, 0x2001, + 0x0001, 0x9112, 0x20e9, 0x0001, 0x20a1, 0x0800, 0x900e, 0x20a9, + 0x0800, 0x4104, 0x8211, 0x1dd8, 0x2009, 0x1100, 0x3400, 0x9102, + 0x0120, 0x0218, 0x20a8, 0x900e, 0x4104, 0x080c, 0x0e42, 0x080c, + 0x0f8f, 0x080c, 0x13a2, 0x080c, 0x0c8a, 0x080c, 0x4721, 0x080c, + 0x7ebf, 0x080c, 0x0dae, 0x080c, 0x27c1, 0x080c, 0x5a05, 0x080c, + 0x4e0f, 0x080c, 0x64ba, 0x080c, 0x1956, 0x080c, 0x6721, 0x080c, + 0x5fe8, 0x080c, 0x1768, 0x080c, 0x18cb, 0x080c, 0x194b, 0x2091, + 0x3009, 0x7883, 0x0000, 0x1004, 0x0905, 0x7880, 0x9086, 0x0002, + 0x1160, 0x7883, 0x4000, 0x7837, 0x4000, 0x7833, 0x0010, 0x0e04, + 0x08ff, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, 0x7003, 0x0000, + 0x2a70, 0x7000, 0x908e, 0x0003, 0x1168, 0x080c, 0x3816, 0x080c, + 0x27e5, 0x080c, 0x5a60, 0x080c, 0x52b6, 0x080c, 0x64e0, 0x080c, + 0x20a5, 0x0c70, 0x000b, 0x0c88, 0x0926, 0x0927, 0x0a62, 0x0924, + 0x0b34, 0x0c87, 0x0c88, 0x0c89, 0x080c, 0x0cf1, 0x0005, 0x0126, + 0x00f6, 0x2091, 0x8000, 0x7000, 0x9086, 0x0001, 0x1904, 0x0a30, + 0x7034, 0xd0b4, 0x1130, 0x0026, 0x2011, 0x0080, 0x080c, 0x0d63, + 0x002e, 0x080c, 0x5745, 0x0150, 0x080c, 0x576b, 0x1570, 0x2079, + 0x0100, 0x7828, 0x9085, 0x1800, 0x782a, 0x0438, 0x080c, 0x5682, + 0x7000, 0x9086, 0x0001, 0x1904, 0x0a30, 0x7088, 0x9086, 0x0028, + 0x1904, 0x0a30, 0x2001, 0x0161, 0x2003, 0x0001, 0x2079, 0x0100, + 0x7827, 0xffff, 0x7a28, 0x9295, 0x1e2f, 0x7a2a, 0x2011, 0x5654, + 0x080c, 0x655b, 0x2011, 0x4586, 0x080c, 0x655b, 0x2011, 0x8030, + 0x2019, 0x0000, 0x7087, 0x0000, 0x00d8, 0x080c, 0x3e5a, 0x2079, + 0x0100, 0x7844, 0x9005, 0x1904, 0x0a30, 0x2011, 0x4586, 0x080c, + 0x655b, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000, 0x780f, + 0x006b, 0x7840, 0x9084, 0xfffb, 0x7842, 0x2011, 0x8010, 0x73c8, + 0x080c, 0x1f80, 0x080c, 0x37dc, 0x7238, 0xc284, 0x723a, 0x2001, + 0x110c, 0x200c, 0xc1ac, 0xc1cc, 0x2102, 0x080c, 0x788f, 0x2011, + 0x0004, 0x080c, 0x95d8, 0x080c, 0x4d24, 0x080c, 0x5745, 0x01e8, + 0x080c, 0x46dd, 0x0140, 0x7087, 0x0001, 0x70c3, 0x0000, 0x080c, + 0x4016, 0x0804, 0x0a30, 0x2001, 0x1153, 0x2004, 0xd094, 0x0168, + 0x2011, 0x110c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x1fc4, 0x1228, + 0x2011, 0x110c, 0x2204, 0xc0bc, 0x0020, 0x2011, 0x110c, 0x2204, + 0xc0bd, 0x2012, 0x080c, 0x4de0, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, + 0x0050, 0x080c, 0x99a3, 0x70cc, 0xd09c, 0x1128, 0x709c, 0x9005, + 0x0110, 0x080c, 0x46bb, 0x70d7, 0x0000, 0x70d3, 0x0000, 0x72cc, + 0x080c, 0x5745, 0x1178, 0x2011, 0x0000, 0x0016, 0x080c, 0x1d69, + 0x2019, 0x1280, 0x211a, 0x001e, 0x704f, 0xffff, 0x7053, 0x00ef, + 0x7073, 0x0000, 0x2079, 0x1152, 0x7804, 0xd0ac, 0x0108, 0xc295, + 0x72ce, 0x080c, 0x5745, 0x0118, 0x9296, 0x0004, 0x0508, 0x2011, + 0x0001, 0x080c, 0x95d8, 0x7097, 0x0000, 0x709b, 0xffff, 0x7003, + 0x0002, 0x00fe, 0x080c, 0x23cd, 0x2011, 0x0005, 0x080c, 0x79c2, + 0x080c, 0x6d42, 0x080c, 0x5745, 0x0148, 0x00c6, 0x2061, 0x0100, + 0x0016, 0x080c, 0x1d69, 0x61e2, 0x001e, 0x00ce, 0x012e, 0x00d0, + 0x7097, 0x0000, 0x709b, 0xffff, 0x7003, 0x0002, 0x2011, 0x0005, + 0x080c, 0x79c2, 0x080c, 0x6d42, 0x080c, 0x5745, 0x0148, 0x00c6, + 0x2061, 0x0100, 0x0016, 0x080c, 0x1d69, 0x61e2, 0x001e, 0x00ce, + 0x00fe, 0x012e, 0x0005, 0x00c6, 0x080c, 0x5745, 0x1118, 0x20a9, + 0x0100, 0x0010, 0x20a9, 0x0082, 0x080c, 0x5745, 0x1118, 0x2009, + 0x0000, 0x0010, 0x2009, 0x007e, 0x0016, 0x0026, 0x0036, 0x2110, + 0x0026, 0x2019, 0x0029, 0x080c, 0x7ba2, 0x002e, 0x080c, 0xad6c, + 0x003e, 0x002e, 0x001e, 0x080c, 0x26a3, 0x8108, 0x1f04, 0x0a44, + 0x00ce, 0x706f, 0x0000, 0x7070, 0x9084, 0x00ff, 0x7072, 0x709f, + 0x0000, 0x0005, 0x0126, 0x2091, 0x8000, 0x7000, 0x9086, 0x0002, + 0x1904, 0x0b32, 0x7098, 0x9086, 0xffff, 0x0130, 0x080c, 0x23cd, + 0x080c, 0x6d42, 0x0804, 0x0b32, 0x70cc, 0xd0ac, 0x1110, 0xd09c, + 0x0520, 0xd084, 0x0510, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, + 0x000e, 0xd08c, 0x01d0, 0x70d0, 0x9086, 0xffff, 0x0190, 0x080c, + 0x252c, 0x080c, 0x6d42, 0x70cc, 0xd094, 0x1904, 0x0b32, 0x2011, + 0x0001, 0x2019, 0x0000, 0x080c, 0x2562, 0x080c, 0x6d42, 0x0804, + 0x0b32, 0x70d4, 0x9005, 0x1904, 0x0b32, 0x7094, 0x9005, 0x1904, + 0x0b32, 0x70cc, 0xd0a4, 0x0118, 0xd0b4, 0x0904, 0x0b32, 0x080c, + 0x4de0, 0x1904, 0x0b32, 0x2001, 0x1153, 0x2004, 0xd0ac, 0x01c8, + 0x0156, 0x00c6, 0x20a9, 0x007f, 0x2009, 0x0000, 0x0016, 0x080c, + 0x4b58, 0x1118, 0x6000, 0xd0ec, 0x1138, 0x001e, 0x8108, 0x1f04, + 0x0ab6, 0x00ce, 0x015e, 0x0028, 0x001e, 0x00ce, 0x015e, 0x0804, + 0x0b32, 0x0006, 0x2001, 0x0103, 0x2003, 0x006b, 0x000e, 0x9006, + 0x2009, 0x0700, 0x20a9, 0x0002, 0x20a1, 0x12ca, 0x20e9, 0x0001, + 0x4001, 0x706c, 0x8007, 0x7170, 0x810f, 0x20a9, 0x0002, 0x4001, + 0x2009, 0x0000, 0x080c, 0x0cd7, 0x2001, 0x0000, 0x810f, 0x20a9, + 0x0002, 0x4001, 0x9006, 0x2009, 0x0200, 0x20a9, 0x0002, 0x20a1, + 0x12da, 0x4001, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003, 0x709b, + 0xffff, 0x7034, 0xd0b4, 0x1130, 0x0026, 0x2011, 0x0040, 0x080c, + 0x0d63, 0x002e, 0x9006, 0x080c, 0x1c36, 0x0036, 0x0046, 0x2019, + 0xffff, 0x2021, 0x0006, 0x080c, 0x384a, 0x004e, 0x003e, 0x00f6, + 0x2079, 0x0100, 0x080c, 0x576b, 0x0150, 0x080c, 0x5745, 0x7828, + 0x0118, 0x9084, 0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, + 0x2001, 0x12dd, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011, 0x0000, + 0x080c, 0x79c2, 0x2011, 0x0000, 0x080c, 0x79cc, 0x080c, 0x6d42, + 0x080c, 0x6e10, 0x012e, 0x0005, 0x0016, 0x0046, 0x00f6, 0x0126, + 0x2091, 0x8000, 0x2079, 0x0100, 0x2009, 0x00f7, 0x080c, 0x46a4, + 0x7940, 0x918c, 0x0010, 0x7942, 0x7924, 0xd1b4, 0x0110, 0x7827, + 0x0040, 0xd19c, 0x0110, 0x7827, 0x0008, 0x0006, 0x0036, 0x0156, + 0x7954, 0xd1ac, 0x1904, 0x0b9b, 0x080c, 0x5757, 0x0158, 0x080c, + 0x576b, 0x1128, 0x2001, 0x128f, 0x2003, 0x0000, 0x0070, 0x080c, + 0x574d, 0x0dc0, 0x2001, 0x128f, 0x2003, 0xaaaa, 0x2001, 0x1290, + 0x2003, 0x0001, 0x080c, 0x5682, 0x0058, 0x080c, 0x5745, 0x0140, + 0x2009, 0x00f8, 0x080c, 0x46a4, 0x7843, 0x0090, 0x7843, 0x0010, + 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x5745, 0x0138, + 0x7824, 0xd0ac, 0x1904, 0x0c6f, 0x1f04, 0x0b7a, 0x0070, 0x7824, + 0x080c, 0x5761, 0x0118, 0xd0ac, 0x1904, 0x0c6f, 0x9084, 0x1800, + 0x0d98, 0x7003, 0x0001, 0x0804, 0x0c6f, 0x2001, 0x0001, 0x080c, + 0x1c36, 0x0804, 0x0c78, 0x080c, 0x203d, 0x1148, 0x2001, 0x0001, + 0x080c, 0x1faf, 0x2001, 0x0001, 0x080c, 0x1f92, 0x00d8, 0x080c, + 0x2045, 0x1138, 0x9006, 0x080c, 0x1faf, 0x9006, 0x080c, 0x1f92, + 0x0088, 0x080c, 0x204d, 0x1d50, 0x2001, 0x12b8, 0x2004, 0xd0fc, + 0x0128, 0x7828, 0x9085, 0x0020, 0x782a, 0x0020, 0x080c, 0x1d96, + 0x0804, 0x0c6a, 0x7850, 0x9085, 0x0040, 0x7852, 0x7938, 0x7850, + 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2055, 0x9085, 0x2000, 0x7852, + 0x793a, 0x20a9, 0x0046, 0x1d04, 0x0bd3, 0x2091, 0x6000, 0x1f04, + 0x0bd3, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf, 0x7852, 0x793a, + 0x080c, 0x5757, 0x0158, 0x080c, 0x576b, 0x1128, 0x2001, 0x128f, + 0x2003, 0x0000, 0x0070, 0x080c, 0x574d, 0x0dc0, 0x2001, 0x128f, + 0x2003, 0xaaaa, 0x2001, 0x1290, 0x2003, 0x0001, 0x080c, 0x5682, + 0x0020, 0x2009, 0x00f8, 0x080c, 0x46a4, 0x20a9, 0x0028, 0xa001, + 0x1f04, 0x0bff, 0x7850, 0x9085, 0x1400, 0x7852, 0x080c, 0x5745, + 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678, 0x2019, + 0xea60, 0x7820, 0xd09c, 0x1528, 0x080c, 0x5745, 0x05c0, 0x7824, + 0xd0ac, 0x1904, 0x0c6f, 0x080c, 0x576b, 0x11d8, 0x0046, 0x2021, + 0x0320, 0x8421, 0x1df0, 0x004e, 0x7827, 0x1800, 0x080c, 0x2055, + 0x7824, 0x9084, 0x1800, 0x1110, 0x8421, 0x1158, 0x2001, 0x128f, + 0x2003, 0xaaaa, 0x2001, 0x1290, 0x2003, 0x0001, 0x7003, 0x0001, + 0x04b0, 0x8319, 0x19b0, 0x2009, 0x12bb, 0x2104, 0x8001, 0x200a, + 0x1168, 0x7827, 0x0048, 0x20a9, 0x0002, 0x080c, 0x2036, 0x7924, + 0x080c, 0x2055, 0xd19c, 0x0110, 0x080c, 0x1f80, 0x00d8, 0x080c, + 0x5757, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c, 0x571c, 0x7003, + 0x0001, 0x00a8, 0x7827, 0x1800, 0x080c, 0x2055, 0x7824, 0x080c, + 0x5761, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800, 0x0990, 0x7003, + 0x0001, 0x0028, 0x2001, 0x0001, 0x080c, 0x1c36, 0x0028, 0x7827, + 0x0048, 0x7828, 0xc09d, 0x782a, 0x7850, 0x9085, 0x0400, 0x7852, + 0x9006, 0x78f2, 0x015e, 0x003e, 0x000e, 0x7034, 0xd0b4, 0x1110, + 0x080c, 0x0d29, 0x012e, 0x00fe, 0x004e, 0x001e, 0x0005, 0x0005, + 0x0005, 0x0005, 0x2a70, 0x2001, 0x128f, 0x2003, 0x0000, 0x7087, + 0x0000, 0x2009, 0x0100, 0x2104, 0x9082, 0x0002, 0x0218, 0x704f, + 0xffff, 0x0010, 0x704f, 0x0000, 0x7057, 0xffff, 0x706f, 0x0000, + 0x7073, 0x0000, 0x080c, 0x99a3, 0x2061, 0x127f, 0x6003, 0x0909, + 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, 0x0200, 0x6013, 0x00ff, + 0x6017, 0x0003, 0x601b, 0x0000, 0x601f, 0x07d0, 0x2061, 0x1287, + 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, 0x0000, 0x600f, 0x0200, + 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, 0x0001, 0x601f, 0x0000, + 0x2061, 0x12a9, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, + 0x600f, 0x2020, 0x2001, 0x1127, 0x2003, 0x0000, 0x0005, 0x2011, + 0x0000, 0x080c, 0x4b58, 0x1178, 0x6004, 0x90c4, 0x00ff, 0x98c6, + 0x0006, 0x0128, 0x90c4, 0xff00, 0x98c6, 0x0600, 0x1120, 0x9186, + 0x0080, 0x0108, 0x8210, 0x8108, 0x9186, 0x0100, 0x1d50, 0x2208, + 0x0005, 0x2091, 0x8000, 0x0e04, 0x0cf3, 0x0006, 0x0016, 0x2079, + 0x0000, 0x001e, 0x798e, 0x000e, 0x788a, 0x000e, 0x7886, 0x3900, + 0x789a, 0x7883, 0x8002, 0x7837, 0x8002, 0x7833, 0x0012, 0x2091, + 0x5000, 0x0156, 0x00d6, 0x2079, 0x0300, 0x7803, 0x0000, 0x2069, + 0x1331, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68, + 0x8318, 0x1f04, 0x0d14, 0x00de, 0x015e, 0x2079, 0x1100, 0x7803, + 0x0005, 0x2091, 0x4080, 0x7834, 0xd0b4, 0x1108, 0x0451, 0x0cd8, + 0x0005, 0x00f6, 0x0006, 0x2079, 0x1123, 0x2f04, 0x8000, 0x207a, + 0x9082, 0x000f, 0x0258, 0x9006, 0x207a, 0x2079, 0x1125, 0x2f04, + 0x9084, 0x0001, 0x9086, 0x0001, 0x207a, 0x0080, 0x2079, 0x1125, + 0x2f7c, 0x8fff, 0x1130, 0x0026, 0x2011, 0x0080, 0x00e1, 0x002e, + 0x0028, 0x0026, 0x2011, 0x0000, 0x00b1, 0x002e, 0x000e, 0x00fe, + 0x0005, 0x0026, 0x2011, 0x0080, 0x0071, 0x002e, 0x2009, 0x0fff, + 0x00b9, 0x0026, 0x2011, 0x0040, 0x0031, 0x002e, 0x2009, 0x0fff, + 0x0079, 0x0c78, 0x0005, 0x0016, 0x3b08, 0x3a00, 0x9104, 0x918d, + 0x00c0, 0x21d8, 0x9084, 0xff3f, 0x9205, 0x20d0, 0x001e, 0x0005, + 0x0156, 0x0126, 0x918c, 0x0fff, 0x21a8, 0x1d04, 0x0d75, 0x2091, + 0x6000, 0x1f04, 0x0d75, 0x012e, 0x015e, 0x0005, 0x890b, 0x810b, + 0x810b, 0x810b, 0x810b, 0x810b, 0x9994, 0xfc00, 0x8217, 0x8214, + 0x8214, 0x0005, 0x0006, 0x814c, 0x894c, 0x894c, 0x894c, 0x894c, + 0x894c, 0x9284, 0x003f, 0x8007, 0x8003, 0x8003, 0x994d, 0x000e, + 0x0005, 0x0016, 0x0026, 0x0096, 0x3348, 0x0c01, 0x2100, 0x9300, + 0x2098, 0x22e0, 0x009e, 0x002e, 0x001e, 0x3518, 0x20a9, 0x0001, + 0x4002, 0x8007, 0x4004, 0x8319, 0x1dd8, 0x0005, 0x2071, 0x1100, + 0x715c, 0x712e, 0x2021, 0x0001, 0x9190, 0x0040, 0x9298, 0x0040, + 0x0240, 0x7060, 0x9302, 0x1228, 0x220a, 0x2208, 0x2310, 0x8420, + 0x0ca8, 0x200b, 0x0000, 0x74ae, 0x74b2, 0x0005, 0x00e6, 0x0126, + 0x2091, 0x8000, 0x2071, 0x1100, 0x70b0, 0x90ea, 0x0010, 0x0268, + 0x8001, 0x70b2, 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, + 0x6807, 0x0000, 0x012e, 0x00ee, 0x0005, 0x906e, 0x0cd8, 0x00e6, + 0x2071, 0x1100, 0x0126, 0x2091, 0x8000, 0x70b0, 0x8001, 0x0260, + 0x70b2, 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, + 0x0000, 0x012e, 0x00ee, 0x0005, 0x906e, 0x0cd8, 0x00e6, 0x0126, + 0x2091, 0x8000, 0x2071, 0x1100, 0x702c, 0x206a, 0x2d00, 0x702e, + 0x70b0, 0x8000, 0x70b2, 0x012e, 0x00ee, 0x0005, 0x8dff, 0x0138, + 0x6804, 0x6807, 0x0000, 0x0006, 0x0c49, 0x00de, 0x0cb8, 0x0005, + 0x00e6, 0x2071, 0x1100, 0x70b0, 0x908a, 0x0010, 0x900d, 0x00ee, + 0x0005, 0x00d6, 0x0821, 0x0148, 0x0016, 0x0026, 0x2d08, 0x2011, + 0x0001, 0x080c, 0x0d8a, 0x002e, 0x001e, 0x00de, 0x0005, 0x00d6, + 0x080c, 0x0dc6, 0x0148, 0x0016, 0x0026, 0x2d08, 0x2011, 0x0001, + 0x080c, 0x0d8a, 0x002e, 0x001e, 0x00de, 0x0005, 0x00d6, 0x0016, + 0x0026, 0x080c, 0x0d7e, 0x2168, 0x002e, 0x001e, 0x080c, 0x0df6, + 0x00de, 0x0005, 0x00e6, 0x2071, 0x130a, 0x7007, 0x0000, 0x701f, + 0x0000, 0x7023, 0x0000, 0x7003, 0x0000, 0x2071, 0x0000, 0x7010, + 0x9085, 0x8004, 0x7012, 0x00ee, 0x0005, 0x00e6, 0x2270, 0x700b, + 0x0000, 0x2071, 0x130a, 0x701c, 0x9088, 0x1314, 0x220a, 0x8000, + 0x9084, 0x0007, 0x701e, 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, + 0x0080, 0x0081, 0x00fe, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x130a, + 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x0019, 0x00fe, + 0x00ee, 0x0005, 0x7000, 0x0002, 0x0e7e, 0x0cf1, 0x701c, 0x7120, + 0x9106, 0x1118, 0x7007, 0x0000, 0x0005, 0x00d6, 0x9180, 0x1314, + 0x2004, 0x700a, 0x2068, 0x8108, 0x918c, 0x0007, 0x7122, 0x782b, + 0x0026, 0x6828, 0x7802, 0x682c, 0x7806, 0x6830, 0x780a, 0x6834, + 0x780e, 0x6814, 0x700e, 0x680c, 0x7016, 0x6810, 0x701a, 0x6804, + 0x00de, 0xd084, 0x0120, 0x7007, 0x0001, 0x0029, 0x0005, 0x7007, + 0x0002, 0x00b1, 0x0005, 0x0016, 0x0026, 0x710c, 0x2011, 0x0040, + 0x9182, 0x0040, 0x1210, 0x2110, 0x9006, 0x700e, 0x7212, 0x8203, + 0x7812, 0x782b, 0x0020, 0x782b, 0x0041, 0x002e, 0x001e, 0x0005, + 0x0016, 0x0026, 0x0136, 0x0146, 0x0156, 0x7014, 0x20e0, 0x7018, + 0x2098, 0x20e9, 0x0000, 0x20a1, 0x0088, 0x782b, 0x0026, 0x710c, + 0x2011, 0x0040, 0x9182, 0x0040, 0x1210, 0x2110, 0x9006, 0x700e, + 0x22a8, 0x4006, 0x8203, 0x7812, 0x782b, 0x0020, 0x3300, 0x701a, + 0x782b, 0x0001, 0x015e, 0x014e, 0x013e, 0x002e, 0x001e, 0x0005, + 0x0016, 0x00e6, 0x2071, 0x130a, 0x00f6, 0x2079, 0x0080, 0x792c, + 0x782b, 0x0002, 0xd1fc, 0x0120, 0x918c, 0x0700, 0x7004, 0x0023, + 0x00fe, 0x00ee, 0x001e, 0x0005, 0x0e7a, 0x0f01, 0x0f33, 0x0f00, + 0x0cf8, 0x918c, 0x0700, 0x1548, 0x0136, 0x0146, 0x0156, 0x7014, + 0x20e8, 0x7018, 0x20a0, 0x20e1, 0x0000, 0x2099, 0x0088, 0x782b, + 0x0040, 0x7010, 0x20a8, 0x4005, 0x3400, 0x701a, 0x015e, 0x014e, + 0x013e, 0x700c, 0x9005, 0x0560, 0x7800, 0x7802, 0x7804, 0x7806, + 0x080c, 0x0eab, 0x0005, 0x7008, 0x9080, 0x0002, 0x2003, 0x0100, + 0x7007, 0x0000, 0x080c, 0x0e7a, 0x0005, 0x7008, 0x9080, 0x0002, + 0x2003, 0x0200, 0x0ca8, 0x918c, 0x0700, 0x1150, 0x700c, 0x9005, + 0x0178, 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, 0x0ec0, 0x0005, + 0x7008, 0x9080, 0x0002, 0x2003, 0x0200, 0x7007, 0x0000, 0x0080, + 0x00d6, 0x7008, 0x2068, 0x7800, 0x682a, 0x7804, 0x682e, 0x7808, + 0x6832, 0x780c, 0x6836, 0x680b, 0x0100, 0x00de, 0x7007, 0x0000, + 0x00c6, 0x00d6, 0x7008, 0x2060, 0x0081, 0x0150, 0x6038, 0x080f, + 0x603b, 0x0000, 0x603f, 0x0000, 0x2c00, 0x2068, 0x080c, 0x0df6, + 0x00de, 0x00ce, 0x080c, 0x0e7a, 0x0005, 0x00e6, 0x2071, 0x1100, + 0x8cff, 0x0140, 0x705c, 0x9c02, 0x0238, 0x9c82, 0xffff, 0x1220, + 0x9085, 0x0001, 0x00ee, 0x0005, 0x9006, 0x0ce0, 0x603c, 0x906d, + 0x090c, 0x0cf1, 0x6008, 0x908e, 0x0100, 0x0130, 0x687b, 0x0030, + 0x6883, 0x0000, 0x6897, 0x4002, 0x080c, 0x50a5, 0x0005, 0x0126, + 0x2091, 0x2200, 0x2079, 0x0300, 0x2071, 0x131c, 0x7003, 0x0000, + 0x78bf, 0x00f6, 0x00c1, 0x7803, 0x0003, 0x780f, 0x0000, 0x20a9, + 0x01c4, 0x2061, 0xae21, 0x2c0d, 0x7912, 0xe104, 0x9ce0, 0x0002, + 0x7916, 0x1f04, 0x0fa3, 0x7807, 0x0001, 0x7803, 0x0000, 0x7803, + 0x0001, 0x012e, 0x0005, 0x00c6, 0x7803, 0x0000, 0x7827, 0x0030, + 0x782b, 0x0400, 0x7827, 0x0031, 0x782b, 0x1331, 0x781f, 0xff00, + 0x781b, 0xff00, 0x2061, 0x1331, 0x602f, 0x15c0, 0x6033, 0x3000, + 0x603b, 0x168e, 0x00ce, 0x0005, 0x0126, 0x2091, 0x2200, 0x7808, + 0xd09c, 0x0138, 0x7820, 0x908c, 0xf000, 0x1508, 0x0043, 0x012e, + 0x0005, 0x9084, 0x0070, 0x190c, 0x0cf1, 0x012e, 0x0005, 0x0ff5, + 0x0ff7, 0x0ffe, 0x1002, 0x1006, 0x100b, 0x100e, 0x1012, 0x101f, + 0x1024, 0x0ff5, 0x108d, 0x1091, 0x10d3, 0x0ff5, 0x0ff5, 0x0ff5, + 0x0ff5, 0x0ff5, 0x0ff5, 0x0ff5, 0x0ff5, 0x080c, 0x0cf1, 0x2009, + 0x0048, 0x2060, 0x080c, 0x7f4e, 0x012e, 0x0005, 0x7004, 0xc085, + 0x7006, 0x0005, 0x7004, 0xc085, 0x7006, 0x0005, 0x080c, 0x10da, + 0x080c, 0x1161, 0x0005, 0x080c, 0x0cf1, 0x0005, 0x7004, 0xc095, + 0x7006, 0x0005, 0x080c, 0x10da, 0x2060, 0x6014, 0x9080, 0x000e, + 0x2003, 0xffff, 0x2009, 0x0048, 0x080c, 0x7f4e, 0x0005, 0x080c, + 0x10da, 0x080c, 0x0cf1, 0x0005, 0x080c, 0x10da, 0x2001, 0x0016, + 0x080c, 0x113b, 0x7827, 0x0018, 0x79ac, 0xd1dc, 0x01c8, 0x7827, + 0x0015, 0x7828, 0x782b, 0x0000, 0x9065, 0x0138, 0x2001, 0x020d, + 0x2003, 0x0050, 0x2003, 0x0020, 0x0088, 0x7004, 0x9005, 0x090c, + 0x0cf1, 0x78ab, 0x0004, 0x7803, 0x0001, 0x080c, 0x1091, 0x0005, + 0x7828, 0x782b, 0x0000, 0x9065, 0x090c, 0x0cf1, 0x6014, 0x2068, + 0x78ab, 0x0004, 0x918c, 0x0700, 0x01d8, 0x080c, 0x1337, 0x080c, + 0x95d2, 0x0158, 0x69ac, 0x6936, 0x69b0, 0x693a, 0x683f, 0xffff, + 0x6843, 0xffff, 0x6880, 0xc0bd, 0x6882, 0x7827, 0x0015, 0x782b, + 0x0000, 0x781f, 0x0300, 0x7803, 0x0001, 0x080c, 0x92a4, 0x0005, + 0x6010, 0x2004, 0xd0bc, 0x190c, 0x993c, 0x2001, 0x0201, 0x2004, + 0x9005, 0x0dd8, 0x7dbc, 0x080c, 0xadd8, 0xd5a4, 0x1118, 0x080c, + 0x10df, 0x0005, 0x080c, 0x1337, 0x7827, 0x0015, 0x782b, 0x0000, + 0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x7004, 0xc09d, 0x7006, + 0x0005, 0x7104, 0x9184, 0x0004, 0x190c, 0x0cf1, 0xd184, 0x1181, + 0xd19c, 0x0150, 0xc19c, 0x7106, 0x2001, 0x020d, 0x2003, 0x0050, + 0x2003, 0x0020, 0x04e1, 0x0005, 0x81ff, 0x190c, 0x0cf1, 0x0005, + 0xc184, 0x7106, 0x0016, 0x00e6, 0x2071, 0x0200, 0x080c, 0x1155, + 0x6014, 0x9005, 0x01c0, 0x9080, 0x0019, 0x2004, 0x9084, 0x00ff, + 0x9086, 0x0029, 0x1180, 0x00f6, 0x2c78, 0x080c, 0x119d, 0x00fe, + 0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x0fb3, 0x7803, 0x0001, + 0x00ee, 0x001e, 0x0005, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, + 0x0020, 0x0069, 0x0ca8, 0x0031, 0x2060, 0x2009, 0x0053, 0x080c, + 0x7f4e, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005, 0x00d6, + 0x2069, 0x0200, 0x7908, 0x918c, 0x0007, 0x9186, 0x0003, 0x0120, + 0x2001, 0x0016, 0x080c, 0x113b, 0x6804, 0x9005, 0x0de8, 0x2001, + 0x015d, 0x2003, 0x0000, 0x79bc, 0x0016, 0x001e, 0xd1a4, 0x1518, + 0x79b8, 0x0016, 0x001e, 0x918c, 0x0fff, 0x0178, 0x9182, 0x0841, + 0x1260, 0x9188, 0x0007, 0x918c, 0x0ff8, 0x810c, 0x810c, 0x810c, + 0x0421, 0x6827, 0x0001, 0x8109, 0x1dd8, 0x00f9, 0x6827, 0x0002, + 0x00e1, 0x682c, 0xd0e4, 0x1148, 0x6804, 0x9005, 0x0de8, 0x79b8, + 0xd1ec, 0x1118, 0x08c0, 0x080c, 0x1337, 0x7827, 0x0015, 0x782b, + 0x0000, 0x2001, 0x020d, 0x2003, 0x0020, 0x2001, 0x0307, 0x2003, + 0x0300, 0x7803, 0x0001, 0x00de, 0x0005, 0x6824, 0x9084, 0x0003, + 0x1de0, 0x0005, 0x2001, 0x0030, 0x2c08, 0x621c, 0x0021, 0x7830, + 0x9086, 0x0041, 0x0005, 0x00f6, 0x2079, 0x0300, 0x0006, 0x7808, + 0xd09c, 0x0140, 0x0016, 0x0026, 0x00c6, 0x080c, 0x0fcc, 0x00ce, + 0x002e, 0x001e, 0x000e, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, + 0x7818, 0xd0bc, 0x1de8, 0x00fe, 0x0005, 0x7037, 0x0001, 0x7150, + 0x7037, 0x0002, 0x7050, 0x2060, 0xd1bc, 0x1110, 0x7054, 0x2060, + 0x0005, 0x00e6, 0x0016, 0x2071, 0x0200, 0x0c79, 0x7358, 0x745c, + 0x6014, 0x905d, 0x0530, 0x2b68, 0x6010, 0x2004, 0xd0bc, 0x190c, + 0x9917, 0x6b42, 0x6c3e, 0x2001, 0x1174, 0x2004, 0xd0b4, 0x1120, + 0x683b, 0xffff, 0x6837, 0xffff, 0x080c, 0x16ae, 0x1190, 0x080c, + 0x1255, 0x2a00, 0x6816, 0x0130, 0x2c00, 0x680e, 0x2805, 0x680a, + 0x2800, 0x6812, 0x7037, 0x0020, 0x781f, 0x0300, 0x001e, 0x00ee, + 0x0005, 0x7037, 0x0050, 0x7037, 0x0020, 0x001e, 0x00ee, 0x080c, + 0x10df, 0x0005, 0x080c, 0x0cf1, 0x0005, 0x2ff0, 0x0126, 0x2091, + 0x2200, 0x3e60, 0x6014, 0x2068, 0x2d60, 0x903e, 0x2730, 0x6964, + 0x691a, 0x9184, 0x000f, 0x9088, 0x168e, 0x2145, 0x0002, 0x11bf, + 0x1226, 0x11bf, 0x11bf, 0x11bf, 0x11ff, 0x11bf, 0x11c3, 0x11bf, + 0x1214, 0x11bf, 0x11bf, 0x11bf, 0x11bf, 0x11e9, 0x11d5, 0x9085, + 0x0001, 0x0804, 0x124d, 0x687c, 0xd0bc, 0x0dc8, 0x6890, 0x6842, + 0x688c, 0x683e, 0x6888, 0x00d6, 0x2805, 0x9c68, 0x6b08, 0x6a0c, + 0x6d00, 0x6c04, 0x00de, 0x0804, 0x1235, 0x687c, 0xd0bc, 0x0d38, + 0x6890, 0x6842, 0x688c, 0x683e, 0x6888, 0x00d6, 0x2805, 0x9c68, + 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x00de, 0x0804, + 0x1235, 0x687c, 0xd0bc, 0x0998, 0x6890, 0x6842, 0x688c, 0x683e, + 0x6804, 0x2060, 0x9080, 0x0019, 0x200c, 0x691a, 0x91cc, 0x000f, + 0x9980, 0x168e, 0x2045, 0x6888, 0xd19c, 0x11e8, 0x0470, 0x687c, + 0xd0ac, 0x0904, 0x11bf, 0x6804, 0x2060, 0x9080, 0x0019, 0x200c, + 0x691a, 0x91cc, 0x000f, 0x9980, 0x168e, 0x2045, 0x9006, 0x6842, + 0x683e, 0xd19c, 0x1140, 0x00c8, 0x687c, 0xd0ac, 0x0904, 0x11bf, + 0x9006, 0x6842, 0x683e, 0x00d6, 0x2805, 0x9c68, 0x6b10, 0x6a14, + 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x00de, 0x0078, 0x687c, 0xd0ac, + 0x0904, 0x11bf, 0x9006, 0x6842, 0x683e, 0x00d6, 0x2805, 0x9c68, + 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x00de, 0x6b2e, 0x6a32, 0x6d1e, + 0x6c22, 0x6f26, 0x6e2a, 0x6988, 0x8840, 0x281d, 0x68ac, 0x6ab0, + 0x6836, 0x6a3a, 0x8109, 0x6916, 0x1150, 0x3e60, 0x601c, 0xc085, + 0x601e, 0x687c, 0xc0dd, 0x687e, 0x9006, 0x012e, 0x0005, 0x2c00, + 0x680e, 0x6b0a, 0x2800, 0x6812, 0x0c80, 0x903e, 0x2730, 0x6880, + 0xd0fc, 0x11a8, 0x00d6, 0x2805, 0x9c68, 0x2900, 0x0002, 0x1297, + 0x127d, 0x127d, 0x1297, 0x1297, 0x1291, 0x1297, 0x127d, 0x1297, + 0x1282, 0x1282, 0x1297, 0x1297, 0x1297, 0x1289, 0x1282, 0xc0fc, + 0x6882, 0x6b2c, 0x6a30, 0x6d1c, 0x6c20, 0x00d6, 0xd99c, 0x0510, + 0x2805, 0x9c68, 0x6f08, 0x6e0c, 0x00e8, 0x6b08, 0x6a0c, 0x6d00, + 0x6c04, 0x00c0, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, + 0x0088, 0x00de, 0x00d6, 0x6864, 0x9084, 0x00ff, 0x9086, 0x001e, + 0x1130, 0x00de, 0x080c, 0x164e, 0x1900, 0x900e, 0x0060, 0x00de, + 0x080c, 0x0cf1, 0x00de, 0x6b2e, 0x6a32, 0x6d1e, 0x6c22, 0x6f26, + 0x6e2a, 0x080c, 0x164e, 0x0005, 0x2001, 0x020b, 0x2004, 0xd0e4, + 0x0110, 0xd0d4, 0x1140, 0x6014, 0x9080, 0x0021, 0x6118, 0x2102, + 0x601b, 0x0002, 0x0005, 0x0126, 0x00c6, 0x2091, 0x2200, 0x00ce, + 0x2001, 0x0037, 0x2c08, 0x080c, 0x113b, 0x6000, 0x9086, 0x0004, + 0x1120, 0x2009, 0x0048, 0x080c, 0x7f4e, 0x012e, 0x0005, 0x0126, + 0x00c6, 0x2091, 0x2200, 0x00ce, 0x7908, 0x918c, 0x0007, 0x9186, + 0x0000, 0x0904, 0x132c, 0x9186, 0x0003, 0x0904, 0x132c, 0x6020, + 0x6023, 0x0000, 0x0006, 0x2031, 0x0190, 0x00c6, 0x7808, 0xd09c, + 0x190c, 0x0fcc, 0x00ce, 0x2001, 0x0038, 0x2c08, 0x621c, 0x080c, + 0x113b, 0x7930, 0x9186, 0x0040, 0x05d8, 0x9186, 0x0042, 0x190c, + 0x0cf1, 0x2001, 0x001e, 0x8001, 0x1df0, 0x8631, 0x1d30, 0x080c, + 0x136e, 0x0026, 0x0056, 0x2001, 0x00d2, 0x8001, 0x1df0, 0x2031, + 0x2000, 0x8631, 0x05a1, 0x2001, 0x020b, 0x2004, 0xd0e4, 0x0dc8, + 0x78ab, 0x0004, 0x080c, 0x0fb3, 0x781f, 0x8080, 0x78ab, 0x0009, + 0x601c, 0xc084, 0x601e, 0x080c, 0x5745, 0x1130, 0x0066, 0x2031, + 0x0001, 0x080c, 0x57d6, 0x006e, 0x7803, 0x0000, 0x7803, 0x0001, + 0x005e, 0x002e, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202, + 0x000e, 0x6022, 0x012e, 0x0005, 0x601c, 0xc084, 0x601e, 0x7827, + 0x0015, 0x7828, 0x9c06, 0x1db0, 0x782b, 0x0000, 0x0c98, 0x080c, + 0x5745, 0x11b0, 0x2001, 0x0138, 0x2003, 0x0000, 0x2001, 0x0160, + 0x2003, 0x0000, 0x2011, 0x012c, 0xa001, 0xa001, 0x8211, 0x1de0, + 0x0081, 0x0066, 0x2031, 0x0000, 0x080c, 0x57d6, 0x006e, 0x0005, + 0x00e9, 0x0039, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202, + 0x0005, 0x00e6, 0x2071, 0x0200, 0x080c, 0x205b, 0x7003, 0x002c, + 0x2001, 0x015d, 0x2003, 0x0000, 0x7000, 0x9084, 0x002c, 0x1de0, + 0x7098, 0x709a, 0x709c, 0x709e, 0x00ee, 0x0005, 0x2001, 0x0138, + 0x2014, 0x2003, 0x0000, 0x2001, 0x0160, 0x202c, 0x2003, 0x0000, + 0x2021, 0x0260, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x1168, 0x2001, + 0x0109, 0x201c, 0x939c, 0x0048, 0x1160, 0x2001, 0x0111, 0x201c, + 0x83ff, 0x1110, 0x8421, 0x1d70, 0x2001, 0x015d, 0x2003, 0x0000, + 0x0005, 0x0046, 0x2021, 0x0019, 0x2003, 0x0048, 0xa001, 0xa001, + 0x201c, 0x939c, 0x0048, 0x0120, 0x8421, 0x1db0, 0x004e, 0x0c60, + 0x004e, 0x0c40, 0x00e6, 0x2071, 0x131f, 0x7003, 0x0000, 0x00ee, + 0x0005, 0x00d6, 0x9280, 0x0005, 0x206c, 0x697c, 0xd1dc, 0x1904, + 0x141f, 0x6964, 0x9184, 0x0007, 0x0002, 0x13bd, 0x140a, 0x13bd, + 0x13bd, 0x13bd, 0x13f1, 0x13d0, 0x13bf, 0x080c, 0x0cf1, 0x687c, + 0xd0b4, 0x0904, 0x1507, 0x6890, 0x6842, 0x683a, 0x688c, 0x683e, + 0x6836, 0x68ac, 0x6846, 0x68b0, 0x684a, 0x6988, 0x0804, 0x1412, + 0x6864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x1d38, 0x687c, 0xd0b4, + 0x0904, 0x1507, 0x6890, 0x6842, 0x683a, 0x688c, 0x683e, 0x6836, + 0x68ac, 0x6846, 0x68b0, 0x684a, 0x6804, 0x685a, 0x9080, 0x0019, + 0x2004, 0x9084, 0x000f, 0x9080, 0x168e, 0x2005, 0x6812, 0x6988, + 0x0450, 0x918c, 0x00ff, 0x9186, 0x0015, 0x1548, 0x687c, 0xd0b4, + 0x0904, 0x1507, 0x6804, 0x685a, 0x9080, 0x0019, 0x2004, 0x9084, + 0x000f, 0x9080, 0x168e, 0x2005, 0x6812, 0x6988, 0x9006, 0x6842, + 0x683e, 0x0088, 0x687c, 0xd0b4, 0x0904, 0x1507, 0x6988, 0x9006, + 0x6842, 0x683e, 0x2d00, 0x685a, 0x6864, 0x9084, 0x000f, 0x9080, + 0x168e, 0x2005, 0x6812, 0x6916, 0x687c, 0xc0dd, 0x687e, 0x00de, + 0x0005, 0x00f6, 0x2079, 0x0090, 0x782c, 0xd0fc, 0x190c, 0x1543, + 0x00e6, 0x00d6, 0x2071, 0x131f, 0x7000, 0x9005, 0x1904, 0x1478, + 0x00c6, 0x7206, 0x9280, 0x0005, 0x205c, 0x7004, 0x2068, 0x782b, + 0x0004, 0x6810, 0x00d6, 0x2068, 0x686c, 0x7836, 0x6890, 0x00f6, + 0x2079, 0x0200, 0x7803, 0x0040, 0x781a, 0x2079, 0x0100, 0x8004, + 0x78d6, 0x00fe, 0x00de, 0x2b68, 0x6814, 0x2050, 0x6858, 0x2060, + 0x6810, 0x2040, 0x6064, 0x90cc, 0x000f, 0x6944, 0x791a, 0x7116, + 0x6848, 0x781e, 0x701a, 0x9006, 0x700e, 0x7012, 0x7004, 0x6940, + 0x6838, 0x9106, 0x11c8, 0x693c, 0x6834, 0x9106, 0x11a8, 0x8aff, + 0x01f0, 0x0126, 0x2091, 0x8000, 0x2079, 0x0090, 0x2009, 0x0001, + 0x00d1, 0x0118, 0x2009, 0x0001, 0x00b1, 0x012e, 0x00ce, 0x9006, + 0x00de, 0x00ee, 0x00fe, 0x0005, 0x0036, 0x0046, 0x6b38, 0x6c34, + 0x080c, 0x16ae, 0x004e, 0x003e, 0x0d10, 0x00ce, 0x0c88, 0x00ce, + 0x9085, 0x0001, 0x0c68, 0x0076, 0x0066, 0x0056, 0x0046, 0x0036, + 0x0026, 0x8aff, 0x0904, 0x1500, 0x700c, 0x7214, 0x923a, 0x7010, + 0x7218, 0x9203, 0x0a04, 0x14ff, 0x9705, 0x0904, 0x14ff, 0x903e, + 0x2730, 0x6880, 0xd0fc, 0x11a8, 0x00d6, 0x2805, 0x9c68, 0x2900, + 0x0002, 0x14e2, 0x14c7, 0x14c7, 0x14e2, 0x14e2, 0x14db, 0x14e2, + 0x14c7, 0x14e2, 0x14cc, 0x14cc, 0x14e2, 0x14e2, 0x14e2, 0x14d3, + 0x14cc, 0xc0fc, 0x6882, 0x6b2c, 0x6a30, 0x6d1c, 0x6c20, 0xd99c, + 0x0528, 0x00d6, 0x2805, 0x9c68, 0x6f08, 0x6e0c, 0x00f0, 0x6b08, + 0x6a0c, 0x6d00, 0x6c04, 0x00c8, 0x6b10, 0x6a14, 0x6d00, 0x6c04, + 0x6f08, 0x6e0c, 0x0090, 0x00de, 0x00d6, 0x6864, 0x9084, 0x00ff, + 0x9086, 0x001e, 0x1138, 0x00de, 0x080c, 0x164e, 0x1904, 0x1491, + 0x900e, 0x00f0, 0x00de, 0x080c, 0x0cf1, 0x00de, 0x7b12, 0x7a16, + 0x7d02, 0x7c06, 0x7f0a, 0x7e0e, 0x792a, 0x7000, 0x8000, 0x7002, + 0x683c, 0x9300, 0x683e, 0x6840, 0x9201, 0x6842, 0x700c, 0x9300, + 0x700e, 0x7010, 0x9201, 0x7012, 0x080c, 0x164e, 0x0008, 0x9006, + 0x002e, 0x003e, 0x004e, 0x005e, 0x006e, 0x007e, 0x0005, 0x080c, + 0x0cf1, 0x0026, 0x2001, 0x0105, 0x2003, 0x0010, 0x782b, 0x0004, + 0x7003, 0x0000, 0x7004, 0x2060, 0x00d6, 0x6014, 0x2068, 0x080c, + 0x95d2, 0x0118, 0x6880, 0xc0bd, 0x6882, 0x6020, 0x9086, 0x0006, + 0x1180, 0x2061, 0x0100, 0x62c8, 0x2001, 0x00fa, 0x8001, 0x1df0, + 0x60c8, 0x9206, 0x1dc0, 0x60c4, 0x689a, 0x60c8, 0x6896, 0x7004, + 0x2060, 0x00de, 0x080c, 0x92a4, 0x2001, 0x0200, 0x2003, 0x0040, + 0x080c, 0x7b66, 0x2011, 0x0000, 0x080c, 0x79cc, 0x080c, 0x6e10, + 0x002e, 0x0804, 0x15fd, 0x0126, 0x2091, 0x2400, 0x0006, 0x0016, + 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x2079, 0x0090, 0x2071, 0x131f, + 0x2b68, 0x6858, 0x2060, 0x792c, 0x782b, 0x0002, 0x9184, 0x0700, + 0x1904, 0x1509, 0x7000, 0x0002, 0x15fd, 0x1560, 0x15d0, 0x15fb, + 0x8001, 0x7002, 0xd19c, 0x1170, 0x8aff, 0x05d0, 0x2009, 0x0001, + 0x080c, 0x148b, 0x0904, 0x15fd, 0x2009, 0x0001, 0x080c, 0x148b, + 0x0804, 0x15fd, 0x782b, 0x0004, 0xd194, 0x0148, 0x6880, 0xc0fc, + 0x6882, 0x8aff, 0x11d8, 0x687c, 0xc0f5, 0x687e, 0x00b8, 0x0026, + 0x0036, 0x6b3c, 0x6a40, 0x7810, 0x682e, 0x931a, 0x7814, 0x6832, + 0x9213, 0x7800, 0x681e, 0x7804, 0x6822, 0x6b3e, 0x6a42, 0x003e, + 0x002e, 0x080c, 0x1666, 0x6880, 0xc0fd, 0x6882, 0x2a00, 0x6816, + 0x2c00, 0x685a, 0x2800, 0x6812, 0x7003, 0x0000, 0x0804, 0x15fd, + 0x00f6, 0x0026, 0x781c, 0x0006, 0x7818, 0x0006, 0x2079, 0x0100, + 0x7a14, 0x9284, 0x1984, 0x9085, 0x0012, 0x7816, 0x0036, 0x2019, + 0x1000, 0x8319, 0x090c, 0x0cf1, 0x7820, 0xd0bc, 0x1dd0, 0x003e, + 0x79c8, 0x000e, 0x9102, 0x001e, 0x0006, 0x0016, 0x79c4, 0x000e, + 0x9103, 0x78c6, 0x000e, 0x78ca, 0x9284, 0x1984, 0x9085, 0x0012, + 0x7816, 0x002e, 0x00fe, 0x782b, 0x0008, 0x7003, 0x0000, 0x0468, + 0x8001, 0x7002, 0xd194, 0x0168, 0x782c, 0xd0fc, 0x1904, 0x1553, + 0xd19c, 0x11f8, 0x8aff, 0x0508, 0x2009, 0x0001, 0x080c, 0x148b, + 0x00e0, 0x0026, 0x0036, 0x6b3c, 0x6a40, 0x080c, 0x1666, 0x00d6, + 0x2805, 0x9c68, 0x6064, 0xd09c, 0x1128, 0x6808, 0x931a, 0x680c, + 0x9213, 0x0020, 0x6810, 0x931a, 0x6814, 0x9213, 0x00de, 0x0804, + 0x1583, 0x0804, 0x157f, 0x080c, 0x0cf1, 0x00ce, 0x00de, 0x00ee, + 0x00fe, 0x001e, 0x000e, 0x012e, 0x0005, 0x00f6, 0x00e6, 0x2071, + 0x131f, 0x7000, 0x9086, 0x0000, 0x05f0, 0x2079, 0x0090, 0x2009, + 0x0207, 0x210c, 0xd194, 0x01a8, 0x2009, 0x020c, 0x210c, 0x9184, + 0x0003, 0x0178, 0x080c, 0xae13, 0x2001, 0x0133, 0x2004, 0x9005, + 0x090c, 0x0cf1, 0x2001, 0x0200, 0x2003, 0x0040, 0x2001, 0x020c, + 0x2102, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106, + 0x1120, 0x2001, 0x0200, 0x2003, 0x0040, 0x782c, 0xd0fc, 0x09b8, + 0x080c, 0x1543, 0x7000, 0x9086, 0x0000, 0x1988, 0x782b, 0x0004, + 0x782c, 0xd0ac, 0x1de8, 0x2001, 0x0200, 0x2003, 0x0040, 0x782b, + 0x0002, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x8840, 0x2805, + 0x9005, 0x0110, 0x8a51, 0x0005, 0x6004, 0x9005, 0x0168, 0x685a, + 0x2060, 0x6064, 0x9084, 0x000f, 0x9080, 0x168e, 0x2045, 0x88ff, + 0x090c, 0x0cf1, 0x8a51, 0x0005, 0x2050, 0x0005, 0x8a50, 0x8841, + 0x2805, 0x9005, 0x1190, 0x2c00, 0x9d06, 0x0120, 0x6000, 0x9005, + 0x1108, 0x2d00, 0x2060, 0x685a, 0x6064, 0x9084, 0x000f, 0x9080, + 0x169e, 0x2045, 0x88ff, 0x090c, 0x0cf1, 0x0005, 0x0000, 0x001d, + 0x0021, 0x0025, 0x0029, 0x002d, 0x0031, 0x0035, 0x0000, 0x001b, + 0x0021, 0x0027, 0x002d, 0x0033, 0x0000, 0x0000, 0x0000, 0x1683, + 0x167f, 0x0000, 0x0000, 0x168d, 0x0000, 0x1683, 0x0000, 0x168a, + 0x1687, 0x0000, 0x0000, 0x0000, 0x168d, 0x168a, 0x0000, 0x1685, + 0x1685, 0x0000, 0x0000, 0x168d, 0x0000, 0x1685, 0x0000, 0x168b, + 0x168b, 0x0000, 0x0000, 0x0000, 0x168d, 0x168b, 0x00a6, 0x0096, + 0x0086, 0x6b42, 0x6c3e, 0x6888, 0x9055, 0x0904, 0x173f, 0x2d60, + 0x6064, 0x90cc, 0x000f, 0x99c0, 0x168e, 0x9986, 0x0007, 0x0130, + 0x9986, 0x000e, 0x0118, 0x9986, 0x000f, 0x1120, 0x608c, 0x9422, + 0x6090, 0x931a, 0x2805, 0x9045, 0x1140, 0x0310, 0x0804, 0x173f, + 0x6004, 0x9065, 0x0904, 0x173f, 0x0c18, 0x2805, 0x9005, 0x01a8, + 0x9c68, 0xd99c, 0x1128, 0x6808, 0x9422, 0x680c, 0x931b, 0x0020, + 0x6810, 0x9422, 0x6814, 0x931b, 0x0620, 0x2300, 0x9405, 0x0150, + 0x8a51, 0x0904, 0x173f, 0x8840, 0x0c40, 0x6004, 0x9065, 0x0904, + 0x173f, 0x0830, 0x8a51, 0x0904, 0x173f, 0x8840, 0x2805, 0x9005, + 0x1158, 0x6004, 0x9065, 0x0904, 0x173f, 0x6064, 0x90cc, 0x000f, + 0x99c0, 0x168e, 0x2805, 0x2040, 0x2b68, 0x6880, 0xc0fc, 0x6882, + 0x0458, 0x8422, 0x8420, 0x831a, 0x9399, 0x0000, 0x00d6, 0x2b68, + 0x6c2e, 0x6b32, 0x00de, 0xd99c, 0x1168, 0x6908, 0x2400, 0x9122, + 0x690c, 0x2300, 0x911b, 0x0a0c, 0x0cf1, 0x6800, 0x9420, 0x6804, + 0x9319, 0x0060, 0x6910, 0x2400, 0x9122, 0x6914, 0x2300, 0x911b, + 0x0a0c, 0x0cf1, 0x6800, 0x9420, 0x6804, 0x9319, 0x2b68, 0x6c1e, + 0x6b22, 0x6880, 0xc0fd, 0x6882, 0x2c00, 0x685a, 0x2800, 0x6812, + 0x2a00, 0x6816, 0x000e, 0x000e, 0x000e, 0x9006, 0x0028, 0x008e, + 0x009e, 0x00ae, 0x9085, 0x0001, 0x0005, 0x2001, 0x0005, 0x2004, + 0x9084, 0x0007, 0x0002, 0x1753, 0x1543, 0x1754, 0x1755, 0x1758, + 0x175b, 0x1760, 0x1763, 0x0005, 0x0005, 0x080c, 0x1543, 0x0005, + 0x080c, 0x0ee8, 0x0005, 0x080c, 0x1543, 0x080c, 0x0ee8, 0x0005, + 0x080c, 0x0ee8, 0x0005, 0x080c, 0x1543, 0x080c, 0x0ee8, 0x0005, + 0x0126, 0x2091, 0x2600, 0x2079, 0x0200, 0x2071, 0x0260, 0x2069, + 0x1100, 0x7817, 0x0000, 0x789b, 0x0814, 0x78a3, 0x0406, 0x789f, + 0x0410, 0x2009, 0x013b, 0x200b, 0x0400, 0x781b, 0x0002, 0x783b, + 0x001f, 0x7837, 0x0020, 0x7803, 0x1600, 0x012e, 0x0005, 0x2091, + 0x2600, 0x781c, 0xd0a4, 0x190c, 0x18c8, 0x9084, 0x0006, 0x0002, + 0x17a3, 0x1798, 0x5fe9, 0x179a, 0x179c, 0x179e, 0x17a0, 0x17a2, + 0x080c, 0x0cf1, 0x080c, 0x0cf1, 0x0039, 0x0028, 0x0029, 0x0018, + 0x0019, 0x0008, 0x0009, 0x0005, 0x0006, 0x0016, 0x0026, 0x080c, + 0xae13, 0x7930, 0x9184, 0x0003, 0x0178, 0x2001, 0x12eb, 0x2004, + 0x9005, 0x0130, 0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0cf1, + 0x7803, 0x0040, 0x0804, 0x17fc, 0x9184, 0x0014, 0x01f0, 0x6a00, + 0x9286, 0x0003, 0x1108, 0x00a0, 0x080c, 0x5745, 0x1178, 0x2001, + 0x1290, 0x2003, 0x0001, 0x2001, 0x1100, 0x2003, 0x0001, 0x9085, + 0x0001, 0x080c, 0x5789, 0x080c, 0x5682, 0x0010, 0x080c, 0x45d6, + 0x7803, 0x0010, 0x78a0, 0x78a2, 0x00f8, 0x9184, 0x1400, 0x0168, + 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x131c, 0x080c, 0x1337, + 0x005e, 0x004e, 0x003e, 0x00ee, 0x0078, 0x9184, 0x0140, 0x0118, + 0x7803, 0x0020, 0x0048, 0x9184, 0x8000, 0x0130, 0x080c, 0x205b, + 0x7803, 0x0004, 0x7898, 0x789a, 0x002e, 0x001e, 0x000e, 0x0005, + 0x0016, 0x0026, 0x0036, 0x0046, 0x00e6, 0x00f6, 0x2071, 0x1100, + 0x7128, 0x2001, 0x1282, 0x2102, 0x2001, 0x128a, 0x2102, 0x2001, + 0x013b, 0x2102, 0x2079, 0x0200, 0x9198, 0x0007, 0x831c, 0x831c, + 0x831c, 0x2320, 0x9182, 0x0224, 0x1228, 0x2011, 0x0004, 0x8423, + 0x8423, 0x0088, 0x9182, 0x02d4, 0x1228, 0x2011, 0x0003, 0x8403, + 0x9420, 0x0048, 0x9182, 0x0444, 0x1220, 0x2011, 0x0002, 0x8423, + 0x0010, 0x2011, 0x0001, 0x9482, 0x0110, 0x8002, 0x8020, 0x8301, + 0x9402, 0x0110, 0x0208, 0x8321, 0x8217, 0x8203, 0x9405, 0x2001, + 0x0201, 0x789e, 0x9198, 0x0007, 0x831c, 0x831c, 0x831c, 0x9398, + 0x0003, 0x2320, 0x9182, 0x0204, 0x1228, 0x2011, 0x0004, 0x8423, + 0x8423, 0x0088, 0x9182, 0x02b4, 0x1228, 0x2011, 0x0003, 0x8403, + 0x9420, 0x0048, 0x9182, 0x041c, 0x1220, 0x2011, 0x0002, 0x8423, + 0x0010, 0x2011, 0x0001, 0x9482, 0x010c, 0x8002, 0x8020, 0x8301, + 0x9402, 0x0110, 0x0208, 0x8321, 0x8217, 0x8203, 0x9405, 0x2001, + 0x0200, 0x78a2, 0x9198, 0x0007, 0x831c, 0x831c, 0x831c, 0x9398, + 0x0005, 0x2320, 0x9182, 0x0204, 0x1230, 0x2011, 0x0008, 0x8423, + 0x8423, 0x8423, 0x0488, 0x9182, 0x024c, 0x1240, 0x2011, 0x0007, + 0x8403, 0x8003, 0x9400, 0x9400, 0x9420, 0x0430, 0x9182, 0x02bc, + 0x1238, 0x2011, 0x0006, 0x8403, 0x8003, 0x9400, 0x9420, 0x00e0, + 0x9182, 0x034c, 0x1230, 0x2011, 0x0005, 0x8403, 0x8003, 0x9420, + 0x0098, 0x9182, 0x042c, 0x1228, 0x2011, 0x0004, 0x8423, 0x8423, + 0x0058, 0x9182, 0x059c, 0x1228, 0x2011, 0x0003, 0x8403, 0x9420, + 0x0018, 0x2011, 0x0002, 0x8423, 0x9482, 0x0228, 0x8002, 0x8020, + 0x8301, 0x9402, 0x0110, 0x0208, 0x8321, 0x8217, 0x8203, 0x9405, + 0x789a, 0x00fe, 0x00ee, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, + 0x7938, 0x080c, 0x0cf1, 0x0126, 0x2091, 0x2800, 0x2061, 0x0100, + 0x2071, 0x1100, 0x080c, 0x1f80, 0x6054, 0x8004, 0x8004, 0x8004, + 0x8004, 0x9084, 0x000c, 0x6150, 0x918c, 0xfff3, 0x9105, 0x6052, + 0x6050, 0x9084, 0xfbff, 0x9085, 0x2000, 0x6052, 0x2009, 0x12bd, + 0x2011, 0x12be, 0x6358, 0x939c, 0x38f0, 0x2320, 0x080c, 0x1fc4, + 0x1238, 0x939d, 0x4003, 0x94a5, 0x8603, 0x230a, 0x2412, 0x0030, + 0x939d, 0x0203, 0x94a5, 0x8603, 0x230a, 0x2412, 0x9006, 0x080c, + 0x1faf, 0x9006, 0x080c, 0x1f92, 0x20a9, 0x0012, 0x1d04, 0x1906, + 0x2091, 0x6000, 0x1f04, 0x1906, 0x602f, 0x0100, 0x602f, 0x0000, + 0x6050, 0x9085, 0x0400, 0x9084, 0xdfff, 0x6052, 0x6024, 0x6026, + 0x080c, 0x1c83, 0x2009, 0x00ef, 0x6132, 0x6136, 0x080c, 0x1c93, + 0x60e7, 0x0000, 0x61ea, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, + 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x049f, 0x60bb, + 0x0000, 0x20a9, 0x0018, 0x60bf, 0x0000, 0x1f04, 0x1933, 0x60bb, + 0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x60bf, 0x0320, 0x60bf, + 0x0018, 0x601b, 0x001e, 0x601f, 0x001e, 0x600f, 0x006b, 0x602b, + 0x402f, 0x012e, 0x0005, 0x00f6, 0x2079, 0x0140, 0x78c3, 0x0080, + 0x78c3, 0x0083, 0x78c3, 0x0000, 0x00fe, 0x0005, 0x2001, 0x1131, + 0x2003, 0x0000, 0x2001, 0x1130, 0x2003, 0x0001, 0x0005, 0x0126, + 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x6124, 0x9184, 0x5e2c, + 0x1118, 0x9184, 0x0007, 0x002a, 0x9195, 0x0004, 0x9284, 0x0007, + 0x0002, 0x1993, 0x1979, 0x197c, 0x197f, 0x1984, 0x1986, 0x198a, + 0x198e, 0x080c, 0x677e, 0x00b8, 0x080c, 0x684f, 0x00a0, 0x080c, + 0x684f, 0x080c, 0x677e, 0x0078, 0x0099, 0x0068, 0x080c, 0x677e, + 0x0079, 0x0048, 0x080c, 0x684f, 0x0059, 0x0028, 0x080c, 0x684f, + 0x080c, 0x677e, 0x0029, 0x002e, 0x001e, 0x000e, 0x012e, 0x0005, + 0x6124, 0xd19c, 0x1904, 0x1bbd, 0xd1f4, 0x0110, 0x080c, 0x0cf1, + 0x080c, 0x5745, 0x0578, 0x7000, 0x9086, 0x0003, 0x0198, 0x6024, + 0x9084, 0x1800, 0x0178, 0x080c, 0x576b, 0x0118, 0x080c, 0x5757, + 0x1148, 0x6027, 0x0020, 0x6043, 0x0000, 0x2001, 0x128f, 0x2003, + 0xaaaa, 0x0458, 0x080c, 0x576b, 0x15d0, 0x6024, 0x9084, 0x1800, + 0x1108, 0x04a8, 0x2001, 0x128f, 0x2003, 0xaaaa, 0x2001, 0x1290, + 0x2003, 0x0001, 0x2001, 0x1100, 0x2003, 0x0001, 0x080c, 0x5682, + 0x0804, 0x1bbd, 0xd1ac, 0x1518, 0x6024, 0xd0dc, 0x1170, 0xd0e4, + 0x1188, 0xd0d4, 0x11a0, 0xd0cc, 0x0130, 0x7088, 0x9086, 0x0028, + 0x1110, 0x080c, 0x58e5, 0x0804, 0x1bbd, 0x2001, 0x1290, 0x2003, + 0x0000, 0x0048, 0x2001, 0x1290, 0x2003, 0x0002, 0x0020, 0x080c, + 0x5857, 0x0804, 0x1bbd, 0x080c, 0x597e, 0x0804, 0x1bbd, 0xd1ac, + 0x0904, 0x1af0, 0x080c, 0x5745, 0x11d8, 0x6027, 0x0020, 0x0006, + 0x0026, 0x0036, 0x080c, 0x5761, 0x1170, 0x2001, 0x1290, 0x2003, + 0x0001, 0x2001, 0x1100, 0x2003, 0x0001, 0x080c, 0x5682, 0x003e, + 0x002e, 0x000e, 0x0005, 0x003e, 0x002e, 0x000e, 0x080c, 0x571c, + 0x0016, 0x0046, 0x00c6, 0x644c, 0x9486, 0xf0f0, 0x1138, 0x2061, + 0x0100, 0x644a, 0x6043, 0x0090, 0x6043, 0x0010, 0x74ca, 0x948c, + 0xff00, 0x7034, 0xd084, 0x0178, 0x9186, 0xf800, 0x1160, 0x7038, + 0xd084, 0x1148, 0xc085, 0x703a, 0x0036, 0x2418, 0x2011, 0x8016, + 0x080c, 0x37dc, 0x003e, 0x9196, 0xff00, 0x05b8, 0x7050, 0x9084, + 0x00ff, 0x810f, 0x9116, 0x0588, 0x7130, 0xd184, 0x1570, 0x2011, + 0x1153, 0x2214, 0xd2ec, 0x0138, 0xc18d, 0x7132, 0x2011, 0x1153, + 0x2214, 0xd2ac, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130, 0x6248, + 0x9294, 0xff00, 0x9296, 0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904, + 0x1ac6, 0x7034, 0xd08c, 0x1140, 0x2001, 0x110c, 0x200c, 0xd1ac, + 0x1904, 0x1ac6, 0xc1ad, 0x2102, 0x0036, 0x73c8, 0x2011, 0x8013, + 0x080c, 0x37dc, 0x003e, 0x0804, 0x1ac6, 0x7034, 0xd08c, 0x1140, + 0x2001, 0x110c, 0x200c, 0xd1ac, 0x1904, 0x1ac6, 0xc1ad, 0x2102, + 0x0036, 0x73c8, 0x2011, 0x8013, 0x080c, 0x37dc, 0x003e, 0x7130, + 0xc185, 0x7132, 0x2011, 0x1153, 0x220c, 0xd1a4, 0x01f0, 0x0016, + 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x66d5, 0x2019, 0x000e, + 0x00c6, 0x2061, 0x0000, 0x080c, 0xaa50, 0x00ce, 0x9484, 0x00ff, + 0x9080, 0x26c1, 0x200d, 0x918c, 0xff00, 0x810f, 0x8127, 0x9006, + 0x2009, 0x000e, 0x080c, 0xaaca, 0x001e, 0xd1ac, 0x1148, 0x0016, + 0x2009, 0x0000, 0x2019, 0x0004, 0x080c, 0x2582, 0x001e, 0x0070, + 0x0156, 0x20a9, 0x007f, 0x2009, 0x0000, 0x080c, 0x4b58, 0x1110, + 0x080c, 0x472d, 0x8108, 0x1f04, 0x1abd, 0x015e, 0x00ce, 0x004e, + 0x2011, 0x0003, 0x080c, 0x79c2, 0x2011, 0x0002, 0x080c, 0x79cc, + 0x080c, 0x78b3, 0x080c, 0x65cf, 0x0036, 0x2019, 0x0000, 0x080c, + 0x7936, 0x003e, 0x60e3, 0x0000, 0x001e, 0x2001, 0x1100, 0x2014, + 0x9296, 0x0004, 0x1128, 0xd19c, 0x1118, 0x6228, 0xc29d, 0x622a, + 0x2003, 0x0001, 0x2001, 0x1122, 0x2003, 0x0000, 0x6027, 0x0020, + 0xd194, 0x0904, 0x1bbd, 0x0016, 0x6220, 0xd2b4, 0x0904, 0x1b6e, + 0x080c, 0x65cf, 0x080c, 0x7721, 0x6027, 0x0004, 0x00f6, 0x2019, + 0x12e5, 0x2304, 0x907d, 0x05f0, 0x7804, 0x9086, 0x0032, 0x15d0, + 0x00d6, 0x00c6, 0x00e6, 0x2069, 0x0140, 0x7810, 0x685e, 0x7808, + 0x685a, 0x6043, 0x0002, 0x2001, 0x0003, 0x8001, 0x1df0, 0x6043, + 0x0000, 0x2001, 0x003c, 0x8001, 0x1df0, 0x6803, 0x1000, 0x6803, + 0x0000, 0x2001, 0x001e, 0x8001, 0x0240, 0x20a9, 0x0009, 0x080c, + 0x2036, 0x6904, 0xd1dc, 0x1128, 0x0cb0, 0x6803, 0x1000, 0x6803, + 0x0000, 0x080c, 0x6c56, 0x080c, 0x6d42, 0x7814, 0x2070, 0x7067, + 0x0103, 0x2f60, 0x080c, 0x7f1e, 0x00ee, 0x00ce, 0x00de, 0x00fe, + 0x001e, 0x0005, 0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, + 0x4000, 0x0120, 0x6803, 0x1000, 0x6803, 0x0000, 0x00de, 0x00c6, + 0x2061, 0x12dc, 0x6028, 0x909a, 0x00c8, 0x1238, 0x8000, 0x602a, + 0x00ce, 0x080c, 0x76fd, 0x0804, 0x1bbc, 0x2061, 0x0100, 0x62c0, + 0x080c, 0x7e9f, 0x2019, 0x12e5, 0x2304, 0x9065, 0x0120, 0x2009, + 0x0027, 0x080c, 0x7f4e, 0x00ce, 0x0804, 0x1bbc, 0xd2bc, 0x0904, + 0x1bbc, 0x080c, 0x65dc, 0x6014, 0x9084, 0x1984, 0x9085, 0x0010, + 0x6016, 0x6027, 0x0004, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, + 0x4000, 0x0120, 0x6803, 0x1000, 0x6803, 0x0000, 0x00de, 0x00c6, + 0x2061, 0x12dc, 0x6044, 0x909a, 0x00c8, 0x12f0, 0x8000, 0x6046, + 0x603c, 0x00ce, 0x9005, 0x0540, 0x2009, 0x07d0, 0x080c, 0x65d4, + 0x9080, 0x0008, 0x2004, 0x9086, 0x0006, 0x1138, 0x6114, 0x918c, + 0x1984, 0x918d, 0x0012, 0x6116, 0x00b8, 0x6114, 0x918c, 0x1984, + 0x918d, 0x0016, 0x6116, 0x0080, 0x0036, 0x2019, 0x0001, 0x080c, + 0x7936, 0x003e, 0x2019, 0x12eb, 0x2304, 0x9065, 0x0120, 0x2009, + 0x004f, 0x080c, 0x7f4e, 0x00ce, 0x001e, 0xd19c, 0x0904, 0x1c32, + 0x0016, 0x0156, 0x6027, 0x0008, 0x6050, 0x9085, 0x0040, 0x6052, + 0x6050, 0x9084, 0xfbcf, 0x6052, 0x080c, 0x2055, 0x9085, 0x2000, + 0x6052, 0x20a9, 0x0012, 0x1d04, 0x1bd3, 0x2091, 0x6000, 0x1f04, + 0x1bd3, 0x6050, 0x9085, 0x0400, 0x9084, 0xdfbf, 0x6052, 0x20a9, + 0x0028, 0xa001, 0x1f04, 0x1be1, 0x6150, 0x9185, 0x1400, 0x6052, + 0x20a9, 0x0366, 0x1d04, 0x1bea, 0x2091, 0x6000, 0x6020, 0xd09c, + 0x1130, 0x015e, 0x6152, 0x001e, 0x6027, 0x0008, 0x04d8, 0x080c, + 0x201f, 0x1f04, 0x1bea, 0x015e, 0x6152, 0x001e, 0x6027, 0x0008, + 0x0016, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x080c, 0x79c2, + 0x2011, 0x0002, 0x080c, 0x79cc, 0x080c, 0x78b3, 0x080c, 0x65cf, + 0x0036, 0x2019, 0x0000, 0x080c, 0x7936, 0x003e, 0x60e3, 0x0000, + 0x080c, 0xadf2, 0x080c, 0xae0d, 0x2001, 0x1172, 0x2004, 0xd0fc, + 0x1120, 0x9085, 0x0001, 0x080c, 0x5789, 0x2001, 0x0140, 0x2003, + 0x0000, 0x2001, 0x1100, 0x2003, 0x0004, 0x6027, 0x0008, 0x080c, + 0x0b34, 0x001e, 0x918c, 0xffd0, 0x6126, 0x0005, 0x0006, 0x0016, + 0x0026, 0x0036, 0x00e6, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2071, + 0x1100, 0x71c0, 0x70c2, 0x9116, 0x01e0, 0x81ff, 0x0128, 0x2011, + 0x8011, 0x080c, 0x37dc, 0x00a8, 0x2011, 0x8012, 0x080c, 0x37dc, + 0x2001, 0x1172, 0x2004, 0xd0fc, 0x1160, 0x00c6, 0x080c, 0x1cde, + 0x2061, 0x0100, 0x2019, 0x0028, 0x2009, 0x0000, 0x080c, 0x2582, + 0x00ce, 0x012e, 0x00fe, 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, + 0x0005, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x1110, + 0x81ff, 0x0118, 0x080c, 0x6215, 0x0038, 0x9080, 0x26c1, 0x200d, + 0x918c, 0xff00, 0x810f, 0x9006, 0x0005, 0x9080, 0x26c1, 0x200d, + 0x918c, 0x00ff, 0x0005, 0x00d6, 0x2069, 0x0140, 0x2001, 0x1114, + 0x2003, 0x00ef, 0x20a9, 0x0010, 0x9006, 0x6852, 0x6856, 0x1f04, + 0x1c8e, 0x00de, 0x0005, 0x0006, 0x00d6, 0x0026, 0x2069, 0x0140, + 0x2001, 0x1114, 0x2102, 0x8114, 0x8214, 0x8214, 0x8214, 0x20a9, + 0x0010, 0x6853, 0x0000, 0x9006, 0x82ff, 0x1128, 0x9184, 0x000f, + 0x9080, 0xb1a7, 0x2005, 0x6856, 0x8211, 0x1f04, 0x1ca3, 0x002e, + 0x00de, 0x000e, 0x0005, 0x00c6, 0x2061, 0x1100, 0x6030, 0x0110, + 0xc09d, 0x0008, 0xc09c, 0x6032, 0x00ce, 0x0005, 0x0156, 0x00d6, + 0x0026, 0x0016, 0x0006, 0x2069, 0x0140, 0x6980, 0x9116, 0x0180, + 0x9112, 0x1230, 0x8212, 0x8210, 0x22a8, 0x2001, 0x0402, 0x0018, + 0x22a8, 0x2001, 0x0404, 0x680e, 0x1f04, 0x1cd3, 0x680f, 0x0000, + 0x000e, 0x001e, 0x002e, 0x00de, 0x015e, 0x0005, 0x2001, 0x1153, + 0x2004, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046, 0x2020, + 0x2009, 0x002e, 0x080c, 0xaaca, 0x004e, 0x0005, 0x00f6, 0x0016, + 0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc, 0x0904, 0x1d51, 0x2009, + 0x0100, 0x210c, 0x918a, 0x0007, 0x0610, 0x9084, 0x0700, 0x908e, + 0x0600, 0x1128, 0x2011, 0x4000, 0x2009, 0x0000, 0x0400, 0x908e, + 0x0500, 0x1128, 0x2011, 0x8000, 0x2009, 0x0000, 0x00c0, 0x908e, + 0x0400, 0x1128, 0x2011, 0x0000, 0x2009, 0x0001, 0x0080, 0x908e, + 0x0300, 0x15b8, 0x2011, 0x0000, 0x2009, 0x0002, 0x0040, 0x9084, + 0x0700, 0x908e, 0x0300, 0x1568, 0x2011, 0x0030, 0x0038, 0x2300, + 0x9080, 0x0020, 0x2018, 0x2300, 0x080c, 0x66ff, 0x2200, 0x8007, + 0x9085, 0x004c, 0x78c2, 0x2009, 0x0227, 0x210c, 0x810f, 0x918c, + 0x00ff, 0x810c, 0x2200, 0x9100, 0x2009, 0x0226, 0x210c, 0x810f, + 0x918c, 0x00ff, 0x810c, 0x9100, 0x2009, 0x0138, 0x200a, 0x080c, + 0x5745, 0x1118, 0x2009, 0x1280, 0x200a, 0x002e, 0x001e, 0x00fe, + 0x0005, 0x78c3, 0x0000, 0x0cc8, 0x0126, 0x2091, 0x2800, 0x0006, + 0x0016, 0x0026, 0x2001, 0x0170, 0x200c, 0x8000, 0x2014, 0x9184, + 0x0003, 0x0110, 0x0804, 0x0cf1, 0x002e, 0x001e, 0x000e, 0x012e, + 0x0005, 0x2001, 0x0171, 0x2004, 0xd0dc, 0x0168, 0x2001, 0x0170, + 0x200c, 0x918c, 0x00ff, 0x918e, 0x004c, 0x1128, 0x200c, 0x918c, + 0xff00, 0x810f, 0x0010, 0x2009, 0x0000, 0x2001, 0x0227, 0x2004, + 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108, 0x2001, 0x0226, 0x2004, + 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108, 0x0005, 0x0018, 0x000c, + 0x0018, 0x0020, 0x1000, 0x0800, 0x1000, 0x1800, 0x0156, 0x0006, + 0x0016, 0x0026, 0x00e6, 0x2001, 0x12b0, 0x2004, 0x908a, 0x0007, + 0x1210, 0x004b, 0x0010, 0x080c, 0x0cf1, 0x00ee, 0x002e, 0x001e, + 0x000e, 0x015e, 0x0005, 0x1db2, 0x1dd1, 0x1df6, 0x1df9, 0x1e23, + 0x1e26, 0x1e29, 0x2001, 0x0001, 0x080c, 0x1c36, 0x080c, 0x201a, + 0x2001, 0x12b2, 0x2003, 0x0000, 0x7828, 0x9084, 0xe1d7, 0x782a, + 0x2001, 0x0000, 0x20a9, 0x0009, 0x080c, 0x1fd8, 0x2001, 0x12b0, + 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x1e2a, 0x080c, 0x65e1, + 0x0005, 0x2009, 0x12b5, 0x200b, 0x0000, 0x2001, 0x12ba, 0x2003, + 0x0036, 0x2001, 0x12b9, 0x2003, 0x002a, 0x2001, 0x12b2, 0x2003, + 0x0001, 0x2001, 0x0000, 0x080c, 0x1f92, 0x2001, 0xffff, 0x20a9, + 0x0009, 0x080c, 0x1fd8, 0x2001, 0x12b0, 0x2003, 0x0006, 0x2009, + 0x001e, 0x2011, 0x1e2a, 0x080c, 0x65e1, 0x0005, 0x080c, 0x0cf1, + 0x0005, 0x2001, 0x12ba, 0x2003, 0x0036, 0x2001, 0x12b2, 0x2003, + 0x0003, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0118, 0x2001, + 0x0000, 0x0010, 0x2001, 0x0001, 0x080c, 0x1f92, 0x2001, 0x12b6, + 0x2003, 0x0000, 0x2001, 0xffff, 0x20a9, 0x0009, 0x080c, 0x1fd8, + 0x2001, 0x12b0, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x1e2a, + 0x080c, 0x65e1, 0x0005, 0x080c, 0x0cf1, 0x0005, 0x080c, 0x0cf1, + 0x0005, 0x0005, 0x0006, 0x0016, 0x0026, 0x00e6, 0x00f6, 0x0156, + 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x2001, 0x12b2, 0x2004, + 0x908a, 0x0007, 0x1210, 0x005b, 0x0010, 0x080c, 0x0cf1, 0x012e, + 0x015e, 0x00fe, 0x00ee, 0x002e, 0x001e, 0x000e, 0x0005, 0x1e4e, + 0x1e6e, 0x1eaf, 0x1edf, 0x1f03, 0x1f13, 0x1f16, 0x080c, 0x1fcc, + 0x11b0, 0x7850, 0x9084, 0xefff, 0x7852, 0x2009, 0x12b8, 0x2104, + 0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0xc08d, 0x0008, + 0xc085, 0x200a, 0x2001, 0x12b0, 0x2003, 0x0001, 0x0030, 0x080c, + 0x1f3e, 0x2001, 0xffff, 0x080c, 0x1dc2, 0x0005, 0x080c, 0x1f19, + 0x05e8, 0x2009, 0x12b9, 0x2104, 0x8001, 0x200a, 0x080c, 0x1fcc, + 0x1178, 0x7850, 0x9084, 0xefff, 0x7852, 0x7a38, 0x9294, 0x0005, + 0x9296, 0x0005, 0x0520, 0x2009, 0x12b8, 0x2104, 0xc085, 0x200a, + 0x2009, 0x12b5, 0x2104, 0x8000, 0x200a, 0x9086, 0x0005, 0x0118, + 0x080c, 0x1f22, 0x00c8, 0x200b, 0x0000, 0x7a38, 0x9294, 0x0006, + 0x9296, 0x0004, 0x0118, 0x2001, 0x0000, 0x0010, 0x2001, 0x0001, + 0x080c, 0x1faf, 0x2001, 0x12b2, 0x2003, 0x0002, 0x0028, 0x2001, + 0x12b0, 0x2003, 0x0003, 0x0010, 0x080c, 0x1de5, 0x0005, 0x080c, + 0x1f19, 0x0560, 0x2009, 0x12b9, 0x2104, 0x8001, 0x200a, 0x080c, + 0x1fcc, 0x1168, 0x7850, 0x9084, 0xefff, 0x7852, 0x2001, 0x12b0, + 0x2003, 0x0003, 0x2001, 0x12b1, 0x2003, 0x0000, 0x00b8, 0x2009, + 0x12b9, 0x2104, 0x9005, 0x1118, 0x080c, 0x1f63, 0x0010, 0x080c, + 0x1f30, 0x080c, 0x1f22, 0x2009, 0x12b5, 0x200b, 0x0000, 0x2001, + 0x12b2, 0x2003, 0x0001, 0x080c, 0x1de5, 0x0000, 0x0005, 0x04c9, + 0x0508, 0x080c, 0x1fcc, 0x11b8, 0x7850, 0x9084, 0xefff, 0x7852, + 0x2009, 0x12b6, 0x2104, 0x8000, 0x200a, 0x9086, 0x0007, 0x0108, + 0x0078, 0x2001, 0x12bb, 0x2003, 0x000a, 0x2009, 0x12b8, 0x2104, + 0xc0fd, 0x200a, 0x0038, 0x0431, 0x2001, 0x12b2, 0x2003, 0x0004, + 0x080c, 0x1e12, 0x0005, 0x00a9, 0x0168, 0x080c, 0x1fcc, 0x1138, + 0x7850, 0x9084, 0xefff, 0x7852, 0x080c, 0x1dfd, 0x0018, 0x0091, + 0x080c, 0x1e12, 0x0005, 0x080c, 0x0cf1, 0x0005, 0x080c, 0x0cf1, + 0x0005, 0x2009, 0x12ba, 0x2104, 0x8001, 0x200a, 0x1110, 0x080c, + 0x1f80, 0x0005, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0005, 0x0118, + 0x2001, 0x0000, 0x0010, 0x2001, 0x0001, 0x080c, 0x1faf, 0x0005, + 0x7a38, 0x9294, 0x0006, 0x9296, 0x0006, 0x0118, 0x2001, 0x0000, + 0x0010, 0x2001, 0x0001, 0x080c, 0x1f92, 0x0005, 0x2009, 0x12b5, + 0x2104, 0x8000, 0x200a, 0x9086, 0x0005, 0x0108, 0x0070, 0x200b, + 0x0000, 0x7a38, 0x9294, 0x0006, 0x9296, 0x0006, 0x0118, 0x2001, + 0x0000, 0x0010, 0x2001, 0x0001, 0x04e9, 0x7a38, 0x9294, 0x0005, + 0x9296, 0x0005, 0x0118, 0x2001, 0x0000, 0x0010, 0x2001, 0x0001, + 0x080c, 0x1faf, 0x0005, 0x0086, 0x2001, 0x12b8, 0x2004, 0x9084, + 0x7fff, 0x090c, 0x0cf1, 0x2009, 0x12b7, 0x2144, 0x8846, 0x280a, + 0x9844, 0x0dd8, 0xd08c, 0x1120, 0xd084, 0x1128, 0x080c, 0x0cf1, + 0x2001, 0x0000, 0x0010, 0x2001, 0x0001, 0x00a1, 0x008e, 0x0005, + 0x0006, 0x0156, 0x2001, 0x12b0, 0x20a9, 0x0009, 0x2003, 0x0000, + 0x8000, 0x1f04, 0x1f86, 0x2001, 0x12b7, 0x2003, 0x8000, 0x015e, + 0x000e, 0x0005, 0x00f6, 0x2079, 0x0100, 0x9085, 0x0000, 0x0158, + 0x7838, 0x9084, 0xfff9, 0x9085, 0x0004, 0x783a, 0x2009, 0x12bd, + 0x210c, 0x795a, 0x0050, 0x7838, 0x9084, 0xfffb, 0x9085, 0x0006, + 0x783a, 0x2009, 0x12be, 0x210c, 0x795a, 0x00fe, 0x0005, 0x00f6, + 0x2079, 0x0100, 0x9085, 0x0000, 0x0138, 0x7838, 0x9084, 0xfffa, + 0x9085, 0x0004, 0x783a, 0x0030, 0x7838, 0x9084, 0xfffb, 0x9085, + 0x0005, 0x783a, 0x00fe, 0x0005, 0x0006, 0x2001, 0x0100, 0x2004, + 0x9082, 0x0007, 0x000e, 0x0005, 0x0156, 0x20a9, 0x0064, 0x7820, + 0x080c, 0x2055, 0xd09c, 0x1110, 0x1f04, 0x1fcf, 0x015e, 0x0005, + 0x0126, 0x0016, 0x0006, 0x2091, 0x8000, 0x7850, 0x9085, 0x0040, + 0x7852, 0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2055, 0x9085, + 0x2000, 0x7852, 0x000e, 0x2008, 0x9186, 0x0000, 0x1118, 0x783b, + 0x0007, 0x0090, 0x9186, 0x0001, 0x1118, 0x783b, 0x0006, 0x0060, + 0x9186, 0x0002, 0x1118, 0x783b, 0x0005, 0x0030, 0x9186, 0x0003, + 0x1118, 0x783b, 0x0004, 0x0000, 0x0006, 0x1d04, 0x2005, 0x2091, + 0x6000, 0x1f04, 0x2005, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf, + 0x7852, 0x080c, 0x2055, 0x9085, 0x1000, 0x7852, 0x000e, 0x001e, + 0x012e, 0x0005, 0x7850, 0x9084, 0xffcf, 0x7852, 0x0005, 0x0006, + 0x0156, 0x00f6, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd0ac, + 0x1100, 0x7854, 0xd08c, 0x1110, 0x1f04, 0x2029, 0x00fe, 0x015e, + 0x000e, 0x0005, 0x7820, 0x0409, 0xd09c, 0x0005, 0x1d04, 0x2036, + 0x2091, 0x6000, 0x1f04, 0x2036, 0x0005, 0x0006, 0x2001, 0x12bc, + 0x2004, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x2001, 0x12bc, + 0x2004, 0x9086, 0x0001, 0x000e, 0x0005, 0x0006, 0x2001, 0x12bc, + 0x2004, 0x9086, 0x0002, 0x000e, 0x0005, 0xa001, 0xa001, 0xa001, + 0xa001, 0xa001, 0x0005, 0x2009, 0x0171, 0x2104, 0xd0dc, 0x0140, + 0x2009, 0x0170, 0x2104, 0x200b, 0x0080, 0xa001, 0xa001, 0x200a, + 0x0005, 0x0036, 0x0046, 0x2001, 0x0141, 0x200c, 0x918c, 0xff00, + 0x9186, 0x2000, 0x0118, 0x9186, 0x0100, 0x1560, 0x2009, 0x017f, + 0x200b, 0x00a2, 0x2009, 0x0169, 0x2019, 0x0160, 0x2324, 0x2011, + 0x0003, 0x2104, 0x9084, 0x0007, 0x9086, 0x0003, 0x11b8, 0x2304, + 0x9402, 0x02a0, 0x1d98, 0x8211, 0x1da0, 0x84ff, 0x0170, 0x2001, + 0x0141, 0x200c, 0x918c, 0xff00, 0x9186, 0x0100, 0x0130, 0x2009, + 0x110c, 0x2104, 0xc0dd, 0x200a, 0x0008, 0x0419, 0x2001, 0x017f, + 0x2003, 0x0000, 0x004e, 0x003e, 0x0005, 0x2001, 0x110c, 0x2004, + 0xd0dc, 0x01b0, 0x2001, 0x0160, 0x2004, 0x9005, 0x0140, 0x2001, + 0x0141, 0x2004, 0x9084, 0xff00, 0x9086, 0x0100, 0x1148, 0x0126, + 0x2091, 0x8000, 0x0016, 0x0026, 0x0021, 0x002e, 0x001e, 0x012e, + 0x0005, 0x00c6, 0x2061, 0x0100, 0x6014, 0x0006, 0x2001, 0x0161, + 0x2003, 0x0000, 0x6017, 0x0018, 0xa001, 0xa001, 0x602f, 0x0008, + 0x6104, 0x918e, 0x0010, 0x6106, 0x918e, 0x0010, 0x6106, 0x6017, + 0x0040, 0x2001, 0x0140, 0x2003, 0x1000, 0x2003, 0x0000, 0x001e, + 0x9184, 0x0003, 0x01c0, 0x0036, 0x2019, 0x0141, 0x2304, 0x9084, + 0xff00, 0x9086, 0x0800, 0x1dd0, 0x919c, 0xffe4, 0x9184, 0x0001, + 0x0118, 0x9385, 0x0009, 0x6016, 0x9184, 0x0002, 0x0118, 0x9385, + 0x0012, 0x6016, 0x003e, 0x2001, 0x110c, 0x200c, 0xc1dc, 0x2102, + 0x00ce, 0x0005, 0x23cc, 0x23cc, 0x2192, 0x219e, 0x21aa, 0x21b6, + 0x21c2, 0x21d0, 0x21de, 0x21ea, 0x21f6, 0x2204, 0x2212, 0x2220, + 0x222e, 0x223e, 0x2250, 0x2250, 0x225c, 0x225c, 0x226a, 0x226a, + 0x2288, 0x2288, 0x22a8, 0x22a8, 0x2278, 0x2278, 0x2298, 0x2298, + 0x22b6, 0x22b6, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, + 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, + 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, + 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, + 0x224e, 0x224e, 0x22c8, 0x22c8, 0x22d4, 0x22d4, 0x22e2, 0x22e2, + 0x22f0, 0x22f0, 0x2300, 0x2300, 0x230e, 0x230e, 0x231e, 0x231e, + 0x232e, 0x232e, 0x2340, 0x2340, 0x234e, 0x234e, 0x235e, 0x235e, + 0x2380, 0x2380, 0x23a2, 0x23a2, 0x236e, 0x236e, 0x2391, 0x2391, + 0x23b1, 0x23b1, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, + 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, + 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, + 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, + 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, + 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, 0x224e, + 0x224e, 0x224e, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, + 0x0146, 0x0156, 0x080c, 0x195f, 0x0804, 0x23c4, 0x0106, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x195f, + 0x0804, 0x23c4, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, + 0x0146, 0x0156, 0x080c, 0x1745, 0x0804, 0x23c4, 0x0106, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1745, + 0x0804, 0x23c4, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, + 0x0146, 0x0156, 0x080c, 0x195f, 0x080c, 0x1745, 0x0804, 0x23c4, + 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, + 0x080c, 0x195f, 0x080c, 0x1745, 0x0804, 0x23c4, 0x0106, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1787, + 0x0804, 0x23c4, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, + 0x0146, 0x0156, 0x080c, 0x1787, 0x0804, 0x23c4, 0x0106, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x195f, + 0x080c, 0x1787, 0x0804, 0x23c4, 0x0106, 0x0006, 0x0126, 0x01c6, + 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x195f, 0x080c, 0x1787, + 0x0804, 0x23c4, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, + 0x0146, 0x0156, 0x080c, 0x1745, 0x080c, 0x1787, 0x0804, 0x23c4, + 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, + 0x080c, 0x1745, 0x080c, 0x1787, 0x0804, 0x23c4, 0x0106, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x195f, + 0x080c, 0x1745, 0x080c, 0x1787, 0x0804, 0x23c4, 0x0106, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x195f, + 0x080c, 0x1745, 0x080c, 0x1787, 0x0804, 0x23c4, 0xa001, 0x0cf0, + 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, + 0x080c, 0x0fcc, 0x0804, 0x23c4, 0x0106, 0x0006, 0x0126, 0x01c6, + 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x195f, 0x080c, 0x0fcc, + 0x0804, 0x23c4, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, + 0x0146, 0x0156, 0x080c, 0x1745, 0x080c, 0x0fcc, 0x0804, 0x23c4, + 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, + 0x080c, 0x195f, 0x080c, 0x0fcc, 0x080c, 0x1787, 0x0804, 0x23c4, + 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, + 0x080c, 0x195f, 0x080c, 0x1745, 0x080c, 0x0fcc, 0x0804, 0x23c4, + 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, + 0x080c, 0x1745, 0x080c, 0x0fcc, 0x080c, 0x1787, 0x0804, 0x23c4, + 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, + 0x080c, 0x0fcc, 0x080c, 0x1787, 0x0804, 0x23c4, 0x0106, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x195f, + 0x080c, 0x1745, 0x080c, 0x0fcc, 0x080c, 0x1787, 0x0804, 0x23c4, + 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, + 0x080c, 0x1d54, 0x0804, 0x23c4, 0x0106, 0x0006, 0x0126, 0x01c6, + 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1d54, 0x080c, 0x195f, + 0x0804, 0x23c4, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, + 0x0146, 0x0156, 0x080c, 0x1d54, 0x080c, 0x1745, 0x0804, 0x23c4, + 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, + 0x080c, 0x1d54, 0x080c, 0x195f, 0x080c, 0x1745, 0x0804, 0x23c4, + 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, + 0x080c, 0x1d54, 0x080c, 0x1787, 0x0804, 0x23c4, 0x0106, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1d54, + 0x080c, 0x195f, 0x080c, 0x1787, 0x0804, 0x23c4, 0x0106, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1d54, + 0x080c, 0x1745, 0x080c, 0x1787, 0x0804, 0x23c4, 0x0106, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1d54, + 0x080c, 0x195f, 0x080c, 0x1745, 0x080c, 0x1787, 0x0804, 0x23c4, + 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, + 0x080c, 0x1d54, 0x080c, 0x0fcc, 0x0804, 0x23c4, 0x0106, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1d54, + 0x080c, 0x195f, 0x080c, 0x0fcc, 0x0804, 0x23c4, 0x0106, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1d54, + 0x080c, 0x1745, 0x080c, 0x0fcc, 0x0804, 0x23c4, 0x0106, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1d54, + 0x080c, 0x195f, 0x080c, 0x0fcc, 0x080c, 0x1787, 0x0804, 0x23c4, + 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, + 0x080c, 0x1d54, 0x080c, 0x195f, 0x080c, 0x1745, 0x080c, 0x0fcc, + 0x0498, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, + 0x0156, 0x080c, 0x1d54, 0x080c, 0x1745, 0x080c, 0x0fcc, 0x080c, + 0x1787, 0x0410, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, + 0x0146, 0x0156, 0x080c, 0x1d54, 0x080c, 0x0fcc, 0x080c, 0x1787, + 0x0098, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, + 0x0156, 0x080c, 0x1d54, 0x080c, 0x195f, 0x080c, 0x1745, 0x080c, + 0x0fcc, 0x080c, 0x1787, 0x0000, 0x015e, 0x014e, 0x013e, 0x01de, + 0x01ce, 0x012e, 0x000e, 0x010e, 0x000d, 0x00c6, 0x0026, 0x0046, + 0x2021, 0x0000, 0x080c, 0x4de0, 0x1904, 0x24aa, 0x72cc, 0x2001, + 0x128f, 0x2004, 0x9005, 0x1110, 0xd29c, 0x0148, 0xd284, 0x1138, + 0xd2bc, 0x1904, 0x24aa, 0x080c, 0x24ae, 0x0804, 0x24aa, 0xd2cc, + 0x1904, 0x24aa, 0x080c, 0x5745, 0x1120, 0x709b, 0xffff, 0x0804, + 0x24aa, 0xd294, 0x0120, 0x709b, 0xffff, 0x0804, 0x24aa, 0x2001, + 0x1114, 0x203c, 0x7284, 0xd284, 0x0904, 0x244c, 0xd28c, 0x1904, + 0x244c, 0x0036, 0x7398, 0x938e, 0xffff, 0x1110, 0x2019, 0x0001, + 0x8314, 0x92e0, 0x1580, 0x2c04, 0x938c, 0x0001, 0x0120, 0x9084, + 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x970e, 0x0560, 0x908e, + 0x0000, 0x0548, 0x908e, 0x00ff, 0x1150, 0x7230, 0xd284, 0x1538, + 0x7284, 0xc28d, 0x7286, 0x709b, 0xffff, 0x003e, 0x0428, 0x2009, + 0x0000, 0x080c, 0x1c69, 0x080c, 0x4b03, 0x11b8, 0x6004, 0x9084, + 0x00ff, 0x9086, 0x0006, 0x1150, 0x7030, 0xd08c, 0x0118, 0x6000, + 0xd0bc, 0x0120, 0x080c, 0x24c1, 0x0140, 0x0028, 0x080c, 0x25ec, + 0x080c, 0x24ef, 0x0110, 0x8318, 0x0818, 0x739a, 0x0010, 0x709b, + 0xffff, 0x003e, 0x0804, 0x24aa, 0x9780, 0x26c1, 0x203d, 0x97bc, + 0xff00, 0x873f, 0x2041, 0x007e, 0x7098, 0x9096, 0xffff, 0x1120, + 0x2009, 0x0000, 0x28a8, 0x0050, 0x9812, 0x0220, 0x2008, 0x9802, + 0x20a8, 0x0020, 0x709b, 0xffff, 0x0804, 0x24aa, 0x2700, 0x0156, + 0x0016, 0x9106, 0x05a0, 0xc484, 0x080c, 0x4b58, 0x0120, 0x080c, + 0x4b03, 0x15a8, 0x0008, 0xc485, 0x6004, 0x9084, 0x00ff, 0x9086, + 0x0006, 0x1130, 0x7030, 0xd08c, 0x01e8, 0x6000, 0xd0bc, 0x11d0, + 0x7284, 0xd28c, 0x0188, 0x6004, 0x9084, 0x00ff, 0x9082, 0x0006, + 0x02b0, 0xd484, 0x1118, 0x080c, 0x4b20, 0x0028, 0x080c, 0x2676, + 0x0170, 0x080c, 0x26a3, 0x0058, 0x080c, 0x25ec, 0x080c, 0x24ef, + 0x0170, 0x0028, 0x080c, 0x2676, 0x0110, 0x0419, 0x0140, 0x001e, + 0x8108, 0x015e, 0x1f04, 0x2466, 0x709b, 0xffff, 0x0018, 0x001e, + 0x015e, 0x719a, 0x004e, 0x002e, 0x00ce, 0x0005, 0x00c6, 0x0016, + 0x709b, 0x0001, 0x2009, 0x007e, 0x080c, 0x4b03, 0x1138, 0x080c, + 0x25ec, 0x04a9, 0x0118, 0x70cc, 0xc0bd, 0x70ce, 0x001e, 0x00ce, + 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2c68, 0x2001, 0x1157, + 0x2004, 0x9084, 0x00ff, 0x6842, 0x080c, 0x984d, 0x01d8, 0x2d00, + 0x6012, 0x080c, 0x99cc, 0x6023, 0x0001, 0x2001, 0x0000, 0x080c, + 0x4aa1, 0x2001, 0x0000, 0x080c, 0x4ab3, 0x0126, 0x2091, 0x8000, + 0x7094, 0x8000, 0x7096, 0x012e, 0x2009, 0x0004, 0x080c, 0x7f4e, + 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x0016, + 0x0076, 0x00d6, 0x00c6, 0x2c68, 0x2001, 0x1157, 0x2004, 0x9084, + 0x00ff, 0x6842, 0x080c, 0x984d, 0x0550, 0x2d00, 0x6012, 0x6800, + 0xc0c4, 0x6802, 0x68a0, 0x9086, 0x007e, 0x0140, 0x6804, 0x9084, + 0x00ff, 0x9086, 0x0006, 0x1110, 0x080c, 0x25ad, 0x080c, 0x99cc, + 0x6023, 0x0001, 0x2001, 0x0000, 0x080c, 0x4aa1, 0x2001, 0x0002, + 0x080c, 0x4ab3, 0x0126, 0x2091, 0x8000, 0x7094, 0x8000, 0x7096, + 0x012e, 0x2009, 0x0002, 0x080c, 0x7f4e, 0x9085, 0x0001, 0x00ce, + 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x0026, 0x2009, 0x0080, + 0x080c, 0x4b03, 0x1120, 0x0031, 0x0110, 0x70d3, 0xffff, 0x002e, + 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2c68, 0x080c, + 0x7ec8, 0x01d8, 0x2d00, 0x6012, 0x080c, 0x99cc, 0x6023, 0x0001, + 0x2001, 0x0000, 0x080c, 0x4aa1, 0x2001, 0x0002, 0x080c, 0x4ab3, + 0x0126, 0x2091, 0x8000, 0x70d4, 0x8000, 0x70d6, 0x012e, 0x2009, + 0x0002, 0x080c, 0x7f4e, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, + 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2009, + 0x007f, 0x080c, 0x4b03, 0x1190, 0x2c68, 0x080c, 0x7ec8, 0x0170, + 0x2d00, 0x6012, 0x6316, 0x6023, 0x0001, 0x620a, 0x080c, 0x99cc, + 0x2009, 0x0022, 0x080c, 0x7f4e, 0x9085, 0x0001, 0x012e, 0x00de, + 0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036, 0x0026, 0x080c, + 0x69d6, 0x080c, 0x697f, 0x080c, 0x89dd, 0x2130, 0x81ff, 0x0128, + 0x20a9, 0x007e, 0x2009, 0x0000, 0x0020, 0x20a9, 0x007f, 0x2009, + 0x0000, 0x0016, 0x080c, 0x4b58, 0x1110, 0x080c, 0x472d, 0x001e, + 0x8108, 0x1f04, 0x2599, 0x86ff, 0x1110, 0x080c, 0x0a33, 0x002e, + 0x003e, 0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0036, + 0x0026, 0x0016, 0x6210, 0x2270, 0x72a0, 0x0026, 0x2019, 0x0029, + 0x080c, 0x69ca, 0x0076, 0x2039, 0x0000, 0x080c, 0x68fe, 0x2c08, + 0x080c, 0xa85f, 0x007e, 0x001e, 0x2e60, 0x6210, 0x6314, 0x080c, + 0x472d, 0x6212, 0x6316, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, + 0x0005, 0x00e6, 0x0006, 0x6010, 0x9080, 0x0028, 0x2004, 0x9086, + 0x0080, 0x0150, 0x2071, 0x1100, 0x7094, 0x9005, 0x0110, 0x8001, + 0x7096, 0x000e, 0x00ee, 0x0005, 0x2071, 0x1100, 0x70d4, 0x9005, + 0x0dc0, 0x8001, 0x70d6, 0x0ca8, 0x6000, 0xc08c, 0x6002, 0x0005, + 0x00f6, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x0156, 0x2178, + 0x81ff, 0x1118, 0x20a9, 0x0001, 0x0098, 0x2001, 0x1153, 0x2004, + 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046, 0x2020, 0x2009, + 0x002d, 0x080c, 0xaaca, 0x004e, 0x20a9, 0x00ff, 0x2011, 0x0000, + 0x0026, 0x928e, 0x007e, 0x0904, 0x2655, 0x928e, 0x007f, 0x05e8, + 0x928e, 0x0080, 0x05d0, 0x9288, 0x1000, 0x210c, 0x81ff, 0x05a8, + 0x8fff, 0x1148, 0x2001, 0x12ae, 0x0006, 0x2003, 0x0001, 0x04c9, + 0x000e, 0x2003, 0x0000, 0x00c6, 0x2160, 0x2001, 0x0001, 0x080c, + 0x4dea, 0x00ce, 0x2019, 0x0029, 0x080c, 0x69ca, 0x0076, 0x2039, + 0x0000, 0x080c, 0x68fe, 0x00c6, 0x0026, 0x2160, 0x6204, 0x9294, + 0x00ff, 0x9286, 0x0006, 0x1118, 0x6007, 0x0404, 0x0028, 0x2001, + 0x0004, 0x8007, 0x9215, 0x6206, 0x002e, 0x00ce, 0x0016, 0x2c08, + 0x080c, 0xa85f, 0x001e, 0x007e, 0x2160, 0x002e, 0x8210, 0x1f04, + 0x2610, 0x015e, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, 0x00fe, + 0x0005, 0x0046, 0x0026, 0x0016, 0x2001, 0x1153, 0x2004, 0xd0c4, + 0x0148, 0xd0a4, 0x0138, 0x9006, 0x2220, 0x8427, 0x2009, 0x0029, + 0x080c, 0xaaca, 0x001e, 0x002e, 0x004e, 0x0005, 0x0016, 0x0026, + 0x0036, 0x00c6, 0x7284, 0x82ff, 0x01f8, 0x2011, 0x1153, 0x2214, + 0xd2ac, 0x11d0, 0x2100, 0x080c, 0x1c7d, 0x81ff, 0x01b8, 0x2019, + 0x0001, 0x8314, 0x92e0, 0x1580, 0x2c04, 0xd384, 0x0120, 0x9084, + 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x9116, 0x0138, 0x9096, + 0x00ff, 0x0110, 0x8318, 0x0c68, 0x9085, 0x0001, 0x00ce, 0x003e, + 0x002e, 0x001e, 0x0005, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, + 0x9180, 0x1000, 0x2004, 0x9065, 0x0158, 0x0016, 0x00c6, 0x2061, + 0x135e, 0x001e, 0x6112, 0x080c, 0x25ad, 0x001e, 0x080c, 0x4b20, + 0x012e, 0x00ce, 0x001e, 0x0005, 0x2001, 0x1133, 0x2004, 0xd0cc, + 0x0005, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, + 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, + 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, + 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, + 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, + 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, + 0x809b, 0x8098, 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, + 0x8081, 0x8080, 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, + 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, + 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, + 0x8056, 0x8055, 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, + 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, + 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, + 0x4831, 0x802e, 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, + 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, + 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, + 0x8000, 0x3800, 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, + 0x8000, 0x3400, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, + 0x3300, 0x3200, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, + 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, + 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, + 0x2800, 0x8000, 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, + 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, + 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, + 0x8000, 0x8000, 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, + 0x1500, 0x8000, 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, + 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, + 0x8000, 0x8000, 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, + 0x8000, 0x0500, 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, + 0x8000, 0x0100, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, + 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, + 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, + 0x8000, 0x2071, 0x1193, 0x7003, 0x0002, 0x9006, 0x7012, 0x7016, + 0x703a, 0x703e, 0x7033, 0x11a3, 0x7037, 0x11a3, 0x7007, 0x0001, + 0x2061, 0x11e3, 0x6003, 0x0002, 0x0005, 0x1004, 0x27e4, 0x0e04, + 0x27e4, 0x2071, 0x1193, 0x2b78, 0x2a60, 0x7880, 0x908e, 0x0069, + 0x1904, 0x28cc, 0x0804, 0x2860, 0x0005, 0x2071, 0x1193, 0x7004, + 0x0002, 0x27ed, 0x27ee, 0x27f5, 0x2806, 0x0005, 0x1004, 0x27f4, + 0x0e04, 0x27f4, 0x2b78, 0x00e8, 0x0005, 0x2b78, 0x2061, 0x11e3, + 0x6008, 0x908e, 0x0100, 0x0128, 0x9086, 0x0200, 0x0904, 0x28c6, + 0x0005, 0x7014, 0x2068, 0x2a60, 0x7018, 0x0807, 0x7010, 0x2068, + 0x6864, 0x9086, 0x0103, 0x0108, 0x0005, 0x2a60, 0x2b78, 0x7018, + 0x0807, 0x2a60, 0x7880, 0x908a, 0x0040, 0x1210, 0x61c0, 0x0042, + 0x2100, 0x908a, 0x003f, 0x1a04, 0x28c3, 0x61c0, 0x0804, 0x2860, + 0x28a2, 0x28d2, 0x28dc, 0x28e0, 0x28ea, 0x28f0, 0x28f4, 0x2904, + 0x2907, 0x2911, 0x2916, 0x291b, 0x2926, 0x2931, 0x2940, 0x294f, + 0x295d, 0x2974, 0x298f, 0x2a10, 0x2a15, 0x2a3e, 0x2a8b, 0x2a9c, + 0x2aba, 0x28c3, 0x28c3, 0x28c3, 0x2af1, 0x2b10, 0x2b19, 0x2b4c, + 0x2b52, 0x28c3, 0x2b7b, 0x28c3, 0x28c3, 0x28c3, 0x28c3, 0x28c3, + 0x2b86, 0x2b90, 0x28c3, 0x28c3, 0x28c3, 0x28c3, 0x28c3, 0x28c3, + 0x28c3, 0x28c3, 0x2b98, 0x28c3, 0x28c3, 0x28c3, 0x28c3, 0x28c3, + 0x2bb5, 0x2bdb, 0x28c3, 0x28c3, 0x28c3, 0x28c3, 0x28c3, 0x28c3, + 0x0002, 0x2c05, 0x2c59, 0x2cb4, 0x2cc7, 0x28c3, 0x2ce1, 0x3102, + 0x3b4e, 0x28c3, 0x28c3, 0x28c3, 0x28c3, 0x28c3, 0x28c3, 0x28c3, + 0x28c3, 0x2911, 0x2916, 0x3104, 0x28c3, 0x3116, 0x3bde, 0x3c39, + 0x3c9f, 0x28c3, 0x3d00, 0x3d2a, 0x3d4f, 0x3e32, 0x3d81, 0x3ddc, + 0x28c3, 0x311a, 0x32a9, 0x32bf, 0x32dd, 0x3342, 0x33a8, 0x33b3, + 0x33ea, 0x33f9, 0x3408, 0x340b, 0x3433, 0x3486, 0x3502, 0x350f, + 0x3612, 0x3732, 0x375b, 0x3856, 0x3878, 0x3884, 0x38bd, 0x398a, + 0x28c3, 0x28c3, 0x28c3, 0x28c3, 0x39f2, 0x3a0d, 0x3a85, 0x3b3f, + 0x713c, 0x0000, 0x2021, 0x4000, 0x080c, 0x37b8, 0x0126, 0x2091, + 0x8000, 0x0e04, 0x28ac, 0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, + 0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010, 0x7c82, + 0x7986, 0x7a8a, 0x7b8e, 0x2091, 0x4080, 0x7007, 0x0001, 0x2091, + 0x5000, 0x012e, 0x0005, 0x2021, 0x4001, 0x08f0, 0x2021, 0x4002, + 0x08d8, 0x2021, 0x4003, 0x08c0, 0x2021, 0x4005, 0x08a8, 0x2021, + 0x4006, 0x0890, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, + 0x7884, 0x7990, 0x0804, 0x37c5, 0x7883, 0x0004, 0x7884, 0x0807, + 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, + 0x0804, 0x37c8, 0x7984, 0x7888, 0x2114, 0x200a, 0x0804, 0x28a2, + 0x7984, 0x2114, 0x0804, 0x28a2, 0x20e1, 0x0000, 0x2099, 0x0021, + 0x20e9, 0x0000, 0x20a1, 0x0021, 0x20a9, 0x001f, 0x4003, 0x7984, + 0x7a88, 0x7b8c, 0x0804, 0x28a2, 0x7884, 0x2060, 0x04d8, 0x2009, + 0x0003, 0x2011, 0x0000, 0x2019, 0x0018, 0x789b, 0x0017, 0x0804, + 0x28a2, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0800, 0x2039, 0x0001, + 0x7d98, 0x7c9c, 0x0848, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, + 0x28cf, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x28d6, 0x79a0, 0x9182, + 0x0040, 0x0210, 0x0804, 0x28cf, 0x2138, 0x7d98, 0x7c9c, 0x0804, + 0x28e4, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x28cf, 0x21e8, + 0x7984, 0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804, 0x28a2, + 0x2061, 0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60, 0x8109, + 0x1dd8, 0x2010, 0x9005, 0x0904, 0x28a2, 0x0804, 0x28c9, 0x79a0, + 0x9182, 0x0040, 0x0210, 0x0804, 0x28cf, 0x21e0, 0x20a9, 0x0001, + 0x7984, 0x2198, 0x4012, 0x0804, 0x28a2, 0x2069, 0x1152, 0x7884, + 0x7990, 0x911a, 0x1a04, 0x28cf, 0x8019, 0x0904, 0x28cf, 0x684a, + 0x6942, 0x788c, 0x6852, 0x7888, 0x6856, 0x9006, 0x685a, 0x685e, + 0x080c, 0x5a12, 0x0804, 0x28a2, 0x2069, 0x1152, 0x7884, 0x7994, + 0x911a, 0x1a04, 0x28cf, 0x8019, 0x0904, 0x28cf, 0x684e, 0x6946, + 0x788c, 0x6862, 0x7888, 0x6866, 0x9006, 0x686a, 0x686e, 0x0126, + 0x2091, 0x8000, 0x080c, 0x4e87, 0x012e, 0x0804, 0x28a2, 0x902e, + 0x2520, 0x81ff, 0x1904, 0x28cc, 0x7984, 0x7b88, 0x7a8c, 0x20a9, + 0x0005, 0x20e9, 0x0001, 0x20a1, 0x119a, 0x4101, 0x080c, 0x3784, + 0x0904, 0x28cc, 0x2009, 0x0020, 0x2039, 0x0001, 0x080c, 0x37c5, + 0x701b, 0x29ab, 0x0005, 0x6864, 0x2008, 0x9084, 0x00ff, 0x9096, + 0x0011, 0x0120, 0x9096, 0x0019, 0x1904, 0x28cc, 0x810f, 0x918c, + 0x00ff, 0x0904, 0x28cc, 0x710e, 0x700c, 0x8001, 0x0538, 0x700e, + 0x080c, 0x3784, 0x0904, 0x28cc, 0x2009, 0x0020, 0x2061, 0x11e3, + 0x6228, 0x632c, 0x6430, 0x6534, 0x9290, 0x0040, 0x9399, 0x0000, + 0x94a1, 0x0000, 0x95a9, 0x0000, 0x2039, 0x0001, 0x080c, 0x37c5, + 0x701b, 0x29db, 0x0005, 0x6864, 0x9084, 0x00ff, 0x9096, 0x0002, + 0x0120, 0x9096, 0x000a, 0x1904, 0x28cc, 0x08b0, 0x7010, 0x2068, + 0x6868, 0xc0fd, 0x686a, 0x080c, 0x4a18, 0x1128, 0x7007, 0x0003, + 0x701b, 0x29f5, 0x0005, 0x080c, 0x52a0, 0x0126, 0x2091, 0x8000, + 0x20a9, 0x0005, 0x20e1, 0x0001, 0x2099, 0x119a, 0x400a, 0x2100, + 0x9210, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0x9d80, + 0x0019, 0x2009, 0x0020, 0x012e, 0x2039, 0x0001, 0x0804, 0x37c8, + 0x61a8, 0x7884, 0x60aa, 0x0804, 0x28a2, 0x2091, 0x8000, 0x7837, + 0x4000, 0x7833, 0x0010, 0x7883, 0x4000, 0x7887, 0x4953, 0x788b, + 0x5020, 0x788f, 0x2020, 0x2009, 0x017f, 0x2104, 0x7892, 0x3f00, + 0x7896, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200, 0x603c, 0x8007, + 0x9205, 0x789a, 0x2009, 0x04fd, 0x2104, 0x789e, 0x2091, 0x5000, + 0x2091, 0x4080, 0x2071, 0x0080, 0x0804, 0x0427, 0x81ff, 0x1904, + 0x28cc, 0x7984, 0x810f, 0x918c, 0x00ff, 0x080c, 0x4b58, 0x1904, + 0x28cf, 0x7e98, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0210, 0x0804, + 0x28cf, 0x7c88, 0x7d8c, 0x080c, 0x4ca3, 0x080c, 0x4c75, 0x0000, + 0x1518, 0x2061, 0x15c0, 0x0126, 0x2091, 0x8000, 0x6000, 0x9086, + 0x0000, 0x0148, 0x6014, 0x906d, 0x0130, 0x686c, 0x9406, 0x1118, + 0x6870, 0x9506, 0x0150, 0x012e, 0x9ce0, 0x0018, 0x2001, 0x1116, + 0x2004, 0x9c02, 0x1a04, 0x28cc, 0x0c30, 0x080c, 0x92a4, 0x012e, + 0x0904, 0x28cc, 0x0804, 0x28a2, 0x900e, 0x2001, 0x0005, 0x080c, + 0x52a0, 0x0126, 0x2091, 0x8000, 0x080c, 0x9849, 0x080c, 0x50a5, + 0x012e, 0x0804, 0x28a2, 0x81ff, 0x1904, 0x28cc, 0x080c, 0x3799, + 0x0904, 0x28cf, 0x080c, 0x4c17, 0x0904, 0x28cc, 0x080c, 0x4ca9, + 0x0904, 0x28cc, 0x0804, 0x28a2, 0x81ff, 0x1904, 0x28cc, 0x080c, + 0x37a9, 0x0904, 0x28cf, 0x080c, 0x4cf1, 0x0904, 0x28cc, 0x2019, + 0x0005, 0x080c, 0x4cc4, 0x0904, 0x28cc, 0x7888, 0x908a, 0x1000, + 0x1a04, 0x28cf, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x6567, + 0x0804, 0x28a2, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0118, 0x2009, + 0x0001, 0x0448, 0x2029, 0x00ff, 0x644c, 0x2400, 0x9506, 0x01f0, + 0x2508, 0x080c, 0x4b58, 0x11d0, 0x080c, 0x4cf1, 0x1128, 0x2009, + 0x0002, 0x62b0, 0x2518, 0x00b8, 0x2019, 0x0004, 0x080c, 0x4cc4, + 0x1118, 0x2009, 0x0006, 0x0078, 0x7884, 0x908a, 0x1000, 0x1270, + 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x6567, 0x8529, 0x1ae8, + 0x012e, 0x0804, 0x28a2, 0x012e, 0x0804, 0x28cc, 0x012e, 0x0804, + 0x28cf, 0x080c, 0x3799, 0x0904, 0x28cf, 0x080c, 0x4c17, 0x0904, + 0x28cc, 0x62a0, 0x2019, 0x0005, 0x00c6, 0x2061, 0x0000, 0x080c, + 0x69ca, 0x0076, 0x2039, 0x0000, 0x080c, 0x68fe, 0x2009, 0x0000, + 0x080c, 0xa85f, 0x007e, 0x00ce, 0x080c, 0x4ca3, 0x0804, 0x28a2, + 0x080c, 0x3799, 0x0904, 0x28cf, 0x080c, 0x4ca3, 0x2208, 0x0804, + 0x28a2, 0x0156, 0x00d6, 0x00e6, 0x2069, 0x1228, 0x6810, 0x6914, + 0x910a, 0x1210, 0x2009, 0x0000, 0x6816, 0x2011, 0x0000, 0x2019, + 0x0000, 0x20a9, 0x007e, 0x2069, 0x1000, 0x2d04, 0x9075, 0x0118, + 0x704c, 0x0059, 0x9210, 0x8d68, 0x1f04, 0x2b2d, 0x2300, 0x9218, + 0x00ee, 0x00de, 0x015e, 0x0804, 0x28a2, 0x00f6, 0x0016, 0x907d, + 0x0140, 0x2001, 0x0000, 0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178, + 0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069, 0x1228, 0x6910, 0x62ac, + 0x0804, 0x28a2, 0x81ff, 0x1904, 0x28cc, 0x614c, 0x9190, 0x26c1, + 0x2215, 0x9294, 0x00ff, 0x636c, 0x83ff, 0x0108, 0x6270, 0x67cc, + 0xd79c, 0x0118, 0x2031, 0x0001, 0x0090, 0xd7ac, 0x0118, 0x2031, + 0x0003, 0x0068, 0xd7a4, 0x0118, 0x2031, 0x0002, 0x0040, 0x080c, + 0x5745, 0x1118, 0x2031, 0x0004, 0x0010, 0x2031, 0x0000, 0x7e9a, + 0x7f9e, 0x0804, 0x28a2, 0x613c, 0x6240, 0x2019, 0x12a6, 0x231c, + 0x2001, 0x12a7, 0x2004, 0x789a, 0x0804, 0x28a2, 0x0126, 0x2091, + 0x8000, 0x6134, 0x9006, 0x2010, 0x2018, 0x012e, 0x0804, 0x28a2, + 0x080c, 0x37a9, 0x0904, 0x28cf, 0x6244, 0x6338, 0x0804, 0x28a2, + 0x613c, 0x6240, 0x7884, 0x603e, 0x7b88, 0x6342, 0x2069, 0x1152, + 0x831f, 0x9305, 0x6816, 0x788c, 0x2069, 0x12a6, 0x2d1c, 0x206a, + 0x7e98, 0x9682, 0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x12a7, + 0x2d04, 0x266a, 0x789a, 0x0804, 0x28a2, 0x0126, 0x2091, 0x8000, + 0x7884, 0x6036, 0xd0c4, 0x01a8, 0x00d6, 0x78a8, 0x2009, 0x12bd, + 0x200a, 0x78ac, 0x2011, 0x12be, 0x2012, 0x2069, 0x0100, 0x6838, + 0x9086, 0x0007, 0x1118, 0x2214, 0x6a5a, 0x0010, 0x210c, 0x695a, + 0x00de, 0x7884, 0xd0b4, 0x0120, 0x3b00, 0x9084, 0xff3f, 0x20d8, + 0x012e, 0x0804, 0x28a2, 0x7898, 0x9005, 0x01a8, 0x7888, 0x9025, + 0x0904, 0x28cf, 0x788c, 0x902d, 0x0904, 0x28cf, 0x900e, 0x080c, + 0x4b58, 0x1120, 0x6244, 0x6338, 0x6446, 0x653a, 0x9186, 0x00ff, + 0x0190, 0x8108, 0x0ca0, 0x080c, 0x37a9, 0x0904, 0x28cf, 0x7888, + 0x900d, 0x0904, 0x28cf, 0x788c, 0x9005, 0x0904, 0x28cf, 0x6244, + 0x6146, 0x6338, 0x603a, 0x0804, 0x28a2, 0x2001, 0x1100, 0x2004, + 0x9086, 0x0003, 0x1904, 0x28cc, 0x00c6, 0x2061, 0x0100, 0x7984, + 0x810f, 0x918c, 0x00ff, 0x9196, 0x00ff, 0x1130, 0x2001, 0x1114, + 0x2004, 0x9085, 0xff00, 0x0078, 0x9182, 0x007f, 0x16a0, 0x9188, + 0x26c1, 0x210d, 0x918c, 0x00ff, 0x2001, 0x1114, 0x2004, 0x9116, + 0x0550, 0x810f, 0x9105, 0x0126, 0x2091, 0x8000, 0x0006, 0x080c, + 0x7ec8, 0x000e, 0x01e0, 0x6012, 0x600b, 0xbc09, 0x6023, 0x0001, + 0x080c, 0x3784, 0x01d8, 0x6867, 0x0000, 0x7007, 0x0003, 0x6833, + 0x0000, 0x6868, 0xc0fd, 0x686a, 0x701b, 0x2cad, 0x2d00, 0x6016, + 0x2009, 0x0032, 0x080c, 0x7f4e, 0x012e, 0x00ce, 0x0005, 0x012e, + 0x00ce, 0x0804, 0x28cc, 0x00ce, 0x0804, 0x28cf, 0x080c, 0x7f1e, + 0x0cb0, 0x2001, 0x1100, 0x2004, 0x9086, 0x0003, 0x1904, 0x28cc, + 0x00c6, 0x2061, 0x0100, 0x7984, 0x810f, 0x918c, 0x00ff, 0x9196, + 0x00ff, 0x1130, 0x2001, 0x1114, 0x2004, 0x9085, 0xff00, 0x0078, + 0x9182, 0x007f, 0x16a0, 0x9188, 0x26c1, 0x210d, 0x918c, 0x00ff, + 0x2001, 0x1114, 0x2004, 0x9116, 0x0550, 0x810f, 0x9105, 0x0126, + 0x2091, 0x8000, 0x0006, 0x080c, 0x7ec8, 0x000e, 0x01e0, 0x6012, + 0x600b, 0xbc05, 0x6023, 0x0001, 0x080c, 0x3784, 0x01d8, 0x6867, + 0x0000, 0x7007, 0x0003, 0x6833, 0x0000, 0x6868, 0xc0fd, 0x686a, + 0x701b, 0x2cad, 0x2d00, 0x6016, 0x2009, 0x0032, 0x080c, 0x7f4e, + 0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x28cc, 0x00ce, + 0x0804, 0x28cf, 0x080c, 0x7f1e, 0x0cb0, 0x6830, 0x9086, 0x0100, + 0x0904, 0x28cc, 0x0804, 0x28a2, 0x2061, 0x1329, 0x0126, 0x2091, + 0x8000, 0x6000, 0xd084, 0x0140, 0x6104, 0x6208, 0x2019, 0x1111, + 0x231c, 0x012e, 0x0804, 0x28a2, 0x012e, 0x0804, 0x28cf, 0x81ff, + 0x1904, 0x28cc, 0x080c, 0x5745, 0x0904, 0x28cc, 0x0126, 0x2091, + 0x8000, 0x6244, 0x6064, 0x9202, 0x0248, 0x9085, 0x0001, 0x080c, + 0x1cb3, 0x080c, 0x4016, 0x012e, 0x0804, 0x28a2, 0x012e, 0x0804, + 0x28cf, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0148, 0x080c, 0x204d, + 0x1130, 0x9006, 0x080c, 0x1faf, 0x9006, 0x080c, 0x1f92, 0x7884, + 0x9084, 0x0007, 0x0002, 0x2cfe, 0x2d07, 0x2d10, 0x2cfb, 0x2cfb, + 0x2cfb, 0x2cfb, 0x2cfb, 0x012e, 0x0804, 0x28cf, 0x2009, 0x0114, + 0x2104, 0x9085, 0x0800, 0x200a, 0x080c, 0x2e61, 0x0080, 0x2009, + 0x0114, 0x2104, 0x9085, 0x4000, 0x200a, 0x080c, 0x2e61, 0x0038, + 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x28a4, 0x0086, + 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2009, + 0x0101, 0x210c, 0x0016, 0x2001, 0x0032, 0x2034, 0x2001, 0x0033, + 0x202c, 0x9006, 0x2048, 0x2050, 0x2058, 0x080c, 0x3098, 0x080c, + 0x2ffe, 0x903e, 0x2720, 0x00f6, 0x00e6, 0x00c6, 0x2d60, 0x2071, + 0x131f, 0x2079, 0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, + 0x0140, 0x2001, 0x0035, 0x2004, 0x780e, 0x2001, 0x0034, 0x2004, + 0x780a, 0x00de, 0x2011, 0x0001, 0x080c, 0x2faa, 0x080c, 0x2faa, + 0x00ce, 0x00ee, 0x00fe, 0x080c, 0x2f03, 0x080c, 0x2fd2, 0x080c, + 0x2f4f, 0x080c, 0x2ec8, 0x080c, 0x2ef9, 0x00f6, 0x2079, 0x0100, + 0x7824, 0xd0ac, 0x0130, 0x8b58, 0x080c, 0x2e43, 0x00fe, 0x0804, + 0x2df2, 0x00fe, 0x080c, 0x2e39, 0x1150, 0x8948, 0x2001, 0x0032, + 0x2602, 0x2001, 0x0033, 0x2502, 0x080c, 0x2e43, 0x0078, 0x87ff, + 0x0138, 0x2001, 0x0201, 0x2004, 0x9005, 0x19b8, 0x8739, 0x0030, + 0x2001, 0x131c, 0x2004, 0x9086, 0x0000, 0x1978, 0x2001, 0x034f, + 0x2003, 0x00f6, 0x8631, 0x1208, 0x8529, 0x2500, 0x9605, 0x0904, + 0x2df2, 0x7884, 0xd0bc, 0x0128, 0x2900, 0x9a05, 0x9b05, 0x1904, + 0x2df2, 0x6013, 0x0019, 0x2001, 0x032a, 0x2003, 0x0004, 0x7884, + 0xd0ac, 0x1148, 0x2001, 0x131c, 0x2003, 0x0003, 0x2001, 0x032a, + 0x2003, 0x0009, 0x0040, 0x6017, 0x0001, 0x2001, 0x002d, 0x2004, + 0x9005, 0x0108, 0x6016, 0x2c00, 0x605a, 0x2001, 0x0200, 0x2003, + 0x0040, 0x2d00, 0x685a, 0x6813, 0x0019, 0x7884, 0xd0a4, 0x1180, + 0x6817, 0x0000, 0x00c6, 0x20a9, 0x0004, 0x2061, 0x0090, 0x602b, + 0x0008, 0x2001, 0x0203, 0x2004, 0x1f04, 0x2dc7, 0x00ce, 0x0040, + 0x6817, 0x0001, 0x2001, 0x002c, 0x2004, 0x9005, 0x0108, 0x6816, + 0x00f6, 0x00c6, 0x2079, 0x0100, 0x2061, 0x0090, 0x7827, 0x0002, + 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a, 0x0006, 0x2001, + 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca, 0x00ce, 0x00fe, + 0x0804, 0x2d33, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, + 0x6027, 0x0002, 0x001e, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, + 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x0f8f, + 0x7884, 0x9084, 0x0003, 0x9086, 0x0002, 0x01a0, 0x2001, 0x0200, + 0x2003, 0x0028, 0x2001, 0x0227, 0x200c, 0x2102, 0x6050, 0x9084, + 0xb7ef, 0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090, + 0x6043, 0x0010, 0x2908, 0x2a10, 0x2b18, 0x2b00, 0x9a05, 0x9905, + 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, + 0x1118, 0x012e, 0x0804, 0x28a2, 0x012e, 0x2021, 0x400c, 0x0804, + 0x28a4, 0x9085, 0x0001, 0x1d04, 0x2e42, 0x2091, 0x6000, 0x8420, + 0x9486, 0x0064, 0x0005, 0x2001, 0x0105, 0x2003, 0x0010, 0x2001, + 0x032a, 0x2003, 0x0004, 0x2001, 0x009a, 0x2003, 0x0004, 0x2001, + 0x131c, 0x2003, 0x0000, 0x2001, 0x131f, 0x2003, 0x0000, 0x2001, + 0x0200, 0x2003, 0x0048, 0x2001, 0x0227, 0x2024, 0x2402, 0x9026, + 0x0005, 0x00f6, 0x2079, 0x0100, 0x2001, 0x1114, 0x200c, 0x7932, + 0x7936, 0x080c, 0x1c93, 0x7850, 0x9084, 0xfbff, 0x9085, 0x0030, + 0x7852, 0x2019, 0x01f4, 0x8319, 0x1df0, 0x9084, 0xffcf, 0x9085, + 0x2000, 0x7852, 0x20a9, 0x0046, 0x1d04, 0x2e7c, 0x2091, 0x6000, + 0x1f04, 0x2e7c, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfff, 0x7852, + 0x2001, 0x0021, 0x2004, 0x9084, 0x0003, 0x9086, 0x0001, 0x1120, + 0x7850, 0x9084, 0xdfff, 0x7852, 0x784b, 0xf7f7, 0x7843, 0x0090, + 0x7843, 0x0010, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x2e9c, 0x7850, + 0x9085, 0x1400, 0x7852, 0x2019, 0x61a8, 0x7854, 0xa001, 0xa001, + 0xd08c, 0x1110, 0x8319, 0x1dc8, 0x7827, 0x0048, 0x7850, 0x9085, + 0x0400, 0x7852, 0x7843, 0x0040, 0x2019, 0x01f4, 0xa001, 0xa001, + 0x8319, 0x1de0, 0x2001, 0x0140, 0x2003, 0x0100, 0x7827, 0x0020, + 0x7843, 0x0000, 0x2003, 0x0000, 0x7827, 0x0048, 0x00fe, 0x0005, + 0x7884, 0xd0ac, 0x11c8, 0x00f6, 0x00e6, 0x2071, 0x131c, 0x2079, + 0x0320, 0x2001, 0x0201, 0x2004, 0x9005, 0x0160, 0x7000, 0x9086, + 0x0000, 0x1140, 0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003, + 0x782b, 0x0019, 0x00ee, 0x00fe, 0x0005, 0x78bc, 0x908c, 0x0070, + 0x0178, 0x2009, 0x0032, 0x260a, 0x2009, 0x0033, 0x250a, 0xd0b4, + 0x0108, 0x8a50, 0xd0ac, 0x0108, 0x8948, 0xd0a4, 0x0108, 0x8b58, + 0x0005, 0x00f6, 0x2079, 0x0200, 0x781c, 0xd084, 0x0110, 0x7837, + 0x0050, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x0100, 0x70e3, 0x0005, + 0x702c, 0x9085, 0x0002, 0x702e, 0x2009, 0x1114, 0x210c, 0x716e, + 0x7063, 0x0100, 0x7166, 0x719e, 0x706b, 0x0000, 0x7073, 0x0809, + 0x7077, 0x0008, 0x7078, 0x9080, 0x0100, 0x707a, 0x7080, 0x8000, + 0x7082, 0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e, 0x707e, 0x70d6, + 0x70ab, 0x0036, 0x70af, 0x95d5, 0x7014, 0x9084, 0x1984, 0x9085, + 0x0012, 0x7016, 0x080c, 0x2fd2, 0x00f6, 0x2071, 0x131c, 0x2079, + 0x0320, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x689c, + 0x780e, 0x6898, 0x780a, 0x00de, 0x2011, 0x0011, 0x080c, 0x2faa, + 0x2011, 0x0001, 0x080c, 0x2faa, 0x00fe, 0x00ee, 0x0005, 0x00f6, + 0x00e6, 0x2071, 0x131c, 0x2079, 0x0320, 0x792c, 0xd1fc, 0x0904, + 0x2fa7, 0x782b, 0x0002, 0x9026, 0xd19c, 0x1904, 0x2fa3, 0x7000, + 0x0002, 0x2fa7, 0x2f65, 0x2f89, 0x2fa3, 0xd1bc, 0x1150, 0xd1dc, + 0x1150, 0x8001, 0x7002, 0x2011, 0x0001, 0x04e1, 0x05c0, 0x04d1, + 0x04b0, 0x78bf, 0x0000, 0x7810, 0x7914, 0x782b, 0x0004, 0x7812, + 0x7916, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8, 0x080c, 0x2ee5, + 0x2009, 0x0001, 0x78b8, 0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a, + 0x00f0, 0x8001, 0x7002, 0x9184, 0x0880, 0x1138, 0x782c, 0xd0fc, + 0x1940, 0x2011, 0x0001, 0x00b1, 0x0090, 0x6010, 0x9092, 0x0004, + 0x9086, 0x0015, 0x1120, 0x6000, 0x605a, 0x2011, 0x0031, 0x6212, + 0xd1dc, 0x1988, 0x0870, 0x782b, 0x0004, 0x7003, 0x0000, 0x00ee, + 0x00fe, 0x0005, 0x6014, 0x9005, 0x0520, 0x8001, 0x6016, 0x6058, + 0x6110, 0x9140, 0x2804, 0x7802, 0x8840, 0x2804, 0x7806, 0x8840, + 0x2804, 0x7812, 0x8840, 0x2804, 0x7816, 0x8840, 0x7a2a, 0x7000, + 0x8000, 0x7002, 0x6058, 0x9802, 0x908a, 0x0029, 0x1138, 0x6058, + 0x9080, 0x0001, 0x2004, 0x605a, 0x2001, 0x0019, 0x6012, 0x9085, + 0x0001, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x2071, 0x131f, 0x2079, + 0x0090, 0x792c, 0xd1fc, 0x01f0, 0x782b, 0x0002, 0x2d60, 0x9026, + 0x7000, 0x0002, 0x2ffa, 0x2fe5, 0x2ff1, 0x8001, 0x7002, 0xd19c, + 0x1188, 0x2011, 0x0001, 0x080c, 0x2faa, 0x0160, 0x080c, 0x2faa, + 0x0048, 0x8001, 0x7002, 0x782c, 0xd0fc, 0x1d30, 0x2011, 0x0001, + 0x080c, 0x2faa, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x00e6, + 0x00c6, 0x2061, 0x0200, 0x601b, 0x0004, 0x2061, 0x0100, 0x60cf, + 0x0400, 0x6104, 0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004, 0x9005, + 0x01f8, 0x2038, 0x2001, 0x002e, 0x2024, 0x2001, 0x002f, 0x201c, + 0x080c, 0x3784, 0x6813, 0x0019, 0x6f16, 0x2d00, 0x685a, 0x978a, + 0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, + 0x6858, 0x9080, 0x0019, 0x04b1, 0x1d90, 0x2d00, 0x685a, 0x0088, + 0x080c, 0x3784, 0x6813, 0x0019, 0x2070, 0x6817, 0x0001, 0x2d00, + 0x685a, 0x2001, 0x002e, 0x2004, 0x2072, 0x2001, 0x002f, 0x2004, + 0x7006, 0x2061, 0x0090, 0x2079, 0x0100, 0x6037, 0x0400, 0x2001, + 0x0200, 0x2003, 0x0040, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, + 0x700a, 0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x700e, 0x601e, + 0x78c6, 0x000e, 0x78ca, 0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee, + 0x00fe, 0x0005, 0x00e6, 0x2071, 0x0080, 0x20e9, 0x0001, 0x20a0, + 0x20e1, 0x0000, 0x2099, 0x0088, 0x702b, 0x0026, 0x7402, 0x7306, + 0x9006, 0x700a, 0x700e, 0x810b, 0x810b, 0x21a8, 0x810b, 0x7112, + 0x702b, 0x0041, 0x702c, 0xd0fc, 0x0de8, 0x702b, 0x0002, 0x702b, + 0x0040, 0x4005, 0x7400, 0x7304, 0x87ff, 0x0180, 0x00c6, 0x00d6, + 0x2d60, 0x00c6, 0x080c, 0x3784, 0x00ce, 0x6058, 0x2070, 0x2d00, + 0x7006, 0x605a, 0x00de, 0x00ce, 0x9085, 0x0001, 0x00ee, 0x0005, + 0x00e6, 0x2001, 0x002d, 0x2004, 0x9005, 0x0508, 0x2038, 0x2001, + 0x0030, 0x2024, 0x2001, 0x0031, 0x201c, 0x080c, 0x3784, 0x2d60, + 0x6813, 0x0019, 0x6f16, 0x2d00, 0x685a, 0x978a, 0x0007, 0x0220, + 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x6858, 0x9080, + 0x0019, 0x080c, 0x3062, 0x1d88, 0x2d00, 0x685a, 0x00e0, 0x080c, + 0x3784, 0x2d60, 0x6013, 0x0019, 0x2070, 0x6017, 0x0001, 0x2c00, + 0x605a, 0x2001, 0x0030, 0x2004, 0x2072, 0x2001, 0x0031, 0x2004, + 0x7006, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x700a, 0x2001, + 0x002b, 0x2004, 0x700e, 0x2001, 0x032a, 0x2003, 0x0004, 0x7884, + 0xd0ac, 0x1180, 0x2001, 0x0101, 0x200c, 0x918d, 0x0200, 0x2102, + 0x6017, 0x0000, 0x2001, 0x131c, 0x2003, 0x0003, 0x2001, 0x032a, + 0x2003, 0x0009, 0x2001, 0x0300, 0x2003, 0x0000, 0x2001, 0x020d, + 0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d, 0x0002, 0x2102, + 0x00ee, 0x0005, 0x0804, 0x28a2, 0x0126, 0x2091, 0x8000, 0x20a9, + 0x0012, 0x2001, 0x1140, 0x20e9, 0x0001, 0x20a0, 0x9006, 0x4004, + 0x2009, 0x013c, 0x200a, 0x012e, 0x0804, 0x28a2, 0x7d98, 0x7c9c, + 0x0804, 0x2991, 0x080c, 0x5745, 0x0110, 0x080c, 0x46e5, 0x2069, + 0x1152, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, + 0x2039, 0x0001, 0x080c, 0x37c5, 0x701b, 0x312f, 0x0005, 0x2069, + 0x1152, 0x6800, 0x9005, 0x0904, 0x28cf, 0x6804, 0xd0ac, 0x0118, + 0xd0a4, 0x0904, 0x28cf, 0xd094, 0x00c6, 0x2061, 0x0100, 0x6104, + 0x0138, 0x6200, 0x9292, 0x0005, 0x0218, 0x918c, 0xffdf, 0x0010, + 0x918d, 0x0020, 0x6106, 0x00ce, 0xd08c, 0x00c6, 0x2061, 0x0100, + 0x6104, 0x0118, 0x918d, 0x0010, 0x0010, 0x918c, 0xffef, 0x6106, + 0x00ce, 0xd084, 0x0158, 0x6a28, 0x928a, 0x007f, 0x1a04, 0x28cf, + 0x9288, 0x26c1, 0x210d, 0x918c, 0x00ff, 0x6156, 0xd0dc, 0x0130, + 0x6828, 0x908a, 0x007f, 0x1a04, 0x28cf, 0x604e, 0x6888, 0x9084, + 0x0030, 0x8004, 0x8004, 0x8004, 0x8004, 0x0006, 0x2009, 0x12c0, + 0x9080, 0x1d8e, 0x2005, 0x200a, 0x000e, 0x2009, 0x12c1, 0x9080, + 0x1d92, 0x2005, 0x200a, 0x6808, 0x908a, 0x0100, 0x0a04, 0x28cf, + 0x908a, 0x0841, 0x1a04, 0x28cf, 0x9084, 0x0007, 0x1904, 0x28cf, + 0x680c, 0x9005, 0x0904, 0x28cf, 0x6810, 0x9005, 0x0904, 0x28cf, + 0x6848, 0x6940, 0x910a, 0x1a04, 0x28cf, 0x8001, 0x0904, 0x28cf, + 0x684c, 0x6944, 0x910a, 0x1a04, 0x28cf, 0x8001, 0x0904, 0x28cf, + 0x6980, 0xd1e4, 0x0140, 0x00c6, 0x2061, 0x0100, 0x6004, 0x9085, + 0x0100, 0x6006, 0x00ce, 0x6814, 0x908c, 0x00ff, 0x613e, 0x8007, + 0x9084, 0x00ff, 0x6042, 0x080c, 0x5a12, 0x080c, 0x4e38, 0x080c, + 0x4e87, 0x6808, 0x602a, 0x080c, 0x1800, 0x2009, 0x0170, 0x200b, + 0x0080, 0xa001, 0xa001, 0x200b, 0x0000, 0x0036, 0x6b08, 0x080c, + 0x1cee, 0x003e, 0x6000, 0x9086, 0x0000, 0x1904, 0x3299, 0x6818, + 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016, + 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0148, 0x6830, 0x6934, + 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0010, 0x9084, + 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x8007, 0x810f, 0x8217, + 0x831f, 0x20a9, 0x0004, 0x20a1, 0x12c2, 0x20e9, 0x0001, 0x4001, + 0x080c, 0x6603, 0x00c6, 0x2009, 0x0000, 0x20a9, 0x0001, 0x6b70, + 0xd384, 0x01d0, 0x0028, 0x83f5, 0x3e18, 0x12b0, 0x3508, 0x8109, + 0x080c, 0x5f4d, 0x6878, 0x6016, 0x6874, 0x2008, 0x9084, 0xff00, + 0x8007, 0x600a, 0x9184, 0x00ff, 0x6006, 0x8108, 0x1118, 0x6003, + 0x0003, 0x0010, 0x6003, 0x0001, 0x1f04, 0x320b, 0x00ce, 0x00c6, + 0x2061, 0x12bc, 0x6a88, 0x9284, 0xc000, 0x2010, 0x9286, 0x0000, + 0x1118, 0x2063, 0x0000, 0x0058, 0x9286, 0x4000, 0x1118, 0x2063, + 0x0001, 0x0028, 0x9286, 0x8000, 0x1da0, 0x2063, 0x0002, 0x00ce, + 0x6888, 0xd0ec, 0x0130, 0x2011, 0x0114, 0x2204, 0x9085, 0x0100, + 0x2012, 0x6a80, 0x9284, 0x0030, 0x9086, 0x0030, 0x1128, 0x9294, + 0xffcf, 0x9295, 0x0020, 0x6a82, 0x2001, 0x128f, 0x6a80, 0x9294, + 0x0030, 0x928e, 0x0000, 0x0170, 0x928e, 0x0010, 0x0118, 0x928e, + 0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c, 0x1d69, 0x2001, 0x1280, + 0x2102, 0x0008, 0x2102, 0x00c6, 0x2061, 0x0100, 0x602f, 0x0040, + 0x602f, 0x0000, 0x00ce, 0x080c, 0x5745, 0x0128, 0x080c, 0x39e4, + 0x0110, 0x080c, 0x1cb3, 0x60c4, 0x9005, 0x01b0, 0x6003, 0x0001, + 0x2009, 0x3283, 0x00c0, 0x080c, 0x5745, 0x1158, 0x2011, 0x5654, + 0x080c, 0x655b, 0x2001, 0x1290, 0x2003, 0x0000, 0x080c, 0x5682, + 0x0040, 0x080c, 0x45d6, 0x0028, 0x6003, 0x0004, 0x2009, 0x3299, + 0x0010, 0x0804, 0x28a2, 0x2001, 0x0170, 0x2004, 0x9084, 0x00ff, + 0x9086, 0x004c, 0x1118, 0x2091, 0x30bd, 0x0817, 0x2091, 0x303d, + 0x0817, 0x6000, 0x9086, 0x0000, 0x0904, 0x28cc, 0x2069, 0x1152, + 0x7890, 0x6842, 0x7894, 0x6846, 0x2d00, 0x2009, 0x0030, 0x7a8c, + 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0804, 0x37c8, 0x9006, + 0x080c, 0x1cb3, 0x81ff, 0x1904, 0x28cc, 0x080c, 0x5745, 0x1178, + 0x2001, 0x1290, 0x2003, 0x0001, 0x2001, 0x1100, 0x2003, 0x0001, + 0x9085, 0x0001, 0x080c, 0x5789, 0x080c, 0x5682, 0x0020, 0x080c, + 0x46e5, 0x080c, 0x45d6, 0x0804, 0x28a2, 0x81ff, 0x1904, 0x28cc, + 0x080c, 0x5745, 0x1110, 0x0804, 0x28cc, 0x6184, 0x81ff, 0x01a8, + 0x703f, 0x0000, 0x2001, 0x1580, 0x2009, 0x0040, 0x7a8c, 0x7b88, + 0x7c9c, 0x7d98, 0x0126, 0x2091, 0x8000, 0x2039, 0x0001, 0x080c, + 0x37c8, 0x701b, 0x28a0, 0x012e, 0x0005, 0x703f, 0x0001, 0x00d6, + 0x2069, 0x1580, 0x20a9, 0x0040, 0x20e9, 0x0001, 0x20a1, 0x1580, + 0x2019, 0xffff, 0x4304, 0x654c, 0x9588, 0x26c1, 0x210d, 0x918c, + 0x00ff, 0x216a, 0x900e, 0x2011, 0x0002, 0x2100, 0x9506, 0x01a8, + 0x080c, 0x4b58, 0x1190, 0x6014, 0x821c, 0x0238, 0x9398, 0x1580, + 0x9085, 0xff00, 0x8007, 0x201a, 0x0038, 0x9398, 0x1580, 0x2324, + 0x94a4, 0xff00, 0x9405, 0x201a, 0x8210, 0x8108, 0x9182, 0x0080, + 0x1208, 0x0c18, 0x8201, 0x8007, 0x2d0c, 0x9105, 0x206a, 0x00de, + 0x20a9, 0x0040, 0x20a1, 0x1580, 0x2099, 0x1580, 0x080c, 0x4678, + 0x0804, 0x32ea, 0x080c, 0x37a9, 0x0904, 0x28cf, 0x00c6, 0x080c, + 0x3784, 0x00ce, 0x1120, 0x2009, 0x0002, 0x0804, 0x28cc, 0x2001, + 0x1153, 0x2004, 0xd0b4, 0x0550, 0x7884, 0x9084, 0xff00, 0x908e, + 0x7e00, 0x0520, 0x908e, 0x7f00, 0x0508, 0x908e, 0x8000, 0x01f0, + 0x6000, 0xd08c, 0x11d8, 0x6004, 0x9084, 0x00ff, 0x9086, 0x0006, + 0x11a8, 0x6867, 0x0000, 0x6868, 0xc0fd, 0x686a, 0x080c, 0x9744, + 0x1120, 0x2009, 0x0003, 0x0804, 0x28cc, 0x7007, 0x0003, 0x701b, + 0x337a, 0x0005, 0x080c, 0x37a9, 0x0904, 0x28cf, 0x20a9, 0x002b, + 0x20e1, 0x0001, 0x2c98, 0x9de8, 0x0002, 0x20e9, 0x0001, 0x2da0, + 0x4003, 0x20a9, 0x0004, 0x9d80, 0x0006, 0x20a0, 0x9c80, 0x0006, + 0x2098, 0x080c, 0x4678, 0x20a9, 0x0004, 0x9d80, 0x000a, 0x20a0, + 0x9c80, 0x000a, 0x2098, 0x080c, 0x4678, 0x2d00, 0x2009, 0x002b, + 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0804, 0x37c8, + 0x81ff, 0x1904, 0x28cc, 0x080c, 0x3799, 0x0904, 0x28cf, 0x080c, + 0x4cb2, 0x0804, 0x28a2, 0x81ff, 0x1904, 0x28cc, 0x7888, 0x908a, + 0x1000, 0x1a04, 0x28cf, 0x080c, 0x37a9, 0x0904, 0x28cf, 0x080c, + 0x4cf1, 0x0904, 0x28cc, 0x2019, 0x0004, 0x080c, 0x4cc4, 0x7984, + 0x810f, 0x7a88, 0x0011, 0x0804, 0x28a2, 0x9186, 0x00ff, 0x0110, + 0x0071, 0x0060, 0x2029, 0x007e, 0x2061, 0x1100, 0x644c, 0x2400, + 0x9506, 0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, + 0x4b58, 0x1138, 0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, + 0x6567, 0x0005, 0x81ff, 0x1904, 0x28cc, 0x080c, 0x3799, 0x0904, + 0x28cf, 0x080c, 0x4c17, 0x0904, 0x28cc, 0x080c, 0x4cbb, 0x0804, + 0x28a2, 0x81ff, 0x1904, 0x28cc, 0x080c, 0x3799, 0x0904, 0x28cf, + 0x080c, 0x4c17, 0x0904, 0x28cc, 0x080c, 0x4ca9, 0x0804, 0x28a2, + 0x6100, 0x0804, 0x28a2, 0x080c, 0x37a9, 0x0904, 0x28cf, 0x6004, + 0x9086, 0x0707, 0x0904, 0x28cf, 0x2001, 0x1100, 0x2004, 0x9086, + 0x0003, 0x1904, 0x28cc, 0x00d6, 0x9ce8, 0x000a, 0x7984, 0xd184, + 0x0110, 0x9ce8, 0x0006, 0x680c, 0x8007, 0x789e, 0x6808, 0x8007, + 0x789a, 0x6b04, 0x831f, 0x6a00, 0x8217, 0x00de, 0x6100, 0x918c, + 0x0200, 0x0804, 0x28a2, 0x7884, 0x909c, 0x00ff, 0x939a, 0x0003, + 0x1a04, 0x28cc, 0x624c, 0x9294, 0x00ff, 0x9084, 0xff00, 0x8007, + 0x9206, 0x1188, 0x2031, 0x1148, 0x2009, 0x013c, 0x2136, 0x2001, + 0x1140, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, + 0x0001, 0x0804, 0x37c8, 0x81ff, 0x1904, 0x28cc, 0x080c, 0x37a9, + 0x0904, 0x28cf, 0x6004, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1904, + 0x28cc, 0x00c6, 0x080c, 0x3784, 0x00ce, 0x0904, 0x28cc, 0x6867, + 0x0000, 0x6868, 0xc0fd, 0x686a, 0x080c, 0x96eb, 0x0904, 0x28cc, + 0x7007, 0x0003, 0x701b, 0x3475, 0x0005, 0x6830, 0x9086, 0x0100, + 0x0904, 0x28cc, 0x9d80, 0x001b, 0x2009, 0x000c, 0x7a8c, 0x7b88, + 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0804, 0x37c8, 0x9006, 0x080c, + 0x1cb3, 0x7884, 0x9084, 0x00ff, 0x9086, 0x00ff, 0x0118, 0x81ff, + 0x1904, 0x28cc, 0x080c, 0x5745, 0x0110, 0x080c, 0x46e5, 0x7888, + 0x908a, 0x1000, 0x1a04, 0x28cf, 0x7984, 0x918c, 0xff00, 0x810f, + 0x9186, 0x00ff, 0x0138, 0x9182, 0x007f, 0x1a04, 0x28cf, 0x2100, + 0x080c, 0x1c7d, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2061, + 0x12ef, 0x601b, 0x0000, 0x601f, 0x0000, 0x080c, 0x5745, 0x1178, + 0x2001, 0x1290, 0x2003, 0x0001, 0x2001, 0x1100, 0x2003, 0x0001, + 0x9085, 0x0001, 0x080c, 0x5789, 0x080c, 0x5682, 0x0450, 0x2011, + 0x0003, 0x080c, 0x79c2, 0x2011, 0x0002, 0x080c, 0x79cc, 0x080c, + 0x78b3, 0x080c, 0x65cf, 0x0036, 0x2019, 0x0000, 0x080c, 0x7936, + 0x003e, 0x2061, 0x0100, 0x2001, 0x1114, 0x2004, 0x9084, 0x00ff, + 0x810f, 0x9105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, + 0x12b9, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x4611, 0x080c, + 0x65e1, 0x7984, 0x918c, 0xff00, 0x810f, 0x080c, 0x5745, 0x1110, + 0x2009, 0x00ff, 0x7a88, 0x080c, 0x33cd, 0x012e, 0x00ce, 0x002e, + 0x0804, 0x28a2, 0x7984, 0x918c, 0xff00, 0x810f, 0x00c6, 0x080c, + 0x4b03, 0x2c08, 0x00ce, 0x1904, 0x28cf, 0x0804, 0x28a2, 0x81ff, + 0x0120, 0x2009, 0x0001, 0x0804, 0x28cc, 0x60cc, 0xd0ac, 0x1130, + 0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x28cc, 0x080c, 0x3784, + 0x1120, 0x2009, 0x0002, 0x0804, 0x28cc, 0x7984, 0x7a8c, 0x7b88, + 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x37c5, 0x701b, 0x3531, + 0x0005, 0x2009, 0x0080, 0x080c, 0x4b58, 0x1130, 0x6004, 0x9084, + 0x00ff, 0x9086, 0x0006, 0x0120, 0x2021, 0x400a, 0x0804, 0x28a4, + 0x00d6, 0x9de8, 0x0019, 0x6900, 0x6a08, 0x6b0c, 0x6c10, 0x6d14, + 0x6e18, 0x6820, 0x90be, 0x0100, 0x0904, 0x35a8, 0x90be, 0x0112, + 0x0904, 0x35a8, 0x90be, 0x0113, 0x0904, 0x35a8, 0x90be, 0x0114, + 0x0904, 0x35a8, 0x90be, 0x0117, 0x0904, 0x35a8, 0x90be, 0x011a, + 0x0904, 0x35a8, 0x90be, 0x011c, 0x0904, 0x35a8, 0x90be, 0x0121, + 0x05b0, 0x90be, 0x0131, 0x0598, 0x90be, 0x0171, 0x05c8, 0x90be, + 0x0173, 0x05b0, 0x90be, 0x01a1, 0x1120, 0x6830, 0x8007, 0x6832, + 0x04a8, 0x90be, 0x0212, 0x0540, 0x90be, 0x0213, 0x0528, 0x90be, + 0x0214, 0x01b0, 0x90be, 0x0217, 0x0168, 0x90be, 0x021a, 0x1120, + 0x6838, 0x8007, 0x683a, 0x00e0, 0x90be, 0x0300, 0x01c8, 0x00de, + 0x0804, 0x28cf, 0x9d80, 0x0010, 0x20a9, 0x0007, 0x080c, 0x35ee, + 0x9d80, 0x000e, 0x20a9, 0x0001, 0x080c, 0x35ee, 0x0048, 0x9d80, + 0x000c, 0x080c, 0x35fc, 0x0050, 0x9d80, 0x000e, 0x080c, 0x35fc, + 0x9d80, 0x000c, 0x20a9, 0x0001, 0x080c, 0x35ee, 0x00c6, 0x080c, + 0x3784, 0x0568, 0x6868, 0xc0fd, 0x686a, 0x6867, 0x0119, 0x6883, + 0x0000, 0x687f, 0x0020, 0x688b, 0x0001, 0x810b, 0x69ae, 0x68b3, + 0x0000, 0x6ab6, 0x6bba, 0x6cbe, 0x6dc2, 0x69c6, 0x68cb, 0x0000, + 0x00ce, 0x00de, 0x6867, 0x0000, 0x6868, 0xc0fd, 0x686a, 0x6823, + 0x0000, 0x6804, 0x2068, 0x080c, 0x9707, 0x1120, 0x2009, 0x0003, + 0x0804, 0x28cc, 0x7007, 0x0003, 0x701b, 0x35e5, 0x0005, 0x00ce, + 0x00de, 0x2009, 0x0002, 0x0804, 0x28cc, 0x6820, 0x9086, 0x8001, + 0x1904, 0x28a2, 0x2009, 0x0004, 0x0804, 0x28cc, 0x0016, 0x2008, + 0x2044, 0x8000, 0x204c, 0x8000, 0x290a, 0x8108, 0x280a, 0x8108, + 0x1f04, 0x35f0, 0x001e, 0x0005, 0x0016, 0x00a6, 0x00b6, 0x2008, + 0x2044, 0x8000, 0x204c, 0x8000, 0x2054, 0x8000, 0x205c, 0x2b0a, + 0x8108, 0x2a0a, 0x8108, 0x290a, 0x8108, 0x280a, 0x00be, 0x00ae, + 0x001e, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x28cc, + 0x7984, 0x2140, 0x918c, 0xff00, 0x810f, 0x60cc, 0xd0ac, 0x1120, + 0x9182, 0x0080, 0x0a04, 0x28cf, 0x9182, 0x00ff, 0x1a04, 0x28cf, + 0x7a8c, 0x7b88, 0x606c, 0x9306, 0x1140, 0x6070, 0x924e, 0x0904, + 0x28cf, 0x99cc, 0xff00, 0x0904, 0x28cf, 0x00c6, 0x080c, 0x36d2, + 0x2c68, 0x00ce, 0x0538, 0x90c6, 0x4000, 0x1180, 0x00c6, 0x0006, + 0x2d60, 0x2009, 0x0000, 0x080c, 0x4d21, 0x1108, 0xc185, 0x6000, + 0xd0bc, 0x0108, 0xc18d, 0x000e, 0x00ce, 0x0088, 0x90c6, 0x4007, + 0x1110, 0x2408, 0x0060, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, + 0x0030, 0x90c6, 0x4009, 0x1108, 0x0010, 0x2001, 0x4006, 0x2020, + 0x0804, 0x28a4, 0x2d00, 0x7022, 0x0016, 0x00b6, 0x00c6, 0x00e6, + 0x2c70, 0x080c, 0x7ec8, 0x05d8, 0x2d00, 0x6012, 0x080c, 0x99cc, + 0x2e58, 0x00ee, 0x00e6, 0x00c6, 0x080c, 0x3784, 0x00ce, 0x2b70, + 0x1150, 0x080c, 0x7f1e, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x2009, + 0x0002, 0x0804, 0x28cc, 0x6867, 0x0000, 0x686b, 0x0000, 0x2d00, + 0x6016, 0x6833, 0x0000, 0x6868, 0xc0fd, 0xd88c, 0x0108, 0xc0f5, + 0x686a, 0x0126, 0x2091, 0x8000, 0x080c, 0x25ad, 0x012e, 0x6023, + 0x0001, 0x2001, 0x0000, 0x080c, 0x4aa1, 0x2001, 0x0002, 0x080c, + 0x4ab3, 0x2009, 0x0002, 0x080c, 0x7f4e, 0x9085, 0x0001, 0x00ee, + 0x00ce, 0x00be, 0x001e, 0x1120, 0x2009, 0x0003, 0x0804, 0x28cc, + 0x7007, 0x0003, 0x701b, 0x36b5, 0x0005, 0x6830, 0x9086, 0x0100, + 0x7020, 0x2060, 0x1138, 0x2009, 0x0004, 0x6204, 0x9294, 0x00ff, + 0x0804, 0x28cc, 0x2009, 0x0000, 0x6868, 0xd0f4, 0x1904, 0x28a2, + 0x080c, 0x4d21, 0x1108, 0xc185, 0x6000, 0xd0bc, 0x0108, 0xc18d, + 0x0804, 0x28a2, 0x00e6, 0x00d6, 0x2029, 0x0000, 0x2001, 0x1133, + 0x2004, 0xd0ac, 0x0138, 0x2021, 0x0000, 0x20a9, 0x00ff, 0x2071, + 0x1000, 0x0030, 0x2021, 0x0080, 0x20a9, 0x007f, 0x2071, 0x1080, + 0x2e04, 0x9005, 0x1130, 0x2100, 0x9406, 0x1570, 0x2428, 0xc5fd, + 0x0458, 0x2068, 0x6f10, 0x2700, 0x9306, 0x11b0, 0x6e14, 0x2600, + 0x9206, 0x1190, 0x2400, 0x9106, 0x1160, 0x2d60, 0xd884, 0x0568, + 0x6004, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1538, 0x2001, 0x4000, + 0x0428, 0x2001, 0x4007, 0x0410, 0x2400, 0x9106, 0x1168, 0x6e14, + 0x87ff, 0x1138, 0x86ff, 0x09d0, 0x2001, 0x1133, 0x2004, 0xd0ac, + 0x19a8, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x36e8, + 0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001, 0x0030, + 0x080c, 0x4b03, 0x1dd0, 0x6312, 0x6216, 0x9006, 0x9005, 0x00de, + 0x00ee, 0x0005, 0x81ff, 0x1904, 0x28cc, 0x080c, 0x3784, 0x0904, + 0x28cc, 0x6867, 0x0000, 0x6868, 0xc0fd, 0x686a, 0x7884, 0x9005, + 0x0904, 0x28cf, 0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04, + 0x28cf, 0x2010, 0x2d18, 0x080c, 0x2562, 0x0904, 0x28cc, 0x7007, + 0x0003, 0x701b, 0x3754, 0x0005, 0x6830, 0x9086, 0x0100, 0x0904, + 0x28cc, 0x0804, 0x28a2, 0x7984, 0x918c, 0xff00, 0x810f, 0x60cc, + 0xd0ac, 0x1120, 0x9182, 0x0080, 0x0a04, 0x28cf, 0x9182, 0x00ff, + 0x1a04, 0x28cf, 0x0126, 0x2091, 0x8000, 0x080c, 0x9602, 0x1188, + 0x9190, 0x1000, 0x2204, 0x9065, 0x0160, 0x080c, 0x472d, 0x2001, + 0x1133, 0x2004, 0xd0ac, 0x0110, 0x6017, 0x0000, 0x012e, 0x0804, + 0x28a2, 0x012e, 0x0804, 0x28cc, 0x080c, 0x0ddf, 0x0188, 0x9006, + 0x6802, 0x7010, 0x9005, 0x1120, 0x2d00, 0x7012, 0x7016, 0x0030, + 0x7014, 0x6802, 0x2060, 0x2d00, 0x6006, 0x7016, 0x9d80, 0x0019, + 0x0005, 0x7984, 0x810f, 0x918c, 0x00ff, 0x080c, 0x4b58, 0x1130, + 0x7e88, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x9066, 0x8cff, + 0x0005, 0x7e84, 0x860f, 0x918c, 0x00ff, 0x080c, 0x4b58, 0x1128, + 0x96b4, 0x00ff, 0x9682, 0x4000, 0x0208, 0x9066, 0x8cff, 0x0005, + 0x0016, 0x7110, 0x81ff, 0x0128, 0x2168, 0x6904, 0x080c, 0x0df6, + 0x0cc8, 0x7112, 0x7116, 0x001e, 0x0005, 0x2031, 0x0001, 0x0010, + 0x2031, 0x0000, 0x2061, 0x11e3, 0x6606, 0x6116, 0x670e, 0x6012, + 0x622a, 0x632e, 0x6432, 0x6536, 0x2c10, 0x080c, 0x0e55, 0x7007, + 0x0002, 0x701b, 0x28a2, 0x0005, 0x00f6, 0x0126, 0x2091, 0x8000, + 0x2079, 0x0000, 0x2001, 0x11a1, 0x2004, 0x9005, 0x1158, 0x0e04, + 0x37f2, 0x7a36, 0x7833, 0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091, + 0x4080, 0x0408, 0x0016, 0x00c6, 0x00e6, 0x2071, 0x1193, 0x7138, + 0x9182, 0x0010, 0x0218, 0x7030, 0x2060, 0x0078, 0x7030, 0x90e0, + 0x0004, 0x9c82, 0x11e3, 0x0210, 0x2061, 0x11a3, 0x2c00, 0x7032, + 0x81ff, 0x1108, 0x7036, 0x8108, 0x713a, 0x2262, 0x6306, 0x640a, + 0x00ee, 0x00ce, 0x001e, 0x012e, 0x00fe, 0x0005, 0x00e6, 0x2071, + 0x1193, 0x7038, 0x9005, 0x0560, 0x0126, 0x2091, 0x8000, 0x0e04, + 0x3847, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x7034, 0x2060, 0x2c04, + 0x7836, 0x7833, 0x0012, 0x7882, 0x6004, 0x7886, 0x6008, 0x788a, + 0x2091, 0x4080, 0x7038, 0x8001, 0x703a, 0x9005, 0x1130, 0x7033, + 0x11a3, 0x7037, 0x11a3, 0x00ce, 0x0048, 0x9c80, 0x0004, 0x90fa, + 0x11e3, 0x0210, 0x2001, 0x11a3, 0x7036, 0x00ce, 0x00fe, 0x012e, + 0x00ee, 0x0005, 0x0026, 0x2001, 0x1153, 0x2004, 0xd0c4, 0x0120, + 0x2011, 0x8014, 0x080c, 0x37dc, 0x002e, 0x0005, 0x81ff, 0x1904, + 0x28cc, 0x0126, 0x2091, 0x8000, 0x6030, 0xc08d, 0xc085, 0xc0ac, + 0x6032, 0x080c, 0x5745, 0x1178, 0x2001, 0x1290, 0x2003, 0x0001, + 0x2001, 0x1100, 0x2003, 0x0001, 0x9085, 0x0001, 0x080c, 0x5789, + 0x080c, 0x5682, 0x0010, 0x080c, 0x45d6, 0x012e, 0x0804, 0x28a2, + 0x7884, 0x2008, 0x918c, 0xfffd, 0x1128, 0x61d8, 0x910d, 0x61da, + 0x0804, 0x28a2, 0x0804, 0x28cf, 0x81ff, 0x1904, 0x28cc, 0x6000, + 0x9086, 0x0003, 0x1904, 0x28cc, 0x2001, 0x1153, 0x2004, 0xd0ac, + 0x1904, 0x28cc, 0x080c, 0x37a9, 0x0904, 0x28cf, 0x6004, 0x9084, + 0x00ff, 0x9086, 0x0006, 0x1120, 0x7888, 0x9005, 0x0904, 0x28a2, + 0x00c6, 0x080c, 0x3784, 0x00ce, 0x0904, 0x28cc, 0x6867, 0x0000, + 0x6833, 0x0000, 0x6868, 0xc0fd, 0x686a, 0x080c, 0x97e0, 0x0904, + 0x28cc, 0x7007, 0x0003, 0x701b, 0x38b6, 0x0005, 0x6830, 0x9086, + 0x0100, 0x0904, 0x28cc, 0x0804, 0x28a2, 0x2001, 0x1100, 0x2004, + 0x9086, 0x0003, 0x1904, 0x28cc, 0x7f84, 0x7a8c, 0x7b88, 0x7c9c, + 0x7d98, 0x080c, 0x3784, 0x0904, 0x28cc, 0x2009, 0x0000, 0x2031, + 0x0000, 0x7023, 0x0000, 0x702f, 0x0000, 0x9d80, 0x0005, 0x7026, + 0x20a0, 0x20e1, 0x0001, 0x20e9, 0x0001, 0x080c, 0x4b58, 0x1904, + 0x3937, 0x6004, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0130, 0x90c4, + 0xff00, 0x98c6, 0x0600, 0x1904, 0x3937, 0x2001, 0x1153, 0x2004, + 0xd0ac, 0x1130, 0x080c, 0x4d21, 0x1118, 0xd79c, 0x0904, 0x3937, + 0xd794, 0x1110, 0xd784, 0x0158, 0x9c80, 0x0006, 0x2098, 0x3400, + 0x20a9, 0x0004, 0x4003, 0x080c, 0x35fc, 0xd794, 0x0148, 0x9c80, + 0x000a, 0x2098, 0x3400, 0x20a9, 0x0004, 0x4003, 0x080c, 0x35fc, + 0x21a2, 0x3400, 0x8000, 0x20a0, 0xd794, 0x01d8, 0x9c80, 0x0000, + 0x2098, 0x20a9, 0x0002, 0x4003, 0x9c80, 0x0003, 0x2098, 0x20a9, + 0x0001, 0x4005, 0x9c80, 0x0004, 0x2098, 0x3400, 0x20a9, 0x0002, + 0x4003, 0x080c, 0x35ee, 0x9c80, 0x0026, 0x2098, 0x20a9, 0x0002, + 0x4003, 0xd794, 0x0110, 0x96b0, 0x000b, 0x96b0, 0x0005, 0x8108, + 0x2001, 0x1133, 0x2004, 0xd0ac, 0x0118, 0x9186, 0x0100, 0x0040, + 0xd78c, 0x0120, 0x9186, 0x0100, 0x0170, 0x0018, 0x9186, 0x007e, + 0x0150, 0xd794, 0x0118, 0x9686, 0x0020, 0x0010, 0x9686, 0x0028, + 0x0150, 0x0804, 0x38d9, 0x86ff, 0x1120, 0x7120, 0x810b, 0x0804, + 0x28a2, 0x702f, 0x0001, 0x711e, 0x7020, 0x9600, 0x7022, 0x772a, + 0x2061, 0x11e3, 0x6007, 0x0000, 0x6616, 0x7024, 0x600f, 0x0001, + 0x6012, 0x622a, 0x632e, 0x6432, 0x6536, 0x2c10, 0x080c, 0x0e55, + 0x7007, 0x0002, 0x701b, 0x3975, 0x0005, 0x702c, 0x9005, 0x1170, + 0x711c, 0x7024, 0x20a0, 0x7728, 0x2031, 0x0000, 0x2061, 0x11e3, + 0x6228, 0x632c, 0x6430, 0x6534, 0x0804, 0x38d9, 0x7120, 0x810b, + 0x0804, 0x28a2, 0x2029, 0x007e, 0x7984, 0x7a88, 0x7b8c, 0x7c98, + 0x9184, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x28cf, 0x9502, + 0x0a04, 0x28cf, 0x9184, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x28cf, + 0x9502, 0x0a04, 0x28cf, 0x9284, 0xff00, 0x8007, 0x90e2, 0x0020, + 0x0a04, 0x28cf, 0x9502, 0x0a04, 0x28cf, 0x9284, 0x00ff, 0x90e2, + 0x0020, 0x0a04, 0x28cf, 0x9502, 0x0a04, 0x28cf, 0x9384, 0xff00, + 0x8007, 0x90e2, 0x0020, 0x0a04, 0x28cf, 0x9502, 0x0a04, 0x28cf, + 0x9384, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x28cf, 0x9502, 0x0a04, + 0x28cf, 0x9484, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x28cf, + 0x9502, 0x0a04, 0x28cf, 0x9484, 0x00ff, 0x90e2, 0x0020, 0x0a04, + 0x28cf, 0x9502, 0x0a04, 0x28cf, 0x2061, 0x12a9, 0x6102, 0x6206, + 0x630a, 0x640e, 0x0804, 0x28a2, 0x0006, 0x2001, 0x1153, 0x2004, + 0xd0cc, 0x000e, 0x0005, 0x0006, 0x2001, 0x1172, 0x2004, 0xd0bc, + 0x000e, 0x0005, 0x6164, 0x7a84, 0x6300, 0x82ff, 0x1118, 0x7986, + 0x0804, 0x28a2, 0x83ff, 0x1904, 0x28cf, 0x2001, 0xfff0, 0x9200, + 0x1a04, 0x28cf, 0x2019, 0xffff, 0x6068, 0x9302, 0x9200, 0x0a04, + 0x28cf, 0x7986, 0x6266, 0x0804, 0x28a2, 0x2001, 0x1100, 0x2004, + 0x9086, 0x0003, 0x1904, 0x28cc, 0x7c88, 0x7d84, 0x7e98, 0x7f8c, + 0x080c, 0x3784, 0x0904, 0x28cc, 0x2009, 0x0000, 0x2019, 0x0000, + 0x7023, 0x0000, 0x702f, 0x0000, 0x9d80, 0x0003, 0x7026, 0x20a0, + 0x91e0, 0x1000, 0x2c64, 0x8cff, 0x01d8, 0x6004, 0x9084, 0x00ff, + 0x9086, 0x0006, 0x0130, 0x6004, 0x9084, 0xff00, 0x9086, 0x0600, + 0x1178, 0x00d6, 0x3468, 0x6014, 0x206a, 0x8d68, 0x6010, 0x8007, + 0x9105, 0x8007, 0x206a, 0x8d68, 0x2da0, 0x00de, 0x9398, 0x0002, + 0x8108, 0x9182, 0x00ff, 0x0120, 0x9386, 0x002a, 0x0148, 0x08c0, + 0x83ff, 0x1120, 0x7120, 0x810c, 0x0804, 0x28a2, 0x702f, 0x0001, + 0x711e, 0x7020, 0x9300, 0x7022, 0x2061, 0x11e3, 0x6007, 0x0000, + 0x6316, 0x7024, 0x600f, 0x0001, 0x6012, 0x642a, 0x652e, 0x6632, + 0x6736, 0x2c10, 0x080c, 0x0e55, 0x7007, 0x0002, 0x701b, 0x3a71, + 0x0005, 0x702c, 0x9005, 0x1168, 0x711c, 0x7024, 0x20a0, 0x2019, + 0x0000, 0x2061, 0x11e3, 0x6428, 0x652c, 0x6630, 0x6734, 0x0804, + 0x3a28, 0x7120, 0x810c, 0x0804, 0x28a2, 0x81ff, 0x1904, 0x28cc, + 0x60cc, 0xd0ac, 0x1118, 0xd09c, 0x0904, 0x28cc, 0x080c, 0x3784, + 0x0904, 0x28cc, 0x7984, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, + 0x0001, 0x080c, 0x37c5, 0x701b, 0x3a9e, 0x0005, 0x00d6, 0x9de8, + 0x0019, 0x6828, 0x90be, 0x7000, 0x0148, 0x90be, 0x7100, 0x0130, + 0x90be, 0x7200, 0x0118, 0x00de, 0x0804, 0x28cf, 0x6820, 0x6924, + 0x080c, 0x1c69, 0x1510, 0x080c, 0x4b03, 0x11f8, 0x7122, 0x6612, + 0x6516, 0x6e18, 0x00c6, 0x080c, 0x3784, 0x01b8, 0x080c, 0x3784, + 0x01a0, 0x00ce, 0x00de, 0x6867, 0x0000, 0x6868, 0xc0fd, 0x686a, + 0x6823, 0x0000, 0x6804, 0x2068, 0x080c, 0x9728, 0x0904, 0x28cc, + 0x7007, 0x0003, 0x701b, 0x3ad8, 0x0005, 0x00de, 0x0804, 0x28cc, + 0x7120, 0x080c, 0x26a3, 0x6820, 0x9086, 0x8001, 0x0904, 0x28cc, + 0x2d00, 0x701e, 0x6804, 0x9080, 0x0002, 0x0006, 0x20a9, 0x002a, + 0x2098, 0x20a0, 0x080c, 0x4678, 0x000e, 0x9de8, 0x0019, 0x6a08, + 0x6b0c, 0x6c10, 0x6d14, 0x2061, 0x11e3, 0x6007, 0x0000, 0x6e00, + 0x6f28, 0x97c6, 0x7000, 0x1108, 0x0018, 0x97c6, 0x7100, 0x1150, + 0x96c2, 0x0004, 0x0a04, 0x28cf, 0x2009, 0x0004, 0x2039, 0x0001, + 0x0804, 0x37c8, 0x97c6, 0x7200, 0x1904, 0x28cf, 0x96c2, 0x0054, + 0x0a04, 0x28cf, 0x600f, 0x0001, 0x6012, 0x6017, 0x002a, 0x622a, + 0x632e, 0x6432, 0x6536, 0x2c10, 0x080c, 0x0e55, 0x7007, 0x0002, + 0x701b, 0x3b23, 0x0005, 0x701c, 0x2068, 0x6804, 0x9080, 0x0001, + 0x2004, 0x9080, 0x0002, 0x0006, 0x20a9, 0x002a, 0x2098, 0x20a0, + 0x080c, 0x4678, 0x000e, 0x2009, 0x002a, 0x2061, 0x11e3, 0x6228, + 0x632c, 0x6430, 0x6534, 0x2039, 0x0001, 0x0804, 0x37c8, 0x81ff, + 0x1904, 0x28cc, 0x080c, 0x3799, 0x0904, 0x28cf, 0x080c, 0x4c17, + 0x0904, 0x28cc, 0x080c, 0x4ccd, 0x0804, 0x28a2, 0x7884, 0xd084, + 0x0904, 0x3342, 0x080c, 0x37a9, 0x0904, 0x28cf, 0x00c6, 0x080c, + 0x3784, 0x00ce, 0x1120, 0x2009, 0x0002, 0x0804, 0x28cc, 0x6004, + 0x9084, 0x00ff, 0x9086, 0x0006, 0x0128, 0x908e, 0x0004, 0x0110, + 0x908e, 0x0005, 0x1580, 0x2001, 0x1153, 0x2004, 0xd0b4, 0x0904, + 0x337e, 0x7884, 0x9084, 0xff00, 0x908e, 0x7e00, 0x0904, 0x337e, + 0x908e, 0x7f00, 0x0904, 0x337e, 0x908e, 0x8000, 0x0904, 0x337e, + 0x6000, 0xd08c, 0x1904, 0x337e, 0x6867, 0x0000, 0x6868, 0xc0fd, + 0x686a, 0x080c, 0x9744, 0x1120, 0x2009, 0x0003, 0x0804, 0x28cc, + 0x7007, 0x0003, 0x701b, 0x3b95, 0x0005, 0x080c, 0x37a9, 0x0904, + 0x28cf, 0x0804, 0x337e, 0x2009, 0x1130, 0x210c, 0x81ff, 0x0120, + 0x2009, 0x0001, 0x0804, 0x28cc, 0x2001, 0x1100, 0x2004, 0x9086, + 0x0003, 0x0120, 0x2009, 0x0007, 0x0804, 0x28cc, 0x2001, 0x1153, + 0x2004, 0xd0ac, 0x0120, 0x2009, 0x0008, 0x0804, 0x28cc, 0x609c, + 0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x337e, 0x6867, 0x0000, 0x6833, + 0x0000, 0x6868, 0xc0fd, 0x686a, 0x080c, 0x97e0, 0x1120, 0x2009, + 0x0003, 0x0804, 0x28cc, 0x7007, 0x0003, 0x701b, 0x3bd0, 0x0005, + 0x6830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x28cc, + 0x080c, 0x37a9, 0x0904, 0x28cf, 0x0804, 0x3b6b, 0x81ff, 0x2009, + 0x0001, 0x1904, 0x28cc, 0x6000, 0x9086, 0x0003, 0x2009, 0x0007, + 0x1904, 0x28cc, 0x2001, 0x1153, 0x2004, 0xd0ac, 0x2009, 0x0008, + 0x1904, 0x28cc, 0x080c, 0x37a9, 0x0904, 0x28cf, 0x6004, 0x9084, + 0x00ff, 0x9086, 0x0006, 0x2009, 0x0009, 0x1904, 0x28cc, 0x00c6, + 0x080c, 0x3784, 0x00ce, 0x2009, 0x0002, 0x0904, 0x28cc, 0x6867, + 0x0000, 0x6833, 0x0000, 0x6868, 0xc0fd, 0x686a, 0x7988, 0x9194, + 0xff00, 0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed, 0x6952, + 0x798c, 0x6956, 0x0048, 0x928e, 0x0100, 0x1904, 0x28cf, 0xc0e5, + 0x6853, 0x0000, 0x6857, 0x0000, 0x683e, 0x080c, 0x99cd, 0x2009, + 0x0003, 0x0904, 0x28cc, 0x7007, 0x0003, 0x701b, 0x3c30, 0x0005, + 0x6830, 0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x28cc, 0x0804, + 0x28a2, 0x81ff, 0x2009, 0x0001, 0x1904, 0x28cc, 0x6000, 0x9086, + 0x0003, 0x2009, 0x0007, 0x1904, 0x28cc, 0x080c, 0x37a9, 0x0904, + 0x28cf, 0x6004, 0x9084, 0x00ff, 0x9086, 0x0006, 0x2009, 0x0009, + 0x1904, 0x28cc, 0x00c6, 0x080c, 0x3784, 0x00ce, 0x2009, 0x0002, + 0x0904, 0x28cc, 0x9d80, 0x001b, 0x2009, 0x0008, 0x7a8c, 0x7b88, + 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x37c5, 0x701b, 0x3c69, + 0x0005, 0x00d6, 0x9de8, 0x001b, 0x6800, 0x9086, 0x0500, 0x1140, + 0x6804, 0x9005, 0x1128, 0x6808, 0x9084, 0xff00, 0x1108, 0x0018, + 0x00de, 0x1904, 0x28cf, 0x00de, 0x6867, 0x0000, 0x6833, 0x0000, + 0x6868, 0xc0fd, 0x686a, 0x00c6, 0x080c, 0x37a9, 0x1118, 0x00ce, + 0x0804, 0x28cf, 0x080c, 0x9a1c, 0x2009, 0x0003, 0x00ce, 0x0904, + 0x28cc, 0x7007, 0x0003, 0x701b, 0x3c96, 0x0005, 0x6830, 0x9086, + 0x0100, 0x2009, 0x0004, 0x0904, 0x28cc, 0x0804, 0x28a2, 0x81ff, + 0x0120, 0x2009, 0x0001, 0x0804, 0x28cc, 0x6000, 0x9086, 0x0003, + 0x0120, 0x2009, 0x0007, 0x0804, 0x28cc, 0x7e84, 0x860f, 0x918c, + 0x00ff, 0x96b4, 0x00ff, 0x080c, 0x4b58, 0x1904, 0x28cf, 0x9186, + 0x007f, 0x0150, 0x6004, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0120, + 0x2009, 0x0009, 0x0804, 0x28cc, 0x00c6, 0x080c, 0x3784, 0x00ce, + 0x1120, 0x2009, 0x0002, 0x0804, 0x28cc, 0x6867, 0x0000, 0x6868, + 0xc0fd, 0x686a, 0x080c, 0x975f, 0x1120, 0x2009, 0x0003, 0x0804, + 0x28cc, 0x7007, 0x0003, 0x701b, 0x3cde, 0x0005, 0x6808, 0x8007, + 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x28cc, 0x68e0, + 0x6866, 0x6810, 0x8007, 0x9084, 0x00ff, 0x800c, 0x6814, 0x8007, + 0x9084, 0x00ff, 0x8004, 0x9080, 0x0002, 0x9108, 0x9d80, 0x0004, + 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0804, 0x37c8, + 0x080c, 0x3784, 0x1120, 0x2009, 0x0002, 0x0804, 0x28cc, 0x7984, + 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x0110, 0x0804, + 0x28cf, 0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, + 0x37c5, 0x701b, 0x3d1c, 0x0005, 0x9d80, 0x0019, 0x2098, 0x20a9, + 0x001a, 0x20a1, 0x12c2, 0x20e1, 0x0001, 0x20e9, 0x0001, 0x4003, + 0x0804, 0x28a2, 0x080c, 0x3784, 0x1120, 0x2009, 0x0002, 0x0804, + 0x28cc, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, + 0x0110, 0x0804, 0x28cf, 0x2099, 0x12c2, 0x20a0, 0x20a9, 0x001a, + 0x20e1, 0x0001, 0x20e9, 0x0001, 0x4003, 0x2009, 0x001a, 0x7a8c, + 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0804, 0x37c8, 0x7884, + 0x908a, 0x1000, 0x1a04, 0x28cf, 0x0126, 0x2091, 0x8000, 0x8003, + 0x800b, 0x810b, 0x9108, 0x00c6, 0x2061, 0x12ef, 0x6142, 0x00ce, + 0x012e, 0x0804, 0x28a2, 0x00c6, 0x080c, 0x5745, 0x1188, 0x2001, + 0x1290, 0x2003, 0x0001, 0x2001, 0x1100, 0x2003, 0x0001, 0x9085, + 0x0001, 0x080c, 0x5789, 0x080c, 0x5682, 0x080c, 0x0cf1, 0x0038, + 0x2061, 0x1100, 0x6030, 0xc09d, 0x6032, 0x080c, 0x45d6, 0x00ce, + 0x0005, 0x00c6, 0x2001, 0x1100, 0x2004, 0x908e, 0x0000, 0x0904, + 0x28cc, 0x7884, 0x9005, 0x0188, 0x7888, 0x2061, 0x12bc, 0x2c0c, + 0x2062, 0x080c, 0x203d, 0x01a0, 0x080c, 0x2045, 0x0188, 0x080c, + 0x204d, 0x0170, 0x2162, 0x0804, 0x28cf, 0x2061, 0x0100, 0x6038, + 0x9086, 0x0007, 0x1118, 0x2009, 0x0001, 0x0010, 0x2009, 0x0000, + 0x7884, 0x9086, 0x0002, 0x1568, 0x2061, 0x0100, 0x6028, 0xc09c, + 0x602a, 0x0026, 0x2011, 0x0003, 0x080c, 0x79c2, 0x2011, 0x0002, + 0x080c, 0x79cc, 0x002e, 0x080c, 0x78b3, 0x080c, 0x65cf, 0x0036, + 0x2019, 0x0000, 0x080c, 0x7936, 0x003e, 0x60e3, 0x0000, 0x080c, + 0xadf2, 0x080c, 0xae0d, 0x9085, 0x0001, 0x080c, 0x5789, 0x2001, + 0x0140, 0x2003, 0x0000, 0x2001, 0x1100, 0x2003, 0x0004, 0x6027, + 0x0008, 0x00ce, 0x0804, 0x28a2, 0x81ff, 0x0120, 0x2009, 0x0001, + 0x0804, 0x28cc, 0x6000, 0x9086, 0x0003, 0x0120, 0x2009, 0x0007, + 0x0804, 0x28cc, 0x7e84, 0x860f, 0x918c, 0x00ff, 0x96b4, 0x00ff, + 0x080c, 0x4b58, 0x1904, 0x28cf, 0x9186, 0x007f, 0x0150, 0x6004, + 0x9084, 0x00ff, 0x9086, 0x0006, 0x0120, 0x2009, 0x0009, 0x0804, + 0x28cc, 0x00c6, 0x080c, 0x3784, 0x00ce, 0x1120, 0x2009, 0x0002, + 0x0804, 0x28cc, 0x6867, 0x0000, 0x6868, 0xc0fd, 0x686a, 0x080c, + 0x977b, 0x1120, 0x2009, 0x0003, 0x0804, 0x28cc, 0x7007, 0x0003, + 0x701b, 0x3e1b, 0x0005, 0x6830, 0x9086, 0x0100, 0x1120, 0x2009, + 0x0004, 0x0804, 0x28cc, 0x68e0, 0x6866, 0x6834, 0x8007, 0x800c, + 0x9d80, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, + 0x0804, 0x37c8, 0x0126, 0x2091, 0x8000, 0x00c6, 0x2061, 0x12ef, + 0x7984, 0x6152, 0x614e, 0x6057, 0x0000, 0x604b, 0x0009, 0x7898, + 0x606a, 0x789c, 0x6066, 0x7888, 0x6062, 0x788c, 0x605e, 0x2061, + 0x1291, 0x2001, 0x1304, 0x6012, 0x600f, 0x0001, 0x6017, 0x0001, + 0x601b, 0x0002, 0x6007, 0x0000, 0x603b, 0x0000, 0x00ce, 0x012e, + 0x0804, 0x28a2, 0x0126, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, + 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2061, 0x0100, 0x2069, 0x0200, + 0x2071, 0x1100, 0x6044, 0xd0a4, 0x11e8, 0xd084, 0x0118, 0x080c, + 0x3ff0, 0x0068, 0xd08c, 0x0118, 0x080c, 0x3f00, 0x0040, 0xd094, + 0x0118, 0x080c, 0x3ed3, 0x0018, 0xd09c, 0x0108, 0x0099, 0x00fe, + 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, + 0x012e, 0x0005, 0x0016, 0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a, + 0x001e, 0x0c68, 0x624c, 0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086, + 0xf0f0, 0x0130, 0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0490, + 0x9294, 0xff00, 0x9296, 0xf700, 0x0178, 0x7134, 0xd1a4, 0x1160, + 0x6240, 0x9295, 0x0100, 0x6242, 0x9294, 0x0010, 0x0128, 0x2009, + 0x00f7, 0x080c, 0x46a4, 0x00f0, 0x6040, 0x9084, 0x0010, 0x9085, + 0x0140, 0x6042, 0x6043, 0x0000, 0x7077, 0x0000, 0x7093, 0x0001, + 0x70b7, 0x0000, 0x70cf, 0x0000, 0x2009, 0x1580, 0x200b, 0x0000, + 0x7087, 0x0000, 0x707b, 0x000f, 0x2009, 0x000f, 0x2011, 0x457f, + 0x080c, 0x65e1, 0x0005, 0x2001, 0x1174, 0x2004, 0xd08c, 0x0110, + 0x704f, 0xffff, 0x7078, 0x9005, 0x1510, 0x2011, 0x457f, 0x080c, + 0x655b, 0x6040, 0x9094, 0x0010, 0x9285, 0x0020, 0x6042, 0x20a9, + 0x00c8, 0x6044, 0xd08c, 0x1168, 0x1f04, 0x3ee9, 0x6242, 0x708b, + 0x0000, 0x6040, 0x9094, 0x0010, 0x9285, 0x0080, 0x6042, 0x6242, + 0x0030, 0x6242, 0x708b, 0x0000, 0x707f, 0x0000, 0x0000, 0x0005, + 0x707c, 0x908a, 0x0003, 0x1210, 0x0023, 0x0010, 0x080c, 0x0cf1, + 0x0005, 0x3f0c, 0x3f54, 0x3fef, 0x00f6, 0x707f, 0x0001, 0x6803, + 0x00fc, 0x20a9, 0x0004, 0x6800, 0x9084, 0x00fc, 0x0120, 0x1f04, + 0x3f13, 0x080c, 0x0cf1, 0x68a0, 0x68a2, 0x689c, 0x689e, 0x6898, + 0x689a, 0xa001, 0x6803, 0x1600, 0x6837, 0x0020, 0x080c, 0x4702, + 0x2079, 0x1500, 0x7833, 0x1101, 0x7837, 0x0000, 0x20e1, 0x0001, + 0x2099, 0x1105, 0x20e9, 0x0001, 0x20a1, 0x150e, 0x20a9, 0x0004, + 0x4003, 0x080c, 0x7e9b, 0x20e1, 0x0001, 0x2099, 0x1500, 0x20e9, + 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c, + 0x600f, 0x0000, 0x080c, 0x45b2, 0x00fe, 0x7083, 0x0000, 0x6043, + 0x0008, 0x6043, 0x0000, 0x0005, 0x00f6, 0x7080, 0x7083, 0x0000, + 0x9025, 0x0904, 0x3fcc, 0x6020, 0xd0b4, 0x1904, 0x3fca, 0x7190, + 0x81ff, 0x0904, 0x3fb8, 0x9486, 0x000c, 0x1904, 0x3fc5, 0x9480, + 0x0018, 0x8004, 0x20a8, 0x080c, 0x46fa, 0x2011, 0x0260, 0x2019, + 0x1500, 0x220c, 0x2304, 0x9106, 0x11e8, 0x8210, 0x8318, 0x1f04, + 0x3f71, 0x6043, 0x0004, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, + 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0006, 0x707f, 0x0002, 0x708b, + 0x0002, 0x2009, 0x07d0, 0x2011, 0x4586, 0x080c, 0x65e1, 0x080c, + 0x4702, 0x04c0, 0x080c, 0x46fa, 0x2079, 0x0260, 0x7930, 0x918e, + 0x1101, 0x1558, 0x7834, 0x9005, 0x1540, 0x7900, 0x918c, 0x00ff, + 0x1118, 0x7804, 0x9005, 0x0190, 0x080c, 0x46fa, 0x2011, 0x026e, + 0x2019, 0x1105, 0x20a9, 0x0004, 0x220c, 0x2304, 0x9102, 0x0230, + 0x11a0, 0x8210, 0x8318, 0x1f04, 0x3fac, 0x0078, 0x7093, 0x0000, + 0x080c, 0x46fa, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0001, + 0x20a1, 0x1500, 0x20a9, 0x0014, 0x4003, 0x6043, 0x0008, 0x6043, + 0x0000, 0x0010, 0x00fe, 0x0005, 0x6040, 0x9085, 0x0100, 0x6042, + 0x6020, 0xd0b4, 0x1db8, 0x080c, 0x7e9b, 0x20e1, 0x0001, 0x2099, + 0x1500, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, + 0x60c3, 0x000c, 0x2011, 0x12e6, 0x2013, 0x0000, 0x7083, 0x0000, + 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x7718, 0x08d8, 0x0005, + 0x7088, 0x908a, 0x001d, 0x1210, 0x0023, 0x0010, 0x080c, 0x0cf1, + 0x0005, 0x4023, 0x4036, 0x4060, 0x4080, 0x40a6, 0x40d5, 0x40fb, + 0x4133, 0x4159, 0x4187, 0x41c0, 0x41f8, 0x4216, 0x4241, 0x4263, + 0x427a, 0x4282, 0x42b4, 0x42da, 0x4309, 0x432f, 0x4367, 0x43a6, + 0x43db, 0x43f9, 0x4452, 0x4474, 0x449e, 0x449f, 0x00c6, 0x2061, + 0x1100, 0x6003, 0x0007, 0x2061, 0x0100, 0x6004, 0x9084, 0xfff9, + 0x6006, 0x00ce, 0x0005, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, + 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0002, 0x708b, 0x0001, 0x2009, + 0x07d0, 0x2011, 0x4586, 0x080c, 0x65e1, 0x0005, 0x00f6, 0x7080, + 0x9086, 0x0014, 0x1518, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x11f0, + 0x080c, 0x46fa, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x11a0, + 0x7834, 0x9005, 0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70b4, 0x9005, + 0x1110, 0x70b7, 0x0001, 0x2011, 0x4586, 0x080c, 0x655b, 0x708b, + 0x0010, 0x080c, 0x4282, 0x0010, 0x7083, 0x0000, 0x00fe, 0x0005, + 0x00f6, 0x708b, 0x0003, 0x6043, 0x0004, 0x2011, 0x4586, 0x080c, + 0x655b, 0x080c, 0x4686, 0x2079, 0x0240, 0x7833, 0x1102, 0x7837, + 0x0000, 0x20a9, 0x0008, 0x9f88, 0x000e, 0x200b, 0x0000, 0x8108, + 0x1f04, 0x4075, 0x60c3, 0x0014, 0x080c, 0x45b2, 0x00fe, 0x0005, + 0x00f6, 0x7080, 0x9005, 0x0500, 0x2011, 0x4586, 0x080c, 0x655b, + 0x9086, 0x0014, 0x11b8, 0x080c, 0x46fa, 0x2079, 0x0260, 0x7a30, + 0x9296, 0x1102, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, + 0x0128, 0x70b4, 0x9005, 0x1110, 0x70b7, 0x0001, 0x708b, 0x0004, + 0x0029, 0x0010, 0x080c, 0x46d6, 0x00fe, 0x0005, 0x00f6, 0x708b, + 0x0005, 0x080c, 0x4686, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837, + 0x0000, 0x080c, 0x46fa, 0x080c, 0x46dd, 0x1170, 0x7074, 0x9005, + 0x1158, 0x714c, 0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c, + 0x4532, 0x0168, 0x080c, 0x46bb, 0x20a9, 0x0008, 0x20e1, 0x0000, + 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, + 0x0014, 0x080c, 0x45b2, 0x00fe, 0x0005, 0x00f6, 0x7080, 0x9005, + 0x0500, 0x2011, 0x4586, 0x080c, 0x655b, 0x9086, 0x0014, 0x11b8, + 0x080c, 0x46fa, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, + 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70b4, 0x9005, + 0x1110, 0x70b7, 0x0001, 0x708b, 0x0006, 0x0029, 0x0010, 0x080c, + 0x46d6, 0x00fe, 0x0005, 0x00f6, 0x708b, 0x0007, 0x080c, 0x4686, + 0x2079, 0x0240, 0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x46fa, + 0x080c, 0x46dd, 0x11b8, 0x7074, 0x9005, 0x11a0, 0x7154, 0x9186, + 0xffff, 0x0180, 0x9180, 0x26c1, 0x200d, 0x918c, 0xff00, 0x810f, + 0x2011, 0x0008, 0x080c, 0x4532, 0x0180, 0x080c, 0x39eb, 0x0110, + 0x080c, 0x1cb3, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, + 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, + 0x45b2, 0x00fe, 0x0005, 0x00f6, 0x7080, 0x9005, 0x0500, 0x2011, + 0x4586, 0x080c, 0x655b, 0x9086, 0x0014, 0x11b8, 0x080c, 0x46fa, + 0x2079, 0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, + 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70b4, 0x9005, 0x1110, 0x70b7, + 0x0001, 0x708b, 0x0008, 0x0029, 0x0010, 0x080c, 0x46d6, 0x00fe, + 0x0005, 0x00f6, 0x708b, 0x0009, 0x080c, 0x4686, 0x2079, 0x0240, + 0x7833, 0x1105, 0x7837, 0x0100, 0x080c, 0x46dd, 0x1150, 0x7074, + 0x9005, 0x1138, 0x080c, 0x44a0, 0x1188, 0x9085, 0x0001, 0x080c, + 0x1cb3, 0x20a9, 0x0008, 0x080c, 0x46fa, 0x20e1, 0x0000, 0x2099, + 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, + 0x080c, 0x45b2, 0x0010, 0x080c, 0x4016, 0x00fe, 0x0005, 0x00f6, + 0x7080, 0x9005, 0x0598, 0x2011, 0x4586, 0x080c, 0x655b, 0x9086, + 0x0014, 0x1550, 0x080c, 0x46fa, 0x2079, 0x0260, 0x7a30, 0x9296, + 0x1105, 0x1510, 0x7834, 0x2011, 0x0100, 0x921e, 0x1160, 0x7a38, + 0xd2fc, 0x0128, 0x70b4, 0x9005, 0x1110, 0x70b7, 0x0001, 0x708b, + 0x000a, 0x00b1, 0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc, 0x0128, + 0x70b4, 0x9005, 0x1110, 0x70b7, 0x0001, 0x7087, 0x0000, 0x708b, + 0x000e, 0x080c, 0x4263, 0x0010, 0x080c, 0x46d6, 0x00fe, 0x0005, + 0x00f6, 0x708b, 0x000b, 0x2011, 0x150e, 0x20e9, 0x0001, 0x22a0, + 0x20a9, 0x0040, 0x2019, 0xffff, 0x4304, 0x080c, 0x4686, 0x2079, + 0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x46dd, 0x0118, + 0x2013, 0x0000, 0x0020, 0x7050, 0x9085, 0x0100, 0x2012, 0x20a9, + 0x0040, 0x2009, 0x024e, 0x2011, 0x150e, 0x220e, 0x8210, 0x8108, + 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, + 0x1f04, 0x41e5, 0x60c3, 0x0084, 0x080c, 0x45b2, 0x00fe, 0x0005, + 0x00f6, 0x7080, 0x9005, 0x01c0, 0x2011, 0x4586, 0x080c, 0x655b, + 0x9086, 0x0084, 0x1178, 0x080c, 0x46fa, 0x2079, 0x0260, 0x7a30, + 0x9296, 0x1106, 0x1138, 0x7834, 0x9005, 0x1120, 0x708b, 0x000c, + 0x0029, 0x0010, 0x080c, 0x46d6, 0x00fe, 0x0005, 0x00f6, 0x708b, + 0x000d, 0x080c, 0x4686, 0x2079, 0x0240, 0x7833, 0x1107, 0x7837, + 0x0000, 0x080c, 0x46fa, 0x20a9, 0x0040, 0x2011, 0x026e, 0x2009, + 0x024e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810, + 0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011, + 0x0260, 0x1f04, 0x4229, 0x60c3, 0x0084, 0x080c, 0x45b2, 0x00fe, + 0x0005, 0x00f6, 0x7080, 0x9005, 0x01e0, 0x2011, 0x4586, 0x080c, + 0x655b, 0x9086, 0x0084, 0x1198, 0x080c, 0x46fa, 0x2079, 0x0260, + 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7087, + 0x0001, 0x080c, 0x4658, 0x708b, 0x000e, 0x0029, 0x0010, 0x080c, + 0x46d6, 0x00fe, 0x0005, 0x708b, 0x000f, 0x7083, 0x0000, 0x2061, + 0x0140, 0x605b, 0xbc85, 0x605f, 0xb5b5, 0x2061, 0x0100, 0x6043, + 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011, 0x4586, 0x080c, + 0x654f, 0x0005, 0x7080, 0x9005, 0x0120, 0x2011, 0x4586, 0x080c, + 0x655b, 0x0005, 0x708b, 0x0011, 0x080c, 0x7e9b, 0x080c, 0x46fa, + 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, + 0x7480, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, + 0x20a8, 0x4003, 0x080c, 0x46dd, 0x1190, 0x716c, 0x81ff, 0x0178, + 0x2009, 0x0000, 0x7070, 0x9084, 0x00ff, 0x0148, 0x080c, 0x1c69, + 0x9186, 0x0080, 0x0120, 0x2011, 0x0008, 0x080c, 0x4532, 0x60c3, + 0x0014, 0x080c, 0x45b2, 0x0005, 0x00f6, 0x7080, 0x9005, 0x0500, + 0x2011, 0x4586, 0x080c, 0x655b, 0x9086, 0x0014, 0x11b8, 0x080c, + 0x46fa, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, + 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70b4, 0x9005, 0x1110, + 0x70b7, 0x0001, 0x708b, 0x0012, 0x0029, 0x0010, 0x7083, 0x0000, + 0x00fe, 0x0005, 0x00f6, 0x708b, 0x0013, 0x080c, 0x4694, 0x2079, + 0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x46fa, 0x080c, + 0x46dd, 0x1170, 0x7074, 0x9005, 0x1158, 0x714c, 0x9186, 0xffff, + 0x0138, 0x2011, 0x0008, 0x080c, 0x4532, 0x0168, 0x080c, 0x46bb, + 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, + 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x45b2, 0x00fe, + 0x0005, 0x00f6, 0x7080, 0x9005, 0x0500, 0x2011, 0x4586, 0x080c, + 0x655b, 0x9086, 0x0014, 0x11b8, 0x080c, 0x46fa, 0x2079, 0x0260, + 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, + 0xd2fc, 0x0128, 0x70b4, 0x9005, 0x1110, 0x70b7, 0x0001, 0x708b, + 0x0014, 0x0029, 0x0010, 0x7083, 0x0000, 0x00fe, 0x0005, 0x00f6, + 0x708b, 0x0015, 0x080c, 0x4694, 0x2079, 0x0240, 0x7833, 0x1104, + 0x7837, 0x0000, 0x080c, 0x46fa, 0x080c, 0x46dd, 0x11b8, 0x7074, + 0x9005, 0x11a0, 0x7154, 0x9186, 0xffff, 0x0180, 0x9180, 0x26c1, + 0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x4532, + 0x0180, 0x080c, 0x39eb, 0x0110, 0x080c, 0x1cb3, 0x20a9, 0x0008, + 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, + 0x4003, 0x60c3, 0x0014, 0x080c, 0x45b2, 0x00fe, 0x0005, 0x00f6, + 0x7080, 0x9005, 0x05c8, 0x2011, 0x4586, 0x080c, 0x655b, 0x9086, + 0x0014, 0x1580, 0x080c, 0x46fa, 0x2079, 0x0260, 0x7a30, 0x9296, + 0x1105, 0x1540, 0x7834, 0x2011, 0x0100, 0x921e, 0x1148, 0x7a38, + 0xd2fc, 0x0128, 0x70b4, 0x9005, 0x1110, 0x70b7, 0x0001, 0x0060, + 0x9005, 0x11c0, 0x7a38, 0xd2fc, 0x0128, 0x70b4, 0x9005, 0x1110, + 0x70b7, 0x0001, 0x7087, 0x0000, 0x7a38, 0xd2f4, 0x0138, 0x2001, + 0x1174, 0x2004, 0xd0a4, 0x1110, 0x70cf, 0x0008, 0x708b, 0x0016, + 0x0029, 0x0010, 0x7083, 0x0000, 0x00fe, 0x0005, 0x080c, 0x7e9b, + 0x080c, 0x46fa, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, + 0x20a1, 0x0240, 0x20a9, 0x000e, 0x4003, 0x2011, 0x026e, 0x708b, + 0x0017, 0x080c, 0x46dd, 0x1150, 0x7074, 0x9005, 0x1138, 0x080c, + 0x44a0, 0x1188, 0x9085, 0x0001, 0x080c, 0x1cb3, 0x20a9, 0x0008, + 0x080c, 0x46fa, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, + 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x45b2, 0x0010, + 0x080c, 0x4016, 0x0005, 0x00f6, 0x7080, 0x9005, 0x01c0, 0x2011, + 0x4586, 0x080c, 0x655b, 0x9086, 0x0084, 0x1178, 0x080c, 0x46fa, + 0x2079, 0x0260, 0x7a30, 0x9296, 0x1106, 0x1138, 0x7834, 0x9005, + 0x1120, 0x708b, 0x0018, 0x0029, 0x0010, 0x7083, 0x0000, 0x00fe, + 0x0005, 0x00f6, 0x708b, 0x0019, 0x080c, 0x4694, 0x2079, 0x0240, + 0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x46fa, 0x2009, 0x026e, + 0x2039, 0x150e, 0x20a9, 0x0040, 0x213e, 0x8738, 0x8108, 0x9186, + 0x0280, 0x1128, 0x6814, 0x8000, 0x6816, 0x2009, 0x0260, 0x1f04, + 0x440c, 0x2039, 0x150e, 0x080c, 0x46dd, 0x11e8, 0x2728, 0x2514, + 0x8207, 0x9084, 0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff, 0x8007, + 0x9205, 0x202a, 0x7050, 0x2310, 0x8214, 0x92a0, 0x150e, 0x2414, + 0x938c, 0x0001, 0x0118, 0x9294, 0xff00, 0x0018, 0x9294, 0x00ff, + 0x8007, 0x9215, 0x2222, 0x20a9, 0x0040, 0x2009, 0x024e, 0x270e, + 0x8738, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, + 0x2009, 0x0240, 0x1f04, 0x443f, 0x60c3, 0x0084, 0x080c, 0x45b2, + 0x00fe, 0x0005, 0x00f6, 0x7080, 0x9005, 0x01e0, 0x2011, 0x4586, + 0x080c, 0x655b, 0x9086, 0x0084, 0x1198, 0x080c, 0x46fa, 0x2079, + 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, + 0x7087, 0x0001, 0x080c, 0x4658, 0x708b, 0x001a, 0x0029, 0x0010, + 0x7083, 0x0000, 0x00fe, 0x0005, 0x708b, 0x001b, 0x080c, 0x7e9b, + 0x080c, 0x46fa, 0x2011, 0x0260, 0x2009, 0x0240, 0x7480, 0x9480, + 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x220e, + 0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810, 0x8000, 0x6812, + 0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011, 0x0260, 0x1f04, + 0x4487, 0x60c3, 0x0084, 0x080c, 0x45b2, 0x0005, 0x0005, 0x0005, + 0x0086, 0x0096, 0x2029, 0x1153, 0x252c, 0x20a9, 0x0008, 0x2041, + 0x150e, 0x20e9, 0x0001, 0x28a0, 0x080c, 0x46fa, 0x20e1, 0x0000, + 0x2099, 0x026e, 0x4003, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, + 0x0110, 0x2011, 0x0000, 0x2800, 0x9200, 0x200c, 0x91a6, 0xffff, + 0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211, 0x1f04, 0x44bb, + 0x0804, 0x452a, 0x82ff, 0x1160, 0xd5d4, 0x0120, 0x91a6, 0x3fff, + 0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904, 0x452a, 0x918d, 0xc000, + 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110, 0x2019, 0x0010, + 0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424, 0x1240, 0xd5d4, + 0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x44e1, 0x04d8, 0x23a8, + 0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x44f3, 0x2328, 0x8529, + 0x92be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007, 0x2200, 0x973a, + 0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04, 0x4502, 0x754e, 0x95c8, + 0x26c1, 0x292d, 0x95ac, 0x00ff, 0x7572, 0x6532, 0x6536, 0x0016, + 0x2508, 0x080c, 0x1c93, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x2018, + 0x2304, 0x9405, 0x201a, 0x7077, 0x0001, 0x20e9, 0x0000, 0x20a1, + 0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9, 0x0008, 0x4003, 0x9085, + 0x0001, 0x0028, 0x9006, 0x0018, 0x9006, 0x080c, 0x0cf1, 0x009e, + 0x008e, 0x0005, 0x0156, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x22a8, + 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x2011, 0x024e, + 0x22a0, 0x4003, 0x014e, 0x013e, 0x01de, 0x01ce, 0x015e, 0x2118, + 0x2021, 0x0000, 0x2001, 0x0007, 0x939a, 0x0010, 0x0218, 0x8420, + 0x8001, 0x0cd0, 0x2118, 0x84ff, 0x0120, 0x939a, 0x0010, 0x8421, + 0x1de0, 0x2021, 0x0001, 0x83ff, 0x0118, 0x8423, 0x8319, 0x1de8, + 0x9238, 0x2029, 0x026e, 0x9528, 0x2504, 0x942c, 0x11b8, 0x9405, + 0x203a, 0x714e, 0x91a0, 0x26c1, 0x242d, 0x95ac, 0x00ff, 0x7572, + 0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x1c93, 0x001e, 0x60e7, + 0x0000, 0x65ea, 0x7077, 0x0001, 0x9084, 0x0000, 0x0005, 0x00e6, + 0x2071, 0x1100, 0x707b, 0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6, + 0x2079, 0x0100, 0x2071, 0x0140, 0x080c, 0x4647, 0x080c, 0x7721, + 0x7004, 0x9084, 0x4000, 0x0120, 0x7003, 0x1000, 0x7003, 0x0000, + 0x0126, 0x2091, 0x8000, 0x2071, 0x1122, 0x2073, 0x0000, 0x7840, + 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c, 0x46a4, 0x001e, 0x9094, + 0x0010, 0x9285, 0x0080, 0x7842, 0x7a42, 0x002e, 0x012e, 0x00fe, + 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x2011, 0x12e6, 0x2013, + 0x0000, 0x7083, 0x0000, 0x012e, 0x60a3, 0x0056, 0x60a7, 0x9575, + 0x080c, 0x7718, 0x6144, 0xd184, 0x0120, 0x7188, 0x918d, 0x2000, + 0x0018, 0x717c, 0x918d, 0x1000, 0x2011, 0x12b9, 0x2112, 0x2009, + 0x07d0, 0x2011, 0x4586, 0x080c, 0x65e1, 0x0005, 0x0016, 0x0026, + 0x00c6, 0x0126, 0x2091, 0x8000, 0x2011, 0x0003, 0x080c, 0x79c2, + 0x2011, 0x0002, 0x080c, 0x79cc, 0x080c, 0x78b3, 0x080c, 0x65cf, + 0x0036, 0x2019, 0x0000, 0x080c, 0x7936, 0x003e, 0x2009, 0x00f7, + 0x080c, 0x46a4, 0x2061, 0x12ef, 0x601b, 0x0000, 0x601f, 0x0000, + 0x2061, 0x1100, 0x6003, 0x0001, 0x2061, 0x0100, 0x6043, 0x0090, + 0x6043, 0x0010, 0x2009, 0x12b9, 0x200b, 0x0000, 0x2009, 0x002d, + 0x2011, 0x4611, 0x080c, 0x654f, 0x012e, 0x00ce, 0x002e, 0x001e, + 0x0005, 0x00e6, 0x0006, 0x0126, 0x2091, 0x8000, 0x0481, 0x2071, + 0x0100, 0x080c, 0x7721, 0x2071, 0x0140, 0x7004, 0x9084, 0x4000, + 0x0120, 0x7003, 0x1000, 0x7003, 0x0000, 0x080c, 0x574d, 0x01a8, + 0x080c, 0x576b, 0x1190, 0x2001, 0x128f, 0x2003, 0xaaaa, 0x0016, + 0x080c, 0x1d69, 0x2001, 0x1280, 0x2102, 0x001e, 0x2001, 0x1290, + 0x2003, 0x0000, 0x080c, 0x5682, 0x0030, 0x2001, 0x0001, 0x080c, + 0x1c36, 0x080c, 0x45d6, 0x012e, 0x000e, 0x00ee, 0x0005, 0x2001, + 0x110d, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036, 0x2011, 0x8017, + 0x2001, 0x12b9, 0x201c, 0x080c, 0x37dc, 0x003e, 0x002e, 0x0005, + 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1580, 0x080c, 0x46fa, + 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9, 0x0020, 0x080c, + 0x46f4, 0x2099, 0x0260, 0x20a1, 0x1592, 0x0051, 0x20a9, 0x000e, + 0x080c, 0x46f7, 0x2099, 0x0260, 0x20a1, 0x15b2, 0x0009, 0x0005, + 0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007, 0x2012, 0x8108, + 0x8210, 0x1f04, 0x467c, 0x002e, 0x001e, 0x0005, 0x080c, 0x7e9b, + 0x20e1, 0x0001, 0x2099, 0x1500, 0x20e9, 0x0000, 0x20a1, 0x0240, + 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0x7e9b, 0x080c, 0x46fa, + 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, + 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006, 0x2061, 0x0100, + 0x810f, 0x2001, 0x1130, 0x2004, 0x9005, 0x1138, 0x2001, 0x1114, + 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185, 0x00f7, 0x604a, + 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x2001, 0x1153, 0x2004, + 0xd0a4, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xaaca, + 0x2001, 0x110c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009, + 0x0000, 0x080c, 0x2582, 0x004e, 0x001e, 0x0005, 0x080c, 0x45d6, + 0x708b, 0x0000, 0x7083, 0x0000, 0x0005, 0x0006, 0x2001, 0x110c, + 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005, 0x0006, 0x0016, 0x0126, + 0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0x918d, 0x0006, 0x2102, + 0x012e, 0x001e, 0x000e, 0x0005, 0x2009, 0x0001, 0x0028, 0x2009, + 0x0002, 0x0010, 0x2009, 0x0000, 0x6814, 0x9084, 0xffc0, 0x910d, + 0x6916, 0x0005, 0x00f6, 0x0156, 0x0146, 0x01d6, 0x9006, 0x20a9, + 0x0080, 0x20e9, 0x0001, 0x20a1, 0x1500, 0x4004, 0x2079, 0x1500, + 0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef, 0x7813, 0x0138, + 0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e, 0x015e, 0x00fe, + 0x0005, 0x0156, 0x20a9, 0x00ff, 0x2009, 0x1000, 0x9006, 0x200a, + 0x8108, 0x1f04, 0x4727, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, + 0x0136, 0x0146, 0x2069, 0x1152, 0x9006, 0x6002, 0x6007, 0x0707, + 0x600a, 0x600e, 0x6012, 0x9198, 0x26c1, 0x231d, 0x939c, 0x00ff, + 0x6316, 0x20a9, 0x0004, 0x9c98, 0x0006, 0x20e9, 0x0001, 0x23a0, + 0x4004, 0x20a9, 0x0004, 0x9c98, 0x000a, 0x23a0, 0x4004, 0x603e, + 0x6042, 0x604e, 0x6052, 0x6056, 0x605a, 0x605e, 0x6062, 0x6066, + 0x606a, 0x606e, 0x6072, 0x6076, 0x607a, 0x608a, 0x608e, 0x6092, + 0x6096, 0x609a, 0x609e, 0x60ae, 0x61a2, 0x00d6, 0x60a4, 0x906d, + 0x0110, 0x080c, 0x0df6, 0x60a7, 0x0000, 0x00de, 0x9006, 0x604a, + 0x6810, 0x603a, 0x680c, 0x6046, 0x6814, 0x9084, 0x00ff, 0x6042, + 0x014e, 0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091, + 0x8000, 0x6974, 0x6e78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, + 0x47f0, 0x918c, 0xff00, 0x810f, 0x9182, 0x00ff, 0x1a04, 0x47f5, + 0x2001, 0x110c, 0x2004, 0x9084, 0x0003, 0x1904, 0x47fc, 0x9188, + 0x1000, 0x2104, 0x9065, 0x0508, 0x6004, 0x9084, 0x00ff, 0x908e, + 0x0006, 0x1500, 0x60a4, 0x900d, 0x1904, 0x4811, 0x6050, 0x900d, + 0x1148, 0x6802, 0x2d00, 0x6052, 0x604e, 0x080c, 0x68a3, 0x9006, + 0x012e, 0x0005, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, 0x0ca8, + 0x2001, 0x0005, 0x2009, 0x0000, 0x04e0, 0x2001, 0x0028, 0x2009, + 0x0000, 0x04b8, 0x9082, 0x0006, 0x1298, 0x2001, 0x1133, 0x2004, + 0xd0ac, 0x1158, 0x60a0, 0xd0bc, 0x1140, 0x6100, 0xd1fc, 0x0990, + 0x2001, 0x0029, 0x2009, 0x1000, 0x0420, 0x2001, 0x0028, 0x00a8, + 0x2009, 0x110c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0068, + 0xd184, 0x0118, 0x2001, 0x0004, 0x0040, 0x2001, 0x0029, 0x6100, + 0xd1fc, 0x0118, 0x2009, 0x1000, 0x0060, 0x2009, 0x0000, 0x0048, + 0x2001, 0x0029, 0x2009, 0x0000, 0x0020, 0x2001, 0x0029, 0x2009, + 0x0000, 0x9005, 0x012e, 0x0005, 0x2001, 0x110c, 0x2004, 0xd084, + 0x19b8, 0x9188, 0x1000, 0x2104, 0x9065, 0x0990, 0x6004, 0x9084, + 0x00ff, 0x908e, 0x0006, 0x1960, 0x6000, 0xd0c4, 0x0948, 0x0804, + 0x47a2, 0x080c, 0x4cdc, 0x0904, 0x47b8, 0x0804, 0x47a6, 0x00e6, + 0x0126, 0x2091, 0x8000, 0x6874, 0x8007, 0x9084, 0x00ff, 0x2008, + 0x9182, 0x00ff, 0x1a04, 0x486a, 0x9188, 0x1000, 0x2104, 0x9065, + 0x01c0, 0x6004, 0x9084, 0x00ff, 0x908e, 0x0006, 0x11a8, 0x2c70, + 0x080c, 0x7ec8, 0x05e8, 0x2e00, 0x6012, 0x2d00, 0x6016, 0x600b, + 0xffff, 0x6023, 0x000a, 0x2009, 0x0003, 0x080c, 0x7f4e, 0x9006, + 0x0460, 0x2001, 0x0028, 0x0440, 0x9082, 0x0006, 0x1298, 0x2001, + 0x1133, 0x2004, 0xd0ac, 0x1158, 0x60a0, 0xd0bc, 0x1140, 0x6100, + 0xd1fc, 0x09e8, 0x2001, 0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, + 0x0028, 0x0090, 0x2009, 0x110c, 0x210c, 0xd18c, 0x0118, 0x2001, + 0x0004, 0x0050, 0xd184, 0x0118, 0x2001, 0x0004, 0x0028, 0x2001, + 0x0029, 0x0010, 0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x0005, + 0x2001, 0x002c, 0x0cc8, 0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, + 0x2011, 0x0000, 0x2079, 0x1100, 0x6974, 0x918c, 0xff00, 0x810f, + 0x9182, 0x00ff, 0x1a04, 0x4a12, 0x2001, 0x110c, 0x2004, 0x9084, + 0x0003, 0x1904, 0x49ff, 0x080c, 0x4b58, 0x1180, 0x6004, 0x9084, + 0x00ff, 0x9082, 0x0006, 0x1250, 0x2001, 0x1133, 0x2004, 0xd0ac, + 0x1904, 0x49f9, 0x60a0, 0xd0bc, 0x1904, 0x49f9, 0x6894, 0x90c6, + 0x006f, 0x0158, 0x90c6, 0x005e, 0x0904, 0x4940, 0x90c6, 0x0064, + 0x0904, 0x4974, 0x2008, 0x0804, 0x4909, 0x6998, 0x2140, 0x918c, + 0xff00, 0x810f, 0x78cc, 0xd0ac, 0x1120, 0x9182, 0x0080, 0x0a04, + 0x4909, 0x9182, 0x00ff, 0x1a04, 0x4909, 0x6aa0, 0x6b9c, 0x786c, + 0x9306, 0x1168, 0x7870, 0x924e, 0x1120, 0x2208, 0x2310, 0x0804, + 0x4909, 0x99cc, 0xff00, 0x1118, 0x2208, 0x2310, 0x04d0, 0x080c, + 0x36d2, 0x2c70, 0x05f0, 0x2009, 0x0000, 0x2011, 0x0000, 0x90c6, + 0x4000, 0x1500, 0x0006, 0x2e60, 0x080c, 0x4d21, 0x1108, 0xc185, + 0x7000, 0xd0bc, 0x0108, 0xc18d, 0x20a9, 0x0004, 0x9d80, 0x0031, + 0x20a0, 0x9e80, 0x0006, 0x2098, 0x080c, 0x4678, 0x20a9, 0x0004, + 0x9d80, 0x0035, 0x20a0, 0x9e80, 0x000a, 0x2098, 0x080c, 0x4678, + 0x000e, 0x0088, 0x90c6, 0x4007, 0x1110, 0x2408, 0x0060, 0x90c6, + 0x4008, 0x1118, 0x2708, 0x2610, 0x0030, 0x90c6, 0x4009, 0x1108, + 0x0010, 0x2001, 0x4006, 0x6896, 0x699a, 0x6a9e, 0x2001, 0x0030, + 0x0450, 0x080c, 0x7ec8, 0x1138, 0x2001, 0x4005, 0x2009, 0x0003, + 0x2011, 0x0000, 0x0c80, 0x2e00, 0x6012, 0x080c, 0x99cc, 0x2d00, + 0x6016, 0x6023, 0x0001, 0x6868, 0xd88c, 0x0108, 0xc0f5, 0x686a, + 0x0126, 0x2091, 0x8000, 0x080c, 0x25ad, 0x012e, 0x2001, 0x0000, + 0x080c, 0x4aa1, 0x2001, 0x0002, 0x080c, 0x4ab3, 0x2009, 0x0002, + 0x080c, 0x7f4e, 0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe, 0x0005, + 0x7800, 0x9086, 0x0003, 0x0118, 0x2009, 0x0007, 0x0448, 0x6e98, + 0x860f, 0x918c, 0x00ff, 0x96b4, 0x00ff, 0x080c, 0x4b58, 0x0120, + 0x2009, 0x000a, 0x0804, 0x4909, 0x9186, 0x007f, 0x0148, 0x6004, + 0x9084, 0x00ff, 0x9086, 0x0006, 0x0118, 0x2009, 0x0009, 0x0080, + 0x00d6, 0x080c, 0x0dc6, 0x1120, 0x00de, 0x2009, 0x0002, 0x0040, + 0x2d00, 0x00de, 0x6806, 0x080c, 0x977b, 0x1960, 0x2009, 0x0003, + 0x2001, 0x4005, 0x0804, 0x490b, 0x6e98, 0x860f, 0x918c, 0x00ff, + 0x96b4, 0x00ff, 0x080c, 0x4b58, 0x0120, 0x2009, 0x000a, 0x0804, + 0x4909, 0x00d6, 0x080c, 0x0dc6, 0x1128, 0x00de, 0x2009, 0x0002, + 0x0804, 0x49dd, 0x2d00, 0x00de, 0x6806, 0x00d6, 0x6804, 0x2068, + 0x20a9, 0x002b, 0x20e1, 0x0001, 0x2c98, 0x9de8, 0x0002, 0x20e9, + 0x0001, 0x2da0, 0x4003, 0x20a9, 0x0004, 0x9d80, 0x0006, 0x20a0, + 0x9c80, 0x0006, 0x2098, 0x080c, 0x4678, 0x20a9, 0x0004, 0x9d80, + 0x000a, 0x20a0, 0x9c80, 0x000a, 0x2098, 0x080c, 0x4678, 0x2d10, + 0x00de, 0x687b, 0x0000, 0x6883, 0x0000, 0x6897, 0x4000, 0xd684, + 0x1170, 0x2001, 0x1153, 0x2004, 0xd0b4, 0x1118, 0x689b, 0x000b, + 0x0400, 0x6000, 0xd08c, 0x0118, 0x689b, 0x000c, 0x00d0, 0x6004, + 0x9084, 0x00ff, 0x9086, 0x0006, 0x0118, 0x689b, 0x0009, 0x0088, + 0x7800, 0x9086, 0x0003, 0x0118, 0x689b, 0x0007, 0x0050, 0x080c, + 0x9744, 0x1904, 0x493a, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804, + 0x490b, 0x687b, 0x0030, 0x6897, 0x4005, 0x2200, 0x2009, 0x002b, + 0x6aa0, 0x6b9c, 0x6ca8, 0x6da4, 0x2031, 0x0000, 0x2039, 0x0001, + 0x2041, 0x0f7e, 0x080c, 0x817f, 0x1904, 0x493a, 0x2009, 0x0002, + 0x0c20, 0x2001, 0x0028, 0x2009, 0x0000, 0x0804, 0x493b, 0x2009, + 0x110c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, + 0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029, 0x2009, 0x0000, + 0x0804, 0x493b, 0x2001, 0x0029, 0x2009, 0x0000, 0x0804, 0x493b, + 0x6974, 0x6e78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1658, 0x918c, + 0xff00, 0x810f, 0x9182, 0x00ff, 0x1280, 0x9188, 0x1000, 0x2104, + 0x9065, 0x0158, 0x6004, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1150, + 0x0491, 0x080c, 0x4c6e, 0x9006, 0x00c8, 0x2001, 0x0028, 0x2009, + 0x0000, 0x00a0, 0x9082, 0x0006, 0x1240, 0x6100, 0xd1fc, 0x0d80, + 0x2001, 0x0029, 0x2009, 0x1000, 0x0048, 0x2001, 0x0029, 0x2009, + 0x0000, 0x0020, 0x2001, 0x0029, 0x2009, 0x0000, 0x9005, 0x0005, + 0x0126, 0x2091, 0x8000, 0x6050, 0x900d, 0x0138, 0x2d00, 0x200a, + 0x6803, 0x0000, 0x6052, 0x012e, 0x0005, 0x2d00, 0x6052, 0x604e, + 0x6803, 0x0000, 0x0cc0, 0x0126, 0x2091, 0x8000, 0x604c, 0x9005, + 0x0170, 0x00e6, 0x2071, 0x12dc, 0x7004, 0x9086, 0x0002, 0x0168, + 0x00ee, 0x604c, 0x6802, 0x2d00, 0x604e, 0x012e, 0x0005, 0x2d00, + 0x6052, 0x604e, 0x6803, 0x0000, 0x0cc0, 0x701c, 0x9c06, 0x1d80, + 0x604c, 0x2070, 0x7000, 0x6802, 0x2d00, 0x7002, 0x00ee, 0x012e, + 0x0005, 0x0126, 0x2091, 0x8000, 0x604c, 0x906d, 0x0130, 0x6800, + 0x9005, 0x1108, 0x6052, 0x604e, 0x9d05, 0x012e, 0x0005, 0x604c, + 0x906d, 0x0130, 0x6800, 0x9005, 0x1108, 0x6052, 0x604e, 0x9d05, + 0x0005, 0x0126, 0x00c6, 0x0026, 0x2091, 0x8000, 0x6210, 0x2260, + 0x6200, 0x9005, 0x0110, 0xc285, 0x0008, 0xc284, 0x6202, 0x002e, + 0x00ce, 0x012e, 0x0005, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, + 0x2260, 0x6204, 0x0006, 0x9086, 0x0006, 0x1180, 0x609c, 0xd0ac, + 0x0168, 0x2001, 0x1153, 0x2004, 0xd0a4, 0x0140, 0x9284, 0xff00, + 0x8007, 0x9086, 0x0007, 0x1110, 0x2011, 0x0600, 0x000e, 0x9294, + 0xff00, 0x9215, 0x6206, 0x0006, 0x9086, 0x0006, 0x1128, 0x6290, + 0x82ff, 0x1110, 0x080c, 0x0cf1, 0x000e, 0x00ce, 0x012e, 0x0005, + 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2260, 0x6204, 0x0006, + 0x9086, 0x0006, 0x1178, 0x609c, 0xd0a4, 0x0160, 0x2001, 0x1153, + 0x2004, 0xd0ac, 0x1138, 0x9284, 0x00ff, 0x9086, 0x0007, 0x1110, + 0x2011, 0x0006, 0x000e, 0x9294, 0x00ff, 0x8007, 0x9215, 0x6206, + 0x00ce, 0x012e, 0x0005, 0x0026, 0x9182, 0x00ff, 0x0218, 0x9085, + 0x0001, 0x00a0, 0x9190, 0x1000, 0x2204, 0x9065, 0x1170, 0x0016, + 0x00d6, 0x080c, 0x0dc6, 0x2d60, 0x00de, 0x001e, 0x0d80, 0x2c00, + 0x2012, 0x60a7, 0x0000, 0x080c, 0x472d, 0x9006, 0x002e, 0x0005, + 0x0126, 0x2091, 0x8000, 0x0026, 0x9182, 0x00ff, 0x0218, 0x9085, + 0x0001, 0x0458, 0x00d6, 0x9190, 0x1000, 0x2204, 0x906d, 0x0518, + 0x2013, 0x0000, 0x00d6, 0x00c6, 0x2d60, 0x60a4, 0x906d, 0x0110, + 0x080c, 0x0df6, 0x00ce, 0x00de, 0x00d6, 0x00c6, 0x68ac, 0x2060, + 0x8cff, 0x0168, 0x600c, 0x0006, 0x6014, 0x2068, 0x080c, 0x95d2, + 0x0110, 0x080c, 0x0e06, 0x080c, 0x7f1e, 0x00ce, 0x0c88, 0x00ce, + 0x00de, 0x080c, 0x0df6, 0x00de, 0x9006, 0x002e, 0x012e, 0x0005, + 0x0016, 0x9182, 0x00ff, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188, + 0x1000, 0x2104, 0x9065, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6, + 0x0156, 0x0136, 0x0146, 0x600b, 0x0000, 0x600f, 0x0000, 0x6000, + 0xc08c, 0x6002, 0x080c, 0x5745, 0x1500, 0x60a0, 0x9086, 0x007e, + 0x0130, 0x2001, 0x1133, 0x2004, 0xd0ac, 0x11b8, 0x0078, 0x7040, + 0xd0e4, 0x0198, 0x00c6, 0x2061, 0x12a2, 0x7048, 0x2062, 0x704c, + 0x6006, 0x7050, 0x600a, 0x7054, 0x600e, 0x00ce, 0x703c, 0x2069, + 0x0140, 0x6886, 0x2069, 0x1100, 0x68a2, 0x7040, 0x605e, 0x7048, + 0x6062, 0x6138, 0x910a, 0x0208, 0x603a, 0x704c, 0x6066, 0x20e1, + 0x0000, 0x2099, 0x0276, 0x9c88, 0x000a, 0x20e9, 0x0001, 0x21a0, + 0x20a9, 0x0004, 0x4003, 0x2099, 0x027a, 0x9c88, 0x0006, 0x21a0, + 0x20a9, 0x0004, 0x4003, 0x2069, 0x0200, 0x6817, 0x0001, 0x7040, + 0x606a, 0x7144, 0x616e, 0x7048, 0x6072, 0x7050, 0x6076, 0x2069, + 0x0200, 0x6817, 0x0000, 0x60a0, 0x9086, 0x007e, 0x1110, 0x7144, + 0x616e, 0x9182, 0x0211, 0x1218, 0x2009, 0x0008, 0x0400, 0x9182, + 0x0259, 0x1218, 0x2009, 0x0007, 0x00d0, 0x9182, 0x02c1, 0x1218, + 0x2009, 0x0006, 0x00a0, 0x9182, 0x0349, 0x1218, 0x2009, 0x0005, + 0x0070, 0x9182, 0x0421, 0x1218, 0x2009, 0x0004, 0x0040, 0x9182, + 0x0581, 0x1218, 0x2009, 0x0003, 0x0010, 0x2009, 0x0002, 0x6192, + 0x014e, 0x013e, 0x015e, 0x00de, 0x0005, 0x0016, 0x0026, 0x00e6, + 0x2071, 0x0260, 0x7034, 0x6896, 0x703c, 0x689a, 0x7054, 0x689e, + 0x6a00, 0x2009, 0x1172, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110, + 0xc2ad, 0x0008, 0xc2ac, 0xd0c4, 0x0120, 0xd1e4, 0x0110, 0xc2bd, + 0x0008, 0xc2bc, 0x6a02, 0x00ee, 0x002e, 0x001e, 0x0005, 0x00d6, + 0x0126, 0x2091, 0x8000, 0x60a4, 0x906d, 0x01c0, 0x6900, 0x81ff, + 0x1540, 0x6a04, 0x9282, 0x0010, 0x1648, 0x9d88, 0x0004, 0x20a9, + 0x0010, 0x2104, 0x9086, 0xffff, 0x0128, 0x8108, 0x1f04, 0x4c29, + 0x080c, 0x0cf1, 0x260a, 0x8210, 0x6a06, 0x0098, 0x080c, 0x0ddf, + 0x01a8, 0x2d00, 0x60a6, 0x6803, 0x0000, 0x9d88, 0x0004, 0x20a9, + 0x0010, 0x200b, 0xffff, 0x8108, 0x1f04, 0x4c41, 0x6807, 0x0001, + 0x6e12, 0x9085, 0x0001, 0x012e, 0x00de, 0x0005, 0x9006, 0x0cd8, + 0x0126, 0x2091, 0x8000, 0x00d6, 0x60a4, 0x900d, 0x01a0, 0x2168, + 0x6800, 0x9005, 0x1160, 0x080c, 0x4cdc, 0x1168, 0x200b, 0xffff, + 0x6804, 0x908a, 0x0002, 0x0218, 0x8001, 0x6806, 0x0020, 0x080c, + 0x0df6, 0x60a7, 0x0000, 0x00de, 0x012e, 0x0005, 0x0126, 0x2091, + 0x8000, 0x080c, 0x68a3, 0x012e, 0x0005, 0x901e, 0x0010, 0x2019, + 0x0001, 0x900e, 0x0126, 0x2091, 0x8000, 0x604c, 0x2068, 0x6000, + 0xd0dc, 0x1170, 0x8dff, 0x01e8, 0x83ff, 0x0120, 0x6878, 0x9606, + 0x0158, 0x0030, 0x686c, 0x9406, 0x1118, 0x6870, 0x9506, 0x0120, + 0x2d08, 0x6800, 0x2068, 0x0c70, 0x6a00, 0x604c, 0x9d06, 0x1110, + 0x624e, 0x0018, 0x9180, 0x0000, 0x2202, 0x82ff, 0x1110, 0x6152, + 0x8dff, 0x012e, 0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001, + 0x0005, 0x080c, 0x4d21, 0x0118, 0x080c, 0x9685, 0x0010, 0x9085, + 0x0001, 0x0005, 0x080c, 0x4d21, 0x0118, 0x080c, 0x9620, 0x0010, + 0x9085, 0x0001, 0x0005, 0x080c, 0x4d21, 0x0118, 0x080c, 0x9668, + 0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x4d21, 0x0118, 0x080c, + 0x963c, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x4d21, 0x0118, + 0x080c, 0x96a1, 0x0010, 0x9085, 0x0001, 0x0005, 0x60a4, 0x900d, + 0x1118, 0x9085, 0x0001, 0x0005, 0x00e6, 0x2170, 0x7000, 0x9005, + 0x1168, 0x20a9, 0x0010, 0x9e88, 0x0004, 0x2104, 0x9606, 0x0130, + 0x8108, 0x1f04, 0x4ce5, 0x9085, 0x0001, 0x0008, 0x9006, 0x00ee, + 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x60a4, 0x906d, 0x1128, + 0x080c, 0x0ddf, 0x01a0, 0x2d00, 0x60a6, 0x6803, 0x0001, 0x6807, + 0x0000, 0x9d88, 0x0004, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108, + 0x1f04, 0x4d05, 0x9085, 0x0001, 0x012e, 0x00de, 0x0005, 0x9006, + 0x0cd8, 0x00d6, 0x0126, 0x2091, 0x8000, 0x60a4, 0x906d, 0x0130, + 0x60a7, 0x0000, 0x080c, 0x0df6, 0x9085, 0x0001, 0x012e, 0x00de, + 0x0005, 0x609c, 0xd0a4, 0x0005, 0x00f6, 0x080c, 0x5745, 0x01b0, + 0x71b4, 0x81ff, 0x1198, 0x71cc, 0xd19c, 0x0180, 0x2001, 0x007e, + 0x9080, 0x1000, 0x2004, 0x907d, 0x0148, 0x7804, 0x9084, 0x00ff, + 0x9086, 0x0006, 0x1118, 0x7800, 0xc0ed, 0x7802, 0x2079, 0x1152, + 0x7804, 0xd0a4, 0x01e8, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x2009, + 0x0000, 0x0016, 0x080c, 0x4b58, 0x1168, 0x6004, 0x9084, 0xff00, + 0x8007, 0x9096, 0x0004, 0x0118, 0x9086, 0x0006, 0x1118, 0x6000, + 0xc0ed, 0x6002, 0x001e, 0x8108, 0x1f04, 0x4d49, 0x00ce, 0x015e, + 0x080c, 0x4de0, 0x0120, 0x2001, 0x12a5, 0x200c, 0x0038, 0x2079, + 0x1152, 0x7804, 0xd0a4, 0x0130, 0x2009, 0x07d0, 0x2011, 0x4d74, + 0x080c, 0x65e1, 0x00fe, 0x0005, 0x2011, 0x4d74, 0x080c, 0x655b, + 0x080c, 0x4de0, 0x01f0, 0x2001, 0x107e, 0x2004, 0x9080, 0x0000, + 0x200c, 0xc1ec, 0x2102, 0x2001, 0x1153, 0x2004, 0xd0a4, 0x0130, + 0x2009, 0x07d0, 0x2011, 0x4d74, 0x080c, 0x65e1, 0x00e6, 0x2071, + 0x1100, 0x706f, 0x0000, 0x7073, 0x0000, 0x080c, 0x23cd, 0x00ee, + 0x04b0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x2009, 0x0000, 0x0016, + 0x080c, 0x4b58, 0x1530, 0x6000, 0xd0ec, 0x0518, 0x0046, 0x62a0, + 0x9294, 0x00ff, 0x8227, 0x9006, 0x2009, 0x0029, 0x080c, 0xaaca, + 0x6000, 0xc0e5, 0xc0ec, 0x6002, 0x6004, 0x9084, 0x00ff, 0x9085, + 0x0700, 0x6006, 0x2019, 0x0029, 0x080c, 0x69ca, 0x0076, 0x2039, + 0x0000, 0x080c, 0x68fe, 0x2009, 0x0000, 0x080c, 0xa85f, 0x007e, + 0x004e, 0x001e, 0x8108, 0x1f04, 0x4d9f, 0x00ce, 0x015e, 0x0005, + 0x00c6, 0x6010, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x00ce, 0x0005, + 0x7810, 0x2004, 0xd0ac, 0x0005, 0x7810, 0x2004, 0xd0bc, 0x0005, + 0x00f6, 0x2001, 0x107e, 0x2004, 0x907d, 0x0110, 0x7800, 0xd0ec, + 0x00fe, 0x0005, 0x0126, 0x0026, 0x2091, 0x8000, 0x6200, 0x9005, + 0x0110, 0xc2fd, 0x0008, 0xc2fc, 0x6202, 0x002e, 0x012e, 0x0005, + 0x2011, 0x1133, 0x2204, 0xd0cc, 0x0138, 0x2001, 0x12a3, 0x200c, + 0x2011, 0x4e05, 0x080c, 0x65e1, 0x0005, 0x2011, 0x4e05, 0x080c, + 0x655b, 0x2011, 0x1133, 0x2204, 0xc0cc, 0x2012, 0x0005, 0x2071, + 0x1228, 0x7003, 0x0001, 0x7007, 0x0000, 0x7013, 0x0000, 0x7017, + 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x700b, 0x0000, 0x7047, + 0x0000, 0x2071, 0x126e, 0x7003, 0x1228, 0x7007, 0x0000, 0x700b, + 0x0000, 0x700f, 0x0001, 0x7013, 0x124e, 0x7017, 0x0020, 0x701b, + 0x0040, 0x703b, 0x0000, 0x2001, 0x124a, 0x2003, 0x0000, 0x0005, + 0x0016, 0x00e6, 0x2071, 0x124b, 0x900e, 0x710a, 0x2001, 0x1153, + 0x2004, 0xd0fc, 0x1148, 0x2001, 0x1153, 0x2004, 0x900e, 0xd09c, + 0x0108, 0x8108, 0x7102, 0x04c0, 0x2001, 0x1172, 0x200c, 0x9184, + 0x000f, 0x0002, 0x4e43, 0x4e43, 0x4e43, 0x4e43, 0x4e43, 0x4e62, + 0x4e43, 0x4e43, 0x4e70, 0x4e43, 0x4e43, 0x4e43, 0x4e43, 0x4e43, + 0x4e43, 0x4e43, 0x7003, 0x0003, 0x2009, 0x1173, 0x210c, 0x9184, + 0xff00, 0x8007, 0x9005, 0x1110, 0x2001, 0x0002, 0x7006, 0x00a0, + 0x7003, 0x0004, 0x0136, 0x0146, 0x0156, 0x20e1, 0x0001, 0x2099, + 0x1176, 0x20e9, 0x0001, 0x20a1, 0x1278, 0x20a9, 0x0004, 0x4003, + 0x015e, 0x014e, 0x013e, 0x0000, 0x00ee, 0x001e, 0x0005, 0x00e6, + 0x2071, 0x0050, 0x684c, 0x9005, 0x1150, 0x00e6, 0x2071, 0x1228, + 0x7028, 0xc085, 0x702a, 0x00ee, 0x9085, 0x0001, 0x04e8, 0x6844, + 0x9005, 0x01a8, 0x2009, 0x0000, 0x0156, 0x20a9, 0x0006, 0x8003, + 0x81f5, 0x3e08, 0x1f04, 0x4e9f, 0x015e, 0x6a60, 0x9200, 0x7002, + 0x6864, 0x9101, 0x7006, 0x7013, 0x0000, 0x7017, 0x0000, 0x6860, + 0x7002, 0x6864, 0x7006, 0x6868, 0x700a, 0x686c, 0x700e, 0x6844, + 0x9005, 0x1120, 0x7013, 0x0000, 0x7017, 0x0000, 0x684c, 0x701a, + 0x701c, 0x9085, 0x0040, 0x701e, 0x7037, 0x0019, 0x702b, 0x0001, + 0x00e6, 0x2071, 0x1228, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, + 0x700b, 0x0000, 0x00ee, 0x9006, 0x00ee, 0x0005, 0x6868, 0xd0fc, + 0x11d0, 0x00e6, 0x0026, 0x2001, 0x124b, 0x2004, 0x9005, 0x0904, + 0x50aa, 0x687c, 0xd0bc, 0x1904, 0x50aa, 0x6978, 0x6874, 0x9105, + 0x1904, 0x50aa, 0x2001, 0x124b, 0x2004, 0x0002, 0x50aa, 0x4f17, + 0x4f4b, 0x4f4b, 0x53ec, 0x0005, 0x6868, 0xd0fc, 0x11f8, 0x00e6, + 0x0026, 0x2009, 0x124b, 0x210c, 0x81ff, 0x0904, 0x50aa, 0x687c, + 0xd0cc, 0x0904, 0x50aa, 0x6880, 0x9084, 0x00ff, 0x9086, 0x0001, + 0x1904, 0x50aa, 0x9186, 0x0003, 0x05f0, 0x9186, 0x0004, 0x0904, + 0x53ec, 0x684f, 0x8021, 0x6853, 0x0017, 0x0028, 0x0005, 0x684f, + 0x8020, 0x6853, 0x0016, 0x2071, 0x1228, 0x701c, 0x9005, 0x1904, + 0x5235, 0x0e04, 0x5278, 0x2071, 0x0000, 0x684c, 0x7082, 0x6850, + 0x7032, 0x686c, 0x7086, 0x7036, 0x6870, 0x708a, 0x2091, 0x4080, + 0x2071, 0x1100, 0x2011, 0x0001, 0x6804, 0x900d, 0x702c, 0x1148, + 0x206a, 0x2d00, 0x702e, 0x70b0, 0x9200, 0x70b2, 0x002e, 0x00ee, + 0x0005, 0x00d6, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, + 0x1dc8, 0x00de, 0x0c68, 0x684f, 0x0000, 0x00f6, 0x2079, 0x0050, + 0x2071, 0x1228, 0x206b, 0x0000, 0x7010, 0x9005, 0x1904, 0x5039, + 0x782c, 0x908c, 0x0780, 0x190c, 0x542a, 0x8004, 0x8004, 0x8004, + 0x9084, 0x0003, 0x0002, 0x4f69, 0x5039, 0x4f8f, 0x4fd2, 0x080c, + 0x0cf1, 0x2071, 0x1100, 0x8d07, 0x8005, 0x8005, 0xc0d5, 0x7822, + 0x6804, 0x900d, 0x1170, 0x2071, 0x12ef, 0x703c, 0x9005, 0x1328, + 0x2001, 0x124c, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, + 0x0005, 0x9016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, + 0x81ff, 0x1dc8, 0x702e, 0x70b0, 0x9200, 0x70b2, 0x0c20, 0x2071, + 0x1100, 0x8d07, 0x8005, 0x8005, 0xc0d5, 0x7822, 0x6804, 0x900d, + 0x1558, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1118, + 0x7022, 0x00ee, 0x0060, 0x00ee, 0xc0d4, 0x8006, 0x8006, 0x806f, + 0x702c, 0x206a, 0x2d00, 0x702e, 0x70b0, 0x8000, 0x70b2, 0x782c, + 0x9094, 0x0780, 0x190c, 0x542a, 0xd0a4, 0x1d18, 0x2071, 0x12ef, + 0x703c, 0x9005, 0x1328, 0x2001, 0x124c, 0x2004, 0x8005, 0x703e, + 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2168, 0x6904, + 0x206a, 0x8210, 0x2d00, 0x81ff, 0x1dc8, 0x702e, 0x70b0, 0x9200, + 0x70b2, 0x0838, 0x00d6, 0x00e6, 0x7824, 0xc0d4, 0x8006, 0x8006, + 0x806f, 0x2071, 0x1100, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70b0, + 0x8000, 0x70b2, 0x782c, 0x9094, 0x0780, 0x190c, 0x542a, 0xd0a4, + 0x1d58, 0x00ee, 0x782c, 0x9094, 0x0780, 0x190c, 0x542a, 0xd09c, + 0x11b8, 0x00de, 0x8d07, 0x8005, 0x8005, 0xc0d5, 0x7822, 0x6804, + 0x900d, 0x1560, 0x2071, 0x12ef, 0x703c, 0x9005, 0x1328, 0x2001, + 0x124c, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, + 0x00de, 0x2d08, 0x7010, 0x8000, 0x7012, 0x7018, 0x906d, 0x711a, + 0x0110, 0x6902, 0x0008, 0x711e, 0x2168, 0x6804, 0x900d, 0x1170, + 0x2071, 0x12ef, 0x703c, 0x9005, 0x1328, 0x2001, 0x124c, 0x2004, + 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1100, + 0x9016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, + 0x1dc8, 0x702e, 0x70b0, 0x9200, 0x70b2, 0x00fe, 0x002e, 0x00ee, + 0x0005, 0x2d08, 0x7010, 0x8000, 0x7012, 0x7018, 0x906d, 0x711a, + 0x0110, 0x6902, 0x0008, 0x711e, 0x2168, 0x6804, 0x900d, 0x1904, + 0x5092, 0x782c, 0x9094, 0x0780, 0x190c, 0x542a, 0xd09c, 0x11b0, + 0x701c, 0x906d, 0x0198, 0x7010, 0x8001, 0x7012, 0x1108, 0x701a, + 0x2d04, 0x701e, 0x8d07, 0x8005, 0x8005, 0xc0d5, 0x7822, 0x782c, + 0x9094, 0x0780, 0x190c, 0x542a, 0xd09c, 0x0d50, 0x782c, 0x9094, + 0x0780, 0x190c, 0x542a, 0xd0a4, 0x01b8, 0x00e6, 0x7824, 0xc0d4, + 0x8006, 0x8006, 0x806f, 0x2071, 0x1100, 0x702c, 0x206a, 0x2d00, + 0x702e, 0x70b0, 0x8000, 0x70b2, 0x782c, 0x9094, 0x0780, 0x190c, + 0x542a, 0xd0a4, 0x1d58, 0x00ee, 0x2071, 0x12ef, 0x703c, 0x9005, + 0x1328, 0x2001, 0x124c, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, + 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1100, 0x9016, 0x702c, 0x2168, + 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x1dc8, 0x702e, 0x70b0, + 0x9200, 0x70b2, 0x00ee, 0x0804, 0x5049, 0x6868, 0xd0fc, 0x1500, + 0x00e6, 0x0026, 0x684f, 0x0000, 0x00f6, 0x2079, 0x0050, 0x2071, + 0x1228, 0x206b, 0x0000, 0x7010, 0x9005, 0x1904, 0x51b5, 0x782c, + 0x908c, 0x0780, 0x190c, 0x542a, 0x8004, 0x8004, 0x8004, 0x9084, + 0x0003, 0x0002, 0x50c9, 0x51b5, 0x50e5, 0x514a, 0x080c, 0x0cf1, + 0x0005, 0x2071, 0x1100, 0x8d07, 0x8005, 0x8005, 0xc0d5, 0x7822, + 0x6804, 0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, + 0x702c, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x1dc8, + 0x702e, 0x70b0, 0x9200, 0x70b2, 0x0c70, 0x2071, 0x1100, 0x8d07, + 0x8005, 0x8005, 0xc0d5, 0x7822, 0x6804, 0x900d, 0x1904, 0x513b, + 0x7830, 0x8007, 0x9084, 0x001f, 0x9082, 0x0005, 0x1220, 0x00fe, + 0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, + 0xd19c, 0x1118, 0x7022, 0x00ee, 0x0060, 0x00ee, 0xc0d4, 0x8006, + 0x8006, 0x806f, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70b0, 0x8000, + 0x70b2, 0x782c, 0x9094, 0x0780, 0x190c, 0x542a, 0xd0a4, 0x1d18, + 0x0e04, 0x5132, 0x7838, 0x7938, 0x910e, 0x1de0, 0x2069, 0x0000, + 0x6836, 0x6833, 0x0013, 0x2001, 0x1239, 0x200c, 0xc184, 0x2102, + 0x2091, 0x4080, 0x2009, 0x124a, 0x200b, 0x0000, 0x00fe, 0x002e, + 0x00ee, 0x0005, 0x2001, 0x1239, 0x200c, 0xc185, 0x2102, 0x00fe, + 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2168, 0x6904, 0x206a, + 0x8210, 0x2d00, 0x81ff, 0x1dc8, 0x702e, 0x70b0, 0x9200, 0x70b2, + 0x0804, 0x50fb, 0x00d6, 0x00e6, 0x7824, 0xc0d4, 0x8006, 0x8006, + 0x806f, 0x2071, 0x1100, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70b0, + 0x8000, 0x70b2, 0x782c, 0x9094, 0x0780, 0x190c, 0x542a, 0xd0a4, + 0x1d58, 0x00ee, 0x0e04, 0x518a, 0x7838, 0x7938, 0x910e, 0x1de0, + 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x7044, 0xc084, 0x7046, + 0x2091, 0x4080, 0x2009, 0x124a, 0x200b, 0x0000, 0x782c, 0x9094, + 0x0780, 0x190c, 0x542a, 0xd09c, 0x1188, 0x00de, 0x8d07, 0x8005, + 0x8005, 0xc0d5, 0x7822, 0x6804, 0x900d, 0x11e0, 0x00fe, 0x002e, + 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x0c40, 0x00de, 0x2d08, + 0x7010, 0x8000, 0x7012, 0x7018, 0x906d, 0x711a, 0x0110, 0x6902, + 0x0008, 0x711e, 0x2168, 0x6804, 0x900d, 0x1120, 0x00fe, 0x002e, + 0x00ee, 0x0005, 0x2071, 0x1100, 0x9016, 0x702c, 0x2168, 0x6904, + 0x206a, 0x8210, 0x2d00, 0x81ff, 0x1dc8, 0x702e, 0x70b0, 0x9200, + 0x70b2, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2d08, 0x7010, 0x8000, + 0x7012, 0x7018, 0x906d, 0x711a, 0x0110, 0x6902, 0x0008, 0x711e, + 0x2168, 0x6804, 0x900d, 0x1904, 0x5222, 0x782c, 0x9094, 0x0780, + 0x190c, 0x542a, 0xd09c, 0x11c8, 0x701c, 0x906d, 0x01b0, 0x684c, + 0x9005, 0x1198, 0x7010, 0x8001, 0x7012, 0x1108, 0x701a, 0x2d04, + 0x701e, 0x8d07, 0x8005, 0x8005, 0xc0d5, 0x7822, 0x782c, 0x9094, + 0x0780, 0x190c, 0x542a, 0xd09c, 0x0d38, 0x782c, 0x9094, 0x0780, + 0x190c, 0x542a, 0xd0a4, 0x0590, 0x00e6, 0x7824, 0xc0d4, 0x8006, + 0x8006, 0x806f, 0x2071, 0x1100, 0x702c, 0x206a, 0x2d00, 0x702e, + 0x70b0, 0x8000, 0x70b2, 0x782c, 0x9094, 0x0780, 0x190c, 0x542a, + 0xd0a4, 0x1d58, 0x00ee, 0x0e04, 0x521b, 0x7838, 0x7938, 0x910e, + 0x1de0, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x7044, 0xc084, + 0x7046, 0x2091, 0x4080, 0x2009, 0x124a, 0x200b, 0x0000, 0x00fe, + 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x00fe, 0x002e, + 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1100, 0x9016, 0x702c, 0x2168, + 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x1dc8, 0x702e, 0x70b0, + 0x9200, 0x70b2, 0x00ee, 0x0804, 0x51c5, 0x2071, 0x1228, 0x206b, + 0x0000, 0x2d08, 0x7010, 0x8000, 0x7012, 0x7018, 0x906d, 0x711a, + 0x0110, 0x6902, 0x0008, 0x711e, 0x2168, 0x6804, 0x900d, 0x1128, + 0x1e04, 0x525e, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1100, 0x9016, + 0x702c, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x1dc8, + 0x702e, 0x70b0, 0x9200, 0x70b2, 0x0e04, 0x524a, 0x2071, 0x1228, + 0x701c, 0x2068, 0x684c, 0x900d, 0x0d28, 0x2071, 0x0000, 0x7182, + 0x6850, 0x7032, 0x686c, 0x7086, 0x7036, 0x6870, 0x708a, 0x2091, + 0x4080, 0x2071, 0x1228, 0x080c, 0x5416, 0x002e, 0x00ee, 0x0005, + 0x2071, 0x1228, 0x206b, 0x0000, 0x2d08, 0x7010, 0x8000, 0x7012, + 0x7018, 0x906d, 0x711a, 0x0110, 0x6902, 0x0008, 0x711e, 0x2168, + 0x6804, 0x900d, 0x1118, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1100, + 0x9016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, + 0x1dc8, 0x702e, 0x70b0, 0x9200, 0x70b2, 0x002e, 0x00ee, 0x0005, + 0x0006, 0x687c, 0x0006, 0x6867, 0x0103, 0x20a9, 0x001c, 0x9d80, + 0x001d, 0x20a0, 0x9006, 0x20e9, 0x0001, 0x4004, 0x000e, 0x9084, + 0x00ff, 0x687e, 0x000e, 0x687a, 0x6982, 0x0005, 0x2071, 0x1228, + 0x7004, 0x0002, 0x52c0, 0x52c1, 0x53ea, 0x53d8, 0x0cf1, 0x53eb, + 0x0005, 0x2001, 0x124b, 0x2004, 0x0002, 0x52ca, 0x52ca, 0x531c, + 0x531d, 0x5373, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x542f, 0x701c, + 0x906d, 0x01b0, 0x684c, 0x9005, 0x01a8, 0x0e04, 0x52e8, 0x694c, + 0x2071, 0x0000, 0x7182, 0x6850, 0x7032, 0x686c, 0x7086, 0x7036, + 0x6870, 0x708a, 0x2091, 0x4080, 0x2071, 0x1228, 0x080c, 0x5416, + 0x012e, 0x0488, 0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x190c, + 0x542a, 0xd09c, 0x2071, 0x1228, 0x1528, 0x2071, 0x1228, 0x700f, + 0x0001, 0x6964, 0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, + 0x918c, 0x00ff, 0x8101, 0x0108, 0x710e, 0x8d07, 0x8005, 0x8005, + 0xc0d5, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de, 0x2071, 0x1228, + 0x701c, 0x2068, 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0x9005, + 0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x2069, 0x12ef, 0x683c, + 0x9005, 0x03d8, 0x11d0, 0x0126, 0x2091, 0x8000, 0x2069, 0x0050, + 0x693c, 0x6838, 0x9106, 0x0160, 0x0e04, 0x533c, 0x2069, 0x0000, + 0x6837, 0x8040, 0x6833, 0x0012, 0x6883, 0x8040, 0x2091, 0x4080, + 0x2069, 0x12ef, 0x683f, 0xffff, 0x012e, 0x0126, 0x2091, 0x8000, + 0x1e0c, 0x548e, 0x701c, 0x906d, 0x0560, 0x2001, 0x005b, 0x2004, + 0x9094, 0x0780, 0x190c, 0x542a, 0xd09c, 0x1518, 0x2071, 0x1228, + 0x700f, 0x0001, 0x6964, 0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, + 0x810f, 0x918c, 0x00ff, 0x8101, 0x0108, 0x710e, 0x8d07, 0x8005, + 0x8005, 0xc0d5, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de, 0x701c, + 0x2068, 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0x9005, 0x1108, + 0x701a, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x542f, + 0x701c, 0x906d, 0x0548, 0x684c, 0x9086, 0x0004, 0x1538, 0x0136, + 0x0146, 0x0156, 0x2099, 0x1176, 0x20e1, 0x0001, 0x20a1, 0x1278, + 0x20e9, 0x0001, 0x20a9, 0x0004, 0x4003, 0x015e, 0x014e, 0x013e, + 0x2071, 0x126e, 0x9d80, 0x001b, 0x700f, 0x0001, 0x7012, 0x7017, + 0x0002, 0x7007, 0x0002, 0x700b, 0x0000, 0x2e10, 0x080c, 0x0e55, + 0x2071, 0x1228, 0x7007, 0x0003, 0x012e, 0x0005, 0x2001, 0x005b, + 0x2004, 0x9094, 0x0780, 0x190c, 0x542a, 0xd09c, 0x2071, 0x1228, + 0x1d98, 0x2071, 0x1228, 0x700f, 0x0001, 0x6964, 0x9184, 0x00ff, + 0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101, 0x0108, + 0x710e, 0x8d07, 0x8005, 0x8005, 0xc0d5, 0x00d6, 0x2069, 0x0050, + 0x6822, 0x00de, 0x2071, 0x1228, 0x701c, 0x2068, 0x7010, 0x8001, + 0x7012, 0x2d04, 0x701e, 0x9005, 0x1978, 0x701a, 0x012e, 0x0005, + 0x2001, 0x1270, 0x2004, 0x908e, 0x0100, 0x1120, 0x7007, 0x0001, + 0x04a9, 0x0005, 0x908e, 0x0000, 0x0de0, 0x908e, 0x0200, 0x1dc8, + 0x080c, 0x542a, 0x0005, 0x0005, 0x684f, 0x0004, 0x206b, 0x0000, + 0x2d08, 0x2071, 0x1228, 0x7010, 0x8000, 0x7012, 0x7018, 0x906d, + 0x711a, 0x0110, 0x6902, 0x0008, 0x711e, 0x2168, 0x6804, 0x900d, + 0x1118, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1100, 0x9016, 0x702c, + 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x1dc8, 0x702e, + 0x70b0, 0x9200, 0x70b2, 0x002e, 0x00ee, 0x0005, 0x0126, 0x2091, + 0x8000, 0x701c, 0x906d, 0x0160, 0x7010, 0x8001, 0x7012, 0x2d04, + 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x080c, 0x0df6, 0x0005, + 0x012e, 0x0005, 0x2011, 0x8004, 0x080c, 0x37dc, 0x0cf8, 0x00f6, + 0x2079, 0x0050, 0x7044, 0xd084, 0x0198, 0xc084, 0x7046, 0x7838, + 0x7938, 0x910e, 0x1de0, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, + 0x2091, 0x4080, 0x2009, 0x124a, 0x200b, 0x0000, 0x00fe, 0x0005, + 0x782c, 0x9094, 0x0780, 0x19f1, 0xd0a4, 0x0dc0, 0x2001, 0x124b, + 0x2004, 0x9086, 0x0004, 0x0140, 0x2009, 0x124a, 0x2104, 0x8000, + 0x200a, 0x9082, 0x000f, 0x0e50, 0x00e6, 0x2071, 0x1100, 0x7824, + 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1118, 0x7022, 0x00ee, + 0x0060, 0x00ee, 0xc0d4, 0x8006, 0x8006, 0x806f, 0x702c, 0x206a, + 0x2d00, 0x702e, 0x70b0, 0x8000, 0x70b2, 0x782c, 0x9094, 0x0780, + 0x190c, 0x542a, 0xd0a4, 0x1d18, 0x7838, 0x7938, 0x910e, 0x1de0, + 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x2091, 0x4080, 0x2009, + 0x124a, 0x200b, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, + 0x0050, 0x7044, 0xd084, 0x0178, 0xc084, 0x7046, 0x7838, 0x7938, + 0x910e, 0x1de0, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x2091, + 0x4080, 0x00fe, 0x0005, 0x782c, 0x9094, 0x0780, 0x190c, 0x542a, + 0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1100, 0x7824, 0xc0d4, 0x8006, + 0x8006, 0x806f, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70b0, 0x8000, + 0x70b2, 0x782c, 0x9094, 0x0780, 0x190c, 0x542a, 0xd0a4, 0x1d68, + 0x2069, 0x0050, 0x693c, 0x2069, 0x124b, 0x6808, 0x690a, 0x2069, + 0x12ef, 0x9102, 0x1118, 0x683c, 0x9005, 0x1328, 0x2001, 0x124c, + 0x200c, 0x810d, 0x693e, 0x00ee, 0x00fe, 0x0005, 0x7088, 0x908a, + 0x0029, 0x1220, 0x9082, 0x001d, 0x0033, 0x0010, 0x080c, 0x0cf1, + 0x6027, 0x1e00, 0x0005, 0x55a7, 0x5541, 0x5557, 0x557b, 0x559a, + 0x55cc, 0x55de, 0x5557, 0x55b8, 0x54f0, 0x552a, 0x54ef, 0x0005, + 0x00d6, 0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005, + 0x1578, 0x708b, 0x0028, 0x2069, 0x12af, 0x2d04, 0x7002, 0x080c, + 0x5857, 0x6028, 0x9085, 0x0600, 0x602a, 0x0410, 0x708b, 0x0028, + 0x2069, 0x12af, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a, + 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x131c, 0x080c, 0x1337, + 0x005e, 0x004e, 0x003e, 0x00ee, 0x0126, 0x2091, 0x2200, 0x080c, + 0x0fb3, 0x78ab, 0x0004, 0x7803, 0x0000, 0x7803, 0x0001, 0x012e, + 0x00de, 0x0005, 0x00d6, 0x2069, 0x0200, 0x6804, 0x9005, 0x1178, + 0x6808, 0x9005, 0x1160, 0x708b, 0x0028, 0x2069, 0x12af, 0x2d04, + 0x7002, 0x080c, 0x58e5, 0x6028, 0x9085, 0x0600, 0x602a, 0x00de, + 0x0005, 0x6803, 0x0090, 0x6124, 0xd1e4, 0x1180, 0x080c, 0x5649, + 0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1cc, 0x0140, 0x708b, 0x0020, + 0x0028, 0x708b, 0x001d, 0x0010, 0x708b, 0x001f, 0x0005, 0x6803, + 0x0088, 0x6124, 0xd1cc, 0x11c8, 0xd1dc, 0x11a0, 0xd1e4, 0x1178, + 0x9184, 0x1e00, 0x11b8, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, + 0x080c, 0x5775, 0x6803, 0x0080, 0x708b, 0x0028, 0x0058, 0x708b, + 0x001e, 0x0040, 0x708b, 0x001d, 0x0028, 0x708b, 0x0020, 0x0010, + 0x708b, 0x001f, 0x0005, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, + 0x080c, 0x5775, 0x6803, 0x0080, 0x6124, 0xd1d4, 0x1180, 0xd1dc, + 0x1158, 0xd1e4, 0x1130, 0x9184, 0x1e00, 0x1158, 0x708b, 0x0028, + 0x0040, 0x708b, 0x001e, 0x0028, 0x708b, 0x001d, 0x0010, 0x708b, + 0x001f, 0x0005, 0x6803, 0x00a0, 0x6124, 0xd1dc, 0x1128, 0xd1e4, + 0x0128, 0x708b, 0x001e, 0x0010, 0x708b, 0x001d, 0x0005, 0x080c, + 0x5675, 0x6124, 0xd1dc, 0x1158, 0x080c, 0x5649, 0xd1d4, 0x1128, + 0xd1e4, 0x0128, 0x708b, 0x001e, 0x0010, 0x708b, 0x001f, 0x0005, + 0x6803, 0x00a0, 0x6124, 0xd1d4, 0x1160, 0xd1cc, 0x1150, 0xd1dc, + 0x1128, 0xd1e4, 0x0140, 0x708b, 0x001e, 0x0028, 0x708b, 0x001d, + 0x0010, 0x708b, 0x0021, 0x0005, 0x080c, 0x5675, 0x6124, 0xd1d4, + 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x708b, 0x001e, 0x0028, + 0x708b, 0x001d, 0x0010, 0x708b, 0x001f, 0x0005, 0x6803, 0x0090, + 0x6124, 0xd1d4, 0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, + 0x0158, 0x708b, 0x001e, 0x0040, 0x708b, 0x001d, 0x0028, 0x708b, + 0x0020, 0x0010, 0x708b, 0x001f, 0x0005, 0x0016, 0x00c6, 0x00d6, + 0x00e6, 0x0126, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1100, + 0x2091, 0x8000, 0x080c, 0x5745, 0x11e8, 0x2001, 0x110c, 0x200c, + 0xd1b4, 0x01c0, 0xc1b4, 0x2102, 0x6027, 0x0200, 0x080c, 0x2055, + 0x6024, 0xd0cc, 0x0158, 0x6803, 0x00a0, 0x2001, 0x1290, 0x2003, + 0x0001, 0x2001, 0x1100, 0x2003, 0x0001, 0x0428, 0x6028, 0xc0cd, + 0x602a, 0x0408, 0x080c, 0x5761, 0x0150, 0x080c, 0x5757, 0x1138, + 0x2001, 0x0001, 0x080c, 0x1c36, 0x080c, 0x571c, 0x00a0, 0x080c, + 0x5672, 0x0178, 0x2001, 0x0001, 0x080c, 0x1c36, 0x7088, 0x9086, + 0x001e, 0x0120, 0x7088, 0x9086, 0x0022, 0x1118, 0x708b, 0x0025, + 0x0010, 0x708b, 0x0021, 0x012e, 0x00ee, 0x00de, 0x00ce, 0x001e, + 0x0005, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011, 0x5654, 0x080c, + 0x654f, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6, 0x0016, 0x080c, + 0x7721, 0x2071, 0x1100, 0x080c, 0x55f5, 0x001e, 0x00fe, 0x00ee, + 0x0005, 0x0026, 0x00e6, 0x2011, 0x5654, 0x2071, 0x12ef, 0x701c, + 0x9206, 0x1118, 0x7018, 0x9005, 0x0110, 0x9085, 0x0001, 0x00ee, + 0x002e, 0x0005, 0x6020, 0xd09c, 0x0005, 0x6803, 0x00c0, 0x0156, + 0x20a9, 0x002d, 0x1d04, 0x567a, 0x2091, 0x6000, 0x1f04, 0x567a, + 0x015e, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, + 0x0140, 0x2071, 0x1100, 0x2001, 0x1290, 0x200c, 0x9186, 0x0000, + 0x0158, 0x9186, 0x0001, 0x0158, 0x9186, 0x0002, 0x0158, 0x9186, + 0x0003, 0x0158, 0x0804, 0x570a, 0x708b, 0x0022, 0x0040, 0x708b, + 0x0021, 0x0028, 0x708b, 0x0023, 0x0030, 0x708b, 0x0024, 0x9085, + 0x0001, 0x080c, 0x5789, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, + 0x0001, 0x080c, 0x1cbe, 0x0026, 0x2011, 0x0003, 0x080c, 0x79c2, + 0x2011, 0x0002, 0x080c, 0x79cc, 0x080c, 0x78b3, 0x080c, 0x65cf, + 0x0036, 0x2019, 0x0000, 0x080c, 0x7936, 0x003e, 0x002e, 0x7000, + 0x908e, 0x0004, 0x0118, 0x602b, 0x0028, 0x0010, 0x602b, 0x0020, + 0x0156, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x6024, 0xd0ac, + 0x0118, 0x012e, 0x015e, 0x04e0, 0x6800, 0x9084, 0x00a0, 0xc0bd, + 0x6802, 0x080c, 0x2055, 0x6904, 0xd1d4, 0x1130, 0x6803, 0x0100, + 0x1f04, 0x56d6, 0x080c, 0x5796, 0x012e, 0x015e, 0x080c, 0x5757, + 0x01a8, 0x6044, 0x9005, 0x0168, 0x6050, 0x0006, 0x9085, 0x0020, + 0x6052, 0x080c, 0x5796, 0x9006, 0x8001, 0x1df0, 0x000e, 0x6052, + 0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x5796, 0x2001, 0x1290, + 0x2003, 0x0004, 0x080c, 0x54d6, 0x080c, 0x5757, 0x0148, 0x6804, + 0xd0d4, 0x1130, 0xd0dc, 0x1100, 0x2001, 0x1290, 0x2003, 0x0000, + 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, + 0x0100, 0x2069, 0x0140, 0x2071, 0x1100, 0x2001, 0x128f, 0x2003, + 0x0000, 0x2001, 0x1280, 0x2003, 0x0000, 0x708b, 0x0000, 0x60e3, + 0x0000, 0x6887, 0x0000, 0x2001, 0x0000, 0x080c, 0x1cbe, 0x6803, + 0x0000, 0x6043, 0x0090, 0x6043, 0x0010, 0x6027, 0xffff, 0x602b, + 0x182f, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006, 0x2001, 0x128f, + 0x2004, 0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006, 0x2001, 0x1172, + 0x2004, 0x9084, 0x0030, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006, + 0x2001, 0x1172, 0x2004, 0x9084, 0x0030, 0x9086, 0x0030, 0x000e, + 0x0005, 0x0006, 0x2001, 0x1172, 0x2004, 0x9084, 0x0030, 0x9086, + 0x0010, 0x000e, 0x0005, 0x0006, 0x2001, 0x1172, 0x2004, 0x9084, + 0x0030, 0x9086, 0x0020, 0x000e, 0x0005, 0x2001, 0x110c, 0x2004, + 0xd0a4, 0x0170, 0x080c, 0x1cde, 0x0036, 0x0016, 0x2009, 0x0000, + 0x2019, 0x0028, 0x080c, 0x2582, 0x001e, 0x003e, 0x9006, 0x0009, + 0x0005, 0x00e6, 0x2071, 0x110c, 0x2e04, 0x0118, 0x9085, 0x0010, + 0x0010, 0x9084, 0xffef, 0x2072, 0x00ee, 0x0005, 0x6050, 0x0006, + 0x60ec, 0x0006, 0x600c, 0x0006, 0x6004, 0x0006, 0x6028, 0x0006, + 0x0016, 0x6138, 0x6050, 0x9084, 0xfbff, 0x9085, 0x2000, 0x6052, + 0x613a, 0x20a9, 0x0012, 0x1d04, 0x57ab, 0x2091, 0x6000, 0x1f04, + 0x57ab, 0x602f, 0x0100, 0x602f, 0x0000, 0x6050, 0x9085, 0x0400, + 0x9084, 0xdfff, 0x6052, 0x613a, 0x001e, 0x602f, 0x0040, 0x602f, + 0x0000, 0x000e, 0x602a, 0x000e, 0x6006, 0x000e, 0x600e, 0x000e, + 0x60ee, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c, + 0x1cbe, 0x6803, 0x00a0, 0x000e, 0x6052, 0x0005, 0x0156, 0x0016, + 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, + 0x0140, 0x2071, 0x1100, 0x6020, 0x9084, 0x0080, 0x0138, 0x2001, + 0x110c, 0x200c, 0xc1c5, 0x2102, 0x0804, 0x584f, 0x2001, 0x110c, + 0x200c, 0xc1c4, 0x2102, 0x6028, 0x9084, 0xe1ff, 0x602a, 0x6027, + 0x0200, 0x6803, 0x0090, 0x20a9, 0x0366, 0x6024, 0xd0cc, 0x1518, + 0x1d04, 0x57fd, 0x2091, 0x6000, 0x1f04, 0x57fd, 0x2011, 0x0003, + 0x080c, 0x79c2, 0x2011, 0x0002, 0x080c, 0x79cc, 0x080c, 0x78b3, + 0x080c, 0x65cf, 0x2019, 0x0000, 0x080c, 0x7936, 0x6803, 0x00a0, + 0x2001, 0x1290, 0x2003, 0x0001, 0x2001, 0x1100, 0x2003, 0x0001, + 0x9085, 0x0001, 0x0460, 0x86ff, 0x1110, 0x080c, 0x1359, 0x60e3, + 0x0000, 0x2001, 0x1280, 0x2004, 0x080c, 0x1cbe, 0x60e2, 0x6803, + 0x0080, 0x20a9, 0x0366, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, + 0x2055, 0x6024, 0x910c, 0x0138, 0x1d04, 0x5833, 0x2091, 0x6000, + 0x1f04, 0x5833, 0x0818, 0x6028, 0x9085, 0x1e00, 0x602a, 0x70a0, + 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x9006, 0x00ee, + 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, + 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, + 0x2071, 0x1100, 0x2069, 0x0140, 0x6020, 0x9084, 0x00c0, 0x0120, + 0x6884, 0x9005, 0x1904, 0x58ac, 0x6803, 0x0088, 0x60e3, 0x0000, + 0x6887, 0x0000, 0x2001, 0x0000, 0x080c, 0x1cbe, 0x2069, 0x0200, + 0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x01c0, 0x6028, 0x9084, + 0xfbff, 0x602a, 0x6027, 0x0400, 0x2069, 0x12af, 0x7000, 0x206a, + 0x708b, 0x0026, 0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04, 0x588e, + 0x2091, 0x6000, 0x1f04, 0x588e, 0x0804, 0x58dd, 0x2069, 0x0140, + 0x20a9, 0x0384, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x2055, + 0x6024, 0x910c, 0x0530, 0x9084, 0x1a00, 0x1518, 0x1d04, 0x589a, + 0x2091, 0x6000, 0x1f04, 0x589a, 0x2011, 0x0003, 0x080c, 0x79c2, + 0x2011, 0x0002, 0x080c, 0x79cc, 0x080c, 0x78b3, 0x080c, 0x65cf, + 0x2019, 0x0000, 0x080c, 0x7936, 0x6803, 0x00a0, 0x2001, 0x1290, + 0x2003, 0x0001, 0x2001, 0x1100, 0x2003, 0x0001, 0x9085, 0x0001, + 0x00a0, 0x6803, 0x0080, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70a0, + 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0x1280, + 0x2004, 0x080c, 0x1cbe, 0x60e2, 0x9006, 0x00ee, 0x00de, 0x00ce, + 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, + 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1100, + 0x6020, 0x9084, 0x00c0, 0x01f0, 0x2011, 0x0003, 0x080c, 0x79c2, + 0x2011, 0x0002, 0x080c, 0x79cc, 0x080c, 0x78b3, 0x080c, 0x65cf, + 0x2019, 0x0000, 0x080c, 0x7936, 0x2069, 0x0140, 0x6803, 0x00a0, + 0x2001, 0x1290, 0x2003, 0x0001, 0x2001, 0x1100, 0x2003, 0x0001, + 0x0804, 0x5976, 0x2001, 0x110c, 0x200c, 0xd1b4, 0x1150, 0xc1b5, + 0x2102, 0x080c, 0x5649, 0x2069, 0x0140, 0x6803, 0x0080, 0x60e3, + 0x0000, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118, 0x6808, 0x9005, + 0x0178, 0x6028, 0x9084, 0xfdff, 0x602a, 0x6027, 0x0200, 0x2069, + 0x12af, 0x7000, 0x206a, 0x708b, 0x0027, 0x7003, 0x0001, 0x04f0, + 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x2055, 0x6024, 0x910c, + 0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04, 0x5938, 0x0006, 0x0016, + 0x00c6, 0x00d6, 0x00e6, 0x080c, 0x64e0, 0x00ee, 0x00de, 0x00ce, + 0x001e, 0x000e, 0x00e6, 0x2071, 0x12ef, 0x7018, 0x00ee, 0x9005, + 0x19f8, 0x01e0, 0x0026, 0x2011, 0x5654, 0x080c, 0x655b, 0x002e, + 0x2069, 0x0140, 0x60e3, 0x0000, 0x70a0, 0x9005, 0x1118, 0x6887, + 0x0001, 0x0008, 0x6886, 0x2001, 0x1280, 0x2004, 0x080c, 0x1cbe, + 0x60e2, 0x2001, 0x110c, 0x200c, 0xc1b4, 0x2102, 0x00ee, 0x00de, + 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, + 0x0026, 0x0036, 0x0046, 0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, + 0x1100, 0x7130, 0xd184, 0x1180, 0x2011, 0x1153, 0x2214, 0xd2ec, + 0x0138, 0xc18d, 0x7132, 0x2011, 0x1153, 0x2214, 0xd2ac, 0x1120, + 0x7030, 0xd08c, 0x0904, 0x59e3, 0x7130, 0xc185, 0x7132, 0x2011, + 0x1153, 0x220c, 0xd1a4, 0x0530, 0x0016, 0x2009, 0x0001, 0x2011, + 0x0100, 0x080c, 0x66d5, 0x2019, 0x000e, 0x080c, 0xaa50, 0x0156, + 0x20a9, 0x007f, 0x2009, 0x0000, 0x9186, 0x007e, 0x0170, 0x9186, + 0x0080, 0x0158, 0x080c, 0x4b58, 0x1140, 0x8127, 0x9006, 0x0016, + 0x2009, 0x000e, 0x080c, 0xaaca, 0x001e, 0x8108, 0x1f04, 0x59b4, + 0x015e, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0000, 0x2019, + 0x0004, 0x080c, 0x2582, 0x001e, 0x0070, 0x0156, 0x20a9, 0x007f, + 0x2009, 0x0000, 0x080c, 0x4b58, 0x1110, 0x080c, 0x472d, 0x8108, + 0x1f04, 0x59da, 0x015e, 0x2011, 0x0003, 0x080c, 0x79c2, 0x2011, + 0x0002, 0x080c, 0x79cc, 0x080c, 0x78b3, 0x080c, 0x65cf, 0x0036, + 0x2019, 0x0000, 0x080c, 0x7936, 0x003e, 0x60e3, 0x0000, 0x2001, + 0x1100, 0x2003, 0x0001, 0x080c, 0x5682, 0x00ee, 0x00ce, 0x004e, + 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x2071, 0x11f4, 0x7003, + 0x0000, 0x7007, 0x0000, 0x708f, 0x0000, 0x7093, 0x0001, 0x70c7, + 0x0000, 0x0005, 0x00e6, 0x2071, 0x0040, 0x6848, 0x9005, 0x1120, + 0x9085, 0x0001, 0x0804, 0x5a5e, 0x6840, 0x9005, 0x01a0, 0x900e, + 0x0156, 0x20a9, 0x0006, 0x8003, 0x81f5, 0x3e08, 0x1f04, 0x5a23, + 0x015e, 0x6a50, 0x9200, 0x7002, 0x6854, 0x9101, 0x7006, 0x7013, + 0x0000, 0x7017, 0x0000, 0x6850, 0x7002, 0x6854, 0x7006, 0x6858, + 0x700a, 0x685c, 0x700e, 0x6840, 0x9005, 0x1120, 0x7013, 0x0000, + 0x7017, 0x0000, 0x6848, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e, + 0x2001, 0x0019, 0x7036, 0x702b, 0x0001, 0x2001, 0x0004, 0x200c, + 0x918c, 0xfff7, 0x918d, 0x8000, 0x2102, 0x00d6, 0x2069, 0x11f4, + 0x6807, 0x0001, 0x00de, 0x080c, 0x5f52, 0x9006, 0x00ee, 0x0005, + 0x2079, 0x0040, 0x2071, 0x11f4, 0x7004, 0x0002, 0x5a70, 0x5a71, + 0x5aa2, 0x5afd, 0x5bfe, 0x5a6e, 0x5a6e, 0x5c27, 0x080c, 0x0cf1, + 0x0005, 0x2079, 0x0040, 0x782c, 0x908c, 0x0780, 0x1530, 0xd0a4, + 0x01b0, 0x7824, 0xc0d4, 0x8006, 0x8006, 0x806f, 0x6803, 0x0000, + 0x6807, 0x0000, 0x6864, 0x9084, 0x00ff, 0x908a, 0x0040, 0x1260, + 0x04a3, 0x7004, 0x9086, 0x0003, 0x1d30, 0x080c, 0x5afd, 0x782c, + 0xd09c, 0x090c, 0x5f52, 0x0005, 0x9082, 0x005a, 0x1218, 0x2100, + 0x0053, 0x0c78, 0x080c, 0x5b37, 0x0c90, 0x2011, 0x8003, 0x080c, + 0x37dc, 0x0cf8, 0x0005, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, + 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, + 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, + 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b57, + 0x5b37, 0x5cdc, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b57, + 0x5d1e, 0x5d61, 0x5daa, 0x5dbe, 0x5b37, 0x5b37, 0x5b73, 0x5b57, + 0x5b37, 0x5b37, 0x5bd7, 0x5e67, 0x5e82, 0x5b37, 0x5b73, 0x5b37, + 0x5b37, 0x5b37, 0x5b37, 0x5bcd, 0x5e82, 0x5b37, 0x5b37, 0x5b37, + 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b87, 0x5b37, + 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, + 0x5f8e, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b9c, 0x5b37, + 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x5b37, 0x2079, 0x0040, 0x7004, + 0x9086, 0x0003, 0x11b8, 0x782c, 0x080c, 0x5f83, 0xd0a4, 0x0190, + 0x7824, 0xc0d4, 0x8006, 0x8006, 0x806f, 0x6803, 0x0000, 0x6807, + 0x0000, 0x6864, 0x9084, 0x00ff, 0x908a, 0x001a, 0x1210, 0x002b, + 0x0c30, 0x00e9, 0x080c, 0x5f52, 0x0005, 0x5b37, 0x5b57, 0x5cc8, + 0x5b37, 0x5b57, 0x5b37, 0x5b57, 0x5b57, 0x5b37, 0x5b57, 0x5cc8, + 0x5b57, 0x5b57, 0x5b57, 0x5b57, 0x5b57, 0x5b37, 0x5b57, 0x5cc8, + 0x5b37, 0x5b37, 0x5b57, 0x5b37, 0x5b37, 0x5b37, 0x5b57, 0x00e6, + 0x2071, 0x11f4, 0x7007, 0x0001, 0x6868, 0x9084, 0x00ff, 0xc0d5, + 0x686a, 0x0126, 0x2091, 0x8000, 0x080c, 0x50a5, 0x012e, 0x00ee, + 0x0005, 0x7007, 0x0001, 0x6868, 0x9084, 0x00ff, 0xc0e5, 0x686a, + 0x0126, 0x2091, 0x8000, 0x080c, 0x50a5, 0x012e, 0x0005, 0x7007, + 0x0001, 0x6868, 0x9084, 0x00ff, 0xc0ed, 0x686a, 0x0126, 0x2091, + 0x8000, 0x080c, 0x50a5, 0x012e, 0x0005, 0x7007, 0x0001, 0x6868, + 0x9084, 0x00ff, 0xc0dd, 0x686a, 0x0126, 0x2091, 0x8000, 0x080c, + 0x50a5, 0x012e, 0x0005, 0x6864, 0x8007, 0x9084, 0x00ff, 0x0988, + 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x5c90, 0x7007, 0x0003, + 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x5c90, 0x0005, 0x6864, + 0x8007, 0x9084, 0x00ff, 0x0904, 0x5b49, 0x8001, 0x1120, 0x7007, + 0x0001, 0x0804, 0x5ca9, 0x7007, 0x0003, 0x7012, 0x2d00, 0x7016, + 0x701a, 0x704b, 0x5ca9, 0x0005, 0x6864, 0x8007, 0x9084, 0x00ff, + 0x9086, 0x0001, 0x1904, 0x5b49, 0x7007, 0x0001, 0x2009, 0x1130, + 0x210c, 0x81ff, 0x11a8, 0x6868, 0x9084, 0x00ff, 0x686a, 0x6883, + 0x0000, 0x080c, 0x4873, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000, + 0x6867, 0x0139, 0x687a, 0x6982, 0x080c, 0x50a5, 0x012e, 0x0ca0, + 0x6994, 0x9186, 0x0071, 0x0d38, 0x6897, 0x4005, 0x689b, 0x0001, + 0x2001, 0x0030, 0x2009, 0x0000, 0x0c40, 0x687c, 0x9084, 0x00c0, + 0x9086, 0x00c0, 0x1120, 0x7007, 0x0001, 0x0804, 0x5e99, 0x2d00, + 0x7016, 0x701a, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x20e9, 0x0001, + 0x9080, 0x0030, 0x2098, 0x20a1, 0x1221, 0x4003, 0x6888, 0x7012, + 0x9082, 0x0401, 0x1a04, 0x5b65, 0x6ab4, 0x928a, 0x0002, 0x1a04, + 0x5b65, 0x82ff, 0x1138, 0x68b8, 0x69bc, 0x9105, 0x0118, 0x2001, + 0x5c63, 0x0018, 0x9280, 0x5c59, 0x2005, 0x70ce, 0x7010, 0x9015, + 0x0904, 0x5c45, 0x080c, 0x0dc6, 0x1118, 0x7007, 0x0004, 0x0005, + 0x2d00, 0x7022, 0x70cc, 0x2060, 0xe000, 0x6866, 0xe004, 0x9d00, + 0x709e, 0x709b, 0x0001, 0xe008, 0x920a, 0x1210, 0x900e, 0x2200, + 0x7112, 0xe20c, 0x8003, 0x800b, 0x9296, 0x0004, 0x0108, 0x9108, + 0x71a2, 0x810b, 0x71a6, 0x9e90, 0x0023, 0x080c, 0x0e55, 0x7094, + 0x908e, 0x0100, 0x0170, 0x9086, 0x0200, 0x0118, 0x7007, 0x0007, + 0x0005, 0x7020, 0x2068, 0x080c, 0x0df6, 0x7014, 0x2068, 0x0804, + 0x5b65, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, 0x0000, 0x2d08, + 0x2068, 0x6906, 0x711a, 0x0804, 0x5bfe, 0x7014, 0x2068, 0x7007, + 0x0001, 0x68b4, 0x9005, 0x1128, 0x68b8, 0x69bc, 0x9105, 0x0108, + 0x00b1, 0x6864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x0904, 0x5e99, + 0x04b8, 0x5c5b, 0x5c5f, 0x0002, 0x001d, 0x0007, 0x0004, 0x000a, + 0x001b, 0x0005, 0x0006, 0x000a, 0x001d, 0x0005, 0x0004, 0x00f6, + 0x00e6, 0x00c6, 0x0076, 0x0066, 0x6fb8, 0x6ebc, 0x6804, 0x2060, + 0x9cf0, 0x002d, 0x9cf8, 0x0033, 0x2009, 0x0005, 0x700c, 0x7816, + 0x7008, 0x7812, 0x7004, 0x7806, 0x7000, 0x7802, 0x7e0e, 0x7f0a, + 0x8109, 0x0128, 0x9ef2, 0x0004, 0x9ffa, 0x0006, 0x0c78, 0x6004, + 0x9065, 0x1d30, 0x006e, 0x007e, 0x00ce, 0x00ee, 0x00fe, 0x0005, + 0x2009, 0x1130, 0x210c, 0x81ff, 0x1178, 0x080c, 0x477e, 0x1108, + 0x0005, 0x080c, 0x52a0, 0x0126, 0x2091, 0x8000, 0x080c, 0x9843, + 0x080c, 0x50a5, 0x012e, 0x0ca0, 0x2001, 0x0028, 0x2009, 0x0000, + 0x0c80, 0x2009, 0x1130, 0x210c, 0x81ff, 0x1190, 0x6888, 0x9005, + 0x01a0, 0x6883, 0x0000, 0x080c, 0x4817, 0x1108, 0x0005, 0x0126, + 0x2091, 0x8000, 0x687a, 0x6982, 0x080c, 0x50a5, 0x012e, 0x0cb0, + 0x2001, 0x0028, 0x2009, 0x0000, 0x0c90, 0x2001, 0x0000, 0x0c78, + 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906, 0x711a, 0x7010, 0x8001, + 0x7012, 0x0118, 0x7007, 0x0003, 0x0030, 0x7014, 0x2068, 0x7007, + 0x0001, 0x7048, 0x080f, 0x0005, 0x7007, 0x0001, 0x6974, 0x810f, + 0x918c, 0x00ff, 0x6878, 0x9084, 0x00ff, 0x20a9, 0x0001, 0x9096, + 0x0001, 0x01b0, 0x2009, 0x0000, 0x20a9, 0x00ff, 0x9096, 0x0002, + 0x0178, 0x9005, 0x11f0, 0x6974, 0x810f, 0x918c, 0x00ff, 0x080c, + 0x4b58, 0x11b8, 0x0066, 0x6e80, 0x080c, 0x4c50, 0x006e, 0x0088, + 0x0046, 0x2011, 0x110c, 0x2224, 0xc484, 0x2412, 0x004e, 0x00c6, + 0x080c, 0x4b58, 0x1110, 0x080c, 0x4d11, 0x8108, 0x1f04, 0x5d08, + 0x00ce, 0x687c, 0xd084, 0x1118, 0x080c, 0x0df6, 0x0005, 0x0126, + 0x2091, 0x8000, 0x080c, 0x50a5, 0x012e, 0x0005, 0x0126, 0x2091, + 0x8000, 0x7007, 0x0001, 0x2001, 0x1153, 0x2004, 0xd0a4, 0x0580, + 0x2061, 0x1329, 0x6100, 0xd184, 0x0178, 0x6888, 0x9084, 0x00ff, + 0x1550, 0x6000, 0xd084, 0x0520, 0x6004, 0x9005, 0x1538, 0x6003, + 0x0000, 0x600b, 0x0000, 0x00c8, 0x2011, 0x0001, 0x6890, 0x9005, + 0x1110, 0x2001, 0x001e, 0x8000, 0x6016, 0x6888, 0x9084, 0x00ff, + 0x0178, 0x6006, 0x6888, 0x8007, 0x9084, 0x00ff, 0x0148, 0x600a, + 0x6888, 0x8000, 0x1108, 0xc28d, 0x6202, 0x012e, 0x0804, 0x5f3c, + 0x012e, 0x0804, 0x5f36, 0x012e, 0x0804, 0x5f30, 0x012e, 0x0804, + 0x5f33, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x1153, + 0x2004, 0xd0a4, 0x05e0, 0x2061, 0x1329, 0x6000, 0xd084, 0x05b8, + 0x6204, 0x6308, 0xd08c, 0x1530, 0x6c78, 0x9484, 0x0003, 0x0170, + 0x6988, 0x918c, 0x00ff, 0x8001, 0x1120, 0x2100, 0x9210, 0x0620, + 0x0028, 0x8001, 0x1508, 0x2100, 0x9212, 0x02f0, 0x9484, 0x000c, + 0x0188, 0x6988, 0x810f, 0x918c, 0x00ff, 0x9082, 0x0004, 0x1120, + 0x2100, 0x9318, 0x0288, 0x0030, 0x9082, 0x0004, 0x1168, 0x2100, + 0x931a, 0x0250, 0x6890, 0x9005, 0x0110, 0x8000, 0x6016, 0x6206, + 0x630a, 0x012e, 0x0804, 0x5f3c, 0x012e, 0x0804, 0x5f39, 0x012e, + 0x0804, 0x5f36, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x2061, + 0x1329, 0x6300, 0xd38c, 0x1120, 0x6308, 0x8318, 0x0220, 0x630a, + 0x012e, 0x0804, 0x5f4a, 0x012e, 0x0804, 0x5f39, 0x0126, 0x00c6, + 0x2091, 0x8000, 0x7007, 0x0001, 0x687c, 0xd0ac, 0x0148, 0x00c6, + 0x2061, 0x1329, 0x6000, 0x9084, 0xfcff, 0x6002, 0x00ce, 0x0448, + 0x6888, 0x9005, 0x05d0, 0x688c, 0x9065, 0x0598, 0x2001, 0x1130, + 0x2004, 0x9005, 0x0118, 0x080c, 0x97a3, 0x0068, 0x6017, 0x0400, + 0x605b, 0x0000, 0x697c, 0xd1a4, 0x0110, 0x6980, 0x615a, 0x2009, + 0x0041, 0x080c, 0x7f4e, 0x6988, 0x918c, 0xff00, 0x9186, 0x2000, + 0x1140, 0x0026, 0x2009, 0x0000, 0x2011, 0xfdff, 0x080c, 0x66d5, + 0x002e, 0x687c, 0xd0c4, 0x0148, 0x2061, 0x1329, 0x6000, 0xd08c, + 0x1120, 0x6008, 0x8000, 0x0208, 0x600a, 0x00ce, 0x012e, 0x0804, + 0x5f3c, 0x00ce, 0x012e, 0x0804, 0x5f36, 0x6984, 0x9186, 0x002e, + 0x0d40, 0x9186, 0x002d, 0x0d28, 0x9186, 0x0045, 0x0510, 0x9186, + 0x002a, 0x1130, 0x2001, 0x110c, 0x200c, 0xc194, 0x2102, 0x08c8, + 0x9186, 0x0020, 0x0170, 0x9186, 0x0029, 0x1d18, 0x6974, 0x918c, + 0xff00, 0x810f, 0x080c, 0x4b58, 0x1960, 0x6000, 0xc0e4, 0x6002, + 0x0840, 0x688c, 0x9065, 0x09a8, 0x2001, 0x12a6, 0x2004, 0x601a, + 0x0800, 0x688c, 0x9065, 0x0968, 0x00e6, 0x6890, 0x9075, 0x2001, + 0x1130, 0x2004, 0x9005, 0x0150, 0x080c, 0x97a3, 0x8eff, 0x0118, + 0x2e60, 0x080c, 0x97a3, 0x00ee, 0x0804, 0x5df9, 0x6024, 0xc0dc, + 0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a, 0x68a0, 0x9005, 0x0130, + 0x6007, 0x003b, 0x68a4, 0x602e, 0x68a8, 0x6016, 0x6003, 0x0001, + 0x080c, 0x6886, 0x080c, 0x6d42, 0x00ee, 0x0804, 0x5df9, 0x2061, + 0x1329, 0x6000, 0xd084, 0x0190, 0xd08c, 0x1904, 0x5f4a, 0x0126, + 0x2091, 0x8000, 0x6204, 0x8210, 0x0220, 0x6206, 0x012e, 0x0804, + 0x5f4a, 0x012e, 0x6883, 0x0016, 0x0804, 0x5f43, 0x6883, 0x0007, + 0x0804, 0x5f43, 0x6864, 0x8007, 0x9084, 0x00ff, 0x0130, 0x8001, + 0x1138, 0x7007, 0x0001, 0x0069, 0x0005, 0x080c, 0x5b49, 0x0040, + 0x7007, 0x0003, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x5e99, + 0x0005, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2061, 0x1100, 0x61c0, + 0x81ff, 0x1904, 0x5f18, 0x6130, 0xd194, 0x1904, 0x5f20, 0x6878, + 0x2070, 0x9e82, 0x15c0, 0x0a04, 0x5f0c, 0x6058, 0x9e02, 0x1a04, + 0x5f0c, 0x2061, 0x1329, 0x6100, 0x9184, 0x0301, 0x9086, 0x0001, + 0x15e8, 0x7120, 0x9186, 0x0006, 0x15f0, 0x7010, 0x9005, 0x0904, + 0x5f18, 0x2004, 0xd0e4, 0x1904, 0x5f1b, 0x7024, 0xd0dc, 0x1904, + 0x5f23, 0x6883, 0x0000, 0x6803, 0x0000, 0x2d08, 0x7014, 0x9005, + 0x1198, 0x7116, 0x687c, 0xd0f4, 0x1904, 0x5f26, 0x2001, 0x1153, + 0x2004, 0xd09c, 0x1118, 0x687c, 0xc0cc, 0x687e, 0x2e60, 0x080c, + 0x6611, 0x012e, 0x00ee, 0x0005, 0x2068, 0x6800, 0x9005, 0x1de0, + 0x6902, 0x2168, 0x687c, 0xd0f4, 0x15c8, 0x012e, 0x00ee, 0x0005, + 0x012e, 0x00ee, 0x6883, 0x0006, 0x0804, 0x5f43, 0xd184, 0x0dc0, + 0xd1c4, 0x11a8, 0x00b8, 0x6974, 0x918c, 0xff00, 0x810f, 0x080c, + 0x4b58, 0x11c8, 0x6000, 0xd0e4, 0x11b0, 0x7120, 0x9186, 0x0007, + 0x1118, 0x6883, 0x0002, 0x0088, 0x6883, 0x0008, 0x0070, 0x6883, + 0x000e, 0x0058, 0x6883, 0x0017, 0x0040, 0x6883, 0x0035, 0x0028, + 0x6883, 0x0028, 0x0010, 0x6883, 0x0029, 0x012e, 0x00ee, 0x0418, + 0x6883, 0x002a, 0x0cd0, 0x6883, 0x0045, 0x0cb8, 0x2e60, 0x2019, + 0x0002, 0x601b, 0x0014, 0x080c, 0xa6bc, 0x012e, 0x00ee, 0x0005, + 0x2009, 0x003e, 0x0058, 0x2009, 0x0004, 0x0040, 0x2009, 0x0006, + 0x0028, 0x2009, 0x0016, 0x0010, 0x2009, 0x0001, 0x6884, 0x9084, + 0xff00, 0x9105, 0x6886, 0x0126, 0x2091, 0x8000, 0x080c, 0x50a5, + 0x012e, 0x0005, 0x080c, 0x0df6, 0x0005, 0x00d6, 0x080c, 0x6608, + 0x00de, 0x0005, 0x00d6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, + 0x0040, 0x702c, 0xd084, 0x01f0, 0x908c, 0x0780, 0x11f8, 0xd09c, + 0x11c8, 0x2071, 0x1100, 0x70b0, 0x90ea, 0x0010, 0x0298, 0x8001, + 0x70b2, 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, + 0x0000, 0x2071, 0x0040, 0x8d07, 0x8005, 0x8005, 0xc0d5, 0x7022, + 0x702c, 0x0c10, 0x012e, 0x00ee, 0x00de, 0x0005, 0x2011, 0x8003, + 0x080c, 0x37dc, 0x0cf8, 0x0006, 0x9084, 0x0780, 0x0128, 0x2011, + 0x8003, 0x080c, 0x37dc, 0x0cf8, 0x000e, 0x0005, 0x00d6, 0x00c6, + 0x0036, 0x0026, 0x0016, 0x7007, 0x0001, 0x6a74, 0x9282, 0x0004, + 0x1a04, 0x5fd9, 0xd284, 0x0170, 0x6a7c, 0x9290, 0x1000, 0x2204, + 0x9065, 0x6004, 0x05e0, 0x8007, 0x9084, 0x00ff, 0x9084, 0x0006, + 0x1108, 0x04a8, 0x2c10, 0x080c, 0x7ec8, 0x1118, 0x080c, 0x984d, + 0x05a0, 0x6212, 0x6874, 0x0002, 0x5fb8, 0x5fbd, 0x5fc0, 0x5fc6, + 0x2019, 0x0002, 0x080c, 0xaa50, 0x0060, 0x080c, 0xa9e7, 0x0048, + 0x2019, 0x0002, 0x6980, 0x080c, 0xaa02, 0x0018, 0x6980, 0x080c, + 0xa9e7, 0x080c, 0x7f1e, 0x6887, 0x0000, 0x0126, 0x2091, 0x8000, + 0x080c, 0x50a5, 0x012e, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00de, + 0x0005, 0x6887, 0x0006, 0x0c88, 0x6887, 0x0002, 0x0c70, 0x6887, + 0x0005, 0x0c58, 0x6887, 0x0004, 0x0c40, 0x6887, 0x0007, 0x0c28, + 0x0005, 0x781c, 0xd08c, 0x05f0, 0x7d44, 0x7c40, 0x9584, 0x00f6, + 0x1500, 0x9484, 0x7000, 0x0138, 0x908a, 0x2000, 0x1250, 0x9584, + 0x0700, 0x8007, 0x04b2, 0x7000, 0x9084, 0xff00, 0x9086, 0x8100, + 0x0db0, 0x9484, 0x0fff, 0x1130, 0x7000, 0x9084, 0xff00, 0x9086, + 0x8100, 0x11e0, 0x080c, 0xadbe, 0x080c, 0x6423, 0x7817, 0x0140, + 0x00c8, 0x9584, 0x0076, 0x1118, 0x080c, 0x6481, 0x19d0, 0xd5a4, + 0x0168, 0x080c, 0x136e, 0x7803, 0x0010, 0x78a0, 0x78a2, 0x2001, + 0x0160, 0x2502, 0x2001, 0x0138, 0x2202, 0x0020, 0x080c, 0xadbe, + 0x7817, 0x0140, 0x2001, 0x12e5, 0x2004, 0x9005, 0x090c, 0x6d42, + 0x0005, 0x6042, 0x626b, 0x6039, 0x6039, 0x6039, 0x6039, 0x6039, + 0x6039, 0x7817, 0x0140, 0x2001, 0x12e5, 0x2004, 0x9005, 0x090c, + 0x6d42, 0x0005, 0x7000, 0x908c, 0xff00, 0x9194, 0xf000, 0x810f, + 0x9484, 0x0fff, 0x6882, 0x9286, 0x2000, 0x1148, 0x6800, 0x9086, + 0x0001, 0x1118, 0x080c, 0x3e5a, 0x0068, 0x00a9, 0x0058, 0x9286, + 0x3000, 0x1118, 0x080c, 0x61b5, 0x0028, 0x9286, 0x8000, 0x1110, + 0x080c, 0x635d, 0x7817, 0x0140, 0x2001, 0x12e5, 0x2004, 0x9005, + 0x090c, 0x6d42, 0x0005, 0x00c6, 0x7010, 0x9084, 0xff00, 0x8007, + 0x9096, 0x0001, 0x0120, 0x9096, 0x0023, 0x1904, 0x61af, 0x9186, + 0x0023, 0x1550, 0x080c, 0x63f6, 0x0904, 0x61af, 0x7124, 0x610a, + 0x7030, 0x908e, 0x0200, 0x1130, 0x2009, 0x0015, 0x080c, 0x7f4e, + 0x0804, 0x61af, 0x908e, 0x0214, 0x0118, 0x908e, 0x0210, 0x1130, + 0x2009, 0x0015, 0x080c, 0x7f4e, 0x0804, 0x61af, 0x908e, 0x0100, + 0x1904, 0x61af, 0x7034, 0x9005, 0x1904, 0x61af, 0x2009, 0x0016, + 0x080c, 0x7f4e, 0x0804, 0x61af, 0x9186, 0x0022, 0x1904, 0x61af, + 0x7030, 0x908e, 0x0300, 0x1580, 0x68cc, 0xd0a4, 0x0528, 0xc0b5, + 0x68ce, 0x7100, 0x918c, 0x00ff, 0x696e, 0x7004, 0x6872, 0x00f6, + 0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006, 0x9084, 0x00ff, 0x0016, + 0x2008, 0x080c, 0x1c93, 0x7932, 0x7936, 0x001e, 0x000e, 0x00fe, + 0x080c, 0x1c69, 0x694e, 0x703c, 0x00e6, 0x2071, 0x0140, 0x7086, + 0x2071, 0x1100, 0x70a2, 0x00ee, 0x7034, 0x9005, 0x1904, 0x61af, + 0x2009, 0x0017, 0x0804, 0x6175, 0x908e, 0x0400, 0x1158, 0x7034, + 0x9005, 0x1904, 0x61af, 0x68cc, 0xc0a5, 0x68ce, 0x2009, 0x0030, + 0x0804, 0x6175, 0x908e, 0x0500, 0x1140, 0x7034, 0x9005, 0x1904, + 0x61af, 0x2009, 0x0018, 0x0804, 0x6175, 0x908e, 0x2010, 0x1120, + 0x2009, 0x0019, 0x0804, 0x6175, 0x908e, 0x2110, 0x1120, 0x2009, + 0x001a, 0x0804, 0x6175, 0x908e, 0x5200, 0x1140, 0x7034, 0x9005, + 0x1904, 0x61af, 0x2009, 0x001b, 0x0804, 0x6175, 0x908e, 0x5000, + 0x1140, 0x7034, 0x9005, 0x1904, 0x61af, 0x2009, 0x001c, 0x0804, + 0x6175, 0x908e, 0x1300, 0x1120, 0x2009, 0x0034, 0x0804, 0x6175, + 0x908e, 0x1200, 0x1140, 0x7034, 0x9005, 0x1904, 0x61af, 0x2009, + 0x0024, 0x0804, 0x6175, 0x908c, 0xff00, 0x918e, 0x2400, 0x1120, + 0x2009, 0x002d, 0x0804, 0x6175, 0x908c, 0xff00, 0x918e, 0x5300, + 0x1118, 0x2009, 0x002a, 0x04c8, 0x908e, 0x0f00, 0x1118, 0x2009, + 0x0020, 0x0498, 0x908e, 0x5300, 0x1108, 0x00d8, 0x908e, 0x6104, + 0x11c0, 0x2011, 0x026d, 0x8208, 0x2204, 0x9082, 0x0004, 0x8004, + 0x8004, 0x20a8, 0x2011, 0x8015, 0x211c, 0x8108, 0x0046, 0x2124, + 0x080c, 0x37dc, 0x004e, 0x8108, 0x1f04, 0x6152, 0x2009, 0x0023, + 0x00a0, 0x908e, 0x6000, 0x1118, 0x2009, 0x003f, 0x0070, 0x908e, + 0x7800, 0x1118, 0x2009, 0x0045, 0x0040, 0x908e, 0x6300, 0x1118, + 0x2009, 0x004a, 0x0010, 0x2009, 0x001d, 0x0016, 0x2011, 0x0263, + 0x2204, 0x8211, 0x220c, 0x080c, 0x1c69, 0x1598, 0x080c, 0x4b03, + 0x1580, 0x6612, 0x6516, 0x86ff, 0x01e8, 0x001e, 0x0016, 0x9186, + 0x0017, 0x1158, 0x686c, 0x9606, 0x11a8, 0x6870, 0x9506, 0x9084, + 0xff00, 0x1180, 0x6000, 0xc0f5, 0x6002, 0x9186, 0x0046, 0x1150, + 0x686c, 0x9606, 0x1138, 0x6870, 0x9506, 0x9084, 0xff00, 0x1110, + 0x001e, 0x0068, 0x00c6, 0x080c, 0x7ec8, 0x0168, 0x001e, 0x6112, + 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0x7f4e, 0x00ce, + 0x0005, 0x001e, 0x0ce0, 0x00ce, 0x0ce0, 0x080c, 0x26bc, 0x1140, + 0x7010, 0x9084, 0xff00, 0x8007, 0x908e, 0x0008, 0x1108, 0x0009, + 0x0005, 0x00c6, 0x0046, 0x7000, 0x908c, 0xff00, 0x810f, 0x9186, + 0x0033, 0x11e8, 0x080c, 0x63f6, 0x0904, 0x6212, 0x7124, 0x610a, + 0x7030, 0x908e, 0x0200, 0x1140, 0x7034, 0x9005, 0x15d8, 0x2009, + 0x0015, 0x080c, 0x7f4e, 0x04b0, 0x908e, 0x0100, 0x1598, 0x7034, + 0x9005, 0x1580, 0x2009, 0x0016, 0x080c, 0x7f4e, 0x0458, 0x9186, + 0x0032, 0x1540, 0x7030, 0x908e, 0x1400, 0x1520, 0x2009, 0x0038, + 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x1c69, + 0x11c0, 0x080c, 0x4b03, 0x11a8, 0x6612, 0x6516, 0x00c6, 0x080c, + 0x7ec8, 0x0170, 0x001e, 0x6112, 0x080c, 0x99cc, 0x6023, 0x0004, + 0x7120, 0x610a, 0x001e, 0x080c, 0x7f4e, 0x080c, 0x6d42, 0x0010, + 0x00ce, 0x001e, 0x004e, 0x00ce, 0x0005, 0x0046, 0x00e6, 0x00d6, + 0x2028, 0x2130, 0x9696, 0x00ff, 0x11b0, 0x9592, 0xfffc, 0x0298, + 0x9596, 0xfffd, 0x1120, 0x2009, 0x007f, 0x0804, 0x6266, 0x9596, + 0xfffe, 0x1118, 0x2009, 0x007e, 0x04c8, 0x9596, 0xfffc, 0x1118, + 0x2009, 0x0080, 0x0498, 0x2011, 0x0000, 0x2019, 0x1133, 0x231c, + 0xd3ac, 0x0138, 0x2021, 0x0000, 0x20a9, 0x00ff, 0x2071, 0x1000, + 0x0030, 0x2021, 0x0081, 0x20a9, 0x007e, 0x2071, 0x1081, 0x2e1c, + 0x93ed, 0x0000, 0x1128, 0x82ff, 0x1170, 0x2410, 0xc2fd, 0x0058, + 0x6f10, 0x2600, 0x9706, 0x6814, 0x1120, 0x9546, 0x1110, 0x2408, + 0x0068, 0x9745, 0x0d80, 0x8420, 0x8e70, 0x1f04, 0x6247, 0x82ff, + 0x1118, 0x9085, 0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, + 0x00ee, 0x004e, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184, + 0x0007, 0x004a, 0x7817, 0x0140, 0x2001, 0x12e5, 0x2004, 0x9005, + 0x090c, 0x6d42, 0x0005, 0x628b, 0x628b, 0x628b, 0x6408, 0x628b, + 0x6294, 0x62b1, 0x6340, 0x628b, 0x628b, 0x628b, 0x628b, 0x628b, + 0x628b, 0x628b, 0x628b, 0x7817, 0x0140, 0x2001, 0x12e5, 0x2004, + 0x9005, 0x090c, 0x6d42, 0x0005, 0x7110, 0xd1bc, 0x0188, 0x7120, + 0x2160, 0x9c8c, 0x0007, 0x1160, 0x9c8a, 0x15c0, 0x0248, 0x6858, + 0x9c02, 0x1230, 0x7124, 0x610a, 0x2009, 0x0046, 0x080c, 0x7f4e, + 0x7817, 0x0140, 0x2001, 0x12e5, 0x2004, 0x9005, 0x090c, 0x6d42, + 0x0005, 0x00c6, 0x7110, 0xd1bc, 0x1904, 0x6316, 0x7108, 0x700c, + 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x15d8, 0x81ff, + 0x15c8, 0x9080, 0x26c1, 0x200d, 0x918c, 0xff00, 0x810f, 0x9006, + 0x1904, 0x6316, 0x080c, 0x4b03, 0x1904, 0x6316, 0x6612, 0x6516, + 0x6000, 0xd0ec, 0x1904, 0x6316, 0x6204, 0x9294, 0xff00, 0x8217, + 0x9286, 0x0006, 0x1190, 0x00c6, 0x080c, 0x7ec8, 0x001e, 0x0904, + 0x6320, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x6156, + 0x2009, 0x0044, 0x080c, 0x7f4e, 0x0448, 0x080c, 0x5745, 0x1170, + 0x6204, 0x9294, 0x00ff, 0x9286, 0x0006, 0x1140, 0x9295, 0x0600, + 0x6206, 0x0c08, 0x190c, 0x6215, 0x11c8, 0x0860, 0x00c6, 0x080c, + 0x7ec8, 0x001e, 0x0198, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, + 0x9286, 0x0004, 0x1118, 0x6007, 0x0005, 0x0010, 0x6007, 0x0001, + 0x6003, 0x0001, 0x080c, 0x68ce, 0x080c, 0x6d42, 0x7817, 0x0140, + 0x2001, 0x12e5, 0x2004, 0x9005, 0x090c, 0x6d42, 0x00ce, 0x0005, + 0x2001, 0x110d, 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, + 0x37dc, 0x00c6, 0x080c, 0x984d, 0x001e, 0x0d40, 0x6112, 0x6023, + 0x0006, 0x7120, 0x610a, 0x7130, 0x6156, 0x6017, 0x0300, 0x6003, + 0x0001, 0x6007, 0x0041, 0x080c, 0x6886, 0x080c, 0x6d42, 0x08b0, + 0x7110, 0xd1bc, 0x0188, 0x7020, 0x2060, 0x9c84, 0x0007, 0x1160, + 0x9c82, 0x15c0, 0x0248, 0x6858, 0x9c02, 0x1230, 0x7124, 0x610a, + 0x2009, 0x0045, 0x080c, 0x7f4e, 0x7817, 0x0140, 0x2001, 0x12e5, + 0x2004, 0x9005, 0x090c, 0x6d42, 0x0005, 0x080c, 0x26bc, 0x1168, + 0x7010, 0x9084, 0xff00, 0x8007, 0x9086, 0x0000, 0x1130, 0x9184, + 0x000f, 0x908a, 0x0006, 0x1208, 0x000b, 0x0005, 0x6374, 0x6375, + 0x6374, 0x6374, 0x63de, 0x63ea, 0x0005, 0x7110, 0xd1bc, 0x0120, + 0x702c, 0xd084, 0x0904, 0x63dd, 0x700c, 0x7108, 0x080c, 0x1c69, + 0x1904, 0x63dd, 0x080c, 0x4b03, 0x1904, 0x63dd, 0x6612, 0x6516, + 0x6204, 0x7110, 0xd1bc, 0x01f8, 0x928c, 0x00ff, 0x9186, 0x0004, + 0x0118, 0x9186, 0x0006, 0x15c8, 0x00c6, 0x080c, 0x63f6, 0x00ce, + 0x0904, 0x63dd, 0x00c6, 0x080c, 0x7ec8, 0x001e, 0x05f0, 0x6112, + 0x080c, 0x99cc, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088, + 0x080c, 0x7f4e, 0x0490, 0x928c, 0x00ff, 0x9186, 0x0006, 0x0160, + 0x9186, 0x0004, 0x0148, 0x9294, 0xff00, 0x8217, 0x9286, 0x0004, + 0x0118, 0x9286, 0x0006, 0x1188, 0x00c6, 0x080c, 0x7ec8, 0x001e, + 0x01e0, 0x6112, 0x080c, 0x99cc, 0x6023, 0x0005, 0x7120, 0x610a, + 0x2009, 0x0088, 0x080c, 0x7f4e, 0x0080, 0x00c6, 0x080c, 0x7ec8, + 0x001e, 0x0158, 0x6112, 0x080c, 0x99cc, 0x6023, 0x0004, 0x7120, + 0x610a, 0x2009, 0x0001, 0x080c, 0x7f4e, 0x0005, 0x7110, 0xd1bc, + 0x0140, 0x00a1, 0x0130, 0x7124, 0x610a, 0x2009, 0x0089, 0x080c, + 0x7f4e, 0x0005, 0x7110, 0xd1bc, 0x0140, 0x0041, 0x0130, 0x7124, + 0x610a, 0x2009, 0x008a, 0x080c, 0x7f4e, 0x0005, 0x7020, 0x2060, + 0x9c84, 0x0007, 0x1158, 0x9c82, 0x15c0, 0x0240, 0x2001, 0x1116, + 0x2004, 0x9c02, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, + 0x7110, 0xd1bc, 0x1178, 0x7024, 0x2060, 0x9c84, 0x0007, 0x1150, + 0x9c82, 0x15c0, 0x0238, 0x6858, 0x9c02, 0x1220, 0x2009, 0x0051, + 0x080c, 0x7f4e, 0x7817, 0x0140, 0x2001, 0x12e5, 0x2004, 0x9005, + 0x090c, 0x6d42, 0x0005, 0x2031, 0x0105, 0x0069, 0x0005, 0x2031, + 0x0206, 0x0049, 0x0005, 0x2031, 0x0207, 0x0029, 0x0005, 0x2031, + 0x0213, 0x0009, 0x0005, 0x00c6, 0x00d6, 0x00f6, 0x7000, 0x9084, + 0xf000, 0x9086, 0xc000, 0x05d0, 0x080c, 0x7ec8, 0x05b8, 0x0066, + 0x00c6, 0x0046, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, + 0x1c69, 0x15a0, 0x080c, 0x4b03, 0x1588, 0x6612, 0x6516, 0x2c00, + 0x004e, 0x00ce, 0x6012, 0x080c, 0x99cc, 0x080c, 0x0ddf, 0x0510, + 0x2d00, 0x605a, 0x6803, 0x0000, 0x6867, 0x0000, 0x6c6a, 0x9df8, + 0x001b, 0x20a9, 0x000e, 0x20e9, 0x0001, 0x20e1, 0x0000, 0x2fa0, + 0x2e98, 0x4003, 0x006e, 0x6616, 0x6007, 0x003e, 0x6023, 0x0001, + 0x6003, 0x0001, 0x080c, 0x68ce, 0x080c, 0x6d42, 0x00fe, 0x00de, + 0x00ce, 0x0005, 0x080c, 0x7f1e, 0x006e, 0x0cc0, 0x004e, 0x00ce, + 0x0cc8, 0x00c6, 0x7000, 0x908c, 0xff00, 0x9184, 0xf000, 0x810f, + 0x9086, 0x2000, 0x1548, 0x9186, 0x0022, 0x11d8, 0x2001, 0x0111, + 0x2004, 0x9005, 0x1518, 0x7030, 0x908e, 0x0400, 0x01f8, 0x908e, + 0x6000, 0x01e0, 0x908e, 0x5400, 0x01c8, 0x908e, 0x0300, 0x1140, + 0x2009, 0x1133, 0x210c, 0xd184, 0x0118, 0x080c, 0x5745, 0x0170, + 0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x63f6, 0x0128, 0x6004, + 0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010, 0x9085, 0x0001, + 0x00ce, 0x0005, 0x2071, 0x12ef, 0x7003, 0x0003, 0x700f, 0x0361, + 0x9006, 0x701a, 0x7012, 0x7017, 0x15c0, 0x7007, 0x0000, 0x7026, + 0x702b, 0x772e, 0x7032, 0x7037, 0x778e, 0x703b, 0xffff, 0x703f, + 0xffff, 0x7042, 0x7047, 0x3d63, 0x704a, 0x705b, 0x65ea, 0x2001, + 0x1291, 0x2003, 0x0003, 0x2001, 0x1293, 0x2003, 0x0100, 0x0005, + 0x2071, 0x12ef, 0x1d04, 0x654a, 0x2091, 0x6000, 0x700c, 0x8001, + 0x700e, 0x1180, 0x700f, 0x0361, 0x7007, 0x0001, 0x0126, 0x2091, + 0x8000, 0x7040, 0x900d, 0x0148, 0x8109, 0x7142, 0x1130, 0x7044, + 0x080f, 0x0018, 0x0126, 0x2091, 0x8000, 0x7024, 0x900d, 0x0188, + 0x7020, 0x8001, 0x7022, 0x1168, 0x7023, 0x0009, 0x8109, 0x7126, + 0x9186, 0x03e8, 0x1110, 0x7028, 0x080f, 0x81ff, 0x1110, 0x7028, + 0x080f, 0x7030, 0x900d, 0x0158, 0x702c, 0x8001, 0x702e, 0x1138, + 0x702f, 0x0009, 0x8109, 0x7132, 0x1110, 0x7034, 0x080f, 0x7038, + 0x9005, 0x0118, 0x0310, 0x8001, 0x703a, 0x703c, 0x9005, 0x0118, + 0x0310, 0x8001, 0x703e, 0x704c, 0x900d, 0x0168, 0x7048, 0x8001, + 0x704a, 0x1148, 0x704b, 0x0009, 0x8109, 0x714e, 0x1120, 0x7150, + 0x714e, 0x7058, 0x080f, 0x7018, 0x900d, 0x0158, 0x7008, 0x8001, + 0x700a, 0x1138, 0x700b, 0x0009, 0x8109, 0x711a, 0x1110, 0x701c, + 0x080f, 0x012e, 0x7004, 0x0002, 0x6570, 0x6571, 0x6589, 0x00e6, + 0x2071, 0x12ef, 0x7018, 0x9005, 0x1120, 0x711a, 0x721e, 0x700b, + 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x12ef, 0x701c, + 0x9206, 0x1110, 0x701a, 0x701e, 0x000e, 0x00ee, 0x0005, 0x00e6, + 0x2071, 0x12ef, 0x6088, 0x9102, 0x0208, 0x618a, 0x00ee, 0x0005, + 0x0005, 0x7110, 0x080c, 0x4b58, 0x1158, 0x6088, 0x8001, 0x0240, + 0x608a, 0x1130, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d42, 0x012e, + 0x8108, 0x9182, 0x00ff, 0x0218, 0x900e, 0x7007, 0x0002, 0x7112, + 0x0005, 0x7014, 0x2060, 0x0126, 0x2091, 0x8000, 0x6040, 0x9005, + 0x0128, 0x8001, 0x6042, 0x1110, 0x080c, 0x9887, 0x6018, 0x9005, + 0x0500, 0x8001, 0x601a, 0x11e8, 0x6120, 0x9186, 0x0003, 0x0118, + 0x9186, 0x0006, 0x11a0, 0x6014, 0x2068, 0x6884, 0x908a, 0x199a, + 0x0270, 0x9082, 0x1999, 0x6886, 0x908a, 0x199a, 0x0210, 0x2001, + 0x1999, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0x0010, 0x080c, + 0x9362, 0x012e, 0x9c88, 0x0018, 0x7116, 0x2001, 0x45c0, 0x9102, + 0x0220, 0x7017, 0x15c0, 0x7007, 0x0000, 0x0005, 0x00e6, 0x2071, + 0x12ef, 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005, 0x2001, + 0x12f8, 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071, 0x12ef, 0x7132, + 0x702f, 0x0009, 0x00ee, 0x0005, 0x2011, 0x12fb, 0x2013, 0x0000, + 0x0005, 0x00e6, 0x2071, 0x12ef, 0x711a, 0x721e, 0x700b, 0x0009, + 0x00ee, 0x0005, 0x00c6, 0x0026, 0x7054, 0x8000, 0x7056, 0x2061, + 0x1291, 0x6008, 0x9086, 0x0000, 0x0158, 0x7068, 0x6036, 0x7064, + 0x6032, 0x7060, 0x602e, 0x705c, 0x602a, 0x2c10, 0x080c, 0x0e55, + 0x002e, 0x00ce, 0x0005, 0x00c6, 0x2061, 0x1329, 0x00ce, 0x0005, + 0x9184, 0x000f, 0x8003, 0x8003, 0x8003, 0x9080, 0x1329, 0x2060, + 0x0005, 0x6884, 0x908a, 0x199a, 0x1630, 0x9005, 0x1150, 0x00c6, + 0x2061, 0x1329, 0x6014, 0x00ce, 0x9005, 0x1130, 0x2001, 0x001e, + 0x0018, 0x908e, 0xffff, 0x01a8, 0x8003, 0x800b, 0x810b, 0x9108, + 0x611a, 0x687c, 0x908c, 0x00c0, 0x918e, 0x00c0, 0x0904, 0x668a, + 0xd0b4, 0x1160, 0xd0bc, 0x15b8, 0x2009, 0x0006, 0x080c, 0x66b0, + 0x0005, 0x900e, 0x0c68, 0x2001, 0x1999, 0x08b8, 0xd0fc, 0x0160, + 0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904, 0x66aa, 0x908c, + 0x2020, 0x918e, 0x2020, 0x0180, 0x6024, 0xd0d4, 0x11a8, 0x2009, + 0x1174, 0x2104, 0xd084, 0x1120, 0x2009, 0x0043, 0x0804, 0x7f4e, + 0x2009, 0x0042, 0x0804, 0x7f4e, 0x6110, 0x210c, 0xd1ac, 0x0d60, + 0x6024, 0xc0cd, 0x6026, 0x0c40, 0xc0d4, 0x6026, 0x6890, 0x602e, + 0x688c, 0x6032, 0x0c20, 0xd0fc, 0x0158, 0x908c, 0x0003, 0x0118, + 0x908e, 0x0003, 0x15b8, 0x908c, 0x2020, 0x918e, 0x2020, 0x0150, + 0x00f6, 0x2c78, 0x080c, 0x119d, 0x00fe, 0x2009, 0x0042, 0x080c, + 0x7f4e, 0x0005, 0x6110, 0x210c, 0xd1ac, 0x0d90, 0x6124, 0xc1cd, + 0x6126, 0x0c70, 0xd0fc, 0x0178, 0x908c, 0x2020, 0x918e, 0x2020, + 0x0188, 0x9084, 0x0003, 0x908e, 0x0002, 0x0138, 0x2009, 0x0041, + 0x080c, 0x7f4e, 0x0005, 0x0091, 0x0ce8, 0x2009, 0x0043, 0x080c, + 0x7f4e, 0x0cc0, 0x6110, 0x210c, 0xd1ac, 0x0d58, 0x6124, 0xc1cd, + 0x6126, 0x0c38, 0x2009, 0x0004, 0x0019, 0x0005, 0x2009, 0x0001, + 0x00d6, 0x6014, 0x90ec, 0xf000, 0x01f0, 0x2068, 0x6982, 0x6800, + 0x6016, 0x9186, 0x0001, 0x1188, 0x697c, 0x918c, 0x8100, 0x918e, + 0x8100, 0x1158, 0x00c6, 0x2061, 0x1329, 0x6200, 0xd28c, 0x1120, + 0x6204, 0x8210, 0x0208, 0x6206, 0x00ce, 0x080c, 0x4ef4, 0x6014, + 0x906d, 0x190c, 0x6611, 0x00de, 0x0005, 0x0156, 0x00c6, 0x2061, + 0x1329, 0x6000, 0x81ff, 0x0110, 0x9205, 0x0008, 0x9204, 0x6002, + 0x00ce, 0x015e, 0x0005, 0x6800, 0xd08c, 0x1138, 0x6808, 0x9005, + 0x0120, 0x8001, 0x680a, 0x9085, 0x0001, 0x0005, 0x20a9, 0x0010, + 0x9006, 0x8004, 0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x1208, 0x9200, + 0x1f04, 0x66f2, 0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x0005, 0x0156, + 0x20a9, 0x0010, 0x9005, 0x01c0, 0x911a, 0x12b0, 0x8213, 0x81f5, + 0x3e08, 0x0228, 0x911a, 0x1220, 0x1f04, 0x6706, 0x0028, 0x911a, + 0x2308, 0x8210, 0x1f04, 0x6706, 0x0006, 0x3200, 0x9084, 0xefff, + 0x2080, 0x000e, 0x015e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000, + 0x0cb8, 0x0126, 0x2091, 0x2800, 0x2079, 0x12dc, 0x012e, 0x00d6, + 0x2069, 0x12dc, 0x6803, 0x0005, 0x0156, 0x0146, 0x01d6, 0x20e9, + 0x0000, 0x2069, 0x0200, 0x080c, 0x7e9b, 0x20a9, 0x0020, 0x20a1, + 0x0240, 0x9006, 0x4004, 0x080c, 0x7e86, 0x20a9, 0x0020, 0x20a1, + 0x0240, 0x9006, 0x4004, 0x080c, 0x7e89, 0x20a9, 0x0020, 0x20a1, + 0x0240, 0x9006, 0x4004, 0x080c, 0x7e8c, 0x20a9, 0x0020, 0x20a1, + 0x0240, 0x9006, 0x4004, 0x080c, 0x7e8f, 0x20a9, 0x0020, 0x20a1, + 0x0240, 0x9006, 0x4004, 0x080c, 0x7e92, 0x20a9, 0x0020, 0x20a1, + 0x0240, 0x9006, 0x4004, 0x080c, 0x7e95, 0x20a9, 0x0020, 0x20a1, + 0x0240, 0x9006, 0x4004, 0x080c, 0x7e98, 0x20a9, 0x0020, 0x20a1, + 0x0240, 0x9006, 0x4004, 0x01de, 0x014e, 0x015e, 0x2069, 0x0004, + 0x2d04, 0x9085, 0x8001, 0x206a, 0x00de, 0x0005, 0x00c6, 0x6027, + 0x0001, 0x7804, 0x9084, 0x0007, 0x0002, 0x678f, 0x67b3, 0x67fd, + 0x6795, 0x67b3, 0x678f, 0x678d, 0x678d, 0x080c, 0x0cf1, 0x080c, + 0x65cf, 0x080c, 0x6d42, 0x00ce, 0x0005, 0x62c0, 0x82ff, 0x1110, + 0x00ce, 0x0005, 0x2011, 0x4586, 0x080c, 0x655b, 0x7828, 0x9092, + 0x00c8, 0x1228, 0x8000, 0x782a, 0x080c, 0x45c0, 0x0c88, 0x62c0, + 0x080c, 0x7e9f, 0x080c, 0x4586, 0x7807, 0x0003, 0x7827, 0x0000, + 0x782b, 0x0000, 0x0c28, 0x080c, 0x65cf, 0x6220, 0xd2a4, 0x0178, + 0x62c0, 0x82ff, 0x1160, 0x782b, 0x0000, 0x7824, 0x9065, 0x090c, + 0x0cf1, 0x2009, 0x0013, 0x080c, 0x7f4e, 0x00ce, 0x0005, 0x00c6, + 0x7824, 0x9065, 0x090c, 0x0cf1, 0x7804, 0x9086, 0x0004, 0x0904, + 0x6839, 0x7828, 0x9092, 0x2710, 0x1230, 0x8000, 0x782a, 0x00ce, + 0x080c, 0x76fd, 0x0c50, 0x2011, 0x0130, 0x2214, 0x080c, 0x7e9f, + 0x6104, 0x9186, 0x0003, 0x1188, 0x00e6, 0x2071, 0x1100, 0x70d8, + 0x00ee, 0xd08c, 0x0150, 0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, + 0x1100, 0x080c, 0x45d6, 0x00ee, 0x00ce, 0x080c, 0xae07, 0x2009, + 0x0014, 0x080c, 0x7f4e, 0x00ce, 0x0840, 0x2001, 0x12f8, 0x2003, + 0x0000, 0x62c0, 0x82ff, 0x1160, 0x782b, 0x0000, 0x7824, 0x9065, + 0x090c, 0x0cf1, 0x2009, 0x0013, 0x080c, 0x7fa6, 0x00ce, 0x0005, + 0x00c6, 0x00d6, 0x7824, 0x9005, 0x090c, 0x0cf1, 0x781c, 0x906d, + 0x090c, 0x0cf1, 0x080c, 0x7e9f, 0x6800, 0xc0dc, 0x6802, 0x7924, + 0x2160, 0x080c, 0x7f1e, 0x693c, 0x81ff, 0x090c, 0x0cf1, 0x8109, + 0x693e, 0x6854, 0x9015, 0x0110, 0x7a1e, 0x0010, 0x7918, 0x791e, + 0x7807, 0x0000, 0x7827, 0x0000, 0x00de, 0x00ce, 0x080c, 0x6d42, + 0x08a8, 0x6104, 0x9186, 0x0002, 0x0128, 0x9186, 0x0004, 0x0110, + 0x0804, 0x67d1, 0x7808, 0x9c06, 0x0904, 0x67d1, 0x080c, 0x6c56, + 0x080c, 0x68ce, 0x00ce, 0x080c, 0x6d42, 0x0804, 0x67c5, 0x00c6, + 0x6024, 0x6027, 0x0002, 0xd0f4, 0x1550, 0x62c8, 0x60c4, 0x9205, + 0x1170, 0x783c, 0x9065, 0x0130, 0x2009, 0x0049, 0x080c, 0x7f4e, + 0x00ce, 0x0005, 0x2011, 0x12fb, 0x2013, 0x0000, 0x0cc8, 0x793c, + 0x81ff, 0x0dc0, 0x793c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0006, + 0x1138, 0x6014, 0x9084, 0x1984, 0x9085, 0x0012, 0x6016, 0x0c40, + 0x6014, 0x9084, 0x1984, 0x9085, 0x0016, 0x6016, 0x0c08, 0x793c, + 0x2160, 0x2009, 0x004a, 0x080c, 0x7f4e, 0x08d0, 0x0006, 0x0016, + 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, + 0x12dc, 0x6020, 0x8000, 0x6022, 0x6010, 0x9005, 0x0148, 0x9080, + 0x0003, 0x2102, 0x6112, 0x012e, 0x00ce, 0x001e, 0x000e, 0x0005, + 0x6116, 0x6112, 0x0cc0, 0x00d6, 0x2069, 0x12dc, 0x6000, 0xd0d4, + 0x0178, 0x6820, 0x8000, 0x6822, 0x9086, 0x0001, 0x1110, 0x2c00, + 0x681e, 0x6804, 0x9084, 0x0007, 0x0804, 0x6d59, 0x00de, 0x0005, + 0xc0d5, 0x6002, 0x6818, 0x9005, 0x0158, 0x6056, 0x605b, 0x0000, + 0x0006, 0x2c00, 0x681a, 0x00de, 0x685a, 0x2069, 0x12dc, 0x0c08, + 0x6056, 0x605a, 0x2c00, 0x681a, 0x681e, 0x08d8, 0x0006, 0x0016, + 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, + 0x12dc, 0x6020, 0x8000, 0x6022, 0x6008, 0x9005, 0x0148, 0x9080, + 0x0003, 0x2102, 0x610a, 0x012e, 0x00ce, 0x001e, 0x000e, 0x0005, + 0x610e, 0x610a, 0x0cc0, 0x00c6, 0x600f, 0x0000, 0x2c08, 0x2061, + 0x12dc, 0x6034, 0x9005, 0x0130, 0x9080, 0x0003, 0x2102, 0x6136, + 0x00ce, 0x0005, 0x613a, 0x6136, 0x00ce, 0x0005, 0x00f6, 0x00e6, + 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0026, 0x0016, 0x0006, 0x0126, + 0x2071, 0x12dc, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, + 0x0904, 0x696a, 0x6010, 0x9080, 0x0028, 0x2004, 0x9206, 0x1904, + 0x6965, 0x87ff, 0x0120, 0x6054, 0x9106, 0x1904, 0x6965, 0x703c, + 0x9c06, 0x1170, 0x0036, 0x2019, 0x0001, 0x080c, 0x7936, 0x7033, + 0x0000, 0x703f, 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x003e, + 0x7038, 0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, + 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, + 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, + 0x600f, 0x0000, 0x080c, 0x95d2, 0x0198, 0x6014, 0x2068, 0x6020, + 0x9086, 0x0003, 0x1510, 0x6867, 0x0103, 0x6b7a, 0x6877, 0x0000, + 0x080c, 0x9843, 0x080c, 0xad5f, 0x080c, 0x50a5, 0x080c, 0x9797, + 0x080c, 0x97a3, 0x00ce, 0x0804, 0x690f, 0x2c78, 0x600c, 0x2060, + 0x0804, 0x690f, 0x012e, 0x000e, 0x001e, 0x002e, 0x006e, 0x007e, + 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, + 0x1128, 0x080c, 0xad5f, 0x080c, 0xaa84, 0x0c10, 0x08a0, 0x0006, + 0x0066, 0x00c6, 0x00d6, 0x00f6, 0x2031, 0x0000, 0x0126, 0x2091, + 0x8000, 0x2079, 0x12dc, 0x7838, 0x9065, 0x0558, 0x600c, 0x0006, + 0x600f, 0x0000, 0x783c, 0x9c06, 0x1170, 0x0036, 0x2019, 0x0001, + 0x080c, 0x7936, 0x7833, 0x0000, 0x783f, 0x0000, 0x7843, 0x0000, + 0x7847, 0x0000, 0x003e, 0x080c, 0x95d2, 0x0178, 0x6014, 0x2068, + 0x6020, 0x9086, 0x0003, 0x11b0, 0x6867, 0x0103, 0x6b7a, 0x6877, + 0x0000, 0x080c, 0x50a5, 0x080c, 0x9797, 0x080c, 0x97a3, 0x000e, + 0x0898, 0x7e3a, 0x7e36, 0x012e, 0x00fe, 0x00de, 0x00ce, 0x006e, + 0x000e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118, 0x080c, 0xaa84, + 0x0c60, 0x0c10, 0x0016, 0x0026, 0x0086, 0x2041, 0x0000, 0x0099, + 0x080c, 0x6a8c, 0x008e, 0x002e, 0x001e, 0x0005, 0x00f6, 0x0126, + 0x2079, 0x12dc, 0x2091, 0x8000, 0x080c, 0x6b19, 0x080c, 0x6b8b, + 0x012e, 0x00fe, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, + 0x0016, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x12dc, 0x7614, + 0x2660, 0x2678, 0x8cff, 0x0904, 0x6a68, 0x6010, 0x9080, 0x0028, + 0x2004, 0x9206, 0x1904, 0x6a63, 0x88ff, 0x0120, 0x6054, 0x9106, + 0x1904, 0x6a63, 0x7024, 0x9c06, 0x1538, 0x2069, 0x0100, 0x68c0, + 0x9005, 0x01f0, 0x080c, 0x65cf, 0x080c, 0x7721, 0x68c3, 0x0000, + 0x080c, 0x7b56, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, + 0x9384, 0x1000, 0x0120, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, + 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0020, + 0x6003, 0x0009, 0x630a, 0x04b8, 0x7014, 0x9c36, 0x1110, 0x660c, + 0x7616, 0x7010, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, + 0x7012, 0x0010, 0x7013, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, + 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2068, + 0x080c, 0x95d2, 0x0188, 0x6020, 0x9086, 0x0003, 0x1510, 0x6867, + 0x0103, 0x6b7a, 0x6877, 0x0000, 0x080c, 0x9843, 0x080c, 0xad5f, + 0x080c, 0x50a5, 0x080c, 0x9797, 0x080c, 0x97a3, 0x080c, 0x7a3e, + 0x00ce, 0x0804, 0x69f2, 0x2c78, 0x600c, 0x2060, 0x0804, 0x69f2, + 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, + 0x0005, 0x6020, 0x9086, 0x0006, 0x1128, 0x080c, 0xad5f, 0x080c, + 0xaa84, 0x0c10, 0x6020, 0x9086, 0x0002, 0x1128, 0x6004, 0x9086, + 0x0085, 0x0968, 0x08c8, 0x6020, 0x9086, 0x0005, 0x19a8, 0x6004, + 0x9086, 0x0085, 0x0d50, 0x0880, 0x00c6, 0x0006, 0x0126, 0x2091, + 0x8000, 0x9280, 0x1000, 0x2004, 0x9065, 0x0904, 0x6b15, 0x00f6, + 0x00e6, 0x00d6, 0x0066, 0x2071, 0x12dc, 0x6654, 0x7018, 0x9c06, + 0x1108, 0x761a, 0x701c, 0x9c06, 0x1130, 0x86ff, 0x1118, 0x7018, + 0x701e, 0x0008, 0x761e, 0x6058, 0x907d, 0x0108, 0x7e56, 0x96ed, + 0x0000, 0x0110, 0x2f00, 0x685a, 0x6057, 0x0000, 0x605b, 0x0000, + 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x080c, 0x4a97, 0x0904, 0x6b11, + 0x7624, 0x86ff, 0x05e8, 0x9680, 0x0005, 0x2004, 0x9d06, 0x15c0, + 0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0548, 0x080c, 0x65cf, + 0x080c, 0x7721, 0x68c3, 0x0000, 0x080c, 0x7b56, 0x7027, 0x0000, + 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0120, 0x6803, + 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, + 0x6827, 0x0001, 0x003e, 0x00de, 0x00c6, 0x603c, 0x9005, 0x0110, + 0x8001, 0x603e, 0x2660, 0x080c, 0x97a3, 0x00ce, 0x0048, 0x00de, + 0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x6abc, + 0x8dff, 0x0158, 0x6867, 0x0103, 0x6b7a, 0x6877, 0x0000, 0x080c, + 0x9843, 0x080c, 0xad5f, 0x080c, 0x50a5, 0x080c, 0x7a3e, 0x0804, + 0x6abc, 0x006e, 0x00de, 0x00ee, 0x00fe, 0x012e, 0x000e, 0x00ce, + 0x0005, 0x0006, 0x0066, 0x00c6, 0x00d6, 0x2031, 0x0000, 0x7814, + 0x9065, 0x0904, 0x6b6b, 0x600c, 0x0006, 0x600f, 0x0000, 0x7824, + 0x9c06, 0x1540, 0x2069, 0x0100, 0x68c0, 0x9005, 0x01f0, 0x080c, + 0x65cf, 0x080c, 0x7721, 0x68c3, 0x0000, 0x080c, 0x7b56, 0x7827, + 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0120, + 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, + 0x0110, 0x6827, 0x0001, 0x003e, 0x0028, 0x6003, 0x0009, 0x630a, + 0x2c30, 0x00b0, 0x6014, 0x2068, 0x080c, 0x95d2, 0x0168, 0x6020, + 0x9086, 0x0003, 0x11b8, 0x6867, 0x0103, 0x6b7a, 0x6877, 0x0000, + 0x080c, 0x50a5, 0x080c, 0x9797, 0x080c, 0x97a3, 0x080c, 0x7a3e, + 0x000e, 0x0804, 0x6b20, 0x7e16, 0x7e12, 0x00de, 0x00ce, 0x006e, + 0x000e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118, 0x080c, 0xaa84, + 0x0c58, 0x6020, 0x9086, 0x0002, 0x1128, 0x6004, 0x9086, 0x0085, + 0x09d0, 0x0c10, 0x6020, 0x9086, 0x0005, 0x19f0, 0x6004, 0x9086, + 0x0085, 0x0d60, 0x08c8, 0x0006, 0x0066, 0x00c6, 0x00d6, 0x7818, + 0x9065, 0x0904, 0x6bf1, 0x6054, 0x0006, 0x6057, 0x0000, 0x605b, + 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x080c, 0x4a97, 0x0904, + 0x6bee, 0x7e24, 0x86ff, 0x05e8, 0x9680, 0x0005, 0x2004, 0x9d06, + 0x15c0, 0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0548, 0x080c, + 0x65cf, 0x080c, 0x7721, 0x68c3, 0x0000, 0x080c, 0x7b56, 0x7827, + 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0120, + 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, + 0x0110, 0x6827, 0x0001, 0x003e, 0x00de, 0x00c6, 0x603c, 0x9005, + 0x0110, 0x8001, 0x603e, 0x2660, 0x080c, 0x97a3, 0x00ce, 0x0048, + 0x00de, 0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, + 0x6b9d, 0x8dff, 0x0138, 0x6867, 0x0103, 0x6b7a, 0x6877, 0x0000, + 0x080c, 0x50a5, 0x080c, 0x7a3e, 0x0804, 0x6b9d, 0x000e, 0x0804, + 0x6b90, 0x781e, 0x781a, 0x00de, 0x00ce, 0x006e, 0x000e, 0x0005, + 0x00e6, 0x00d6, 0x0066, 0x6000, 0xd0dc, 0x0188, 0x604c, 0x906d, + 0x0170, 0x6878, 0x9606, 0x1158, 0x2071, 0x12dc, 0x7024, 0x9035, + 0x0130, 0x9080, 0x0005, 0x2004, 0x9d06, 0x1108, 0x0021, 0x006e, + 0x00de, 0x00ee, 0x0005, 0x00f6, 0x2079, 0x0100, 0x78c0, 0x9005, + 0x1138, 0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x04a0, + 0x080c, 0x7721, 0x78c3, 0x0000, 0x080c, 0x7b56, 0x7027, 0x0000, + 0x0036, 0x2079, 0x0140, 0x7b04, 0x9384, 0x1000, 0x0120, 0x7803, + 0x0100, 0x7803, 0x0000, 0x2079, 0x0100, 0x7824, 0xd084, 0x0110, + 0x7827, 0x0001, 0x080c, 0x7b56, 0x003e, 0x080c, 0x4a97, 0x00c6, + 0x603c, 0x9005, 0x0110, 0x8001, 0x603e, 0x2660, 0x080c, 0x7f1e, + 0x00ce, 0x6867, 0x0103, 0x6b7a, 0x6877, 0x0000, 0x080c, 0x9843, + 0x080c, 0x50a5, 0x080c, 0x7a3e, 0x00fe, 0x0005, 0x00e6, 0x00c6, + 0x2001, 0x110c, 0x2014, 0xc2e4, 0x2202, 0x2071, 0x12dc, 0x7004, + 0x9084, 0x0007, 0x0002, 0x6c6d, 0x6c70, 0x6c86, 0x6ca4, 0x6cdd, + 0x6c6d, 0x6c6b, 0x6c6b, 0x080c, 0x0cf1, 0x00ce, 0x00ee, 0x0005, + 0x7024, 0x9065, 0x0148, 0x7020, 0x8001, 0x7022, 0x600c, 0x9015, + 0x0150, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027, 0x0000, + 0x00ce, 0x00ee, 0x0005, 0x7216, 0x7212, 0x0cb0, 0x6010, 0x2060, + 0x080c, 0x4a97, 0x6000, 0xc0dc, 0x6002, 0x7007, 0x0000, 0x7027, + 0x0000, 0x7020, 0x8001, 0x7022, 0x1118, 0x00ce, 0x00ee, 0x0005, + 0x6054, 0x9015, 0x0120, 0x721e, 0x080c, 0x6d42, 0x0cb0, 0x7218, + 0x721e, 0x080c, 0x6d42, 0x0c88, 0x7024, 0x9065, 0x0598, 0x700c, + 0x9c06, 0x1160, 0x080c, 0x7a3e, 0x600c, 0x9015, 0x0120, 0x720e, + 0x600f, 0x0000, 0x0428, 0x720e, 0x720a, 0x0410, 0x7014, 0x9c06, + 0x1160, 0x080c, 0x7a3e, 0x600c, 0x9015, 0x0120, 0x7216, 0x600f, + 0x0000, 0x00b0, 0x7216, 0x7212, 0x0098, 0x6010, 0x2060, 0x080c, + 0x4a97, 0x6000, 0xc0dc, 0x6002, 0x080c, 0x7a3e, 0x701c, 0x9065, + 0x0138, 0x6054, 0x9015, 0x0110, 0x721e, 0x0010, 0x7218, 0x721e, + 0x7027, 0x0000, 0x00ce, 0x00ee, 0x0005, 0x7024, 0x9065, 0x0140, + 0x080c, 0x7a3e, 0x600c, 0x9015, 0x0150, 0x720e, 0x600f, 0x0000, + 0x080c, 0x7b56, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x0005, 0x720e, + 0x720a, 0x0cb0, 0x00d6, 0x2069, 0x12dc, 0x6830, 0x9084, 0x0003, + 0x0002, 0x6cff, 0x6d01, 0x6d25, 0x6cfd, 0x080c, 0x0cf1, 0x00de, + 0x0005, 0x00c6, 0x6840, 0x9086, 0x0001, 0x01b8, 0x683c, 0x9065, + 0x0130, 0x600c, 0x9015, 0x0170, 0x6a3a, 0x600f, 0x0000, 0x6833, + 0x0000, 0x683f, 0x0000, 0x2011, 0x12fb, 0x2013, 0x0000, 0x00ce, + 0x00de, 0x0005, 0x683a, 0x6836, 0x0c90, 0x6843, 0x0000, 0x6838, + 0x9065, 0x0d68, 0x6003, 0x0003, 0x0c50, 0x00c6, 0x6843, 0x0000, + 0x6847, 0x0000, 0x683c, 0x9065, 0x0168, 0x600c, 0x9015, 0x0130, + 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000, 0x0020, 0x683f, 0x0000, + 0x683a, 0x6836, 0x00ce, 0x00de, 0x0005, 0xc1e5, 0x2001, 0x110c, + 0x2102, 0x0005, 0x2001, 0x110c, 0x200c, 0xd1ec, 0x0138, 0xc1ec, + 0x2102, 0x080c, 0x6e10, 0x2001, 0x110c, 0x200c, 0x9184, 0x0600, + 0x9086, 0x0600, 0x0d50, 0x00d6, 0x2069, 0x12dc, 0x6804, 0x9084, + 0x0007, 0x0002, 0x6d64, 0x6def, 0x6def, 0x6def, 0x6def, 0x6df1, + 0x6d62, 0x6d62, 0x080c, 0x0cf1, 0x6820, 0x9005, 0x1110, 0x00de, + 0x0005, 0x00c6, 0x680c, 0x9065, 0x0150, 0x6807, 0x0004, 0x6826, + 0x682b, 0x0000, 0x080c, 0x6e53, 0x00ce, 0x00de, 0x0005, 0x6814, + 0x9065, 0x0150, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x080c, + 0x6e53, 0x00ce, 0x00de, 0x0005, 0x00e6, 0x6a1c, 0x92f5, 0x0000, + 0x0904, 0x6dec, 0x704c, 0x900d, 0x0118, 0x7088, 0x9005, 0x01a0, + 0x7054, 0x9075, 0x0120, 0x920e, 0x0904, 0x6dec, 0x0028, 0x6818, + 0x920e, 0x0904, 0x6dec, 0x2070, 0x704c, 0x900d, 0x0d88, 0x7088, + 0x9005, 0x1d70, 0x2e00, 0x681e, 0x733c, 0x7038, 0x9302, 0x1e40, + 0x080c, 0x7ef5, 0x0904, 0x6dec, 0x8318, 0x733e, 0x6116, 0x2e10, + 0x6212, 0x9180, 0x0020, 0x2004, 0x9084, 0x00ff, 0x605e, 0x9180, + 0x0020, 0x2003, 0x0000, 0x9180, 0x0021, 0x2004, 0x908a, 0x199a, + 0x0210, 0x2001, 0x1999, 0x8003, 0x801b, 0x831b, 0x9318, 0x631a, + 0x00f6, 0x2c78, 0x2061, 0x0100, 0x609b, 0x0000, 0x00d6, 0x00e6, + 0x2069, 0x0200, 0x2071, 0x0240, 0x080c, 0x738a, 0x00ee, 0x00de, + 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, + 0x0000, 0x7823, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040, 0x00fe, + 0x00ee, 0x00ce, 0x00de, 0x0005, 0x00ee, 0x00ce, 0x0cd8, 0x00de, + 0x0005, 0x00c6, 0x680c, 0x9065, 0x0138, 0x6807, 0x0004, 0x6826, + 0x682b, 0x0000, 0x080c, 0x6e53, 0x00ce, 0x00de, 0x0005, 0x2001, + 0x110c, 0x2014, 0xc2ed, 0x2202, 0x00de, 0x00fe, 0x0005, 0x2001, + 0x110c, 0x2014, 0xd2e4, 0x0120, 0xc2e4, 0x2202, 0x080c, 0x6d53, + 0x00f6, 0x00d6, 0x2069, 0x12dc, 0x6830, 0x9086, 0x0000, 0x11e0, + 0x2001, 0x110c, 0x200c, 0xd1c4, 0x11d0, 0x6838, 0x907d, 0x01a0, + 0x6a04, 0x9296, 0x0000, 0x19d8, 0x6833, 0x0001, 0x683e, 0x6847, + 0x0000, 0x0126, 0x00f6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1421, + 0x1178, 0x012e, 0x080c, 0x75b1, 0x00de, 0x00fe, 0x0005, 0xc1c4, + 0x2102, 0x0066, 0x2031, 0x0001, 0x080c, 0x57d6, 0x006e, 0x08e8, + 0x012e, 0x6843, 0x0000, 0x7803, 0x0002, 0x780c, 0x9015, 0x0140, + 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c20, + 0x683a, 0x6836, 0x0cc0, 0x6020, 0x9084, 0x000f, 0x000b, 0x0005, + 0x6e66, 0x6e6b, 0x7280, 0x733f, 0x6e6b, 0x7280, 0x733f, 0x6e66, + 0x6e6b, 0x6e66, 0x6e66, 0x6e66, 0x6e66, 0x6e66, 0x080c, 0x6c56, + 0x080c, 0x6d42, 0x0005, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, + 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, + 0x6004, 0x908a, 0x004c, 0x1a0c, 0x0cf1, 0x6110, 0x2178, 0x79a0, + 0x2011, 0x1133, 0x2214, 0xd2ac, 0x1110, 0xd1bc, 0x0150, 0x7900, + 0xd1f4, 0x0120, 0x7914, 0x918c, 0x00ff, 0x0040, 0x2009, 0x0000, + 0x0028, 0x91f8, 0x26c1, 0x2f0d, 0x918c, 0x00ff, 0x2c78, 0x2061, + 0x0100, 0x619a, 0x908a, 0x0040, 0x1a04, 0x6eeb, 0x0053, 0x00fe, + 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, + 0x0005, 0x6fc3, 0x7004, 0x7033, 0x70d5, 0x70f8, 0x70fe, 0x710c, + 0x7115, 0x7122, 0x7128, 0x713a, 0x7128, 0x718a, 0x7115, 0x7197, + 0x719d, 0x7122, 0x719d, 0x71aa, 0x6ee9, 0x6ee9, 0x6ee9, 0x6ee9, + 0x6ee9, 0x6ee9, 0x6ee9, 0x6ee9, 0x6ee9, 0x6ee9, 0x6ee9, 0x7802, + 0x7819, 0x7824, 0x7845, 0x7867, 0x710c, 0x6ee9, 0x710c, 0x7128, + 0x6ee9, 0x7033, 0x70d5, 0x6ee9, 0x7c3b, 0x7128, 0x6ee9, 0x7c57, + 0x7128, 0x6ee9, 0x7122, 0x6fbc, 0x6f05, 0x6ee9, 0x7c6e, 0x7cdb, + 0x7db2, 0x6ee9, 0x7dbf, 0x7109, 0x7dd5, 0x6ee9, 0x7872, 0x7e0f, + 0x6ee9, 0x080c, 0x0cf1, 0x2100, 0x0053, 0x00fe, 0x00ee, 0x00de, + 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x0005, 0x6f03, + 0x6f03, 0x6f03, 0x6f2b, 0x6f45, 0x6f55, 0x6f03, 0x6f03, 0x6f03, + 0x6f8e, 0x6f9d, 0x6f03, 0x080c, 0x0cf1, 0x00d6, 0x080c, 0x71be, + 0x7003, 0x2414, 0x7007, 0x0018, 0x700b, 0x0800, 0x7814, 0x2068, + 0x683c, 0x700e, 0x6850, 0x7022, 0x6854, 0x7026, 0x60c3, 0x0018, + 0x080c, 0x76f5, 0x00de, 0x0005, 0x00d6, 0x7810, 0x2068, 0x68a0, + 0x2069, 0x1100, 0x6acc, 0xd2ac, 0x1110, 0xd0bc, 0x0110, 0x9085, + 0x0001, 0x00de, 0x0005, 0x00d6, 0x080c, 0x71be, 0x7003, 0x0500, + 0x7814, 0x90e8, 0x001b, 0x6808, 0x700a, 0x680c, 0x700e, 0x6810, + 0x7012, 0x6814, 0x7016, 0x6818, 0x701a, 0x681c, 0x701e, 0x60c3, + 0x0010, 0x080c, 0x76f5, 0x00de, 0x0005, 0x080c, 0x71be, 0x7003, + 0x7800, 0x7007, 0x0000, 0x7808, 0x8007, 0x700a, 0x700f, 0x0000, + 0x60c3, 0x0008, 0x080c, 0x76f5, 0x0005, 0x00d6, 0x00e6, 0x080c, + 0x7234, 0x2073, 0x0200, 0x8e70, 0x2073, 0x0000, 0x8e70, 0x2073, + 0xdf10, 0x8e70, 0x2073, 0x0034, 0x8e70, 0x2069, 0x1105, 0x20a9, + 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x6f69, 0x2069, 0x1101, + 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x6f72, 0x2069, + 0x12c2, 0x20a9, 0x001a, 0x2d04, 0x8007, 0x2072, 0x8d68, 0x8e70, + 0x1f04, 0x6f7b, 0x2073, 0x0000, 0x8e70, 0x2073, 0x0000, 0x60c3, + 0x004c, 0x080c, 0x76f5, 0x00ee, 0x00de, 0x0005, 0x080c, 0x71be, + 0x7003, 0x6300, 0x7007, 0x0028, 0x700b, 0x0000, 0x7808, 0x700e, + 0x60c3, 0x0008, 0x080c, 0x76f5, 0x0005, 0x00d6, 0x0026, 0x0016, + 0x080c, 0x7234, 0x7003, 0x0200, 0x7814, 0x700e, 0x00e6, 0x9ef0, + 0x0004, 0x2009, 0x0001, 0x2011, 0x000c, 0x2073, 0x0800, 0x8e70, + 0x2073, 0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c, 0x76f5, + 0x001e, 0x002e, 0x00de, 0x0005, 0x2001, 0x1114, 0x2004, 0x609a, + 0x080c, 0x76f5, 0x0005, 0x080c, 0x71be, 0x7003, 0x5200, 0x2069, + 0x1152, 0x6804, 0xd084, 0x0130, 0x6828, 0x0016, 0x080c, 0x1c7d, + 0x710e, 0x001e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1105, + 0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004, 0x2099, + 0x1101, 0x20a1, 0x0254, 0x4003, 0x2001, 0x1133, 0x2004, 0xd0ac, + 0x1138, 0x7810, 0x9080, 0x0028, 0x2004, 0x9082, 0x007f, 0x0248, + 0x2001, 0x111b, 0x2004, 0x7032, 0x2001, 0x111c, 0x2004, 0x7036, + 0x0030, 0x2001, 0x1114, 0x2004, 0x9084, 0x00ff, 0x7036, 0x60c3, + 0x001c, 0x080c, 0x76f5, 0x0005, 0x080c, 0x71be, 0x7003, 0x0500, + 0x2001, 0x1133, 0x2004, 0xd0ac, 0x1138, 0x7810, 0x9080, 0x0028, + 0x2004, 0x9082, 0x007f, 0x0248, 0x2001, 0x111b, 0x2004, 0x700a, + 0x2001, 0x111c, 0x2004, 0x700e, 0x0030, 0x2001, 0x1114, 0x2004, + 0x9084, 0x00ff, 0x700e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, + 0x1105, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003, 0x60c3, 0x0010, + 0x080c, 0x76f5, 0x0005, 0x080c, 0x71be, 0x00c6, 0x7810, 0x2060, + 0x2001, 0x0000, 0x080c, 0x4dea, 0x00ce, 0x7810, 0x9080, 0x0028, + 0x2004, 0x9086, 0x007e, 0x1130, 0x7003, 0x0400, 0x620c, 0xc2b4, + 0x620e, 0x0010, 0x7003, 0x0300, 0x7810, 0x9080, 0x0028, 0x2004, + 0x9086, 0x007e, 0x1904, 0x70a1, 0x00d6, 0x2069, 0x127f, 0x2001, + 0x1133, 0x2004, 0xd0a4, 0x0178, 0x6800, 0x700a, 0x6808, 0x9084, + 0x2000, 0x7012, 0x680c, 0x7016, 0x701f, 0x2710, 0x6818, 0x7022, + 0x681c, 0x7026, 0x0080, 0x6800, 0x700a, 0x6804, 0x700e, 0x6808, + 0x080c, 0x5745, 0x1118, 0x9084, 0x37ff, 0x0010, 0x9084, 0x3fff, + 0x7012, 0x680c, 0x7016, 0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001, + 0x2099, 0x1105, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9, + 0x0004, 0x2099, 0x1101, 0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, + 0x7e86, 0x2069, 0x1287, 0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002, + 0x2001, 0x1172, 0x2004, 0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de, + 0x0478, 0x2001, 0x1133, 0x2004, 0xd0a4, 0x0140, 0x2001, 0x1280, + 0x2004, 0x60e3, 0x0000, 0x080c, 0x1cbe, 0x60e2, 0x20e1, 0x0001, + 0x2099, 0x127f, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x20a9, 0x0008, + 0x4003, 0x20a9, 0x0004, 0x2099, 0x1105, 0x20a1, 0x0256, 0x4003, + 0x20a9, 0x0004, 0x2099, 0x1101, 0x20a1, 0x025a, 0x4003, 0x080c, + 0x7e86, 0x20a1, 0x024e, 0x20a9, 0x0008, 0x2099, 0x1287, 0x4003, + 0x60c3, 0x0074, 0x080c, 0x76f5, 0x0005, 0x080c, 0x71be, 0x7003, + 0x2010, 0x7007, 0x0014, 0x700b, 0x0800, 0x700f, 0x2000, 0x9006, + 0x00f6, 0x2079, 0x1152, 0x7904, 0x00fe, 0xd1ac, 0x1110, 0x9085, + 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010, 0x9085, 0x0002, 0x00d6, + 0x0804, 0x716e, 0x7026, 0x60c3, 0x0014, 0x080c, 0x76f5, 0x0005, + 0x080c, 0x71be, 0x7003, 0x5000, 0x0804, 0x704c, 0x080c, 0x71be, + 0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x080c, 0x76f5, + 0x0005, 0x080c, 0x722b, 0x0010, 0x080c, 0x7234, 0x7003, 0x0200, + 0x60c3, 0x0004, 0x080c, 0x76f5, 0x0005, 0x080c, 0x7234, 0x7003, + 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x080c, + 0x76f5, 0x0005, 0x080c, 0x7234, 0x7003, 0x0200, 0x0804, 0x704c, + 0x080c, 0x7234, 0x7003, 0x0100, 0x782c, 0x9005, 0x0110, 0x700a, + 0x0010, 0x700b, 0x0003, 0x7814, 0x700e, 0x60c3, 0x0008, 0x080c, + 0x76f5, 0x0005, 0x00d6, 0x080c, 0x7234, 0x7003, 0x0210, 0x7007, + 0x0014, 0x700b, 0x0800, 0x7810, 0x2068, 0x6894, 0x9086, 0x0014, + 0x1178, 0x6998, 0x9184, 0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f, + 0x2100, 0x0040, 0x700f, 0x0100, 0x0028, 0x700f, 0x0400, 0x0010, + 0x700f, 0x0700, 0x00f6, 0x2079, 0x1152, 0x7904, 0x00fe, 0xd1ac, + 0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010, 0x2009, + 0x1174, 0x210c, 0xd184, 0x1110, 0x9085, 0x0002, 0x0026, 0x2009, + 0x1172, 0x210c, 0xd1e4, 0x0130, 0xc0c5, 0x9094, 0x0030, 0x9296, + 0x0010, 0x0140, 0xd1ec, 0x0130, 0x9094, 0x0030, 0x9296, 0x0010, + 0x0108, 0xc0bd, 0x002e, 0x7026, 0x60c3, 0x0014, 0x00de, 0x080c, + 0x76f5, 0x0005, 0x080c, 0x7234, 0x7003, 0x0210, 0x7007, 0x0014, + 0x700f, 0x0100, 0x60c3, 0x0014, 0x080c, 0x76f5, 0x0005, 0x080c, + 0x7234, 0x7003, 0x0200, 0x0804, 0x6fc7, 0x080c, 0x7234, 0x7003, + 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x080c, + 0x76f5, 0x0005, 0x080c, 0x7234, 0x7003, 0x0100, 0x700b, 0x000b, + 0x60c3, 0x0008, 0x080c, 0x76f5, 0x0005, 0x0026, 0x00d6, 0x0036, + 0x0046, 0x2019, 0x3200, 0x2021, 0x0800, 0x0040, 0x0026, 0x00d6, + 0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100, 0x080c, 0x7e9b, + 0x7810, 0x2068, 0x6810, 0x9305, 0x7002, 0x6814, 0x7006, 0x6aa0, + 0x2069, 0x1100, 0x6850, 0x700e, 0x9286, 0x007e, 0x1168, 0x9385, + 0x00ff, 0x7002, 0x7007, 0xfffe, 0x2001, 0x128f, 0x2004, 0x9005, + 0x01e8, 0x6a70, 0x720e, 0x00d0, 0x9286, 0x007f, 0x1130, 0x9385, + 0x00ff, 0x7002, 0x7007, 0xfffd, 0x0068, 0x68cc, 0xd0ac, 0x1110, + 0xd2bc, 0x0160, 0x9286, 0x0080, 0x1128, 0x9385, 0x00ff, 0x7002, + 0x7007, 0xfffc, 0x686c, 0x700a, 0x6870, 0x700e, 0x9485, 0x0029, + 0x7012, 0x004e, 0x003e, 0x00de, 0x080c, 0x76e4, 0x721a, 0x9f95, + 0x0000, 0x7222, 0x7027, 0xffff, 0x2071, 0x024c, 0x002e, 0x0005, + 0x0026, 0x080c, 0x7e9b, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, + 0x2069, 0x1100, 0x686c, 0x700a, 0x6870, 0x700e, 0x00de, 0x7013, + 0x2029, 0x0c10, 0x7003, 0x0100, 0x7007, 0x0000, 0x700b, 0xfc02, + 0x700f, 0x0000, 0x0005, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, + 0x3300, 0x2021, 0x0800, 0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, + 0x2019, 0x2300, 0x2021, 0x0100, 0x080c, 0x7e9b, 0x7810, 0x2068, + 0x6810, 0x9305, 0x7002, 0x6814, 0x7006, 0x68a0, 0x2069, 0x1100, + 0x6a50, 0x720e, 0x6acc, 0xd2ac, 0x1118, 0x9092, 0x007e, 0x02a0, + 0x7810, 0x00c6, 0x2060, 0x6010, 0x9005, 0x1140, 0x6014, 0x9005, + 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020, 0x686c, 0x700a, + 0x6870, 0x700e, 0x00ce, 0x0000, 0x9485, 0x0098, 0x7012, 0x004e, + 0x003e, 0x00de, 0x080c, 0x76e4, 0x721a, 0x7a08, 0x7222, 0x2f10, + 0x7226, 0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0x76e4, 0x721a, + 0x7a08, 0x7222, 0x7814, 0x7026, 0x2071, 0x024c, 0x002e, 0x0005, + 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, + 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0cf1, 0x908a, 0x0090, 0x1a0c, + 0x0cf1, 0x6110, 0x2178, 0x79a0, 0x2011, 0x1133, 0x2214, 0xd2ac, + 0x1110, 0xd1bc, 0x0150, 0x7900, 0xd1f4, 0x0120, 0x7914, 0x918c, + 0x00ff, 0x0040, 0x2009, 0x0000, 0x0028, 0x91f8, 0x26c1, 0x2f0d, + 0x918c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0x9082, 0x0085, + 0x002b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x72c3, 0x72c9, + 0x72d5, 0x72c1, 0x72c1, 0x72c1, 0x72c3, 0x72c1, 0x72c1, 0x72c1, + 0x72c1, 0x080c, 0x0cf1, 0x00e1, 0x60c3, 0x0000, 0x080c, 0x76f5, + 0x0005, 0x04a9, 0x7808, 0x700a, 0x7814, 0x700e, 0x7017, 0xffff, + 0x60c3, 0x000c, 0x080c, 0x76f5, 0x0005, 0x080c, 0x731f, 0x7003, + 0x0003, 0x7007, 0x0300, 0x60c3, 0x0004, 0x080c, 0x76f5, 0x0005, + 0x0026, 0x080c, 0x7e9b, 0x7810, 0x2068, 0x6810, 0x9085, 0x8100, + 0x7002, 0x6814, 0x7006, 0x68a0, 0x2069, 0x1100, 0x6acc, 0xd2ac, + 0x1118, 0x9092, 0x007e, 0x0240, 0x686c, 0x700a, 0x6870, 0x700e, + 0x7013, 0x0009, 0x0804, 0x7204, 0x6a50, 0x720e, 0x0cc8, 0x0026, + 0x080c, 0x7e9b, 0x7810, 0x2068, 0x6810, 0x9085, 0x8400, 0x7002, + 0x6814, 0x7006, 0x68a0, 0x2069, 0x1100, 0x6acc, 0xd2ac, 0x1118, + 0x9092, 0x007e, 0x0248, 0x686c, 0x700a, 0x6870, 0x700e, 0x2001, + 0x0099, 0x7012, 0x0804, 0x7275, 0x6a50, 0x720e, 0x0cc0, 0x0026, + 0x080c, 0x7e9b, 0x7810, 0x2068, 0x6810, 0x9085, 0x8500, 0x7002, + 0x6814, 0x7006, 0x68a0, 0x2069, 0x1100, 0x6acc, 0xd2ac, 0x1118, + 0x9092, 0x007e, 0x0248, 0x686c, 0x700a, 0x6870, 0x700e, 0x2001, + 0x0099, 0x7012, 0x0804, 0x7275, 0x6a50, 0x720e, 0x0cc0, 0x00c6, + 0x00d6, 0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071, 0x0240, + 0x7804, 0x908a, 0x0040, 0x0a0c, 0x0cf1, 0x908a, 0x0054, 0x1a0c, + 0x0cf1, 0x7910, 0x2160, 0x61a0, 0x2011, 0x1133, 0x2214, 0xd2ac, + 0x1110, 0xd1bc, 0x0150, 0x6100, 0xd1f4, 0x0120, 0x6114, 0x918c, + 0x00ff, 0x0040, 0x2009, 0x0000, 0x0028, 0x91e0, 0x26c1, 0x2c0d, + 0x918c, 0x00ff, 0x2061, 0x0100, 0x619a, 0x9082, 0x0040, 0x002b, + 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x738a, 0x7448, 0x740f, + 0x7550, 0x7388, 0x7388, 0x7388, 0x7388, 0x7388, 0x7388, 0x7388, + 0x7a1a, 0x7a22, 0x7a2a, 0x7a32, 0x7388, 0x7de2, 0x7388, 0x7a12, + 0x080c, 0x0cf1, 0x780b, 0xffff, 0x080c, 0x73dd, 0x7914, 0x2168, + 0x6978, 0x7956, 0x7132, 0x697c, 0x9184, 0x000f, 0x1118, 0x2001, + 0x0005, 0x0040, 0xd184, 0x0118, 0x2001, 0x0004, 0x0018, 0x9084, + 0x0006, 0x8004, 0x2010, 0x785c, 0x9084, 0x00ff, 0x8007, 0x9205, + 0x7042, 0xd1ac, 0x0128, 0x7047, 0x0002, 0x080c, 0x119d, 0x0050, + 0xd1b4, 0x0118, 0x7047, 0x0001, 0x0028, 0x7047, 0x0000, 0x9016, + 0x2230, 0x0010, 0x6ab0, 0x6eac, 0x726a, 0x766e, 0x20a9, 0x0008, + 0x9d88, 0x0023, 0x20e1, 0x0001, 0x2198, 0x20e9, 0x0000, 0x20a1, + 0x0252, 0x2069, 0x0200, 0x6813, 0x0018, 0x4003, 0x6813, 0x0008, + 0x60c3, 0x0020, 0x6017, 0x0009, 0x2001, 0x12f8, 0x2003, 0x07d0, + 0x2001, 0x12f7, 0x2003, 0x0009, 0x0005, 0x00d6, 0x6813, 0x0008, + 0x7a10, 0x2268, 0x6a8c, 0x8210, 0x9294, 0x00ff, 0x6a8e, 0x8217, + 0x721a, 0x6a10, 0x9295, 0x0600, 0x7202, 0x6a14, 0x7206, 0x68a0, + 0x6900, 0x2069, 0x1100, 0x6bcc, 0xd3ac, 0x1138, 0xd0bc, 0x0188, + 0xd1f4, 0x0118, 0x9294, 0x00ff, 0x629a, 0x6a6c, 0x720a, 0x6a70, + 0x720e, 0x7013, 0x0829, 0x2f10, 0x7222, 0x7027, 0xffff, 0x00de, + 0x0005, 0x9294, 0x00ff, 0x629a, 0x6a50, 0x720e, 0x0c90, 0x00d6, + 0x0081, 0x7814, 0x2068, 0x6890, 0x7002, 0x688c, 0x7006, 0x68b0, + 0x700a, 0x68ac, 0x700e, 0x60c3, 0x000c, 0x00de, 0x080c, 0x76f5, + 0x0005, 0x00d6, 0x6813, 0x0008, 0x7810, 0x2068, 0x6810, 0x9085, + 0x0500, 0x7002, 0x6814, 0x7006, 0x68a0, 0x2069, 0x1100, 0x6acc, + 0xd2ac, 0x1110, 0xd0bc, 0x0188, 0x686c, 0x700a, 0x6870, 0x700e, + 0x7013, 0x0889, 0x080c, 0x76e4, 0x721a, 0x7a08, 0x7222, 0x2f10, + 0x7226, 0x2071, 0x024c, 0x00de, 0x0005, 0x6a50, 0x720e, 0x0c80, + 0x00d6, 0x080c, 0x7523, 0x7814, 0x2068, 0x7814, 0x9084, 0xf000, + 0x1130, 0x7814, 0x9084, 0x0700, 0x8007, 0x002b, 0x0010, 0x9006, + 0x0013, 0x00de, 0x0005, 0x7465, 0x74bd, 0x74c6, 0x74de, 0x74eb, + 0x74fd, 0x7505, 0x7463, 0x080c, 0x0cf1, 0x0016, 0x0036, 0x697c, + 0x918c, 0x0003, 0x0118, 0x9186, 0x0003, 0x11a0, 0x6ba8, 0x7824, + 0xd0cc, 0x1170, 0x7316, 0x6898, 0x701a, 0x6894, 0x701e, 0x003e, + 0x001e, 0x2001, 0x12c0, 0x2004, 0x60c2, 0x080c, 0x76f5, 0x0005, + 0xc3e5, 0x0c80, 0x9186, 0x0001, 0x190c, 0x0cf1, 0x6ba8, 0x7824, + 0xd0cc, 0x1588, 0x7316, 0x6898, 0x701a, 0x6894, 0x701e, 0x68a4, + 0x7026, 0x68ac, 0x702e, 0x2009, 0x0018, 0x9384, 0x0300, 0x01e8, + 0xd3c4, 0x0110, 0x68ac, 0x9108, 0xd3cc, 0x0110, 0x68a4, 0x9108, + 0x2011, 0x0258, 0x0156, 0x20a9, 0x000d, 0x9d80, 0x002c, 0x201c, + 0x831f, 0x2312, 0x8000, 0x8210, 0x1f04, 0x74a7, 0x015e, 0x9184, + 0x0003, 0x0118, 0x2019, 0x0245, 0x201a, 0x61c2, 0x003e, 0x001e, + 0x080c, 0x76f5, 0x0005, 0xc3e5, 0x0868, 0x2011, 0x0008, 0x7824, + 0xd0cc, 0x1110, 0x7216, 0x0400, 0x0ce8, 0xc2e5, 0x2011, 0x0302, + 0x7824, 0xd0cc, 0x0108, 0xc2e5, 0x7216, 0x7027, 0x0012, 0x702f, + 0x0008, 0x7043, 0x7000, 0x7047, 0x0500, 0x704f, 0x000a, 0x705b, + 0x2500, 0x60c3, 0x0032, 0x080c, 0x76f5, 0x0005, 0x2011, 0x0028, + 0x7824, 0xd0cc, 0x1130, 0x7216, 0x60c3, 0x0018, 0x080c, 0x76f5, + 0x0005, 0x0cc8, 0xc2e5, 0x2011, 0x0100, 0x7824, 0xd0cc, 0x0108, + 0xc2e5, 0x7216, 0x702f, 0x0008, 0x7858, 0x9084, 0x00ff, 0x7036, + 0x60c3, 0x0020, 0x080c, 0x76f5, 0x0005, 0x2011, 0x0008, 0x7824, + 0xd0cc, 0x0108, 0xc2e5, 0x7216, 0x08f8, 0x0036, 0x7b14, 0x9384, + 0xff00, 0x7816, 0x9384, 0x00ff, 0x8001, 0x1138, 0x7824, 0xd0cc, + 0x0108, 0xc2e5, 0x7216, 0x003e, 0x0878, 0x0046, 0x2021, 0x0800, + 0x0006, 0x7824, 0xd0cc, 0x000e, 0x0108, 0xc4e5, 0x7416, 0x004e, + 0x701e, 0x003e, 0x0808, 0x00d6, 0x6813, 0x0008, 0x7a10, 0x2268, + 0x6810, 0x9085, 0x0700, 0x7002, 0x6814, 0x7006, 0x68a0, 0x2069, + 0x1100, 0x6acc, 0xd2ac, 0x1110, 0xd0bc, 0x01a0, 0x686c, 0x700a, + 0x6870, 0x700e, 0x7824, 0xd0cc, 0x1180, 0x7013, 0x0898, 0x080c, + 0x76e4, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c, + 0x00de, 0x0005, 0x6a50, 0x720e, 0x0c68, 0x7013, 0x0889, 0x0c78, + 0x0016, 0x7814, 0x9084, 0x0700, 0x8007, 0x0013, 0x001e, 0x0005, + 0x7560, 0x7560, 0x7562, 0x7560, 0x7560, 0x7560, 0x757f, 0x7560, + 0x080c, 0x0cf1, 0x7914, 0x918c, 0xf8ff, 0x918d, 0x0600, 0x7916, + 0x2009, 0x0003, 0x00d1, 0x00d6, 0x2069, 0x1152, 0x6804, 0xd0bc, + 0x0130, 0x682c, 0x9084, 0x00ff, 0x8007, 0x7032, 0x0010, 0x7033, + 0x3f00, 0x00de, 0x60c3, 0x0001, 0x080c, 0x76f5, 0x0005, 0x2009, + 0x0003, 0x0019, 0x7033, 0x7f00, 0x0ca8, 0x00d6, 0x0016, 0x080c, + 0x7e9b, 0x001e, 0x7810, 0x2068, 0x6810, 0x9085, 0x0100, 0x7002, + 0x6814, 0x7006, 0x68a0, 0x2069, 0x1100, 0x6acc, 0xd2ac, 0x1110, + 0xd0bc, 0x01a0, 0x6a6c, 0x720a, 0x6a70, 0x720e, 0x7013, 0x0888, + 0x918d, 0x0008, 0x7116, 0x080c, 0x76e4, 0x721a, 0x7a08, 0x7222, + 0x2f10, 0x7226, 0x2071, 0x024c, 0x00de, 0x0005, 0x6a50, 0x720e, + 0x0c68, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046, 0x0036, 0x2061, + 0x0100, 0x2071, 0x1100, 0x7150, 0x7810, 0x2068, 0x68a0, 0x2028, + 0x6910, 0x6a14, 0x76cc, 0xd6ac, 0x1130, 0xd0bc, 0x1120, 0x2019, + 0x0000, 0x7450, 0x0010, 0x736c, 0x7470, 0x7820, 0x90be, 0x0006, + 0x0904, 0x765a, 0x90be, 0x000a, 0x15e8, 0x9185, 0x0200, 0x6062, + 0x6266, 0x636a, 0x646e, 0x6073, 0x2029, 0x6077, 0x0000, 0x688c, + 0x8000, 0x9084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, + 0x2f00, 0x6082, 0x7808, 0x6086, 0x7814, 0x2070, 0x7038, 0x608a, + 0x7034, 0x608e, 0x7048, 0x60c6, 0x7044, 0x60ca, 0x686c, 0x60ce, + 0x60af, 0x95d5, 0x60d7, 0x0000, 0x609f, 0x0000, 0x080c, 0x7e80, + 0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110, 0x2009, + 0x1b58, 0x080c, 0x65d4, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, + 0x00ee, 0x0005, 0x9185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, + 0x6073, 0x0809, 0x6077, 0x0008, 0x688c, 0x8000, 0x9084, 0x00ff, + 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, + 0x6086, 0x7814, 0x2070, 0x7038, 0x608a, 0x7034, 0x608e, 0x7048, + 0x60c6, 0x7044, 0x60ca, 0x686c, 0x60ce, 0x60af, 0x95d5, 0x60d7, + 0x0000, 0x9582, 0x0080, 0x0248, 0x6a00, 0xd2f4, 0x0120, 0x6a14, + 0x9294, 0x00ff, 0x0010, 0x2011, 0x0000, 0x629e, 0x080c, 0x7e80, + 0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110, 0x2009, + 0x1b58, 0x080c, 0x65d4, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, + 0x00ee, 0x0005, 0x7814, 0x2070, 0x707c, 0x9084, 0x0003, 0x9086, + 0x0002, 0x05f0, 0x9185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, + 0x6073, 0x0880, 0x6077, 0x0008, 0x688c, 0x8000, 0x9084, 0x00ff, + 0x688e, 0x8007, 0x607a, 0x7838, 0x607e, 0x2f00, 0x6086, 0x7808, + 0x6082, 0x7090, 0x608a, 0x708c, 0x608e, 0x70b0, 0x60c6, 0x70ac, + 0x60ca, 0x70ac, 0x7930, 0x9108, 0x7932, 0x70b0, 0x792c, 0x9109, + 0x792e, 0x686c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x9582, + 0x0080, 0x0248, 0x6a00, 0xd2f4, 0x0120, 0x6a14, 0x9294, 0x00ff, + 0x0010, 0x2011, 0x0000, 0x629e, 0x080c, 0x7e5b, 0x0804, 0x7648, + 0x9185, 0x0700, 0x6062, 0x6266, 0x636a, 0x646e, 0x7824, 0xd0cc, + 0x7826, 0x0118, 0x6073, 0x0889, 0x0010, 0x6073, 0x0898, 0x6077, + 0x0000, 0x688c, 0x8000, 0x9084, 0x00ff, 0x688e, 0x8007, 0x607a, + 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7038, 0x608a, + 0x7034, 0x608e, 0x7048, 0x60c6, 0x7044, 0x60ca, 0x686c, 0x60ce, + 0x60af, 0x95d5, 0x60d7, 0x0000, 0x9582, 0x0080, 0x0248, 0x6a00, + 0xd2f4, 0x0120, 0x6a14, 0x9294, 0x00ff, 0x0010, 0x2011, 0x0000, + 0x629e, 0x7824, 0xd0cc, 0x0120, 0x080c, 0x7e80, 0x0804, 0x7648, + 0x080c, 0x7e5b, 0x0804, 0x7648, 0x7a10, 0x9280, 0x0023, 0x2014, + 0x8210, 0x9294, 0x00ff, 0x2202, 0x8217, 0x0005, 0x00d6, 0x2069, + 0x12dc, 0x6843, 0x0001, 0x00de, 0x0005, 0x60a3, 0x0056, 0x60a7, + 0x9575, 0x00f1, 0x080c, 0x65c6, 0x0005, 0x0016, 0x2001, 0x110c, + 0x200c, 0x9184, 0x0600, 0x9086, 0x0600, 0x0128, 0x0089, 0x080c, + 0x65c6, 0x001e, 0x0005, 0xc1e5, 0x2001, 0x110c, 0x2102, 0x2001, + 0x12dd, 0x2003, 0x0000, 0x2001, 0x12e5, 0x2003, 0x0000, 0x0c88, + 0x0006, 0x6014, 0x9084, 0x1804, 0x9085, 0x0009, 0x6016, 0x000e, + 0x0005, 0x0006, 0x00c6, 0x2061, 0x0100, 0x6014, 0x9084, 0x1804, + 0x9085, 0x0008, 0x6016, 0x00ce, 0x000e, 0x0005, 0x00c6, 0x00d6, + 0x0016, 0x0026, 0x2061, 0x0100, 0x2069, 0x0140, 0x080c, 0x5745, + 0x1198, 0x2001, 0x12f8, 0x2004, 0x9005, 0x15b8, 0x0066, 0x2031, + 0x0001, 0x080c, 0x57d6, 0x006e, 0x1118, 0x080c, 0x65c6, 0x0468, + 0x00c6, 0x2061, 0x12dc, 0x00d8, 0x6904, 0x9194, 0x4000, 0x0550, + 0x0881, 0x6803, 0x1000, 0x6803, 0x0000, 0x00c6, 0x2061, 0x12dc, + 0x6128, 0x9192, 0x00c8, 0x1258, 0x8108, 0x612a, 0x6124, 0x00ce, + 0x81ff, 0x0198, 0x080c, 0x65c6, 0x080c, 0x7718, 0x0070, 0x6124, + 0x91e5, 0x0000, 0x0140, 0x080c, 0xae07, 0x2009, 0x0014, 0x080c, + 0x7f4e, 0x080c, 0x65cf, 0x00ce, 0x0000, 0x002e, 0x001e, 0x00de, + 0x00ce, 0x0005, 0x2001, 0x12f8, 0x2004, 0x9005, 0x1db0, 0x00c6, + 0x2061, 0x12dc, 0x6128, 0x9192, 0x0003, 0x1e08, 0x8108, 0x612a, + 0x00ce, 0x080c, 0x65c6, 0x080c, 0x45d6, 0x0c38, 0x00c6, 0x00d6, + 0x00e6, 0x0016, 0x0026, 0x080c, 0x65dc, 0x2071, 0x12dc, 0x713c, + 0x81ff, 0x0590, 0x2061, 0x0100, 0x2069, 0x0140, 0x080c, 0x5745, + 0x11a8, 0x0036, 0x2019, 0x0002, 0x080c, 0x7936, 0x003e, 0x713c, + 0x2160, 0x080c, 0xae07, 0x2009, 0x004a, 0x080c, 0x7f4e, 0x0066, + 0x2031, 0x0001, 0x080c, 0x57d6, 0x006e, 0x00b0, 0x6904, 0x9194, + 0x4000, 0x01c0, 0x6803, 0x1000, 0x6803, 0x0000, 0x0036, 0x2019, + 0x0001, 0x080c, 0x7936, 0x003e, 0x713c, 0x2160, 0x080c, 0xae07, + 0x2009, 0x004a, 0x080c, 0x7f4e, 0x002e, 0x001e, 0x00ee, 0x00de, + 0x00ce, 0x0005, 0x0c58, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056, + 0x0046, 0x0006, 0x0126, 0x2091, 0x8000, 0x6010, 0x2068, 0x6ca0, + 0x2071, 0x12dc, 0x7018, 0x2068, 0x8dff, 0x0198, 0x68a0, 0x9406, + 0x0118, 0x6854, 0x2068, 0x0cc0, 0x6014, 0x2060, 0x646c, 0x6570, + 0x6678, 0x2d60, 0x080c, 0x4c75, 0x0120, 0x080c, 0x7a3e, 0x9085, + 0x0001, 0x012e, 0x000e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, + 0x00ee, 0x0005, 0x080c, 0x71be, 0x7003, 0x1200, 0x7820, 0x9086, + 0x0004, 0x1110, 0x6098, 0x0018, 0x2001, 0x1114, 0x2004, 0x700e, + 0x7838, 0x7012, 0x783c, 0x7016, 0x60c3, 0x002c, 0x080c, 0x76f5, + 0x0005, 0x080c, 0x71be, 0x7003, 0x0f00, 0x7808, 0x700e, 0x60c3, + 0x0008, 0x080c, 0x76f5, 0x0005, 0x0156, 0x080c, 0x7234, 0x7003, + 0x0200, 0x2011, 0x1148, 0x63f0, 0x2312, 0x20a9, 0x0006, 0x2011, + 0x1140, 0x2019, 0x1141, 0x9ef0, 0x0002, 0x2376, 0x8e70, 0x2276, + 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002, 0x1f04, 0x7835, 0x60c3, + 0x001c, 0x080c, 0x76f5, 0x015e, 0x0005, 0x0016, 0x0026, 0x080c, + 0x7210, 0x080c, 0x7222, 0x9e80, 0x0004, 0x20e9, 0x0000, 0x20a0, + 0x7814, 0x9080, 0x0000, 0x2004, 0x9080, 0x0021, 0x20e1, 0x0001, + 0x2098, 0x7808, 0x9088, 0x0002, 0x21a8, 0x4003, 0x9080, 0x0004, + 0x8003, 0x60c2, 0x080c, 0x76f5, 0x002e, 0x001e, 0x0005, 0x080c, + 0x71be, 0x7003, 0x6200, 0x7808, 0x700e, 0x60c3, 0x0008, 0x080c, + 0x76f5, 0x0005, 0x0016, 0x0026, 0x080c, 0x71be, 0x20e9, 0x0000, + 0x20a1, 0x024c, 0x7814, 0x9080, 0x0000, 0x2004, 0x9080, 0x0023, + 0x20e1, 0x0001, 0x2098, 0x7808, 0x9088, 0x0002, 0x21a8, 0x4003, + 0x8003, 0x60c2, 0x080c, 0x76f5, 0x002e, 0x001e, 0x0005, 0x00e6, + 0x00c6, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x12dc, 0x700c, + 0x2060, 0x8cff, 0x0178, 0x080c, 0x97cd, 0x1110, 0x080c, 0x8576, + 0x600c, 0x0006, 0x080c, 0x99c4, 0x080c, 0x7f1e, 0x080c, 0x7a3e, + 0x00ce, 0x0c78, 0x700f, 0x0000, 0x700b, 0x0000, 0x012e, 0x000e, + 0x00ce, 0x00ee, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, + 0x00c6, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2069, 0x0100, + 0x2079, 0x0140, 0x2071, 0x12dc, 0x7024, 0x2060, 0x8cff, 0x05a0, + 0x080c, 0x7721, 0x68c3, 0x0000, 0x080c, 0x65cf, 0x2009, 0x0013, + 0x080c, 0x7f4e, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0158, 0x6827, + 0x0004, 0x7804, 0x9084, 0x4000, 0x01a0, 0x7803, 0x1000, 0x7803, + 0x0000, 0x0078, 0xd084, 0x0118, 0x6827, 0x0001, 0x0010, 0x1f04, + 0x78d4, 0x7804, 0x9084, 0x1000, 0x0120, 0x7803, 0x0100, 0x7803, + 0x0000, 0x6824, 0x000e, 0x001e, 0x002e, 0x00ce, 0x00de, 0x00ee, + 0x00fe, 0x015e, 0x012e, 0x0005, 0x2001, 0x1100, 0x2004, 0x9096, + 0x0001, 0x0550, 0x9096, 0x0004, 0x0538, 0x6817, 0x0008, 0x68c3, + 0x0000, 0x2011, 0x4586, 0x080c, 0x655b, 0x20a9, 0x01f4, 0x6824, + 0xd094, 0x0158, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000, 0x01a0, + 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0xd084, 0x0118, 0x6827, + 0x0001, 0x0010, 0x1f04, 0x790f, 0x7804, 0x9084, 0x1000, 0x0120, + 0x7803, 0x0100, 0x7803, 0x0000, 0x000e, 0x001e, 0x002e, 0x00ce, + 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x0126, 0x0156, + 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0026, 0x0016, 0x0006, 0x2091, + 0x8000, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x12dc, 0x703c, + 0x2060, 0x8cff, 0x0904, 0x79b8, 0x6814, 0x9084, 0x0002, 0x0904, + 0x79b8, 0x68af, 0x95f5, 0x6817, 0x0010, 0x2009, 0x00fa, 0x8109, + 0x1df0, 0x68c7, 0x0000, 0x68cb, 0x0008, 0x080c, 0x65dc, 0x080c, + 0x1605, 0x0046, 0x2009, 0x017f, 0x200b, 0x00a5, 0x2021, 0x0169, + 0x2404, 0x9084, 0x000f, 0x9086, 0x0004, 0x1500, 0x68af, 0x95f5, + 0x68c7, 0x0000, 0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0090, + 0x2071, 0x131f, 0x6814, 0x9084, 0x1984, 0x9085, 0x0012, 0x6816, + 0x782b, 0x0008, 0x7003, 0x0000, 0x00fe, 0x00ee, 0x9386, 0x0002, + 0x1128, 0x7884, 0x9005, 0x1110, 0x7887, 0x0001, 0x200b, 0x0000, + 0x004e, 0x939d, 0x0000, 0x1120, 0x2009, 0x0049, 0x080c, 0x7f4e, + 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0158, 0x6827, 0x0004, 0x7804, + 0x9084, 0x4000, 0x01a0, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, + 0xd08c, 0x0118, 0x6827, 0x0002, 0x0010, 0x1f04, 0x799a, 0x7804, + 0x9084, 0x1000, 0x0120, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, + 0x000e, 0x001e, 0x002e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, + 0x012e, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x12dc, + 0x6a06, 0x012e, 0x00de, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, + 0x2069, 0x12dc, 0x6a32, 0x012e, 0x00de, 0x0005, 0x00f6, 0x00e6, + 0x00c6, 0x0066, 0x0006, 0x0126, 0x2071, 0x12dc, 0x7614, 0x2660, + 0x2678, 0x2091, 0x8000, 0x8cff, 0x0530, 0x6020, 0x9206, 0x11f8, + 0x7014, 0x9c36, 0x1110, 0x660c, 0x7616, 0x7010, 0x9c36, 0x1140, + 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7012, 0x0010, 0x7013, 0x0000, + 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, + 0x600f, 0x0000, 0x080c, 0x97a3, 0x04c9, 0x00ce, 0x08e0, 0x2c78, + 0x600c, 0x2060, 0x08c0, 0x012e, 0x000e, 0x006e, 0x00ce, 0x00ee, + 0x00fe, 0x0005, 0x080c, 0x73dd, 0x7814, 0x7032, 0x7042, 0x7047, + 0x1000, 0x00f8, 0x080c, 0x73dd, 0x7814, 0x7032, 0x7042, 0x7047, + 0x4000, 0x00b8, 0x080c, 0x73dd, 0x7814, 0x7032, 0x7042, 0x7047, + 0x2000, 0x0078, 0x080c, 0x73dd, 0x7814, 0x7032, 0x7042, 0x7047, + 0x0400, 0x0038, 0x080c, 0x73dd, 0x7814, 0x7032, 0x7042, 0x7047, + 0x0200, 0x60c3, 0x0020, 0x080c, 0x76f5, 0x0005, 0x00e6, 0x2071, + 0x12dc, 0x7020, 0x9005, 0x0110, 0x8001, 0x7022, 0x00ee, 0x0005, + 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0006, 0x0126, + 0x2091, 0x8000, 0x2071, 0x12dc, 0x7614, 0x2660, 0x2678, 0x2039, + 0x0001, 0x87ff, 0x0904, 0x7ad2, 0x8cff, 0x0904, 0x7ad2, 0x6020, + 0x9086, 0x0006, 0x1904, 0x7acd, 0x88ff, 0x0138, 0x2800, 0x9c06, + 0x1904, 0x7acd, 0x2039, 0x0000, 0x0050, 0x6010, 0x9206, 0x1904, + 0x7acd, 0x85ff, 0x0120, 0x6054, 0x9106, 0x1904, 0x7acd, 0x7024, + 0x9c06, 0x1538, 0x2069, 0x0100, 0x68c0, 0x9005, 0x01f0, 0x080c, + 0x65cf, 0x6817, 0x0008, 0x68c3, 0x0000, 0x080c, 0x7b56, 0x7027, + 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0120, + 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, + 0x0110, 0x6827, 0x0001, 0x003e, 0x0020, 0x6003, 0x0009, 0x630a, + 0x0460, 0x7014, 0x9c36, 0x1110, 0x660c, 0x7616, 0x7010, 0x9c36, + 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7012, 0x0010, 0x7013, + 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, + 0x2678, 0x89ff, 0x1158, 0x600f, 0x0000, 0x6014, 0x2068, 0x080c, + 0x95d2, 0x0110, 0x080c, 0xaa84, 0x080c, 0x97a3, 0x080c, 0x7a3e, + 0x88ff, 0x1190, 0x00ce, 0x0804, 0x7a59, 0x2c78, 0x600c, 0x2060, + 0x0804, 0x7a59, 0x9006, 0x012e, 0x000e, 0x006e, 0x007e, 0x00ce, + 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x98c5, + 0x0001, 0x0c88, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, + 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x12dc, 0x7638, 0x2660, + 0x2678, 0x8cff, 0x0904, 0x7b46, 0x6020, 0x9086, 0x0006, 0x1904, + 0x7b41, 0x87ff, 0x0128, 0x2700, 0x9c06, 0x1904, 0x7b41, 0x0040, + 0x6010, 0x9206, 0x15f0, 0x85ff, 0x0118, 0x6054, 0x9106, 0x15c8, + 0x703c, 0x9c06, 0x1170, 0x0036, 0x2019, 0x0001, 0x080c, 0x7936, + 0x7033, 0x0000, 0x703f, 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, + 0x003e, 0x7038, 0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, + 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, + 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, + 0x2678, 0x600f, 0x0000, 0x6014, 0x2068, 0x080c, 0x95d2, 0x0110, + 0x080c, 0xaa84, 0x080c, 0x97a3, 0x87ff, 0x1190, 0x00ce, 0x0804, + 0x7af1, 0x2c78, 0x600c, 0x2060, 0x0804, 0x7af1, 0x9006, 0x012e, + 0x000e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, + 0x601b, 0x0000, 0x00ce, 0x97bd, 0x0001, 0x0c88, 0x00e6, 0x2071, + 0x12dc, 0x2001, 0x1100, 0x2004, 0x9086, 0x0002, 0x1118, 0x7007, + 0x0005, 0x0010, 0x7007, 0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6, + 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, + 0x12dc, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0518, 0x2200, + 0x9c06, 0x11e0, 0x7038, 0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, + 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, + 0x7037, 0x0000, 0x660c, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, + 0x2678, 0x600f, 0x0000, 0x9085, 0x0001, 0x0020, 0x2c78, 0x600c, + 0x2060, 0x08d8, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00ee, + 0x00fe, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0006, + 0x0126, 0x2091, 0x8000, 0x2071, 0x12dc, 0x760c, 0x2660, 0x2678, + 0x8cff, 0x0904, 0x7c2c, 0x6010, 0x9080, 0x0028, 0x2004, 0x9206, + 0x1904, 0x7c27, 0x7024, 0x9c06, 0x1508, 0x2069, 0x0100, 0x68c0, + 0x9005, 0x0904, 0x7c03, 0x080c, 0x7721, 0x68c3, 0x0000, 0x080c, + 0x7b56, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, + 0x1000, 0x0120, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, + 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x700c, 0x9c36, + 0x1110, 0x660c, 0x760e, 0x7008, 0x9c36, 0x1140, 0x2c00, 0x9f36, + 0x0118, 0x2f00, 0x700a, 0x0010, 0x700b, 0x0000, 0x660c, 0x0066, + 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, + 0x080c, 0x97bc, 0x1158, 0x080c, 0x25d1, 0x080c, 0x97cd, 0x11f0, + 0x080c, 0x8576, 0x00d8, 0x080c, 0x7b56, 0x08c0, 0x080c, 0x97cd, + 0x1118, 0x080c, 0x8576, 0x0090, 0x6014, 0x2068, 0x080c, 0x95d2, + 0x0168, 0x6020, 0x9086, 0x0003, 0x11f8, 0x6867, 0x0103, 0x6b7a, + 0x6877, 0x0000, 0x080c, 0x50a5, 0x080c, 0x9797, 0x080c, 0x99c4, + 0x080c, 0x97a3, 0x080c, 0x7a3e, 0x00ce, 0x0804, 0x7bb0, 0x2c78, + 0x600c, 0x2060, 0x0804, 0x7bb0, 0x012e, 0x000e, 0x006e, 0x00ce, + 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d30, + 0x080c, 0xaa84, 0x0c18, 0x00d6, 0x080c, 0x7234, 0x7003, 0x0200, + 0x7007, 0x0014, 0x60c3, 0x0014, 0x20e1, 0x0001, 0x2099, 0x12a9, + 0x20e9, 0x0000, 0x20a1, 0x0250, 0x20a9, 0x0004, 0x4003, 0x7023, + 0x0004, 0x7027, 0x7878, 0x080c, 0x76f5, 0x00de, 0x0005, 0x080c, + 0x7234, 0x7003, 0x0214, 0x7007, 0x0018, 0x700b, 0x0800, 0x7814, + 0x9084, 0xff00, 0x700e, 0x7814, 0x9084, 0x00ff, 0x7022, 0x782c, + 0x7026, 0x60c3, 0x0018, 0x080c, 0x76f5, 0x0005, 0x00d6, 0x0016, + 0x00d6, 0x2f68, 0x2009, 0x0035, 0x080c, 0x9ac5, 0x00de, 0x1904, + 0x7cd4, 0x080c, 0x71be, 0x7003, 0x1300, 0x782c, 0x2068, 0x6820, + 0x9086, 0x0003, 0x0570, 0x7810, 0x9080, 0x0028, 0x2014, 0x2001, + 0x1133, 0x2004, 0xd0ac, 0x11d0, 0x9286, 0x007e, 0x1128, 0x700b, + 0x00ff, 0x700f, 0xfffe, 0x04a8, 0x9286, 0x007f, 0x1128, 0x700b, + 0x00ff, 0x700f, 0xfffd, 0x0468, 0xd2bc, 0x0180, 0x9286, 0x0080, + 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffc, 0x0418, 0x92e8, 0x1000, + 0x2d6c, 0x6810, 0x700a, 0x6814, 0x700e, 0x00d8, 0x6098, 0x700e, + 0x00c0, 0x2001, 0x1133, 0x2004, 0xd0ac, 0x1138, 0x7810, 0x9080, + 0x0028, 0x2004, 0x9082, 0x007e, 0x0250, 0x00d6, 0x2069, 0x111b, + 0x2d04, 0x700a, 0x8d68, 0x2d04, 0x700e, 0x00de, 0x0010, 0x6034, + 0x700e, 0x7838, 0x7012, 0x783c, 0x7016, 0x60c3, 0x000c, 0x001e, + 0x00de, 0x080c, 0x76f5, 0x0005, 0x781b, 0x0001, 0x7803, 0x0006, + 0x001e, 0x00de, 0x0005, 0x792c, 0x9180, 0x0008, 0x200c, 0x9186, + 0x0006, 0x01b0, 0x9186, 0x0003, 0x0904, 0x7d4b, 0x9186, 0x0005, + 0x0904, 0x7d34, 0x9186, 0x0004, 0x05c8, 0x9186, 0x0008, 0x0904, + 0x7d3c, 0x7807, 0x0037, 0x7817, 0x1700, 0x080c, 0x7db2, 0x0005, + 0x080c, 0x7d71, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, + 0x6800, 0x0002, 0x7d15, 0x7d20, 0x7d17, 0x7d20, 0x7d1c, 0x7d15, + 0x7d15, 0x7d20, 0x7d20, 0x7d20, 0x7d20, 0x7d15, 0x7d15, 0x7d15, + 0x7d15, 0x7d15, 0x7d20, 0x7d15, 0x7d20, 0x080c, 0x0cf1, 0x6824, + 0xd0e4, 0x0110, 0xd0cc, 0x0110, 0x900e, 0x0010, 0x2009, 0x2000, + 0x682c, 0x7022, 0x6830, 0x7026, 0x0804, 0x7d69, 0x080c, 0x7d71, + 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x6a00, 0x9286, + 0x0002, 0x1108, 0x900e, 0x04a8, 0x04e1, 0x00d6, 0x0026, 0x792c, + 0x2168, 0x2009, 0x4000, 0x0468, 0x04a1, 0x00d6, 0x0026, 0x792c, + 0x2168, 0x2009, 0x4000, 0x9286, 0x0005, 0x0118, 0x9286, 0x0002, + 0x1108, 0x900e, 0x00f0, 0x0429, 0x00d6, 0x0026, 0x792c, 0x2168, + 0x6814, 0x2068, 0x69ac, 0x6834, 0x9112, 0x69b0, 0x6838, 0x9103, + 0x7022, 0x7226, 0x792c, 0x9180, 0x0000, 0x2004, 0x908e, 0x0002, + 0x0130, 0x908e, 0x0004, 0x0118, 0x2009, 0x4000, 0x0010, 0x2009, + 0x0000, 0x712a, 0x60c3, 0x0018, 0x002e, 0x00de, 0x080c, 0x76f5, + 0x0005, 0x0036, 0x0046, 0x0056, 0x0066, 0x080c, 0x7234, 0x9006, + 0x7003, 0x0200, 0x7938, 0x710a, 0x793c, 0x710e, 0x7810, 0x9080, + 0x0028, 0x2004, 0x2011, 0x1133, 0x2214, 0xd2ac, 0x1118, 0x9092, + 0x007e, 0x0268, 0x00d6, 0x2069, 0x111b, 0x2d2c, 0x8d68, 0x2d34, + 0x90e8, 0x1000, 0x2d6c, 0x6b10, 0x6c14, 0x00de, 0x0030, 0x2019, + 0x0000, 0x6498, 0x2029, 0x0000, 0x6634, 0x782c, 0x9080, 0x0008, + 0x2004, 0x9086, 0x0003, 0x1128, 0x7512, 0x7616, 0x731a, 0x741e, + 0x0020, 0x7312, 0x7416, 0x751a, 0x761e, 0x006e, 0x005e, 0x004e, + 0x003e, 0x0005, 0x080c, 0x7234, 0x7003, 0x0100, 0x700b, 0x0009, + 0x7814, 0x700e, 0x60c3, 0x0008, 0x080c, 0x76f5, 0x0005, 0x080c, + 0x71b5, 0x7003, 0x1400, 0x7838, 0x700a, 0x783c, 0x700e, 0x782c, + 0x7012, 0x7830, 0x7016, 0x7834, 0x9084, 0x00ff, 0x8007, 0x701a, + 0x60c3, 0x0010, 0x080c, 0x76f5, 0x0005, 0x080c, 0x722b, 0x7003, + 0x0100, 0x782c, 0x700a, 0x7814, 0x700e, 0x60c3, 0x0008, 0x080c, + 0x76f5, 0x0005, 0x0029, 0x60c3, 0x0000, 0x080c, 0x76f5, 0x0005, + 0x00d6, 0x080c, 0x7e9b, 0x7810, 0x2068, 0x6810, 0x9085, 0x0300, + 0x7002, 0x6814, 0x7006, 0x68a0, 0x2069, 0x1100, 0x6acc, 0xd2ac, + 0x1110, 0xd0bc, 0x0188, 0x686c, 0x700a, 0x6870, 0x700e, 0x7013, + 0x0819, 0x080c, 0x76e4, 0x721a, 0x2f10, 0x7222, 0x7a08, 0x7226, + 0x2071, 0x024c, 0x00de, 0x0005, 0x6234, 0x720e, 0x0c80, 0x0059, + 0x7914, 0x712a, 0x60c3, 0x0000, 0x60a7, 0x9575, 0x080c, 0x7718, + 0x080c, 0x65c6, 0x0005, 0x0036, 0x00d6, 0x00e6, 0x7858, 0x2068, + 0x9df0, 0x001b, 0x7210, 0x9296, 0x00c0, 0x9294, 0xfffd, 0x7212, + 0x7214, 0x9294, 0x0300, 0x7216, 0x7100, 0x9194, 0x00ff, 0x7308, + 0x9384, 0x00ff, 0x908d, 0xc200, 0x7102, 0x9384, 0xff00, 0x9215, + 0x720a, 0x7004, 0x720c, 0x700e, 0x7206, 0x00d6, 0x2069, 0x0200, + 0x080c, 0x7e9b, 0x00de, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, + 0x000a, 0x20e1, 0x0001, 0x2e98, 0x4003, 0x60a3, 0x0035, 0x6a68, + 0x9294, 0x7000, 0x9286, 0x3000, 0x0110, 0x60a3, 0x0037, 0x00ee, + 0x00de, 0x003e, 0x0005, 0x900e, 0x7814, 0x9080, 0x001f, 0x2004, + 0xd0fc, 0x01d8, 0x9084, 0x0003, 0x11c0, 0x2001, 0x110c, 0x2004, + 0xd0bc, 0x0198, 0x7824, 0xd0cc, 0x1180, 0xd0c4, 0x1170, 0x7814, + 0x9080, 0x002a, 0x2004, 0x9005, 0x1140, 0x2001, 0x110c, 0x200c, + 0xc1d5, 0x2102, 0x2009, 0x12c1, 0x210c, 0x918d, 0x0092, 0x0010, + 0x2009, 0x0096, 0x60ab, 0x0036, 0x6116, 0x0005, 0x2009, 0x0009, + 0x00a0, 0x2009, 0x000a, 0x0088, 0x2009, 0x000b, 0x0070, 0x2009, + 0x000c, 0x0058, 0x2009, 0x000d, 0x0040, 0x2009, 0x000e, 0x0028, + 0x2009, 0x000f, 0x0010, 0x2009, 0x0008, 0x6912, 0x0005, 0x00d6, + 0x9290, 0x0018, 0x8214, 0x20e9, 0x0000, 0x2069, 0x0200, 0x6813, + 0x0000, 0x22a8, 0x9284, 0x00e0, 0x0128, 0x20a9, 0x0020, 0x9292, + 0x0020, 0x0008, 0x9016, 0x20a1, 0x0240, 0x9006, 0x4004, 0x82ff, + 0x0120, 0x6810, 0x8000, 0x6812, 0x0c60, 0x00de, 0x0005, 0x2061, + 0x15c0, 0x2071, 0x1100, 0x7064, 0x7046, 0x704b, 0x15c0, 0x0005, + 0x00e6, 0x0126, 0x2071, 0x1100, 0x2091, 0x8000, 0x7544, 0x9582, + 0x0010, 0x0608, 0x7048, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, + 0x9ce0, 0x0018, 0x7058, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x15c0, + 0x0c98, 0x6003, 0x0008, 0x8529, 0x7546, 0x9ca8, 0x0018, 0x7058, + 0x9502, 0x1230, 0x754a, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, + 0x704b, 0x15c0, 0x0cc0, 0x9006, 0x0cc0, 0x00e6, 0x2071, 0x1100, + 0x7544, 0x9582, 0x0010, 0x0600, 0x7048, 0x2060, 0x6000, 0x9086, + 0x0000, 0x0148, 0x9ce0, 0x0018, 0x7058, 0x9c02, 0x1208, 0x0cb0, + 0x2061, 0x15c0, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7546, 0x9ca8, + 0x0018, 0x7058, 0x9502, 0x1228, 0x754a, 0x9085, 0x0001, 0x00ee, + 0x0005, 0x704b, 0x15c0, 0x0cc8, 0x9006, 0x0cc8, 0x9c82, 0x15c0, + 0x0a0c, 0x0cf1, 0x2001, 0x1116, 0x2004, 0x9c02, 0x1a0c, 0x0cf1, + 0x9006, 0x6006, 0x600a, 0x600e, 0x6016, 0x601a, 0x6012, 0x6023, + 0x0000, 0x6003, 0x0000, 0x601e, 0x6056, 0x605a, 0x6026, 0x602a, + 0x602e, 0x6032, 0x6036, 0x603a, 0x603e, 0x6042, 0x2061, 0x1100, + 0x6044, 0x8000, 0x6046, 0x9086, 0x0001, 0x0108, 0x0005, 0x0126, + 0x2091, 0x8000, 0x080c, 0x6d42, 0x012e, 0x0cc0, 0x6020, 0x9084, + 0x000f, 0x0002, 0x7f60, 0x7f70, 0x7f8b, 0x7fa6, 0x9af2, 0x9b0d, + 0x9b28, 0x7f60, 0x7f70, 0x7f60, 0x7fc2, 0x7f60, 0x7f60, 0x7f60, + 0x9186, 0x0013, 0x1128, 0x080c, 0x6c56, 0x080c, 0x6d42, 0x0005, + 0x9186, 0x0047, 0x1120, 0x9016, 0x080c, 0x119a, 0x0000, 0x0005, + 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0cf1, 0x0013, 0x006e, + 0x0005, 0x7f89, 0x8406, 0x85b0, 0x7f89, 0x862d, 0x8072, 0x7f89, + 0x7f89, 0x8392, 0x8a82, 0x7f89, 0x7f89, 0x7f89, 0x7f89, 0x7f89, + 0x7f89, 0x080c, 0x0cf1, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, + 0x0cf1, 0x0013, 0x006e, 0x0005, 0x7fa4, 0x9085, 0x7fa4, 0x7fa4, + 0x7fa4, 0x7fa4, 0x7fa4, 0x7fa4, 0x902d, 0x91f5, 0x7fa4, 0x90b6, + 0x9131, 0x90b6, 0x9131, 0x7fa4, 0x080c, 0x0cf1, 0x6000, 0x9082, + 0x0016, 0x1a0c, 0x0cf1, 0x6000, 0x0002, 0x7fc0, 0x8ac3, 0x8b8c, + 0x8caa, 0x8e09, 0x7fc0, 0x7fc0, 0x7fc0, 0x8a9d, 0x8fdd, 0x8fe0, + 0x7fc0, 0x7fc0, 0x7fc0, 0x7fc0, 0x900a, 0x7fc0, 0x7fc0, 0x7fc0, + 0x080c, 0x0cf1, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0cf1, + 0x0013, 0x006e, 0x0005, 0x7fdb, 0x7fdb, 0x7fdb, 0x7ffe, 0x8051, + 0x7fdb, 0x7fdb, 0x7fdb, 0x7fdd, 0x7fdb, 0x7fdb, 0x7fdb, 0x7fdb, + 0x7fdb, 0x7fdb, 0x7fdb, 0x080c, 0x0cf1, 0x9186, 0x0003, 0x190c, + 0x0cf1, 0x00d6, 0x6003, 0x0003, 0x6106, 0x6014, 0x2068, 0x687f, + 0x0040, 0x68ac, 0x6846, 0x68b0, 0x684a, 0x6837, 0x0000, 0x683b, + 0x0000, 0x00de, 0x2c10, 0x080c, 0x13a9, 0x080c, 0x68eb, 0x0126, + 0x2091, 0x8000, 0x080c, 0x6e10, 0x012e, 0x0005, 0x9182, 0x0047, + 0x0002, 0x800a, 0x800a, 0x800c, 0x802b, 0x800a, 0x800a, 0x800a, + 0x800a, 0x803d, 0x080c, 0x0cf1, 0x00d6, 0x0016, 0x080c, 0x6cf2, + 0x080c, 0x6e10, 0x6003, 0x0004, 0x6114, 0x2168, 0x6884, 0x8003, + 0x800b, 0x810b, 0x9108, 0x611a, 0x687f, 0x0020, 0x688c, 0x688a, + 0x68a4, 0x68ae, 0x68a8, 0x68b2, 0x68c7, 0x0000, 0x68cb, 0x0000, + 0x001e, 0x00de, 0x0005, 0x080c, 0x6cf2, 0x00d6, 0x6114, 0x2168, + 0x080c, 0x95d2, 0x0120, 0x687b, 0x0006, 0x080c, 0x50a5, 0x00de, + 0x080c, 0x7f1e, 0x080c, 0x6e10, 0x0005, 0x080c, 0x6cf2, 0x080c, + 0x25ad, 0x00d6, 0x6114, 0x2168, 0x080c, 0x95d2, 0x0120, 0x687b, + 0x0029, 0x080c, 0x50a5, 0x00de, 0x080c, 0x7f1e, 0x080c, 0x6e10, + 0x0005, 0x9182, 0x0047, 0x0002, 0x8061, 0x8063, 0x8061, 0x8061, + 0x8061, 0x8061, 0x8061, 0x8061, 0x8061, 0x8061, 0x8061, 0x8061, + 0x8063, 0x080c, 0x0cf1, 0x00d6, 0x080c, 0x1132, 0x6114, 0x2168, + 0x687b, 0x0000, 0x6883, 0x0000, 0x080c, 0x50a5, 0x00de, 0x080c, + 0x7f1e, 0x0005, 0x91b6, 0x0015, 0x1118, 0x080c, 0x7f1e, 0x0030, + 0x91b6, 0x0016, 0x190c, 0x0cf1, 0x080c, 0x7f1e, 0x0005, 0x20a9, + 0x000e, 0x20e1, 0x0000, 0x2e98, 0x6014, 0x20e9, 0x0001, 0x20a0, + 0x4003, 0x9080, 0x001b, 0x20a0, 0x20a9, 0x0006, 0x3310, 0x3420, + 0x9298, 0x0001, 0x94a8, 0x0001, 0x222e, 0x2326, 0x9290, 0x0002, + 0x95a8, 0x0002, 0x9398, 0x0002, 0x94a0, 0x0002, 0x1f04, 0x8094, + 0x00e6, 0x080c, 0x95d2, 0x0130, 0x6014, 0x2070, 0x7007, 0x0000, + 0x7067, 0x0103, 0x00ee, 0x080c, 0x7f1e, 0x0005, 0x00d6, 0x0036, + 0x7330, 0x9386, 0x0200, 0x1130, 0x6010, 0x2068, 0x6813, 0x00ff, + 0x6817, 0xfffd, 0x6014, 0x9005, 0x0130, 0x2068, 0x6807, 0x0000, + 0x6867, 0x0103, 0x6b32, 0x080c, 0x7f1e, 0x003e, 0x00de, 0x0005, + 0x0016, 0x20a9, 0x002a, 0x9e80, 0x000c, 0x20e1, 0x0000, 0x2098, + 0x6014, 0x9080, 0x0002, 0x20e9, 0x0001, 0x20a0, 0x4003, 0x20a9, + 0x002a, 0x6014, 0x9080, 0x0001, 0x2004, 0x9080, 0x0002, 0x20a0, + 0x4003, 0x00e6, 0x6014, 0x2004, 0x2070, 0x7067, 0x0103, 0x00ee, + 0x080c, 0x7f1e, 0x001e, 0x0005, 0x0016, 0x2009, 0x0000, 0x7030, + 0x9086, 0x0100, 0x0140, 0x7038, 0x9084, 0x00ff, 0x800c, 0x703c, + 0x9084, 0x00ff, 0x8004, 0x9080, 0x0004, 0x9108, 0x9192, 0x0014, + 0x1218, 0x2011, 0x0000, 0x0010, 0x2009, 0x0014, 0x21a8, 0x9e80, + 0x000c, 0x2098, 0x6014, 0x9080, 0x0002, 0x20a0, 0x080c, 0x4678, + 0x82ff, 0x0170, 0x2009, 0x0205, 0x2104, 0x8000, 0x200a, 0x2e00, + 0x2098, 0x3400, 0x9080, 0x0014, 0x20a0, 0x22a8, 0x080c, 0x4678, + 0x00e6, 0x080c, 0x95d2, 0x0140, 0x6014, 0x2070, 0x7007, 0x0000, + 0x7064, 0x70e2, 0x7067, 0x0103, 0x00ee, 0x080c, 0x7f1e, 0x001e, + 0x0005, 0x0016, 0x00d6, 0x7030, 0x9086, 0x0100, 0x1118, 0x2009, + 0x0004, 0x0010, 0x7034, 0x800c, 0x21a8, 0x9e80, 0x000c, 0x2098, + 0x6014, 0x2068, 0x6804, 0x9005, 0x1108, 0x2d00, 0x9080, 0x000c, + 0x20a0, 0x080c, 0x4678, 0x080c, 0x95d2, 0x0148, 0x6804, 0x9005, + 0x1158, 0x6807, 0x0000, 0x6864, 0x68e2, 0x6867, 0x0103, 0x080c, + 0x7f1e, 0x00de, 0x001e, 0x0005, 0x00e6, 0x2070, 0x7030, 0x8007, + 0x9086, 0x0100, 0x1118, 0x080c, 0x8576, 0x00b8, 0x7034, 0x8007, + 0x800c, 0x9e80, 0x000c, 0x687b, 0x0000, 0x6883, 0x0000, 0x6897, + 0x4000, 0x6aa0, 0x6b9c, 0x6ca8, 0x6da4, 0x2031, 0x0000, 0x2039, + 0x0001, 0x2041, 0x0f7e, 0x0019, 0x0d30, 0x00ee, 0x08c0, 0x00d6, + 0x0006, 0x080c, 0x0dc6, 0x000e, 0x0190, 0x6812, 0x000e, 0x683e, + 0x0006, 0x6e06, 0x2800, 0x683a, 0x6916, 0x6f0e, 0x6a2a, 0x6b2e, + 0x6c32, 0x6d36, 0x2d10, 0x080c, 0x0e55, 0x9085, 0x0001, 0x00de, + 0x0005, 0x00e6, 0x00d6, 0x6043, 0x0000, 0x2c68, 0x0016, 0x2009, + 0x0035, 0x080c, 0x9ac5, 0x001e, 0x1168, 0x0026, 0x622c, 0x2268, + 0x002e, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003, 0x0130, 0x9386, + 0x0006, 0x0128, 0x080c, 0x7f1e, 0x0020, 0x0031, 0x0010, 0x080c, + 0x8270, 0x00de, 0x00ee, 0x0005, 0x00f6, 0x6814, 0x2078, 0x9186, + 0x0015, 0x0904, 0x8259, 0x918e, 0x0016, 0x1904, 0x826e, 0x700c, + 0x9084, 0xff00, 0x9086, 0x1700, 0x1904, 0x8238, 0x8fff, 0x1138, + 0x6800, 0x9086, 0x000f, 0x0904, 0x821c, 0x0804, 0x826c, 0x6808, + 0x9086, 0xffff, 0x1904, 0x825b, 0x787c, 0x9084, 0x0060, 0x9086, + 0x0020, 0x1128, 0x783c, 0x7940, 0x9105, 0x1904, 0x825b, 0x080c, + 0x9797, 0x685c, 0x7882, 0x787c, 0xc0dc, 0xc0f4, 0xc0d4, 0x787e, + 0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c, 0x66ff, 0x7884, + 0x920a, 0x0208, 0x8011, 0x7a86, 0x82ff, 0x002e, 0x1138, 0x00c6, + 0x2d60, 0x080c, 0x9389, 0x00ce, 0x0804, 0x826c, 0x00c6, 0x00d6, + 0x2f68, 0x6868, 0xd0fc, 0x1118, 0x080c, 0x477e, 0x0010, 0x080c, + 0x4a18, 0x00de, 0x00ce, 0x1904, 0x825b, 0x00c6, 0x2d60, 0x080c, + 0x7f1e, 0x00ce, 0x0804, 0x826c, 0x00c6, 0x080c, 0x984d, 0x0190, + 0x6017, 0x0000, 0x6810, 0x6012, 0x080c, 0x99cc, 0x6023, 0x0003, + 0x6904, 0x00c6, 0x2d60, 0x080c, 0x7f1e, 0x00ce, 0x080c, 0x7f4e, + 0x00ce, 0x04d0, 0x2001, 0x12a8, 0x2004, 0x6842, 0x00ce, 0x04a0, + 0x7008, 0x9086, 0x000b, 0x11a0, 0x6010, 0x200c, 0xc1bc, 0x2102, + 0x00c6, 0x2d60, 0x7883, 0x0003, 0x6007, 0x0085, 0x6003, 0x000b, + 0x6023, 0x0002, 0x080c, 0x6886, 0x080c, 0x6d42, 0x00ce, 0x00e0, + 0x700c, 0x9086, 0x2a00, 0x1138, 0x2001, 0x12a8, 0x2004, 0x6842, + 0x0098, 0x0471, 0x0098, 0x8fff, 0x090c, 0x0cf1, 0x00c6, 0x00d6, + 0x2d60, 0x2f68, 0x687b, 0x0003, 0x080c, 0x926a, 0x080c, 0x9797, + 0x080c, 0x97a3, 0x00de, 0x00ce, 0x080c, 0x7f1e, 0x00fe, 0x0005, + 0x9186, 0x0015, 0x1128, 0x2001, 0x12a8, 0x2004, 0x6842, 0x0068, + 0x918e, 0x0016, 0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c, 0xad19, + 0x080c, 0x66ae, 0x080c, 0x7f1e, 0x00ce, 0x080c, 0x7f1e, 0x0005, + 0x0026, 0x0036, 0x0046, 0x7228, 0x7cb0, 0x7bac, 0xd2f4, 0x0130, + 0x2001, 0x12a8, 0x2004, 0x6842, 0x0804, 0x82ec, 0x00c6, 0x2d60, + 0x080c, 0x9297, 0x00ce, 0x6804, 0x9086, 0x0050, 0x1170, 0x00c6, + 0x2d00, 0x2060, 0x6003, 0x0001, 0x6007, 0x0050, 0x080c, 0x6886, + 0x080c, 0x6d42, 0x00ce, 0x0804, 0x82ec, 0x6800, 0x9086, 0x000f, + 0x01c8, 0x8fff, 0x090c, 0x0cf1, 0x6824, 0xd0dc, 0x1198, 0x6800, + 0x9086, 0x0004, 0x1198, 0x787c, 0xd0ac, 0x0180, 0x7843, 0x0fff, + 0x783f, 0x0fff, 0x7880, 0xc0f4, 0xc0fc, 0x7882, 0x2001, 0x0001, + 0x6832, 0x00e8, 0x2001, 0x0007, 0x6832, 0x00c8, 0x787c, 0xd0b4, + 0x1138, 0xd0ac, 0x0db8, 0x7838, 0x7934, 0x9105, 0x0d98, 0x0c30, + 0xd2ec, 0x1d80, 0x7024, 0x9306, 0x1118, 0x7020, 0x9406, 0x0d50, + 0x7020, 0x683e, 0x7024, 0x683a, 0x2001, 0x0005, 0x6832, 0x080c, + 0x98d9, 0x080c, 0x6d42, 0x0010, 0x080c, 0x7f1e, 0x004e, 0x003e, + 0x002e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x6038, 0x2068, 0x6a20, + 0x9286, 0x0007, 0x0904, 0x8350, 0x9286, 0x0002, 0x0904, 0x8350, + 0x9286, 0x0000, 0x0904, 0x8350, 0x6808, 0x633c, 0x9306, 0x1904, + 0x8350, 0x2071, 0x026c, 0x9186, 0x0015, 0x05e0, 0x918e, 0x0016, + 0x1190, 0x6034, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1160, 0x700c, + 0x9086, 0x2a00, 0x1140, 0x6038, 0x9080, 0x0009, 0x200c, 0xc1dd, + 0xc1f5, 0x2102, 0x0438, 0x00c6, 0x6038, 0x2060, 0x6104, 0x9186, + 0x004b, 0x01a0, 0x9186, 0x004c, 0x0188, 0x9186, 0x004d, 0x0170, + 0x9186, 0x004e, 0x0158, 0x9186, 0x0052, 0x0140, 0x6014, 0x2068, + 0x080c, 0x95d2, 0x090c, 0x0cf1, 0x6883, 0x0003, 0x6007, 0x0085, + 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x6886, 0x080c, 0x6d42, + 0x00ce, 0x0030, 0x6038, 0x2070, 0x2001, 0x12a8, 0x2004, 0x7042, + 0x080c, 0x7f1e, 0x002e, 0x00de, 0x00ee, 0x0005, 0x00d6, 0x00f6, + 0x6014, 0x2068, 0x6010, 0x2078, 0x91b6, 0x0015, 0x0130, 0x7a08, + 0x7b0c, 0x7c00, 0xc48c, 0x7c02, 0x0038, 0x7238, 0x7a0a, 0x733c, + 0x7b0e, 0x7c00, 0xc48d, 0x7c02, 0x6804, 0x9005, 0x1120, 0x00fe, + 0x00de, 0x0804, 0x80a0, 0x9080, 0x0002, 0x00d6, 0x2068, 0x6a0a, + 0x6b0e, 0x6c02, 0x00de, 0x2009, 0x002b, 0x6aa0, 0x6b9c, 0x6ca8, + 0x6da4, 0x2031, 0x0000, 0x2039, 0x0001, 0x2041, 0x0f7e, 0x080c, + 0x817f, 0x0128, 0x00fe, 0x00de, 0x080c, 0x7f1e, 0x0005, 0x080c, + 0x8576, 0x0cc0, 0x2100, 0x91b2, 0x004c, 0x1a0c, 0x0cf1, 0x91b2, + 0x0040, 0x1a04, 0x83f6, 0x0002, 0x83ea, 0x83de, 0x83ea, 0x83ea, + 0x83ea, 0x83ea, 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, + 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, + 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, + 0x83dc, 0x83dc, 0x83dc, 0x83ea, 0x83dc, 0x83ea, 0x83ea, 0x83dc, + 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83ea, 0x83dc, 0x83dc, 0x83dc, + 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83ea, 0x83ea, + 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, 0x83dc, + 0x83dc, 0x83ea, 0x83dc, 0x83dc, 0x080c, 0x0cf1, 0x6003, 0x0001, + 0x6106, 0x080c, 0x68ce, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d42, + 0x012e, 0x0005, 0x6003, 0x0001, 0x6106, 0x080c, 0x68ce, 0x0126, + 0x2091, 0x8000, 0x080c, 0x6d42, 0x012e, 0x0005, 0x2600, 0x0002, + 0x8404, 0x8404, 0x8404, 0x83ea, 0x83ea, 0x8404, 0x8404, 0x8404, + 0x8404, 0x83ea, 0x8404, 0x8404, 0x080c, 0x0cf1, 0x6004, 0x90b2, + 0x004c, 0x1a0c, 0x0cf1, 0x91b6, 0x0013, 0x0904, 0x84a2, 0x91b6, + 0x0027, 0x1904, 0x8468, 0x080c, 0x6c56, 0x6004, 0x080c, 0x97bc, + 0x0178, 0x080c, 0x97cd, 0x0904, 0x8462, 0x908e, 0x0021, 0x0904, + 0x8465, 0x908e, 0x0022, 0x05f0, 0x908e, 0x003d, 0x05f0, 0x0498, + 0x080c, 0x25d1, 0x2001, 0x0007, 0x080c, 0x4ab3, 0x6010, 0x9080, + 0x0028, 0x200c, 0x080c, 0x8576, 0x9186, 0x007e, 0x1148, 0x2001, + 0x1133, 0x2014, 0xc285, 0x080c, 0x5745, 0x1108, 0xc2ad, 0x2202, + 0x0016, 0x0026, 0x0036, 0x2110, 0x2019, 0x0028, 0x080c, 0x69ca, + 0x0076, 0x2039, 0x0000, 0x080c, 0x68fe, 0x6010, 0x00c6, 0x9065, + 0x0100, 0x00ce, 0x2c08, 0x080c, 0xa85f, 0x007e, 0x003e, 0x002e, + 0x001e, 0x080c, 0x4b20, 0x080c, 0x99c4, 0x080c, 0x7f1e, 0x080c, + 0x6d42, 0x0005, 0x080c, 0x8576, 0x0cb0, 0x080c, 0x85a4, 0x0c98, + 0x9186, 0x0014, 0x1db0, 0x080c, 0x6c56, 0x080c, 0x25ad, 0x080c, + 0x97bc, 0x1188, 0x080c, 0x25d1, 0x6010, 0x9080, 0x0028, 0x200c, + 0x080c, 0x8576, 0x9186, 0x007e, 0x1128, 0x2001, 0x1133, 0x200c, + 0xc185, 0x2102, 0x08c0, 0x080c, 0x97cd, 0x1118, 0x080c, 0x8576, + 0x0890, 0x6004, 0x908e, 0x0032, 0x1158, 0x00e6, 0x00f6, 0x2071, + 0x1193, 0x2079, 0x0000, 0x080c, 0x28cc, 0x00fe, 0x00ee, 0x0818, + 0x6004, 0x908e, 0x0021, 0x0d50, 0x908e, 0x0022, 0x090c, 0x8576, + 0x0804, 0x845b, 0x90b2, 0x0040, 0x1a04, 0x8565, 0x2008, 0x0002, + 0x84ea, 0x84eb, 0x84ee, 0x84f1, 0x84f4, 0x84f7, 0x84e8, 0x84e8, + 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84e8, + 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84e8, + 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84fa, 0x8509, + 0x84e8, 0x850b, 0x8509, 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84e8, + 0x8509, 0x8509, 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84e8, 0x84e8, + 0x84e8, 0x84e8, 0x8545, 0x8509, 0x84e8, 0x8505, 0x84e8, 0x84e8, + 0x84e8, 0x8506, 0x84e8, 0x84e8, 0x84e8, 0x8509, 0x853c, 0x84e8, + 0x080c, 0x0cf1, 0x00f0, 0x2001, 0x000b, 0x0460, 0x2001, 0x0003, + 0x0448, 0x2001, 0x0005, 0x0430, 0x2001, 0x0001, 0x0418, 0x2001, + 0x0009, 0x0400, 0x080c, 0x6c56, 0x6003, 0x0005, 0x2001, 0x12a8, + 0x2004, 0x6042, 0x080c, 0x6d42, 0x00a0, 0x0018, 0x0010, 0x080c, + 0x4ab3, 0x0804, 0x8556, 0x080c, 0x6c56, 0x2001, 0x12a6, 0x2004, + 0x601a, 0x2001, 0x12a8, 0x2004, 0x6042, 0x6003, 0x0004, 0x080c, + 0x6d42, 0x0005, 0x080c, 0x4ab3, 0x080c, 0x6c56, 0x6003, 0x0002, + 0x2001, 0x12a8, 0x2004, 0x6042, 0x0036, 0x2019, 0x115d, 0x2304, + 0x9084, 0xff00, 0x1120, 0x2001, 0x12a6, 0x201c, 0x0040, 0x8007, + 0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b, 0x9318, 0x631a, + 0x003e, 0x080c, 0x6d42, 0x08e8, 0x080c, 0x6c56, 0x080c, 0x99c4, + 0x080c, 0x7f1e, 0x080c, 0x6d42, 0x08a0, 0x00e6, 0x00f6, 0x2071, + 0x1193, 0x2079, 0x0000, 0x080c, 0x28cc, 0x00fe, 0x00ee, 0x080c, + 0x6c56, 0x080c, 0x7f1e, 0x080c, 0x6d42, 0x0818, 0x080c, 0x6c56, + 0x2001, 0x12a8, 0x2004, 0x6042, 0x6003, 0x0002, 0x2001, 0x12a6, + 0x2004, 0x601a, 0x080c, 0x6d42, 0x0005, 0x2600, 0x2008, 0x0002, + 0x8574, 0x8574, 0x8574, 0x8556, 0x8556, 0x8574, 0x8574, 0x8574, + 0x8574, 0x8556, 0x8574, 0x8574, 0x080c, 0x0cf1, 0x00e6, 0x0026, + 0x0016, 0x080c, 0x95d2, 0x0508, 0x6014, 0x2070, 0x7064, 0x9086, + 0x0139, 0x1148, 0x2001, 0x0030, 0x2009, 0x0000, 0x2011, 0x4005, + 0x080c, 0x9a7b, 0x0090, 0x7068, 0xd0fc, 0x0178, 0x7007, 0x0000, + 0x0016, 0x6004, 0x908e, 0x0021, 0x0160, 0x908e, 0x003d, 0x0148, + 0x001e, 0x7067, 0x0103, 0x7033, 0x0100, 0x001e, 0x002e, 0x00ee, + 0x0005, 0x001e, 0x0009, 0x0cc8, 0x00e6, 0x9cf0, 0x0005, 0x2e74, + 0x7000, 0x2070, 0x7067, 0x0103, 0x7023, 0x8001, 0x00ee, 0x0005, + 0x00d6, 0x6610, 0x2668, 0x6804, 0x9084, 0x00ff, 0x00de, 0x90b2, + 0x000c, 0x1a0c, 0x0cf1, 0x6604, 0x96b6, 0x0043, 0x1120, 0x080c, + 0x9a37, 0x0804, 0x861d, 0x6604, 0x96b6, 0x0033, 0x1120, 0x080c, + 0x99e7, 0x0804, 0x861d, 0x6604, 0x96b6, 0x0028, 0x1120, 0x080c, + 0x97fd, 0x0804, 0x861d, 0x6604, 0x96b6, 0x0029, 0x1120, 0x080c, + 0x9816, 0x0804, 0x861d, 0x6604, 0x96b6, 0x001f, 0x1118, 0x080c, + 0x807f, 0x04d8, 0x6604, 0x96b6, 0x0000, 0x1118, 0x080c, 0x8356, + 0x04a0, 0x6604, 0x96b6, 0x0022, 0x1118, 0x080c, 0x80ae, 0x0468, + 0x6604, 0x96b6, 0x0035, 0x1118, 0x080c, 0x8199, 0x0430, 0x6604, + 0x96b6, 0x0039, 0x1118, 0x080c, 0x82f2, 0x00f8, 0x6604, 0x96b6, + 0x003d, 0x1118, 0x080c, 0x80c8, 0x00c0, 0x6604, 0x96b6, 0x0044, + 0x1118, 0x080c, 0x80ec, 0x0088, 0x6604, 0x96b6, 0x0049, 0x1118, + 0x080c, 0x8131, 0x0050, 0x91b6, 0x0015, 0x1110, 0x0053, 0x0028, + 0x91b6, 0x0016, 0x1118, 0x0804, 0x87e2, 0x0005, 0x080c, 0x7f68, + 0x0ce0, 0x863b, 0x863e, 0x863b, 0x8682, 0x863b, 0x8762, 0x87f0, + 0x863b, 0x863b, 0x87bc, 0x863b, 0x87d2, 0x00e6, 0x080c, 0x1132, + 0x9cf0, 0x0005, 0x2e74, 0x7000, 0x2070, 0x7067, 0x0103, 0x00ee, + 0x080c, 0x7f1e, 0x0005, 0xa001, 0xa001, 0x0005, 0x00e6, 0x2071, + 0x1100, 0x7080, 0x9086, 0x0074, 0x1540, 0x080c, 0xa836, 0x11b0, + 0x6010, 0x00d6, 0x2068, 0x7030, 0xd08c, 0x0128, 0x6800, 0xd0bc, + 0x0110, 0xc0c5, 0x6802, 0x00e9, 0x00de, 0x2001, 0x0006, 0x080c, + 0x4ab3, 0x080c, 0x25d1, 0x080c, 0x7f1e, 0x0088, 0x2001, 0x000a, + 0x080c, 0x4ab3, 0x080c, 0x25d1, 0x6003, 0x0001, 0x6007, 0x0001, + 0x080c, 0x68ce, 0x080c, 0x6d42, 0x0010, 0x080c, 0x8752, 0x00ee, + 0x0005, 0x6800, 0xd084, 0x0168, 0x2001, 0x0000, 0x080c, 0x4aa1, + 0x2069, 0x1152, 0x6804, 0xd0a4, 0x0120, 0x2001, 0x0006, 0x080c, + 0x4ae0, 0x0005, 0x00d6, 0x2011, 0x1120, 0x2204, 0x9086, 0x0074, + 0x1904, 0x874f, 0x6010, 0x2068, 0x6aa0, 0x9286, 0x007e, 0x1120, + 0x080c, 0x88f8, 0x0804, 0x86f0, 0x080c, 0x88ee, 0x6010, 0x2068, + 0x6aa0, 0x9286, 0x0080, 0x11c0, 0x6813, 0x00ff, 0x6817, 0xfffc, + 0x6014, 0x9005, 0x0138, 0x2068, 0x6807, 0x0000, 0x6867, 0x0103, + 0x6833, 0x0200, 0x2001, 0x0006, 0x080c, 0x4ab3, 0x080c, 0x25d1, + 0x080c, 0x7f1e, 0x0804, 0x8750, 0x00e6, 0x2071, 0x1133, 0x2e04, + 0xd09c, 0x0188, 0x2071, 0x0260, 0x7108, 0x720c, 0x918c, 0x00ff, + 0x1118, 0x9284, 0xff00, 0x0138, 0x6010, 0x2070, 0x70a0, 0xd0bc, + 0x1110, 0x7112, 0x7216, 0x00ee, 0x6014, 0x9005, 0x0198, 0x2068, + 0x6868, 0xd0f4, 0x0178, 0x6864, 0x9084, 0x00ff, 0x9086, 0x0039, + 0x1958, 0x2001, 0x0000, 0x2009, 0x0000, 0x2011, 0x4000, 0x080c, + 0x9a7b, 0x0840, 0x2001, 0x0004, 0x080c, 0x4ab3, 0x6003, 0x0001, + 0x6007, 0x0003, 0x080c, 0x68ce, 0x080c, 0x6d42, 0x0804, 0x8750, + 0x685c, 0xd0e4, 0x01d8, 0x080c, 0x9966, 0x080c, 0x5745, 0x0118, + 0xd0dc, 0x1904, 0x86aa, 0x2011, 0x1133, 0x2204, 0xc0ad, 0x2012, + 0x2001, 0x1280, 0x2004, 0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000, + 0x080c, 0x1cbe, 0x78e2, 0x00fe, 0x0804, 0x86aa, 0x080c, 0x99a3, + 0x2011, 0x1133, 0x2204, 0xc0a5, 0x2012, 0x0006, 0x080c, 0xa966, + 0x000e, 0x1904, 0x86aa, 0xc0b5, 0x2012, 0x2001, 0x0000, 0x080c, + 0x4aa1, 0x00c6, 0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100, 0x79ea, + 0x7932, 0x7936, 0x00fe, 0x080c, 0x1c93, 0x00f6, 0x2079, 0x1100, + 0x7972, 0x2100, 0x2009, 0x0000, 0x080c, 0x1c69, 0x794e, 0x00fe, + 0x8108, 0x080c, 0x4b03, 0x2c00, 0x00ce, 0x1904, 0x86aa, 0x6012, + 0x2001, 0x0002, 0x080c, 0x4ab3, 0x6023, 0x0001, 0x6003, 0x0001, + 0x6007, 0x0002, 0x080c, 0x68ce, 0x080c, 0x6d42, 0x0008, 0x0011, + 0x00de, 0x0005, 0x2030, 0x2001, 0x1100, 0x2004, 0x9086, 0x0003, + 0x0120, 0x2001, 0x0007, 0x080c, 0x4ab3, 0x080c, 0x25d1, 0x080c, + 0x7f1e, 0x0005, 0x00e6, 0x0026, 0x0016, 0x2071, 0x1100, 0x7080, + 0x9086, 0x0014, 0x1904, 0x87b4, 0x7000, 0x9086, 0x0003, 0x1178, + 0x6014, 0x9005, 0x1160, 0x0036, 0x0046, 0x6010, 0x9080, 0x0028, + 0x201c, 0x2021, 0x0006, 0x080c, 0x384a, 0x004e, 0x003e, 0x00d6, + 0x6010, 0x2068, 0x080c, 0x4bf5, 0x080c, 0x8671, 0x00de, 0x080c, + 0x89bf, 0x1550, 0x6010, 0x00d6, 0x2068, 0x6890, 0x00de, 0x9005, + 0x0518, 0x2001, 0x0006, 0x080c, 0x4ab3, 0x00e6, 0x6014, 0x9075, + 0x01a8, 0x7064, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1148, 0x2001, + 0x0000, 0x2009, 0x0000, 0x2011, 0x4000, 0x080c, 0x9a7b, 0x0030, + 0x7007, 0x0000, 0x7067, 0x0103, 0x7033, 0x0200, 0x00ee, 0x080c, + 0x25d1, 0x080c, 0x7f1e, 0x0020, 0x080c, 0x8576, 0x080c, 0x8752, + 0x001e, 0x002e, 0x00ee, 0x0005, 0x2011, 0x1120, 0x2204, 0x9086, + 0x0014, 0x1168, 0x2001, 0x0002, 0x080c, 0x4ab3, 0x6003, 0x0001, + 0x6007, 0x0001, 0x080c, 0x68ce, 0x080c, 0x6d42, 0x0010, 0x080c, + 0x8752, 0x0005, 0x2011, 0x1120, 0x2204, 0x9086, 0x0004, 0x1138, + 0x2001, 0x0007, 0x080c, 0x4ab3, 0x080c, 0x7f1e, 0x0010, 0x080c, + 0x8752, 0x0005, 0x000b, 0x0005, 0x863b, 0x87f7, 0x863b, 0x882d, + 0x863b, 0x88a4, 0x87f0, 0x863b, 0x863b, 0x88b9, 0x863b, 0x88cb, + 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c, 0x7f1e, 0x0005, 0x00d6, + 0x00c6, 0x080c, 0x88dd, 0x1188, 0x2001, 0x0000, 0x080c, 0x4aa1, + 0x2001, 0x0002, 0x080c, 0x4ab3, 0x6003, 0x0001, 0x6007, 0x0002, + 0x080c, 0x68ce, 0x080c, 0x6d42, 0x00e8, 0x2009, 0x026e, 0x2104, + 0x9086, 0x0009, 0x1160, 0x6010, 0x2068, 0x6840, 0x9084, 0x00ff, + 0x9005, 0x0170, 0x8001, 0x6842, 0x601b, 0x000a, 0x0058, 0x2009, + 0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x1900, 0x1108, 0x08c0, + 0x080c, 0x8752, 0x00ce, 0x00de, 0x0005, 0x080c, 0x88eb, 0x00d6, + 0x2069, 0x128f, 0x2d04, 0x9005, 0x0168, 0x6010, 0x2068, 0x68a0, + 0x9086, 0x007e, 0x1138, 0x2069, 0x111c, 0x2d04, 0x8000, 0x206a, + 0x00de, 0x0010, 0x00de, 0x0088, 0x2001, 0x0000, 0x080c, 0x4aa1, + 0x2001, 0x0002, 0x080c, 0x4ab3, 0x6003, 0x0001, 0x6007, 0x0002, + 0x080c, 0x68ce, 0x080c, 0x6d42, 0x0428, 0x080c, 0x8576, 0x2009, + 0x026e, 0x2134, 0x96b4, 0x00ff, 0x9686, 0x0005, 0x01e0, 0x9686, + 0x000b, 0x01b0, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x1118, + 0x9686, 0x0009, 0x0180, 0x9086, 0x1900, 0x1150, 0x9686, 0x0009, + 0x0150, 0x2001, 0x0004, 0x080c, 0x4ab3, 0x080c, 0x7f1e, 0x0010, + 0x080c, 0x8752, 0x0005, 0x00d6, 0x6014, 0x2068, 0x080c, 0x95d2, + 0x0128, 0x6868, 0xd0fc, 0x0110, 0x00de, 0x0c90, 0x6010, 0x2068, + 0x6840, 0x9084, 0x00ff, 0x9005, 0x0140, 0x8001, 0x6842, 0x601b, + 0x000a, 0x6007, 0x0016, 0x00de, 0x0c28, 0x68a0, 0x9086, 0x007e, + 0x1138, 0x00e6, 0x2071, 0x1100, 0x080c, 0x46bb, 0x00ee, 0x0010, + 0x080c, 0x25ad, 0x00de, 0x08a0, 0x080c, 0x88eb, 0x1168, 0x2001, + 0x0004, 0x080c, 0x4ab3, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c, + 0x68ce, 0x080c, 0x6d42, 0x0020, 0x080c, 0x8576, 0x080c, 0x8752, + 0x0005, 0x0489, 0x1168, 0x2001, 0x0008, 0x080c, 0x4ab3, 0x6003, + 0x0001, 0x6007, 0x0005, 0x080c, 0x68ce, 0x080c, 0x6d42, 0x0010, + 0x080c, 0x8752, 0x0005, 0x00f9, 0x1168, 0x2001, 0x000a, 0x080c, + 0x4ab3, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x68ce, 0x080c, + 0x6d42, 0x0010, 0x080c, 0x8752, 0x0005, 0x2009, 0x026e, 0x2104, + 0x9086, 0x0003, 0x1138, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, + 0x9086, 0x2a00, 0x0005, 0x9085, 0x0001, 0x0005, 0x00c6, 0x0016, + 0x9c88, 0x0004, 0x2164, 0x080c, 0x4b67, 0x001e, 0x00ce, 0x0005, + 0x00f6, 0x00e6, 0x00d6, 0x0036, 0x0016, 0x6010, 0x2068, 0x2009, + 0x1133, 0x2104, 0x9085, 0x0003, 0x200a, 0x080c, 0x8994, 0x0570, + 0x2009, 0x1133, 0x2104, 0xc0cd, 0x200a, 0x2001, 0x1153, 0x2004, + 0xd0a4, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xaaca, + 0x2001, 0x110c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009, + 0x0001, 0x080c, 0x2582, 0x00e6, 0x2071, 0x1100, 0x080c, 0x23cd, + 0x00ee, 0x00c6, 0x0156, 0x20a9, 0x0081, 0x2009, 0x007f, 0x080c, + 0x26a3, 0x8108, 0x1f04, 0x892f, 0x015e, 0x00ce, 0x080c, 0x88ee, + 0x6813, 0x00ff, 0x6817, 0xfffe, 0x2071, 0x0260, 0x2079, 0x0200, + 0x7817, 0x0001, 0x2001, 0x1133, 0x200c, 0xc1c5, 0x7018, 0xd0fc, + 0x0110, 0xd0dc, 0x0118, 0x7038, 0xd0dc, 0x1108, 0xc1c4, 0x7817, + 0x0000, 0x2001, 0x1133, 0x2102, 0x2079, 0x0100, 0x2e04, 0x9084, + 0x00ff, 0x2069, 0x111b, 0x206a, 0x78e6, 0x0006, 0x8e70, 0x2e04, + 0x2069, 0x111c, 0x206a, 0x78ea, 0x7832, 0x7836, 0x2010, 0x9084, + 0xff00, 0x001e, 0x9105, 0x2009, 0x1127, 0x200a, 0x2200, 0x9084, + 0x00ff, 0x2008, 0x080c, 0x1c93, 0x080c, 0x5745, 0x0170, 0x2071, + 0x0260, 0x2069, 0x12a2, 0x7048, 0x206a, 0x704c, 0x6806, 0x7050, + 0x680a, 0x7054, 0x680e, 0x080c, 0x9966, 0x0040, 0x2001, 0x0006, + 0x080c, 0x4ab3, 0x080c, 0x25d1, 0x080c, 0x7f1e, 0x001e, 0x003e, + 0x00de, 0x00ee, 0x00fe, 0x0005, 0x0026, 0x0036, 0x00e6, 0x0156, + 0x2019, 0x1127, 0x231c, 0x83ff, 0x01e8, 0x2071, 0x0260, 0x7200, + 0x9294, 0x00ff, 0x7004, 0x9084, 0xff00, 0x9205, 0x9306, 0x1190, + 0x2011, 0x0276, 0x20a9, 0x0004, 0x9d98, 0x000a, 0x080c, 0x8a45, + 0x1148, 0x2011, 0x027a, 0x20a9, 0x0004, 0x9d98, 0x0006, 0x080c, + 0x8a45, 0x1100, 0x015e, 0x00ee, 0x003e, 0x002e, 0x0005, 0x00e6, + 0x2071, 0x0260, 0x7034, 0x9086, 0x0014, 0x11a8, 0x7038, 0x9086, + 0x0800, 0x1188, 0x703c, 0xd0ec, 0x0160, 0x9084, 0x0f00, 0x9086, + 0x0100, 0x1138, 0x7054, 0xd0a4, 0x1110, 0xd0ac, 0x0110, 0x9006, + 0x0010, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6, 0x00d6, 0x00c6, + 0x0076, 0x0056, 0x0046, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, + 0x2029, 0x12e5, 0x252c, 0x2021, 0x12eb, 0x2424, 0x2061, 0x15c0, + 0x2071, 0x1100, 0x7244, 0x7064, 0x9202, 0x16f0, 0x080c, 0xaaf2, + 0x05a0, 0x6720, 0x9786, 0x0001, 0x0580, 0x9786, 0x0007, 0x0568, + 0x2500, 0x9c06, 0x0550, 0x2400, 0x9c06, 0x0538, 0x00c6, 0x6000, + 0x9086, 0x0004, 0x1110, 0x080c, 0x12c7, 0x9786, 0x0008, 0x1148, + 0x080c, 0x97cd, 0x1130, 0x00ce, 0x080c, 0x8576, 0x080c, 0x97a3, + 0x00a0, 0x6014, 0x2068, 0x080c, 0x95d2, 0x0160, 0x9786, 0x0003, + 0x11e8, 0x6867, 0x0103, 0x6b7a, 0x6877, 0x0000, 0x080c, 0x50a5, + 0x080c, 0x9797, 0x080c, 0x97a3, 0x00ce, 0x9ce0, 0x0018, 0x7058, + 0x9c02, 0x1210, 0x0804, 0x89f2, 0x012e, 0x000e, 0x002e, 0x004e, + 0x005e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x9786, 0x0006, + 0x1118, 0x080c, 0xaa84, 0x0c30, 0x08e0, 0x220c, 0x2304, 0x9106, + 0x1130, 0x8210, 0x8318, 0x1f04, 0x8a45, 0x9006, 0x0005, 0x2304, + 0x9102, 0x0218, 0x2001, 0x0001, 0x0010, 0x2001, 0x0000, 0x918d, + 0x0001, 0x0005, 0x0136, 0x01c6, 0x0016, 0x0026, 0x080c, 0x0d7e, + 0x2100, 0x22e0, 0x9300, 0x2098, 0x3518, 0x20a9, 0x0001, 0x002e, + 0x220c, 0x4002, 0x910e, 0x1140, 0x8210, 0x8319, 0x1dc8, 0x9006, + 0x001e, 0x01ce, 0x013e, 0x0005, 0x220c, 0x9102, 0x0218, 0x2001, + 0x0001, 0x0010, 0x2001, 0x0000, 0x918d, 0x0001, 0x001e, 0x01ce, + 0x013e, 0x0005, 0x6004, 0x908a, 0x004c, 0x1a0c, 0x0cf1, 0x080c, + 0x97bc, 0x0120, 0x080c, 0x97cd, 0x0168, 0x0028, 0x080c, 0x25d1, + 0x080c, 0x97cd, 0x0138, 0x080c, 0x6c56, 0x080c, 0x7f1e, 0x080c, + 0x6d42, 0x0005, 0x080c, 0x8576, 0x0cb0, 0x9182, 0x0040, 0x0002, + 0x8ab3, 0x8ab3, 0x8ab3, 0x8ab3, 0x8ab3, 0x8ab3, 0x8ab3, 0x8ab3, + 0x8ab3, 0x8ab3, 0x8ab3, 0x8ab5, 0x8ab5, 0x8ab5, 0x8ab5, 0x8ab3, + 0x8ab3, 0x8ab3, 0x8ab5, 0x080c, 0x0cf1, 0x600b, 0xffff, 0x6003, + 0x0001, 0x6106, 0x080c, 0x6886, 0x0126, 0x2091, 0x8000, 0x080c, + 0x6d42, 0x012e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082, + 0x0040, 0x0804, 0x8b4d, 0x9186, 0x0027, 0x11e8, 0x080c, 0x6c56, + 0x080c, 0x25ad, 0x00d6, 0x6114, 0x2168, 0x080c, 0x95d2, 0x0168, + 0x6867, 0x0103, 0x687b, 0x0029, 0x6877, 0x0000, 0x697c, 0xc1c5, + 0x697e, 0x080c, 0x50a5, 0x080c, 0x9797, 0x00de, 0x080c, 0x7f1e, + 0x080c, 0x6d42, 0x0005, 0x9186, 0x0014, 0x1120, 0x6004, 0x9082, + 0x0040, 0x0418, 0x9186, 0x0046, 0x0138, 0x9186, 0x0045, 0x0120, + 0x9186, 0x0048, 0x190c, 0x0cf1, 0x2001, 0x0109, 0x2004, 0xd084, + 0x0198, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x080c, + 0x677e, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001, 0x6000, 0x9086, + 0x0002, 0x1110, 0x0804, 0x8b8c, 0x0005, 0x0002, 0x8b2b, 0x8b29, + 0x8b29, 0x8b29, 0x8b29, 0x8b29, 0x8b29, 0x8b29, 0x8b29, 0x8b29, + 0x8b29, 0x8b46, 0x8b46, 0x8b46, 0x8b46, 0x8b29, 0x8b46, 0x8b29, + 0x8b46, 0x080c, 0x0cf1, 0x080c, 0x6c56, 0x00d6, 0x6114, 0x2168, + 0x080c, 0x95d2, 0x0168, 0x6867, 0x0103, 0x687b, 0x0006, 0x6877, + 0x0000, 0x6880, 0xc0ec, 0x6882, 0x080c, 0x50a5, 0x080c, 0x9797, + 0x00de, 0x080c, 0x7f1e, 0x080c, 0x6d42, 0x0005, 0x080c, 0x6c56, + 0x080c, 0x7f1e, 0x080c, 0x6d42, 0x0005, 0x0002, 0x8b63, 0x8b61, + 0x8b61, 0x8b61, 0x8b61, 0x8b61, 0x8b61, 0x8b61, 0x8b61, 0x8b61, + 0x8b61, 0x8b7a, 0x8b7a, 0x8b7a, 0x8b7a, 0x8b61, 0x8b85, 0x8b61, + 0x8b7a, 0x080c, 0x0cf1, 0x00d6, 0x080c, 0x6c56, 0x6014, 0x2068, + 0x2001, 0x12a8, 0x2004, 0x6042, 0x697c, 0xd1ac, 0x0140, 0x6003, + 0x0004, 0x687c, 0x9085, 0x0400, 0x687e, 0x00de, 0x0005, 0x6003, + 0x0002, 0x0cb8, 0x080c, 0x6c56, 0x2001, 0x12a8, 0x2004, 0x6042, + 0x6003, 0x000f, 0x080c, 0x6d42, 0x0005, 0x080c, 0x6c56, 0x080c, + 0x7f1e, 0x080c, 0x6d42, 0x0005, 0x9182, 0x0040, 0x0002, 0x8ba3, + 0x8ba3, 0x8ba3, 0x8ba3, 0x8ba3, 0x8ba5, 0x8c7a, 0x8ba3, 0x8ba3, + 0x8ba3, 0x8ba3, 0x8ba3, 0x8ba3, 0x8ba3, 0x8ba3, 0x8ba3, 0x8ba3, + 0x8ba3, 0x8ba3, 0x8ca9, 0x080c, 0x0cf1, 0x00d6, 0x6114, 0x2168, + 0x7644, 0x96b4, 0x0fff, 0x86ff, 0x1508, 0x6010, 0x2004, 0xd0bc, + 0x1904, 0x8c65, 0x687b, 0x0000, 0x6867, 0x0103, 0x6e76, 0x687c, + 0xd0ac, 0x0128, 0x6834, 0x6938, 0x9115, 0x190c, 0x8dfb, 0x080c, + 0x4ed6, 0x6210, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x7044, 0xd0e4, + 0x1904, 0x8c4b, 0x080c, 0x7f1e, 0x00de, 0x0005, 0x968c, 0x0c00, + 0x0148, 0x6010, 0x2004, 0xd0bc, 0x1904, 0x8c4f, 0x7348, 0x6b92, + 0x734c, 0x6b8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0508, 0x9186, + 0x0028, 0x1118, 0x687b, 0x001c, 0x00e8, 0xd6dc, 0x01a0, 0x687b, + 0x0015, 0x687c, 0xd0ac, 0x0170, 0x6938, 0x6a34, 0x2100, 0x9205, + 0x0148, 0x7048, 0x9106, 0x1118, 0x734c, 0x9206, 0x0118, 0x6992, + 0x6a8e, 0xc6dc, 0x0038, 0xd6d4, 0x0118, 0x687b, 0x0007, 0x0010, + 0x687b, 0x0000, 0x6867, 0x0103, 0x6e76, 0x901e, 0xd6c4, 0x01d8, + 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4, 0x0804, + 0x8bab, 0x735c, 0x6b86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, + 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x9d90, 0x0025, + 0x080c, 0x927a, 0x003e, 0xd6cc, 0x0904, 0x8bbf, 0x7154, 0x698a, + 0x81ff, 0x0904, 0x8bbf, 0x9192, 0x0021, 0x1268, 0x8304, 0x9098, + 0x0018, 0x9d90, 0x0029, 0x080c, 0x927a, 0x2011, 0x0205, 0x2013, + 0x0000, 0x0804, 0x8bbf, 0x6868, 0xd0fc, 0x0120, 0x2009, 0x0020, + 0x698a, 0x0c60, 0x00f6, 0x2d78, 0x080c, 0x9219, 0x00fe, 0x080c, + 0x926a, 0x0804, 0x8bc1, 0x080c, 0x987a, 0x0804, 0x8bcc, 0x687c, + 0xd0ac, 0x0904, 0x8bd6, 0x6024, 0xd0dc, 0x1904, 0x8bd6, 0x6880, + 0xd0bc, 0x1904, 0x8bd6, 0x7348, 0x6838, 0x9306, 0x11b8, 0x734c, + 0x6834, 0x9306, 0x0904, 0x8bd6, 0x0088, 0x687c, 0xd0ac, 0x0904, + 0x8bb2, 0x6838, 0x6934, 0x9105, 0x0904, 0x8bb2, 0x6024, 0xd0dc, + 0x1904, 0x8bb2, 0x6880, 0xd0bc, 0x1904, 0x8bb2, 0x080c, 0x98aa, + 0x0804, 0x8bcc, 0x00f6, 0x6003, 0x0003, 0x2079, 0x026c, 0x7c04, + 0x7b00, 0x7e0c, 0x7d08, 0x6014, 0x2078, 0x787c, 0xd0ac, 0x0138, + 0x6003, 0x0002, 0x00fe, 0x0005, 0x2130, 0x2228, 0x0058, 0x2400, + 0x79ac, 0x910a, 0x2300, 0x7ab0, 0x9213, 0x2600, 0x9102, 0x2500, + 0x9203, 0x0e90, 0x7c36, 0x7b3a, 0x7e46, 0x7d4a, 0x00fe, 0x6043, + 0x0000, 0x2c10, 0x080c, 0x13a9, 0x080c, 0x68eb, 0x080c, 0x6e10, + 0x0005, 0x0005, 0x9182, 0x0040, 0x0002, 0x8cc0, 0x8cc0, 0x8cc0, + 0x8cc0, 0x8cc0, 0x8cc2, 0x8d54, 0x8cc0, 0x8cc0, 0x8d6a, 0x8dd2, + 0x8cc0, 0x8cc0, 0x8cc0, 0x8cc0, 0x8de1, 0x8cc0, 0x8cc0, 0x8cc0, + 0x080c, 0x0cf1, 0x0076, 0x00f6, 0x00e6, 0x00d6, 0x2071, 0x0260, + 0x6114, 0x2178, 0x7644, 0x7e76, 0x96b4, 0x0fff, 0x7f7c, 0xc7e5, + 0x7f7e, 0x6210, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0904, + 0x8d4f, 0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048, 0x7892, + 0x704c, 0x788e, 0x9284, 0x0300, 0x0904, 0x8d4f, 0x080c, 0x0ddf, + 0x090c, 0x0cf1, 0x2d00, 0x787a, 0x7f7c, 0xc7cd, 0x7f7e, 0x6867, + 0x0103, 0x7868, 0x686a, 0x786c, 0x686e, 0x7870, 0x6872, 0x6e76, + 0x968c, 0x0c00, 0x0120, 0x7348, 0x6b92, 0x734c, 0x6b8e, 0x968c, + 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186, 0x0028, 0x1118, 0x687b, + 0x001c, 0x0060, 0xd6dc, 0x0118, 0x687b, 0x0015, 0x0038, 0xd6d4, + 0x0118, 0x687b, 0x0007, 0x0010, 0x687b, 0x0000, 0x6f7e, 0x7880, + 0x6882, 0x7884, 0x6886, 0x901e, 0xd6c4, 0x0190, 0x735c, 0x6b86, + 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036, + 0x2308, 0x2019, 0x0018, 0x9d90, 0x0025, 0x080c, 0x927a, 0x003e, + 0xd6cc, 0x01e8, 0x7154, 0x698a, 0x81ff, 0x01c8, 0x9192, 0x0021, + 0x1260, 0x8304, 0x9098, 0x0018, 0x9d90, 0x0029, 0x080c, 0x927a, + 0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0x7868, 0xd0fc, 0x0120, + 0x2009, 0x0020, 0x698a, 0x0c68, 0x2d78, 0x080c, 0x9219, 0x00de, + 0x00ee, 0x00fe, 0x007e, 0x0005, 0x00f6, 0x6003, 0x0003, 0x2079, + 0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6014, 0x2078, 0x7c36, + 0x7b3a, 0x7e46, 0x7d4a, 0x00fe, 0x2c10, 0x080c, 0x13a9, 0x080c, + 0x76ee, 0x0005, 0x00d6, 0x2001, 0x12a8, 0x2004, 0x6042, 0x6003, + 0x0002, 0x080c, 0x6cf2, 0x080c, 0x6e10, 0x6114, 0x2168, 0x697c, + 0xd1e4, 0x0904, 0x8dcd, 0xd1cc, 0x0570, 0x6978, 0x6868, 0xd0fc, + 0x0500, 0x0016, 0x687c, 0x0006, 0x6880, 0x0006, 0x9d90, 0x0019, + 0x9198, 0x0019, 0x2009, 0x0020, 0x0156, 0x21a8, 0x2304, 0x2012, + 0x8318, 0x8210, 0x1f04, 0x8d8e, 0x015e, 0x000e, 0x6882, 0x000e, + 0x687e, 0x001e, 0x6874, 0x0006, 0x2168, 0x080c, 0x0e06, 0x001e, + 0x0440, 0x0016, 0x080c, 0x0e06, 0x00de, 0x6974, 0x0016, 0x080c, + 0x926a, 0x001e, 0x00f0, 0x6867, 0x0103, 0x6974, 0x9184, 0x00ff, + 0x90b6, 0x0002, 0x0180, 0x9086, 0x0028, 0x1118, 0x687b, 0x001c, + 0x0060, 0xd1dc, 0x0118, 0x687b, 0x0015, 0x0038, 0xd1d4, 0x0118, + 0x687b, 0x0007, 0x0010, 0x687b, 0x0000, 0x0016, 0x080c, 0x4ed6, + 0x001e, 0xd1e4, 0x1120, 0x080c, 0x7f1e, 0x00de, 0x0005, 0x080c, + 0x987a, 0x0cd8, 0x2019, 0x0001, 0x080c, 0x7936, 0x6003, 0x0002, + 0x2001, 0x12a8, 0x2004, 0x6042, 0x080c, 0x6cf2, 0x080c, 0x6e10, + 0x0005, 0x080c, 0x6cf2, 0x080c, 0x25ad, 0x00d6, 0x6114, 0x2168, + 0x080c, 0x95d2, 0x0150, 0x6867, 0x0103, 0x687b, 0x0029, 0x6877, + 0x0000, 0x080c, 0x50a5, 0x080c, 0x9797, 0x00de, 0x080c, 0x7f1e, + 0x080c, 0x6e10, 0x0005, 0x687b, 0x0015, 0xd1fc, 0x0138, 0x687b, + 0x0007, 0x8002, 0x8000, 0x810a, 0x9189, 0x0000, 0x6992, 0x688e, + 0x0005, 0x9182, 0x0040, 0x0002, 0x8e20, 0x8e20, 0x8e20, 0x8e20, + 0x8e20, 0x8e22, 0x8e20, 0x8e20, 0x8ec0, 0x8e20, 0x8e20, 0x8e20, + 0x8e20, 0x8e20, 0x8e20, 0x8e20, 0x8e20, 0x8e20, 0x8e20, 0x8fdc, + 0x080c, 0x0cf1, 0x0076, 0x00f6, 0x00e6, 0x00d6, 0x2071, 0x0260, + 0x6114, 0x2178, 0x7644, 0x7e76, 0x96b4, 0x0fff, 0x7f7c, 0xc7e5, + 0x7f7e, 0x6210, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0904, + 0x8eb9, 0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048, 0x7892, + 0x704c, 0x788e, 0x9284, 0x0300, 0x0904, 0x8eb9, 0x9686, 0x0100, + 0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4, 0x7e76, 0x0c38, 0x080c, + 0x0ddf, 0x090c, 0x0cf1, 0x2d00, 0x787a, 0x7f7c, 0x97bd, 0x0200, + 0x7f7e, 0x6867, 0x0103, 0x7868, 0x686a, 0x786c, 0x686e, 0x7870, + 0x6872, 0x6e76, 0x968c, 0x0c00, 0x0120, 0x7348, 0x6b92, 0x734c, + 0x6b8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186, 0x0028, + 0x1118, 0x687b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0x687b, 0x0015, + 0x0038, 0xd6d4, 0x0118, 0x687b, 0x0007, 0x0010, 0x687b, 0x0000, + 0x6f7e, 0x7880, 0x6882, 0x7884, 0x6886, 0x901e, 0xd6c4, 0x0190, + 0x735c, 0x6b86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019, + 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x9d90, 0x0025, 0x080c, + 0x927a, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0x698a, 0x81ff, 0x01c8, + 0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x9d90, 0x0029, + 0x080c, 0x927a, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0x7868, + 0xd0fc, 0x0120, 0x2009, 0x0020, 0x698a, 0x0c68, 0x2d78, 0x080c, + 0x9219, 0x080c, 0x12a4, 0x00de, 0x00ee, 0x00fe, 0x007e, 0x0005, + 0x2001, 0x12a8, 0x2004, 0x6042, 0x00d6, 0x6114, 0x2168, 0x683c, + 0x6940, 0x9105, 0x1118, 0x687c, 0xc0dc, 0x687e, 0x6003, 0x0002, + 0x697c, 0xd1e4, 0x0904, 0x8fd7, 0x6043, 0x0000, 0x6010, 0x2004, + 0xd0bc, 0x11f8, 0xd1cc, 0x0904, 0x8fa6, 0x6978, 0x6868, 0xd0fc, + 0x0904, 0x8f69, 0x0016, 0x687c, 0x0006, 0x6880, 0x0006, 0x00f6, + 0x2178, 0x7974, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x0904, 0x8f3e, + 0x9086, 0x0028, 0x15b8, 0x687b, 0x001c, 0x787b, 0x001c, 0x0804, + 0x8f46, 0x6024, 0xd0f4, 0x11d0, 0x6838, 0x6a34, 0x9205, 0x09d0, + 0x6838, 0x6a90, 0x9206, 0x1120, 0x688c, 0x6a34, 0x9206, 0x0990, + 0x6024, 0xd0d4, 0x1148, 0x69ac, 0x6834, 0x9102, 0x603a, 0x69b0, + 0x6838, 0x9103, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x6010, 0x00d6, + 0x2068, 0x683c, 0x8000, 0x683e, 0x00de, 0x687c, 0xc0e4, 0x687e, + 0x6877, 0x0000, 0x6893, 0x0000, 0x688f, 0x0000, 0x080c, 0x98aa, + 0x0804, 0x8fd7, 0xd1dc, 0x0158, 0x687b, 0x0015, 0x787b, 0x0015, + 0x080c, 0x9a64, 0x0118, 0x7974, 0xc1dc, 0x7976, 0x0078, 0xd1d4, + 0x0128, 0x687b, 0x0007, 0x787b, 0x0007, 0x0040, 0x687c, 0xd0ac, + 0x0128, 0x6834, 0x6938, 0x9115, 0x190c, 0x8dfb, 0x6878, 0x787a, + 0x6890, 0x7892, 0x688c, 0x788e, 0x9d90, 0x0019, 0x9f98, 0x0019, + 0x2009, 0x0020, 0x0156, 0x21a8, 0x2304, 0x2012, 0x8318, 0x8210, + 0x1f04, 0x8f54, 0x015e, 0x00fe, 0x000e, 0x6882, 0x000e, 0x687e, + 0x001e, 0x6874, 0x0006, 0x2168, 0x080c, 0x0e06, 0x001e, 0x0804, + 0x8fd3, 0x0016, 0x00f6, 0x2178, 0x7974, 0x9184, 0x00ff, 0x90b6, + 0x0002, 0x01e0, 0x9086, 0x0028, 0x1128, 0x687b, 0x001c, 0x787b, + 0x001c, 0x00e0, 0xd1dc, 0x0158, 0x687b, 0x0015, 0x787b, 0x0015, + 0x080c, 0x9a64, 0x0118, 0x7974, 0xc1dc, 0x7976, 0x0078, 0xd1d4, + 0x0128, 0x687b, 0x0007, 0x787b, 0x0007, 0x0040, 0x687c, 0xd0ac, + 0x0128, 0x6834, 0x6938, 0x9115, 0x190c, 0x8dfb, 0x6890, 0x7892, + 0x688c, 0x788e, 0x687c, 0x787e, 0x00fe, 0x080c, 0x0e06, 0x00de, + 0x6974, 0x0016, 0x080c, 0x926a, 0x001e, 0x0468, 0x6867, 0x0103, + 0x6974, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028, + 0x1118, 0x687b, 0x001c, 0x00d0, 0xd1dc, 0x0148, 0x687b, 0x0015, + 0x080c, 0x9a64, 0x0118, 0x6974, 0xc1dc, 0x6976, 0x0078, 0xd1d4, + 0x0118, 0x687b, 0x0007, 0x0050, 0x687b, 0x0000, 0x687c, 0xd0ac, + 0x0128, 0x6834, 0x6938, 0x9115, 0x190c, 0x8dfb, 0x6974, 0x0016, + 0x080c, 0x4ed6, 0x001e, 0xd1e4, 0x1120, 0x080c, 0x7f1e, 0x00de, + 0x0005, 0x080c, 0x987a, 0x0cd8, 0x0005, 0x080c, 0x6c56, 0x0010, + 0x080c, 0x6cf2, 0x080c, 0x95d2, 0x01c0, 0x00d6, 0x6114, 0x2168, + 0x6867, 0x0103, 0x2009, 0x110c, 0x210c, 0xd18c, 0x11c0, 0xd184, + 0x1198, 0x6108, 0x697a, 0x918e, 0x0029, 0x1110, 0x080c, 0xad5f, + 0x6877, 0x0000, 0x080c, 0x50a5, 0x00de, 0x080c, 0x7f1e, 0x080c, + 0x6d42, 0x080c, 0x6e10, 0x0005, 0x687b, 0x0004, 0x0c88, 0x687b, + 0x0004, 0x0c70, 0x9182, 0x0040, 0x0002, 0x9020, 0x9020, 0x9020, + 0x9020, 0x9020, 0x9022, 0x9020, 0x9025, 0x9020, 0x9020, 0x9020, + 0x9020, 0x9020, 0x9020, 0x9020, 0x9020, 0x9020, 0x9020, 0x9020, + 0x080c, 0x0cf1, 0x080c, 0x7f1e, 0x0005, 0x0006, 0x0026, 0x9016, + 0x080c, 0x119a, 0x002e, 0x000e, 0x0005, 0x9182, 0x0085, 0x0002, + 0x903d, 0x903b, 0x903b, 0x9049, 0x903b, 0x903b, 0x903b, 0x903b, + 0x903b, 0x903b, 0x903b, 0x080c, 0x0cf1, 0x6003, 0x0001, 0x6106, + 0x080c, 0x6886, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d42, 0x012e, + 0x0005, 0x0026, 0x0056, 0x00d6, 0x00e6, 0x2071, 0x0260, 0x7224, + 0x6216, 0x7220, 0x080c, 0x95c2, 0x01a0, 0x2268, 0x6800, 0x9086, + 0x0000, 0x0178, 0x6010, 0x6d10, 0x952e, 0x1158, 0x00c6, 0x2d60, + 0x080c, 0x9297, 0x00ce, 0x0128, 0x6803, 0x0002, 0x6007, 0x0086, + 0x0010, 0x6007, 0x0087, 0x6003, 0x0001, 0x080c, 0x6886, 0x080c, + 0x6d42, 0x9280, 0x0004, 0x2004, 0xd0bc, 0x0150, 0x6824, 0xd0ec, + 0x0138, 0x00c6, 0x2260, 0x6043, 0x0000, 0x080c, 0x98aa, 0x00ce, + 0x00ee, 0x00de, 0x005e, 0x002e, 0x0005, 0x9186, 0x0013, 0x1160, + 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0cf1, 0x908a, 0x0090, 0x1a0c, + 0x0cf1, 0x9082, 0x0085, 0x0072, 0x9186, 0x0027, 0x0120, 0x9186, + 0x0014, 0x190c, 0x0cf1, 0x080c, 0x6c56, 0x080c, 0x97a3, 0x080c, + 0x6d42, 0x0005, 0x90ad, 0x90af, 0x90af, 0x90ad, 0x90ad, 0x90ad, + 0x90ad, 0x90ad, 0x90ad, 0x90ad, 0x90ad, 0x080c, 0x0cf1, 0x080c, + 0x6c56, 0x080c, 0x97a3, 0x080c, 0x6d42, 0x0005, 0x9186, 0x0013, + 0x1128, 0x6004, 0x9082, 0x0085, 0x2008, 0x04a8, 0x9186, 0x0027, + 0x11e8, 0x080c, 0x6c56, 0x080c, 0x25ad, 0x00d6, 0x6014, 0x2068, + 0x080c, 0x95d2, 0x0150, 0x6867, 0x0103, 0x6877, 0x0000, 0x687b, + 0x0029, 0x080c, 0x50a5, 0x080c, 0x9797, 0x00de, 0x080c, 0x7f1e, + 0x080c, 0x6d42, 0x0005, 0x080c, 0x7f68, 0x0ce0, 0x9186, 0x0014, + 0x1dd0, 0x080c, 0x6c56, 0x00d6, 0x6014, 0x2068, 0x080c, 0x95d2, + 0x0d60, 0x6867, 0x0103, 0x6877, 0x0000, 0x687b, 0x0006, 0x6880, + 0xc0ec, 0x6882, 0x08f0, 0x0002, 0x9101, 0x90ff, 0x90ff, 0x90ff, + 0x90ff, 0x90ff, 0x9119, 0x90ff, 0x90ff, 0x90ff, 0x90ff, 0x080c, + 0x0cf1, 0x080c, 0x6c56, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, + 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x12a6, 0x0010, + 0x2001, 0x12a7, 0x2004, 0x601a, 0x6003, 0x000c, 0x080c, 0x6d42, + 0x0005, 0x080c, 0x6c56, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, + 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x12a6, 0x0010, + 0x2001, 0x12a7, 0x2004, 0x601a, 0x6003, 0x000e, 0x080c, 0x6d42, + 0x0005, 0x9182, 0x0090, 0x1220, 0x9182, 0x0085, 0x0208, 0x001a, + 0x080c, 0x7f68, 0x0005, 0x9146, 0x9146, 0x9146, 0x9146, 0x9148, + 0x919b, 0x9146, 0x9146, 0x9146, 0x9146, 0x9146, 0x080c, 0x0cf1, + 0x00d6, 0x6010, 0x2004, 0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00, + 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x00de, + 0x0804, 0x91ac, 0x080c, 0x9797, 0x080c, 0x95d2, 0x01c8, 0x6014, + 0x2068, 0x6867, 0x0103, 0x6880, 0xd0b4, 0x0128, 0x687b, 0x0006, + 0xc0ec, 0x6882, 0x0048, 0xd0bc, 0x0118, 0x687b, 0x0002, 0x0020, + 0x687b, 0x0005, 0x080c, 0x9849, 0x6877, 0x0000, 0x080c, 0x50a5, + 0x2c68, 0x080c, 0x7ec8, 0x01d0, 0x6003, 0x0001, 0x6007, 0x001e, + 0x600b, 0xffff, 0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f, + 0x210c, 0x613e, 0x6910, 0x6112, 0x080c, 0x99cc, 0x6954, 0x6156, + 0x6023, 0x0001, 0x080c, 0x6886, 0x080c, 0x6d42, 0x2d60, 0x080c, + 0x7f1e, 0x00de, 0x0005, 0x6010, 0x2004, 0xd0bc, 0x0598, 0x6034, + 0x908c, 0xff00, 0x810f, 0x9186, 0x0035, 0x0130, 0x9186, 0x001e, + 0x0118, 0x9186, 0x0039, 0x1530, 0x00d6, 0x2c68, 0x080c, 0x9ac5, + 0x1904, 0x91f1, 0x080c, 0x7ec8, 0x01d8, 0x6106, 0x6003, 0x0001, + 0x6023, 0x0001, 0x6910, 0x6112, 0x692c, 0x612e, 0x6930, 0x6132, + 0x6934, 0x918c, 0x00ff, 0x6136, 0x6938, 0x613a, 0x693c, 0x613e, + 0x6954, 0x6156, 0x080c, 0x99cc, 0x080c, 0x6886, 0x080c, 0x6d42, + 0x2d60, 0x00f8, 0x00d6, 0x6014, 0x2068, 0x080c, 0x95d2, 0x01c8, + 0x6867, 0x0103, 0x6880, 0xd0b4, 0x0128, 0xc0ec, 0x6882, 0x687b, + 0x0006, 0x0048, 0xd0bc, 0x0118, 0x687b, 0x0002, 0x0020, 0x687b, + 0x0005, 0x080c, 0x9849, 0x6877, 0x0000, 0x080c, 0x50a5, 0x080c, + 0x9797, 0x00de, 0x080c, 0x7f1e, 0x0005, 0x0016, 0x00d6, 0x6014, + 0x2068, 0x080c, 0x95d2, 0x0140, 0x6867, 0x0103, 0x687b, 0x0028, + 0x6877, 0x0000, 0x080c, 0x50a5, 0x00de, 0x001e, 0x9186, 0x0013, + 0x0148, 0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, + 0x7f68, 0x0030, 0x080c, 0x6c56, 0x080c, 0x97a3, 0x080c, 0x6d42, + 0x0005, 0x0056, 0x0066, 0x00d6, 0x00f6, 0x2029, 0x0001, 0x9182, + 0x0101, 0x1208, 0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098, + 0x0018, 0x2009, 0x0020, 0x9f90, 0x0029, 0x080c, 0x927a, 0x96b2, + 0x0020, 0x7804, 0x906d, 0x0110, 0x080c, 0x0e06, 0x080c, 0x0ddf, + 0x0520, 0x8528, 0x6867, 0x0110, 0x686b, 0x0000, 0x2d20, 0x7c06, + 0x968a, 0x003d, 0x1228, 0x2608, 0x9d90, 0x001b, 0x0499, 0x00a8, + 0x96b2, 0x003c, 0x2009, 0x003c, 0x2d78, 0x9d90, 0x001b, 0x0451, + 0x0c28, 0x2079, 0x0200, 0x7817, 0x0000, 0x00fe, 0x852f, 0x95ad, + 0x0003, 0x7d66, 0x95ac, 0x0000, 0x0048, 0x2079, 0x0200, 0x7817, + 0x0000, 0x00fe, 0x852f, 0x95ad, 0x0003, 0x7d66, 0x00de, 0x006e, + 0x005e, 0x0005, 0x00f6, 0x8dff, 0x0158, 0x6804, 0x907d, 0x0130, + 0x6807, 0x0000, 0x080c, 0x50a5, 0x2f68, 0x0cb8, 0x080c, 0x50a5, + 0x00fe, 0x0005, 0x00f6, 0x0156, 0x2079, 0x0200, 0x9184, 0x0001, + 0x0108, 0x8108, 0x810c, 0x21a8, 0x2300, 0x9e00, 0x2004, 0x8007, + 0x2012, 0x8318, 0x9386, 0x0020, 0x1120, 0x2018, 0x7814, 0x8000, + 0x7816, 0x8210, 0x1f04, 0x9284, 0x015e, 0x00fe, 0x0005, 0x0066, + 0x0126, 0x2091, 0x8000, 0x2031, 0x0001, 0x6020, 0x9084, 0x000f, + 0x0083, 0x012e, 0x006e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0066, + 0x2031, 0x0000, 0x6020, 0x9084, 0x000f, 0x001b, 0x006e, 0x012e, + 0x0005, 0x92d1, 0x92d1, 0x92cc, 0x92f3, 0x92bf, 0x92cc, 0x92f3, + 0x92cc, 0x92bf, 0x92bf, 0x92cc, 0x92cc, 0x92cc, 0x92bf, 0x080c, + 0x0cf1, 0x0036, 0x2019, 0x0010, 0x080c, 0xa6bc, 0x6023, 0x0006, + 0x6003, 0x0007, 0x003e, 0x0005, 0x9006, 0x0005, 0x9085, 0x0001, + 0x0005, 0x00d6, 0x86ff, 0x11d8, 0x6014, 0x2068, 0x080c, 0x95d2, + 0x01c0, 0x6864, 0x9086, 0x0139, 0x1128, 0x687b, 0x0005, 0x6883, + 0x0000, 0x0028, 0x900e, 0x2001, 0x0005, 0x080c, 0x52a0, 0x080c, + 0x9849, 0x080c, 0x50a5, 0x080c, 0x7f1e, 0x9085, 0x0001, 0x00de, + 0x0005, 0x9006, 0x0ce0, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0cf1, + 0x000b, 0x0005, 0x930a, 0x932b, 0x930c, 0x934a, 0x9328, 0x930a, + 0x92cc, 0x92d1, 0x92d1, 0x92cc, 0x92cc, 0x92cc, 0x92cc, 0x92cc, + 0x92cc, 0x92cc, 0x080c, 0x0cf1, 0x86ff, 0x11b8, 0x6020, 0x9086, + 0x0006, 0x0198, 0x00d6, 0x6014, 0x2068, 0x080c, 0x95d2, 0x0110, + 0x080c, 0x9849, 0x00de, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, + 0x0002, 0x080c, 0x6886, 0x080c, 0x6d42, 0x9085, 0x0001, 0x0005, + 0x080c, 0x12c7, 0x0c08, 0x00e6, 0x2071, 0x12dc, 0x7024, 0x9c06, + 0x1110, 0x080c, 0x78b3, 0x6020, 0x9084, 0x000f, 0x9086, 0x0006, + 0x1150, 0x0086, 0x0096, 0x2049, 0x0001, 0x2c40, 0x080c, 0x7a48, + 0x009e, 0x008e, 0x0010, 0x080c, 0x77d3, 0x00ee, 0x1928, 0x080c, + 0x92cc, 0x0005, 0x0036, 0x00e6, 0x2071, 0x12dc, 0x703c, 0x9c06, + 0x1140, 0x2019, 0x0000, 0x080c, 0x7936, 0x00ee, 0x003e, 0x0804, + 0x930c, 0x080c, 0x7b66, 0x00ee, 0x003e, 0x1904, 0x930c, 0x080c, + 0x92cc, 0x0005, 0x00c6, 0x6020, 0x9084, 0x000f, 0x0013, 0x00ce, + 0x0005, 0x937e, 0x9402, 0x9530, 0x9389, 0x97a3, 0x937e, 0xa6ae, + 0x7f1e, 0x9402, 0x9377, 0x959b, 0x9377, 0x9377, 0x9377, 0x080c, + 0x0cf1, 0x080c, 0x97cd, 0x1110, 0x080c, 0x8576, 0x0005, 0x080c, + 0x6c56, 0x080c, 0x6d42, 0x080c, 0x7f1e, 0x0005, 0x601b, 0x0001, + 0x0005, 0x6014, 0x9080, 0x0025, 0x2c02, 0x6000, 0x908a, 0x0016, + 0x1a0c, 0x0cf1, 0x000b, 0x0005, 0x93a4, 0x93a6, 0x93c6, 0x93d8, + 0x93e5, 0x93a4, 0x937e, 0x937e, 0x937e, 0x93d8, 0x93d8, 0x93a4, + 0x93a4, 0x93a4, 0x93a4, 0x93e2, 0x080c, 0x0cf1, 0x00e6, 0x6014, + 0x2070, 0x7080, 0xc0b5, 0x7082, 0x2071, 0x12dc, 0x7024, 0x9c06, + 0x0190, 0x080c, 0x77d3, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, + 0x0002, 0x2001, 0x12a7, 0x2004, 0x601a, 0x080c, 0x6886, 0x080c, + 0x6d42, 0x00ee, 0x0005, 0x601b, 0x0001, 0x0cd8, 0x00d6, 0x6014, + 0x2068, 0x6880, 0xc0b5, 0x6882, 0x00de, 0x6007, 0x0085, 0x6003, + 0x000b, 0x6023, 0x0002, 0x080c, 0x6886, 0x080c, 0x6d42, 0x0005, + 0x00d6, 0x601b, 0x0001, 0x6014, 0x2068, 0x6880, 0xc0b5, 0x6882, + 0x00de, 0x0005, 0x080c, 0x7f1e, 0x0005, 0x6014, 0x9005, 0x01b8, + 0x9088, 0x001f, 0x210c, 0xd1e4, 0x0190, 0x9080, 0x0021, 0x2004, + 0x601a, 0x2001, 0x0037, 0x2c08, 0x080c, 0x113b, 0x6000, 0x9086, + 0x0004, 0x1120, 0x2009, 0x0048, 0x080c, 0x7f4e, 0x0005, 0x080c, + 0x12c7, 0x0820, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0cf1, 0x000b, + 0x0005, 0x9419, 0x9386, 0x941b, 0x9419, 0x941b, 0x941b, 0x937f, + 0x9419, 0x9379, 0x9379, 0x9419, 0x9419, 0x9419, 0x9419, 0x9419, + 0x9419, 0x080c, 0x0cf1, 0x6010, 0x00d6, 0x2068, 0x6804, 0x9084, + 0x00ff, 0x00de, 0x908a, 0x000c, 0x1a0c, 0x0cf1, 0x000b, 0x0005, + 0x9434, 0x94d6, 0x9436, 0x9470, 0x9436, 0x9470, 0x9436, 0x9440, + 0x9434, 0x9470, 0x9434, 0x945c, 0x080c, 0x0cf1, 0x6004, 0x908e, + 0x0016, 0x0588, 0x908e, 0x0004, 0x0570, 0x908e, 0x0002, 0x0558, + 0x6004, 0x080c, 0x97cd, 0x0904, 0x94ef, 0x908e, 0x0021, 0x0904, + 0x94f3, 0x908e, 0x0022, 0x0904, 0x94ef, 0x908e, 0x003d, 0x0904, + 0x94f3, 0x908e, 0x0039, 0x0904, 0x94f7, 0x908e, 0x0035, 0x0904, + 0x94f7, 0x908e, 0x001e, 0x0188, 0x908e, 0x0001, 0x1150, 0x6010, + 0x00d6, 0x2068, 0x6804, 0x9084, 0x00ff, 0x00de, 0x9086, 0x0006, + 0x0110, 0x080c, 0x25ad, 0x080c, 0x8576, 0x080c, 0x97a3, 0x0005, + 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0904, 0x94c7, 0x9186, + 0x0002, 0x1518, 0x6010, 0x2068, 0x2001, 0x1133, 0x2004, 0xd0ac, + 0x1904, 0x9519, 0x68a0, 0xd0bc, 0x1904, 0x9519, 0x6840, 0x9084, + 0x00ff, 0x9005, 0x0190, 0x8001, 0x6842, 0x6017, 0x0000, 0x6023, + 0x0007, 0x601b, 0x0398, 0x6043, 0x0000, 0x080c, 0x7ec8, 0x0128, + 0x2d00, 0x6012, 0x6023, 0x0001, 0x0450, 0x00de, 0x00ce, 0x6004, + 0x908e, 0x0002, 0x11a8, 0x6010, 0x9080, 0x0028, 0x2004, 0x9086, + 0x007e, 0x1170, 0x2009, 0x1133, 0x2104, 0xc085, 0x200a, 0x00e6, + 0x2071, 0x1100, 0x080c, 0x46bb, 0x00ee, 0x080c, 0x8576, 0x0020, + 0x080c, 0x8576, 0x080c, 0x25ad, 0x00e6, 0x0126, 0x2091, 0x8000, + 0x080c, 0x25d1, 0x012e, 0x00ee, 0x080c, 0x97a3, 0x0005, 0x2001, + 0x0002, 0x080c, 0x4ab3, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, + 0x68ce, 0x080c, 0x6d42, 0x00de, 0x00ce, 0x0c80, 0x00c6, 0x00d6, + 0x6104, 0x9186, 0x0016, 0x0d58, 0x6010, 0x2068, 0x6840, 0x9084, + 0x00ff, 0x9005, 0x0904, 0x949d, 0x8001, 0x6842, 0x6003, 0x0001, + 0x080c, 0x68ce, 0x080c, 0x6d42, 0x00de, 0x00ce, 0x08b8, 0x080c, + 0x8576, 0x0804, 0x946d, 0x080c, 0x85a4, 0x0804, 0x946d, 0x00d6, + 0x2c68, 0x6104, 0x080c, 0x9ac5, 0x00de, 0x0118, 0x080c, 0x7f1e, + 0x00b8, 0x6004, 0x8007, 0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, + 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x603c, 0x600a, + 0x2001, 0x12a7, 0x2004, 0x601a, 0x080c, 0x6886, 0x080c, 0x6d42, + 0x0005, 0x00de, 0x00ce, 0x080c, 0x8576, 0x080c, 0x25ad, 0x00e6, + 0x0126, 0x2091, 0x8000, 0x080c, 0x25d1, 0x6017, 0x0000, 0x6023, + 0x0007, 0x601b, 0x0398, 0x6043, 0x0000, 0x012e, 0x00ee, 0x0005, + 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0cf1, 0x000b, 0x0005, 0x9547, + 0x9547, 0x9547, 0x9547, 0x9547, 0x9547, 0x9547, 0x9547, 0x9547, + 0x937e, 0x9547, 0x9386, 0x9549, 0x9386, 0x9556, 0x9547, 0x080c, + 0x0cf1, 0x6004, 0x9086, 0x008b, 0x0148, 0x6007, 0x008b, 0x6003, + 0x000d, 0x080c, 0x6886, 0x080c, 0x6d42, 0x0005, 0x080c, 0x9797, + 0x080c, 0x95d2, 0x0580, 0x080c, 0x25ad, 0x00d6, 0x080c, 0x95d2, + 0x0168, 0x6014, 0x2068, 0x6867, 0x0103, 0x687b, 0x0006, 0x6877, + 0x0000, 0x6880, 0xc0ed, 0x6882, 0x080c, 0x50a5, 0x2c68, 0x080c, + 0x7ec8, 0x0150, 0x6810, 0x6012, 0x080c, 0x99cc, 0x00c6, 0x2d60, + 0x080c, 0x97a3, 0x00ce, 0x0008, 0x2d60, 0x00de, 0x6017, 0x0000, + 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x68ce, + 0x080c, 0x6d42, 0x0078, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, + 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x080c, 0x25ad, 0x08b0, + 0x080c, 0x97a3, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0cf1, + 0x000b, 0x0005, 0x95b2, 0x95b2, 0x95b2, 0x95b4, 0x95b5, 0x95b2, + 0x95b2, 0x95b2, 0x95b2, 0x95b2, 0x95b2, 0x95b2, 0x95b2, 0x95b2, + 0x95b2, 0x95b2, 0x080c, 0x0cf1, 0x0005, 0x080c, 0x7b66, 0x190c, + 0x0cf1, 0x6114, 0x2168, 0x687b, 0x0006, 0x080c, 0x50a5, 0x080c, + 0x7f1e, 0x0005, 0x9284, 0x0007, 0x1158, 0x9282, 0x15c0, 0x0240, + 0x2001, 0x1116, 0x2004, 0x9202, 0x1218, 0x9085, 0x0001, 0x0005, + 0x9006, 0x0ce8, 0x0026, 0x6214, 0x9294, 0xf000, 0x002e, 0x0005, + 0x00e6, 0x00c6, 0x0036, 0x0006, 0x0126, 0x2091, 0x8000, 0x2061, + 0x15c0, 0x2071, 0x1100, 0x7344, 0x7064, 0x9302, 0x12a8, 0x6020, + 0x9206, 0x1160, 0x080c, 0x9946, 0x0148, 0x080c, 0x97cd, 0x1110, + 0x080c, 0x8576, 0x00c6, 0x080c, 0x7f1e, 0x00ce, 0x9ce0, 0x0018, + 0x7058, 0x9c02, 0x1208, 0x0c38, 0x012e, 0x000e, 0x003e, 0x00ce, + 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016, 0x9188, 0x1000, 0x210c, + 0x81ff, 0x0170, 0x2061, 0x15c0, 0x2071, 0x1100, 0x0016, 0x080c, + 0x7ec8, 0x001e, 0x0138, 0x6112, 0x080c, 0x25ad, 0x080c, 0x7f1e, + 0x9006, 0x0010, 0x9085, 0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, + 0x00c6, 0x0056, 0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x7ec8, + 0x005e, 0x0180, 0x6616, 0x6512, 0x080c, 0x99cc, 0x6023, 0x0003, + 0x2009, 0x004b, 0x080c, 0x7f4e, 0x9085, 0x0001, 0x012e, 0x005e, + 0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0056, 0x0126, 0x2091, + 0x8000, 0x62a0, 0x00c6, 0x080c, 0x7ec8, 0x005e, 0x01f8, 0x6017, + 0x0000, 0x6512, 0x080c, 0x99cc, 0x6023, 0x0003, 0x00c6, 0x2560, + 0x00ce, 0x080c, 0x69ca, 0x0076, 0x2039, 0x0000, 0x080c, 0x68fe, + 0x2c08, 0x080c, 0xa85f, 0x007e, 0x2009, 0x004c, 0x080c, 0x7f4e, + 0x9085, 0x0001, 0x012e, 0x005e, 0x00ce, 0x0005, 0x9006, 0x0cd0, + 0x00f6, 0x00c6, 0x0046, 0x00c6, 0x080c, 0x7ec8, 0x2c78, 0x00ce, + 0x0180, 0x7e16, 0x2c00, 0x7812, 0x7823, 0x0003, 0x2021, 0x0005, + 0x080c, 0x96bd, 0x2f60, 0x2009, 0x004d, 0x080c, 0x7f4e, 0x9085, + 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046, + 0x00c6, 0x080c, 0x7ec8, 0x2c78, 0x00ce, 0x0178, 0x7e16, 0x2c00, + 0x7812, 0x7823, 0x0003, 0x2021, 0x0005, 0x0439, 0x2f60, 0x2009, + 0x004e, 0x080c, 0x7f4e, 0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe, + 0x0005, 0x00f6, 0x00c6, 0x0046, 0x00c6, 0x080c, 0x7ec8, 0x2c78, + 0x00ce, 0x0178, 0x7e16, 0x2c00, 0x7812, 0x7823, 0x0003, 0x2021, + 0x0004, 0x0059, 0x2f60, 0x2009, 0x0052, 0x080c, 0x7f4e, 0x9085, + 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x0096, 0x0076, 0x0126, + 0x2091, 0x8000, 0x080c, 0x4c77, 0x0158, 0x2001, 0x96c2, 0x0006, + 0x900e, 0x2400, 0x080c, 0x52a0, 0x080c, 0x50a5, 0x000e, 0x0807, + 0x2418, 0x080c, 0x6bf8, 0x62a0, 0x0086, 0x2041, 0x0001, 0x2039, + 0x0001, 0x2608, 0x080c, 0x69e3, 0x008e, 0x080c, 0x68fe, 0x2f08, + 0x2648, 0x080c, 0xa85f, 0x613c, 0x81ff, 0x090c, 0x6a8c, 0x012e, + 0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6, + 0x080c, 0x7ec8, 0x001e, 0x0188, 0x660a, 0x6112, 0x080c, 0x99cc, + 0x6023, 0x0001, 0x2d00, 0x6016, 0x2009, 0x001f, 0x080c, 0x7f4e, + 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, + 0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x7ec8, 0x001e, 0x01b0, + 0x660a, 0x6112, 0x080c, 0x99cc, 0x6023, 0x0008, 0x2d00, 0x6016, + 0x00f6, 0x2c78, 0x080c, 0x119d, 0x00fe, 0x2009, 0x0021, 0x080c, + 0x7f4e, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, + 0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x7ec8, 0x001e, + 0x0188, 0x660a, 0x6112, 0x080c, 0x99cc, 0x6023, 0x0001, 0x2d00, + 0x6016, 0x2009, 0x003d, 0x080c, 0x7f4e, 0x9085, 0x0001, 0x012e, + 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, + 0x00c6, 0x080c, 0x984d, 0x001e, 0x0180, 0x6112, 0x080c, 0x99cc, + 0x6023, 0x0001, 0x2d00, 0x6016, 0x2009, 0x0000, 0x080c, 0x7f4e, + 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, + 0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x7ec8, 0x001e, 0x0188, + 0x660a, 0x6112, 0x080c, 0x99cc, 0x6023, 0x0001, 0x2d00, 0x6016, + 0x2009, 0x0044, 0x080c, 0x7f4e, 0x9085, 0x0001, 0x012e, 0x00ce, + 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6, + 0x080c, 0x7ec8, 0x001e, 0x0188, 0x660a, 0x6112, 0x080c, 0x99cc, + 0x6023, 0x0001, 0x2d00, 0x6016, 0x2009, 0x0049, 0x080c, 0x7f4e, + 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0026, + 0x00d6, 0x6210, 0x2268, 0x6a3c, 0x82ff, 0x0110, 0x8211, 0x6a3e, + 0x00de, 0x002e, 0x0005, 0x0006, 0x6000, 0x9086, 0x0000, 0x0190, + 0x6017, 0x0000, 0x6023, 0x0007, 0x2001, 0x12a6, 0x2004, 0x0006, + 0x9082, 0x0051, 0x000e, 0x0208, 0x8004, 0x601a, 0x080c, 0xad19, + 0x6043, 0x0000, 0x000e, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e, + 0x0002, 0x0140, 0x908e, 0x0003, 0x0128, 0x908e, 0x0004, 0x0110, + 0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x00d6, 0x6014, + 0x906d, 0x0148, 0x6864, 0x9086, 0x0139, 0x0138, 0x6868, 0xd0fc, + 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x00de, 0x000e, 0x0005, + 0x00c6, 0x0126, 0x2091, 0x8000, 0x00c6, 0x080c, 0x7ec8, 0x001e, + 0x0190, 0x6112, 0x080c, 0x99cc, 0x6023, 0x0001, 0x2d00, 0x6016, + 0x080c, 0x25ad, 0x2009, 0x0028, 0x080c, 0x7f4e, 0x9085, 0x0001, + 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015, 0x1188, + 0x2011, 0x1120, 0x2204, 0x9086, 0x0074, 0x1158, 0x080c, 0x88ee, + 0x6003, 0x0001, 0x6007, 0x0029, 0x080c, 0x68ce, 0x080c, 0x6d42, + 0x0020, 0x080c, 0x8576, 0x080c, 0x7f1e, 0x0005, 0x9186, 0x0016, + 0x1128, 0x2001, 0x0004, 0x080c, 0x4ab3, 0x00e8, 0x9186, 0x0015, + 0x11e8, 0x2011, 0x1120, 0x2204, 0x9086, 0x0014, 0x11b8, 0x6010, + 0x00d6, 0x2068, 0x080c, 0x4bf5, 0x00de, 0x080c, 0x89bf, 0x1170, + 0x6010, 0x00d6, 0x2068, 0x6890, 0x00de, 0x9005, 0x0138, 0x2001, + 0x0006, 0x080c, 0x4ab3, 0x080c, 0x80a0, 0x0020, 0x080c, 0x8576, + 0x080c, 0x7f1e, 0x0005, 0x6878, 0x9086, 0x0005, 0x1108, 0x0009, + 0x0005, 0x6880, 0xc0ad, 0x6882, 0x0005, 0x00e6, 0x0126, 0x2071, + 0x1100, 0x2091, 0x8000, 0x7544, 0x9582, 0x0001, 0x0608, 0x7048, + 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x0018, 0x7058, + 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x15c0, 0x0c98, 0x6003, 0x0008, + 0x8529, 0x7546, 0x9ca8, 0x0018, 0x7058, 0x9502, 0x1230, 0x754a, + 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x704b, 0x15c0, 0x0cc0, + 0x9006, 0x0cc0, 0x6043, 0x0000, 0x6017, 0x0000, 0x6003, 0x0001, + 0x6007, 0x0050, 0x080c, 0x6886, 0x080c, 0x6d42, 0x0005, 0x00c6, + 0x6010, 0x2004, 0xd0bc, 0x0120, 0x6020, 0x9084, 0x000f, 0x0013, + 0x00ce, 0x0005, 0x937e, 0x98a2, 0x98a5, 0x98a8, 0xab09, 0xab24, + 0xab27, 0x937e, 0x937e, 0x937e, 0x937e, 0x937e, 0x937e, 0x937e, + 0x080c, 0x0cf1, 0xa001, 0xa001, 0x0005, 0xa001, 0xa001, 0x0005, + 0x0009, 0x0005, 0x6010, 0x2004, 0xd0bc, 0x0550, 0x00f6, 0x2c78, + 0x080c, 0x7ec8, 0x1128, 0x2001, 0x12a8, 0x2004, 0x7842, 0x00f8, + 0x7810, 0x6012, 0x080c, 0x99cc, 0x7820, 0x9086, 0x0003, 0x0128, + 0x7808, 0x603a, 0x2f00, 0x603e, 0x0020, 0x7808, 0x603e, 0x2f00, + 0x603a, 0x602e, 0x6023, 0x0001, 0x6007, 0x0035, 0x6003, 0x0001, + 0x7954, 0x6156, 0x080c, 0x6886, 0x080c, 0x6d42, 0x2f60, 0x00fe, + 0x0005, 0x0016, 0x00f6, 0x6830, 0x6036, 0x908e, 0x0001, 0x0148, + 0x6803, 0x0002, 0x9086, 0x0005, 0x0168, 0x9006, 0x602e, 0x6032, + 0x00c8, 0x681c, 0xc085, 0x681e, 0x6803, 0x0004, 0x6824, 0xc0f4, + 0xc0d5, 0x6826, 0x6814, 0x2078, 0x78ac, 0x6938, 0x9102, 0x78b0, + 0x693c, 0x9103, 0x1e50, 0x683c, 0x602e, 0x6838, 0x9084, 0xfffc, + 0x683a, 0x6032, 0x2d00, 0x603a, 0x6808, 0x603e, 0x6910, 0x6112, + 0x6954, 0x6156, 0x6023, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001, + 0x080c, 0x6886, 0x080c, 0x6d42, 0x00fe, 0x001e, 0x0005, 0x6024, + 0xd0d4, 0x0510, 0xd0f4, 0x11f8, 0x6038, 0x940a, 0x603c, 0x9303, + 0x0230, 0x9105, 0x0120, 0x6024, 0xc0d4, 0xc0f5, 0x0098, 0x643a, + 0x633e, 0x6c3e, 0x6b42, 0x0046, 0x0036, 0x2400, 0x6cac, 0x9402, + 0x6836, 0x2300, 0x6bb0, 0x9303, 0x683a, 0x003e, 0x004e, 0x6024, + 0xc0d4, 0x0000, 0x6026, 0x0005, 0xd0f4, 0x1138, 0x683c, 0x603a, + 0x6840, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x0005, 0x0006, 0x0016, + 0x6004, 0x908e, 0x0034, 0x01b8, 0x908e, 0x0035, 0x01a0, 0x908e, + 0x0036, 0x0188, 0x908e, 0x0037, 0x0170, 0x908e, 0x0038, 0x0158, + 0x908e, 0x0039, 0x0140, 0x908e, 0x003a, 0x0128, 0x908e, 0x003b, + 0x0110, 0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016, + 0x0026, 0x0036, 0x00e6, 0x2001, 0x12a2, 0x200c, 0x8000, 0x2014, + 0x2001, 0x0032, 0x080c, 0x66ff, 0x2001, 0x12a6, 0x82ff, 0x1110, + 0x2011, 0x0002, 0x2202, 0x2001, 0x12a4, 0x200c, 0x8000, 0x2014, + 0x2071, 0x127f, 0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x66ff, + 0x2001, 0x12a7, 0x82ff, 0x1110, 0x2011, 0x0002, 0x2202, 0x2001, + 0x12a8, 0x9288, 0x000a, 0x2102, 0x2001, 0x1340, 0x2102, 0x2001, + 0x0032, 0x080c, 0x113b, 0x080c, 0x4df8, 0x00ee, 0x003e, 0x002e, + 0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x00e6, 0x2001, 0x12a6, + 0x2003, 0x0028, 0x2001, 0x12a7, 0x2003, 0x0014, 0x2071, 0x127f, + 0x701b, 0x0000, 0x701f, 0x07d0, 0x2001, 0x12a8, 0x2009, 0x001e, + 0x2102, 0x2001, 0x1340, 0x2102, 0x2001, 0x0032, 0x080c, 0x113b, + 0x00ee, 0x001e, 0x000e, 0x0005, 0x00d6, 0x6058, 0x906d, 0x0110, + 0x080c, 0x0df6, 0x00de, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091, + 0x8000, 0x00c6, 0x080c, 0x7ec8, 0x001e, 0x0178, 0x6112, 0x0ca1, + 0x6023, 0x0001, 0x2d00, 0x6016, 0x2009, 0x0033, 0x080c, 0x7f4e, + 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00d6, + 0x00e6, 0x00f6, 0x2071, 0x1100, 0x9186, 0x0015, 0x1500, 0x7080, + 0x9086, 0x0018, 0x11e0, 0x6014, 0x2068, 0x6a3c, 0xd2e4, 0x1160, + 0x2c78, 0x080c, 0x6f1c, 0x01d8, 0x706c, 0x6a50, 0x9206, 0x1160, + 0x7070, 0x6a54, 0x9206, 0x1140, 0x6210, 0x9290, 0x0028, 0x2214, + 0x2009, 0x0000, 0x080c, 0x25f0, 0x080c, 0x80a0, 0x0020, 0x080c, + 0x8576, 0x080c, 0x7f1e, 0x00fe, 0x00ee, 0x00de, 0x0005, 0x7050, + 0x6a54, 0x9206, 0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, + 0x00c6, 0x080c, 0x7ec8, 0x001e, 0x0180, 0x6112, 0x080c, 0x99cc, + 0x6023, 0x0001, 0x2d00, 0x6016, 0x2009, 0x0043, 0x080c, 0x7f4e, + 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00d6, + 0x00e6, 0x00f6, 0x2071, 0x1100, 0x9186, 0x0015, 0x11c0, 0x7080, + 0x9086, 0x0004, 0x11a0, 0x6014, 0x90e8, 0x001b, 0x2c78, 0x080c, + 0x6f1c, 0x01a8, 0x706c, 0x6a08, 0x9206, 0x1130, 0x7070, 0x6a0c, + 0x9206, 0x1110, 0x080c, 0x25ad, 0x080c, 0x80a0, 0x0020, 0x080c, + 0x8576, 0x080c, 0x7f1e, 0x00fe, 0x00ee, 0x00de, 0x0005, 0x7050, + 0x6a0c, 0x9206, 0x0d78, 0x0c80, 0x0016, 0x0026, 0x687c, 0xd0ac, + 0x0178, 0x6938, 0x6a34, 0x2100, 0x9205, 0x0150, 0x6890, 0x9106, + 0x1118, 0x688c, 0x9206, 0x0120, 0x6992, 0x6a8e, 0x9085, 0x0001, + 0x002e, 0x001e, 0x0005, 0x00d6, 0x0036, 0x6314, 0x2368, 0x687a, + 0x6982, 0x929e, 0x4000, 0x1560, 0x6310, 0x00c6, 0x2360, 0x2009, + 0x0000, 0x6868, 0xd0f4, 0x1140, 0x080c, 0x4d21, 0x1108, 0xc185, + 0x6000, 0xd0bc, 0x0108, 0xc18d, 0x6a96, 0x699a, 0x20a9, 0x0004, + 0x20e1, 0x0001, 0x20e9, 0x0001, 0x9d80, 0x0031, 0x20a0, 0x9c80, + 0x0006, 0x2098, 0x080c, 0x4678, 0x20a9, 0x0004, 0x9d80, 0x0035, + 0x20a0, 0x9c80, 0x000a, 0x2098, 0x080c, 0x4678, 0x00ce, 0x0080, + 0x6a96, 0x3918, 0x9398, 0x0006, 0x231c, 0x689b, 0x0004, 0x6ba2, + 0x6310, 0x00c6, 0x2360, 0x6004, 0x00ce, 0x9084, 0x00ff, 0x689e, + 0x080c, 0x50a5, 0x003e, 0x00de, 0x0005, 0x00c6, 0x0026, 0x0016, + 0x9186, 0x0035, 0x0110, 0x6a38, 0x0008, 0x6a2c, 0x080c, 0x95c2, + 0x01f0, 0x2260, 0x6120, 0x9186, 0x0003, 0x0118, 0x9186, 0x0006, + 0x1190, 0x6838, 0x9206, 0x0140, 0x683c, 0x9206, 0x1160, 0x6108, + 0x6838, 0x9106, 0x1140, 0x0020, 0x6008, 0x693c, 0x9106, 0x1118, + 0x6010, 0x6910, 0x9106, 0x001e, 0x002e, 0x00ce, 0x0005, 0x9085, + 0x0001, 0x0cc8, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0cf1, + 0x0013, 0x006e, 0x0005, 0x9b0b, 0x9fed, 0xa14f, 0x9b0b, 0x9b0b, + 0x9b0b, 0x9b0b, 0x9b0b, 0x9b42, 0xa1cd, 0x9b0b, 0x9b0b, 0x9b0b, + 0x9b0b, 0x9b0b, 0x9b0b, 0x080c, 0x0cf1, 0x0066, 0x6000, 0x90b2, + 0x0016, 0x1a0c, 0x0cf1, 0x0013, 0x006e, 0x0005, 0x9b26, 0xa64b, + 0x9b26, 0x9b26, 0x9b26, 0x9b26, 0x9b26, 0x9b26, 0xa60b, 0xa69b, + 0x9b26, 0xac51, 0xac85, 0xac51, 0xac85, 0x9b26, 0x080c, 0x0cf1, + 0x6000, 0x9082, 0x0016, 0x1a0c, 0x0cf1, 0x6000, 0x000a, 0x0005, + 0x9b40, 0xa307, 0xa3dc, 0xa3fe, 0xa4a6, 0x9b40, 0xa57d, 0xa528, + 0xa1d9, 0xa5e1, 0xa5f6, 0x9b40, 0x9b40, 0x9b40, 0x9b40, 0x9b40, + 0x080c, 0x0cf1, 0x91b2, 0x004c, 0x1a0c, 0x0cf1, 0x2100, 0x91b2, + 0x0040, 0x1a04, 0x9f4e, 0x0002, 0x9b8c, 0x9d57, 0x9b8c, 0x9b8c, + 0x9b8c, 0x9d60, 0x9b8c, 0x9b8c, 0x9b8c, 0x9b8c, 0x9b8c, 0x9b8c, + 0x9b8c, 0x9b8c, 0x9b8c, 0x9b8c, 0x9b8c, 0x9b8c, 0x9b8c, 0x9b8c, + 0x9b8c, 0x9b8c, 0x9b8c, 0x9b8e, 0x9bea, 0x9bf9, 0x9c47, 0x9c65, + 0x9ce3, 0x9d42, 0x9b8c, 0x9b8c, 0x9d63, 0x9b8c, 0x9b8c, 0x9d78, + 0x9d85, 0x9b8c, 0x9b8c, 0x9b8c, 0x9b8c, 0x9b8c, 0x9dfd, 0x9b8c, + 0x9b8c, 0x9e0c, 0x9b8c, 0x9b8c, 0x9dd3, 0x9b8c, 0x9b8c, 0x9b8c, + 0x9e24, 0x9b8c, 0x9b8c, 0x9b8c, 0x9ea0, 0x9b8c, 0x9b8c, 0x9b8c, + 0x9b8c, 0x9b8c, 0x9b8c, 0x9f15, 0x080c, 0x0cf1, 0x080c, 0x4de0, + 0x1150, 0x2001, 0x1133, 0x2004, 0xd0cc, 0x1128, 0x9084, 0x0009, + 0x9086, 0x0008, 0x1140, 0x6007, 0x0009, 0x602f, 0x0009, 0x6017, + 0x0000, 0x0804, 0x9d50, 0x080c, 0x4dd0, 0x00e6, 0x00c6, 0x0036, + 0x0026, 0x0016, 0x6210, 0x2270, 0x72a0, 0x0026, 0x2019, 0x0029, + 0x080c, 0x69ca, 0x0076, 0x2039, 0x0000, 0x080c, 0x68fe, 0x2c08, + 0x080c, 0xa85f, 0x007e, 0x001e, 0x2e60, 0x001e, 0x002e, 0x003e, + 0x00ce, 0x00ee, 0x6610, 0x00c6, 0x2660, 0x080c, 0x4b67, 0x00ce, + 0x96b0, 0x0001, 0x2634, 0x9684, 0x00ff, 0x9082, 0x0006, 0x0278, + 0x080c, 0xa7a3, 0x1904, 0x9c41, 0x080c, 0xa740, 0x1120, 0x6007, + 0x0008, 0x0804, 0x9d50, 0x6007, 0x0009, 0x0804, 0x9d50, 0x080c, + 0xa966, 0x0128, 0x080c, 0xa7a3, 0x0d78, 0x0804, 0x9c41, 0x6017, + 0x1900, 0x0c88, 0x080c, 0x26bc, 0x1904, 0x9f4b, 0x6106, 0x080c, + 0xa6fc, 0x6007, 0x0006, 0x0804, 0x9d50, 0x6007, 0x0007, 0x0804, + 0x9d50, 0x080c, 0xacbf, 0x1904, 0x9f4b, 0x080c, 0x26bc, 0x1904, + 0x9f4b, 0x00d6, 0x6610, 0x2668, 0x6e04, 0x9684, 0x00ff, 0x9082, + 0x0006, 0x1220, 0x2001, 0x0001, 0x080c, 0x4aa1, 0x96b4, 0xff00, + 0x8637, 0x9686, 0x0006, 0x0188, 0x9686, 0x0004, 0x0170, 0x6e04, + 0x96b4, 0x00ff, 0x9686, 0x0006, 0x0140, 0x9686, 0x0004, 0x0128, + 0x9686, 0x0005, 0x0110, 0x00de, 0x00e0, 0x080c, 0xa801, 0x11a0, + 0x9686, 0x0006, 0x1150, 0x0026, 0x6210, 0x9290, 0x0028, 0x2214, + 0x2009, 0x0000, 0x080c, 0x25f0, 0x002e, 0x080c, 0x4bf5, 0x6007, + 0x000a, 0x00de, 0x0804, 0x9d50, 0x6007, 0x000b, 0x00de, 0x0804, + 0x9d50, 0x080c, 0x25ad, 0x6007, 0x0001, 0x0804, 0x9d50, 0x080c, + 0xacbf, 0x1904, 0x9f4b, 0x080c, 0x26bc, 0x1904, 0x9f4b, 0x6610, + 0x00d6, 0x2668, 0x6e04, 0x00de, 0x9686, 0x0707, 0x0d50, 0x0026, + 0x6210, 0x9290, 0x0028, 0x2214, 0x2009, 0x0000, 0x080c, 0x25f0, + 0x002e, 0x6007, 0x000c, 0x0804, 0x9d50, 0x080c, 0x4de0, 0x1140, + 0x2001, 0x1133, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008, 0x1110, + 0x0804, 0x9b9b, 0x080c, 0x4dd0, 0x6610, 0x96b0, 0x0001, 0x2634, + 0x9684, 0x00ff, 0x9082, 0x0006, 0x06e8, 0x1138, 0x0026, 0x2001, + 0x0006, 0x080c, 0x4ae0, 0x002e, 0x0050, 0x96b4, 0xff00, 0x8637, + 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0x9c41, 0x080c, + 0xa80e, 0x1120, 0x6007, 0x000e, 0x0804, 0x9d50, 0x0046, 0x6410, + 0x94a0, 0x0028, 0x2424, 0x94a4, 0x00ff, 0x8427, 0x0046, 0x080c, + 0x25ad, 0x004e, 0x0016, 0x9006, 0x2009, 0x1153, 0x210c, 0xd1a4, + 0x0158, 0x2009, 0x0029, 0x080c, 0xaaca, 0x6010, 0x00d6, 0x2068, + 0x6800, 0xc0e5, 0x6802, 0x00de, 0x001e, 0x004e, 0x6007, 0x0001, + 0x0804, 0x9d50, 0x2001, 0x0001, 0x080c, 0x4aa1, 0x0156, 0x0016, + 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1105, 0x2011, 0x0270, + 0x080c, 0x8a45, 0x003e, 0x002e, 0x001e, 0x015e, 0x9005, 0x0168, + 0x96b4, 0xff00, 0x8637, 0x9682, 0x0004, 0x0a04, 0x9c41, 0x9682, + 0x0007, 0x0a04, 0x9c8f, 0x0804, 0x9c41, 0x6017, 0x1900, 0x6007, + 0x0009, 0x0804, 0x9d50, 0x080c, 0x4de0, 0x1140, 0x2001, 0x1133, + 0x2004, 0x9084, 0x0009, 0x9086, 0x0008, 0x1110, 0x0804, 0x9b9b, + 0x080c, 0x4dd0, 0x6610, 0x96b0, 0x0001, 0x2634, 0x9684, 0x00ff, + 0x9082, 0x0006, 0x06b8, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0004, + 0x0120, 0x9686, 0x0006, 0x1904, 0x9c41, 0x080c, 0xa836, 0x1138, + 0x080c, 0xa740, 0x1120, 0x6007, 0x0010, 0x0804, 0x9d50, 0x0046, + 0x6410, 0x94a0, 0x0028, 0x2424, 0x94a4, 0x00ff, 0x8427, 0x0046, + 0x080c, 0x25ad, 0x004e, 0x0016, 0x9006, 0x2009, 0x1153, 0x210c, + 0xd1a4, 0x0158, 0x2009, 0x0029, 0x080c, 0xaaca, 0x6010, 0x00d6, + 0x2068, 0x6800, 0xc0e5, 0x6802, 0x00de, 0x001e, 0x004e, 0x6007, + 0x0001, 0x00f0, 0x080c, 0xa966, 0x0140, 0x96b4, 0xff00, 0x8637, + 0x9686, 0x0006, 0x0950, 0x0804, 0x9c41, 0x6017, 0x1900, 0x6007, + 0x0009, 0x0070, 0x080c, 0x26bc, 0x1904, 0x9f4b, 0x080c, 0xacbf, + 0x1904, 0x9f4b, 0x080c, 0x9f86, 0x1904, 0x9c41, 0x6007, 0x0012, + 0x6003, 0x0001, 0x080c, 0x68ce, 0x080c, 0x6d42, 0x0005, 0x6007, + 0x0001, 0x6003, 0x0001, 0x080c, 0x68ce, 0x080c, 0x6d42, 0x0cb0, + 0x6007, 0x0005, 0x0c68, 0x080c, 0xacbf, 0x1904, 0x9f4b, 0x080c, + 0x26bc, 0x1904, 0x9f4b, 0x080c, 0x9f86, 0x1904, 0x9c41, 0x6007, + 0x0020, 0x6003, 0x0001, 0x080c, 0x68ce, 0x080c, 0x6d42, 0x0005, + 0x080c, 0x26bc, 0x1904, 0x9f4b, 0x6007, 0x0023, 0x6003, 0x0001, + 0x080c, 0x68ce, 0x080c, 0x6d42, 0x0005, 0x080c, 0xacbf, 0x1904, + 0x9f4b, 0x080c, 0x26bc, 0x1904, 0x9f4b, 0x080c, 0x9f86, 0x1904, + 0x9c41, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7244, 0x9286, + 0xffff, 0x0180, 0x2c08, 0x080c, 0x95c2, 0x01b0, 0x2260, 0x7240, + 0x6008, 0x9206, 0x1188, 0x6010, 0x9190, 0x0004, 0x2214, 0x9206, + 0x01b8, 0x0050, 0x7240, 0x2c08, 0x9006, 0x080c, 0xaa9c, 0x1180, + 0x7244, 0x9286, 0xffff, 0x0190, 0x2160, 0x6007, 0x0026, 0x6017, + 0x1700, 0x7214, 0x9296, 0xffff, 0x1160, 0x6007, 0x0025, 0x0048, + 0x6020, 0x9086, 0x0007, 0x1d80, 0x080c, 0x7f1e, 0x2160, 0x6007, + 0x0025, 0x6003, 0x0001, 0x080c, 0x68ce, 0x080c, 0x6d42, 0x00ee, + 0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x4aa1, 0x0156, + 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1105, 0x2011, + 0x0276, 0x080c, 0x8a45, 0x003e, 0x002e, 0x001e, 0x015e, 0x0120, + 0x6007, 0x0031, 0x0804, 0x9d50, 0x080c, 0x8752, 0x080c, 0x5745, + 0x1158, 0x0006, 0x0026, 0x0036, 0x080c, 0x5761, 0x0110, 0x080c, + 0x571c, 0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x26bc, 0x1904, + 0x9f4b, 0x6106, 0x080c, 0x9fa2, 0x6007, 0x002b, 0x0804, 0x9d50, + 0x6007, 0x002c, 0x0804, 0x9d50, 0x080c, 0xacbf, 0x1904, 0x9f4b, + 0x080c, 0x26bc, 0x1904, 0x9f4b, 0x080c, 0x9f86, 0x1904, 0x9c41, + 0x6106, 0x080c, 0x9fa6, 0x1120, 0x6007, 0x002e, 0x0804, 0x9d50, + 0x6007, 0x002f, 0x0804, 0x9d50, 0x080c, 0x26bc, 0x1904, 0x9f4b, + 0x00e6, 0x00d6, 0x00c6, 0x6010, 0x9080, 0x0001, 0x200c, 0x9184, + 0x00ff, 0x9086, 0x0006, 0x0158, 0x9184, 0xff00, 0x8007, 0x9086, + 0x0006, 0x0128, 0x00ce, 0x00de, 0x00ee, 0x0804, 0x9d57, 0x2001, + 0x1172, 0x2004, 0xd0e4, 0x0904, 0x9e9d, 0x2071, 0x026c, 0x7010, + 0x603a, 0x7014, 0x603e, 0x7108, 0x720c, 0x2001, 0x1153, 0x2004, + 0xd0a4, 0x0140, 0x6010, 0x2068, 0x6810, 0x9106, 0x1118, 0x6814, + 0x9206, 0x0508, 0x2001, 0x1153, 0x2004, 0xd0ac, 0x15a0, 0x2069, + 0x1100, 0x6870, 0x9206, 0x1578, 0x686c, 0x9106, 0x1560, 0x7210, + 0x080c, 0x95c2, 0x0568, 0x080c, 0xab36, 0x0550, 0x622e, 0x6007, + 0x0036, 0x6003, 0x0001, 0x080c, 0x6886, 0x080c, 0x6d42, 0x00ce, + 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff, 0x0150, 0x080c, + 0x95c2, 0x01b0, 0x9280, 0x0002, 0x2004, 0x7110, 0x9106, 0x1180, + 0x08f8, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c, 0xaa9c, 0x2c10, + 0x2160, 0x0130, 0x08a8, 0x6007, 0x0037, 0x6017, 0x1500, 0x08c8, + 0x6007, 0x0037, 0x6017, 0x1700, 0x08a0, 0x6007, 0x0012, 0x0888, + 0x080c, 0x26bc, 0x1904, 0x9f4b, 0x6010, 0x9080, 0x0001, 0x2004, + 0x9084, 0xff00, 0x8007, 0x9086, 0x0006, 0x1904, 0x9d57, 0x00e6, + 0x00d6, 0x00c6, 0x2001, 0x1172, 0x2004, 0xd0e4, 0x0904, 0x9f0d, + 0x2069, 0x1100, 0x2071, 0x026c, 0x7008, 0x603a, 0x720c, 0x623e, + 0x9286, 0xffff, 0x1150, 0x7208, 0x00c6, 0x2c08, 0x9085, 0x0001, + 0x080c, 0xaa9c, 0x2c10, 0x00ce, 0x0598, 0x080c, 0x95c2, 0x0580, + 0x00c6, 0x0026, 0x2260, 0x080c, 0x9297, 0x002e, 0x00ce, 0x7118, + 0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0158, 0x9186, 0x0005, + 0x0118, 0x9186, 0x0007, 0x1178, 0x9280, 0x0005, 0x2004, 0x9005, + 0x0150, 0x0056, 0x7510, 0x7614, 0x080c, 0xab4f, 0x005e, 0x00ce, + 0x00de, 0x00ee, 0x0005, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, + 0x2a00, 0x6003, 0x0001, 0x080c, 0x6886, 0x080c, 0x6d42, 0x0c78, + 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x1700, 0x6003, 0x0001, + 0x080c, 0x6886, 0x080c, 0x6d42, 0x0c10, 0x6007, 0x003b, 0x602f, + 0x000b, 0x6017, 0x0000, 0x0804, 0x9e71, 0x00e6, 0x0026, 0x080c, + 0x4de0, 0x0558, 0x080c, 0x4dd0, 0x080c, 0xad2a, 0x1520, 0x2071, + 0x1100, 0x70cc, 0xc085, 0x70ce, 0x00f6, 0x2079, 0x0100, 0x729c, + 0x9284, 0x00ff, 0x706e, 0x78e6, 0x9284, 0xff00, 0x7270, 0x9205, + 0x7072, 0x78ea, 0x00fe, 0x70d7, 0x0000, 0x2001, 0x1153, 0x2004, + 0xd0a4, 0x0120, 0x2011, 0x12f5, 0x2013, 0x07d0, 0xd0ac, 0x1128, + 0x080c, 0x23cd, 0x0010, 0x080c, 0xad56, 0x002e, 0x00ee, 0x080c, + 0x7f1e, 0x0804, 0x9d56, 0x080c, 0x7f1e, 0x0005, 0x2600, 0x0002, + 0x9f5b, 0x9f5b, 0x9f5b, 0x9f5b, 0x9f5b, 0x9f5d, 0x9f5b, 0x9f5b, + 0x9f5b, 0x9f5b, 0x9f75, 0x080c, 0x0cf1, 0x080c, 0xacbf, 0x1d58, + 0x080c, 0x26bc, 0x1d40, 0x0411, 0x1138, 0x6007, 0x0045, 0x6003, + 0x0001, 0x080c, 0x68ce, 0x0005, 0x080c, 0x25ad, 0x6007, 0x0001, + 0x6003, 0x0001, 0x080c, 0x68ce, 0x0005, 0x080c, 0xacbf, 0x1998, + 0x080c, 0x26bc, 0x1980, 0x0051, 0x1d78, 0x703c, 0x6016, 0x6007, + 0x004a, 0x6003, 0x0001, 0x080c, 0x68ce, 0x0005, 0x00d6, 0x0066, + 0x6610, 0x2668, 0x6e04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, + 0x0170, 0x9686, 0x0004, 0x0158, 0x6e04, 0x96b4, 0x00ff, 0x9686, + 0x0006, 0x0128, 0x9686, 0x0004, 0x0110, 0x9085, 0x0001, 0x006e, + 0x00de, 0x0005, 0x00d6, 0x0449, 0x00de, 0x0005, 0x00d6, 0x0491, + 0x11f0, 0x680c, 0x908c, 0xff00, 0x6820, 0x9084, 0x00ff, 0x9115, + 0x6216, 0x6824, 0x602e, 0xd1e4, 0x0118, 0x2009, 0x0001, 0x0060, + 0xd1ec, 0x0168, 0x6920, 0x918c, 0x00ff, 0x6824, 0x080c, 0x1c69, + 0x1130, 0x2110, 0x2009, 0x0000, 0x080c, 0x25f0, 0x0018, 0x9085, + 0x0001, 0x0008, 0x9006, 0x00de, 0x0005, 0x2069, 0x026d, 0x6800, + 0x9082, 0x0010, 0x1228, 0x6017, 0x0000, 0x9085, 0x0001, 0x0008, + 0x9006, 0x0005, 0x6017, 0x0000, 0x2069, 0x026c, 0x6808, 0x9084, + 0xff00, 0x9086, 0x0800, 0x1140, 0x6800, 0x9084, 0x00ff, 0x908e, + 0x0014, 0x0110, 0x908e, 0x0010, 0x0005, 0x6004, 0x90b2, 0x004c, + 0x1a0c, 0x0cf1, 0x91b6, 0x0013, 0x1130, 0x2008, 0x91b2, 0x0040, + 0x1a04, 0xa11e, 0x0092, 0x91b6, 0x0027, 0x0120, 0x91b6, 0x0014, + 0x190c, 0x0cf1, 0x2001, 0x0007, 0x080c, 0x4ae0, 0x080c, 0x6c56, + 0x080c, 0x97a3, 0x080c, 0x6d42, 0x0005, 0xa04d, 0xa04f, 0xa04d, + 0xa04d, 0xa04d, 0xa04f, 0xa061, 0xa117, 0xa0b9, 0xa117, 0xa0cd, + 0xa117, 0xa061, 0xa117, 0xa10f, 0xa117, 0xa10f, 0xa117, 0xa117, + 0xa04d, 0xa04d, 0xa04d, 0xa04d, 0xa04d, 0xa04d, 0xa04d, 0xa04d, + 0xa04d, 0xa04d, 0xa04d, 0xa04f, 0xa04d, 0xa117, 0xa04d, 0xa04d, + 0xa117, 0xa04d, 0xa114, 0xa117, 0xa04d, 0xa04d, 0xa04d, 0xa04d, + 0xa117, 0xa117, 0xa04d, 0xa117, 0xa117, 0xa04d, 0xa05b, 0xa04d, + 0xa04d, 0xa04d, 0xa04d, 0xa113, 0xa117, 0xa04d, 0xa04d, 0xa117, + 0xa117, 0xa04d, 0xa04d, 0xa04d, 0xa04d, 0x080c, 0x0cf1, 0x080c, + 0x6c56, 0x2001, 0x12a6, 0x2004, 0x601a, 0x6003, 0x0002, 0x080c, + 0x6d42, 0x0804, 0xa11d, 0x2001, 0x0000, 0x080c, 0x4aa1, 0x0804, + 0xa117, 0x00f6, 0x2079, 0x1152, 0x7804, 0x00fe, 0xd0ac, 0x1904, + 0xa117, 0x2001, 0x0000, 0x080c, 0x4aa1, 0x6010, 0x9080, 0x0004, + 0x2004, 0x9086, 0x00ff, 0x1140, 0x00f6, 0x2079, 0x1100, 0x7894, + 0x8000, 0x7896, 0x00fe, 0x0418, 0x6010, 0x00c6, 0x2060, 0x6000, + 0xd0f4, 0x1178, 0x6010, 0x9005, 0x0160, 0x0036, 0x0046, 0x63a0, + 0x2021, 0x0007, 0x080c, 0x384a, 0x004e, 0x003e, 0x00ce, 0x0804, + 0xa117, 0x00ce, 0x2001, 0x1100, 0x2004, 0x9086, 0x0002, 0x1138, + 0x00f6, 0x2079, 0x1100, 0x7894, 0x8000, 0x7896, 0x00fe, 0x2001, + 0x0002, 0x080c, 0x4ab3, 0x080c, 0x6c56, 0x6023, 0x0001, 0x6003, + 0x0001, 0x6007, 0x0002, 0x080c, 0x68ce, 0x080c, 0x6d42, 0x6110, + 0x00c6, 0x2160, 0x2009, 0x0001, 0x080c, 0x6567, 0x00ce, 0x0804, + 0xa11d, 0x6610, 0x00d6, 0x2668, 0x6e04, 0x00de, 0x96b4, 0xff00, + 0x8637, 0x9686, 0x0006, 0x0904, 0xa117, 0x9686, 0x0004, 0x0904, + 0xa117, 0x2001, 0x0004, 0x0804, 0xa115, 0x2001, 0x1100, 0x2004, + 0x9086, 0x0003, 0x1160, 0x0036, 0x0046, 0x6010, 0x9080, 0x0028, + 0x201c, 0x2021, 0x0006, 0x080c, 0x384a, 0x004e, 0x003e, 0x2001, + 0x0006, 0x080c, 0xa134, 0x6610, 0x00d6, 0x2668, 0x6e04, 0x00de, + 0x0066, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0120, + 0x2001, 0x0006, 0x080c, 0x4ae0, 0x2001, 0x1153, 0x2004, 0xd0ac, + 0x11f0, 0x2001, 0x1133, 0x2004, 0xd0a4, 0x01c8, 0x96b4, 0x00ff, + 0x9686, 0x0006, 0x01a0, 0x00f6, 0x2079, 0x1100, 0x7894, 0x8000, + 0x7896, 0x00fe, 0x0804, 0xa09f, 0x2001, 0x0004, 0x0030, 0x2001, + 0x0006, 0x0411, 0x0020, 0x0018, 0x0010, 0x080c, 0x4ae0, 0x080c, + 0x6c56, 0x080c, 0x7f1e, 0x080c, 0x6d42, 0x0005, 0x2600, 0x0002, + 0xa12b, 0xa12b, 0xa12b, 0xa12b, 0xa12b, 0xa12d, 0xa12b, 0xa12b, + 0xa12b, 0xa12b, 0xa12d, 0x080c, 0x0cf1, 0x080c, 0x6c56, 0x080c, + 0x7f1e, 0x080c, 0x6d42, 0x0005, 0x0016, 0x00d6, 0x6110, 0x2168, + 0x6900, 0xd184, 0x0188, 0x6104, 0x918e, 0x000a, 0x1128, 0x699c, + 0xd1a4, 0x1110, 0x2001, 0x0007, 0x080c, 0x4ab3, 0x2001, 0x0000, + 0x080c, 0x4aa1, 0x080c, 0x25d1, 0x00de, 0x001e, 0x0005, 0x6610, + 0x00d6, 0x2668, 0x6804, 0x9084, 0xff00, 0x8007, 0x00de, 0x90b2, + 0x000c, 0x1a0c, 0x0cf1, 0x91b6, 0x0015, 0x1110, 0x003b, 0x0028, + 0x91b6, 0x0016, 0x190c, 0x0cf1, 0x006b, 0x0005, 0x863b, 0x863b, + 0x863b, 0x863b, 0x863b, 0x863b, 0xa1b7, 0xa17e, 0x863b, 0x863b, + 0x863b, 0x863b, 0x863b, 0x863b, 0x863b, 0x863b, 0x863b, 0x863b, + 0xa1b7, 0xa1be, 0x863b, 0x863b, 0x863b, 0x863b, 0x00f6, 0x2079, + 0x1152, 0x7804, 0xd0ac, 0x11e0, 0x6010, 0x907d, 0x01c8, 0x7800, + 0xd0f4, 0x1118, 0x7810, 0x9005, 0x1198, 0x2001, 0x0000, 0x080c, + 0x4aa1, 0x2001, 0x0002, 0x080c, 0x4ab3, 0x6023, 0x0001, 0x6003, + 0x0001, 0x6007, 0x0002, 0x080c, 0x68ce, 0x080c, 0x6d42, 0x00a8, + 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x1c69, 0x1168, + 0x00c6, 0x080c, 0x4b58, 0x0120, 0x00ce, 0x080c, 0x7f1e, 0x0028, + 0x080c, 0x472d, 0x00ce, 0x080c, 0x7f1e, 0x00fe, 0x0005, 0x6604, + 0x96b6, 0x001e, 0x1110, 0x080c, 0x7f1e, 0x0005, 0x080c, 0x88eb, + 0x1148, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x68ce, 0x080c, + 0x6d42, 0x0010, 0x080c, 0x7f1e, 0x0005, 0x6004, 0x908a, 0x004c, + 0x1a0c, 0x0cf1, 0x080c, 0x6c56, 0x080c, 0x97a3, 0x080c, 0x6d42, + 0x0005, 0x9182, 0x0040, 0x0002, 0xa1ef, 0xa1ef, 0xa1ef, 0xa1ef, + 0xa1f1, 0xa1ef, 0xa1ef, 0xa1ef, 0xa1ef, 0xa1ef, 0xa1ef, 0xa1ef, + 0xa1ef, 0xa1ef, 0xa1ef, 0xa1ef, 0xa1ef, 0xa1ef, 0xa1ef, 0x080c, + 0x0cf1, 0x00d6, 0x00e6, 0x00f6, 0x0046, 0x0026, 0x6210, 0x9280, + 0x002b, 0x2004, 0x9005, 0x1190, 0x6106, 0x2071, 0x0260, 0x7444, + 0x94a4, 0xff00, 0x0904, 0xa256, 0x9486, 0x2000, 0x1160, 0x2009, + 0x0001, 0x2011, 0x0200, 0x080c, 0x66d5, 0x0028, 0x2021, 0x0000, + 0x080c, 0xacfb, 0x0c48, 0x080c, 0x0ddf, 0x090c, 0x0cf1, 0x6003, + 0x0007, 0x2d00, 0x6867, 0x010d, 0x6803, 0x0000, 0x686b, 0x0000, + 0x6c8a, 0x2c00, 0x688e, 0x6008, 0x68e2, 0x6010, 0x2078, 0x78a0, + 0x8007, 0x7130, 0x697a, 0x0016, 0x9084, 0xff00, 0x6876, 0x687f, + 0x0000, 0x6883, 0x0000, 0x6887, 0x0036, 0x080c, 0x50a5, 0x001e, + 0x9486, 0x2000, 0x1130, 0x2019, 0x0017, 0x080c, 0xaa50, 0x0804, + 0xa2a9, 0x9486, 0x0400, 0x1130, 0x2019, 0x0002, 0x080c, 0xaa02, + 0x0804, 0xa2a9, 0x9486, 0x0200, 0x1110, 0x080c, 0xa9e7, 0x9486, + 0x1000, 0x1110, 0x080c, 0xaa35, 0x0804, 0xa2a9, 0x2069, 0x1329, + 0x6a00, 0xd284, 0x0904, 0xa303, 0x9284, 0x0300, 0x1904, 0xa2fc, + 0x6804, 0x9005, 0x0904, 0xa2e4, 0x2d78, 0x6003, 0x0007, 0x080c, + 0x0dc6, 0x0904, 0xa2b3, 0x7800, 0xd08c, 0x1118, 0x7804, 0x8001, + 0x7806, 0x6017, 0x0000, 0x6803, 0x0000, 0x6867, 0x0116, 0x686b, + 0x0000, 0x6008, 0x68e2, 0x2c00, 0x687a, 0x6010, 0x2078, 0x78a0, + 0x8007, 0x7130, 0x69b6, 0x6876, 0x6883, 0x003d, 0x7044, 0x9084, + 0x0003, 0x9080, 0xa2af, 0x2005, 0x687e, 0x20a9, 0x000a, 0x2001, + 0x0270, 0x9d90, 0x0021, 0x2009, 0x0205, 0x200b, 0x0080, 0x20e1, + 0x0000, 0x20e9, 0x0001, 0x2098, 0x22a0, 0x4003, 0x200b, 0x0000, + 0x2001, 0x027a, 0x200c, 0x69b2, 0x8000, 0x200c, 0x69ae, 0x080c, + 0x50a5, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de, 0x0005, 0x0000, + 0x0080, 0x0040, 0x0000, 0x6017, 0x0100, 0x6003, 0x0001, 0x6007, + 0x0041, 0x080c, 0x6886, 0x080c, 0x6d42, 0x0c58, 0x2069, 0x0260, + 0x6848, 0x9084, 0xff00, 0x9086, 0x1200, 0x1198, 0x686c, 0x9084, + 0x00ff, 0x0016, 0x6114, 0x918c, 0x0700, 0x910d, 0x6116, 0x001e, + 0x6003, 0x0001, 0x6007, 0x0043, 0x080c, 0x6886, 0x080c, 0x6d42, + 0x0880, 0x6017, 0x0200, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, + 0x6886, 0x080c, 0x6d42, 0x0828, 0x2001, 0x110d, 0x2004, 0xd0ec, + 0x0120, 0x2011, 0x8049, 0x080c, 0x37dc, 0x6017, 0x0300, 0x0010, + 0x6017, 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x6886, + 0x080c, 0x6d42, 0x0804, 0xa2a9, 0x6017, 0x0500, 0x0c98, 0x6017, + 0x0600, 0x0804, 0xa2be, 0x6017, 0x0200, 0x0804, 0xa2be, 0x9186, + 0x0013, 0x1160, 0x6004, 0x908a, 0x0054, 0x1a0c, 0x0cf1, 0x9082, + 0x0040, 0x0a0c, 0x0cf1, 0x2008, 0x0804, 0xa38f, 0x9186, 0x0051, + 0x0138, 0x9186, 0x0047, 0x11d8, 0x6004, 0x9086, 0x0041, 0x0518, + 0x2001, 0x0109, 0x2004, 0xd084, 0x01f0, 0x0126, 0x2091, 0x2800, + 0x0006, 0x0016, 0x0026, 0x080c, 0x677e, 0x002e, 0x001e, 0x000e, + 0x012e, 0x6000, 0x9086, 0x0002, 0x1170, 0x0804, 0xa3dc, 0x9186, + 0x0027, 0x0120, 0x9186, 0x0014, 0x190c, 0x0cf1, 0x6004, 0x9082, + 0x0040, 0x2008, 0x001a, 0x080c, 0x7f68, 0x0005, 0xa359, 0xa35b, + 0xa35b, 0xa37f, 0xa359, 0xa359, 0xa359, 0xa359, 0xa359, 0xa359, + 0xa359, 0xa359, 0xa359, 0xa359, 0xa359, 0xa359, 0xa359, 0xa359, + 0xa359, 0x080c, 0x0cf1, 0x080c, 0x6c56, 0x080c, 0x6d42, 0x0036, + 0x00d6, 0x6014, 0x906d, 0x01c0, 0x9d84, 0xf000, 0x01a8, 0x6003, + 0x0002, 0x6010, 0x2004, 0xd0bc, 0x1178, 0x2019, 0x0004, 0x080c, + 0xaa84, 0x6017, 0x0000, 0x6018, 0x9005, 0x1120, 0x2001, 0x12a7, + 0x2004, 0x601a, 0x6003, 0x0007, 0x00de, 0x003e, 0x0005, 0x00d6, + 0x080c, 0x6c56, 0x080c, 0x6d42, 0x080c, 0x95d2, 0x0120, 0x6014, + 0x2068, 0x080c, 0x0df6, 0x080c, 0x97a3, 0x00de, 0x0005, 0x0002, + 0xa3a3, 0xa3c0, 0xa3ac, 0xa3d6, 0xa3a3, 0xa3a3, 0xa3a3, 0xa3a3, + 0xa3a3, 0xa3a3, 0xa3a3, 0xa3a3, 0xa3a3, 0xa3a3, 0xa3a3, 0xa3a3, + 0xa3a3, 0xa3a3, 0xa3a3, 0x080c, 0x0cf1, 0x6014, 0x9088, 0x001f, + 0x2104, 0x9085, 0x0400, 0x200a, 0x080c, 0x6c56, 0x6014, 0x9080, + 0x001f, 0x2004, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043, + 0x080c, 0x7f4e, 0x0010, 0x6003, 0x0004, 0x080c, 0x6d42, 0x0005, + 0x080c, 0x6c56, 0x6114, 0x9184, 0xf000, 0x0128, 0x9180, 0x001f, + 0x200c, 0xd1ec, 0x1138, 0x080c, 0x66ae, 0x080c, 0x7f1e, 0x080c, + 0x6d42, 0x0005, 0x080c, 0xacc6, 0x0db0, 0x0cc8, 0x080c, 0x6c56, + 0x2009, 0x0041, 0x0804, 0xa528, 0x9182, 0x0040, 0x0002, 0xa3f2, + 0xa3f4, 0xa3f2, 0xa3f2, 0xa3f2, 0xa3f2, 0xa3f2, 0xa3f2, 0xa3f2, + 0xa3f2, 0xa3f2, 0xa3f2, 0xa3f2, 0xa3f2, 0xa3f2, 0xa3f2, 0xa3f2, + 0xa3f5, 0xa3f2, 0x080c, 0x0cf1, 0x0005, 0x00d6, 0x080c, 0x66ae, + 0x00de, 0x080c, 0xad19, 0x080c, 0x7f1e, 0x0005, 0x9182, 0x0040, + 0x0002, 0xa414, 0xa414, 0xa414, 0xa414, 0xa414, 0xa414, 0xa414, + 0xa416, 0xa414, 0xa419, 0xa471, 0xa414, 0xa414, 0xa414, 0xa414, + 0xa471, 0xa414, 0xa414, 0xa414, 0x080c, 0x0cf1, 0x080c, 0x7f68, + 0x0005, 0x2001, 0x0105, 0x2004, 0x9084, 0x1800, 0x1904, 0xa471, + 0x2001, 0x1172, 0x2004, 0xd0e4, 0x1528, 0x603b, 0x0000, 0x080c, + 0x6cf2, 0x6014, 0x00d6, 0x2068, 0x687c, 0xd0fc, 0x0188, 0x908c, + 0x0003, 0x918e, 0x0002, 0x0508, 0x2001, 0x110c, 0x2004, 0xd0d4, + 0x11e0, 0x080c, 0x6e07, 0x2009, 0x0041, 0x00de, 0x0804, 0xa528, + 0x080c, 0x6e07, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x66ae, + 0x00de, 0x0005, 0x2001, 0x0100, 0x2004, 0x9082, 0x0005, 0x0aa8, + 0x2001, 0x011f, 0x2004, 0x603a, 0x0890, 0x2001, 0x110c, 0x200c, + 0xc1d4, 0x2102, 0xd1cc, 0x0110, 0x080c, 0x2069, 0x080c, 0x6e07, + 0x6014, 0x9080, 0x001f, 0x200c, 0xd1ec, 0x1130, 0x080c, 0x66ae, + 0x080c, 0x7f1e, 0x00de, 0x0005, 0x080c, 0xacc6, 0x0db8, 0x00de, + 0x0005, 0x2001, 0x110c, 0x200c, 0xc1d4, 0x2102, 0x0036, 0x080c, + 0x6cf2, 0x080c, 0x6e07, 0x6014, 0x00d6, 0x2068, 0x6010, 0x2004, + 0xd0bc, 0x0188, 0x687c, 0x9084, 0x0003, 0x9086, 0x0002, 0x0140, + 0x68ac, 0x6330, 0x931a, 0x6332, 0x68b0, 0x632c, 0x931b, 0x632e, + 0x6003, 0x0002, 0x0080, 0x2019, 0x0004, 0x080c, 0xaa84, 0x6018, + 0x9005, 0x1128, 0x2001, 0x12a7, 0x2004, 0x8003, 0x601a, 0x6017, + 0x0000, 0x6003, 0x0007, 0x00de, 0x003e, 0x0005, 0x9182, 0x0040, + 0x0002, 0xa4bd, 0xa4bd, 0xa4bd, 0xa4bd, 0xa4bd, 0xa4bd, 0xa4bd, + 0xa4bd, 0xa4bf, 0xa4bd, 0xa4bd, 0xa4bd, 0xa4bd, 0xa4bd, 0xa4bd, + 0xa4bd, 0xa4bd, 0xa4bd, 0xa4bd, 0xa504, 0x080c, 0x0cf1, 0x6014, + 0x00d6, 0x2068, 0x6834, 0x6a38, 0x6110, 0x210c, 0xd1bc, 0x1190, + 0x920d, 0x1518, 0x687c, 0xd0fc, 0x0128, 0x2009, 0x0041, 0x00de, + 0x0804, 0xa528, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x66ae, + 0x00de, 0x0005, 0x6124, 0xd1f4, 0x1d58, 0x0006, 0x0046, 0x6cac, + 0x9422, 0x69b0, 0x2200, 0x910b, 0x6030, 0x9420, 0x6432, 0x602c, + 0x9109, 0x612e, 0x004e, 0x000e, 0x08d8, 0x6110, 0x210c, 0xd1bc, + 0x1178, 0x2009, 0x110d, 0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, + 0x0010, 0x6003, 0x0006, 0x00e9, 0x080c, 0x66b0, 0x00de, 0x0005, + 0x6003, 0x0002, 0x00de, 0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c, + 0x1132, 0x1904, 0xa4bf, 0x0005, 0x00d6, 0x6014, 0x2068, 0x6834, + 0x6938, 0x00de, 0x9105, 0x1120, 0x080c, 0x1132, 0x1904, 0xa4bf, + 0x0005, 0xd2fc, 0x0140, 0x8002, 0x8000, 0x8212, 0x9291, 0x0000, + 0x2009, 0x0009, 0x0010, 0x2009, 0x0015, 0x6a9a, 0x6896, 0x0005, + 0x9182, 0x0040, 0x0208, 0x0062, 0x9186, 0x0013, 0x0120, 0x9186, + 0x0014, 0x190c, 0x0cf1, 0x6024, 0xd0dc, 0x090c, 0x0cf1, 0x0005, + 0xa54b, 0xa552, 0xa55e, 0xa56a, 0xa54b, 0xa54b, 0xa54b, 0xa579, + 0xa54b, 0xa54d, 0xa54d, 0xa54b, 0xa54b, 0xa54b, 0xa54b, 0xa54d, + 0xa54b, 0xa54d, 0xa54b, 0x080c, 0x0cf1, 0x6024, 0xd0dc, 0x090c, + 0x0cf1, 0x0005, 0x6003, 0x0001, 0x6106, 0x080c, 0x6886, 0x0126, + 0x2091, 0x8000, 0x080c, 0x6d42, 0x012e, 0x0005, 0x6003, 0x0001, + 0x6106, 0x080c, 0x6886, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d42, + 0x012e, 0x0005, 0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x13a9, + 0x0126, 0x2091, 0x8000, 0x080c, 0x68eb, 0x080c, 0x6e10, 0x012e, + 0x0005, 0x9016, 0x080c, 0x119a, 0x0005, 0x0126, 0x2091, 0x8000, + 0x0036, 0x00d6, 0x9182, 0x0040, 0x0023, 0x00de, 0x003e, 0x012e, + 0x0005, 0xa599, 0xa59b, 0xa5ad, 0xa5c8, 0xa599, 0xa599, 0xa599, + 0xa5dd, 0xa599, 0xa599, 0xa599, 0xa599, 0xa599, 0xa599, 0xa599, + 0xa599, 0x080c, 0x0cf1, 0x6014, 0x2068, 0x687c, 0xd0fc, 0x01f8, + 0x909c, 0x0003, 0x939e, 0x0003, 0x01d0, 0x6003, 0x0001, 0x6106, + 0x080c, 0x6886, 0x080c, 0x6d42, 0x0498, 0x6014, 0x2068, 0x687c, + 0xd0fc, 0x0168, 0x909c, 0x0003, 0x939e, 0x0003, 0x0140, 0x6003, + 0x0001, 0x6106, 0x080c, 0x6886, 0x080c, 0x6d42, 0x0408, 0x6017, + 0x0000, 0x601b, 0x0000, 0x2019, 0x0004, 0x080c, 0xaa84, 0x00c0, + 0x6014, 0x2068, 0x687c, 0xd0fc, 0x0d90, 0x909c, 0x0003, 0x939e, + 0x0003, 0x0d68, 0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x13a9, + 0x080c, 0x68eb, 0x080c, 0x6e10, 0x0018, 0x9016, 0x080c, 0x119a, + 0x0005, 0x080c, 0x6c56, 0x6114, 0x81ff, 0x0158, 0x00d6, 0x2168, + 0x080c, 0xad5f, 0x0036, 0x2019, 0x0029, 0x080c, 0xaa84, 0x003e, + 0x00de, 0x080c, 0x97a3, 0x080c, 0x6d42, 0x0005, 0x080c, 0x6cf2, + 0x6114, 0x81ff, 0x0158, 0x00d6, 0x2168, 0x080c, 0xad5f, 0x0036, + 0x2019, 0x0029, 0x080c, 0xaa84, 0x003e, 0x00de, 0x080c, 0x97a3, + 0x080c, 0x6e10, 0x0005, 0x9182, 0x0085, 0x0002, 0xa61b, 0xa619, + 0xa619, 0xa627, 0xa619, 0xa619, 0xa619, 0xa619, 0xa619, 0xa619, + 0xa619, 0x080c, 0x0cf1, 0x6003, 0x000b, 0x6106, 0x080c, 0x6886, + 0x0126, 0x2091, 0x8000, 0x080c, 0x6d42, 0x012e, 0x0005, 0x0026, + 0x00e6, 0x080c, 0xacbf, 0x0118, 0x080c, 0x7f1e, 0x00c8, 0x2071, + 0x0260, 0x7224, 0x6216, 0x7220, 0x080c, 0xa91c, 0x0118, 0x6007, + 0x0086, 0x0040, 0x6007, 0x0087, 0x7224, 0x9296, 0xffff, 0x1110, + 0x6007, 0x0086, 0x6003, 0x0001, 0x080c, 0x6886, 0x080c, 0x6d42, + 0x00ee, 0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, + 0x0085, 0x0a0c, 0x0cf1, 0x908a, 0x0090, 0x1a0c, 0x0cf1, 0x9082, + 0x0085, 0x00a2, 0x9186, 0x0027, 0x0130, 0x9186, 0x0014, 0x0118, + 0x080c, 0x7f68, 0x0050, 0x2001, 0x0007, 0x080c, 0x4ae0, 0x080c, + 0x6c56, 0x080c, 0x97a3, 0x080c, 0x6d42, 0x0005, 0xa679, 0xa67b, + 0xa67b, 0xa679, 0xa679, 0xa679, 0xa679, 0xa679, 0xa679, 0xa679, + 0xa679, 0x080c, 0x0cf1, 0x080c, 0x6c56, 0x080c, 0x97a3, 0x080c, + 0x6d42, 0x0005, 0x9182, 0x0085, 0x0a0c, 0x0cf1, 0x9182, 0x0090, + 0x1a0c, 0x0cf1, 0x9182, 0x0085, 0x0002, 0xa698, 0xa698, 0xa698, + 0xa69a, 0xa698, 0xa698, 0xa698, 0xa698, 0xa698, 0xa698, 0xa698, + 0x080c, 0x0cf1, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186, 0x0014, + 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0x7f68, 0x0030, 0x080c, + 0x6c56, 0x080c, 0x97a3, 0x080c, 0x6d42, 0x0005, 0x0036, 0x080c, + 0xad19, 0x6043, 0x0000, 0x2019, 0x000b, 0x0031, 0x6023, 0x0006, + 0x6003, 0x0007, 0x003e, 0x0005, 0x0126, 0x0036, 0x2091, 0x8000, + 0x0086, 0x2c40, 0x0096, 0x2049, 0x0000, 0x080c, 0x7a48, 0x009e, + 0x008e, 0x1578, 0x0076, 0x2c38, 0x080c, 0x7ae2, 0x007e, 0x1548, + 0x6000, 0x9086, 0x0000, 0x0528, 0x6020, 0x9086, 0x0007, 0x0508, + 0x00d6, 0x6000, 0x9086, 0x0004, 0x1150, 0x080c, 0xad19, 0x6023, + 0x0007, 0x2001, 0x12a6, 0x2004, 0x601a, 0x080c, 0x12c7, 0x6014, + 0x2068, 0x080c, 0x95d2, 0x0110, 0x080c, 0xaa84, 0x00de, 0x6017, + 0x0000, 0x080c, 0xad19, 0x6023, 0x0007, 0x2001, 0x12a6, 0x2004, + 0x601a, 0x003e, 0x012e, 0x0005, 0x00f6, 0x00c6, 0x0036, 0x0156, + 0x2079, 0x0260, 0x7938, 0x783c, 0x080c, 0x1c69, 0x15a0, 0x0016, + 0x00c6, 0x080c, 0x4b58, 0x1568, 0x001e, 0x002e, 0x0026, 0x0016, + 0x2019, 0x0029, 0x080c, 0x7ba2, 0x080c, 0x69ca, 0x0076, 0x2039, + 0x0000, 0x080c, 0x68fe, 0x007e, 0x001e, 0x0076, 0x2039, 0x0000, + 0x080c, 0xa85f, 0x007e, 0x0026, 0x6204, 0x9294, 0xff00, 0x8217, + 0x9286, 0x0006, 0x0118, 0x9286, 0x0004, 0x1118, 0x62a0, 0x080c, + 0x2661, 0x002e, 0x001e, 0x080c, 0x472d, 0x6612, 0x6516, 0x9006, + 0x0010, 0x00ce, 0x001e, 0x015e, 0x003e, 0x00ce, 0x00fe, 0x0005, + 0x00c6, 0x00d6, 0x00e6, 0x0016, 0x2009, 0x1120, 0x2104, 0x9086, + 0x0074, 0x1904, 0xa798, 0x2069, 0x0260, 0x6944, 0x9182, 0x0100, + 0x06d8, 0x6940, 0x9184, 0x8000, 0x0904, 0xa795, 0x2001, 0x128f, + 0x2004, 0x9005, 0x1160, 0x6010, 0x2070, 0x7010, 0x9084, 0x00ff, + 0x0118, 0x7000, 0xd0f4, 0x0118, 0x9184, 0x0800, 0x0570, 0x6948, + 0x918a, 0x0001, 0x0620, 0x694c, 0x2009, 0x0205, 0x200b, 0x0001, + 0x693c, 0x81ff, 0x1198, 0x6944, 0x9182, 0x0100, 0x02a8, 0x6940, + 0x81ff, 0x1178, 0x6948, 0x918a, 0x0001, 0x0288, 0x6950, 0x918a, + 0x0001, 0x0298, 0x00d0, 0x6017, 0x0100, 0x00a0, 0x6017, 0x0300, + 0x0088, 0x6017, 0x0500, 0x0070, 0x6017, 0x0700, 0x0058, 0x6017, + 0x0900, 0x0040, 0x6017, 0x0b00, 0x0028, 0x6017, 0x0f00, 0x0010, + 0x6017, 0x2d00, 0x9085, 0x0001, 0x0008, 0x9006, 0x001e, 0x00ee, + 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x0026, 0x0036, 0x0156, + 0x6210, 0x2268, 0x6b04, 0x9394, 0x00ff, 0x9286, 0x0006, 0x0190, + 0x9286, 0x0004, 0x0178, 0x9394, 0xff00, 0x8217, 0x9286, 0x0006, + 0x0148, 0x9286, 0x0004, 0x0130, 0x00c6, 0x2d60, 0x080c, 0x4b67, + 0x00ce, 0x04c0, 0x2011, 0x0276, 0x20a9, 0x0004, 0x9d98, 0x000a, + 0x080c, 0x8a45, 0x1580, 0x2011, 0x027a, 0x20a9, 0x0004, 0x9d98, + 0x0006, 0x080c, 0x8a45, 0x1538, 0x0046, 0x0016, 0x6aa0, 0x9294, + 0x00ff, 0x8227, 0x9006, 0x2009, 0x1153, 0x210c, 0xd1a4, 0x0138, + 0x2009, 0x0029, 0x080c, 0xaaca, 0x6800, 0xc0e5, 0x6802, 0x2019, + 0x0029, 0x080c, 0x69ca, 0x0076, 0x2039, 0x0000, 0x080c, 0x68fe, + 0x2c08, 0x080c, 0xa85f, 0x007e, 0x2001, 0x0007, 0x080c, 0x4ae0, + 0x001e, 0x004e, 0x9006, 0x015e, 0x003e, 0x002e, 0x00de, 0x00ce, + 0x0005, 0x00d6, 0x2069, 0x026e, 0x6800, 0x9086, 0x0800, 0x0118, + 0x6017, 0x0000, 0x0008, 0x9006, 0x00de, 0x0005, 0x00c6, 0x00f6, + 0x0016, 0x0026, 0x0036, 0x0156, 0x2079, 0x026c, 0x7930, 0x7834, + 0x080c, 0x1c69, 0x11a0, 0x080c, 0x4b58, 0x1188, 0x2011, 0x0270, + 0x20a9, 0x0004, 0x9c98, 0x000a, 0x080c, 0x8a45, 0x1140, 0x2011, + 0x0274, 0x20a9, 0x0004, 0x9c98, 0x0006, 0x080c, 0x8a45, 0x015e, + 0x003e, 0x002e, 0x001e, 0x00fe, 0x00ce, 0x0005, 0x00c6, 0x0006, + 0x0016, 0x0026, 0x0036, 0x0156, 0x2011, 0x0263, 0x2204, 0x8211, + 0x220c, 0x080c, 0x1c69, 0x11a0, 0x080c, 0x4b58, 0x1188, 0x2011, + 0x0276, 0x20a9, 0x0004, 0x9c98, 0x000a, 0x080c, 0x8a45, 0x1140, + 0x2011, 0x027a, 0x20a9, 0x0004, 0x9c98, 0x0006, 0x080c, 0x8a45, + 0x015e, 0x003e, 0x002e, 0x001e, 0x000e, 0x00ce, 0x0005, 0x00e6, + 0x00c6, 0x0086, 0x0076, 0x0066, 0x0056, 0x0046, 0x0026, 0x0126, + 0x2091, 0x8000, 0x2740, 0x2029, 0x12e5, 0x252c, 0x2021, 0x12eb, + 0x2424, 0x2061, 0x15c0, 0x2071, 0x1100, 0x7644, 0x7064, 0x81ff, + 0x0128, 0x8001, 0x9602, 0x1a04, 0xa8db, 0x0018, 0x9606, 0x0904, + 0xa8db, 0x2100, 0x9c06, 0x0904, 0xa8d2, 0x080c, 0xaaf2, 0x0904, + 0xa8d2, 0x6720, 0x9786, 0x0001, 0x0904, 0xa8f3, 0x9786, 0x0004, + 0x0904, 0xa8f3, 0x9786, 0x0007, 0x05e8, 0x2500, 0x9c06, 0x05d0, + 0x2400, 0x9c06, 0x05b8, 0x080c, 0xab02, 0x15a0, 0x88ff, 0x0118, + 0x6054, 0x9906, 0x1578, 0x00d6, 0x6000, 0x9086, 0x0004, 0x1120, + 0x0016, 0x080c, 0x12c7, 0x001e, 0x9786, 0x0008, 0x1148, 0x080c, + 0x97cd, 0x1130, 0x080c, 0x8576, 0x00de, 0x080c, 0x97a3, 0x00d0, + 0x6014, 0x2068, 0x080c, 0x95d2, 0x0190, 0x9786, 0x0003, 0x1528, + 0x6867, 0x0103, 0x6b7a, 0x6877, 0x0000, 0x080c, 0xad5f, 0x0016, + 0x080c, 0x9843, 0x080c, 0x50a5, 0x001e, 0x080c, 0x9797, 0x00de, + 0x080c, 0x97a3, 0x9ce0, 0x0018, 0x2001, 0x1116, 0x2004, 0x9c02, + 0x1210, 0x0804, 0xa873, 0x012e, 0x002e, 0x004e, 0x005e, 0x006e, + 0x007e, 0x008e, 0x00ce, 0x00ee, 0x0005, 0x9786, 0x0006, 0x19c0, + 0x9386, 0x0005, 0x0128, 0x080c, 0xad5f, 0x080c, 0xaa84, 0x08f8, + 0x00de, 0x0c00, 0x0868, 0x080c, 0xab02, 0x19e0, 0x81ff, 0x09d0, + 0x9180, 0x0001, 0x2004, 0x9086, 0x0018, 0x0130, 0x9180, 0x0001, + 0x2004, 0x9086, 0x002d, 0x1970, 0x6000, 0x9086, 0x0002, 0x1950, + 0x080c, 0x97bc, 0x0130, 0x080c, 0x97cd, 0x1920, 0x080c, 0x8576, + 0x0038, 0x080c, 0x25d1, 0x080c, 0x97cd, 0x1110, 0x080c, 0x8576, + 0x080c, 0x97a3, 0x0804, 0xa8d2, 0x00c6, 0x00e6, 0x0016, 0x2c08, + 0x2170, 0x9006, 0x080c, 0xaa9c, 0x001e, 0x0120, 0x6020, 0x9084, + 0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005, 0xa93b, 0xa93b, 0xa93b, + 0xa93b, 0xa93b, 0xa93b, 0xa93d, 0xa93b, 0xa93b, 0xa93b, 0xa93b, + 0x97a3, 0x97a3, 0xa93b, 0x9006, 0x0005, 0x0046, 0x0016, 0x7010, + 0x9080, 0x0028, 0x2024, 0x94a4, 0x00ff, 0x8427, 0x2c00, 0x2009, + 0x0020, 0x080c, 0xaaca, 0x001e, 0x004e, 0x0036, 0x2019, 0x0002, + 0x080c, 0xa6bc, 0x003e, 0x9085, 0x0001, 0x0005, 0x00d6, 0x6014, + 0x906d, 0x9084, 0xf000, 0x0130, 0x080c, 0x92a4, 0x687b, 0x0005, + 0x080c, 0x50a5, 0x00de, 0x080c, 0x97a3, 0x0005, 0x2001, 0x0001, + 0x080c, 0x4aa1, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, + 0x2019, 0x1105, 0x2011, 0x0276, 0x080c, 0x8a45, 0x003e, 0x002e, + 0x001e, 0x015e, 0x9005, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, + 0x0076, 0x0066, 0x0026, 0x0126, 0x2091, 0x8000, 0x2740, 0x2061, + 0x15c0, 0x2079, 0x0001, 0x8fff, 0x0904, 0xa9da, 0x2071, 0x1100, + 0x7644, 0x7064, 0x8001, 0x9602, 0x1a04, 0xa9da, 0x88ff, 0x0128, + 0x2800, 0x9c06, 0x15b0, 0x2079, 0x0000, 0x080c, 0xaaf2, 0x0588, + 0x2400, 0x9c06, 0x0570, 0x6720, 0x9786, 0x0006, 0x1550, 0x9786, + 0x0007, 0x0538, 0x88ff, 0x1140, 0x6010, 0x9206, 0x1510, 0x85ff, + 0x0118, 0x6054, 0x9106, 0x11e8, 0x00d6, 0x6000, 0x9086, 0x0004, + 0x1150, 0x080c, 0xad19, 0x6023, 0x0007, 0x2001, 0x12a6, 0x2004, + 0x601a, 0x080c, 0x12c7, 0x6014, 0x2068, 0x080c, 0x95d2, 0x0120, + 0x0046, 0x080c, 0xaa84, 0x004e, 0x00de, 0x080c, 0x97a3, 0x88ff, + 0x1198, 0x9ce0, 0x0018, 0x2001, 0x1116, 0x2004, 0x9c02, 0x1210, + 0x0804, 0xa98b, 0x9006, 0x012e, 0x002e, 0x006e, 0x007e, 0x008e, + 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x98c5, 0x0001, 0x0ca0, 0x0076, + 0x0056, 0x0086, 0x2041, 0x0000, 0x2029, 0x0001, 0x2c20, 0x2019, + 0x0002, 0x6210, 0x0096, 0x2049, 0x0000, 0x080c, 0x7a48, 0x009e, + 0x008e, 0x2039, 0x0000, 0x080c, 0x7ae2, 0x080c, 0xa97c, 0x005e, + 0x007e, 0x0005, 0x0026, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156, + 0x2c20, 0x2128, 0x20a9, 0x007f, 0x2009, 0x0000, 0x0016, 0x0036, + 0x080c, 0x4b58, 0x11b0, 0x2c10, 0x0056, 0x0086, 0x2041, 0x0000, + 0x2508, 0x2029, 0x0001, 0x0096, 0x2049, 0x0000, 0x080c, 0x7a48, + 0x009e, 0x008e, 0x2039, 0x0000, 0x080c, 0x7ae2, 0x080c, 0xa97c, + 0x005e, 0x003e, 0x001e, 0x8108, 0x1f04, 0xaa0e, 0x015e, 0x00ce, + 0x007e, 0x005e, 0x004e, 0x002e, 0x0005, 0x0076, 0x0056, 0x6210, + 0x0086, 0x2041, 0x0000, 0x2029, 0x0001, 0x2019, 0x0048, 0x0096, + 0x2049, 0x0000, 0x080c, 0x7a48, 0x009e, 0x008e, 0x2039, 0x0000, + 0x080c, 0x7ae2, 0x2c20, 0x080c, 0xa97c, 0x005e, 0x007e, 0x0005, + 0x0026, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20, 0x20a9, + 0x007f, 0x2009, 0x0000, 0x0016, 0x0036, 0x080c, 0x4b58, 0x11c0, + 0x2c10, 0x0086, 0x2041, 0x0000, 0x2828, 0x0046, 0x2021, 0x0001, + 0x080c, 0xacfb, 0x004e, 0x0096, 0x2049, 0x0000, 0x080c, 0x7a48, + 0x009e, 0x008e, 0x2039, 0x0000, 0x080c, 0x7ae2, 0x080c, 0xa97c, + 0x003e, 0x001e, 0x8108, 0x1f04, 0xaa5b, 0x015e, 0x00ce, 0x007e, + 0x005e, 0x004e, 0x002e, 0x0005, 0x0016, 0x00f6, 0x9d82, 0x45c0, + 0x0280, 0x9d82, 0xffff, 0x1268, 0x6800, 0x907d, 0x0138, 0x6803, + 0x0000, 0x6b82, 0x080c, 0x50a5, 0x2f68, 0x0cb0, 0x6b82, 0x080c, + 0x50a5, 0x00fe, 0x001e, 0x0005, 0x00e6, 0x0046, 0x0036, 0x2061, + 0x15c0, 0x9005, 0x1138, 0x2071, 0x1100, 0x7444, 0x7064, 0x8001, + 0x9402, 0x12d8, 0x2100, 0x9c06, 0x0168, 0x6000, 0x9086, 0x0000, + 0x0148, 0x6008, 0x9206, 0x1130, 0x6010, 0x91a0, 0x0004, 0x2424, + 0x9406, 0x0140, 0x9ce0, 0x0018, 0x2001, 0x1116, 0x2004, 0x9c02, + 0x1220, 0x0c40, 0x9085, 0x0001, 0x0008, 0x9006, 0x003e, 0x004e, + 0x00ee, 0x0005, 0x00d6, 0x0006, 0x080c, 0x0ddf, 0x000e, 0x090c, + 0x0cf1, 0x6867, 0x010d, 0x688e, 0x0026, 0x2010, 0x080c, 0x95c2, + 0x2001, 0x0000, 0x0120, 0x2200, 0x9080, 0x0015, 0x2004, 0x002e, + 0x687a, 0x6986, 0x6c76, 0x687f, 0x0000, 0x2001, 0x12ae, 0x2004, + 0x6882, 0x9006, 0x68e2, 0x6802, 0x686a, 0x688a, 0x080c, 0x50a5, + 0x00de, 0x0005, 0x6700, 0x9786, 0x0000, 0x0158, 0x9786, 0x0001, + 0x0140, 0x9786, 0x000a, 0x0128, 0x9786, 0x0009, 0x0110, 0x9085, + 0x0001, 0x0005, 0x00e6, 0x6010, 0x2070, 0x70a0, 0x9206, 0x00ee, + 0x0005, 0x0016, 0x6004, 0x908e, 0x001e, 0x11a0, 0x8007, 0x6134, + 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b, + 0x6023, 0x0005, 0x2001, 0x12a7, 0x2004, 0x601a, 0x080c, 0x6886, + 0x080c, 0x6d42, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005, 0x6024, + 0xd0e4, 0x0158, 0xd0cc, 0x0118, 0x080c, 0x98aa, 0x0030, 0x080c, + 0xad19, 0x080c, 0x66ae, 0x080c, 0x7f1e, 0x0005, 0x9280, 0x0008, + 0x2004, 0x9084, 0x000f, 0x0002, 0xab4a, 0xab4a, 0xab4a, 0xab4c, + 0xab4a, 0xab4c, 0xab4c, 0xab4a, 0xab4c, 0xab4a, 0xab4a, 0xab4a, + 0xab4a, 0xab4a, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x9280, + 0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xab63, 0xab63, 0xab63, + 0xab63, 0xab63, 0xab63, 0xab70, 0xab63, 0xab63, 0xab63, 0xab63, + 0xab63, 0xab63, 0xab63, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, + 0x2a00, 0x6003, 0x0001, 0x080c, 0x6886, 0x080c, 0x6d42, 0x0005, + 0x00c6, 0x2260, 0x080c, 0xad19, 0x6043, 0x0000, 0x6024, 0xc0f4, + 0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce, 0x00d6, 0x2268, 0x9186, + 0x0007, 0x1904, 0xabcb, 0x6814, 0x9005, 0x0138, 0x9080, 0x001f, + 0x2004, 0xd0fc, 0x1110, 0x00de, 0x08b0, 0x6007, 0x003a, 0x6003, + 0x0001, 0x080c, 0x6886, 0x080c, 0x6d42, 0x00c6, 0x2d60, 0x6100, + 0x9186, 0x0002, 0x1904, 0xac4e, 0x6014, 0x9005, 0x1138, 0x6000, + 0x9086, 0x0007, 0x190c, 0x0cf1, 0x0804, 0xac4e, 0x908c, 0xf000, + 0x1130, 0x0028, 0x2068, 0x6800, 0x9005, 0x1de0, 0x2d00, 0x9080, + 0x001f, 0x2004, 0x9084, 0x0003, 0x9086, 0x0002, 0x1180, 0x6014, + 0x2068, 0x687c, 0xc0dc, 0xc0f4, 0x687e, 0x6880, 0xc0f4, 0xc0fc, + 0x6882, 0x2009, 0x0043, 0x080c, 0xa528, 0x0804, 0xac4e, 0x2009, + 0x0041, 0x0804, 0xac48, 0x9186, 0x0005, 0x15c0, 0x6814, 0x9080, + 0x001f, 0x2004, 0xd0bc, 0x1118, 0x00de, 0x0804, 0xab63, 0xd0b4, + 0x0128, 0xd0fc, 0x090c, 0x0cf1, 0x0804, 0xab83, 0x6007, 0x003a, + 0x6003, 0x0001, 0x080c, 0x6886, 0x080c, 0x6d42, 0x00c6, 0x2d60, + 0x6100, 0x9186, 0x0002, 0x0120, 0x9186, 0x0004, 0x1904, 0xac4e, + 0x6814, 0x9080, 0x001f, 0x200c, 0xc1f4, 0xc1dc, 0x2102, 0x8000, + 0x200c, 0xc1f4, 0xc1fc, 0xc1bc, 0x2102, 0x00f6, 0x2c78, 0x080c, + 0x119d, 0x00fe, 0x2009, 0x0042, 0x0804, 0xac48, 0x0036, 0x00d6, + 0x00d6, 0x080c, 0x0ddf, 0x003e, 0x090c, 0x0cf1, 0x6867, 0x010d, + 0x6803, 0x0000, 0x686b, 0x0000, 0x688b, 0x0000, 0x6b8e, 0x6887, + 0x0045, 0x2c00, 0x6892, 0x6038, 0x68a2, 0x2360, 0x6024, 0xc0dd, + 0x6026, 0x6010, 0x9080, 0x0028, 0x2004, 0x9084, 0x00ff, 0x8007, + 0x6354, 0x6b7a, 0x6876, 0x687f, 0x0000, 0x6883, 0x0000, 0x6d9a, + 0x6e96, 0x689f, 0x0001, 0x080c, 0x50a5, 0x2019, 0x0045, 0x6008, + 0x2068, 0x080c, 0xa6bc, 0x2d00, 0x600a, 0x6023, 0x0006, 0x6003, + 0x0007, 0x601b, 0x0000, 0x6043, 0x0000, 0x00de, 0x003e, 0x0038, + 0x6043, 0x0000, 0x6003, 0x0007, 0x080c, 0xa528, 0x00ce, 0x00de, + 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0085, 0x2008, + 0x00c2, 0x9186, 0x0027, 0x1178, 0x080c, 0x6c56, 0x0036, 0x00d6, + 0x6014, 0x2068, 0x2019, 0x0004, 0x080c, 0xaa84, 0x00de, 0x003e, + 0x080c, 0x6d42, 0x0005, 0x9186, 0x0014, 0x0d70, 0x080c, 0x7f68, + 0x0005, 0xac7e, 0xac7c, 0xac7c, 0xac7c, 0xac7c, 0xac7c, 0xac7e, + 0xac7c, 0xac7c, 0xac7c, 0xac7c, 0x080c, 0x0cf1, 0x080c, 0x6c56, + 0x6003, 0x000c, 0x080c, 0x6d42, 0x0005, 0x9182, 0x0090, 0x1220, + 0x9182, 0x0085, 0x0208, 0x001a, 0x080c, 0x7f68, 0x0005, 0xac9a, + 0xac9a, 0xac9a, 0xac9a, 0xac9c, 0xacbc, 0xac9a, 0xac9a, 0xac9a, + 0xac9a, 0xac9a, 0x080c, 0x0cf1, 0x00d6, 0x2c68, 0x080c, 0x7ec8, + 0x01b0, 0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0x026e, 0x210c, + 0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x600b, 0xffff, 0x6910, + 0x6112, 0x6023, 0x0004, 0x080c, 0x6886, 0x080c, 0x6d42, 0x2d60, + 0x080c, 0x7f1e, 0x00de, 0x0005, 0x080c, 0x7f1e, 0x0005, 0x00e6, + 0x6010, 0x2070, 0x7000, 0xd0ec, 0x00ee, 0x0005, 0x2009, 0x1172, + 0x210c, 0xd1ec, 0x0578, 0x6003, 0x0002, 0x6024, 0xc0e5, 0x6026, + 0xd0cc, 0x0150, 0x2001, 0x12a8, 0x2004, 0x6042, 0x2009, 0x1172, + 0x210c, 0xd1f4, 0x11e8, 0x0080, 0x2009, 0x1172, 0x210c, 0xd1f4, + 0x0128, 0x6024, 0xc0e4, 0x6026, 0x9006, 0x00a0, 0x2001, 0x12a8, + 0x200c, 0x8103, 0x9100, 0x6042, 0x6010, 0x9088, 0x002b, 0x2104, + 0x9005, 0x0118, 0x9088, 0x0003, 0x0cd0, 0x2c0a, 0x600f, 0x0000, + 0x9085, 0x0001, 0x0005, 0x0016, 0x00c6, 0x00e6, 0x6154, 0x92f0, + 0x002b, 0x2e04, 0x2060, 0x8cff, 0x0180, 0x84ff, 0x1118, 0x6054, + 0x9106, 0x1138, 0x600c, 0x2072, 0x080c, 0x66ae, 0x080c, 0x7f1e, + 0x0010, 0x9cf0, 0x0003, 0x2e64, 0x0c70, 0x00ee, 0x00ce, 0x001e, + 0x0005, 0x00d6, 0x6010, 0x90e8, 0x002b, 0x2d04, 0x9005, 0x0140, + 0x9c06, 0x0120, 0x2d04, 0x90e8, 0x0003, 0x0cb8, 0x600c, 0x206a, + 0x00de, 0x0005, 0x0026, 0x0036, 0x0156, 0x2011, 0x1127, 0x2204, + 0x9084, 0x00ff, 0x2019, 0x026e, 0x2334, 0x9636, 0x11d8, 0x8318, + 0x2334, 0x2204, 0x9084, 0xff00, 0x9636, 0x11a0, 0x2011, 0x0270, + 0x20a9, 0x0004, 0x6010, 0x9098, 0x000a, 0x080c, 0x8a45, 0x1150, + 0x2011, 0x0274, 0x20a9, 0x0004, 0x6010, 0x9098, 0x0006, 0x080c, + 0x8a45, 0x1100, 0x015e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x2071, + 0x1100, 0x080c, 0x46bb, 0x080c, 0x23cd, 0x00ee, 0x0005, 0x00e6, + 0x6010, 0x2070, 0x7000, 0xd0fc, 0x0108, 0x0011, 0x00ee, 0x0005, + 0x6880, 0xc0e5, 0x6882, 0x0005, 0x00e6, 0x00c6, 0x0076, 0x0066, + 0x0056, 0x0046, 0x0026, 0x0016, 0x0126, 0x2091, 0x8000, 0x2029, + 0x12e5, 0x252c, 0x2021, 0x12eb, 0x2424, 0x2061, 0x15c0, 0x2071, + 0x1100, 0x7644, 0x7064, 0x9606, 0x0578, 0x6720, 0x9786, 0x0001, + 0x0118, 0x9786, 0x0008, 0x1500, 0x2500, 0x9c06, 0x01e8, 0x2400, + 0x9c06, 0x01d0, 0x080c, 0xaaf2, 0x01b8, 0x080c, 0xab02, 0x11a0, + 0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x12c7, 0x001e, + 0x080c, 0x97bc, 0x1110, 0x080c, 0x25d1, 0x080c, 0x97cd, 0x1110, + 0x080c, 0x8576, 0x080c, 0x97a3, 0x9ce0, 0x0018, 0x2001, 0x1116, + 0x2004, 0x9c02, 0x1208, 0x0858, 0x012e, 0x001e, 0x002e, 0x004e, + 0x005e, 0x006e, 0x007e, 0x00ce, 0x00ee, 0x0005, 0x0126, 0x0006, + 0x00e6, 0x2091, 0x8000, 0x2071, 0x1140, 0xd5a4, 0x0118, 0x7034, + 0x8000, 0x7036, 0xd5b4, 0x0118, 0x7030, 0x8000, 0x7032, 0xd5ac, + 0x0118, 0x2071, 0x114a, 0x0451, 0x00ee, 0x000e, 0x012e, 0x0005, + 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, 0x1140, 0xd5a4, + 0x0118, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0118, 0x7030, 0x8000, + 0x7032, 0xd5ac, 0x0118, 0x2071, 0x114a, 0x0081, 0x00ee, 0x000e, + 0x012e, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, + 0x1142, 0x0021, 0x00ee, 0x000e, 0x012e, 0x0005, 0x2e04, 0x8000, + 0x2072, 0x1220, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x0005, 0x00e6, + 0x2071, 0x1140, 0x0c99, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1144, + 0x0c69, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, + 0x2071, 0x1140, 0x7044, 0x8000, 0x7046, 0x00ee, 0x000e, 0x012e, + 0x0005, 0x8064, 0x0008, 0x0010, 0x0000, 0x8066, 0x0000, 0x0101, + 0x0008, 0x4404, 0x0003, 0x8060, 0x0000, 0x0400, 0x0000, 0x580a, + 0x0003, 0x791e, 0x0003, 0x507c, 0x0003, 0x4c07, 0x000b, 0xbac0, + 0x0009, 0x0082, 0x0008, 0x0c07, 0x0003, 0x15fe, 0x0008, 0x3407, + 0x000b, 0x808c, 0x0008, 0x0001, 0x0000, 0x0000, 0x0007, 0x4047, + 0x000a, 0x808c, 0x0008, 0x0002, 0x0000, 0x0819, 0x000b, 0x4022, + 0x0000, 0x001a, 0x0003, 0x4122, 0x0008, 0x0bfe, 0x0008, 0x11a0, + 0x0001, 0x11a5, 0x000b, 0x0ca0, 0x0001, 0x11a5, 0x000b, 0x9180, + 0x0001, 0x0005, 0x0008, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0019, + 0x0000, 0x4424, 0x000b, 0x0240, 0x0002, 0x099f, 0x000b, 0x00fe, + 0x0000, 0x31a2, 0x000b, 0x112a, 0x0000, 0x002e, 0x0008, 0x022c, + 0x0008, 0x3a44, 0x0002, 0x0c07, 0x0003, 0x1734, 0x0000, 0x1530, + 0x0000, 0x1632, 0x0008, 0x0d2a, 0x0008, 0x9a80, 0x0009, 0x000f, + 0x0008, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0011, 0x0008, 0x4437, + 0x0003, 0x808c, 0x0008, 0x0002, 0x0000, 0x01fe, 0x0008, 0x42e0, + 0x0009, 0x0d98, 0x000b, 0x00fe, 0x0000, 0x43e0, 0x0001, 0x0d98, + 0x000b, 0x9880, 0x0001, 0x0010, 0x0000, 0x7f62, 0x0008, 0x8066, + 0x0000, 0x1e0a, 0x0008, 0x4445, 0x0003, 0x808a, 0x0008, 0x0003, + 0x0008, 0x9a80, 0x0009, 0x0002, 0x0000, 0x7f62, 0x0008, 0x584b, + 0x0003, 0x8066, 0x0000, 0x3679, 0x0000, 0x444e, 0x000b, 0x584f, + 0x000b, 0x8054, 0x0008, 0x0011, 0x0008, 0x8074, 0x0000, 0x1010, + 0x0008, 0x1efe, 0x0000, 0x3007, 0x0003, 0x0058, 0x000c, 0x0007, + 0x0003, 0x1cfe, 0x0008, 0x1b80, 0x0009, 0x7f62, 0x0008, 0x8066, + 0x0000, 0x0231, 0x0008, 0x445d, 0x0003, 0x585e, 0x000b, 0x0140, + 0x0008, 0x0140, 0x0008, 0x0242, 0x0000, 0x0242, 0x0000, 0x1f43, + 0x0002, 0x0c6e, 0x0003, 0x0d44, 0x0000, 0x0d44, 0x0000, 0x0d46, + 0x0008, 0x0d46, 0x0008, 0x0348, 0x0008, 0x0348, 0x0008, 0x044a, + 0x0008, 0x044a, 0x0008, 0x0076, 0x0003, 0x0344, 0x0008, 0x0344, + 0x0008, 0x0446, 0x0008, 0x0446, 0x0008, 0x0548, 0x0008, 0x0548, + 0x0008, 0x064a, 0x0000, 0x064a, 0x0000, 0x5876, 0x000b, 0x8054, + 0x0008, 0x0001, 0x0000, 0x8074, 0x0000, 0x2020, 0x0008, 0x4000, + 0x000f, 0x3a40, 0x000a, 0x0c0a, 0x000b, 0x2b24, 0x0008, 0x2b24, + 0x0008, 0x5880, 0x000b, 0x8054, 0x0008, 0x0002, 0x0000, 0x1242, + 0x0002, 0x08ca, 0x0003, 0x3a45, 0x000a, 0x08bb, 0x0003, 0x1e10, + 0x000a, 0x7f3c, 0x0000, 0x08b8, 0x0003, 0x1d00, 0x0002, 0x7f3a, + 0x0000, 0x0d60, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, + 0x0008, 0x4490, 0x000b, 0x8060, 0x0000, 0x0400, 0x0000, 0x00fe, + 0x0000, 0x34b5, 0x000b, 0x1cfe, 0x0008, 0xff80, 0x0009, 0x0001, + 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x449b, + 0x0003, 0x00fe, 0x0000, 0x318b, 0x0003, 0x0038, 0x0000, 0x00fe, + 0x0000, 0xff80, 0x0009, 0x0019, 0x0000, 0x7f62, 0x0008, 0x8066, + 0x0000, 0x0009, 0x0008, 0x44a5, 0x000b, 0x80c0, 0x0009, 0x00ff, + 0x0008, 0x7f3e, 0x0008, 0x0d60, 0x0000, 0x0efe, 0x0008, 0x1f80, + 0x0001, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x44af, + 0x000b, 0x8060, 0x0000, 0x0400, 0x0000, 0x003a, 0x0008, 0x1dfe, + 0x0000, 0x008c, 0x0003, 0x0036, 0x0008, 0x0058, 0x000c, 0x00ca, + 0x000b, 0x8074, 0x0000, 0x2000, 0x0000, 0x00ca, 0x000b, 0x3a44, + 0x0002, 0x09a8, 0x0003, 0x8074, 0x0000, 0x1000, 0x0000, 0x2d0e, + 0x0000, 0x2d0e, 0x0000, 0x358b, 0x000b, 0x26fe, 0x0008, 0x26fe, + 0x0008, 0x2700, 0x0008, 0x2700, 0x0008, 0x00d0, 0x0009, 0x0cd8, + 0x000b, 0x8074, 0x0000, 0x4040, 0x0008, 0x58ca, 0x0003, 0x507c, + 0x0003, 0x3a46, 0x000a, 0x0cd8, 0x000b, 0x3a47, 0x0002, 0x08d5, + 0x000b, 0x8054, 0x0008, 0x0004, 0x0000, 0x8074, 0x0000, 0x8000, + 0x0000, 0x0112, 0x0003, 0x92c0, 0x0009, 0x0f88, 0x0008, 0x0807, + 0x000b, 0x9a80, 0x0009, 0x0002, 0x0000, 0x7f62, 0x0008, 0x8066, + 0x0000, 0x362a, 0x0000, 0x44dd, 0x000b, 0x2000, 0x0000, 0x2000, + 0x0000, 0x2102, 0x0000, 0x2102, 0x0000, 0x2204, 0x0000, 0x2204, + 0x0000, 0x2306, 0x0000, 0x2306, 0x0000, 0x2408, 0x0000, 0x2408, + 0x0000, 0x250a, 0x0000, 0x250a, 0x0000, 0x260c, 0x0000, 0x260c, + 0x0000, 0x270e, 0x0000, 0x270e, 0x0000, 0x2810, 0x0000, 0x2810, + 0x0000, 0x2912, 0x0000, 0x2912, 0x0000, 0x9a80, 0x0009, 0x0007, + 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0052, 0x0000, 0x44f7, + 0x0003, 0x92c0, 0x0009, 0x0780, 0x0008, 0x0d92, 0x000b, 0x124b, + 0x0002, 0x0900, 0x000b, 0x2e4d, 0x0002, 0x2e4d, 0x0002, 0x098b, + 0x000b, 0x5900, 0x000b, 0x8054, 0x0008, 0x0004, 0x0000, 0x3a46, + 0x000a, 0x0d0d, 0x000b, 0x1243, 0x000a, 0x0910, 0x0003, 0x8010, + 0x0008, 0x000d, 0x0000, 0x017c, 0x0004, 0x1810, 0x0000, 0x017c, + 0x0004, 0x0110, 0x000b, 0x0173, 0x0004, 0x1810, 0x0000, 0x017c, + 0x0004, 0x8074, 0x0000, 0xf000, 0x0008, 0x3a42, 0x0002, 0x0d18, + 0x0003, 0x15fe, 0x0008, 0x342e, 0x0003, 0x0d30, 0x0000, 0x0007, + 0x0003, 0x8074, 0x0000, 0x0501, 0x0000, 0x8010, 0x0008, 0x000c, + 0x0008, 0x017c, 0x0004, 0x0007, 0x0003, 0xbbe0, 0x0009, 0x0030, + 0x0008, 0x0d2e, 0x0003, 0x18fe, 0x0000, 0x3ce0, 0x0009, 0x092b, + 0x000b, 0x15fe, 0x0008, 0x3ce0, 0x0009, 0x092b, 0x000b, 0x016e, + 0x0004, 0x8076, 0x0008, 0x0040, 0x0000, 0x016b, 0x000b, 0x8076, + 0x0008, 0x0041, 0x0008, 0x016b, 0x000b, 0xbbe0, 0x0009, 0x0032, + 0x0000, 0x0d33, 0x0003, 0x3c1e, 0x0008, 0x016b, 0x000b, 0xbbe0, + 0x0009, 0x0037, 0x0000, 0x0d50, 0x0003, 0x18fe, 0x0000, 0x3ce0, + 0x0009, 0x0d2b, 0x0003, 0x1afe, 0x0008, 0xff80, 0x0009, 0x000d, + 0x0000, 0x7f62, 0x0008, 0x2604, 0x0008, 0x2604, 0x0008, 0x2706, + 0x0008, 0x2706, 0x0008, 0x2808, 0x0000, 0x2808, 0x0000, 0x290a, + 0x0000, 0x290a, 0x0000, 0x8066, 0x0000, 0x0422, 0x0000, 0x4547, + 0x0003, 0x0173, 0x0004, 0x8054, 0x0008, 0x0004, 0x0000, 0x8074, + 0x0000, 0xf000, 0x0008, 0x8072, 0x0000, 0x8000, 0x0000, 0x0112, + 0x0003, 0xbbe0, 0x0009, 0x0038, 0x0000, 0x0d62, 0x000b, 0x18fe, + 0x0000, 0x3ce0, 0x0009, 0x095f, 0x000b, 0x15fe, 0x0008, 0x3ce0, + 0x0009, 0x0d27, 0x0003, 0x016e, 0x0004, 0x8076, 0x0008, 0x0040, + 0x0000, 0x8072, 0x0000, 0x8000, 0x0000, 0x019f, 0x0003, 0x8076, + 0x0008, 0x0042, 0x0008, 0x016b, 0x000b, 0xbbe0, 0x0009, 0x0016, + 0x0000, 0x0d6b, 0x000b, 0x3a44, 0x0002, 0x0c09, 0x000b, 0x8072, + 0x0000, 0x8000, 0x0000, 0x8000, 0x000f, 0x0007, 0x0003, 0x8072, + 0x0000, 0x8000, 0x0000, 0x0007, 0x0003, 0x3d30, 0x000a, 0x7f00, + 0x0000, 0xbc80, 0x0001, 0x0007, 0x0000, 0x0177, 0x0003, 0x1930, + 0x000a, 0x7f00, 0x0000, 0x9880, 0x0001, 0x0007, 0x0000, 0x7f62, + 0x0008, 0x8066, 0x0000, 0x000a, 0x0008, 0x457a, 0x000b, 0x4000, + 0x000f, 0x217c, 0x0003, 0x0870, 0x0008, 0x4000, 0x000f, 0xbac0, + 0x0009, 0x0090, 0x0008, 0x0985, 0x0003, 0x8074, 0x0000, 0x0706, + 0x0000, 0x0187, 0x0003, 0x8074, 0x0000, 0x0703, 0x0000, 0x4000, + 0x000f, 0x8010, 0x0008, 0x0008, 0x0000, 0x01ad, 0x000b, 0x0173, + 0x0004, 0x8010, 0x0008, 0x0007, 0x0000, 0x017c, 0x0004, 0x1810, + 0x0000, 0x017c, 0x0004, 0x01b7, 0x0003, 0x8010, 0x0008, 0x0009, + 0x0008, 0x01ad, 0x000b, 0x8010, 0x0008, 0x0005, 0x0008, 0x01ad, + 0x000b, 0x808c, 0x0008, 0x0001, 0x0000, 0x8010, 0x0008, 0x0004, + 0x0000, 0x4143, 0x000a, 0x0840, 0x000b, 0x01ad, 0x000b, 0x8010, + 0x0008, 0x0003, 0x0008, 0x01af, 0x0003, 0x8010, 0x0008, 0x000b, + 0x0000, 0x01af, 0x0003, 0x8010, 0x0008, 0x0002, 0x0000, 0x01af, + 0x0003, 0x3a47, 0x0002, 0x0cca, 0x000b, 0x8010, 0x0008, 0x0006, + 0x0008, 0x01af, 0x0003, 0x8074, 0x0000, 0xf000, 0x0008, 0x017c, + 0x0004, 0x017f, 0x0004, 0x3a40, 0x000a, 0x0807, 0x000b, 0x8010, + 0x0008, 0x000c, 0x0008, 0x017c, 0x0004, 0x0007, 0x0003, 0x8074, + 0x0000, 0xf080, 0x0000, 0x0d30, 0x0000, 0x2e4d, 0x0002, 0x2e4d, + 0x0002, 0x09c0, 0x000b, 0x8054, 0x0008, 0x0019, 0x0000, 0x0007, + 0x0003, 0x8054, 0x0008, 0x0009, 0x0008, 0x0007, 0x0003, 0x0001, + 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, + 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0xbb4d +}; +#ifdef UNIQUE_FW_NAME +unsigned short fw2300tp_length01 = 0xa9b8; +#else +unsigned short risc_code_length01 = 0xa9b8; +#endif + diff -urN linux-2.4.18/drivers/scsi/qla1280.c lia64-2.4/drivers/scsi/qla1280.c --- linux-2.4.18/drivers/scsi/qla1280.c Wed Oct 10 16:32:03 2001 +++ lia64-2.4/drivers/scsi/qla1280.c Wed Oct 10 16:35:07 2001 @@ -1,162 +1,110 @@ /******************************************************************************** - * QLOGIC LINUX SOFTWARE - * - * QLogic ISP1x80/1x160 device driver for Linux 2.3.x (redhat 6.X). - * - * COPYRIGHT (C) 1999-2000 QLOGIC CORPORATION - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the Qlogic's Linux Software License. See below. - * - * This program is WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistribution's or source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification, immediately at the beginning of the file. - * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - ********************************************************************************/ - -/***************************************************************************************** - QLOGIC CORPORATION SOFTWARE - "GNU" GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION - AND MODIFICATION - -This GNU General Public License ("License") applies solely to QLogic Linux -Software ("Software") and may be distributed under the terms of this License. - -1. You may copy and distribute verbatim copies of the Software's source code as -you receive it, in any medium, provided that you conspicuously and appropriately -publish on each copy an appropriate copyright notice and disclaimer of warranty; -keep intact all the notices that refer to this License and to the absence of any -warranty; and give any other recipients of the Software a copy of this License along -with the Software. - -You may charge a fee for the physical act of transferring a copy, and you may at your -option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Software or any portion of it, thus forming -a work based on the Software, and copy and distribute such modifications or work under -the terms of Section 1 above, provided that you also meet all of these conditions: - -* a) You must cause the modified files to carry prominent notices stating that you -changed the files and the date of any change. - -* b) You must cause any work that you distribute or publish that in whole or in part -contains or is derived from the Software or any part thereof, to be licensed as a -whole at no charge to all third parties under the terms of this License. - -* c) If the modified Software normally reads commands interactively when run, you -must cause it, when started running for such interactive use in the most ordinary way, -to print or display an announcement including an appropriate copyright notice and a -notice that there is no warranty (or else, saying that you provide a warranty) and that -users may redistribute the Software under these conditions, and telling the user how to -view a copy of this License. (Exception:if the Software itself is interactive but does -not normally print such an announcement, your work based on the Software is not required -to print an announcement.) - -These requirements apply to the modified work as a whole. If identifiable sections of -that work are not derived from the Software, and can be reasonably considered independent -and separate works in themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you distribute the same -sections as part of a whole which is a work based on the Software, the distribution of the -whole must be on the terms of this License, whose permissions for other licensees extend -to the entire whole, and thus to each and every part regardless of who wrote it. - -3. You may copy and distribute the Software (or a work based on it, under Section 2) in -object code or executable form under the terms of Sections 1 and 2 above provided that -you also do one of the following: - -* a) Accompany it with the complete corresponding machine-readable source code, which must -be distributed under the terms of Sections 1 and 2 above on a medium customarily used for -software interchange; or, - -* b) Accompany it with a written offer, valid for at least three years, to give any third -party, for a charge no more than your cost of physically performing source distribution, -a complete machine-readable copy of the corresponding source code, to be distributed under -the terms of Sections 1 and 2 above on a medium customarily used for software interchange; -or, - -* c) Accompany it with the information you received as to the offer to distribute -corresponding source code. (This alternative is allowed only for noncommercial distribution -and only if you received the Software in object code or executable form with such an offer, -in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for making modifications -to it. For an executable work, complete source code means all the source code for all -modules it contains, plus any associated interface definition files, plus the scripts used -to control compilation and installation of the executable. - -If distribution of executable or object code is made by offering access to copy from a -designated place, then offering equivalent access to copy the source code from the same -place counts as distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - -4. You may not copy, modify, sublicense, or distribute the Software except as expressly -provided under this License. Any attempt otherwise to copy, modify, sublicense or -distribute the Software is void, and will automatically terminate your rights under this -License. However, parties who have received copies, or rights, from you under this License -will not have their licenses terminated so long as such parties remain in full compliance. - -5. This license grants you world wide, royalty free non-exclusive rights to modify or -distribute the Software or its derivative works. These actions are prohibited by law -if you do not accept this License. Therefore, by modifying or distributing the Software -(or any work based on the Software), you indicate your acceptance of this License to do -so, and all its terms and conditions for copying, distributing or modifying the Software -or works based on it. - -6. Each time you redistribute the Software (or any work based on the Software), the -recipient automatically receives a license from the original licensor to copy, distribute -or modify the Software subject to these terms and conditions. You may not impose any -further restrictions on the recipients' exercise of the rights granted herein. You are -not responsible for enforcing compliance by third parties to this License. - -7. If, as a consequence of a court judgment or allegation of patent infringement or for -any other reason (not limited to patent issues), conditions are imposed on you -(whether by court order, agreement or otherwise) that contradict the conditions of this -License, they do not excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this License -and any other pertinent obligations, then as a consequence you may not distribute the -Software at all. - -If any portion of this section is held invalid or unenforceable under any particular -circumstance, the balance of the section is intended to apply and the section as a whole -is intended to apply in other circumstances. -NO WARRANTY - -11. THE SOFTWARE IS PROVIDED WITHOUT A WARRANTY OF ANY KIND. THERE IS NO -WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, -EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE -ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. -SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL -NECESSARY SERVICING, REPAIR OR CORRECTION. - -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE SOFTWARE AS PERMITTED ABOVE, BE LIABLE TO YOU FOR -DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL -DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING -BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR -LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO -OPERATE WITH ANY OTHER SOFTWARES), EVEN IF SUCH HOLDER OR OTHER PARTY HAS -BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -END OF TERMS AND CONDITIONS - -*******************************************************************************************/ - +* QLOGIC LINUX SOFTWARE +* +* QLogic QLA1280 (Ultra2) and QLA12160 (Ultra3) SCSI driver +* Copyright (C) 2000 Qlogic Corporation +* (www.qlogic.com) +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2, or (at your option) any +* later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +** +******************************************************************************/ +#define QLA1280_VERSION "3.23 Beta" /**************************************************************************** Revision History: - Rev. 3.00 Jan 17, 1999 DG Qlogic + Rev 3.23 Beta January 11, 2001 BN Qlogic + - Added check of device_id when handling non + QLA12160s during detect(). + Rev 3.22 Beta January 5, 2001 BN Qlogic + - Changed queue_task() to schedule_task() + for kernels 2.4.0 and higher. + Note: 2.4.0-testxx kernels released prior to + the actual 2.4.0 kernel release on January 2001 + will get compile/link errors with schedule_task(). + Please update your kernel to released 2.4.0 level, + or comment lines in this file flagged with 3.22 + to resolve compile/link error of schedule_task(). + - Added -DCONFIG_SMP in addition to -D__SMP__ + in Makefile for 2.4.0 builds of driver as module. + Rev 3.21 Beta January 4, 2001 BN Qlogic + - Changed criteria of 64/32 Bit mode of HBA + operation according to BITS_PER_LONG rather + than HBA's NVRAM setting of >4Gig memory bit; + so that the HBA auto-configures without the need + to setup each system individually. + Rev 3.20 Beta December 5, 2000 BN Qlogic + - Added priority handling to IA-64 onboard SCSI + ISP12160 chip for kernels greater than 2.3.18. + - Added irqrestore for qla1280_intr_handler. + - Enabled /proc/scsi/qla1280 interface. + - Clear /proc/scsi/qla1280 counters in detect(). + Rev 3.19 Beta October 13, 2000 BN Qlogic + - Declare driver_template for new kernel + (2.4.0 and greater) scsi initialization scheme. + - Update /proc/scsi entry for 2.3.18 kernels and + above as qla1280 + Rev 3.18 Beta October 10, 2000 BN Qlogic + - Changed scan order of adapters to map + the QLA12160 followed by the QLA1280. + Rev 3.17 Beta September 18, 2000 BN Qlogic + - Removed warnings for 32 bit 2.4.x compiles + - Corrected declared size for request and response + DMA addresses that are kept in each ha + Rev. 3.16 Beta August 25, 2000 BN Qlogic + - Corrected 64 bit addressing issue on IA-64 + where the upper 32 bits were not properly + passed to the RISC engine. + Rev. 3.15 Beta August 22, 2000 BN Qlogic + - Modified qla1280_setup_chip to properly load + ISP firmware for greater that 4 Gig memory on IA-64 + Rev. 3.14 Beta August 16, 2000 BN Qlogic + - Added setting of dma_mask to full 64 bit + if flags.enable_64bit_addressing is set in NVRAM + Rev. 3.13 Beta August 16, 2000 BN Qlogic + - Use new PCI DMA mapping APIs for 2.4.x kernel + Rev. 3.12 July 18, 2000 Redhat & BN Qlogic + - Added check of pci_enable_device to detect() for 2.3.x + - Use pci_resource_start() instead of + pdev->resource[0].start in detect() for 2.3.x + - Updated driver version + Rev. 3.11 July 14, 2000 BN Qlogic + - Updated SCSI Firmware to following versions: + qla1x80: 8.13.08 + qla1x160: 10.04.08 + - Updated driver version to 3.11 + Rev. 3.10 June 23, 2000 BN Qlogic + - Added filtering of AMI SubSys Vendor ID devices + Rev. 3.9 + - DEBUG_QLA1280 undefined and new version BN Qlogic + Rev. 3.08b May 9, 2000 MD Dell + - Added logic to check against AMI subsystem vendor ID + Rev. 3.08 May 4, 2000 DG Qlogic + - Added logic to check for PCI subsystem ID. + Rev. 3.07 Apr 24, 2000 DG & BN Qlogic + - Updated SCSI Firmware to following versions: + qla12160: 10.01.19 + qla1280: 8.09.00 + Rev. 3.06 Apr 12, 2000 DG & BN Qlogic + - Internal revision; not released + Rev. 3.05 Mar 28, 2000 DG & BN Qlogic + - Edit correction for virt_to_bus and PROC. + Rev. 3.04 Mar 28, 2000 DG & BN Qlogic + - Merge changes from ia64 port. + Rev. 3.03 Mar 28, 2000 BN Qlogic + - Increase version to reflect new code drop with compile fix + of issue with inclusion of linux/spinlock for 2.3 kernels + Rev. 3.02 Mar 15, 2000 BN Qlogic + - Merge qla1280_proc_info from 2.10 code base + Rev. 3.01 Feb 10, 2000 BN Qlogic + - Corrected code to compile on a 2.2.x kernel. + Rev. 3.00 Jan 17, 2000 DG Qlogic - Added 64-bit support. Rev. 2.07 Nov 9, 1999 DG Qlogic - Added new routine to set target parameters for ISP12160. @@ -183,12 +131,11 @@ *****************************************************************************/ +#include #ifdef MODULE #include #endif -#define QLA1280_VERSION " 3.00-Beta" - #include #include #include @@ -207,8 +154,16 @@ #include #include #include -/* MRS #include */ +#ifndef KERNEL_VERSION +# define KERNEL_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z)) +#endif + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,18) +#include +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) +#include # include #endif #include "sd.h" @@ -216,23 +171,16 @@ #include "hosts.h" #define UNIQUE_FW_NAME #include "qla1280.h" -#include "ql12160_fw.h" /* ISP RISC code */ +#include "ql12160_fw.h" /* ISP RISC codes */ #include "ql1280_fw.h" #include -#include /* for kmalloc() */ - - -#ifndef KERNEL_VERSION -# define KERNEL_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z)) -#endif - +#include /* * Compile time Options: * 0 - Disable and 1 - Enable */ -#define QLA1280_64BIT_SUPPORT 1 /* 64-bit Support */ #define QL1280_TARGET_MODE_SUPPORT 0 /* Target mode support */ #define WATCHDOGTIMER 0 #define MEMORY_MAPPED_IO 0 @@ -244,15 +192,9 @@ #define AUTO_ESCALATE_ABORT 0 /* Automatically escalate aborts */ #define STOP_ON_ERROR 0 /* Stop on aborts and resets */ #define STOP_ON_RESET 0 -#define STOP_ON_ABORT 0 -#undef DYNAMIC_MEM_ALLOC - -#define DEBUG_QLA1280 0 /* Debugging */ -/* #define CHECKSRBSIZE */ - -/* - * These macros to assist programming - */ +#define STOP_ON_ABORT 0 +#define QLA1280_PROFILE 1 /* 3.20 */ +#define DEBUG_QLA1280 0 #define BZERO(ptr, amt) memset(ptr, 0, amt) #define BCOPY(src, dst, amt) memcpy(dst, src, amt) @@ -260,19 +202,28 @@ #define KMFREE(ip,siz) kfree((ip)) #define SYS_DELAY(x) udelay(x);barrier() #define QLA1280_DELAY(sec) mdelay(sec * 1000) -#define VIRT_TO_BUS(a) virt_to_bus((a)) -#if QLA1280_64BIT_SUPPORT + +/* 3.16 */ +#if BITS_PER_LONG > 32 +#define pci_dma_lo32(a) (a & 0xffffffff) +#define pci_dma_hi32(a) ((a >> 32) & 0xffffffff) +#else +#define pci_dma_lo32(a) (a & 0xffffffff) +#define pci_dma_hi32(a) 0 +#endif + +#define VIRT_TO_BUS(a) virt_to_bus(((void *)a)) + #if BITS_PER_LONG <= 32 -#define VIRT_TO_BUS_LOW(a) (uint32_t)virt_to_bus((a)) +#define VIRT_TO_BUS_LOW(a) (uint32_t)virt_to_bus(((void *)a)) #define VIRT_TO_BUS_HIGH(a) (uint32_t)(0x0) #else -#define VIRT_TO_BUS_LOW(a) (uint32_t)(0xffffffff & virt_to_bus((a))) -#define VIRT_TO_BUS_HIGH(a) (uint32_t)(0xffffffff & (virt_to_bus((a))>>32)) +#define VIRT_TO_BUS_LOW(a) (uint32_t)(0xffffffff & virt_to_bus((void *)(a))) +#define VIRT_TO_BUS_HIGH(a) (uint32_t)(0xffffffff & (virt_to_bus((void *)(a))>>32)) #endif -#endif /* QLA1280_64BIT_SUPPORT */ -#define STATIC +#define STATIC #define NVRAM_DELAY() udelay(500) /* 2 microsecond delay */ void qla1280_device_queue_depth(scsi_qla_host_t *, Scsi_Device *); @@ -285,11 +236,11 @@ #define LSB(x) (uint8_t)(x) #if BITS_PER_LONG <= 32 -#define LS_64BITS(x) (uint32_t)(x) -#define MS_64BITS(x) (uint32_t)(0x0) +#define LS_64BITS(x) (uint32_t)((unsigned long) x) +#define MS_64BITS(x) (uint32_t)((unsigned long) 0x0) #else -#define LS_64BITS(x) (uint32_t)(0xffffffff & (x)) -#define MS_64BITS(x) (uint32_t)(0xffffffff & ((x)>>32) ) +#define LS_64BITS(x) (uint32_t)(0xffffffff & ((unsigned long)x)) +#define MS_64BITS(x) (uint32_t)(0xffffffff & (((unsigned long)x)>>32) ) #endif /* @@ -300,9 +251,6 @@ STATIC void qla1280_putq_t(scsi_lu_t *, srb_t *); STATIC void qla1280_done_q_put(srb_t *, srb_t **, srb_t **); STATIC void qla1280_select_queue_depth(struct Scsi_Host *, Scsi_Device *); -#ifdef QLA1280_UNUSED -static void qla1280_dump_regs(struct Scsi_Host *host); -#endif #if STOP_ON_ERROR static void qla1280_panic(char *, struct Scsi_Host *host); #endif @@ -312,10 +260,7 @@ STATIC int qla1280_return_status( sts_entry_t *sts, Scsi_Cmnd *cp); STATIC void qla1280_removeq(scsi_lu_t *q, srb_t *sp); STATIC void qla1280_mem_free(scsi_qla_host_t *ha); -static void qla1280_do_dpc(void *p); -#ifdef QLA1280_UNUSED -static void qla1280_set_flags(char * s); -#endif +void qla1280_do_dpc(void *p); static char *qla1280_get_token(char *, char *); #if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) STATIC inline void mdelay(int); @@ -339,9 +284,7 @@ STATIC uint8_t qla1280_device_reset(scsi_qla_host_t *, uint8_t, uint32_t); STATIC uint8_t qla1280_abort_device(scsi_qla_host_t *, uint8_t, uint32_t, uint32_t); STATIC uint8_t qla1280_abort_command(scsi_qla_host_t *, srb_t *), -#if QLA1280_64BIT_SUPPORT qla1280_64bit_start_scsi(scsi_qla_host_t *, srb_t *), -#endif qla1280_32bit_start_scsi(scsi_qla_host_t *, srb_t *), qla1280_abort_isp(scsi_qla_host_t *); STATIC void qla1280_nv_write(scsi_qla_host_t *, uint16_t), @@ -374,12 +317,12 @@ qla1280_notify_ack(scsi_qla_host_t *, notify_entry_t *), qla1280_immed_notify(scsi_qla_host_t *, notify_entry_t *), qla1280_accept_io(scsi_qla_host_t *, ctio_ret_entry_t *), -#if QLA1280_64BIT_SUPPORT - qla1280_64bit_continue_io(scsi_qla_host_t *, atio_entry_t *, uint32_t, - paddr32_t *), -#endif - qla1280_32bit_continue_io(scsi_qla_host_t *, atio_entry_t *, uint32_t, - paddr32_t *), + qla1280_64bit_continue_io(scsi_qla_host_t *, + atio_entry_t *, uint32_t, + paddr32_t *), + qla1280_32bit_continue_io(scsi_qla_host_t *, + atio_entry_t *, uint32_t, + paddr32_t *), qla1280_atio_entry(scsi_qla_host_t *, atio_entry_t *), qla1280_notify_entry(scsi_qla_host_t *, notify_entry_t *); #endif /* QLA1280_TARGET_MODE_SUPPORT */ @@ -400,7 +343,7 @@ qla1280_dump_buffer(caddr_t, uint32_t); char debug_buff[80]; -#if DEBUG_QLA1280 +#if DEBUG_QLA1280 STATIC uint8_t ql_debug_print = 1; #else STATIC uint8_t ql_debug_print = 0; @@ -426,6 +369,22 @@ #endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) +/* + * Our directory Entry in /proc/scsi for the user to + * access the driver. + */ +/* Need to add in proc_fs.h PROC_SCSI_QL1280 */ +#define PROC_SCSI_QL1280 PROC_SCSI_QLOGICISP + +struct proc_dir_entry proc_scsi_qla1280 = { + PROC_SCSI_QL1280, 7, "qla1280", + S_IFDIR | S_IRUGO | S_IXUGO, 2, + 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL +}; +#endif + /* We use the Scsi_Pointer structure that's included with each command * SCSI_Cmnd as a scratchpad for our SRB. * @@ -471,17 +430,17 @@ unsigned char *fwver; /* Ptr to F/W version array */ } qla_boards_t; -struct _qlaboards QLBoardTbl[NUM_OF_ISP_DEVICES] = +struct _qlaboards QL1280BoardTbl[NUM_OF_ISP_DEVICES] = { /* Name , Board PCI Device ID, Number of ports */ + {"QLA12160 ", QLA12160_DEVICE_ID, 2, + &fw12160i_code01[0], (unsigned long *)&fw12160i_length01,&fw12160i_addr01, &fw12160i_version_str[0] }, {"QLA1080 ", QLA1080_DEVICE_ID, 1, &fw1280ei_code01[0], (unsigned long *)&fw1280ei_length01,&fw1280ei_addr01, &fw1280ei_version_str[0] }, {"QLA1240 ", QLA1240_DEVICE_ID, 2, &fw1280ei_code01[0], (unsigned long *)&fw1280ei_length01,&fw1280ei_addr01, &fw1280ei_version_str[0] }, {"QLA1280 ", QLA1280_DEVICE_ID, 2, &fw1280ei_code01[0], (unsigned long *)&fw1280ei_length01,&fw1280ei_addr01, &fw1280ei_version_str[0] }, - {"QLA12160 ", QLA12160_DEVICE_ID, 2, - &fw12160i_code01[0], (unsigned long *)&fw12160i_length01,&fw12160i_addr01, &fw12160i_version_str[0] }, {"QLA10160 ", QLA10160_DEVICE_ID, 1, &fw12160i_code01[0], (unsigned long *)&fw12160i_length01,&fw12160i_addr01, &fw12160i_version_str[0] }, {" ", 0, 0} @@ -489,7 +448,7 @@ static unsigned long qla1280_verbose = 1L; static scsi_qla_host_t *qla1280_hostlist = NULL; -#ifdef QLA1280_PROFILE +#if QLA1280_PROFILE static int qla1280_buffer_size = 0; static char *qla1280_buffer = NULL; #endif @@ -567,152 +526,153 @@ * * Returns: *************************************************************************/ -#ifdef QLA1280_PROFILE -#define PROC_BUF (&qla1280_buffer[size]) -#define LUN_ID (targ_lun>>(MAX_T_BITS+MAX_L_BITS)),((targ_lun>>MAX_L_BITS)&0xf), targ_lun&0x7 -#endif +#define PROC_BUF (&qla1280_buffer[len]) int -qla1280_proc_info ( char *buffer, char **start, off_t offset, int length, - int hostno, int inout) -{ -#ifdef QLA1280_PROFILE +qla1280_proc_info( char *buffer, char **start, off_t offset, int length, + int hostno, int inout) { +#if QLA1280_PROFILE struct Scsi_Host *host; scsi_qla_host_t *ha; int size = 0; - int targ_lun; scsi_lu_t *up; - int no_devices; - - printk("Entering proc_info 0x%p,0x%lx,0x%x,0x%x\n",buffer,offset,length,hostno); + int len = 0; + qla_boards_t *bdp; + uint32_t b, t, l; + uint8_t *temp; host = NULL; - /* find the host they want to look at */ - for(ha=qla1280_hostlist; (ha != NULL) && ha->host->host_no != hostno; ha=ha->next) + + /* Find the host that was specified */ + for( ha=qla1280_hostlist; (ha != NULL) && ha->host->host_no != hostno; ha=ha->next ) ; - if (!ha) - { - size += sprintf(buffer, "Can't find adapter for host number %d\n", hostno); - if (size > length) - { + /* if host wasn't found then exit */ + if( !ha ) { + size = sprintf(buffer, "Can't find adapter for host number %d\n", hostno); + if( size > length ) { return (size); - } - else - { - return (length); + } else { + return (0); } } host = ha->host; - if (inout == TRUE) /* Has data been written to the file? */ - { - return (qla1280_set_info(buffer, length, host)); - } - /* compute number of active devices */ - no_devices = 0; - for (targ_lun = 0; targ_lun < MAX_EQ; targ_lun++) + if( inout == TRUE ) /* Has data been written to the file? */ { - if( (up = ha->dev[targ_lun]) == NULL ) - continue; - no_devices++; + printk("qla1280_proc: has data been written to the file. \n"); + return (qla1280_set_info(buffer, length, host)); } - /* size = 112 * no_devices; */ - size = 4096; - /* round up to the next page */ /* * if our old buffer is the right size use it otherwise * allocate a new one. */ - if (qla1280_buffer_size != size) - { + size = 4096; /* get a page */ + if( qla1280_buffer_size != size ) { /* deallocate this buffer and get a new one */ - if (qla1280_buffer != NULL) - { + if( qla1280_buffer != NULL ) { kfree(qla1280_buffer); qla1280_buffer_size = 0; } qla1280_buffer = kmalloc(size, GFP_KERNEL); } - if (qla1280_buffer == NULL) - { + if( qla1280_buffer == NULL ) { size = sprintf(buffer, "qla1280 - kmalloc error at line %d\n", __LINE__); return size; } + /* save the size of our buffer */ qla1280_buffer_size = size; - size = 0; - size += sprintf(PROC_BUF, "Qlogic 1280/1080 SCSI driver version: "); /* 43 bytes */ - size += sprintf(PROC_BUF, "%5s, ", QLA1280_VERSION); /* 5 */ - size += sprintf(PROC_BUF, "Qlogic Firmware version: "); /* 25 */ - size += sprintf(PROC_BUF, "%2d.%2d.%2d",_firmware_version[0], /* 8 */ - ql12_firmware_version[1], - ql12_firmware_version[2]); - size += sprintf(PROC_BUF, "\n"); /* 1 */ - - size += sprintf(PROC_BUF, "SCSI Host Adapter Information: %s\n", QLBoardTbl[ha->devnum].bdName); - size += sprintf(PROC_BUF, "Request Queue = 0x%lx, Response Queue = 0x%lx\n", - ha->request_dma, - ha->response_dma); - size += sprintf(PROC_BUF, "Request Queue count= 0x%x, Response Queue count= 0x%x\n", + /* 3.20 clear the buffer we use for proc display */ + temp = qla1280_buffer; + for (b=0 ; b < size; b++) *(temp+b) = 0; + + /* start building the print buffer */ + bdp = &QL1280BoardTbl[ha->devnum]; + size = sprintf(PROC_BUF, + "QLogic PCI to SCSI Adapter for ISP 1280/12160:\n" + " Firmware version: %2d.%02d.%02d, Driver version %s\n", bdp->fwver[0], bdp->fwver[1], bdp->fwver[2], QLA1280_VERSION); + + len += size; + + size = sprintf(PROC_BUF, "SCSI Host Adapter Information: %s\n", bdp->bdName); + len += size; + size = sprintf(PROC_BUF, "Request Queue = 0x%lx, Response Queue = 0x%lx\n", + (unsigned long) ha->request_dma, + (unsigned long) ha->response_dma); + len += size; + size = sprintf(PROC_BUF, "Request Queue count= 0x%x, Response Queue count= 0x%x\n", REQUEST_ENTRY_CNT, RESPONSE_ENTRY_CNT); - size += sprintf(PROC_BUF,"Number of pending commands = 0x%lx\n", ha->actthreads); - size += sprintf(PROC_BUF,"Number of queued commands = 0x%lx\n", ha->qthreads); - size += sprintf(PROC_BUF,"Number of free request entries = %d\n",ha->req_q_cnt); - size += sprintf(PROC_BUF, "\n"); /* 1 */ + len += size; + size = sprintf(PROC_BUF, "Number of pending commands = 0x%lx\n", ha->actthreads); + len += size; + size = sprintf(PROC_BUF, "Number of queued commands = 0x%lx\n", ha->qthreads); + len += size; + size = sprintf(PROC_BUF, "Number of free request entries = %d\n",ha->req_q_cnt); + len += size; + size = sprintf(PROC_BUF, "\n"); /* 1 */ + len += size; - size += sprintf(PROC_BUF, "Attached devices:\n"); + size = sprintf(PROC_BUF, "SCSI device Information:\n"); + len += size; /* scan for all equipment stats */ - for (targ_lun = 0; targ_lun < MAX_EQ; targ_lun++) - { - if( (up = ha->dev[targ_lun]) == NULL ) + for (b = 0; b < MAX_BUSES; b++) + for (t = 0; t < MAX_TARGETS; t++) { + for( l = 0; l < MAX_LUNS; l++ ) { + up = (scsi_lu_t *) LU_Q(ha, b, t, l); + if( up == NULL ) continue; - if( up->io_cnt == 0 ) - { - size += sprintf(PROC_BUF,"(%2d:%2d:%2d) No stats\n",LUN_ID); + /* unused device/lun */ + if( up->io_cnt == 0 || up->io_cnt < 2 ) continue; - } /* total reads since boot */ /* total writes since boot */ /* total requests since boot */ - size += sprintf(PROC_BUF, "Total requests %ld,",up->io_cnt); + size = sprintf(PROC_BUF, "(%2d:%2d:%2d): Total reqs %ld,",b,t,l,up->io_cnt); + len += size; /* current number of pending requests */ - size += sprintf(PROC_BUF, "(%2d:%2d:%2d) pending requests %d,",LUN_ID,up->q_outcnt); + size = sprintf(PROC_BUF, " Pend reqs %d,",up->q_outcnt); + len += size; +#if 0 /* avg response time */ - size += sprintf(PROC_BUF, "Avg response time %ld%%,",(up->resp_time/up->io_cnt)*100); + size = sprintf(PROC_BUF, " Avg resp time %ld%%,",(up->resp_time/up->io_cnt)*100); + len += size; /* avg active time */ - size += sprintf(PROC_BUF, "Avg active time %ld%%\n",(up->act_time/up->io_cnt)*100); + size = sprintf(PROC_BUF, " Avg active time %ld%%\n",(up->act_time/up->io_cnt)*100); +#else + size = sprintf(PROC_BUF, "\n"); +#endif + len += size; + } + if( len >= qla1280_buffer_size ) + break; } - if (size >= qla1280_buffer_size) - { + if( len >= qla1280_buffer_size ) { printk(KERN_WARNING "qla1280: Overflow buffer in qla1280_proc.c\n"); } - if (offset > size - 1) - { + if( offset > len - 1 ) { kfree(qla1280_buffer); qla1280_buffer = NULL; qla1280_buffer_size = length = 0; *start = NULL; - } - else - { + } else { *start = &qla1280_buffer[offset]; /* Start of wanted data */ - if (size - offset < length) - { - length = size - offset; + if( len - offset < length ) { + length = len - offset; } } + return (length); +#else + return (0); #endif - return (length); } - /************************************************************************** * qla1280_detect * This routine will probe for Qlogic 1280 SCSI host adapters. @@ -734,7 +694,10 @@ struct Scsi_Host *host; scsi_qla_host_t *ha, *cur_ha; struct _qlaboards *bdp; - int i, j; + int i,j; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + unsigned short subsys; +#endif #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,1,95) unsigned int piobase; unsigned char pci_bus, pci_devfn, pci_irq; @@ -747,13 +710,19 @@ #else int index; #endif +#ifndef PCI_VENDOR_ID_AMI +#define PCI_VENDOR_ID_AMI 0x101e +#endif ENTER("qla1280_detect"); + if (sizeof(srb_t) > sizeof(Scsi_Pointer) ) + printk("qla1280_detect: [WARNING] srb_t Must Be Redefined"); + #ifdef CHECKSRBSIZE if (sizeof(srb_t) > sizeof(Scsi_Pointer) ) { - printk("Redefine SRB - its too big"); + printk("qla1280_detect: srb_t Must Be Redefined - its too big"); return 0; } #endif @@ -784,45 +753,174 @@ "qla1280: insmod or else it might trash certain memory areas.\n"); #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) if ((int) !pcibios_present()) +#else + if (!pci_present()) +#endif { - printk("scsi: PCI not present\n"); - return 0; - } /* end of IF */ - bdp = &QLBoardTbl[0]; + printk("scsi: PCI not present\n"); + return 0; + } + + bdp = &QL1280BoardTbl[0]; qla1280_hostlist = NULL; -#if 0 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) template->proc_dir = &proc_scsi_qla1280; #else template->proc_name = "qla1280"; #endif + + /* 3.20 */ + /* First Initialize QLA12160 on PCI Bus 1 Dev 2 */ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,18) + while ((pdev = pci_find_subsys(QLA1280_VENDOR_ID, + bdp->device_id, /* QLA12160 first in list */ + PCI_ANY_ID, + PCI_ANY_ID,pdev))) { + + /* find QLA12160 device on PCI bus=1 slot=2 */ + if ((pdev->bus->number != 1) || + (PCI_SLOT(pdev->devfn) != 2)) continue; + + if (pci_enable_device(pdev)) goto find_devices; + printk("qla1x160: Initializing ISP12160 on PCI Bus 1, Dev 2\n"); + host = scsi_register(template, sizeof(scsi_qla_host_t)); + if (!host) { + printk(KERN_WARNING "qla1280: Failed to register host, aborting.\n"); + return 0; + } + scsi_set_pci_device(host, pdev); + ha = (scsi_qla_host_t *) host->hostdata; + /* Clear our data area */ + for( j =0, cp = (char *)ha; j < sizeof(scsi_qla_host_t); j++) + *cp++ = 0; + /* Sanitize the information from PCI BIOS. */ + host->irq = pdev->irq; + host->io_port = pci_resource_start(pdev, 0); + ha->pci_bus = pdev->bus->number; + ha->pci_device_fn = pdev->devfn; + ha->pdev = pdev; + ha->device_id = bdp->device_id; /* QLA12160 first in list */ + ha->devnum = 0; // This priority ISP12160 is always devnum zero + if( qla1280_mem_alloc(ha) ) { + printk(KERN_INFO "qla1x160: Failed to get memory\n"); + } + ha->ports = bdp->numPorts; + /* following needed for all cases of OS versions */ + host->io_port &= PCI_BASE_ADDRESS_IO_MASK; + ha->iobase = (device_reg_t *) host->io_port; + ha->host = host; + ha->host_no = host->host_no; + /* 3.20 zero out /proc/scsi/qla1280 counters */ + ha->actthreads = 0; + ha->qthreads = 0; + ha->isr_count = 0; + + /* load the F/W, read paramaters, and init the H/W */ + ha->instance = num_hosts; + if (qla1280_initialize_adapter(ha)) + { + printk(KERN_INFO "qla1x160: Failed to initialize QLA12160 on PCI Bus 1 Dev 2 \n"); + qla1280_mem_free(ha); + scsi_unregister(host); + goto find_devices; + } + host->max_channel = bdp->numPorts-1; + /* Register our resources with Linux */ + if( qla1280_register_with_Linux(ha, bdp->numPorts-1) ) { + printk(KERN_INFO "qla1x160: Failed to register resources for QLA12160 on PCI Bus 1 Dev 2\n"); + qla1280_mem_free(ha); + scsi_unregister(host); + goto find_devices; + } + reg = ha->iobase; + /* Disable ISP interrupts. */ + qla1280_disable_intrs(ha); + /* Insure mailbox registers are free. */ + WRT_REG_WORD(®->semaphore, 0); + WRT_REG_WORD(®->host_cmd, HC_CLR_RISC_INT); + WRT_REG_WORD(®->host_cmd, HC_CLR_HOST_INT); + + /* Enable chip interrupts. */ + qla1280_enable_intrs(ha); + /* Insert new entry into the list of adapters */ + ha->next = NULL; + /* this preferred device will always be the first one found */ + cur_ha = qla1280_hostlist = ha; + num_hosts++; + } +#endif + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,18) + find_devices: +#endif + + pdev = NULL; /* Try and find each different type of adapter we support */ - for( i=0; bdp->device_id != 0 && i < NUM_OF_ISP_DEVICES; i++, bdp++ ) { + for(i=0;bdp->device_id != 0 && i < NUM_OF_ISP_DEVICES;i++,bdp++) { #if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,18) + /* PCI_SUBSYSTEM_IDS supported */ + while ((pdev = pci_find_subsys(QLA1280_VENDOR_ID, + bdp->device_id, PCI_ANY_ID, PCI_ANY_ID, pdev) )) { + if (pci_enable_device(pdev)) continue; +#else while ((pdev = pci_find_device(QLA1280_VENDOR_ID, bdp->device_id, pdev ) )) { - if (pci_enable_device(pdev)) continue; -#else +#endif /* 2,3,18 */ +#else /* less than 2,1,95 */ while (!(pcibios_find_device(QLA1280_VENDOR_ID, bdp->device_id, index++, &pci_bus, &pci_devfn)) ) { -#endif +#endif /* 2,1,95 */ /* found a adapter */ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,18) + /* If it's an AMI SubSys Vendor ID adapter, skip it. */ + if (pdev->subsystem_vendor == PCI_VENDOR_ID_AMI) + { + printk("qla1x160: Skip AMI SubSys Vendor ID Chip\n"); + continue; + } + + /* 3.20 and 3.23 */ + /* skip QLA12160 already initialized on PCI Bus 1 Dev 2 */ + /* since we already initialized and presented it */ + if ((bdp->device_id == QLA12160_DEVICE_ID) && + (pdev->bus->number == 1) && + (PCI_SLOT(pdev->devfn) == 2)) continue; + + printk("qla1x160: Supported Device Found VID=%x DID=%x SSVID=%x SSDID=%x\n", + pdev->vendor, pdev->device, + pdev->subsystem_vendor, pdev->subsystem_device); + +#else +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95) + printk("qla1x160: Supported Device Found\n"); + pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, + &subsys); + /* Bypass all AMI SUBSYS VENDOR IDs */ + if (subsys == PCI_VENDOR_ID_AMI) + { + printk("qla1x160: Skip AMI SubSys Vendor ID Chip\n"); + continue; + } +#endif /* 2,1,95 */ +#endif /* 2,3,18 */ host = scsi_register(template, sizeof(scsi_qla_host_t)); - if (!host) { - printk(KERN_WARNING "qla1280: Failed to register host, aborting.\n"); - return 0; - } - scsi_set_pci_device(host, pdev); ha = (scsi_qla_host_t *) host->hostdata; /* Clear our data area */ for( j =0, cp = (char *)ha; j < sizeof(scsi_qla_host_t); j++) - *cp = 0; + *cp++ = 0; /* Sanitize the information from PCI BIOS. */ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95) host->irq = pdev->irq; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + host->io_port = (unsigned int) pdev->base_address[0]; +#else host->io_port = pci_resource_start(pdev, 0); +#endif ha->pci_bus = pdev->bus->number; ha->pci_device_fn = pdev->devfn; ha->pdev = pdev; @@ -836,38 +934,38 @@ ha->pci_device_fn = pci_devfn; #endif ha->device_id = bdp->device_id; - - ha->devnum = i; + ha->devnum = i; // specifies microcode load address + if( qla1280_mem_alloc(ha) ) { - printk(KERN_INFO "qla1280: Failed to allocate memory for adapter\n"); + printk(KERN_INFO "qla1x160: Failed to get memory\n"); } ha->ports = bdp->numPorts; + /* following needed for all cases of OS versions */ + host->io_port &= PCI_BASE_ADDRESS_IO_MASK; ha->iobase = (device_reg_t *) host->io_port; ha->host = host; ha->host_no = host->host_no; /* load the F/W, read paramaters, and init the H/W */ + ha->instance = num_hosts; if (qla1280_initialize_adapter(ha)) { - - printk(KERN_INFO "qla1280: Failed to initialized adapter\n"); - qla1280_mem_free(ha); - scsi_unregister(host); - continue; + printk(KERN_INFO "qla1x160:Failed to initialize adapter\n"); + qla1280_mem_free(ha); + scsi_unregister(host); + continue; } host->max_channel = bdp->numPorts-1; - ha->instance = num_hosts; /* Register our resources with Linux */ if( qla1280_register_with_Linux(ha, bdp->numPorts-1) ) { - printk(KERN_INFO "qla1280: Failed to register our resources\n"); - qla1280_mem_free(ha); - scsi_unregister(host); - continue; + printk(KERN_INFO "qla1x160: Failed to register resources\n"); + qla1280_mem_free(ha); + scsi_unregister(host); + continue; } - reg = ha->iobase; /* Disable ISP interrupts. */ qla1280_disable_intrs(ha); @@ -924,8 +1022,11 @@ host->can_queue = 0xfffff; /* unlimited */ host->cmd_per_lun = 1; host->select_queue_depths = qla1280_select_queue_depth; - host->n_io_port = 0xFF; - host->base = (unsigned long) ha->mmpbase; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + host->base = (unsigned char *) ha->mmpbase; +#else + host->base = (u_long) ha->mmpbase; +#endif host->max_channel = maxchannels; host->max_lun = MAX_LUNS-1; host->unique_id = ha->instance; @@ -1016,10 +1117,10 @@ bp = &qla1280_buffer[0]; ha = (scsi_qla_host_t *)host->hostdata; - bdp = &QLBoardTbl[ha->devnum]; + bdp = &QL1280BoardTbl[ha->devnum]; memset(bp, 0, sizeof(qla1280_buffer)); sprintf(bp, - "QLogic %sPCI to SCSI Host Adapter: bus %d device %d irq %d\n" + "QLogic %s PCI to SCSI Host Adapter: bus %d device %d irq %d\n" " Firmware version: %2d.%02d.%02d, Driver version %s", (char *)&bdp->bdName[0], ha->pci_bus, (ha->pci_device_fn & 0xf8) >> 3, host->irq, bdp->fwver[0],bdp->fwver[1],bdp->fwver[2], @@ -1051,8 +1152,8 @@ scsi_lu_t *q; u_long handle; - ENTER("qla1280_queuecommand"); - COMTRACE('C') + /*ENTER("qla1280_queuecommand"); + COMTRACE('C')*/ host = cmd->host; ha = (scsi_qla_host_t *) host->hostdata; @@ -1079,7 +1180,7 @@ { LU_Q(ha, b, t, l) = q; BZERO(q,sizeof(struct scsi_lu)); - DEBUG(sprintf(debug_buff,"Allocate new device queue 0x%x\n",q)); + DEBUG(sprintf(debug_buff,"Allocate new device queue 0x%x\n\r",q)); DEBUG(qla1280_print(debug_buff)); DRIVER_UNLOCK } @@ -1087,8 +1188,12 @@ { CMD_RESULT(cmd) = (int) (DID_BUS_BUSY << 16); qla1280_done_q_put(sp, &ha->done_q_first, &ha->done_q_last); - - schedule_task(&ha->run_qla_bh); +/* 3.22 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) /* 3.22 */ + queue_task(&ha->run_qla_bh,&tq_scheduler); +#else /* 3.22 */ + schedule_task(&ha->run_qla_bh); /* 3.22 */ +#endif /* 3.22 */ ha->flags.dpc_sched = TRUE; DRIVER_UNLOCK return(0); @@ -1099,15 +1204,13 @@ handle = INVALID_HANDLE; CMD_HANDLE(cmd) = (unsigned char *)handle; - /* Bookkeeping information */ - sp->r_start = jiffies; /* time the request was received */ - sp->u_start = 0; - /* add the command to our queue */ ha->qthreads++; qla1280_putq_t(q,sp); - DEBUG(sprintf(debug_buff,"qla1280_queuecmd: queue pid=%d, hndl=0x%x\n\r",cmd->pid,handle)); + DEBUG(sprintf(debug_buff, + "qla1280_QC: t=%x CDB=%x I/OSize=0x%x haQueueCount=0x%x\n\r", + t,cmd->cmnd[0],CMD_XFRLEN(cmd),ha->qthreads)); DEBUG(qla1280_print(debug_buff)); /* send command to adapter */ @@ -1117,7 +1220,7 @@ DRIVER_UNLOCK - LEAVE("qla1280_queuecommand"); + /*LEAVE("qla1280_queuecommand");*/ return (0); } @@ -1556,6 +1659,7 @@ { COMTRACE('X') printk(KERN_INFO "scsi(%d): Already in interrupt - returning \n", (int)ha->host_no); + spin_unlock_irqrestore(&io_request_lock, cpu_flags); return; } set_bit(QLA1280_IN_ISR_BIT, (int *)&ha->flags); @@ -1587,7 +1691,7 @@ ha->run_qla_bh.routine = qla1280_do_dpc; COMTRACE('P') - schedule_task(&ha->run_qla_bh); + queue_task_irq(&ha->run_qla_bh,&tq_scheduler); ha->flags.dpc_sched = TRUE; } clear_bit(QLA1280_IN_ISR_BIT, (int *)&ha->flags); @@ -1611,7 +1715,7 @@ * "host->can_queue". This can cause a panic if we were in our interrupt * code . **************************************************************************/ -static void qla1280_do_dpc(void *p) +void qla1280_do_dpc(void *p) { scsi_qla_host_t *ha = (scsi_qla_host_t *) p; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95) @@ -1729,6 +1833,7 @@ scsi_lu_t *q; uint32_t b, t, l; Scsi_Cmnd *cmd; + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) unsigned long cpu_flags = 0; #endif @@ -1745,7 +1850,8 @@ *done_q_last = NULL; else (*done_q_first)->s_prev = NULL; - cmd = sp->cmd; + + cmd = sp->cmd; b = SCSI_BUS_32(cmd); t = SCSI_TCN_32(cmd); l = SCSI_LUN_32(cmd); @@ -1759,8 +1865,6 @@ q->q_flag &= ~QLA1280_QBUSY; } - q->resp_time += jiffies - sp->r_start; /* Lun bookkeeping information */ - q->act_time += jiffies - sp->u_start; q->io_cnt++; if( sp->dir & BIT_5 ) q->r_cnt++; @@ -1783,7 +1887,28 @@ default: break; } - + /* 3.13 64 and 32 bit */ + /* Release memory used for this I/O */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + if (cmd->use_sg) { + DEBUG(sprintf(debug_buff, + "S/G unmap_sg cmd=%x\n\r",cmd);) + DEBUG(qla1280_print(debug_buff)); + pci_unmap_sg(ha->pdev, cmd->request_buffer, + cmd->use_sg, + scsi_to_pci_dma_dir(cmd->sc_data_direction)); + } + else if (cmd->request_bufflen) { + /*DEBUG(sprintf(debug_buff, + "No S/G unmap_single cmd=%x saved_dma_handle=%lx\n\r", + cmd,sp->saved_dma_handle);) + DEBUG(qla1280_print(debug_buff);)*/ + + pci_unmap_single(ha->pdev,sp->saved_dma_handle, + cmd->request_bufflen, + scsi_to_pci_dma_dir(cmd->sc_data_direction)); + } +#endif /* Call the mid-level driver interrupt handler */ CMD_HANDLE(sp->cmd) = (unsigned char *) 0; ha->actthreads--; @@ -1797,8 +1922,6 @@ qla1280_next(ha, q, b); } DRIVER_UNLOCK - - COMTRACE('d') LEAVE("qla1280_done"); } @@ -1970,7 +2093,7 @@ if (q->q_outcnt >= ha->bus_settings[b].hiwat) q->q_flag |= QLA1280_QBUSY; -#if QLA1280_64BIT_SUPPORT +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) if (ha->flags.enable_64bit_addressing) status = qla1280_64bit_start_scsi(ha, sp); else @@ -1987,7 +2110,7 @@ /* Wait for 30 sec for command to be accepted. */ for (cnt = 6000000; cnt; cnt--) { -#if QLA1280_64BIT_SUPPORT +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) if (ha->flags.enable_64bit_addressing) status = qla1280_64bit_start_scsi(ha, sp); else @@ -2078,7 +2201,7 @@ ENTER("qla1280_putq_t"); #endif DRIVER_LOCK - DEBUG(sprintf(debug_buff,"Adding to device 0x%p<-(0x%p)\n\r",q,sp)); + DEBUG(sprintf(debug_buff,"Adding to device q=0x%p<-(0x%p)sp\n\r",q,sp)); DEBUG(qla1280_print(debug_buff)); sp->s_next = NULL; if (!q->q_first) /* If queue empty */ @@ -2163,28 +2286,33 @@ { uint8_t status = 1; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,18) + dma_addr_t dma_handle; +#endif #ifdef QL_DEBUG_LEVEL_3 ENTER("qla1280_mem_alloc"); #endif -#ifdef DYNAMIC_MEM_ALLOC - ha->request_ring = qla1280_alloc_phys(REQUEST_ENTRY_SIZE * REQUEST_ENTRY_CNT, - &ha->request_dma); - if(ha->request_ring) { - ha->response_ring = qla1280_alloc_phys(RESPONSE_ENTRY_SIZE * RESPONSE_ENTRY_CNT, - &ha->response_dma); - if(ha->response_ring) { - status = 0; - } - } -#else + /* 3.13 */ + /* get consistent memory allocated for request and response rings */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) ha->request_ring = &ha->req[0]; ha->request_dma = VIRT_TO_BUS(&ha->req[0]); ha->response_ring = &ha->res[0]; ha->response_dma = VIRT_TO_BUS(&ha->res[0]); status = 0; -#endif +#else + ha->request_ring = pci_alloc_consistent(ha->pdev, + ((REQUEST_ENTRY_CNT+1)*(sizeof(request_t))), + &dma_handle); + ha->request_dma = dma_handle; + ha->response_ring = pci_alloc_consistent(ha->pdev, + ((RESPONSE_ENTRY_CNT+1)*(sizeof(response_t))), + &dma_handle); + ha->response_dma = dma_handle; + status = 0; +#endif if(status) { #if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) @@ -2228,6 +2356,16 @@ ha->dev[b] = (scsi_lu_t *)NULL; } + /* 3.13 */ + /* free consistent memory allocated for request and response rings */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + pci_free_consistent(ha->pdev, ((REQUEST_ENTRY_CNT+1)*(sizeof(request_t))), + ha->request_ring, ha->request_dma); + + pci_free_consistent(ha->pdev,((RESPONSE_ENTRY_CNT+1)*(sizeof(response_t))), + ha->response_ring, ha->response_dma); +#endif + LEAVE("qlc1280_mem_free"); } @@ -2488,7 +2626,7 @@ /* Verify checksum of loaded RISC code. */ mb[0] = MBC_VERIFY_CHECKSUM; /* mb[1] = ql12_risc_code_addr01; */ - mb[1] = *QLBoardTbl[ha->devnum].fwstart; + mb[1] = *QL1280BoardTbl[ha->devnum].fwstart; if (!(status = qla1280_mailbox_command(ha, BIT_1|BIT_0, &mb[0]))) { @@ -2498,7 +2636,7 @@ #endif mb[0] = MBC_EXECUTE_FIRMWARE; /* mb[1] = ql12_risc_code_addr01; */ - mb[1] = *QLBoardTbl[ha->devnum].fwstart; + mb[1] = *QL1280BoardTbl[ha->devnum].fwstart; qla1280_mailbox_command(ha, BIT_1|BIT_0, &mb[0]); } else @@ -2533,18 +2671,69 @@ qla1280_pci_config(scsi_qla_host_t *ha) { uint8_t status = 1; - uint32_t command; #if MEMORY_MAPPED_IO uint32_t page_offset, base; uint32_t mmapbase; #endif - config_reg_t *creg = 0; uint16_t buf_wd; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + uint32_t command; + config_reg_t *creg = 0; +#endif + ENTER("qla1280_pci_config"); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + /* + * Set Bus Master Enable, Memory Address Space Enable and + * reset any error bits, in the command register. + */ + pci_read_config_word(ha->pdev, PCI_COMMAND, &buf_wd); + buf_wd &= ~0x7; +#if MEMORY_MAPPED_IO + DEBUG(printk("qla1280: MEMORY MAPPED IO is enabled.\n")); + buf_wd |= BIT_2 + BIT_1 + BIT_0; +#else + buf_wd |= BIT_2 + BIT_0; +#endif + pci_write_config_word(ha->pdev, PCI_COMMAND, buf_wd); + /* + * Reset expansion ROM address decode enable. + */ + pci_read_config_word(ha->pdev, PCI_ROM_ADDRESS, &buf_wd); + buf_wd &= ~PCI_ROM_ADDRESS_ENABLE; + pci_write_config_word(ha->pdev, PCI_ROM_ADDRESS, buf_wd); +#if MEMORY_MAPPED_IO + /* + * Get memory mapped I/O address. + */ + pci_read_config_word(ha->pdev, PCI_BASE_ADDRESS_1, &mmapbase); + mmapbase &= PCI_BASE_ADDRESS_MEM_MASK; + + /* + * Find proper memory chunk for memory map I/O reg. + */ + base = mmapbase & PAGE_MASK; + page_offset = mmapbase - base; + /* + * Get virtual address for I/O registers. + */ + ha->mmpbase = ioremap_nocache(base, page_offset + 256); + if( ha->mmpbase ) + { + ha->mmpbase += page_offset; + /* ha->iobase = ha->mmpbase; */ + status = 0; + } +#else /* MEMORY_MAPPED_IO */ + status = 0; +#endif /* MEMORY_MAPPED_IO */ + +#else /*LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) */ + /* Get command register. */ - if (pci_read_config_word(ha->pdev,OFFSET(creg->command), &buf_wd) == PCIBIOS_SUCCESSFUL) + if (pcibios_read_config_word(ha->pci_bus,ha->pci_device_fn, OFFSET(creg->command), &buf_wd) == PCIBIOS_SUCCESSFUL) { command = buf_wd; /* @@ -2558,20 +2747,20 @@ #else buf_wd |= BIT_2 + BIT_0; #endif - if( pci_write_config_word(ha->pdev,OFFSET(creg->command), buf_wd) ) + if( pcibios_write_config_word(ha->pci_bus,ha->pci_device_fn, OFFSET(creg->command), buf_wd) ) { printk(KERN_WARNING "qla1280: Could not write config word.\n"); } /* Get expansion ROM address. */ - if (pci_read_config_word(ha->pdev,OFFSET(creg->expansion_rom), &buf_wd) == PCIBIOS_SUCCESSFUL) + if (pcibios_read_config_word(ha->pci_bus,ha->pci_device_fn, OFFSET(creg->expansion_rom), &buf_wd) == PCIBIOS_SUCCESSFUL) { /* Reset expansion ROM address decode enable. */ buf_wd &= ~BIT_0; - if (pci_write_config_word(ha->pdev,OFFSET(creg->expansion_rom), buf_wd) == PCIBIOS_SUCCESSFUL) + if (pcibios_write_config_word(ha->pci_bus,ha->pci_device_fn, OFFSET(creg->expansion_rom), buf_wd) == PCIBIOS_SUCCESSFUL) { #if MEMORY_MAPPED_IO /* Get memory mapped I/O address. */ - pci_read_config_dword(ha->pdev,OFFSET(cfgp->mem_base_addr), &mmapbase); + pcibios_read_config_dword(ha->pci_bus, ha->pci_device_fn,OFFSET(cfgp->mem_base_addr), &mmapbase); mmapbase &= PCI_BASE_ADDRESS_MEM_MASK; /* Find proper memory chunk for memory map I/O reg. */ @@ -2595,6 +2784,7 @@ } } } +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) */ LEAVE("qla1280_pci_config"); return(status); @@ -2725,6 +2915,7 @@ * Returns: * 0 = success. */ +#define DUMP_IT_BACK 0 /* for debug of RISC loading */ STATIC uint8_t qla1280_setup_chip(scsi_qla_host_t *ha) { @@ -2733,37 +2924,52 @@ uint16_t *risc_code_address; long risc_code_size; uint16_t mb[MAILBOX_REGISTER_COUNT]; -#ifdef QLA1280_UNUSED - uint8_t *sp; - int i; -#endif uint16_t cnt; int num; +#if DUMP_IT_BACK + int i; + uint8_t *sp; uint8_t *tbuf; - u_long p_tbuf; +#if BITS_PER_LONG > 32 + dma_addr_t p_tbuf; +#else + uint32_t p_tbuf; +#endif +#endif #ifdef QL_DEBUG_LEVEL_3 ENTER("qla1280_setup_chip"); #endif - if( (tbuf = (uint8_t *)KMALLOC(8000) ) == NULL ) - { - printk("setup_chip: couldn't alloacte memory\n"); - return(1); - } - p_tbuf = VIRT_TO_BUS(tbuf); + /* 3.13 */ +#if DUMP_IT_BACK +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + if( (tbuf = (uint8_t *)KMALLOC(8000) ) == NULL ) + { + printk("setup_chip: couldn't alloacte memory\n"); + return(1); + } + p_tbuf = VIRT_TO_BUS(tbuf); +#else + /* get consistent memory allocated for setup_chip */ + tbuf = pci_alloc_consistent(ha->pdev, 8000, &p_tbuf); +#endif +#endif + /* Load RISC code. */ /* risc_address = ql12_risc_code_addr01; risc_code_address = &ql12_risc_code01[0]; risc_code_size = ql12_risc_code_length01; */ - risc_address = *QLBoardTbl[ha->devnum].fwstart; - risc_code_address = QLBoardTbl[ha->devnum].fwcode; - risc_code_size = (long)(*QLBoardTbl[ha->devnum].fwlen & 0xffff); - - DEBUG(printk("qla1280: DMAing RISC code (%d) words.\n",(int)risc_code_size)); - DEBUG(sprintf(debug_buff,"qla1280_setup_chip: Loading RISC code size =(%ld).\n\r",risc_code_size);) + risc_address = *QL1280BoardTbl[ha->devnum].fwstart; + risc_code_address = QL1280BoardTbl[ha->devnum].fwcode; + risc_code_size = (long)(*QL1280BoardTbl[ha->devnum].fwlen & 0xffff); + + DEBUG(printk("qla1280_setup_chip: DMA RISC code (%d) words\n", + (int)risc_code_size)); + DEBUG(sprintf(debug_buff, + "qla1280_setup_chip: DMA RISC code (%d) words\n\r",risc_code_size);) DEBUG(qla1280_print(debug_buff)); num =0; while (risc_code_size > 0 && !status) @@ -2773,29 +2979,31 @@ if ( cnt > risc_code_size ) cnt = risc_code_size; - DEBUG(sprintf(debug_buff,"qla1280_setup_chip: loading risc @ =(0x%p),%d,%d(0x%x).\n\r",risc_code_address,cnt,num,risc_address);) + DEBUG(sprintf(debug_buff, + "qla1280_setup_chip: loading risc @ =(0x%p),%d,%d(0x%x).\n\r", + risc_code_address,cnt,num,risc_address);) DEBUG(qla1280_print(debug_buff)); - DEBUG(printk("qla1280_setup_chip: loading risc @ =code=(0x%p),cnt=%d,seg=%d,addr=0x%x\n\r",risc_code_address,cnt,num,risc_address)); - BCOPY((caddr_t) risc_code_address,(caddr_t) ha->request_ring, (cnt <<1)); + BCOPY((caddr_t) risc_code_address,(caddr_t) ha->request_ring, + (cnt <<1)); + + flush_cache_all(); + mb[0] = MBC_LOAD_RAM; - /* mb[0] = MBC_LOAD_RAM_A64; */ mb[1] = risc_address; mb[4] = cnt; mb[3] = (uint16_t) ha->request_dma & 0xffff; mb[2] = (uint16_t) (ha->request_dma >> 16) & 0xffff; mb[7] = (uint16_t) (MS_64BITS(ha->request_dma) & 0xffff); mb[6] = (uint16_t) (MS_64BITS(ha->request_dma) >> 16) & 0xffff; - DEBUG(printk("qla1280_setup_chip: op=%d 0x%lx = 0x%4x,0x%4x,0x%4x,0x%4x\n",mb[0],ha->request_dma,mb[6],mb[7],mb[2],mb[3])); + DEBUG(printk("qla1280_setup_chip: op=%d 0x%p = 0x%4x,0x%4x,0x%4x,0x%4x\n",mb[0],ha->request_dma,mb[6],mb[7],mb[2],mb[3])); if( (status = qla1280_mailbox_command(ha, BIT_4|BIT_3|BIT_2|BIT_1|BIT_0, &mb[0])) ) { printk("Failed to load partial segment of f/w\n"); break; } - /* dump it back */ - -#if 0 - mb[0] = MBC_DUMP_RAM_A64; +#if DUMP_IT_BACK + mb[0] = MBC_READ_RAM_WORD; mb[1] = risc_address; mb[4] = cnt; mb[3] = (uint16_t) p_tbuf & 0xffff; @@ -2803,10 +3011,13 @@ mb[7] = (uint16_t) (p_tbuf >> 32) & 0xffff; mb[6] = (uint16_t) (p_tbuf >> 48) & 0xffff; - if( (status = qla1280_mailbox_command(ha, BIT_4|BIT_3|BIT_2|BIT_1|BIT_0, - &mb[0])) ) + if( (status = qla1280_mailbox_command(ha, + BIT_4|BIT_3|BIT_2|BIT_1|BIT_0,&mb[0])) ) { printk("Failed to dump partial segment of f/w\n"); + DEBUG(sprintf(debug_buff, + "setup_chip: Failed to dump partial segment of f/w\n\r");) + DEBUG(qla1280_print(debug_buff)); break; } sp = (uint8_t *)ha->request_ring; @@ -2814,51 +3025,20 @@ { if( tbuf[i] != sp[i] ) { - printk("qla1280 : firmware compare error @ byte (0x%x)\n",i); - break; + printk("qla1280_setup_chip: FW compare error @ byte(0x%x) loop#=%x\n",i,num); + printk("setup_chip: FWbyte=%x FWfromChip=%x\n",sp[i],tbuf[i]); + DEBUG(sprintf(debug_buff, + "qla1280_setup_chip: FW compare error @ byte(0x%x) loop#=%x\n\r",i);) + DEBUG(qla1280_print(debug_buff);) + /*break;*/ } } - #endif risc_address += cnt; risc_code_size = risc_code_size - cnt; risc_code_address = risc_code_address + cnt; num++; } -#ifdef QLA1280_UNUSED - DEBUG(ql_debug_print = 0;) - { - for (i = 0; i < ql12_risc_code_length01; i++) - { - mb[0] = 0x4; - mb[1] = ql12_risc_code_addr01 + i; - mb[2] = ql12_risc_code01[i]; - - status = qla1280_mailbox_command(ha, BIT_2|BIT_1|BIT_0, - &mb[0]); - if (status) - { - printk("qla1280 : firmware load failure\n"); - break; - } - - mb[0] = 0x5; - mb[1] = ql12_risc_code_addr01 + i; - mb[2] = 0; - - status = qla1280_mailbox_command(ha, BIT_2|BIT_1|BIT_0, - &mb[0]); - if (status) - { - printk("qla1280 : firmware dump failure\n"); - break; - } - if( mb[2] != ql12_risc_code01[i] ) - printk("qla1280 : firmware compare error @ (0x%x)\n",ql12_risc_code_addr01+i); - } - } - DEBUG(ql_debug_print = 1;) -#endif /* Verify checksum of loaded RISC code. */ if (!status) @@ -2866,22 +3046,29 @@ DEBUG(printk("qla1280_setup_chip: Verifying checksum of loaded RISC code.\n");) mb[0] = MBC_VERIFY_CHECKSUM; /* mb[1] = ql12_risc_code_addr01; */ - mb[1] = *QLBoardTbl[ha->devnum].fwstart; + mb[1] = *QL1280BoardTbl[ha->devnum].fwstart; if (!(status = qla1280_mailbox_command(ha, BIT_1|BIT_0, &mb[0]))) { /* Start firmware execution. */ DEBUG(qla1280_print("qla1280_setup_chip: start firmware running.\n\r");) mb[0] = MBC_EXECUTE_FIRMWARE; - /* mb[1] = ql12_risc_code_addr01; */ - mb[1] = *QLBoardTbl[ha->devnum].fwstart; + mb[1] = *QL1280BoardTbl[ha->devnum].fwstart; qla1280_mailbox_command(ha, BIT_1|BIT_0, &mb[0]); } else printk("qla1280_setup_chip: Failed checksum.\n"); } - KMFREE(tbuf,8000); + /* 3.13 */ +#if DUMP_IT_BACK +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + KMFREE(tbuf,8000); +#else + /* free consistent memory allocated for setup_chip */ + pci_free_consistent(ha->pdev, 8000, tbuf, p_tbuf); +#endif +#endif #if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) if (status) @@ -3158,9 +3345,29 @@ /* Disable RISC load of firmware. */ ha->flags.disable_risc_code_load = nv->cntr_flags_1.disable_loading_risc_code; - /* Enable 64bit addressing. */ - ha->flags.enable_64bit_addressing = - nv->cntr_flags_1.enable_64bit_addressing; + +#if BITS_PER_LONG > 32 + /* Enable 64bit addressing for OS/System combination supporting it */ + /* actual NVRAM bit is: nv->cntr_flags_1.enable_64bit_addressing */ + /* but we will ignore it and use BITS_PER_LONG macro to setup for */ + /* 64 or 32 bit access of host memory in all x86/ia-64/Alpha systems */ + ha->flags.enable_64bit_addressing = 1; +#else + ha->flags.enable_64bit_addressing = 0; +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + if (ha->flags.enable_64bit_addressing) { + printk("[[[ qla1x160: 64 Bit PCI Addressing Enabled ]]]\n"); + +#if BITS_PER_LONG > 32 + /* Update our PCI device dma_mask for full 64 bit mask */ + //ha->pdev->dma_mask = (pci_dma_t) 0xffffffffffffffffull; + ha->pdev->dma_mask = 0xffffffffffffffff; + +#endif + } +#endif /* Set ISP hardware DMA burst */ mb[0] = nv->isp_config.c; @@ -3844,7 +4051,7 @@ #endif } -#if QLA1280_64BIT_SUPPORT +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,18) /* * qla1280_64bit_start_scsi * The start SCSI is responsible for building request packets on @@ -3869,10 +4076,13 @@ uint16_t seg_cnt; struct scatterlist *sg = (struct scatterlist *) NULL; uint32_t *dword_ptr; + dma_addr_t dma_handle; -#ifdef QL_DEBUG_LEVEL_3 ENTER("qla1280_64bit_start_scsi:"); -#endif + + DEBUG(sprintf(debug_buff, + "64bit_start: cmd=%x sp=%x CDB=%x\n\r",cmd,sp,cmd->cmnd[0]);) + DEBUG(qla1280_print(debug_buff)); if( qla1280_check_for_dead_scsi_bus(ha, sp) ) { @@ -3883,9 +4093,10 @@ seg_cnt = 0; req_cnt = 1; if (cmd->use_sg) - { - seg_cnt = cmd->use_sg; + { /* 3.13 64 bit */ sg = (struct scatterlist *) cmd->request_buffer; + seg_cnt = pci_map_sg(ha->pdev,sg,cmd->use_sg, + scsi_to_pci_dma_dir(cmd->sc_data_direction)); if (seg_cnt > 2) { @@ -3896,7 +4107,7 @@ } else if (cmd->request_bufflen) /* If data transfer. */ { - DEBUG(printk("Single data transfer (0x%x)\n",cmd->request_bufflen)); + /*DEBUG(printk("Single data transfer len=0x%x\n",cmd->request_bufflen));*/ seg_cnt = 1; } @@ -3957,7 +4168,7 @@ /* Load SCSI command packet. */ pkt->cdb_len = (uint16_t)CMD_CDBLEN(cmd); BCOPY(&(CMD_CDBP(cmd)), pkt->scsi_cdb, pkt->cdb_len); - DEBUG(printk("Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0])); + //DEBUG(printk("Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0])); /* * Load data segments. @@ -3983,12 +4194,17 @@ /* Load command entry data segments. */ for (cnt = 0; cnt < 2 && seg_cnt; cnt++, seg_cnt--) { - DEBUG(sprintf(debug_buff,"SG Segment ap=0x%p, len=0x%x\n\r",sg->address,sg->length)); - DEBUG(qla1280_print(debug_buff)); - *dword_ptr++ = cpu_to_le32(VIRT_TO_BUS_LOW(sg->address)); - *dword_ptr++ = cpu_to_le32(VIRT_TO_BUS_HIGH(sg->address)); - *dword_ptr++ = sg->length; + /* 3.13 64 bit */ + *dword_ptr++ = cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))); + *dword_ptr++ = cpu_to_le32(pci_dma_hi32(sg_dma_address(sg))); + *dword_ptr++ = cpu_to_le32(sg_dma_len(sg)); sg++; + DEBUG(sprintf(debug_buff, + "S/G Segment phys_addr=%x %x, len=0x%x\n\r", + cpu_to_le32(pci_dma_hi32(sg_dma_address(sg))), + cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))), + cpu_to_le32(sg_dma_len(sg)));) + DEBUG(qla1280_print(debug_buff)); } #ifdef QL_DEBUG_LEVEL_5 qla1280_print( @@ -4005,6 +4221,10 @@ /* * Build continuation packets. */ + DEBUG(sprintf(debug_buff, + "S/G Building Continuation...seg_cnt=0x%x remains\n\r", + seg_cnt);) + DEBUG(qla1280_print(debug_buff)); while (seg_cnt > 0) { /* Adjust ring index. */ @@ -4038,10 +4258,17 @@ /* Load continuation entry data segments. */ for (cnt = 0; cnt < 5 && seg_cnt; cnt++, seg_cnt--) { - *dword_ptr++ = cpu_to_le32(VIRT_TO_BUS_LOW(sg->address)); - *dword_ptr++ = cpu_to_le32(VIRT_TO_BUS_HIGH(sg->address)); - *dword_ptr++ = sg->length; - sg++; + /* 3.13 64 bit */ + *dword_ptr++ = cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))); + *dword_ptr++ = cpu_to_le32(pci_dma_hi32(sg_dma_address(sg))); + *dword_ptr++ = cpu_to_le32(sg_dma_len(sg)); + DEBUG(sprintf(debug_buff, + "S/G Segment Cont. phys_addr=%x %x, len=0x%x\n\r", + cpu_to_le32(pci_dma_hi32(sg_dma_address(sg))), + cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))), + cpu_to_le32(sg_dma_len(sg)));) + DEBUG(qla1280_print(debug_buff)); + sg++; } #ifdef QL_DEBUG_LEVEL_5 qla1280_print( @@ -4058,11 +4285,21 @@ #endif } } - else /* No scatter gather data transfer */ - { - *dword_ptr++ = cpu_to_le32(VIRT_TO_BUS_LOW(cmd->request_buffer)); - *dword_ptr++ = cpu_to_le32(VIRT_TO_BUS_HIGH(cmd->request_buffer)); - *dword_ptr = (uint32_t) cmd->request_bufflen; + else /* No scatter gather data transfer */ + { /* 3.13 64 bit */ + dma_handle = pci_map_single(ha->pdev, + cmd->request_buffer, + cmd->request_bufflen, + scsi_to_pci_dma_dir(cmd->sc_data_direction)); + /* save dma_handle for pci_unmap_single */ + sp->saved_dma_handle = dma_handle; + + *dword_ptr++ = cpu_to_le32(pci_dma_lo32(dma_handle)); + *dword_ptr++ = cpu_to_le32(pci_dma_hi32(dma_handle)); + *dword_ptr = (uint32_t) cmd->request_bufflen; + /*DEBUG(sprintf(debug_buff, + "No S/G map_single saved_dma_handle=%lx\n\r",dma_handle)); + DEBUG(qla1280_print(debug_buff));*/ #ifdef QL_DEBUG_LEVEL_5 qla1280_print( "qla1280_64bit_start_scsi: No scatter/gather command packet data - c"); @@ -4077,12 +4314,12 @@ #endif } } -#ifdef QL_DEBUG_LEVEL_5 - else /* No data transfer */ + else /* No data transfer */ { *dword_ptr++ = (uint32_t) 0; *dword_ptr++ = (uint32_t) 0; *dword_ptr = (uint32_t) 0; +#ifdef QL_DEBUG_LEVEL_5 qla1280_print( "qla1280_64bit_start_scsi: No data, command packet data - c"); qla1280_print(" b "); @@ -4093,8 +4330,8 @@ qla1280_output_number((uint32_t)SCSI_LUN_32(cmd), 10); qla1280_print("\n\r"); qla1280_dump_buffer((caddr_t)pkt, REQUEST_ENTRY_SIZE); - } #endif + } /* Adjust ring index. */ ha->req_ring_index++; if (ha->req_ring_index == REQUEST_ENTRY_CNT) @@ -4106,6 +4343,10 @@ ha->request_ring_ptr++; /* Set chip new ring index. */ + DEBUG(qla1280_print("qla1280_64bit_start_scsi: Wakeup RISC for pending command\n\r")); + ha->qthreads--; + sp->flags |= SRB_SENT; + ha->actthreads++; WRT_REG_WORD(®->mailbox4, ha->req_ring_index); } else @@ -4146,7 +4387,7 @@ #endif return(status); } -#endif /* QLA1280_64BIT_SUPPORT */ +#endif /* * qla1280_32bit_start_scsi @@ -4181,8 +4422,15 @@ uint8_t *data_ptr; uint32_t *dword_ptr; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + dma_addr_t dma_handle; +#endif + ENTER("qla1280_32bit_start_scsi"); + DEBUG(sprintf(debug_buff, + "32bit_start: cmd=%x sp=%x CDB=%x\n\r",cmd,sp,cmd->cmnd[0]);) + DEBUG(qla1280_print(debug_buff)); if( qla1280_check_for_dead_scsi_bus(ha, sp) ) { @@ -4199,8 +4447,15 @@ * differences and the kernel SG list uses virtual addresses where * we need physical addresses. */ - seg_cnt = cmd->use_sg; sg = (struct scatterlist *) cmd->request_buffer; + /* 3.13 32 bit */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + seg_cnt = cmd->use_sg; +#else + seg_cnt = pci_map_sg(ha->pdev,sg,cmd->use_sg, + scsi_to_pci_dma_dir(cmd->sc_data_direction)); +#endif + /* * if greater than four sg entries then we need to allocate * continuation entries @@ -4211,17 +4466,22 @@ if ((uint16_t)(seg_cnt - 4) % 7) req_cnt++; } - DEBUG(sprintf(debug_buff,"S/G for data transfer -num segs(%d), req blk cnt(%d)\n\r",seg_cnt,req_cnt)); + DEBUG(sprintf(debug_buff, + "S/G Transfer cmd=%x seg_cnt=0x%x, req_cnt=%x\n\r", + cmd,seg_cnt,req_cnt)); DEBUG(qla1280_print(debug_buff)); } else if (cmd->request_bufflen) /* If data transfer. */ { - DEBUG(printk("Single data transfer (0x%x)\n",cmd->request_bufflen)); + DEBUG(sprintf(debug_buff, + "No S/G transfer t=%x cmd=%x len=%x CDB=%x\n\r", + SCSI_TCN_32(cmd),cmd,cmd->request_bufflen,cmd->cmnd[0])); + DEBUG(qla1280_print(debug_buff)); seg_cnt = 1; } else { - DEBUG(printk("No data transfer \n")); + //DEBUG(printk("No data transfer \n")); seg_cnt = 0; } @@ -4238,7 +4498,8 @@ ha->req_q_cnt = REQUEST_ENTRY_CNT - (ha->req_ring_index - cnt); } - DEBUG(sprintf(debug_buff,"Number of free entries = (%d)\n\r",ha->req_q_cnt)); + DEBUG(sprintf(debug_buff,"Number of free entries=(%d) seg_cnt=0x%x\n\r", + ha->req_q_cnt,seg_cnt)); DEBUG(qla1280_print(debug_buff)); /* If room for request in request ring. */ if ((uint16_t)(req_cnt + 2) < ha->req_q_cnt) @@ -4286,20 +4547,15 @@ data_ptr = (uint8_t *) &(CMD_CDBP(cmd)); for (cnt = 0; cnt < pkt->cdb_len; cnt++) pkt->scsi_cdb[cnt] = *data_ptr++; - DEBUG(printk("Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0])); + //DEBUG(printk("Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0])); /* * Load data segments. */ if (seg_cnt) { - DEBUG(printk("loading data segments..\n")); /* Set transfer direction (READ and WRITE) */ /* Linux doesn't tell us */ - /* - * 3/10 dg - Normally, we should need this check with our F/W - * but because of a small issue with it we do. - * * For block devices, cmd->request.cmd has the operation * For character devices, this isn't always set properly, so * we need to check data_cmnd[0]. This catches the conditions @@ -4325,15 +4581,32 @@ /* Load command entry data segments. */ for (cnt = 0; cnt < 4 && seg_cnt; cnt++, seg_cnt--) { + /* 3.13 32 bit */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) *dword_ptr++ = (uint32_t) cpu_to_le32(VIRT_TO_BUS(sg->address)); *dword_ptr++ = sg->length; - DEBUG(sprintf(debug_buff,"SG Segment ap=0x%p, len=0x%x\n\r",sg->address,sg->length)); + DEBUG(sprintf(debug_buff, + "S/G Segment phys_addr=0x%x, len=0x%x\n\r", + cpu_to_le32(VIRT_TO_BUS(sg->address)),sg->length)); + DEBUG(qla1280_print(debug_buff)); +#else + *dword_ptr++ = cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))); + *dword_ptr++ = cpu_to_le32(sg_dma_len(sg)); + DEBUG(sprintf(debug_buff, + "S/G Segment phys_addr=0x%x, len=0x%x\n\r", + cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))), + cpu_to_le32(sg_dma_len(sg)));) DEBUG(qla1280_print(debug_buff)); +#endif sg++; } /* * Build continuation packets. */ + DEBUG(sprintf(debug_buff, + "S/G Building Continuation...seg_cnt=0x%x remains\n\r", + seg_cnt);) + DEBUG(qla1280_print(debug_buff)); while (seg_cnt > 0) { /* Adjust ring index. */ @@ -4368,9 +4641,25 @@ /* Load continuation entry data segments. */ for (cnt = 0; cnt < 7 && seg_cnt; cnt++, seg_cnt--) { - *dword_ptr++ = (u_int) cpu_to_le32(VIRT_TO_BUS(sg->address)); - *dword_ptr++ = sg->length; - sg++; + /* 3.13 32 bit */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + *dword_ptr++ = (u_int) cpu_to_le32(VIRT_TO_BUS(sg->address)); + *dword_ptr++ = sg->length; + DEBUG(sprintf(debug_buff, + "S/G Segment Cont. phys_addr=0x%x, len=0x%x\n\r", + cpu_to_le32(pci_dma_lo32(VIRT_TO_BUS(sg->address))), + sg->length);) + DEBUG(qla1280_print(debug_buff)); +#else + *dword_ptr++ = cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))); + *dword_ptr++ = cpu_to_le32(sg_dma_len(sg)); + DEBUG(sprintf(debug_buff, + "S/G Segment Cont. phys_addr=0x%x, len=0x%x\n\r", + cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))), + cpu_to_le32(sg_dma_len(sg)));) + DEBUG(qla1280_print(debug_buff)); +#endif + sg++; } #ifdef QL_DEBUG_LEVEL_5 qla1280_print( @@ -4385,14 +4674,28 @@ #endif } } - else /* No scatter gather data transfer */ + else /* No S/G data transfer */ { + /* 3.13 32 bit */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) *dword_ptr++ = (uint32_t) cpu_to_le32(VIRT_TO_BUS(cmd->request_buffer)); *dword_ptr = (uint32_t) cmd->request_bufflen; - DEBUG(printk("Single Segment ap=0x%p, len=0x%x\n",cmd->request_buffer,cmd->request_bufflen)); +#else + dma_handle = pci_map_single(ha->pdev, + cmd->request_buffer, + cmd->request_bufflen, + scsi_to_pci_dma_dir(cmd->sc_data_direction)); + sp->saved_dma_handle = dma_handle; + + *dword_ptr++ = cpu_to_le32(pci_dma_lo32(dma_handle)); + *dword_ptr = (uint32_t) cmd->request_bufflen; + /*DEBUG(sprintf(debug_buff, + "No S/G map_single saved_dma_handle=%lx\n\r",dma_handle)); + DEBUG(qla1280_print(debug_buff));*/ +#endif } } - else /* No data transfer */ + else /* No data transfer at all */ { *dword_ptr++ = (uint32_t) 0; *dword_ptr = (uint32_t) 0; @@ -4420,10 +4723,8 @@ /* Set chip new ring index. */ DEBUG(qla1280_print("qla1280_32bit_start_scsi: Wakeup RISC for pending command\n\r")); ha->qthreads--; - sp->u_start = jiffies; sp->flags |= SRB_SENT; ha->actthreads++; - /* qla1280_output_number((uint32_t)ha->actthreads++, 16); */ WRT_REG_WORD(®->mailbox4, ha->req_ring_index); } else @@ -4431,7 +4732,7 @@ status = 1; #ifdef QL_DEBUG_LEVEL_2 qla1280_print( - "qla1280_32bit_start_scsi: NO ROOM IN OUTSTANDING ARRAY\n\r"); + "qla1280_32bit_start_scsi: NO ROOM IN OUTSTANDING ARRAY\n\r"); qla1280_print(" req_q_cnt="); qla1280_output_number((uint32_t)ha->req_q_cnt, 16); qla1280_print("\n\r"); @@ -4465,6 +4766,7 @@ return(status); } + /* * qla1280_req_pkt * Function is responsible for locking ring and @@ -4895,7 +5197,7 @@ { device_reg_t *reg = ha->iobase; response_t *pkt; - srb_t *sp; + srb_t *sp = 0; uint16_t mailbox[MAILBOX_REGISTER_COUNT]; uint16_t *wptr; uint32_t index; @@ -4909,9 +5211,11 @@ /* Check for mailbox interrupt. */ mailbox[0] = RD_REG_WORD(®->semaphore); + if (mailbox[0] & BIT_0) { /* Get mailbox data. */ + //DEBUG(qla1280_print("qla1280_isr: In Get mailbox data \n\r");) wptr = &mailbox[0]; *wptr++ = RD_REG_WORD(®->mailbox0); @@ -4944,7 +5248,7 @@ { case MBA_SCSI_COMPLETION: /* Response completion */ #ifdef QL_DEBUG_LEVEL_5 - qla1280_print("qla1280_isr: mailbox response completion\n\r"); + qla1280_print("qla1280_isr: mailbox SCSI response completion\n\r"); #endif if (ha->flags.online) { @@ -4973,9 +5277,11 @@ else (*done_q_last)->s_next = sp; *done_q_last = sp; + } else { + #ifdef QL_DEBUG_LEVEL_2 qla1280_print("qla1280_isr: ISP invalid handle\n\r"); #endif @@ -5047,6 +5353,7 @@ #endif break; default: + //DEBUG(qla1280_print("qla1280_isr: default case of switch MB \n\r");) if (mailbox[0] < MBA_ASYNC_EVENT) { wptr = &mailbox[0]; @@ -5063,9 +5370,9 @@ break; } } - else + else { WRT_REG_WORD(®->host_cmd, HC_CLR_RISC_INT); - + } /* * Response ring */ @@ -5129,6 +5436,7 @@ qla1280_error_entry(ha, pkt, done_q_first, done_q_last); + /* Adjust ring index. */ ha->rsp_ring_index++; if (ha->rsp_ring_index == RESPONSE_ENTRY_CNT) @@ -5312,9 +5620,12 @@ } pkt->scsi_status = S_CKCON; pkt->option_flags |= (uint32_t)OF_SSTS | (uint32_t)OF_NO_DATA; + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) if (ha->flags.enable_64bit_addressing) qla1280_64bit_continue_io(ha, pkt, 0, 0); else +#endif qla1280_32bit_continue_io(ha, pkt, 0, 0); break; case 0x16: /* Requested Capability Not Available */ @@ -5673,10 +5984,12 @@ (uint32_t)OF_NO_DATA; break; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) if (ha->flags.enable_64bit_addressing) - qla1280_64bit_continue_io(ha, pkt, len, (paddr32_t *)&phy_addr); + qla1280_64bit_continue_io(ha, pkt, len, (paddr32_t *)&phy_addr); else - qla1280_32bit_continue_io(ha, pkt, len, (paddr32_t *)&phy_addr); +#endif + qla1280_32bit_continue_io(ha, pkt, len, (paddr32_t *)&phy_addr); break; default: break; @@ -5750,11 +6063,13 @@ ha->outstanding_cmds[pkt->handle] = 0; cp = sp->cmd; + /* Generate LU queue on cntrl, target, LUN */ b = SCSI_BUS_32(cp); t = SCSI_TCN_32(cp); l = SCSI_LUN_32(cp); q = LU_Q(ha, b, t, l); + if( pkt->comp_status || pkt->scsi_status ) { DEBUG(qla1280_print( "scsi: comp_status = ");) @@ -5885,7 +6200,7 @@ /* Place command on done queue. */ qla1280_done_q_put(sp, done_q_first, done_q_last); } -#if QLA1280_64BIT_SUPPORT +#if BITS_PER_LONG > 32 else if (pkt->entry_type == COMMAND_A64_TYPE) { #ifdef QL_DEBUG_LEVEL_2 @@ -5962,7 +6277,6 @@ sp->timeout += 2; */ /* Place request back on top of device queue. */ - /* sp->flags &= ~(SRB_SENT | SRB_TIMEOUT); */ sp->flags = 0; qla1280_putq_t(q, sp); } @@ -6080,7 +6394,7 @@ } } #ifdef QL_DEBUG_LEVEL_3 - qla1280_print("qla1280_restart_queues: exiting normally\n"); + qla1280_print("qla1280_restart_queues: exiting normally\n\r"); #endif } @@ -6166,13 +6480,15 @@ return(ret); } - -/* - * Declarations for load module - */ -static Scsi_Host_Template driver_template = QLA1280_LINUX_TEMPLATE; - +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) +#ifdef MODULE +Scsi_Host_Template driver_template = QLA1280_LINUX_TEMPLATE; #include "scsi_module.c" +#endif +#else /* new kernel scsi initialization scheme */ +static Scsi_Host_Template driver_template = QLA1280_LINUX_TEMPLATE; +#include "scsi_module.c" +#endif /************************************************************************ * qla1280_check_for_dead_scsi_bus * @@ -6283,13 +6599,13 @@ #if MEMORY_MAPPED_IO ret = *port; #else - ret = inb((int)port); + ret = inb((long)port); #endif if (ql_debug_print) { qla1280_print("qla1280_getbyte: address = "); - qla1280_output_number((uint32_t)port, 16); + qla1280_output_number((unsigned long)port, 16); qla1280_print(" data = 0x"); qla1280_output_number((uint32_t)ret, 16); qla1280_print("\n\r"); @@ -6309,13 +6625,13 @@ #if MEMORY_MAPPED_IO ret = *port; #else - ret = inw((int)port); + ret = inw((unsigned long)port); #endif if (ql_debug_print) { qla1280_print("qla1280_getword: address = "); - qla1280_output_number((uint32_t)port, 16); + qla1280_output_number((unsigned long)port, 16); qla1280_print(" data = 0x"); qla1280_output_number((uint32_t)ret, 16); qla1280_print("\n\r"); @@ -6335,13 +6651,13 @@ #if MEMORY_MAPPED_IO ret = *port; #else - ret = inl((int)port); + ret = inl((unsigned long)port); #endif if (ql_debug_print) { qla1280_print("qla1280_getdword: address = "); - qla1280_output_number((uint32_t)port, 16); + qla1280_output_number((unsigned long)port, 16); qla1280_print(" data = 0x"); qla1280_output_number((uint32_t)ret, 16); qla1280_print("\n\r"); @@ -6359,13 +6675,13 @@ #if MEMORY_MAPPED_IO *port = data; #else - outb(data, (int)port); + outb(data, (unsigned long)port); #endif if (ql_debug_print) { qla1280_print("qla1280_putbyte: address = "); - qla1280_output_number((uint32_t)port, 16); + qla1280_output_number((unsigned long)port, 16); qla1280_print(" data = 0x"); qla1280_output_number((uint32_t)data, 16); qla1280_print("\n\r"); @@ -6384,14 +6700,14 @@ #ifdef _LINUX_IOPORTS outw(data, (int)port); #else - outw((int)port, data); + outw((unsigned long)port, data); #endif #endif if (ql_debug_print) { qla1280_print("qla1280_putword: address = "); - qla1280_output_number((uint32_t)port, 16); + qla1280_output_number((unsigned long)port, 16); qla1280_print(" data = 0x"); qla1280_output_number((uint32_t)data, 16); qla1280_print("\n\r"); @@ -6410,14 +6726,14 @@ #ifdef _LINUX_IOPORTS outl(data,(int)port); #else - outl((int)port, data); + outl((unsigned long)port, data); #endif #endif if (ql_debug_print) { qla1280_print("qla1280_putdword: address = "); - qla1280_output_number((uint32_t)port, 16); + qla1280_output_number((unsigned long)port, 16); qla1280_print(" data = 0x"); qla1280_output_number((uint32_t)data, 16); qla1280_print("\n\r"); @@ -6441,8 +6757,7 @@ /* * Out character to COM2 port. - * PORT must be at standard address for COM2 = 0x2F8, - * or COM1 = 0x3F8 + * PORT must be at standard address for COM1 = 0x3f8 */ #define OUTB(addr,data) outb((data),(addr)) @@ -6452,7 +6767,7 @@ #ifdef QL_DEBUG_CONSOLE printk("%c", c); #else - int com_addr = 0x2f8; + int com_addr = 0x3f8; int hardware_flow_control = 1; int software_flow_control = 0; uint8_t data; @@ -6464,7 +6779,7 @@ }while (!(data & BIT_6)); /* - * Set BAUD rate for COM2 to 19200 (0x6) + * Set BAUD rate for COM2 to 9600 (0x6) */ /* Select rate divisor. */ @@ -6660,8 +6975,6 @@ qla1280_print(debug_buff); sprintf(debug_buff," Pid=%d, SP=0x%p\n\r", (int)cmd->pid, CMD_SP(cmd)); qla1280_print(debug_buff); - sprintf(debug_buff," r_start=0x%lx, u_start=0x%lx\n\r",sp->r_start,sp->u_start); - qla1280_print(debug_buff); sprintf(debug_buff," underflow size = 0x%x, direction=0x%x, req.cmd=0x%x \n\r", cmd->underflow, sp->dir,cmd->request.cmd); qla1280_print(debug_buff); } @@ -6689,23 +7002,6 @@ } #endif -#ifdef QLA1280_UNUSED -/************************************************************************** - * ql1280_dump_regs - * - **************************************************************************/ -static void qla1280_dump_regs(struct Scsi_Host *host) -{ - printk("Mailbox registers:\n"); - printk("qla1280 : mbox 0 0x%04x \n", inw(host->io_port + 0x70)); - printk("qla1280 : mbox 1 0x%04x \n", inw(host->io_port + 0x72)); - printk("qla1280 : mbox 2 0x%04x \n", inw(host->io_port + 0x74)); - printk("qla1280 : mbox 3 0x%04x \n", inw(host->io_port + 0x76)); - printk("qla1280 : mbox 4 0x%04x \n", inw(host->io_port + 0x78)); - printk("qla1280 : mbox 5 0x%04x \n", inw(host->io_port + 0x7a)); -} -#endif - #if STOP_ON_ERROR @@ -6732,9 +7028,6 @@ printk("HA flags =0x%lx\n", *fp); DEBUG2(ql_debug_print = 1;) /* DEBUG2(ql1280_dump_device((scsi_qla_host_t *) host->hostdata)); */ -#ifdef QLA1280_UNUSED - qla1280_dump_regs(host); -#endif sti(); panic("Ooops"); /* cli(); @@ -6747,11 +7040,6 @@ } #endif -#ifdef QLA1280_UNUSED -static void qla1280_set_flags(char * s) -{ -} -#endif /************************************************************************** * qla1280_setup @@ -6765,24 +7053,6 @@ { char *end, *str, *cp; -#ifdef QLA1280_UNUSED - static struct - { - const char *name; - int siz; - void (*func)(); - int arg; - } options[] = - { - { "dump_regs", 9, &qla1280_dump_regs, 0 - }, - { "verbose", 7, &qla1280_set_flags, 0x1 - }, - { "", 0, NULL, 0 - } - }; -#endif - printk("scsi: Processing Option str = %s\n", s); end = strchr(s, '\0'); /* locate command */ @@ -6832,4 +7102,3 @@ * tab-width: 8 * End: */ - diff -urN linux-2.4.18/drivers/scsi/qla1280.h lia64-2.4/drivers/scsi/qla1280.h --- linux-2.4.18/drivers/scsi/qla1280.h Mon Sep 24 15:07:46 2001 +++ lia64-2.4/drivers/scsi/qla1280.h Fri Jul 19 18:33:24 2002 @@ -1,169 +1,35 @@ -/************************************************************************* - * QLOGIC LINUX SOFTWARE - * - * QLogic ISP1x80/1x160 device driver for Linux 2.3.x (redhat 6.x). - * - * COPYRIGHT (C) 1996-2000 QLOGIC CORPORATION - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the Qlogic's Linux Software License. - * - * This program is WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistribution's or source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification, immediately at the beginning of the file. - * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - *****************************************************************************/ - -/************************************************************************************* - QLOGIC CORPORATION SOFTWARE - "GNU" GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION - AND MODIFICATION - -This GNU General Public License ("License") applies solely to QLogic Linux -Software ("Software") and may be distributed under the terms of this License. - -1. You may copy and distribute verbatim copies of the Software's source code as -you receive it, in any medium, provided that you conspicuously and appropriately -publish on each copy an appropriate copyright notice and disclaimer of warranty; -keep intact all the notices that refer to this License and to the absence of any -warranty; and give any other recipients of the Software a copy of this License along -with the Software. - -You may charge a fee for the physical act of transferring a copy, and you may at your -option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Software or any portion of it, thus forming -a work based on the Software, and copy and distribute such modifications or work under -the terms of Section 1 above, provided that you also meet all of these conditions: - -* a) You must cause the modified files to carry prominent notices stating that you -changed the files and the date of any change. - -* b) You must cause any work that you distribute or publish that in whole or in part -contains or is derived from the Software or any part thereof, to be licensed as a -whole at no charge to all third parties under the terms of this License. - -* c) If the modified Software normally reads commands interactively when run, you -must cause it, when started running for such interactive use in the most ordinary way, -to print or display an announcement including an appropriate copyright notice and a -notice that there is no warranty (or else, saying that you provide a warranty) and that -users may redistribute the Software under these conditions, and telling the user how to -view a copy of this License. (Exception:if the Software itself is interactive but does -not normally print such an announcement, your work based on the Software is not required -to print an announcement.) - -These requirements apply to the modified work as a whole. If identifiable sections of -that work are not derived from the Software, and can be reasonably considered independent -and separate works in themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you distribute the same -sections as part of a whole which is a work based on the Software, the distribution of the -whole must be on the terms of this License, whose permissions for other licensees extend -to the entire whole, and thus to each and every part regardless of who wrote it. - -3. You may copy and distribute the Software (or a work based on it, under Section 2) in -object code or executable form under the terms of Sections 1 and 2 above provided that -you also do one of the following: - -* a) Accompany it with the complete corresponding machine-readable source code, which must -be distributed under the terms of Sections 1 and 2 above on a medium customarily used for -software interchange; or, - -* b) Accompany it with a written offer, valid for at least three years, to give any third -party, for a charge no more than your cost of physically performing source distribution, -a complete machine-readable copy of the corresponding source code, to be distributed under -the terms of Sections 1 and 2 above on a medium customarily used for software interchange; -or, - -* c) Accompany it with the information you received as to the offer to distribute -corresponding source code. (This alternative is allowed only for noncommercial distribution -and only if you received the Software in object code or executable form with such an offer, -in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for making modifications -to it. For an executable work, complete source code means all the source code for all -modules it contains, plus any associated interface definition files, plus the scripts used -to control compilation and installation of the executable. - -If distribution of executable or object code is made by offering access to copy from a -designated place, then offering equivalent access to copy the source code from the same -place counts as distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - -4. You may not copy, modify, sublicense, or distribute the Software except as expressly -provided under this License. Any attempt otherwise to copy, modify, sublicense or -distribute the Software is void, and will automatically terminate your rights under this -License. However, parties who have received copies, or rights, from you under this License -will not have their licenses terminated so long as such parties remain in full compliance. - -5. This license grants you world wide, royalty free non-exclusive rights to modify or -distribute the Software or its derivative works. These actions are prohibited by law -if you do not accept this License. Therefore, by modifying or distributing the Software -(or any work based on the Software), you indicate your acceptance of this License to do -so, and all its terms and conditions for copying, distributing or modifying the Software -or works based on it. - -6. Each time you redistribute the Software (or any work based on the Software), the -recipient automatically receives a license from the original licensor to copy, distribute -or modify the Software subject to these terms and conditions. You may not impose any -further restrictions on the recipients' exercise of the rights granted herein. You are -not responsible for enforcing compliance by third parties to this License. - -7. If, as a consequence of a court judgment or allegation of patent infringement or for -any other reason (not limited to patent issues), conditions are imposed on you -(whether by court order, agreement or otherwise) that contradict the conditions of this -License, they do not excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this License -and any other pertinent obligations, then as a consequence you may not distribute the -Software at all. - -If any portion of this section is held invalid or unenforceable under any particular -circumstance, the balance of the section is intended to apply and the section as a whole -is intended to apply in other circumstances. -NO WARRANTY - -11. THE SOFTWARE IS PROVIDED WITHOUT A WARRANTY OF ANY KIND. THERE IS NO -WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, -EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE -ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. -SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL -NECESSARY SERVICING, REPAIR OR CORRECTION. - -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE SOFTWARE AS PERMITTED ABOVE, BE LIABLE TO YOU FOR -DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL -DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING -BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR -LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO -OPERATE WITH ANY OTHER SOFTWARES), EVEN IF SUCH HOLDER OR OTHER PARTY HAS -BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -END OF TERMS AND CONDITIONS +/******************************************************************************** +* QLOGIC LINUX SOFTWARE +* +* QLogic ISP1280 (Ultra2) /12160 (Ultra3) SCSI driver +* Copyright (C) 2000 Qlogic Corporation +* (www.qlogic.com) +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2, or (at your option) any +* later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +** +******************************************************************************/ -*************************************************************************************/ - - #ifndef _IO_HBA_QLA1280_H /* wrapper symbol for kernel use */ #define _IO_HBA_QLA1280_H /* subject to change without notice */ + +#ifndef LINUX_VERSION_CODE +#include +#endif /* LINUX_VERSION_CODE not defined */ + #if defined(__cplusplus) extern "C" { #endif -#include - +#ifndef HOSTS_C /* included in hosts.c */ /* * Enable define statement to ignore Data Underrun Errors, * remove define statement to enable detection. @@ -173,15 +39,18 @@ /* * Driver debug definitions. */ -/* #define QL_DEBUG_LEVEL_1 */ /* Output register accesses to COM2. */ -/* #define QL_DEBUG_LEVEL_2 */ /* Output error msgs to COM2. */ -/* #define QL_DEBUG_LEVEL_3 */ /* Output function trace msgs to COM2. */ -/* #define QL_DEBUG_LEVEL_4 */ /* Output NVRAM trace msgs to COM2. */ -/* #define QL_DEBUG_LEVEL_5 */ /* Output ring trace msgs to COM2. */ -/* #define QL_DEBUG_LEVEL_6 */ /* Output WATCHDOG timer trace to COM2. */ -/* #define QL_DEBUG_LEVEL_7 */ /* Output RISC load trace msgs to COM2. */ +/* #define QL_DEBUG_LEVEL_1 */ /* Output register accesses to COM1 */ +/* #define QL_DEBUG_LEVEL_2 */ /* Output error msgs to COM1 */ +/* #define QL_DEBUG_LEVEL_3 */ /* Output function trace msgs to COM1 */ +/* #define QL_DEBUG_LEVEL_4 */ /* Output NVRAM trace msgs to COM1 */ +/* #define QL_DEBUG_LEVEL_5 */ /* Output ring trace msgs to COM1 */ +/* #define QL_DEBUG_LEVEL_6 */ /* Output WATCHDOG timer trace to COM1 */ +/* #define QL_DEBUG_LEVEL_7 */ /* Output RISC load trace msgs to COM1 */ + +#define QL_DEBUG_CONSOLE /* Output to console instead of COM1 */ + /* comment this #define to get output of qla1280_print to COM1 */ + /* if COM1 is not connected to a host system, the driver hangs system! */ -#define QL_DEBUG_CONSOLE /* Output to console instead of COM2. */ #ifndef TRUE # define TRUE 1 @@ -206,7 +75,11 @@ * Locking */ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,0) -# include +# if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) +# include +# else +# include +# endif # include # define cpuid smp_processor_id() # if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) @@ -314,12 +187,12 @@ #define WRT_REG_DWORD(addr, data) qla1280_putdword((uint32_t *)addr, data) #else /* QL_DEBUG_LEVEL_1 */ #ifdef MEMORY_MAPPED_IO - #define RD_REG_BYTE(addr) readb((unsigned long) (addr) - #define RD_REG_WORD(addr) readw((unsigned long) (addr) - #define RD_REG_DWORD(addr) readl((unsigned long) (addr) - #define WRT_REG_BYTE(addr, data) writeb((data), (unsigned long) (addr)) - #define WRT_REG_WORD(addr, data) writew((data), (unsigned long) (addr)) - #define WRT_REG_DWORD(addr, data) writel((data), (unsigned long) (addr)) + #define RD_REG_BYTE(addr) (*((volatile uint8_t *)addr)) + #define RD_REG_WORD(addr) (*((volatile uint16_t *)addr)) + #define RD_REG_DWORD(addr) (*((volatile uint32_t *)addr)) + #define WRT_REG_BYTE(addr, data) (*((volatile uint8_t *)addr) = data) + #define WRT_REG_WORD(addr, data) (*((volatile uint16_t *)addr) = data) + #define WRT_REG_DWORD(addr, data) (*((volatile uint32_t *)addr) = data) #else /* MEMORY_MAPPED_IO */ #define RD_REG_BYTE(addr) (inb((unsigned long)addr)) #define RD_REG_WORD(addr) (inw((unsigned long)addr)) @@ -372,7 +245,8 @@ /* - * SCSI Request Block structure + * SCSI Request Block structure (sp) that is placed + * on cmd->SCp location of every I/O */ typedef struct srb { @@ -381,10 +255,11 @@ struct srb *s_prev; /* (4) Previous block on LU queue */ uint8_t flags; /* (1) Status flags. */ uint8_t dir; /* direction of transfer */ - uint8_t unused[2]; - u_long r_start; /* jiffies at start of request */ - u_long u_start; /* jiffies when sent to F/W */ -}srb_t; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + dma_addr_t saved_dma_handle; /* for unmap of single transfers */ +#endif + +} srb_t; /* * SRB flag definitions @@ -1562,22 +1437,35 @@ request_t req[REQUEST_ENTRY_CNT+1]; response_t res[RESPONSE_ENTRY_CNT+1]; - unsigned long request_dma; /* Physical address. */ +#if BITS_PER_LONG > 32 + dma_addr_t request_dma; /* Physical Address */ +#else + uint32_t request_dma; /* Physical address. */ +#endif request_t *request_ring; /* Base virtual address */ request_t *request_ring_ptr; /* Current address. */ uint16_t req_ring_index; /* Current index. */ uint16_t req_q_cnt; /* Number of available entries. */ - unsigned long response_dma; /* Physical address. */ +#if BITS_PER_LONG > 32 + dma_addr_t response_dma; /* Physical address. */ +#else + uint32_t response_dma; /* Physical address. */ +#endif response_t *response_ring; /* Base virtual address */ response_t *response_ring_ptr; /* Current address. */ uint16_t rsp_ring_index; /* Current index. */ #if QL1280_TARGET_MODE_SUPPORT /* Target buffer and sense data. */ +#if BITS_PER_LONG > 32 + dma_addr_t tbuf_dma; /* Physical address. */ + dma_addr_t tsense_dma; /* Physical address. */ +#else uint32_t tbuf_dma; /* Physical address. */ - tgt_t *tbuf; uint32_t tsense_dma; /* Physical address. */ +#endif + tgt_t *tbuf; uint8_t *tsense; #endif @@ -1614,8 +1502,13 @@ uint32_t dpc :1; /* 15 */ uint32_t dpc_sched :1; /* 16 */ uint32_t interrupts_on :1; /* 17 */ + uint32_t bios_enabled :1; /* 18 */ }flags; + /* needed holders for PCI ordered list of hosts */ + unsigned long io_port; + uint32_t irq; + }scsi_qla_host_t; /* @@ -1644,6 +1537,8 @@ #define QLA1280_RING_LOCK(ha) #define QLA1280_RING_UNLOCK(ha) +#endif /* HOSTS_C */ + #if defined(__cplusplus) } #endif @@ -1661,49 +1556,20 @@ int qla1280_biosparam(Disk *, kdev_t, int[]); void qla1280_intr_handler(int, void *, struct pt_regs *); void qla1280_setup(char *s, int *dummy); -#if defined(__386__) + # define QLA1280_BIOSPARAM qla1280_biosparam -#else -# define QLA1280_BIOSPARAM NULL -#endif /* * Scsi_Host_template (see hosts.h) * Device driver Interfaces to mid-level SCSI driver. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) -/* This interface is now obsolete !!! */ -#define QLA1280_LINUX_TEMPLATE { \ - next: NULL, \ - usage_count: NULL, \ - proc_dir: NULL, \ - proc_info: NULL, \ - name: "Qlogic ISP 1280", \ - detect: qla1280_detect, \ - release: qla1280_release, \ - info: qla1280_info, \ - command: NULL, \ - queuecommand: qla1280_queuecommand, \ - abort: qla1280_abort, \ - reset: qla1280_reset, \ - slave_attach: NULL, \ - bios_param: QLA1280_BIOSPARAM, \ - can_queue: 255, /* MAX_OUTSTANDING_COMMANDS */ \ - this_id: -1, /* scsi id of host adapter */ \ - sg_tablesize: SG_ALL, \ - cmd_per_lun: 3, /* max commands per lun */ \ - present: 0, /* number of 1280s present */ \ - unchecked_isa_dma: 0, /* no memeory DMA restrictions */ \ - use_clustering: ENABLE_CLUSTERING \ -} -#else -#define QLA1280_LINUX_TEMPLATE { \ +#define QLA1280_LINUX_TEMPLATE { \ next: NULL, \ module: NULL, \ proc_dir: NULL, \ proc_info: qla1280_proc_info, \ - name: "Qlogic ISP 1280\1080", \ + name: "Qlogic ISP 1280\12160", \ detect: qla1280_detect, \ release: qla1280_release, \ info: qla1280_info, \ @@ -1723,13 +1589,14 @@ this_id: -1, /* scsi id of host adapter */\ sg_tablesize: SG_ALL, /* max scatter-gather cmds */\ cmd_per_lun: 3, /* cmds per lun (linked cmds) */\ - present: 0, /* number of 7xxx's present */\ + present: 0, /* number of 1280's present */\ unchecked_isa_dma: 0, /* no memory DMA restrictions */\ use_clustering: ENABLE_CLUSTERING, \ use_new_eh_code: 0, \ emulated: 0 \ } -#endif + #endif /* _IO_HBA_QLA1280_H */ + diff -urN linux-2.4.18/drivers/scsi/qla2x00.c lia64-2.4/drivers/scsi/qla2x00.c --- linux-2.4.18/drivers/scsi/qla2x00.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/scsi/qla2x00.c Mon Jul 23 14:12:22 2001 @@ -0,0 +1,12823 @@ +/******************************************************************************** +* QLOGIC LINUX SOFTWARE +* +* QLogic QLA2x00 device driver for Linux 2.2.x and 2.4.x +* Copyright (C) 2000 and 2001 Qlogic Corporation +* (www.qlogic.com) +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2, or (at your option) any +* later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +** +******************************************************************************/ +#define QLA2100_VERSION "4.31.7b" +/**************************************************************************** +Revision History: + Rev. 4.31.7b June 8, 2001 DG QLogic + - Fixed issue when loop id for target is changed to a different + loop id. + Rev. 4.31.6 June 1, 2001 DG QLogic + - Official 2200 firmware: v2.01.34 + - Official 2300 firmware: v3.00.24 + Rev. 4.31.5b May 30, 2001 DG QLogic + - Reset SRB_SENT flag in all isr routines. + - Fix displaying garbage when using /proc. + Rev. 4.31.3b May 15, 2001 DG QLogic + - Using test 2200 firmware: v204.01.33 + Rev. 4.31.2b May 15, 2001 DG QLogic + - Using test 2200 firmware: v203.01.33 + Rev. 4.31.1b May 15, 2001 DG QLogic + - Upgrade FC firmware to: 2200 v209.01.27 + - Changed logic to handle a topology of 4 after issuing the + "Get Host loop id". + Rev. 4.31b May 15, 2001 RL QLogic + - Added code to export PCI device info via a new ioctl function + in kernel 2.4.4. + - Redirect console messages to the OS messages file only. + - Additional fix in ioctl functions for node/port name endianess + problem. + Rev. 4.30b May 3, 2001 RL QLogic + - Moved the allocation of host database to outside of the adapter + structure allocation to avoid the allocation size limitation in the + scsi_register function. + Rev. 4.29b April 27, 2001 RL QLogic + - Fixed endianess of the node and port names read from the config + file for persistent binding entries. + Rev. 4.28b April 26, 2001 DG QLogic + - Fixed persistent binding of target devices. + Rev. 4.27 April 26, 2001 DG QLogic + - Fixed Mailbox timeout logic + - Fixed to compile on 2.4.x RedHat systems. + Rev. 4.25 March 15, 2001 DG QLogic + - released + Rev. 4.25 Beta March 9, 2001 DG QLogic + - incl new qlavendor.c file. + Rev. 4.24 Beta Test32 February 22, 2001 BN QLogic + - Added code for scanning of missing LUN to let the + SCSI layer skip it. + - Revised init_cb_t structure in qla2x00.h for the new + QLA2300 as well as QLA2200 devices. + - Changed criteria of 64/32 Bit mode of HBA + operation according to BITS_PER_LONG rather + than HBA's NVRAM setting of >4Gig memory bit; + so that the HBA auto-configures without the need + to setup each system individually. + - Merged changes for proper compile and operation in Alpha systems. + - Upgrade FC firmware to: QLA2300 v3.00.18 *new + and enabled FC Loopback test on QLA2300 HBAs. + - Add statistics counters and IOCTL support for + HBA Error Count, LIP Resets, and total ISR count. + - Changed qla2100_reinit on loop down after 4 minutes + specific to QLA2100 HBAs only. + - Added code and Makefile option to handle RISC code + download differently for ia-64 platforms than x86 or alpha. + Rev. 4.23 Beta January 12, 2001 BN QLogic + - Use cmd->sc_data_direction for setting of HBA data transfer + direction for 2.4.0 and higher kernels. + Note: Users must set the reply_len in sg_header. + For Writes and no data transfer; reply_len should + be the lenght of sg_header. + For Reads, reply_len should be the length of sg_header + plus the number of bytes to be read. + - Added check of SCSI_RESET_SUGGEST_BUS_RESET during + qla2100_reset() and perform BUS_RESET. + Also perform DEVICE_RESET on else of flag checking. + - Added new /proc/scsi/qla2x00/HbaApiNode for IOCTL interface + for 2.4.x kernels; so driver can be accessed with out need + to have at least one mapped scsi drive. + - Modified qla2100_mailbox_command's second parameter + to 32 bits for use by Loop-Back Diagnostic function + - Increase MAILBOX_REGISTER_COUNT to 32 + - Added Loop-Back Diagnostic function to qla2x00ioctl.c + for QLA2200 HBAs only. + - Order HBA detection as follows: + QLA2300, QLA2200, QLA2100. + - Changed queue_task() to queue_task_irq() in + qla2100_intr_handler() for proper usage. + - In qla2100_register_with_Linux() put check and getting + device iobase before registering of interrupt with Linux; + to help with driver loading/unloading when ramdisk is also loaded. + - Change IOCTL support to SDM_VERSION 5 in qla2x00ioctl.c + to be support SNIA HBA API 1.0 Library + - Upgrade FC firmware to: QLA2200 v2.01.27 *new + QLA2300 v3.00.17 *new + - Added copy of HBA Serial Number to /proc entry + - Added sigmask(SIGKILL) as second parameter to + siginitsetinv() function called during qla2100_do_dpc(); + so that the driver can be unloaded for 2.4.0 kernels. + Rev. 4.22 Beta November 22, 2000 BN QLogic + - Change IOCTL support to SDM_VERSION 4 in qla2x00_v4_ioctl.c + to be compatible with ln_rel-1.0Beta API library + Rev. 4.21 Beta November 15, 2000 BN QLogic + - Upgrade FC firmware to: 2100 v1.19.16 + 2200 v2.01.24 + 2300 v3.00.12 + - Merge of qla2x00 driver 2.19.16Beta changes. + - Updated qlavendor.c for vendor unique command + decoding. + Rev. 4.20 Beta October 17, 2000 BN QLogic + - QLA2300 Support added. + Rev. 4.14 Beta October 16, 2000 BN QLogic + - Added setting of higher address bits for + MBC_INITIALIZE_FIRMWARE operation. + - Release also contains newer qlavendor.c file + - Move to the new SCSI initialization scheme + and always declare the static driver_template + for kernels 2.4.0 and higher + Rev. 4.13 Beta September 21, 2000 BN QLogic + - Added "quiet" option to keep from printing LIP + occurred messages on systems that specify it. + - Added option to choose tp or ef, FC firmware + Rev. 4.12 Beta September 18, 2000 BN QLogic + - Added pci_set_master() to qla2100_pci_config + function to make sure all systems are supported + Rev. 4.11 Beta September 6, 2000 BN QLogic + - Enabled IOCTLs for external IOCTL and APIs + Rev. 4.10 Beta August 28, 2000 BN Qlogic + - Use new PCI DMA mapping APIs for 2.4.x kernel + - Added driver IOCTL support code; but disabled + it with #if 0 for next release + - Verified correct 64 bit addressing with NVRAM: + enable_64bit_addressing (>4GByte Addressing) + enabled in BIOS advanced settings option. + Rev. 4.0 July 24, 2000 BN Qlogic + - Added FC Tape Support by use of new FC Firmware + ql2100_fw.h must be v1.19.12 or greater + ql2200_fw.h must be v2.01.16 or greater + - Corrected HBA Node Name equal to zero + - Changed QLBoardTbl to QLBoardTbl_fc to avoid + double definition error with regards to qla1280 + on new 2.4.0 kernel build tools + Rev. 3.90 Beta July 21, 2000 BN Qlogic + - Added 64 bit OS and IA-64 hardware support + - Move to new major revision number + Rev. 2.22 July 14, 2000 BN Qlogic + - Updated 2100 FW to 1.19.10 + - Updated 2200 FW to 2.01.14 + - Move version to 2.22 for release to DVT + Rev. 2.19.8 July 11, 2000 DG Qlogic + - Fixed 2100 issue of login retry when no fabric is attached. + Rev. 2.19.7 July 6, 2000 DG + - Set queue depth per lun to 16 instead of throttle which is a + port max queue size and added an option "ql2xmaxqdepth=xx" + to allow user to change queue depth. This prevents us from + exceeding the adapter's throttle size which causes requests + to sit in the input queue for long periods of time. + Rev. 2.19.6 June 28, 2000 DG Qlogic + - GA release + - Fixed panic in putq_t routine when called from abort. + Rev. 2.19.5b7 June 27, 2000 DG + - Add logic to wait reset delay if no fabric devices are found. + Rev. 2.19.5b6 June 26, 2000 DG + - Fixed Fw ready issue. + - Clear sent flag in SRB, so we will abort commands in Lun + queue that were previously sent. + - Flush input queue when an isp_abort occurs. + Rev. 2.19.5b5 June 16, 2000 DG + - Fixed issue of not holding off request if multiple RSCN or + PORT updates occur while process the currect RSCN. + Rev. 2.19.5b4 June 16, 2000 DG + - Added lock for done_q to prevent losing requests in timer. + Rev. 2.19.5b3 June 16, 2000 DG + - Added routine to set the correct direction for vendor specific + commands. Set the new option "QLA_SCSI_VENDOR_DIR". + - Fixed issue of retrying continuously on a Missing SCSI device. + - Fixed multiple adapter issue. Only login into adapter node + once and never again. + - Change code not to use loop id 0 for Fabric nodes. + Rev. 2.19.5b2 June 15, 2000 DG + - Added code to reset port down count on good requests. + Rev. 2.19.5 June 8, 2000 DG + - Added code to display the connection type F, FL, or N. + - Reaarange code in DPC routine to put "retry login" + further down in the routine and skip is loop is down. + - Check the returned status after GAN (qla2100_sns_device) + and retry on ISP TX timeout (0x4005). + Rev. 2.19.4 June 6, 2000 DG + - Fixed for panic that occurs when system is shutdown. + Rev. 2.19.3 June 5, 2000 DG + - Fixed retry logic for user configured targets. + Rev. 2.19.2 May 31, 2000 DG + - Remove spinlock in qla2100_timer. + - Change the jiffies timer to loop timer in fw_ready. + Rev. 2.19.1 May 6, 2000 DG + - Change risc code 2200 from 2.1.12 to 2.1.13 to correct issue + of getting mailbox timeouts. + - Change mailbox timer to get correct timeout. + - Added qla2100_cmd_wait to wait for outstanding commands to + complete before querying the name server after a LIP. + Rev. 2.19 May 6, 2000 DG + - Fixed mailbox timeout recovery logic. + Rev. 2.18 May 1, 2000 DG + - Changes from Fabric testing + Rev. 2.18b4 Apr 21, 2000 DG + - Fixed login retry count to retry count. + - If the loop is down for more than 4 minutes then restart + queues and reset adpater if enabled. + - In qla2100_queuecommand we no longer return new requests + immediately back to kernel when loop is down. This causes + SYSTEM to HANG when a lot of requests are outstanding. We + now put them in the done queue and let the DPC routine + return them to kernel. + - Fixed panic cause by changing the timeout value of new request + when the loop is down. + - Cleanup qla2100_next. + Rev. 2.18b3 Apr 18, 2000 DG + - After the GAN, check returned status in resp buffer. + Rev. 2.18b2 Apr 12, 2000 DG + - Added handling of firmware bug when we use connection mode + 1 (P2P). The firmware tries to change to loop mode after + encountering some IO failures/resets. + - Added logic to reset all modules during a chip reset. + - After the GAN, if we lost devices or have a device that was + configured by the user then retry the login. This is a + work-a-round for Brocade switches. It sometimes does + not return all the devices in the port list. + Rev. 2.18b1 Apr 1, 2000 DG + - Added logic to ignore device types other than FL/F + from gan list. Mcdata switch returns a bogus port of + type 85 in the list. + - Added firmware 2.1.11 to fix issues with reusing loop ids. + Rev. 2.17 Mar 21, 2000 DG + - Fixed mailbox timeout timer. + - Added counters to record timeouts and aborts. + Rev. 2.16 Mar 8, 2000 DG + - Fixed Profiling code to reduced output of inactive devices. + - Fixed driver name in "/proc/scsi/qla2x00" instead of "qla". + - Fixed extended timeout value for loop down retries. + - Fixed code that search for target binding in command line to search + for all occurences instead of the first four. + - Disable the reinit of adapter when the LOOP is DOWN + for more than 4 minutes. It can be enabled with the command + line option "reinit_on_loopdown". + - Fixed issue of not setting HBA instance number before + calling HBA initialized. + Rev. 2.15 Feb 19, 2000 DG + - Fixed 2100 issue of driver not seeing storage when switch is connected + to loop. + Rev. 2.14 Feb 11, 2000 DG + - Added new logic to accept persistent binding information from the command line. + - Modified command parser to handle properties on the command line after + the regular options. + Rev. 2.13 Jan 27, 2000 TT + - Modify to use makefile parameter "IP=1" to enanle IP support. + - Fix SNS mailbox cmd parameter in qla2x00_register_ip_device. + - Reverse byte order on ha->port_id to match NT and fix compare bugs. + Rev. 2.12 Jan 26, 2000 TT+DG + - Updated Qlogic Linux sofware license. + - Added IP support for qla2xip driver. + - Fix host adapter structure initialization in qla2100_detect. + - Fix port name byte order in qla2100_update_fc_db. + - Fix the issue of not returning "NO_CONNECT" back to the user + when the loop is down after the loop down timer has expired. + - Added option QLA2100_EXT_TIMEOUT to extend timeout of each command. + default if OFF. + - Change device high water mark (hiwat) to execution throttle. + Rev. 2.11 Dec 8, 1999 DG + - Added Qlogic Linux sofware license. + Rev. 2.10 Oct 31, 1999 DG + - Fixed issue of not releasing requests if port is down (DPC issue). + - Ignore BIOS setting for MAX number of luns unless USE_BIOS_MAX_LUNS + is set. +*****************************************************************************/ + +/* +* Compile time Options: +* 0 - Disable and 1 - Enable +*/ +#define QL2100_TARGET_MODE_SUPPORT 0 /* Target mode support */ +#define MEMORY_MAPPED_IO 0 +#define DEBUG_QLA2100_INTR 0 +#define USE_NVRAM_DEFAULTS 0 +#define DEBUG_PRINT_NVRAM 0 +#define LOADING_RISC_ACTIVITY 0 +#define AUTO_ESCALATE_RESET 0 /* Automatically escalate resets */ +#define AUTO_ESCALATE_ABORT 0 /* Automatically escalate aborts */ +#define STOP_ON_ERROR 0 /* Stop on aborts and resets */ +#define STOP_ON_RESET 0 +#define STOP_ON_ABORT 0 +#define QLA2100_COMTRACE 0 /* One char tracing */ +#define WATCH_THREADS_SIZ 0 /* watch size of pending queue */ +#define USE_PORTNAME 1 /* option to use port names for targets */ +#define QLA2100_EXT_TIMEOUT 0 /* Extend timeout for commands up to 1 min*/ +#define LUN_MASKING 0 +#define USE_FLASH 0 +#define QLA2100_PROFILE 1 +#define QLA_SCSI_VENDOR_DIR 0 /* Decode vendor specific opcodes for direction */ +#define QLA2100_LIPTEST 0 +#define REQ_TRACE 1 + +#undef TRACECODE /* include tracing code in watchdog routines */ +#define CHECK_BINDING + +#define DEBUG_QLA2100 0 /* For Debug of qla2x00 */ +#define DEBUG_GET_FW_DUMP 0 /* also set DEBUG_QLA2100 and + use COM1 and capture it */ +#define USE_TP_FW 1 /* use tp or ef firmware */ + +/* The following WORD_FW_LOAD is defined in Makefile for ia-64 builds + and can also be decommented here for Word by Word confirmation of + RISC code download operation */ +/* #define WORD_FW_LOAD 0 */ + +/* +* String arrays +*/ +#define LINESIZE 256 +#define MAXARGS 26 + +/* +* Include files +*/ +#include +#ifdef MODULE +#include +#endif + +#ifndef LINUX_VERSION_CODE +#include +#endif /* LINUX_VERSION_CODE not defined */ + +static int num_hosts; /* ioctl related */ +static int apiHBAInstance = 0; /* ioctl related keeps track of API HBA Instance */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#ifndef KERNEL_VERSION +# define KERNEL_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z)) +#endif + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,18) +#define APIDEV 1 +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) +#include +# include +#else +/*#include */ + +#define __KERNEL_SYSCALLS__ + +#include +#include + +#include +#define SHUTDOWN_SIGS (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGTERM)) +#endif +#include "sd.h" +#include "scsi.h" +#include "hosts.h" + +#ifdef FC_IP_SUPPORT +#include +#include "qlcommon.h" +#endif + +#include "qla2x00.h" +#define UNIQUE_FW_NAME /* unique F/W array names */ +#ifdef UNIQUE_FW_NAME +#include "ql2100_fw.h" /* ISP RISC code */ +#ifdef FC_IP_SUPPORT +#include "ql2200ip_fw.h" /* ISP RISC 2200 code */ +#include "ql2300ip_fw.h" /* ISP RISC 2300 code */ +#else +#include "ql2200_fw.h" /* ISP RISC 2200 code */ +#include "ql2300_fw.h" /* ISP RISC 2300 code */ +#endif +#else +#include "isp_fw.h" /* ISP RISC code */ +#include "isp1_fw.h" /* ISP RISC 2200 code */ +#endif +#include +#include + + +#define BZERO(ptr, amt) memset((void *)(ptr), 0, amt) +#define BCMP(s1, s2, amt) memcmp((void *)(s1), (void *)(s2), amt) +#define BCOPY(src, dst, amt) memcpy((void *)(dst), (void *)(src), amt) +#define KMALLOC(siz) kmalloc((siz), GFP_ATOMIC | GFP_DMA) +#define KMFREE(ip,siz) kfree((ip)) +#define SYS_DELAY(x) udelay(x);barrier() +#define QLA2100_DELAY(sec) mdelay(sec * HZ) + +/* 4.10 */ +#if BITS_PER_LONG > 32 +#define pci_dma_lo32(a) (a & 0xffffffff) +#define pci_dma_hi32(a) ((a >> 32) & 0xffffffff) +#else +#define pci_dma_lo32(a) (a & 0xffffffff) +#define pci_dma_hi32(a) 0 +#endif + +#define VIRT_TO_BUS(a) virt_to_bus((a)) + +#if BITS_PER_LONG <= 32 +#define VIRT_TO_BUS_LOW(a) (uint32_t)virt_to_bus(((void *)a)) +#define VIRT_TO_BUS_HIGH(a) (uint32_t)(0x0) +#else +#define VIRT_TO_BUS_LOW(a) (uint32_t)(0xffffffff & virt_to_bus((void *)(a))) +#define VIRT_TO_BUS_HIGH(a) (uint32_t)(0xffffffff & (virt_to_bus((void *)(a))>>32)) +#endif + +#define CACHE_FLUSH(a) (RD_REG_WORD(a)) +#define INVALID_HANDLE (MAX_OUTSTANDING_COMMANDS+1) + +#define STATIC + +#if BITS_PER_LONG <= 32 +#define LS_64BITS(x) (uint32_t)((unsigned long)x) +#define MS_64BITS(x) (uint32_t)((unsigned long) 0x0) +#else +#define LS_64BITS(x) (uint32_t)(0xffffffff & ((unsigned long)x)) +#define MS_64BITS(x) (uint32_t)(0xffffffff & (((unsigned long)x)>>32) ) +#endif + +#if BITS_PER_LONG <= 32 +#define MSB(x) (uint8_t)(((uint16_t)(x) >> 8) & 0xff) +#define LSB(x) (uint8_t)(x & 0xff) +#define MSW(x) (uint16_t)(((uint32_t)(x) >> 16) & 0xffff) +#define LSW(x) (uint16_t)(x & 0xffff) +#define QL21_64BITS_3RDWD(x) ((uint16_t) 0) +#define QL21_64BITS_4THWD(x) ((uint16_t) 0) +#else +#define MSB(x) (uint8_t)(((uint16_t)(x) >> 8) & 0xff) +#define LSB(x) (uint8_t)(x & 0xff) +#define MSW(x) (uint16_t)(((uint32_t)(x) >> 16) & 0xffff) +#define LSW(x) (uint16_t)(x & 0xffff) +#define QL21_64BITS_3RDWD(x) ((uint16_t) (x >> 32) & 0xffff) +#define QL21_64BITS_4THWD(x) ((uint16_t) (x >> 48) & 0xffff) +#endif + +#define OFFSET(w) (((u_long) &w) & 0xFFFF) /* 256 byte offsets */ +#define SCSI_BUS_32(scp) ((scp)->channel) +#define SCSI_TCN_32(scp) ((scp)->target) +#define SCSI_LUN_32(scp) ((scp)->lun) + +/* +* TIMER MACROS +*/ +#define QLA2100_TIMER_LOCK(ap) spin_lock_irqsave(&(ap)->retry_lock, cpu_flags); +#define QLA2100_TIMER_UNLOCK(ap) spin_unlock_irqrestore(&(ap)->retry_lock, cpu_flags); + + +#define WATCH_INTERVAL 1 /* number of seconds */ +#define START_TIMER(f, h, w) \ +{ \ +init_timer(&(h)->timer); \ +(h)->timer.expires = jiffies + w * HZ;\ +(h)->timer.data = (unsigned long) h; \ +(h)->timer.function = (void (*)(unsigned long))f; \ +(h)->flags.start_timer = FALSE; \ +add_timer(&(h)->timer); \ +(h)->timer_active = 1;\ +} + +#define RESTART_TIMER(f, h, w) \ +{ \ +(h)->timer.expires = jiffies + w * HZ;\ +(h)->flags.start_timer = FALSE; \ +add_timer(&(h)->timer); \ +} + +#define STOP_TIMER(f, h) \ +{ \ +del_timer(&(h)->timer); \ +(h)->timer_active = 0;\ +} + +#define NVRAM_DELAY() udelay(500) /* 2 microsecond delay */ + +typedef unsigned long paddr32_t; + +/* +* Qlogic Driver support Function Prototypes. +*/ +STATIC uint8_t qla2100_register_with_Linux(scsi_qla_host_t *ha, uint8_t maxchannels); +STATIC void qla2100_done(scsi_qla_host_t *, srb_t **, srb_t **), +qla2100_next(scsi_qla_host_t *, scsi_lu_t *), +qla2100_select_queue_depth(struct Scsi_Host *, Scsi_Device *); + +STATIC void qla2100_done_q_put(scsi_qla_host_t *, srb_t *, srb_t **, srb_t **), +qla2100_putq_b(scsi_lu_t *, srb_t *), +qla2100_putq_t(scsi_lu_t *, srb_t *), +qla2100_removeq(scsi_lu_t *, srb_t *), +qla2100_timer(scsi_qla_host_t *), +qla2100_timeout_insert(scsi_qla_host_t *, srb_t *), +qla2100_timeout_remove(scsi_qla_host_t *, srb_t *); + +STATIC uint8_t qla2100_mem_alloc(scsi_qla_host_t *); + +static void qla2100_dump_regs(struct Scsi_Host *host); +#if STOP_ON_ERROR +static void qla2100_panic(char *, struct Scsi_Host *host); +#endif +void qla2100_print_scsi_cmd(Scsi_Cmnd *cmd); +STATIC void qla2100_abort_queue_single(scsi_qla_host_t *,uint32_t,uint32_t,uint32_t,uint32_t); + +STATIC int qla2100_return_status(scsi_qla_host_t *ha, sts_entry_t *sts, Scsi_Cmnd *cp); +STATIC void qla2100_removeq(scsi_lu_t *q, srb_t *sp); +STATIC void qla2100_mem_free(scsi_qla_host_t *ha); +void qla2100_do_dpc(void *p); + +static inline void qla2100_callback(scsi_qla_host_t *ha, srb_t *sp, uint8_t dec), +qla2100_tgt_dealloc(scsi_qla_host_t *, tgt_t *), +qla2100_lun_dealloc(scsi_lu_t *); +static inline tgt_t *qla2100_tgt_alloc(scsi_qla_host_t *); +static inline scsi_lu_t *qla2100_lun_alloc(void); + +static inline void qla2100_enable_intrs(scsi_qla_host_t *); +static inline void qla2100_disable_intrs(scsi_qla_host_t *); +#if QLA2100_EXT_TIMEOUT +static void qla2100_extend_timeout(Scsi_Cmnd *cmd, int timeout); +#endif +static int qla2100_get_tokens(char *line, char **argv, int maxargs ); + +/* +* QLogic ISP2100 Hardware Support Function Prototypes. +*/ +STATIC uint8_t qla2100_initialize_adapter(scsi_qla_host_t *), +qla2100_isp_firmware(scsi_qla_host_t *), +qla2100_pci_config(scsi_qla_host_t *), +qla2100_set_cache_line(scsi_qla_host_t *), +qla2100_chip_diag(scsi_qla_host_t *), +qla2100_setup_chip(scsi_qla_host_t *), +qla2100_init_rings(scsi_qla_host_t *), +qla2100_fw_ready(scsi_qla_host_t *), +qla2100_nvram_config(scsi_qla_host_t *), +qla2200_nvram_config(scsi_qla_host_t *), +qla2100_mailbox_command(scsi_qla_host_t *, uint32_t, uint16_t *), +qla2100_update_device_data(scsi_qla_host_t *, device_data_t *, u_char), +qla2100_sns_device(scsi_qla_host_t *, u_char), +qla2100_update_fc_db(scsi_qla_host_t *, u_char), +qla2100_map_targets(scsi_qla_host_t *), +#if USE_FLASH +qla2100_get_database(scsi_qla_host_t *), +qla2100_save_database(scsi_qla_host_t *), +qla2100_program_flash_address(scsi_qla_host_t *, uint32_t, u_char), +qla2100_erase_flash_sector(scsi_qla_host_t *, uint32_t), +qla2100_poll_flash(scsi_qla_host_t *, uint32_t, u_char), +#endif +qla2100_loop_reset(scsi_qla_host_t *), +qla2100_device_reset(scsi_qla_host_t *, uint32_t, uint32_t), +qla2100_abort_device(scsi_qla_host_t *, uint32_t, uint32_t, uint32_t), +qla2100_abort_command(scsi_qla_host_t *, srb_t *), +qla2100_64bit_start_scsi(scsi_qla_host_t *, srb_t *), +qla2100_32bit_start_scsi(scsi_qla_host_t *, srb_t *), +qla2100_abort_isp(scsi_qla_host_t *), +qla2100_loop_resync(scsi_qla_host_t *); +STATIC uint8_t qla2100_cmd_wait(scsi_qla_host_t *ha); + +STATIC void qla2100_nv_write(scsi_qla_host_t *, uint16_t), +qla2100_nv_delay(void), +qla2100_poll(scsi_qla_host_t *), +qla2100_init_fc_db(scsi_qla_host_t *), +qla2100_init_tgt_map(scsi_qla_host_t *), +#if USE_FLASH +qla2100_flash_enable(scsi_qla_host_t *), +qla2100_flash_disable(scsi_qla_host_t *), +qla2100_write_flash_byte(scsi_qla_host_t *, uint32_t, u_char), +#endif +qla2100_reset_adapter(scsi_qla_host_t *), +qla2100_marker(scsi_qla_host_t *, uint32_t, uint32_t, uint32_t, +u_char), +qla2100_enable_lun(scsi_qla_host_t *), +qla2100_notify_ack(scsi_qla_host_t *, notify_entry_t *), +qla2100_64bit_continue_io(scsi_qla_host_t *, atio_entry_t *, + uint32_t, u_long *), +qla2100_32bit_continue_io(scsi_qla_host_t *, atio_entry_t *, + uint32_t, u_long *), +qla2100_isp_cmd(scsi_qla_host_t *), +qla2100_isr(scsi_qla_host_t *, srb_t **, srb_t **), +qla2100_rst_aen(scsi_qla_host_t *), +qla2100_atio_entry(scsi_qla_host_t *, atio_entry_t *), +qla2100_status_entry(scsi_qla_host_t *, sts_entry_t *, srb_t **, +srb_t **), +qla2100_error_entry(scsi_qla_host_t *, response_t *, srb_t **, +srb_t **), +qla2100_restart_queues(scsi_qla_host_t *, uint8_t), +qla2100_restart_watchdog_queue(scsi_qla_host_t *), +qla2100_abort_queues(scsi_qla_host_t *, uint8_t); + +STATIC uint16_t qla2100_get_nvram_word(scsi_qla_host_t *, uint32_t), +qla2100_nvram_request(scsi_qla_host_t *, uint32_t), +qla2100_read_flash_byte(scsi_qla_host_t *, uint32_t), +qla2100_debounce_register(volatile uint16_t *); + +STATIC request_t *qla2100_req_pkt(scsi_qla_host_t *); +STATIC request_t *qla2100_ms_req_pkt(scsi_qla_host_t *, srb_t *); +uint8_t qla2100_update_config(scsi_qla_host_t *ha); +STATIC uint8_t qla2100_configure_hba(scsi_qla_host_t *ha); +STATIC uint8_t qla2100_configure_loop(scsi_qla_host_t *ha, uint8_t ); +STATIC void qla2100_reset_chip(scsi_qla_host_t *ha); +#if QL2100_TARGET_MODE_SUPPORT +qla2100_enable_lun(scsi_qla_host_t *, uint8_t, uint32_t), +qla2100_notify_ack(scsi_qla_host_t *, notify_entry_t *), +qla2100_immed_notify(scsi_qla_host_t *, notify_entry_t *), +qla2100_accept_io(scsi_qla_host_t *, ctio_ret_entry_t *), +qla2100_64bit_continue_io(scsi_qla_host_t *, atio_entry_t *, uint32_t, + u_long *), +qla2100_32bit_continue_io(scsi_qla_host_t *, atio_entry_t *, uint32_t, + u_long *), +qla2100_atio_entry(scsi_qla_host_t *, atio_entry_t *), +qla2100_notify_entry(scsi_qla_host_t *, notify_entry_t *), + +#endif /* QLA2100_TARGET_MODE_SUPPORT */ +STATIC uint8_t qla2100_sns_get_name( scsi_qla_host_t *ha, device_data_t *device, uint8_t flag ); +STATIC void qla2100_display_fc_names(scsi_qla_host_t *ha); +void ql2100_dump_requests(scsi_qla_host_t *ha); +static void qla2100_get_properties(scsi_qla_host_t *ha, char *string); +STATIC uint8_t qla2100_find_propname(scsi_qla_host_t *ha, char *propname, char *propstr, char *db); +static int qla2100_get_prop_16chars(scsi_qla_host_t *ha, char *propname, char *propval, char *cmdline); +static char *qla2100_get_line(char *str, char *line); +void qla2100_check_fabric_devices(scsi_qla_host_t *ha); + +#ifdef FC_IP_SUPPORT + +/* Entry points for IP network driver */ +int qla2x00_ip_inquiry(uint16_t wAdapterNumber, BD_INQUIRY_DATA *pInquiryData); +int qla2x00_ip_enable(scsi_qla_host_t *ha, BD_ENABLE_DATA *pEnableData); +void qla2x00_ip_disable(scsi_qla_host_t *ha); +void qla2x00_add_buffers(scsi_qla_host_t *ha, uint16_t wBufferCount); +int qla2x00_send_packet(scsi_qla_host_t *ha, SEND_CB *pSendCB); + +static int qla2x00_ip_initialize(scsi_qla_host_t *ha); +static int qla2x00_add_new_ip_device(scsi_qla_host_t *ha, +uint16_t wLoopId, +uint8_t *pPortId, +uint8_t *pPortName, +int bForceAdd); +static int qla2x00_convert_to_arp(scsi_qla_host_t *ha, SEND_CB *pSendCB); +static void qla2x00_free_ip_block(scsi_qla_host_t *ha, +IP_DEVICE_BLOCK *pIpDevice); +static int qla2x00_get_ip_loopid(scsi_qla_host_t *ha, +uint8_t *pNodeName, +uint8_t *pLoopId); +static int qla2x00_send_farp_request(scsi_qla_host_t *ha, +uint8_t *pPortName); +static int qla2x00_register_ip_device(scsi_qla_host_t *ha); +static int qla2x00_reserve_ip_block(scsi_qla_host_t *ha, +PIP_DEVICE_BLOCK *pIpDevBlk); +static int qla2x00_update_ip_device_data(scsi_qla_host_t *ha, +device_data_t *pDeviceData); +static int qla2x00_reserve_loopid(scsi_qla_host_t *ha, uint16_t *pLoopId); +static void qla2x00_free_loopid(scsi_qla_host_t *ha, uint16_t wLoopId); +static int qla2x00_login_public_device(scsi_qla_host_t *ha, +uint16_t *pLoopId, +uint8_t *pPortID, +uint16_t wOptions); +static int qla2x00_logout_public_device(scsi_qla_host_t *ha, +uint16_t wLoopId, +uint16_t wOptions); +#else +/* v2.19.8 */ +static int qla2x00_login_public_device(scsi_qla_host_t *ha, +uint16_t *pLoopId, +uint8_t *pPortID, +uint16_t wOptions); +static int qla2x00_reserve_loopid(scsi_qla_host_t *ha, uint16_t *pLoopId); +static void qla2x00_free_loopid(scsi_qla_host_t *ha, uint16_t wLoopId); +#endif + +#if APIDEV +static int apidev_init(struct Scsi_Host*); +static int apidev_cleanup(void); +#endif + +void qla2100_print_q_info(scsi_lu_t *q); + +#if DEBUG_QLA2100 +#ifndef QL_DEBUG_ROUTINES +#define QL_DEBUG_ROUTINES +#endif +#endif +#ifdef QL_DEBUG_ROUTINES +/* +* Driver Debug Function Prototypes. +*/ +STATIC uint8_t qla2100_getbyte(uint8_t *); +STATIC uint16_t qla2100_getword(uint16_t *); +STATIC uint32_t qla2100_getdword(uint32_t *); +STATIC void qla2100_putbyte(uint8_t *, uint8_t), +qla2100_putword(uint16_t *, uint16_t), +qla2100_putdword(uint32_t *, uint32_t), +qla2100_print(int8_t *), +qla2100_output_number(u_long, uint8_t), +qla2100_putc(int8_t); +#endif +#if DEBUG_GET_FW_DUMP +STATIC void qla2300_dump_isp(scsi_qla_host_t *ha), +qla2100_dump_word(uint8_t *, uint32_t, uint32_t); +#endif + +/* Debug print buffer */ +char debug_buff[LINESIZE]; +#if DEBUG_QLA2100 +STATIC uint8_t ql2x_debug_print = 1; +#else +STATIC uint8_t ql2x_debug_print = 0; +#endif + +/* +* insmod needs to find the variable and make it point to something +*/ +static char *ql2xdevconf = NULL; +static int ql2xretrycount = 8; +#ifdef MODULE +static char *ql2xopts = NULL; +static int ql2xmaxqdepth = 0; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,18) + +/* insmod qla2100 ql2xopts=verbose" */ +MODULE_PARM(ql2xopts, "s"); +MODULE_PARM(ql2xmaxqdepth, "i"); +#endif +/* +* Just in case someone uses commas to separate items on the insmod +* command line, we define a dummy buffer here to avoid having insmod +* write wild stuff into our code segment +*/ +static char dummy_buffer[60] = "Please don't add commas in your insmod command!!\n"; + +#endif + +/* +* Macros to change names of OS remapping routines. +*/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) +#define ioremap vremap +#define iounmap vfree +#endif + + +/* +* This is the pointer to the /proc/scsi/qla2100 code. +* access the driver. +*/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) +#if CONFIG_PROC_FS +/* this definition is normally in proc_fs.h PROC_SCSI_QL2100 */ +#define PROC_SCSI_QL2100 PROC_SCSI_QLOGICISP + +struct proc_dir_entry proc_scsi_qla2100 = { +PROC_SCSI_QL2100, 7, "qla2x00", +S_IFDIR | S_IRUGO | S_IXUGO, 2, +0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL +}; +#endif +#endif +static int qla2100_lip = 0; + +#include +#include + +/* multi-OS QLOGIC IOCTL definition file */ +#include "qla2x00exioct.h" + + +#if QLA_SCSI_VENDOR_DIR +/* Include routine to set direction for vendor specific commands */ +#include "qlavendor.c" +#endif +/*********************************************************************** +* We use the Scsi_Pointer structure that's included with each command +* SCSI_Cmnd as a scratchpad for our SRB. This allows us to accept +* an unlimited number of commands. +* +* SCp will always point to the SRB structure (defined in qla2100.h). +* It is defined as follows: +* - SCp.ptr -- > pointer back to the cmd +* - SCp.this_residual --> used as forward pointer to next srb +* - SCp.buffer --> used as backward pointer to next srb +* - SCp.buffers_residual --> used as flags field +* - SCp.have_data_in --> not used +* - SCp.sent_command --> not used +* - SCp.phase --> not used +***********************************************************************/ +#define CMD_SP(Cmnd) (&(Cmnd)->SCp) +#define CMD_XFRLEN(Cmnd) (Cmnd)->request_bufflen +#define CMD_CDBLEN(Cmnd) (Cmnd)->cmd_len +#define CMD_CDBP(Cmnd) (Cmnd)->cmnd +#define CMD_SNSP(Cmnd) (Cmnd)->sense_buffer +#define CMD_SNSLEN(Cmnd) (sizeof (Cmnd)->sense_buffer) +#define CMD_RESULT(Cmnd) ((Cmnd)->result) +#define CMD_HANDLE(Cmnd) ((Cmnd)->host_scribble) +#define CMD_TIMEOUT(Cmnd) ((Cmnd)->timeout_per_command) + +#define DID_RETRY DID_ERROR + + +/* +* Macros use for debugging the driver. +*/ +#ifdef QL_DEBUG_LEVEL_3 +#define ENTER(x) sprintf(debug_buff,"qla2100 : Entering %s()\n\r", x); \ +qla2100_print(debug_buff); +#define LEAVE(x) sprintf(debug_buff,"qla2100 : Leaving %s()\n\r", x); \ +qla2100_print(debug_buff); +#define ENTER_INTR(x) sprintf(debug_buff,"qla2100 : Entering %s()\n\r", x); \ +qla2100_print(debug_buff); +#define LEAVE_INTR(x) sprintf(debug_buff,"qla2100 : Leaving %s()\n\r", x); \ +qla2100_print(debug_buff); +#define DEBUG3(x) x +#else +#define ENTER(x) +#define LEAVE(x) +#define ENTER_INTR(x) +#define LEAVE_INTR(x) +#define DEBUG3(x) +#endif + +#if QLA2100_COMTRACE +#define COMTRACE(x) qla2100_putc(x); +#else +#define COMTRACE(x) +#endif + +#if DEBUG_QLA2100 +#define DEBUG(x) x +#define DEBUG4(x) +#else +#define DEBUG(x) +#define DEBUG4(x) +#endif + +#ifdef QL_DEBUG_LEVEL_2 +#define DEBUG2(x) x +#else +#define DEBUG2(x) +#endif +#ifdef QL_DEBUG_LEVEL_5 +#define DEBUG5(x) x +#else +#define DEBUG5(x) +#endif + +uint8_t copyright[48] = "Copyright 1999-2001, Qlogic Corporation"; + +/****************************************************************************/ +/* LINUX - Loadable Module Functions. */ +/****************************************************************************/ + +/*****************************************/ +/* ISP Boards supported by this driver */ +/*****************************************/ +#define QLA2100_VENDOR_ID 0x1077 +#define QLA2100_DEVICE_ID 0x2100 +#define QLA2200_DEVICE_ID 0x2200 +#define QLA2200A_DEVICE_ID 0x2200A +#define QLA2300_DEVICE_ID 0x2300 +#define QLA2200A_RISC_ROM_VER 4 + +#define NUM_OF_ISP_DEVICES 4 + +typedef struct _qlaboards +{ +unsigned char bdName[9]; /* Board ID String */ +unsigned long device_id; /* Device ID */ +int numPorts; /* number of loops on adapter */ +unsigned short *fwcode; /* pointer to FW array */ +unsigned long *fwlen; /* number of words in array */ +unsigned short *fwstart; /* start address for F/W */ +unsigned char *fwver; /* Ptr to F/W version array */ +} qla_boards_t; + + +#if USE_TP_FW +struct _qlaboards QLBoardTbl_fc[NUM_OF_ISP_DEVICES] = +{ +/* Name , Board PCI Device ID, Number of ports */ +{"QLA2300 ", QLA2300_DEVICE_ID, MAX_BUSES, +#ifdef FC_IP_SUPPORT +&fw2300ip_code01[0], (unsigned long *)&fw2300ip_length01, &fw2300ip_addr01, &fw2300ip_version_str[0] }, +#else +&fw2300tp_code01[0], (unsigned long *)&fw2300tp_length01, &fw2300tp_addr01, &fw2300tp_version_str[0] }, +#endif +{"QLA2200 ", QLA2200_DEVICE_ID, MAX_BUSES, +#ifdef FC_IP_SUPPORT +&fw2200ip_code01[0], (unsigned long *)&fw2200ip_length01, &fw2200ip_addr01, &fw2200ip_version_str[0] }, +#else +&fw2200tp_code01[0], (unsigned long *)&fw2200tp_length01, &fw2200tp_addr01, &fw2200tp_version_str[0] }, +#endif +{"QLA2100 ", QLA2100_DEVICE_ID, MAX_BUSES, +&fw2100tp_code01[0], (unsigned long *)&fw2100tp_length01,&fw2100tp_addr01, &fw2100tp_version_str[0] }, +{" ", 0, 0} +}; + +#else /* USE_TP_FW */ + +struct _qlaboards QLBoardTbl_fc[NUM_OF_ISP_DEVICES] = +{ +/* Name , Board PCI Device ID, Number of ports */ +{"QLA2300 ", QLA2300_DEVICE_ID, MAX_BUSES, +#ifdef FC_IP_SUPPORT +&fw2300ip_code01[0], (unsigned long *)&fw2300ip_length01, &fw2300ip_addr01, &fw2300ip_version_str[0] }, +#else +&fw2300ef_code01[0], (unsigned long *)&fw2300ef_length01, &fw2300ef_addr01, &fw2300ef_version_str[0] }, +#endif +{"QLA2200 ", QLA2200_DEVICE_ID, MAX_BUSES, +#ifdef FC_IP_SUPPORT +&fw2200ip_code01[0], (unsigned long *)&fw2200ip_length01, &fw2200ip_addr01, &fw2200ip_version_str[0] }, +#else +&fw2200ef_code01[0], (unsigned long *)&fw2200ef_length01, &fw2200ef_addr01, &fw2200ef_version_str[0] }, +#endif +{"QLA2100 ", QLA2100_DEVICE_ID, MAX_BUSES, +&fw2100ef_code01[0], (unsigned long *)&fw2100ef_length01,&fw2100ef_addr01, &fw2100ef_version_str[0] }, +{" ", 0, 0} +}; +#endif /* USE_TP_FW */ + +/* +* Stat info +*/ +static struct _qla2100stats { +unsigned long mboxtout; /* mailbox timeouts */ +unsigned long mboxerr; /* mailbox errors */ +unsigned long ispAbort; /* ISP aborts */ +unsigned long debugNo; +unsigned long loop_resync; +unsigned long outarray_full; +unsigned long retry_q_cnt; +unsigned long done_q_cnt; +scsi_qla_host_t *irqhba; +} qla2100_stats; + +/* +* Command line options +*/ +static unsigned long qla2100_verbose = 1L; +static unsigned long qla2100_quiet = 0L; +static unsigned long qla2100_reinit = 1L; +static unsigned long qla2100_req_dmp = 0L; +static scsi_qla_host_t *qla2100_hostlist = NULL; + +#ifdef QLA2100_PROFILE +static int qla2100_buffer_size = 0; +static char *qla2100_buffer = NULL; +#endif + +#include +#include +#include + +/************************************************************************* +* qla2100_set_info +* +* Description: +* Set parameters for the driver from the /proc filesystem. +* +* Returns: +*************************************************************************/ +int +qla2100_set_info(char *buffer, int length, struct Scsi_Host *HBAptr) { + return (-ENOSYS); /* Currently this is a no-op */ +} + + +#include "qla2x00ioctl.c" + + +/************************************************************************* +* qla2100_proc_info +* +* Description: +* Return information to handle /proc support for the driver. +* +* inout : decides on the direction of the dataflow and the meaning of the +* variables +* buffer: If inout==FALSE data is being written to it else read from it +* (ptrs to a page buffer) +* *start: If inout==FALSE start of the valid data in the buffer +* offset: If inout==FALSE offset from the beginning of the imaginary file +* from which we start writing into the buffer +* length: If inout==FALSE max number of bytes to be written into the buffer +* else number of bytes in the buffer +* Returns: +*************************************************************************/ +#define PROC_BUF (&qla2100_buffer[len]) +int +qla2100_proc_info( char *buffer, char **start, off_t offset, int length, +int hostno, int inout) { +#if QLA2100_PROFILE + struct Scsi_Host *host; + scsi_qla_host_t *ha; + int size = 0; + scsi_lu_t *up; + int len = 0; + qla_boards_t *bdp; + uint32_t t, l; + +#if REQ_TRACE + Scsi_Cmnd *cp; + srb_t *sp; + int i; +#endif + + DEBUG5(printk("Entering proc_info 0x%x,0x%lx,0x%x,0x%x\n",(int)buffer,offset,length,hostno);) + host = NULL; + + /* Find the host that was specified */ + for( ha=qla2100_hostlist; (ha != NULL) && ha->host->host_no != hostno; ha=ha->next ) + ; + + /* if host wasn't found then exit */ + if( !ha ) { + size = sprintf(buffer, "Can't find adapter for host number %d\n", hostno); + if( size > length ) { + return (size); + } else { + return (0); + } + } + + host = ha->host; + + if( inout == TRUE ) /* Has data been written to the file? */ + { + printk(KERN_INFO "qla2100_proc: has data been written to the file. \n"); + return (qla2100_set_info(buffer, length, host)); + } + + + /* + * if our old buffer is the right size use it otherwise + * allocate a new one. + */ + size = 4096; /* get a page */ + if( qla2100_buffer_size != size ) { + /* deallocate this buffer and get a new one */ + if( qla2100_buffer != NULL ) { + kfree(qla2100_buffer); + qla2100_buffer_size = 0; + } + qla2100_buffer = kmalloc(size, GFP_KERNEL); + } + if( qla2100_buffer == NULL ) { + size = sprintf(buffer, "qla2100 - kmalloc error at line %d\n", + __LINE__); + return size; + } + /* save the size of our buffer */ + qla2100_buffer_size = size; + + /* start building the print buffer */ + bdp = &QLBoardTbl_fc[ha->devnum]; + qla2100_lip = 1; + size = sprintf(PROC_BUF, + "QLogic PCI to Fibre Channel Host Adapter for ISP2100/ISP2200/ISP2300:\n" /* 72 */ + " Firmware version: %2d.%02d.%02d, Driver version %s\n", /* 66 */ + bdp->fwver[0], bdp->fwver[1], bdp->fwver[2], QLA2100_VERSION); + len += size; + +#if 0 + size = sprintf(PROC_BUF, + "FC HBA: %s; HBA Serial# %x%x%x\n", + bdp->bdName, + ha->serial0, + ha->serial1, + ha->serial2); + len += size; + + size = sprintf(PROC_BUF, + "[%c%c%c%c%c%c]; Part#%c%c%c%c%c%c%c%c; FRU#%c%c%c%c%c%c%c%c; EC#%c%c%c%c%c%c%c%c\n", + ha->oem_string[0], + ha->oem_string[1], + ha->oem_string[2], + ha->oem_string[3], + ha->oem_string[4], + ha->oem_string[5], + + ha->oem_part[0], + ha->oem_part[1], + ha->oem_part[2], + ha->oem_part[3], + ha->oem_part[4], + ha->oem_part[5], + ha->oem_part[6], + ha->oem_part[7], + + ha->oem_fru[0], + ha->oem_fru[1], + ha->oem_fru[2], + ha->oem_fru[3], + ha->oem_fru[4], + ha->oem_fru[5], + ha->oem_fru[6], + ha->oem_fru[7], + + ha->oem_ec[0], + ha->oem_ec[1], + ha->oem_ec[2], + ha->oem_ec[3], + ha->oem_ec[4], + ha->oem_ec[5], + ha->oem_ec[6], + ha->oem_ec[7]); + len += size; +#endif + + size = sprintf(PROC_BUF, "Request Queue = 0x%lx, Response Queue = 0x%lx\n", + (long unsigned int)ha->request_dma, + (long unsigned int)ha->response_dma); + len += size; + size = sprintf(PROC_BUF, "Request Queue count= %ld, Response Queue count= %ld\n", + (long)REQUEST_ENTRY_CNT, + (long)RESPONSE_ENTRY_CNT); + len += size; + size = sprintf(PROC_BUF, "Number of pending commands = 0x%lx\n", ha->actthreads); + len += size; + size = sprintf(PROC_BUF, "Number of queued commands = 0x%lx\n", ha->qthreads); + len += size; + size = sprintf(PROC_BUF, "Number of free request entries = %d\n",ha->req_q_cnt); + len += size; + size = sprintf(PROC_BUF, "Number of mailbox timeouts = %ld\n",qla2100_stats.mboxtout); + len += size; + size = sprintf(PROC_BUF, "Number of ISP aborts = %ld\n",qla2100_stats.ispAbort); + len += size; + size = sprintf(PROC_BUF, "Number of loop resyncs = %ld\n",qla2100_stats.ispAbort); + len += size; + size = sprintf(PROC_BUF, "Number of retries for empty slots = %ld\n",qla2100_stats.outarray_full); + len += size; + size = sprintf(PROC_BUF, "Number of reqs in retry_q = %ld\n",qla2100_stats.retry_q_cnt); + len += size; + size = sprintf(PROC_BUF, "Number of reqs in done_q = %ld\n",qla2100_stats.done_q_cnt); + len += size; + +#if REQ_TRACE + if ( qla2100_req_dmp ) { + size = sprintf(PROC_BUF,"Outstanding Commands on controller:\n"); + len += size; + for( i=0; i < MAX_OUTSTANDING_COMMANDS; i++ ) { + if( (sp = ha->outstanding_cmds[i]) == NULL ) + continue; + if( (cp = sp->cmd) == NULL ) + continue; + size = sprintf(PROC_BUF, + "(%d): Pid=%ld, sp flags=0x%x, cmd=0x%p, state=%x handle=%x\n\r", + i, (int)sp->cmd->pid, (long)sp->flags, + CMD_SP(sp->cmd),(int)sp->state,CMD_HANDLE(sp->cmd)); + + len += size; + if( len >= qla2100_buffer_size ) + goto profile_stop; + } + } +#endif + + /* 2.25 node/port display to proc */ + /* Display the node name for adapter */ + size = sprintf(PROC_BUF, "\nSCSI Device Information:\n"); + len += size; + size = sprintf(PROC_BUF, + "scsi-qla%d-adapter-node=%02x%02x%02x%02x%02x%02x%02x%02x;\n", + (int)ha->instance, + ha->init_cb->node_name[0], + ha->init_cb->node_name[1], + ha->init_cb->node_name[2], + ha->init_cb->node_name[3], + ha->init_cb->node_name[4], + ha->init_cb->node_name[5], + ha->init_cb->node_name[6], + ha->init_cb->node_name[7]); + len += size; + + /* display the port name for adapter */ + size = sprintf(PROC_BUF, + "scsi-qla%d-adapter-port=%02x%02x%02x%02x%02x%02x%02x%02x;\n", + (int)ha->instance, + ha->init_cb->port_name[0], + ha->init_cb->port_name[1], + ha->init_cb->port_name[2], + ha->init_cb->port_name[3], + ha->init_cb->port_name[4], + ha->init_cb->port_name[5], + ha->init_cb->port_name[6], + ha->init_cb->port_name[7]); + len += size; + + /* Print out device port names */ + for (i = 0; i < MAX_FIBRE_DEVICES; i++) { + if (ha->fc_db[i].loop_id == PORT_UNUSED) + continue; + +#if USE_PORTNAME + size = sprintf(PROC_BUF, + "scsi-qla%d-target-%d=%02x%02x%02x%02x%02x%02x%02x%02x;\n", + (int)ha->instance, i, + ha->fc_db[i].wwn[0], + ha->fc_db[i].wwn[1], + ha->fc_db[i].wwn[2], + ha->fc_db[i].wwn[3], + ha->fc_db[i].wwn[4], + ha->fc_db[i].wwn[5], + ha->fc_db[i].wwn[6], + ha->fc_db[i].wwn[7]); +#else + size = sprintf(PROC_BUF, + "scsi-qla%d-target-%d=%02x%02x%02x%02x%02x%02x%02x%02x;\n", + (int)ha->instance, i, + ha->fc_db[i].name[0], + ha->fc_db[i].name[1], + ha->fc_db[i].name[2], + ha->fc_db[i].name[3], + ha->fc_db[i].name[4], + ha->fc_db[i].name[5], + ha->fc_db[i].name[6], + ha->fc_db[i].name[7]); +#endif + len += size; + } /* 2.25 node/port display to proc */ + + size = sprintf(PROC_BUF, "\nSCSI LUN Information:\n"); + len += size; + size = sprintf(PROC_BUF, "(Id:Lun)\n"); + len += size; + /* scan for all equipment stats */ + for (t = 0; t < MAX_FIBRE_DEVICES; t++) { + /* valid target */ + if (ha->fc_db[t].loop_id == PORT_UNUSED) + continue; + /* scan all luns */ + for( l = 0; l < ha->max_luns; l++ ) { + up = (scsi_lu_t *) GET_LU_Q(ha, 0, t, l); + if( up == NULL ) + continue; + if( up->io_cnt == 0 || up->io_cnt < 5) + continue; + /* total reads since boot */ + /* total writes since boot */ + /* total requests since boot */ + size = sprintf(PROC_BUF, "(%2d:%2d): Total reqs %ld,",t,l,up->io_cnt); + len += size; + /* current number of pending requests */ + size = sprintf(PROC_BUF, " Pending reqs %d,",up->q_outcnt); + len += size; + + /* current number of pending requests */ + size = sprintf(PROC_BUF, " Queued reqs %d,",(int)up->q_incnt); + len += size; + size = sprintf(PROC_BUF, "\n"); + len += size; + if( len >= qla2100_buffer_size ) + goto profile_stop; + } + if( len >= qla2100_buffer_size ) + break; + } + + profile_stop: + if( len >= qla2100_buffer_size ) { + printk(KERN_WARNING "qla2100: Overflow buffer in qla2100_proc.c\n"); + } + + if( offset > len - 1 ) { + kfree(qla2100_buffer); + qla2100_buffer = NULL; + qla2100_buffer_size = length = 0; + *start = NULL; + } else { + if( len - offset < length ) { + length = len - offset; + } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + *start = &qla2100_buffer[offset]; /* Start of wanted data */ +#else + *start = buffer; + memcpy(buffer, &qla2100_buffer[offset], length); +#endif + } + return (length); +#else + return (0); +#endif + +} + +/************************************************************************** +* qla2100_detect +* +* Description: +* This routine will probe for Qlogic FC SCSI host adapters. +* It returns the number of host adapters of a particular +* type that were found. It also initialize all data necessary for +* the driver. It is passed-in the host number, so that it +* knows where its first entry is in the scsi_hosts[] array. +* +* Input: +* template - pointer to SCSI template +* +* Returns: +* num - number of host adapters found. +**************************************************************************/ +int +qla2100_detect(Scsi_Host_Template *template) +{ + struct Scsi_Host *host; + scsi_qla_host_t *ha, *cur_ha; + struct _qlaboards *bdp; + int i, j; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + unsigned short subsys; +#endif +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,1,95) + unsigned int piobase; + unsigned char pci_bus, pci_devfn, pci_irq; + config_reg_t *cfgp = 0; +#endif + device_reg_t *reg; + char *cp; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95) + struct pci_dev *pdev = NULL; +#else + int index; +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + struct semaphore sem = MUTEX_LOCKED; +#else + DECLARE_MUTEX_LOCKED(sem); +#endif + + unsigned long wait_switch = 0; + + ENTER("qla2100_detect"); + + if( sizeof(srb_t) > sizeof(Scsi_Pointer) ) + printk(KERN_WARNING "qla2x00: srb_t must be re-defined " + "- it's too big"); + +#ifdef CODECHECK + if( sizeof(srb_t) > sizeof(Scsi_Pointer) ) { + printk(KERN_WARNING "Redefine srb_t - its too big"); + return 0; + } +#endif + +#ifdef MODULE + DEBUG2(sprintf(debug_buff, + "DEBUG: qla2100_detect starts at address = 0x%8lx\n", + (uint32_t)qla2100_detect);) + DEBUG2(qla2100_print(debug_buff);) + /* + * If we are called as a module, the qla2100 pointer may not be null + * and it would point to our bootup string, just like on the lilo + * command line. IF not NULL, then process this config string with + * qla2100_setup + * + * Boot time Options + * To add options at boot time add a line to your lilo.conf file like: + * append="qla2100=verbose,tag_info:{{32,32,32,32},{32,32,32,32}}" + * which will result in the first four devices on the first two + * controllers being set to a tagged queue depth of 32. + */ + if( ql2xopts ) + qla2100_setup(ql2xopts, NULL); + if( dummy_buffer[0] != 'P' ) + printk(KERN_WARNING "qla2100: Please read the file " + "/usr/src/linux/drivers/scsi/README.qla2100\n" + "qla2100: to see the proper way to specify options to " + "the qla2100 module\n" + "qla2100: Specifically, don't use any commas when passing " + "arguments to\n" + "qla2100: insmod or else it might trash certain memory " + "areas.\n"); +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + if( (int) !pcibios_present() ) +#else + if (!pci_present()) +#endif + { + printk(KERN_WARNING "scsi: [ERROR] PCI not present\n"); + return 0; + } /* end of IF */ + + bdp = &QLBoardTbl_fc[0]; + qla2100_hostlist = NULL; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + template->proc_dir = &proc_scsi_qla2100; +#else + template->proc_name = "qla2x00"; +#endif + + /* Try and find each different type of adapter we support */ + for( i=0; bdp->device_id != 0 && i < NUM_OF_ISP_DEVICES; i++, bdp++ ) { + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,18) + /* PCI_SUBSYSTEM_IDS supported */ + while ((pdev = pci_find_subsys(QLA2100_VENDOR_ID, + bdp->device_id, PCI_ANY_ID, PCI_ANY_ID, pdev) )) { + if (pci_enable_device(pdev)) continue; +#else + while ((pdev = pci_find_device(QLA2100_VENDOR_ID, + bdp->device_id, pdev ) )) { +#endif /* 2,3,18 */ + +#else /* less than 2,1,95 */ + while (!(pcibios_find_device(QLA2100_VENDOR_ID, + bdp->device_id, index++, &pci_bus, &pci_devfn)) ) { +#endif /* 2,1,95 */ + + /* found an adapter */ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,18) + printk(KERN_INFO "qla2x00: detect() found an HBA\n"); + printk(KERN_INFO + "qla2x00: VID=%x DID=%x SSVID=%x SSDID=%x\n", + pdev->vendor, pdev->device, + pdev->subsystem_vendor, + pdev->subsystem_device); + + /* If it's an XXX SubSys Vendor ID adapter, skip it. */ + /* if (pdev->subsystem_vendor == PCI_VENDOR_ID_XXX) + { + printk(KERN_INFO "qla2x00: Skip XXX SubSys " + "Vendor ID Controller\n"); + continue; + } + */ +#else +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95) + pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, + &subsys); + + /* Bypass all XXX SUBSYS VENDOR IDs */ + /* if (subsys == PCI_VENDOR_ID_XXX) + { + printk(KERN_INFO "qla2x00:Skip XXX SubSys " + "Vendor ID Controller\n"); + continue; + } + */ +#endif /* 2,1,95 */ +#endif /* 2,3,18 */ + host = scsi_register(template, sizeof(scsi_qla_host_t)); + ha = (scsi_qla_host_t *) host->hostdata; + + /* Clear our data area */ + for( j = 0, cp = (char *)ha; + j < sizeof(scsi_qla_host_t); j++, cp++ ) + *cp = 0; + + /* Sanitize the information from PCI BIOS. */ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95) + host->irq = pdev->irq; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + host->io_port = (unsigned long) pdev->base_address[0]; +#else + host->io_port = pdev->resource[0].start; +#endif + ha->pci_bus = pdev->bus->number; + ha->pci_device_fn = pdev->devfn; + ha->pdev = pdev; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,4) + scsi_set_pci_device(host, pdev); +#endif +#else + pcibios_read_config_byte(pci_bus, pci_devfn, + OFFSET(cfgp->interrupt_line), &pci_irq); + pcibios_read_config_dword(pci_bus, pci_devfn, + OFFSET(cfgp->base_port), &piobase); + host->irq = pci_irq; + host->io_port = (unsigned int) piobase; + ha->pci_bus = pci_bus; + ha->pci_device_fn = pci_devfn; +#endif + ha->device_id = bdp->device_id; + host->io_port &= PCI_BASE_ADDRESS_IO_MASK; + ha->devnum = i; + if( qla2100_verbose ) { + printk(KERN_INFO "(scsi): Found a %s @ bus %d, " + "device 0x%x, irq %d, iobase 0x%lx\n", + bdp->bdName, ha->pci_bus, + (ha->pci_device_fn & 0xf8) >> 3, + host->irq, (unsigned long)host->io_port); + } + + ha->iobase = (device_reg_t *) host->io_port; + ha->iobase2300 = (device2300_reg_t *) host->io_port; + ha->host = host; + + /* 4.23 Initialize /proc/scsi/qla2x00 counters */ + ha->actthreads = 0; + ha->qthreads = 0; + ha->dump_done = 0; + ha->isp_aborts = 0; + ha->lip_count = 0; + + if( qla2100_mem_alloc(ha) ) { + printk(KERN_INFO "qla2100: Failed to allocate " + "memory for adapter\n"); + } + ha->prev_topology = 0; + ha->ports = bdp->numPorts; + ha->host_no = host->host_no; + + /* 4.10 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + ha->ioctl_mem = (void *)KMALLOC(PAGE_SIZE); + ha->ioctl_mem_phys = VIRT_TO_BUS(ha->ioctl_mem); +#else + /* get consistent memory allocated for ioctl I/O + * operations + */ + ha->ioctl_mem = pci_alloc_consistent(ha->pdev, + PAGE_SIZE, &ha->ioctl_mem_phys); +#endif + + if (ha->ioctl_mem == NULL) { + printk(KERN_WARNING "qla2100: ERROR in ioctl " + "physical memory allocation\n"); + return(0); + } + + if( ha->device_id == QLA2100_DEVICE_ID ) + ha->max_targets = MAX_TARGETS_2100; + else + ha->max_targets = MAX_TARGETS_2200; + + /* load the F/W, read paramaters, and init the H/W */ + ha->instance = num_hosts; + + if( qla2100_initialize_adapter(ha) ) { + printk(KERN_WARNING + "qla2100_detect: [ERROR] Failed to " + "initialize adapter\n"); + + qla2100_mem_free(ha); + scsi_unregister(host); + continue; + } + + ha->next = NULL; + /* Mark preallocated Loop IDs in use. */ + ha->fabricid[SNS_FL_PORT].in_use = TRUE; + ha->fabricid[FABRIC_CONTROLLER].in_use = TRUE; + ha->fabricid[SIMPLE_NAME_SERVER].in_use = TRUE; + + /* Register our resources with Linux */ + if( qla2100_register_with_Linux(ha, bdp->numPorts-1) ) { + printk(KERN_WARNING + "qla2100: [ERROR] Failed to register our " + "resources\n"); + qla2100_mem_free(ha); + scsi_unregister(host); + continue; + } + + /* reg uses here in detect() are common: + * 2100/2200/2300 + */ + reg = ha->iobase; + + /* Disable ISP interrupts. */ + qla2100_disable_intrs(ha); + + /* + * Startup the kernel thread for this host adapter + */ + + ha->dpc_notify = &sem; + kernel_thread((int (*)(void *))qla2100_do_dpc, + (void *) ha, 0); + + /* + * Now wait for the kernel dpc thread to initialize + * and go to sleep. + */ + down(&sem); + ha->dpc_notify = NULL; + + /* + * These locks are used to prevent more than one + * CPU from modifying the queue at the same time. + * The higher level "io_request_lock" will reduce + * most contention for these locks. + */ + ha->retry_lock = SPIN_LOCK_UNLOCKED; + + /* Insure mailbox registers are free. */ + WRT_REG_WORD(®->semaphore, 0); + WRT_REG_WORD(®->host_cmd, HC_CLR_RISC_INT); + WRT_REG_WORD(®->host_cmd, HC_CLR_HOST_INT); + + /* Wait around max 5 secs for the devices to come + * on-line we don't want Linux scanning before we + * are ready. + */ + /* v2.19.5b6 */ + for (wait_switch = jiffies+(ha->loop_reset_delay * HZ); + wait_switch > jiffies && + !(ha->device_flags & DFLG_FABRIC_DEVICES) ; ) { + + qla2100_check_fabric_devices(ha); + } + /* just in case we turned it on */ + ha->dpc_flags &= ~COMMAND_WAIT_NEEDED; + + /* List the target we have found */ + qla2100_display_fc_names(ha); + + /* Enable chip interrupts. */ + qla2100_enable_intrs(ha); + + /* Insert new entry into the list of adapters */ + ha->next = NULL; + if( qla2100_hostlist == NULL ) { + qla2100_hostlist = ha; + } else { + cur_ha = qla2100_hostlist; + + while( cur_ha->next != NULL ) + cur_ha = cur_ha->next; + + cur_ha->next = ha; + } + num_hosts++; + } + } /* end of FOR */ + + LEAVE("qla2100_detect"); + return num_hosts; +} + +/************************************************************************** +* qla2100_register_with_Linux +* +* Description: +* Free the passed in Scsi_Host memory structures prior to unloading the +* module. +* +* Input: +* ha - pointer to host adapter structure +* maxchannels - MAX number of channels. +* +* Returns: +* 0 - Sucessfully reserved resources. +* 1 - Failed to reserved a resource. +**************************************************************************/ +STATIC uint8_t qla2100_register_with_Linux(scsi_qla_host_t *ha, uint8_t maxchannels) { + + struct Scsi_Host *host = ha->host; + char drvname[9]; + + host->can_queue = 0xfffff; /* unlimited */ + host->cmd_per_lun = 1; + host->select_queue_depths = qla2100_select_queue_depth; + host->n_io_port = 0xFF; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + host->base = (unsigned char *) ha->mmpbase; +#else + host->base = (u_long) ha->mmpbase; +#endif + host->max_channel = maxchannels; + /* fix: 07/31 host->max_lun = MAX_LUNS-1; */ + host->max_lun = ha->max_luns; + host->unique_id = ha->instance; + host->max_id = ha->max_targets; + + /* set our host ID (need to do something about our two IDs) */ + host->this_id = 255; + + /* Register the I/O space with Linux */ + if( check_region(host->io_port, 0xff) ) { + printk(KERN_WARNING "qla2100 : [ERROR] Failed to reserved i/o region " + "0x%04lx-0x%04lx already in use\n", + host->io_port, host->io_port + 0xff); + /* 4.31.5 - deleted free_irq(host->irq, NULL); */ + return 1; + } + + /* ER# 4368 */ + sprintf(drvname,"qla2x00#%02d",host->unique_id); + + request_region(host->io_port, 0xff, drvname); + + + /* Register the IRQ with Linux (sharable) */ + if( request_irq(host->irq, qla2100_intr_handler, SA_INTERRUPT| SA_SHIRQ, "qla2x00", ha) ) { + printk(KERN_WARNING "qla2100 : [ERROR] Failed to reserved interrupt %d " + "already in use\n", host->irq); + return 1; + } + + /* Initialized the timer */ + START_TIMER(qla2100_timer,ha,WATCH_INTERVAL); + + return 0; +} + + +/************************************************************************** +* qla2100_release +* +* Description: +* Free the passed in Scsi_Host memory structures prior to unloading the +* module. +* +* Input: +* ha - pointer to host adapter structure +* +* Returns: +* 0 - Always returns good status +**************************************************************************/ +int +qla2100_release(struct Scsi_Host *host) { + scsi_qla_host_t *ha = (scsi_qla_host_t *) host->hostdata; + + ENTER("qla2100_release"); + /* if adpater is running and online */ + if( !ha->flags.online ) + return(0); + + /* turn-off interrupts on the card */ + qla2100_disable_intrs(ha); + + /* Detach interrupts */ + if( host->irq ) + free_irq(host->irq, ha); + + /* release io space registers */ + if( host->io_port ) + release_region(host->io_port, 0xff); + + /* Disable timer */ + if( ha->timer_active ) + STOP_TIMER(qla2100_timer,ha) + + /* Kill the kernel thread for this host */ + if( ha->dpc_handler != NULL ) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + struct semaphore sem = MUTEX_LOCKED; +#else + DECLARE_MUTEX_LOCKED(sem); +#endif + + ha->dpc_notify = &sem; + send_sig(SIGKILL, ha->dpc_handler, 1); + down(&sem); + ha->dpc_notify = NULL; + } +#if USE_FLASH + /* Move driver database to flash, if enabled. */ + if( ha->flags.enable_flash_db_update && ha->flags.updated_fc_db ) { + ha->flags.updated_fc_db = FALSE; + qla2100_save_database(ha); + } +#endif +#if MEMORY_MAPPED_IO + if( ha->mmpbase ) { + iounmap((void *) (((unsigned long) ha->mmpbase) & PAGE_MASK)); + } +#endif /* MEMORY_MAPPED_IO */ + +#if APIDEV + apidev_cleanup(); +#endif + + qla2100_mem_free(ha); + ha->flags.online = FALSE; + + LEAVE("qla2100_release"); + return(0); +} + +/************************************************************************** +* qla2100_info +* +* Description: +* +* Input: +* host - pointer to Scsi host adapter structure +* +* Returns: +* Return a text string describing the driver. +**************************************************************************/ +const char * +qla2100_info(struct Scsi_Host *host) { + static char qla2100_buffer[255]; + char *bp; + scsi_qla_host_t *ha; + qla_boards_t *bdp; + +#if APIDEV +/* We must create the api node here instead of qla2100_detect since we want + the api node to be subdirectory of /proc/scsi/qla2x00 which will not + have been created when qla2100_detect exits, but which will have been + created by this point. */ + + apidev_init(host); +#endif + bp = &qla2100_buffer[0]; + ha = (scsi_qla_host_t *)host->hostdata; + bdp = &QLBoardTbl_fc[ha->devnum]; + memset(bp, 0, sizeof(qla2100_buffer)); + sprintf(bp, + "QLogic %sPCI to Fibre Channel Host Adapter: bus %d device %d irq %d\n" + " Firmware version: %2d.%02d.%02d, Driver version %s", + (char *)&bdp->bdName[0], ha->pci_bus, (ha->pci_device_fn & 0xf8) >> 3, host->irq, + bdp->fwver[0], bdp->fwver[1], bdp->fwver[2], QLA2100_VERSION); + return(bp); +} + +/************************************************************************** +* qla1200_queuecommand +* +* Description: +* Queue a command to the controller. +* +* Input: +* cmd - pointer to Scsi cmd structure +* fn - pointer to Scsi done function +* +* Returns: +* 0 - Always +* +* Note: +* The mid-level driver tries to ensures that queuecommand never gets invoked +* concurrently with itself or the interrupt handler (although the +* interrupt handler may call this routine as part of request-completion +* handling). +**************************************************************************/ +int +qla2100_queuecommand(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *)) { + scsi_qla_host_t *ha; + srb_t *sp; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + unsigned long cpu_flags = 0; +#endif + struct Scsi_Host *host; + uint32_t b, t, l; + scsi_lu_t *q; + u_long handle; + + ENTER("qla2100_queuecommand"); + COMTRACE('C') + + host = cmd->host; + ha = (scsi_qla_host_t *) host->hostdata; + /* Get our SCSI request pointer + * SCp always point to it - see definition in qla2100.h. + */ + sp = (srb_t *) CMD_SP(cmd); + sp->cmd = cmd; + cmd->scsi_done = fn; + + /* If we not trying to do a recovery procedure of some sort + * then this is probably a new command. + */ + if( cmd->flags == 0 && + cmd->retries == 0 ) + sp->flags = 0; + + /* Generate LU queue on bus, target, LUN */ + b = SCSI_BUS_32(cmd); + t = SCSI_TCN_32(cmd); + l = SCSI_LUN_32(cmd); + + DEBUG5(qla2100_print_scsi_cmd(cmd);) + DEBUG5(sprintf(debug_buff,"qla2100_queuecmd: pid=%d, opcode=%d, timeout=%d\n",cmd->pid,cmd->cmnd[0],CMD_TIMEOUT(cmd));) + DEBUG5(qla2100_print(debug_buff);) + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + /*DEBUG(sprintf(debug_buff,"\n\nQC: t=%x CDB=%x Size=%x\n\r", + t,cmd->cmnd[0],CMD_XFRLEN(cmd));) + DEBUG(qla2100_print(debug_buff)); */ +#endif + /* + * We found all the devices at LIP time, and created a device + * table for them, so we only need to check the table to see + * if the device is present. if PORT_AVAILABLE or PORT_UNUSED + * then no target exists. + * + * We return DID_NO_CONNECT if the loop is down after loop down + * timer has expired. + */ + if( TGT_Q(ha,b,t) == NULL || + (TGT_Q(ha,b,t) && TGT_Q(ha,b,t)->loop_id > LAST_SNS_LOOP_ID) ) { + /* DEBUG2(printk("scsi(%2d:%2d:%2d:%2d): port unavailable\n", + (int)ha->host_no,b,t,l);) */ + CMD_RESULT(sp->cmd) = DID_NO_CONNECT << 16; + qla2100_callback(ha,sp,FALSE); + LEAVE("qla2100_queuecommand"); + return(0); + } + /* v218b4 */ + if (ha->loop_down_timer == 0 && + ha->loop_state == LOOP_DOWN ){ /* 01/21/00 DG */ + DEBUG2(printk("scsi(%2d:%2d:%2d:%2d): Loop down - returning pid=%ld \n",(int)ha->host_no,b,t,l,cmd->pid);) + CMD_RESULT(sp->cmd) = DID_NO_CONNECT << 16; + ha->flags.done_requests_needed = TRUE; + qla2100_done_q_put(ha, sp, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + LEAVE("qla2100_queuecommand"); + return(0); + } + + /* + * Allocate a LUN/DEVICE queue from this request if we haven't + * already did it on a previous command. + */ + if( (q = GET_LU_Q(ha, b, t,l)) == NULL ) { + DRIVER_LOCK + if( (q = qla2100_lun_alloc()) == NULL ) { + CMD_RESULT(sp->cmd) = DID_RETRY << 16; + qla2100_callback(ha,sp,FALSE); + return(0); + } + LU_Q(ha, b, t, l) = q; + DEBUG(sprintf(debug_buff,"Allocate new device queue 0x%x\n",q)); + DEBUG(qla2100_print(debug_buff)); + DRIVER_UNLOCK + } + + /* Set an invalid handle until we issue the command to ISP */ + /* then we will set the real handle value. */ + handle = INVALID_HANDLE; + CMD_HANDLE(cmd) = (unsigned char *)handle; + +#if QLA2100_EXT_TIMEOUT + /* Extend timeout for this request */ + qla2100_extend_timeout(cmd,60*HZ); +#endif + + /* + * SCSI Kluge + * ======== + * Whenever, we need to wait for an event such as loop down + * (i.e. loop_down_timer ) or port down (i.e. LUN request qeueue is + * suspended) then we will recycle new commands back to the SCSI layer. + * We do this because this is normally a temporary condition and we don't + * want the mid-level scsi.c driver to get upset and start aborting + * commands. + + * The timeout value is extracted from the command minus 1-second + * and put on a retry queue (watchdog). Once the command timeout it + * is returned to the mid-level with a BUSY status, so the mid-level + * will retry it. This process continues until the LOOP DOWN time + * expires or the condition goes away. + */ + if( ha->loop_down_timer || + ha->loop_state == LOOP_DOWN || + (PORT_DOWN(ha,t) > 0) || + ha->loop_state != LOOP_READY || + (q->q_flag & QLA2100_QSUSP) ) { + /* Insert command into watchdog queue */ + qla2100_timeout_insert(ha, sp); + LEAVE("qla2100_queuecommand"); + return (0); + } + /* Set retry count if this is a new command */ + if( sp->flags == 0 && + !(q->q_flag & QLA2100_QSUSP) ) { + sp->retry_count = ha->retry_count; + if( TGT_Q(ha, b, t)->down_timer == 0 ) + sp->port_down_retry_count = ha->port_down_retry_count; + } + + /* No timeout necessary, because the upper layer is doing it for us */ + sp->wdg_time = 0; + + /* add the command to our queue */ + ha->qthreads++; + qla2100_putq_t(q,sp); + + DEBUG5(sprintf(debug_buff,"\nQC: queue pid=%d, hndl=0x%x\n\r", + cmd->pid,handle)); + DEBUG5(qla2100_print(debug_buff)); + + /* send command to adapter */ + qla2100_restart_queues(ha,FALSE); + + COMTRACE('c') + LEAVE("qla2100_queuecommand"); + return (0); +} + +/************************************************************************** +* qla1200_abort +* +* Description: +* Abort the specified SCSI command. +* +* Input: +* cmd - pointer to Scsi cmd structure +* +* Returns: +**************************************************************************/ +int +qla2100_abort(Scsi_Cmnd *cmd) { + scsi_qla_host_t *ha; + srb_t *sp; + srb_t *rp, *rp_next; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + unsigned long cpu_flags = 0; +#endif + struct Scsi_Host *host; + uint32_t b, t, l; + scsi_lu_t *q; + int return_status = SCSI_ABORT_SUCCESS; + int found = 0; + int i; + u_long handle; + + uint16_t data; + + ENTER("qla2100_abort"); + COMTRACE('A') + + ha = (scsi_qla_host_t *) cmd->host->hostdata; + host = cmd->host; + +#if DEBUG_GET_FW_DUMP + if (ha->device_id == QLA2300_DEVICE_ID) + { + if (ha->dump_done != 1) { + DEBUG(sprintf(debug_buff,"\nqla2100_abort handle=%x: >>>>>>> DUMP 2300 FW <<<<<<<\n",CMD_HANDLE(cmd));) + DEBUG(qla2100_print(debug_buff);) + qla2300_dump_isp(ha); + ha->dump_done = 1; + } + } +#endif + + DRIVER_LOCK + /* Get the SCSI request ptr */ + sp = (srb_t *) CMD_SP(cmd); + + /* + * if the handle is NULL then we already completed the command. + * We always give the handle a value of "INVALID_HANDLE" when + * we received it. + */ + if( (u_long) CMD_HANDLE(cmd) == 0L ) { + + DRIVER_UNLOCK +#if STOP_ON_ABORT + qla2100_panic("qla2100_abort",ha->host); +#endif + return(SCSI_ABORT_NOT_RUNNING); /* no action - we don't have command */ + } + + /* Check for a pending interrupt. */ + if (ha->device_id == QLA2300_DEVICE_ID) + data = qla2100_debounce_register((uint16_t *)&ha->iobase2300->host_status) & RISC_2300_INT; + else data = qla2100_debounce_register(&ha->iobase->istatus) & + RISC_INT; + + /* Check for pending interrupts. */ + if( !(ha->flags.in_isr) && (data)) { + /* Add any completed commands in the done queue */ + DEBUG(qla2100_print("qla2100_abort: Calling isr\n");) + qla2100_isr(ha, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + } + + /* + * if no LUN queue then something is very wrong!!! + */ + handle = (u_long) CMD_HANDLE(cmd); + + /* Generate LU queue on bus, target, LUN */ + b = SCSI_BUS_32(cmd); + t = SCSI_TCN_32(cmd); + l = SCSI_LUN_32(cmd); + if( (q = GET_LU_Q(ha, b, t, l)) == NULL ) { + COMTRACE('a') + + DRIVER_UNLOCK + printk(KERN_WARNING "qla2100 (%d:%d:%d): No LUN queue for the specified device\n",(int)b,(int)t,(int)l); + return(SCSI_ABORT_NOT_RUNNING); /* no action - we don't have command */ + } + +#if AUTO_ESCALATE_ABORT + if( (sp->flags & SRB_ABORTED) ) { + DRIVER_UNLOCK + DEBUG(qla2100_print("qla2100_abort: Abort escalayted - returning SCSI_ABORT_SNOOZE.\n\r")); + return(SCSI_ABORT_SNOOZE); + } +#endif + /* + * if the command ahs a abort pending then tell the upper layer + */ + if( (sp->flags & SRB_ABORT_PENDING) ) { + COMTRACE('a') + DRIVER_UNLOCK + if( qla2100_verbose ) + printk(KERN_INFO "scsi(): Command has a pending abort " + "message - ABORT_PENDING.\n"); + DEBUG(qla2100_print("qla2100: Command has a pending abort message - ABORT_PENDING.\n\r")); + return(SCSI_ABORT_PENDING); + } + + DEBUG(sprintf(debug_buff,"ABORTing command= 0x%x, sp=%x sp->state=%x\n", + (int)cmd,sp,sp->state);) + DEBUG(qla2100_print(debug_buff);) + DEBUG(qla2100_print_scsi_cmd(cmd)); + + for( rp = ha->retry_q_first; (rp); rp = rp_next ) { + rp_next = rp->s_next; + if( sp != rp ) + continue; + qla2100_timeout_remove(ha, sp); + CMD_RESULT(sp->cmd) = DID_BUS_BUSY << 16; + CMD_HANDLE(sp->cmd) = (unsigned char *) NULL; + qla2100_done_q_put(ha, sp, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + found++; + } + + /* + * Our SP pointer points at the command we want to remove from the + * LUN queue providing we haven't already sent it to the adapter. + */ + if( found ) + return_status = SCSI_ABORT_SUCCESS; + else if( !(sp->flags&SRB_SENT) ) { + found++; + DEBUG(sprintf(debug_buff,"qla2100: Cmd in LUN queue aborted pid %d.\n\r",sp->cmd->pid);) + DEBUG(qla2100_print(debug_buff);) + /* Remove srb from SCSI LU queue. */ + qla2100_removeq(q, sp); + sp->flags |= SRB_ABORTED; + CMD_RESULT(cmd) = DID_ABORT << 16; + qla2100_done_q_put(ha, sp, &ha->done_q_first, &ha->done_q_last); + return_status = SCSI_ABORT_SUCCESS; + found++; + } else { /* find the command in our active list */ + for( i = 1; i < MAX_OUTSTANDING_COMMANDS; i++ ) { + if( sp == ha->outstanding_cmds[i] ) { + found++; + DEBUG(sprintf(debug_buff, + "qla2100: RISC aborting pid %d sp->state=%x\n\r", + sp->cmd->pid,sp->state);) + DEBUG(qla2100_print(debug_buff);) + /* DEBUG(qla2100_print_scsi_cmd(cmd)); */ + DEBUG(qla2100_print_q_info(q);) + /* v2.19.8 Ignore abort request if port is down */ + if ( qla2100_abort_command(ha,sp) ) { + DEBUG(printk("qla2100: Failed to abort pid %ld.\n",sp->cmd->pid);) + return_status = SCSI_ABORT_NOT_RUNNING; /* no action */ + } + else + return_status = SCSI_ABORT_PENDING; + break; + } + } + } + +#if STOP_ON_ABORT + qla2100_panic("qla2100_abort",ha->host); +#endif + if( found == 0 ) + return_status = SCSI_ABORT_NOT_RUNNING; /* no action */ + + DEBUG(sprintf(debug_buff, "qla2100_abort: Aborted status returned = 0x%x.\n\r",return_status)); + DEBUG(qla2100_print(debug_buff)); + /* + * Complete any commands + */ + if( ha->done_q_first ) + qla2100_done(ha, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + + if( found ) { + qla2100_restart_queues(ha,TRUE); + } + DRIVER_UNLOCK + + LEAVE("qla2100_abort"); + COMTRACE('a') + return(return_status); +} + +/************************************************************************** +* qla1200_reset +* +* Description: +* The reset function will reset the SCSI bus and abort any executing +* commands. +* +* Input: +* cmd = Linux SCSI command packet of the command that cause the +* bus reset. +* flags = SCSI bus reset option flags (see scsi.h) +* +* Returns: +* DID_RESET in cmd.host_byte of aborted command(s) +* +* Note: +* Resetting the bus always succeeds - is has to, otherwise the +* kernel will panic! Try a surgical technique - sending a BUS +* DEVICE RESET message - on the offending target before pulling +* the SCSI bus reset line. +**************************************************************************/ +int +qla2100_reset(Scsi_Cmnd *cmd, unsigned int flags) { + scsi_qla_host_t *ha; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + unsigned long cpu_flags = 0; +#endif + uint32_t b, t, l; + srb_t *sp; + typedef enum { + ABORT_DEVICE = 1, + DEVICE_RESET = 2, + BUS_RESET = 3, + ADAPTER_RESET= 4, + RESET_DELAYED= 5, + FAIL = 6 + } action_t; + action_t action = ADAPTER_RESET; + uint16_t data; + scsi_lu_t *q; + int result; + + + ENTER("qla2100_reset"); + COMTRACE('R') + if( cmd == NULL ) { + printk(KERN_WARNING "(scsi?:?:?:?) Reset called with NULL Scsi_Cmnd " + "pointer, failing.\n"); + return(SCSI_RESET_SNOOZE); + } + ha = (scsi_qla_host_t *) cmd->host->hostdata; + sp = (srb_t *) CMD_SP(cmd); + +#if STOP_ON_RESET + sprintf(debug_buff,"ABORTing command= 0x%x\n",(int)cmd); + qla2100_print(debug_buff); + qla2100_print_scsi_cmd(cmd); + qla2100_panic("qla2100_reset",ha->host); +#endif + + + DRIVER_LOCK + if (ha->device_id == QLA2300_DEVICE_ID) + data = qla2100_debounce_register((uint16_t *)&ha->iobase2300->host_status) & + RISC_2300_INT; + else data = qla2100_debounce_register(&ha->iobase->istatus) & + RISC_INT; + + /* Check for pending interrupts. */ + if( !(ha->flags.in_isr) && (data) ) { + DEBUG(qla2100_print("qla2100_reset: Calling isr\n");) + qla2100_isr(ha, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + } + DRIVER_UNLOCK + + /* + * Determine the suggested action that the mid-level driver wants + * us to perform. + */ + if( CMD_HANDLE(cmd) == (unsigned char *) 0 ) { + /* + * if mid-level driver called reset with a orphan SCSI_Cmnd + * (i.e. a command that's not pending ), so perform the + * function specified. + */ + /* 4.23 */ + if( (flags & SCSI_RESET_SUGGEST_HOST_RESET) ) + action = ADAPTER_RESET; + else if( flags & SCSI_RESET_SUGGEST_BUS_RESET ) + action = BUS_RESET; + else + action = DEVICE_RESET; + } else { /* + * Mid-level driver has called reset with this SCSI_Cmnd and + * its pending. + */ + if( flags & SCSI_RESET_SUGGEST_HOST_RESET ) + action = ADAPTER_RESET; + else if( flags & SCSI_RESET_SUGGEST_BUS_RESET ) + action = BUS_RESET; + else + action = DEVICE_RESET; + } + + b = SCSI_BUS_32(cmd); + t = SCSI_TCN_32(cmd); + l = SCSI_LUN_32(cmd); + q = GET_LU_Q(ha, b, t, l); + +#if AUTO_ESCALATE_RESET + if( (action & DEVICE_RESET) && (q->q_flag & QLA2100_QRESET) ) { + printk(KERN_INFO "qla2100(%d): Bus device reset already sent to " "device, escalating.\n", (int)ha->host_no); + action = BUS_RESET; + } + if( (action & DEVICE_RESET) && (sp->flags & SRB_ABORT_PENDING) ) { + printk(KERN_INFO "qla2100(%d):Have already attempted to reach " "device with abort device\n", (int)ha->host_no); + printk(KERN_INFO "qla2100(%d):message, will escalate to BUS " "RESET.\n",(int) ha->host_no); + action = BUS_RESET; + } +#endif + + /* + * By this point, we want to already know what we are going to do, + * so we only need to perform the course of action. + */ + + DRIVER_LOCK + result = SCSI_RESET_ERROR; + switch( action ) { + case FAIL: + break; + + case RESET_DELAYED: + result = SCSI_RESET_PENDING; + break; + + case ABORT_DEVICE: + if( qla2100_verbose ) + printk(KERN_INFO "scsi(%d:%d:%d:%d): ABORT DEVICE ISSUED.\n", (int)ha->host_no,(int)b,(int)t,(int)l); + qla2100_abort_queue_single(ha,b,t,l,DID_ABORT); + if( !ha->loop_down_timer ) + if( qla2100_abort_device(ha, b, t, l) == 0 ) + result = SCSI_RESET_PENDING; + break; + + case DEVICE_RESET: + if( qla2100_verbose ) + printk(KERN_INFO "scsi(%d:%d:%d:%d): DEVICE RESET ISSUED.\n",(int) ha->host_no,(int)b,(int)t,(int)l); + for( l = 0; l < ha->max_luns; l++ ) + qla2100_abort_queue_single(ha,b,t,l,DID_ABORT); + if( !ha->loop_down_timer ) + if( qla2100_device_reset(ha, b, t) == 0 ) + result = SCSI_RESET_PENDING; + q->q_flag |= QLA2100_QRESET; + break; + + case BUS_RESET: + if( qla2100_verbose ) + printk(KERN_INFO "scsi(%d:%d:%d:%d): LOOP RESET ISSUED.\n",(int) ha->host_no,(int)b,(int)t,(int)l); + for( t = 0; t < ha->max_targets; t++ ) + for( l = 0; l < ha->max_luns; l++ ) + qla2100_abort_queue_single(ha,b,t,l,DID_RESET); + if( !ha->loop_down_timer ) + if( qla2100_loop_reset(ha) == 0 ) + result = SCSI_RESET_SUCCESS | SCSI_RESET_BUS_RESET; + /* + * The reset loop routine returns all the outstanding commands back + * with "DID_RESET" in the status field. + */ + if( flags & SCSI_RESET_SYNCHRONOUS ) { + CMD_RESULT(cmd) = (int) (DID_BUS_BUSY << 16); + (*(cmd)->scsi_done)(cmd); + } + + /* ha->reset_start = jiffies; */ + break; + + case ADAPTER_RESET: + default: + if( qla2100_verbose ) { + printk(KERN_INFO "scsi(%d:%d:%d:%d): ADAPTER RESET ISSUED.\n",(int) ha->host_no,(int)b,(int)t,(int)l); + } + ha->flags.reset_active = TRUE; + /* + * We restarted all of the commands automatically, so the mid-level code can expect + * completions momentitarily. + */ + if( qla2100_abort_isp(ha) == 0 ) + result = SCSI_RESET_SUCCESS | SCSI_RESET_HOST_RESET; + + ha->flags.reset_active = FALSE; + } + + if( ha->done_q_first ) + qla2100_done(ha, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + qla2100_restart_queues(ha,TRUE); + DRIVER_UNLOCK + + COMTRACE('r') + LEAVE("qla2100_reset"); + return(result); +} + +/************************************************************************** +* qla1200_biosparam +* +* Description: +* Return the disk geometry for the given SCSI device. +**************************************************************************/ +int +qla2100_biosparam(Disk *disk, kdev_t dev, int geom[]) { + int heads, sectors, cylinders; + + heads = 64; + sectors = 32; + cylinders = disk->capacity / (heads * sectors); + if( cylinders > 1024 ) { + heads = 255; + sectors = 63; + cylinders = disk->capacity / (heads * sectors); + } + + geom[0] = heads; + geom[1] = sectors; + geom[2] = cylinders; + + return (0); +} + +/************************************************************************** +* qla2100_intr_handler +* +* Description: +* Handles the actual interrupt from the adapter. +* +* Context: Interrupt +**************************************************************************/ +void +qla2100_intr_handler(int irq, void *dev_id, struct pt_regs *regs) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,95) + unsigned long cpu_flags = 0; +#endif + scsi_qla_host_t *ha; + uint16_t data; + device_reg_t *reg; + device2300_reg_t *reg2300; + + ENTER_INTR("qla2100_intr_handler"); + COMTRACE('I') + ha = (scsi_qla_host_t *) dev_id; + if( !ha ) { + printk(KERN_INFO "qla2100_intr_handler: NULL host ptr\n"); + COMTRACE('X') + return; + } + ha->isr_count++; + qla2100_stats.irqhba = ha; + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,95) + /* Prevent concurrent access to adapters register */ + spin_lock_irqsave(&io_request_lock, cpu_flags); + qla2100_disable_intrs(ha); + + if (ha->device_id == QLA2300_DEVICE_ID) { + reg2300 = ha->iobase2300; + data = qla2100_debounce_register( + (uint16_t *)®2300->host_status) & RISC_2300_INT; + } else { + reg = ha->iobase; + data = qla2100_debounce_register(®->istatus) & + RISC_INT; + } + + /* Check for pending interrupts. */ + if( data ) { + /*DEBUG(qla2100_print("qla2100_intr_handler: Int active, Calling isr\n");)*/ + qla2100_isr(ha, + (srb_t **)&ha->done_q_first, + (srb_t **)&ha->done_q_last); + } + + if( ha->done_q_first ) + qla2100_done(ha, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + + spin_unlock_irqrestore(&io_request_lock, cpu_flags); + qla2100_enable_intrs(ha); + + /* Wakeup the DPC routine */ + if( (!ha->flags.mbox_busy && (ha->flags.isp_abort_needed || + ha->flags.reset_marker || + ha->flags.update_config_needed || + ( !ha->flags.loop_resync_active && + ha->flags.loop_resync_needed) ) ) + && ha->dpc_wait && !ha->dpc_active ) { /* v2.19.4 */ + up(ha->dpc_wait); + } + +#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) */ + + /* Prevent concurrent access to istatus register */ + if( test_bit(QLA2100_IN_ISR_BIT, (int *)&ha->flags) ) { + COMTRACE('X') + DEBUG(printk("scsi%d: Already in interrupt - returning \n", (int)ha->host_no);) + return; + } + set_bit(QLA2100_IN_ISR_BIT, (int *)&ha->flags); + qla2100_disable_intrs(ha); + + if (ha->device_id == QLA2300_DEVICE_ID) { + reg2300 = ha->iobase2300; + data = qla2100_debounce_register( + (uint16_t *)®2300->host_status) & RISC_2300_INT; + } else { + reg = ha->iobase; + data = qla2100_debounce_register(®->istatus) & + RISC_INT; + } + + /* Check for pending interrupts. */ + if( data ) { + DEBUG(qla2100_print("qla2100_intr_handler_2: Int active, Calling isr\n");) + qla2100_isr(ha, + (srb_t **)&ha->done_q_first, + (srb_t **)&ha->done_q_last); + } + + if( ha->done_q_first ) + qla2100_done(ha, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + + + /* Schedule the DPC routine */ + if( (ha->flags.isp_abort_needed || + ha->flags.reset_marker || + ( !ha->flags.loop_resync_active && + ha->flags.loop_resync_needed) || + ha->done_q_first ) && !ha->flags.dpc_sched ) { + + ha->run_qla_bh.data = (void *) ha; + ha->run_qla_bh.routine = qla2100_do_dpc; + + COMTRACE('P') + queue_task_irq(&ha->run_qla_bh,&tq_scheduler); + ha->flags.dpc_sched = TRUE; + } + clear_bit(QLA2100_IN_ISR_BIT, (int *)&ha->flags); + qla2100_enable_intrs(ha); +#endif + + COMTRACE('i') + LEAVE_INTR("qla2100_intr_handler"); +} + +/************************************************************************** +* qla2100_do_dpc +* This kernel thread is a task that is schedule by the interrupt handler +* to perform the background processing for interrupts. +* +* Notes: +* This task always run in the context of a kernel thread. It +* is kick-off by the driver's detect code and starts up +* up one per adapter. It immediately goes to sleep and waits for +* some fibre event. When either the interrupt handler or +* the timer routine detects a event it will one of the task +* bits then wake us up. +**************************************************************************/ +void +qla2100_do_dpc(void *p) { + scsi_qla_host_t *ha = (scsi_qla_host_t *) p; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + struct semaphore sem = MUTEX_LOCKED; +#else + DECLARE_MUTEX_LOCKED(sem); +#endif + unsigned long flags; + srb_t *sp, *sp_next; + uint32_t b, t, l; + scsi_lu_t *q; + int status; + + lock_kernel(); + + /* + * If we were started as result of loading a module, close all of the + * user space pages. We don't need them, and if we didn't close them + * they would be locked into memory. + */ + exit_mm(current); + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,18) + + daemonize(); + +#endif + current->session = 1; + current->pgrp = 1; + /* + * FIXME(dg) this is still a child process of the one that did the insmod. + * This needs to be attached to task[0] instead. + */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + siginitsetinv(¤t->blocked, SHUTDOWN_SIGS); +#else + siginitsetinv(¤t->blocked, sigmask(SIGKILL)); +#endif + current->fs->umask = 0; + + /* + * Set the name of this process. + */ + sprintf(current->comm, "qla2100_dpc_%d", (int)ha->host_no); + + ha->dpc_wait = &sem; + ha->dpc_handler = current; + + unlock_kernel(); + + /* + * Wake up the thread that created us. + */ + DEBUG(printk("qla2100_dpc: Wake up parent %d\n", ha->dpc_notify->count.counter)); + + up(ha->dpc_notify); + + while( 1 ) { + /* + * If we get a signal, it means we are supposed to go + * away and die. This typically happens if the user is + * trying to unload a module. + */ + DEBUG(printk("qla2100 %d: DPC handler sleeping\n",(int)ha->host_no)); + down_interruptible(&sem); + + if( signal_pending(current) ) + break; /* get out */ + + DEBUG(printk("qla2100 %d: DPC handler waking up\n",(int)ha->host_no);) + + if (ha->dpc_flags & COMMAND_WAIT_NEEDED) { + /* Release task daemon lock. */ + DEBUG(printk("Waiting on commands to complete\n");) + if( qla2100_cmd_wait(ha) ) + continue; + /* Acquire task daemon lock. */ + } + spin_lock_irqsave(&io_request_lock, flags); + ha->dpc_active = 1; + + /* Determine what action is necessary */ + + /* Flush all commands in watchdog queue */ + if( ha->flags.port_restart_needed ) { + DEBUG(qla2100_print("qla2100: DPC port restarting - flushing all cmds in watchdog queue.\n");) + ha->flags.port_restart_needed = FALSE; + for( sp = ha->retry_q_first; (sp != NULL); sp = sp_next ) { + sp_next = sp->s_next; + b = SCSI_BUS_32(sp->cmd); + t = SCSI_TCN_32(sp->cmd); + l = SCSI_LUN_32(sp->cmd); + if( (q = GET_LU_Q(ha, b, t,l)) == NULL || + !(q->q_flag & QLA2100_QSUSP) ) + continue; + q->q_flag &= ~QLA2100_QSUSP; + qla2100_timeout_remove(ha, sp); + CMD_RESULT(sp->cmd) = DID_BUS_BUSY << 16; + CMD_HANDLE(sp->cmd) = (unsigned char *) NULL; + qla2100_done_q_put(ha, sp, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + } + + /* v2.19 - We want to wait until the end to + * return all requests back to OS. + */ + /* deleted: qla2100_restart_queues(ha, FALSE); */ + ha->flags.restart_queues_needed = TRUE; + } + + /* Process any pending mailbox commands */ + if( !ha->flags.mbox_busy ) { + if( ha->flags.isp_abort_needed ) { + DEBUG(printk("dpc: qla2100_abort_isp ha = %p\n", ha);) + ha->flags.isp_abort_needed = FALSE; + qla2100_abort_isp(ha); + } + + if( ha->flags.reset_marker ) { + DEBUG(printk("dpc: qla2100_reset_marker \n");) + qla2100_rst_aen(ha); + } + + if( ha->flags.update_config_needed ) { + DEBUG(printk("dpc: qla2100_update_config\n");) + qla2100_update_config(ha); + } + + /* v2.19.8 Retry each device up to login retry count */ + if ( (ha->device_flags & RELOGIN_NEEDED) && + !ha->loop_state != LOOP_DOWN ) { /* v2.19.5 */ + DEBUG(printk("dpc: qla2100_login\n");) + ha->device_flags &= ~RELOGIN_NEEDED; + for (t = 0; t < MAX_FIBRE_DEVICES; t++) { + /* check if fabric logic retry needed */ + if ( (ha->fc_db[t].flag & DEV_PUBLIC) && + (ha->fc_db[t].flag & DEV_RELOGIN) ) { + if ( PORT_DOWN(ha,t) ) { + PORT_DOWN(ha,t)--; + if ( (status = qla2x00_login_public_device(ha, + &ha->fc_db[t].loop_id, + &ha->fc_db[t].port_id[0], + (uint16_t) MBC_NO_PLOGI_IF_LOGGED_IN)) == QL_STATUS_SUCCESS ) { + DEBUG(printk("dpc: logged in ID %x\n",ha->fc_db[t].loop_id);) + /* restart ports */ + ha->fc_db[t].flag &= ~DEV_RELOGIN; + PORT_DOWN(ha,t) = 0; + } else if ( status == QL_STATUS_FATAL_ERROR ) { + ha->flags.isp_abort_needed = TRUE; + ha->fc_db[t].flag &= ~DEV_RELOGIN; + PORT_DOWN(ha,t) = 0; + } else { + /* retry the login again */ + ha->device_flags |= RELOGIN_NEEDED; + DEBUG(printk("dpc: Retry %d logged in ID %x\n",PORT_DOWN(ha,t), + ha->fc_db[t].loop_id);) + } + } + } + } + DEBUG(printk("dpc: qla2100_login_end.\n");) + } + + /* v2.19.5 */ + if ( (ha->device_flags & LOGIN_RETRY_NEEDED) && + !ha->loop_state != LOOP_DOWN ) { /* v2.19.5 */ + ha->device_flags &= ~LOGIN_RETRY_NEEDED; + DEBUG(printk("dpc: qla2100_login_retry\n");) + qla2100_loop_resync(ha); + DEBUG(printk("dpc: qla2100_login_retry end.\n");) + } + + /* v2.19.5b5 */ + if( ha->flags.loop_resync_needed ) { + if( (ha->device_flags & RSCN_UPDATE ) ) { + DEBUG(printk("dpc: qla2100_rscn_update\n");) + ha->device_flags &= ~RSCN_UPDATE; + } + else + DEBUG(printk("dpc: qla2100_loop_resync\n");) + qla2100_loop_resync(ha); + DEBUG(printk("dpc: qla2100_loop_resync/rscn_update done\n");) + } + + if( ha->flags.restart_queues_needed ) { + DEBUG(printk("dpc: calling qla2100_restart_queues\n");) + qla2100_restart_queues(ha,FALSE); + } + + if( ha->flags.abort_queue_needed ) { + DEBUG(printk("dpc: qla2100_abort_queues\n");) + qla2100_abort_queues(ha, FALSE); + } + if( !ha->interrupts_on ) + qla2100_enable_intrs(ha); + } + + if( ha->flags.done_requests_needed ) + ha->flags.done_requests_needed = FALSE; + + if( ha->done_q_first ) { + qla2100_done(ha, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + } + + ha->dpc_active = 0; + + /* The spinlock is really needed up to this point. (DB) */ + spin_unlock_irqrestore(&io_request_lock, flags); + } + DEBUG(qla2100_print("dpc: DPC handler exiting\n");) + + /* + * Make sure that nobody tries to wake us up again. + */ + ha->dpc_wait = NULL; + ha->dpc_handler = NULL; + ha->dpc_active = 0; + + /* + * If anyone is waiting for us to exit (i.e. someone trying to unload + * a driver), then wake up that process to let them know we are on + * the way out the door. This may be overkill - I *think* that we + * could probably just unload the driver and send the signal, and when + * the error handling thread wakes up that it would just exit without + * needing to touch any memory associated with the driver itself. + */ + if( ha->dpc_notify != NULL ) + up(ha->dpc_notify); + + +} + +/************************************************************************** +* qla2100_device_queue_depth +* Determines the queue depth for a given device. There are two ways +* a queue depth can be obtained for a tagged queueing device. One +* way is the default queue depth which is determined by whether +* If it is defined, then it is used +* as the default queue depth. Otherwise, we use either 4 or 8 as the +* default queue depth (dependent on the number of hardware SCBs). +**************************************************************************/ +STATIC void qla2100_device_queue_depth(scsi_qla_host_t *p, Scsi_Device *device) { + int default_depth = 16; + + device->queue_depth = default_depth; + if( device->tagged_supported ) { + device->tagged_queue = 1; + device->current_tag = 0; +#ifdef MODULE + if( !(ql2xmaxqdepth == 0 || ql2xmaxqdepth > 256) ) + device->queue_depth = ql2xmaxqdepth; +#endif + + printk(KERN_INFO "scsi(%d:%d:%d:%d): Enabled tagged queuing, queue depth %d.\n", + (int)p->host_no, device->channel, device->id, + device->lun, device->queue_depth); + } else { + printk(KERN_WARNING "scsi(%d:%d:%d:%d):Device does not supoort tags queuing!!!.\n", + (int)p->host_no, device->channel, device->id, + device->lun); + } +} + +/************************************************************************** +* qla2100_select_queue_depth +* +* Description: +* Sets the queue depth for each SCSI device hanging off the input +* host adapter. We use a queue depth of 2 for devices that do not +* support tagged queueing. +**************************************************************************/ +STATIC void +qla2100_select_queue_depth(struct Scsi_Host *host, Scsi_Device *scsi_devs) { + Scsi_Device *device; + scsi_qla_host_t *p = (scsi_qla_host_t *) host->hostdata; + + ENTER("qla2100_select_queue_depth"); + for( device = scsi_devs; device != NULL; device = device->next ) { + if( device->host == host ) + qla2100_device_queue_depth(p, device); + } + LEAVE("qla2100_select_queue_depth"); +} + +/************************************************************************** +* ** Driver Support Routines ** +* +* qla2100_enable_intrs +* qla2100_disable_intrs +**************************************************************************/ +static inline void qla2100_enable_intrs(scsi_qla_host_t *ha) { + device_reg_t *reg; + + reg = ha->iobase; + ha->interrupts_on = 1; + /* enable risc and host interrupts */ + WRT_REG_WORD(®->ictrl, (ISP_EN_INT+ ISP_EN_RISC)); +} + +static inline void qla2100_disable_intrs(scsi_qla_host_t *ha) { + device_reg_t *reg; + + reg = ha->iobase; + ha->interrupts_on = 0; + /* disable risc and host interrupts */ + WRT_REG_WORD(®->ictrl, 0); +} + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) +/************************************************************************** +* mdelay +* Delay in milliseconds +* +**************************************************************************/ +STATIC inline void +mdelay(int milliseconds) { + int i; + + for( i=0; is_next) ) + *done_q_last = NULL; + else + (*done_q_first)->s_prev = NULL; + qla2100_stats.done_q_cnt--; + DEBUG(sp->state = 5;) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + DRIVER_UNLOCK +#endif + QLA2100_TIMER_UNLOCK(ha); + cmd = sp->cmd; + b = SCSI_BUS_32(cmd); + t = SCSI_TCN_32(cmd); + l = SCSI_LUN_32(cmd); + q = GET_LU_Q(ha, b, t, l); + + /* Decrement outstanding commands on device. */ + if( q->q_outcnt ) + q->q_outcnt--; + if( q->q_outcnt < ha->hiwat ) { + q->q_flag &= ~QLA2100_QBUSY; + } + + q->io_cnt++; + + switch( (CMD_RESULT(cmd)>>16) ) { + case DID_RESET: + q->q_flag &= ~QLA2100_QRESET; + /* Issue marker command. */ + qla2100_marker(ha, b, t, 0, MK_SYNC_ID); + break; + case DID_ABORT: + sp->flags &= ~SRB_ABORT_PENDING; + sp->flags |= SRB_ABORTED; + if( sp->flags & SRB_TIMEOUT ) + CMD_RESULT(sp->cmd)= DID_TIME_OUT << 16; + break; + default: + break; + } + + /* 4.10 64 and 32 bit */ + /* Release memory used for this I/O */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + if (cmd->use_sg) { + /* DEBUG(sprintf(debug_buff, + "S/G unmap_sg cmd=%x\n\r",cmd);) + DEBUG(qla2100_print(debug_buff)); */ + pci_unmap_sg(ha->pdev, cmd->request_buffer, + cmd->use_sg, + scsi_to_pci_dma_dir(cmd->sc_data_direction)); + } + else if (cmd->request_bufflen) { + /* DEBUG(sprintf(debug_buff, + "No S/G unmap_single cmd=%x saved_dma_handle=%lx\n\r", + cmd,sp->saved_dma_handle);) + DEBUG(qla2100_print(debug_buff);) */ + pci_unmap_single(ha->pdev,sp->saved_dma_handle, + cmd->request_bufflen, + scsi_to_pci_dma_dir(cmd->sc_data_direction)); + } +#endif + /* Call the mid-level driver interrupt handler */ + /* DEBUG(sprintf(debug_buff," [%d] ",cmd->pid);) + DEBUG(qla2100_print(debug_buff);) */ + + qla2100_callback(ha,sp,TRUE); + qla2100_next(ha, q); + } + + + COMTRACE('d') + /* LEAVE("qla2100_done"); */ +} + +/************************************************************************** +* qla2100_return_status +* Translates a ISP error to a Linux SCSI error +**************************************************************************/ +STATIC int qla2100_return_status(scsi_qla_host_t *ha, + sts_entry_t *sts, Scsi_Cmnd *cp) { + int host_status = DID_ERROR; + int scsi_status; + int comp_status; + unsigned resid; + srb_t *sp; + uint32_t t; + uint8_t *strp; + scsi_lu_t *up; + +#if DEBUG_QLA2100_INTR + STATIC char *reason[] = { + "DID_OK", + "DID_NO_CONNECT", + "DID_BUS_BUSY", + "DID_TIME_OUT", + "DID_BAD_TARGET", + "DID_ABORT", + "DID_PARITY", + "DID_ERROR", + "DID_RESET", + "DID_BAD_INTR" + }; +#endif /* DEBUG_QLA2100_INTR */ + + ENTER("qla2100_return_status"); + +#if DEBUG_QLA2100_INTR + /* + DEBUG(printk("qla2100: compl status = 0x%04x\n", sts->comp_status)); + */ +#endif + scsi_status = sts->scsi_status; + comp_status = sts->comp_status; + sp = (srb_t *) CMD_SP(cp); + + if( (scsi_status & SS_RESIDUAL_OVER) ) + comp_status = CS_DATA_OVERRUN; + else if( (scsi_status & SS_RESPONSE_INFO_LEN_VALID) && + sts->rsp_info[3] == (uint8_t) 0 ) + comp_status = CS_COMPLETE; + + /* If scanning and missing lun then let the scsi layer skip it */ + /* 4.24 dg 01/18/2001 */ + if( cp->cmnd[0] == 0x12 && + cp->lun == 0 ) { /* inquiry */ + strp = (uint8_t *)cp->request_buffer; + up = (scsi_lu_t *) GET_LU_Q(ha, 0, cp->target, cp->lun); + if( *strp == 0x7f && up->io_cnt < 5) { + /* Make lun unassigned and wrong type */ + *strp = 0x23; + } + } + + switch( comp_status ) { + case CS_COMPLETE: + host_status = DID_OK; + /* v2.19.5b2 Reset port down retry on success. */ + sp->port_down_retry_count = ha->port_down_retry_count; + break; + case CS_PORT_UNAVAILABLE: + /* release target data structure */ + host_status = DID_NO_CONNECT; + DEBUG(sprintf(debug_buff,"scsi: Unavail port detected 0x%x-0x%x.\n", + sts->comp_status, sts->scsi_status); ) + DEBUG(qla2100_print(debug_buff);) + break; + case CS_PORT_LOGGED_OUT: + case CS_PORT_CONFIG_CHG: + case CS_PORT_BUSY: + case CS_INCOMPLETE: + host_status = DID_NO_CONNECT; + DEBUG(sprintf(debug_buff,"scsi: Port Error detected 0x%x-0x%x.\n", + sts->comp_status, sts->scsi_status); ) + DEBUG(qla2100_print(debug_buff);) + break; + case CS_RESET: + host_status = DID_RESET; + break; + case CS_ABORTED: + /* v2.19.12 - DID_ABORT does not retry the request */ + /* if we aborted this request then abort otherwise it must be a reset */ + if ( (sp->flags & SRB_ABORT_PENDING) ) + host_status = DID_ABORT; + else + host_status = DID_RESET; + break; + case CS_TIMEOUT: + host_status = DID_ERROR; + /* v2.19.8 if timeout then check to see if logout occurred*/ + t = SCSI_TCN_32(cp); + if ( (ha->fc_db[t].flag & DEV_PUBLIC) && + (sts->status_flags & IOCBSTAT_SF_LOGO) ) { + ha->fc_db[t].flag |= DEV_RELOGIN; + DEBUG(printk("scsi: Timeout occurred with Logo, status flag (%x) with public device loop id (%x), attempt new recovery\n", + sts->status_flags, ha->fc_db[t].loop_id);) + /* Suspend port */ + PORT_DOWN(ha,t) = ha->port_down_retry_count; + ha->device_flags |= RELOGIN_NEEDED; + } + break; + case CS_DATA_UNDERRUN: + resid = sts->residual_length; + /* if RISC reports underrun and target does not report it + * then we must have a lost frame, so tell upper layer + * to retry it by reporting an error. + */ + if( !(sts->scsi_status & SS_RESIDUAL_UNDER) ) { + resid = (unsigned)(CMD_XFRLEN(cp)); + } + + if( (unsigned)(CMD_XFRLEN(cp) - resid) < cp->underflow ) { + host_status = DID_ERROR; + DEBUG3(sprintf(debug_buff,"scsi: Underflow detected - retrying command.\n");) + DEBUG3(qla2100_print(debug_buff);) + } else { + /* v2.19.5b2 Reset port down retry on success. */ + sp->port_down_retry_count = ha->port_down_retry_count; + host_status = DID_OK; + } + break; + + default: + DEBUG3(printk("scsi: Error detected 0x%x-0x%x.\n", + sts->comp_status, sts->scsi_status);) + host_status = DID_ERROR; + break; + } + +#if DEBUG_QLA2100_INTR + sprintf(debug_buff, "qla2100 ISP status: host status (%s) scsi status %x\n\r", reason[host_status], scsi_status); + DEBUG(qla2100_print(debug_buff);) +#endif + + LEAVE("qla2100_return_status"); + + return ((scsi_status & STATUS_MASK) | (host_status << 16) ); +} + +/* +* qla2100_done_q_put +* Place SRB command on done queue. +* +* Input: +* ha = host pointer +* sp = srb pointer. +* done_q_first = done queue first pointer. +* done_q_last = done queue last pointer. +*/ +STATIC void +qla2100_done_q_put(scsi_qla_host_t *ha, srb_t *sp, srb_t **done_q_first, srb_t **done_q_last) { + + unsigned long cpu_flags = 0; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_put_done_q"); +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + DRIVER_LOCK +#else + QLA2100_TIMER_LOCK(ha); +#endif + /* Place block on done queue */ + sp->s_next = NULL; + sp->s_prev = *done_q_last; + if( !*done_q_first ) + *done_q_first = sp; + else + (*done_q_last)->s_next = sp; + *done_q_last = sp; + + qla2100_stats.done_q_cnt++; + DEBUG(sp->state = 3;) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + DRIVER_LOCK +#else + QLA2100_TIMER_UNLOCK(ha); +#endif + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_put_done_q"); +#endif +} + + +/************************************************************************** +* qla2100_timer +* +* Description: +* One second timer +* +* Context: Interrupt +**************************************************************************/ +STATIC void +qla2100_timer(scsi_qla_host_t *ha) { + + srb_t *sp, *sp_next; + int stop_timer, kick_off = 0; + int cnt; + int t; + /* unsigned long cpu_flags = 0; */ + + + /* ENTER("qla2100_timer"); */ + + /* v2.19.02 spin_lock_irqsave(&io_request_lock, cpu_flags); */ + + stop_timer = 0; + + for( t = 0; t < ha->max_targets; t++ ) { + if( TGT_Q(ha, 0, t) == NULL ) + continue; + if( TGT_Q(ha, 0, t)->down_timer > 0 ) + TGT_Q(ha, 0, t)->down_timer--; + } + + /* Port Down Handler. */ + if( ha->queue_restart_timer > 0 ) { + ha->queue_restart_timer--; +#ifdef TRACECODE + sprintf(debug_buff,"timer: Port down time in secs %d\n",ha->queue_restart_timer); + qla2100_print(debug_buff); +#endif + /* + * When a port goes DOWN, we suspend the queue and wait 1 second + * (one timer tick) before trying to kick off the commands again. + * We will do this for "port_down_retry_count" times per + * command before giving up on the command altogether. + */ + if( !ha->queue_restart_timer ) { + ha->flags.port_restart_needed = TRUE; + DEBUG(qla2100_print("qla2100_timer: Port Down complete - restarting commands in the queues\n");) + stop_timer++; + } + } + /* Loop down handler. */ + if( ha->loop_down_timer > 0 && + !ha->flags.abort_isp_active && + ha->flags.online ) { + if( ha->loop_down_timer == LOOP_DOWN_TIME ) { + DEBUG(printk("qla2100_timer: Loop Down time expired - aborting the queues before time expire\n");) +#ifdef TRACECODE + qla2100_print("qla2100_timer: Loop Down - aborting the queues before time expire\n"); +#endif +#if 1 + ha->flags.abort_queue_needed = TRUE; +#else + qla2100_abort_queues(ha, TRUE); +#endif + } + + ha->loop_down_timer--; +#ifdef TRACECODE + sprintf(debug_buff,"qla2100_timer: Loop Down - seconds remainning %d\n",ha->loop_down_timer); + qla2100_print(debug_buff); +#endif + /* if the loop has been down for 4 minutes on QLA2100, + reinit adapter */ + if( !ha->loop_down_timer ) { +#ifdef TRACECODE + qla2100_print("qla2100_timer: Loop down for 4 mins \n"); +#endif + DEBUG(printk("qla2100_timer: Loop down exceed 4 mins -restarting queues and abort ISP.\n");) + ha->flags.restart_queues_needed = TRUE; + if ( (ha->device_id == QLA2100_DEVICE_ID) && + (qla2100_reinit == 1 )) + ha->flags.isp_abort_needed = TRUE; + stop_timer++; + } + } + + /* + * Retry Handler -- This handler will recycle queued requests until the + * temporary loop down condition terminates. + */ + if( !ha->flags.abort_isp_active ) { +#ifdef TRACECODE + if( ha->retry_q_first ) + qla2100_print("qla2100_timer: Scanning for timed out commands\n"); +#endif + for( cnt=0, sp = ha->retry_q_first; (sp); sp = sp_next ) { + if( sp->wdg_time ) + sp->wdg_time--; + sp_next = sp->s_next; + if( sp->wdg_time == 0 ) { + kick_off++; + DEBUG3(sprintf(debug_buff,"timer: CMD timeout %p, pid %d\n",sp, sp->cmd->pid);) + DEBUG3(qla2100_print(debug_buff);) + cnt++; + qla2100_timeout_remove(ha, sp); + CMD_RESULT(sp->cmd) = DID_BUS_BUSY << 16; + CMD_HANDLE(sp->cmd) = (unsigned char *) NULL; + qla2100_done_q_put(ha, sp, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + } + } + + if( cnt > 0 ) { + DEBUG2(sprintf(debug_buff,"timer: found %d requests\n",cnt);) + DEBUG2(qla2100_print(debug_buff);) + } + } + + if( ha->done_q_first ) + ha->flags.done_requests_needed = TRUE; + + if( ha->dpc_flags & ISP_RESET_NEEDED) { + ha->dpc_flags &= ~ISP_RESET_NEEDED; + ha->flags.isp_abort_needed = TRUE; + } + + +#if QLA2100_LIPTEST + if( (ha->forceLip++) == (60*3) && qla2100_lip) { + /* qla2100_loop_reset(ha); */ + qla2100_abort_isp(ha); + ha->forceLip = 0; + } +#endif + /* v2.19.02 spin_unlock_irqrestore(&io_request_lock, cpu_flags); */ + + /* Schedule the DPC routine if needed */ + if( ( ha->flags.isp_abort_needed || + (!ha->flags.loop_resync_active && ha->flags.loop_resync_needed) || + ha->flags.restart_queues_needed || + ha->flags.port_restart_needed || + ha->flags.done_requests_needed || + (ha->device_flags & RELOGIN_NEEDED) || + (ha->dpc_flags & COMMAND_WAIT_NEEDED) || + (ha->device_flags & LOGIN_RETRY_NEEDED) || + kick_off > 0 || + ha->flags.abort_queue_needed ) && + ha->dpc_wait && !ha->dpc_active ) { /* v2.19.4 */ + up(ha->dpc_wait); + } + + /* IOCTL SCSI Pass Thru Handler. */ + if (ha->IoctlPassThru_InProgress) { + if (ha->ioctl_timer) ha->ioctl_timer--; + } + + /* IOCTL FCCT Pass Thru Handler. */ + if (ha->IoctlPassFCCT_InProgress) { + if (ha->ioctl_timer) ha->ioctl_timer--; + } + + /* ha->flags.watchdog_enabled = FALSE; */ + RESTART_TIMER(qla2100_timer,ha,WATCH_INTERVAL); + + /* LEAVE("qla2100_timer"); */ +} + +/* +* qla2100_timeout_insert +* Function used to insert a command block onto the +* watchdog timer queue. +* +* Note: Must insure that sc_time is not zero +* before calling qla2100_timeout_insert. +* +* Input: +* ha = adapter block pointer. +* sp = srb pointer. +*/ +STATIC void +qla2100_timeout_insert(scsi_qla_host_t *ha, srb_t *sp) { + unsigned long cpu_flags = 0; + uint8_t timeoutcnt; + +#ifdef QL_DEBUG_LEVEL_3 + /* ENTER("qla2100_timeout_insert"); */ +#endif + + /* Compute number of time intervals */ + timeoutcnt = (uint8_t) (CMD_TIMEOUT(sp->cmd)/(WATCH_INTERVAL * HZ)); + if( timeoutcnt >= 3 ) /* 3 or more */ + /* sp->wdg_time = timeoutcnt - 3; */ + sp->wdg_time = 3; + else + sp->wdg_time = 1; + + DEBUG3(sprintf(debug_buff,"Watchdog (insert) - pid=%d, tmo=%d \n",sp->cmd->pid,sp->wdg_time);) + DEBUG3(qla2100_print(debug_buff);) + + /* Acquire watchdoq queue specific lock */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + DRIVER_LOCK +#else + QLA2100_TIMER_LOCK(ha); +#endif + /* Add command to queue */ + if (ha->retry_q_first == NULL) { + ha->retry_q_first = sp; + ha->retry_q_last = sp; + } else { + ha->retry_q_last->s_next = sp; + ha->retry_q_last = sp; + } + sp->s_next = NULL; + qla2100_stats.retry_q_cnt++; + sp->state = 0xd0; + + sp->flags |= SRB_WATCHDOG; + ha->flags.watchdog_enabled = TRUE; + + /* Release watchdog queue specific lock */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + DRIVER_UNLOCK +#else + QLA2100_TIMER_UNLOCK(ha); +#endif + +#ifdef QL_DEBUG_LEVEL_3 + /* LEAVE("qla2100_timeout_insert"); */ +#endif +} + +/* +* qla2100_timeout_remove +* Function used to remove a command block from the +* watchdog timer queue. +* +* Note: Must insure that command is on watchdog +* list before calling qla2100_timeout_remove. +* if (sp->flags & SRB_WATCHDOG) +* +* Input: +* ha = adapter block pointer. +* sp = srb pointer. +*/ +STATIC void +qla2100_timeout_remove(scsi_qla_host_t *ha, srb_t *sp) { + unsigned long cpu_flags = 0; + srb_t *nextsp; + +#ifdef QL_DEBUG_LEVEL_3 + /* ENTER("qla2100_timeout_remove"); */ +#endif + + DEBUG3(sprintf(debug_buff,"Watchdog (remove) pid=%d time%d\n",sp->cmd->pid,sp->wdg_time);) + DEBUG3(qla2100_print(debug_buff);) + + /* Acquire watchdoq queue specific lock */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + DRIVER_LOCK +#else + QLA2100_TIMER_LOCK(ha); +#endif + /* Remove command block from watchdog queue. */ + if (ha->retry_q_first != NULL) { + if (ha->retry_q_first == sp) { + /* Remove from top of queue */ + ha->retry_q_first = sp->s_next; + if (ha->retry_q_first == NULL) { + + ha->retry_q_last = NULL; + ha->flags.watchdog_enabled = FALSE; + } + } else { + /* Remove from middle of queue or bottom of queue */ + for (nextsp = ha->retry_q_first; nextsp->s_next != NULL; + nextsp = nextsp->s_next) { + if (nextsp->s_next == sp) { + nextsp->s_next = sp->s_next; + if (nextsp->s_next == NULL) + ha->retry_q_last = nextsp; + break; + } + } + } + sp->flags &= ~SRB_WATCHDOG; + qla2100_stats.retry_q_cnt--; + } + + /* Release watchdog queue specific lock */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + DRIVER_UNLOCK +#else + QLA2100_TIMER_UNLOCK(ha); +#endif + +#ifdef QL_DEBUG_LEVEL_3 + /* LEAVE("qla2100_timeout_remove"); */ +#endif +} + +/* +* qla2100_next +* Retrieve and process next job in the queue. +* +* Input: +* ha = adapter block pointer. +* q = SCSI LU pointer. +* SCSI_LU_Q lock must be already obtained and no other locks. +* +* Output: +* Releases SCSI_LU_Q upon exit. +*/ +STATIC void +qla2100_next(scsi_qla_host_t *ha, scsi_lu_t *q) { + srb_t *sp; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + unsigned long cpu_flags = 0; +#endif + uint8_t status; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_next"); +#endif + + DRIVER_LOCK + COMTRACE('N') + while( ((sp = q->q_first) != NULL) && /* we have a pending cmds */ + !(q->q_flag & QLA2100_QBUSY) && /* device can accept more cmds */ + !((q->q_flag & QLA2100_QSUSP) && /* device queue not suspended */ + !ha->flags.abort_isp_active && /* adapter abort active */ + !ha->loop_down_timer) ) /* down timer not active */ + { + /* Remove srb from SCSI LU queue. */ + qla2100_removeq(q, sp); + sp->state = 0x32; + /* Set busy flag if reached high water mark. */ + q->q_outcnt++; + if( q->q_outcnt >= ha->hiwat ) { + q->q_flag |= QLA2100_QBUSY; + } + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + if( ha->flags.enable_64bit_addressing ) + status = qla2100_64bit_start_scsi(ha, sp); + else +#endif + status = qla2100_32bit_start_scsi(ha, sp); + + if( status ) { + qla2100_putq_t(q, sp); + + if( q->q_outcnt ) + q->q_outcnt--; + if( q->q_outcnt < ha->hiwat ) + q->q_flag &= ~QLA2100_QBUSY; + break; + } + } + + COMTRACE('n') + DRIVER_UNLOCK + /* Release SCSI LU queue specific lock */ + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_next"); +#endif +} +#if 0 +/******************************************************* +v4.10 +* This function has been de-implemented +* All DMAable memory is allocated on the spot +* according to what kernel version is in effect. +******************************************************** +* qla2100_alloc_phys +* Function used to allocate physical memory +* and zero it. +* +* Input: +* size = size in bytes. +* flag = sleep flag. +* phy_addr = physical address pointer. +* +* Returns: +* not NULL = success +*/ +STATIC void * +qla2100_alloc_phys(int siz, u_long *phy_addr) { + void *mem = NULL; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_alloc_phys"); +#endif + mem = KMALLOC(siz); + if( mem != NULL ) { + *phy_addr = VIRT_TO_BUS(mem); + BZERO((caddr_t)mem, siz); + DEBUG5(sprintf(debug_buff,"qla2100: get phys mem =0x%lx\n\r",(long)*phy_addr)); + DEBUG5(qla2100_print(debug_buff);) + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( mem == NULL ) + qla2100_print("qla2100_alloc_phys: **** FAILED ****\n\r"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_alloc_phys"); +#endif + return(mem); +} +#endif + +/* +* qla2100_putq_t +* Add the standard SCB job to the top of standard SCB commands. +* +* Input: +* q = SCSI LU pointer. +* sp = srb pointer. +* SCSI_LU_Q lock must be already obtained. +*/ +STATIC void +qla2100_putq_t(scsi_lu_t *q, srb_t *sp) { + srb_t *srb_p; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + unsigned long cpu_flags = 0; +#endif + +#ifdef QL_DEBUG_LEVEL_3 + /* ENTER("qla2100_putq_t"); */ +#endif + DRIVER_LOCK + DEBUG5(sprintf(debug_buff,"Adding to queue 0x%x<-(0x%x)\n\r",q,sp)); + DEBUG5(qla2100_print(debug_buff)); + sp->s_next = NULL; + q->q_incnt++; + sp->state = 2; + /* v2.19.6 */ + if( !q->q_first || !q->q_last) /* If queue empty */ + { + sp->s_prev = NULL; + q->q_first = sp; + q->q_last = sp; + } else { + srb_p = q->q_first; + while( srb_p ) + srb_p = srb_p->s_next; + + if( srb_p ) { + sp->s_prev = srb_p->s_prev; + if( srb_p->s_prev ) + srb_p->s_prev->s_next = sp; + else + q->q_first = sp; + srb_p->s_prev = sp; + sp->s_next = srb_p; + } else { + sp->s_prev = q->q_last; + q->q_last->s_next = sp; + q->q_last = sp; + } + } + + DRIVER_UNLOCK +#ifdef QL_DEBUG_LEVEL_3 + /* LEAVE("qla2100_putq_t"); */ +#endif +} + +/* +* qla2100_removeq +* Function used to remove a command block from the +* LU queue. +* +* Input: +* q = SCSI LU pointer. +* sp = srb pointer. +* SCSI_LU_Q lock must be already obtained. +*/ +STATIC void +qla2100_removeq(scsi_lu_t *q, srb_t *sp) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + unsigned long cpu_flags = 0; +#endif + DEBUG5(sprintf(debug_buff,"Removing from device_q (0x%x)->(0x%x)\n\r",q,sp)); + DEBUG5(qla2100_print(debug_buff)); + DRIVER_LOCK + if( sp->s_prev ) { + if( (sp->s_prev->s_next = sp->s_next) != NULL ) + sp->s_next->s_prev = sp->s_prev; + else + q->q_last = sp->s_prev; + } else if( !(q->q_first = sp->s_next) ) + q->q_last = NULL; + else + q->q_first->s_prev = NULL; + q->q_incnt--; + DRIVER_UNLOCK +} + +/* +* qla2100_callback +* Returns the completed SCSI command to LINUX. +* +* Returns: +* None +*/ +static inline void qla2100_callback(scsi_qla_host_t *ha, srb_t *sp, uint8_t dec) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + unsigned long cpu_flags = 0; +#endif + + CMD_HANDLE(sp->cmd) = (unsigned char *) NULL; + sp->flags &= ~SRB_SENT; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + DRIVER_LOCK +#endif +#if 0 + if( dec ) + ha->actthreads--; +#endif + + /* v2.19.14 + * Perform internal retries, if needed. + */ + switch( (CMD_RESULT(sp->cmd)>>16) ) { + case DID_ERROR: + if( sp->retry_count > 0 ) { + sp->retry_count--; + DEBUG3(printk("qla2100: RETRY - os retry %d, drv retry %d, port retry %d\n\r",sp->cmd->retries,sp->retry_count,sp->port_down_retry_count)); + CMD_RESULT(sp->cmd) = (int) DID_BUS_BUSY << 16; + } else { + sp->retry_count = ha->retry_count; + /* all resetted commands must return with RESET */ + if(sp->cmd->flags & IS_RESETTING ) { + CMD_RESULT(sp->cmd) = (int) DID_RESET << 16; + DEBUG3(printk("qla2100: RESET cmd %p\n",sp->cmd)); + } + DEBUG3(printk("qla2100: OSerr = %p\n\r",sp->cmd)); + } + break; + default: + break; + } + + /* Call the mid-level driver interrupt handler */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + sti(); + (*(sp->cmd)->scsi_done)(sp->cmd); + cli(); +#else + (*(sp->cmd)->scsi_done)(sp->cmd); +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + DRIVER_UNLOCK +#endif +} + +/* +* qla2100_mem_alloc +* Allocates adapter memory. +* +* Returns: +* 0 = success. +* 1 = failure. +*/ +STATIC uint8_t +qla2100_mem_alloc(scsi_qla_host_t *ha) { + + uint8_t status = 1; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_mem_alloc"); +#endif + + /* 4.10 */ + /* get consistent memory allocated for request/response rings */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + ha->request_ring = &ha->req[0]; + ha->request_dma = VIRT_TO_BUS(&ha->req[0]); + ha->response_ring = &ha->res[0]; + ha->response_dma = VIRT_TO_BUS(&ha->res[0]); +#ifdef FC_IP_SUPPORT + ha->pIpBufferQueue = &ha->asIpBuffers[0]; + ha->ppIpBufferQueueLow = VIRT_TO_BUS_LOW(&ha->asIpBuffers[0]); + ha->ppIpBufferQueueHigh = VIRT_TO_BUS_HIGH(&ha->asIpBuffers[0]); +#endif /* FC_IP_SUPPORT */ +#else /* KERNEL >= 2.3.18 */ + ha->request_ring = pci_alloc_consistent(ha->pdev, + ((REQUEST_ENTRY_CNT+1)*(sizeof(request_t))), + &ha->request_dma); + ha->response_ring = pci_alloc_consistent(ha->pdev, + ((RESPONSE_ENTRY_CNT+1)*(sizeof(response_t))), + &ha->response_dma); +#ifdef FC_IP_SUPPORT + /* not ported yet to new pci_alloc_consistent */ + ha->pIpBufferQueue = &ha->asIpBuffers[0]; + ha->ppIpBufferQueueLow = VIRT_TO_BUS_LOW(&ha->asIpBuffers[0]); + ha->ppIpBufferQueueHigh = VIRT_TO_BUS_HIGH(&ha->asIpBuffers[0]); +#endif +#endif + /* 4.10 */ + /* get consistent memory allocated for init control block */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + ha->init_cb = KMALLOC(sizeof(init_cb_t)); + if( ha->init_cb != NULL ) { + ha->init_cb_dma = VIRT_TO_BUS(ha->init_cb); + BZERO((caddr_t)ha->init_cb, sizeof(init_cb_t)); + } +#else + ha->init_cb = pci_alloc_consistent(ha->pdev, + sizeof(init_cb_t), + &ha->init_cb_dma); + BZERO((caddr_t)ha->init_cb, sizeof(init_cb_t)); +#endif + if( ha->init_cb ) status = 0; + + if( status ) + printk(KERN_WARNING "qla2100_mem_alloc: **** FAILED ****\n"); + +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_mem_alloc"); +#endif + return(status); +} + +/* +* qla2100_mem_free +* Frees all adapter allocated memory. +* +* Input: +* ha = adapter block pointer. +*/ +STATIC void +qla2100_mem_free(scsi_qla_host_t *ha) { + tgt_t *tgt; + uint32_t b, t; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_mem_free"); +#endif + if( ha ) { + /* Free the target queues */ + b = 0; + for( t = 0; t < MAX_FIBRE_DEVICES; t++ ) { + tgt = TGT_Q(ha, b, t); + if( tgt ) + qla2100_tgt_dealloc(ha, tgt); + } + + /* Free host database. */ + if (ha->phost_db != NULL) { + KMFREE(ha->phost_db, sizeof(fcdev_t) * MAX_HOST_COUNT); + } + + /* 4.10 */ + /* free consistent memory allocated for request and response rings */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + pci_free_consistent(ha->pdev, + ((REQUEST_ENTRY_CNT+1)*(sizeof(request_t))), + ha->request_ring, ha->request_dma); + + pci_free_consistent(ha->pdev, + ((RESPONSE_ENTRY_CNT+1)*(sizeof(response_t))), + ha->response_ring, ha->response_dma); +#endif + /* free memory allocated for ioctl operations */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + KMFREE(ha->ioctl_mem, PAGE_SIZE); +#else + pci_free_consistent(ha->pdev, PAGE_SIZE, + ha->ioctl_mem, ha->ioctl_mem_phys); +#endif + /* free memory allocated for init_cb */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + KMFREE(ha->init_cb, sizeof(init_cb_t)); +#else + pci_free_consistent(ha->pdev, sizeof(init_cb_t), + ha->init_cb, ha->init_cb_dma); +#endif + } + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_mem_free"); +#endif +} + +/* +* qla2100_tgt_alloc +* Allocates a target queue structure. +* +* Input: +* ha = adapter block pointer. +* +* Returns +* target queue structure = success: +* NULL = otherwise +*/ +static inline tgt_t * +qla2100_tgt_alloc(scsi_qla_host_t *ha) { + tgt_t *tgt; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_tgt_alloc"); +#endif + + tgt = (tgt_t *)KMALLOC(sizeof(tgt_t)); /* Could Sleep here */ + if( tgt != NULL ) { + BZERO(tgt,sizeof(tgt_t)); + DEBUG(sprintf(debug_buff,"Alloc Target @ %08x \n",tgt);) + DEBUG(qla2100_print(debug_buff);) + } + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_tgt_alloc"); +#endif + return(tgt); +} + +/* +* qla2100_lun_alloc +* Allocates a logical device queue structure and lock +* +* Returns: +* SCSI LU structure pointer +*/ +STATIC inline scsi_lu_t * +qla2100_lun_alloc(void) { + scsi_lu_t *q; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_lun_alloc"); +#endif + + q = (scsi_lu_t *)KMALLOC(sizeof(scsi_lu_t)); /* Sleep */ + BZERO(q,sizeof(struct scsi_lu)); + DEBUG(sprintf(debug_buff,"Alloc Lun @ %08x \n",q);) + DEBUG(qla2100_print(debug_buff);) + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_lun_alloc"); +#endif + return(q); +} + +/* +* qla2100_tgt_dealloc +* Deallocates a target and all logical device queue structures. +* +* Input: +* ha = adapter block pointer. +* tgt = Target queue structure pointer +*/ +static inline void +qla2100_tgt_dealloc(scsi_qla_host_t *ha, tgt_t *tgt) { + uint32_t l; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_tgt_dealloc"); +#endif + + if( tgt != NULL ) { + /* Insure all LUN memory is released. */ + for( l = 0; l < ha->max_luns; l++ ) { + if( tgt->luns[l] ) + qla2100_lun_dealloc(tgt->luns[l]); + } + KMFREE(tgt, sizeof(tgt_t)); + } + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_tgt_dealloc"); +#endif +} + +/* +* qla2100_lun_dealloc +* Deallocates a logical unit queue structure. +* +* Input: +* q = SCSI LU structure pointer +*/ +static inline void +qla2100_lun_dealloc(scsi_lu_t *q) { +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_lun_dealloc"); +#endif + if( q != NULL ) { + DEBUG(sprintf(debug_buff,"Dealloc Lun @ %08x -- deleted\n",q);) + DEBUG(qla2100_print(debug_buff);) + KMFREE(q, sizeof(scsi_lu_t)); + } +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_lun_dealloc"); +#endif + +} + +/* +* qla2100_abort_queue_single +* Abort all commands on a device queues. +* +* Input: +* ha = adapter block pointer. +*/ +STATIC void qla2100_abort_queue_single(scsi_qla_host_t *ha,uint32_t b,uint32_t t,uint32_t l,uint32_t stat) { + scsi_lu_t *q; + srb_t *sp; + + ENTER("qla2100_abort_queue_single"); + /* dg - 08/23/99 + * We don't want to try and abort queues that don't exists + * (i.e. the device is not configure on the loop ) + */ + if( ha->loop_down_timer > 0 ) { + return; + } + DEBUG5(sprintf(debug_buff,"Abort queue single %2d:%2d:%2d:%2d\n", + ha->host_no,b,t,l);) + DEBUG5(qla2100_print(debug_buff);) + q = (scsi_lu_t * )GET_LU_Q(ha, b, t, l); + while( q != NULL && (sp = q->q_first) != NULL ) { + /* Acquire LU queue specific lock */ + + qla2100_removeq(q, sp); + + /* Release LU queue specific lock */ + CMD_RESULT(sp->cmd) = stat; + qla2100_done_q_put(ha, sp, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + } + LEAVE("qla2100_abort_queue_single"); +} + +/****************************************************************************/ +/* QLogic ISP2100 Hardware Support Functions. */ +/****************************************************************************/ + +/* +* qla2100_initialize_adapter +* Initialize board. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success +*/ +uint8_t +qla2100_initialize_adapter(scsi_qla_host_t *ha) +{ + uint8_t status = QL_STATUS_SUCCESS; + uint8_t isp_init = 0; + uint8_t restart_risc = 0; + uint8_t retry; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_initialize_adapter"); +#endif + + /* Clear adapter flags. */ + ha->forceLip = 0; + ha->flags.online = FALSE; + ha->flags.isp_abort_needed = FALSE; + ha->flags.disable_host_adapter = FALSE; + ha->flags.loop_resync_active = FALSE; + ha->flags.reset_active = FALSE; + ha->flags.abort_isp_active = FALSE; + ha->flags.watchdog_enabled = FALSE; + ha->loop_down_timer = LOOP_DOWN_TIME; + ha->loop_state = LOOP_DOWN; + ha->flags.start_timer = FALSE; + ha->flags.done_requests_needed = FALSE; + ha->device_flags = 0; + ha->dpc_flags = 0; + ha->sns_retry_cnt = 0; + ha->host_db_ptr = 0; + ha->device_flags = 0; + /* 4.11 */ + ha->flags.managment_server_logged_in = 0; + + /* Allocate host database */ + ha->phost_db = (fcdev_t *)KMALLOC(sizeof(fcdev_t) * MAX_HOST_COUNT); + if (ha->phost_db != NULL) { + BZERO(ha->phost_db, sizeof(fcdev_t) * MAX_HOST_COUNT); + DEBUG(sprintf(debug_buff,"Alloc Host DB success. Max Cnt=%d.", + MAX_HOST_COUNT);) + DEBUG(qla2100_print(debug_buff);) + } else { + status = QL_STATUS_RESOURCE_ERROR; + } + + DEBUG(printk("Configure PCI space for adapter...\n")); + + if ( status == QL_STATUS_SUCCESS && + (status = qla2100_pci_config(ha)) == QL_STATUS_SUCCESS ) { + + qla2100_reset_chip(ha); + + /* Initialize Fibre Channel database. */ + qla2100_init_fc_db(ha); + + /* Initialize target map database. */ + qla2100_init_tgt_map(ha); + if( qla2100_verbose ) + printk(KERN_INFO + "scsi(%d): Configure NVRAM parameters...\n", + (int)ha->host_no); + + if( ha->device_id == QLA2100_DEVICE_ID ) + qla2100_nvram_config(ha); + else + qla2200_nvram_config(ha); + + /* v2.19.12 */ + ha->retry_count = ql2xretrycount; + + if( qla2100_verbose ) + printk(KERN_INFO + "scsi(%d): Verifying loaded RISC code...\n", + (int)ha->host_no); + + qla2100_set_cache_line(ha); + + /* If the user specified a device configuration on + * the command line then use it as the configuration. + * Otherwise, we scan for all devices. + */ + if ( ql2xdevconf ) { + qla2100_get_properties(ha, ql2xdevconf); + } + + retry = 10; + /* + * Try an configure the loop. + */ + do { + DEBUG(qla2100_print("qla2100_initialize_adapter: check " + "if firmware needs to be loaded\n");) + + /* If firmware needs to be loaded */ + if( qla2100_isp_firmware(ha) ) { + if( qla2100_verbose ) + printk(KERN_INFO + "scsi(%d): Verifying chip...\n", + (int)ha->host_no); + + if( (status = qla2100_chip_diag(ha)) == + QL_STATUS_SUCCESS ) + status = qla2100_setup_chip(ha); + + if( status == QL_STATUS_SUCCESS ) + DEBUG(printk("scsi(%d): Chip verified " + "and RISC loaded...\n", + (int)ha->host_no)); + } + + if ( status != QL_STATUS_SUCCESS ) + continue; + + status = qla2100_init_rings(ha); + + if ( status != QL_STATUS_SUCCESS ) + continue; + + /* dg - 7/3/1999 + * Wait for a successful LIP up to a maximum of + * (in seconds): RISC login timeout value, RISC + * retry count value, and port down retry value + * OR a minimum of 4 seconds OR If no cable, + * only 5 seconds. + */ + DEBUG(printk("scsi(%d): qla2100_init_rings OK, " + "call qla2100_fw_ready...\n", + (int)ha->host_no)); + DEBUG(qla2100_print("qla2100_init_rings OK, " + "call qla2100_fw_ready...\n");) + + if ( qla2100_fw_ready(ha) == QL_STATUS_SUCCESS ) { + ha->flags.reset_marker = FALSE; + + /* Go setup flash database devices + * with proper Loop ID's. + */ + do { + ha->flags.loop_resync_needed = FALSE; + status = qla2100_update_fc_db(ha, + FALSE); + } while( !ha->loop_down_timer && + ha->flags.loop_resync_needed ); + + /* If database was full and a device + * was not configured, try and reuse + * the slots. + */ + + if( status == QL_STATUS_FATAL_ERROR ) { + do { + ha->flags.loop_resync_needed = + FALSE; + status = + qla2100_update_fc_db(ha, + TRUE); + } while( !ha->loop_down_timer && + ha->flags.loop_resync_needed ); + } + } + if( ha->flags.update_config_needed ) { + ha->init_cb->additional_firmware_options.connection_options = ha->operating_mode; + restart_risc = 1; + } + isp_init = 1; + + } while( restart_risc && retry-- ); + + if( isp_init ) { + ha->flags.reset_marker = FALSE; + qla2100_marker(ha, 0, 0, 0, MK_SYNC_ALL); + + ha->flags.online = TRUE; + + /* Enable target response to SCSI bus. */ + if( ha->flags.enable_target_mode ) + qla2100_enable_lun(ha); + } + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if ( status != QL_STATUS_SUCCESS ) + qla2100_print("qla2100_initialize_adapter: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_initialize_adapter"); +#endif + + return(status); +} + +/* +* ISP Firmware Test +* Checks if present version of RISC firmware is older than +* driver firmware. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = firmware does not need to be loaded. +*/ +STATIC uint8_t +qla2100_isp_firmware(scsi_qla_host_t *ha) { + uint8_t status; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2x00_isp_firmware"); +#endif + + if( ha->flags.disable_risc_code_load ) { + /* Verify checksum of loaded RISC code. */ + mb[0] = MBC_VERIFY_CHECKSUM; + mb[1] = *QLBoardTbl_fc[ha->devnum].fwstart; + if( !(status = qla2100_mailbox_command(ha, BIT_1|BIT_0, &mb[0])) ) { + /* Start firmware execution. */ + mb[0] = MBC_EXECUTE_FIRMWARE; + mb[1] = *QLBoardTbl_fc[ha->devnum].fwstart; + qla2100_mailbox_command(ha, BIT_1|BIT_0, &mb[0]); + } + } else + status = 1; + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print( + "qla2100_isp_firmware: **** Return status=1; RISC Load Needed ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2x00_isp_firmware"); +#endif + return(status); +} + +/* +* (08/05/99) +* +* PCI configuration +* Setup device PCI configuration registers. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success. +*/ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95) +STATIC uint8_t +qla2100_pci_config(scsi_qla_host_t *ha) { + uint8_t status = 1; + uint32_t command; +#if MEMORY_MAPPED_IO + uint32_t page_offset, base; + uint32_t mmapbase; +#endif + config_reg_t *creg = 0; + uint16_t buf_wd; + + ENTER("qla2100_pci_config"); +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95) +/* 4.12 */ + /* turn on PCI master; for system BIOSes that don't turn + it on by default */ + pci_set_master(ha->pdev); + + if (ha->device_id == QLA2300_DEVICE_ID) { + pci_read_config_word(ha->pdev,OFFSET(creg->command), &buf_wd); + buf_wd = buf_wd | + PCI_COMMAND_IO | + PCI_COMMAND_MEMORY | + PCI_COMMAND_MASTER | + PCI_COMMAND_INVALIDATE | + PCI_COMMAND_PARITY | + PCI_COMMAND_SERR; + buf_wd = buf_wd & ~PCI_COMMAND_INVALIDATE; + pci_write_config_word(ha->pdev,OFFSET(creg->command), buf_wd); + /* temporary: set upper 32 bits of 64 bit address to 0 */ + buf_wd = 0; + pci_write_config_word(ha->pdev,PCI_BASE_ADDRESS_2, buf_wd); + } +#endif + pci_read_config_word(ha->pdev,OFFSET(creg->revision_id), &buf_wd); + ha->revision = buf_wd; + if( !ha->iobase ) { + /* Get command register. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + if( pci_read_config_word(ha->pdev,OFFSET(creg->command), &buf_wd) == PCIBIOS_SUCCESSFUL ) { +#else + if( pci_read_config_word(ha->pdev,OFFSET(creg->command), &buf_wd) == PCIBIOS_SUCCESSFUL ) { +#endif + command = buf_wd; + /* + * Set Bus Master Enable (bit-2), Memory Address Space Enable and + * reset any error bits. + */ + buf_wd &= ~0x7; +#if MEMORY_MAPPED_IO + DEBUG(printk("qla2100: I/O SPACE and MEMORY MAPPED IO is enabled.\n")); + buf_wd |= BIT_2 + BIT_1 + BIT_0; +#else + DEBUG(printk("qla2100: I/O SPACE Enabled and MEMORY MAPPED IO is disabled.\n")); + buf_wd |= BIT_2 + BIT_0; +#endif + if( pci_write_config_word(ha->pdev,OFFSET(creg->command), buf_wd) ) { + printk(KERN_WARNING "qla2100: Could not write config word.\n"); + } + /* Get expansion ROM address. */ + if( pci_read_config_word(ha->pdev, OFFSET(creg->expansion_rom), &buf_wd) == PCIBIOS_SUCCESSFUL ) { + /* Reset expansion ROM address decode enable. */ + buf_wd &= ~BIT_0; + if( pci_write_config_word(ha->pdev, OFFSET(creg->expansion_rom), buf_wd) == PCIBIOS_SUCCESSFUL ) { +#if MEMORY_MAPPED_IO + /* Get memory mapped I/O address. */ + pcibios_read_config_dword(ha->pci_bus, ha->pci_device_fn,OFFSET(cfgp->mem_base_addr), &mmapbase); + mmapbase &= PCI_BASE_ADDRESS_MEM_MASK; + + /* Find proper memory chunk for memory map I/O reg. */ + base = mmapbase & PAGE_MASK; + page_offset = mmapbase - base; + /* Get virtual address for I/O registers. */ + ha->mmpbase = ioremap(base,page_offset + 256); + if( ha->mmpbase ) { + ha->mmpbase += page_offset; + /* ha->iobase = ha->mmpbase; */ + status = 0; + } +#else /* MEMORY_MAPPED_IO */ + status = 0; +#endif /* MEMORY_MAPPED_IO */ + } + } + } + } else + status = 0; + + + LEAVE("qla2100_pci_config"); + return(status); +} +#else +STATIC uint8_t +qla2100_pci_config(scsi_qla_host_t *ha) { + uint8_t status = 1; + uint32_t command; +#if MEMORY_MAPPED_IO + uint32_t page_offset, base; + uint32_t mmapbase; +#endif + config_reg_t *creg = 0; + uint16_t buf_wd; + + ENTER("qla2100_pci_config"); + + pcibios_read_config_word(ha->pci_bus,ha->pci_device_fn, OFFSET(creg->revision_id), &buf_wd); + ha->revision = buf_wd; + if( !ha->iobase ) { + /* Get command register. */ + if( pcibios_read_config_word(ha->pci_bus,ha->pci_device_fn, OFFSET(creg->command), &buf_wd) == PCIBIOS_SUCCESSFUL ) { + command = buf_wd; + + /* + * Set Bus Master Enable (bit-2), Memory Address Space Enable and + * reset any error bits. + */ + buf_wd &= ~0x7; +#if MEMORY_MAPPED_IO + DEBUG(printk("qla2100: I/O SPACE and MEMORY MAPPED IO is enabled.\n")); + buf_wd |= BIT_2 + BIT_1 + BIT_0; +#else + DEBUG(printk("qla2100: I/O SPACE Enabled and MEMORY MAPPED IO is disabled.\n")); + buf_wd |= BIT_2 + BIT_0; +#endif + if( pcibios_write_config_word(ha->pci_bus,ha->pci_device_fn, OFFSET(creg->command), buf_wd) ) { + printk(KERN_WARNING "qla2100: Could not write config word.\n"); + } + /* Get expansion ROM address. */ + if( pcibios_read_config_word(ha->pci_bus,ha->pci_device_fn, OFFSET(creg->expansion_rom), &buf_wd) == PCIBIOS_SUCCESSFUL ) { + /* Reset expansion ROM address decode enable. */ + buf_wd &= ~BIT_0; + if( pcibios_write_config_word(ha->pci_bus,ha->pci_device_fn, OFFSET(creg->expansion_rom), buf_wd) == PCIBIOS_SUCCESSFUL ) { +#if MEMORY_MAPPED_IO + /* Get memory mapped I/O address. */ + pcibios_read_config_dword(ha->pci_bus, ha->pci_device_fn,OFFSET(cfgp->mem_base_addr), &mmapbase); + mmapbase &= PCI_BASE_ADDRESS_MEM_MASK; + + /* Find proper memory chunk for memory map I/O reg. */ + base = mmapbase & PAGE_MASK; + page_offset = mmapbase - base; + /* Get virtual address for I/O registers. */ + ha->mmpbase = ioremap(base,page_offset + 256); + if( ha->mmpbase ) { + ha->mmpbase += page_offset; + /* ha->iobase = ha->mmpbase; */ + status = 0; + } +#else /* MEMORY_MAPPED_IO */ + status = 0; +#endif /* MEMORY_MAPPED_IO */ + } + } + } + } else + status = 0; + + + LEAVE("qla2100_pci_config"); + return(status); +} +#endif + + +/* +* qla2100_set_cache_line +* Sets PCI cache line parameter. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success. +*/ +STATIC uint8_t +qla2100_set_cache_line(scsi_qla_host_t *ha) { + int status = 0; + uint8_t buf; + config_reg_t *creg = 0; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_set_cache_line"); +#endif + /* Set the cache line. */ + if( ha->flags.set_cache_line_size_1 ) { + buf = 1; + if( pcibios_write_config_byte(ha->pci_bus, + ha->pci_device_fn, + (u_long)&creg->cache_line,buf) != PCIBIOS_SUCCESSFUL ) + status = 1; + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_set_cache_line: **** FAILED ****\n\r"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_set_cache_line"); +#endif + return(status); +} + +/* +* Chip diagnostics +* Test chip for proper operation. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success. +*/ +STATIC uint8_t +qla2100_chip_diag(scsi_qla_host_t *ha) { + device_reg_t *reg = ha->iobase; + device2300_reg_t *reg2300 = ha->iobase2300; + uint8_t status = 0; + uint16_t data; + uint32_t cnt; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + + ENTER("qla2100_chip_diag"); +#ifdef QL_DEBUG_LEVEL_3 + qla2100_print("qla2100_chip_diag: testing device at "); + qla2100_output_number((u_long)®->flash_address, 16); + qla2100_print("\n"); +#endif + + /* Reset ISP chip. */ + WRT_REG_WORD(®->ctrl_status, ISP_RESET); + data = qla2100_debounce_register(®->ctrl_status); + for( cnt = 6000000 ; cnt && (data & ISP_RESET); cnt-- ) { + SYS_DELAY(5); + data = RD_REG_WORD(®->ctrl_status); + } + + if( cnt ) { +#if defined(QL_DEBUG_LEVEL_2) + qla2100_print("{{{qla2100_chip_diag: Reset register cleared by chip}}}\n\r"); +#endif + /* Reset RISC processor. */ + WRT_REG_WORD(®->host_cmd, HC_RESET_RISC); + WRT_REG_WORD(®->host_cmd, HC_RELEASE_RISC); + data = qla2100_debounce_register(®->mailbox0); + for( cnt = 6000000; cnt && (data == MBS_BUSY); cnt-- ) { + SYS_DELAY(5); + data = RD_REG_WORD(®->mailbox0); + } + + if( cnt ) { + /* Check product ID of chip */ +#if defined(QL_DEBUG_LEVEL_2) + qla2100_print("{{{qla2100_chip_diag: Checking product ID of chip}}}\n\r"); +#endif + if (ha->device_id != QLA2300_DEVICE_ID) { + if( RD_REG_WORD(®->mailbox1) != PROD_ID_1 || + (RD_REG_WORD(®->mailbox2) != PROD_ID_2 && + RD_REG_WORD(®->mailbox2) != PROD_ID_2a) || + RD_REG_WORD(®->mailbox3) != PROD_ID_3 || + qla2100_debounce_register(®->mailbox4) != PROD_ID_4 ) { + printk(KERN_WARNING "qla2100: [ERROR] Wrong product ID = 0x%x,0x%x,0x%x,0x%x\n", + RD_REG_WORD(®->mailbox1), + RD_REG_WORD(®->mailbox2), + RD_REG_WORD(®->mailbox3), + RD_REG_WORD(®->mailbox4)); + status = 1; + } else { + /* Now determine if we have a 2200A board */ + if( ( ha->device_id == QLA2200_DEVICE_ID || + ha->device_id == QLA2200A_DEVICE_ID ) && + RD_REG_WORD(®->mailbox7) == + QLA2200A_RISC_ROM_VER ) { + ha->device_id = QLA2200A_DEVICE_ID; +#if defined(QL_DEBUG_LEVEL_2) + qla2100_print("qla2100_chip_diag: Found QLA2200A chip.\n\r"); +#endif + } + } + } else { /* check prod id of 2300 here */ + if( RD_REG_WORD(®2300->mailbox1) != PROD_ID_1 || + (RD_REG_WORD(®2300->mailbox2) != PROD_ID_2 && + RD_REG_WORD(®2300->mailbox2) != PROD_ID_2a) || + RD_REG_WORD(®2300->mailbox3) != PROD_ID_3 || + qla2100_debounce_register(®2300->mailbox4) != PROD_ID_4 ) { + printk(KERN_WARNING "qla2300: [ERROR] Wrong product ID = 0x%x,0x%x,0x%x,0x%x\n", + RD_REG_WORD(®2300->mailbox1), + RD_REG_WORD(®2300->mailbox2), + RD_REG_WORD(®2300->mailbox3), + RD_REG_WORD(®2300->mailbox4)); + status = 1; + } + DEBUG(printk("qla2100_chip_diag: Do MBC_MAILBOX_REGISTER_TEST\n")); +#if defined(QL_DEBUG_LEVEL_2) + qla2100_print("qla2100_chip_diag: Do MBC_MAILBOX_REGISTER_TEST\n\r"); +#endif + /* Wrap Incoming Mailboxes Test. */ + mb[0] = MBC_MAILBOX_REGISTER_TEST; + mb[1] = 0xAAAA; + mb[2] = 0x5555; + mb[3] = 0xAA55; + mb[4] = 0x55AA; + mb[5] = 0xA5A5; + mb[6] = 0x5A5A; + mb[7] = 0x2525; + if( !(status = qla2100_mailbox_command(ha, + BIT_7|BIT_6|BIT_5|BIT_4|BIT_3|BIT_2|BIT_1|BIT_0, + &mb[0])) ) { + if( mb[1] != 0xAAAA || mb[2] != 0x5555 || + mb[3] != 0xAA55 || mb[4] != 0x55AA ) + status = 1; + if( mb[5] != 0xA5A5 || mb[6] != 0x5A5A || + mb[7] != 0x2525 ) + status = 1; + if( status ) { + printk(KERN_WARNING "qla2100_chip_diag: [ERROR] *** Failed mailbox register test ***\n\r"); + DEBUG(qla2100_print("qla2100_chip_diag: *** Failed mailbox register test ***\n\r");) + } + } else { + printk(KERN_WARNING "qla2100_chip_diag: [ERROR] failed mailbox send register test\n"); + DEBUG(qla2100_print("qla2100_chip_diag: Failed mailbox send register test\n\r");) + } + } + } else + status = 1; + } else + status = 1; + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_chip_diag: **** FAILED ****\n"); + else qla2100_print("qla2100_chip_diag: Returning Good Status \n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_chip_diag"); +#endif + return(status); +} + +/* +* Setup chip +* Load and start RISC firmware. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success. +*/ +STATIC uint8_t +qla2100_setup_chip(scsi_qla_host_t *ha) { + uint16_t cnt; + uint16_t risc_address; + uint16_t *risc_code_address; + long risc_code_size; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + uint8_t status = 0; + int num, temp; +#ifdef WORD_FW_LOAD + uint16_t *ql21_risc_code_addr01; + uint16_t ql21_risc_code_length01; + uint8_t dump_status; +#endif + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_setup_chip"); +#endif + + /* Load RISC code. */ + risc_address = *QLBoardTbl_fc[ha->devnum].fwstart; + risc_code_address = QLBoardTbl_fc[ha->devnum].fwcode; + risc_code_size = (long)(*QLBoardTbl_fc[ha->devnum].fwlen & 0xffff); + + DEBUG(printk("qla2100_setup_chip: Loading RISC code size =(0x%lx)\n",risc_code_size);) + DEBUG(qla2100_print("qla2100_setup_chip: Loading RISC code now in silent mode!\n\r");) + num = 0; + DEBUG(sprintf(debug_buff,"virt=%x phys=%x\n\r",ha->request_ring,ha->request_dma);) + DEBUG(qla2100_print(debug_buff);) + /* go into silent mode */ + temp = ql2x_debug_print; + if( ql2x_debug_print ) ql2x_debug_print = 0; + + while( risc_code_size > 0 && !status ) { + /* for 2200A set transfer size to 128 bytes */ + if( ha->device_id == QLA2200A_DEVICE_ID ) + cnt = 128 >> 1; + else + cnt = REQUEST_ENTRY_SIZE * REQUEST_ENTRY_CNT >> 1; + if( cnt > risc_code_size ) + cnt = risc_code_size; + + DEBUG(sprintf(debug_buff,"qla2100_setup_chip:loading risc segment@ addr 0x%x, number of bytes 0x%x, offset 0x%x.\n\r",risc_code_address,cnt,risc_address);) + DEBUG(qla2100_print(debug_buff);) + + BCOPY((caddr_t) risc_code_address,(caddr_t) ha->request_ring, (cnt <<1)); + + flush_cache_all(); /* flush written firmware to the + ha->request_ring buffer before DMA */ + + mb[0] = MBC_LOAD_RAM; + mb[1] = risc_address; + mb[3] = (uint16_t)(ha->request_dma & 0xffff); + mb[2] = (uint16_t)((ha->request_dma >> 16) & 0xffff); + mb[4] = cnt; + status = qla2100_mailbox_command(ha, BIT_4|BIT_3|BIT_2|BIT_1|BIT_0, + &mb[0]); + + if( status ) { + qla2100_dump_regs(ha->host); + printk(KERN_WARNING "qla2x00: [ERROR] Failed to load segment %d of FW\n",num); + DEBUG(qla2100_print("qla2100_setup_chip: Failed to load segment of FW\n");) + break; + } + risc_address += cnt; + risc_code_size -= cnt; + risc_code_address += cnt; + num++; + } + ql2x_debug_print = temp; + +#ifdef WORD_FW_LOAD + { + int i; + uint8_t temp; + + temp = ql2x_debug_print; + if( ql2x_debug_print ) ql2x_debug_print = 0; + risc_address = *QLBoardTbl_fc[ha->devnum].fwstart; + ql21_risc_code_addr01 = QLBoardTbl_fc[ha->devnum].fwcode; + ql21_risc_code_length01= (long)(*QLBoardTbl_fc[ha->devnum].fwlen & 0xffff); + + for( i = 0; i < ql21_risc_code_length01 ; i++ ) { + + mb[0] = MBC_WRITE_RAM_WORD; + mb[1] = risc_address + i; + mb[2] = *(ql21_risc_code_addr01 + i); + + dump_status = qla2100_mailbox_command(ha,BIT_2|BIT_1|BIT_0, + &mb[0]); + if( dump_status ) { + printk(KERN_WARNING "qla2x00 : [ERROR] firmware load failure\n"); + break; + } + + mb[0] = MBC_READ_RAM_WORD; + mb[1] = risc_address + i; + mb[2] = 0; + + dump_status = qla2100_mailbox_command(ha,BIT_2|BIT_1|BIT_0, + &mb[0]); + if( dump_status ) { + printk(KERN_WARNING "qla2x00: [ERROR] RISC FW Read Failure\n"); + break; + } + if( mb[2] != *(ql21_risc_code_addr01 + i) ) + printk(KERN_WARNING "qla2x00: [ERROR] RISC FW Compare ERROR @ (0x%p)\n", + (void *) (ql21_risc_code_addr01+i)); + } + ql2x_debug_print = temp; + printk(KERN_INFO "qla2x00: RISC FW download confirmed... \n"); + } +#endif + /* Verify checksum of loaded RISC code. */ + if( !status ) { + DEBUG(printk("qla2100_setup_chip: Verifying Check Sum of loaded RISC code.\n");) + mb[0] = MBC_VERIFY_CHECKSUM; + mb[1] = *QLBoardTbl_fc[ha->devnum].fwstart; + if( !(status = qla2100_mailbox_command(ha, BIT_1|BIT_0, &mb[0])) ) { + /* Start firmware execution. */ + DEBUG(qla2100_print("qla2100_setup_chip: CS Ok, Start firmware running\n\r");) + mb[0] = MBC_EXECUTE_FIRMWARE; + mb[1]= *QLBoardTbl_fc[ha->devnum].fwstart; + status = qla2100_mailbox_command(ha, BIT_1|BIT_0, &mb[0]); + } +#if defined(QL_DEBUG_LEVEL_2) + else + qla2100_print("qla2100_setup_chip: ISP FW Failed Check Sum\n"); +#endif + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_setup_chip: **** FAILED ****\n"); + else qla2100_print("qla2100_setup_chip: Returning Good Status\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_setup_chip"); +#endif + return(status); +} + +/* +* qla2100_init_rings +* Initializes firmware. +* +* Beginning of request ring has initialization control block +* already built by nvram config routine. +* +* Input: +* ha = adapter block pointer. +* ha->request_ring = request ring virtual address +* ha->response_ring = response ring virtual address +* ha->request_dma = request ring physical address +* ha->response_dma = response ring physical address +* +* Returns: +* 0 = success. +*/ +STATIC uint8_t +qla2100_init_rings(scsi_qla_host_t *ha) { + uint8_t status; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + int cnt; + device2300_reg_t *reg2300 = ha->iobase2300; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_init_rings"); +#endif + /* Clear outstanding commands array. */ + for( cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS; cnt++ ) + ha->outstanding_cmds[cnt] = 0; + +#ifdef RSCN + /* Clear RSCN queue. */ + ha->rscn_in_ptr = 0; + ha->rscn_out_ptr = 0; +#endif + + /* Initialize firmware. */ + ha->request_ring_ptr = ha->request_ring; + ha->req_ring_index = 0; + ha->req_q_cnt = REQUEST_ENTRY_CNT; + ha->response_ring_ptr = ha->response_ring; + ha->rsp_ring_index = 0; + mb[0] = MBC_INITIALIZE_FIRMWARE; + mb[3] = LSW(ha->init_cb_dma); + mb[2] = MSW(ha->init_cb_dma); + mb[4] = 0; /* set request queue in ptr for 2100/2200 */ + mb[5] = 0; /* set response queue out ptr for 2100/2200*/ + mb[7] = QL21_64BITS_3RDWD(ha->init_cb_dma); + mb[6] = QL21_64BITS_4THWD(ha->init_cb_dma); + + if (ha->device_id == QLA2300_DEVICE_ID) { + /* set request queue in ptr , response queue out ptr for 2300 */ + WRT_REG_WORD(®2300->req_q_in, 0); + WRT_REG_WORD(®2300->rsp_q_out, 0); + } + + DEBUG(qla2100_print("qla2100_init_rings: Issue MBC_INIT_FIRMWARE op\n");) + status = qla2100_mailbox_command(ha, + BIT_7|BIT_6|BIT_5|BIT_4|BIT_3|BIT_2|BIT_0, + &mb[0]); + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_init_rings: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_init_rings"); +#endif + return(status); +} + +/* +* qla2100_fw_ready +* Waits for firmware ready. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success. +*/ +STATIC uint8_t +qla2100_fw_ready(scsi_qla_host_t *ha) { + uint8_t status = 0; + uint32_t cnt, cnt1; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + uint16_t timeout; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_fw_ready"); +#endif + timeout = (ha->retry_count * ha->login_timeout) + 5; + cnt1 = 0x350; /* 25 secs */ + /* Wait for ISP to finish LIP */ + if(!qla2100_quiet) printk(KERN_INFO "scsi(%d): Waiting for LIP to complete...\n", (int)ha->host->host_no); + if( timeout ) + cnt = 36 * timeout; + else + cnt = 0x700; + + for( ; cnt; cnt-- ) { + mb[0] = MBC_GET_FIRMWARE_STATE; + if( !(status = qla2100_mailbox_command(ha, BIT_0, &mb[0])) ) { + if( ha->loop_down_timer || mb[1] != FSTATE_READY ) { + status = 1; + /* Exit if no cable connected after 10 seconds. */ + if( !cnt1-- ) + if( mb[1] == FSTATE_CONFIG_WAIT || mb[1] == FSTATE_LOSS_OF_SYNC ) { + + break; + } + } else { + DEBUG(printk("qla2100_fw_ready: F/W Ready - OK \n");) + status = 0; /* dg 09/15/99 */ + break; + } + } + + if( ha->flags.online ) { + status = 0; /* dg 09/15/99 */ + break; + } + + /* Delay for a while */ + udelay(10); + +#ifdef QL_DEBUG_LEVEL_2 +/* qla2100_print("qla2100_fw_ready: mailbox_out[1] = "); + qla2100_output_number((uint32_t)mb[1], 16); + qla2100_print("\n");*/ +#endif + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_fw_ready: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_fw_ready"); +#endif + return(status); +} + +/* +* qla2100_configure_hba +* Setup adapter context. +* +* Input: +* ha = adapter state pointer. +* +* Returns: +* 0 = success +* 1 = failed +* +* Context: +* Kernel context. +*/ +STATIC uint8_t +qla2100_configure_hba(scsi_qla_host_t *ha) { + uint8_t rval; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + uint8_t connect_type[22]; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_configure_hba"); +#endif + + /* Get host addresses. */ + mb[0] = MBC_GET_ADAPTER_LOOP_ID; + rval = qla2100_mailbox_command(ha, BIT_0, &mb[0]); + if( !rval ) { + if( mb[6] == 4 ) { + printk(KERN_INFO "scsi%d: Can't get topology - retrying\n",(int)ha->host_no); + return(1); + } + ha->loop_id = mb[1]; + + /* Get loop topology. */ + if( ha->device_id == QLA2100_DEVICE_ID ) { + mb[6] = 0; + } + ha->min_external_loopid = SNS_FIRST_LOOP_ID; + ha->operating_mode = LOOP; + switch( mb[6] ) { + case 0: + ha->current_topology = ISP_CFG_NL; + strcpy((char *)&connect_type[0],"(Loop)"); + break; + case 1: + ha->current_topology = ISP_CFG_FL; + strcpy((char *)&connect_type[0],"(FL_Port)"); + break; + case 2: + ha->operating_mode = P2P; + ha->current_topology = ISP_CFG_N; + ha->min_external_loopid = 1; /* v2.19.5b3 */ + strcpy((char *)&connect_type[0],"(N_Port-to-N_Port)"); + break; + case 3: + ha->operating_mode = P2P; + ha->current_topology = ISP_CFG_F; + ha->min_external_loopid = 1; /* v2.19.5b3 */ + strcpy((char *)&connect_type[0],"(F_Port)"); + break; + default: + ha->current_topology = ISP_CFG_NL; + strcpy((char *)&connect_type[0],"(Loop)"); + break; + } + + /* Save Host port and loop ID. */ + /* Reverse byte order - TT */ + ha->port_id[2] = LSB(mb[2]); + ha->port_id[1] = MSB(mb[2]); + ha->port_id[0] = LSB(mb[3]); + if (!qla2100_quiet) printk(KERN_INFO "scsi%d: Topology - %s, Host Loop address 0x%x\n",(int)ha->host_no,connect_type, ha->loop_id); + } else + printk(KERN_WARNING "qla2100_configure_hba: [ERROR] Get host loop ID failed\n"); + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( rval != 0 ) + qla2100_print("qla2100_configure_hba: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_configure_hba"); +#endif + return(rval); +} + +/* +* NVRAM configuration for 2100. +* +* Input: +* ha = adapter block pointer. +* ha->request_ring = request ring virtual address +* ha->response_ring = response ring virtual address +* ha->request_dma = request ring physical address +* ha->response_dma = response ring physical address +* +* Output: +* initialization control block in response_ring +* host adapters parameters in host adapter block +* +* Returns: +* 0 = success. +*/ +STATIC uint8_t +qla2100_nvram_config(scsi_qla_host_t *ha) { + uint8_t status = 0; + uint16_t cnt; + caddr_t dptr1, dptr2; + init_cb_t *icb = ha->init_cb; + nvram21_t *nv = (nvram21_t *)ha->request_ring; + uint16_t *wptr = (uint16_t *)ha->request_ring; + uint8_t chksum = 0; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_nvram_config"); +#endif + + /* Verify valid NVRAM checksum. */ + for( cnt = 0; cnt < sizeof(nvram21_t)/2; cnt++ ) { + *wptr = qla2100_get_nvram_word(ha, cnt); + chksum += (uint8_t)*wptr; + chksum += (uint8_t)(*wptr >> 8); + wptr++; + } + +#if DEBUG_PRINT_NVRAM + qla2100_print( + "qla2100_nvram_config: Contents of NVRAM "); + qla2100_print("\n\r"); + qla2100_dump_buffer((uint8_t *)ha->request_ring, sizeof(nvram21_t)); +#endif + + /* Bad NVRAM data, set defaults parameters. */ + if( chksum || nv->id[0] != 'I' || nv->id[1] != 'S' || nv->id[2] != 'P' || + nv->id[3] != ' ' || nv->nvram_version < 1 ) { + /* Reset NVRAM data. */ + DEBUG(printk("Using defaults for NVRAM: \n")); + DEBUG(printk("checksum=0x%x, Id=%c, version=0x%x\n",chksum,nv->id[0],nv->nvram_version)); + wptr = (uint16_t *)ha->request_ring; + for( cnt = 0; cnt < sizeof(nvram21_t)/2; cnt++ ) + *wptr++ = 0; + + /* + * Set default initialization control block. + */ + nv->parameter_block_version = ICB_VERSION; + nv->firmware_options.enable_fairness = 1; + nv->firmware_options.enable_fast_posting = 1; + nv->firmware_options.enable_full_login_on_lip = 1; + + nv->frame_payload_size = 1024; + nv->max_iocb_allocation = 256; + nv->execution_throttle = 16; + nv->retry_count = 8; + nv->retry_delay = 1; + nv->node_name[0] = 32; + nv->node_name[3] = 224; + nv->node_name[4] = 139; + nv->login_timeout = 4; + + /* + * Set default host adapter parameters + */ + nv->host_p.enable_lip_full_login = 1; + nv->reset_delay = 5; + nv->port_down_retry_count = 8; + nv->maximum_luns_per_target = 8; + status = 1; + } + + /* + * Copy over NVRAM RISC parameter block + * to initialization control block. + */ + dptr1 = (caddr_t)icb; + dptr2 = (caddr_t)&nv->parameter_block_version; + cnt = (caddr_t)&nv->host_p - (caddr_t)&nv->parameter_block_version; + while( cnt-- ) + *dptr1++ = *dptr2++; + + /* HBA node name 0 correction */ + for (cnt=0 ; cnt<8 ; cnt++) { + if (icb->node_name[cnt] != 0) + break; + } + if (cnt == 8) { + for ( cnt= 0 ; cnt < 8 ; cnt++) + icb->node_name[cnt] = icb->port_name[cnt]; + icb->node_name[0] = icb->node_name[0] & ~BIT_0; + icb->port_name[0] = icb->port_name[0] | BIT_0; + } + + /* + * Setup driver firmware options. + */ +#if QL2100_TARGET_MODE_SUPPORT + icb->firmware_options.enable_target_mode = 1; +#else + icb->firmware_options.enable_target_mode = 0; +#endif + icb->firmware_options.disable_initiator_mode = 0; + icb->firmware_options.enable_port_update_event = 1; + icb->firmware_options.enable_full_login_on_lip = 1; + + /* + * Set host adapter parameters + */ + ha->flags.enable_target_mode = icb->firmware_options.enable_target_mode; + ha->flags.disable_luns = nv->host_p.disable_luns; + ha->flags.disable_risc_code_load = nv->host_p.disable_risc_code_load; + ha->flags.set_cache_line_size_1 = nv->host_p.set_cache_line_size_1; + ha->flags.enable_64bit_addressing = nv->host_p.enable_64bit_addressing; + +#if BITS_PER_LONG > 32 + /* Enable 64bit addressing for OS/System combination supporting it */ + /* actual NVRAM bit is: nv->cntr_flags_1.enable_64bit_addressing */ + /* but we will ignore it and use BITS_PER_LONG macro to setup for */ + /* 64 or 32 bit access of host memory in all x86/ia-64/Alpha systems */ + ha->flags.enable_64bit_addressing = 1; +#else + ha->flags.enable_64bit_addressing = 0; +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + if (ha->flags.enable_64bit_addressing) + printk(KERN_INFO "[[[ qla2x00: 64 Bit PCI Addressing Enabled ]]]\n"); + +#if BITS_PER_LONG > 32 + /* Update our PCI device dma_mask for full 64 bit mask */ + /* ha->pdev->dma_mask = (pci_dma_t) 0xffffffffffffffffull; */ + ha->pdev->dma_mask = 0xffffffffffffffff; +#endif +#endif + ha->flags.enable_lip_reset = nv->host_p.enable_lip_reset; + ha->flags.enable_lip_full_login = nv->host_p.enable_lip_full_login; + ha->flags.enable_target_reset = nv->host_p.enable_target_reset; + ha->flags.enable_flash_db_update = nv->host_p.enable_database_storage; + + /* new for IOCTL support of APIs */ + ha->node_name[0] = icb->node_name[0]; + ha->node_name[1] = icb->node_name[1]; + ha->node_name[2] = icb->node_name[2]; + ha->node_name[3] = icb->node_name[3]; + ha->node_name[4] = icb->node_name[4]; + ha->node_name[5] = icb->node_name[5]; + ha->node_name[6] = icb->node_name[6]; + ha->node_name[7] = icb->node_name[7]; + ha->nvram_version = nv->nvram_version; + + /* empty data for QLA2100s OEM stuff */ + ha->oem_id = 0; + ha->oem_spare0 = 0; + for ( cnt= 0 ; cnt < 8 ; cnt++) { + ha->oem_string[cnt] = 0; + ha->oem_part[cnt] = 0; + ha->oem_fru[cnt] = 0; + ha->oem_ec[cnt] = 0; + } + + ha->hiwat = icb->iocb_allocation; + ha->execution_throttle = nv->execution_throttle; + + ha->retry_count = nv->retry_count; + ha->login_timeout = nv->login_timeout; + /* Set minimum login_timeout to 4 seconds. */ + if( ha->login_timeout < 4 ) + ha->login_timeout = 4; + ha->port_down_retry_count = nv->port_down_retry_count; + ha->minimum_timeout = (ha->login_timeout * ha->retry_count) + + ha->port_down_retry_count; + ha->loop_reset_delay = nv->reset_delay; + /* Will get the value from nvram. */ + ha->loop_down_timeout = LOOP_DOWN_TIMEOUT; + ha->loop_down_abort_time = LOOP_DOWN_TIME - ha->loop_down_timeout; + + /* save HBA serial number */ + ha->serial0 = nv->node_name[5]; + ha->serial1 = nv->node_name[6]; + ha->serial2 = nv->node_name[7]; + +#if USE_BIOS_MAX_LUNS + if( !nv->maximum_luns_per_target ) + ha->max_luns = MAX_LUNS-1; + else + ha->max_luns = nv->maximum_luns_per_target; +#else + ha->max_luns = MAX_LUNS-1; +#endif + + /* + * Setup ring parameters in initialization control block + */ + icb->request_q_outpointer = 0; + icb->response_q_inpointer = 0; + icb->request_q_length = REQUEST_ENTRY_CNT; + icb->response_q_length = RESPONSE_ENTRY_CNT; + icb->request_q_address[0] = LS_64BITS(ha->request_dma); + icb->request_q_address[1] = MS_64BITS(ha->request_dma); + icb->response_q_address[0] = LS_64BITS(ha->response_dma); + icb->response_q_address[1] = MS_64BITS(ha->response_dma); + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_nvram_config: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_nvram_config"); +#endif + return(status); +} + +/* +* NVRAM configuration for the 2200. +* +* Input: +* ha = adapter block pointer. +* ha->request_ring = request ring virtual address +* ha->response_ring = response ring virtual address +* ha->request_dma = request ring physical address +* ha->response_dma = response ring physical address +* +* Output: +* initialization control block in response_ring +* host adapters parameters in host adapter block +* +* Returns: +* 0 = success. +*/ +STATIC uint8_t +qla2200_nvram_config(scsi_qla_host_t *ha) { + uint8_t status = 0; + uint16_t cnt; + caddr_t dptr1, dptr2; + init_cb_t *icb = ha->init_cb; + nvram22_t *nv = (nvram22_t *)ha->request_ring; + uint16_t *wptr = (uint16_t *)ha->request_ring; + uint8_t chksum = 0; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2200/2300_nvram_config"); +#endif + + if( !ha->flags.nvram_config_done ) { + + /* Verify valid NVRAM checksum. */ + for( cnt = 0; cnt < sizeof(nvram22_t)/2; cnt++ ) { + *wptr = qla2100_get_nvram_word(ha, cnt); + chksum += (uint8_t)*wptr; + chksum += (uint8_t)(*wptr >> 8); + wptr++; + } + +#if DEBUG_PRINT_NVRAM + qla2100_print( + "qla2200_nvram_config: Contents of NVRAM "); + qla2100_print("\n\r"); + qla2100_dump_buffer((uint8_t *)ha->request_ring, sizeof(nvram22_t)); +#endif + + /* Bad NVRAM data, set defaults parameters. */ + if( chksum || nv->id[0] != 'I' || nv->id[1] != 'S' || nv->id[2] != 'P' || + nv->id[3] != ' ' || nv->nvram_version < 1 ) { + /* Reset NVRAM data. */ + DEBUG(printk("Using defaults for 2200/2300 NVRAM: \n")); + DEBUG(printk("checksum=0x%x, Id0=%c Id1=%c Id2=%x, version=0x%x\n",chksum,nv->id[0],nv->id[1],nv->id[2],nv->nvram_version)); + wptr = (uint16_t *)nv; + for( cnt = 0; cnt < sizeof(nvram21_t)/2; cnt++ ) + *wptr++ = 0; + + /* + * Set default initialization control block. + */ + nv->parameter_block_version = ICB_VERSION; + nv->firmware_options.enable_fairness = 1; + nv->firmware_options.enable_fast_posting = 1; + nv->firmware_options.enable_full_login_on_lip = 1; + nv->firmware_options.enable_name_change = 1; + nv->firmware_options.expanded_ifwcb = 1; + + nv->frame_payload_size = 1024; + nv->max_iocb_allocation = 256; + nv->execution_throttle = 16; + nv->retry_count = 8; + nv->retry_delay = 1; + nv->port_name[0] = 32; + nv->port_name[3] = 224; + nv->port_name[4] = 139; + nv->login_timeout = 4; + nv->additional_firmware_options.connection_options = P2P_LOOP; + /* + * Set default host adapter parameters + */ + nv->host_p.enable_lip_full_login = 1; + nv->reset_delay = 5; + nv->port_down_retry_count = 8; + nv->maximum_luns_per_target = 8; + status = 1; + } + + /* Reset icb data */ + BZERO((caddr_t)icb, sizeof(init_cb_t)); + /* + * Copy over NVRAM RISC parameter block + * to initialization control block. + */ + dptr1 = (caddr_t)icb; + dptr2 = (caddr_t)&nv->parameter_block_version; + cnt = (caddr_t)&nv->additional_firmware_options - (caddr_t)&nv->parameter_block_version; + while( cnt-- ) + *dptr1++ = *dptr2++; + + dptr1 += (caddr_t)&icb->additional_firmware_options - (caddr_t)&icb->request_q_outpointer; + cnt = (caddr_t)&nv->host_p - (caddr_t)&nv->additional_firmware_options; + while( cnt-- ) + *dptr1++ = *dptr2++; + + /* HBA node name 0 correction */ + for (cnt=0 ; cnt<8 ; cnt++) { + if (icb->node_name[cnt] != 0) + break; + } + if (cnt == 8) { + for ( cnt= 0 ; cnt < 8 ; cnt++) + icb->node_name[cnt] = icb->port_name[cnt]; + icb->node_name[0] = icb->node_name[0] & ~BIT_0; + icb->port_name[0] = icb->port_name[0] | BIT_0; + } + + /* + * Setup driver firmware options. + */ + icb->firmware_options.enable_full_duplex = 0; +#if QL2100_TARGET_MODE_SUPPORT + icb->firmware_options.enable_target_mode = 1; +#else + icb->firmware_options.enable_target_mode = 0; +#endif + icb->firmware_options.disable_initiator_mode = 0; + icb->firmware_options.enable_port_update_event = 1; + icb->firmware_options.enable_full_login_on_lip = 1; +#if USE_TP_FW + icb->firmware_options.enable_name_change = 1; + icb->firmware_options.expanded_ifwcb = 1; +#endif + /* + * Set host adapter parameters + */ + ha->flags.enable_target_mode = icb->firmware_options.enable_target_mode; + ha->flags.disable_luns = nv->host_p.disable_luns; + ha->flags.disable_risc_code_load = nv->host_p.disable_risc_code_load; + ha->flags.set_cache_line_size_1 = nv->host_p.set_cache_line_size_1; + ha->flags.enable_64bit_addressing = nv->host_p.enable_64bit_addressing; + +#if BITS_PER_LONG > 32 + /* Enable 64bit addressing for OS/System combination supporting it */ + /* actual NVRAM bit is: nv->cntr_flags_1.enable_64bit_addressing */ + /* but we will ignore it and use BITS_PER_LONG macro to setup for */ + /* 64 or 32 bit access of host memory in all x86/ia-64/Alpha systems */ + ha->flags.enable_64bit_addressing = 1; +#else + ha->flags.enable_64bit_addressing = 0; +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + if (ha->flags.enable_64bit_addressing) + printk(KERN_INFO "[[[ qla2x00: 64 Bit PCI Addressing Enabled ]]]\n"); + +#if BITS_PER_LONG > 32 + /* Update our PCI device dma_mask for full 64 bit mask */ + ha->pdev->dma_mask = 0xffffffffffffffff; +#endif +#endif + ha->flags.enable_lip_reset = nv->host_p.enable_lip_reset; + ha->flags.enable_lip_full_login = nv->host_p.enable_lip_full_login; + ha->flags.enable_target_reset = nv->host_p.enable_target_reset; + ha->flags.enable_flash_db_update = nv->host_p.enable_database_storage; + ha->operating_mode = icb->additional_firmware_options.connection_options; + + /* new for IOCTL support of APIs */ + ha->node_name[0] = icb->node_name[0]; + ha->node_name[1] = icb->node_name[1]; + ha->node_name[2] = icb->node_name[2]; + ha->node_name[3] = icb->node_name[3]; + ha->node_name[4] = icb->node_name[4]; + ha->node_name[5] = icb->node_name[5]; + ha->node_name[6] = icb->node_name[6]; + ha->node_name[7] = icb->node_name[7]; + ha->nvram_version = nv->nvram_version; + + + ha->hiwat = icb->iocb_allocation; + ha->execution_throttle = nv->execution_throttle; + + ha->retry_count = nv->retry_count; + ha->login_timeout = nv->login_timeout; + /* Set minimum login_timeout to 4 seconds. */ + if( ha->login_timeout < 4 ) + ha->login_timeout = 4; + ha->port_down_retry_count = nv->port_down_retry_count; + ha->minimum_timeout = (ha->login_timeout * ha->retry_count) + + ha->port_down_retry_count; + ha->loop_reset_delay = nv->reset_delay; + /* Will get the value from nvram. */ + ha->loop_down_timeout = LOOP_DOWN_TIMEOUT; + ha->loop_down_abort_time = LOOP_DOWN_TIME - ha->loop_down_timeout; + + /* save HBA serial number */ + ha->serial0 = nv->port_name[5]; + ha->serial1 = nv->port_name[6]; + ha->serial2 = nv->port_name[7]; + + /* save OEM related items for QLA2200s and QLA2300s */ + ha->oem_id = nv->oem_id; + ha->oem_spare0 = nv->oem_spare0; + + for ( cnt= 2 ; cnt < 8 ; cnt++ ) + ha->oem_string[cnt] = nv->oem_string[cnt]; + + for ( cnt= 0 ; cnt < 8 ; cnt++ ) { + ha->oem_part[cnt] = nv->oem_part[cnt]; + ha->oem_fru[cnt] = nv->oem_fru[cnt]; + ha->oem_ec[cnt] = nv->oem_ec[cnt]; + } + +#ifdef FC_IP_SUPPORT + for (cnt = 0; cnt < 8; cnt++) + ha->acPortName[cnt] = nv->port_name[cnt]; +#endif + +#if USE_BIOS_MAX_LUNS + if( !nv->maximum_luns_per_target ) + ha->max_luns = MAX_LUNS; + else if( nv->maximum_luns_per_target < MAX_LUNS ) + ha->max_luns = nv->maximum_luns_per_target; + else + ha->max_luns = MAX_LUNS; +#else + ha->max_luns = MAX_LUNS; +#endif + + /* + * Setup ring parameters in initialization control block + */ + icb->request_q_outpointer = 0; + icb->response_q_inpointer = 0; + icb->request_q_length = REQUEST_ENTRY_CNT; + icb->response_q_length = RESPONSE_ENTRY_CNT; + icb->request_q_address[0] = LS_64BITS(ha->request_dma); + icb->request_q_address[1] = MS_64BITS(ha->request_dma); + icb->response_q_address[0] = LS_64BITS(ha->response_dma); + icb->response_q_address[1] = MS_64BITS(ha->response_dma); + + icb->lun_enables = 0; + icb->command_resource_count = 0; + icb->immediate_notify_resource_count = 0; + icb->timeout = 0; + icb->reserved_2 = 0; + + ha->flags.nvram_config_done = 1; + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2200_nvram_config: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2200_nvram_config"); +#endif + return(status); +} + +/* +* Get NVRAM data word +* Calculates word position in NVRAM and calls request routine to +* get the word from NVRAM. +* +* Input: +* ha = adapter block pointer. +* address = NVRAM word address. +* +* Returns: +* data word. +*/ +STATIC uint16_t +qla2100_get_nvram_word(scsi_qla_host_t *ha, uint32_t address) { + uint32_t nv_cmd; + uint16_t data; + +#ifdef QL_DEBUG_ROUTINES + uint8_t saved_print_status = ql2x_debug_print; +#endif +#ifdef QL_DEBUG_LEVEL_4 + qla2100_print("qla2100_get_nvram_word: entered\n"); +#endif + + nv_cmd = address << 16; + nv_cmd |= NV_READ_OP; + +#ifdef QL_DEBUG_ROUTINES + ql2x_debug_print = FALSE; +#endif + data = qla2100_nvram_request(ha, nv_cmd); +#ifdef QL_DEBUG_ROUTINES + ql2x_debug_print = saved_print_status; +#endif + +#ifdef QL_DEBUG_LEVEL_4 + qla2100_print("qla2100_get_nvram_word: exiting normally NVRAM data = "); + qla2100_output_number((u_long)data, 16); + qla2100_print("\n"); +#endif + return(data); +} + +/* +* NVRAM request +* Sends read command to NVRAM and gets data from NVRAM. +* +* Input: +* ha = adapter block pointer. +* nv_cmd = Bit 26 = start bit +* Bit 25, 24 = opcode +* Bit 23-16 = address +* Bit 15-0 = write data +* +* Returns: +* data word. +*/ +STATIC uint16_t +qla2100_nvram_request(scsi_qla_host_t *ha, uint32_t nv_cmd) { + uint8_t cnt; + device_reg_t *reg = ha->iobase; + uint16_t data = 0; + uint16_t reg_data; + + /* Send command to NVRAM. */ + + nv_cmd <<= 5; + for( cnt = 0; cnt < 11; cnt++ ) { + if( nv_cmd & BIT_31 ) + qla2100_nv_write(ha, NV_DATA_OUT); + else + qla2100_nv_write(ha, 0); + nv_cmd <<= 1; + } + + /* Read data from NVRAM. */ + + for( cnt = 0; cnt < 16; cnt++ ) { + WRT_REG_WORD(®->nvram, NV_SELECT+NV_CLOCK); + /* qla2100_nv_delay(ha); */ + NVRAM_DELAY(); + data <<= 1; + reg_data = RD_REG_WORD(®->nvram); + if( reg_data & NV_DATA_IN ) + data |= BIT_0; + WRT_REG_WORD(®->nvram, NV_SELECT); + /* qla2100_nv_delay(ha); */ + NVRAM_DELAY(); + } + + /* Deselect chip. */ + + WRT_REG_WORD(®->nvram, NV_DESELECT); + /* qla2100_nv_delay(ha); */ + NVRAM_DELAY(); + + return(data); +} + +STATIC void +qla2100_nv_write(scsi_qla_host_t *ha, uint16_t data) { + device_reg_t *reg = ha->iobase; + + WRT_REG_WORD(®->nvram, data | NV_SELECT); + NVRAM_DELAY(); + /* qla2100_nv_delay(ha); */ + WRT_REG_WORD(®->nvram, data | NV_SELECT | NV_CLOCK); + /* qla2100_nv_delay(ha); */ + NVRAM_DELAY(); + WRT_REG_WORD(®->nvram, data | NV_SELECT); + /* qla2100_nv_delay(ha); */ + NVRAM_DELAY(); +} + +STATIC void +qla2100_nv_delay(void) { + SYS_DELAY(NV_DELAY_COUNT); +} + + +/* +* Mailbox Command +* Issue mailbox command and waits for completion. +* +* Input: +* ha = adapter block pointer. +* mr = mailbox registers to load. +* mb = data pointer for mailbox registers. +* +* Output: +* mb[MAILBOX_REGISTER_COUNT] = returned mailbox data. +* +* Returns: +* 0 = success +* 1 = failed (mbox status != 0x4000) +*/ +STATIC uint8_t +qla2100_mailbox_command(scsi_qla_host_t *ha, uint32_t mr, uint16_t *mb) { + device_reg_t *reg = ha->iobase; + device2300_reg_t *reg2300 = ha->iobase2300; + uint8_t status = 0; + uint32_t cnt; + uint16_t *optr, *iptr; + uint16_t data, command, intreq; + srb_t *done_q_first = 0; + srb_t *done_q_last = 0; + uint32_t longdata = 0; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_mailbox_command"); +#endif + + /* Acquire interrupt specific lock */ + QLA2100_INTR_LOCK(ha); + + DRIVER_LOCK + ha->flags.mbox_busy = TRUE; + +#ifdef QL_DEBUG_LEVEL_5 + sprintf(debug_buff,"scsi%d ",(int)ha->host_no); + qla2100_print(debug_buff); + qla2100_print("qla2100_mailbox_command: [[Start]] mbox_out[0] = "); + qla2100_output_number((u_long)*mb, 16); + qla2100_print("\n"); +#endif + /* Load mailbox registers. */ + if (ha->device_id != QLA2300_DEVICE_ID) + optr = (uint16_t *)®->mailbox0; + else + optr = (uint16_t *)®2300->mailbox0; + +#ifdef QL_DEBUG_LEVEL_5 + qla2100_print( + "qla2100_mailbox_command: Load MB word registers (displayed in bytes) = \n"); + qla2100_dump_buffer((uint8_t *)mb, 16); + qla2100_print("\n"); + qla2100_dump_buffer(((uint8_t *)mb + 0x10), 16); + qla2100_print("\n"); + qla2100_dump_buffer(((uint8_t *)mb + 0x20), 8); + qla2100_print("\n"); + qla2100_print("qla2100_mailbox_command: I/O address = "); + qla2100_output_number((u_long)optr, 16); + qla2100_print("\n"); +#endif + iptr = mb; + command = *(mb); + for( cnt = 0; cnt < MAILBOX_REGISTER_COUNT; cnt++ ) { + if( mr & BIT_0 ) { + WRT_REG_WORD(optr, (*iptr)); + } + mr >>= 1; + optr++; + iptr++; + } +#ifdef QL_DEBUG_LEVEL_5 + qla2100_dump_regs(ha->host); +#endif + + /* Issue set host interrupt command. */ + ha->flags.mbox_int = FALSE; + WRT_REG_WORD(®->host_cmd, HC_SET_HOST_INT); + + /* Wait for 30 seconds for command to finish. */ + if (ha->device_id == QLA2300_DEVICE_ID) + data = qla2100_debounce_register((uint16_t *)®2300->host_status); + else data = qla2100_debounce_register(®->istatus); + + cnt = 0x100000*2; /* 22 secs */ + + for( ; cnt > 0 && !ha->flags.mbox_int; cnt-- ) { + /* Check for pending interrupts. */ + if (ha->device_id == QLA2300_DEVICE_ID) { + switch (*mb) { + case MBC_LOAD_RAM: + case MBC_EXECUTE_FIRMWARE: + case MBC_MAILBOX_REGISTER_TEST: + case MBC_VERIFY_CHECKSUM: + case MBC_ABOUT_FIRMWARE: + /* handle ROM commands the old way */ + data = RD_REG_WORD(®->istatus); + intreq = data & RISC_INT; + break; + default: + /* handle non-ROM commands the new way */ + data = RD_REG_WORD(®->istatus); + longdata = RD_REG_DWORD(®2300->host_status); + intreq = longdata & RISC_2300_INT; + break; + } + } else { + /* QLA2100 or QLA2200 */ + data = RD_REG_WORD(®->istatus); + intreq = data & RISC_INT; + } + if ( intreq != 0 ) { + qla2100_isr(ha, + (srb_t **)&done_q_first, + (srb_t **)&done_q_last); + /* udelay(10); */ + } + udelay(10); /* v4.27 */ + } /* for */ + + /* Check for mailbox command timeout. */ + if( !cnt ) { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2100_mailbox_command: **** MB Command Timeout for cmd = "); + qla2100_output_number((u_long)mb[0], 16); + qla2100_print(" ****\n"); + qla2100_print( + "qla2100_mailbox_command: **** icontrol = "); + qla2100_output_number(RD_REG_WORD(®->ictrl), 16); + qla2100_print(" ****\n"); + qla2100_print( + "qla2100_mailbox_command: **** istatus = "); + qla2100_output_number((u_long)data, 16); + qla2100_print(" ****\n"); + qla2100_print( + "qla2100_mailbox_command: **** chip mailbox[0] = "); + qla2100_output_number((u_long)RD_REG_WORD(optr), 16); + qla2100_print(" ****\n"); + qla2100_dump_regs(ha->host); +#endif + ha->flags.isp_abort_needed = TRUE; + qla2100_stats.mboxtout++; + status = 1; + } else if( ha->mailbox_out[0] != MBS_CMD_CMP ) { + qla2100_stats.mboxerr++; + status = 1; + } + + /* Load return mailbox registers. */ + optr = mb; + iptr = (uint16_t *)&ha->mailbox_out[0]; + + mr = MAILBOX_REGISTER_COUNT; + while( mr-- ) + *optr++ = *iptr++; + + /* Go check for any response interrupts pending. */ + ha->flags.mbox_busy = FALSE; + + qla2100_isr(ha,(srb_t **)&done_q_first,(srb_t **)&done_q_last); + + /* Release interrupt specific lock */ + QLA2100_INTR_UNLOCK(ha); + DRIVER_UNLOCK + + if( ha->flags.isp_abort_needed ) + qla2100_abort_isp(ha); + + if( ha->flags.reset_marker ) + qla2100_rst_aen(ha); + if( ha->flags.update_config_needed ) + qla2100_update_config(ha); + if( ha->flags.loop_resync_needed ) + qla2100_loop_resync(ha); + + if( done_q_first ) + qla2100_done(ha, (srb_t **)&done_q_first, (srb_t **)&done_q_last); + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) { + qla2100_print("qla2100_mailbox_command: **** FAILED, mailbox0 = "); + qla2100_output_number((u_long)mb[0], 16); + qla2100_print(" ****\n"); + } else { +/* DEBUG(qla2100_print("qla2100_mbc: Completed OK operation=");) +DEBUG(qla2100_output_number((u_long)command, 16);) +DEBUG(qla2100_print(" \n");) +DEBUG(qla2100_print("qla2100_mbc: mailbox[1]=");) +DEBUG(qla2100_output_number((u_long)mb[1], 16);) +DEBUG(qla2100_print(" \n");) +DEBUG(qla2100_print("mbc: +++ rsp_q_in= ");) +DEBUG(qla2100_output_number(RD_REG_WORD(&ha->iobase2300->rsp_q_in), 16);) +DEBUG(qla2100_print(" +++ \n");) +DEBUG(qla2100_print("mbc: +++ rsp_q_out= ");) +DEBUG(qla2100_output_number(RD_REG_WORD(&ha->iobase2300->rsp_q_out), 16);) +DEBUG(qla2100_print(" +++ \n\n");) +DEBUG(printk("qla2100_mbc: Completed OK operation=%x\n\n",command);) */ + } +#endif +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_mailbox_command"); +#endif + return(status); +} + + + /* + * qla2100_poll + * Polls ISP for interrupts. + * + * Input: + * ha = adapter block pointer. + */ +STATIC void +qla2100_poll(scsi_qla_host_t *ha) { + device_reg_t *reg = ha->iobase; + device2300_reg_t *reg2300 = ha->iobase2300; + uint16_t data; + srb_t *done_q_first = 0; + srb_t *done_q_last = 0; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_poll"); +#endif + + /* Acquire interrupt specific lock */ + QLA2100_INTR_LOCK(ha); + + /* Check for pending interrupts. */ + if (ha->device_id == QLA2300_DEVICE_ID) + data = qla2100_debounce_register((uint16_t *)®2300->host_status) & + RISC_2300_INT; + else data = qla2100_debounce_register(®->istatus) & + RISC_INT; + + /* Check for pending interrupts. */ + if( data ) { + DEBUG(qla2100_print("qla2100_poll: Calling isr\n");) + qla2100_isr(ha, + (srb_t **)&done_q_first, + (srb_t **)&done_q_last); + } + + /* Release interrupt specific lock */ + QLA2100_INTR_UNLOCK(ha); + + if( !ha->flags.mbox_busy ) { + if( ha->flags.isp_abort_needed ) + qla2100_abort_isp(ha); + if( ha->flags.reset_marker ) + qla2100_rst_aen(ha); + if( ha->flags.update_config_needed ) + qla2100_update_config(ha); + if( ha->flags.loop_resync_needed ) + qla2100_loop_resync(ha); + } + + if( done_q_first ) + qla2100_done(ha, (srb_t **)&done_q_first, (srb_t **)&done_q_last); + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_poll"); +#endif +} + +/* +* qla2100_find_host +* This routine searches the host adapter database +* and return either TRUE or FALSE. +* +* Input: +* ha = adapter block pointer. +* device = device data pointer. +* +* Returns: +* TRUE - found +*/ +STATIC uint8_t +qla2100_find_host(scsi_qla_host_t *ha, device_data_t *device) { + fcdev_t *pdb; + uint16_t cnt; + + pdb = ha->phost_db; + for (cnt = 0; cnt < ha->host_db_ptr; cnt++) { + /* if nodename/portname in database */ +#if USE_PORTNAME + if (BCMP(device->wwn, pdb[cnt].name, 8) == 0) { +#else + if (BCMP(device->name, pdb[cnt].name, 8) == 0) { +#endif + return TRUE; + } + } + return FALSE; +} + +/* +* qla2100_update_host_data +* This routine updates the host device database +* +* Input: +* ha = adapter block pointer. +* device = device data pointer. +* +* Returns: +* 0 = success, if device found or added to database. +* 1 = error +* 2 = database was full and device was not configured. +*/ +STATIC uint8_t +qla2100_update_host_data(scsi_qla_host_t *ha, device_data_t *device, + uint8_t enable_slot_reuse) +{ + fcdev_t *pdb; + uint8_t status = 0; + uint8_t index; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_update_host"); +#endif + + pdb = ha->phost_db; + index = ha->host_db_ptr; + if (index != MAX_HOST_COUNT) { + index++; +#if USE_PORTNAME + BCOPY(device->wwn, pdb[index].name, 8); +#else + BCOPY(device->name, pdb[index].name, 8); +#endif + } else if ( enable_slot_reuse ) { + index = 0; + printk(KERN_INFO "qla2100_update_host: Host table Full." + " Overwriting slot 0."); +#if USE_PORTNAME + BCOPY(device->wwn, pdb[index].name, 8); +#else + BCOPY(device->name, pdb[index].name, 8); +#endif + } else { + printk(KERN_INFO "qla2100_update_host: Host table Full."); + status = 2; + } + ha->host_db_ptr = index; + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_update_host: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_update_host"); +#endif + return(status); + +} + +/* +* qla2100_update_device_data +* This routine updates the device data in the database and logs +* onto the device if necessary. +* +* Input: +* ha = adapter block pointer. +* device = device data pointer. +* +* Returns: +* 0 = success, if device found or added to database. +* 1 = error +* 2 = database was full and device was not configured. +*/ +STATIC uint8_t +qla2100_update_device_data(scsi_qla_host_t *ha, device_data_t *device, uint8_t enable_slot_reuse) { + uint8_t status = 0; + uint8_t hostflag = 0; + uint8_t dev_configured; + uint16_t cnt, i; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_update_device"); +#endif + + dev_configured = FALSE; + if( ha->device_id == QLA2100_DEVICE_ID ) { + ha->min_external_loopid = 1; /* v2.19.5b3 */ + ha->max_public_loop_ids = LAST_SNS_LOOP_ID - SNS_FIRST_LOOP_ID + 1; + } else { + ha->max_public_loop_ids = LAST_SNS_LOOP_ID + 1; + } + + DEBUG(sprintf(debug_buff, + "qla2100: Found device - portname=%02x%02x%02x%02x%02x%02x%02x%02x," + " nodename=%02x%02x%02x%02x%02x%02x%02x%02x," + " port Id=%06lx, loop id=%04x\n", + device->wwn[0], device->wwn[1], + device->wwn[2], device->wwn[3], + device->wwn[4], device->wwn[5], + device->wwn[6], device->wwn[7], + device->name[0], device->name[1], + device->name[2], device->name[3], + device->name[4], device->name[5], + device->name[6], device->name[7], + device->port_id[0] << 16 | device->port_id[1] << 8 | device->port_id[2], device->loop_id);) + DEBUG(qla2100_print(debug_buff);) + + /* if we already login to the host adapter then skip it */ + if ( qla2100_find_host(ha, device) ) { + DEBUG(printk("update_db: Skipping host adapter..\n");) + return( status ); + } + + /* Search to see if node name is already in database. If found then change loop ID in database. */ + for( cnt = 0; cnt < MAX_FIBRE_DEVICES && !dev_configured; cnt++ ) { + /* if nodename/portname in database then replace it */ +#if USE_PORTNAME /* updated for ioctl merge */ + if (BCMP(device->wwn, ha->fc_db[cnt].wwn, 8) == 0) { +#else + if (BCMP(device->name, ha->fc_db[cnt].name, 8) == 0) { +#endif + ha->fc_db[cnt].flag &= ~DEV_MISSING; + /* if device was configured by user then find and assign a loop ID for it */ + if( ha->fc_db[cnt].loop_id == PORT_AVAILABLE ) { + DEBUG(qla2100_print("Port marked as already assigned.\n");) + /* If device found is on the public loop. */ + /* then find the next available fabric loop ID */ + if( device->loop_id == 0xffff ) { + status = 1; + /* Search the public database for first available slot. */ + for( i = ha->min_external_loopid; i < ha->max_public_loop_ids; i++ ) { + if( !ha->fabricid[i].in_use ) { + ha->fabricid[i].in_use = TRUE; + if( ha->device_id == QLA2100_DEVICE_ID ) + device->loop_id = SNS_FIRST_LOOP_ID + i; + else + device->loop_id = i; + ha->fc_db[cnt].loop_id = device->loop_id; + ha->fc_db[cnt].port_id[0] = device->port_id[0]; + ha->fc_db[cnt].port_id[1] = device->port_id[1]; + ha->fc_db[cnt].port_id[2] = device->port_id[2]; + ha->fc_db[cnt].flag |= DEV_PUBLIC; + status = 0; + break; + } + } /* end of for */ + } else { /* change the local loop ID in database */ + ha->fc_db[cnt].loop_id = device->loop_id; + } + } else /* loop id may have been previously used */ + { + /* If device is on public loop. */ + if( device->loop_id == 0xffff ) { + /* It was previously public, so use previously assigned loop id. */ + if( ha->fc_db[cnt].flag & DEV_PUBLIC ) + if( ha->device_id == QLA2100_DEVICE_ID ) + device->loop_id = ha->fc_db[cnt].loop_id; + else { + /* if the same topology and public loop */ + /* search for the next avaiable public loop ID */ + DEBUG(printk("update_db: topology prev %d, curr %d\n", + ha->prev_topology, ha->current_topology );) + if( ha->prev_topology == ha->current_topology ) { + if( (ha->min_external_loopid) && + (ha->fc_db[cnt].loop_id < ha->min_external_loopid) ) { + status = 1; + /* find a loop ID for the Public device */ + for( i = ha->min_external_loopid; i < ha->max_public_loop_ids; i++ ) + if( !ha->fabricid[i].in_use ) { + ha->fabricid[i].in_use = TRUE; + device->loop_id = i; + ha->fc_db[cnt].loop_id = device->loop_id; + status = 0; + break; + } + } else + device->loop_id = ha->fc_db[cnt].loop_id; + } else { + status = 1; + /* Find an unused loop ID */ + for( i = ha->min_external_loopid; i < ha->max_public_loop_ids; i++ ) + if( !ha->fabricid[i].in_use ) { + ha->fabricid[i].in_use = TRUE; + device->loop_id = i; + ha->fc_db[cnt].loop_id = device->loop_id; + status = 0; + break; + } + } + + } else { + /* If it moved from private to public loop, assign new public loop id. */ + status = 1; + /* Find an unused loop ID */ + for( i = ha->min_external_loopid; i < ha->max_public_loop_ids; i++ ) + if( !ha->fabricid[i].in_use ) { + ha->fabricid[i].in_use = TRUE; + if( ha->device_id == QLA2100_DEVICE_ID ) + + device->loop_id = SNS_FIRST_LOOP_ID + i; + else + device->loop_id = i; + ha->fc_db[cnt].loop_id = device->loop_id; + ha->fc_db[cnt].flag |= DEV_PUBLIC; + ha->fc_db[cnt].port_id[0] = device->port_id[0]; + ha->fc_db[cnt].port_id[1] = device->port_id[1]; + ha->fc_db[cnt].port_id[2] = device->port_id[2]; + status = 0; + break; + } + } + } else { + /* The found device is on private loop but was + previously on public loop, so free public loop id. */ + if( ha->fc_db[cnt].flag & DEV_PUBLIC ) { + ha->fc_db[cnt].flag &= ~DEV_PUBLIC; + i = ha->fc_db[cnt].loop_id - SNS_FIRST_LOOP_ID; + ha->fabricid[i].in_use = 0; + } + ha->fc_db[cnt].loop_id = device->loop_id; + } + } + + /* If public device in database */ + if( !status && (ha->fc_db[cnt].flag) & DEV_PUBLIC ) { + + + /* If public loop device, compare port id to see if + device moves to another NL/N port. */ + if( ha->fc_db[cnt].port_id[0] != device->port_id[0] || + ha->fc_db[cnt].port_id[1] != device->port_id[1] || + ha->fc_db[cnt].port_id[2] != device->port_id[2] ) { + if( ha->prev_topology == ha->current_topology ) { + /* Port id changed, log device out then log back + in with new port id but same loop id. */ + mb[0] = MBC_LOGOUT_FABRIC_PORT; + mb[1] = ha->fc_db[cnt].loop_id << 8; + qla2100_mailbox_command(ha, BIT_1|BIT_0, &mb[0]); + ha->fc_db[cnt].port_id[0] = device->port_id[0]; + ha->fc_db[cnt].port_id[1] = device->port_id[1]; + ha->fc_db[cnt].port_id[2] = device->port_id[2]; + } + } + /* + * Try and find a loop Id for the given + * fabric port. We keep trying Ids until we find + * a good one. + */ + mb[0] = 0x4008; + while( !status && mb[0] == 0x4008 ) { + DEBUG(printk("update_db: Trying Fabric Login @ loop id= %d, port id= %06x\n", device->loop_id,device->port_id);) + mb[0] = MBC_LOGIN_FABRIC_PORT; + mb[1] = device->loop_id << 8 | 0x01; + mb[2] = device->port_id[0]; + mb[3] = device->port_id[1] << 8 | device->port_id[2]; + qla2100_mailbox_command(ha, BIT_3|BIT_2|BIT_1|BIT_0, + &mb[0]); + /* Command parameter error or all IDS used */ + if ( mb[0] == 0x4006 || mb[0] == 0x4009 ) { + status = 1; + DEBUG(printk("update_db: (1) Failed Fabric login with Loop ID = %d\n", device->loop_id);) + } + /* + * if loop Id is in use then try the next Id . + */ + if( mb[0] == 0x4008 ) { + DEBUG(printk("update_db: Used Loop ID = %04x, port id=%06x - trying next id\n", device->loop_id, + ((mb[1] << 16) | (((mb[2] >>8 ) &0xff) << 8) | (mb[2] & 0xff)));) + if( device->loop_id++ <= LAST_SNS_LOOP_ID ) + ha->fabricid[device->loop_id].in_use = TRUE; + else + status = 1; + } + } + /* Login succuessful */ + if( !status ) { + /* if different host */ + if( (mb[1] & 0x1) ) { /* v2.19.05b3 */ + DEBUG(printk("update_db: Warning -- Adapter found: port id=%06x, tgt=%d\n", + ((mb[1] << 16) | (((mb[2] >>8 ) &0xff) << 8) | (mb[2] & 0xff)),cnt);) + qla2100_update_host_data(ha, device, enable_slot_reuse); + ha->fabricid[device->loop_id].in_use = FALSE; + hostflag++; + } else { + /* 4.31.8 update loop id in database */ + ha->fc_db[cnt].loop_id = device->loop_id; + } + } +#if 0 + /* Command error */ + if( !status && mb[0] != 0x4005 ) { + /* Issue Abort target command to cause RISC to + flush all commands outstanding for this device. + Commands will be returned with "Aborted" status. */ + mb[0] = MBC_ABORT_TARGET; + mb[1] = device->loop_id << 8; + mb[2] = 1; + status = qla2100_mailbox_command(ha, BIT_2|BIT_1|BIT_0, &mb[0]); + } +#endif + } + dev_configured = TRUE; + } + } + + /* Device not already in database so find */ + /* an empty slot and loop id for it. */ + if( !dev_configured ) { + DEBUG(printk("qla2100_db_update: New Device - not in database.\n");) + + /* If device is on public loop. */ + /* First find an unused Fabric loop ID */ + /* then find a slot. */ + if( device->loop_id == 0xffff ) { + status = 1; + for( i = ha->min_external_loopid; i < ha->max_public_loop_ids; i++ ) { + if( !ha->fabricid[i].in_use ) { + ha->fabricid[i].in_use = TRUE; + if( ha->device_id == QLA2100_DEVICE_ID ) + device->loop_id = SNS_FIRST_LOOP_ID + i; + else + device->loop_id = i; + status = 0; + break; + } + } + /* Preset status to Loop ID used */ + mb[0] = 0x4008; + /* Check to insure loop ID for fabric device is good */ + while( !status && mb[0] == 0x4008 ) { + DEBUG(printk("update_db: Trying Fabric Login @ loop id %d\n", device->loop_id);) + mb[0] = MBC_LOGIN_FABRIC_PORT; + mb[1] = device->loop_id << 8 | 0x01; + mb[2] = device->port_id[0]; + mb[3] = device->port_id[1] << 8 | device->port_id[2]; + qla2100_mailbox_command(ha, BIT_3|BIT_2|BIT_1|BIT_0, &mb[0]); + if ( mb[0] == 0x4006 || mb[0] == 0x4009 ) { + status = 1; + DEBUG(printk("update_db: (2) Failed Fabric login with Loop ID = %d\n", device->loop_id);) + } + if( mb[0] == 0x4008 ) { + DEBUG(printk("update_db: (2) Used Fabric Loop ID = %04x, port id=%06x\n", device->loop_id, + ((mb[1] << 16) | (((mb[2] >>8 ) &0xff) << 8) | (mb[2] & 0xff)));) + if( device->loop_id++ <= LAST_SNS_LOOP_ID ) + ha->fabricid[device->loop_id].in_use = TRUE; /* v2.19.05b3 */ + else + status = 1; + } + if( (mb[1] & 0x1) ) { /* v2.19.05b3 */ + qla2100_update_host_data(ha, device, enable_slot_reuse); + DEBUG(printk("update_db: Adapter found: port id=%06x\n", + (device->port_id[0] <<16) | + (device->port_id[1] << 8) | (device->port_id[2])) ); + ha->fabricid[device->loop_id].in_use = FALSE; + hostflag++; + } + } + } + /* Now find an empty slot for the device */ + if( !status && hostflag == 0 ) { + if( ha->device_id == QLA2100_DEVICE_ID ) + ha->min_external_loopid = SNS_FIRST_LOOP_ID; + /* Find a empty slot and add device into database. */ + for( i = 0; i < MAX_FIBRE_DEVICES; i++ ) + if( ha->fc_db[i].loop_id == PORT_UNUSED ) { + ha->fc_db[i].flag &= ~DEV_MISSING; + + /* get and set both wwnn and wwpn */ + BCOPY(device->name, ha->fc_db[i].name, 8); + BCOPY(device->wwn, ha->fc_db[i].wwn, 8); + + ha->fc_db[i].loop_id = device->loop_id; + if( device->loop_id >= ha->min_external_loopid ) { + ha->fc_db[i].flag |= DEV_PUBLIC; + ha->fc_db[i].port_id[0] = device->port_id[0]; + ha->fc_db[i].port_id[1] = device->port_id[1]; + ha->fc_db[i].port_id[2] = device->port_id[2]; + } + ha->flags.updated_fc_db = TRUE; + dev_configured = TRUE; + break; + } + if( !dev_configured ) { + if( enable_slot_reuse ) { + for( i = 0; i < MAX_FIBRE_DEVICES; i++ ) + if( ha->fc_db[i].loop_id == PORT_AVAILABLE ) { + ha->fc_db[i].flag &= ~DEV_MISSING; +#if USE_PORTNAME /* ioctl support change */ + BCOPY(device->wwn, ha->fc_db[i].wwn, 8); +#else + BCOPY(device->name, ha->fc_db[i].name, 8); +#endif + ha->fc_db[i].loop_id = device->loop_id; + if( device->loop_id >= ha->min_external_loopid ) { + ha->fc_db[i].flag |= DEV_PUBLIC; + ha->fc_db[i].port_id[0] = device->port_id[0]; + ha->fc_db[i].port_id[1] = device->port_id[1]; + ha->fc_db[i].port_id[2] = device->port_id[2]; + } + ha->flags.updated_fc_db = TRUE; + break; + } + } else { + ha->fabricid[device->loop_id].in_use = FALSE; + status = 2; + } + + } + + } + } +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_update_device: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_update_device"); +#endif + return(status); + } + +/* +* qla2100_sns_device +* Setup Simple Name Server devices with loop ID's. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success. +* 1 = error +* 2 = database was full and device was not configured. +*/ +STATIC uint8_t +qla2100_sns_device(scsi_qla_host_t *ha, uint8_t enable_slot_reuse) { + uint8_t status = 1; + uint8_t first_port_id[3]; + uint8_t next_port_id[3]; + uint8_t host_port_id[3]; + sns_data_t *sns; +#if BITS_PER_LONG > 32 + uint64_t phys_address = 0; +#else + uint32_t phys_address = 0; +#endif + uint16_t mb[MAILBOX_REGISTER_COUNT]; + uint8_t use_gan = 1; + uint8_t retry_count = 0; + gp_idnn_t *gp_idnn; + uint16_t i; + device_data_t device; + uint8_t db_full = 0; + uint16_t public_count; + uint32_t fabric_devices = 0; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_sns_device"); +#endif + + /* If FL port exists, then SNS is present */ + DEBUG(printk("qla2100_sns_device: Checking for Fabric.\n");) + mb[0] = MBC_GET_PORT_NAME; + mb[1] = SNS_FL_PORT << 8; /* port name */ + if( !qla2100_mailbox_command(ha, BIT_1|BIT_0, &mb[0]) ) { + +#ifdef RCSN + /* Mark devices that need re-synchronization. */ + qla2100_device_resync(ha); +#endif + + /* Fl port is present */ + host_port_id[0] = ha->port_id[0]; + host_port_id[1] = ha->port_id[1]; + host_port_id[2] = ha->port_id[2]; + + /* Calculate the max number of public ports */ + if( ha->device_id == QLA2100_DEVICE_ID ) + public_count = ha->max_public_loop_ids; + else + public_count = ha->max_public_loop_ids - ha->min_external_loopid; + + /* Register with name server as type fc4 device */ + +#ifdef FC_IP_SUPPORT + /* Register with name server as type 5 device */ + if (ha->flags.enable_ip == TRUE) { + qla2x00_register_ip_device(ha); + } + + /* If IP enable, skip GP_IDNN and just use GAN */ + if (ha->flags.enable_ip == TRUE) + goto tryGan; +#endif /* FC_IP_SUPPORT */ + + /* Find out if this is a Brocade switch, if so do GP_IDNN. */ + /* otherwise use the GAN */ + mb[0] = MBC_GET_PORT_NAME; + mb[1] = SNS_FL_PORT << 8 | BIT_0; /* node name */ + qla2100_mailbox_command(ha, BIT_1|BIT_0, &mb[0]); + if( mb[2] == 0x0010 && mb[3] == 0x6000 && + (mb[6] & 0x00FF) == 0x0069 ) { +/* 4.10 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + gp_idnn = KMALLOC(GP_IDNN_LENGTH); + if ( gp_idnn != NULL ) { + phys_address = VIRT_TO_BUS(gp_idnn); + BZERO((caddr_t)gp_idnn, GP_IDNN_LENGTH); + } +#else + gp_idnn = pci_alloc_consistent(ha->pdev, + GP_IDNN_LENGTH, + &phys_address); + BZERO((caddr_t)gp_idnn, GP_IDNN_LENGTH); +#endif + if ( gp_idnn != NULL ) { + /* Retry GP_IDNN til valid list or retries done */ + while( retry_count++ < 10 ) { + /* + * Issue GP_IDNN to get list of port IDs and + * node names from name server. + */ + gp_idnn->req.buffer_length = GP_IDNN_LENGTH/2; + /* 4.10 */ + gp_idnn->req.buffer_address[0] = + LS_64BITS(phys_address); + gp_idnn->req.buffer_address[1] = + MS_64BITS(phys_address); + gp_idnn->req.subcommand_length = 6; + gp_idnn->req.subcommand = 0x173; + gp_idnn->req.length = GP_IDNN_LENGTH / 4; + gp_idnn->req.protocol = 0x08; + + mb[0] = MBC_SEND_SNS_COMMAND; + mb[1] = 14; + mb[3] = LSW(phys_address); + mb[2] = MSW(phys_address); + mb[7] = QL21_64BITS_3RDWD(phys_address); + mb[6] = QL21_64BITS_4THWD(phys_address); + if( !qla2100_mailbox_command(ha, + BIT_7|BIT_6|BIT_3|BIT_2|BIT_1|BIT_0, + &mb[0]) ) { + if( gp_idnn->rsp.response == SNS_ACCEPT ) { + DEBUG3(printk("Sns: Get all Fabric devices:\n");) + /* Go down device list and add devices to database. */ + for( i = 0; i < public_count; i++ ) { + /* if not host port id then add it to the database */ + if( gp_idnn->rsp.port_data[i].port_id[0] != host_port_id[0] || + gp_idnn->rsp.port_data[i].port_id[1] != host_port_id[1] || + gp_idnn->rsp.port_data[i].port_id[2] != host_port_id[2] ) { + BCOPY(gp_idnn->rsp.port_data[i].nodename, device.name, 8); + /* get loop id */ + device.port_id[0] = gp_idnn->rsp.port_data[i].port_id[0]; + device.port_id[1] = gp_idnn->rsp.port_data[i].port_id[1]; + device.port_id[2] = gp_idnn->rsp.port_data[i].port_id[2]; +#if USE_PORTNAME + /* Get portname */ + if( qla2100_sns_get_name(ha, &device, 0) ) { + status = 1; /* v2.19.5b4 */ + break; + } +#endif + device.loop_id = 0xffff; + /* Update device database and login to device. */ + fabric_devices++; + if( (status = qla2100_update_device_data(ha, &device, enable_slot_reuse)) ) { + if( status == 2 ) + db_full = 1; + else + break; + } + } + if( gp_idnn->rsp.port_data[i].controlbyte == 0x80 ) + break; + } + use_gan = 0; + break; + } + } + /* Wait for 100ms before retrying */ + for( i = 0; i <= 10000; i++ ) { + udelay(10); + } + } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + KMFREE(gp_idnn, GP_IDNN_LENGTH); +#else + pci_free_consistent(ha->pdev, GP_IDNN_LENGTH, + gp_idnn, phys_address); +#endif + } else { + use_gan = 0; +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2100_sns_device: Failed to allocate memory, No FL Port\n"); +#endif + } + } + /* Use the GAN (GA_NXT) Name server request to discover the ports */ + + /* + * Go through GAN list to find all fabric devices. Will perform + * necessary logout of previously existed devices that have changed + * and save new devices in a new device list. + * + */ + + if( use_gan ) { +#ifdef FC_IP_SUPPORT + tryGan: +#endif + + /* Find all registered ports in the Fabric */ +/* 4.10 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + sns = KMALLOC(sizeof(sns_data_t)); + if ( sns != NULL ) { + phys_address = VIRT_TO_BUS(sns); + BZERO((caddr_t)sns, sizeof(sns_data_t)); + } +#else + sns = pci_alloc_consistent(ha->pdev, + sizeof(sns_data_t), + &phys_address); + BZERO((caddr_t)sns, sizeof(sns_data_t)); +#endif + if ( sns != NULL ) { + DEBUG(printk("qla2100_sns_device: Performing a GAN (%d)\n",public_count);) + status = 0; + /* start with port ID = 0 */ + first_port_id[0] = first_port_id[1] = first_port_id[2] = 0; + next_port_id[0] = next_port_id[1] = next_port_id[2] = 0; + mb[0] = 0; + for( i = 0; i < public_count && !ha->loop_down_timer && + !ha->flags.loop_resync_needed; i++ ) { + /* GAN Get all next entries for the selected port ID from SNS. */ + BZERO((caddr_t)sns, sizeof(sns_data_t)); + sns->p.req.hdr.buffer_length = 318; /*304*/ + sns->p.req.hdr.buffer_address[0] = + LS_64BITS(phys_address); + sns->p.req.hdr.buffer_address[1] = + MS_64BITS(phys_address); + sns->p.req.hdr.subcommand_length = 6; + sns->p.req.subcommand = 0x100; + sns->p.req.param[6] = next_port_id[2]; + sns->p.req.param[7] = next_port_id[1]; + sns->p.req.param[8] = next_port_id[0]; + + mb[0] = MBC_SEND_SNS_COMMAND; + mb[1] = 14; + mb[3] = LSW(phys_address); + mb[2] = MSW(phys_address); + mb[7] = QL21_64BITS_3RDWD(phys_address); + mb[6] = QL21_64BITS_4THWD(phys_address); + if( !qla2100_mailbox_command(ha, + BIT_7|BIT_6|BIT_3|BIT_2|BIT_1|BIT_0, + &mb[0]) ) { + if( sns->p.rsp[8] != 0x80 || /* SNS_ACCEPT */ + sns->p.rsp[9] != 0x02 ) { /* 04/18/00 */ + printk(KERN_INFO "qla2100_sns_device: SEND_SNS_COMMAND Failed - 0x%2x%2x mb_res=%x\n", + sns->p.rsp[8],sns->p.rsp[9],mb[0]); + status = 1; + break; + } + /* save next port ID */ + next_port_id[0] = sns->p.rsp[17]; + next_port_id[1] = sns->p.rsp[18]; + next_port_id[2] = sns->p.rsp[19]; + + } else { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2100_sns_device: MBC_SEND_SNS_COMMAND Failed, No FL Port\n"); +#endif + /* v2.19.5 */ + DEBUG(printk("qla2100_sns_device: Failed Performing a GAN mb0=0x%x, mb1=0x%x\n", + mb[0],mb[1]);) + status = 1; + break; + } + + /* Assign loop ID for device on SNS. */ + if( (next_port_id[0] != first_port_id[0] || + next_port_id[1] != first_port_id[1] || + next_port_id[2] != first_port_id[2]) + && (sns->p.rsp[284] || sns->p.rsp[285] || + sns->p.rsp[286] || sns->p.rsp[287] || + sns->p.rsp[288] || sns->p.rsp[289] || + sns->p.rsp[290] || sns->p.rsp[291]) ) { + /* if port Id local loop skip this ID */ + if( next_port_id[0] != host_port_id[0] || + next_port_id[1] != host_port_id[1] || + next_port_id[2] != host_port_id[2] ) { +#if USE_PORTNAME + /* Extract portname */ + BCOPY(&sns->p.rsp[20], device.wwn, 8); +#endif + /* Extract nodename */ + BCOPY(&sns->p.rsp[284], device.name, 8); + /* extract port ID */ + device.port_id[0] = next_port_id[0]; + device.port_id[1] = next_port_id[1]; + device.port_id[2] = next_port_id[2]; + device.loop_id = 0xffff; + + /* Update device database and login device in */ + + /* if McData, skip all port types except 1 (N_port) & 2 (NL_port) */ + if ( !( (sns->p.rsp[16] == 0x01) || + (sns->p.rsp[16] == 0x02) ) ) { + DEBUG(printk("qla2100_sns_device: Skipping port type %x\n", sns->p.rsp[16]);) + } + +#ifdef FC_IP_SUPPORT + else if (sns->p.rsp[579] & 0x20) { + fabric_devices++; + /* Update IP device */ + if (qla2x00_update_ip_device_data(ha, &device) == QL_STATUS_FATAL_ERROR) { + status = 1; + break; + } + /* Update SCSI device */ + } +#endif + else { + fabric_devices++; + if( (status = qla2100_update_device_data(ha, &device, enable_slot_reuse)) ) { + if( status == 2 ) + db_full = 1; + break; + } + } +#ifdef FC_IP_SUPPORT + } +#endif + } + + /* + * Save first port if not repeating port + * on another Loop ID. + */ + if( !(first_port_id[0] || first_port_id[1] || + first_port_id[2]) ) { + first_port_id[0] = next_port_id[0]; + first_port_id[1] = next_port_id[1]; + first_port_id[2] = next_port_id[2]; + } + } else + break; + } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + KMFREE(sns, sizeof(sns_data_t)); +#else + pci_free_consistent(ha->pdev, sizeof(sns_data_t), + sns, phys_address); +#endif + + } +#ifdef QL_DEBUG_LEVEL_2 + else + qla2100_print( + "qla2100_sns_device: Failed to allocate memory, No FL Port\n"); +#endif + } + } else +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2100_sns_device: MBC_GET_PORT_NAME Failed, No FL Port\n"); +#else + DEBUG(printk("No Fabric found.\n");) +#endif + + if( fabric_devices > 0) + ha->device_flags |= DFLG_FABRIC_DEVICES; + + if( db_full ) + status = 2; + + /* Update iff F/FL found and update O.K. */ + if( !status ) + ha->prev_topology = ha->current_topology; + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_sns_device: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_sns_device"); +#endif + return(status); +} + +#if USE_PORTNAME +/* +* qla2100_sns_get_name +* This routine is called tot do the SNS Get Port/Name command +* of the specified port. +* +* Input: +* ha = adapter block pointer. +* flag = 0 - port name , 1 - node name +* +* Output: +* +*/ +STATIC uint8_t qla2100_sns_get_name( scsi_qla_host_t *ha, device_data_t *device, uint8_t flag ) { + uint8_t lStatus = 0; + uint16_t wRetryCount; +#if BITS_PER_LONG > 32 + uint64_t phys_address = 0; +#else + uint32_t phys_address = 0; +#endif + uint16_t mb[MAILBOX_REGISTER_COUNT]; + uint16_t subCmd, response; + sns_data_t *sns; + + /* Set retry count */ + if ( flag ) + subCmd = 0x113; + else + subCmd = 0x112; + DEBUG2(printk("qla2100_SnsGetName: Get opcode %x - name for port Id %06x\n", subCmd, + (uint32_t)(device->port_id[0] << 16 | device->port_id[1] << 8 | device->port_id[2]));) + + wRetryCount = 2; + while (wRetryCount--) { + /* Do 'Get Port/Node name' mailbox command for the FL attached device */ +/* 4.10 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + sns = KMALLOC(sizeof(sns_data_t)); + if ( sns != NULL ) { + phys_address = VIRT_TO_BUS(sns); + BZERO((caddr_t)sns, sizeof(sns_data_t)); + } +#else + sns = pci_alloc_consistent(ha->pdev, + sizeof(sns_data_t), + &phys_address); + BZERO((caddr_t)sns, sizeof(sns_data_t)); +#endif + if ( sns != NULL ) { + BZERO((caddr_t)sns, sizeof(sns_data_t)); + sns->p.req.hdr.buffer_length = 12; + /* 4.10 */ + sns->p.req.hdr.buffer_address[0] = + LS_64BITS(phys_address); + sns->p.req.hdr.buffer_address[1] = + MS_64BITS(phys_address); + sns->p.req.hdr.subcommand_length = 6; + sns->p.req.subcommand = subCmd; + sns->p.req.param[6] = device->port_id[2]; + sns->p.req.param[7] = device->port_id[1]; + sns->p.req.param[8] = device->port_id[0]; + sns->p.req.param[9] = 0; + + mb[0] = MBC_SEND_SNS_COMMAND; + mb[1] = 14; + mb[3] = LSW(phys_address); + mb[2] = MSW(phys_address); + mb[7] = QL21_64BITS_3RDWD(phys_address); + mb[6] = QL21_64BITS_4THWD(phys_address); + if( !qla2100_mailbox_command(ha, + BIT_7|BIT_6|BIT_3|BIT_2|BIT_1|BIT_0, + &mb[0]) ) { + + response = sns->p.rsp[8] | (sns->p.rsp[9] << 8); + if( response == SNS_ACCEPT ) { + if ( flag ) { + BCOPY(&sns->p.rsp[16], device->name, 8); + } else { + BCOPY(&sns->p.rsp[16], device->wwn, 8); + } + } else { + printk(KERN_WARNING "qla2100_SnsGetName: [ERROR] Get Name mb cmd response is not accept - status %x\n", mb[0]); + } + } else if (mb[0] == MBS_FATAL_ERROR) { + printk(KERN_WARNING "qla2100_SnsGetName: [ERROR] Get Name mb cmd fatal error - status %x\n", mb[0]); + lStatus = 1; + break; + } else { + printk(KERN_WARNING "qla2100_SnsGetName: [ERROR] Get Name mb cmd failed - status %x\n", mb[0]); + } + + } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + KMFREE(sns, sizeof(sns_data_t)); +#else + pci_free_consistent(ha->pdev, sizeof(sns_data_t), + sns, phys_address); +#endif + } + return(lStatus); + +} +#endif + +/* +* qla2100_init_fc_db +* Initializes Fibre Channel Device Database. +* +* Input: +* ha = adapter block pointer. +* +* Output: +* ha->fc_db = initialized +*/ +STATIC void +qla2100_init_fc_db(scsi_qla_host_t *ha) { + uint16_t cnt; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_init_fc_db"); +#endif + + /* Initialize fc database if it is not initialized. */ + if( !ha->fc_db[0].loop_id && !ha->fc_db[1].loop_id ) { + ha->flags.updated_fc_db = FALSE; + + /* Initialize target database. */ + for( cnt = 0; cnt < MAX_FIBRE_DEVICES; cnt++ ) { + ha->fc_db[cnt].name[0] = 0L; + ha->fc_db[cnt].name[1] = 0L; + ha->fc_db[cnt].loop_id = PORT_UNUSED; + ha->fc_db[cnt].port_login_retry_count = 8; + ha->fc_db[cnt].flag = 0; /* v2.19.5b3 */ + ha->fc_db[cnt].port_timer = 0; /* v2.19.8 */ + } + +#if USE_FLASH + /* Move flash database to driver database. */ + qla2100_get_database(ha); +#endif + } + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_init_fc_db"); +#endif +} + +/* +* qla2100_configure_fabric +* Setup fabric devices with loop ID's. +* +* Input: +* ha = adapter block pointer. +* enable_slot_reuse = allows the use of PORT_AVAILABLE slots. +* +* Returns: +* 0 = success. +* 1 = error. +* 2 = database was full and a device was not configured. +* +* Context: +* Kernel context. +*/ +STATIC uint8_t +qla2100_configure_fabric(scsi_qla_host_t *ha, + uint8_t enable_slot_reuse) +{ + uint8_t status = 0; + uint16_t i; + + /* get public loop devices */ + if( !ha->loop_down_timer && !ha->flags.loop_resync_needed ){ + /* Configure loop */ + if( !qla2100_configure_hba(ha) ) { + if( ha->device_id == QLA2100_DEVICE_ID ) { + ha->max_public_loop_ids = LAST_SNS_LOOP_ID - SNS_FIRST_LOOP_ID + 1; + } else { + ha->max_public_loop_ids = LAST_SNS_LOOP_ID + 1; + /* dg 09/15 */ + /* if the topology have change then make all devices available */ + if( ha->prev_topology != ha->current_topology ) { + /* Mark all fabric devices that where present as AVAILABLE */ + for( i = 0; i < ha->max_public_loop_ids; i++ ) + if( (i != SNS_FL_PORT) && (i != FABRIC_CONTROLLER) + && (i != SIMPLE_NAME_SERVER) ) + ha->fabricid[i].in_use = FALSE; + } + } + status = qla2100_sns_device(ha, enable_slot_reuse); + qla2100_restart_queues(ha,TRUE); + } + status = 1; + } + return( status ); +} + +/* +* qla2100_check_devices +* Check devices with loop ID's. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success. +* 1 = retry needed +* +* Context: +* Kernel context. +*/ +STATIC uint8_t +qla2100_check_devices(scsi_qla_host_t *ha) { + int cnt; + uint8_t ret = 0; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + + /* + * Retry any devices that wasn't found but as a WWN. + */ + /* v2.19.05b6 */ + for( cnt = 0; cnt < MAX_FIBRE_DEVICES; cnt++ ) { + if( (ha->fc_db[cnt].flag & DEV_MISSING) && + !(ha->fc_db[cnt].flag & DEV_OFFLINE) ) { + /* + * This dev was not detected but its WWN + * is valid. To handle the case where + * the switch may not be giving us the + * device list correctly, schedule for + * a login retry later if not previously + * done so. + */ + DEBUG(printk("qla2100_sns:Port login retry - target %d, count=%d\n",cnt, + ha->fc_db[cnt].port_login_retry_count); ) + if( ha->fc_db[cnt].port_login_retry_count ) + ha->fc_db[cnt].port_login_retry_count--; + + /* + * If after decrement the retry count + * becomes 0, mark this device OFFLINE so + * no more retries will be done based + * on this device. + */ + if (ha->fc_db[cnt].port_login_retry_count == 0) { + DEBUG(printk("qla2100_sns:Port set to OFFLINE - target %d\n",cnt); ) + ha->fc_db[cnt].flag |= DEV_OFFLINE; + } + ret = 1; + } + } + + /* + * Mark devices as DEV_MISSING if they were present + * before and have a loop ID. + */ + for( cnt = 0; cnt < MAX_FIBRE_DEVICES && + !ha->loop_down_timer && + !ha->flags.loop_resync_needed; cnt++ ) { + /* if this slot is used (i.e. loop ID 0 - 0xfe) */ + if( ha->fc_db[cnt].loop_id <= LAST_SNS_LOOP_ID ) { + /* Get port name */ + mb[0] = MBC_GET_PORT_NAME; + mb[1] = ha->fc_db[cnt].loop_id << 8 | BIT_0; + if( qla2100_mailbox_command(ha, BIT_1|BIT_0, &mb[0]) ) { + /* Flag as missing only once */ + if ( !(ha->fc_db[cnt].flag & DEV_MISSING) ) { + if ( ha->fc_db[cnt].port_login_retry_count ) { /* v2.19.05b3 */ + ha->fc_db[cnt].port_login_retry_count--; + ha->fc_db[cnt].flag |= DEV_MISSING; + DEBUG(printk("qla2100_sns: Missing port %d @ loop ID: %x\n", + cnt, ha->fc_db[cnt].loop_id);) + ret++; + } + } + } else if (ha->fc_db[cnt].flag & DEV_MISSING) { + ha->fc_db[cnt].flag &= ~DEV_MISSING; + ha->fc_db[cnt].flag &= ~DEV_OFFLINE; + ha->fc_db[cnt].flag |= DEV_RETURN; + ha->fc_db[cnt].port_login_retry_count = 8; + DEBUG(printk("qla2100_sns: Device %d returned\n", cnt);) + } + } + } + return( ret ); +} + +/* +* qla2100_update_fc_db +* Updates Fibre Channel Device Database with what is actually on loop. +* +* Input: +* ha = adapter block pointer. +* enable_slot_reuse = allows the use of PORT_AVAILABLE slots. +* +* Output: +* ha->fc_db = updated +* +* Returns: +* 0 = success. +* 1 = error. +* 2 = database was full and device was not configured. +*/ +STATIC uint8_t +qla2100_update_fc_db(scsi_qla_host_t *ha, uint8_t enable_slot_reuse) { + uint8_t status = 0; + uint8_t ret = 0; + uint8_t db_full = 0; + uint16_t cnt; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + port_list_entry_t *gn_list, *port_entry; + device_data_t device; +#if BITS_PER_LONG > 32 + uint64_t phys_address = 0; +#else + uint32_t phys_address = 0; +#endif + uint16_t i, size; + uint16_t localdevices = 0; + int retry_needed = 0; + +#ifdef FC_IP_SUPPORT + PIP_DEVICE_BLOCK pIpDevice; +#endif + + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_update_fc_db"); +#endif + + /* Configure loop */ + if( !qla2100_configure_hba(ha) ) { + if( ha->device_id == QLA2100_DEVICE_ID ) { + ha->max_public_loop_ids = LAST_SNS_LOOP_ID - SNS_FIRST_LOOP_ID + 1; + } else { + ha->max_public_loop_ids = LAST_SNS_LOOP_ID + 1; + /* dg 09/15 */ + /* if the topology have change then make all devices available */ + if( ha->prev_topology != ha->current_topology ) { + /* Mark all fabric devices that where present as AVAILABLE */ + for( i = 0; i < ha->max_public_loop_ids; i++ ) + if( (i != SNS_FL_PORT) && (i != FABRIC_CONTROLLER) + && (i != SIMPLE_NAME_SERVER) ) + ha->fabricid[i].in_use = FALSE; + + /* Mark all local devices that where present as AVAILABLE */ + if( ha->current_topology == ISP_CFG_F ) + for( cnt = 0; cnt < MAX_FIBRE_DEVICES && !ha->loop_down_timer + && !ha->flags.loop_resync_needed; cnt++ ) + if( ha->fc_db[cnt].loop_id < SNS_FIRST_LOOP_ID ) { + ha->fc_db[cnt].loop_id = PORT_AVAILABLE; + ha->fc_db[cnt].flag &= ~DEV_PUBLIC; + } + } + } + /* v2.19.03 - Mark all devices missing if configured */ + for( cnt = 0; cnt < MAX_FIBRE_DEVICES; cnt++ ) + if( ha->fc_db[cnt].flag & DEV_CONFIGURED) + ha->fc_db[cnt].flag |= DEV_MISSING; + +#ifdef FC_IP_SUPPORT + /* Disable all IP devices in linked list */ + for (pIpDevice = ha->pIpDeviceTop; pIpDevice != NULL; + pIpDevice = pIpDevice->pNextIpDevice) { + pIpDevice->lDeviceFlags &= ~IP_DEV_FLAG_PRESENT; + } +#endif /* FC_IP_SUPPORT */ + + /* Configure local */ + /* Get the port list of devices on the local loop */ +/* 4.10 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + gn_list = KMALLOC(GN_LIST_LENGTH); + if ( gn_list != NULL ) { + phys_address = VIRT_TO_BUS(gn_list); + BZERO((caddr_t)gn_list, GN_LIST_LENGTH); + } +#else + gn_list = pci_alloc_consistent(ha->pdev, + GN_LIST_LENGTH, + &phys_address); + BZERO((caddr_t)gn_list, GN_LIST_LENGTH); +#endif + if( gn_list != NULL ) { + + if( !ha->loop_down_timer && !ha->flags.loop_resync_needed ) { + /* Get port list.*/ + mb[0] = MBC_GET_PORT_LIST; +#ifdef FC_IP_SUPPORT + if (ha->flags.enable_ip == FALSE) + mb[1] = BIT_0; /* Bit 0 - return node names */ + else + mb[1] = BIT_0|BIT_1;/* Bit 0 - return node names, Bit 1 - loop IDs 0-255 */ +#else + mb[1] = BIT_0; +#endif + mb[3] = LSW(phys_address); + mb[2] = MSW(phys_address); + mb[7] = QL21_64BITS_3RDWD(phys_address); + mb[6] = QL21_64BITS_4THWD(phys_address); + if( !qla2100_mailbox_command(ha, BIT_7|BIT_6|BIT_3|BIT_2|BIT_1|BIT_0, &mb[0]) ) { + if ( mb[0] == MBS_COMMAND_COMPLETE ) { + port_entry = gn_list; + size = mb[1]; + /* dg 10/29/99 - check for empty list */ + if ( size/sizeof(port_list_entry_t) == 0 ) { + /* Local devices were present, but may not be reponding, + so retry them later */ + DEBUG(qla2100_print("qla2100_update_fc_db: local port list - empty\n");) + } else + /* Scan through the port list and add devices to the database */ + for( ; size >= sizeof(port_list_entry_t); + size -= sizeof(port_list_entry_t), port_entry++ ) { + /* Skip the known ports. */ +#ifdef FC_IP_SUPPORT + if( ((port_entry->loop_id & LOOP_ID_MASK) == SNS_FL_PORT) || + ((port_entry->loop_id & LOOP_ID_MASK) == FABRIC_CONTROLLER) || + ((port_entry->loop_id & LOOP_ID_MASK) == SIMPLE_NAME_SERVER) ) +#else + if( (port_entry->loop_id == SNS_FL_PORT) || + (port_entry->loop_id == FABRIC_CONTROLLER) || + (port_entry->loop_id == SIMPLE_NAME_SERVER) ) +#endif + continue; + + /* if we are on a public loop then logout the public devices. */ + if( ((ha->current_topology == ISP_CFG_FL) + || (ha->current_topology == ISP_CFG_F)) +#ifdef FC_IP_SUPPORT + && !(port_entry->loop_id & PLE_NOT_SCSI_DEVICE) + && ((port_entry->loop_id & LOOP_ID_MASK) >= ha->min_external_loopid)) { +#else + && (port_entry->loop_id >= ha->min_external_loopid) ) { +#endif + mb[0] = MBC_LOGOUT_FABRIC_PORT; +#ifdef FC_IP_SUPPORT + mb[1] = (port_entry->loop_id & LOOP_ID_MASK) << 8; +#else + mb[1] = port_entry->loop_id << 8; +#endif + qla2100_mailbox_command(ha, BIT_1|BIT_0, &mb[0]); + } else { + /* We are on a local loop */ + /* update the database with the loop */ + /* ID and login to the device. */ +#ifdef FC_IP_SUPPORT + device.loop_id = port_entry->loop_id & LOOP_ID_MASK; +#else + device.loop_id = port_entry->loop_id; +#endif + +#if USE_PORTNAME + /* Get port name */ + mb[0] = MBC_GET_PORT_NAME; + /* mb[1] = device.loop_id << 8 | BIT_0; */ + mb[1] = device.loop_id << 8; + if( !qla2100_mailbox_command(ha, BIT_1|BIT_0, &mb[0]) ) { + /* dg 09/15/99 */ + if ( mb[0] == MBS_COMMAND_COMPLETE ) { + /* tt 1/18/00 */ + mb[2] = (mb[2] & 0x00FF) << 8 | mb[2] >> 8; + mb[3] = (mb[3] & 0x00FF) << 8 | mb[3] >> 8; + mb[6] = (mb[6] & 0x00FF) << 8 | mb[6] >> 8; + mb[7] = (mb[7] & 0x00FF) << 8 | mb[7] >> 8; + + BCOPY(&mb[7], &device.wwn[0], 2); + BCOPY(&mb[6], &device.wwn[2], 2); + BCOPY(&mb[3], &device.wwn[4], 2); + BCOPY(&mb[2], &device.wwn[6], 2); + } else { + status = 1; + printk(KERN_WARNING "qla2100_update_fc_db: [ERROR] GET PORT NAME - bad status.\n"); + goto qla2100_update_fc_db_exit; + } + + } else { /* dg 10/29/99 */ + if ( mb[0] == MBS_FATAL_ERROR ) { + status = 1; + goto qla2100_update_fc_db_exit; + } + continue; + } +#endif + /* Get the node name */ + BCOPY(port_entry->name, device.name, 8); + + +#ifdef FC_IP_SUPPORT + if (!(port_entry->loop_id & PLE_NOT_SCSI_DEVICE)) { + /* SCSI type device */ + DEBUG(sprintf(debug_buff, "qla2100_update_fc_db: SCSI device at ID %x\n\r", + device.loop_id)); + DEBUG(qla2100_print(debug_buff)); +#endif + if( (status = qla2100_update_device_data(ha, &device, enable_slot_reuse)) ) { + /* if not configured or full */ + if( status == 2 ) + db_full = 1; + else + break; + } else + localdevices++; +#ifdef FC_IP_SUPPORT + } else if (ha->flags.enable_ip == TRUE) { + /* SCSI login failed, assume it is IP device */ + DEBUG(sprintf(debug_buff, "qla2100_update_fc_db: IP device at ID %x\n\r", + device.loop_id)); + DEBUG(qla2100_print(debug_buff)); + + /* Update IP device database */ + if (qla2x00_update_ip_device_data(ha, &device) == QL_STATUS_SUCCESS) { + localdevices++; + } else { + status = 1; + break; + } + } +#endif + } + } /* end of For */ + } + } + } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + KMFREE(gn_list, GN_LIST_LENGTH); +#else + pci_free_consistent(ha->pdev, GN_LIST_LENGTH, + gn_list, phys_address); +#endif + /* + * if topology is a direct attached local loop then + * don't serach for public devices, unless its a 2100. + */ + if( ((ha->current_topology == ISP_CFG_N) || + (ha->current_topology == ISP_CFG_NL)) && + ha->device_id != QLA2100_DEVICE_ID ) { /* 2/21/00 - dg */ + ha->prev_topology = ha->current_topology; + } else { + /* dgER - we need to add logic to register + * our adapter with the Name server, so we + * can send Command Transport commands (FC4). + * (target mode) + */ + + /* get public loop devices */ + if( !ha->loop_down_timer && !ha->flags.loop_resync_needed ){ + /* v2.19.5 */ + if( (ret = qla2100_sns_device(ha, enable_slot_reuse)) == 2 ) + db_full = 1; + /* v2.19.5b3 */ + if( ret == 1 ) { + if( ha->device_id != QLA2100_DEVICE_ID ) { + status = ret; + ha->sns_retry_cnt++; + if( ha->sns_retry_cnt > 8 ) { + if( !(ha->dpc_flags & ISP_RESET_ONCE) ) + ha->dpc_flags |= ISP_RESET_NEEDED; + } + else + retry_needed++; + } + } + } + + } + + /* Set local loop devices present flag, clear retry flag */ + if (localdevices > 0 ) { + ha->device_flags |= DFLG_LOCAL_DEVICES; + ha->device_flags &= ~DFLG_RETRY_LOCAL_DEVICES; + } + + if( qla2100_check_devices(ha) ){ + DEBUG(printk("qla2100: Devices are missing or configured - retrying\n");) + retry_needed++; + } +#ifdef FC_IP_SUPPORT + /* Clean up active IP device list */ + for (pIpDevice = ha->pIpDeviceBottom; pIpDevice != NULL; + pIpDevice = pIpDevice->pLastIpDevice) { + if (!(pIpDevice->lDeviceFlags & IP_DEV_FLAG_PRESENT)) { + /* Device not present, remove it from list and free resources */ + DEBUG(sprintf(debug_buff, "qla2100_update_fc_db: removing IP device, loop ID: %x, port ID: %x\n\r", + pIpDevice->wLoopId, + pIpDevice->acPortId[0]<<16 | pIpDevice->acPortId[1]<<8 | pIpDevice->acPortId[2])); + DEBUG(qla2100_print(debug_buff)); + + if (pIpDevice->lDeviceFlags & IP_DEV_FLAG_PUBLIC_DEVICE) { + /* Do fabric logout and free loop ID */ + if (qla2x00_logout_public_device(ha, pIpDevice->wLoopId, 0) == QL_STATUS_FATAL_ERROR) { + status = 1; + break; + } + qla2x00_free_loopid(ha, pIpDevice->wLoopId); + } + qla2x00_free_ip_block(ha, pIpDevice); + } + } +#endif /* FC_IP_SUPPORT */ + + } else { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2100_update_fc_db: Failed to allocate memory, No local loop\n"); +#endif + status = 1; + } + /* Map the devices to target IDs */ + if( !ha->loop_down_timer && !ha->flags.loop_resync_needed ) + qla2100_map_targets(ha); + } else + status = 1; + + if( db_full ) + status = 2; + + if( retry_needed ) { + ha->device_flags |= LOGIN_RETRY_NEEDED; + /* v2.19.5 */ + status = 1; + } + + qla2100_update_fc_db_exit: + + if( status == 0 ) { + ha->loop_state = LOOP_READY; + ha->sns_retry_cnt = 0; + for( cnt = 0; cnt < MAX_FIBRE_DEVICES; cnt++ ) + ha->fc_db[cnt].port_login_retry_count = 8; + DEBUG(printk("qla2100_update_fc_db: LOOP READY\n");) + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_update_fc_db: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_update_fc_db"); +#endif + return(status); +} + +/* +* qla2100_init_tgt_map +* Initializes target map. +* +* Input: +* ha = adapter block pointer. +* +* Output: +* TGT_Q initialized +*/ +STATIC void +qla2100_init_tgt_map(scsi_qla_host_t *ha) { + uint32_t b, t; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_init_tgt_map"); +#endif + + for( b = 0; b < MAX_BUSES; b++ ) + for( t = 0; t < MAX_FIBRE_DEVICES; t++ ) + TGT_Q(ha, b, t) = (tgt_t *) NULL; + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_init_tgt_map"); +#endif +} + +/* +* qla2100_map_targets +* Setup target queues. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success. +*/ +STATIC uint8_t +qla2100_map_targets(scsi_qla_host_t *ha) { + tgt_t *tgt; + uint32_t b; + uint32_t t; + uint8_t status = 0; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_map_targets"); +#endif + + b = 0; + for( t = 0; t < MAX_FIBRE_DEVICES; t++ ) { + /* if Port never been used. OR */ + /* Device does not exist on port. */ + if( ha->fc_db[t].loop_id != PORT_UNUSED && + ha->fc_db[t].loop_id != PORT_AVAILABLE ) { /* dg 10/29/99 */ + + if( (tgt = TGT_Q(ha, b, t)) != NULL ) { + DEBUG2(sprintf(debug_buff,"Target %d already allocated\n",t)); + DEBUG2(qla2100_print(debug_buff)); + } else + tgt = qla2100_tgt_alloc(ha); + DEBUG(sprintf(debug_buff,"Assigning target ID %02x:%02x @ (%08x) to loop id: 0x%04x\n",b,t,tgt,ha->fc_db[t].loop_id);) + DEBUG(qla2100_print(debug_buff)); + TGT_Q(ha, b, t) = tgt; + tgt->loop_id = ha->fc_db[t].loop_id; + tgt->down_timer = 0; + } + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_map_targets: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_map_targets"); +#endif + return(status); +} +#if USE_FLASH +/* +* qla2100_get_database +* Copies and converts flash database to driver database. +* (may sleep) +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success. +*/ +STATIC uint8_t +qla2100_get_database(scsi_qla_host_t *ha) { + flash_database_t *fptr; + uint8_t status = 1; + uint32_t addr; + uint16_t cnt; + uint8_t *bptr; + uint8_t checksum; + uint32_t b, t; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_get_database"); +#endif + + /* Default setup. */ + ha->flash_db = FLASH_DATABASE_0; + ha->flash_seq = 0; + + if( (fptr = (flash_database_t *)KMALLOC(sizeof(flash_database_t))) ) { + /* Enable Flash Read/Write. */ + qla2100_flash_enable(ha); + + /* Start with flash database with the highest sequence number. */ + b = qla2100_read_flash_byte(ha, FLASH_DATABASE_0); + b |= qla2100_read_flash_byte(ha, FLASH_DATABASE_0 + 1) << 8; + b |= qla2100_read_flash_byte(ha, FLASH_DATABASE_0 + 1) << 16; + b |= qla2100_read_flash_byte(ha, FLASH_DATABASE_0 + 1) << 24; + t = qla2100_read_flash_byte(ha, FLASH_DATABASE_1); + t |= qla2100_read_flash_byte(ha, FLASH_DATABASE_1 + 1) << 8; + t |= qla2100_read_flash_byte(ha, FLASH_DATABASE_1 + 1) << 16; + t |= qla2100_read_flash_byte(ha, FLASH_DATABASE_1 + 1) << 24; + if( t > b ) { + ha->flash_db = FLASH_DATABASE_1; + } + + /* Select the flash database with the good checksum. */ + for( t = 0; t < 2; t++ ) { + checksum = 0; + addr = ha->flash_db; + bptr = (uint8_t *)fptr; + fptr->hdr.size = sizeof(flash_database_t); + + /* Read flash database to driver. */ + for( cnt = 0; cnt < fptr->hdr.size; cnt++ ) { + *bptr = (uint8_t)qla2100_read_flash_byte(ha, addr++); + checksum += *bptr++; + if( bptr == &fptr->hdr.spares[0] && + (fptr->hdr.size > sizeof(flash_database_t) || + fptr->hdr.size < sizeof(flash_hdr_t) || + !fptr->hdr.version) ) { + checksum = 1; + break; + } + } + + if( !checksum ) { + status = 0; + break; + } + /* trying other database */ + if( ha->flash_db == FLASH_DATABASE_0 ) { + ha->flash_db = FLASH_DATABASE_1; + } else { + ha->flash_db = FLASH_DATABASE_0; + } + } + + if( !status ) { + ha->flash_seq = fptr->hdr.seq; + + /* Convert flash database to driver database format. */ + if( fptr->hdr.size -= sizeof(flash_hdr_t) ) { + for( cnt = 0; cnt < MAX_FIBRE_DEVICES; cnt++ ) { + ha->fc_db[cnt].name[0] = fptr->node[cnt].name[0]; + ha->fc_db[cnt].name[1] = fptr->node[cnt].name[1]; + cnt, + ha->fc_db[cnt].name[1], + ha->fc_db[cnt].name[0]); + + ha->fc_db[cnt].loop_id = PORT_AVAILABLE; + ha->fc_db[cnt].flag = 0; /* v2.19.05b3 */ + if( !(fptr->hdr.size -= sizeof(flash_node_t)) ) + break; + } + } + } + + qla2100_flash_disable(ha); + + KMFREE(fptr, sizeof(flash_database_t)); + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_get_database: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_get_database"); +#endif + return(status); +} + +/* +* qla2100_save_database +* Copies and converts driver database to flash database. +* (may sleep) +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success. +*/ +STATIC uint8_t +qla2100_save_database(scsi_qla_host_t *ha) { + flash_database_t *fptr; + uint8_t status = 1; + uint32_t addr; + uint16_t cnt; + uint8_t *bptr; + uint8_t checksum; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_save_database"); +#endif + + if( (fptr = (flash_database_t *)KMALLOC(sizeof(flash_database_t)) ) ) { + /* Enable Flash Read/Write. */ + qla2100_flash_enable(ha); + + fptr->hdr.seq = ++ha->flash_seq; + fptr->hdr.version = FLASH_DATABASE_VERSION; + fptr->hdr.size = sizeof(flash_hdr_t); + + /* Copy and convert driver database to flash database. */ + for( cnt = 0; cnt < MAX_FIBRE_DEVICES; cnt++ ) { + if( ha->fc_db[cnt].loop_id == PORT_UNUSED ) + break; + else { + fptr->node[cnt].name[0] = ha->fc_db[cnt].name[0]; + fptr->node[cnt].name[1] = ha->fc_db[cnt].name[1]; + fptr->hdr.size += sizeof(flash_node_t); + } + } + + /* Calculate checksum. */ + checksum = 0; + bptr = (uint8_t *)fptr; + for( cnt = 0; cnt < fptr->hdr.size; cnt++ ) + checksum += *bptr++; + fptr->hdr.checksum = ~checksum + 1; + + /* Setup next sector address for flash */ + if( ha->flash_db == FLASH_DATABASE_0 ) + addr = FLASH_DATABASE_1; + else + addr = FLASH_DATABASE_0; + ha->flash_db = addr; + + /* Erase flash sector prior to write. */ + status = qla2100_erase_flash_sector(ha, addr); + + /* Write database to flash. */ + bptr = (uint8_t *)fptr; + for( cnt = 0; cnt < fptr->hdr.size && !status; cnt++ ) + status = qla2100_program_flash_address(ha, addr++, *bptr++); + + qla2100_flash_disable(ha); + + KMFREE(fptr, sizeof(flash_database_t)); + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_save_database: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_save_database"); +#endif + return(status); +} + +/* +* qla2100_program_flash_address +* Program flash address. +* +* Input: +* ha = adapter block pointer. +* addr = flash byte address. +* data = data to be written to flash. +* +* Returns: +* 0 = success. +*/ +STATIC uint8_t +qla2100_program_flash_address(scsi_qla_host_t *ha, uint32_t addr, uint8_t data) { + uint8_t status; + + /* Write Program Command Sequence */ + qla2100_write_flash_byte(ha, 0x5555, 0xaa); + qla2100_write_flash_byte(ha, 0x2aaa, 0x55); + qla2100_write_flash_byte(ha, 0x5555, 0xa0); + qla2100_write_flash_byte(ha, addr, data); + + /* Wait for write to complete. */ + status = qla2100_poll_flash(ha, addr, data); + +#ifdef QL_DEBUG_LEVEL_2 + if( status ) + qla2100_print("qla2100_program_flash_address: **** FAILED ****\n"); +#endif + return(status); +} + +/* +* qla2100_erase_flash_sector +* Erases flash sector. +* +* Input: +* ha = adapter block pointer. +* addr = sector address. +* +* Returns: +* 0 = success. +*/ +STATIC uint8_t +qla2100_erase_flash_sector(scsi_qla_host_t *ha, uint32_t addr) { + uint8_t status; + + addr &= 0x1c000; + + /* Individual Sector Erase Command Sequence */ + qla2100_write_flash_byte(ha, 0x5555, 0xaa); + qla2100_write_flash_byte(ha, 0x2aaa, 0x55); + qla2100_write_flash_byte(ha, 0x5555, 0x80); + qla2100_write_flash_byte(ha, 0x5555, 0xaa); + qla2100_write_flash_byte(ha, 0x2aaa, 0x55); + qla2100_write_flash_byte(ha, addr, 0x30); + + SYS_DELAY(150); + + /* Wait for erase to complete. */ + status = qla2100_poll_flash(ha, addr, 0x80); + +#ifdef QL_DEBUG_LEVEL_2 + if( status ) + qla2100_print("qla2100_erase_flash_sector: **** FAILED ****\n"); +#endif + return(status); +} + +/* +* qla2100_poll_flash +* Polls flash for completion. +* +* Input: +* ha = adapter block pointer. +* addr = flash byte address. +* data = data to be polled. +* +* Returns: +* 0 = success. +*/ +STATIC uint8_t +qla2100_poll_flash(scsi_qla_host_t *ha, uint32_t addr, uint8_t poll_data) { + uint8_t status = 1; + uint8_t flash_data; + uint32_t cnt; + + poll_data &= BIT_7; + + /* Wait for 30 seconds for command to finish. */ + for( cnt = 3000000; cnt; cnt-- ) { + flash_data = (uint8_t)qla2100_read_flash_byte(ha, addr); + + if( (flash_data & BIT_7) == poll_data ) { + status = 0; + break; + } + if( flash_data & BIT_5 && cnt > 2 ) + cnt = 2; + SYS_DELAY(10); + } + + return(status); +} + +/* +* qla2100_flash_enable +* Setup flash for reading/writing. +* +* Input: +* ha = adapter block pointer. +*/ +STATIC void +qla2100_flash_enable(scsi_qla_host_t *ha) { + device_reg_t *reg = ha->iobase; + + /* Setup bit 16 of flash address. */ + WRT_REG_WORD(®->nvram, NV_SELECT); + + /* Enable Flash Read/Write. */ + WRT_REG_WORD(®->ctrl_status, ISP_FLASH_ENABLE); + + /* Read/Reset Command Sequence */ + qla2100_write_flash_byte(ha, 0x5555, 0xaa); + qla2100_write_flash_byte(ha, 0x2aaa, 0x55); + qla2100_write_flash_byte(ha, 0x5555, 0xf0); + qla2100_read_flash_byte(ha, FLASH_DATABASE_0); +} + +/* +* qla2100_flash_disable +* Disable flash and allow RISC to run. +* +* Input: +* ha = adapter block pointer. +*/ +STATIC void +qla2100_flash_disable(scsi_qla_host_t *ha) { + device_reg_t *reg = ha->iobase; + + /* Restore chip registers. */ + WRT_REG_WORD(®->ctrl_status, 0); + WRT_REG_WORD(®->nvram, 0); +} + +/* +* qla2100_write_flash_byte +* Write byte to flash. +* +* Input: +* ha = adapter block pointer. +* addr = flash byte address. +* data = data to be written. +*/ +STATIC void +qla2100_write_flash_byte(scsi_qla_host_t *ha, uint32_t addr, uint8_t data) { + device_reg_t *reg = ha->iobase; + + WRT_REG_WORD(®->flash_address, (uint16_t)addr); + WRT_REG_WORD(®->flash_data, (uint16_t)data); +} + +/* +* qla2100_read_flash_byte +* Reads byte from flash, but must read a word from chip. +* +* Input: +* ha = adapter block pointer. +* addr = flash byte address. +* +* Returns: +* byte from flash. +*/ +STATIC uint16_t +qla2100_read_flash_byte(scsi_qla_host_t *ha, uint32_t addr) { + device_reg_t *reg = ha->iobase; + uint16_t data; + + WRT_REG_WORD(®->flash_address, (uint16_t)addr); + data = qla2100_debounce_register(®->flash_data); + + return(data); +} +#endif + +/* +* qla2100_reset_adapter +* Reset adapter. +* +* Input: +* ha = adapter block pointer. +*/ +STATIC void +qla2100_reset_adapter(scsi_qla_host_t *ha) { + device_reg_t *reg = ha->iobase; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_reset_adapter"); +#endif + + ha->flags.online = FALSE; + qla2100_disable_intrs(ha); + /* WRT_REG_WORD(®->ictrl, 0); */ + /* Reset RISC processor. */ + WRT_REG_WORD(®->host_cmd, HC_RESET_RISC); + WRT_REG_WORD(®->host_cmd, HC_RELEASE_RISC); +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_reset_adapter"); +#endif +} + +/* +* qla2100_loop_reset +* Issue loop reset. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success +*/ +STATIC uint8_t +qla2100_loop_reset(scsi_qla_host_t *ha) { + uint8_t status = 0; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_loop_reset"); +#endif + + if( ha->flags.enable_lip_reset ) { + mb[0] = MBC_LIP_RESET; + mb[1] = 0xff00; + mb[2] = ha->loop_reset_delay; + status |= qla2100_mailbox_command(ha, BIT_2|BIT_1|BIT_0, &mb[0]); + } + if( ha->flags.enable_target_reset ) { + mb[0] = MBC_TARGET_RESET; + mb[1] = ha->loop_reset_delay; + status |= qla2100_mailbox_command(ha, BIT_1|BIT_0, &mb[0]); + } + if( (!ha->flags.enable_target_reset && !ha->flags.enable_lip_reset ) || + ha->flags.enable_lip_full_login ) { + mb[0] = MBC_LIP_FULL_LOGIN; + status |= qla2100_mailbox_command(ha, BIT_0, &mb[0]); + } + + /* Issue marker command. */ + qla2100_marker(ha, 0, 0, 0, MK_SYNC_ALL); + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_loop_reset: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_loop_reset"); +#endif + return(status); +} + +/* +* qla2100_device_reset +* Issue bus device reset message to the target. +* +* Input: +* ha = adapter block pointer. +* b = BUS number. +* t = SCSI ID. +* +* Returns: +* 0 = success +*/ +STATIC uint8_t +qla2100_device_reset(scsi_qla_host_t *ha, uint32_t b, uint32_t t) { + tgt_t *tgt; + uint8_t status; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_device_reset"); +#endif + + tgt = TGT_Q(ha, b, t); + + mb[0] = MBC_ABORT_TARGET; + mb[1] = tgt->loop_id << 8; + mb[2] = 1; + status = qla2100_mailbox_command(ha, BIT_2|BIT_1|BIT_0, &mb[0]); + + /* Issue marker command. */ + qla2100_marker(ha, b, t, 0, MK_SYNC_ID); + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_device_reset: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_device_reset"); +#endif + return(status); +} + +/* +* qla2100_abort_device +* Issue an abort message to the device +* +* Input: +* ha = adapter block pointer. +* b = BUS number. +* t = SCSI ID. +* l = SCSI LUN. +* +* Returns: +* 0 = success +*/ +STATIC uint8_t +qla2100_abort_device(scsi_qla_host_t *ha, uint32_t b, uint32_t t, uint32_t l) { + tgt_t *tgt; + uint8_t status; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_abort_device"); +#endif + + tgt = TGT_Q(ha, b, t); + + mb[0] = MBC_ABORT_DEVICE; + mb[1] = tgt->loop_id << 8; + mb[2] = l; + status = qla2100_mailbox_command(ha, BIT_2|BIT_1|BIT_0, &mb[0]); + + /* Issue marker command. */ + qla2100_marker(ha, b, t, l, MK_SYNC_ID_LUN); + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_abort_device: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_abort_device"); +#endif + return(status); +} + +/* +* qla2100_abort_command +* Abort command aborts a specified IOCB. +* +* Input: +* ha = adapter block pointer. +* sp = SB structure pointer. +* +* Returns: +* 0 = success +*/ +STATIC uint8_t +qla2100_abort_command(scsi_qla_host_t *ha, srb_t *sp) { + uint8_t status; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + uint32_t b, t, l; + uint32_t handle; + tgt_t *tgt; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_abort_command"); +#endif + /* v2.19.8 */ + t = SCSI_TCN_32(sp->cmd); + if( ha->loop_state == LOOP_DOWN || + PORT_DOWN(ha,t) > 0 ) { + return(0); + } + + /* Locate handle number. */ + for( handle = 0; handle < MAX_OUTSTANDING_COMMANDS; handle++ ) + if( ha->outstanding_cmds[handle] == sp ) + break; + + DEBUG(qla2100_print("qla2100_abort_command: Sending Abort Command for Handle = ");) + DEBUG(qla2100_output_number((u_long) handle, 16);) + DEBUG(qla2100_print("\n");) + + /* Get a pointer to the SCSI address */ + b = SCSI_BUS_32(sp->cmd); + l = SCSI_LUN_32(sp->cmd); + + tgt = TGT_Q(ha, b, t); + + mb[0] = MBC_ABORT_COMMAND; + mb[1] = tgt->loop_id << 8; + mb[2] = (uint16_t)handle; + mb[3] = handle >> 16; + mb[6] = l; + if( !(status = qla2100_mailbox_command(ha, BIT_6|BIT_3|BIT_2|BIT_1|BIT_0, + &mb[0])) ) + sp->flags |= SRB_ABORT_PENDING; + + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_abort_command: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_abort_command"); +#endif + return(status); +} + +/* +* Issue marker command. +* Function issues marker IOCB. +* +* Input: +* ha = adapter block pointer. +* b = BUS number. +* t = SCSI ID +* l = SCSI LUN +* type = marker modifier +*/ +STATIC void +qla2100_marker(scsi_qla_host_t *ha, uint32_t b, uint32_t t, uint32_t l, uint8_t type) { + mrk_entry_t *pkt; + tgt_t *tgt; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_marker"); +#endif + + tgt = TGT_Q(ha, b, t); + + /* Get request packet. */ + if( (pkt = (mrk_entry_t *)qla2100_req_pkt(ha) ) ) { + pkt->entry_type = MARKER_TYPE; + pkt->modifier = type; + + if( type == MK_SYNC_LIP ) + pkt->sequence_number = ha->lip_seq; + else if( type != MK_SYNC_ALL ) { + pkt->lun = l; + pkt->target = (uint8_t)tgt->loop_id; + } + + /* Issue command to ISP */ + qla2100_isp_cmd(ha); + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( !pkt ) + qla2100_print("qla2100_marker: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_marker"); +#endif +} + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,18) +/* +* qla2100_64bit_start_scsi +* The start SCSI is responsible for building request packets on +* request ring and modifying ISP input pointer. +* +* Input: +* ha = adapter block pointer. +* sp = SB structure pointer. +* +* Returns: +* 0 = success, was able to issue command. +*/ +STATIC uint8_t +qla2100_64bit_start_scsi(scsi_qla_host_t *ha, srb_t *sp) { + device_reg_t *reg = ha->iobase; + device2300_reg_t *reg2300 = ha->iobase2300; + uint8_t status = 0; + Scsi_Cmnd *cmd = sp->cmd; + uint32_t cnt; + cmd_a64_entry_t *pkt; + uint16_t req_cnt; + uint16_t seg_cnt; + uint16_t cdb_len,temp; + struct scatterlist *sg = (struct scatterlist *) NULL; + uint32_t timeout; + caddr_t data_ptr; + uint32_t *dword_ptr; + uint64_t dma_handle; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_64bit_start_scsi:"); +#endif + DEBUG(sprintf(debug_buff, + "64bit_start: cmd=%x sp=%x CDB=%x\n\r",cmd,sp,cmd->cmnd[0]);) + DEBUG(qla2100_print(debug_buff)); + + /* Calculate number of entries and segments required. */ + seg_cnt = 0; + req_cnt = 1; + if ( cmd->use_sg ) { + /* 4.10 64 bit S/G Data Transfer */ + sg = (struct scatterlist *) cmd->request_buffer; + seg_cnt = pci_map_sg(ha->pdev, + sg,cmd->use_sg, + scsi_to_pci_dma_dir(cmd->sc_data_direction)); + + if( seg_cnt > 2 ) { + req_cnt += (uint16_t)(seg_cnt - 2) / 5; + if( (uint16_t)(seg_cnt - 2) % 5 ) + req_cnt++; + } + } else if( cmd->request_bufflen ) + { /* no S/G Data Transfer */ + /* DEBUG5(printk("Single data transfer (0x%x)\n", + cmd->request_bufflen)); */ + seg_cnt = 1; + } + + /* Acquire ring specific lock */ + QLA2100_RING_LOCK(ha); + + if( (uint16_t)(req_cnt + 2) >= ha->req_q_cnt ) { + /* Calculate number of free request q out entries. */ + if (ha->device_id == QLA2300_DEVICE_ID) cnt = RD_REG_WORD(®2300->req_q_out); + else cnt = RD_REG_WORD(®->mailbox4); + if( ha->req_ring_index < cnt ) + ha->req_q_cnt = cnt - ha->req_ring_index; + else + ha->req_q_cnt = REQUEST_ENTRY_CNT - (ha->req_ring_index - cnt); + } + + /* If room for request in request ring. */ + if( (uint16_t)(req_cnt + 2) < ha->req_q_cnt ) { + /* Check for room in outstanding command list. */ + for( cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS && + ha->outstanding_cmds[cnt] != 0; cnt++ ) + ; + + if( cnt < MAX_OUTSTANDING_COMMANDS ) { + ha->outstanding_cmds[cnt] = sp; + ha->req_q_cnt -= req_cnt; + CMD_HANDLE(sp->cmd) = (unsigned char *) (u_long) cnt; + + /* + * Build command packet. + */ + pkt = ha->request_ring_ptr; + + pkt->entry_type = COMMAND_A64_TYPE; + pkt->entry_count = (uint8_t)req_cnt; + pkt->sys_define = (uint8_t)ha->req_ring_index; + pkt->control_flags= 0; + pkt->entry_status = 0; + pkt->handle = (uint32_t)cnt; + + /* Zero out remaining portion of packet. */ + dword_ptr = (uint32_t *)pkt + 2; + for( cnt = 2; cnt < REQUEST_ENTRY_SIZE/4; cnt++ ) + *dword_ptr++ = 0; + + /* + * We subtract 2 sec. from the timeout value to insure + * the ISP time-out before the mid-level or the driver. + */ + timeout = (uint32_t) CMD_TIMEOUT(cmd)/HZ; + if( timeout > 2 ) + pkt->timeout = (uint16_t) timeout - 2; + else + pkt->timeout = (uint16_t) timeout; + + /* Set device target ID and LUN */ + pkt->target = TGT_Q(ha, SCSI_BUS_32(cmd), + SCSI_TCN_32(cmd))->loop_id; + pkt->lun = SCSI_LUN_32(cmd); + + /* Enable simple tag queuing if device supports it. */ + if ( cmd->device->tagged_queue ) { + switch (cmd->tag) { + case SIMPLE_QUEUE_TAG: + pkt->control_flags = CF_SIMPLE_TAG; + break; + case HEAD_OF_QUEUE_TAG: + pkt->control_flags = CF_HEAD_TAG; + break; + case ORDERED_QUEUE_TAG: + pkt->control_flags = CF_ORDERED_TAG; + break; + default: + pkt->control_flags = CF_SIMPLE_TAG; + } + } else + pkt->control_flags = CF_SIMPLE_TAG; + + if (ha->device_id == QLA2300_DEVICE_ID) + pkt->control_flags |= CF_NO_FAST_POSTING; + + /* Load SCSI command packet. */ + cdb_len = (uint16_t)CMD_CDBLEN(cmd); + if (cdb_len > MAX_CMDSZ) cdb_len = MAX_CMDSZ; + data_ptr = (uint8_t *) &(CMD_CDBP(cmd)); + for( cnt = 0; cnt < cdb_len; cnt++ ) + pkt->scsi_cdb[cnt] = *data_ptr++; + pkt->byte_count = (uint32_t) CMD_XFRLEN(cmd); + + /* + * Load data segments. + */ + if( seg_cnt ) /* If data transfer. */ + { + switch( cmd->data_cmnd[0] ) { + case FORMAT_UNIT: + case WRITE_6: + case MODE_SELECT: + case SEND_DIAGNOSTIC: + case WRITE_10: + case WRITE_BUFFER: + case WRITE_LONG: + case WRITE_SAME: + case MODE_SELECT_10: + case WRITE_12: + case WRITE_VERIFY_12: + case SEND_VOLUME_TAG: + pkt->control_flags |= BIT_6; /* WRITE */ + break; + default: +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) +#if QLA_SCSI_VENDOR_DIR + qla2100_set_vend_direction(ha, cmd, pkt); +#else + pkt->control_flags |= BIT_5; /* READ */ +#endif +#else /* kernel version is 2.4.0 or higher */ + if (cmd->sc_data_direction == SCSI_DATA_WRITE) + pkt->control_flags |= BIT_6;/*WRITE*/ + else + pkt->control_flags |= BIT_5;/*READ*/ +#endif /* kernel version 2.4.0 */ + break; + } + sp->dir = pkt->control_flags & (BIT_5|BIT_6); + + /* Set total data segment count. */ + pkt->dseg_count = seg_cnt; + + /* Setup packet address segment pointer. */ + dword_ptr = (uint32_t *)&pkt->dseg_0_address; + + if( cmd->use_sg ) /* If scatter gather */ + { + /* Load command entry data segments. */ + for( cnt = 0; cnt < 2 && seg_cnt; cnt++, seg_cnt-- ) { + /* 4.10 64 bit */ + *dword_ptr++ = cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))); + *dword_ptr++ = cpu_to_le32(pci_dma_hi32(sg_dma_address(sg))); + *dword_ptr++ = cpu_to_le32(sg_dma_len(sg)); + sg++; + /* DEBUG(sprintf(debug_buff, + "S/G Segment phys_addr=%x %x, len=0x%x\n\r", + cpu_to_le32(pci_dma_hi32(sg_dma_address(sg))), + cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))), + cpu_to_le32(sg_dma_len(sg)));) + DEBUG(qla2100_print(debug_buff)); */ + } +#ifdef QL_DEBUG_LEVEL_5 + qla2100_print( + "qla2x00_64bit_start_scsi: Scatter/gather command packet data - "); + qla2100_print("b"); + qla2100_output_number((uint32_t)SCSI_BUS_32(cmd), 10); + qla2100_print("t"); + qla2100_output_number((uint32_t)SCSI_TCN_32(cmd), 10); + qla2100_print("d"); + qla2100_output_number((uint32_t)SCSI_LUN_32(cmd), 10); + qla2100_print("\n\r"); + qla2100_dump_buffer((caddr_t)pkt, REQUEST_ENTRY_SIZE); +#endif + /* + * Build continuation packets. + */ + while( seg_cnt > 0 ) { + /* Adjust ring index. */ + ha->req_ring_index++; + if( ha->req_ring_index == REQUEST_ENTRY_CNT ) { + ha->req_ring_index = 0; + ha->request_ring_ptr = ha->request_ring; + } else + ha->request_ring_ptr++; + + pkt = (cmd_a64_entry_t *)ha->request_ring_ptr; + + /* Zero out packet. */ + dword_ptr = (uint32_t *)pkt; + for( cnt = 0;cnt < REQUEST_ENTRY_SIZE/4; cnt++ ) + *dword_ptr++ = 0; + + /* Load packet defaults. */ + ((cont_a64_entry_t *)pkt)->entry_type = + CONTINUE_A64_TYPE; + ((cont_a64_entry_t *)pkt)->entry_count = 1; + ((cont_a64_entry_t *)pkt)->sys_define = (uint8_t) + ha->req_ring_index; + + /* Setup packet address segment pointer. */ + dword_ptr = (uint32_t *) + &((cont_a64_entry_t *)pkt)->dseg_0_address; + + /* Load continuation entry data segments. */ + for( cnt = 0; cnt < 5 && seg_cnt; cnt++, seg_cnt-- ) { + /* 4.10 64 bit */ + *dword_ptr++ = cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))); + *dword_ptr++ = cpu_to_le32(pci_dma_hi32(sg_dma_address(sg))); + *dword_ptr++ = cpu_to_le32(sg_dma_len(sg)); + sg++; + /* DEBUG(sprintf(debug_buff, + "S/G Segment Cont. phys_addr=%x %x, len=0x%x\n\r", + cpu_to_le32(pci_dma_hi32(sg_dma_address(sg))), + cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))), + cpu_to_le32(sg_dma_len(sg)));) + DEBUG(qla2100_print(debug_buff)); */ + } +#ifdef QL_DEBUG_LEVEL_5 + qla2100_print( + "qla2x00_64bit_start_scsi: continuation packet data - c"); + qla2100_print("b"); + qla2100_output_number((u_long)SCSI_BUS_32(cmd), 10); + + qla2100_print("t"); + qla2100_output_number((u_long)SCSI_TCN_32(cmd), 10); + qla2100_print("d"); + qla2100_output_number((u_long)SCSI_LUN_32(cmd), 10); + qla2100_print("\n\r"); + qla2100_dump_buffer((caddr_t)pkt, REQUEST_ENTRY_SIZE); +#endif + } + } else /* No scatter gather data transfer */ + { /* 4.10 64 bit */ + dma_handle = pci_map_single(ha->pdev, + cmd->request_buffer, + cmd->request_bufflen, + scsi_to_pci_dma_dir(cmd->sc_data_direction)); + /* save dma_handle for pci_unmap_single */ + sp->saved_dma_handle = dma_handle; + + *dword_ptr++ = cpu_to_le32(pci_dma_lo32(dma_handle)); + *dword_ptr++ = cpu_to_le32(pci_dma_hi32(dma_handle)); + *dword_ptr = (uint32_t) cmd->request_bufflen; + /* DEBUG(sprintf(debug_buff, + "64_bit: No S/G map_single saved_dma_handle=%lx len=%x \n\r",dma_handle, cmd->request_bufflen)); + DEBUG(qla2100_print(debug_buff)); */ +#ifdef QL_DEBUG_LEVEL_5 + qla2100_print( + "qla2x00_64bit_start_scsi: No scatter/gather command packet data - c"); + qla2100_print("b"); + qla2100_output_number((uint32_t)SCSI_BUS_32(cmd), 10); + qla2100_print("t"); + qla2100_output_number((uint32_t)SCSI_TCN_32(cmd), 10); + qla2100_print("d"); + qla2100_output_number((uint32_t)SCSI_LUN_32(cmd), 10); + qla2100_print("\n\r"); + qla2100_dump_buffer((caddr_t)pkt, REQUEST_ENTRY_SIZE); +#endif + } + } + else /* No data transfer */ + { + *dword_ptr++ = (uint32_t) 0; + *dword_ptr++ = (uint32_t) 0; + *dword_ptr = (uint32_t) 0; +#ifdef QL_DEBUG_LEVEL_5 + qla2100_print( + "qla2x00_64bit_start_scsi: No data, command packet data - c"); + qla2100_print("b"); + qla2100_output_number((u_long)SCSI_BUS_32(cmd), 10); + qla2100_print("t"); + qla2100_output_number((u_long)SCSI_TCN_32(cmd), 10); + qla2100_print("d"); + qla2100_output_number((u_long)SCSI_LUN_32(cmd), 10); + qla2100_print("\n\r"); + qla2x00_dump_buffer((caddr_t)pkt, REQUEST_ENTRY_SIZE); +#endif + } + DEBUG4(qla2100_print("\nqla2100_64bit_start_scsi: Wakeup RISC for pending command\n\r")); + /* Adjust ring index. */ + ha->req_ring_index++; + if( ha->req_ring_index == REQUEST_ENTRY_CNT ) { + ha->req_ring_index = 0; + ha->request_ring_ptr = ha->request_ring; + } else + ha->request_ring_ptr++; + + /* Set chip new ring index. */ +#if WATCH_THREADS_SIZE + DEBUG3(qla2100_output_number((uint32_t)ha->actthreads, 16)); +#endif + if (ha->device_id == QLA2300_DEVICE_ID) { + temp = CACHE_FLUSH(®2300->req_q_in); + WRT_REG_WORD(®2300->req_q_in, ha->req_ring_index); + } else { + temp = CACHE_FLUSH(®->mailbox4); + WRT_REG_WORD(®->mailbox4, ha->req_ring_index); + } + } else { + status = 1; +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2x00_64bit_start_scsi: NO ROOM IN OUTSTANDING ARRAY\n\r"); + qla2100_print(" req_q_cnt="); + qla2100_output_number((u_long)ha->req_q_cnt, 16); +#endif + } + } else { + status = 1; +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2x00_64bit_start_scsi: in-ptr="); + qla2100_output_number((u_long)ha->req_ring_index, 16); + qla2100_print(" req_q_cnt="); + qla2100_output_number((u_long)ha->req_q_cnt, 16); + qla2100_print(" req_cnt="); + qla2100_output_number((u_long)req_cnt, 16); + qla2100_print("\n\r"); +#endif + } + + /* Release ring specific lock */ + QLA2100_RING_UNLOCK(ha); + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2x00_64bit_start_scsi: **** FAILED ****\n\r"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + qla2100_print("qla2x00_64bit_start_scsi: exiting normally\n\r"); +#endif + return(status); +} +#endif + +/* +* qla2100_32bit_start_scsi +* The start SCSI is responsible for building request packets on +* request ring and modifying ISP input pointer. +* +* The Qlogic firmware interface allows every queue slot to have a SCSI +* command and up to 4 scatter/gather (SG) entries. If we need more +* than 4 SG entries, then continuation entries are used that can +* hold another 7 entries each. The start routine determines if there +* is eought empty slots then build the combination of requests to +* fulfill the OS request. +* +* Input: +* ha = adapter block pointer. +* sp = SCSI Request Block structure pointer. +* +* Returns: +* 0 = success, was able to issue command. +*/ +STATIC uint8_t +qla2100_32bit_start_scsi(scsi_qla_host_t *ha, srb_t *sp) { + device_reg_t *reg = ha->iobase; + device2300_reg_t *reg2300 = ha->iobase2300; + uint8_t status = 0; + Scsi_Cmnd *cmd = sp->cmd; + uint16_t cdb_len, temp; + uint32_t cnt; + cmd_entry_t *pkt; + uint16_t req_cnt; + uint16_t seg_cnt; + struct scatterlist *sg = (struct scatterlist *) NULL; + caddr_t data_ptr; + uint32_t *dword_ptr; + uint32_t timeout; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + uint64_t dma_handle; +#endif + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_32bit_start_scsi"); +#endif + +#if defined(QL_DEBUG_LEVEL_5) || defined(QL_DEBUG_LEVEL_3) + printk( + "32bit_start BEGIN: cmd=%x sp=%x CDB=%x\n\r", + cmd,sp,cmd->cmnd[0]); +#endif +#ifdef NEW + /* + * Send marker if required. + */ + if (ha->marker_needed != 0) { + if (qla2200_marker(ha, 0, 0, MK_SYNC_ALL) != 0) { + RING_UNLOCK(ha); + return (1); + } + } +#endif + COMTRACE('S') + /* Calculate number of entries and segments required. */ + seg_cnt = 0; + req_cnt = 1; + if( cmd->use_sg ) { + sg = (struct scatterlist *) cmd->request_buffer; + /* 4.10 32 bit S/G Data Transfer */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + seg_cnt = cmd->use_sg; +#else + seg_cnt = pci_map_sg(ha->pdev,sg,cmd->use_sg, + scsi_to_pci_dma_dir(cmd->sc_data_direction)); +#endif + /* + * if greater than four sg entries then we need to allocate + * continuation entries + */ + if( seg_cnt > 2 ) { + req_cnt += (uint16_t)(seg_cnt - 3) / 7; + if( (uint16_t)(seg_cnt - 3) % 7 ) + req_cnt++; + } + DEBUG5(sprintf(debug_buff, + "S/G for data transfer -num segs(%d), req blk cnt(%d)\n\r",seg_cnt,req_cnt)); + DEBUG5(qla2100_print(debug_buff)); + } else if( CMD_XFRLEN(cmd) ) /* If data transfer. */ + { /* no S/G Data Transfer */ + /* DEBUG5(printk("Single data transfer (0x%x)\n", + cmd->request_bufflen));*/ + seg_cnt = 1; + } + + /* Acquire ring specific lock */ + QLA2100_RING_LOCK(ha); + + if( (uint16_t)(req_cnt + 2) >= ha->req_q_cnt ) { + /* Calculate number of free request entries. */ + if (ha->device_id == QLA2300_DEVICE_ID) + cnt = qla2100_debounce_register(®2300->req_q_out); + else + cnt = qla2100_debounce_register(®->mailbox4); + + if( ha->req_ring_index < cnt ) + ha->req_q_cnt = cnt - ha->req_ring_index; + else + ha->req_q_cnt = REQUEST_ENTRY_CNT - (ha->req_ring_index - cnt); + } + + DEBUG5(sprintf(debug_buff, + "Number of free entries = (%d)\n\r",ha->req_q_cnt)); + DEBUG5(qla2100_print(debug_buff)); + /* If room for request in request ring. */ + if( (uint16_t)(req_cnt + 2) < ha->req_q_cnt ) { + /* Check for room in outstanding command list. */ + for( cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS && + (ha->outstanding_cmds[cnt] != 0); cnt++ ) + ; + + if( cnt < MAX_OUTSTANDING_COMMANDS ) { + ha->outstanding_cmds[cnt] = sp; + ha->req_q_cnt -= req_cnt; + /* save the handle -- helps if we want to abort it */ + CMD_HANDLE(sp->cmd) = (unsigned char *) (u_long) cnt; + + /* + * Build command packet. + */ + pkt = (cmd_entry_t *)ha->request_ring_ptr; + + pkt->entry_type = COMMAND_TYPE; + pkt->entry_count = (uint8_t)req_cnt; + pkt->sys_define = (uint8_t)ha->req_ring_index; + pkt->entry_status = 0; + pkt->control_flags= 0; + pkt->handle = (uint32_t)cnt; + + /* Zero out remaining portion of packet. */ + dword_ptr = (uint32_t *)pkt + 2; + for( cnt = 2; cnt < REQUEST_ENTRY_SIZE/4; cnt++ ) + *dword_ptr++ = 0; + + /* + * v2.19.8 + * We subtract 5 sec. from the timeout value to insure + * the ISP time-out before the mid-level or the driver. + */ + timeout = (uint32_t) CMD_TIMEOUT(cmd)/HZ; + if( timeout > 5 ) + pkt->timeout = (uint16_t) timeout - 5; + else + pkt->timeout = (uint16_t) timeout; + + /* Set device target ID and LUN */ + pkt->target = TGT_Q(ha, + SCSI_BUS_32(cmd), SCSI_TCN_32(cmd))->loop_id; + pkt->lun = SCSI_LUN_32(cmd); + + /* Enable simple tag queuing if device supports it. */ + if ( cmd->device->tagged_queue ) { + switch (cmd->tag) { + case SIMPLE_QUEUE_TAG: + pkt->control_flags = CF_SIMPLE_TAG; + break; + case HEAD_OF_QUEUE_TAG: + pkt->control_flags = CF_HEAD_TAG; + break; + case ORDERED_QUEUE_TAG: + pkt->control_flags = CF_ORDERED_TAG; + break; + default: + pkt->control_flags = CF_SIMPLE_TAG; + } + } else + pkt->control_flags = CF_SIMPLE_TAG; + + if (ha->device_id == QLA2300_DEVICE_ID) + pkt->control_flags |= CF_NO_FAST_POSTING; + + /* Load SCSI command packet. */ + cdb_len = (uint16_t)CMD_CDBLEN(cmd); + if( cdb_len > MAX_CMDSZ ) + cdb_len = MAX_CMDSZ; + data_ptr = (uint8_t *) &(CMD_CDBP(cmd)); + for( cnt = 0; cnt < cdb_len; cnt++ ) + pkt->scsi_cdb[cnt] = *data_ptr++; + DEBUG3(sprintf(debug_buff, + "qla2100: Packet has command[0]=0x%x, hndl=0x%x\n",pkt->scsi_cdb[0],pkt->handle);) + DEBUG3(qla2100_print(debug_buff);) + pkt->byte_count = (uint32_t) CMD_XFRLEN(cmd); + + /* + * Load data segments. + */ + if( seg_cnt ) { + /* Set transfer direction (READ and WRITE) */ + /* Linux doesn't tell us */ + + switch( cmd->data_cmnd[0] ) { + case FORMAT_UNIT: + case WRITE_6: + case MODE_SELECT: + case SEND_DIAGNOSTIC: + case WRITE_10: + case WRITE_BUFFER: + case WRITE_LONG: + case WRITE_SAME: + case MODE_SELECT_10: + case WRITE_12: + case WRITE_VERIFY_12: + case SEND_VOLUME_TAG: + pkt->control_flags |= BIT_6; /* WRITE */ + break; + default: +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) +#if QLA_SCSI_VENDOR_DIR + qla2100_set_vend_direction(ha, cmd, pkt); +#else + pkt->control_flags |= BIT_5; /* READ */ +#endif +#else /* kernel version is 2.4.0 or higher */ + if (cmd->sc_data_direction == SCSI_DATA_WRITE) + pkt->control_flags |= BIT_6;/*WRITE*/ + else + pkt->control_flags |= BIT_5;/*READ*/ +#endif /* kernel version 2.4.0 */ + break; + } + sp->dir = pkt->control_flags & (BIT_5|BIT_6); + + /* Set total data segment count. */ + pkt->dseg_count = seg_cnt; + + /* Setup packet address segment pointer. */ + dword_ptr = (uint32_t *)&pkt->dseg_0_address; + + if( cmd->use_sg ) /* If scatter gather */ + { + DEBUG5(qla2100_print("Building S/G data segments..\n\r")); + DEBUG5(qla2100_dump_buffer((caddr_t)sg, 4*16)); + /* Load command entry data segments. */ + for( cnt = 0; cnt < 3 && seg_cnt; cnt++, seg_cnt-- ) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + *dword_ptr++ = (uint32_t) cpu_to_le32(VIRT_TO_BUS(sg->address)); + *dword_ptr++ = sg->length; + /* DEBUG(sprintf(debug_buff, + "S/G Segment phys_addr=0x%x, len=0x%x\n\r", + cpu_to_le32(VIRT_TO_BUS(sg->address)),sg->length)); + DEBUG(qla2100_print(debug_buff)); */ +#else + *dword_ptr++ = cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))); + *dword_ptr++ = cpu_to_le32(sg_dma_len(sg)); + /* DEBUG(sprintf(debug_buff, + "S/G Segment phys_addr=0x%x, len=0x%x\n\r", + cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))), + cpu_to_le32(sg_dma_len(sg)));) + DEBUG(qla2100_print(debug_buff)); */ +#endif + sg++; + } +#ifdef QL_DEBUG_LEVEL_5 + qla2100_print( + "qla2100_32bit_start_scsi: Scatter/gather command packet data - "); + qla2100_output_number((u_long)ha->host_no, 10); + qla2100_print(":"); + qla2100_output_number((u_long)SCSI_BUS_32(cmd), 10); + qla2100_print(":"); + qla2100_output_number((u_long)SCSI_TCN_32(cmd), 10); + qla2100_print(":"); + qla2100_output_number((u_long)SCSI_LUN_32(cmd), 10); + qla2100_print("\n"); + qla2100_dump_buffer((uint8_t *)pkt, REQUEST_ENTRY_SIZE); +#endif + /* + * Build continuation packets. + */ + while( seg_cnt > 0 ) { + /* Adjust ring index. */ + ha->req_ring_index++; + if( ha->req_ring_index == REQUEST_ENTRY_CNT ) { + ha->req_ring_index = 0; + ha->request_ring_ptr = ha->request_ring; + } else + ha->request_ring_ptr++; + + pkt = (cmd_entry_t *)ha->request_ring_ptr; + + /* Zero out packet. */ + dword_ptr = (uint32_t *)pkt; + for( cnt = 0;cnt < REQUEST_ENTRY_SIZE/4; cnt++ ) + *dword_ptr++ = 0; + + /* Load packet defaults. */ + ((cont_entry_t *)pkt)->entry_type = CONTINUE_TYPE; + ((cont_entry_t *)pkt)->entry_count = 1; + ((cont_entry_t *)pkt)->sys_define = (uint8_t) + ha->req_ring_index; + + /* Setup packet address segment pointer. */ + dword_ptr = (uint32_t *) + &((cont_entry_t *)pkt)->dseg_0_address; + + /* Load continuation entry data segments. */ + for( cnt = 0; cnt < 7 && seg_cnt; cnt++, seg_cnt-- ) { + /* 4.10 32 bit */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + *dword_ptr++ = (u_int) cpu_to_le32(VIRT_TO_BUS(sg->address)); + *dword_ptr++ = sg->length; + /* DEBUG(sprintf(debug_buff, + "S/G Segment Cont. phys_addr=0x%x, len=0x%x\n\r", + cpu_to_le32(pci_dma_lo32(VIRT_TO_BUS(sg->address))),sg->length);) + DEBUG(qla2100_print(debug_buff)); */ +#else + *dword_ptr++ = cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))); + *dword_ptr++ = cpu_to_le32(sg_dma_len(sg)); + /* DEBUG(sprintf(debug_buff, + "S/G Segment Cont. phys_addr=0x%x, len=0x%x\n\r", + cpu_to_le32(pci_dma_lo32(sg_dma_address(sg))), + cpu_to_le32(sg_dma_len(sg)));) + DEBUG(qla2100_print(debug_buff)); */ +#endif + sg++; + } +#ifdef QL_DEBUG_LEVEL_5 + qla2100_print( + "qla2100_32bit_start_scsi: continuation packet data - "); + qla2100_output_number((u_long)ha->host_no, 10); + qla2100_print(":"); + qla2100_output_number((u_long)SCSI_BUS_32(cmd), 10); + qla2100_print(":"); + qla2100_output_number((u_long)SCSI_TCN_32(cmd), 10); + qla2100_print(":"); + qla2100_output_number((u_long)SCSI_LUN_32(cmd), 10); + qla2100_print("\n"); + qla2100_dump_buffer((uint8_t *)pkt, + REQUEST_ENTRY_SIZE); +#endif + } + } else /* No scatter gather data transfer */ + { + /* 4.10 32 bit */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + *dword_ptr++ = (uint32_t) cpu_to_le32(VIRT_TO_BUS(cmd->request_buffer)); + *dword_ptr = (uint32_t) cmd->request_bufflen; +#else + dma_handle = pci_map_single(ha->pdev, + cmd->request_buffer, + cmd->request_bufflen, + scsi_to_pci_dma_dir(cmd->sc_data_direction)); + sp->saved_dma_handle = dma_handle; + + *dword_ptr++ = cpu_to_le32(pci_dma_lo32(dma_handle)); + *dword_ptr = (uint32_t) cmd->request_bufflen; + /* DEBUG(sprintf(debug_buff, + "32_bit: No S/G map_single dma_handle=%lx len=%x\n\r",dma_handle,cmd->request_bufflen)); + DEBUG(qla2100_print(debug_buff)); */ +#endif + /* DEBUG5(printk("Single Segment ap=0x%x, len=0x%x\n",cmd->request_buffer,cmd->request_bufflen));*/ + +#ifdef QL_DEBUG_LEVEL_5 + qla2100_print("qla2100_32bit_start_scsi: No scatter/gather command packet data - "); + qla2100_output_number((u_long)ha->host_no, 10); + qla2100_print(":"); + qla2100_output_number((u_long)SCSI_BUS_32(cmd), 10); + qla2100_print(":"); + qla2100_output_number((u_long)SCSI_TCN_32(cmd), 10); + qla2100_print(":"); + qla2100_output_number((u_long)SCSI_LUN_32(cmd), 10); + qla2100_print("\n"); + qla2100_dump_buffer((uint8_t *)pkt, REQUEST_ENTRY_SIZE); +#endif + } + } + else /* No data transfer */ + { + *dword_ptr++ = (uint32_t) 0; + *dword_ptr = (uint32_t) 0; +#ifdef QL_DEBUG_LEVEL_5 + qla2100_print( + "qla2100_32bit_start_scsi: No data, command packet data - "); + qla2100_output_number((u_long)ha->host_no, 10); + qla2100_print(":"); + qla2100_output_number((u_long)SCSI_BUS_32(cmd), 10); + qla2100_print(":"); + qla2100_output_number((u_long)SCSI_TCN_32(cmd), 10); + qla2100_print(":"); + qla2100_output_number((u_long)SCSI_LUN_32(cmd), 10); + qla2100_print("\n"); + qla2100_dump_buffer((uint8_t *)pkt, REQUEST_ENTRY_SIZE); +#endif + } + /* Adjust ring index. */ + ha->req_ring_index++; + if( ha->req_ring_index == REQUEST_ENTRY_CNT ) { + ha->req_ring_index = 0; + ha->request_ring_ptr = ha->request_ring; + } else + ha->request_ring_ptr++; + + /* Set chip new ring index. */ + DEBUG4(qla2100_print("\nqla2100_32bit_start_scsi: Wakeup RISC for pending command\n\r")); + ha->qthreads--; + sp->flags |= SRB_SENT; + sp->state = 0xde; + ha->actthreads++; + + /* DEBUG(sprintf(debug_buff," Start(pid=%d) ",cmd->pid);) + DEBUG(qla2100_print(debug_buff);) */ + +#if WATCH_THREADS_SIZE + DEBUG3(qla2100_output_number((u_long)ha->actthreads, 16)); +#endif + if (ha->device_id == QLA2300_DEVICE_ID) { + temp = CACHE_FLUSH(®2300->req_q_in); + WRT_REG_WORD(®2300->req_q_in, ha->req_ring_index); + } else { + temp = CACHE_FLUSH(®->mailbox4); + WRT_REG_WORD(®->mailbox4, ha->req_ring_index); + } + } else { + status = 1; + qla2100_stats.outarray_full++; +#ifdef QL_DEBUG_LEVEL_8 + qla2100_print( + "qla2100_32bit_start_scsi: NO ROOM IN OUTSTANDING ARRAY\n"); +#endif + } + } else { + status = 1; +#ifdef QL_DEBUG_LEVEL_8 + qla2100_print("qla2100_32bit_start_scsi: in-ptr="); + qla2100_output_number((u_long)ha->req_ring_index, 16); + qla2100_print(" req_q_cnt="); + qla2100_output_number((u_long)ha->req_q_cnt, 16); + qla2100_print(" req_cnt="); + qla2100_output_number((u_long)req_cnt, 16); + qla2100_print("\n"); +#endif + } + + /* Release ring specific lock */ + QLA2100_RING_UNLOCK(ha); + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_32bit_start_scsi: **** FAILED ****\n"); +#ifdef QL_DEBUG_LEVEL_3 + else qla2100_print("qla2100_32bit_start_scsi: exiting normally\n\n\r"); +#endif +#endif +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_32bit_start_scsi"); +#endif + COMTRACE('s') + return(status); +} + +/* +* qla2100_ms_req_pkt +* Function is responsible for locking ring and +* getting a zeroed out Managment Server request packet. +* +* Input: +* ha = adapter block pointer. +* sp = srb_t pointer to handle post function call +* Returns: +* 0 = failed to get slot. +*/ +STATIC request_t * +qla2100_ms_req_pkt(scsi_qla_host_t *ha, srb_t *sp) { + device_reg_t *reg = ha->iobase; + device2300_reg_t *reg2300 = ha->iobase2300; + request_t *pkt = 0; + uint16_t cnt,i; + uint32_t *dword_ptr; + uint32_t timer; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_ms_req_pkt"); +#endif + + /* Wait for 30 seconds for slot. */ + for( timer = 3000000; timer; timer-- ) { + /* Acquire ring specific lock */ + QLA2100_RING_LOCK(ha); + + if( !ha->req_q_cnt ) { + /* Calculate number of free request entries. */ + if (ha->device_id == QLA2300_DEVICE_ID) cnt = qla2100_debounce_register(®2300->req_q_out); + else cnt = qla2100_debounce_register(®->mailbox4); + if( ha->req_ring_index < cnt ) + ha->req_q_cnt = cnt - ha->req_ring_index; + else + ha->req_q_cnt = REQUEST_ENTRY_CNT - (ha->req_ring_index - cnt); + } + + /* Check for room in outstanding command list. */ + for( cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS && + (ha->outstanding_cmds[cnt] != 0); cnt++ ) + ; + + if( (cnt < MAX_OUTSTANDING_COMMANDS) && + ( ha->req_q_cnt != 0 )) { + + pkt = ha->request_ring_ptr; + + /* Zero out packet. */ + dword_ptr = (uint32_t *)pkt; + for( i = 0; i < REQUEST_ENTRY_SIZE/4; i++ ) + *dword_ptr++ = 0; + + DEBUG(sprintf(debug_buff, + "qla2100_ms_req: putting sp=%x in outstanding_cmds[%x]\n",sp,cnt)); + DEBUG(qla2100_print(debug_buff)); + + ha->outstanding_cmds[cnt] = sp; + /* save the handle */ + CMD_HANDLE(sp->cmd) = (unsigned char *) (u_long) cnt; + + ha->req_q_cnt--; + pkt->handle = (uint32_t)cnt; + + /* Set system defined field. */ + pkt->sys_define = (uint8_t)ha->req_ring_index; + pkt->entry_status = 0; + + break; + } + + /* Release ring specific lock */ + QLA2100_RING_UNLOCK(ha); + + SYS_DELAY(2); + + /* Check for pending interrupts. */ + qla2100_poll(ha); + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( !pkt ) + qla2100_print("qla2100_ms_req_pkt: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_ms_req_pkt"); +#endif + return(pkt); +} + + +/* +* qla2100_req_pkt +* Function is responsible for locking ring and +* getting a zeroed out request packet. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = failed to get slot. +*/ +STATIC request_t * +qla2100_req_pkt(scsi_qla_host_t *ha) { + device_reg_t *reg = ha->iobase; + device2300_reg_t *reg2300 = ha->iobase2300; + request_t *pkt = 0; + uint16_t cnt; + uint32_t *dword_ptr; + uint32_t timer; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_req_pkt"); +#endif + + /* Wait for 30 seconds for slot. */ + for( timer = 3000000; timer; timer-- ) { + /* Acquire ring specific lock */ + QLA2100_RING_LOCK(ha); + + if( !ha->req_q_cnt ) { + /* Calculate number of free request entries. */ + if (ha->device_id == QLA2300_DEVICE_ID) cnt = qla2100_debounce_register(®2300->req_q_out); + else cnt = qla2100_debounce_register(®->mailbox4); + if( ha->req_ring_index < cnt ) + ha->req_q_cnt = cnt - ha->req_ring_index; + else + ha->req_q_cnt = REQUEST_ENTRY_CNT - (ha->req_ring_index - cnt); + } + + /* Found empty request ring slot? */ + if( ha->req_q_cnt ) { + ha->req_q_cnt--; + pkt = ha->request_ring_ptr; + + /* Zero out packet. */ + dword_ptr = (uint32_t *)pkt; + for( cnt = 0; cnt < REQUEST_ENTRY_SIZE/4; cnt++ ) + *dword_ptr++ = 0; + + /* Set system defined field. */ + pkt->sys_define = (uint8_t)ha->req_ring_index; + + /* Set entry count. */ + pkt->entry_count = 1; + + break; + } + + /* Release ring specific lock */ + QLA2100_RING_UNLOCK(ha); + + SYS_DELAY(2); /* 10 */ + + /* Check for pending interrupts. */ + qla2100_poll(ha); + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( !pkt ) + qla2100_print("qla2100_req_pkt: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_req_pkt"); +#endif + return(pkt); +} + +/* +* qla2100_isp_cmd +* Function is responsible for modifying ISP input pointer. +* Releases ring lock. +* +* Input: +* ha = adapter block pointer. +*/ +STATIC void +qla2100_isp_cmd(scsi_qla_host_t *ha) { + device_reg_t *reg = ha->iobase; + device2300_reg_t *reg2300 = ha->iobase2300; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_isp_cmd"); +#endif + +#ifdef QL_DEBUG_LEVEL_5 + qla2100_print("qla2100_isp_cmd: IOCB data:\n"); + qla2100_dump_buffer((uint8_t *)ha->request_ring_ptr, REQUEST_ENTRY_SIZE); +#endif + + /* Adjust ring index. */ + ha->req_ring_index++; + if( ha->req_ring_index == REQUEST_ENTRY_CNT ) { + ha->req_ring_index = 0; + ha->request_ring_ptr = ha->request_ring; + } else + ha->request_ring_ptr++; + + /* Set chip new ring index. */ + if (ha->device_id == QLA2300_DEVICE_ID) WRT_REG_WORD(®2300->req_q_in, ha->req_ring_index); + else WRT_REG_WORD(®->mailbox4, ha->req_ring_index); + + /* Release ring specific lock */ + QLA2100_RING_UNLOCK(ha); + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_isp_cmd"); +#endif +} + +/* +* qla2100_enable_lun +* Issue enable LUN entry IOCB. +* +* Input: +* ha = adapter block pointer. +*/ +STATIC void +qla2100_enable_lun(scsi_qla_host_t *ha) { + elun_entry_t *pkt; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_enable_lun"); +#endif + + /* Get request packet. */ + if( (pkt = (elun_entry_t *)qla2100_req_pkt(ha)) != NULL ) { + pkt->entry_type = ENABLE_LUN_TYPE; + pkt->command_count = 32; + pkt->immed_notify_count = 1; + pkt->timeout = 0xffff; + + /* Issue command to ISP */ + qla2100_isp_cmd(ha); + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( !pkt ) + qla2100_print("qla2100_enable_lun: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_enable_lun"); +#endif +} + + + +#if QL2100_TARGET_MODE_SUPPORT +/****************************************************************************/ +/* Target Mode Support Functions. */ +/****************************************************************************/ + + +/* +* qla2100_notify_ack +* Issue notify acknowledge IOCB. +* If sequence ID is zero, acknowledgement of +* SCSI bus reset or bus device reset is assumed. +* +* Input: +* ha = adapter block pointer. +* inotify = immediate notify entry pointer. +*/ +STATIC void +qla2100_notify_ack(scsi_qla_host_t *ha, notify_entry_t *inotify) { + nack_entry_t *pkt; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_notify_ack: entered\n"); +#endif + + /* Get request packet. */ + if( pkt = (nack_entry_t *)qla2100_req_pkt(ha) ) { + pkt->entry_type = NOTIFY_ACK_TYPE; + pkt->initiator_id = inotify->initiator_id; + pkt->target_id = inotify->target_id; + + if( (pkt->status = inotify->status) == 0xe ) + /* Reset LIP occurred. */ + pkt->flags = OF_RESET; + else + /* Increment Immediate Notify Resource Count. */ + pkt->flags = OF_INC_RC; + + pkt->task_flags = inotify->task_flags; + pkt->seq_id = inotify->seq_id; + + /* Issue command to ISP */ + qla2100_isp_cmd(ha); + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( !pkt ) + qla2100_print("qla2100_notify_ack: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_notify_ack: exiting normally\n"); +#endif +} + +/* +* qla2100_64bit_continue_io +* Issue continue target I/O IOCB. +* +* Input: +* ha = adapter block pointer. +* atio = atio pointer. +* len = total bytecount. +* addr = physical address pointer. +*/ +STATIC void +qla2100_64bit_continue_io(scsi_qla_host_t *ha, atio_entry_t *atio, uint32_t len, + u_long *addr) { + ctio_a64_entry_t *pkt; + uint32_t *dword_ptr; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_64bit_continue_io: entered\n"); +#endif + + /* Get request packet. */ + if( pkt = (ctio_a64_entry_t *)qla2100_req_pkt(ha) ) { + pkt->entry_type = CTIO_A64_TYPE; + pkt->initiator_id = atio->initiator_id; + pkt->exchange_id = atio->exchange_id; + pkt->flags = atio->flags | OF_FAST_POST; + pkt->scsi_status = atio->scsi_status; + + if( len ) { + pkt->dseg_count = 1; + pkt->transfer_length = len; + pkt->dseg_0_length = len; + dword_ptr = (uint32_t *)addr; + pkt->dseg_0_address[0] = *dword_ptr++; + pkt->dseg_0_address[1] = *dword_ptr; + } + + /* Issue command to ISP */ + qla2100_isp_cmd(ha); + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( !pkt ) + qla2100_print("qla2100_64bit_continue_io: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_64bit_continue_io: exiting normally\n"); +#endif +} + +/* +* qla2100_32bit_continue_io +* Issue continue target I/O IOCB. +* +* Input: +* ha = adapter block pointer. +* atio = atio pointer. +* len = total bytecount. +* addr = physical address pointer. +*/ +STATIC void +qla2100_32bit_continue_io(scsi_qla_host_t *ha, atio_entry_t *atio, uint32_t len, + u_long *addr) { + ctio_entry_t *pkt; + uint32_t *dword_ptr; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_continue_io: entered\n"); +#endif + + /* Get request packet. */ + if( pkt = (ctio_entry_t *)qla2100_req_pkt(ha) ) { + pkt->entry_type = CONTINUE_TGT_IO_TYPE; + pkt->initiator_id = atio->initiator_id; + pkt->exchange_id = atio->exchange_id; + pkt->flags = atio->flags | OF_FAST_POST; + pkt->scsi_status = atio->scsi_status; + + if( len ) { + pkt->dseg_count = 1; + pkt->transfer_length = len; + pkt->dseg_0_length = len; + dword_ptr = (uint32_t *)addr; + pkt->dseg_0_address = *dword_ptr; + } + + /* Issue command to ISP */ + qla2100_isp_cmd(ha); + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( !pkt ) + qla2100_print("qla2100_32bit_continue_io: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_32bit_continue_io: exiting normally\n"); +#endif +} +#endif /* QL2100_TARGET_MODE_SUPPORT */ + + + +/****************************************************************************/ +/* Interrupt Service Routine. */ +/****************************************************************************/ + +/* +* qla2100_isr +* Calls I/O done on command completion. +* +* Input: +* ha = adapter block pointer. +* done_q_first = done queue first pointer. +* done_q_last = done queue last pointer. +* INTR_LOCK must be already obtained. +*/ +STATIC void +qla2100_isr(scsi_qla_host_t *ha, srb_t **done_q_first, srb_t **done_q_last) { + device_reg_t *reg = ha->iobase; + device2300_reg_t *reg2300 = ha->iobase2300; + response_t *pkt, response_entry; + srb_t *sp; + uint16_t mailbox[MAILBOX_REGISTER_COUNT]; + uint16_t *wptr, status2 = 0; + uint32_t index, longstatus, *dptr1, *dptr2; + unsigned long cpu_flags = 0; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_isr"); +#endif + if (ha->device_id != QLA2300_DEVICE_ID) { + /* Check for 2100/2200 mailbox interrupt (semaphore set) */ + longstatus = RD_REG_WORD(®->semaphore); + if (longstatus & BIT_0) status2 = SEMAPHORE_SET; + } else { + /* Get 2300's Interrupt Status byte */ + longstatus = RD_REG_DWORD(®2300->host_status); +/*#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + DEBUG(qla2100_print("qla2100_isr: +++ 2300 RISC_TO_HOST reg= ");) + DEBUG(qla2100_output_number((u_long)longstatus, 16);) + DEBUG(qla2100_print(" +++ \n");) +#endif */ + switch(longstatus & 0xff) { + case 0x1: + case 0x2: + case 0x10: + case 0x11: + case 0x12: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + status2 = SEMAPHORE_SET; + break; + case 0x13: + default: + status2 = 0; + break; + } + } + + if ( status2 == SEMAPHORE_SET ) { + + /* Get mailbox data. */ + wptr = &mailbox[0]; + if (ha->device_id != QLA2300_DEVICE_ID) { + *wptr++ = qla2100_debounce_register(®->mailbox0); + *wptr++ = RD_REG_WORD(®->mailbox1); + *wptr = RD_REG_WORD(®->mailbox2); + } else { + *wptr++ = qla2100_debounce_register(®2300->mailbox0); + *wptr++ = RD_REG_WORD(®2300->mailbox1); + *wptr = RD_REG_WORD(®2300->mailbox2); + } + + WRT_REG_WORD(®->host_cmd, HC_CLR_RISC_INT); + +#if defined(QL_DEBUG_LEVEL_4) +DEBUG(qla2100_print("qla2100_isr: SEMAPHORE SET Processing, mailbox[0]=");) +DEBUG(qla2100_output_number((u_long)mailbox[0], 16);) +DEBUG(qla2100_print(" \n");) +DEBUG(qla2100_print("qla2100_isr: mailbox[1]=");) +DEBUG(qla2100_output_number((u_long)mailbox[1], 16);) +DEBUG(qla2100_print(" \n");) +DEBUG(qla2100_print("qla2100_isr: mailbox[2]=");) +DEBUG(qla2100_output_number((u_long)mailbox[2], 16);) +DEBUG(qla2100_print(" \n");) +DEBUG(qla2100_print("qla2100_isr: mailbox[3]=");) +DEBUG(qla2100_output_number((u_long)mailbox[3], 16);) +DEBUG(qla2100_print(" \n");) +#endif + +#ifdef FC_IP_SUPPORT /*******************************************/ + /* Handle IP send fast post */ + if (mailbox[0] == MBA_IP_TRANSMIT_COMPLETE) { + SEND_CB *pSendCB; + + /* Clear the semaphore lock , if it was set */ + if (RD_REG_WORD(®->semaphore) & BIT_0) + WRT_REG_WORD(®->semaphore, 0); + + /* Validate cmd handle and get packet pointer */ + if (mailbox[1] < MAX_SEND_PACKETS) { + if ((pSendCB = (SEND_CB *)ha->apActiveIpQueue[mailbox[1]]) != NULL) { + ha->apActiveIpQueue[mailbox[1]] = NULL; + + /* Complete backdoor command */ + (*ha->pSendCompletionRoutine)(pSendCB); + + return; + } + } + + /* Invalid handle from RISC, reset RISC firmware */ + printk(KERN_WARNING "qla2100_isr: bad IP send fast post handle %x\n", + mailbox[1]); + ha->flags.isp_abort_needed = TRUE; + return; + } + + /* Handle IP receive fast post */ + else if (mailbox[0] == MBA_IP_RECEIVE_COMPLETE || + mailbox[0] == MBA_IP_RECEIVE_COMPLETE_SPLIT) { + PBUFFER_CB pBufferCB, pNextBufferCB; + uint32_t lTagVal; + uint32_t lPacketSize; + uint32_t lReceiveBufferSize; + volatile uint16_t *pNextMailbox; + uint16_t wBufferCount; + + pNextMailbox = ®->mailbox10; + + /* If split buffer, set header size for 1st buffer */ + if (mailbox[0] == MBA_IP_RECEIVE_COMPLETE_SPLIT) + lReceiveBufferSize = ha->wHeaderSize; + else + lReceiveBufferSize = ha->lReceiveBufferSize; + + if ((lTagVal = RD_REG_WORD(pNextMailbox)) >= ha->wReceiveBufferCount) { + goto InvalidIpBufferHandle; + } + + pBufferCB = &ha->pReceiveBufferCBs[lTagVal]; + + if (!(pBufferCB->lFlags & BCB_FLAGS_RISC_OWNS_BUFFER)) { + goto InvalidIpBufferHandle; + } + + /* Set buffer belongs to driver now */ + pBufferCB->lFlags &= ~BCB_FLAGS_RISC_OWNS_BUFFER; + + lPacketSize = RD_REG_WORD(®->mailbox3); + pBufferCB->lPacketSize = lPacketSize; + pNextBufferCB = pBufferCB; + + for (wBufferCount = 1; ; wBufferCount++) { + if (lPacketSize > lReceiveBufferSize) { + pNextBufferCB->lBufferSize = lReceiveBufferSize; + lPacketSize -= lReceiveBufferSize; + + /* If split buffer, only use header size on 1st buffer */ + lReceiveBufferSize = ha->lReceiveBufferSize; + + pNextMailbox++; + if ((lTagVal = RD_REG_WORD(pNextMailbox)) >= + ha->wReceiveBufferCount) { + InvalidIpBufferHandle: + printk(KERN_WARNING "qla2100_isr: bad IP receive fast post handle %x\n", + lTagVal); + ha->flags.isp_abort_needed = TRUE; + return; + } + + pNextBufferCB->pNextBufferCB = &ha->pReceiveBufferCBs[lTagVal]; + pNextBufferCB = pNextBufferCB->pNextBufferCB; + + if (!(pNextBufferCB->lFlags & BCB_FLAGS_RISC_OWNS_BUFFER)) { + goto InvalidIpBufferHandle; + } + + /* Set buffer belongs to driver now */ + pNextBufferCB->lFlags &= ~BCB_FLAGS_RISC_OWNS_BUFFER; + } else { + pNextBufferCB->lBufferSize = lPacketSize; + pNextBufferCB->pNextBufferCB = NULL; + break; + } + } + + /* Clear the semaphore lock , if it was set */ + if (RD_REG_WORD(®->semaphore) & BIT_0) + WRT_REG_WORD(®->semaphore, 0); + + /* Pass received packet to IP driver */ + pBufferCB->wBufferCount = wBufferCount; + + (*ha->pReturnReceivePacketsRoutine) + (ha->pReturnReceivePacketsContext, + pBufferCB); + + /* Keep track of RISC buffer pointer (for IP reinit) */ + ha->wIpBufferOut += wBufferCount; + if (ha->wIpBufferOut >= IP_BUFFER_QUEUE_DEPTH) + ha->wIpBufferOut -= IP_BUFFER_QUEUE_DEPTH; + + return; + } +#endif /* FC_IP_SUPPORT ****************************************8*/ + + if( mailbox[0] != MBA_SCSI_COMPLETION ) { +#ifdef QL_DEBUG_LEVEL_4 + qla2100_print("qla2100_isr: non MBA_SCSI_COMPLETION ; Saving mailbox data\n"); +#endif + wptr++; + if (ha->device_id != QLA2300_DEVICE_ID) { + *wptr++ = RD_REG_WORD(®->mailbox3); + *wptr++ = qla2100_debounce_register(®->mailbox4); + *wptr++ = qla2100_debounce_register(®->mailbox5); + *wptr++ = RD_REG_WORD(®->mailbox6); + *wptr = RD_REG_WORD(®->mailbox7); + } else { + *wptr++ = RD_REG_WORD(®2300->mailbox3); + *wptr++ = qla2100_debounce_register(®2300->mailbox4); + *wptr++ = qla2100_debounce_register(®2300->mailbox5); + *wptr++ = RD_REG_WORD(®2300->mailbox6); + *wptr = RD_REG_WORD(®2300->mailbox7); + } + } + + /* Clear the semaphore lock , if it was set */ + if (RD_REG_WORD(®->semaphore) & BIT_0) + WRT_REG_WORD(®->semaphore, 0); + +#ifdef QL_DEBUG_LEVEL_4 + qla2100_print("qla2100_isr: +++ mailbox interrupt mailbox[0] = "); + qla2100_output_number((u_long)mailbox[0], 16); + qla2100_print("+++ \n"); + #endif + /* Handle asynchronous (0x80xx) and + mailbox command completion (0x400x) events */ + switch( mailbox[0] ) { + case MBA_SCSI_COMPLETION: /* 0x8020 */ + if( ha->flags.online ) { + /* Get outstanding command index. */ + index = (uint32_t)(mailbox[2] << 16 | mailbox[1]); + /* Validate handle. */ + if( index < MAX_OUTSTANDING_COMMANDS ) { + sp = ha->outstanding_cmds[index]; + } else + sp = 0; + + if( sp ) { + /* Free outstanding command slot. */ + ha->outstanding_cmds[index] = 0; + + /* Save ISP completion status */ + CMD_RESULT(sp->cmd) = DID_OK; + sp->flags &= ~SRB_SENT; + /* v2.19.5b2 Reset port down retry on success. */ + sp->port_down_retry_count = ha->port_down_retry_count; + + QLA2100_TIMER_LOCK(ha); + ha->actthreads--; + /* Place block on done queue */ + qla2100_stats.done_q_cnt++; + DEBUG(sp->state = 3;) + + sp->s_next = NULL; + sp->s_prev = *done_q_last; + if( !(*done_q_first) ) + *done_q_first = sp; + else + (*done_q_last)->s_next = sp; + *done_q_last = sp; + QLA2100_TIMER_UNLOCK(ha); + } else { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_isr: ISP invalid handle\n"); +#endif + ha->flags.isp_abort_needed = TRUE; + } + } + break; + case MBA_RESET: /* Reset 0x8001*/ +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_isr: asynchronous RESET\n"); +#endif + ha->flags.reset_marker = TRUE; + break; + case MBA_SYSTEM_ERR: /* System Error 0x8002 */ +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_isr: ISP System Error - mbx1="); + qla2100_output_number((u_long)mailbox[1], 16); + qla2100_print(", mbx2="); + qla2100_output_number((u_long)mailbox[2], 16); + qla2100_print(", mbx3="); + qla2100_output_number((u_long)mailbox[3], 16); + qla2100_print("\n"); +#endif + printk(KERN_WARNING + "!qla2100_isr: ISP System Error - mbx1=%xh, mbx2=%xh, mbx3=%xh", + mailbox[1], mailbox[2], mailbox[3]); + ha->flags.isp_abort_needed = TRUE; + break; + case MBA_REQ_TRANSFER_ERR: /* Request Transfer Error */ +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_isr: ISP Request Transfer Error\n"); +#endif + printk(KERN_WARNING "qla2100: ISP Request Transfer Error\n"); + ha->flags.isp_abort_needed = TRUE; + break; + case MBA_RSP_TRANSFER_ERR: /* Response Transfer Error */ +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_isr: ISP Response Transfer Error\n"); +#endif + printk(KERN_WARNING "qla2100: ISP Response Transfer Error\n"); + ha->flags.isp_abort_needed = TRUE; + break; + case MBA_WAKEUP_THRES: /* Request Queue Wake-up */ +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_isr: asynchronous WAKEUP_THRES\n"); +#endif + break; + case MBA_LIP_OCCURRED: /* Loop Initialization Procedure */ + if(!qla2100_quiet) printk(KERN_INFO "scsi(%d): LIP occurred.\n",(int)ha->host_no); + DEBUG(sprintf(debug_buff,"\n\nscsi(%d): LIP occurred.\n",(int)ha->host_no);) + DEBUG(qla2100_print(debug_buff)); +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2100_isr: asynchronous MBA_LIP_OCCURRED\n"); +#endif + ha->dpc_flags = ha->dpc_flags | COMMAND_WAIT_NEEDED; + /* Save LIP sequence. */ + ha->lip_seq = mailbox[1]; + if( ha->loop_state != LOOP_DOWN ) { + ha->loop_state = LOOP_DOWN; + ha->loop_down_timer = LOOP_DOWN_TIME; + } + ha->lip_count++; + break; + case MBA_LOOP_UP: + printk(KERN_INFO "scsi(%d): LOOP UP detected\n",(int)ha->host_no); +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_isr: asynchronous MBA_LOOP_UP\n"); +#endif + ha->loop_state = LOOP_UP; + break; + case MBA_LOOP_DOWN: + printk(KERN_INFO "scsi(%d): LOOP DOWN detected\n",(int)ha->host_no); +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_isr: asynchronous MBA_LOOP_DOWN\n"); +#endif + ha->dpc_flags = ha->dpc_flags | COMMAND_WAIT_NEEDED; + if( ha->loop_state != LOOP_DOWN ) { + ha->loop_state = LOOP_DOWN; + ha->loop_down_timer = LOOP_DOWN_TIME; + } + break; + case MBA_LIP_RESET: /* LIP reset occurred. */ + if(!qla2100_quiet) printk(KERN_INFO "scsi(%d): LIP reset occurred\n",(int)ha->host_no); +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2100_isr: asynchronous MBA_LIP_RESET\n"); +#endif + ha->dpc_flags = ha->dpc_flags | COMMAND_WAIT_NEEDED; + ha->flags.reset_marker = TRUE; + ha->loop_down_timer = LOOP_DOWN_TIME; + ha->loop_state = LOOP_DOWN; + ha->operating_mode = LOOP; + break; + case MBA_LINK_MODE_UP: /* Link mode up. */ + DEBUG(printk(KERN_INFO "scsi(%d): Link node is up\n",(int)ha->host_no);) +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2100_isr: asynchronous MBA_LINK_MODE_UP\n"); +#endif + ha->dpc_flags = ha->dpc_flags | COMMAND_WAIT_NEEDED; + break; + case MBA_UPDATE_CONFIG: /* Update Configuration. */ + printk(KERN_INFO "scsi(%d): Configuration change detected: value %d.\n",(int)ha->host_no,mailbox[1]); +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2100_isr: asynchronous MBA_UPDATE_CONFIG\n"); +#endif + ha->flags.update_config_needed = 1; + ha->loop_state = LOOP_DOWN; /* dg - 03/30 */ + ha->flags.isp_abort_needed = TRUE; + break; + case MBA_PORT_UPDATE: /* Port database update occurred. */ + DEBUG(printk("scsi(%d): Port database changed\n",(int)ha->host_no);) +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2100_isr: asynchronous MBA_PORT_UPDATE\n"); +#endif + ha->loop_down_timer = 0; + ha->flags.loop_resync_needed = TRUE; + ha->loop_state = LOOP_UPDATE; + break; + case MBA_SCR_UPDATE: /* State Change Registration. */ +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2100_isr: asynchronous MBA_RSCR_UPDATE\n"); +#endif + mailbox[1] = RD_REG_WORD(®->mailbox1); + mailbox[2] = RD_REG_WORD(®->mailbox2); + + DEBUG(printk("scsi(%d): RSCN database changed - 0x%x,0x%x\n",(int)ha->host_no,mailbox[1],mailbox[2]);) +#ifdef RCSN + index = ha->rscn_in_ptr + 1; + if (index == MAX_RSCN_COUNT) + index = 0; + if (index != ha->rscn_out_ptr) { + ha->rscn_queue[ha->rscn_in_ptr].format = + MSB(mb[1]); + ha->rscn_queue[ha->rscn_in_ptr].d_id.b.domain = + LSB(mb[1]); + ha->rscn_queue[ha->rscn_in_ptr].d_id.b.area = + MSB(mb[2]); + ha->rscn_queue[ha->rscn_in_ptr].d_id.b.al_pa = + LSB(mb[2]); + ha->rscn_in_ptr = (uint8_t)index; + } else { + ha->device_flags |= RSCN_QUEUE_OVERFLOW; + } +#endif + ha->device_flags |= RSCN_UPDATE; + ha->loop_down_timer = 0; + ha->flags.loop_resync_needed = TRUE; + ha->loop_state = LOOP_UPDATE; + /* ha->dpc_flags = ha->dpc_flags | COMMAND_WAIT_NEEDED; */ + break; + case MBA_CTIO_COMPLETION: +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2100_isr: asynchronous MBA_CTIO_COMPLETION\n"); +#endif + break; + default: + if( mailbox[0] < MBA_ASYNC_EVENT /* 0x8000 */) { + wptr = &mailbox[0]; + ha->mailbox_out[0] = *wptr++; + ha->mailbox_out[1] = *wptr++; + ha->mailbox_out[2] = *wptr++; + ha->mailbox_out[3] = *wptr++; + ha->mailbox_out[4] = *wptr++; + ha->mailbox_out[5] = *wptr++; + ha->mailbox_out[6] = *wptr++; + ha->mailbox_out[7] = *wptr; + ha->flags.mbox_int = TRUE; +#ifdef QL_DEBUG_LEVEL_2 + if (mailbox[0] != 0x4000) { + qla2100_print("qla2100_isr: MBA Switch Default mailbox[0]= "); + qla2100_output_number(mailbox[0] , 16); + qla2100_print("\n"); + } +#endif +#ifdef QL_DEBUG_LEVEL_4 + qla2100_print("qla2100_isr: Setting flags.mbox_int=1 in Default mailbox[0]= "); + qla2100_output_number(mailbox[0] , 16); + qla2100_print("\n"); +#endif + } + break; + } /* switch */ + } else { /* not a SEMAPHORE Set Completion */ + if (ha->device_id != QLA2300_DEVICE_ID) + mailbox[5]=qla2100_debounce_register(®->mailbox5); + else + mailbox[5]=qla2100_debounce_register(®2300->rsp_q_in); + + WRT_REG_WORD(®->host_cmd, HC_CLR_RISC_INT); + /* + * Response Ring Update + */ + /* Clear mailbox busy flag for 2300s; + so we don't ignore its Respose Ring Updates + during send of mailbox command */ + if (ha->device_id == QLA2300_DEVICE_ID) + ha->flags.mbox_busy = FALSE; + + if( ha->flags.online && !(ha->flags.mbox_busy) ) { + if( mailbox[5] < RESPONSE_ENTRY_CNT ) { + while( ha->rsp_ring_index != mailbox[5] ) { + pkt = ha->response_ring_ptr; + +#ifdef QL_DEBUG_LEVEL_5 + qla2100_print("qla2100_isr: ha->rsp_ring_index = "); + qla2100_output_number((u_long)ha->rsp_ring_index, 16); + qla2100_print(" mailbox[5] = "); + qla2100_output_number((u_long)mailbox[5], 16); + qla2100_print("\n"); + qla2100_print("\nqla2100_isr: response packet data\n"); + qla2100_dump_buffer((uint8_t *)pkt, RESPONSE_ENTRY_SIZE); +#endif + +#ifdef FC_IP_SUPPORT /************************************************/ + /* Handle IP send completion */ + if (pkt->entry_type == ET_IP_COMMAND_64) { + uint32_t lTagVal; + SEND_CB *pSendCB; + + /* Set packet pointer from queue entry handle */ + if ((lTagVal = pkt->handle) < MAX_SEND_PACKETS) { + if ((pSendCB = (SEND_CB *)ha->apActiveIpQueue[lTagVal]) != NULL) { + ha->apActiveIpQueue[lTagVal] = NULL; + + /* Return send packet to IP driver */ + (*ha->pSendCompletionRoutine)(pSendCB); + } else { + /* Invalid handle from RISC, reset RISC firmware */ + printk(KERN_WARNING "qla2100_isr: bad IP send handle %x\n", lTagVal); + ha->flags.isp_abort_needed = TRUE; + } + } else { + /* Invalid handle from RISC, reset RISC firmware */ + printk(KERN_WARNING "qla2100_isr: bad IP send handle %x\n", lTagVal); + ha->flags.isp_abort_needed = TRUE; + } + + /* Adjust ring index. */ + ha->rsp_ring_index++; + if( ha->rsp_ring_index == RESPONSE_ENTRY_CNT ) { + ha->rsp_ring_index = 0; + ha->response_ring_ptr = ha->response_ring; + } else + ha->response_ring_ptr++; + if (ha->device_id != QLA2300_DEVICE_ID) + WRT_REG_WORD(®->mailbox5, ha->rsp_ring_index); + else + WRT_REG_WORD(®2300->rsp_q_out, ha->rsp_ring_index); + continue; + } + + /* Handle IP receive packet */ + else if (pkt->entry_type == ET_IP_RECEIVE) { + PIP_RECEIVE_ENTRY pIpReceiveEntry = (PIP_RECEIVE_ENTRY)pkt; + PBUFFER_CB pBufferCB, pNextBufferCB; + uint32_t lTagVal; + uint32_t lPacketSize; + uint16_t wBufferCount; + uint32_t lReceiveBufferSize; + + /* If split buffer, set header size for 1st buffer */ + if (pIpReceiveEntry->wCompletionStatus & IP_REC_STATUS_SPLIT_BUFFER) + lReceiveBufferSize = ha->wHeaderSize; + else + lReceiveBufferSize = ha->lReceiveBufferSize; + + if ((lTagVal = pIpReceiveEntry->waBufferHandle[0]) >= + ha->wReceiveBufferCount) { + /* Invalid handle from RISC, reset RISC firmware */ + printk(KERN_WARNING "qla2100_isr: bad IP buffer handle %x\n", lTagVal); + ha->flags.isp_abort_needed = TRUE; + goto InvalidIpHandle; + } + pBufferCB = &ha->pReceiveBufferCBs[lTagVal]; + + if (!(pBufferCB->lFlags & BCB_FLAGS_RISC_OWNS_BUFFER)) { + /* Invalid handle from RISC, reset RISC firmware */ + printk(KERN_WARNING "qla2100_isr: bad IP buffer handle %x\n", lTagVal); + ha->flags.isp_abort_needed = TRUE; + goto InvalidIpHandle; + } + + /* Set buffer belongs to driver now */ + pBufferCB->lFlags &= ~BCB_FLAGS_RISC_OWNS_BUFFER; + + lPacketSize = pIpReceiveEntry->wSequenseLength; + pBufferCB->lPacketSize = lPacketSize; + pNextBufferCB = pBufferCB; + + for (wBufferCount = 1; ; wBufferCount++) { + if (lPacketSize > lReceiveBufferSize) { + pNextBufferCB->lBufferSize = lReceiveBufferSize; + lPacketSize -= lReceiveBufferSize; + + /* If split buffer, only use header size on 1st buffer */ + lReceiveBufferSize = ha->lReceiveBufferSize; + + if ((lTagVal = pIpReceiveEntry->waBufferHandle[wBufferCount]) >= + ha->wReceiveBufferCount) { + /* Invalid handle from RISC, reset RISC firmware */ + printk(KERN_WARNING "qla2100_isr: bad IP buffer handle %x\n", lTagVal); + ha->flags.isp_abort_needed = TRUE; + goto InvalidIpHandle; + } + pNextBufferCB->pNextBufferCB = &ha->pReceiveBufferCBs[lTagVal];; + pNextBufferCB = pNextBufferCB->pNextBufferCB; + + if (!(pNextBufferCB->lFlags & BCB_FLAGS_RISC_OWNS_BUFFER)) { + /* Invalid handle from RISC, reset RISC firmware */ + printk(KERN_WARNING "qla2100_isr: bad IP buffer handle %x\n", lTagVal); + ha->flags.isp_abort_needed = TRUE; + goto InvalidIpHandle; + } + + /* Set buffer belongs to driver now */ + pNextBufferCB->lFlags &= ~BCB_FLAGS_RISC_OWNS_BUFFER; + } else { + pNextBufferCB->lBufferSize = lPacketSize; + pNextBufferCB->pNextBufferCB = NULL; + break; + } + } + + /* Check for incoming ARP packet with matching IP address */ + if (pIpReceiveEntry->wServiceClass == 0) { + PPACKET_HEADER pPacket = (PPACKET_HEADER)pBufferCB->pBuffer; + PIP_DEVICE_BLOCK pIpDevice; + uint8_t acPortId[3]; + + /* Scan list of IP devices to see if login needed */ + for (pIpDevice = ha->pIpDeviceTop; pIpDevice != NULL; + pIpDevice = pIpDevice->pNextIpDevice) { + if (*(uint16_t *)(&pIpDevice->acWorldWideName[2]) == + pPacket->sNetworkHeader.wSourceAddrHigh && + *(uint32_t *)(&pIpDevice->acWorldWideName[4]) == + pPacket->sNetworkHeader.lSourceAddrLow) { + /* Device already in IP list, skip login */ + goto SkipDeviceLogin; + } + } + + /* Device not in list, need to do login */ + acPortId[0] = pIpReceiveEntry->cS_IDHigh; + acPortId[1] = (uint8_t)(pIpReceiveEntry->wS_IDLow >> 8); + acPortId[2] = (uint8_t)pIpReceiveEntry->wS_IDLow; + + /* Make sure its not a local device */ + if (acPortId[0] == ha->port_id[0] && + acPortId[1] == ha->port_id[1]) { + goto SkipDeviceLogin; + } + + if (qla2x00_add_new_ip_device(ha, PUBLIC_LOOP_DEVICE, + acPortId, + (uint8_t *)&pPacket->sNetworkHeader.wSourceNAA, + TRUE) == QL_STATUS_FATAL_ERROR) { + /* Fatal error, reinitialize */ + ha->flags.isp_abort_needed = TRUE; + } + } + SkipDeviceLogin: + /* Pass received packet to IP driver */ + pBufferCB->wBufferCount = wBufferCount; + + (*ha->pReturnReceivePacketsRoutine) + (ha->pReturnReceivePacketsContext, + pBufferCB); + + /* Keep track of RISC buffer pointer (for IP reinit) */ + ha->wIpBufferOut += wBufferCount; + if (ha->wIpBufferOut >= IP_BUFFER_QUEUE_DEPTH) + ha->wIpBufferOut -= IP_BUFFER_QUEUE_DEPTH; + InvalidIpHandle: + /* Adjust ring index. */ + ha->rsp_ring_index++; + if( ha->rsp_ring_index == RESPONSE_ENTRY_CNT ) { + ha->rsp_ring_index = 0; + ha->response_ring_ptr = ha->response_ring; + } else + ha->response_ring_ptr++; + if (ha->device_id != QLA2300_DEVICE_ID) + WRT_REG_WORD(®->mailbox5, ha->rsp_ring_index); + else + WRT_REG_WORD(®2300->rsp_q_out, ha->rsp_ring_index); + continue; + } + + /* Handle IP FARP request */ + else if (pkt->entry_type == ET_IP_FARP_REQUEST) { + PIP_FARP_REQUEST_ENTRY pIpFarpRequestEntry; + uint8_t acPortId[3]; + uint8_t acPortName[8]; + + pIpFarpRequestEntry = (PIP_FARP_REQUEST_ENTRY)pkt; + acPortId[0] = pIpFarpRequestEntry->cRequesterPortIdHigh; + acPortId[1] = (uint8_t)(pIpFarpRequestEntry->wRequesterPortIdLow >> 8); + acPortId[2] = (uint8_t)pIpFarpRequestEntry->wRequesterPortIdLow; + acPortName[0] = pIpFarpRequestEntry->acRequesterPortName[7]; + acPortName[1] = pIpFarpRequestEntry->acRequesterPortName[6]; + acPortName[2] = pIpFarpRequestEntry->acRequesterPortName[5]; + acPortName[3] = pIpFarpRequestEntry->acRequesterPortName[4]; + acPortName[4] = pIpFarpRequestEntry->acRequesterPortName[3]; + acPortName[5] = pIpFarpRequestEntry->acRequesterPortName[2]; + acPortName[6] = pIpFarpRequestEntry->acRequesterPortName[1]; + acPortName[7] = pIpFarpRequestEntry->acRequesterPortName[0]; + + /* Login and add device to IP database */ + if (qla2x00_add_new_ip_device(ha, PUBLIC_LOOP_DEVICE, + acPortId, + acPortName, + TRUE) == QL_STATUS_FATAL_ERROR) { + /* Fatal error, reinitialize */ + ha->flags.isp_abort_needed = TRUE; + } + + /* Adjust ring index. */ + ha->rsp_ring_index++; + if( ha->rsp_ring_index == RESPONSE_ENTRY_CNT ) { + ha->rsp_ring_index = 0; + ha->response_ring_ptr = ha->response_ring; + } else + ha->response_ring_ptr++; + if (ha->device_id != QLA2300_DEVICE_ID) + WRT_REG_WORD(®->mailbox5, ha->rsp_ring_index); + else + WRT_REG_WORD(®2300->rsp_q_out, ha->rsp_ring_index); + + continue; + } +#endif /* FC_IP_SUPPORT *******************************************/ + + if( pkt->entry_type == STATUS_TYPE || + pkt->entry_status ) { + ha->actthreads--; + if( pkt->entry_type == STATUS_TYPE ) { + qla2100_status_entry(ha, (sts_entry_t *)pkt, + done_q_first, done_q_last); + /* DEBUG(printk("qla2100_isr: RespRingUpdate STATUS TYPE\n");) */ + } else { + qla2100_error_entry(ha, pkt, + done_q_first, done_q_last); + /* DEBUG(printk("qla2100_isr: RespRingUpdate ERROR TYPE \n");)*/ + } + /* Adjust ring index. */ + ha->rsp_ring_index++; + if( ha->rsp_ring_index == RESPONSE_ENTRY_CNT ) { + ha->rsp_ring_index = 0; + ha->response_ring_ptr = ha->response_ring; + } else + ha->response_ring_ptr++; + if (ha->device_id != QLA2300_DEVICE_ID) + WRT_REG_WORD(®->mailbox5, ha->rsp_ring_index); + else + WRT_REG_WORD(®2300->rsp_q_out, ha->rsp_ring_index); + } else { + pkt = &response_entry; + + /* Copy packet. */ + dptr1 = (uint32_t *)ha->response_ring_ptr; + dptr2 = (uint32_t *)pkt; + for( index = 0; index < RESPONSE_ENTRY_SIZE/4; + index++ ) + *dptr2++ = *dptr1++; + + /* Adjust ring index. */ + ha->rsp_ring_index++; + if( ha->rsp_ring_index == RESPONSE_ENTRY_CNT ) { + ha->rsp_ring_index = 0; + ha->response_ring_ptr = ha->response_ring; + } else + ha->response_ring_ptr++; + if (ha->device_id != QLA2300_DEVICE_ID) + WRT_REG_WORD(®->mailbox5, ha->rsp_ring_index); + else + WRT_REG_WORD(®2300->rsp_q_out, ha->rsp_ring_index); + + /* Release interrupt specific lock */ + QLA2100_INTR_UNLOCK(ha); + +#if QLA2100_TARGET_MODE_SUPPORT + switch( pkt->entry_type ) { + case ACCEPT_TGT_IO_TYPE: + qla2100_atio_entry(ha, (atio_entry_t *)pkt); + break; + case IMMED_NOTIFY_TYPE: + qla2100_notify_ack(ha, (notify_entry_t *)pkt); + break; + default: + break; + } +#endif /**** FC_TARGET_MODE_SUPPORT */ + + /* Acquire interrupt specific lock */ + QLA2100_INTR_LOCK(ha); + } + } + } else { + ha->flags.isp_abort_needed = TRUE; +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_isr: $$$ Response Pointer Error $$$ mb5=\n"); + qla2100_output_number((u_long)mailbox[5], 16); + qla2100_print(" \n"); + printk(KERN_WARNING "qla2100_isr: [ERROR] Response pointer Error mailbox[5]=%x\n",mailbox[5]); +#endif + } + } + } + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_isr"); +#endif +} + + + +/* +* qla2100_rst_aen +* Processes asynchronous reset. +* +* Input: +* ha = adapter block pointer. +*/ +STATIC void +qla2100_rst_aen(scsi_qla_host_t *ha) { +#if QL2100_TARGET_MODE_SUPPORT + notify_entry_t nentry; +#endif /* QL2100_TARGET_MODE_SUPPORT */ + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_rst_aen"); +#endif + + if( ha->flags.online && !ha->flags.reset_active && + !ha->loop_down_timer && !ha->flags.abort_isp_active ) { + ha->flags.reset_active = TRUE; + do { + ha->flags.reset_marker = FALSE; + + /* Issue marker command. */ + qla2100_marker(ha, 0, 0, 0, MK_SYNC_ALL); + +#if QL2100_TARGET_MODE_SUPPORT + if( !ha->loop_down_timer && !ha->flags.reset_marker ) { + /* Issue notify acknowledgement command. */ + BZERO((caddr_t)&nentry, sizeof(notify_entry_t)); + nentry.initiator_id = ha->id; + /* dg 7/3/99 nentry.target_id = ha->id; */ + nentry.task_flags = BIT_13; + qla2100_notify_ack(ha, &nentry); + } +#endif /* QL2100_TARGET_MODE_SUPPORT */ + }while( !ha->loop_down_timer && ha->flags.reset_marker ); + ha->flags.reset_active = FALSE; + } + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_rst_aen"); +#endif +} + +#if QLA2100_TARGET_MODE_SUPPORT +/* +* qla2100_atio_entry +* Processes received ISP accept target I/O entry. +* +* Input: +* ha = adapter block pointer. +* pkt = entry pointer. +*/ +STATIC void +qla2100_atio_entry(scsi_qla_host_t *ha, atio_entry_t *pkt) { + uint64_t *a64; + uint64_t *end_a64; + u_long phy_addr[2]; + u_long end_addr[2]; + uint32_t len; + uint32_t offset; + uint8_t t; + uint8_t *sense_ptr; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_atio_entry: entered\n"); +#endif + + t = pkt->initiator_id; + sense_ptr = ha->tsense + t * TARGET_SENSE_SIZE; + a64 = (uint64_t *)&phy_addr[0]; + end_a64 = (uint64_t *)&end_addr[0]; + + switch( pkt->status & ~BIT_7 ) { + case 7: /* Path invalid */ +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + qla2100_print("qla2100_atio_entry: Path invalid\n"); +#endif + break; + case 0x16: /* Requested Capability Not Available */ +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + qla2100_print( + "qla2100_atio_entry: Requested Capability Not Available\n"); +#endif + break; + case 0x17: /* Bus Device Reset Message Received */ +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + qla2100_print( + "qla2100_atio_entry: Bus Device Reset Message Received\n"); +#endif + break; + case 0x3D: /* CDB Received */ + + /* Check for invalid LUN */ + if( pkt->lun && pkt->cdb[0] != SS_INQUIR && + pkt->cdb[0] != SS_REQSEN ) + pkt->cdb[0] = SS_TEST; + + switch( pkt->cdb[0] ) { + case SS_TEST: +#ifdef QL_DEBUG_LEVEL_3 + qla2100_print("qla2100_atio_entry: SS_TEST\n"); +#endif + BZERO(sense_ptr, TARGET_SENSE_SIZE); + len = 0; + if( pkt->lun == 0 ) + pkt->scsi_status = S_GOOD; + else { + *sense_ptr = 0x70; + *(sense_ptr+2) = SD_ILLREQ; + *(sense_ptr+7) = TARGET_SENSE_SIZE-8; + *(sense_ptr+12) = SC_INVLUN; + pkt->scsi_status = S_CKCON; + } + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | OF_NO_DATA); + break; + case SS_REQSEN: +#ifdef QL_DEBUG_LEVEL_3 + qla2100_print("qla2100_atio_entry: SS_REQSEN\n"); +#endif + phy_addr[0] = ha->tsense_dma; + phy_addr[1] = 0; + *a64 += t * TARGET_SENSE_SIZE; + if( pkt->cdb[4] > TARGET_SENSE_SIZE ) + len = TARGET_SENSE_SIZE; + else + len = pkt->cdb[4]; + pkt->scsi_status = S_GOOD; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | OF_DATA_IN); + break; + case SS_INQUIR: +#ifdef QL_DEBUG_LEVEL_3 + qla2100_print("qla2100_atio_entry: SS_INQUIR\n"); +#endif + BZERO(sense_ptr, TARGET_SENSE_SIZE); + phy_addr[0] = ha->tbuf_dma; + phy_addr[1] = 0; + *a64 += TARGET_INQ_OFFSET; + + if( pkt->lun == 0 ) { + ha->tbuf->inq.id_type = ID_PROCESOR; + ha->tbuf->inq.id_pqual = ID_QOK; + } else { + ha->tbuf->inq.id_type = ID_NODEV; + ha->tbuf->inq.id_pqual = ID_QNOLU; + } + + if( pkt->cdb[4] > sizeof(struct ident) ) + len = sizeof(struct ident); + else + len = pkt->cdb[4]; + pkt->scsi_status = S_GOOD; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | OF_DATA_IN); + break; + case SM_WRDB: + BZERO(sense_ptr, TARGET_SENSE_SIZE); + offset = pkt->cdb[5]; + offset |= pkt->cdb[4] << 8; + offset |= pkt->cdb[3] << 16; + len = pkt->cdb[8]; + len |= pkt->cdb[7] << 8; + len |= pkt->cdb[6] << 16; + end_addr[0] = phy_addr[0] = ha->tbuf_dma; + end_addr[1] = phy_addr[1] = 0; + *end_a64 += TARGET_DATA_OFFSET + TARGET_DATA_SIZE; + switch( pkt->cdb[1] & 7 ) { + case RW_BUF_HDATA: +#ifdef QL_DEBUG_LEVEL_3 + qla2100_print("qla2100_atio_entry: SM_WRDB, RW_BUF_HDATA\n"); +#endif + if( len > TARGET_DATA_SIZE + 4 ) { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_atio_entry: SM_WRDB, length > buffer size\n"); +#endif + *sense_ptr = 0x70; + *(sense_ptr+2) = SD_ILLREQ; + *(sense_ptr+7) = TARGET_SENSE_SIZE-8; + *(sense_ptr+12) = SC_ILLCDB; + pkt->scsi_status = S_CKCON; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | + OF_NO_DATA); + len = 0; + } else if( len ) { + pkt->scsi_status = S_GOOD; + pkt->flags =(uint16_t)(OF_SSTS | OF_INC_RC | + OF_DATA_OUT); + } else { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_atio_entry: SM_WRDB, zero length\n"); +#endif + pkt->scsi_status = S_GOOD; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | + OF_NO_DATA); + } + + break; + case RW_BUF_DATA: +#ifdef QL_DEBUG_LEVEL_3 + qla2100_print("qla2100_atio_entry: SM_WRDB, RW_BUF_DATA\n"); +#endif + *a64 += offset + TARGET_DATA_OFFSET; + if( pkt->cdb[2] != 0 || *a64 >= *end_a64 || + *a64 + len > *end_a64 ) { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_atio_entry: SM_WRDB, RW_BUF_DATA BAD\n"); + qla2100_print("buf_id="); + qla2100_output_number((u_long)pkt->cdb[2], 16); + qla2100_print(", offset="); + qla2100_output_number((u_long)offset, 16); + qla2100_print(", length="); + qla2100_output_number((u_long)len, 16); + qla2100_print("\n"); +#endif + *sense_ptr = 0x70; + *(sense_ptr+2) = SD_ILLREQ; + *(sense_ptr+7) = TARGET_SENSE_SIZE-8; + *(sense_ptr+12) = SC_ILLCDB; + len = 0; + pkt->scsi_status = S_CKCON; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | + OF_NO_DATA); + } else if( len ) { + pkt->scsi_status = S_GOOD; + pkt->flags =(uint16_t)(OF_SSTS | OF_INC_RC | + OF_DATA_OUT); + } else { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_atio_entry: SM_WRDB, zero length\n"); +#endif + pkt->scsi_status = S_GOOD; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | + OF_NO_DATA); + } + break; + default: +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_atio_entry: SM_WRDB unknown mode\n"); +#endif + *sense_ptr = 0x70; + *(sense_ptr+2) = SD_ILLREQ; + *(sense_ptr+7) = TARGET_SENSE_SIZE-8; + *(sense_ptr+12) = SC_ILLCDB; + len = 0; + pkt->scsi_status = S_CKCON; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | + OF_NO_DATA); + break; + } + break; + case SM_RDDB: + BZERO(sense_ptr, TARGET_SENSE_SIZE); + offset = pkt->cdb[5]; + offset |= pkt->cdb[4] << 8; + offset |= pkt->cdb[3] << 16; + len = pkt->cdb[8]; + len |= pkt->cdb[7] << 8; + len |= pkt->cdb[6] << 16; + end_addr[0] = phy_addr[0] = ha->tbuf_dma; + end_addr[1] = phy_addr[1] = 0; + *end_a64 += TARGET_DATA_OFFSET + TARGET_DATA_SIZE; + switch( pkt->cdb[1] & 7 ) { + case RW_BUF_HDATA: +#ifdef QL_DEBUG_LEVEL_3 + qla2100_print("qla2100_atio_entry: SM_RDDB, RW_BUF_HDATA\n"); +#endif + if( len ) { + ha->tbuf->hdr[0] = 0; + ha->tbuf->hdr[1] = + (uint8_t)(TARGET_DATA_SIZE >> 16); + ha->tbuf->hdr[2] = + (uint8_t)(TARGET_DATA_SIZE >> 8); + ha->tbuf->hdr[3] = (uint8_t)TARGET_DATA_SIZE; + if( len > TARGET_DATA_SIZE + 4 ) + len = TARGET_DATA_SIZE + 4; + pkt->scsi_status = S_GOOD; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | + OF_DATA_IN); + } else { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_atio_entry: SM_RDDB, zero length\n"); +#endif + pkt->scsi_status = S_GOOD; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | + OF_NO_DATA); + } + break; + case RW_BUF_DATA: +#ifdef QL_DEBUG_LEVEL_3 + qla2100_print("qla2100_atio_entry: SM_RDDB, RW_BUF_DATA\n"); +#endif + *a64 += offset + TARGET_DATA_OFFSET; + if( pkt->cdb[2] != 0 || *a64 >= *end_a64 ) { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_atio_entry: SM_RDDB, RW_BUF_DATA BAD\n"); + qla2100_print("buf_id="); + qla2100_output_number((u_long)pkt->cdb[2], 16); + qla2100_print(", offset="); + qla2100_output_number((u_long)offset, 16); + qla2100_print("\n"); +#endif + *sense_ptr = 0x70; + *(sense_ptr+2) = SD_ILLREQ; + *(sense_ptr+7) = TARGET_SENSE_SIZE-8; + *(sense_ptr+12) = SC_ILLCDB; + len = 0; + pkt->scsi_status = S_CKCON; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | + OF_NO_DATA); + } else { + if( *a64 + len > *end_a64 ) + len = *end_a64 - *a64; + if( len ) { + pkt->scsi_status = S_GOOD; + pkt->flags = (uint16_t)(OF_SSTS | + OF_INC_RC | OF_DATA_IN); + } else { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_atio_entry: SM_RDDB, zero length\n"); +#endif + pkt->scsi_status = S_GOOD; + pkt->flags = (uint16_t)(OF_SSTS | + OF_INC_RC | OF_NO_DATA); + } + } + break; + case RW_BUF_DESC: +#ifdef QL_DEBUG_LEVEL_3 + qla2100_print("qla2100_atio_entry: SM_RDDB, RW_BUF_DESC\n"); +#endif + if( len ) { + if( len > 4 ) + len = 4; + + ha->tbuf->hdr[0] = 0; + if( pkt->cdb[2] != 0 ) { + ha->tbuf->hdr[1] = 0; + ha->tbuf->hdr[2] = 0; + ha->tbuf->hdr[3] = 0; + } else { + ha->tbuf->hdr[1] = + (uint8_t)(TARGET_DATA_SIZE >> 16); + ha->tbuf->hdr[2] = + (uint8_t)(TARGET_DATA_SIZE >> 8); + ha->tbuf->hdr[3] = + (uint8_t)TARGET_DATA_SIZE; + } + pkt->scsi_status = S_GOOD; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | + OF_DATA_IN); + } else { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_atio_entry: SM_RDDB, zero length\n"); +#endif + pkt->scsi_status = S_GOOD; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | + OF_NO_DATA); + } + break; + default: +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_atio_entry: SM_RDDB unknown mode\n"); +#endif + *sense_ptr = 0x70; + *(sense_ptr+2) = SD_ILLREQ; + *(sense_ptr+7) = TARGET_SENSE_SIZE-8; + *(sense_ptr+12) = SC_ILLCDB; + len = 0; + pkt->scsi_status = S_CKCON; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | + OF_NO_DATA); + break; + } + break; + default: +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_atio_entry: Unknown SCSI command\n"); + qla2100_dump_buffer((uint8_t *)&pkt->cdb[0], MAX_CMDSZ); +#endif + BZERO(sense_ptr, TARGET_SENSE_SIZE); + *sense_ptr = 0x70; + *(sense_ptr+2) = SD_ILLREQ; + *(sense_ptr+7) = TARGET_SENSE_SIZE-8; + *(sense_ptr+12) = SC_INVOPCODE; + len = 0; + pkt->scsi_status = S_CKCON; + pkt->flags = (uint16_t)(OF_SSTS | OF_INC_RC | OF_NO_DATA); + break; + } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + if ( ha->flags.enable_64bit_addressing ) + qla2100_64bit_continue_io(ha, pkt, len, &phy_addr); + else +#endif + qla2100_32bit_continue_io(ha, pkt, len, &phy_addr); + break; + default: + break; + } + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_atio_entry: exiting normally\n"); +#endif +} +#endif /* QLA2100_TARGET_MODE_SUPPORT */ + +/* +* qla2100_status_entry +* Processes received ISP status entry. +* +* Input: +* ha = adapter block pointer. +* pkt = entry pointer. +* done_q_first = done queue first pointer. +* done_q_last = done queue last pointer. +*/ +STATIC void +qla2100_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt, srb_t **done_q_first, + srb_t **done_q_last) { + uint32_t b, t, l; + uint8_t sense_sz = 0; + srb_t *sp, *sp2; + scsi_lu_t *q; + Scsi_Cmnd *cp; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_status_entry"); +#endif + /* Validate handle. */ + if( pkt->handle < MAX_OUTSTANDING_COMMANDS ) + sp = ha->outstanding_cmds[pkt->handle]; + else + sp = 0; + + if( sp ) { + /* Free outstanding command slot. */ + ha->outstanding_cmds[pkt->handle] = 0; + cp = sp->cmd; + sp->ccode = pkt->comp_status; + sp->scode = pkt->scsi_status; + + sp->flags &= ~SRB_SENT; + /* Generate LU queue on cntrl, target, LUN */ + b = SCSI_BUS_32(cp); + t = SCSI_TCN_32(cp); + l = SCSI_LUN_32(cp); + q = GET_LU_Q(ha, b, t, l); + + /* Target busy */ + if( pkt->scsi_status & SS_BUSY_CONDITION && + (uint8_t)pkt->scsi_status != SS_RESERVE_CONFLICT ) { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_status_entry: SCSI busy status, scsi("); + qla2100_output_number((u_long)ha->host_no, 10); + qla2100_print(":"); + qla2100_output_number((u_long)b, 10); + qla2100_print(":"); + qla2100_output_number((u_long)t, 10); + qla2100_print(":"); + qla2100_output_number((u_long)l, 10); + qla2100_print(")\n"); +#endif + sp->retry_count--; + CMD_RESULT(cp) = (int) (DID_BUS_BUSY << 16) | + (pkt->scsi_status & 0xff); + + } +#if 0 + /* dg - 03/30 */ + else if( ha->loop_down_timer ) { +#endif + else if( ha->loop_down_timer || + ha->loop_state != LOOP_READY ) { +#ifdef QL_DEBUG_LEVEL_3 + qla2100_print("scsi("); + qla2100_output_number((u_long)ha->host_no, 10); + qla2100_print(":"); + qla2100_output_number((u_long)b, 10); + qla2100_print(":"); + qla2100_output_number((u_long)t, 10); + qla2100_print(":"); + qla2100_output_number((u_long)l, 10); + qla2100_print("): Loop Not ready - pid ="); + qla2100_output_number((u_long)sp->cmd->pid, 16); + qla2100_print("\n"); +#endif + CMD_RESULT(cp) = (int) (DID_BUS_BUSY << 16); + } else if( sp->port_down_retry_count > 1 && + (pkt->comp_status == CS_PORT_UNAVAILABLE || + pkt->comp_status == CS_PORT_LOGGED_OUT || + pkt->comp_status == CS_PORT_CONFIG_CHG || + pkt->comp_status == CS_PORT_BUSY) ) { + /* if the port is unavaliable and we haven't exceeded the port down count */ + /* then send command back to the mid-level. */ +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("scsi("); + qla2100_output_number((u_long)ha->host_no, 10); + qla2100_print(":"); + qla2100_output_number((u_long)b, 10); + qla2100_print(":"); + qla2100_output_number((u_long)t, 10); + qla2100_print(":"); + qla2100_output_number((u_long)l, 10); + qla2100_print("): Port Down Retry Cnt =("); + qla2100_output_number((u_long)sp->port_down_retry_count, 10); + qla2100_print("): , pid ="); + qla2100_output_number((u_long)sp->cmd->pid, 16); + qla2100_print(", status ="); + qla2100_output_number((u_long)pkt->comp_status, 16); + qla2100_print("\n"); +#endif + sp->port_down_retry_count--; + + /* dg 08/17/99 + * Force the SCSI layer to keep retrying until our + * port_down_retry_count expire. They will normally + * try and reset the bus after half the retries + * have completed, so double the count. + */ + CMD_RESULT(sp->cmd) = DID_BUS_BUSY << 16; + + /* Acquire target queue lock */ + if( !(q->q_flag & QLA2100_QSUSP) ) { + q->q_flag |= QLA2100_QSUSP; /* suspend starting new commands */ + + /* Decrement port down count on all pending commands. */ + /* and return them back to OS. */ + for( sp2 = q->q_first; sp2; sp2 = sp2->s_next ) { +#if 0 + if( sp2->port_down_retry_count ) /* dg - v4.31.4 */ + sp2->port_down_retry_count--; +#endif + /* v2.19.14 - unconditionally retry these + * requests. + */ + CMD_RESULT(sp2->cmd) = DID_BUS_BUSY << 16; + qla2100_callback(ha,sp2, TRUE); + } + q->q_first = q->q_last = NULL; + /* if port timer is not active then start it */ + if( !ha->queue_restart_timer ) { + ha->queue_restart_timer = PORT_RETRY_TIME; + } + if( TGT_Q(ha, b, t)->down_timer == 0 ) { + TGT_Q(ha, b, t)->down_timer = + ha->port_down_retry_count * PORT_RETRY_TIME; + } + } + + /* Release LU queue specific lock */ + } else { +#ifdef QL_DEBUG_LEVEL_2 + if( pkt->comp_status ) { + qla2100_print( + "qla2100_status_entry: Compl error = "); + qla2100_output_number((u_long)pkt->comp_status, 16); + qla2100_print(", scsi("); + qla2100_output_number((u_long)ha->host_no, 10); + qla2100_print(":"); + qla2100_output_number((u_long)b, 10); + qla2100_print(":"); + qla2100_output_number((u_long)t, 10); + qla2100_print(":"); + qla2100_output_number((u_long)l, 10); + qla2100_print("), retry count= "); + qla2100_output_number((u_long)sp->port_down_retry_count, 10); + qla2100_print(", pid = "); + qla2100_output_number((u_long)cp->pid, 16); + qla2100_print("\n"); + } +#endif + /* Set ISP completion status and target status byte. */ + CMD_RESULT(cp) = qla2100_return_status(ha, pkt, cp); + + memset((caddr_t)cp->sense_buffer, 0,sizeof(cp->sense_buffer)); + if( pkt->scsi_status & SS_CHECK_CONDITION ) { + /* Mid-level always zero sense buffer before giving it to us */ + if( pkt->scsi_status & SS_SENSE_LEN_VALID ) { + if( pkt->req_sense_length < CMD_SNSLEN(cp) ) + sense_sz = pkt->req_sense_length; + else + sense_sz = CMD_SNSLEN(cp) - 1; + + BCOPY((caddr_t)&pkt->req_sense_data, cp->sense_buffer, sense_sz); + + } + +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print( + "qla2100_status_entry: Check condition Sense data, scsi("); + qla2100_output_number((u_long)ha->host_no, 10); + qla2100_print(":"); + qla2100_output_number((u_long)b, 10); + qla2100_print(":"); + qla2100_output_number((u_long)t, 10); + qla2100_print(":"); + qla2100_output_number((u_long)l, 10); + qla2100_print(")\n"); + if( sense_sz ) + qla2100_dump_buffer(cp->sense_buffer, sense_sz); +#endif + } + } + /* Place command on done queue. */ + qla2100_done_q_put(ha, sp, done_q_first, done_q_last); + } else { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_status_entry: ISP Invalid handle\n"); +#endif + printk(KERN_WARNING "!qla2100: Status Entry invalid handle"); + ha->flags.isp_abort_needed = TRUE; + } +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_status_entry"); +#endif +} + +/* +* qla2100_error_entry +* Processes error entry. +* +* Input: +* ha = adapter block pointer. +* pkt = entry pointer. +* done_q_first = done queue first pointer. +* done_q_last = done queue last pointer. +*/ +STATIC void +qla2100_error_entry(scsi_qla_host_t *ha, response_t *pkt, srb_t **done_q_first, + srb_t **done_q_last) { + srb_t *sp; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_error_entry"); +#endif + +#ifdef QL_DEBUG_LEVEL_2 + if( pkt->entry_status & BIT_5 ) + qla2100_print("qla2100_error_entry: Invalid Entry Order\n"); + else if( pkt->entry_status & BIT_4 ) + qla2100_print("qla2100_error_entry: Invalid Entry Count\n"); + else if( pkt->entry_status & BIT_3 ) + qla2100_print("qla2100_error_entry: Invalid Entry Parameter\n"); + else if( pkt->entry_status & BIT_2 ) + qla2100_print("qla2100_error_entry: Invalid Entry Type\n"); + else if( pkt->entry_status & BIT_1 ) + qla2100_print("qla2100_error_entry: Busy\n"); + else + qla2100_print("qla2100_error_entry: UNKNOWN flag error\n"); +#endif + + /* Validate handle. */ + if( pkt->handle < MAX_OUTSTANDING_COMMANDS ) + sp = ha->outstanding_cmds[pkt->handle]; + else + sp = 0; + + if( sp ) { + /* Free outstanding command slot. */ + ha->outstanding_cmds[pkt->handle] = 0; + + sp->flags &= ~SRB_SENT; + /* Bad payload or header */ + if( pkt->entry_status & (BIT_5 + BIT_4 + BIT_3 + BIT_2) ) { + /* Bad payload or header, set error status. */ + CMD_RESULT(sp->cmd) = (int) DID_ERROR << 16; + + } else if( pkt->entry_status & BIT_1 && sp->retry_count ) /* FULL flag */ + { + sp->retry_count--; + CMD_RESULT(sp->cmd) = (int) DID_BUS_BUSY << 16; + } else { + /* Set error status. */ + CMD_RESULT(sp->cmd) =(int) DID_ERROR << 16; + } + /* Place command on done queue. */ + qla2100_done_q_put(ha, sp, done_q_first, done_q_last); + } else if( pkt->entry_type == COMMAND_A64_TYPE || + pkt->entry_type == COMMAND_TYPE ) { +#ifdef QL_DEBUG_LEVEL_2 + qla2100_print("qla2100_error_entry: ISP Invalid handle\n"); +#endif + printk(KERN_WARNING "!qla2100: Error Entry invalid handle"); + ha->flags.isp_abort_needed = TRUE; + } + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_error_entry"); +#endif +} + +/* +* qla2100_abort_isp +* Resets ISP and aborts all outstanding commands. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success +*/ +STATIC uint8_t +qla2100_abort_isp(scsi_qla_host_t *ha) { + uint16_t cnt; + srb_t *sp; + scsi_lu_t *q; + uint32_t b, t, l; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) + unsigned long cpu_flags = 0; +#endif + uint8_t status = 0; + + ENTER("qla2100_abort_isp"); + + DRIVER_LOCK + ha->flags.isp_abort_needed = FALSE; + if( !ha->flags.abort_isp_active && ha->flags.online ) { + ha->flags.abort_isp_active = TRUE; + ha->flags.online = FALSE; + ha->dpc_flags &= ~COMMAND_WAIT_NEEDED; + ha->dpc_flags &= ~COMMAND_WAIT_ACTIVE; + qla2100_stats.ispAbort++; + ha->isp_aborts++; + ha->sns_retry_cnt = 0; + printk(KERN_INFO + "qla2100: Performing ISP error recovery - ha= %p\n", + (void *) ha); + qla2100_reset_chip(ha); + + if( ha->loop_state != LOOP_DOWN ) { + ha->loop_state = LOOP_DOWN; + ha->loop_down_timer = LOOP_DOWN_TIME; + } + +#ifdef FC_IP_SUPPORT + /* Return all IP send packets */ + for (cnt = 0; cnt < MAX_SEND_PACKETS; cnt++) { + if (ha->apActiveIpQueue[cnt] != NULL) { + (*ha->pSendCompletionRoutine)(ha->apActiveIpQueue[cnt]); + + ha->apActiveIpQueue[cnt] = NULL; + } + } +#endif + + /* Requeue all commands in outstanding command list. */ + for( cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++ ) { + sp = ha->outstanding_cmds[cnt]; + if( sp ) { + ha->outstanding_cmds[cnt] = 0; + /* Generate LU queue on controller, target, LUN */ + b = SCSI_BUS_32(sp->cmd); + t = SCSI_TCN_32(sp->cmd); + l = SCSI_LUN_32(sp->cmd); + if ((q = (scsi_lu_t *)GET_LU_Q(ha, b, t, l))) { + /* Reset outstanding command count. */ + q->q_outcnt = 0; + q->q_flag &= ~QLA2100_QBUSY; + } + /* sp->flags &= ~(SRB_SENT | SRB_TIMEOUT); */ + sp->flags = 0; + /* we need to send the command back to OS */ + CMD_RESULT(sp->cmd) = DID_BUS_BUSY << 16; + CMD_HANDLE(sp->cmd) = (unsigned char *) NULL; + qla2100_done_q_put(ha, sp, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + } + } + + if( ha->device_id == QLA2100_DEVICE_ID ) + qla2100_nvram_config(ha); + else + qla2200_nvram_config(ha); + + /* v2.19.12 */ + ha->retry_count = ql2xretrycount; + if( !qla2100_configure_loop(ha, TRUE) ) { + ha->flags.reset_marker = FALSE; + + if( !ha->loop_down_timer ) + qla2100_marker(ha, 0, 0, 0, MK_SYNC_ALL); + + ha->flags.online = TRUE; + + /* Enable target response to SCSI bus. */ + if( ha->flags.enable_target_mode ) + qla2100_enable_lun(ha); + +#ifdef FC_IP_SUPPORT + /* Reenable IP support */ + if (ha->flags.enable_ip) + qla2x00_ip_initialize(ha); +#endif + /* Enable ISP interrupts. */ + qla2100_enable_intrs(ha); + + /* v2.19.5b6 Return all commands */ + qla2100_abort_queues(ha, TRUE); + + /* Restart queues that may have been stopped. */ + ha->flags.abort_isp_active = FALSE; + /* 6/9 if( !ha->loop_down_timer ) */ + qla2100_restart_queues(ha,TRUE); + } else { + printk(KERN_WARNING + "qla2100: ISP error recovery failed, board disabled"); + qla2100_reset_adapter(ha); + qla2100_abort_queues(ha, FALSE); + } + } + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_abort_isp: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_abort_isp"); +#endif + return(status); +} +/* +* qla2100_restart_watchdog_queue +* Restart device queues. +* +* Input: +* ha = adapter block pointer. +*/ +STATIC void +qla2100_restart_watchdog_queue(scsi_qla_host_t *ha) { + srb_t *sp, *sp_next; + + for( sp = ha->retry_q_first; (sp); sp = sp_next ) { + sp_next = sp->s_next; + /* when time expire return request back to OS as BUSY */ + qla2100_timeout_remove(ha, sp); + CMD_RESULT(sp->cmd) = DID_BUS_BUSY << 16; + CMD_HANDLE(sp->cmd) = (unsigned char *) NULL; + qla2100_done_q_put(ha, sp, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + } + +} + +/* +* qla2100_restart_queues +* Restart device queues. +* +* Input: +* ha = adapter block pointer. +*/ +STATIC void +qla2100_restart_queues(scsi_qla_host_t *ha, uint8_t flush) { + scsi_lu_t *q; + uint32_t b, t, l; + srb_t *sp, *sp_next; + srb_t *done_q_first = (srb_t *) NULL; + srb_t *done_q_last = (srb_t *) NULL; + int cnt; + unsigned long cpu_flags = 0; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_restart_queues"); +#endif + + ha->flags.restart_queues_needed = FALSE; + + /* + * start all queues working again. + */ + for( b = 0; b < MAX_BUSES; b++ ) + for( t = 0; t < ha->max_targets; t++ ) { + if( TGT_Q(ha, b, t) == NULL ) + continue; + for( l = 0; l < ha->max_luns; l++ ) { + q = (scsi_lu_t *) GET_LU_Q(ha, b, t, l); + if( q != NULL ) { + q->q_flag &= ~QLA2100_QSUSP; + if( q->q_first ) + qla2100_next(ha, q); + } + } + } + + /* + * Clear out our retry queue + */ + if( flush ) { + for( sp = ha->retry_q_first; (sp); sp = sp_next ) { + sp_next = sp->s_next; + /* when time expire return request back to OS as BUSY */ + qla2100_timeout_remove(ha, sp); + CMD_RESULT(sp->cmd) = DID_BUS_BUSY << 16; + CMD_HANDLE(sp->cmd) = (unsigned char *) NULL; + qla2100_done_q_put(ha, sp, (srb_t **)&done_q_first, (srb_t **)&done_q_last); + } + + /* Callback everything in done queue */ + cnt = 0; + while( done_q_first ) { + QLA2100_TIMER_LOCK(ha); + /* remove command from done list */ + sp = done_q_first; + if( !(done_q_first = sp->s_next) ) + done_q_last = NULL; + else + (done_q_first)->s_prev = NULL; + cnt++; + qla2100_stats.done_q_cnt--; + DEBUG(sp->state = 5;) + QLA2100_TIMER_UNLOCK(ha); + /* DEBUG(sprintf(debug_buff, + "qla2100_restart_queues: callback pid %d\n", + sp->cmd->pid);) + DEBUG(qla2100_print(debug_buff);) */ + qla2100_callback(ha,sp,FALSE); + } + DEBUG(sprintf(debug_buff,"qla2100_restart_queues: callback %d commands.\n",cnt);) + DEBUG(qla2100_print(debug_buff);) + } + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_restart_queues"); +#endif +} + +/* +* qla2100_abort_queues +* Abort all commands on device queues. +* +* Input: +* ha = adapter block pointer. +*/ +STATIC void +qla2100_abort_queues(scsi_qla_host_t *ha, uint8_t doneqflg) { + scsi_lu_t *q; + uint32_t b, t, l; + srb_t *sp, *sp_next; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_abort_queues"); +#endif + ha->flags.abort_queue_needed = FALSE; + + for( b = 0; b < MAX_BUSES; b++ ) + for( t = 0; t < ha->max_targets; t++ ) { + if( TGT_Q(ha, b, t) == NULL ) + continue; + for( l = 0; l < MAX_LUNS; l++ ) { + q = GET_LU_Q(ha, b, t, l); + if( q != NULL ) { + /* Try to acquire LU queue specific lock */ + /* if( queue is not busy ) + { */ + sp = q->q_first; + q->q_first = q->q_last = NULL; + + while( sp ) { + q->q_incnt--; + sp_next = sp->s_next; + CMD_RESULT(sp->cmd) = DID_BUS_BUSY << 16; + if ( doneqflg ) { + CMD_HANDLE(sp->cmd) = (unsigned char *) NULL; + qla2100_done_q_put(ha, sp, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); + } else + qla2100_callback(ha,sp,FALSE); + sp = sp_next; + } + /* } + else + ha->flags.abort_queue_needed = TRUE; + */ + } + } + } + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_abort_queues"); +#endif +} + +/* +* qla2100_update_config +* Restart RISC in order to update the connection mode. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success +*/ +uint8_t +qla2100_update_config(scsi_qla_host_t *ha) { + uint8_t status = 0; + +#ifdef QL_DEBUG_LEVEL_3 + qla2100_print("qla2100_update_config: entered\n"); +#endif + /* Turn-off flag, so we don't get called again */ + ha->flags.update_config_needed = FALSE; + + /* get the new topology */ + qla2100_configure_hba(ha); + + ha->init_cb->additional_firmware_options.connection_options = ha->operating_mode; + DEBUG(printk("qla2100_update_config: Setting new topology to %d\n" , ha->operating_mode);) + + qla2100_reset_chip(ha); + + if( ha->loop_state != LOOP_DOWN ) { + ha->loop_state = LOOP_DOWN; + ha->loop_down_timer = LOOP_DOWN_TIME; + } + + if( !(status = qla2100_configure_loop(ha, TRUE)) ) { + ha->flags.reset_marker = FALSE; + if( !ha->loop_down_timer ) + qla2100_marker(ha, 0, 0, 0, MK_SYNC_ALL); + + ha->flags.online = TRUE; + + /* Enable target response to SCSI bus. */ + if( ha->flags.enable_target_mode ) + qla2100_enable_lun(ha); + + } + + /* Enable ISP interrupts. */ + qla2100_enable_intrs(ha); + /* WRT_REG_WORD(®->ictrl, ISP_EN_INT + ISP_EN_RISC); */ +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_update_config: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + qla2100_print("qla2100_update_config: exiting normally\n"); +#endif + return(status); +} + +/* +* qla2100_loop_resync +* Resync with fibre channel devices. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success +*/ +STATIC uint8_t +qla2100_loop_resync(scsi_qla_host_t *ha) { + uint8_t status; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_loop_resync"); +#endif + + ha->loop_state = LOOP_UPDATE; + if( ha->flags.online && !ha->flags.loop_resync_active && + !ha->flags.abort_isp_active ) { + ha->flags.loop_resync_active = TRUE; + if( !(status = qla2100_fw_ready(ha)) ) { + do { + ha->flags.loop_resync_needed = FALSE; + /* v2.19.05b6 */ + ha->loop_state = LOOP_UPDATE; + + /* Issue marker command. */ + qla2100_marker(ha, 0, 0, 0, MK_SYNC_ALL); + + /* Remap devices on Loop. */ + qla2100_update_fc_db(ha, TRUE); + + }while( !ha->loop_down_timer && ha->flags.loop_resync_needed ); + } + ha->flags.loop_resync_active = FALSE; + /* v2.19 - we don't want to call this if we are already + * in the loop resync code + */ + qla2100_restart_queues(ha,TRUE); + } else + status = 0; + + /* Restart queues that may have been stopped. */ + /* 04/10 if( !ha->loop_down_timer ) { + qla2100_restart_queues(ha,TRUE); + } */ + /* v2.19 */ + /* deleted qla2100_restart_queues(ha,TRUE); */ + +#if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) + if( status ) + qla2100_print("qla2100_loop_resync: **** FAILED ****\n"); +#endif +#ifdef QL_DEBUG_LEVEL_3 + else + LEAVE("qla2100_loop_resync"); +#endif + return(status); +} + +/* +* qla2100_debounce_register +* Debounce register. +* +* Input: +* port = register address. +* +* Returns: +* register value. +*/ +STATIC uint16_t +qla2100_debounce_register(volatile uint16_t *addr) { + volatile uint16_t ret; + volatile uint16_t ret2; + + do { + ret = RD_REG_WORD(addr); + ret2 = RD_REG_WORD(addr); + }while( ret != ret2 ); + + return(ret); +} + +/* qla2100_cmd_wait +* Stall driver until all outstanding commands are returned. +* +* Input: +* ha = adapter state pointer. +* +* Return; +* 0 -- Done +* 1 -- continue; +* +* Context: +* Kernel context. +*/ +STATIC uint8_t +qla2100_cmd_wait(scsi_qla_host_t *ha) { + uint16_t index; + uint8_t stat = 1; + + ENTER("qla2200_cmd_wait: started\n"); + + /* Wait for all outstanding commands to be returned. */ + for (index = 1; index < MAX_OUTSTANDING_COMMANDS; index++) { + if (ha->outstanding_cmds[index] == NULL) + continue; + + /* if command not completed then wait for it */ + if (ha->flags.isp_abort_needed){ + stat = 0; + break; + } + + if( (ha->dpc_flags & COMMAND_WAIT_ACTIVE) && + ha->cmd_wait_cnt-- == 0 ) { + ha->flags.isp_abort_needed = TRUE; + DEBUG(printk("qla2200_cmd_wait: ISP abort %d\n",index);) + } else { + ha->cmd_wait_cnt = 30; + ha->dpc_flags |= COMMAND_WAIT_ACTIVE; + } + + DEBUG5( if( (ha->dpc_flags & COMMAND_WAIT_ACTIVE) ) ) + DEBUG5(printk("qla2200_cmd_wait: on handle %d - cnt %d\n",index,ha->cmd_wait_cnt);) + + } + + if (index == MAX_OUTSTANDING_COMMANDS || + ha->flags.isp_abort_needed) { + ha->dpc_flags &= ~COMMAND_WAIT_NEEDED; + ha->dpc_flags &= ~COMMAND_WAIT_ACTIVE; + stat = 0; + } + return( stat ); +} + +/* +* qla2100_reset_chip +* Reset ISP chip. +* +* Input: +* ha = adapter block pointer. +*/ +STATIC void +qla2100_reset_chip(scsi_qla_host_t *ha) { + uint32_t cnt; + device_reg_t *reg = ha->iobase; + +#ifdef QL_DEBUG_LEVEL_3 + ENTER("qla2100_reset_chip"); +#endif + + /* Disable ISP interrupts. */ + qla2100_disable_intrs(ha); + /* WRT_REG_WORD(®->ictrl, 0); */ + +#if 1 + /* Pause RISC. */ + WRT_REG_WORD(®->host_cmd, HC_PAUSE_RISC); + for (cnt = 0; cnt < 30000; cnt++) { + if ((RD_REG_WORD(®->host_cmd) & HC_RISC_PAUSE) != 0) + break; + else + udelay(100); + } + + /* Select FPM registers. */ + WRT_REG_WORD(®->ctrl_status, 0x20); + + /* FPM Soft Reset. */ + WRT_REG_WORD(®->fpm_diag_config, 0x100); + + /* Select frame buffer registers. */ + WRT_REG_WORD(®->ctrl_status, 0x10); + + /* Reset frame buffer FIFOs. */ + WRT_REG_WORD(®->fb_cmd, 0xa000); + + /* Select RISC module registers. */ + WRT_REG_WORD(®->ctrl_status, 0); + + /* Reset RISC module. */ + WRT_REG_WORD(®->host_cmd, HC_RESET_RISC); + + /* Reset ISP semaphore. */ + WRT_REG_WORD(®->semaphore, 0); + + /* Release RISC module. */ + WRT_REG_WORD(®->host_cmd, HC_RELEASE_RISC); + + /* Wait for RISC to recover from reset. */ + for (cnt = 0; cnt < 30000; cnt++) { + if (RD_REG_WORD(®->mailbox0) != MBS_BUSY) + break; + else + udelay(100); + } + + /* Disable RISC pause on FPM parity error. */ + WRT_REG_WORD(®->host_cmd, HC_DISABLE_PARITY_PAUSE); +#else + /* Insure mailbox registers are free. */ + WRT_REG_WORD(®->semaphore, 0); + WRT_REG_WORD(®->host_cmd, HC_CLR_RISC_INT); + WRT_REG_WORD(®->host_cmd, HC_CLR_HOST_INT); + + /* clear mailbox busy */ + ha->flags.mbox_busy = FALSE; + + /* Reset ISP chip. */ + WRT_REG_WORD(®->ctrl_status, ISP_RESET); + + /* + * Delay after reset, for chip to recover. + * Otherwise causes system PANIC + */ + mdelay(2); + + for( cnt = 30000; cnt; cnt-- ) { + if( !(RD_REG_WORD(®->ctrl_status) & ISP_RESET) ) + break; + udelay(100); + } + + /* Reset RISC processor. */ + WRT_REG_WORD(®->host_cmd, HC_RESET_RISC); + WRT_REG_WORD(®->host_cmd, HC_RELEASE_RISC); + for( cnt = 30000; cnt; cnt-- ) { + if( RD_REG_WORD(®->mailbox0) != MBS_BUSY ) + break; + udelay(100); + } +#endif + +#ifdef QL_DEBUG_LEVEL_3 + LEAVE("qla2100_reset_chip"); +#endif +} + + +#ifdef RCSN +/* +* qla2100_device_resync +* Marks devices in the database that needs resynchronization. +* +* Input: +* ha = adapter block pointer. +* +* Context: +* Kernel context. +*/ +STATIC void +qla2100_device_resync(scsi_qla_host_t *ha) { + uint16_t index; + uint32_t mask; + rscn_t dev; + port_id_t p; + + ENTERT("qla2100_device_resync:"); + while (ha->rscn_out_ptr != ha->rscn_in_ptr || + ha->device_flags & RSCN_QUEUE_OVERFLOW) { + INTR_LOCK(ha); + BCOPY(&ha->rscn_queue[ha->rscn_out_ptr], + &dev, sizeof (rscn_t)); + + ha->rscn_out_ptr++; + if (ha->rscn_out_ptr == MAX_RSCN_COUNT) + ha->rscn_out_ptr = 0; + + /* Queue overflow, set switch default case. */ + if (ha->device_flags & RSCN_QUEUE_OVERFLOW) { + dev.format = 3; + ha->device_flags = ha->device_flags & ~RSCN_QUEUE_OVERFLOW; + } + + switch (dev.format) { + case 0: + mask = 0xffffff; + break; + case 1: + mask = 0xffff00; + break; + case 2: + mask = 0xff0000; + break; + default: + mask = 0x0; + dev.d_id.b24 = 0; + ha->rscn_out_ptr = ha->rscn_in_ptr; + break; + } + INTR_UNLOCK(ha); + + for (index = 0; index < MAX_FIBRE_DEVICES; index++) { + p.b.b24 = dev.d_id.b24; + if (ha->fc_db[index].flags & DEV_PUBLIC && + ha->fc_db[index].port_id[2] == p.r.port_id[2] && + ha->fc_db[index].port_id[1] == p.r.port_id[1] && + ha->fc_db[index].port_id[0] == p.r.port_id[0] ) + if (ha->fc_db[index].loop_id <= SNS_LAST_LOOP_ID) + printk(KERN_INFO "qla2100_device_resync: %d:%d:%d\n", + ha->fc_db[index].port_id[2] , + ha->fc_db[index].port_id[1] , + ha->fc_db[index].port_id[0] ) + ha->fc_db[index].flags |= DEV_MISSING; + } + } + } + + LEAVE("qla2100_device_resync: exiting normally"); +} +#endif /* RCSN */ + +#ifdef GET_PORT_INFO + +/* +* qla2100_get_port_database +* Issue enhanced get port database mailbox command +* and copy device name as necessary. +* +* Input: +* ha = adapter state pointer. +* dev = structure pointer. +* opt = mailbox 1 option byte. +* +* Returns: +* qla2100 local function return status code. +* +* Context: +* Kernel context. +*/ +STATIC int +qla2100_get_port_database(scsi_qla_host_t *ha, fcdev_t *dev, uint8_t opt) { + int rval = 0; + port_database_t *pd; + u_long phys_address = 0; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + + ENTER("qla2200_get_port_database:"); +/* 4.10 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + pd = KMALLOC(PORT_DATABASE_SIZE); + if ( pd != NULL ) { + phys_address = VIRT_TO_BUS(pd); + BZERO((caddr_t)pd, PORT_DATABASE_SIZE); + } +#else + pd = pci_alloc_consistent(ha->pdev, + PORT_DATABASE_SIZE, + &phys_address); + BZERO((caddr_t)pd, PORT_DATABASE_SIZE); +#endif + if( pd == NULL ) { + return 2; + } + BZERO((caddr_t)pd, PORT_DATABASE_SIZE); + + mb[0] = MBC_GET_PORT_DATABASE; + mb[1] = dev->loop_id << 8 | opt; + mb[2] = MSW(phys_address); + mb[3] = LSW(phys_address); + mb[6] = 0; + mb[7] = 0; + if( !qla2100_mailbox_command(ha, + BIT_7|BIT_6|BIT_3|BIT_2|BIT_1|BIT_0, + &mb[0]) ) { + /* Get d_id of device. */ + /* + dev->d_id.b.al_pa = pd->port_id[2]; + dev->d_id.b.area = pd->port_id[3]; + dev->d_id.b.domain = pd->port_id[0]; + dev->d_id.b.rsvd_1 = 0; + */ + + /* Get initiator status of device. */ + pd->prli_svc_param_word_3[0] & BIT_5 ? + (dev->flags = dev->flags | DEV_INITIATOR) : + (dev->flags = dev->flags & ~DEV_INITIATOR); + } else { + printk(KERN_WARNING "qla2200_get_port_database: [ERROR] failed"); + rval = 1; + } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) + KMFREE(pd, PORT_DATABASE_SIZE); +#else + pci_free_consistent(ha->pdev, PORT_DATABASE_SIZE, + pd, phys_address); +#endif + LEAVE("qla2200_get_port_database:"); + + return (rval); +} +#endif + +/* +* qla2100_configure_loop +* Resync with fibre channel devices. +* +* Input: +* ha = adapter block pointer. +* +* Returns: +* 0 = success +*/ + +STATIC uint8_t qla2100_configure_loop(scsi_qla_host_t *ha, uint8_t reuse) { + uint8_t status = 0; + + /* If firmware needs to be loaded */ + if( qla2100_isp_firmware(ha) ) { + ha->flags.online = FALSE; + if( !(status = qla2100_chip_diag(ha)) ) + status = qla2100_setup_chip(ha); + } + + if( !status && !(status = qla2100_init_rings(ha)) ) { + if( !qla2100_fw_ready(ha) ) { + ha->flags.reset_marker = FALSE; + do { + ha->flags.loop_resync_needed = FALSE; + /* remap devices on loop */ + qla2100_update_fc_db(ha, reuse); + }while( !ha->loop_down_timer && ha->flags.loop_resync_needed ); + } + } + return(status); +} + +/* + * This routine will wait for fabric devices for + * the reset delay. + */ +void qla2100_check_fabric_devices(scsi_qla_host_t *ha) { + uint16_t mb[MAILBOX_REGISTER_COUNT]; + + mb[0] = MBC_GET_FIRMWARE_STATE; + qla2100_mailbox_command(ha, BIT_0, &mb[0]); +} + +#if QLA2100_EXT_TIMEOUT +/* +* qla2100_extend_timeout +* This routine will extend the timeout to the specified value. +* +* Input: +* cmd = SCSI command structure +* +* Returns: +* None. +*/ +static void qla2100_extend_timeout(Scsi_Cmnd *cmd, int timeout) { + del_timer(&cmd->eh_timeout); + cmd->eh_timeout.expires = jiffies + timeout; + add_timer(&cmd->eh_timeout); +} +#endif +/* +* qla2100_display_fc_names +* This routine will the node names of the different devices found +* after port inquiry. +* +* Input: +* cmd = SCSI command structure +* +* Returns: +* None. +*/ +STATIC void qla2100_display_fc_names(scsi_qla_host_t *ha) { + uint16_t index; + + /* Display the node name for adapter */ + printk(KERN_INFO + "scsi-qla%d-adapter-node=%02x%02x%02x%02x%02x%02x%02x%02x;\n", + (int)ha->instance, + ha->init_cb->node_name[0], + ha->init_cb->node_name[1], + ha->init_cb->node_name[2], + ha->init_cb->node_name[3], + ha->init_cb->node_name[4], + ha->init_cb->node_name[5], + ha->init_cb->node_name[6], + ha->init_cb->node_name[7]); + + /* display the port name for adapter */ + printk(KERN_INFO + "scsi-qla%d-adapter-port=%02x%02x%02x%02x%02x%02x%02x%02x;\n", + (int)ha->instance, + ha->init_cb->port_name[0], + ha->init_cb->port_name[1], + ha->init_cb->port_name[2], + ha->init_cb->port_name[3], + ha->init_cb->port_name[4], + ha->init_cb->port_name[5], + ha->init_cb->port_name[6], + ha->init_cb->port_name[7]); + + /* Print out device port names */ + for (index = 0; index < MAX_FIBRE_DEVICES; index++) { + if (ha->fc_db[index].loop_id == PORT_UNUSED || + ha->fc_db[index].loop_id == PORT_AVAILABLE ) + continue; + +#if USE_PORTNAME + printk(KERN_INFO + "scsi-qla%d-target-%d=%02x%02x%02x%02x%02x%02x%02x%02x;\n", + (int)ha->instance, index, + ha->fc_db[index].wwn[0], + ha->fc_db[index].wwn[1], + ha->fc_db[index].wwn[2], + ha->fc_db[index].wwn[3], + ha->fc_db[index].wwn[4], + ha->fc_db[index].wwn[5], + ha->fc_db[index].wwn[6], + ha->fc_db[index].wwn[7]); +#else + printk(KERN_INFO + "scsi-qla%d-target-%d=%02x%02x%02x%02x%02x%02x%02x%02x;\n", + (int)ha->instance, index, + ha->fc_db[index].name[0], + ha->fc_db[index].name[1], + ha->fc_db[index].name[2], + ha->fc_db[index].name[3], + ha->fc_db[index].name[4], + ha->fc_db[index].name[5], + ha->fc_db[index].name[6], + ha->fc_db[index].name[7]); +#endif + } +} + +/* +* qla2100_find_propname +* Get property in database. +* +* Input: +* ha = adapter structure pointer. +* db = pointer to database +* propstr = pointer to dest array for string +* propname = name of property to search for. +* +* Returns: +* 0 = no property +* value = index of property value. +* +* Context: +* Kernel context. +*/ +STATIC uint8_t +qla2100_find_propname(scsi_qla_host_t *ha, + char *propname, char *propstr, char *db) { + char *np, *cp; + int i,k,l; + + /* find the specified string */ + for( l=0, cp = db; (*cp) && l < strlen(db) ; cp = np, l++ ) { + np = qla2100_get_line(cp, propstr); + DEBUG5(printk("qla2100_find_propname: %d - Searching for {%s} in cmd substr: {%s}, next line: {%s} \n",l,propname,propstr, np);) + /* find the property name */ + k = strlen(propname); + for ( i = 0; (propstr[i]) && i < strlen(db); i++ ) { + if( BCMP(propname,&propstr[i],k) == 0) { + DEBUG5(printk("qla2100_find_propname: found at index = %d\n",i+k );) + return (i+k); /* match */ + } + } + } + return (0); +} + + + +/* +* qla2100_get_prop_16chars +* Get an 8-byte property value for the specified property name by +* converting from the property string found in the configuration file. +* The resulting converted value is in big endian format (MSB at byte0). +* +* Input: +* ha = adapter state pointer. +* propname = property name pointer. +* propval = pointer to location for the converted property val. +* db = pointer to database +* +* Returns: +* 0 = value returned successfully. +* +* Context: +* Kernel context. +*/ +static int +qla2100_get_prop_16chars(scsi_qla_host_t *ha, char *propname, + char *propval, char *db) { + char *propstr; + int i, k; + int rval; + uint8_t nval; + uint8_t *pchar; + uint8_t *ret_byte; + uint8_t *tmp_byte; + uint8_t *retval = (uint8_t*)propval; + uint8_t tmpval[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + uint16_t max_byte_cnt = 8; /* 16 chars = 8 bytes */ + uint16_t max_strlen = 16; + char buf[LINESIZE]; + + rval = qla2100_find_propname(ha, propname, buf, db); + if ( rval >= LINESIZE ) + rval = 0; + + propstr = &buf[rval]; + if ( *propstr == '=' ) + propstr++; /* ignore equal sign */ + + if (rval == 0 ) { + return (1); + } + + if (strlen(propstr) != max_strlen) { + printk(KERN_INFO + "qla2x00: Failed to find prop for %s - rval=%d, " + "strlen(propstr)=%d->(16), val=%s.\n", + propname, rval, (int)strlen(propstr),propstr); + return (1); + } + + /* Convert string to numbers. */ + + pchar = (uint8_t *)propstr; + tmp_byte = (uint8_t *)tmpval; + + rval = 0; + for (i = 0; i < max_strlen; i++) { + /* + * Check for invalid character, two at a time, + * then convert them starting with first byte. + */ + + if ((pchar[i] >= '0') && (pchar[i] <= '9')) { + nval = pchar[i] - '0'; + } else if ((pchar[i] >= 'A') && (pchar[i] <= 'F')) { + nval = pchar[i] - 'A' + 10; + } else if ((pchar[i] >= 'a') && (pchar[i] <= 'f')) { + nval = pchar[i] - 'a' + 10; + } else { + /* invalid character */ + rval = 1; + break; + } + + if (i & BIT_0) { + *tmp_byte = *tmp_byte | nval; + tmp_byte++; + } else { + *tmp_byte = *tmp_byte | nval << 4; + } + } + + if (rval != 0) { + /* Encountered invalid character. */ + return (rval); + } + + /* Copy over the converted value. */ + + ret_byte = retval; + tmp_byte = tmpval; + + i = max_byte_cnt; + k = 0; + while (i--) { + *ret_byte++ = *tmp_byte++; + } + + /* big endian retval[0]; */ + return (0); +} + +/* +* qla2100_get_properties +* Find all properties for the specified adapeter in +* command line. +* +* Input: +* ha = adapter block pointer. +* cmdline = pointer to command line string +* +* Context: +* Kernel context. +*/ +static void +qla2100_get_properties(scsi_qla_host_t *ha, char *cmdline) { + char propbuf[LINESIZE]; + int tmp_rval; + uint16_t tgt; + uint8_t tmp_name[8]; + + /* Adapter FC node names. */ + sprintf(propbuf, "scsi-qla%d-adapter-node", (int) ha->instance); + qla2100_get_prop_16chars (ha, propbuf, + (caddr_t)(&ha->init_cb->node_name), cmdline); + + sprintf(propbuf, "scsi-qla%d-adapter-port", (int) ha->instance); + + /* DG 04/07 check portname of adapter */ + qla2100_get_prop_16chars (ha, propbuf, + (caddr_t)(tmp_name), cmdline); + if (BCMP(&ha->init_cb->port_name[0], &tmp_name[0], 8) != 0) { + /* + * Adapter port name is WWN, and cannot be changed. + * Inform users of the mismatch, then just continue driver + * loading using the original adapter port name in NVRAM. + */ + printk(KERN_WARNING + "qla2x00: qla%ld found mismatch in adapter port names.\n", + ha->instance); + printk(KERN_INFO + " qla%ld port name found in NVRAM -> %02x%02x%02x%02x%02x%02x%02x%02x\n", + ha->instance, + ha->init_cb->port_name[0], + ha->init_cb->port_name[1], + ha->init_cb->port_name[2], + ha->init_cb->port_name[3], + ha->init_cb->port_name[4], + ha->init_cb->port_name[5], + ha->init_cb->port_name[6], + ha->init_cb->port_name[7]); + printk(KERN_INFO + " qla%ld port name found on command line -> %02x%02x%02x%02x%02x%02x%02x%02x\n", + ha->instance, + tmp_name[0], + tmp_name[1], + tmp_name[2], + tmp_name[3], + tmp_name[4], + tmp_name[5], + tmp_name[6], + tmp_name[7]); + printk(KERN_INFO + " Using port name from NVRAM.\n"); + } + + /* FC name for devices */ + for (tgt = 0; tgt < MAX_FIBRE_DEVICES; tgt++) { + sprintf(propbuf, "scsi-qla%d-target-%d", + (int) ha->instance, tgt); + + tmp_rval = qla2100_get_prop_16chars (ha, propbuf, + tmp_name, cmdline); + if ( tmp_rval == 0 ) { + /* Got a name for this ID. */ + + /* Save to appropriate fields. */ +#if USE_PORTNAME /* updated for ioctl merge */ + BCOPY(tmp_name, ha->fc_db[tgt].wwn, 8); +#else + BCOPY(tmp_name, ha->fc_db[tgt].name, 8); +#endif + ha->fc_db[tgt].loop_id = PORT_AVAILABLE; + ha->fc_db[tgt].flag = 0; /* v2.19.05b3 */ + ha->fc_db[tgt].flag |= DEV_CONFIGURED; + DEBUG(printk("Target %d - configured by user: ",tgt);) + DEBUG(printk("scsi-target=\"%08x%08x\"\n", + tmp_name[1], + tmp_name[0]);)/*ioctl support change*/ + } + } + +} + +/* +* Declarations for load module +*/ + +/* 2.19.15 */ +#ifndef FC_IP_SUPPORT +/************************************************************************/ +/* qla2x00_reserve_loopid */ +/* This routine reserves an unused public loop ID. */ +/* */ +/* Arguments: */ +/* ha - adapter block pointer */ +/* pLoopID - pointer to word for returning loop ID */ +/* */ +/* Return Value: */ +/* QL_STATUS_SUCCESS if no error */ +/* QL_STATUS_RESOURCE_ERROR if out of loop IDs */ +/************************************************************************/ + +static int qla2x00_reserve_loopid(scsi_qla_host_t *ha, uint16_t *pLoopId) +{ + int i; + + /* Look for unused loop ID */ + for (i = ha->min_external_loopid; i < ha->max_public_loop_ids; i++) + { + if (!ha->fabricid[i].in_use) + { + /* Found free loop ID */ + ha->fabricid[i].in_use = TRUE; + *pLoopId = i; + + DEBUG(sprintf(debug_buff, "qla2x00_reserve_loopid: assigned loop ID %x\n\r", *pLoopId)); + DEBUG(qla2100_print(debug_buff)); + return QL_STATUS_SUCCESS; + } + } + + /* Out of loop IDs */ + *pLoopId = ha->max_public_loop_ids + 1; /* Set out of range */ + DEBUG(qla2100_print("qla2x00_reserve_loopid: out of loop IDs\n\r")); + return QL_STATUS_RESOURCE_ERROR; +} /* qla2x00_reserve_loopid */ + + +/************************************************************************/ +/* qla2x00_free_loopid */ +/* This routine frees a public loop ID. */ +/* */ +/* Arguments: */ +/* ha - adapter block pointer */ +/* wLoopID - loop ID to free */ +/* */ +/* Return Value: */ +/* none */ +/************************************************************************/ + +static void qla2x00_free_loopid(scsi_qla_host_t *ha, uint16_t wLoopId) +{ + if (wLoopId < ha->max_public_loop_ids) + { + ha->fabricid[wLoopId].in_use = FALSE; + DEBUG(sprintf(debug_buff, "qla2x00_free_loopid: free loop ID %x\n\r", wLoopId)); + DEBUG(qla2100_print(debug_buff)); + } + else + { + DEBUG(sprintf(debug_buff, "qla2x00_free_loopid: loop ID %x out of range\n\r", wLoopId)); + DEBUG(qla2100_print(debug_buff)); + } +} /* qla2x00_free_loopid */ + + +/************************************************************************/ +/* qla2x00_login_public_device */ +/* This routine issues mailbox command to login fabric port. */ +/* */ +/* Arguments: */ +/* ha - adapter block pointer */ +/* wLoopID - public loop ID for device */ +/* pPortID - pointer to port ID for fabric login */ +/* wOptions - MBC_NO_PLOGI_IF_LOGGED_IN (bit 0) */ +/* MBC_NO_PROCESS_LOGIN (bit 1) */ +/* */ +/* Return Value: */ +/* QL_STATUS_SUCCESS if no error */ +/* QL_STATUS_ERROR if any other error */ +/* QL_STATUS_RESOURCE_ERROR if out of loop IDs */ +/* QL_STATUS_FATAL_ERROR if fatal error */ +/************************************************************************/ + +static int qla2x00_login_public_device(scsi_qla_host_t *ha, + uint16_t *pLoopId, + uint8_t *pPortID, + uint16_t wOptions) +{ + int status = QL_STATUS_SUCCESS; + int wRetryCount; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + + /* Set retry count */ + wRetryCount = 2; + + while (wRetryCount--) + { + DEBUG(sprintf(debug_buff, "qla2x00_login_public_device: login loop ID: %x port ID: %x, option: %x\n\r", + *pLoopId, *pPortID << 16 | *(pPortID+1) << 8 | *(pPortID+2), wOptions )); + DEBUG(qla2100_print(debug_buff)); + + /* Issue fabric login request */ + mb[0] = MBC_LOGIN_FABRIC_PORT; + mb[1] = (uint16_t)(*pLoopId << 8 | (wOptions & 0x00FF)); + mb[2] = (uint16_t)(*pPortID); + mb[3] = (uint16_t)(*(pPortID+1) << 8 | *(pPortID+2)); + if (qla2100_mailbox_command(ha, BIT_3|BIT_2|BIT_1|BIT_0, &mb[0]) == 0) + { + /* Login successful */ + status = QL_STATUS_SUCCESS; + break; + } + + /* Login failed, check status */ + if (mb[0] == MBS_FATAL_ERROR) + { + DEBUG(qla2100_print("qla2x00_login_public_device: LOGIN_FABRIC_PORT fatal error\n\r")); + status = QL_STATUS_FATAL_ERROR; + break; + } + else if (mb[0] == MBS_LOOP_ID_IN_USE) + { + DEBUG(sprintf(debug_buff, "qla2x00_login_public_device: loop ID %x in use by port ID %x (4008)\n\r", + *pLoopId, mb[1] << 16 | mb[2])); + DEBUG(qla2100_print(debug_buff)); + + /* Allocate another loop ID and retry */ + if ((status = qla2x00_reserve_loopid(ha, pLoopId)) == QL_STATUS_SUCCESS) + { + wRetryCount++; + } + else + { + break; + } + } + else if (mb[0] == MBS_PORT_ID_IN_USE) + { + DEBUG(sprintf(debug_buff, "qla2x00_login_public_device: port ID already assigned to loop ID %x (4007)\n\r", + mb[1])); + DEBUG(qla2100_print(debug_buff)); + + /* Free loop ID and use one assigned by RISC */ + qla2x00_free_loopid(ha, *pLoopId); + *pLoopId = mb[1]; + + /* Must reissue login mailbox command with new loop ID */ + wRetryCount++; + } + else + { + DEBUG(sprintf(debug_buff, "qla2x00_login_public_device: login error status %x, MB1: %x, MB2: %x\n\r", + mb[0], mb[1], mb[2])); + DEBUG(qla2100_print(debug_buff)); + status = QL_STATUS_ERROR; + } + } + return(status); +} /* qla2x00_login_public_device */ + + +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) +#ifdef MODULE +Scsi_Host_Template driver_template = QLA2100_LINUX_TEMPLATE; +#include "scsi_module.c" +#endif +#else /* new kernel scsi initialization scheme */ +static Scsi_Host_Template driver_template = QLA2100_LINUX_TEMPLATE; +#include "scsi_module.c" +#endif + +#ifdef QL_DEBUG_ROUTINES +/****************************************************************************/ +/* Driver Debug Functions. */ +/****************************************************************************/ + + /* + * Get byte from I/O port + */ +STATIC uint8_t +qla2100_getbyte(uint8_t *port) { + uint8_t ret; + +#ifdef MEMORY_MAPPED_IO + ret = *port; +#else + ret = inb((int)port); +#endif + + if( ql2x_debug_print ) { + qla2100_print("qla2100_getbyte: address = "); + qla2100_output_number((u_long)port, 16); + qla2100_print(" data = 0x"); + qla2100_output_number((u_long)ret, 16); + qla2100_print("\n"); + } + + return(ret); +} + + /* + * Get word from I/O port + */ +STATIC uint16_t +qla2100_getword(uint16_t *port) { + uint16_t ret; + +#ifdef MEMORY_MAPPED_IO + ret = *port; +#else + ret = inw((int)port); +#endif + + if( ql2x_debug_print ) { + qla2100_print("qla2100_getword: address = "); + qla2100_output_number((u_long)port, 16); + qla2100_print(" data = 0x"); + qla2100_output_number((u_long)ret, 16); + qla2100_print("\n"); + } + + return(ret); +} + + /* + * Get double word from I/O port + */ +STATIC uint32_t +qla2100_getdword(uint32_t *port) { + uint32_t ret; + +#ifdef MEMORY_MAPPED_IO + ret = *port; +#else + ret = inl((int)port); +#endif + + if( ql2x_debug_print ) { + qla2100_print("qla2100_getdword: address = "); + qla2100_output_number((u_long)port, 16); + qla2100_print(" data = 0x"); + qla2100_output_number((u_long)ret, 16); + qla2100_print("\n"); + } + + return(ret); +} + + /* + * Send byte to I/O port + */ +STATIC void +qla2100_putbyte(uint8_t *port, uint8_t data) { +#ifdef MEMORY_MAPPED_IO + *port = data; +#else + outb(data, (int)port); +#endif + + if( ql2x_debug_print ) { + qla2100_print("qla2100_putbyte: address = "); + qla2100_output_number((u_long)port, 16); + qla2100_print(" data = 0x"); + qla2100_output_number((u_long)data, 16); + qla2100_print("\n"); + } +} + + /* + * Send word to I/O port + */ +STATIC void +qla2100_putword(uint16_t *port, uint16_t data) { +#ifdef MEMORY_MAPPED_IO + *port = data; +#else +#ifdef _LINUX_IOPORTS + outw(data, (int)port); +#else + outw((int)port, data); +#endif +#endif + + if( ql2x_debug_print ) { + qla2100_print("qla2100_putword: address = "); + qla2100_output_number((u_long)port, 16); + qla2100_print(" data = 0x"); + qla2100_output_number((u_long)data, 16); + qla2100_print("\n"); + } +} + + /* + * Send double word to I/O port + */ +STATIC void +qla2100_putdword(uint32_t *port, uint32_t data) { +#ifdef MEMORY_MAPPED_IO + *port = data; +#else +#ifdef _LINUX_IOPORTS + outl(data,(int)port); +#else + outl((int)port, data); +#endif +#endif + + if( ql2x_debug_print ) { + qla2100_print("qla2100_putdword: address = "); + qla2100_output_number((u_long)port, 16); + qla2100_print(" data = 0x"); + qla2100_output_number((u_long)data, 16); + qla2100_print("\n"); + } +} + + /* + * Dummy function to prevent warnings for + * declared and unused debug functions + */ +void +qla2100_debug(void) { + qla2100_getbyte(0); + qla2100_getword(0); + qla2100_getdword(0); + qla2100_putbyte(0, 0); + qla2100_putword(0, 0); + qla2100_putdword(0, 0); +} + + /* + * Out character to COM1 port. + * PORT must be at standard address for COM1 = 0x3F8 + * This port is available on both Lion and ia32 systems + */ +#define OUTB(addr,data) outb((data),(addr)) +STATIC void +qla2100_putc(int8_t c) { +#ifdef QL_DEBUG_CONSOLE + + printk("%c",c); + +#else /* QL_DEBUG_CONSOLE */ + + uint8_t data; + int com_addr = 0x3f8; /* COM1 */ + int hardware_flow_control = 1; + int software_flow_control = 0; + uint8_t loop = TRUE; + + do { + + /* Wait for transmitter holding and shift registers for empty. */ + do { + data = inb(com_addr+5); + }while( !(data & BIT_6) ); + + /* + * Set BAUD rate for COM1 to 9600 + */ + + /* BAUD rate divisor LSB. */ + OUTB(com_addr+3, 0x83); + + /* BAUD rate divisor MSB. */ + OUTB(com_addr, 0xc); /* 0xC = 9600 baud */ + + /* Set No parity, 8 bits, 1 stop bit and + select interrupt enable register. */ + OUTB(com_addr+3, 3); + + /* Disable interrupts. */ + OUTB(com_addr+1, 0); + + /* Set data terminal ready and request to send */ + OUTB(com_addr+1, 0); + + if( hardware_flow_control ) { + /* Wait for clear-to-send and data-set-ready */ + do { + data = inb(com_addr+6) & (BIT_5 + BIT_4); + }while( data != (BIT_5 + BIT_4) ); + } else if( software_flow_control ) { + /* Test for data ready. */ + data = inb(com_addr+5); + if( data & BIT_0 ) { + /* If XOFF */ + data = inb(com_addr); + if( data == '\023' ) { + /* Wait for XON */ + do { + /* Wait for int8_t */ + do { + data = inb(com_addr+5); + }while( !(data & BIT_0) ); + data = inb(com_addr); + }while( data != '\021' ); + } + } + } + + /* Output character. */ + OUTB(com_addr, c); + + /* Add return. */ + if( c == '\n' ) + c = '\r'; + else + loop = FALSE; + + }while( loop ); +#endif /* QL_DEBUG_CONSOLE */ +} + + /* + * Out NULL terminated string to COM port. + */ +STATIC void +qla2100_print(int8_t *s) { + if( ql2x_debug_print ) { +#ifdef QL_DEBUG_CONSOLE + printk("%s",s); +#else + /* Output string. */ + while( *s ) + qla2100_putc(*s++); +#endif + } +} + + /* + * Output long number to COM port. + */ +STATIC void + qla2100_output_number(u_long n, uint8_t base) { + int8_t str[12]; + int8_t *s = &str[11]; + uint8_t output = 0; + uint8_t hex = FALSE; + + if( ql2x_debug_print ) { + if( base == 10 || base == 16 ) { + if( base == 16 && n > 9 ) + hex = TRUE; + + *s = 0; + do { + s--; + *s = n % base; + if( *s > 9 ) + *s += 55; + else + *s += '0'; + n /= base; + }while( n ); + + for( ; *s; s++ ) { + if( *s != '0' ) + output = 1; + if( output ) + qla2100_putc(*s); + } + if( !output ) + qla2100_putc(*--s); + + if( hex ) + qla2100_putc('h'); + } + } +} + +STATIC void +qla2100_dump_buffer(uint8_t *b, uint32_t size) { + uint32_t cnt; + uint8_t c; + + if( ql2x_debug_print ) { + qla2100_print( + " 0 1 2 3 4 5 6 7 8 9 Ah Bh Ch Dh Eh Fh\n"); + qla2100_print( + "---------------------------------------------------------------\n"); + + for( cnt = 0; cnt < size; ) { + c = *b++; + if( c < 16 ) + qla2100_putc(' '); + qla2100_output_number((uint32_t)c, 16); + cnt++; + if( !(cnt % 16) ) + qla2100_print("\n"); + else if( c < 10 ) + qla2100_print(" "); + else + qla2100_putc(' '); + } + if( cnt % 16 ) + qla2100_print("\n"); + } +} + /************************************************************************** + * ql2100_print_scsi_cmd + * + **************************************************************************/ +void qla2100_print_scsi_cmd(Scsi_Cmnd *cmd) { + scsi_qla_host_t *ha; + struct Scsi_Host *host = cmd->host; + srb_t *sp; + + int i; + ha = (scsi_qla_host_t *) host->hostdata; + + ql2x_debug_print = 1; + sp = (srb_t *) CMD_SP(cmd); + sprintf(debug_buff,"SCSI Command=0x%p, Handle=0x%08lx pid=%x\n\r", cmd, (u_long)CMD_HANDLE(cmd),cmd->pid); + qla2100_print(debug_buff); + sprintf(debug_buff," chan=%d, target = 0x%02x, lun = 0x%02x, cmd_len = 0x%02x\n\r", + cmd->channel, cmd->target, cmd->lun, cmd->cmd_len); + qla2100_print(debug_buff); + qla2100_print(" CDB = "); + for( i = 0; i < cmd->cmd_len; i++ ) { + sprintf(debug_buff,"0x%02x ", cmd->cmnd[i]); + qla2100_print(debug_buff); + } + + sprintf(debug_buff,"\n\r seg_cnt =%d, retries=%d, serial_number_at_timeout=0x%lx\n\r",cmd->use_sg,cmd->retries,cmd->serial_number_at_timeout); + qla2100_print(debug_buff); + sprintf(debug_buff," request buffer=0x%p, request buffer len=0x%x\n\r",cmd->request_buffer,cmd->request_bufflen); + qla2100_print(debug_buff); + sprintf(debug_buff," tag=%d, flags=0x%x, transfersize=0x%x \n\r", + cmd->tag, cmd->flags,cmd->transfersize); + qla2100_print(debug_buff); + sprintf(debug_buff," Pid=%d, SP=0x%x\n\r", (int)cmd->pid, CMD_SP(cmd)); + + qla2100_print(debug_buff); + sprintf(debug_buff," sp flags=0x%lx, sp state=%x, wdgtime=%d\n\r",sp->flags,sp->state,sp->wdg_time); + qla2100_print(debug_buff); +} + + +void qla2100_print_q_info(scsi_lu_t *q) { + sprintf(debug_buff,"Queue info: queue in =%d, queue out= %d, flags=0x%lx\n\r", q->q_incnt, q->q_outcnt, q->q_flag); + qla2100_print(debug_buff); +} +#endif + + + + + /************************************************************************** + * ql2100_dump_regs + * + **************************************************************************/ +static void qla2100_dump_regs(struct Scsi_Host *host) { + printk("Mailbox registers:\n"); + printk("qla2100 : mbox 0 0x%04x \n", inw(host->io_port + 0x10)); + printk("qla2100 : mbox 1 0x%04x \n", inw(host->io_port + 0x12)); + printk("qla2100 : mbox 2 0x%04x \n", inw(host->io_port + 0x14)); + printk("qla2100 : mbox 3 0x%04x \n", inw(host->io_port + 0x16)); + printk("qla2100 : mbox 4 0x%04x \n", inw(host->io_port + 0x18)); + printk("qla2100 : mbox 5 0x%04x \n", inw(host->io_port + 0x1a)); +#ifdef TRACECODE + sprintf(debug_buff,"qla2100 : mbox 0 0x%04x \n\r", inw(host->io_port + 0x10)); + qla2100_print(debug_buff); + sprintf(debug_buff,"qla2100 : mbox 1 0x%04x \n\r", inw(host->io_port + 0x12)); + qla2100_print(debug_buff); + sprintf(debug_buff,"qla2100 : mbox 2 0x%04x \n\r", inw(host->io_port + 0x14)); + qla2100_print(debug_buff); + sprintf(debug_buff,"qla2100 : mbox 3 0x%04x \n\r", inw(host->io_port + 0x16)); + qla2100_print(debug_buff); + sprintf(debug_buff,"qla2100 : mbox 4 0x%04x \n\r", inw(host->io_port + 0x18)); + qla2100_print(debug_buff); + sprintf(debug_buff,"qla2100 : mbox 5 0x%04x \n\r", inw(host->io_port + 0x1a)); + qla2100_print(debug_buff); +#endif +} + + +#if STOP_ON_ERROR + /************************************************************************** + * ql2100_panic + * + **************************************************************************/ +static void qla2100_panic(char *cp, struct Scsi_Host *host) { + scsi_qla_host_t *ha; + long *fp; + + ha = (scsi_qla_host_t *) host->hostdata; + DEBUG2(ql2x_debug_print = 1;) + sprintf(debug_buff,"qla2100 - PANIC: %s\n",cp); + qla2100_print(debug_buff); + sprintf(debug_buff,"Current time=0x%lx\n", jiffies); + qla2100_print(debug_buff); + sprintf(debug_buff,"Number of pending commands =0x%lx\n", ha->actthreads); + qla2100_print(debug_buff); + sprintf(debug_buff,"Number of queued commands =0x%lx\n", ha->qthreads); + qla2100_print(debug_buff); + sprintf(debug_buff,"Number of free entries = (%d)\n",ha->req_q_cnt); + qla2100_print(debug_buff); + sprintf(debug_buff,"Request Queue @ 0x%lx, Response Queue @ 0x%lx\n", + ha->request_dma, + ha->response_dma); + qla2100_print(debug_buff); + sprintf(debug_buff,"Request In Ptr %d\n", ha->req_ring_index); + qla2100_print(debug_buff); + fp = (long *) &ha->flags; + sprintf(debug_buff,"HA flags =0x%lx\n", *fp); + qla2100_print(debug_buff); + ql2100_dump_requests(ha); + qla2100_dump_regs(host); + cli(); + for( ;; ) { + QLA2100_DELAY(2); barrier(); + } + sti(); +} +#endif +#if 0 + static void qla2100_set_flags(int flag) { + + switch( flag ) { + case 0x1: + qla2100_verbose = 1L; + + } + + } +#endif + /************************************************************************** + * ql2100_dump_requests + * + **************************************************************************/ +void +ql2100_dump_requests(scsi_qla_host_t *ha) { + + Scsi_Cmnd *cp; + srb_t *sp; + int i; +#ifdef QL_DEBUG_ROUTINES + qla2100_print("Outstanding Commands on controller:\n\r"); +#else + printk(KERN_INFO "Outstanding Commands on controller:\n"); +#endif + for( i=0; i < MAX_OUTSTANDING_COMMANDS; i++ ) { + if( (sp = ha->outstanding_cmds[i]) == NULL ) + continue; + if( (cp = sp->cmd) == NULL ) + continue; + sprintf(debug_buff,"(%d): Pid=%ld, sp flags=0x%x, cmd=0x%p\n\r", i, (int)sp->cmd->pid, (long)sp->flags,CMD_SP(sp->cmd)); + +#ifdef QL_DEBUG_ROUTINES + qla2100_print(debug_buff); +#else + printk(KERN_INFO "%s",debug_buff); +#endif + } + +} + + + /************************************************************************** + * qla2100_setup + * + * Handle Linux boot parameters. This routine allows for assigning a value + * to a parameter with a ';' between the parameter and the value. + * ie. qla2x00=arg0;arg1;...;argN; OR + * via the command line. + * ie. qla2x00 ql2xopts=arg0;arg1;...;argN; + **************************************************************************/ +void qla2100_setup(char *s, int *dummy) { + char *cp, *np; + char *slots[MAXARGS]; + char **argv = &slots[0]; + char buf[LINESIZE]; + int argc, opts; + + /* + * Determine if we have any properties. + */ + cp = s; + opts = 1; + while( *cp && (np = qla2100_get_line(cp, buf)) != NULL ) { + if( BCMP("scsi-qla",buf,8) == 0 ) { + DEBUG(printk("qla2100: devconf=%s\n",cp);) + ql2xdevconf = cp; + (opts > 0)? opts-- : 0; + break; + } + opts++; + cp = np; + } + /* + * Parse the args before the properties + */ + if( opts ) { + opts = (opts > MAXARGS-1)? MAXARGS-1: opts; + argc = qla2100_get_tokens(s, argv, opts); + while (argc > 0 ) { + cp = *argv; + DEBUG(printk("scsi: found cmd arg =[%s]\n", cp);) + if( strcmp(cp, "verbose") == 0 ) { + DEBUG(printk("qla2100: verbose\n");) + qla2100_verbose++; + } else if (strcmp(cp, "quiet") == 0) { + qla2100_quiet = 1; + } else if( strcmp(cp, "reinit_on_loopdown") == 0 ) { + qla2100_reinit++; + DEBUG(printk("qla2100: reinit_on_loopdown\n");) + } + argc--, argv++; + } + } + +} + + /********************** qla2100_get_line ********************* + * qla2100_get_line + * Copy a substring from the specified string. The substring + * consists of any number of chars seperated by white spaces (i.e. spaces) + * and ending with a newline '\n' or a semicolon ';'. + * + * Enter: + * str - orig string + * line - substring + * + * Returns: + * cp - pointer to next string + * or + * null - End of string + *************************************************************/ +static char *qla2100_get_line(char *str, char *line) { + register char *cp = str; + register char *sp = line; + + /* skip preceeding spaces */ + while( *cp && *cp == ' ' ) + ++cp; + while ( (*cp) && *cp != '\n' && *cp != ';' ) /* end of line */ + *sp++ = *cp++; + + *sp = '\0'; + DEBUG5(printk("qla2100_get_line: %s\n",line);) + if( (*cp) ) { + cp++; + return( cp ); + } + return( NULL ); +} + + + /**************************** get_tokens ********************* + * Parse command line into argv1, argv2, ... argvX + * Arguments are seperated by white spaces and colons and end + * with a NULL. + *************************************************************/ +static int qla2100_get_tokens(char *line, char **argv, int maxargs ) { + register char *cp = line; + int count = 0; + + while( *cp && count < maxargs ) { + /* skip preceeding spaces */ + while((*cp) && *cp == ' ') + ++cp; + /* symbol starts here */ + argv[count++] = cp; + /* skip symbols */ + while ( (*cp) && !( *cp == ' ' || *cp == ';' || *cp == ':' ) ) + cp++; + /* replace comma or space with a null */ + if( (*cp) && (*cp ==' ' ) && argv[count-1] != cp ) + *cp++ = '\0'; + } + return( count ); +} + +#ifdef FC_IP_SUPPORT + /* Include routines for supporting IP */ +#include "qla2100ip.c" +#endif /* FC_IP_SUPPORT */ + +#if APIDEV +/****************************************************************************/ +/* Create character driver "HbaApiDev" w dynamically allocated major number */ +/* and create "/proc/scsi/qla2x00/HbaApiNode" as the device node associated */ +/* with the major number. */ +/****************************************************************************/ + +#define APIDEV_NODE "HbaApiNode" +#define APIDEV_NAME "HbaApiDev" + +static int apidev_major = 0; +static struct Scsi_Host *apidev_host = 0; + +static int apidev_open(struct inode *inode, struct file *file) +{ + printk (KERN_INFO "qla2100_apidev: open MAJOR number = %d, MINOR number = %d\n", MAJOR (inode->i_rdev), MINOR (inode->i_rdev)); + return 0; +} +static int apidev_close(struct inode *inode, struct file *file) +{ + printk (KERN_INFO "qla2100_apidev: closed\n"); + return 0; +} + +static int apidev_ioctl(struct inode *inode, struct file *fp, unsigned int cmd, unsigned long arg) +{ + Scsi_Device fake_scsi_device; + fake_scsi_device.host = apidev_host; + return(qla2100_ioctl(&fake_scsi_device, (int)cmd, (void*)arg)); +} + +static struct file_operations apidev_fops = { + ioctl: apidev_ioctl, + open: apidev_open, + release: apidev_close +}; + +static int apidev_init(struct Scsi_Host *host) +{ + if(apidev_host) return 0; + if (0 > (apidev_major = register_chrdev(0, APIDEV_NAME, &apidev_fops))) + { + DEBUG(printk("qla2100_apidev: register_chrdev rc=%d\n",apidev_major);) + return apidev_major; + } + apidev_host = host; + DEBUG(printk("qla2x00: Created /proc/scsi/qla2x00/%s major=%d\n",APIDEV_NODE,apidev_major);) + proc_mknod(APIDEV_NODE, 0777+S_IFCHR,host->hostt->proc_dir,(kdev_t)MKDEV(apidev_major,0)); + return 0; +} + +static int apidev_cleanup() +{ + if(!apidev_host) return 0; + unregister_chrdev(apidev_major,APIDEV_NAME); + remove_proc_entry(APIDEV_NODE,apidev_host->hostt->proc_dir); + apidev_host = 0; + return 0; +} +#endif /* APIDEV */ + +#ifdef QL_DEBUG_ROUTINES +#if DEBUG_GET_FW_DUMP +#include "x2300dbg.c" +#endif +#endif + + +/* +* Overrides for Emacs so that we almost follow Linus's tabbing style. +* Emacs will notice this stuff at the end of the file and automatically +* adjust the settings for this buffer only. This must remain at the end +* of the file. +* --------------------------------------------------------------------------- +* Local variables: +* c-indent-level: 2 +* c-brace-imaginary-offset: 0 +* c-brace-offset: -2 +* c-argdecl-indent: 2 +* c-label-offset: -2 +* c-continued-statement-offset: 2 +* c-continued-brace-offset: 0 +* indent-tabs-mode: nil +* tab-width: 8 +* End: +*/ diff -urN linux-2.4.18/drivers/scsi/qla2x00.h lia64-2.4/drivers/scsi/qla2x00.h --- linux-2.4.18/drivers/scsi/qla2x00.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/scsi/qla2x00.h Mon Jul 23 14:12:30 2001 @@ -0,0 +1,2492 @@ +/******************************************************************************** +* QLOGIC LINUX SOFTWARE +* +* QLogic ISP2x00 device driver for Linux 2.2.x and 2.4.x +* Copyright (C) 2000 and 2001 Qlogic Corporation +* (www.qlogic.com) +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2, or (at your option) any +* later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +** +******************************************************************************/ + +#ifndef _IO_HBA_QLA2100_H /* wrapper symbol for kernel use */ +#define _IO_HBA_QLA2100_H /* subject to change without notice */ + +#ifndef LINUX_VERSION_CODE +#include +#endif /* LINUX_VERSION_CODE not defined */ + +#ifndef HOSTS_C + +#if defined(__cplusplus) +extern "C" { +#endif + +#ifndef ISP2200 +#define ISP2200 +#endif + + +/* + * Driver debug definitions. + */ +/* #define QL_DEBUG_LEVEL_1 */ /* Output register accesses to COM1 */ +/* #define QL_DEBUG_LEVEL_2 */ /* Output error msgs to COM1 */ +/* #define QL_DEBUG_LEVEL_3 */ /* Output function trace msgs to COM1 */ +/* #define QL_DEBUG_LEVEL_4 */ /* Output NVRAM trace msgs to COM1 */ +/* #define QL_DEBUG_LEVEL_5 */ /* Output ring trace msgs to COM1 */ +/* #define QL_DEBUG_LEVEL_6 */ /* Output WATCHDOG timer trace to COM1 */ +/* #define QL_DEBUG_LEVEL_7 */ /* Output RISC load trace msgs to COM1 */ +/* #define QL_DEBUG_LEVEL_8 */ /* Output ring saturation msgs to COM1 */ + +#define QL_DEBUG_CONSOLE /* Output to console instead of COM1 */ + /* comment this #define to get output of qla2100_print to COM1 */ + /* if COM1 is not connected to a host system, the driver hangs system! */ + +/* + * Data bit definitions. + */ +#define BIT_0 0x1 +#define BIT_1 0x2 +#define BIT_2 0x4 +#define BIT_3 0x8 +#define BIT_4 0x10 +#define BIT_5 0x20 +#define BIT_6 0x40 +#define BIT_7 0x80 +#define BIT_8 0x100 +#define BIT_9 0x200 +#define BIT_10 0x400 +#define BIT_11 0x800 +#define BIT_12 0x1000 +#define BIT_13 0x2000 +#define BIT_14 0x4000 +#define BIT_15 0x8000 +#define BIT_16 0x10000 +#define BIT_17 0x20000 +#define BIT_18 0x40000 +#define BIT_19 0x80000 +#define BIT_20 0x100000 +#define BIT_21 0x200000 +#define BIT_22 0x400000 +#define BIT_23 0x800000 +#define BIT_24 0x1000000 +#define BIT_25 0x2000000 +#define BIT_26 0x4000000 +#define BIT_27 0x8000000 +#define BIT_28 0x10000000 +#define BIT_29 0x20000000 +#define BIT_30 0x40000000 +#define BIT_31 0x80000000 + +/* + * Common size type definitions + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; +typedef char int8_t; +typedef short int16_t; +typedef long int32_t; +#endif + +/* + * Local Macro Definitions. + */ +#if defined(QL_DEBUG_LEVEL_1) || defined(QL_DEBUG_LEVEL_2) || \ + defined(QL_DEBUG_LEVEL_3) || defined(QL_DEBUG_LEVEL_4) || \ + defined(QL_DEBUG_LEVEL_5) || defined(QL_DEBUG_LEVEL_6) || \ + defined(QL_DEBUG_LEVEL_7) || defined(QL_DEBUG_LEVEL_8) + #define QL_DEBUG_ROUTINES +#endif + +#ifndef TRUE + #define TRUE 1 +#endif + +#ifndef FALSE + #define FALSE 0 +#endif +#ifndef KERNEL_VERSION +# define KERNEL_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z)) +#endif + +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,1,92) +# if defined(__sparc_v9__) || defined(__powerpc__) +# error "PPC and Sparc platforms are only support under 2.1.92 and above" +# endif +#endif + + +/* + * Locking + */ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,0) +# if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) +# include +# else +# include +# endif +# include +# define cpuid smp_processor_id() +# if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) +# define DRIVER_LOCK_INIT \ + spin_lock_init(&ha->spin_lock); +# define DRIVER_LOCK \ + if(!ha->cpu_lock_count[cpuid]) { \ + spin_lock_irqsave(&ha->spin_lock, cpu_flags); \ + ha->cpu_lock_count[cpuid]++; \ + } else { \ + ha->cpu_lock_count[cpuid]++; \ + } +# define DRIVER_UNLOCK \ + if(--ha->cpu_lock_count[cpuid] == 0) \ + spin_unlock_irqrestore(&ha->spin_lock, cpu_flags); +# else +# define DRIVER_LOCK_INIT +# define DRIVER_LOCK +# define DRIVER_UNLOCK +# endif +#else +# define cpuid 0 +# define DRIVER_LOCK_INIT +# define DRIVER_LOCK \ + save_flags(cpu_flags); \ + cli(); +# define DRIVER_UNLOCK \ + restore_flags(cpu_flags); +# define le32_to_cpu(x) (x) +# define cpu_to_le32(x) (x) +#endif + + +/* + * I/O register +*/ +/* #define MEMORY_MAPPED_IO */ /* Enable memory mapped I/O */ +#undef MEMORY_MAPPED_IO /* Disable memory mapped I/O */ +#define LINUX_IOPORTS /* Linux in/out routines are define*/ + /* differently from other OSs */ + +#ifdef QL_DEBUG_LEVEL_1 + #define RD_REG_BYTE(addr) qla2100_getbyte((uint8_t *)addr) + #define RD_REG_WORD(addr) qla2100_getword((uint16_t *)addr) + #define RD_REG_DWORD(addr) qla2100_getdword((uint32_t *)addr) + #define WRT_REG_BYTE(addr, data) qla2100_putbyte((uint8_t *)addr, data) + #define WRT_REG_WORD(addr, data) qla2100_putword((uint16_t *)addr, data) + #define WRT_REG_DWORD(addr, data) qla2100_putdword((uint32_t *)addr, data) +#else /* QL_DEBUG_LEVEL_1 */ +#ifdef MEMORY_MAPPED_IO +#define RD_REG_BYTE(addr) (*((volatile uint8_t *)addr)) +#define RD_REG_WORD(addr) (*((volatile uint16_t *)addr)) +#define RD_REG_DWORD(addr) (*((volatile uint32_t *)addr)) +#define WRT_REG_BYTE(addr, data) (*((volatile uint8_t *)addr) = data) +#define WRT_REG_WORD(addr, data) (*((volatile uint16_t *)addr) = data) +#define WRT_REG_DWORD(addr, data) (*((volatile uint32_t *)addr) = data) +#else /* MEMORY_MAPPED_IO */ +#define RD_REG_BYTE(addr) (inb((unsigned long)addr)) +#define RD_REG_WORD(addr) (inw((unsigned long)addr)) +#define RD_REG_DWORD(addr) (inl((unsigned long)addr)) +#define WRT_REG_BYTE(addr, data) (outb(data,(unsigned long)addr)) +#define WRT_REG_WORD(addr, data) (outw(data,(unsigned long)addr)) +#define WRT_REG_DWORD(addr, data) (outl(data,(unsigned long)addr)) +#endif /* MEMORY_MAPPED_IO */ +#endif /* QL_DEBUG_LEVEL_1 */ + +#define MAX_FIBRE_DEVICES 256 +#define MAX_RSCN_COUNT 10 +#define MAX_HOST_COUNT 16 + +/* + * Host adapter default definitions. + */ +#define MAX_BUSES 1 /* We only have one bus today */ +#define MAX_TARGETS_2100 255 +#define MAX_TARGETS_2200 255 +#define MAX_LUNS 255 + +/* + * Fibre Channel device definitions. + */ +#define LAST_LOCAL_LOOP_ID 0x7d +#define SNS_FL_PORT 0x7e +#define FABRIC_CONTROLLER 0x7f +#define SIMPLE_NAME_SERVER 0x80 +#define SNS_FIRST_LOOP_ID 0x81 +#define LAST_SNS_LOOP_ID 0xfe +#define MANAGEMENT_SERVER 0xfe +#define BROADCAST 0xff +#define SNS_ACCEPT 0x0280 /* 8002 swapped */ +#define SNS_REJECT 0x0180 /* 8001 swapped */ + +/* Loop ID's used as database flags, must be higher than any valid Loop ID */ +#define PORT_UNUSED 0x100 /* Port never been used. */ +#define PORT_AVAILABLE 0x101 /* Device does not exist on port. */ + +/* + * Timeout timer counts in seconds + */ +#define QLA2100_WDG_TIME_QUANTUM 1 /* In seconds */ +#define PORT_RETRY_TIME 2 +#define LOOP_DOWN_TIMEOUT 60 +#define LOOP_DOWN_TIME 240 /* 240 */ + +/* Maximum outstanding commands in ISP queues (1-65535) */ +#define LOOP_DOWN_RESET (LOOP_DOWN_TIME - 30) + +/* Maximum outstanding commands in ISP queues (1-65535) */ +#define MAX_OUTSTANDING_COMMANDS 512*2 + +#define REQUEST_ENTRY_CNT 256 /* # of request entries, was 512 */ +#define RESPONSE_ENTRY_CNT 256 /* # of response entries, was 16 */ + +/* + * UnixWare required definitions. + */ +#define HBA_PREFIX qla2100 + +/* Physical DMA memory requirements */ +#define QLA2100_MEMALIGN 4 +#define QLA2100_BOUNDARY 0x80000000 /* 2GB */ + +/* Number of segments 1 - 65535 */ +#define SG_SEGMENTS 32 /* Cmd entry + 6 continuations */ + +/* + * SCSI Request Block + */ +typedef struct srb +{ + Scsi_Cmnd *cmd; /* (4) SCSI command block */ + struct srb *s_next; /* (4) Next block on LU queue */ + struct srb *s_prev; /* (4) Previous block on LU queue */ + uint8_t flags; /* (1) Status flags. */ + uint8_t dir; /* direction of transfer */ + uint8_t retry_count; /* Retry count. */ + uint8_t port_down_retry_count; /* Port down retry count. */ + uint8_t ccode; /* risc completion code */ + uint8_t scode; /* scsi status code */ + uint8_t wdg_time; /* watchdog time in seconds */ + uint8_t state; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,18) + uint64_t saved_dma_handle; /* for unmap of single transfers */ +#endif +}srb_t; + +/* + * SRB flag definitions + */ +#define SRB_TIMEOUT BIT_0 /* Command timed out */ +#define SRB_SENT BIT_1 /* Command sent to ISP */ +#define SRB_WATCHDOG BIT_2 /* Command on watchdog list */ +#define SRB_ABORT_PENDING BIT_3 /* Command abort sent to device */ +#define SRB_ABORTED BIT_4 /* Command aborted command already */ +#define SRB_RETRY BIT_5 /* Command aborted command already */ + +/* + * LUN - Logical Unit Queue structure + */ +typedef struct scsi_lu +{ + srb_t *q_first; /* First block on LU queue */ + srb_t *q_last; /* Last block on LU queue */ + u_char q_flag; /* LU queue state flags */ + u_short q_outcnt; /* Pending jobs for this LU */ + u_long q_incnt; /* queued jobs for this LU */ + u_long io_cnt; /* total xfer count */ + u_long resp_time; /* total response time (start - finish) */ + u_long act_time; /* total actived time (minus queuing time) */ + u_long w_cnt; /* total writes */ + u_long r_cnt; /* total reads */ +#if QLA2X00_TARGET_MODE_SUPPORT + void (*q_func)(); /* Target driver event handler */ + long q_param; /* Target driver event param */ +#endif +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,0) + spinlock_t *q_spin_lock; /* Device Queue Lock */ +#endif + volatile unsigned char cpu_lock_count[NR_CPUS]; + u_long q_timeout; /* total command timeouts */ +}scsi_lu_t; + +/* + * Logical Unit q_flag definitions + */ +#define QLA2100_QBUSY BIT_0 +#define QLA2100_QWAIT BIT_1 +#define QLA2100_QSUSP BIT_2 +#define QLA2100_QRESET BIT_4 +#define QLA2100_QHBA BIT_5 +#define QLA2100_BSUSP BIT_6 /* controller is suspended */ +#define QLA2100_BREM BIT_7 /* controller is removed */ + +/* + * ISP PCI Configuration Register Set + */ +typedef volatile struct +{ + uint16_t vendor_id; /* 0x0 */ + uint16_t device_id; /* 0x2 */ + uint16_t command; /* 0x4 */ + uint16_t status; /* 0x6 */ + uint8_t revision_id; /* 0x8 */ + uint8_t programming_interface; /* 0x9 */ + uint8_t sub_class; /* 0xa */ + uint8_t base_class; /* 0xb */ + uint8_t cache_line; /* 0xc */ + uint8_t latency_timer; /* 0xd */ + uint8_t header_type; /* 0xe */ + uint8_t bist; /* 0xf */ + uint32_t base_port; /* 0x10 */ + uint32_t mem_base_addr; /* 0x14 */ + uint32_t base_addr[4]; /* 0x18-0x24 */ + uint32_t reserved_1[2]; /* 0x28-0x2c */ + uint16_t expansion_rom; /* 0x30 */ + uint32_t reserved_2[2]; /* 0x34-0x38 */ + uint8_t interrupt_line; /* 0x3c */ + uint8_t interrupt_pin; /* 0x3d */ + uint8_t min_grant; /* 0x3e */ + uint8_t max_latency; /* 0x3f */ +}config_reg_t; + + +/* + * 2100/2200 ISP I/O Register Set structure definitions. + */ +typedef volatile struct +{ + uint16_t flash_address; /* Flash BIOS address */ + uint16_t flash_data; /* Flash BIOS data */ + uint16_t unused_1[1]; /* Gap */ + uint16_t ctrl_status; /* Control/Status */ + #define ISP_FLASH_ENABLE BIT_1 /* Flash BIOS Read/Write enable */ + #define ISP_RESET BIT_0 /* ISP soft reset */ + uint16_t ictrl; /* Interrupt control */ + #define ISP_EN_INT BIT_15 /* ISP enable interrupts. */ + #define ISP_EN_RISC BIT_3 /* ISP enable RISC interrupts. */ + uint16_t istatus; /* Interrupt status @0xa*/ + #define RISC_INT BIT_3 /* RISC interrupt */ + uint16_t semaphore; /* Semaphore */ + uint16_t nvram; /* NVRAM register. @0xe */ + #define NV_DESELECT 0 + #define NV_CLOCK BIT_0 + #define NV_SELECT BIT_1 + #define NV_DATA_OUT BIT_2 + #define NV_DATA_IN BIT_3 + + /* 2100 and 2200 */ + uint16_t mailbox0; /* Mailbox 0 @0x10 */ + uint16_t mailbox1; /* Mailbox 1 */ + uint16_t mailbox2; /* Mailbox 2 */ + uint16_t mailbox3; /* Mailbox 3 */ + uint16_t mailbox4; /* Mailbox 4 */ + uint16_t mailbox5; /* Mailbox 5 */ + uint16_t mailbox6; /* Mailbox 6 */ + uint16_t mailbox7; /* Mailbox 7 */ + + uint16_t unused_2[0x3b]; /* Gap */ + uint16_t fpm_diag_config; + uint16_t unused_3[0x6]; /* Gap */ + uint16_t pcr; /* Processor Control Register. */ + uint16_t unused_4[0x5]; /* Gap */ + uint16_t mctr; /* Memory Configuration and Timing. */ + uint16_t unused_5[0x3]; /* Gap */ + uint16_t fb_cmd; + uint16_t unused_6[0x3]; /* Gap */ + uint16_t host_cmd; /* Host command and control */ + + #define HOST_INT BIT_7 /* host interrupt bit */ +#ifdef FC_IP_SUPPORT + uint16_t unused_3[0x0F]; /* Gap */ + uint16_t mailbox8; /* Mailbox 8 */ + uint16_t mailbox9; /* Mailbox 9 */ + uint16_t mailbox10; /* Mailbox 10 */ + uint16_t mailbox11; /* Mailbox 11 */ + uint16_t mailbox12; /* Mailbox 12 */ + uint16_t mailbox13; /* Mailbox 13 */ + uint16_t mailbox14; /* Mailbox 14 */ + uint16_t mailbox15; /* Mailbox 15 */ + uint16_t mailbox16; /* Mailbox 16 */ + uint16_t mailbox17; /* Mailbox 17 */ + uint16_t mailbox18; /* Mailbox 18 */ + uint16_t mailbox19; /* Mailbox 19 */ + uint16_t mailbox20; /* Mailbox 20 */ + uint16_t mailbox21; /* Mailbox 21 */ + uint16_t mailbox22; /* Mailbox 22 */ + uint16_t mailbox23; /* Mailbox 23 */ +#endif + +}device_reg_t; + +/* + * 2300 ISP I/O Register Set structure definitions. + */ +typedef volatile struct +{ + uint16_t flash_address; /* Flash BIOS address */ + uint16_t flash_data; /* Flash BIOS data */ + uint16_t unused_1[1]; /* Gap */ + uint16_t ctrl_status; /* Control/Status */ + #define ISP_FLASH_ENABLE BIT_1 /* Flash BIOS Read/Write enable */ + #define ISP_RESET BIT_0 /* ISP soft reset */ + uint16_t ictrl; /* Interrupt control */ + #define ISP_EN_INT BIT_15 /* ISP enable interrupts. */ + #define ISP_EN_RISC BIT_3 /* ISP enable RISC interrupts. */ + uint16_t istatus; /* Interrupt status @0xa*/ + #define RISC_2300_INT BIT_15 /* 2300 RISC int for non-ROM cmds */ + uint16_t semaphore; /* Semaphore */ + uint16_t nvram; /* NVRAM register. @0xf */ + #define NV_DESELECT 0 + #define NV_CLOCK BIT_0 + #define NV_SELECT BIT_1 + #define NV_DATA_OUT BIT_2 + #define NV_DATA_IN BIT_3 + /* 2300 */ + uint16_t req_q_in /* @0x10 */; + uint16_t req_q_out /* @0x12 */; + uint16_t rsp_q_in /* @0x14 */; + uint16_t rsp_q_out /* @0x16 */; + uint32_t host_status /* @0x18 */; + uint16_t unused3[0x12]; + uint16_t mailbox0; /* Mailbox 0 @0x40 */ + uint16_t mailbox1; /* Mailbox 1 */ + uint16_t mailbox2; /* Mailbox 2 */ + uint16_t mailbox3; /* Mailbox 3 */ + uint16_t mailbox4; /* Mailbox 4 */ + uint16_t mailbox5; /* Mailbox 5 */ + uint16_t mailbox6; /* Mailbox 6 */ + uint16_t mailbox7; /* Mailbox 7 @0x4E */ + uint16_t mailbox8; /* Mailbox 8 */ + uint16_t mailbox9; /* Mailbox 9 */ + uint16_t mailbox10; /* Mailbox 10 */ + uint16_t mailbox11; /* Mailbox 11 */ + uint16_t mailbox12; /* Mailbox 12 */ + uint16_t mailbox13; /* Mailbox 13 */ + uint16_t mailbox14; /* Mailbox 14 */ + uint16_t mailbox15; /* Mailbox 15 */ + uint16_t mailbox16; /* Mailbox 16 */ + uint16_t mailbox17; /* Mailbox 17 */ + uint16_t mailbox18; /* Mailbox 18 */ + uint16_t mailbox19; /* Mailbox 19 */ + uint16_t mailbox20; /* Mailbox 20 */ + uint16_t mailbox21; /* Mailbox 21 */ + uint16_t mailbox22; /* Mailbox 22 */ + uint16_t mailbox23; /* Mailbox 23 */ + uint16_t mailbox24; /* Mailbox 24 */ + uint16_t mailbox25; /* Mailbox 25 */ + uint16_t mailbox26; /* Mailbox 26 */ + uint16_t mailbox27; /* Mailbox 27 */ + uint16_t mailbox28; /* Mailbox 28 */ + uint16_t mailbox29; /* Mailbox 29 */ + uint16_t mailbox30; /* Mailbox 30 */ + uint16_t mailbox31; /* Mailbox 31 @0x7E */ + uint16_t unused4[0xb]; /* gap */ + + uint16_t fpm_diag_config; + uint16_t unused_3[0x6]; /* Gap */ + uint16_t pcr; /* Processor Control Register. */ + uint16_t unused_4[0x5]; /* Gap */ + uint16_t mctr; /* Memory Configuration and Timing. */ + uint16_t unused_5[0x3]; /* Gap */ + uint16_t fb_cmd; + uint16_t unused_6[0x3]; /* Gap */ + uint16_t host_cmd; /* Host command and control */ + + #define HOST_INT BIT_7 /* host interrupt bit */ +#ifdef FC_IP_SUPPORT + uint16_t unused_3[0x0F]; /* Gap */ + uint16_t mailbox8; /* Mailbox 8 */ + uint16_t mailbox9; /* Mailbox 9 */ + uint16_t mailbox10; /* Mailbox 10 */ + uint16_t mailbox11; /* Mailbox 11 */ + uint16_t mailbox12; /* Mailbox 12 */ + uint16_t mailbox13; /* Mailbox 13 */ + uint16_t mailbox14; /* Mailbox 14 */ + uint16_t mailbox15; /* Mailbox 15 */ + uint16_t mailbox16; /* Mailbox 16 */ + uint16_t mailbox17; /* Mailbox 17 */ + uint16_t mailbox18; /* Mailbox 18 */ + uint16_t mailbox19; /* Mailbox 19 */ + uint16_t mailbox20; /* Mailbox 20 */ + uint16_t mailbox21; /* Mailbox 21 */ + uint16_t mailbox22; /* Mailbox 22 */ + uint16_t mailbox23; /* Mailbox 23 */ +#endif + +}device2300_reg_t; + + +#define MAILBOX_REGISTER_COUNT 32 + +/* + * ISP product identification definitions in mailboxes after reset. + */ +#define PROD_ID_1 0x4953 +#define PROD_ID_2 0x0000 +#define PROD_ID_2a 0x5020 +#define PROD_ID_3 0x2020 +#define PROD_ID_4 0x1 + +/* + * ISP host command and control register command definitions + */ +#define HC_RESET_RISC 0x1000 /* Reset RISC */ +#define HC_PAUSE_RISC 0x2000 /* Pause RISC */ +#define HC_RELEASE_RISC 0x3000 /* Release RISC from reset. */ +#define HC_SET_HOST_INT 0x5000 /* Set host interrupt */ +#define HC_CLR_HOST_INT 0x6000 /* Clear HOST interrupt */ +#define HC_CLR_RISC_INT 0x7000 /* Clear RISC interrupt */ +#define HC_RISC_PAUSE BIT_5 +#define HC_DISABLE_PARITY_PAUSE 0x4001 /* Disable parity error RISC pause. */ + +#define SEMAPHORE_SET 0x1234 + +/* + * ISP mailbox Self-Test status codes + */ +#define MBS_FRM_ALIVE 0 /* Firmware Alive. */ +#define MBS_CHKSUM_ERR 1 /* Checksum Error. */ +#define MBS_BUSY 4 /* Busy. */ + +/* + * ISP mailbox command complete status codes + */ +#define MBS_CMD_CMP 0x4000 /* Command Complete. */ +#define MBS_INV_CMD 0x4001 /* Invalid Command. */ +#define MBS_HOST_INF_ERR 0x4002 /* Host Interface Error. */ +#define MBS_TEST_FAILED 0x4003 /* Test Failed. */ +#define MBS_CMD_ERR 0x4005 /* Command Error. */ +#define MBS_CMD_PARAM_ERR 0x4006 /* Command Parameter Error. */ +#define MBS_FATAL_ERROR 0xF000 /* Command Fatal Error. */ + +#define MBS_FIRMWARE_ALIVE 0x0000 +#define MBS_COMMAND_COMPLETE 0x4000 +#define MBS_INVALID_COMMAND 0x4001 + +/* QLogic subroutine status definitions */ +#define QL_STATUS_SUCCESS 0 +#define QL_STATUS_ERROR 1 +#define QL_STATUS_FATAL_ERROR 2 +#define QL_STATUS_RESOURCE_ERROR 3 +#define QL_STATUS_LOOP_ID_IN_USE 4 +#define QL_STATUS_NO_DATA 5 + +/* + * ISP mailbox asynchronous event status codes + */ +#define MBA_ASYNC_EVENT 0x8000 /* Asynchronous event. */ +#define MBA_RESET 0x8001 /* Reset Detected. */ +#define MBA_SYSTEM_ERR 0x8002 /* System Error. */ +#define MBA_REQ_TRANSFER_ERR 0x8003 /* Request Transfer Error. */ +#define MBA_RSP_TRANSFER_ERR 0x8004 /* Response Transfer Error. */ +#define MBA_WAKEUP_THRES 0x8005 /* Request Queue Wake-up. */ +#define MBA_LIP_OCCURRED 0x8010 /* Loop Initialization Procedure */ + /* occurred. */ +#define MBA_LOOP_UP 0x8011 /* FC Loop UP. */ +#define MBA_LOOP_DOWN 0x8012 /* FC Loop Down. */ +#define MBA_LIP_RESET 0x8013 /* LIP reset occurred. */ +#define MBA_PORT_UPDATE 0x8014 /* Port Database update. */ +#define MBA_SCR_UPDATE 0x8015 /* State Change Registration. */ +#define MBA_SCSI_COMPLETION 0x8020 /* SCSI Command Complete. */ +#define MBA_CTIO_COMPLETION 0x8021 /* CTIO Complete. */ +#ifdef ISP2200 +#define MBA_LINK_MODE_UP 0x8030 /* FC Link Mode UP. */ +#define MBA_UPDATE_CONFIG 0x8036 /* FC Update Configuration. */ +#endif + +/* + * ISP mailbox commands + */ +#define MBC_LOAD_RAM 1 /* Load RAM. */ +#define MBC_EXECUTE_FIRMWARE 2 /* Execute firmware. */ +#define MBC_WRITE_RAM_WORD 4 /* Write RAM word. */ +#define MBC_READ_RAM_WORD 5 /* Read RAM word. */ +#define MBC_MAILBOX_REGISTER_TEST 6 /* Wrap incoming mailboxes */ +#define MBC_VERIFY_CHECKSUM 7 /* Verify checksum. */ +#define MBC_ABOUT_FIRMWARE 8 /* Get firmware revision. */ +#define MBC_DUMP_RAM 0xA /* READ BACK FW */ +#define MBC_DUMP_SRAM 0xC /* Dump SRAM */ +#define MBC_IOCB_EXECUTE 0x12 /* Execute an IOCB command */ +#define MBC_ABORT_COMMAND 0x15 /* Abort IOCB command. */ +#define MBC_ABORT_DEVICE 0x16 /* Abort device (ID/LUN). */ +#define MBC_ABORT_TARGET 0x17 /* Abort target (ID). */ +#define MBC_TARGET_RESET 0x18 /* Target reset. */ +#define MBC_GET_ADAPTER_LOOP_ID 0x20 /* Get loop id of ISP2100. */ +#define MBC_SET_TARGET_PARAMATERS 0x38 /* Set target parameters. */ +#define MBC_DIAGNOSTIC_LOOP_BACK 0x45 /* Perform LoopBack diagnostic */ +#define MBC_INITIALIZE_FIRMWARE 0x60 /* Initialize firmware */ +#define MBC_INITIATE_LIP 0x62 /* Initiate Loop Initialization */ + /* Procedure */ +#define MBC_GET_PORT_DATABASE 0x64 /* Get port database. */ +#define MBC_GET_FIRMWARE_STATE 0x69 /* Get firmware state. */ +#define MBC_GET_PORT_NAME 0x6a /* Get port name. */ +#define MBC_LIP_RESET 0x6c /* LIP reset. */ +#define MBC_SEND_SNS_COMMAND 0x6e /* Send Simple Name Server command. */ +#define MBC_LOGIN_FABRIC_PORT 0x6f /* Login fabric port. */ +#define MBC_LOGOUT_FABRIC_PORT 0x71 /* Logout fabric port. */ +#define MBC_LIP_FULL_LOGIN 0x72 /* Full login LIP. */ +#define MBC_GET_PORT_LIST 0x75 /* Get port list. */ + +/* + * Firmware state codes from get firmware state mailbox command + */ +#define FSTATE_CONFIG_WAIT 0 +#define FSTATE_WAIT_AL_PA 1 +#define FSTATE_WAIT_LOGIN 2 +#define FSTATE_READY 3 +#define FSTATE_LOSS_OF_SYNC 4 +#define FSTATE_ERROR 5 +#define FSTATE_REINIT 6 +#define FSTATE_NON_PART 7 + +#define FSTATE_CONFIG_CORRECT 0 +#define FSTATE_P2P_RCV_LIP 1 +#define FSTATE_P2P_CHOOSE_LOOP 2 +#define FSTATE_P2P_RCV_UNIDEN_LIP 3 +#define FSTATE_FATAL_ERROR 4 +#define FSTATE_LOOP_BACK_CONN 5 + +/* + * ISP Initialization Control Block. + */ +typedef struct +{ + uint8_t version; + #define ICB_VERSION 1 + uint8_t reserved_1; + struct + { + uint8_t enable_hard_loop_id :1; /* bit 0 */ + uint8_t enable_fairness :1; + uint8_t enable_full_duplex :1; + uint8_t enable_fast_posting :1; + uint8_t enable_target_mode :1; + uint8_t disable_initiator_mode :1; + uint8_t enable_adisc :1; + uint8_t enable_lun_response :1; /* bit 7 */ + uint8_t enable_port_update_event :1; + uint8_t disable_initial_lip :1; + uint8_t enable_decending_soft_assign :1; + uint8_t previous_assigned_addressing :1; + uint8_t enable_stop_q_on_full :1; + uint8_t enable_full_login_on_lip :1; + uint8_t enable_name_change :1; + uint8_t expanded_ifwcb :1; /* bit 15 */ + }firmware_options; + uint16_t frame_length; + uint16_t iocb_allocation; + uint16_t execution_throttle; + uint8_t retry_count; + uint8_t retry_delay; +#ifdef ISP2200 + uint8_t port_name[8]; +#else + uint8_t node_name[8]; +#endif + uint16_t adapter_hard_loop_id; + uint8_t inquiry_data; + uint8_t login_timeout; +#ifdef ISP2200 + uint8_t node_name[8]; +#else + uint8_t reserved_1[8]; +#endif + uint16_t request_q_outpointer; + uint16_t response_q_inpointer; + uint16_t request_q_length; + uint16_t response_q_length; + uint32_t request_q_address[2]; + uint32_t response_q_address[2]; + uint16_t lun_enables; + uint8_t command_resource_count; + uint8_t immediate_notify_resource_count; + uint16_t timeout; + uint16_t reserved_2; + struct + { + uint8_t operation_mode :4; /* Bits 0 1 2 3 */ + uint8_t connection_options :3; /* Bits 4 5 6 */ + #define LOOP 0 + #define P2P 1 + #define LOOP_P2P 2 + #define P2P_LOOP 3 + uint8_t nonpart_if_hard_addr_failed :1; /* Bit 7 */ + uint8_t enable_class2 :1; /* Bit 8 */ + uint8_t enable_ack0 :1; /* Bit 9 */ + uint8_t unused_10 :1; /* bit 10 */ + uint8_t unused_11 :1; /* bit 11 */ + uint8_t enable_fc_tape :1; /* bit 12 */ + uint8_t enable_fc_confirm :1; /* bit 13 */ + uint8_t enable_cmd_q_target_mode :1; /* bit 14 */ + uint8_t unused_15 :1; /* bit 15 */ + }additional_firmware_options; + uint8_t response_accum_timer; + uint8_t interrupt_delay_timer; + struct + { + uint8_t enable_read_xfr_rdy :1; /* Bit 0 */ + uint8_t soft_id_only :1; /* Bit 1 */ + uint8_t unused_2 :1; /* Bit 2 */ + uint8_t unused_3 :1; /* Bit 3 */ + uint8_t fcp_rsp_payload :2; /* Bits 4 5 */ + #define send_24_bytes_0 0 + #define send_12_bytes_0 1 + #define second_send_24_bytes_0 2 + #define send_32_bytes_0 3 + uint8_t unused_6 :1; /* Bit 6 */ + uint8_t unused_7 :1; /* Bit 7 */ + uint8_t unused_8 :1; /* Bit 8 */ + uint8_t unused_9 :1; /* Bit 9 */ + uint8_t unused_10 :1; /* Bit 10 */ + uint8_t unused_11 :1; /* Bit 11 */ + uint8_t unused_12 :1; /* Bit 12 */ + uint8_t set_50_ohms_term_enable :1; /* Bit 13 */ + uint8_t data_rate :2; /* Bits 14 15 */ + #define set_1_gig_rate 0 + #define set_2_gig_rate 1 + #define auto_negotiate 2 + }special_options; + uint16_t reserved_3[13]; +}init_cb_t; + +/* + * ISP Get/Set Target Parameters mailbox command control flags. + */ + +/* + * NVRAM Command values. + */ +#define NV_START_BIT BIT_2 +#define NV_WRITE_OP (BIT_26+BIT_24) +#define NV_READ_OP (BIT_26+BIT_25) +#define NV_ERASE_OP (BIT_26+BIT_25+BIT_24) +#define NV_MASK_OP (BIT_26+BIT_25+BIT_24) +#define NV_DELAY_COUNT 10 + +/* + * ISP2200 NVRAM structure definitions. + */ +typedef struct +{ + /* + * NVRAM header + */ + + uint8_t id[4]; + uint8_t nvram_version; + uint8_t reserved_0; + + /* + * NVRAM RISC parameter block + */ + + uint8_t parameter_block_version; + uint8_t reserved_1; + + struct + { + uint8_t enable_hard_loop_id :1; + uint8_t enable_fairness :1; + uint8_t enable_full_duplex :1; + uint8_t enable_fast_posting :1; + uint8_t enable_target_mode :1; + uint8_t disable_initiator_mode :1; + uint8_t enable_adisc :1; + uint8_t enable_lun_response :1; + uint8_t enable_port_update_event :1; + uint8_t disable_initial_lip :1; + uint8_t enable_decending_soft_assign :1; + uint8_t previous_assigned_addressing :1; + uint8_t enable_stop_q_on_full :1; + uint8_t enable_full_login_on_lip :1; + uint8_t enable_name_change :1; + uint8_t expanded_ifwcb :1; + }firmware_options; + + uint16_t frame_payload_size; + uint16_t max_iocb_allocation; + uint16_t execution_throttle; + uint8_t retry_count; + uint8_t retry_delay; + uint8_t port_name[8]; + uint16_t adapter_hard_loop_id; + uint8_t inquiry_data; + uint8_t login_timeout; + + uint8_t node_name[8]; + + /* Expanded RISC parameter block */ + struct + { + uint8_t operation_mode :4; + uint8_t connection_options :3; + uint8_t nonpart_if_hard_addr_failed :1; + uint8_t enable_class2 :1; + uint8_t enable_ack0 :1; + uint8_t unused_10 :1; + uint8_t unused_11 :1; + uint8_t enable_fc_tape :1; + uint8_t enable_fc_confirm :1; + uint8_t enable_command_reference_num :1; + }additional_firmware_options; + + uint8_t response_accum_timer; + uint8_t interrupt_delay_timer; + uint16_t reserved_2[14]; + + /* + * NVRAM host parameter block + */ + + struct + { + uint8_t unused_0 :1; + uint8_t disable_bios :1; + uint8_t disable_luns :1; + uint8_t enable_selectable_boot :1; + uint8_t disable_risc_code_load :1; + uint8_t set_cache_line_size_1 :1; + uint8_t pci_parity_disable :1; + uint8_t enable_extended_logging :1; + uint8_t enable_64bit_addressing :1; + uint8_t enable_lip_reset :1; + uint8_t enable_lip_full_login :1; + uint8_t enable_target_reset :1; + uint8_t enable_database_storage :1; + uint8_t unused_13 :1; + uint8_t unused_14 :1; + uint8_t unused_15 :1; + }host_p; + + uint8_t boot_node_name[8]; + uint8_t boot_lun_number; + uint8_t reset_delay; + uint8_t port_down_retry_count; + uint8_t reserved_3; + + uint16_t maximum_luns_per_target; + + uint16_t reserved_6[7]; + + /* Offset 100 */ + uint16_t reserved_7[25]; + + /* Offset 150 */ + uint16_t reserved_8[25]; + + /* Offset 200 */ + uint8_t oem_id; + + uint8_t oem_spare0; + + uint8_t oem_string[6]; + + uint8_t oem_part[8]; + + uint8_t oem_fru[8]; + + uint8_t oem_ec[8]; + + + /* Offset 232 */ + struct + { + uint8_t external_gbic :1; + uint8_t risc_ram_parity :1; + uint8_t buffer_plus_module :1; + uint8_t multi_chip_hba :1; + uint8_t unused_1 :1; + uint8_t unused_2 :1; + uint8_t unused_3 :1; + uint8_t unused_4 :1; + uint8_t unused_5 :1; + uint8_t unused_6 :1; + uint8_t unused_7 :1; + uint8_t unused_8 :1; + uint8_t unused_9 :1; + uint8_t unused_10 :1; + uint8_t unused_11 :1; + uint8_t unused_12 :1; + }hba_features; + + uint16_t reserved_9; + uint16_t reserved_10; + uint16_t reserved_11; + + uint16_t reserved_12; + uint16_t reserved_13; + + /* Subsystem ID must be at offset 244 */ + uint16_t subsystem_vendor_id; + + uint16_t reserved_14; + + /* Subsystem device ID must be at offset 248 */ + uint16_t subsystem_device_id; + + uint16_t reserved_15[2]; + uint8_t reserved_16; + uint8_t checksum; +}nvram22_t; + +typedef struct +{ + /* + * NVRAM header for 2100 board. + */ + + uint8_t id[4]; + uint8_t nvram_version; + uint8_t reserved_0; + + /* + * NVRAM RISC parameter block + */ + + uint8_t parameter_block_version; + uint8_t reserved_1; + + struct + { + uint8_t enable_hard_loop_id :1; + uint8_t enable_fairness :1; + uint8_t enable_full_duplex :1; + uint8_t enable_fast_posting :1; + uint8_t enable_target_mode :1; + uint8_t disable_initiator_mode :1; + uint8_t enable_adisc :1; + uint8_t enable_lun_response :1; + uint8_t enable_port_update_event :1; + uint8_t disable_initial_lip :1; + uint8_t enable_decending_soft_assign :1; + uint8_t previous_assigned_addressing :1; + uint8_t enable_stop_q_on_full :1; + uint8_t enable_full_login_on_lip :1; + uint8_t enable_name_change :1; + uint8_t unused_15 :1; + }firmware_options; + + uint16_t frame_payload_size; + uint16_t max_iocb_allocation; + uint16_t execution_throttle; + uint8_t retry_count; + uint8_t retry_delay; + uint8_t node_name[8]; + uint16_t adapter_hard_loop_id; + uint8_t reserved_2; + uint8_t login_timeout; + uint16_t reserved_3[4]; + + /* Reserved for expanded RISC parameter block */ + uint16_t reserved_4[16]; + + /* + * NVRAM host parameter block + */ + + struct + { + uint8_t unused_0 :1; + uint8_t disable_bios :1; + uint8_t disable_luns :1; + uint8_t enable_selectable_boot :1; + uint8_t disable_risc_code_load :1; + uint8_t set_cache_line_size_1 :1; + uint8_t pci_parity_disable :1; + uint8_t enable_extended_logging :1; + uint8_t enable_64bit_addressing :1; + uint8_t enable_lip_reset :1; + uint8_t enable_lip_full_login :1; + uint8_t enable_target_reset :1; + uint8_t enable_database_storage :1; + uint8_t unused_13 :1; + uint8_t unused_14 :1; + uint8_t unused_15 :1; + }host_p; + + uint8_t boot_node_name[8]; + uint8_t boot_lun_number; + uint8_t reset_delay; + uint8_t port_down_retry_count; + uint8_t reserved_5; + + uint16_t maximum_luns_per_target; + + uint16_t reserved_6[7]; + + /* Offset 100 */ + uint16_t reserved_7[25]; + + /* Offset 150 */ + uint16_t reserved_8[25]; + + /* Offset 200 */ + uint16_t reserved_9[22]; + + /* Subsystem ID must be at offset 244 */ + uint16_t subsystem_vendor_id; + + uint16_t reserved_10; + + /* Subsystem device ID must be at offset 248 */ + uint16_t subsystem_device_id; + + uint16_t reserved_11[2]; + uint8_t reserved_12; + uint8_t checksum; +}nvram21_t; + +/* + * ISP queue - command entry structure definition. + */ +#define MAX_CMDSZ 16 /* SCSI maximum CDB size. */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define COMMAND_TYPE 0x11 /* Command entry */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t handle; /* System handle. */ + uint8_t reserved; + uint8_t target; /* SCSI ID */ + uint16_t lun; /* SCSI LUN */ + uint16_t control_flags; /* Control flags. */ +#define CF_HEAD_TAG BIT_1 +#define CF_ORDERED_TAG BIT_2 +#define CF_SIMPLE_TAG BIT_3 +#define CF_READ BIT_5 +#define CF_WRITE BIT_6 +#define CF_NO_FAST_POSTING BIT_7 + uint16_t reserved_1; + uint16_t timeout; /* Command timeout. */ + uint16_t dseg_count; /* Data segment count. */ + uint8_t scsi_cdb[MAX_CMDSZ]; /* SCSI command words. */ + uint32_t byte_count; /* Total byte count. */ + uint32_t dseg_0_address; /* Data segment 0 address. */ + uint32_t dseg_0_length; /* Data segment 0 length. */ + uint32_t dseg_1_address; /* Data segment 1 address. */ + uint32_t dseg_1_length; /* Data segment 1 length. */ + uint32_t dseg_2_address; /* Data segment 2 address. */ + uint32_t dseg_2_length; /* Data segment 2 length. */ +}cmd_entry_t; + +/* + * ISP queue - 64-Bit addressing, command entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define COMMAND_A64_TYPE 0x19 /* Command A64 entry */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t handle; /* System handle. */ + uint8_t reserved; + uint8_t target; /* SCSI ID */ + uint16_t lun; /* SCSI LUN */ + uint16_t control_flags; /* Control flags. */ + uint16_t reserved_1; + uint16_t timeout; /* Command timeout. */ + uint16_t dseg_count; /* Data segment count. */ + uint8_t scsi_cdb[MAX_CMDSZ]; /* SCSI command words. */ + uint32_t byte_count; /* Total byte count. */ + uint32_t dseg_0_address[2]; /* Data segment 0 address. */ + uint32_t dseg_0_length; /* Data segment 0 length. */ + uint32_t dseg_1_address[2]; /* Data segment 1 address. */ + uint32_t dseg_1_length; /* Data segment 1 length. */ +}cmd_a64_entry_t, request_t; + +/* + * ISP queue - continuation entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define CONTINUE_TYPE 0x02 /* Continuation entry. */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t reserved; + uint32_t dseg_0_address; /* Data segment 0 address. */ + uint32_t dseg_0_length; /* Data segment 0 length. */ + uint32_t dseg_1_address; /* Data segment 1 address. */ + uint32_t dseg_1_length; /* Data segment 1 length. */ + uint32_t dseg_2_address; /* Data segment 2 address. */ + uint32_t dseg_2_length; /* Data segment 2 length. */ + uint32_t dseg_3_address; /* Data segment 3 address. */ + uint32_t dseg_3_length; /* Data segment 3 length. */ + uint32_t dseg_4_address; /* Data segment 4 address. */ + uint32_t dseg_4_length; /* Data segment 4 length. */ + uint32_t dseg_5_address; /* Data segment 5 address. */ + uint32_t dseg_5_length; /* Data segment 5 length. */ + uint32_t dseg_6_address; /* Data segment 6 address. */ + uint32_t dseg_6_length; /* Data segment 6 length. */ +}cont_entry_t; + +/* + * ISP queue - 64-Bit addressing, continuation entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define CONTINUE_A64_TYPE 0x0A /* Continuation A64 entry. */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t dseg_0_address[2]; /* Data segment 0 address. */ + uint32_t dseg_0_length; /* Data segment 0 length. */ + uint32_t dseg_1_address[2]; /* Data segment 1 address. */ + uint32_t dseg_1_length; /* Data segment 1 length. */ + uint32_t dseg_2_address[2]; /* Data segment 2 address. */ + uint32_t dseg_2_length; /* Data segment 2 length. */ + uint32_t dseg_3_address[2]; /* Data segment 3 address. */ + uint32_t dseg_3_length; /* Data segment 3 length. */ + uint32_t dseg_4_address[2]; /* Data segment 4 address. */ + uint32_t dseg_4_length; /* Data segment 4 length. */ +}cont_a64_entry_t; + +/* + * ISP queue - status entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define STATUS_TYPE 0x03 /* Status entry. */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + #define RF_INV_E_ORDER BIT_5 /* Invalid entry order. */ + #define RF_INV_E_COUNT BIT_4 /* Invalid entry count. */ + #define RF_INV_E_PARAM BIT_3 /* Invalid entry parameter. */ + #define RF_INV_E_TYPE BIT_2 /* Invalid entry type. */ + #define RF_BUSY BIT_1 /* Busy */ + uint32_t handle; /* System handle. */ + uint16_t scsi_status; /* SCSI status. */ + uint16_t comp_status; /* Completion status. */ + uint16_t state_flags; /* State flags. */ + uint16_t status_flags; /* Status flags. */ + #define IOCBSTAT_SF_LOGO 0x2000 /* logo after 2 abts w/ no response (2 sec) */ + uint16_t rsp_info_len; /* Response Info Length. */ + uint16_t req_sense_length; /* Request sense data length. */ + uint32_t residual_length; /* Residual transfer length. */ + uint8_t rsp_info[8]; /* FCP response information. */ + uint8_t req_sense_data[32]; /* Request sense data. */ +}sts_entry_t, response_t; + +/* + * ISP queue - marker entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define MARKER_TYPE 0x04 /* Marker entry. */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t sys_define_2; /* System defined. */ + uint8_t reserved; + uint8_t target; /* SCSI ID */ + uint8_t modifier; /* Modifier (7-0). */ + #define MK_SYNC_ID_LUN 0 /* Synchronize ID/LUN */ + #define MK_SYNC_ID 1 /* Synchronize ID */ + #define MK_SYNC_ALL 2 /* Synchronize all ID/LUN */ + #define MK_SYNC_LIP 3 /* Synchronize all ID/LUN, */ + /* clear port changed, */ + /* use sequence number. */ + uint8_t reserved_1; + uint16_t sequence_number; /* Sequence number of event */ + uint16_t lun; /* SCSI LUN */ + uint8_t reserved_2[48]; +}mrk_entry_t; + +/* + * ISP queue - enable LUN entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define ENABLE_LUN_TYPE 0x0B /* Enable LUN entry. */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t sys_define_2; /* System defined. */ + uint8_t reserved_8; + uint8_t reserved_1; + uint16_t reserved_2; + uint32_t reserved_3; + uint8_t status; + uint8_t reserved_4; + uint8_t command_count; /* Number of ATIOs allocated. */ + uint8_t immed_notify_count; /* Number of Immediate Notify */ + /* entries allocated. */ + uint16_t reserved_5; + uint16_t timeout; /* 0 = 30 seconds, 0xFFFF = disable */ + uint16_t reserved_6[20]; +}elun_entry_t; + +/* + * ISP queue - modify LUN entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define MODIFY_LUN_TYPE 0x0C /* Modify LUN entry. */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t sys_define_2; /* System defined. */ + uint8_t reserved_8; + uint8_t reserved_1; + uint8_t operators; + uint8_t reserved_2; + uint32_t reserved_3; + uint8_t status; + uint8_t reserved_4; + uint8_t command_count; /* Number of ATIOs allocated. */ + uint8_t immed_notify_count; /* Number of Immediate Notify */ + /* entries allocated. */ + uint16_t reserved_5; + uint16_t timeout; /* 0 = 30 seconds, 0xFFFF = disable */ + uint16_t reserved_7[20]; +}modify_lun_entry_t; + +/* + * ISP queue - immediate notify entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define IMMED_NOTIFY_TYPE 0x0D /* Immediate notify entry. */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t sys_define_2; /* System defined. */ + uint8_t reserved_8; + uint8_t initiator_id; + uint8_t reserved_1; + uint8_t target_id; + uint32_t reserved_2; + uint16_t status; + uint16_t task_flags; + uint16_t seq_id; + uint16_t reserved_5[11]; + uint16_t scsi_status; + uint8_t sense_data[18]; +}notify_entry_t; + +/* + * ISP queue - notify acknowledge entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define NOTIFY_ACK_TYPE 0x0E /* Notify acknowledge entry. */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t sys_define_2; /* System defined. */ + uint8_t reserved_8; + uint8_t initiator_id; + uint8_t reserved_1; + uint8_t target_id; + uint16_t flags; + uint16_t reserved_2; + uint16_t status; + uint16_t task_flags; + uint16_t seq_id; + uint16_t reserved_3[21]; +}nack_entry_t; + +/* + * ISP queue - Accept Target I/O (ATIO) entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define ACCEPT_TGT_IO_TYPE 0x16 /* Accept target I/O entry. */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t sys_define_2; /* System defined. */ + uint8_t reserved_8; + uint8_t initiator_id; + uint16_t exchange_id; + uint16_t flags; + uint16_t status; + uint8_t reserved_1; + uint8_t task_codes; + uint8_t task_flags; + uint8_t execution_codes; + uint8_t cdb[MAX_CMDSZ]; + uint32_t data_length; + uint16_t lun; + uint16_t reserved_2A; + uint16_t scsi_status; + uint8_t sense_data[18]; +}atio_entry_t; + +/* + * ISP queue - Continue Target I/O (CTIO) entry for status mode 0 + * structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define CONTINUE_TGT_IO_TYPE 0x17 /* CTIO entry */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t sys_define_2; /* System defined. */ + uint8_t reserved_8; + uint8_t initiator_id; + uint16_t exchange_id; + uint16_t flags; + uint16_t status; + uint16_t timeout; /* 0 = 30 seconds, 0xFFFF = disable */ + uint16_t dseg_count; /* Data segment count. */ + uint32_t relative_offset; + uint32_t residual; + uint16_t reserved_1[3]; + uint16_t scsi_status; + uint32_t transfer_length; + uint32_t dseg_0_address; /* Data segment 0 address. */ + uint32_t dseg_0_length; /* Data segment 0 length. */ + uint32_t dseg_1_address; /* Data segment 1 address. */ + uint32_t dseg_1_length; /* Data segment 1 length. */ + uint32_t dseg_2_address; /* Data segment 2 address. */ + uint32_t dseg_2_length; /* Data segment 2 length. */ +}ctio_entry_t; + +/* + * ISP queue - CTIO returned entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define CTIO_RET_TYPE 0x17 /* CTIO return entry */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t sys_define_2; /* System defined. */ + uint8_t reserved_8; + uint8_t initiator_id; + uint16_t exchange_id; + uint16_t flags; + uint16_t status; + uint16_t timeout; /* 0 = 30 seconds, 0xFFFF = disable */ + uint16_t dseg_count; /* Data segment count. */ + uint32_t relative_offset; + uint32_t residual; + uint16_t reserved_1[8]; + uint16_t scsi_status; + uint8_t sense_data[18]; +}ctio_ret_entry_t; + +/* + * ISP queue - CTIO A64 entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define CTIO_A64_TYPE 0x1F /* CTIO A64 entry */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t sys_define_2; /* System defined. */ + uint8_t reserved_8; + uint8_t initiator_id; + uint16_t exchange_id; + uint16_t flags; + uint16_t status; + uint16_t timeout; /* 0 = 30 seconds, 0xFFFF = disable */ + uint16_t dseg_count; /* Data segment count. */ + uint32_t relative_offset; + uint32_t residual; + uint16_t reserved_1[3]; + uint16_t scsi_status; + uint32_t transfer_length; + uint32_t dseg_0_address[2]; /* Data segment 0 address. */ + uint32_t dseg_0_length; /* Data segment 0 length. */ + uint32_t dseg_1_address[2]; /* Data segment 1 address. */ + uint32_t dseg_1_length; /* Data segment 1 length. */ +}ctio_a64_entry_t; + +/* + * ISP queue - CTIO returned entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define CTIO_A64_RET_TYPE 0x1F /* CTIO A64 returned entry */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t sys_define_2; /* System defined. */ + uint8_t reserved_8; + uint8_t initiator_id; + uint16_t exchange_id; + uint16_t flags; + uint16_t status; + uint16_t timeout; /* 0 = 30 seconds, 0xFFFF = disable */ + uint16_t dseg_count; /* Data segment count. */ + uint32_t relative_offset; + uint32_t residual; + uint16_t reserved_1[8]; + uint16_t scsi_status; + uint8_t sense_data[18]; +}ctio_a64_ret_entry_t; + +/* + * ISP queue - Status Contination entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define STATUS_CONT_TYPE 0x10 /* Status contination entry */ + uint8_t entry_count; /* Entry count. */ + uint8_t reserved; + uint8_t entry_status; /* Entry Status. */ + uint8_t sense_data[60]; +}status_cont_entry_t; + +/* + * ISP queue - Command Set entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define CMD_SET_TYPE 0x18 /* Command set entry */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t sys_define_2; /* System defined. */ + uint16_t reserved; + uint16_t status; + uint16_t control_flags; /* Control flags. */ + uint16_t count; + uint32_t iocb_0_address; + uint32_t iocb_1_address; + uint32_t iocb_2_address; + uint32_t iocb_3_address; + uint32_t iocb_4_address; + uint32_t iocb_5_address; + uint32_t iocb_6_address; + uint32_t iocb_7_address; + uint32_t iocb_8_address; + uint32_t iocb_9_address; + uint32_t iocb_10_address; + uint32_t iocb_11_address; +}cmd_set_entry_t; + +/* + * ISP queue - Command Set A64 entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define CMD_SET_TYPE 0x18 /* Command set entry */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t sys_define_2; /* System defined. */ + uint16_t reserved; + uint16_t status; + uint16_t control_flags; /* Control flags. */ + uint16_t count; + uint32_t iocb_0_address[2]; + uint32_t iocb_1_address[2]; + uint32_t iocb_2_address[2]; + uint32_t iocb_3_address[2]; + uint32_t iocb_4_address[2]; + uint32_t iocb_5_address[2]; +}cmd_set_a64_entry_t; + +/* 4.11 + * ISP queue - Command Set entry structure definition. + */ +typedef struct +{ + uint8_t entry_type; /* Entry type. */ + #define MS_IOCB_TYPE 0x29 /* Management Server IOCB entry */ + uint8_t entry_count; /* Entry count. */ + uint8_t sys_define; /* System defined. */ + uint8_t entry_status; /* Entry Status. */ + uint32_t handle; /* System handle. */ + uint8_t reserved; + uint8_t loop_id; + uint16_t status; + uint16_t control_flags; /* Control flags. */ + uint16_t reserved2; + uint16_t timeout; + uint16_t DSDcount; + uint16_t RespDSDcount; + uint8_t reserved3[10]; + uint32_t Response_bytecount; + uint32_t Request_bytecount; + uint32_t dseg_req_address[2]; /* Data segment 0 address. */ + uint32_t dseg_req_length; /* Data segment 0 length. */ + uint32_t dseg_rsp_address[2]; /* Data segment 1 address. */ + uint32_t dseg_rsp_length; /* Data segment 1 length. */ +}cmd_ms_iocb_entry_t; + + +/* + * ISP request and response queue entry sizes + */ +#define RESPONSE_ENTRY_SIZE (sizeof(response_t)) +#define REQUEST_ENTRY_SIZE (sizeof(request_t)) + +/* + * ISP status entry - completion status definitions. + */ +#define CS_COMPLETE 0x0 /* No errors */ +#define CS_INCOMPLETE 0x1 /* Incomplete transfer of cmd. */ +#define CS_DMA 0x2 /* A DMA direction error. */ +#define CS_TRANSPORT 0x3 /* Transport error. */ +#define CS_RESET 0x4 /* SCSI bus reset occurred */ +#define CS_ABORTED 0x5 /* System aborted command. */ +#define CS_TIMEOUT 0x6 /* Timeout error. */ +#define CS_DATA_OVERRUN 0x7 /* Data overrun. */ +#define CS_DATA_UNDERRUN 0x15 /* Data Underrun. */ +#define CS_ABORT_MSG 0xE /* Target rejected abort msg. */ +#define CS_DEV_RESET_MSG 0x12 /* Target rejected dev rst msg. */ +#define CS_PORT_UNAVAILABLE 0x28 /* Port unavailable (selection timeout) */ +#define CS_PORT_LOGGED_OUT 0x29 /* Port Logged Out */ +#define CS_PORT_CONFIG_CHG 0x2A /* Port Configuration Changed */ +#define CS_PORT_BUSY 0x2B /* Port Busy */ +#define CS_BAD_PAYLOAD 0x80 /* Driver defined */ +#define CS_UNKNOWN 0x81 /* Driver defined */ +#define CS_RETRY 0x82 /* Driver defined */ + +/* + * ISP status entry - SCSI status byte bit definitions. + */ +#define SS_RESIDUAL_UNDER BIT_11 +#define SS_RESIDUAL_OVER BIT_10 +#define SS_SENSE_LEN_VALID BIT_9 +#ifdef ISP2200 +#define SS_RESPONSE_INFO_LEN_VALID BIT_8 +#else +#define SS_RESIDUAL_LEN_VALID BIT_8 +#endif + +#define SS_RESERVE_CONFLICT (BIT_4 | BIT_3) +#define SS_BUSY_CONDITION BIT_3 +#define SS_CONDITION_MET BIT_2 +#define SS_CHECK_CONDITION BIT_1 + +/* + * ISP target entries - Flags bit definitions. + */ +#define OF_RESET BIT_5 /* Reset LIP flag */ +#define OF_DATA_IN BIT_6 /* Data in to initiator */ + /* (data from target to initiator) */ +#define OF_DATA_OUT BIT_7 /* Data out from initiator */ + /* (data from initiator to target) */ +#define OF_NO_DATA (BIT_7 | BIT_6) +#define OF_INC_RC BIT_8 /* Increment command resource count */ +#define OF_FAST_POST BIT_9 /* Enable mailbox fast posting. */ +#define OF_SSTS BIT_15 /* Send SCSI status */ + +/* + * Target Read/Write buffer structure. + */ +#define TARGET_DATA_OFFSET 4 +#define TARGET_DATA_SIZE 0x2000 /* 8K */ +#define TARGET_INQ_OFFSET (TARGET_DATA_OFFSET + TARGET_DATA_SIZE) +#define TARGET_SENSE_SIZE 18 +#define TARGET_BUF_SIZE 36 + +#if QL1280_TARGET_MODE_SUPPORT +typedef struct +{ + uint8_t hdr[4]; + uint8_t data[TARGET_DATA_SIZE]; +}tgt_buf_t; +#endif /* QL1280_TARGET_MODE_SUPPORT */ +typedef struct +{ + uint16_t loop_id; +#ifdef QL_MAPPED_TARGETS + uint16_t lun_offset; +#endif + uint32_t down_timer; + scsi_lu_t *luns[MAX_LUNS]; +}tgt_t; + +/* + * 24 bit port ID type definition. + */ +typedef union { + struct { + uint8_t port_id[3]; + uint8_t rsvd_1; + }r; +#if defined(_BIT_FIELDS_LTOH) + uint32_t b24 : 24, + rsvd : 8; + struct { + uint8_t al_pa; + uint8_t area; + uint8_t domain; + uint8_t rsvd_1; + }b; +#else + uint32_t rsvd : 8, + b24 : 24; + struct { + uint8_t domain; + uint8_t area; + uint8_t al_pa; + uint8_t rsvd_1; + }b; +#endif +} port_id_t; + + +typedef struct +{ + uint8_t name[8]; /* big endian node name */ + uint8_t wwn[8]; /* big endian port name */ + uint16_t loop_id; + uint8_t port_id[3]; /* 24-bit port ID */ + uint8_t rsvd_1; + /* + * This is used to retry login for devices specified for + * persistent binding or lost devices. + */ + uint8_t port_login_retry_count; + uint8_t port_timer; + uint16_t flag; + uint32_t mask[8]; /* LUN Mask for this Device */ + /* flags bits defined as follows */ +#define DEV_PUBLIC BIT_0 +#define DEV_OFFLINE BIT_1 +#define DEV_LUNMASK_SET BIT_2 /* some LUNs masked for this device */ +#define DEV_MP_DISABLED BIT_3 /* device disabled for qlmultipath */ +#define DEV_TAPE_DEVICE BIT_4 +#define DEV_CONFIGURED BIT_5 +#define DEV_MISSING BIT_6 +#define DEV_RETURN BIT_7 +#define DEV_HOST BIT_8 +#define DEV_RELOGIN BIT_9 +#define DEV_PORT_DOWN BIT_10 +}fcdev_t; + + +typedef struct +{ + uint8_t in_use; +}fabricid_t; + +/* + * Flash Database structures. + */ +#define FLASH_DATABASE_0 0x1c000 +#define FLASH_DATABASE_1 0x18000 +#define FLASH_DATABASE_VERSION 1 + +typedef struct +{ + uint32_t seq; + uint8_t version; + uint8_t checksum; + uint16_t size; + uint8_t spares[8]; +}flash_hdr_t; + +typedef struct +{ + uint32_t name[2]; + uint8_t spares[8]; +}flash_node_t; + +typedef struct +{ + flash_hdr_t hdr; + flash_node_t node[MAX_FIBRE_DEVICES]; +}flash_database_t; + +/* + * SNS structures. + */ +#define SNS_DATA_SIZE 608 + +typedef struct +{ + uint16_t buffer_length; + uint16_t reserved; + uint32_t buffer_address[2]; + uint16_t subcommand_length; + uint16_t reserved_1; +}sns_hdr_t; + +typedef struct +{ + union + { + struct + { + sns_hdr_t hdr; + uint16_t subcommand; + uint8_t param[SNS_DATA_SIZE - sizeof(sns_hdr_t) - 2]; + }req; + + uint8_t rsp[SNS_DATA_SIZE]; + }p; +}sns_data_t; + +/* + * SNS request/response structures for GP_IDNN. + */ +typedef struct +{ + uint8_t controlbyte; + uint8_t port_id[3]; + uint32_t reserved; + uint8_t nodename[8]; +}port_data_t; + +#ifdef ISP2200 +#define GP_IDNN_LENGTH (256 * sizeof(port_data_t)) + 16 +#else +#define GP_IDNN_LENGTH (126 * sizeof(port_data_t)) + 16 +#endif + +typedef union +{ + struct + { + uint16_t buffer_length; + uint16_t reserved; + uint32_t buffer_address[2]; + uint16_t subcommand_length; + uint16_t reserved_1; + uint16_t subcommand; + uint16_t length; + uint32_t reserved2; + uint32_t protocol; + uint8_t param[GP_IDNN_LENGTH - 28]; + }req; + + struct + { + uint8_t revision; + uint8_t inid[3]; + uint8_t fcstype; + uint8_t subtype; + uint8_t options; + uint8_t reserved; + uint16_t response; + uint16_t residual; + uint8_t reserved1; + uint8_t reason_code; + uint8_t explanation_code; + uint8_t vendor_unique; +#ifdef ISP2200 + port_data_t port_data[256]; +#else + port_data_t port_data[126]; +#endif + }rsp; + +}gp_idnn_t; + +#ifdef ISP2200 +#define GN_LIST_LENGTH 256 * sizeof(port_list_entry_t) +#else +#define GN_LIST_LENGTH 126 * sizeof(port_list_entry_t) +#endif +/* + * Structure used in Get Port List mailbox command (0x75). + */ +typedef struct +{ + uint8_t name[8]; + uint16_t loop_id; +}port_list_entry_t; + +/* + * Structure used for device info. + */ +typedef struct +{ + uint8_t name[8]; /* big endian node name */ + uint8_t wwn[8]; /* big endian port name */ + uint16_t loop_id; + uint8_t port_id[3]; +}device_data_t; + +/* + * Port Database structure definition + * Little endian except where noted. + */ +#define PORT_DATABASE_SIZE 128 /* bytes */ +typedef struct { + uint8_t options; + uint8_t control; + uint8_t master_state; + uint8_t slave_state; +#define PD_STATE_DISCOVERY 0 +#define PD_STATE_WAIT_DISCOVERY_ACK 1 +#define PD_STATE_PORT_LOGIN 2 +#define PD_STATE_WAIT_PORT_LOGIN_ACK 3 +#define PD_STATE_PROCESS_LOGIN 4 +#define PD_STATE_WAIT_PROCESS_LOGIN_ACK 5 +#define PD_STATE_PORT_LOGGED_IN 6 +#define PD_STATE_PORT_UNAVAILABLE 7 +#define PD_STATE_PROCESS_LOGOUT 8 +#define PD_STATE_WAIT_PROCESS_LOGOUT_ACK 9 +#define PD_STATE_PORT_LOGOUT 10 +#define PD_STATE_WAIT_PORT_LOGOUT_ACK 11 + uint8_t reserved[2]; + uint8_t hard_address; + uint8_t reserved_1; + uint8_t port_id[4]; + uint8_t node_name[8]; /* Big endian. */ + uint8_t port_name[8]; /* Big endian. */ + uint16_t execution_throttle; + uint16_t execution_count; + uint8_t reset_count; + uint8_t reserved_2; + uint16_t resource_allocation; + uint16_t current_allocation; + uint16_t queue_head; + uint16_t queue_tail; + uint16_t transmit_execution_list_next; + uint16_t transmit_execution_list_previous; + uint16_t common_features; + uint16_t total_concurrent_sequences; + uint16_t RO_by_information_category; + uint8_t recipient; + uint8_t initiator; + uint16_t receive_data_size; + uint16_t concurrent_sequences; + uint16_t open_sequences_per_exchange; + uint16_t lun_abort_flags; + uint16_t lun_stop_flags; + uint16_t stop_queue_head; + uint16_t stop_queue_tail; + uint16_t port_retry_timer; + uint16_t next_sequence_id; + uint16_t frame_count; + uint16_t PRLI_payload_length; + uint8_t prli_svc_param_word_0[2]; /* Big endian */ + /* Bits 15-0 of word 0 */ + uint8_t prli_svc_param_word_3[2]; /* Big endian */ + /* Bits 15-0 of word 3 */ + uint16_t loop_id; + uint16_t extended_lun_info_list_pointer; + uint16_t extended_lun_stop_list_pointer; +} port_database_t; + + + +/* + * Registered State Change Notification structures. + */ +typedef struct { + port_id_t d_id; + uint8_t format; +} rscn_t; + + + +#ifdef FC_IP_SUPPORT +/* + * Definitions for IP support + */ +#define LOOP_ID_MASK 0x00FF +#define PLE_NOT_SCSI_DEVICE 0x8000 /* Upper bit of loop ID set if not SCSI */ + +/* Firmware IP initialization control block definitions */ +typedef struct _IPInitBlock +{ + uint8_t cVersion; + uint8_t cReserved1; + uint16_t wIpFirmwareOptions; + uint16_t wIpHeaderSize; + uint16_t wIpMTUSize; + uint16_t wIpBufferSize; + uint16_t wReserved2; + uint16_t wReserved3; + uint16_t wReserved4; + uint16_t wReserved5; + uint16_t wIpQueueSize; + uint16_t wIpLowWaterMark; + uint16_t wIpQueueAddr[4]; + uint16_t wIpQueueInPointer; + uint16_t wIpFastPostCount; + uint16_t wIpBufferContainerCount; + uint16_t wIpIocbResourceAllocation; +} IP_INIT_BLOCK, *PIP_INIT_BLOCK; + +#define IPIB_VERSION 0x01 +#define IPIB_LOW_WATER_MARK 0 +#define IPIB_FAST_POST_COUNT 4 +#define IPIB_BUFFER_CONTAINER_COUNT 64 +#define IPIB_IOCB_RESERVE_COUNT 250 + +/* IP firmware options */ +#define IPIB_OPTION_64BIT_ADDRESSING 0x0001 +#define IPIB_OPTION_NO_BROADCAST_FASTPOST 0x0002 +#define IPIB_OPTION_OUT_OF_BUFFERS_EVENT 0x0004 + +/* IP device data structure */ +typedef struct _IpDeviceBlock +{ + uint32_t lDeviceFlags; + uint16_t wLoopId; + uint16_t wUnused1; + uint8_t acWorldWideName[8]; + uint8_t acPortId[3]; + uint8_t cUnused2; + struct _IpDeviceBlock *pNextIpDevice; + struct _IpDeviceBlock *pLastIpDevice; + uint32_t lUnused3; +} IP_DEVICE_BLOCK, *PIP_DEVICE_BLOCK; + +#define IP_DEV_FLAG_PRESENT 0x00000001 +#define IP_DEV_FLAG_PUBLIC_DEVICE 0x00000002 + +#define PUBLIC_LOOP_DEVICE ((uint16_t)-1) + +/* Maximum number of IP connections */ +#define QLLAN_MAX_IP_DEVICES 64 + +/* IP IOCB types */ +#define ET_IP_COMMAND_32 0x13 +#define ET_IP_COMMAND_64 0x1B +#define ET_IP_RECEIVE 0x23 +#define ET_IP_RECEIVE_CONTINUATION 0x2B +#define ET_IP_FARP_REQUEST 0x30 + +/* Data segment descriptor structures */ +typedef struct +{ + uint32_t lBase; + uint32_t lCount; +} DATA_SEG; + +typedef struct +{ + uint32_t lBase[2]; + uint32_t lCount; +} DATA_SEG_A64; + +/* IP Command IOCB structure */ +typedef struct _IpCommandEntry +{ + uint32_t lHeader; + uint32_t lHandle; + uint8_t cReserved1; + uint8_t cLoopId; + uint16_t wCompletionStatus; + uint16_t wControlFlags; + uint16_t wReserved2; + uint16_t wTimeout; + uint16_t wSegmentCount; + uint16_t wServiceClass; + uint16_t wReserved3[7]; + uint32_t lTotalByteCount; + union + { + DATA_SEG asDataSeg[3]; + DATA_SEG_A64 asDataSeg64[2]; + } ds; +} IP_COMMAND_ENTRY, *PIP_COMMAND_ENTRY; + +/* IP Receive IOCB structure */ +#define IP_RECEIVE_ENTRY_MAX_HANDLES 24 +typedef struct _IpReceiveEntry +{ + uint8_t cEntryType; + uint8_t cEntryCount; + uint8_t cSegmentCount; + uint8_t cEntryStatus; + uint16_t wS_IDLow; + uint8_t cS_IDHigh; + uint8_t cReserved1; + uint8_t cReserved2; + uint8_t cLoopId; + uint16_t wCompletionStatus; + uint16_t wServiceClass; + uint16_t wSequenseLength; + uint16_t waBufferHandle[IP_RECEIVE_ENTRY_MAX_HANDLES]; +} IP_RECEIVE_ENTRY, *PIP_RECEIVE_ENTRY; + +/* IP Receive IOCB completion status bits */ +#define IP_REC_STATUS_SPLIT_BUFFER 0x0001 + +/* IP FARP Request IOCB structure */ +typedef struct _IpFarpRequestEntry +{ + uint8_t cEntryType; + uint8_t cEntryCount; + uint8_t cReserved1; + uint8_t cEntryStatus; + uint16_t wRequesterPortIdLow; + uint8_t cRequesterPortIdHigh; + uint8_t cReserved2; + uint8_t acRequesterPortName[8]; +} IP_FARP_REQUEST_ENTRY, *PIP_FARP_REQUEST_ENTRY; + +/* IP mailbox commands */ +#define MBC_INITIALIZE_IP 0x0077 +#define MBC_SEND_FARP_REQUEST 0x0078 + +/* Fabric login mailbox command option bits */ +#define MBC_NO_PLOGI_IF_LOGGED_IN 0x01 +#define MBC_NO_PROCESS_LOGIN 0x02 + +/* Mailbox command completion status */ +#define MBS_PORT_ID_IN_USE 0x4007 +#define MBS_LOOP_ID_IN_USE 0x4008 +#define MBS_ALL_LOOP_IDS_IN_USE 0x4009 +#define MBS_NAME_SERVER_NOT_LOGGED_IN 0x400A + +/* IP async events */ +#define MBA_IP_TRANSMIT_COMPLETE 0x8022 +#define MBA_IP_RECEIVE_COMPLETE 0x8023 +#define MBA_IP_BROADCAST_RECEIVED 0x8024 +#define MBA_IP_RECEIVE_BUFFERS_LOW 0x8025 +#define MBA_IP_OUT_OF_BUFFERS 0x8026 +#define MBA_IP_RECEIVE_COMPLETE_SPLIT 0x8027 + +/* FARP request payload structure */ +typedef struct _IpSendFarpPayload +{ + uint8_t cMatchAddressCode; + uint8_t acReserved1[3]; + uint8_t cResponderFlags; + uint8_t acReserved2[3]; + uint8_t acRequesterPortName[8]; + uint8_t acRequesterNodeName[8]; + uint8_t acResponderPortName[8]; + uint8_t acResponderNodeName[8]; +} IP_SEND_FARP_PAYLOAD, *PIP_SEND_FARP_PAYLOAD; + +#define IP_FARP_MATCH_PORTNAME 0x01 +#define IP_FARP_REQUEST_LOGIN 0x01 +#else +/* Fabric login mailbox command option bits */ +#define MBC_NO_PLOGI_IF_LOGGED_IN 0x01 +#define MBC_NO_PROCESS_LOGIN 0x02 + +/* Mailbox command completion status */ +#define MBS_PORT_ID_IN_USE 0x4007 +#define MBS_LOOP_ID_IN_USE 0x4008 +#define MBS_ALL_LOOP_IDS_IN_USE 0x4009 +#define MBS_NAME_SERVER_NOT_LOGGED_IN 0x400A + +#endif /* FC_IP_SUPPORT */ + +/* + * Linux Host Adapter structure + */ +typedef struct scsi_qla_host +{ + /* ISP ring lock, rings, and indexes */ + request_t req[REQUEST_ENTRY_CNT+1]; + response_t res[RESPONSE_ENTRY_CNT+1]; + + /* Linux adapter configuration data */ + struct Scsi_Host *host; /* pointer to host data */ + struct scsi_qla_host *next; + device_reg_t *iobase; /* Base Memory-mapped or I/O address */ + device2300_reg_t *iobase2300;/* Base Memory-mapped or I/O address */ + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95) + struct pci_dev *pdev; +#endif + uint8_t pci_bus; + uint8_t pci_device_fn; + uint8_t devnum; + volatile unsigned char *mmpbase; /* memory mapped address */ + u_long host_no; + u_long instance; + uint8_t revision; + uint8_t ports; + u_long actthreads; + u_long qthreads; + u_long isr_count; /* Interrupt count */ + u_long isp_aborts; + u_long lip_count; + u_long spurious_int; + uint32_t device_id; + + /* ISP connection configuration data */ + uint16_t max_public_loop_ids; + uint16_t min_external_loopid; /* First external loop Id */ + uint8_t current_topology; /* Current ISP configuration */ + uint8_t prev_topology; /* Previous ISP configuration */ +#define ISP_CFG_NL 1 +#define ISP_CFG_N 2 +#define ISP_CFG_FL 4 +#define ISP_CFG_F 8 + + uint8_t id; /* Host adapter SCSI id */ + uint16_t loop_id; /* Host adapter loop id */ + uint8_t port_id[3]; /* Host adapter port id */ + uint8_t operating_mode; /* current F/W operating connection mode */ + /* 0 - LOOP, 1 - P2P, 2 - LOOP_P2P, + * 3 - P2P_LOOP + */ + + /* NVRAM configuration data */ + uint16_t loop_reset_delay; /* Loop reset delay. */ + uint16_t hiwat; /* High water mark per device. */ + uint16_t execution_throttle; /* queue depth */ + uint16_t minimum_timeout; /* Minimum timeout. */ + uint8_t retry_count; + uint8_t login_timeout; + uint8_t port_down_retry_count; + uint8_t loop_down_timeout; + uint16_t max_luns; + uint16_t max_targets; + + /* Device TGT/LUN queues. */ + tgt_t *tgt[MAX_BUSES][MAX_FIBRE_DEVICES]; /* Logical unit queues */ + + /* Interrupt lock, and data */ + + /* Fibre Channel Device Database and LIP sequence. */ + fcdev_t fc_db[MAX_FIBRE_DEVICES]; /* Driver database. */ + uint32_t flash_db; /* Flash database address in use. */ + fabricid_t fabricid[MAX_FIBRE_DEVICES]; /* Fabric ids table . */ + uint32_t flash_seq; /* Flash database seq # in use. */ + volatile uint16_t lip_seq; /* LIP sequence number. */ + + /* Linux bottom half run queue */ + struct tq_struct run_qla_bh; + + /* Linux kernel thread */ + struct task_struct *dpc_handler; /* kernel thread */ + struct semaphore *dpc_wait; /* DPC waits on this semaphore */ + struct semaphore *dpc_notify; /* requester waits for DPC on this + * semaphore + */ + uint8_t dpc_active; /* DPC routine is active */ + + /* Received ISP mailbox data. */ + volatile uint16_t mailbox_out[MAILBOX_REGISTER_COUNT]; + + /* Outstandings ISP commands. */ + srb_t *outstanding_cmds[MAX_OUTSTANDING_COMMANDS]; + +#if BITS_PER_LONG > 32 + uint64_t request_dma; /* Physical address. */ +#else + uint32_t request_dma; /* Physical address. */ +#endif + request_t *request_ring; /* Base virtual address */ + request_t *request_ring_ptr; /* Current address. */ + uint16_t req_ring_index; /* Current index. */ + uint16_t req_q_cnt; /* Number of available entries. */ + +#if BITS_PER_LONG > 32 + uint64_t response_dma; /* Physical address. */ +#else + uint32_t response_dma; /* Physical address. */ +#endif + response_t *response_ring; /* Base virtual address */ + response_t *response_ring_ptr; /* Current address. */ + uint16_t rsp_ring_index; /* Current index. */ + +#if QL2X00_TARGET_MODE_SUPPORT + /* Target buffer and sense data. */ + u_long tbuf_dma; /* Physical address. */ + tgt_buf_t *tbuf; + u_long tsense_dma; /* Physical address. */ + uint8_t *tsense; +#endif + +#ifdef FC_IP_SUPPORT + /* Data for IP support */ + uint8_t acPortName[8]; + IP_BUFFER_ENTRY asIpBuffers[IP_BUFFER_QUEUE_DEPTH]; + uint32_t ppIpBufferQueueLow; + uint32_t ppIpBufferQueueHigh; + IP_BUFFER_ENTRY *pIpBufferQueue; + uint16_t wIpBufferIn; + uint16_t wIpBufferOut; + uint32_t lMaximumTransferSize; + uint32_t lReceiveBufferSize; + uint16_t wReceiveBufferCount; + uint16_t wHeaderSize; + PSEND_COMPLETION_CALLBACK pSendCompletionRoutine; + PRECEIVE_PACKETS_CALLBACK pReturnReceivePacketsRoutine; + void *pReturnReceivePacketsContext; + PNOTIFY_CALLBACK pNotifyRoutine; + void *pNotifyContext; + BUFFER_CB *pReceiveBufferCBs; + IP_DEVICE_BLOCK asIpDeviceDatabase[QLLAN_MAX_IP_DEVICES]; + IP_DEVICE_BLOCK *pIpDeviceFree; + IP_DEVICE_BLOCK *pIpDeviceTop; + IP_DEVICE_BLOCK *pIpDeviceBottom; + uint32_t lCurrentTagIndex; + void *apActiveIpQueue[MAX_SEND_PACKETS]; +#endif + + /* Firmware Initialization Control Block data */ +#if BITS_PER_LONG > 32 + uint64_t init_cb_dma; /* Physical address. */ +#else + uint32_t init_cb_dma; /* Physical address. */ +#endif + init_cb_t *init_cb; + + /* Timeout timers. */ + uint8_t queue_restart_timer; + uint8_t loop_down_timer; /* loop down timer */ + uint8_t loop_down_abort_time; /* port down timer */ + uint32_t timer_active; + uint32_t forceLip; + struct timer_list timer; + + /* Watchdog queue, lock and total timer */ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,0) + spinlock_t retry_lock; /* Watchdog Queue Lock */ +#endif + srb_t *retry_q_first; /* First job on watchdog queue */ + srb_t *retry_q_last; /* Last job on watchdog queue */ + + srb_t *done_q_first; /* First job on done queue */ + srb_t *done_q_last; /* Last job on done queue */ + + /* RSCN queue. */ + rscn_t rscn_queue[MAX_RSCN_COUNT]; + uint8_t rscn_in_ptr; + uint8_t rscn_out_ptr; + + /* Host Adapter database */ + fcdev_t *phost_db; + uint8_t host_db_ptr; + + volatile struct + { + uint32_t online :1; /* 0 */ + uint32_t enable_64bit_addressing :1; /* 1 */ + uint32_t mbox_int :1; /* 2 */ + uint32_t mbox_busy :1; /* 3 */ + uint32_t reset_marker :1; /* 4 */ + uint32_t loop_resync_needed :1; /* 5 */ + uint32_t watchdog_enabled :1; /* 6 */ + uint32_t isp_abort_needed :1; /* 7 */ + uint32_t disable_host_adapter :1; /* 8 */ + uint32_t loop_resync_active :1; /* 9 */ + uint32_t reset_active :1; /* 10 */ + uint32_t abort_isp_active :1; /* 11 */ + uint32_t disable_risc_code_load :1; /* 12 */ + uint32_t set_cache_line_size_1 :1; /* 13 */ + uint32_t enable_target_mode :1; /* 14 */ + uint32_t disable_luns :1; /* 15 */ + uint32_t enable_lip_reset :1; /* 16 */ + uint32_t enable_lip_full_login :1; /* 17 */ + uint32_t enable_target_reset :1; /* 18 */ + uint32_t updated_fc_db :1; /* 19 */ + uint32_t enable_flash_db_update :1; /* 20 */ + uint32_t abort_queue_needed :1; /* 21 */ + +#define QLA2100_IN_ISR_BIT 22 + uint32_t in_isr :1; /* 22 */ + uint32_t dpc_sched :1; /* 23 */ + uint32_t start_timer :1; /* 24 */ + uint32_t nvram_config_done :1; /* 25 */ + uint32_t update_config_needed :1; /* 26 */ + uint32_t done_requests_needed :1; /* 27 */ + uint32_t restart_queues_needed :1; /* 28 */ + uint32_t port_restart_needed :1; /* 29 */ +#ifdef FC_IP_SUPPORT + uint32_t enable_ip :1; /* 30 */ +#endif + /* 4.11 */ + uint32_t managment_server_logged_in:1; /* 31 */ + } flags; + + uint32_t device_flags; +#define DFLG_LOCAL_DEVICES BIT_0 +#define DFLG_RETRY_LOCAL_DEVICES BIT_1 +#define RSCN_UPDATE BIT_2 +#define LOGIN_RETRY_NEEDED BIT_3 +#define RSCN_QUEUE_OVERFLOW BIT_4 +#define DFLG_FABRIC_DEVICES BIT_5 +#define RELOGIN_NEEDED BIT_6 + + uint8_t marker_needed; + uint8_t missing_targets; + uint8_t sns_retry_cnt; + uint8_t cmd_wait_cnt; + uint32_t dpc_flags; +#define MAILBOX_RETRY BIT_0 +#define COMMAND_WAIT_NEEDED BIT_1 +#define COMMAND_WAIT_ACTIVE BIT_2 +#define ISP_RESET_NEEDED BIT_3 +#define LOGOUT_DONE BIT_4 +#define ISP_RESET_ONCE BIT_5 + + uint16_t interrupts_on; + + volatile uint16_t loop_state; +/* These values are NOT used as flags. */ +#define LOOP_TIMEOUT 0x1 +#define LOOP_DOWN 0x2 +#define LOOP_UP 0x4 +#define LOOP_UPDATE 0x8 +#define LOOP_READY 0x10 + + /* following are new and needed for IOCTL support */ + uint8_t node_name[8]; + uint8_t nvram_version; + uint8_t ioctl_timer; + uint8_t IoctlPassThru_InProgress; + uint8_t IoctlPassFCCT_InProgress; + void *ioctl_mem; +#if BITS_PER_LONG > 32 + uint64_t ioctl_mem_phys; +#else + uint32_t ioctl_mem_phys; +#endif + + /* HBA serial number */ + uint8_t serial0; + uint8_t serial1; + uint8_t serial2; + + /* oem related items */ + uint8_t oem_id; + uint8_t oem_spare0; + uint8_t oem_part[6]; + uint8_t oem_fru[8]; + uint8_t oem_ec[8]; + uint8_t oem_string[8]; + + uint32_t dump_done; + +} scsi_qla_host_t; + +/* + * Macros to help code, maintain, etc. + */ +#define TGT_Q(ha, b, t) (ha->tgt[b][t]) +#define GET_LU_Q(ha, b, t, l) ( (TGT_Q(ha,b,t) != NULL)? TGT_Q(ha, b, t)->luns[l] : NULL) +#define LU_Q(ha, b, t, l) (TGT_Q(ha, b, t)->luns[l]) +#define PORT_DOWN(ha, t) ((ha)->fc_db[(t)].port_timer) + +/* + * Locking Macro Definitions + * + * LOCK/UNLOCK definitions are lock/unlock primitives for multi-processor + * or spl/splx for uniprocessor. + */ +#define QLA2100_INTR_LOCK(ha) +#define QLA2100_INTR_UNLOCK(ha) + +#define QLA2100_RING_LOCK(ha) +#define QLA2100_RING_UNLOCK(ha) + +#if defined(__cplusplus) +} +#endif +#endif + +#if defined(__386__) +# define QLA2100_BIOSPARAM qla2100_biosparam +#else +# define QLA2100_BIOSPARAM NULL +#endif + +/* + * Linux - SCSI Driver Interface Function Prototypes. + */ +int qla2100_ioctl(Scsi_Device *, int , void *); +int qla2100_proc_info ( char *, char **, off_t, int, int, int); +const char * qla2100_info(struct Scsi_Host *host); +int qla2100_detect(Scsi_Host_Template *); +int qla2100_release(struct Scsi_Host *); +const char * qla2100_info(struct Scsi_Host *); +int qla2100_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *)); +int qla2100_abort(Scsi_Cmnd *); +int qla2100_reset(Scsi_Cmnd *, unsigned int); +int qla2100_biosparam(Disk *, kdev_t, int[]); +void qla2100_intr_handler(int, void *, struct pt_regs *); +//void qla2100_device_queue_depth(scsi_qla_host_t *, Scsi_Device *); +void qla2100_setup(char *s, int *dummy); + +/* Number of segments 1 - 65535 */ +#define SG_SEGMENTS 32 /* Cmd entry + 6 continuations */ + +/* + * Scsi_Host_template (see hosts.h) + * Device driver Interfaces to mid-level SCSI driver. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) +/* This interface is now obsolete !!! */ +#define QLA2100_LINUX_TEMPLATE { \ + next: NULL, \ + usage_count: NULL, \ + proc_dir: NULL, \ + proc_info: qla2100_proc_info, \ + name: "Qlogic Fibre Channel 2100", \ + detect: qla2100_detect, \ + release: qla2100_release, \ + info: qla2100_info, \ + command: NULL, \ + queuecommand: qla2100_queuecommand, \ + abort: qla2100_abort, \ + reset: qla2100_reset, \ + slave_attach: NULL, \ + bios_param: QLA2100_BIOSPARAM, \ + can_queue: 1, /* MAX_OUTSTANDING_COMMANDS */ \ + this_id: -1, /* scsi id of host adapter */ \ + sg_tablesize: SG_ALL, \ + cmd_per_lun: 1, /* max commands per lun */ \ + present: 0, /* number of ISP present */ \ + unchecked_isa_dma: 0, /* no memeory DMA restrictions */ \ + use_clustering: ENABLE_CLUSTERING \ +} +#else + +#define QLA2100_LINUX_TEMPLATE { \ + next: NULL, \ + module: NULL, \ + proc_dir: NULL, \ + proc_info: qla2100_proc_info, \ + name: "Qlogic Fibre Channel 2100", \ + detect: qla2100_detect, \ + release: qla2100_release, \ + info: qla2100_info, \ + ioctl: qla2100_ioctl, \ + command: NULL, \ + queuecommand: qla2100_queuecommand, \ + eh_strategy_handler: NULL, \ + eh_abort_handler: NULL, \ + eh_device_reset_handler: NULL, \ + eh_bus_reset_handler: NULL, \ + eh_host_reset_handler: NULL, \ + abort: qla2100_abort, \ + reset: qla2100_reset, \ + slave_attach: NULL, \ + bios_param: QLA2100_BIOSPARAM, \ + can_queue: 255, /* max simultaneous cmds */\ + this_id: -1, /* scsi id of host adapter */\ + sg_tablesize: SG_SEGMENTS, /* max scatter-gather cmds */\ + cmd_per_lun: 3, /* cmds per lun (linked cmds) */\ + present: 0, /* number of 7xxx's present */\ + unchecked_isa_dma: 0, /* no memory DMA restrictions */\ + use_clustering: ENABLE_CLUSTERING, \ + use_new_eh_code: 0, \ + emulated: 0 \ +} +#endif +#endif /* _IO_HBA_QLA2100_H */ diff -urN linux-2.4.18/drivers/scsi/qla2x00exioct.h lia64-2.4/drivers/scsi/qla2x00exioct.h --- linux-2.4.18/drivers/scsi/qla2x00exioct.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/scsi/qla2x00exioct.h Mon Jul 23 14:12:38 2001 @@ -0,0 +1,823 @@ +/* + * File Name: exioct.h + * + * San/Device Management Ioctl Header + * File is created to adhere to Solaris requirement using 8-space tabs. + * + * !!!!! PLEASE DO NOT REMOVE THE TABS !!!!! + * !!!!! PLEASE NO SINGLE LINE COMMENTS: // !!!!! + * !!!!! PLEASE NO MORE THAN 80 CHARS PER LINE !!!!! + * + * *********************************************************************** + * * ** + * * NOTICE ** + * * COPYRIGHT (C) 2000 QLOGIC CORPORATION ** + * * ALL RIGHTS RESERVED ** + * * ** + * *********************************************************************** + * + * Revision History: + * + * Rev. 0 March 1, 2000 + * YPL - Created. + * + * Rev. 1 March 2, 2000 + * RLU - Updated with latest definitions. Added more comments. + * + * Rev. 2 May 16, 2000 + * SP - Updated definitions and changed structures (March 27, 2000) + * SP - Addded structures + * + * Rev. 3 June 1, 2000 + * THL - Made major changes to include all changes talked in our meeting. + * + * Rev. 4 June 5, 2000 + * RLU - Added new definitions/structures for SDM_GET_AEN and SDM_REG_AEN + * functions. + * - Major definition/structure name changes as discussed in meetings. + * - Deleted duplicated command code and structure definitions. + * + * Rev. 4.1 June 14, 2000 + * WTR - Moved Solaris specific defines to exioctso.h. This makes it + * possible for application developers to include only exioct.h + * in their Solaris application development. + * + * Rev. 4.2 June 15, 2000 + * THL - Changed UINT16 and UINT32 back to WORD and DWORD for NT; otherwise, + * NT will get a compilation error for redefining UINT16 and UINT32. + * Added RISC_CODE/FLASH_RAM macros. + * + * Rev. 4.3 June 22, 2000 + * THL - Changed SDM_FC_ADDR according to External Ioctls document. + * Added SDM_DEF_TYPE macros. + * + * Rev. 4.4 June 22, 2000 + * THL - Moved NT specific defines to exioctnt.h. + * + * Rev. 4.5 August 15, 2000 + * SP - Rolled back some changes made by Todd R. + * Kept new status code SDM_STATUS_NO_MEMORY + * Port types fabric and tape device + * + * Rev. 4.7 Sep 6, 2000 + * YPL - Replace SDM_ with EXT_, _ISP with _CHIP. + * Add vendor specific statuses, device update, config defines. + * + * Rev. 5.0 Sep 13, 2000 + * YPL - Update version to 5, remove max defines, make port type bit. + * Change HBA_PORT_PROPERTY to have bus/target/lun defined as UINT16 + * + * Rev. 5.1 Sep 22, 2000 + * THL - Add destination address for specify scsi address or FC address. + * Remove "not support" comment and add more macros. + * + * Rev. 5.2 Sep 27, 2000 + * THL - Add new macros and structure for add and swap target device. + * Create new data structure for get port database. + * TLE - Merge changes needed for FailOver + * + * Rev. 5.3 Sep 29, 2000 + * THL - Add access mode for NVRAM. + * + * Rev. 5.4 Oct 03, 2000 + * THL - Add EXT_SC_GET_FC_STATISTICS. + * + * Rev. 5.5 Oct 18, 2000 + * THL - Remove duplicated EXT_DEF_ADDR_MODE_32 and EXT_DEF_ADDR_MODE_16. + * Reformat new data structures and defines. + * + * Rev. 5.6 Oct 19, 2000 + * RLU - Changed file name from ExIoct.h to exioct.h. + * - Added definition of EXT_RNID_DATA for API implementation. + * - Reformat some lines to conform to the format agreed + * upon in IOCTL meeting (and mentioned at beginning of + * this file). + * + * Rev. 5.7 Oct 25, 2000 + * BN - Added LUN bitmask structure and macros + * + * Rev. 5.8 Oct 25, 2000 + * BN - Added EXT_CC_DRIVER_PROP define + * + * Rev. 5.9 Oct 26, 2000 + * BN - Sync with UnixApi project + * + * Rev. 5.10 Oct 30, 2000 + * BN - Remove not needed #define for EXT_CC_DRIVER_PROP + * - Add EXT_ to IS_LUN_BIT_SET, SET_LUN_BIT, CLR_LUN_BIT + * + * Rev. 5.11 Nov 1, 2000 + * BN - Increased [1] of EXT_DEVICEDATA to [EXT_MAX_TARGET] + * TLE - Decreased [EXT_MAX_TARGET] of EXT_DEVICEDATA to [1] + * + * Rev. 5.12 Nov 7, 2000 + * RLU - Deleted EXT_DEF_MAX_LUNS define and changed all references + * to it to use EXT_MAX_LUN. + * - Changed the revision numbers for the last 2 revisions down + * to use 5.x. + * + * Rev. 5.13 Nov 28, 2000 + * RLU - Change value defines from EXT_... to EXT_DEF_... + * + * Rev. 5.14 Jan 08, 2001 + * BN - Added #define SDM_CC_LOOPBACK SDM_CC_LOOPBACK_OS + * + */ + +#ifndef _EXIOCT_H +#define _EXIOCT_H + +/* + * NOTE: the following version defines must be updated each time the + * changes made may affect the backward compatibility of the + * input/output relations of the SDM IOCTL functions. + */ +#define EXT_VERSION 5 + + +/* + * OS independent General definitions + */ +#define EXT_DEF_SIGNATURE_SIZE 8 +#define EXT_DEF_WWN_NAME_SIZE 8 +#define EXT_DEF_WWP_NAME_SIZE 8 +#define EXT_DEF_SERIAL_NUM_SIZE 4 +#define EXT_DEF_PORTID_SIZE 4 +#define EXT_DEF_PORTID_SIZE_ACTUAL 3 +#define EXT_DEF_MAX_STR_SIZE 128 +#define EXT_DEF_SCSI_PASSTHRU_CDB_LENGTH 12 + +#define EXT_DEF_ADDR_MODE_32 1 +#define EXT_DEF_ADDR_MODE_64 2 + +/* + * *********************************************************************** + * X OS type definitions + * *********************************************************************** + */ +#ifdef _MSC_VER /* NT */ + +#pragma pack(1) +#include "ExIoctNT.h" + +#elif defined(linux) /* Linux */ + +#include "qla2x00exioctln.h" + +#elif defined(sun) || defined(__sun) /* Solaris */ + +#include "exioctso.h" + +#endif + +/* + * *********************************************************************** + * OS dependent General configuration defines + * *********************************************************************** + */ +#define EXT_DEF_MAX_HBA EXT_DEF_MAX_HBA_OS +#define EXT_DEF_MAX_BUS EXT_DEF_MAX_BUS_OS +#define EXT_DEF_MAX_TARGET EXT_DEF_MAX_TARGET_OS +#define EXT_DEF_MAX_LUN EXT_DEF_MAX_LUN_OS + +/* + * *********************************************************************** + * Common header struct definitions for San/Device Mgmt + * *********************************************************************** + */ +typedef struct { + UINT64 Signature; /* 8 chars string */ + UINT16 AddrMode; /* 2 */ + UINT16 Version; /* 2 */ + UINT16 SubCode; /* 2 */ + UINT16 Instance; /* 2 */ + UINT32 Status; /* 4 */ + UINT32 DetailStatus; /* 4 */ + UINT32 Reserved1; /* 4 */ + UINT32 RequestLen; /* 4 */ + UINT32 ResponseLen; /* 4 */ + UINT64 RequestAdr; /* 8 */ + UINT64 ResponseAdr; /* 8 */ + UINT16 HbaSelect; /* 2 */ + UINT16 VendorSpecificStatus[11]; /* 22 */ + UINT64 VendorSpecificData; /* 8 chars string */ +} EXT_IOCTL, *PEXT_IOCTL; /* 84 / 0x54 */ + +/* + * Addressing mode used by the user application + */ +#define EXT_ADDR_MODE EXT_ADDR_MODE_OS + +/* + * Status. These macros are being used for setting Status field in + * EXT_IOCTL structure. + */ +#define EXT_STATUS_OK 0 +#define EXT_STATUS_ERR 1 +#define EXT_STATUS_BUSY 2 +#define EXT_STATUS_PENDING 3 +#define EXT_STATUS_SUSPENDED 4 +#define EXT_STATUS_RETRY_PENDING 5 +#define EXT_STATUS_INVALID_PARAM 6 +#define EXT_STATUS_DATA_OVERRUN 7 +#define EXT_STATUS_DATA_UNDERRUN 8 +#define EXT_STATUS_DEV_NOT_FOUND 9 +#define EXT_STATUS_COPY_ERR 10 +#define EXT_STATUS_MAILBOX 11 +#define EXT_STATUS_UNSUPPORTED_SUBCODE 12 +#define EXT_STATUS_UNSUPPORTED_VERSION 13 +#define EXT_STATUS_MS_NO_RESPONSE 14 +#define EXT_STATUS_SCSI_STATUS 15 +#define EXT_STATUS_BUFFER_TOO_SMALL 16 +#define EXT_STATUS_NO_MEMORY 17 +#define EXT_STATUS_UNKNOWN 18 +#define EXT_STATUS_UNKNOWN_DSTATUS 19 +#define EXT_STATUS_INVALID_REQUEST 20 + +/* + * Detail Status contains the SCSI bus status codes. + */ + +#define EXT_DSTATUS_GOOD 0x00 +#define EXT_DSTATUS_CHECK_CONDITION 0x02 +#define EXT_DSTATUS_CONDITION_MET 0x04 +#define EXT_DSTATUS_BUSY 0x08 +#define EXT_DSTATUS_INTERMEDIATE 0x10 +#define EXT_DSTATUS_INTERMEDIATE_COND_MET 0x14 +#define EXT_DSTATUS_RESERVATION_CONFLICT 0x18 +#define EXT_DSTATUS_COMMAND_TERMINATED 0x22 +#define EXT_DSTATUS_QUEUE_FULL 0x28 + +/* + * Detail Status contains the needed Response buffer space(bytes) + * when Status = EXT_STATUS_BUFFER_TOO_SMALL + */ + + +/* + * Detail Status contains one of the following codes + * when Status = EXT_STATUS_INVALID_PARAM or + * = EXT_STATUS_DEV_NOT_FOUND + */ +#define EXT_DSTATUS_NOADNL_INFO 0x00 +#define EXT_DSTATUS_HBA_INST 0x01 +#define EXT_DSTATUS_TARGET 0x02 +#define EXT_DSTATUS_LUN 0x03 +#define EXT_DSTATUS_REQUEST_LEN 0x04 +#define EXT_DSTATUS_PATH_INDEX 0x05 + +/* + * Currently supported DeviceControl / ioctl command codes + */ +#define EXT_CC_QUERY EXT_CC_QUERY_OS +#define EXT_CC_SEND_FCCT_PASSTHRU EXT_CC_SEND_FCCT_PASSTHRU_OS +#define EXT_CC_REG_AEN EXT_CC_REG_AEN_OS +#define EXT_CC_GET_AEN EXT_CC_GET_AEN_OS +#define EXT_CC_SEND_ELS_RNID EXT_CC_SEND_ELS_RNID_OS +#define EXT_CC_SEND_SCSI_PASSTHRU EXT_CC_SCSI_PASSTHRU_OS +#define EXT_CC_READ_HOST_PARAMS EXT_CC_READ_HOST_PARAMS_OS +#define EXT_CC_READ_RISC_PARAMS EXT_CC_READ_RISC_PARAMS_OS +#define EXT_CC_UPDATE_HOST_PARAMS EXT_CC_UPDATE_HOST_PARAMS_OS +#define EXT_CC_UPDATE_RISC_PARAMS EXT_CC_UPDATE_RISC_PARAMS_OS +#define EXT_CC_READ_NVRAM EXT_CC_READ_NVRAM_OS +#define EXT_CC_UPDATE_NVRAM EXT_CC_UPDATE_NVRAM_OS + +#define EXT_CC_LOOPBACK EXT_CC_LOOPBACK_OS +/* + * HBA port operations + */ +#define EXT_CC_GET_DATA EXT_CC_GET_DATA_OS +#define EXT_CC_SET_DATA EXT_CC_SET_DATA_OS + +/* + * The following DeviceControl / ioctl command codes currently are not + * supported. + */ +#define EXT_CC_SEND_ELS_RTIN EXT_CC_SEND_ELS_RTIN_OS + + +/* + * *********************************************************************** + * EXT_IOCTL SubCode definition. + * These macros are being used for setting SubCode field in EXT_IOCTL + * structure. + * *********************************************************************** + */ + +/* + * Query. + * Uses with EXT_QUERY as the ioctl code. + */ +#define EXT_SC_QUERY_HBA_NODE 1 +#define EXT_SC_QUERY_HBA_PORT 2 +#define EXT_SC_QUERY_DISC_PORT 3 +#define EXT_SC_QUERY_DISC_TGT 4 +#define EXT_SC_QUERY_DISC_LUN 5 /* Currently Not Supported */ +#define EXT_SC_QUERY_DRIVER 6 +#define EXT_SC_QUERY_FW 7 +#define EXT_SC_QUERY_CHIP 8 + +/* + * Get. + * Uses with EXT_GET_DATA as the ioctl code + */ +/* 1 - 99 Common */ +#define EXT_SC_GET_SCSI_ADDR 1 /* Currently Not Supported */ +#define EXT_SC_GET_ERR_DETECTIONS 2 /* Currently Not Supported */ +#define EXT_SC_GET_STATISTICS 3 +#define EXT_SC_GET_BUS_MODE 4 /* Currently Not Supported */ +#define EXT_SC_GET_DR_DUMP_BUF 5 /* Currently Not Supported */ +#define EXT_SC_GET_RISC_CODE 6 +#define EXT_SC_GET_FLASH_RAM 7 + +/* 100 - 199 FC_INTF_TYPE */ +#define EXT_SC_GET_LINK_STATUS 101 /* Currently Not Supported */ +#define EXT_SC_GET_LOOP_ID 102 /* Currently Not Supported */ +#define EXT_SC_GET_LUN_BITMASK 103 +#define EXT_SC_GET_PORT_DATABASE 104 /* Currently Not Supported */ +#define EXT_SC_GET_PORT_DATABASE_MEM 105 /* Currently Not Supported */ +#define EXT_SC_GET_PORT_SUMMARY 106 +#define EXT_SC_GET_POSITION_MAP 107 +#define EXT_SC_GET_RETRY_CNT 108 /* Currently Not Supported */ +#define EXT_SC_GET_RNID 109 +#define EXT_SC_GET_RTIN 110 /* Currently Not Supported */ +#define EXT_SC_GET_FC_LUN_BITMASK 111 +#define EXT_SC_GET_FC_STATISTICS 112 + +/* 200 - 299 SCSI_INTF_TYPE */ +#define EXT_SC_GET_SEL_TIMEOUT 201 /* Currently Not Supported */ + + +/* + * Set. + * Uses with EXT_SET_DATA as the ioctl code + */ +/* 1 - 99 Common */ +#define EXT_SC_RST_STATISTICS 3 /* Currently Not Supported */ +#define EXT_SC_SET_BUS_MODE 4 /* Currently Not Supported */ +#define EXT_SC_SET_DR_DUMP_BUF 5 /* Currently Not Supported */ +#define EXT_SC_SET_RISC_CODE 6 +#define EXT_SC_SET_FLASH_RAM 7 + +/* 100 - 199 FC_INTF_TYPE */ +#define EXT_SC_SET_LUN_BITMASK 103 +#define EXT_SC_SET_RETRY_CNT 108 /* Currently Not Supported */ +#define EXT_SC_SET_RNID 109 +#define EXT_SC_SET_RTIN 110 /* Currently Not Supported */ +#define EXT_SC_SET_FC_LUN_BITMASK 111 +#define EXT_SC_ADD_TARGET_DEVICE 112 +#define EXT_SC_SWAP_TARGET_DEVICE 113 + +/* 200 - 299 SCSI_INTF_TYPE */ +#define EXT_SC_SET_SEL_TIMEOUT 201 /* Currently Not Supported */ + +/* SCSI passthrough */ +#define EXT_SC_SEND_SCSI_PASSTHRU 0 +#define EXT_SC_SEND_FC_SCSI_PASSTHRU 1 + +/* NVRAM */ +#define EXT_SC_NVRAM_HARDWARE 0 /* Save */ +#define EXT_SC_NVRAM_DRIVER 1 /* Driver (Apply) */ +#define EXT_SC_NVRAM_ALL 2 /* NVRAM/Driver (Save+Apply) */ + +/* Read */ + +/* Write */ + +/* Reset */ + +/* Request struct */ + + +/* + * Response struct + */ +typedef struct _EXT_HBA_NODE { + UINT8 WWNN [EXT_DEF_WWN_NAME_SIZE]; /* 8 */ + UINT8 Manufacturer [EXT_DEF_MAX_STR_SIZE]; /* 128; "QLOGIC" */ + UINT8 Model [EXT_DEF_MAX_STR_SIZE]; /* 128; "QLA2200" */ + UINT8 SerialNum [EXT_DEF_SERIAL_NUM_SIZE];/* 4; 123 */ + UINT8 DriverVersion[EXT_DEF_MAX_STR_SIZE]; /* 128; "7.4.3" */ + UINT8 FWVersion [EXT_DEF_MAX_STR_SIZE]; /* 128; "2.1.6" */ + + /* The following field is currently not supported */ + UINT8 OptRomVersion[EXT_DEF_MAX_STR_SIZE]; /* 128; "1.44" */ + + UINT16 PortCount; /* 2; 1 */ + UINT16 InterfaceType; /* 2; FC/SCSI */ + + /* The following two fields are not yet supported */ + UINT32 DriverAttr; /* 4 */ + UINT32 FWAttr; /* 4 */ + + UINT32 Reserved[8]; /* 32 */ +} EXT_HBA_NODE, *PEXT_HBA_NODE; /* 696 */ + +/* HBA node query interface type */ +#define EXT_DEF_FC_INTF_TYPE 1 +#define EXT_DEF_SCSI_INTF_TYPE 2 + +typedef struct _EXT_HBA_PORT { + UINT8 WWPN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ + UINT8 Id [EXT_DEF_PORTID_SIZE]; /* 4; 3 bytes valid Port Id. */ + UINT16 Type; /* 2; Port Type */ + UINT16 State; /* 2; Port State */ + UINT16 Mode; /* 2 */ + UINT16 DiscPortCount; /* 2 */ + UINT16 DiscPortNameType; /* 2; USE_NODE_NAME or */ + /* USE_PORT_NAME */ + UINT16 DiscTargetCount; /* 2 */ + UINT16 Bus; /* 1 */ + UINT16 Target; /* 1 */ + UINT16 Lun; /* 1 */ + UINT16 Unused; /* 1 */ + UINT32 Reserved[6]; /* 28 */ +} EXT_HBA_PORT, *PEXT_HBA_PORT; /* 56 */ + +/* port type bit definitions */ +#define EXT_DEF_INITIATOR_DEV 0x1 +#define EXT_DEF_TARGET_DEV 0x2 +#define EXT_DEF_TAPE_DEV 0x4 +#define EXT_DEF_FABRIC_DEV 0x8 + + +/* HBA port state */ +#define EXT_DEF_HBA_OK 0 +#define EXT_DEF_HBA_SUSPENDED 1 +#define EXT_DEF_HBA_LOOP_DOWN 2 + +/* Connection mode */ +#define EXT_DEF_P2P_MODE 1 +#define EXT_DEF_LOOP_MODE 2 + +/* Valid name type for Disc. port/target */ +#define EXT_DEF_USE_NODE_NAME 1 +#define EXT_DEF_USE_PORT_NAME 2 + +typedef struct _EXT_DISC_PORT { + UINT8 WWNN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ + UINT8 WWPN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ + UINT8 Id [EXT_DEF_PORTID_SIZE]; /* 4; 3 bytes used. big endian*/ + + /* The following fields currently are not supported */ + UINT16 Type; /* 2; Port Type */ + UINT16 Status; /* 2; Port Status */ + UINT16 Bus; /* 2; n/a for Solaris */ + + UINT16 TargetId; /* 2 */ + UINT32 Reserved[8]; /* 32 */ +} EXT_DISC_PORT, *PEXT_DISC_PORT; /* 60 */ + +typedef struct _EXT_DISC_TARGET { + UINT8 WWNN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ + UINT8 WWPN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ + UINT8 Id [EXT_DEF_PORTID_SIZE]; /* 4; 3 bytes used. big endian*/ + + /* The following fields currently are not supported */ + UINT16 Type; /* 2; Target Type */ + UINT16 Status; /* 2; Target Status*/ + UINT16 Bus; /* 2; n/a for Solaris */ + + UINT16 TargetId; /* 2 */ + + /* The following field is currently not supported */ + UINT16 LunCount; /* 2; n/a for nt */ + + UINT16 Reserved[15]; /* 30 */ +} EXT_DISC_TARGET, *PEXT_DISC_TARGET; /* 60 */ + +/* The following command is not supported */ +typedef struct _EXT_DISC_LUN { /* n/a for nt */ + UINT16 Id; /* 2 */ + UINT16 State; /* 2 */ + UINT16 IoCount; /* 2 */ + UINT16 Reserved[15]; /* 30 */ +} EXT_DISC_LUN, *PEXT_DISC_LUN; /* 36 */ + + +/* SCSI address */ +typedef struct _EXT_SCSI_ADDR { + UINT16 Bus; /* 2 */ + UINT16 Target; /* 2 */ + UINT16 Lun; /* 2 */ + UINT16 Padding[5]; /* 10 */ +} EXT_SCSI_ADDR, *PEXT_SCSI_ADDR; /* 16 */ + + +/* Fibre Channel address */ +typedef struct _EXT_FC_ADDR { + union { + UINT8 WWNN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ + UINT8 WWPN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ + UINT8 Id[EXT_DEF_PORTID_SIZE]; /* 4 */ + } FcAddr; + UINT16 Type; /* 2 */ + UINT16 Padding[2]; /* 2 */ +} EXT_FC_ADDR, *PEXT_FC_ADDR; /* 24 */ + +#define EXT_DEF_TYPE_WWNN 1 +#define EXT_DEF_TYPE_WWPN 2 +#define EXT_DEF_TYPE_PORTID 3 +#define EXT_DEF_TYPE_FABRIC 4 + + +/* Destination address */ +typedef struct _EXT_DEST_ADDR { + union { + UINT8 WWNN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ + UINT8 WWPN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ + UINT8 Id[EXT_DEF_PORTID_SIZE]; /* 4 */ + struct { + UINT16 Bus; /* 2 */ + UINT16 Target; /* 2 */ + } ScsiAddr; + } DestAddr; + UINT16 DestType; /* 2 */ + UINT16 Lun; /* 2 */ + UINT16 Padding[2]; /* 4 */ +} EXT_DEST_ADDR, *PEXT_DEST_ADDR; /* 20 */ + + +#define EXT_DEF_DESTTYPE_WWNN 1 +#define EXT_DEF_DESTTYPE_WWPN 2 +#define EXT_DEF_DESTTYPE_PORTID 3 +#define EXT_DEF_DESTTYPE_FABRIC 4 +#define EXT_DEF_DESTTYPE_SCSI 5 + +/* Statistic */ +typedef struct _EXT_HBA_PORT_STAT { + UINT32 ControllerErrorCount; /* 4 */ + UINT32 DeviceErrorCount; /* 4 */ + UINT32 TotalIoCount; /* 4 */ + UINT32 TotalMBytes; /* 4; MB of data processed */ + UINT32 TotalLipResets; /* 4; Total no. of LIP Reset */ + UINT32 TotalInterrupts; /* 4; Total no. of Interrupts */ + UINT32 TotalLinkFailures; /* 4 */ + UINT32 TotalLossOfSync; /* 4 */ + UINT32 TotalLossOfSignals; /* 4 */ + UINT32 PrimitiveSeqProtocolErrorCount;/* 4 */ + UINT32 InvalidTransmissionWordCount; /* 4 */ + UINT32 InvalidCRCCount; /* 4 */ + UINT32 Reserved[16]; /* 64 */ +} EXT_HBA_PORT_STAT, *PEXT_HBA_PORT_STAT; /* 112 */ + + +/* Driver property */ +typedef struct _EXT_DRIVER { + UINT8 Version[EXT_DEF_MAX_STR_SIZE];/* 128 */ + UINT16 NumOfBus; /* 2; Port Type */ + UINT16 TargetsPerBus; /* 2; Port Status */ + UINT16 LunsPerTarget; /* 2 */ + UINT32 MaxTransferLen; /* 4 */ + UINT32 MaxDataSegments; /* 4 */ + UINT16 DmaBitAddresses; /* 2 */ + UINT16 IoMapType; /* 2 */ + UINT32 Attrib; /* 4 */ + UINT32 InternalFlags[4]; /* 16 */ + UINT32 Reserved[8]; /* 32 */ +} EXT_DRIVER, *PEXT_DRIVER; /* 198 */ + + +/* Firmware property */ +typedef struct _EXT_FW { + UINT8 Version[EXT_DEF_MAX_STR_SIZE];/* 128 */ + UINT32 Attrib; /* 4 */ + UINT16 Reserved[33]; /* 66 */ +} EXT_FW, *PEXT_FW; /* 198 */ + + +/* ISP/Chip property */ +typedef struct _EXT_CHIP { + UINT16 VendorId; /* 2 */ + UINT16 DeviceId; /* 2 */ + UINT16 SubVendorId; /* 2 */ + UINT16 SubSystemId; /* 2 */ + UINT16 PciBusNumber; /* 2 */ + UINT16 PciSlotNumber; /* 2 */ + UINT32 IoAddr; /* 4 */ + UINT32 IoAddrLen; /* 4 */ + UINT32 MemAddr; /* 4 */ + UINT32 MemAddrLen; /* 4 */ + UINT16 ChipType; /* 2 */ + UINT16 InterruptLevel; /* 2 */ + UINT16 OutMbx[8]; /* 16 */ + UINT32 Reserved[8]; /* 32 */ +} EXT_CHIP, *PEXT_CHIP; /* 80 */ + + +/* Request Buffer for RNID */ +typedef struct _EXT_RNID_REQ { + EXT_FC_ADDR Addr; + UINT8 DataFormat; + UINT32 Reserved[16]; +} EXT_RNID_REQ, *PEXT_RNID_REQ; + +/* Request Buffer for Set RNID */ +typedef struct _EXT_SET_RNID_REQ { + UINT8 IPVersion[2]; + UINT8 UDPPortNumber[2]; + UINT8 IPAddress[16]; + UINT32 Reserved[16]; +} EXT_SET_RNID_REQ, *PEXT_SET_RNID_REQ; + +/* RNID definition and data struct */ +#define SEND_RNID_RSP_SIZE 72 + +typedef struct _RNID_DATA +{ + UINT8 WWN[16]; /* 16 */ + UINT32 UnitType; /* 4 */ + UINT8 PortId[4]; /* 4 */ + UINT32 NumOfAttachedNodes; /* 4 */ + UINT8 IPVersion[2]; /* 2 */ + UINT8 UDPPortNumber[2]; /* 2 */ + UINT8 IPAddress[16]; /* 16 */ + UINT16 Reserved; /* 2 */ + UINT16 TopoDiscFlags; /* 2 */ +} EXT_RNID_DATA, *PEXT_RNID_DATA; /* 52 */ + + +/* SCSI pass-through */ +typedef struct _EXT_SCSI_PASSTHRU { + EXT_SCSI_ADDR TargetAddr; + UINT8 Direction; + UINT8 CdbLength; + UINT8 Cdb[EXT_DEF_SCSI_PASSTHRU_CDB_LENGTH]; + UINT32 Reserved[16]; + UINT8 SenseData[256]; +} EXT_SCSI_PASSTHRU, *PEXT_SCSI_PASSTHRU; + +/* FC SCSI pass-through */ +typedef struct _EXT_FC_SCSI_PASSTHRU { + EXT_DEST_ADDR FCScsiAddr; + UINT8 Direction; + UINT8 CdbLength; + UINT8 Cdb[EXT_DEF_SCSI_PASSTHRU_CDB_LENGTH]; + UINT32 Reserved[16]; + UINT8 SenseData[256]; +} EXT_FC_SCSI_PASSTHRU, *PEXT_FC_SCSI_PASSTHRU; + +/* SCSI pass-through direction */ +#define EXT_DEF_SCSI_PASSTHRU_DATA_IN 1 +#define EXT_DEF_SCSI_PASSTHRU_DATA_OUT 2 + + +/* EXT_REG_AEN Request struct */ +typedef struct _EXT_REG_AEN { + UINT32 Enable; /* 4; non-0 to enable, 0 to disable. */ + UINT32 Reserved; /* 4 */ +} EXT_REG_AEN, *PEXT_REG_AEN; /* 8 */ + +/* EXT_GET_AEN Response struct */ +typedef struct _EXT_ASYNC_EVENT { + UINT32 AsyncEventCode; /* 4 */ + union { + struct { + UINT8 RSCNInfo[EXT_DEF_PORTID_SIZE_ACTUAL];/* 3, BE */ + UINT8 AddrFormat; /* 1 */ + UINT32 Rsvd_1[2]; /* 8 */ + } RSCN; + + UINT32 Reserved[3]; /* 12 */ + } Payload; +} EXT_ASYNC_EVENT, *PEXT_ASYNC_EVENT; /* 16 */ + +/* Asynchronous Event Codes */ +#define EXT_DEF_LIP_OCCURRED 0x8010 +#define EXT_DEF_LINK_UP 0x8011 +#define EXT_DEF_LINK_DOWN 0x8012 +#define EXT_DEF_LIP_RESET 0x8013 +#define EXT_DEF_RSCN 0x8015 +#define EXT_DEF_DEVICE_UPDATE 0x8014 + +/* Required # of entries in the queue buffer allocated. */ +#define EXT_DEF_MAX_AEN_QUEUE EXT_DEF_MAX_AEN_QUEUE_OS + +/* LUN BitMask structure definition, array of 32bit words, + * 1 bit per lun. When bit == 1, the lun is masked. + * Most significant bit of mask[0] is lun 0, bit 24 is lun 7. + */ +typedef struct _EXT_LUN_BIT_MASK { +#if ((EXT_MAX_LUN & 0x7) == 0) + UINT8 mask[EXT_DEF_MAX_LUN >> 3]; +#else + UINT8 mask[(EXT_DEF_MAX_LUN + 8) >> 3 ]; +#endif +} EXT_LUN_BIT_MASK, *PEXT_LUN_BIT_MASK; + +/* Device type to get for EXT_SC_GET_PORT_SUMMARY */ +#define EXT_DEF_GET_KNOWN_DEVICE 0x1 +#define EXT_DEF_GET_VISIBLE_DEVICE 0x2 +#define EXT_DEF_GET_HIDDEN_DEVICE 0x4 +#define EXT_DEF_GET_FABRIC_DEVICE 0x8 +#define EXT_DEF_GET_LOOP_DEVICE 0x10 + +/* Each entry in device database */ +typedef struct _EXT_DEVICEDATAENTRY +{ + UINT8 NodeWWN[8]; /* Node World Wide Name for device */ + UINT8 PortWWN[8]; /* Port World Wide Name for device */ + UINT8 PortID[3]; /* Current PortId for device */ + UINT8 ControlFlags; /* Control flag */ + EXT_SCSI_ADDR TargetAddress; /* scsi address */ + UINT32 DeviceFlags; /* Flags for device */ + UINT16 LoopID; /* Loop ID */ + UINT16 BaseLunNumber; + UINT32 Reserved[32]; +} EXT_DEVICEDATAENTRY, *PEXT_DEVICEDATAENTRY; + +#define EXT_DEF_EXTERNAL_LUN_COUNT 2048 +#define EXT_DEF_EXTERNAL_LUN_BITMASK_BYTES (EXT_DEF_EXTERNAL_LUN_COUNT / 8) + +/* Structure as used in the IOCTL. */ + +typedef struct _EXT_EXTERNAL_LUN_BITMASK_ENTRY +{ + UINT8 NodeName[EXT_DEF_WWN_NAME_SIZE]; + UINT8 PortName[EXT_DEF_WWN_NAME_SIZE]; + + UINT32 Reserved2; + UINT32 Reserved3; + UINT32 Reserved4; + UINT32 Reserved5; /* Pad to 32-byte header.*/ + + UINT8 Bitmask[EXT_DEF_EXTERNAL_LUN_BITMASK_BYTES]; +} EXT_EXTERNAL_LUN_BITMASK_ENTRY, *PEXT_EXTERNAL_LUN_BITMASK_ENTRY; + + +/* Structure as it is stored in the NT registry.*/ + +typedef struct _LUN_BITMASK_LIST +{ + UINT16 Version; /* Should be LUN_BITMASK_REGISTRY_VERSION */ + UINT16 EntryCount; /* Count of variable entries following.*/ + UINT32 Reserved1; + UINT32 Reserved2; + UINT32 Reserved3; + UINT32 Reserved4; + UINT32 Reserved5; + UINT32 Reserved6; + UINT32 Reserved7; /* Pad to 32-byte header.*/ + + EXT_EXTERNAL_LUN_BITMASK_ENTRY BitmaskEntry[1]; + /* Variable-length data.*/ + +} EXT_LUN_BITMASK_LIST, *PEXT_LUN_BITMASK_LIST; + + +/* Device database information */ +typedef struct _EXT_DEVICEDATA +{ + UINT32 TotalDevices; /* Set to total number of device. */ + UINT32 ReturnListEntryCount; /* Set to number of device entries */ + /* returned in list. */ + + EXT_DEVICEDATAENTRY EntryList[1]; /* Variable length */ +} EXT_DEVICEDATA, *PEXT_DEVICEDATA; + + +/* Swap Target Device Data structure */ +typedef struct _EXT_SWAPTARGETDEVICE +{ + EXT_DEVICEDATAENTRY CurrentExistDevice; + EXT_DEVICEDATAENTRY NewDevice; +} EXT_SWAPTARGETDEVICE, *PEXT_SWAPTARGETDEVICE; + +#define EXT_DEF_LUN_BITMASK_LIST_MIN_ENTRIES 1 +#define EXT_DEF_LUN_BITMASK_LIST_MAX_ENTRIES 256 + +#ifdef _WIN64 +#define EXT_DEF_LUN_BITMASK_LIST_HEADER_SIZE 32 +#else +#define EXT_DEF_LUN_BITMASK_LIST_HEADER_SIZE \ + offsetof(LUN_BITMASK_LIST_BUFFER, asBitmaskEntry) +#endif + +#define EXT_DEF_LUN_BITMASK_LIST_MIN_SIZE \ + (EXT_DEF_LUN_BITMASK_LIST_HEADER_SIZE + \ + (sizeof(EXT_EXTERNAL_LUN_BITMASK_ENTRY) * EXT_DEF_LUN_BITMASK_LIST_MIN_ENTRIES)) +#define EXT_LUN_BITMASK_LIST_MAX_SIZE \ + (EXT_LUN_BITMASK_LIST_HEADER_SIZE + \ + (sizeof(EXT_EXTERNAL_LUN_BITMASK_ENTRY) * EXT_DEF_LUN_BITMASK_LIST_MAX_ENTRIES)) +/* + * LUN mask bit manipulation macros + * + * P = Pointer to an EXT_LUN_BIT_MASK union. + * L = LUN number. + */ +#define EXT_IS_LUN_BIT_SET(P,L) \ + ((P->mask[L/8] & (0x80 >> (L%8)))?1:0) + +#define EXT_SET_LUN_BIT(P,L) \ + (P->mask[L/8] |= (0x80 >> (L%8))) + +#define EXT_CLR_LUN_BIT(P,L) \ + (P->mask[L/8] &= ~(0x80 >> (L%8))) + + + +#ifdef _MSC_VER +#pragma pack() +#endif + +#endif /* _EXIOCT_H */ diff -urN linux-2.4.18/drivers/scsi/qla2x00exioctln.h lia64-2.4/drivers/scsi/qla2x00exioctln.h --- linux-2.4.18/drivers/scsi/qla2x00exioctln.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/scsi/qla2x00exioctln.h Mon Jul 23 14:12:47 2001 @@ -0,0 +1,131 @@ +/***************************************************************************** +* QLOGIC LINUX SOFTWARE +* +* QLogic ISP2x00 device driver for Linux 2.2.x and 2.4.x +* Copyright (C) 2000 Qlogic Corporation +* (www.qlogic.com) +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2, or (at your option) any +* later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +****************************************************************************/ + +/* + Rev 8 Jan 08, 2001 BN + - Added LOOP_BACK ioctl define + + Rev 7 Nov 06, 2000 BN + - Added EXT_DEF_MAX_AEN_QUEUE_OS define + - Added define for handle_hba_t + + Rev 6 Oct 25, 2000 BN + - Added EXT_CC_DRIVER_PROP_OS define + + Rev 5 Oct 25, 2000 BN + - Redo the copyright header and add AEN details + + Rev 4 Oct 23, 2000 BN + - Added definition for BOOLEAN + + Rev 3 Oct 23, 2000 + BN + - Added definitions for EXT_ADDR_MODE_OS + and also include of + + Rev 2 Oct 18, 2000 + BN + - Enable API Exention support + + Rev 1 Original version Sep 7, 2000 + BN + + + +*/ + +#include + +#if BITS_PER_LONG <= 32 +#define EXT_ADDR_MODE_OS EXT_DEF_ADDR_MODE_32 +#else +#define EXT_ADDR_MODE_OS EXT_DEF_ADDR_MODE_64 +#endif + +#define UINT8 uint8_t +#define UINT16 uint16_t +#define UINT32 uint32_t +#define UINT64 void * +#define BOOLEAN uint8_t + +#define uint8_t unsigned char +#define uint16_t unsigned short +#define uint32_t unsigned int + +#if BITS_PER_LONG > 32 +#define uint64_t unsigned long +#else +#define uint64_t unsigned long long +#endif + +typedef struct track_instance +{ + + int handle; + +} track_instance_t; + + +#define EXT_DEF_MAX_HBA_OS 256 /* 0 - 0xFF */ +#define EXT_DEF_MAX_BUS_OS 1 +#define EXT_DEF_MAX_TARGET_OS 256 /* 0 - 0xFF */ +#define EXT_DEF_MAX_LUN_OS 256 /* 0 - 0xFF */ + +#define EXT_DEF_MAX_AEN_QUEUE_OS 64 + +#define QLMULTIPATH_MAGIC 'y' +#define _QLBUILD /* for exioct.h to enable include of qinsdmgt.h */ + +#define EXT_CC_STARTIOCTL _IOWR(QLMULTIPATH_MAGIC, 0 , sizeof(EXT_IOCTL)) +#define EXT_CC_SETINSTANCE _IOWR(QLMULTIPATH_MAGIC, 1 , sizeof(EXT_IOCTL)) + +#define EXT_CC_QUERY_OS _IOWR(QLMULTIPATH_MAGIC, 2 , sizeof(EXT_IOCTL)) +#define EXT_CC_SEND_FCCT_PASSTHRU_OS _IOWR(QLMULTIPATH_MAGIC, 3 , sizeof(EXT_IOCTL)) +#define EXT_CC_READ_NVRAM_OS _IOWR(QLMULTIPATH_MAGIC, 4 , sizeof(EXT_IOCTL)) +#define EXT_CC_SCSI_PASSTHRU_OS _IOWR(QLMULTIPATH_MAGIC, 5 , sizeof(EXT_IOCTL)) +#define EXT_CC_STOP_QCMD _IOWR(QLMULTIPATH_MAGIC, 6 , sizeof(EXT_IOCTL)) +#define EXT_CC_RESUME_QCMD _IOWR(QLMULTIPATH_MAGIC, 7 , sizeof(EXT_IOCTL)) +#define EXT_CC_GET_DATA_OS _IOWR(QLMULTIPATH_MAGIC, 8 , sizeof(EXT_IOCTL)) +#define EXT_CC_WWPN_TO_SCSIADDR _IOWR(QLMULTIPATH_MAGIC, 9 , sizeof(EXT_IOCTL)) +#define EXT_CC_REG_AEN_OS _IOWR(QLMULTIPATH_MAGIC, 10 , sizeof(EXT_IOCTL)) +#define EXT_CC_GET_AEN_OS _IOWR(QLMULTIPATH_MAGIC, 11 , sizeof(EXT_IOCTL)) + +#define EXT_CC_DRIVER_PROP_OS _IOWR(QLMULTIPATH_MAGIC, 12 , sizeof(EXT_IOCTL)) + +#define EXT_CC_LOOPBACK_OS _IOWR(QLMULTIPATH_MAGIC, 20 , sizeof(EXT_IOCTL)) + + + +/* + * Overrides for Emacs so that we almost follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 2 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -2 + * c-argdecl-indent: 2 + * c-label-offset: -2 + * c-continued-statement-offset: 2 + * c-continued-brace-offset: 0 + * indent-tabs-mode: nil + * tab-width: 8 + * End: + */ diff -urN linux-2.4.18/drivers/scsi/qla2x00ioctl.c lia64-2.4/drivers/scsi/qla2x00ioctl.c --- linux-2.4.18/drivers/scsi/qla2x00ioctl.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/scsi/qla2x00ioctl.c Mon Jul 23 14:12:54 2001 @@ -0,0 +1,1179 @@ +/******************************************************************************** +* QLOGIC LINUX SOFTWARE +* +* QLogic QLA2x00 device driver for Linux 2.2.x and 2.4.x +* Copyright (C) 2000 Qlogic Corporation +* (www.qlogic.com) +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2, or (at your option) any +* later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +** +******************************************************************************/ +/**************************************************************************** +Revision History: + Rev. 1.3 Beta February 20, 2001 BN QLogic + - Zero the sp used for IOCTL SCSI Passthru operations + Rev. 1.2 Beta January 31, 2001 BN QLogic + - Added setting of scsi completion to pext->DetailStatus + and set pext->Status to EXT_STATUS_SCSI_STATUS. + - Added details to Statistics IOCTL for ispaborts, + lip_count, isr_count. + + Rev. 1.2 Beta January 8, 2001 BN QLogic + - Added loop-back diagnostic IOCTL support. + + Rev. 1.1 Beta October 27, 2000 BN QLogic + - Updated return status from ioctl function. + + Rev. 1.0 Beta October 20, 2000 BN QLogic + - Initial version check in + + +*/ + +void copy_up_EXT( PEXT_IOCTL pext, void *arg) { +uint32_t i; +uint8_t *usr_temp, *kernel_tmp; + + /* copy up the EXT_IOCTL to application (api library) */ + for (i=0 ; i < sizeof(EXT_IOCTL) ; i++) { + usr_temp = (uint8_t *)arg + i; + kernel_tmp = (uint8_t *)pext + i; + __put_user(*kernel_tmp, usr_temp); + } + + return; +} + + +/************************************************************************* + * ioctl_scsi_pt_done + * + * Description: + * Sets completion flag. + * + * Returns: + *************************************************************************/ +void ioctl_scsi_pt_done(Scsi_Cmnd *pscsi_cmd) { + struct Scsi_Host *host; + scsi_qla_host_t *ha; + + host = pscsi_cmd->host; + ha = (scsi_qla_host_t *) host->hostdata; + + ha->IoctlPassThru_InProgress = 0; + return; +} + + +/************************************************************************* + * ioctl_fcct_done + * + * Description: + * Sets completion flag. + * + * Returns: + *************************************************************************/ +void ioctl_fcct_done(Scsi_Cmnd *pscsi_cmd) { + struct Scsi_Host *host; + scsi_qla_host_t *ha; + + host = pscsi_cmd->host; + ha = (scsi_qla_host_t *) host->hostdata; + /* printk("ioctl_fcct_done post function called OK\n"); */ + DEBUG(sprintf(debug_buff,"ioctl_fcct_done post function called OK\n")); + DEBUG(qla2100_print(debug_buff)); + ha->IoctlPassFCCT_InProgress = 0; + return; +} + + +/************************************************************************* + * qla2100_ioctl + * + * Description: + * Performs ioctl requests not satified by the upper levels. + * + * Returns: + * ret = 0 Success + * ret != 0 Failed; detailed status copied to EXT_IOCTL structure + * if applicable + *************************************************************************/ +int +qla2100_ioctl(Scsi_Device *dev, int cmd, void *arg){ + + static EXT_IOCTL ext; + PEXT_IOCTL pext = &ext; + struct Scsi_Host *host; + scsi_qla_host_t *ha, *search_ha; + scsi_lu_t *q; +#if BITS_PER_LONG <= 32 + uint32_t handle; +#else + uint64_t handle; +#endif + uint32_t cnt, i, b, t, l, port_cnt, status; + uint32_t tgt_cnt, tgt, transfer_size, inst; + uint8_t *extptr, *usrsrc, *usr_temp, *kernel_tmp, *kernel_tmp1; + static Scsi_Cmnd scsi_cmd; + Scsi_Cmnd *pscsi_cmd = &scsi_cmd; + static Scsi_Device scsi_device; + static srb_t ioctl_sp; + srb_t *sp = &ioctl_sp; + static EXT_SCSI_PASSTHRU scsi_pass; + EXT_SCSI_PASSTHRU *pscsi_pass = &scsi_pass; + static EXT_HBA_NODE tmp_hba_node; + static EXT_HBA_PORT tmp_hba_port; + static EXT_DISC_PORT tmp_disc_port; + static EXT_DISC_TARGET tmp_disc_target; + static EXT_CHIP tmp_isp; + static EXT_HBA_PORT_STAT tmp_stat; + uint16_t mb[MAILBOX_REGISTER_COUNT]; + unsigned long cpu_flags = 0; + uint16_t scratch; + uint16_t *wptr = &scratch; + qla_boards_t *bdp; + uint8_t *temp; + uint8_t tempbuf[8]; + cmd_ms_iocb_entry_t *pkt; + + int ret = EINVAL; + + BZERO((caddr_t)sp,sizeof(srb_t)); + + host = dev->host; + ha = (scsi_qla_host_t *) host->hostdata; /* midlayer chosen instance */ + + ret = verify_area(VERIFY_READ, (void *)arg, sizeof(EXT_IOCTL)); + if (ret) { + DEBUG2(printk("[qla2100_ioctl: ERROR in verify_area READ ha=%8x]\n",(uint32_t)ha);) + return(ret); + } + /* copy in application layer EXT_IOCTL */ + for (i=0 ; i < sizeof(EXT_IOCTL) ; i++) { + usrsrc = (uint8_t *)(arg + i); + extptr = (uint8_t *)pext + i; + __get_user(*extptr, usrsrc); + } + + /* printk("[GOT QLA2100 IOCTL sig=%s cmd=%x]\n", + (char *)&pext->Signature,cmd); */ + + /* check signature of this ioctl */ + temp = (uint8_t *) &pext->Signature; +#if BITS_PER_LONG <= 32 +for (i=0 ; i<4 ; i++,temp++) tempbuf[i] = *temp; + if( (tempbuf[0] == 'Q') && (tempbuf[1] == 'L') && + (tempbuf[2] == 'O') && (tempbuf[3] == 'G')) status = 0; + else status = 1; +#else + if( (tempbuf[0] == 'Q') && (tempbuf[1] == 'L') && + (tempbuf[2] == 'O') && (tempbuf[3] == 'G') && + (tempbuf[4] == 'I') && (tempbuf[5] == 'C')) status = 0; + else status = 1; +#endif + if ( status != 0) { + DEBUG2(printk("[GOT QLA2100 IOCTL but signature did not match ha=%8x]\n", + (uint32_t)ha);) + ret = EXT_STATUS_ERR; + return(ret); + } + /* check version of this ioctl */ + if (pext->Version != EXT_VERSION) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_INVALID_PARAM; + copy_up_EXT(pext,arg); + printk(KERN_WARNING "qla2x00: GOT QLA2100 IOCTL but version did not match.\n"); + ret = EXT_STATUS_ERR; + return(ret); + } + /* check for API setting HBA Instance for subsequent operations */ + if (cmd == (int)EXT_CC_SETINSTANCE) { + /* since API opens devices once and uses handle for subsequent calls */ + /* we keep a parameter to designate the "active HBA" for ioctls */ + if (pext->HbaSelect < num_hosts) { + apiHBAInstance = pext->HbaSelect; + pext->Status = EXT_STATUS_OK; + pext->DetailStatus = EXT_STATUS_OK; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_OK; + } else { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_INVALID_PARAM; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR in EXT_SETINSTANCE ha=%8x]\n",(uint32_t)ha);) + ret = EXT_STATUS_ERR; + } + return(ret); /* Instance for subsequent IOCTLs are not set */ + } + + /* check for valid apiHBAInstance (set previously by EXT_SETINSTANCE + or default 0) and set ha context for this IOCTL */ + for (search_ha=qla2100_hostlist; + (search_ha != NULL) && search_ha->instance != apiHBAInstance; + search_ha = search_ha->next) ; + if ( !search_ha ) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_INVALID_PARAM; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR in matching apiHBAInstance to an HBA Instance]\n");) + ret = EXT_STATUS_ERR; + return(ret); + } + /* IOCTL ha context is ready to be set from apiHBAInstance */ + ha = search_ha; + /* set EXT_IOCTL.HbaSelect for reference by IOCTL caller */ + pext->HbaSelect = apiHBAInstance; + + switch (cmd) { /* switch on EXT IOCTL COMMAND CODE */ + case EXT_CC_STARTIOCTL: + pext->Instance = num_hosts; + pext->Status = EXT_STATUS_OK; + pext->DetailStatus = EXT_STATUS_OK; + copy_up_EXT(pext,arg); + /*printk("[QLA2100 EXT_STARTIOCTL did OK ]\n");*/ + ret = EXT_STATUS_OK; + break; + case EXT_CC_QUERY: + /* All Query type ioctls are done here */ + switch(pext->SubCode) { + case EXT_SC_QUERY_HBA_NODE: + /* fill all available HBA NODE Information */ + bdp = &QLBoardTbl_fc[ha->devnum]; + for (i=0; i < 8 ;i++) tmp_hba_node.WWNN[i] = ha->node_name[i]; + sprintf((char *)(tmp_hba_node.Manufacturer),"Qlogic Corp."); + sprintf((char *)(tmp_hba_node.Model),(char *)&bdp->bdName[0]); + tmp_hba_node.SerialNum[0] = ha->node_name[5]; + tmp_hba_node.SerialNum[1] = ha->node_name[6]; + tmp_hba_node.SerialNum[2] = ha->node_name[7]; + sprintf((char *)(tmp_hba_node.DriverVersion),QLA2100_VERSION); + sprintf((char *)(tmp_hba_node.FWVersion),"%2d.%02d.%02d", + bdp->fwver[0], bdp->fwver[1], bdp->fwver[2]); + /* tmp_hba_node.NvramVersion = ha->nvram_version; */ + sprintf((char *)(tmp_hba_node.OptRomVersion),"0"); + tmp_hba_node.InterfaceType = EXT_DEF_FC_INTF_TYPE; + tmp_hba_node.PortCount = 1; + + ret = verify_area(VERIFY_WRITE, (void *)pext->ResponseAdr, + sizeof(EXT_HBA_NODE)); + if (ret) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR verify_area WRITE ha=%8x]\n",(uint32_t)ha);) + return(ret); + } + /* now copy up the HBA_NODE to user */ + if (pext->ResponseLen < sizeof(EXT_HBA_NODE)) transfer_size = pext->ResponseLen; + else transfer_size = sizeof(EXT_HBA_NODE); + for (i=0 ; i < transfer_size ; i++) { + usr_temp = (uint8_t *)pext->ResponseAdr + i; + kernel_tmp = (uint8_t *)&tmp_hba_node + i; + __put_user(*kernel_tmp, usr_temp); + } + /*printk("[finished QLA2100 IOCTL QUERY_HBA_NODE ]\n"); */ + pext->Status = EXT_STATUS_OK; + pext->DetailStatus = EXT_STATUS_OK; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_OK; + break; + case EXT_SC_QUERY_HBA_PORT: + /* reflect all HBA PORT related info */ + tmp_hba_port.WWPN[7] = ha->init_cb->port_name[7]; + tmp_hba_port.WWPN[6] = ha->init_cb->port_name[6]; + tmp_hba_port.WWPN[5] = ha->init_cb->port_name[5]; + tmp_hba_port.WWPN[4] = ha->init_cb->port_name[4]; + tmp_hba_port.WWPN[3] = ha->init_cb->port_name[3]; + tmp_hba_port.WWPN[2] = ha->init_cb->port_name[2]; + tmp_hba_port.WWPN[1] = ha->init_cb->port_name[1]; + tmp_hba_port.WWPN[0] = ha->init_cb->port_name[0]; + tmp_hba_port.Id[1] = ha->port_id[0]; + tmp_hba_port.Id[2] = ha->port_id[1]; + tmp_hba_port.Id[3] = ha->port_id[2]; + tmp_hba_port.Type = EXT_DEF_INITIATOR_DEV; + + port_cnt = 0; + tgt_cnt = 0; + for (tgt = 0; tgt < MAX_FIBRE_DEVICES ; tgt++) { + if (ha->fc_db[tgt].loop_id > LAST_SNS_LOOP_ID) + continue; + port_cnt++; + + /* at this point the linux driver does not differentiate */ + /* Initiator devices (ie HBAs) from Targets; so the count */ + /* is same for both */ + /* if (ha->fc_db[tgt] & FC_INITIATOR_DEVICE) + continue; */ + tgt_cnt++; + } + tmp_hba_port.DiscPortCount = port_cnt; + tmp_hba_port.DiscTargetCount = tgt_cnt; + + if ( ha->loop_down_timer == 0 && ha->loop_state == LOOP_DOWN) { + tmp_hba_port.State = EXT_DEF_HBA_LOOP_DOWN; + } else tmp_hba_port.State = EXT_DEF_HBA_OK; + tmp_hba_port.DiscPortNameType = EXT_DEF_USE_PORT_NAME; + + ret = verify_area(VERIFY_WRITE, (void *)pext->ResponseAdr , + sizeof(EXT_HBA_PORT)); + if (ret) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR verify_area WRITE ha=%8x]\n",(uint32_t)ha);) + return(ret); + } + /* now copy up the HBA_PORT to user */ + if (pext->ResponseLen < sizeof(EXT_HBA_PORT)) transfer_size = pext->ResponseLen; + else transfer_size = sizeof(EXT_HBA_PORT); + for (i=0 ; i < transfer_size ; i++) { + usr_temp = (uint8_t *)pext->ResponseAdr + i; + kernel_tmp = (uint8_t *)&tmp_hba_port + i; + __put_user(*kernel_tmp, usr_temp); + } + /*printk("[finished QLA2100 IOCTL QUERY_HBA_PORT ports=%x tgts=%x]\n",port_cnt,tgt_cnt); */ + pext->Status = EXT_STATUS_OK; + pext->DetailStatus = EXT_STATUS_OK; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_OK; + break; + case EXT_SC_QUERY_DISC_PORT: + for (tgt=0, inst=0; tgt < MAX_FIBRE_DEVICES; tgt++) { + if (ha->fc_db[tgt].loop_id > LAST_SNS_LOOP_ID) + continue; + if( inst != pext->Instance ) { + inst++; + continue; + } + break; + } + if (tgt == MAX_FIBRE_DEVICES) { + pext->Status = ret = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_DEV_NOT_FOUND; + copy_up_EXT(pext,arg); + return(ret); + } + + tmp_disc_port.WWNN[0] = ha->fc_db[tgt].name[0]; + tmp_disc_port.WWNN[1] = ha->fc_db[tgt].name[1]; + tmp_disc_port.WWNN[2] = ha->fc_db[tgt].name[2]; + tmp_disc_port.WWNN[3] = ha->fc_db[tgt].name[3]; + + tmp_disc_port.WWNN[4] = ha->fc_db[tgt].name[4]; + tmp_disc_port.WWNN[5] = ha->fc_db[tgt].name[5]; + tmp_disc_port.WWNN[6] = ha->fc_db[tgt].name[6]; + tmp_disc_port.WWNN[7] = ha->fc_db[tgt].name[7]; + + tmp_disc_port.WWPN[0] = ha->fc_db[tgt].wwn[0]; + tmp_disc_port.WWPN[1] = ha->fc_db[tgt].wwn[1]; + tmp_disc_port.WWPN[2] = ha->fc_db[tgt].wwn[2]; + tmp_disc_port.WWPN[3] = ha->fc_db[tgt].wwn[3]; + + tmp_disc_port.WWPN[4] = ha->fc_db[tgt].wwn[4]; + tmp_disc_port.WWPN[5] = ha->fc_db[tgt].wwn[5]; + tmp_disc_port.WWPN[6] = ha->fc_db[tgt].wwn[6]; + tmp_disc_port.WWPN[7] = ha->fc_db[tgt].wwn[7]; + + tmp_disc_port.Id[1] = ha->fc_db[tgt].port_id[0]; + tmp_disc_port.Id[2] = ha->fc_db[tgt].port_id[1]; + tmp_disc_port.Id[3] = ha->fc_db[tgt].port_id[2]; + tmp_disc_port.Type = EXT_DEF_TARGET_DEV; + + tmp_disc_port.Status = EXT_STATUS_OK; + tmp_disc_port.Bus = 0; + tmp_disc_port.TargetId = tgt; + + ret = verify_area(VERIFY_WRITE, (void *)pext->ResponseAdr , + sizeof(EXT_DISC_PORT)); + if (ret) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR verify_area WRITE ha=%8x]\n",(uint32_t)ha);) + return(ret); + } + + /* now copy up the DISC_PORT to user */ + if (pext->ResponseLen < sizeof(EXT_DISC_PORT)) transfer_size = pext->ResponseLen; + else transfer_size = sizeof(EXT_DISC_PORT); + for (i=0 ; i < transfer_size ; i++) { + usr_temp = (uint8_t *)pext->ResponseAdr + i; + kernel_tmp = (uint8_t *)&tmp_disc_port + i; + __put_user(*kernel_tmp, usr_temp); + } + /*printk("[finished QLA2100 IOCTL QUERY_DISC_PORT ]\n"); */ + pext->Status = EXT_STATUS_OK; + pext->DetailStatus = EXT_STATUS_OK; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_OK; + break; + case EXT_SC_QUERY_DISC_TGT: + /* (for multipath merge) to do: search the ha->tgt[][] data base + instead of ha->fc_db[] so that we give details on Targets that + are visible to the OS. */ + for (tgt=0, inst=0; tgt < MAX_FIBRE_DEVICES; tgt++) { + if (ha->fc_db[tgt].loop_id > LAST_SNS_LOOP_ID) + continue; + if( inst != pext->Instance ) { + inst++; + continue; + } + break; + } + if (tgt == MAX_FIBRE_DEVICES) { + pext->Status = ret = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_DEV_NOT_FOUND; + copy_up_EXT(pext,arg); + return(ret); + } + tmp_disc_target.WWNN[0]= ha->fc_db[tgt].name[0]; + tmp_disc_target.WWNN[1]= ha->fc_db[tgt].name[1]; + tmp_disc_target.WWNN[2]= ha->fc_db[tgt].name[2]; + tmp_disc_target.WWNN[3]= ha->fc_db[tgt].name[3]; + + tmp_disc_target.WWNN[4]= ha->fc_db[tgt].name[4]; + tmp_disc_target.WWNN[5]= ha->fc_db[tgt].name[5]; + tmp_disc_target.WWNN[6]= ha->fc_db[tgt].name[6]; + tmp_disc_target.WWNN[7]= ha->fc_db[tgt].name[7]; + + + tmp_disc_target.WWPN[0]= ha->fc_db[tgt].wwn[0]; + tmp_disc_target.WWPN[1]= ha->fc_db[tgt].wwn[1]; + tmp_disc_target.WWPN[2]= ha->fc_db[tgt].wwn[2]; + tmp_disc_target.WWPN[3]= ha->fc_db[tgt].wwn[3]; + + tmp_disc_target.WWPN[4]= ha->fc_db[tgt].wwn[4]; + tmp_disc_target.WWPN[5]= ha->fc_db[tgt].wwn[5]; + tmp_disc_target.WWPN[6]= ha->fc_db[tgt].wwn[6]; + tmp_disc_target.WWPN[7]= ha->fc_db[tgt].wwn[7]; + tmp_disc_target.Id[1] = ha->fc_db[tgt].port_id[0]; + tmp_disc_target.Id[2] = ha->fc_db[tgt].port_id[1]; + tmp_disc_target.Id[3] = ha->fc_db[tgt].port_id[2]; + tmp_disc_target.Type = EXT_DEF_TARGET_DEV; + + tmp_disc_target.Status = EXT_STATUS_OK; + tmp_disc_target.Bus = 0; + tmp_disc_target.TargetId = tgt; + + cnt = 0; + for (i=0; i < MAX_LUNS ; i++) { + if ((ha->tgt[0][tgt])->luns[i] !=0) + cnt++; + } + tmp_disc_target.LunCount = cnt; + + ret = verify_area(VERIFY_WRITE, (void *)pext->ResponseAdr , + sizeof(EXT_DISC_TARGET)); + if (ret) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR verify_area WRITE ha=%8x]\n",(uint32_t)ha);) + return(ret); + } + /* now copy up the DISC_TGT to user */ + if (pext->ResponseLen < sizeof(EXT_DISC_PORT)) transfer_size = pext->ResponseLen; + else transfer_size = sizeof(EXT_DISC_TARGET); + for (i=0 ; i < transfer_size ; i++) { + usr_temp = (uint8_t *)pext->ResponseAdr + i; + kernel_tmp = (uint8_t *)&tmp_disc_target + i; + __put_user(*kernel_tmp, usr_temp); + } + /* printk("[finished QLA2100 IOCTL QUERY_DISC_TGT Luns=%x pid0=%x pid1=%x pid2=%x]\n",cnt,ha->fc_db[tgt].port_id[0],ha->fc_db[tgt].port_id[1],ha->fc_db[tgt].port_id[2]);*/ + + pext->Status = EXT_STATUS_OK; + pext->DetailStatus = EXT_STATUS_OK; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_OK; + break; + case EXT_SC_QUERY_CHIP: + host = ha->host; + tmp_isp.VendorId = QLA2100_VENDOR_ID; + tmp_isp.DeviceId = ha->device_id; + tmp_isp.SubVendorId = QLA2100_VENDOR_ID; + tmp_isp.SubSystemId = 0; + tmp_isp.PciBusNumber = ha->pci_bus; + tmp_isp.PciSlotNumber = (ha->pci_device_fn & 0xf8) >> 3; + tmp_isp.IoAddr = host->io_port; + tmp_isp.IoAddrLen = 512; + tmp_isp.MemAddr = 0; + tmp_isp.MemAddrLen = 0; + tmp_isp.ChipType = 0; + tmp_isp.InterruptLevel = host->irq; + for (i=0;i<8;i++) tmp_isp.OutMbx[i] = 0; + + ret = verify_area(VERIFY_WRITE, (void *)pext->ResponseAdr , + sizeof(EXT_CHIP)); + if (ret) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR verify_area WRITE ha=%8x]\n",(uint32_t)ha);) + return(ret); + } + /* now copy up the ISP to user */ + if (pext->ResponseLen < sizeof(EXT_CHIP)) transfer_size = pext->ResponseLen; + else transfer_size = sizeof(EXT_CHIP); + for (i=0 ; i < transfer_size ; i++) { + usr_temp = (uint8_t *)pext->ResponseAdr + i; + kernel_tmp = (uint8_t *)&tmp_isp + i; + __put_user(*kernel_tmp, usr_temp); + } + /* printk("[finished QLA2100 IOCTL QUERY_CHIP]\n"); */ + pext->Status = EXT_STATUS_OK; + pext->DetailStatus = EXT_STATUS_OK; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_OK; + break; + + case EXT_SC_QUERY_DISC_LUN: + pext->Status = EXT_STATUS_OK; + pext->DetailStatus = EXT_STATUS_OK; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_OK; + break; + default: + ret = EXT_STATUS_ERR; + break; + } + break; + case EXT_CC_GET_DATA: + switch(pext->SubCode) { + case EXT_SC_GET_STATISTICS: + + tmp_stat.ControllerErrorCount = ha->isp_aborts; + tmp_stat.DeviceErrorCount = 0; + tmp_stat.TotalIoCount = ha->qthreads; + tmp_stat.TotalMBytes = 0; + tmp_stat.TotalLipResets = ha->lip_count; + tmp_stat.TotalInterrupts = ha->isr_count; + + ret = verify_area(VERIFY_WRITE, (void *)pext->ResponseAdr, + sizeof(EXT_HBA_PORT_STAT)); + if (ret) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR verify_area WRITE ha=%8x]\n",(uint32_t)ha);) + return(ret); + } + /* now copy up the STATISTICS to user */ + if (pext->ResponseLen < sizeof(EXT_HBA_PORT_STAT)) transfer_size = pext->ResponseLen; + else transfer_size = sizeof(EXT_HBA_PORT_STAT); + for (i=0 ; i < transfer_size ; i++) { + usr_temp = (uint8_t *)pext->ResponseAdr + i; + kernel_tmp = (uint8_t *)&tmp_stat + i; + __put_user(*kernel_tmp, usr_temp); + } + /*printk("[finished QLA2100 IOCTL STATISTICS ]\n");*/ + pext->Status = EXT_STATUS_OK; + pext->DetailStatus = EXT_STATUS_OK; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_OK; + break; + default: + break; + } + break; + case EXT_CC_SEND_FCCT_PASSTHRU: + DEBUG(sprintf(debug_buff,"qla2100_ioctl: start EXT_CC_SEND_FCCT_PASSTHRU\n")); + DEBUG(qla2100_print(debug_buff)); + /* Management Server type (fc switch) pass thru ioctl */ + /* same as EXT_FCSCSI_REQ but it is going to the FC switch */ + /* clear ioctl_sp and scsi_cmd to be used */ + kernel_tmp = (uint8_t *)sp; + for (i=0;iioctl_mem; + for (i=0;iResponseLen > PAGE_SIZE) pext->ResponseLen = PAGE_SIZE; + if (pext->RequestLen > PAGE_SIZE) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_INVALID_PARAM; + copy_up_EXT(pext,arg); + /*printk("[EXT_CC_SEND_FCCT_PASSTHRU too big ResponseLen=%x ReqLen=%x]\n",pext->ResponseLen,pext->RequestLen); */ + DEBUG2(printk("[qla2100_ioctl: ERROR size of requested Resp_len in EXT_CC_SEND_FCCT_PASSTHRU]\n");) + return(ret); + } + ret = verify_area(VERIFY_READ, (void *)pext->RequestAdr, + pext->RequestLen); + if (ret){ + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + /*printk("[EXT_CC_SEND_FCCT_PASSTHRU verify read error]\n");*/ + DEBUG2(printk("[qla2100_ioctl: ERROR verify_area READ of EXT_CC_SEND_FCCT_PASSTHRU]\n");) + return(ret); + } + for (i=0 ; i < pext->RequestLen ; i++) { + /* copy in from user space the fcct command to be sent */ + usr_temp = (uint8_t *)pext->RequestAdr + i; + kernel_tmp = (uint8_t *)ha->ioctl_mem + i; + __get_user(*kernel_tmp, usr_temp); + /* printk("{%x}",*kernel_tmp); */ + } + /* check on current topology or loop down */ + if ((ha->current_topology != ISP_CFG_F) && + (ha->current_topology != ISP_CFG_FL ) ) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_DEV_NOT_FOUND; + copy_up_EXT(pext,arg); + /*printk("[EXT_CC_SEND_FCCT_PASSTHRU wrong topology current=%x]\n", + ha->current_topology); */ + DEBUG2(printk("[qla2100_ioctl: ERROR EXT_CC_SEND_FCCT_PASSTHRU not in F-Port or FL-Port mode]\n");) + return(ret); + } + /* check on loop down */ + if ( ha->loop_down_timer == 0 && ha->loop_state == LOOP_DOWN) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_DEV_NOT_FOUND; + copy_up_EXT(pext,arg); + /* printk("[EXT_CC_SEND_FCCT_PASSTHRU loop down]\n"); */ + DEBUG2(printk("[qla2100_ioctl: ERROR EXT_CC_SEND_FCCT_PASSTHRU not in F-Port mode]\n");) + return(ret); + } + /* login to management server device */ + if (ha->flags.managment_server_logged_in == 0) { + mb[0] = MBC_LOGIN_FABRIC_PORT; + mb[1] = MANAGEMENT_SERVER << 8; + mb[2] = 0xff; + mb[3] = 0xfffa; + + ret = qla2100_mailbox_command(ha, BIT_3|BIT_2|BIT_1|BIT_0, + &mb[0]); + if ( (ret != 0) || (mb[0] == 0x4006) || + (mb[0] == 0x4009) || (mb[0] != 0x4000) ) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_DEV_NOT_FOUND; + copy_up_EXT(pext,arg); + /* printk("[EXT_CC_SEND_FCCT_PASSTHRU could not login to sns]\n"); */ + DEBUG2(printk("[qla2100_ioctl: ERROR could not login to Management Server]\n");) + DEBUG(sprintf(debug_buff,"FCCT ioctl: call qla2100_ms_req_pkt\n")); + DEBUG(qla2100_print(debug_buff)); + return(ret); + } + ha->flags.managment_server_logged_in = 1; + } + + /* setup sp for this FCCT pass thru */ + pscsi_cmd->host = ha->host; + sp->cmd = pscsi_cmd; + sp->flags = SRB_WATCHDOG; + + /* mark this as a special delivery and collection command */ + scsi_cmd.flags = 0; + scsi_cmd.scsi_done = ioctl_fcct_done; + + DEBUG(sprintf(debug_buff,"FCCT ioctl: FABRIC_LOGIN OK, call qla2100_ms_req_pkt\n")); + DEBUG(qla2100_print(debug_buff)); + + /* get spin lock for this operation */ + spin_lock_irqsave(&io_request_lock, cpu_flags); + + /* Get MS request packet. */ + if( (pkt = (cmd_ms_iocb_entry_t *)qla2100_ms_req_pkt(ha, sp) ) ) { + pkt->entry_type = MS_IOCB_TYPE; + pkt->entry_count = 1; + pkt->loop_id = MANAGEMENT_SERVER; + pkt->timeout = 4; + pkt->DSDcount = 1; + pkt->RespDSDcount = 2; + pkt->Response_bytecount = pext->ResponseLen; + pkt->Request_bytecount = pext->RequestLen; + + /* loading command payload address */ + pkt->dseg_req_address[0] = LS_64BITS(ha->ioctl_mem_phys); + pkt->dseg_req_address[1] = MS_64BITS(ha->ioctl_mem_phys); + pkt->dseg_req_length = pext->RequestLen; + + /* loading command response address */ + pkt->dseg_rsp_address[0] = LS_64BITS(ha->ioctl_mem_phys); + pkt->dseg_rsp_address[1] = MS_64BITS(ha->ioctl_mem_phys); + pkt->dseg_rsp_length = pext->ResponseLen; + + /* set flag to indicate IOCTL FCCT PassThru in progress */ + ha->IoctlPassFCCT_InProgress = 1; + + ha->ioctl_timer = 6; /* 6 ticks of 1 second timer max wait */ + + /* Issue command to ISP */ + qla2100_isp_cmd(ha); + } + /* release spin lock since command is issued */ + spin_unlock_irqrestore(&io_request_lock, cpu_flags); + + DEBUG(sprintf(debug_buff, + "FCCT ioctl: Command issued and released spin lock\n")); + DEBUG(qla2100_print(debug_buff)); + + if (!pkt) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_DEV_NOT_FOUND; + copy_up_EXT(pext,arg); + /* printk("[EXT_CC_SEND_FCCT_PASSTHRU could not get Request Packet]\n"); */ + DEBUG2(printk("[qla2100_ioctl:EXT_CC_SEND_FCCT_PASSTHRU could not get Request Packet]\n");) + return(ret); + } + + /* wait for post function or timer to zero the InProgress flag */ + while (ha->IoctlPassFCCT_InProgress == 1) { + udelay(35); + } + + DEBUG(sprintf(debug_buff, + "FCCT ioctl: finished while(InProgress) wait loop \n")); + DEBUG(qla2100_print(debug_buff)); + /* printk("[FCCT IOCTL finished while(InProgress) wait loop ]\n");*/ + + if (ha->IoctlPassFCCT_InProgress == 1) { + /* We waited and post function did not get called */ + DEBUG(printk("[FCCT IOCTL post function not called]\n");) + DEBUG(sprintf(debug_buff, + "FCCT ioctl: post function not called \n")); + DEBUG(qla2100_print(debug_buff)); + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_DEV_NOT_FOUND; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_ERR; + } else { + /* getting device data and putting in pext->ResponseAdr */ + /* printk("[post function called; start FCCT IOCTL returning up data ]\n");*/ + ret = verify_area(VERIFY_WRITE, (void *)pext->ResponseAdr , + pext->ResponseLen); + if (ret) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR verify_area WRITE for IOCTL PT ha=%8x]\n", + (uint32_t)ha);) + return(ret); + } + /* sending back data returned from Management Server */ + for (i=0 ; i < pext->ResponseLen ; i++) { + usr_temp = (uint8_t *)pext->ResponseAdr + i; + kernel_tmp = (uint8_t *)ha->ioctl_mem + i; + /*printk("[%x]",*kernel_tmp);*/ + __put_user(*kernel_tmp, usr_temp); + } + /*printk("[finished QLA2100 IOCTL EXT_CC_SEND_FCCT_PASSTHRU]\n");*/ + pext->Status = EXT_STATUS_SCSI_STATUS; + pext->DetailStatus = sp->scode; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_OK; + } + break; + + case EXT_CC_SEND_SCSI_PASSTHRU: + /* printk("[start EXT_CC_SEND_SCSI_PASSTHRU]\n"); */ + ret = verify_area(VERIFY_READ, (void *)pext->RequestAdr, + sizeof(EXT_SCSI_PASSTHRU)); + if (ret) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR verify_area READ of EXT_SCSI_PASSTHRU]\n");) + return(ret); + } + for (i=0 ; i < sizeof(EXT_SCSI_PASSTHRU) ; i++) { + usr_temp = (uint8_t *)pext->RequestAdr + i; + kernel_tmp = (uint8_t *)pscsi_pass + i; + __get_user(*kernel_tmp, usr_temp); + } + if (pext->ResponseLen > PAGE_SIZE) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_INVALID_PARAM; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR size of requested EXT_SCSI_PASSTHRU]\n");) + return(ret); + } + /* clear ioctl_sp and scsi_cmd and scsi_device to be used */ + kernel_tmp = (uint8_t *)sp; + for (i=0;iioctl_mem; + for (i=0;ihost = ha->host; + sp->cmd = pscsi_cmd; + sp->flags = SRB_WATCHDOG; + + /* mark this as a special delivery and collection command */ + scsi_cmd.flags = 0; + scsi_cmd.scsi_done = ioctl_scsi_pt_done; + + scsi_cmd.device = &scsi_device; + scsi_cmd.device->tagged_queue = 0; + scsi_cmd.use_sg = 0; /* no ScatterGather */ + scsi_cmd.target = pscsi_pass->TargetAddr.Target; + scsi_cmd.lun = pscsi_pass->TargetAddr.Lun; + scsi_cmd.request_bufflen = pext->ResponseLen; + scsi_cmd.request_buffer = ha->ioctl_mem; + scsi_cmd.timeout_per_command = 0x300; + + // printk("[start FCSCSI IOCTL look at direction t=%x l=%x]\n", + // scsi_cmd.target,scsi_cmd.lun); + if (pscsi_pass->Direction == EXT_DEF_SCSI_PASSTHRU_DATA_OUT) { + /* sending user data from pext->ResponseAdr to device */ + ret = verify_area(VERIFY_READ, (void *)pext->ResponseAdr, + pext->ResponseLen); + if (ret) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR verify_area READ EXT_SCSI_PASSTHRU]\n");) + return(ret); + } + for (i=0 ; i < pext->ResponseLen ; i++) { + usr_temp = (uint8_t *)pext->ResponseAdr + i; + kernel_tmp = (uint8_t *)ha->ioctl_mem + i; + __get_user(*kernel_tmp, usr_temp); + } + } + if (pscsi_pass->CdbLength == 6) { + scsi_cmd.cmd_len = 6; + scsi_cmd.data_cmnd[0] = scsi_cmd.cmnd[0] = pscsi_pass->Cdb[0]; + scsi_cmd.data_cmnd[1] = scsi_cmd.cmnd[1] = pscsi_pass->Cdb[1]; + scsi_cmd.data_cmnd[2] = scsi_cmd.cmnd[2] = pscsi_pass->Cdb[2]; + scsi_cmd.data_cmnd[3] = scsi_cmd.cmnd[3] = pscsi_pass->Cdb[3]; + scsi_cmd.data_cmnd[4] = scsi_cmd.cmnd[4] = pscsi_pass->Cdb[4]; + scsi_cmd.data_cmnd[5] = scsi_cmd.cmnd[5] = pscsi_pass->Cdb[5]; + scsi_cmd.data_cmnd[6] = scsi_cmd.cmnd[6] = 0; + scsi_cmd.data_cmnd[7] = scsi_cmd.cmnd[7] = 0; + scsi_cmd.data_cmnd[8] = scsi_cmd.cmnd[8] = 0; + scsi_cmd.data_cmnd[9] = scsi_cmd.cmnd[9] = 0; + } else if (pscsi_pass->CdbLength == 10) { + scsi_cmd.cmd_len = 0x0A; + scsi_cmd.data_cmnd[0] = scsi_cmd.cmnd[0] = pscsi_pass->Cdb[0]; + scsi_cmd.data_cmnd[1] = scsi_cmd.cmnd[1] = pscsi_pass->Cdb[1]; + scsi_cmd.data_cmnd[2] = scsi_cmd.cmnd[2] = pscsi_pass->Cdb[2]; + scsi_cmd.data_cmnd[3] = scsi_cmd.cmnd[3] = pscsi_pass->Cdb[3]; + scsi_cmd.data_cmnd[4] = scsi_cmd.cmnd[4] = pscsi_pass->Cdb[4]; + scsi_cmd.data_cmnd[5] = scsi_cmd.cmnd[5] = pscsi_pass->Cdb[5]; + scsi_cmd.data_cmnd[6] = scsi_cmd.cmnd[6] = pscsi_pass->Cdb[6]; + scsi_cmd.data_cmnd[7] = scsi_cmd.cmnd[7] = pscsi_pass->Cdb[7]; + scsi_cmd.data_cmnd[8] = scsi_cmd.cmnd[8] = pscsi_pass->Cdb[8]; + scsi_cmd.data_cmnd[9] = scsi_cmd.cmnd[9] = pscsi_pass->Cdb[9]; + } else if (pscsi_pass->CdbLength == 12) { + scsi_cmd.cmd_len = 0x0C; + scsi_cmd.data_cmnd[0] = scsi_cmd.cmnd[0] = pscsi_pass->Cdb[0]; + scsi_cmd.data_cmnd[1] = scsi_cmd.cmnd[1] = pscsi_pass->Cdb[1]; + scsi_cmd.data_cmnd[2] = scsi_cmd.cmnd[2] = pscsi_pass->Cdb[2]; + scsi_cmd.data_cmnd[3] = scsi_cmd.cmnd[3] = pscsi_pass->Cdb[3]; + scsi_cmd.data_cmnd[4] = scsi_cmd.cmnd[4] = pscsi_pass->Cdb[4]; + scsi_cmd.data_cmnd[5] = scsi_cmd.cmnd[5] = pscsi_pass->Cdb[5]; + scsi_cmd.data_cmnd[6] = scsi_cmd.cmnd[6] = pscsi_pass->Cdb[6]; + scsi_cmd.data_cmnd[7] = scsi_cmd.cmnd[7] = pscsi_pass->Cdb[7]; + scsi_cmd.data_cmnd[8] = scsi_cmd.cmnd[8] = pscsi_pass->Cdb[8]; + scsi_cmd.data_cmnd[9] = scsi_cmd.cmnd[9] = pscsi_pass->Cdb[9]; + scsi_cmd.data_cmnd[10] = scsi_cmd.cmnd[10] = pscsi_pass->Cdb[10]; + scsi_cmd.data_cmnd[11] = scsi_cmd.cmnd[10] = pscsi_pass->Cdb[11]; + } + /* Generate LU queue on bus, target, LUN */ + b = SCSI_BUS_32(pscsi_cmd); + t = SCSI_TCN_32(pscsi_cmd); + l = SCSI_LUN_32(pscsi_cmd); + + /* set sp->target for 32bit/64bit delivery */ + sp->wdg_time = 0; + + /* check presense of requested target and other conditions */ + if( TGT_Q(ha,b,t) == NULL || + ( TGT_Q(ha,b,t) && TGT_Q(ha,b,t)->loop_id > LAST_SNS_LOOP_ID) || + ( ha->loop_down_timer == 0 && ha->loop_state == LOOP_DOWN)) { + printk(KERN_WARNING "qla2x00: FCSCSI IOCTL Target MISSING.\n"); + DEBUG2(printk("scsi(%2d:%2d:%2d:%2d): SCSI PT port unavailable\n", + (int)ha->host_no,b,t,l);) + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_DEV_NOT_FOUND; + copy_up_EXT(pext,arg); + return(ret); + } + /* get spin lock for this operation */ + spin_lock_irqsave(&io_request_lock, cpu_flags); + + /* Allocate a LUN/DEVICE queue from this request */ + if( (q = GET_LU_Q(ha, b, t,l)) == NULL ) { + DRIVER_LOCK + if( (q = qla2100_lun_alloc()) == NULL ) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_DEV_NOT_FOUND; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR in GET_LU_Q for SCSI_PASSTHRU ha=%8x]\n", + (uint32_t)ha);) + ret = EXT_STATUS_ERR; + return(ret); + } + LU_Q(ha, b, t, l) = q; + DEBUG(sprintf(debug_buff,"Allocate new device queue 0x%x\n",q)); + DEBUG(qla2100_print(debug_buff)); + DRIVER_UNLOCK + } + /* Set an invalid handle until we issue the command to ISP */ + /* then we will set the real handle value. */ + handle = INVALID_HANDLE; + CMD_HANDLE(pscsi_cmd) = (unsigned char *)handle; + + if( sp->flags ) { + sp->port_down_retry_count = ha->port_down_retry_count - 1; + sp->retry_count = ha->retry_count; + DEBUG3(sprintf(debug_buff,"qla2100: PT Set retry counts =0x%x,0x%x\n\r", + sp->port_down_retry_count,sp->retry_count)); + DEBUG3(qla2100_print(debug_buff)); + } + qla2100_putq_t(q,sp); + + /* set flag to indicate IOCTL SCSI PassThru in progress */ + ha->IoctlPassThru_InProgress = 1; + + //printk("[start FCSCSI IOCTL restart queues]\n"); + /* send command to adapter */ + qla2100_restart_queues(ha,FALSE); + + /* release spin lock since command is queued */ + spin_unlock_irqrestore(&io_request_lock, cpu_flags); + + ha->ioctl_timer = 6; /* 6 ticks of 1 second timer max wait */ + + /* wait for post function or timer to zero the InProgress flag */ + while (ha->IoctlPassThru_InProgress == 1) { + udelay(35); + } + + //printk("[start FCSCSI IOCTL finished while]\n"); + if (ha->IoctlPassThru_InProgress == 1) { + /* We waited and post function did not get called */ + DEBUG(printk("[FCSCSI IOCTL post function not called]\n");) + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_DEV_NOT_FOUND; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_ERR; + } else { + if (pscsi_pass->Direction == EXT_DEF_SCSI_PASSTHRU_DATA_IN) { + /* getting device data and putting in pext->ResponseAdr */ + ret = verify_area(VERIFY_WRITE, (void *)pext->ResponseAdr , + pext->ResponseLen); + if (ret) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR verify_area WRITE for IOCTL PT ha=%8x]\n", + (uint32_t)ha);) + return(ret); + } + /* now copy up the READ data to user */ + for (i=0 ; i < pext->ResponseLen ; i++) { + usr_temp = (uint8_t *)pext->ResponseAdr + i; + kernel_tmp = (uint8_t *)ha->ioctl_mem + i; + /*printk("[%x]",*kernel_tmp);*/ + __put_user(*kernel_tmp, usr_temp); + } + } + //printk("[[sense0=%x sense2=%x]]\n", + //pscsi_cmd->sense_buffer[0], + //pscsi_cmd->sense_buffer[2]); + /* copy up structure to make sense data available to user */ + for (i=0;i<16;i++) + pscsi_pass->SenseData[i] = pscsi_cmd->sense_buffer[i]; + ret = verify_area(VERIFY_WRITE, (void *)pext->RequestAdr, + sizeof(EXT_SCSI_PASSTHRU)); + if (ret) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + DEBUG2(printk("[qla2100_ioctl: ERROR verify_area WRITE of EXT_SCSI_PASSTHRU]\n");) + return(ret); + } + for (i=0 ; i < sizeof(EXT_SCSI_PASSTHRU) ; i++) { + usr_temp = (uint8_t *)pext->RequestAdr + i; + kernel_tmp = (uint8_t *)pscsi_pass + i; + __put_user(*kernel_tmp, usr_temp); + } + /* printk("[finished QLA2100 IOCTL EXT_FCSCSI_REQ]\n"); */ + pext->Status = EXT_STATUS_SCSI_STATUS; + pext->DetailStatus = sp->scode; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_OK; + } + break; + + case EXT_CC_READ_NVRAM: + if (pext->ResponseLen < sizeof(nvram21_t)) transfer_size = pext->ResponseLen; + else transfer_size = sizeof(nvram21_t)/2; + for( i = 0, cnt = 0; cnt < transfer_size ; cnt++ , i++ ) { + *wptr = qla2100_get_nvram_word(ha, cnt); + + usr_temp = (uint8_t *)pext->ResponseAdr; + kernel_tmp = (uint8_t *)wptr; + + usr_temp += i; /* even byte */ + __put_user(*kernel_tmp, usr_temp); + + i++; + usr_temp = (uint8_t *)pext->ResponseAdr; + kernel_tmp1 = (uint8_t *)wptr + 1; + usr_temp += i; /* odd byte */ + __put_user(*kernel_tmp1, usr_temp); + } + + /* printk("[finished QLA2100 IOCTL EXT_NVR_RD]\n"); */ + pext->Status = EXT_STATUS_OK; + pext->DetailStatus = EXT_STATUS_OK; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_OK; + break; + + case EXT_CC_LOOPBACK: + DEBUG(sprintf(debug_buff,"qla2100_ioctl: start EXT_CC_LOOPBACK\n")); + DEBUG(qla2100_print(debug_buff)); + + /* printk("[start EXT_CC_LOOPBACK]\n"); */ + + if (ha->device_id == QLA2100_DEVICE_ID) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_DEV_NOT_FOUND; + copy_up_EXT(pext,arg); + DEBUG2(printk("[EXT_CC_SEND_LOOP_BACK not supported on QLA2100]\n");) + return(ret); + } + + if (pext->ResponseLen > PAGE_SIZE) pext->ResponseLen = PAGE_SIZE; + if (pext->RequestLen > PAGE_SIZE) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_INVALID_PARAM; + copy_up_EXT(pext,arg); + /*printk("[EXT_CC_LOOPBACK too big ResponseLen=%x ReqLen=%x]\n",pext->ResponseLen,pext->RequestLen); */ + DEBUG2(printk("[qla2100_ioctl: ERROR size of requested Resp_len in EXT_CC_SEND_LOOP_BACK]\n");) + return(ret); + } + ret = verify_area(VERIFY_READ, (void *)pext->RequestAdr, + pext->RequestLen); + if (ret){ + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + /*printk("[EXT_CC_LOOPBACK verify read error]\n");*/ + DEBUG2(printk("[qla2100_ioctl: ERROR verify_area READ of EXT_CC_LOOPBACK]\n");) + return(ret); + } + for (i=0 ; i < pext->ResponseLen ; i++) { + /* copy in from user space the user data pattern to be sent */ + usr_temp = (uint8_t *)pext->ResponseAdr + i; + kernel_tmp = (uint8_t *)ha->ioctl_mem + i; + __get_user(*kernel_tmp, usr_temp); + /* printk("{%x}",*kernel_tmp); */ + } + /* check on loop down */ + if ( ha->loop_down_timer == 0 && ha->loop_state == LOOP_DOWN) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_DEV_NOT_FOUND; + copy_up_EXT(pext,arg); + /* printk("[EXT_CC_LOOPBACK loop down]\n"); */ + return(ret); + } + + /* get spin lock for this operation */ + spin_lock_irqsave(&io_request_lock, cpu_flags); + + mb[0] = MBC_DIAGNOSTIC_LOOP_BACK; + mb[1] = 0x72; /* options: 64 bit, use buffer for snd/rcv on ext. loop */ + mb[2] = mb[3] = mb[4] = mb[5] = mb[6] = mb[7] = mb[8] = mb[9] = 0; + mb[10] = LSW(pext->ResponseLen); + mb[11] = MSW(pext->ResponseLen); + mb[12] = 0; /* transfer segment count */ + mb[13] = 0; /* receive segment count */ + mb[14] = LSW(ha->ioctl_mem_phys); /* send data address */ + mb[15] = MSW(ha->ioctl_mem_phys); + mb[20] = QL21_64BITS_3RDWD(ha->ioctl_mem_phys); + mb[21] = QL21_64BITS_4THWD(ha->ioctl_mem_phys); + mb[16] = LSW(ha->ioctl_mem_phys); /* recv data address */ + mb[17] = MSW(ha->ioctl_mem_phys); + mb[6] = QL21_64BITS_3RDWD(ha->ioctl_mem_phys); + mb[7] = QL21_64BITS_4THWD(ha->ioctl_mem_phys); + mb[18] = 1; /* iteration count lsb */ + mb[19] = 0; /* iteration count msb */ + + DEBUG(sprintf(debug_buff, + "LoopBack ioctl: issue loop back mailbox command\n")); + DEBUG(qla2100_print(debug_buff)); + + // wait for 64 bit loopback ready firmware + status = qla2100_mailbox_command(ha,BIT_21|BIT_20|BIT_19|BIT_18| + BIT_17|BIT_16|BIT_15|BIT_14| + BIT_13|BIT_12|BIT_11| + BIT_10|BIT_7|BIT_6|BIT_1|BIT_0, + &mb[0]); + + /* release spin lock since command is issued */ + spin_unlock_irqrestore(&io_request_lock, cpu_flags); + + if (status) { + DEBUG(sprintf(debug_buff, + "LoopBack ioctl: issue loop back mailbox command FAILED\n")); + DEBUG(qla2100_print(debug_buff)); + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_ERR; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_ERR; + } else { + /* put looped back data in pext->ResponseAdr */ + /* printk("[LoopBack ioctl: LoopBack was OK ]\n");*/ + ret = verify_area(VERIFY_WRITE, (void *)pext->ResponseAdr , + pext->ResponseLen); + if (ret) { + pext->Status = EXT_STATUS_ERR; + pext->DetailStatus = EXT_STATUS_COPY_ERR; + copy_up_EXT(pext,arg); + DEBUG2(printk("[LoopBack ioctl: ERROR verify_area WRITE ha=%x]\n", + (uint32_t)ha);) + return(ret); + } + /* sending back looped back data */ + for (i=0 ; i < pext->ResponseLen ; i++) { + usr_temp = (uint8_t *)pext->ResponseAdr + i; + kernel_tmp = (uint8_t *)ha->ioctl_mem + i; + /*printk("[%x]",*kernel_tmp);*/ + __put_user(*kernel_tmp, usr_temp); + } + /*printk("[finished QLA2100 IOCTL EXT_CC_LOOPBACK]\n");*/ + pext->Status = EXT_STATUS_OK; + pext->DetailStatus = EXT_STATUS_OK; + copy_up_EXT(pext,arg); + ret = EXT_STATUS_OK; + } + break; + +/* case EXT_CC_RSCN_REG: + break; + case EXT_CC_RSCN_GET: + break; + case EXT_CC_ELS_RNID_SEND: + break; + case EXT_CC_ELS_RTIN_SEND: + break; + case EXT_CC_PLATFORM_REG: + break; + +all others go here */ + + default: + break; + } + + return(ret); +} + diff -urN linux-2.4.18/drivers/scsi/qlavendor.c lia64-2.4/drivers/scsi/qlavendor.c --- linux-2.4.18/drivers/scsi/qlavendor.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/scsi/qlavendor.c Mon Jul 23 14:13:02 2001 @@ -0,0 +1,325 @@ +/******************************************************************************** +* QLOGIC LINUX SOFTWARE +* +* QLogic ISP2x00 device driver for Linux 2.2.x (redhat 6.X). +* +* COPYRIGHT (C) 2000 QLOGIC CORPORATION +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the Qlogic's Linux Software License. See below. +* +* This program is WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* 1. Redistribution's or source code must retain the above copyright +* notice, this list of conditions, and the following disclaimer, +* without modification, immediately at the beginning of the file. +* 2. The name of the author may not be used to endorse or promote products +* derived from this software without specific prior written permission. +* +********************************************************************************/ + +/***************************************************************************************** + QLOGIC CORPORATION SOFTWARE + "GNU" GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION + AND MODIFICATION + +This GNU General Public License ("License") applies solely to QLogic Linux +Software ("Software") and may be distributed under the terms of this License. + +1. You may copy and distribute verbatim copies of the Software's source code as +you receive it, in any medium, provided that you conspicuously and appropriately +publish on each copy an appropriate copyright notice and disclaimer of warranty; +keep intact all the notices that refer to this License and to the absence of any +warranty; and give any other recipients of the Software a copy of this License along +with the Software. + +You may charge a fee for the physical act of transferring a copy, and you may at your +option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Software or any portion of it, thus forming +a work based on the Software, and copy and distribute such modifications or work under +the terms of Section 1 above, provided that you also meet all of these conditions: + +* a) You must cause the modified files to carry prominent notices stating that you +changed the files and the date of any change. + +* b) You must cause any work that you distribute or publish that in whole or in part +contains or is derived from the Software or any part thereof, to be licensed as a +whole at no charge to all third parties under the terms of this License. + +* c) If the modified Software normally reads commands interactively when run, you +must cause it, when started running for such interactive use in the most ordinary way, +to print or display an announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide a warranty) and that +users may redistribute the Software under these conditions, and telling the user how to +view a copy of this License. (Exception:if the Software itself is interactive but does +not normally print such an announcement, your work based on the Software is not required +to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable sections of +that work are not derived from the Software, and can be reasonably considered independent +and separate works in themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you distribute the same +sections as part of a whole which is a work based on the Software, the distribution of the +whole must be on the terms of this License, whose permissions for other licensees extend +to the entire whole, and thus to each and every part regardless of who wrote it. + +3. You may copy and distribute the Software (or a work based on it, under Section 2) in +object code or executable form under the terms of Sections 1 and 2 above provided that +you also do one of the following: + +* a) Accompany it with the complete corresponding machine-readable source code, which must +be distributed under the terms of Sections 1 and 2 above on a medium customarily used for +software interchange; or, + +* b) Accompany it with a written offer, valid for at least three years, to give any third +party, for a charge no more than your cost of physically performing source distribution, +a complete machine-readable copy of the corresponding source code, to be distributed under +the terms of Sections 1 and 2 above on a medium customarily used for software interchange; +or, + +* c) Accompany it with the information you received as to the offer to distribute +corresponding source code. (This alternative is allowed only for noncommercial distribution +and only if you received the Software in object code or executable form with such an offer, +in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making modifications +to it. For an executable work, complete source code means all the source code for all +modules it contains, plus any associated interface definition files, plus the scripts used +to control compilation and installation of the executable. + +If distribution of executable or object code is made by offering access to copy from a +designated place, then offering equivalent access to copy the source code from the same +place counts as distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Software except as expressly +provided under this License. Any attempt otherwise to copy, modify, sublicense or +distribute the Software is void, and will automatically terminate your rights under this +License. However, parties who have received copies, or rights, from you under this License +will not have their licenses terminated so long as such parties remain in full compliance. + +5. This license grants you world wide, royalty free non-exclusive rights to modify or +distribute the Software or its derivative works. These actions are prohibited by law +if you do not accept this License. Therefore, by modifying or distributing the Software +(or any work based on the Software), you indicate your acceptance of this License to do +so, and all its terms and conditions for copying, distributing or modifying the Software +or works based on it. + +6. Each time you redistribute the Software (or any work based on the Software), the +recipient automatically receives a license from the original licensor to copy, distribute +or modify the Software subject to these terms and conditions. You may not impose any +further restrictions on the recipients' exercise of the rights granted herein. You are +not responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement or for +any other reason (not limited to patent issues), conditions are imposed on you +(whether by court order, agreement or otherwise) that contradict the conditions of this +License, they do not excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this License +and any other pertinent obligations, then as a consequence you may not distribute the +Software at all. + +If any portion of this section is held invalid or unenforceable under any particular +circumstance, the balance of the section is intended to apply and the section as a whole +is intended to apply in other circumstances. +NO WARRANTY + +11. THE SOFTWARE IS PROVIDEDWITHOUT A WARRANTY OF ANY KIND. THERE IS NO +WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, +EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE +ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. +SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL +NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE SOFTWARE AS PERMITTED ABOVE, BE LIABLE TO YOU FOR +DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL +DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING +BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR +LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO +OPERATE WITH ANY OTHER SOFTWARES), EVEN IF SUCH HOLDER OR OTHER PARTY HAS +BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +END OF TERMS AND CONDITIONS + +******************************************************************************/ +/* + * vendor specific op codes. +*/ + +#define UCSCSI_DCMD 0x20 /* DAC960 direct command */ +#define UCSCSI_DCMD_PASSTHRU 0x21 /* DAC960 pass-through command */ +#define UC_SCSI_DCMD 0x22 /* DAC960 FSI direct command */ +#define DAC_CDB_LEN 12 +#define DAC_SENSE_LEN 64 + +#define SCSI_WRITE10 0x2A /* Required for direct disk writes */ +#define SCSI_WRITE6 0x0A /* Required for direct disk writes */ +#define SCSI_WRITEBUFFER 0x3B /* Required for flashing disk FW */ +#define DACMD_WRITE_CONF_ONDISK 0x4B +#define DACMD_WRITE_CONFIG 0x06 +#define DACMD_WRITE_CONF2 0x3C +#define DACMD_WRITE_CONFLABEL 0x49 /* Write configuration label */ +#define DACMD_WRITE_CONFIG_V3x 0x4F +#define DACMD_ADD_CONFIG_V2x 0x18 +#define DACMD_ADD_CONFIG_V3x 0x4C +#define DACMD_STORE_IMAGE 0x21 +#define DACMD_ADD_CAPACITY 0x2A /* add physical drives to existing array */ +#define DACMD_WRITE_IOPORT 0x3A /* write port B */ +#define DACMD_S2S_WRITEFULLCONF 0x60 /* write full configuration */ +#define DACMD_S2S_ADDFULLCONF 0x62 /* add full configuration */ +#define DACMD_S2S_WRITELUNMAP_OLD 0x58 /* write LUN map information */ +#define DACMD_S2S_WRITELUNMAP 0xD2 /* Write LUN MAP Information */ +#define DACMD_S2S_WRITE_IOPORT 0x66 /* write expanded IO port */ +#define DACMD_WRITE_V3x 0x34 /* write data from plain memory */ +#define DACMD_S2S_WRITESIG 0x4D /* write signature information */ + +#define MDACIOCTL_STOREIMAGE 0x2C /* Store the softeware image on controller */ +#define MDACIOCTL_WRITESIGNATURE 0xA6 /* Write Controller Signature */ +#define MDACIOCTL_SETREALTIMECLOCK 0xAC /* Set real time clock value */ +#define MDACIOCTL_PASS_THRU_CDB 0xAD /* Set up a pass-through command */ +#define MDACIOCTL_PASS_THRU_INITIATE 0xAE /* Initiates a pass-through read/write command (bi-directional) */ +#define MDACIOCTL_CREATENEWCONF 0xC0 /* Create new configruation */ +#define MDACIOCTL_ADDNEWCONF 0xC4 /* Add new logical/physical device to configruation */ +#define MDACIOCTL_MORE 0xC6 /* Do MORE operation */ +#define MDACIOCTL_SETPHYSDEVPARAMETER 0xC8 /* Set physical device parameters */ +#define MDACIOCTL_SETLOGDEVPARAMETER 0xCF /* Set logical device parameters */ +#define MDACIOCTL_SETCONTROLLERPARAMTER 0xD1 /* Set controller parameter */ +#define MDACIOCTL_WRITESANMAP 0xD4 /* Set logical device LUN map */ +#define MDACIOCTL_SETMACADDRESS 0xD5 /* Set controller MAC address */ + + /* + * qla2100_set_scsi_direction + * This routine will set the proper direction for vendor specific + * commands. + * + * Note: Vendors should modify this routine to set the proper + * direction of the transfer if they used vendor specific commands. + * + * Input: + * ha = adapter block pointer. + * sp = SCSI Request Block structure pointer. + * + * Returns: + * 0 = success, was able to issue command. + */ + + void qla2100_set_vend_direction(scsi_qla_host_t *ha, + Scsi_Cmnd *cmd, cmd_entry_t *pkt) { + /* This section added 10-JAN-2001 by Lethe. Required to facilitate SCSI + pass-through for flashing disk firmware, and direct disk writes under + Mylex 6.x and 5.x Firmware */ + if( cmd->data_cmnd[0] == UCSCSI_DCMD_PASSTHRU) { + pkt->control_flags = 0; + switch (cmd->data_cmnd[2]) { + case SCSI_WRITE6: + case SCSI_WRITE10: + case SCSI_WRITEBUFFER: + pkt->control_flags |= BIT_6; + break; + default: + pkt->control_flags |= BIT_5; + } + } + else if( cmd->data_cmnd[0] == UCSCSI_DCMD ) + { + pkt->control_flags = 0; + switch( cmd->data_cmnd[2] ) + { + case DACMD_WRITE_CONF_ONDISK: + case DACMD_WRITE_CONFIG: + case DACMD_WRITE_CONF2: + case DACMD_WRITE_CONFLABEL: + case DACMD_WRITE_CONFIG_V3x: + case DACMD_ADD_CONFIG_V2x: + case DACMD_ADD_CONFIG_V3x: + case DACMD_STORE_IMAGE: + case DACMD_ADD_CAPACITY: + case DACMD_WRITE_IOPORT: + case DACMD_S2S_WRITEFULLCONF: + case DACMD_S2S_ADDFULLCONF: + case DACMD_S2S_WRITELUNMAP_OLD: + case DACMD_S2S_WRITELUNMAP: + case DACMD_S2S_WRITE_IOPORT: + case DACMD_WRITE_V3x: + case DACMD_S2S_WRITESIG: + pkt->control_flags |= BIT_6; + break; + default: + pkt->control_flags |= BIT_5; + } + } + +/******************************************************************************************* +* The below logic is required to operate correctly with Mylex (IBM's) DAC960 family of * +* external RAID controllers. * +* * +* In addition to defining whether below CDBs are Reads or Writes, Mylex, in their infinite * +* wisdom, defined a vendor-specific CDB which can act as a Read OR a write, depending on * +* the parameters sent in a previous MDACIOCTL_PASS_THRU_CDB. Instead of adding a lot of * +* logic to define and maintain a MDACIOCTL_PASS_THRU_CDB queue, and parse each one of them * +* to determine direction, I took easy way out (also the low-overhead method). * +* * +* If the high-order bit of the 32-bit UniqueID, defined in byte 3 of data_cmnd[3] is set * +* then I will mark that as a CDB which is going to be a write, otherwise the pass thru * +* operation will be a read. If somebody wishes to rewrite the driver to maintain a 30-sec * +* command queue, and parse the contents of each data buffer passed in to determine R or W * +* then they are free to do so, and it will not impact future versions of the Distributed * +* Array Manager, which required this fix in the first place. * +* * +* This configurator and patch was written by David A. Lethe of Xyratex david@santools.com. * +* In addition, the logic to check cmd->data_cmnd[0] == UC_SCSI_DCMD, was written by * +* Sammy Wilborn of Silicon Graphics, Inc, and David Lethe * +* They define CDBs used by the DAC960FF family, when running FW 7.x and above. * +* * +*******************************************************************************************/ + + else if ( cmd->data_cmnd[0] == UC_SCSI_DCMD ) /* Mylex DAC960 FW 7.x */ + { + pkt->control_flags = 0; + switch( cmd->data_cmnd[2] ) + { + case MDACIOCTL_STOREIMAGE: + case MDACIOCTL_SETREALTIMECLOCK: + case MDACIOCTL_WRITESIGNATURE: + case MDACIOCTL_CREATENEWCONF: + case MDACIOCTL_ADDNEWCONF: + case MDACIOCTL_MORE: + case MDACIOCTL_SETPHYSDEVPARAMETER: + case MDACIOCTL_SETLOGDEVPARAMETER: + case MDACIOCTL_SETCONTROLLERPARAMTER: + case MDACIOCTL_WRITESANMAP: + case MDACIOCTL_SETMACADDRESS: + case MDACIOCTL_PASS_THRU_CDB: + pkt->control_flags |= BIT_6; + break; + default: + if (cmd->data_cmnd[2] == MDACIOCTL_PASS_THRU_INITIATE) { + /* If the high bit of the UniqueID field of the vendor- + specific field is TRUE, then it is marked as a write. */ + if (cmd->data_cmnd[3] & 0x80) + pkt->control_flags |= BIT_6; + else + pkt->control_flags |= BIT_5; + } + else + pkt->control_flags |= BIT_5; + break; + } + } + else + { + pkt->control_flags |= BIT_5; + } + + } diff -urN linux-2.4.18/drivers/scsi/scsi_dma.c lia64-2.4/drivers/scsi/scsi_dma.c --- linux-2.4.18/drivers/scsi/scsi_dma.c Tue Feb 26 11:04:38 2002 +++ lia64-2.4/drivers/scsi/scsi_dma.c Fri May 10 17:15:53 2002 @@ -30,8 +30,69 @@ typedef unsigned char FreeSectorBitmap; #elif SECTORS_PER_PAGE <= 32 typedef unsigned int FreeSectorBitmap; -#else -#error You lose. +#elif SECTORS_PER_PAGE <= 64 +typedef u64 FreeSectorBitmap; +#elif SECTORS_PER_PAGE <= 128 + +typedef struct { + u64 hi, lo; +} FreeSectorBitmap; + +/* No side effects on MAP-macro-arguments, please... */ + +#define MAP_MAKE_MASK(m, nbits) \ +do { \ + if ((nbits) >= 64) { \ + (m).hi = ((u64) 1 << ((nbits) - 64)) - 1; \ + (m).lo = ~(u64) 0; \ + } else { \ + (m).hi = 0; \ + (m).lo = ((u64) 1 << (nbits)) - 1; \ + } \ +} while (0) + +#define MAP_SHIFT_LEFT(m, count) \ +do { \ + if ((count) >= 64) { \ + (m).hi = (m).lo << ((count) - 64); \ + (m).lo = 0; \ + } else { \ + (m).hi = ((m).hi << (count)) | ((m).lo >> (64 - (count))); \ + (m).lo <<= count; \ + } \ +} while (0) + +#define MAP_AND(r, left, right) \ +do { \ + (r).hi = (left).hi & (right).hi; \ + (r).lo = (left).lo & (right).lo; \ +} while (0) + +#define MAP_SET(r, mask) \ +do { \ + (r).hi |= (mask).hi; \ + (r).lo |= (mask).lo; \ +} while (0) + +#define MAP_CLEAR(r, mask) \ +do { \ + (r).hi &= ~(mask).hi; \ + (r).lo &= ~(mask).lo; \ +} while (0) + +#define MAP_EQUAL(left, right) (((left.hi ^ right.hi) | (left.lo ^ right.lo)) == 0) +#define MAP_EMPTY(m) ((m.lo | m.hi) == 0) + +#endif + +#ifndef MAP_MAKE_MASK +# define MAP_MAKE_MASK(m,nbits) ((m) = (((u64) 1 << (nbits)) - 1)) +# define MAP_SHIFT_LEFT(m,nbits) ((m) <<= (nbits)) +# define MAP_AND(res,l,r) ((res) = (l) & (r)) +# define MAP_EQUAL(l,r) ((l) == (r)) +# define MAP_EMPTY(m) ((m) == 0) +# define MAP_CLEAR(m, bits) ((m) &= ~(bits)) +# define MAP_SET(m, bits) ((m) |= (bits)) #endif /* @@ -71,7 +132,8 @@ */ void *scsi_malloc(unsigned int len) { - unsigned int nbits, mask; + FreeSectorBitmap mask, busy_sectors, result; + unsigned int nbits; unsigned long flags; int i, j; @@ -79,23 +141,29 @@ return NULL; nbits = len >> 9; - mask = (1 << nbits) - 1; spin_lock_irqsave(&allocator_request_lock, flags); - for (i = 0; i < dma_sectors / SECTORS_PER_PAGE; i++) + for (i = 0; i < dma_sectors / SECTORS_PER_PAGE; i++) { + MAP_MAKE_MASK(mask, nbits); + busy_sectors = dma_malloc_freelist[i]; for (j = 0; j <= SECTORS_PER_PAGE - nbits; j++) { - if ((dma_malloc_freelist[i] & (mask << j)) == 0) { - dma_malloc_freelist[i] |= (mask << j); + MAP_AND(result, busy_sectors, mask); + if (MAP_EMPTY(result)) { + MAP_SET(dma_malloc_freelist[i], mask); scsi_dma_free_sectors -= nbits; #ifdef DEBUG - SCSI_LOG_MLQUEUE(3, printk("SMalloc: %d %p [From:%p]\n", len, dma_malloc_pages[i] + (j << 9))); - printk("SMalloc: %d %p [From:%p]\n", len, dma_malloc_pages[i] + (j << 9)); + SCSI_LOG_MLQUEUE(3, printk("SMalloc: %d %p\n", + len, dma_malloc_pages[i] + (j << 9))); + printk("SMalloc: %d %p\n", + len, dma_malloc_pages[i] + (j << 9)); #endif spin_unlock_irqrestore(&allocator_request_lock, flags); return (void *) ((unsigned long) dma_malloc_pages[i] + (j << 9)); } + MAP_SHIFT_LEFT(mask, 1); } + } spin_unlock_irqrestore(&allocator_request_lock, flags); return NULL; /* Nope. No more */ } @@ -121,7 +189,8 @@ */ int scsi_free(void *obj, unsigned int len) { - unsigned int page, sector, nbits, mask; + FreeSectorBitmap mask, result; + unsigned int page, sector, nbits; unsigned long flags; #ifdef DEBUG @@ -145,13 +214,14 @@ sector = (((unsigned long) obj) - page_addr) >> 9; nbits = len >> 9; - mask = (1 << nbits) - 1; + MAP_MAKE_MASK(mask, nbits); if (sector + nbits > SECTORS_PER_PAGE) panic("scsi_free:Bad memory alignment"); - if ((dma_malloc_freelist[page] & - (mask << sector)) != (mask << sector)) { + MAP_SHIFT_LEFT(mask, sector); + MAP_AND(result, mask, dma_malloc_freelist[page]); + if (!MAP_EQUAL(result, mask)) { #ifdef DEBUG printk("scsi_free(obj=%p, len=%d) called from %08lx\n", obj, len, ret); @@ -159,7 +229,7 @@ panic("scsi_free:Trying to free unused memory"); } scsi_dma_free_sectors += nbits; - dma_malloc_freelist[page] &= ~(mask << sector); + MAP_CLEAR(dma_malloc_freelist[page], mask); spin_unlock_irqrestore(&allocator_request_lock, flags); return 0; } diff -urN linux-2.4.18/drivers/scsi/scsi_ioctl.c lia64-2.4/drivers/scsi/scsi_ioctl.c --- linux-2.4.18/drivers/scsi/scsi_ioctl.c Mon Aug 20 10:19:06 2001 +++ lia64-2.4/drivers/scsi/scsi_ioctl.c Mon Aug 20 12:20:58 2001 @@ -198,6 +198,9 @@ unsigned int needed, buf_needed; int timeout, retries, result; int data_direction; +#if __GNUC__ < 3 + int foo; +#endif if (!sic) return -EINVAL; @@ -207,12 +210,21 @@ if (verify_area(VERIFY_READ, sic, sizeof(Scsi_Ioctl_Command))) return -EFAULT; - if(__get_user(inlen, &sic->inlen)) +#if __GNUC__ < 3 + foo = __get_user(inlen, &sic->inlen); + if(foo) return -EFAULT; - if(__get_user(outlen, &sic->outlen)) + foo = __get_user(outlen, &sic->outlen); + if(foo) + return -EFAULT; +#else + if(__get_user(inlen, &sic->inlen)) return -EFAULT; + if(__get_user(outlen, &sic->outlen)) + return -EFAULT; +#endif /* * We do not transfer more than MAX_BUF with this interface. * If the user needs to transfer more data than this, they diff -urN linux-2.4.18/drivers/scsi/simscsi.c lia64-2.4/drivers/scsi/simscsi.c --- linux-2.4.18/drivers/scsi/simscsi.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/scsi/simscsi.c Thu May 9 21:34:59 2002 @@ -0,0 +1,384 @@ +/* + * Simulated SCSI driver. + * + * Copyright (C) 1999, 2001 Hewlett-Packard Co + * Copyright (C) 1999, 2001 David Mosberger-Tang + * Copyright (C) 1999 Stephane Eranian + * + * 99/12/18 David Mosberger Added support for READ10/WRITE10 needed by linux v2.3.33 + */ +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "scsi.h" +#include "sd.h" +#include "hosts.h" +#include "simscsi.h" + +#define DEBUG_SIMSCSI 1 + +/* Simulator system calls: */ + +#define SSC_OPEN 50 +#define SSC_CLOSE 51 +#define SSC_READ 52 +#define SSC_WRITE 53 +#define SSC_GET_COMPLETION 54 +#define SSC_WAIT_COMPLETION 55 + +#define SSC_WRITE_ACCESS 2 +#define SSC_READ_ACCESS 1 + +#ifdef DEBUG_SIMSCSI + int simscsi_debug; +# define DBG simscsi_debug +#else +# define DBG 0 +#endif + +#if 0 +struct timer_list disk_timer; +#else +static void simscsi_interrupt (unsigned long val); +DECLARE_TASKLET(simscsi_tasklet, simscsi_interrupt, 0); +#endif + +struct disk_req { + unsigned long addr; + unsigned len; +}; + +struct disk_stat { + int fd; + unsigned count; +}; + +extern long ia64_ssc (long arg0, long arg1, long arg2, long arg3, int nr); + +static int desc[8] = { -1, -1, -1, -1, -1, -1, -1, -1 }; + +static struct queue_entry { + Scsi_Cmnd *sc; +} queue[SIMSCSI_REQ_QUEUE_LEN]; + +static int rd, wr; +static atomic_t num_reqs = ATOMIC_INIT(0); + +/* base name for default disks */ +static char *simscsi_root = DEFAULT_SIMSCSI_ROOT; + +#define MAX_ROOT_LEN 128 + +/* + * used to setup a new base for disk images + * to use /foo/bar/disk[a-z] as disk images + * you have to specify simscsi=/foo/bar/disk on the command line + */ +static int __init +simscsi_setup (char *s) +{ + /* XXX Fix me we may need to strcpy() ? */ + if (strlen(s) > MAX_ROOT_LEN) { + printk("simscsi_setup: prefix too long---using default %s\n", simscsi_root); + } + simscsi_root = s; + return 1; +} + +__setup("simscsi=", simscsi_setup); + +static void +simscsi_interrupt (unsigned long val) +{ + unsigned long flags; + Scsi_Cmnd *sc; + + spin_lock_irqsave(&io_request_lock, flags); + { + while ((sc = queue[rd].sc) != 0) { + atomic_dec(&num_reqs); + queue[rd].sc = 0; + if (DBG) + printk("simscsi_interrupt: done with %ld\n", sc->serial_number); + (*sc->scsi_done)(sc); + rd = (rd + 1) % SIMSCSI_REQ_QUEUE_LEN; + } + } + spin_unlock_irqrestore(&io_request_lock, flags); +} + +int +simscsi_detect (Scsi_Host_Template *templ) +{ + templ->proc_name = "simscsi"; +#if 0 + init_timer(&disk_timer); + disk_timer.function = simscsi_interrupt; +#endif + return 1; /* fake one SCSI host adapter */ +} + +int +simscsi_release (struct Scsi_Host *host) +{ + return 0; /* this is easy... */ +} + +const char * +simscsi_info (struct Scsi_Host *host) +{ + return "simulated SCSI host adapter"; +} + +int +simscsi_abort (Scsi_Cmnd *cmd) +{ + printk ("simscsi_abort: unimplemented\n"); + return SCSI_ABORT_SUCCESS; +} + +int +simscsi_reset (Scsi_Cmnd *cmd, unsigned int reset_flags) +{ + printk ("simscsi_reset: unimplemented\n"); + return SCSI_RESET_SUCCESS; +} + +int +simscsi_biosparam (Disk *disk, kdev_t n, int ip[]) +{ + int size = disk->capacity; + + ip[0] = 64; + ip[1] = 32; + ip[2] = size >> 11; + return 0; +} + +static void +simscsi_readwrite (Scsi_Cmnd *sc, int mode, unsigned long offset, unsigned long len) +{ + struct disk_stat stat; + struct disk_req req; + + req.addr = __pa(sc->request_buffer); + req.len = len; /* # of bytes to transfer */ + + if (sc->request_bufflen < req.len) + return; + + stat.fd = desc[sc->target]; + if (DBG) + printk("simscsi_%s @ %lx (off %lx, len %lu) ->", + mode == SSC_READ ? "read":"write", req.addr, offset, len); + ia64_ssc(stat.fd, 1, __pa(&req), offset, mode); + ia64_ssc(__pa(&stat), 0, 0, 0, SSC_WAIT_COMPLETION); + + if (stat.count == req.len) { + sc->result = GOOD; + } else { + sc->result = DID_ERROR << 16; + } + if (DBG) + printk("%d\n", sc->result); +} + +static void +simscsi_sg_readwrite (Scsi_Cmnd *sc, int mode, unsigned long offset) +{ + int list_len = sc->use_sg; + struct scatterlist *sl = (struct scatterlist *)sc->buffer; + struct disk_stat stat; + struct disk_req req; + + stat.fd = desc[sc->target]; + + while (list_len) { + req.addr = __pa(sl->address); + req.len = sl->length; + if (DBG) + printk("simscsi_sg_%s @ %lx (off %lx) use_sg=%d len=%d\n", + mode == SSC_READ ? "read":"write", req.addr, offset, + list_len, sl->length); + ia64_ssc(stat.fd, 1, __pa(&req), offset, mode); + ia64_ssc(__pa(&stat), 0, 0, 0, SSC_WAIT_COMPLETION); + + /* should not happen in our case */ + if (stat.count != req.len) { + sc->result = DID_ERROR << 16; + return; + } + offset += sl->length; + sl++; + list_len--; + } + sc->result = GOOD; +} + +/* + * function handling both READ_6/WRITE_6 (non-scatter/gather mode) + * commands. + * Added 02/26/99 S.Eranian + */ +static void +simscsi_readwrite6 (Scsi_Cmnd *sc, int mode) +{ + unsigned long offset; + + offset = (((sc->cmnd[1] & 0x1f) << 16) | (sc->cmnd[2] << 8) | sc->cmnd[3])*512; + if (sc->use_sg > 0) + simscsi_sg_readwrite(sc, mode, offset); + else + simscsi_readwrite(sc, mode, offset, sc->cmnd[4]*512); +} + + +static void +simscsi_readwrite10 (Scsi_Cmnd *sc, int mode) +{ + unsigned long offset; + + offset = ( (sc->cmnd[2] << 24) | (sc->cmnd[3] << 16) + | (sc->cmnd[4] << 8) | (sc->cmnd[5] << 0))*512; + if (sc->use_sg > 0) + simscsi_sg_readwrite(sc, mode, offset); + else + simscsi_readwrite(sc, mode, offset, ((sc->cmnd[7] << 8) | sc->cmnd[8])*512); +} + +int +simscsi_queuecommand (Scsi_Cmnd *sc, void (*done)(Scsi_Cmnd *)) +{ + char fname[MAX_ROOT_LEN+16]; + char *buf; +#if DEBUG_SIMSCSI + register long sp asm ("sp"); + + if (DBG) + printk("simscsi_queuecommand: target=%d,cmnd=%u,sc=%lu,sp=%lx,done=%p\n", + sc->target, sc->cmnd[0], sc->serial_number, sp, done); +#endif + + sc->result = DID_BAD_TARGET << 16; + sc->scsi_done = done; + if (sc->target <= 7 && sc->lun == 0) { + switch (sc->cmnd[0]) { + case INQUIRY: + if (sc->request_bufflen < 35) { + break; + } + sprintf (fname, "%s%c", simscsi_root, 'a' + sc->target); + desc[sc->target] = ia64_ssc (__pa(fname), SSC_READ_ACCESS|SSC_WRITE_ACCESS, + 0, 0, SSC_OPEN); + if (desc[sc->target] < 0) { + /* disk doesn't exist... */ + break; + } + buf = sc->request_buffer; + buf[0] = 0; /* magnetic disk */ + buf[1] = 0; /* not a removable medium */ + buf[2] = 2; /* SCSI-2 compliant device */ + buf[3] = 2; /* SCSI-2 response data format */ + buf[4] = 31; /* additional length (bytes) */ + buf[5] = 0; /* reserved */ + buf[6] = 0; /* reserved */ + buf[7] = 0; /* various flags */ + memcpy(buf + 8, "HP SIMULATED DISK 0.00", 28); + sc->result = GOOD; + break; + + case TEST_UNIT_READY: + sc->result = GOOD; + break; + + case READ_6: + if (desc[sc->target] < 0 ) + break; + simscsi_readwrite6(sc, SSC_READ); + break; + + case READ_10: + if (desc[sc->target] < 0 ) + break; + simscsi_readwrite10(sc, SSC_READ); + break; + + case WRITE_6: + if (desc[sc->target] < 0) + break; + simscsi_readwrite6(sc, SSC_WRITE); + break; + + case WRITE_10: + if (desc[sc->target] < 0) + break; + simscsi_readwrite10(sc, SSC_WRITE); + break; + + + case READ_CAPACITY: + if (desc[sc->target] < 0 || sc->request_bufflen < 8) { + break; + } + buf = sc->request_buffer; + + /* pretend to be a 1GB disk (partition table contains real stuff): */ + buf[0] = 0x00; + buf[1] = 0x1f; + buf[2] = 0xff; + buf[3] = 0xff; + /* set block size of 512 bytes: */ + buf[4] = 0; + buf[5] = 0; + buf[6] = 2; + buf[7] = 0; + sc->result = GOOD; + break; + + case MODE_SENSE: + printk("MODE_SENSE\n"); + break; + + case START_STOP: + printk("START_STOP\n"); + break; + + default: + panic("simscsi: unknown SCSI command %u\n", sc->cmnd[0]); + } + } + if (sc->result == DID_BAD_TARGET) { + sc->result |= DRIVER_SENSE << 24; + sc->sense_buffer[0] = 0x70; + sc->sense_buffer[2] = 0x00; + } + if (atomic_read(&num_reqs) >= SIMSCSI_REQ_QUEUE_LEN) { + panic("Attempt to queue command while command is pending!!"); + } + atomic_inc(&num_reqs); + queue[wr].sc = sc; + wr = (wr + 1) % SIMSCSI_REQ_QUEUE_LEN; + +#if 0 + if (!timer_pending(&disk_timer)) { + disk_timer.expires = jiffies; + add_timer(&disk_timer); + } +#else + tasklet_schedule(&simscsi_tasklet); +#endif + return 0; +} + + +static Scsi_Host_Template driver_template = SIMSCSI; + +#include "scsi_module.c" diff -urN linux-2.4.18/drivers/scsi/simscsi.h lia64-2.4/drivers/scsi/simscsi.h --- linux-2.4.18/drivers/scsi/simscsi.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/scsi/simscsi.h Wed Feb 21 16:31:25 2001 @@ -0,0 +1,39 @@ +/* + * Simulated SCSI driver. + * + * Copyright (C) 1999 Hewlett-Packard Co + * Copyright (C) 1999 David Mosberger-Tang + */ +#ifndef SIMSCSI_H +#define SIMSCSI_H + +#define SIMSCSI_REQ_QUEUE_LEN 64 + +#define DEFAULT_SIMSCSI_ROOT "/var/ski-disks/sd" + +extern int simscsi_detect (Scsi_Host_Template *); +extern int simscsi_release (struct Scsi_Host *); +extern const char *simscsi_info (struct Scsi_Host *); +extern int simscsi_queuecommand (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); +extern int simscsi_abort (Scsi_Cmnd *); +extern int simscsi_reset (Scsi_Cmnd *, unsigned int); +extern int simscsi_biosparam (Disk *, kdev_t, int[]); + +#define SIMSCSI { \ + detect: simscsi_detect, \ + release: simscsi_release, \ + info: simscsi_info, \ + queuecommand: simscsi_queuecommand, \ + abort: simscsi_abort, \ + reset: simscsi_reset, \ + bios_param: simscsi_biosparam, \ + can_queue: SIMSCSI_REQ_QUEUE_LEN, \ + this_id: -1, \ + sg_tablesize: SG_ALL, \ + cmd_per_lun: SIMSCSI_REQ_QUEUE_LEN, \ + present: 0, \ + unchecked_isa_dma: 0, \ + use_clustering: DISABLE_CLUSTERING \ +} + +#endif /* SIMSCSI_H */ diff -urN linux-2.4.18/drivers/sound/Config.in lia64-2.4/drivers/sound/Config.in --- linux-2.4.18/drivers/sound/Config.in Wed Dec 26 16:58:53 2001 +++ lia64-2.4/drivers/sound/Config.in Mon Jul 22 14:03:25 2002 @@ -30,6 +30,7 @@ fi fi fi +dep_tristate ' ForteMedia FM801 driver (EXPERIMENTAL)' CONFIG_SOUND_FORTE $CONFIG_SOUND $CONFIG_PCI $CONFIG_EXPERIMENTAL dep_tristate ' Creative SBLive! (EMU10K1)' CONFIG_SOUND_EMU10K1 $CONFIG_SOUND $CONFIG_PCI dep_mbool ' Creative SBLive! MIDI' CONFIG_MIDI_EMU10K1 $CONFIG_SOUND_EMU10K1 $CONFIG_EXPERIMENTAL dep_tristate ' Crystal SoundFusion (CS4280/461x)' CONFIG_SOUND_FUSION $CONFIG_SOUND diff -urN linux-2.4.18/drivers/sound/Makefile lia64-2.4/drivers/sound/Makefile --- linux-2.4.18/drivers/sound/Makefile Wed Dec 26 16:58:53 2001 +++ lia64-2.4/drivers/sound/Makefile Mon Jul 22 14:03:52 2002 @@ -68,6 +68,7 @@ obj-$(CONFIG_SOUND_FUSION) += cs46xx.o ac97_codec.o obj-$(CONFIG_SOUND_MAESTRO) += maestro.o obj-$(CONFIG_SOUND_MAESTRO3) += maestro3.o ac97_codec.o +obj-$(CONFIG_SOUND_FORTE) += forte.o ac97_codec.o obj-$(CONFIG_SOUND_TRIDENT) += trident.o ac97_codec.o obj-$(CONFIG_SOUND_EMU10K1) += ac97_codec.o obj-$(CONFIG_SOUND_RME96XX) += rme96xx.o diff -urN linux-2.4.18/drivers/sound/forte.c lia64-2.4/drivers/sound/forte.c --- linux-2.4.18/drivers/sound/forte.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/drivers/sound/forte.c Fri Jul 19 21:01:30 2002 @@ -0,0 +1,1818 @@ +/* + * forte.c - ForteMedia FM801 OSS Driver + * + * Written by Martin K. Petersen + * Copyright (C) 2002 Hewlett-Packard Company + * + * Based upon the ALSA FM801 driver by Jaroslav Kysela and OSS drivers + * by Thomas Sailer, Alan Cox, Zach Brown, and Jeff Garzik. Thanks + * guys! + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version + * 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + */ + +/* + * TODO: + * MMIO + * Multichannelize + * Multichipify + * MPU401 + * M^Gameport + */ + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#define DRIVER_NAME "forte" +#define DRIVER_VERSION "$Id: forte.c,v 1.32 2002/07/12 17:06:15 mkp Exp $" +#define PFX DRIVER_NAME ": " + +#define M_DEBUG 0 + +#ifdef M_DEBUG +#define DPRINTK(args...) printk(KERN_WARNING args) +#else +#define DPRINTK(args...) +#endif + +/* Card capabilities */ +#define FORTE_CAPS (DSP_CAP_REALTIME) +// |DSP_CAP_MMAP|DSP_CAP_TRIGGER) + +/* Supported audio formats */ +#define FORTE_FMTS (AFMT_U8 | AFMT_S16_LE) + +/* Buffers */ +#define FORTE_MIN_FRAG_SIZE 256 +#define FORTE_MAX_FRAG_SIZE PAGE_SIZE +#define FORTE_DEF_FRAG_SIZE 256 +#define FORTE_MIN_FRAGMENTS 16 +#define FORTE_MAX_FRAGMENTS 256 +#define FORTE_DEF_FRAGMENTS 16 +#define FORTE_MIN_BUF 16386 + +/* PCI BARs */ +#define FORTE_PCM_VOL 0x00 /* PCM Output Volume */ +#define FORTE_FM_VOL 0x02 /* FM Output Volume */ +#define FORTE_I2S_VOL 0x04 /* I2S Volume */ +#define FORTE_REC_SRC 0x06 /* Record Source */ +#define FORTE_PLY_CTRL 0x08 /* Playback Control */ +#define FORTE_PLY_COUNT 0x0a /* Playback Count */ +#define FORTE_PLY_BUF1 0x0c /* Playback Buffer I */ +#define FORTE_PLY_BUF2 0x10 /* Playback Buffer II */ +#define FORTE_CAP_CTRL 0x14 /* Capture Control */ +#define FORTE_CAP_COUNT 0x16 /* Capture Count */ +#define FORTE_CAP_BUF1 0x18 /* Capture Buffer I */ +#define FORTE_CAP_BUF2 0x1c /* Capture Buffer II */ +#define FORTE_CODEC_CTRL 0x22 /* Codec Control */ +#define FORTE_I2S_MODE 0x24 /* I2S Mode Control */ +#define FORTE_VOLUME 0x26 /* Volume Up/Down/Mute Status */ +#define FORTE_I2C_CTRL 0x29 /* I2C Control */ +#define FORTE_AC97_CMD 0x2a /* AC'97 Command */ +#define FORTE_AC97_DATA 0x2c /* AC'97 Data */ +#define FORTE_MPU401_DATA 0x30 /* MPU401 Data */ +#define FORTE_MPU401_CMD 0x31 /* MPU401 Command */ +#define FORTE_GPIO_CTRL 0x52 /* General Purpose I/O Control */ +#define FORTE_GEN_CTRL 0x54 /* General Control */ +#define FORTE_IRQ_MASK 0x56 /* Interrupt Mask */ +#define FORTE_IRQ_STATUS 0x5a /* Interrupt Status */ +#define FORTE_OPL3_BANK0 0x68 /* OPL3 Status Read / Bank 0 Write */ +#define FORTE_OPL3_DATA0 0x69 /* OPL3 Data 0 Write */ +#define FORTE_OPL3_BANK1 0x6a /* OPL3 Bank 1 Write */ +#define FORTE_OPL3_DATA1 0x6b /* OPL3 Bank 1 Write */ +#define FORTE_POWERDOWN 0x70 /* Blocks Power Down Control */ + +#define FORTE_CAP_OFFSET FORTE_CAP_CTRL - FORTE_PLY_CTRL + +#define FORTE_AC97_ADDR_SHIFT 10 + +/* Playback and record control register bits */ +#define FORTE_BUF1_LAST (1<<1) +#define FORTE_BUF2_LAST (1<<2) +#define FORTE_START (1<<5) +#define FORTE_PAUSE (1<<6) +#define FORTE_IMMED_STOP (1<<7) +#define FORTE_RATE_SHIFT 8 +#define FORTE_RATE_MASK (15 << FORTE_RATE_SHIFT) +#define FORTE_CHANNELS_4 (1<<12) /* Playback only */ +#define FORTE_CHANNELS_6 (2<<12) /* Playback only */ +#define FORTE_CHANNELS_6MS (3<<12) /* Playback only */ +#define FORTE_CHANNELS_MASK (3<<12) +#define FORTE_16BIT (1<<14) +#define FORTE_STEREO (1<<15) + +/* IRQ status bits */ +#define FORTE_IRQ_PLAYBACK (1<<8) +#define FORTE_IRQ_CAPTURE (1<<9) +#define FORTE_IRQ_VOLUME (1<<14) +#define FORTE_IRQ_MPU (1<<15) + +/* CODEC control */ +#define FORTE_CC_CODEC_RESET (1<<5) +#define FORTE_CC_AC97_RESET (1<<6) + +/* AC97 cmd */ +#define FORTE_AC97_WRITE (0<<7) +#define FORTE_AC97_READ (1<<7) +#define FORTE_AC97_DP_INVALID (0<<8) +#define FORTE_AC97_DP_VALID (1<<8) +#define FORTE_AC97_PORT_RDY (0<<9) +#define FORTE_AC97_PORT_BSY (1<<9) + + +struct forte_channel { + const char *name; + + unsigned short ctrl; /* Ctrl BAR contents */ + unsigned long iobase; /* Ctrl BAR address */ + + wait_queue_head_t wait; + + void *buf; /* Buffer */ + dma_addr_t buf_handle; /* Buffer handle */ + + unsigned int record; + unsigned int format; + unsigned int rate; + unsigned int stereo; + + unsigned int frag_sz; /* Current fragment size */ + unsigned int frag_num; /* Current # of fragments */ + unsigned int buf_sz; /* Current buffer size */ + + unsigned int hwptr; /* Tail */ + unsigned int swptr; /* Head */ + unsigned int filled_frags; /* Fragments currently full */ + unsigned int next_buf; /* Index of next buffer */ + + unsigned int blocked; /* Blocked on I/O */ + unsigned int drain; /* Drain queued buffers */ + unsigned int active; /* Channel currently in use */ + unsigned int mapped; /* mmap */ + + unsigned int buf_pages; /* Real size of buffer */ + int bytes; /* Total bytes */ + unsigned int nr_irqs; /* Number of interrupts */ +}; + + +struct forte_chip { + struct pci_dev *pci_dev; + unsigned long iobase; + int irq; + + struct semaphore open_sem; /* Device access */ + struct semaphore syscall_sem; /* Syscalls */ + spinlock_t lock; /* State */ + + spinlock_t ac97_lock; + struct ac97_codec *ac97; + + int multichannel; + int dsp; /* OSS handle */ + int trigger; /* mmap I/O trigger */ + + struct forte_channel play; + struct forte_channel rec; +}; + + +static struct forte_chip *forte; +static int found; + + +/* AC97 Codec -------------------------------------------------------------- */ + + +/** + * forte_ac97_wait: + * @chip: fm801 instance whose AC97 codec to wait on + * + * FIXME: + * Stop busy-waiting + */ + +static inline int +forte_ac97_wait (struct forte_chip *chip) +{ + int i = 10000; + + while ( (inw (chip->iobase + FORTE_AC97_CMD) & FORTE_AC97_PORT_BSY) + && i-- ) + ; + + return i == 0; +} + + +/** + * forte_ac97_read: + * @codec: AC97 codec to read from + * @reg: register to read + */ + +u16 +forte_ac97_read (struct ac97_codec *codec, u8 reg) +{ + u16 ret = 0; + struct forte_chip *chip = codec->private_data; + + spin_lock (&chip->ac97_lock); + + /* Knock, knock */ + if (forte_ac97_wait (chip)) { + printk (KERN_ERR PFX "ac97_read: Serial bus busy\n"); + goto out; + } + + /* Send read command */ + outw (reg | (1<<7), chip->iobase + FORTE_AC97_CMD); + + if (forte_ac97_wait (chip)) { + printk (KERN_ERR PFX "ac97_read: Bus busy reading reg 0x%x\n", + reg); + goto out; + } + + /* Sanity checking */ + if (inw (chip->iobase + FORTE_AC97_CMD) & FORTE_AC97_DP_INVALID) { + printk (KERN_ERR PFX "ac97_read: Invalid data port"); + goto out; + } + + /* Fetch result */ + ret = inw (chip->iobase + FORTE_AC97_DATA); + + out: + spin_unlock (&chip->ac97_lock); + return ret; +} + + +/** + * forte_ac97_write: + * @codec: AC97 codec to send command to + * @reg: register to write + * @val: value to write + */ + +void +forte_ac97_write (struct ac97_codec *codec, u8 reg, u16 val) +{ + struct forte_chip *chip = codec->private_data; + + spin_lock (&chip->ac97_lock); + + /* Knock, knock */ + if (forte_ac97_wait (chip)) { + printk (KERN_ERR PFX "ac97_write: Serial bus busy\n"); + goto out; + } + + outw (val, chip->iobase + FORTE_AC97_DATA); + outb (reg | FORTE_AC97_WRITE, chip->iobase + FORTE_AC97_CMD); + + /* Wait for completion */ + if (forte_ac97_wait (chip)) { + printk (KERN_ERR PFX "ac97_write: Bus busy after write\n"); + goto out; + } + + out: + spin_unlock (&chip->ac97_lock); +} + + +/* Mixer ------------------------------------------------------------------- */ + + +/** + * forte_mixer_open: + * @inode: + * @file: + */ + +static int +forte_mixer_open (struct inode *inode, struct file *file) +{ + struct forte_chip *chip = forte; + + MOD_INC_USE_COUNT; + + file->private_data = chip->ac97; + + return 0; +} + + +/** + * forte_mixer_release: + * @inode: + * @file: + */ + +static int +forte_mixer_release (struct inode *inode, struct file *file) +{ + /* We will welease Wodewick */ + MOD_DEC_USE_COUNT; + + return 0; +} + + +/** + * forte_mixer_ioctl: + * @inode: + * @file: + */ + +static int +forte_mixer_ioctl (struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + struct ac97_codec *codec = (struct ac97_codec *) file->private_data; + + return codec->mixer_ioctl (codec, cmd, arg); +} + + +static struct file_operations forte_mixer_fops = { + owner: THIS_MODULE, + llseek: no_llseek, + ioctl: forte_mixer_ioctl, + open: forte_mixer_open, + release: forte_mixer_release, +}; + + +/* Channel ----------------------------------------------------------------- */ + +/** + * forte_channel_reset: + * @channel: Channel to reset + */ + +static void +forte_channel_reset (struct forte_channel *channel) +{ + if (!channel || !channel->iobase) { + DPRINTK ("%s: dead channel\n", __FUNCTION__); + return; + } + + DPRINTK ("%s: channel = %s\n", __FUNCTION__, channel->name); + + channel->ctrl &= ~FORTE_START; + outw (channel->ctrl, channel->iobase + FORTE_PLY_CTRL); + + /* We always play at least two fragments, hence these defaults */ + channel->hwptr = channel->frag_sz; + channel->next_buf = 1; + channel->swptr = 0; + channel->filled_frags = 0; + channel->blocked = 0; + channel->drain = 0; + channel->active = 0; + channel->bytes = 0; + channel->nr_irqs = 0; + channel->mapped = 0; +} + + +/** + * forte_channel_start: + * @channel: Channel to start (record/playback) + */ + +static void inline +forte_channel_start (struct forte_channel *channel) +{ + if (!channel || !channel->iobase) { + DPRINTK ("%s: dead channel\n", __FUNCTION__); + return; + } + + channel->ctrl &= ~(FORTE_PAUSE | FORTE_BUF1_LAST | FORTE_BUF2_LAST); + channel->ctrl |= FORTE_START; + channel->active = 1; + + outw (channel->ctrl, channel->iobase + FORTE_PLY_CTRL); +} + + +/** + * forte_channel_stop: + * @channel: Channel to stop + */ + +static void inline +forte_channel_stop (struct forte_channel *channel) +{ + if (!channel || !channel->iobase) { + DPRINTK ("%s: dead channel\n", __FUNCTION__); + return; + } + + channel->ctrl &= ~FORTE_START; + outw (channel->ctrl, channel->iobase + FORTE_PLY_CTRL); + + channel->active = 0; +} + + +/** + * forte_channel_rate: + * @channel: Channel whose rate to set. Playback and record are + * independent. + * @rate: Channel rate in Hz + */ + +static int +forte_channel_rate (struct forte_channel *channel, unsigned int rate) +{ + int new_rate; + + if (!channel || !channel->iobase) { + DPRINTK ("%s: dead channel\n", __FUNCTION__); + return -EINVAL; + } + + if (rate == 0 || channel->rate == rate) + return channel->rate; + + if (rate > 48000) + rate = 48000; + + if (rate < 5500) + rate = 5500; + + channel->ctrl &= ~FORTE_RATE_MASK; + + switch (rate) { + case 5500: new_rate = 0; break; + case 8000: new_rate = 1; break; + case 9600: new_rate = 2; break; + case 11025: new_rate = 3; break; + case 16000: new_rate = 4; break; + case 19200: new_rate = 5; break; + case 22050: new_rate = 6; break; + case 32000: new_rate = 7; break; + case 38400: new_rate = 8; break; + case 44100: new_rate = 9; break; + case 48000: new_rate = 10; break; + + default: + printk (KERN_ERR PFX "Unsupported rate: %d", rate); + return -EINVAL; + } + + channel->ctrl |= new_rate << FORTE_RATE_SHIFT; + channel->rate = rate; + + DPRINTK ("%s: %s rate = %d\n", __FUNCTION__, channel->name, rate); + + return channel->rate; +} + + +/** + * forte_channel_format: + * @channel: Channel whose audio format to set + * @format: OSS format ID + */ + +static int +forte_channel_format (struct forte_channel *channel, int format) +{ + if (!channel || !channel->iobase) { + DPRINTK ("%s: dead channel\n", __FUNCTION__); + return -EINVAL; + } + + DPRINTK ("%s: %s format = %d\n", __FUNCTION__, channel->name, format); + + if (channel->format == format) + return format; + + switch (format) { + + case AFMT_QUERY: + return channel->format; + + case AFMT_U8: + channel->ctrl &= ~FORTE_16BIT; + channel->format = format; + return format; + + case AFMT_S16_LE: + channel->ctrl |= FORTE_16BIT; + channel->format = format; + return format; + + default: + printk (KERN_ERR PFX "Unsupported audio format"); + return -EINVAL; + } +} + + +/** + * forte_channel_stereo: + * @channel: Channel to toggle + * @stereo: 0 for Mono, 1 for Stereo + */ + +static int +forte_channel_stereo (struct forte_channel *channel, unsigned int stereo) +{ + if (!channel || !channel->iobase) { + DPRINTK ("%s: dead channel\n", __FUNCTION__); + return -EINVAL; + } + + DPRINTK ("%s: %s stereo = %d\n", __FUNCTION__, channel->name, stereo); + + switch (stereo) { + case 0: + channel->ctrl &= ~(FORTE_STEREO | FORTE_CHANNELS_MASK); + channel-> stereo = stereo; + return stereo; + case 1: + channel->ctrl &= ~FORTE_CHANNELS_MASK; + channel->ctrl |= FORTE_STEREO; + channel-> stereo = stereo; + return stereo; + default: + printk (KERN_ERR PFX "Unsupported channel format"); + return -EINVAL; + } +} + + +/** + * forte_channel_buffer: + * @channel: Channel whose buffer to set up + * + * FIXME: Buffer scaling dependant on rate/channels/bits + * + */ + +static void +forte_channel_buffer (struct forte_channel *channel, int sz, int num) +{ + /* Go away, I'm busy */ + if (channel->filled_frags) + return; + + channel->frag_sz = sz; + channel->frag_num = num; + + if (channel->frag_sz < FORTE_MIN_FRAG_SIZE) + channel->frag_sz = FORTE_MIN_FRAG_SIZE; + + if (channel->frag_sz > FORTE_MAX_FRAG_SIZE) + channel->frag_sz = FORTE_MAX_FRAG_SIZE; + + if (channel->frag_num < FORTE_MIN_FRAGMENTS) + channel->frag_num = FORTE_MIN_FRAGMENTS; + + if (channel->frag_num > FORTE_MAX_FRAGMENTS) + channel->frag_num = FORTE_MAX_FRAGMENTS; + + if (channel->frag_sz * channel->frag_num < FORTE_MIN_BUF) + channel->frag_num = FORTE_MIN_BUF / channel->frag_sz; + + channel->buf_sz = channel->frag_sz * channel->frag_num; + + DPRINTK ("%s: %s frag_sz = %d, frag_num = %d, buf_sz = %d\n", + __FUNCTION__, channel->name, channel->frag_sz, + channel->frag_num, channel->buf_sz); +} + + +/** + * forte_channel_drain: + * @chip: + * @channel: + * + */ + +static inline void +forte_channel_drain (struct forte_channel *channel) +{ + if (!channel->active) + return; + + if (channel->mapped) { + forte_channel_stop (channel); + return; + } + + channel->drain = 1; + + while (channel->active && channel->filled_frags > 0) + interruptible_sleep_on (&channel->wait); + + channel->drain = 0; + + return; +} + + +/** + * forte_channel_prep: + * @channel: Channel whose buffer to prepare + * + */ + +static void +forte_channel_prep (struct forte_channel *channel) +{ + struct page *page; + int i; + + if (channel->buf) + return; + + channel->buf_pages = channel->buf_sz >> PAGE_SHIFT; + + if (channel->buf_sz % PAGE_SIZE) + channel->buf_pages++; + + DPRINTK ("%s: %s frag_sz = %d, frag_num = %d, buf_sz = %d, pg = %d\n", + __FUNCTION__, channel->name, channel->frag_sz, + channel->frag_num, channel->buf_sz, channel->buf_pages); + + /* DMA buffer */ + channel->buf = pci_alloc_consistent (forte->pci_dev, + channel->buf_pages * PAGE_SIZE, + &channel->buf_handle); + + page = virt_to_page (channel->buf); + + for (i = 0 ; i < channel->buf_pages ; i++) + mem_map_reserve (page++); + + if (!channel->buf || !channel->buf_handle) + BUG(); + + /* Prep buffer registers */ + outw (channel->frag_sz - 1, channel->iobase + FORTE_PLY_COUNT); + outl (channel->buf_handle, channel->iobase + FORTE_PLY_BUF1); + outl (channel->buf_handle + channel->frag_sz, + channel->iobase + FORTE_PLY_BUF2); + + /* Reset hwptr */ + channel->hwptr = channel->frag_sz; + channel->next_buf = 1; + + DPRINTK ("%s: %s buffer @ %p (%d)\n", __FUNCTION__, channel->name, + channel->buf, (unsigned long) channel->buf_handle); +} + + +/** + * forte_channel_init: + * @chip: Forte chip instance the channel hangs off + * @channel: Channel to initialize + * + * Description: + * Initializes a channel, sets defaults, and allocates + * buffers. + */ + +static int +forte_channel_init (struct forte_chip *chip, struct forte_channel *channel) +{ + spin_lock_irq (&chip->lock); + + DPRINTK ("%s: chip iobase @ %p\n", __FUNCTION__, (void *)chip->iobase); + + memset (channel, 0x0, sizeof (*channel)); + + if (channel == &chip->play) { + channel->name = "PCM_OUT"; + channel->iobase = chip->iobase; + DPRINTK ("%s: PCM-OUT iobase @ %p\n", __FUNCTION__, + (void *) channel->iobase); + } + else if (channel == &chip->rec) { + channel->name = "PCM_IN"; + channel->iobase = chip->iobase + FORTE_CAP_OFFSET; + channel->record = 1; + DPRINTK ("%s: PCM-IN iobase @ %p\n", __FUNCTION__, + (void *) channel->iobase); + } + else + BUG(); + + init_waitqueue_head (&channel->wait); + + /* Defaults: 48kHz, 16-bit, mono */ + forte_channel_stereo (channel, 0); + forte_channel_format (channel, AFMT_S16_LE); + forte_channel_rate (channel, 48000); + forte_channel_buffer (channel, FORTE_DEF_FRAG_SIZE, + FORTE_DEF_FRAGMENTS); + forte_channel_reset (channel); + + spin_unlock_irq (&chip->lock); + + return 0; +} + + +/** + * forte_channel_free: + * @chip: Chip this channel hangs off + * @channel: Channel to nuke + * + * Description: + * Resets channel and frees buffers. + */ + +static void +forte_channel_free (struct forte_chip *chip, struct forte_channel *channel) +{ + DPRINTK ("%s: %s\n", __FUNCTION__, channel->name); + + if (!channel->buf_handle) + return; + + spin_lock_irq (&chip->lock); + + pci_free_consistent (chip->pci_dev, channel->buf_pages * PAGE_SIZE, + channel->buf, channel->buf_handle); + + memset (channel, 0x0, sizeof (*channel)); + + spin_unlock_irq (&chip->lock); + synchronize_irq(); +} + + +/* DSP --------------------------------------------------------------------- */ + + +/** + * forte_dsp_ioctl: + */ + +static int +forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg) +{ + int ival, ret, rval, rd, wr; + unsigned long flags; + struct forte_chip *chip; + struct audio_buf_info abi; + struct count_info cinfo; + + chip = file->private_data; + + if (file->f_mode & FMODE_WRITE) + wr = 1; + else + wr = 0; + + if (file->f_mode & FMODE_READ) + rd = 1; + else + rd = 0; + + /* Don't fsck with parms while a channel is active. + * FIXME: This is not good enough + */ + if (rd && wr && (chip->play.active || chip->rec.active)) + return -EFAULT; + + spin_lock_irqsave (&chip->lock, flags); + + switch (cmd) { + + case OSS_GETVERSION: + ret = put_user (SOUND_VERSION, (int *) arg); + break; + + case SNDCTL_DSP_GETCAPS: + DPRINTK ("%s: GETCAPS\n", __FUNCTION__); + ival = FORTE_CAPS; /* DUPLEX */ + ret = put_user (ival, (int *) arg); + break; + + case SNDCTL_DSP_GETFMTS: + DPRINTK ("%s: GETFMTS\n", __FUNCTION__); + ival = FORTE_FMTS; /* U8, 16LE */ + ret = put_user (ival, (int *) arg); + break; + + case SNDCTL_DSP_SETFMT: /* U8, 16LE */ + DPRINTK ("%s: SETFMT\n", __FUNCTION__); + if (get_user (ival, (int *) arg)) { + ret = -EFAULT; + break; + } + + if (rd) { + forte_channel_stop (&chip->rec); + rval = forte_channel_format (&chip->rec, ival); + } + + if (wr) { + forte_channel_stop (&chip->rec); + rval = forte_channel_format (&chip->play, ival); + } + + ret = put_user (rval, (int *) arg); + break; + + case SNDCTL_DSP_STEREO: /* 0 - mono, 1 - stereo */ + DPRINTK ("%s: STEREO\n", __FUNCTION__); + if (get_user (ival, (int *) arg)) { + ret = -EFAULT; + break; + } + + if (rd) { + forte_channel_stop (&chip->rec); + rval = forte_channel_stereo (&chip->rec, ival); + } + + if (wr) { + forte_channel_stop (&chip->rec); + rval = forte_channel_stereo (&chip->play, ival); + } + + ret = put_user (rval, (int *) arg); + break; + + case SNDCTL_DSP_CHANNELS: /* 1 - mono, 2 - stereo */ + DPRINTK ("%s: CHANNELS\n", __FUNCTION__); + + if (get_user (ival, (int *) arg)) { + ret = -EFAULT; + break; + } + + if (rd) { + forte_channel_stop (&chip->rec); + rval = forte_channel_stereo (&chip->rec, ival-1) + 1; + } + + if (wr) { + forte_channel_stop (&chip->play); + rval = forte_channel_stereo (&chip->play, ival-1) + 1; + } + + ret = put_user (rval, (int *) arg); + break; + + case SNDCTL_DSP_SPEED: + DPRINTK ("%s: SPEED\n", __FUNCTION__); + + if (get_user (ival, (int *) arg)) { + ret = -EFAULT; + break; + } + + if (rd) { + forte_channel_stop (&chip->rec); + rval = forte_channel_rate (&chip->rec, ival); + } + + if (wr) { + forte_channel_stop (&chip->play); + rval = forte_channel_rate (&chip->play, ival); + } + + ret = put_user(rval, (int*) arg); + break; + + case SNDCTL_DSP_GETBLKSIZE: + DPRINTK ("%s: GETBLKSIZE\n", __FUNCTION__); + + if (rd) + ival = chip->rec.frag_sz; + + if (wr) + ival = chip->play.frag_sz; + + ret = put_user (ival, (int *) arg); + break; + + case SNDCTL_DSP_RESET: + DPRINTK ("%s: RESET\n", __FUNCTION__); + + if (rd) + forte_channel_reset (&chip->rec); + + if (wr) + forte_channel_reset (&chip->play); + + ret = 0; + break; + + case SNDCTL_DSP_SYNC: + DPRINTK ("%s: SYNC\n", __FUNCTION__); + + if (wr) { + forte_channel_drain (&chip->play); + forte_channel_reset (&chip->play); + } + + ret = 0; + break; + + case SNDCTL_DSP_POST: + DPRINTK ("%s: POST\n", __FUNCTION__); + + if (wr) + forte_channel_reset (&chip->play); + + ret = 0; + break; + + case SNDCTL_DSP_SETFRAGMENT: + DPRINTK ("%s: SETFRAGMENT\n", __FUNCTION__); + if (get_user (ival, (int *) arg)) { + ret = -EFAULT; + break; + } + + if (rd) { + forte_channel_buffer (&chip->rec, ival & 0xffff, + (ival >> 16) & 0xffff); + ival = (chip->rec.frag_num << 16) + chip->rec.frag_sz; + } + + if (wr) { + forte_channel_buffer (&chip->play, ival & 0xffff, + (ival >> 16) & 0xffff); + ival = (chip->play.frag_num << 16) +chip->play.frag_sz; + } + + ret = put_user (ival, (int *) arg); + break; + + case SNDCTL_DSP_GETISPACE: + ret = -EINVAL; + break; + + // FIXME + DPRINTK ("%s: GETISPACE\n", __FUNCTION__); + abi.fragstotal = chip->rec.frag_num; + abi.fragments = chip->rec.frag_num - chip->rec.filled_frags; + abi.fragsize = chip->rec.frag_sz; + abi.bytes = abi.fragments * abi.fragsize; + ret = copy_to_user ((void *) arg, &abi, sizeof (abi)); + break; + + case SNDCTL_DSP_GETIPTR: + DPRINTK ("%s: GETIPTR\n", __FUNCTION__); + + ret = -EINVAL; + break; + + case SNDCTL_DSP_GETOSPACE: + DPRINTK ("%s: GETOSPACE\n", __FUNCTION__); + + abi.fragstotal = chip->play.frag_num; + abi.fragments = chip->play.frag_num - chip->play.filled_frags; + abi.fragsize = chip->play.frag_sz; + abi.bytes = abi.fragments * abi.fragsize; + + DPRINTK ("%s: GETOSPACE f_total=%d, frags=%d, fz=%d, bytes=%d\n", __FUNCTION__, abi.fragstotal, abi.fragments, abi.fragsize, abi.bytes); + + ret = copy_to_user ((void *) arg, &abi, sizeof (abi)); + break; + + case SNDCTL_DSP_GETOPTR: + DPRINTK ("%s: GETOPTR\n", __FUNCTION__); + + cinfo.bytes = chip->play.bytes; + + cinfo.blocks = chip->play.nr_irqs; + chip->play.nr_irqs = 0; + + cinfo.ptr = chip->play.hwptr * chip->play.frag_sz; + + ret = copy_to_user ((void *) arg, &cinfo, sizeof (cinfo)); + break; + + case SNDCTL_DSP_GETODELAY: + DPRINTK ("%s: GETODELAY\n", __FUNCTION__); + + if (! chip->play.active) { + ret = 0; + break; + } + + ival = chip->play.filled_frags * chip->play.frag_sz; + + DPRINTK ("%s: GETODELAY = %d\n", __FUNCTION__, ival); + + ret = put_user (ival, (int *) arg); + break; + + case SNDCTL_DSP_SETDUPLEX: + DPRINTK ("%s: SETDUPLEX\n", __FUNCTION__); + + ret = -EINVAL; + break; + + case SNDCTL_DSP_GETTRIGGER: + DPRINTK ("%s: GETTRIGGER\n", __FUNCTION__); + + ret = put_user (chip->trigger, (int *) arg); + break; + + case SNDCTL_DSP_SETTRIGGER: + + if (get_user (ival, (int *) arg)) { + ret = -EFAULT; + break; + } + + DPRINTK ("%s: SETTRIGGER %d\n", __FUNCTION__, ival); + + if (ival & PCM_ENABLE_OUTPUT) + forte_channel_start (&chip->play); + else { + forte_channel_prep (&chip->play); + forte_channel_stop (&chip->play); + } + + break; + + default: + printk (KERN_ERR PFX "Unsupported ioctl: %x (%p)\n", cmd, + (void *) arg); + ret = -EINVAL; + break; + } + + spin_unlock_irqrestore (&chip->lock, flags); + return ret; +} + + +/** + * forte_dsp_open: + */ + +static int +forte_dsp_open (struct inode *inode, struct file *file) +{ + struct forte_chip *chip = forte; /* FIXME: HACK FROM HELL! */ + struct forte_channel *channel; + + if (down_interruptible (&chip->open_sem)) { + DPRINTK ("%s: returning -ERESTARTSYS\n", __FUNCTION__); + return -ERESTARTSYS; + } + + file->private_data = forte; + + DPRINTK ("%s: chip @ %p\n", __FUNCTION__, file->private_data); + + if (file->f_mode & FMODE_WRITE) + forte_channel_init (forte, &forte->play); + + if (file->f_mode & FMODE_READ) + forte_channel_init (forte, &forte->rec); + + return 0; +} + + +/** + * forte_dsp_release: + */ + +static int +forte_dsp_release (struct inode *inode, struct file *file) +{ + struct forte_chip *chip = file->private_data; + int ret = 0; + + DPRINTK ("%s: chip @ %p\n", __FUNCTION__, chip); + + if (file->f_mode & FMODE_WRITE) { + if (down_interruptible (&chip->syscall_sem)) + return -ERESTARTSYS; + + forte_channel_drain (&chip->play); + forte_channel_stop (&chip->play); + forte_channel_free (chip, &chip->play); + + up (&chip->syscall_sem); + up (&chip->open_sem); + + return 0; + } + + if (file->f_mode & FMODE_READ) { + if (down_interruptible (&chip->syscall_sem)) + return -ERESTARTSYS; + + while (chip->rec.filled_frags > 0) + interruptible_sleep_on (&chip->rec.wait); + + forte_channel_free (chip, &chip->rec); + up (&chip->syscall_sem); + up (&chip->open_sem); + return 0; + } + + printk (KERN_ERR PFX "dsp_release error"); + + return -EINVAL; +} + + +/** + * forte_dsp_poll: + */ + +static unsigned int +forte_dsp_poll (struct file *file, struct poll_table_struct *wait) +{ + struct forte_chip *chip; + struct forte_channel *channel; + unsigned int mask = 0; + + chip = file->private_data; + + if (file->f_mode & FMODE_WRITE) { + channel = &chip->play; + + if (channel->ctrl & FORTE_START) + poll_wait (file, &channel->wait, wait); + + if (channel->filled_frags) + mask |= POLLOUT | POLLWRNORM; + } + + if (file->f_mode & FMODE_READ) { + channel = &chip->rec; + + if (channel->ctrl & FORTE_START) + poll_wait (file, &channel->wait, wait); + + if (channel->filled_frags > 0) + mask |= POLLIN | POLLRDNORM; + } + + return mask; +} + + +/** + * forte_dsp_mmap: + */ + +static int +forte_dsp_mmap (struct file *file, struct vm_area_struct *vma) +{ + struct forte_chip *chip; + struct forte_channel *channel; + unsigned long size; + int ret; + + chip = file->private_data; + + DPRINTK ("%s: start %lXh, size %ld, pgoff %ld\n", __FUNCTION__, + vma->vm_start, vma->vm_end - vma->vm_start, vma->vm_pgoff); + + if (vma->vm_flags & VM_WRITE && chip->play.active) { + ret = -EBUSY; + goto out; + } + + if (vma->vm_flags & VM_READ && chip->rec.active) { + ret = -EBUSY; + goto out; + } + + if (file->f_mode & FMODE_WRITE) + channel = &chip->play; + else if (file->f_mode & FMODE_READ) + channel = &chip->rec; + else { + ret = -EINVAL; + goto out; + } + + forte_channel_prep (channel); + channel->mapped = 1; + + if (vma->vm_pgoff != 0) { + ret = -EINVAL; + goto out; + } + + size = vma->vm_end - vma->vm_start; + + if (size > channel->buf_pages * PAGE_SIZE) { + DPRINTK ("%s: size (%d) > buf_sz (%d) \n", __FUNCTION__, + size, channel->buf_sz); + ret = -EINVAL; + goto out; + } + + if (remap_page_range (vma->vm_start, virt_to_phys (channel->buf), + size, vma->vm_page_prot)) { + DPRINTK ("%s: remap el a no worko\n", __FUNCTION__); + ret = -EAGAIN; + goto out; + } + + ret = 0; + + out: + return ret; +} + + +/** + * forte_dsp_write: + */ + +static ssize_t +forte_dsp_write (struct file *file, const char *buffer, size_t bytes, + loff_t *ppos) +{ + struct forte_chip *chip; + struct forte_channel *channel; + unsigned int i = bytes, ret = 0, sz = 0; + + if (ppos != &file->f_pos) + return -ESPIPE; + + if (!access_ok (VERIFY_READ, buffer, bytes)) + return -EFAULT; + + chip = (struct forte_chip *) file->private_data; + + if (!chip) + BUG(); + + channel = &chip->play; + + if (!channel) + BUG(); + + if (down_interruptible (&chip->syscall_sem)) + return -ERESTARTSYS; + + /* Set up buffers with the right fragment size */ + forte_channel_prep (channel); + + while (i) { + /* All fragment buffers in use -> wait */ + if (channel->frag_num - channel->filled_frags == 0) { + up (&chip->syscall_sem); + + channel->blocked = 1; + interruptible_sleep_on (&channel->wait); + channel->blocked = 0; + + if (down_interruptible (&chip->syscall_sem) && + signal_pending (current)) + return -ERESTARTSYS; + } + + if (i > channel->frag_sz) + sz = channel->frag_sz; + else + sz = i; + + /* Clear the fragment so we don't get noise when copying + * smaller buffers + */ + memset ((void *) channel->buf + channel->swptr, 0x0, sz); + + if (copy_from_user ((void *) channel->buf + channel->swptr, + buffer, sz)) { + ret = -EFAULT; + goto out; + } + + /* Advance software pointer */ + buffer += sz; + channel->bytes += sz; + channel->filled_frags++; + channel->swptr += channel->frag_sz; + channel->swptr %= channel->buf_sz; + i -= sz; + + /* If playback isn't active, start it */ + if (channel->active == 0) + forte_channel_start (channel); + } + + ret = bytes - i; + + out: + up (&chip->syscall_sem); + return ret; +} + + +/** + * forte_dsp_read: + */ + +static ssize_t +forte_dsp_read (struct file *file, char *buffer, size_t bytes, + loff_t *ppos) +{ + struct forte_chip *chip; + struct forte_channel *channel; + unsigned int i = bytes, sz, ret; + unsigned long flags; + + if (ppos != &file->f_pos) + return -ESPIPE; + + if (!access_ok (VERIFY_WRITE, buffer, bytes)) + return -EFAULT; + + chip = (struct forte_chip *) file->private_data; + + if (!chip) + BUG(); + + channel = &chip->rec; + + if (!channel) + BUG(); + + spin_lock_irqsave (&chip->lock, flags); + + /* Set up buffers with the right fragment size */ + forte_channel_prep (channel); + + /* Start recording */ + forte_channel_start (channel); + + while (i) { + DPRINTK ("%s: i = %d\n", __FUNCTION__, i); + + /* No fragment buffers in use -> wait */ + if (channel->filled_frags == 0) { + spin_unlock_irqrestore (&chip->lock, flags); + interruptible_sleep_on (&channel->wait); + spin_lock_irqsave (&chip->lock, flags); + } + + if (i > channel->frag_sz) + sz = channel->frag_sz; + else + sz = i; + + if (copy_to_user (buffer, (void *)channel->buf+channel->swptr, + sz)) { + ret = -EFAULT; + DPRINTK ("%s: copy_to_user failed\n", __FUNCTION__); + goto out; + } + + /* Advance software pointer */ + buffer += sz; + channel->filled_frags--; + channel->swptr += channel->frag_sz; + channel->swptr %= channel->buf_sz; + i -= sz; + + DPRINTK ("%s: filled_frags = %d, swptr = %x\n", __FUNCTION__, + channel->filled_frags, channel->swptr); + } + + ret = bytes - i; + + out: + spin_unlock_irqrestore (&chip->lock, flags); + return ret; +} + + +static struct file_operations forte_dsp_fops = { + owner: THIS_MODULE, + llseek: &no_llseek, +// read: &forte_dsp_read, + write: &forte_dsp_write, + poll: &forte_dsp_poll, + ioctl: &forte_dsp_ioctl, + open: &forte_dsp_open, + release: &forte_dsp_release, + mmap: &forte_dsp_mmap, +}; + + +/* Common ------------------------------------------------------------------ */ + + +/** + * forte_interrupt: + */ + +static void +forte_interrupt (int irq, void *dev_id, struct pt_regs *regs) +{ + struct forte_chip *chip = dev_id; + struct forte_channel *channel = NULL; + u16 status, count; + + status = inw (chip->iobase + FORTE_IRQ_STATUS); + + /* If this is not for us, get outta here ASAP */ + if ((status & (FORTE_IRQ_PLAYBACK | FORTE_IRQ_CAPTURE)) == 0) + return; + + if (status & FORTE_IRQ_PLAYBACK) { + channel = &chip->play; + spin_lock_irq (&chip->lock); + + /* Declare a fragment done */ + channel->filled_frags--; + + /* Get # of completed bytes */ + count = inw (channel->iobase + FORTE_PLY_COUNT) + 1; + + if (count == 0) { + DPRINTK ("%s: last, filled_frags = %d\n", __FUNCTION__, + channel->filled_frags); + channel->filled_frags = 0; + goto pack; + } + + channel->nr_irqs++; + + /* Flip-flop between buffer I and II */ + channel->next_buf ^= 1; + + /* Advance hardware pointer by fragment size and wrap around */ + channel->hwptr += channel->frag_sz; + channel->hwptr %= channel->buf_sz; + + /* Buffer I or buffer II BAR */ + outl (channel->buf_handle + channel->hwptr, + channel->next_buf == 0 ? + channel->iobase + FORTE_PLY_BUF1 : + channel->iobase + FORTE_PLY_BUF2); + + /* If the currently playing fragment is last, schedule stop */ + if (channel->filled_frags == 1) + forte_channel_stop (channel); + pack: + /* Acknowledge interrupt */ + outw (FORTE_IRQ_PLAYBACK, chip->iobase + FORTE_IRQ_STATUS); + + spin_unlock_irq (&chip->lock); + + if (channel->blocked || channel->drain) + wake_up_interruptible (&channel->wait); + } + + if (status & FORTE_IRQ_CAPTURE) { + channel = &chip->rec; + spin_lock_irq (&chip->lock); + + /* One fragment filled */ + channel->filled_frags++; + + DPRINTK ("%s: filled_frags = %d\n", __FUNCTION__, + channel->filled_frags); + + /* Get # of completed bytes */ + count = inw (channel->iobase + FORTE_PLY_COUNT) + 1; + + if (count == 0) { + DPRINTK ("%s: last, filled_frags = %d\n", __FUNCTION__, + channel->filled_frags); + channel->filled_frags = 0; + goto rack; + } + + /* Buffer I or buffer II BAR */ + outl (channel->buf_handle + channel->hwptr, + channel->next_buf == 0 ? + channel->iobase + FORTE_PLY_BUF1 : + channel->iobase + FORTE_PLY_BUF2); + + /* Flip-flop between buffer I and II */ + channel->next_buf ^= 1; + + /* Advance hardware pointer by fragment size and wrap around */ + channel->hwptr += channel->frag_sz; + channel->hwptr %= channel->buf_sz; + + DPRINTK ("%s: hwptr = %x\n", __FUNCTION__, channel->hwptr); + + /* Out of buffers */ + if (channel->filled_frags == channel->frag_num - 1) + forte_channel_stop (channel); + rack: + /* Acknowledge interrupt */ + outw (FORTE_IRQ_CAPTURE, chip->iobase + FORTE_IRQ_STATUS); + + spin_unlock_irq (&chip->lock); + + wake_up_interruptible (&channel->wait); + } + + return; +} + + +/** + * forte_chip_init: + * @chip: Chip instance to initialize + * + * Description: + * Resets chip, configures codec and registers the driver with + * the sound subsystem. + * + * Press and hold Start for 8 secs, then switch on Run + * and hold for 4 seconds. Let go of Start. Numbers + * assume a properly oiled TWG. + */ + +static int __devinit +forte_chip_init (struct forte_chip *chip) +{ + u8 revision; + u16 cmdw; + struct ac97_codec *codec; + + pci_read_config_byte (chip->pci_dev, PCI_REVISION_ID, &revision); + + if (revision >= 0xB1) { + chip->multichannel = 1; + printk (KERN_INFO PFX "Multi-channel device detected.\n"); + } + + /* Reset chip */ + outw (FORTE_CC_CODEC_RESET | FORTE_CC_AC97_RESET, + chip->iobase + FORTE_CODEC_CTRL); + udelay(100); + outw (0, chip->iobase + FORTE_CODEC_CTRL); + + /* Request read from AC97 */ + outw (FORTE_AC97_READ | (0 << FORTE_AC97_ADDR_SHIFT), + chip->iobase + FORTE_AC97_CMD); + mdelay(750); + + if ((inw (chip->iobase + FORTE_AC97_CMD) & (3<<8)) != (1<<8)) { + printk (KERN_INFO PFX "AC97 codec not responding"); + return -EIO; + } + + /* Init volume */ + outw (0x0808, chip->iobase + FORTE_PCM_VOL); + outw (0x9f1f, chip->iobase + FORTE_FM_VOL); + outw (0x8808, chip->iobase + FORTE_I2S_VOL); + + /* I2S control - I2S mode */ + outw (0x0003, chip->iobase + FORTE_I2S_MODE); + + /* Interrupt setup - unmask PLAYBACK & CAPTURE */ + cmdw = inw (chip->iobase + FORTE_IRQ_MASK); + cmdw &= ~0x0003; + outw (cmdw, chip->iobase + FORTE_IRQ_MASK); + + /* Interrupt clear */ + outw (FORTE_IRQ_PLAYBACK|FORTE_IRQ_CAPTURE, + chip->iobase + FORTE_IRQ_STATUS); + + /* Set up the AC97 codec */ + if ((codec = kmalloc (sizeof (struct ac97_codec), GFP_KERNEL)) == NULL) + return -ENOMEM; + memset (codec, 0, sizeof (struct ac97_codec)); + + codec->private_data = chip; + codec->codec_read = forte_ac97_read; + codec->codec_write = forte_ac97_write; + codec->id = 0; + + if (ac97_probe_codec (codec) == 0) { + printk(KERN_ERR PFX "codec probe failed\n"); + kfree (codec); + return -1; + } + + /* Register mixer */ + if ((codec->dev_mixer = + register_sound_mixer (&forte_mixer_fops, -1)) < 0) { + printk (KERN_ERR PFX "couldn't register mixer!\n"); + kfree (codec); + return -1; + } + + chip->ac97 = codec; + + /* Register DSP */ + if ((chip->dsp = register_sound_dsp (&forte_dsp_fops, -1) ) < 0) { + printk (KERN_ERR PFX "couldn't register dsp!\n"); + return -1; + } + + return 0; +} + + +/** + * forte_probe: + * @pci_dev: PCI struct for probed device + * @pci_id: + * + * Description: + * Allocates chip instance, I/O region, and IRQ + */ +static int __init +forte_probe (struct pci_dev *pci_dev, const struct pci_device_id *pci_id) +{ + struct forte_chip *chip; + int ret = 0; + + /* FIXME: Support more than one chip */ + if (found++) + return -EIO; + + /* Ignition */ + if (pci_enable_device (pci_dev)) + return -EIO; + + pci_set_master (pci_dev); + + /* Allocate chip instance and configure */ + forte = (struct forte_chip *) + kmalloc (sizeof (struct forte_chip), GFP_KERNEL); + chip = forte; + + if (chip == NULL) { + printk (KERN_WARNING PFX "Out of memory"); + return -ENOMEM; + } + + memset (chip, 0, sizeof (struct forte_chip)); + chip->pci_dev = pci_dev; + + init_MUTEX(&chip->open_sem); + init_MUTEX(&chip->syscall_sem); + spin_lock_init (&chip->lock); + spin_lock_init (&chip->ac97_lock); + + if (! request_region (pci_resource_start (pci_dev, 0), + pci_resource_len (pci_dev, 0), DRIVER_NAME)) { + printk (KERN_WARNING PFX "Unable to reserve I/O space"); + ret = -ENOMEM; + goto error; + } + + chip->iobase = pci_resource_start (pci_dev, 0); + chip->irq = pci_dev->irq; + + if (request_irq (chip->irq, forte_interrupt, SA_SHIRQ, DRIVER_NAME, + chip)) { + printk (KERN_WARNING PFX "Unable to reserve IRQ"); + ret = -EIO; + goto error; + } + + pci_set_drvdata (pci_dev, chip); + + printk (KERN_INFO PFX "FM801 chip found at 0x%04lX-0x%04lX IRQ %u\n", + chip->iobase, pci_resource_end (pci_dev, 0), chip->irq); + + /* Power it up */ + if ((ret = forte_chip_init (chip)) == 0) + return 0; + + error: + if (chip->irq) + free_irq (chip->irq, chip); + + if (chip->iobase) + release_region (pci_resource_start (pci_dev, 0), + pci_resource_len (pci_dev, 0)); + + kfree (chip); + + return ret; +} + + +/** + * forte_remove: + * @pci_dev: PCI device to unclaim + * + */ + +static void +forte_remove (struct pci_dev *pci_dev) +{ + struct forte_chip *chip = pci_get_drvdata (pci_dev); + + if (chip == NULL) + return; + + free_irq (chip->irq, chip); + release_region (chip->iobase, pci_resource_len (pci_dev, 0)); + + unregister_sound_dsp (chip->dsp); + unregister_sound_mixer (chip->ac97->dev_mixer); + + kfree (chip); + + printk (KERN_INFO PFX "driver released\n"); +} + + +static struct pci_device_id forte_pci_ids[] __devinitdata = { + { 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, + { 0, } +}; + + +static struct pci_driver forte_pci_driver = { + name: DRIVER_NAME, + id_table: forte_pci_ids, + probe: forte_probe, + remove: forte_remove, + +}; + + +/** + * forte_init_module: + * + */ + +static int __init +forte_init_module (void) +{ + if (!pci_present()) + return -ENODEV; + + printk (KERN_INFO PFX DRIVER_VERSION "\n"); + + if (!pci_register_driver (&forte_pci_driver)) { + pci_unregister_driver (&forte_pci_driver); + return -ENODEV; + } + + return 0; +} + + +/** + * forte_cleanup_module: + * + */ + +static void __exit +forte_cleanup_module (void) +{ + pci_unregister_driver (&forte_pci_driver); +} + + +module_init(forte_init_module); +module_exit(forte_cleanup_module); + +MODULE_AUTHOR("Martin K. Petersen "); +MODULE_DESCRIPTION("ForteMedia FM801 OSS Driver"); +MODULE_LICENSE("GPL"); +MODULE_DEVICE_TABLE (pci, forte_pci_ids); diff -urN linux-2.4.18/drivers/usb/usb-ohci.c lia64-2.4/drivers/usb/usb-ohci.c --- linux-2.4.18/drivers/usb/usb-ohci.c Tue Feb 26 11:04:48 2002 +++ lia64-2.4/drivers/usb/usb-ohci.c Tue Feb 26 11:38:28 2002 @@ -2352,21 +2352,22 @@ { ohci_t * ohci; struct usb_bus * bus; + dma_addr_t bus_addr; ohci = (ohci_t *) kmalloc (sizeof *ohci, GFP_KERNEL); if (!ohci) return NULL; - + memset (ohci, 0, sizeof (ohci_t)); - ohci->hcca = pci_alloc_consistent (dev, sizeof *ohci->hcca, - &ohci->hcca_dma); + ohci->hcca = pci_alloc_consistent (dev, sizeof *ohci->hcca, &bus_addr); if (!ohci->hcca) { kfree (ohci); return NULL; } memset (ohci->hcca, 0, sizeof (struct ohci_hcca)); + ohci->hcca_dma = bus_addr; ohci->disabled = 1; ohci->sleeping = 0; ohci->irq = -1; diff -urN linux-2.4.18/drivers/video/fbmem.c lia64-2.4/drivers/video/fbmem.c --- linux-2.4.18/drivers/video/fbmem.c Tue Feb 26 11:04:51 2002 +++ lia64-2.4/drivers/video/fbmem.c Tue Feb 26 11:38:30 2002 @@ -616,6 +616,8 @@ vma->vm_flags |= VM_IO; #elif defined(__sh__) pgprot_val(vma->vm_page_prot) &= ~_PAGE_CACHABLE; +#elif defined(__ia64__) + vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); #else #warning What do we have to do here?? #endif diff -urN linux-2.4.18/drivers/video/radeonfb.c lia64-2.4/drivers/video/radeonfb.c --- linux-2.4.18/drivers/video/radeonfb.c Tue Feb 26 11:04:52 2002 +++ lia64-2.4/drivers/video/radeonfb.c Tue Jul 9 23:36:32 2002 @@ -258,8 +258,8 @@ u32 mmio_base_phys; u32 fb_base_phys; - u32 mmio_base; - u32 fb_base; + void *mmio_base; + void *fb_base; struct pci_dev *pdev; @@ -800,8 +800,7 @@ } /* map the regions */ - rinfo->mmio_base = (u32) ioremap (rinfo->mmio_base_phys, - RADEON_REGSIZE); + rinfo->mmio_base = ioremap (rinfo->mmio_base_phys, RADEON_REGSIZE); if (!rinfo->mmio_base) { printk ("radeonfb: cannot map MMIO\n"); release_mem_region (rinfo->mmio_base_phys, @@ -947,8 +946,7 @@ } } - rinfo->fb_base = (u32) ioremap (rinfo->fb_base_phys, - rinfo->video_ram); + rinfo->fb_base = ioremap (rinfo->fb_base_phys, rinfo->video_ram); if (!rinfo->fb_base) { printk ("radeonfb: cannot map FB\n"); iounmap ((void*)rinfo->mmio_base); @@ -1692,7 +1690,7 @@ disp->dispsw_data = NULL; - disp->screen_base = (char*)rinfo->fb_base; + disp->screen_base = rinfo->fb_base; disp->type = FB_TYPE_PACKED_PIXELS; disp->type_aux = 0; disp->ypanstep = 1; diff -urN linux-2.4.18/drivers/video/riva/fbdev.c lia64-2.4/drivers/video/riva/fbdev.c --- linux-2.4.18/drivers/video/riva/fbdev.c Tue Feb 26 11:04:52 2002 +++ lia64-2.4/drivers/video/riva/fbdev.c Fri Jul 19 23:01:52 2002 @@ -140,7 +140,8 @@ CH_GEFORCE3, CH_GEFORCE3_1, CH_GEFORCE3_2, - CH_QUADRO_DDC + CH_QUADRO_DDC, + CH_QUADRO4 }; /* directly indexed by riva_chips enum, above */ @@ -167,7 +168,10 @@ { "GeForce3", NV_ARCH_20}, { "GeForce3 Ti 200", NV_ARCH_20}, { "GeForce3 Ti 500", NV_ARCH_20}, - { "Quadro DDC", NV_ARCH_20} + { "Quadro DDC", NV_ARCH_20}, +#if 0 + { "Quadro4", NV_ARCH_25}, /* doesn't work properly yet... */ +#endif }; static struct pci_device_id rivafb_pci_tbl[] __devinitdata = { @@ -215,6 +219,10 @@ PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_GEFORCE3_2 }, { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO_DDC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_QUADRO_DDC }, +#if 0 + { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4, /* doesn't work properly yet... */ + PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_QUADRO4 }, +#endif { 0, } /* terminate list */ }; MODULE_DEVICE_TABLE(pci, rivafb_pci_tbl); diff -urN linux-2.4.18/drivers/video/sstfb.c lia64-2.4/drivers/video/sstfb.c --- linux-2.4.18/drivers/video/sstfb.c Mon Nov 26 11:19:10 2001 +++ lia64-2.4/drivers/video/sstfb.c Wed Jul 10 13:48:53 2002 @@ -1761,15 +1761,15 @@ pci_read_config_byte(sst_dev, PCI_REVISION_ID, &fb_info.revision); - fb_info.mmio.vbase = (u32) ioremap_nocache(fb_info.mmio.base, 0x400000); + fb_info.mmio.vbase = (unsigned long) ioremap_nocache(fb_info.mmio.base, 0x400000); if (!fb_info.mmio.vbase) { eprintk("cannot remap register area %#lx\n", fb_info.mmio.base); return -ENXIO; } fb_info.video.base = fb_info.mmio.base+0x400000; - fb_info.video.vbase = (u32) ioremap_nocache(fb_info.video.base, - 0x400000); + fb_info.video.vbase = (unsigned long) ioremap_nocache(fb_info.video.base, + 0x400000); if (!fb_info.video.vbase) { eprintk("cannot remap framebuffer %#lx\n", fb_info.video.base); diff -urN linux-2.4.18/drivers/video/vgacon.c lia64-2.4/drivers/video/vgacon.c --- linux-2.4.18/drivers/video/vgacon.c Wed Oct 24 10:17:58 2001 +++ lia64-2.4/drivers/video/vgacon.c Fri Jul 19 19:12:49 2002 @@ -109,14 +109,7 @@ static unsigned int vga_default_font_height; /* Height of default screen font */ static unsigned char vga_video_type; /* Card type */ static unsigned char vga_hardscroll_enabled; -#ifdef CONFIG_IA64_SOFTSDV_HACKS -/* - * SoftSDV doesn't have hardware assist VGA scrolling - */ -static unsigned char vga_hardscroll_user_enable = 0; -#else static unsigned char vga_hardscroll_user_enable = 1; -#endif static unsigned char vga_font_is_default = 1; static int vga_vesa_blanked; static int vga_palette_blanked; diff -urN linux-2.4.18/fs/binfmt_elf.c lia64-2.4/fs/binfmt_elf.c --- linux-2.4.18/fs/binfmt_elf.c Tue Feb 26 11:04:53 2002 +++ lia64-2.4/fs/binfmt_elf.c Tue Feb 26 13:18:09 2002 @@ -564,6 +564,9 @@ // printk(KERN_WARNING "ELF: Ambiguous type, using ELF\n"); interpreter_type = INTERPRETER_ELF; } + } else { + /* Executables without an interpreter also need a personality */ + SET_PERSONALITY(elf_ex, ibcs2_interpreter); } /* OK, we are done with that, now set up the arg stuff, diff -urN linux-2.4.18/fs/fcntl.c lia64-2.4/fs/fcntl.c --- linux-2.4.18/fs/fcntl.c Mon Sep 24 15:08:13 2001 +++ lia64-2.4/fs/fcntl.c Mon Sep 24 15:23:46 2001 @@ -289,6 +289,7 @@ * to fix this will be in libc. */ err = filp->f_owner.pid; + force_successful_syscall_return(); break; case F_SETOWN: lock_kernel(); diff -urN linux-2.4.18/fs/open.c lia64-2.4/fs/open.c --- linux-2.4.18/fs/open.c Wed Oct 24 10:17:59 2001 +++ lia64-2.4/fs/open.c Thu Jun 20 00:01:06 2002 @@ -301,7 +301,8 @@ newattrs.ia_mtime = times[1].tv_sec; newattrs.ia_valid |= ATTR_ATIME_SET | ATTR_MTIME_SET; } else { - if ((error = permission(inode,MAY_WRITE)) != 0) + if (current->fsuid != inode->i_uid && + (error = permission(inode,MAY_WRITE)) != 0) goto dput_and_out; } error = notify_change(nd.dentry, &newattrs); diff -urN linux-2.4.18/fs/partitions/Config.in lia64-2.4/fs/partitions/Config.in --- linux-2.4.18/fs/partitions/Config.in Mon Aug 20 10:19:20 2001 +++ lia64-2.4/fs/partitions/Config.in Thu Mar 28 16:11:08 2002 @@ -32,6 +32,7 @@ bool ' SGI partition support' CONFIG_SGI_PARTITION bool ' Ultrix partition table support' CONFIG_ULTRIX_PARTITION bool ' Sun partition tables support' CONFIG_SUN_PARTITION + bool ' EFI GUID Partition support' CONFIG_EFI_PARTITION else if [ "$ARCH" = "alpha" ]; then define_bool CONFIG_OSF_PARTITION y diff -urN linux-2.4.18/fs/partitions/Makefile lia64-2.4/fs/partitions/Makefile --- linux-2.4.18/fs/partitions/Makefile Thu Jul 26 16:30:04 2001 +++ lia64-2.4/fs/partitions/Makefile Mon Aug 13 23:46:06 2001 @@ -24,6 +24,7 @@ obj-$(CONFIG_SUN_PARTITION) += sun.o obj-$(CONFIG_ULTRIX_PARTITION) += ultrix.o obj-$(CONFIG_IBM_PARTITION) += ibm.o +obj-$(CONFIG_EFI_PARTITION) += efi.o include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/fs/partitions/check.c lia64-2.4/fs/partitions/check.c --- linux-2.4.18/fs/partitions/check.c Tue Feb 26 11:04:59 2002 +++ lia64-2.4/fs/partitions/check.c Thu Mar 28 16:11:08 2002 @@ -33,6 +33,7 @@ #include "sun.h" #include "ibm.h" #include "ultrix.h" +#include "efi.h" extern int *blk_size[]; @@ -41,6 +42,9 @@ static int (*check_part[])(struct gendisk *hd, struct block_device *bdev, unsigned long first_sect, int first_minor) = { #ifdef CONFIG_ACORN_PARTITION acorn_partition, +#endif +#ifdef CONFIG_EFI_PARTITION + efi_partition, /* this must come before msdos */ #endif #ifdef CONFIG_LDM_PARTITION ldm_partition, /* this must come before msdos */ diff -urN linux-2.4.18/fs/partitions/efi.c lia64-2.4/fs/partitions/efi.c --- linux-2.4.18/fs/partitions/efi.c Wed Dec 31 16:00:00 1969 +++ lia64-2.4/fs/partitions/efi.c Thu Mar 28 16:11:09 2002 @@ -0,0 +1,823 @@ +/************************************************************ + * EFI GUID Partition Table handling + * Per Intel EFI Specification v1.02 + * http://developer.intel.com/technology/efi/efi.htm + * efi.[ch] by Matt Domsch + * Copyright 2000,2001,2002 Dell Computer Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * TODO: + * + * Changelog: + * Wed Mar 27 2002 Matt Domsch + * - Ported to 2.5.7-pre1 and 2.4.18 + * - Applied patch to avoid fault in alternate header handling + * - cleaned up find_valid_gpt + * - On-disk structure and copy in memory is *always* LE now - + * swab fields as needed + * - remove print_gpt_header() + * - only use first max_p partition entries, to keep the kernel minor number + * and partition numbers tied. + * - 2.4.18 patch needs own crc32() function - there's no official + * lib/crc32.c in 2.4.x. + * + * Mon Feb 04 2002 Matt Domsch + * - Removed __PRIPTR_PREFIX - not being used + * + * Mon Jan 14 2002 Matt Domsch + * - Ported to 2.5.2-pre11 + library crc32 patch Linus applied + * + * Thu Dec 6 2001 Matt Domsch + * - Added compare_gpts(). + * - moved le_efi_guid_to_cpus() back into this file. GPT is the only + * thing that keeps EFI GUIDs on disk. + * - Changed gpt structure names and members to be simpler and more Linux-like. + * + * Wed Oct 17 2001 Matt Domsch + * - Removed CONFIG_DEVFS_VOLUMES_UUID code entirely per Martin Wilck + * + * Wed Oct 10 2001 Matt Domsch + * - Changed function comments to DocBook style per Andreas Dilger suggestion. + * + * Mon Oct 08 2001 Matt Domsch + * - Change read_lba() to use the page cache per Al Viro's work. + * - print u64s properly on all architectures + * - fixed debug_printk(), now Dprintk() + * + * Mon Oct 01 2001 Matt Domsch + * - Style cleanups + * - made most functions static + * - Endianness addition + * - remove test for second alternate header, as it's not per spec, + * and is unnecessary. There's now a method to read/write the last + * sector of an odd-sized disk from user space. No tools have ever + * been released which used this code, so it's effectively dead. + * - Per Asit Mallick of Intel, added a test for a valid PMBR. + * - Added kernel command line option 'gpt' to override valid PMBR test. + * + * Wed Jun 6 2001 Martin Wilck + * - added devfs volume UUID support (/dev/volumes/uuids) for + * mounting file systems by the partition GUID. + * + * Tue Dec 5 2000 Matt Domsch + * - Moved crc32() to linux/lib, added efi_crc32(). + * + * Thu Nov 30 2000 Matt Domsch + * - Replaced Intel's CRC32 function with an equivalent + * non-license-restricted version. + * + * Wed Oct 25 2000 Matt Domsch + * - Fixed the last_lba() call to return the proper last block + * + * Thu Oct 12 2000 Matt Domsch + * - Thanks to Andries Brouwer for his debugging assistance. + * - Code works, detects all the partitions. + * + ************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "check.h" +#include "efi.h" + +#if CONFIG_BLK_DEV_MD +extern void md_autodetect_dev(kdev_t dev); +#endif + +/* Handle printing of 64-bit values */ +/* Borrowed from /usr/include/inttypes.h */ +# if BITS_PER_LONG == 64 +# define __PRI64_PREFIX "l" +# else +# define __PRI64_PREFIX "ll" +# endif +# define PRIx64 __PRI64_PREFIX "x" + + +#undef EFI_DEBUG +#ifdef EFI_DEBUG +#define Dprintk(x...) printk(KERN_DEBUG x) +#else +#define Dprintk(x...) +#endif + +/* This allows a kernel command line option 'gpt' to override + * the test for invalid PMBR. Not __initdata because reloading + * the partition tables happens after init too. + */ +static int force_gpt; +static int __init +force_gpt_fn(char *str) +{ + force_gpt = 1; + return 1; +} +__setup("gpt", force_gpt_fn); + + +/* + * There are multiple 16-bit CRC polynomials in common use, but this is + * *the* standard CRC-32 polynomial, first popularized by Ethernet. + * x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x^1+x^0 + */ +#define CRCPOLY_LE 0xedb88320 +/* How many bits at a time to use. Requires a table of 4<>= 1) { + crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY_LE : 0); + for (j = 0; j < 1 << CRC_LE_BITS; j += 2 * i) + crc32table_le[i + j] = crc ^ crc32table_le[j]; + } + return 0; +} + +/** + * crc32cleanup_le(): free LE table data + */ +static void __exit crc32cleanup_le(void) +{ + if (crc32table_le) kfree(crc32table_le); + crc32table_le = NULL; +} + +__initcall(crc32init_le); +__exitcall(crc32cleanup_le); + +/** + * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN II CRC32 + * @crc - seed value for computation. ~0 for Ethernet, sometimes 0 for + * other uses, or the previous crc32 value if computing incrementally. + * @p - pointer to buffer over which CRC is run + * @len - length of buffer @p + * + */ +static u32 crc32_le(u32 crc, unsigned char const *p, size_t len) +{ + while (len--) { + crc = (crc >> 8) ^ crc32table_le[(crc ^ *p++) & 255]; + } + return crc; +} + + +/** + * efi_crc32() - EFI version of crc32 function + * @buf: buffer to calculate crc32 of + * @len - length of buf + * + * Description: Returns EFI-style CRC32 value for @buf + * + * This function uses the little endian Ethernet polynomial + * but seeds the function with ~0, and xor's with ~0 at the end. + * Note, the EFI Specification, v1.02, has a reference to + * Dr. Dobbs Journal, May 1994 (actually it's in May 1992). + */ +static inline u32 +efi_crc32(const void *buf, unsigned long len) +{ + return (crc32_le(~0L, buf, len) ^ ~0L); +} + +/** + * is_pmbr_valid(): test Protective MBR for validity + * @mbr: pointer to a legacy mbr structure + * + * Description: Returns 1 if PMBR is valid, 0 otherwise. + * Validity depends on two things: + * 1) MSDOS signature is in the last two bytes of the MBR + * 2) One partition of type 0xEE is found + */ +static int +is_pmbr_valid(legacy_mbr *mbr) +{ + int i, found = 0, signature = 0; + if (!mbr) + return 0; + signature = (le16_to_cpu(mbr->signature) == MSDOS_MBR_SIGNATURE); + for (i = 0; signature && i < 4; i++) { + if (mbr->partition_record[i].sys_ind == + EFI_PMBR_OSTYPE_EFI_GPT) { + found = 1; + break; + } + } + return (signature && found); +} + +/** + * last_lba(): return number of last logical block of device + * @hd: gendisk with partition list + * @bdev: block device + * + * Description: Returns last LBA value on success, 0 on error. + * This is stored (by sd and ide-geometry) in + * the part[0] entry for this disk, and is the number of + * physical sectors available on the disk. + */ +static u64 +last_lba(struct gendisk *hd, struct block_device *bdev) +{ + if (!hd || !hd->part || !bdev) + return 0; + return hd->part[MINOR(to_kdev_t(bdev->bd_dev))].nr_sects - 1; +} + +/** + * read_lba(): Read bytes from disk, starting at given LBA + * @hd + * @bdev + * @lba + * @buffer + * @size_t + * + * Description: Reads @count bytes from @bdev into @buffer. + * Returns number of bytes read on success, 0 on error. + */ +static size_t +read_lba(struct gendisk *hd, struct block_device *bdev, u64 lba, + u8 * buffer, size_t count) +{ + + size_t totalreadcount = 0, bytesread = 0; + unsigned long blocksize; + int i; + Sector sect; + unsigned char *data = NULL; + + if (!hd || !bdev || !buffer || !count) + return 0; + + blocksize = get_hardsect_size(to_kdev_t(bdev->bd_dev)); + if (!blocksize) + blocksize = 512; + + for (i = 0; count > 0; i++) { + data = read_dev_sector(bdev, lba, §); + if (!data) + return totalreadcount; + + bytesread = + PAGE_CACHE_SIZE - (data - + (unsigned char *) page_address(sect.v)); + bytesread = min(bytesread, count); + memcpy(buffer, data, bytesread); + put_dev_sector(sect); + + buffer += bytesread; + totalreadcount += bytesread; + count -= bytesread; + lba += (bytesread / blocksize); + } + return totalreadcount; +} + + +/** + * alloc_read_gpt_entries(): reads partition entries from disk + * @hd + * @bdev + * @gpt - GPT header + * + * Description: Returns ptes on success, NULL on error. + * Allocates space for PTEs based on information found in @gpt. + * Notes: remember to free pte when you're done! + */ +static gpt_entry * +alloc_read_gpt_entries(struct gendisk *hd, + struct block_device *bdev, gpt_header *gpt) +{ + size_t count; + gpt_entry *pte; + if (!hd || !bdev || !gpt) + return NULL; + + count = le32_to_cpu(gpt->num_partition_entries) * + le32_to_cpu(gpt->sizeof_partition_entry); + if (!count) + return NULL; + pte = kmalloc(count, GFP_KERNEL); + if (!pte) + return NULL; + memset(pte, 0, count); + + if (read_lba(hd, bdev, le64_to_cpu(gpt->partition_entry_lba), + (u8 *) pte, + count) < count) { + kfree(pte); + pte=NULL; + return NULL; + } + return pte; +} + +/** + * alloc_read_gpt_header(): Allocates GPT header, reads into it from disk + * @hd + * @bdev + * @lba is the Logical Block Address of the partition table + * + * Description: returns GPT header on success, NULL on error. Allocates + * and fills a GPT header starting at @ from @bdev. + * Note: remember to free gpt when finished with it. + */ +static gpt_header * +alloc_read_gpt_header(struct gendisk *hd, struct block_device *bdev, u64 lba) +{ + gpt_header *gpt; + if (!hd || !bdev) + return NULL; + + gpt = kmalloc(sizeof (gpt_header), GFP_KERNEL); + if (!gpt) + return NULL; + memset(gpt, 0, sizeof (gpt_header)); + + if (read_lba(hd, bdev, lba, (u8 *) gpt, + sizeof (gpt_header)) < sizeof (gpt_header)) { + kfree(gpt); + gpt=NULL; + return NULL; + } + + return gpt; +} + +/** + * is_gpt_valid() - tests one GPT header and PTEs for validity + * @hd + * @bdev + * @lba is the logical block address of the GPT header to test + * @gpt is a GPT header ptr, filled on return. + * @ptes is a PTEs ptr, filled on return. + * + * Description: returns 1 if valid, 0 on error. + * If valid, returns pointers to newly allocated GPT header and PTEs. + */ +static int +is_gpt_valid(struct gendisk *hd, struct block_device *bdev, u64 lba, + gpt_header **gpt, gpt_entry **ptes) +{ + u32 crc, origcrc; + + if (!hd || !bdev || !gpt || !ptes) + return 0; + if (!(*gpt = alloc_read_gpt_header(hd, bdev, lba))) + return 0; + + /* Check the GUID Partition Table signature */ + if (le64_to_cpu((*gpt)->signature) != GPT_HEADER_SIGNATURE) { + Dprintk("GUID Partition Table Header signature is wrong: %" + PRIx64 " != %" PRIx64 "\n", le64_to_cpu((*gpt)->signature), + GPT_HEADER_SIGNATURE); + kfree(*gpt); + *gpt = NULL; + return 0; + } + + /* Check the GUID Partition Table CRC */ + origcrc = le32_to_cpu((*gpt)->header_crc32); + (*gpt)->header_crc32 = 0; + crc = efi_crc32((const unsigned char *) (*gpt), le32_to_cpu((*gpt)->header_size)); + + if (crc != origcrc) { + Dprintk + ("GUID Partition Table Header CRC is wrong: %x != %x\n", + crc, origcrc); + kfree(*gpt); + *gpt = NULL; + return 0; + } + (*gpt)->header_crc32 = cpu_to_le32(origcrc); + + /* Check that the my_lba entry points to the LBA that contains + * the GUID Partition Table */ + if (le64_to_cpu((*gpt)->my_lba) != lba) { + Dprintk("GPT my_lba incorrect: %" PRIx64 " != %" PRIx64 "\n", + le64_to_cpu((*gpt)->my_lba), lba); + kfree(*gpt); + *gpt = NULL; + return 0; + } + + if (!(*ptes = alloc_read_gpt_entries(hd, bdev, *gpt))) { + kfree(*gpt); + *gpt = NULL; + return 0; + } + + /* Check the GUID Partition Entry Array CRC */ + crc = efi_crc32((const unsigned char *) (*ptes), + le32_to_cpu((*gpt)->num_partition_entries) * + le32_to_cpu((*gpt)->sizeof_partition_entry)); + + if (crc != le32_to_cpu((*gpt)->partition_entry_array_crc32)) { + Dprintk("GUID Partitition Entry Array CRC check failed.\n"); + kfree(*gpt); + *gpt = NULL; + kfree(*ptes); + *ptes = NULL; + return 0; + } + + /* We're done, all's well */ + return 1; +} + +/** + * compare_gpts() - Search disk for valid GPT headers and PTEs + * @pgpt is the primary GPT header + * @agpt is the alternate GPT header + * @lastlba is the last LBA number + * Description: Returns nothing. Sanity checks pgpt and agpt fields + * and prints warnings on discrepancies. + * + */ +static void +compare_gpts(gpt_header *pgpt, gpt_header *agpt, u64 lastlba) +{ + int error_found = 0; + if (!pgpt || !agpt) + return; + if (le64_to_cpu(pgpt->my_lba) != le64_to_cpu(agpt->alternate_lba)) { + printk(KERN_WARNING + "GPT:Primary header LBA != Alt. header alternate_lba\n"); + printk(KERN_WARNING "GPT:%" PRIx64 " != %" PRIx64 "\n", + le64_to_cpu(pgpt->my_lba), + le64_to_cpu(agpt->alternate_lba)); + error_found++; + } + if (le64_to_cpu(pgpt->alternate_lba) != le64_to_cpu(agpt->my_lba)) { + printk(KERN_WARNING + "GPT:Primary header alternate_lba != Alt. header my_lba\n"); + printk(KERN_WARNING "GPT:%" PRIx64 " != %" PRIx64 "\n", + le64_to_cpu(pgpt->alternate_lba), + le64_to_cpu(agpt->my_lba)); + error_found++; + } + if (le64_to_cpu(pgpt->first_usable_lba) != + le64_to_cpu(agpt->first_usable_lba)) { + printk(KERN_WARNING "GPT:first_usable_lbas don't match.\n"); + printk(KERN_WARNING "GPT:%" PRIx64 " != %" PRIx64 "\n", + le64_to_cpu(pgpt->first_usable_lba), + le64_to_cpu(agpt->first_usable_lba)); + error_found++; + } + if (le64_to_cpu(pgpt->last_usable_lba) != + le64_to_cpu(agpt->last_usable_lba)) { + printk(KERN_WARNING "GPT:last_usable_lbas don't match.\n"); + printk(KERN_WARNING "GPT:%" PRIx64 " != %" PRIx64 "\n", + le64_to_cpu(pgpt->last_usable_lba), + le64_to_cpu(agpt->last_usable_lba)); + error_found++; + } + if (efi_guidcmp(pgpt->disk_guid, agpt->disk_guid)) { + printk(KERN_WARNING "GPT:disk_guids don't match.\n"); + error_found++; + } + if (le32_to_cpu(pgpt->num_partition_entries) != + le32_to_cpu(agpt->num_partition_entries)) { + printk(KERN_WARNING "GPT:num_partition_entries don't match: " + "0x%x != 0x%x\n", + le32_to_cpu(pgpt->num_partition_entries), + le32_to_cpu(agpt->num_partition_entries)); + error_found++; + } + if (le32_to_cpu(pgpt->sizeof_partition_entry) != + le32_to_cpu(agpt->sizeof_partition_entry)) { + printk(KERN_WARNING + "GPT:sizeof_partition_entry values don't match: " + "0x%x != 0x%x\n", + le32_to_cpu(pgpt->sizeof_partition_entry), + le32_to_cpu(agpt->sizeof_partition_entry)); + error_found++; + } + if (le32_to_cpu(pgpt->partition_entry_array_crc32) != + le32_to_cpu(agpt->partition_entry_array_crc32)) { + printk(KERN_WARNING + "GPT:partition_entry_array_crc32 values don't match: " + "0x%x != 0x%x\n", + le32_to_cpu(pgpt->partition_entry_array_crc32), + le32_to_cpu(agpt->partition_entry_array_crc32)); + error_found++; + } + if (le64_to_cpu(pgpt->alternate_lba) != lastlba) { + printk(KERN_WARNING + "GPT:Primary header thinks Alt. header is not at the end of the disk.\n"); + printk(KERN_WARNING "GPT:%" PRIx64 " != %" PRIx64 "\n", + le64_to_cpu(pgpt->alternate_lba), lastlba); + error_found++; + } + + if (le64_to_cpu(agpt->my_lba) != lastlba) { + printk(KERN_WARNING + "GPT:Alternate GPT header not at the end of the disk.\n"); + printk(KERN_WARNING "GPT:%" PRIx64 " != %" PRIx64 "\n", + le64_to_cpu(agpt->my_lba), lastlba); + error_found++; + } + + if (error_found) + printk(KERN_WARNING + "GPT: Use GNU Parted to correct GPT errors.\n"); + return; +} + +/** + * find_valid_gpt() - Search disk for valid GPT headers and PTEs + * @hd + * @bdev + * @gpt is a GPT header ptr, filled on return. + * @ptes is a PTEs ptr, filled on return. + * Description: Returns 1 if valid, 0 on error. + * If valid, returns pointers to newly allocated GPT header and PTEs. + * Validity depends on finding either the Primary GPT header and PTEs valid, + * or the Alternate GPT header and PTEs valid, and the PMBR valid. + */ +static int +find_valid_gpt(struct gendisk *hd, struct block_device *bdev, + gpt_header **gpt, gpt_entry **ptes) +{ + int good_pgpt = 0, good_agpt = 0, good_pmbr = 0; + gpt_header *pgpt = NULL, *agpt = NULL; + gpt_entry *pptes = NULL, *aptes = NULL; + legacy_mbr *legacymbr = NULL; + u64 lastlba; + if (!hd || !bdev || !gpt || !ptes) + return 0; + + lastlba = last_lba(hd, bdev); + good_pgpt = is_gpt_valid(hd, bdev, GPT_PRIMARY_PARTITION_TABLE_LBA, + &pgpt, &pptes); + if (good_pgpt) { + good_agpt = is_gpt_valid(hd, bdev, + le64_to_cpu(pgpt->alternate_lba), + &agpt, &aptes); + if (!good_agpt) { + good_agpt = is_gpt_valid(hd, bdev, lastlba, + &agpt, &aptes); + } + } + else { + good_agpt = is_gpt_valid(hd, bdev, lastlba, + &agpt, &aptes); + } + + /* The obviously unsuccessful case */ + if (!good_pgpt && !good_agpt) { + goto fail; + } + + /* This will be added to the EFI Spec. per Intel after v1.02. */ + legacymbr = kmalloc(sizeof (*legacymbr), GFP_KERNEL); + if (legacymbr) { + memset(legacymbr, 0, sizeof (*legacymbr)); + read_lba(hd, bdev, 0, (u8 *) legacymbr, + sizeof (*legacymbr)); + good_pmbr = is_pmbr_valid(legacymbr); + kfree(legacymbr); + legacymbr=NULL; + } + + /* Failure due to bad PMBR */ + if ((good_pgpt || good_agpt) && !good_pmbr && !force_gpt) { + printk(KERN_WARNING + " Warning: Disk has a valid GPT signature " + "but invalid PMBR.\n"); + printk(KERN_WARNING + " Assuming this disk is *not* a GPT disk anymore.\n"); + printk(KERN_WARNING + " Use gpt kernel option to override. " + "Use GNU Parted to correct disk.\n"); + goto fail; + } + + /* Would fail due to bad PMBR, but force GPT anyhow */ + if ((good_pgpt || good_agpt) && !good_pmbr && force_gpt) { + printk(KERN_WARNING + " Warning: Disk has a valid GPT signature but " + "invalid PMBR.\n"); + printk(KERN_WARNING + " Use GNU Parted to correct disk.\n"); + printk(KERN_WARNING + " gpt option taken, disk treated as GPT.\n"); + } + + compare_gpts(pgpt, agpt, lastlba); + + /* The good cases */ + if (good_pgpt && (good_pmbr || force_gpt)) { + *gpt = pgpt; + *ptes = pptes; + if (agpt) { kfree(agpt); agpt = NULL; } + if (aptes) { kfree(aptes); aptes = NULL; } + if (!good_agpt) { + printk(KERN_WARNING + "Alternate GPT is invalid, " + "using primary GPT.\n"); + } + return 1; + } + else if (good_agpt && (good_pmbr || force_gpt)) { + *gpt = agpt; + *ptes = aptes; + if (pgpt) { kfree(pgpt); pgpt = NULL; } + if (pptes) { kfree(pptes); pptes = NULL; } + printk(KERN_WARNING + "Primary GPT is invalid, using alternate GPT.\n"); + return 1; + } + + fail: + if (pgpt) { kfree(pgpt); pgpt=NULL; } + if (agpt) { kfree(agpt); agpt=NULL; } + if (pptes) { kfree(pptes); pptes=NULL; } + if (aptes) { kfree(aptes); aptes=NULL; } + *gpt = NULL; + *ptes = NULL; + return 0; +} + +/** + * add_gpt_partitions(struct gendisk *hd, struct block_device *bdev, + * @hd + * @bdev + * + * Description: Create devices for each entry in the GUID Partition Table + * Entries. + * + * We do not create a Linux partition for GPT, but + * only for the actual data partitions. + * Returns: + * -1 if unable to read the partition table + * 0 if this isn't our partition table + * 1 if successful + * + */ +static int +add_gpt_partitions(struct gendisk *hd, struct block_device *bdev, int nextminor) +{ + gpt_header *gpt = NULL; + gpt_entry *ptes = NULL; + u32 i; + int max_p; + + if (!hd || !bdev) + return -1; + + if (!find_valid_gpt(hd, bdev, &gpt, &ptes) || !gpt || !ptes) { + if (gpt) { + kfree(gpt); + gpt = NULL; + } + if (ptes) { + kfree(ptes); + ptes = NULL; + } + return 0; + } + + Dprintk("GUID Partition Table is valid! Yea!\n"); + + max_p = (1 << hd->minor_shift) - 1; + for (i = 0; i < le32_to_cpu(gpt->num_partition_entries) && i < max_p; i++) { + if (!efi_guidcmp(ptes[i].partition_type_guid, NULL_GUID)) + continue; + + add_gd_partition(hd, nextminor+i, + le64_to_cpu(ptes[i].starting_lba), + (le64_to_cpu(ptes[i].ending_lba) - + le64_to_cpu(ptes[i].starting_lba) + + 1)); + + /* If there's this is a RAID volume, tell md */ +#if CONFIG_BLK_DEV_MD + if (!efi_guidcmp(ptes[i].partition_type_guid, + PARTITION_LINUX_RAID_GUID)) { + md_autodetect_dev(MKDEV + (MAJOR(to_kdev_t(bdev->bd_dev)), + nextminor)); + } +#endif + } + kfree(ptes); + ptes=NULL; + kfree(gpt); + gpt=NULL; + printk("\n"); + return 1; +} + +/** + * efi_partition(): EFI GPT partition handling entry function + * @hd + * @bdev + * @first_sector: unused + * @first_part_minor: minor number assigned to first GPT partition found + * + * Description: called from check.c, if the disk contains GPT + * partitions, sets up partition entries in the kernel. + * + * If the first block on the disk is a legacy MBR, + * it will get handled by msdos_partition(). + * If it's a Protective MBR, we'll handle it here. + * + * set_blocksize() calls are necessary to be able to read + * a disk with an odd number of 512-byte sectors, as the + * default BLOCK_SIZE of 1024 bytes won't let that last + * sector be read otherwise. + * + * Returns: + * -1 if unable to read the partition table + * 0 if this isn't our partitoin table + * 1 if successful + */ +int +efi_partition(struct gendisk *hd, struct block_device *bdev, + unsigned long first_sector, int first_part_minor) +{ + + kdev_t dev = to_kdev_t(bdev->bd_dev); + int hardblocksize = get_hardsect_size(dev); + int orig_blksize_size = BLOCK_SIZE; + int rc = 0; + + /* Need to change the block size that the block layer uses */ + if (blksize_size[MAJOR(dev)]) { + orig_blksize_size = blksize_size[MAJOR(dev)][MINOR(dev)]; + } + + if (orig_blksize_size != hardblocksize) + set_blocksize(dev, hardblocksize); + + rc = add_gpt_partitions(hd, bdev, first_part_minor); + + /* change back */ + if (orig_blksize_size != hardblocksize) + set_blocksize(dev, orig_blksize_size); + + return rc; +} + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 4 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -4 + * c-argdecl-indent: 4 + * c-label-offset: -4 + * c-continued-statement-offset: 4 + * c-continued-brace-offset: 0 + * indent-tabs-mode: nil + * tab-width: 8 + * End: + */ diff -urN linux-2.4.18/fs/partitions/efi.h lia64-2.4/fs/partitions/efi.h --- linux-2.4.18/fs/partitions/efi.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/fs/partitions/efi.h Fri Jul 19 23:22:00 2002 @@ -0,0 +1,138 @@ +/************************************************************ + * EFI GUID Partition Table + * Per Intel EFI Specification v1.02 + * http://developer.intel.com/technology/efi/efi.htm + * + * By Matt Domsch Fri Sep 22 22:15:56 CDT 2000 + * Copyright 2000,2001 Dell Computer Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + ************************************************************/ + +#ifndef FS_PART_EFI_H_INCLUDED +#define FS_PART_EFI_H_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +/* + * Yes, specifying asm-ia64 is ugly, but this lets it build on + * other platforms too, until efi.h moves to include/linux. + */ +#include + +#define MSDOS_MBR_SIGNATURE 0xaa55 +#define EFI_PMBR_OSTYPE_EFI 0xEF +#define EFI_PMBR_OSTYPE_EFI_GPT 0xEE + +#define GPT_BLOCK_SIZE 512 +#define GPT_HEADER_SIGNATURE 0x5452415020494645L +#define GPT_HEADER_REVISION_V1 0x00010000 +#define GPT_PRIMARY_PARTITION_TABLE_LBA 1 + +#define PARTITION_SYSTEM_GUID \ + EFI_GUID( 0xC12A7328, 0xF81F, 0x11d2, \ + 0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B) +#define LEGACY_MBR_PARTITION_GUID \ + EFI_GUID( 0x024DEE41, 0x33E7, 0x11d3, \ + 0x9D, 0x69, 0x00, 0x08, 0xC7, 0x81, 0xF3, 0x9F) +#define PARTITION_MSFT_RESERVED_GUID \ + EFI_GUID( 0xE3C9E316, 0x0B5C, 0x4DB8, \ + 0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE) +#define PARTITION_BASIC_DATA_GUID \ + EFI_GUID( 0xEBD0A0A2, 0xB9E5, 0x4433, \ + 0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7) +#define PARTITION_LINUX_RAID_GUID \ + EFI_GUID( 0xa19d880f, 0x05fc, 0x4d3b, \ + 0xa0, 0x06, 0x74, 0x3f, 0x0f, 0x84, 0x91, 0x1e) +#define PARTITION_LINUX_SWAP_GUID \ + EFI_GUID( 0x0657fd6d, 0xa4ab, 0x43c4, \ + 0x84, 0xe5, 0x09, 0x33, 0xc8, 0x4b, 0x4f, 0x4f) +#define PARTITION_LINUX_LVM_GUID \ + EFI_GUID( 0xe6d6d379, 0xf507, 0x44c2, \ + 0xa2, 0x3c, 0x23, 0x8f, 0x2a, 0x3d, 0xf9, 0x28) + +typedef struct _gpt_header { + u64 signature; + u32 revision; + u32 header_size; + u32 header_crc32; + u32 reserved1; + u64 my_lba; + u64 alternate_lba; + u64 first_usable_lba; + u64 last_usable_lba; + efi_guid_t disk_guid; + u64 partition_entry_lba; + u32 num_partition_entries; + u32 sizeof_partition_entry; + u32 partition_entry_array_crc32; + u8 reserved2[GPT_BLOCK_SIZE - 92]; +} __attribute__ ((packed)) gpt_header; + +typedef struct _gpt_entry_attributes { + u64 required_to_function:1; + u64 reserved:47; + u64 type_guid_specific:16; +} __attribute__ ((packed)) gpt_entry_attributes; + +typedef struct _gpt_entry { + efi_guid_t partition_type_guid; + efi_guid_t unique_partition_guid; + u64 starting_lba; + u64 ending_lba; + gpt_entry_attributes attributes; + efi_char16_t partition_name[72 / sizeof (efi_char16_t)]; +} __attribute__ ((packed)) gpt_entry; + +typedef struct _legacy_mbr { + u8 boot_code[440]; + u32 unique_mbr_signature; + u16 unknown; + struct partition partition_record[4]; + u16 signature; +} __attribute__ ((packed)) legacy_mbr; + +/* Functions */ +extern int + efi_partition(struct gendisk *hd, struct block_device *bdev, + unsigned long first_sector, int first_part_minor); + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * -------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 4 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -4 + * c-argdecl-indent: 4 + * c-label-offset: -4 + * c-continued-statement-offset: 4 + * c-continued-brace-offset: 0 + * indent-tabs-mode: nil + * tab-width: 8 + * End: + */ diff -urN linux-2.4.18/fs/partitions/msdos.c lia64-2.4/fs/partitions/msdos.c --- linux-2.4.18/fs/partitions/msdos.c Tue Feb 26 11:04:59 2002 +++ lia64-2.4/fs/partitions/msdos.c Thu Mar 28 16:11:09 2002 @@ -35,6 +35,7 @@ #include "check.h" #include "msdos.h" +#include "efi.h" #if CONFIG_BLK_DEV_MD extern void md_autodetect_dev(kdev_t dev); @@ -563,6 +564,16 @@ return 0; } p = (struct partition *) (data + 0x1be); +#ifdef CONFIG_EFI_PARTITION + for (i=1 ; i<=4 ; i++,p++) { + /* If this is an EFI GPT disk, msdos should ignore it. */ + if (SYS_IND(p) == EFI_PMBR_OSTYPE_EFI_GPT) { + put_dev_sector(sect); + return 0; + } + } + p = (struct partition *) (data + 0x1be); +#endif /* * Look for partitions in two passes: diff -urN linux-2.4.18/fs/proc/base.c lia64-2.4/fs/proc/base.c --- linux-2.4.18/fs/proc/base.c Tue Feb 26 11:04:59 2002 +++ lia64-2.4/fs/proc/base.c Tue Feb 26 11:38:37 2002 @@ -396,7 +396,24 @@ } #endif +static loff_t mem_lseek(struct file * file, loff_t offset, int orig) +{ + switch (orig) { + case 0: + file->f_pos = offset; + break; + case 1: + file->f_pos += offset; + break; + default: + return -EINVAL; + } + force_successful_syscall_return(); + return file->f_pos; +} + static struct file_operations proc_mem_operations = { + llseek: mem_lseek, read: mem_read, write: mem_write, open: mem_open, diff -urN linux-2.4.18/include/asm-alpha/page.h lia64-2.4/include/asm-alpha/page.h --- linux-2.4.18/include/asm-alpha/page.h Wed Oct 10 16:32:15 2001 +++ lia64-2.4/include/asm-alpha/page.h Sat Feb 9 14:37:44 2002 @@ -98,6 +98,9 @@ #define VALID_PAGE(page) (((page) - mem_map) < max_mapnr) #endif /* CONFIG_DISCONTIGMEM */ +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + #endif /* __KERNEL__ */ #endif /* _ALPHA_PAGE_H */ diff -urN linux-2.4.18/include/asm-arm/page.h lia64-2.4/include/asm-arm/page.h --- linux-2.4.18/include/asm-arm/page.h Mon Aug 20 10:19:22 2001 +++ lia64-2.4/include/asm-arm/page.h Sat Feb 9 14:38:13 2002 @@ -96,6 +96,9 @@ #define VALID_PAGE(page) ((page - mem_map) < max_mapnr) #endif +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + #endif #endif diff -urN linux-2.4.18/include/asm-cris/page.h lia64-2.4/include/asm-cris/page.h --- linux-2.4.18/include/asm-cris/page.h Tue Feb 13 14:13:44 2001 +++ lia64-2.4/include/asm-cris/page.h Sat Feb 9 14:38:56 2002 @@ -112,6 +112,9 @@ extern unsigned long dram_start, dram_end; +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + #endif /* __KERNEL__ */ #endif /* _CRIS_PAGE_H */ diff -urN linux-2.4.18/include/asm-i386/hw_irq.h lia64-2.4/include/asm-i386/hw_irq.h --- linux-2.4.18/include/asm-i386/hw_irq.h Mon Sep 24 15:08:23 2001 +++ lia64-2.4/include/asm-i386/hw_irq.h Mon May 6 09:16:40 2002 @@ -222,4 +222,6 @@ static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} #endif +extern irq_desc_t irq_desc [NR_IRQS]; + #endif /* _ASM_HW_IRQ_H */ diff -urN linux-2.4.18/include/asm-i386/page.h lia64-2.4/include/asm-i386/page.h --- linux-2.4.18/include/asm-i386/page.h Tue Feb 26 11:05:03 2002 +++ lia64-2.4/include/asm-i386/page.h Mon May 6 09:16:40 2002 @@ -30,8 +30,8 @@ #endif -#define clear_user_page(page, vaddr) clear_page(page) -#define copy_user_page(to, from, vaddr) copy_page(to, from) +#define clear_user_page(page, vaddr, pg) clear_page(page) +#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) /* * These are used to make use of C type-checking.. @@ -131,6 +131,9 @@ #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) #define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT)) #define VALID_PAGE(page) ((page - mem_map) < max_mapnr) + +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) #endif /* __KERNEL__ */ diff -urN linux-2.4.18/include/asm-i386/ptrace.h lia64-2.4/include/asm-i386/ptrace.h --- linux-2.4.18/include/asm-i386/ptrace.h Mon Sep 24 15:08:24 2001 +++ lia64-2.4/include/asm-i386/ptrace.h Wed Nov 28 13:08:17 2001 @@ -58,6 +58,7 @@ #define user_mode(regs) ((VM_MASK & (regs)->eflags) || (3 & (regs)->xcs)) #define instruction_pointer(regs) ((regs)->eip) extern void show_regs(struct pt_regs *); +#define force_successful_syscall_return() #endif #endif diff -urN linux-2.4.18/include/asm-i386/serial.h lia64-2.4/include/asm-i386/serial.h --- linux-2.4.18/include/asm-i386/serial.h Fri Aug 10 18:16:27 2001 +++ lia64-2.4/include/asm-i386/serial.h Mon Jul 8 15:19:36 2002 @@ -57,6 +57,20 @@ { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ +/* + * HCDP_SERIAL_PORT_DEFNS should be placed in exactly the same slot + * in rs_table as defined by HCDP_SERIAL_CONSOLE_PORT in + * include/linux/serial.h + */ +#define HCDP_SERIAL_PORT_DEFNS \ + { 0, BASE_BAUD, -1, 0, STD_COM_FLAGS}, /* ttySx device + in comments sucks. + You add an entry + and you get to edit + boatloads of these + comments. Not worth + it */ + #ifdef CONFIG_SERIAL_MANY_PORTS #define EXTRA_SERIAL_PORT_DEFNS \ @@ -126,6 +140,7 @@ #endif #define SERIAL_PORT_DFNS \ + HCDP_SERIAL_PORT_DEFNS \ STD_SERIAL_PORT_DEFNS \ EXTRA_SERIAL_PORT_DEFNS \ HUB6_SERIAL_PORT_DFNS \ diff -urN linux-2.4.18/include/asm-ia64/a.out.h lia64-2.4/include/asm-ia64/a.out.h --- linux-2.4.18/include/asm-ia64/a.out.h Tue Jul 31 10:30:09 2001 +++ lia64-2.4/include/asm-ia64/a.out.h Fri Jul 19 23:20:15 2002 @@ -7,8 +7,8 @@ * probably would be better to clean up binfmt_elf.c so it does not * necessarily depend on there being a.out support. * - * Copyright (C) 1998-2000 Hewlett-Packard Co - * Copyright (C) 1998-2000 David Mosberger-Tang + * Copyright (C) 1998-2000, 2002 Hewlett-Packard Co + * David Mosberger-Tang */ #include @@ -31,7 +31,7 @@ #ifdef __KERNEL__ # include -# define STACK_TOP (0x8000000000000000UL + (1UL << (4*PAGE_SHIFT - 12)) - PAGE_SIZE) +# define STACK_TOP (0x6000000000000000UL + (1UL << (4*PAGE_SHIFT - 12)) - PAGE_SIZE) # define IA64_RBS_BOT (STACK_TOP - 0x80000000L + PAGE_SIZE) /* bottom of reg. backing store */ #endif diff -urN linux-2.4.18/include/asm-ia64/acpi-ext.h lia64-2.4/include/asm-ia64/acpi-ext.h --- linux-2.4.18/include/asm-ia64/acpi-ext.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/acpi-ext.h Wed Dec 31 16:00:00 1969 @@ -1,205 +0,0 @@ -#ifndef _ASM_IA64_ACPI_EXT_H -#define _ASM_IA64_ACPI_EXT_H - -/* - * Advanced Configuration and Power Infterface - * Based on 'ACPI Specification 1.0b' Febryary 2, 1999 - * and 'IA-64 Extensions to the ACPI Specification' Rev 0.6 - * - * Copyright (C) 1999 VA Linux Systems - * Copyright (C) 1999 Walt Drummond - * Copyright (C) 2000 Intel Corp. - * Copyright (C) 2000,2001 J.I. Lee - * ACPI 2.0 specification - */ - -#include - -#pragma pack(1) -#define ACPI_RSDP_SIG "RSD PTR " /* Trailing space required */ -#define ACPI_RSDP_SIG_LEN 8 -typedef struct { - char signature[8]; - u8 checksum; - char oem_id[6]; - u8 revision; - u32 rsdt; - u32 lenth; - struct acpi_xsdt *xsdt; - u8 ext_checksum; - u8 reserved[3]; -} acpi20_rsdp_t; - -typedef struct { - char signature[4]; - u32 length; - u8 revision; - u8 checksum; - char oem_id[6]; - char oem_table_id[8]; - u32 oem_revision; - u32 creator_id; - u32 creator_revision; -} acpi_desc_table_hdr_t; - -#define ACPI_RSDT_SIG "RSDT" -#define ACPI_RSDT_SIG_LEN 4 -typedef struct { - acpi_desc_table_hdr_t header; - u8 reserved[4]; - u32 entry_ptrs[1]; /* Not really . . . */ -} acpi20_rsdt_t; - -#define ACPI_XSDT_SIG "XSDT" -#define ACPI_XSDT_SIG_LEN 4 -typedef struct acpi_xsdt { - acpi_desc_table_hdr_t header; - unsigned long entry_ptrs[1]; /* Not really . . . */ -} acpi_xsdt_t; - -/* Common structures for ACPI 2.0 and 0.71 */ - -typedef struct acpi_entry_iosapic { - u8 type; - u8 length; - u8 id; - u8 reserved; - u32 irq_base; /* start of IRQ's this IOSAPIC is responsible for. */ - unsigned long address; /* Address of this IOSAPIC */ -} acpi_entry_iosapic_t; - -/* Local SAPIC flags */ -#define LSAPIC_ENABLED (1<<0) -#define LSAPIC_PERFORMANCE_RESTRICTED (1<<1) -#define LSAPIC_PRESENT (1<<2) - -/* Defines legacy IRQ->pin mapping */ -typedef struct { - u8 type; - u8 length; - u8 bus; /* Constant 0 == ISA */ - u8 isa_irq; /* ISA IRQ # */ - u32 pin; /* called vector in spec; really IOSAPIC pin number */ - u16 flags; /* Edge/Level trigger & High/Low active */ -} acpi_entry_int_override_t; - -#define INT_OVERRIDE_ACTIVE_LOW 0x03 -#define INT_OVERRIDE_LEVEL_TRIGGER 0x0d - -/* IA64 ext 0.71 */ - -typedef struct { - char signature[8]; - u8 checksum; - char oem_id[6]; - char reserved; /* Must be 0 */ - struct acpi_rsdt *rsdt; -} acpi_rsdp_t; - -typedef struct { - acpi_desc_table_hdr_t header; - u8 reserved[4]; - unsigned long entry_ptrs[1]; /* Not really . . . */ -} acpi_rsdt_t; - -#define ACPI_SAPIC_SIG "SPIC" -#define ACPI_SAPIC_SIG_LEN 4 -typedef struct { - acpi_desc_table_hdr_t header; - u8 reserved[4]; - unsigned long interrupt_block; -} acpi_sapic_t; - -/* SAPIC structure types */ -#define ACPI_ENTRY_LOCAL_SAPIC 0 -#define ACPI_ENTRY_IO_SAPIC 1 -#define ACPI_ENTRY_INT_SRC_OVERRIDE 2 -#define ACPI_ENTRY_PLATFORM_INT_SOURCE 3 /* Unimplemented */ - -typedef struct acpi_entry_lsapic { - u8 type; - u8 length; - u16 acpi_processor_id; - u16 flags; - u8 id; - u8 eid; -} acpi_entry_lsapic_t; - -typedef struct { - u8 type; - u8 length; - u16 flags; - u8 int_type; - u8 id; - u8 eid; - u8 iosapic_vector; - u8 reserved[4]; - u32 global_vector; -} acpi_entry_platform_src_t; - -/* ACPI 2.0 with 1.3 errata specific structures */ - -#define ACPI_MADT_SIG "APIC" -#define ACPI_MADT_SIG_LEN 4 -typedef struct { - acpi_desc_table_hdr_t header; - u32 lapic_address; - u32 flags; -} acpi_madt_t; - -/* acpi 2.0 MADT flags */ -#define MADT_PCAT_COMPAT (1<<0) - -/* acpi 2.0 MADT structure types */ -#define ACPI20_ENTRY_LOCAL_APIC 0 -#define ACPI20_ENTRY_IO_APIC 1 -#define ACPI20_ENTRY_INT_SRC_OVERRIDE 2 -#define ACPI20_ENTRY_NMI_SOURCE 3 -#define ACPI20_ENTRY_LOCAL_APIC_NMI 4 -#define ACPI20_ENTRY_LOCAL_APIC_ADDR_OVERRIDE 5 -#define ACPI20_ENTRY_IO_SAPIC 6 -#define ACPI20_ENTRY_LOCAL_SAPIC 7 -#define ACPI20_ENTRY_PLATFORM_INT_SOURCE 8 - -typedef struct acpi20_entry_lsapic { - u8 type; - u8 length; - u8 acpi_processor_id; - u8 id; - u8 eid; - u8 reserved[3]; - u32 flags; -} acpi20_entry_lsapic_t; - -typedef struct acpi20_entry_lapic_addr_override { - u8 type; - u8 length; - u8 reserved[2]; - unsigned long lapic_address; -} acpi20_entry_lapic_addr_override_t; - -typedef struct { - u8 type; - u8 length; - u16 flags; - u8 int_type; - u8 id; - u8 eid; - u8 iosapic_vector; - u32 global_vector; -} acpi20_entry_platform_src_t; - -/* constants for interrupt routing API for device drivers */ -#define ACPI20_ENTRY_PIS_PMI 1 -#define ACPI20_ENTRY_PIS_INIT 2 -#define ACPI20_ENTRY_PIS_CPEI 3 -#define ACPI_MAX_PLATFORM_IRQS 4 - -extern int acpi20_parse(acpi20_rsdp_t *); -extern int acpi_parse(acpi_rsdp_t *); -extern const char *acpi_get_sysname (void); -extern int acpi_request_vector(u32 int_type); - -extern void (*acpi_idle) (void); /* power-management idle function, if any */ -#pragma pack() -#endif /* _ASM_IA64_ACPI_EXT_H */ diff -urN linux-2.4.18/include/asm-ia64/acpi.h lia64-2.4/include/asm-ia64/acpi.h --- linux-2.4.18/include/asm-ia64/acpi.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/acpi.h Tue Jun 11 14:24:23 2002 @@ -0,0 +1,113 @@ +/* + * asm-ia64/acpi.h + * + * Copyright (C) 1999 VA Linux Systems + * Copyright (C) 1999 Walt Drummond + * Copyright (C) 2000,2001 J.I. Lee + * Copyright (C) 2001,2002 Paul Diefenbaugh + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#ifndef _ASM_ACPI_H +#define _ASM_ACPI_H + +#ifdef __KERNEL__ + +#define COMPILER_DEPENDENT_INT64 long +#define COMPILER_DEPENDENT_UINT64 unsigned long + +/* + * Calling conventions: + * + * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) + * ACPI_EXTERNAL_XFACE - External ACPI interfaces + * ACPI_INTERNAL_XFACE - Internal ACPI interfaces + * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces + */ +#define ACPI_SYSTEM_XFACE +#define ACPI_EXTERNAL_XFACE +#define ACPI_INTERNAL_XFACE +#define ACPI_INTERNAL_VAR_XFACE + +/* Asm macros */ + +#define ACPI_ASM_MACROS +#define BREAKPOINT3 +#define ACPI_DISABLE_IRQS() __cli() +#define ACPI_ENABLE_IRQS() __sti() +#define ACPI_FLUSH_CPU_CACHE() + +#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ + do { \ + __asm__ volatile ("1: ld4 r29=%1\n" \ + ";;\n" \ + "mov ar.ccv=r29\n" \ + "mov r2=r29\n" \ + "shr.u r30=r29,1\n" \ + "and r29=-4,r29\n" \ + ";;\n" \ + "add r29=2,r29\n" \ + "and r30=1,r30\n" \ + ";;\n" \ + "add r29=r29,r30\n" \ + ";;\n" \ + "cmpxchg4.acq r30=%1,r29,ar.ccv\n" \ + ";;\n" \ + "cmp.eq p6,p7=r2,r30\n" \ + "(p7) br.dpnt.few 1b\n" \ + "cmp.gt p8,p9=3,r29\n" \ + ";;\n" \ + "(p8) mov %0=-1\n" \ + "(p9) mov %0=r0\n" \ + :"=r"(Acq):"m"(GLptr):"r2","r29","r30","memory"); \ + } while (0) + +#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ + do { \ + __asm__ volatile ("1: ld4 r29=%1\n" \ + ";;\n" \ + "mov ar.ccv=r29\n" \ + "mov r2=r29\n" \ + "and r29=-4,r29\n" \ + ";;\n" \ + "cmpxchg4.acq r30=%1,r29,ar.ccv\n" \ + ";;\n" \ + "cmp.eq p6,p7=r2,r30\n" \ + "(p7) br.dpnt.few 1b\n" \ + "and %0=1,r2\n" \ + ";;\n" \ + :"=r"(Acq):"m"(GLptr):"r2","r29","r30","memory"); \ + } while (0) + +const char *acpi_get_sysname (void); +int acpi_boot_init (char *cdline); +int acpi_request_vector (u32 int_type); +int acpi_get_prt (struct pci_vector_struct **vectors, int *count); +int acpi_get_interrupt_model(int *type); + +#ifdef CONFIG_DISCONTIGMEM +#define NODE_ARRAY_INDEX(x) ((x) / 8) /* 8 bits/char */ +#define NODE_ARRAY_OFFSET(x) ((x) % 8) /* 8 bits/char */ +#define MAX_PXM_DOMAINS (256) +#endif /* CONFIG_DISCONTIGMEM */ + +#endif /*__KERNEL__*/ + +#endif /*_ASM_ACPI_H*/ diff -urN linux-2.4.18/include/asm-ia64/acpikcfg.h lia64-2.4/include/asm-ia64/acpikcfg.h --- linux-2.4.18/include/asm-ia64/acpikcfg.h Tue Jul 31 10:30:09 2001 +++ lia64-2.4/include/asm-ia64/acpikcfg.h Wed Dec 31 16:00:00 1969 @@ -1,30 +0,0 @@ -#ifndef _ASM_IA64_ACPIKCFG_H -#define _ASM_IA64_ACPIKCFG_H - -/* - * acpikcfg.h - ACPI based Kernel Configuration Manager External Interfaces - * - * Copyright (C) 2000 Intel Corp. - * Copyright (C) 2000 J.I. Lee - */ - - -u32 __init acpi_cf_init (void * rsdp); -u32 __init acpi_cf_terminate (void ); - -u32 __init -acpi_cf_get_pci_vectors ( - struct pci_vector_struct **vectors, - int *num_pci_vectors - ); - - -#ifdef CONFIG_ACPI_KERNEL_CONFIG_DEBUG -void __init -acpi_cf_print_pci_vectors ( - struct pci_vector_struct *vectors, - int num_pci_vectors - ); -#endif - -#endif /* _ASM_IA64_ACPIKCFG_H */ diff -urN linux-2.4.18/include/asm-ia64/atomic.h lia64-2.4/include/asm-ia64/atomic.h --- linux-2.4.18/include/asm-ia64/atomic.h Mon Jul 9 21:30:19 2001 +++ lia64-2.4/include/asm-ia64/atomic.h Fri Jul 19 23:20:15 2002 @@ -9,8 +9,8 @@ * "int" types were carefully placed so as to ensure proper operation * of the macros. * - * Copyright (C) 1998, 1999 Hewlett-Packard Co - * Copyright (C) 1998, 1999 David Mosberger-Tang + * Copyright (C) 1998, 1999, 2002 Hewlett-Packard Co + * David Mosberger-Tang */ #include diff -urN linux-2.4.18/include/asm-ia64/bitops.h lia64-2.4/include/asm-ia64/bitops.h --- linux-2.4.18/include/asm-ia64/bitops.h Tue Jul 31 10:30:09 2001 +++ lia64-2.4/include/asm-ia64/bitops.h Fri Jul 19 23:20:15 2002 @@ -57,10 +57,10 @@ } /* - * clear_bit() doesn't provide any barrier for the compiler. + * clear_bit() has "acquire" semantics. */ #define smp_mb__before_clear_bit() smp_mb() -#define smp_mb__after_clear_bit() smp_mb() +#define smp_mb__after_clear_bit() do { /* skip */; } while (0) /** * clear_bit - Clears a bit in memory @@ -325,7 +325,7 @@ /* * Find next zero bit in a bitmap reasonably efficiently.. */ -static inline int +static inline unsigned long find_next_zero_bit (void *addr, unsigned long size, unsigned long offset) { unsigned long *p = ((unsigned long *) addr) + (offset >> 6); @@ -357,6 +357,8 @@ tmp = *p; found_first: tmp |= ~0UL << size; + if (tmp == ~0UL) /* any bits zero? */ + return result + size; /* nope */ found_middle: return result + ffz(tmp); } diff -urN linux-2.4.18/include/asm-ia64/cache.h lia64-2.4/include/asm-ia64/cache.h --- linux-2.4.18/include/asm-ia64/cache.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/cache.h Fri Jul 19 23:20:15 2002 @@ -5,7 +5,7 @@ /* * Copyright (C) 1998-2000 Hewlett-Packard Co - * Copyright (C) 1998-2000 David Mosberger-Tang + * David Mosberger-Tang */ /* Bytes per L1 (data) cache line. */ diff -urN linux-2.4.18/include/asm-ia64/checksum.h lia64-2.4/include/asm-ia64/checksum.h --- linux-2.4.18/include/asm-ia64/checksum.h Sun Feb 6 18:42:40 2000 +++ lia64-2.4/include/asm-ia64/checksum.h Fri Feb 8 13:53:58 2002 @@ -89,11 +89,4 @@ return ~sum; } -#define _HAVE_ARCH_IPV6_CSUM -extern unsigned short int csum_ipv6_magic (struct in6_addr *saddr, - struct in6_addr *daddr, - __u16 len, - unsigned short proto, - unsigned int sum); - #endif /* _ASM_IA64_CHECKSUM_H */ diff -urN linux-2.4.18/include/asm-ia64/current.h lia64-2.4/include/asm-ia64/current.h --- linux-2.4.18/include/asm-ia64/current.h Fri Apr 21 15:21:24 2000 +++ lia64-2.4/include/asm-ia64/current.h Thu Mar 7 14:24:32 2002 @@ -3,7 +3,7 @@ /* * Copyright (C) 1998-2000 Hewlett-Packard Co - * Copyright (C) 1998-2000 David Mosberger-Tang + * David Mosberger-Tang */ /* In kernel mode, thread pointer (r13) is used to point to the diff -urN linux-2.4.18/include/asm-ia64/efi.h lia64-2.4/include/asm-ia64/efi.h --- linux-2.4.18/include/asm-ia64/efi.h Tue Jul 31 10:30:09 2001 +++ lia64-2.4/include/asm-ia64/efi.h Fri Jul 19 23:20:27 2002 @@ -7,9 +7,9 @@ * * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond - * Copyright (C) 1999 Hewlett-Packard Co. - * Copyright (C) 1999 David Mosberger-Tang - * Copyright (C) 1999 Stephane Eranian + * Copyright (C) 1999, 2002 Hewlett-Packard Co. + * David Mosberger-Tang + * Stephane Eranian */ #include #include @@ -32,13 +32,18 @@ typedef u8 efi_bool_t; typedef u16 efi_char16_t; /* UNICODE character */ + typedef struct { - u32 data1; - u16 data2; - u16 data3; - u8 data4[8]; + u8 b[16]; } efi_guid_t; +#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ +((efi_guid_t) \ +{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \ + (b) & 0xff, ((b) >> 8) & 0xff, \ + (c) & 0xff, ((c) >> 8) & 0xff, \ + (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }}) + /* * Generic EFI table header */ @@ -82,6 +87,8 @@ #define EFI_MEMORY_RUNTIME 0x8000000000000000 /* range requires runtime mapping */ #define EFI_MEMORY_DESCRIPTOR_VERSION 1 +#define EFI_PAGE_SHIFT 12 + typedef struct { u32 type; u32 pad; @@ -165,21 +172,26 @@ /* * EFI Configuration Table and GUID definitions */ +#define NULL_GUID \ + EFI_GUID( 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ) #define MPS_TABLE_GUID \ - ((efi_guid_t) { 0xeb9d2d2f, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }}) + EFI_GUID( 0xeb9d2d2f, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d ) #define ACPI_TABLE_GUID \ - ((efi_guid_t) { 0xeb9d2d30, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }}) + EFI_GUID( 0xeb9d2d30, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d ) #define ACPI_20_TABLE_GUID \ - ((efi_guid_t) { 0x8868e871, 0xe4f1, 0x11d3, { 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }}) + EFI_GUID( 0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 ) #define SMBIOS_TABLE_GUID \ - ((efi_guid_t) { 0xeb9d2d31, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }}) + EFI_GUID( 0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d ) #define SAL_SYSTEM_TABLE_GUID \ - ((efi_guid_t) { 0xeb9d2d32, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }}) + EFI_GUID( 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d ) + +#define HCDP_TABLE_GUID \ + EFI_GUID( 0xf951938d, 0x620b, 0x42ef, 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 ) typedef struct { efi_guid_t guid; @@ -215,6 +227,7 @@ void *acpi20; /* ACPI table (ACPI 2.0) */ void *smbios; /* SM BIOS table */ void *sal_systab; /* SAL system table */ + void *hcdp; /* HCDP table */ void *boot_info; /* boot info table */ efi_get_time_t *get_time; efi_set_time_t *set_time; @@ -233,12 +246,25 @@ return memcmp(&left, &right, sizeof (efi_guid_t)); } +static inline char * +efi_guid_unparse(efi_guid_t *guid, char *out) +{ + sprintf(out, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + guid->b[3], guid->b[2], guid->b[1], guid->b[0], + guid->b[5], guid->b[4], guid->b[7], guid->b[6], + guid->b[8], guid->b[9], guid->b[10], guid->b[11], + guid->b[12], guid->b[13], guid->b[14], guid->b[15]); + return out; +} + extern void efi_init (void); extern void efi_map_pal_code (void); extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); extern void efi_gettimeofday (struct timeval *tv); extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */ -extern u64 efi_get_iobase (void); +extern u64 efi_get_iobase (void); +extern u32 efi_mem_type (unsigned long phys_addr); +extern u64 efi_mem_attributes (unsigned long phys_addr); /* * Variable Attributes diff -urN linux-2.4.18/include/asm-ia64/elf.h lia64-2.4/include/asm-ia64/elf.h --- linux-2.4.18/include/asm-ia64/elf.h Tue Jul 11 15:43:45 2000 +++ lia64-2.4/include/asm-ia64/elf.h Fri Jul 19 23:20:15 2002 @@ -4,8 +4,8 @@ /* * ELF archtecture specific definitions. * - * Copyright (C) 1998, 1999 Hewlett-Packard Co - * Copyright (C) 1998, 1999 David Mosberger-Tang + * Copyright (C) 1998, 1999, 2002 Hewlett-Packard Co + * David Mosberger-Tang */ #include @@ -25,6 +25,10 @@ #define USE_ELF_CORE_DUMP +/* Least-significant four bits of ELF header's e_flags are OS-specific. The bits are + interpreted as follows by Linux: */ +#define EF_IA_64_LINUX_EXECUTABLE_STACK 0x1 /* is stack (& heap) executable by default? */ + /* always align to 64KB to allow for future page sizes of up to 64KB: */ #define ELF_EXEC_PAGESIZE PAGE_SIZE @@ -35,7 +39,7 @@ * the way of the program that it will "exec", and that there is * sufficient room for the brk. */ -#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000) +#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x800000000) /* @@ -82,7 +86,9 @@ #define ELF_PLATFORM 0 #ifdef __KERNEL__ -#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) +struct elf64_hdr; +extern void ia64_set_personality (struct elf64_hdr *elf_ex, int ibcs2_interpreter); +#define SET_PERSONALITY(ex, ibcs2) ia64_set_personality(&(ex), ibcs2) #endif #endif /* _ASM_IA64_ELF_H */ diff -urN linux-2.4.18/include/asm-ia64/hardirq.h lia64-2.4/include/asm-ia64/hardirq.h --- linux-2.4.18/include/asm-ia64/hardirq.h Tue Jul 31 10:30:09 2001 +++ lia64-2.4/include/asm-ia64/hardirq.h Fri Jul 19 23:20:16 2002 @@ -25,8 +25,8 @@ #define local_softirq_pending() (local_cpu_data->softirq_pending) #define local_ksoftirqd_task() (local_cpu_data->ksoftirqd) -#define local_irq_count() (local_cpu_data->irq_stat.f.irq_count) -#define local_bh_count() (local_cpu_data->irq_stat.f.bh_count) +#define really_local_irq_count() (local_cpu_data->irq_stat.f.irq_count) /* XXX fix me */ +#define really_local_bh_count() (local_cpu_data->irq_stat.f.bh_count) /* XXX fix me */ #define local_syscall_count() /* unused on IA-64 */ #define local_nmi_count() 0 @@ -38,11 +38,11 @@ #define in_irq() (local_cpu_data->irq_stat.f.irq_count != 0) #ifndef CONFIG_SMP -# define local_hardirq_trylock() (local_irq_count() == 0) +# define local_hardirq_trylock() (really_local_irq_count() == 0) # define local_hardirq_endlock() do { } while (0) -# define local_irq_enter(irq) (local_irq_count()++) -# define local_irq_exit(irq) (local_irq_count()--) +# define local_irq_enter(irq) (really_local_irq_count()++) +# define local_irq_exit(irq) (really_local_irq_count()--) # define synchronize_irq() barrier() #else @@ -70,6 +70,7 @@ /* if we didn't own the irq lock, just ignore.. */ if (global_irq_holder == cpu) { global_irq_holder = NO_PROC_ID; + smp_mb__before_clear_bit(); /* need barrier before releasing lock... */ clear_bit(0,&global_irq_lock); } } @@ -77,7 +78,7 @@ static inline void local_irq_enter (int irq) { - local_irq_count()++; + really_local_irq_count()++; while (test_bit(0,&global_irq_lock)) { /* nothing */; @@ -87,13 +88,13 @@ static inline void local_irq_exit (int irq) { - local_irq_count()--; + really_local_irq_count()--; } static inline int local_hardirq_trylock (void) { - return !local_irq_count() && !test_bit(0,&global_irq_lock); + return !really_local_irq_count() && !test_bit(0,&global_irq_lock); } #define local_hardirq_endlock() do { } while (0) diff -urN linux-2.4.18/include/asm-ia64/hw_irq.h lia64-2.4/include/asm-ia64/hw_irq.h --- linux-2.4.18/include/asm-ia64/hw_irq.h Tue Jul 31 10:30:09 2001 +++ lia64-2.4/include/asm-ia64/hw_irq.h Fri Jul 19 23:20:15 2002 @@ -2,8 +2,8 @@ #define _ASM_IA64_HW_IRQ_H /* - * Copyright (C) 2001 Hewlett-Packard Co - * Copyright (C) 2001 David Mosberger-Tang + * Copyright (C) 2001, 2002 Hewlett-Packard Co + * David Mosberger-Tang */ #include @@ -67,6 +67,8 @@ extern __u8 isa_irq_to_vector_map[16]; #define isa_irq_to_vector(x) isa_irq_to_vector_map[(x)] +extern __u8 gsi_to_vector_map[255]; +#define gsi_to_vector(x) gsi_to_vector_map[(x)] extern unsigned long ipi_base_addr; @@ -88,6 +90,7 @@ extern struct irq_desc _irq_desc[NR_IRQS]; +#ifndef CONFIG_IA64_GENERIC static inline struct irq_desc * __ia64_irq_desc (unsigned int irq) { @@ -105,6 +108,7 @@ { return (unsigned int) vec; } +#endif /* * Next follows the irq descriptor interface. On IA-64, each CPU supports 256 interrupt diff -urN linux-2.4.18/include/asm-ia64/io.h lia64-2.4/include/asm-ia64/io.h --- linux-2.4.18/include/asm-ia64/io.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/io.h Fri Jul 19 23:20:15 2002 @@ -408,5 +408,11 @@ #define memset_io(addr,c,len) \ __ia64_memset_c_io((unsigned long)(addr),0x0101010101010101UL*(u8)(c),(len)) + +#define dma_cache_inv(_start,_size) do { } while (0) +#define dma_cache_wback(_start,_size) do { } while (0) +#define dma_cache_wback_inv(_start,_size) do { } while (0) + # endif /* __KERNEL__ */ + #endif /* _ASM_IA64_IO_H */ diff -urN linux-2.4.18/include/asm-ia64/irq.h lia64-2.4/include/asm-ia64/irq.h --- linux-2.4.18/include/asm-ia64/irq.h Fri Mar 10 15:24:02 2000 +++ lia64-2.4/include/asm-ia64/irq.h Mon Feb 11 16:21:32 2002 @@ -2,9 +2,9 @@ #define _ASM_IA64_IRQ_H /* - * Copyright (C) 1999-2000 Hewlett-Packard Co - * Copyright (C) 1998-2000 David Mosberger-Tang - * Copyright (C) 1998 Stephane Eranian + * Copyright (C) 1999-2000, 2002 Hewlett-Packard Co + * David Mosberger-Tang + * Stephane Eranian * * 11/24/98 S.Eranian updated TIMER_IRQ and irq_cannonicalize * 01/20/99 S.Eranian added keyboard interrupt @@ -27,5 +27,6 @@ extern void disable_irq (unsigned int); extern void disable_irq_nosync (unsigned int); extern void enable_irq (unsigned int); +extern void set_irq_affinity_info (int irq, int dest, int redir); #endif /* _ASM_IA64_IRQ_H */ diff -urN linux-2.4.18/include/asm-ia64/kregs.h lia64-2.4/include/asm-ia64/kregs.h --- linux-2.4.18/include/asm-ia64/kregs.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/kregs.h Thu Jun 20 18:48:15 2002 @@ -2,8 +2,8 @@ #define _ASM_IA64_KREGS_H /* - * Copyright (C) 2001 Hewlett-Packard Co - * Copyright (C) 2001 David Mosberger-Tang + * Copyright (C) 2001-2002 Hewlett-Packard Co + * David Mosberger-Tang */ /* * This file defines the kernel register usage convention used by Linux/ia64. @@ -31,4 +31,132 @@ #define IA64_TR_PERCPU_DATA 1 /* dtr1: percpu data */ #define IA64_TR_CURRENT_STACK 2 /* dtr2: maps kernel's memory- & register-stacks */ -#endif /* _ASM_IA64_kREGS_H */ +/* Processor status register bits: */ +#define IA64_PSR_BE_BIT 1 +#define IA64_PSR_UP_BIT 2 +#define IA64_PSR_AC_BIT 3 +#define IA64_PSR_MFL_BIT 4 +#define IA64_PSR_MFH_BIT 5 +#define IA64_PSR_IC_BIT 13 +#define IA64_PSR_I_BIT 14 +#define IA64_PSR_PK_BIT 15 +#define IA64_PSR_DT_BIT 17 +#define IA64_PSR_DFL_BIT 18 +#define IA64_PSR_DFH_BIT 19 +#define IA64_PSR_SP_BIT 20 +#define IA64_PSR_PP_BIT 21 +#define IA64_PSR_DI_BIT 22 +#define IA64_PSR_SI_BIT 23 +#define IA64_PSR_DB_BIT 24 +#define IA64_PSR_LP_BIT 25 +#define IA64_PSR_TB_BIT 26 +#define IA64_PSR_RT_BIT 27 +/* The following are not affected by save_flags()/restore_flags(): */ +#define IA64_PSR_CPL0_BIT 32 +#define IA64_PSR_CPL1_BIT 33 +#define IA64_PSR_IS_BIT 34 +#define IA64_PSR_MC_BIT 35 +#define IA64_PSR_IT_BIT 36 +#define IA64_PSR_ID_BIT 37 +#define IA64_PSR_DA_BIT 38 +#define IA64_PSR_DD_BIT 39 +#define IA64_PSR_SS_BIT 40 +#define IA64_PSR_RI_BIT 41 +#define IA64_PSR_ED_BIT 43 +#define IA64_PSR_BN_BIT 44 +#define IA64_PSR_IA_BIT 45 + +#define IA64_PSR_BE (__IA64_UL(1) << IA64_PSR_BE_BIT) +#define IA64_PSR_UP (__IA64_UL(1) << IA64_PSR_UP_BIT) +#define IA64_PSR_AC (__IA64_UL(1) << IA64_PSR_AC_BIT) +#define IA64_PSR_MFL (__IA64_UL(1) << IA64_PSR_MFL_BIT) +#define IA64_PSR_MFH (__IA64_UL(1) << IA64_PSR_MFH_BIT) +#define IA64_PSR_IC (__IA64_UL(1) << IA64_PSR_IC_BIT) +#define IA64_PSR_I (__IA64_UL(1) << IA64_PSR_I_BIT) +#define IA64_PSR_PK (__IA64_UL(1) << IA64_PSR_PK_BIT) +#define IA64_PSR_DT (__IA64_UL(1) << IA64_PSR_DT_BIT) +#define IA64_PSR_DFL (__IA64_UL(1) << IA64_PSR_DFL_BIT) +#define IA64_PSR_DFH (__IA64_UL(1) << IA64_PSR_DFH_BIT) +#define IA64_PSR_SP (__IA64_UL(1) << IA64_PSR_SP_BIT) +#define IA64_PSR_PP (__IA64_UL(1) << IA64_PSR_PP_BIT) +#define IA64_PSR_DI (__IA64_UL(1) << IA64_PSR_DI_BIT) +#define IA64_PSR_SI (__IA64_UL(1) << IA64_PSR_SI_BIT) +#define IA64_PSR_DB (__IA64_UL(1) << IA64_PSR_DB_BIT) +#define IA64_PSR_LP (__IA64_UL(1) << IA64_PSR_LP_BIT) +#define IA64_PSR_TB (__IA64_UL(1) << IA64_PSR_TB_BIT) +#define IA64_PSR_RT (__IA64_UL(1) << IA64_PSR_RT_BIT) +/* The following are not affected by save_flags()/restore_flags(): */ +#define IA64_PSR_CPL (__IA64_UL(3) << IA64_PSR_CPL0_BIT) +#define IA64_PSR_IS (__IA64_UL(1) << IA64_PSR_IS_BIT) +#define IA64_PSR_MC (__IA64_UL(1) << IA64_PSR_MC_BIT) +#define IA64_PSR_IT (__IA64_UL(1) << IA64_PSR_IT_BIT) +#define IA64_PSR_ID (__IA64_UL(1) << IA64_PSR_ID_BIT) +#define IA64_PSR_DA (__IA64_UL(1) << IA64_PSR_DA_BIT) +#define IA64_PSR_DD (__IA64_UL(1) << IA64_PSR_DD_BIT) +#define IA64_PSR_SS (__IA64_UL(1) << IA64_PSR_SS_BIT) +#define IA64_PSR_RI (__IA64_UL(3) << IA64_PSR_RI_BIT) +#define IA64_PSR_ED (__IA64_UL(1) << IA64_PSR_ED_BIT) +#define IA64_PSR_BN (__IA64_UL(1) << IA64_PSR_BN_BIT) +#define IA64_PSR_IA (__IA64_UL(1) << IA64_PSR_IA_BIT) + +/* A mask of PSR bits that we generally don't want to inherit across a clone2() or an + execve(). Only list flags here that need to be cleared/set for BOTH clone2() and + execve(). */ +#define IA64_PSR_BITS_TO_CLEAR (IA64_PSR_MFL | IA64_PSR_MFH | IA64_PSR_DB | IA64_PSR_LP | \ + IA64_PSR_TB | IA64_PSR_ID | IA64_PSR_DA | IA64_PSR_DD | \ + IA64_PSR_SS | IA64_PSR_ED | IA64_PSR_IA) +#define IA64_PSR_BITS_TO_SET (IA64_PSR_DFH) + +/* User mask bits: */ +#define IA64_PSR_UM (IA64_PSR_BE | IA64_PSR_UP | IA64_PSR_AC | IA64_PSR_MFL | IA64_PSR_MFH) + +/* Default Control Register */ +#define IA64_DCR_PP_BIT 0 /* privileged performance monitor default */ +#define IA64_DCR_BE_BIT 1 /* big-endian default */ +#define IA64_DCR_LC_BIT 2 /* ia32 lock-check enable */ +#define IA64_DCR_DM_BIT 8 /* defer TLB miss faults */ +#define IA64_DCR_DP_BIT 9 /* defer page-not-present faults */ +#define IA64_DCR_DK_BIT 10 /* defer key miss faults */ +#define IA64_DCR_DX_BIT 11 /* defer key permission faults */ +#define IA64_DCR_DR_BIT 12 /* defer access right faults */ +#define IA64_DCR_DA_BIT 13 /* defer access bit faults */ +#define IA64_DCR_DD_BIT 14 /* defer debug faults */ + +#define IA64_DCR_PP (__IA64_UL(1) << IA64_DCR_PP_BIT) +#define IA64_DCR_BE (__IA64_UL(1) << IA64_DCR_BE_BIT) +#define IA64_DCR_LC (__IA64_UL(1) << IA64_DCR_LC_BIT) +#define IA64_DCR_DM (__IA64_UL(1) << IA64_DCR_DM_BIT) +#define IA64_DCR_DP (__IA64_UL(1) << IA64_DCR_DP_BIT) +#define IA64_DCR_DK (__IA64_UL(1) << IA64_DCR_DK_BIT) +#define IA64_DCR_DX (__IA64_UL(1) << IA64_DCR_DX_BIT) +#define IA64_DCR_DR (__IA64_UL(1) << IA64_DCR_DR_BIT) +#define IA64_DCR_DA (__IA64_UL(1) << IA64_DCR_DA_BIT) +#define IA64_DCR_DD (__IA64_UL(1) << IA64_DCR_DD_BIT) + +/* Interrupt Status Register */ +#define IA64_ISR_X_BIT 32 /* execute access */ +#define IA64_ISR_W_BIT 33 /* write access */ +#define IA64_ISR_R_BIT 34 /* read access */ +#define IA64_ISR_NA_BIT 35 /* non-access */ +#define IA64_ISR_SP_BIT 36 /* speculative load exception */ +#define IA64_ISR_RS_BIT 37 /* mandatory register-stack exception */ +#define IA64_ISR_IR_BIT 38 /* invalid register frame exception */ +#define IA64_ISR_CODE_MASK 0xf + +#define IA64_ISR_X (__IA64_UL(1) << IA64_ISR_X_BIT) +#define IA64_ISR_W (__IA64_UL(1) << IA64_ISR_W_BIT) +#define IA64_ISR_R (__IA64_UL(1) << IA64_ISR_R_BIT) +#define IA64_ISR_NA (__IA64_UL(1) << IA64_ISR_NA_BIT) +#define IA64_ISR_SP (__IA64_UL(1) << IA64_ISR_SP_BIT) +#define IA64_ISR_RS (__IA64_UL(1) << IA64_ISR_RS_BIT) +#define IA64_ISR_IR (__IA64_UL(1) << IA64_ISR_IR_BIT) + +/* ISR code field for non-access instructions */ +#define IA64_ISR_CODE_TPA 0 +#define IA64_ISR_CODE_FC 1 +#define IA64_ISR_CODE_PROBE 2 +#define IA64_ISR_CODE_TAK 3 +#define IA64_ISR_CODE_LFETCH 4 +#define IA64_ISR_CODE_PROBEF 5 + +#endif /* _ASM_IA64_KREGS_H */ diff -urN linux-2.4.18/include/asm-ia64/machvec.h lia64-2.4/include/asm-ia64/machvec.h --- linux-2.4.18/include/asm-ia64/machvec.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/machvec.h Fri Jul 19 23:20:15 2002 @@ -18,8 +18,10 @@ struct pt_regs; struct scatterlist; struct irq_desc; +struct page; typedef void ia64_mv_setup_t (char **); +typedef void ia64_mv_cpu_init_t(void); typedef void ia64_mv_irq_init_t (void); typedef void ia64_mv_pci_fixup_t (int); typedef unsigned long ia64_mv_map_nr_t (unsigned long); @@ -44,6 +46,8 @@ typedef void ia64_mv_pci_dma_sync_single (struct pci_dev *, dma_addr_t, size_t, int); typedef void ia64_mv_pci_dma_sync_sg (struct pci_dev *, struct scatterlist *, int, int); typedef unsigned long ia64_mv_pci_dma_address (struct scatterlist *); +typedef int ia64_mv_pci_dma_supported (struct pci_dev *, u64); + /* * WARNING: The legacy I/O space is _architected_. Platforms are * expected to follow this architected model (see Section 10.7 in the @@ -66,6 +70,8 @@ # include # elif defined (CONFIG_IA64_DIG) # include +# elif defined (CONFIG_IA64_HP_ZX1) +# include # elif defined (CONFIG_IA64_SGI_SN1) # include # elif defined (CONFIG_IA64_SGI_SN2) @@ -77,6 +83,7 @@ # else # define platform_name ia64_mv.name # define platform_setup ia64_mv.setup +# define platform_cpu_init ia64_mv.cpu_init # define platform_irq_init ia64_mv.irq_init # define platform_map_nr ia64_mv.map_nr # define platform_mca_init ia64_mv.mca_init @@ -96,6 +103,7 @@ # define platform_pci_dma_sync_single ia64_mv.sync_single # define platform_pci_dma_sync_sg ia64_mv.sync_sg # define platform_pci_dma_address ia64_mv.dma_address +# define platform_pci_dma_supported ia64_mv.dma_supported # define platform_irq_desc ia64_mv.irq_desc # define platform_irq_to_vector ia64_mv.irq_to_vector # define platform_local_vector_to_irq ia64_mv.local_vector_to_irq @@ -110,6 +118,7 @@ struct ia64_machine_vector { const char *name; ia64_mv_setup_t *setup; + ia64_mv_cpu_init_t *cpu_init; ia64_mv_irq_init_t *irq_init; ia64_mv_pci_fixup_t *pci_fixup; ia64_mv_map_nr_t *map_nr; @@ -118,6 +127,7 @@ ia64_mv_cmci_handler_t *cmci_handler; ia64_mv_log_print_t *log_print; ia64_mv_send_ipi_t *send_ipi; + ia64_mv_global_tlb_purge_t *global_tlb_purge; ia64_mv_pci_dma_init *dma_init; ia64_mv_pci_alloc_consistent *alloc_consistent; ia64_mv_pci_free_consistent *free_consistent; @@ -128,6 +138,7 @@ ia64_mv_pci_dma_sync_single *sync_single; ia64_mv_pci_dma_sync_sg *sync_sg; ia64_mv_pci_dma_address *dma_address; + ia64_mv_pci_dma_supported *dma_supported; ia64_mv_irq_desc *irq_desc; ia64_mv_irq_to_vector *irq_to_vector; ia64_mv_local_vector_to_irq *local_vector_to_irq; @@ -143,6 +154,7 @@ { \ #name, \ platform_setup, \ + platform_cpu_init, \ platform_irq_init, \ platform_pci_fixup, \ platform_map_nr, \ @@ -162,6 +174,7 @@ platform_pci_dma_sync_single, \ platform_pci_dma_sync_sg, \ platform_pci_dma_address, \ + platform_pci_dma_supported, \ platform_irq_desc, \ platform_irq_to_vector, \ platform_local_vector_to_irq, \ @@ -193,6 +206,7 @@ extern ia64_mv_pci_dma_sync_single swiotlb_sync_single; extern ia64_mv_pci_dma_sync_sg swiotlb_sync_sg; extern ia64_mv_pci_dma_address swiotlb_dma_address; +extern ia64_mv_pci_dma_supported swiotlb_pci_dma_supported; /* * Define default versions so we can extend machvec for new platforms without having @@ -201,6 +215,9 @@ #ifndef platform_setup # define platform_setup ((ia64_mv_setup_t *) machvec_noop) #endif +#ifndef platform_cpu_init +# define platform_cpu_init ((ia64_mv_cpu_init_t *) machvec_noop) +#endif #ifndef platform_irq_init # define platform_irq_init ((ia64_mv_irq_init_t *) machvec_noop) #endif @@ -254,6 +271,9 @@ #endif #ifndef platform_pci_dma_address # define platform_pci_dma_address swiotlb_dma_address +#endif +#ifndef platform_pci_dma_supported +# define platform_pci_dma_supported swiotlb_pci_dma_supported #endif #ifndef platform_irq_desc # define platform_irq_desc __ia64_irq_desc diff -urN linux-2.4.18/include/asm-ia64/machvec_hpzx1.h lia64-2.4/include/asm-ia64/machvec_hpzx1.h --- linux-2.4.18/include/asm-ia64/machvec_hpzx1.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/machvec_hpzx1.h Fri Apr 26 17:18:08 2002 @@ -0,0 +1,39 @@ +#ifndef _ASM_IA64_MACHVEC_HPZX1_h +#define _ASM_IA64_MACHVEC_HPZX1_h + +extern ia64_mv_setup_t dig_setup; +extern ia64_mv_pci_fixup_t hpzx1_pci_fixup; +extern ia64_mv_map_nr_t map_nr_dense; +extern ia64_mv_pci_alloc_consistent sba_alloc_consistent; +extern ia64_mv_pci_free_consistent sba_free_consistent; +extern ia64_mv_pci_map_single sba_map_single; +extern ia64_mv_pci_unmap_single sba_unmap_single; +extern ia64_mv_pci_map_sg sba_map_sg; +extern ia64_mv_pci_unmap_sg sba_unmap_sg; +extern ia64_mv_pci_dma_address sba_dma_address; +extern ia64_mv_pci_dma_supported sba_dma_supported; + +/* + * This stuff has dual use! + * + * For a generic kernel, the macros are used to initialize the + * platform's machvec structure. When compiling a non-generic kernel, + * the macros are used directly. + */ +#define platform_name "hpzx1" +#define platform_setup dig_setup +#define platform_pci_fixup hpzx1_pci_fixup +#define platform_map_nr map_nr_dense +#define platform_pci_dma_init ((ia64_mv_pci_dma_init *) machvec_noop) +#define platform_pci_alloc_consistent sba_alloc_consistent +#define platform_pci_free_consistent sba_free_consistent +#define platform_pci_map_single sba_map_single +#define platform_pci_unmap_single sba_unmap_single +#define platform_pci_map_sg sba_map_sg +#define platform_pci_unmap_sg sba_unmap_sg +#define platform_pci_dma_sync_single ((ia64_mv_pci_dma_sync_single *) machvec_noop) +#define platform_pci_dma_sync_sg ((ia64_mv_pci_dma_sync_sg *) machvec_noop) +#define platform_pci_dma_address sba_dma_address +#define platform_pci_dma_supported sba_dma_supported + +#endif /* _ASM_IA64_MACHVEC_HPZX1_h */ diff -urN linux-2.4.18/include/asm-ia64/machvec_init.h lia64-2.4/include/asm-ia64/machvec_init.h --- linux-2.4.18/include/asm-ia64/machvec_init.h Thu Jan 4 12:50:17 2001 +++ lia64-2.4/include/asm-ia64/machvec_init.h Fri Apr 5 16:44:44 2002 @@ -5,6 +5,11 @@ #include extern ia64_mv_send_ipi_t ia64_send_ipi; +extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge; +extern ia64_mv_irq_desc __ia64_irq_desc; +extern ia64_mv_irq_to_vector __ia64_irq_to_vector; +extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq; + extern ia64_mv_inb_t __ia64_inb; extern ia64_mv_inw_t __ia64_inw; extern ia64_mv_inl_t __ia64_inl; diff -urN linux-2.4.18/include/asm-ia64/machvec_sn1.h lia64-2.4/include/asm-ia64/machvec_sn1.h --- linux-2.4.18/include/asm-ia64/machvec_sn1.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/machvec_sn1.h Fri Apr 26 17:15:30 2002 @@ -1,27 +1,65 @@ +/* + * Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/NoticeExplan + */ + #ifndef _ASM_IA64_MACHVEC_SN1_h #define _ASM_IA64_MACHVEC_SN1_h -extern ia64_mv_setup_t sn1_setup; -extern ia64_mv_irq_init_t sn1_irq_init; +extern ia64_mv_setup_t sn_setup; +extern ia64_mv_cpu_init_t sn_cpu_init; +extern ia64_mv_irq_init_t sn_irq_init; extern ia64_mv_map_nr_t sn1_map_nr; extern ia64_mv_send_ipi_t sn1_send_IPI; extern ia64_mv_global_tlb_purge_t sn1_global_tlb_purge; -extern ia64_mv_pci_fixup_t sn1_pci_fixup; -extern ia64_mv_inb_t sn1_inb; -extern ia64_mv_inw_t sn1_inw; -extern ia64_mv_inl_t sn1_inl; -extern ia64_mv_outb_t sn1_outb; -extern ia64_mv_outw_t sn1_outw; -extern ia64_mv_outl_t sn1_outl; -extern ia64_mv_pci_alloc_consistent sn1_pci_alloc_consistent; -extern ia64_mv_pci_free_consistent sn1_pci_free_consistent; -extern ia64_mv_pci_map_single sn1_pci_map_single; -extern ia64_mv_pci_unmap_single sn1_pci_unmap_single; -extern ia64_mv_pci_map_sg sn1_pci_map_sg; -extern ia64_mv_pci_unmap_sg sn1_pci_unmap_sg; -extern ia64_mv_pci_dma_sync_single sn1_pci_dma_sync_single; -extern ia64_mv_pci_dma_sync_sg sn1_pci_dma_sync_sg; -extern ia64_mv_pci_dma_address sn1_dma_address; +extern ia64_mv_irq_desc sn_irq_desc; +extern ia64_mv_irq_to_vector sn_irq_to_vector; +extern ia64_mv_local_vector_to_irq sn_local_vector_to_irq; +extern ia64_mv_valid_irq sn_valid_irq; +extern ia64_mv_pci_fixup_t sn_pci_fixup; +extern ia64_mv_inb_t sn_inb; +extern ia64_mv_inw_t sn_inw; +extern ia64_mv_inl_t sn_inl; +extern ia64_mv_outb_t sn_outb; +extern ia64_mv_outw_t sn_outw; +extern ia64_mv_outl_t sn_outl; +extern ia64_mv_pci_alloc_consistent sn_pci_alloc_consistent; +extern ia64_mv_pci_free_consistent sn_pci_free_consistent; +extern ia64_mv_pci_map_single sn_pci_map_single; +extern ia64_mv_pci_unmap_single sn_pci_unmap_single; +extern ia64_mv_pci_map_sg sn_pci_map_sg; +extern ia64_mv_pci_unmap_sg sn_pci_unmap_sg; +extern ia64_mv_pci_dma_sync_single sn_pci_dma_sync_single; +extern ia64_mv_pci_dma_sync_sg sn_pci_dma_sync_sg; +extern ia64_mv_pci_dma_address sn_dma_address; +extern ia64_mv_pci_dma_supported sn_pci_dma_supported; /* * This stuff has dual use! @@ -30,28 +68,34 @@ * platform's machvec structure. When compiling a non-generic kernel, * the macros are used directly. */ -#define platform_name "sn1" -#define platform_setup sn1_setup -#define platform_irq_init sn1_irq_init -#define platform_map_nr sn1_map_nr -#define platform_send_ipi sn1_send_IPI +#define platform_name "sn1" +#define platform_setup sn_setup +#define platform_cpu_init sn_cpu_init +#define platform_irq_init sn_irq_init +#define platform_map_nr sn_map_nr +#define platform_send_ipi sn1_send_IPI #define platform_global_tlb_purge sn1_global_tlb_purge -#define platform_pci_fixup sn1_pci_fixup -#define platform_inb sn1_inb -#define platform_inw sn1_inw -#define platform_inl sn1_inl -#define platform_outb sn1_outb -#define platform_outw sn1_outw -#define platform_outl sn1_outl -#define platform_pci_dma_init machvec_noop -#define platform_pci_alloc_consistent sn1_pci_alloc_consistent -#define platform_pci_free_consistent sn1_pci_free_consistent -#define platform_pci_map_single sn1_pci_map_single -#define platform_pci_unmap_single sn1_pci_unmap_single -#define platform_pci_map_sg sn1_pci_map_sg -#define platform_pci_unmap_sg sn1_pci_unmap_sg -#define platform_pci_dma_sync_single sn1_pci_dma_sync_single -#define platform_pci_dma_sync_sg sn1_pci_dma_sync_sg -#define platform_pci_dma_address sn1_dma_address +#define platform_pci_fixup sn_pci_fixup +#define platform_inb sn_inb +#define platform_inw sn_inw +#define platform_inl sn_inl +#define platform_outb sn_outb +#define platform_outw sn_outw +#define platform_oul sn_outl +#define platform_irq_desc sn_irq_desc +#define platform_irq_to_vector sn_irq_to_vector +#define platform_local_vector_to_irq sn_local_vector_to_irq +#define platform_valid_irq sn_valid_irq +#define platform_pci_dma_init machvec_noop +#define platform_pci_alloc_consistent sn_pci_alloc_consistent +#define platform_pci_free_consistent sn_pci_free_consistent +#define platform_pci_map_single sn_pci_map_single +#define platform_pci_unmap_single sn_pci_unmap_single +#define platform_pci_map_sg sn_pci_map_sg +#define platform_pci_unmap_sg sn_pci_unmap_sg +#define platform_pci_dma_sync_single sn_pci_dma_sync_single +#define platform_pci_dma_sync_sg sn_pci_dma_sync_sg +#define platform_pci_dma_address sn_dma_address +#define platform_pci_dma_supported sn_pci_dma_supported #endif /* _ASM_IA64_MACHVEC_SN1_h */ diff -urN linux-2.4.18/include/asm-ia64/machvec_sn2.h lia64-2.4/include/asm-ia64/machvec_sn2.h --- linux-2.4.18/include/asm-ia64/machvec_sn2.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/machvec_sn2.h Fri Apr 26 17:15:30 2002 @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/NoticeExplan + */ + +#ifndef _ASM_IA64_MACHVEC_SN2_H +#define _ASM_IA64_MACHVEC_SN2_H + +extern ia64_mv_setup_t sn_setup; +extern ia64_mv_cpu_init_t sn_cpu_init; +extern ia64_mv_irq_init_t sn_irq_init; +extern ia64_mv_map_nr_t sn2_map_nr; +extern ia64_mv_send_ipi_t sn2_send_IPI; +extern ia64_mv_global_tlb_purge_t sn2_global_tlb_purge; +extern ia64_mv_irq_desc sn_irq_desc; +extern ia64_mv_irq_to_vector sn_irq_to_vector; +extern ia64_mv_local_vector_to_irq sn_local_vector_to_irq; +extern ia64_mv_valid_irq sn_valid_irq; +extern ia64_mv_pci_fixup_t sn_pci_fixup; +extern ia64_mv_inb_t sn_inb; +extern ia64_mv_inw_t sn_inw; +extern ia64_mv_inl_t sn_inl; +extern ia64_mv_outb_t sn_outb; +extern ia64_mv_outw_t sn_outw; +extern ia64_mv_outl_t sn_outl; +extern ia64_mv_pci_alloc_consistent sn_pci_alloc_consistent; +extern ia64_mv_pci_free_consistent sn_pci_free_consistent; +extern ia64_mv_pci_map_single sn_pci_map_single; +extern ia64_mv_pci_unmap_single sn_pci_unmap_single; +extern ia64_mv_pci_map_sg sn_pci_map_sg; +extern ia64_mv_pci_unmap_sg sn_pci_unmap_sg; +extern ia64_mv_pci_dma_sync_single sn_pci_dma_sync_single; +extern ia64_mv_pci_dma_sync_sg sn_pci_dma_sync_sg; +extern ia64_mv_pci_dma_address sn_dma_address; +extern ia64_mv_pci_dma_supported sn_pci_dma_supported; + +/* + * This stuff has dual use! + * + * For a generic kernel, the macros are used to initialize the + * platform's machvec structure. When compiling a non-generic kernel, + * the macros are used directly. + */ +#define platform_name "sn2" +#define platform_setup sn_setup +#define platform_cpu_init sn_cpu_init +#define platform_irq_init sn_irq_init +#define platform_map_nr sn2_map_nr +#define platform_send_ipi sn2_send_IPI +#define platform_global_tlb_purge sn2_global_tlb_purge +#define platform_pci_fixup sn_pci_fixup +#define platform_inb sn_inb +#define platform_inw sn_inw +#define platform_inl sn_inl +#define platform_outb sn_outb +#define platform_outw sn_outw +#define platform_oul sn_outl +#define platform_irq_desc sn_irq_desc +#define platform_irq_to_vector sn_irq_to_vector +#define platform_local_vector_to_irq sn_local_vector_to_irq +#define platform_valid_irq sn_valid_irq +#define platform_pci_dma_init machvec_noop +#define platform_pci_alloc_consistent sn_pci_alloc_consistent +#define platform_pci_free_consistent sn_pci_free_consistent +#define platform_pci_map_single sn_pci_map_single +#define platform_pci_unmap_single sn_pci_unmap_single +#define platform_pci_map_sg sn_pci_map_sg +#define platform_pci_unmap_sg sn_pci_unmap_sg +#define platform_pci_dma_sync_single sn_pci_dma_sync_single +#define platform_pci_dma_sync_sg sn_pci_dma_sync_sg +#define platform_pci_dma_address sn_dma_address +#define platform_pci_dma_supported sn_pci_dma_supported + +#endif /* _ASM_IA64_MACHVEC_SN2_H */ diff -urN linux-2.4.18/include/asm-ia64/mca.h lia64-2.4/include/asm-ia64/mca.h --- linux-2.4.18/include/asm-ia64/mca.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/mca.h Fri Jul 19 23:20:44 2002 @@ -7,9 +7,6 @@ * Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com) */ -/* XXX use this temporary define for MP systems trying to INIT */ -#undef SAL_MPINIT_WORKAROUND - #ifndef _ASM_IA64_MCA_H #define _ASM_IA64_MCA_H @@ -101,12 +98,19 @@ IA64_MCA_HALT = -3 /* System to be halted by SAL */ }; +enum { + IA64_MCA_SAME_CONTEXT = 0x0, /* SAL to return to same context */ + IA64_MCA_NEW_CONTEXT = -1 /* SAL to return to new context */ +}; + typedef struct ia64_mca_os_to_sal_state_s { u64 imots_os_status; /* OS status to SAL as to what happened * with the MCA handling. */ u64 imots_sal_gp; /* GP of the SAL - physical */ - u64 imots_new_min_state; /* Pointer to structure containing + u64 imots_context; /* 0 if return to same context + 1 if return to new context */ + u64 *imots_new_min_state; /* Pointer to structure containing * new values of registers in the min state * save area. */ @@ -127,12 +131,19 @@ extern void ia64_mca_wakeup_int_handler(int,void *,struct pt_regs *); extern void ia64_mca_cmc_int_handler(int,void *,struct pt_regs *); extern void ia64_mca_cpe_int_handler(int,void *,struct pt_regs *); -extern void ia64_log_print(int,prfunc_t); +extern int ia64_log_print(int,prfunc_t); extern void ia64_mca_cmc_vector_setup(void); extern void ia64_mca_check_errors( void ); extern u64 ia64_log_get(int, prfunc_t); #define PLATFORM_CALL(fn, args) printk("Platform call TBD\n") + +#define platform_mem_dev_err_print ia64_log_prt_oem_data +#define platform_pci_bus_err_print ia64_log_prt_oem_data +#define platform_pci_comp_err_print ia64_log_prt_oem_data +#define platform_plat_specific_err_print ia64_log_prt_oem_data +#define platform_host_ctlr_err_print ia64_log_prt_oem_data +#define platform_plat_bus_err_print ia64_log_prt_oem_data #undef MCA_TEST diff -urN linux-2.4.18/include/asm-ia64/mca_asm.h lia64-2.4/include/asm-ia64/mca_asm.h --- linux-2.4.18/include/asm-ia64/mca_asm.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/mca_asm.h Thu Jan 24 11:28:57 2002 @@ -6,6 +6,8 @@ * Copyright (C) Srinivasa Thirumalachar * Copyright (C) 2000 Hewlett-Packard Co. * Copyright (C) 2000 David Mosberger-Tang + * Copyright (C) 2002 Intel Corp. + * Copyright (C) 2002 Jenna Hall */ #ifndef _ASM_IA64_MCA_ASM_H #define _ASM_IA64_MCA_ASM_H @@ -24,7 +26,7 @@ * 1. Lop off bits 61 thru 63 in the virtual address */ #define INST_VA_TO_PA(addr) \ - dep addr = 0, addr, 61, 3; + dep addr = 0, addr, 61, 3 /* * This macro converts a data virtual address to a physical address * Right now for simulation purposes the virtual addresses are @@ -32,7 +34,7 @@ * 1. Lop off bits 61 thru 63 in the virtual address */ #define DATA_VA_TO_PA(addr) \ - dep addr = 0, addr, 61, 3; + dep addr = 0, addr, 61, 3 /* * This macro converts a data physical address to a virtual address * Right now for simulation purposes the virtual addresses are @@ -41,7 +43,7 @@ */ #define DATA_PA_TO_VA(addr,temp) \ mov temp = 0x7 ;; \ - dep addr = temp, addr, 61, 3;; + dep addr = temp, addr, 61, 3 /* * This macro jumps to the instruction at the given virtual address @@ -112,8 +114,8 @@ ;; \ mov cr.iip = temp2; \ mov cr.ifs = r0; \ - DATA_VA_TO_PA(sp) \ - DATA_VA_TO_PA(gp) \ + DATA_VA_TO_PA(sp); \ + DATA_VA_TO_PA(gp); \ ;; \ srlz.i; \ ;; \ @@ -130,8 +132,7 @@ * translations turned on. * 1. Get the old saved psr * - * 2. Clear the interrupt enable and interrupt state collection bits - * in the current psr. + * 2. Clear the interrupt state collection bit in the current psr. * * 3. Set the instruction translation bit back in the old psr * Note we have to do this since we are right now saving only the @@ -140,9 +141,11 @@ * * 4. Set ipsr to this old_psr with "it" bit set and "bn" = 1. * - * 5. Set iip to the virtual address of the next instruction bundle. + * 5. Reset the current thread pointer (r13). * - * 6. Do an rfi to move ipsr to psr and iip to ip. + * 6. Set iip to the virtual address of the next instruction bundle. + * + * 7. Do an rfi to move ipsr to psr and iip to ip. */ #define VIRTUAL_MODE_ENTER(temp1, temp2, start_addr, old_psr) \ @@ -156,6 +159,10 @@ mov ar.rsc = 0; \ ;; \ srlz.d; \ + mov r13 = ar.k6; \ + ;; \ + DATA_PA_TO_VA(r13,temp1); \ + ;; \ mov temp2 = ar.bspstore; \ ;; \ DATA_PA_TO_VA(temp2,temp1); \ @@ -170,8 +177,6 @@ ;; \ mov temp2 = 1; \ ;; \ - dep temp1 = temp2, temp1, PSR_I, 1; \ - ;; \ dep temp1 = temp2, temp1, PSR_IC, 1; \ ;; \ dep temp1 = temp2, temp1, PSR_IT, 1; \ @@ -195,7 +200,7 @@ nop 1; \ nop 2; \ nop 1; \ - rfi; \ + rfi \ ;; /* diff -urN linux-2.4.18/include/asm-ia64/module.h lia64-2.4/include/asm-ia64/module.h --- linux-2.4.18/include/asm-ia64/module.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/module.h Fri Jul 19 23:20:22 2002 @@ -51,6 +51,9 @@ return 0; archdata = (struct archdata *)(mod->archdata_start); + if (archdata->unw_start == 0) + return 0; + /* * Make sure the unwind pointers are sane. */ diff -urN linux-2.4.18/include/asm-ia64/offsets.h lia64-2.4/include/asm-ia64/offsets.h --- linux-2.4.18/include/asm-ia64/offsets.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/offsets.h Fri Jul 19 23:19:45 2002 @@ -8,7 +8,7 @@ */ #define PT_PTRACED_BIT 0 #define PT_TRACESYS_BIT 1 -#define IA64_TASK_SIZE 3408 /* 0xd50 */ +#define IA64_TASK_SIZE 3424 /* 0xd60 */ #define IA64_PT_REGS_SIZE 400 /* 0x190 */ #define IA64_SWITCH_STACK_SIZE 560 /* 0x230 */ #define IA64_SIGINFO_SIZE 128 /* 0x80 */ @@ -19,11 +19,11 @@ #define IA64_TASK_PTRACE_OFFSET 48 /* 0x30 */ #define IA64_TASK_SIGPENDING_OFFSET 16 /* 0x10 */ #define IA64_TASK_NEED_RESCHED_OFFSET 40 /* 0x28 */ -#define IA64_TASK_PROCESSOR_OFFSET 100 /* 0x64 */ -#define IA64_TASK_THREAD_OFFSET 976 /* 0x3d0 */ -#define IA64_TASK_THREAD_KSP_OFFSET 976 /* 0x3d0 */ -#define IA64_TASK_PFM_MUST_BLOCK_OFFSET 1600 /* 0x640 */ -#define IA64_TASK_PID_OFFSET 220 /* 0xdc */ +#define IA64_TASK_PROCESSOR_OFFSET 96 /* 0x60 */ +#define IA64_TASK_THREAD_OFFSET 992 /* 0x3e0 */ +#define IA64_TASK_THREAD_KSP_OFFSET 992 /* 0x3e0 */ +#define IA64_TASK_PFM_OVFL_BLOCK_RESET_OFFSET 1616 /* 0x650 */ +#define IA64_TASK_PID_OFFSET 228 /* 0xe4 */ #define IA64_TASK_MM_OFFSET 88 /* 0x58 */ #define IA64_PT_REGS_CR_IPSR_OFFSET 0 /* 0x0 */ #define IA64_PT_REGS_CR_IIP_OFFSET 8 /* 0x8 */ @@ -115,6 +115,7 @@ #define IA64_SWITCH_STACK_AR_RNAT_OFFSET 536 /* 0x218 */ #define IA64_SWITCH_STACK_AR_BSPSTORE_OFFSET 544 /* 0x220 */ #define IA64_SWITCH_STACK_PR_OFFSET 552 /* 0x228 */ +#define IA64_SIGCONTEXT_IP_OFFSET 40 /* 0x28 */ #define IA64_SIGCONTEXT_AR_BSP_OFFSET 72 /* 0x48 */ #define IA64_SIGCONTEXT_AR_FPSR_OFFSET 104 /* 0x68 */ #define IA64_SIGCONTEXT_AR_RNAT_OFFSET 80 /* 0x50 */ diff -urN linux-2.4.18/include/asm-ia64/page.h lia64-2.4/include/asm-ia64/page.h --- linux-2.4.18/include/asm-ia64/page.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/page.h Fri Jul 19 23:20:15 2002 @@ -55,7 +55,7 @@ #ifdef CONFIG_IA64_GENERIC # include # define virt_to_page(kaddr) (mem_map + platform_map_nr(kaddr)) -# define page_to_phys(page) XXX fix me +# define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) #elif defined (CONFIG_IA64_SGI_SN1) # ifndef CONFIG_DISCONTIGMEM # define virt_to_page(kaddr) (mem_map + MAP_NR_DENSE(kaddr)) @@ -65,7 +65,13 @@ # define virt_to_page(kaddr) (mem_map + MAP_NR_DENSE(kaddr)) # define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) #endif -#define VALID_PAGE(page) ((page - mem_map) < max_mapnr) +#ifdef CONFIG_VIRTUAL_MEM_MAP + struct page; + extern int ia64_page_valid (struct page *); +# define VALID_PAGE(page) (((page - mem_map) < max_mapnr) && ia64_page_valid(page)) +#else +# define VALID_PAGE(page) ((page - mem_map) < max_mapnr) +#endif typedef union ia64_va { struct { @@ -148,6 +154,11 @@ # define __pgprot(x) (x) #endif /* !STRICT_MM_TYPECHECKS */ -#define PAGE_OFFSET 0xe000000000000000 +#define PAGE_OFFSET 0xe000000000000000 + +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC | \ + (((current->thread.flags & IA64_THREAD_XSTACK) != 0) \ + ? VM_EXEC : 0)) #endif /* _ASM_IA64_PAGE_H */ diff -urN linux-2.4.18/include/asm-ia64/pci.h lia64-2.4/include/asm-ia64/pci.h --- linux-2.4.18/include/asm-ia64/pci.h Tue Feb 26 11:05:03 2002 +++ lia64-2.4/include/asm-ia64/pci.h Fri Jul 19 23:21:25 2002 @@ -19,6 +19,11 @@ #define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_MEM 0x10000000 +void pcibios_config_init(void); +struct pci_bus * pcibios_scan_root(int bus); +extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value); +extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value); + struct pci_dev; static inline void @@ -45,31 +50,15 @@ #define pci_dma_sync_single platform_pci_dma_sync_single #define pci_dma_sync_sg platform_pci_dma_sync_sg #define sg_dma_address platform_pci_dma_address +#define pci_dma_supported platform_pci_dma_supported /* pci_unmap_{single,page} is not a nop, thus... */ -#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ - dma_addr_t ADDR_NAME; -#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ - __u32 LEN_NAME; -#define pci_unmap_addr(PTR, ADDR_NAME) \ - ((PTR)->ADDR_NAME) -#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \ - (((PTR)->ADDR_NAME) = (VAL)) -#define pci_unmap_len(PTR, LEN_NAME) \ - ((PTR)->LEN_NAME) -#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ - (((PTR)->LEN_NAME) = (VAL)) - -/* - * Return whether the given PCI device DMA address mask can be supported properly. For - * example, if your device can only drive the low 24-bits during PCI bus mastering, then - * you would pass 0x00ffffff as the mask to this function. - */ -static inline int -pci_dma_supported (struct pci_dev *hwdev, u64 mask) -{ - return 1; -} +#define DECLARE_PCI_UNMAP_ADDR(addr_name) dma_addr_t addr_name; +#define DECLARE_PCI_UNMAP_LEN(len_name) __u32 len_name; +#define pci_unmap_addr(ptr, addr_name) ((ptr)->addr_name) +#define pci_unmap_addr_set(ptr, addr_name, val) (((ptr)->addr_name) = (val)) +#define pci_unmap_len(ptr, len_name) ((ptr)->len_name) +#define pci_unmap_len_set(ptr, len_name, val) (((ptr)->len_name) = (val)) #define pci_map_page(dev,pg,off,size,dir) \ pci_map_single((dev), page_address(pg) + (off), (size), (dir)) @@ -79,7 +68,7 @@ /* The ia64 platform always supports 64-bit addressing. */ #define pci_dac_dma_supported(pci_dev, mask) (1) -#define pci_dac_page_to_dma(dev,pg,off,dir) ((dma64_addr_t) page_to_bus(pg) + (off)) +#define pci_dac_page_to_dma(dev,pg,off,dir) ((dma_addr_t) page_to_bus(pg) + (off)) #define pci_dac_dma_to_page(dev,dma_addr) (virt_to_page(bus_to_virt(dma_addr))) #define pci_dac_dma_to_offset(dev,dma_addr) ((dma_addr) & ~PAGE_MASK) #define pci_dac_dma_sync_single(dev,dma_addr,len,dir) do { /* nothing */ } while (0) diff -urN linux-2.4.18/include/asm-ia64/perfmon.h lia64-2.4/include/asm-ia64/perfmon.h --- linux-2.4.18/include/asm-ia64/perfmon.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/perfmon.h Mon Jul 8 14:15:24 2002 @@ -1,55 +1,178 @@ /* - * Copyright (C) 2001 Hewlett-Packard Co - * Copyright (C) 2001 Stephane Eranian + * Copyright (C) 2001-2002 Hewlett-Packard Co + * Stephane Eranian */ #ifndef _ASM_IA64_PERFMON_H #define _ASM_IA64_PERFMON_H -#include +/* + * perfmon comamnds supported on all CPU models + */ +#define PFM_WRITE_PMCS 0x01 +#define PFM_WRITE_PMDS 0x02 +#define PFM_READ_PMDS 0x03 +#define PFM_STOP 0x04 +#define PFM_START 0x05 +#define PFM_ENABLE 0x06 +#define PFM_DISABLE 0x07 +#define PFM_CREATE_CONTEXT 0x08 +#define PFM_DESTROY_CONTEXT 0x09 +#define PFM_RESTART 0x0a +#define PFM_PROTECT_CONTEXT 0x0b +#define PFM_GET_FEATURES 0x0c +#define PFM_DEBUG 0x0d +#define PFM_UNPROTECT_CONTEXT 0x0e +#define PFM_GET_PMC_RESET_VAL 0x0f + + +/* + * CPU model specific commands (may not be supported on all models) + */ +#define PFM_WRITE_IBRS 0x20 +#define PFM_WRITE_DBRS 0x21 + +/* + * context flags + */ +#define PFM_FL_INHERIT_NONE 0x00 /* never inherit a context across fork (default) */ +#define PFM_FL_INHERIT_ONCE 0x01 /* clone pfm_context only once across fork() */ +#define PFM_FL_INHERIT_ALL 0x02 /* always clone pfm_context across fork() */ +#define PFM_FL_NOTIFY_BLOCK 0x04 /* block task on user level notifications */ +#define PFM_FL_SYSTEM_WIDE 0x08 /* create a system wide context */ + +/* + * PMC flags + */ +#define PFM_REGFL_OVFL_NOTIFY 0x1 /* send notification on overflow */ + +/* + * PMD/PMC/IBR/DBR return flags (ignored on input) + * + * Those flags are used on output and must be checked in case EAGAIN is returned + * by any of the calls using a pfarg_reg_t or pfarg_dbreg_t structure. + */ +#define PFM_REG_RETFL_NOTAVAIL (1U<<31) /* set if register is implemented but not available */ +#define PFM_REG_RETFL_EINVAL (1U<<30) /* set if register entry is invalid */ +#define PFM_REG_RETFL_MASK (PFM_REG_RETFL_NOTAVAIL|PFM_REG_RETFL_EINVAL) + +#define PFM_REG_HAS_ERROR(flag) (((flag) & PFM_REG_RETFL_MASK) != 0) /* * Request structure used to define a context */ typedef struct { - unsigned long smpl_entries; /* how many entries in sampling buffer */ - unsigned long smpl_regs; /* which pmds to record on overflow */ - void *smpl_vaddr; /* returns address of BTB buffer */ + unsigned long ctx_smpl_entries; /* how many entries in sampling buffer */ + unsigned long ctx_smpl_regs[4]; /* which pmds to record on overflow */ - pid_t notify_pid; /* which process to notify on overflow */ - int notify_sig; /* XXX: not used anymore */ + pid_t ctx_notify_pid; /* which process to notify on overflow */ + int ctx_flags; /* noblock/block, inherit flags */ + void *ctx_smpl_vaddr; /* returns address of BTB buffer */ - int flags; /* NOBLOCK/BLOCK/ INHERIT flags (will replace API flags) */ -} pfreq_context_t; + unsigned long ctx_cpu_mask; /* on which CPU to enable perfmon (systemwide) */ + + unsigned long reserved[8]; /* for future use */ +} pfarg_context_t; /* * Request structure used to write/read a PMC or PMD */ typedef struct { - unsigned long reg_num; /* which register */ + unsigned int reg_num; /* which register */ + unsigned int reg_flags; /* PMC: notify/don't notify. PMD/PMC: return flags */ unsigned long reg_value; /* configuration (PMC) or initial value (PMD) */ - unsigned long reg_smpl_reset; /* reset of sampling buffer overflow (large) */ - unsigned long reg_ovfl_reset; /* reset on counter overflow (small) */ - int reg_flags; /* (PMD): notify/don't notify */ -} pfreq_reg_t; + + unsigned long reg_long_reset; /* reset after sampling buffer overflow (large) */ + unsigned long reg_short_reset;/* reset after counter overflow (small) */ + + unsigned long reg_reset_pmds[4]; /* which other counters to reset on overflow */ + + unsigned long reserved[16]; /* for future use */ +} pfarg_reg_t; + +typedef struct { + unsigned int dbreg_num; /* which register */ + unsigned int dbreg_flags; /* dbregs return flags */ + unsigned long dbreg_value; /* configuration (PMC) or initial value (PMD) */ + unsigned long reserved[6]; +} pfarg_dbreg_t; + +typedef struct { + unsigned int ft_version; /* perfmon: major [16-31], minor [0-15] */ + unsigned int ft_smpl_version;/* sampling format: major [16-31], minor [0-15] */ + unsigned long reserved[4]; /* for future use */ +} pfarg_features_t; /* - * main request structure passed by user - */ -typedef union { - pfreq_context_t pfr_ctx; /* request to configure a context */ - pfreq_reg_t pfr_reg; /* request to configure a PMD/PMC */ -} perfmon_req_t; + * This header is at the beginning of the sampling buffer returned to the user. + * It is exported as Read-Only at this point. It is directly followed by the + * first record. + */ +typedef struct { + unsigned int hdr_version; /* contains perfmon version (smpl format diffs) */ + unsigned int reserved; + unsigned long hdr_entry_size; /* size of one entry in bytes */ + unsigned long hdr_count; /* how many valid entries */ + unsigned long hdr_pmds[4]; /* which pmds are recorded */ +} perfmon_smpl_hdr_t; + +/* + * Define the version numbers for both perfmon as a whole and the sampling buffer format. + */ +#define PFM_VERSION_MAJ 1U +#define PFM_VERSION_MIN 0U +#define PFM_VERSION (((PFM_VERSION_MAJ&0xffff)<<16)|(PFM_VERSION_MIN & 0xffff)) + +#define PFM_SMPL_VERSION_MAJ 1U +#define PFM_SMPL_VERSION_MIN 0U +#define PFM_SMPL_VERSION (((PFM_SMPL_VERSION_MAJ&0xffff)<<16)|(PFM_SMPL_VERSION_MIN & 0xffff)) + + +#define PFM_VERSION_MAJOR(x) (((x)>>16) & 0xffff) +#define PFM_VERSION_MINOR(x) ((x) & 0xffff) + +/* + * Entry header in the sampling buffer. + * The header is directly followed with the PMDS saved in increasing index + * order: PMD4, PMD5, .... How many PMDs are present is determined by the + * user program during context creation. + * + * XXX: in this version of the entry, only up to 64 registers can be recorded + * This should be enough for quite some time. Always check sampling format + * before parsing entries! + * + * Inn the case where multiple counters have overflowed at the same time, the + * rate field indicate the initial value of the first PMD, based on the index. + * For instance, if PMD2 and PMD5 have ovewrflowed for this entry, the rate field + * will show the initial value of PMD2. + */ +typedef struct { + int pid; /* identification of process */ + int cpu; /* which cpu was used */ + unsigned long rate; /* initial value of overflowed counter */ + unsigned long stamp; /* timestamp */ + unsigned long ip; /* where did the overflow interrupt happened */ + unsigned long regs; /* bitmask of which registers overflowed */ + unsigned long period; /* sampling period used by overflowed counter (smallest pmd index) */ +} perfmon_smpl_entry_t; + +extern int perfmonctl(pid_t pid, int cmd, void *arg, int narg); #ifdef __KERNEL__ extern void pfm_save_regs (struct task_struct *); extern void pfm_load_regs (struct task_struct *); -extern int pfm_inherit (struct task_struct *, struct pt_regs *); +extern int pfm_inherit (struct task_struct *, struct pt_regs *); extern void pfm_context_exit (struct task_struct *); extern void pfm_flush_regs (struct task_struct *); extern void pfm_cleanup_notifiers (struct task_struct *); +extern void pfm_cleanup_owners (struct task_struct *); +extern int pfm_use_debug_registers(struct task_struct *); +extern int pfm_release_debug_registers(struct task_struct *); +extern int pfm_cleanup_smpl_buf(struct task_struct *); +extern void pfm_syst_wide_update_task(struct task_struct *, int); +extern void perfmon_init_percpu(void); #endif /* __KERNEL__ */ diff -urN linux-2.4.18/include/asm-ia64/pgalloc.h lia64-2.4/include/asm-ia64/pgalloc.h --- linux-2.4.18/include/asm-ia64/pgalloc.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/pgalloc.h Fri Jul 19 23:20:20 2002 @@ -8,13 +8,14 @@ * This hopefully works with any (fixed) ia-64 page-size, as defined * in (currently 8192). * - * Copyright (C) 1998-2001 Hewlett-Packard Co + * Copyright (C) 1998-2002 Hewlett-Packard Co * David Mosberger-Tang * Copyright (C) 2000, Goutham Rao */ #include +#include #include #include @@ -204,9 +205,15 @@ static inline void flush_tlb_pgtables (struct mm_struct *mm, unsigned long start, unsigned long end) { - if (rgn_index(start) != rgn_index(end)) - printk("flush_tlb_pgtables: can't flush across regions!!\n"); - flush_tlb_range(mm, ia64_thash(start), ia64_thash(end)); + if (unlikely(end - start >= 1024*1024*1024*1024UL + || rgn_index(start) != rgn_index(end - 1))) + /* + * This condition is very rare and normal applications shouldn't get + * here. No attempt has been made to optimize for this case. + */ + flush_tlb_all(); + else + flush_tlb_range(mm, ia64_thash(start), ia64_thash(end)); } /* @@ -220,6 +227,7 @@ #define flush_cache_range(mm, start, end) do { } while (0) #define flush_cache_page(vma, vmaddr) do { } while (0) #define flush_page_to_ram(page) do { } while (0) +#define flush_icache_page(vma,pg) do { } while (0) extern void flush_icache_range (unsigned long start, unsigned long end); diff -urN linux-2.4.18/include/asm-ia64/pgtable.h lia64-2.4/include/asm-ia64/pgtable.h --- linux-2.4.18/include/asm-ia64/pgtable.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/pgtable.h Fri Jul 19 23:20:16 2002 @@ -8,7 +8,7 @@ * This hopefully works with any (fixed) IA-64 page-size, as defined * in (currently 8192). * - * Copyright (C) 1998-2001 Hewlett-Packard Co + * Copyright (C) 1998-2002 Hewlett-Packard Co * David Mosberger-Tang */ @@ -108,19 +108,15 @@ /* * All the normal masks have the "page accessed" bits on, as any time * they are used, the page is accessed. They are cleared only by the - * page-out routines. On the other hand, we do NOT turn on the - * execute bit on pages that are mapped writable. For those pages, we - * turn on the X bit only when the program attempts to actually - * execute code in such a page (it's a "lazy execute bit", if you - * will). This lets reduce the amount of i-cache flushing we have to - * do for data pages such as stack and heap pages. + * page-out routines. */ #define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_A) #define PAGE_SHARED __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RW) #define PAGE_READONLY __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_R) -#define PAGE_COPY __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_R) +#define PAGE_COPY __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RX) #define PAGE_GATE __pgprot(__ACCESS_BITS | _PAGE_PL_0 | _PAGE_AR_X_RX) #define PAGE_KERNEL __pgprot(__DIRTY_BITS | _PAGE_PL_0 | _PAGE_AR_RWX) +#define PAGE_KERNELRX __pgprot(__ACCESS_BITS | _PAGE_PL_0 | _PAGE_AR_RX) # ifndef __ASSEMBLY__ @@ -152,8 +148,8 @@ #define __S011 PAGE_SHARED #define __S100 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_X_RX) #define __S101 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RX) -#define __S110 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RW) -#define __S111 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RW) +#define __S110 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RWX) +#define __S111 __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RWX) #define pgd_ERROR(e) printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e)) #define pmd_ERROR(e) printk("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e)) @@ -178,6 +174,7 @@ return (addr & (local_cpu_data->unimpl_pa_mask)) == 0; } +#ifndef CONFIG_DISCONTIGMEM /* * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel * memory. For the return value to be meaningful, ADDR must be >= @@ -193,6 +190,8 @@ */ #define kern_addr_valid(addr) (1) +#endif + /* * Now come the defines and routines to manage and access the three-level * page table. @@ -210,7 +209,13 @@ #define VMALLOC_START (0xa000000000000000 + 3*PAGE_SIZE) #define VMALLOC_VMADDR(x) ((unsigned long)(x)) -#define VMALLOC_END (0xa000000000000000 + (1UL << (4*PAGE_SHIFT - 9))) +#ifdef CONFIG_VIRTUAL_MEM_MAP +# define VMALLOC_END_INIT (0xa000000000000000 + (1UL << (4*PAGE_SHIFT - 9))) +# define VMALLOC_END vmalloc_end + extern unsigned long vmalloc_end; +#else +# define VMALLOC_END (0xa000000000000000 + (1UL << (4*PAGE_SHIFT - 9))) +#endif /* * Conversion functions: convert a page and protection to a page entry, @@ -237,8 +242,10 @@ #define pte_none(pte) (!pte_val(pte)) #define pte_present(pte) (pte_val(pte) & (_PAGE_P | _PAGE_PROTNONE)) #define pte_clear(pte) (pte_val(*(pte)) = 0UL) +#ifndef CONFIG_DISCONTIGMEM /* pte_page() returns the "struct page *" corresponding to the PTE: */ #define pte_page(pte) (mem_map + (unsigned long) ((pte_val(pte) & _PFN_MASK) >> PAGE_SHIFT)) +#endif #define pmd_none(pmd) (!pmd_val(pmd)) #define pmd_bad(pmd) (!ia64_phys_addr_valid(pmd_val(pmd))) @@ -423,22 +430,6 @@ return pte_val(a) == pte_val(b); } -/* - * Macros to check the type of access that triggered a page fault. - */ - -static inline int -is_write_access (int access_type) -{ - return (access_type & 0x2); -} - -static inline int -is_exec_access (int access_type) -{ - return (access_type & 0x4); -} - extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; extern void paging_init (void); @@ -463,6 +454,37 @@ /* We provide our own get_unmapped_area to cope with VA holes for userland */ #define HAVE_ARCH_UNMAPPED_AREA +/* + * No page table caches to initialise + */ +#define pgtable_cache_init() do { } while (0) + +/* + * No page table caches to initialise + */ +#define pgtable_cache_init() do { } while (0) + +#ifdef CONFIG_VIRTUAL_MEM_MAP + +/* arch mem_map init routines are needed due to holes in a virtual mem_map */ +#define HAVE_ARCH_MEMMAP_INIT + +#include + +typedef void memmap_init_callback_t (struct page *start, struct page *end); + +extern void arch_memmap_init (memmap_init_callback_t *callback, + struct page *start, struct page *end); + +typedef void memmap_zone_callback_t (struct page *start, struct page *end, + zone_t *zone,unsigned long start_paddr, + int highmem_flag); + +extern void arch_memmap_zone_init (memmap_zone_callback_t *callback, + struct page *start, struct page *end, zone_t *zone, + unsigned long start_paddr, int highmem_flag); +#endif /* CONFIG_VIRTUAL_MEM_MAP */ + # endif /* !__ASSEMBLY__ */ /* @@ -482,10 +504,5 @@ #define KERNEL_TR_PAGE_SHIFT _PAGE_SIZE_64M #define KERNEL_TR_PAGE_SIZE (1 << KERNEL_TR_PAGE_SHIFT) #define KERNEL_TR_PAGE_NUM ((KERNEL_START - PAGE_OFFSET) / KERNEL_TR_PAGE_SIZE) - -/* - * No page table caches to initialise - */ -#define pgtable_cache_init() do { } while (0) #endif /* _ASM_IA64_PGTABLE_H */ diff -urN linux-2.4.18/include/asm-ia64/processor.h lia64-2.4/include/asm-ia64/processor.h --- linux-2.4.18/include/asm-ia64/processor.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/processor.h Fri Jul 19 23:20:15 2002 @@ -2,9 +2,9 @@ #define _ASM_IA64_PROCESSOR_H /* - * Copyright (C) 1998-2001 Hewlett-Packard Co - * Copyright (C) 1998-2001 David Mosberger-Tang - * Copyright (C) 1998-2001 Stephane Eranian + * Copyright (C) 1998-2002 Hewlett-Packard Co + * David Mosberger-Tang + * Stephane Eranian * Copyright (C) 1999 Asit Mallick * Copyright (C) 1999 Don Dugger * @@ -14,10 +14,10 @@ */ #include +#include #include #include -#include #include #define IA64_NUM_DBG_REGS 8 @@ -27,7 +27,6 @@ */ #define IA64_NUM_PMC_REGS 32 #define IA64_NUM_PMD_REGS 32 -#define IA64_NUM_PMD_COUNTERS 4 #define DEFAULT_MAP_BASE 0x2000000000000000 #define DEFAULT_TASK_SIZE 0xa000000000000000 @@ -54,114 +53,6 @@ #define MCA_bus 0 #define MCA_bus__is_a_macro /* for versions in ksyms.c */ -/* Processor status register bits: */ -#define IA64_PSR_BE_BIT 1 -#define IA64_PSR_UP_BIT 2 -#define IA64_PSR_AC_BIT 3 -#define IA64_PSR_MFL_BIT 4 -#define IA64_PSR_MFH_BIT 5 -#define IA64_PSR_IC_BIT 13 -#define IA64_PSR_I_BIT 14 -#define IA64_PSR_PK_BIT 15 -#define IA64_PSR_DT_BIT 17 -#define IA64_PSR_DFL_BIT 18 -#define IA64_PSR_DFH_BIT 19 -#define IA64_PSR_SP_BIT 20 -#define IA64_PSR_PP_BIT 21 -#define IA64_PSR_DI_BIT 22 -#define IA64_PSR_SI_BIT 23 -#define IA64_PSR_DB_BIT 24 -#define IA64_PSR_LP_BIT 25 -#define IA64_PSR_TB_BIT 26 -#define IA64_PSR_RT_BIT 27 -/* The following are not affected by save_flags()/restore_flags(): */ -#define IA64_PSR_CPL0_BIT 32 -#define IA64_PSR_CPL1_BIT 33 -#define IA64_PSR_IS_BIT 34 -#define IA64_PSR_MC_BIT 35 -#define IA64_PSR_IT_BIT 36 -#define IA64_PSR_ID_BIT 37 -#define IA64_PSR_DA_BIT 38 -#define IA64_PSR_DD_BIT 39 -#define IA64_PSR_SS_BIT 40 -#define IA64_PSR_RI_BIT 41 -#define IA64_PSR_ED_BIT 43 -#define IA64_PSR_BN_BIT 44 - -#define IA64_PSR_BE (__IA64_UL(1) << IA64_PSR_BE_BIT) -#define IA64_PSR_UP (__IA64_UL(1) << IA64_PSR_UP_BIT) -#define IA64_PSR_AC (__IA64_UL(1) << IA64_PSR_AC_BIT) -#define IA64_PSR_MFL (__IA64_UL(1) << IA64_PSR_MFL_BIT) -#define IA64_PSR_MFH (__IA64_UL(1) << IA64_PSR_MFH_BIT) -#define IA64_PSR_IC (__IA64_UL(1) << IA64_PSR_IC_BIT) -#define IA64_PSR_I (__IA64_UL(1) << IA64_PSR_I_BIT) -#define IA64_PSR_PK (__IA64_UL(1) << IA64_PSR_PK_BIT) -#define IA64_PSR_DT (__IA64_UL(1) << IA64_PSR_DT_BIT) -#define IA64_PSR_DFL (__IA64_UL(1) << IA64_PSR_DFL_BIT) -#define IA64_PSR_DFH (__IA64_UL(1) << IA64_PSR_DFH_BIT) -#define IA64_PSR_SP (__IA64_UL(1) << IA64_PSR_SP_BIT) -#define IA64_PSR_PP (__IA64_UL(1) << IA64_PSR_PP_BIT) -#define IA64_PSR_DI (__IA64_UL(1) << IA64_PSR_DI_BIT) -#define IA64_PSR_SI (__IA64_UL(1) << IA64_PSR_SI_BIT) -#define IA64_PSR_DB (__IA64_UL(1) << IA64_PSR_DB_BIT) -#define IA64_PSR_LP (__IA64_UL(1) << IA64_PSR_LP_BIT) -#define IA64_PSR_TB (__IA64_UL(1) << IA64_PSR_TB_BIT) -#define IA64_PSR_RT (__IA64_UL(1) << IA64_PSR_RT_BIT) -/* The following are not affected by save_flags()/restore_flags(): */ -#define IA64_PSR_IS (__IA64_UL(1) << IA64_PSR_IS_BIT) -#define IA64_PSR_MC (__IA64_UL(1) << IA64_PSR_MC_BIT) -#define IA64_PSR_IT (__IA64_UL(1) << IA64_PSR_IT_BIT) -#define IA64_PSR_ID (__IA64_UL(1) << IA64_PSR_ID_BIT) -#define IA64_PSR_DA (__IA64_UL(1) << IA64_PSR_DA_BIT) -#define IA64_PSR_DD (__IA64_UL(1) << IA64_PSR_DD_BIT) -#define IA64_PSR_SS (__IA64_UL(1) << IA64_PSR_SS_BIT) -#define IA64_PSR_RI (__IA64_UL(3) << IA64_PSR_RI_BIT) -#define IA64_PSR_ED (__IA64_UL(1) << IA64_PSR_ED_BIT) -#define IA64_PSR_BN (__IA64_UL(1) << IA64_PSR_BN_BIT) - -/* User mask bits: */ -#define IA64_PSR_UM (IA64_PSR_BE | IA64_PSR_UP | IA64_PSR_AC | IA64_PSR_MFL | IA64_PSR_MFH) - -/* Default Control Register */ -#define IA64_DCR_PP_BIT 0 /* privileged performance monitor default */ -#define IA64_DCR_BE_BIT 1 /* big-endian default */ -#define IA64_DCR_LC_BIT 2 /* ia32 lock-check enable */ -#define IA64_DCR_DM_BIT 8 /* defer TLB miss faults */ -#define IA64_DCR_DP_BIT 9 /* defer page-not-present faults */ -#define IA64_DCR_DK_BIT 10 /* defer key miss faults */ -#define IA64_DCR_DX_BIT 11 /* defer key permission faults */ -#define IA64_DCR_DR_BIT 12 /* defer access right faults */ -#define IA64_DCR_DA_BIT 13 /* defer access bit faults */ -#define IA64_DCR_DD_BIT 14 /* defer debug faults */ - -#define IA64_DCR_PP (__IA64_UL(1) << IA64_DCR_PP_BIT) -#define IA64_DCR_BE (__IA64_UL(1) << IA64_DCR_BE_BIT) -#define IA64_DCR_LC (__IA64_UL(1) << IA64_DCR_LC_BIT) -#define IA64_DCR_DM (__IA64_UL(1) << IA64_DCR_DM_BIT) -#define IA64_DCR_DP (__IA64_UL(1) << IA64_DCR_DP_BIT) -#define IA64_DCR_DK (__IA64_UL(1) << IA64_DCR_DK_BIT) -#define IA64_DCR_DX (__IA64_UL(1) << IA64_DCR_DX_BIT) -#define IA64_DCR_DR (__IA64_UL(1) << IA64_DCR_DR_BIT) -#define IA64_DCR_DA (__IA64_UL(1) << IA64_DCR_DA_BIT) -#define IA64_DCR_DD (__IA64_UL(1) << IA64_DCR_DD_BIT) - -/* Interrupt Status Register */ -#define IA64_ISR_X_BIT 32 /* execute access */ -#define IA64_ISR_W_BIT 33 /* write access */ -#define IA64_ISR_R_BIT 34 /* read access */ -#define IA64_ISR_NA_BIT 35 /* non-access */ -#define IA64_ISR_SP_BIT 36 /* speculative load exception */ -#define IA64_ISR_RS_BIT 37 /* mandatory register-stack exception */ -#define IA64_ISR_IR_BIT 38 /* invalid register frame exception */ - -#define IA64_ISR_X (__IA64_UL(1) << IA64_ISR_X_BIT) -#define IA64_ISR_W (__IA64_UL(1) << IA64_ISR_W_BIT) -#define IA64_ISR_R (__IA64_UL(1) << IA64_ISR_R_BIT) -#define IA64_ISR_NA (__IA64_UL(1) << IA64_ISR_NA_BIT) -#define IA64_ISR_SP (__IA64_UL(1) << IA64_ISR_SP_BIT) -#define IA64_ISR_RS (__IA64_UL(1) << IA64_ISR_RS_BIT) -#define IA64_ISR_IR (__IA64_UL(1) << IA64_ISR_IR_BIT) - #define IA64_THREAD_FPH_VALID (__IA64_UL(1) << 0) /* floating-point high state valid? */ #define IA64_THREAD_DBG_VALID (__IA64_UL(1) << 1) /* debug registers valid? */ #define IA64_THREAD_PM_VALID (__IA64_UL(1) << 2) /* performance registers valid? */ @@ -170,6 +61,7 @@ #define IA64_THREAD_KRBS_SYNCED (__IA64_UL(1) << 5) /* krbs synced with process vm? */ #define IA64_THREAD_FPEMU_NOPRINT (__IA64_UL(1) << 6) /* don't log any fpswa faults */ #define IA64_THREAD_FPEMU_SIGFPE (__IA64_UL(1) << 7) /* send a SIGFPE for fpswa faults */ +#define IA64_THREAD_XSTACK (__IA64_UL(1) << 8) /* stack executable by default? */ #define IA64_THREAD_UAC_SHIFT 3 #define IA64_THREAD_UAC_MASK (IA64_THREAD_UAC_NOPRINT | IA64_THREAD_UAC_SIGBUS) @@ -187,6 +79,7 @@ #ifndef __ASSEMBLY__ #include +#include #include #include @@ -275,16 +168,32 @@ __u32 ptce_stride[2]; struct task_struct *ksoftirqd; /* kernel softirq daemon for this CPU */ #ifdef CONFIG_SMP + int processor; __u64 loops_per_jiffy; __u64 ipi_count; __u64 prof_counter; __u64 prof_multiplier; - __u64 ipi_operation; +# ifdef CONFIG_PERFMON + __u32 pfm_syst_wide; + __u32 pfm_dcr_pp; +# endif + union { + /* + * This is written to by *other* CPUs, + * so isolate it in its own cacheline. + */ + __u64 operation; + char pad[SMP_CACHE_BYTES] ____cacheline_aligned; + } ipi; #endif #ifdef CONFIG_NUMA + void *node_directory; + int numa_node_id; struct cpuinfo_ia64 *cpu_data[NR_CPUS]; #endif -} __attribute__ ((aligned (PAGE_SIZE))) ; + /* Platform specific word. MUST BE LAST IN STRUCT */ + __u64 platform_specific; +} __attribute__ ((aligned (PAGE_SIZE))); /* * The "local" data pointer. It points to the per-CPU data of the currently executing @@ -303,7 +212,8 @@ * the array. */ #ifdef CONFIG_NUMA -# define cpu_data(cpu) local_cpu_data->cpu_data_ptrs[cpu] +# define cpu_data(cpu) local_cpu_data->cpu_data[cpu] +# define numa_node_id() (local_cpu_data->numa_node_id) #else extern struct cpuinfo_ia64 _cpu_data[NR_CPUS]; # define cpu_data(cpu) (&_cpu_data[cpu]) @@ -366,10 +276,12 @@ #ifdef CONFIG_PERFMON __u64 pmc[IA64_NUM_PMC_REGS]; __u64 pmd[IA64_NUM_PMD_REGS]; - unsigned long pfm_must_block; /* non-zero if we need to block on overflow */ + unsigned long pfm_ovfl_block_reset;/* non-zero if we need to block or reset regs on ovfl */ void *pfm_context; /* pointer to detailed PMU context */ - atomic_t pfm_notifiers_check; /* indicate if release_thread much check tasklist */ -# define INIT_THREAD_PM {0, }, {0, }, 0, 0, {0}, + atomic_t pfm_notifiers_check; /* when >0, will cleanup ctx_notify_task in tasklist */ + atomic_t pfm_owners_check; /* when >0, will cleanup ctx_owner in tasklist */ + void *pfm_smpl_buf_list; /* list of sampling buffers to vfree */ +# define INIT_THREAD_PM {0, }, {0, }, 0, NULL, {0}, {0}, NULL, #else # define INIT_THREAD_PM #endif @@ -393,11 +305,8 @@ #define start_thread(regs,new_ip,new_sp) do { \ set_fs(USER_DS); \ - ia64_psr(regs)->dfh = 1; /* disable fph */ \ - ia64_psr(regs)->mfh = 0; /* clear mfh */ \ - ia64_psr(regs)->cpl = 3; /* set user mode */ \ - ia64_psr(regs)->ri = 0; /* clear return slot number */ \ - ia64_psr(regs)->is = 0; /* IA-64 instruction set */ \ + regs->cr_ipsr = ((regs->cr_ipsr | (IA64_PSR_BITS_TO_SET | IA64_PSR_CPL | IA64_PSR_SP)) \ + & ~(IA64_PSR_BITS_TO_CLEAR | IA64_PSR_RI | IA64_PSR_IS)); \ regs->cr_iip = new_ip; \ regs->ar_rsc = 0xf; /* eager mode, privilege level 3 */ \ regs->ar_rnat = 0; \ @@ -542,11 +451,6 @@ extern void ia32_load_state (struct task_struct *task); #endif -#ifdef CONFIG_PERFMON -extern void ia64_save_pm_regs (struct task_struct *task); -extern void ia64_load_pm_regs (struct task_struct *task); -#endif - #define ia64_fph_enable() asm volatile (";; rsm psr.dfh;; srlz.d;;" ::: "memory"); #define ia64_fph_disable() asm volatile (";; ssm psr.dfh;; srlz.d;;" ::: "memory"); @@ -646,9 +550,22 @@ * interrupt enable bits. Don't trigger any mandatory RSE references while this bit is * off! */ -#define ia64_clear_ic(flags) \ - asm volatile ("mov %0=psr;; rsm psr.i | psr.ic;; srlz.i;;" \ - : "=r"(flags) :: "memory"); +static inline __u64 +ia64_clear_ic (void) +{ + __u64 psr; + asm volatile ("mov %0=psr;; rsm psr.i | psr.ic;; srlz.i;;" : "=r"(psr) :: "memory"); + return psr; +} + +/* + * Restore the psr. + */ +static inline void +ia64_set_psr (__u64 psr) +{ + asm volatile (";; mov psr.l=%0;; srlz.d" :: "r" (psr) : "memory"); +} /* * Insert a translation into an instruction and/or data translation diff -urN linux-2.4.18/include/asm-ia64/ptrace.h lia64-2.4/include/asm-ia64/ptrace.h --- linux-2.4.18/include/asm-ia64/ptrace.h Tue Jul 31 10:30:09 2001 +++ lia64-2.4/include/asm-ia64/ptrace.h Fri Jul 19 23:20:15 2002 @@ -247,8 +247,34 @@ #endif /* !__KERNEL__ */ +/* pt_all_user_regs is used for PTRACE_GETREGS PTRACE_SETREGS */ +struct pt_all_user_regs { + unsigned long nat; + unsigned long cr_iip; + unsigned long cfm; + unsigned long cr_ipsr; + unsigned long pr; + + unsigned long gr[32]; + unsigned long br[8]; + unsigned long ar[128]; + struct ia64_fpreg fr[128]; +}; + #endif /* !__ASSEMBLY__ */ +/* indices to application-registers array in pt_all_user_regs */ +#define PT_AUR_RSC 16 +#define PT_AUR_BSP 17 +#define PT_AUR_BSPSTORE 18 +#define PT_AUR_RNAT 19 +#define PT_AUR_CCV 32 +#define PT_AUR_UNAT 36 +#define PT_AUR_FPSR 40 +#define PT_AUR_PFS 64 +#define PT_AUR_LC 65 +#define PT_AUR_EC 66 + /* * The numbers chosen here are somewhat arbitrary but absolutely MUST * not overlap with any of the number assigned in . @@ -256,5 +282,7 @@ #define PTRACE_SINGLEBLOCK 12 /* resume execution until next branch */ #define PTRACE_GETSIGINFO 13 /* get child's siginfo structure */ #define PTRACE_SETSIGINFO 14 /* set child's siginfo structure */ +#define PTRACE_GETREGS 18 /* get all registers (pt_all_user_regs) in one shot */ +#define PTRACE_SETREGS 19 /* set all registers (pt_all_user_regs) in one shot */ #endif /* _ASM_IA64_PTRACE_H */ diff -urN linux-2.4.18/include/asm-ia64/sal.h lia64-2.4/include/asm-ia64/sal.h --- linux-2.4.18/include/asm-ia64/sal.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/sal.h Fri Jul 19 23:20:28 2002 @@ -8,11 +8,14 @@ * Abstraction Layer". * * Copyright (C) 2001 Intel + * Copyright (C) 2002 Jenna Hall * Copyright (C) 2001 Fred Lewis * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang * Copyright (C) 1999 Srinivasa Prasad Thirumalachar * + * 02/01/04 J. Hall Updated Error Record Structures to conform to July 2001 + * revision of the SAL spec. * 01/01/03 fvlewis Updated Error Record Structures to conform with Nov. 2000 * revision of the SAL spec. * 99/09/29 davidm Updated for SAL 2.6. @@ -149,6 +152,7 @@ #define IA64_SAL_PLATFORM_FEATURE_BUS_LOCK (1 << 0) #define IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT (1 << 1) #define IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT (1 << 2) +#define IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT (1 << 3) typedef struct ia64_sal_desc_platform_feature { u8 type; @@ -227,38 +231,42 @@ SAL_VECTOR_OS_BOOT_RENDEZ = 2 }; +/* Encodings for mca_opt parameter sent to SAL_MC_SET_PARAMS */ +#define SAL_MC_PARAM_RZ_ALWAYS 0x1 +#define SAL_MC_PARAM_BINIT_ESCALATE 0x10 + /* ** Definition of the SAL Error Log from the SAL spec */ /* SAL Error Record Section GUID Definitions */ #define SAL_PROC_DEV_ERR_SECT_GUID \ - ((efi_guid_t) { 0xe429faf1, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ - 0xc7, 0x3c, 0x88, 0x81 }} ) + EFI_GUID ( 0xe429faf1, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \ + 0xc7, 0x3c, 0x88, 0x81 ) #define SAL_PLAT_MEM_DEV_ERR_SECT_GUID \ - ((efi_guid_t) { 0xe429faf2, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ - 0xc7, 0x3c, 0x88, 0x81 }} ) + EFI_GUID( 0xe429faf2, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \ + 0xc7, 0x3c, 0x88, 0x81 ) #define SAL_PLAT_SEL_DEV_ERR_SECT_GUID \ - ((efi_guid_t) { 0xe429faf3, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ - 0xc7, 0x3c, 0x88, 0x81 }} ) + EFI_GUID( 0xe429faf3, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \ + 0xc7, 0x3c, 0x88, 0x81 ) #define SAL_PLAT_PCI_BUS_ERR_SECT_GUID \ - ((efi_guid_t) { 0xe429faf4, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ - 0xc7, 0x3c, 0x88, 0x81 }} ) + EFI_GUID( 0xe429faf4, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \ + 0xc7, 0x3c, 0x88, 0x81 ) #define SAL_PLAT_SMBIOS_DEV_ERR_SECT_GUID \ - ((efi_guid_t) { 0xe429faf5, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ - 0xc7, 0x3c, 0x88, 0x81 }} ) + EFI_GUID( 0xe429faf5, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \ + 0xc7, 0x3c, 0x88, 0x81 ) #define SAL_PLAT_PCI_COMP_ERR_SECT_GUID \ - ((efi_guid_t) { 0xe429faf6, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ - 0xc7, 0x3c, 0x88, 0x81 }} ) + EFI_GUID( 0xe429faf6, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \ + 0xc7, 0x3c, 0x88, 0x81 ) #define SAL_PLAT_SPECIFIC_ERR_SECT_GUID \ - ((efi_guid_t) { 0xe429faf7, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ - 0xc7, 0x3c, 0x88, 0x81 }} ) + EFI_GUID( 0xe429faf7, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \ + 0xc7, 0x3c, 0x88, 0x81 ) #define SAL_PLAT_HOST_CTLR_ERR_SECT_GUID \ - ((efi_guid_t) { 0xe429faf8, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ - 0xc7, 0x3c, 0x88, 0x81 }} ) + EFI_GUID( 0xe429faf8, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \ + 0xc7, 0x3c, 0x88, 0x81 ) #define SAL_PLAT_BUS_ERR_SECT_GUID \ - ((efi_guid_t) { 0xe429faf9, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \ - 0xc7, 0x3c, 0x88, 0x81 }} ) + EFI_GUID( 0xe429faf9, 0x3cb7, 0x11d4, 0xbc, 0xa7, 0x0, 0x80, \ + 0xc7, 0x3c, 0x88, 0x81 ) #define MAX_CACHE_ERRORS 6 #define MAX_TLB_ERRORS 6 @@ -515,12 +523,12 @@ { u16 vendor_id; u16 device_id; - u16 class_code; + u8 class_code[3]; u8 func_num; u8 dev_num; u8 bus_num; u8 seg_num; - u8 reserved[6]; + u8 reserved[5]; } comp_info; u32 num_mem_regs; u32 num_io_regs; @@ -775,5 +783,7 @@ *scratch_buf_size_needed = isrv.v1; return isrv.status; } + +extern unsigned long sal_platform_features; #endif /* _ASM_IA64_PAL_H */ diff -urN linux-2.4.18/include/asm-ia64/scatterlist.h lia64-2.4/include/asm-ia64/scatterlist.h --- linux-2.4.18/include/asm-ia64/scatterlist.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/scatterlist.h Tue Jan 15 15:18:39 2002 @@ -2,7 +2,7 @@ #define _ASM_IA64_SCATTERLIST_H /* - * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co + * Copyright (C) 1998-1999, 2001-2002 Hewlett-Packard Co * David Mosberger-Tang */ @@ -14,7 +14,6 @@ /* These two are only valid if ADDRESS member of this struct is NULL. */ struct page *page; unsigned int offset; - unsigned int length; /* buffer length */ }; diff -urN linux-2.4.18/include/asm-ia64/serial.h lia64-2.4/include/asm-ia64/serial.h --- linux-2.4.18/include/asm-ia64/serial.h Sun Feb 6 18:42:40 2000 +++ lia64-2.4/include/asm-ia64/serial.h Fri Jul 19 18:50:04 2002 @@ -59,6 +59,20 @@ { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ +/* + * HCDP_SERIAL_PORT_DEFNS should be placed in exactly the same slot + * in rs_table as defined by HCDP_SERIAL_CONSOLE_PORT in + * include/linux/serial.h + */ +#define HCDP_SERIAL_PORT_DEFNS \ + { 0, BASE_BAUD, -1, 0, STD_COM_FLAGS}, /* ttySx device + in comments sucks. + You add an entry + and you get to edit + boatloads of these + comments. Not worth + it */ + #ifdef CONFIG_SERIAL_MANY_PORTS #define EXTRA_SERIAL_PORT_DEFNS \ @@ -129,6 +143,7 @@ #define SERIAL_PORT_DFNS \ STD_SERIAL_PORT_DEFNS \ + HCDP_SERIAL_PORT_DEFNS \ EXTRA_SERIAL_PORT_DEFNS \ HUB6_SERIAL_PORT_DFNS \ MCA_SERIAL_PORT_DFNS diff -urN linux-2.4.18/include/asm-ia64/sigcontext.h lia64-2.4/include/asm-ia64/sigcontext.h --- linux-2.4.18/include/asm-ia64/sigcontext.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/sigcontext.h Fri Dec 28 16:37:17 2001 @@ -56,7 +56,9 @@ unsigned long sc_rbs_base; /* NULL or new base of sighandler's rbs */ unsigned long sc_loadrs; /* see description above */ - unsigned long sc_rsvd[14]; /* reserved for future use */ + unsigned long sc_ar25; /* rsvd for scratch use */ + unsigned long sc_ar26; /* rsvd for scratch use */ + unsigned long sc_rsvd[12]; /* reserved for future use */ /* * The mask must come last so we can increase _NSIG_WORDS * without breaking binary compatibility. diff -urN linux-2.4.18/include/asm-ia64/siginfo.h lia64-2.4/include/asm-ia64/siginfo.h --- linux-2.4.18/include/asm-ia64/siginfo.h Wed Dec 26 16:58:57 2001 +++ lia64-2.4/include/asm-ia64/siginfo.h Mon May 6 18:04:23 2002 @@ -2,8 +2,8 @@ #define _ASM_IA64_SIGINFO_H /* - * Copyright (C) 1998-2001 Hewlett-Packard Co - * Copyright (C) 1998-2001 David Mosberger-Tang + * Copyright (C) 1998-2002 Hewlett-Packard Co + * David Mosberger-Tang */ #include @@ -57,7 +57,7 @@ struct { void *_addr; /* faulting insn/memory ref. */ int _imm; /* immediate value for "break" */ - int _pad0; + unsigned int _flags; /* see below */ unsigned long _isr; /* isr */ } _sigfault; @@ -70,7 +70,7 @@ struct { pid_t _pid; /* which child */ uid_t _uid; /* sender's uid */ - unsigned long _pfm_ovfl_counters; /* which PMU counter overflowed */ + unsigned long _pfm_ovfl_counters[4]; /* which PMU counter overflowed */ } _sigprof; } _sifields; } siginfo_t; @@ -88,12 +88,23 @@ #define si_ptr _sifields._rt._sigval.sival_ptr #define si_addr _sifields._sigfault._addr #define si_imm _sifields._sigfault._imm /* as per UNIX SysV ABI spec */ -#define si_isr _sifields._sigfault._isr /* valid if si_code==FPE_FLTxxx */ +#define si_flags _sifields._sigfault._flags +/* + * si_isr is valid for SIGILL, SIGFPE, SIGSEGV, SIGBUS, and SIGTRAP provided that + * si_code is non-zero and __ISR_VALID is set in si_flags. + */ +#define si_isr _sifields._sigfault._isr #define si_band _sifields._sigpoll._band #define si_fd _sifields._sigpoll._fd #define si_pfm_ovfl _sifields._sigprof._pfm_ovfl_counters /* + * Flag values for si_flags: + */ +#define __ISR_VALID_BIT 0 +#define __ISR_VALID (1 << __ISR_VALID_BIT) + +/* * si_code values * Positive values for kernel-generated signals. */ @@ -141,7 +152,8 @@ #define ILL_BADSTK (__SI_FAULT|8) /* internal stack error */ #define ILL_BADIADDR (__SI_FAULT|9) /* unimplemented instruction address */ #define __ILL_BREAK (__SI_FAULT|10) /* illegal break */ -#define NSIGILL 10 +#define __ILL_BNDMOD (__SI_FAULT|11) /* bundle-update (modification) in progress */ +#define NSIGILL 11 /* * SIGFPE si_codes diff -urN linux-2.4.18/include/asm-ia64/signal.h lia64-2.4/include/asm-ia64/signal.h --- linux-2.4.18/include/asm-ia64/signal.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/signal.h Mon May 6 18:04:23 2002 @@ -115,6 +115,7 @@ #define SA_PROBE SA_ONESHOT #define SA_SAMPLE_RANDOM SA_RESTART #define SA_SHIRQ 0x04000000 +#define SA_PERCPU_IRQ 0x02000000 #endif /* __KERNEL__ */ diff -urN linux-2.4.18/include/asm-ia64/sn/addrs.h lia64-2.4/include/asm-ia64/sn/addrs.h --- linux-2.4.18/include/asm-ia64/sn/addrs.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/addrs.h Fri Jul 19 23:20:15 2002 @@ -1,40 +1,42 @@ -/* $Id$ + +/* * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc. - * Copyright (C) 1999 by Ralf Baechle + * Copyright (c) 1992-1999,2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_ADDRS_H -#define _ASM_SN_ADDRS_H -#include -#if _LANGUAGE_C -#include -#endif /* _LANGUAGE_C */ - -#if !defined(CONFIG_IA64_SGI_SN1) && !defined(CONFIG_IA64_GENERIC) -#include -#include -#include -#endif /* CONFIG_IA64_SGI_SN1 */ +#ifndef _ASM_IA64_SN_ADDRS_H +#define _ASM_IA64_SN_ADDRS_H + +#include -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) +#if defined (CONFIG_IA64_SGI_SN1) #include -#endif +#elif defined (CONFIG_IA64_SGI_SN2) +#include +#else +#error <<>> +#endif /* !SN1 && !SN2 */ +#ifndef __ASSEMBLY__ +#include +#endif -#if _LANGUAGE_C +#ifndef __ASSEMBLY__ #define PS_UINT_CAST (__psunsigned_t) #define UINT64_CAST (uint64_t) - +#ifdef CONFIG_IA64_SGI_SN2 +#define HUBREG_CAST (volatile mmr_t *) +#else #define HUBREG_CAST (volatile hubreg_t *) +#endif -#elif _LANGUAGE_ASSEMBLY +#elif __ASSEMBLY__ #define PS_UINT_CAST #define UINT64_CAST @@ -43,18 +45,6 @@ #endif -#define NASID_GET_META(_n) ((_n) >> NASID_LOCAL_BITS) -#if defined CONFIG_SGI_IP35 || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#define NASID_GET_LOCAL(_n) ((_n) & 0x7f) -#endif -#define NASID_MAKE(_m, _l) (((_m) << NASID_LOCAL_BITS) | (_l)) - -#define NODE_ADDRSPACE_MASK (NODE_ADDRSPACE_SIZE - 1) -#define TO_NODE_ADDRSPACE(_pa) (UINT64_CAST (_pa) & NODE_ADDRSPACE_MASK) - -#define CHANGE_ADDR_NASID(_pa, _nasid) \ - ((UINT64_CAST (_pa) & ~NASID_MASK) | \ - (UINT64_CAST(_nasid) << NASID_SHFT)) /* @@ -62,7 +52,11 @@ * node's address space. */ +#ifdef CONFIG_IA64_SGI_SN2 /* SN2 has an extra AS field between node offset and node id (nasid) */ +#define NODE_OFFSET(_n) (UINT64_CAST (_n) << NASID_SHFT) +#else #define NODE_OFFSET(_n) (UINT64_CAST (_n) << NODE_SIZE_BITS) +#endif #define NODE_CAC_BASE(_n) (CAC_BASE + NODE_OFFSET(_n)) #define NODE_HSPEC_BASE(_n) (HSPEC_BASE + NODE_OFFSET(_n)) @@ -118,11 +112,6 @@ /* * The following define the major position-independent aliases used * in SN. - * UALIAS -- 256MB in size, reads in the UALIAS result in - * uncached references to the memory of the reader's node. - * CPU_UALIAS -- 128kb in size, the bottom part of UALIAS is flipped - * depending on which CPU does the access to provide - * all CPUs with unique uncached memory at low addresses. * LBOOT -- 256MB in size, reads in the LBOOT area result in * uncached references to the local hub's boot prom and * other directory-bus connected devices. @@ -130,17 +119,7 @@ * references to the local hub's registers. */ -#define UALIAS_BASE HSPEC_BASE -#define UALIAS_SIZE 0x10000000 /* 256 Megabytes */ -#define CPU_UALIAS 0x20000 /* 128 Kilobytes */ -#define UALIAS_CPU_SIZE (CPU_UALIAS / CPUS_PER_NODE) -#define UALIAS_LIMIT (UALIAS_BASE + UALIAS_SIZE) - -/* - * The bottom of ualias space is flipped depending on whether you're - * processor 0 or 1 within a node. - */ -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) +#if defined CONFIG_IA64_SGI_SN1 #define LREG_BASE (HSPEC_BASE + 0x10000000) #define LREG_SIZE 0x8000000 /* 128 MB */ #define LREG_LIMIT (LREG_BASE + LREG_SIZE) @@ -151,7 +130,11 @@ #endif #define HUB_REGISTER_WIDGET 1 +#ifdef CONFIG_IA64_SGI_SN2 +#define IALIAS_BASE LOCAL_SWIN_BASE(HUB_REGISTER_WIDGET) +#else #define IALIAS_BASE NODE_SWIN_BASE(0, HUB_REGISTER_WIDGET) +#endif #define IALIAS_SIZE 0x800000 /* 8 Megabytes */ #define IS_IALIAS(_a) (((_a) >= IALIAS_BASE) && \ ((_a) < (IALIAS_BASE + IALIAS_SIZE))) @@ -160,7 +143,7 @@ * Macro for referring to Hub's RBOOT space */ -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) +#if defined CONFIG_IA64_SGI_SN1 #define NODE_LREG_BASE(_n) (NODE_HSPEC_BASE(_n) + 0x30000000) #define NODE_LREG_LIMIT(_n) (NODE_LREG_BASE(_n) + LREG_SIZE) @@ -172,168 +155,6 @@ #endif -/* - * Macros for referring the Hub's back door space - * - * These macros correctly process addresses in any node's space. - * WARNING: They won't work in assembler. - * - * BDDIR_ENTRY_LO returns the address of the low double-word of the dir - * entry corresponding to a physical (Cac or Uncac) address. - * BDDIR_ENTRY_HI returns the address of the high double-word of the entry. - * BDPRT_ENTRY returns the address of the double-word protection entry - * corresponding to the page containing the physical address. - * BDPRT_ENTRY_S Stores the value into the protection entry. - * BDPRT_ENTRY_L Load the value from the protection entry. - * BDECC_ENTRY returns the address of the ECC byte corresponding to a - * double-word at a specified physical address. - * BDECC_ENTRY_H returns the address of the two ECC bytes corresponding to a - * quad-word at a specified physical address. - */ -#define NODE_BDOOR_BASE(_n) (NODE_HSPEC_BASE(_n) + (NODE_ADDRSPACE_SIZE/2)) - -#define NODE_BDECC_BASE(_n) (NODE_BDOOR_BASE(_n)) -#define NODE_BDDIR_BASE(_n) (NODE_BDOOR_BASE(_n) + (NODE_ADDRSPACE_SIZE/4)) -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -/* - * Bedrock's directory entries are a single word: no low/high - */ - -#define BDDIR_ENTRY(_pa) (HSPEC_BASE + \ - NODE_ADDRSPACE_SIZE * 7 / 8 | \ - UINT64_CAST (_pa) & NASID_MASK | \ - UINT64_CAST (_pa) >> 3 & BDDIR_UPPER_MASK) - -#ifdef BRINGUP - /* minimize source changes by mapping *_LO() & *_HI() */ -#define BDDIR_ENTRY_LO(_pa) BDDIR_ENTRY(_pa) -#define BDDIR_ENTRY_HI(_pa) BDDIR_ENTRY(_pa) -#endif /* BRINGUP */ - -#define BDDIR_PAGE_MASK (BDDIR_UPPER_MASK & 0x7ffff << 11) -#define BDDIR_PAGE_BASE_MASK (UINT64_CAST 0xfffffffffffff800) - -#ifdef _LANGUAGE_C - -#define BDPRT_ENTRY_ADDR(_pa, _rgn) ((uint64_t *) ( (HSPEC_BASE + \ - NODE_ADDRSPACE_SIZE * 7 / 8 + 0x408) | \ - (UINT64_CAST (_pa) & NASID_MASK) | \ - (UINT64_CAST (_pa) >> 3 & BDDIR_PAGE_MASK) | \ - (UINT64_CAST (_pa) >> 3 & 0x3 << 4) | \ - ((_rgn) & 0x1e) << 5)) - -static __inline uint64_t BDPRT_ENTRY_L(paddr_t pa,uint32_t rgn) { - uint64_t word=*BDPRT_ENTRY_ADDR(pa,rgn); - - if(rgn&0x20) /*If the region is > 32, move it down*/ - word = word >> 32; - if(rgn&0x1) /*If the region is odd, get that part */ - word = word >> 16; - word = word & 0xffff; /*Get the 16 bits we are interested in*/ - - return word; -} - -static __inline void BDPRT_ENTRY_S(paddr_t pa,uint32_t rgn,uint64_t val) { - uint64_t *addr=(uint64_t *)BDPRT_ENTRY_ADDR(pa,rgn); - uint64_t word,mask; - - word=*addr; - mask=0; - if(rgn&0x1) { - mask|=0x0000ffff0000ffff; - val=val<<16; - } - else - mask|=0xffff0000ffff0000; - if(rgn&0x20) { - mask|=0x00000000ffffffff; - val=val<<32; - } - else - mask|=0xffffffff00000000; - word &= mask; - word |= val; - - *(addr++)=word; - addr++; - *(addr++)=word; - addr++; - *(addr++)=word; - addr++; - *addr=word; -} -#endif /*_LANGUAGE_C*/ - -#define BDCNT_ENTRY(_pa) (HSPEC_BASE + \ - NODE_ADDRSPACE_SIZE * 7 / 8 + 0x8 | \ - UINT64_CAST (_pa) & NASID_MASK | \ - UINT64_CAST (_pa) >> 3 & BDDIR_PAGE_MASK | \ - UINT64_CAST (_pa) >> 3 & 0x3 << 4) - - -#ifdef BRINGUP - /* little endian packing of ecc bytes requires a swizzle */ - /* this is problemmatic for memory_init_ecc */ -#endif /* BRINGUP */ -#define BDECC_ENTRY(_pa) (HSPEC_BASE + \ - NODE_ADDRSPACE_SIZE * 5 / 8 | \ - UINT64_CAST (_pa) & NASID_MASK | \ - UINT64_CAST (_pa) >> 3 & BDECC_UPPER_MASK \ - ^ 0x7ULL) - -#define BDECC_SCRUB(_pa) (HSPEC_BASE + \ - NODE_ADDRSPACE_SIZE / 2 | \ - UINT64_CAST (_pa) & NASID_MASK | \ - UINT64_CAST (_pa) >> 3 & BDECC_UPPER_MASK \ - ^ 0x7ULL) - - /* address for Halfword backdoor ecc access. Note that */ - /* ecc bytes are packed in little endian order */ -#define BDECC_ENTRY_H(_pa) (HSPEC_BASE + \ - NODE_ADDRSPACE_SIZE * 5 / 8 | \ - UINT64_CAST (_pa) & NASID_MASK | \ - UINT64_CAST (_pa) >> 3 & BDECC_UPPER_MASK \ - ^ 0x6ULL) - -/* - * Macro to convert a back door directory, protection, page counter, or ecc - * address into the raw physical address of the associated cache line - * or protection page. - */ - -#define BDDIR_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ - (UINT64_CAST (_ba) & BDDIR_UPPER_MASK) << 3) - -#ifdef BRINGUP -/* - * This can't be done since there are 4 entries per address so you'd end up - * mapping back to 4 different physical addrs. - */ - -#define BDPRT_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ - (UINT64_CAST (_ba) & BDDIR_PAGE_MASK) << 3 | \ - (UINT64_CAST (_ba) & 0x3 << 4) << 3) -#endif - -#define BDCNT_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ - (UINT64_CAST (_ba) & BDDIR_PAGE_MASK) << 3 | \ - (UINT64_CAST (_ba) & 0x3 << 4) << 3) - -#define BDECC_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ - ((UINT64_CAST (_ba) ^ 0x7ULL) \ - & BDECC_UPPER_MASK) << 3 ) - -#define BDECC_H_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \ - ((UINT64_CAST (_ba) ^ 0x6ULL) \ - & BDECC_UPPER_MASK) << 3 ) - -#define BDADDR_IS_DIR(_ba) ((UINT64_CAST (_ba) & 0x8) == 0) -#define BDADDR_IS_PRT(_ba) ((UINT64_CAST (_ba) & 0x408) == 0x408) -#define BDADDR_IS_CNT(_ba) ((UINT64_CAST (_ba) & 0x8) == 0x8) - -#endif /* CONFIG_SGI_IP35 */ - /* * The following macros produce the correct base virtual address for @@ -344,6 +165,36 @@ * for _x. */ + +#ifdef CONFIG_IA64_SGI_SN2 +/* + * SN2 has II mmr's located inside small window space like SN0 & SN1, + * but has all other non-II mmr's located at the top of big window + * space, unlike SN0 & SN1. + */ +#define LOCAL_HUB_BASE(_x) (LOCAL_MMR_ADDR(_x) | (((~(_x)) & BWIN_TOP)>>8)) +#define REMOTE_HUB_BASE(_x) \ + (UNCACHED | GLOBAL_MMR_SPACE | \ + (((~(_x)) & BWIN_TOP)>>8) | \ + (((~(_x)) & BWIN_TOP)>>9) | (_x)) + +#define LOCAL_HUB(_x) (HUBREG_CAST LOCAL_HUB_BASE(_x)) +#define REMOTE_HUB(_n, _x) \ + (HUBREG_CAST (REMOTE_HUB_BASE(_x) | ((((long)(_n))<offset + \ - KLD_LAUNCH(nasid)->stride * (slice)) -#define LAUNCH_ADDR(nasid, slice) \ - TO_NODE_UNCAC((nasid), LAUNCH_OFFSET(nasid, slice)) -#define LAUNCH_SIZE(nasid) KLD_LAUNCH(nasid)->size - -#define NMI_OFFSET(nasid, slice) \ - (KLD_NMI(nasid)->offset + \ - KLD_NMI(nasid)->stride * (slice)) -#define NMI_ADDR(nasid, slice) \ - TO_NODE_UNCAC((nasid), NMI_OFFSET(nasid, slice)) -#define NMI_SIZE(nasid) KLD_NMI(nasid)->size - +#ifndef CONFIG_IA64_SGI_SN2 #define KLCONFIG_OFFSET(nasid) KLD_KLCONFIG(nasid)->offset +#else +#define KLCONFIG_OFFSET(nasid) \ + ia64_sn_get_klconfig_addr(nasid) +#endif /* CONFIG_IA64_SGI_SN2 */ + #define KLCONFIG_ADDR(nasid) \ - TO_NODE_UNCAC((nasid), KLCONFIG_OFFSET(nasid)) + TO_NODE_CAC((nasid), KLCONFIG_OFFSET(nasid)) #define KLCONFIG_SIZE(nasid) KLD_KLCONFIG(nasid)->size #define GDA_ADDR(nasid) KLD_GDA(nasid)->pointer #define GDA_SIZE(nasid) KLD_GDA(nasid)->size -#define SYMMON_STK_OFFSET(nasid, slice) \ - (KLD_SYMMON_STK(nasid)->offset + \ - KLD_SYMMON_STK(nasid)->stride * (slice)) -#define SYMMON_STK_STRIDE(nasid) KLD_SYMMON_STK(nasid)->stride - -#define SYMMON_STK_ADDR(nasid, slice) \ - TO_NODE_CAC((nasid), SYMMON_STK_OFFSET(nasid, slice)) - -#define SYMMON_STK_SIZE(nasid) KLD_SYMMON_STK(nasid)->stride - -#define SYMMON_STK_END(nasid) (SYMMON_STK_ADDR(nasid, 0) + KLD_SYMMON_STK(nasid)->size) - -/* loading symmon 4k below UNIX. the arcs loader needs the topaddr for a - * relocatable program - */ -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -/* update master.d/sn1_elspec.dbg, SN1/addrs.h/DEBUGUNIX_ADDR, and - * DBGLOADADDR in symmon's Makefile when changing this */ -#define UNIX_DEBUG_LOADADDR 0x310000 -#elif defined(SN0XXL) -#define UNIX_DEBUG_LOADADDR 0x360000 -#else -#define UNIX_DEBUG_LOADADDR 0x300000 -#endif -#define SYMMON_LOADADDR(nasid) \ - TO_NODE(nasid, PHYS_TO_K0(UNIX_DEBUG_LOADADDR - 0x1000)) - -#define FREEMEM_OFFSET(nasid) KLD_FREEMEM(nasid)->offset -#define FREEMEM_ADDR(nasid) SYMMON_STK_END(nasid) -/* - * XXX - * Fix this. FREEMEM_ADDR should be aware of if symmon is loaded. - * Also, it should take into account what prom thinks to be a safe - * address - PHYS_TO_K0(NODE_OFFSET(nasid) + FREEMEM_OFFSET(nasid)) - */ -#define FREEMEM_SIZE(nasid) KLD_FREEMEM(nasid)->size - -#define PI_ERROR_OFFSET(nasid) KLD_PI_ERROR(nasid)->offset -#define PI_ERROR_ADDR(nasid) \ - TO_NODE_UNCAC((nasid), PI_ERROR_OFFSET(nasid)) -#define PI_ERROR_SIZE(nasid) KLD_PI_ERROR(nasid)->size - #define NODE_OFFSET_TO_K0(_nasid, _off) \ (PAGE_OFFSET | NODE_OFFSET(_nasid) | (_off)) -#define K0_TO_NODE_OFFSET(_k0addr) \ - ((__psunsigned_t)(_k0addr) & NODE_ADDRSPACE_MASK) - -#define KERN_VARS_ADDR(nasid) KLD_KERN_VARS(nasid)->pointer -#define KERN_VARS_SIZE(nasid) KLD_KERN_VARS(nasid)->size - -#define KERN_XP_ADDR(nasid) KLD_KERN_XP(nasid)->pointer -#define KERN_XP_SIZE(nasid) KLD_KERN_XP(nasid)->size - -#define GPDA_ADDR(nasid) TO_NODE_CAC(nasid, GPDA_OFFSET) - -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ -#endif /* _ASM_SN_ADDRS_H */ +#endif /* _ASM_IA64_SN_ADDRS_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/agent.h lia64-2.4/include/asm-ia64/sn/agent.h --- linux-2.4.18/include/asm-ia64/sn/agent.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/agent.h Wed Dec 31 16:00:00 1969 @@ -1,47 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * This file has definitions for the hub and snac interfaces. - * - * Copyright (C) 1992 - 1997, 1999 Silcon Graphics, Inc. - * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) - */ -#ifndef _ASM_SGI_SN_AGENT_H -#define _ASM_SGI_SN_AGENT_H - -#include - -#include -#include -//#include - -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#include -#endif /* CONFIG_SGI_IP35 */ - -/* - * NIC register macros - */ - -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#define HUB_NIC_ADDR(_cpuid) \ - REMOTE_HUB_ADDR(COMPACT_TO_NASID_NODEID(cputocnode(_cpuid)), \ - LB_MICROLAN_CTL) -#endif - -#define SET_HUB_NIC(_my_cpuid, _val) \ - (HUB_S(HUB_NIC_ADDR(_my_cpuid), (_val))) - -#define SET_MY_HUB_NIC(_v) \ - SET_HUB_NIC(cpuid(), (_v)) - -#define GET_HUB_NIC(_my_cpuid) \ - (HUB_L(HUB_NIC_ADDR(_my_cpuid))) - -#define GET_MY_HUB_NIC() \ - GET_HUB_NIC(cpuid()) - -#endif /* _ASM_SGI_SN_AGENT_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/alenlist.h lia64-2.4/include/asm-ia64/sn/alenlist.h --- linux-2.4.18/include/asm-ia64/sn/alenlist.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/alenlist.h Mon May 6 18:04:24 2002 @@ -4,11 +4,12 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_ALENLIST_H -#define _ASM_SN_ALENLIST_H +#ifndef _ASM_IA64_SN_ALENLIST_H +#define _ASM_IA64_SN_ALENLIST_H + +#include /* Definition of Address/Length List */ @@ -51,7 +52,7 @@ /* Return codes from alenlist routines. */ -#define ALENLIST_FAILURE -1 +#define ALENLIST_FAILURE (-1) #define ALENLIST_SUCCESS 0 @@ -201,4 +202,4 @@ } #endif -#endif /* _ASM_SN_ALENLIST_H */ +#endif /* _ASM_IA64_SN_ALENLIST_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/arc/hinv.h lia64-2.4/include/asm-ia64/sn/arc/hinv.h --- linux-2.4.18/include/asm-ia64/sn/arc/hinv.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/arc/hinv.h Mon Nov 19 23:22:54 2001 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Jack Steiner (steiner@sgi.com) + * Copyright (C) 2000-2001 Silicon Graphics, Inc. All rights reserved. */ diff -urN linux-2.4.18/include/asm-ia64/sn/arc/types.h lia64-2.4/include/asm-ia64/sn/arc/types.h --- linux-2.4.18/include/asm-ia64/sn/arc/types.h Thu Apr 12 12:16:36 2001 +++ lia64-2.4/include/asm-ia64/sn/arc/types.h Mon Nov 19 23:22:54 2001 @@ -4,7 +4,7 @@ * for more details. * * Copyright 1999 Ralf Baechle (ralf@gnu.org) - * Copyright 1999 Silicon Graphics, Inc. + * Copyright 1999,2001 Silicon Graphics, Inc. */ #ifndef _ASM_SN_ARC_TYPES_H #define _ASM_SN_ARC_TYPES_H diff -urN linux-2.4.18/include/asm-ia64/sn/arch.h lia64-2.4/include/asm-ia64/sn/arch.h --- linux-2.4.18/include/asm-ia64/sn/arch.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/arch.h Fri Jul 19 23:20:15 2002 @@ -6,180 +6,50 @@ * * SGI specific setup. * - * Copyright (C) 1995 - 1997, 1999 Silcon Graphics, Inc. + * Copyright (C) 1995-1997,1999,2001-2002 Silicon Graphics, Inc. All rights reserved. * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) */ -#ifndef _ASM_SN_ARCH_H -#define _ASM_SN_ARCH_H +#ifndef _ASM_IA64_SN_ARCH_H +#define _ASM_IA64_SN_ARCH_H -#include #include - +#include +#include #include -#if defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_SGI_IP37) || defined(CONFIG_IA64_GENERIC) + +#if defined(CONFIG_IA64_SGI_SN1) #include +#elif defined(CONFIG_IA64_SGI_SN2) +#include #endif -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) +#if defined(CONFIG_IA64_SGI_SN1) +typedef u64 bdrkreg_t; +#elif defined(CONFIG_IA64_SGI_SN2) +typedef u64 shubreg_t; +#endif + typedef u64 hubreg_t; +typedef u64 mmr_t; typedef u64 nic_t; -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -typedef u64 bdrkreg_t; -#endif /* CONFIG_SGI_xxxxx */ -#endif /* _LANGUAGE_C || _LANGUAGE_C_PLUS_PLUS */ - -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#define CPUS_PER_NODE 4 /* CPUs on a single hub */ -#define CPUS_PER_NODE_SHFT 2 /* Bits to shift in the node number */ -#define CPUS_PER_SUBNODE 2 /* CPUs on a single hub PI */ -#endif -#define CNODE_NUM_CPUS(_cnode) (NODEPDA(_cnode)->node_num_cpus) #define CNODE_TO_CPU_BASE(_cnode) (NODEPDA(_cnode)->node_first_cpu) -#define makespnum(_nasid, _slice) \ - (((_nasid) << CPUS_PER_NODE_SHFT) | (_slice)) - -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) - -/* - * There are 2 very similar macros for dealing with "slices". Make sure - * you use the right one. - * Unfortunately, on all platforms except IP35 (currently), the 2 macros - * are interchangible. - * - * On IP35, there are 4 cpus per node. Each cpu is refered to by it's slice. - * The slices are numbered 0 thru 3. - * - * There are also 2 PI interfaces per node. Each PI interface supports 2 cpus. - * The term "local slice" specifies the cpu number relative to the PI. - * - * The cpus on the node are numbered: - * slice localslice - * 0 0 - * 1 1 - * 2 0 - * 3 1 - * - * cputoslice - returns a number 0..3 that is the slice of the specified cpu. - * cputolocalslice - returns a number 0..1 that identifies the local slice of - * the cpu within it's PI interface. - */ -#ifdef LATER - /* These are dummied up for now ..... */ -#define cputocnode(cpu) \ - (pdaindr[(cpu)].p_nodeid) -#define cputonasid(cpu) \ - (pdaindr[(cpu)].p_nasid) -#define cputoslice(cpu) \ - (ASSERT(pdaindr[(cpu)].pda), (pdaindr[(cpu)].pda->p_slice)) -#define cputolocalslice(cpu) \ - (ASSERT(pdaindr[(cpu)].pda), (LOCALCPU(pdaindr[(cpu)].pda->p_slice))) -#define cputosubnode(cpu) \ - (ASSERT(pdaindr[(cpu)].pda), (SUBNODE(pdaindr[(cpu)].pda->p_slice))) -#else -#define cputocnode(cpu) 0 -#define cputonasid(cpu) 0 -#define cputoslice(cpu) 0 -#define cputolocalslice(cpu) 0 -#define cputosubnode(cpu) 0 -#endif /* LATER */ -#endif /* CONFIG_SGI_IP35 */ - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -#define INVALID_NASID (nasid_t)-1 -#define INVALID_CNODEID (cnodeid_t)-1 -#define INVALID_PNODEID (pnodeid_t)-1 -#define INVALID_MODULE (moduleid_t)-1 -#define INVALID_PARTID (partid_t)-1 - -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -extern int get_slice(void); -extern cpuid_t get_cnode_cpu(cnodeid_t); -extern int get_cpu_slice(cpuid_t); -extern cpuid_t cnodetocpu(cnodeid_t); -// extern cpuid_t cnode_slice_to_cpuid(cnodeid_t, int); - -extern int cnode_exists(cnodeid_t cnode); -extern cnodeid_t cpuid_to_compact_node[MAXCPUS]; -#endif /* CONFIG_IP35 */ - -extern nasid_t get_nasid(void); -extern cnodeid_t get_cpu_cnode(int); -extern int get_cpu_slice(cpuid_t); - -/* - * NO ONE should access these arrays directly. The only reason we refer to - * them here is to avoid the procedure call that would be required in the - * macros below. (Really want private data members here :-) - */ -extern cnodeid_t nasid_to_compact_node[MAX_NASIDS]; -extern nasid_t compact_to_nasid_node[MAX_COMPACT_NODES]; - -/* - * These macros are used by various parts of the kernel to convert - * between the three different kinds of node numbering. At least some - * of them may change to procedure calls in the future, but the macros - * will continue to work. Don't use the arrays above directly. - */ - -#define NASID_TO_REGION(nnode) \ - ((nnode) >> \ - (is_fine_dirmode() ? NASID_TO_FINEREG_SHFT : NASID_TO_COARSEREG_SHFT)) - -#ifndef __ia64 -extern cnodeid_t nasid_to_compact_node[MAX_NASIDS]; -extern nasid_t compact_to_nasid_node[MAX_COMPACT_NODES]; -extern cnodeid_t cpuid_to_compact_node[MAXCPUS]; - -#if !defined(DEBUG) - -#define NASID_TO_COMPACT_NODEID(nnode) (nasid_to_compact_node[nnode]) -#define COMPACT_TO_NASID_NODEID(cnode) (compact_to_nasid_node[cnode]) -#define CPUID_TO_COMPACT_NODEID(cpu) (cpuid_to_compact_node[(cpu)]) -#else - -/* - * These functions can do type checking and fail if they need to return - * a bad nodeid, but they're not as fast so just use 'em for debug kernels. - */ -cnodeid_t nasid_to_compact_nodeid(nasid_t nasid); -nasid_t compact_to_nasid_nodeid(cnodeid_t cnode); - -#define NASID_TO_COMPACT_NODEID(nnode) nasid_to_compact_nodeid(nnode) -#define COMPACT_TO_NASID_NODEID(cnode) compact_to_nasid_nodeid(cnode) -#define CPUID_TO_COMPACT_NODEID(cpu) (cpuid_to_compact_node[(cpu)]) -#endif - -#else - -/* - * IA64 specific nasid and cnode ids. - */ #define NASID_TO_COMPACT_NODEID(nasid) (nasid_to_cnodeid(nasid)) #define COMPACT_TO_NASID_NODEID(cnode) (cnodeid_to_nasid(cnode)) -#define CPUID_TO_COMPACT_NODEID(cpu) (cpuid_to_cnodeid(cpu)) -#endif /* #ifndef __ia64 */ -extern int node_getlastslot(cnodeid_t); +#define INVALID_NASID ((nasid_t)-1) +#define INVALID_CNODEID ((cnodeid_t)-1) +#define INVALID_PNODEID ((pnodeid_t)-1) +#define INVALID_MODULE ((moduleid_t)-1) +#define INVALID_PARTID ((partid_t)-1) -#endif /* _LANGUAGE_C || _LANGUAGE_C_PLUS_PLUS */ +extern cpuid_t cnodetocpu(cnodeid_t); +void sn_flush_all_caches(long addr, long bytes); -#define SLOT_BITMASK (MAX_MEM_SLOTS - 1) -#define SLOT_SIZE (1LL< [2] # units unit number + * : : : + * [ ] 0 + */ + +#include + +#define ulong_t uint64_t + +struct map +{ + unsigned long m_size; /* number of units available */ + unsigned long m_addr; /* address of first available unit */ +}; + +#define mapstart(X) &X[2] /* start of map array */ + +#define mapsize(X) X[0].m_size /* number of empty slots */ + /* remaining in map array */ +#define maplock(X) (((spinlock_t *) X[1].m_size)) + +#define mapout(X) ((sv_t *) X[1].m_addr) + + +extern ulong_t atealloc(struct map *, size_t); +extern struct map *atemapalloc(ulong_t); +extern void atefree(struct map *, size_t, ulong_t); +extern void atemapfree(struct map *); + +#endif /* _ASM_IA64_SN_ATE_UTILS_H */ + diff -urN linux-2.4.18/include/asm-ia64/sn/bte.h lia64-2.4/include/asm-ia64/sn/bte.h --- linux-2.4.18/include/asm-ia64/sn/bte.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/bte.h Fri Jul 19 23:21:10 2002 @@ -0,0 +1,92 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#ifndef _ASM_IA64_SN_BTE_H +#define _ASM_IA64_SN_BTE_H + +#ident "$Revision: $" + +#include +#include +#include + +#define L1_CACHE_MASK (L1_CACHE_BYTES - 1) /* Mask to retrieve + * the offset into this + * cache line.*/ + +/* BTE status register only supports 16 bits for length field */ +#define BTE_LEN_BITS (16) +#define BTE_LEN_MASK ((1 << BTE_LEN_BITS) - 1) +#define BTE_MAX_XFER ((1 << BTE_LEN_BITS) * L1_CACHE_BYTES) + + +/* + * Constants used in determining the best and worst case transfer + * times. To help explain the two, the following graph of transfer + * status vs time may help. + * + * active +------------------:-+ : + * status | : | : + * idle +__________________:_+======= + * 0 Time MaxT MinT + * + * Therefore, MaxT is the maximum thoeretical rate for transfering + * the request block (assuming ideal circumstances) + * + * MinT is the minimum theoretical rate for transferring the + * requested block (assuming maximum link distance and contention) + * + * The following defines are the inverse of the above. They are + * used for calculating the MaxT time and MinT time given the + * number of lines in the transfer. + */ +#define BTE_MAXT_LINES_PER_SECOND 800 +#define BTE_MINT_LINES_PER_SECOND 600 + + +/* Define hardware */ +#define BTES_PER_NODE 2 + +/* Define hardware modes */ +#define BTE_NOTIFY (IBCT_NOTIFY) +#define BTE_NORMAL BTE_NOTIFY +#define BTE_ZERO_FILL (BTE_NOTIFY | IBCT_ZFIL_MODE) + +/* Use a reserved bit to let the caller specify a wait for any BTE */ +#define BTE_WACQUIRE (0x4000) + +/* + * Structure defining a bte. An instance of this + * structure is created in the nodepda for each + * bte on that node (as defined by BTES_PER_NODE) + * This structure contains everything necessary + * to work with a BTE. + */ +typedef struct bteinfo_s { + u64 volatile notify ____cacheline_aligned; + char *bte_base_addr ____cacheline_aligned; + spinlock_t spinlock; + u64 idealTransferTimeout; + u64 idealTransferTimeoutReached; + u64 mostRecentSrc; + u64 mostRecentDest; + u64 mostRecentLen; + u64 mostRecentMode; + u64 volatile *mostRecentNotification; + void *bteTestBuf; +} bteinfo_t; + +/* Possible results from bte_copy and bte_unaligned_copy */ +typedef enum { + BTE_SUCCESS, /* 0 is success */ + BTEFAIL_NOTAVAIL, /* BTE not available */ + BTEFAIL_ERROR, /* Generic error */ + BTEFAIL_DIR /* Diretory error */ +} bte_result_t; + +#endif /* _ASM_IA64_SN_BTE_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/bte_copy.h lia64-2.4/include/asm-ia64/sn/bte_copy.h --- linux-2.4.18/include/asm-ia64/sn/bte_copy.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/bte_copy.h Tue Feb 26 13:19:35 2002 @@ -0,0 +1,311 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#ifndef _ASM_IA64_SN_BTE_COPY_H +#define _ASM_IA64_SN_BTE_COPY_H + +#ident "$Revision: $" + +#include +#include +#include +#include + +/* + * BTE_LOCKING support - Undefining the following line will + * adapt the bte_copy code to support one bte per cpu in + * synchronous mode. Even if bte_copy is called with a + * notify address, the bte will spin and wait for the transfer + * to complete. By defining the following, spin_locks and + * busy checks are placed around the initiation of a BTE + * transfer and multiple bte's per cpu are supported. + */ +#define CONFIG_IA64_SGI_BTE_LOCKING 1 + +/* + * Some macros to simplify reading. + * + * Start with macros to locate the BTE control registers. + */ + +#define BTEREG_LNSTAT_ADDR (bte->bte_base_addr) +#define BTEREG_SOURCE_ADDR (bte->bte_base_addr + IIO_IBSA0 - IIO_IBLS0) +#define BTEREG_DEST_ADDR (bte->bte_base_addr + IIO_IBDA0 - IIO_IBLS0) +#define BTEREG_CTRL_ADDR ((volatile char *)bte->bte_base_addr + IIO_IBCT0 - IIO_IBLS0) +#define BTEREG_NOTIF_ADDR (bte->bte_base_addr + IIO_IBNA0 - IIO_IBLS0) + +/* Some macros to force the IBCT0 value valid. */ + +#define BTE_VALID_MODES BTE_NOTIFY +#define BTE_VLD_MODE(x) (x & BTE_VALID_MODES) + +// #define DEBUG_BTE +// #define DEBUG_BTE_VERBOSE +// #define DEBUG_TIME_BTE + +#ifdef DEBUG_BTE +# define DPRINTK(x) printk x // Terse +# ifdef DEBUG_BTE_VERBOSE +# define DPRINTKV(x) printk x // Verbose +# else +# define DPRINTKV(x) +# endif +#else +# define DPRINTK(x) +# define DPRINTKV(x) +#endif + +#ifdef DEBUG_TIME_BTE +extern u64 BteSetupTime; +extern u64 BteTransferTime; +extern u64 BteTeardownTime; +extern u64 BteExecuteTime; +#endif + +/* + * bte_copy(src, dest, len, mode, notification) + * + * use the block transfer engine to move kernel + * memory from src to dest using the assigned mode. + * + * Paramaters: + * src - physical address of the transfer source. + * dest - physical address of the transfer destination. + * len - number of bytes to transfer from source to dest. + * mode - hardware defined. See reference information + * for IBCT0/1 in the SHUB Programmers Reference + * notification - kernel virtual address of the notification cache + * line. If NULL, the default is used and + * the bte_copy is synchronous. + * + * NOTE: This function requires src, dest, and len to + * be cache line aligned. + */ +extern __inline__ bte_result_t +bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) +{ +#ifdef CONFIG_IA64_SGI_BTE_LOCKING + int bte_to_use; +#endif + +#ifdef DEBUG_TIME_BTE + u64 invokeTime = 0; + u64 completeTime = 0; + u64 xferStartTime = 0; + u64 xferCompleteTime = 0; +#endif + u64 transferSize; + bteinfo_t *bte; + +#ifdef DEBUG_TIME_BTE + invokeTime = ia64_get_itc(); +#endif + + DPRINTK(("bte_copy (0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx)\n", + src, dest, len, mode, notification)); + + if (len == 0) { + return (BTE_SUCCESS); + } + + ASSERT(!((len & L1_CACHE_MASK) || + (src & L1_CACHE_MASK) || (dest & L1_CACHE_MASK))); + + ASSERT(len < ((BTE_LEN_MASK + 1) << L1_CACHE_SHIFT)); + +#ifdef CONFIG_IA64_SGI_BTE_LOCKING + { + bte_to_use = 0; + + /* Attempt to lock one of the BTE interfaces */ + while ((*pda.cpubte[bte_to_use]-> + mostRecentNotification & IBLS_BUSY) + && + (!(spin_trylock + (&(pda.cpubte[bte_to_use]->spinlock)))) + && (bte_to_use < BTES_PER_NODE)) { + bte_to_use++; + } + + if ((bte_to_use >= BTES_PER_NODE) && + !(mode & BTE_WACQUIRE)) { + return (BTEFAIL_NOTAVAIL); + } + + /* Wait until a bte is available. */ + } + while (bte_to_use >= BTES_PER_NODE); + + bte = pda.cpubte[bte_to_use]; + DPRINTKV(("Got a lock on bte %d\n", bte_to_use)); +#else + /* Assuming one BTE per CPU. */ + bte = pda.cpubte[0]; +#endif + + /* + * The following are removed for optimization but is + * available in the event that the SHUB exhibits + * notification problems similar to the hub, bedrock et al. + * + * bte->mostRecentSrc = src; + * bte->mostRecentDest = dest; + * bte->mostRecentLen = len; + * bte->mostRecentMode = mode; + */ + if (notification == NULL) { + /* User does not want to be notified. */ + bte->mostRecentNotification = &bte->notify; + } else { + bte->mostRecentNotification = notification; + } + + /* Calculate the number of cache lines to transfer. */ + transferSize = ((len >> L1_CACHE_SHIFT) & BTE_LEN_MASK); + + DPRINTKV(("Calculated transfer size of %d cache lines\n", + transferSize)); + + /* Initialize the notification to a known value. */ + *bte->mostRecentNotification = -1L; + + + DPRINTKV(("Before, status is 0x%lx and notify is 0x%lx\n", + HUB_L(BTEREG_LNSTAT_ADDR), + *bte->mostRecentNotification)); + + /* Set the status reg busy bit and transfer length */ + DPRINTKV(("IBLS - HUB_S(0x%lx, 0x%lx)\n", + BTEREG_LNSTAT_ADDR, IBLS_BUSY | transferSize)); + HUB_S(BTEREG_LNSTAT_ADDR, IBLS_BUSY | transferSize); + + + DPRINTKV(("After setting status, status is 0x%lx and notify is 0x%lx\n", HUB_L(BTEREG_LNSTAT_ADDR), *bte->mostRecentNotification)); + + /* Set the source and destination registers */ + DPRINTKV(("IBSA - HUB_S(0x%lx, 0x%lx)\n", BTEREG_SOURCE_ADDR, + src)); + HUB_S(BTEREG_SOURCE_ADDR, src); + DPRINTKV(("IBDA - HUB_S(0x%lx, 0x%lx)\n", BTEREG_DEST_ADDR, dest)); + HUB_S(BTEREG_DEST_ADDR, dest); + + + /* Set the notification register */ + DPRINTKV(("IBNA - HUB_S(0x%lx, 0x%lx)\n", BTEREG_NOTIF_ADDR, + __pa(bte->mostRecentNotification))); + HUB_S(BTEREG_NOTIF_ADDR, (__pa(bte->mostRecentNotification))); + + + DPRINTKV(("Set Notify, status is 0x%lx and notify is 0x%lx\n", + HUB_L(BTEREG_LNSTAT_ADDR), + *bte->mostRecentNotification)); + + /* Initiate the transfer */ + DPRINTKV(("IBCT - HUB_S(0x%lx, 0x%lx)\n", BTEREG_CTRL_ADDR, mode)); +#ifdef DEBUG_TIME_BTE + xferStartTime = ia64_get_itc(); +#endif + HUB_S(BTEREG_CTRL_ADDR, BTE_VLD_MODE(mode)); + + DPRINTKV(("Initiated, status is 0x%lx and notify is 0x%lx\n", + HUB_L(BTEREG_LNSTAT_ADDR), + *bte->mostRecentNotification)); + + // >>> Temporarily work around not getting a notification + // from medusa. + // *bte->mostRecentNotification = HUB_L(bte->bte_base_addr); + + if (notification == NULL) { + /* + * Calculate our timeout + * + * What are we doing here? We are trying to determine + * the fastest time the BTE could have transfered our + * block of data. By takine the clock frequency (ticks/sec) + * divided by the BTE MaxT Transfer Rate (lines/sec) + * times the transfer size (lines), we get a tick + * offset from current time that the transfer should + * complete. + * + * Why do this? We are watching for a notification + * failure from the BTE. This behaviour has been + * seen in the SN0 and SN1 hardware on rare circumstances + * and is expected in SN2. By checking at the + * ideal transfer timeout, we minimize our time + * delay from hardware completing our request and + * our detecting the failure. + */ + bte->idealTransferTimeout = jiffies + + (HZ / BTE_MAXT_LINES_PER_SECOND * transferSize); + + while ((IBLS_BUSY & bte->notify)) { + /* + * Notification Workaround: When the max + * theoretical time has elapsed, read the hub + * status register into the notification area. + * This fakes the shub performing the copy. + */ + if (jiffies > bte->idealTransferTimeout) { + bte->notify = HUB_L(bte->bte_base_addr); + bte->idealTransferTimeoutReached++; + bte->idealTransferTimeout = jiffies + + (HZ / BTE_MAXT_LINES_PER_SECOND * + (bte->notify & BTE_LEN_MASK)); + } + } +#ifdef DEBUG_TIME_BTE + xferCompleteTime = ia64_get_itc(); +#endif + if (bte->notify & IBLS_ERROR) { + /* >>> Need to do real error checking. */ + transferSize = 0; + +#ifdef CONFIG_IA64_SGI_BTE_LOCKING + spin_unlock(&(bte->spinlock)); +#endif + return (BTEFAIL_ERROR); + } + + } +#ifdef CONFIG_IA64_SGI_BTE_LOCKING + spin_unlock(&(bte->spinlock)); +#endif +#ifdef DEBUG_TIME_BTE + completeTime = ia64_get_itc(); + + BteSetupTime = xferStartTime - invokeTime; + BteTransferTime = xferCompleteTime - xferStartTime; + BteTeardownTime = completeTime - xferCompleteTime; + BteExecuteTime = completeTime - invokeTime; +#endif + return (BTE_SUCCESS); +} + +/* + * Define the bte_unaligned_copy as an extern. + */ +extern bte_result_t bte_unaligned_copy(u64, u64, u64, u64, char *); + +/* + * The following is the prefered way of calling bte_unaligned_copy + * If the copy is fully cache line aligned, then bte_copy is + * used instead. Since bte_copy is inlined, this saves a call + * stack. NOTE: bte_copy is called synchronously and does block + * until the transfer is complete. In order to get the asynch + * version of bte_copy, you must perform this check yourself. + */ +#define BTE_UNALIGNED_COPY(src, dest, len, mode, bteBlock) \ + if ((len & L1_CACHE_MASK) || \ + (src & L1_CACHE_MASK) || \ + (dest & L1_CACHE_MASK)) { \ + bte_unaligned_copy (src, dest, len, mode, bteBlock); \ + } else { \ + bte_copy(src, dest, len, mode, NULL); \ + } + +#endif /* _ASM_IA64_SN_BTE_COPY_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/cdl.h lia64-2.4/include/asm-ia64/sn/cdl.h --- linux-2.4.18/include/asm-ia64/sn/cdl.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/cdl.h Fri Jul 19 23:21:07 2002 @@ -4,11 +4,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_CDL_H -#define _ASM_SN_CDL_H +#ifndef _ASM_IA64_SN_CDL_H +#define _ASM_IA64_SN_CDL_H #include @@ -193,4 +192,4 @@ void async_attach_signal_done(async_attach_t); void async_attach_waitall(async_attach_t); -#endif /* _ASM_SN_CDL_H */ +#endif /* _ASM_IA64_SN_CDL_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/clksupport.h lia64-2.4/include/asm-ia64/sn/clksupport.h --- linux-2.4.18/include/asm-ia64/sn/clksupport.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/clksupport.h Mon Feb 4 17:48:56 2002 @@ -4,61 +4,60 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Jack Steiner (steiner@sgi.com) + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. */ - -#ifndef _ASM_KSYS_CLKSUPPORT_H -#define _ASM_KSYS_CLKSUPPORT_H - -/* #include */ - -#if SN -#include -#include -typedef hubreg_t clkreg_t; -extern nasid_t master_nasid; - -#define GET_LOCAL_RTC (clkreg_t)LOCAL_HUB_L(PI_RT_COUNT) -#define DISABLE_TMO_INTR() if (cpuid_to_localslice(cpuid())) \ - REMOTE_HUB_PI_S(get_nasid(),\ - cputosubnode(cpuid()),\ - PI_RT_COMPARE_B, 0); \ - else \ - REMOTE_HUB_PI_S(get_nasid(),\ - cputosubnode(cpuid()),\ - PI_RT_COMPARE_A, 0); - -/* This is a hack; we really need to figure these values out dynamically */ -/* - * Since 800 ns works very well with various HUB frequencies, such as - * 360, 380, 390 and 400 MHZ, we use 800 ns rtc cycle time. - */ -#define NSEC_PER_CYCLE 800 -#define CYCLE_PER_SEC (NSEC_PER_SEC/NSEC_PER_CYCLE) /* - * Number of cycles per profiling intr + * This file contains definitions for accessing a platform supported high resolution + * clock. The clock is monitonically increasing and can be accessed from any node + * in the system. The clock is synchronized across nodes - all nodes see the + * same value. + * + * RTC_COUNTER_ADDR - contains the address of the counter + * + * GET_RTC_COUNTER() - macro to read the value of the clock + * + * RTC_CYCLES_PER_SEC - clock frequency in ticks per second + * */ -#define CLK_FCLOCK_FAST_FREQ 1250 -#define CLK_FCLOCK_SLOW_FREQ 0 -/* The is the address that the user will use to mmap the cycle counter */ -#define CLK_CYCLE_ADDRESS_FOR_USER LOCAL_HUB_ADDR(PI_RT_COUNT) - -#elif IP30 -#include -typedef heartreg_t clkreg_t; -#define NSEC_PER_CYCLE 80 -#define CYCLE_PER_SEC (NSEC_PER_SEC/NSEC_PER_CYCLE) -#define GET_LOCAL_RTC *((volatile clkreg_t *)PHYS_TO_COMPATK1(HEART_COUNT)) -#define DISABLE_TMO_INTR() -#define CLK_CYCLE_ADDRESS_FOR_USER PHYS_TO_K1(HEART_COUNT) -#define CLK_FCLOCK_SLOW_FREQ (CYCLE_PER_SEC / HZ) + +#ifndef _ASM_IA64_SN_CLKSUPPORT_H +#define _ASM_IA64_SN_CLKSUPPORT_H + +#include +#include +#include + +typedef long clkreg_t; +extern long sn_rtc_cycles_per_second; + + +#if defined(CONFIG_IA64_SGI_SN1) +#include +#include +/* clocks are not synchronized yet on SN1 - used node 0 (problem if no NASID 0) */ +#define RTC_COUNTER_ADDR ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_COUNTER)) +#define RTC_COMPARE_A_ADDR ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_COMPARE_A)) +#define RTC_COMPARE_B_ADDR ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_COMPARE_B)) +#define RTC_INT_PENDING_A_ADDR ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_INT_PEND_A)) +#define RTC_INT_PENDING_B_ADDR ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_INT_PEND_B)) +#define RTC_INT_ENABLED_A_ADDR ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_INT_EN_A)) +#define RTC_INT_ENABLED_B_ADDR ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_INT_EN_B)) +#else +#include +#define RTC_COUNTER_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC)) +#define RTC_COMPARE_A_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC)) +#define RTC_COMPARE_B_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC)) +#define RTC_INT_PENDING_A_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC)) +#define RTC_INT_PENDING_B_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC)) +#define RTC_INT_ENABLED_A_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC)) +#define RTC_INT_ENABLED_B_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC)) #endif -/* Prototypes */ -extern void init_timebase(void); -extern void fastick_maint(struct eframe_s *); -extern int audioclock; -extern int prfclk_enabled_cnt; -#endif /* _ASM_KSYS_CLKSUPPORT_H */ + +#define GET_RTC_COUNTER() (*RTC_COUNTER_ADDR) +#define rtc_time() GET_RTC_COUNTER() + +#define RTC_CYCLES_PER_SEC sn_rtc_cycles_per_second + +#endif /* _ASM_IA64_SN_CLKSUPPORT_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/dmamap.h lia64-2.4/include/asm-ia64/sn/dmamap.h --- linux-2.4.18/include/asm-ia64/sn/dmamap.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/dmamap.h Fri Jul 19 23:20:15 2002 @@ -4,11 +4,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_DMAMAP_H -#define _ASM_SN_DMAMAP_H +#ifndef _ASM_IA64_SN_DMAMAP_H +#define _ASM_IA64_SN_DMAMAP_H #include @@ -70,7 +69,6 @@ extern int a24_mapsize; extern int a32_mapsize; -extern lock_t dmamaplock; extern sv_t dmamapout; #ifdef __cplusplus @@ -87,4 +85,4 @@ #define DMAMAP_FLAGS 0x7 -#endif /* _ASM_SN_DMAMAP_H */ +#endif /* _ASM_IA64_SN_DMAMAP_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/driver.h lia64-2.4/include/asm-ia64/sn/driver.h --- linux-2.4.18/include/asm-ia64/sn/driver.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/driver.h Fri Jul 19 23:21:07 2002 @@ -4,11 +4,13 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_DRIVER_H -#define _ASM_SN_DRIVER_H +#ifndef _ASM_IA64_SN_DRIVER_H +#define _ASM_IA64_SN_DRIVER_H + +#include +#include /* ** Interface for device driver handle management. @@ -18,133 +20,77 @@ */ typedef struct device_driver_s *device_driver_t; -#define DEVICE_DRIVER_NONE (device_driver_t)NULL /* == Driver thread priority support == */ typedef int ilvl_t; -/* default driver thread priority level */ -#define DRIVER_THREAD_PRI_DEFAULT (ilvl_t)230 -/* invalid driver thread priority level */ -#define DRIVER_THREAD_PRI_INVALID (ilvl_t)-1 - -/* Associate a thread priority with a driver */ -extern int device_driver_thread_pri_set(device_driver_t driver, - ilvl_t pri); - -/* Get the thread priority associated with the driver */ -extern ilvl_t device_driver_thread_pri_get(device_driver_t driver); - -/* Get the thread priority for a driver from the sysgen paramters */ -extern ilvl_t device_driver_sysgen_thread_pri_get(char *driver_prefix); - -/* Initialize device driver functions. */ -extern void device_driver_init(void); - - -/* Allocate a driver handle */ -extern device_driver_t device_driver_alloc(char *prefix); - - -/* Free a driver handle */ -extern void device_driver_free(device_driver_t driver); - - -/* Given a device driver prefix, return a handle to the driver. */ -extern device_driver_t device_driver_get(char *prefix); - -/* Given a device, return a handle to the driver. */ -extern device_driver_t device_driver_getbydev(devfs_handle_t device); -struct cdevsw; -struct bdevsw; +#ifdef __cplusplus +extern "C" { +#endif + +struct eframe_s; +struct piomap; +struct dmamap; + +typedef __psunsigned_t iobush_t; + +/* interrupt function */ +typedef void *intr_arg_t; +typedef void intr_func_f(intr_arg_t); +typedef intr_func_f *intr_func_t; + +#define INTR_ARG(n) ((intr_arg_t)(__psunsigned_t)(n)) + +/* system interrupt resource handle -- returned from intr_alloc */ +typedef struct intr_s *intr_t; +#define INTR_HANDLE_NONE ((intr_t)0) -/* Associate a driver with bdevsw/cdevsw pointers. */ -extern int -device_driver_devsw_put(device_driver_t driver, - struct bdevsw *my_bdevsw, - struct cdevsw *my_cdevsw); - - -/* Given a driver, return the corresponding bdevsw and cdevsw pointers. */ -extern void -device_driver_devsw_get( device_driver_t driver, - struct bdevsw **bdevswp, - struct cdevsw **cdevswp); - -/* Given a driver, return its name (prefix). */ -extern void device_driver_name_get(device_driver_t driver, char *buffer, int length); +/* + * restore interrupt level value, returned from intr_block_level + * for use with intr_unblock_level. + */ +typedef void *rlvl_t; /* - * A descriptor for every static device driver in the system. - * lboot creates a table of these and places in in master.c. - * device_driver_init runs through this table during initialization - * in order to "register" every static device driver. + * A basic, platform-independent description of I/O requirements for + * a device. This structure is usually formed by lboot based on information + * in configuration files. It contains information about PIO, DMA, and + * interrupt requirements for a specific instance of a device. + * + * The pio description is currently unused. + * + * The dma description describes bandwidth characteristics and bandwidth + * allocation requirements. (TBD) + * + * The Interrupt information describes the priority of interrupt, desired + * destination, policy (TBD), whether this is an error interrupt, etc. + * For now, interrupts are targeted to specific CPUs. */ -typedef struct static_device_driver_desc_s { - char *sdd_prefix; - struct bdevsw *sdd_bdevsw; - struct cdevsw *sdd_cdevsw; -} *static_device_driver_desc_t; - -extern struct static_device_driver_desc_s static_device_driver_table[]; -extern int static_devsw_count; +typedef struct device_desc_s { + /* pio description (currently none) */ -/*====== administration support ========== */ -/* structure of each entry in the table created by lboot for - * device / driver administration -*/ -typedef struct dev_admin_info_s { - char *dai_name; /* name of the device or driver - * prefix - */ - char *dai_param_name; /* device or driver parameter name */ - char *dai_param_val; /* value of the parameter */ -} dev_admin_info_t; - - -/* Update all the administrative hints associated with the device */ -extern void device_admin_info_update(devfs_handle_t dev_vhdl); - -/* Update all the administrative hints associated with the device driver */ -extern void device_driver_admin_info_update(device_driver_t driver); - -/* Get a particular administrative hint associated with a device */ -extern char *device_admin_info_get(devfs_handle_t dev_vhdl, - char *info_lbl); - -/* Associate a particular administrative hint for a device */ -extern int device_admin_info_set(devfs_handle_t dev_vhdl, - char *info_lbl, - char *info_val); - -/* Get a particular administrative hint associated with a device driver*/ -extern char *device_driver_admin_info_get(char *driver_prefix, - char *info_name); - -/* Associate a particular administrative hint for a device driver*/ -extern int device_driver_admin_info_set(char *driver_prefix, - char *driver_info_lbl, - char *driver_info_val); + /* dma description */ + /* TBD: allocated badwidth requirements */ -/* Initialize the extended device administrative hint table */ -extern void device_admin_table_init(void); - -/* Add a hint corresponding to a device to the extended device administrative - * hint table. - */ -extern void device_admin_table_update(char *dev_name, - char *param_name, - char *param_val); - -/* Initialize the extended device driver administrative hint table */ -extern void device_driver_admin_table_init(void); - -/* Add a hint corresponding to a device to the extended device driver - * administrative hint table. - */ -extern void device_driver_admin_table_update(char *drv_prefix, - char *param_name, - char *param_val); -#endif /* _ASM_SN_DRIVER_H */ + /* interrupt description */ + devfs_handle_t intr_target; /* Hardware locator string */ + int intr_policy; /* TBD */ + ilvl_t intr_swlevel; /* software level for blocking intr */ + char *intr_name; /* name of interrupt, if any */ + + int flags; +} *device_desc_t; + +/* flag values */ +#define D_INTR_ISERR 0x1 /* interrupt is for error handling */ +#define D_IS_ASSOC 0x2 /* descriptor is associated with a dev */ +#define D_INTR_NOTHREAD 0x4 /* Interrupt handler isn't threaded. */ + +#define INTR_SWLEVEL_NOTHREAD_DEFAULT 0 /* Default + * Interrupt level in case of + * non-threaded interrupt + * handlers + */ +#endif /* _ASM_IA64_SN_DRIVER_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/eeprom.h lia64-2.4/include/asm-ia64/sn/eeprom.h --- linux-2.4.18/include/asm-ia64/sn/eeprom.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/eeprom.h Mon Feb 4 17:48:56 2002 @@ -6,11 +6,10 @@ * * Public interface for reading Atmel EEPROMs via L1 system controllers * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_EEPROM_H -#define _ASM_SN_EEPROM_H +#ifndef _ASM_IA64_SN_EEPROM_H +#define _ASM_IA64_SN_EEPROM_H #include #include @@ -385,14 +384,8 @@ ( IO_BRICK, NASID_GET((r)), (v), 0 ) \ : nic_bridge_vertex_info((v), (r)) ) -#ifdef BRINGUP /* will we read mfg info from IOC3's that aren't - * part of IO7 cards, or aren't in I/O bricks? */ -#define IOC3_VERTEX_MFG_INFO(v, r, e) \ - eeprom_vertex_info_set( IO_IO7, NASID_GET((r)), (v), 0 ) -#endif /* BRINGUP */ - #define HUB_UID_GET(n,v,p) cbrick_uid_get((n),(p)) #define ROUTER_UID_GET(d,p) rbrick_uid_get(get_nasid(),(d),(p)) #define XBOW_UID_GET(n,p) iobrick_uid_get((n),(p)) -#endif /* _ASM_SN_EEPROM_H */ +#endif /* _ASM_IA64_SN_EEPROM_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/fetchop.h lia64-2.4/include/asm-ia64/sn/fetchop.h --- linux-2.4.18/include/asm-ia64/sn/fetchop.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/fetchop.h Mon Feb 4 17:48:56 2002 @@ -0,0 +1,40 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + + +#ifndef _ASM_IA64_SN_FETCHOP_H +#define _ASM_IA64_SN_FETCHOP_H + +#define FETCHOP_BASENAME "sgi_fetchop" +#define FETCHOP_FULLNAME "/dev/sgi_fetchop" + + + +#define FETCHOP_VAR_SIZE 64 /* 64 byte per fetchop variable */ + +#define FETCHOP_LOAD 0 +#define FETCHOP_INCREMENT 8 +#define FETCHOP_DECREMENT 16 +#define FETCHOP_CLEAR 24 + +#define FETCHOP_STORE 0 +#define FETCHOP_AND 24 +#define FETCHOP_OR 32 + +#define FETCHOP_CLEAR_CACHE 56 + +#define FETCHOP_LOAD_OP(addr, op) ( \ + *(long *)((char*) (addr) + (op))) + +#define FETCHOP_STORE_OP(addr, op, x) ( \ + *(long *)((char*) (addr) + (op)) = \ + (long) (x)) + +#endif /* _ASM_IA64_SN_FETCHOP_H */ + diff -urN linux-2.4.18/include/asm-ia64/sn/gda.h lia64-2.4/include/asm-ia64/sn/gda.h --- linux-2.4.18/include/asm-ia64/sn/gda.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/gda.h Mon Nov 19 23:22:54 2001 @@ -6,16 +6,17 @@ * * Derived from IRIX . * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. * * gda.h -- Contains the data structure for the global data area, * The GDA contains information communicated between the * PROM, SYMMON, and the kernel. */ -#ifndef _ASM_SN_GDA_H -#define _ASM_SN_GDA_H +#ifndef _ASM_IA64_SN_GDA_H +#define _ASM_IA64_SN_GDA_H #include +#include #define GDA_MAGIC 0x58464552 @@ -42,7 +43,7 @@ #define G_PARTIDOFF 40 #define G_TABLEOFF 128 -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ typedef struct gda { u32 g_magic; /* GDA magic number */ @@ -68,7 +69,7 @@ #define GDA ((gda_t*) GDA_ADDR(get_nasid())) -#endif /* __LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ /* * Define: PART_GDA_VERSION * Purpose: Define the minimum version of the GDA required, lower @@ -105,4 +106,4 @@ #define PROMOP_BIST1 0x0800 /* keep track of which BIST ran */ #define PROMOP_BIST2 0x1000 /* keep track of which BIST ran */ -#endif /* _ASM_SN_GDA_H */ +#endif /* _ASM_IA64_SN_GDA_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/hack.h lia64-2.4/include/asm-ia64/sn/hack.h --- linux-2.4.18/include/asm-ia64/sn/hack.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/hack.h Fri Jul 19 23:21:07 2002 @@ -4,13 +4,12 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Jack Steiner (steiner@sgi.com) + * Copyright (C) 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_HACK_H -#define _ASM_SN_HACK_H +#ifndef _ASM_IA64_SN_HACK_H +#define _ASM_IA64_SN_HACK_H #include #include /* for copy_??_user */ @@ -32,7 +31,6 @@ #include #define DELAY(a) -#define cpuid() 0 /************************************************ * Routines redefined to use linux equivalents. * @@ -59,14 +57,14 @@ #define spl7 splhi() #define splx(s) -extern void * kmem_alloc_node(register size_t, register int, cnodeid_t); -extern void * kmem_zalloc(size_t, int); -extern void * kmem_zalloc_node(register size_t, register int, cnodeid_t ); -extern void * kmem_zone_alloc(register zone_t *, int); -extern zone_t * kmem_zone_init(register int , char *); -extern void kmem_zone_free(register zone_t *, void *); +extern void * snia_kmem_alloc_node(register size_t, register int, cnodeid_t); +extern void * snia_kmem_zalloc(size_t, int); +extern void * snia_kmem_zalloc_node(register size_t, register int, cnodeid_t ); +extern void * snia_kmem_zone_alloc(register zone_t *, int); +extern zone_t * snia_kmem_zone_init(register int , char *); +extern void snia_kmem_zone_free(register zone_t *, void *); extern int is_specified(char *); extern int cap_able(uint64_t); extern int compare_and_swap_ptr(void **, void *, void *); -#endif /* _ASM_SN_HACK_H */ +#endif /* _ASM_IA64_SN_HACK_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/hcl.h lia64-2.4/include/asm-ia64/sn/hcl.h --- linux-2.4.18/include/asm-ia64/sn/hcl.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/hcl.h Fri Jul 19 23:21:07 2002 @@ -4,13 +4,15 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_HCL_H -#define _ASM_SN_HCL_H +#ifndef _ASM_IA64_SN_HCL_H +#define _ASM_IA64_SN_HCL_H + +#include +#include +#include -extern spinlock_t hcl_spinlock; extern devfs_handle_t hcl_handle; /* HCL driver */ extern devfs_handle_t hwgraph_root; extern devfs_handle_t linux_busnum; @@ -93,7 +95,6 @@ extern devfs_handle_t hwgraph_char_device_get(devfs_handle_t); extern graph_error_t hwgraph_char_device_add(devfs_handle_t, char *, char *, devfs_handle_t *); extern int hwgraph_path_add(devfs_handle_t, char *, devfs_handle_t *); -extern struct file_operations * hwgraph_bdevsw_get(devfs_handle_t); extern int hwgraph_info_add_LBL(devfs_handle_t, char *, arbitrary_info_t); extern int hwgraph_info_get_LBL(devfs_handle_t, char *, arbitrary_info_t *); extern int hwgraph_info_replace_LBL(devfs_handle_t, char *, arbitrary_info_t, @@ -111,4 +112,4 @@ -#endif /* _ASM_SN_HCL_H */ +#endif /* _ASM_IA64_SN_HCL_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/hcl_util.h lia64-2.4/include/asm-ia64/sn/hcl_util.h --- linux-2.4.18/include/asm-ia64/sn/hcl_util.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/hcl_util.h Mon Feb 4 17:48:56 2002 @@ -4,12 +4,13 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_HCL_UTIL_H -#define _ASM_SN_HCL_UTIL_H +#ifndef _ASM_IA64_SN_HCL_UTIL_H +#define _ASM_IA64_SN_HCL_UTIL_H + +#include extern char * dev_to_name(devfs_handle_t, char *, uint); extern int device_master_set(devfs_handle_t, devfs_handle_t); @@ -17,8 +18,5 @@ extern cnodeid_t master_node_get(devfs_handle_t); extern cnodeid_t nodevertex_to_cnodeid(devfs_handle_t); extern void mark_nodevertex_as_node(devfs_handle_t, cnodeid_t); -extern void device_info_set(devfs_handle_t, void *); -extern void *device_info_get(devfs_handle_t); - -#endif _ASM_SN_HCL_UTIL_H +#endif /* _ASM_IA64_SN_HCL_UTIL_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/hires_clock.h lia64-2.4/include/asm-ia64/sn/hires_clock.h --- linux-2.4.18/include/asm-ia64/sn/hires_clock.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/hires_clock.h Mon Nov 19 23:22:54 2001 @@ -0,0 +1,52 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001 Silicon Graphics, Inc. All rights reserved. + * + * SGI Hi Resolution Clock + * + * SGI SN platforms provide a high resolution clock that is + * synchronized across all nodes. The clock can be memory mapped + * and directly read from user space. + * + * Access to the clock is thru the following: + * (error checking not shown) + * + * (Note: should library routines be provided to encapsulate this??) + * + * int fd: + * volatile long *clk; + * + * fd = open (HIRES_FULLNAME, O_RDONLY); + * clk = mmap(0, getpagesize(), PROT_READ, MAP_SHARED, fd, 0); + * clk += ioctl(fd, HIRES_IOCQGETOFFSET, 0); + * + * At this point, clk is a pointer to the high resolution clock. + * + * The clock period can be obtained via: + * + * long picosec_per_tick; + * picosec_per_tick = ioctl(fd, HIRES_IOCQGETPICOSEC, 0); + */ + +#ifndef _ASM_IA64_SN_HIRES_CLOCK_H +#define _ASM_IA64_SN_HIRES_CLOCK_H + + +#define HIRES_BASENAME "sgi_hires_clock" +#define HIRES_FULLNAME "/dev/sgi_hires_clock" +#define HIRES_IOC_BASE 's' + + +/* Get page offset of hires timer */ +#define HIRES_IOCQGETOFFSET _IO( HIRES_IOC_BASE, 0 ) + +/* get clock period in picoseconds per tick */ +#define HIRES_IOCQGETPICOSEC _IO( HIRES_IOC_BASE, 1 ) + +/* get number of significant bits in clock counter */ +#define HIRES_IOCQGETCLOCKBITS _IO( HIRES_IOC_BASE, 2 ) + +#endif /* _ASM_IA64_SN_HIRES_CLOCK_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/hubspc.h lia64-2.4/include/asm-ia64/sn/hubspc.h --- linux-2.4.18/include/asm-ia64/sn/hubspc.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/hubspc.h Wed Dec 31 16:00:00 1969 @@ -1,25 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ -#ifndef _ASM_SN_HUBSPC_H -#define _ASM_SN_HUBSPC_H - -typedef enum { - HUBSPC_REFCOUNTERS, - HUBSPC_PROM -} hubspc_subdevice_t; - - -/* - * Reference Counters - */ - -extern int refcounters_attach(devfs_handle_t hub); - -#endif /* _ASM_SN_HUBSPC_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/hwcntrs.h lia64-2.4/include/asm-ia64/sn/hwcntrs.h --- linux-2.4.18/include/asm-ia64/sn/hwcntrs.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/hwcntrs.h Wed Dec 31 16:00:00 1969 @@ -1,97 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ -#ifndef _ASM_SN_HWCNTRS_H -#define _ASM_SN_HWCNTRS_H - - -typedef uint64_t refcnt_t; - -#define SN0_REFCNT_MAX_COUNTERS 64 - -typedef struct sn0_refcnt_set { - refcnt_t refcnt[SN0_REFCNT_MAX_COUNTERS]; - uint64_t flags; - uint64_t reserved[4]; -} sn0_refcnt_set_t; - -typedef struct sn0_refcnt_buf { - sn0_refcnt_set_t refcnt_set; - uint64_t paddr; - uint64_t page_size; - cnodeid_t cnodeid; /* cnodeid + pad[3] use 64 bits */ - uint16_t pad[3]; - uint64_t reserved[4]; -} sn0_refcnt_buf_t; - -typedef struct sn0_refcnt_args { - uint64_t vaddr; - uint64_t len; - sn0_refcnt_buf_t* buf; - uint64_t reserved[4]; -} sn0_refcnt_args_t; - -/* - * Info needed by the user level program - * to mmap the refcnt buffer - */ - -#define RCB_INFO_GET 1 -#define RCB_SLOT_GET 2 - -typedef struct rcb_info { - uint64_t rcb_len; /* total refcnt buffer len in bytes */ - - int rcb_sw_sets; /* number of sw counter sets in buffer */ - int rcb_sw_counters_per_set; /* sw counters per set -- numnodes */ - int rcb_sw_counter_size; /* sizeof(refcnt_t) -- size of sw cntr */ - - int rcb_base_pages; /* number of base pages in node */ - int rcb_base_page_size; /* sw base page size */ - uint64_t rcb_base_paddr; /* base physical address for this node */ - - int rcb_cnodeid; /* cnodeid for this node */ - int rcb_granularity; /* hw page size used for counter sets */ - uint rcb_hw_counter_max; /* max hwcounter count (width mask) */ - int rcb_diff_threshold; /* current node differential threshold */ - int rcb_abs_threshold; /* current node absolute threshold */ - int rcb_num_slots; /* physmem slots */ - - int rcb_reserved[512]; - -} rcb_info_t; - -typedef struct rcb_slot { - uint64_t base; - uint64_t size; -} rcb_slot_t; - -#if defined(__KERNEL__) -typedef struct sn0_refcnt_args_32 { - uint64_t vaddr; - uint64_t len; - app32_ptr_t buf; - uint64_t reserved[4]; -} sn0_refcnt_args_32_t; - -/* Defines and Macros */ -/* A set of reference counts are for 4k bytes of physical memory */ -#define NBPREFCNTP 0x1000 -#define BPREFCNTPSHIFT 12 -#define bytes_to_refcntpages(x) (((__psunsigned_t)(x)+(NBPREFCNTP-1))>>BPREFCNTPSHIFT) -#define refcntpage_offset(x) ((__psunsigned_t)(x)&((NBPP-1)&~(NBPREFCNTP-1))) -#define align_to_refcntpage(x) ((__psunsigned_t)(x)&(~(NBPREFCNTP-1))) - -extern void migr_refcnt_read(sn0_refcnt_buf_t*); -extern void migr_refcnt_read_extended(sn0_refcnt_buf_t*); -extern int migr_refcnt_enabled(void); - -#endif /* __KERNEL__ */ - -#endif /* _ASM_SN_HWCNTRS_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/idle.h lia64-2.4/include/asm-ia64/sn/idle.h --- linux-2.4.18/include/asm-ia64/sn/idle.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/idle.h Fri Jul 19 23:21:10 2002 @@ -0,0 +1,54 @@ +#ifndef _ASM_IA64_SN_IDLE_H +#define _ASM_IA64_SN_IDLE_H + +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include + +static __inline__ void +snidle(void) { + +#ifdef CONFIG_IA64_SGI_AUTOTEST + { + extern int autotest_enabled; + if (autotest_enabled) { + extern void llsc_main(int); + llsc_main(smp_processor_id()); + } + } +#endif + + if (pda.idle_flag == 0) { + /* + * Turn the activity LED off. + */ + set_led_bits(0, LED_CPU_ACTIVITY); + } + +#ifdef CONFIG_IA64_SGI_SN_SIM + if (IS_RUNNING_ON_SIMULATOR()) + SIMULATOR_SLEEP(); +#endif + + pda.idle_flag = 1; +} + +static __inline__ void +snidleoff(void) { + /* + * Turn the activity LED on. + */ + set_led_bits(LED_CPU_ACTIVITY, LED_CPU_ACTIVITY); + + pda.idle_flag = 0; +} + +#endif /* _ASM_IA64_SN_IDLE_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/ifconfig_net.h lia64-2.4/include/asm-ia64/sn/ifconfig_net.h --- linux-2.4.18/include/asm-ia64/sn/ifconfig_net.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/ifconfig_net.h Mon Nov 19 23:22:54 2001 @@ -0,0 +1,32 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2000-2001 Silicon Graphics, Inc. All rights reserved. + */ + +#ifndef _ASM_IA64_SN_IFCONFIG_NET_H +#define _ASM_IA64_SN_IFCONFIG_NET_H + +#define NETCONFIG_FILE "/tmp/ifconfig_net" +#define POUND_CHAR '#' +#define MAX_LINE_LEN 128 +#define MAXPATHLEN 128 + +struct ifname_num { + long next_eth; + long next_fddi; + long next_hip; + long next_tr; + long next_fc; + long size; +}; + +struct ifname_MAC { + char name[16]; + unsigned char dev_addr[7]; + unsigned char addr_len; /* hardware address length */ +}; + +#endif /* _ASM_IA64_SN_IFCONFIG_NET_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/intr.h lia64-2.4/include/asm-ia64/sn/intr.h --- linux-2.4.18/include/asm-ia64/sn/intr.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/intr.h Tue Feb 26 13:19:35 2002 @@ -4,250 +4,21 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_INTR_H -#define _ASM_SN_INTR_H - -/* Subnode wildcard */ -#define SUBNODE_ANY -1 - -/* Number of interrupt levels associated with each interrupt register. */ -#define N_INTPEND_BITS 64 - -#define INT_PEND0_BASELVL 0 -#define INT_PEND1_BASELVL 64 - -#define N_INTPENDJUNK_BITS 8 -#define INTPENDJUNK_CLRBIT 0x80 +#ifndef _ASM_IA64_SN_INTR_H +#define _ASM_IA64_SN_INTR_H #include -#include - -#if LANGUAGE_C - -#define II_NAMELEN 24 - -/* - * Dispatch table entry - contains information needed to call an interrupt - * routine. - */ -typedef struct intr_vector_s { - intr_func_t iv_func; /* Interrupt handler function */ - intr_func_t iv_prefunc; /* Interrupt handler prologue func */ - void *iv_arg; /* Argument to pass to handler */ -#ifdef LATER - thd_int_t iv_tinfo; /* Thread info */ -#endif - cpuid_t iv_mustruncpu; /* Where we must run. */ -} intr_vector_t; - -/* Interrupt information table. */ -typedef struct intr_info_s { - xtalk_intr_setfunc_t ii_setfunc; /* Function to set the interrupt - * destination and level register. - * It returns 0 (success) or an - * error code. - */ - void *ii_cookie; /* arg passed to setfunc */ - devfs_handle_t ii_owner_dev; /* device that owns this intr */ - char ii_name[II_NAMELEN]; /* Name of this intr. */ - int ii_flags; /* informational flags */ -} intr_info_t; - -#define iv_tflags iv_tinfo.thd_flags -#define iv_isync iv_tinfo.thd_isync -#define iv_lat iv_tinfo.thd_latstats -#define iv_thread iv_tinfo.thd_ithread -#define iv_pri iv_tinfo.thd_pri - -#define THD_CREATED 0x00000001 /* - * We've created a thread for this - * interrupt. - */ - -/* - * Bits for ii_flags: - */ -#define II_UNRESERVE 0 -#define II_RESERVE 1 /* Interrupt reserved. */ -#define II_INUSE 2 /* Interrupt connected */ -#define II_ERRORINT 4 /* INterrupt is an error condition */ -#define II_THREADED 8 /* Interrupt handler is threaded. */ - -/* - * Interrupt level wildcard - */ -#define INTRCONNECT_ANYBIT -1 - -/* - * This structure holds information needed both to call and to maintain - * interrupts. The two are in separate arrays for the locality benefits. - * Since there's only one set of vectors per hub chip (but more than one - * CPU, the lock to change the vector tables must be here rather than in - * the PDA. - */ - -typedef struct intr_vecblk_s { - intr_vector_t vectors[N_INTPEND_BITS]; /* information needed to - call an intr routine. */ - intr_info_t info[N_INTPEND_BITS]; /* information needed only - to maintain interrupts. */ - spinlock_t vector_lock; /* Lock for this and the - masks in the PDA. */ - splfunc_t vector_spl; /* vector_lock req'd spl */ - int vector_state; /* Initialized to zero. - Set to INTR_INITED - by hubintr_init. - */ - int vector_count; /* Number of vectors - * reserved. - */ - int cpu_count[CPUS_PER_SUBNODE]; /* How many interrupts are - * connected to each CPU - */ - int ithreads_enabled; /* Are interrupt threads - * initialized on this node. - * and block? - */ -} intr_vecblk_t; - -/* Possible values for vector_state: */ -#define VECTOR_UNINITED 0 -#define VECTOR_INITED 1 -#define VECTOR_SET 2 - -#define hub_intrvect0 private.p_intmasks.dispatch0->vectors -#define hub_intrvect1 private.p_intmasks.dispatch1->vectors -#define hub_intrinfo0 private.p_intmasks.dispatch0->info -#define hub_intrinfo1 private.p_intmasks.dispatch1->info - -/* - * Macros to manipulate the interrupt register on the calling hub chip. - */ - -#define LOCAL_HUB_SEND_INTR(_level) LOCAL_HUB_S(PI_INT_PEND_MOD, \ - (0x100|(_level))) -#define REMOTE_HUB_PI_SEND_INTR(_hub, _sn, _level) \ - REMOTE_HUB_PI_S((_hub), _sn, PI_INT_PEND_MOD, (0x100|(_level))) - -#define REMOTE_CPU_SEND_INTR(_cpuid, _level) \ - REMOTE_HUB_PI_S(cputonasid(_cpuid), \ - SUBNODE(cputoslice(_cpuid)), \ - PI_INT_PEND_MOD, (0x100|(_level))) -/* - * When clearing the interrupt, make sure this clear does make it - * to the hub. Otherwise we could end up losing interrupts. - * We do an uncached load of the int_pend0 register to ensure this. - */ - -#define LOCAL_HUB_CLR_INTR(_level) \ - LOCAL_HUB_S(PI_INT_PEND_MOD, (_level)), \ - LOCAL_HUB_L(PI_INT_PEND0) -#define REMOTE_HUB_PI_CLR_INTR(_hub, _sn, _level) \ - REMOTE_HUB_PI_S((_hub), (_sn), PI_INT_PEND_MOD, (_level)), \ - REMOTE_HUB_PI_L((_hub), (_sn), PI_INT_PEND0) - -/* Special support for use by gfx driver only. Supports special gfx hub interrupt. */ -extern void install_gfxintr(cpuid_t cpu, ilvl_t swlevel, intr_func_t intr_func, void *intr_arg); - -void setrtvector(intr_func_t func); - -/* - * Interrupt blocking - */ -extern void intr_block_bit(cpuid_t cpu, int bit); -extern void intr_unblock_bit(cpuid_t cpu, int bit); - -#endif /* LANGUAGE_C */ - -/* - * Hard-coded interrupt levels: - */ - -/* - * L0 = SW1 - * L1 = SW2 - * L2 = INT_PEND0 - * L3 = INT_PEND1 - * L4 = RTC - * L5 = Profiling Timer - * L6 = Hub Errors - * L7 = Count/Compare (T5 counters) - */ - - -/* INT_PEND0 hard-coded bits. */ -#ifdef DEBUG_INTR_TSTAMP -/* hard coded interrupt level for interrupt latency test interrupt */ -#define CPU_INTRLAT_B 62 -#define CPU_INTRLAT_A 61 +#if defined(CONFIG_IA64_SGI_SN1) +#include +#elif defined(CONFIG_IA64_SGI_SN2) +#include #endif -/* Hardcoded bits required by software. */ -#define MSC_MESG_INTR 9 -#define CPU_ACTION_B 8 -#define CPU_ACTION_A 7 +extern void sn_send_IPI_phys(long, int, int); -/* These are determined by hardware: */ -#define CC_PEND_B 6 -#define CC_PEND_A 5 -#define UART_INTR 4 -#define PG_MIG_INTR 3 -#define GFX_INTR_B 2 -#define GFX_INTR_A 1 -#define RESERVED_INTR 0 - -/* INT_PEND1 hard-coded bits: */ -#define MSC_PANIC_INTR 63 -#define NI_ERROR_INTR 62 -#define MD_COR_ERR_INTR 61 -#define COR_ERR_INTR_B 60 -#define COR_ERR_INTR_A 59 -#define CLK_ERR_INTR 58 - -#if CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 || CONFIG_IA64_GENERIC -# define NACK_INT_B 57 -# define NACK_INT_A 56 -# define LB_ERROR 55 -# define XB_ERROR 54 -#else - << BOMB! >> Must define IP27 or IP35 or IP37 -#endif - -#define BRIDGE_ERROR_INTR 53 /* Setup by PROM to catch Bridge Errors */ - -#define IP27_INTR_0 52 /* Reserved for PROM use */ -#define IP27_INTR_1 51 /* (do not use in Kernel) */ -#define IP27_INTR_2 50 -#define IP27_INTR_3 49 -#define IP27_INTR_4 48 -#define IP27_INTR_5 47 -#define IP27_INTR_6 46 -#define IP27_INTR_7 45 - -#define TLB_INTR_B 44 /* used for tlb flush random */ -#define TLB_INTR_A 43 - -#define LLP_PFAIL_INTR_B 42 /* see ml/SN/SN0/sysctlr.c */ -#define LLP_PFAIL_INTR_A 41 - -#define NI_BRDCAST_ERR_B 40 -#define NI_BRDCAST_ERR_A 39 - -#if CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 || CONFIG_IA64_GENERIC -# define IO_ERROR_INTR 38 /* set up by prom */ -# define DEBUG_INTR_B 37 /* used by symmon to stop all cpus */ -# define DEBUG_INTR_A 36 -#endif - -#ifdef CONFIG_IA64_SGI_SN1 -// These aren't strictly accurate or complete. See the -// Synergy Spec. for details. -#define SGI_UART_IRQ (65) -#define SGI_HUB_ERROR_IRQ (182) -#endif +#define CPU_VECTOR_TO_IRQ(cpuid,vector) ((cpuid) << 8 | (vector)) -#endif /* _ASM_SN_INTR_H */ +#endif /* _ASM_IA64_SN_INTR_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/intr_public.h lia64-2.4/include/asm-ia64/sn/intr_public.h --- linux-2.4.18/include/asm-ia64/sn/intr_public.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/intr_public.h Fri Jul 19 23:20:15 2002 @@ -4,56 +4,16 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_INTR_PUBLIC_H__ -#define _ASM_SN_INTR_PUBLIC_H__ +#ifndef _ASM_IA64_SN_INTR_PUBLIC_H +#define _ASM_IA64_SN_INTR_PUBLIC_H #include -/* REMEMBER: If you change these, the whole world needs to be recompiled. - * It would also require changing the hubspl.s code and SN0/intr.c - * Currently, the spl code has no support for multiple INTPEND1 masks. - */ - -#define N_INTPEND0_MASKS 1 -#define N_INTPEND1_MASKS 1 - -#define INTPEND0_MAXMASK (N_INTPEND0_MASKS - 1) -#define INTPEND1_MAXMASK (N_INTPEND1_MASKS - 1) - -#if _LANGUAGE_C -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#include +#if defined(CONFIG_IA64_SGI_SN1) +#include +#elif defined(CONFIG_IA64_SGI_SN2) #endif -#include - -struct intr_vecblk_s; /* defined in asm/sn/intr.h */ - -/* - * The following are necessary to create the illusion of a CEL - * on the IP27 hub. We'll add more priority levels soon, but for - * now, any interrupt in a particular band effectively does an spl. - * These must be in the PDA since they're different for each processor. - * Users of this structure must hold the vector_lock in the appropriate vector - * block before modifying the mask arrays. There's only one vector block - * for each Hub so a lock in the PDA wouldn't be adequate. - */ -typedef struct hub_intmasks_s { - /* - * The masks are stored with the lowest-priority (most inclusive) - * in the lowest-numbered masks (i.e., 0, 1, 2...). - */ - /* INT_PEND0: */ - hubreg_t intpend0_masks[N_INTPEND0_MASKS]; - /* INT_PEND1: */ - hubreg_t intpend1_masks[N_INTPEND1_MASKS]; - /* INT_PEND0: */ - struct intr_vecblk_s *dispatch0; - /* INT_PEND1: */ - struct intr_vecblk_s *dispatch1; -} hub_intmasks_t; -#endif /* _LANGUAGE_C */ -#endif /* _ASM_SN_INTR_PUBLIC_H__ */ +#endif /* _ASM_IA64_SN_INTR_PUBLIC_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/invent.h lia64-2.4/include/asm-ia64/sn/invent.h --- linux-2.4.18/include/asm-ia64/sn/invent.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/invent.h Fri Jul 19 23:21:07 2002 @@ -4,11 +4,13 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_INVENT_H -#define _ASM_SN_INVENT_H +#ifndef _ASM_IA64_SN_INVENT_H +#define _ASM_IA64_SN_INVENT_H + +#include +#include /* * sys/sn/invent.h -- Kernel Hardware Inventory @@ -743,4 +745,4 @@ int); extern int device_controller_num_get( devfs_handle_t); #endif /* __KERNEL__ */ -#endif /* _ASM_SN_INVENT_H */ +#endif /* _ASM_IA64_SN_INVENT_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/io.h lia64-2.4/include/asm-ia64/sn/io.h --- linux-2.4.18/include/asm-ia64/sn/io.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/io.h Fri Jul 19 23:21:10 2002 @@ -1,21 +1,17 @@ - -/* $Id: io.h,v 1.2 2000/02/02 16:35:57 ralf Exp $ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2000 Ralf Baechle - * Copyright (C) 2000 Silicon Graphics, Inc. + * Copyright (C) 2000-2001 Silicon Graphics, Inc. */ -#ifndef _ASM_SN_IO_H -#define _ASM_SN_IO_H +#ifndef _ASM_IA64_SN_IO_H +#define _ASM_IA64_SN_IO_H #include -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#include -#endif +#include /* Because we only have PCI I/O ports. */ #define IIO_ITTE_BASE 0x400160 /* base of translation table entries */ @@ -51,17 +47,35 @@ #define IIO_ITTE_GET(nasid, bigwin) REMOTE_HUB_ADDR((nasid), IIO_ITTE(bigwin)) /* - * Macro which takes the widget number, and returns the + * Macro which takes the widget number, and returns the * IO PRB address of that widget. - * value _x is expected to be a widget number in the range + * value _x is expected to be a widget number in the range * 0, 8 - 0xF */ #define IIO_IOPRB(_x) (IIO_IOPRB_0 + ( ( (_x) < HUB_WIDGET_ID_MIN ? \ (_x) : \ (_x) - (HUB_WIDGET_ID_MIN-1)) << 3) ) -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) +#if defined(CONFIG_IA64_SGI_SN1) +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#elif defined(CONFIG_IA64_SGI_SN2) +#include +#include #endif -#endif /* _ASM_SN_IO_H */ +#endif /* _ASM_IA64_SN_IO_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/iobus.h lia64-2.4/include/asm-ia64/sn/iobus.h --- linux-2.4.18/include/asm-ia64/sn/iobus.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/iobus.h Wed Dec 31 16:00:00 1969 @@ -1,185 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ -#ifndef _ASM_SN_IOBUS_H -#define _ASM_SN_IOBUS_H - -#ifdef __cplusplus -extern "C" { -#endif - -struct eframe_s; -struct piomap; -struct dmamap; - - -/* for ilvl_t interrupt level, for use with intr_block_level. Can't - * typedef twice without causing warnings, and some users of this header - * file do not already include driver.h, but expect ilvl_t to be defined, - * while others include both, leading to the warning ... - */ - -#include -#include - - -typedef __psunsigned_t iobush_t; - -#if __KERNEL__ -/* adapter handle */ -typedef devfs_handle_t adap_t; -#endif - - -/* interrupt function */ -typedef void *intr_arg_t; -typedef void intr_func_f(intr_arg_t); -typedef intr_func_f *intr_func_t; - -#define INTR_ARG(n) ((intr_arg_t)(__psunsigned_t)(n)) - -/* system interrupt resource handle -- returned from intr_alloc */ -typedef struct intr_s *intr_t; -#define INTR_HANDLE_NONE ((intr_t)0) - -/* - * restore interrupt level value, returned from intr_block_level - * for use with intr_unblock_level. - */ -typedef void *rlvl_t; - - -/* - * A basic, platform-independent description of I/O requirements for - * a device. This structure is usually formed by lboot based on information - * in configuration files. It contains information about PIO, DMA, and - * interrupt requirements for a specific instance of a device. - * - * The pio description is currently unused. - * - * The dma description describes bandwidth characteristics and bandwidth - * allocation requirements. (TBD) - * - * The Interrupt information describes the priority of interrupt, desired - * destination, policy (TBD), whether this is an error interrupt, etc. - * For now, interrupts are targeted to specific CPUs. - */ - -typedef struct device_desc_s { - /* pio description (currently none) */ - - /* dma description */ - /* TBD: allocated badwidth requirements */ - - /* interrupt description */ - devfs_handle_t intr_target; /* Hardware locator string */ - int intr_policy; /* TBD */ - ilvl_t intr_swlevel; /* software level for blocking intr */ - char *intr_name; /* name of interrupt, if any */ - - int flags; -} *device_desc_t; - -/* flag values */ -#define D_INTR_ISERR 0x1 /* interrupt is for error handling */ -#define D_IS_ASSOC 0x2 /* descriptor is associated with a dev */ -#define D_INTR_NOTHREAD 0x4 /* Interrupt handler isn't threaded. */ - -#define INTR_SWLEVEL_NOTHREAD_DEFAULT 0 /* Default - * Interrupt level in case of - * non-threaded interrupt - * handlers - */ -/* - * Drivers use these interfaces to manage device descriptors. - * - * To examine defaults: - * desc = device_desc_default_get(dev); - * device_desc_*_get(desc); - * - * To modify defaults: - * desc = device_desc_default_get(dev); - * device_desc_*_set(desc); - * - * To eliminate defaults: - * device_desc_default_set(dev, NULL); - * - * To override defaults: - * desc = device_desc_dup(dev); - * device_desc_*_set(desc,...); - * use device_desc in calls - * device_desc_free(desc); - * - * Software must not set or eliminate default device descriptors for a device while - * concurrently get'ing, dup'ing or using them. Default device descriptors can be - * changed only for a device that is quiescent. In general, device drivers have no - * need to permanently change defaults anyway -- they just override defaults, when - * necessary. - */ -extern device_desc_t device_desc_dup(devfs_handle_t dev); -extern void device_desc_free(device_desc_t device_desc); -extern device_desc_t device_desc_default_get(devfs_handle_t dev); -extern void device_desc_default_set(devfs_handle_t dev, device_desc_t device_desc); - -extern devfs_handle_t device_desc_intr_target_get(device_desc_t device_desc); -extern int device_desc_intr_policy_get(device_desc_t device_desc); -extern ilvl_t device_desc_intr_swlevel_get(device_desc_t device_desc); -extern char * device_desc_intr_name_get(device_desc_t device_desc); -extern int device_desc_flags_get(device_desc_t device_desc); - -extern void device_desc_intr_target_set(device_desc_t device_desc, devfs_handle_t target); -extern void device_desc_intr_policy_set(device_desc_t device_desc, int policy); -extern void device_desc_intr_swlevel_set(device_desc_t device_desc, ilvl_t swlevel); -extern void device_desc_intr_name_set(device_desc_t device_desc, char *name); -extern void device_desc_flags_set(device_desc_t device_desc, int flags); - - -/* IO state */ -#ifdef COMMENT -#define IO_STATE_EMPTY 0x01 /* non-existent */ -#define IO_STATE_INITIALIZING 0x02 /* being initialized */ -#define IO_STATE_ATTACHING 0x04 /* becoming active */ -#define IO_STATE_ACTIVE 0x08 /* active */ -#define IO_STATE_DETACHING 0x10 /* becoming inactive */ -#define IO_STATE_INACTIVE 0x20 /* not in use */ -#define IO_STATE_ERROR 0x40 /* problems */ -#define IO_STATE_BAD_HARDWARE 0x80 /* broken hardware */ -#endif - -struct edt; - - -/* return codes */ -#define RC_OK 0 -#define RC_ERROR 1 - -/* bus configuration management op code */ -#define IOBUS_CONFIG_ATTACH 0 /* vary on */ -#define IOBUS_CONFIG_DETACH 1 /* vary off */ -#define IOBUS_CONFIG_RECOVER 2 /* clear error then vary on */ - -/* get low-level PIO handle */ -extern int pio_geth(struct piomap*, int bus, int bus_id, int subtype, - iopaddr_t addr, int size); - -/* get low-level DMA handle */ -extern int dma_geth(struct dmamap*, int bus_type, int bus_id, int dma_type, - int npages, int page_size, int flags); - -#ifdef __cplusplus -} -#endif - -/* - * Macros for page number and page offsets, using ps as page size - */ -#define x_pnum(addr, ps) ((__psunsigned_t)(addr) / (__psunsigned_t)(ps)) -#define x_poff(addr, ps) ((__psunsigned_t)(addr) & ((__psunsigned_t)(ps) - 1)) - -#endif /* _ASM_SN_IOBUS_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/ioc3.h lia64-2.4/include/asm-ia64/sn/ioc3.h --- linux-2.4.18/include/asm-ia64/sn/ioc3.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/ioc3.h Mon Feb 4 17:48:56 2002 @@ -1,10 +1,44 @@ +/* + * Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/NoticeExplan + */ + /* $Id: ioc3.h,v 1.2 2000/11/16 19:49:17 pfg Exp $ * * Copyright (C) 1999 Ralf Baechle * This file is part of the Linux driver for the SGI IOC3. */ -#ifndef IOC3_H -#define IOC3_H +#ifndef _ASM_IA64_SN_IOC3_H +#define _ASM_IA64_SN_IOC3_H + +#include /* SUPERIO uart register map */ typedef volatile struct ioc3_uartregs { @@ -668,4 +702,4 @@ #define IOC3_VENDOR_ID_NUM 0x10A9 #define IOC3_DEVICE_ID_NUM 0x0003 -#endif /* IOC3_H */ +#endif /* _ASM_IA64_SN_IOC3_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/ioerror.h lia64-2.4/include/asm-ia64/sn/ioerror.h --- linux-2.4.18/include/asm-ia64/sn/ioerror.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/ioerror.h Mon May 6 18:04:24 2002 @@ -4,13 +4,15 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_IOERROR_H -#define _ASM_SN_IOERROR_H +#ifndef _ASM_IA64_SN_IOERROR_H +#define _ASM_IA64_SN_IOERROR_H -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) +#ifndef __ASSEMBLY__ + +#include +#include /* * Macros defining the various Errors to be handled as part of @@ -162,7 +164,6 @@ #define IOERROR_FIELDVALID(e,f) (((e)->ie_v.iev_b.ievb_ ## f) != 0) #define IOERROR_GETVALUE(e,f) (ASSERT(IOERROR_FIELDVALID(e,f)),((e)->ie_ ## f)) -#if IP27 || IP35 /* hub code likes to call the SysAD address "hubaddr" ... */ #define ie_hubaddr ie_sysioaddr #define ievb_hubaddr ievb_sysioaddr @@ -178,7 +179,6 @@ MODE_DEVREENABLE /* Reenable pass */ } ioerror_mode_t; -#endif /* C || C++ */ typedef int error_handler_f(void *, int, ioerror_mode_t, ioerror_t *); typedef void *error_handler_arg_t; @@ -193,4 +193,4 @@ #define IOERR_PRINTF(x) #endif /* ERROR_DEBUG */ -#endif /* _ASM_SN_IOERROR_H */ +#endif /* _ASM_IA64_SN_IOERROR_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/ioerror_handling.h lia64-2.4/include/asm-ia64/sn/ioerror_handling.h --- linux-2.4.18/include/asm-ia64/sn/ioerror_handling.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/ioerror_handling.h Mon Feb 4 17:48:56 2002 @@ -1,16 +1,17 @@ -/* $Id$ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_IOERROR_HANDLING_H -#define _ASM_SN_IOERROR_HANDLING_H +#ifndef _ASM_IA64_SN_IOERROR_HANDLING_H +#define _ASM_IA64_SN_IOERROR_HANDLING_H #include +#include +#include +#include #if __KERNEL__ @@ -264,7 +265,7 @@ * one. */ if (v_error_skip_env_get(v, error_env) != GRAPH_SUCCESS) { - error_env = kmem_zalloc(sizeof(label_t), KM_NOSLEEP); + error_env = snia_kmem_zalloc(sizeof(label_t), KM_NOSLEEP); /* Unable to allocate memory for jum buffer. This should * be a very rare occurrence. */ @@ -302,4 +303,4 @@ #endif #endif /* __KERNEL__ */ -#endif /* _ASM_SN_IOERROR_HANDLING_H */ +#endif /* _ASM_IA64_SN_IOERROR_HANDLING_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/iograph.h lia64-2.4/include/asm-ia64/sn/iograph.h --- linux-2.4.18/include/asm-ia64/sn/iograph.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/iograph.h Mon Nov 19 23:22:54 2001 @@ -4,11 +4,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_IOGRAPH_H -#define _ASM_SN_IOGRAPH_H +#ifndef _ASM_IA64_SN_IOGRAPH_H +#define _ASM_IA64_SN_IOGRAPH_H /* * During initialization, platform-dependent kernel code establishes some @@ -68,6 +67,7 @@ #define EDGE_LBL_HPC "hpc" #define EDGE_LBL_GFX "gfx" #define EDGE_LBL_HUB "hub" /* For SN0 */ +#define EDGE_LBL_SYNERGY "synergy" /* For SNIA only */ #define EDGE_LBL_IBUS "ibus" /* For EVEREST */ #define EDGE_LBL_INTERCONNECT "link" #define EDGE_LBL_IO "io" @@ -216,4 +216,4 @@ }; -#endif /* _ASM_SN_IOGRAPH_H */ +#endif /* _ASM_IA64_SN_IOGRAPH_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/klclock.h lia64-2.4/include/asm-ia64/sn/klclock.h --- linux-2.4.18/include/asm-ia64/sn/klclock.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/klclock.h Mon Nov 19 23:22:54 2001 @@ -0,0 +1,60 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1996, 2001 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 2001 by Ralf Baechle + */ +#ifndef _ASM_IA64_SN_KLCLOCK_H +#define _ASM_IA64_SN_KLCLOCK_H + +#include + +#define RTC_BASE_ADDR (unsigned char *)(nvram_base) + +/* Defines for the SGS-Thomson M48T35 clock */ +#define RTC_SGS_WRITE_ENABLE 0x80 +#define RTC_SGS_READ_PROTECT 0x40 +#define RTC_SGS_YEAR_ADDR (RTC_BASE_ADDR + 0x7fffL) +#define RTC_SGS_MONTH_ADDR (RTC_BASE_ADDR + 0x7ffeL) +#define RTC_SGS_DATE_ADDR (RTC_BASE_ADDR + 0x7ffdL) +#define RTC_SGS_DAY_ADDR (RTC_BASE_ADDR + 0x7ffcL) +#define RTC_SGS_HOUR_ADDR (RTC_BASE_ADDR + 0x7ffbL) +#define RTC_SGS_MIN_ADDR (RTC_BASE_ADDR + 0x7ffaL) +#define RTC_SGS_SEC_ADDR (RTC_BASE_ADDR + 0x7ff9L) +#define RTC_SGS_CONTROL_ADDR (RTC_BASE_ADDR + 0x7ff8L) + +/* Defines for the Dallas DS1386 */ +#define RTC_DAL_UPDATE_ENABLE 0x80 +#define RTC_DAL_UPDATE_DISABLE 0x00 +#define RTC_DAL_YEAR_ADDR (RTC_BASE_ADDR + 0xaL) +#define RTC_DAL_MONTH_ADDR (RTC_BASE_ADDR + 0x9L) +#define RTC_DAL_DATE_ADDR (RTC_BASE_ADDR + 0x8L) +#define RTC_DAL_DAY_ADDR (RTC_BASE_ADDR + 0x6L) +#define RTC_DAL_HOUR_ADDR (RTC_BASE_ADDR + 0x4L) +#define RTC_DAL_MIN_ADDR (RTC_BASE_ADDR + 0x2L) +#define RTC_DAL_SEC_ADDR (RTC_BASE_ADDR + 0x1L) +#define RTC_DAL_CONTROL_ADDR (RTC_BASE_ADDR + 0xbL) +#define RTC_DAL_USER_ADDR (RTC_BASE_ADDR + 0xeL) + +/* Defines for the Dallas DS1742 */ +#define RTC_DS1742_WRITE_ENABLE 0x80 +#define RTC_DS1742_READ_ENABLE 0x40 +#define RTC_DS1742_UPDATE_DISABLE 0x00 +#define RTC_DS1742_YEAR_ADDR (RTC_BASE_ADDR + 0x7ffL) +#define RTC_DS1742_MONTH_ADDR (RTC_BASE_ADDR + 0x7feL) +#define RTC_DS1742_DATE_ADDR (RTC_BASE_ADDR + 0x7fdL) +#define RTC_DS1742_DAY_ADDR (RTC_BASE_ADDR + 0x7fcL) +#define RTC_DS1742_HOUR_ADDR (RTC_BASE_ADDR + 0x7fbL) +#define RTC_DS1742_MIN_ADDR (RTC_BASE_ADDR + 0x7faL) +#define RTC_DS1742_SEC_ADDR (RTC_BASE_ADDR + 0x7f9L) +#define RTC_DS1742_CONTROL_ADDR (RTC_BASE_ADDR + 0x7f8L) +#define RTC_DS1742_USER_ADDR (RTC_BASE_ADDR + 0x0L) + +#define BCD_TO_INT(x) (((x>>4) * 10) + (x & 0xf)) +#define INT_TO_BCD(x) (((x / 10)<<4) + (x % 10)) + +#define YRREF 1970 + +#endif /* _ASM_IA64_SN_KLCLOCK_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/klconfig.h lia64-2.4/include/asm-ia64/sn/klconfig.h --- linux-2.4.18/include/asm-ia64/sn/klconfig.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/klconfig.h Mon Feb 4 17:48:56 2002 @@ -6,11 +6,11 @@ * * Derived from IRIX . * - * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc. + * Copyright (C) 1992-1997,1999,2001-2002 Silicon Graphics, Inc. All Rights Reserved. * Copyright (C) 1999 by Ralf Baechle */ -#ifndef _ASM_SN_KLCONFIG_H -#define _ASM_SN_KLCONFIG_H +#ifndef _ASM_IA64_SN_KLCONFIG_H +#define _ASM_IA64_SN_KLCONFIG_H #include @@ -38,20 +38,22 @@ #include #include #include -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) #include -#include +#include #include -#include -// #include -// #include #include #include #include #include #include -#endif /* CONFIG_SGI_IP35 ... */ +#ifdef CONFIG_IA64_SGI_SN1 +#include +#endif + +#ifdef CONFIG_IA64_SGI_SN2 +#include +#endif #define KLCFGINFO_MAGIC 0xbeedbabe @@ -59,19 +61,11 @@ #define MAX_MODULE_ID 255 #define SIZE_PAD 4096 /* 4k padding for structures */ -#if (defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC)) && defined(BRINGUP) /* MAX_SLOTS_PER_NODE??? */ /* * 1 NODE brick, 3 Router bricks (1 local, 1 meta, 1 repeater), * 6 XIO Widgets, 1 Xbow, 1 gfx */ #define MAX_SLOTS_PER_NODE (1 + 3 + 6 + 1 + 1) -#else -/* - * 1 NODE brd, 2 Router brd (1 8p, 1 meta), 6 Widgets, - * 2 Midplanes assuming no pci card cages - */ -#define MAX_SLOTS_PER_NODE (1 + 2 + 6 + 2) -#endif /* XXX if each node is guranteed to have some memory */ @@ -349,7 +343,7 @@ #define KLCLASS(_x) ((_x) & KLCLASS_MASK) /* - * IP27 board types + * board types */ #define KLTYPE_MASK 0x0f @@ -357,11 +351,7 @@ #define KLTYPE_EMPTY 0x00 #define KLTYPE_WEIRDCPU (KLCLASS_CPU | 0x0) -#define KLTYPE_IP27 (KLCLASS_CPU | 0x1) /* 2 CPUs(R10K) per board */ -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#define KLTYPE_IP35 KLTYPE_IP27 -#define KLTYPE_IP37 KLTYPE_IP35 -#endif +#define KLTYPE_SNIA (KLCLASS_CPU | 0x1) #define KLTYPE_WEIRDIO (KLCLASS_IO | 0x0) #define KLTYPE_BASEIO (KLCLASS_IO | 0x1) /* IOC3, SuperIO, Bridge, SCSI */ @@ -949,7 +939,6 @@ extern int config_find_nic_router(nasid_t, nic_t, lboard_t **, klrou_t**); extern int config_find_nic_hub(nasid_t, nic_t, lboard_t **, klhub_t**); extern int config_find_xbow(nasid_t, lboard_t **, klxbow_t**); -extern klcpu_t *get_cpuinfo(cpuid_t cpu); extern int update_klcfg_cpuinfo(nasid_t, int); extern void board_to_path(lboard_t *brd, char *path); extern moduleid_t get_module_id(nasid_t nasid); @@ -963,4 +952,4 @@ extern nasid_t get_actual_nasid(lboard_t *brd) ; extern net_vec_t klcfg_discover_route(lboard_t *, lboard_t *, int); -#endif /* _ASM_SN_KLCONFIG_H */ +#endif /* _ASM_IA64_SN_KLCONFIG_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/kldir.h lia64-2.4/include/asm-ia64/sn/kldir.h --- linux-2.4.18/include/asm-ia64/sn/kldir.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/kldir.h Mon Feb 4 17:48:56 2002 @@ -1,18 +1,16 @@ -/* $Id$ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Derived from IRIX , revision 1.21. * - * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc. + * Copyright (C) 1992-1997,1999,2001-2002 Silicon Graphics, Inc. All Rights Reserved. * Copyright (C) 1999 by Ralf Baechle */ -#ifndef _ASM_SN_KLDIR_H -#define _ASM_SN_KLDIR_H +#ifndef _ASM_IA64_SN_KLDIR_H +#define _ASM_IA64_SN_KLDIR_H -#include #include /* @@ -125,16 +123,16 @@ * 0x0 (0K) +-----------------------------------------+ */ -#ifdef LANGUAGE_ASSEMBLY +#ifdef __ASSEMBLY__ #define KLDIR_OFF_MAGIC 0x00 #define KLDIR_OFF_OFFSET 0x08 #define KLDIR_OFF_POINTER 0x10 #define KLDIR_OFF_SIZE 0x18 #define KLDIR_OFF_COUNT 0x20 #define KLDIR_OFF_STRIDE 0x28 -#endif /* LANGUAGE_ASSEMBLY */ +#endif /* __ASSEMBLY__ */ -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ typedef struct kldir_ent_s { u64 magic; /* Indicates validity of entry */ off_t offset; /* Offset from start of node space */ @@ -146,19 +144,220 @@ /* NOTE: These 16 bytes are used in the Partition KLDIR entry to store partition info. Refer to klpart.h for this. */ } kldir_ent_t; -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ #define KLDIR_ENT_SIZE 0x40 #define KLDIR_MAX_ENTRIES (0x400 / 0x40) + + /* - * The actual offsets of each memory area are machine-dependent + * The upper portion of the memory map applies during boot + * only and is overwritten by IRIX/SYMMON. The minimum memory bank + * size on IP35 is 64M, which provides a limit on the amount of space + * the PROM can assume it has available. + * + * Most of the addresses below are defined as macros in this file, or + * in SN/addrs.h or SN/SN1/addrs.h. + * + * MEMORY MAP PER NODE + * + * 0x4000000 (64M) +-----------------------------------------+ + * | | + * | | + * | IO7 TEXT/DATA/BSS/stack | + * 0x3000000 (48M) +-----------------------------------------+ + * | Free | + * 0x2102000 (>33M) +-----------------------------------------+ + * | IP35 Topology (PCFG) + misc data | + * 0x2000000 (32M) +-----------------------------------------+ + * | IO7 BUFFERS FOR FLASH ENET IOC3 | + * 0x1F80000 (31.5M) +-----------------------------------------+ + * | Free | + * 0x1C00000 (28M) +-----------------------------------------+ + * | IP35 PROM TEXT/DATA/BSS/stack | + * 0x1A00000 (26M) +-----------------------------------------+ + * | Routing temp. space | + * 0x1800000 (24M) +-----------------------------------------+ + * | Diagnostics temp. space | + * 0x1500000 (21M) +-----------------------------------------+ + * | Free | + * 0x1400000 (20M) +-----------------------------------------+ + * | IO7 PROM temporary copy | + * 0x1300000 (19M) +-----------------------------------------+ + * | | + * | Free | + * | (UNIX DATA starts above 0x1000000) | + * | | + * +-----------------------------------------+ + * | UNIX DEBUG Version | + * 0x0310000 (3.1M) +-----------------------------------------+ + * | SYMMON, loaded just below UNIX | + * | (For UNIX Debug only) | + * | | + * | | + * 0x006C000 (432K) +-----------------------------------------+ + * | SYMMON STACK [NUM_CPU_PER_NODE] | + * | (For UNIX Debug only) | + * 0x004C000 (304K) +-----------------------------------------+ + * | | + * | | + * | UNIX NON-DEBUG Version | + * 0x0040000 (256K) +-----------------------------------------+ + * + * + * The lower portion of the memory map contains information that is + * permanent and is used by the IP35PROM, IO7PROM and IRIX. + * + * 0x40000 (256K) +-----------------------------------------+ + * | | + * | KLCONFIG (64K) | + * | | + * 0x30000 (192K) +-----------------------------------------+ + * | | + * | PI Error Spools (64K) | + * | | + * 0x20000 (128K) +-----------------------------------------+ + * | | + * | Unused | + * | | + * 0x19000 (100K) +-----------------------------------------+ + * | Early cache Exception stack (CPU 3)| + * 0x18800 (98K) +-----------------------------------------+ + * | cache error eframe (CPU 3) | + * 0x18400 (97K) +-----------------------------------------+ + * | Exception Handlers (CPU 3) | + * 0x18000 (96K) +-----------------------------------------+ + * | | + * | Unused | + * | | + * 0x13c00 (79K) +-----------------------------------------+ + * | GPDA (8k) | + * 0x11c00 (71K) +-----------------------------------------+ + * | Early cache Exception stack (CPU 2)| + * 0x10800 (66k) +-----------------------------------------+ + * | cache error eframe (CPU 2) | + * 0x10400 (65K) +-----------------------------------------+ + * | Exception Handlers (CPU 2) | + * 0x10000 (64K) +-----------------------------------------+ + * | | + * | Unused | + * | | + * 0x0b400 (45K) +-----------------------------------------+ + * | GDA (1k) | + * 0x0b000 (44K) +-----------------------------------------+ + * | NMI Eframe areas (4) | + * 0x0a000 (40K) +-----------------------------------------+ + * | NMI Register save areas (4) | + * 0x09000 (36K) +-----------------------------------------+ + * | Early cache Exception stack (CPU 1)| + * 0x08800 (34K) +-----------------------------------------+ + * | cache error eframe (CPU 1) | + * 0x08400 (33K) +-----------------------------------------+ + * | Exception Handlers (CPU 1) | + * 0x08000 (32K) +-----------------------------------------+ + * | | + * | | + * | Unused | + * | | + * | | + * 0x04000 (16K) +-----------------------------------------+ + * | NMI Handler (Protected Page) | + * 0x03000 (12K) +-----------------------------------------+ + * | ARCS PVECTORS (master node only) | + * 0x02c00 (11K) +-----------------------------------------+ + * | ARCS TVECTORS (master node only) | + * 0x02800 (10K) +-----------------------------------------+ + * | LAUNCH [NUM_CPU] | + * 0x02400 (9K) +-----------------------------------------+ + * | Low memory directory (KLDIR) | + * 0x02000 (8K) +-----------------------------------------+ + * | ARCS SPB (1K) | + * 0x01000 (4K) +-----------------------------------------+ + * | Early cache Exception stack (CPU 0)| + * 0x00800 (2k) +-----------------------------------------+ + * | cache error eframe (CPU 0) | + * 0x00400 (1K) +-----------------------------------------+ + * | Exception Handlers (CPU 0) | + * 0x00000 (0K) +-----------------------------------------+ + */ + +/* + * NOTE: To change the kernel load address, you must update: + * - the appropriate elspec files in irix/kern/master.d + * - NODEBUGUNIX_ADDR in SN/SN1/addrs.h + * - IP27_FREEMEM_OFFSET below + * - KERNEL_START_OFFSET below (if supporting cells) */ -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#include -#else -#error "kldir.h is currently defined for IP27 and IP35 platforms only" -#endif -#endif /* _ASM_SN_KLDIR_H */ + +/* + * This is defined here because IP27_SYMMON_STK_SIZE must be at least what + * we define here. Since it's set up in the prom. We can't redefine it later + * and expect more space to be allocated. The way to find out the true size + * of the symmon stacks is to divide SYMMON_STK_SIZE by SYMMON_STK_STRIDE + * for a particular node. + */ +#define SYMMON_STACK_SIZE 0x8000 + +#if defined (PROM) || defined (SABLE) + +/* + * These defines are prom version dependent. No code other than the IP35 + * prom should attempt to use these values. + */ +#define IP27_LAUNCH_OFFSET 0x2400 +#define IP27_LAUNCH_SIZE 0x400 +#define IP27_LAUNCH_COUNT 4 +#define IP27_LAUNCH_STRIDE 0x100 /* could be as small as 0x80 */ + +#define IP27_KLCONFIG_OFFSET 0x30000 +#define IP27_KLCONFIG_SIZE 0x10000 +#define IP27_KLCONFIG_COUNT 1 +#define IP27_KLCONFIG_STRIDE 0 + +#define IP27_NMI_OFFSET 0x3000 +#define IP27_NMI_SIZE 0x100 +#define IP27_NMI_COUNT 4 +#define IP27_NMI_STRIDE 0x40 + +#define IP27_PI_ERROR_OFFSET 0x20000 +#define IP27_PI_ERROR_SIZE 0x10000 +#define IP27_PI_ERROR_COUNT 1 +#define IP27_PI_ERROR_STRIDE 0 + +#define IP27_SYMMON_STK_OFFSET 0x4c000 +#define IP27_SYMMON_STK_SIZE 0x20000 +#define IP27_SYMMON_STK_COUNT 4 +/* IP27_SYMMON_STK_STRIDE must be >= SYMMON_STACK_SIZE */ +#define IP27_SYMMON_STK_STRIDE 0x8000 + +#define IP27_FREEMEM_OFFSET 0x40000 +#define IP27_FREEMEM_SIZE (-1) +#define IP27_FREEMEM_COUNT 1 +#define IP27_FREEMEM_STRIDE 0 + +#endif /* PROM || SABLE*/ +/* + * There will be only one of these in a partition so the IO7 must set it up. + */ +#define IO6_GDA_OFFSET 0xb000 +#define IO6_GDA_SIZE 0x400 +#define IO6_GDA_COUNT 1 +#define IO6_GDA_STRIDE 0 + +/* + * save area of kernel nmi regs in the prom format + */ +#define IP27_NMI_KREGS_OFFSET 0x9000 +#define IP27_NMI_KREGS_CPU_SIZE 0x400 +/* + * save area of kernel nmi regs in eframe format + */ +#define IP27_NMI_EFRAME_OFFSET 0xa000 +#define IP27_NMI_EFRAME_SIZE 0x400 + +#define GPDA_OFFSET 0x11c00 + +#endif /* _ASM_IA64_SN_KLDIR_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/ksys/elsc.h lia64-2.4/include/asm-ia64/sn/ksys/elsc.h --- linux-2.4.18/include/asm-ia64/sn/ksys/elsc.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/ksys/elsc.h Mon Feb 4 17:48:56 2002 @@ -4,36 +4,16 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992-1997, 2000-2002 Silicon Graphics, Inc. All Rights Reserved. */ #ifndef _ASM_SN_KSYS_ELSC_H #define _ASM_SN_KSYS_ELSC_H -#include - -#if defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) #include -#endif - -// #include -#define ELSC_I2C_ADDR 0x08 -#define ELSC_I2C_HUB0 0x09 -#define ELSC_I2C_HUB1 0x0a -#define ELSC_I2C_HUB2 0x0b -#define ELSC_I2C_HUB3 0x0c - -#define ELSC_PACKET_MAX 96 #define ELSC_ACP_MAX 86 /* 84+cr+lf */ #define ELSC_LINE_MAX (ELSC_ACP_MAX - 2) -/* - * ELSC character queue type for I/O - */ - -#define ELSC_QSIZE 128 /* Power of 2 is more efficient */ - typedef sc_cq_t elsc_cq_t; /* @@ -49,14 +29,11 @@ int elsc_msg_callback(elsc_t *e, void (*callback)(void *callback_data, char *msg), void *callback_data); -#ifdef LATER char *elsc_errmsg(int code); int elsc_nvram_write(elsc_t *e, int addr, char *buf, int len); int elsc_nvram_read(elsc_t *e, int addr, char *buf, int len); int elsc_nvram_magic(elsc_t *e); -#endif - int elsc_command(elsc_t *e, int only_if_message); int elsc_parse(elsc_t *e, char *p1, char *p2, char *p3); int elsc_ust_write(elsc_t *e, uchar_t c); @@ -69,10 +46,8 @@ */ int elsc_version(elsc_t *e, char *result); -#ifdef LATER int elsc_debug_set(elsc_t *e, u_char byte1, u_char byte2); int elsc_debug_get(elsc_t *e, u_char *byte1, u_char *byte2); -#endif int elsc_module_set(elsc_t *e, int module); int elsc_module_get(elsc_t *e); int elsc_partition_set(elsc_t *e, int partition); @@ -85,13 +60,10 @@ int elsc_cell_get(elsc_t *e); int elsc_bist_set(elsc_t *e, char bist_status); char elsc_bist_get(elsc_t *e); -int elsc_lock(elsc_t *e, - int retry_interval_usec, - int timeout_usec, u_char lock_val); +int elsc_lock(elsc_t *e, int retry_interval_usec, int timeout_usec, u_char lock_val); int elsc_unlock(elsc_t *e); int elsc_display_char(elsc_t *e, int led, int chr); int elsc_display_digit(elsc_t *e, int led, int num, int l_case); -#ifdef LATER int elsc_display_mesg(elsc_t *e, char *chr); /* 8-char input */ int elsc_password_set(elsc_t *e, char *password); /* 4-char input */ int elsc_password_get(elsc_t *e, char *password); /* 4-char output */ @@ -102,7 +74,6 @@ int elsc_system_reset(elsc_t *e); int elsc_dip_switches(elsc_t *e); int elsc_nic_get(elsc_t *e, uint64_t *nic, int verbose); -#endif int _elsc_hbt(elsc_t *e, int ival, int rdly); @@ -110,29 +81,8 @@ #define elsc_hbt_disable(e) _elsc_hbt(e, 0, 0) #define elsc_hbt_send(e) _elsc_hbt(e, 0, 1) -/* - * Routines for using the ELSC as a UART. There's a version of each - * routine that takes a pointer to an elsc_t, and another version that - * gets the pointer by calling a user-supplied global routine "get_elsc". - * The latter version is useful when the elsc is employed for stdio. - */ - -#define ELSCUART_FLASH 0x3c /* LED pattern */ - elsc_t *get_elsc(void); -int elscuart_probe(void); -void elscuart_init(void *); -int elscuart_poll(void); -int elscuart_readc(void); -int elscuart_getc(void); -int elscuart_putc(int); -int elscuart_puts(char *); -char *elscuart_gets(char *, int); -int elscuart_flush(void); - - - /* * Error codes * @@ -142,23 +92,23 @@ #define ELSC_ERROR_NONE 0 -#define ELSC_ERROR_CMD_SEND -100 /* Error sending command */ -#define ELSC_ERROR_CMD_CHECKSUM -101 /* Command checksum bad */ -#define ELSC_ERROR_CMD_UNKNOWN -102 /* Unknown command */ -#define ELSC_ERROR_CMD_ARGS -103 /* Invalid argument(s) */ -#define ELSC_ERROR_CMD_PERM -104 /* Permission denied */ -#define ELSC_ERROR_CMD_STATE -105 /* not allowed in this state*/ - -#define ELSC_ERROR_RESP_TIMEOUT -110 /* ELSC response timeout */ -#define ELSC_ERROR_RESP_CHECKSUM -111 /* Response checksum bad */ -#define ELSC_ERROR_RESP_FORMAT -112 /* Response format error */ -#define ELSC_ERROR_RESP_DIR -113 /* Response direction error */ - -#define ELSC_ERROR_MSG_LOST -120 /* Queue full; msg. lost */ -#define ELSC_ERROR_LOCK_TIMEOUT -121 /* ELSC response timeout */ -#define ELSC_ERROR_DATA_SEND -122 /* Error sending data */ -#define ELSC_ERROR_NIC -123 /* NIC processing error */ -#define ELSC_ERROR_NVMAGIC -124 /* Bad magic no. in NVRAM */ -#define ELSC_ERROR_MODULE -125 /* Moduleid processing err */ +#define ELSC_ERROR_CMD_SEND (-100) /* Error sending command */ +#define ELSC_ERROR_CMD_CHECKSUM (-101) /* Command checksum bad */ +#define ELSC_ERROR_CMD_UNKNOWN (-102) /* Unknown command */ +#define ELSC_ERROR_CMD_ARGS (-103) /* Invalid argument(s) */ +#define ELSC_ERROR_CMD_PERM (-104) /* Permission denied */ +#define ELSC_ERROR_CMD_STATE (-105) /* not allowed in this state*/ + +#define ELSC_ERROR_RESP_TIMEOUT (-110) /* ELSC response timeout */ +#define ELSC_ERROR_RESP_CHECKSUM (-111) /* Response checksum bad */ +#define ELSC_ERROR_RESP_FORMAT (-112) /* Response format error */ +#define ELSC_ERROR_RESP_DIR (-113) /* Response direction error */ + +#define ELSC_ERROR_MSG_LOST (-120) /* Queue full; msg. lost */ +#define ELSC_ERROR_LOCK_TIMEOUT (-121) /* ELSC response timeout */ +#define ELSC_ERROR_DATA_SEND (-122) /* Error sending data */ +#define ELSC_ERROR_NIC (-123) /* NIC processing error */ +#define ELSC_ERROR_NVMAGIC (-124) /* Bad magic no. in NVRAM */ +#define ELSC_ERROR_MODULE (-125) /* Moduleid processing err */ #endif /* _ASM_SN_KSYS_ELSC_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/ksys/i2c.h lia64-2.4/include/asm-ia64/sn/ksys/i2c.h --- linux-2.4.18/include/asm-ia64/sn/ksys/i2c.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/ksys/i2c.h Wed Dec 31 16:00:00 1969 @@ -1,77 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ -#ifndef _ASM_SN_KSYS_I2C_H -#define _ASM_SN_KSYS_I2C_H - -#if _STANDALONE -# include "rtc.h" -#else -# define rtc_time() (GET_LOCAL_RTC * NSEC_PER_CYCLE / 1000) -# define rtc_sleep us_delay -# define rtc_time_t uint64_t -#endif - -typedef u_char i2c_addr_t; /* 7-bit address */ - -int i2c_init(nasid_t); - -int i2c_probe(nasid_t nasid, rtc_time_t timeout); - -int i2c_arb(nasid_t, rtc_time_t timeout, rtc_time_t *token_start); - -int i2c_master_xmit(nasid_t, - i2c_addr_t addr, - u_char *buf, - int len_max, - int *len_ptr, - rtc_time_t timeout, - int only_if_message); - -int i2c_master_recv(nasid_t, - i2c_addr_t addr, - u_char *buf, - int len_max, - int *len_ptr, - int emblen, - rtc_time_t timeout, - int only_if_message); - -int i2c_master_xmit_recv(nasid_t, - i2c_addr_t addr, - u_char *xbuf, - int xlen_max, - int *xlen_ptr, - u_char *rbuf, - int rlen_max, - int *rlen_ptr, - int emblen, - rtc_time_t timeout, - int only_if_message); - -char *i2c_errmsg(int code); - -/* - * Error codes - */ - -#define I2C_ERROR_NONE 0 -#define I2C_ERROR_INIT -1 /* Initialization error */ -#define I2C_ERROR_STATE -2 /* Unexpected chip state */ -#define I2C_ERROR_NAK -3 /* Addressed slave not responding */ -#define I2C_ERROR_TO_ARB -4 /* Timeout waiting for sysctlr arb */ -#define I2C_ERROR_TO_BUSY -5 /* Timeout waiting for busy bus */ -#define I2C_ERROR_TO_SENDA -6 /* Timeout sending address byte */ -#define I2C_ERROR_TO_SENDD -7 /* Timeout sending data byte */ -#define I2C_ERROR_TO_RECVA -8 /* Timeout receiving address byte */ -#define I2C_ERROR_TO_RECVD -9 /* Timeout receiving data byte */ -#define I2C_ERROR_NO_MESSAGE -10 /* No message was waiting */ -#define I2C_ERROR_NO_ELSC -11 /* ELSC is disabled for access */ - -#endif /* _ASM_SN_KSYS_I2C_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/ksys/l1.h lia64-2.4/include/asm-ia64/sn/ksys/l1.h --- linux-2.4.18/include/asm-ia64/sn/ksys/l1.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/ksys/l1.h Mon Feb 4 17:48:56 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992-1997,2000-2002 Silicon Graphics, Inc. All Rights Reserved. */ #ifndef _ASM_SN_KSYS_L1_H @@ -13,7 +12,8 @@ #include #include -#include +#include +#include #define BRL1_QSIZE 128 /* power of 2 is more efficient */ #define BRL1_BUFSZ 264 /* needs to be large enough @@ -39,7 +39,7 @@ * This value can't be confused with a network vector because the least- * significant nibble of a network vector cannot be greater than 8. */ -#define BRL1_LOCALUART ((net_vec_t)0xf) +#define BRL1_LOCALHUB_UART ((net_vec_t)0xf) /* L1<->Bedrock reserved subchannels */ @@ -71,7 +71,14 @@ struct l1sc_s; -typedef void (*brl1_notif_t)(struct l1sc_s *, int); +/* Saved off interrupt frame */ +typedef struct brl1_intr_frame { + int bf_irq; /* irq received */ + void *bf_dev_id; /* device information */ + struct pt_regs *bf_regs; /* register frame */ +} brl1_intr_frame_t; + +typedef void (*brl1_notif_t)(int, void *, struct pt_regs *, struct l1sc_s *, int); typedef int (*brl1_uartf_t)(struct l1sc_s *); /* structure for controlling a subchannel */ @@ -90,6 +97,7 @@ * continue */ brl1_notif_t rx_notify; /* notify higher layer that a packet has been * received */ + brl1_intr_frame_t irq_frame; /* saved off irq information */ } brl1_sch_t; /* br<->l1 protocol states */ @@ -101,7 +109,7 @@ #define BRL1_RESET 7 -#ifndef _LANGUAGE_ASSEMBLY +#ifndef __ASSEMBLY__ /* * l1sc_t structure-- tracks protocol state, open subchannels, etc. @@ -118,6 +126,8 @@ brl1_uartf_t putc_f; /* pointer to UART putc function */ brl1_uartf_t getc_f; /* pointer to UART getc function */ + spinlock_t send_lock; /* arbitrates send synchronization */ + spinlock_t recv_lock; /* arbitrates uart receive access */ spinlock_t subch_lock; /* arbitrates subchannel allocation */ cpuid_t intr_cpu; /* cpu that receives L1 interrupts */ @@ -327,15 +337,6 @@ void sc_init( l1sc_t *sc, nasid_t nasid, net_vec_t uart ); void sc_intr_enable( l1sc_t *sc ); -int _elscuart_putc( l1sc_t *sc, int c ); -int _elscuart_getc( l1sc_t *sc ); -int _elscuart_poll( l1sc_t *sc ); -int _elscuart_readc( l1sc_t *sc ); -int _elscuart_flush( l1sc_t *sc ); -int _elscuart_probe( l1sc_t *sc ); -void _elscuart_init( l1sc_t *sc ); -void elscuart_syscon_listen( l1sc_t *sc ); - int elsc_rack_bay_get(l1sc_t *e, uint *rack, uint *bay); int elsc_rack_bay_type_get(l1sc_t *e, uint *rack, uint *bay, uint *brick_type); @@ -357,5 +358,5 @@ int iobrick_sc_version( l1sc_t *sc, char *result ); -#endif /* !_LANGUAGE_ASSEMBLY */ +#endif /* !__ASSEMBLY__ */ #endif /* _ASM_SN_KSYS_L1_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/labelcl.h lia64-2.4/include/asm-ia64/sn/labelcl.h --- linux-2.4.18/include/asm-ia64/sn/labelcl.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/labelcl.h Mon Feb 4 17:48:56 2002 @@ -4,15 +4,16 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_LABELCL_H -#define _ASM_SN_LABELCL_H +#ifndef _ASM_IA64_SN_LABELCL_H +#define _ASM_IA64_SN_LABELCL_H + +#include #define LABELCL_MAGIC 0x4857434c /* 'HWLC' */ #define LABEL_LENGTH_MAX 256 /* Includes NULL char */ -#define INFO_DESC_PRIVATE -1 /* default */ +#define INFO_DESC_PRIVATE (-1) /* default */ #define INFO_DESC_EXPORT 0 /* export info itself */ /* @@ -90,4 +91,4 @@ extern int labelcl_info_get_IDX(struct devfs_entry *, int, arbitrary_info_t *); extern struct devfs_entry *device_info_connectpt_get(struct devfs_entry *); -#endif /* _ASM_SN_LABELCL_H */ +#endif /* _ASM_IA64_SN_LABELCL_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/leds.h lia64-2.4/include/asm-ia64/sn/leds.h --- linux-2.4.18/include/asm-ia64/sn/leds.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/leds.h Fri Jul 19 23:21:10 2002 @@ -0,0 +1,46 @@ +#ifndef _ASM_IA64_SN_LEDS_H +#define _ASM_IA64_SN_LEDS_H + +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include + +#ifdef CONFIG_IA64_SGI_SN1 +#define LED0 0xc0000b00100000c0LL /* ZZZ fixme */ +#define LED_CPU_SHIFT 3 +#else +#include +#define LED0 (LOCAL_MMR_ADDR(SH_REAL_JUNK_BUS_LED0)) +#define LED_CPU_SHIFT 16 +#endif + +#define LED_CPU_HEARTBEAT 0x01 +#define LED_CPU_ACTIVITY 0x02 +#define LED_MASK_AUTOTEST 0xfe + +/* + * Basic macros for flashing the LEDS on an SGI, SN1. + */ + +static __inline__ void +set_led_bits(u8 value, u8 mask) +{ + pda.led_state = (pda.led_state & ~mask) | (value & mask); +#ifdef CONFIG_IA64_SGI_SN1 + *pda.led_address = (long) pda.led_state; +#else + *pda.led_address = (short) pda.led_state; +#endif +} + +#endif /* _ASM_IA64_SN_LEDS_H */ + diff -urN linux-2.4.18/include/asm-ia64/sn/mca.h lia64-2.4/include/asm-ia64/sn/mca.h --- linux-2.4.18/include/asm-ia64/sn/mca.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/mca.h Mon Feb 4 17:48:56 2002 @@ -0,0 +1,128 @@ +/* + * File: mca.h + * Purpose: Machine check handling specific to the SN platform defines + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/NoticeExplan + */ + +#include +#include +#include +#include + +#ifdef CONFIG_IA64_SGI_SN + +typedef u64 __uint64_t; + +typedef struct { + __uint64_t sh_event_occurred; + __uint64_t sh_first_error; + __uint64_t sh_event_overflow; + __uint64_t sh_pi_first_error; + __uint64_t sh_pi_error_summary; + __uint64_t sh_pi_error_overflow; + __uint64_t sh_pi_error_detail_1; + __uint64_t sh_pi_error_detail_2; + __uint64_t sh_pi_hw_time_stamp; + __uint64_t sh_pi_uncorrected_detail_1; + __uint64_t sh_pi_uncorrected_detail_2; + __uint64_t sh_pi_uncorrected_detail_3; + __uint64_t sh_pi_uncorrected_detail_4; + __uint64_t sh_pi_uncor_time_stamp; + __uint64_t sh_pi_corrected_detail_1; + __uint64_t sh_pi_corrected_detail_2; + __uint64_t sh_pi_corrected_detail_3; + __uint64_t sh_pi_corrected_detail_4; + __uint64_t sh_pi_cor_time_stamp; + __uint64_t sh_mem_error_summary; + __uint64_t sh_mem_error_overflow; + __uint64_t sh_misc_err_hdr_lower; + __uint64_t sh_misc_err_hdr_upper; + __uint64_t sh_dir_uc_err_hdr_lower; + __uint64_t sh_dir_uc_err_hdr_upper; + __uint64_t sh_dir_cor_err_hdr_lower; + __uint64_t sh_dir_cor_err_hdr_upper; + __uint64_t sh_mem_error_mask; + __uint64_t sh_md_uncor_time_stamp; + __uint64_t sh_md_cor_time_stamp; + __uint64_t sh_md_hw_time_stamp; + __uint64_t sh_xn_error_summary; + __uint64_t sh_xn_first_error; + __uint64_t sh_xn_error_overflow; + __uint64_t sh_xniilb_error_summary; + __uint64_t sh_xniilb_first_error; + __uint64_t sh_xniilb_error_overflow; + __uint64_t sh_xniilb_error_detail_1; + __uint64_t sh_xniilb_error_detail_2; + __uint64_t sh_xniilb_error_detail_3; + __uint64_t sh_xnpi_error_summary; + __uint64_t sh_xnpi_first_error; + __uint64_t sh_xnpi_error_overflow; + __uint64_t sh_xnpi_error_detail_1; + __uint64_t sh_xnmd_error_summary; + __uint64_t sh_xnmd_first_error; + __uint64_t sh_xnmd_error_overflow; + __uint64_t sh_xnmd_ecc_err_report; + __uint64_t sh_xnmd_error_detail_1; + __uint64_t sh_lb_error_summary; + __uint64_t sh_lb_first_error; + __uint64_t sh_lb_error_overflow; + __uint64_t sh_lb_error_detail_1; + __uint64_t sh_lb_error_detail_2; + __uint64_t sh_lb_error_detail_3; + __uint64_t sh_lb_error_detail_4; + __uint64_t sh_lb_error_detail_5; +} sal_log_shub_state_t; + +typedef struct { +sal_log_section_hdr_t header; + struct + { + __uint64_t err_status : 1, + guid : 1, + oem_data : 1, + reserved : 61; + } valid; + __uint64_t err_status; + efi_guid_t guid; + __uint64_t shub_nic; + sal_log_shub_state_t shub_state; +} sal_log_plat_info_t; + + +extern void sal_log_plat_print(int header_len, int sect_len, u8 *p_data, prfunc_t prfunc); + +#ifdef platform_plat_specific_err_print +#undef platform_plat_specific_err_print +#endif +#define platform_plat_specific_err_print sal_log_plat_print + +#endif /* CONFIG_IA64_SGI_SN */ diff -urN linux-2.4.18/include/asm-ia64/sn/mem_refcnt.h lia64-2.4/include/asm-ia64/sn/mem_refcnt.h --- linux-2.4.18/include/asm-ia64/sn/mem_refcnt.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/mem_refcnt.h Wed Dec 31 16:00:00 1969 @@ -1,26 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ -#ifndef _ASM_SN_MEM_REFCNT_H -#define _ASM_SN_MEM_REFCNT_H - -extern int mem_refcnt_attach(devfs_handle_t hub); -extern int mem_refcnt_open(devfs_handle_t *devp, mode_t oflag, int otyp, cred_t *crp); -extern int mem_refcnt_close(devfs_handle_t dev, int oflag, int otyp, cred_t *crp); -extern int mem_refcnt_mmap(devfs_handle_t dev, vhandl_t *vt, off_t off, size_t len, uint prot); -extern int mem_refcnt_unmap(devfs_handle_t dev, vhandl_t *vt); -extern int mem_refcnt_ioctl(devfs_handle_t dev, - int cmd, - void *arg, - int mode, - cred_t *cred_p, - int *rvalp); - - -#endif /* _ASM_SN_MEM_REFCNT_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/mmtimer_private.h lia64-2.4/include/asm-ia64/sn/mmtimer_private.h --- linux-2.4.18/include/asm-ia64/sn/mmtimer_private.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/mmtimer_private.h Mon Feb 4 17:48:56 2002 @@ -0,0 +1,42 @@ +/* + * Intel Multimedia Timer device interface + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2001-2002 Silicon Graphics, Inc. All rights reserved. + * + * Helper file for the SN implementation of mmtimers + * + * 11/01/01 - jbarnes - initial revision + */ + +#ifndef _SN_MMTIMER_PRIVATE_H + +#define RTC_BITS 55 /* 55 bits for this implementation */ +#define NUM_COMPARATORS 2 /* two comparison registers in SN1 */ + +/* + * Check for an interrupt and clear the pending bit if + * one is waiting. + */ +#define MMTIMER_INT_PENDING(x) (x ? *(RTC_INT_PENDING_B_ADDR) : *(RTC_INT_PENDING_A_ADDR)) + +/* + * Set interrupts on RTC 'x' to 'v' (true or false) + */ +#define MMTIMER_SET_INT(x,v) (x ? (*(RTC_INT_ENABLED_B_ADDR) = (unsigned long)(v)) : (*(RTC_INT_ENABLED_A_ADDR) = (unsigned long)(v))) + +#define MMTIMER_ENABLE_INT(x) MMTIMER_SET_INT(x, 1) +#define MMTIMER_DISABLE_INT(x) MMTIMER_SET_INT(x, 0) + +typedef struct mmtimer { + spinlock_t timer_lock; + unsigned long periodic; + int signo; + volatile unsigned long *compare; + struct task_struct *process; +} mmtimer_t; + +#endif /* _SN_LINUX_MMTIMER_PRIVATE_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/mmzone.h lia64-2.4/include/asm-ia64/sn/mmzone.h --- linux-2.4.18/include/asm-ia64/sn/mmzone.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/mmzone.h Wed Dec 31 16:00:00 1969 @@ -1,113 +0,0 @@ -/* - * Written by Kanoj Sarcar (kanoj@sgi.com) Jan 2000 - * Copyright, 2000, Silicon Graphics, sprasad@engr.sgi.com - */ -#ifndef _LINUX_ASM_SN_MMZONE_H -#define _LINUX_ASM_SN_MMZONE_H - -#include - -#include -#include - -/* - * Memory is conceptually divided into chunks. A chunk is either - * completely present, or else the kernel assumes it is completely - * absent. Each node consists of a number of contiguous chunks. - */ - -#define CHUNKMASK (~(CHUNKSZ - 1)) -#define CHUNKNUM(vaddr) (__pa(vaddr) >> CHUNKSHIFT) -#define PCHUNKNUM(paddr) ((paddr) >> CHUNKSHIFT) - -#define MAXCHUNKS (MAXNODES * MAX_CHUNKS_PER_NODE) - -extern int chunktonid[]; -#define CHUNKTONID(cnum) (chunktonid[cnum]) - -typedef struct plat_pglist_data { - pg_data_t gendata; /* try to keep this first. */ - unsigned long virtstart; - unsigned long size; -} plat_pg_data_t; - -extern plat_pg_data_t plat_node_data[]; - -extern int numa_debug(void); - -/* - * The foll two will move into linux/mmzone.h RSN. - */ -#define NODE_START(n) plat_node_data[(n)].virtstart -#define NODE_SIZE(n) plat_node_data[(n)].size - -#define KVADDR_TO_NID(kaddr) \ - ((CHUNKTONID(CHUNKNUM((kaddr))) != -1) ? (CHUNKTONID(CHUNKNUM((kaddr)))) : \ - (printk("DISCONTIGBUG: %s line %d addr 0x%lx", __FILE__, __LINE__, \ - (unsigned long)(kaddr)), numa_debug())) -#if 0 -#define KVADDR_TO_NID(kaddr) CHUNKTONID(CHUNKNUM((kaddr))) -#endif - -/* These 2 macros should never be used if KVADDR_TO_NID(kaddr) is -1 */ -/* - * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory - * and returns the mem_map of that node. - */ -#define ADDR_TO_MAPBASE(kaddr) \ - NODE_MEM_MAP(KVADDR_TO_NID((unsigned long)(kaddr))) - -/* - * Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory - * and returns the kaddr corresponding to first physical page in the - * node's mem_map. - */ -#define LOCAL_BASE_ADDR(kaddr) NODE_START(KVADDR_TO_NID(kaddr)) - -#ifdef CONFIG_DISCONTIGMEM - -/* - * Return a pointer to the node data for node n. - * Assume that n is the compact node id. - */ -#define NODE_DATA(n) (&((plat_node_data + (n))->gendata)) - -/* - * NODE_MEM_MAP gives the kaddr for the mem_map of the node. - */ -#define NODE_MEM_MAP(nid) (NODE_DATA((nid))->node_mem_map) - -/* This macro should never be used if KVADDR_TO_NID(kaddr) is -1 */ -#define LOCAL_MAP_NR(kvaddr) \ - (((unsigned long)(kvaddr)-LOCAL_BASE_ADDR((kvaddr))) >> PAGE_SHIFT) -#define MAP_NR_SN1(kaddr) (LOCAL_MAP_NR((kaddr)) + \ - (((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \ - sizeof(mem_map_t))) -#if 0 -#define MAP_NR_VALID(kaddr) (LOCAL_MAP_NR((kaddr)) + \ - (((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \ - sizeof(mem_map_t))) -#define MAP_NR_SN1(kaddr) ((KVADDR_TO_NID(kaddr) == -1) ? (max_mapnr + 1) :\ - MAP_NR_VALID(kaddr)) -#endif - -/* FIXME */ -#define sn1_pte_pagenr(x) MAP_NR_SN1(PAGE_OFFSET + (unsigned long)((pte_val(x)&_PFN_MASK) & PAGE_MASK)) -#define pte_page(pte) (mem_map + sn1_pte_pagenr(pte)) -/* FIXME */ - -#define kern_addr_valid(addr) ((KVADDR_TO_NID((unsigned long)addr) >= \ - numnodes) ? 0 : (test_bit(LOCAL_MAP_NR((addr)), \ - NODE_DATA(KVADDR_TO_NID((unsigned long)addr))->valid_addr_bitmap))) - -#define virt_to_page(kaddr) (mem_map + MAP_NR_SN1(kaddr)) - -#else /* CONFIG_DISCONTIGMEM */ - -#define MAP_NR_SN1(addr) (((unsigned long) (addr) - PAGE_OFFSET) >> PAGE_SHIFT) - -#endif /* CONFIG_DISCONTIGMEM */ - -#define numa_node_id() cpuid_to_cnodeid(smp_processor_id()) - -#endif /* !_LINUX_ASM_SN_MMZONE_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/mmzone_default.h lia64-2.4/include/asm-ia64/sn/mmzone_default.h --- linux-2.4.18/include/asm-ia64/sn/mmzone_default.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/mmzone_default.h Wed Dec 31 16:00:00 1969 @@ -1,15 +0,0 @@ -/* - * Copyright, 2000, Silicon Graphics, sprasad@engr.sgi.com - */ - -#define MAXNODES 16 -#define MAXNASIDS 16 - -#define CHUNKSZ (8*1024*1024) -#define CHUNKSHIFT 23 /* 2 ^^ CHUNKSHIFT == CHUNKSZ */ - -#define CNODEID_TO_NASID(n) n -#define NASID_TO_CNODEID(n) n - -#define MAX_CHUNKS_PER_NODE 8 - diff -urN linux-2.4.18/include/asm-ia64/sn/mmzone_sn1.h lia64-2.4/include/asm-ia64/sn/mmzone_sn1.h --- linux-2.4.18/include/asm-ia64/sn/mmzone_sn1.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/mmzone_sn1.h Wed Dec 31 16:00:00 1969 @@ -1,105 +0,0 @@ -#ifndef _ASM_IA64_MMZONE_SN1_H -#define _ASM_IA64_MMZONE_SN1_H - -#include - -/* - * Copyright, 2000, Silicon Graphics, sprasad@engr.sgi.com - */ -/* Maximum configuration supported by SNIA hardware. There are other - * restrictions that may limit us to a smaller max configuration. - */ -#define MAXNODES 128 -#define MAXNASIDS 128 - -#define CHUNKSZ (64*1024*1024) -#define CHUNKSHIFT 26 /* 2 ^^ CHUNKSHIFT == CHUNKSZ */ - -extern int cnodeid_map[] ; -extern int nasid_map[] ; - -#define CNODEID_TO_NASID(n) (cnodeid_map[(n)]) -#define NASID_TO_CNODEID(n) (nasid_map[(n)]) - -#define MAX_CHUNKS_PER_NODE 128 - - -/* - * These are a bunch of sn1 hw specific defines. For now, keep it - * in this file. If it gets too diverse we may want to create a - * mmhwdefs_sn1.h - */ - -/* - * Structure of the mem config of the node as a SN1 MI reg - * Medusa supports this reg config. - */ - -typedef struct node_memmap_s -{ - unsigned int b0 :1, /* 0 bank 0 present */ - b1 :1, /* 1 bank 1 present */ - r01 :2, /* 2-3 reserved */ - b01size :4, /* 4-7 Size of bank 0 and 1 */ - b2 :1, /* 8 bank 2 present */ - b3 :1, /* 9 bank 3 present */ - r23 :2, /* 10-11 reserved */ - b23size :4, /* 12-15 Size of bank 2 and 3 */ - b4 :1, /* 16 bank 4 present */ - b5 :1, /* 17 bank 5 present */ - r45 :2, /* 18-19 reserved */ - b45size :4, /* 20-23 Size of bank 4 and 5 */ - b6 :1, /* 24 bank 6 present */ - b7 :1, /* 25 bank 7 present */ - r67 :2, /* 26-27 reserved */ - b67size :4; /* 28-31 Size of bank 6 and 7 */ -} node_memmap_t ; - -#define GBSHIFT 30 -#define MBSHIFT 20 - -/* - * SN1 Arch defined values - */ -#define SN1_MAX_BANK_PER_NODE 8 -#define SN1_BANK_PER_NODE_SHIFT 3 /* derived from SN1_MAX_BANK_PER_NODE */ -#define SN1_NODE_ADDR_SHIFT (GBSHIFT+3) /* 8GB */ -#define SN1_BANK_ADDR_SHIFT (SN1_NODE_ADDR_SHIFT-SN1_BANK_PER_NODE_SHIFT) - -#define SN1_BANK_SIZE_SHIFT (MBSHIFT+6) /* 64 MB */ -#define SN1_MIN_BANK_SIZE_SHIFT SN1_BANK_SIZE_SHIFT - -/* - * BankSize nibble to bank size mapping - * - * 1 - 64 MB - * 2 - 128 MB - * 3 - 256 MB - * 4 - 512 MB - * 5 - 1024 MB (1GB) - */ - -/* fixme - this macro breaks for bsize 6-8 and 0 */ - -#ifdef CONFIG_IA64_SGI_SN1_SIM -/* Support the medusa hack for 8M/16M/32M nodes */ -#define BankSizeBytes(bsize) ((bsize<6) ? (1<<((bsize-1)+SN1_BANK_SIZE_SHIFT)) :\ - (1<<((bsize-9)+MBSHIFT))) -#else -#define BankSizeBytes(bsize) (1<<((bsize-1)+SN1_BANK_SIZE_SHIFT)) -#endif - -#define BankSizeToEFIPages(bsize) ((BankSizeBytes(bsize)) >> 12) - -#define GetPhysAddr(n,b) (((u64)n<> SN1_NODE_ADDR_SHIFT) - -#define GetBankId(paddr) \ - (((u64)(paddr) >> SN1_BANK_ADDR_SHIFT) & 7) - -#define SN1_MAX_BANK_SIZE ((u64)BankSizeBytes(5)) -#define SN1_BANK_SIZE_MASK (~(SN1_MAX_BANK_SIZE-1)) - -#endif /* _ASM_IA64_MMZONE_SN1_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/module.h lia64-2.4/include/asm-ia64/sn/module.h --- linux-2.4.18/include/asm-ia64/sn/module.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/module.h Mon Feb 4 17:48:56 2002 @@ -1,31 +1,24 @@ -/* $Id$ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_MODULE_H -#define _ASM_SN_MODULE_H +#ifndef _ASM_IA64_SN_MODULE_H +#define _ASM_IA64_SN_MODULE_H #ifdef __cplusplus extern "C" { #endif -#include #include #include #include -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#ifdef BRINGUP /* max. number of modules? Should be about 300.*/ -#define MODULE_MAX 56 -#endif /* BRINGUP */ +#define MODULE_MAX 128 #define MODULE_MAX_NODES 1 -#endif /* CONFIG_SGI_IP35 */ #define MODULE_HIST_CNT 16 #define MAX_MODULE_LEN 16 @@ -39,8 +32,6 @@ #define MODULE_FORMAT_LONG 2 -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) - /* * Module id format * @@ -134,17 +125,6 @@ ((_m2)&(MODULE_RACK_MASK|MODULE_BPOS_MASK))) #define MODULE_MATCH(_m1, _m2) (MODULE_CMP((_m1),(_m2)) == 0) -#else - -/* - * Some code that uses this macro will not be conditionally compiled. - */ -#define MODULE_GET_BTCHAR(_m) ('?') -#define MODULE_CMP(_m1, _m2) ((_m1) - (_m2)) -#define MODULE_MATCH(_m1, _m2) (MODULE_CMP((_m1),(_m2)) == 0) - -#endif /* CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 */ - typedef struct module_s module_t; struct module_s { @@ -205,4 +185,4 @@ } #endif -#endif /* _ASM_SN_MODULE_H */ +#endif /* _ASM_IA64_SN_MODULE_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/nag.h lia64-2.4/include/asm-ia64/sn/nag.h --- linux-2.4.18/include/asm-ia64/sn/nag.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/nag.h Mon Nov 19 23:22:54 2001 @@ -0,0 +1,32 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2001 Silicon Graphics, Inc. All rights reserved. +*/ + + +#ifndef _ASM_IA64_SN_NAG_H +#define _ASM_IA64_SN_NAG_H + + +#define NAG(mesg...) \ +do { \ + static unsigned int how_broken = 1; \ + static unsigned int threshold = 1; \ + if (how_broken == threshold) { \ + if (threshold < 10000) \ + threshold *= 10; \ + if (how_broken > 1) \ + printk(KERN_WARNING "%u times: ", how_broken); \ + else \ + printk(KERN_WARNING); \ + printk(mesg); \ + } \ + how_broken++; \ +} while (0) + + +#endif /* _ASM_IA64_SN_NAG_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/nic.h lia64-2.4/include/asm-ia64/sn/nic.h --- linux-2.4.18/include/asm-ia64/sn/nic.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/nic.h Mon Feb 4 17:48:56 2002 @@ -4,13 +4,14 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_NIC_H -#define _ASM_SN_NIC_H +#ifndef _ASM_IA64_SN_NIC_H +#define _ASM_IA64_SN_NIC_H #include +#include +#include #define MCR_DATA(x) ((int) ((x) & 1)) #define MCR_DONE(x) ((x) & 2) @@ -125,4 +126,4 @@ extern nic_vmce_t nic_vmc_add(char *, nic_vmc_func *); extern void nic_vmc_del(nic_vmce_t); -#endif /* _ASM_SN_NIC_H */ +#endif /* _ASM_IA64_SN_NIC_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/nodemask.h lia64-2.4/include/asm-ia64/sn/nodemask.h --- linux-2.4.18/include/asm-ia64/sn/nodemask.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/nodemask.h Wed Dec 31 16:00:00 1969 @@ -1,330 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ -#ifndef _ASM_SN_NODEMASK_H -#define _ASM_SN_NODEMASK_H - -#if defined(__KERNEL__) || defined(_KMEMUSER) - -#include - -#if CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 || CONFIG_IA64_GENERIC -#include /* needed for MAX_COMPACT_NODES */ -#endif - -#define CNODEMASK_BOOTED_MASK boot_cnodemask -#define CNODEMASK_BIPW 64 - -#if !defined(SN0XXL) && !defined(CONFIG_SGI_IP35) && !defined(CONFIG_IA64_SGI_SN1) && !defined(CONFIG_IA64_GENERIC) - /* MAXCPUS 128p (64 nodes) or less */ - -#define CNODEMASK_SIZE 1 -typedef uint64_t cnodemask_t; - -#define CNODEMASK_WORD(p,w) (p) -#define CNODEMASK_SET_WORD(p,w,val) (p) = val -#define CNODEMASK_CLRALL(p) (p) = 0 -#define CNODEMASK_SETALL(p) (p) = ~((cnodemask_t)0) -#define CNODEMASK_IS_ZERO(p) ((p) == 0) -#define CNODEMASK_IS_NONZERO(p) ((p) != 0) -#define CNODEMASK_NOTEQ(p, q) ((p) != (q)) -#define CNODEMASK_EQ(p, q) ((p) == (q)) -#define CNODEMASK_LSB_ISONE(p) ((p) & 0x1ULL) - -#define CNODEMASK_ZERO() ((cnodemask_t)0) -#define CNODEMASK_CVTB(bit) (1ULL << (bit)) -#define CNODEMASK_SETB(p, bit) ((p) |= 1ULL << (bit)) -#define CNODEMASK_CLRB(p, bit) ((p) &= ~(1ULL << (bit))) -#define CNODEMASK_TSTB(p, bit) ((p) & (1ULL << (bit))) - -#define CNODEMASK_SETM(p, q) ((p) |= (q)) -#define CNODEMASK_CLRM(p, q) ((p) &= ~(q)) -#define CNODEMASK_ANDM(p, q) ((p) &= (q)) -#define CNODEMASK_TSTM(p, q) ((p) & (q)) - -#define CNODEMASK_CPYNOTM(p, q) ((p) = ~(q)) -#define CNODEMASK_CPY(p, q) ((p) = (q)) -#define CNODEMASK_ORNOTM(p, q) ((p) |= ~(q)) -#define CNODEMASK_SHIFTL(p) ((p) <<= 1) -#define CNODEMASK_SHIFTR(p) ((p) >>= 1) -#define CNODEMASK_SHIFTL_PTR(p) (*(p) <<= 1) -#define CNODEMASK_SHIFTR_PTR(p) (*(p) >>= 1) - -/* Atomically set or clear a particular bit */ -#define CNODEMASK_ATOMSET_BIT(p, bit) atomicSetUlong((cnodemask_t *)&(p), (1ULL<<(bit))) -#define CNODEMASK_ATOMCLR_BIT(p, bit) atomicClearUlong((cnodemask_t *)&(p), (1ULL<<(bit))) - -/* Atomically set or clear a collection of bits */ -#define CNODEMASK_ATOMSET(p, q) atomicSetUlong((cnodemask_t *)&(p), q) -#define CNODEMASK_ATOMCLR(p, q) atomicClearUlong((cnodemask_t *)&(p), q) - -/* Atomically set or clear a collection of bits, returning the old value */ -#define CNODEMASK_ATOMSET_MASK(__old, p, q) { \ - (__old) = atomicSetUlong((cnodemask_t *)&(p), q); \ -} -#define CNODEMASK_ATOMCLR_MASK(__old, p, q) { \ - (__old) = atomicClearUlong((cnodemask_t *)&(p),q); \ -} - -#define CNODEMASK_FROM_NUMNODES(n) ((~(cnodemask_t)0)>>(CNODEMASK_BIPW-(n))) - -#else /* SN0XXL || SN1 - MAXCPUS > 128 */ - -#define CNODEMASK_SIZE (MAX_COMPACT_NODES / CNODEMASK_BIPW) - -typedef struct { - uint64_t _bits[CNODEMASK_SIZE]; -} cnodemask_t; - -#define CNODEMASK_WORD(p,w) \ - ((w >= 0 && w < CNODEMASK_SIZE) ? (p)._bits[(w)] : 0) -#define CNODEMASK_SET_WORD(p,w,val) { \ - if (w >= 0 && w < CNODEMASK_SIZE) \ - (p)._bits[(w)] = val; \ -} - -#define CNODEMASK_CLRALL(p) { \ - int i; \ - \ - for (i = 0 ; i < CNODEMASK_SIZE ; i++) \ - (p)._bits[i] = 0; \ -} - -#define CNODEMASK_SETALL(p) { \ - int i; \ - \ - for (i = 0 ; i < CNODEMASK_SIZE ; i++) \ - (p)._bits[i] = ~(0); \ -} - -#define CNODEMASK_LSB_ISONE(p) ((p)._bits[0] & 0x1ULL) - - -#define CNODEMASK_SETM(p,q) { \ - int i; \ - \ - for (i = 0 ; i < CNODEMASK_SIZE ; i++) \ - (p)._bits[i] |= ((q)._bits[i]); \ -} - -#define CNODEMASK_CLRM(p,q) { \ - int i; \ - \ - for (i = 0 ; i < CNODEMASK_SIZE ; i++) \ - (p)._bits[i] &= ~((q)._bits[i]); \ -} - -#define CNODEMASK_ANDM(p,q) { \ - int i; \ - \ - for (i = 0 ; i < CNODEMASK_SIZE ; i++) \ - (p)._bits[i] &= ((q)._bits[i]); \ -} - -#define CNODEMASK_CPY(p, q) { \ - int i; \ - \ - for (i = 0 ; i < CNODEMASK_SIZE ; i++) \ - (p)._bits[i] = (q)._bits[i]; \ -} - -#define CNODEMASK_CPYNOTM(p,q) { \ - int i; \ - \ - for (i = 0 ; i < CNODEMASK_SIZE ; i++) \ - (p)._bits[i] = ~((q)._bits[i]); \ -} - -#define CNODEMASK_ORNOTM(p,q) { \ - int i; \ - \ - for (i = 0 ; i < CNODEMASK_SIZE ; i++) \ - (p)._bits[i] |= ~((q)._bits[i]); \ -} - -#define CNODEMASK_INDEX(bit) ((bit) >> 6) -#define CNODEMASK_SHFT(bit) ((bit) & 0x3f) - - -#define CNODEMASK_SETB(p, bit) \ - (p)._bits[CNODEMASK_INDEX(bit)] |= (1ULL << CNODEMASK_SHFT(bit)) - - -#define CNODEMASK_CLRB(p, bit) \ - (p)._bits[CNODEMASK_INDEX(bit)] &= ~(1ULL << CNODEMASK_SHFT(bit)) - - -#define CNODEMASK_TSTB(p, bit) \ - ((p)._bits[CNODEMASK_INDEX(bit)] & (1ULL << CNODEMASK_SHFT(bit))) - -/** Probably should add atomic update for entire cnodemask_t struct **/ - -/* Atomically set or clear a particular bit */ -#define CNODEMASK_ATOMSET_BIT(p, bit) \ - (atomicSetUlong((unsigned long *)&(p)._bits[CNODEMASK_INDEX(bit)], (1ULL << CNODEMASK_SHFT(bit)))); -#define CNODEMASK_ATOMCLR_BIT(__old, p, bit) \ - (atomicClearUlong((unsigned long *)&(p)._bits[CNODEMASK_INDEX(bit)], (1ULL << CNODEMASK_SHFT(bit)))); - -/* Atomically set or clear a collection of bits */ -#define CNODEMASK_ATOMSET(p, q) { \ - int i; \ - \ - for (i = 0 ; i < CNODEMASK_SIZE ; i++) { \ - atomicSetUlong((unsigned long *)&(p)._bits[i], (q)._bits[i]); \ - } \ -} -#define CNODEMASK_ATOMCLR(p, q) { \ - int i; \ - \ - for (i = 0 ; i < CNODEMASK_SIZE ; i++) { \ - atomicClearUlong((unsigned long *)&(p)._bits[i], (q)._bits[i]); \ - } \ -} - -/* Atomically set or clear a collection of bits, returning the old value */ -#define CNODEMASK_ATOMSET_MASK(__old, p, q) { \ - int i; \ - \ - for (i = 0 ; i < CNODEMASK_SIZE ; i++) { \ - (__old)._bits[i] = \ - atomicSetUlong((unsigned long *)&(p)._bits[i], (q)._bits[i]); \ - } \ -} -#define CNODEMASK_ATOMCLR_MASK(__old, p, q) { \ - int i; \ - \ - for (i = 0 ; i < CNODEMASK_SIZE ; i++) { \ - (__old)._bits[i] = \ - atomicClearUlong((unsigned long *)&(p)._bits[i], (q)._bits[i]); \ - } \ -} - -__inline static cnodemask_t CNODEMASK_CVTB(int bit) -{ - cnodemask_t __tmp; - CNODEMASK_CLRALL(__tmp); - CNODEMASK_SETB(__tmp,bit); - return(__tmp); -} - - -__inline static cnodemask_t CNODEMASK_ZERO(void) -{ - cnodemask_t __tmp; - CNODEMASK_CLRALL(__tmp); - return(__tmp); -} - -__inline static int CNODEMASK_IS_ZERO (cnodemask_t p) -{ - int i; - - for (i = 0 ; i < CNODEMASK_SIZE ; i++) - if (p._bits[i] != 0) - return 0; - return 1; -} - -__inline static int CNODEMASK_IS_NONZERO (cnodemask_t p) -{ - int i; - - for (i = 0 ; i < CNODEMASK_SIZE ; i++) - if (p._bits[i] != 0) - return 1; - return 0; -} - -__inline static int CNODEMASK_NOTEQ (cnodemask_t p, cnodemask_t q) -{ - int i; - - for (i = 0 ; i < CNODEMASK_SIZE ; i++) - if (p._bits[i] != q._bits[i]) - return 1; - return 0; -} - -__inline static int CNODEMASK_EQ (cnodemask_t p, cnodemask_t q) -{ - int i; - - for (i = 0 ; i < CNODEMASK_SIZE ; i++) - if (p._bits[i] != q._bits[i]) - return 0; - return 1; -} - - -__inline static int CNODEMASK_TSTM (cnodemask_t p, cnodemask_t q) -{ - int i; - - for (i = 0 ; i < CNODEMASK_SIZE ; i++) - if (p._bits[i] & q._bits[i]) - return 1; - return 0; -} - -__inline static void CNODEMASK_SHIFTL_PTR (cnodemask_t *p) -{ - int i; - uint64_t upper; - - /* - * shift words starting with the last word - * of the vector and work backward to the first - * word updating the low order bits with the - * high order bit of the prev word. - */ - for (i=(CNODEMASK_SIZE-1); i > 0; --i) { - upper = (p->_bits[i-1] & (1ULL<<(CNODEMASK_BIPW-1))) ? 1 : 0; - p->_bits[i] <<= 1; - p->_bits[i] |= upper; - } - p->_bits[i] <<= 1; -} - -__inline static void CNODEMASK_SHIFTR_PTR (cnodemask_t *p) -{ - int i; - uint64_t lower; - - /* - * shift words starting with the first word - * of the vector and work forward to the last - * word updating the high order bit with the - * low order bit of the next word. - */ - for (i=0; i < (CNODEMASK_SIZE-2); ++i) { - lower = (p->_bits[i+1] & (0x1)) ? 1 : 0; - p->_bits[i] >>= 1; - p->_bits[i] |= (lower<<((CNODEMASK_BIPW-1))); - } - p->_bits[i] >>= 1; -} - -__inline static cnodemask_t CNODEMASK_FROM_NUMNODES(int n) -{ - cnodemask_t __tmp; - int i; - CNODEMASK_CLRALL(__tmp); - for (i=0; i - -#include +#include #include #include -#include -/* #include */ -#ifdef LATER -typedef struct module_s module_t; /* Avoids sys/SN/module.h */ -#else +#if defined(CONFIG_IA64_SGI_SN1) +#include +#endif +#include #include +#include + +#if defined(CONFIG_IA64_SGI_SN1) +#include #endif -/* #include */ /* * NUMA Node-Specific Data structures are defined in this file. @@ -37,26 +33,16 @@ /* * Subnode PDA structures. Each node needs a few data structures that * correspond to the PIs on the HUB chip that supports the node. - * - * WARNING!!!! 6.5.x compatibility requirements prevent us from - * changing or reordering fields in the following structure for IP27. - * It is essential that the data mappings not change for IP27 platforms. - * It is OK to add fields that are IP35 specific if they are under #ifdef IP35. */ +#if defined(CONFIG_IA64_SGI_SN1) struct subnodepda_s { intr_vecblk_t intr_dispatch0; intr_vecblk_t intr_dispatch1; - uint64_t next_prof_timeout; - int prof_count; }; - typedef struct subnodepda_s subnode_pda_t; -struct ptpool_s; - -#if defined(CONFIG_IA64_SGI_SYNERGY_PERF) struct synergy_perf_s; #endif @@ -65,8 +51,6 @@ * Node-specific data structure. * * One of these structures is allocated on each node of a NUMA system. - * Non-NUMA systems are considered to be systems with one node, and - * hence there will be one of this structure for the entire system. * * This structure provides a convenient way of keeping together * all per-node data structures. @@ -74,119 +58,13 @@ -#ifdef LATER -/* - * The following structure is contained in the nodepda & contains - * a lock & queue-head for sanon pages that belong to the node. - * See the anon manager for more details. - */ -typedef struct { - lock_t sal_lock; - plist_t sal_listhead; -} sanon_list_head_t; -#endif struct nodepda_s { -#ifdef NUMA_BASE - - /* - * Pointer to this node's copy of Nodepdaindr - */ - struct nodepda_s **pernode_pdaindr; - - /* - * Data used for migration control - */ - struct migr_control_data_s *mcd; - - /* - * Data used for replication control - */ - struct repl_control_data_s *rcd; - - /* - * Numa statistics - */ - struct numa_stats_s *numa_stats; - - /* - * Load distribution - */ - uint memfit_assign; - - /* - * New extended memory reference counters - */ - void *migr_refcnt_counterbase; - void *migr_refcnt_counterbuffer; - size_t migr_refcnt_cbsize; - int migr_refcnt_numsets; - - /* - * mem_tick quiescing lock - */ - uint mem_tick_lock; - - /* - * Migration candidate set - * by migration prologue intr handler - */ - uint64_t migr_candidate; - - /* - * Each node gets its own syswait counter to remove contention - * on the global one. - */ -#ifdef LATER - struct syswait syswait; -#endif - -#endif /* NUMA_BASE */ - /* - * Node-specific Zone structures. - */ -#ifdef LATER - zoneset_element_t node_zones; - pg_data_t node_pg_data; /* VM page data structures */ - plist_t error_discard_plist; -#endif - uint error_discard_count; - uint error_page_count; - uint error_cleaned_count; - spinlock_t error_discard_lock; - /* Information needed for SN Hub chip interrupt handling. */ - subnode_pda_t snpda[NUM_SUBNODES]; - /* Distributed kernel support */ -#ifdef LATER - kern_vars_t kern_vars; -#endif - /* Vector operation support */ - /* Change this to a sleep lock? */ - spinlock_t vector_lock; - /* State of the vector unit for this node */ - char vector_unit_busy; cpuid_t node_first_cpu; /* Starting cpu number for node */ - ushort node_num_cpus; /* Number of cpus present */ - - /* node utlbmiss info */ - spinlock_t node_utlbswitchlock; - volatile cpumask_t node_utlbmiss_flush; - volatile signed char node_need_utlbmiss_patch; - volatile char node_utlbmiss_patched; - nodepda_router_info_t *npda_rip_first; - nodepda_router_info_t **npda_rip_last; - int dependent_routers; - -#if defined(CONFIG_IA64_SGI_SYNERGY_PERF) - int synergy_perf_enabled; - int synergy_perf_freq; - spinlock_t synergy_perf_lock; - uint64_t synergy_inactive_intervals; - uint64_t synergy_active_intervals; - struct synergy_perf_s *synergy_perf_data; - struct synergy_perf_s *synergy_perf_first; /* reporting consistency .. */ -#endif /* CONFIG_IA64_SGI_SYNERGY_PERF */ + /* WARNING: no guarantee that */ + /* the second cpu on a node is */ + /* node_first_cpu+1. */ devfs_handle_t xbow_vhdl; nasid_t xbow_peer; /* NASID of our peer hub on xbow */ @@ -194,84 +72,67 @@ slotid_t slotdesc; moduleid_t module_id; /* Module ID (redundant local copy) */ module_t *module; /* Pointer to containing module */ - int hub_chip_rev; /* Rev of my Hub chip */ - char nasid_mask[NASID_MASK_BYTES]; - /* Need a copy of the nasid mask - * on every node */ xwidgetnum_t basew_id; devfs_handle_t basew_xc; - spinlock_t fprom_lock; - char ni_error_print; /* For printing ni error state - * only once during system panic - */ -#ifdef LATER - md_perf_monitor_t node_md_perfmon; - hubstat_t hubstats; int hubticks; - sbe_info_t *sbe_info; /* ECC single-bit error statistics */ -#endif /* LATER */ - int huberror_ticks; - - router_queue_t *visited_router_q; - router_queue_t *bfs_router_q; - /* Used for router traversal */ -#if defined (CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) - router_map_ent_t router_map[MAX_RTR_BREADTH]; -#endif - int num_routers; /* Total routers in the system */ + int num_routers; /* XXX not setup! Total routers in the system */ - char membank_flavor; - /* Indicates what sort of memory - * banks are present on this node - */ char *hwg_node_name; /* hwgraph node name */ - - struct widget_info_t *widget_info; /* Node as xtalk widget */ devfs_handle_t node_vertex; /* Hwgraph vertex for this node */ void *pdinfo; /* Platform-dependent per-node info */ - uint64_t *dump_stack; /* Dump stack during nmi handling */ - int dump_count; /* To allow only one cpu-per-node */ -#ifdef LATER - io_perf_monitor_t node_io_perfmon; -#endif - /* - * Each node gets its own pdcount counter to remove contention - * on the global one. - */ - - int pdcount; /* count of pdinserted pages */ -#ifdef NUMA_BASE - void *cached_global_pool; /* pointer to cached vmpool */ -#endif /* NUMA_BASE */ + nodepda_router_info_t *npda_rip_first; + nodepda_router_info_t **npda_rip_last; -#ifdef LATER - sanon_list_head_t sanon_list_head; /* head for sanon pages */ -#endif -#ifdef NUMA_BASE - struct ptpool_s *ptpool; /* ptpool for this node */ -#endif /* NUMA_BASE */ /* * The BTEs on this node are shared by the local cpus */ -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) -#ifdef LATER - bteinfo_t *node_bte_info[BTES_PER_NODE]; -#endif -#endif + bteinfo_t node_bte_info[BTES_PER_NODE]; + +#if defined(CONFIG_IA64_SGI_SN1) + subnode_pda_t snpda[NUM_SUBNODES]; + /* + * New extended memory reference counters + */ + void *migr_refcnt_counterbase; + void *migr_refcnt_counterbuffer; + size_t migr_refcnt_cbsize; + int migr_refcnt_numsets; + hubstat_t hubstats; + int synergy_perf_enabled; + int synergy_perf_freq; + spinlock_t synergy_perf_lock; + uint64_t synergy_inactive_intervals; + uint64_t synergy_active_intervals; + struct synergy_perf_s *synergy_perf_data; + struct synergy_perf_s *synergy_perf_first; /* reporting consistency .. */ +#endif /* CONFIG_IA64_SGI_SN1 */ + + /* + * Array of pointers to the nodepdas for each node. + */ + struct nodepda_s *pernode_pdaindr[MAX_COMPACT_NODES]; + }; typedef struct nodepda_s nodepda_t; +#ifdef CONFIG_IA64_SGI_SN2 +struct irqpda_s { + int num_irq_used; + char irq_flags[NR_IRQS]; +}; + +typedef struct irqpda_s irqpda_t; + +#endif /* CONFIG_IA64_SGI_SN2 */ + -#define NODE_MODULEID(_node) (NODEPDA(_node)->module_id) -#define NODE_SLOTID(_node) (NODEPDA(_node)->slotdesc) -#ifdef NUMA_BASE /* * Access Functions for node PDA. * Since there is one nodepda for each node, we need a convenient mechanism @@ -279,180 +140,49 @@ * The next set of definitions provides this. * Routines are expected to use * - * nodepda -> to access PDA for the node on which code is running - * subnodepda -> to access subnode PDA for the node on which code is running + * nodepda -> to access node PDA for the node on which code is running + * subnodepda -> to access subnode PDA for the subnode on which code is running * - * NODEPDA(x) -> to access node PDA for cnodeid 'x' - * SUBNODEPDA(x,s) -> to access subnode PDA for cnodeid/slice 'x' - */ - -#ifdef LATER -#define nodepda private.p_nodepda /* Ptr to this node's PDA */ -#if CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 || CONFIG_IA64_GENERIC -#define subnodepda private.p_subnodepda /* Ptr to this node's subnode PDA */ -#endif - -#else -/* - * Until we have a shared node local area defined, do it this way .. - * like in Caliase space. See above. - */ -extern nodepda_t *nodepda; -extern subnode_pda_t *subnodepda; -#endif - -/* - * Nodepdaindr[] - * This is a private data structure for use only in early initialization. - * All users of nodepda should use the macro NODEPDA(nodenum) to get - * the suitable nodepda structure. - * This macro has the advantage of not requiring #ifdefs for NUMA and - * non-NUMA code. - */ -extern nodepda_t *Nodepdaindr[]; -/* - * NODEPDA_GLOBAL(x) macro should ONLY be used during early initialization. - * Once meminit is complete, NODEPDA(x) is ready to use. - * During early init, the system fills up Nodepdaindr. By the time we - * are in meminit(), all nodepdas are initialized, and hence - * we can fill up the node_pdaindr array in each nodepda structure. + * NODEPDA(cnode) -> to access node PDA for cnodeid + * SUBNODEPDA(cnode,sn) -> to access subnode PDA for cnodeid/subnode */ -#define NODEPDA_GLOBAL(x) Nodepdaindr[x] -/* - * Returns a pointer to a given node's nodepda. - */ -#define NODEPDA(x) (nodepda->pernode_pdaindr[x]) +#define nodepda pda.p_nodepda /* Ptr to this node's PDA */ +#define NODEPDA(cnode) (nodepda->pernode_pdaindr[cnode]) -/* - * Returns a pointer to a given node/slice's subnodepda. - * SUBNODEPDA(cnode, subnode) - uses cnode as first arg - * SNPDA(npda, subnode) - uses pointer to nodepda as first arg - */ -#define SUBNODEPDA(x,sn) (&nodepda->pernode_pdaindr[x]->snpda[sn]) +#if defined(CONFIG_IA64_SGI_SN1) +#define subnodepda pda.p_subnodepda /* Ptr to this node's subnode PDA */ +#define SUBNODEPDA(cnode,sn) (&(NODEPDA(cnode)->snpda[sn])) #define SNPDA(npda,sn) (&(npda)->snpda[sn]) +#endif -#define NODEPDA_ERROR_FOOTPRINT(node, cpu) \ - (&(NODEPDA(node)->error_stamp[cpu])) -#define NODEPDA_MDP_MON(node) (&(NODEPDA(node)->node_md_perfmon)) -#define NODEPDA_IOP_MON(node) (&(NODEPDA(node)->node_io_perfmon)) /* * Macros to access data structures inside nodepda */ -#if NUMA_MIGR_CONTROL -#define NODEPDA_MCD(node) (NODEPDA(node)->mcd) -#endif /* NUMA_MIGR_CONTROL */ - -#if NUMA_REPL_CONTROL -#define NODEPDA_RCD(node) (NODEPDA(node)->rcd) -#endif /* NUMA_REPL_CONTROL */ - -#if (NUMA_MIGR_CONTROL || NUMA_REPL_CONTROL) -#define NODEPDA_LRS(node) (NODEPDA(node)->lrs) -#endif /* (NUMA_MIGR_CONTROL || NUMA_REPL_CONTROL) */ +#define NODE_MODULEID(cnode) (NODEPDA(cnode)->module_id) +#define NODE_SLOTID(cnode) (NODEPDA(cnode)->slotdesc) -/* - * Exported functions - */ -extern nodepda_t *nodepda_alloc(void); -#else /* !NUMA_BASE */ /* - * For a single-node system we will just have one global nodepda pointer - * allocated at startup. The global nodepda will point to this nodepda - * structure. + * Quickly convert a compact node ID into a hwgraph vertex */ -extern nodepda_t *Nodepdaindr; +#define cnodeid_to_vertex(cnodeid) (NODEPDA(cnodeid)->node_vertex) -/* - * On non-NUMA systems, NODEPDA_GLOBAL and NODEPDA macros collapse to - * be the same. - */ -#define NODEPDA_GLOBAL(x) Nodepdaindr /* - * Returns a pointer to a given node's nodepda. + * Check if given a compact node id the corresponding node has all the + * cpus disabled. */ -#define NODEPDA(x) Nodepdaindr +#define is_headless_node(cnode) ((cnode == CNODEID_NONE) || \ + (node_data(cnode)->active_cpu_count == 0)) /* - * nodepda can also be defined as private.p_nodepda. - * But on non-NUMA systems, there is only one nodepda, and there is - * no reason to go through the PDA to access this pointer. - * Hence nodepda aliases to the global nodepda directly. - * - * Routines should use nodepda to access the local node's PDA. - */ -#define nodepda (Nodepdaindr) - -#endif /* NUMA_BASE */ - -/* Quickly convert a compact node ID into a hwgraph vertex */ -#define cnodeid_to_vertex(cnodeid) (NODEPDA(cnodeid)->node_vertex) - - -/* Check if given a compact node id the corresponding node has all the - * cpus disabled. - */ -#define is_headless_node(_cnode) ((_cnode == CNODEID_NONE) || \ - (CNODE_NUM_CPUS(_cnode) == 0)) -/* Check if given a node vertex handle the corresponding node has all the + * Check if given a node vertex handle the corresponding node has all the * cpus disabled. */ #define is_headless_node_vertex(_nodevhdl) \ is_headless_node(nodevertex_to_cnodeid(_nodevhdl)) -#ifdef __cplusplus -} -#endif - -#ifdef NUMA_BASE -/* - * To remove contention on the global syswait counter each node will have - * its own. Each clock tick the clock cpu will re-calculate the global - * syswait counter by summing from each of the nodes. The other cpus will - * continue to read the global one during their clock ticks. This does - * present a problem when a thread increments the count on one node and wakes - * up on a different node and decrements it there. Eventually the count could - * overflow if this happens continually for a long period. To prevent this - * second_thread() periodically preserves the current syswait state and - * resets the counters. - */ -#define ADD_SYSWAIT(_field) atomicAddInt(&nodepda->syswait._field, 1) -#define SUB_SYSWAIT(_field) atomicAddInt(&nodepda->syswait._field, -1) -#else -#define ADD_SYSWAIT(_field) \ -{ \ - ASSERT(syswait._field >= 0); \ - atomicAddInt(&syswait._field, 1); \ -} -#define SUB_SYSWAIT(_field) \ -{ \ - ASSERT(syswait._field > 0); \ - atomicAddInt(&syswait._field, -1); \ -} -#endif /* NUMA_BASE */ - -#ifdef NUMA_BASE -/* - * Another global variable to remove contention from: pdcount. - * See above comments for SYSWAIT. - */ -#define ADD_PDCOUNT(_n) \ -{ \ - atomicAddInt(&nodepda->pdcount, _n); \ - if (_n > 0 && !pdflag) \ - pdflag = 1; \ -} -#else -#define ADD_PDCOUNT(_n) \ -{ \ - ASSERT(&pdcount >= 0); \ - atomicAddInt(&pdcount, _n); \ - if (_n > 0 && !pdflag) \ - pdflag = 1; \ -} -#endif /* NUMA_BASE */ -#endif /* _ASM_SN_NODEPDA_H */ +#endif /* _ASM_IA64_SN_NODEPDA_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/pci/bridge.h lia64-2.4/include/asm-ia64/sn/pci/bridge.h --- linux-2.4.18/include/asm-ia64/sn/pci/bridge.h Tue Mar 6 19:44:34 2001 +++ lia64-2.4/include/asm-ia64/sn/pci/bridge.h Mon Nov 19 23:22:55 2001 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_SN_PCI_BRIDGE_H #define _ASM_SN_PCI_BRIDGE_H @@ -53,7 +52,7 @@ * Bridge address map */ -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) +#ifndef __ASSEMBLY__ #ifdef __cplusplus extern "C" { @@ -373,7 +372,7 @@ ds:2, /* Data size */ gbr:1, /* GBR enable */ vbpm:1, /* VBPM message */ - error:1, /* Error occurred */ + error:1, /* Error occurred */ barr:1, /* Barrier op */ rsvd:8; } berr_st; @@ -638,7 +637,7 @@ #define berr_field berr_un.berr_st -#endif /* LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ /* * The values of these macros can and should be crosschecked @@ -903,10 +902,10 @@ #define BRIDGE_DEVIO_2MB 0x00200000 /* Device IO Offset (0..1) */ #define BRIDGE_DEVIO_1MB 0x00100000 /* Device IO Offset (2..7) */ -#if LANGUAGE_C +#ifndef __ASSEMBLY__ #define BRIDGE_DEVIO(x) ((x)<=1 ? BRIDGE_DEVIO0+(x)*BRIDGE_DEVIO_2MB : BRIDGE_DEVIO2+((x)-2)*BRIDGE_DEVIO_1MB) -#endif /* LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ #define BRIDGE_EXTERNAL_FLASH 0x00C00000 /* External Flash PROMS */ @@ -971,6 +970,10 @@ #define BRIDGE_CTRL_CLR_RLLP_CNT (0x1 << 11) #define BRIDGE_CTRL_CLR_TLLP_CNT (0x1 << 10) #define BRIDGE_CTRL_SYS_END (0x1 << 9) +#define BRIDGE_CTRL_BUS_SPEED(n) ((n) << 4) +#define BRIDGE_CTRL_BUS_SPEED_MASK (BRIDGE_CTRL_BUS_SPEED(0x3)) +#define BRIDGE_CTRL_BUS_SPEED_33 0x00 +#define BRIDGE_CTRL_BUS_SPEED_66 0x10 #define BRIDGE_CTRL_MAX_TRANS(n) ((n) << 4) #define BRIDGE_CTRL_MAX_TRANS_MASK (BRIDGE_CTRL_MAX_TRANS(0x1f)) #define BRIDGE_CTRL_WIDGET_ID(n) ((n) << 0) @@ -1296,14 +1299,14 @@ #define PCI32_MAPPED_BASE BRIDGE_DMA_MAPPED_BASE #define PCI32_DIRECT_BASE BRIDGE_DMA_DIRECT_BASE -#if LANGUAGE_C +#ifndef __ASSEMBLY__ #define IS_PCI32_LOCAL(x) ((uint64_t)(x) < PCI32_MAPPED_BASE) #define IS_PCI32_MAPPED(x) ((uint64_t)(x) < PCI32_DIRECT_BASE && \ (uint64_t)(x) >= PCI32_MAPPED_BASE) #define IS_PCI32_DIRECT(x) ((uint64_t)(x) >= PCI32_MAPPED_BASE) #define IS_PCI64(x) ((uint64_t)(x) >= PCI64_BASE) -#endif /* LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ /* * The GIO address space. @@ -1318,13 +1321,13 @@ #define GIO_MAPPED_BASE BRIDGE_DMA_MAPPED_BASE #define GIO_DIRECT_BASE BRIDGE_DMA_DIRECT_BASE -#if LANGUAGE_C +#ifndef __ASSEMBLY__ #define IS_GIO_LOCAL(x) ((uint64_t)(x) < GIO_MAPPED_BASE) #define IS_GIO_MAPPED(x) ((uint64_t)(x) < GIO_DIRECT_BASE && \ (uint64_t)(x) >= GIO_MAPPED_BASE) #define IS_GIO_DIRECT(x) ((uint64_t)(x) >= GIO_MAPPED_BASE) -#endif /* LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ /* PCI to xtalk mapping */ @@ -1347,7 +1350,7 @@ #define PCI64_ATTR_RMF_MASK 0x00ff000000000000 #define PCI64_ATTR_RMF_SHFT 48 -#if LANGUAGE_C +#ifndef __ASSEMBLY__ /* Address translation entry for mapped pci32 accesses */ typedef union ate_u { uint64_t ent; @@ -1375,7 +1378,7 @@ uint64_t valid:1; } field; } ate_t; -#endif /* LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ #define ATE_V (1 << 0) #define ATE_CO (1 << 1) @@ -1401,7 +1404,7 @@ #define is_xbridge(bridge) \ (XWIDGET_PART_NUM(bridge->b_wid_id) == XBRIDGE_WIDGET_PART_NUM) -#if LANGUAGE_C +#ifndef __ASSEMBLY__ /* ======================================================================== */ diff -urN linux-2.4.18/include/asm-ia64/sn/pci/pci_bus_cvlink.h lia64-2.4/include/asm-ia64/sn/pci/pci_bus_cvlink.h --- linux-2.4.18/include/asm-ia64/sn/pci/pci_bus_cvlink.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/pci/pci_bus_cvlink.h Tue Feb 26 13:19:35 2002 @@ -4,29 +4,61 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_SN_PCI_CVLINK_H #define _ASM_SN_PCI_CVLINK_H +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define MAX_PCI_XWIDGET 256 +#define MAX_ATE_MAPS 1024 + #define SET_PCIA64(dev) \ - (((struct sn1_device_sysdata *)((dev)->sysdata))->isa64) = 1 + (((struct sn_device_sysdata *)((dev)->sysdata))->isa64) = 1 #define IS_PCIA64(dev) (((dev)->dma_mask == 0xffffffffffffffffUL) || \ - (((struct sn1_device_sysdata *)((dev)->sysdata))->isa64)) + (((struct sn_device_sysdata *)((dev)->sysdata))->isa64)) #define IS_PCI32G(dev) ((dev)->dma_mask >= 0xffffffff) #define IS_PCI32L(dev) ((dev)->dma_mask < 0xffffffff) -struct sn1_widget_sysdata { +#define PCIDEV_VERTEX(pci_dev) \ + (((struct sn_device_sysdata *)((pci_dev)->sysdata))->vhdl) + +#define PCIBUS_VERTEX(pci_bus) \ + (((struct sn_widget_sysdata *)((pci_bus)->sysdata))->vhdl) + +struct sn_widget_sysdata { devfs_handle_t vhdl; }; -struct sn1_device_sysdata { +struct sn_device_sysdata { devfs_handle_t vhdl; int isa64; + volatile unsigned int *dma_buf_sync; + volatile unsigned int *xbow_buf_sync; }; -struct sn1_dma_maps_s{ +struct sn_dma_maps_s{ struct pcibr_dmamap_s dma_map; dma_addr_t dma_addr; }; diff -urN linux-2.4.18/include/asm-ia64/sn/pci/pci_defs.h lia64-2.4/include/asm-ia64/sn/pci/pci_defs.h --- linux-2.4.18/include/asm-ia64/sn/pci/pci_defs.h Thu Jan 4 15:25:55 2001 +++ lia64-2.4/include/asm-ia64/sn/pci/pci_defs.h Mon Nov 19 23:22:55 2001 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_SN_PCI_PCI_DEFS_H #define _ASM_SN_PCI_PCI_DEFS_H diff -urN linux-2.4.18/include/asm-ia64/sn/pci/pciba.h lia64-2.4/include/asm-ia64/sn/pci/pciba.h --- linux-2.4.18/include/asm-ia64/sn/pci/pciba.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/pci/pciba.h Mon Nov 19 23:22:55 2001 @@ -1,24 +1,33 @@ -/* $Id$ +/* + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file "COPYING" in the main directory of + * this archive for more details. * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. + * Copyright (C) 1997, 2001 Silicon Graphics, Inc. All rights reserved. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam */ + #ifndef _ASM_SN_PCI_PCIBA_H #define _ASM_SN_PCI_PCIBA_H -/* - * These are all the HACKS from ioccom.h .. - */ -#define IOCPARM_MASK 0xff /* parameters must be < 256 bytes */ -#define IOC_VOID 0x20000000 /* no parameters */ +#include +#include +#include + +/* for application compatibility with IRIX (why do I bother?) */ + +#ifndef __KERNEL__ +typedef u_int8_t uint8_t; +typedef u_int16_t uint16_t; +typedef u_int32_t uint32_t; +#endif + +#define PCI_CFG_VENDOR_ID PCI_VENDOR_ID +#define PCI_CFG_COMMAND PCI_COMMAND +#define PCI_CFG_REV_ID PCI_REVISION_ID +#define PCI_CFG_HEADER_TYPE PCI_HEADER_TYPE +#define PCI_CFG_BASE_ADDR(n) PCI_BASE_ADDRESS_##n -/* - * The above needs to be modified and follow LINUX ... - */ /* /hw/.../pci/[slot]/config accepts ioctls to read * and write specific registers as follows: @@ -69,18 +78,11 @@ /* PCIIOCGETBASE(n): arg is ptr to a 32-bit int, * which will get the value of the BASE register. */ + +/* FIXME chadt: this doesn't tell me whether or not this will work + with non-constant 'n.' */ #define PCIIOCGETBASE(n) PCIIOCCFGRD(uint32_t,PCI_CFG_BASE_ADDR(n)) -/* /hw/.../pci/[slot]/intr accepts an ioctl to - * set up user level interrupt handling as follows: - * - * "n" is a bitmap of which of the four PCI interrupt - * lines are of interest, using PCIIO_INTR_LINE_[ABCD]. - */ -#define PCIIOCSETULI(n) _IOWR(1,n,struct uliargs) -#if _KERNEL -#define PCIIOCSETULI32(n) _IOWR(1,n,struct uliargs32) -#endif /* /hw/.../pci/[slot]/dma accepts ioctls to allocate * and free physical memory for use in user-triggered @@ -93,11 +95,20 @@ * both the size of the request and the flag values * to be used in setting up the DMA. * + +FIXME chadt: gonna have to revisit this: what flags would an IRIXer like to + have available? + * Any flags normally useful in pciio_dmamap - * or pciio_dmatrans function calls can6 be used here. - */ + * or pciio_dmatrans function calls can6 be used here. */ #define PCIIOCDMAALLOC_REQUEST_PACK(flags,size) \ ((((uint64_t)(flags))<<32)| \ (((uint64_t)(size))&0xFFFFFFFF)) + + +#ifdef __KERNEL__ +extern int pciba_init(void); +#endif + #endif /* _ASM_SN_PCI_PCIBA_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/pci/pcibr.h lia64-2.4/include/asm-ia64/sn/pci/pcibr.h --- linux-2.4.18/include/asm-ia64/sn/pci/pcibr.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/pci/pcibr.h Mon Nov 19 23:22:55 2001 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_SN_PCI_PCIBR_H #define _ASM_SN_PCI_PCIBR_H @@ -13,7 +12,7 @@ #if defined(__KERNEL__) #include -#include +#include #include #include @@ -31,7 +30,7 @@ #define PCIBR_INTR_BLOCKED 0x40000000 #define PCIBR_INTR_BUSY 0x80000000 -#if LANGUAGE_C +#ifndef __ASSEMBLY__ /* ===================================================================== * opaque types used by pcibr's xtalk bus provider @@ -183,10 +182,7 @@ extern void pcibr_intr_free(pcibr_intr_t intr); -extern int pcibr_intr_connect(pcibr_intr_t intr, - intr_func_t intr_func, - intr_arg_t intr_arg, - void *thread); +extern int pcibr_intr_connect(pcibr_intr_t intr); extern void pcibr_intr_disconnect(pcibr_intr_t intr); @@ -349,7 +345,7 @@ extern int pcibr_asic_rev(devfs_handle_t); -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ #endif /* #if defined(__KERNEL__) */ /* * Some useful ioctls into the pcibr driver @@ -390,10 +386,34 @@ /* * Structures for requesting PCI bridge information and receiving a response */ -typedef struct pcibr_slot_info_req_s *pcibr_slot_info_req_t; +typedef struct pcibr_slot_req_s *pcibr_slot_req_t; +typedef struct pcibr_slot_up_resp_s *pcibr_slot_up_resp_t; +typedef struct pcibr_slot_down_resp_s *pcibr_slot_down_resp_t; typedef struct pcibr_slot_info_resp_s *pcibr_slot_info_resp_t; typedef struct pcibr_slot_func_info_resp_s *pcibr_slot_func_info_resp_t; +#define L1_QSIZE 128 /* our L1 message buffer size */ +struct pcibr_slot_req_s { + int req_slot; + union { + pcibr_slot_up_resp_t up; + pcibr_slot_down_resp_t down; + pcibr_slot_info_resp_t query; + void *any; + } req_respp; + int req_size; +}; + +struct pcibr_slot_up_resp_s { + int resp_sub_errno; + char resp_l1_msg[L1_QSIZE + 1]; +}; + +struct pcibr_slot_down_resp_s { + int resp_sub_errno; + char resp_l1_msg[L1_QSIZE + 1]; +}; + struct pcibr_slot_info_req_s { int req_slot; pcibr_slot_info_resp_t req_respp; @@ -454,7 +474,40 @@ int resp_f_att_det_error; } resp_func[8]; - }; + + +/* + * PCI specific errors, interpreted by pciconfig command + */ + +/* EPERM 1 */ +#define PCI_SLOT_ALREADY_UP 2 /* slot already up */ +#define PCI_SLOT_ALREADY_DOWN 3 /* slot already down */ +#define PCI_IS_SYS_CRITICAL 4 /* slot is system critical */ +/* EIO 5 */ +/* ENXIO 6 */ +#define PCI_L1_ERR 7 /* L1 console command error */ +#define PCI_NOT_A_BRIDGE 8 /* device is not a bridge */ +#define PCI_SLOT_IN_SHOEHORN 9 /* slot is in a shorhorn */ +#define PCI_NOT_A_SLOT 10 /* slot is invalid */ +#define PCI_RESP_AREA_TOO_SMALL 11 /* slot is invalid */ +/* ENOMEM 12 */ +#define PCI_NO_DRIVER 13 /* no driver for device */ +/* EFAULT 14 */ +#define PCI_EMPTY_33MHZ 15 /* empty 33 MHz bus */ +/* EBUSY 16 */ +#define PCI_SLOT_RESET_ERR 17 /* slot reset error */ +#define PCI_SLOT_INFO_INIT_ERR 18 /* slot info init error */ +/* ENODEV 19 */ +#define PCI_SLOT_ADDR_INIT_ERR 20 /* slot addr space init error */ +#define PCI_SLOT_DEV_INIT_ERR 21 /* slot device init error */ +/* EINVAL 22 */ +#define PCI_SLOT_GUEST_INIT_ERR 23 /* slot guest info init error */ +#define PCI_SLOT_RRB_ALLOC_ERR 24 /* slot initial rrb alloc error */ +#define PCI_SLOT_DRV_ATTACH_ERR 25 /* driver attach error */ +#define PCI_SLOT_DRV_DETACH_ERR 26 /* driver detach error */ +/* ERANGE 34 */ +/* EUNATCH 42 */ #endif /* _ASM_SN_PCI_PCIBR_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/pci/pcibr_private.h lia64-2.4/include/asm-ia64/sn/pci/pcibr_private.h --- linux-2.4.18/include/asm-ia64/sn/pci/pcibr_private.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/pci/pcibr_private.h Mon Feb 4 17:48:56 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_SN_PCI_PCIBR_PRIVATE_H #define _ASM_SN_PCI_PCIBR_PRIVATE_H @@ -16,6 +15,7 @@ * should ever peek into this file. */ +#include #include #include @@ -100,9 +100,6 @@ #define bi_flags bi_pi.pi_flags /* PCIBR_INTR flags */ #define bi_dev bi_pi.pi_dev /* associated pci card */ #define bi_lines bi_pi.pi_lines /* which PCI interrupt line(s) */ -#define bi_func bi_pi.pi_func /* handler function (when connected) */ -#define bi_arg bi_pi.pi_arg /* handler parameter (when connected) */ -#define bi_tinfo bi_pi.pi_tinfo /* Thread info (when connected) */ #define bi_mustruncpu bi_pi.pi_mustruncpu /* Where we must run. */ #define bi_irq bi_pi.pi_irq /* IRQ assigned. */ #define bi_cpu bi_pi.pi_cpu /* cpu assigned. */ @@ -173,14 +170,17 @@ */ struct pcibr_soft_s { - devfs_handle_t bs_conn; /* xtalk connection point */ - devfs_handle_t bs_vhdl; /* vertex owned by pcibr */ + devfs_handle_t bs_conn; /* xtalk connection point */ + devfs_handle_t bs_vhdl; /* vertex owned by pcibr */ int bs_int_enable; /* Mask of enabled intrs */ - bridge_t *bs_base; /* PIO pointer to Bridge chip */ - char *bs_name; /* hw graph name */ - xwidgetnum_t bs_xid; /* Bridge's xtalk ID number */ - devfs_handle_t bs_master; /* xtalk master vertex */ - xwidgetnum_t bs_mxid; /* master's xtalk ID number */ + bridge_t *bs_base; /* PIO pointer to Bridge chip */ + char *bs_name; /* hw graph name */ + xwidgetnum_t bs_xid; /* Bridge's xtalk ID number */ + devfs_handle_t bs_master; /* xtalk master vertex */ + xwidgetnum_t bs_mxid; /* master's xtalk ID number */ + pciio_slot_t bs_first_slot; /* first existing slot */ + pciio_slot_t bs_last_slot; /* last existing slot */ + iopaddr_t bs_dir_xbase; /* xtalk address for 32-bit PCI direct map */ xwidgetnum_t bs_dir_xport; /* xtalk port for 32-bit PCI direct map */ @@ -190,7 +190,7 @@ short bs_int_ate_size; /* number of internal ates */ short bs_xbridge; /* if 1 then xbridge */ - int bs_rev_num; /* revision number of Bridge */ + int bs_rev_num; /* revision number of Bridge */ unsigned bs_dma_flags; /* revision-implied DMA flags */ @@ -253,6 +253,7 @@ struct { pciio_space_t bssd_space; iopaddr_t bssd_base; + int bssd_ref_cnt; } bss_devio; /* Shadow value for Device(x) register, @@ -312,7 +313,9 @@ int bs_rrb_fixed; int bs_rrb_avail[2]; int bs_rrb_res[8]; - int bs_rrb_valid[16]; + int bs_rrb_res_dflt[8]; + int bs_rrb_valid[16]; + int bs_rrb_valid_dflt[16]; struct { /* Each Bridge interrupt bit has a single XIO @@ -433,5 +436,42 @@ #define pcibr_soft_get(v) ((pcibr_soft_t)hwgraph_fastinfo_get((v))) #define pcibr_soft_set(v,i) (hwgraph_fastinfo_set((v), (arbitrary_info_t)(i))) + +/* Use io spin locks. This ensures that all the PIO writes from a particular + * CPU to a particular IO device are synched before the start of the next + * set of PIO operations to the same device. + */ +#define pcibr_lock(pcibr_soft) io_splock(&pcibr_soft->bs_lock) +#define pcibr_unlock(pcibr_soft,s) io_spunlock(&pcibr_soft->bs_lock,s) + +/* + * mem alloc/free macros + */ +#define NEWAf(ptr,n,f) (ptr = snia_kmem_zalloc((n)*sizeof (*(ptr)), (f&PCIIO_NOSLEEP)?KM_NOSLEEP:KM_SLEEP)) +#define NEWA(ptr,n) (ptr = snia_kmem_zalloc((n)*sizeof (*(ptr)), KM_SLEEP)) +#define DELA(ptr,n) (kfree(ptr)) + +#define NEWf(ptr,f) NEWAf(ptr,1,f) +#define NEW(ptr) NEWA(ptr,1) +#define DEL(ptr) DELA(ptr,1) + +typedef volatile unsigned *cfg_p; +typedef volatile bridgereg_t *reg_p; + +#define PCIBR_RRB_SLOT_VIRTUAL 8 +#define PCIBR_VALID_SLOT(s) (s < 8) +#define PCIBR_D64_BASE_UNSET (0xFFFFFFFFFFFFFFFF) +#define PCIBR_D32_BASE_UNSET (0xFFFFFFFF) +#define INFO_LBL_PCIBR_ASIC_REV "_pcibr_asic_rev" + +#define PCIBR_SOFT_LIST 1 +#if PCIBR_SOFT_LIST +typedef struct pcibr_list_s *pcibr_list_p; +struct pcibr_list_s { + pcibr_list_p bl_next; + pcibr_soft_t bl_soft; + devfs_handle_t bl_vhdl; +}; +#endif /* PCIBR_SOFT_LIST */ #endif /* _ASM_SN_PCI_PCIBR_PRIVATE_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/pci/pciio.h lia64-2.4/include/asm-ia64/sn/pci/pciio.h --- linux-2.4.18/include/asm-ia64/sn/pci/pciio.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/pci/pciio.h Mon Feb 4 17:48:56 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_SN_PCI_PCIIO_H #define _ASM_SN_PCI_PCIIO_H @@ -15,25 +14,22 @@ */ #include -#include +#include +#include -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) +#ifndef __ASSEMBLY__ #include #include -#ifdef __cplusplus -extern "C" { -#endif - typedef int pciio_vendor_id_t; -#define PCIIO_VENDOR_ID_NONE -1 +#define PCIIO_VENDOR_ID_NONE (-1) typedef int pciio_device_id_t; -#define PCIIO_DEVICE_ID_NONE -1 +#define PCIIO_DEVICE_ID_NONE (-1) typedef uint8_t pciio_bus_t; /* PCI bus number (0..255) */ typedef uint8_t pciio_slot_t; /* PCI slot number (0..31, 255) */ @@ -387,10 +383,7 @@ pciio_intr_free_f (pciio_intr_t intr_hdl); typedef int -pciio_intr_connect_f (pciio_intr_t intr_hdl, /* pciio intr resource handle */ - intr_func_t intr_func, /* pciio intr handler */ - intr_arg_t intr_arg, /* arg to intr handler */ - void *thread); /* intr thread to use */ +pciio_intr_connect_f (pciio_intr_t intr_hdl); /* pciio intr resource handle */ typedef void pciio_intr_disconnect_f (pciio_intr_t intr_hdl); @@ -729,8 +722,5 @@ extern int pciio_error_handler(devfs_handle_t, int, ioerror_mode_t, ioerror_t *); extern int pciio_dma_enabled(devfs_handle_t); -#ifdef __cplusplus -}; -#endif #endif /* C or C++ */ #endif /* _ASM_SN_PCI_PCIIO_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/pci/pciio_private.h lia64-2.4/include/asm-ia64/sn/pci/pciio_private.h --- linux-2.4.18/include/asm-ia64/sn/pci/pciio_private.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/pci/pciio_private.h Mon Feb 4 17:48:56 2002 @@ -4,12 +4,13 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_SN_PCI_PCIIO_PRIVATE_H #define _ASM_SN_PCI_PCIIO_PRIVATE_H +#include + /* * pciio_private.h -- private definitions for pciio * PCI drivers should NOT include this file. @@ -48,11 +49,6 @@ devfs_handle_t pi_dev; /* associated pci card */ device_desc_t pi_dev_desc; /* override device descriptor */ pciio_intr_line_t pi_lines; /* which interrupt line(s) */ - intr_func_t pi_func; /* handler function (when connected) */ - intr_arg_t pi_arg; /* handler parameter (when connected) */ -#ifdef LATER - thd_int_t pi_tinfo; /* Thread info (when connected) */ -#endif cpuid_t pi_mustruncpu; /* Where we must run. */ int pi_irq; /* IRQ assigned */ int pi_cpu; /* cpu assigned */ @@ -84,6 +80,8 @@ pciio_space_t w_space; iopaddr_t w_base; size_t w_size; + int w_devio_index; /* DevIO[] register used to + access this window */ } c_window[6]; unsigned c_rbase; /* EXPANSION ROM base addr */ diff -urN linux-2.4.18/include/asm-ia64/sn/pda.h lia64-2.4/include/asm-ia64/sn/pda.h --- linux-2.4.18/include/asm-ia64/sn/pda.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/pda.h Fri Jul 19 23:21:10 2002 @@ -0,0 +1,84 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ +#ifndef _ASM_IA64_SN_PDA_H +#define _ASM_IA64_SN_PDA_H + +#include +#include +#include +#include +#include +#include + + +/* + * CPU-specific data structure. + * + * One of these structures is allocated for each cpu of a NUMA system. + * + * This structure provides a convenient way of keeping together + * all SN per-cpu data structures. + */ + + + +typedef struct pda_s { + + /* Having a pointer in the begining of PDA tends to increase + * the chance of having this pointer in cache. (Yes something + * else gets pushed out). Doing this reduces the number of memory + * access to all nodepda variables to be one + */ + struct nodepda_s *p_nodepda; /* Pointer to Per node PDA */ + struct subnodepda_s *p_subnodepda; /* Pointer to CPU subnode PDA */ + + /* + * Support for SN LEDs + */ +#ifdef CONFIG_IA64_SGI_SN1 + volatile long *led_address; +#else + volatile short *led_address; +#endif + u8 led_state; + u8 hb_state; /* supports blinking heartbeat leds */ + unsigned int hb_count; + + unsigned int idle_flag; + +#ifdef CONFIG_IA64_SGI_SN2 + struct irqpda_s *p_irqpda; /* Pointer to CPU irq data */ +#endif + volatile unsigned long *bedrock_rev_id; + volatile unsigned long *pio_write_status_addr; + + bteinfo_t *cpubte[BTES_PER_NODE]; +} pda_t; + + +#define CACHE_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1)) + +/* + * PDA + * Per-cpu private data area for each cpu. The PDA is located immediately after + * the IA64 cpu_data area. A full page is allocated for the cp_data area for each + * cpu but only a small amout of the page is actually used. We put the SNIA PDA + * in the same page as the cpu_data area. Note that there is a check in the setup + * code to verify that we dont overflow the page. + * + * Seems like we should should cache-line align the pda so that any changes in the + * size of the cpu_data area dont change cache layout. Should we align to 32, 64, 128 + * or 512 boundary. Each has merits. For now, pick 128 but should be revisited later. + */ +#define CPU_DATA_END CACHE_ALIGN((long)&(((struct cpuinfo_ia64*)0)->platform_specific)) +#define PDAADDR (PERCPU_ADDR+CPU_DATA_END) + +#define pda (*((pda_t *) PDAADDR)) + + +#endif /* _ASM_IA64_SN_PDA_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/pio.h lia64-2.4/include/asm-ia64/sn/pio.h --- linux-2.4.18/include/asm-ia64/sn/pio.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/pio.h Mon Feb 4 17:48:56 2002 @@ -4,15 +4,14 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_PIO_H -#define _ASM_SN_PIO_H +#ifndef _ASM_IA64_SN_PIO_H +#define _ASM_IA64_SN_PIO_H #include #include -#include +#include /* * pioaddr_t - The kernel virtual address that a PIO can be done upon. @@ -143,7 +142,7 @@ #define LAN_RAM 2 #define LAN_IO 3 -#define PIOREG_NULL -1 +#define PIOREG_NULL (-1) /* standard flags values for pio_map routines, * including {xtalk,pciio}_piomap calls. @@ -156,4 +155,4 @@ #define PIOMAP_FLAGS 0x7 -#endif /* _ASM_SN_PIO_H */ +#endif /* _ASM_IA64_SN_PIO_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/prio.h lia64-2.4/include/asm-ia64/sn/prio.h --- linux-2.4.18/include/asm-ia64/sn/prio.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/prio.h Mon Feb 4 17:48:56 2002 @@ -4,11 +4,12 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_PRIO_H -#define _ASM_SN_PRIO_H +#ifndef _ASM_IA64_SN_PRIO_H +#define _ASM_IA64_SN_PRIO_H + +#include /* * Priority I/O function prototypes and macro definitions @@ -33,6 +34,6 @@ /* Error returns */ #define PRIO_SUCCESS 0 -#define PRIO_FAIL -1 +#define PRIO_FAIL (-1) -#endif /* _ASM_SN_PRIO_H */ +#endif /* _ASM_IA64_SN_PRIO_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/router.h lia64-2.4/include/asm-ia64/sn/router.h --- linux-2.4.18/include/asm-ia64/sn/router.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/router.h Mon Feb 4 17:48:56 2002 @@ -1,19 +1,665 @@ + /* $Id$ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#ifndef _ASM_IA64_SN_ROUTER_H +#define _ASM_IA64_SN_ROUTER_H + +/* + * Router Register definitions + * + * Macro argument _L always stands for a link number (1 to 8, inclusive). + */ + +#ifndef __ASSEMBLY__ + +#include +#include +#include +#include + +typedef uint64_t router_reg_t; + +#define MAX_ROUTERS 64 + +#define MAX_ROUTER_PATH 80 + +#define ROUTER_REG_CAST (volatile router_reg_t *) +#define PS_UINT_CAST (__psunsigned_t) +#define UINT64_CAST (uint64_t) +typedef signed char port_no_t; /* Type for router port number */ + +#else + +#define ROUTERREG_CAST +#define PS_UINT_CAST +#define UINT64_CAST + +#endif /* __ASSEMBLY__ */ + +#define MAX_ROUTER_PORTS (8) /* Max. number of ports on a router */ + +#define ALL_PORTS ((1 << MAX_ROUTER_PORTS) - 1) /* for 0 based references */ + +#define PORT_INVALID (-1) /* Invalid port number */ + +#define IS_META(_rp) ((_rp)->flags & PCFG_ROUTER_META) + +#define IS_REPEATER(_rp)((_rp)->flags & PCFG_ROUTER_REPEATER) + +/* + * RR_TURN makes a given number of clockwise turns (0 to 7) from an inport + * port to generate an output port. + * + * RR_DISTANCE returns the number of turns necessary (0 to 7) to go from + * an input port (_L1 = 1 to 8) to an output port ( _L2 = 1 to 8). + * + * These are written to work on unsigned data. */ -#ifndef _ASM_SN_ROUTER_H -#define _ASM_SN_ROUTER_H -#include +#define RR_TURN(_L, count) ((_L) + (count) > MAX_ROUTER_PORTS ? \ + (_L) + (count) - MAX_ROUTER_PORTS : \ + (_L) + (count)) + +#define RR_DISTANCE(_LS, _LD) ((_LD) >= (_LS) ? \ + (_LD) - (_LS) : \ + (_LD) + MAX_ROUTER_PORTS - (_LS)) + +/* Router register addresses */ + +#define RR_STATUS_REV_ID 0x00000 /* Status register and Revision ID */ +#define RR_PORT_RESET 0x00008 /* Multiple port reset */ +#define RR_PROT_CONF 0x00010 /* Inter-partition protection conf. */ +#define RR_GLOBAL_PORT_DEF 0x00018 /* Global Port definitions */ +#define RR_GLOBAL_PARMS0 0x00020 /* Parameters shared by all 8 ports */ +#define RR_GLOBAL_PARMS1 0x00028 /* Parameters shared by all 8 ports */ +#define RR_DIAG_PARMS 0x00030 /* Parameters for diag. testing */ +#define RR_DEBUG_ADDR 0x00038 /* Debug address select - debug port*/ +#define RR_LB_TO_L2 0x00040 /* Local Block to L2 cntrl intf reg */ +#define RR_L2_TO_LB 0x00048 /* L2 cntrl intf to Local Block reg */ +#define RR_JBUS_CONTROL 0x00050 /* read/write timing for JBUS intf */ + +#define RR_SCRATCH_REG0 0x00100 /* Scratch 0 is 64 bits */ +#define RR_SCRATCH_REG1 0x00108 /* Scratch 1 is 64 bits */ +#define RR_SCRATCH_REG2 0x00110 /* Scratch 2 is 64 bits */ +#define RR_SCRATCH_REG3 0x00118 /* Scratch 3 is 1 bit */ +#define RR_SCRATCH_REG4 0x00120 /* Scratch 4 is 1 bit */ + +#define RR_JBUS0(_D) (((_D) & 0x7) << 3 | 0x00200) /* JBUS0 addresses */ +#define RR_JBUS1(_D) (((_D) & 0x7) << 3 | 0x00240) /* JBUS1 addresses */ + +#define RR_SCRATCH_REG0_WZ 0x00500 /* Scratch 0 is 64 bits */ +#define RR_SCRATCH_REG1_WZ 0x00508 /* Scratch 1 is 64 bits */ +#define RR_SCRATCH_REG2_WZ 0x00510 /* Scratch 2 is 64 bits */ +#define RR_SCRATCH_REG3_SZ 0x00518 /* Scratch 3 is 1 bit */ +#define RR_SCRATCH_REG4_SZ 0x00520 /* Scratch 4 is 1 bit */ + +#define RR_VECTOR_HW_BAR(context) (0x08000 | (context)<<3) /* barrier config registers */ +/* Port-specific registers (_L is the link number from 1 to 8) */ + +#define RR_PORT_PARMS(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0000) /* LLP parameters */ +#define RR_STATUS_ERROR(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0008) /* Port-related errs */ +#define RR_CHANNEL_TEST(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0010) /* Port LLP chan test */ +#define RR_RESET_MASK(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0018) /* Remote reset mask */ +#define RR_HISTOGRAM0(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0020) /* Port usage histgrm */ +#define RR_HISTOGRAM1(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0028) /* Port usage histgrm */ +#define RR_HISTOGRAM0_WC(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0030) /* Port usage histgrm */ +#define RR_HISTOGRAM1_WC(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0038) /* Port usage histgrm */ +#define RR_ERROR_CLEAR(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0088) /* Read/clear errors */ +#define RR_GLOBAL_TABLE0(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0100) /* starting address of global table for this port */ +#define RR_GLOBAL_TABLE(_L, _x) (RR_GLOBAL_TABLE0(_L) + ((_x) << 3)) +#define RR_LOCAL_TABLE0(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0200) /* starting address of local table for this port */ +#define RR_LOCAL_TABLE(_L, _x) (RR_LOCAL_TABLE0(_L) + ((_x) << 3)) + +#define RR_META_ENTRIES 16 + +#define RR_LOCAL_ENTRIES 128 + +/* + * RR_STATUS_REV_ID mask and shift definitions + */ + +#define RSRI_INPORT_SHFT 52 +#define RSRI_INPORT_MASK (UINT64_CAST 0xf << 52) +#define RSRI_LINKWORKING_BIT(_L) (35 + 2 * (_L)) +#define RSRI_LINKWORKING(_L) (UINT64_CAST 1 << (35 + 2 * (_L))) +#define RSRI_LINKRESETFAIL(_L) (UINT64_CAST 1 << (34 + 2 * (_L))) +#define RSRI_LSTAT_SHFT(_L) (34 + 2 * (_L)) +#define RSRI_LSTAT_MASK(_L) (UINT64_CAST 0x3 << 34 + 2 * (_L)) +#define RSRI_LOCALSBERROR (UINT64_CAST 1 << 35) +#define RSRI_LOCALSTUCK (UINT64_CAST 1 << 34) +#define RSRI_LOCALBADVEC (UINT64_CAST 1 << 33) +#define RSRI_LOCALTAILERR (UINT64_CAST 1 << 32) +#define RSRI_LOCAL_SHFT 32 +#define RSRI_LOCAL_MASK (UINT64_CAST 0xf << 32) +#define RSRI_CHIPREV_SHFT 28 +#define RSRI_CHIPREV_MASK (UINT64_CAST 0xf << 28) +#define RSRI_CHIPID_SHFT 12 +#define RSRI_CHIPID_MASK (UINT64_CAST 0xffff << 12) +#define RSRI_MFGID_SHFT 1 +#define RSRI_MFGID_MASK (UINT64_CAST 0x7ff << 1) + +#define RSRI_LSTAT_WENTDOWN 0 +#define RSRI_LSTAT_RESETFAIL 1 +#define RSRI_LSTAT_LINKUP 2 +#define RSRI_LSTAT_NOTUSED 3 + +/* + * RR_PORT_RESET mask definitions + */ + +#define RPRESET_WARM (UINT64_CAST 1 << 9) +#define RPRESET_LINK(_L) (UINT64_CAST 1 << (_L)) +#define RPRESET_LOCAL (UINT64_CAST 1) + +/* + * RR_PROT_CONF mask and shift definitions + */ + +#define RPCONF_DIRCMPDIS_SHFT 13 +#define RPCONF_DIRCMPDIS_MASK (UINT64_CAST 1 << 13) +#define RPCONF_FORCELOCAL (UINT64_CAST 1 << 12) +#define RPCONF_FLOCAL_SHFT 12 +#define RPCONF_METAID_SHFT 8 +#define RPCONF_METAID_MASK (UINT64_CAST 0xf << 8) +#define RPCONF_RESETOK(_L) (UINT64_CAST 1 << ((_L) - 1)) + +/* + * RR_GLOBAL_PORT_DEF mask and shift definitions + */ + +#define RGPD_MGLBLNHBR_ID_SHFT 12 /* -global neighbor ID */ +#define RGPD_MGLBLNHBR_ID_MASK (UINT64_CAST 0xf << 12) +#define RGPD_MGLBLNHBR_VLD_SHFT 11 /* -global neighbor Valid */ +#define RGPD_MGLBLNHBR_VLD_MASK (UINT64_CAST 0x1 << 11) +#define RGPD_MGLBLPORT_SHFT 8 /* -global neighbor Port */ +#define RGPD_MGLBLPORT_MASK (UINT64_CAST 0x7 << 8) +#define RGPD_PGLBLNHBR_ID_SHFT 4 /* +global neighbor ID */ +#define RGPD_PGLBLNHBR_ID_MASK (UINT64_CAST 0xf << 4) +#define RGPD_PGLBLNHBR_VLD_SHFT 3 /* +global neighbor Valid */ +#define RGPD_PGLBLNHBR_VLD_MASK (UINT64_CAST 0x1 << 3) +#define RGPD_PGLBLPORT_SHFT 0 /* +global neighbor Port */ +#define RGPD_PGLBLPORT_MASK (UINT64_CAST 0x7 << 0) + +#define GLBL_PARMS_REGS 2 /* Two Global Parms registers */ + +/* + * RR_GLOBAL_PARMS0 mask and shift definitions + */ + +#define RGPARM0_ARB_VALUE_SHFT 54 /* Local Block Arbitration State */ +#define RGPARM0_ARB_VALUE_MASK (UINT64_CAST 0x7 << 54) +#define RGPARM0_ROTATEARB_SHFT 53 /* Rotate Local Block Arbitration */ +#define RGPARM0_ROTATEARB_MASK (UINT64_CAST 0x1 << 53) +#define RGPARM0_FAIREN_SHFT 52 /* Fairness logic Enable */ +#define RGPARM0_FAIREN_MASK (UINT64_CAST 0x1 << 52) +#define RGPARM0_LOCGNTTO_SHFT 40 /* Local grant timeout */ +#define RGPARM0_LOCGNTTO_MASK (UINT64_CAST 0xfff << 40) +#define RGPARM0_DATELINE_SHFT 38 /* Dateline crossing router */ +#define RGPARM0_DATELINE_MASK (UINT64_CAST 0x1 << 38) +#define RGPARM0_MAXRETRY_SHFT 28 /* Max retry count */ +#define RGPARM0_MAXRETRY_MASK (UINT64_CAST 0x3ff << 28) +#define RGPARM0_URGWRAP_SHFT 20 /* Urgent wrap */ +#define RGPARM0_URGWRAP_MASK (UINT64_CAST 0xff << 20) +#define RGPARM0_DEADLKTO_SHFT 16 /* Deadlock timeout */ +#define RGPARM0_DEADLKTO_MASK (UINT64_CAST 0xf << 16) +#define RGPARM0_URGVAL_SHFT 12 /* Urgent value */ +#define RGPARM0_URGVAL_MASK (UINT64_CAST 0xf << 12) +#define RGPARM0_VCHSELEN_SHFT 11 /* VCH_SEL_EN */ +#define RGPARM0_VCHSELEN_MASK (UINT64_CAST 0x1 << 11) +#define RGPARM0_LOCURGTO_SHFT 9 /* Local urgent timeout */ +#define RGPARM0_LOCURGTO_MASK (UINT64_CAST 0x3 << 9) +#define RGPARM0_TAILVAL_SHFT 5 /* Tail value */ +#define RGPARM0_TAILVAL_MASK (UINT64_CAST 0xf << 5) +#define RGPARM0_CLOCK_SHFT 1 /* Global clock select */ +#define RGPARM0_CLOCK_MASK (UINT64_CAST 0xf << 1) +#define RGPARM0_BYPEN_SHFT 0 +#define RGPARM0_BYPEN_MASK (UINT64_CAST 1) /* Bypass enable */ + +/* + * RR_GLOBAL_PARMS1 shift and mask definitions + */ + +#define RGPARM1_TTOWRAP_SHFT 12 /* Tail timeout wrap */ +#define RGPARM1_TTOWRAP_MASK (UINT64_CAST 0xfffff << 12) +#define RGPARM1_AGERATE_SHFT 8 /* Age rate */ +#define RGPARM1_AGERATE_MASK (UINT64_CAST 0xf << 8) +#define RGPARM1_JSWSTAT_SHFT 0 /* JTAG Sw Register bits */ +#define RGPARM1_JSWSTAT_MASK (UINT64_CAST 0xff << 0) + +/* + * RR_DIAG_PARMS mask and shift definitions + */ + +#define RDPARM_ABSHISTOGRAM (UINT64_CAST 1 << 17) /* Absolute histgrm */ +#define RDPARM_DEADLOCKRESET (UINT64_CAST 1 << 16) /* Reset on deadlck */ +#define RDPARM_DISABLE(_L) (UINT64_CAST 1 << ((_L) + 7)) +#define RDPARM_SENDERROR(_L) (UINT64_CAST 1 << ((_L) - 1)) + +/* + * RR_DEBUG_ADDR mask and shift definitions + */ + +#define RDA_DATA_SHFT 10 /* Observed debug data */ +#define RDA_DATA_MASK (UINT64_CAST 0xffff << 10) +#define RDA_ADDR_SHFT 0 /* debug address for data */ +#define RDA_ADDR_MASK (UINT64_CAST 0x3ff << 0) + +/* + * RR_LB_TO_L2 mask and shift definitions + */ + +#define RLBTOL2_DATA_VLD_SHFT 32 /* data is valid for JTAG controller */ +#define RLBTOL2_DATA_VLD_MASK (UINT64_CAST 0x1 << 32) +#define RLBTOL2_DATA_SHFT 0 /* data bits for JTAG controller */ +#define RLBTOL2_DATA_MASK (UINT64_CAST 0xffffffff) + +/* + * RR_L2_TO_LB mask and shift definitions + */ + +#define RL2TOLB_DATA_VLD_SHFT 33 /* data is valid from JTAG controller */ +#define RL2TOLB_DATA_VLD_MASK (UINT64_CAST 0x1 << 33) +#define RL2TOLB_PARITY_SHFT 32 /* sw implemented parity for data */ +#define RL2TOLB_PARITY_MASK (UINT64_CAST 0x1 << 32) +#define RL2TOLB_DATA_SHFT 0 /* data bits from JTAG controller */ +#define RL2TOLB_DATA_MASK (UINT64_CAST 0xffffffff) + +/* + * RR_JBUS_CONTROL mask and shift definitions + */ -#if CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 || CONFIG_IA64_GENERIC -#include +#define RJC_POS_BITS_SHFT 20 /* Router position bits */ +#define RJC_POS_BITS_MASK (UINT64_CAST 0xf << 20) +#define RJC_RD_DATA_STROBE_SHFT 16 /* count when read data is strobed in */ +#define RJC_RD_DATA_STROBE_MASK (UINT64_CAST 0xf << 16) +#define RJC_WE_OE_HOLD_SHFT 8 /* time OE or WE is held */ +#define RJC_WE_OE_HOLD_MASK (UINT64_CAST 0xff << 8) +#define RJC_ADDR_SET_HLD_SHFT 0 /* time address driven around OE/WE */ +#define RJC_ADDR_SET_HLD_MASK (UINT64_CAST 0xff) + +/* + * RR_SCRATCH_REGx mask and shift definitions + * note: these fields represent a software convention, and are not + * understood/interpreted by the hardware. + */ + +#define RSCR0_BOOTED_SHFT 63 +#define RSCR0_BOOTED_MASK (UINT64_CAST 0x1 << RSCR0_BOOTED_SHFT) +#define RSCR0_LOCALID_SHFT 56 +#define RSCR0_LOCALID_MASK (UINT64_CAST 0x7f << RSCR0_LOCALID_SHFT) +#define RSCR0_UNUSED_SHFT 48 +#define RSCR0_UNUSED_MASK (UINT64_CAST 0xff << RSCR0_UNUSED_SHFT) +#define RSCR0_NIC_SHFT 0 +#define RSCR0_NIC_MASK (UINT64_CAST 0xffffffffffff) + +#define RSCR1_MODID_SHFT 0 +#define RSCR1_MODID_MASK (UINT64_CAST 0xffff) + +/* + * RR_VECTOR_HW_BAR mask and shift definitions + */ + +#define BAR_TX_SHFT 27 /* Barrier in trans(m)it when read */ +#define BAR_TX_MASK (UINT64_CAST 1 << BAR_TX_SHFT) +#define BAR_VLD_SHFT 26 /* Valid Configuration */ +#define BAR_VLD_MASK (UINT64_CAST 1 << BAR_VLD_SHFT) +#define BAR_SEQ_SHFT 24 /* Sequence number */ +#define BAR_SEQ_MASK (UINT64_CAST 3 << BAR_SEQ_SHFT) +#define BAR_LEAFSTATE_SHFT 18 /* Leaf State */ +#define BAR_LEAFSTATE_MASK (UINT64_CAST 0x3f << BAR_LEAFSTATE_SHFT) +#define BAR_PARENT_SHFT 14 /* Parent Port */ +#define BAR_PARENT_MASK (UINT64_CAST 0xf << BAR_PARENT_SHFT) +#define BAR_CHILDREN_SHFT 6 /* Child Select port bits */ +#define BAR_CHILDREN_MASK (UINT64_CAST 0xff << BAR_CHILDREN_SHFT) +#define BAR_LEAFCOUNT_SHFT 0 /* Leaf Count to trigger parent */ +#define BAR_LEAFCOUNT_MASK (UINT64_CAST 0x3f) + +/* + * RR_PORT_PARMS(_L) mask and shift definitions + */ + +#define RPPARM_MIPRESETEN_SHFT 29 /* Message In Progress reset enable */ +#define RPPARM_MIPRESETEN_MASK (UINT64_CAST 0x1 << 29) +#define RPPARM_UBAREN_SHFT 28 /* Enable user barrier requests */ +#define RPPARM_UBAREN_MASK (UINT64_CAST 0x1 << 28) +#define RPPARM_OUTPDTO_SHFT 24 /* Output Port Deadlock TO value */ +#define RPPARM_OUTPDTO_MASK (UINT64_CAST 0xf << 24) +#define RPPARM_PORTMATE_SHFT 21 /* Port Mate for the port */ +#define RPPARM_PORTMATE_MASK (UINT64_CAST 0x7 << 21) +#define RPPARM_HISTEN_SHFT 20 /* Histogram counter enable */ +#define RPPARM_HISTEN_MASK (UINT64_CAST 0x1 << 20) +#define RPPARM_HISTSEL_SHFT 18 +#define RPPARM_HISTSEL_MASK (UINT64_CAST 0x3 << 18) +#define RPPARM_DAMQHS_SHFT 16 +#define RPPARM_DAMQHS_MASK (UINT64_CAST 0x3 << 16) +#define RPPARM_NULLTO_SHFT 10 +#define RPPARM_NULLTO_MASK (UINT64_CAST 0x3f << 10) +#define RPPARM_MAXBURST_SHFT 0 +#define RPPARM_MAXBURST_MASK (UINT64_CAST 0x3ff) + +/* + * NOTE: Normally the kernel tracks only UTILIZATION statistics. + * The other 2 should not be used, except during any experimentation + * with the router. + */ +#define RPPARM_HISTSEL_AGE 0 /* Histogram age characterization. */ +#define RPPARM_HISTSEL_UTIL 1 /* Histogram link utilization */ +#define RPPARM_HISTSEL_DAMQ 2 /* Histogram DAMQ characterization. */ + +/* + * RR_STATUS_ERROR(_L) and RR_ERROR_CLEAR(_L) mask and shift definitions + */ +#define RSERR_POWERNOK (UINT64_CAST 1 << 38) +#define RSERR_PORT_DEADLOCK (UINT64_CAST 1 << 37) +#define RSERR_WARMRESET (UINT64_CAST 1 << 36) +#define RSERR_LINKRESET (UINT64_CAST 1 << 35) +#define RSERR_RETRYTIMEOUT (UINT64_CAST 1 << 34) +#define RSERR_FIFOOVERFLOW (UINT64_CAST 1 << 33) +#define RSERR_ILLEGALPORT (UINT64_CAST 1 << 32) +#define RSERR_DEADLOCKTO_SHFT 28 +#define RSERR_DEADLOCKTO_MASK (UINT64_CAST 0xf << 28) +#define RSERR_RECVTAILTO_SHFT 24 +#define RSERR_RECVTAILTO_MASK (UINT64_CAST 0xf << 24) +#define RSERR_RETRYCNT_SHFT 16 +#define RSERR_RETRYCNT_MASK (UINT64_CAST 0xff << 16) +#define RSERR_CBERRCNT_SHFT 8 +#define RSERR_CBERRCNT_MASK (UINT64_CAST 0xff << 8) +#define RSERR_SNERRCNT_SHFT 0 +#define RSERR_SNERRCNT_MASK (UINT64_CAST 0xff << 0) + + +#define PORT_STATUS_UP (1 << 0) /* Router link up */ +#define PORT_STATUS_FENCE (1 << 1) /* Router link fenced */ +#define PORT_STATUS_RESETFAIL (1 << 2) /* Router link didnot + * come out of reset */ +#define PORT_STATUS_DISCFAIL (1 << 3) /* Router link failed after + * out of reset but before + * router tables were + * programmed + */ +#define PORT_STATUS_KERNFAIL (1 << 4) /* Router link failed + * after reset and the + * router tables were + * programmed + */ +#define PORT_STATUS_UNDEF (1 << 5) /* Unable to pinpoint + * why the router link + * went down + */ +#define PROBE_RESULT_BAD (-1) /* Set if any of the router + * links failed after reset + */ +#define PROBE_RESULT_GOOD (0) /* Set if all the router links + * which came out of reset + * are up + */ + +/* Should be enough for 256 CPUs */ +#define MAX_RTR_BREADTH 64 /* Max # of routers possible */ + +/* Get the require set of bits in a var. corr to a sequence of bits */ +#define GET_FIELD(var, fname) \ + ((var) >> fname##_SHFT & fname##_MASK >> fname##_SHFT) +/* Set the require set of bits in a var. corr to a sequence of bits */ +#define SET_FIELD(var, fname, fval) \ + ((var) = (var) & ~fname##_MASK | (uint64_t) (fval) << fname##_SHFT) + + +#ifndef __ASSEMBLY__ + +typedef struct router_map_ent_s { + uint64_t nic; + moduleid_t module; + slotid_t slot; +} router_map_ent_t; + +struct rr_status_error_fmt { + uint64_t rserr_unused : 30, + rserr_fifooverflow : 1, + rserr_illegalport : 1, + rserr_deadlockto : 4, + rserr_recvtailto : 4, + rserr_retrycnt : 8, + rserr_cberrcnt : 8, + rserr_snerrcnt : 8; +}; + +/* + * This type is used to store "absolute" counts of router events + */ +typedef int router_count_t; + +/* All utilizations are on a scale from 0 - 1023. */ +#define RP_BYPASS_UTIL 0 +#define RP_RCV_UTIL 1 +#define RP_SEND_UTIL 2 +#define RP_TOTAL_PKTS 3 /* Free running clock/packet counter */ + +#define RP_NUM_UTILS 3 + +#define RP_HIST_REGS 2 +#define RP_NUM_BUCKETS 4 +#define RP_HIST_TYPES 3 + +#define RP_AGE0 0 +#define RP_AGE1 1 +#define RP_AGE2 2 +#define RP_AGE3 3 + + +#define RR_UTIL_SCALE 1024 + +/* + * Router port-oriented information + */ +typedef struct router_port_info_s { + router_reg_t rp_histograms[RP_HIST_REGS];/* Port usage info */ + router_reg_t rp_port_error; /* Port error info */ + router_count_t rp_retry_errors; /* Total retry errors */ + router_count_t rp_sn_errors; /* Total sn errors */ + router_count_t rp_cb_errors; /* Total cb errors */ + int rp_overflows; /* Total count overflows */ + int rp_excess_err; /* Port has excessive errors */ + ushort rp_util[RP_NUM_BUCKETS];/* Port utilization */ +} router_port_info_t; + +#define ROUTER_INFO_VERSION 7 + +struct lboard_s; + +/* + * Router information + */ +typedef struct router_info_s { + char ri_version; /* structure version */ + cnodeid_t ri_cnode; /* cnode of its legal guardian hub */ + nasid_t ri_nasid; /* Nasid of same */ + char ri_ledcache; /* Last LED bitmap */ + char ri_leds; /* Current LED bitmap */ + char ri_portmask; /* Active port bitmap */ + router_reg_t ri_stat_rev_id; /* Status rev ID value */ + net_vec_t ri_vector; /* vector from guardian to router */ + int ri_writeid; /* router's vector write ID */ + int64_t ri_timebase; /* Time of first sample */ + int64_t ri_timestamp; /* Time of last sample */ + router_port_info_t ri_port[MAX_ROUTER_PORTS]; /* per port info */ + moduleid_t ri_module; /* Which module are we in? */ + slotid_t ri_slotnum; /* Which slot are we in? */ + router_reg_t ri_glbl_parms[GLBL_PARMS_REGS]; + /* Global parms0&1 register contents*/ + devfs_handle_t ri_vertex; /* hardware graph vertex */ + router_reg_t ri_prot_conf; /* protection config. register */ + int64_t ri_per_minute; /* Ticks per minute */ + + /* + * Everything below here is for kernel use only and may change at + * at any time with or without a change in teh revision number + * + * Any pointers or things that come and go with DEBUG must go at + * the bottom of the structure, below the user stuff. + */ + char ri_hist_type; /* histogram type */ + devfs_handle_t ri_guardian; /* guardian node for the router */ + int64_t ri_last_print; /* When did we last print */ + char ri_print; /* Should we print */ + char ri_just_blink; /* Should we blink the LEDs */ + +#ifdef DEBUG + int64_t ri_deltatime; /* Time it took to sample */ #endif + spinlock_t ri_lock; /* Lock for access to router info */ + net_vec_t *ri_vecarray; /* Pointer to array of vectors */ + struct lboard_s *ri_brd; /* Pointer to board structure */ + char * ri_name; /* This board's hwg path */ + unsigned char ri_port_maint[MAX_ROUTER_PORTS]; /* should we send a + message to availmon */ +} router_info_t; + + +/* Router info location specifiers */ + +#define RIP_PROMLOG 2 /* Router info in promlog */ +#define RIP_CONSOLE 4 /* Router info on console */ + +#define ROUTER_INFO_PRINT(_rip,_where) (_rip->ri_print |= _where) + /* Set the field used to check if a + * router info can be printed + */ +#define IS_ROUTER_INFO_PRINTED(_rip,_where) \ + (_rip->ri_print & _where) + /* Was the router info printed to + * the given location (_where) ? + * Mainly used to prevent duplicate + * router error states. + */ +#define ROUTER_INFO_LOCK(_rip,_s) _s = mutex_spinlock(&(_rip->ri_lock)) + /* Take the lock on router info + * to gain exclusive access + */ +#define ROUTER_INFO_UNLOCK(_rip,_s) mutex_spinunlock(&(_rip->ri_lock),_s) + /* Release the lock on router info */ +/* + * Router info hanging in the nodepda + */ +typedef struct nodepda_router_info_s { + devfs_handle_t router_vhdl; /* vertex handle of the router */ + short router_port; /* port thru which we entered */ + short router_portmask; + moduleid_t router_module; /* module in which router is there */ + slotid_t router_slot; /* router slot */ + unsigned char router_type; /* kind of router */ + net_vec_t router_vector; /* vector from the guardian node */ + + router_info_t *router_infop; /* info hanging off the hwg vertex */ + struct nodepda_router_info_s *router_next; + /* pointer to next element */ +} nodepda_router_info_t; + +#define ROUTER_NAME_SIZE 20 /* Max size of a router name */ + +#define NORMAL_ROUTER_NAME "normal_router" +#define NULL_ROUTER_NAME "null_router" +#define META_ROUTER_NAME "meta_router" +#define REPEATER_ROUTER_NAME "repeater_router" +#define UNKNOWN_ROUTER_NAME "unknown_router" + +/* The following definitions are needed by the router traversing + * code either using the hardware graph or using vector operations. + */ +/* Structure of the router queue element */ +typedef struct router_elt_s { + union { + /* queue element structure during router probing */ + struct { + /* number-in-a-can (unique) for the router */ + nic_t nic; + /* vector route from the master hub to + * this router. + */ + net_vec_t vec; + /* port status */ + uint64_t status; + char port_status[MAX_ROUTER_PORTS + 1]; + } r_elt; + /* queue element structure during router guardian + * assignment + */ + struct { + /* vertex handle for the router */ + devfs_handle_t vhdl; + /* guardian for this router */ + devfs_handle_t guard; + /* vector router from the guardian to the router */ + net_vec_t vec; + } k_elt; + } u; + /* easy to use port status interpretation */ +} router_elt_t; + +/* structure of the router queue */ + +typedef struct router_queue_s { + char head; /* Point where a queue element is inserted */ + char tail; /* Point where a queue element is removed */ + int type; + router_elt_t array[MAX_RTR_BREADTH]; + /* Entries for queue elements */ +} router_queue_t; + + +#endif /* __ASSEMBLY__ */ + +/* + * RR_HISTOGRAM(_L) mask and shift definitions + * There are two 64 bit histogram registers, so the following macros take + * into account dealing with an array of 4 32 bit values indexed by _x + */ + +#define RHIST_BUCKET_SHFT(_x) (32 * ((_x) & 0x1)) +#define RHIST_BUCKET_MASK(_x) (UINT64_CAST 0xffffffff << RHIST_BUCKET_SHFT((_x) & 0x1)) +#define RHIST_GET_BUCKET(_x, _reg) \ + ((RHIST_BUCKET_MASK(_x) & ((_reg)[(_x) >> 1])) >> RHIST_BUCKET_SHFT(_x)) + +/* + * RR_RESET_MASK(_L) mask and shift definitions + */ + +#define RRM_RESETOK(_L) (UINT64_CAST 1 << ((_L) - 1)) +#define RRM_RESETOK_ALL ALL_PORTS + +/* + * RR_META_TABLE(_x) and RR_LOCAL_TABLE(_x) mask and shift definitions + */ + +#define RTABLE_SHFT(_L) (4 * ((_L) - 1)) +#define RTABLE_MASK(_L) (UINT64_CAST 0x7 << RTABLE_SHFT(_L)) + + +#define ROUTERINFO_STKSZ 4096 + +#ifndef __ASSEMBLY__ + +int router_reg_read(router_info_t *rip, int regno, router_reg_t *val); +int router_reg_write(router_info_t *rip, int regno, router_reg_t val); +int router_get_info(devfs_handle_t routerv, router_info_t *, int); +int router_init(cnodeid_t cnode,int writeid, nodepda_router_info_t *npda_rip); +int router_set_leds(router_info_t *rip); +void router_print_state(router_info_t *rip, int level, + void (*pf)(int, char *, ...),int print_where); +void capture_router_stats(router_info_t *rip); + + +int probe_routers(void); +void get_routername(unsigned char brd_type,char *rtrname); +void router_guardians_set(devfs_handle_t hwgraph_root); +int router_hist_reselect(router_info_t *, int64_t); +#endif /* __ASSEMBLY__ */ -#endif /* _ASM_SN_ROUTER_H */ +#endif /* _ASM_IA64_SN_ROUTER_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sgi.h lia64-2.4/include/asm-ia64/sn/sgi.h --- linux-2.4.18/include/asm-ia64/sn/sgi.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sgi.h Fri Jul 19 23:21:07 2002 @@ -4,13 +4,12 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Jack Steiner (steiner@sgi.com) + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SGI_H -#define _ASM_SN_SGI_H +#ifndef _ASM_IA64_SN_SGI_H +#define _ASM_IA64_SN_SGI_H #include @@ -95,9 +94,6 @@ bigger. This is NULL-terminated */ }; -#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b)) - -typedef uint32_t app32_ptr_t; /* needed by edt.h */ typedef int64_t __psint_t; /* needed by klgraph.c */ typedef enum { B_FALSE, B_TRUE } boolean_t; @@ -105,8 +101,6 @@ #define ctob(x) ((uint64_t)(x)*NBPC) #define btoc(x) (((uint64_t)(x)+(NBPC-1))/NBPC) -typedef __psunsigned_t nic_data_t; - /* ** Possible return values from graph routines. @@ -129,10 +123,6 @@ * calls */ #define XG_WIDGET_PART_NUM 0xC102 /* KONA/xt_regs.h XG_XT_PART_NUM_VALUE */ -#ifndef TO_PHYS_MASK -#define TO_PHYS_MASK 0x0000000fffffffff -#endif - typedef uint64_t vhandl_t; @@ -159,7 +149,7 @@ typedef uint64_t mrlock_t; /* needed by devsupport.c */ #define HUB_PIO_CONVEYOR 0x1 -#define CNODEID_NONE (cnodeid_t)-1 +#define CNODEID_NONE ((cnodeid_t)-1) #define XTALK_PCI_PART_NUM "030-1275-" #define kdebug 0 @@ -177,7 +167,7 @@ #define kern_free(x) kfree(x) typedef cpuid_t cpu_cookie_t; -#define CPU_NONE -1 +#define CPU_NONE (-1) /* * mutext support mapping @@ -225,9 +215,6 @@ } } while(0) #endif /* DISABLE_ASSERT */ -#define PRINT_WARNING(x...) do { printk("WARNING : "); printk(x); } while(0) -#define PRINT_NOTICE(x...) do { printk("NOTICE : "); printk(x); } while(0) -#define PRINT_ALERT(x...) do { printk("ALERT : "); printk(x); } while(0) #define PRINT_PANIC panic #ifdef CONFIG_SMP @@ -238,4 +225,4 @@ #include /* for now */ -#endif /* _ASM_SN_SGI_H */ +#endif /* _ASM_IA64_SN_SGI_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/simulator.h lia64-2.4/include/asm-ia64/sn/simulator.h --- linux-2.4.18/include/asm-ia64/sn/simulator.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/simulator.h Mon Nov 19 23:22:55 2001 @@ -0,0 +1,27 @@ +#ifndef _ASM_IA64_SN_SIMULATOR_H +#define _ASM_IA64_SN_SIMULATOR_H + +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * Copyright (C) 2000-2001 Silicon Graphics, Inc. All rights reserved. + */ + +#include + +#ifdef CONFIG_IA64_SGI_SN_SIM + +#define SNMAGIC 0xaeeeeeee8badbeefL +#define IS_RUNNING_ON_SIMULATOR() ({long sn; asm("mov %0=cpuid[%1]" : "=r"(sn) : "r"(2)); sn == SNMAGIC;}) + +#define SIMULATOR_SLEEP() asm("nop.i 0x8beef") + +#else + +#define IS_RUNNING_ON_SIMULATOR() (0) +#define SIMULATOR_SLEEP() + +#endif + +#endif /* _ASM_IA64_SN_SIMULATOR_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/slotnum.h lia64-2.4/include/asm-ia64/sn/slotnum.h --- linux-2.4.18/include/asm-ia64/sn/slotnum.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/slotnum.h Mon Nov 19 23:22:55 2001 @@ -4,22 +4,23 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SLOTNUM_H -#define _ASM_SN_SLOTNUM_H +#ifndef _ASM_IA64_SN_SLOTNUM_H +#define _ASM_IA64_SN_SLOTNUM_H #include typedef unsigned char slotid_t; -#if defined (CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) +#if defined (CONFIG_IA64_SGI_SN1) #include +#elif defined (CONFIG_IA64_SGI_SN2) +#include #else #error <> -#endif /* !CONFIG_SGI_IP35 && !CONFIG_IA64_SGI_SN1 */ +#endif /* !CONFIG_IA64_SGI_SN1 */ -#endif /* _ASM_SN_SLOTNUM_H */ +#endif /* _ASM_IA64_SN_SLOTNUM_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/addrs.h lia64-2.4/include/asm-ia64/sn/sn1/addrs.h --- linux-2.4.18/include/asm-ia64/sn/sn1/addrs.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/addrs.h Fri Jul 19 23:20:15 2002 @@ -4,19 +4,21 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_ADDRS_H -#define _ASM_SN_SN1_ADDRS_H +#ifndef _ASM_IA64_SN_SN1_ADDRS_H +#define _ASM_IA64_SN_SN1_ADDRS_H +#include + +#ifdef CONFIG_IA64_SGI_SN1 /* - * IP35 (on a TRex) Address map + * SN1 (on a TRex) Address map * * This file contains a set of definitions and macros which are used * to reference into the major address spaces (CAC, HSPEC, IO, MSPEC, - * and UNCAC) used by the IP35 architecture. It also contains addresses + * and UNCAC) used by the SN1 architecture. It also contains addresses * for "major" statically locatable PROM/Kernel data structures, such as * the partition table, the configuration data structure, etc. * We make an implicit assumption that the processor using this file @@ -32,7 +34,6 @@ * appropriately. */ -#include /* * Some of the macros here need to be casted to appropriate types when used @@ -40,22 +41,14 @@ * use some new ANSI preprocessor stuff to paste these on where needed. */ -#if defined(_RUN_UNCACHED) -#define CAC_BASE 0x9600000000000000 -#else -#ifndef __ia64 -#define CAC_BASE 0xa800000000000000 -#else #define CAC_BASE 0xe000000000000000 -#endif -#endif - #define HSPEC_BASE 0xc0000b0000000000 #define HSPEC_SWIZ_BASE 0xc000030000000000 #define IO_BASE 0xc0000a0000000000 #define IO_SWIZ_BASE 0xc000020000000000 -#define MSPEC_BASE 0xc000000000000000 +#define MSPEC_BASE 0xc000090000000000 #define UNCAC_BASE 0xc000000000000000 +#define TO_PHYS_MASK 0x000000ffffffffff #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) @@ -109,18 +102,14 @@ #define NASID_GET(_pa) (int) ((UINT64_CAST (_pa) >> \ NASID_SHFT) & NASID_BITMASK) -#if _LANGUAGE_C && !defined(_STANDALONE) -#ifndef REAL_HARDWARE -#define NODE_SWIN_BASE(nasid, widget) RAW_NODE_SWIN_BASE(nasid, widget) -#else +#ifndef __ASSEMBLY__ #define NODE_SWIN_BASE(nasid, widget) \ ((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN) \ : RAW_NODE_SWIN_BASE(nasid, widget)) -#endif #else #define NODE_SWIN_BASE(nasid, widget) \ (NODE_IO_BASE(nasid) + (UINT64_CAST (widget) << SWIN_SIZE_BITS)) -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ /* * The following definitions pertain to the IO special address @@ -155,7 +144,7 @@ /* * The following define the major position-independent aliases used - * in IP27. + * in SN1. * CALIAS -- Varies in size, points to the first n bytes of memory * on the reader's node. */ @@ -169,11 +158,6 @@ #define SN0_WIDGET_BASE(_nasid, _wid) (NODE_SWIN_BASE((_nasid), (_wid))) -#if _LANGUAGE_C -#define KERN_NMI_ADDR(nasid, slice) \ - TO_NODE_UNCAC((nasid), IP27_NMI_KREGS_OFFSET + \ - (IP27_NMI_KREGS_CPU_SIZE * (slice))) -#endif /* _LANGUAGE_C */ /* @@ -197,7 +181,7 @@ #define KL_UART_CMD LOCAL_HSPEC(HSPEC_UART_0) /* UART command reg */ #define KL_UART_DATA LOCAL_HSPEC(HSPEC_UART_1) /* UART data reg */ -#if !_LANGUAGE_ASSEMBLY +#if !__ASSEMBLY__ /* Address 0x400 to 0x1000 ualias points to cache error eframe + misc * CACHE_ERR_SP_PTR could either contain an address to the stack, or * the stack could start at CACHE_ERR_SP_PTR @@ -210,28 +194,9 @@ #define CACHE_ERR_SP (CACHE_ERR_SP_PTR - 16) #define CACHE_ERR_AREA_SIZE (ARCS_SPB_OFFSET - CACHE_ERR_EFRAME) -#endif /* !_LANGUAGE_ASSEMBLY */ +#endif /* !__ASSEMBLY__ */ + -/* Each CPU accesses UALIAS at a different physaddr, on 32k boundaries - * This determines the locations of the exception vectors - */ -#define UALIAS_FLIP_BASE UALIAS_BASE -#define UALIAS_FLIP_SHIFT 15 -#define UALIAS_FLIP_ADDR(_x) ((_x) ^ (cputoslice(getcpuid())<Key field is used for this purpose. - * Macros needed by IP27 device drivers to convert the + * Macros needed by SN1 device drivers to convert the * COMPONENT->Key field to the respective base address. * Key field looks as follows: * @@ -256,7 +221,7 @@ * is in place. */ -#if _LANGUAGE_C +#ifndef __ASSEMBLY__ #define uchar unsigned char @@ -301,8 +266,9 @@ #define PUT_INSTALL_STATUS(c,s) c->Revision = s #define GET_INSTALL_STATUS(c) c->Revision -#endif /* LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ #endif /* _STANDALONE */ +#endif /* CONFIG_IA64_SGI_SN1 */ -#endif /* _ASM_SN_SN1_ADDRS_H */ +#endif /* _ASM_IA64_SN_SN1_ADDRS_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/arch.h lia64-2.4/include/asm-ia64/sn/sn1/arch.h --- linux-2.4.18/include/asm-ia64/sn/sn1/arch.h Thu Jan 4 15:25:55 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/arch.h Fri Jul 19 23:20:15 2002 @@ -4,29 +4,29 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_ARCH_H -#define _ASM_SN_SN1_ARCH_H +#ifndef _ASM_IA64_SN_SN1_ARCH_H +#define _ASM_IA64_SN_SN1_ARCH_H #if defined(N_MODE) #error "ERROR constants defined only for M-mode" #endif +#include +#include + +#define CPUS_PER_NODE 4 /* CPUs on a single hub */ +#define CPUS_PER_SUBNODE 2 /* CPUs on a single hub PI */ + /* * This is the maximum number of NASIDS that can be present in a system. + * This include ALL nodes in ALL partitions connected via NUMALINK. * (Highest NASID plus one.) */ #define MAX_NASIDS 128 /* - * MAXCPUS refers to the maximum number of CPUs in a single kernel. - * This is not necessarily the same as MAXNODES * CPUS_PER_NODE - */ -#define MAXCPUS 512 - -/* * This is the maximum number of nodes that can be part of a kernel. * Effectively, it's the maximum number of compact node ids (cnodeid_t). * This is not necessarily the same as MAX_NASIDS. @@ -40,6 +40,19 @@ #define MAX_NONPREMIUM_REGIONS 16 #define MAX_PREMIUM_REGIONS MAX_REGIONS +/* + * Slot constants for IP35 + */ + +#define MAX_MEM_SLOTS 8 /* max slots per node */ + +#if defined(N_MODE) +#error "N-mode not supported" +#endif + +#define SLOT_SHIFT (30) +#define SLOT_MIN_MEM_SIZE (64*1024*1024) + /* * MAX_PARITIONS refers to the maximum number of logically defined @@ -51,17 +64,14 @@ #define NASID_MASK_BYTES ((MAX_NASIDS + 7) / 8) /* - * Slot constants for IP35 + * New stuff in here from Irix sys/pfdat.h. */ +#define SLOT_PFNSHIFT (SLOT_SHIFT - PAGE_SHIFT) +#define PFN_NASIDSHFT (NASID_SHFT - PAGE_SHIFT) +#define slot_getbasepfn(node,slot) (mkpfn(COMPACT_TO_NASID_NODEID(node), slot< /* The secret password; used to release protection */ #define HUB_PASSWORD 0x53474972756c6573ull @@ -24,7 +22,6 @@ #define MAX_HUB_PATH 80 -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) #include #include #include @@ -40,19 +37,13 @@ #include #include -#else /* ! CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 */ - -<< BOMB! CONFIG_SGI_IP35 is only defined for IP35 >> - -#endif /* defined(CONFIG_SGI_IP35) */ - /* Translation of uncached attributes */ #define UATTR_HSPEC 0 #define UATTR_IO 1 #define UATTR_MSPEC 2 #define UATTR_UNCAC 3 -#if _LANGUAGE_ASSEMBLY +#if __ASSEMBLY__ /* * Get nasid into register, r (uses at) @@ -63,9 +54,9 @@ and r, LRI_NODEID_MASK; \ dsrl r, LRI_NODEID_SHFT -#endif /* _LANGUAGE_ASSEMBLY */ +#endif /* __ASSEMBLY__ */ -#if _LANGUAGE_C +#ifndef __ASSEMBLY__ #include @@ -78,6 +69,6 @@ void capture_hub_stats(cnodeid_t, struct nodepda_s *); void init_hub_stats(cnodeid_t, struct nodepda_s *); -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ -#endif /* _ASM_SN_SN1_BEDROCK_H */ +#endif /* _ASM_IA64_SN_SN1_BEDROCK_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hubdev.h lia64-2.4/include/asm-ia64/sn/sn1/hubdev.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hubdev.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/hubdev.h Mon Nov 19 23:22:55 2001 @@ -4,12 +4,11 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_HUBDEV_H -#define _ASM_SN_SN1_HUBDEV_H +#ifndef _ASM_IA64_SN_SN1_HUBDEV_H +#define _ASM_IA64_SN_SN1_HUBDEV_H extern void hubdev_init(void); extern void hubdev_register(int (*attach_method)(devfs_handle_t)); @@ -19,4 +18,4 @@ extern caddr_t hubdev_prombase_get(devfs_handle_t hub); extern cnodeid_t hubdev_cnodeid_get(devfs_handle_t hub); -#endif /* _ASM_SN_SN1_HUBDEV_H */ +#endif /* _ASM_IA64_SN_SN1_HUBDEV_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hubio.h lia64-2.4/include/asm-ia64/sn/sn1/hubio.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hubio.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/hubio.h Mon Nov 19 23:22:55 2001 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ /************************************************************************ @@ -20,8 +19,8 @@ ************************************************************************/ -#ifndef _ASM_SN_SN1_HUBIO_H -#define _ASM_SN_SN1_HUBIO_H +#ifndef _ASM_IA64_SN_SN1_HUBIO_H +#define _ASM_IA64_SN_SN1_HUBIO_H #define IIO_WID 0x00400000 /* @@ -762,7 +761,7 @@ -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ /************************************************************************ * * @@ -2942,15 +2941,15 @@ typedef union ii_ilct_u { bdrkreg_t ii_ilct_regval; struct { - bdrkreg_t i_rsvd : 9; - bdrkreg_t i_test_err_capture : 1; - bdrkreg_t i_test_clear : 1; - bdrkreg_t i_test_flit : 3; - bdrkreg_t i_test_cberr : 1; - bdrkreg_t i_test_valid : 1; - bdrkreg_t i_test_data : 20; - bdrkreg_t i_test_mask : 8; - bdrkreg_t i_test_seed : 20; + bdrkreg_t i_test_seed : 20; + bdrkreg_t i_test_mask : 8; + bdrkreg_t i_test_data : 20; + bdrkreg_t i_test_valid : 1; + bdrkreg_t i_test_cberr : 1; + bdrkreg_t i_test_flit : 3; + bdrkreg_t i_test_clear : 1; + bdrkreg_t i_test_err_capture : 1; + bdrkreg_t i_rsvd : 9; } ii_ilct_fld_s; } ii_ilct_u_t; @@ -4935,7 +4934,7 @@ -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ /************************************************************************ * * @@ -5014,4 +5013,4 @@ -#endif /* _ASM_SN_SN1_HUBIO_H */ +#endif /* _ASM_IA64_SN_SN1_HUBIO_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hubio_next.h lia64-2.4/include/asm-ia64/sn/sn1/hubio_next.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hubio_next.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/hubio_next.h Fri Jul 19 23:21:07 2002 @@ -4,11 +4,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_HUBIO_NEXT_H -#define _ASM_SN_SN1_HUBIO_NEXT_H +#ifndef _ASM_IA64_SN_SN1_HUBIO_NEXT_H +#define _ASM_IA64_SN_SN1_HUBIO_NEXT_H /* * Slightly friendlier names for some common registers. @@ -64,7 +63,7 @@ #define IIO_BTE_NOTIFY_0 IIO_IBNA_0 /* Also BTE notification 0 */ #define IIO_BTE_INT_0 IIO_IBIA_0 /* Also BTE interrupt 0 */ #define IIO_BTE_OFF_0 0 /* Base offset from BTE 0 regs. */ -#define IIO_BTE_OFF_1 IIO_IBLS_1 - IIO_IBLS_0 /* Offset from base to BTE 1 */ +#define IIO_BTE_OFF_1 (IIO_IBLS_1 - IIO_IBLS_0) /* Offset from base to BTE 1 */ /* BTE register offsets from base */ #define BTEOFF_STAT 0 @@ -78,11 +77,16 @@ /* names used in hub_diags.c; carried over from SN0 */ #define IIO_BASE_BTE0 IIO_IBLS_0 #define IIO_BASE_BTE1 IIO_IBLS_1 -#if 0 -#define IIO_BASE IIO_WID -#define IIO_BASE_PERF IIO_IPCR /* IO Performance Control */ -#define IIO_PERF_CNT IIO_IPPR /* IO Performance Profiling */ -#endif + +/* + * Macro which takes the widget number, and returns the + * IO PRB address of that widget. + * value _x is expected to be a widget number in the range + * 0, 8 - 0xF + */ +#define IIO_IOPRB(_x) (IIO_IOPRB_0 + ( ( (_x) < HUB_WIDGET_ID_MIN ? \ + (_x) : \ + (_x) - (HUB_WIDGET_ID_MIN-1)) << 3) ) /* GFX Flow Control Node/Widget Register */ @@ -139,7 +143,7 @@ * redefined big window 7 as small window 0. XXX does this still apply for SN1?? */ -#define HUB_NUM_BIG_WINDOW IIO_NUM_ITTES - 1 +#define HUB_NUM_BIG_WINDOW (IIO_NUM_ITTES - 1) /* * Use the top big window as a surrogate for the first small window @@ -343,7 +347,7 @@ * CRBs. */ -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ /* * Easy access macros for CRBs, all 4 registers (A-D) @@ -389,7 +393,7 @@ #define icrbd_context ii_icrb0_d_fld_s.id_context #define d_regvalue ii_icrb0_d_regval -#endif /* LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ /* Number of widgets supported by hub */ #define HUB_NUM_WIDGET 9 @@ -399,7 +403,7 @@ #define HUB_WIDGET_PART_NUM 0xc110 #define MAX_HUBS_PER_XBOW 2 -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ /* A few more #defines for backwards compatibility */ #define iprb_t ii_iprb0_u_t #define iprb_regval ii_iprb0_regval @@ -430,11 +434,11 @@ #define IO_PERF_SETS 32 #if __KERNEL__ -#if _LANGUAGE_C +#ifndef __ASSEMBLY__ /* XXX moved over from SN/SN0/hubio.h -- each should be checked for SN1 */ #include #include -#include +#include #include /* Bit for the widget in inbound access register */ @@ -699,12 +703,9 @@ extern int hub_intr_connect( hub_intr_t intr_hdl, /* xtalk intr resource hndl */ - intr_func_t intr_func, /* xtalk intr handler */ - void *intr_arg, /* arg to intr handler */ xtalk_intr_setfunc_t setfunc, /* func to set intr hw */ - void *setfunc_arg, /* arg to setfunc */ - void *thread); /* intr thread to use */ + void *setfunc_arg); /* arg to setfunc */ extern void hub_intr_disconnect(hub_intr_t intr_hdl); @@ -756,6 +757,6 @@ extern void hub_widgetdev_shutdown(devfs_handle_t, int); extern int hub_dma_enabled(devfs_handle_t); -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ #endif /* _KERNEL */ -#endif /* _ASM_SN_SN1_HUBIO_NEXT_H */ +#endif /* _ASM_IA64_SN_SN1_HUBIO_NEXT_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hublb.h lia64-2.4/include/asm-ia64/sn/sn1/hublb.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hublb.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/hublb.h Mon Nov 19 23:22:55 2001 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ /************************************************************************ @@ -20,8 +19,8 @@ ************************************************************************/ -#ifndef _ASM_SN_SN1_HUBLB_H -#define _ASM_SN_SN1_HUBLB_H +#ifndef _ASM_IA64_SN_SN1_HUBLB_H +#define _ASM_IA64_SN_SN1_HUBLB_H #define LB_REV_ID 0x00600000 /* @@ -251,7 +250,7 @@ -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ /************************************************************************ * * @@ -1593,7 +1592,7 @@ -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ /************************************************************************ * * @@ -1605,4 +1604,4 @@ -#endif /* _ASM_SN_SN1_HUBLB_H */ +#endif /* _ASM_IA64_SN_SN1_HUBLB_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hublb_next.h lia64-2.4/include/asm-ia64/sn/sn1/hublb_next.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hublb_next.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/hublb_next.h Mon Nov 19 23:22:55 2001 @@ -4,11 +4,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_HUBLB_NEXT_H -#define _ASM_SN_SN1_HUBLB_NEXT_H +#ifndef _ASM_IA64_SN_SN1_HUBLB_NEXT_H +#define _ASM_IA64_SN_SN1_HUBLB_NEXT_H /********************************************************************** @@ -107,4 +106,4 @@ #define PIOTYPE_PROT_ERR 6 /* VECTOR_STATUS only */ #define PIOTYPE_UNKNOWN 7 /* VECTOR_STATUS only */ -#endif /* _ASM_SN_SN1_HUBLB_NEXT_H */ +#endif /* _ASM_IA64_SN_SN1_HUBLB_NEXT_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hubmd.h lia64-2.4/include/asm-ia64/sn/sn1/hubmd.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hubmd.h Tue Mar 6 19:44:34 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/hubmd.h Mon Nov 19 23:22:56 2001 @@ -4,11 +4,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_HUBMD_H -#define _ASM_SN_SN1_HUBMD_H +#ifndef _ASM_IA64_SN_SN1_HUBMD_H +#define _ASM_IA64_SN_SN1_HUBMD_H /************************************************************************ @@ -315,7 +314,7 @@ -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ /************************************************************************ * * @@ -2140,7 +2139,7 @@ * corresponds to the valid bit, and bit 1 of each two-bit field * * corresponds to the overrun bit. * * The rule for the valid bit is that it gets set whenever that error * - * occurs, regardless of whether a higher priority error has occurred. * + * occurs, regardless of whether a higher priority error has occurred. * * The rule for the overrun bit is that it gets set whenever we are * * unable to record the address information for this particular * * error, due to a previous error of the same or higher priority. * @@ -2463,7 +2462,7 @@ -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ /************************************************************************ * * @@ -2474,4 +2473,4 @@ -#endif /* _ASM_SN_SN1_HUBMD_H */ +#endif /* _ASM_IA64_SN_SN1_HUBMD_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hubmd_next.h lia64-2.4/include/asm-ia64/sn/sn1/hubmd_next.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hubmd_next.h Tue Mar 6 19:44:34 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/hubmd_next.h Mon Feb 4 17:48:56 2002 @@ -4,13 +4,11 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_HUBMD_NEXT_H -#define _ASM_SN_SN1_HUBMD_NEXT_H +#ifndef _ASM_IA64_SN_SN1_HUBMD_NEXT_H +#define _ASM_IA64_SN_SN1_HUBMD_NEXT_H -#ifdef BRINGUP /* XXX moved over from SN/SN0/hubmd.h -- each should be checked for SN1 */ /* In fact, most of this stuff is wrong. Some is correct, such as * MD_PAGE_SIZE and MD_PAGE_NUM_SHFT. @@ -147,7 +145,7 @@ #define MD_SPROT_REFCNT_GET(value) ( \ ((value) & MD_SPROT_REFCNT_MASK) >> MD_SPROT_REFCNT_SHFT) -#if _LANGUAGE_C +#ifndef __ASSEMBLY__ #ifdef LITTLE_ENDIAN typedef union md_perf_sel { @@ -171,9 +169,8 @@ } md_perf_sel_t; #endif -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ -#endif /* BRINGUP */ /* Like SN0, SN1 supports a mostly-flat address space with 8 CPU-visible, evenly spaced, contiguous regions, or "software @@ -300,7 +297,7 @@ ***********************************************************************/ -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ /* Standard Directory Entries */ @@ -533,7 +530,7 @@ struct md_pdir_sparse_fmt pds_fmt; } md_pdir_t; -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ /********************************************************************** @@ -568,7 +565,7 @@ #define MD_DIR_WAIT (UINT64_CAST 0x6) /* ptr format, hw-defined */ #define MD_DIR_POISONED (UINT64_CAST 0x7) /* ptr format, hw-defined */ -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ /* Convert format and state fields into a single "cacheline state" value, defined above */ @@ -578,7 +575,7 @@ MD_DIR_SHARED) #define MD_DIR_STATE(x) MD_FMT_ST_TO_STATE(MD_DIR_FORMAT(x), MD_DIR_STVAL(x)) -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ @@ -812,4 +809,4 @@ #define MFC_ADDR_SHFT 6 -#endif /* _ASM_SN_SN1_HUBMD_NEXT_H */ +#endif /* _ASM_IA64_SN_SN1_HUBMD_NEXT_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hubni.h lia64-2.4/include/asm-ia64/sn/sn1/hubni.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hubni.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/hubni.h Mon Nov 19 23:22:56 2001 @@ -4,11 +4,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_HUBNI_H -#define _ASM_SN_SN1_HUBNI_H +#ifndef _ASM_IA64_SN_SN1_HUBNI_H +#define _ASM_IA64_SN_SN1_HUBNI_H /************************************************************************ @@ -1000,7 +999,7 @@ -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ /************************************************************************ * * @@ -1615,7 +1614,7 @@ -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ /************************************************************************ * * @@ -1779,4 +1778,4 @@ -#endif /* _ASM_SN_SN1_HUBNI_H */ +#endif /* _ASM_IA64_SN_SN1_HUBNI_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hubni_next.h lia64-2.4/include/asm-ia64/sn/sn1/hubni_next.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hubni_next.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/hubni_next.h Mon Nov 19 23:22:56 2001 @@ -4,11 +4,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_HUBNI_NEXT_H -#define _ASM_SN_SN1_HUBNI_NEXT_H +#ifndef _ASM_IA64_SN_SN1_HUBNI_NEXT_H +#define _ASM_IA64_SN_SN1_HUBNI_NEXT_H #define NI_LOCAL_ENTRIES 128 #define NI_META_ENTRIES 1 @@ -67,7 +66,7 @@ NPE_EXTLONG_MASK | NPE_EXTSHORT_MASK |\ NPE_FIFOOVFLOW_MASK | NPE_TAILTO_MASK) -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ /* NI_PORT_HEADER[AB] registers (not automatically generated) */ #ifdef LITTLE_ENDIAN @@ -172,4 +171,4 @@ 0x6 << NPP_NULL_TIMEOUT_SHFT | \ 0x3f0 << NPP_MAX_BURST_SHFT) -#endif /* _ASM_SN_SN1_HUBNI_NEXT_H */ +#endif /* _ASM_IA64_SN_SN1_HUBNI_NEXT_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hubpi.h lia64-2.4/include/asm-ia64/sn/sn1/hubpi.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hubpi.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/hubpi.h Mon Nov 19 23:22:56 2001 @@ -4,11 +4,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_HUBPI_H -#define _ASM_SN_SN1_HUBPI_H +#ifndef _ASM_IA64_SN_SN1_HUBPI_H +#define _ASM_IA64_SN_SN1_HUBPI_H /************************************************************************ * * @@ -551,7 +550,7 @@ -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ /************************************************************************ * * @@ -4248,7 +4247,7 @@ -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ /************************************************************************ * * @@ -4261,4 +4260,4 @@ #define PI_GFX_PAGE_ENABLE 0x0000010000000000LL -#endif /* _ASM_SN_SN1_HUBPI_H */ +#endif /* _ASM_IA64_SN_SN1_HUBPI_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hubpi_next.h lia64-2.4/include/asm-ia64/sn/sn1/hubpi_next.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hubpi_next.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/hubpi_next.h Mon Nov 19 23:22:56 2001 @@ -4,11 +4,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_HUBPI_NEXT_H -#define _ASM_SN_SN1_HUBPI_NEXT_H +#ifndef _ASM_IA64_SN_SN1_HUBPI_NEXT_H +#define _ASM_IA64_SN_SN1_HUBPI_NEXT_H /* define for remote PI_1 space. It is always half of a node_addressspace @@ -54,7 +53,7 @@ ((sts) & (PI_CRB_STS_I | PI_CRB_STS_H) | \ ((sts) & (PI_CRB_STS_A | PI_CRB_STS_R)) >> 1) -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ /* * format of error stack and error status registers. */ @@ -329,4 +328,4 @@ /* Error stack address shift, for use with pi_stk_fmt.sk_addr */ #define ERR_STK_ADDR_SHFT 3 -#endif /* _ASM_SN_SN1_HUBPI_NEXT_H */ +#endif /* _ASM_IA64_SN_SN1_HUBPI_NEXT_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hubspc.h lia64-2.4/include/asm-ia64/sn/sn1/hubspc.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hubspc.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn1/hubspc.h Mon Nov 19 23:22:56 2001 @@ -0,0 +1,24 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. + */ +#ifndef _ASM_IA64_SN_SN1_HUBSPC_H +#define _ASM_IA64_SN_SN1_HUBSPC_H + +typedef enum { + HUBSPC_REFCOUNTERS, + HUBSPC_PROM +} hubspc_subdevice_t; + + +/* + * Reference Counters + */ + +extern int refcounters_attach(devfs_handle_t hub); + +#endif /* _ASM_IA64_SN_SN1_HUBSPC_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hubstat.h lia64-2.4/include/asm-ia64/sn/sn1/hubstat.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hubstat.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn1/hubstat.h Mon Nov 19 23:22:56 2001 @@ -0,0 +1,56 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2000 - 2001 Silicon Graphics, Inc. All rights reserved. + */ + +#ifndef _ASM_IA64_SN_SN1_HUBSTAT_H +#define _ASM_IA64_SN_SN1_HUBSTAT_H + +typedef int64_t hub_count_t; + +#define HUBSTAT_VERSION 1 + +typedef struct hubstat_s { + char hs_version; /* structure version */ + cnodeid_t hs_cnode; /* cnode of this hub */ + nasid_t hs_nasid; /* Nasid of same */ + int64_t hs_timebase; /* Time of first sample */ + int64_t hs_timestamp; /* Time of last sample */ + int64_t hs_per_minute; /* Ticks per minute */ + + union { + hubreg_t hs_niu_stat_rev_id; /* SN0: Status rev ID */ + hubreg_t hs_niu_port_status; /* SN1: Port status */ + } hs_niu; + + hub_count_t hs_ni_retry_errors; /* Total retry errors */ + hub_count_t hs_ni_sn_errors; /* Total sn errors */ + hub_count_t hs_ni_cb_errors; /* Total cb errors */ + int hs_ni_overflows; /* NI count overflows */ + hub_count_t hs_ii_sn_errors; /* Total sn errors */ + hub_count_t hs_ii_cb_errors; /* Total cb errors */ + int hs_ii_overflows; /* II count overflows */ + + /* + * Anything below this comment is intended for kernel internal-use + * only and may be changed at any time. + * + * Any members that contain pointers or are conditionally compiled + * need to be below here also. + */ + int64_t hs_last_print; /* When we last printed */ + char hs_print; /* Should we print */ + + char *hs_name; /* This hub's name */ + unsigned char hs_maint; /* Should we print to availmon */ +} hubstat_t; + +#define hs_ni_stat_rev_id hs_niu.hs_niu_stat_rev_id +#define hs_ni_port_status hs_niu.hs_niu_port_status + +extern struct file_operations hub_mon_fops; + +#endif /* _ASM_IA64_SN_SN1_HUBSTAT_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hubxb.h lia64-2.4/include/asm-ia64/sn/sn1/hubxb.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hubxb.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/hubxb.h Mon Nov 19 23:22:56 2001 @@ -4,11 +4,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_HUBXB_H -#define _ASM_SN_SN1_HUBXB_H +#ifndef _ASM_IA64_SN_SN1_HUBXB_H +#define _ASM_IA64_SN_SN1_HUBXB_H /************************************************************************ * * @@ -273,7 +272,7 @@ -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ /************************************************************************ * * @@ -1247,7 +1246,7 @@ -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ /************************************************************************ * * @@ -1286,4 +1285,4 @@ -#endif /* _ASM_SN_SN1_HUBXB_H */ +#endif /* _ASM_IA64_SN_SN1_HUBXB_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hubxb_next.h lia64-2.4/include/asm-ia64/sn/sn1/hubxb_next.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hubxb_next.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/hubxb_next.h Mon Nov 19 23:22:56 2001 @@ -4,11 +4,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_HUBXB_NEXT_H -#define _ASM_SN_SN1_HUBXB_NEXT_H +#ifndef _ASM_IA64_SN_SN1_HUBXB_NEXT_H +#define _ASM_IA64_SN_SN1_HUBXB_NEXT_H /* XB_FIRST_ERROR fe_source field encoding */ #define XVE_SOURCE_POQ0 0xf /* 1111 */ @@ -30,4 +29,4 @@ #define XBP_RESET_DEFAULTS 0x0008000080000021LL #define XBP_ACTIVE_DEFAULTS 0x00080000fffff021LL -#endif /* _ASM_SN_SN1_HUBXB_NEXT_H */ +#endif /* _ASM_IA64_SN_SN1_HUBXB_NEXT_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/hwcntrs.h lia64-2.4/include/asm-ia64/sn/sn1/hwcntrs.h --- linux-2.4.18/include/asm-ia64/sn/sn1/hwcntrs.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn1/hwcntrs.h Mon Nov 19 23:22:56 2001 @@ -0,0 +1,96 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. + */ +#ifndef _ASM_IA64_SN_SN1_HWCNTRS_H +#define _ASM_IA64_SN_SN1_HWCNTRS_H + + +typedef uint64_t refcnt_t; + +#define SN0_REFCNT_MAX_COUNTERS 64 + +typedef struct sn0_refcnt_set { + refcnt_t refcnt[SN0_REFCNT_MAX_COUNTERS]; + uint64_t flags; + uint64_t reserved[4]; +} sn0_refcnt_set_t; + +typedef struct sn0_refcnt_buf { + sn0_refcnt_set_t refcnt_set; + uint64_t paddr; + uint64_t page_size; + cnodeid_t cnodeid; /* cnodeid + pad[3] use 64 bits */ + uint16_t pad[3]; + uint64_t reserved[4]; +} sn0_refcnt_buf_t; + +typedef struct sn0_refcnt_args { + uint64_t vaddr; + uint64_t len; + sn0_refcnt_buf_t* buf; + uint64_t reserved[4]; +} sn0_refcnt_args_t; + +/* + * Info needed by the user level program + * to mmap the refcnt buffer + */ + +#define RCB_INFO_GET 1 +#define RCB_SLOT_GET 2 + +typedef struct rcb_info { + uint64_t rcb_len; /* total refcnt buffer len in bytes */ + + int rcb_sw_sets; /* number of sw counter sets in buffer */ + int rcb_sw_counters_per_set; /* sw counters per set -- num_compact_nodes */ + int rcb_sw_counter_size; /* sizeof(refcnt_t) -- size of sw cntr */ + + int rcb_base_pages; /* number of base pages in node */ + int rcb_base_page_size; /* sw base page size */ + uint64_t rcb_base_paddr; /* base physical address for this node */ + + int rcb_cnodeid; /* cnodeid for this node */ + int rcb_granularity; /* hw page size used for counter sets */ + uint rcb_hw_counter_max; /* max hwcounter count (width mask) */ + int rcb_diff_threshold; /* current node differential threshold */ + int rcb_abs_threshold; /* current node absolute threshold */ + int rcb_num_slots; /* physmem slots */ + + int rcb_reserved[512]; + +} rcb_info_t; + +typedef struct rcb_slot { + uint64_t base; + uint64_t size; +} rcb_slot_t; + +#if defined(__KERNEL__) +typedef struct sn0_refcnt_args_32 { + uint64_t vaddr; + uint64_t len; + app32_ptr_t buf; + uint64_t reserved[4]; +} sn0_refcnt_args_32_t; + +/* Defines and Macros */ +/* A set of reference counts are for 4k bytes of physical memory */ +#define NBPREFCNTP 0x1000 +#define BPREFCNTPSHIFT 12 +#define bytes_to_refcntpages(x) (((__psunsigned_t)(x)+(NBPREFCNTP-1))>>BPREFCNTPSHIFT) +#define refcntpage_offset(x) ((__psunsigned_t)(x)&((NBPP-1)&~(NBPREFCNTP-1))) +#define align_to_refcntpage(x) ((__psunsigned_t)(x)&(~(NBPREFCNTP-1))) + +extern void migr_refcnt_read(sn0_refcnt_buf_t*); +extern void migr_refcnt_read_extended(sn0_refcnt_buf_t*); +extern int migr_refcnt_enabled(void); + +#endif /* __KERNEL__ */ + +#endif /* _ASM_IA64_SN_SN1_HWCNTRS_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/intr.h lia64-2.4/include/asm-ia64/sn/sn1/intr.h --- linux-2.4.18/include/asm-ia64/sn/sn1/intr.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn1/intr.h Mon Feb 4 17:48:56 2002 @@ -0,0 +1,237 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ +#ifndef _ASM_IA64_SN_SN1_INTR_H +#define _ASM_IA64_SN_SN1_INTR_H + +/* Subnode wildcard */ +#define SUBNODE_ANY (-1) + +/* Number of interrupt levels associated with each interrupt register. */ +#define N_INTPEND_BITS 64 + +#define INT_PEND0_BASELVL 0 +#define INT_PEND1_BASELVL 64 + +#define N_INTPENDJUNK_BITS 8 +#define INTPENDJUNK_CLRBIT 0x80 + +#include +#include +#include +#include + +#ifndef __ASSEMBLY__ +#define II_NAMELEN 24 + +/* + * Dispatch table entry - contains information needed to call an interrupt + * routine. + */ +typedef struct intr_vector_s { + intr_func_t iv_func; /* Interrupt handler function */ + intr_func_t iv_prefunc; /* Interrupt handler prologue func */ + void *iv_arg; /* Argument to pass to handler */ + cpuid_t iv_mustruncpu; /* Where we must run. */ +} intr_vector_t; + +/* Interrupt information table. */ +typedef struct intr_info_s { + xtalk_intr_setfunc_t ii_setfunc; /* Function to set the interrupt + * destination and level register. + * It returns 0 (success) or an + * error code. + */ + void *ii_cookie; /* arg passed to setfunc */ + devfs_handle_t ii_owner_dev; /* device that owns this intr */ + char ii_name[II_NAMELEN]; /* Name of this intr. */ + int ii_flags; /* informational flags */ +} intr_info_t; + + +#define THD_CREATED 0x00000001 /* + * We've created a thread for this + * interrupt. + */ + +/* + * Bits for ii_flags: + */ +#define II_UNRESERVE 0 +#define II_RESERVE 1 /* Interrupt reserved. */ +#define II_INUSE 2 /* Interrupt connected */ +#define II_ERRORINT 4 /* INterrupt is an error condition */ +#define II_THREADED 8 /* Interrupt handler is threaded. */ + +/* + * Interrupt level wildcard + */ +#define INTRCONNECT_ANYBIT (-1) + +/* + * This structure holds information needed both to call and to maintain + * interrupts. The two are in separate arrays for the locality benefits. + * Since there's only one set of vectors per hub chip (but more than one + * CPU, the lock to change the vector tables must be here rather than in + * the PDA. + */ + +typedef struct intr_vecblk_s { + intr_vector_t vectors[N_INTPEND_BITS]; /* information needed to + call an intr routine. */ + intr_info_t info[N_INTPEND_BITS]; /* information needed only + to maintain interrupts. */ + spinlock_t vector_lock; /* Lock for this and the + masks in the PDA. */ + splfunc_t vector_spl; /* vector_lock req'd spl */ + int vector_state; /* Initialized to zero. + Set to INTR_INITED + by hubintr_init. + */ + int vector_count; /* Number of vectors + * reserved. + */ + int cpu_count[CPUS_PER_SUBNODE]; /* How many interrupts are + * connected to each CPU + */ + int ithreads_enabled; /* Are interrupt threads + * initialized on this node. + * and block? + */ +} intr_vecblk_t; + +/* Possible values for vector_state: */ +#define VECTOR_UNINITED 0 +#define VECTOR_INITED 1 +#define VECTOR_SET 2 + +#define hub_intrvect0 private.p_intmasks.dispatch0->vectors +#define hub_intrvect1 private.p_intmasks.dispatch1->vectors +#define hub_intrinfo0 private.p_intmasks.dispatch0->info +#define hub_intrinfo1 private.p_intmasks.dispatch1->info + +/* + * Macros to manipulate the interrupt register on the calling hub chip. + */ + +#define LOCAL_HUB_SEND_INTR(_level) LOCAL_HUB_S(PI_INT_PEND_MOD, \ + (0x100|(_level))) +#define REMOTE_HUB_PI_SEND_INTR(_hub, _sn, _level) \ + REMOTE_HUB_PI_S((_hub), _sn, PI_INT_PEND_MOD, (0x100|(_level))) + +#define REMOTE_CPU_SEND_INTR(_cpuid, _level) \ + REMOTE_HUB_PI_S(cpuid_to_nasid(_cpuid), \ + SUBNODE(cpuid_to_slice(_cpuid)), \ + PI_INT_PEND_MOD, (0x100|(_level))) + +/* + * When clearing the interrupt, make sure this clear does make it + * to the hub. Otherwise we could end up losing interrupts. + * We do an uncached load of the int_pend0 register to ensure this. + */ + +#define LOCAL_HUB_CLR_INTR(_level) \ + LOCAL_HUB_S(PI_INT_PEND_MOD, (_level)), \ + LOCAL_HUB_L(PI_INT_PEND0) +#define REMOTE_HUB_PI_CLR_INTR(_hub, _sn, _level) \ + REMOTE_HUB_PI_S((_hub), (_sn), PI_INT_PEND_MOD, (_level)), \ + REMOTE_HUB_PI_L((_hub), (_sn), PI_INT_PEND0) + +/* Special support for use by gfx driver only. Supports special gfx hub interrupt. */ +extern void install_gfxintr(cpuid_t cpu, ilvl_t swlevel, intr_func_t intr_func, void *intr_arg); + +void setrtvector(intr_func_t func); + +/* + * Interrupt blocking + */ +extern void intr_block_bit(cpuid_t cpu, int bit); +extern void intr_unblock_bit(cpuid_t cpu, int bit); + +#endif /* __ASSEMBLY__ */ + +/* + * Hard-coded interrupt levels: + */ + +/* + * L0 = SW1 + * L1 = SW2 + * L2 = INT_PEND0 + * L3 = INT_PEND1 + * L4 = RTC + * L5 = Profiling Timer + * L6 = Hub Errors + * L7 = Count/Compare (T5 counters) + */ + + +/* INT_PEND0 hard-coded bits. */ +#ifdef DEBUG_INTR_TSTAMP +/* hard coded interrupt level for interrupt latency test interrupt */ +#define CPU_INTRLAT_B 62 +#define CPU_INTRLAT_A 61 +#endif + +/* Hardcoded bits required by software. */ +#define MSC_MESG_INTR 9 +#define CPU_ACTION_B 8 +#define CPU_ACTION_A 7 + +/* These are determined by hardware: */ +#define CC_PEND_B 6 +#define CC_PEND_A 5 +#define UART_INTR 4 +#define PG_MIG_INTR 3 +#define GFX_INTR_B 2 +#define GFX_INTR_A 1 +#define RESERVED_INTR 0 + +/* INT_PEND1 hard-coded bits: */ +#define MSC_PANIC_INTR 63 +#define NI_ERROR_INTR 62 +#define MD_COR_ERR_INTR 61 +#define COR_ERR_INTR_B 60 +#define COR_ERR_INTR_A 59 +#define CLK_ERR_INTR 58 + +# define NACK_INT_B 57 +# define NACK_INT_A 56 +# define LB_ERROR 55 +# define XB_ERROR 54 + +#define BRIDGE_ERROR_INTR 53 /* Setup by PROM to catch Bridge Errors */ + +#define IP27_INTR_0 52 /* Reserved for PROM use */ +#define IP27_INTR_1 51 /* (do not use in Kernel) */ +#define IP27_INTR_2 50 +#define IP27_INTR_3 49 +#define IP27_INTR_4 48 +#define IP27_INTR_5 47 +#define IP27_INTR_6 46 +#define IP27_INTR_7 45 + +#define TLB_INTR_B 44 /* used for tlb flush random */ +#define TLB_INTR_A 43 + +#define LLP_PFAIL_INTR_B 42 /* see ml/SN/SN0/sysctlr.c */ +#define LLP_PFAIL_INTR_A 41 + +#define NI_BRDCAST_ERR_B 40 +#define NI_BRDCAST_ERR_A 39 + +# define IO_ERROR_INTR 38 /* set up by prom */ +# define DEBUG_INTR_B 37 /* used by symmon to stop all cpus */ +# define DEBUG_INTR_A 36 + +// These aren't strictly accurate or complete. See the +// Synergy Spec. for details. +#define SGI_UART_IRQ (65) +#define SGI_HUB_ERROR_IRQ (182) + +#endif /* _ASM_IA64_SN_SN1_INTR_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/intr_public.h lia64-2.4/include/asm-ia64/sn/sn1/intr_public.h --- linux-2.4.18/include/asm-ia64/sn/sn1/intr_public.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn1/intr_public.h Fri Jul 19 23:20:15 2002 @@ -0,0 +1,53 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. + */ +#ifndef _ASM_IA64_SN_SN1_INTR_PUBLIC_H +#define _ASM_IA64_SN_SN1_INTR_PUBLIC_H + +/* REMEMBER: If you change these, the whole world needs to be recompiled. + * It would also require changing the hubspl.s code and SN0/intr.c + * Currently, the spl code has no support for multiple INTPEND1 masks. + */ + +#define N_INTPEND0_MASKS 1 +#define N_INTPEND1_MASKS 1 + +#define INTPEND0_MAXMASK (N_INTPEND0_MASKS - 1) +#define INTPEND1_MAXMASK (N_INTPEND1_MASKS - 1) + +#ifndef __ASSEMBLY__ +#include + +struct intr_vecblk_s; /* defined in asm/sn/intr.h */ + +/* + * The following are necessary to create the illusion of a CEL + * on the IP27 hub. We'll add more priority levels soon, but for + * now, any interrupt in a particular band effectively does an spl. + * These must be in the PDA since they're different for each processor. + * Users of this structure must hold the vector_lock in the appropriate vector + * block before modifying the mask arrays. There's only one vector block + * for each Hub so a lock in the PDA wouldn't be adequate. + */ +typedef struct hub_intmasks_s { + /* + * The masks are stored with the lowest-priority (most inclusive) + * in the lowest-numbered masks (i.e., 0, 1, 2...). + */ + /* INT_PEND0: */ + hubreg_t intpend0_masks[N_INTPEND0_MASKS]; + /* INT_PEND1: */ + hubreg_t intpend1_masks[N_INTPEND1_MASKS]; + /* INT_PEND0: */ + struct intr_vecblk_s *dispatch0; + /* INT_PEND1: */ + struct intr_vecblk_s *dispatch1; +} hub_intmasks_t; + +#endif /* __ASSEMBLY__ */ +#endif /* _ASM_IA64_SN_SN1_INTR_PUBLIC_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/ip27config.h lia64-2.4/include/asm-ia64/sn/sn1/ip27config.h --- linux-2.4.18/include/asm-ia64/sn/sn1/ip27config.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/ip27config.h Mon Feb 4 17:48:56 2002 @@ -4,12 +4,11 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_IP27CONFIG_H -#define _ASM_SN_SN1_IP27CONFIG_H +#ifndef _ASM_IA64_SN_SN1_IP27CONFIG_H +#define _ASM_IA64_SN_SN1_IP27CONFIG_H /* @@ -50,7 +49,7 @@ */ #define IP27_RTC_FREQ 1250 /* 800ns cycle time */ -#if _LANGUAGE_C +#ifndef __ASSEMBLY__ typedef struct ip27config_s { /* KEEP IN SYNC w/ start.s & below */ uint time_const; /* Time constant */ @@ -110,9 +109,9 @@ */ #define CONFIG_12P4I_NODE(n) (0) -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ -#if _LANGUAGE_ASSEMBLY +#if __ASSEMBLY__ .struct 0 /* KEEP IN SYNC WITH C structure */ ip27c_time_const: .word 0 @@ -137,7 +136,7 @@ ip27c_pvers_rev: .word 0 ip27c_config_type: .word 0 /* To recognize special configs */ -#endif /* _LANGUAGE_ASSEMBLY */ +#endif /* __ASSEMBLY__ */ /* * R10000 Configuration Cycle - These define the SYSAD values used @@ -245,7 +244,7 @@ #define CONFIG_FREQ_RTC IP27C_KHZ(IP27_RTC_FREQ) -#if _LANGUAGE_C +#ifndef __ASSEMBLY__ /* we are going to define all the known configs is a table * for building hex images we will pull out the particular @@ -258,7 +257,7 @@ */ /* these numbers are as the are ordered in the table below */ -#define IP27_CONFIG_UNKNOWN -1 +#define IP27_CONFIG_UNKNOWN (-1) #define IP27_CONFIG_SN1_1MB_200_400_200_TABLE 0 #define IP27_CONFIG_SN00_4MB_100_200_133_TABLE 1 #define IP27_CONFIG_SN1_4MB_200_400_267_TABLE 2 @@ -500,9 +499,9 @@ #define CONFIG_FPROM_WR ip_config_table[IP27_CONFIG_SN1_4MB_180_360_240_TABLE].fprom_wr #endif /* IP27_CONFIG_SN1_4MB_180_360_240 */ -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ -#if _LANGUAGE_ASSEMBLY +#if __ASSEMBLY__ /* these need to be in here since we need assembly definitions * for building hex images (as required by start.s) @@ -653,6 +652,6 @@ #define CONFIG_FPROM_WR CONFIG_FPROM_ENABLE #endif /* IP27_CONFIG_SN1_4MB_180_360_240 */ -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ -#endif /* _ASM_SN_SN1_IP27CONFIG_H */ +#endif /* _ASM_IA64_SN_SN1_IP27CONFIG_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/kldir.h lia64-2.4/include/asm-ia64/sn/sn1/kldir.h --- linux-2.4.18/include/asm-ia64/sn/sn1/kldir.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/kldir.h Wed Dec 31 16:00:00 1969 @@ -1,222 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ - -#ifndef _ASM_SN_SN1_KLDIR_H -#define _ASM_SN_SN1_KLDIR_H - -/* - * The upper portion of the memory map applies during boot - * only and is overwritten by IRIX/SYMMON. The minimum memory bank - * size on IP35 is 64M, which provides a limit on the amount of space - * the PROM can assume it has available. - * - * Most of the addresses below are defined as macros in this file, or - * in SN/addrs.h or SN/SN1/addrs.h. - * - * MEMORY MAP PER NODE - * - * 0x4000000 (64M) +-----------------------------------------+ - * | | - * | | - * | IO7 TEXT/DATA/BSS/stack | - * 0x3000000 (48M) +-----------------------------------------+ - * | Free | - * 0x2102000 (>33M) +-----------------------------------------+ - * | IP35 Topology (PCFG) + misc data | - * 0x2000000 (32M) +-----------------------------------------+ - * | IO7 BUFFERS FOR FLASH ENET IOC3 | - * 0x1F80000 (31.5M) +-----------------------------------------+ - * | Free | - * 0x1C00000 (28M) +-----------------------------------------+ - * | IP35 PROM TEXT/DATA/BSS/stack | - * 0x1A00000 (26M) +-----------------------------------------+ - * | Routing temp. space | - * 0x1800000 (24M) +-----------------------------------------+ - * | Diagnostics temp. space | - * 0x1500000 (21M) +-----------------------------------------+ - * | Free | - * 0x1400000 (20M) +-----------------------------------------+ - * | IO7 PROM temporary copy | - * 0x1300000 (19M) +-----------------------------------------+ - * | | - * | Free | - * | (UNIX DATA starts above 0x1000000) | - * | | - * +-----------------------------------------+ - * | UNIX DEBUG Version | - * 0x0310000 (3.1M) +-----------------------------------------+ - * | SYMMON, loaded just below UNIX | - * | (For UNIX Debug only) | - * | | - * | | - * 0x006C000 (432K) +-----------------------------------------+ - * | SYMMON STACK [NUM_CPU_PER_NODE] | - * | (For UNIX Debug only) | - * 0x004C000 (304K) +-----------------------------------------+ - * | | - * | | - * | UNIX NON-DEBUG Version | - * 0x0040000 (256K) +-----------------------------------------+ - * - * - * The lower portion of the memory map contains information that is - * permanent and is used by the IP35PROM, IO7PROM and IRIX. - * - * 0x40000 (256K) +-----------------------------------------+ - * | | - * | KLCONFIG (64K) | - * | | - * 0x30000 (192K) +-----------------------------------------+ - * | | - * | PI Error Spools (64K) | - * | | - * 0x20000 (128K) +-----------------------------------------+ - * | | - * | Unused | - * | | - * 0x19000 (100K) +-----------------------------------------+ - * | Early cache Exception stack (CPU 3)| - * 0x18800 (98K) +-----------------------------------------+ - * | cache error eframe (CPU 3) | - * 0x18400 (97K) +-----------------------------------------+ - * | Exception Handlers (CPU 3) | - * 0x18000 (96K) +-----------------------------------------+ - * | | - * | Unused | - * | | - * 0x13c00 (79K) +-----------------------------------------+ - * | GPDA (8k) | - * 0x11c00 (71K) +-----------------------------------------+ - * | Early cache Exception stack (CPU 2)| - * 0x10800 (66k) +-----------------------------------------+ - * | cache error eframe (CPU 2) | - * 0x10400 (65K) +-----------------------------------------+ - * | Exception Handlers (CPU 2) | - * 0x10000 (64K) +-----------------------------------------+ - * | | - * | Unused | - * | | - * 0x0b400 (45K) +-----------------------------------------+ - * | GDA (1k) | - * 0x0b000 (44K) +-----------------------------------------+ - * | NMI Eframe areas (4) | - * 0x0a000 (40K) +-----------------------------------------+ - * | NMI Register save areas (4) | - * 0x09000 (36K) +-----------------------------------------+ - * | Early cache Exception stack (CPU 1)| - * 0x08800 (34K) +-----------------------------------------+ - * | cache error eframe (CPU 1) | - * 0x08400 (33K) +-----------------------------------------+ - * | Exception Handlers (CPU 1) | - * 0x08000 (32K) +-----------------------------------------+ - * | | - * | | - * | Unused | - * | | - * | | - * 0x04000 (16K) +-----------------------------------------+ - * | NMI Handler (Protected Page) | - * 0x03000 (12K) +-----------------------------------------+ - * | ARCS PVECTORS (master node only) | - * 0x02c00 (11K) +-----------------------------------------+ - * | ARCS TVECTORS (master node only) | - * 0x02800 (10K) +-----------------------------------------+ - * | LAUNCH [NUM_CPU] | - * 0x02400 (9K) +-----------------------------------------+ - * | Low memory directory (KLDIR) | - * 0x02000 (8K) +-----------------------------------------+ - * | ARCS SPB (1K) | - * 0x01000 (4K) +-----------------------------------------+ - * | Early cache Exception stack (CPU 0)| - * 0x00800 (2k) +-----------------------------------------+ - * | cache error eframe (CPU 0) | - * 0x00400 (1K) +-----------------------------------------+ - * | Exception Handlers (CPU 0) | - * 0x00000 (0K) +-----------------------------------------+ - */ - -/* - * NOTE: To change the kernel load address, you must update: - * - the appropriate elspec files in irix/kern/master.d - * - NODEBUGUNIX_ADDR in SN/SN1/addrs.h - * - IP27_FREEMEM_OFFSET below - * - KERNEL_START_OFFSET below (if supporting cells) - */ - - -/* - * This is defined here because IP27_SYMMON_STK_SIZE must be at least what - * we define here. Since it's set up in the prom. We can't redefine it later - * and expect more space to be allocated. The way to find out the true size - * of the symmon stacks is to divide SYMMON_STK_SIZE by SYMMON_STK_STRIDE - * for a particular node. - */ -#define SYMMON_STACK_SIZE 0x8000 - -#if defined (PROM) || defined (SABLE) - -/* - * These defines are prom version dependent. No code other than the IP35 - * prom should attempt to use these values. - */ -#define IP27_LAUNCH_OFFSET 0x2400 -#define IP27_LAUNCH_SIZE 0x400 -#define IP27_LAUNCH_COUNT 4 -#define IP27_LAUNCH_STRIDE 0x100 /* could be as small as 0x80 */ - -#define IP27_KLCONFIG_OFFSET 0x30000 -#define IP27_KLCONFIG_SIZE 0x10000 -#define IP27_KLCONFIG_COUNT 1 -#define IP27_KLCONFIG_STRIDE 0 - -#define IP27_NMI_OFFSET 0x3000 -#define IP27_NMI_SIZE 0x100 -#define IP27_NMI_COUNT 4 -#define IP27_NMI_STRIDE 0x40 - -#define IP27_PI_ERROR_OFFSET 0x20000 -#define IP27_PI_ERROR_SIZE 0x10000 -#define IP27_PI_ERROR_COUNT 1 -#define IP27_PI_ERROR_STRIDE 0 - -#define IP27_SYMMON_STK_OFFSET 0x4c000 -#define IP27_SYMMON_STK_SIZE 0x20000 -#define IP27_SYMMON_STK_COUNT 4 -/* IP27_SYMMON_STK_STRIDE must be >= SYMMON_STACK_SIZE */ -#define IP27_SYMMON_STK_STRIDE 0x8000 - -#define IP27_FREEMEM_OFFSET 0x40000 -#define IP27_FREEMEM_SIZE -1 -#define IP27_FREEMEM_COUNT 1 -#define IP27_FREEMEM_STRIDE 0 - -#endif /* PROM || SABLE*/ -/* - * There will be only one of these in a partition so the IO7 must set it up. - */ -#define IO6_GDA_OFFSET 0xb000 -#define IO6_GDA_SIZE 0x400 -#define IO6_GDA_COUNT 1 -#define IO6_GDA_STRIDE 0 - -/* - * save area of kernel nmi regs in the prom format - */ -#define IP27_NMI_KREGS_OFFSET 0x9000 -#define IP27_NMI_KREGS_CPU_SIZE 0x400 -/* - * save area of kernel nmi regs in eframe format - */ -#define IP27_NMI_EFRAME_OFFSET 0xa000 -#define IP27_NMI_EFRAME_SIZE 0x400 - -#define GPDA_OFFSET 0x11c00 - -#endif /* _ASM_SN_SN1_KLDIR_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/leds.h lia64-2.4/include/asm-ia64/sn/sn1/leds.h --- linux-2.4.18/include/asm-ia64/sn/sn1/leds.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/leds.h Wed Dec 31 16:00:00 1969 @@ -1,35 +0,0 @@ -#ifndef _ASM_SN_SN1_LED_H -#define _ASM_SN_SN1_LED_H - -/* - * Copyright (C) 2000 Silicon Graphics, Inc - * Copyright (C) 2000 Jack Steiner (steiner@sgi.com) - */ - -#include - -#define LED0 0xc0000b00100000c0LL /* ZZZ fixme */ - - - -#define LED_AP_START 0x01 /* AP processor started */ -#define LED_AP_IDLE 0x01 - -/* - * Basic macros for flashing the LEDS on an SGI, SN1. - */ - -extern __inline__ void -HUB_SET_LED(int val) -{ - long *ledp; - int eid; - - eid = hard_smp_processor_id() & 3; - ledp = (long*) (LED0 + (eid<<3)); - *ledp = val; -} - - -#endif /* _ASM_SN_SN1_LED_H */ - diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/mem_refcnt.h lia64-2.4/include/asm-ia64/sn/sn1/mem_refcnt.h --- linux-2.4.18/include/asm-ia64/sn/sn1/mem_refcnt.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn1/mem_refcnt.h Mon Nov 19 23:22:56 2001 @@ -0,0 +1,25 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. + */ +#ifndef _ASM_IA64_SN_SN1_MEM_REFCNT_H +#define _ASM_IA64_SN_SN1_MEM_REFCNT_H + +extern int mem_refcnt_attach(devfs_handle_t hub); +extern int mem_refcnt_open(devfs_handle_t *devp, mode_t oflag, int otyp, cred_t *crp); +extern int mem_refcnt_close(devfs_handle_t dev, int oflag, int otyp, cred_t *crp); +extern int mem_refcnt_mmap(devfs_handle_t dev, vhandl_t *vt, off_t off, size_t len, uint prot); +extern int mem_refcnt_unmap(devfs_handle_t dev, vhandl_t *vt); +extern int mem_refcnt_ioctl(devfs_handle_t dev, + int cmd, + void *arg, + int mode, + cred_t *cred_p, + int *rvalp); + + +#endif /* _ASM_IA64_SN_SN1_MEM_REFCNT_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/mmzone_sn1.h lia64-2.4/include/asm-ia64/sn/sn1/mmzone_sn1.h --- linux-2.4.18/include/asm-ia64/sn/sn1/mmzone_sn1.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn1/mmzone_sn1.h Tue Feb 26 13:19:35 2002 @@ -0,0 +1,149 @@ +#ifndef _ASM_IA64_SN_MMZONE_SN1_H +#define _ASM_IA64_SN_MMZONE_SN1_H + +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include + + +/* + * SGI SN1 Arch defined values + * + * An SN1 physical address is broken down as follows: + * + * +-----------------------------------------+ + * | | | | node offset | + * | unused | AS | node |-------------------| + * | | | | cn | clump offset | + * +-----------------------------------------+ + * 6 4 4 4 3 3 3 3 2 0 + * 3 4 3 0 9 3 2 0 9 0 + * + * bits 63-44 Unused - must be zero + * bits 43-40 Address space ID. Cached memory has a value of 0. + * Chipset & IO addresses have non-zero values. + * bits 39-33 Node number. Note that some configurations do NOT + * have a node zero. + * bits 32-0 Node offset. + * + * The node offset can be further broken down as: + * bits 32-30 Clump (bank) number. + * bits 29-0 Clump (bank) offset. + * + * A node consists of up to 8 clumps (banks) of memory. A clump may be empty, or may be + * populated with a single contiguous block of memory starting at clump + * offset 0. The size of the block is (2**n) * 64MB, where 0> SN1_NODE_SHIFT) & SN1_NODE_MASK) +#define SN1_NODE_CLUMP_NUMBER(addr) (((unsigned long)(addr) >>30) & 7) +#define SN1_NODE_OFFSET(addr) (((unsigned long)(addr)) & SN1_NODE_OFFSET_MASK) +#define SN1_KADDR(nasid, offset) (((unsigned long)(nasid)<> SN1_CHUNKSHIFT) + + +/* + * Given a kaddr, find the nid (compact nodeid) + */ +#ifdef CONFIG_IA64_SGI_SN_DEBUG +#define DISCONBUG(kaddr) panic("DISCONTIG BUG: line %d, %s. kaddr 0x%lx", \ + __LINE__, __FILE__, (long)(kaddr)) + +#define KVADDR_TO_NID(kaddr) ({long _ktn=(long)(kaddr); \ + kern_addr_valid(_ktn) ? \ + local_node_data->physical_node_map[SN1_NODE_NUMBER(_ktn)] :\ + (DISCONBUG(_ktn), 0UL);}) +#else +#define KVADDR_TO_NID(kaddr) (local_node_data->physical_node_map[SN1_NODE_NUMBER(kaddr)]) +#endif + + + +/* + * Given a kaddr, find the index into the clump_mem_map_base array of the page struct entry + * for the first page of the clump. + */ +#define PLAT_CLUMP_MEM_MAP_INDEX(kaddr) ({long _kmmi=(long)(kaddr); \ + KVADDR_TO_NID(_kmmi) * PLAT_CLUMPS_PER_NODE + \ + SN1_NODE_CLUMP_NUMBER(_kmmi);}) + + +/* + * Calculate a "goal" value to be passed to __alloc_bootmem_node for allocating structures on + * nodes so that they dont alias to the same line in the cache as the previous allocated structure. + * This macro takes an address of the end of previous allocation, rounds it to a page boundary & + * changes the node number. + */ +#define PLAT_BOOTMEM_ALLOC_GOAL(cnode,kaddr) __pa(SN1_KADDR(PLAT_PXM_TO_PHYS_NODE_NUMBER(nid_to_pxm_map[cnode]), \ + (SN1_NODE_OFFSET(kaddr) + PAGE_SIZE - 1) >> PAGE_SHIFT << PAGE_SHIFT)) + + + + +/* + * Convert a proximity domain number (from the ACPI tables) into a physical node number. + */ + +#define PLAT_PXM_TO_PHYS_NODE_NUMBER(pxm) (pxm) + +#endif /* _ASM_IA64_SN_MMZONE_SN1_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/promlog.h lia64-2.4/include/asm-ia64/sn/sn1/promlog.h --- linux-2.4.18/include/asm-ia64/sn/sn1/promlog.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/promlog.h Wed Dec 31 16:00:00 1969 @@ -1,85 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ - -#ifndef _ASM_SN_SN1_PROMLOG_H -#define _ASM_SN_SN1_PROMLOG_H - -#include - -#define PROMLOG_MAGIC 0x504c4f49 -#define PROMLOG_VERSION 1 - -#define PROMLOG_OFFSET_MAGIC 0x10 -#define PROMLOG_OFFSET_VERSION 0x14 -#define PROMLOG_OFFSET_SEQUENCE 0x18 -#define PROMLOG_OFFSET_ENTRY0 0x100 - -#define PROMLOG_ERROR_NONE 0 -#define PROMLOG_ERROR_PROM -1 -#define PROMLOG_ERROR_MAGIC -2 -#define PROMLOG_ERROR_CORRUPT -3 -#define PROMLOG_ERROR_BOL -4 -#define PROMLOG_ERROR_EOL -5 -#define PROMLOG_ERROR_POS -6 -#define PROMLOG_ERROR_REPLACE -7 -#define PROMLOG_ERROR_COMPACT -8 -#define PROMLOG_ERROR_FULL -9 -#define PROMLOG_ERROR_ARG -10 -#define PROMLOG_ERROR_UNUSED -11 - -#define PROMLOG_TYPE_UNUSED 0xf -#define PROMLOG_TYPE_LOG 3 -#define PROMLOG_TYPE_LIST 2 -#define PROMLOG_TYPE_VAR 1 -#define PROMLOG_TYPE_DELETED 0 - -#define PROMLOG_TYPE_ANY 98 -#define PROMLOG_TYPE_INVALID 99 - -#define PROMLOG_KEY_MAX 14 -#define PROMLOG_VALUE_MAX 47 -#define PROMLOG_CPU_MAX 4 - -typedef struct promlog_header_s { - unsigned int unused[4]; - unsigned int magic; - unsigned int version; - unsigned int sequence; -} promlog_header_t; - -typedef unsigned int promlog_pos_t; - -typedef struct promlog_ent_s { /* PROM individual entry */ - uint type : 4; - uint cpu_num : 4; - char key[PROMLOG_KEY_MAX + 1]; - - char value[PROMLOG_VALUE_MAX + 1]; - -} promlog_ent_t; - -typedef struct promlog_s { /* Activation handle */ - fprom_t f; - int sector_base; - int cpu_num; - - int active; /* Active sector, 0 or 1 */ - - promlog_pos_t log_start; - promlog_pos_t log_end; - - promlog_pos_t alt_start; - promlog_pos_t alt_end; - - promlog_pos_t pos; - promlog_ent_t ent; -} promlog_t; - -#endif /* _ASM_SN_SN1_PROMLOG_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/router.h lia64-2.4/include/asm-ia64/sn/sn1/router.h --- linux-2.4.18/include/asm-ia64/sn/sn1/router.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/router.h Wed Dec 31 16:00:00 1969 @@ -1,670 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ - -#ifndef _ASM_SN_SN1_ROUTER_H -#define _ASM_SN_SN1_ROUTER_H - -/* - * Router Register definitions - * - * Macro argument _L always stands for a link number (1 to 8, inclusive). - */ - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -#include -#include -#include - -typedef uint64_t router_reg_t; - -#define MAX_ROUTERS 64 - -#define MAX_ROUTER_PATH 80 - -#define ROUTER_REG_CAST (volatile router_reg_t *) -#define PS_UINT_CAST (__psunsigned_t) -#define UINT64_CAST (uint64_t) -typedef signed char port_no_t; /* Type for router port number */ - -#elif _LANGUAGE_ASSEMBLY - -#define ROUTERREG_CAST -#define PS_UINT_CAST -#define UINT64_CAST - -#endif /* _LANGUAGE_C || _LANGUAGE_C_PLUS_PLUS */ - -#define MAX_ROUTER_PORTS (8) /* Max. number of ports on a router */ - -#define ALL_PORTS ((1 << MAX_ROUTER_PORTS) - 1) /* for 0 based references */ - -#define PORT_INVALID (-1) /* Invalid port number */ - -#define IS_META(_rp) ((_rp)->flags & PCFG_ROUTER_META) - -#define IS_REPEATER(_rp)((_rp)->flags & PCFG_ROUTER_REPEATER) - -/* - * RR_TURN makes a given number of clockwise turns (0 to 7) from an inport - * port to generate an output port. - * - * RR_DISTANCE returns the number of turns necessary (0 to 7) to go from - * an input port (_L1 = 1 to 8) to an output port ( _L2 = 1 to 8). - * - * These are written to work on unsigned data. - */ - -#define RR_TURN(_L, count) ((_L) + (count) > MAX_ROUTER_PORTS ? \ - (_L) + (count) - MAX_ROUTER_PORTS : \ - (_L) + (count)) - -#define RR_DISTANCE(_LS, _LD) ((_LD) >= (_LS) ? \ - (_LD) - (_LS) : \ - (_LD) + MAX_ROUTER_PORTS - (_LS)) - -/* Router register addresses */ - -#define RR_STATUS_REV_ID 0x00000 /* Status register and Revision ID */ -#define RR_PORT_RESET 0x00008 /* Multiple port reset */ -#define RR_PROT_CONF 0x00010 /* Inter-partition protection conf. */ -#define RR_GLOBAL_PORT_DEF 0x00018 /* Global Port definitions */ -#define RR_GLOBAL_PARMS0 0x00020 /* Parameters shared by all 8 ports */ -#define RR_GLOBAL_PARMS1 0x00028 /* Parameters shared by all 8 ports */ -#define RR_DIAG_PARMS 0x00030 /* Parameters for diag. testing */ -#define RR_DEBUG_ADDR 0x00038 /* Debug address select - debug port*/ -#define RR_LB_TO_L2 0x00040 /* Local Block to L2 cntrl intf reg */ -#define RR_L2_TO_LB 0x00048 /* L2 cntrl intf to Local Block reg */ -#define RR_JBUS_CONTROL 0x00050 /* read/write timing for JBUS intf */ - -#define RR_SCRATCH_REG0 0x00100 /* Scratch 0 is 64 bits */ -#define RR_SCRATCH_REG1 0x00108 /* Scratch 1 is 64 bits */ -#define RR_SCRATCH_REG2 0x00110 /* Scratch 2 is 64 bits */ -#define RR_SCRATCH_REG3 0x00118 /* Scratch 3 is 1 bit */ -#define RR_SCRATCH_REG4 0x00120 /* Scratch 4 is 1 bit */ - -#define RR_JBUS0(_D) (((_D) & 0x7) << 3 | 0x00200) /* JBUS0 addresses */ -#define RR_JBUS1(_D) (((_D) & 0x7) << 3 | 0x00240) /* JBUS1 addresses */ - -#define RR_SCRATCH_REG0_WZ 0x00500 /* Scratch 0 is 64 bits */ -#define RR_SCRATCH_REG1_WZ 0x00508 /* Scratch 1 is 64 bits */ -#define RR_SCRATCH_REG2_WZ 0x00510 /* Scratch 2 is 64 bits */ -#define RR_SCRATCH_REG3_SZ 0x00518 /* Scratch 3 is 1 bit */ -#define RR_SCRATCH_REG4_SZ 0x00520 /* Scratch 4 is 1 bit */ - -#define RR_VECTOR_HW_BAR(context) (0x08000 | (context)<<3) /* barrier config registers */ -/* Port-specific registers (_L is the link number from 1 to 8) */ - -#define RR_PORT_PARMS(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0000) /* LLP parameters */ -#define RR_STATUS_ERROR(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0008) /* Port-related errs */ -#define RR_CHANNEL_TEST(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0010) /* Port LLP chan test */ -#define RR_RESET_MASK(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0018) /* Remote reset mask */ -#define RR_HISTOGRAM0(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0020) /* Port usage histgrm */ -#define RR_HISTOGRAM1(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0028) /* Port usage histgrm */ -#define RR_HISTOGRAM0_WC(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0030) /* Port usage histgrm */ -#define RR_HISTOGRAM1_WC(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0038) /* Port usage histgrm */ -#define RR_ERROR_CLEAR(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0088) /* Read/clear errors */ -#define RR_GLOBAL_TABLE0(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0100) /* starting address of global table for this port */ -#define RR_GLOBAL_TABLE(_L, _x) (RR_GLOBAL_TABLE0(_L) + ((_x) << 3)) -#define RR_LOCAL_TABLE0(_L) (((_L+1) & 0xe) << 15 | ((_L+1) & 0x1) << 11 | 0x0200) /* starting address of local table for this port */ -#define RR_LOCAL_TABLE(_L, _x) (RR_LOCAL_TABLE0(_L) + ((_x) << 3)) - -#define RR_META_ENTRIES 16 - -#define RR_LOCAL_ENTRIES 128 - -/* - * RR_STATUS_REV_ID mask and shift definitions - */ - -#define RSRI_INPORT_SHFT 52 -#define RSRI_INPORT_MASK (UINT64_CAST 0xf << 52) -#define RSRI_LINKWORKING_BIT(_L) (35 + 2 * (_L)) -#define RSRI_LINKWORKING(_L) (UINT64_CAST 1 << (35 + 2 * (_L))) -#define RSRI_LINKRESETFAIL(_L) (UINT64_CAST 1 << (34 + 2 * (_L))) -#define RSRI_LSTAT_SHFT(_L) (34 + 2 * (_L)) -#define RSRI_LSTAT_MASK(_L) (UINT64_CAST 0x3 << 34 + 2 * (_L)) -#define RSRI_LOCALSBERROR (UINT64_CAST 1 << 35) -#define RSRI_LOCALSTUCK (UINT64_CAST 1 << 34) -#define RSRI_LOCALBADVEC (UINT64_CAST 1 << 33) -#define RSRI_LOCALTAILERR (UINT64_CAST 1 << 32) -#define RSRI_LOCAL_SHFT 32 -#define RSRI_LOCAL_MASK (UINT64_CAST 0xf << 32) -#define RSRI_CHIPREV_SHFT 28 -#define RSRI_CHIPREV_MASK (UINT64_CAST 0xf << 28) -#define RSRI_CHIPID_SHFT 12 -#define RSRI_CHIPID_MASK (UINT64_CAST 0xffff << 12) -#define RSRI_MFGID_SHFT 1 -#define RSRI_MFGID_MASK (UINT64_CAST 0x7ff << 1) - -#define RSRI_LSTAT_WENTDOWN 0 -#define RSRI_LSTAT_RESETFAIL 1 -#define RSRI_LSTAT_LINKUP 2 -#define RSRI_LSTAT_NOTUSED 3 - -/* - * RR_PORT_RESET mask definitions - */ - -#define RPRESET_WARM (UINT64_CAST 1 << 9) -#define RPRESET_LINK(_L) (UINT64_CAST 1 << (_L)) -#define RPRESET_LOCAL (UINT64_CAST 1) - -/* - * RR_PROT_CONF mask and shift definitions - */ - -#define RPCONF_DIRCMPDIS_SHFT 13 -#define RPCONF_DIRCMPDIS_MASK (UINT64_CAST 1 << 13) -#define RPCONF_FORCELOCAL (UINT64_CAST 1 << 12) -#define RPCONF_FLOCAL_SHFT 12 -#define RPCONF_METAID_SHFT 8 -#define RPCONF_METAID_MASK (UINT64_CAST 0xf << 8) -#define RPCONF_RESETOK(_L) (UINT64_CAST 1 << ((_L) - 1)) - -/* - * RR_GLOBAL_PORT_DEF mask and shift definitions - */ - -#define RGPD_MGLBLNHBR_ID_SHFT 12 /* -global neighbor ID */ -#define RGPD_MGLBLNHBR_ID_MASK (UINT64_CAST 0xf << 12) -#define RGPD_MGLBLNHBR_VLD_SHFT 11 /* -global neighbor Valid */ -#define RGPD_MGLBLNHBR_VLD_MASK (UINT64_CAST 0x1 << 11) -#define RGPD_MGLBLPORT_SHFT 8 /* -global neighbor Port */ -#define RGPD_MGLBLPORT_MASK (UINT64_CAST 0x7 << 8) -#define RGPD_PGLBLNHBR_ID_SHFT 4 /* +global neighbor ID */ -#define RGPD_PGLBLNHBR_ID_MASK (UINT64_CAST 0xf << 4) -#define RGPD_PGLBLNHBR_VLD_SHFT 3 /* +global neighbor Valid */ -#define RGPD_PGLBLNHBR_VLD_MASK (UINT64_CAST 0x1 << 3) -#define RGPD_PGLBLPORT_SHFT 0 /* +global neighbor Port */ -#define RGPD_PGLBLPORT_MASK (UINT64_CAST 0x7 << 0) - -#define GLBL_PARMS_REGS 2 /* Two Global Parms registers */ - -/* - * RR_GLOBAL_PARMS0 mask and shift definitions - */ - -#define RGPARM0_ARB_VALUE_SHFT 54 /* Local Block Arbitration State */ -#define RGPARM0_ARB_VALUE_MASK (UINT64_CAST 0x7 << 54) -#define RGPARM0_ROTATEARB_SHFT 53 /* Rotate Local Block Arbitration */ -#define RGPARM0_ROTATEARB_MASK (UINT64_CAST 0x1 << 53) -#define RGPARM0_FAIREN_SHFT 52 /* Fairness logic Enable */ -#define RGPARM0_FAIREN_MASK (UINT64_CAST 0x1 << 52) -#define RGPARM0_LOCGNTTO_SHFT 40 /* Local grant timeout */ -#define RGPARM0_LOCGNTTO_MASK (UINT64_CAST 0xfff << 40) -#define RGPARM0_DATELINE_SHFT 38 /* Dateline crossing router */ -#define RGPARM0_DATELINE_MASK (UINT64_CAST 0x1 << 38) -#define RGPARM0_MAXRETRY_SHFT 28 /* Max retry count */ -#define RGPARM0_MAXRETRY_MASK (UINT64_CAST 0x3ff << 28) -#define RGPARM0_URGWRAP_SHFT 20 /* Urgent wrap */ -#define RGPARM0_URGWRAP_MASK (UINT64_CAST 0xff << 20) -#define RGPARM0_DEADLKTO_SHFT 16 /* Deadlock timeout */ -#define RGPARM0_DEADLKTO_MASK (UINT64_CAST 0xf << 16) -#define RGPARM0_URGVAL_SHFT 12 /* Urgent value */ -#define RGPARM0_URGVAL_MASK (UINT64_CAST 0xf << 12) -#define RGPARM0_VCHSELEN_SHFT 11 /* VCH_SEL_EN */ -#define RGPARM0_VCHSELEN_MASK (UINT64_CAST 0x1 << 11) -#define RGPARM0_LOCURGTO_SHFT 9 /* Local urgent timeout */ -#define RGPARM0_LOCURGTO_MASK (UINT64_CAST 0x3 << 9) -#define RGPARM0_TAILVAL_SHFT 5 /* Tail value */ -#define RGPARM0_TAILVAL_MASK (UINT64_CAST 0xf << 5) -#define RGPARM0_CLOCK_SHFT 1 /* Global clock select */ -#define RGPARM0_CLOCK_MASK (UINT64_CAST 0xf << 1) -#define RGPARM0_BYPEN_SHFT 0 -#define RGPARM0_BYPEN_MASK (UINT64_CAST 1) /* Bypass enable */ - -/* - * RR_GLOBAL_PARMS1 shift and mask definitions - */ - -#define RGPARM1_TTOWRAP_SHFT 12 /* Tail timeout wrap */ -#define RGPARM1_TTOWRAP_MASK (UINT64_CAST 0xfffff << 12) -#define RGPARM1_AGERATE_SHFT 8 /* Age rate */ -#define RGPARM1_AGERATE_MASK (UINT64_CAST 0xf << 8) -#define RGPARM1_JSWSTAT_SHFT 0 /* JTAG Sw Register bits */ -#define RGPARM1_JSWSTAT_MASK (UINT64_CAST 0xff << 0) - -/* - * RR_DIAG_PARMS mask and shift definitions - */ - -#define RDPARM_ABSHISTOGRAM (UINT64_CAST 1 << 17) /* Absolute histgrm */ -#define RDPARM_DEADLOCKRESET (UINT64_CAST 1 << 16) /* Reset on deadlck */ -#define RDPARM_DISABLE(_L) (UINT64_CAST 1 << ((_L) + 7)) -#define RDPARM_SENDERROR(_L) (UINT64_CAST 1 << ((_L) - 1)) - -/* - * RR_DEBUG_ADDR mask and shift definitions - */ - -#define RDA_DATA_SHFT 10 /* Observed debug data */ -#define RDA_DATA_MASK (UINT64_CAST 0xffff << 10) -#define RDA_ADDR_SHFT 0 /* debug address for data */ -#define RDA_ADDR_MASK (UINT64_CAST 0x3ff << 0) - -/* - * RR_LB_TO_L2 mask and shift definitions - */ - -#define RLBTOL2_DATA_VLD_SHFT 32 /* data is valid for JTAG controller */ -#define RLBTOL2_DATA_VLD_MASK (UINT64_CAST 0x1 << 32) -#define RLBTOL2_DATA_SHFT 0 /* data bits for JTAG controller */ -#define RLBTOL2_DATA_MASK (UINT64_CAST 0xffffffff) - -/* - * RR_L2_TO_LB mask and shift definitions - */ - -#define RL2TOLB_DATA_VLD_SHFT 33 /* data is valid from JTAG controller */ -#define RL2TOLB_DATA_VLD_MASK (UINT64_CAST 0x1 << 33) -#define RL2TOLB_PARITY_SHFT 32 /* sw implemented parity for data */ -#define RL2TOLB_PARITY_MASK (UINT64_CAST 0x1 << 32) -#define RL2TOLB_DATA_SHFT 0 /* data bits from JTAG controller */ -#define RL2TOLB_DATA_MASK (UINT64_CAST 0xffffffff) - -/* - * RR_JBUS_CONTROL mask and shift definitions - */ - -#define RJC_POS_BITS_SHFT 20 /* Router position bits */ -#define RJC_POS_BITS_MASK (UINT64_CAST 0xf << 20) -#define RJC_RD_DATA_STROBE_SHFT 16 /* count when read data is strobed in */ -#define RJC_RD_DATA_STROBE_MASK (UINT64_CAST 0xf << 16) -#define RJC_WE_OE_HOLD_SHFT 8 /* time OE or WE is held */ -#define RJC_WE_OE_HOLD_MASK (UINT64_CAST 0xff << 8) -#define RJC_ADDR_SET_HLD_SHFT 0 /* time address driven around OE/WE */ -#define RJC_ADDR_SET_HLD_MASK (UINT64_CAST 0xff) - -/* - * RR_SCRATCH_REGx mask and shift definitions - * note: these fields represent a software convention, and are not - * understood/interpreted by the hardware. - */ - -#define RSCR0_BOOTED_SHFT 63 -#define RSCR0_BOOTED_MASK (UINT64_CAST 0x1 << RSCR0_BOOTED_SHFT) -#define RSCR0_LOCALID_SHFT 56 -#define RSCR0_LOCALID_MASK (UINT64_CAST 0x7f << RSCR0_LOCALID_SHFT) -#define RSCR0_UNUSED_SHFT 48 -#define RSCR0_UNUSED_MASK (UINT64_CAST 0xff << RSCR0_UNUSED_SHFT) -#define RSCR0_NIC_SHFT 0 -#define RSCR0_NIC_MASK (UINT64_CAST 0xffffffffffff) - -#define RSCR1_MODID_SHFT 0 -#define RSCR1_MODID_MASK (UINT64_CAST 0xffff) - -/* - * RR_VECTOR_HW_BAR mask and shift definitions - */ - -#define BAR_TX_SHFT 27 /* Barrier in trans(m)it when read */ -#define BAR_TX_MASK (UINT64_CAST 1 << BAR_TX_SHFT) -#define BAR_VLD_SHFT 26 /* Valid Configuration */ -#define BAR_VLD_MASK (UINT64_CAST 1 << BAR_VLD_SHFT) -#define BAR_SEQ_SHFT 24 /* Sequence number */ -#define BAR_SEQ_MASK (UINT64_CAST 3 << BAR_SEQ_SHFT) -#define BAR_LEAFSTATE_SHFT 18 /* Leaf State */ -#define BAR_LEAFSTATE_MASK (UINT64_CAST 0x3f << BAR_LEAFSTATE_SHFT) -#define BAR_PARENT_SHFT 14 /* Parent Port */ -#define BAR_PARENT_MASK (UINT64_CAST 0xf << BAR_PARENT_SHFT) -#define BAR_CHILDREN_SHFT 6 /* Child Select port bits */ -#define BAR_CHILDREN_MASK (UINT64_CAST 0xff << BAR_CHILDREN_SHFT) -#define BAR_LEAFCOUNT_SHFT 0 /* Leaf Count to trigger parent */ -#define BAR_LEAFCOUNT_MASK (UINT64_CAST 0x3f) - -/* - * RR_PORT_PARMS(_L) mask and shift definitions - */ - -#define RPPARM_MIPRESETEN_SHFT 29 /* Message In Progress reset enable */ -#define RPPARM_MIPRESETEN_MASK (UINT64_CAST 0x1 << 29) -#define RPPARM_UBAREN_SHFT 28 /* Enable user barrier requests */ -#define RPPARM_UBAREN_MASK (UINT64_CAST 0x1 << 28) -#define RPPARM_OUTPDTO_SHFT 24 /* Output Port Deadlock TO value */ -#define RPPARM_OUTPDTO_MASK (UINT64_CAST 0xf << 24) -#define RPPARM_PORTMATE_SHFT 21 /* Port Mate for the port */ -#define RPPARM_PORTMATE_MASK (UINT64_CAST 0x7 << 21) -#define RPPARM_HISTEN_SHFT 20 /* Histogram counter enable */ -#define RPPARM_HISTEN_MASK (UINT64_CAST 0x1 << 20) -#define RPPARM_HISTSEL_SHFT 18 -#define RPPARM_HISTSEL_MASK (UINT64_CAST 0x3 << 18) -#define RPPARM_DAMQHS_SHFT 16 -#define RPPARM_DAMQHS_MASK (UINT64_CAST 0x3 << 16) -#define RPPARM_NULLTO_SHFT 10 -#define RPPARM_NULLTO_MASK (UINT64_CAST 0x3f << 10) -#define RPPARM_MAXBURST_SHFT 0 -#define RPPARM_MAXBURST_MASK (UINT64_CAST 0x3ff) - -/* - * NOTE: Normally the kernel tracks only UTILIZATION statistics. - * The other 2 should not be used, except during any experimentation - * with the router. - */ -#define RPPARM_HISTSEL_AGE 0 /* Histogram age characterization. */ -#define RPPARM_HISTSEL_UTIL 1 /* Histogram link utilization */ -#define RPPARM_HISTSEL_DAMQ 2 /* Histogram DAMQ characterization. */ - -/* - * RR_STATUS_ERROR(_L) and RR_ERROR_CLEAR(_L) mask and shift definitions - */ -#define RSERR_POWERNOK (UINT64_CAST 1 << 38) -#define RSERR_PORT_DEADLOCK (UINT64_CAST 1 << 37) -#define RSERR_WARMRESET (UINT64_CAST 1 << 36) -#define RSERR_LINKRESET (UINT64_CAST 1 << 35) -#define RSERR_RETRYTIMEOUT (UINT64_CAST 1 << 34) -#define RSERR_FIFOOVERFLOW (UINT64_CAST 1 << 33) -#define RSERR_ILLEGALPORT (UINT64_CAST 1 << 32) -#define RSERR_DEADLOCKTO_SHFT 28 -#define RSERR_DEADLOCKTO_MASK (UINT64_CAST 0xf << 28) -#define RSERR_RECVTAILTO_SHFT 24 -#define RSERR_RECVTAILTO_MASK (UINT64_CAST 0xf << 24) -#define RSERR_RETRYCNT_SHFT 16 -#define RSERR_RETRYCNT_MASK (UINT64_CAST 0xff << 16) -#define RSERR_CBERRCNT_SHFT 8 -#define RSERR_CBERRCNT_MASK (UINT64_CAST 0xff << 8) -#define RSERR_SNERRCNT_SHFT 0 -#define RSERR_SNERRCNT_MASK (UINT64_CAST 0xff << 0) - - -#define PORT_STATUS_UP (1 << 0) /* Router link up */ -#define PORT_STATUS_FENCE (1 << 1) /* Router link fenced */ -#define PORT_STATUS_RESETFAIL (1 << 2) /* Router link didnot - * come out of reset */ -#define PORT_STATUS_DISCFAIL (1 << 3) /* Router link failed after - * out of reset but before - * router tables were - * programmed - */ -#define PORT_STATUS_KERNFAIL (1 << 4) /* Router link failed - * after reset and the - * router tables were - * programmed - */ -#define PORT_STATUS_UNDEF (1 << 5) /* Unable to pinpoint - * why the router link - * went down - */ -#define PROBE_RESULT_BAD (-1) /* Set if any of the router - * links failed after reset - */ -#define PROBE_RESULT_GOOD (0) /* Set if all the router links - * which came out of reset - * are up - */ - -/* Should be enough for 256 CPUs */ -#define MAX_RTR_BREADTH 64 /* Max # of routers possible */ - -/* Get the require set of bits in a var. corr to a sequence of bits */ -#define GET_FIELD(var, fname) \ - ((var) >> fname##_SHFT & fname##_MASK >> fname##_SHFT) -/* Set the require set of bits in a var. corr to a sequence of bits */ -#define SET_FIELD(var, fname, fval) \ - ((var) = (var) & ~fname##_MASK | (uint64_t) (fval) << fname##_SHFT) - - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -typedef struct router_map_ent_s { - uint64_t nic; - moduleid_t module; - slotid_t slot; -} router_map_ent_t; - -struct rr_status_error_fmt { - uint64_t rserr_unused : 30, - rserr_fifooverflow : 1, - rserr_illegalport : 1, - rserr_deadlockto : 4, - rserr_recvtailto : 4, - rserr_retrycnt : 8, - rserr_cberrcnt : 8, - rserr_snerrcnt : 8; -}; - -/* - * This type is used to store "absolute" counts of router events - */ -typedef int router_count_t; - -/* All utilizations are on a scale from 0 - 1023. */ -#define RP_BYPASS_UTIL 0 -#define RP_RCV_UTIL 1 -#define RP_SEND_UTIL 2 -#define RP_TOTAL_PKTS 3 /* Free running clock/packet counter */ - -#define RP_NUM_UTILS 3 - -#define RP_HIST_REGS 2 -#define RP_NUM_BUCKETS 4 -#define RP_HIST_TYPES 3 - -#define RP_AGE0 0 -#define RP_AGE1 1 -#define RP_AGE2 2 -#define RP_AGE3 3 - - -#define RR_UTIL_SCALE 1024 - -/* - * Router port-oriented information - */ -typedef struct router_port_info_s { - router_reg_t rp_histograms[RP_HIST_REGS];/* Port usage info */ - router_reg_t rp_port_error; /* Port error info */ - router_count_t rp_retry_errors; /* Total retry errors */ - router_count_t rp_sn_errors; /* Total sn errors */ - router_count_t rp_cb_errors; /* Total cb errors */ - int rp_overflows; /* Total count overflows */ - int rp_excess_err; /* Port has excessive errors */ - ushort rp_util[RP_NUM_BUCKETS];/* Port utilization */ -} router_port_info_t; - -#define ROUTER_INFO_VERSION 7 - -struct lboard_s; - -/* - * Router information - */ -typedef struct router_info_s { - char ri_version; /* structure version */ - cnodeid_t ri_cnode; /* cnode of its legal guardian hub */ - nasid_t ri_nasid; /* Nasid of same */ - char ri_ledcache; /* Last LED bitmap */ - char ri_leds; /* Current LED bitmap */ - char ri_portmask; /* Active port bitmap */ - router_reg_t ri_stat_rev_id; /* Status rev ID value */ - net_vec_t ri_vector; /* vector from guardian to router */ - int ri_writeid; /* router's vector write ID */ - int64_t ri_timebase; /* Time of first sample */ - int64_t ri_timestamp; /* Time of last sample */ - router_port_info_t ri_port[MAX_ROUTER_PORTS]; /* per port info */ - moduleid_t ri_module; /* Which module are we in? */ - slotid_t ri_slotnum; /* Which slot are we in? */ - router_reg_t ri_glbl_parms[GLBL_PARMS_REGS]; - /* Global parms0&1 register contents*/ - devfs_handle_t ri_vertex; /* hardware graph vertex */ - router_reg_t ri_prot_conf; /* protection config. register */ - int64_t ri_per_minute; /* Ticks per minute */ - - /* - * Everything below here is for kernel use only and may change at - * at any time with or without a change in teh revision number - * - * Any pointers or things that come and go with DEBUG must go at - * the bottom of the structure, below the user stuff. - */ - char ri_hist_type; /* histogram type */ - devfs_handle_t ri_guardian; /* guardian node for the router */ - int64_t ri_last_print; /* When did we last print */ - char ri_print; /* Should we print */ - char ri_just_blink; /* Should we blink the LEDs */ - -#ifdef DEBUG - int64_t ri_deltatime; /* Time it took to sample */ -#endif - spinlock_t ri_lock; /* Lock for access to router info */ - net_vec_t *ri_vecarray; /* Pointer to array of vectors */ - struct lboard_s *ri_brd; /* Pointer to board structure */ - char * ri_name; /* This board's hwg path */ - unsigned char ri_port_maint[MAX_ROUTER_PORTS]; /* should we send a - message to availmon */ -} router_info_t; - - -/* Router info location specifiers */ - -#define RIP_PROMLOG 2 /* Router info in promlog */ -#define RIP_CONSOLE 4 /* Router info on console */ - -#define ROUTER_INFO_PRINT(_rip,_where) (_rip->ri_print |= _where) - /* Set the field used to check if a - * router info can be printed - */ -#define IS_ROUTER_INFO_PRINTED(_rip,_where) \ - (_rip->ri_print & _where) - /* Was the router info printed to - * the given location (_where) ? - * Mainly used to prevent duplicate - * router error states. - */ -#define ROUTER_INFO_LOCK(_rip,_s) _s = mutex_spinlock(&(_rip->ri_lock)) - /* Take the lock on router info - * to gain exclusive access - */ -#define ROUTER_INFO_UNLOCK(_rip,_s) mutex_spinunlock(&(_rip->ri_lock),_s) - /* Release the lock on router info */ -/* - * Router info hanging in the nodepda - */ -typedef struct nodepda_router_info_s { - devfs_handle_t router_vhdl; /* vertex handle of the router */ - short router_port; /* port thru which we entered */ - short router_portmask; - moduleid_t router_module; /* module in which router is there */ - slotid_t router_slot; /* router slot */ - unsigned char router_type; /* kind of router */ - net_vec_t router_vector; /* vector from the guardian node */ - - router_info_t *router_infop; /* info hanging off the hwg vertex */ - struct nodepda_router_info_s *router_next; - /* pointer to next element */ -} nodepda_router_info_t; - -#define ROUTER_NAME_SIZE 20 /* Max size of a router name */ - -#define NORMAL_ROUTER_NAME "normal_router" -#define NULL_ROUTER_NAME "null_router" -#define META_ROUTER_NAME "meta_router" -#define REPEATER_ROUTER_NAME "repeater_router" -#define UNKNOWN_ROUTER_NAME "unknown_router" - -/* The following definitions are needed by the router traversing - * code either using the hardware graph or using vector operations. - */ -/* Structure of the router queue element */ -typedef struct router_elt_s { - union { - /* queue element structure during router probing */ - struct { - /* number-in-a-can (unique) for the router */ - nic_t nic; - /* vector route from the master hub to - * this router. - */ - net_vec_t vec; - /* port status */ - uint64_t status; - char port_status[MAX_ROUTER_PORTS + 1]; - } r_elt; - /* queue element structure during router guardian - * assignment - */ - struct { - /* vertex handle for the router */ - devfs_handle_t vhdl; - /* guardian for this router */ - devfs_handle_t guard; - /* vector router from the guardian to the router */ - net_vec_t vec; - } k_elt; - } u; - /* easy to use port status interpretation */ -} router_elt_t; - -/* structure of the router queue */ - -typedef struct router_queue_s { - char head; /* Point where a queue element is inserted */ - char tail; /* Point where a queue element is removed */ - int type; - router_elt_t array[MAX_RTR_BREADTH]; - /* Entries for queue elements */ -} router_queue_t; - - -#endif /* _LANGUAGE_C || _LANGUAGE_C_PLUS_PLUS */ - -/* - * RR_HISTOGRAM(_L) mask and shift definitions - * There are two 64 bit histogram registers, so the following macros take - * into account dealing with an array of 4 32 bit values indexed by _x - */ - -#define RHIST_BUCKET_SHFT(_x) (32 * ((_x) & 0x1)) -#define RHIST_BUCKET_MASK(_x) (UINT64_CAST 0xffffffff << RHIST_BUCKET_SHFT((_x) & 0x1)) -#define RHIST_GET_BUCKET(_x, _reg) \ - ((RHIST_BUCKET_MASK(_x) & ((_reg)[(_x) >> 1])) >> RHIST_BUCKET_SHFT(_x)) - -/* - * RR_RESET_MASK(_L) mask and shift definitions - */ - -#define RRM_RESETOK(_L) (UINT64_CAST 1 << ((_L) - 1)) -#define RRM_RESETOK_ALL ALL_PORTS - -/* - * RR_META_TABLE(_x) and RR_LOCAL_TABLE(_x) mask and shift definitions - */ - -#define RTABLE_SHFT(_L) (4 * ((_L) - 1)) -#define RTABLE_MASK(_L) (UINT64_CAST 0x7 << RTABLE_SHFT(_L)) - - -#define ROUTERINFO_STKSZ 4096 - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) -#if defined(_LANGUAGE_C_PLUS_PLUS) -extern "C" { -#endif - -int router_reg_read(router_info_t *rip, int regno, router_reg_t *val); -int router_reg_write(router_info_t *rip, int regno, router_reg_t val); -int router_get_info(devfs_handle_t routerv, router_info_t *, int); -int router_init(cnodeid_t cnode,int writeid, nodepda_router_info_t *npda_rip); -int router_set_leds(router_info_t *rip); -void router_print_state(router_info_t *rip, int level, - void (*pf)(int, char *, ...),int print_where); -void capture_router_stats(router_info_t *rip); - - -int probe_routers(void); -void get_routername(unsigned char brd_type,char *rtrname); -void router_guardians_set(devfs_handle_t hwgraph_root); -int router_hist_reselect(router_info_t *, int64_t); -#if defined(_LANGUAGE_C_PLUS_PLUS) -} -#endif -#endif /* _LANGUAGE_C || _LANGUAGE_C_PLUS_PLUS */ - -#endif /* _ASM_SN_SN1_ROUTER_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/slotnum.h lia64-2.4/include/asm-ia64/sn/sn1/slotnum.h --- linux-2.4.18/include/asm-ia64/sn/sn1/slotnum.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/slotnum.h Mon Nov 19 23:22:56 2001 @@ -4,12 +4,11 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SN1_SLOTNUM_H -#define _ASM_SN_SN1_SLOTNUM_H +#ifndef _ASM_IA64_SN_SN1_SLOTNUM_H +#define _ASM_IA64_SN_SN1_SLOTNUM_H #define SLOTNUM_MAXLENGTH 16 @@ -85,4 +84,4 @@ #endif /* __KERNEL__ */ -#endif /* _ASM_SN_SN1_SLOTNUM_H */ +#endif /* _ASM_IA64_SN_SN1_SLOTNUM_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/sn1.h lia64-2.4/include/asm-ia64/sn/sn1/sn1.h --- linux-2.4.18/include/asm-ia64/sn/sn1/sn1.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/sn1.h Wed Dec 31 16:00:00 1969 @@ -1,34 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ - -/* - * sn1.h -- hardware specific defines for sn1 boards - * The defines used here are used to limit the size of - * various datastructures in the PROM. eg. KLCFGINFO, MPCONF etc. - */ - -#ifndef _ASM_SN_SN1_SN1_H -#define _ASM_SN_SN1_SN1_H - -extern xwidgetnum_t hub_widget_id(nasid_t); -extern nasid_t get_nasid(void); -extern int get_slice(void); -extern int is_fine_dirmode(void); -extern hubreg_t get_hub_chiprev(nasid_t nasid); -extern hubreg_t get_region(cnodeid_t); -extern hubreg_t nasid_to_region(nasid_t); -extern int verify_snchip_rev(void); -extern void ni_reset_port(void); - -#ifdef SN1_USE_POISON_BITS -extern int hub_bte_poison_ok(void); -#endif /* SN1_USE_POISON_BITS */ - -#endif /* _ASM_SN_SN1_SN1_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/sn_private.h lia64-2.4/include/asm-ia64/sn/sn1/sn_private.h --- linux-2.4.18/include/asm-ia64/sn/sn1/sn_private.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn1/sn_private.h Mon Nov 19 23:22:57 2001 @@ -0,0 +1,292 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. + */ +#ifndef _ASM_IA64_SN_SN1_SN_PRIVATE_H +#define _ASM_IA64_SN_SN1_SN_PRIVATE_H + +#include +#include +#include + +extern nasid_t master_nasid; + +/* promif.c */ +#ifdef LATER +extern cpuid_t cpu_node_probe(cpumask_t *cpumask, int *numnodes); +#endif +extern void he_arcs_set_vectors(void); +extern void mem_init(void); +#ifdef LATER +extern int cpu_enabled(cpuid_t); +#endif +extern void cpu_unenable(cpuid_t); +extern nasid_t get_lowest_nasid(void); +extern __psunsigned_t get_master_bridge_base(void); +extern void set_master_bridge_base(void); +extern int check_nasid_equiv(nasid_t, nasid_t); +extern nasid_t get_console_nasid(void); +extern char get_console_pcislot(void); +#ifdef LATER +extern void intr_init_vecblk(nodepda_t *npda, cnodeid_t, int); +#endif + +extern int is_master_nasid_widget(nasid_t test_nasid, xwidgetnum_t test_wid); + +/* memsupport.c */ +extern void poison_state_alter_range(__psunsigned_t start, int len, int poison); +extern int memory_present(paddr_t); +extern int memory_read_accessible(paddr_t); +extern int memory_write_accessible(paddr_t); +extern void memory_set_access(paddr_t, int, int); +extern void show_dir_state(paddr_t, void (*)(char *, ...)); +extern void check_dir_state(nasid_t, int, void (*)(char *, ...)); +extern void set_dir_owner(paddr_t, int); +extern void set_dir_state(paddr_t, int); +extern void set_dir_state_POISONED(paddr_t); +extern void set_dir_state_UNOWNED(paddr_t); +extern int is_POISONED_dir_state(paddr_t); +extern int is_UNOWNED_dir_state(paddr_t); +extern void get_dir_ent(paddr_t paddr, int *state, + uint64_t *vec_ptr, hubreg_t *elo); + +/* intr.c */ +extern int intr_reserve_level(cpuid_t cpu, int level, int err, devfs_handle_t owner_dev, char *name); +extern void intr_unreserve_level(cpuid_t cpu, int level); +extern int intr_connect_level(cpuid_t cpu, int bit, ilvl_t mask_no, + intr_func_t intr_prefunc); +extern int intr_disconnect_level(cpuid_t cpu, int bit); +extern cpuid_t intr_heuristic(devfs_handle_t dev, device_desc_t dev_desc, + int req_bit,int intr_resflags,devfs_handle_t owner_dev, + char *intr_name,int *resp_bit); +extern void intr_block_bit(cpuid_t cpu, int bit); +extern void intr_unblock_bit(cpuid_t cpu, int bit); +extern void setrtvector(intr_func_t); +extern void install_cpuintr(cpuid_t cpu); +extern void install_dbgintr(cpuid_t cpu); +extern void install_tlbintr(cpuid_t cpu); +extern void hub_migrintr_init(cnodeid_t /*cnode*/); +extern int cause_intr_connect(int level, intr_func_t handler, uint intr_spl_mask); +extern int cause_intr_disconnect(int level); +extern void intr_reserve_hardwired(cnodeid_t); +extern void intr_clear_all(nasid_t); +extern void intr_dumpvec(cnodeid_t cnode, void (*pf)(char *, ...)); + +/* error_dump.c */ +extern char *hub_rrb_err_type[]; +extern char *hub_wrb_err_type[]; + +void nmi_dump(void); +void install_cpu_nmi_handler(int slice); + +/* klclock.c */ +extern void hub_rtc_init(cnodeid_t); + +/* bte.c */ +void bte_lateinit(void); +void bte_wait_for_xfer_completion(void *); + +/* klgraph.c */ +void klhwg_add_all_nodes(devfs_handle_t); +void klhwg_add_all_modules(devfs_handle_t); + +/* klidbg.c */ +void install_klidbg_functions(void); + +/* klnuma.c */ +extern void replicate_kernel_text(int numnodes); +extern __psunsigned_t get_freemem_start(cnodeid_t cnode); +extern void setup_replication_mask(int maxnodes); + +/* init.c */ +extern cnodeid_t get_compact_nodeid(void); /* get compact node id */ +extern void init_platform_nodepda(nodepda_t *npda, cnodeid_t node); +extern void init_platform_pda(cpuid_t cpu); +extern void per_cpu_init(void); +#ifdef LATER +extern cpumask_t boot_cpumask; +#endif +extern int is_fine_dirmode(void); +extern void update_node_information(cnodeid_t); + +#ifdef LATER +/* clksupport.c */ +extern void early_counter_intr(eframe_t *); +#endif + +/* hubio.c */ +extern void hubio_init(void); +extern void hub_merge_clean(nasid_t nasid); +extern void hub_set_piomode(nasid_t nasid, int conveyor); + +/* huberror.c */ +extern void hub_error_init(cnodeid_t); +extern void dump_error_spool(cpuid_t cpu, void (*pf)(char *, ...)); +extern void hubni_error_handler(char *, int); +extern int check_ni_errors(void); + +/* Used for debugger to signal upper software a breakpoint has taken place */ + +extern void *debugger_update; +extern __psunsigned_t debugger_stopped; + +/* + * IP27 piomap, created by hub_pio_alloc. + * xtalk_info MUST BE FIRST, since this structure is cast to a + * xtalk_piomap_s by generic xtalk routines. + */ +struct hub_piomap_s { + struct xtalk_piomap_s hpio_xtalk_info;/* standard crosstalk pio info */ + devfs_handle_t hpio_hub; /* which hub's mapping registers are set up */ + short hpio_holdcnt; /* count of current users of bigwin mapping */ + char hpio_bigwin_num;/* if big window map, which one */ + int hpio_flags; /* defined below */ +}; +/* hub_piomap flags */ +#define HUB_PIOMAP_IS_VALID 0x1 +#define HUB_PIOMAP_IS_BIGWINDOW 0x2 +#define HUB_PIOMAP_IS_FIXED 0x4 + +#define hub_piomap_xt_piomap(hp) (&hp->hpio_xtalk_info) +#define hub_piomap_hub_v(hp) (hp->hpio_hub) +#define hub_piomap_winnum(hp) (hp->hpio_bigwin_num) + +#if TBD + /* Ensure that hpio_xtalk_info is first */ + #assert (&(((struct hub_piomap_s *)0)->hpio_xtalk_info) == 0) +#endif + + +/* + * IP27 dmamap, created by hub_pio_alloc. + * xtalk_info MUST BE FIRST, since this structure is cast to a + * xtalk_dmamap_s by generic xtalk routines. + */ +struct hub_dmamap_s { + struct xtalk_dmamap_s hdma_xtalk_info;/* standard crosstalk dma info */ + devfs_handle_t hdma_hub; /* which hub we go through */ + int hdma_flags; /* defined below */ +}; +/* hub_dmamap flags */ +#define HUB_DMAMAP_IS_VALID 0x1 +#define HUB_DMAMAP_USED 0x2 +#define HUB_DMAMAP_IS_FIXED 0x4 + +#if TBD + /* Ensure that hdma_xtalk_info is first */ + #assert (&(((struct hub_dmamap_s *)0)->hdma_xtalk_info) == 0) +#endif + +/* + * IP27 interrupt handle, created by hub_intr_alloc. + * xtalk_info MUST BE FIRST, since this structure is cast to a + * xtalk_intr_s by generic xtalk routines. + */ +struct hub_intr_s { + struct xtalk_intr_s i_xtalk_info; /* standard crosstalk intr info */ + ilvl_t i_swlevel; /* software level for blocking intr */ + cpuid_t i_cpuid; /* which cpu */ + int i_bit; /* which bit */ + int i_flags; +}; +/* flag values */ +#define HUB_INTR_IS_ALLOCED 0x1 /* for debug: allocated */ +#define HUB_INTR_IS_CONNECTED 0x4 /* for debug: connected to a software driver */ + +#if TBD + /* Ensure that i_xtalk_info is first */ + #assert (&(((struct hub_intr_s *)0)->i_xtalk_info) == 0) +#endif + + +/* IP27 hub-specific information stored under INFO_LBL_HUB_INFO */ +/* TBD: IP27-dependent stuff currently in nodepda.h should be here */ +typedef struct hubinfo_s { + nodepda_t *h_nodepda; /* pointer to node's private data area */ + cnodeid_t h_cnodeid; /* compact nodeid */ + nasid_t h_nasid; /* nasid */ + + /* structures for PIO management */ + xwidgetnum_t h_widgetid; /* my widget # (as viewed from xbow) */ + struct hub_piomap_s h_small_window_piomap[HUB_WIDGET_ID_MAX+1]; + sv_t h_bwwait; /* wait for big window to free */ + spinlock_t h_bwlock; /* guard big window piomap's */ + spinlock_t h_crblock; /* gaurd CRB error handling */ + int h_num_big_window_fixed; /* count number of FIXED maps */ + struct hub_piomap_s h_big_window_piomap[HUB_NUM_BIG_WINDOW]; + hub_intr_t hub_ii_errintr; +} *hubinfo_t; + +#define hubinfo_get(vhdl, infoptr) ((void)hwgraph_info_get_LBL \ + (vhdl, INFO_LBL_NODE_INFO, (arbitrary_info_t *)infoptr)) + +#define hubinfo_set(vhdl, infoptr) (void)hwgraph_info_add_LBL \ + (vhdl, INFO_LBL_NODE_INFO, (arbitrary_info_t)infoptr) + +#define hubinfo_to_hubv(hinfo, hub_v) (hinfo->h_nodepda->node_vertex) + +/* + * Hub info PIO map access functions. + */ +#define hubinfo_bwin_piomap_get(hinfo, win) \ + (&hinfo->h_big_window_piomap[win]) +#define hubinfo_swin_piomap_get(hinfo, win) \ + (&hinfo->h_small_window_piomap[win]) + +/* IP27 cpu-specific information stored under INFO_LBL_CPU_INFO */ +/* TBD: IP27-dependent stuff currently in pda.h should be here */ +typedef struct cpuinfo_s { +#ifdef LATER + pda_t *ci_cpupda; /* pointer to CPU's private data area */ +#endif + cpuid_t ci_cpuid; /* CPU ID */ +} *cpuinfo_t; + +#define cpuinfo_get(vhdl, infoptr) ((void)hwgraph_info_get_LBL \ + (vhdl, INFO_LBL_CPU_INFO, (arbitrary_info_t *)infoptr)) + +#define cpuinfo_set(vhdl, infoptr) (void)hwgraph_info_add_LBL \ + (vhdl, INFO_LBL_CPU_INFO, (arbitrary_info_t)infoptr) + +/* Special initialization function for xswitch vertices created during startup. */ +extern void xswitch_vertex_init(devfs_handle_t xswitch); + +extern xtalk_provider_t hub_provider; + +/* du.c */ +int ducons_write(char *buf, int len); + +/* memerror.c */ + +extern void install_eccintr(cpuid_t cpu); +extern void memerror_get_stats(cnodeid_t cnode, + int *bank_stats, int *bank_stats_max); +extern void probe_md_errors(nasid_t); +/* sysctlr.c */ +extern void sysctlr_init(void); +extern void sysctlr_power_off(int sdonly); +extern void sysctlr_keepalive(void); + +#define valid_cpuid(_x) (((_x) >= 0) && ((_x) < maxcpus)) + +/* Useful definitions to get the memory dimm given a physical + * address. + */ +#define paddr_dimm(_pa) ((_pa & MD_BANK_MASK) >> MD_BANK_SHFT) +#define paddr_cnode(_pa) (NASID_TO_COMPACT_NODEID(NASID_GET(_pa))) +extern void membank_pathname_get(paddr_t,char *); + +/* To redirect the output into the error buffer */ +#define errbuf_print(_s) printf("#%s",_s) + +extern void crbx(nasid_t nasid, void (*pf)(char *, ...)); +void bootstrap(void); + +/* sndrv.c */ +extern int sndrv_attach(devfs_handle_t vertex); + +#endif /* _ASM_IA64_SN_SN1_SN_PRIVATE_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/synergy.h lia64-2.4/include/asm-ia64/sn/sn1/synergy.h --- linux-2.4.18/include/asm-ia64/sn/sn1/synergy.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn1/synergy.h Fri Jul 19 23:21:07 2002 @@ -0,0 +1,187 @@ +#ifndef _ASM_IA64_SN_SN1_SYNERGY_H +#define _ASM_IA64_SN_SN1_SYNERGY_H + +#include +#include +#include +#include + + +/* + * Definitions for the synergy asic driver + * + * These are for SGI platforms only. + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + + +#define SYNERGY_L4_BYTES (64UL*1024*1024) +#define SYNERGY_L4_WAYS 8 +#define SYNERGY_L4_BYTES_PER_WAY (SYNERGY_L4_BYTES/SYNERGY_L4_WAYS) +#define SYNERGY_BLOCK_SIZE 512UL + + +#define SSPEC_BASE (0xe0000000000UL) +#define LB_REG_BASE (SSPEC_BASE + 0x0) + +#define VEC_MASK3A_ADDR (0x2a0 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) +#define VEC_MASK3B_ADDR (0x2a8 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) +#define VEC_MASK3A (0x2a0) +#define VEC_MASK3B (0x2a8) + +#define VEC_MASK2A_ADDR (0x2b0 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) +#define VEC_MASK2B_ADDR (0x2b8 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) +#define VEC_MASK2A (0x2b0) +#define VEC_MASK2B (0x2b8) + +#define VEC_MASK1A_ADDR (0x2c0 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) +#define VEC_MASK1B_ADDR (0x2c8 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) +#define VEC_MASK1A (0x2c0) +#define VEC_MASK1B (0x2c8) + +#define VEC_MASK0A_ADDR (0x2d0 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) +#define VEC_MASK0B_ADDR (0x2d8 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) +#define VEC_MASK0A (0x2d0) +#define VEC_MASK0B (0x2d8) + +#define GBL_PERF_A_ADDR (0x330 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) +#define GBL_PERF_B_ADDR (0x338 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) + +#define WRITE_LOCAL_SYNERGY_REG(addr, value) __synergy_out(addr, value) + +#define HUB_L(_a) *(_a) +#define HUB_S(_a, _d) *(_a) = (_d) + +#define HSPEC_SYNERGY0_0 0x04000000 /* Synergy0 Registers */ +#define HSPEC_SYNERGY1_0 0x05000000 /* Synergy1 Registers */ +#define HS_SYNERGY_STRIDE (HSPEC_SYNERGY1_0 - HSPEC_SYNERGY0_0) +#define REMOTE_HSPEC(_n, _x) (HUBREG_CAST (RREG_BASE(_n) + (_x))) + +#define RREG_BASE(_n) (NODE_LREG_BASE(_n)) +#define NODE_LREG_BASE(_n) (NODE_HSPEC_BASE(_n) + 0x30000000) +#define NODE_HSPEC_BASE(_n) (HSPEC_BASE + NODE_OFFSET(_n)) +#ifndef HSPEC_BASE +#define HSPEC_BASE (SYN_UNCACHED_SPACE | HSPEC_BASE_SYN) +#endif +#define SYN_UNCACHED_SPACE 0xc000000000000000 +#define HSPEC_BASE_SYN 0x00000b0000000000 +#define NODE_OFFSET(_n) (UINT64_CAST (_n) << NODE_SIZE_BITS) +#define NODE_SIZE_BITS 33 + +#define SYN_TAG_DISABLE_WAY (SSPEC_BASE+0xae0) + + +#define RSYN_REG_OFFSET(fsb, reg) (((fsb) ? HSPEC_SYNERGY1_0 : HSPEC_SYNERGY0_0) | (reg)) + +#define REMOTE_SYNERGY_LOAD(nasid, fsb, reg) __remote_synergy_in(nasid, fsb, reg) +#define REMOTE_SYNERGY_STORE(nasid, fsb, reg, val) __remote_synergy_out(nasid, fsb, reg, val) + +static inline uint64_t +__remote_synergy_in(int nasid, int fsb, uint64_t reg) { + volatile uint64_t *addr; + + addr = (uint64_t *)(RREG_BASE(nasid) + RSYN_REG_OFFSET(fsb, reg)); + return (*addr); +} + +static inline void +__remote_synergy_out(int nasid, int fsb, uint64_t reg, uint64_t value) { + volatile uint64_t *addr; + + addr = (uint64_t *)(RREG_BASE(nasid) + RSYN_REG_OFFSET(fsb, (reg<<2))); + *(addr+0) = value >> 48; + *(addr+1) = value >> 32; + *(addr+2) = value >> 16; + *(addr+3) = value; + __ia64_mf_a(); +} + +/* XX this doesn't make a lot of sense. Which fsb? */ +static inline void +__synergy_out(unsigned long addr, unsigned long value) +{ + volatile unsigned long *adr = (unsigned long *) + (addr | __IA64_UNCACHED_OFFSET); + + *adr = value; + __ia64_mf_a(); +} + +#define READ_LOCAL_SYNERGY_REG(addr) __synergy_in(addr) + +/* XX this doesn't make a lot of sense. Which fsb? */ +static inline unsigned long +__synergy_in(unsigned long addr) +{ + unsigned long ret, *adr = (unsigned long *) + (addr | __IA64_UNCACHED_OFFSET); + + ret = *adr; + __ia64_mf_a(); + return ret; +} + +struct sn1_intr_action { + void (*handler)(int, void *, struct pt_regs *); + void *intr_arg; + unsigned long flags; + struct sn1_intr_action * next; +}; + +typedef struct synergy_da_s { + hub_intmasks_t s_intmasks; +}synergy_da_t; + +struct sn1_cnode_action_list { + spinlock_t action_list_lock; + struct sn1_intr_action *action_list; +}; + +/* + * ioctl cmds for node/hub/synergy/[01]/mon for synergy + * perf monitoring are defined in sndrv.h + */ + +/* multiplex the counters every 10 timer interrupts */ +#define SYNERGY_PERF_FREQ_DEFAULT 10 + +/* macros for synergy "mon" device ioctl handler */ +#define SYNERGY_PERF_INFO(_s, _f) (arbitrary_info_t)(((_s) << 16)|(_f)) +#define SYNERGY_PERF_INFO_CNODE(_x) (cnodeid_t)(((uint64_t)_x) >> 16) +#define SYNERGY_PERF_INFO_FSB(_x) (((uint64_t)_x) & 1) + +/* synergy perf control registers */ +#define PERF_CNTL0_A 0xab0UL /* control A on FSB0 */ +#define PERF_CNTL0_B 0xab8UL /* control B on FSB0 */ +#define PERF_CNTL1_A 0xac0UL /* control A on FSB1 */ +#define PERF_CNTL1_B 0xac8UL /* control B on FSB1 */ + +/* synergy perf counters */ +#define PERF_CNTR0_A 0xad0UL /* counter A on FSB0 */ +#define PERF_CNTR0_B 0xad8UL /* counter B on FSB0 */ +#define PERF_CNTR1_A 0xaf0UL /* counter A on FSB1 */ +#define PERF_CNTR1_B 0xaf8UL /* counter B on FSB1 */ + +/* Synergy perf data. Each nodepda keeps a list of these */ +struct synergy_perf_s { + uint64_t intervals; /* count of active intervals for this event */ + uint64_t total_intervals;/* snapshot of total intervals */ + uint64_t modesel; /* mode and sel bits, both A and B registers */ + struct synergy_perf_s *next; /* next in circular linked list */ + uint64_t counts[2]; /* [0] is synergy-A counter, [1] synergy-B counter */ +}; + +typedef struct synergy_perf_s synergy_perf_t; + +typedef struct synergy_info_s synergy_info_t; + +extern void synergy_perf_init(void); +extern void synergy_perf_update(int); +extern struct file_operations synergy_mon_fops; + +#endif /* _ASM_IA64_SN_SN1_SYNERGY_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn1/uart16550.h lia64-2.4/include/asm-ia64/sn/sn1/uart16550.h --- linux-2.4.18/include/asm-ia64/sn/sn1/uart16550.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sn1/uart16550.h Wed Dec 31 16:00:00 1969 @@ -1,228 +0,0 @@ -/* $Id$ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam - */ - -#ifndef _ASM_SN_SN1_UART16550_H -#define _ASM_SN_SN1_UART16550_H - - -/* - * Definitions for 16550 chip - */ - - /* defined as offsets from the data register */ -#define REG_DAT 0 /* receive/transmit data */ -#define REG_ICR 1 /* interrupt control register */ -#define REG_ISR 2 /* interrupt status register */ -#define REG_FCR 2 /* fifo control register */ -#define REG_LCR 3 /* line control register */ -#define REG_MCR 4 /* modem control register */ -#define REG_LSR 5 /* line status register */ -#define REG_MSR 6 /* modem status register */ -#define REG_SCR 7 /* Scratch register */ -#define REG_DLL 0 /* divisor latch (lsb) */ -#define REG_DLH 1 /* divisor latch (msb) */ -#define REG_EFR 2 /* 16650 enhanced feature register */ - -/* - * 16450/16550 Registers Structure. - */ - -/* Line Control Register */ -#define LCR_WLS0 0x01 /*word length select bit 0 */ -#define LCR_WLS1 0x02 /*word length select bit 2 */ -#define LCR_STB 0x04 /* number of stop bits */ -#define LCR_PEN 0x08 /* parity enable */ -#define LCR_EPS 0x10 /* even parity select */ -#define LCR_SETBREAK 0x40 /* break key */ -#define LCR_DLAB 0x80 /* divisor latch access bit */ -#define LCR_RXLEN 0x03 /* # of data bits per received/xmitted char */ -#define LCR_STOP1 0x00 -#define LCR_STOP2 0x04 -#define LCR_PAREN 0x08 -#define LCR_PAREVN 0x10 -#define LCR_PARMARK 0x20 -#define LCR_SNDBRK 0x40 -#define LCR_DLAB 0x80 - - -#define LCR_BITS5 0x00 /* 5 bits per char */ -#define LCR_BITS6 0x01 /* 6 bits per char */ -#define LCR_BITS7 0x02 /* 7 bits per char */ -#define LCR_BITS8 0x03 /* 8 bits per char */ - -#define LCR_MASK_BITS_CHAR 0x03 -#define LCR_MASK_STOP_BITS 0x04 -#define LCR_MASK_PARITY_BITS 0x18 - - -/* Line Status Register */ -#define LSR_RCA 0x01 /* data ready */ -#define LSR_OVRRUN 0x02 /* overrun error */ -#define LSR_PARERR 0x04 /* parity error */ -#define LSR_FRMERR 0x08 /* framing error */ -#define LSR_BRKDET 0x10 /* a break has arrived */ -#define LSR_XHRE 0x20 /* tx hold reg is now empty */ -#define LSR_XSRE 0x40 /* tx shift reg is now empty */ -#define LSR_RFBE 0x80 /* rx FIFO Buffer error */ - -/* Interrupt Status Regisger */ -#define ISR_MSTATUS 0x00 -#define ISR_TxRDY 0x02 -#define ISR_RxRDY 0x04 -#define ISR_ERROR_INTR 0x08 -#define ISR_FFTMOUT 0x0c /* FIFO Timeout */ -#define ISR_RSTATUS 0x06 /* Receiver Line status */ - -/* Interrupt Enable Register */ -#define ICR_RIEN 0x01 /* Received Data Ready */ -#define ICR_TIEN 0x02 /* Tx Hold Register Empty */ -#define ICR_SIEN 0x04 /* Receiver Line Status */ -#define ICR_MIEN 0x08 /* Modem Status */ - -/* Modem Control Register */ -#define MCR_DTR 0x01 /* Data Terminal Ready */ -#define MCR_RTS 0x02 /* Request To Send */ -#define MCR_OUT1 0x04 /* Aux output - not used */ -#define MCR_OUT2 0x08 /* turns intr to 386 on/off */ -#define MCR_LOOP 0x10 /* loopback for diagnostics */ -#define MCR_AFE 0x20 /* Auto flow control enable */ - -/* Modem Status Register */ -#define MSR_DCTS 0x01 /* Delta Clear To Send */ -#define MSR_DDSR 0x02 /* Delta Data Set Ready */ -#define MSR_DRI 0x04 /* Trail Edge Ring Indicator */ -#define MSR_DDCD 0x08 /* Delta Data Carrier Detect */ -#define MSR_CTS 0x10 /* Clear To Send */ -#define MSR_DSR 0x20 /* Data Set Ready */ -#define MSR_RI 0x40 /* Ring Indicator */ -#define MSR_DCD 0x80 /* Data Carrier Detect */ - -#define DELTAS(x) ((x)&(MSR_DCTS|MSR_DDSR|MSR_DRI|MSR_DDCD)) -#define STATES(x) ((x)(MSR_CTS|MSR_DSR|MSR_RI|MSR_DCD)) - - -#define FCR_FIFOEN 0x01 /* enable receive/transmit fifo */ -#define FCR_RxFIFO 0x02 /* enable receive fifo */ -#define FCR_TxFIFO 0x04 /* enable transmit fifo */ -#define FCR_MODE1 0x08 /* change to mode 1 */ -#define RxLVL0 0x00 /* Rx fifo level at 1 */ -#define RxLVL1 0x40 /* Rx fifo level at 4 */ -#define RxLVL2 0x80 /* Rx fifo level at 8 */ -#define RxLVL3 0xc0 /* Rx fifo level at 14 */ - -#define FIFOEN (FCR_FIFOEN | FCR_RxFIFO | FCR_TxFIFO | RxLVL3 | FCR_MODE1) - -#define FCT_TxMASK 0x30 /* mask for Tx trigger */ -#define FCT_RxMASK 0xc0 /* mask for Rx trigger */ - -/* enhanced festures register */ -#define EFR_SFLOW 0x0f /* various S/w Flow Controls */ -#define EFR_EIC 0x10 /* Enhanced Interrupt Control bit */ -#define EFR_SCD 0x20 /* Special Character Detect */ -#define EFR_RTS 0x40 /* RTS flow control */ -#define EFR_CTS 0x80 /* CTS flow control */ - -/* Rx Tx software flow controls in 16650 enhanced mode */ -#define SFLOW_Tx0 0x00 /* no Xmit flow control */ -#define SFLOW_Tx1 0x08 /* Transmit Xon1, Xoff1 */ -#define SFLOW_Tx2 0x04 /* Transmit Xon2, Xoff2 */ -#define SFLOW_Tx3 0x0c /* Transmit Xon1,Xon2, Xoff1,Xoff2 */ -#define SFLOW_Rx0 0x00 /* no Rcv flow control */ -#define SFLOW_Rx1 0x02 /* Receiver compares Xon1, Xoff1 */ -#define SFLOW_Rx2 0x01 /* Receiver compares Xon2, Xoff2 */ - -#define ASSERT_DTR(x) (x |= MCR_DTR) -#define ASSERT_RTS(x) (x |= MCR_RTS) -#define DU_RTS_ASSERTED(x) (((x) & MCR_RTS) != 0) -#define DU_RTS_ASSERT(x) ((x) |= MCR_RTS) -#define DU_RTS_DEASSERT(x) ((x) &= ~MCR_RTS) - - -/* - * ioctl(fd, I_STR, arg) - * use the SIOC_RS422 and SIOC_EXTCLK combination to support MIDI - */ -#define SIOC ('z' << 8) /* z for z85130 */ -#define SIOC_EXTCLK (SIOC | 1) /* select/de-select external clock */ -#define SIOC_RS422 (SIOC | 2) /* select/de-select RS422 protocol */ -#define SIOC_ITIMER (SIOC | 3) /* upstream timer adjustment */ -#define SIOC_LOOPBACK (SIOC | 4) /* diagnostic loopback test mode */ - - -/* channel control register */ -#define DMA_INT_MASK 0xe0 /* ring intr mask */ -#define DMA_INT_TH25 0x20 /* 25% threshold */ -#define DMA_INT_TH50 0x40 /* 50% threshold */ -#define DMA_INT_TH75 0x60 /* 75% threshold */ -#define DMA_INT_EMPTY 0x80 /* ring buffer empty */ -#define DMA_INT_NEMPTY 0xa0 /* ring buffer not empty */ -#define DMA_INT_FULL 0xc0 /* ring buffer full */ -#define DMA_INT_NFULL 0xe0 /* ring buffer not full */ - -#define DMA_CHANNEL_RESET 0x400 /* reset dma channel */ -#define DMA_ENABLE 0x200 /* enable DMA */ - -/* peripheral controller intr status bits applicable to serial ports */ -#define ISA_SERIAL0_MASK 0x03f00000 /* mask for port #1 intrs */ -#define ISA_SERIAL0_DIR 0x00100000 /* device intr request */ -#define ISA_SERIAL0_Tx_THIR 0x00200000 /* Transmit DMA threshold */ -#define ISA_SERIAL0_Tx_PREQ 0x00400000 /* Transmit DMA pair req */ -#define ISA_SERIAL0_Tx_MEMERR 0x00800000 /* Transmit DMA memory err */ -#define ISA_SERIAL0_Rx_THIR 0x01000000 /* Receive DMA threshold */ -#define ISA_SERIAL0_Rx_OVERRUN 0x02000000 /* Receive DMA over-run */ - -#define ISA_SERIAL1_MASK 0xfc000000 /* mask for port #1 intrs */ -#define ISA_SERIAL1_DIR 0x04000000 /* device intr request */ -#define ISA_SERIAL1_Tx_THIR 0x08000000 /* Transmit DMA threshold */ -#define ISA_SERIAL1_Tx_PREQ 0x10000000 /* Transmit DMA pair req */ -#define ISA_SERIAL1_Tx_MEMERR 0x20000000 /* Transmit DMA memory err */ -#define ISA_SERIAL1_Rx_THIR 0x40000000 /* Receive DMA threshold */ -#define ISA_SERIAL1_Rx_OVERRUN 0x80000000 /* Receive DMA over-run */ - -#define MAX_RING_BLOCKS 128 /* 4096/32 */ -#define MAX_RING_SIZE 4096 - -/* DMA Input Control Byte */ -#define DMA_IC_OVRRUN 0x01 /* overrun error */ -#define DMA_IC_PARERR 0x02 /* parity error */ -#define DMA_IC_FRMERR 0x04 /* framing error */ -#define DMA_IC_BRKDET 0x08 /* a break has arrived */ -#define DMA_IC_VALID 0x80 /* pair is valid */ - -/* DMA Output Control Byte */ -#define DMA_OC_TxINTR 0x20 /* set Tx intr after processing byte */ -#define DMA_OC_INVALID 0x00 /* invalid pair */ -#define DMA_OC_WTHR 0x40 /* Write byte to THR */ -#define DMA_OC_WMCR 0x80 /* Write byte to MCR */ -#define DMA_OC_DELAY 0xc0 /* time delay before next xmit */ - -/* ring id's */ -#define RID_SERIAL0_TX 0x4 /* serial port 0, transmit ring buffer */ -#define RID_SERIAL0_RX 0x5 /* serial port 0, receive ring buffer */ -#define RID_SERIAL1_TX 0x6 /* serial port 1, transmit ring buffer */ -#define RID_SERIAL1_RX 0x7 /* serial port 1, receive ring buffer */ - -#define CLOCK_XIN 22 -#define PRESCALER_DIVISOR 3 -#define CLOCK_ACE 7333333 - -/* - * increment the ring offset. One way to do this would be to add b'100000. - * this would let the offset value roll over automatically when it reaches - * its maximum value (127). However when we use the offset, we must use - * the appropriate bits only by masking with 0xfe0. - * The other option is to shift the offset right by 5 bits and look at its - * value. Then increment if required and shift back - * note: 127 * 2^5 = 4064 - */ -#define INC_RING_POINTER(x) \ - ( ((x & 0xffe0) < 4064) ? (x += 32) : 0 ) - -#endif /* _ASM_SN_SN1_UART16550_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn2/addrs.h lia64-2.4/include/asm-ia64/sn/sn2/addrs.h --- linux-2.4.18/include/asm-ia64/sn/sn2/addrs.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn2/addrs.h Tue Feb 26 13:19:36 2002 @@ -0,0 +1,159 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#ifndef _ASM_IA64_SN_SN2_ADDRS_H +#define _ASM_IA64_SN_SN2_ADDRS_H + +/* McKinley Address Format: + * + * 4 4 3 3 3 3 + * 9 8 8 7 6 5 0 + * +-+---------+----+--------------+ + * |0| Node ID | AS | Node Offset | + * +-+---------+----+--------------+ + * + * Node ID: If bit 38 = 1, is ICE, else is SHUB + * AS: Address Space Identifier. Used only if bit 38 = 0. + * b'00: Local Resources and MMR space + * bit 35 + * 0: Local resources space + * node id: + * 0: IA64/NT compatibility space + * 2: Local MMR Space + * 4: Local memory, regardless of local node id + * 1: Global MMR space + * b'01: GET space. + * b'10: AMO space. + * b'11: Cacheable memory space. + * + * NodeOffset: byte offset + */ + +#ifndef __ASSEMBLY__ +typedef union ia64_sn2_pa { + struct { + unsigned long off : 36; + unsigned long as : 2; + unsigned long nasid: 11; + unsigned long fill : 15; + } f; + unsigned long l; + void *p; +} ia64_sn2_pa_t; +#endif + +#define TO_PHYS_MASK 0x0001ffcfffffffff /* Note - clear AS bits */ + + +/* Regions determined by AS */ +#define LOCAL_MMR_SPACE 0xc000008000000000 /* Local MMR space */ +#define LOCAL_MEM_SPACE 0xc000010000000000 /* Local Memory space */ +#define GLOBAL_MMR_SPACE 0xc000000800000000 /* Global MMR space */ +#define GET_SPACE 0xc000001000000000 /* GET space */ +#define AMO_SPACE 0xc000002000000000 /* AMO space */ +#define CACHEABLE_MEM_SPACE 0xe000003000000000 /* Cacheable memory space */ +#define UNCACHED 0xc000000000000000 /* UnCacheable memory space */ + +/* SN2 address macros */ +#define NID_SHFT 38 +#define LOCAL_MMR_ADDR(a) (UNCACHED | LOCAL_MMR_SPACE | (a)) +#define LOCAL_MEM_ADDR(a) (LOCAL_MEM_SPACE | (a)) +#define REMOTE_ADDR(n,a) ((((unsigned long)(n))< */ +#define BWIN_SIZE_BITS 29 /* big window size: 512M */ +#define NASID_BITS 11 /* bits <48:38> */ +#define NASID_BITMASK (0x7ffULL) +#define NASID_SHFT NID_SHFT +#define NASID_META_BITS 0 /* ???? */ +#define NASID_LOCAL_BITS 7 /* same router as SN1 */ + +#define NODE_ADDRSPACE_SIZE (UINT64_CAST 1 << NODE_SIZE_BITS) +#define NASID_MASK (UINT64_CAST NASID_BITMASK << NASID_SHFT) +#define NASID_GET(_pa) (int) ((UINT64_CAST (_pa) >> \ + NASID_SHFT) & NASID_BITMASK) +#ifdef __IA64 +#define PHYS_TO_DMA(x) ( ((x & NASID_MASK) >> 2) | \ + (x & (NODE_ADDRSPACE_SIZE - 1)) ) +#else +#define PHYS_TO_DMA(x) ( (x) ) +#endif + +#define CHANGE_NASID(n,x) ({ia64_sn2_pa_t _v; _v.l = (long) (x); _v.f.nasid = n; _v.p;}) + +#ifndef __ASSEMBLY__ +#define NODE_SWIN_BASE(nasid, widget) \ + ((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN) \ + : RAW_NODE_SWIN_BASE(nasid, widget)) +#else +#define NODE_SWIN_BASE(nasid, widget) \ + (NODE_IO_BASE(nasid) + (UINT64_CAST (widget) << SWIN_SIZE_BITS)) +#define LOCAL_SWIN_BASE(widget) \ + (UNCACHED | LOCAL_MMR_SPACE | ((UINT64_CAST (widget) << SWIN_SIZE_BITS))) +#endif /* __ASSEMBLY__ */ + +/* + * The following definitions pertain to the IO special address + * space. They define the location of the big and little windows + * of any given node. + */ + +#define BWIN_INDEX_BITS 3 +#define BWIN_SIZE (UINT64_CAST 1 << BWIN_SIZE_BITS) +#define BWIN_SIZEMASK (BWIN_SIZE - 1) +#define BWIN_WIDGET_MASK 0x7 +#define NODE_BWIN_BASE0(nasid) (NODE_IO_BASE(nasid) + BWIN_SIZE) +#define NODE_BWIN_BASE(nasid, bigwin) (NODE_BWIN_BASE0(nasid) + \ + (UINT64_CAST (bigwin) << BWIN_SIZE_BITS)) + +#define BWIN_WIDGETADDR(addr) ((addr) & BWIN_SIZEMASK) +#define BWIN_WINDOWNUM(addr) (((addr) >> BWIN_SIZE_BITS) & BWIN_WIDGET_MASK) + +/* + * Verify if addr belongs to large window address of node with "nasid" + * + * + * NOTE: "addr" is expected to be XKPHYS address, and NOT physical + * address + * + * + */ + +#define NODE_BWIN_ADDR(nasid, addr) \ + (((addr) >= NODE_BWIN_BASE0(nasid)) && \ + ((addr) < (NODE_BWIN_BASE(nasid, HUB_NUM_BIG_WINDOW) + \ + BWIN_SIZE))) + +#endif /* _ASM_IA64_SN_SN2_ADDRS_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn2/arch.h lia64-2.4/include/asm-ia64/sn/sn2/arch.h --- linux-2.4.18/include/asm-ia64/sn/sn2/arch.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn2/arch.h Mon Feb 4 17:48:57 2002 @@ -0,0 +1,66 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ +#ifndef _ASM_IA64_SN_SN2_ARCH_H +#define _ASM_IA64_SN_SN2_ARCH_H + +#include + + +#define CPUS_PER_NODE 4 /* CPUs on a single hub */ +#define CPUS_PER_SUBNODE 4 /* CPUs on a single hub PI */ + + +/* + * This is the maximum number of NASIDS that can be present in a system. + * (Highest NASID plus one.) + */ +#define MAX_NASIDS 2048 + + +/* + * This is the maximum number of nodes that can be part of a kernel. + * Effectively, it's the maximum number of compact node ids (cnodeid_t). + * This is not necessarily the same as MAX_NASIDS. + */ +#define MAX_COMPACT_NODES 128 + +/* + * MAX_REGIONS refers to the maximum number of hardware partitioned regions. + */ +#define MAX_REGIONS 64 +#define MAX_NONPREMIUM_REGIONS 16 +#define MAX_PREMIUM_REGIONS MAX_REGIONS + + +/* + * MAX_PARITIONS refers to the maximum number of logically defined + * partitions the system can support. + */ +#define MAX_PARTITIONS MAX_REGIONS + + +#define NASID_MASK_BYTES ((MAX_NASIDS + 7) / 8) + + +/* + * 1 FSB per SHUB, with up to 4 cpus per FSB. + */ +#define NUM_SUBNODES 1 +#define SUBNODE_SHFT 0 +#define SUBNODE_MASK (0x0 << SUBNODE_SHFT) +#define LOCALCPU_SHFT 0 +#define LOCALCPU_MASK (0x3 << LOCALCPU_SHFT) +#define SUBNODE(slice) (((slice) & SUBNODE_MASK) >> SUBNODE_SHFT) +#define LOCALCPU(slice) (((slice) & LOCALCPU_MASK) >> LOCALCPU_SHFT) +#define TO_SLICE(subn, local) (((subn) << SUBNODE_SHFT) | \ + ((local) << LOCALCPU_SHFT)) + +typedef u64 mmr_t; + +#endif /* _ASM_IA64_SN_SN2_ARCH_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn2/intr.h lia64-2.4/include/asm-ia64/sn/sn2/intr.h --- linux-2.4.18/include/asm-ia64/sn/sn2/intr.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn2/intr.h Mon Feb 4 17:48:57 2002 @@ -0,0 +1,25 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ +#ifndef _ASM_IA64_SN_SN2_INTR_H +#define _ASM_IA64_SN_SN2_INTR_H + +#define SGI_UART_VECTOR (0xe9) +#define SGI_SHUB_ERROR_VECTOR (0xea) + +// These two IRQ's are used by partitioning. +#define SGI_XPC_NOTIFY (0xe7) +#define SGI_XPART_ACTIVATE (0x30) + +#define IA64_SN2_FIRST_DEVICE_VECTOR (0x31) +#define IA64_SN2_LAST_DEVICE_VECTOR (0xe6) + +#define SN2_IRQ_RESERVED (0x1) +#define SN2_IRQ_CONNECTED (0x2) + +#endif /* _ASM_IA64_SN_SN2_INTR_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn2/mmzone_sn2.h lia64-2.4/include/asm-ia64/sn/sn2/mmzone_sn2.h --- linux-2.4.18/include/asm-ia64/sn/sn2/mmzone_sn2.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn2/mmzone_sn2.h Tue Feb 26 13:19:36 2002 @@ -0,0 +1,165 @@ +#ifndef _ASM_IA64_SN_MMZONE_SN2_H +#define _ASM_IA64_SN_MMZONE_SN2_H + +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#include + + +/* + * SGI SN2 Arch defined values + * + * An SN2 physical address is broken down as follows: + * + * +-----------------------------------------+ + * | | | | node offset | + * | unused | node | AS |-------------------| + * | | | | cn | clump offset | + * +-----------------------------------------+ + * 6 4 4 3 3 3 3 3 3 0 + * 3 9 8 8 7 6 5 4 3 0 + * + * bits 63-49 Unused - must be zero + * bits 48-38 Node number. Note that some configurations do NOT + * have a node zero. + * bits 37-36 Address space ID. Cached memory has a value of 3 (!!!). + * Chipset & IO addresses have other values. + * (Yikes!! The hardware folks hate us...) + * bits 35-0 Node offset. + * + * The node offset can be further broken down as: + * bits 35-34 Clump (bank) number. + * bits 33-0 Clump (bank) offset. + * + * A node consists of up to 4 clumps (banks) of memory. A clump may be empty, or may be + * populated with a single contiguous block of memory starting at clump + * offset 0. The size of the block is (2**n) * 64MB, where 0> SN2_NODE_SHIFT) & SN2_NODE_MASK) +#define SN2_NODE_CLUMP_NUMBER(kaddr) (((unsigned long)(kaddr) >>34) & 3) +#define SN2_NODE_OFFSET(addr) (((unsigned long)(addr)) & SN2_NODE_OFFSET_MASK) +#define SN2_KADDR(nasid, offset) (((unsigned long)(nasid)<>2) | \ + (_p&SN2_NODE_OFFSET_MASK)) >>SN2_CHUNKSHIFT;}) + +/* + * Given a kaddr, find the nid (compact nodeid) + */ +#ifdef CONFIG_IA64_SGI_SN_DEBUG +#define DISCONBUG(kaddr) panic("DISCONTIG BUG: line %d, %s. kaddr 0x%lx", \ + __LINE__, __FILE__, (long)(kaddr)) + +#define KVADDR_TO_NID(kaddr) ({long _ktn=(long)(kaddr); \ + kern_addr_valid(_ktn) ? \ + local_node_data->physical_node_map[SN2_NODE_NUMBER(_ktn)] : \ + (DISCONBUG(_ktn), 0UL);}) +#else +#define KVADDR_TO_NID(kaddr) (local_node_data->physical_node_map[SN2_NODE_NUMBER(kaddr)]) +#endif + + + +/* + * Given a kaddr, find the index into the clump_mem_map_base array of the page struct entry + * for the first page of the clump. + */ +#define PLAT_CLUMP_MEM_MAP_INDEX(kaddr) ({long _kmmi=(long)(kaddr); \ + KVADDR_TO_NID(_kmmi) * PLAT_CLUMPS_PER_NODE + \ + SN2_NODE_CLUMP_NUMBER(_kmmi);}) + + + +/* + * Calculate a "goal" value to be passed to __alloc_bootmem_node for allocating structures on + * nodes so that they dont alias to the same line in the cache as the previous allocated structure. + * This macro takes an address of the end of previous allocation, rounds it to a page boundary & + * changes the node number. + */ +#define PLAT_BOOTMEM_ALLOC_GOAL(cnode,kaddr) __pa(SN2_KADDR(PLAT_PXM_TO_PHYS_NODE_NUMBER(nid_to_pxm_map[cnode]), \ + (SN2_NODE_OFFSET(kaddr) + PAGE_SIZE - 1) >> PAGE_SHIFT << PAGE_SHIFT)) + + + + +/* + * Convert a proximity domain number (from the ACPI tables) into a physical node number. + * Note: on SN2, the promity domain number is the same as bits [8:1] of the NASID. The following + * algorithm relies on: + * - bit 0 of the NASID for cpu nodes is always 0 + * - bits [10:9] of all NASIDs in a partition are always the same + * - hard_smp_processor_id return the SAPIC of the current cpu & + * bits 0..11 contain the NASID. + * + * All of this complexity is because MS architectually limited proximity domain numbers to + * 8 bits. + */ + +#define PLAT_PXM_TO_PHYS_NODE_NUMBER(pxm) (((pxm)<<1) | (hard_smp_processor_id() & 0x300)) + +#endif /* _ASM_IA64_SN_MMZONE_SN2_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn2/shub.h lia64-2.4/include/asm-ia64/sn/sn2/shub.h --- linux-2.4.18/include/asm-ia64/sn/sn2/shub.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn2/shub.h Fri Jul 19 23:21:07 2002 @@ -0,0 +1,44 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2001 Silicon Graphics, Inc. All rights reserved. + */ + + +#ifndef _ASM_IA64_SN_SN2_SHUB_H +#define _ASM_IA64_SN_SN2_SHUB_H + +#include /* shub mmr addresses and formats */ +#include +#include +#ifndef __ASSEMBLY__ +#include /* shub mmr struct defines */ +#endif + +/* + * Junk Bus Address Space + * The junk bus is used to access the PROM, LED's, and UART. It's + * accessed through the local block MMR space. The data path is + * 16 bits wide. This space requires address bits 31-27 to be set, and + * is further divided by address bits 26:15. + * The LED addresses are write-only. To read the LEDs, you need to use + * SH_JUNK_BUS_LED0-3, defined in shub_mmr.h + * + */ +#define SH_REAL_JUNK_BUS_LED0 0x7fed00000 +#define SH_REAL_JUNK_BUS_LED1 0x7fed10000 +#define SH_REAL_JUNK_BUS_LED2 0x7fed20000 +#define SH_REAL_JUNK_BUS_LED3 0x7fed30000 +#define SH_JUNK_BUS_UART0 0x7fed40000 +#define SH_JUNK_BUS_UART1 0x7fed40008 +#define SH_JUNK_BUS_UART2 0x7fed40010 +#define SH_JUNK_BUS_UART3 0x7fed40018 +#define SH_JUNK_BUS_UART4 0x7fed40020 +#define SH_JUNK_BUS_UART5 0x7fed40028 +#define SH_JUNK_BUS_UART6 0x7fed40030 +#define SH_JUNK_BUS_UART7 0x7fed40038 + +#endif /* _ASM_IA64_SN_SN2_SHUB_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn2/shub_md.h lia64-2.4/include/asm-ia64/sn/sn2/shub_md.h --- linux-2.4.18/include/asm-ia64/sn/sn2/shub_md.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn2/shub_md.h Tue Apr 16 23:50:40 2002 @@ -0,0 +1,276 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2001, 2002 Silicon Graphics, Inc. All rights reserved. + */ + + +#ifndef _SHUB_MD_H +#define _SHUB_MD_H + +/* SN2 supports a mostly-flat address space with 4 CPU-visible, evenly spaced, + contiguous regions, or "software banks". On SN2, software bank n begins at + addresses n * 16GB, 0 <= n < 4. Each bank has a 16GB address space. If + the 4 dimms do not use up this space there will be holes between the + banks. Even with these holes the whole memory space within a bank is + not addressable address space. The top 1/32 of each bank is directory + memory space and is accessible through bist only. + + Physically a SN2 node board contains 2 daughter cards with 8 dimm sockets + each. A total of 16 dimm sockets arranged as 4 "DIMM banks" of 4 dimms + each. The data is stripped across the 4 memory busses so all dimms within + a dimm bank must have identical capacity dimms. Memory is increased or + decreased in sets of 4. Each dimm bank has 2 dimms on each side. + + Physical Dimm Bank layout. + DTR Card0 + ------------ + Dimm Bank 3 | MemYL3 | CS 3 + | MemXL3 | + |----------| + Dimm Bank 2 | MemYL2 | CS 2 + | MemXL2 | + |----------| + Dimm Bank 1 | MemYL1 | CS 1 + | MemXL1 | + |----------| + Dimm Bank 0 | MemYL0 | CS 0 + | MemXL0 | + ------------ + | | + BUS BUS + XL YL + | | + ------------ + | SHUB | + | MD | + ------------ + | | + BUS BUS + XR YR + | | + ------------ + Dimm Bank 0 | MemXR0 | CS 0 + | MemYR0 | + |----------| + Dimm Bank 1 | MemXR1 | CS 1 + | MemYR1 | + |----------| + Dimm Bank 2 | MemXR2 | CS 2 + | MemYR2 | + |----------| + Dimm Bank 3 | MemXR3 | CS 3 + | MemYR3 | + ------------ + DTR Card1 + + The dimms can be 1 or 2 sided dimms. The size and bankness is defined + separately for each dimm bank in the sh_[x,y,jnr]_dimm_cfg MMR register. + + Normally software bank 0 would map directly to physical dimm bank 0. The + software banks can map to the different physical dimm banks via the + DIMM[0-3]_CS field in SH_[x,y,jnr]_DIMM_CFG for each dimm slot. + + All the PROM's data structures (promlog variables, klconfig, etc.) + track memory by the physical dimm bank number. The kernel usually + tracks memory by the software bank number. + + */ + + +/* Preprocessor macros */ +#define MD_MEM_BANKS 4 +#define MD_PHYS_BANKS_PER_DIMM 2 /* dimms may be 2 sided. */ +#define MD_NUM_PHYS_BANKS (MD_MEM_BANKS * MD_PHYS_BANKS_PER_DIMM) +#define MD_DIMMS_IN_SLOT 4 /* 4 dimms in each dimm bank. aka slot */ + +/* Address bits 35,34 control dimm bank access. */ +#define MD_BANK_SHFT 34 +#define MD_BANK_MASK (UINT64_CAST 0x3 << MD_BANK_SHFT ) +#define MD_BANK_GET(addr) (((addr) & MD_BANK_MASK) >> MD_BANK_SHFT) +#define MD_BANK_SIZE (UINT64_CAST 0x1 << MD_BANK_SHFT ) /* 16 gb */ +#define MD_BANK_OFFSET(_b) (UINT64_CAST (_b) << MD_BANK_SHFT) + +/*Address bit 12 selects side of dimm if 2bnk dimms present. */ +#define MD_PHYS_BANK_SEL_SHFT 12 +#define MD_PHYS_BANK_SEL_MASK (UINT64_CAST 0x1 << MD_PHYS_BANK_SEL_SHFT) + +/* Address bit 7 determines if data resides on X or Y memory system. + * If addr Bit 7 is set the data resides on Y memory system and + * the corresponing directory entry reside on the X. + */ +#define MD_X_OR_Y_SEL_SHFT 7 +#define MD_X_OR_Y_SEL_MASK (1 << MD_X_OR_Y_SEL_SHFT) + +/* Address bit 8 determines which directory entry of the pair the address + * corresponds to. If addr Bit 8 is set DirB corresponds to the memory address. + */ +#define MD_DIRA_OR_DIRB_SEL_SHFT 8 +#define MD_DIRA_OR_DIRB_SEL_MASK (1 << MD_DIRA_OR_DIRB_SEL_SHFT) + +/* Address bit 11 determines if corresponding directory entry resides + * on Left or Right memory bus. If addr Bit 11 is set the corresponding + * directory entry resides on Right memory bus. + */ +#define MD_L_OR_R_SEL_SHFT 11 +#define MD_L_OR_R_SEL_MASK (1 << MD_L_OR_R_SEL_SHFT) + +/* DRAM sizes. */ +#define MD_SZ_64_Mb 0x0 +#define MD_SZ_128_Mb 0x1 +#define MD_SZ_256_Mb 0x2 +#define MD_SZ_512_Mb 0x3 +#define MD_SZ_1024_Mb 0x4 +#define MD_SZ_2048_Mb 0x5 +#define MD_SZ_UNUSED 0x7 + +#define MD_DIMM_SIZE_BYTES(_size, _2bk) ( \ + ( (_size) == 7 ? 0 : ( 0x4000000L << (_size)) << (_2bk)))\ + +#define MD_DIMM_SIZE_MBYTES(_size, _2bk) ( \ + ( (_size) == 7 ? 0 : ( 0x40L << (_size) ) << (_2bk))) \ + +/* The top 1/32 of each bank is directory memory, and not accessable + * via normal reads and writes */ +#define MD_DIMM_USER_SIZE(_size) ((_size) * 31 / 32) + +/* Minimum size of a populated bank is 64M (62M usable) */ +#define MIN_BANK_SIZE MD_DIMM_USER_SIZE((64 * 0x100000)) +#define MIN_BANK_STRING "62" + + +/*Possible values for FREQ field in sh_[x,y,jnr]_dimm_cfg regs */ +#define MD_DIMM_100_CL2_0 0x0 +#define MD_DIMM_133_CL2_0 0x1 +#define MD_DIMM_133_CL2_5 0x2 +#define MD_DIMM_160_CL2_0 0x3 +#define MD_DIMM_160_CL2_5 0x4 +#define MD_DIMM_160_CL3_0 0x5 +#define MD_DIMM_200_CL2_0 0x6 +#define MD_DIMM_200_CL2_5 0x7 +#define MD_DIMM_200_CL3_0 0x8 + +/* DIMM_CFG fields */ +#define MD_DIMM_SHFT(_dimm) ((_dimm) << 3) +#define MD_DIMM_SIZE_MASK(_dimm) \ + (SH_JNR_DIMM_CFG_DIMM0_SIZE_MASK << \ + (MD_DIMM_SHFT(_dimm))) + +#define MD_DIMM_2BK_MASK(_dimm) \ + (SH_JNR_DIMM_CFG_DIMM0_2BK_MASK << \ + MD_DIMM_SHFT(_dimm)) + +#define MD_DIMM_REV_MASK(_dimm) \ + (SH_JNR_DIMM_CFG_DIMM0_REV_MASK << \ + MD_DIMM_SHFT(_dimm)) + +#define MD_DIMM_CS_MASK(_dimm) \ + (SH_JNR_DIMM_CFG_DIMM0_CS_MASK << \ + MD_DIMM_SHFT(_dimm)) + +#define MD_DIMM_SIZE(_dimm, _cfg) \ + (((_cfg) & MD_DIMM_SIZE_MASK(_dimm)) \ + >> (MD_DIMM_SHFT(_dimm)+SH_JNR_DIMM_CFG_DIMM0_SIZE_SHFT)) + +#define MD_DIMM_TWO_SIDED(_dimm,_cfg) \ + ( ((_cfg) & MD_DIMM_2BK_MASK(_dimm)) \ + >> (MD_DIMM_SHFT(_dimm)+SH_JNR_DIMM_CFG_DIMM0_2BK_SHFT)) + +#define MD_DIMM_REVERSED(_dimm,_cfg) \ + (((_cfg) & MD_DIMM_REV_MASK(_dimm)) \ + >> (MD_DIMM_SHFT(_dimm)+SH_JNR_DIMM_CFG_DIMM0_REV_SHFT)) + +#define MD_DIMM_CS(_dimm,_cfg) \ + (((_cfg) & MD_DIMM_CS_MASK(_dimm)) \ + >> (MD_DIMM_SHFT(_dimm)+SH_JNR_DIMM_CFG_DIMM0_CS_SHFT)) + + + +/* Macros to set MMRs that must be set identically to others. */ +#define MD_SET_DIMM_CFG(_n, _value) { \ + REMOTE_HUB_S(_n, SH_X_DIMM_CFG,_value); \ + REMOTE_HUB_S(_n, SH_Y_DIMM_CFG, _value); \ + REMOTE_HUB_S(_n, SH_JNR_DIMM_CFG, _value);} + +#define MD_SET_DQCT_CFG(_n, _value) { \ + REMOTE_HUB_S(_n, SH_X_DQCT_CFG,_value); \ + REMOTE_HUB_S(_n, SH_Y_DQCT_CFG,_value); } + +#define MD_SET_CFG(_n, _value) { \ + REMOTE_HUB_S(_n, SH_X_CFG,_value); \ + REMOTE_HUB_S(_n, SH_Y_CFG,_value);} + +#define MD_SET_REFRESH_CONTROL(_n, _value) { \ + REMOTE_HUB_S(_n, SH_X_REFRESH_CONTROL, _value); \ + REMOTE_HUB_S(_n, SH_Y_REFRESH_CONTROL, _value);} + +#define MD_SET_DQ_MMR_DIR_COFIG(_n, _value) { \ + REMOTE_HUB_S(_n, SH_MD_DQLP_MMR_DIR_CONFIG, _value); \ + REMOTE_HUB_S(_n, SH_MD_DQRP_MMR_DIR_CONFIG, _value);} + +#define MD_SET_PIOWD_DIR_ENTRYS(_n, _value) { \ + REMOTE_HUB_S(_n, SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY, _value);\ + REMOTE_HUB_S(_n, SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY, _value);} + +/* + * There are 12 Node Presence MMRs, 4 in each primary DQ and 4 in the + * LB. The data in the left and right DQ MMRs and the LB must match. + */ +#define MD_SET_PRESENT_VEC(_n, _vec, _value) { \ + REMOTE_HUB_S(_n, SH_MD_DQLP_MMR_DIR_PRESVEC0+((_vec)*0x10),\ + _value); \ + REMOTE_HUB_S(_n, SH_MD_DQRP_MMR_DIR_PRESVEC0+((_vec)*0x10),\ + _value); \ + REMOTE_HUB_S(_n, SH_SHUBS_PRESENT0+((_vec)*0x80), _value);} +/* + * There are 16 Privilege Vector MMRs, 8 in each primary DQ. The data + * in the corresponding left and right DQ MMRs must match. Each MMR + * pair is used for a single partition. + */ +#define MD_SET_PRI_VEC(_n, _vec, _value) { \ + REMOTE_HUB_S(_n, SH_MD_DQLP_MMR_DIR_PRIVEC0+((_vec)*0x10),\ + _value); \ + REMOTE_HUB_S(_n, SH_MD_DQRP_MMR_DIR_PRIVEC0+((_vec)*0x10),\ + _value);} +/* + * There are 16 Local/Remote MMRs, 8 in each primary DQ. The data in + * the corresponding left and right DQ MMRs must match. Each MMR pair + * is used for a single partition. + */ +#define MD_SET_LOC_VEC(_n, _vec, _value) { \ + REMOTE_HUB_S(_n, SH_MD_DQLP_MMR_DIR_LOCVEC0+((_vec)*0x10),\ + _value); \ + REMOTE_HUB_S(_n, SH_MD_DQRP_MMR_DIR_LOCVEC0+((_vec)*0x10),\ + _value);} + +/* Memory BIST CMDS */ +#define MD_DIMM_INIT_MODE_SET 0x0 +#define MD_DIMM_INIT_REFRESH 0x1 +#define MD_DIMM_INIT_PRECHARGE 0x2 +#define MD_DIMM_INIT_BURST_TERM 0x6 +#define MD_DIMM_INIT_NOP 0x7 +#define MD_DIMM_BIST_READ 0x10 +#define MD_FILL_DIR 0x20 +#define MD_FILL_DATA 0x30 +#define MD_FILL_DIR_ACCESS 0X40 +#define MD_READ_DIR_PAIR 0x50 +#define MD_READ_DIR_TAG 0x60 + +/* SH_MMRBIST_CTL macros */ +#define MD_BIST_FAIL(_n) (REMOTE_HUB_L(_n, SH_MMRBIST_CTL) & \ + SH_MMRBIST_CTL_FAIL_MASK) + +#define MD_BIST_IN_PROGRESS(_n) (REMOTE_HUB_L(_n, SH_MMRBIST_CTL) & \ + SH_MMRBIST_CTL_IN_PROGRESS_MASK) + +#define MD_BIST_MEM_IDLE(_n); (REMOTE_HUB_L(_n, SH_MMRBIST_CTL) & \ + SH_MMRBIST_CTL_MEM_IDLE_MASK) + +/* SH_MMRBIST_ERR macros */ +#define MD_BIST_MISCOMPARE(_n) (REMOTE_HUB_L(_n, SH_MMRBIST_ERR) & \ + SH_MMRBIST_ERR_DETECTED_MASK) + +#endif /* _SHUB_MD_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn2/shub_mmr.h lia64-2.4/include/asm-ia64/sn/sn2/shub_mmr.h --- linux-2.4.18/include/asm-ia64/sn/sn2/shub_mmr.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn2/shub_mmr.h Mon Nov 19 23:22:59 2001 @@ -0,0 +1,31597 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2001 Silicon Graphics, Inc. All rights reserved. + */ + + +#ifndef _ASM_IA64_SN_SN2_SHUB_MMR_H +#define _ASM_IA64_SN_SN2_SHUB_MMR_H + +/* ==================================================================== */ +/* Register "SH_FSB_BINIT_CONTROL" */ +/* FSB BINIT# Control */ +/* ==================================================================== */ + +#define SH_FSB_BINIT_CONTROL 0x0000000120010000 +#define SH_FSB_BINIT_CONTROL_MASK 0x0000000000000001 +#define SH_FSB_BINIT_CONTROL_INIT 0x0000000000000000 + +/* SH_FSB_BINIT_CONTROL_BINIT */ +/* Description: Assert the FSB's BINIT# Signal */ +#define SH_FSB_BINIT_CONTROL_BINIT_SHFT 0 +#define SH_FSB_BINIT_CONTROL_BINIT_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_FSB_RESET_CONTROL" */ +/* FSB Reset Control */ +/* ==================================================================== */ + +#define SH_FSB_RESET_CONTROL 0x0000000120010080 +#define SH_FSB_RESET_CONTROL_MASK 0x0000000000000001 +#define SH_FSB_RESET_CONTROL_INIT 0x0000000000000000 + +/* SH_FSB_RESET_CONTROL_RESET */ +/* Description: Assert the FSB's RESET# Signal */ +#define SH_FSB_RESET_CONTROL_RESET_SHFT 0 +#define SH_FSB_RESET_CONTROL_RESET_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_FSB_SYSTEM_AGENT_CONFIG" */ +/* FSB System Agent Configuration */ +/* ==================================================================== */ + +#define SH_FSB_SYSTEM_AGENT_CONFIG 0x0000000120010100 +#define SH_FSB_SYSTEM_AGENT_CONFIG_MASK 0x00003fff0187fff9 +#define SH_FSB_SYSTEM_AGENT_CONFIG_INIT 0x0000000000000000 + +/* SH_FSB_SYSTEM_AGENT_CONFIG_RCNT_SCNT_EN */ +/* Description: RCNT/SCNT Assertion Enabled */ +#define SH_FSB_SYSTEM_AGENT_CONFIG_RCNT_SCNT_EN_SHFT 0 +#define SH_FSB_SYSTEM_AGENT_CONFIG_RCNT_SCNT_EN_MASK 0x0000000000000001 + +/* SH_FSB_SYSTEM_AGENT_CONFIG_BERR_ASSERT_EN */ +/* Description: BERR Assertion Enabled for Bus Errors */ +#define SH_FSB_SYSTEM_AGENT_CONFIG_BERR_ASSERT_EN_SHFT 3 +#define SH_FSB_SYSTEM_AGENT_CONFIG_BERR_ASSERT_EN_MASK 0x0000000000000008 + +/* SH_FSB_SYSTEM_AGENT_CONFIG_BERR_SAMPLING_EN */ +/* Description: BERR Sampling Enabled */ +#define SH_FSB_SYSTEM_AGENT_CONFIG_BERR_SAMPLING_EN_SHFT 4 +#define SH_FSB_SYSTEM_AGENT_CONFIG_BERR_SAMPLING_EN_MASK 0x0000000000000010 + +/* SH_FSB_SYSTEM_AGENT_CONFIG_BINIT_ASSERT_EN */ +/* Description: BINIT Assertion Enabled */ +#define SH_FSB_SYSTEM_AGENT_CONFIG_BINIT_ASSERT_EN_SHFT 5 +#define SH_FSB_SYSTEM_AGENT_CONFIG_BINIT_ASSERT_EN_MASK 0x0000000000000020 + +/* SH_FSB_SYSTEM_AGENT_CONFIG_BNR_THROTTLING_EN */ +/* Description: stutter FSB request assertion */ +#define SH_FSB_SYSTEM_AGENT_CONFIG_BNR_THROTTLING_EN_SHFT 6 +#define SH_FSB_SYSTEM_AGENT_CONFIG_BNR_THROTTLING_EN_MASK 0x0000000000000040 + +/* SH_FSB_SYSTEM_AGENT_CONFIG_SHORT_HANG_EN */ +/* Description: use short duration hang timeout */ +#define SH_FSB_SYSTEM_AGENT_CONFIG_SHORT_HANG_EN_SHFT 7 +#define SH_FSB_SYSTEM_AGENT_CONFIG_SHORT_HANG_EN_MASK 0x0000000000000080 + +/* SH_FSB_SYSTEM_AGENT_CONFIG_INTA_RSP_DATA */ +/* Description: Interrupt Acknowledge Response Data */ +#define SH_FSB_SYSTEM_AGENT_CONFIG_INTA_RSP_DATA_SHFT 8 +#define SH_FSB_SYSTEM_AGENT_CONFIG_INTA_RSP_DATA_MASK 0x000000000000ff00 + +/* SH_FSB_SYSTEM_AGENT_CONFIG_IO_TRANS_RSP */ +/* Description: IO Transaction Response */ +#define SH_FSB_SYSTEM_AGENT_CONFIG_IO_TRANS_RSP_SHFT 16 +#define SH_FSB_SYSTEM_AGENT_CONFIG_IO_TRANS_RSP_MASK 0x0000000000010000 + +/* SH_FSB_SYSTEM_AGENT_CONFIG_XTPR_TRANS_RSP */ +/* Description: External Task Priority Register (xTPR) Transaction */ +/* Response */ +#define SH_FSB_SYSTEM_AGENT_CONFIG_XTPR_TRANS_RSP_SHFT 17 +#define SH_FSB_SYSTEM_AGENT_CONFIG_XTPR_TRANS_RSP_MASK 0x0000000000020000 + +/* SH_FSB_SYSTEM_AGENT_CONFIG_INTA_TRANS_RSP */ +/* Description: Interrupt Acknowledge Transaction Response */ +#define SH_FSB_SYSTEM_AGENT_CONFIG_INTA_TRANS_RSP_SHFT 18 +#define SH_FSB_SYSTEM_AGENT_CONFIG_INTA_TRANS_RSP_MASK 0x0000000000040000 + +/* SH_FSB_SYSTEM_AGENT_CONFIG_TDOT */ +/* Description: Throttle Data-bus Ownership Transitions */ +#define SH_FSB_SYSTEM_AGENT_CONFIG_TDOT_SHFT 23 +#define SH_FSB_SYSTEM_AGENT_CONFIG_TDOT_MASK 0x0000000000800000 + +/* SH_FSB_SYSTEM_AGENT_CONFIG_SERIALIZE_FSB_EN */ +/* Description: serialize processor transactions */ +#define SH_FSB_SYSTEM_AGENT_CONFIG_SERIALIZE_FSB_EN_SHFT 24 +#define SH_FSB_SYSTEM_AGENT_CONFIG_SERIALIZE_FSB_EN_MASK 0x0000000001000000 + +/* SH_FSB_SYSTEM_AGENT_CONFIG_BINIT_EVENT_ENABLES */ +/* Description: FSB error binit enables */ +#define SH_FSB_SYSTEM_AGENT_CONFIG_BINIT_EVENT_ENABLES_SHFT 32 +#define SH_FSB_SYSTEM_AGENT_CONFIG_BINIT_EVENT_ENABLES_MASK 0x00003fff00000000 + +/* ==================================================================== */ +/* Register "SH_FSB_VGA_REMAP" */ +/* FSB VGA Address Space Remap */ +/* ==================================================================== */ + +#define SH_FSB_VGA_REMAP 0x0000000120010180 +#define SH_FSB_VGA_REMAP_MASK 0x4001fffffffe0000 +#define SH_FSB_VGA_REMAP_INIT 0x0000000000000000 + +/* SH_FSB_VGA_REMAP_OFFSET */ +/* Description: VGA Remap Node Offset */ +#define SH_FSB_VGA_REMAP_OFFSET_SHFT 17 +#define SH_FSB_VGA_REMAP_OFFSET_MASK 0x0000000ffffe0000 + +/* SH_FSB_VGA_REMAP_ASID */ +/* Description: VGA Remap Address Space ID */ +#define SH_FSB_VGA_REMAP_ASID_SHFT 36 +#define SH_FSB_VGA_REMAP_ASID_MASK 0x0000003000000000 + +/* SH_FSB_VGA_REMAP_NID */ +/* Description: VGA Remap Node ID */ +#define SH_FSB_VGA_REMAP_NID_SHFT 38 +#define SH_FSB_VGA_REMAP_NID_MASK 0x0001ffc000000000 + +/* SH_FSB_VGA_REMAP_VGA_REMAPPING_ENABLED */ +/* Description: VGA Remapping Enabled */ +#define SH_FSB_VGA_REMAP_VGA_REMAPPING_ENABLED_SHFT 62 +#define SH_FSB_VGA_REMAP_VGA_REMAPPING_ENABLED_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_FSB_RESET_STATUS" */ +/* FSB Reset Status */ +/* ==================================================================== */ + +#define SH_FSB_RESET_STATUS 0x0000000120020000 +#define SH_FSB_RESET_STATUS_MASK 0x0000000000000001 +#define SH_FSB_RESET_STATUS_INIT 0x0000000000000000 + +/* SH_FSB_RESET_STATUS_RESET_IN_PROGRESS */ +/* Description: Reset in Progress */ +#define SH_FSB_RESET_STATUS_RESET_IN_PROGRESS_SHFT 0 +#define SH_FSB_RESET_STATUS_RESET_IN_PROGRESS_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_FSB_SYMMETRIC_AGENT_STATUS" */ +/* FSB Symmetric Agent Status */ +/* ==================================================================== */ + +#define SH_FSB_SYMMETRIC_AGENT_STATUS 0x0000000120020080 +#define SH_FSB_SYMMETRIC_AGENT_STATUS_MASK 0x0000000000000007 +#define SH_FSB_SYMMETRIC_AGENT_STATUS_INIT 0x0000000000000000 + +/* SH_FSB_SYMMETRIC_AGENT_STATUS_CPU_0_ACTIVE */ +/* Description: CPU 0 Active. */ +#define SH_FSB_SYMMETRIC_AGENT_STATUS_CPU_0_ACTIVE_SHFT 0 +#define SH_FSB_SYMMETRIC_AGENT_STATUS_CPU_0_ACTIVE_MASK 0x0000000000000001 + +/* SH_FSB_SYMMETRIC_AGENT_STATUS_CPU_1_ACTIVE */ +/* Description: CPU 1 Active. */ +#define SH_FSB_SYMMETRIC_AGENT_STATUS_CPU_1_ACTIVE_SHFT 1 +#define SH_FSB_SYMMETRIC_AGENT_STATUS_CPU_1_ACTIVE_MASK 0x0000000000000002 + +/* SH_FSB_SYMMETRIC_AGENT_STATUS_CPUS_READY */ +/* Description: The Processors are Ready */ +#define SH_FSB_SYMMETRIC_AGENT_STATUS_CPUS_READY_SHFT 2 +#define SH_FSB_SYMMETRIC_AGENT_STATUS_CPUS_READY_MASK 0x0000000000000004 + +/* ==================================================================== */ +/* Register "SH_GFX_CREDIT_COUNT_0" */ +/* Graphics-write Credit Count for CPU 0 */ +/* ==================================================================== */ + +#define SH_GFX_CREDIT_COUNT_0 0x0000000120030000 +#define SH_GFX_CREDIT_COUNT_0_MASK 0x80000000000fffff +#define SH_GFX_CREDIT_COUNT_0_INIT 0x000000000000003f + +/* SH_GFX_CREDIT_COUNT_0_COUNT */ +/* Description: Credit Count */ +#define SH_GFX_CREDIT_COUNT_0_COUNT_SHFT 0 +#define SH_GFX_CREDIT_COUNT_0_COUNT_MASK 0x00000000000fffff + +/* SH_GFX_CREDIT_COUNT_0_RESET_GFX_STATE */ +/* Description: Reset GFX state */ +#define SH_GFX_CREDIT_COUNT_0_RESET_GFX_STATE_SHFT 63 +#define SH_GFX_CREDIT_COUNT_0_RESET_GFX_STATE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_GFX_CREDIT_COUNT_1" */ +/* Graphics-write Credit Count for CPU 1 */ +/* ==================================================================== */ + +#define SH_GFX_CREDIT_COUNT_1 0x0000000120030080 +#define SH_GFX_CREDIT_COUNT_1_MASK 0x80000000000fffff +#define SH_GFX_CREDIT_COUNT_1_INIT 0x000000000000003f + +/* SH_GFX_CREDIT_COUNT_1_COUNT */ +/* Description: Credit Count */ +#define SH_GFX_CREDIT_COUNT_1_COUNT_SHFT 0 +#define SH_GFX_CREDIT_COUNT_1_COUNT_MASK 0x00000000000fffff + +/* SH_GFX_CREDIT_COUNT_1_RESET_GFX_STATE */ +/* Description: Reset GFX state */ +#define SH_GFX_CREDIT_COUNT_1_RESET_GFX_STATE_SHFT 63 +#define SH_GFX_CREDIT_COUNT_1_RESET_GFX_STATE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_GFX_MODE_CNTRL_0" */ +/* Graphics credit mode amd message ordering for CPU 0 */ +/* ==================================================================== */ + +#define SH_GFX_MODE_CNTRL_0 0x0000000120030100 +#define SH_GFX_MODE_CNTRL_0_MASK 0x0000000000000007 +#define SH_GFX_MODE_CNTRL_0_INIT 0x0000000000000003 + +/* SH_GFX_MODE_CNTRL_0_DWORD_CREDITS */ +/* Description: GFX credits are tracked by D-words */ +#define SH_GFX_MODE_CNTRL_0_DWORD_CREDITS_SHFT 0 +#define SH_GFX_MODE_CNTRL_0_DWORD_CREDITS_MASK 0x0000000000000001 + +/* SH_GFX_MODE_CNTRL_0_MIXED_MODE_CREDITS */ +/* Description: GFX credits are tracked by D-words and messages */ +#define SH_GFX_MODE_CNTRL_0_MIXED_MODE_CREDITS_SHFT 1 +#define SH_GFX_MODE_CNTRL_0_MIXED_MODE_CREDITS_MASK 0x0000000000000002 + +/* SH_GFX_MODE_CNTRL_0_RELAXED_ORDERING */ +/* Description: GFX message routing order */ +#define SH_GFX_MODE_CNTRL_0_RELAXED_ORDERING_SHFT 2 +#define SH_GFX_MODE_CNTRL_0_RELAXED_ORDERING_MASK 0x0000000000000004 + +/* ==================================================================== */ +/* Register "SH_GFX_MODE_CNTRL_1" */ +/* Graphics credit mode amd message ordering for CPU 1 */ +/* ==================================================================== */ + +#define SH_GFX_MODE_CNTRL_1 0x0000000120030180 +#define SH_GFX_MODE_CNTRL_1_MASK 0x0000000000000007 +#define SH_GFX_MODE_CNTRL_1_INIT 0x0000000000000003 + +/* SH_GFX_MODE_CNTRL_1_DWORD_CREDITS */ +/* Description: GFX credits are tracked by D-words */ +#define SH_GFX_MODE_CNTRL_1_DWORD_CREDITS_SHFT 0 +#define SH_GFX_MODE_CNTRL_1_DWORD_CREDITS_MASK 0x0000000000000001 + +/* SH_GFX_MODE_CNTRL_1_MIXED_MODE_CREDITS */ +/* Description: GFX credits are tracked by D-words and messages */ +#define SH_GFX_MODE_CNTRL_1_MIXED_MODE_CREDITS_SHFT 1 +#define SH_GFX_MODE_CNTRL_1_MIXED_MODE_CREDITS_MASK 0x0000000000000002 + +/* SH_GFX_MODE_CNTRL_1_RELAXED_ORDERING */ +/* Description: GFX message routing order */ +#define SH_GFX_MODE_CNTRL_1_RELAXED_ORDERING_SHFT 2 +#define SH_GFX_MODE_CNTRL_1_RELAXED_ORDERING_MASK 0x0000000000000004 + +/* ==================================================================== */ +/* Register "SH_GFX_SKID_CREDIT_COUNT_0" */ +/* Graphics-write Skid Credit Count for CPU 0 */ +/* ==================================================================== */ + +#define SH_GFX_SKID_CREDIT_COUNT_0 0x0000000120030200 +#define SH_GFX_SKID_CREDIT_COUNT_0_MASK 0x00000000000fffff +#define SH_GFX_SKID_CREDIT_COUNT_0_INIT 0x0000000000000030 + +/* SH_GFX_SKID_CREDIT_COUNT_0_SKID */ +/* Description: Skid Credit Count */ +#define SH_GFX_SKID_CREDIT_COUNT_0_SKID_SHFT 0 +#define SH_GFX_SKID_CREDIT_COUNT_0_SKID_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_GFX_SKID_CREDIT_COUNT_1" */ +/* Graphics-write Skid Credit Count for CPU 1 */ +/* ==================================================================== */ + +#define SH_GFX_SKID_CREDIT_COUNT_1 0x0000000120030280 +#define SH_GFX_SKID_CREDIT_COUNT_1_MASK 0x00000000000fffff +#define SH_GFX_SKID_CREDIT_COUNT_1_INIT 0x0000000000000030 + +/* SH_GFX_SKID_CREDIT_COUNT_1_SKID */ +/* Description: Skid Credit Count */ +#define SH_GFX_SKID_CREDIT_COUNT_1_SKID_SHFT 0 +#define SH_GFX_SKID_CREDIT_COUNT_1_SKID_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_GFX_STALL_LIMIT_0" */ +/* Graphics-write Stall Limit for CPU 0 */ +/* ==================================================================== */ + +#define SH_GFX_STALL_LIMIT_0 0x0000000120030300 +#define SH_GFX_STALL_LIMIT_0_MASK 0x0000000003ffffff +#define SH_GFX_STALL_LIMIT_0_INIT 0x0000000000010000 + +/* SH_GFX_STALL_LIMIT_0_LIMIT */ +/* Description: Graphics Stall Limit for CPU 0 */ +#define SH_GFX_STALL_LIMIT_0_LIMIT_SHFT 0 +#define SH_GFX_STALL_LIMIT_0_LIMIT_MASK 0x0000000003ffffff + +/* ==================================================================== */ +/* Register "SH_GFX_STALL_LIMIT_1" */ +/* Graphics-write Stall Limit for CPU 1 */ +/* ==================================================================== */ + +#define SH_GFX_STALL_LIMIT_1 0x0000000120030380 +#define SH_GFX_STALL_LIMIT_1_MASK 0x0000000003ffffff +#define SH_GFX_STALL_LIMIT_1_INIT 0x0000000000010000 + +/* SH_GFX_STALL_LIMIT_1_LIMIT */ +/* Description: Graphics Stall Limit for CPU 1 */ +#define SH_GFX_STALL_LIMIT_1_LIMIT_SHFT 0 +#define SH_GFX_STALL_LIMIT_1_LIMIT_MASK 0x0000000003ffffff + +/* ==================================================================== */ +/* Register "SH_GFX_STALL_TIMER_0" */ +/* Graphics-write Stall Timer for CPU 0 */ +/* ==================================================================== */ + +#define SH_GFX_STALL_TIMER_0 0x0000000120030400 +#define SH_GFX_STALL_TIMER_0_MASK 0x0000000003ffffff +#define SH_GFX_STALL_TIMER_0_INIT 0x0000000000000000 + +/* SH_GFX_STALL_TIMER_0_TIMER_VALUE */ +/* Description: Timer Value */ +#define SH_GFX_STALL_TIMER_0_TIMER_VALUE_SHFT 0 +#define SH_GFX_STALL_TIMER_0_TIMER_VALUE_MASK 0x0000000003ffffff + +/* ==================================================================== */ +/* Register "SH_GFX_STALL_TIMER_1" */ +/* Graphics-write Stall Timer for CPU 1 */ +/* ==================================================================== */ + +#define SH_GFX_STALL_TIMER_1 0x0000000120030480 +#define SH_GFX_STALL_TIMER_1_MASK 0x0000000003ffffff +#define SH_GFX_STALL_TIMER_1_INIT 0x0000000000000000 + +/* SH_GFX_STALL_TIMER_1_TIMER_VALUE */ +/* Description: Timer Value */ +#define SH_GFX_STALL_TIMER_1_TIMER_VALUE_SHFT 0 +#define SH_GFX_STALL_TIMER_1_TIMER_VALUE_MASK 0x0000000003ffffff + +/* ==================================================================== */ +/* Register "SH_GFX_WINDOW_0" */ +/* Graphics-write Window for CPU 0 */ +/* ==================================================================== */ + +#define SH_GFX_WINDOW_0 0x0000000120030500 +#define SH_GFX_WINDOW_0_MASK 0x8000000fff000000 +#define SH_GFX_WINDOW_0_INIT 0x0000000000000000 + +/* SH_GFX_WINDOW_0_BASE_ADDR */ +/* Description: Base Address for CPU 0's 16 MB Graphics Window */ +#define SH_GFX_WINDOW_0_BASE_ADDR_SHFT 24 +#define SH_GFX_WINDOW_0_BASE_ADDR_MASK 0x0000000fff000000 + +/* SH_GFX_WINDOW_0_GFX_WINDOW_EN */ +/* Description: Graphics Window Enabled */ +#define SH_GFX_WINDOW_0_GFX_WINDOW_EN_SHFT 63 +#define SH_GFX_WINDOW_0_GFX_WINDOW_EN_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_GFX_WINDOW_1" */ +/* Graphics-write Window for CPU 1 */ +/* ==================================================================== */ + +#define SH_GFX_WINDOW_1 0x0000000120030580 +#define SH_GFX_WINDOW_1_MASK 0x8000000fff000000 +#define SH_GFX_WINDOW_1_INIT 0x0000000000000000 + +/* SH_GFX_WINDOW_1_BASE_ADDR */ +/* Description: Base Address for CPU 1's 16 MB Graphics Window */ +#define SH_GFX_WINDOW_1_BASE_ADDR_SHFT 24 +#define SH_GFX_WINDOW_1_BASE_ADDR_MASK 0x0000000fff000000 + +/* SH_GFX_WINDOW_1_GFX_WINDOW_EN */ +/* Description: Graphics Window Enabled */ +#define SH_GFX_WINDOW_1_GFX_WINDOW_EN_SHFT 63 +#define SH_GFX_WINDOW_1_GFX_WINDOW_EN_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_GFX_INTERRUPT_TIMER_LIMIT_0" */ +/* Graphics-write Interrupt Limit for CPU 0 */ +/* ==================================================================== */ + +#define SH_GFX_INTERRUPT_TIMER_LIMIT_0 0x0000000120030600 +#define SH_GFX_INTERRUPT_TIMER_LIMIT_0_MASK 0x00000000000000ff +#define SH_GFX_INTERRUPT_TIMER_LIMIT_0_INIT 0x0000000000000040 + +/* SH_GFX_INTERRUPT_TIMER_LIMIT_0_INTERRUPT_TIMER_LIMIT */ +/* Description: GFX Interrupt Timer Limit */ +#define SH_GFX_INTERRUPT_TIMER_LIMIT_0_INTERRUPT_TIMER_LIMIT_SHFT 0 +#define SH_GFX_INTERRUPT_TIMER_LIMIT_0_INTERRUPT_TIMER_LIMIT_MASK 0x00000000000000ff + +/* ==================================================================== */ +/* Register "SH_GFX_INTERRUPT_TIMER_LIMIT_1" */ +/* Graphics-write Interrupt Limit for CPU 1 */ +/* ==================================================================== */ + +#define SH_GFX_INTERRUPT_TIMER_LIMIT_1 0x0000000120030680 +#define SH_GFX_INTERRUPT_TIMER_LIMIT_1_MASK 0x00000000000000ff +#define SH_GFX_INTERRUPT_TIMER_LIMIT_1_INIT 0x0000000000000040 + +/* SH_GFX_INTERRUPT_TIMER_LIMIT_1_INTERRUPT_TIMER_LIMIT */ +/* Description: GFX Interrupt Timer Limit */ +#define SH_GFX_INTERRUPT_TIMER_LIMIT_1_INTERRUPT_TIMER_LIMIT_SHFT 0 +#define SH_GFX_INTERRUPT_TIMER_LIMIT_1_INTERRUPT_TIMER_LIMIT_MASK 0x00000000000000ff + +/* ==================================================================== */ +/* Register "SH_GFX_WRITE_STATUS_0" */ +/* Graphics Write Status for CPU 0 */ +/* ==================================================================== */ + +#define SH_GFX_WRITE_STATUS_0 0x0000000120040000 +#define SH_GFX_WRITE_STATUS_0_MASK 0x8000000000000001 +#define SH_GFX_WRITE_STATUS_0_INIT 0x0000000000000000 + +/* SH_GFX_WRITE_STATUS_0_BUSY */ +/* Description: Busy */ +#define SH_GFX_WRITE_STATUS_0_BUSY_SHFT 0 +#define SH_GFX_WRITE_STATUS_0_BUSY_MASK 0x0000000000000001 + +/* SH_GFX_WRITE_STATUS_0_RE_ENABLE_GFX_STALL */ +/* Description: Re-enable GFX stall logic for this processor */ +#define SH_GFX_WRITE_STATUS_0_RE_ENABLE_GFX_STALL_SHFT 63 +#define SH_GFX_WRITE_STATUS_0_RE_ENABLE_GFX_STALL_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_GFX_WRITE_STATUS_1" */ +/* Graphics Write Status for CPU 1 */ +/* ==================================================================== */ + +#define SH_GFX_WRITE_STATUS_1 0x0000000120040080 +#define SH_GFX_WRITE_STATUS_1_MASK 0x8000000000000001 +#define SH_GFX_WRITE_STATUS_1_INIT 0x0000000000000000 + +/* SH_GFX_WRITE_STATUS_1_BUSY */ +/* Description: Busy */ +#define SH_GFX_WRITE_STATUS_1_BUSY_SHFT 0 +#define SH_GFX_WRITE_STATUS_1_BUSY_MASK 0x0000000000000001 + +/* SH_GFX_WRITE_STATUS_1_RE_ENABLE_GFX_STALL */ +/* Description: Re-enable GFX stall logic for this processor */ +#define SH_GFX_WRITE_STATUS_1_RE_ENABLE_GFX_STALL_SHFT 63 +#define SH_GFX_WRITE_STATUS_1_RE_ENABLE_GFX_STALL_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_II_INT0" */ +/* SHub II Interrupt 0 Registers */ +/* ==================================================================== */ + +#define SH_II_INT0 0x0000000110000000 +#define SH_II_INT0_MASK 0x00000000000001ff +#define SH_II_INT0_INIT 0x0000000000000000 + +/* SH_II_INT0_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_II_INT0_IDX_SHFT 0 +#define SH_II_INT0_IDX_MASK 0x00000000000000ff + +/* SH_II_INT0_SEND */ +/* Description: Send Interrupt Message to PI, This generates a puls */ +#define SH_II_INT0_SEND_SHFT 8 +#define SH_II_INT0_SEND_MASK 0x0000000000000100 + +/* ==================================================================== */ +/* Register "SH_II_INT0_CONFIG" */ +/* SHub II Interrupt 0 Config Registers */ +/* ==================================================================== */ + +#define SH_II_INT0_CONFIG 0x0000000110000080 +#define SH_II_INT0_CONFIG_MASK 0x0003ffffffefffff +#define SH_II_INT0_CONFIG_INIT 0x0000000000000000 + +/* SH_II_INT0_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_II_INT0_CONFIG_TYPE_SHFT 0 +#define SH_II_INT0_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_II_INT0_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_II_INT0_CONFIG_AGT_SHFT 3 +#define SH_II_INT0_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_II_INT0_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_II_INT0_CONFIG_PID_SHFT 4 +#define SH_II_INT0_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_II_INT0_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_II_INT0_CONFIG_BASE_SHFT 21 +#define SH_II_INT0_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* ==================================================================== */ +/* Register "SH_II_INT0_ENABLE" */ +/* SHub II Interrupt 0 Enable Registers */ +/* ==================================================================== */ + +#define SH_II_INT0_ENABLE 0x0000000110000200 +#define SH_II_INT0_ENABLE_MASK 0x0000000000000001 +#define SH_II_INT0_ENABLE_INIT 0x0000000000000000 + +/* SH_II_INT0_ENABLE_II_ENABLE */ +/* Description: Enable II Interrupt */ +#define SH_II_INT0_ENABLE_II_ENABLE_SHFT 0 +#define SH_II_INT0_ENABLE_II_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_II_INT1" */ +/* SHub II Interrupt 1 Registers */ +/* ==================================================================== */ + +#define SH_II_INT1 0x0000000110000100 +#define SH_II_INT1_MASK 0x00000000000001ff +#define SH_II_INT1_INIT 0x0000000000000000 + +/* SH_II_INT1_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_II_INT1_IDX_SHFT 0 +#define SH_II_INT1_IDX_MASK 0x00000000000000ff + +/* SH_II_INT1_SEND */ +/* Description: Send Interrupt Message to PI, This generates a puls */ +#define SH_II_INT1_SEND_SHFT 8 +#define SH_II_INT1_SEND_MASK 0x0000000000000100 + +/* ==================================================================== */ +/* Register "SH_II_INT1_CONFIG" */ +/* SHub II Interrupt 1 Config Registers */ +/* ==================================================================== */ + +#define SH_II_INT1_CONFIG 0x0000000110000180 +#define SH_II_INT1_CONFIG_MASK 0x0003ffffffefffff +#define SH_II_INT1_CONFIG_INIT 0x0000000000000000 + +/* SH_II_INT1_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_II_INT1_CONFIG_TYPE_SHFT 0 +#define SH_II_INT1_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_II_INT1_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_II_INT1_CONFIG_AGT_SHFT 3 +#define SH_II_INT1_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_II_INT1_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_II_INT1_CONFIG_PID_SHFT 4 +#define SH_II_INT1_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_II_INT1_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_II_INT1_CONFIG_BASE_SHFT 21 +#define SH_II_INT1_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* ==================================================================== */ +/* Register "SH_II_INT1_ENABLE" */ +/* SHub II Interrupt 1 Enable Registers */ +/* ==================================================================== */ + +#define SH_II_INT1_ENABLE 0x0000000110000280 +#define SH_II_INT1_ENABLE_MASK 0x0000000000000001 +#define SH_II_INT1_ENABLE_INIT 0x0000000000000000 + +/* SH_II_INT1_ENABLE_II_ENABLE */ +/* Description: Enable II 1 Interrupt */ +#define SH_II_INT1_ENABLE_II_ENABLE_SHFT 0 +#define SH_II_INT1_ENABLE_II_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_INT_NODE_ID_CONFIG" */ +/* SHub Interrupt Node ID Configuration */ +/* ==================================================================== */ + +#define SH_INT_NODE_ID_CONFIG 0x0000000110000300 +#define SH_INT_NODE_ID_CONFIG_MASK 0x0000000000000fff +#define SH_INT_NODE_ID_CONFIG_INIT 0x0000000000000000 + +/* SH_INT_NODE_ID_CONFIG_NODE_ID */ +/* Description: Node ID for interrupt messages */ +#define SH_INT_NODE_ID_CONFIG_NODE_ID_SHFT 0 +#define SH_INT_NODE_ID_CONFIG_NODE_ID_MASK 0x00000000000007ff + +/* SH_INT_NODE_ID_CONFIG_ID_SEL */ +/* Description: Select node id for interrupt messages */ +#define SH_INT_NODE_ID_CONFIG_ID_SEL_SHFT 11 +#define SH_INT_NODE_ID_CONFIG_ID_SEL_MASK 0x0000000000000800 + +/* ==================================================================== */ +/* Register "SH_IPI_INT" */ +/* SHub Inter-Processor Interrupt Registers */ +/* ==================================================================== */ + +#define SH_IPI_INT 0x0000000110000380 +#define SH_IPI_INT_MASK 0x8ff3ffffffefffff +#define SH_IPI_INT_INIT 0x0000000000000000 + +/* SH_IPI_INT_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_IPI_INT_TYPE_SHFT 0 +#define SH_IPI_INT_TYPE_MASK 0x0000000000000007 + +/* SH_IPI_INT_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_IPI_INT_AGT_SHFT 3 +#define SH_IPI_INT_AGT_MASK 0x0000000000000008 + +/* SH_IPI_INT_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_IPI_INT_PID_SHFT 4 +#define SH_IPI_INT_PID_MASK 0x00000000000ffff0 + +/* SH_IPI_INT_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_IPI_INT_BASE_SHFT 21 +#define SH_IPI_INT_BASE_MASK 0x0003ffffffe00000 + +/* SH_IPI_INT_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_IPI_INT_IDX_SHFT 52 +#define SH_IPI_INT_IDX_MASK 0x0ff0000000000000 + +/* SH_IPI_INT_SEND */ +/* Description: Send Interrupt Message to PI, This generates a puls */ +#define SH_IPI_INT_SEND_SHFT 63 +#define SH_IPI_INT_SEND_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_IPI_INT_ENABLE" */ +/* SHub Inter-Processor Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_IPI_INT_ENABLE 0x0000000110000400 +#define SH_IPI_INT_ENABLE_MASK 0x0000000000000001 +#define SH_IPI_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_IPI_INT_ENABLE_PIO_ENABLE */ +/* Description: Enable PIO Interrupt */ +#define SH_IPI_INT_ENABLE_PIO_ENABLE_SHFT 0 +#define SH_IPI_INT_ENABLE_PIO_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT0_CONFIG" */ +/* SHub Local Interrupt 0 Registers */ +/* ==================================================================== */ + +#define SH_LOCAL_INT0_CONFIG 0x0000000110000480 +#define SH_LOCAL_INT0_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_LOCAL_INT0_CONFIG_INIT 0x0000000000000000 + +/* SH_LOCAL_INT0_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_LOCAL_INT0_CONFIG_TYPE_SHFT 0 +#define SH_LOCAL_INT0_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_LOCAL_INT0_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_LOCAL_INT0_CONFIG_AGT_SHFT 3 +#define SH_LOCAL_INT0_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_LOCAL_INT0_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_LOCAL_INT0_CONFIG_PID_SHFT 4 +#define SH_LOCAL_INT0_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_LOCAL_INT0_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_LOCAL_INT0_CONFIG_BASE_SHFT 21 +#define SH_LOCAL_INT0_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_LOCAL_INT0_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_LOCAL_INT0_CONFIG_IDX_SHFT 52 +#define SH_LOCAL_INT0_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT0_ENABLE" */ +/* SHub Local Interrupt 0 Enable */ +/* ==================================================================== */ + +#define SH_LOCAL_INT0_ENABLE 0x0000000110000500 +#define SH_LOCAL_INT0_ENABLE_MASK 0x000000000000f7ff +#define SH_LOCAL_INT0_ENABLE_INIT 0x0000000000000000 + +/* SH_LOCAL_INT0_ENABLE_PI_HW_INT */ +/* Description: Enable PI Hardware interrupt */ +#define SH_LOCAL_INT0_ENABLE_PI_HW_INT_SHFT 0 +#define SH_LOCAL_INT0_ENABLE_PI_HW_INT_MASK 0x0000000000000001 + +/* SH_LOCAL_INT0_ENABLE_MD_HW_INT */ +/* Description: Enable MD Hardware interrupt */ +#define SH_LOCAL_INT0_ENABLE_MD_HW_INT_SHFT 1 +#define SH_LOCAL_INT0_ENABLE_MD_HW_INT_MASK 0x0000000000000002 + +/* SH_LOCAL_INT0_ENABLE_XN_HW_INT */ +/* Description: Enable XN Hardware interrupt */ +#define SH_LOCAL_INT0_ENABLE_XN_HW_INT_SHFT 2 +#define SH_LOCAL_INT0_ENABLE_XN_HW_INT_MASK 0x0000000000000004 + +/* SH_LOCAL_INT0_ENABLE_LB_HW_INT */ +/* Description: Enable LB Hardware interrupt */ +#define SH_LOCAL_INT0_ENABLE_LB_HW_INT_SHFT 3 +#define SH_LOCAL_INT0_ENABLE_LB_HW_INT_MASK 0x0000000000000008 + +/* SH_LOCAL_INT0_ENABLE_II_HW_INT */ +/* Description: Enable II wrapper Hardware interrupt */ +#define SH_LOCAL_INT0_ENABLE_II_HW_INT_SHFT 4 +#define SH_LOCAL_INT0_ENABLE_II_HW_INT_MASK 0x0000000000000010 + +/* SH_LOCAL_INT0_ENABLE_PI_CE_INT */ +/* Description: Enable PI Correctable Error Interrupt */ +#define SH_LOCAL_INT0_ENABLE_PI_CE_INT_SHFT 5 +#define SH_LOCAL_INT0_ENABLE_PI_CE_INT_MASK 0x0000000000000020 + +/* SH_LOCAL_INT0_ENABLE_MD_CE_INT */ +/* Description: Enable MD Correctable Error Interrupt */ +#define SH_LOCAL_INT0_ENABLE_MD_CE_INT_SHFT 6 +#define SH_LOCAL_INT0_ENABLE_MD_CE_INT_MASK 0x0000000000000040 + +/* SH_LOCAL_INT0_ENABLE_XN_CE_INT */ +/* Description: Enable XN Correctable Error Interrupt */ +#define SH_LOCAL_INT0_ENABLE_XN_CE_INT_SHFT 7 +#define SH_LOCAL_INT0_ENABLE_XN_CE_INT_MASK 0x0000000000000080 + +/* SH_LOCAL_INT0_ENABLE_PI_UCE_INT */ +/* Description: Enable PI Correctable Error Interrupt */ +#define SH_LOCAL_INT0_ENABLE_PI_UCE_INT_SHFT 8 +#define SH_LOCAL_INT0_ENABLE_PI_UCE_INT_MASK 0x0000000000000100 + +/* SH_LOCAL_INT0_ENABLE_MD_UCE_INT */ +/* Description: Enable MD Correctable Error Interrupt */ +#define SH_LOCAL_INT0_ENABLE_MD_UCE_INT_SHFT 9 +#define SH_LOCAL_INT0_ENABLE_MD_UCE_INT_MASK 0x0000000000000200 + +/* SH_LOCAL_INT0_ENABLE_XN_UCE_INT */ +/* Description: Enable XN Correctable Error Interrupt */ +#define SH_LOCAL_INT0_ENABLE_XN_UCE_INT_SHFT 10 +#define SH_LOCAL_INT0_ENABLE_XN_UCE_INT_MASK 0x0000000000000400 + +/* SH_LOCAL_INT0_ENABLE_SYSTEM_SHUTDOWN_INT */ +/* Description: Enable System Shutdown Interrupt */ +#define SH_LOCAL_INT0_ENABLE_SYSTEM_SHUTDOWN_INT_SHFT 12 +#define SH_LOCAL_INT0_ENABLE_SYSTEM_SHUTDOWN_INT_MASK 0x0000000000001000 + +/* SH_LOCAL_INT0_ENABLE_UART_INT */ +/* Description: Enable Junk Bus UART Interrupt */ +#define SH_LOCAL_INT0_ENABLE_UART_INT_SHFT 13 +#define SH_LOCAL_INT0_ENABLE_UART_INT_MASK 0x0000000000002000 + +/* SH_LOCAL_INT0_ENABLE_L1_NMI_INT */ +/* Description: Enable L1 Controller NMI Interrupt */ +#define SH_LOCAL_INT0_ENABLE_L1_NMI_INT_SHFT 14 +#define SH_LOCAL_INT0_ENABLE_L1_NMI_INT_MASK 0x0000000000004000 + +/* SH_LOCAL_INT0_ENABLE_STOP_CLOCK */ +/* Description: Stop Clock Interrupt */ +#define SH_LOCAL_INT0_ENABLE_STOP_CLOCK_SHFT 15 +#define SH_LOCAL_INT0_ENABLE_STOP_CLOCK_MASK 0x0000000000008000 + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT1_CONFIG" */ +/* SHub Local Interrupt 1 Registers */ +/* ==================================================================== */ + +#define SH_LOCAL_INT1_CONFIG 0x0000000110000580 +#define SH_LOCAL_INT1_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_LOCAL_INT1_CONFIG_INIT 0x0000000000000000 + +/* SH_LOCAL_INT1_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_LOCAL_INT1_CONFIG_TYPE_SHFT 0 +#define SH_LOCAL_INT1_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_LOCAL_INT1_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_LOCAL_INT1_CONFIG_AGT_SHFT 3 +#define SH_LOCAL_INT1_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_LOCAL_INT1_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_LOCAL_INT1_CONFIG_PID_SHFT 4 +#define SH_LOCAL_INT1_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_LOCAL_INT1_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_LOCAL_INT1_CONFIG_BASE_SHFT 21 +#define SH_LOCAL_INT1_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_LOCAL_INT1_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_LOCAL_INT1_CONFIG_IDX_SHFT 52 +#define SH_LOCAL_INT1_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT1_ENABLE" */ +/* SHub Local Interrupt 1 Enable */ +/* ==================================================================== */ + +#define SH_LOCAL_INT1_ENABLE 0x0000000110000600 +#define SH_LOCAL_INT1_ENABLE_MASK 0x000000000000f7ff +#define SH_LOCAL_INT1_ENABLE_INIT 0x0000000000000000 + +/* SH_LOCAL_INT1_ENABLE_PI_HW_INT */ +/* Description: Enable PI Hardware interrupt */ +#define SH_LOCAL_INT1_ENABLE_PI_HW_INT_SHFT 0 +#define SH_LOCAL_INT1_ENABLE_PI_HW_INT_MASK 0x0000000000000001 + +/* SH_LOCAL_INT1_ENABLE_MD_HW_INT */ +/* Description: Enable MD Hardware interrupt */ +#define SH_LOCAL_INT1_ENABLE_MD_HW_INT_SHFT 1 +#define SH_LOCAL_INT1_ENABLE_MD_HW_INT_MASK 0x0000000000000002 + +/* SH_LOCAL_INT1_ENABLE_XN_HW_INT */ +/* Description: Enable XN Hardware interrupt */ +#define SH_LOCAL_INT1_ENABLE_XN_HW_INT_SHFT 2 +#define SH_LOCAL_INT1_ENABLE_XN_HW_INT_MASK 0x0000000000000004 + +/* SH_LOCAL_INT1_ENABLE_LB_HW_INT */ +/* Description: Enable LB Hardware interrupt */ +#define SH_LOCAL_INT1_ENABLE_LB_HW_INT_SHFT 3 +#define SH_LOCAL_INT1_ENABLE_LB_HW_INT_MASK 0x0000000000000008 + +/* SH_LOCAL_INT1_ENABLE_II_HW_INT */ +/* Description: Enable II wrapper Hardware interrupt */ +#define SH_LOCAL_INT1_ENABLE_II_HW_INT_SHFT 4 +#define SH_LOCAL_INT1_ENABLE_II_HW_INT_MASK 0x0000000000000010 + +/* SH_LOCAL_INT1_ENABLE_PI_CE_INT */ +/* Description: Enable PI Correctable Error Interrupt */ +#define SH_LOCAL_INT1_ENABLE_PI_CE_INT_SHFT 5 +#define SH_LOCAL_INT1_ENABLE_PI_CE_INT_MASK 0x0000000000000020 + +/* SH_LOCAL_INT1_ENABLE_MD_CE_INT */ +/* Description: Enable MD Correctable Error Interrupt */ +#define SH_LOCAL_INT1_ENABLE_MD_CE_INT_SHFT 6 +#define SH_LOCAL_INT1_ENABLE_MD_CE_INT_MASK 0x0000000000000040 + +/* SH_LOCAL_INT1_ENABLE_XN_CE_INT */ +/* Description: Enable XN Correctable Error Interrupt */ +#define SH_LOCAL_INT1_ENABLE_XN_CE_INT_SHFT 7 +#define SH_LOCAL_INT1_ENABLE_XN_CE_INT_MASK 0x0000000000000080 + +/* SH_LOCAL_INT1_ENABLE_PI_UCE_INT */ +/* Description: Enable PI Correctable Error Interrupt */ +#define SH_LOCAL_INT1_ENABLE_PI_UCE_INT_SHFT 8 +#define SH_LOCAL_INT1_ENABLE_PI_UCE_INT_MASK 0x0000000000000100 + +/* SH_LOCAL_INT1_ENABLE_MD_UCE_INT */ +/* Description: Enable MD Correctable Error Interrupt */ +#define SH_LOCAL_INT1_ENABLE_MD_UCE_INT_SHFT 9 +#define SH_LOCAL_INT1_ENABLE_MD_UCE_INT_MASK 0x0000000000000200 + +/* SH_LOCAL_INT1_ENABLE_XN_UCE_INT */ +/* Description: Enable XN Correctable Error Interrupt */ +#define SH_LOCAL_INT1_ENABLE_XN_UCE_INT_SHFT 10 +#define SH_LOCAL_INT1_ENABLE_XN_UCE_INT_MASK 0x0000000000000400 + +/* SH_LOCAL_INT1_ENABLE_SYSTEM_SHUTDOWN_INT */ +/* Description: Enable System Shutdown Interrupt */ +#define SH_LOCAL_INT1_ENABLE_SYSTEM_SHUTDOWN_INT_SHFT 12 +#define SH_LOCAL_INT1_ENABLE_SYSTEM_SHUTDOWN_INT_MASK 0x0000000000001000 + +/* SH_LOCAL_INT1_ENABLE_UART_INT */ +/* Description: Enable Junk Bus UART Interrupt */ +#define SH_LOCAL_INT1_ENABLE_UART_INT_SHFT 13 +#define SH_LOCAL_INT1_ENABLE_UART_INT_MASK 0x0000000000002000 + +/* SH_LOCAL_INT1_ENABLE_L1_NMI_INT */ +/* Description: Enable L1 Controller NMI Interrupt */ +#define SH_LOCAL_INT1_ENABLE_L1_NMI_INT_SHFT 14 +#define SH_LOCAL_INT1_ENABLE_L1_NMI_INT_MASK 0x0000000000004000 + +/* SH_LOCAL_INT1_ENABLE_STOP_CLOCK */ +/* Description: Stop Clock Interrupt */ +#define SH_LOCAL_INT1_ENABLE_STOP_CLOCK_SHFT 15 +#define SH_LOCAL_INT1_ENABLE_STOP_CLOCK_MASK 0x0000000000008000 + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT2_CONFIG" */ +/* SHub Local Interrupt 2 Registers */ +/* ==================================================================== */ + +#define SH_LOCAL_INT2_CONFIG 0x0000000110000680 +#define SH_LOCAL_INT2_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_LOCAL_INT2_CONFIG_INIT 0x0000000000000000 + +/* SH_LOCAL_INT2_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_LOCAL_INT2_CONFIG_TYPE_SHFT 0 +#define SH_LOCAL_INT2_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_LOCAL_INT2_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_LOCAL_INT2_CONFIG_AGT_SHFT 3 +#define SH_LOCAL_INT2_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_LOCAL_INT2_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_LOCAL_INT2_CONFIG_PID_SHFT 4 +#define SH_LOCAL_INT2_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_LOCAL_INT2_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_LOCAL_INT2_CONFIG_BASE_SHFT 21 +#define SH_LOCAL_INT2_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_LOCAL_INT2_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_LOCAL_INT2_CONFIG_IDX_SHFT 52 +#define SH_LOCAL_INT2_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT2_ENABLE" */ +/* SHub Local Interrupt 2 Enable */ +/* ==================================================================== */ + +#define SH_LOCAL_INT2_ENABLE 0x0000000110000700 +#define SH_LOCAL_INT2_ENABLE_MASK 0x000000000000f7ff +#define SH_LOCAL_INT2_ENABLE_INIT 0x0000000000000000 + +/* SH_LOCAL_INT2_ENABLE_PI_HW_INT */ +/* Description: Enable PI Hardware interrupt */ +#define SH_LOCAL_INT2_ENABLE_PI_HW_INT_SHFT 0 +#define SH_LOCAL_INT2_ENABLE_PI_HW_INT_MASK 0x0000000000000001 + +/* SH_LOCAL_INT2_ENABLE_MD_HW_INT */ +/* Description: Enable MD Hardware interrupt */ +#define SH_LOCAL_INT2_ENABLE_MD_HW_INT_SHFT 1 +#define SH_LOCAL_INT2_ENABLE_MD_HW_INT_MASK 0x0000000000000002 + +/* SH_LOCAL_INT2_ENABLE_XN_HW_INT */ +/* Description: Enable XN Hardware interrupt */ +#define SH_LOCAL_INT2_ENABLE_XN_HW_INT_SHFT 2 +#define SH_LOCAL_INT2_ENABLE_XN_HW_INT_MASK 0x0000000000000004 + +/* SH_LOCAL_INT2_ENABLE_LB_HW_INT */ +/* Description: Enable LB Hardware interrupt */ +#define SH_LOCAL_INT2_ENABLE_LB_HW_INT_SHFT 3 +#define SH_LOCAL_INT2_ENABLE_LB_HW_INT_MASK 0x0000000000000008 + +/* SH_LOCAL_INT2_ENABLE_II_HW_INT */ +/* Description: Enable II wrapper Hardware interrupt */ +#define SH_LOCAL_INT2_ENABLE_II_HW_INT_SHFT 4 +#define SH_LOCAL_INT2_ENABLE_II_HW_INT_MASK 0x0000000000000010 + +/* SH_LOCAL_INT2_ENABLE_PI_CE_INT */ +/* Description: Enable PI Correctable Error Interrupt */ +#define SH_LOCAL_INT2_ENABLE_PI_CE_INT_SHFT 5 +#define SH_LOCAL_INT2_ENABLE_PI_CE_INT_MASK 0x0000000000000020 + +/* SH_LOCAL_INT2_ENABLE_MD_CE_INT */ +/* Description: Enable MD Correctable Error Interrupt */ +#define SH_LOCAL_INT2_ENABLE_MD_CE_INT_SHFT 6 +#define SH_LOCAL_INT2_ENABLE_MD_CE_INT_MASK 0x0000000000000040 + +/* SH_LOCAL_INT2_ENABLE_XN_CE_INT */ +/* Description: Enable XN Correctable Error Interrupt */ +#define SH_LOCAL_INT2_ENABLE_XN_CE_INT_SHFT 7 +#define SH_LOCAL_INT2_ENABLE_XN_CE_INT_MASK 0x0000000000000080 + +/* SH_LOCAL_INT2_ENABLE_PI_UCE_INT */ +/* Description: Enable PI Correctable Error Interrupt */ +#define SH_LOCAL_INT2_ENABLE_PI_UCE_INT_SHFT 8 +#define SH_LOCAL_INT2_ENABLE_PI_UCE_INT_MASK 0x0000000000000100 + +/* SH_LOCAL_INT2_ENABLE_MD_UCE_INT */ +/* Description: Enable MD Correctable Error Interrupt */ +#define SH_LOCAL_INT2_ENABLE_MD_UCE_INT_SHFT 9 +#define SH_LOCAL_INT2_ENABLE_MD_UCE_INT_MASK 0x0000000000000200 + +/* SH_LOCAL_INT2_ENABLE_XN_UCE_INT */ +/* Description: Enable XN Correctable Error Interrupt */ +#define SH_LOCAL_INT2_ENABLE_XN_UCE_INT_SHFT 10 +#define SH_LOCAL_INT2_ENABLE_XN_UCE_INT_MASK 0x0000000000000400 + +/* SH_LOCAL_INT2_ENABLE_SYSTEM_SHUTDOWN_INT */ +/* Description: Enable System Shutdown Interrupt */ +#define SH_LOCAL_INT2_ENABLE_SYSTEM_SHUTDOWN_INT_SHFT 12 +#define SH_LOCAL_INT2_ENABLE_SYSTEM_SHUTDOWN_INT_MASK 0x0000000000001000 + +/* SH_LOCAL_INT2_ENABLE_UART_INT */ +/* Description: Enable Junk Bus UART Interrupt */ +#define SH_LOCAL_INT2_ENABLE_UART_INT_SHFT 13 +#define SH_LOCAL_INT2_ENABLE_UART_INT_MASK 0x0000000000002000 + +/* SH_LOCAL_INT2_ENABLE_L1_NMI_INT */ +/* Description: Enable L1 Controller NMI Interrupt */ +#define SH_LOCAL_INT2_ENABLE_L1_NMI_INT_SHFT 14 +#define SH_LOCAL_INT2_ENABLE_L1_NMI_INT_MASK 0x0000000000004000 + +/* SH_LOCAL_INT2_ENABLE_STOP_CLOCK */ +/* Description: Stop Clock Interrupt */ +#define SH_LOCAL_INT2_ENABLE_STOP_CLOCK_SHFT 15 +#define SH_LOCAL_INT2_ENABLE_STOP_CLOCK_MASK 0x0000000000008000 + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT3_CONFIG" */ +/* SHub Local Interrupt 3 Registers */ +/* ==================================================================== */ + +#define SH_LOCAL_INT3_CONFIG 0x0000000110000780 +#define SH_LOCAL_INT3_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_LOCAL_INT3_CONFIG_INIT 0x0000000000000000 + +/* SH_LOCAL_INT3_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_LOCAL_INT3_CONFIG_TYPE_SHFT 0 +#define SH_LOCAL_INT3_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_LOCAL_INT3_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_LOCAL_INT3_CONFIG_AGT_SHFT 3 +#define SH_LOCAL_INT3_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_LOCAL_INT3_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_LOCAL_INT3_CONFIG_PID_SHFT 4 +#define SH_LOCAL_INT3_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_LOCAL_INT3_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_LOCAL_INT3_CONFIG_BASE_SHFT 21 +#define SH_LOCAL_INT3_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_LOCAL_INT3_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_LOCAL_INT3_CONFIG_IDX_SHFT 52 +#define SH_LOCAL_INT3_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT3_ENABLE" */ +/* SHub Local Interrupt 3 Enable */ +/* ==================================================================== */ + +#define SH_LOCAL_INT3_ENABLE 0x0000000110000800 +#define SH_LOCAL_INT3_ENABLE_MASK 0x000000000000f7ff +#define SH_LOCAL_INT3_ENABLE_INIT 0x0000000000000000 + +/* SH_LOCAL_INT3_ENABLE_PI_HW_INT */ +/* Description: Enable PI Hardware interrupt */ +#define SH_LOCAL_INT3_ENABLE_PI_HW_INT_SHFT 0 +#define SH_LOCAL_INT3_ENABLE_PI_HW_INT_MASK 0x0000000000000001 + +/* SH_LOCAL_INT3_ENABLE_MD_HW_INT */ +/* Description: Enable MD Hardware interrupt */ +#define SH_LOCAL_INT3_ENABLE_MD_HW_INT_SHFT 1 +#define SH_LOCAL_INT3_ENABLE_MD_HW_INT_MASK 0x0000000000000002 + +/* SH_LOCAL_INT3_ENABLE_XN_HW_INT */ +/* Description: Enable XN Hardware interrupt */ +#define SH_LOCAL_INT3_ENABLE_XN_HW_INT_SHFT 2 +#define SH_LOCAL_INT3_ENABLE_XN_HW_INT_MASK 0x0000000000000004 + +/* SH_LOCAL_INT3_ENABLE_LB_HW_INT */ +/* Description: Enable LB Hardware interrupt */ +#define SH_LOCAL_INT3_ENABLE_LB_HW_INT_SHFT 3 +#define SH_LOCAL_INT3_ENABLE_LB_HW_INT_MASK 0x0000000000000008 + +/* SH_LOCAL_INT3_ENABLE_II_HW_INT */ +/* Description: Enable II wrapper Hardware interrupt */ +#define SH_LOCAL_INT3_ENABLE_II_HW_INT_SHFT 4 +#define SH_LOCAL_INT3_ENABLE_II_HW_INT_MASK 0x0000000000000010 + +/* SH_LOCAL_INT3_ENABLE_PI_CE_INT */ +/* Description: Enable PI Correctable Error Interrupt */ +#define SH_LOCAL_INT3_ENABLE_PI_CE_INT_SHFT 5 +#define SH_LOCAL_INT3_ENABLE_PI_CE_INT_MASK 0x0000000000000020 + +/* SH_LOCAL_INT3_ENABLE_MD_CE_INT */ +/* Description: Enable MD Correctable Error Interrupt */ +#define SH_LOCAL_INT3_ENABLE_MD_CE_INT_SHFT 6 +#define SH_LOCAL_INT3_ENABLE_MD_CE_INT_MASK 0x0000000000000040 + +/* SH_LOCAL_INT3_ENABLE_XN_CE_INT */ +/* Description: Enable XN Correctable Error Interrupt */ +#define SH_LOCAL_INT3_ENABLE_XN_CE_INT_SHFT 7 +#define SH_LOCAL_INT3_ENABLE_XN_CE_INT_MASK 0x0000000000000080 + +/* SH_LOCAL_INT3_ENABLE_PI_UCE_INT */ +/* Description: Enable PI Correctable Error Interrupt */ +#define SH_LOCAL_INT3_ENABLE_PI_UCE_INT_SHFT 8 +#define SH_LOCAL_INT3_ENABLE_PI_UCE_INT_MASK 0x0000000000000100 + +/* SH_LOCAL_INT3_ENABLE_MD_UCE_INT */ +/* Description: Enable MD Correctable Error Interrupt */ +#define SH_LOCAL_INT3_ENABLE_MD_UCE_INT_SHFT 9 +#define SH_LOCAL_INT3_ENABLE_MD_UCE_INT_MASK 0x0000000000000200 + +/* SH_LOCAL_INT3_ENABLE_XN_UCE_INT */ +/* Description: Enable XN Correctable Error Interrupt */ +#define SH_LOCAL_INT3_ENABLE_XN_UCE_INT_SHFT 10 +#define SH_LOCAL_INT3_ENABLE_XN_UCE_INT_MASK 0x0000000000000400 + +/* SH_LOCAL_INT3_ENABLE_SYSTEM_SHUTDOWN_INT */ +/* Description: Enable System Shutdown Interrupt */ +#define SH_LOCAL_INT3_ENABLE_SYSTEM_SHUTDOWN_INT_SHFT 12 +#define SH_LOCAL_INT3_ENABLE_SYSTEM_SHUTDOWN_INT_MASK 0x0000000000001000 + +/* SH_LOCAL_INT3_ENABLE_UART_INT */ +/* Description: Enable Junk Bus UART Interrupt */ +#define SH_LOCAL_INT3_ENABLE_UART_INT_SHFT 13 +#define SH_LOCAL_INT3_ENABLE_UART_INT_MASK 0x0000000000002000 + +/* SH_LOCAL_INT3_ENABLE_L1_NMI_INT */ +/* Description: Enable L1 Controller NMI Interrupt */ +#define SH_LOCAL_INT3_ENABLE_L1_NMI_INT_SHFT 14 +#define SH_LOCAL_INT3_ENABLE_L1_NMI_INT_MASK 0x0000000000004000 + +/* SH_LOCAL_INT3_ENABLE_STOP_CLOCK */ +/* Description: Stop Clock Interrupt */ +#define SH_LOCAL_INT3_ENABLE_STOP_CLOCK_SHFT 15 +#define SH_LOCAL_INT3_ENABLE_STOP_CLOCK_MASK 0x0000000000008000 + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT4_CONFIG" */ +/* SHub Local Interrupt 4 Registers */ +/* ==================================================================== */ + +#define SH_LOCAL_INT4_CONFIG 0x0000000110000880 +#define SH_LOCAL_INT4_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_LOCAL_INT4_CONFIG_INIT 0x0000000000000000 + +/* SH_LOCAL_INT4_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_LOCAL_INT4_CONFIG_TYPE_SHFT 0 +#define SH_LOCAL_INT4_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_LOCAL_INT4_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_LOCAL_INT4_CONFIG_AGT_SHFT 3 +#define SH_LOCAL_INT4_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_LOCAL_INT4_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_LOCAL_INT4_CONFIG_PID_SHFT 4 +#define SH_LOCAL_INT4_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_LOCAL_INT4_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_LOCAL_INT4_CONFIG_BASE_SHFT 21 +#define SH_LOCAL_INT4_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_LOCAL_INT4_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_LOCAL_INT4_CONFIG_IDX_SHFT 52 +#define SH_LOCAL_INT4_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT4_ENABLE" */ +/* SHub Local Interrupt 4 Enable */ +/* ==================================================================== */ + +#define SH_LOCAL_INT4_ENABLE 0x0000000110000900 +#define SH_LOCAL_INT4_ENABLE_MASK 0x000000000000f7ff +#define SH_LOCAL_INT4_ENABLE_INIT 0x0000000000000000 + +/* SH_LOCAL_INT4_ENABLE_PI_HW_INT */ +/* Description: Enable PI Hardware interrupt */ +#define SH_LOCAL_INT4_ENABLE_PI_HW_INT_SHFT 0 +#define SH_LOCAL_INT4_ENABLE_PI_HW_INT_MASK 0x0000000000000001 + +/* SH_LOCAL_INT4_ENABLE_MD_HW_INT */ +/* Description: Enable MD Hardware interrupt */ +#define SH_LOCAL_INT4_ENABLE_MD_HW_INT_SHFT 1 +#define SH_LOCAL_INT4_ENABLE_MD_HW_INT_MASK 0x0000000000000002 + +/* SH_LOCAL_INT4_ENABLE_XN_HW_INT */ +/* Description: Enable XN Hardware interrupt */ +#define SH_LOCAL_INT4_ENABLE_XN_HW_INT_SHFT 2 +#define SH_LOCAL_INT4_ENABLE_XN_HW_INT_MASK 0x0000000000000004 + +/* SH_LOCAL_INT4_ENABLE_LB_HW_INT */ +/* Description: Enable LB Hardware interrupt */ +#define SH_LOCAL_INT4_ENABLE_LB_HW_INT_SHFT 3 +#define SH_LOCAL_INT4_ENABLE_LB_HW_INT_MASK 0x0000000000000008 + +/* SH_LOCAL_INT4_ENABLE_II_HW_INT */ +/* Description: Enable II wrapper Hardware interrupt */ +#define SH_LOCAL_INT4_ENABLE_II_HW_INT_SHFT 4 +#define SH_LOCAL_INT4_ENABLE_II_HW_INT_MASK 0x0000000000000010 + +/* SH_LOCAL_INT4_ENABLE_PI_CE_INT */ +/* Description: Enable PI Correctable Error Interrupt */ +#define SH_LOCAL_INT4_ENABLE_PI_CE_INT_SHFT 5 +#define SH_LOCAL_INT4_ENABLE_PI_CE_INT_MASK 0x0000000000000020 + +/* SH_LOCAL_INT4_ENABLE_MD_CE_INT */ +/* Description: Enable MD Correctable Error Interrupt */ +#define SH_LOCAL_INT4_ENABLE_MD_CE_INT_SHFT 6 +#define SH_LOCAL_INT4_ENABLE_MD_CE_INT_MASK 0x0000000000000040 + +/* SH_LOCAL_INT4_ENABLE_XN_CE_INT */ +/* Description: Enable XN Correctable Error Interrupt */ +#define SH_LOCAL_INT4_ENABLE_XN_CE_INT_SHFT 7 +#define SH_LOCAL_INT4_ENABLE_XN_CE_INT_MASK 0x0000000000000080 + +/* SH_LOCAL_INT4_ENABLE_PI_UCE_INT */ +/* Description: Enable PI Correctable Error Interrupt */ +#define SH_LOCAL_INT4_ENABLE_PI_UCE_INT_SHFT 8 +#define SH_LOCAL_INT4_ENABLE_PI_UCE_INT_MASK 0x0000000000000100 + +/* SH_LOCAL_INT4_ENABLE_MD_UCE_INT */ +/* Description: Enable MD Correctable Error Interrupt */ +#define SH_LOCAL_INT4_ENABLE_MD_UCE_INT_SHFT 9 +#define SH_LOCAL_INT4_ENABLE_MD_UCE_INT_MASK 0x0000000000000200 + +/* SH_LOCAL_INT4_ENABLE_XN_UCE_INT */ +/* Description: Enable XN Correctable Error Interrupt */ +#define SH_LOCAL_INT4_ENABLE_XN_UCE_INT_SHFT 10 +#define SH_LOCAL_INT4_ENABLE_XN_UCE_INT_MASK 0x0000000000000400 + +/* SH_LOCAL_INT4_ENABLE_SYSTEM_SHUTDOWN_INT */ +/* Description: Enable System Shutdown Interrupt */ +#define SH_LOCAL_INT4_ENABLE_SYSTEM_SHUTDOWN_INT_SHFT 12 +#define SH_LOCAL_INT4_ENABLE_SYSTEM_SHUTDOWN_INT_MASK 0x0000000000001000 + +/* SH_LOCAL_INT4_ENABLE_UART_INT */ +/* Description: Enable Junk Bus UART Interrupt */ +#define SH_LOCAL_INT4_ENABLE_UART_INT_SHFT 13 +#define SH_LOCAL_INT4_ENABLE_UART_INT_MASK 0x0000000000002000 + +/* SH_LOCAL_INT4_ENABLE_L1_NMI_INT */ +/* Description: Enable L1 Controller NMI Interrupt */ +#define SH_LOCAL_INT4_ENABLE_L1_NMI_INT_SHFT 14 +#define SH_LOCAL_INT4_ENABLE_L1_NMI_INT_MASK 0x0000000000004000 + +/* SH_LOCAL_INT4_ENABLE_STOP_CLOCK */ +/* Description: Stop Clock Interrupt */ +#define SH_LOCAL_INT4_ENABLE_STOP_CLOCK_SHFT 15 +#define SH_LOCAL_INT4_ENABLE_STOP_CLOCK_MASK 0x0000000000008000 + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT5_CONFIG" */ +/* SHub Local Interrupt 5 Registers */ +/* ==================================================================== */ + +#define SH_LOCAL_INT5_CONFIG 0x0000000110000980 +#define SH_LOCAL_INT5_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_LOCAL_INT5_CONFIG_INIT 0x0000000000000000 + +/* SH_LOCAL_INT5_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_LOCAL_INT5_CONFIG_TYPE_SHFT 0 +#define SH_LOCAL_INT5_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_LOCAL_INT5_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_LOCAL_INT5_CONFIG_AGT_SHFT 3 +#define SH_LOCAL_INT5_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_LOCAL_INT5_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_LOCAL_INT5_CONFIG_PID_SHFT 4 +#define SH_LOCAL_INT5_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_LOCAL_INT5_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_LOCAL_INT5_CONFIG_BASE_SHFT 21 +#define SH_LOCAL_INT5_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_LOCAL_INT5_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_LOCAL_INT5_CONFIG_IDX_SHFT 52 +#define SH_LOCAL_INT5_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT5_ENABLE" */ +/* SHub Local Interrupt 5 Enable */ +/* ==================================================================== */ + +#define SH_LOCAL_INT5_ENABLE 0x0000000110000a00 +#define SH_LOCAL_INT5_ENABLE_MASK 0x000000000000f7ff +#define SH_LOCAL_INT5_ENABLE_INIT 0x0000000000000000 + +/* SH_LOCAL_INT5_ENABLE_PI_HW_INT */ +/* Description: Enable PI Hardware interrupt */ +#define SH_LOCAL_INT5_ENABLE_PI_HW_INT_SHFT 0 +#define SH_LOCAL_INT5_ENABLE_PI_HW_INT_MASK 0x0000000000000001 + +/* SH_LOCAL_INT5_ENABLE_MD_HW_INT */ +/* Description: Enable MD Hardware interrupt */ +#define SH_LOCAL_INT5_ENABLE_MD_HW_INT_SHFT 1 +#define SH_LOCAL_INT5_ENABLE_MD_HW_INT_MASK 0x0000000000000002 + +/* SH_LOCAL_INT5_ENABLE_XN_HW_INT */ +/* Description: Enable XN Hardware interrupt */ +#define SH_LOCAL_INT5_ENABLE_XN_HW_INT_SHFT 2 +#define SH_LOCAL_INT5_ENABLE_XN_HW_INT_MASK 0x0000000000000004 + +/* SH_LOCAL_INT5_ENABLE_LB_HW_INT */ +/* Description: Enable LB Hardware interrupt */ +#define SH_LOCAL_INT5_ENABLE_LB_HW_INT_SHFT 3 +#define SH_LOCAL_INT5_ENABLE_LB_HW_INT_MASK 0x0000000000000008 + +/* SH_LOCAL_INT5_ENABLE_II_HW_INT */ +/* Description: Enable II wrapper Hardware interrupt */ +#define SH_LOCAL_INT5_ENABLE_II_HW_INT_SHFT 4 +#define SH_LOCAL_INT5_ENABLE_II_HW_INT_MASK 0x0000000000000010 + +/* SH_LOCAL_INT5_ENABLE_PI_CE_INT */ +/* Description: Enable PI Correctable Error Interrupt */ +#define SH_LOCAL_INT5_ENABLE_PI_CE_INT_SHFT 5 +#define SH_LOCAL_INT5_ENABLE_PI_CE_INT_MASK 0x0000000000000020 + +/* SH_LOCAL_INT5_ENABLE_MD_CE_INT */ +/* Description: Enable MD Correctable Error Interrupt */ +#define SH_LOCAL_INT5_ENABLE_MD_CE_INT_SHFT 6 +#define SH_LOCAL_INT5_ENABLE_MD_CE_INT_MASK 0x0000000000000040 + +/* SH_LOCAL_INT5_ENABLE_XN_CE_INT */ +/* Description: Enable XN Correctable Error Interrupt */ +#define SH_LOCAL_INT5_ENABLE_XN_CE_INT_SHFT 7 +#define SH_LOCAL_INT5_ENABLE_XN_CE_INT_MASK 0x0000000000000080 + +/* SH_LOCAL_INT5_ENABLE_PI_UCE_INT */ +/* Description: Enable PI Correctable Error Interrupt */ +#define SH_LOCAL_INT5_ENABLE_PI_UCE_INT_SHFT 8 +#define SH_LOCAL_INT5_ENABLE_PI_UCE_INT_MASK 0x0000000000000100 + +/* SH_LOCAL_INT5_ENABLE_MD_UCE_INT */ +/* Description: Enable MD Correctable Error Interrupt */ +#define SH_LOCAL_INT5_ENABLE_MD_UCE_INT_SHFT 9 +#define SH_LOCAL_INT5_ENABLE_MD_UCE_INT_MASK 0x0000000000000200 + +/* SH_LOCAL_INT5_ENABLE_XN_UCE_INT */ +/* Description: Enable XN Correctable Error Interrupt */ +#define SH_LOCAL_INT5_ENABLE_XN_UCE_INT_SHFT 10 +#define SH_LOCAL_INT5_ENABLE_XN_UCE_INT_MASK 0x0000000000000400 + +/* SH_LOCAL_INT5_ENABLE_SYSTEM_SHUTDOWN_INT */ +/* Description: Enable System Shutdown Interrupt */ +#define SH_LOCAL_INT5_ENABLE_SYSTEM_SHUTDOWN_INT_SHFT 12 +#define SH_LOCAL_INT5_ENABLE_SYSTEM_SHUTDOWN_INT_MASK 0x0000000000001000 + +/* SH_LOCAL_INT5_ENABLE_UART_INT */ +/* Description: Enable Junk Bus UART Interrupt */ +#define SH_LOCAL_INT5_ENABLE_UART_INT_SHFT 13 +#define SH_LOCAL_INT5_ENABLE_UART_INT_MASK 0x0000000000002000 + +/* SH_LOCAL_INT5_ENABLE_L1_NMI_INT */ +/* Description: Enable L1 Controller NMI Interrupt */ +#define SH_LOCAL_INT5_ENABLE_L1_NMI_INT_SHFT 14 +#define SH_LOCAL_INT5_ENABLE_L1_NMI_INT_MASK 0x0000000000004000 + +/* SH_LOCAL_INT5_ENABLE_STOP_CLOCK */ +/* Description: Stop Clock Interrupt */ +#define SH_LOCAL_INT5_ENABLE_STOP_CLOCK_SHFT 15 +#define SH_LOCAL_INT5_ENABLE_STOP_CLOCK_MASK 0x0000000000008000 + +/* ==================================================================== */ +/* Register "SH_PROC0_ERR_INT_CONFIG" */ +/* SHub Processor 0 Error Interrupt Registers */ +/* ==================================================================== */ + +#define SH_PROC0_ERR_INT_CONFIG 0x0000000110000a80 +#define SH_PROC0_ERR_INT_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_PROC0_ERR_INT_CONFIG_INIT 0x0000000000000000 + +/* SH_PROC0_ERR_INT_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_PROC0_ERR_INT_CONFIG_TYPE_SHFT 0 +#define SH_PROC0_ERR_INT_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_PROC0_ERR_INT_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_PROC0_ERR_INT_CONFIG_AGT_SHFT 3 +#define SH_PROC0_ERR_INT_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_PROC0_ERR_INT_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_PROC0_ERR_INT_CONFIG_PID_SHFT 4 +#define SH_PROC0_ERR_INT_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_PROC0_ERR_INT_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_PROC0_ERR_INT_CONFIG_BASE_SHFT 21 +#define SH_PROC0_ERR_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_PROC0_ERR_INT_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_PROC0_ERR_INT_CONFIG_IDX_SHFT 52 +#define SH_PROC0_ERR_INT_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC1_ERR_INT_CONFIG" */ +/* SHub Processor 1 Error Interrupt Registers */ +/* ==================================================================== */ + +#define SH_PROC1_ERR_INT_CONFIG 0x0000000110000b00 +#define SH_PROC1_ERR_INT_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_PROC1_ERR_INT_CONFIG_INIT 0x0000000000000000 + +/* SH_PROC1_ERR_INT_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_PROC1_ERR_INT_CONFIG_TYPE_SHFT 0 +#define SH_PROC1_ERR_INT_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_PROC1_ERR_INT_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_PROC1_ERR_INT_CONFIG_AGT_SHFT 3 +#define SH_PROC1_ERR_INT_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_PROC1_ERR_INT_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_PROC1_ERR_INT_CONFIG_PID_SHFT 4 +#define SH_PROC1_ERR_INT_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_PROC1_ERR_INT_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_PROC1_ERR_INT_CONFIG_BASE_SHFT 21 +#define SH_PROC1_ERR_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_PROC1_ERR_INT_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_PROC1_ERR_INT_CONFIG_IDX_SHFT 52 +#define SH_PROC1_ERR_INT_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC2_ERR_INT_CONFIG" */ +/* SHub Processor 2 Error Interrupt Registers */ +/* ==================================================================== */ + +#define SH_PROC2_ERR_INT_CONFIG 0x0000000110000b80 +#define SH_PROC2_ERR_INT_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_PROC2_ERR_INT_CONFIG_INIT 0x0000000000000000 + +/* SH_PROC2_ERR_INT_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_PROC2_ERR_INT_CONFIG_TYPE_SHFT 0 +#define SH_PROC2_ERR_INT_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_PROC2_ERR_INT_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_PROC2_ERR_INT_CONFIG_AGT_SHFT 3 +#define SH_PROC2_ERR_INT_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_PROC2_ERR_INT_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_PROC2_ERR_INT_CONFIG_PID_SHFT 4 +#define SH_PROC2_ERR_INT_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_PROC2_ERR_INT_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_PROC2_ERR_INT_CONFIG_BASE_SHFT 21 +#define SH_PROC2_ERR_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_PROC2_ERR_INT_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_PROC2_ERR_INT_CONFIG_IDX_SHFT 52 +#define SH_PROC2_ERR_INT_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC3_ERR_INT_CONFIG" */ +/* SHub Processor 3 Error Interrupt Registers */ +/* ==================================================================== */ + +#define SH_PROC3_ERR_INT_CONFIG 0x0000000110000c00 +#define SH_PROC3_ERR_INT_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_PROC3_ERR_INT_CONFIG_INIT 0x0000000000000000 + +/* SH_PROC3_ERR_INT_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_PROC3_ERR_INT_CONFIG_TYPE_SHFT 0 +#define SH_PROC3_ERR_INT_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_PROC3_ERR_INT_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_PROC3_ERR_INT_CONFIG_AGT_SHFT 3 +#define SH_PROC3_ERR_INT_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_PROC3_ERR_INT_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_PROC3_ERR_INT_CONFIG_PID_SHFT 4 +#define SH_PROC3_ERR_INT_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_PROC3_ERR_INT_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_PROC3_ERR_INT_CONFIG_BASE_SHFT 21 +#define SH_PROC3_ERR_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_PROC3_ERR_INT_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_PROC3_ERR_INT_CONFIG_IDX_SHFT 52 +#define SH_PROC3_ERR_INT_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC0_ADV_INT_CONFIG" */ +/* SHub Processor 0 Advisory Interrupt Registers */ +/* ==================================================================== */ + +#define SH_PROC0_ADV_INT_CONFIG 0x0000000110000c80 +#define SH_PROC0_ADV_INT_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_PROC0_ADV_INT_CONFIG_INIT 0x0000000000000000 + +/* SH_PROC0_ADV_INT_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_PROC0_ADV_INT_CONFIG_TYPE_SHFT 0 +#define SH_PROC0_ADV_INT_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_PROC0_ADV_INT_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_PROC0_ADV_INT_CONFIG_AGT_SHFT 3 +#define SH_PROC0_ADV_INT_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_PROC0_ADV_INT_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_PROC0_ADV_INT_CONFIG_PID_SHFT 4 +#define SH_PROC0_ADV_INT_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_PROC0_ADV_INT_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_PROC0_ADV_INT_CONFIG_BASE_SHFT 21 +#define SH_PROC0_ADV_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_PROC0_ADV_INT_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_PROC0_ADV_INT_CONFIG_IDX_SHFT 52 +#define SH_PROC0_ADV_INT_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC1_ADV_INT_CONFIG" */ +/* SHub Processor 1 Advisory Interrupt Registers */ +/* ==================================================================== */ + +#define SH_PROC1_ADV_INT_CONFIG 0x0000000110000d00 +#define SH_PROC1_ADV_INT_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_PROC1_ADV_INT_CONFIG_INIT 0x0000000000000000 + +/* SH_PROC1_ADV_INT_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_PROC1_ADV_INT_CONFIG_TYPE_SHFT 0 +#define SH_PROC1_ADV_INT_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_PROC1_ADV_INT_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_PROC1_ADV_INT_CONFIG_AGT_SHFT 3 +#define SH_PROC1_ADV_INT_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_PROC1_ADV_INT_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_PROC1_ADV_INT_CONFIG_PID_SHFT 4 +#define SH_PROC1_ADV_INT_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_PROC1_ADV_INT_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_PROC1_ADV_INT_CONFIG_BASE_SHFT 21 +#define SH_PROC1_ADV_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_PROC1_ADV_INT_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_PROC1_ADV_INT_CONFIG_IDX_SHFT 52 +#define SH_PROC1_ADV_INT_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC2_ADV_INT_CONFIG" */ +/* SHub Processor 2 Advisory Interrupt Registers */ +/* ==================================================================== */ + +#define SH_PROC2_ADV_INT_CONFIG 0x0000000110000d80 +#define SH_PROC2_ADV_INT_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_PROC2_ADV_INT_CONFIG_INIT 0x0000000000000000 + +/* SH_PROC2_ADV_INT_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_PROC2_ADV_INT_CONFIG_TYPE_SHFT 0 +#define SH_PROC2_ADV_INT_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_PROC2_ADV_INT_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_PROC2_ADV_INT_CONFIG_AGT_SHFT 3 +#define SH_PROC2_ADV_INT_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_PROC2_ADV_INT_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_PROC2_ADV_INT_CONFIG_PID_SHFT 4 +#define SH_PROC2_ADV_INT_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_PROC2_ADV_INT_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_PROC2_ADV_INT_CONFIG_BASE_SHFT 21 +#define SH_PROC2_ADV_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_PROC2_ADV_INT_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_PROC2_ADV_INT_CONFIG_IDX_SHFT 52 +#define SH_PROC2_ADV_INT_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC3_ADV_INT_CONFIG" */ +/* SHub Processor 3 Advisory Interrupt Registers */ +/* ==================================================================== */ + +#define SH_PROC3_ADV_INT_CONFIG 0x0000000110000e00 +#define SH_PROC3_ADV_INT_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_PROC3_ADV_INT_CONFIG_INIT 0x0000000000000000 + +/* SH_PROC3_ADV_INT_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_PROC3_ADV_INT_CONFIG_TYPE_SHFT 0 +#define SH_PROC3_ADV_INT_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_PROC3_ADV_INT_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_PROC3_ADV_INT_CONFIG_AGT_SHFT 3 +#define SH_PROC3_ADV_INT_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_PROC3_ADV_INT_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_PROC3_ADV_INT_CONFIG_PID_SHFT 4 +#define SH_PROC3_ADV_INT_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_PROC3_ADV_INT_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_PROC3_ADV_INT_CONFIG_BASE_SHFT 21 +#define SH_PROC3_ADV_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_PROC3_ADV_INT_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_PROC3_ADV_INT_CONFIG_IDX_SHFT 52 +#define SH_PROC3_ADV_INT_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC0_ERR_INT_ENABLE" */ +/* SHub Processor 0 Error Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_PROC0_ERR_INT_ENABLE 0x0000000110000e80 +#define SH_PROC0_ERR_INT_ENABLE_MASK 0x0000000000000001 +#define SH_PROC0_ERR_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_PROC0_ERR_INT_ENABLE_PROC0_ERR_ENABLE */ +/* Description: Enable Processor 0 Error Interrupt */ +#define SH_PROC0_ERR_INT_ENABLE_PROC0_ERR_ENABLE_SHFT 0 +#define SH_PROC0_ERR_INT_ENABLE_PROC0_ERR_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_PROC1_ERR_INT_ENABLE" */ +/* SHub Processor 1 Error Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_PROC1_ERR_INT_ENABLE 0x0000000110000f00 +#define SH_PROC1_ERR_INT_ENABLE_MASK 0x0000000000000001 +#define SH_PROC1_ERR_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_PROC1_ERR_INT_ENABLE_PROC1_ERR_ENABLE */ +/* Description: Enable Processor 1 Error Interrupt */ +#define SH_PROC1_ERR_INT_ENABLE_PROC1_ERR_ENABLE_SHFT 0 +#define SH_PROC1_ERR_INT_ENABLE_PROC1_ERR_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_PROC2_ERR_INT_ENABLE" */ +/* SHub Processor 2 Error Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_PROC2_ERR_INT_ENABLE 0x0000000110000f80 +#define SH_PROC2_ERR_INT_ENABLE_MASK 0x0000000000000001 +#define SH_PROC2_ERR_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_PROC2_ERR_INT_ENABLE_PROC2_ERR_ENABLE */ +/* Description: Enable Processor 2 Error Interrupt */ +#define SH_PROC2_ERR_INT_ENABLE_PROC2_ERR_ENABLE_SHFT 0 +#define SH_PROC2_ERR_INT_ENABLE_PROC2_ERR_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_PROC3_ERR_INT_ENABLE" */ +/* SHub Processor 3 Error Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_PROC3_ERR_INT_ENABLE 0x0000000110001000 +#define SH_PROC3_ERR_INT_ENABLE_MASK 0x0000000000000001 +#define SH_PROC3_ERR_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_PROC3_ERR_INT_ENABLE_PROC3_ERR_ENABLE */ +/* Description: Enable Processor 3 Error Interrupt */ +#define SH_PROC3_ERR_INT_ENABLE_PROC3_ERR_ENABLE_SHFT 0 +#define SH_PROC3_ERR_INT_ENABLE_PROC3_ERR_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_PROC0_ADV_INT_ENABLE" */ +/* SHub Processor 0 Advisory Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_PROC0_ADV_INT_ENABLE 0x0000000110001080 +#define SH_PROC0_ADV_INT_ENABLE_MASK 0x0000000000000001 +#define SH_PROC0_ADV_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_PROC0_ADV_INT_ENABLE_PROC0_ADV_ENABLE */ +/* Description: Enable Processor 0 Advisory Interrupt */ +#define SH_PROC0_ADV_INT_ENABLE_PROC0_ADV_ENABLE_SHFT 0 +#define SH_PROC0_ADV_INT_ENABLE_PROC0_ADV_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_PROC1_ADV_INT_ENABLE" */ +/* SHub Processor 1 Advisory Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_PROC1_ADV_INT_ENABLE 0x0000000110001100 +#define SH_PROC1_ADV_INT_ENABLE_MASK 0x0000000000000001 +#define SH_PROC1_ADV_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_PROC1_ADV_INT_ENABLE_PROC1_ADV_ENABLE */ +/* Description: Enable Processor 1 Advisory Interrupt */ +#define SH_PROC1_ADV_INT_ENABLE_PROC1_ADV_ENABLE_SHFT 0 +#define SH_PROC1_ADV_INT_ENABLE_PROC1_ADV_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_PROC2_ADV_INT_ENABLE" */ +/* SHub Processor 2 Advisory Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_PROC2_ADV_INT_ENABLE 0x0000000110001180 +#define SH_PROC2_ADV_INT_ENABLE_MASK 0x0000000000000001 +#define SH_PROC2_ADV_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_PROC2_ADV_INT_ENABLE_PROC2_ADV_ENABLE */ +/* Description: Enable Processor 2 Advisory Interrupt */ +#define SH_PROC2_ADV_INT_ENABLE_PROC2_ADV_ENABLE_SHFT 0 +#define SH_PROC2_ADV_INT_ENABLE_PROC2_ADV_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_PROC3_ADV_INT_ENABLE" */ +/* SHub Processor 3 Advisory Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_PROC3_ADV_INT_ENABLE 0x0000000110001200 +#define SH_PROC3_ADV_INT_ENABLE_MASK 0x0000000000000001 +#define SH_PROC3_ADV_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_PROC3_ADV_INT_ENABLE_PROC3_ADV_ENABLE */ +/* Description: Enable Processor 3 Advisory Interrupt */ +#define SH_PROC3_ADV_INT_ENABLE_PROC3_ADV_ENABLE_SHFT 0 +#define SH_PROC3_ADV_INT_ENABLE_PROC3_ADV_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_PROFILE_INT_CONFIG" */ +/* SHub Profile Interrupt Configuration Registers */ +/* ==================================================================== */ + +#define SH_PROFILE_INT_CONFIG 0x0000000110001280 +#define SH_PROFILE_INT_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_PROFILE_INT_CONFIG_INIT 0x0000000000000000 + +/* SH_PROFILE_INT_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_PROFILE_INT_CONFIG_TYPE_SHFT 0 +#define SH_PROFILE_INT_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_PROFILE_INT_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_PROFILE_INT_CONFIG_AGT_SHFT 3 +#define SH_PROFILE_INT_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_PROFILE_INT_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_PROFILE_INT_CONFIG_PID_SHFT 4 +#define SH_PROFILE_INT_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_PROFILE_INT_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_PROFILE_INT_CONFIG_BASE_SHFT 21 +#define SH_PROFILE_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_PROFILE_INT_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_PROFILE_INT_CONFIG_IDX_SHFT 52 +#define SH_PROFILE_INT_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_PROFILE_INT_ENABLE" */ +/* SHub Profile Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_PROFILE_INT_ENABLE 0x0000000110001300 +#define SH_PROFILE_INT_ENABLE_MASK 0x0000000000000001 +#define SH_PROFILE_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_PROFILE_INT_ENABLE_PROFILE_ENABLE */ +/* Description: Enable Profile Interrupt */ +#define SH_PROFILE_INT_ENABLE_PROFILE_ENABLE_SHFT 0 +#define SH_PROFILE_INT_ENABLE_PROFILE_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_RTC0_INT_CONFIG" */ +/* SHub RTC 0 Interrupt Config Registers */ +/* ==================================================================== */ + +#define SH_RTC0_INT_CONFIG 0x0000000110001380 +#define SH_RTC0_INT_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_RTC0_INT_CONFIG_INIT 0x0000000000000000 + +/* SH_RTC0_INT_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_RTC0_INT_CONFIG_TYPE_SHFT 0 +#define SH_RTC0_INT_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_RTC0_INT_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_RTC0_INT_CONFIG_AGT_SHFT 3 +#define SH_RTC0_INT_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_RTC0_INT_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_RTC0_INT_CONFIG_PID_SHFT 4 +#define SH_RTC0_INT_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_RTC0_INT_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_RTC0_INT_CONFIG_BASE_SHFT 21 +#define SH_RTC0_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_RTC0_INT_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_RTC0_INT_CONFIG_IDX_SHFT 52 +#define SH_RTC0_INT_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_RTC0_INT_ENABLE" */ +/* SHub RTC 0 Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_RTC0_INT_ENABLE 0x0000000110001400 +#define SH_RTC0_INT_ENABLE_MASK 0x0000000000000001 +#define SH_RTC0_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_RTC0_INT_ENABLE_RTC0_ENABLE */ +/* Description: Enable RTC 0 Interrupt */ +#define SH_RTC0_INT_ENABLE_RTC0_ENABLE_SHFT 0 +#define SH_RTC0_INT_ENABLE_RTC0_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_RTC1_INT_CONFIG" */ +/* SHub RTC 1 Interrupt Config Registers */ +/* ==================================================================== */ + +#define SH_RTC1_INT_CONFIG 0x0000000110001480 +#define SH_RTC1_INT_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_RTC1_INT_CONFIG_INIT 0x0000000000000000 + +/* SH_RTC1_INT_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_RTC1_INT_CONFIG_TYPE_SHFT 0 +#define SH_RTC1_INT_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_RTC1_INT_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_RTC1_INT_CONFIG_AGT_SHFT 3 +#define SH_RTC1_INT_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_RTC1_INT_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_RTC1_INT_CONFIG_PID_SHFT 4 +#define SH_RTC1_INT_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_RTC1_INT_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_RTC1_INT_CONFIG_BASE_SHFT 21 +#define SH_RTC1_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_RTC1_INT_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_RTC1_INT_CONFIG_IDX_SHFT 52 +#define SH_RTC1_INT_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_RTC1_INT_ENABLE" */ +/* SHub RTC 1 Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_RTC1_INT_ENABLE 0x0000000110001500 +#define SH_RTC1_INT_ENABLE_MASK 0x0000000000000001 +#define SH_RTC1_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_RTC1_INT_ENABLE_RTC1_ENABLE */ +/* Description: Enable RTC 1 Interrupt */ +#define SH_RTC1_INT_ENABLE_RTC1_ENABLE_SHFT 0 +#define SH_RTC1_INT_ENABLE_RTC1_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_RTC2_INT_CONFIG" */ +/* SHub RTC 2 Interrupt Config Registers */ +/* ==================================================================== */ + +#define SH_RTC2_INT_CONFIG 0x0000000110001580 +#define SH_RTC2_INT_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_RTC2_INT_CONFIG_INIT 0x0000000000000000 + +/* SH_RTC2_INT_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_RTC2_INT_CONFIG_TYPE_SHFT 0 +#define SH_RTC2_INT_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_RTC2_INT_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_RTC2_INT_CONFIG_AGT_SHFT 3 +#define SH_RTC2_INT_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_RTC2_INT_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_RTC2_INT_CONFIG_PID_SHFT 4 +#define SH_RTC2_INT_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_RTC2_INT_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_RTC2_INT_CONFIG_BASE_SHFT 21 +#define SH_RTC2_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_RTC2_INT_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_RTC2_INT_CONFIG_IDX_SHFT 52 +#define SH_RTC2_INT_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_RTC2_INT_ENABLE" */ +/* SHub RTC 2 Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_RTC2_INT_ENABLE 0x0000000110001600 +#define SH_RTC2_INT_ENABLE_MASK 0x0000000000000001 +#define SH_RTC2_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_RTC2_INT_ENABLE_RTC2_ENABLE */ +/* Description: Enable RTC 2 Interrupt */ +#define SH_RTC2_INT_ENABLE_RTC2_ENABLE_SHFT 0 +#define SH_RTC2_INT_ENABLE_RTC2_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_RTC3_INT_CONFIG" */ +/* SHub RTC 3 Interrupt Config Registers */ +/* ==================================================================== */ + +#define SH_RTC3_INT_CONFIG 0x0000000110001680 +#define SH_RTC3_INT_CONFIG_MASK 0x0ff3ffffffefffff +#define SH_RTC3_INT_CONFIG_INIT 0x0000000000000000 + +/* SH_RTC3_INT_CONFIG_TYPE */ +/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ +#define SH_RTC3_INT_CONFIG_TYPE_SHFT 0 +#define SH_RTC3_INT_CONFIG_TYPE_MASK 0x0000000000000007 + +/* SH_RTC3_INT_CONFIG_AGT */ +/* Description: Agent, must be 0 for SHub */ +#define SH_RTC3_INT_CONFIG_AGT_SHFT 3 +#define SH_RTC3_INT_CONFIG_AGT_MASK 0x0000000000000008 + +/* SH_RTC3_INT_CONFIG_PID */ +/* Description: Processor ID, same setting as on targeted McKinley */ +#define SH_RTC3_INT_CONFIG_PID_SHFT 4 +#define SH_RTC3_INT_CONFIG_PID_MASK 0x00000000000ffff0 + +/* SH_RTC3_INT_CONFIG_BASE */ +/* Description: Optional interrupt vector area, 2MB aligned */ +#define SH_RTC3_INT_CONFIG_BASE_SHFT 21 +#define SH_RTC3_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 + +/* SH_RTC3_INT_CONFIG_IDX */ +/* Description: Targeted McKinley interrupt vector */ +#define SH_RTC3_INT_CONFIG_IDX_SHFT 52 +#define SH_RTC3_INT_CONFIG_IDX_MASK 0x0ff0000000000000 + +/* ==================================================================== */ +/* Register "SH_RTC3_INT_ENABLE" */ +/* SHub RTC 3 Interrupt Enable Registers */ +/* ==================================================================== */ + +#define SH_RTC3_INT_ENABLE 0x0000000110001700 +#define SH_RTC3_INT_ENABLE_MASK 0x0000000000000001 +#define SH_RTC3_INT_ENABLE_INIT 0x0000000000000000 + +/* SH_RTC3_INT_ENABLE_RTC3_ENABLE */ +/* Description: Enable RTC 3 Interrupt */ +#define SH_RTC3_INT_ENABLE_RTC3_ENABLE_SHFT 0 +#define SH_RTC3_INT_ENABLE_RTC3_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_EVENT_OCCURRED" */ +/* SHub Interrupt Event Occurred */ +/* ==================================================================== */ + +#define SH_EVENT_OCCURRED 0x0000000110010000 +#define SH_EVENT_OCCURRED_MASK 0x000000007fffffff +#define SH_EVENT_OCCURRED_INIT 0x0000000000000000 + +/* SH_EVENT_OCCURRED_PI_HW_INT */ +/* Description: Pending PI Hardware interrupt */ +#define SH_EVENT_OCCURRED_PI_HW_INT_SHFT 0 +#define SH_EVENT_OCCURRED_PI_HW_INT_MASK 0x0000000000000001 + +/* SH_EVENT_OCCURRED_MD_HW_INT */ +/* Description: Pending MD Hardware interrupt */ +#define SH_EVENT_OCCURRED_MD_HW_INT_SHFT 1 +#define SH_EVENT_OCCURRED_MD_HW_INT_MASK 0x0000000000000002 + +/* SH_EVENT_OCCURRED_XN_HW_INT */ +/* Description: Pending XN Hardware interrupt */ +#define SH_EVENT_OCCURRED_XN_HW_INT_SHFT 2 +#define SH_EVENT_OCCURRED_XN_HW_INT_MASK 0x0000000000000004 + +/* SH_EVENT_OCCURRED_LB_HW_INT */ +/* Description: Pending LB Hardware interrupt */ +#define SH_EVENT_OCCURRED_LB_HW_INT_SHFT 3 +#define SH_EVENT_OCCURRED_LB_HW_INT_MASK 0x0000000000000008 + +/* SH_EVENT_OCCURRED_II_HW_INT */ +/* Description: Pending II wrapper Hardware interrupt */ +#define SH_EVENT_OCCURRED_II_HW_INT_SHFT 4 +#define SH_EVENT_OCCURRED_II_HW_INT_MASK 0x0000000000000010 + +/* SH_EVENT_OCCURRED_PI_CE_INT */ +/* Description: Pending PI Correctable Error Interrupt */ +#define SH_EVENT_OCCURRED_PI_CE_INT_SHFT 5 +#define SH_EVENT_OCCURRED_PI_CE_INT_MASK 0x0000000000000020 + +/* SH_EVENT_OCCURRED_MD_CE_INT */ +/* Description: Pending MD Correctable Error Interrupt */ +#define SH_EVENT_OCCURRED_MD_CE_INT_SHFT 6 +#define SH_EVENT_OCCURRED_MD_CE_INT_MASK 0x0000000000000040 + +/* SH_EVENT_OCCURRED_XN_CE_INT */ +/* Description: Pending XN Correctable Error Interrupt */ +#define SH_EVENT_OCCURRED_XN_CE_INT_SHFT 7 +#define SH_EVENT_OCCURRED_XN_CE_INT_MASK 0x0000000000000080 + +/* SH_EVENT_OCCURRED_PI_UCE_INT */ +/* Description: Pending PI Correctable Error Interrupt */ +#define SH_EVENT_OCCURRED_PI_UCE_INT_SHFT 8 +#define SH_EVENT_OCCURRED_PI_UCE_INT_MASK 0x0000000000000100 + +/* SH_EVENT_OCCURRED_MD_UCE_INT */ +/* Description: Pending MD Correctable Error Interrupt */ +#define SH_EVENT_OCCURRED_MD_UCE_INT_SHFT 9 +#define SH_EVENT_OCCURRED_MD_UCE_INT_MASK 0x0000000000000200 + +/* SH_EVENT_OCCURRED_XN_UCE_INT */ +/* Description: Pending XN Correctable Error Interrupt */ +#define SH_EVENT_OCCURRED_XN_UCE_INT_SHFT 10 +#define SH_EVENT_OCCURRED_XN_UCE_INT_MASK 0x0000000000000400 + +/* SH_EVENT_OCCURRED_PROC0_ADV_INT */ +/* Description: Pending Processor 0 Advisory Interrupt */ +#define SH_EVENT_OCCURRED_PROC0_ADV_INT_SHFT 11 +#define SH_EVENT_OCCURRED_PROC0_ADV_INT_MASK 0x0000000000000800 + +/* SH_EVENT_OCCURRED_PROC1_ADV_INT */ +/* Description: Pending Processor 1 Advisory Interrupt */ +#define SH_EVENT_OCCURRED_PROC1_ADV_INT_SHFT 12 +#define SH_EVENT_OCCURRED_PROC1_ADV_INT_MASK 0x0000000000001000 + +/* SH_EVENT_OCCURRED_PROC2_ADV_INT */ +/* Description: Pending Processor 2 Advisory Interrupt */ +#define SH_EVENT_OCCURRED_PROC2_ADV_INT_SHFT 13 +#define SH_EVENT_OCCURRED_PROC2_ADV_INT_MASK 0x0000000000002000 + +/* SH_EVENT_OCCURRED_PROC3_ADV_INT */ +/* Description: Pending Processor 3 Advisory Interrupt */ +#define SH_EVENT_OCCURRED_PROC3_ADV_INT_SHFT 14 +#define SH_EVENT_OCCURRED_PROC3_ADV_INT_MASK 0x0000000000004000 + +/* SH_EVENT_OCCURRED_PROC0_ERR_INT */ +/* Description: Pending Processor 0 Error Interrupt */ +#define SH_EVENT_OCCURRED_PROC0_ERR_INT_SHFT 15 +#define SH_EVENT_OCCURRED_PROC0_ERR_INT_MASK 0x0000000000008000 + +/* SH_EVENT_OCCURRED_PROC1_ERR_INT */ +/* Description: Pending Processor 1 Error Interrupt */ +#define SH_EVENT_OCCURRED_PROC1_ERR_INT_SHFT 16 +#define SH_EVENT_OCCURRED_PROC1_ERR_INT_MASK 0x0000000000010000 + +/* SH_EVENT_OCCURRED_PROC2_ERR_INT */ +/* Description: Pending Processor 2 Error Interrupt */ +#define SH_EVENT_OCCURRED_PROC2_ERR_INT_SHFT 17 +#define SH_EVENT_OCCURRED_PROC2_ERR_INT_MASK 0x0000000000020000 + +/* SH_EVENT_OCCURRED_PROC3_ERR_INT */ +/* Description: Pending Processor 3 Error Interrupt */ +#define SH_EVENT_OCCURRED_PROC3_ERR_INT_SHFT 18 +#define SH_EVENT_OCCURRED_PROC3_ERR_INT_MASK 0x0000000000040000 + +/* SH_EVENT_OCCURRED_SYSTEM_SHUTDOWN_INT */ +/* Description: Pending System Shutdown Interrupt */ +#define SH_EVENT_OCCURRED_SYSTEM_SHUTDOWN_INT_SHFT 19 +#define SH_EVENT_OCCURRED_SYSTEM_SHUTDOWN_INT_MASK 0x0000000000080000 + +/* SH_EVENT_OCCURRED_UART_INT */ +/* Description: Pending Junk Bus UART Interrupt */ +#define SH_EVENT_OCCURRED_UART_INT_SHFT 20 +#define SH_EVENT_OCCURRED_UART_INT_MASK 0x0000000000100000 + +/* SH_EVENT_OCCURRED_L1_NMI_INT */ +/* Description: Pending L1 Controller NMI Interrupt */ +#define SH_EVENT_OCCURRED_L1_NMI_INT_SHFT 21 +#define SH_EVENT_OCCURRED_L1_NMI_INT_MASK 0x0000000000200000 + +/* SH_EVENT_OCCURRED_STOP_CLOCK */ +/* Description: Pending Stop Clock Interrupt */ +#define SH_EVENT_OCCURRED_STOP_CLOCK_SHFT 22 +#define SH_EVENT_OCCURRED_STOP_CLOCK_MASK 0x0000000000400000 + +/* SH_EVENT_OCCURRED_RTC0_INT */ +/* Description: Pending RTC 0 Interrupt */ +#define SH_EVENT_OCCURRED_RTC0_INT_SHFT 23 +#define SH_EVENT_OCCURRED_RTC0_INT_MASK 0x0000000000800000 + +/* SH_EVENT_OCCURRED_RTC1_INT */ +/* Description: Pending RTC 1 Interrupt */ +#define SH_EVENT_OCCURRED_RTC1_INT_SHFT 24 +#define SH_EVENT_OCCURRED_RTC1_INT_MASK 0x0000000001000000 + +/* SH_EVENT_OCCURRED_RTC2_INT */ +/* Description: Pending RTC 2 Interrupt */ +#define SH_EVENT_OCCURRED_RTC2_INT_SHFT 25 +#define SH_EVENT_OCCURRED_RTC2_INT_MASK 0x0000000002000000 + +/* SH_EVENT_OCCURRED_RTC3_INT */ +/* Description: Pending RTC 3 Interrupt */ +#define SH_EVENT_OCCURRED_RTC3_INT_SHFT 26 +#define SH_EVENT_OCCURRED_RTC3_INT_MASK 0x0000000004000000 + +/* SH_EVENT_OCCURRED_PROFILE_INT */ +/* Description: Pending Profile Interrupt */ +#define SH_EVENT_OCCURRED_PROFILE_INT_SHFT 27 +#define SH_EVENT_OCCURRED_PROFILE_INT_MASK 0x0000000008000000 + +/* SH_EVENT_OCCURRED_IPI_INT */ +/* Description: Pending IPI Interrupt */ +#define SH_EVENT_OCCURRED_IPI_INT_SHFT 28 +#define SH_EVENT_OCCURRED_IPI_INT_MASK 0x0000000010000000 + +/* SH_EVENT_OCCURRED_II_INT0 */ +/* Description: Pending II 0 Interrupt */ +#define SH_EVENT_OCCURRED_II_INT0_SHFT 29 +#define SH_EVENT_OCCURRED_II_INT0_MASK 0x0000000020000000 + +/* SH_EVENT_OCCURRED_II_INT1 */ +/* Description: Pending II 1 Interrupt */ +#define SH_EVENT_OCCURRED_II_INT1_SHFT 30 +#define SH_EVENT_OCCURRED_II_INT1_MASK 0x0000000040000000 + +/* ==================================================================== */ +/* Register "SH_EVENT_OCCURRED_ALIAS" */ +/* SHub Interrupt Event Occurred Alias */ +/* ==================================================================== */ + +#define SH_EVENT_OCCURRED_ALIAS 0x0000000110010008 + +/* ==================================================================== */ +/* Register "SH_EVENT_OVERFLOW" */ +/* SHub Interrupt Event Occurred Overflow */ +/* ==================================================================== */ + +#define SH_EVENT_OVERFLOW 0x0000000110010080 +#define SH_EVENT_OVERFLOW_MASK 0x000000000fffffff +#define SH_EVENT_OVERFLOW_INIT 0x0000000000000000 + +/* SH_EVENT_OVERFLOW_PI_HW_INT */ +/* Description: Pending PI Hardware interrupt */ +#define SH_EVENT_OVERFLOW_PI_HW_INT_SHFT 0 +#define SH_EVENT_OVERFLOW_PI_HW_INT_MASK 0x0000000000000001 + +/* SH_EVENT_OVERFLOW_MD_HW_INT */ +/* Description: Pending MD Hardware interrupt */ +#define SH_EVENT_OVERFLOW_MD_HW_INT_SHFT 1 +#define SH_EVENT_OVERFLOW_MD_HW_INT_MASK 0x0000000000000002 + +/* SH_EVENT_OVERFLOW_XN_HW_INT */ +/* Description: Pending XN Hardware interrupt */ +#define SH_EVENT_OVERFLOW_XN_HW_INT_SHFT 2 +#define SH_EVENT_OVERFLOW_XN_HW_INT_MASK 0x0000000000000004 + +/* SH_EVENT_OVERFLOW_LB_HW_INT */ +/* Description: Pending LB Hardware interrupt */ +#define SH_EVENT_OVERFLOW_LB_HW_INT_SHFT 3 +#define SH_EVENT_OVERFLOW_LB_HW_INT_MASK 0x0000000000000008 + +/* SH_EVENT_OVERFLOW_II_HW_INT */ +/* Description: Pending II wrapper Hardware interrupt */ +#define SH_EVENT_OVERFLOW_II_HW_INT_SHFT 4 +#define SH_EVENT_OVERFLOW_II_HW_INT_MASK 0x0000000000000010 + +/* SH_EVENT_OVERFLOW_PI_CE_INT */ +/* Description: Pending PI Correctable Error Interrupt */ +#define SH_EVENT_OVERFLOW_PI_CE_INT_SHFT 5 +#define SH_EVENT_OVERFLOW_PI_CE_INT_MASK 0x0000000000000020 + +/* SH_EVENT_OVERFLOW_MD_CE_INT */ +/* Description: Pending MD Correctable Error Interrupt */ +#define SH_EVENT_OVERFLOW_MD_CE_INT_SHFT 6 +#define SH_EVENT_OVERFLOW_MD_CE_INT_MASK 0x0000000000000040 + +/* SH_EVENT_OVERFLOW_XN_CE_INT */ +/* Description: Pending XN Correctable Error Interrupt */ +#define SH_EVENT_OVERFLOW_XN_CE_INT_SHFT 7 +#define SH_EVENT_OVERFLOW_XN_CE_INT_MASK 0x0000000000000080 + +/* SH_EVENT_OVERFLOW_PI_UCE_INT */ +/* Description: Pending PI Correctable Error Interrupt */ +#define SH_EVENT_OVERFLOW_PI_UCE_INT_SHFT 8 +#define SH_EVENT_OVERFLOW_PI_UCE_INT_MASK 0x0000000000000100 + +/* SH_EVENT_OVERFLOW_MD_UCE_INT */ +/* Description: Pending MD Correctable Error Interrupt */ +#define SH_EVENT_OVERFLOW_MD_UCE_INT_SHFT 9 +#define SH_EVENT_OVERFLOW_MD_UCE_INT_MASK 0x0000000000000200 + +/* SH_EVENT_OVERFLOW_XN_UCE_INT */ +/* Description: Pending XN Correctable Error Interrupt */ +#define SH_EVENT_OVERFLOW_XN_UCE_INT_SHFT 10 +#define SH_EVENT_OVERFLOW_XN_UCE_INT_MASK 0x0000000000000400 + +/* SH_EVENT_OVERFLOW_PROC0_ADV_INT */ +/* Description: Pending Processor 0 Advisory Interrupt */ +#define SH_EVENT_OVERFLOW_PROC0_ADV_INT_SHFT 11 +#define SH_EVENT_OVERFLOW_PROC0_ADV_INT_MASK 0x0000000000000800 + +/* SH_EVENT_OVERFLOW_PROC1_ADV_INT */ +/* Description: Pending Processor 1 Advisory Interrupt */ +#define SH_EVENT_OVERFLOW_PROC1_ADV_INT_SHFT 12 +#define SH_EVENT_OVERFLOW_PROC1_ADV_INT_MASK 0x0000000000001000 + +/* SH_EVENT_OVERFLOW_PROC2_ADV_INT */ +/* Description: Pending Processor 2 Advisory Interrupt */ +#define SH_EVENT_OVERFLOW_PROC2_ADV_INT_SHFT 13 +#define SH_EVENT_OVERFLOW_PROC2_ADV_INT_MASK 0x0000000000002000 + +/* SH_EVENT_OVERFLOW_PROC3_ADV_INT */ +/* Description: Pending Processor 3 Advisory Interrupt */ +#define SH_EVENT_OVERFLOW_PROC3_ADV_INT_SHFT 14 +#define SH_EVENT_OVERFLOW_PROC3_ADV_INT_MASK 0x0000000000004000 + +/* SH_EVENT_OVERFLOW_PROC0_ERR_INT */ +/* Description: Pending Processor 0 Error Interrupt */ +#define SH_EVENT_OVERFLOW_PROC0_ERR_INT_SHFT 15 +#define SH_EVENT_OVERFLOW_PROC0_ERR_INT_MASK 0x0000000000008000 + +/* SH_EVENT_OVERFLOW_PROC1_ERR_INT */ +/* Description: Pending Processor 1 Error Interrupt */ +#define SH_EVENT_OVERFLOW_PROC1_ERR_INT_SHFT 16 +#define SH_EVENT_OVERFLOW_PROC1_ERR_INT_MASK 0x0000000000010000 + +/* SH_EVENT_OVERFLOW_PROC2_ERR_INT */ +/* Description: Pending Processor 2 Error Interrupt */ +#define SH_EVENT_OVERFLOW_PROC2_ERR_INT_SHFT 17 +#define SH_EVENT_OVERFLOW_PROC2_ERR_INT_MASK 0x0000000000020000 + +/* SH_EVENT_OVERFLOW_PROC3_ERR_INT */ +/* Description: Pending Processor 3 Error Interrupt */ +#define SH_EVENT_OVERFLOW_PROC3_ERR_INT_SHFT 18 +#define SH_EVENT_OVERFLOW_PROC3_ERR_INT_MASK 0x0000000000040000 + +/* SH_EVENT_OVERFLOW_SYSTEM_SHUTDOWN_INT */ +/* Description: Pending System Shutdown Interrupt */ +#define SH_EVENT_OVERFLOW_SYSTEM_SHUTDOWN_INT_SHFT 19 +#define SH_EVENT_OVERFLOW_SYSTEM_SHUTDOWN_INT_MASK 0x0000000000080000 + +/* SH_EVENT_OVERFLOW_UART_INT */ +/* Description: Pending Junk Bus UART Interrupt */ +#define SH_EVENT_OVERFLOW_UART_INT_SHFT 20 +#define SH_EVENT_OVERFLOW_UART_INT_MASK 0x0000000000100000 + +/* SH_EVENT_OVERFLOW_L1_NMI_INT */ +/* Description: Pending L1 Controller NMI Interrupt */ +#define SH_EVENT_OVERFLOW_L1_NMI_INT_SHFT 21 +#define SH_EVENT_OVERFLOW_L1_NMI_INT_MASK 0x0000000000200000 + +/* SH_EVENT_OVERFLOW_STOP_CLOCK */ +/* Description: Pending Stop Clock Interrupt */ +#define SH_EVENT_OVERFLOW_STOP_CLOCK_SHFT 22 +#define SH_EVENT_OVERFLOW_STOP_CLOCK_MASK 0x0000000000400000 + +/* SH_EVENT_OVERFLOW_RTC0_INT */ +/* Description: Pending RTC 0 Interrupt */ +#define SH_EVENT_OVERFLOW_RTC0_INT_SHFT 23 +#define SH_EVENT_OVERFLOW_RTC0_INT_MASK 0x0000000000800000 + +/* SH_EVENT_OVERFLOW_RTC1_INT */ +/* Description: Pending RTC 1 Interrupt */ +#define SH_EVENT_OVERFLOW_RTC1_INT_SHFT 24 +#define SH_EVENT_OVERFLOW_RTC1_INT_MASK 0x0000000001000000 + +/* SH_EVENT_OVERFLOW_RTC2_INT */ +/* Description: Pending RTC 2 Interrupt */ +#define SH_EVENT_OVERFLOW_RTC2_INT_SHFT 25 +#define SH_EVENT_OVERFLOW_RTC2_INT_MASK 0x0000000002000000 + +/* SH_EVENT_OVERFLOW_RTC3_INT */ +/* Description: Pending RTC 3 Interrupt */ +#define SH_EVENT_OVERFLOW_RTC3_INT_SHFT 26 +#define SH_EVENT_OVERFLOW_RTC3_INT_MASK 0x0000000004000000 + +/* SH_EVENT_OVERFLOW_PROFILE_INT */ +/* Description: Pending Profile Interrupt */ +#define SH_EVENT_OVERFLOW_PROFILE_INT_SHFT 27 +#define SH_EVENT_OVERFLOW_PROFILE_INT_MASK 0x0000000008000000 + +/* ==================================================================== */ +/* Register "SH_EVENT_OVERFLOW_ALIAS" */ +/* SHub Interrupt Event Occurred Overflow Alias */ +/* ==================================================================== */ + +#define SH_EVENT_OVERFLOW_ALIAS 0x0000000110010088 + +/* ==================================================================== */ +/* Register "SH_JUNK_BUS_TIME" */ +/* Junk Bus Timing */ +/* ==================================================================== */ + +#define SH_JUNK_BUS_TIME 0x0000000110020000 +#define SH_JUNK_BUS_TIME_MASK 0x00000000ffffffff +#define SH_JUNK_BUS_TIME_INIT 0x0000000040404040 + +/* SH_JUNK_BUS_TIME_FPROM_SETUP_HOLD */ +/* Description: Fprom_Setup_Hold */ +#define SH_JUNK_BUS_TIME_FPROM_SETUP_HOLD_SHFT 0 +#define SH_JUNK_BUS_TIME_FPROM_SETUP_HOLD_MASK 0x00000000000000ff + +/* SH_JUNK_BUS_TIME_FPROM_ENABLE */ +/* Description: Fprom_Enable */ +#define SH_JUNK_BUS_TIME_FPROM_ENABLE_SHFT 8 +#define SH_JUNK_BUS_TIME_FPROM_ENABLE_MASK 0x000000000000ff00 + +/* SH_JUNK_BUS_TIME_UART_SETUP_HOLD */ +/* Description: Uart_Setup_Hold */ +#define SH_JUNK_BUS_TIME_UART_SETUP_HOLD_SHFT 16 +#define SH_JUNK_BUS_TIME_UART_SETUP_HOLD_MASK 0x0000000000ff0000 + +/* SH_JUNK_BUS_TIME_UART_ENABLE */ +/* Description: Uart_Enable */ +#define SH_JUNK_BUS_TIME_UART_ENABLE_SHFT 24 +#define SH_JUNK_BUS_TIME_UART_ENABLE_MASK 0x00000000ff000000 + +/* ==================================================================== */ +/* Register "SH_JUNK_LATCH_TIME" */ +/* Junk Bus Latch Timing */ +/* ==================================================================== */ + +#define SH_JUNK_LATCH_TIME 0x0000000110020080 +#define SH_JUNK_LATCH_TIME_MASK 0x0000000000000007 +#define SH_JUNK_LATCH_TIME_INIT 0x0000000000000002 + +/* SH_JUNK_LATCH_TIME_SETUP_HOLD */ +/* Description: Setup and Hold Time */ +#define SH_JUNK_LATCH_TIME_SETUP_HOLD_SHFT 0 +#define SH_JUNK_LATCH_TIME_SETUP_HOLD_MASK 0x0000000000000007 + +/* ==================================================================== */ +/* Register "SH_JUNK_NACK_RESET" */ +/* Junk Bus Nack Counter Reset */ +/* ==================================================================== */ + +#define SH_JUNK_NACK_RESET 0x0000000110020100 +#define SH_JUNK_NACK_RESET_MASK 0x0000000000000001 +#define SH_JUNK_NACK_RESET_INIT 0x0000000000000000 + +/* SH_JUNK_NACK_RESET_PULSE */ +/* Description: Junk bus nack counter reset */ +#define SH_JUNK_NACK_RESET_PULSE_SHFT 0 +#define SH_JUNK_NACK_RESET_PULSE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_JUNK_BUS_LED0" */ +/* Junk Bus LED0 */ +/* ==================================================================== */ + +#define SH_JUNK_BUS_LED0 0x0000000110030000 +#define SH_JUNK_BUS_LED0_MASK 0x00000000000000ff +#define SH_JUNK_BUS_LED0_INIT 0x0000000000000000 + +/* SH_JUNK_BUS_LED0_LED0_DATA */ +/* Description: LED0_data */ +#define SH_JUNK_BUS_LED0_LED0_DATA_SHFT 0 +#define SH_JUNK_BUS_LED0_LED0_DATA_MASK 0x00000000000000ff + +/* ==================================================================== */ +/* Register "SH_JUNK_BUS_LED1" */ +/* Junk Bus LED1 */ +/* ==================================================================== */ + +#define SH_JUNK_BUS_LED1 0x0000000110030080 +#define SH_JUNK_BUS_LED1_MASK 0x00000000000000ff +#define SH_JUNK_BUS_LED1_INIT 0x0000000000000000 + +/* SH_JUNK_BUS_LED1_LED1_DATA */ +/* Description: LED1_data */ +#define SH_JUNK_BUS_LED1_LED1_DATA_SHFT 0 +#define SH_JUNK_BUS_LED1_LED1_DATA_MASK 0x00000000000000ff + +/* ==================================================================== */ +/* Register "SH_JUNK_BUS_LED2" */ +/* Junk Bus LED2 */ +/* ==================================================================== */ + +#define SH_JUNK_BUS_LED2 0x0000000110030100 +#define SH_JUNK_BUS_LED2_MASK 0x00000000000000ff +#define SH_JUNK_BUS_LED2_INIT 0x0000000000000000 + +/* SH_JUNK_BUS_LED2_LED2_DATA */ +/* Description: LED2_data */ +#define SH_JUNK_BUS_LED2_LED2_DATA_SHFT 0 +#define SH_JUNK_BUS_LED2_LED2_DATA_MASK 0x00000000000000ff + +/* ==================================================================== */ +/* Register "SH_JUNK_BUS_LED3" */ +/* Junk Bus LED3 */ +/* ==================================================================== */ + +#define SH_JUNK_BUS_LED3 0x0000000110030180 +#define SH_JUNK_BUS_LED3_MASK 0x00000000000000ff +#define SH_JUNK_BUS_LED3_INIT 0x0000000000000000 + +/* SH_JUNK_BUS_LED3_LED3_DATA */ +/* Description: LED3_data */ +#define SH_JUNK_BUS_LED3_LED3_DATA_SHFT 0 +#define SH_JUNK_BUS_LED3_LED3_DATA_MASK 0x00000000000000ff + +/* ==================================================================== */ +/* Register "SH_JUNK_ERROR_STATUS" */ +/* Junk Bus Error Status */ +/* ==================================================================== */ + +#define SH_JUNK_ERROR_STATUS 0x0000000110030200 +#define SH_JUNK_ERROR_STATUS_MASK 0x1fff7fffffffffff +#define SH_JUNK_ERROR_STATUS_INIT 0x0000000000000000 + +/* SH_JUNK_ERROR_STATUS_ADDRESS */ +/* Description: Failing junk bus address */ +#define SH_JUNK_ERROR_STATUS_ADDRESS_SHFT 0 +#define SH_JUNK_ERROR_STATUS_ADDRESS_MASK 0x00007fffffffffff + +/* SH_JUNK_ERROR_STATUS_CMD */ +/* Description: Junk bus command */ +#define SH_JUNK_ERROR_STATUS_CMD_SHFT 48 +#define SH_JUNK_ERROR_STATUS_CMD_MASK 0x00ff000000000000 + +/* SH_JUNK_ERROR_STATUS_MODE */ +/* Description: Mode */ +#define SH_JUNK_ERROR_STATUS_MODE_SHFT 56 +#define SH_JUNK_ERROR_STATUS_MODE_MASK 0x0100000000000000 + +/* SH_JUNK_ERROR_STATUS_STATUS */ +/* Description: Status */ +#define SH_JUNK_ERROR_STATUS_STATUS_SHFT 57 +#define SH_JUNK_ERROR_STATUS_STATUS_MASK 0x1e00000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_STAT" */ +/* This register describes the LLP status. */ +/* ==================================================================== */ + +#define SH_NI0_LLP_STAT 0x0000000150000000 +#define SH_NI0_LLP_STAT_MASK 0x000000000000000f +#define SH_NI0_LLP_STAT_INIT 0x0000000000000000 + +/* SH_NI0_LLP_STAT_LINK_RESET_STATE */ +/* Description: Status of LLP link. */ +#define SH_NI0_LLP_STAT_LINK_RESET_STATE_SHFT 0 +#define SH_NI0_LLP_STAT_LINK_RESET_STATE_MASK 0x000000000000000f + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_RESET" */ +/* Writing issues a reset to the network interface */ +/* ==================================================================== */ + +#define SH_NI0_LLP_RESET 0x0000000150000008 +#define SH_NI0_LLP_RESET_MASK 0x0000000000000003 +#define SH_NI0_LLP_RESET_INIT 0x0000000000000000 + +/* SH_NI0_LLP_RESET_LINK */ +/* Description: Send Link Reset. Generates a pulse. */ +#define SH_NI0_LLP_RESET_LINK_SHFT 0 +#define SH_NI0_LLP_RESET_LINK_MASK 0x0000000000000001 + +/* SH_NI0_LLP_RESET_WARM */ +/* Description: Send Warm Reset. Generates a pulse. */ +#define SH_NI0_LLP_RESET_WARM_SHFT 1 +#define SH_NI0_LLP_RESET_WARM_MASK 0x0000000000000002 + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_RESET_EN" */ +/* Controls LLP warm reset propagation */ +/* ==================================================================== */ + +#define SH_NI0_LLP_RESET_EN 0x0000000150000010 +#define SH_NI0_LLP_RESET_EN_MASK 0x0000000000000001 +#define SH_NI0_LLP_RESET_EN_INIT 0x0000000000000001 + +/* SH_NI0_LLP_RESET_EN_OK */ +/* Description: Allow LLP warm reset to reset SHUB */ +#define SH_NI0_LLP_RESET_EN_OK_SHFT 0 +#define SH_NI0_LLP_RESET_EN_OK_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_CHAN_MODE" */ +/* Sets the signaling mode of LLP and channel */ +/* ==================================================================== */ + +#define SH_NI0_LLP_CHAN_MODE 0x0000000150000018 +#define SH_NI0_LLP_CHAN_MODE_MASK 0x000000000000001f +#define SH_NI0_LLP_CHAN_MODE_INIT 0x0000000000000000 + +/* SH_NI0_LLP_CHAN_MODE_BITMODE32 */ +/* Description: Enables 32-bit (plus sideband) channel phits */ +#define SH_NI0_LLP_CHAN_MODE_BITMODE32_SHFT 0 +#define SH_NI0_LLP_CHAN_MODE_BITMODE32_MASK 0x0000000000000001 + +/* SH_NI0_LLP_CHAN_MODE_AC_ENCODE */ +/* Description: Enables nearly dc-free encoding for AC-coupling */ +#define SH_NI0_LLP_CHAN_MODE_AC_ENCODE_SHFT 1 +#define SH_NI0_LLP_CHAN_MODE_AC_ENCODE_MASK 0x0000000000000002 + +/* SH_NI0_LLP_CHAN_MODE_ENABLE_TUNING */ +/* Description: Enables automatic tuning of channel skew. */ +#define SH_NI0_LLP_CHAN_MODE_ENABLE_TUNING_SHFT 2 +#define SH_NI0_LLP_CHAN_MODE_ENABLE_TUNING_MASK 0x0000000000000004 + +/* SH_NI0_LLP_CHAN_MODE_ENABLE_RMT_FT_UPD */ +/* Description: Enables remote fine tune updates */ +#define SH_NI0_LLP_CHAN_MODE_ENABLE_RMT_FT_UPD_SHFT 3 +#define SH_NI0_LLP_CHAN_MODE_ENABLE_RMT_FT_UPD_MASK 0x0000000000000008 + +/* SH_NI0_LLP_CHAN_MODE_ENABLE_CLKQUAD */ +/* Description: Enables quadrature clock in the pfssd */ +#define SH_NI0_LLP_CHAN_MODE_ENABLE_CLKQUAD_SHFT 4 +#define SH_NI0_LLP_CHAN_MODE_ENABLE_CLKQUAD_MASK 0x0000000000000010 + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_CONFIG" */ +/* Sets the configuration of LLP and channel */ +/* ==================================================================== */ + +#define SH_NI0_LLP_CONFIG 0x0000000150000020 +#define SH_NI0_LLP_CONFIG_MASK 0x0000003fffffffff +#define SH_NI0_LLP_CONFIG_INIT 0x00000007fc6ffd00 + +/* SH_NI0_LLP_CONFIG_MAXBURST */ +#define SH_NI0_LLP_CONFIG_MAXBURST_SHFT 0 +#define SH_NI0_LLP_CONFIG_MAXBURST_MASK 0x00000000000003ff + +/* SH_NI0_LLP_CONFIG_MAXRETRY */ +#define SH_NI0_LLP_CONFIG_MAXRETRY_SHFT 10 +#define SH_NI0_LLP_CONFIG_MAXRETRY_MASK 0x00000000000ffc00 + +/* SH_NI0_LLP_CONFIG_NULLTIMEOUT */ +#define SH_NI0_LLP_CONFIG_NULLTIMEOUT_SHFT 20 +#define SH_NI0_LLP_CONFIG_NULLTIMEOUT_MASK 0x0000000003f00000 + +/* SH_NI0_LLP_CONFIG_FTU_TIME */ +#define SH_NI0_LLP_CONFIG_FTU_TIME_SHFT 26 +#define SH_NI0_LLP_CONFIG_FTU_TIME_MASK 0x0000003ffc000000 + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_TEST_CTL" */ +/* ==================================================================== */ + +#define SH_NI0_LLP_TEST_CTL 0x0000000150000028 +#define SH_NI0_LLP_TEST_CTL_MASK 0x7ff3f3ffffffffff +#define SH_NI0_LLP_TEST_CTL_INIT 0x000000000a5fffff + +/* SH_NI0_LLP_TEST_CTL_PATTERN */ +/* Description: Send channel data pattern */ +#define SH_NI0_LLP_TEST_CTL_PATTERN_SHFT 0 +#define SH_NI0_LLP_TEST_CTL_PATTERN_MASK 0x000000ffffffffff + +/* SH_NI0_LLP_TEST_CTL_SEND_TEST_MODE */ +/* Description: Enables continuous send of data */ +#define SH_NI0_LLP_TEST_CTL_SEND_TEST_MODE_SHFT 40 +#define SH_NI0_LLP_TEST_CTL_SEND_TEST_MODE_MASK 0x0000030000000000 + +/* SH_NI0_LLP_TEST_CTL_WIRE_SEL */ +#define SH_NI0_LLP_TEST_CTL_WIRE_SEL_SHFT 44 +#define SH_NI0_LLP_TEST_CTL_WIRE_SEL_MASK 0x0003f00000000000 + +/* SH_NI0_LLP_TEST_CTL_LFSR_MODE */ +#define SH_NI0_LLP_TEST_CTL_LFSR_MODE_SHFT 52 +#define SH_NI0_LLP_TEST_CTL_LFSR_MODE_MASK 0x0030000000000000 + +/* SH_NI0_LLP_TEST_CTL_NOISE_MODE */ +#define SH_NI0_LLP_TEST_CTL_NOISE_MODE_SHFT 54 +#define SH_NI0_LLP_TEST_CTL_NOISE_MODE_MASK 0x00c0000000000000 + +/* SH_NI0_LLP_TEST_CTL_ARMCAPTURE */ +/* Description: Enable Capture of Next MicroPacket */ +#define SH_NI0_LLP_TEST_CTL_ARMCAPTURE_SHFT 56 +#define SH_NI0_LLP_TEST_CTL_ARMCAPTURE_MASK 0x0100000000000000 + +/* SH_NI0_LLP_TEST_CTL_CAPTURECBONLY */ +/* Description: Only capture a micropacket with a Check Byte error */ +#define SH_NI0_LLP_TEST_CTL_CAPTURECBONLY_SHFT 57 +#define SH_NI0_LLP_TEST_CTL_CAPTURECBONLY_MASK 0x0200000000000000 + +/* SH_NI0_LLP_TEST_CTL_SENDCBERROR */ +/* Description: Sends a single error */ +#define SH_NI0_LLP_TEST_CTL_SENDCBERROR_SHFT 58 +#define SH_NI0_LLP_TEST_CTL_SENDCBERROR_MASK 0x0400000000000000 + +/* SH_NI0_LLP_TEST_CTL_SENDSNERROR */ +/* Description: Sends a single sequence number error */ +#define SH_NI0_LLP_TEST_CTL_SENDSNERROR_SHFT 59 +#define SH_NI0_LLP_TEST_CTL_SENDSNERROR_MASK 0x0800000000000000 + +/* SH_NI0_LLP_TEST_CTL_FAKESNERROR */ +/* Description: Causes receiver to pretend it saw a sn error */ +#define SH_NI0_LLP_TEST_CTL_FAKESNERROR_SHFT 60 +#define SH_NI0_LLP_TEST_CTL_FAKESNERROR_MASK 0x1000000000000000 + +/* SH_NI0_LLP_TEST_CTL_CAPTURED */ +/* Description: Indicates a Valid Micropacket was captured */ +#define SH_NI0_LLP_TEST_CTL_CAPTURED_SHFT 61 +#define SH_NI0_LLP_TEST_CTL_CAPTURED_MASK 0x2000000000000000 + +/* SH_NI0_LLP_TEST_CTL_CBERROR */ +/* Description: Indicates a Micropacket with a CB error was capture */ +#define SH_NI0_LLP_TEST_CTL_CBERROR_SHFT 62 +#define SH_NI0_LLP_TEST_CTL_CBERROR_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_CAPT_WD1" */ +/* low order 64-bit captured word */ +/* ==================================================================== */ + +#define SH_NI0_LLP_CAPT_WD1 0x0000000150000030 +#define SH_NI0_LLP_CAPT_WD1_MASK 0xffffffffffffffff +#define SH_NI0_LLP_CAPT_WD1_INIT 0x0000000000000000 + +/* SH_NI0_LLP_CAPT_WD1_DATA */ +/* Description: low order 64-bit captured word */ +#define SH_NI0_LLP_CAPT_WD1_DATA_SHFT 0 +#define SH_NI0_LLP_CAPT_WD1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_CAPT_WD2" */ +/* high order 64-bit captured word */ +/* ==================================================================== */ + +#define SH_NI0_LLP_CAPT_WD2 0x0000000150000038 +#define SH_NI0_LLP_CAPT_WD2_MASK 0xffffffffffffffff +#define SH_NI0_LLP_CAPT_WD2_INIT 0x0000000000000000 + +/* SH_NI0_LLP_CAPT_WD2_DATA */ +/* Description: high order 64-bit captured word */ +#define SH_NI0_LLP_CAPT_WD2_DATA_SHFT 0 +#define SH_NI0_LLP_CAPT_WD2_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_CAPT_SBCB" */ +/* captured sideband, sequence, and CRC */ +/* ==================================================================== */ + +#define SH_NI0_LLP_CAPT_SBCB 0x0000000150000040 +#define SH_NI0_LLP_CAPT_SBCB_MASK 0x0000001fffffffff +#define SH_NI0_LLP_CAPT_SBCB_INIT 0x0000000000000000 + +/* SH_NI0_LLP_CAPT_SBCB_CAPTUREDRCVSBSN */ +/* Description: sideband and sequence */ +#define SH_NI0_LLP_CAPT_SBCB_CAPTUREDRCVSBSN_SHFT 0 +#define SH_NI0_LLP_CAPT_SBCB_CAPTUREDRCVSBSN_MASK 0x000000000000ffff + +/* SH_NI0_LLP_CAPT_SBCB_CAPTUREDRCVCRC */ +/* Description: CRC */ +#define SH_NI0_LLP_CAPT_SBCB_CAPTUREDRCVCRC_SHFT 16 +#define SH_NI0_LLP_CAPT_SBCB_CAPTUREDRCVCRC_MASK 0x00000000ffff0000 + +/* SH_NI0_LLP_CAPT_SBCB_SENTALLCBERRORS */ +/* Description: All CB errors have been sent */ +#define SH_NI0_LLP_CAPT_SBCB_SENTALLCBERRORS_SHFT 32 +#define SH_NI0_LLP_CAPT_SBCB_SENTALLCBERRORS_MASK 0x0000000100000000 + +/* SH_NI0_LLP_CAPT_SBCB_SENTALLSNERRORS */ +/* Description: All SN errors have been sent */ +#define SH_NI0_LLP_CAPT_SBCB_SENTALLSNERRORS_SHFT 33 +#define SH_NI0_LLP_CAPT_SBCB_SENTALLSNERRORS_MASK 0x0000000200000000 + +/* SH_NI0_LLP_CAPT_SBCB_FAKEDALLSNERRORS */ +/* Description: All faked SN errors have been sent */ +#define SH_NI0_LLP_CAPT_SBCB_FAKEDALLSNERRORS_SHFT 34 +#define SH_NI0_LLP_CAPT_SBCB_FAKEDALLSNERRORS_MASK 0x0000000400000000 + +/* SH_NI0_LLP_CAPT_SBCB_CHARGEOVERFLOW */ +/* Description: wire charge counter overflowed, valid if llp_mode e */ +#define SH_NI0_LLP_CAPT_SBCB_CHARGEOVERFLOW_SHFT 35 +#define SH_NI0_LLP_CAPT_SBCB_CHARGEOVERFLOW_MASK 0x0000000800000000 + +/* SH_NI0_LLP_CAPT_SBCB_CHARGEUNDERFLOW */ +/* Description: wire charge counter underflowed, valid if llp_mode */ +/* enabled */ +#define SH_NI0_LLP_CAPT_SBCB_CHARGEUNDERFLOW_SHFT 36 +#define SH_NI0_LLP_CAPT_SBCB_CHARGEUNDERFLOW_MASK 0x0000001000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_ERR" */ +/* ==================================================================== */ + +#define SH_NI0_LLP_ERR 0x0000000150000048 +#define SH_NI0_LLP_ERR_MASK 0x001fffffffffffff +#define SH_NI0_LLP_ERR_INIT 0x0000000000000000 + +/* SH_NI0_LLP_ERR_RX_SN_ERR_COUNT */ +/* Description: Counts the sequence number errors received */ +#define SH_NI0_LLP_ERR_RX_SN_ERR_COUNT_SHFT 0 +#define SH_NI0_LLP_ERR_RX_SN_ERR_COUNT_MASK 0x00000000000000ff + +/* SH_NI0_LLP_ERR_RX_CB_ERR_COUNT */ +/* Description: Counts the check byte errors received */ +#define SH_NI0_LLP_ERR_RX_CB_ERR_COUNT_SHFT 8 +#define SH_NI0_LLP_ERR_RX_CB_ERR_COUNT_MASK 0x000000000000ff00 + +/* SH_NI0_LLP_ERR_RETRY_COUNT */ +/* Description: Counts the retries */ +#define SH_NI0_LLP_ERR_RETRY_COUNT_SHFT 16 +#define SH_NI0_LLP_ERR_RETRY_COUNT_MASK 0x0000000000ff0000 + +/* SH_NI0_LLP_ERR_RETRY_TIMEOUT */ +/* Description: Indicates a retry timeout has occured */ +#define SH_NI0_LLP_ERR_RETRY_TIMEOUT_SHFT 24 +#define SH_NI0_LLP_ERR_RETRY_TIMEOUT_MASK 0x0000000001000000 + +/* SH_NI0_LLP_ERR_RCV_LINK_RESET */ +/* Description: Indicates a link reset has been received */ +#define SH_NI0_LLP_ERR_RCV_LINK_RESET_SHFT 25 +#define SH_NI0_LLP_ERR_RCV_LINK_RESET_MASK 0x0000000002000000 + +/* SH_NI0_LLP_ERR_SQUASH */ +/* Description: Indicates a micropacket was squashed */ +#define SH_NI0_LLP_ERR_SQUASH_SHFT 26 +#define SH_NI0_LLP_ERR_SQUASH_MASK 0x0000000004000000 + +/* SH_NI0_LLP_ERR_POWER_NOT_OK */ +/* Description: Detects and traps a loss of power_OK */ +#define SH_NI0_LLP_ERR_POWER_NOT_OK_SHFT 27 +#define SH_NI0_LLP_ERR_POWER_NOT_OK_MASK 0x0000000008000000 + +/* SH_NI0_LLP_ERR_WIRE_CNT */ +/* Description: counts the errors detected on a single wire test */ +#define SH_NI0_LLP_ERR_WIRE_CNT_SHFT 28 +#define SH_NI0_LLP_ERR_WIRE_CNT_MASK 0x000ffffff0000000 + +/* SH_NI0_LLP_ERR_WIRE_OVERFLOW */ +/* Description: wire_error_cnt has overflowed */ +#define SH_NI0_LLP_ERR_WIRE_OVERFLOW_SHFT 52 +#define SH_NI0_LLP_ERR_WIRE_OVERFLOW_MASK 0x0010000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_STAT" */ +/* This register describes the LLP status. */ +/* ==================================================================== */ + +#define SH_NI1_LLP_STAT 0x0000000150002000 +#define SH_NI1_LLP_STAT_MASK 0x000000000000000f +#define SH_NI1_LLP_STAT_INIT 0x0000000000000000 + +/* SH_NI1_LLP_STAT_LINK_RESET_STATE */ +/* Description: Status of LLP link. */ +#define SH_NI1_LLP_STAT_LINK_RESET_STATE_SHFT 0 +#define SH_NI1_LLP_STAT_LINK_RESET_STATE_MASK 0x000000000000000f + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_RESET" */ +/* Writing issues a reset to the network interface */ +/* ==================================================================== */ + +#define SH_NI1_LLP_RESET 0x0000000150002008 +#define SH_NI1_LLP_RESET_MASK 0x0000000000000003 +#define SH_NI1_LLP_RESET_INIT 0x0000000000000000 + +/* SH_NI1_LLP_RESET_LINK */ +/* Description: Send Link Reset. Generates a pulse. */ +#define SH_NI1_LLP_RESET_LINK_SHFT 0 +#define SH_NI1_LLP_RESET_LINK_MASK 0x0000000000000001 + +/* SH_NI1_LLP_RESET_WARM */ +/* Description: Send Warm Reset. Generates a pulse. */ +#define SH_NI1_LLP_RESET_WARM_SHFT 1 +#define SH_NI1_LLP_RESET_WARM_MASK 0x0000000000000002 + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_RESET_EN" */ +/* Controls LLP warm reset propagation */ +/* ==================================================================== */ + +#define SH_NI1_LLP_RESET_EN 0x0000000150002010 +#define SH_NI1_LLP_RESET_EN_MASK 0x0000000000000001 +#define SH_NI1_LLP_RESET_EN_INIT 0x0000000000000001 + +/* SH_NI1_LLP_RESET_EN_OK */ +/* Description: Allow LLP warm reset to reset SHUB */ +#define SH_NI1_LLP_RESET_EN_OK_SHFT 0 +#define SH_NI1_LLP_RESET_EN_OK_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_CHAN_MODE" */ +/* Sets the signaling mode of LLP and channel */ +/* ==================================================================== */ + +#define SH_NI1_LLP_CHAN_MODE 0x0000000150002018 +#define SH_NI1_LLP_CHAN_MODE_MASK 0x000000000000001f +#define SH_NI1_LLP_CHAN_MODE_INIT 0x0000000000000000 + +/* SH_NI1_LLP_CHAN_MODE_BITMODE32 */ +/* Description: Enables 32-bit (plus sideband) channel phits */ +#define SH_NI1_LLP_CHAN_MODE_BITMODE32_SHFT 0 +#define SH_NI1_LLP_CHAN_MODE_BITMODE32_MASK 0x0000000000000001 + +/* SH_NI1_LLP_CHAN_MODE_AC_ENCODE */ +/* Description: Enables nearly dc-free encoding for AC-coupling */ +#define SH_NI1_LLP_CHAN_MODE_AC_ENCODE_SHFT 1 +#define SH_NI1_LLP_CHAN_MODE_AC_ENCODE_MASK 0x0000000000000002 + +/* SH_NI1_LLP_CHAN_MODE_ENABLE_TUNING */ +/* Description: Enables automatic tuning of channel skew. */ +#define SH_NI1_LLP_CHAN_MODE_ENABLE_TUNING_SHFT 2 +#define SH_NI1_LLP_CHAN_MODE_ENABLE_TUNING_MASK 0x0000000000000004 + +/* SH_NI1_LLP_CHAN_MODE_ENABLE_RMT_FT_UPD */ +/* Description: Enables remote fine tune updates */ +#define SH_NI1_LLP_CHAN_MODE_ENABLE_RMT_FT_UPD_SHFT 3 +#define SH_NI1_LLP_CHAN_MODE_ENABLE_RMT_FT_UPD_MASK 0x0000000000000008 + +/* SH_NI1_LLP_CHAN_MODE_ENABLE_CLKQUAD */ +/* Description: Enables quadrature clock in the pfssd */ +#define SH_NI1_LLP_CHAN_MODE_ENABLE_CLKQUAD_SHFT 4 +#define SH_NI1_LLP_CHAN_MODE_ENABLE_CLKQUAD_MASK 0x0000000000000010 + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_CONFIG" */ +/* Sets the configuration of LLP and channel */ +/* ==================================================================== */ + +#define SH_NI1_LLP_CONFIG 0x0000000150002020 +#define SH_NI1_LLP_CONFIG_MASK 0x0000003fffffffff +#define SH_NI1_LLP_CONFIG_INIT 0x00000007fc6ffd00 + +/* SH_NI1_LLP_CONFIG_MAXBURST */ +#define SH_NI1_LLP_CONFIG_MAXBURST_SHFT 0 +#define SH_NI1_LLP_CONFIG_MAXBURST_MASK 0x00000000000003ff + +/* SH_NI1_LLP_CONFIG_MAXRETRY */ +#define SH_NI1_LLP_CONFIG_MAXRETRY_SHFT 10 +#define SH_NI1_LLP_CONFIG_MAXRETRY_MASK 0x00000000000ffc00 + +/* SH_NI1_LLP_CONFIG_NULLTIMEOUT */ +#define SH_NI1_LLP_CONFIG_NULLTIMEOUT_SHFT 20 +#define SH_NI1_LLP_CONFIG_NULLTIMEOUT_MASK 0x0000000003f00000 + +/* SH_NI1_LLP_CONFIG_FTU_TIME */ +#define SH_NI1_LLP_CONFIG_FTU_TIME_SHFT 26 +#define SH_NI1_LLP_CONFIG_FTU_TIME_MASK 0x0000003ffc000000 + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_TEST_CTL" */ +/* ==================================================================== */ + +#define SH_NI1_LLP_TEST_CTL 0x0000000150002028 +#define SH_NI1_LLP_TEST_CTL_MASK 0x7ff3f3ffffffffff +#define SH_NI1_LLP_TEST_CTL_INIT 0x000000000a5fffff + +/* SH_NI1_LLP_TEST_CTL_PATTERN */ +/* Description: Send channel data pattern */ +#define SH_NI1_LLP_TEST_CTL_PATTERN_SHFT 0 +#define SH_NI1_LLP_TEST_CTL_PATTERN_MASK 0x000000ffffffffff + +/* SH_NI1_LLP_TEST_CTL_SEND_TEST_MODE */ +/* Description: Enables continuous send of data */ +#define SH_NI1_LLP_TEST_CTL_SEND_TEST_MODE_SHFT 40 +#define SH_NI1_LLP_TEST_CTL_SEND_TEST_MODE_MASK 0x0000030000000000 + +/* SH_NI1_LLP_TEST_CTL_WIRE_SEL */ +#define SH_NI1_LLP_TEST_CTL_WIRE_SEL_SHFT 44 +#define SH_NI1_LLP_TEST_CTL_WIRE_SEL_MASK 0x0003f00000000000 + +/* SH_NI1_LLP_TEST_CTL_LFSR_MODE */ +#define SH_NI1_LLP_TEST_CTL_LFSR_MODE_SHFT 52 +#define SH_NI1_LLP_TEST_CTL_LFSR_MODE_MASK 0x0030000000000000 + +/* SH_NI1_LLP_TEST_CTL_NOISE_MODE */ +#define SH_NI1_LLP_TEST_CTL_NOISE_MODE_SHFT 54 +#define SH_NI1_LLP_TEST_CTL_NOISE_MODE_MASK 0x00c0000000000000 + +/* SH_NI1_LLP_TEST_CTL_ARMCAPTURE */ +/* Description: Enable Capture of Next MicroPacket */ +#define SH_NI1_LLP_TEST_CTL_ARMCAPTURE_SHFT 56 +#define SH_NI1_LLP_TEST_CTL_ARMCAPTURE_MASK 0x0100000000000000 + +/* SH_NI1_LLP_TEST_CTL_CAPTURECBONLY */ +/* Description: Only capture a micropacket with a Check Byte error */ +#define SH_NI1_LLP_TEST_CTL_CAPTURECBONLY_SHFT 57 +#define SH_NI1_LLP_TEST_CTL_CAPTURECBONLY_MASK 0x0200000000000000 + +/* SH_NI1_LLP_TEST_CTL_SENDCBERROR */ +/* Description: Sends a single error */ +#define SH_NI1_LLP_TEST_CTL_SENDCBERROR_SHFT 58 +#define SH_NI1_LLP_TEST_CTL_SENDCBERROR_MASK 0x0400000000000000 + +/* SH_NI1_LLP_TEST_CTL_SENDSNERROR */ +/* Description: Sends a single sequence number error */ +#define SH_NI1_LLP_TEST_CTL_SENDSNERROR_SHFT 59 +#define SH_NI1_LLP_TEST_CTL_SENDSNERROR_MASK 0x0800000000000000 + +/* SH_NI1_LLP_TEST_CTL_FAKESNERROR */ +/* Description: Causes receiver to pretend it saw a sn error */ +#define SH_NI1_LLP_TEST_CTL_FAKESNERROR_SHFT 60 +#define SH_NI1_LLP_TEST_CTL_FAKESNERROR_MASK 0x1000000000000000 + +/* SH_NI1_LLP_TEST_CTL_CAPTURED */ +/* Description: Indicates a Valid Micropacket was captured */ +#define SH_NI1_LLP_TEST_CTL_CAPTURED_SHFT 61 +#define SH_NI1_LLP_TEST_CTL_CAPTURED_MASK 0x2000000000000000 + +/* SH_NI1_LLP_TEST_CTL_CBERROR */ +/* Description: Indicates a Micropacket with a CB error was capture */ +#define SH_NI1_LLP_TEST_CTL_CBERROR_SHFT 62 +#define SH_NI1_LLP_TEST_CTL_CBERROR_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_CAPT_WD1" */ +/* low order 64-bit captured word */ +/* ==================================================================== */ + +#define SH_NI1_LLP_CAPT_WD1 0x0000000150002030 +#define SH_NI1_LLP_CAPT_WD1_MASK 0xffffffffffffffff +#define SH_NI1_LLP_CAPT_WD1_INIT 0x0000000000000000 + +/* SH_NI1_LLP_CAPT_WD1_DATA */ +/* Description: low order 64-bit captured word */ +#define SH_NI1_LLP_CAPT_WD1_DATA_SHFT 0 +#define SH_NI1_LLP_CAPT_WD1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_CAPT_WD2" */ +/* high order 64-bit captured word */ +/* ==================================================================== */ + +#define SH_NI1_LLP_CAPT_WD2 0x0000000150002038 +#define SH_NI1_LLP_CAPT_WD2_MASK 0xffffffffffffffff +#define SH_NI1_LLP_CAPT_WD2_INIT 0x0000000000000000 + +/* SH_NI1_LLP_CAPT_WD2_DATA */ +/* Description: high order 64-bit captured word */ +#define SH_NI1_LLP_CAPT_WD2_DATA_SHFT 0 +#define SH_NI1_LLP_CAPT_WD2_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_CAPT_SBCB" */ +/* captured sideband, sequence, and CRC */ +/* ==================================================================== */ + +#define SH_NI1_LLP_CAPT_SBCB 0x0000000150002040 +#define SH_NI1_LLP_CAPT_SBCB_MASK 0x0000001fffffffff +#define SH_NI1_LLP_CAPT_SBCB_INIT 0x0000000000000000 + +/* SH_NI1_LLP_CAPT_SBCB_CAPTUREDRCVSBSN */ +/* Description: sideband and sequence */ +#define SH_NI1_LLP_CAPT_SBCB_CAPTUREDRCVSBSN_SHFT 0 +#define SH_NI1_LLP_CAPT_SBCB_CAPTUREDRCVSBSN_MASK 0x000000000000ffff + +/* SH_NI1_LLP_CAPT_SBCB_CAPTUREDRCVCRC */ +/* Description: CRC */ +#define SH_NI1_LLP_CAPT_SBCB_CAPTUREDRCVCRC_SHFT 16 +#define SH_NI1_LLP_CAPT_SBCB_CAPTUREDRCVCRC_MASK 0x00000000ffff0000 + +/* SH_NI1_LLP_CAPT_SBCB_SENTALLCBERRORS */ +/* Description: All CB errors have been sent */ +#define SH_NI1_LLP_CAPT_SBCB_SENTALLCBERRORS_SHFT 32 +#define SH_NI1_LLP_CAPT_SBCB_SENTALLCBERRORS_MASK 0x0000000100000000 + +/* SH_NI1_LLP_CAPT_SBCB_SENTALLSNERRORS */ +/* Description: All SN errors have been sent */ +#define SH_NI1_LLP_CAPT_SBCB_SENTALLSNERRORS_SHFT 33 +#define SH_NI1_LLP_CAPT_SBCB_SENTALLSNERRORS_MASK 0x0000000200000000 + +/* SH_NI1_LLP_CAPT_SBCB_FAKEDALLSNERRORS */ +/* Description: All faked SN errors have been sent */ +#define SH_NI1_LLP_CAPT_SBCB_FAKEDALLSNERRORS_SHFT 34 +#define SH_NI1_LLP_CAPT_SBCB_FAKEDALLSNERRORS_MASK 0x0000000400000000 + +/* SH_NI1_LLP_CAPT_SBCB_CHARGEOVERFLOW */ +/* Description: wire charge counter overflowed, valid if llp_mode e */ +#define SH_NI1_LLP_CAPT_SBCB_CHARGEOVERFLOW_SHFT 35 +#define SH_NI1_LLP_CAPT_SBCB_CHARGEOVERFLOW_MASK 0x0000000800000000 + +/* SH_NI1_LLP_CAPT_SBCB_CHARGEUNDERFLOW */ +/* Description: wire charge counter underflowed, valid if llp_mode */ +/* enabled */ +#define SH_NI1_LLP_CAPT_SBCB_CHARGEUNDERFLOW_SHFT 36 +#define SH_NI1_LLP_CAPT_SBCB_CHARGEUNDERFLOW_MASK 0x0000001000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_ERR" */ +/* ==================================================================== */ + +#define SH_NI1_LLP_ERR 0x0000000150002048 +#define SH_NI1_LLP_ERR_MASK 0x001fffffffffffff +#define SH_NI1_LLP_ERR_INIT 0x0000000000000000 + +/* SH_NI1_LLP_ERR_RX_SN_ERR_COUNT */ +/* Description: Counts the sequence number errors received */ +#define SH_NI1_LLP_ERR_RX_SN_ERR_COUNT_SHFT 0 +#define SH_NI1_LLP_ERR_RX_SN_ERR_COUNT_MASK 0x00000000000000ff + +/* SH_NI1_LLP_ERR_RX_CB_ERR_COUNT */ +/* Description: Counts the check byte errors received */ +#define SH_NI1_LLP_ERR_RX_CB_ERR_COUNT_SHFT 8 +#define SH_NI1_LLP_ERR_RX_CB_ERR_COUNT_MASK 0x000000000000ff00 + +/* SH_NI1_LLP_ERR_RETRY_COUNT */ +/* Description: Counts the retries */ +#define SH_NI1_LLP_ERR_RETRY_COUNT_SHFT 16 +#define SH_NI1_LLP_ERR_RETRY_COUNT_MASK 0x0000000000ff0000 + +/* SH_NI1_LLP_ERR_RETRY_TIMEOUT */ +/* Description: Indicates a retry timeout has occured */ +#define SH_NI1_LLP_ERR_RETRY_TIMEOUT_SHFT 24 +#define SH_NI1_LLP_ERR_RETRY_TIMEOUT_MASK 0x0000000001000000 + +/* SH_NI1_LLP_ERR_RCV_LINK_RESET */ +/* Description: Indicates a link reset has been received */ +#define SH_NI1_LLP_ERR_RCV_LINK_RESET_SHFT 25 +#define SH_NI1_LLP_ERR_RCV_LINK_RESET_MASK 0x0000000002000000 + +/* SH_NI1_LLP_ERR_SQUASH */ +/* Description: Indicates a micropacket was squashed */ +#define SH_NI1_LLP_ERR_SQUASH_SHFT 26 +#define SH_NI1_LLP_ERR_SQUASH_MASK 0x0000000004000000 + +/* SH_NI1_LLP_ERR_POWER_NOT_OK */ +/* Description: Detects and traps a loss of power_OK */ +#define SH_NI1_LLP_ERR_POWER_NOT_OK_SHFT 27 +#define SH_NI1_LLP_ERR_POWER_NOT_OK_MASK 0x0000000008000000 + +/* SH_NI1_LLP_ERR_WIRE_CNT */ +/* Description: counts the errors detected on a single wire test */ +#define SH_NI1_LLP_ERR_WIRE_CNT_SHFT 28 +#define SH_NI1_LLP_ERR_WIRE_CNT_MASK 0x000ffffff0000000 + +/* SH_NI1_LLP_ERR_WIRE_OVERFLOW */ +/* Description: wire_error_cnt has overflowed */ +#define SH_NI1_LLP_ERR_WIRE_OVERFLOW_SHFT 52 +#define SH_NI1_LLP_ERR_WIRE_OVERFLOW_MASK 0x0010000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_LLP_TO_FIFO02_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_LLP_TO_FIFO02_FLOW 0x0000000150001010 +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_MASK 0x3f3f003f3f00bfbf +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI0_LLP_TO_FIFO02_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI0_LLP_TO_FIFO02_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI0_LLP_TO_FIFO02_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNNI0_LLP_TO_FIFO02_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNNI0_LLP_TO_FIFO02_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_CREDIT_VC0_DYN_MASK 0x000000003f000000 + +/* SH_XNNI0_LLP_TO_FIFO02_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_CREDIT_VC0_CAP_MASK 0x0000003f00000000 + +/* SH_XNNI0_LLP_TO_FIFO02_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_CREDIT_VC2_DYN_MASK 0x003f000000000000 + +/* SH_XNNI0_LLP_TO_FIFO02_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNNI0_LLP_TO_FIFO02_FLOW_CREDIT_VC2_CAP_MASK 0x3f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_LLP_TO_FIFO13_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_LLP_TO_FIFO13_FLOW 0x0000000150001020 +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_MASK 0x3f3f003f3f00bfbf +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI0_LLP_TO_FIFO13_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI0_LLP_TO_FIFO13_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI0_LLP_TO_FIFO13_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNNI0_LLP_TO_FIFO13_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNNI0_LLP_TO_FIFO13_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_CREDIT_VC0_DYN_MASK 0x000000003f000000 + +/* SH_XNNI0_LLP_TO_FIFO13_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_CREDIT_VC0_CAP_MASK 0x0000003f00000000 + +/* SH_XNNI0_LLP_TO_FIFO13_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_CREDIT_VC2_DYN_MASK 0x003f000000000000 + +/* SH_XNNI0_LLP_TO_FIFO13_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNNI0_LLP_TO_FIFO13_FLOW_CREDIT_VC2_CAP_MASK 0x3f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_LLP_DEBIT_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_LLP_DEBIT_FLOW 0x0000000150001030 +#define SH_XNNI0_LLP_DEBIT_FLOW_MASK 0x1f1f1f1f1f1f1f1f +#define SH_XNNI0_LLP_DEBIT_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC0_DYN */ +/* Description: vc0 debit dynamic value */ +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC0_DYN_SHFT 0 +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC0_DYN_MASK 0x000000000000001f + +/* SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC0_CAP */ +/* Description: vc0 debit captured value */ +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC0_CAP_SHFT 8 +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC0_CAP_MASK 0x0000000000001f00 + +/* SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC1_DYN */ +/* Description: vc1 debit dynamic value */ +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC1_DYN_SHFT 16 +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC1_DYN_MASK 0x00000000001f0000 + +/* SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC1_CAP */ +/* Description: vc1 debit captured value */ +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC1_CAP_SHFT 24 +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC1_CAP_MASK 0x000000001f000000 + +/* SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC2_DYN */ +/* Description: vc2 debit dynamic value */ +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC2_DYN_SHFT 32 +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC2_DYN_MASK 0x0000001f00000000 + +/* SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC2_CAP */ +/* Description: vc2 debit captured value */ +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC2_CAP_SHFT 40 +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC2_CAP_MASK 0x00001f0000000000 + +/* SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC3_DYN */ +/* Description: vc3 debit dynamic value */ +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC3_DYN_SHFT 48 +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC3_DYN_MASK 0x001f000000000000 + +/* SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC3_CAP */ +/* Description: vc3 debit captured value */ +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC3_CAP_SHFT 56 +#define SH_XNNI0_LLP_DEBIT_FLOW_DEBIT_VC3_CAP_MASK 0x1f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_LINK_0_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_LINK_0_FLOW 0x0000000150001040 +#define SH_XNNI0_LINK_0_FLOW_MASK 0x000000007f7f7fbf +#define SH_XNNI0_LINK_0_FLOW_INIT 0x0000000000001800 + +/* SH_XNNI0_LINK_0_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI0_LINK_0_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI0_LINK_0_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI0_LINK_0_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on vc0 from debit cntr */ +#define SH_XNNI0_LINK_0_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI0_LINK_0_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI0_LINK_0_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 Limit Test */ +#define SH_XNNI0_LINK_0_FLOW_CREDIT_VC0_TEST_SHFT 8 +#define SH_XNNI0_LINK_0_FLOW_CREDIT_VC0_TEST_MASK 0x0000000000007f00 + +/* SH_XNNI0_LINK_0_FLOW_CREDIT_VC0_DYN */ +/* Description: Dynamic vc0 credit value */ +#define SH_XNNI0_LINK_0_FLOW_CREDIT_VC0_DYN_SHFT 16 +#define SH_XNNI0_LINK_0_FLOW_CREDIT_VC0_DYN_MASK 0x00000000007f0000 + +/* SH_XNNI0_LINK_0_FLOW_CREDIT_VC0_CAP */ +/* Description: Captured vc0 credit */ +#define SH_XNNI0_LINK_0_FLOW_CREDIT_VC0_CAP_SHFT 24 +#define SH_XNNI0_LINK_0_FLOW_CREDIT_VC0_CAP_MASK 0x000000007f000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_LINK_1_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_LINK_1_FLOW 0x0000000150001050 +#define SH_XNNI0_LINK_1_FLOW_MASK 0x000000007f7f7fbf +#define SH_XNNI0_LINK_1_FLOW_INIT 0x0000000000001800 + +/* SH_XNNI0_LINK_1_FLOW_DEBIT_VC1_WITHHOLD */ +/* Description: vc1 withhold */ +#define SH_XNNI0_LINK_1_FLOW_DEBIT_VC1_WITHHOLD_SHFT 0 +#define SH_XNNI0_LINK_1_FLOW_DEBIT_VC1_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI0_LINK_1_FLOW_DEBIT_VC1_FORCE_CRED */ +/* Description: Force Credit on vc1 from debit cntr */ +#define SH_XNNI0_LINK_1_FLOW_DEBIT_VC1_FORCE_CRED_SHFT 7 +#define SH_XNNI0_LINK_1_FLOW_DEBIT_VC1_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI0_LINK_1_FLOW_CREDIT_VC1_TEST */ +/* Description: vc1 Limit Test */ +#define SH_XNNI0_LINK_1_FLOW_CREDIT_VC1_TEST_SHFT 8 +#define SH_XNNI0_LINK_1_FLOW_CREDIT_VC1_TEST_MASK 0x0000000000007f00 + +/* SH_XNNI0_LINK_1_FLOW_CREDIT_VC1_DYN */ +/* Description: Dynamic vc1 credit value */ +#define SH_XNNI0_LINK_1_FLOW_CREDIT_VC1_DYN_SHFT 16 +#define SH_XNNI0_LINK_1_FLOW_CREDIT_VC1_DYN_MASK 0x00000000007f0000 + +/* SH_XNNI0_LINK_1_FLOW_CREDIT_VC1_CAP */ +/* Description: Captured vc1 credit */ +#define SH_XNNI0_LINK_1_FLOW_CREDIT_VC1_CAP_SHFT 24 +#define SH_XNNI0_LINK_1_FLOW_CREDIT_VC1_CAP_MASK 0x000000007f000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_LINK_2_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_LINK_2_FLOW 0x0000000150001060 +#define SH_XNNI0_LINK_2_FLOW_MASK 0x000000007f7f7fbf +#define SH_XNNI0_LINK_2_FLOW_INIT 0x0000000000001800 + +/* SH_XNNI0_LINK_2_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI0_LINK_2_FLOW_DEBIT_VC2_WITHHOLD_SHFT 0 +#define SH_XNNI0_LINK_2_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI0_LINK_2_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on vc2 from debit cntr */ +#define SH_XNNI0_LINK_2_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 7 +#define SH_XNNI0_LINK_2_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI0_LINK_2_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 Limit Test */ +#define SH_XNNI0_LINK_2_FLOW_CREDIT_VC2_TEST_SHFT 8 +#define SH_XNNI0_LINK_2_FLOW_CREDIT_VC2_TEST_MASK 0x0000000000007f00 + +/* SH_XNNI0_LINK_2_FLOW_CREDIT_VC2_DYN */ +/* Description: Dynamic vc2 credit value */ +#define SH_XNNI0_LINK_2_FLOW_CREDIT_VC2_DYN_SHFT 16 +#define SH_XNNI0_LINK_2_FLOW_CREDIT_VC2_DYN_MASK 0x00000000007f0000 + +/* SH_XNNI0_LINK_2_FLOW_CREDIT_VC2_CAP */ +/* Description: Captured vc2 credit */ +#define SH_XNNI0_LINK_2_FLOW_CREDIT_VC2_CAP_SHFT 24 +#define SH_XNNI0_LINK_2_FLOW_CREDIT_VC2_CAP_MASK 0x000000007f000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_LINK_3_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_LINK_3_FLOW 0x0000000150001070 +#define SH_XNNI0_LINK_3_FLOW_MASK 0x000000007f7f7fbf +#define SH_XNNI0_LINK_3_FLOW_INIT 0x0000000000001800 + +/* SH_XNNI0_LINK_3_FLOW_DEBIT_VC3_WITHHOLD */ +/* Description: vc3 withhold */ +#define SH_XNNI0_LINK_3_FLOW_DEBIT_VC3_WITHHOLD_SHFT 0 +#define SH_XNNI0_LINK_3_FLOW_DEBIT_VC3_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI0_LINK_3_FLOW_DEBIT_VC3_FORCE_CRED */ +/* Description: Force Credit on vc3 from debit cntr */ +#define SH_XNNI0_LINK_3_FLOW_DEBIT_VC3_FORCE_CRED_SHFT 7 +#define SH_XNNI0_LINK_3_FLOW_DEBIT_VC3_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI0_LINK_3_FLOW_CREDIT_VC3_TEST */ +/* Description: vc3 Limit Test */ +#define SH_XNNI0_LINK_3_FLOW_CREDIT_VC3_TEST_SHFT 8 +#define SH_XNNI0_LINK_3_FLOW_CREDIT_VC3_TEST_MASK 0x0000000000007f00 + +/* SH_XNNI0_LINK_3_FLOW_CREDIT_VC3_DYN */ +/* Description: Dynamic vc3 credit value */ +#define SH_XNNI0_LINK_3_FLOW_CREDIT_VC3_DYN_SHFT 16 +#define SH_XNNI0_LINK_3_FLOW_CREDIT_VC3_DYN_MASK 0x00000000007f0000 + +/* SH_XNNI0_LINK_3_FLOW_CREDIT_VC3_CAP */ +/* Description: Captured vc3 credit */ +#define SH_XNNI0_LINK_3_FLOW_CREDIT_VC3_CAP_SHFT 24 +#define SH_XNNI0_LINK_3_FLOW_CREDIT_VC3_CAP_MASK 0x000000007f000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_LLP_TO_FIFO02_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_LLP_TO_FIFO02_FLOW 0x0000000150003010 +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_MASK 0x3f3f003f3f00bfbf +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI1_LLP_TO_FIFO02_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI1_LLP_TO_FIFO02_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI1_LLP_TO_FIFO02_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNNI1_LLP_TO_FIFO02_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNNI1_LLP_TO_FIFO02_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_CREDIT_VC0_DYN_MASK 0x000000003f000000 + +/* SH_XNNI1_LLP_TO_FIFO02_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_CREDIT_VC0_CAP_MASK 0x0000003f00000000 + +/* SH_XNNI1_LLP_TO_FIFO02_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_CREDIT_VC2_DYN_MASK 0x003f000000000000 + +/* SH_XNNI1_LLP_TO_FIFO02_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNNI1_LLP_TO_FIFO02_FLOW_CREDIT_VC2_CAP_MASK 0x3f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_LLP_TO_FIFO13_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_LLP_TO_FIFO13_FLOW 0x0000000150003020 +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_MASK 0x3f3f003f3f00bfbf +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI1_LLP_TO_FIFO13_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI1_LLP_TO_FIFO13_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI1_LLP_TO_FIFO13_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNNI1_LLP_TO_FIFO13_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNNI1_LLP_TO_FIFO13_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_CREDIT_VC0_DYN_MASK 0x000000003f000000 + +/* SH_XNNI1_LLP_TO_FIFO13_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_CREDIT_VC0_CAP_MASK 0x0000003f00000000 + +/* SH_XNNI1_LLP_TO_FIFO13_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_CREDIT_VC2_DYN_MASK 0x003f000000000000 + +/* SH_XNNI1_LLP_TO_FIFO13_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNNI1_LLP_TO_FIFO13_FLOW_CREDIT_VC2_CAP_MASK 0x3f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_LLP_DEBIT_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_LLP_DEBIT_FLOW 0x0000000150003030 +#define SH_XNNI1_LLP_DEBIT_FLOW_MASK 0x1f1f1f1f1f1f1f1f +#define SH_XNNI1_LLP_DEBIT_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC0_DYN */ +/* Description: vc0 debit dynamic value */ +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC0_DYN_SHFT 0 +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC0_DYN_MASK 0x000000000000001f + +/* SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC0_CAP */ +/* Description: vc0 debit captured value */ +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC0_CAP_SHFT 8 +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC0_CAP_MASK 0x0000000000001f00 + +/* SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC1_DYN */ +/* Description: vc1 debit dynamic value */ +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC1_DYN_SHFT 16 +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC1_DYN_MASK 0x00000000001f0000 + +/* SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC1_CAP */ +/* Description: vc1 debit captured value */ +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC1_CAP_SHFT 24 +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC1_CAP_MASK 0x000000001f000000 + +/* SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC2_DYN */ +/* Description: vc2 debit dynamic value */ +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC2_DYN_SHFT 32 +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC2_DYN_MASK 0x0000001f00000000 + +/* SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC2_CAP */ +/* Description: vc2 debit captured value */ +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC2_CAP_SHFT 40 +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC2_CAP_MASK 0x00001f0000000000 + +/* SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC3_DYN */ +/* Description: vc3 debit dynamic value */ +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC3_DYN_SHFT 48 +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC3_DYN_MASK 0x001f000000000000 + +/* SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC3_CAP */ +/* Description: vc3 debit captured value */ +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC3_CAP_SHFT 56 +#define SH_XNNI1_LLP_DEBIT_FLOW_DEBIT_VC3_CAP_MASK 0x1f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_LINK_0_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_LINK_0_FLOW 0x0000000150003040 +#define SH_XNNI1_LINK_0_FLOW_MASK 0x000000007f7f7fbf +#define SH_XNNI1_LINK_0_FLOW_INIT 0x0000000000001800 + +/* SH_XNNI1_LINK_0_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI1_LINK_0_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI1_LINK_0_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI1_LINK_0_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on vc0 from debit cntr */ +#define SH_XNNI1_LINK_0_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI1_LINK_0_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI1_LINK_0_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 Limit Test */ +#define SH_XNNI1_LINK_0_FLOW_CREDIT_VC0_TEST_SHFT 8 +#define SH_XNNI1_LINK_0_FLOW_CREDIT_VC0_TEST_MASK 0x0000000000007f00 + +/* SH_XNNI1_LINK_0_FLOW_CREDIT_VC0_DYN */ +/* Description: Dynamic vc0 credit value */ +#define SH_XNNI1_LINK_0_FLOW_CREDIT_VC0_DYN_SHFT 16 +#define SH_XNNI1_LINK_0_FLOW_CREDIT_VC0_DYN_MASK 0x00000000007f0000 + +/* SH_XNNI1_LINK_0_FLOW_CREDIT_VC0_CAP */ +/* Description: Captured vc0 credit */ +#define SH_XNNI1_LINK_0_FLOW_CREDIT_VC0_CAP_SHFT 24 +#define SH_XNNI1_LINK_0_FLOW_CREDIT_VC0_CAP_MASK 0x000000007f000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_LINK_1_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_LINK_1_FLOW 0x0000000150003050 +#define SH_XNNI1_LINK_1_FLOW_MASK 0x000000007f7f7fbf +#define SH_XNNI1_LINK_1_FLOW_INIT 0x0000000000001800 + +/* SH_XNNI1_LINK_1_FLOW_DEBIT_VC1_WITHHOLD */ +/* Description: vc1 withhold */ +#define SH_XNNI1_LINK_1_FLOW_DEBIT_VC1_WITHHOLD_SHFT 0 +#define SH_XNNI1_LINK_1_FLOW_DEBIT_VC1_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI1_LINK_1_FLOW_DEBIT_VC1_FORCE_CRED */ +/* Description: Force Credit on vc1 from debit cntr */ +#define SH_XNNI1_LINK_1_FLOW_DEBIT_VC1_FORCE_CRED_SHFT 7 +#define SH_XNNI1_LINK_1_FLOW_DEBIT_VC1_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI1_LINK_1_FLOW_CREDIT_VC1_TEST */ +/* Description: vc1 Limit Test */ +#define SH_XNNI1_LINK_1_FLOW_CREDIT_VC1_TEST_SHFT 8 +#define SH_XNNI1_LINK_1_FLOW_CREDIT_VC1_TEST_MASK 0x0000000000007f00 + +/* SH_XNNI1_LINK_1_FLOW_CREDIT_VC1_DYN */ +/* Description: Dynamic vc1 credit value */ +#define SH_XNNI1_LINK_1_FLOW_CREDIT_VC1_DYN_SHFT 16 +#define SH_XNNI1_LINK_1_FLOW_CREDIT_VC1_DYN_MASK 0x00000000007f0000 + +/* SH_XNNI1_LINK_1_FLOW_CREDIT_VC1_CAP */ +/* Description: Captured vc1 credit */ +#define SH_XNNI1_LINK_1_FLOW_CREDIT_VC1_CAP_SHFT 24 +#define SH_XNNI1_LINK_1_FLOW_CREDIT_VC1_CAP_MASK 0x000000007f000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_LINK_2_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_LINK_2_FLOW 0x0000000150003060 +#define SH_XNNI1_LINK_2_FLOW_MASK 0x000000007f7f7fbf +#define SH_XNNI1_LINK_2_FLOW_INIT 0x0000000000001800 + +/* SH_XNNI1_LINK_2_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI1_LINK_2_FLOW_DEBIT_VC2_WITHHOLD_SHFT 0 +#define SH_XNNI1_LINK_2_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI1_LINK_2_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on vc2 from debit cntr */ +#define SH_XNNI1_LINK_2_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 7 +#define SH_XNNI1_LINK_2_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI1_LINK_2_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 Limit Test */ +#define SH_XNNI1_LINK_2_FLOW_CREDIT_VC2_TEST_SHFT 8 +#define SH_XNNI1_LINK_2_FLOW_CREDIT_VC2_TEST_MASK 0x0000000000007f00 + +/* SH_XNNI1_LINK_2_FLOW_CREDIT_VC2_DYN */ +/* Description: Dynamic vc2 credit value */ +#define SH_XNNI1_LINK_2_FLOW_CREDIT_VC2_DYN_SHFT 16 +#define SH_XNNI1_LINK_2_FLOW_CREDIT_VC2_DYN_MASK 0x00000000007f0000 + +/* SH_XNNI1_LINK_2_FLOW_CREDIT_VC2_CAP */ +/* Description: Captured vc2 credit */ +#define SH_XNNI1_LINK_2_FLOW_CREDIT_VC2_CAP_SHFT 24 +#define SH_XNNI1_LINK_2_FLOW_CREDIT_VC2_CAP_MASK 0x000000007f000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_LINK_3_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_LINK_3_FLOW 0x0000000150003070 +#define SH_XNNI1_LINK_3_FLOW_MASK 0x000000007f7f7fbf +#define SH_XNNI1_LINK_3_FLOW_INIT 0x0000000000001800 + +/* SH_XNNI1_LINK_3_FLOW_DEBIT_VC3_WITHHOLD */ +/* Description: vc3 withhold */ +#define SH_XNNI1_LINK_3_FLOW_DEBIT_VC3_WITHHOLD_SHFT 0 +#define SH_XNNI1_LINK_3_FLOW_DEBIT_VC3_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI1_LINK_3_FLOW_DEBIT_VC3_FORCE_CRED */ +/* Description: Force Credit on vc3 from debit cntr */ +#define SH_XNNI1_LINK_3_FLOW_DEBIT_VC3_FORCE_CRED_SHFT 7 +#define SH_XNNI1_LINK_3_FLOW_DEBIT_VC3_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI1_LINK_3_FLOW_CREDIT_VC3_TEST */ +/* Description: vc3 Limit Test */ +#define SH_XNNI1_LINK_3_FLOW_CREDIT_VC3_TEST_SHFT 8 +#define SH_XNNI1_LINK_3_FLOW_CREDIT_VC3_TEST_MASK 0x0000000000007f00 + +/* SH_XNNI1_LINK_3_FLOW_CREDIT_VC3_DYN */ +/* Description: Dynamic vc3 credit value */ +#define SH_XNNI1_LINK_3_FLOW_CREDIT_VC3_DYN_SHFT 16 +#define SH_XNNI1_LINK_3_FLOW_CREDIT_VC3_DYN_MASK 0x00000000007f0000 + +/* SH_XNNI1_LINK_3_FLOW_CREDIT_VC3_CAP */ +/* Description: Captured vc3 credit */ +#define SH_XNNI1_LINK_3_FLOW_CREDIT_VC3_CAP_SHFT 24 +#define SH_XNNI1_LINK_3_FLOW_CREDIT_VC3_CAP_MASK 0x000000007f000000 + +/* ==================================================================== */ +/* Register "SH_IILB_LOCAL_TABLE" */ +/* local lookup table */ +/* ==================================================================== */ + +#define SH_IILB_LOCAL_TABLE 0x0000000150020000 +#define SH_IILB_LOCAL_TABLE_MASK 0x800000000000003f +#define SH_IILB_LOCAL_TABLE_MEMDEPTH 128 +#define SH_IILB_LOCAL_TABLE_INIT 0x0000000000000000 + +/* SH_IILB_LOCAL_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_IILB_LOCAL_TABLE_DIR0_SHFT 0 +#define SH_IILB_LOCAL_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_IILB_LOCAL_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_IILB_LOCAL_TABLE_V0_SHFT 4 +#define SH_IILB_LOCAL_TABLE_V0_MASK 0x0000000000000010 + +/* SH_IILB_LOCAL_TABLE_NI_SEL0 */ +/* Description: ni select for requests */ +#define SH_IILB_LOCAL_TABLE_NI_SEL0_SHFT 5 +#define SH_IILB_LOCAL_TABLE_NI_SEL0_MASK 0x0000000000000020 + +/* SH_IILB_LOCAL_TABLE_VALID */ +/* Description: Indicates that this entry is valid */ +#define SH_IILB_LOCAL_TABLE_VALID_SHFT 63 +#define SH_IILB_LOCAL_TABLE_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_IILB_GLOBAL_TABLE" */ +/* global lookup table */ +/* ==================================================================== */ + +#define SH_IILB_GLOBAL_TABLE 0x0000000150020400 +#define SH_IILB_GLOBAL_TABLE_MASK 0x800000000000003f +#define SH_IILB_GLOBAL_TABLE_MEMDEPTH 16 +#define SH_IILB_GLOBAL_TABLE_INIT 0x0000000000000000 + +/* SH_IILB_GLOBAL_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_IILB_GLOBAL_TABLE_DIR0_SHFT 0 +#define SH_IILB_GLOBAL_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_IILB_GLOBAL_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_IILB_GLOBAL_TABLE_V0_SHFT 4 +#define SH_IILB_GLOBAL_TABLE_V0_MASK 0x0000000000000010 + +/* SH_IILB_GLOBAL_TABLE_NI_SEL0 */ +/* Description: ni select for requests */ +#define SH_IILB_GLOBAL_TABLE_NI_SEL0_SHFT 5 +#define SH_IILB_GLOBAL_TABLE_NI_SEL0_MASK 0x0000000000000020 + +/* SH_IILB_GLOBAL_TABLE_VALID */ +/* Description: Indicates that this entry is valid */ +#define SH_IILB_GLOBAL_TABLE_VALID_SHFT 63 +#define SH_IILB_GLOBAL_TABLE_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_IILB_OVER_RIDE_TABLE" */ +/* If enabled, bypass the Global/Local tables */ +/* ==================================================================== */ + +#define SH_IILB_OVER_RIDE_TABLE 0x0000000150020480 +#define SH_IILB_OVER_RIDE_TABLE_MASK 0x800000000000003f +#define SH_IILB_OVER_RIDE_TABLE_INIT 0x8000000000000000 + +/* SH_IILB_OVER_RIDE_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_IILB_OVER_RIDE_TABLE_DIR0_SHFT 0 +#define SH_IILB_OVER_RIDE_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_IILB_OVER_RIDE_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_IILB_OVER_RIDE_TABLE_V0_SHFT 4 +#define SH_IILB_OVER_RIDE_TABLE_V0_MASK 0x0000000000000010 + +/* SH_IILB_OVER_RIDE_TABLE_NI_SEL0 */ +/* Description: ni select */ +#define SH_IILB_OVER_RIDE_TABLE_NI_SEL0_SHFT 5 +#define SH_IILB_OVER_RIDE_TABLE_NI_SEL0_MASK 0x0000000000000020 + +/* SH_IILB_OVER_RIDE_TABLE_ENABLE */ +/* Description: Indicates that this entry is enabled */ +#define SH_IILB_OVER_RIDE_TABLE_ENABLE_SHFT 63 +#define SH_IILB_OVER_RIDE_TABLE_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_IILB_RSP_PLANE_HINT" */ +/* If enabled, invert incoming response only plane hint bit before lo */ +/* ==================================================================== */ + +#define SH_IILB_RSP_PLANE_HINT 0x0000000150020488 +#define SH_IILB_RSP_PLANE_HINT_MASK 0x0000000000000000 +#define SH_IILB_RSP_PLANE_HINT_INIT 0x0000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_LOCAL_TABLE" */ +/* local lookup table */ +/* ==================================================================== */ + +#define SH_PI_LOCAL_TABLE 0x0000000150021000 +#define SH_PI_LOCAL_TABLE_MASK 0x8000000000003f3f +#define SH_PI_LOCAL_TABLE_MEMDEPTH 128 +#define SH_PI_LOCAL_TABLE_INIT 0x0000000000000000 + +/* SH_PI_LOCAL_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_PI_LOCAL_TABLE_DIR0_SHFT 0 +#define SH_PI_LOCAL_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_PI_LOCAL_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_PI_LOCAL_TABLE_V0_SHFT 4 +#define SH_PI_LOCAL_TABLE_V0_MASK 0x0000000000000010 + +/* SH_PI_LOCAL_TABLE_NI_SEL0 */ +/* Description: ni select for requests */ +#define SH_PI_LOCAL_TABLE_NI_SEL0_SHFT 5 +#define SH_PI_LOCAL_TABLE_NI_SEL0_MASK 0x0000000000000020 + +/* SH_PI_LOCAL_TABLE_DIR1 */ +#define SH_PI_LOCAL_TABLE_DIR1_SHFT 8 +#define SH_PI_LOCAL_TABLE_DIR1_MASK 0x0000000000000f00 + +/* SH_PI_LOCAL_TABLE_V1 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_PI_LOCAL_TABLE_V1_SHFT 12 +#define SH_PI_LOCAL_TABLE_V1_MASK 0x0000000000001000 + +/* SH_PI_LOCAL_TABLE_NI_SEL1 */ +/* Description: ni select for plane-hint 1 */ +#define SH_PI_LOCAL_TABLE_NI_SEL1_SHFT 13 +#define SH_PI_LOCAL_TABLE_NI_SEL1_MASK 0x0000000000002000 + +/* SH_PI_LOCAL_TABLE_VALID */ +/* Description: Indicates that this entry is valid */ +#define SH_PI_LOCAL_TABLE_VALID_SHFT 63 +#define SH_PI_LOCAL_TABLE_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_GLOBAL_TABLE" */ +/* global lookup table */ +/* ==================================================================== */ + +#define SH_PI_GLOBAL_TABLE 0x0000000150021400 +#define SH_PI_GLOBAL_TABLE_MASK 0x8000000000003f3f +#define SH_PI_GLOBAL_TABLE_MEMDEPTH 16 +#define SH_PI_GLOBAL_TABLE_INIT 0x0000000000000000 + +/* SH_PI_GLOBAL_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_PI_GLOBAL_TABLE_DIR0_SHFT 0 +#define SH_PI_GLOBAL_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_PI_GLOBAL_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_PI_GLOBAL_TABLE_V0_SHFT 4 +#define SH_PI_GLOBAL_TABLE_V0_MASK 0x0000000000000010 + +/* SH_PI_GLOBAL_TABLE_NI_SEL0 */ +/* Description: ni select for requests */ +#define SH_PI_GLOBAL_TABLE_NI_SEL0_SHFT 5 +#define SH_PI_GLOBAL_TABLE_NI_SEL0_MASK 0x0000000000000020 + +/* SH_PI_GLOBAL_TABLE_DIR1 */ +#define SH_PI_GLOBAL_TABLE_DIR1_SHFT 8 +#define SH_PI_GLOBAL_TABLE_DIR1_MASK 0x0000000000000f00 + +/* SH_PI_GLOBAL_TABLE_V1 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_PI_GLOBAL_TABLE_V1_SHFT 12 +#define SH_PI_GLOBAL_TABLE_V1_MASK 0x0000000000001000 + +/* SH_PI_GLOBAL_TABLE_NI_SEL1 */ +/* Description: ni select for plane-hint 1 */ +#define SH_PI_GLOBAL_TABLE_NI_SEL1_SHFT 13 +#define SH_PI_GLOBAL_TABLE_NI_SEL1_MASK 0x0000000000002000 + +/* SH_PI_GLOBAL_TABLE_VALID */ +/* Description: Indicates that this entry is valid */ +#define SH_PI_GLOBAL_TABLE_VALID_SHFT 63 +#define SH_PI_GLOBAL_TABLE_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_OVER_RIDE_TABLE" */ +/* If enabled, bypass the Global/Local tables */ +/* ==================================================================== */ + +#define SH_PI_OVER_RIDE_TABLE 0x0000000150021480 +#define SH_PI_OVER_RIDE_TABLE_MASK 0x8000000000003f3f +#define SH_PI_OVER_RIDE_TABLE_INIT 0x8000000000002000 + +/* SH_PI_OVER_RIDE_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_PI_OVER_RIDE_TABLE_DIR0_SHFT 0 +#define SH_PI_OVER_RIDE_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_PI_OVER_RIDE_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_PI_OVER_RIDE_TABLE_V0_SHFT 4 +#define SH_PI_OVER_RIDE_TABLE_V0_MASK 0x0000000000000010 + +/* SH_PI_OVER_RIDE_TABLE_NI_SEL0 */ +/* Description: ni select */ +#define SH_PI_OVER_RIDE_TABLE_NI_SEL0_SHFT 5 +#define SH_PI_OVER_RIDE_TABLE_NI_SEL0_MASK 0x0000000000000020 + +/* SH_PI_OVER_RIDE_TABLE_DIR1 */ +#define SH_PI_OVER_RIDE_TABLE_DIR1_SHFT 8 +#define SH_PI_OVER_RIDE_TABLE_DIR1_MASK 0x0000000000000f00 + +/* SH_PI_OVER_RIDE_TABLE_V1 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_PI_OVER_RIDE_TABLE_V1_SHFT 12 +#define SH_PI_OVER_RIDE_TABLE_V1_MASK 0x0000000000001000 + +/* SH_PI_OVER_RIDE_TABLE_NI_SEL1 */ +/* Description: ni select */ +#define SH_PI_OVER_RIDE_TABLE_NI_SEL1_SHFT 13 +#define SH_PI_OVER_RIDE_TABLE_NI_SEL1_MASK 0x0000000000002000 + +/* SH_PI_OVER_RIDE_TABLE_ENABLE */ +/* Description: Indicates that this entry is enabled */ +#define SH_PI_OVER_RIDE_TABLE_ENABLE_SHFT 63 +#define SH_PI_OVER_RIDE_TABLE_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_RSP_PLANE_HINT" */ +/* If enabled, invert incoming response only plane hint bit before lo */ +/* ==================================================================== */ + +#define SH_PI_RSP_PLANE_HINT 0x0000000150021488 +#define SH_PI_RSP_PLANE_HINT_MASK 0x0000000000000001 +#define SH_PI_RSP_PLANE_HINT_INIT 0x0000000000000000 + +/* SH_PI_RSP_PLANE_HINT_INVERT */ +/* Description: Invert Response Plane Hint */ +#define SH_PI_RSP_PLANE_HINT_INVERT_SHFT 0 +#define SH_PI_RSP_PLANE_HINT_INVERT_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_NI0_LOCAL_TABLE" */ +/* local lookup table */ +/* ==================================================================== */ + +#define SH_NI0_LOCAL_TABLE 0x0000000150022000 +#define SH_NI0_LOCAL_TABLE_MASK 0x800000000000001f +#define SH_NI0_LOCAL_TABLE_MEMDEPTH 128 +#define SH_NI0_LOCAL_TABLE_INIT 0x0000000000000000 + +/* SH_NI0_LOCAL_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_NI0_LOCAL_TABLE_DIR0_SHFT 0 +#define SH_NI0_LOCAL_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_NI0_LOCAL_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_NI0_LOCAL_TABLE_V0_SHFT 4 +#define SH_NI0_LOCAL_TABLE_V0_MASK 0x0000000000000010 + +/* SH_NI0_LOCAL_TABLE_VALID */ +/* Description: Indicates that this entry is valid */ +#define SH_NI0_LOCAL_TABLE_VALID_SHFT 63 +#define SH_NI0_LOCAL_TABLE_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_GLOBAL_TABLE" */ +/* global lookup table */ +/* ==================================================================== */ + +#define SH_NI0_GLOBAL_TABLE 0x0000000150022400 +#define SH_NI0_GLOBAL_TABLE_MASK 0x800000000000001f +#define SH_NI0_GLOBAL_TABLE_MEMDEPTH 16 +#define SH_NI0_GLOBAL_TABLE_INIT 0x0000000000000000 + +/* SH_NI0_GLOBAL_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_NI0_GLOBAL_TABLE_DIR0_SHFT 0 +#define SH_NI0_GLOBAL_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_NI0_GLOBAL_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_NI0_GLOBAL_TABLE_V0_SHFT 4 +#define SH_NI0_GLOBAL_TABLE_V0_MASK 0x0000000000000010 + +/* SH_NI0_GLOBAL_TABLE_VALID */ +/* Description: Indicates that this entry is valid */ +#define SH_NI0_GLOBAL_TABLE_VALID_SHFT 63 +#define SH_NI0_GLOBAL_TABLE_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_OVER_RIDE_TABLE" */ +/* If enabled, bypass the Global/Local tables */ +/* ==================================================================== */ + +#define SH_NI0_OVER_RIDE_TABLE 0x0000000150022480 +#define SH_NI0_OVER_RIDE_TABLE_MASK 0x800000000000001f +#define SH_NI0_OVER_RIDE_TABLE_INIT 0x8000000000000000 + +/* SH_NI0_OVER_RIDE_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_NI0_OVER_RIDE_TABLE_DIR0_SHFT 0 +#define SH_NI0_OVER_RIDE_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_NI0_OVER_RIDE_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_NI0_OVER_RIDE_TABLE_V0_SHFT 4 +#define SH_NI0_OVER_RIDE_TABLE_V0_MASK 0x0000000000000010 + +/* SH_NI0_OVER_RIDE_TABLE_ENABLE */ +/* Description: Indicates that this entry is enabled */ +#define SH_NI0_OVER_RIDE_TABLE_ENABLE_SHFT 63 +#define SH_NI0_OVER_RIDE_TABLE_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_RSP_PLANE_HINT" */ +/* If enabled, invert incoming response only plane hint bit before lo */ +/* ==================================================================== */ + +#define SH_NI0_RSP_PLANE_HINT 0x0000000150022488 +#define SH_NI0_RSP_PLANE_HINT_MASK 0x0000000000000000 +#define SH_NI0_RSP_PLANE_HINT_INIT 0x0000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_LOCAL_TABLE" */ +/* local lookup table */ +/* ==================================================================== */ + +#define SH_NI1_LOCAL_TABLE 0x0000000150023000 +#define SH_NI1_LOCAL_TABLE_MASK 0x800000000000001f +#define SH_NI1_LOCAL_TABLE_MEMDEPTH 128 +#define SH_NI1_LOCAL_TABLE_INIT 0x0000000000000000 + +/* SH_NI1_LOCAL_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_NI1_LOCAL_TABLE_DIR0_SHFT 0 +#define SH_NI1_LOCAL_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_NI1_LOCAL_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_NI1_LOCAL_TABLE_V0_SHFT 4 +#define SH_NI1_LOCAL_TABLE_V0_MASK 0x0000000000000010 + +/* SH_NI1_LOCAL_TABLE_VALID */ +/* Description: Indicates that this entry is valid */ +#define SH_NI1_LOCAL_TABLE_VALID_SHFT 63 +#define SH_NI1_LOCAL_TABLE_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_GLOBAL_TABLE" */ +/* global lookup table */ +/* ==================================================================== */ + +#define SH_NI1_GLOBAL_TABLE 0x0000000150023400 +#define SH_NI1_GLOBAL_TABLE_MASK 0x800000000000001f +#define SH_NI1_GLOBAL_TABLE_MEMDEPTH 16 +#define SH_NI1_GLOBAL_TABLE_INIT 0x0000000000000000 + +/* SH_NI1_GLOBAL_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_NI1_GLOBAL_TABLE_DIR0_SHFT 0 +#define SH_NI1_GLOBAL_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_NI1_GLOBAL_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_NI1_GLOBAL_TABLE_V0_SHFT 4 +#define SH_NI1_GLOBAL_TABLE_V0_MASK 0x0000000000000010 + +/* SH_NI1_GLOBAL_TABLE_VALID */ +/* Description: Indicates that this entry is valid */ +#define SH_NI1_GLOBAL_TABLE_VALID_SHFT 63 +#define SH_NI1_GLOBAL_TABLE_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_OVER_RIDE_TABLE" */ +/* If enabled, bypass the Global/Local tables */ +/* ==================================================================== */ + +#define SH_NI1_OVER_RIDE_TABLE 0x0000000150023480 +#define SH_NI1_OVER_RIDE_TABLE_MASK 0x800000000000001f +#define SH_NI1_OVER_RIDE_TABLE_INIT 0x8000000000000000 + +/* SH_NI1_OVER_RIDE_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_NI1_OVER_RIDE_TABLE_DIR0_SHFT 0 +#define SH_NI1_OVER_RIDE_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_NI1_OVER_RIDE_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_NI1_OVER_RIDE_TABLE_V0_SHFT 4 +#define SH_NI1_OVER_RIDE_TABLE_V0_MASK 0x0000000000000010 + +/* SH_NI1_OVER_RIDE_TABLE_ENABLE */ +/* Description: Indicates that this entry is enabled */ +#define SH_NI1_OVER_RIDE_TABLE_ENABLE_SHFT 63 +#define SH_NI1_OVER_RIDE_TABLE_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_RSP_PLANE_HINT" */ +/* If enabled, invert incoming response only plane hint bit before lo */ +/* ==================================================================== */ + +#define SH_NI1_RSP_PLANE_HINT 0x0000000150023488 +#define SH_NI1_RSP_PLANE_HINT_MASK 0x0000000000000000 +#define SH_NI1_RSP_PLANE_HINT_INIT 0x0000000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_LOCAL_TABLE" */ +/* local lookup table */ +/* ==================================================================== */ + +#define SH_MD_LOCAL_TABLE 0x0000000150024000 +#define SH_MD_LOCAL_TABLE_MASK 0x8000000000003f3f +#define SH_MD_LOCAL_TABLE_MEMDEPTH 128 +#define SH_MD_LOCAL_TABLE_INIT 0x0000000000000000 + +/* SH_MD_LOCAL_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_MD_LOCAL_TABLE_DIR0_SHFT 0 +#define SH_MD_LOCAL_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_MD_LOCAL_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_MD_LOCAL_TABLE_V0_SHFT 4 +#define SH_MD_LOCAL_TABLE_V0_MASK 0x0000000000000010 + +/* SH_MD_LOCAL_TABLE_NI_SEL0 */ +/* Description: ni select for requests */ +#define SH_MD_LOCAL_TABLE_NI_SEL0_SHFT 5 +#define SH_MD_LOCAL_TABLE_NI_SEL0_MASK 0x0000000000000020 + +/* SH_MD_LOCAL_TABLE_DIR1 */ +#define SH_MD_LOCAL_TABLE_DIR1_SHFT 8 +#define SH_MD_LOCAL_TABLE_DIR1_MASK 0x0000000000000f00 + +/* SH_MD_LOCAL_TABLE_V1 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_MD_LOCAL_TABLE_V1_SHFT 12 +#define SH_MD_LOCAL_TABLE_V1_MASK 0x0000000000001000 + +/* SH_MD_LOCAL_TABLE_NI_SEL1 */ +/* Description: ni select for plane-hint 1 */ +#define SH_MD_LOCAL_TABLE_NI_SEL1_SHFT 13 +#define SH_MD_LOCAL_TABLE_NI_SEL1_MASK 0x0000000000002000 + +/* SH_MD_LOCAL_TABLE_VALID */ +/* Description: Indicates that this entry is valid */ +#define SH_MD_LOCAL_TABLE_VALID_SHFT 63 +#define SH_MD_LOCAL_TABLE_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_GLOBAL_TABLE" */ +/* global lookup table */ +/* ==================================================================== */ + +#define SH_MD_GLOBAL_TABLE 0x0000000150024400 +#define SH_MD_GLOBAL_TABLE_MASK 0x8000000000003f3f +#define SH_MD_GLOBAL_TABLE_MEMDEPTH 16 +#define SH_MD_GLOBAL_TABLE_INIT 0x0000000000000000 + +/* SH_MD_GLOBAL_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_MD_GLOBAL_TABLE_DIR0_SHFT 0 +#define SH_MD_GLOBAL_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_MD_GLOBAL_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_MD_GLOBAL_TABLE_V0_SHFT 4 +#define SH_MD_GLOBAL_TABLE_V0_MASK 0x0000000000000010 + +/* SH_MD_GLOBAL_TABLE_NI_SEL0 */ +/* Description: ni select for requests */ +#define SH_MD_GLOBAL_TABLE_NI_SEL0_SHFT 5 +#define SH_MD_GLOBAL_TABLE_NI_SEL0_MASK 0x0000000000000020 + +/* SH_MD_GLOBAL_TABLE_DIR1 */ +#define SH_MD_GLOBAL_TABLE_DIR1_SHFT 8 +#define SH_MD_GLOBAL_TABLE_DIR1_MASK 0x0000000000000f00 + +/* SH_MD_GLOBAL_TABLE_V1 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_MD_GLOBAL_TABLE_V1_SHFT 12 +#define SH_MD_GLOBAL_TABLE_V1_MASK 0x0000000000001000 + +/* SH_MD_GLOBAL_TABLE_NI_SEL1 */ +/* Description: ni select for plane-hint 1 */ +#define SH_MD_GLOBAL_TABLE_NI_SEL1_SHFT 13 +#define SH_MD_GLOBAL_TABLE_NI_SEL1_MASK 0x0000000000002000 + +/* SH_MD_GLOBAL_TABLE_VALID */ +/* Description: Indicates that this entry is valid */ +#define SH_MD_GLOBAL_TABLE_VALID_SHFT 63 +#define SH_MD_GLOBAL_TABLE_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_OVER_RIDE_TABLE" */ +/* If enabled, bypass the Global/Local tables */ +/* ==================================================================== */ + +#define SH_MD_OVER_RIDE_TABLE 0x0000000150024480 +#define SH_MD_OVER_RIDE_TABLE_MASK 0x8000000000003f3f +#define SH_MD_OVER_RIDE_TABLE_INIT 0x8000000000002000 + +/* SH_MD_OVER_RIDE_TABLE_DIR0 */ +/* Description: Direction field for next chip */ +#define SH_MD_OVER_RIDE_TABLE_DIR0_SHFT 0 +#define SH_MD_OVER_RIDE_TABLE_DIR0_MASK 0x000000000000000f + +/* SH_MD_OVER_RIDE_TABLE_V0 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_MD_OVER_RIDE_TABLE_V0_SHFT 4 +#define SH_MD_OVER_RIDE_TABLE_V0_MASK 0x0000000000000010 + +/* SH_MD_OVER_RIDE_TABLE_NI_SEL0 */ +/* Description: ni select */ +#define SH_MD_OVER_RIDE_TABLE_NI_SEL0_SHFT 5 +#define SH_MD_OVER_RIDE_TABLE_NI_SEL0_MASK 0x0000000000000020 + +/* SH_MD_OVER_RIDE_TABLE_DIR1 */ +#define SH_MD_OVER_RIDE_TABLE_DIR1_SHFT 8 +#define SH_MD_OVER_RIDE_TABLE_DIR1_MASK 0x0000000000000f00 + +/* SH_MD_OVER_RIDE_TABLE_V1 */ +/* Description: Low bit of virtual channel for next chip */ +#define SH_MD_OVER_RIDE_TABLE_V1_SHFT 12 +#define SH_MD_OVER_RIDE_TABLE_V1_MASK 0x0000000000001000 + +/* SH_MD_OVER_RIDE_TABLE_NI_SEL1 */ +/* Description: ni select */ +#define SH_MD_OVER_RIDE_TABLE_NI_SEL1_SHFT 13 +#define SH_MD_OVER_RIDE_TABLE_NI_SEL1_MASK 0x0000000000002000 + +/* SH_MD_OVER_RIDE_TABLE_ENABLE */ +/* Description: Indicates that this entry is enabled */ +#define SH_MD_OVER_RIDE_TABLE_ENABLE_SHFT 63 +#define SH_MD_OVER_RIDE_TABLE_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_RSP_PLANE_HINT" */ +/* If enabled, invert incoming response only plane hint bit before lo */ +/* ==================================================================== */ + +#define SH_MD_RSP_PLANE_HINT 0x0000000150024488 +#define SH_MD_RSP_PLANE_HINT_MASK 0x0000000000000001 +#define SH_MD_RSP_PLANE_HINT_INIT 0x0000000000000000 + +/* SH_MD_RSP_PLANE_HINT_INVERT */ +/* Description: Invert Response Plane Hint */ +#define SH_MD_RSP_PLANE_HINT_INVERT_SHFT 0 +#define SH_MD_RSP_PLANE_HINT_INVERT_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_LB_LIQ_CTL" */ +/* Local Block LIQ Control */ +/* ==================================================================== */ + +#define SH_LB_LIQ_CTL 0x0000000110040000 +#define SH_LB_LIQ_CTL_MASK 0x0000000000070f1f +#define SH_LB_LIQ_CTL_INIT 0x0000000000000000 + +/* SH_LB_LIQ_CTL_LIQ_REQ_CTL */ +/* Description: LIQ Request Control */ +#define SH_LB_LIQ_CTL_LIQ_REQ_CTL_SHFT 0 +#define SH_LB_LIQ_CTL_LIQ_REQ_CTL_MASK 0x000000000000001f + +/* SH_LB_LIQ_CTL_LIQ_RPL_CTL */ +/* Description: LIQ Reply Control */ +#define SH_LB_LIQ_CTL_LIQ_RPL_CTL_SHFT 8 +#define SH_LB_LIQ_CTL_LIQ_RPL_CTL_MASK 0x0000000000000f00 + +/* SH_LB_LIQ_CTL_FORCE_RQ_CREDIT */ +/* Description: Force request credit */ +#define SH_LB_LIQ_CTL_FORCE_RQ_CREDIT_SHFT 16 +#define SH_LB_LIQ_CTL_FORCE_RQ_CREDIT_MASK 0x0000000000010000 + +/* SH_LB_LIQ_CTL_FORCE_RP_CREDIT */ +/* Description: Force reply credit */ +#define SH_LB_LIQ_CTL_FORCE_RP_CREDIT_SHFT 17 +#define SH_LB_LIQ_CTL_FORCE_RP_CREDIT_MASK 0x0000000000020000 + +/* SH_LB_LIQ_CTL_FORCE_LINVV_CREDIT */ +/* Description: Force linvv credit */ +#define SH_LB_LIQ_CTL_FORCE_LINVV_CREDIT_SHFT 18 +#define SH_LB_LIQ_CTL_FORCE_LINVV_CREDIT_MASK 0x0000000000040000 + +/* ==================================================================== */ +/* Register "SH_LB_LOQ_CTL" */ +/* Local Block LOQ Control */ +/* ==================================================================== */ + +#define SH_LB_LOQ_CTL 0x0000000110040080 +#define SH_LB_LOQ_CTL_MASK 0x0000000000000003 +#define SH_LB_LOQ_CTL_INIT 0x0000000000000000 + +/* SH_LB_LOQ_CTL_LOQ_REQ_CTL */ +/* Description: LOQ Request Control */ +#define SH_LB_LOQ_CTL_LOQ_REQ_CTL_SHFT 0 +#define SH_LB_LOQ_CTL_LOQ_REQ_CTL_MASK 0x0000000000000001 + +/* SH_LB_LOQ_CTL_LOQ_RPL_CTL */ +/* Description: LOQ Reply Control */ +#define SH_LB_LOQ_CTL_LOQ_RPL_CTL_SHFT 1 +#define SH_LB_LOQ_CTL_LOQ_RPL_CTL_MASK 0x0000000000000002 + +/* ==================================================================== */ +/* Register "SH_LB_MAX_REP_CREDIT_CNT" */ +/* Maximum number of reply credits from XN */ +/* ==================================================================== */ + +#define SH_LB_MAX_REP_CREDIT_CNT 0x0000000110040100 +#define SH_LB_MAX_REP_CREDIT_CNT_MASK 0x000000000000001f +#define SH_LB_MAX_REP_CREDIT_CNT_INIT 0x000000000000001f + +/* SH_LB_MAX_REP_CREDIT_CNT_MAX_CNT */ +/* Description: Max reply credits */ +#define SH_LB_MAX_REP_CREDIT_CNT_MAX_CNT_SHFT 0 +#define SH_LB_MAX_REP_CREDIT_CNT_MAX_CNT_MASK 0x000000000000001f + +/* ==================================================================== */ +/* Register "SH_LB_MAX_REQ_CREDIT_CNT" */ +/* Maximum number of request credits from XN */ +/* ==================================================================== */ + +#define SH_LB_MAX_REQ_CREDIT_CNT 0x0000000110040180 +#define SH_LB_MAX_REQ_CREDIT_CNT_MASK 0x000000000000001f +#define SH_LB_MAX_REQ_CREDIT_CNT_INIT 0x000000000000001f + +/* SH_LB_MAX_REQ_CREDIT_CNT_MAX_CNT */ +/* Description: Max request credits */ +#define SH_LB_MAX_REQ_CREDIT_CNT_MAX_CNT_SHFT 0 +#define SH_LB_MAX_REQ_CREDIT_CNT_MAX_CNT_MASK 0x000000000000001f + +/* ==================================================================== */ +/* Register "SH_PIO_TIME_OUT" */ +/* Local Block PIO time out value */ +/* ==================================================================== */ + +#define SH_PIO_TIME_OUT 0x0000000110040200 +#define SH_PIO_TIME_OUT_MASK 0x000000000000ffff +#define SH_PIO_TIME_OUT_INIT 0x0000000000000400 + +/* SH_PIO_TIME_OUT_VALUE */ +/* Description: PIO time out value */ +#define SH_PIO_TIME_OUT_VALUE_SHFT 0 +#define SH_PIO_TIME_OUT_VALUE_MASK 0x000000000000ffff + +/* ==================================================================== */ +/* Register "SH_PIO_NACK_RESET" */ +/* Local Block PIO Reset for nack counters */ +/* ==================================================================== */ + +#define SH_PIO_NACK_RESET 0x0000000110040280 +#define SH_PIO_NACK_RESET_MASK 0x0000000000000001 +#define SH_PIO_NACK_RESET_INIT 0x0000000000000000 + +/* SH_PIO_NACK_RESET_PULSE */ +/* Description: PIO nack counter reset */ +#define SH_PIO_NACK_RESET_PULSE_SHFT 0 +#define SH_PIO_NACK_RESET_PULSE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_CONVEYOR_BELT_TIME_OUT" */ +/* Local Block conveyor belt time out value */ +/* ==================================================================== */ + +#define SH_CONVEYOR_BELT_TIME_OUT 0x0000000110040300 +#define SH_CONVEYOR_BELT_TIME_OUT_MASK 0x0000000000000fff +#define SH_CONVEYOR_BELT_TIME_OUT_INIT 0x0000000000000000 + +/* SH_CONVEYOR_BELT_TIME_OUT_VALUE */ +/* Description: Conveyor belt time out value */ +#define SH_CONVEYOR_BELT_TIME_OUT_VALUE_SHFT 0 +#define SH_CONVEYOR_BELT_TIME_OUT_VALUE_MASK 0x0000000000000fff + +/* ==================================================================== */ +/* Register "SH_LB_CREDIT_STATUS" */ +/* Credit Counter Status Register */ +/* ==================================================================== */ + +#define SH_LB_CREDIT_STATUS 0x0000000110050000 +#define SH_LB_CREDIT_STATUS_MASK 0x000000000ffff3df +#define SH_LB_CREDIT_STATUS_INIT 0x0000000000000000 + +/* SH_LB_CREDIT_STATUS_LIQ_RQ_CREDIT */ +/* Description: LIQ request queue credit counter */ +#define SH_LB_CREDIT_STATUS_LIQ_RQ_CREDIT_SHFT 0 +#define SH_LB_CREDIT_STATUS_LIQ_RQ_CREDIT_MASK 0x000000000000001f + +/* SH_LB_CREDIT_STATUS_LIQ_RP_CREDIT */ +/* Description: LIQ reply queue credit counter */ +#define SH_LB_CREDIT_STATUS_LIQ_RP_CREDIT_SHFT 6 +#define SH_LB_CREDIT_STATUS_LIQ_RP_CREDIT_MASK 0x00000000000003c0 + +/* SH_LB_CREDIT_STATUS_LINVV_CREDIT */ +/* Description: LINVV credit counter */ +#define SH_LB_CREDIT_STATUS_LINVV_CREDIT_SHFT 12 +#define SH_LB_CREDIT_STATUS_LINVV_CREDIT_MASK 0x000000000003f000 + +/* SH_LB_CREDIT_STATUS_LOQ_RQ_CREDIT */ +/* Description: LOQ request queue credit counter */ +#define SH_LB_CREDIT_STATUS_LOQ_RQ_CREDIT_SHFT 18 +#define SH_LB_CREDIT_STATUS_LOQ_RQ_CREDIT_MASK 0x00000000007c0000 + +/* SH_LB_CREDIT_STATUS_LOQ_RP_CREDIT */ +/* Description: LOQ reply queue credit counter */ +#define SH_LB_CREDIT_STATUS_LOQ_RP_CREDIT_SHFT 23 +#define SH_LB_CREDIT_STATUS_LOQ_RP_CREDIT_MASK 0x000000000f800000 + +/* ==================================================================== */ +/* Register "SH_LB_DEBUG_LOCAL_SEL" */ +/* LB Debug Port Select */ +/* ==================================================================== */ + +#define SH_LB_DEBUG_LOCAL_SEL 0x0000000110050080 +#define SH_LB_DEBUG_LOCAL_SEL_MASK 0xf777777777777777 +#define SH_LB_DEBUG_LOCAL_SEL_INIT 0x0000000000000000 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE0_CHIPLET_SEL */ +/* Description: Nibble 0 Chiplet select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE0_CHIPLET_SEL_SHFT 0 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE0_CHIPLET_SEL_MASK 0x0000000000000007 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE0_NIBBLE_SEL_SHFT 4 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE1_CHIPLET_SEL */ +/* Description: Nibble 1 Chiplet select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE1_CHIPLET_SEL_SHFT 8 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE1_CHIPLET_SEL_MASK 0x0000000000000700 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE1_NIBBLE_SEL_SHFT 12 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE2_CHIPLET_SEL */ +/* Description: Nibble 2 Chiplet select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE2_CHIPLET_SEL_SHFT 16 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE2_CHIPLET_SEL_MASK 0x0000000000070000 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE2_NIBBLE_SEL_SHFT 20 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE3_CHIPLET_SEL */ +/* Description: Nibble 3 Chiplet select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE3_CHIPLET_SEL_SHFT 24 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE3_CHIPLET_SEL_MASK 0x0000000007000000 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE3_NIBBLE_SEL_SHFT 28 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE4_CHIPLET_SEL */ +/* Description: Nibble 4 Chiplet select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE4_CHIPLET_SEL_SHFT 32 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE4_CHIPLET_SEL_MASK 0x0000000700000000 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE4_NIBBLE_SEL_SHFT 36 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE5_CHIPLET_SEL */ +/* Description: Nibble 5 Chiplet select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE5_CHIPLET_SEL_SHFT 40 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE5_CHIPLET_SEL_MASK 0x0000070000000000 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE5_NIBBLE_SEL_SHFT 44 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE6_CHIPLET_SEL */ +/* Description: Nibble 6 Chiplet select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE6_CHIPLET_SEL_SHFT 48 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE6_CHIPLET_SEL_MASK 0x0007000000000000 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE6_NIBBLE_SEL_SHFT 52 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE7_CHIPLET_SEL */ +/* Description: Nibble 7 Chiplet select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE7_CHIPLET_SEL_SHFT 56 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE7_CHIPLET_SEL_MASK 0x0700000000000000 + +/* SH_LB_DEBUG_LOCAL_SEL_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE7_NIBBLE_SEL_SHFT 60 +#define SH_LB_DEBUG_LOCAL_SEL_NIBBLE7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* SH_LB_DEBUG_LOCAL_SEL_TRIGGER_ENABLE */ +/* Description: Enable trigger on bit 32 of Analyzer data */ +#define SH_LB_DEBUG_LOCAL_SEL_TRIGGER_ENABLE_SHFT 63 +#define SH_LB_DEBUG_LOCAL_SEL_TRIGGER_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_LB_DEBUG_PERF_SEL" */ +/* LB Debug Port Performance Select */ +/* ==================================================================== */ + +#define SH_LB_DEBUG_PERF_SEL 0x0000000110050100 +#define SH_LB_DEBUG_PERF_SEL_MASK 0x7777777777777777 +#define SH_LB_DEBUG_PERF_SEL_INIT 0x0000000000000000 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE0_CHIPLET_SEL */ +/* Description: Nibble 0 Chiplet select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE0_CHIPLET_SEL_SHFT 0 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE0_CHIPLET_SEL_MASK 0x0000000000000007 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE0_NIBBLE_SEL_SHFT 4 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE1_CHIPLET_SEL */ +/* Description: Nibble 1 Chiplet select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE1_CHIPLET_SEL_SHFT 8 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE1_CHIPLET_SEL_MASK 0x0000000000000700 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE1_NIBBLE_SEL_SHFT 12 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE2_CHIPLET_SEL */ +/* Description: Nibble 2 Chiplet select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE2_CHIPLET_SEL_SHFT 16 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE2_CHIPLET_SEL_MASK 0x0000000000070000 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE2_NIBBLE_SEL_SHFT 20 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE3_CHIPLET_SEL */ +/* Description: Nibble 3 Chiplet select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE3_CHIPLET_SEL_SHFT 24 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE3_CHIPLET_SEL_MASK 0x0000000007000000 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE3_NIBBLE_SEL_SHFT 28 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE4_CHIPLET_SEL */ +/* Description: Nibble 4 Chiplet select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE4_CHIPLET_SEL_SHFT 32 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE4_CHIPLET_SEL_MASK 0x0000000700000000 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE4_NIBBLE_SEL_SHFT 36 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE5_CHIPLET_SEL */ +/* Description: Nibble 5 Chiplet select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE5_CHIPLET_SEL_SHFT 40 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE5_CHIPLET_SEL_MASK 0x0000070000000000 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE5_NIBBLE_SEL_SHFT 44 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE6_CHIPLET_SEL */ +/* Description: Nibble 6 Chiplet select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE6_CHIPLET_SEL_SHFT 48 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE6_CHIPLET_SEL_MASK 0x0007000000000000 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE6_NIBBLE_SEL_SHFT 52 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE7_CHIPLET_SEL */ +/* Description: Nibble 7 Chiplet select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE7_CHIPLET_SEL_SHFT 56 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE7_CHIPLET_SEL_MASK 0x0700000000000000 + +/* SH_LB_DEBUG_PERF_SEL_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_LB_DEBUG_PERF_SEL_NIBBLE7_NIBBLE_SEL_SHFT 60 +#define SH_LB_DEBUG_PERF_SEL_NIBBLE7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_LB_DEBUG_TRIG_SEL" */ +/* LB Debug Trigger Select */ +/* ==================================================================== */ + +#define SH_LB_DEBUG_TRIG_SEL 0x0000000110050180 +#define SH_LB_DEBUG_TRIG_SEL_MASK 0x7777777777777777 +#define SH_LB_DEBUG_TRIG_SEL_INIT 0x0000000000000000 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER0_CHIPLET_SEL */ +/* Description: Nibble 0 Chiplet select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER0_CHIPLET_SEL_SHFT 0 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER0_CHIPLET_SEL_MASK 0x0000000000000007 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER0_NIBBLE_SEL_SHFT 4 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER1_CHIPLET_SEL */ +/* Description: Nibble 1 Chiplet select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER1_CHIPLET_SEL_SHFT 8 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER1_CHIPLET_SEL_MASK 0x0000000000000700 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER1_NIBBLE_SEL_SHFT 12 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER2_CHIPLET_SEL */ +/* Description: Nibble 2 Chiplet select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER2_CHIPLET_SEL_SHFT 16 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER2_CHIPLET_SEL_MASK 0x0000000000070000 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER2_NIBBLE_SEL_SHFT 20 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER3_CHIPLET_SEL */ +/* Description: Nibble 3 Chiplet select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER3_CHIPLET_SEL_SHFT 24 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER3_CHIPLET_SEL_MASK 0x0000000007000000 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER3_NIBBLE_SEL_SHFT 28 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER4_CHIPLET_SEL */ +/* Description: Nibble 4 Chiplet select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER4_CHIPLET_SEL_SHFT 32 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER4_CHIPLET_SEL_MASK 0x0000000700000000 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER4_NIBBLE_SEL_SHFT 36 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER5_CHIPLET_SEL */ +/* Description: Nibble 5 Chiplet select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER5_CHIPLET_SEL_SHFT 40 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER5_CHIPLET_SEL_MASK 0x0000070000000000 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER5_NIBBLE_SEL_SHFT 44 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER6_CHIPLET_SEL */ +/* Description: Nibble 6 Chiplet select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER6_CHIPLET_SEL_SHFT 48 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER6_CHIPLET_SEL_MASK 0x0007000000000000 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER6_NIBBLE_SEL_SHFT 52 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER7_CHIPLET_SEL */ +/* Description: Nibble 7 Chiplet select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER7_CHIPLET_SEL_SHFT 56 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER7_CHIPLET_SEL_MASK 0x0700000000000000 + +/* SH_LB_DEBUG_TRIG_SEL_TRIGGER7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER7_NIBBLE_SEL_SHFT 60 +#define SH_LB_DEBUG_TRIG_SEL_TRIGGER7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_DETAIL_1" */ +/* LB Error capture information: HDR1 */ +/* ==================================================================== */ + +#define SH_LB_ERROR_DETAIL_1 0x0000000110050200 +#define SH_LB_ERROR_DETAIL_1_MASK 0x8003073fff3fffff +#define SH_LB_ERROR_DETAIL_1_INIT 0x0000000000000000 + +/* SH_LB_ERROR_DETAIL_1_COMMAND */ +/* Description: COMMAND */ +#define SH_LB_ERROR_DETAIL_1_COMMAND_SHFT 0 +#define SH_LB_ERROR_DETAIL_1_COMMAND_MASK 0x00000000000000ff + +/* SH_LB_ERROR_DETAIL_1_SUPPL */ +/* Description: SUPPLMENTAL */ +#define SH_LB_ERROR_DETAIL_1_SUPPL_SHFT 8 +#define SH_LB_ERROR_DETAIL_1_SUPPL_MASK 0x00000000003fff00 + +/* SH_LB_ERROR_DETAIL_1_SOURCE */ +/* Description: SOURCE */ +#define SH_LB_ERROR_DETAIL_1_SOURCE_SHFT 24 +#define SH_LB_ERROR_DETAIL_1_SOURCE_MASK 0x0000003fff000000 + +/* SH_LB_ERROR_DETAIL_1_DEST */ +/* Description: DEST */ +#define SH_LB_ERROR_DETAIL_1_DEST_SHFT 40 +#define SH_LB_ERROR_DETAIL_1_DEST_MASK 0x0000070000000000 + +/* SH_LB_ERROR_DETAIL_1_HDR_ERR */ +/* Description: HDR_ERR */ +#define SH_LB_ERROR_DETAIL_1_HDR_ERR_SHFT 48 +#define SH_LB_ERROR_DETAIL_1_HDR_ERR_MASK 0x0001000000000000 + +/* SH_LB_ERROR_DETAIL_1_DATA_ERR */ +/* Description: DATA_ERR */ +#define SH_LB_ERROR_DETAIL_1_DATA_ERR_SHFT 49 +#define SH_LB_ERROR_DETAIL_1_DATA_ERR_MASK 0x0002000000000000 + +/* SH_LB_ERROR_DETAIL_1_VALID */ +/* Description: VALID */ +#define SH_LB_ERROR_DETAIL_1_VALID_SHFT 63 +#define SH_LB_ERROR_DETAIL_1_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_DETAIL_2" */ +/* LB Error Bits */ +/* ==================================================================== */ + +#define SH_LB_ERROR_DETAIL_2 0x0000000110050280 +#define SH_LB_ERROR_DETAIL_2_MASK 0x00007fffffffffff +#define SH_LB_ERROR_DETAIL_2_INIT 0x0000000000000000 + +/* SH_LB_ERROR_DETAIL_2_ADDRESS */ +/* Description: ADDRESS */ +#define SH_LB_ERROR_DETAIL_2_ADDRESS_SHFT 0 +#define SH_LB_ERROR_DETAIL_2_ADDRESS_MASK 0x00007fffffffffff + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_DETAIL_3" */ +/* LB Error Bits */ +/* ==================================================================== */ + +#define SH_LB_ERROR_DETAIL_3 0x0000000110050300 +#define SH_LB_ERROR_DETAIL_3_MASK 0xffffffffffffffff +#define SH_LB_ERROR_DETAIL_3_INIT 0x0000000000000000 + +/* SH_LB_ERROR_DETAIL_3_DATA */ +/* Description: DATA */ +#define SH_LB_ERROR_DETAIL_3_DATA_SHFT 0 +#define SH_LB_ERROR_DETAIL_3_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_DETAIL_4" */ +/* LB Error Bits */ +/* ==================================================================== */ + +#define SH_LB_ERROR_DETAIL_4 0x0000000110050380 +#define SH_LB_ERROR_DETAIL_4_MASK 0xffffffffffffffff +#define SH_LB_ERROR_DETAIL_4_INIT 0x0000000000000000 + +/* SH_LB_ERROR_DETAIL_4_ROUTE */ +/* Description: ROUTE */ +#define SH_LB_ERROR_DETAIL_4_ROUTE_SHFT 0 +#define SH_LB_ERROR_DETAIL_4_ROUTE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_DETAIL_5" */ +/* LB Error Bits */ +/* ==================================================================== */ + +#define SH_LB_ERROR_DETAIL_5 0x0000000110050400 +#define SH_LB_ERROR_DETAIL_5_MASK 0x000000000000007f +#define SH_LB_ERROR_DETAIL_5_INIT 0x0000000000000000 + +/* SH_LB_ERROR_DETAIL_5_READ_RETRY */ +/* Description: Read retry error */ +#define SH_LB_ERROR_DETAIL_5_READ_RETRY_SHFT 0 +#define SH_LB_ERROR_DETAIL_5_READ_RETRY_MASK 0x0000000000000001 + +/* SH_LB_ERROR_DETAIL_5_PTC1_WRITE */ +/* Description: PTC1 write error */ +#define SH_LB_ERROR_DETAIL_5_PTC1_WRITE_SHFT 1 +#define SH_LB_ERROR_DETAIL_5_PTC1_WRITE_MASK 0x0000000000000002 + +/* SH_LB_ERROR_DETAIL_5_WRITE_RETRY */ +/* Description: Write retry error */ +#define SH_LB_ERROR_DETAIL_5_WRITE_RETRY_SHFT 2 +#define SH_LB_ERROR_DETAIL_5_WRITE_RETRY_MASK 0x0000000000000004 + +/* SH_LB_ERROR_DETAIL_5_COUNT_A_OVERFLOW */ +/* Description: Nack A counter overflow error */ +#define SH_LB_ERROR_DETAIL_5_COUNT_A_OVERFLOW_SHFT 3 +#define SH_LB_ERROR_DETAIL_5_COUNT_A_OVERFLOW_MASK 0x0000000000000008 + +/* SH_LB_ERROR_DETAIL_5_COUNT_B_OVERFLOW */ +/* Description: Nack B counter overflow error */ +#define SH_LB_ERROR_DETAIL_5_COUNT_B_OVERFLOW_SHFT 4 +#define SH_LB_ERROR_DETAIL_5_COUNT_B_OVERFLOW_MASK 0x0000000000000010 + +/* SH_LB_ERROR_DETAIL_5_NACK_A_TIMEOUT */ +/* Description: Nack A counter timeout error */ +#define SH_LB_ERROR_DETAIL_5_NACK_A_TIMEOUT_SHFT 5 +#define SH_LB_ERROR_DETAIL_5_NACK_A_TIMEOUT_MASK 0x0000000000000020 + +/* SH_LB_ERROR_DETAIL_5_NACK_B_TIMEOUT */ +/* Description: Nack B counter timeout error */ +#define SH_LB_ERROR_DETAIL_5_NACK_B_TIMEOUT_SHFT 6 +#define SH_LB_ERROR_DETAIL_5_NACK_B_TIMEOUT_MASK 0x0000000000000040 + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_MASK" */ +/* LB Error Mask */ +/* ==================================================================== */ + +#define SH_LB_ERROR_MASK 0x0000000110050480 +#define SH_LB_ERROR_MASK_MASK 0x00000000007fffff +#define SH_LB_ERROR_MASK_INIT 0x00000000007fffff + +/* SH_LB_ERROR_MASK_RQ_BAD_CMD */ +/* Description: RQ_BAD_CMD */ +#define SH_LB_ERROR_MASK_RQ_BAD_CMD_SHFT 0 +#define SH_LB_ERROR_MASK_RQ_BAD_CMD_MASK 0x0000000000000001 + +/* SH_LB_ERROR_MASK_RP_BAD_CMD */ +/* Description: RP_BAD_CMD */ +#define SH_LB_ERROR_MASK_RP_BAD_CMD_SHFT 1 +#define SH_LB_ERROR_MASK_RP_BAD_CMD_MASK 0x0000000000000002 + +/* SH_LB_ERROR_MASK_RQ_SHORT */ +/* Description: RQ_SHORT */ +#define SH_LB_ERROR_MASK_RQ_SHORT_SHFT 2 +#define SH_LB_ERROR_MASK_RQ_SHORT_MASK 0x0000000000000004 + +/* SH_LB_ERROR_MASK_RP_SHORT */ +/* Description: RP_SHORT */ +#define SH_LB_ERROR_MASK_RP_SHORT_SHFT 3 +#define SH_LB_ERROR_MASK_RP_SHORT_MASK 0x0000000000000008 + +/* SH_LB_ERROR_MASK_RQ_LONG */ +/* Description: RQ_LONG */ +#define SH_LB_ERROR_MASK_RQ_LONG_SHFT 4 +#define SH_LB_ERROR_MASK_RQ_LONG_MASK 0x0000000000000010 + +/* SH_LB_ERROR_MASK_RP_LONG */ +/* Description: RP_LONG */ +#define SH_LB_ERROR_MASK_RP_LONG_SHFT 5 +#define SH_LB_ERROR_MASK_RP_LONG_MASK 0x0000000000000020 + +/* SH_LB_ERROR_MASK_RQ_BAD_DATA */ +/* Description: RQ_BAD_DATA */ +#define SH_LB_ERROR_MASK_RQ_BAD_DATA_SHFT 6 +#define SH_LB_ERROR_MASK_RQ_BAD_DATA_MASK 0x0000000000000040 + +/* SH_LB_ERROR_MASK_RP_BAD_DATA */ +/* Description: RP_BAD_DATA */ +#define SH_LB_ERROR_MASK_RP_BAD_DATA_SHFT 7 +#define SH_LB_ERROR_MASK_RP_BAD_DATA_MASK 0x0000000000000080 + +/* SH_LB_ERROR_MASK_RQ_BAD_ADDR */ +/* Description: RQ_BAD_ADDR */ +#define SH_LB_ERROR_MASK_RQ_BAD_ADDR_SHFT 8 +#define SH_LB_ERROR_MASK_RQ_BAD_ADDR_MASK 0x0000000000000100 + +/* SH_LB_ERROR_MASK_RQ_TIME_OUT */ +/* Description: RQ_TIME_OUT */ +#define SH_LB_ERROR_MASK_RQ_TIME_OUT_SHFT 9 +#define SH_LB_ERROR_MASK_RQ_TIME_OUT_MASK 0x0000000000000200 + +/* SH_LB_ERROR_MASK_LINVV_OVERFLOW */ +/* Description: LINVV_OVERFLOW */ +#define SH_LB_ERROR_MASK_LINVV_OVERFLOW_SHFT 10 +#define SH_LB_ERROR_MASK_LINVV_OVERFLOW_MASK 0x0000000000000400 + +/* SH_LB_ERROR_MASK_UNEXPECTED_LINV */ +/* Description: UNEXPECTED_LINV */ +#define SH_LB_ERROR_MASK_UNEXPECTED_LINV_SHFT 11 +#define SH_LB_ERROR_MASK_UNEXPECTED_LINV_MASK 0x0000000000000800 + +/* SH_LB_ERROR_MASK_PTC_1_TIMEOUT */ +/* Description: PTC_1 Time out */ +#define SH_LB_ERROR_MASK_PTC_1_TIMEOUT_SHFT 12 +#define SH_LB_ERROR_MASK_PTC_1_TIMEOUT_MASK 0x0000000000001000 + +/* SH_LB_ERROR_MASK_JUNK_BUS_ERR */ +/* Description: Junk Bus error */ +#define SH_LB_ERROR_MASK_JUNK_BUS_ERR_SHFT 13 +#define SH_LB_ERROR_MASK_JUNK_BUS_ERR_MASK 0x0000000000002000 + +/* SH_LB_ERROR_MASK_PIO_CB_ERR */ +/* Description: PIO Conveyor Belt operation error */ +#define SH_LB_ERROR_MASK_PIO_CB_ERR_SHFT 14 +#define SH_LB_ERROR_MASK_PIO_CB_ERR_MASK 0x0000000000004000 + +/* SH_LB_ERROR_MASK_VECTOR_RQ_ROUTE_ERROR */ +/* Description: Vector request Route data was invalid */ +#define SH_LB_ERROR_MASK_VECTOR_RQ_ROUTE_ERROR_SHFT 15 +#define SH_LB_ERROR_MASK_VECTOR_RQ_ROUTE_ERROR_MASK 0x0000000000008000 + +/* SH_LB_ERROR_MASK_VECTOR_RP_ROUTE_ERROR */ +/* Description: Vector reply Route data was invalid */ +#define SH_LB_ERROR_MASK_VECTOR_RP_ROUTE_ERROR_SHFT 16 +#define SH_LB_ERROR_MASK_VECTOR_RP_ROUTE_ERROR_MASK 0x0000000000010000 + +/* SH_LB_ERROR_MASK_GCLK_DROP */ +/* Description: Gclk drop error */ +#define SH_LB_ERROR_MASK_GCLK_DROP_SHFT 17 +#define SH_LB_ERROR_MASK_GCLK_DROP_MASK 0x0000000000020000 + +/* SH_LB_ERROR_MASK_RQ_FIFO_ERROR */ +/* Description: Request queue FIFO error */ +#define SH_LB_ERROR_MASK_RQ_FIFO_ERROR_SHFT 18 +#define SH_LB_ERROR_MASK_RQ_FIFO_ERROR_MASK 0x0000000000040000 + +/* SH_LB_ERROR_MASK_RP_FIFO_ERROR */ +/* Description: Reply queue FIFO error */ +#define SH_LB_ERROR_MASK_RP_FIFO_ERROR_SHFT 19 +#define SH_LB_ERROR_MASK_RP_FIFO_ERROR_MASK 0x0000000000080000 + +/* SH_LB_ERROR_MASK_UNEXP_VALID */ +/* Description: Unexpected valid error */ +#define SH_LB_ERROR_MASK_UNEXP_VALID_SHFT 20 +#define SH_LB_ERROR_MASK_UNEXP_VALID_MASK 0x0000000000100000 + +/* SH_LB_ERROR_MASK_RQ_CREDIT_OVERFLOW */ +/* Description: Request queue credit overflow */ +#define SH_LB_ERROR_MASK_RQ_CREDIT_OVERFLOW_SHFT 21 +#define SH_LB_ERROR_MASK_RQ_CREDIT_OVERFLOW_MASK 0x0000000000200000 + +/* SH_LB_ERROR_MASK_RP_CREDIT_OVERFLOW */ +/* Description: Reply queue credit overflow */ +#define SH_LB_ERROR_MASK_RP_CREDIT_OVERFLOW_SHFT 22 +#define SH_LB_ERROR_MASK_RP_CREDIT_OVERFLOW_MASK 0x0000000000400000 + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_OVERFLOW" */ +/* LB Error Overflow */ +/* ==================================================================== */ + +#define SH_LB_ERROR_OVERFLOW 0x0000000110050500 +#define SH_LB_ERROR_OVERFLOW_MASK 0x00000000007fffff +#define SH_LB_ERROR_OVERFLOW_INIT 0x0000000000000000 + +/* SH_LB_ERROR_OVERFLOW_RQ_BAD_CMD_OVRFL */ +/* Description: RQ_BAD_CMD_OVRFL */ +#define SH_LB_ERROR_OVERFLOW_RQ_BAD_CMD_OVRFL_SHFT 0 +#define SH_LB_ERROR_OVERFLOW_RQ_BAD_CMD_OVRFL_MASK 0x0000000000000001 + +/* SH_LB_ERROR_OVERFLOW_RP_BAD_CMD_OVRFL */ +/* Description: RP_BAD_CMD_OVRFL */ +#define SH_LB_ERROR_OVERFLOW_RP_BAD_CMD_OVRFL_SHFT 1 +#define SH_LB_ERROR_OVERFLOW_RP_BAD_CMD_OVRFL_MASK 0x0000000000000002 + +/* SH_LB_ERROR_OVERFLOW_RQ_SHORT_OVRFL */ +/* Description: RQ_SHORT_OVRFL */ +#define SH_LB_ERROR_OVERFLOW_RQ_SHORT_OVRFL_SHFT 2 +#define SH_LB_ERROR_OVERFLOW_RQ_SHORT_OVRFL_MASK 0x0000000000000004 + +/* SH_LB_ERROR_OVERFLOW_RP_SHORT_OVRFL */ +/* Description: RP_SHORT_OVRFL */ +#define SH_LB_ERROR_OVERFLOW_RP_SHORT_OVRFL_SHFT 3 +#define SH_LB_ERROR_OVERFLOW_RP_SHORT_OVRFL_MASK 0x0000000000000008 + +/* SH_LB_ERROR_OVERFLOW_RQ_LONG_OVRFL */ +/* Description: RQ_LONG_OVRFL */ +#define SH_LB_ERROR_OVERFLOW_RQ_LONG_OVRFL_SHFT 4 +#define SH_LB_ERROR_OVERFLOW_RQ_LONG_OVRFL_MASK 0x0000000000000010 + +/* SH_LB_ERROR_OVERFLOW_RP_LONG_OVRFL */ +/* Description: RP_LONG_OVRFL */ +#define SH_LB_ERROR_OVERFLOW_RP_LONG_OVRFL_SHFT 5 +#define SH_LB_ERROR_OVERFLOW_RP_LONG_OVRFL_MASK 0x0000000000000020 + +/* SH_LB_ERROR_OVERFLOW_RQ_BAD_DATA_OVRFL */ +/* Description: RQ_BAD_DATA_OVRFL */ +#define SH_LB_ERROR_OVERFLOW_RQ_BAD_DATA_OVRFL_SHFT 6 +#define SH_LB_ERROR_OVERFLOW_RQ_BAD_DATA_OVRFL_MASK 0x0000000000000040 + +/* SH_LB_ERROR_OVERFLOW_RP_BAD_DATA_OVRFL */ +/* Description: RP_BAD_DATA_OVRFL */ +#define SH_LB_ERROR_OVERFLOW_RP_BAD_DATA_OVRFL_SHFT 7 +#define SH_LB_ERROR_OVERFLOW_RP_BAD_DATA_OVRFL_MASK 0x0000000000000080 + +/* SH_LB_ERROR_OVERFLOW_RQ_BAD_ADDR_OVRFL */ +/* Description: RQ_BAD_ADDR_OVRFL */ +#define SH_LB_ERROR_OVERFLOW_RQ_BAD_ADDR_OVRFL_SHFT 8 +#define SH_LB_ERROR_OVERFLOW_RQ_BAD_ADDR_OVRFL_MASK 0x0000000000000100 + +/* SH_LB_ERROR_OVERFLOW_RQ_TIME_OUT_OVRFL */ +/* Description: RQ_TIME_OUT_OVRFL */ +#define SH_LB_ERROR_OVERFLOW_RQ_TIME_OUT_OVRFL_SHFT 9 +#define SH_LB_ERROR_OVERFLOW_RQ_TIME_OUT_OVRFL_MASK 0x0000000000000200 + +/* SH_LB_ERROR_OVERFLOW_LINVV_OVERFLOW_OVRFL */ +/* Description: LINVV_OVERFLOW_OVRFL */ +#define SH_LB_ERROR_OVERFLOW_LINVV_OVERFLOW_OVRFL_SHFT 10 +#define SH_LB_ERROR_OVERFLOW_LINVV_OVERFLOW_OVRFL_MASK 0x0000000000000400 + +/* SH_LB_ERROR_OVERFLOW_UNEXPECTED_LINV_OVRFL */ +/* Description: UNEXPECTED_LINV_OVRFL */ +#define SH_LB_ERROR_OVERFLOW_UNEXPECTED_LINV_OVRFL_SHFT 11 +#define SH_LB_ERROR_OVERFLOW_UNEXPECTED_LINV_OVRFL_MASK 0x0000000000000800 + +/* SH_LB_ERROR_OVERFLOW_PTC_1_TIMEOUT_OVRFL */ +/* Description: PTC_1 Time out overflow */ +#define SH_LB_ERROR_OVERFLOW_PTC_1_TIMEOUT_OVRFL_SHFT 12 +#define SH_LB_ERROR_OVERFLOW_PTC_1_TIMEOUT_OVRFL_MASK 0x0000000000001000 + +/* SH_LB_ERROR_OVERFLOW_JUNK_BUS_ERR_OVRFL */ +/* Description: Junk Bus error overflow */ +#define SH_LB_ERROR_OVERFLOW_JUNK_BUS_ERR_OVRFL_SHFT 13 +#define SH_LB_ERROR_OVERFLOW_JUNK_BUS_ERR_OVRFL_MASK 0x0000000000002000 + +/* SH_LB_ERROR_OVERFLOW_PIO_CB_ERR_OVRFL */ +/* Description: PIO Conveyor Belt operation error overflow */ +#define SH_LB_ERROR_OVERFLOW_PIO_CB_ERR_OVRFL_SHFT 14 +#define SH_LB_ERROR_OVERFLOW_PIO_CB_ERR_OVRFL_MASK 0x0000000000004000 + +/* SH_LB_ERROR_OVERFLOW_VECTOR_RQ_ROUTE_ERROR_OVRFL */ +/* Description: Vector request Route data was invalid overflow */ +#define SH_LB_ERROR_OVERFLOW_VECTOR_RQ_ROUTE_ERROR_OVRFL_SHFT 15 +#define SH_LB_ERROR_OVERFLOW_VECTOR_RQ_ROUTE_ERROR_OVRFL_MASK 0x0000000000008000 + +/* SH_LB_ERROR_OVERFLOW_VECTOR_RP_ROUTE_ERROR_OVRFL */ +/* Description: Vector reply Route data was invalid overflow */ +#define SH_LB_ERROR_OVERFLOW_VECTOR_RP_ROUTE_ERROR_OVRFL_SHFT 16 +#define SH_LB_ERROR_OVERFLOW_VECTOR_RP_ROUTE_ERROR_OVRFL_MASK 0x0000000000010000 + +/* SH_LB_ERROR_OVERFLOW_GCLK_DROP_OVRFL */ +/* Description: Gclk drop error overflow */ +#define SH_LB_ERROR_OVERFLOW_GCLK_DROP_OVRFL_SHFT 17 +#define SH_LB_ERROR_OVERFLOW_GCLK_DROP_OVRFL_MASK 0x0000000000020000 + +/* SH_LB_ERROR_OVERFLOW_RQ_FIFO_ERROR_OVRFL */ +/* Description: Request queue FIFO error overflow */ +#define SH_LB_ERROR_OVERFLOW_RQ_FIFO_ERROR_OVRFL_SHFT 18 +#define SH_LB_ERROR_OVERFLOW_RQ_FIFO_ERROR_OVRFL_MASK 0x0000000000040000 + +/* SH_LB_ERROR_OVERFLOW_RP_FIFO_ERROR_OVRFL */ +/* Description: Reply queue FIFO error overflow */ +#define SH_LB_ERROR_OVERFLOW_RP_FIFO_ERROR_OVRFL_SHFT 19 +#define SH_LB_ERROR_OVERFLOW_RP_FIFO_ERROR_OVRFL_MASK 0x0000000000080000 + +/* SH_LB_ERROR_OVERFLOW_UNEXP_VALID_OVRFL */ +/* Description: Unexpected valid error overflow */ +#define SH_LB_ERROR_OVERFLOW_UNEXP_VALID_OVRFL_SHFT 20 +#define SH_LB_ERROR_OVERFLOW_UNEXP_VALID_OVRFL_MASK 0x0000000000100000 + +/* SH_LB_ERROR_OVERFLOW_RQ_CREDIT_OVERFLOW_OVRFL */ +/* Description: Request queue credit overflow */ +#define SH_LB_ERROR_OVERFLOW_RQ_CREDIT_OVERFLOW_OVRFL_SHFT 21 +#define SH_LB_ERROR_OVERFLOW_RQ_CREDIT_OVERFLOW_OVRFL_MASK 0x0000000000200000 + +/* SH_LB_ERROR_OVERFLOW_RP_CREDIT_OVERFLOW_OVRFL */ +/* Description: Reply queue credit overflow */ +#define SH_LB_ERROR_OVERFLOW_RP_CREDIT_OVERFLOW_OVRFL_SHFT 22 +#define SH_LB_ERROR_OVERFLOW_RP_CREDIT_OVERFLOW_OVRFL_MASK 0x0000000000400000 + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_OVERFLOW_ALIAS" */ +/* LB Error Overflow */ +/* ==================================================================== */ + +#define SH_LB_ERROR_OVERFLOW_ALIAS 0x0000000110050508 + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_SUMMARY" */ +/* LB Error Bits */ +/* ==================================================================== */ + +#define SH_LB_ERROR_SUMMARY 0x0000000110050580 +#define SH_LB_ERROR_SUMMARY_MASK 0x00000000007fffff +#define SH_LB_ERROR_SUMMARY_INIT 0x0000000000000000 + +/* SH_LB_ERROR_SUMMARY_RQ_BAD_CMD */ +/* Description: RQ_BAD_CMD */ +#define SH_LB_ERROR_SUMMARY_RQ_BAD_CMD_SHFT 0 +#define SH_LB_ERROR_SUMMARY_RQ_BAD_CMD_MASK 0x0000000000000001 + +/* SH_LB_ERROR_SUMMARY_RP_BAD_CMD */ +/* Description: RP_BAD_CMD */ +#define SH_LB_ERROR_SUMMARY_RP_BAD_CMD_SHFT 1 +#define SH_LB_ERROR_SUMMARY_RP_BAD_CMD_MASK 0x0000000000000002 + +/* SH_LB_ERROR_SUMMARY_RQ_SHORT */ +/* Description: RQ_SHORT */ +#define SH_LB_ERROR_SUMMARY_RQ_SHORT_SHFT 2 +#define SH_LB_ERROR_SUMMARY_RQ_SHORT_MASK 0x0000000000000004 + +/* SH_LB_ERROR_SUMMARY_RP_SHORT */ +/* Description: RP_SHORT */ +#define SH_LB_ERROR_SUMMARY_RP_SHORT_SHFT 3 +#define SH_LB_ERROR_SUMMARY_RP_SHORT_MASK 0x0000000000000008 + +/* SH_LB_ERROR_SUMMARY_RQ_LONG */ +/* Description: RQ_LONG */ +#define SH_LB_ERROR_SUMMARY_RQ_LONG_SHFT 4 +#define SH_LB_ERROR_SUMMARY_RQ_LONG_MASK 0x0000000000000010 + +/* SH_LB_ERROR_SUMMARY_RP_LONG */ +/* Description: RP_LONG */ +#define SH_LB_ERROR_SUMMARY_RP_LONG_SHFT 5 +#define SH_LB_ERROR_SUMMARY_RP_LONG_MASK 0x0000000000000020 + +/* SH_LB_ERROR_SUMMARY_RQ_BAD_DATA */ +/* Description: RQ_BAD_DATA */ +#define SH_LB_ERROR_SUMMARY_RQ_BAD_DATA_SHFT 6 +#define SH_LB_ERROR_SUMMARY_RQ_BAD_DATA_MASK 0x0000000000000040 + +/* SH_LB_ERROR_SUMMARY_RP_BAD_DATA */ +/* Description: RP_BAD_DATA */ +#define SH_LB_ERROR_SUMMARY_RP_BAD_DATA_SHFT 7 +#define SH_LB_ERROR_SUMMARY_RP_BAD_DATA_MASK 0x0000000000000080 + +/* SH_LB_ERROR_SUMMARY_RQ_BAD_ADDR */ +/* Description: RQ_BAD_ADDR */ +#define SH_LB_ERROR_SUMMARY_RQ_BAD_ADDR_SHFT 8 +#define SH_LB_ERROR_SUMMARY_RQ_BAD_ADDR_MASK 0x0000000000000100 + +/* SH_LB_ERROR_SUMMARY_RQ_TIME_OUT */ +/* Description: RQ_TIME_OUT */ +#define SH_LB_ERROR_SUMMARY_RQ_TIME_OUT_SHFT 9 +#define SH_LB_ERROR_SUMMARY_RQ_TIME_OUT_MASK 0x0000000000000200 + +/* SH_LB_ERROR_SUMMARY_LINVV_OVERFLOW */ +/* Description: LINVV_OVERFLOW */ +#define SH_LB_ERROR_SUMMARY_LINVV_OVERFLOW_SHFT 10 +#define SH_LB_ERROR_SUMMARY_LINVV_OVERFLOW_MASK 0x0000000000000400 + +/* SH_LB_ERROR_SUMMARY_UNEXPECTED_LINV */ +/* Description: UNEXPECTED_LINV */ +#define SH_LB_ERROR_SUMMARY_UNEXPECTED_LINV_SHFT 11 +#define SH_LB_ERROR_SUMMARY_UNEXPECTED_LINV_MASK 0x0000000000000800 + +/* SH_LB_ERROR_SUMMARY_PTC_1_TIMEOUT */ +/* Description: PTC_1 Time out */ +#define SH_LB_ERROR_SUMMARY_PTC_1_TIMEOUT_SHFT 12 +#define SH_LB_ERROR_SUMMARY_PTC_1_TIMEOUT_MASK 0x0000000000001000 + +/* SH_LB_ERROR_SUMMARY_JUNK_BUS_ERR */ +/* Description: Junk Bus error */ +#define SH_LB_ERROR_SUMMARY_JUNK_BUS_ERR_SHFT 13 +#define SH_LB_ERROR_SUMMARY_JUNK_BUS_ERR_MASK 0x0000000000002000 + +/* SH_LB_ERROR_SUMMARY_PIO_CB_ERR */ +/* Description: PIO Conveyor Belt operation error */ +#define SH_LB_ERROR_SUMMARY_PIO_CB_ERR_SHFT 14 +#define SH_LB_ERROR_SUMMARY_PIO_CB_ERR_MASK 0x0000000000004000 + +/* SH_LB_ERROR_SUMMARY_VECTOR_RQ_ROUTE_ERROR */ +/* Description: Vector request Route data was invalid */ +#define SH_LB_ERROR_SUMMARY_VECTOR_RQ_ROUTE_ERROR_SHFT 15 +#define SH_LB_ERROR_SUMMARY_VECTOR_RQ_ROUTE_ERROR_MASK 0x0000000000008000 + +/* SH_LB_ERROR_SUMMARY_VECTOR_RP_ROUTE_ERROR */ +/* Description: Vector reply Route data was invalid */ +#define SH_LB_ERROR_SUMMARY_VECTOR_RP_ROUTE_ERROR_SHFT 16 +#define SH_LB_ERROR_SUMMARY_VECTOR_RP_ROUTE_ERROR_MASK 0x0000000000010000 + +/* SH_LB_ERROR_SUMMARY_GCLK_DROP */ +/* Description: Gclk drop error */ +#define SH_LB_ERROR_SUMMARY_GCLK_DROP_SHFT 17 +#define SH_LB_ERROR_SUMMARY_GCLK_DROP_MASK 0x0000000000020000 + +/* SH_LB_ERROR_SUMMARY_RQ_FIFO_ERROR */ +/* Description: Request queue FIFO error */ +#define SH_LB_ERROR_SUMMARY_RQ_FIFO_ERROR_SHFT 18 +#define SH_LB_ERROR_SUMMARY_RQ_FIFO_ERROR_MASK 0x0000000000040000 + +/* SH_LB_ERROR_SUMMARY_RP_FIFO_ERROR */ +/* Description: Reply queue FIFO error */ +#define SH_LB_ERROR_SUMMARY_RP_FIFO_ERROR_SHFT 19 +#define SH_LB_ERROR_SUMMARY_RP_FIFO_ERROR_MASK 0x0000000000080000 + +/* SH_LB_ERROR_SUMMARY_UNEXP_VALID */ +/* Description: Unexpected valid error */ +#define SH_LB_ERROR_SUMMARY_UNEXP_VALID_SHFT 20 +#define SH_LB_ERROR_SUMMARY_UNEXP_VALID_MASK 0x0000000000100000 + +/* SH_LB_ERROR_SUMMARY_RQ_CREDIT_OVERFLOW */ +/* Description: Request queue credit overflow */ +#define SH_LB_ERROR_SUMMARY_RQ_CREDIT_OVERFLOW_SHFT 21 +#define SH_LB_ERROR_SUMMARY_RQ_CREDIT_OVERFLOW_MASK 0x0000000000200000 + +/* SH_LB_ERROR_SUMMARY_RP_CREDIT_OVERFLOW */ +/* Description: Reply queue credit overflow */ +#define SH_LB_ERROR_SUMMARY_RP_CREDIT_OVERFLOW_SHFT 22 +#define SH_LB_ERROR_SUMMARY_RP_CREDIT_OVERFLOW_MASK 0x0000000000400000 + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_SUMMARY_ALIAS" */ +/* LB Error Bits Alias */ +/* ==================================================================== */ + +#define SH_LB_ERROR_SUMMARY_ALIAS 0x0000000110050588 + +/* ==================================================================== */ +/* Register "SH_LB_FIRST_ERROR" */ +/* LB First Error */ +/* ==================================================================== */ + +#define SH_LB_FIRST_ERROR 0x0000000110050600 +#define SH_LB_FIRST_ERROR_MASK 0x00000000007fffff +#define SH_LB_FIRST_ERROR_INIT 0x0000000000000000 + +/* SH_LB_FIRST_ERROR_RQ_BAD_CMD */ +/* Description: RQ_BAD_CMD */ +#define SH_LB_FIRST_ERROR_RQ_BAD_CMD_SHFT 0 +#define SH_LB_FIRST_ERROR_RQ_BAD_CMD_MASK 0x0000000000000001 + +/* SH_LB_FIRST_ERROR_RP_BAD_CMD */ +/* Description: RP_BAD_CMD */ +#define SH_LB_FIRST_ERROR_RP_BAD_CMD_SHFT 1 +#define SH_LB_FIRST_ERROR_RP_BAD_CMD_MASK 0x0000000000000002 + +/* SH_LB_FIRST_ERROR_RQ_SHORT */ +/* Description: RQ_SHORT */ +#define SH_LB_FIRST_ERROR_RQ_SHORT_SHFT 2 +#define SH_LB_FIRST_ERROR_RQ_SHORT_MASK 0x0000000000000004 + +/* SH_LB_FIRST_ERROR_RP_SHORT */ +/* Description: RP_SHORT */ +#define SH_LB_FIRST_ERROR_RP_SHORT_SHFT 3 +#define SH_LB_FIRST_ERROR_RP_SHORT_MASK 0x0000000000000008 + +/* SH_LB_FIRST_ERROR_RQ_LONG */ +/* Description: RQ_LONG */ +#define SH_LB_FIRST_ERROR_RQ_LONG_SHFT 4 +#define SH_LB_FIRST_ERROR_RQ_LONG_MASK 0x0000000000000010 + +/* SH_LB_FIRST_ERROR_RP_LONG */ +/* Description: RP_LONG */ +#define SH_LB_FIRST_ERROR_RP_LONG_SHFT 5 +#define SH_LB_FIRST_ERROR_RP_LONG_MASK 0x0000000000000020 + +/* SH_LB_FIRST_ERROR_RQ_BAD_DATA */ +/* Description: RQ_BAD_DATA */ +#define SH_LB_FIRST_ERROR_RQ_BAD_DATA_SHFT 6 +#define SH_LB_FIRST_ERROR_RQ_BAD_DATA_MASK 0x0000000000000040 + +/* SH_LB_FIRST_ERROR_RP_BAD_DATA */ +/* Description: RP_BAD_DATA */ +#define SH_LB_FIRST_ERROR_RP_BAD_DATA_SHFT 7 +#define SH_LB_FIRST_ERROR_RP_BAD_DATA_MASK 0x0000000000000080 + +/* SH_LB_FIRST_ERROR_RQ_BAD_ADDR */ +/* Description: RQ_BAD_ADDR */ +#define SH_LB_FIRST_ERROR_RQ_BAD_ADDR_SHFT 8 +#define SH_LB_FIRST_ERROR_RQ_BAD_ADDR_MASK 0x0000000000000100 + +/* SH_LB_FIRST_ERROR_RQ_TIME_OUT */ +/* Description: RQ_TIME_OUT */ +#define SH_LB_FIRST_ERROR_RQ_TIME_OUT_SHFT 9 +#define SH_LB_FIRST_ERROR_RQ_TIME_OUT_MASK 0x0000000000000200 + +/* SH_LB_FIRST_ERROR_LINVV_OVERFLOW */ +/* Description: LINVV_OVERFLOW */ +#define SH_LB_FIRST_ERROR_LINVV_OVERFLOW_SHFT 10 +#define SH_LB_FIRST_ERROR_LINVV_OVERFLOW_MASK 0x0000000000000400 + +/* SH_LB_FIRST_ERROR_UNEXPECTED_LINV */ +/* Description: UNEXPECTED_LINV */ +#define SH_LB_FIRST_ERROR_UNEXPECTED_LINV_SHFT 11 +#define SH_LB_FIRST_ERROR_UNEXPECTED_LINV_MASK 0x0000000000000800 + +/* SH_LB_FIRST_ERROR_PTC_1_TIMEOUT */ +/* Description: PTC_1 Time out */ +#define SH_LB_FIRST_ERROR_PTC_1_TIMEOUT_SHFT 12 +#define SH_LB_FIRST_ERROR_PTC_1_TIMEOUT_MASK 0x0000000000001000 + +/* SH_LB_FIRST_ERROR_JUNK_BUS_ERR */ +/* Description: Junk Bus error */ +#define SH_LB_FIRST_ERROR_JUNK_BUS_ERR_SHFT 13 +#define SH_LB_FIRST_ERROR_JUNK_BUS_ERR_MASK 0x0000000000002000 + +/* SH_LB_FIRST_ERROR_PIO_CB_ERR */ +/* Description: PIO Conveyor Belt operation error */ +#define SH_LB_FIRST_ERROR_PIO_CB_ERR_SHFT 14 +#define SH_LB_FIRST_ERROR_PIO_CB_ERR_MASK 0x0000000000004000 + +/* SH_LB_FIRST_ERROR_VECTOR_RQ_ROUTE_ERROR */ +/* Description: Vector request Route data was invalid */ +#define SH_LB_FIRST_ERROR_VECTOR_RQ_ROUTE_ERROR_SHFT 15 +#define SH_LB_FIRST_ERROR_VECTOR_RQ_ROUTE_ERROR_MASK 0x0000000000008000 + +/* SH_LB_FIRST_ERROR_VECTOR_RP_ROUTE_ERROR */ +/* Description: Vector reply Route data was invalid */ +#define SH_LB_FIRST_ERROR_VECTOR_RP_ROUTE_ERROR_SHFT 16 +#define SH_LB_FIRST_ERROR_VECTOR_RP_ROUTE_ERROR_MASK 0x0000000000010000 + +/* SH_LB_FIRST_ERROR_GCLK_DROP */ +/* Description: Gclk drop error */ +#define SH_LB_FIRST_ERROR_GCLK_DROP_SHFT 17 +#define SH_LB_FIRST_ERROR_GCLK_DROP_MASK 0x0000000000020000 + +/* SH_LB_FIRST_ERROR_RQ_FIFO_ERROR */ +/* Description: Request queue FIFO error */ +#define SH_LB_FIRST_ERROR_RQ_FIFO_ERROR_SHFT 18 +#define SH_LB_FIRST_ERROR_RQ_FIFO_ERROR_MASK 0x0000000000040000 + +/* SH_LB_FIRST_ERROR_RP_FIFO_ERROR */ +/* Description: Reply queue FIFO error */ +#define SH_LB_FIRST_ERROR_RP_FIFO_ERROR_SHFT 19 +#define SH_LB_FIRST_ERROR_RP_FIFO_ERROR_MASK 0x0000000000080000 + +/* SH_LB_FIRST_ERROR_UNEXP_VALID */ +/* Description: Unexpected valid error */ +#define SH_LB_FIRST_ERROR_UNEXP_VALID_SHFT 20 +#define SH_LB_FIRST_ERROR_UNEXP_VALID_MASK 0x0000000000100000 + +/* SH_LB_FIRST_ERROR_RQ_CREDIT_OVERFLOW */ +/* Description: Request queue credit overflow */ +#define SH_LB_FIRST_ERROR_RQ_CREDIT_OVERFLOW_SHFT 21 +#define SH_LB_FIRST_ERROR_RQ_CREDIT_OVERFLOW_MASK 0x0000000000200000 + +/* SH_LB_FIRST_ERROR_RP_CREDIT_OVERFLOW */ +/* Description: Reply queue credit overflow */ +#define SH_LB_FIRST_ERROR_RP_CREDIT_OVERFLOW_SHFT 22 +#define SH_LB_FIRST_ERROR_RP_CREDIT_OVERFLOW_MASK 0x0000000000400000 + +/* ==================================================================== */ +/* Register "SH_LB_LAST_CREDIT" */ +/* Credit counter status register */ +/* ==================================================================== */ + +#define SH_LB_LAST_CREDIT 0x0000000110050680 +#define SH_LB_LAST_CREDIT_MASK 0x000000000ffff3df +#define SH_LB_LAST_CREDIT_INIT 0x0000000000000000 + +/* SH_LB_LAST_CREDIT_LIQ_RQ_CREDIT */ +/* Description: LIQ request queue credit counter */ +#define SH_LB_LAST_CREDIT_LIQ_RQ_CREDIT_SHFT 0 +#define SH_LB_LAST_CREDIT_LIQ_RQ_CREDIT_MASK 0x000000000000001f + +/* SH_LB_LAST_CREDIT_LIQ_RP_CREDIT */ +/* Description: LIQ reply queue credit counter */ +#define SH_LB_LAST_CREDIT_LIQ_RP_CREDIT_SHFT 6 +#define SH_LB_LAST_CREDIT_LIQ_RP_CREDIT_MASK 0x00000000000003c0 + +/* SH_LB_LAST_CREDIT_LINVV_CREDIT */ +/* Description: LINVV credit counter */ +#define SH_LB_LAST_CREDIT_LINVV_CREDIT_SHFT 12 +#define SH_LB_LAST_CREDIT_LINVV_CREDIT_MASK 0x000000000003f000 + +/* SH_LB_LAST_CREDIT_LOQ_RQ_CREDIT */ +/* Description: LOQ request queue credit counter */ +#define SH_LB_LAST_CREDIT_LOQ_RQ_CREDIT_SHFT 18 +#define SH_LB_LAST_CREDIT_LOQ_RQ_CREDIT_MASK 0x00000000007c0000 + +/* SH_LB_LAST_CREDIT_LOQ_RP_CREDIT */ +/* Description: LOQ reply queue credit counter */ +#define SH_LB_LAST_CREDIT_LOQ_RP_CREDIT_SHFT 23 +#define SH_LB_LAST_CREDIT_LOQ_RP_CREDIT_MASK 0x000000000f800000 + +/* ==================================================================== */ +/* Register "SH_LB_NACK_STATUS" */ +/* Nack Counter Status Register */ +/* ==================================================================== */ + +#define SH_LB_NACK_STATUS 0x0000000110050700 +#define SH_LB_NACK_STATUS_MASK 0x3fffffff0fff0fff +#define SH_LB_NACK_STATUS_INIT 0x0000000000000000 + +/* SH_LB_NACK_STATUS_PIO_NACK_A */ +/* Description: PIO nackA counter */ +#define SH_LB_NACK_STATUS_PIO_NACK_A_SHFT 0 +#define SH_LB_NACK_STATUS_PIO_NACK_A_MASK 0x0000000000000fff + +/* SH_LB_NACK_STATUS_PIO_NACK_B */ +/* Description: PIO nackA counter */ +#define SH_LB_NACK_STATUS_PIO_NACK_B_SHFT 16 +#define SH_LB_NACK_STATUS_PIO_NACK_B_MASK 0x000000000fff0000 + +/* SH_LB_NACK_STATUS_JUNK_NACK */ +/* Description: Junk bus nack counter */ +#define SH_LB_NACK_STATUS_JUNK_NACK_SHFT 32 +#define SH_LB_NACK_STATUS_JUNK_NACK_MASK 0x0000ffff00000000 + +/* SH_LB_NACK_STATUS_CB_TIMEOUT_COUNT */ +/* Description: Conveyor belt time out counter */ +#define SH_LB_NACK_STATUS_CB_TIMEOUT_COUNT_SHFT 48 +#define SH_LB_NACK_STATUS_CB_TIMEOUT_COUNT_MASK 0x0fff000000000000 + +/* SH_LB_NACK_STATUS_CB_STATE */ +/* Description: Conveyor belt state */ +#define SH_LB_NACK_STATUS_CB_STATE_SHFT 60 +#define SH_LB_NACK_STATUS_CB_STATE_MASK 0x3000000000000000 + +/* ==================================================================== */ +/* Register "SH_LB_TRIGGER_COMPARE" */ +/* LB Test-point Trigger Compare */ +/* ==================================================================== */ + +#define SH_LB_TRIGGER_COMPARE 0x0000000110050780 +#define SH_LB_TRIGGER_COMPARE_MASK 0x00000000ffffffff +#define SH_LB_TRIGGER_COMPARE_INIT 0x0000000000000000 + +/* SH_LB_TRIGGER_COMPARE_MASK */ +/* Description: Mask to select Debug bits for trigger generation */ +#define SH_LB_TRIGGER_COMPARE_MASK_SHFT 0 +#define SH_LB_TRIGGER_COMPARE_MASK_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_LB_TRIGGER_DATA" */ +/* LB Test-point Trigger Compare Data */ +/* ==================================================================== */ + +#define SH_LB_TRIGGER_DATA 0x0000000110050800 +#define SH_LB_TRIGGER_DATA_MASK 0x00000000ffffffff +#define SH_LB_TRIGGER_DATA_INIT 0x00000000ffffffff + +/* SH_LB_TRIGGER_DATA_COMPARE_PATTERN */ +/* Description: debug bit pattern for trigger generation */ +#define SH_LB_TRIGGER_DATA_COMPARE_PATTERN_SHFT 0 +#define SH_LB_TRIGGER_DATA_COMPARE_PATTERN_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_PI_AEC_CONFIG" */ +/* PI Adaptive Error Correction Configuration */ +/* ==================================================================== */ + +#define SH_PI_AEC_CONFIG 0x0000000120050000 +#define SH_PI_AEC_CONFIG_MASK 0x0000000000000007 +#define SH_PI_AEC_CONFIG_INIT 0x0000000000000000 + +/* SH_PI_AEC_CONFIG_MODE */ +/* Description: AEC Operation Mode */ +#define SH_PI_AEC_CONFIG_MODE_SHFT 0 +#define SH_PI_AEC_CONFIG_MODE_MASK 0x0000000000000007 + +/* ==================================================================== */ +/* Register "SH_PI_AFI_ERROR_MASK" */ +/* PI AFI Error Mask */ +/* ==================================================================== */ + +#define SH_PI_AFI_ERROR_MASK 0x0000000120050080 +#define SH_PI_AFI_ERROR_MASK_MASK 0x00000007ffe00000 +#define SH_PI_AFI_ERROR_MASK_INIT 0x00000007ffe00000 + +/* SH_PI_AFI_ERROR_MASK_HUNG_BUS */ +/* Description: FSB is hung */ +#define SH_PI_AFI_ERROR_MASK_HUNG_BUS_SHFT 21 +#define SH_PI_AFI_ERROR_MASK_HUNG_BUS_MASK 0x0000000000200000 + +/* SH_PI_AFI_ERROR_MASK_RSP_PARITY */ +/* Description: Parity error detecte during response phase */ +#define SH_PI_AFI_ERROR_MASK_RSP_PARITY_SHFT 22 +#define SH_PI_AFI_ERROR_MASK_RSP_PARITY_MASK 0x0000000000400000 + +/* SH_PI_AFI_ERROR_MASK_IOQ_OVERRUN */ +/* Description: Over run error detected on IOQ */ +#define SH_PI_AFI_ERROR_MASK_IOQ_OVERRUN_SHFT 23 +#define SH_PI_AFI_ERROR_MASK_IOQ_OVERRUN_MASK 0x0000000000800000 + +/* SH_PI_AFI_ERROR_MASK_REQ_FORMAT */ +/* Description: FSB request format not supported */ +#define SH_PI_AFI_ERROR_MASK_REQ_FORMAT_SHFT 24 +#define SH_PI_AFI_ERROR_MASK_REQ_FORMAT_MASK 0x0000000001000000 + +/* SH_PI_AFI_ERROR_MASK_ADDR_ACCESS */ +/* Description: Access to Address is not supported */ +#define SH_PI_AFI_ERROR_MASK_ADDR_ACCESS_SHFT 25 +#define SH_PI_AFI_ERROR_MASK_ADDR_ACCESS_MASK 0x0000000002000000 + +/* SH_PI_AFI_ERROR_MASK_REQ_PARITY */ +/* Description: Parity error detected during request phase */ +#define SH_PI_AFI_ERROR_MASK_REQ_PARITY_SHFT 26 +#define SH_PI_AFI_ERROR_MASK_REQ_PARITY_MASK 0x0000000004000000 + +/* SH_PI_AFI_ERROR_MASK_ADDR_PARITY */ +/* Description: Parity error detected on address */ +#define SH_PI_AFI_ERROR_MASK_ADDR_PARITY_SHFT 27 +#define SH_PI_AFI_ERROR_MASK_ADDR_PARITY_MASK 0x0000000008000000 + +/* SH_PI_AFI_ERROR_MASK_SHUB_FSB_DQE */ +/* Description: SHUB_FSB_DQE */ +#define SH_PI_AFI_ERROR_MASK_SHUB_FSB_DQE_SHFT 28 +#define SH_PI_AFI_ERROR_MASK_SHUB_FSB_DQE_MASK 0x0000000010000000 + +/* SH_PI_AFI_ERROR_MASK_SHUB_FSB_UCE */ +/* Description: An un-correctable ECC error was detected */ +#define SH_PI_AFI_ERROR_MASK_SHUB_FSB_UCE_SHFT 29 +#define SH_PI_AFI_ERROR_MASK_SHUB_FSB_UCE_MASK 0x0000000020000000 + +/* SH_PI_AFI_ERROR_MASK_SHUB_FSB_CE */ +/* Description: An correctable ECC error was detected */ +#define SH_PI_AFI_ERROR_MASK_SHUB_FSB_CE_SHFT 30 +#define SH_PI_AFI_ERROR_MASK_SHUB_FSB_CE_MASK 0x0000000040000000 + +/* SH_PI_AFI_ERROR_MASK_LIVELOCK */ +/* Description: AFI livelock error was detected */ +#define SH_PI_AFI_ERROR_MASK_LIVELOCK_SHFT 31 +#define SH_PI_AFI_ERROR_MASK_LIVELOCK_MASK 0x0000000080000000 + +/* SH_PI_AFI_ERROR_MASK_BAD_SNOOP */ +/* Description: AFI bad snoop error was detected */ +#define SH_PI_AFI_ERROR_MASK_BAD_SNOOP_SHFT 32 +#define SH_PI_AFI_ERROR_MASK_BAD_SNOOP_MASK 0x0000000100000000 + +/* SH_PI_AFI_ERROR_MASK_FSB_TBL_MISS */ +/* Description: AFI FSB request table miss error was detected */ +#define SH_PI_AFI_ERROR_MASK_FSB_TBL_MISS_SHFT 33 +#define SH_PI_AFI_ERROR_MASK_FSB_TBL_MISS_MASK 0x0000000200000000 + +/* SH_PI_AFI_ERROR_MASK_MSG_LEN */ +/* Description: Runt or Obese message received from SIC */ +#define SH_PI_AFI_ERROR_MASK_MSG_LEN_SHFT 34 +#define SH_PI_AFI_ERROR_MASK_MSG_LEN_MASK 0x0000000400000000 + +/* ==================================================================== */ +/* Register "SH_PI_AFI_TEST_POINT_COMPARE" */ +/* PI AFI Test Point Compare */ +/* ==================================================================== */ + +#define SH_PI_AFI_TEST_POINT_COMPARE 0x0000000120050100 +#define SH_PI_AFI_TEST_POINT_COMPARE_MASK 0xffffffffffffffff +#define SH_PI_AFI_TEST_POINT_COMPARE_INIT 0xffffffff00000000 + +/* SH_PI_AFI_TEST_POINT_COMPARE_COMPARE_MASK */ +/* Description: Mask to select Debug bits for trigger generation */ +#define SH_PI_AFI_TEST_POINT_COMPARE_COMPARE_MASK_SHFT 0 +#define SH_PI_AFI_TEST_POINT_COMPARE_COMPARE_MASK_MASK 0x00000000ffffffff + +/* SH_PI_AFI_TEST_POINT_COMPARE_COMPARE_PATTERN */ +/* Description: debug bit pattern for trigger generation */ +#define SH_PI_AFI_TEST_POINT_COMPARE_COMPARE_PATTERN_SHFT 32 +#define SH_PI_AFI_TEST_POINT_COMPARE_COMPARE_PATTERN_MASK 0xffffffff00000000 + +/* ==================================================================== */ +/* Register "SH_PI_AFI_TEST_POINT_SELECT" */ +/* PI AFI Test Point Select */ +/* ==================================================================== */ + +#define SH_PI_AFI_TEST_POINT_SELECT 0x0000000120050180 +#define SH_PI_AFI_TEST_POINT_SELECT_MASK 0xff7f7f7f7f7f7f7f +#define SH_PI_AFI_TEST_POINT_SELECT_INIT 0x0000000000000000 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE0_CHIPLET_SEL */ +/* Description: Nibble 0: Word Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE0_CHIPLET_SEL_SHFT 0 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE0_CHIPLET_SEL_MASK 0x000000000000000f + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble 0: Nibble Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE0_NIBBLE_SEL_SHFT 4 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE1_CHIPLET_SEL */ +/* Description: Nibble 1: Word Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE1_CHIPLET_SEL_SHFT 8 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE1_CHIPLET_SEL_MASK 0x0000000000000f00 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble 1: Nibble Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE1_NIBBLE_SEL_SHFT 12 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE2_CHIPLET_SEL */ +/* Description: Nibble 2: Word Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE2_CHIPLET_SEL_SHFT 16 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE2_CHIPLET_SEL_MASK 0x00000000000f0000 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble 2: Nibble Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE2_NIBBLE_SEL_SHFT 20 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE3_CHIPLET_SEL */ +/* Description: Nibble 3: Word Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE3_CHIPLET_SEL_SHFT 24 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE3_CHIPLET_SEL_MASK 0x000000000f000000 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble 3: Nibble Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE3_NIBBLE_SEL_SHFT 28 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE4_CHIPLET_SEL */ +/* Description: Nibble 4: Word Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE4_CHIPLET_SEL_SHFT 32 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE4_CHIPLET_SEL_MASK 0x0000000f00000000 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble 4: Nibble Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE4_NIBBLE_SEL_SHFT 36 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE5_CHIPLET_SEL */ +/* Description: Nibble 5: Word Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE5_CHIPLET_SEL_SHFT 40 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE5_CHIPLET_SEL_MASK 0x00000f0000000000 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble 5: Nibble Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE5_NIBBLE_SEL_SHFT 44 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE6_CHIPLET_SEL */ +/* Description: Nibble 6: Word Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE6_CHIPLET_SEL_SHFT 48 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE6_CHIPLET_SEL_MASK 0x000f000000000000 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble 6: Nibble Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE6_NIBBLE_SEL_SHFT 52 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE7_CHIPLET_SEL */ +/* Description: Nibble 7: Word Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE7_CHIPLET_SEL_SHFT 56 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE7_CHIPLET_SEL_MASK 0x0f00000000000000 + +/* SH_PI_AFI_TEST_POINT_SELECT_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble 7: Nibble Select */ +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE7_NIBBLE_SEL_SHFT 60 +#define SH_PI_AFI_TEST_POINT_SELECT_NIBBLE7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* SH_PI_AFI_TEST_POINT_SELECT_TRIGGER_ENABLE */ +/* Description: Trigger Enabled */ +#define SH_PI_AFI_TEST_POINT_SELECT_TRIGGER_ENABLE_SHFT 63 +#define SH_PI_AFI_TEST_POINT_SELECT_TRIGGER_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_AFI_TEST_POINT_TRIGGER_SELECT" */ +/* PI CRBC Test Point Trigger Select */ +/* ==================================================================== */ + +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT 0x0000000120050200 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_MASK 0x7f7f7f7f7f7f7f7f +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_INIT 0x0000000000000000 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER0_CHIPLET_SEL */ +/* Description: Nibble 0 Chiplet select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER0_CHIPLET_SEL_SHFT 0 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER0_CHIPLET_SEL_MASK 0x000000000000000f + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER0_NIBBLE_SEL_SHFT 4 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER1_CHIPLET_SEL */ +/* Description: Nibble 1 Chiplet select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER1_CHIPLET_SEL_SHFT 8 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER1_CHIPLET_SEL_MASK 0x0000000000000f00 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER1_NIBBLE_SEL_SHFT 12 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER2_CHIPLET_SEL */ +/* Description: Nibble 2 Chiplet select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER2_CHIPLET_SEL_SHFT 16 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER2_CHIPLET_SEL_MASK 0x00000000000f0000 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER2_NIBBLE_SEL_SHFT 20 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER3_CHIPLET_SEL */ +/* Description: Nibble 3 Chiplet select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER3_CHIPLET_SEL_SHFT 24 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER3_CHIPLET_SEL_MASK 0x000000000f000000 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER3_NIBBLE_SEL_SHFT 28 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER4_CHIPLET_SEL */ +/* Description: Nibble 4 Chiplet select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER4_CHIPLET_SEL_SHFT 32 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER4_CHIPLET_SEL_MASK 0x0000000f00000000 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER4_NIBBLE_SEL_SHFT 36 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER5_CHIPLET_SEL */ +/* Description: Nibble 5 Chiplet select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER5_CHIPLET_SEL_SHFT 40 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER5_CHIPLET_SEL_MASK 0x00000f0000000000 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER5_NIBBLE_SEL_SHFT 44 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER6_CHIPLET_SEL */ +/* Description: Nibble 6 Chiplet select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER6_CHIPLET_SEL_SHFT 48 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER6_CHIPLET_SEL_MASK 0x000f000000000000 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER6_NIBBLE_SEL_SHFT 52 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER7_CHIPLET_SEL */ +/* Description: Nibble 7 Chiplet select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER7_CHIPLET_SEL_SHFT 56 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER7_CHIPLET_SEL_MASK 0x0f00000000000000 + +/* SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER7_NIBBLE_SEL_SHFT 60 +#define SH_PI_AFI_TEST_POINT_TRIGGER_SELECT_TRIGGER7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_AUTO_REPLY_ENABLE" */ +/* PI Auto Reply Enable */ +/* ==================================================================== */ + +#define SH_PI_AUTO_REPLY_ENABLE 0x0000000120050280 +#define SH_PI_AUTO_REPLY_ENABLE_MASK 0x0000000000000001 +#define SH_PI_AUTO_REPLY_ENABLE_INIT 0x0000000000000000 + +/* SH_PI_AUTO_REPLY_ENABLE_AUTO_REPLY_ENABLE */ +/* Description: Auto Reply Enabled */ +#define SH_PI_AUTO_REPLY_ENABLE_AUTO_REPLY_ENABLE_SHFT 0 +#define SH_PI_AUTO_REPLY_ENABLE_AUTO_REPLY_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_PI_CAM_CONTROL" */ +/* CRB CAM MMR Access Control */ +/* ==================================================================== */ + +#define SH_PI_CAM_CONTROL 0x0000000120050300 +#define SH_PI_CAM_CONTROL_MASK 0x800000000000037f +#define SH_PI_CAM_CONTROL_INIT 0x0000000000000000 + +/* SH_PI_CAM_CONTROL_CAM_INDX */ +/* Description: CRB CAM Index to perform read/write on. */ +#define SH_PI_CAM_CONTROL_CAM_INDX_SHFT 0 +#define SH_PI_CAM_CONTROL_CAM_INDX_MASK 0x000000000000007f + +/* SH_PI_CAM_CONTROL_CAM_WRITE */ +/* Description: Is CRB CAM MMR function a write. */ +#define SH_PI_CAM_CONTROL_CAM_WRITE_SHFT 8 +#define SH_PI_CAM_CONTROL_CAM_WRITE_MASK 0x0000000000000100 + +/* SH_PI_CAM_CONTROL_RRB_RD_XFER_CLEAR */ +/* Description: Clear RRB read tranfer pending. */ +#define SH_PI_CAM_CONTROL_RRB_RD_XFER_CLEAR_SHFT 9 +#define SH_PI_CAM_CONTROL_RRB_RD_XFER_CLEAR_MASK 0x0000000000000200 + +/* SH_PI_CAM_CONTROL_START */ +/* Description: Start CRB CAM read/write operation */ +#define SH_PI_CAM_CONTROL_START_SHFT 63 +#define SH_PI_CAM_CONTROL_START_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_CRBC_TEST_POINT_COMPARE" */ +/* PI CRBC Test Point Compare */ +/* ==================================================================== */ + +#define SH_PI_CRBC_TEST_POINT_COMPARE 0x0000000120050380 +#define SH_PI_CRBC_TEST_POINT_COMPARE_MASK 0xffffffffffffffff +#define SH_PI_CRBC_TEST_POINT_COMPARE_INIT 0xffffffff00000000 + +/* SH_PI_CRBC_TEST_POINT_COMPARE_COMPARE_MASK */ +/* Description: Mask to select Debug bits for trigger generation */ +#define SH_PI_CRBC_TEST_POINT_COMPARE_COMPARE_MASK_SHFT 0 +#define SH_PI_CRBC_TEST_POINT_COMPARE_COMPARE_MASK_MASK 0x00000000ffffffff + +/* SH_PI_CRBC_TEST_POINT_COMPARE_COMPARE_PATTERN */ +/* Description: debug bit pattern for trigger generation */ +#define SH_PI_CRBC_TEST_POINT_COMPARE_COMPARE_PATTERN_SHFT 32 +#define SH_PI_CRBC_TEST_POINT_COMPARE_COMPARE_PATTERN_MASK 0xffffffff00000000 + +/* ==================================================================== */ +/* Register "SH_PI_CRBC_TEST_POINT_SELECT" */ +/* PI CRBC Test Point Select */ +/* ==================================================================== */ + +#define SH_PI_CRBC_TEST_POINT_SELECT 0x0000000120050400 +#define SH_PI_CRBC_TEST_POINT_SELECT_MASK 0xf777777777777777 +#define SH_PI_CRBC_TEST_POINT_SELECT_INIT 0x0000000000000000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE0_CHIPLET_SEL */ +/* Description: Nibble 0 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE0_CHIPLET_SEL_SHFT 0 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE0_CHIPLET_SEL_MASK 0x0000000000000007 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE0_NIBBLE_SEL_SHFT 4 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE1_CHIPLET_SEL */ +/* Description: Nibble 1 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE1_CHIPLET_SEL_SHFT 8 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE1_CHIPLET_SEL_MASK 0x0000000000000700 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE1_NIBBLE_SEL_SHFT 12 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE2_CHIPLET_SEL */ +/* Description: Nibble 2 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE2_CHIPLET_SEL_SHFT 16 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE2_CHIPLET_SEL_MASK 0x0000000000070000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE2_NIBBLE_SEL_SHFT 20 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE3_CHIPLET_SEL */ +/* Description: Nibble 3 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE3_CHIPLET_SEL_SHFT 24 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE3_CHIPLET_SEL_MASK 0x0000000007000000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE3_NIBBLE_SEL_SHFT 28 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE4_CHIPLET_SEL */ +/* Description: Nibble 4 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE4_CHIPLET_SEL_SHFT 32 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE4_CHIPLET_SEL_MASK 0x0000000700000000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE4_NIBBLE_SEL_SHFT 36 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE5_CHIPLET_SEL */ +/* Description: Nibble 5 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE5_CHIPLET_SEL_SHFT 40 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE5_CHIPLET_SEL_MASK 0x0000070000000000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE5_NIBBLE_SEL_SHFT 44 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE6_CHIPLET_SEL */ +/* Description: Nibble 6 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE6_CHIPLET_SEL_SHFT 48 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE6_CHIPLET_SEL_MASK 0x0007000000000000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE6_NIBBLE_SEL_SHFT 52 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE7_CHIPLET_SEL */ +/* Description: Nibble 7 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE7_CHIPLET_SEL_SHFT 56 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE7_CHIPLET_SEL_MASK 0x0700000000000000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE7_NIBBLE_SEL_SHFT 60 +#define SH_PI_CRBC_TEST_POINT_SELECT_NIBBLE7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* SH_PI_CRBC_TEST_POINT_SELECT_TRIGGER_ENABLE */ +/* Description: Enable trigger on bit 32 of Analyzer data */ +#define SH_PI_CRBC_TEST_POINT_SELECT_TRIGGER_ENABLE_SHFT 63 +#define SH_PI_CRBC_TEST_POINT_SELECT_TRIGGER_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT" */ +/* PI CRBC Test Point Trigger Select */ +/* ==================================================================== */ + +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT 0x0000000120050480 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_MASK 0x7777777777777777 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_INIT 0x0000000000000000 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER0_CHIPLET_SEL */ +/* Description: Nibble 0 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER0_CHIPLET_SEL_SHFT 0 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER0_CHIPLET_SEL_MASK 0x0000000000000007 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER0_NIBBLE_SEL_SHFT 4 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER1_CHIPLET_SEL */ +/* Description: Nibble 1 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER1_CHIPLET_SEL_SHFT 8 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER1_CHIPLET_SEL_MASK 0x0000000000000700 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER1_NIBBLE_SEL_SHFT 12 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER2_CHIPLET_SEL */ +/* Description: Nibble 2 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER2_CHIPLET_SEL_SHFT 16 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER2_CHIPLET_SEL_MASK 0x0000000000070000 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER2_NIBBLE_SEL_SHFT 20 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER3_CHIPLET_SEL */ +/* Description: Nibble 3 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER3_CHIPLET_SEL_SHFT 24 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER3_CHIPLET_SEL_MASK 0x0000000007000000 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER3_NIBBLE_SEL_SHFT 28 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER4_CHIPLET_SEL */ +/* Description: Nibble 4 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER4_CHIPLET_SEL_SHFT 32 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER4_CHIPLET_SEL_MASK 0x0000000700000000 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER4_NIBBLE_SEL_SHFT 36 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER5_CHIPLET_SEL */ +/* Description: Nibble 5 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER5_CHIPLET_SEL_SHFT 40 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER5_CHIPLET_SEL_MASK 0x0000070000000000 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER5_NIBBLE_SEL_SHFT 44 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER6_CHIPLET_SEL */ +/* Description: Nibble 6 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER6_CHIPLET_SEL_SHFT 48 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER6_CHIPLET_SEL_MASK 0x0007000000000000 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER6_NIBBLE_SEL_SHFT 52 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER7_CHIPLET_SEL */ +/* Description: Nibble 7 Chiplet select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER7_CHIPLET_SEL_SHFT 56 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER7_CHIPLET_SEL_MASK 0x0700000000000000 + +/* SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER7_NIBBLE_SEL_SHFT 60 +#define SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT_TRIGGER7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_ERROR_MASK" */ +/* PI CRBP Error Mask */ +/* ==================================================================== */ + +#define SH_PI_CRBP_ERROR_MASK 0x0000000120050500 +#define SH_PI_CRBP_ERROR_MASK_MASK 0x00000000001fffff +#define SH_PI_CRBP_ERROR_MASK_INIT 0x00000000001fffff + +/* SH_PI_CRBP_ERROR_MASK_FSB_PROTO_ERR */ +/* Description: Mask detection internal protocol table misses */ +#define SH_PI_CRBP_ERROR_MASK_FSB_PROTO_ERR_SHFT 0 +#define SH_PI_CRBP_ERROR_MASK_FSB_PROTO_ERR_MASK 0x0000000000000001 + +/* SH_PI_CRBP_ERROR_MASK_GFX_RP_ERR */ +/* Description: Mask graphic reply error detection */ +#define SH_PI_CRBP_ERROR_MASK_GFX_RP_ERR_SHFT 1 +#define SH_PI_CRBP_ERROR_MASK_GFX_RP_ERR_MASK 0x0000000000000002 + +/* SH_PI_CRBP_ERROR_MASK_XB_PROTO_ERR */ +/* Description: Mask detection of external protocol table misses */ +#define SH_PI_CRBP_ERROR_MASK_XB_PROTO_ERR_SHFT 2 +#define SH_PI_CRBP_ERROR_MASK_XB_PROTO_ERR_MASK 0x0000000000000004 + +/* SH_PI_CRBP_ERROR_MASK_MEM_RP_ERR */ +/* Description: Mask memory error reply message detection */ +#define SH_PI_CRBP_ERROR_MASK_MEM_RP_ERR_SHFT 3 +#define SH_PI_CRBP_ERROR_MASK_MEM_RP_ERR_MASK 0x0000000000000008 + +/* SH_PI_CRBP_ERROR_MASK_PIO_RP_ERR */ +/* Description: Mask PIO reply error message detection */ +#define SH_PI_CRBP_ERROR_MASK_PIO_RP_ERR_SHFT 4 +#define SH_PI_CRBP_ERROR_MASK_PIO_RP_ERR_MASK 0x0000000000000010 + +/* SH_PI_CRBP_ERROR_MASK_MEM_TO_ERR */ +/* Description: Mask memory time-out detection */ +#define SH_PI_CRBP_ERROR_MASK_MEM_TO_ERR_SHFT 5 +#define SH_PI_CRBP_ERROR_MASK_MEM_TO_ERR_MASK 0x0000000000000020 + +/* SH_PI_CRBP_ERROR_MASK_PIO_TO_ERR */ +/* Description: Mask PIO time-out detection */ +#define SH_PI_CRBP_ERROR_MASK_PIO_TO_ERR_SHFT 6 +#define SH_PI_CRBP_ERROR_MASK_PIO_TO_ERR_MASK 0x0000000000000040 + +/* SH_PI_CRBP_ERROR_MASK_FSB_SHUB_UCE */ +/* Description: Mask un-correctable ECC error detection */ +#define SH_PI_CRBP_ERROR_MASK_FSB_SHUB_UCE_SHFT 7 +#define SH_PI_CRBP_ERROR_MASK_FSB_SHUB_UCE_MASK 0x0000000000000080 + +/* SH_PI_CRBP_ERROR_MASK_FSB_SHUB_CE */ +/* Description: Mask correctable ECC error detection */ +#define SH_PI_CRBP_ERROR_MASK_FSB_SHUB_CE_SHFT 8 +#define SH_PI_CRBP_ERROR_MASK_FSB_SHUB_CE_MASK 0x0000000000000100 + +/* SH_PI_CRBP_ERROR_MASK_MSG_COLOR_ERR */ +/* Description: Mask detection of color errors */ +#define SH_PI_CRBP_ERROR_MASK_MSG_COLOR_ERR_SHFT 9 +#define SH_PI_CRBP_ERROR_MASK_MSG_COLOR_ERR_MASK 0x0000000000000200 + +/* SH_PI_CRBP_ERROR_MASK_MD_RQ_Q_OFLOW */ +/* Description: Mask MD Request input buffer over flow error */ +#define SH_PI_CRBP_ERROR_MASK_MD_RQ_Q_OFLOW_SHFT 10 +#define SH_PI_CRBP_ERROR_MASK_MD_RQ_Q_OFLOW_MASK 0x0000000000000400 + +/* SH_PI_CRBP_ERROR_MASK_MD_RP_Q_OFLOW */ +/* Description: Mask MD Reply input buffer over flow error */ +#define SH_PI_CRBP_ERROR_MASK_MD_RP_Q_OFLOW_SHFT 11 +#define SH_PI_CRBP_ERROR_MASK_MD_RP_Q_OFLOW_MASK 0x0000000000000800 + +/* SH_PI_CRBP_ERROR_MASK_XN_RQ_Q_OFLOW */ +/* Description: Mask XN Request input buffer over flow error */ +#define SH_PI_CRBP_ERROR_MASK_XN_RQ_Q_OFLOW_SHFT 12 +#define SH_PI_CRBP_ERROR_MASK_XN_RQ_Q_OFLOW_MASK 0x0000000000001000 + +/* SH_PI_CRBP_ERROR_MASK_XN_RP_Q_OFLOW */ +/* Description: Mask XN Reply input buffer over flow error */ +#define SH_PI_CRBP_ERROR_MASK_XN_RP_Q_OFLOW_SHFT 13 +#define SH_PI_CRBP_ERROR_MASK_XN_RP_Q_OFLOW_MASK 0x0000000000002000 + +/* SH_PI_CRBP_ERROR_MASK_NACK_OFLOW */ +/* Description: Mask NACK over flow error */ +#define SH_PI_CRBP_ERROR_MASK_NACK_OFLOW_SHFT 14 +#define SH_PI_CRBP_ERROR_MASK_NACK_OFLOW_MASK 0x0000000000004000 + +/* SH_PI_CRBP_ERROR_MASK_GFX_INT_0 */ +/* Description: Mask GFX transfer interrupt for CPU 0 */ +#define SH_PI_CRBP_ERROR_MASK_GFX_INT_0_SHFT 15 +#define SH_PI_CRBP_ERROR_MASK_GFX_INT_0_MASK 0x0000000000008000 + +/* SH_PI_CRBP_ERROR_MASK_GFX_INT_1 */ +/* Description: Mask GFX transfer interrupt for CPU 1 */ +#define SH_PI_CRBP_ERROR_MASK_GFX_INT_1_SHFT 16 +#define SH_PI_CRBP_ERROR_MASK_GFX_INT_1_MASK 0x0000000000010000 + +/* SH_PI_CRBP_ERROR_MASK_MD_RQ_CRD_OFLOW */ +/* Description: Mask MD Request Credit Overflow Error */ +#define SH_PI_CRBP_ERROR_MASK_MD_RQ_CRD_OFLOW_SHFT 17 +#define SH_PI_CRBP_ERROR_MASK_MD_RQ_CRD_OFLOW_MASK 0x0000000000020000 + +/* SH_PI_CRBP_ERROR_MASK_MD_RP_CRD_OFLOW */ +/* Description: Mask MD Reply Credit Overflow Error */ +#define SH_PI_CRBP_ERROR_MASK_MD_RP_CRD_OFLOW_SHFT 18 +#define SH_PI_CRBP_ERROR_MASK_MD_RP_CRD_OFLOW_MASK 0x0000000000040000 + +/* SH_PI_CRBP_ERROR_MASK_XN_RQ_CRD_OFLOW */ +/* Description: Mask XN Request Credit Overflow Error */ +#define SH_PI_CRBP_ERROR_MASK_XN_RQ_CRD_OFLOW_SHFT 19 +#define SH_PI_CRBP_ERROR_MASK_XN_RQ_CRD_OFLOW_MASK 0x0000000000080000 + +/* SH_PI_CRBP_ERROR_MASK_XN_RP_CRD_OFLOW */ +/* Description: Mask XN Reply Credit Overflow Error */ +#define SH_PI_CRBP_ERROR_MASK_XN_RP_CRD_OFLOW_SHFT 20 +#define SH_PI_CRBP_ERROR_MASK_XN_RP_CRD_OFLOW_MASK 0x0000000000100000 + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_FSB_PIPE_COMPARE" */ +/* CRBP FSB Pipe Compare */ +/* ==================================================================== */ + +#define SH_PI_CRBP_FSB_PIPE_COMPARE 0x0000000120050580 +#define SH_PI_CRBP_FSB_PIPE_COMPARE_MASK 0x001fffffffffffff +#define SH_PI_CRBP_FSB_PIPE_COMPARE_INIT 0x0000000000000000 + +/* SH_PI_CRBP_FSB_PIPE_COMPARE_COMPARE_ADDRESS */ +/* Description: Address A or B to compare against */ +#define SH_PI_CRBP_FSB_PIPE_COMPARE_COMPARE_ADDRESS_SHFT 0 +#define SH_PI_CRBP_FSB_PIPE_COMPARE_COMPARE_ADDRESS_MASK 0x00007fffffffffff + +/* SH_PI_CRBP_FSB_PIPE_COMPARE_COMPARE_REQ */ +/* Description: REQa or REQb value to compare against */ +#define SH_PI_CRBP_FSB_PIPE_COMPARE_COMPARE_REQ_SHFT 47 +#define SH_PI_CRBP_FSB_PIPE_COMPARE_COMPARE_REQ_MASK 0x001f800000000000 + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_FSB_PIPE_MASK" */ +/* CRBP Compare Mask */ +/* ==================================================================== */ + +#define SH_PI_CRBP_FSB_PIPE_MASK 0x0000000120050600 +#define SH_PI_CRBP_FSB_PIPE_MASK_MASK 0x001fffffffffffff +#define SH_PI_CRBP_FSB_PIPE_MASK_INIT 0x0000000000000000 + +/* SH_PI_CRBP_FSB_PIPE_MASK_COMPARE_ADDRESS_MASK */ +/* Description: Address A or B mask values */ +#define SH_PI_CRBP_FSB_PIPE_MASK_COMPARE_ADDRESS_MASK_SHFT 0 +#define SH_PI_CRBP_FSB_PIPE_MASK_COMPARE_ADDRESS_MASK_MASK 0x00007fffffffffff + +/* SH_PI_CRBP_FSB_PIPE_MASK_COMPARE_REQ_MASK */ +/* Description: REQa or REQb mask values */ +#define SH_PI_CRBP_FSB_PIPE_MASK_COMPARE_REQ_MASK_SHFT 47 +#define SH_PI_CRBP_FSB_PIPE_MASK_COMPARE_REQ_MASK_MASK 0x001f800000000000 + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_TEST_POINT_COMPARE" */ +/* PI CRBP Test Point Compare */ +/* ==================================================================== */ + +#define SH_PI_CRBP_TEST_POINT_COMPARE 0x0000000120050680 +#define SH_PI_CRBP_TEST_POINT_COMPARE_MASK 0xffffffffffffffff +#define SH_PI_CRBP_TEST_POINT_COMPARE_INIT 0xffffffff00000000 + +/* SH_PI_CRBP_TEST_POINT_COMPARE_COMPARE_MASK */ +/* Description: Mask to select Debug bits for trigger generation */ +#define SH_PI_CRBP_TEST_POINT_COMPARE_COMPARE_MASK_SHFT 0 +#define SH_PI_CRBP_TEST_POINT_COMPARE_COMPARE_MASK_MASK 0x00000000ffffffff + +/* SH_PI_CRBP_TEST_POINT_COMPARE_COMPARE_PATTERN */ +/* Description: debug bit pattern for trigger generation */ +#define SH_PI_CRBP_TEST_POINT_COMPARE_COMPARE_PATTERN_SHFT 32 +#define SH_PI_CRBP_TEST_POINT_COMPARE_COMPARE_PATTERN_MASK 0xffffffff00000000 + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_TEST_POINT_SELECT" */ +/* PI CRBP Test Point Select */ +/* ==================================================================== */ + +#define SH_PI_CRBP_TEST_POINT_SELECT 0x0000000120050700 +#define SH_PI_CRBP_TEST_POINT_SELECT_MASK 0xf777777777777777 +#define SH_PI_CRBP_TEST_POINT_SELECT_INIT 0x0000000000000000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE0_CHIPLET_SEL */ +/* Description: Nibble 0 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE0_CHIPLET_SEL_SHFT 0 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE0_CHIPLET_SEL_MASK 0x0000000000000007 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE0_NIBBLE_SEL_SHFT 4 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE1_CHIPLET_SEL */ +/* Description: Nibble 1 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE1_CHIPLET_SEL_SHFT 8 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE1_CHIPLET_SEL_MASK 0x0000000000000700 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE1_NIBBLE_SEL_SHFT 12 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE2_CHIPLET_SEL */ +/* Description: Nibble 2 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE2_CHIPLET_SEL_SHFT 16 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE2_CHIPLET_SEL_MASK 0x0000000000070000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE2_NIBBLE_SEL_SHFT 20 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE3_CHIPLET_SEL */ +/* Description: Nibble 3 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE3_CHIPLET_SEL_SHFT 24 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE3_CHIPLET_SEL_MASK 0x0000000007000000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE3_NIBBLE_SEL_SHFT 28 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE4_CHIPLET_SEL */ +/* Description: Nibble 4 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE4_CHIPLET_SEL_SHFT 32 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE4_CHIPLET_SEL_MASK 0x0000000700000000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE4_NIBBLE_SEL_SHFT 36 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE5_CHIPLET_SEL */ +/* Description: Nibble 5 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE5_CHIPLET_SEL_SHFT 40 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE5_CHIPLET_SEL_MASK 0x0000070000000000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE5_NIBBLE_SEL_SHFT 44 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE6_CHIPLET_SEL */ +/* Description: Nibble 6 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE6_CHIPLET_SEL_SHFT 48 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE6_CHIPLET_SEL_MASK 0x0007000000000000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE6_NIBBLE_SEL_SHFT 52 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE7_CHIPLET_SEL */ +/* Description: Nibble 7 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE7_CHIPLET_SEL_SHFT 56 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE7_CHIPLET_SEL_MASK 0x0700000000000000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE7_NIBBLE_SEL_SHFT 60 +#define SH_PI_CRBP_TEST_POINT_SELECT_NIBBLE7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* SH_PI_CRBP_TEST_POINT_SELECT_TRIGGER_ENABLE */ +/* Description: Enable trigger on bit 32 of Analyzer data */ +#define SH_PI_CRBP_TEST_POINT_SELECT_TRIGGER_ENABLE_SHFT 63 +#define SH_PI_CRBP_TEST_POINT_SELECT_TRIGGER_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT" */ +/* PI CRBP Test Point Trigger Select */ +/* ==================================================================== */ + +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT 0x0000000120050780 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_MASK 0x7777777777777777 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_INIT 0x0000000000000000 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER0_CHIPLET_SEL */ +/* Description: Nibble 0 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER0_CHIPLET_SEL_SHFT 0 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER0_CHIPLET_SEL_MASK 0x0000000000000007 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER0_NIBBLE_SEL_SHFT 4 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER1_CHIPLET_SEL */ +/* Description: Nibble 1 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER1_CHIPLET_SEL_SHFT 8 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER1_CHIPLET_SEL_MASK 0x0000000000000700 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER1_NIBBLE_SEL_SHFT 12 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER2_CHIPLET_SEL */ +/* Description: Nibble 2 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER2_CHIPLET_SEL_SHFT 16 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER2_CHIPLET_SEL_MASK 0x0000000000070000 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER2_NIBBLE_SEL_SHFT 20 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER3_CHIPLET_SEL */ +/* Description: Nibble 3 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER3_CHIPLET_SEL_SHFT 24 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER3_CHIPLET_SEL_MASK 0x0000000007000000 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER3_NIBBLE_SEL_SHFT 28 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER4_CHIPLET_SEL */ +/* Description: Nibble 4 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER4_CHIPLET_SEL_SHFT 32 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER4_CHIPLET_SEL_MASK 0x0000000700000000 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER4_NIBBLE_SEL_SHFT 36 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER5_CHIPLET_SEL */ +/* Description: Nibble 5 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER5_CHIPLET_SEL_SHFT 40 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER5_CHIPLET_SEL_MASK 0x0000070000000000 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER5_NIBBLE_SEL_SHFT 44 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER6_CHIPLET_SEL */ +/* Description: Nibble 6 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER6_CHIPLET_SEL_SHFT 48 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER6_CHIPLET_SEL_MASK 0x0007000000000000 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER6_NIBBLE_SEL_SHFT 52 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER7_CHIPLET_SEL */ +/* Description: Nibble 7 Chiplet select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER7_CHIPLET_SEL_SHFT 56 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER7_CHIPLET_SEL_MASK 0x0700000000000000 + +/* SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER7_NIBBLE_SEL_SHFT 60 +#define SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT_TRIGGER7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_XB_PIPE_COMPARE_0" */ +/* CRBP XB Pipe Compare */ +/* ==================================================================== */ + +#define SH_PI_CRBP_XB_PIPE_COMPARE_0 0x0000000120050800 +#define SH_PI_CRBP_XB_PIPE_COMPARE_0_MASK 0x007fffffffffffff +#define SH_PI_CRBP_XB_PIPE_COMPARE_0_INIT 0x0000000000000000 + +/* SH_PI_CRBP_XB_PIPE_COMPARE_0_COMPARE_ADDRESS */ +/* Description: Address to compare against */ +#define SH_PI_CRBP_XB_PIPE_COMPARE_0_COMPARE_ADDRESS_SHFT 0 +#define SH_PI_CRBP_XB_PIPE_COMPARE_0_COMPARE_ADDRESS_MASK 0x00007fffffffffff + +/* SH_PI_CRBP_XB_PIPE_COMPARE_0_COMPARE_COMMAND */ +/* Description: SN2NET Command to compare against */ +#define SH_PI_CRBP_XB_PIPE_COMPARE_0_COMPARE_COMMAND_SHFT 47 +#define SH_PI_CRBP_XB_PIPE_COMPARE_0_COMPARE_COMMAND_MASK 0x007f800000000000 + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_XB_PIPE_COMPARE_1" */ +/* CRBP XB Pipe Compare */ +/* ==================================================================== */ + +#define SH_PI_CRBP_XB_PIPE_COMPARE_1 0x0000000120050880 +#define SH_PI_CRBP_XB_PIPE_COMPARE_1_MASK 0x000001ff3fff3fff +#define SH_PI_CRBP_XB_PIPE_COMPARE_1_INIT 0x0000000000000000 + +/* SH_PI_CRBP_XB_PIPE_COMPARE_1_COMPARE_SOURCE */ +/* Description: Source to compare against */ +#define SH_PI_CRBP_XB_PIPE_COMPARE_1_COMPARE_SOURCE_SHFT 0 +#define SH_PI_CRBP_XB_PIPE_COMPARE_1_COMPARE_SOURCE_MASK 0x0000000000003fff + +/* SH_PI_CRBP_XB_PIPE_COMPARE_1_COMPARE_SUPPLEMENTAL */ +/* Description: Supplemental to compare against */ +#define SH_PI_CRBP_XB_PIPE_COMPARE_1_COMPARE_SUPPLEMENTAL_SHFT 16 +#define SH_PI_CRBP_XB_PIPE_COMPARE_1_COMPARE_SUPPLEMENTAL_MASK 0x000000003fff0000 + +/* SH_PI_CRBP_XB_PIPE_COMPARE_1_COMPARE_ECHO */ +/* Description: Echo to compare against */ +#define SH_PI_CRBP_XB_PIPE_COMPARE_1_COMPARE_ECHO_SHFT 32 +#define SH_PI_CRBP_XB_PIPE_COMPARE_1_COMPARE_ECHO_MASK 0x000001ff00000000 + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_XB_PIPE_MASK_0" */ +/* CRBP Compare Mask Register 1 */ +/* ==================================================================== */ + +#define SH_PI_CRBP_XB_PIPE_MASK_0 0x0000000120050900 +#define SH_PI_CRBP_XB_PIPE_MASK_0_MASK 0x007fffffffffffff +#define SH_PI_CRBP_XB_PIPE_MASK_0_INIT 0x0000000000000000 + +/* SH_PI_CRBP_XB_PIPE_MASK_0_COMPARE_ADDRESS_MASK */ +/* Description: Address to compare against */ +#define SH_PI_CRBP_XB_PIPE_MASK_0_COMPARE_ADDRESS_MASK_SHFT 0 +#define SH_PI_CRBP_XB_PIPE_MASK_0_COMPARE_ADDRESS_MASK_MASK 0x00007fffffffffff + +/* SH_PI_CRBP_XB_PIPE_MASK_0_COMPARE_COMMAND_MASK */ +/* Description: SN2NET Command to compare against */ +#define SH_PI_CRBP_XB_PIPE_MASK_0_COMPARE_COMMAND_MASK_SHFT 47 +#define SH_PI_CRBP_XB_PIPE_MASK_0_COMPARE_COMMAND_MASK_MASK 0x007f800000000000 + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_XB_PIPE_MASK_1" */ +/* CRBP XB Pipe Compare Mask Register 1 */ +/* ==================================================================== */ + +#define SH_PI_CRBP_XB_PIPE_MASK_1 0x0000000120050980 +#define SH_PI_CRBP_XB_PIPE_MASK_1_MASK 0x000001ff3fff3fff +#define SH_PI_CRBP_XB_PIPE_MASK_1_INIT 0x0000000000000000 + +/* SH_PI_CRBP_XB_PIPE_MASK_1_COMPARE_SOURCE_MASK */ +/* Description: Source to compare against */ +#define SH_PI_CRBP_XB_PIPE_MASK_1_COMPARE_SOURCE_MASK_SHFT 0 +#define SH_PI_CRBP_XB_PIPE_MASK_1_COMPARE_SOURCE_MASK_MASK 0x0000000000003fff + +/* SH_PI_CRBP_XB_PIPE_MASK_1_COMPARE_SUPPLEMENTAL_MASK */ +/* Description: Supplemental to compare against */ +#define SH_PI_CRBP_XB_PIPE_MASK_1_COMPARE_SUPPLEMENTAL_MASK_SHFT 16 +#define SH_PI_CRBP_XB_PIPE_MASK_1_COMPARE_SUPPLEMENTAL_MASK_MASK 0x000000003fff0000 + +/* SH_PI_CRBP_XB_PIPE_MASK_1_COMPARE_ECHO_MASK */ +/* Description: Echo to compare against */ +#define SH_PI_CRBP_XB_PIPE_MASK_1_COMPARE_ECHO_MASK_SHFT 32 +#define SH_PI_CRBP_XB_PIPE_MASK_1_COMPARE_ECHO_MASK_MASK 0x000001ff00000000 + +/* ==================================================================== */ +/* Register "SH_PI_DPC_QUEUE_CONFIG" */ +/* DPC Queue Configuration */ +/* ==================================================================== */ + +#define SH_PI_DPC_QUEUE_CONFIG 0x0000000120050a00 +#define SH_PI_DPC_QUEUE_CONFIG_MASK 0x000000001f1f1f1f +#define SH_PI_DPC_QUEUE_CONFIG_INIT 0x000000000c010c01 + +/* SH_PI_DPC_QUEUE_CONFIG_DWCQ_AE_LEVEL */ +/* Description: DXB WTL Command Queue Almost Empty Level */ +#define SH_PI_DPC_QUEUE_CONFIG_DWCQ_AE_LEVEL_SHFT 0 +#define SH_PI_DPC_QUEUE_CONFIG_DWCQ_AE_LEVEL_MASK 0x000000000000001f + +/* SH_PI_DPC_QUEUE_CONFIG_DWCQ_AF_THRESH */ +/* Description: DXB WTL Command Queue Almost Full Threshold */ +#define SH_PI_DPC_QUEUE_CONFIG_DWCQ_AF_THRESH_SHFT 8 +#define SH_PI_DPC_QUEUE_CONFIG_DWCQ_AF_THRESH_MASK 0x0000000000001f00 + +/* SH_PI_DPC_QUEUE_CONFIG_FWCQ_AE_LEVEL */ +/* Description: FSB WTL Command Queue Almost Empty Level */ +#define SH_PI_DPC_QUEUE_CONFIG_FWCQ_AE_LEVEL_SHFT 16 +#define SH_PI_DPC_QUEUE_CONFIG_FWCQ_AE_LEVEL_MASK 0x00000000001f0000 + +/* SH_PI_DPC_QUEUE_CONFIG_FWCQ_AF_THRESH */ +/* Description: FSB WTL Command Queue Almost Full Threshold */ +#define SH_PI_DPC_QUEUE_CONFIG_FWCQ_AF_THRESH_SHFT 24 +#define SH_PI_DPC_QUEUE_CONFIG_FWCQ_AF_THRESH_MASK 0x000000001f000000 + +/* ==================================================================== */ +/* Register "SH_PI_ERROR_MASK" */ +/* PI Error Mask */ +/* ==================================================================== */ + +#define SH_PI_ERROR_MASK 0x0000000120050a80 +#define SH_PI_ERROR_MASK_MASK 0x00000007ffffffff +#define SH_PI_ERROR_MASK_INIT 0x00000007ffffffff + +/* SH_PI_ERROR_MASK_FSB_PROTO_ERR */ +/* Description: Mask detection of internal protocol table misses */ +#define SH_PI_ERROR_MASK_FSB_PROTO_ERR_SHFT 0 +#define SH_PI_ERROR_MASK_FSB_PROTO_ERR_MASK 0x0000000000000001 + +/* SH_PI_ERROR_MASK_GFX_RP_ERR */ +/* Description: Mask graphic reply error message error detection */ +#define SH_PI_ERROR_MASK_GFX_RP_ERR_SHFT 1 +#define SH_PI_ERROR_MASK_GFX_RP_ERR_MASK 0x0000000000000002 + +/* SH_PI_ERROR_MASK_XB_PROTO_ERR */ +/* Description: Mask detection of external protocol table misses */ +#define SH_PI_ERROR_MASK_XB_PROTO_ERR_SHFT 2 +#define SH_PI_ERROR_MASK_XB_PROTO_ERR_MASK 0x0000000000000004 + +/* SH_PI_ERROR_MASK_MEM_RP_ERR */ +/* Description: Mask memory reply error detection */ +#define SH_PI_ERROR_MASK_MEM_RP_ERR_SHFT 3 +#define SH_PI_ERROR_MASK_MEM_RP_ERR_MASK 0x0000000000000008 + +/* SH_PI_ERROR_MASK_PIO_RP_ERR */ +/* Description: Mask PIO reply error detection */ +#define SH_PI_ERROR_MASK_PIO_RP_ERR_SHFT 4 +#define SH_PI_ERROR_MASK_PIO_RP_ERR_MASK 0x0000000000000010 + +/* SH_PI_ERROR_MASK_MEM_TO_ERR */ +/* Description: Mask CRB time-out errors */ +#define SH_PI_ERROR_MASK_MEM_TO_ERR_SHFT 5 +#define SH_PI_ERROR_MASK_MEM_TO_ERR_MASK 0x0000000000000020 + +/* SH_PI_ERROR_MASK_PIO_TO_ERR */ +/* Description: Mask PIO time-out errors */ +#define SH_PI_ERROR_MASK_PIO_TO_ERR_SHFT 6 +#define SH_PI_ERROR_MASK_PIO_TO_ERR_MASK 0x0000000000000040 + +/* SH_PI_ERROR_MASK_FSB_SHUB_UCE */ +/* Description: Mask un-correctable ECC error detection */ +#define SH_PI_ERROR_MASK_FSB_SHUB_UCE_SHFT 7 +#define SH_PI_ERROR_MASK_FSB_SHUB_UCE_MASK 0x0000000000000080 + +/* SH_PI_ERROR_MASK_FSB_SHUB_CE */ +/* Description: Mask correctable ECC error detection */ +#define SH_PI_ERROR_MASK_FSB_SHUB_CE_SHFT 8 +#define SH_PI_ERROR_MASK_FSB_SHUB_CE_MASK 0x0000000000000100 + +/* SH_PI_ERROR_MASK_MSG_COLOR_ERR */ +/* Description: Mask message color error detection */ +#define SH_PI_ERROR_MASK_MSG_COLOR_ERR_SHFT 9 +#define SH_PI_ERROR_MASK_MSG_COLOR_ERR_MASK 0x0000000000000200 + +/* SH_PI_ERROR_MASK_MD_RQ_Q_OFLOW */ +/* Description: Mask MD Request input buffer over flow error */ +#define SH_PI_ERROR_MASK_MD_RQ_Q_OFLOW_SHFT 10 +#define SH_PI_ERROR_MASK_MD_RQ_Q_OFLOW_MASK 0x0000000000000400 + +/* SH_PI_ERROR_MASK_MD_RP_Q_OFLOW */ +/* Description: Mask MD Reply input buffer over flow error */ +#define SH_PI_ERROR_MASK_MD_RP_Q_OFLOW_SHFT 11 +#define SH_PI_ERROR_MASK_MD_RP_Q_OFLOW_MASK 0x0000000000000800 + +/* SH_PI_ERROR_MASK_XN_RQ_Q_OFLOW */ +/* Description: Mask XN Request input buffer over flow error */ +#define SH_PI_ERROR_MASK_XN_RQ_Q_OFLOW_SHFT 12 +#define SH_PI_ERROR_MASK_XN_RQ_Q_OFLOW_MASK 0x0000000000001000 + +/* SH_PI_ERROR_MASK_XN_RP_Q_OFLOW */ +/* Description: Mask XN Reply input buffer over flow error */ +#define SH_PI_ERROR_MASK_XN_RP_Q_OFLOW_SHFT 13 +#define SH_PI_ERROR_MASK_XN_RP_Q_OFLOW_MASK 0x0000000000002000 + +/* SH_PI_ERROR_MASK_NACK_OFLOW */ +/* Description: Mask NACK over flow error */ +#define SH_PI_ERROR_MASK_NACK_OFLOW_SHFT 14 +#define SH_PI_ERROR_MASK_NACK_OFLOW_MASK 0x0000000000004000 + +/* SH_PI_ERROR_MASK_GFX_INT_0 */ +/* Description: Mask GFX transfer interrupt for CPU 0 */ +#define SH_PI_ERROR_MASK_GFX_INT_0_SHFT 15 +#define SH_PI_ERROR_MASK_GFX_INT_0_MASK 0x0000000000008000 + +/* SH_PI_ERROR_MASK_GFX_INT_1 */ +/* Description: Mask GFX transfer interrupt for CPU 1 */ +#define SH_PI_ERROR_MASK_GFX_INT_1_SHFT 16 +#define SH_PI_ERROR_MASK_GFX_INT_1_MASK 0x0000000000010000 + +/* SH_PI_ERROR_MASK_MD_RQ_CRD_OFLOW */ +/* Description: Mask MD Request Credit Overflow Error */ +#define SH_PI_ERROR_MASK_MD_RQ_CRD_OFLOW_SHFT 17 +#define SH_PI_ERROR_MASK_MD_RQ_CRD_OFLOW_MASK 0x0000000000020000 + +/* SH_PI_ERROR_MASK_MD_RP_CRD_OFLOW */ +/* Description: Mask MD Reply Credit Overflow Error */ +#define SH_PI_ERROR_MASK_MD_RP_CRD_OFLOW_SHFT 18 +#define SH_PI_ERROR_MASK_MD_RP_CRD_OFLOW_MASK 0x0000000000040000 + +/* SH_PI_ERROR_MASK_XN_RQ_CRD_OFLOW */ +/* Description: Mask XN Request Credit Overflow Error */ +#define SH_PI_ERROR_MASK_XN_RQ_CRD_OFLOW_SHFT 19 +#define SH_PI_ERROR_MASK_XN_RQ_CRD_OFLOW_MASK 0x0000000000080000 + +/* SH_PI_ERROR_MASK_XN_RP_CRD_OFLOW */ +/* Description: Mask XN Reply Credit Overflow Error */ +#define SH_PI_ERROR_MASK_XN_RP_CRD_OFLOW_SHFT 20 +#define SH_PI_ERROR_MASK_XN_RP_CRD_OFLOW_MASK 0x0000000000100000 + +/* SH_PI_ERROR_MASK_HUNG_BUS */ +/* Description: Mask FSB hung error */ +#define SH_PI_ERROR_MASK_HUNG_BUS_SHFT 21 +#define SH_PI_ERROR_MASK_HUNG_BUS_MASK 0x0000000000200000 + +/* SH_PI_ERROR_MASK_RSP_PARITY */ +/* Description: Parity error detecte during response phase */ +#define SH_PI_ERROR_MASK_RSP_PARITY_SHFT 22 +#define SH_PI_ERROR_MASK_RSP_PARITY_MASK 0x0000000000400000 + +/* SH_PI_ERROR_MASK_IOQ_OVERRUN */ +/* Description: Over run error detected on IOQ */ +#define SH_PI_ERROR_MASK_IOQ_OVERRUN_SHFT 23 +#define SH_PI_ERROR_MASK_IOQ_OVERRUN_MASK 0x0000000000800000 + +/* SH_PI_ERROR_MASK_REQ_FORMAT */ +/* Description: FSB request format not supported */ +#define SH_PI_ERROR_MASK_REQ_FORMAT_SHFT 24 +#define SH_PI_ERROR_MASK_REQ_FORMAT_MASK 0x0000000001000000 + +/* SH_PI_ERROR_MASK_ADDR_ACCESS */ +/* Description: Access to Address is not supported */ +#define SH_PI_ERROR_MASK_ADDR_ACCESS_SHFT 25 +#define SH_PI_ERROR_MASK_ADDR_ACCESS_MASK 0x0000000002000000 + +/* SH_PI_ERROR_MASK_REQ_PARITY */ +/* Description: Parity error detected during request phase */ +#define SH_PI_ERROR_MASK_REQ_PARITY_SHFT 26 +#define SH_PI_ERROR_MASK_REQ_PARITY_MASK 0x0000000004000000 + +/* SH_PI_ERROR_MASK_ADDR_PARITY */ +/* Description: Parity error detected on address */ +#define SH_PI_ERROR_MASK_ADDR_PARITY_SHFT 27 +#define SH_PI_ERROR_MASK_ADDR_PARITY_MASK 0x0000000008000000 + +/* SH_PI_ERROR_MASK_SHUB_FSB_DQE */ +/* Description: SHUB_FSB_DQE */ +#define SH_PI_ERROR_MASK_SHUB_FSB_DQE_SHFT 28 +#define SH_PI_ERROR_MASK_SHUB_FSB_DQE_MASK 0x0000000010000000 + +/* SH_PI_ERROR_MASK_SHUB_FSB_UCE */ +/* Description: An un-correctable ECC error was detected */ +#define SH_PI_ERROR_MASK_SHUB_FSB_UCE_SHFT 29 +#define SH_PI_ERROR_MASK_SHUB_FSB_UCE_MASK 0x0000000020000000 + +/* SH_PI_ERROR_MASK_SHUB_FSB_CE */ +/* Description: An correctable ECC error was detected */ +#define SH_PI_ERROR_MASK_SHUB_FSB_CE_SHFT 30 +#define SH_PI_ERROR_MASK_SHUB_FSB_CE_MASK 0x0000000040000000 + +/* SH_PI_ERROR_MASK_LIVELOCK */ +/* Description: AFI livelock error was detected */ +#define SH_PI_ERROR_MASK_LIVELOCK_SHFT 31 +#define SH_PI_ERROR_MASK_LIVELOCK_MASK 0x0000000080000000 + +/* SH_PI_ERROR_MASK_BAD_SNOOP */ +/* Description: AFI bad snoop error was detected */ +#define SH_PI_ERROR_MASK_BAD_SNOOP_SHFT 32 +#define SH_PI_ERROR_MASK_BAD_SNOOP_MASK 0x0000000100000000 + +/* SH_PI_ERROR_MASK_FSB_TBL_MISS */ +/* Description: AFI FSB request table miss error was detected */ +#define SH_PI_ERROR_MASK_FSB_TBL_MISS_SHFT 33 +#define SH_PI_ERROR_MASK_FSB_TBL_MISS_MASK 0x0000000200000000 + +/* SH_PI_ERROR_MASK_MSG_LENGTH */ +/* Description: Message length error on received message from SIC */ +#define SH_PI_ERROR_MASK_MSG_LENGTH_SHFT 34 +#define SH_PI_ERROR_MASK_MSG_LENGTH_MASK 0x0000000400000000 + +/* ==================================================================== */ +/* Register "SH_PI_EXPRESS_REPLY_CONFIG" */ +/* PI Express Reply Configuration */ +/* ==================================================================== */ + +#define SH_PI_EXPRESS_REPLY_CONFIG 0x0000000120050b00 +#define SH_PI_EXPRESS_REPLY_CONFIG_MASK 0x0000000000000007 +#define SH_PI_EXPRESS_REPLY_CONFIG_INIT 0x0000000000000001 + +/* SH_PI_EXPRESS_REPLY_CONFIG_MODE */ +/* Description: Express Reply Mode */ +#define SH_PI_EXPRESS_REPLY_CONFIG_MODE_SHFT 0 +#define SH_PI_EXPRESS_REPLY_CONFIG_MODE_MASK 0x0000000000000007 + +/* ==================================================================== */ +/* Register "SH_PI_FSB_COMPARE_VALUE" */ +/* FSB Compare Value */ +/* ==================================================================== */ + +#define SH_PI_FSB_COMPARE_VALUE 0x0000000120050c00 +#define SH_PI_FSB_COMPARE_VALUE_MASK 0xffffffffffffffff +#define SH_PI_FSB_COMPARE_VALUE_INIT 0x0000000000000000 + +/* SH_PI_FSB_COMPARE_VALUE_COMPARE_VALUE */ +/* Description: Compare value */ +#define SH_PI_FSB_COMPARE_VALUE_COMPARE_VALUE_SHFT 0 +#define SH_PI_FSB_COMPARE_VALUE_COMPARE_VALUE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_PI_FSB_COMPARE_MASK" */ +/* FSB Compare Mask */ +/* ==================================================================== */ + +#define SH_PI_FSB_COMPARE_MASK 0x0000000120050b80 +#define SH_PI_FSB_COMPARE_MASK_MASK 0xffffffffffffffff +#define SH_PI_FSB_COMPARE_MASK_INIT 0x0000000000000000 + +/* SH_PI_FSB_COMPARE_MASK_MASK_VALUE */ +/* Description: Mask value */ +#define SH_PI_FSB_COMPARE_MASK_MASK_VALUE_SHFT 0 +#define SH_PI_FSB_COMPARE_MASK_MASK_VALUE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_PI_FSB_ERROR_INJECTION" */ +/* Inject an Error onto the FSB */ +/* ==================================================================== */ + +#define SH_PI_FSB_ERROR_INJECTION 0x0000000120050c80 +#define SH_PI_FSB_ERROR_INJECTION_MASK 0x000000070fff03ff +#define SH_PI_FSB_ERROR_INJECTION_INIT 0x0000000000000000 + +/* SH_PI_FSB_ERROR_INJECTION_RP_PE_TO_FSB */ +/* Description: Inject a RP# Parity Error onto the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_RP_PE_TO_FSB_SHFT 0 +#define SH_PI_FSB_ERROR_INJECTION_RP_PE_TO_FSB_MASK 0x0000000000000001 + +/* SH_PI_FSB_ERROR_INJECTION_AP0_PE_TO_FSB */ +/* Description: Inject an AP[0]# Parity Error onto the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_AP0_PE_TO_FSB_SHFT 1 +#define SH_PI_FSB_ERROR_INJECTION_AP0_PE_TO_FSB_MASK 0x0000000000000002 + +/* SH_PI_FSB_ERROR_INJECTION_AP1_PE_TO_FSB */ +/* Description: Inject an AP[1]# Parity Error onto the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_AP1_PE_TO_FSB_SHFT 2 +#define SH_PI_FSB_ERROR_INJECTION_AP1_PE_TO_FSB_MASK 0x0000000000000004 + +/* SH_PI_FSB_ERROR_INJECTION_RSP_PE_TO_FSB */ +/* Description: Inject a RSP# Parity Error onto the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_RSP_PE_TO_FSB_SHFT 3 +#define SH_PI_FSB_ERROR_INJECTION_RSP_PE_TO_FSB_MASK 0x0000000000000008 + +/* SH_PI_FSB_ERROR_INJECTION_DW0_CE_TO_FSB */ +/* Description: Inject a Correctable Error in Doubleword 0 onto the */ +#define SH_PI_FSB_ERROR_INJECTION_DW0_CE_TO_FSB_SHFT 4 +#define SH_PI_FSB_ERROR_INJECTION_DW0_CE_TO_FSB_MASK 0x0000000000000010 + +/* SH_PI_FSB_ERROR_INJECTION_DW0_UCE_TO_FSB */ +/* Description: Inject an Uncorrectable Error in Doubleword 0 onto */ +/* the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_DW0_UCE_TO_FSB_SHFT 5 +#define SH_PI_FSB_ERROR_INJECTION_DW0_UCE_TO_FSB_MASK 0x0000000000000020 + +/* SH_PI_FSB_ERROR_INJECTION_DW1_CE_TO_FSB */ +/* Description: Inject a Correctable Error in Doubleword 1 onto the */ +#define SH_PI_FSB_ERROR_INJECTION_DW1_CE_TO_FSB_SHFT 6 +#define SH_PI_FSB_ERROR_INJECTION_DW1_CE_TO_FSB_MASK 0x0000000000000040 + +/* SH_PI_FSB_ERROR_INJECTION_DW1_UCE_TO_FSB */ +/* Description: Inject an Uncorrectable Error in Doubleword 1 onto */ +/* the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_DW1_UCE_TO_FSB_SHFT 7 +#define SH_PI_FSB_ERROR_INJECTION_DW1_UCE_TO_FSB_MASK 0x0000000000000080 + +/* SH_PI_FSB_ERROR_INJECTION_IP0_PE_TO_FSB */ +/* Description: Inject an IP[0]# Parity Error onto the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_IP0_PE_TO_FSB_SHFT 8 +#define SH_PI_FSB_ERROR_INJECTION_IP0_PE_TO_FSB_MASK 0x0000000000000100 + +/* SH_PI_FSB_ERROR_INJECTION_IP1_PE_TO_FSB */ +/* Description: Inject an IP[1]# Parity Error onto the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_IP1_PE_TO_FSB_SHFT 9 +#define SH_PI_FSB_ERROR_INJECTION_IP1_PE_TO_FSB_MASK 0x0000000000000200 + +/* SH_PI_FSB_ERROR_INJECTION_RP_PE_FROM_FSB */ +/* Description: Inject a RP# Parity Error When Sampling the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_RP_PE_FROM_FSB_SHFT 16 +#define SH_PI_FSB_ERROR_INJECTION_RP_PE_FROM_FSB_MASK 0x0000000000010000 + +/* SH_PI_FSB_ERROR_INJECTION_AP0_PE_FROM_FSB */ +/* Description: Inject an AP[0]# Parity Error When Sampling the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_AP0_PE_FROM_FSB_SHFT 17 +#define SH_PI_FSB_ERROR_INJECTION_AP0_PE_FROM_FSB_MASK 0x0000000000020000 + +/* SH_PI_FSB_ERROR_INJECTION_AP1_PE_FROM_FSB */ +/* Description: Inject an AP[1]# Parity Error When Sampling the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_AP1_PE_FROM_FSB_SHFT 18 +#define SH_PI_FSB_ERROR_INJECTION_AP1_PE_FROM_FSB_MASK 0x0000000000040000 + +/* SH_PI_FSB_ERROR_INJECTION_RSP_PE_FROM_FSB */ +/* Description: Inject a RSP# Parity Error When Sampling the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_RSP_PE_FROM_FSB_SHFT 19 +#define SH_PI_FSB_ERROR_INJECTION_RSP_PE_FROM_FSB_MASK 0x0000000000080000 + +/* SH_PI_FSB_ERROR_INJECTION_DW0_CE_FROM_FSB */ +/* Description: Inject a Correctable Error in Doubleword 0 of SIC D */ +/* ata Packet 0 */ +#define SH_PI_FSB_ERROR_INJECTION_DW0_CE_FROM_FSB_SHFT 20 +#define SH_PI_FSB_ERROR_INJECTION_DW0_CE_FROM_FSB_MASK 0x0000000000100000 + +/* SH_PI_FSB_ERROR_INJECTION_DW0_UCE_FROM_FSB */ +/* Description: Inject a Uncorrectable Error in Doubleword 0 of SIC */ +/* Data Packet 0 */ +#define SH_PI_FSB_ERROR_INJECTION_DW0_UCE_FROM_FSB_SHFT 21 +#define SH_PI_FSB_ERROR_INJECTION_DW0_UCE_FROM_FSB_MASK 0x0000000000200000 + +/* SH_PI_FSB_ERROR_INJECTION_DW1_CE_FROM_FSB */ +/* Description: Inject a Correctable Error in Doubleword 0 of SIC D */ +/* ata Packet 0 */ +#define SH_PI_FSB_ERROR_INJECTION_DW1_CE_FROM_FSB_SHFT 22 +#define SH_PI_FSB_ERROR_INJECTION_DW1_CE_FROM_FSB_MASK 0x0000000000400000 + +/* SH_PI_FSB_ERROR_INJECTION_DW1_UCE_FROM_FSB */ +/* Description: Inject a Uncorrectable Error in Doubleword 0 of SIC */ +/* Data Packet 0 */ +#define SH_PI_FSB_ERROR_INJECTION_DW1_UCE_FROM_FSB_SHFT 23 +#define SH_PI_FSB_ERROR_INJECTION_DW1_UCE_FROM_FSB_MASK 0x0000000000800000 + +/* SH_PI_FSB_ERROR_INJECTION_DW2_CE_FROM_FSB */ +/* Description: Inject a Correctable Error in Doubleword 0 of SIC D */ +/* ata Packet 0 */ +#define SH_PI_FSB_ERROR_INJECTION_DW2_CE_FROM_FSB_SHFT 24 +#define SH_PI_FSB_ERROR_INJECTION_DW2_CE_FROM_FSB_MASK 0x0000000001000000 + +/* SH_PI_FSB_ERROR_INJECTION_DW2_UCE_FROM_FSB */ +/* Description: Inject a Uncorrectable Error in Doubleword 0 of SIC */ +/* Data Packet 0 */ +#define SH_PI_FSB_ERROR_INJECTION_DW2_UCE_FROM_FSB_SHFT 25 +#define SH_PI_FSB_ERROR_INJECTION_DW2_UCE_FROM_FSB_MASK 0x0000000002000000 + +/* SH_PI_FSB_ERROR_INJECTION_DW3_CE_FROM_FSB */ +/* Description: Inject a Correctable Error in Doubleword 0 of SIC D */ +/* ata Packet 0 */ +#define SH_PI_FSB_ERROR_INJECTION_DW3_CE_FROM_FSB_SHFT 26 +#define SH_PI_FSB_ERROR_INJECTION_DW3_CE_FROM_FSB_MASK 0x0000000004000000 + +/* SH_PI_FSB_ERROR_INJECTION_DW3_UCE_FROM_FSB */ +/* Description: Inject a Uncorrectable Error in Doubleword 0 of SIC */ +/* Data Packet 0 */ +#define SH_PI_FSB_ERROR_INJECTION_DW3_UCE_FROM_FSB_SHFT 27 +#define SH_PI_FSB_ERROR_INJECTION_DW3_UCE_FROM_FSB_MASK 0x0000000008000000 + +/* SH_PI_FSB_ERROR_INJECTION_IOQ_OVERRUN */ +/* Description: Inject an ioq overrun Error on the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_IOQ_OVERRUN_SHFT 32 +#define SH_PI_FSB_ERROR_INJECTION_IOQ_OVERRUN_MASK 0x0000000100000000 + +/* SH_PI_FSB_ERROR_INJECTION_LIVELOCK */ +/* Description: Inject a livelock Error on the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_LIVELOCK_SHFT 33 +#define SH_PI_FSB_ERROR_INJECTION_LIVELOCK_MASK 0x0000000200000000 + +/* SH_PI_FSB_ERROR_INJECTION_BUS_HANG */ +/* Description: Inject an bus hang on the FSB */ +#define SH_PI_FSB_ERROR_INJECTION_BUS_HANG_SHFT 34 +#define SH_PI_FSB_ERROR_INJECTION_BUS_HANG_MASK 0x0000000400000000 + +/* ==================================================================== */ +/* Register "SH_PI_MD2PI_REPLY_VC_CONFIG" */ +/* MD-to-PI Reply Virtual Channel Configuration */ +/* ==================================================================== */ + +#define SH_PI_MD2PI_REPLY_VC_CONFIG 0x0000000120050d00 +#define SH_PI_MD2PI_REPLY_VC_CONFIG_MASK 0xc000000000003fff +#define SH_PI_MD2PI_REPLY_VC_CONFIG_INIT 0x000000000000088c + +/* SH_PI_MD2PI_REPLY_VC_CONFIG_HDR_DEPTH */ +/* Description: Depth of header Buffer */ +#define SH_PI_MD2PI_REPLY_VC_CONFIG_HDR_DEPTH_SHFT 0 +#define SH_PI_MD2PI_REPLY_VC_CONFIG_HDR_DEPTH_MASK 0x000000000000000f + +/* SH_PI_MD2PI_REPLY_VC_CONFIG_DATA_DEPTH */ +/* Description: Number of data buffers Available */ +#define SH_PI_MD2PI_REPLY_VC_CONFIG_DATA_DEPTH_SHFT 4 +#define SH_PI_MD2PI_REPLY_VC_CONFIG_DATA_DEPTH_MASK 0x00000000000000f0 + +/* SH_PI_MD2PI_REPLY_VC_CONFIG_MAX_CREDITS */ +/* Description: Maximum credits from sender */ +#define SH_PI_MD2PI_REPLY_VC_CONFIG_MAX_CREDITS_SHFT 8 +#define SH_PI_MD2PI_REPLY_VC_CONFIG_MAX_CREDITS_MASK 0x0000000000003f00 + +/* SH_PI_MD2PI_REPLY_VC_CONFIG_FORCE_CREDIT */ +/* Description: Send an extra credit to sender */ +#define SH_PI_MD2PI_REPLY_VC_CONFIG_FORCE_CREDIT_SHFT 62 +#define SH_PI_MD2PI_REPLY_VC_CONFIG_FORCE_CREDIT_MASK 0x4000000000000000 + +/* SH_PI_MD2PI_REPLY_VC_CONFIG_CAPTURE_CREDIT_STATUS */ +/* Description: Capture credit and status information */ +#define SH_PI_MD2PI_REPLY_VC_CONFIG_CAPTURE_CREDIT_STATUS_SHFT 63 +#define SH_PI_MD2PI_REPLY_VC_CONFIG_CAPTURE_CREDIT_STATUS_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_MD2PI_REQUEST_VC_CONFIG" */ +/* MD-to-PI Request Virtual Channel Configuration */ +/* ==================================================================== */ + +#define SH_PI_MD2PI_REQUEST_VC_CONFIG 0x0000000120050d80 +#define SH_PI_MD2PI_REQUEST_VC_CONFIG_MASK 0xc000000000003fff +#define SH_PI_MD2PI_REQUEST_VC_CONFIG_INIT 0x000000000000088c + +/* SH_PI_MD2PI_REQUEST_VC_CONFIG_HDR_DEPTH */ +/* Description: Depth of header Buffer */ +#define SH_PI_MD2PI_REQUEST_VC_CONFIG_HDR_DEPTH_SHFT 0 +#define SH_PI_MD2PI_REQUEST_VC_CONFIG_HDR_DEPTH_MASK 0x000000000000000f + +/* SH_PI_MD2PI_REQUEST_VC_CONFIG_DATA_DEPTH */ +/* Description: Number of data buffers Available */ +#define SH_PI_MD2PI_REQUEST_VC_CONFIG_DATA_DEPTH_SHFT 4 +#define SH_PI_MD2PI_REQUEST_VC_CONFIG_DATA_DEPTH_MASK 0x00000000000000f0 + +/* SH_PI_MD2PI_REQUEST_VC_CONFIG_MAX_CREDITS */ +/* Description: Maximum credits from sender */ +#define SH_PI_MD2PI_REQUEST_VC_CONFIG_MAX_CREDITS_SHFT 8 +#define SH_PI_MD2PI_REQUEST_VC_CONFIG_MAX_CREDITS_MASK 0x0000000000003f00 + +/* SH_PI_MD2PI_REQUEST_VC_CONFIG_FORCE_CREDIT */ +/* Description: Send an extra credit to sender */ +#define SH_PI_MD2PI_REQUEST_VC_CONFIG_FORCE_CREDIT_SHFT 62 +#define SH_PI_MD2PI_REQUEST_VC_CONFIG_FORCE_CREDIT_MASK 0x4000000000000000 + +/* SH_PI_MD2PI_REQUEST_VC_CONFIG_CAPTURE_CREDIT_STATUS */ +/* Description: Capture credit and status information */ +#define SH_PI_MD2PI_REQUEST_VC_CONFIG_CAPTURE_CREDIT_STATUS_SHFT 63 +#define SH_PI_MD2PI_REQUEST_VC_CONFIG_CAPTURE_CREDIT_STATUS_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_QUEUE_ERROR_INJECTION" */ +/* PI Queue Error Injection */ +/* ==================================================================== */ + +#define SH_PI_QUEUE_ERROR_INJECTION 0x0000000120050e00 +#define SH_PI_QUEUE_ERROR_INJECTION_MASK 0x00000000000000ff +#define SH_PI_QUEUE_ERROR_INJECTION_INIT 0x0000000000000000 + +/* SH_PI_QUEUE_ERROR_INJECTION_DAT_DFR_Q */ +#define SH_PI_QUEUE_ERROR_INJECTION_DAT_DFR_Q_SHFT 0 +#define SH_PI_QUEUE_ERROR_INJECTION_DAT_DFR_Q_MASK 0x0000000000000001 + +/* SH_PI_QUEUE_ERROR_INJECTION_DXB_WTL_CMND_Q */ +#define SH_PI_QUEUE_ERROR_INJECTION_DXB_WTL_CMND_Q_SHFT 1 +#define SH_PI_QUEUE_ERROR_INJECTION_DXB_WTL_CMND_Q_MASK 0x0000000000000002 + +/* SH_PI_QUEUE_ERROR_INJECTION_FSB_WTL_CMND_Q */ +#define SH_PI_QUEUE_ERROR_INJECTION_FSB_WTL_CMND_Q_SHFT 2 +#define SH_PI_QUEUE_ERROR_INJECTION_FSB_WTL_CMND_Q_MASK 0x0000000000000004 + +/* SH_PI_QUEUE_ERROR_INJECTION_MDPI_RPY_BFR */ +#define SH_PI_QUEUE_ERROR_INJECTION_MDPI_RPY_BFR_SHFT 3 +#define SH_PI_QUEUE_ERROR_INJECTION_MDPI_RPY_BFR_MASK 0x0000000000000008 + +/* SH_PI_QUEUE_ERROR_INJECTION_PTC_INTR */ +#define SH_PI_QUEUE_ERROR_INJECTION_PTC_INTR_SHFT 4 +#define SH_PI_QUEUE_ERROR_INJECTION_PTC_INTR_MASK 0x0000000000000010 + +/* SH_PI_QUEUE_ERROR_INJECTION_RXL_KILL_Q */ +#define SH_PI_QUEUE_ERROR_INJECTION_RXL_KILL_Q_SHFT 5 +#define SH_PI_QUEUE_ERROR_INJECTION_RXL_KILL_Q_MASK 0x0000000000000020 + +/* SH_PI_QUEUE_ERROR_INJECTION_RXL_RDY_Q */ +#define SH_PI_QUEUE_ERROR_INJECTION_RXL_RDY_Q_SHFT 6 +#define SH_PI_QUEUE_ERROR_INJECTION_RXL_RDY_Q_MASK 0x0000000000000040 + +/* SH_PI_QUEUE_ERROR_INJECTION_XNPI_RPY_BFR */ +#define SH_PI_QUEUE_ERROR_INJECTION_XNPI_RPY_BFR_SHFT 7 +#define SH_PI_QUEUE_ERROR_INJECTION_XNPI_RPY_BFR_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_PI_TEST_POINT_COMPARE" */ +/* PI Test Point Compare */ +/* ==================================================================== */ + +#define SH_PI_TEST_POINT_COMPARE 0x0000000120050e80 +#define SH_PI_TEST_POINT_COMPARE_MASK 0xffffffffffffffff +#define SH_PI_TEST_POINT_COMPARE_INIT 0xffffffff00000000 + +/* SH_PI_TEST_POINT_COMPARE_COMPARE_MASK */ +/* Description: Mask to select test point data for trigger generati */ +#define SH_PI_TEST_POINT_COMPARE_COMPARE_MASK_SHFT 0 +#define SH_PI_TEST_POINT_COMPARE_COMPARE_MASK_MASK 0x00000000ffffffff + +/* SH_PI_TEST_POINT_COMPARE_COMPARE_PATTERN */ +/* Description: Pattern of test point data to cause trigger */ +#define SH_PI_TEST_POINT_COMPARE_COMPARE_PATTERN_SHFT 32 +#define SH_PI_TEST_POINT_COMPARE_COMPARE_PATTERN_MASK 0xffffffff00000000 + +/* ==================================================================== */ +/* Register "SH_PI_TEST_POINT_SELECT" */ +/* PI Test Point Select */ +/* ==================================================================== */ + +#define SH_PI_TEST_POINT_SELECT 0x0000000120050f00 +#define SH_PI_TEST_POINT_SELECT_MASK 0xf777777777777777 +#define SH_PI_TEST_POINT_SELECT_INIT 0x0000000000000000 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE0_CHIPLET_SEL */ +/* Description: Nibble 0 data is from Chiplet X */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE0_CHIPLET_SEL_SHFT 0 +#define SH_PI_TEST_POINT_SELECT_NIBBLE0_CHIPLET_SEL_MASK 0x0000000000000007 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble X is routed to Nibble 0 */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE0_NIBBLE_SEL_SHFT 4 +#define SH_PI_TEST_POINT_SELECT_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE1_CHIPLET_SEL */ +/* Description: Nibble 1 data is from Chiplet X */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE1_CHIPLET_SEL_SHFT 8 +#define SH_PI_TEST_POINT_SELECT_NIBBLE1_CHIPLET_SEL_MASK 0x0000000000000700 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble X is routed to Nibble 1 */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE1_NIBBLE_SEL_SHFT 12 +#define SH_PI_TEST_POINT_SELECT_NIBBLE1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE2_CHIPLET_SEL */ +/* Description: Nibble 2 data is from Chiplet X */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE2_CHIPLET_SEL_SHFT 16 +#define SH_PI_TEST_POINT_SELECT_NIBBLE2_CHIPLET_SEL_MASK 0x0000000000070000 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble X is routed to Nibble 2 */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE2_NIBBLE_SEL_SHFT 20 +#define SH_PI_TEST_POINT_SELECT_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE3_CHIPLET_SEL */ +/* Description: Nibble 3 data is from Chiplet X */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE3_CHIPLET_SEL_SHFT 24 +#define SH_PI_TEST_POINT_SELECT_NIBBLE3_CHIPLET_SEL_MASK 0x0000000007000000 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble X is routed to Nibble 3 */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE3_NIBBLE_SEL_SHFT 28 +#define SH_PI_TEST_POINT_SELECT_NIBBLE3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE4_CHIPLET_SEL */ +/* Description: Nibble 4 data is from Chiplet X */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE4_CHIPLET_SEL_SHFT 32 +#define SH_PI_TEST_POINT_SELECT_NIBBLE4_CHIPLET_SEL_MASK 0x0000000700000000 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble X is routed to Nibble 4 */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE4_NIBBLE_SEL_SHFT 36 +#define SH_PI_TEST_POINT_SELECT_NIBBLE4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE5_CHIPLET_SEL */ +/* Description: Nibble 5 data is from Chiplet X */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE5_CHIPLET_SEL_SHFT 40 +#define SH_PI_TEST_POINT_SELECT_NIBBLE5_CHIPLET_SEL_MASK 0x0000070000000000 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble X is routed to Nibble 5 */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE5_NIBBLE_SEL_SHFT 44 +#define SH_PI_TEST_POINT_SELECT_NIBBLE5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE6_CHIPLET_SEL */ +/* Description: Nibble 6 data is from Chiplet X */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE6_CHIPLET_SEL_SHFT 48 +#define SH_PI_TEST_POINT_SELECT_NIBBLE6_CHIPLET_SEL_MASK 0x0007000000000000 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble X is routed to Nibble 6 */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE6_NIBBLE_SEL_SHFT 52 +#define SH_PI_TEST_POINT_SELECT_NIBBLE6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE7_CHIPLET_SEL */ +/* Description: Nibble 7 data is from Chiplet X */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE7_CHIPLET_SEL_SHFT 56 +#define SH_PI_TEST_POINT_SELECT_NIBBLE7_CHIPLET_SEL_MASK 0x0700000000000000 + +/* SH_PI_TEST_POINT_SELECT_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble X is routed to Nibble 7 */ +#define SH_PI_TEST_POINT_SELECT_NIBBLE7_NIBBLE_SEL_SHFT 60 +#define SH_PI_TEST_POINT_SELECT_NIBBLE7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* SH_PI_TEST_POINT_SELECT_TRIGGER_ENABLE */ +/* Description: Enable trigger on bit 32 of Analyzer data */ +#define SH_PI_TEST_POINT_SELECT_TRIGGER_ENABLE_SHFT 63 +#define SH_PI_TEST_POINT_SELECT_TRIGGER_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_TEST_POINT_TRIGGER_SELECT" */ +/* PI Test Point Trigger Select */ +/* ==================================================================== */ + +#define SH_PI_TEST_POINT_TRIGGER_SELECT 0x0000000120050f80 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_MASK 0x7777777777777777 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_INIT 0x0000000000000000 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER0_CHIPLET_SEL */ +/* Description: Nibble 0 Chiplet select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER0_CHIPLET_SEL_SHFT 0 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER0_CHIPLET_SEL_MASK 0x0000000000000007 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER0_NIBBLE_SEL_SHFT 4 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER1_CHIPLET_SEL */ +/* Description: Nibble 1 Chiplet select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER1_CHIPLET_SEL_SHFT 8 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER1_CHIPLET_SEL_MASK 0x0000000000000700 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER1_NIBBLE_SEL_SHFT 12 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER2_CHIPLET_SEL */ +/* Description: Nibble 2 Chiplet select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER2_CHIPLET_SEL_SHFT 16 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER2_CHIPLET_SEL_MASK 0x0000000000070000 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER2_NIBBLE_SEL_SHFT 20 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER3_CHIPLET_SEL */ +/* Description: Nibble 3 Chiplet select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER3_CHIPLET_SEL_SHFT 24 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER3_CHIPLET_SEL_MASK 0x0000000007000000 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER3_NIBBLE_SEL_SHFT 28 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER4_CHIPLET_SEL */ +/* Description: Nibble 4 Chiplet select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER4_CHIPLET_SEL_SHFT 32 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER4_CHIPLET_SEL_MASK 0x0000000700000000 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER4_NIBBLE_SEL_SHFT 36 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER5_CHIPLET_SEL */ +/* Description: Nibble 5 Chiplet select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER5_CHIPLET_SEL_SHFT 40 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER5_CHIPLET_SEL_MASK 0x0000070000000000 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER5_NIBBLE_SEL_SHFT 44 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER6_CHIPLET_SEL */ +/* Description: Nibble 6 Chiplet select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER6_CHIPLET_SEL_SHFT 48 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER6_CHIPLET_SEL_MASK 0x0007000000000000 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER6_NIBBLE_SEL_SHFT 52 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER7_CHIPLET_SEL */ +/* Description: Nibble 7 Chiplet select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER7_CHIPLET_SEL_SHFT 56 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER7_CHIPLET_SEL_MASK 0x0700000000000000 + +/* SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER7_NIBBLE_SEL_SHFT 60 +#define SH_PI_TEST_POINT_TRIGGER_SELECT_TRIGGER7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_XN2PI_REPLY_VC_CONFIG" */ +/* XN-to-PI Reply Virtual Channel Configuration */ +/* ==================================================================== */ + +#define SH_PI_XN2PI_REPLY_VC_CONFIG 0x0000000120051000 +#define SH_PI_XN2PI_REPLY_VC_CONFIG_MASK 0xc000000000003fff +#define SH_PI_XN2PI_REPLY_VC_CONFIG_INIT 0x000000000000068c + +/* SH_PI_XN2PI_REPLY_VC_CONFIG_HDR_DEPTH */ +/* Description: Depth of header Buffer */ +#define SH_PI_XN2PI_REPLY_VC_CONFIG_HDR_DEPTH_SHFT 0 +#define SH_PI_XN2PI_REPLY_VC_CONFIG_HDR_DEPTH_MASK 0x000000000000000f + +/* SH_PI_XN2PI_REPLY_VC_CONFIG_DATA_DEPTH */ +/* Description: Number of data buffers Available */ +#define SH_PI_XN2PI_REPLY_VC_CONFIG_DATA_DEPTH_SHFT 4 +#define SH_PI_XN2PI_REPLY_VC_CONFIG_DATA_DEPTH_MASK 0x00000000000000f0 + +/* SH_PI_XN2PI_REPLY_VC_CONFIG_MAX_CREDITS */ +/* Description: Maximum credits from sender */ +#define SH_PI_XN2PI_REPLY_VC_CONFIG_MAX_CREDITS_SHFT 8 +#define SH_PI_XN2PI_REPLY_VC_CONFIG_MAX_CREDITS_MASK 0x0000000000003f00 + +/* SH_PI_XN2PI_REPLY_VC_CONFIG_FORCE_CREDIT */ +/* Description: Send an extra credit to sender */ +#define SH_PI_XN2PI_REPLY_VC_CONFIG_FORCE_CREDIT_SHFT 62 +#define SH_PI_XN2PI_REPLY_VC_CONFIG_FORCE_CREDIT_MASK 0x4000000000000000 + +/* SH_PI_XN2PI_REPLY_VC_CONFIG_CAPTURE_CREDIT_STATUS */ +/* Description: Capture credit and status information */ +#define SH_PI_XN2PI_REPLY_VC_CONFIG_CAPTURE_CREDIT_STATUS_SHFT 63 +#define SH_PI_XN2PI_REPLY_VC_CONFIG_CAPTURE_CREDIT_STATUS_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_XN2PI_REQUEST_VC_CONFIG" */ +/* XN-to-PI Request Virtual Channel Configuration */ +/* ==================================================================== */ + +#define SH_PI_XN2PI_REQUEST_VC_CONFIG 0x0000000120051080 +#define SH_PI_XN2PI_REQUEST_VC_CONFIG_MASK 0xc000000000003fff +#define SH_PI_XN2PI_REQUEST_VC_CONFIG_INIT 0x000000000000068c + +/* SH_PI_XN2PI_REQUEST_VC_CONFIG_HDR_DEPTH */ +/* Description: Depth of header Buffer */ +#define SH_PI_XN2PI_REQUEST_VC_CONFIG_HDR_DEPTH_SHFT 0 +#define SH_PI_XN2PI_REQUEST_VC_CONFIG_HDR_DEPTH_MASK 0x000000000000000f + +/* SH_PI_XN2PI_REQUEST_VC_CONFIG_DATA_DEPTH */ +/* Description: Number of data buffers Available */ +#define SH_PI_XN2PI_REQUEST_VC_CONFIG_DATA_DEPTH_SHFT 4 +#define SH_PI_XN2PI_REQUEST_VC_CONFIG_DATA_DEPTH_MASK 0x00000000000000f0 + +/* SH_PI_XN2PI_REQUEST_VC_CONFIG_MAX_CREDITS */ +/* Description: Maximum credits from sender */ +#define SH_PI_XN2PI_REQUEST_VC_CONFIG_MAX_CREDITS_SHFT 8 +#define SH_PI_XN2PI_REQUEST_VC_CONFIG_MAX_CREDITS_MASK 0x0000000000003f00 + +/* SH_PI_XN2PI_REQUEST_VC_CONFIG_FORCE_CREDIT */ +/* Description: Send an extra credit to sender */ +#define SH_PI_XN2PI_REQUEST_VC_CONFIG_FORCE_CREDIT_SHFT 62 +#define SH_PI_XN2PI_REQUEST_VC_CONFIG_FORCE_CREDIT_MASK 0x4000000000000000 + +/* SH_PI_XN2PI_REQUEST_VC_CONFIG_CAPTURE_CREDIT_STATUS */ +/* Description: Capture credit and status information */ +#define SH_PI_XN2PI_REQUEST_VC_CONFIG_CAPTURE_CREDIT_STATUS_SHFT 63 +#define SH_PI_XN2PI_REQUEST_VC_CONFIG_CAPTURE_CREDIT_STATUS_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_AEC_STATUS" */ +/* PI Adaptive Error Correction Status */ +/* ==================================================================== */ + +#define SH_PI_AEC_STATUS 0x0000000120060000 +#define SH_PI_AEC_STATUS_MASK 0x0000000000000007 +#define SH_PI_AEC_STATUS_INIT 0x0000000000000000 + +/* SH_PI_AEC_STATUS_STATE */ +/* Description: AEC State */ +#define SH_PI_AEC_STATUS_STATE_SHFT 0 +#define SH_PI_AEC_STATUS_STATE_MASK 0x0000000000000007 + +/* ==================================================================== */ +/* Register "SH_PI_AFI_FIRST_ERROR" */ +/* PI AFI First Error */ +/* ==================================================================== */ + +#define SH_PI_AFI_FIRST_ERROR 0x0000000120060080 +#define SH_PI_AFI_FIRST_ERROR_MASK 0x00000007ffe00180 +#define SH_PI_AFI_FIRST_ERROR_INIT 0x0000000000000000 + +/* SH_PI_AFI_FIRST_ERROR_FSB_SHUB_UCE */ +/* Description: An un-correctable ECC error was detected */ +#define SH_PI_AFI_FIRST_ERROR_FSB_SHUB_UCE_SHFT 7 +#define SH_PI_AFI_FIRST_ERROR_FSB_SHUB_UCE_MASK 0x0000000000000080 + +/* SH_PI_AFI_FIRST_ERROR_FSB_SHUB_CE */ +/* Description: A correctable ECC error was detected */ +#define SH_PI_AFI_FIRST_ERROR_FSB_SHUB_CE_SHFT 8 +#define SH_PI_AFI_FIRST_ERROR_FSB_SHUB_CE_MASK 0x0000000000000100 + +/* SH_PI_AFI_FIRST_ERROR_HUNG_BUS */ +/* Description: FSB is hung */ +#define SH_PI_AFI_FIRST_ERROR_HUNG_BUS_SHFT 21 +#define SH_PI_AFI_FIRST_ERROR_HUNG_BUS_MASK 0x0000000000200000 + +/* SH_PI_AFI_FIRST_ERROR_RSP_PARITY */ +/* Description: Parity error detecte during response phase */ +#define SH_PI_AFI_FIRST_ERROR_RSP_PARITY_SHFT 22 +#define SH_PI_AFI_FIRST_ERROR_RSP_PARITY_MASK 0x0000000000400000 + +/* SH_PI_AFI_FIRST_ERROR_IOQ_OVERRUN */ +/* Description: Over run error detected on IOQ */ +#define SH_PI_AFI_FIRST_ERROR_IOQ_OVERRUN_SHFT 23 +#define SH_PI_AFI_FIRST_ERROR_IOQ_OVERRUN_MASK 0x0000000000800000 + +/* SH_PI_AFI_FIRST_ERROR_REQ_FORMAT */ +/* Description: FSB request format not supported */ +#define SH_PI_AFI_FIRST_ERROR_REQ_FORMAT_SHFT 24 +#define SH_PI_AFI_FIRST_ERROR_REQ_FORMAT_MASK 0x0000000001000000 + +/* SH_PI_AFI_FIRST_ERROR_ADDR_ACCESS */ +/* Description: Access to Address is not supported */ +#define SH_PI_AFI_FIRST_ERROR_ADDR_ACCESS_SHFT 25 +#define SH_PI_AFI_FIRST_ERROR_ADDR_ACCESS_MASK 0x0000000002000000 + +/* SH_PI_AFI_FIRST_ERROR_REQ_PARITY */ +/* Description: Parity error detected during request phase */ +#define SH_PI_AFI_FIRST_ERROR_REQ_PARITY_SHFT 26 +#define SH_PI_AFI_FIRST_ERROR_REQ_PARITY_MASK 0x0000000004000000 + +/* SH_PI_AFI_FIRST_ERROR_ADDR_PARITY */ +/* Description: Parity error detected on address */ +#define SH_PI_AFI_FIRST_ERROR_ADDR_PARITY_SHFT 27 +#define SH_PI_AFI_FIRST_ERROR_ADDR_PARITY_MASK 0x0000000008000000 + +/* SH_PI_AFI_FIRST_ERROR_SHUB_FSB_DQE */ +/* Description: SHUB_FSB_DQE */ +#define SH_PI_AFI_FIRST_ERROR_SHUB_FSB_DQE_SHFT 28 +#define SH_PI_AFI_FIRST_ERROR_SHUB_FSB_DQE_MASK 0x0000000010000000 + +/* SH_PI_AFI_FIRST_ERROR_SHUB_FSB_UCE */ +/* Description: An un-correctable ECC error was detected */ +#define SH_PI_AFI_FIRST_ERROR_SHUB_FSB_UCE_SHFT 29 +#define SH_PI_AFI_FIRST_ERROR_SHUB_FSB_UCE_MASK 0x0000000020000000 + +/* SH_PI_AFI_FIRST_ERROR_SHUB_FSB_CE */ +/* Description: An correctable ECC error was detected */ +#define SH_PI_AFI_FIRST_ERROR_SHUB_FSB_CE_SHFT 30 +#define SH_PI_AFI_FIRST_ERROR_SHUB_FSB_CE_MASK 0x0000000040000000 + +/* SH_PI_AFI_FIRST_ERROR_LIVELOCK */ +/* Description: AFI livelock error was detected */ +#define SH_PI_AFI_FIRST_ERROR_LIVELOCK_SHFT 31 +#define SH_PI_AFI_FIRST_ERROR_LIVELOCK_MASK 0x0000000080000000 + +/* SH_PI_AFI_FIRST_ERROR_BAD_SNOOP */ +/* Description: AFI bad snoop error was detected */ +#define SH_PI_AFI_FIRST_ERROR_BAD_SNOOP_SHFT 32 +#define SH_PI_AFI_FIRST_ERROR_BAD_SNOOP_MASK 0x0000000100000000 + +/* SH_PI_AFI_FIRST_ERROR_FSB_TBL_MISS */ +/* Description: AFI FSB request table miss error was detected */ +#define SH_PI_AFI_FIRST_ERROR_FSB_TBL_MISS_SHFT 33 +#define SH_PI_AFI_FIRST_ERROR_FSB_TBL_MISS_MASK 0x0000000200000000 + +/* SH_PI_AFI_FIRST_ERROR_MSG_LEN */ +/* Description: Runt or Obese message received from SIC */ +#define SH_PI_AFI_FIRST_ERROR_MSG_LEN_SHFT 34 +#define SH_PI_AFI_FIRST_ERROR_MSG_LEN_MASK 0x0000000400000000 + +/* ==================================================================== */ +/* Register "SH_PI_CAM_ADDRESS_READ_DATA" */ +/* CRB CAM MMR Address Read Data */ +/* ==================================================================== */ + +#define SH_PI_CAM_ADDRESS_READ_DATA 0x0000000120060100 +#define SH_PI_CAM_ADDRESS_READ_DATA_MASK 0x8000ffffffffffff +#define SH_PI_CAM_ADDRESS_READ_DATA_INIT 0x0000000000000000 + +/* SH_PI_CAM_ADDRESS_READ_DATA_CAM_ADDR */ +/* Description: CRB CAM Address Read Data. */ +#define SH_PI_CAM_ADDRESS_READ_DATA_CAM_ADDR_SHFT 0 +#define SH_PI_CAM_ADDRESS_READ_DATA_CAM_ADDR_MASK 0x0000ffffffffffff + +/* SH_PI_CAM_ADDRESS_READ_DATA_CAM_ADDR_VAL */ +/* Description: CRB CAM Address Read Data Valid. */ +#define SH_PI_CAM_ADDRESS_READ_DATA_CAM_ADDR_VAL_SHFT 63 +#define SH_PI_CAM_ADDRESS_READ_DATA_CAM_ADDR_VAL_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_CAM_LPRA_READ_DATA" */ +/* CRB CAM MMR LPRA Read Data */ +/* ==================================================================== */ + +#define SH_PI_CAM_LPRA_READ_DATA 0x0000000120060180 +#define SH_PI_CAM_LPRA_READ_DATA_MASK 0xffffffffffffffff +#define SH_PI_CAM_LPRA_READ_DATA_INIT 0x0000000000000000 + +/* SH_PI_CAM_LPRA_READ_DATA_CAM_LPRA */ +/* Description: CRB CAM LPRA read data. */ +#define SH_PI_CAM_LPRA_READ_DATA_CAM_LPRA_SHFT 0 +#define SH_PI_CAM_LPRA_READ_DATA_CAM_LPRA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_PI_CAM_STATE_READ_DATA" */ +/* CRB CAM MMR State Read Data */ +/* ==================================================================== */ + +#define SH_PI_CAM_STATE_READ_DATA 0x0000000120060200 +#define SH_PI_CAM_STATE_READ_DATA_MASK 0x8003ffff0000003f +#define SH_PI_CAM_STATE_READ_DATA_INIT 0x0000000000000000 + +/* SH_PI_CAM_STATE_READ_DATA_CAM_STATE */ +/* Description: CRB CAM State read data. */ +#define SH_PI_CAM_STATE_READ_DATA_CAM_STATE_SHFT 0 +#define SH_PI_CAM_STATE_READ_DATA_CAM_STATE_MASK 0x000000000000000f + +/* SH_PI_CAM_STATE_READ_DATA_CAM_TO */ +/* Description: CRB CAM Time-out Status. */ +#define SH_PI_CAM_STATE_READ_DATA_CAM_TO_SHFT 4 +#define SH_PI_CAM_STATE_READ_DATA_CAM_TO_MASK 0x0000000000000010 + +/* SH_PI_CAM_STATE_READ_DATA_CAM_STATE_RD_PEND */ +/* Description: CRB CAM State Read Pending. */ +#define SH_PI_CAM_STATE_READ_DATA_CAM_STATE_RD_PEND_SHFT 5 +#define SH_PI_CAM_STATE_READ_DATA_CAM_STATE_RD_PEND_MASK 0x0000000000000020 + +/* SH_PI_CAM_STATE_READ_DATA_CAM_LPRA */ +/* Description: CRB LPRA Overflow Data. */ +#define SH_PI_CAM_STATE_READ_DATA_CAM_LPRA_SHFT 32 +#define SH_PI_CAM_STATE_READ_DATA_CAM_LPRA_MASK 0x0003ffff00000000 + +/* SH_PI_CAM_STATE_READ_DATA_CAM_RD_DATA_VAL */ +/* Description: CRB CAM MMR read data is valid. */ +#define SH_PI_CAM_STATE_READ_DATA_CAM_RD_DATA_VAL_SHFT 63 +#define SH_PI_CAM_STATE_READ_DATA_CAM_RD_DATA_VAL_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_CORRECTED_DETAIL_1" */ +/* PI Corrected Error Detail */ +/* ==================================================================== */ + +#define SH_PI_CORRECTED_DETAIL_1 0x0000000120060280 +#define SH_PI_CORRECTED_DETAIL_1_MASK 0xffffffffffffffff +#define SH_PI_CORRECTED_DETAIL_1_INIT 0x0000000000000000 + +/* SH_PI_CORRECTED_DETAIL_1_ADDRESS */ +/* Description: Address of Message that logged Correctable Error */ +#define SH_PI_CORRECTED_DETAIL_1_ADDRESS_SHFT 0 +#define SH_PI_CORRECTED_DETAIL_1_ADDRESS_MASK 0x0000ffffffffffff + +/* SH_PI_CORRECTED_DETAIL_1_SYNDROME */ +/* Description: Syndrome for double word data with Correctable Erro */ +#define SH_PI_CORRECTED_DETAIL_1_SYNDROME_SHFT 48 +#define SH_PI_CORRECTED_DETAIL_1_SYNDROME_MASK 0x00ff000000000000 + +/* SH_PI_CORRECTED_DETAIL_1_DEP */ +/* Description: DEP code for Double word in error */ +#define SH_PI_CORRECTED_DETAIL_1_DEP_SHFT 56 +#define SH_PI_CORRECTED_DETAIL_1_DEP_MASK 0xff00000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_CORRECTED_DETAIL_2" */ +/* PI Corrected Error Detail 2 */ +/* ==================================================================== */ + +#define SH_PI_CORRECTED_DETAIL_2 0x0000000120060300 +#define SH_PI_CORRECTED_DETAIL_2_MASK 0xffffffffffffffff +#define SH_PI_CORRECTED_DETAIL_2_INIT 0x0000000000000000 + +/* SH_PI_CORRECTED_DETAIL_2_DATA */ +/* Description: Double word data in error */ +#define SH_PI_CORRECTED_DETAIL_2_DATA_SHFT 0 +#define SH_PI_CORRECTED_DETAIL_2_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_PI_CORRECTED_DETAIL_3" */ +/* PI Corrected Error Detail 3 */ +/* ==================================================================== */ + +#define SH_PI_CORRECTED_DETAIL_3 0x0000000120060380 +#define SH_PI_CORRECTED_DETAIL_3_MASK 0xffffffffffffffff +#define SH_PI_CORRECTED_DETAIL_3_INIT 0x0000000000000000 + +/* SH_PI_CORRECTED_DETAIL_3_ADDRESS */ +/* Description: Address of Message that logged Correctable Error */ +#define SH_PI_CORRECTED_DETAIL_3_ADDRESS_SHFT 0 +#define SH_PI_CORRECTED_DETAIL_3_ADDRESS_MASK 0x0000ffffffffffff + +/* SH_PI_CORRECTED_DETAIL_3_SYNDROME */ +/* Description: Syndrome for double word data with Correctable Erro */ +#define SH_PI_CORRECTED_DETAIL_3_SYNDROME_SHFT 48 +#define SH_PI_CORRECTED_DETAIL_3_SYNDROME_MASK 0x00ff000000000000 + +/* SH_PI_CORRECTED_DETAIL_3_DEP */ +/* Description: DEP code for Double word in error */ +#define SH_PI_CORRECTED_DETAIL_3_DEP_SHFT 56 +#define SH_PI_CORRECTED_DETAIL_3_DEP_MASK 0xff00000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_CORRECTED_DETAIL_4" */ +/* PI Corrected Error Detail 4 */ +/* ==================================================================== */ + +#define SH_PI_CORRECTED_DETAIL_4 0x0000000120060400 +#define SH_PI_CORRECTED_DETAIL_4_MASK 0xffffffffffffffff +#define SH_PI_CORRECTED_DETAIL_4_INIT 0x0000000000000000 + +/* SH_PI_CORRECTED_DETAIL_4_DATA */ +/* Description: Double word data in error */ +#define SH_PI_CORRECTED_DETAIL_4_DATA_SHFT 0 +#define SH_PI_CORRECTED_DETAIL_4_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_FIRST_ERROR" */ +/* PI CRBP First Error */ +/* ==================================================================== */ + +#define SH_PI_CRBP_FIRST_ERROR 0x0000000120060480 +#define SH_PI_CRBP_FIRST_ERROR_MASK 0x00000000001fffff +#define SH_PI_CRBP_FIRST_ERROR_INIT 0x0000000000000000 + +/* SH_PI_CRBP_FIRST_ERROR_FSB_PROTO_ERR */ +/* Description: CRB's FSB pipe detected protocol table miss */ +#define SH_PI_CRBP_FIRST_ERROR_FSB_PROTO_ERR_SHFT 0 +#define SH_PI_CRBP_FIRST_ERROR_FSB_PROTO_ERR_MASK 0x0000000000000001 + +/* SH_PI_CRBP_FIRST_ERROR_GFX_RP_ERR */ +/* Description: CRB's XB pipe received a GFX error reply */ +#define SH_PI_CRBP_FIRST_ERROR_GFX_RP_ERR_SHFT 1 +#define SH_PI_CRBP_FIRST_ERROR_GFX_RP_ERR_MASK 0x0000000000000002 + +/* SH_PI_CRBP_FIRST_ERROR_XB_PROTO_ERR */ +/* Description: CRB's XB pipe detected protocol table miss */ +#define SH_PI_CRBP_FIRST_ERROR_XB_PROTO_ERR_SHFT 2 +#define SH_PI_CRBP_FIRST_ERROR_XB_PROTO_ERR_MASK 0x0000000000000004 + +/* SH_PI_CRBP_FIRST_ERROR_MEM_RP_ERR */ +/* Description: CRB's XB pipe received a memory error reply message */ +#define SH_PI_CRBP_FIRST_ERROR_MEM_RP_ERR_SHFT 3 +#define SH_PI_CRBP_FIRST_ERROR_MEM_RP_ERR_MASK 0x0000000000000008 + +/* SH_PI_CRBP_FIRST_ERROR_PIO_RP_ERR */ +/* Description: CRB's XB pipe received a PIO error reply message */ +#define SH_PI_CRBP_FIRST_ERROR_PIO_RP_ERR_SHFT 4 +#define SH_PI_CRBP_FIRST_ERROR_PIO_RP_ERR_MASK 0x0000000000000010 + +/* SH_PI_CRBP_FIRST_ERROR_MEM_TO_ERR */ +/* Description: CRB's XB pipe detected a CRB time-out */ +#define SH_PI_CRBP_FIRST_ERROR_MEM_TO_ERR_SHFT 5 +#define SH_PI_CRBP_FIRST_ERROR_MEM_TO_ERR_MASK 0x0000000000000020 + +/* SH_PI_CRBP_FIRST_ERROR_PIO_TO_ERR */ +/* Description: CRB's XB pipe detected a PIO time-out */ +#define SH_PI_CRBP_FIRST_ERROR_PIO_TO_ERR_SHFT 6 +#define SH_PI_CRBP_FIRST_ERROR_PIO_TO_ERR_MASK 0x0000000000000040 + +/* SH_PI_CRBP_FIRST_ERROR_FSB_SHUB_UCE */ +/* Description: An un-correctable ECC error was detected */ +#define SH_PI_CRBP_FIRST_ERROR_FSB_SHUB_UCE_SHFT 7 +#define SH_PI_CRBP_FIRST_ERROR_FSB_SHUB_UCE_MASK 0x0000000000000080 + +/* SH_PI_CRBP_FIRST_ERROR_FSB_SHUB_CE */ +/* Description: A correctable ECC error was detected */ +#define SH_PI_CRBP_FIRST_ERROR_FSB_SHUB_CE_SHFT 8 +#define SH_PI_CRBP_FIRST_ERROR_FSB_SHUB_CE_MASK 0x0000000000000100 + +/* SH_PI_CRBP_FIRST_ERROR_MSG_COLOR_ERR */ +/* Description: Message color was wrong */ +#define SH_PI_CRBP_FIRST_ERROR_MSG_COLOR_ERR_SHFT 9 +#define SH_PI_CRBP_FIRST_ERROR_MSG_COLOR_ERR_MASK 0x0000000000000200 + +/* SH_PI_CRBP_FIRST_ERROR_MD_RQ_Q_OFLOW */ +/* Description: MD Request input buffer over flow error */ +#define SH_PI_CRBP_FIRST_ERROR_MD_RQ_Q_OFLOW_SHFT 10 +#define SH_PI_CRBP_FIRST_ERROR_MD_RQ_Q_OFLOW_MASK 0x0000000000000400 + +/* SH_PI_CRBP_FIRST_ERROR_MD_RP_Q_OFLOW */ +/* Description: MD Reply input buffer over flow error */ +#define SH_PI_CRBP_FIRST_ERROR_MD_RP_Q_OFLOW_SHFT 11 +#define SH_PI_CRBP_FIRST_ERROR_MD_RP_Q_OFLOW_MASK 0x0000000000000800 + +/* SH_PI_CRBP_FIRST_ERROR_XN_RQ_Q_OFLOW */ +/* Description: XN Request input buffer over flow error */ +#define SH_PI_CRBP_FIRST_ERROR_XN_RQ_Q_OFLOW_SHFT 12 +#define SH_PI_CRBP_FIRST_ERROR_XN_RQ_Q_OFLOW_MASK 0x0000000000001000 + +/* SH_PI_CRBP_FIRST_ERROR_XN_RP_Q_OFLOW */ +/* Description: XN Reply input buffer over flow error */ +#define SH_PI_CRBP_FIRST_ERROR_XN_RP_Q_OFLOW_SHFT 13 +#define SH_PI_CRBP_FIRST_ERROR_XN_RP_Q_OFLOW_MASK 0x0000000000002000 + +/* SH_PI_CRBP_FIRST_ERROR_NACK_OFLOW */ +/* Description: NACK over flow error */ +#define SH_PI_CRBP_FIRST_ERROR_NACK_OFLOW_SHFT 14 +#define SH_PI_CRBP_FIRST_ERROR_NACK_OFLOW_MASK 0x0000000000004000 + +/* SH_PI_CRBP_FIRST_ERROR_GFX_INT_0 */ +/* Description: GFX transfer interrupt for CPU 0 */ +#define SH_PI_CRBP_FIRST_ERROR_GFX_INT_0_SHFT 15 +#define SH_PI_CRBP_FIRST_ERROR_GFX_INT_0_MASK 0x0000000000008000 + +/* SH_PI_CRBP_FIRST_ERROR_GFX_INT_1 */ +/* Description: GFX transfer interrupt for CPU 1 */ +#define SH_PI_CRBP_FIRST_ERROR_GFX_INT_1_SHFT 16 +#define SH_PI_CRBP_FIRST_ERROR_GFX_INT_1_MASK 0x0000000000010000 + +/* SH_PI_CRBP_FIRST_ERROR_MD_RQ_CRD_OFLOW */ +/* Description: MD Request Credit Overflow Error */ +#define SH_PI_CRBP_FIRST_ERROR_MD_RQ_CRD_OFLOW_SHFT 17 +#define SH_PI_CRBP_FIRST_ERROR_MD_RQ_CRD_OFLOW_MASK 0x0000000000020000 + +/* SH_PI_CRBP_FIRST_ERROR_MD_RP_CRD_OFLOW */ +/* Description: MD Reply Credit Overflow Error */ +#define SH_PI_CRBP_FIRST_ERROR_MD_RP_CRD_OFLOW_SHFT 18 +#define SH_PI_CRBP_FIRST_ERROR_MD_RP_CRD_OFLOW_MASK 0x0000000000040000 + +/* SH_PI_CRBP_FIRST_ERROR_XN_RQ_CRD_OFLOW */ +/* Description: XN Request Credit Overflow Error */ +#define SH_PI_CRBP_FIRST_ERROR_XN_RQ_CRD_OFLOW_SHFT 19 +#define SH_PI_CRBP_FIRST_ERROR_XN_RQ_CRD_OFLOW_MASK 0x0000000000080000 + +/* SH_PI_CRBP_FIRST_ERROR_XN_RP_CRD_OFLOW */ +/* Description: XN Reply Credit Overflow Error */ +#define SH_PI_CRBP_FIRST_ERROR_XN_RP_CRD_OFLOW_SHFT 20 +#define SH_PI_CRBP_FIRST_ERROR_XN_RP_CRD_OFLOW_MASK 0x0000000000100000 + +/* ==================================================================== */ +/* Register "SH_PI_ERROR_DETAIL_1" */ +/* PI Error Detail 1 */ +/* ==================================================================== */ + +#define SH_PI_ERROR_DETAIL_1 0x0000000120060500 +#define SH_PI_ERROR_DETAIL_1_MASK 0xffffffffffffffff +#define SH_PI_ERROR_DETAIL_1_INIT 0x0000000000000000 + +/* SH_PI_ERROR_DETAIL_1_STATUS */ +/* Description: Error Detail 1 */ +#define SH_PI_ERROR_DETAIL_1_STATUS_SHFT 0 +#define SH_PI_ERROR_DETAIL_1_STATUS_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_PI_ERROR_DETAIL_2" */ +/* PI Error Detail 2 */ +/* ==================================================================== */ + +#define SH_PI_ERROR_DETAIL_2 0x0000000120060580 +#define SH_PI_ERROR_DETAIL_2_MASK 0xffffffffffffffff +#define SH_PI_ERROR_DETAIL_2_INIT 0x0000000000000000 + +/* SH_PI_ERROR_DETAIL_2_STATUS */ +/* Description: Error Status */ +#define SH_PI_ERROR_DETAIL_2_STATUS_SHFT 0 +#define SH_PI_ERROR_DETAIL_2_STATUS_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_PI_ERROR_OVERFLOW" */ +/* PI Error Overflow */ +/* ==================================================================== */ + +#define SH_PI_ERROR_OVERFLOW 0x0000000120060600 +#define SH_PI_ERROR_OVERFLOW_MASK 0x00000007ffffffff +#define SH_PI_ERROR_OVERFLOW_INIT 0x0000000000000000 + +/* SH_PI_ERROR_OVERFLOW_FSB_PROTO_ERR */ +/* Description: CRB's FSB pipe detected protocol table miss */ +#define SH_PI_ERROR_OVERFLOW_FSB_PROTO_ERR_SHFT 0 +#define SH_PI_ERROR_OVERFLOW_FSB_PROTO_ERR_MASK 0x0000000000000001 + +/* SH_PI_ERROR_OVERFLOW_GFX_RP_ERR */ +/* Description: CRB's XB pipe received another GFX reply error mess */ +#define SH_PI_ERROR_OVERFLOW_GFX_RP_ERR_SHFT 1 +#define SH_PI_ERROR_OVERFLOW_GFX_RP_ERR_MASK 0x0000000000000002 + +/* SH_PI_ERROR_OVERFLOW_XB_PROTO_ERR */ +/* Description: CRB's XB pipe detected another protocol table miss */ +#define SH_PI_ERROR_OVERFLOW_XB_PROTO_ERR_SHFT 2 +#define SH_PI_ERROR_OVERFLOW_XB_PROTO_ERR_MASK 0x0000000000000004 + +/* SH_PI_ERROR_OVERFLOW_MEM_RP_ERR */ +/* Description: CRB's XB pipe received another memory reply error m */ +#define SH_PI_ERROR_OVERFLOW_MEM_RP_ERR_SHFT 3 +#define SH_PI_ERROR_OVERFLOW_MEM_RP_ERR_MASK 0x0000000000000008 + +/* SH_PI_ERROR_OVERFLOW_PIO_RP_ERR */ +/* Description: CRB's XB pipe received another PIO reply error mess */ +#define SH_PI_ERROR_OVERFLOW_PIO_RP_ERR_SHFT 4 +#define SH_PI_ERROR_OVERFLOW_PIO_RP_ERR_MASK 0x0000000000000010 + +/* SH_PI_ERROR_OVERFLOW_MEM_TO_ERR */ +/* Description: CRB's XB pipe detected a CRB time-out */ +#define SH_PI_ERROR_OVERFLOW_MEM_TO_ERR_SHFT 5 +#define SH_PI_ERROR_OVERFLOW_MEM_TO_ERR_MASK 0x0000000000000020 + +/* SH_PI_ERROR_OVERFLOW_PIO_TO_ERR */ +/* Description: CRB's XB pipe detected a PIO time-out */ +#define SH_PI_ERROR_OVERFLOW_PIO_TO_ERR_SHFT 6 +#define SH_PI_ERROR_OVERFLOW_PIO_TO_ERR_MASK 0x0000000000000040 + +/* SH_PI_ERROR_OVERFLOW_FSB_SHUB_UCE */ +/* Description: An un-correctable ECC error was detected */ +#define SH_PI_ERROR_OVERFLOW_FSB_SHUB_UCE_SHFT 7 +#define SH_PI_ERROR_OVERFLOW_FSB_SHUB_UCE_MASK 0x0000000000000080 + +/* SH_PI_ERROR_OVERFLOW_FSB_SHUB_CE */ +/* Description: An correctable ECC error was detected */ +#define SH_PI_ERROR_OVERFLOW_FSB_SHUB_CE_SHFT 8 +#define SH_PI_ERROR_OVERFLOW_FSB_SHUB_CE_MASK 0x0000000000000100 + +/* SH_PI_ERROR_OVERFLOW_MSG_COLOR_ERR */ +/* Description: Message color was not correct */ +#define SH_PI_ERROR_OVERFLOW_MSG_COLOR_ERR_SHFT 9 +#define SH_PI_ERROR_OVERFLOW_MSG_COLOR_ERR_MASK 0x0000000000000200 + +/* SH_PI_ERROR_OVERFLOW_MD_RQ_Q_OFLOW */ +/* Description: MD Request input buffer over flow error */ +#define SH_PI_ERROR_OVERFLOW_MD_RQ_Q_OFLOW_SHFT 10 +#define SH_PI_ERROR_OVERFLOW_MD_RQ_Q_OFLOW_MASK 0x0000000000000400 + +/* SH_PI_ERROR_OVERFLOW_MD_RP_Q_OFLOW */ +/* Description: MD Reply input buffer over flow error */ +#define SH_PI_ERROR_OVERFLOW_MD_RP_Q_OFLOW_SHFT 11 +#define SH_PI_ERROR_OVERFLOW_MD_RP_Q_OFLOW_MASK 0x0000000000000800 + +/* SH_PI_ERROR_OVERFLOW_XN_RQ_Q_OFLOW */ +/* Description: XN Request input buffer over flow error */ +#define SH_PI_ERROR_OVERFLOW_XN_RQ_Q_OFLOW_SHFT 12 +#define SH_PI_ERROR_OVERFLOW_XN_RQ_Q_OFLOW_MASK 0x0000000000001000 + +/* SH_PI_ERROR_OVERFLOW_XN_RP_Q_OFLOW */ +/* Description: XN Reply input buffer over flow error */ +#define SH_PI_ERROR_OVERFLOW_XN_RP_Q_OFLOW_SHFT 13 +#define SH_PI_ERROR_OVERFLOW_XN_RP_Q_OFLOW_MASK 0x0000000000002000 + +/* SH_PI_ERROR_OVERFLOW_NACK_OFLOW */ +/* Description: NACK over flow error */ +#define SH_PI_ERROR_OVERFLOW_NACK_OFLOW_SHFT 14 +#define SH_PI_ERROR_OVERFLOW_NACK_OFLOW_MASK 0x0000000000004000 + +/* SH_PI_ERROR_OVERFLOW_GFX_INT_0 */ +/* Description: GFX transfer interrupt for CPU 0 */ +#define SH_PI_ERROR_OVERFLOW_GFX_INT_0_SHFT 15 +#define SH_PI_ERROR_OVERFLOW_GFX_INT_0_MASK 0x0000000000008000 + +/* SH_PI_ERROR_OVERFLOW_GFX_INT_1 */ +/* Description: GFX transfer interrupt for CPU 1 */ +#define SH_PI_ERROR_OVERFLOW_GFX_INT_1_SHFT 16 +#define SH_PI_ERROR_OVERFLOW_GFX_INT_1_MASK 0x0000000000010000 + +/* SH_PI_ERROR_OVERFLOW_MD_RQ_CRD_OFLOW */ +/* Description: MD Request Credit Overflow Error */ +#define SH_PI_ERROR_OVERFLOW_MD_RQ_CRD_OFLOW_SHFT 17 +#define SH_PI_ERROR_OVERFLOW_MD_RQ_CRD_OFLOW_MASK 0x0000000000020000 + +/* SH_PI_ERROR_OVERFLOW_MD_RP_CRD_OFLOW */ +/* Description: MD Reply Credit Overflow Error */ +#define SH_PI_ERROR_OVERFLOW_MD_RP_CRD_OFLOW_SHFT 18 +#define SH_PI_ERROR_OVERFLOW_MD_RP_CRD_OFLOW_MASK 0x0000000000040000 + +/* SH_PI_ERROR_OVERFLOW_XN_RQ_CRD_OFLOW */ +/* Description: XN Request Credit Overflow Error */ +#define SH_PI_ERROR_OVERFLOW_XN_RQ_CRD_OFLOW_SHFT 19 +#define SH_PI_ERROR_OVERFLOW_XN_RQ_CRD_OFLOW_MASK 0x0000000000080000 + +/* SH_PI_ERROR_OVERFLOW_XN_RP_CRD_OFLOW */ +/* Description: XN Reply Credit Overflow Error */ +#define SH_PI_ERROR_OVERFLOW_XN_RP_CRD_OFLOW_SHFT 20 +#define SH_PI_ERROR_OVERFLOW_XN_RP_CRD_OFLOW_MASK 0x0000000000100000 + +/* SH_PI_ERROR_OVERFLOW_HUNG_BUS */ +/* Description: FSB is hung */ +#define SH_PI_ERROR_OVERFLOW_HUNG_BUS_SHFT 21 +#define SH_PI_ERROR_OVERFLOW_HUNG_BUS_MASK 0x0000000000200000 + +/* SH_PI_ERROR_OVERFLOW_RSP_PARITY */ +/* Description: Parity error detecte during response phase */ +#define SH_PI_ERROR_OVERFLOW_RSP_PARITY_SHFT 22 +#define SH_PI_ERROR_OVERFLOW_RSP_PARITY_MASK 0x0000000000400000 + +/* SH_PI_ERROR_OVERFLOW_IOQ_OVERRUN */ +/* Description: Over run error detected on IOQ */ +#define SH_PI_ERROR_OVERFLOW_IOQ_OVERRUN_SHFT 23 +#define SH_PI_ERROR_OVERFLOW_IOQ_OVERRUN_MASK 0x0000000000800000 + +/* SH_PI_ERROR_OVERFLOW_REQ_FORMAT */ +/* Description: FSB request format not supported */ +#define SH_PI_ERROR_OVERFLOW_REQ_FORMAT_SHFT 24 +#define SH_PI_ERROR_OVERFLOW_REQ_FORMAT_MASK 0x0000000001000000 + +/* SH_PI_ERROR_OVERFLOW_ADDR_ACCESS */ +/* Description: Access to Address is not supported */ +#define SH_PI_ERROR_OVERFLOW_ADDR_ACCESS_SHFT 25 +#define SH_PI_ERROR_OVERFLOW_ADDR_ACCESS_MASK 0x0000000002000000 + +/* SH_PI_ERROR_OVERFLOW_REQ_PARITY */ +/* Description: Parity error detected during request phase */ +#define SH_PI_ERROR_OVERFLOW_REQ_PARITY_SHFT 26 +#define SH_PI_ERROR_OVERFLOW_REQ_PARITY_MASK 0x0000000004000000 + +/* SH_PI_ERROR_OVERFLOW_ADDR_PARITY */ +/* Description: Parity error detected on address */ +#define SH_PI_ERROR_OVERFLOW_ADDR_PARITY_SHFT 27 +#define SH_PI_ERROR_OVERFLOW_ADDR_PARITY_MASK 0x0000000008000000 + +/* SH_PI_ERROR_OVERFLOW_SHUB_FSB_DQE */ +/* Description: SHUB_FSB_DQE */ +#define SH_PI_ERROR_OVERFLOW_SHUB_FSB_DQE_SHFT 28 +#define SH_PI_ERROR_OVERFLOW_SHUB_FSB_DQE_MASK 0x0000000010000000 + +/* SH_PI_ERROR_OVERFLOW_SHUB_FSB_UCE */ +/* Description: An un-correctable ECC error was detected */ +#define SH_PI_ERROR_OVERFLOW_SHUB_FSB_UCE_SHFT 29 +#define SH_PI_ERROR_OVERFLOW_SHUB_FSB_UCE_MASK 0x0000000020000000 + +/* SH_PI_ERROR_OVERFLOW_SHUB_FSB_CE */ +/* Description: An correctable ECC error was detected */ +#define SH_PI_ERROR_OVERFLOW_SHUB_FSB_CE_SHFT 30 +#define SH_PI_ERROR_OVERFLOW_SHUB_FSB_CE_MASK 0x0000000040000000 + +/* SH_PI_ERROR_OVERFLOW_LIVELOCK */ +/* Description: AFI livelock error was detected */ +#define SH_PI_ERROR_OVERFLOW_LIVELOCK_SHFT 31 +#define SH_PI_ERROR_OVERFLOW_LIVELOCK_MASK 0x0000000080000000 + +/* SH_PI_ERROR_OVERFLOW_BAD_SNOOP */ +/* Description: AFI bad snoop error was detected */ +#define SH_PI_ERROR_OVERFLOW_BAD_SNOOP_SHFT 32 +#define SH_PI_ERROR_OVERFLOW_BAD_SNOOP_MASK 0x0000000100000000 + +/* SH_PI_ERROR_OVERFLOW_FSB_TBL_MISS */ +/* Description: AFI FSB request table miss error was detected */ +#define SH_PI_ERROR_OVERFLOW_FSB_TBL_MISS_SHFT 33 +#define SH_PI_ERROR_OVERFLOW_FSB_TBL_MISS_MASK 0x0000000200000000 + +/* SH_PI_ERROR_OVERFLOW_MSG_LENGTH */ +/* Description: Message length error on received message from SIC */ +#define SH_PI_ERROR_OVERFLOW_MSG_LENGTH_SHFT 34 +#define SH_PI_ERROR_OVERFLOW_MSG_LENGTH_MASK 0x0000000400000000 + +/* ==================================================================== */ +/* Register "SH_PI_ERROR_OVERFLOW_ALIAS" */ +/* PI Error Overflow Alias */ +/* ==================================================================== */ + +#define SH_PI_ERROR_OVERFLOW_ALIAS 0x0000000120060608 + +/* ==================================================================== */ +/* Register "SH_PI_ERROR_SUMMARY" */ +/* PI Error Summary */ +/* ==================================================================== */ + +#define SH_PI_ERROR_SUMMARY 0x0000000120060680 +#define SH_PI_ERROR_SUMMARY_MASK 0x00000007ffffffff +#define SH_PI_ERROR_SUMMARY_INIT 0x0000000000000000 + +/* SH_PI_ERROR_SUMMARY_FSB_PROTO_ERR */ +/* Description: CRB's FSB pipe detected protocol table miss */ +#define SH_PI_ERROR_SUMMARY_FSB_PROTO_ERR_SHFT 0 +#define SH_PI_ERROR_SUMMARY_FSB_PROTO_ERR_MASK 0x0000000000000001 + +/* SH_PI_ERROR_SUMMARY_GFX_RP_ERR */ +/* Description: Graphic reply error message received */ +#define SH_PI_ERROR_SUMMARY_GFX_RP_ERR_SHFT 1 +#define SH_PI_ERROR_SUMMARY_GFX_RP_ERR_MASK 0x0000000000000002 + +/* SH_PI_ERROR_SUMMARY_XB_PROTO_ERR */ +/* Description: CRB's XB pipe detected protocol table miss */ +#define SH_PI_ERROR_SUMMARY_XB_PROTO_ERR_SHFT 2 +#define SH_PI_ERROR_SUMMARY_XB_PROTO_ERR_MASK 0x0000000000000004 + +/* SH_PI_ERROR_SUMMARY_MEM_RP_ERR */ +/* Description: Memory reply error message received */ +#define SH_PI_ERROR_SUMMARY_MEM_RP_ERR_SHFT 3 +#define SH_PI_ERROR_SUMMARY_MEM_RP_ERR_MASK 0x0000000000000008 + +/* SH_PI_ERROR_SUMMARY_PIO_RP_ERR */ +/* Description: PIO error reply message received */ +#define SH_PI_ERROR_SUMMARY_PIO_RP_ERR_SHFT 4 +#define SH_PI_ERROR_SUMMARY_PIO_RP_ERR_MASK 0x0000000000000010 + +/* SH_PI_ERROR_SUMMARY_MEM_TO_ERR */ +/* Description: CRB's XB pipe detected a CRB time-out */ +#define SH_PI_ERROR_SUMMARY_MEM_TO_ERR_SHFT 5 +#define SH_PI_ERROR_SUMMARY_MEM_TO_ERR_MASK 0x0000000000000020 + +/* SH_PI_ERROR_SUMMARY_PIO_TO_ERR */ +/* Description: CRB's XB pipe detected a PIO time-out */ +#define SH_PI_ERROR_SUMMARY_PIO_TO_ERR_SHFT 6 +#define SH_PI_ERROR_SUMMARY_PIO_TO_ERR_MASK 0x0000000000000040 + +/* SH_PI_ERROR_SUMMARY_FSB_SHUB_UCE */ +/* Description: An un-correctable ECC error was detected */ +#define SH_PI_ERROR_SUMMARY_FSB_SHUB_UCE_SHFT 7 +#define SH_PI_ERROR_SUMMARY_FSB_SHUB_UCE_MASK 0x0000000000000080 + +/* SH_PI_ERROR_SUMMARY_FSB_SHUB_CE */ +/* Description: An correctable ECC error was detected */ +#define SH_PI_ERROR_SUMMARY_FSB_SHUB_CE_SHFT 8 +#define SH_PI_ERROR_SUMMARY_FSB_SHUB_CE_MASK 0x0000000000000100 + +/* SH_PI_ERROR_SUMMARY_MSG_COLOR_ERR */ +/* Description: Message color was wrong */ +#define SH_PI_ERROR_SUMMARY_MSG_COLOR_ERR_SHFT 9 +#define SH_PI_ERROR_SUMMARY_MSG_COLOR_ERR_MASK 0x0000000000000200 + +/* SH_PI_ERROR_SUMMARY_MD_RQ_Q_OFLOW */ +/* Description: MD Request input buffer over flow error */ +#define SH_PI_ERROR_SUMMARY_MD_RQ_Q_OFLOW_SHFT 10 +#define SH_PI_ERROR_SUMMARY_MD_RQ_Q_OFLOW_MASK 0x0000000000000400 + +/* SH_PI_ERROR_SUMMARY_MD_RP_Q_OFLOW */ +/* Description: MD Reply input buffer over flow error */ +#define SH_PI_ERROR_SUMMARY_MD_RP_Q_OFLOW_SHFT 11 +#define SH_PI_ERROR_SUMMARY_MD_RP_Q_OFLOW_MASK 0x0000000000000800 + +/* SH_PI_ERROR_SUMMARY_XN_RQ_Q_OFLOW */ +/* Description: XN Request input buffer over flow error */ +#define SH_PI_ERROR_SUMMARY_XN_RQ_Q_OFLOW_SHFT 12 +#define SH_PI_ERROR_SUMMARY_XN_RQ_Q_OFLOW_MASK 0x0000000000001000 + +/* SH_PI_ERROR_SUMMARY_XN_RP_Q_OFLOW */ +/* Description: XN Reply input buffer over flow error */ +#define SH_PI_ERROR_SUMMARY_XN_RP_Q_OFLOW_SHFT 13 +#define SH_PI_ERROR_SUMMARY_XN_RP_Q_OFLOW_MASK 0x0000000000002000 + +/* SH_PI_ERROR_SUMMARY_NACK_OFLOW */ +/* Description: NACK over flow error */ +#define SH_PI_ERROR_SUMMARY_NACK_OFLOW_SHFT 14 +#define SH_PI_ERROR_SUMMARY_NACK_OFLOW_MASK 0x0000000000004000 + +/* SH_PI_ERROR_SUMMARY_GFX_INT_0 */ +/* Description: GFX transfer interrupt for CPU 0 */ +#define SH_PI_ERROR_SUMMARY_GFX_INT_0_SHFT 15 +#define SH_PI_ERROR_SUMMARY_GFX_INT_0_MASK 0x0000000000008000 + +/* SH_PI_ERROR_SUMMARY_GFX_INT_1 */ +/* Description: GFX transfer interrupt for CPU 1 */ +#define SH_PI_ERROR_SUMMARY_GFX_INT_1_SHFT 16 +#define SH_PI_ERROR_SUMMARY_GFX_INT_1_MASK 0x0000000000010000 + +/* SH_PI_ERROR_SUMMARY_MD_RQ_CRD_OFLOW */ +/* Description: MD Request Credit Overflow Error */ +#define SH_PI_ERROR_SUMMARY_MD_RQ_CRD_OFLOW_SHFT 17 +#define SH_PI_ERROR_SUMMARY_MD_RQ_CRD_OFLOW_MASK 0x0000000000020000 + +/* SH_PI_ERROR_SUMMARY_MD_RP_CRD_OFLOW */ +/* Description: MD Reply Credit Overflow Error */ +#define SH_PI_ERROR_SUMMARY_MD_RP_CRD_OFLOW_SHFT 18 +#define SH_PI_ERROR_SUMMARY_MD_RP_CRD_OFLOW_MASK 0x0000000000040000 + +/* SH_PI_ERROR_SUMMARY_XN_RQ_CRD_OFLOW */ +/* Description: XN Request Credit Overflow Error */ +#define SH_PI_ERROR_SUMMARY_XN_RQ_CRD_OFLOW_SHFT 19 +#define SH_PI_ERROR_SUMMARY_XN_RQ_CRD_OFLOW_MASK 0x0000000000080000 + +/* SH_PI_ERROR_SUMMARY_XN_RP_CRD_OFLOW */ +/* Description: XN Reply Credit Overflow Error */ +#define SH_PI_ERROR_SUMMARY_XN_RP_CRD_OFLOW_SHFT 20 +#define SH_PI_ERROR_SUMMARY_XN_RP_CRD_OFLOW_MASK 0x0000000000100000 + +/* SH_PI_ERROR_SUMMARY_HUNG_BUS */ +/* Description: FSB is hung */ +#define SH_PI_ERROR_SUMMARY_HUNG_BUS_SHFT 21 +#define SH_PI_ERROR_SUMMARY_HUNG_BUS_MASK 0x0000000000200000 + +/* SH_PI_ERROR_SUMMARY_RSP_PARITY */ +/* Description: Parity error detecte during response phase */ +#define SH_PI_ERROR_SUMMARY_RSP_PARITY_SHFT 22 +#define SH_PI_ERROR_SUMMARY_RSP_PARITY_MASK 0x0000000000400000 + +/* SH_PI_ERROR_SUMMARY_IOQ_OVERRUN */ +/* Description: Over run error detected on IOQ */ +#define SH_PI_ERROR_SUMMARY_IOQ_OVERRUN_SHFT 23 +#define SH_PI_ERROR_SUMMARY_IOQ_OVERRUN_MASK 0x0000000000800000 + +/* SH_PI_ERROR_SUMMARY_REQ_FORMAT */ +/* Description: FSB request format not supported */ +#define SH_PI_ERROR_SUMMARY_REQ_FORMAT_SHFT 24 +#define SH_PI_ERROR_SUMMARY_REQ_FORMAT_MASK 0x0000000001000000 + +/* SH_PI_ERROR_SUMMARY_ADDR_ACCESS */ +/* Description: Access to Address is not supported */ +#define SH_PI_ERROR_SUMMARY_ADDR_ACCESS_SHFT 25 +#define SH_PI_ERROR_SUMMARY_ADDR_ACCESS_MASK 0x0000000002000000 + +/* SH_PI_ERROR_SUMMARY_REQ_PARITY */ +/* Description: Parity error detected during request phase */ +#define SH_PI_ERROR_SUMMARY_REQ_PARITY_SHFT 26 +#define SH_PI_ERROR_SUMMARY_REQ_PARITY_MASK 0x0000000004000000 + +/* SH_PI_ERROR_SUMMARY_ADDR_PARITY */ +/* Description: Parity error detected on address */ +#define SH_PI_ERROR_SUMMARY_ADDR_PARITY_SHFT 27 +#define SH_PI_ERROR_SUMMARY_ADDR_PARITY_MASK 0x0000000008000000 + +/* SH_PI_ERROR_SUMMARY_SHUB_FSB_DQE */ +/* Description: SHUB_FSB_DQE error */ +#define SH_PI_ERROR_SUMMARY_SHUB_FSB_DQE_SHFT 28 +#define SH_PI_ERROR_SUMMARY_SHUB_FSB_DQE_MASK 0x0000000010000000 + +/* SH_PI_ERROR_SUMMARY_SHUB_FSB_UCE */ +/* Description: An un-correctable ECC error was detected */ +#define SH_PI_ERROR_SUMMARY_SHUB_FSB_UCE_SHFT 29 +#define SH_PI_ERROR_SUMMARY_SHUB_FSB_UCE_MASK 0x0000000020000000 + +/* SH_PI_ERROR_SUMMARY_SHUB_FSB_CE */ +/* Description: An correctable ECC error was detected */ +#define SH_PI_ERROR_SUMMARY_SHUB_FSB_CE_SHFT 30 +#define SH_PI_ERROR_SUMMARY_SHUB_FSB_CE_MASK 0x0000000040000000 + +/* SH_PI_ERROR_SUMMARY_LIVELOCK */ +/* Description: AFI livelock error was detected */ +#define SH_PI_ERROR_SUMMARY_LIVELOCK_SHFT 31 +#define SH_PI_ERROR_SUMMARY_LIVELOCK_MASK 0x0000000080000000 + +/* SH_PI_ERROR_SUMMARY_BAD_SNOOP */ +/* Description: AFI bad snoop error was detected */ +#define SH_PI_ERROR_SUMMARY_BAD_SNOOP_SHFT 32 +#define SH_PI_ERROR_SUMMARY_BAD_SNOOP_MASK 0x0000000100000000 + +/* SH_PI_ERROR_SUMMARY_FSB_TBL_MISS */ +/* Description: AFI FSB request table miss error was detected */ +#define SH_PI_ERROR_SUMMARY_FSB_TBL_MISS_SHFT 33 +#define SH_PI_ERROR_SUMMARY_FSB_TBL_MISS_MASK 0x0000000200000000 + +/* SH_PI_ERROR_SUMMARY_MSG_LENGTH */ +/* Description: Message length error on received message from SIC */ +#define SH_PI_ERROR_SUMMARY_MSG_LENGTH_SHFT 34 +#define SH_PI_ERROR_SUMMARY_MSG_LENGTH_MASK 0x0000000400000000 + +/* ==================================================================== */ +/* Register "SH_PI_ERROR_SUMMARY_ALIAS" */ +/* PI Error Summary Alias */ +/* ==================================================================== */ + +#define SH_PI_ERROR_SUMMARY_ALIAS 0x0000000120060688 + +/* ==================================================================== */ +/* Register "SH_PI_EXPRESS_REPLY_STATUS" */ +/* PI Express Reply Status */ +/* ==================================================================== */ + +#define SH_PI_EXPRESS_REPLY_STATUS 0x0000000120060700 +#define SH_PI_EXPRESS_REPLY_STATUS_MASK 0x0000000000000007 +#define SH_PI_EXPRESS_REPLY_STATUS_INIT 0x0000000000000000 + +/* SH_PI_EXPRESS_REPLY_STATUS_STATE */ +/* Description: Express Reply State */ +#define SH_PI_EXPRESS_REPLY_STATUS_STATE_SHFT 0 +#define SH_PI_EXPRESS_REPLY_STATUS_STATE_MASK 0x0000000000000007 + +/* ==================================================================== */ +/* Register "SH_PI_FIRST_ERROR" */ +/* PI First Error */ +/* ==================================================================== */ + +#define SH_PI_FIRST_ERROR 0x0000000120060780 +#define SH_PI_FIRST_ERROR_MASK 0x00000007ffffffff +#define SH_PI_FIRST_ERROR_INIT 0x0000000000000000 + +/* SH_PI_FIRST_ERROR_FSB_PROTO_ERR */ +/* Description: CRB's FSB pipe detected protocol table miss */ +#define SH_PI_FIRST_ERROR_FSB_PROTO_ERR_SHFT 0 +#define SH_PI_FIRST_ERROR_FSB_PROTO_ERR_MASK 0x0000000000000001 + +/* SH_PI_FIRST_ERROR_GFX_RP_ERR */ +/* Description: Graphics error reply message received */ +#define SH_PI_FIRST_ERROR_GFX_RP_ERR_SHFT 1 +#define SH_PI_FIRST_ERROR_GFX_RP_ERR_MASK 0x0000000000000002 + +/* SH_PI_FIRST_ERROR_XB_PROTO_ERR */ +/* Description: CRB's XB pipe detected protocol table miss */ +#define SH_PI_FIRST_ERROR_XB_PROTO_ERR_SHFT 2 +#define SH_PI_FIRST_ERROR_XB_PROTO_ERR_MASK 0x0000000000000004 + +/* SH_PI_FIRST_ERROR_MEM_RP_ERR */ +/* Description: Memory reply error message received */ +#define SH_PI_FIRST_ERROR_MEM_RP_ERR_SHFT 3 +#define SH_PI_FIRST_ERROR_MEM_RP_ERR_MASK 0x0000000000000008 + +/* SH_PI_FIRST_ERROR_PIO_RP_ERR */ +/* Description: PIO reply error message received */ +#define SH_PI_FIRST_ERROR_PIO_RP_ERR_SHFT 4 +#define SH_PI_FIRST_ERROR_PIO_RP_ERR_MASK 0x0000000000000010 + +/* SH_PI_FIRST_ERROR_MEM_TO_ERR */ +/* Description: CRB's XB pipe detected a CRB time-out */ +#define SH_PI_FIRST_ERROR_MEM_TO_ERR_SHFT 5 +#define SH_PI_FIRST_ERROR_MEM_TO_ERR_MASK 0x0000000000000020 + +/* SH_PI_FIRST_ERROR_PIO_TO_ERR */ +/* Description: CRB's XB pipe detected a PIO time-out */ +#define SH_PI_FIRST_ERROR_PIO_TO_ERR_SHFT 6 +#define SH_PI_FIRST_ERROR_PIO_TO_ERR_MASK 0x0000000000000040 + +/* SH_PI_FIRST_ERROR_FSB_SHUB_UCE */ +/* Description: An un-correctable ECC error was detected */ +#define SH_PI_FIRST_ERROR_FSB_SHUB_UCE_SHFT 7 +#define SH_PI_FIRST_ERROR_FSB_SHUB_UCE_MASK 0x0000000000000080 + +/* SH_PI_FIRST_ERROR_FSB_SHUB_CE */ +/* Description: A correctable ECC error was detected */ +#define SH_PI_FIRST_ERROR_FSB_SHUB_CE_SHFT 8 +#define SH_PI_FIRST_ERROR_FSB_SHUB_CE_MASK 0x0000000000000100 + +/* SH_PI_FIRST_ERROR_MSG_COLOR_ERR */ +/* Description: Message color was wrong */ +#define SH_PI_FIRST_ERROR_MSG_COLOR_ERR_SHFT 9 +#define SH_PI_FIRST_ERROR_MSG_COLOR_ERR_MASK 0x0000000000000200 + +/* SH_PI_FIRST_ERROR_MD_RQ_Q_OFLOW */ +/* Description: MD Request input buffer over flow error */ +#define SH_PI_FIRST_ERROR_MD_RQ_Q_OFLOW_SHFT 10 +#define SH_PI_FIRST_ERROR_MD_RQ_Q_OFLOW_MASK 0x0000000000000400 + +/* SH_PI_FIRST_ERROR_MD_RP_Q_OFLOW */ +/* Description: MD Reply input buffer over flow error */ +#define SH_PI_FIRST_ERROR_MD_RP_Q_OFLOW_SHFT 11 +#define SH_PI_FIRST_ERROR_MD_RP_Q_OFLOW_MASK 0x0000000000000800 + +/* SH_PI_FIRST_ERROR_XN_RQ_Q_OFLOW */ +/* Description: XN Request input buffer over flow error */ +#define SH_PI_FIRST_ERROR_XN_RQ_Q_OFLOW_SHFT 12 +#define SH_PI_FIRST_ERROR_XN_RQ_Q_OFLOW_MASK 0x0000000000001000 + +/* SH_PI_FIRST_ERROR_XN_RP_Q_OFLOW */ +/* Description: XN Reply input buffer over flow error */ +#define SH_PI_FIRST_ERROR_XN_RP_Q_OFLOW_SHFT 13 +#define SH_PI_FIRST_ERROR_XN_RP_Q_OFLOW_MASK 0x0000000000002000 + +/* SH_PI_FIRST_ERROR_NACK_OFLOW */ +/* Description: NACK over flow error */ +#define SH_PI_FIRST_ERROR_NACK_OFLOW_SHFT 14 +#define SH_PI_FIRST_ERROR_NACK_OFLOW_MASK 0x0000000000004000 + +/* SH_PI_FIRST_ERROR_GFX_INT_0 */ +/* Description: GFX transfer interrupt for CPU 0 */ +#define SH_PI_FIRST_ERROR_GFX_INT_0_SHFT 15 +#define SH_PI_FIRST_ERROR_GFX_INT_0_MASK 0x0000000000008000 + +/* SH_PI_FIRST_ERROR_GFX_INT_1 */ +/* Description: GFX transfer interrupt for CPU 1 */ +#define SH_PI_FIRST_ERROR_GFX_INT_1_SHFT 16 +#define SH_PI_FIRST_ERROR_GFX_INT_1_MASK 0x0000000000010000 + +/* SH_PI_FIRST_ERROR_MD_RQ_CRD_OFLOW */ +/* Description: MD Request Credit Overflow Error */ +#define SH_PI_FIRST_ERROR_MD_RQ_CRD_OFLOW_SHFT 17 +#define SH_PI_FIRST_ERROR_MD_RQ_CRD_OFLOW_MASK 0x0000000000020000 + +/* SH_PI_FIRST_ERROR_MD_RP_CRD_OFLOW */ +/* Description: MD Reply Credit Overflow Error */ +#define SH_PI_FIRST_ERROR_MD_RP_CRD_OFLOW_SHFT 18 +#define SH_PI_FIRST_ERROR_MD_RP_CRD_OFLOW_MASK 0x0000000000040000 + +/* SH_PI_FIRST_ERROR_XN_RQ_CRD_OFLOW */ +/* Description: XN Request Credit Overflow Error */ +#define SH_PI_FIRST_ERROR_XN_RQ_CRD_OFLOW_SHFT 19 +#define SH_PI_FIRST_ERROR_XN_RQ_CRD_OFLOW_MASK 0x0000000000080000 + +/* SH_PI_FIRST_ERROR_XN_RP_CRD_OFLOW */ +/* Description: XN Reply Credit Overflow Error */ +#define SH_PI_FIRST_ERROR_XN_RP_CRD_OFLOW_SHFT 20 +#define SH_PI_FIRST_ERROR_XN_RP_CRD_OFLOW_MASK 0x0000000000100000 + +/* SH_PI_FIRST_ERROR_HUNG_BUS */ +/* Description: FSB is hung */ +#define SH_PI_FIRST_ERROR_HUNG_BUS_SHFT 21 +#define SH_PI_FIRST_ERROR_HUNG_BUS_MASK 0x0000000000200000 + +/* SH_PI_FIRST_ERROR_RSP_PARITY */ +/* Description: Parity error detecte during response phase */ +#define SH_PI_FIRST_ERROR_RSP_PARITY_SHFT 22 +#define SH_PI_FIRST_ERROR_RSP_PARITY_MASK 0x0000000000400000 + +/* SH_PI_FIRST_ERROR_IOQ_OVERRUN */ +/* Description: Over run error detected on IOQ */ +#define SH_PI_FIRST_ERROR_IOQ_OVERRUN_SHFT 23 +#define SH_PI_FIRST_ERROR_IOQ_OVERRUN_MASK 0x0000000000800000 + +/* SH_PI_FIRST_ERROR_REQ_FORMAT */ +/* Description: FSB request format not supported */ +#define SH_PI_FIRST_ERROR_REQ_FORMAT_SHFT 24 +#define SH_PI_FIRST_ERROR_REQ_FORMAT_MASK 0x0000000001000000 + +/* SH_PI_FIRST_ERROR_ADDR_ACCESS */ +/* Description: Access to Address is not supported */ +#define SH_PI_FIRST_ERROR_ADDR_ACCESS_SHFT 25 +#define SH_PI_FIRST_ERROR_ADDR_ACCESS_MASK 0x0000000002000000 + +/* SH_PI_FIRST_ERROR_REQ_PARITY */ +/* Description: Parity error detected during request phase */ +#define SH_PI_FIRST_ERROR_REQ_PARITY_SHFT 26 +#define SH_PI_FIRST_ERROR_REQ_PARITY_MASK 0x0000000004000000 + +/* SH_PI_FIRST_ERROR_ADDR_PARITY */ +/* Description: Parity error detected on address */ +#define SH_PI_FIRST_ERROR_ADDR_PARITY_SHFT 27 +#define SH_PI_FIRST_ERROR_ADDR_PARITY_MASK 0x0000000008000000 + +/* SH_PI_FIRST_ERROR_SHUB_FSB_DQE */ +/* Description: SHUB_FSB_DQE */ +#define SH_PI_FIRST_ERROR_SHUB_FSB_DQE_SHFT 28 +#define SH_PI_FIRST_ERROR_SHUB_FSB_DQE_MASK 0x0000000010000000 + +/* SH_PI_FIRST_ERROR_SHUB_FSB_UCE */ +/* Description: An un-correctable ECC error was detected */ +#define SH_PI_FIRST_ERROR_SHUB_FSB_UCE_SHFT 29 +#define SH_PI_FIRST_ERROR_SHUB_FSB_UCE_MASK 0x0000000020000000 + +/* SH_PI_FIRST_ERROR_SHUB_FSB_CE */ +/* Description: An correctable ECC error was detected */ +#define SH_PI_FIRST_ERROR_SHUB_FSB_CE_SHFT 30 +#define SH_PI_FIRST_ERROR_SHUB_FSB_CE_MASK 0x0000000040000000 + +/* SH_PI_FIRST_ERROR_LIVELOCK */ +/* Description: AFI livelock error was detected */ +#define SH_PI_FIRST_ERROR_LIVELOCK_SHFT 31 +#define SH_PI_FIRST_ERROR_LIVELOCK_MASK 0x0000000080000000 + +/* SH_PI_FIRST_ERROR_BAD_SNOOP */ +/* Description: AFI bad snoop error was detected */ +#define SH_PI_FIRST_ERROR_BAD_SNOOP_SHFT 32 +#define SH_PI_FIRST_ERROR_BAD_SNOOP_MASK 0x0000000100000000 + +/* SH_PI_FIRST_ERROR_FSB_TBL_MISS */ +/* Description: AFI FSB request table miss error was detected */ +#define SH_PI_FIRST_ERROR_FSB_TBL_MISS_SHFT 33 +#define SH_PI_FIRST_ERROR_FSB_TBL_MISS_MASK 0x0000000200000000 + +/* SH_PI_FIRST_ERROR_MSG_LENGTH */ +/* Description: Message length error on received message from SIC */ +#define SH_PI_FIRST_ERROR_MSG_LENGTH_SHFT 34 +#define SH_PI_FIRST_ERROR_MSG_LENGTH_MASK 0x0000000400000000 + +/* ==================================================================== */ +/* Register "SH_PI_FIRST_ERROR_ALIAS" */ +/* PI First Error Alias */ +/* ==================================================================== */ + +#define SH_PI_FIRST_ERROR_ALIAS 0x0000000120060788 + +/* ==================================================================== */ +/* Register "SH_PI_PI2MD_REPLY_VC_STATUS" */ +/* PI-to-MD Reply Virtual Channel Status */ +/* ==================================================================== */ + +#define SH_PI_PI2MD_REPLY_VC_STATUS 0x0000000120060900 +#define SH_PI_PI2MD_REPLY_VC_STATUS_MASK 0x000000000000003f +#define SH_PI_PI2MD_REPLY_VC_STATUS_INIT 0x0000000000000000 + +/* SH_PI_PI2MD_REPLY_VC_STATUS_OUTPUT_CRD_STAT */ +/* Description: Status of output credits */ +#define SH_PI_PI2MD_REPLY_VC_STATUS_OUTPUT_CRD_STAT_SHFT 0 +#define SH_PI_PI2MD_REPLY_VC_STATUS_OUTPUT_CRD_STAT_MASK 0x000000000000003f + +/* ==================================================================== */ +/* Register "SH_PI_PI2MD_REQUEST_VC_STATUS" */ +/* PI-to-MD Request Virtual Channel Status */ +/* ==================================================================== */ + +#define SH_PI_PI2MD_REQUEST_VC_STATUS 0x0000000120060980 +#define SH_PI_PI2MD_REQUEST_VC_STATUS_MASK 0x000000000000003f +#define SH_PI_PI2MD_REQUEST_VC_STATUS_INIT 0x0000000000000000 + +/* SH_PI_PI2MD_REQUEST_VC_STATUS_OUTPUT_CRD_STAT */ +/* Description: Status of output credits */ +#define SH_PI_PI2MD_REQUEST_VC_STATUS_OUTPUT_CRD_STAT_SHFT 0 +#define SH_PI_PI2MD_REQUEST_VC_STATUS_OUTPUT_CRD_STAT_MASK 0x000000000000003f + +/* ==================================================================== */ +/* Register "SH_PI_PI2XN_REPLY_VC_STATUS" */ +/* PI-to-XN Reply Virtual Channel Status */ +/* ==================================================================== */ + +#define SH_PI_PI2XN_REPLY_VC_STATUS 0x0000000120060a00 +#define SH_PI_PI2XN_REPLY_VC_STATUS_MASK 0x000000000000003f +#define SH_PI_PI2XN_REPLY_VC_STATUS_INIT 0x0000000000000000 + +/* SH_PI_PI2XN_REPLY_VC_STATUS_OUTPUT_CRD_STAT */ +/* Description: Status of output credits */ +#define SH_PI_PI2XN_REPLY_VC_STATUS_OUTPUT_CRD_STAT_SHFT 0 +#define SH_PI_PI2XN_REPLY_VC_STATUS_OUTPUT_CRD_STAT_MASK 0x000000000000003f + +/* ==================================================================== */ +/* Register "SH_PI_PI2XN_REQUEST_VC_STATUS" */ +/* PI-to-XN Request Virtual Channel Status */ +/* ==================================================================== */ + +#define SH_PI_PI2XN_REQUEST_VC_STATUS 0x0000000120060a80 +#define SH_PI_PI2XN_REQUEST_VC_STATUS_MASK 0x000000000000003f +#define SH_PI_PI2XN_REQUEST_VC_STATUS_INIT 0x0000000000000000 + +/* SH_PI_PI2XN_REQUEST_VC_STATUS_OUTPUT_CRD_STAT */ +/* Description: Status of output credits */ +#define SH_PI_PI2XN_REQUEST_VC_STATUS_OUTPUT_CRD_STAT_SHFT 0 +#define SH_PI_PI2XN_REQUEST_VC_STATUS_OUTPUT_CRD_STAT_MASK 0x000000000000003f + +/* ==================================================================== */ +/* Register "SH_PI_UNCORRECTED_DETAIL_1" */ +/* PI Uncorrected Error Detail 1 */ +/* ==================================================================== */ + +#define SH_PI_UNCORRECTED_DETAIL_1 0x0000000120060b00 +#define SH_PI_UNCORRECTED_DETAIL_1_MASK 0xffffffffffffffff +#define SH_PI_UNCORRECTED_DETAIL_1_INIT 0x0000000000000000 + +/* SH_PI_UNCORRECTED_DETAIL_1_ADDRESS */ +/* Description: Address of Message that logged Uncorrectable Error */ +#define SH_PI_UNCORRECTED_DETAIL_1_ADDRESS_SHFT 0 +#define SH_PI_UNCORRECTED_DETAIL_1_ADDRESS_MASK 0x0000ffffffffffff + +/* SH_PI_UNCORRECTED_DETAIL_1_SYNDROME */ +/* Description: Syndrome for double word data with Uncorrectable Er */ +#define SH_PI_UNCORRECTED_DETAIL_1_SYNDROME_SHFT 48 +#define SH_PI_UNCORRECTED_DETAIL_1_SYNDROME_MASK 0x00ff000000000000 + +/* SH_PI_UNCORRECTED_DETAIL_1_DEP */ +/* Description: DEP for Double word in error */ +#define SH_PI_UNCORRECTED_DETAIL_1_DEP_SHFT 56 +#define SH_PI_UNCORRECTED_DETAIL_1_DEP_MASK 0xff00000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_UNCORRECTED_DETAIL_2" */ +/* PI Uncorrected Error Detail 2 */ +/* ==================================================================== */ + +#define SH_PI_UNCORRECTED_DETAIL_2 0x0000000120060b80 +#define SH_PI_UNCORRECTED_DETAIL_2_MASK 0xffffffffffffffff +#define SH_PI_UNCORRECTED_DETAIL_2_INIT 0x0000000000000000 + +/* SH_PI_UNCORRECTED_DETAIL_2_DATA */ +/* Description: Double word data in error */ +#define SH_PI_UNCORRECTED_DETAIL_2_DATA_SHFT 0 +#define SH_PI_UNCORRECTED_DETAIL_2_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_PI_UNCORRECTED_DETAIL_3" */ +/* PI Uncorrected Error Detail 3 */ +/* ==================================================================== */ + +#define SH_PI_UNCORRECTED_DETAIL_3 0x0000000120060c00 +#define SH_PI_UNCORRECTED_DETAIL_3_MASK 0xffffffffffffffff +#define SH_PI_UNCORRECTED_DETAIL_3_INIT 0x0000000000000000 + +/* SH_PI_UNCORRECTED_DETAIL_3_ADDRESS */ +/* Description: Address of Message that logged Uncorrectable Error */ +#define SH_PI_UNCORRECTED_DETAIL_3_ADDRESS_SHFT 0 +#define SH_PI_UNCORRECTED_DETAIL_3_ADDRESS_MASK 0x0000ffffffffffff + +/* SH_PI_UNCORRECTED_DETAIL_3_SYNDROME */ +/* Description: Syndrome for double word data with Uncorrectable Er */ +#define SH_PI_UNCORRECTED_DETAIL_3_SYNDROME_SHFT 48 +#define SH_PI_UNCORRECTED_DETAIL_3_SYNDROME_MASK 0x00ff000000000000 + +/* SH_PI_UNCORRECTED_DETAIL_3_DEP */ +/* Description: DCP for Double word in error */ +#define SH_PI_UNCORRECTED_DETAIL_3_DEP_SHFT 56 +#define SH_PI_UNCORRECTED_DETAIL_3_DEP_MASK 0xff00000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_UNCORRECTED_DETAIL_4" */ +/* PI Uncorrected Error Detail 4 */ +/* ==================================================================== */ + +#define SH_PI_UNCORRECTED_DETAIL_4 0x0000000120060c80 +#define SH_PI_UNCORRECTED_DETAIL_4_MASK 0xffffffffffffffff +#define SH_PI_UNCORRECTED_DETAIL_4_INIT 0x0000000000000000 + +/* SH_PI_UNCORRECTED_DETAIL_4_DATA */ +/* Description: Double word data in error */ +#define SH_PI_UNCORRECTED_DETAIL_4_DATA_SHFT 0 +#define SH_PI_UNCORRECTED_DETAIL_4_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_PI_MD2PI_REPLY_VC_STATUS" */ +/* MD-to-PI Reply Virtual Channel Status */ +/* ==================================================================== */ + +#define SH_PI_MD2PI_REPLY_VC_STATUS 0x0000000120060800 +#define SH_PI_MD2PI_REPLY_VC_STATUS_MASK 0x0000000000000fff +#define SH_PI_MD2PI_REPLY_VC_STATUS_INIT 0x0000000000000000 + +/* SH_PI_MD2PI_REPLY_VC_STATUS_INPUT_HDR_CRD_STAT */ +/* Description: Status of input header credits */ +#define SH_PI_MD2PI_REPLY_VC_STATUS_INPUT_HDR_CRD_STAT_SHFT 0 +#define SH_PI_MD2PI_REPLY_VC_STATUS_INPUT_HDR_CRD_STAT_MASK 0x000000000000000f + +/* SH_PI_MD2PI_REPLY_VC_STATUS_INPUT_DAT_CRD_STAT */ +/* Description: Status of data credits */ +#define SH_PI_MD2PI_REPLY_VC_STATUS_INPUT_DAT_CRD_STAT_SHFT 4 +#define SH_PI_MD2PI_REPLY_VC_STATUS_INPUT_DAT_CRD_STAT_MASK 0x00000000000000f0 + +/* SH_PI_MD2PI_REPLY_VC_STATUS_INPUT_QUEUE_STAT */ +/* Description: Status of MD Reply Input Queue */ +#define SH_PI_MD2PI_REPLY_VC_STATUS_INPUT_QUEUE_STAT_SHFT 8 +#define SH_PI_MD2PI_REPLY_VC_STATUS_INPUT_QUEUE_STAT_MASK 0x0000000000000f00 + +/* ==================================================================== */ +/* Register "SH_PI_MD2PI_REQUEST_VC_STATUS" */ +/* MD-to-PI Request Virtual Channel Status */ +/* ==================================================================== */ + +#define SH_PI_MD2PI_REQUEST_VC_STATUS 0x0000000120060880 +#define SH_PI_MD2PI_REQUEST_VC_STATUS_MASK 0x0000000000000fff +#define SH_PI_MD2PI_REQUEST_VC_STATUS_INIT 0x0000000000000000 + +/* SH_PI_MD2PI_REQUEST_VC_STATUS_INPUT_HDR_CRD_STAT */ +/* Description: Status of input header credits */ +#define SH_PI_MD2PI_REQUEST_VC_STATUS_INPUT_HDR_CRD_STAT_SHFT 0 +#define SH_PI_MD2PI_REQUEST_VC_STATUS_INPUT_HDR_CRD_STAT_MASK 0x000000000000000f + +/* SH_PI_MD2PI_REQUEST_VC_STATUS_INPUT_DAT_CRD_STAT */ +/* Description: Status of input data credits */ +#define SH_PI_MD2PI_REQUEST_VC_STATUS_INPUT_DAT_CRD_STAT_SHFT 4 +#define SH_PI_MD2PI_REQUEST_VC_STATUS_INPUT_DAT_CRD_STAT_MASK 0x00000000000000f0 + +/* SH_PI_MD2PI_REQUEST_VC_STATUS_INPUT_QUEUE_STAT */ +/* Description: Status of MD Request Input Queue */ +#define SH_PI_MD2PI_REQUEST_VC_STATUS_INPUT_QUEUE_STAT_SHFT 8 +#define SH_PI_MD2PI_REQUEST_VC_STATUS_INPUT_QUEUE_STAT_MASK 0x0000000000000f00 + +/* ==================================================================== */ +/* Register "SH_PI_XN2PI_REPLY_VC_STATUS" */ +/* XN-to-PI Reply Virtual Channel Status */ +/* ==================================================================== */ + +#define SH_PI_XN2PI_REPLY_VC_STATUS 0x0000000120060d00 +#define SH_PI_XN2PI_REPLY_VC_STATUS_MASK 0x0000000000000fff +#define SH_PI_XN2PI_REPLY_VC_STATUS_INIT 0x0000000000000000 + +/* SH_PI_XN2PI_REPLY_VC_STATUS_INPUT_HDR_CRD_STAT */ +/* Description: Status of input header credits */ +#define SH_PI_XN2PI_REPLY_VC_STATUS_INPUT_HDR_CRD_STAT_SHFT 0 +#define SH_PI_XN2PI_REPLY_VC_STATUS_INPUT_HDR_CRD_STAT_MASK 0x000000000000000f + +/* SH_PI_XN2PI_REPLY_VC_STATUS_INPUT_DAT_CRD_STAT */ +/* Description: Status of input data credits */ +#define SH_PI_XN2PI_REPLY_VC_STATUS_INPUT_DAT_CRD_STAT_SHFT 4 +#define SH_PI_XN2PI_REPLY_VC_STATUS_INPUT_DAT_CRD_STAT_MASK 0x00000000000000f0 + +/* SH_PI_XN2PI_REPLY_VC_STATUS_INPUT_QUEUE_STAT */ +/* Description: Status of XN Reply Input Queue */ +#define SH_PI_XN2PI_REPLY_VC_STATUS_INPUT_QUEUE_STAT_SHFT 8 +#define SH_PI_XN2PI_REPLY_VC_STATUS_INPUT_QUEUE_STAT_MASK 0x0000000000000f00 + +/* ==================================================================== */ +/* Register "SH_PI_XN2PI_REQUEST_VC_STATUS" */ +/* XN-to-PI Request Virtual Channel Status */ +/* ==================================================================== */ + +#define SH_PI_XN2PI_REQUEST_VC_STATUS 0x0000000120060d80 +#define SH_PI_XN2PI_REQUEST_VC_STATUS_MASK 0x0000000000000fff +#define SH_PI_XN2PI_REQUEST_VC_STATUS_INIT 0x0000000000000000 + +/* SH_PI_XN2PI_REQUEST_VC_STATUS_INPUT_HDR_CRD_STAT */ +/* Description: Status of input header credits */ +#define SH_PI_XN2PI_REQUEST_VC_STATUS_INPUT_HDR_CRD_STAT_SHFT 0 +#define SH_PI_XN2PI_REQUEST_VC_STATUS_INPUT_HDR_CRD_STAT_MASK 0x000000000000000f + +/* SH_PI_XN2PI_REQUEST_VC_STATUS_INPUT_DAT_CRD_STAT */ +/* Description: Status of input data credits */ +#define SH_PI_XN2PI_REQUEST_VC_STATUS_INPUT_DAT_CRD_STAT_SHFT 4 +#define SH_PI_XN2PI_REQUEST_VC_STATUS_INPUT_DAT_CRD_STAT_MASK 0x00000000000000f0 + +/* SH_PI_XN2PI_REQUEST_VC_STATUS_INPUT_QUEUE_STAT */ +/* Description: Status of XN Request Input Queue */ +#define SH_PI_XN2PI_REQUEST_VC_STATUS_INPUT_QUEUE_STAT_SHFT 8 +#define SH_PI_XN2PI_REQUEST_VC_STATUS_INPUT_QUEUE_STAT_MASK 0x0000000000000f00 + +/* ==================================================================== */ +/* Register "SH_XNPI_SIC_FLOW" */ +/* ==================================================================== */ + +#define SH_XNPI_SIC_FLOW 0x0000000150030000 +#define SH_XNPI_SIC_FLOW_MASK 0x9f1f1f1f1f1f9f9f +#define SH_XNPI_SIC_FLOW_INIT 0x0000080000080000 + +/* SH_XNPI_SIC_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNPI_SIC_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNPI_SIC_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000001f + +/* SH_XNPI_SIC_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNPI_SIC_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNPI_SIC_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNPI_SIC_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNPI_SIC_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNPI_SIC_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000001f00 + +/* SH_XNPI_SIC_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNPI_SIC_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNPI_SIC_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNPI_SIC_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNPI_SIC_FLOW_CREDIT_VC0_TEST_SHFT 16 +#define SH_XNPI_SIC_FLOW_CREDIT_VC0_TEST_MASK 0x00000000001f0000 + +/* SH_XNPI_SIC_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNPI_SIC_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNPI_SIC_FLOW_CREDIT_VC0_DYN_MASK 0x000000001f000000 + +/* SH_XNPI_SIC_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNPI_SIC_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNPI_SIC_FLOW_CREDIT_VC0_CAP_MASK 0x0000001f00000000 + +/* SH_XNPI_SIC_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNPI_SIC_FLOW_CREDIT_VC2_TEST_SHFT 40 +#define SH_XNPI_SIC_FLOW_CREDIT_VC2_TEST_MASK 0x00001f0000000000 + +/* SH_XNPI_SIC_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNPI_SIC_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNPI_SIC_FLOW_CREDIT_VC2_DYN_MASK 0x001f000000000000 + +/* SH_XNPI_SIC_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNPI_SIC_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNPI_SIC_FLOW_CREDIT_VC2_CAP_MASK 0x1f00000000000000 + +/* SH_XNPI_SIC_FLOW_DISABLE_BYPASS_OUT */ +#define SH_XNPI_SIC_FLOW_DISABLE_BYPASS_OUT_SHFT 63 +#define SH_XNPI_SIC_FLOW_DISABLE_BYPASS_OUT_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNPI_TO_NI0_PORT_FLOW" */ +/* ==================================================================== */ + +#define SH_XNPI_TO_NI0_PORT_FLOW 0x0000000150030010 +#define SH_XNPI_TO_NI0_PORT_FLOW_MASK 0x3f3f003f3f00bfbf +#define SH_XNPI_TO_NI0_PORT_FLOW_INIT 0x0000000000000000 + +/* SH_XNPI_TO_NI0_PORT_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNPI_TO_NI0_PORT_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNPI_TO_NI0_PORT_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNPI_TO_NI0_PORT_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNPI_TO_NI0_PORT_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNPI_TO_NI0_PORT_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNPI_TO_NI0_PORT_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNPI_TO_NI0_PORT_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNPI_TO_NI0_PORT_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNPI_TO_NI0_PORT_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNPI_TO_NI0_PORT_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNPI_TO_NI0_PORT_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNPI_TO_NI0_PORT_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNPI_TO_NI0_PORT_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNPI_TO_NI0_PORT_FLOW_CREDIT_VC0_DYN_MASK 0x000000003f000000 + +/* SH_XNPI_TO_NI0_PORT_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNPI_TO_NI0_PORT_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNPI_TO_NI0_PORT_FLOW_CREDIT_VC0_CAP_MASK 0x0000003f00000000 + +/* SH_XNPI_TO_NI0_PORT_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNPI_TO_NI0_PORT_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNPI_TO_NI0_PORT_FLOW_CREDIT_VC2_DYN_MASK 0x003f000000000000 + +/* SH_XNPI_TO_NI0_PORT_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNPI_TO_NI0_PORT_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNPI_TO_NI0_PORT_FLOW_CREDIT_VC2_CAP_MASK 0x3f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNPI_TO_NI1_PORT_FLOW" */ +/* ==================================================================== */ + +#define SH_XNPI_TO_NI1_PORT_FLOW 0x0000000150030020 +#define SH_XNPI_TO_NI1_PORT_FLOW_MASK 0x3f3f003f3f00bfbf +#define SH_XNPI_TO_NI1_PORT_FLOW_INIT 0x0000000000000000 + +/* SH_XNPI_TO_NI1_PORT_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNPI_TO_NI1_PORT_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNPI_TO_NI1_PORT_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNPI_TO_NI1_PORT_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNPI_TO_NI1_PORT_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNPI_TO_NI1_PORT_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNPI_TO_NI1_PORT_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNPI_TO_NI1_PORT_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNPI_TO_NI1_PORT_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNPI_TO_NI1_PORT_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNPI_TO_NI1_PORT_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNPI_TO_NI1_PORT_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNPI_TO_NI1_PORT_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNPI_TO_NI1_PORT_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNPI_TO_NI1_PORT_FLOW_CREDIT_VC0_DYN_MASK 0x000000003f000000 + +/* SH_XNPI_TO_NI1_PORT_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNPI_TO_NI1_PORT_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNPI_TO_NI1_PORT_FLOW_CREDIT_VC0_CAP_MASK 0x0000003f00000000 + +/* SH_XNPI_TO_NI1_PORT_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNPI_TO_NI1_PORT_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNPI_TO_NI1_PORT_FLOW_CREDIT_VC2_DYN_MASK 0x003f000000000000 + +/* SH_XNPI_TO_NI1_PORT_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNPI_TO_NI1_PORT_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNPI_TO_NI1_PORT_FLOW_CREDIT_VC2_CAP_MASK 0x3f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNPI_TO_IILB_PORT_FLOW" */ +/* ==================================================================== */ + +#define SH_XNPI_TO_IILB_PORT_FLOW 0x0000000150030030 +#define SH_XNPI_TO_IILB_PORT_FLOW_MASK 0x3f3f003f3f00bfbf +#define SH_XNPI_TO_IILB_PORT_FLOW_INIT 0x0000000000000000 + +/* SH_XNPI_TO_IILB_PORT_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNPI_TO_IILB_PORT_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNPI_TO_IILB_PORT_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNPI_TO_IILB_PORT_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNPI_TO_IILB_PORT_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNPI_TO_IILB_PORT_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNPI_TO_IILB_PORT_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNPI_TO_IILB_PORT_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNPI_TO_IILB_PORT_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNPI_TO_IILB_PORT_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNPI_TO_IILB_PORT_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNPI_TO_IILB_PORT_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNPI_TO_IILB_PORT_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNPI_TO_IILB_PORT_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNPI_TO_IILB_PORT_FLOW_CREDIT_VC0_DYN_MASK 0x000000003f000000 + +/* SH_XNPI_TO_IILB_PORT_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNPI_TO_IILB_PORT_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNPI_TO_IILB_PORT_FLOW_CREDIT_VC0_CAP_MASK 0x0000003f00000000 + +/* SH_XNPI_TO_IILB_PORT_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNPI_TO_IILB_PORT_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNPI_TO_IILB_PORT_FLOW_CREDIT_VC2_DYN_MASK 0x003f000000000000 + +/* SH_XNPI_TO_IILB_PORT_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNPI_TO_IILB_PORT_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNPI_TO_IILB_PORT_FLOW_CREDIT_VC2_CAP_MASK 0x3f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNPI_FR_NI0_PORT_FLOW_FIFO" */ +/* ==================================================================== */ + +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO 0x0000000150030040 +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_MASK 0x00001f1f3f3f3f3f +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_INIT 0x00000c0c00000000 + +/* SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_DYN */ +/* Description: vc0 fifo entry dynamic value */ +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_DYN_SHFT 0 +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_DYN_MASK 0x000000000000003f + +/* SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_CAP */ +/* Description: vc0 fifo entry captured value */ +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_CAP_SHFT 8 +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_CAP_MASK 0x0000000000003f00 + +/* SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_DYN */ +/* Description: vc2 fifo entry dynamic value */ +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_DYN_SHFT 16 +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_DYN_MASK 0x00000000003f0000 + +/* SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_CAP */ +/* Description: vc2 fifo entry captured value */ +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_CAP_SHFT 24 +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_CAP_MASK 0x000000003f000000 + +/* SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_TEST */ +/* Description: vc0 test credits limit */ +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_TEST_SHFT 32 +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_TEST_MASK 0x0000001f00000000 + +/* SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_TEST */ +/* Description: vc2 test credits limit */ +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_TEST_SHFT 40 +#define SH_XNPI_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_TEST_MASK 0x00001f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNPI_FR_NI1_PORT_FLOW_FIFO" */ +/* ==================================================================== */ + +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO 0x0000000150030050 +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_MASK 0x00001f1f3f3f3f3f +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_INIT 0x00000c0c00000000 + +/* SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_DYN */ +/* Description: vc0 fifo entry dynamic value */ +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_DYN_SHFT 0 +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_DYN_MASK 0x000000000000003f + +/* SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_CAP */ +/* Description: vc0 fifo entry captured value */ +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_CAP_SHFT 8 +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_CAP_MASK 0x0000000000003f00 + +/* SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_DYN */ +/* Description: vc2 fifo entry dynamic value */ +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_DYN_SHFT 16 +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_DYN_MASK 0x00000000003f0000 + +/* SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_CAP */ +/* Description: vc2 fifo entry captured value */ +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_CAP_SHFT 24 +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_CAP_MASK 0x000000003f000000 + +/* SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_TEST */ +/* Description: vc0 test credits limit */ +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_TEST_SHFT 32 +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_TEST_MASK 0x0000001f00000000 + +/* SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_TEST */ +/* Description: vc2 test credits limit */ +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_TEST_SHFT 40 +#define SH_XNPI_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_TEST_MASK 0x00001f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNPI_FR_IILB_PORT_FLOW_FIFO" */ +/* ==================================================================== */ + +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO 0x0000000150030060 +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_MASK 0x00001f1f3f3f3f3f +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_INIT 0x00000c0c00000000 + +/* SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_DYN */ +/* Description: vc0 fifo entry dynamic value */ +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_DYN_SHFT 0 +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_DYN_MASK 0x000000000000003f + +/* SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_CAP */ +/* Description: vc0 fifo entry captured value */ +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_CAP_SHFT 8 +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_CAP_MASK 0x0000000000003f00 + +/* SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_DYN */ +/* Description: vc2 fifo entry dynamic value */ +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_DYN_SHFT 16 +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_DYN_MASK 0x00000000003f0000 + +/* SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_CAP */ +/* Description: vc2 fifo entry captured value */ +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_CAP_SHFT 24 +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_CAP_MASK 0x000000003f000000 + +/* SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_TEST */ +/* Description: vc0 test credits limit */ +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_TEST_SHFT 32 +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_TEST_MASK 0x0000001f00000000 + +/* SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_TEST */ +/* Description: vc2 test credits limit */ +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_TEST_SHFT 40 +#define SH_XNPI_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_TEST_MASK 0x00001f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNMD_SIC_FLOW" */ +/* ==================================================================== */ + +#define SH_XNMD_SIC_FLOW 0x0000000150030100 +#define SH_XNMD_SIC_FLOW_MASK 0x9f1f1f1f1f1f9f9f +#define SH_XNMD_SIC_FLOW_INIT 0x0000090000090000 + +/* SH_XNMD_SIC_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNMD_SIC_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNMD_SIC_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000001f + +/* SH_XNMD_SIC_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNMD_SIC_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNMD_SIC_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNMD_SIC_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNMD_SIC_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNMD_SIC_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000001f00 + +/* SH_XNMD_SIC_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNMD_SIC_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNMD_SIC_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNMD_SIC_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNMD_SIC_FLOW_CREDIT_VC0_TEST_SHFT 16 +#define SH_XNMD_SIC_FLOW_CREDIT_VC0_TEST_MASK 0x00000000001f0000 + +/* SH_XNMD_SIC_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNMD_SIC_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNMD_SIC_FLOW_CREDIT_VC0_DYN_MASK 0x000000001f000000 + +/* SH_XNMD_SIC_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNMD_SIC_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNMD_SIC_FLOW_CREDIT_VC0_CAP_MASK 0x0000001f00000000 + +/* SH_XNMD_SIC_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNMD_SIC_FLOW_CREDIT_VC2_TEST_SHFT 40 +#define SH_XNMD_SIC_FLOW_CREDIT_VC2_TEST_MASK 0x00001f0000000000 + +/* SH_XNMD_SIC_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNMD_SIC_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNMD_SIC_FLOW_CREDIT_VC2_DYN_MASK 0x001f000000000000 + +/* SH_XNMD_SIC_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNMD_SIC_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNMD_SIC_FLOW_CREDIT_VC2_CAP_MASK 0x1f00000000000000 + +/* SH_XNMD_SIC_FLOW_DISABLE_BYPASS_OUT */ +#define SH_XNMD_SIC_FLOW_DISABLE_BYPASS_OUT_SHFT 63 +#define SH_XNMD_SIC_FLOW_DISABLE_BYPASS_OUT_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNMD_TO_NI0_PORT_FLOW" */ +/* ==================================================================== */ + +#define SH_XNMD_TO_NI0_PORT_FLOW 0x0000000150030110 +#define SH_XNMD_TO_NI0_PORT_FLOW_MASK 0x3f3f003f3f00bfbf +#define SH_XNMD_TO_NI0_PORT_FLOW_INIT 0x0000000000000000 + +/* SH_XNMD_TO_NI0_PORT_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNMD_TO_NI0_PORT_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNMD_TO_NI0_PORT_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNMD_TO_NI0_PORT_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNMD_TO_NI0_PORT_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNMD_TO_NI0_PORT_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNMD_TO_NI0_PORT_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNMD_TO_NI0_PORT_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNMD_TO_NI0_PORT_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNMD_TO_NI0_PORT_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNMD_TO_NI0_PORT_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNMD_TO_NI0_PORT_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNMD_TO_NI0_PORT_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNMD_TO_NI0_PORT_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNMD_TO_NI0_PORT_FLOW_CREDIT_VC0_DYN_MASK 0x000000003f000000 + +/* SH_XNMD_TO_NI0_PORT_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNMD_TO_NI0_PORT_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNMD_TO_NI0_PORT_FLOW_CREDIT_VC0_CAP_MASK 0x0000003f00000000 + +/* SH_XNMD_TO_NI0_PORT_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNMD_TO_NI0_PORT_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNMD_TO_NI0_PORT_FLOW_CREDIT_VC2_DYN_MASK 0x003f000000000000 + +/* SH_XNMD_TO_NI0_PORT_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNMD_TO_NI0_PORT_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNMD_TO_NI0_PORT_FLOW_CREDIT_VC2_CAP_MASK 0x3f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNMD_TO_NI1_PORT_FLOW" */ +/* ==================================================================== */ + +#define SH_XNMD_TO_NI1_PORT_FLOW 0x0000000150030120 +#define SH_XNMD_TO_NI1_PORT_FLOW_MASK 0x3f3f003f3f00bfbf +#define SH_XNMD_TO_NI1_PORT_FLOW_INIT 0x0000000000000000 + +/* SH_XNMD_TO_NI1_PORT_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNMD_TO_NI1_PORT_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNMD_TO_NI1_PORT_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNMD_TO_NI1_PORT_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNMD_TO_NI1_PORT_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNMD_TO_NI1_PORT_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNMD_TO_NI1_PORT_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNMD_TO_NI1_PORT_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNMD_TO_NI1_PORT_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNMD_TO_NI1_PORT_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNMD_TO_NI1_PORT_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNMD_TO_NI1_PORT_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNMD_TO_NI1_PORT_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNMD_TO_NI1_PORT_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNMD_TO_NI1_PORT_FLOW_CREDIT_VC0_DYN_MASK 0x000000003f000000 + +/* SH_XNMD_TO_NI1_PORT_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNMD_TO_NI1_PORT_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNMD_TO_NI1_PORT_FLOW_CREDIT_VC0_CAP_MASK 0x0000003f00000000 + +/* SH_XNMD_TO_NI1_PORT_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNMD_TO_NI1_PORT_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNMD_TO_NI1_PORT_FLOW_CREDIT_VC2_DYN_MASK 0x003f000000000000 + +/* SH_XNMD_TO_NI1_PORT_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNMD_TO_NI1_PORT_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNMD_TO_NI1_PORT_FLOW_CREDIT_VC2_CAP_MASK 0x3f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNMD_TO_IILB_PORT_FLOW" */ +/* ==================================================================== */ + +#define SH_XNMD_TO_IILB_PORT_FLOW 0x0000000150030130 +#define SH_XNMD_TO_IILB_PORT_FLOW_MASK 0x3f3f003f3f00bfbf +#define SH_XNMD_TO_IILB_PORT_FLOW_INIT 0x0000000000000000 + +/* SH_XNMD_TO_IILB_PORT_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNMD_TO_IILB_PORT_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNMD_TO_IILB_PORT_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNMD_TO_IILB_PORT_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNMD_TO_IILB_PORT_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNMD_TO_IILB_PORT_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNMD_TO_IILB_PORT_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNMD_TO_IILB_PORT_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNMD_TO_IILB_PORT_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNMD_TO_IILB_PORT_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNMD_TO_IILB_PORT_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNMD_TO_IILB_PORT_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNMD_TO_IILB_PORT_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNMD_TO_IILB_PORT_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNMD_TO_IILB_PORT_FLOW_CREDIT_VC0_DYN_MASK 0x000000003f000000 + +/* SH_XNMD_TO_IILB_PORT_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNMD_TO_IILB_PORT_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNMD_TO_IILB_PORT_FLOW_CREDIT_VC0_CAP_MASK 0x0000003f00000000 + +/* SH_XNMD_TO_IILB_PORT_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNMD_TO_IILB_PORT_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNMD_TO_IILB_PORT_FLOW_CREDIT_VC2_DYN_MASK 0x003f000000000000 + +/* SH_XNMD_TO_IILB_PORT_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNMD_TO_IILB_PORT_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNMD_TO_IILB_PORT_FLOW_CREDIT_VC2_CAP_MASK 0x3f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNMD_FR_NI0_PORT_FLOW_FIFO" */ +/* ==================================================================== */ + +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO 0x0000000150030140 +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_MASK 0x00001f1f3f3f3f3f +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_INIT 0x00000c0c00000000 + +/* SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_DYN */ +/* Description: vc0 fifo entry dynamic value */ +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_DYN_SHFT 0 +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_DYN_MASK 0x000000000000003f + +/* SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_CAP */ +/* Description: vc0 fifo entry captured value */ +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_CAP_SHFT 8 +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_CAP_MASK 0x0000000000003f00 + +/* SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_DYN */ +/* Description: vc2 fifo entry dynamic value */ +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_DYN_SHFT 16 +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_DYN_MASK 0x00000000003f0000 + +/* SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_CAP */ +/* Description: vc2 fifo entry captured value */ +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_CAP_SHFT 24 +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_CAP_MASK 0x000000003f000000 + +/* SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_TEST */ +/* Description: vc0 test credits limit */ +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_TEST_SHFT 32 +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC0_TEST_MASK 0x0000001f00000000 + +/* SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_TEST */ +/* Description: vc2 test credits limit */ +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_TEST_SHFT 40 +#define SH_XNMD_FR_NI0_PORT_FLOW_FIFO_ENTRY_VC2_TEST_MASK 0x00001f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNMD_FR_NI1_PORT_FLOW_FIFO" */ +/* ==================================================================== */ + +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO 0x0000000150030150 +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_MASK 0x00001f1f3f3f3f3f +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_INIT 0x00000c0c00000000 + +/* SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_DYN */ +/* Description: vc0 fifo entry dynamic value */ +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_DYN_SHFT 0 +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_DYN_MASK 0x000000000000003f + +/* SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_CAP */ +/* Description: vc0 fifo entry captured value */ +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_CAP_SHFT 8 +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_CAP_MASK 0x0000000000003f00 + +/* SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_DYN */ +/* Description: vc2 fifo entry dynamic value */ +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_DYN_SHFT 16 +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_DYN_MASK 0x00000000003f0000 + +/* SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_CAP */ +/* Description: vc2 fifo entry captured value */ +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_CAP_SHFT 24 +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_CAP_MASK 0x000000003f000000 + +/* SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_TEST */ +/* Description: vc0 test credits limit */ +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_TEST_SHFT 32 +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC0_TEST_MASK 0x0000001f00000000 + +/* SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_TEST */ +/* Description: vc2 test credits limit */ +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_TEST_SHFT 40 +#define SH_XNMD_FR_NI1_PORT_FLOW_FIFO_ENTRY_VC2_TEST_MASK 0x00001f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNMD_FR_IILB_PORT_FLOW_FIFO" */ +/* ==================================================================== */ + +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO 0x0000000150030160 +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_MASK 0x00001f1f3f3f3f3f +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_INIT 0x00000c0c00000000 + +/* SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_DYN */ +/* Description: vc0 fifo entry dynamic value */ +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_DYN_SHFT 0 +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_DYN_MASK 0x000000000000003f + +/* SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_CAP */ +/* Description: vc0 fifo entry captured value */ +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_CAP_SHFT 8 +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_CAP_MASK 0x0000000000003f00 + +/* SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_DYN */ +/* Description: vc2 fifo entry dynamic value */ +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_DYN_SHFT 16 +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_DYN_MASK 0x00000000003f0000 + +/* SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_CAP */ +/* Description: vc2 fifo entry captured value */ +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_CAP_SHFT 24 +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_CAP_MASK 0x000000003f000000 + +/* SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_TEST */ +/* Description: vc0 test credits limit */ +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_TEST_SHFT 32 +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC0_TEST_MASK 0x0000001f00000000 + +/* SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_TEST */ +/* Description: vc2 test credits limit */ +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_TEST_SHFT 40 +#define SH_XNMD_FR_IILB_PORT_FLOW_FIFO_ENTRY_VC2_TEST_MASK 0x00001f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNII_INTRA_FLOW" */ +/* ==================================================================== */ + +#define SH_XNII_INTRA_FLOW 0x0000000150030200 +#define SH_XNII_INTRA_FLOW_MASK 0x7f7f7f7f7f7fbfbf +#define SH_XNII_INTRA_FLOW_INIT 0x00003f00003f0000 + +/* SH_XNII_INTRA_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNII_INTRA_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNII_INTRA_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNII_INTRA_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNII_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNII_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNII_INTRA_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNII_INTRA_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNII_INTRA_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNII_INTRA_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNII_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNII_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNII_INTRA_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNII_INTRA_FLOW_CREDIT_VC0_TEST_SHFT 16 +#define SH_XNII_INTRA_FLOW_CREDIT_VC0_TEST_MASK 0x00000000007f0000 + +/* SH_XNII_INTRA_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNII_INTRA_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNII_INTRA_FLOW_CREDIT_VC0_DYN_MASK 0x000000007f000000 + +/* SH_XNII_INTRA_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNII_INTRA_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNII_INTRA_FLOW_CREDIT_VC0_CAP_MASK 0x0000007f00000000 + +/* SH_XNII_INTRA_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNII_INTRA_FLOW_CREDIT_VC2_TEST_SHFT 40 +#define SH_XNII_INTRA_FLOW_CREDIT_VC2_TEST_MASK 0x00007f0000000000 + +/* SH_XNII_INTRA_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNII_INTRA_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNII_INTRA_FLOW_CREDIT_VC2_DYN_MASK 0x007f000000000000 + +/* SH_XNII_INTRA_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNII_INTRA_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNII_INTRA_FLOW_CREDIT_VC2_CAP_MASK 0x7f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNLB_INTRA_FLOW" */ +/* ==================================================================== */ + +#define SH_XNLB_INTRA_FLOW 0x0000000150030210 +#define SH_XNLB_INTRA_FLOW_MASK 0xff7f7f7f7f7fbfbf +#define SH_XNLB_INTRA_FLOW_INIT 0x0000080000100000 + +/* SH_XNLB_INTRA_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNLB_INTRA_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNLB_INTRA_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNLB_INTRA_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNLB_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNLB_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNLB_INTRA_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNLB_INTRA_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNLB_INTRA_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNLB_INTRA_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNLB_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNLB_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNLB_INTRA_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNLB_INTRA_FLOW_CREDIT_VC0_TEST_SHFT 16 +#define SH_XNLB_INTRA_FLOW_CREDIT_VC0_TEST_MASK 0x00000000007f0000 + +/* SH_XNLB_INTRA_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNLB_INTRA_FLOW_CREDIT_VC0_DYN_SHFT 24 +#define SH_XNLB_INTRA_FLOW_CREDIT_VC0_DYN_MASK 0x000000007f000000 + +/* SH_XNLB_INTRA_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNLB_INTRA_FLOW_CREDIT_VC0_CAP_SHFT 32 +#define SH_XNLB_INTRA_FLOW_CREDIT_VC0_CAP_MASK 0x0000007f00000000 + +/* SH_XNLB_INTRA_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNLB_INTRA_FLOW_CREDIT_VC2_TEST_SHFT 40 +#define SH_XNLB_INTRA_FLOW_CREDIT_VC2_TEST_MASK 0x00007f0000000000 + +/* SH_XNLB_INTRA_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNLB_INTRA_FLOW_CREDIT_VC2_DYN_SHFT 48 +#define SH_XNLB_INTRA_FLOW_CREDIT_VC2_DYN_MASK 0x007f000000000000 + +/* SH_XNLB_INTRA_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNLB_INTRA_FLOW_CREDIT_VC2_CAP_SHFT 56 +#define SH_XNLB_INTRA_FLOW_CREDIT_VC2_CAP_MASK 0x7f00000000000000 + +/* SH_XNLB_INTRA_FLOW_DISABLE_BYPASS_IN */ +#define SH_XNLB_INTRA_FLOW_DISABLE_BYPASS_IN_SHFT 63 +#define SH_XNLB_INTRA_FLOW_DISABLE_BYPASS_IN_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT 0x0000000150030220 +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_MASK 0x7f7f007f7f00bfbf +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_INIT 0x0000000000000000 + +/* SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC0_DYN */ +/* Description: vc0 debit dynamic value */ +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC0_DYN_SHFT 24 +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC0_DYN_MASK 0x000000007f000000 + +/* SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC0_CAP */ +/* Description: vc0 debit captured value */ +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC0_CAP_SHFT 32 +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC0_CAP_MASK 0x0000007f00000000 + +/* SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC2_DYN */ +/* Description: vc2 debit dynamic value */ +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC2_DYN_SHFT 48 +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC2_DYN_MASK 0x007f000000000000 + +/* SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC2_CAP */ +/* Description: vc2 debit captured value */ +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC2_CAP_SHFT 56 +#define SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT_VC2_CAP_MASK 0x7f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT 0x0000000150030230 +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_MASK 0x7f7f007f7f00bfbf +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_INIT 0x0000000000000000 + +/* SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC0_DYN */ +/* Description: vc0 debit dynamic value */ +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC0_DYN_SHFT 24 +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC0_DYN_MASK 0x000000007f000000 + +/* SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC0_CAP */ +/* Description: vc0 debit captured value */ +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC0_CAP_SHFT 32 +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC0_CAP_MASK 0x0000007f00000000 + +/* SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC2_DYN */ +/* Description: vc2 debit dynamic value */ +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC2_DYN_SHFT 48 +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC2_DYN_MASK 0x007f000000000000 + +/* SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC2_CAP */ +/* Description: vc2 debit captured value */ +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC2_CAP_SHFT 56 +#define SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT_VC2_CAP_MASK 0x7f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT 0x0000000150030240 +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_MASK 0x7f7f007f7f00bfbf +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_INIT 0x0000000000000000 + +/* SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC0_DYN */ +/* Description: vc0 debit dynamic value */ +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC0_DYN_SHFT 24 +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC0_DYN_MASK 0x000000007f000000 + +/* SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC0_CAP */ +/* Description: vc0 debit captured value */ +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC0_CAP_SHFT 32 +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC0_CAP_MASK 0x0000007f00000000 + +/* SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC2_DYN */ +/* Description: vc2 debit dynamic value */ +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC2_DYN_SHFT 48 +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC2_DYN_MASK 0x007f000000000000 + +/* SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC2_CAP */ +/* Description: vc2 debit captured value */ +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC2_CAP_SHFT 56 +#define SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT_VC2_CAP_MASK 0x7f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT 0x0000000150030250 +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_MASK 0x7f7f007f7f00bfbf +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_INIT 0x0000000000000000 + +/* SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC0_DYN */ +/* Description: vc0 debit dynamic value */ +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC0_DYN_SHFT 24 +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC0_DYN_MASK 0x000000007f000000 + +/* SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC0_CAP */ +/* Description: vc0 debit captured value */ +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC0_CAP_SHFT 32 +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC0_CAP_MASK 0x0000007f00000000 + +/* SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC2_DYN */ +/* Description: vc2 debit dynamic value */ +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC2_DYN_SHFT 48 +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC2_DYN_MASK 0x007f000000000000 + +/* SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC2_CAP */ +/* Description: vc2 debit captured value */ +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC2_CAP_SHFT 56 +#define SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT_VC2_CAP_MASK 0x7f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT 0x0000000150030260 +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_MASK 0x7f7f007f7f00bfbf +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_INIT 0x0000000000000000 + +/* SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC0_DYN */ +/* Description: vc0 debit dynamic value */ +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC0_DYN_SHFT 24 +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC0_DYN_MASK 0x000000007f000000 + +/* SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC0_CAP */ +/* Description: vc0 debit captured value */ +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC0_CAP_SHFT 32 +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC0_CAP_MASK 0x0000007f00000000 + +/* SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC2_DYN */ +/* Description: vc2 debit dynamic value */ +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC2_DYN_SHFT 48 +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC2_DYN_MASK 0x007f000000000000 + +/* SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC2_CAP */ +/* Description: vc2 debit captured value */ +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC2_CAP_SHFT 56 +#define SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT_VC2_CAP_MASK 0x7f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT 0x0000000150030270 +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_MASK 0x00007f7f7f7f7f7f +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_INIT 0x000000000c00000c + +/* SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC0_TEST_SHFT 0 +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC0_TEST_MASK 0x000000000000007f + +/* SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC0_DYN_SHFT 8 +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC0_DYN_MASK 0x0000000000007f00 + +/* SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC0_CAP_SHFT 16 +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC0_CAP_MASK 0x00000000007f0000 + +/* SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC2_TEST_SHFT 24 +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC2_TEST_MASK 0x000000007f000000 + +/* SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC2_DYN_SHFT 32 +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC2_DYN_MASK 0x0000007f00000000 + +/* SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC2_CAP_SHFT 40 +#define SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT_VC2_CAP_MASK 0x00007f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT 0x0000000150030280 +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_MASK 0x00007f7f7f7f7f7f +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_INIT 0x000000000c00000c + +/* SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC0_TEST_SHFT 0 +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC0_TEST_MASK 0x000000000000007f + +/* SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC0_DYN_SHFT 8 +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC0_DYN_MASK 0x0000000000007f00 + +/* SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC0_CAP_SHFT 16 +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC0_CAP_MASK 0x00000000007f0000 + +/* SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC2_TEST_SHFT 24 +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC2_TEST_MASK 0x000000007f000000 + +/* SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC2_DYN_SHFT 32 +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC2_DYN_MASK 0x0000007f00000000 + +/* SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC2_CAP_SHFT 40 +#define SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT_VC2_CAP_MASK 0x00007f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT 0x0000000150030290 +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_MASK 0x00007f7f7f7f7f7f +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_INIT 0x000000000c00000c + +/* SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC0_TEST_SHFT 0 +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC0_TEST_MASK 0x000000000000007f + +/* SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC0_DYN_SHFT 8 +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC0_DYN_MASK 0x0000000000007f00 + +/* SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC0_CAP_SHFT 16 +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC0_CAP_MASK 0x00000000007f0000 + +/* SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC2_TEST_SHFT 24 +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC2_TEST_MASK 0x000000007f000000 + +/* SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC2_DYN_SHFT 32 +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC2_DYN_MASK 0x0000007f00000000 + +/* SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC2_CAP_SHFT 40 +#define SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT_VC2_CAP_MASK 0x00007f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT 0x00000001500302a0 +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_MASK 0x00007f7f7f7f7f7f +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_INIT 0x000000000c00000c + +/* SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC0_TEST_SHFT 0 +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC0_TEST_MASK 0x000000000000007f + +/* SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC0_DYN_SHFT 8 +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC0_DYN_MASK 0x0000000000007f00 + +/* SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC0_CAP_SHFT 16 +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC0_CAP_MASK 0x00000000007f0000 + +/* SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC2_TEST_SHFT 24 +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC2_TEST_MASK 0x000000007f000000 + +/* SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC2_DYN_SHFT 32 +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC2_DYN_MASK 0x0000007f00000000 + +/* SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC2_CAP_SHFT 40 +#define SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT_VC2_CAP_MASK 0x00007f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT 0x00000001500302b0 +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_MASK 0x00007f7f7f7f7f7f +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_INIT 0x000000000c00000c + +/* SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC0_TEST_SHFT 0 +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC0_TEST_MASK 0x000000000000007f + +/* SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC0_DYN_SHFT 8 +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC0_DYN_MASK 0x0000000000007f00 + +/* SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC0_CAP_SHFT 16 +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC0_CAP_MASK 0x00000000007f0000 + +/* SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC2_TEST_SHFT 24 +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC2_TEST_MASK 0x000000007f000000 + +/* SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC2_DYN_SHFT 32 +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC2_DYN_MASK 0x0000007f00000000 + +/* SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC2_CAP_SHFT 40 +#define SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT_VC2_CAP_MASK 0x00007f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT 0x0000000150030300 +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_MASK 0x7f7f007f7f00bfbf +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_INIT 0x0000000000000000 + +/* SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC0_DYN */ +/* Description: vc0 debit dynamic value */ +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC0_DYN_SHFT 24 +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC0_DYN_MASK 0x000000007f000000 + +/* SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC0_CAP */ +/* Description: vc0 debit captured value */ +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC0_CAP_SHFT 32 +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC0_CAP_MASK 0x0000007f00000000 + +/* SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC2_DYN */ +/* Description: vc2 debit dynamic value */ +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC2_DYN_SHFT 48 +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC2_DYN_MASK 0x007f000000000000 + +/* SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC2_CAP */ +/* Description: vc2 debit captured value */ +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC2_CAP_SHFT 56 +#define SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT_VC2_CAP_MASK 0x7f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT 0x0000000150030310 +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_MASK 0x7f7f007f7f00bfbf +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_INIT 0x0000000000000000 + +/* SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC0_DYN */ +/* Description: vc0 debit dynamic value */ +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC0_DYN_SHFT 24 +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC0_DYN_MASK 0x000000007f000000 + +/* SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC0_CAP */ +/* Description: vc0 debit captured value */ +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC0_CAP_SHFT 32 +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC0_CAP_MASK 0x0000007f00000000 + +/* SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC2_DYN */ +/* Description: vc2 debit dynamic value */ +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC2_DYN_SHFT 48 +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC2_DYN_MASK 0x007f000000000000 + +/* SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC2_CAP */ +/* Description: vc2 debit captured value */ +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC2_CAP_SHFT 56 +#define SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT_VC2_CAP_MASK 0x7f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT 0x0000000150030320 +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_MASK 0x7f7f007f7f00bfbf +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_INIT 0x0000000000000000 + +/* SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC0_DYN */ +/* Description: vc0 debit dynamic value */ +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC0_DYN_SHFT 24 +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC0_DYN_MASK 0x000000007f000000 + +/* SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC0_CAP */ +/* Description: vc0 debit captured value */ +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC0_CAP_SHFT 32 +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC0_CAP_MASK 0x0000007f00000000 + +/* SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC2_DYN */ +/* Description: vc2 debit dynamic value */ +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC2_DYN_SHFT 48 +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC2_DYN_MASK 0x007f000000000000 + +/* SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC2_CAP */ +/* Description: vc2 debit captured value */ +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC2_CAP_SHFT 56 +#define SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT_VC2_CAP_MASK 0x7f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT 0x0000000150030330 +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_MASK 0x00007f7f7f7f7f7f +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_INIT 0x000000000c00000c + +/* SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC0_TEST_SHFT 0 +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC0_TEST_MASK 0x000000000000007f + +/* SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC0_DYN_SHFT 8 +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC0_DYN_MASK 0x0000000000007f00 + +/* SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC0_CAP_SHFT 16 +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC0_CAP_MASK 0x00000000007f0000 + +/* SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC2_TEST_SHFT 24 +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC2_TEST_MASK 0x000000007f000000 + +/* SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC2_DYN_SHFT 32 +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC2_DYN_MASK 0x0000007f00000000 + +/* SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC2_CAP_SHFT 40 +#define SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT_VC2_CAP_MASK 0x00007f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT 0x0000000150030340 +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_MASK 0x00007f7f7f7f7f7f +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_INIT 0x000000000c00000c + +/* SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC0_TEST_SHFT 0 +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC0_TEST_MASK 0x000000000000007f + +/* SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC0_DYN_SHFT 8 +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC0_DYN_MASK 0x0000000000007f00 + +/* SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC0_CAP_SHFT 16 +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC0_CAP_MASK 0x00000000007f0000 + +/* SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC2_TEST_SHFT 24 +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC2_TEST_MASK 0x000000007f000000 + +/* SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC2_DYN_SHFT 32 +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC2_DYN_MASK 0x0000007f00000000 + +/* SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC2_CAP_SHFT 40 +#define SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT_VC2_CAP_MASK 0x00007f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT 0x0000000150030350 +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_MASK 0x00007f7f7f7f7f7f +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_INIT 0x000000000c00000c + +/* SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC0_TEST_SHFT 0 +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC0_TEST_MASK 0x000000000000007f + +/* SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC0_DYN_SHFT 8 +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC0_DYN_MASK 0x0000000000007f00 + +/* SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC0_CAP_SHFT 16 +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC0_CAP_MASK 0x00000000007f0000 + +/* SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC2_TEST_SHFT 24 +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC2_TEST_MASK 0x000000007f000000 + +/* SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC2_DYN_SHFT 32 +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC2_DYN_MASK 0x0000007f00000000 + +/* SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC2_CAP_SHFT 40 +#define SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT_VC2_CAP_MASK 0x00007f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_0_INTRANI_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_0_INTRANI_FLOW 0x0000000150030360 +#define SH_XNNI0_0_INTRANI_FLOW_MASK 0x00000000000000bf +#define SH_XNNI0_0_INTRANI_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI0_0_INTRANI_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI0_0_INTRANI_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI0_0_INTRANI_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI0_0_INTRANI_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNNI0_0_INTRANI_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI0_0_INTRANI_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_XNNI0_1_INTRANI_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_1_INTRANI_FLOW 0x0000000150030370 +#define SH_XNNI0_1_INTRANI_FLOW_MASK 0x00000000000000bf +#define SH_XNNI0_1_INTRANI_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI0_1_INTRANI_FLOW_DEBIT_VC1_WITHHOLD */ +/* Description: vc1 withhold */ +#define SH_XNNI0_1_INTRANI_FLOW_DEBIT_VC1_WITHHOLD_SHFT 0 +#define SH_XNNI0_1_INTRANI_FLOW_DEBIT_VC1_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI0_1_INTRANI_FLOW_DEBIT_VC1_FORCE_CRED */ +/* Description: Force Credit on VC1 from debit cntr */ +#define SH_XNNI0_1_INTRANI_FLOW_DEBIT_VC1_FORCE_CRED_SHFT 7 +#define SH_XNNI0_1_INTRANI_FLOW_DEBIT_VC1_FORCE_CRED_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_XNNI0_2_INTRANI_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_2_INTRANI_FLOW 0x0000000150030380 +#define SH_XNNI0_2_INTRANI_FLOW_MASK 0x00000000000000bf +#define SH_XNNI0_2_INTRANI_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI0_2_INTRANI_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI0_2_INTRANI_FLOW_DEBIT_VC2_WITHHOLD_SHFT 0 +#define SH_XNNI0_2_INTRANI_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI0_2_INTRANI_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNNI0_2_INTRANI_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 7 +#define SH_XNNI0_2_INTRANI_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_XNNI0_3_INTRANI_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_3_INTRANI_FLOW 0x0000000150030390 +#define SH_XNNI0_3_INTRANI_FLOW_MASK 0x00000000000000bf +#define SH_XNNI0_3_INTRANI_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI0_3_INTRANI_FLOW_DEBIT_VC3_WITHHOLD */ +/* Description: vc3 withhold */ +#define SH_XNNI0_3_INTRANI_FLOW_DEBIT_VC3_WITHHOLD_SHFT 0 +#define SH_XNNI0_3_INTRANI_FLOW_DEBIT_VC3_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI0_3_INTRANI_FLOW_DEBIT_VC3_FORCE_CRED */ +/* Description: Force Credit on VC3 from debit cntr */ +#define SH_XNNI0_3_INTRANI_FLOW_DEBIT_VC3_FORCE_CRED_SHFT 7 +#define SH_XNNI0_3_INTRANI_FLOW_DEBIT_VC3_FORCE_CRED_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_XNNI0_VCSWITCH_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_VCSWITCH_FLOW 0x00000001500303a0 +#define SH_XNNI0_VCSWITCH_FLOW_MASK 0x0000000701010101 +#define SH_XNNI0_VCSWITCH_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI0_VCSWITCH_FLOW_NI_VCFIFO_DATELINE_SWITCH */ +/* Description: Swap VC0/2 with VC1/3 */ +#define SH_XNNI0_VCSWITCH_FLOW_NI_VCFIFO_DATELINE_SWITCH_SHFT 0 +#define SH_XNNI0_VCSWITCH_FLOW_NI_VCFIFO_DATELINE_SWITCH_MASK 0x0000000000000001 + +/* SH_XNNI0_VCSWITCH_FLOW_PI_VCFIFO_SWITCH */ +/* Description: Swap VC0/2 with VC1/3 */ +#define SH_XNNI0_VCSWITCH_FLOW_PI_VCFIFO_SWITCH_SHFT 8 +#define SH_XNNI0_VCSWITCH_FLOW_PI_VCFIFO_SWITCH_MASK 0x0000000000000100 + +/* SH_XNNI0_VCSWITCH_FLOW_MD_VCFIFO_SWITCH */ +/* Description: Swap VC0/2 with VC1/3 */ +#define SH_XNNI0_VCSWITCH_FLOW_MD_VCFIFO_SWITCH_SHFT 16 +#define SH_XNNI0_VCSWITCH_FLOW_MD_VCFIFO_SWITCH_MASK 0x0000000000010000 + +/* SH_XNNI0_VCSWITCH_FLOW_IILB_VCFIFO_SWITCH */ +/* Description: Swap VC0/2 with VC1/3 */ +#define SH_XNNI0_VCSWITCH_FLOW_IILB_VCFIFO_SWITCH_SHFT 24 +#define SH_XNNI0_VCSWITCH_FLOW_IILB_VCFIFO_SWITCH_MASK 0x0000000001000000 + +/* SH_XNNI0_VCSWITCH_FLOW_DISABLE_SYNC_BYPASS_IN */ +#define SH_XNNI0_VCSWITCH_FLOW_DISABLE_SYNC_BYPASS_IN_SHFT 32 +#define SH_XNNI0_VCSWITCH_FLOW_DISABLE_SYNC_BYPASS_IN_MASK 0x0000000100000000 + +/* SH_XNNI0_VCSWITCH_FLOW_DISABLE_SYNC_BYPASS_OUT */ +#define SH_XNNI0_VCSWITCH_FLOW_DISABLE_SYNC_BYPASS_OUT_SHFT 33 +#define SH_XNNI0_VCSWITCH_FLOW_DISABLE_SYNC_BYPASS_OUT_MASK 0x0000000200000000 + +/* SH_XNNI0_VCSWITCH_FLOW_ASYNC_FIFOES */ +#define SH_XNNI0_VCSWITCH_FLOW_ASYNC_FIFOES_SHFT 34 +#define SH_XNNI0_VCSWITCH_FLOW_ASYNC_FIFOES_MASK 0x0000000400000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_TIMER_REG" */ +/* ==================================================================== */ + +#define SH_XNNI0_TIMER_REG 0x00000001500303b0 +#define SH_XNNI0_TIMER_REG_MASK 0x0000000100ffffff +#define SH_XNNI0_TIMER_REG_INIT 0x0000000000ffffff + +/* SH_XNNI0_TIMER_REG_TIMEOUT_REG */ +/* Description: Master Timeout Counter */ +#define SH_XNNI0_TIMER_REG_TIMEOUT_REG_SHFT 0 +#define SH_XNNI0_TIMER_REG_TIMEOUT_REG_MASK 0x0000000000ffffff + +/* SH_XNNI0_TIMER_REG_LINKCLEANUP_REG */ +/* Description: Link Clean Up */ +#define SH_XNNI0_TIMER_REG_LINKCLEANUP_REG_SHFT 32 +#define SH_XNNI0_TIMER_REG_LINKCLEANUP_REG_MASK 0x0000000100000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_FIFO02_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_FIFO02_FLOW 0x00000001500303c0 +#define SH_XNNI0_FIFO02_FLOW_MASK 0x00000f0f0f0f0f0f +#define SH_XNNI0_FIFO02_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI0_FIFO02_FLOW_COUNT_VC0_LIMIT */ +/* Description: limit reg zero disables functionality */ +#define SH_XNNI0_FIFO02_FLOW_COUNT_VC0_LIMIT_SHFT 0 +#define SH_XNNI0_FIFO02_FLOW_COUNT_VC0_LIMIT_MASK 0x000000000000000f + +/* SH_XNNI0_FIFO02_FLOW_COUNT_VC0_DYN */ +/* Description: dynamic counter value */ +#define SH_XNNI0_FIFO02_FLOW_COUNT_VC0_DYN_SHFT 8 +#define SH_XNNI0_FIFO02_FLOW_COUNT_VC0_DYN_MASK 0x0000000000000f00 + +/* SH_XNNI0_FIFO02_FLOW_COUNT_VC0_CAP */ +/* Description: captured counter value */ +#define SH_XNNI0_FIFO02_FLOW_COUNT_VC0_CAP_SHFT 16 +#define SH_XNNI0_FIFO02_FLOW_COUNT_VC0_CAP_MASK 0x00000000000f0000 + +/* SH_XNNI0_FIFO02_FLOW_COUNT_VC2_LIMIT */ +/* Description: limit reg zero disables functionality */ +#define SH_XNNI0_FIFO02_FLOW_COUNT_VC2_LIMIT_SHFT 24 +#define SH_XNNI0_FIFO02_FLOW_COUNT_VC2_LIMIT_MASK 0x000000000f000000 + +/* SH_XNNI0_FIFO02_FLOW_COUNT_VC2_DYN */ +/* Description: counter dynamic value */ +#define SH_XNNI0_FIFO02_FLOW_COUNT_VC2_DYN_SHFT 32 +#define SH_XNNI0_FIFO02_FLOW_COUNT_VC2_DYN_MASK 0x0000000f00000000 + +/* SH_XNNI0_FIFO02_FLOW_COUNT_VC2_CAP */ +/* Description: captured counter value */ +#define SH_XNNI0_FIFO02_FLOW_COUNT_VC2_CAP_SHFT 40 +#define SH_XNNI0_FIFO02_FLOW_COUNT_VC2_CAP_MASK 0x00000f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_FIFO13_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_FIFO13_FLOW 0x00000001500303d0 +#define SH_XNNI0_FIFO13_FLOW_MASK 0x00000f0f0f0f0f0f +#define SH_XNNI0_FIFO13_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI0_FIFO13_FLOW_COUNT_VC1_LIMIT */ +/* Description: limit reg zero disables functionality */ +#define SH_XNNI0_FIFO13_FLOW_COUNT_VC1_LIMIT_SHFT 0 +#define SH_XNNI0_FIFO13_FLOW_COUNT_VC1_LIMIT_MASK 0x000000000000000f + +/* SH_XNNI0_FIFO13_FLOW_COUNT_VC1_DYN */ +/* Description: dynamic counter value */ +#define SH_XNNI0_FIFO13_FLOW_COUNT_VC1_DYN_SHFT 8 +#define SH_XNNI0_FIFO13_FLOW_COUNT_VC1_DYN_MASK 0x0000000000000f00 + +/* SH_XNNI0_FIFO13_FLOW_COUNT_VC1_CAP */ +/* Description: captured counter value */ +#define SH_XNNI0_FIFO13_FLOW_COUNT_VC1_CAP_SHFT 16 +#define SH_XNNI0_FIFO13_FLOW_COUNT_VC1_CAP_MASK 0x00000000000f0000 + +/* SH_XNNI0_FIFO13_FLOW_COUNT_VC3_LIMIT */ +/* Description: limit reg zero disables functionality */ +#define SH_XNNI0_FIFO13_FLOW_COUNT_VC3_LIMIT_SHFT 24 +#define SH_XNNI0_FIFO13_FLOW_COUNT_VC3_LIMIT_MASK 0x000000000f000000 + +/* SH_XNNI0_FIFO13_FLOW_COUNT_VC3_DYN */ +/* Description: counter dynamic value */ +#define SH_XNNI0_FIFO13_FLOW_COUNT_VC3_DYN_SHFT 32 +#define SH_XNNI0_FIFO13_FLOW_COUNT_VC3_DYN_MASK 0x0000000f00000000 + +/* SH_XNNI0_FIFO13_FLOW_COUNT_VC3_CAP */ +/* Description: captured counter value */ +#define SH_XNNI0_FIFO13_FLOW_COUNT_VC3_CAP_SHFT 40 +#define SH_XNNI0_FIFO13_FLOW_COUNT_VC3_CAP_MASK 0x00000f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_NI_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_NI_FLOW 0x00000001500303e0 +#define SH_XNNI0_NI_FLOW_MASK 0xff0fff0fff0fff0f +#define SH_XNNI0_NI_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI0_NI_FLOW_VC0_LIMIT */ +/* Description: vc0 limit reg, zero disables functionality */ +#define SH_XNNI0_NI_FLOW_VC0_LIMIT_SHFT 0 +#define SH_XNNI0_NI_FLOW_VC0_LIMIT_MASK 0x000000000000000f + +/* SH_XNNI0_NI_FLOW_VC0_DYN */ +/* Description: vc0 counter dynamic value */ +#define SH_XNNI0_NI_FLOW_VC0_DYN_SHFT 8 +#define SH_XNNI0_NI_FLOW_VC0_DYN_MASK 0x0000000000000f00 + +/* SH_XNNI0_NI_FLOW_VC0_CAP */ +/* Description: vc0 counter captured value */ +#define SH_XNNI0_NI_FLOW_VC0_CAP_SHFT 12 +#define SH_XNNI0_NI_FLOW_VC0_CAP_MASK 0x000000000000f000 + +/* SH_XNNI0_NI_FLOW_VC1_LIMIT */ +/* Description: vc1 limit reg, zero disables functionality */ +#define SH_XNNI0_NI_FLOW_VC1_LIMIT_SHFT 16 +#define SH_XNNI0_NI_FLOW_VC1_LIMIT_MASK 0x00000000000f0000 + +/* SH_XNNI0_NI_FLOW_VC1_DYN */ +/* Description: vc1 counter dynamic value */ +#define SH_XNNI0_NI_FLOW_VC1_DYN_SHFT 24 +#define SH_XNNI0_NI_FLOW_VC1_DYN_MASK 0x000000000f000000 + +/* SH_XNNI0_NI_FLOW_VC1_CAP */ +/* Description: vc1 counter captured value */ +#define SH_XNNI0_NI_FLOW_VC1_CAP_SHFT 28 +#define SH_XNNI0_NI_FLOW_VC1_CAP_MASK 0x00000000f0000000 + +/* SH_XNNI0_NI_FLOW_VC2_LIMIT */ +/* Description: vc2 limit reg, zero disables functionality */ +#define SH_XNNI0_NI_FLOW_VC2_LIMIT_SHFT 32 +#define SH_XNNI0_NI_FLOW_VC2_LIMIT_MASK 0x0000000f00000000 + +/* SH_XNNI0_NI_FLOW_VC2_DYN */ +/* Description: vc2 counter dynamic value */ +#define SH_XNNI0_NI_FLOW_VC2_DYN_SHFT 40 +#define SH_XNNI0_NI_FLOW_VC2_DYN_MASK 0x00000f0000000000 + +/* SH_XNNI0_NI_FLOW_VC2_CAP */ +/* Description: vc2 counter captured value */ +#define SH_XNNI0_NI_FLOW_VC2_CAP_SHFT 44 +#define SH_XNNI0_NI_FLOW_VC2_CAP_MASK 0x0000f00000000000 + +/* SH_XNNI0_NI_FLOW_VC3_LIMIT */ +/* Description: vc3 limit reg, zero disables functionality */ +#define SH_XNNI0_NI_FLOW_VC3_LIMIT_SHFT 48 +#define SH_XNNI0_NI_FLOW_VC3_LIMIT_MASK 0x000f000000000000 + +/* SH_XNNI0_NI_FLOW_VC3_DYN */ +/* Description: vc3 counter dynamic value */ +#define SH_XNNI0_NI_FLOW_VC3_DYN_SHFT 56 +#define SH_XNNI0_NI_FLOW_VC3_DYN_MASK 0x0f00000000000000 + +/* SH_XNNI0_NI_FLOW_VC3_CAP */ +/* Description: vc3 counter captured value */ +#define SH_XNNI0_NI_FLOW_VC3_CAP_SHFT 60 +#define SH_XNNI0_NI_FLOW_VC3_CAP_MASK 0xf000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_DEAD_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI0_DEAD_FLOW 0x00000001500303f0 +#define SH_XNNI0_DEAD_FLOW_MASK 0xff0fff0fff0fff0f +#define SH_XNNI0_DEAD_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI0_DEAD_FLOW_VC0_LIMIT */ +/* Description: vc0 limit reg, zero disables functionality */ +#define SH_XNNI0_DEAD_FLOW_VC0_LIMIT_SHFT 0 +#define SH_XNNI0_DEAD_FLOW_VC0_LIMIT_MASK 0x000000000000000f + +/* SH_XNNI0_DEAD_FLOW_VC0_DYN */ +/* Description: vc0 counter dynamic value */ +#define SH_XNNI0_DEAD_FLOW_VC0_DYN_SHFT 8 +#define SH_XNNI0_DEAD_FLOW_VC0_DYN_MASK 0x0000000000000f00 + +/* SH_XNNI0_DEAD_FLOW_VC0_CAP */ +/* Description: vc0 counter captured value */ +#define SH_XNNI0_DEAD_FLOW_VC0_CAP_SHFT 12 +#define SH_XNNI0_DEAD_FLOW_VC0_CAP_MASK 0x000000000000f000 + +/* SH_XNNI0_DEAD_FLOW_VC1_LIMIT */ +/* Description: vc1 limit reg, zero disables functionality */ +#define SH_XNNI0_DEAD_FLOW_VC1_LIMIT_SHFT 16 +#define SH_XNNI0_DEAD_FLOW_VC1_LIMIT_MASK 0x00000000000f0000 + +/* SH_XNNI0_DEAD_FLOW_VC1_DYN */ +/* Description: vc1 counter dynamic value */ +#define SH_XNNI0_DEAD_FLOW_VC1_DYN_SHFT 24 +#define SH_XNNI0_DEAD_FLOW_VC1_DYN_MASK 0x000000000f000000 + +/* SH_XNNI0_DEAD_FLOW_VC1_CAP */ +/* Description: vc1 counter captured value */ +#define SH_XNNI0_DEAD_FLOW_VC1_CAP_SHFT 28 +#define SH_XNNI0_DEAD_FLOW_VC1_CAP_MASK 0x00000000f0000000 + +/* SH_XNNI0_DEAD_FLOW_VC2_LIMIT */ +/* Description: vc2 limit reg, zero disables functionality */ +#define SH_XNNI0_DEAD_FLOW_VC2_LIMIT_SHFT 32 +#define SH_XNNI0_DEAD_FLOW_VC2_LIMIT_MASK 0x0000000f00000000 + +/* SH_XNNI0_DEAD_FLOW_VC2_DYN */ +/* Description: vc2 counter dynamic value */ +#define SH_XNNI0_DEAD_FLOW_VC2_DYN_SHFT 40 +#define SH_XNNI0_DEAD_FLOW_VC2_DYN_MASK 0x00000f0000000000 + +/* SH_XNNI0_DEAD_FLOW_VC2_CAP */ +/* Description: vc2 counter captured value */ +#define SH_XNNI0_DEAD_FLOW_VC2_CAP_SHFT 44 +#define SH_XNNI0_DEAD_FLOW_VC2_CAP_MASK 0x0000f00000000000 + +/* SH_XNNI0_DEAD_FLOW_VC3_LIMIT */ +/* Description: vc3 limit reg, zero disables functionality */ +#define SH_XNNI0_DEAD_FLOW_VC3_LIMIT_SHFT 48 +#define SH_XNNI0_DEAD_FLOW_VC3_LIMIT_MASK 0x000f000000000000 + +/* SH_XNNI0_DEAD_FLOW_VC3_DYN */ +/* Description: vc3 counter dynamic value */ +#define SH_XNNI0_DEAD_FLOW_VC3_DYN_SHFT 56 +#define SH_XNNI0_DEAD_FLOW_VC3_DYN_MASK 0x0f00000000000000 + +/* SH_XNNI0_DEAD_FLOW_VC3_CAP */ +/* Description: vc3 counter captured value */ +#define SH_XNNI0_DEAD_FLOW_VC3_CAP_SHFT 60 +#define SH_XNNI0_DEAD_FLOW_VC3_CAP_MASK 0xf000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI0_INJECT_AGE" */ +/* ==================================================================== */ + +#define SH_XNNI0_INJECT_AGE 0x0000000150030400 +#define SH_XNNI0_INJECT_AGE_MASK 0x000000000000ffff +#define SH_XNNI0_INJECT_AGE_INIT 0x0000000000000000 + +/* SH_XNNI0_INJECT_AGE_REQUEST_INJECT */ +/* Description: Value of AGE field for outgoing requests */ +#define SH_XNNI0_INJECT_AGE_REQUEST_INJECT_SHFT 0 +#define SH_XNNI0_INJECT_AGE_REQUEST_INJECT_MASK 0x00000000000000ff + +/* SH_XNNI0_INJECT_AGE_REPLY_INJECT */ +/* Description: Value of AGE field for outgoing replies */ +#define SH_XNNI0_INJECT_AGE_REPLY_INJECT_SHFT 8 +#define SH_XNNI0_INJECT_AGE_REPLY_INJECT_MASK 0x000000000000ff00 + +/* ==================================================================== */ +/* Register "SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT 0x0000000150030500 +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_MASK 0x7f7f007f7f00bfbf +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_INIT 0x0000000000000000 + +/* SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC0_DYN */ +/* Description: vc0 debit dynamic value */ +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC0_DYN_SHFT 24 +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC0_DYN_MASK 0x000000007f000000 + +/* SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC0_CAP */ +/* Description: vc0 debit captured value */ +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC0_CAP_SHFT 32 +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC0_CAP_MASK 0x0000007f00000000 + +/* SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC2_DYN */ +/* Description: vc2 debit dynamic value */ +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC2_DYN_SHFT 48 +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC2_DYN_MASK 0x007f000000000000 + +/* SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC2_CAP */ +/* Description: vc2 debit captured value */ +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC2_CAP_SHFT 56 +#define SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT_VC2_CAP_MASK 0x7f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT 0x0000000150030510 +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_MASK 0x7f7f007f7f00bfbf +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_INIT 0x0000000000000000 + +/* SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC0_DYN */ +/* Description: vc0 debit dynamic value */ +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC0_DYN_SHFT 24 +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC0_DYN_MASK 0x000000007f000000 + +/* SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC0_CAP */ +/* Description: vc0 debit captured value */ +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC0_CAP_SHFT 32 +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC0_CAP_MASK 0x0000007f00000000 + +/* SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC2_DYN */ +/* Description: vc2 debit dynamic value */ +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC2_DYN_SHFT 48 +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC2_DYN_MASK 0x007f000000000000 + +/* SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC2_CAP */ +/* Description: vc2 debit captured value */ +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC2_CAP_SHFT 56 +#define SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT_VC2_CAP_MASK 0x7f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT 0x0000000150030520 +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_MASK 0x7f7f007f7f00bfbf +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_INIT 0x0000000000000000 + +/* SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC2_WITHHOLD_SHFT 8 +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x0000000000003f00 + +/* SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 15 +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000008000 + +/* SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC0_DYN */ +/* Description: vc0 debit dynamic value */ +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC0_DYN_SHFT 24 +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC0_DYN_MASK 0x000000007f000000 + +/* SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC0_CAP */ +/* Description: vc0 debit captured value */ +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC0_CAP_SHFT 32 +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC0_CAP_MASK 0x0000007f00000000 + +/* SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC2_DYN */ +/* Description: vc2 debit dynamic value */ +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC2_DYN_SHFT 48 +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC2_DYN_MASK 0x007f000000000000 + +/* SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC2_CAP */ +/* Description: vc2 debit captured value */ +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC2_CAP_SHFT 56 +#define SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT_VC2_CAP_MASK 0x7f00000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT 0x0000000150030530 +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_MASK 0x00007f7f7f7f7f7f +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_INIT 0x000000000c00000c + +/* SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC0_TEST_SHFT 0 +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC0_TEST_MASK 0x000000000000007f + +/* SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC0_DYN_SHFT 8 +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC0_DYN_MASK 0x0000000000007f00 + +/* SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC0_CAP_SHFT 16 +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC0_CAP_MASK 0x00000000007f0000 + +/* SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC2_TEST_SHFT 24 +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC2_TEST_MASK 0x000000007f000000 + +/* SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC2_DYN_SHFT 32 +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC2_DYN_MASK 0x0000007f00000000 + +/* SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC2_CAP_SHFT 40 +#define SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT_VC2_CAP_MASK 0x00007f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT 0x0000000150030540 +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_MASK 0x00007f7f7f7f7f7f +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_INIT 0x000000000c00000c + +/* SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC0_TEST_SHFT 0 +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC0_TEST_MASK 0x000000000000007f + +/* SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC0_DYN_SHFT 8 +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC0_DYN_MASK 0x0000000000007f00 + +/* SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC0_CAP_SHFT 16 +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC0_CAP_MASK 0x00000000007f0000 + +/* SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC2_TEST_SHFT 24 +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC2_TEST_MASK 0x000000007f000000 + +/* SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC2_DYN_SHFT 32 +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC2_DYN_MASK 0x0000007f00000000 + +/* SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC2_CAP_SHFT 40 +#define SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT_VC2_CAP_MASK 0x00007f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT 0x0000000150030550 +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_MASK 0x00007f7f7f7f7f7f +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_INIT 0x000000000c00000c + +/* SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC0_TEST */ +/* Description: vc0 credit_test */ +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC0_TEST_SHFT 0 +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC0_TEST_MASK 0x000000000000007f + +/* SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC0_DYN */ +/* Description: vc0 credit dynamic value */ +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC0_DYN_SHFT 8 +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC0_DYN_MASK 0x0000000000007f00 + +/* SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC0_CAP */ +/* Description: vc0 credit captured value */ +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC0_CAP_SHFT 16 +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC0_CAP_MASK 0x00000000007f0000 + +/* SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC2_TEST */ +/* Description: vc2 credit_test */ +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC2_TEST_SHFT 24 +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC2_TEST_MASK 0x000000007f000000 + +/* SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC2_DYN */ +/* Description: vc2 credit dynamic value */ +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC2_DYN_SHFT 32 +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC2_DYN_MASK 0x0000007f00000000 + +/* SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC2_CAP */ +/* Description: vc2 credit captured value */ +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC2_CAP_SHFT 40 +#define SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT_VC2_CAP_MASK 0x00007f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_0_INTRANI_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_0_INTRANI_FLOW 0x0000000150030560 +#define SH_XNNI1_0_INTRANI_FLOW_MASK 0x00000000000000bf +#define SH_XNNI1_0_INTRANI_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI1_0_INTRANI_FLOW_DEBIT_VC0_WITHHOLD */ +/* Description: vc0 withhold */ +#define SH_XNNI1_0_INTRANI_FLOW_DEBIT_VC0_WITHHOLD_SHFT 0 +#define SH_XNNI1_0_INTRANI_FLOW_DEBIT_VC0_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI1_0_INTRANI_FLOW_DEBIT_VC0_FORCE_CRED */ +/* Description: Force Credit on VC0 from debit cntr */ +#define SH_XNNI1_0_INTRANI_FLOW_DEBIT_VC0_FORCE_CRED_SHFT 7 +#define SH_XNNI1_0_INTRANI_FLOW_DEBIT_VC0_FORCE_CRED_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_XNNI1_1_INTRANI_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_1_INTRANI_FLOW 0x0000000150030570 +#define SH_XNNI1_1_INTRANI_FLOW_MASK 0x00000000000000bf +#define SH_XNNI1_1_INTRANI_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI1_1_INTRANI_FLOW_DEBIT_VC1_WITHHOLD */ +/* Description: vc1 withhold */ +#define SH_XNNI1_1_INTRANI_FLOW_DEBIT_VC1_WITHHOLD_SHFT 0 +#define SH_XNNI1_1_INTRANI_FLOW_DEBIT_VC1_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI1_1_INTRANI_FLOW_DEBIT_VC1_FORCE_CRED */ +/* Description: Force Credit on VC1 from debit cntr */ +#define SH_XNNI1_1_INTRANI_FLOW_DEBIT_VC1_FORCE_CRED_SHFT 7 +#define SH_XNNI1_1_INTRANI_FLOW_DEBIT_VC1_FORCE_CRED_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_XNNI1_2_INTRANI_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_2_INTRANI_FLOW 0x0000000150030580 +#define SH_XNNI1_2_INTRANI_FLOW_MASK 0x00000000000000bf +#define SH_XNNI1_2_INTRANI_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI1_2_INTRANI_FLOW_DEBIT_VC2_WITHHOLD */ +/* Description: vc2 withhold */ +#define SH_XNNI1_2_INTRANI_FLOW_DEBIT_VC2_WITHHOLD_SHFT 0 +#define SH_XNNI1_2_INTRANI_FLOW_DEBIT_VC2_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI1_2_INTRANI_FLOW_DEBIT_VC2_FORCE_CRED */ +/* Description: Force Credit on VC2 from debit cntr */ +#define SH_XNNI1_2_INTRANI_FLOW_DEBIT_VC2_FORCE_CRED_SHFT 7 +#define SH_XNNI1_2_INTRANI_FLOW_DEBIT_VC2_FORCE_CRED_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_XNNI1_3_INTRANI_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_3_INTRANI_FLOW 0x0000000150030590 +#define SH_XNNI1_3_INTRANI_FLOW_MASK 0x00000000000000bf +#define SH_XNNI1_3_INTRANI_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI1_3_INTRANI_FLOW_DEBIT_VC3_WITHHOLD */ +/* Description: vc3 withhold */ +#define SH_XNNI1_3_INTRANI_FLOW_DEBIT_VC3_WITHHOLD_SHFT 0 +#define SH_XNNI1_3_INTRANI_FLOW_DEBIT_VC3_WITHHOLD_MASK 0x000000000000003f + +/* SH_XNNI1_3_INTRANI_FLOW_DEBIT_VC3_FORCE_CRED */ +/* Description: Force Credit on VC3 from debit cntr */ +#define SH_XNNI1_3_INTRANI_FLOW_DEBIT_VC3_FORCE_CRED_SHFT 7 +#define SH_XNNI1_3_INTRANI_FLOW_DEBIT_VC3_FORCE_CRED_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_XNNI1_VCSWITCH_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_VCSWITCH_FLOW 0x00000001500305a0 +#define SH_XNNI1_VCSWITCH_FLOW_MASK 0x0000000701010101 +#define SH_XNNI1_VCSWITCH_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI1_VCSWITCH_FLOW_NI_VCFIFO_DATELINE_SWITCH */ +/* Description: Swap VC0/2 with VC1/3 */ +#define SH_XNNI1_VCSWITCH_FLOW_NI_VCFIFO_DATELINE_SWITCH_SHFT 0 +#define SH_XNNI1_VCSWITCH_FLOW_NI_VCFIFO_DATELINE_SWITCH_MASK 0x0000000000000001 + +/* SH_XNNI1_VCSWITCH_FLOW_PI_VCFIFO_SWITCH */ +/* Description: Swap VC0/2 with VC1/3 */ +#define SH_XNNI1_VCSWITCH_FLOW_PI_VCFIFO_SWITCH_SHFT 8 +#define SH_XNNI1_VCSWITCH_FLOW_PI_VCFIFO_SWITCH_MASK 0x0000000000000100 + +/* SH_XNNI1_VCSWITCH_FLOW_MD_VCFIFO_SWITCH */ +/* Description: Swap VC0/2 with VC1/3 */ +#define SH_XNNI1_VCSWITCH_FLOW_MD_VCFIFO_SWITCH_SHFT 16 +#define SH_XNNI1_VCSWITCH_FLOW_MD_VCFIFO_SWITCH_MASK 0x0000000000010000 + +/* SH_XNNI1_VCSWITCH_FLOW_IILB_VCFIFO_SWITCH */ +/* Description: Swap VC0/2 with VC1/3 */ +#define SH_XNNI1_VCSWITCH_FLOW_IILB_VCFIFO_SWITCH_SHFT 24 +#define SH_XNNI1_VCSWITCH_FLOW_IILB_VCFIFO_SWITCH_MASK 0x0000000001000000 + +/* SH_XNNI1_VCSWITCH_FLOW_DISABLE_SYNC_BYPASS_IN */ +#define SH_XNNI1_VCSWITCH_FLOW_DISABLE_SYNC_BYPASS_IN_SHFT 32 +#define SH_XNNI1_VCSWITCH_FLOW_DISABLE_SYNC_BYPASS_IN_MASK 0x0000000100000000 + +/* SH_XNNI1_VCSWITCH_FLOW_DISABLE_SYNC_BYPASS_OUT */ +#define SH_XNNI1_VCSWITCH_FLOW_DISABLE_SYNC_BYPASS_OUT_SHFT 33 +#define SH_XNNI1_VCSWITCH_FLOW_DISABLE_SYNC_BYPASS_OUT_MASK 0x0000000200000000 + +/* SH_XNNI1_VCSWITCH_FLOW_ASYNC_FIFOES */ +#define SH_XNNI1_VCSWITCH_FLOW_ASYNC_FIFOES_SHFT 34 +#define SH_XNNI1_VCSWITCH_FLOW_ASYNC_FIFOES_MASK 0x0000000400000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_TIMER_REG" */ +/* ==================================================================== */ + +#define SH_XNNI1_TIMER_REG 0x00000001500305b0 +#define SH_XNNI1_TIMER_REG_MASK 0x0000000100ffffff +#define SH_XNNI1_TIMER_REG_INIT 0x0000000000ffffff + +/* SH_XNNI1_TIMER_REG_TIMEOUT_REG */ +/* Description: Master Timeout Counter */ +#define SH_XNNI1_TIMER_REG_TIMEOUT_REG_SHFT 0 +#define SH_XNNI1_TIMER_REG_TIMEOUT_REG_MASK 0x0000000000ffffff + +/* SH_XNNI1_TIMER_REG_LINKCLEANUP_REG */ +/* Description: Link Clean Up */ +#define SH_XNNI1_TIMER_REG_LINKCLEANUP_REG_SHFT 32 +#define SH_XNNI1_TIMER_REG_LINKCLEANUP_REG_MASK 0x0000000100000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_FIFO02_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_FIFO02_FLOW 0x00000001500305c0 +#define SH_XNNI1_FIFO02_FLOW_MASK 0x00000f0f0f0f0f0f +#define SH_XNNI1_FIFO02_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI1_FIFO02_FLOW_COUNT_VC0_LIMIT */ +/* Description: limit reg zero disables functionality */ +#define SH_XNNI1_FIFO02_FLOW_COUNT_VC0_LIMIT_SHFT 0 +#define SH_XNNI1_FIFO02_FLOW_COUNT_VC0_LIMIT_MASK 0x000000000000000f + +/* SH_XNNI1_FIFO02_FLOW_COUNT_VC0_DYN */ +/* Description: dynamic counter value */ +#define SH_XNNI1_FIFO02_FLOW_COUNT_VC0_DYN_SHFT 8 +#define SH_XNNI1_FIFO02_FLOW_COUNT_VC0_DYN_MASK 0x0000000000000f00 + +/* SH_XNNI1_FIFO02_FLOW_COUNT_VC0_CAP */ +/* Description: captured counter value */ +#define SH_XNNI1_FIFO02_FLOW_COUNT_VC0_CAP_SHFT 16 +#define SH_XNNI1_FIFO02_FLOW_COUNT_VC0_CAP_MASK 0x00000000000f0000 + +/* SH_XNNI1_FIFO02_FLOW_COUNT_VC2_LIMIT */ +/* Description: limit reg zero disables functionality */ +#define SH_XNNI1_FIFO02_FLOW_COUNT_VC2_LIMIT_SHFT 24 +#define SH_XNNI1_FIFO02_FLOW_COUNT_VC2_LIMIT_MASK 0x000000000f000000 + +/* SH_XNNI1_FIFO02_FLOW_COUNT_VC2_DYN */ +/* Description: counter dynamic value */ +#define SH_XNNI1_FIFO02_FLOW_COUNT_VC2_DYN_SHFT 32 +#define SH_XNNI1_FIFO02_FLOW_COUNT_VC2_DYN_MASK 0x0000000f00000000 + +/* SH_XNNI1_FIFO02_FLOW_COUNT_VC2_CAP */ +/* Description: captured counter value */ +#define SH_XNNI1_FIFO02_FLOW_COUNT_VC2_CAP_SHFT 40 +#define SH_XNNI1_FIFO02_FLOW_COUNT_VC2_CAP_MASK 0x00000f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_FIFO13_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_FIFO13_FLOW 0x00000001500305d0 +#define SH_XNNI1_FIFO13_FLOW_MASK 0x00000f0f0f0f0f0f +#define SH_XNNI1_FIFO13_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI1_FIFO13_FLOW_COUNT_VC1_LIMIT */ +/* Description: limit reg zero disables functionality */ +#define SH_XNNI1_FIFO13_FLOW_COUNT_VC1_LIMIT_SHFT 0 +#define SH_XNNI1_FIFO13_FLOW_COUNT_VC1_LIMIT_MASK 0x000000000000000f + +/* SH_XNNI1_FIFO13_FLOW_COUNT_VC1_DYN */ +/* Description: dynamic counter value */ +#define SH_XNNI1_FIFO13_FLOW_COUNT_VC1_DYN_SHFT 8 +#define SH_XNNI1_FIFO13_FLOW_COUNT_VC1_DYN_MASK 0x0000000000000f00 + +/* SH_XNNI1_FIFO13_FLOW_COUNT_VC1_CAP */ +/* Description: captured counter value */ +#define SH_XNNI1_FIFO13_FLOW_COUNT_VC1_CAP_SHFT 16 +#define SH_XNNI1_FIFO13_FLOW_COUNT_VC1_CAP_MASK 0x00000000000f0000 + +/* SH_XNNI1_FIFO13_FLOW_COUNT_VC3_LIMIT */ +/* Description: limit reg zero disables functionality */ +#define SH_XNNI1_FIFO13_FLOW_COUNT_VC3_LIMIT_SHFT 24 +#define SH_XNNI1_FIFO13_FLOW_COUNT_VC3_LIMIT_MASK 0x000000000f000000 + +/* SH_XNNI1_FIFO13_FLOW_COUNT_VC3_DYN */ +/* Description: counter dynamic value */ +#define SH_XNNI1_FIFO13_FLOW_COUNT_VC3_DYN_SHFT 32 +#define SH_XNNI1_FIFO13_FLOW_COUNT_VC3_DYN_MASK 0x0000000f00000000 + +/* SH_XNNI1_FIFO13_FLOW_COUNT_VC3_CAP */ +/* Description: captured counter value */ +#define SH_XNNI1_FIFO13_FLOW_COUNT_VC3_CAP_SHFT 40 +#define SH_XNNI1_FIFO13_FLOW_COUNT_VC3_CAP_MASK 0x00000f0000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_NI_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_NI_FLOW 0x00000001500305e0 +#define SH_XNNI1_NI_FLOW_MASK 0xff0fff0fff0fff0f +#define SH_XNNI1_NI_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI1_NI_FLOW_VC0_LIMIT */ +/* Description: vc0 limit reg, zero disables functionality */ +#define SH_XNNI1_NI_FLOW_VC0_LIMIT_SHFT 0 +#define SH_XNNI1_NI_FLOW_VC0_LIMIT_MASK 0x000000000000000f + +/* SH_XNNI1_NI_FLOW_VC0_DYN */ +/* Description: vc0 counter dynamic value */ +#define SH_XNNI1_NI_FLOW_VC0_DYN_SHFT 8 +#define SH_XNNI1_NI_FLOW_VC0_DYN_MASK 0x0000000000000f00 + +/* SH_XNNI1_NI_FLOW_VC0_CAP */ +/* Description: vc0 counter captured value */ +#define SH_XNNI1_NI_FLOW_VC0_CAP_SHFT 12 +#define SH_XNNI1_NI_FLOW_VC0_CAP_MASK 0x000000000000f000 + +/* SH_XNNI1_NI_FLOW_VC1_LIMIT */ +/* Description: vc1 limit reg, zero disables functionality */ +#define SH_XNNI1_NI_FLOW_VC1_LIMIT_SHFT 16 +#define SH_XNNI1_NI_FLOW_VC1_LIMIT_MASK 0x00000000000f0000 + +/* SH_XNNI1_NI_FLOW_VC1_DYN */ +/* Description: vc1 counter dynamic value */ +#define SH_XNNI1_NI_FLOW_VC1_DYN_SHFT 24 +#define SH_XNNI1_NI_FLOW_VC1_DYN_MASK 0x000000000f000000 + +/* SH_XNNI1_NI_FLOW_VC1_CAP */ +/* Description: vc1 counter captured value */ +#define SH_XNNI1_NI_FLOW_VC1_CAP_SHFT 28 +#define SH_XNNI1_NI_FLOW_VC1_CAP_MASK 0x00000000f0000000 + +/* SH_XNNI1_NI_FLOW_VC2_LIMIT */ +/* Description: vc2 limit reg, zero disables functionality */ +#define SH_XNNI1_NI_FLOW_VC2_LIMIT_SHFT 32 +#define SH_XNNI1_NI_FLOW_VC2_LIMIT_MASK 0x0000000f00000000 + +/* SH_XNNI1_NI_FLOW_VC2_DYN */ +/* Description: vc2 counter dynamic value */ +#define SH_XNNI1_NI_FLOW_VC2_DYN_SHFT 40 +#define SH_XNNI1_NI_FLOW_VC2_DYN_MASK 0x00000f0000000000 + +/* SH_XNNI1_NI_FLOW_VC2_CAP */ +/* Description: vc2 counter captured value */ +#define SH_XNNI1_NI_FLOW_VC2_CAP_SHFT 44 +#define SH_XNNI1_NI_FLOW_VC2_CAP_MASK 0x0000f00000000000 + +/* SH_XNNI1_NI_FLOW_VC3_LIMIT */ +/* Description: vc3 limit reg, zero disables functionality */ +#define SH_XNNI1_NI_FLOW_VC3_LIMIT_SHFT 48 +#define SH_XNNI1_NI_FLOW_VC3_LIMIT_MASK 0x000f000000000000 + +/* SH_XNNI1_NI_FLOW_VC3_DYN */ +/* Description: vc3 counter dynamic value */ +#define SH_XNNI1_NI_FLOW_VC3_DYN_SHFT 56 +#define SH_XNNI1_NI_FLOW_VC3_DYN_MASK 0x0f00000000000000 + +/* SH_XNNI1_NI_FLOW_VC3_CAP */ +/* Description: vc3 counter captured value */ +#define SH_XNNI1_NI_FLOW_VC3_CAP_SHFT 60 +#define SH_XNNI1_NI_FLOW_VC3_CAP_MASK 0xf000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_DEAD_FLOW" */ +/* ==================================================================== */ + +#define SH_XNNI1_DEAD_FLOW 0x00000001500305f0 +#define SH_XNNI1_DEAD_FLOW_MASK 0xff0fff0fff0fff0f +#define SH_XNNI1_DEAD_FLOW_INIT 0x0000000000000000 + +/* SH_XNNI1_DEAD_FLOW_VC0_LIMIT */ +/* Description: vc0 limit reg, zero disables functionality */ +#define SH_XNNI1_DEAD_FLOW_VC0_LIMIT_SHFT 0 +#define SH_XNNI1_DEAD_FLOW_VC0_LIMIT_MASK 0x000000000000000f + +/* SH_XNNI1_DEAD_FLOW_VC0_DYN */ +/* Description: vc0 counter dynamic value */ +#define SH_XNNI1_DEAD_FLOW_VC0_DYN_SHFT 8 +#define SH_XNNI1_DEAD_FLOW_VC0_DYN_MASK 0x0000000000000f00 + +/* SH_XNNI1_DEAD_FLOW_VC0_CAP */ +/* Description: vc0 counter captured value */ +#define SH_XNNI1_DEAD_FLOW_VC0_CAP_SHFT 12 +#define SH_XNNI1_DEAD_FLOW_VC0_CAP_MASK 0x000000000000f000 + +/* SH_XNNI1_DEAD_FLOW_VC1_LIMIT */ +/* Description: vc1 limit reg, zero disables functionality */ +#define SH_XNNI1_DEAD_FLOW_VC1_LIMIT_SHFT 16 +#define SH_XNNI1_DEAD_FLOW_VC1_LIMIT_MASK 0x00000000000f0000 + +/* SH_XNNI1_DEAD_FLOW_VC1_DYN */ +/* Description: vc1 counter dynamic value */ +#define SH_XNNI1_DEAD_FLOW_VC1_DYN_SHFT 24 +#define SH_XNNI1_DEAD_FLOW_VC1_DYN_MASK 0x000000000f000000 + +/* SH_XNNI1_DEAD_FLOW_VC1_CAP */ +/* Description: vc1 counter captured value */ +#define SH_XNNI1_DEAD_FLOW_VC1_CAP_SHFT 28 +#define SH_XNNI1_DEAD_FLOW_VC1_CAP_MASK 0x00000000f0000000 + +/* SH_XNNI1_DEAD_FLOW_VC2_LIMIT */ +/* Description: vc2 limit reg, zero disables functionality */ +#define SH_XNNI1_DEAD_FLOW_VC2_LIMIT_SHFT 32 +#define SH_XNNI1_DEAD_FLOW_VC2_LIMIT_MASK 0x0000000f00000000 + +/* SH_XNNI1_DEAD_FLOW_VC2_DYN */ +/* Description: vc2 counter dynamic value */ +#define SH_XNNI1_DEAD_FLOW_VC2_DYN_SHFT 40 +#define SH_XNNI1_DEAD_FLOW_VC2_DYN_MASK 0x00000f0000000000 + +/* SH_XNNI1_DEAD_FLOW_VC2_CAP */ +/* Description: vc2 counter captured value */ +#define SH_XNNI1_DEAD_FLOW_VC2_CAP_SHFT 44 +#define SH_XNNI1_DEAD_FLOW_VC2_CAP_MASK 0x0000f00000000000 + +/* SH_XNNI1_DEAD_FLOW_VC3_LIMIT */ +/* Description: vc3 limit reg, zero disables functionality */ +#define SH_XNNI1_DEAD_FLOW_VC3_LIMIT_SHFT 48 +#define SH_XNNI1_DEAD_FLOW_VC3_LIMIT_MASK 0x000f000000000000 + +/* SH_XNNI1_DEAD_FLOW_VC3_DYN */ +/* Description: vc3 counter dynamic value */ +#define SH_XNNI1_DEAD_FLOW_VC3_DYN_SHFT 56 +#define SH_XNNI1_DEAD_FLOW_VC3_DYN_MASK 0x0f00000000000000 + +/* SH_XNNI1_DEAD_FLOW_VC3_CAP */ +/* Description: vc3 counter captured value */ +#define SH_XNNI1_DEAD_FLOW_VC3_CAP_SHFT 60 +#define SH_XNNI1_DEAD_FLOW_VC3_CAP_MASK 0xf000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNNI1_INJECT_AGE" */ +/* ==================================================================== */ + +#define SH_XNNI1_INJECT_AGE 0x0000000150030600 +#define SH_XNNI1_INJECT_AGE_MASK 0x000000000000ffff +#define SH_XNNI1_INJECT_AGE_INIT 0x0000000000000000 + +/* SH_XNNI1_INJECT_AGE_REQUEST_INJECT */ +/* Description: Value of AGE field for outgoing requests */ +#define SH_XNNI1_INJECT_AGE_REQUEST_INJECT_SHFT 0 +#define SH_XNNI1_INJECT_AGE_REQUEST_INJECT_MASK 0x00000000000000ff + +/* SH_XNNI1_INJECT_AGE_REPLY_INJECT */ +/* Description: Value of AGE field for outgoing replies */ +#define SH_XNNI1_INJECT_AGE_REPLY_INJECT_SHFT 8 +#define SH_XNNI1_INJECT_AGE_REPLY_INJECT_MASK 0x000000000000ff00 + +/* ==================================================================== */ +/* Register "SH_XN_DEBUG_SEL" */ +/* XN Debug Port Select */ +/* ==================================================================== */ + +#define SH_XN_DEBUG_SEL 0x0000000150031000 +#define SH_XN_DEBUG_SEL_MASK 0xf777777777777777 +#define SH_XN_DEBUG_SEL_INIT 0x0000000000000000 + +/* SH_XN_DEBUG_SEL_NIBBLE0_RLM_SEL */ +/* Description: Nibble 0 RLM select */ +#define SH_XN_DEBUG_SEL_NIBBLE0_RLM_SEL_SHFT 0 +#define SH_XN_DEBUG_SEL_NIBBLE0_RLM_SEL_MASK 0x0000000000000007 + +/* SH_XN_DEBUG_SEL_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_XN_DEBUG_SEL_NIBBLE0_NIBBLE_SEL_SHFT 4 +#define SH_XN_DEBUG_SEL_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_XN_DEBUG_SEL_NIBBLE1_RLM_SEL */ +/* Description: Nibble 1 RLM select */ +#define SH_XN_DEBUG_SEL_NIBBLE1_RLM_SEL_SHFT 8 +#define SH_XN_DEBUG_SEL_NIBBLE1_RLM_SEL_MASK 0x0000000000000700 + +/* SH_XN_DEBUG_SEL_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_XN_DEBUG_SEL_NIBBLE1_NIBBLE_SEL_SHFT 12 +#define SH_XN_DEBUG_SEL_NIBBLE1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_XN_DEBUG_SEL_NIBBLE2_RLM_SEL */ +/* Description: Nibble 2 RLM select */ +#define SH_XN_DEBUG_SEL_NIBBLE2_RLM_SEL_SHFT 16 +#define SH_XN_DEBUG_SEL_NIBBLE2_RLM_SEL_MASK 0x0000000000070000 + +/* SH_XN_DEBUG_SEL_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_XN_DEBUG_SEL_NIBBLE2_NIBBLE_SEL_SHFT 20 +#define SH_XN_DEBUG_SEL_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_XN_DEBUG_SEL_NIBBLE3_RLM_SEL */ +/* Description: Nibble 3 RLM select */ +#define SH_XN_DEBUG_SEL_NIBBLE3_RLM_SEL_SHFT 24 +#define SH_XN_DEBUG_SEL_NIBBLE3_RLM_SEL_MASK 0x0000000007000000 + +/* SH_XN_DEBUG_SEL_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_XN_DEBUG_SEL_NIBBLE3_NIBBLE_SEL_SHFT 28 +#define SH_XN_DEBUG_SEL_NIBBLE3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_XN_DEBUG_SEL_NIBBLE4_RLM_SEL */ +/* Description: Nibble 4 RLM select */ +#define SH_XN_DEBUG_SEL_NIBBLE4_RLM_SEL_SHFT 32 +#define SH_XN_DEBUG_SEL_NIBBLE4_RLM_SEL_MASK 0x0000000700000000 + +/* SH_XN_DEBUG_SEL_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_XN_DEBUG_SEL_NIBBLE4_NIBBLE_SEL_SHFT 36 +#define SH_XN_DEBUG_SEL_NIBBLE4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_XN_DEBUG_SEL_NIBBLE5_RLM_SEL */ +/* Description: Nibble 5 RLM select */ +#define SH_XN_DEBUG_SEL_NIBBLE5_RLM_SEL_SHFT 40 +#define SH_XN_DEBUG_SEL_NIBBLE5_RLM_SEL_MASK 0x0000070000000000 + +/* SH_XN_DEBUG_SEL_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_XN_DEBUG_SEL_NIBBLE5_NIBBLE_SEL_SHFT 44 +#define SH_XN_DEBUG_SEL_NIBBLE5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_XN_DEBUG_SEL_NIBBLE6_RLM_SEL */ +/* Description: Nibble 6 RLM select */ +#define SH_XN_DEBUG_SEL_NIBBLE6_RLM_SEL_SHFT 48 +#define SH_XN_DEBUG_SEL_NIBBLE6_RLM_SEL_MASK 0x0007000000000000 + +/* SH_XN_DEBUG_SEL_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_XN_DEBUG_SEL_NIBBLE6_NIBBLE_SEL_SHFT 52 +#define SH_XN_DEBUG_SEL_NIBBLE6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_XN_DEBUG_SEL_NIBBLE7_RLM_SEL */ +/* Description: Nibble 7 RLM select */ +#define SH_XN_DEBUG_SEL_NIBBLE7_RLM_SEL_SHFT 56 +#define SH_XN_DEBUG_SEL_NIBBLE7_RLM_SEL_MASK 0x0700000000000000 + +/* SH_XN_DEBUG_SEL_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_XN_DEBUG_SEL_NIBBLE7_NIBBLE_SEL_SHFT 60 +#define SH_XN_DEBUG_SEL_NIBBLE7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* SH_XN_DEBUG_SEL_TRIGGER_ENABLE */ +/* Description: Enable trigger on bit 32 of Analyzer data */ +#define SH_XN_DEBUG_SEL_TRIGGER_ENABLE_SHFT 63 +#define SH_XN_DEBUG_SEL_TRIGGER_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_XN_DEBUG_TRIG_SEL" */ +/* XN Debug trigger Select */ +/* ==================================================================== */ + +#define SH_XN_DEBUG_TRIG_SEL 0x0000000150031020 +#define SH_XN_DEBUG_TRIG_SEL_MASK 0x7777777777777777 +#define SH_XN_DEBUG_TRIG_SEL_INIT 0x0000000000000000 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER0_RLM_SEL */ +/* Description: Nibble 0 RLM select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER0_RLM_SEL_SHFT 0 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER0_RLM_SEL_MASK 0x0000000000000007 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER0_NIBBLE_SEL_SHFT 4 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER1_RLM_SEL */ +/* Description: Nibble 1 RLM select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER1_RLM_SEL_SHFT 8 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER1_RLM_SEL_MASK 0x0000000000000700 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER1_NIBBLE_SEL_SHFT 12 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER2_RLM_SEL */ +/* Description: Nibble 2 RLM select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER2_RLM_SEL_SHFT 16 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER2_RLM_SEL_MASK 0x0000000000070000 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER2_NIBBLE_SEL_SHFT 20 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER3_RLM_SEL */ +/* Description: Nibble 3 RLM select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER3_RLM_SEL_SHFT 24 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER3_RLM_SEL_MASK 0x0000000007000000 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER3_NIBBLE_SEL_SHFT 28 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER4_RLM_SEL */ +/* Description: Nibble 4 RLM select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER4_RLM_SEL_SHFT 32 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER4_RLM_SEL_MASK 0x0000000700000000 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER4_NIBBLE_SEL_SHFT 36 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER5_RLM_SEL */ +/* Description: Nibble 5 RLM select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER5_RLM_SEL_SHFT 40 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER5_RLM_SEL_MASK 0x0000070000000000 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER5_NIBBLE_SEL_SHFT 44 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER6_RLM_SEL */ +/* Description: Nibble 6 RLM select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER6_RLM_SEL_SHFT 48 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER6_RLM_SEL_MASK 0x0007000000000000 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER6_NIBBLE_SEL_SHFT 52 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER7_RLM_SEL */ +/* Description: Nibble 7 RLM select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER7_RLM_SEL_SHFT 56 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER7_RLM_SEL_MASK 0x0700000000000000 + +/* SH_XN_DEBUG_TRIG_SEL_TRIGGER7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER7_NIBBLE_SEL_SHFT 60 +#define SH_XN_DEBUG_TRIG_SEL_TRIGGER7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_XN_TRIGGER_COMPARE" */ +/* XN Debug Compare */ +/* ==================================================================== */ + +#define SH_XN_TRIGGER_COMPARE 0x0000000150031040 +#define SH_XN_TRIGGER_COMPARE_MASK 0x00000000ffffffff +#define SH_XN_TRIGGER_COMPARE_INIT 0x0000000000000000 + +/* SH_XN_TRIGGER_COMPARE_MASK */ +/* Description: Mask to select Debug bits for trigger generation */ +#define SH_XN_TRIGGER_COMPARE_MASK_SHFT 0 +#define SH_XN_TRIGGER_COMPARE_MASK_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_XN_TRIGGER_DATA" */ +/* XN Debug Compare Data */ +/* ==================================================================== */ + +#define SH_XN_TRIGGER_DATA 0x0000000150031050 +#define SH_XN_TRIGGER_DATA_MASK 0x00000000ffffffff +#define SH_XN_TRIGGER_DATA_INIT 0x00000000ffffffff + +/* SH_XN_TRIGGER_DATA_COMPARE_PATTERN */ +/* Description: debug bit pattern for trigger generation */ +#define SH_XN_TRIGGER_DATA_COMPARE_PATTERN_SHFT 0 +#define SH_XN_TRIGGER_DATA_COMPARE_PATTERN_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_DEBUG_SEL" */ +/* XN IILB Debug Port Select */ +/* ==================================================================== */ + +#define SH_XN_IILB_DEBUG_SEL 0x0000000150031060 +#define SH_XN_IILB_DEBUG_SEL_MASK 0x7777777777777777 +#define SH_XN_IILB_DEBUG_SEL_INIT 0x0000000000000000 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE0_INPUT_SEL */ +/* Description: Nibble 0 input select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE0_INPUT_SEL_SHFT 0 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE0_INPUT_SEL_MASK 0x0000000000000007 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE0_NIBBLE_SEL_SHFT 4 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE1_INPUT_SEL */ +/* Description: Nibble 1 input select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE1_INPUT_SEL_SHFT 8 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE1_INPUT_SEL_MASK 0x0000000000000700 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE1_NIBBLE_SEL_SHFT 12 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE2_INPUT_SEL */ +/* Description: Nibble 2 input select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE2_INPUT_SEL_SHFT 16 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE2_INPUT_SEL_MASK 0x0000000000070000 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE2_NIBBLE_SEL_SHFT 20 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE3_INPUT_SEL */ +/* Description: Nibble 3 input select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE3_INPUT_SEL_SHFT 24 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE3_INPUT_SEL_MASK 0x0000000007000000 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE3_NIBBLE_SEL_SHFT 28 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE4_INPUT_SEL */ +/* Description: Nibble 4 input select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE4_INPUT_SEL_SHFT 32 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE4_INPUT_SEL_MASK 0x0000000700000000 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE4_NIBBLE_SEL_SHFT 36 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE5_INPUT_SEL */ +/* Description: Nibble 5 input select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE5_INPUT_SEL_SHFT 40 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE5_INPUT_SEL_MASK 0x0000070000000000 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE5_NIBBLE_SEL_SHFT 44 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE6_INPUT_SEL */ +/* Description: Nibble 6 input select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE6_INPUT_SEL_SHFT 48 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE6_INPUT_SEL_MASK 0x0007000000000000 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE6_NIBBLE_SEL_SHFT 52 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE7_INPUT_SEL */ +/* Description: Nibble 7 input select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE7_INPUT_SEL_SHFT 56 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE7_INPUT_SEL_MASK 0x0700000000000000 + +/* SH_XN_IILB_DEBUG_SEL_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_XN_IILB_DEBUG_SEL_NIBBLE7_NIBBLE_SEL_SHFT 60 +#define SH_XN_IILB_DEBUG_SEL_NIBBLE7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_XN_PI_DEBUG_SEL" */ +/* XN PI Debug Port Select */ +/* ==================================================================== */ + +#define SH_XN_PI_DEBUG_SEL 0x00000001500310a0 +#define SH_XN_PI_DEBUG_SEL_MASK 0x7777777777777777 +#define SH_XN_PI_DEBUG_SEL_INIT 0x0000000000000000 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE0_INPUT_SEL */ +/* Description: Nibble 0 input select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE0_INPUT_SEL_SHFT 0 +#define SH_XN_PI_DEBUG_SEL_NIBBLE0_INPUT_SEL_MASK 0x0000000000000007 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE0_NIBBLE_SEL_SHFT 4 +#define SH_XN_PI_DEBUG_SEL_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE1_INPUT_SEL */ +/* Description: Nibble 1 input select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE1_INPUT_SEL_SHFT 8 +#define SH_XN_PI_DEBUG_SEL_NIBBLE1_INPUT_SEL_MASK 0x0000000000000700 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE1_NIBBLE_SEL_SHFT 12 +#define SH_XN_PI_DEBUG_SEL_NIBBLE1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE2_INPUT_SEL */ +/* Description: Nibble 2 input select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE2_INPUT_SEL_SHFT 16 +#define SH_XN_PI_DEBUG_SEL_NIBBLE2_INPUT_SEL_MASK 0x0000000000070000 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE2_NIBBLE_SEL_SHFT 20 +#define SH_XN_PI_DEBUG_SEL_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE3_INPUT_SEL */ +/* Description: Nibble 3 input select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE3_INPUT_SEL_SHFT 24 +#define SH_XN_PI_DEBUG_SEL_NIBBLE3_INPUT_SEL_MASK 0x0000000007000000 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE3_NIBBLE_SEL_SHFT 28 +#define SH_XN_PI_DEBUG_SEL_NIBBLE3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE4_INPUT_SEL */ +/* Description: Nibble 4 input select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE4_INPUT_SEL_SHFT 32 +#define SH_XN_PI_DEBUG_SEL_NIBBLE4_INPUT_SEL_MASK 0x0000000700000000 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE4_NIBBLE_SEL_SHFT 36 +#define SH_XN_PI_DEBUG_SEL_NIBBLE4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE5_INPUT_SEL */ +/* Description: Nibble 5 input select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE5_INPUT_SEL_SHFT 40 +#define SH_XN_PI_DEBUG_SEL_NIBBLE5_INPUT_SEL_MASK 0x0000070000000000 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE5_NIBBLE_SEL_SHFT 44 +#define SH_XN_PI_DEBUG_SEL_NIBBLE5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE6_INPUT_SEL */ +/* Description: Nibble 6 input select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE6_INPUT_SEL_SHFT 48 +#define SH_XN_PI_DEBUG_SEL_NIBBLE6_INPUT_SEL_MASK 0x0007000000000000 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE6_NIBBLE_SEL_SHFT 52 +#define SH_XN_PI_DEBUG_SEL_NIBBLE6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE7_INPUT_SEL */ +/* Description: Nibble 7 input select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE7_INPUT_SEL_SHFT 56 +#define SH_XN_PI_DEBUG_SEL_NIBBLE7_INPUT_SEL_MASK 0x0700000000000000 + +/* SH_XN_PI_DEBUG_SEL_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_XN_PI_DEBUG_SEL_NIBBLE7_NIBBLE_SEL_SHFT 60 +#define SH_XN_PI_DEBUG_SEL_NIBBLE7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_XN_MD_DEBUG_SEL" */ +/* XN MD Debug Port Select */ +/* ==================================================================== */ + +#define SH_XN_MD_DEBUG_SEL 0x0000000150031080 +#define SH_XN_MD_DEBUG_SEL_MASK 0x7777777777777777 +#define SH_XN_MD_DEBUG_SEL_INIT 0x0000000000000000 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE0_INPUT_SEL */ +/* Description: Nibble 0 input select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE0_INPUT_SEL_SHFT 0 +#define SH_XN_MD_DEBUG_SEL_NIBBLE0_INPUT_SEL_MASK 0x0000000000000007 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE0_NIBBLE_SEL_SHFT 4 +#define SH_XN_MD_DEBUG_SEL_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE1_INPUT_SEL */ +/* Description: Nibble 1 input select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE1_INPUT_SEL_SHFT 8 +#define SH_XN_MD_DEBUG_SEL_NIBBLE1_INPUT_SEL_MASK 0x0000000000000700 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE1_NIBBLE_SEL_SHFT 12 +#define SH_XN_MD_DEBUG_SEL_NIBBLE1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE2_INPUT_SEL */ +/* Description: Nibble 2 input select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE2_INPUT_SEL_SHFT 16 +#define SH_XN_MD_DEBUG_SEL_NIBBLE2_INPUT_SEL_MASK 0x0000000000070000 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE2_NIBBLE_SEL_SHFT 20 +#define SH_XN_MD_DEBUG_SEL_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE3_INPUT_SEL */ +/* Description: Nibble 3 input select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE3_INPUT_SEL_SHFT 24 +#define SH_XN_MD_DEBUG_SEL_NIBBLE3_INPUT_SEL_MASK 0x0000000007000000 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE3_NIBBLE_SEL_SHFT 28 +#define SH_XN_MD_DEBUG_SEL_NIBBLE3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE4_INPUT_SEL */ +/* Description: Nibble 4 input select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE4_INPUT_SEL_SHFT 32 +#define SH_XN_MD_DEBUG_SEL_NIBBLE4_INPUT_SEL_MASK 0x0000000700000000 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE4_NIBBLE_SEL_SHFT 36 +#define SH_XN_MD_DEBUG_SEL_NIBBLE4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE5_INPUT_SEL */ +/* Description: Nibble 5 input select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE5_INPUT_SEL_SHFT 40 +#define SH_XN_MD_DEBUG_SEL_NIBBLE5_INPUT_SEL_MASK 0x0000070000000000 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE5_NIBBLE_SEL_SHFT 44 +#define SH_XN_MD_DEBUG_SEL_NIBBLE5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE6_INPUT_SEL */ +/* Description: Nibble 6 input select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE6_INPUT_SEL_SHFT 48 +#define SH_XN_MD_DEBUG_SEL_NIBBLE6_INPUT_SEL_MASK 0x0007000000000000 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE6_NIBBLE_SEL_SHFT 52 +#define SH_XN_MD_DEBUG_SEL_NIBBLE6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE7_INPUT_SEL */ +/* Description: Nibble 7 input select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE7_INPUT_SEL_SHFT 56 +#define SH_XN_MD_DEBUG_SEL_NIBBLE7_INPUT_SEL_MASK 0x0700000000000000 + +/* SH_XN_MD_DEBUG_SEL_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_XN_MD_DEBUG_SEL_NIBBLE7_NIBBLE_SEL_SHFT 60 +#define SH_XN_MD_DEBUG_SEL_NIBBLE7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_XN_NI0_DEBUG_SEL" */ +/* XN NI0 Debug Port Select */ +/* ==================================================================== */ + +#define SH_XN_NI0_DEBUG_SEL 0x00000001500310c0 +#define SH_XN_NI0_DEBUG_SEL_MASK 0x7777777777777777 +#define SH_XN_NI0_DEBUG_SEL_INIT 0x0000000000000000 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE0_INPUT_SEL */ +/* Description: Nibble 0 input select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE0_INPUT_SEL_SHFT 0 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE0_INPUT_SEL_MASK 0x0000000000000007 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE0_NIBBLE_SEL_SHFT 4 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE1_INPUT_SEL */ +/* Description: Nibble 1 input select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE1_INPUT_SEL_SHFT 8 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE1_INPUT_SEL_MASK 0x0000000000000700 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE1_NIBBLE_SEL_SHFT 12 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE2_INPUT_SEL */ +/* Description: Nibble 2 input select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE2_INPUT_SEL_SHFT 16 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE2_INPUT_SEL_MASK 0x0000000000070000 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE2_NIBBLE_SEL_SHFT 20 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE3_INPUT_SEL */ +/* Description: Nibble 3 input select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE3_INPUT_SEL_SHFT 24 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE3_INPUT_SEL_MASK 0x0000000007000000 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE3_NIBBLE_SEL_SHFT 28 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE4_INPUT_SEL */ +/* Description: Nibble 4 input select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE4_INPUT_SEL_SHFT 32 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE4_INPUT_SEL_MASK 0x0000000700000000 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE4_NIBBLE_SEL_SHFT 36 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE5_INPUT_SEL */ +/* Description: Nibble 5 input select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE5_INPUT_SEL_SHFT 40 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE5_INPUT_SEL_MASK 0x0000070000000000 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE5_NIBBLE_SEL_SHFT 44 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE6_INPUT_SEL */ +/* Description: Nibble 6 input select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE6_INPUT_SEL_SHFT 48 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE6_INPUT_SEL_MASK 0x0007000000000000 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE6_NIBBLE_SEL_SHFT 52 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE7_INPUT_SEL */ +/* Description: Nibble 7 input select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE7_INPUT_SEL_SHFT 56 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE7_INPUT_SEL_MASK 0x0700000000000000 + +/* SH_XN_NI0_DEBUG_SEL_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_XN_NI0_DEBUG_SEL_NIBBLE7_NIBBLE_SEL_SHFT 60 +#define SH_XN_NI0_DEBUG_SEL_NIBBLE7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_XN_NI1_DEBUG_SEL" */ +/* XN NI1 Debug Port Select */ +/* ==================================================================== */ + +#define SH_XN_NI1_DEBUG_SEL 0x00000001500310e0 +#define SH_XN_NI1_DEBUG_SEL_MASK 0x7777777777777777 +#define SH_XN_NI1_DEBUG_SEL_INIT 0x0000000000000000 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE0_INPUT_SEL */ +/* Description: Nibble 0 input select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE0_INPUT_SEL_SHFT 0 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE0_INPUT_SEL_MASK 0x0000000000000007 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE0_NIBBLE_SEL_SHFT 4 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE1_INPUT_SEL */ +/* Description: Nibble 1 input select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE1_INPUT_SEL_SHFT 8 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE1_INPUT_SEL_MASK 0x0000000000000700 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE1_NIBBLE_SEL_SHFT 12 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE2_INPUT_SEL */ +/* Description: Nibble 2 input select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE2_INPUT_SEL_SHFT 16 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE2_INPUT_SEL_MASK 0x0000000000070000 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE2_NIBBLE_SEL_SHFT 20 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE3_INPUT_SEL */ +/* Description: Nibble 3 input select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE3_INPUT_SEL_SHFT 24 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE3_INPUT_SEL_MASK 0x0000000007000000 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE3_NIBBLE_SEL_SHFT 28 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE4_INPUT_SEL */ +/* Description: Nibble 4 input select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE4_INPUT_SEL_SHFT 32 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE4_INPUT_SEL_MASK 0x0000000700000000 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE4_NIBBLE_SEL_SHFT 36 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE5_INPUT_SEL */ +/* Description: Nibble 5 input select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE5_INPUT_SEL_SHFT 40 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE5_INPUT_SEL_MASK 0x0000070000000000 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE5_NIBBLE_SEL_SHFT 44 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE6_INPUT_SEL */ +/* Description: Nibble 6 input select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE6_INPUT_SEL_SHFT 48 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE6_INPUT_SEL_MASK 0x0007000000000000 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE6_NIBBLE_SEL_SHFT 52 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE7_INPUT_SEL */ +/* Description: Nibble 7 input select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE7_INPUT_SEL_SHFT 56 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE7_INPUT_SEL_MASK 0x0700000000000000 + +/* SH_XN_NI1_DEBUG_SEL_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_XN_NI1_DEBUG_SEL_NIBBLE7_NIBBLE_SEL_SHFT 60 +#define SH_XN_NI1_DEBUG_SEL_NIBBLE7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_XN_IILB_LB_CMP_EXP_DATA0" */ +/* IILB compare LB input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_IILB_LB_CMP_EXP_DATA0 0x0000000150031100 +#define SH_XN_IILB_LB_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_IILB_LB_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_IILB_LB_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_IILB_LB_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_IILB_LB_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_LB_CMP_EXP_DATA1" */ +/* IILB compare LB input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_IILB_LB_CMP_EXP_DATA1 0x0000000150031110 +#define SH_XN_IILB_LB_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_IILB_LB_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_IILB_LB_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_IILB_LB_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_IILB_LB_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_LB_CMP_ENABLE0" */ +/* IILB compare LB input enable0 */ +/* ==================================================================== */ + +#define SH_XN_IILB_LB_CMP_ENABLE0 0x0000000150031120 +#define SH_XN_IILB_LB_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_IILB_LB_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_IILB_LB_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_IILB_LB_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_IILB_LB_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_LB_CMP_ENABLE1" */ +/* IILB compare LB input enable1 */ +/* ==================================================================== */ + +#define SH_XN_IILB_LB_CMP_ENABLE1 0x0000000150031130 +#define SH_XN_IILB_LB_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_IILB_LB_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_IILB_LB_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_IILB_LB_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_IILB_LB_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_II_CMP_EXP_DATA0" */ +/* IILB compare II input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_IILB_II_CMP_EXP_DATA0 0x0000000150031140 +#define SH_XN_IILB_II_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_IILB_II_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_IILB_II_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_IILB_II_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_IILB_II_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_II_CMP_EXP_DATA1" */ +/* IILB compare II input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_IILB_II_CMP_EXP_DATA1 0x0000000150031150 +#define SH_XN_IILB_II_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_IILB_II_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_IILB_II_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_IILB_II_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_IILB_II_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_II_CMP_ENABLE0" */ +/* IILB compare II input enable0 */ +/* ==================================================================== */ + +#define SH_XN_IILB_II_CMP_ENABLE0 0x0000000150031160 +#define SH_XN_IILB_II_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_IILB_II_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_IILB_II_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_IILB_II_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_IILB_II_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_II_CMP_ENABLE1" */ +/* IILB compare II input enable1 */ +/* ==================================================================== */ + +#define SH_XN_IILB_II_CMP_ENABLE1 0x0000000150031170 +#define SH_XN_IILB_II_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_IILB_II_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_IILB_II_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_IILB_II_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_IILB_II_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_MD_CMP_EXP_DATA0" */ +/* IILB compare MD input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_IILB_MD_CMP_EXP_DATA0 0x0000000150031180 +#define SH_XN_IILB_MD_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_IILB_MD_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_IILB_MD_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_IILB_MD_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_IILB_MD_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_MD_CMP_EXP_DATA1" */ +/* IILB compare MD input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_IILB_MD_CMP_EXP_DATA1 0x0000000150031190 +#define SH_XN_IILB_MD_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_IILB_MD_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_IILB_MD_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_IILB_MD_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_IILB_MD_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_MD_CMP_ENABLE0" */ +/* IILB compare MD input enable0 */ +/* ==================================================================== */ + +#define SH_XN_IILB_MD_CMP_ENABLE0 0x00000001500311a0 +#define SH_XN_IILB_MD_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_IILB_MD_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_IILB_MD_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_IILB_MD_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_IILB_MD_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_MD_CMP_ENABLE1" */ +/* IILB compare MD input enable1 */ +/* ==================================================================== */ + +#define SH_XN_IILB_MD_CMP_ENABLE1 0x00000001500311b0 +#define SH_XN_IILB_MD_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_IILB_MD_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_IILB_MD_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_IILB_MD_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_IILB_MD_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_PI_CMP_EXP_DATA0" */ +/* IILB compare PI input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_IILB_PI_CMP_EXP_DATA0 0x00000001500311c0 +#define SH_XN_IILB_PI_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_IILB_PI_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_IILB_PI_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_IILB_PI_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_IILB_PI_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_PI_CMP_EXP_DATA1" */ +/* IILB compare PI input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_IILB_PI_CMP_EXP_DATA1 0x00000001500311d0 +#define SH_XN_IILB_PI_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_IILB_PI_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_IILB_PI_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_IILB_PI_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_IILB_PI_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_PI_CMP_ENABLE0" */ +/* IILB compare PI input enable0 */ +/* ==================================================================== */ + +#define SH_XN_IILB_PI_CMP_ENABLE0 0x00000001500311e0 +#define SH_XN_IILB_PI_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_IILB_PI_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_IILB_PI_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_IILB_PI_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_IILB_PI_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_PI_CMP_ENABLE1" */ +/* IILB compare PI input enable1 */ +/* ==================================================================== */ + +#define SH_XN_IILB_PI_CMP_ENABLE1 0x00000001500311f0 +#define SH_XN_IILB_PI_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_IILB_PI_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_IILB_PI_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_IILB_PI_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_IILB_PI_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI0_CMP_EXP_DATA0" */ +/* IILB compare NI0 input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_IILB_NI0_CMP_EXP_DATA0 0x0000000150031200 +#define SH_XN_IILB_NI0_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_IILB_NI0_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_IILB_NI0_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_IILB_NI0_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_IILB_NI0_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI0_CMP_EXP_DATA1" */ +/* IILB compare NI0 input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_IILB_NI0_CMP_EXP_DATA1 0x0000000150031210 +#define SH_XN_IILB_NI0_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_IILB_NI0_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_IILB_NI0_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_IILB_NI0_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_IILB_NI0_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI0_CMP_ENABLE0" */ +/* IILB compare NI0 input enable0 */ +/* ==================================================================== */ + +#define SH_XN_IILB_NI0_CMP_ENABLE0 0x0000000150031220 +#define SH_XN_IILB_NI0_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_IILB_NI0_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_IILB_NI0_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_IILB_NI0_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_IILB_NI0_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI0_CMP_ENABLE1" */ +/* IILB compare NI0 input enable1 */ +/* ==================================================================== */ + +#define SH_XN_IILB_NI0_CMP_ENABLE1 0x0000000150031230 +#define SH_XN_IILB_NI0_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_IILB_NI0_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_IILB_NI0_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_IILB_NI0_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_IILB_NI0_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI1_CMP_EXP_DATA0" */ +/* IILB compare NI1 input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_IILB_NI1_CMP_EXP_DATA0 0x0000000150031240 +#define SH_XN_IILB_NI1_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_IILB_NI1_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_IILB_NI1_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_IILB_NI1_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_IILB_NI1_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI1_CMP_EXP_DATA1" */ +/* IILB compare NI1 input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_IILB_NI1_CMP_EXP_DATA1 0x0000000150031250 +#define SH_XN_IILB_NI1_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_IILB_NI1_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_IILB_NI1_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_IILB_NI1_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_IILB_NI1_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI1_CMP_ENABLE0" */ +/* IILB compare NI1 input enable0 */ +/* ==================================================================== */ + +#define SH_XN_IILB_NI1_CMP_ENABLE0 0x0000000150031260 +#define SH_XN_IILB_NI1_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_IILB_NI1_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_IILB_NI1_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_IILB_NI1_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_IILB_NI1_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI1_CMP_ENABLE1" */ +/* IILB compare NI1 input enable1 */ +/* ==================================================================== */ + +#define SH_XN_IILB_NI1_CMP_ENABLE1 0x0000000150031270 +#define SH_XN_IILB_NI1_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_IILB_NI1_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_IILB_NI1_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_IILB_NI1_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_IILB_NI1_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_IILB_CMP_EXP_DATA0" */ +/* MD compare IILB input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_MD_IILB_CMP_EXP_DATA0 0x0000000150031500 +#define SH_XN_MD_IILB_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_MD_IILB_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_MD_IILB_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_MD_IILB_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_MD_IILB_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_IILB_CMP_EXP_DATA1" */ +/* MD compare IILB input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_MD_IILB_CMP_EXP_DATA1 0x0000000150031510 +#define SH_XN_MD_IILB_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_MD_IILB_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_MD_IILB_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_MD_IILB_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_MD_IILB_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_IILB_CMP_ENABLE0" */ +/* MD compare IILB input enable0 */ +/* ==================================================================== */ + +#define SH_XN_MD_IILB_CMP_ENABLE0 0x0000000150031520 +#define SH_XN_MD_IILB_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_MD_IILB_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_MD_IILB_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_MD_IILB_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_MD_IILB_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_IILB_CMP_ENABLE1" */ +/* MD compare IILB input enable1 */ +/* ==================================================================== */ + +#define SH_XN_MD_IILB_CMP_ENABLE1 0x0000000150031530 +#define SH_XN_MD_IILB_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_MD_IILB_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_MD_IILB_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_MD_IILB_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_MD_IILB_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI0_CMP_EXP_DATA0" */ +/* MD compare NI0 input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_MD_NI0_CMP_EXP_DATA0 0x0000000150031540 +#define SH_XN_MD_NI0_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_MD_NI0_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_MD_NI0_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_MD_NI0_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_MD_NI0_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI0_CMP_EXP_DATA1" */ +/* MD compare NI0 input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_MD_NI0_CMP_EXP_DATA1 0x0000000150031550 +#define SH_XN_MD_NI0_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_MD_NI0_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_MD_NI0_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_MD_NI0_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_MD_NI0_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI0_CMP_ENABLE0" */ +/* MD compare NI0 input enable0 */ +/* ==================================================================== */ + +#define SH_XN_MD_NI0_CMP_ENABLE0 0x0000000150031560 +#define SH_XN_MD_NI0_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_MD_NI0_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_MD_NI0_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_MD_NI0_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_MD_NI0_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI0_CMP_ENABLE1" */ +/* MD compare NI0 input enable1 */ +/* ==================================================================== */ + +#define SH_XN_MD_NI0_CMP_ENABLE1 0x0000000150031570 +#define SH_XN_MD_NI0_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_MD_NI0_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_MD_NI0_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_MD_NI0_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_MD_NI0_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI1_CMP_EXP_DATA0" */ +/* MD compare NI1 input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_MD_NI1_CMP_EXP_DATA0 0x0000000150031580 +#define SH_XN_MD_NI1_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_MD_NI1_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_MD_NI1_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_MD_NI1_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_MD_NI1_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI1_CMP_EXP_DATA1" */ +/* MD compare NI1 input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_MD_NI1_CMP_EXP_DATA1 0x0000000150031590 +#define SH_XN_MD_NI1_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_MD_NI1_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_MD_NI1_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_MD_NI1_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_MD_NI1_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI1_CMP_ENABLE0" */ +/* MD compare NI1 input enable0 */ +/* ==================================================================== */ + +#define SH_XN_MD_NI1_CMP_ENABLE0 0x00000001500315a0 +#define SH_XN_MD_NI1_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_MD_NI1_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_MD_NI1_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_MD_NI1_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_MD_NI1_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI1_CMP_ENABLE1" */ +/* MD compare NI1 input enable1 */ +/* ==================================================================== */ + +#define SH_XN_MD_NI1_CMP_ENABLE1 0x00000001500315b0 +#define SH_XN_MD_NI1_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_MD_NI1_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_MD_NI1_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_MD_NI1_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_MD_NI1_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_EXP_HDR0" */ +/* MD compare SIC input expected header0 */ +/* ==================================================================== */ + +#define SH_XN_MD_SIC_CMP_EXP_HDR0 0x00000001500315c0 +#define SH_XN_MD_SIC_CMP_EXP_HDR0_MASK 0xffffffffffffffff +#define SH_XN_MD_SIC_CMP_EXP_HDR0_INIT 0x0000000000000000 + +/* SH_XN_MD_SIC_CMP_EXP_HDR0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_MD_SIC_CMP_EXP_HDR0_DATA_SHFT 0 +#define SH_XN_MD_SIC_CMP_EXP_HDR0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_EXP_HDR1" */ +/* MD compare SIC input expected header1 */ +/* ==================================================================== */ + +#define SH_XN_MD_SIC_CMP_EXP_HDR1 0x00000001500315d0 +#define SH_XN_MD_SIC_CMP_EXP_HDR1_MASK 0x000003ffffffffff +#define SH_XN_MD_SIC_CMP_EXP_HDR1_INIT 0x0000000000000000 + +/* SH_XN_MD_SIC_CMP_EXP_HDR1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_MD_SIC_CMP_EXP_HDR1_DATA_SHFT 0 +#define SH_XN_MD_SIC_CMP_EXP_HDR1_DATA_MASK 0x000003ffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_HDR_ENABLE0" */ +/* MD compare SIC header enable0 */ +/* ==================================================================== */ + +#define SH_XN_MD_SIC_CMP_HDR_ENABLE0 0x00000001500315e0 +#define SH_XN_MD_SIC_CMP_HDR_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_MD_SIC_CMP_HDR_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_MD_SIC_CMP_HDR_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_MD_SIC_CMP_HDR_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_MD_SIC_CMP_HDR_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_HDR_ENABLE1" */ +/* MD compare SIC header enable1 */ +/* ==================================================================== */ + +#define SH_XN_MD_SIC_CMP_HDR_ENABLE1 0x00000001500315f0 +#define SH_XN_MD_SIC_CMP_HDR_ENABLE1_MASK 0x000003ffffffffff +#define SH_XN_MD_SIC_CMP_HDR_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_MD_SIC_CMP_HDR_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_MD_SIC_CMP_HDR_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_MD_SIC_CMP_HDR_ENABLE1_ENABLE_MASK 0x000003ffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA0" */ +/* MD compare SIC data0 */ +/* ==================================================================== */ + +#define SH_XN_MD_SIC_CMP_DATA0 0x0000000150031600 +#define SH_XN_MD_SIC_CMP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_MD_SIC_CMP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_MD_SIC_CMP_DATA0_DATA0 */ +/* Description: Data0 */ +#define SH_XN_MD_SIC_CMP_DATA0_DATA0_SHFT 0 +#define SH_XN_MD_SIC_CMP_DATA0_DATA0_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA1" */ +/* MD compare SIC data1 */ +/* ==================================================================== */ + +#define SH_XN_MD_SIC_CMP_DATA1 0x0000000150031610 +#define SH_XN_MD_SIC_CMP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_MD_SIC_CMP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_MD_SIC_CMP_DATA1_DATA1 */ +/* Description: Data1 */ +#define SH_XN_MD_SIC_CMP_DATA1_DATA1_SHFT 0 +#define SH_XN_MD_SIC_CMP_DATA1_DATA1_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA2" */ +/* MD compare SIC data2 */ +/* ==================================================================== */ + +#define SH_XN_MD_SIC_CMP_DATA2 0x0000000150031620 +#define SH_XN_MD_SIC_CMP_DATA2_MASK 0xffffffffffffffff +#define SH_XN_MD_SIC_CMP_DATA2_INIT 0x0000000000000000 + +/* SH_XN_MD_SIC_CMP_DATA2_DATA2 */ +/* Description: Data2 */ +#define SH_XN_MD_SIC_CMP_DATA2_DATA2_SHFT 0 +#define SH_XN_MD_SIC_CMP_DATA2_DATA2_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA3" */ +/* MD compare SIC data3 */ +/* ==================================================================== */ + +#define SH_XN_MD_SIC_CMP_DATA3 0x0000000150031630 +#define SH_XN_MD_SIC_CMP_DATA3_MASK 0xffffffffffffffff +#define SH_XN_MD_SIC_CMP_DATA3_INIT 0x0000000000000000 + +/* SH_XN_MD_SIC_CMP_DATA3_DATA3 */ +/* Description: Data3 */ +#define SH_XN_MD_SIC_CMP_DATA3_DATA3_SHFT 0 +#define SH_XN_MD_SIC_CMP_DATA3_DATA3_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA_ENABLE0" */ +/* MD enable compare SIC data0 */ +/* ==================================================================== */ + +#define SH_XN_MD_SIC_CMP_DATA_ENABLE0 0x0000000150031640 +#define SH_XN_MD_SIC_CMP_DATA_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_MD_SIC_CMP_DATA_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_MD_SIC_CMP_DATA_ENABLE0_DATA_ENABLE0 */ +/* Description: Data0 */ +#define SH_XN_MD_SIC_CMP_DATA_ENABLE0_DATA_ENABLE0_SHFT 0 +#define SH_XN_MD_SIC_CMP_DATA_ENABLE0_DATA_ENABLE0_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA_ENABLE1" */ +/* MD enable compare SIC data1 */ +/* ==================================================================== */ + +#define SH_XN_MD_SIC_CMP_DATA_ENABLE1 0x0000000150031650 +#define SH_XN_MD_SIC_CMP_DATA_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_MD_SIC_CMP_DATA_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_MD_SIC_CMP_DATA_ENABLE1_DATA_ENABLE1 */ +/* Description: Data1 */ +#define SH_XN_MD_SIC_CMP_DATA_ENABLE1_DATA_ENABLE1_SHFT 0 +#define SH_XN_MD_SIC_CMP_DATA_ENABLE1_DATA_ENABLE1_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA_ENABLE2" */ +/* MD enable compare SIC data2 */ +/* ==================================================================== */ + +#define SH_XN_MD_SIC_CMP_DATA_ENABLE2 0x0000000150031660 +#define SH_XN_MD_SIC_CMP_DATA_ENABLE2_MASK 0xffffffffffffffff +#define SH_XN_MD_SIC_CMP_DATA_ENABLE2_INIT 0x0000000000000000 + +/* SH_XN_MD_SIC_CMP_DATA_ENABLE2_DATA_ENABLE2 */ +/* Description: Data2 */ +#define SH_XN_MD_SIC_CMP_DATA_ENABLE2_DATA_ENABLE2_SHFT 0 +#define SH_XN_MD_SIC_CMP_DATA_ENABLE2_DATA_ENABLE2_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA_ENABLE3" */ +/* MD enable compare SIC data3 */ +/* ==================================================================== */ + +#define SH_XN_MD_SIC_CMP_DATA_ENABLE3 0x0000000150031670 +#define SH_XN_MD_SIC_CMP_DATA_ENABLE3_MASK 0xffffffffffffffff +#define SH_XN_MD_SIC_CMP_DATA_ENABLE3_INIT 0x0000000000000000 + +/* SH_XN_MD_SIC_CMP_DATA_ENABLE3_DATA_ENABLE3 */ +/* Description: Data3 */ +#define SH_XN_MD_SIC_CMP_DATA_ENABLE3_DATA_ENABLE3_SHFT 0 +#define SH_XN_MD_SIC_CMP_DATA_ENABLE3_DATA_ENABLE3_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_IILB_CMP_EXP_DATA0" */ +/* PI compare IILB input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_PI_IILB_CMP_EXP_DATA0 0x0000000150031300 +#define SH_XN_PI_IILB_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_PI_IILB_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_PI_IILB_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_PI_IILB_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_PI_IILB_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_IILB_CMP_EXP_DATA1" */ +/* PI compare IILB input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_PI_IILB_CMP_EXP_DATA1 0x0000000150031310 +#define SH_XN_PI_IILB_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_PI_IILB_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_PI_IILB_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_PI_IILB_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_PI_IILB_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_IILB_CMP_ENABLE0" */ +/* PI compare IILB input enable0 */ +/* ==================================================================== */ + +#define SH_XN_PI_IILB_CMP_ENABLE0 0x0000000150031320 +#define SH_XN_PI_IILB_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_PI_IILB_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_PI_IILB_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_PI_IILB_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_PI_IILB_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_IILB_CMP_ENABLE1" */ +/* PI compare IILB input enable1 */ +/* ==================================================================== */ + +#define SH_XN_PI_IILB_CMP_ENABLE1 0x0000000150031330 +#define SH_XN_PI_IILB_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_PI_IILB_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_PI_IILB_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_PI_IILB_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_PI_IILB_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI0_CMP_EXP_DATA0" */ +/* PI compare NI0 input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_PI_NI0_CMP_EXP_DATA0 0x0000000150031340 +#define SH_XN_PI_NI0_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_PI_NI0_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_PI_NI0_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_PI_NI0_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_PI_NI0_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI0_CMP_EXP_DATA1" */ +/* PI compare NI0 input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_PI_NI0_CMP_EXP_DATA1 0x0000000150031350 +#define SH_XN_PI_NI0_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_PI_NI0_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_PI_NI0_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_PI_NI0_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_PI_NI0_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI0_CMP_ENABLE0" */ +/* PI compare NI0 input enable0 */ +/* ==================================================================== */ + +#define SH_XN_PI_NI0_CMP_ENABLE0 0x0000000150031360 +#define SH_XN_PI_NI0_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_PI_NI0_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_PI_NI0_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_PI_NI0_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_PI_NI0_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI0_CMP_ENABLE1" */ +/* PI compare NI0 input enable1 */ +/* ==================================================================== */ + +#define SH_XN_PI_NI0_CMP_ENABLE1 0x0000000150031370 +#define SH_XN_PI_NI0_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_PI_NI0_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_PI_NI0_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_PI_NI0_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_PI_NI0_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI1_CMP_EXP_DATA0" */ +/* PI compare NI1 input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_PI_NI1_CMP_EXP_DATA0 0x0000000150031380 +#define SH_XN_PI_NI1_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_PI_NI1_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_PI_NI1_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_PI_NI1_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_PI_NI1_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI1_CMP_EXP_DATA1" */ +/* PI compare NI1 input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_PI_NI1_CMP_EXP_DATA1 0x0000000150031390 +#define SH_XN_PI_NI1_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_PI_NI1_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_PI_NI1_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_PI_NI1_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_PI_NI1_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI1_CMP_ENABLE0" */ +/* PI compare NI1 input enable0 */ +/* ==================================================================== */ + +#define SH_XN_PI_NI1_CMP_ENABLE0 0x00000001500313a0 +#define SH_XN_PI_NI1_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_PI_NI1_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_PI_NI1_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_PI_NI1_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_PI_NI1_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI1_CMP_ENABLE1" */ +/* PI compare NI1 input enable1 */ +/* ==================================================================== */ + +#define SH_XN_PI_NI1_CMP_ENABLE1 0x00000001500313b0 +#define SH_XN_PI_NI1_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_PI_NI1_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_PI_NI1_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_PI_NI1_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_PI_NI1_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_EXP_HDR0" */ +/* PI compare SIC input expected header0 */ +/* ==================================================================== */ + +#define SH_XN_PI_SIC_CMP_EXP_HDR0 0x00000001500313c0 +#define SH_XN_PI_SIC_CMP_EXP_HDR0_MASK 0xffffffffffffffff +#define SH_XN_PI_SIC_CMP_EXP_HDR0_INIT 0x0000000000000000 + +/* SH_XN_PI_SIC_CMP_EXP_HDR0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_PI_SIC_CMP_EXP_HDR0_DATA_SHFT 0 +#define SH_XN_PI_SIC_CMP_EXP_HDR0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_EXP_HDR1" */ +/* PI compare SIC input expected header1 */ +/* ==================================================================== */ + +#define SH_XN_PI_SIC_CMP_EXP_HDR1 0x00000001500313d0 +#define SH_XN_PI_SIC_CMP_EXP_HDR1_MASK 0x000003ffffffffff +#define SH_XN_PI_SIC_CMP_EXP_HDR1_INIT 0x0000000000000000 + +/* SH_XN_PI_SIC_CMP_EXP_HDR1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_PI_SIC_CMP_EXP_HDR1_DATA_SHFT 0 +#define SH_XN_PI_SIC_CMP_EXP_HDR1_DATA_MASK 0x000003ffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_HDR_ENABLE0" */ +/* PI compare SIC header enable0 */ +/* ==================================================================== */ + +#define SH_XN_PI_SIC_CMP_HDR_ENABLE0 0x00000001500313e0 +#define SH_XN_PI_SIC_CMP_HDR_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_PI_SIC_CMP_HDR_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_PI_SIC_CMP_HDR_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_PI_SIC_CMP_HDR_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_PI_SIC_CMP_HDR_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_HDR_ENABLE1" */ +/* PI compare SIC header enable1 */ +/* ==================================================================== */ + +#define SH_XN_PI_SIC_CMP_HDR_ENABLE1 0x00000001500313f0 +#define SH_XN_PI_SIC_CMP_HDR_ENABLE1_MASK 0x000003ffffffffff +#define SH_XN_PI_SIC_CMP_HDR_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_PI_SIC_CMP_HDR_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_PI_SIC_CMP_HDR_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_PI_SIC_CMP_HDR_ENABLE1_ENABLE_MASK 0x000003ffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA0" */ +/* PI compare SIC data0 */ +/* ==================================================================== */ + +#define SH_XN_PI_SIC_CMP_DATA0 0x0000000150031400 +#define SH_XN_PI_SIC_CMP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_PI_SIC_CMP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_PI_SIC_CMP_DATA0_DATA0 */ +/* Description: Data0 */ +#define SH_XN_PI_SIC_CMP_DATA0_DATA0_SHFT 0 +#define SH_XN_PI_SIC_CMP_DATA0_DATA0_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA1" */ +/* PI compare SIC data1 */ +/* ==================================================================== */ + +#define SH_XN_PI_SIC_CMP_DATA1 0x0000000150031410 +#define SH_XN_PI_SIC_CMP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_PI_SIC_CMP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_PI_SIC_CMP_DATA1_DATA1 */ +/* Description: Data1 */ +#define SH_XN_PI_SIC_CMP_DATA1_DATA1_SHFT 0 +#define SH_XN_PI_SIC_CMP_DATA1_DATA1_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA2" */ +/* PI compare SIC data2 */ +/* ==================================================================== */ + +#define SH_XN_PI_SIC_CMP_DATA2 0x0000000150031420 +#define SH_XN_PI_SIC_CMP_DATA2_MASK 0xffffffffffffffff +#define SH_XN_PI_SIC_CMP_DATA2_INIT 0x0000000000000000 + +/* SH_XN_PI_SIC_CMP_DATA2_DATA2 */ +/* Description: Data2 */ +#define SH_XN_PI_SIC_CMP_DATA2_DATA2_SHFT 0 +#define SH_XN_PI_SIC_CMP_DATA2_DATA2_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA3" */ +/* PI compare SIC data3 */ +/* ==================================================================== */ + +#define SH_XN_PI_SIC_CMP_DATA3 0x0000000150031430 +#define SH_XN_PI_SIC_CMP_DATA3_MASK 0xffffffffffffffff +#define SH_XN_PI_SIC_CMP_DATA3_INIT 0x0000000000000000 + +/* SH_XN_PI_SIC_CMP_DATA3_DATA3 */ +/* Description: Data3 */ +#define SH_XN_PI_SIC_CMP_DATA3_DATA3_SHFT 0 +#define SH_XN_PI_SIC_CMP_DATA3_DATA3_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA_ENABLE0" */ +/* PI enable compare SIC data0 */ +/* ==================================================================== */ + +#define SH_XN_PI_SIC_CMP_DATA_ENABLE0 0x0000000150031440 +#define SH_XN_PI_SIC_CMP_DATA_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_PI_SIC_CMP_DATA_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_PI_SIC_CMP_DATA_ENABLE0_DATA_ENABLE0 */ +/* Description: Data0 */ +#define SH_XN_PI_SIC_CMP_DATA_ENABLE0_DATA_ENABLE0_SHFT 0 +#define SH_XN_PI_SIC_CMP_DATA_ENABLE0_DATA_ENABLE0_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA_ENABLE1" */ +/* PI enable compare SIC data1 */ +/* ==================================================================== */ + +#define SH_XN_PI_SIC_CMP_DATA_ENABLE1 0x0000000150031450 +#define SH_XN_PI_SIC_CMP_DATA_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_PI_SIC_CMP_DATA_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_PI_SIC_CMP_DATA_ENABLE1_DATA_ENABLE1 */ +/* Description: Data1 */ +#define SH_XN_PI_SIC_CMP_DATA_ENABLE1_DATA_ENABLE1_SHFT 0 +#define SH_XN_PI_SIC_CMP_DATA_ENABLE1_DATA_ENABLE1_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA_ENABLE2" */ +/* PI enable compare SIC data2 */ +/* ==================================================================== */ + +#define SH_XN_PI_SIC_CMP_DATA_ENABLE2 0x0000000150031460 +#define SH_XN_PI_SIC_CMP_DATA_ENABLE2_MASK 0xffffffffffffffff +#define SH_XN_PI_SIC_CMP_DATA_ENABLE2_INIT 0x0000000000000000 + +/* SH_XN_PI_SIC_CMP_DATA_ENABLE2_DATA_ENABLE2 */ +/* Description: Data2 */ +#define SH_XN_PI_SIC_CMP_DATA_ENABLE2_DATA_ENABLE2_SHFT 0 +#define SH_XN_PI_SIC_CMP_DATA_ENABLE2_DATA_ENABLE2_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA_ENABLE3" */ +/* PI enable compare SIC data3 */ +/* ==================================================================== */ + +#define SH_XN_PI_SIC_CMP_DATA_ENABLE3 0x0000000150031470 +#define SH_XN_PI_SIC_CMP_DATA_ENABLE3_MASK 0xffffffffffffffff +#define SH_XN_PI_SIC_CMP_DATA_ENABLE3_INIT 0x0000000000000000 + +/* SH_XN_PI_SIC_CMP_DATA_ENABLE3_DATA_ENABLE3 */ +/* Description: Data3 */ +#define SH_XN_PI_SIC_CMP_DATA_ENABLE3_DATA_ENABLE3_SHFT 0 +#define SH_XN_PI_SIC_CMP_DATA_ENABLE3_DATA_ENABLE3_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_IILB_CMP_EXP_DATA0" */ +/* NI0 compare IILB input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_NI0_IILB_CMP_EXP_DATA0 0x0000000150031700 +#define SH_XN_NI0_IILB_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_NI0_IILB_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_NI0_IILB_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_NI0_IILB_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_NI0_IILB_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_IILB_CMP_EXP_DATA1" */ +/* NI0 compare IILB input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_NI0_IILB_CMP_EXP_DATA1 0x0000000150031710 +#define SH_XN_NI0_IILB_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_NI0_IILB_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_NI0_IILB_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_NI0_IILB_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_NI0_IILB_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_IILB_CMP_ENABLE0" */ +/* NI0 compare IILB input enable0 */ +/* ==================================================================== */ + +#define SH_XN_NI0_IILB_CMP_ENABLE0 0x0000000150031720 +#define SH_XN_NI0_IILB_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_NI0_IILB_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_NI0_IILB_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_NI0_IILB_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_NI0_IILB_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_IILB_CMP_ENABLE1" */ +/* NI0 compare IILB input enable1 */ +/* ==================================================================== */ + +#define SH_XN_NI0_IILB_CMP_ENABLE1 0x0000000150031730 +#define SH_XN_NI0_IILB_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_NI0_IILB_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_NI0_IILB_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_NI0_IILB_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_NI0_IILB_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_PI_CMP_EXP_DATA0" */ +/* NI0 compare PI input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_NI0_PI_CMP_EXP_DATA0 0x0000000150031740 +#define SH_XN_NI0_PI_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_NI0_PI_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_NI0_PI_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_NI0_PI_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_NI0_PI_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_PI_CMP_EXP_DATA1" */ +/* NI0 compare PI input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_NI0_PI_CMP_EXP_DATA1 0x0000000150031750 +#define SH_XN_NI0_PI_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_NI0_PI_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_NI0_PI_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_NI0_PI_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_NI0_PI_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_PI_CMP_ENABLE0" */ +/* NI0 compare PI input enable0 */ +/* ==================================================================== */ + +#define SH_XN_NI0_PI_CMP_ENABLE0 0x0000000150031760 +#define SH_XN_NI0_PI_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_NI0_PI_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_NI0_PI_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_NI0_PI_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_NI0_PI_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_PI_CMP_ENABLE1" */ +/* NI0 compare PI input enable1 */ +/* ==================================================================== */ + +#define SH_XN_NI0_PI_CMP_ENABLE1 0x0000000150031770 +#define SH_XN_NI0_PI_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_NI0_PI_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_NI0_PI_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_NI0_PI_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_NI0_PI_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_MD_CMP_EXP_DATA0" */ +/* NI0 compare MD input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_NI0_MD_CMP_EXP_DATA0 0x0000000150031780 +#define SH_XN_NI0_MD_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_NI0_MD_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_NI0_MD_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_NI0_MD_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_NI0_MD_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_MD_CMP_EXP_DATA1" */ +/* NI0 compare MD input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_NI0_MD_CMP_EXP_DATA1 0x0000000150031790 +#define SH_XN_NI0_MD_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_NI0_MD_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_NI0_MD_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_NI0_MD_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_NI0_MD_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_MD_CMP_ENABLE0" */ +/* NI0 compare MD input enable0 */ +/* ==================================================================== */ + +#define SH_XN_NI0_MD_CMP_ENABLE0 0x00000001500317a0 +#define SH_XN_NI0_MD_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_NI0_MD_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_NI0_MD_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_NI0_MD_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_NI0_MD_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_MD_CMP_ENABLE1" */ +/* NI0 compare MD input enable1 */ +/* ==================================================================== */ + +#define SH_XN_NI0_MD_CMP_ENABLE1 0x00000001500317b0 +#define SH_XN_NI0_MD_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_NI0_MD_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_NI0_MD_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_NI0_MD_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_NI0_MD_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_NI_CMP_EXP_DATA0" */ +/* NI0 compare NI input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_NI0_NI_CMP_EXP_DATA0 0x00000001500317c0 +#define SH_XN_NI0_NI_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_NI0_NI_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_NI0_NI_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_NI0_NI_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_NI0_NI_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_NI_CMP_EXP_DATA1" */ +/* NI0 compare NI input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_NI0_NI_CMP_EXP_DATA1 0x00000001500317d0 +#define SH_XN_NI0_NI_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_NI0_NI_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_NI0_NI_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_NI0_NI_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_NI0_NI_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_NI_CMP_ENABLE0" */ +/* NI0 compare NI input enable0 */ +/* ==================================================================== */ + +#define SH_XN_NI0_NI_CMP_ENABLE0 0x00000001500317e0 +#define SH_XN_NI0_NI_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_NI0_NI_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_NI0_NI_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_NI0_NI_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_NI0_NI_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_NI_CMP_ENABLE1" */ +/* NI0 compare NI input enable1 */ +/* ==================================================================== */ + +#define SH_XN_NI0_NI_CMP_ENABLE1 0x00000001500317f0 +#define SH_XN_NI0_NI_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_NI0_NI_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_NI0_NI_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_NI0_NI_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_NI0_NI_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_LLP_CMP_EXP_DATA0" */ +/* NI0 compare LLP input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_NI0_LLP_CMP_EXP_DATA0 0x0000000150031800 +#define SH_XN_NI0_LLP_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_NI0_LLP_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_NI0_LLP_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_NI0_LLP_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_NI0_LLP_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_LLP_CMP_EXP_DATA1" */ +/* NI0 compare LLP input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_NI0_LLP_CMP_EXP_DATA1 0x0000000150031810 +#define SH_XN_NI0_LLP_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_NI0_LLP_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_NI0_LLP_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_NI0_LLP_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_NI0_LLP_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_LLP_CMP_ENABLE0" */ +/* NI0 compare LLP input enable0 */ +/* ==================================================================== */ + +#define SH_XN_NI0_LLP_CMP_ENABLE0 0x0000000150031820 +#define SH_XN_NI0_LLP_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_NI0_LLP_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_NI0_LLP_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_NI0_LLP_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_NI0_LLP_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI0_LLP_CMP_ENABLE1" */ +/* NI0 compare LLP input enable1 */ +/* ==================================================================== */ + +#define SH_XN_NI0_LLP_CMP_ENABLE1 0x0000000150031830 +#define SH_XN_NI0_LLP_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_NI0_LLP_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_NI0_LLP_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_NI0_LLP_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_NI0_LLP_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_IILB_CMP_EXP_DATA0" */ +/* NI1 compare IILB input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_NI1_IILB_CMP_EXP_DATA0 0x0000000150031900 +#define SH_XN_NI1_IILB_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_NI1_IILB_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_NI1_IILB_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_NI1_IILB_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_NI1_IILB_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_IILB_CMP_EXP_DATA1" */ +/* NI1 compare IILB input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_NI1_IILB_CMP_EXP_DATA1 0x0000000150031910 +#define SH_XN_NI1_IILB_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_NI1_IILB_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_NI1_IILB_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_NI1_IILB_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_NI1_IILB_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_IILB_CMP_ENABLE0" */ +/* NI1 compare IILB input enable0 */ +/* ==================================================================== */ + +#define SH_XN_NI1_IILB_CMP_ENABLE0 0x0000000150031920 +#define SH_XN_NI1_IILB_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_NI1_IILB_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_NI1_IILB_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_NI1_IILB_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_NI1_IILB_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_IILB_CMP_ENABLE1" */ +/* NI1 compare IILB input enable1 */ +/* ==================================================================== */ + +#define SH_XN_NI1_IILB_CMP_ENABLE1 0x0000000150031930 +#define SH_XN_NI1_IILB_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_NI1_IILB_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_NI1_IILB_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_NI1_IILB_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_NI1_IILB_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_PI_CMP_EXP_DATA0" */ +/* NI1 compare PI input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_NI1_PI_CMP_EXP_DATA0 0x0000000150031940 +#define SH_XN_NI1_PI_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_NI1_PI_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_NI1_PI_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_NI1_PI_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_NI1_PI_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_PI_CMP_EXP_DATA1" */ +/* NI1 compare PI input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_NI1_PI_CMP_EXP_DATA1 0x0000000150031950 +#define SH_XN_NI1_PI_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_NI1_PI_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_NI1_PI_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_NI1_PI_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_NI1_PI_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_PI_CMP_ENABLE0" */ +/* NI1 compare PI input enable0 */ +/* ==================================================================== */ + +#define SH_XN_NI1_PI_CMP_ENABLE0 0x0000000150031960 +#define SH_XN_NI1_PI_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_NI1_PI_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_NI1_PI_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_NI1_PI_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_NI1_PI_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_PI_CMP_ENABLE1" */ +/* NI1 compare PI input enable1 */ +/* ==================================================================== */ + +#define SH_XN_NI1_PI_CMP_ENABLE1 0x0000000150031970 +#define SH_XN_NI1_PI_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_NI1_PI_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_NI1_PI_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_NI1_PI_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_NI1_PI_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_MD_CMP_EXP_DATA0" */ +/* NI1 compare MD input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_NI1_MD_CMP_EXP_DATA0 0x0000000150031980 +#define SH_XN_NI1_MD_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_NI1_MD_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_NI1_MD_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_NI1_MD_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_NI1_MD_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_MD_CMP_EXP_DATA1" */ +/* NI1 compare MD input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_NI1_MD_CMP_EXP_DATA1 0x0000000150031990 +#define SH_XN_NI1_MD_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_NI1_MD_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_NI1_MD_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_NI1_MD_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_NI1_MD_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_MD_CMP_ENABLE0" */ +/* NI1 compare MD input enable0 */ +/* ==================================================================== */ + +#define SH_XN_NI1_MD_CMP_ENABLE0 0x00000001500319a0 +#define SH_XN_NI1_MD_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_NI1_MD_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_NI1_MD_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_NI1_MD_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_NI1_MD_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_MD_CMP_ENABLE1" */ +/* NI1 compare MD input enable1 */ +/* ==================================================================== */ + +#define SH_XN_NI1_MD_CMP_ENABLE1 0x00000001500319b0 +#define SH_XN_NI1_MD_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_NI1_MD_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_NI1_MD_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_NI1_MD_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_NI1_MD_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_NI_CMP_EXP_DATA0" */ +/* NI1 compare NI input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_NI1_NI_CMP_EXP_DATA0 0x00000001500319c0 +#define SH_XN_NI1_NI_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_NI1_NI_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_NI1_NI_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_NI1_NI_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_NI1_NI_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_NI_CMP_EXP_DATA1" */ +/* NI1 compare NI input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_NI1_NI_CMP_EXP_DATA1 0x00000001500319d0 +#define SH_XN_NI1_NI_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_NI1_NI_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_NI1_NI_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_NI1_NI_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_NI1_NI_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_NI_CMP_ENABLE0" */ +/* NI1 compare NI input enable0 */ +/* ==================================================================== */ + +#define SH_XN_NI1_NI_CMP_ENABLE0 0x00000001500319e0 +#define SH_XN_NI1_NI_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_NI1_NI_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_NI1_NI_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_NI1_NI_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_NI1_NI_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_NI_CMP_ENABLE1" */ +/* NI1 compare NI input enable1 */ +/* ==================================================================== */ + +#define SH_XN_NI1_NI_CMP_ENABLE1 0x00000001500319f0 +#define SH_XN_NI1_NI_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_NI1_NI_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_NI1_NI_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_NI1_NI_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_NI1_NI_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_LLP_CMP_EXP_DATA0" */ +/* NI1 compare LLP input expected data0 */ +/* ==================================================================== */ + +#define SH_XN_NI1_LLP_CMP_EXP_DATA0 0x0000000150031a00 +#define SH_XN_NI1_LLP_CMP_EXP_DATA0_MASK 0xffffffffffffffff +#define SH_XN_NI1_LLP_CMP_EXP_DATA0_INIT 0x0000000000000000 + +/* SH_XN_NI1_LLP_CMP_EXP_DATA0_DATA */ +/* Description: Expected data 0 */ +#define SH_XN_NI1_LLP_CMP_EXP_DATA0_DATA_SHFT 0 +#define SH_XN_NI1_LLP_CMP_EXP_DATA0_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_LLP_CMP_EXP_DATA1" */ +/* NI1 compare LLP input expected data1 */ +/* ==================================================================== */ + +#define SH_XN_NI1_LLP_CMP_EXP_DATA1 0x0000000150031a10 +#define SH_XN_NI1_LLP_CMP_EXP_DATA1_MASK 0xffffffffffffffff +#define SH_XN_NI1_LLP_CMP_EXP_DATA1_INIT 0x0000000000000000 + +/* SH_XN_NI1_LLP_CMP_EXP_DATA1_DATA */ +/* Description: Expected data 1 */ +#define SH_XN_NI1_LLP_CMP_EXP_DATA1_DATA_SHFT 0 +#define SH_XN_NI1_LLP_CMP_EXP_DATA1_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_LLP_CMP_ENABLE0" */ +/* NI1 compare LLP input enable0 */ +/* ==================================================================== */ + +#define SH_XN_NI1_LLP_CMP_ENABLE0 0x0000000150031a20 +#define SH_XN_NI1_LLP_CMP_ENABLE0_MASK 0xffffffffffffffff +#define SH_XN_NI1_LLP_CMP_ENABLE0_INIT 0x0000000000000000 + +/* SH_XN_NI1_LLP_CMP_ENABLE0_ENABLE */ +/* Description: Enable0 */ +#define SH_XN_NI1_LLP_CMP_ENABLE0_ENABLE_SHFT 0 +#define SH_XN_NI1_LLP_CMP_ENABLE0_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_NI1_LLP_CMP_ENABLE1" */ +/* NI1 compare LLP input enable1 */ +/* ==================================================================== */ + +#define SH_XN_NI1_LLP_CMP_ENABLE1 0x0000000150031a30 +#define SH_XN_NI1_LLP_CMP_ENABLE1_MASK 0xffffffffffffffff +#define SH_XN_NI1_LLP_CMP_ENABLE1_INIT 0x0000000000000000 + +/* SH_XN_NI1_LLP_CMP_ENABLE1_ENABLE */ +/* Description: Enable1 */ +#define SH_XN_NI1_LLP_CMP_ENABLE1_ENABLE_SHFT 0 +#define SH_XN_NI1_LLP_CMP_ENABLE1_ENABLE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XNPI_ECC_INJ_REG" */ +/* ==================================================================== */ + +#define SH_XNPI_ECC_INJ_REG 0x0000000150032000 +#define SH_XNPI_ECC_INJ_REG_MASK 0xf0fff0fff0fff0ff +#define SH_XNPI_ECC_INJ_REG_INIT 0x0000000000000000 + +/* SH_XNPI_ECC_INJ_REG_BYTE0 */ +/* Description: Replacement Checkbyte */ +#define SH_XNPI_ECC_INJ_REG_BYTE0_SHFT 0 +#define SH_XNPI_ECC_INJ_REG_BYTE0_MASK 0x00000000000000ff + +/* SH_XNPI_ECC_INJ_REG_DATA_1SHOT0 */ +/* Description: 1 shot mask data */ +#define SH_XNPI_ECC_INJ_REG_DATA_1SHOT0_SHFT 12 +#define SH_XNPI_ECC_INJ_REG_DATA_1SHOT0_MASK 0x0000000000001000 + +/* SH_XNPI_ECC_INJ_REG_DATA_CONT0 */ +/* Description: toggle mask data */ +#define SH_XNPI_ECC_INJ_REG_DATA_CONT0_SHFT 13 +#define SH_XNPI_ECC_INJ_REG_DATA_CONT0_MASK 0x0000000000002000 + +/* SH_XNPI_ECC_INJ_REG_DATA_CB_1SHOT0 */ +/* Description: Replace Checkbyte One Shot */ +#define SH_XNPI_ECC_INJ_REG_DATA_CB_1SHOT0_SHFT 14 +#define SH_XNPI_ECC_INJ_REG_DATA_CB_1SHOT0_MASK 0x0000000000004000 + +/* SH_XNPI_ECC_INJ_REG_DATA_CB_CONT0 */ +/* Description: Replace Checkbyte Continuous */ +#define SH_XNPI_ECC_INJ_REG_DATA_CB_CONT0_SHFT 15 +#define SH_XNPI_ECC_INJ_REG_DATA_CB_CONT0_MASK 0x0000000000008000 + +/* SH_XNPI_ECC_INJ_REG_BYTE1 */ +/* Description: Replacement Checkbyte */ +#define SH_XNPI_ECC_INJ_REG_BYTE1_SHFT 16 +#define SH_XNPI_ECC_INJ_REG_BYTE1_MASK 0x0000000000ff0000 + +/* SH_XNPI_ECC_INJ_REG_DATA_1SHOT1 */ +/* Description: 1 shot mask data */ +#define SH_XNPI_ECC_INJ_REG_DATA_1SHOT1_SHFT 28 +#define SH_XNPI_ECC_INJ_REG_DATA_1SHOT1_MASK 0x0000000010000000 + +/* SH_XNPI_ECC_INJ_REG_DATA_CONT1 */ +/* Description: toggle mask data */ +#define SH_XNPI_ECC_INJ_REG_DATA_CONT1_SHFT 29 +#define SH_XNPI_ECC_INJ_REG_DATA_CONT1_MASK 0x0000000020000000 + +/* SH_XNPI_ECC_INJ_REG_DATA_CB_1SHOT1 */ +/* Description: Replace Checkbyte One Shot */ +#define SH_XNPI_ECC_INJ_REG_DATA_CB_1SHOT1_SHFT 30 +#define SH_XNPI_ECC_INJ_REG_DATA_CB_1SHOT1_MASK 0x0000000040000000 + +/* SH_XNPI_ECC_INJ_REG_DATA_CB_CONT1 */ +/* Description: Replace Checkbyte Continous */ +#define SH_XNPI_ECC_INJ_REG_DATA_CB_CONT1_SHFT 31 +#define SH_XNPI_ECC_INJ_REG_DATA_CB_CONT1_MASK 0x0000000080000000 + +/* SH_XNPI_ECC_INJ_REG_BYTE2 */ +/* Description: Replacement Checkbyte */ +#define SH_XNPI_ECC_INJ_REG_BYTE2_SHFT 32 +#define SH_XNPI_ECC_INJ_REG_BYTE2_MASK 0x000000ff00000000 + +/* SH_XNPI_ECC_INJ_REG_DATA_1SHOT2 */ +/* Description: 1 shot mask data */ +#define SH_XNPI_ECC_INJ_REG_DATA_1SHOT2_SHFT 44 +#define SH_XNPI_ECC_INJ_REG_DATA_1SHOT2_MASK 0x0000100000000000 + +/* SH_XNPI_ECC_INJ_REG_DATA_CONT2 */ +/* Description: toggle mask data */ +#define SH_XNPI_ECC_INJ_REG_DATA_CONT2_SHFT 45 +#define SH_XNPI_ECC_INJ_REG_DATA_CONT2_MASK 0x0000200000000000 + +/* SH_XNPI_ECC_INJ_REG_DATA_CB_1SHOT2 */ +/* Description: Replace Checkbyte OneShot */ +#define SH_XNPI_ECC_INJ_REG_DATA_CB_1SHOT2_SHFT 46 +#define SH_XNPI_ECC_INJ_REG_DATA_CB_1SHOT2_MASK 0x0000400000000000 + +/* SH_XNPI_ECC_INJ_REG_DATA_CB_CONT2 */ +/* Description: Replace Checkbyte Continous */ +#define SH_XNPI_ECC_INJ_REG_DATA_CB_CONT2_SHFT 47 +#define SH_XNPI_ECC_INJ_REG_DATA_CB_CONT2_MASK 0x0000800000000000 + +/* SH_XNPI_ECC_INJ_REG_BYTE3 */ +/* Description: Replacement Checkbyte */ +#define SH_XNPI_ECC_INJ_REG_BYTE3_SHFT 48 +#define SH_XNPI_ECC_INJ_REG_BYTE3_MASK 0x00ff000000000000 + +/* SH_XNPI_ECC_INJ_REG_DATA_1SHOT3 */ +/* Description: 1 shot mask data */ +#define SH_XNPI_ECC_INJ_REG_DATA_1SHOT3_SHFT 60 +#define SH_XNPI_ECC_INJ_REG_DATA_1SHOT3_MASK 0x1000000000000000 + +/* SH_XNPI_ECC_INJ_REG_DATA_CONT3 */ +/* Description: toggle mask data */ +#define SH_XNPI_ECC_INJ_REG_DATA_CONT3_SHFT 61 +#define SH_XNPI_ECC_INJ_REG_DATA_CONT3_MASK 0x2000000000000000 + +/* SH_XNPI_ECC_INJ_REG_DATA_CB_1SHOT3 */ +/* Description: Replace Checkbyte One-Shot */ +#define SH_XNPI_ECC_INJ_REG_DATA_CB_1SHOT3_SHFT 62 +#define SH_XNPI_ECC_INJ_REG_DATA_CB_1SHOT3_MASK 0x4000000000000000 + +/* SH_XNPI_ECC_INJ_REG_DATA_CB_CONT3 */ +/* Description: Replace Checkbyte Continous */ +#define SH_XNPI_ECC_INJ_REG_DATA_CB_CONT3_SHFT 63 +#define SH_XNPI_ECC_INJ_REG_DATA_CB_CONT3_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNPI_ECC0_INJ_MASK_REG" */ +/* ==================================================================== */ + +#define SH_XNPI_ECC0_INJ_MASK_REG 0x0000000150032008 +#define SH_XNPI_ECC0_INJ_MASK_REG_MASK 0xffffffffffffffff +#define SH_XNPI_ECC0_INJ_MASK_REG_INIT 0x0000000000000000 + +/* SH_XNPI_ECC0_INJ_MASK_REG_MASK_ECC0 */ +/* Description: Replacement Data */ +#define SH_XNPI_ECC0_INJ_MASK_REG_MASK_ECC0_SHFT 0 +#define SH_XNPI_ECC0_INJ_MASK_REG_MASK_ECC0_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XNPI_ECC1_INJ_MASK_REG" */ +/* ==================================================================== */ + +#define SH_XNPI_ECC1_INJ_MASK_REG 0x0000000150032010 +#define SH_XNPI_ECC1_INJ_MASK_REG_MASK 0xffffffffffffffff +#define SH_XNPI_ECC1_INJ_MASK_REG_INIT 0x0000000000000000 + +/* SH_XNPI_ECC1_INJ_MASK_REG_MASK_ECC1 */ +/* Description: Replacement Data */ +#define SH_XNPI_ECC1_INJ_MASK_REG_MASK_ECC1_SHFT 0 +#define SH_XNPI_ECC1_INJ_MASK_REG_MASK_ECC1_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XNPI_ECC2_INJ_MASK_REG" */ +/* ==================================================================== */ + +#define SH_XNPI_ECC2_INJ_MASK_REG 0x0000000150032018 +#define SH_XNPI_ECC2_INJ_MASK_REG_MASK 0xffffffffffffffff +#define SH_XNPI_ECC2_INJ_MASK_REG_INIT 0x0000000000000000 + +/* SH_XNPI_ECC2_INJ_MASK_REG_MASK_ECC2 */ +/* Description: Replacement Data */ +#define SH_XNPI_ECC2_INJ_MASK_REG_MASK_ECC2_SHFT 0 +#define SH_XNPI_ECC2_INJ_MASK_REG_MASK_ECC2_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XNPI_ECC3_INJ_MASK_REG" */ +/* ==================================================================== */ + +#define SH_XNPI_ECC3_INJ_MASK_REG 0x0000000150032020 +#define SH_XNPI_ECC3_INJ_MASK_REG_MASK 0xffffffffffffffff +#define SH_XNPI_ECC3_INJ_MASK_REG_INIT 0x0000000000000000 + +/* SH_XNPI_ECC3_INJ_MASK_REG_MASK_ECC3 */ +/* Description: Replacement Data */ +#define SH_XNPI_ECC3_INJ_MASK_REG_MASK_ECC3_SHFT 0 +#define SH_XNPI_ECC3_INJ_MASK_REG_MASK_ECC3_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XNMD_ECC_INJ_REG" */ +/* ==================================================================== */ + +#define SH_XNMD_ECC_INJ_REG 0x0000000150032030 +#define SH_XNMD_ECC_INJ_REG_MASK 0xf0fff0fff0fff0ff +#define SH_XNMD_ECC_INJ_REG_INIT 0x0000000000000000 + +/* SH_XNMD_ECC_INJ_REG_BYTE0 */ +/* Description: Replacement Checkbyte */ +#define SH_XNMD_ECC_INJ_REG_BYTE0_SHFT 0 +#define SH_XNMD_ECC_INJ_REG_BYTE0_MASK 0x00000000000000ff + +/* SH_XNMD_ECC_INJ_REG_DATA_1SHOT0 */ +/* Description: 1 shot mask data */ +#define SH_XNMD_ECC_INJ_REG_DATA_1SHOT0_SHFT 12 +#define SH_XNMD_ECC_INJ_REG_DATA_1SHOT0_MASK 0x0000000000001000 + +/* SH_XNMD_ECC_INJ_REG_DATA_CONT0 */ +/* Description: toggle mask data */ +#define SH_XNMD_ECC_INJ_REG_DATA_CONT0_SHFT 13 +#define SH_XNMD_ECC_INJ_REG_DATA_CONT0_MASK 0x0000000000002000 + +/* SH_XNMD_ECC_INJ_REG_DATA_CB_1SHOT0 */ +/* Description: Replace Checkbyte One Shot */ +#define SH_XNMD_ECC_INJ_REG_DATA_CB_1SHOT0_SHFT 14 +#define SH_XNMD_ECC_INJ_REG_DATA_CB_1SHOT0_MASK 0x0000000000004000 + +/* SH_XNMD_ECC_INJ_REG_DATA_CB_CONT0 */ +/* Description: Replace Checkbyte Continuous */ +#define SH_XNMD_ECC_INJ_REG_DATA_CB_CONT0_SHFT 15 +#define SH_XNMD_ECC_INJ_REG_DATA_CB_CONT0_MASK 0x0000000000008000 + +/* SH_XNMD_ECC_INJ_REG_BYTE1 */ +/* Description: Replacement Checkbyte */ +#define SH_XNMD_ECC_INJ_REG_BYTE1_SHFT 16 +#define SH_XNMD_ECC_INJ_REG_BYTE1_MASK 0x0000000000ff0000 + +/* SH_XNMD_ECC_INJ_REG_DATA_1SHOT1 */ +/* Description: 1 shot mask data */ +#define SH_XNMD_ECC_INJ_REG_DATA_1SHOT1_SHFT 28 +#define SH_XNMD_ECC_INJ_REG_DATA_1SHOT1_MASK 0x0000000010000000 + +/* SH_XNMD_ECC_INJ_REG_DATA_CONT1 */ +/* Description: toggle mask data */ +#define SH_XNMD_ECC_INJ_REG_DATA_CONT1_SHFT 29 +#define SH_XNMD_ECC_INJ_REG_DATA_CONT1_MASK 0x0000000020000000 + +/* SH_XNMD_ECC_INJ_REG_DATA_CB_1SHOT1 */ +/* Description: Replace Checkbyte One Shot */ +#define SH_XNMD_ECC_INJ_REG_DATA_CB_1SHOT1_SHFT 30 +#define SH_XNMD_ECC_INJ_REG_DATA_CB_1SHOT1_MASK 0x0000000040000000 + +/* SH_XNMD_ECC_INJ_REG_DATA_CB_CONT1 */ +/* Description: Replace Checkbyte Continous */ +#define SH_XNMD_ECC_INJ_REG_DATA_CB_CONT1_SHFT 31 +#define SH_XNMD_ECC_INJ_REG_DATA_CB_CONT1_MASK 0x0000000080000000 + +/* SH_XNMD_ECC_INJ_REG_BYTE2 */ +/* Description: Replacement Checkbyte */ +#define SH_XNMD_ECC_INJ_REG_BYTE2_SHFT 32 +#define SH_XNMD_ECC_INJ_REG_BYTE2_MASK 0x000000ff00000000 + +/* SH_XNMD_ECC_INJ_REG_DATA_1SHOT2 */ +/* Description: 1 shot mask data */ +#define SH_XNMD_ECC_INJ_REG_DATA_1SHOT2_SHFT 44 +#define SH_XNMD_ECC_INJ_REG_DATA_1SHOT2_MASK 0x0000100000000000 + +/* SH_XNMD_ECC_INJ_REG_DATA_CONT2 */ +/* Description: toggle mask data */ +#define SH_XNMD_ECC_INJ_REG_DATA_CONT2_SHFT 45 +#define SH_XNMD_ECC_INJ_REG_DATA_CONT2_MASK 0x0000200000000000 + +/* SH_XNMD_ECC_INJ_REG_DATA_CB_1SHOT2 */ +/* Description: Replace Checkbyte OneShot */ +#define SH_XNMD_ECC_INJ_REG_DATA_CB_1SHOT2_SHFT 46 +#define SH_XNMD_ECC_INJ_REG_DATA_CB_1SHOT2_MASK 0x0000400000000000 + +/* SH_XNMD_ECC_INJ_REG_DATA_CB_CONT2 */ +/* Description: Replace Checkbyte Continous */ +#define SH_XNMD_ECC_INJ_REG_DATA_CB_CONT2_SHFT 47 +#define SH_XNMD_ECC_INJ_REG_DATA_CB_CONT2_MASK 0x0000800000000000 + +/* SH_XNMD_ECC_INJ_REG_BYTE3 */ +/* Description: Replacement Checkbyte */ +#define SH_XNMD_ECC_INJ_REG_BYTE3_SHFT 48 +#define SH_XNMD_ECC_INJ_REG_BYTE3_MASK 0x00ff000000000000 + +/* SH_XNMD_ECC_INJ_REG_DATA_1SHOT3 */ +/* Description: 1 shot mask data */ +#define SH_XNMD_ECC_INJ_REG_DATA_1SHOT3_SHFT 60 +#define SH_XNMD_ECC_INJ_REG_DATA_1SHOT3_MASK 0x1000000000000000 + +/* SH_XNMD_ECC_INJ_REG_DATA_CONT3 */ +/* Description: toggle mask data */ +#define SH_XNMD_ECC_INJ_REG_DATA_CONT3_SHFT 61 +#define SH_XNMD_ECC_INJ_REG_DATA_CONT3_MASK 0x2000000000000000 + +/* SH_XNMD_ECC_INJ_REG_DATA_CB_1SHOT3 */ +/* Description: Replace Checkbyte One-Shot */ +#define SH_XNMD_ECC_INJ_REG_DATA_CB_1SHOT3_SHFT 62 +#define SH_XNMD_ECC_INJ_REG_DATA_CB_1SHOT3_MASK 0x4000000000000000 + +/* SH_XNMD_ECC_INJ_REG_DATA_CB_CONT3 */ +/* Description: Replace Checkbyte Continous */ +#define SH_XNMD_ECC_INJ_REG_DATA_CB_CONT3_SHFT 63 +#define SH_XNMD_ECC_INJ_REG_DATA_CB_CONT3_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNMD_ECC0_INJ_MASK_REG" */ +/* ==================================================================== */ + +#define SH_XNMD_ECC0_INJ_MASK_REG 0x0000000150032038 +#define SH_XNMD_ECC0_INJ_MASK_REG_MASK 0xffffffffffffffff +#define SH_XNMD_ECC0_INJ_MASK_REG_INIT 0x0000000000000000 + +/* SH_XNMD_ECC0_INJ_MASK_REG_MASK_ECC0 */ +/* Description: Replacement Data */ +#define SH_XNMD_ECC0_INJ_MASK_REG_MASK_ECC0_SHFT 0 +#define SH_XNMD_ECC0_INJ_MASK_REG_MASK_ECC0_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XNMD_ECC1_INJ_MASK_REG" */ +/* ==================================================================== */ + +#define SH_XNMD_ECC1_INJ_MASK_REG 0x0000000150032040 +#define SH_XNMD_ECC1_INJ_MASK_REG_MASK 0xffffffffffffffff +#define SH_XNMD_ECC1_INJ_MASK_REG_INIT 0x0000000000000000 + +/* SH_XNMD_ECC1_INJ_MASK_REG_MASK_ECC1 */ +/* Description: Replacement Data */ +#define SH_XNMD_ECC1_INJ_MASK_REG_MASK_ECC1_SHFT 0 +#define SH_XNMD_ECC1_INJ_MASK_REG_MASK_ECC1_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XNMD_ECC2_INJ_MASK_REG" */ +/* ==================================================================== */ + +#define SH_XNMD_ECC2_INJ_MASK_REG 0x0000000150032048 +#define SH_XNMD_ECC2_INJ_MASK_REG_MASK 0xffffffffffffffff +#define SH_XNMD_ECC2_INJ_MASK_REG_INIT 0x0000000000000000 + +/* SH_XNMD_ECC2_INJ_MASK_REG_MASK_ECC2 */ +/* Description: Replacement Data */ +#define SH_XNMD_ECC2_INJ_MASK_REG_MASK_ECC2_SHFT 0 +#define SH_XNMD_ECC2_INJ_MASK_REG_MASK_ECC2_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XNMD_ECC3_INJ_MASK_REG" */ +/* ==================================================================== */ + +#define SH_XNMD_ECC3_INJ_MASK_REG 0x0000000150032050 +#define SH_XNMD_ECC3_INJ_MASK_REG_MASK 0xffffffffffffffff +#define SH_XNMD_ECC3_INJ_MASK_REG_INIT 0x0000000000000000 + +/* SH_XNMD_ECC3_INJ_MASK_REG_MASK_ECC3 */ +/* Description: Replacement Data */ +#define SH_XNMD_ECC3_INJ_MASK_REG_MASK_ECC3_SHFT 0 +#define SH_XNMD_ECC3_INJ_MASK_REG_MASK_ECC3_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XNMD_ECC_ERR_REPORT" */ +/* ==================================================================== */ + +#define SH_XNMD_ECC_ERR_REPORT 0x0000000150032058 +#define SH_XNMD_ECC_ERR_REPORT_MASK 0x0001000100010001 +#define SH_XNMD_ECC_ERR_REPORT_INIT 0x0000000000000000 + +/* SH_XNMD_ECC_ERR_REPORT_ECC_DISABLE0 */ +/* Description: Disable Error Correction */ +#define SH_XNMD_ECC_ERR_REPORT_ECC_DISABLE0_SHFT 0 +#define SH_XNMD_ECC_ERR_REPORT_ECC_DISABLE0_MASK 0x0000000000000001 + +/* SH_XNMD_ECC_ERR_REPORT_ECC_DISABLE1 */ +/* Description: Disable Error Correction */ +#define SH_XNMD_ECC_ERR_REPORT_ECC_DISABLE1_SHFT 16 +#define SH_XNMD_ECC_ERR_REPORT_ECC_DISABLE1_MASK 0x0000000000010000 + +/* SH_XNMD_ECC_ERR_REPORT_ECC_DISABLE2 */ +/* Description: Disable Error Correction */ +#define SH_XNMD_ECC_ERR_REPORT_ECC_DISABLE2_SHFT 32 +#define SH_XNMD_ECC_ERR_REPORT_ECC_DISABLE2_MASK 0x0000000100000000 + +/* SH_XNMD_ECC_ERR_REPORT_ECC_DISABLE3 */ +/* Description: Disable Error Correction */ +#define SH_XNMD_ECC_ERR_REPORT_ECC_DISABLE3_SHFT 48 +#define SH_XNMD_ECC_ERR_REPORT_ECC_DISABLE3_MASK 0x0001000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_SUMMARY_1" */ +/* ni0 Error Summary Bits */ +/* ==================================================================== */ + +#define SH_NI0_ERROR_SUMMARY_1 0x0000000150040500 +#define SH_NI0_ERROR_SUMMARY_1_MASK 0xffffffffffffffff +#define SH_NI0_ERROR_SUMMARY_1_INIT 0xffffffffffffffff + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_DEBIT0 */ +/* Description: Fifo 02 debit0 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_DEBIT0_SHFT 0 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_DEBIT0_MASK 0x0000000000000001 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_DEBIT2 */ +/* Description: Fifo 02 debit2 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_DEBIT2_SHFT 1 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_DEBIT2_MASK 0x0000000000000002 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_DEBIT0 */ +/* Description: Fifo 13 debit0 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_DEBIT0_SHFT 2 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_DEBIT0_MASK 0x0000000000000004 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_DEBIT2 */ +/* Description: Fifo 13 debit2 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_DEBIT2_SHFT 3 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_DEBIT2_MASK 0x0000000000000008 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit overflow 0 */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit overflow 1 */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit overflow 2 */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit overflow 0 */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit overflow 1 */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit overflow 2 */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_DEBIT0 */ +/* Description: PI Fifo debit0 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_DEBIT0_SHFT 22 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_DEBIT0_MASK 0x0000000000400000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_DEBIT2 */ +/* Description: PI Fifo debit2 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_DEBIT2_SHFT 23 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_DEBIT2_MASK 0x0000000000800000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_DEBIT0 */ +/* Description: IILB Fifo debit0 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_DEBIT0_SHFT 24 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_DEBIT0_MASK 0x0000000001000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_DEBIT2 */ +/* Description: IILB Fifo debit2 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_DEBIT2_SHFT 25 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_DEBIT2_MASK 0x0000000002000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_DEBIT0 */ +/* Description: MD Fifo debit0 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_DEBIT0_SHFT 26 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_DEBIT0_MASK 0x0000000004000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_DEBIT2 */ +/* Description: MD Fifo debit2 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_DEBIT2_SHFT 27 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_DEBIT2_MASK 0x0000000008000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT0 */ +/* Description: NI Fifo debit0 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT0_SHFT 28 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT0_MASK 0x0000000010000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT1 */ +/* Description: NI Fifo debit1 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT1_SHFT 29 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT1_MASK 0x0000000020000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT2 */ +/* Description: NI Fifo debit2 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT2_SHFT 30 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT2_MASK 0x0000000040000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT3 */ +/* Description: NI Fifo debit3 overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT3_SHFT 31 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT3_MASK 0x0000000080000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit overflow */ +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI0_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO02_VC0 */ +/* Description: Fifo02 vc0 tail timeout */ +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO02_VC0_SHFT 56 +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO02_VC0_MASK 0x0100000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO02_VC2 */ +/* Description: Fifo02 vc2 tail timeout */ +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO02_VC2_SHFT 57 +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO02_VC2_MASK 0x0200000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO13_VC1 */ +/* Description: Fifo13 vc1 tail timeout */ +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO13_VC1_SHFT 58 +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO13_VC1_MASK 0x0400000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO13_VC3 */ +/* Description: Fifo13 vc3 tail timeout */ +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO13_VC3_SHFT 59 +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO13_VC3_MASK 0x0800000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC0 */ +/* Description: NI vc0 tail timeout */ +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC0_SHFT 60 +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC0_MASK 0x1000000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC1 */ +/* Description: NI vc1 tail timeout */ +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC1_SHFT 61 +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC1_MASK 0x2000000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC2 */ +/* Description: NI vc2 tail timeout */ +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC2_SHFT 62 +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC2_MASK 0x4000000000000000 + +/* SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC3 */ +/* Description: NI vc3 tail timeout */ +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC3_SHFT 63 +#define SH_NI0_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC3_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_SUMMARY_1_ALIAS" */ +/* ni0 Error Summary Bits Alias */ +/* ==================================================================== */ + +#define SH_NI0_ERROR_SUMMARY_1_ALIAS 0x0000000150040508 + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_SUMMARY_2" */ +/* ni0 Error Summary Bits */ +/* ==================================================================== */ + +#define SH_NI0_ERROR_SUMMARY_2 0x0000000150040510 +#define SH_NI0_ERROR_SUMMARY_2_MASK 0x7fffffff003fffff +#define SH_NI0_ERROR_SUMMARY_2_INIT 0x7fffffff003fffff + +/* SH_NI0_ERROR_SUMMARY_2_ILLEGAL_VCNI */ +/* Description: Illegal VC NI */ +#define SH_NI0_ERROR_SUMMARY_2_ILLEGAL_VCNI_SHFT 0 +#define SH_NI0_ERROR_SUMMARY_2_ILLEGAL_VCNI_MASK 0x0000000000000001 + +/* SH_NI0_ERROR_SUMMARY_2_ILLEGAL_VCPI */ +/* Description: Illegal VC PI */ +#define SH_NI0_ERROR_SUMMARY_2_ILLEGAL_VCPI_SHFT 1 +#define SH_NI0_ERROR_SUMMARY_2_ILLEGAL_VCPI_MASK 0x0000000000000002 + +/* SH_NI0_ERROR_SUMMARY_2_ILLEGAL_VCMD */ +/* Description: Illegal VC MD */ +#define SH_NI0_ERROR_SUMMARY_2_ILLEGAL_VCMD_SHFT 2 +#define SH_NI0_ERROR_SUMMARY_2_ILLEGAL_VCMD_MASK 0x0000000000000004 + +/* SH_NI0_ERROR_SUMMARY_2_ILLEGAL_VCIILB */ +/* Description: Illegal VC IILB */ +#define SH_NI0_ERROR_SUMMARY_2_ILLEGAL_VCIILB_SHFT 3 +#define SH_NI0_ERROR_SUMMARY_2_ILLEGAL_VCIILB_MASK 0x0000000000000008 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit underflow 0 */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit underflow 1 */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit underflow 2 */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit underflow 0 */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit underflow 1 */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit underflow 2 */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit underflow */ +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI0_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_LLP_DEADLOCK_VC0 */ +/* Description: llp deadlock vc0 */ +#define SH_NI0_ERROR_SUMMARY_2_LLP_DEADLOCK_VC0_SHFT 56 +#define SH_NI0_ERROR_SUMMARY_2_LLP_DEADLOCK_VC0_MASK 0x0100000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_LLP_DEADLOCK_VC1 */ +/* Description: llp deadlock vc1 */ +#define SH_NI0_ERROR_SUMMARY_2_LLP_DEADLOCK_VC1_SHFT 57 +#define SH_NI0_ERROR_SUMMARY_2_LLP_DEADLOCK_VC1_MASK 0x0200000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_LLP_DEADLOCK_VC2 */ +/* Description: llp deadlock vc2 */ +#define SH_NI0_ERROR_SUMMARY_2_LLP_DEADLOCK_VC2_SHFT 58 +#define SH_NI0_ERROR_SUMMARY_2_LLP_DEADLOCK_VC2_MASK 0x0400000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_LLP_DEADLOCK_VC3 */ +/* Description: llp deadlock vc3 */ +#define SH_NI0_ERROR_SUMMARY_2_LLP_DEADLOCK_VC3_SHFT 59 +#define SH_NI0_ERROR_SUMMARY_2_LLP_DEADLOCK_VC3_MASK 0x0800000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_CHIPLET_NOMATCH */ +/* Description: chiplet nomatch */ +#define SH_NI0_ERROR_SUMMARY_2_CHIPLET_NOMATCH_SHFT 60 +#define SH_NI0_ERROR_SUMMARY_2_CHIPLET_NOMATCH_MASK 0x1000000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_NI0_ERROR_SUMMARY_2_LUT_READ_ERROR_SHFT 61 +#define SH_NI0_ERROR_SUMMARY_2_LUT_READ_ERROR_MASK 0x2000000000000000 + +/* SH_NI0_ERROR_SUMMARY_2_RETRY_TIMEOUT_ERROR */ +/* Description: Retry Timeout Error */ +#define SH_NI0_ERROR_SUMMARY_2_RETRY_TIMEOUT_ERROR_SHFT 62 +#define SH_NI0_ERROR_SUMMARY_2_RETRY_TIMEOUT_ERROR_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_SUMMARY_2_ALIAS" */ +/* ni0 Error Summary Bits Alias */ +/* ==================================================================== */ + +#define SH_NI0_ERROR_SUMMARY_2_ALIAS 0x0000000150040518 + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_OVERFLOW_1" */ +/* ni0 Error Overflow Bits */ +/* ==================================================================== */ + +#define SH_NI0_ERROR_OVERFLOW_1 0x0000000150040520 +#define SH_NI0_ERROR_OVERFLOW_1_MASK 0xffffffffffffffff +#define SH_NI0_ERROR_OVERFLOW_1_INIT 0xffffffffffffffff + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_DEBIT0 */ +/* Description: Fifo 02 debit0 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_DEBIT0_SHFT 0 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_DEBIT0_MASK 0x0000000000000001 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_DEBIT2 */ +/* Description: Fifo 02 debit2 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_DEBIT2_SHFT 1 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_DEBIT2_MASK 0x0000000000000002 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_DEBIT0 */ +/* Description: Fifo 13 debit0 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_DEBIT0_SHFT 2 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_DEBIT0_MASK 0x0000000000000004 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_DEBIT2 */ +/* Description: Fifo 13 debit2 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_DEBIT2_SHFT 3 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_DEBIT2_MASK 0x0000000000000008 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit overflow 0 */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit overflow 1 */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit overflow 2 */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit overflow 0 */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit overflow 1 */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit overflow 2 */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_DEBIT0 */ +/* Description: PI Fifo debit0 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_DEBIT0_SHFT 22 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_DEBIT0_MASK 0x0000000000400000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_DEBIT2 */ +/* Description: PI Fifo debit2 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_DEBIT2_SHFT 23 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_DEBIT2_MASK 0x0000000000800000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_DEBIT0 */ +/* Description: IILB Fifo debit0 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_DEBIT0_SHFT 24 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_DEBIT0_MASK 0x0000000001000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_DEBIT2 */ +/* Description: IILB Fifo debit2 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_DEBIT2_SHFT 25 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_DEBIT2_MASK 0x0000000002000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_DEBIT0 */ +/* Description: MD Fifo debit0 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_DEBIT0_SHFT 26 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_DEBIT0_MASK 0x0000000004000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_DEBIT2 */ +/* Description: MD Fifo debit2 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_DEBIT2_SHFT 27 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_DEBIT2_MASK 0x0000000008000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT0 */ +/* Description: NI Fifo debit0 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT0_SHFT 28 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT0_MASK 0x0000000010000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT1 */ +/* Description: NI Fifo debit1 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT1_SHFT 29 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT1_MASK 0x0000000020000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT2 */ +/* Description: NI Fifo debit2 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT2_SHFT 30 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT2_MASK 0x0000000040000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT3 */ +/* Description: NI Fifo debit3 overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT3_SHFT 31 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT3_MASK 0x0000000080000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit overflow */ +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI0_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO02_VC0 */ +/* Description: Fifo02 vc0 tail timeout */ +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO02_VC0_SHFT 56 +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO02_VC0_MASK 0x0100000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO02_VC2 */ +/* Description: Fifo02 vc2 tail timeout */ +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO02_VC2_SHFT 57 +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO02_VC2_MASK 0x0200000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO13_VC1 */ +/* Description: Fifo13 vc1 tail timeout */ +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO13_VC1_SHFT 58 +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO13_VC1_MASK 0x0400000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO13_VC3 */ +/* Description: Fifo13 vc3 tail timeout */ +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO13_VC3_SHFT 59 +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO13_VC3_MASK 0x0800000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC0 */ +/* Description: NI vc0 tail timeout */ +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC0_SHFT 60 +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC0_MASK 0x1000000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC1 */ +/* Description: NI vc1 tail timeout */ +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC1_SHFT 61 +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC1_MASK 0x2000000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC2 */ +/* Description: NI vc2 tail timeout */ +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC2_SHFT 62 +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC2_MASK 0x4000000000000000 + +/* SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC3 */ +/* Description: NI vc3 tail timeout */ +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC3_SHFT 63 +#define SH_NI0_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC3_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_OVERFLOW_1_ALIAS" */ +/* ni0 Error Overflow Bits Alias */ +/* ==================================================================== */ + +#define SH_NI0_ERROR_OVERFLOW_1_ALIAS 0x0000000150040528 + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_OVERFLOW_2" */ +/* ni0 Error Overflow Bits */ +/* ==================================================================== */ + +#define SH_NI0_ERROR_OVERFLOW_2 0x0000000150040530 +#define SH_NI0_ERROR_OVERFLOW_2_MASK 0x7fffffff003fffff +#define SH_NI0_ERROR_OVERFLOW_2_INIT 0x7fffffff003fffff + +/* SH_NI0_ERROR_OVERFLOW_2_ILLEGAL_VCNI */ +/* Description: Illegal VC NI */ +#define SH_NI0_ERROR_OVERFLOW_2_ILLEGAL_VCNI_SHFT 0 +#define SH_NI0_ERROR_OVERFLOW_2_ILLEGAL_VCNI_MASK 0x0000000000000001 + +/* SH_NI0_ERROR_OVERFLOW_2_ILLEGAL_VCPI */ +/* Description: Illegal VC PI */ +#define SH_NI0_ERROR_OVERFLOW_2_ILLEGAL_VCPI_SHFT 1 +#define SH_NI0_ERROR_OVERFLOW_2_ILLEGAL_VCPI_MASK 0x0000000000000002 + +/* SH_NI0_ERROR_OVERFLOW_2_ILLEGAL_VCMD */ +/* Description: Illegal VC MD */ +#define SH_NI0_ERROR_OVERFLOW_2_ILLEGAL_VCMD_SHFT 2 +#define SH_NI0_ERROR_OVERFLOW_2_ILLEGAL_VCMD_MASK 0x0000000000000004 + +/* SH_NI0_ERROR_OVERFLOW_2_ILLEGAL_VCIILB */ +/* Description: Illegal VC IILB */ +#define SH_NI0_ERROR_OVERFLOW_2_ILLEGAL_VCIILB_SHFT 3 +#define SH_NI0_ERROR_OVERFLOW_2_ILLEGAL_VCIILB_MASK 0x0000000000000008 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit underflow 0 */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit underflow 1 */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit underflow 2 */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit underflow 0 */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit underflow 1 */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit underflow 2 */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit underflow */ +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI0_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC0 */ +/* Description: llp deadlock vc0 */ +#define SH_NI0_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC0_SHFT 56 +#define SH_NI0_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC0_MASK 0x0100000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC1 */ +/* Description: llp deadlock vc1 */ +#define SH_NI0_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC1_SHFT 57 +#define SH_NI0_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC1_MASK 0x0200000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC2 */ +/* Description: llp deadlock vc2 */ +#define SH_NI0_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC2_SHFT 58 +#define SH_NI0_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC2_MASK 0x0400000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC3 */ +/* Description: llp deadlock vc3 */ +#define SH_NI0_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC3_SHFT 59 +#define SH_NI0_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC3_MASK 0x0800000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_CHIPLET_NOMATCH */ +/* Description: chiplet nomatch */ +#define SH_NI0_ERROR_OVERFLOW_2_CHIPLET_NOMATCH_SHFT 60 +#define SH_NI0_ERROR_OVERFLOW_2_CHIPLET_NOMATCH_MASK 0x1000000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_NI0_ERROR_OVERFLOW_2_LUT_READ_ERROR_SHFT 61 +#define SH_NI0_ERROR_OVERFLOW_2_LUT_READ_ERROR_MASK 0x2000000000000000 + +/* SH_NI0_ERROR_OVERFLOW_2_RETRY_TIMEOUT_ERROR */ +/* Description: Retry Timeout Error */ +#define SH_NI0_ERROR_OVERFLOW_2_RETRY_TIMEOUT_ERROR_SHFT 62 +#define SH_NI0_ERROR_OVERFLOW_2_RETRY_TIMEOUT_ERROR_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_OVERFLOW_2_ALIAS" */ +/* ni0 Error Overflow Bits Alias */ +/* ==================================================================== */ + +#define SH_NI0_ERROR_OVERFLOW_2_ALIAS 0x0000000150040538 + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_MASK_1" */ +/* ni0 Error Mask Bits */ +/* ==================================================================== */ + +#define SH_NI0_ERROR_MASK_1 0x0000000150040540 +#define SH_NI0_ERROR_MASK_1_MASK 0xffffffffffffffff +#define SH_NI0_ERROR_MASK_1_INIT 0xffffffffffffffff + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_DEBIT0 */ +/* Description: Fifo 02 debit0 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_DEBIT0_SHFT 0 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_DEBIT0_MASK 0x0000000000000001 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_DEBIT2 */ +/* Description: Fifo 02 debit2 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_DEBIT2_SHFT 1 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_DEBIT2_MASK 0x0000000000000002 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_DEBIT0 */ +/* Description: Fifo 13 debit0 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_DEBIT0_SHFT 2 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_DEBIT0_MASK 0x0000000000000004 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_DEBIT2 */ +/* Description: Fifo 13 debit2 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_DEBIT2_SHFT 3 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_DEBIT2_MASK 0x0000000000000008 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit overflow 0 */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI0_ERROR_MASK_1_OVERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit overflow 1 */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI0_ERROR_MASK_1_OVERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit overflow 2 */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI0_ERROR_MASK_1_OVERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit overflow 0 */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI0_ERROR_MASK_1_OVERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit overflow 1 */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI0_ERROR_MASK_1_OVERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit overflow 2 */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI0_ERROR_MASK_1_OVERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_DEBIT0 */ +/* Description: PI Fifo debit0 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_DEBIT0_SHFT 22 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_DEBIT0_MASK 0x0000000000400000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_DEBIT2 */ +/* Description: PI Fifo debit2 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_DEBIT2_SHFT 23 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_DEBIT2_MASK 0x0000000000800000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_DEBIT0 */ +/* Description: IILB Fifo debit0 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_DEBIT0_SHFT 24 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_DEBIT0_MASK 0x0000000001000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_DEBIT2 */ +/* Description: IILB Fifo debit2 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_DEBIT2_SHFT 25 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_DEBIT2_MASK 0x0000000002000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_DEBIT0 */ +/* Description: MD Fifo debit0 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_DEBIT0_SHFT 26 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_DEBIT0_MASK 0x0000000004000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_DEBIT2 */ +/* Description: MD Fifo debit2 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_DEBIT2_SHFT 27 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_DEBIT2_MASK 0x0000000008000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT0 */ +/* Description: NI Fifo debit0 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT0_SHFT 28 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT0_MASK 0x0000000010000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT1 */ +/* Description: NI Fifo debit1 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT1_SHFT 29 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT1_MASK 0x0000000020000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT2 */ +/* Description: NI Fifo debit2 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT2_SHFT 30 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT2_MASK 0x0000000040000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT3 */ +/* Description: NI Fifo debit3 overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT3_SHFT 31 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT3_MASK 0x0000000080000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit overflow */ +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI0_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_FIFO02_VC0 */ +/* Description: Fifo02 vc0 tail timeout */ +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_FIFO02_VC0_SHFT 56 +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_FIFO02_VC0_MASK 0x0100000000000000 + +/* SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_FIFO02_VC2 */ +/* Description: Fifo02 vc2 tail timeout */ +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_FIFO02_VC2_SHFT 57 +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_FIFO02_VC2_MASK 0x0200000000000000 + +/* SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_FIFO13_VC1 */ +/* Description: Fifo13 vc1 tail timeout */ +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_FIFO13_VC1_SHFT 58 +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_FIFO13_VC1_MASK 0x0400000000000000 + +/* SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_FIFO13_VC3 */ +/* Description: Fifo13 vc3 tail timeout */ +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_FIFO13_VC3_SHFT 59 +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_FIFO13_VC3_MASK 0x0800000000000000 + +/* SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC0 */ +/* Description: NI vc0 tail timeout */ +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC0_SHFT 60 +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC0_MASK 0x1000000000000000 + +/* SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC1 */ +/* Description: NI vc1 tail timeout */ +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC1_SHFT 61 +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC1_MASK 0x2000000000000000 + +/* SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC2 */ +/* Description: NI vc2 tail timeout */ +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC2_SHFT 62 +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC2_MASK 0x4000000000000000 + +/* SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC3 */ +/* Description: NI vc3 tail timeout */ +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC3_SHFT 63 +#define SH_NI0_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC3_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_MASK_2" */ +/* ni0 Error Mask Bits */ +/* ==================================================================== */ + +#define SH_NI0_ERROR_MASK_2 0x0000000150040550 +#define SH_NI0_ERROR_MASK_2_MASK 0x7fffffff003fffff +#define SH_NI0_ERROR_MASK_2_INIT 0x7fffffff003fffff + +/* SH_NI0_ERROR_MASK_2_ILLEGAL_VCNI */ +/* Description: Illegal VC NI */ +#define SH_NI0_ERROR_MASK_2_ILLEGAL_VCNI_SHFT 0 +#define SH_NI0_ERROR_MASK_2_ILLEGAL_VCNI_MASK 0x0000000000000001 + +/* SH_NI0_ERROR_MASK_2_ILLEGAL_VCPI */ +/* Description: Illegal VC PI */ +#define SH_NI0_ERROR_MASK_2_ILLEGAL_VCPI_SHFT 1 +#define SH_NI0_ERROR_MASK_2_ILLEGAL_VCPI_MASK 0x0000000000000002 + +/* SH_NI0_ERROR_MASK_2_ILLEGAL_VCMD */ +/* Description: Illegal VC MD */ +#define SH_NI0_ERROR_MASK_2_ILLEGAL_VCMD_SHFT 2 +#define SH_NI0_ERROR_MASK_2_ILLEGAL_VCMD_MASK 0x0000000000000004 + +/* SH_NI0_ERROR_MASK_2_ILLEGAL_VCIILB */ +/* Description: Illegal VC IILB */ +#define SH_NI0_ERROR_MASK_2_ILLEGAL_VCIILB_SHFT 3 +#define SH_NI0_ERROR_MASK_2_ILLEGAL_VCIILB_MASK 0x0000000000000008 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit underflow 0 */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit underflow 1 */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit underflow 2 */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit underflow 0 */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit underflow 1 */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit underflow 2 */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit underflow */ +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI0_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI0_ERROR_MASK_2_LLP_DEADLOCK_VC0 */ +/* Description: llp deadlock vc0 */ +#define SH_NI0_ERROR_MASK_2_LLP_DEADLOCK_VC0_SHFT 56 +#define SH_NI0_ERROR_MASK_2_LLP_DEADLOCK_VC0_MASK 0x0100000000000000 + +/* SH_NI0_ERROR_MASK_2_LLP_DEADLOCK_VC1 */ +/* Description: llp deadlock vc1 */ +#define SH_NI0_ERROR_MASK_2_LLP_DEADLOCK_VC1_SHFT 57 +#define SH_NI0_ERROR_MASK_2_LLP_DEADLOCK_VC1_MASK 0x0200000000000000 + +/* SH_NI0_ERROR_MASK_2_LLP_DEADLOCK_VC2 */ +/* Description: llp deadlock vc2 */ +#define SH_NI0_ERROR_MASK_2_LLP_DEADLOCK_VC2_SHFT 58 +#define SH_NI0_ERROR_MASK_2_LLP_DEADLOCK_VC2_MASK 0x0400000000000000 + +/* SH_NI0_ERROR_MASK_2_LLP_DEADLOCK_VC3 */ +/* Description: llp deadlock vc3 */ +#define SH_NI0_ERROR_MASK_2_LLP_DEADLOCK_VC3_SHFT 59 +#define SH_NI0_ERROR_MASK_2_LLP_DEADLOCK_VC3_MASK 0x0800000000000000 + +/* SH_NI0_ERROR_MASK_2_CHIPLET_NOMATCH */ +/* Description: chiplet nomatch */ +#define SH_NI0_ERROR_MASK_2_CHIPLET_NOMATCH_SHFT 60 +#define SH_NI0_ERROR_MASK_2_CHIPLET_NOMATCH_MASK 0x1000000000000000 + +/* SH_NI0_ERROR_MASK_2_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_NI0_ERROR_MASK_2_LUT_READ_ERROR_SHFT 61 +#define SH_NI0_ERROR_MASK_2_LUT_READ_ERROR_MASK 0x2000000000000000 + +/* SH_NI0_ERROR_MASK_2_RETRY_TIMEOUT_ERROR */ +/* Description: Retry Timeout Error */ +#define SH_NI0_ERROR_MASK_2_RETRY_TIMEOUT_ERROR_SHFT 62 +#define SH_NI0_ERROR_MASK_2_RETRY_TIMEOUT_ERROR_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_FIRST_ERROR_1" */ +/* ni0 First Error Bits */ +/* ==================================================================== */ + +#define SH_NI0_FIRST_ERROR_1 0x0000000150040560 +#define SH_NI0_FIRST_ERROR_1_MASK 0xffffffffffffffff +#define SH_NI0_FIRST_ERROR_1_INIT 0xffffffffffffffff + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_DEBIT0 */ +/* Description: Fifo 02 debit0 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_DEBIT0_SHFT 0 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_DEBIT0_MASK 0x0000000000000001 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_DEBIT2 */ +/* Description: Fifo 02 debit2 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_DEBIT2_SHFT 1 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_DEBIT2_MASK 0x0000000000000002 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_DEBIT0 */ +/* Description: Fifo 13 debit0 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_DEBIT0_SHFT 2 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_DEBIT0_MASK 0x0000000000000004 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_DEBIT2 */ +/* Description: Fifo 13 debit2 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_DEBIT2_SHFT 3 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_DEBIT2_MASK 0x0000000000000008 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit overflow 0 */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit overflow 1 */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit overflow 2 */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit overflow 0 */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit overflow 1 */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit overflow 2 */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_DEBIT0 */ +/* Description: PI Fifo debit0 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_DEBIT0_SHFT 22 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_DEBIT0_MASK 0x0000000000400000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_DEBIT2 */ +/* Description: PI Fifo debit2 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_DEBIT2_SHFT 23 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_DEBIT2_MASK 0x0000000000800000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_DEBIT0 */ +/* Description: IILB Fifo debit0 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_DEBIT0_SHFT 24 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_DEBIT0_MASK 0x0000000001000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_DEBIT2 */ +/* Description: IILB Fifo debit2 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_DEBIT2_SHFT 25 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_DEBIT2_MASK 0x0000000002000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_DEBIT0 */ +/* Description: MD Fifo debit0 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_DEBIT0_SHFT 26 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_DEBIT0_MASK 0x0000000004000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_DEBIT2 */ +/* Description: MD Fifo debit2 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_DEBIT2_SHFT 27 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_DEBIT2_MASK 0x0000000008000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT0 */ +/* Description: NI Fifo debit0 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT0_SHFT 28 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT0_MASK 0x0000000010000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT1 */ +/* Description: NI Fifo debit1 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT1_SHFT 29 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT1_MASK 0x0000000020000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT2 */ +/* Description: NI Fifo debit2 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT2_SHFT 30 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT2_MASK 0x0000000040000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT3 */ +/* Description: NI Fifo debit3 overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT3_SHFT 31 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT3_MASK 0x0000000080000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit overflow */ +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI0_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO02_VC0 */ +/* Description: Fifo02 vc0 tail timeout */ +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO02_VC0_SHFT 56 +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO02_VC0_MASK 0x0100000000000000 + +/* SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO02_VC2 */ +/* Description: Fifo02 vc2 tail timeout */ +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO02_VC2_SHFT 57 +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO02_VC2_MASK 0x0200000000000000 + +/* SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO13_VC1 */ +/* Description: Fifo13 vc1 tail timeout */ +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO13_VC1_SHFT 58 +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO13_VC1_MASK 0x0400000000000000 + +/* SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO13_VC3 */ +/* Description: Fifo13 vc3 tail timeout */ +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO13_VC3_SHFT 59 +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO13_VC3_MASK 0x0800000000000000 + +/* SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC0 */ +/* Description: NI vc0 tail timeout */ +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC0_SHFT 60 +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC0_MASK 0x1000000000000000 + +/* SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC1 */ +/* Description: NI vc1 tail timeout */ +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC1_SHFT 61 +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC1_MASK 0x2000000000000000 + +/* SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC2 */ +/* Description: NI vc2 tail timeout */ +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC2_SHFT 62 +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC2_MASK 0x4000000000000000 + +/* SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC3 */ +/* Description: NI vc3 tail timeout */ +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC3_SHFT 63 +#define SH_NI0_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC3_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_FIRST_ERROR_2" */ +/* ni0 First Error Bits */ +/* ==================================================================== */ + +#define SH_NI0_FIRST_ERROR_2 0x0000000150040570 +#define SH_NI0_FIRST_ERROR_2_MASK 0x7fffffff003fffff +#define SH_NI0_FIRST_ERROR_2_INIT 0x7fffffff003fffff + +/* SH_NI0_FIRST_ERROR_2_ILLEGAL_VCNI */ +/* Description: Illegal VC NI */ +#define SH_NI0_FIRST_ERROR_2_ILLEGAL_VCNI_SHFT 0 +#define SH_NI0_FIRST_ERROR_2_ILLEGAL_VCNI_MASK 0x0000000000000001 + +/* SH_NI0_FIRST_ERROR_2_ILLEGAL_VCPI */ +/* Description: Illegal VC PI */ +#define SH_NI0_FIRST_ERROR_2_ILLEGAL_VCPI_SHFT 1 +#define SH_NI0_FIRST_ERROR_2_ILLEGAL_VCPI_MASK 0x0000000000000002 + +/* SH_NI0_FIRST_ERROR_2_ILLEGAL_VCMD */ +/* Description: Illegal VC MD */ +#define SH_NI0_FIRST_ERROR_2_ILLEGAL_VCMD_SHFT 2 +#define SH_NI0_FIRST_ERROR_2_ILLEGAL_VCMD_MASK 0x0000000000000004 + +/* SH_NI0_FIRST_ERROR_2_ILLEGAL_VCIILB */ +/* Description: Illegal VC IILB */ +#define SH_NI0_FIRST_ERROR_2_ILLEGAL_VCIILB_SHFT 3 +#define SH_NI0_FIRST_ERROR_2_ILLEGAL_VCIILB_MASK 0x0000000000000008 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit underflow 0 */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit underflow 1 */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit underflow 2 */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit underflow 0 */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit underflow 1 */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit underflow 2 */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit underflow */ +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI0_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI0_FIRST_ERROR_2_LLP_DEADLOCK_VC0 */ +/* Description: llp deadlock vc0 */ +#define SH_NI0_FIRST_ERROR_2_LLP_DEADLOCK_VC0_SHFT 56 +#define SH_NI0_FIRST_ERROR_2_LLP_DEADLOCK_VC0_MASK 0x0100000000000000 + +/* SH_NI0_FIRST_ERROR_2_LLP_DEADLOCK_VC1 */ +/* Description: llp deadlock vc1 */ +#define SH_NI0_FIRST_ERROR_2_LLP_DEADLOCK_VC1_SHFT 57 +#define SH_NI0_FIRST_ERROR_2_LLP_DEADLOCK_VC1_MASK 0x0200000000000000 + +/* SH_NI0_FIRST_ERROR_2_LLP_DEADLOCK_VC2 */ +/* Description: llp deadlock vc2 */ +#define SH_NI0_FIRST_ERROR_2_LLP_DEADLOCK_VC2_SHFT 58 +#define SH_NI0_FIRST_ERROR_2_LLP_DEADLOCK_VC2_MASK 0x0400000000000000 + +/* SH_NI0_FIRST_ERROR_2_LLP_DEADLOCK_VC3 */ +/* Description: llp deadlock vc3 */ +#define SH_NI0_FIRST_ERROR_2_LLP_DEADLOCK_VC3_SHFT 59 +#define SH_NI0_FIRST_ERROR_2_LLP_DEADLOCK_VC3_MASK 0x0800000000000000 + +/* SH_NI0_FIRST_ERROR_2_CHIPLET_NOMATCH */ +/* Description: chiplet nomatch */ +#define SH_NI0_FIRST_ERROR_2_CHIPLET_NOMATCH_SHFT 60 +#define SH_NI0_FIRST_ERROR_2_CHIPLET_NOMATCH_MASK 0x1000000000000000 + +/* SH_NI0_FIRST_ERROR_2_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_NI0_FIRST_ERROR_2_LUT_READ_ERROR_SHFT 61 +#define SH_NI0_FIRST_ERROR_2_LUT_READ_ERROR_MASK 0x2000000000000000 + +/* SH_NI0_FIRST_ERROR_2_RETRY_TIMEOUT_ERROR */ +/* Description: Retry Timeout Error */ +#define SH_NI0_FIRST_ERROR_2_RETRY_TIMEOUT_ERROR_SHFT 62 +#define SH_NI0_FIRST_ERROR_2_RETRY_TIMEOUT_ERROR_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_DETAIL_1" */ +/* ni0 Chiplet no match header bits 63:0 */ +/* ==================================================================== */ + +#define SH_NI0_ERROR_DETAIL_1 0x0000000150040580 +#define SH_NI0_ERROR_DETAIL_1_MASK 0xffffffffffffffff +#define SH_NI0_ERROR_DETAIL_1_INIT 0x0000000000000000 + +/* SH_NI0_ERROR_DETAIL_1_HEADER */ +/* Description: Header bits 63:0 */ +#define SH_NI0_ERROR_DETAIL_1_HEADER_SHFT 0 +#define SH_NI0_ERROR_DETAIL_1_HEADER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_DETAIL_2" */ +/* ni0 Chiplet no match header bits 127:64 */ +/* ==================================================================== */ + +#define SH_NI0_ERROR_DETAIL_2 0x0000000150040590 +#define SH_NI0_ERROR_DETAIL_2_MASK 0xffffffffffffffff +#define SH_NI0_ERROR_DETAIL_2_INIT 0x0000000000000000 + +/* SH_NI0_ERROR_DETAIL_2_HEADER */ +/* Description: Header bits 127:64 */ +#define SH_NI0_ERROR_DETAIL_2_HEADER_SHFT 0 +#define SH_NI0_ERROR_DETAIL_2_HEADER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_SUMMARY_1" */ +/* ni1 Error Summary Bits */ +/* ==================================================================== */ + +#define SH_NI1_ERROR_SUMMARY_1 0x0000000150040600 +#define SH_NI1_ERROR_SUMMARY_1_MASK 0xffffffffffffffff +#define SH_NI1_ERROR_SUMMARY_1_INIT 0xffffffffffffffff + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_DEBIT0 */ +/* Description: Fifo 02 debit0 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_DEBIT0_SHFT 0 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_DEBIT0_MASK 0x0000000000000001 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_DEBIT2 */ +/* Description: Fifo 02 debit2 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_DEBIT2_SHFT 1 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_DEBIT2_MASK 0x0000000000000002 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_DEBIT0 */ +/* Description: Fifo 13 debit0 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_DEBIT0_SHFT 2 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_DEBIT0_MASK 0x0000000000000004 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_DEBIT2 */ +/* Description: Fifo 13 debit2 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_DEBIT2_SHFT 3 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_DEBIT2_MASK 0x0000000000000008 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit overflow 0 */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit overflow 1 */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit overflow 2 */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit overflow 0 */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit overflow 1 */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit overflow 2 */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_DEBIT0 */ +/* Description: PI Fifo debit0 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_DEBIT0_SHFT 22 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_DEBIT0_MASK 0x0000000000400000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_DEBIT2 */ +/* Description: PI Fifo debit2 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_DEBIT2_SHFT 23 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_DEBIT2_MASK 0x0000000000800000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_DEBIT0 */ +/* Description: IILB Fifo debit0 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_DEBIT0_SHFT 24 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_DEBIT0_MASK 0x0000000001000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_DEBIT2 */ +/* Description: IILB Fifo debit2 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_DEBIT2_SHFT 25 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_DEBIT2_MASK 0x0000000002000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_DEBIT0 */ +/* Description: MD Fifo debit0 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_DEBIT0_SHFT 26 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_DEBIT0_MASK 0x0000000004000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_DEBIT2 */ +/* Description: MD Fifo debit2 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_DEBIT2_SHFT 27 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_DEBIT2_MASK 0x0000000008000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT0 */ +/* Description: NI Fifo debit0 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT0_SHFT 28 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT0_MASK 0x0000000010000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT1 */ +/* Description: NI Fifo debit1 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT1_SHFT 29 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT1_MASK 0x0000000020000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT2 */ +/* Description: NI Fifo debit2 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT2_SHFT 30 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT2_MASK 0x0000000040000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT3 */ +/* Description: NI Fifo debit3 overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT3_SHFT 31 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_DEBIT3_MASK 0x0000000080000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit overflow */ +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI1_ERROR_SUMMARY_1_OVERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO02_VC0 */ +/* Description: Fifo02 vc0 tail timeout */ +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO02_VC0_SHFT 56 +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO02_VC0_MASK 0x0100000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO02_VC2 */ +/* Description: Fifo02 vc2 tail timeout */ +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO02_VC2_SHFT 57 +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO02_VC2_MASK 0x0200000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO13_VC1 */ +/* Description: Fifo13 vc1 tail timeout */ +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO13_VC1_SHFT 58 +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO13_VC1_MASK 0x0400000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO13_VC3 */ +/* Description: Fifo13 vc3 tail timeout */ +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO13_VC3_SHFT 59 +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_FIFO13_VC3_MASK 0x0800000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC0 */ +/* Description: NI vc0 tail timeout */ +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC0_SHFT 60 +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC0_MASK 0x1000000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC1 */ +/* Description: NI vc1 tail timeout */ +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC1_SHFT 61 +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC1_MASK 0x2000000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC2 */ +/* Description: NI vc2 tail timeout */ +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC2_SHFT 62 +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC2_MASK 0x4000000000000000 + +/* SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC3 */ +/* Description: NI vc3 tail timeout */ +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC3_SHFT 63 +#define SH_NI1_ERROR_SUMMARY_1_TAIL_TIMEOUT_NI_VC3_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_SUMMARY_1_ALIAS" */ +/* ni1 Error Summary Bits Alias */ +/* ==================================================================== */ + +#define SH_NI1_ERROR_SUMMARY_1_ALIAS 0x0000000150040608 + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_SUMMARY_2" */ +/* ni1 Error Summary Bits */ +/* ==================================================================== */ + +#define SH_NI1_ERROR_SUMMARY_2 0x0000000150040610 +#define SH_NI1_ERROR_SUMMARY_2_MASK 0x7fffffff003fffff +#define SH_NI1_ERROR_SUMMARY_2_INIT 0x7fffffff003fffff + +/* SH_NI1_ERROR_SUMMARY_2_ILLEGAL_VCNI */ +/* Description: Illegal VC NI */ +#define SH_NI1_ERROR_SUMMARY_2_ILLEGAL_VCNI_SHFT 0 +#define SH_NI1_ERROR_SUMMARY_2_ILLEGAL_VCNI_MASK 0x0000000000000001 + +/* SH_NI1_ERROR_SUMMARY_2_ILLEGAL_VCPI */ +/* Description: Illegal VC PI */ +#define SH_NI1_ERROR_SUMMARY_2_ILLEGAL_VCPI_SHFT 1 +#define SH_NI1_ERROR_SUMMARY_2_ILLEGAL_VCPI_MASK 0x0000000000000002 + +/* SH_NI1_ERROR_SUMMARY_2_ILLEGAL_VCMD */ +/* Description: Illegal VC MD */ +#define SH_NI1_ERROR_SUMMARY_2_ILLEGAL_VCMD_SHFT 2 +#define SH_NI1_ERROR_SUMMARY_2_ILLEGAL_VCMD_MASK 0x0000000000000004 + +/* SH_NI1_ERROR_SUMMARY_2_ILLEGAL_VCIILB */ +/* Description: Illegal VC IILB */ +#define SH_NI1_ERROR_SUMMARY_2_ILLEGAL_VCIILB_SHFT 3 +#define SH_NI1_ERROR_SUMMARY_2_ILLEGAL_VCIILB_MASK 0x0000000000000008 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit underflow 0 */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit underflow 1 */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit underflow 2 */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit underflow 0 */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit underflow 1 */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit underflow 2 */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit underflow */ +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI1_ERROR_SUMMARY_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_LLP_DEADLOCK_VC0 */ +/* Description: llp deadlock vc0 */ +#define SH_NI1_ERROR_SUMMARY_2_LLP_DEADLOCK_VC0_SHFT 56 +#define SH_NI1_ERROR_SUMMARY_2_LLP_DEADLOCK_VC0_MASK 0x0100000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_LLP_DEADLOCK_VC1 */ +/* Description: llp deadlock vc1 */ +#define SH_NI1_ERROR_SUMMARY_2_LLP_DEADLOCK_VC1_SHFT 57 +#define SH_NI1_ERROR_SUMMARY_2_LLP_DEADLOCK_VC1_MASK 0x0200000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_LLP_DEADLOCK_VC2 */ +/* Description: llp deadlock vc2 */ +#define SH_NI1_ERROR_SUMMARY_2_LLP_DEADLOCK_VC2_SHFT 58 +#define SH_NI1_ERROR_SUMMARY_2_LLP_DEADLOCK_VC2_MASK 0x0400000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_LLP_DEADLOCK_VC3 */ +/* Description: llp deadlock vc3 */ +#define SH_NI1_ERROR_SUMMARY_2_LLP_DEADLOCK_VC3_SHFT 59 +#define SH_NI1_ERROR_SUMMARY_2_LLP_DEADLOCK_VC3_MASK 0x0800000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_CHIPLET_NOMATCH */ +/* Description: chiplet nomatch */ +#define SH_NI1_ERROR_SUMMARY_2_CHIPLET_NOMATCH_SHFT 60 +#define SH_NI1_ERROR_SUMMARY_2_CHIPLET_NOMATCH_MASK 0x1000000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_NI1_ERROR_SUMMARY_2_LUT_READ_ERROR_SHFT 61 +#define SH_NI1_ERROR_SUMMARY_2_LUT_READ_ERROR_MASK 0x2000000000000000 + +/* SH_NI1_ERROR_SUMMARY_2_RETRY_TIMEOUT_ERROR */ +/* Description: Retry Timeout Error */ +#define SH_NI1_ERROR_SUMMARY_2_RETRY_TIMEOUT_ERROR_SHFT 62 +#define SH_NI1_ERROR_SUMMARY_2_RETRY_TIMEOUT_ERROR_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_SUMMARY_2_ALIAS" */ +/* ni1 Error Summary Bits Alias */ +/* ==================================================================== */ + +#define SH_NI1_ERROR_SUMMARY_2_ALIAS 0x0000000150040618 + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_OVERFLOW_1" */ +/* ni1 Error Overflow Bits */ +/* ==================================================================== */ + +#define SH_NI1_ERROR_OVERFLOW_1 0x0000000150040620 +#define SH_NI1_ERROR_OVERFLOW_1_MASK 0xffffffffffffffff +#define SH_NI1_ERROR_OVERFLOW_1_INIT 0xffffffffffffffff + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_DEBIT0 */ +/* Description: Fifo 02 debit0 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_DEBIT0_SHFT 0 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_DEBIT0_MASK 0x0000000000000001 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_DEBIT2 */ +/* Description: Fifo 02 debit2 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_DEBIT2_SHFT 1 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_DEBIT2_MASK 0x0000000000000002 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_DEBIT0 */ +/* Description: Fifo 13 debit0 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_DEBIT0_SHFT 2 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_DEBIT0_MASK 0x0000000000000004 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_DEBIT2 */ +/* Description: Fifo 13 debit2 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_DEBIT2_SHFT 3 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_DEBIT2_MASK 0x0000000000000008 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit overflow 0 */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit overflow 1 */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit overflow 2 */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit overflow 0 */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit overflow 1 */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit overflow 2 */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_DEBIT0 */ +/* Description: PI Fifo debit0 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_DEBIT0_SHFT 22 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_DEBIT0_MASK 0x0000000000400000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_DEBIT2 */ +/* Description: PI Fifo debit2 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_DEBIT2_SHFT 23 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_DEBIT2_MASK 0x0000000000800000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_DEBIT0 */ +/* Description: IILB Fifo debit0 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_DEBIT0_SHFT 24 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_DEBIT0_MASK 0x0000000001000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_DEBIT2 */ +/* Description: IILB Fifo debit2 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_DEBIT2_SHFT 25 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_DEBIT2_MASK 0x0000000002000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_DEBIT0 */ +/* Description: MD Fifo debit0 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_DEBIT0_SHFT 26 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_DEBIT0_MASK 0x0000000004000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_DEBIT2 */ +/* Description: MD Fifo debit2 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_DEBIT2_SHFT 27 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_DEBIT2_MASK 0x0000000008000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT0 */ +/* Description: NI Fifo debit0 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT0_SHFT 28 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT0_MASK 0x0000000010000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT1 */ +/* Description: NI Fifo debit1 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT1_SHFT 29 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT1_MASK 0x0000000020000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT2 */ +/* Description: NI Fifo debit2 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT2_SHFT 30 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT2_MASK 0x0000000040000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT3 */ +/* Description: NI Fifo debit3 overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT3_SHFT 31 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_DEBIT3_MASK 0x0000000080000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit overflow */ +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI1_ERROR_OVERFLOW_1_OVERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO02_VC0 */ +/* Description: Fifo02 vc0 tail timeout */ +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO02_VC0_SHFT 56 +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO02_VC0_MASK 0x0100000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO02_VC2 */ +/* Description: Fifo02 vc2 tail timeout */ +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO02_VC2_SHFT 57 +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO02_VC2_MASK 0x0200000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO13_VC1 */ +/* Description: Fifo13 vc1 tail timeout */ +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO13_VC1_SHFT 58 +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO13_VC1_MASK 0x0400000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO13_VC3 */ +/* Description: Fifo13 vc3 tail timeout */ +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO13_VC3_SHFT 59 +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_FIFO13_VC3_MASK 0x0800000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC0 */ +/* Description: NI vc0 tail timeout */ +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC0_SHFT 60 +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC0_MASK 0x1000000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC1 */ +/* Description: NI vc1 tail timeout */ +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC1_SHFT 61 +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC1_MASK 0x2000000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC2 */ +/* Description: NI vc2 tail timeout */ +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC2_SHFT 62 +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC2_MASK 0x4000000000000000 + +/* SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC3 */ +/* Description: NI vc3 tail timeout */ +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC3_SHFT 63 +#define SH_NI1_ERROR_OVERFLOW_1_TAIL_TIMEOUT_NI_VC3_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_OVERFLOW_1_ALIAS" */ +/* ni1 Error Overflow Bits Alias */ +/* ==================================================================== */ + +#define SH_NI1_ERROR_OVERFLOW_1_ALIAS 0x0000000150040628 + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_OVERFLOW_2" */ +/* ni1 Error Overflow Bits */ +/* ==================================================================== */ + +#define SH_NI1_ERROR_OVERFLOW_2 0x0000000150040630 +#define SH_NI1_ERROR_OVERFLOW_2_MASK 0x7fffffff003fffff +#define SH_NI1_ERROR_OVERFLOW_2_INIT 0x7fffffff003fffff + +/* SH_NI1_ERROR_OVERFLOW_2_ILLEGAL_VCNI */ +/* Description: Illegal VC NI */ +#define SH_NI1_ERROR_OVERFLOW_2_ILLEGAL_VCNI_SHFT 0 +#define SH_NI1_ERROR_OVERFLOW_2_ILLEGAL_VCNI_MASK 0x0000000000000001 + +/* SH_NI1_ERROR_OVERFLOW_2_ILLEGAL_VCPI */ +/* Description: Illegal VC PI */ +#define SH_NI1_ERROR_OVERFLOW_2_ILLEGAL_VCPI_SHFT 1 +#define SH_NI1_ERROR_OVERFLOW_2_ILLEGAL_VCPI_MASK 0x0000000000000002 + +/* SH_NI1_ERROR_OVERFLOW_2_ILLEGAL_VCMD */ +/* Description: Illegal VC MD */ +#define SH_NI1_ERROR_OVERFLOW_2_ILLEGAL_VCMD_SHFT 2 +#define SH_NI1_ERROR_OVERFLOW_2_ILLEGAL_VCMD_MASK 0x0000000000000004 + +/* SH_NI1_ERROR_OVERFLOW_2_ILLEGAL_VCIILB */ +/* Description: Illegal VC IILB */ +#define SH_NI1_ERROR_OVERFLOW_2_ILLEGAL_VCIILB_SHFT 3 +#define SH_NI1_ERROR_OVERFLOW_2_ILLEGAL_VCIILB_MASK 0x0000000000000008 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit underflow 0 */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit underflow 1 */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit underflow 2 */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit underflow 0 */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit underflow 1 */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit underflow 2 */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit underflow */ +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI1_ERROR_OVERFLOW_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC0 */ +/* Description: llp deadlock vc0 */ +#define SH_NI1_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC0_SHFT 56 +#define SH_NI1_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC0_MASK 0x0100000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC1 */ +/* Description: llp deadlock vc1 */ +#define SH_NI1_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC1_SHFT 57 +#define SH_NI1_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC1_MASK 0x0200000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC2 */ +/* Description: llp deadlock vc2 */ +#define SH_NI1_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC2_SHFT 58 +#define SH_NI1_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC2_MASK 0x0400000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC3 */ +/* Description: llp deadlock vc3 */ +#define SH_NI1_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC3_SHFT 59 +#define SH_NI1_ERROR_OVERFLOW_2_LLP_DEADLOCK_VC3_MASK 0x0800000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_CHIPLET_NOMATCH */ +/* Description: chiplet nomatch */ +#define SH_NI1_ERROR_OVERFLOW_2_CHIPLET_NOMATCH_SHFT 60 +#define SH_NI1_ERROR_OVERFLOW_2_CHIPLET_NOMATCH_MASK 0x1000000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_NI1_ERROR_OVERFLOW_2_LUT_READ_ERROR_SHFT 61 +#define SH_NI1_ERROR_OVERFLOW_2_LUT_READ_ERROR_MASK 0x2000000000000000 + +/* SH_NI1_ERROR_OVERFLOW_2_RETRY_TIMEOUT_ERROR */ +/* Description: Retry Timeout Error */ +#define SH_NI1_ERROR_OVERFLOW_2_RETRY_TIMEOUT_ERROR_SHFT 62 +#define SH_NI1_ERROR_OVERFLOW_2_RETRY_TIMEOUT_ERROR_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_OVERFLOW_2_ALIAS" */ +/* ni1 Error Overflow Bits Alias */ +/* ==================================================================== */ + +#define SH_NI1_ERROR_OVERFLOW_2_ALIAS 0x0000000150040638 + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_MASK_1" */ +/* ni1 Error Mask Bits */ +/* ==================================================================== */ + +#define SH_NI1_ERROR_MASK_1 0x0000000150040640 +#define SH_NI1_ERROR_MASK_1_MASK 0xffffffffffffffff +#define SH_NI1_ERROR_MASK_1_INIT 0xffffffffffffffff + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_DEBIT0 */ +/* Description: Fifo 02 debit0 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_DEBIT0_SHFT 0 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_DEBIT0_MASK 0x0000000000000001 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_DEBIT2 */ +/* Description: Fifo 02 debit2 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_DEBIT2_SHFT 1 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_DEBIT2_MASK 0x0000000000000002 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_DEBIT0 */ +/* Description: Fifo 13 debit0 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_DEBIT0_SHFT 2 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_DEBIT0_MASK 0x0000000000000004 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_DEBIT2 */ +/* Description: Fifo 13 debit2 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_DEBIT2_SHFT 3 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_DEBIT2_MASK 0x0000000000000008 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit overflow 0 */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI1_ERROR_MASK_1_OVERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit overflow 1 */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI1_ERROR_MASK_1_OVERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit overflow 2 */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI1_ERROR_MASK_1_OVERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit overflow 0 */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI1_ERROR_MASK_1_OVERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit overflow 1 */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI1_ERROR_MASK_1_OVERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit overflow 2 */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI1_ERROR_MASK_1_OVERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_DEBIT0 */ +/* Description: PI Fifo debit0 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_DEBIT0_SHFT 22 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_DEBIT0_MASK 0x0000000000400000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_DEBIT2 */ +/* Description: PI Fifo debit2 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_DEBIT2_SHFT 23 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_DEBIT2_MASK 0x0000000000800000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_DEBIT0 */ +/* Description: IILB Fifo debit0 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_DEBIT0_SHFT 24 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_DEBIT0_MASK 0x0000000001000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_DEBIT2 */ +/* Description: IILB Fifo debit2 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_DEBIT2_SHFT 25 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_DEBIT2_MASK 0x0000000002000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_DEBIT0 */ +/* Description: MD Fifo debit0 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_DEBIT0_SHFT 26 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_DEBIT0_MASK 0x0000000004000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_DEBIT2 */ +/* Description: MD Fifo debit2 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_DEBIT2_SHFT 27 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_DEBIT2_MASK 0x0000000008000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT0 */ +/* Description: NI Fifo debit0 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT0_SHFT 28 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT0_MASK 0x0000000010000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT1 */ +/* Description: NI Fifo debit1 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT1_SHFT 29 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT1_MASK 0x0000000020000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT2 */ +/* Description: NI Fifo debit2 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT2_SHFT 30 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT2_MASK 0x0000000040000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT3 */ +/* Description: NI Fifo debit3 overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT3_SHFT 31 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_DEBIT3_MASK 0x0000000080000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit overflow */ +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI1_ERROR_MASK_1_OVERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_FIFO02_VC0 */ +/* Description: Fifo02 vc0 tail timeout */ +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_FIFO02_VC0_SHFT 56 +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_FIFO02_VC0_MASK 0x0100000000000000 + +/* SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_FIFO02_VC2 */ +/* Description: Fifo02 vc2 tail timeout */ +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_FIFO02_VC2_SHFT 57 +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_FIFO02_VC2_MASK 0x0200000000000000 + +/* SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_FIFO13_VC1 */ +/* Description: Fifo13 vc1 tail timeout */ +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_FIFO13_VC1_SHFT 58 +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_FIFO13_VC1_MASK 0x0400000000000000 + +/* SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_FIFO13_VC3 */ +/* Description: Fifo13 vc3 tail timeout */ +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_FIFO13_VC3_SHFT 59 +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_FIFO13_VC3_MASK 0x0800000000000000 + +/* SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC0 */ +/* Description: NI vc0 tail timeout */ +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC0_SHFT 60 +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC0_MASK 0x1000000000000000 + +/* SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC1 */ +/* Description: NI vc1 tail timeout */ +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC1_SHFT 61 +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC1_MASK 0x2000000000000000 + +/* SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC2 */ +/* Description: NI vc2 tail timeout */ +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC2_SHFT 62 +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC2_MASK 0x4000000000000000 + +/* SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC3 */ +/* Description: NI vc3 tail timeout */ +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC3_SHFT 63 +#define SH_NI1_ERROR_MASK_1_TAIL_TIMEOUT_NI_VC3_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_MASK_2" */ +/* ni1 Error Mask Bits */ +/* ==================================================================== */ + +#define SH_NI1_ERROR_MASK_2 0x0000000150040650 +#define SH_NI1_ERROR_MASK_2_MASK 0x7fffffff003fffff +#define SH_NI1_ERROR_MASK_2_INIT 0x7fffffff003fffff + +/* SH_NI1_ERROR_MASK_2_ILLEGAL_VCNI */ +/* Description: Illegal VC NI */ +#define SH_NI1_ERROR_MASK_2_ILLEGAL_VCNI_SHFT 0 +#define SH_NI1_ERROR_MASK_2_ILLEGAL_VCNI_MASK 0x0000000000000001 + +/* SH_NI1_ERROR_MASK_2_ILLEGAL_VCPI */ +/* Description: Illegal VC PI */ +#define SH_NI1_ERROR_MASK_2_ILLEGAL_VCPI_SHFT 1 +#define SH_NI1_ERROR_MASK_2_ILLEGAL_VCPI_MASK 0x0000000000000002 + +/* SH_NI1_ERROR_MASK_2_ILLEGAL_VCMD */ +/* Description: Illegal VC MD */ +#define SH_NI1_ERROR_MASK_2_ILLEGAL_VCMD_SHFT 2 +#define SH_NI1_ERROR_MASK_2_ILLEGAL_VCMD_MASK 0x0000000000000004 + +/* SH_NI1_ERROR_MASK_2_ILLEGAL_VCIILB */ +/* Description: Illegal VC IILB */ +#define SH_NI1_ERROR_MASK_2_ILLEGAL_VCIILB_SHFT 3 +#define SH_NI1_ERROR_MASK_2_ILLEGAL_VCIILB_MASK 0x0000000000000008 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit underflow 0 */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit underflow 1 */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit underflow 2 */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit underflow 0 */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit underflow 1 */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit underflow 2 */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit underflow */ +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI1_ERROR_MASK_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI1_ERROR_MASK_2_LLP_DEADLOCK_VC0 */ +/* Description: llp deadlock vc0 */ +#define SH_NI1_ERROR_MASK_2_LLP_DEADLOCK_VC0_SHFT 56 +#define SH_NI1_ERROR_MASK_2_LLP_DEADLOCK_VC0_MASK 0x0100000000000000 + +/* SH_NI1_ERROR_MASK_2_LLP_DEADLOCK_VC1 */ +/* Description: llp deadlock vc1 */ +#define SH_NI1_ERROR_MASK_2_LLP_DEADLOCK_VC1_SHFT 57 +#define SH_NI1_ERROR_MASK_2_LLP_DEADLOCK_VC1_MASK 0x0200000000000000 + +/* SH_NI1_ERROR_MASK_2_LLP_DEADLOCK_VC2 */ +/* Description: llp deadlock vc2 */ +#define SH_NI1_ERROR_MASK_2_LLP_DEADLOCK_VC2_SHFT 58 +#define SH_NI1_ERROR_MASK_2_LLP_DEADLOCK_VC2_MASK 0x0400000000000000 + +/* SH_NI1_ERROR_MASK_2_LLP_DEADLOCK_VC3 */ +/* Description: llp deadlock vc3 */ +#define SH_NI1_ERROR_MASK_2_LLP_DEADLOCK_VC3_SHFT 59 +#define SH_NI1_ERROR_MASK_2_LLP_DEADLOCK_VC3_MASK 0x0800000000000000 + +/* SH_NI1_ERROR_MASK_2_CHIPLET_NOMATCH */ +/* Description: chiplet nomatch */ +#define SH_NI1_ERROR_MASK_2_CHIPLET_NOMATCH_SHFT 60 +#define SH_NI1_ERROR_MASK_2_CHIPLET_NOMATCH_MASK 0x1000000000000000 + +/* SH_NI1_ERROR_MASK_2_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_NI1_ERROR_MASK_2_LUT_READ_ERROR_SHFT 61 +#define SH_NI1_ERROR_MASK_2_LUT_READ_ERROR_MASK 0x2000000000000000 + +/* SH_NI1_ERROR_MASK_2_RETRY_TIMEOUT_ERROR */ +/* Description: Retry Timeout Error */ +#define SH_NI1_ERROR_MASK_2_RETRY_TIMEOUT_ERROR_SHFT 62 +#define SH_NI1_ERROR_MASK_2_RETRY_TIMEOUT_ERROR_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_FIRST_ERROR_1" */ +/* ni1 First Error Bits */ +/* ==================================================================== */ + +#define SH_NI1_FIRST_ERROR_1 0x0000000150040660 +#define SH_NI1_FIRST_ERROR_1_MASK 0xffffffffffffffff +#define SH_NI1_FIRST_ERROR_1_INIT 0xffffffffffffffff + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_DEBIT0 */ +/* Description: Fifo 02 debit0 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_DEBIT0_SHFT 0 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_DEBIT0_MASK 0x0000000000000001 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_DEBIT2 */ +/* Description: Fifo 02 debit2 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_DEBIT2_SHFT 1 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_DEBIT2_MASK 0x0000000000000002 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_DEBIT0 */ +/* Description: Fifo 13 debit0 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_DEBIT0_SHFT 2 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_DEBIT0_MASK 0x0000000000000004 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_DEBIT2 */ +/* Description: Fifo 13 debit2 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_DEBIT2_SHFT 3 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_DEBIT2_MASK 0x0000000000000008 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit overflow 0 */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit overflow 1 */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit overflow 2 */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit overflow 0 */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit overflow 1 */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit overflow 2 */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_DEBIT0 */ +/* Description: PI Fifo debit0 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_DEBIT0_SHFT 22 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_DEBIT0_MASK 0x0000000000400000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_DEBIT2 */ +/* Description: PI Fifo debit2 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_DEBIT2_SHFT 23 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_DEBIT2_MASK 0x0000000000800000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_DEBIT0 */ +/* Description: IILB Fifo debit0 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_DEBIT0_SHFT 24 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_DEBIT0_MASK 0x0000000001000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_DEBIT2 */ +/* Description: IILB Fifo debit2 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_DEBIT2_SHFT 25 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_DEBIT2_MASK 0x0000000002000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_DEBIT0 */ +/* Description: MD Fifo debit0 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_DEBIT0_SHFT 26 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_DEBIT0_MASK 0x0000000004000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_DEBIT2 */ +/* Description: MD Fifo debit2 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_DEBIT2_SHFT 27 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_DEBIT2_MASK 0x0000000008000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT0 */ +/* Description: NI Fifo debit0 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT0_SHFT 28 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT0_MASK 0x0000000010000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT1 */ +/* Description: NI Fifo debit1 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT1_SHFT 29 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT1_MASK 0x0000000020000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT2 */ +/* Description: NI Fifo debit2 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT2_SHFT 30 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT2_MASK 0x0000000040000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT3 */ +/* Description: NI Fifo debit3 overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT3_SHFT 31 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_DEBIT3_MASK 0x0000000080000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit overflow */ +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI1_FIRST_ERROR_1_OVERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO02_VC0 */ +/* Description: Fifo02 vc0 tail timeout */ +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO02_VC0_SHFT 56 +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO02_VC0_MASK 0x0100000000000000 + +/* SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO02_VC2 */ +/* Description: Fifo02 vc2 tail timeout */ +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO02_VC2_SHFT 57 +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO02_VC2_MASK 0x0200000000000000 + +/* SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO13_VC1 */ +/* Description: Fifo13 vc1 tail timeout */ +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO13_VC1_SHFT 58 +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO13_VC1_MASK 0x0400000000000000 + +/* SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO13_VC3 */ +/* Description: Fifo13 vc3 tail timeout */ +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO13_VC3_SHFT 59 +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_FIFO13_VC3_MASK 0x0800000000000000 + +/* SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC0 */ +/* Description: NI vc0 tail timeout */ +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC0_SHFT 60 +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC0_MASK 0x1000000000000000 + +/* SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC1 */ +/* Description: NI vc1 tail timeout */ +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC1_SHFT 61 +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC1_MASK 0x2000000000000000 + +/* SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC2 */ +/* Description: NI vc2 tail timeout */ +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC2_SHFT 62 +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC2_MASK 0x4000000000000000 + +/* SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC3 */ +/* Description: NI vc3 tail timeout */ +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC3_SHFT 63 +#define SH_NI1_FIRST_ERROR_1_TAIL_TIMEOUT_NI_VC3_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_FIRST_ERROR_2" */ +/* ni1 First Error Bits */ +/* ==================================================================== */ + +#define SH_NI1_FIRST_ERROR_2 0x0000000150040670 +#define SH_NI1_FIRST_ERROR_2_MASK 0x7fffffff003fffff +#define SH_NI1_FIRST_ERROR_2_INIT 0x7fffffff003fffff + +/* SH_NI1_FIRST_ERROR_2_ILLEGAL_VCNI */ +/* Description: Illegal VC NI */ +#define SH_NI1_FIRST_ERROR_2_ILLEGAL_VCNI_SHFT 0 +#define SH_NI1_FIRST_ERROR_2_ILLEGAL_VCNI_MASK 0x0000000000000001 + +/* SH_NI1_FIRST_ERROR_2_ILLEGAL_VCPI */ +/* Description: Illegal VC PI */ +#define SH_NI1_FIRST_ERROR_2_ILLEGAL_VCPI_SHFT 1 +#define SH_NI1_FIRST_ERROR_2_ILLEGAL_VCPI_MASK 0x0000000000000002 + +/* SH_NI1_FIRST_ERROR_2_ILLEGAL_VCMD */ +/* Description: Illegal VC MD */ +#define SH_NI1_FIRST_ERROR_2_ILLEGAL_VCMD_SHFT 2 +#define SH_NI1_FIRST_ERROR_2_ILLEGAL_VCMD_MASK 0x0000000000000004 + +/* SH_NI1_FIRST_ERROR_2_ILLEGAL_VCIILB */ +/* Description: Illegal VC IILB */ +#define SH_NI1_FIRST_ERROR_2_ILLEGAL_VCIILB_SHFT 3 +#define SH_NI1_FIRST_ERROR_2_ILLEGAL_VCIILB_MASK 0x0000000000000008 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_POP */ +/* Description: Fifo 02 vc0 pop underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_POP_SHFT 4 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_POP_MASK 0x0000000000000010 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_POP */ +/* Description: Fifo 02 vc2 pop underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_POP_SHFT 5 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_POP_MASK 0x0000000000000020 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC1_POP */ +/* Description: Fifo 13 vc1 pop underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC1_POP_SHFT 6 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC1_POP_MASK 0x0000000000000040 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC3_POP */ +/* Description: Fifo 13 vc3 pop underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC3_POP_SHFT 7 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC3_POP_MASK 0x0000000000000080 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_PUSH */ +/* Description: Fifo 02 vc0 push underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_PUSH_SHFT 8 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_PUSH_MASK 0x0000000000000100 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_PUSH */ +/* Description: Fifo 02 vc2 push underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_PUSH_SHFT 9 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_PUSH_MASK 0x0000000000000200 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC1_PUSH */ +/* Description: Fifo 13 vc1 push underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC1_PUSH_SHFT 10 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC1_PUSH_MASK 0x0000000000000400 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC3_PUSH */ +/* Description: Fifo 13 vc3 push underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC3_PUSH_SHFT 11 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC3_PUSH_MASK 0x0000000000000800 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_CREDIT */ +/* Description: Fifo 02 vc0 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_CREDIT_SHFT 12 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_CREDIT */ +/* Description: Fifo 02 vc2 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_CREDIT_SHFT 13 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO02_VC2_CREDIT_MASK 0x0000000000002000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC0_CREDIT */ +/* Description: Fifo 13 vc0 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC0_CREDIT_SHFT 14 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC0_CREDIT_MASK 0x0000000000004000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC2_CREDIT */ +/* Description: Fifo 13 vc2 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC2_CREDIT_SHFT 15 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_FIFO13_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW0_VC0_CREDIT */ +/* Description: VC0 credit underflow 0 */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW0_VC0_CREDIT_SHFT 16 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW0_VC0_CREDIT_MASK 0x0000000000010000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW1_VC0_CREDIT */ +/* Description: VC0 credit underflow 1 */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW1_VC0_CREDIT_SHFT 17 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW1_VC0_CREDIT_MASK 0x0000000000020000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW2_VC0_CREDIT */ +/* Description: VC0 credit underflow 2 */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW2_VC0_CREDIT_SHFT 18 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW2_VC0_CREDIT_MASK 0x0000000000040000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW0_VC2_CREDIT */ +/* Description: VC2 credit underflow 0 */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW0_VC2_CREDIT_SHFT 19 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW0_VC2_CREDIT_MASK 0x0000000000080000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW1_VC2_CREDIT */ +/* Description: VC2 credit underflow 1 */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW1_VC2_CREDIT_SHFT 20 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW1_VC2_CREDIT_MASK 0x0000000000100000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW2_VC2_CREDIT */ +/* Description: VC2 credit underflow 2 */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW2_VC2_CREDIT_SHFT 21 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW2_VC2_CREDIT_MASK 0x0000000000200000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_POP */ +/* Description: PI Fifo vc0 pop underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_POP_SHFT 32 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_POP_MASK 0x0000000100000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_POP */ +/* Description: PI Fifo vc2 pop underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_POP_SHFT 33 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_POP_MASK 0x0000000200000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_POP */ +/* Description: IILB Fifo vc0 pop underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_POP_SHFT 34 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_POP_MASK 0x0000000400000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_POP */ +/* Description: IILB Fifo vc2 pop underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_POP_SHFT 35 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_POP_MASK 0x0000000800000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_POP */ +/* Description: MD Fifo vc0 pop underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_POP_SHFT 36 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_POP_MASK 0x0000001000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_POP */ +/* Description: MD Fifo vc2 pop underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_POP_SHFT 37 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_POP_MASK 0x0000002000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC0_POP */ +/* Description: NI Fifo vc0 pop underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC0_POP_SHFT 38 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC0_POP_MASK 0x0000004000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC2_POP */ +/* Description: NI Fifo vc2 pop underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC2_POP_SHFT 39 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC2_POP_MASK 0x0000008000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_PUSH */ +/* Description: PI Fifo vc0 push underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_PUSH_SHFT 40 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_PUSH_MASK 0x0000010000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_PUSH */ +/* Description: PI Fifo vc2 push underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_PUSH_SHFT 41 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_PUSH_MASK 0x0000020000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_PUSH */ +/* Description: IILB Fifo vc0 push underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_SHFT 42 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_PUSH_MASK 0x0000040000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_PUSH */ +/* Description: IILB Fifo vc2 push underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_SHFT 43 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_PUSH_MASK 0x0000080000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_PUSH */ +/* Description: MD Fifo vc0 push underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_PUSH_SHFT 44 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_PUSH_MASK 0x0000100000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_PUSH */ +/* Description: MD Fifo vc2 push underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_PUSH_SHFT 45 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_PUSH_MASK 0x0000200000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_CREDIT */ +/* Description: PI Fifo vc0 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_SHFT 46 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_CREDIT */ +/* Description: PI Fifo vc2 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_SHFT 47 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_PI_FIFO_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT */ +/* Description: IILB Fifo vc0 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_SHFT 48 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC0_CREDIT_MASK 0x0001000000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT */ +/* Description: IILB Fifo vc2 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_SHFT 49 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_IILB_FIFO_VC2_CREDIT_MASK 0x0002000000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_CREDIT */ +/* Description: MD Fifo vc0 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_SHFT 50 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC0_CREDIT_MASK 0x0004000000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_CREDIT */ +/* Description: MD Fifo vc2 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_SHFT 51 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_MD_FIFO_VC2_CREDIT_MASK 0x0008000000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC0_CREDIT */ +/* Description: NI Fifo vc0 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_SHFT 52 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC0_CREDIT_MASK 0x0010000000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC1_CREDIT */ +/* Description: NI Fifo vc1 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_SHFT 53 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC1_CREDIT_MASK 0x0020000000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC2_CREDIT */ +/* Description: NI Fifo vc2 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_SHFT 54 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC2_CREDIT_MASK 0x0040000000000000 + +/* SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC3_CREDIT */ +/* Description: NI Fifo vc3 credit underflow */ +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_SHFT 55 +#define SH_NI1_FIRST_ERROR_2_UNDERFLOW_NI_FIFO_VC3_CREDIT_MASK 0x0080000000000000 + +/* SH_NI1_FIRST_ERROR_2_LLP_DEADLOCK_VC0 */ +/* Description: llp deadlock vc0 */ +#define SH_NI1_FIRST_ERROR_2_LLP_DEADLOCK_VC0_SHFT 56 +#define SH_NI1_FIRST_ERROR_2_LLP_DEADLOCK_VC0_MASK 0x0100000000000000 + +/* SH_NI1_FIRST_ERROR_2_LLP_DEADLOCK_VC1 */ +/* Description: llp deadlock vc1 */ +#define SH_NI1_FIRST_ERROR_2_LLP_DEADLOCK_VC1_SHFT 57 +#define SH_NI1_FIRST_ERROR_2_LLP_DEADLOCK_VC1_MASK 0x0200000000000000 + +/* SH_NI1_FIRST_ERROR_2_LLP_DEADLOCK_VC2 */ +/* Description: llp deadlock vc2 */ +#define SH_NI1_FIRST_ERROR_2_LLP_DEADLOCK_VC2_SHFT 58 +#define SH_NI1_FIRST_ERROR_2_LLP_DEADLOCK_VC2_MASK 0x0400000000000000 + +/* SH_NI1_FIRST_ERROR_2_LLP_DEADLOCK_VC3 */ +/* Description: llp deadlock vc3 */ +#define SH_NI1_FIRST_ERROR_2_LLP_DEADLOCK_VC3_SHFT 59 +#define SH_NI1_FIRST_ERROR_2_LLP_DEADLOCK_VC3_MASK 0x0800000000000000 + +/* SH_NI1_FIRST_ERROR_2_CHIPLET_NOMATCH */ +/* Description: chiplet nomatch */ +#define SH_NI1_FIRST_ERROR_2_CHIPLET_NOMATCH_SHFT 60 +#define SH_NI1_FIRST_ERROR_2_CHIPLET_NOMATCH_MASK 0x1000000000000000 + +/* SH_NI1_FIRST_ERROR_2_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_NI1_FIRST_ERROR_2_LUT_READ_ERROR_SHFT 61 +#define SH_NI1_FIRST_ERROR_2_LUT_READ_ERROR_MASK 0x2000000000000000 + +/* SH_NI1_FIRST_ERROR_2_RETRY_TIMEOUT_ERROR */ +/* Description: Retry Timeout Error */ +#define SH_NI1_FIRST_ERROR_2_RETRY_TIMEOUT_ERROR_SHFT 62 +#define SH_NI1_FIRST_ERROR_2_RETRY_TIMEOUT_ERROR_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_DETAIL_1" */ +/* ni1 Chiplet no match header bits 63:0 */ +/* ==================================================================== */ + +#define SH_NI1_ERROR_DETAIL_1 0x0000000150040680 +#define SH_NI1_ERROR_DETAIL_1_MASK 0xffffffffffffffff +#define SH_NI1_ERROR_DETAIL_1_INIT 0x0000000000000000 + +/* SH_NI1_ERROR_DETAIL_1_HEADER */ +/* Description: Header bits 63:0 */ +#define SH_NI1_ERROR_DETAIL_1_HEADER_SHFT 0 +#define SH_NI1_ERROR_DETAIL_1_HEADER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_DETAIL_2" */ +/* ni1 Chiplet no match header bits 127:64 */ +/* ==================================================================== */ + +#define SH_NI1_ERROR_DETAIL_2 0x0000000150040690 +#define SH_NI1_ERROR_DETAIL_2_MASK 0xffffffffffffffff +#define SH_NI1_ERROR_DETAIL_2_INIT 0x0000000000000000 + +/* SH_NI1_ERROR_DETAIL_2_HEADER */ +/* Description: Header bits 127:64 */ +#define SH_NI1_ERROR_DETAIL_2_HEADER_SHFT 0 +#define SH_NI1_ERROR_DETAIL_2_HEADER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_CORRECTED_DETAIL_1" */ +/* Corrected error details */ +/* ==================================================================== */ + +#define SH_XN_CORRECTED_DETAIL_1 0x0000000150040070 +#define SH_XN_CORRECTED_DETAIL_1_MASK 0x0fff0fff0fff0fff +#define SH_XN_CORRECTED_DETAIL_1_INIT 0x0000000000000000 + +/* SH_XN_CORRECTED_DETAIL_1_ECC0_SYNDROME */ +/* Description: ECC0 Syndrome */ +#define SH_XN_CORRECTED_DETAIL_1_ECC0_SYNDROME_SHFT 0 +#define SH_XN_CORRECTED_DETAIL_1_ECC0_SYNDROME_MASK 0x00000000000000ff + +/* SH_XN_CORRECTED_DETAIL_1_ECC0_WC */ +/* Description: ECC0 Word Count */ +#define SH_XN_CORRECTED_DETAIL_1_ECC0_WC_SHFT 8 +#define SH_XN_CORRECTED_DETAIL_1_ECC0_WC_MASK 0x0000000000000300 + +/* SH_XN_CORRECTED_DETAIL_1_ECC0_VC */ +/* Description: ECC0 Virtual Channel */ +#define SH_XN_CORRECTED_DETAIL_1_ECC0_VC_SHFT 10 +#define SH_XN_CORRECTED_DETAIL_1_ECC0_VC_MASK 0x0000000000000c00 + +/* SH_XN_CORRECTED_DETAIL_1_ECC1_SYNDROME */ +/* Description: ECC1 Syndrome */ +#define SH_XN_CORRECTED_DETAIL_1_ECC1_SYNDROME_SHFT 16 +#define SH_XN_CORRECTED_DETAIL_1_ECC1_SYNDROME_MASK 0x0000000000ff0000 + +/* SH_XN_CORRECTED_DETAIL_1_ECC1_WC */ +/* Description: ECC1 Word Count */ +#define SH_XN_CORRECTED_DETAIL_1_ECC1_WC_SHFT 24 +#define SH_XN_CORRECTED_DETAIL_1_ECC1_WC_MASK 0x0000000003000000 + +/* SH_XN_CORRECTED_DETAIL_1_ECC1_VC */ +/* Description: ECC1 Virtual Channel */ +#define SH_XN_CORRECTED_DETAIL_1_ECC1_VC_SHFT 26 +#define SH_XN_CORRECTED_DETAIL_1_ECC1_VC_MASK 0x000000000c000000 + +/* SH_XN_CORRECTED_DETAIL_1_ECC2_SYNDROME */ +/* Description: ECC2 Syndrome */ +#define SH_XN_CORRECTED_DETAIL_1_ECC2_SYNDROME_SHFT 32 +#define SH_XN_CORRECTED_DETAIL_1_ECC2_SYNDROME_MASK 0x000000ff00000000 + +/* SH_XN_CORRECTED_DETAIL_1_ECC2_WC */ +/* Description: ECC2 Word Count */ +#define SH_XN_CORRECTED_DETAIL_1_ECC2_WC_SHFT 40 +#define SH_XN_CORRECTED_DETAIL_1_ECC2_WC_MASK 0x0000030000000000 + +/* SH_XN_CORRECTED_DETAIL_1_ECC2_VC */ +/* Description: ECC2 Virtual Channel */ +#define SH_XN_CORRECTED_DETAIL_1_ECC2_VC_SHFT 42 +#define SH_XN_CORRECTED_DETAIL_1_ECC2_VC_MASK 0x00000c0000000000 + +/* SH_XN_CORRECTED_DETAIL_1_ECC3_SYNDROME */ +/* Description: ECC3 Syndrome */ +#define SH_XN_CORRECTED_DETAIL_1_ECC3_SYNDROME_SHFT 48 +#define SH_XN_CORRECTED_DETAIL_1_ECC3_SYNDROME_MASK 0x00ff000000000000 + +/* SH_XN_CORRECTED_DETAIL_1_ECC3_WC */ +/* Description: ECC3 Word Count */ +#define SH_XN_CORRECTED_DETAIL_1_ECC3_WC_SHFT 56 +#define SH_XN_CORRECTED_DETAIL_1_ECC3_WC_MASK 0x0300000000000000 + +/* SH_XN_CORRECTED_DETAIL_1_ECC3_VC */ +/* Description: ECC3 Virtual Channel */ +#define SH_XN_CORRECTED_DETAIL_1_ECC3_VC_SHFT 58 +#define SH_XN_CORRECTED_DETAIL_1_ECC3_VC_MASK 0x0c00000000000000 + +/* ==================================================================== */ +/* Register "SH_XN_CORRECTED_DETAIL_2" */ +/* Corrected error data */ +/* ==================================================================== */ + +#define SH_XN_CORRECTED_DETAIL_2 0x0000000150040080 +#define SH_XN_CORRECTED_DETAIL_2_MASK 0xffffffffffffffff +#define SH_XN_CORRECTED_DETAIL_2_INIT 0x0000000000000000 + +/* SH_XN_CORRECTED_DETAIL_2_DATA */ +/* Description: ECC data */ +#define SH_XN_CORRECTED_DETAIL_2_DATA_SHFT 0 +#define SH_XN_CORRECTED_DETAIL_2_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_CORRECTED_DETAIL_3" */ +/* Corrected error header0 */ +/* ==================================================================== */ + +#define SH_XN_CORRECTED_DETAIL_3 0x0000000150040090 +#define SH_XN_CORRECTED_DETAIL_3_MASK 0xffffffffffffffff +#define SH_XN_CORRECTED_DETAIL_3_INIT 0x0000000000000000 + +/* SH_XN_CORRECTED_DETAIL_3_HEADER0 */ +/* Description: ECC header0 (bits 63 - 0) */ +#define SH_XN_CORRECTED_DETAIL_3_HEADER0_SHFT 0 +#define SH_XN_CORRECTED_DETAIL_3_HEADER0_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_CORRECTED_DETAIL_4" */ +/* Corrected error header1 */ +/* ==================================================================== */ + +#define SH_XN_CORRECTED_DETAIL_4 0x00000001500400a0 +#define SH_XN_CORRECTED_DETAIL_4_MASK 0xc00003ffffffffff +#define SH_XN_CORRECTED_DETAIL_4_INIT 0x0000000000000000 + +/* SH_XN_CORRECTED_DETAIL_4_HEADER1 */ +/* Description: ECC header1 (bits 104 - 64) */ +#define SH_XN_CORRECTED_DETAIL_4_HEADER1_SHFT 0 +#define SH_XN_CORRECTED_DETAIL_4_HEADER1_MASK 0x000003ffffffffff + +/* SH_XN_CORRECTED_DETAIL_4_ERR_GROUP */ +/* Description: Error group */ +#define SH_XN_CORRECTED_DETAIL_4_ERR_GROUP_SHFT 62 +#define SH_XN_CORRECTED_DETAIL_4_ERR_GROUP_MASK 0xc000000000000000 + +/* ==================================================================== */ +/* Register "SH_XN_UNCORRECTED_DETAIL_1" */ +/* Uncorrected error details */ +/* ==================================================================== */ + +#define SH_XN_UNCORRECTED_DETAIL_1 0x00000001500400b0 +#define SH_XN_UNCORRECTED_DETAIL_1_MASK 0x0fff0fff0fff0fff +#define SH_XN_UNCORRECTED_DETAIL_1_INIT 0x0000000000000000 + +/* SH_XN_UNCORRECTED_DETAIL_1_ECC0_SYNDROME */ +/* Description: ECC0 Syndrome */ +#define SH_XN_UNCORRECTED_DETAIL_1_ECC0_SYNDROME_SHFT 0 +#define SH_XN_UNCORRECTED_DETAIL_1_ECC0_SYNDROME_MASK 0x00000000000000ff + +/* SH_XN_UNCORRECTED_DETAIL_1_ECC0_WC */ +/* Description: ECC0 Word Count */ +#define SH_XN_UNCORRECTED_DETAIL_1_ECC0_WC_SHFT 8 +#define SH_XN_UNCORRECTED_DETAIL_1_ECC0_WC_MASK 0x0000000000000300 + +/* SH_XN_UNCORRECTED_DETAIL_1_ECC0_VC */ +/* Description: ECC0 Virtual Channel */ +#define SH_XN_UNCORRECTED_DETAIL_1_ECC0_VC_SHFT 10 +#define SH_XN_UNCORRECTED_DETAIL_1_ECC0_VC_MASK 0x0000000000000c00 + +/* SH_XN_UNCORRECTED_DETAIL_1_ECC1_SYNDROME */ +/* Description: ECC1 Syndrome */ +#define SH_XN_UNCORRECTED_DETAIL_1_ECC1_SYNDROME_SHFT 16 +#define SH_XN_UNCORRECTED_DETAIL_1_ECC1_SYNDROME_MASK 0x0000000000ff0000 + +/* SH_XN_UNCORRECTED_DETAIL_1_ECC1_WC */ +/* Description: ECC1 Word Count */ +#define SH_XN_UNCORRECTED_DETAIL_1_ECC1_WC_SHFT 24 +#define SH_XN_UNCORRECTED_DETAIL_1_ECC1_WC_MASK 0x0000000003000000 + +/* SH_XN_UNCORRECTED_DETAIL_1_ECC1_VC */ +/* Description: ECC1 Virtual Channel */ +#define SH_XN_UNCORRECTED_DETAIL_1_ECC1_VC_SHFT 26 +#define SH_XN_UNCORRECTED_DETAIL_1_ECC1_VC_MASK 0x000000000c000000 + +/* SH_XN_UNCORRECTED_DETAIL_1_ECC2_SYNDROME */ +/* Description: ECC2 Syndrome */ +#define SH_XN_UNCORRECTED_DETAIL_1_ECC2_SYNDROME_SHFT 32 +#define SH_XN_UNCORRECTED_DETAIL_1_ECC2_SYNDROME_MASK 0x000000ff00000000 + +/* SH_XN_UNCORRECTED_DETAIL_1_ECC2_WC */ +/* Description: ECC2 Word Count */ +#define SH_XN_UNCORRECTED_DETAIL_1_ECC2_WC_SHFT 40 +#define SH_XN_UNCORRECTED_DETAIL_1_ECC2_WC_MASK 0x0000030000000000 + +/* SH_XN_UNCORRECTED_DETAIL_1_ECC2_VC */ +/* Description: ECC2 Virtual Channel */ +#define SH_XN_UNCORRECTED_DETAIL_1_ECC2_VC_SHFT 42 +#define SH_XN_UNCORRECTED_DETAIL_1_ECC2_VC_MASK 0x00000c0000000000 + +/* SH_XN_UNCORRECTED_DETAIL_1_ECC3_SYNDROME */ +/* Description: ECC3 Syndrome */ +#define SH_XN_UNCORRECTED_DETAIL_1_ECC3_SYNDROME_SHFT 48 +#define SH_XN_UNCORRECTED_DETAIL_1_ECC3_SYNDROME_MASK 0x00ff000000000000 + +/* SH_XN_UNCORRECTED_DETAIL_1_ECC3_WC */ +/* Description: ECC3 Word Count */ +#define SH_XN_UNCORRECTED_DETAIL_1_ECC3_WC_SHFT 56 +#define SH_XN_UNCORRECTED_DETAIL_1_ECC3_WC_MASK 0x0300000000000000 + +/* SH_XN_UNCORRECTED_DETAIL_1_ECC3_VC */ +/* Description: ECC3 Virtual Channel */ +#define SH_XN_UNCORRECTED_DETAIL_1_ECC3_VC_SHFT 58 +#define SH_XN_UNCORRECTED_DETAIL_1_ECC3_VC_MASK 0x0c00000000000000 + +/* ==================================================================== */ +/* Register "SH_XN_UNCORRECTED_DETAIL_2" */ +/* Uncorrected error data */ +/* ==================================================================== */ + +#define SH_XN_UNCORRECTED_DETAIL_2 0x00000001500400c0 +#define SH_XN_UNCORRECTED_DETAIL_2_MASK 0xffffffffffffffff +#define SH_XN_UNCORRECTED_DETAIL_2_INIT 0x0000000000000000 + +/* SH_XN_UNCORRECTED_DETAIL_2_DATA */ +/* Description: ECC data */ +#define SH_XN_UNCORRECTED_DETAIL_2_DATA_SHFT 0 +#define SH_XN_UNCORRECTED_DETAIL_2_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_UNCORRECTED_DETAIL_3" */ +/* Uncorrected error header0 */ +/* ==================================================================== */ + +#define SH_XN_UNCORRECTED_DETAIL_3 0x00000001500400d0 +#define SH_XN_UNCORRECTED_DETAIL_3_MASK 0xffffffffffffffff +#define SH_XN_UNCORRECTED_DETAIL_3_INIT 0x0000000000000000 + +/* SH_XN_UNCORRECTED_DETAIL_3_HEADER0 */ +/* Description: ECC header0 (bits 63 - 0) */ +#define SH_XN_UNCORRECTED_DETAIL_3_HEADER0_SHFT 0 +#define SH_XN_UNCORRECTED_DETAIL_3_HEADER0_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XN_UNCORRECTED_DETAIL_4" */ +/* Uncorrected error header1 */ +/* ==================================================================== */ + +#define SH_XN_UNCORRECTED_DETAIL_4 0x00000001500400e0 +#define SH_XN_UNCORRECTED_DETAIL_4_MASK 0xc00003ffffffffff +#define SH_XN_UNCORRECTED_DETAIL_4_INIT 0x0000000000000000 + +/* SH_XN_UNCORRECTED_DETAIL_4_HEADER1 */ +/* Description: ECC header1 (bits 104 - 64) */ +#define SH_XN_UNCORRECTED_DETAIL_4_HEADER1_SHFT 0 +#define SH_XN_UNCORRECTED_DETAIL_4_HEADER1_MASK 0x000003ffffffffff + +/* SH_XN_UNCORRECTED_DETAIL_4_ERR_GROUP */ +/* Description: Error group */ +#define SH_XN_UNCORRECTED_DETAIL_4_ERR_GROUP_SHFT 62 +#define SH_XN_UNCORRECTED_DETAIL_4_ERR_GROUP_MASK 0xc000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNMD_ERROR_DETAIL_1" */ +/* Look Up Table Address (md) */ +/* ==================================================================== */ + +#define SH_XNMD_ERROR_DETAIL_1 0x00000001500400f0 +#define SH_XNMD_ERROR_DETAIL_1_MASK 0x00000000000007ff +#define SH_XNMD_ERROR_DETAIL_1_INIT 0x0000000000000000 + +/* SH_XNMD_ERROR_DETAIL_1_LUT_ADDR */ +/* Description: Look Up Table Read Address */ +#define SH_XNMD_ERROR_DETAIL_1_LUT_ADDR_SHFT 0 +#define SH_XNMD_ERROR_DETAIL_1_LUT_ADDR_MASK 0x00000000000007ff + +/* ==================================================================== */ +/* Register "SH_XNPI_ERROR_DETAIL_1" */ +/* Look Up Table Address (pi) */ +/* ==================================================================== */ + +#define SH_XNPI_ERROR_DETAIL_1 0x0000000150040100 +#define SH_XNPI_ERROR_DETAIL_1_MASK 0x00000000000007ff +#define SH_XNPI_ERROR_DETAIL_1_INIT 0x0000000000000000 + +/* SH_XNPI_ERROR_DETAIL_1_LUT_ADDR */ +/* Description: Look Up Table Read Address */ +#define SH_XNPI_ERROR_DETAIL_1_LUT_ADDR_SHFT 0 +#define SH_XNPI_ERROR_DETAIL_1_LUT_ADDR_MASK 0x00000000000007ff + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERROR_DETAIL_1" */ +/* Chiplet NoMatch header [63:0] */ +/* ==================================================================== */ + +#define SH_XNIILB_ERROR_DETAIL_1 0x0000000150040110 +#define SH_XNIILB_ERROR_DETAIL_1_MASK 0xffffffffffffffff +#define SH_XNIILB_ERROR_DETAIL_1_INIT 0x0000000000000000 + +/* SH_XNIILB_ERROR_DETAIL_1_HEADER */ +/* Description: header bits [63:0] */ +#define SH_XNIILB_ERROR_DETAIL_1_HEADER_SHFT 0 +#define SH_XNIILB_ERROR_DETAIL_1_HEADER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERROR_DETAIL_2" */ +/* Chiplet NoMatch header [127:64] */ +/* ==================================================================== */ + +#define SH_XNIILB_ERROR_DETAIL_2 0x0000000150040120 +#define SH_XNIILB_ERROR_DETAIL_2_MASK 0xffffffffffffffff +#define SH_XNIILB_ERROR_DETAIL_2_INIT 0x0000000000000000 + +/* SH_XNIILB_ERROR_DETAIL_2_HEADER */ +/* Description: header bits [127:64] */ +#define SH_XNIILB_ERROR_DETAIL_2_HEADER_SHFT 0 +#define SH_XNIILB_ERROR_DETAIL_2_HEADER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERROR_DETAIL_3" */ +/* Look Up Table Address (iilb) */ +/* ==================================================================== */ + +#define SH_XNIILB_ERROR_DETAIL_3 0x0000000150040130 +#define SH_XNIILB_ERROR_DETAIL_3_MASK 0x00000000000007ff +#define SH_XNIILB_ERROR_DETAIL_3_INIT 0x0000000000000000 + +/* SH_XNIILB_ERROR_DETAIL_3_LUT_ADDR */ +/* Description: Look Up Table Read Address */ +#define SH_XNIILB_ERROR_DETAIL_3_LUT_ADDR_SHFT 0 +#define SH_XNIILB_ERROR_DETAIL_3_LUT_ADDR_MASK 0x00000000000007ff + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_DETAIL_3" */ +/* Look Up Table Address (ni0) */ +/* ==================================================================== */ + +#define SH_NI0_ERROR_DETAIL_3 0x0000000150040140 +#define SH_NI0_ERROR_DETAIL_3_MASK 0x00000000000007ff +#define SH_NI0_ERROR_DETAIL_3_INIT 0x0000000000000000 + +/* SH_NI0_ERROR_DETAIL_3_LUT_ADDR */ +/* Description: Look Up Table Read Address */ +#define SH_NI0_ERROR_DETAIL_3_LUT_ADDR_SHFT 0 +#define SH_NI0_ERROR_DETAIL_3_LUT_ADDR_MASK 0x00000000000007ff + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_DETAIL_3" */ +/* Look Up Table Address (ni1) */ +/* ==================================================================== */ + +#define SH_NI1_ERROR_DETAIL_3 0x0000000150040150 +#define SH_NI1_ERROR_DETAIL_3_MASK 0x00000000000007ff +#define SH_NI1_ERROR_DETAIL_3_INIT 0x0000000000000000 + +/* SH_NI1_ERROR_DETAIL_3_LUT_ADDR */ +/* Description: Look Up Table Read Address */ +#define SH_NI1_ERROR_DETAIL_3_LUT_ADDR_SHFT 0 +#define SH_NI1_ERROR_DETAIL_3_LUT_ADDR_MASK 0x00000000000007ff + +/* ==================================================================== */ +/* Register "SH_XN_ERROR_SUMMARY" */ +/* ==================================================================== */ + +#define SH_XN_ERROR_SUMMARY 0x0000000150040000 +#define SH_XN_ERROR_SUMMARY_MASK 0x0000003fffffffff +#define SH_XN_ERROR_SUMMARY_INIT 0x0000003fffffffff + +/* SH_XN_ERROR_SUMMARY_NI0_POP_OVERFLOW */ +/* Description: NI0 pop overflow */ +#define SH_XN_ERROR_SUMMARY_NI0_POP_OVERFLOW_SHFT 0 +#define SH_XN_ERROR_SUMMARY_NI0_POP_OVERFLOW_MASK 0x0000000000000001 + +/* SH_XN_ERROR_SUMMARY_NI0_PUSH_OVERFLOW */ +/* Description: NI0 push overflow */ +#define SH_XN_ERROR_SUMMARY_NI0_PUSH_OVERFLOW_SHFT 1 +#define SH_XN_ERROR_SUMMARY_NI0_PUSH_OVERFLOW_MASK 0x0000000000000002 + +/* SH_XN_ERROR_SUMMARY_NI0_CREDIT_OVERFLOW */ +/* Description: NI0 credit overflow */ +#define SH_XN_ERROR_SUMMARY_NI0_CREDIT_OVERFLOW_SHFT 2 +#define SH_XN_ERROR_SUMMARY_NI0_CREDIT_OVERFLOW_MASK 0x0000000000000004 + +/* SH_XN_ERROR_SUMMARY_NI0_DEBIT_OVERFLOW */ +/* Description: NI0 debit overflow */ +#define SH_XN_ERROR_SUMMARY_NI0_DEBIT_OVERFLOW_SHFT 3 +#define SH_XN_ERROR_SUMMARY_NI0_DEBIT_OVERFLOW_MASK 0x0000000000000008 + +/* SH_XN_ERROR_SUMMARY_NI0_POP_UNDERFLOW */ +/* Description: NI0 pop underflow */ +#define SH_XN_ERROR_SUMMARY_NI0_POP_UNDERFLOW_SHFT 4 +#define SH_XN_ERROR_SUMMARY_NI0_POP_UNDERFLOW_MASK 0x0000000000000010 + +/* SH_XN_ERROR_SUMMARY_NI0_PUSH_UNDERFLOW */ +/* Description: NI0 push underflow */ +#define SH_XN_ERROR_SUMMARY_NI0_PUSH_UNDERFLOW_SHFT 5 +#define SH_XN_ERROR_SUMMARY_NI0_PUSH_UNDERFLOW_MASK 0x0000000000000020 + +/* SH_XN_ERROR_SUMMARY_NI0_CREDIT_UNDERFLOW */ +/* Description: NI0 credit underflow */ +#define SH_XN_ERROR_SUMMARY_NI0_CREDIT_UNDERFLOW_SHFT 6 +#define SH_XN_ERROR_SUMMARY_NI0_CREDIT_UNDERFLOW_MASK 0x0000000000000040 + +/* SH_XN_ERROR_SUMMARY_NI0_LLP_ERROR */ +/* Description: NI0 llp error */ +#define SH_XN_ERROR_SUMMARY_NI0_LLP_ERROR_SHFT 7 +#define SH_XN_ERROR_SUMMARY_NI0_LLP_ERROR_MASK 0x0000000000000080 + +/* SH_XN_ERROR_SUMMARY_NI0_PIPE_ERROR */ +/* Description: NI0 Pipe in/out errors */ +#define SH_XN_ERROR_SUMMARY_NI0_PIPE_ERROR_SHFT 8 +#define SH_XN_ERROR_SUMMARY_NI0_PIPE_ERROR_MASK 0x0000000000000100 + +/* SH_XN_ERROR_SUMMARY_NI1_POP_OVERFLOW */ +/* Description: NI1 pop overflow */ +#define SH_XN_ERROR_SUMMARY_NI1_POP_OVERFLOW_SHFT 9 +#define SH_XN_ERROR_SUMMARY_NI1_POP_OVERFLOW_MASK 0x0000000000000200 + +/* SH_XN_ERROR_SUMMARY_NI1_PUSH_OVERFLOW */ +/* Description: NI1 push overflow */ +#define SH_XN_ERROR_SUMMARY_NI1_PUSH_OVERFLOW_SHFT 10 +#define SH_XN_ERROR_SUMMARY_NI1_PUSH_OVERFLOW_MASK 0x0000000000000400 + +/* SH_XN_ERROR_SUMMARY_NI1_CREDIT_OVERFLOW */ +/* Description: NI1 credit overflow */ +#define SH_XN_ERROR_SUMMARY_NI1_CREDIT_OVERFLOW_SHFT 11 +#define SH_XN_ERROR_SUMMARY_NI1_CREDIT_OVERFLOW_MASK 0x0000000000000800 + +/* SH_XN_ERROR_SUMMARY_NI1_DEBIT_OVERFLOW */ +/* Description: NI1 debit overflow */ +#define SH_XN_ERROR_SUMMARY_NI1_DEBIT_OVERFLOW_SHFT 12 +#define SH_XN_ERROR_SUMMARY_NI1_DEBIT_OVERFLOW_MASK 0x0000000000001000 + +/* SH_XN_ERROR_SUMMARY_NI1_POP_UNDERFLOW */ +/* Description: NI1 pop underflow */ +#define SH_XN_ERROR_SUMMARY_NI1_POP_UNDERFLOW_SHFT 13 +#define SH_XN_ERROR_SUMMARY_NI1_POP_UNDERFLOW_MASK 0x0000000000002000 + +/* SH_XN_ERROR_SUMMARY_NI1_PUSH_UNDERFLOW */ +/* Description: NI1 push underflow */ +#define SH_XN_ERROR_SUMMARY_NI1_PUSH_UNDERFLOW_SHFT 14 +#define SH_XN_ERROR_SUMMARY_NI1_PUSH_UNDERFLOW_MASK 0x0000000000004000 + +/* SH_XN_ERROR_SUMMARY_NI1_CREDIT_UNDERFLOW */ +/* Description: NI1 credit underflow */ +#define SH_XN_ERROR_SUMMARY_NI1_CREDIT_UNDERFLOW_SHFT 15 +#define SH_XN_ERROR_SUMMARY_NI1_CREDIT_UNDERFLOW_MASK 0x0000000000008000 + +/* SH_XN_ERROR_SUMMARY_NI1_LLP_ERROR */ +/* Description: NI1 llp error */ +#define SH_XN_ERROR_SUMMARY_NI1_LLP_ERROR_SHFT 16 +#define SH_XN_ERROR_SUMMARY_NI1_LLP_ERROR_MASK 0x0000000000010000 + +/* SH_XN_ERROR_SUMMARY_NI1_PIPE_ERROR */ +/* Description: NI1 pipe in/out error */ +#define SH_XN_ERROR_SUMMARY_NI1_PIPE_ERROR_SHFT 17 +#define SH_XN_ERROR_SUMMARY_NI1_PIPE_ERROR_MASK 0x0000000000020000 + +/* SH_XN_ERROR_SUMMARY_XNMD_CREDIT_OVERFLOW */ +/* Description: XNMD credit overflow */ +#define SH_XN_ERROR_SUMMARY_XNMD_CREDIT_OVERFLOW_SHFT 18 +#define SH_XN_ERROR_SUMMARY_XNMD_CREDIT_OVERFLOW_MASK 0x0000000000040000 + +/* SH_XN_ERROR_SUMMARY_XNMD_DEBIT_OVERFLOW */ +/* Description: XNMD debit overflow */ +#define SH_XN_ERROR_SUMMARY_XNMD_DEBIT_OVERFLOW_SHFT 19 +#define SH_XN_ERROR_SUMMARY_XNMD_DEBIT_OVERFLOW_MASK 0x0000000000080000 + +/* SH_XN_ERROR_SUMMARY_XNMD_DATA_BUFF_OVERFLOW */ +/* Description: XNMD data buffer overflow */ +#define SH_XN_ERROR_SUMMARY_XNMD_DATA_BUFF_OVERFLOW_SHFT 20 +#define SH_XN_ERROR_SUMMARY_XNMD_DATA_BUFF_OVERFLOW_MASK 0x0000000000100000 + +/* SH_XN_ERROR_SUMMARY_XNMD_CREDIT_UNDERFLOW */ +/* Description: XNMD credit underflow */ +#define SH_XN_ERROR_SUMMARY_XNMD_CREDIT_UNDERFLOW_SHFT 21 +#define SH_XN_ERROR_SUMMARY_XNMD_CREDIT_UNDERFLOW_MASK 0x0000000000200000 + +/* SH_XN_ERROR_SUMMARY_XNMD_SBE_ERROR */ +/* Description: XNMD single bit error */ +#define SH_XN_ERROR_SUMMARY_XNMD_SBE_ERROR_SHFT 22 +#define SH_XN_ERROR_SUMMARY_XNMD_SBE_ERROR_MASK 0x0000000000400000 + +/* SH_XN_ERROR_SUMMARY_XNMD_UCE_ERROR */ +/* Description: XNMD uncorrectable error */ +#define SH_XN_ERROR_SUMMARY_XNMD_UCE_ERROR_SHFT 23 +#define SH_XN_ERROR_SUMMARY_XNMD_UCE_ERROR_MASK 0x0000000000800000 + +/* SH_XN_ERROR_SUMMARY_XNMD_LUT_ERROR */ +/* Description: XNMD look up table error */ +#define SH_XN_ERROR_SUMMARY_XNMD_LUT_ERROR_SHFT 24 +#define SH_XN_ERROR_SUMMARY_XNMD_LUT_ERROR_MASK 0x0000000001000000 + +/* SH_XN_ERROR_SUMMARY_XNPI_CREDIT_OVERFLOW */ +/* Description: XNMD credit overflow */ +#define SH_XN_ERROR_SUMMARY_XNPI_CREDIT_OVERFLOW_SHFT 25 +#define SH_XN_ERROR_SUMMARY_XNPI_CREDIT_OVERFLOW_MASK 0x0000000002000000 + +/* SH_XN_ERROR_SUMMARY_XNPI_DEBIT_OVERFLOW */ +/* Description: XNPI debit overflow */ +#define SH_XN_ERROR_SUMMARY_XNPI_DEBIT_OVERFLOW_SHFT 26 +#define SH_XN_ERROR_SUMMARY_XNPI_DEBIT_OVERFLOW_MASK 0x0000000004000000 + +/* SH_XN_ERROR_SUMMARY_XNPI_DATA_BUFF_OVERFLOW */ +/* Description: XNPI data buffer overflow */ +#define SH_XN_ERROR_SUMMARY_XNPI_DATA_BUFF_OVERFLOW_SHFT 27 +#define SH_XN_ERROR_SUMMARY_XNPI_DATA_BUFF_OVERFLOW_MASK 0x0000000008000000 + +/* SH_XN_ERROR_SUMMARY_XNPI_CREDIT_UNDERFLOW */ +/* Description: XNPI credit underflow */ +#define SH_XN_ERROR_SUMMARY_XNPI_CREDIT_UNDERFLOW_SHFT 28 +#define SH_XN_ERROR_SUMMARY_XNPI_CREDIT_UNDERFLOW_MASK 0x0000000010000000 + +/* SH_XN_ERROR_SUMMARY_XNPI_SBE_ERROR */ +/* Description: XNPI single bit error */ +#define SH_XN_ERROR_SUMMARY_XNPI_SBE_ERROR_SHFT 29 +#define SH_XN_ERROR_SUMMARY_XNPI_SBE_ERROR_MASK 0x0000000020000000 + +/* SH_XN_ERROR_SUMMARY_XNPI_UCE_ERROR */ +/* Description: XNPI uncorrectable error */ +#define SH_XN_ERROR_SUMMARY_XNPI_UCE_ERROR_SHFT 30 +#define SH_XN_ERROR_SUMMARY_XNPI_UCE_ERROR_MASK 0x0000000040000000 + +/* SH_XN_ERROR_SUMMARY_XNPI_LUT_ERROR */ +/* Description: XNPI look up table error */ +#define SH_XN_ERROR_SUMMARY_XNPI_LUT_ERROR_SHFT 31 +#define SH_XN_ERROR_SUMMARY_XNPI_LUT_ERROR_MASK 0x0000000080000000 + +/* SH_XN_ERROR_SUMMARY_IILB_DEBIT_OVERFLOW */ +/* Description: IILB debit overflow */ +#define SH_XN_ERROR_SUMMARY_IILB_DEBIT_OVERFLOW_SHFT 32 +#define SH_XN_ERROR_SUMMARY_IILB_DEBIT_OVERFLOW_MASK 0x0000000100000000 + +/* SH_XN_ERROR_SUMMARY_IILB_CREDIT_OVERFLOW */ +/* Description: IILB credit overflow */ +#define SH_XN_ERROR_SUMMARY_IILB_CREDIT_OVERFLOW_SHFT 33 +#define SH_XN_ERROR_SUMMARY_IILB_CREDIT_OVERFLOW_MASK 0x0000000200000000 + +/* SH_XN_ERROR_SUMMARY_IILB_FIFO_OVERFLOW */ +/* Description: IILB fifo overflow */ +#define SH_XN_ERROR_SUMMARY_IILB_FIFO_OVERFLOW_SHFT 34 +#define SH_XN_ERROR_SUMMARY_IILB_FIFO_OVERFLOW_MASK 0x0000000400000000 + +/* SH_XN_ERROR_SUMMARY_IILB_CREDIT_UNDERFLOW */ +/* Description: IILB credit underflow */ +#define SH_XN_ERROR_SUMMARY_IILB_CREDIT_UNDERFLOW_SHFT 35 +#define SH_XN_ERROR_SUMMARY_IILB_CREDIT_UNDERFLOW_MASK 0x0000000800000000 + +/* SH_XN_ERROR_SUMMARY_IILB_FIFO_UNDERFLOW */ +/* Description: IILB fifo underflow */ +#define SH_XN_ERROR_SUMMARY_IILB_FIFO_UNDERFLOW_SHFT 36 +#define SH_XN_ERROR_SUMMARY_IILB_FIFO_UNDERFLOW_MASK 0x0000001000000000 + +/* SH_XN_ERROR_SUMMARY_IILB_CHIPLET_OR_LUT */ +/* Description: IILB chiplet nomatch or lut read error */ +#define SH_XN_ERROR_SUMMARY_IILB_CHIPLET_OR_LUT_SHFT 37 +#define SH_XN_ERROR_SUMMARY_IILB_CHIPLET_OR_LUT_MASK 0x0000002000000000 + +/* ==================================================================== */ +/* Register "SH_XN_ERRORS_ALIAS" */ +/* ==================================================================== */ + +#define SH_XN_ERRORS_ALIAS 0x0000000150040008 + +/* ==================================================================== */ +/* Register "SH_XN_ERROR_OVERFLOW" */ +/* ==================================================================== */ + +#define SH_XN_ERROR_OVERFLOW 0x0000000150040020 +#define SH_XN_ERROR_OVERFLOW_MASK 0x0000003fffffffff +#define SH_XN_ERROR_OVERFLOW_INIT 0x0000003fffffffff + +/* SH_XN_ERROR_OVERFLOW_NI0_POP_OVERFLOW */ +/* Description: NI0 pop overflow */ +#define SH_XN_ERROR_OVERFLOW_NI0_POP_OVERFLOW_SHFT 0 +#define SH_XN_ERROR_OVERFLOW_NI0_POP_OVERFLOW_MASK 0x0000000000000001 + +/* SH_XN_ERROR_OVERFLOW_NI0_PUSH_OVERFLOW */ +/* Description: NI0 push overflow */ +#define SH_XN_ERROR_OVERFLOW_NI0_PUSH_OVERFLOW_SHFT 1 +#define SH_XN_ERROR_OVERFLOW_NI0_PUSH_OVERFLOW_MASK 0x0000000000000002 + +/* SH_XN_ERROR_OVERFLOW_NI0_CREDIT_OVERFLOW */ +/* Description: NI0 credit overflow */ +#define SH_XN_ERROR_OVERFLOW_NI0_CREDIT_OVERFLOW_SHFT 2 +#define SH_XN_ERROR_OVERFLOW_NI0_CREDIT_OVERFLOW_MASK 0x0000000000000004 + +/* SH_XN_ERROR_OVERFLOW_NI0_DEBIT_OVERFLOW */ +/* Description: NI0 debit overflow */ +#define SH_XN_ERROR_OVERFLOW_NI0_DEBIT_OVERFLOW_SHFT 3 +#define SH_XN_ERROR_OVERFLOW_NI0_DEBIT_OVERFLOW_MASK 0x0000000000000008 + +/* SH_XN_ERROR_OVERFLOW_NI0_POP_UNDERFLOW */ +/* Description: NI0 pop underflow */ +#define SH_XN_ERROR_OVERFLOW_NI0_POP_UNDERFLOW_SHFT 4 +#define SH_XN_ERROR_OVERFLOW_NI0_POP_UNDERFLOW_MASK 0x0000000000000010 + +/* SH_XN_ERROR_OVERFLOW_NI0_PUSH_UNDERFLOW */ +/* Description: NI0 push underflow */ +#define SH_XN_ERROR_OVERFLOW_NI0_PUSH_UNDERFLOW_SHFT 5 +#define SH_XN_ERROR_OVERFLOW_NI0_PUSH_UNDERFLOW_MASK 0x0000000000000020 + +/* SH_XN_ERROR_OVERFLOW_NI0_CREDIT_UNDERFLOW */ +/* Description: NI0 credit underflow */ +#define SH_XN_ERROR_OVERFLOW_NI0_CREDIT_UNDERFLOW_SHFT 6 +#define SH_XN_ERROR_OVERFLOW_NI0_CREDIT_UNDERFLOW_MASK 0x0000000000000040 + +/* SH_XN_ERROR_OVERFLOW_NI0_LLP_ERROR */ +/* Description: NI0 llp error */ +#define SH_XN_ERROR_OVERFLOW_NI0_LLP_ERROR_SHFT 7 +#define SH_XN_ERROR_OVERFLOW_NI0_LLP_ERROR_MASK 0x0000000000000080 + +/* SH_XN_ERROR_OVERFLOW_NI0_PIPE_ERROR */ +/* Description: NI0 Pipe in/out errors */ +#define SH_XN_ERROR_OVERFLOW_NI0_PIPE_ERROR_SHFT 8 +#define SH_XN_ERROR_OVERFLOW_NI0_PIPE_ERROR_MASK 0x0000000000000100 + +/* SH_XN_ERROR_OVERFLOW_NI1_POP_OVERFLOW */ +/* Description: NI1 pop overflow */ +#define SH_XN_ERROR_OVERFLOW_NI1_POP_OVERFLOW_SHFT 9 +#define SH_XN_ERROR_OVERFLOW_NI1_POP_OVERFLOW_MASK 0x0000000000000200 + +/* SH_XN_ERROR_OVERFLOW_NI1_PUSH_OVERFLOW */ +/* Description: NI1 push overflow */ +#define SH_XN_ERROR_OVERFLOW_NI1_PUSH_OVERFLOW_SHFT 10 +#define SH_XN_ERROR_OVERFLOW_NI1_PUSH_OVERFLOW_MASK 0x0000000000000400 + +/* SH_XN_ERROR_OVERFLOW_NI1_CREDIT_OVERFLOW */ +/* Description: NI1 credit overflow */ +#define SH_XN_ERROR_OVERFLOW_NI1_CREDIT_OVERFLOW_SHFT 11 +#define SH_XN_ERROR_OVERFLOW_NI1_CREDIT_OVERFLOW_MASK 0x0000000000000800 + +/* SH_XN_ERROR_OVERFLOW_NI1_DEBIT_OVERFLOW */ +/* Description: NI1 debit overflow */ +#define SH_XN_ERROR_OVERFLOW_NI1_DEBIT_OVERFLOW_SHFT 12 +#define SH_XN_ERROR_OVERFLOW_NI1_DEBIT_OVERFLOW_MASK 0x0000000000001000 + +/* SH_XN_ERROR_OVERFLOW_NI1_POP_UNDERFLOW */ +/* Description: NI1 pop underflow */ +#define SH_XN_ERROR_OVERFLOW_NI1_POP_UNDERFLOW_SHFT 13 +#define SH_XN_ERROR_OVERFLOW_NI1_POP_UNDERFLOW_MASK 0x0000000000002000 + +/* SH_XN_ERROR_OVERFLOW_NI1_PUSH_UNDERFLOW */ +/* Description: NI1 push underflow */ +#define SH_XN_ERROR_OVERFLOW_NI1_PUSH_UNDERFLOW_SHFT 14 +#define SH_XN_ERROR_OVERFLOW_NI1_PUSH_UNDERFLOW_MASK 0x0000000000004000 + +/* SH_XN_ERROR_OVERFLOW_NI1_CREDIT_UNDERFLOW */ +/* Description: NI1 credit underflow */ +#define SH_XN_ERROR_OVERFLOW_NI1_CREDIT_UNDERFLOW_SHFT 15 +#define SH_XN_ERROR_OVERFLOW_NI1_CREDIT_UNDERFLOW_MASK 0x0000000000008000 + +/* SH_XN_ERROR_OVERFLOW_NI1_LLP_ERROR */ +/* Description: NI1 llp error */ +#define SH_XN_ERROR_OVERFLOW_NI1_LLP_ERROR_SHFT 16 +#define SH_XN_ERROR_OVERFLOW_NI1_LLP_ERROR_MASK 0x0000000000010000 + +/* SH_XN_ERROR_OVERFLOW_NI1_PIPE_ERROR */ +/* Description: NI1 pipe in/out error */ +#define SH_XN_ERROR_OVERFLOW_NI1_PIPE_ERROR_SHFT 17 +#define SH_XN_ERROR_OVERFLOW_NI1_PIPE_ERROR_MASK 0x0000000000020000 + +/* SH_XN_ERROR_OVERFLOW_XNMD_CREDIT_OVERFLOW */ +/* Description: XNMD credit overflow */ +#define SH_XN_ERROR_OVERFLOW_XNMD_CREDIT_OVERFLOW_SHFT 18 +#define SH_XN_ERROR_OVERFLOW_XNMD_CREDIT_OVERFLOW_MASK 0x0000000000040000 + +/* SH_XN_ERROR_OVERFLOW_XNMD_DEBIT_OVERFLOW */ +/* Description: XNMD debit overflow */ +#define SH_XN_ERROR_OVERFLOW_XNMD_DEBIT_OVERFLOW_SHFT 19 +#define SH_XN_ERROR_OVERFLOW_XNMD_DEBIT_OVERFLOW_MASK 0x0000000000080000 + +/* SH_XN_ERROR_OVERFLOW_XNMD_DATA_BUFF_OVERFLOW */ +/* Description: XNMD data buffer overflow */ +#define SH_XN_ERROR_OVERFLOW_XNMD_DATA_BUFF_OVERFLOW_SHFT 20 +#define SH_XN_ERROR_OVERFLOW_XNMD_DATA_BUFF_OVERFLOW_MASK 0x0000000000100000 + +/* SH_XN_ERROR_OVERFLOW_XNMD_CREDIT_UNDERFLOW */ +/* Description: XNMD credit underflow */ +#define SH_XN_ERROR_OVERFLOW_XNMD_CREDIT_UNDERFLOW_SHFT 21 +#define SH_XN_ERROR_OVERFLOW_XNMD_CREDIT_UNDERFLOW_MASK 0x0000000000200000 + +/* SH_XN_ERROR_OVERFLOW_XNMD_SBE_ERROR */ +/* Description: XNMD single bit error */ +#define SH_XN_ERROR_OVERFLOW_XNMD_SBE_ERROR_SHFT 22 +#define SH_XN_ERROR_OVERFLOW_XNMD_SBE_ERROR_MASK 0x0000000000400000 + +/* SH_XN_ERROR_OVERFLOW_XNMD_UCE_ERROR */ +/* Description: XNMD uncorrectable error */ +#define SH_XN_ERROR_OVERFLOW_XNMD_UCE_ERROR_SHFT 23 +#define SH_XN_ERROR_OVERFLOW_XNMD_UCE_ERROR_MASK 0x0000000000800000 + +/* SH_XN_ERROR_OVERFLOW_XNMD_LUT_ERROR */ +/* Description: XNMD look up table error */ +#define SH_XN_ERROR_OVERFLOW_XNMD_LUT_ERROR_SHFT 24 +#define SH_XN_ERROR_OVERFLOW_XNMD_LUT_ERROR_MASK 0x0000000001000000 + +/* SH_XN_ERROR_OVERFLOW_XNPI_CREDIT_OVERFLOW */ +/* Description: XNMD credit overflow */ +#define SH_XN_ERROR_OVERFLOW_XNPI_CREDIT_OVERFLOW_SHFT 25 +#define SH_XN_ERROR_OVERFLOW_XNPI_CREDIT_OVERFLOW_MASK 0x0000000002000000 + +/* SH_XN_ERROR_OVERFLOW_XNPI_DEBIT_OVERFLOW */ +/* Description: XNPI debit overflow */ +#define SH_XN_ERROR_OVERFLOW_XNPI_DEBIT_OVERFLOW_SHFT 26 +#define SH_XN_ERROR_OVERFLOW_XNPI_DEBIT_OVERFLOW_MASK 0x0000000004000000 + +/* SH_XN_ERROR_OVERFLOW_XNPI_DATA_BUFF_OVERFLOW */ +/* Description: XNPI data buffer overflow */ +#define SH_XN_ERROR_OVERFLOW_XNPI_DATA_BUFF_OVERFLOW_SHFT 27 +#define SH_XN_ERROR_OVERFLOW_XNPI_DATA_BUFF_OVERFLOW_MASK 0x0000000008000000 + +/* SH_XN_ERROR_OVERFLOW_XNPI_CREDIT_UNDERFLOW */ +/* Description: XNPI credit underflow */ +#define SH_XN_ERROR_OVERFLOW_XNPI_CREDIT_UNDERFLOW_SHFT 28 +#define SH_XN_ERROR_OVERFLOW_XNPI_CREDIT_UNDERFLOW_MASK 0x0000000010000000 + +/* SH_XN_ERROR_OVERFLOW_XNPI_SBE_ERROR */ +/* Description: XNPI single bit error */ +#define SH_XN_ERROR_OVERFLOW_XNPI_SBE_ERROR_SHFT 29 +#define SH_XN_ERROR_OVERFLOW_XNPI_SBE_ERROR_MASK 0x0000000020000000 + +/* SH_XN_ERROR_OVERFLOW_XNPI_UCE_ERROR */ +/* Description: XNPI uncorrectable error */ +#define SH_XN_ERROR_OVERFLOW_XNPI_UCE_ERROR_SHFT 30 +#define SH_XN_ERROR_OVERFLOW_XNPI_UCE_ERROR_MASK 0x0000000040000000 + +/* SH_XN_ERROR_OVERFLOW_XNPI_LUT_ERROR */ +/* Description: XNPI look up table error */ +#define SH_XN_ERROR_OVERFLOW_XNPI_LUT_ERROR_SHFT 31 +#define SH_XN_ERROR_OVERFLOW_XNPI_LUT_ERROR_MASK 0x0000000080000000 + +/* SH_XN_ERROR_OVERFLOW_IILB_DEBIT_OVERFLOW */ +/* Description: IILB debit overflow */ +#define SH_XN_ERROR_OVERFLOW_IILB_DEBIT_OVERFLOW_SHFT 32 +#define SH_XN_ERROR_OVERFLOW_IILB_DEBIT_OVERFLOW_MASK 0x0000000100000000 + +/* SH_XN_ERROR_OVERFLOW_IILB_CREDIT_OVERFLOW */ +/* Description: IILB credit overflow */ +#define SH_XN_ERROR_OVERFLOW_IILB_CREDIT_OVERFLOW_SHFT 33 +#define SH_XN_ERROR_OVERFLOW_IILB_CREDIT_OVERFLOW_MASK 0x0000000200000000 + +/* SH_XN_ERROR_OVERFLOW_IILB_FIFO_OVERFLOW */ +/* Description: IILB fifo overflow */ +#define SH_XN_ERROR_OVERFLOW_IILB_FIFO_OVERFLOW_SHFT 34 +#define SH_XN_ERROR_OVERFLOW_IILB_FIFO_OVERFLOW_MASK 0x0000000400000000 + +/* SH_XN_ERROR_OVERFLOW_IILB_CREDIT_UNDERFLOW */ +/* Description: IILB credit underflow */ +#define SH_XN_ERROR_OVERFLOW_IILB_CREDIT_UNDERFLOW_SHFT 35 +#define SH_XN_ERROR_OVERFLOW_IILB_CREDIT_UNDERFLOW_MASK 0x0000000800000000 + +/* SH_XN_ERROR_OVERFLOW_IILB_FIFO_UNDERFLOW */ +/* Description: IILB fifo underflow */ +#define SH_XN_ERROR_OVERFLOW_IILB_FIFO_UNDERFLOW_SHFT 36 +#define SH_XN_ERROR_OVERFLOW_IILB_FIFO_UNDERFLOW_MASK 0x0000001000000000 + +/* SH_XN_ERROR_OVERFLOW_IILB_CHIPLET_OR_LUT */ +/* Description: IILB chiplet nomatch or lut read error */ +#define SH_XN_ERROR_OVERFLOW_IILB_CHIPLET_OR_LUT_SHFT 37 +#define SH_XN_ERROR_OVERFLOW_IILB_CHIPLET_OR_LUT_MASK 0x0000002000000000 + +/* ==================================================================== */ +/* Register "SH_XN_ERROR_OVERFLOW_ALIAS" */ +/* ==================================================================== */ + +#define SH_XN_ERROR_OVERFLOW_ALIAS 0x0000000150040028 + +/* ==================================================================== */ +/* Register "SH_XN_ERROR_MASK" */ +/* ==================================================================== */ + +#define SH_XN_ERROR_MASK 0x0000000150040040 +#define SH_XN_ERROR_MASK_MASK 0x0000003fffffffff +#define SH_XN_ERROR_MASK_INIT 0x0000003fffffffff + +/* SH_XN_ERROR_MASK_NI0_POP_OVERFLOW */ +/* Description: NI0 pop overflow */ +#define SH_XN_ERROR_MASK_NI0_POP_OVERFLOW_SHFT 0 +#define SH_XN_ERROR_MASK_NI0_POP_OVERFLOW_MASK 0x0000000000000001 + +/* SH_XN_ERROR_MASK_NI0_PUSH_OVERFLOW */ +/* Description: NI0 push overflow */ +#define SH_XN_ERROR_MASK_NI0_PUSH_OVERFLOW_SHFT 1 +#define SH_XN_ERROR_MASK_NI0_PUSH_OVERFLOW_MASK 0x0000000000000002 + +/* SH_XN_ERROR_MASK_NI0_CREDIT_OVERFLOW */ +/* Description: NI0 credit overflow */ +#define SH_XN_ERROR_MASK_NI0_CREDIT_OVERFLOW_SHFT 2 +#define SH_XN_ERROR_MASK_NI0_CREDIT_OVERFLOW_MASK 0x0000000000000004 + +/* SH_XN_ERROR_MASK_NI0_DEBIT_OVERFLOW */ +/* Description: NI0 debit overflow */ +#define SH_XN_ERROR_MASK_NI0_DEBIT_OVERFLOW_SHFT 3 +#define SH_XN_ERROR_MASK_NI0_DEBIT_OVERFLOW_MASK 0x0000000000000008 + +/* SH_XN_ERROR_MASK_NI0_POP_UNDERFLOW */ +/* Description: NI0 pop underflow */ +#define SH_XN_ERROR_MASK_NI0_POP_UNDERFLOW_SHFT 4 +#define SH_XN_ERROR_MASK_NI0_POP_UNDERFLOW_MASK 0x0000000000000010 + +/* SH_XN_ERROR_MASK_NI0_PUSH_UNDERFLOW */ +/* Description: NI0 push underflow */ +#define SH_XN_ERROR_MASK_NI0_PUSH_UNDERFLOW_SHFT 5 +#define SH_XN_ERROR_MASK_NI0_PUSH_UNDERFLOW_MASK 0x0000000000000020 + +/* SH_XN_ERROR_MASK_NI0_CREDIT_UNDERFLOW */ +/* Description: NI0 credit underflow */ +#define SH_XN_ERROR_MASK_NI0_CREDIT_UNDERFLOW_SHFT 6 +#define SH_XN_ERROR_MASK_NI0_CREDIT_UNDERFLOW_MASK 0x0000000000000040 + +/* SH_XN_ERROR_MASK_NI0_LLP_ERROR */ +/* Description: NI0 llp error */ +#define SH_XN_ERROR_MASK_NI0_LLP_ERROR_SHFT 7 +#define SH_XN_ERROR_MASK_NI0_LLP_ERROR_MASK 0x0000000000000080 + +/* SH_XN_ERROR_MASK_NI0_PIPE_ERROR */ +/* Description: NI0 Pipe in/out errors */ +#define SH_XN_ERROR_MASK_NI0_PIPE_ERROR_SHFT 8 +#define SH_XN_ERROR_MASK_NI0_PIPE_ERROR_MASK 0x0000000000000100 + +/* SH_XN_ERROR_MASK_NI1_POP_OVERFLOW */ +/* Description: NI1 pop overflow */ +#define SH_XN_ERROR_MASK_NI1_POP_OVERFLOW_SHFT 9 +#define SH_XN_ERROR_MASK_NI1_POP_OVERFLOW_MASK 0x0000000000000200 + +/* SH_XN_ERROR_MASK_NI1_PUSH_OVERFLOW */ +/* Description: NI1 push overflow */ +#define SH_XN_ERROR_MASK_NI1_PUSH_OVERFLOW_SHFT 10 +#define SH_XN_ERROR_MASK_NI1_PUSH_OVERFLOW_MASK 0x0000000000000400 + +/* SH_XN_ERROR_MASK_NI1_CREDIT_OVERFLOW */ +/* Description: NI1 credit overflow */ +#define SH_XN_ERROR_MASK_NI1_CREDIT_OVERFLOW_SHFT 11 +#define SH_XN_ERROR_MASK_NI1_CREDIT_OVERFLOW_MASK 0x0000000000000800 + +/* SH_XN_ERROR_MASK_NI1_DEBIT_OVERFLOW */ +/* Description: NI1 debit overflow */ +#define SH_XN_ERROR_MASK_NI1_DEBIT_OVERFLOW_SHFT 12 +#define SH_XN_ERROR_MASK_NI1_DEBIT_OVERFLOW_MASK 0x0000000000001000 + +/* SH_XN_ERROR_MASK_NI1_POP_UNDERFLOW */ +/* Description: NI1 pop underflow */ +#define SH_XN_ERROR_MASK_NI1_POP_UNDERFLOW_SHFT 13 +#define SH_XN_ERROR_MASK_NI1_POP_UNDERFLOW_MASK 0x0000000000002000 + +/* SH_XN_ERROR_MASK_NI1_PUSH_UNDERFLOW */ +/* Description: NI1 push underflow */ +#define SH_XN_ERROR_MASK_NI1_PUSH_UNDERFLOW_SHFT 14 +#define SH_XN_ERROR_MASK_NI1_PUSH_UNDERFLOW_MASK 0x0000000000004000 + +/* SH_XN_ERROR_MASK_NI1_CREDIT_UNDERFLOW */ +/* Description: NI1 credit underflow */ +#define SH_XN_ERROR_MASK_NI1_CREDIT_UNDERFLOW_SHFT 15 +#define SH_XN_ERROR_MASK_NI1_CREDIT_UNDERFLOW_MASK 0x0000000000008000 + +/* SH_XN_ERROR_MASK_NI1_LLP_ERROR */ +/* Description: NI1 llp error */ +#define SH_XN_ERROR_MASK_NI1_LLP_ERROR_SHFT 16 +#define SH_XN_ERROR_MASK_NI1_LLP_ERROR_MASK 0x0000000000010000 + +/* SH_XN_ERROR_MASK_NI1_PIPE_ERROR */ +/* Description: NI1 pipe in/out error */ +#define SH_XN_ERROR_MASK_NI1_PIPE_ERROR_SHFT 17 +#define SH_XN_ERROR_MASK_NI1_PIPE_ERROR_MASK 0x0000000000020000 + +/* SH_XN_ERROR_MASK_XNMD_CREDIT_OVERFLOW */ +/* Description: XNMD credit overflow */ +#define SH_XN_ERROR_MASK_XNMD_CREDIT_OVERFLOW_SHFT 18 +#define SH_XN_ERROR_MASK_XNMD_CREDIT_OVERFLOW_MASK 0x0000000000040000 + +/* SH_XN_ERROR_MASK_XNMD_DEBIT_OVERFLOW */ +/* Description: XNMD debit overflow */ +#define SH_XN_ERROR_MASK_XNMD_DEBIT_OVERFLOW_SHFT 19 +#define SH_XN_ERROR_MASK_XNMD_DEBIT_OVERFLOW_MASK 0x0000000000080000 + +/* SH_XN_ERROR_MASK_XNMD_DATA_BUFF_OVERFLOW */ +/* Description: XNMD data buffer overflow */ +#define SH_XN_ERROR_MASK_XNMD_DATA_BUFF_OVERFLOW_SHFT 20 +#define SH_XN_ERROR_MASK_XNMD_DATA_BUFF_OVERFLOW_MASK 0x0000000000100000 + +/* SH_XN_ERROR_MASK_XNMD_CREDIT_UNDERFLOW */ +/* Description: XNMD credit underflow */ +#define SH_XN_ERROR_MASK_XNMD_CREDIT_UNDERFLOW_SHFT 21 +#define SH_XN_ERROR_MASK_XNMD_CREDIT_UNDERFLOW_MASK 0x0000000000200000 + +/* SH_XN_ERROR_MASK_XNMD_SBE_ERROR */ +/* Description: XNMD single bit error */ +#define SH_XN_ERROR_MASK_XNMD_SBE_ERROR_SHFT 22 +#define SH_XN_ERROR_MASK_XNMD_SBE_ERROR_MASK 0x0000000000400000 + +/* SH_XN_ERROR_MASK_XNMD_UCE_ERROR */ +/* Description: XNMD uncorrectable error */ +#define SH_XN_ERROR_MASK_XNMD_UCE_ERROR_SHFT 23 +#define SH_XN_ERROR_MASK_XNMD_UCE_ERROR_MASK 0x0000000000800000 + +/* SH_XN_ERROR_MASK_XNMD_LUT_ERROR */ +/* Description: XNMD look up table error */ +#define SH_XN_ERROR_MASK_XNMD_LUT_ERROR_SHFT 24 +#define SH_XN_ERROR_MASK_XNMD_LUT_ERROR_MASK 0x0000000001000000 + +/* SH_XN_ERROR_MASK_XNPI_CREDIT_OVERFLOW */ +/* Description: XNMD credit overflow */ +#define SH_XN_ERROR_MASK_XNPI_CREDIT_OVERFLOW_SHFT 25 +#define SH_XN_ERROR_MASK_XNPI_CREDIT_OVERFLOW_MASK 0x0000000002000000 + +/* SH_XN_ERROR_MASK_XNPI_DEBIT_OVERFLOW */ +/* Description: XNPI debit overflow */ +#define SH_XN_ERROR_MASK_XNPI_DEBIT_OVERFLOW_SHFT 26 +#define SH_XN_ERROR_MASK_XNPI_DEBIT_OVERFLOW_MASK 0x0000000004000000 + +/* SH_XN_ERROR_MASK_XNPI_DATA_BUFF_OVERFLOW */ +/* Description: XNPI data buffer overflow */ +#define SH_XN_ERROR_MASK_XNPI_DATA_BUFF_OVERFLOW_SHFT 27 +#define SH_XN_ERROR_MASK_XNPI_DATA_BUFF_OVERFLOW_MASK 0x0000000008000000 + +/* SH_XN_ERROR_MASK_XNPI_CREDIT_UNDERFLOW */ +/* Description: XNPI credit underflow */ +#define SH_XN_ERROR_MASK_XNPI_CREDIT_UNDERFLOW_SHFT 28 +#define SH_XN_ERROR_MASK_XNPI_CREDIT_UNDERFLOW_MASK 0x0000000010000000 + +/* SH_XN_ERROR_MASK_XNPI_SBE_ERROR */ +/* Description: XNPI single bit error */ +#define SH_XN_ERROR_MASK_XNPI_SBE_ERROR_SHFT 29 +#define SH_XN_ERROR_MASK_XNPI_SBE_ERROR_MASK 0x0000000020000000 + +/* SH_XN_ERROR_MASK_XNPI_UCE_ERROR */ +/* Description: XNPI uncorrectable error */ +#define SH_XN_ERROR_MASK_XNPI_UCE_ERROR_SHFT 30 +#define SH_XN_ERROR_MASK_XNPI_UCE_ERROR_MASK 0x0000000040000000 + +/* SH_XN_ERROR_MASK_XNPI_LUT_ERROR */ +/* Description: XNPI look up table error */ +#define SH_XN_ERROR_MASK_XNPI_LUT_ERROR_SHFT 31 +#define SH_XN_ERROR_MASK_XNPI_LUT_ERROR_MASK 0x0000000080000000 + +/* SH_XN_ERROR_MASK_IILB_DEBIT_OVERFLOW */ +/* Description: IILB debit overflow */ +#define SH_XN_ERROR_MASK_IILB_DEBIT_OVERFLOW_SHFT 32 +#define SH_XN_ERROR_MASK_IILB_DEBIT_OVERFLOW_MASK 0x0000000100000000 + +/* SH_XN_ERROR_MASK_IILB_CREDIT_OVERFLOW */ +/* Description: IILB credit overflow */ +#define SH_XN_ERROR_MASK_IILB_CREDIT_OVERFLOW_SHFT 33 +#define SH_XN_ERROR_MASK_IILB_CREDIT_OVERFLOW_MASK 0x0000000200000000 + +/* SH_XN_ERROR_MASK_IILB_FIFO_OVERFLOW */ +/* Description: IILB fifo overflow */ +#define SH_XN_ERROR_MASK_IILB_FIFO_OVERFLOW_SHFT 34 +#define SH_XN_ERROR_MASK_IILB_FIFO_OVERFLOW_MASK 0x0000000400000000 + +/* SH_XN_ERROR_MASK_IILB_CREDIT_UNDERFLOW */ +/* Description: IILB credit underflow */ +#define SH_XN_ERROR_MASK_IILB_CREDIT_UNDERFLOW_SHFT 35 +#define SH_XN_ERROR_MASK_IILB_CREDIT_UNDERFLOW_MASK 0x0000000800000000 + +/* SH_XN_ERROR_MASK_IILB_FIFO_UNDERFLOW */ +/* Description: IILB fifo underflow */ +#define SH_XN_ERROR_MASK_IILB_FIFO_UNDERFLOW_SHFT 36 +#define SH_XN_ERROR_MASK_IILB_FIFO_UNDERFLOW_MASK 0x0000001000000000 + +/* SH_XN_ERROR_MASK_IILB_CHIPLET_OR_LUT */ +/* Description: IILB chiplet nomatch or lut read error */ +#define SH_XN_ERROR_MASK_IILB_CHIPLET_OR_LUT_SHFT 37 +#define SH_XN_ERROR_MASK_IILB_CHIPLET_OR_LUT_MASK 0x0000002000000000 + +/* ==================================================================== */ +/* Register "SH_XN_FIRST_ERROR" */ +/* ==================================================================== */ + +#define SH_XN_FIRST_ERROR 0x0000000150040060 +#define SH_XN_FIRST_ERROR_MASK 0x0000003fffffffff +#define SH_XN_FIRST_ERROR_INIT 0x0000003fffffffff + +/* SH_XN_FIRST_ERROR_NI0_POP_OVERFLOW */ +/* Description: NI0 pop overflow */ +#define SH_XN_FIRST_ERROR_NI0_POP_OVERFLOW_SHFT 0 +#define SH_XN_FIRST_ERROR_NI0_POP_OVERFLOW_MASK 0x0000000000000001 + +/* SH_XN_FIRST_ERROR_NI0_PUSH_OVERFLOW */ +/* Description: NI0 push overflow */ +#define SH_XN_FIRST_ERROR_NI0_PUSH_OVERFLOW_SHFT 1 +#define SH_XN_FIRST_ERROR_NI0_PUSH_OVERFLOW_MASK 0x0000000000000002 + +/* SH_XN_FIRST_ERROR_NI0_CREDIT_OVERFLOW */ +/* Description: NI0 credit overflow */ +#define SH_XN_FIRST_ERROR_NI0_CREDIT_OVERFLOW_SHFT 2 +#define SH_XN_FIRST_ERROR_NI0_CREDIT_OVERFLOW_MASK 0x0000000000000004 + +/* SH_XN_FIRST_ERROR_NI0_DEBIT_OVERFLOW */ +/* Description: NI0 debit overflow */ +#define SH_XN_FIRST_ERROR_NI0_DEBIT_OVERFLOW_SHFT 3 +#define SH_XN_FIRST_ERROR_NI0_DEBIT_OVERFLOW_MASK 0x0000000000000008 + +/* SH_XN_FIRST_ERROR_NI0_POP_UNDERFLOW */ +/* Description: NI0 pop underflow */ +#define SH_XN_FIRST_ERROR_NI0_POP_UNDERFLOW_SHFT 4 +#define SH_XN_FIRST_ERROR_NI0_POP_UNDERFLOW_MASK 0x0000000000000010 + +/* SH_XN_FIRST_ERROR_NI0_PUSH_UNDERFLOW */ +/* Description: NI0 push underflow */ +#define SH_XN_FIRST_ERROR_NI0_PUSH_UNDERFLOW_SHFT 5 +#define SH_XN_FIRST_ERROR_NI0_PUSH_UNDERFLOW_MASK 0x0000000000000020 + +/* SH_XN_FIRST_ERROR_NI0_CREDIT_UNDERFLOW */ +/* Description: NI0 credit underflow */ +#define SH_XN_FIRST_ERROR_NI0_CREDIT_UNDERFLOW_SHFT 6 +#define SH_XN_FIRST_ERROR_NI0_CREDIT_UNDERFLOW_MASK 0x0000000000000040 + +/* SH_XN_FIRST_ERROR_NI0_LLP_ERROR */ +/* Description: NI0 llp error */ +#define SH_XN_FIRST_ERROR_NI0_LLP_ERROR_SHFT 7 +#define SH_XN_FIRST_ERROR_NI0_LLP_ERROR_MASK 0x0000000000000080 + +/* SH_XN_FIRST_ERROR_NI0_PIPE_ERROR */ +/* Description: NI0 Pipe in/out errors */ +#define SH_XN_FIRST_ERROR_NI0_PIPE_ERROR_SHFT 8 +#define SH_XN_FIRST_ERROR_NI0_PIPE_ERROR_MASK 0x0000000000000100 + +/* SH_XN_FIRST_ERROR_NI1_POP_OVERFLOW */ +/* Description: NI1 pop overflow */ +#define SH_XN_FIRST_ERROR_NI1_POP_OVERFLOW_SHFT 9 +#define SH_XN_FIRST_ERROR_NI1_POP_OVERFLOW_MASK 0x0000000000000200 + +/* SH_XN_FIRST_ERROR_NI1_PUSH_OVERFLOW */ +/* Description: NI1 push overflow */ +#define SH_XN_FIRST_ERROR_NI1_PUSH_OVERFLOW_SHFT 10 +#define SH_XN_FIRST_ERROR_NI1_PUSH_OVERFLOW_MASK 0x0000000000000400 + +/* SH_XN_FIRST_ERROR_NI1_CREDIT_OVERFLOW */ +/* Description: NI1 credit overflow */ +#define SH_XN_FIRST_ERROR_NI1_CREDIT_OVERFLOW_SHFT 11 +#define SH_XN_FIRST_ERROR_NI1_CREDIT_OVERFLOW_MASK 0x0000000000000800 + +/* SH_XN_FIRST_ERROR_NI1_DEBIT_OVERFLOW */ +/* Description: NI1 debit overflow */ +#define SH_XN_FIRST_ERROR_NI1_DEBIT_OVERFLOW_SHFT 12 +#define SH_XN_FIRST_ERROR_NI1_DEBIT_OVERFLOW_MASK 0x0000000000001000 + +/* SH_XN_FIRST_ERROR_NI1_POP_UNDERFLOW */ +/* Description: NI1 pop underflow */ +#define SH_XN_FIRST_ERROR_NI1_POP_UNDERFLOW_SHFT 13 +#define SH_XN_FIRST_ERROR_NI1_POP_UNDERFLOW_MASK 0x0000000000002000 + +/* SH_XN_FIRST_ERROR_NI1_PUSH_UNDERFLOW */ +/* Description: NI1 push underflow */ +#define SH_XN_FIRST_ERROR_NI1_PUSH_UNDERFLOW_SHFT 14 +#define SH_XN_FIRST_ERROR_NI1_PUSH_UNDERFLOW_MASK 0x0000000000004000 + +/* SH_XN_FIRST_ERROR_NI1_CREDIT_UNDERFLOW */ +/* Description: NI1 credit underflow */ +#define SH_XN_FIRST_ERROR_NI1_CREDIT_UNDERFLOW_SHFT 15 +#define SH_XN_FIRST_ERROR_NI1_CREDIT_UNDERFLOW_MASK 0x0000000000008000 + +/* SH_XN_FIRST_ERROR_NI1_LLP_ERROR */ +/* Description: NI1 llp error */ +#define SH_XN_FIRST_ERROR_NI1_LLP_ERROR_SHFT 16 +#define SH_XN_FIRST_ERROR_NI1_LLP_ERROR_MASK 0x0000000000010000 + +/* SH_XN_FIRST_ERROR_NI1_PIPE_ERROR */ +/* Description: NI1 pipe in/out error */ +#define SH_XN_FIRST_ERROR_NI1_PIPE_ERROR_SHFT 17 +#define SH_XN_FIRST_ERROR_NI1_PIPE_ERROR_MASK 0x0000000000020000 + +/* SH_XN_FIRST_ERROR_XNMD_CREDIT_OVERFLOW */ +/* Description: XNMD credit overflow */ +#define SH_XN_FIRST_ERROR_XNMD_CREDIT_OVERFLOW_SHFT 18 +#define SH_XN_FIRST_ERROR_XNMD_CREDIT_OVERFLOW_MASK 0x0000000000040000 + +/* SH_XN_FIRST_ERROR_XNMD_DEBIT_OVERFLOW */ +/* Description: XNMD debit overflow */ +#define SH_XN_FIRST_ERROR_XNMD_DEBIT_OVERFLOW_SHFT 19 +#define SH_XN_FIRST_ERROR_XNMD_DEBIT_OVERFLOW_MASK 0x0000000000080000 + +/* SH_XN_FIRST_ERROR_XNMD_DATA_BUFF_OVERFLOW */ +/* Description: XNMD data buffer overflow */ +#define SH_XN_FIRST_ERROR_XNMD_DATA_BUFF_OVERFLOW_SHFT 20 +#define SH_XN_FIRST_ERROR_XNMD_DATA_BUFF_OVERFLOW_MASK 0x0000000000100000 + +/* SH_XN_FIRST_ERROR_XNMD_CREDIT_UNDERFLOW */ +/* Description: XNMD credit underflow */ +#define SH_XN_FIRST_ERROR_XNMD_CREDIT_UNDERFLOW_SHFT 21 +#define SH_XN_FIRST_ERROR_XNMD_CREDIT_UNDERFLOW_MASK 0x0000000000200000 + +/* SH_XN_FIRST_ERROR_XNMD_SBE_ERROR */ +/* Description: XNMD single bit error */ +#define SH_XN_FIRST_ERROR_XNMD_SBE_ERROR_SHFT 22 +#define SH_XN_FIRST_ERROR_XNMD_SBE_ERROR_MASK 0x0000000000400000 + +/* SH_XN_FIRST_ERROR_XNMD_UCE_ERROR */ +/* Description: XNMD uncorrectable error */ +#define SH_XN_FIRST_ERROR_XNMD_UCE_ERROR_SHFT 23 +#define SH_XN_FIRST_ERROR_XNMD_UCE_ERROR_MASK 0x0000000000800000 + +/* SH_XN_FIRST_ERROR_XNMD_LUT_ERROR */ +/* Description: XNMD look up table error */ +#define SH_XN_FIRST_ERROR_XNMD_LUT_ERROR_SHFT 24 +#define SH_XN_FIRST_ERROR_XNMD_LUT_ERROR_MASK 0x0000000001000000 + +/* SH_XN_FIRST_ERROR_XNPI_CREDIT_OVERFLOW */ +/* Description: XNMD credit overflow */ +#define SH_XN_FIRST_ERROR_XNPI_CREDIT_OVERFLOW_SHFT 25 +#define SH_XN_FIRST_ERROR_XNPI_CREDIT_OVERFLOW_MASK 0x0000000002000000 + +/* SH_XN_FIRST_ERROR_XNPI_DEBIT_OVERFLOW */ +/* Description: XNPI debit overflow */ +#define SH_XN_FIRST_ERROR_XNPI_DEBIT_OVERFLOW_SHFT 26 +#define SH_XN_FIRST_ERROR_XNPI_DEBIT_OVERFLOW_MASK 0x0000000004000000 + +/* SH_XN_FIRST_ERROR_XNPI_DATA_BUFF_OVERFLOW */ +/* Description: XNPI data buffer overflow */ +#define SH_XN_FIRST_ERROR_XNPI_DATA_BUFF_OVERFLOW_SHFT 27 +#define SH_XN_FIRST_ERROR_XNPI_DATA_BUFF_OVERFLOW_MASK 0x0000000008000000 + +/* SH_XN_FIRST_ERROR_XNPI_CREDIT_UNDERFLOW */ +/* Description: XNPI credit underflow */ +#define SH_XN_FIRST_ERROR_XNPI_CREDIT_UNDERFLOW_SHFT 28 +#define SH_XN_FIRST_ERROR_XNPI_CREDIT_UNDERFLOW_MASK 0x0000000010000000 + +/* SH_XN_FIRST_ERROR_XNPI_SBE_ERROR */ +/* Description: XNPI single bit error */ +#define SH_XN_FIRST_ERROR_XNPI_SBE_ERROR_SHFT 29 +#define SH_XN_FIRST_ERROR_XNPI_SBE_ERROR_MASK 0x0000000020000000 + +/* SH_XN_FIRST_ERROR_XNPI_UCE_ERROR */ +/* Description: XNPI uncorrectable error */ +#define SH_XN_FIRST_ERROR_XNPI_UCE_ERROR_SHFT 30 +#define SH_XN_FIRST_ERROR_XNPI_UCE_ERROR_MASK 0x0000000040000000 + +/* SH_XN_FIRST_ERROR_XNPI_LUT_ERROR */ +/* Description: XNPI look up table error */ +#define SH_XN_FIRST_ERROR_XNPI_LUT_ERROR_SHFT 31 +#define SH_XN_FIRST_ERROR_XNPI_LUT_ERROR_MASK 0x0000000080000000 + +/* SH_XN_FIRST_ERROR_IILB_DEBIT_OVERFLOW */ +/* Description: IILB debit overflow */ +#define SH_XN_FIRST_ERROR_IILB_DEBIT_OVERFLOW_SHFT 32 +#define SH_XN_FIRST_ERROR_IILB_DEBIT_OVERFLOW_MASK 0x0000000100000000 + +/* SH_XN_FIRST_ERROR_IILB_CREDIT_OVERFLOW */ +/* Description: IILB credit overflow */ +#define SH_XN_FIRST_ERROR_IILB_CREDIT_OVERFLOW_SHFT 33 +#define SH_XN_FIRST_ERROR_IILB_CREDIT_OVERFLOW_MASK 0x0000000200000000 + +/* SH_XN_FIRST_ERROR_IILB_FIFO_OVERFLOW */ +/* Description: IILB fifo overflow */ +#define SH_XN_FIRST_ERROR_IILB_FIFO_OVERFLOW_SHFT 34 +#define SH_XN_FIRST_ERROR_IILB_FIFO_OVERFLOW_MASK 0x0000000400000000 + +/* SH_XN_FIRST_ERROR_IILB_CREDIT_UNDERFLOW */ +/* Description: IILB credit underflow */ +#define SH_XN_FIRST_ERROR_IILB_CREDIT_UNDERFLOW_SHFT 35 +#define SH_XN_FIRST_ERROR_IILB_CREDIT_UNDERFLOW_MASK 0x0000000800000000 + +/* SH_XN_FIRST_ERROR_IILB_FIFO_UNDERFLOW */ +/* Description: IILB fifo underflow */ +#define SH_XN_FIRST_ERROR_IILB_FIFO_UNDERFLOW_SHFT 36 +#define SH_XN_FIRST_ERROR_IILB_FIFO_UNDERFLOW_MASK 0x0000001000000000 + +/* SH_XN_FIRST_ERROR_IILB_CHIPLET_OR_LUT */ +/* Description: IILB chiplet nomatch or lut read error */ +#define SH_XN_FIRST_ERROR_IILB_CHIPLET_OR_LUT_SHFT 37 +#define SH_XN_FIRST_ERROR_IILB_CHIPLET_OR_LUT_MASK 0x0000002000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERROR_SUMMARY" */ +/* ==================================================================== */ + +#define SH_XNIILB_ERROR_SUMMARY 0x0000000150040200 +#define SH_XNIILB_ERROR_SUMMARY_MASK 0xffffffffffffffff +#define SH_XNIILB_ERROR_SUMMARY_INIT 0xffffffffffffffff + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_II_DEBIT0 */ +/* Description: II debit0 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_II_DEBIT0_SHFT 0 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_II_DEBIT0_MASK 0x0000000000000001 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_II_DEBIT2 */ +/* Description: II debit2 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_II_DEBIT2_SHFT 1 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_II_DEBIT2_MASK 0x0000000000000002 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_LB_DEBIT0 */ +/* Description: LB debit0 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_LB_DEBIT0_SHFT 2 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_LB_DEBIT0_MASK 0x0000000000000004 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_LB_DEBIT2 */ +/* Description: LB debit2 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_LB_DEBIT2_SHFT 3 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_LB_DEBIT2_MASK 0x0000000000000008 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_II_VC0 */ +/* Description: II VC0 fifo overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_II_VC0_SHFT 4 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_II_VC0_MASK 0x0000000000000010 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_II_VC2 */ +/* Description: II VC2 fifo overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_II_VC2_SHFT 5 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_II_VC2_MASK 0x0000000000000020 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_II_VC0 */ +/* Description: II VC0 fifo underflow */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_II_VC0_SHFT 6 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_II_VC0_MASK 0x0000000000000040 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_II_VC2 */ +/* Description: II VC2 fifo underflow */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_II_VC2_SHFT 7 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_II_VC2_MASK 0x0000000000000080 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_LB_VC0 */ +/* Description: LB VC0 fifo overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_LB_VC0_SHFT 8 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_LB_VC0_MASK 0x0000000000000100 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_LB_VC2 */ +/* Description: LB VC2 fifo overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_LB_VC2_SHFT 9 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_LB_VC2_MASK 0x0000000000000200 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_LB_VC0 */ +/* Description: LB VC0 fifo underflow */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_LB_VC0_SHFT 10 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_LB_VC0_MASK 0x0000000000000400 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_LB_VC2 */ +/* Description: LB VC2 fifo underflow */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_LB_VC2_SHFT 11 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_LB_VC2_MASK 0x0000000000000800 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_VC0_CREDIT_IN */ +/* Description: PI VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_VC0_CREDIT_IN_SHFT 12 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_VC0_CREDIT_IN_MASK 0x0000000000001000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_VC0_CREDIT_IN */ +/* Description: IILB VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_VC0_CREDIT_IN_SHFT 13 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_VC0_CREDIT_IN_MASK 0x0000000000002000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_VC0_CREDIT_IN */ +/* Description: MD VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_VC0_CREDIT_IN_SHFT 14 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_VC0_CREDIT_IN_MASK 0x0000000000004000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_VC0_CREDIT_IN */ +/* Description: NI0 VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_VC0_CREDIT_IN_SHFT 15 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_VC0_CREDIT_IN_MASK 0x0000000000008000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_VC0_CREDIT_IN */ +/* Description: NI1 VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_VC0_CREDIT_IN_SHFT 16 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_VC0_CREDIT_IN_MASK 0x0000000000010000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_VC2_CREDIT_IN */ +/* Description: PI VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_VC2_CREDIT_IN_SHFT 17 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_VC2_CREDIT_IN_MASK 0x0000000000020000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_VC2_CREDIT_IN */ +/* Description: IILB VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_VC2_CREDIT_IN_SHFT 18 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_VC2_CREDIT_IN_MASK 0x0000000000040000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_VC2_CREDIT_IN */ +/* Description: MD VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_VC2_CREDIT_IN_SHFT 19 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_VC2_CREDIT_IN_MASK 0x0000000000080000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_VC2_CREDIT_IN */ +/* Description: NI0 VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_VC2_CREDIT_IN_SHFT 20 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_VC2_CREDIT_IN_MASK 0x0000000000100000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_VC2_CREDIT_IN */ +/* Description: NI1 VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_VC2_CREDIT_IN_SHFT 21 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_VC2_CREDIT_IN_MASK 0x0000000000200000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_PI_VC0_CREDIT_IN */ +/* Description: PI VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_PI_VC0_CREDIT_IN_SHFT 22 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_PI_VC0_CREDIT_IN_MASK 0x0000000000400000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_CREDIT_IN */ +/* Description: IILB VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_CREDIT_IN_SHFT 23 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_CREDIT_IN_MASK 0x0000000000800000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_MD_VC0_CREDIT_IN */ +/* Description: MD VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_MD_VC0_CREDIT_IN_SHFT 24 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_MD_VC0_CREDIT_IN_MASK 0x0000000001000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_CREDIT_IN */ +/* Description: NI0 VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_CREDIT_IN_SHFT 25 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_CREDIT_IN_MASK 0x0000000002000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_CREDIT_IN */ +/* Description: NI1 VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_CREDIT_IN_SHFT 26 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_CREDIT_IN_MASK 0x0000000004000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_PI_VC2_CREDIT_IN */ +/* Description: PI VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_PI_VC2_CREDIT_IN_SHFT 27 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_PI_VC2_CREDIT_IN_MASK 0x0000000008000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_CREDIT_IN */ +/* Description: IILB VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_CREDIT_IN_SHFT 28 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_CREDIT_IN_MASK 0x0000000010000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_MD_VC2_CREDIT_IN */ +/* Description: MD VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_MD_VC2_CREDIT_IN_SHFT 29 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_MD_VC2_CREDIT_IN_MASK 0x0000000020000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_CREDIT_IN */ +/* Description: NI0 VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_CREDIT_IN_SHFT 30 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_CREDIT_IN_MASK 0x0000000040000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_CREDIT_IN */ +/* Description: NI1 VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_CREDIT_IN_SHFT 31 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_CREDIT_IN_MASK 0x0000000080000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_DEBIT0 */ +/* Description: PI Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_DEBIT0_SHFT 32 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_DEBIT0_MASK 0x0000000100000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_DEBIT2 */ +/* Description: PI Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_DEBIT2_SHFT 33 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_DEBIT2_MASK 0x0000000200000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT0 */ +/* Description: IILB Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT0_SHFT 34 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT0_MASK 0x0000000400000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT2 */ +/* Description: IILB Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT2_SHFT 35 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT2_MASK 0x0000000800000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_DEBIT0 */ +/* Description: MD Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_DEBIT0_SHFT 36 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_DEBIT0_MASK 0x0000001000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_DEBIT2 */ +/* Description: MD Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_DEBIT2_SHFT 37 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_DEBIT2_MASK 0x0000002000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT0 */ +/* Description: NI0 Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT0_SHFT 38 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT0_MASK 0x0000004000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT2 */ +/* Description: NI0 Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT2_SHFT 39 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT2_MASK 0x0000008000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT0 */ +/* Description: NI1 Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT0_SHFT 40 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT0_MASK 0x0000010000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT2 */ +/* Description: NI1 Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT2_SHFT 41 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT2_MASK 0x0000020000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_VC0_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_VC0_CREDIT_OUT_SHFT 42 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_VC0_CREDIT_OUT_MASK 0x0000040000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_VC2_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_VC2_CREDIT_OUT_SHFT 43 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_PI_VC2_CREDIT_OUT_MASK 0x0000080000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_VC0_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_VC0_CREDIT_OUT_SHFT 44 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_VC0_CREDIT_OUT_MASK 0x0000100000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_VC2_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_VC2_CREDIT_OUT_SHFT 45 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_MD_VC2_CREDIT_OUT_MASK 0x0000200000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_VC0_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_VC0_CREDIT_OUT_SHFT 46 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_VC0_CREDIT_OUT_MASK 0x0000400000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_VC2_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_VC2_CREDIT_OUT_SHFT 47 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_IILB_VC2_CREDIT_OUT_MASK 0x0000800000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_VC0_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_VC0_CREDIT_OUT_SHFT 48 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_VC0_CREDIT_OUT_MASK 0x0001000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_VC2_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_VC2_CREDIT_OUT_SHFT 49 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI0_VC2_CREDIT_OUT_MASK 0x0002000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_VC0_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_VC0_CREDIT_OUT_SHFT 50 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_VC0_CREDIT_OUT_MASK 0x0004000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_VC2_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_VC2_CREDIT_OUT_SHFT 51 +#define SH_XNIILB_ERROR_SUMMARY_OVERFLOW_NI1_VC2_CREDIT_OUT_MASK 0x0008000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_PI_VC0_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_PI_VC0_CREDIT_OUT_SHFT 52 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_PI_VC0_CREDIT_OUT_MASK 0x0010000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_PI_VC2_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_PI_VC2_CREDIT_OUT_SHFT 53 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_PI_VC2_CREDIT_OUT_MASK 0x0020000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_MD_VC0_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_MD_VC0_CREDIT_OUT_SHFT 54 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_MD_VC0_CREDIT_OUT_MASK 0x0040000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_MD_VC2_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_MD_VC2_CREDIT_OUT_SHFT 55 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_MD_VC2_CREDIT_OUT_MASK 0x0080000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_CREDIT_OUT_SHFT 56 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_CREDIT_OUT_MASK 0x0100000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_CREDIT_OUT_SHFT 57 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_CREDIT_OUT_MASK 0x0200000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_CREDIT_OUT_SHFT 58 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_CREDIT_OUT_MASK 0x0400000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_CREDIT_OUT_SHFT 59 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_CREDIT_OUT_MASK 0x0800000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_CREDIT_OUT_SHFT 60 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_CREDIT_OUT_MASK 0x1000000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_CREDIT_OUT_SHFT 61 +#define SH_XNIILB_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_CREDIT_OUT_MASK 0x2000000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_CHIPLET_NOMATCH */ +/* Description: chiplet nomatch */ +#define SH_XNIILB_ERROR_SUMMARY_CHIPLET_NOMATCH_SHFT 62 +#define SH_XNIILB_ERROR_SUMMARY_CHIPLET_NOMATCH_MASK 0x4000000000000000 + +/* SH_XNIILB_ERROR_SUMMARY_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_XNIILB_ERROR_SUMMARY_LUT_READ_ERROR_SHFT 63 +#define SH_XNIILB_ERROR_SUMMARY_LUT_READ_ERROR_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERRORS_ALIAS" */ +/* ==================================================================== */ + +#define SH_XNIILB_ERRORS_ALIAS 0x0000000150040208 + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERROR_OVERFLOW" */ +/* ==================================================================== */ + +#define SH_XNIILB_ERROR_OVERFLOW 0x0000000150040220 +#define SH_XNIILB_ERROR_OVERFLOW_MASK 0xffffffffffffffff +#define SH_XNIILB_ERROR_OVERFLOW_INIT 0xffffffffffffffff + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_II_DEBIT0 */ +/* Description: II debit0 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_II_DEBIT0_SHFT 0 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_II_DEBIT0_MASK 0x0000000000000001 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_II_DEBIT2 */ +/* Description: II debit2 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_II_DEBIT2_SHFT 1 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_II_DEBIT2_MASK 0x0000000000000002 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_LB_DEBIT0 */ +/* Description: LB debit0 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_LB_DEBIT0_SHFT 2 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_LB_DEBIT0_MASK 0x0000000000000004 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_LB_DEBIT2 */ +/* Description: LB debit2 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_LB_DEBIT2_SHFT 3 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_LB_DEBIT2_MASK 0x0000000000000008 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_II_VC0 */ +/* Description: II VC0 fifo overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_II_VC0_SHFT 4 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_II_VC0_MASK 0x0000000000000010 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_II_VC2 */ +/* Description: II VC2 fifo overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_II_VC2_SHFT 5 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_II_VC2_MASK 0x0000000000000020 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_II_VC0 */ +/* Description: II VC0 fifo underflow */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_II_VC0_SHFT 6 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_II_VC0_MASK 0x0000000000000040 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_II_VC2 */ +/* Description: II VC2 fifo underflow */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_II_VC2_SHFT 7 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_II_VC2_MASK 0x0000000000000080 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_LB_VC0 */ +/* Description: LB VC0 fifo overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_LB_VC0_SHFT 8 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_LB_VC0_MASK 0x0000000000000100 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_LB_VC2 */ +/* Description: LB VC2 fifo overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_LB_VC2_SHFT 9 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_LB_VC2_MASK 0x0000000000000200 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_LB_VC0 */ +/* Description: LB VC0 fifo underflow */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_LB_VC0_SHFT 10 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_LB_VC0_MASK 0x0000000000000400 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_LB_VC2 */ +/* Description: LB VC2 fifo underflow */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_LB_VC2_SHFT 11 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_LB_VC2_MASK 0x0000000000000800 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_VC0_CREDIT_IN */ +/* Description: PI VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_VC0_CREDIT_IN_SHFT 12 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_VC0_CREDIT_IN_MASK 0x0000000000001000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_CREDIT_IN */ +/* Description: IILB VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_CREDIT_IN_SHFT 13 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_CREDIT_IN_MASK 0x0000000000002000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_VC0_CREDIT_IN */ +/* Description: MD VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_VC0_CREDIT_IN_SHFT 14 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_VC0_CREDIT_IN_MASK 0x0000000000004000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_CREDIT_IN */ +/* Description: NI0 VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_CREDIT_IN_SHFT 15 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_CREDIT_IN_MASK 0x0000000000008000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_CREDIT_IN */ +/* Description: NI1 VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_CREDIT_IN_SHFT 16 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_CREDIT_IN_MASK 0x0000000000010000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_VC2_CREDIT_IN */ +/* Description: PI VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_VC2_CREDIT_IN_SHFT 17 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_VC2_CREDIT_IN_MASK 0x0000000000020000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_CREDIT_IN */ +/* Description: IILB VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_CREDIT_IN_SHFT 18 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_CREDIT_IN_MASK 0x0000000000040000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_VC2_CREDIT_IN */ +/* Description: MD VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_VC2_CREDIT_IN_SHFT 19 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_VC2_CREDIT_IN_MASK 0x0000000000080000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_CREDIT_IN */ +/* Description: NI0 VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_CREDIT_IN_SHFT 20 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_CREDIT_IN_MASK 0x0000000000100000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_CREDIT_IN */ +/* Description: NI1 VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_CREDIT_IN_SHFT 21 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_CREDIT_IN_MASK 0x0000000000200000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_PI_VC0_CREDIT_IN */ +/* Description: PI VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_PI_VC0_CREDIT_IN_SHFT 22 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_PI_VC0_CREDIT_IN_MASK 0x0000000000400000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_CREDIT_IN */ +/* Description: IILB VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_CREDIT_IN_SHFT 23 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_CREDIT_IN_MASK 0x0000000000800000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_MD_VC0_CREDIT_IN */ +/* Description: MD VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_MD_VC0_CREDIT_IN_SHFT 24 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_MD_VC0_CREDIT_IN_MASK 0x0000000001000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_CREDIT_IN */ +/* Description: NI0 VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_CREDIT_IN_SHFT 25 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_CREDIT_IN_MASK 0x0000000002000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_CREDIT_IN */ +/* Description: NI1 VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_CREDIT_IN_SHFT 26 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_CREDIT_IN_MASK 0x0000000004000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_PI_VC2_CREDIT_IN */ +/* Description: PI VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_PI_VC2_CREDIT_IN_SHFT 27 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_PI_VC2_CREDIT_IN_MASK 0x0000000008000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_CREDIT_IN */ +/* Description: IILB VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_CREDIT_IN_SHFT 28 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_CREDIT_IN_MASK 0x0000000010000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_MD_VC2_CREDIT_IN */ +/* Description: MD VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_MD_VC2_CREDIT_IN_SHFT 29 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_MD_VC2_CREDIT_IN_MASK 0x0000000020000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_CREDIT_IN */ +/* Description: NI0 VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_CREDIT_IN_SHFT 30 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_CREDIT_IN_MASK 0x0000000040000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_CREDIT_IN */ +/* Description: NI1 VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_CREDIT_IN_SHFT 31 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_CREDIT_IN_MASK 0x0000000080000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_DEBIT0 */ +/* Description: PI Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_DEBIT0_SHFT 32 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_DEBIT0_MASK 0x0000000100000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_DEBIT2 */ +/* Description: PI Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_DEBIT2_SHFT 33 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_DEBIT2_MASK 0x0000000200000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT0 */ +/* Description: IILB Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT0_SHFT 34 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT0_MASK 0x0000000400000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT2 */ +/* Description: IILB Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT2_SHFT 35 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT2_MASK 0x0000000800000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_DEBIT0 */ +/* Description: MD Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_DEBIT0_SHFT 36 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_DEBIT0_MASK 0x0000001000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_DEBIT2 */ +/* Description: MD Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_DEBIT2_SHFT 37 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_DEBIT2_MASK 0x0000002000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT0 */ +/* Description: NI0 Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT0_SHFT 38 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT0_MASK 0x0000004000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT2 */ +/* Description: NI0 Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT2_SHFT 39 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT2_MASK 0x0000008000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT0 */ +/* Description: NI1 Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT0_SHFT 40 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT0_MASK 0x0000010000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT2 */ +/* Description: NI1 Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT2_SHFT 41 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT2_MASK 0x0000020000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_VC0_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_VC0_CREDIT_OUT_SHFT 42 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_VC0_CREDIT_OUT_MASK 0x0000040000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_VC2_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_VC2_CREDIT_OUT_SHFT 43 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_PI_VC2_CREDIT_OUT_MASK 0x0000080000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_VC0_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_VC0_CREDIT_OUT_SHFT 44 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_VC0_CREDIT_OUT_MASK 0x0000100000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_VC2_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_VC2_CREDIT_OUT_SHFT 45 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_MD_VC2_CREDIT_OUT_MASK 0x0000200000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_CREDIT_OUT_SHFT 46 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_CREDIT_OUT_MASK 0x0000400000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_CREDIT_OUT_SHFT 47 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_CREDIT_OUT_MASK 0x0000800000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_CREDIT_OUT_SHFT 48 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_CREDIT_OUT_MASK 0x0001000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_CREDIT_OUT_SHFT 49 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_CREDIT_OUT_MASK 0x0002000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_CREDIT_OUT_SHFT 50 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_CREDIT_OUT_MASK 0x0004000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_CREDIT_OUT_SHFT 51 +#define SH_XNIILB_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_CREDIT_OUT_MASK 0x0008000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_PI_VC0_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_PI_VC0_CREDIT_OUT_SHFT 52 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_PI_VC0_CREDIT_OUT_MASK 0x0010000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_PI_VC2_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_PI_VC2_CREDIT_OUT_SHFT 53 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_PI_VC2_CREDIT_OUT_MASK 0x0020000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_MD_VC0_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_MD_VC0_CREDIT_OUT_SHFT 54 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_MD_VC0_CREDIT_OUT_MASK 0x0040000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_MD_VC2_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_MD_VC2_CREDIT_OUT_SHFT 55 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_MD_VC2_CREDIT_OUT_MASK 0x0080000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_CREDIT_OUT_SHFT 56 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_CREDIT_OUT_MASK 0x0100000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_CREDIT_OUT_SHFT 57 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_CREDIT_OUT_MASK 0x0200000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_CREDIT_OUT_SHFT 58 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_CREDIT_OUT_MASK 0x0400000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_CREDIT_OUT_SHFT 59 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_CREDIT_OUT_MASK 0x0800000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_CREDIT_OUT_SHFT 60 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_CREDIT_OUT_MASK 0x1000000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_CREDIT_OUT_SHFT 61 +#define SH_XNIILB_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_CREDIT_OUT_MASK 0x2000000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_CHIPLET_NOMATCH */ +/* Description: chiplet nomatch */ +#define SH_XNIILB_ERROR_OVERFLOW_CHIPLET_NOMATCH_SHFT 62 +#define SH_XNIILB_ERROR_OVERFLOW_CHIPLET_NOMATCH_MASK 0x4000000000000000 + +/* SH_XNIILB_ERROR_OVERFLOW_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_XNIILB_ERROR_OVERFLOW_LUT_READ_ERROR_SHFT 63 +#define SH_XNIILB_ERROR_OVERFLOW_LUT_READ_ERROR_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERROR_OVERFLOW_ALIAS" */ +/* ==================================================================== */ + +#define SH_XNIILB_ERROR_OVERFLOW_ALIAS 0x0000000150040228 + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERROR_MASK" */ +/* ==================================================================== */ + +#define SH_XNIILB_ERROR_MASK 0x0000000150040240 +#define SH_XNIILB_ERROR_MASK_MASK 0xffffffffffffffff +#define SH_XNIILB_ERROR_MASK_INIT 0xffffffffffffffff + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_II_DEBIT0 */ +/* Description: II debit0 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_II_DEBIT0_SHFT 0 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_II_DEBIT0_MASK 0x0000000000000001 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_II_DEBIT2 */ +/* Description: II debit2 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_II_DEBIT2_SHFT 1 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_II_DEBIT2_MASK 0x0000000000000002 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_LB_DEBIT0 */ +/* Description: LB debit0 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_LB_DEBIT0_SHFT 2 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_LB_DEBIT0_MASK 0x0000000000000004 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_LB_DEBIT2 */ +/* Description: LB debit2 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_LB_DEBIT2_SHFT 3 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_LB_DEBIT2_MASK 0x0000000000000008 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_II_VC0 */ +/* Description: II VC0 fifo overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_II_VC0_SHFT 4 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_II_VC0_MASK 0x0000000000000010 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_II_VC2 */ +/* Description: II VC2 fifo overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_II_VC2_SHFT 5 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_II_VC2_MASK 0x0000000000000020 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_II_VC0 */ +/* Description: II VC0 fifo underflow */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_II_VC0_SHFT 6 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_II_VC0_MASK 0x0000000000000040 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_II_VC2 */ +/* Description: II VC2 fifo underflow */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_II_VC2_SHFT 7 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_II_VC2_MASK 0x0000000000000080 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_LB_VC0 */ +/* Description: LB VC0 fifo overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_LB_VC0_SHFT 8 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_LB_VC0_MASK 0x0000000000000100 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_LB_VC2 */ +/* Description: LB VC2 fifo overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_LB_VC2_SHFT 9 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_LB_VC2_MASK 0x0000000000000200 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_LB_VC0 */ +/* Description: LB VC0 fifo underflow */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_LB_VC0_SHFT 10 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_LB_VC0_MASK 0x0000000000000400 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_LB_VC2 */ +/* Description: LB VC2 fifo underflow */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_LB_VC2_SHFT 11 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_LB_VC2_MASK 0x0000000000000800 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_PI_VC0_CREDIT_IN */ +/* Description: PI VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_PI_VC0_CREDIT_IN_SHFT 12 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_PI_VC0_CREDIT_IN_MASK 0x0000000000001000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_VC0_CREDIT_IN */ +/* Description: IILB VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_VC0_CREDIT_IN_SHFT 13 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_VC0_CREDIT_IN_MASK 0x0000000000002000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_MD_VC0_CREDIT_IN */ +/* Description: MD VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_MD_VC0_CREDIT_IN_SHFT 14 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_MD_VC0_CREDIT_IN_MASK 0x0000000000004000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_VC0_CREDIT_IN */ +/* Description: NI0 VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_VC0_CREDIT_IN_SHFT 15 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_VC0_CREDIT_IN_MASK 0x0000000000008000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_VC0_CREDIT_IN */ +/* Description: NI1 VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_VC0_CREDIT_IN_SHFT 16 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_VC0_CREDIT_IN_MASK 0x0000000000010000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_PI_VC2_CREDIT_IN */ +/* Description: PI VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_PI_VC2_CREDIT_IN_SHFT 17 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_PI_VC2_CREDIT_IN_MASK 0x0000000000020000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_VC2_CREDIT_IN */ +/* Description: IILB VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_VC2_CREDIT_IN_SHFT 18 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_VC2_CREDIT_IN_MASK 0x0000000000040000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_MD_VC2_CREDIT_IN */ +/* Description: MD VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_MD_VC2_CREDIT_IN_SHFT 19 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_MD_VC2_CREDIT_IN_MASK 0x0000000000080000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_VC2_CREDIT_IN */ +/* Description: NI0 VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_VC2_CREDIT_IN_SHFT 20 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_VC2_CREDIT_IN_MASK 0x0000000000100000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_VC2_CREDIT_IN */ +/* Description: NI1 VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_VC2_CREDIT_IN_SHFT 21 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_VC2_CREDIT_IN_MASK 0x0000000000200000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_PI_VC0_CREDIT_IN */ +/* Description: PI VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_PI_VC0_CREDIT_IN_SHFT 22 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_PI_VC0_CREDIT_IN_MASK 0x0000000000400000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_IILB_VC0_CREDIT_IN */ +/* Description: IILB VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_IILB_VC0_CREDIT_IN_SHFT 23 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_IILB_VC0_CREDIT_IN_MASK 0x0000000000800000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_MD_VC0_CREDIT_IN */ +/* Description: MD VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_MD_VC0_CREDIT_IN_SHFT 24 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_MD_VC0_CREDIT_IN_MASK 0x0000000001000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_NI0_VC0_CREDIT_IN */ +/* Description: NI0 VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI0_VC0_CREDIT_IN_SHFT 25 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI0_VC0_CREDIT_IN_MASK 0x0000000002000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_NI1_VC0_CREDIT_IN */ +/* Description: NI1 VC0 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI1_VC0_CREDIT_IN_SHFT 26 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI1_VC0_CREDIT_IN_MASK 0x0000000004000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_PI_VC2_CREDIT_IN */ +/* Description: PI VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_PI_VC2_CREDIT_IN_SHFT 27 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_PI_VC2_CREDIT_IN_MASK 0x0000000008000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_IILB_VC2_CREDIT_IN */ +/* Description: IILB VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_IILB_VC2_CREDIT_IN_SHFT 28 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_IILB_VC2_CREDIT_IN_MASK 0x0000000010000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_MD_VC2_CREDIT_IN */ +/* Description: MD VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_MD_VC2_CREDIT_IN_SHFT 29 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_MD_VC2_CREDIT_IN_MASK 0x0000000020000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_NI0_VC2_CREDIT_IN */ +/* Description: NI0 VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI0_VC2_CREDIT_IN_SHFT 30 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI0_VC2_CREDIT_IN_MASK 0x0000000040000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_NI1_VC2_CREDIT_IN */ +/* Description: NI1 VC2 credit overflow Pipe In */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI1_VC2_CREDIT_IN_SHFT 31 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI1_VC2_CREDIT_IN_MASK 0x0000000080000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_PI_DEBIT0 */ +/* Description: PI Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_PI_DEBIT0_SHFT 32 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_PI_DEBIT0_MASK 0x0000000100000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_PI_DEBIT2 */ +/* Description: PI Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_PI_DEBIT2_SHFT 33 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_PI_DEBIT2_MASK 0x0000000200000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_DEBIT0 */ +/* Description: IILB Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_DEBIT0_SHFT 34 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_DEBIT0_MASK 0x0000000400000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_DEBIT2 */ +/* Description: IILB Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_DEBIT2_SHFT 35 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_DEBIT2_MASK 0x0000000800000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_MD_DEBIT0 */ +/* Description: MD Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_MD_DEBIT0_SHFT 36 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_MD_DEBIT0_MASK 0x0000001000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_MD_DEBIT2 */ +/* Description: MD Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_MD_DEBIT2_SHFT 37 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_MD_DEBIT2_MASK 0x0000002000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_DEBIT0 */ +/* Description: NI0 Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_DEBIT0_SHFT 38 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_DEBIT0_MASK 0x0000004000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_DEBIT2 */ +/* Description: NI0 Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_DEBIT2_SHFT 39 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_DEBIT2_MASK 0x0000008000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_DEBIT0 */ +/* Description: NI1 Fifo Debit0 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_DEBIT0_SHFT 40 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_DEBIT0_MASK 0x0000010000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_DEBIT2 */ +/* Description: NI1 Fifo Debit2 overflow */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_DEBIT2_SHFT 41 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_DEBIT2_MASK 0x0000020000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_PI_VC0_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_PI_VC0_CREDIT_OUT_SHFT 42 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_PI_VC0_CREDIT_OUT_MASK 0x0000040000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_PI_VC2_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_PI_VC2_CREDIT_OUT_SHFT 43 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_PI_VC2_CREDIT_OUT_MASK 0x0000080000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_MD_VC0_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_MD_VC0_CREDIT_OUT_SHFT 44 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_MD_VC0_CREDIT_OUT_MASK 0x0000100000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_MD_VC2_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_MD_VC2_CREDIT_OUT_SHFT 45 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_MD_VC2_CREDIT_OUT_MASK 0x0000200000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_VC0_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_VC0_CREDIT_OUT_SHFT 46 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_VC0_CREDIT_OUT_MASK 0x0000400000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_VC2_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_VC2_CREDIT_OUT_SHFT 47 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_IILB_VC2_CREDIT_OUT_MASK 0x0000800000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_VC0_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_VC0_CREDIT_OUT_SHFT 48 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_VC0_CREDIT_OUT_MASK 0x0001000000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_VC2_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_VC2_CREDIT_OUT_SHFT 49 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI0_VC2_CREDIT_OUT_MASK 0x0002000000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_VC0_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_VC0_CREDIT_OUT_SHFT 50 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_VC0_CREDIT_OUT_MASK 0x0004000000000000 + +/* SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_VC2_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_VC2_CREDIT_OUT_SHFT 51 +#define SH_XNIILB_ERROR_MASK_OVERFLOW_NI1_VC2_CREDIT_OUT_MASK 0x0008000000000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_PI_VC0_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_PI_VC0_CREDIT_OUT_SHFT 52 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_PI_VC0_CREDIT_OUT_MASK 0x0010000000000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_PI_VC2_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_PI_VC2_CREDIT_OUT_SHFT 53 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_PI_VC2_CREDIT_OUT_MASK 0x0020000000000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_MD_VC0_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_MD_VC0_CREDIT_OUT_SHFT 54 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_MD_VC0_CREDIT_OUT_MASK 0x0040000000000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_MD_VC2_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_MD_VC2_CREDIT_OUT_SHFT 55 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_MD_VC2_CREDIT_OUT_MASK 0x0080000000000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_IILB_VC0_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_IILB_VC0_CREDIT_OUT_SHFT 56 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_IILB_VC0_CREDIT_OUT_MASK 0x0100000000000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_IILB_VC2_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_IILB_VC2_CREDIT_OUT_SHFT 57 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_IILB_VC2_CREDIT_OUT_MASK 0x0200000000000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_NI0_VC0_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI0_VC0_CREDIT_OUT_SHFT 58 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI0_VC0_CREDIT_OUT_MASK 0x0400000000000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_NI0_VC2_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI0_VC2_CREDIT_OUT_SHFT 59 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI0_VC2_CREDIT_OUT_MASK 0x0800000000000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_NI1_VC0_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI1_VC0_CREDIT_OUT_SHFT 60 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI1_VC0_CREDIT_OUT_MASK 0x1000000000000000 + +/* SH_XNIILB_ERROR_MASK_UNDERFLOW_NI1_VC2_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI1_VC2_CREDIT_OUT_SHFT 61 +#define SH_XNIILB_ERROR_MASK_UNDERFLOW_NI1_VC2_CREDIT_OUT_MASK 0x2000000000000000 + +/* SH_XNIILB_ERROR_MASK_CHIPLET_NOMATCH */ +/* Description: chiplet nomatch */ +#define SH_XNIILB_ERROR_MASK_CHIPLET_NOMATCH_SHFT 62 +#define SH_XNIILB_ERROR_MASK_CHIPLET_NOMATCH_MASK 0x4000000000000000 + +/* SH_XNIILB_ERROR_MASK_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_XNIILB_ERROR_MASK_LUT_READ_ERROR_SHFT 63 +#define SH_XNIILB_ERROR_MASK_LUT_READ_ERROR_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNIILB_FIRST_ERROR" */ +/* ==================================================================== */ + +#define SH_XNIILB_FIRST_ERROR 0x0000000150040260 +#define SH_XNIILB_FIRST_ERROR_MASK 0xffffffffffffffff +#define SH_XNIILB_FIRST_ERROR_INIT 0xffffffffffffffff + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_II_DEBIT0 */ +/* Description: II debit0 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_II_DEBIT0_SHFT 0 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_II_DEBIT0_MASK 0x0000000000000001 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_II_DEBIT2 */ +/* Description: II debit2 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_II_DEBIT2_SHFT 1 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_II_DEBIT2_MASK 0x0000000000000002 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_LB_DEBIT0 */ +/* Description: LB debit0 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_LB_DEBIT0_SHFT 2 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_LB_DEBIT0_MASK 0x0000000000000004 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_LB_DEBIT2 */ +/* Description: LB debit2 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_LB_DEBIT2_SHFT 3 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_LB_DEBIT2_MASK 0x0000000000000008 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_II_VC0 */ +/* Description: II VC0 fifo overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_II_VC0_SHFT 4 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_II_VC0_MASK 0x0000000000000010 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_II_VC2 */ +/* Description: II VC2 fifo overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_II_VC2_SHFT 5 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_II_VC2_MASK 0x0000000000000020 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_II_VC0 */ +/* Description: II VC0 fifo underflow */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_II_VC0_SHFT 6 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_II_VC0_MASK 0x0000000000000040 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_II_VC2 */ +/* Description: II VC2 fifo underflow */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_II_VC2_SHFT 7 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_II_VC2_MASK 0x0000000000000080 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_LB_VC0 */ +/* Description: LB VC0 fifo overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_LB_VC0_SHFT 8 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_LB_VC0_MASK 0x0000000000000100 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_LB_VC2 */ +/* Description: LB VC2 fifo overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_LB_VC2_SHFT 9 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_LB_VC2_MASK 0x0000000000000200 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_LB_VC0 */ +/* Description: LB VC0 fifo underflow */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_LB_VC0_SHFT 10 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_LB_VC0_MASK 0x0000000000000400 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_LB_VC2 */ +/* Description: LB VC2 fifo underflow */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_LB_VC2_SHFT 11 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_LB_VC2_MASK 0x0000000000000800 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_VC0_CREDIT_IN */ +/* Description: PI VC0 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_VC0_CREDIT_IN_SHFT 12 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_VC0_CREDIT_IN_MASK 0x0000000000001000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_VC0_CREDIT_IN */ +/* Description: IILB VC0 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_VC0_CREDIT_IN_SHFT 13 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_VC0_CREDIT_IN_MASK 0x0000000000002000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_VC0_CREDIT_IN */ +/* Description: MD VC0 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_VC0_CREDIT_IN_SHFT 14 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_VC0_CREDIT_IN_MASK 0x0000000000004000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_VC0_CREDIT_IN */ +/* Description: NI0 VC0 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_VC0_CREDIT_IN_SHFT 15 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_VC0_CREDIT_IN_MASK 0x0000000000008000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_VC0_CREDIT_IN */ +/* Description: NI1 VC0 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_VC0_CREDIT_IN_SHFT 16 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_VC0_CREDIT_IN_MASK 0x0000000000010000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_VC2_CREDIT_IN */ +/* Description: PI VC2 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_VC2_CREDIT_IN_SHFT 17 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_VC2_CREDIT_IN_MASK 0x0000000000020000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_VC2_CREDIT_IN */ +/* Description: IILB VC2 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_VC2_CREDIT_IN_SHFT 18 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_VC2_CREDIT_IN_MASK 0x0000000000040000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_VC2_CREDIT_IN */ +/* Description: MD VC2 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_VC2_CREDIT_IN_SHFT 19 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_VC2_CREDIT_IN_MASK 0x0000000000080000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_VC2_CREDIT_IN */ +/* Description: NI0 VC2 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_VC2_CREDIT_IN_SHFT 20 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_VC2_CREDIT_IN_MASK 0x0000000000100000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_VC2_CREDIT_IN */ +/* Description: NI1 VC2 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_VC2_CREDIT_IN_SHFT 21 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_VC2_CREDIT_IN_MASK 0x0000000000200000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_PI_VC0_CREDIT_IN */ +/* Description: PI VC0 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_PI_VC0_CREDIT_IN_SHFT 22 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_PI_VC0_CREDIT_IN_MASK 0x0000000000400000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_IILB_VC0_CREDIT_IN */ +/* Description: IILB VC0 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_IILB_VC0_CREDIT_IN_SHFT 23 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_IILB_VC0_CREDIT_IN_MASK 0x0000000000800000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_MD_VC0_CREDIT_IN */ +/* Description: MD VC0 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_MD_VC0_CREDIT_IN_SHFT 24 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_MD_VC0_CREDIT_IN_MASK 0x0000000001000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI0_VC0_CREDIT_IN */ +/* Description: NI0 VC0 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI0_VC0_CREDIT_IN_SHFT 25 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI0_VC0_CREDIT_IN_MASK 0x0000000002000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI1_VC0_CREDIT_IN */ +/* Description: NI1 VC0 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI1_VC0_CREDIT_IN_SHFT 26 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI1_VC0_CREDIT_IN_MASK 0x0000000004000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_PI_VC2_CREDIT_IN */ +/* Description: PI VC2 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_PI_VC2_CREDIT_IN_SHFT 27 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_PI_VC2_CREDIT_IN_MASK 0x0000000008000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_IILB_VC2_CREDIT_IN */ +/* Description: IILB VC2 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_IILB_VC2_CREDIT_IN_SHFT 28 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_IILB_VC2_CREDIT_IN_MASK 0x0000000010000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_MD_VC2_CREDIT_IN */ +/* Description: MD VC2 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_MD_VC2_CREDIT_IN_SHFT 29 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_MD_VC2_CREDIT_IN_MASK 0x0000000020000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI0_VC2_CREDIT_IN */ +/* Description: NI0 VC2 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI0_VC2_CREDIT_IN_SHFT 30 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI0_VC2_CREDIT_IN_MASK 0x0000000040000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI1_VC2_CREDIT_IN */ +/* Description: NI1 VC2 credit overflow Pipe In */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI1_VC2_CREDIT_IN_SHFT 31 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI1_VC2_CREDIT_IN_MASK 0x0000000080000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_DEBIT0 */ +/* Description: PI Fifo Debit0 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_DEBIT0_SHFT 32 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_DEBIT0_MASK 0x0000000100000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_DEBIT2 */ +/* Description: PI Fifo Debit2 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_DEBIT2_SHFT 33 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_DEBIT2_MASK 0x0000000200000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_DEBIT0 */ +/* Description: IILB Fifo Debit0 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_DEBIT0_SHFT 34 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_DEBIT0_MASK 0x0000000400000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_DEBIT2 */ +/* Description: IILB Fifo Debit2 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_DEBIT2_SHFT 35 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_DEBIT2_MASK 0x0000000800000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_DEBIT0 */ +/* Description: MD Fifo Debit0 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_DEBIT0_SHFT 36 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_DEBIT0_MASK 0x0000001000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_DEBIT2 */ +/* Description: MD Fifo Debit2 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_DEBIT2_SHFT 37 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_DEBIT2_MASK 0x0000002000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_DEBIT0 */ +/* Description: NI0 Fifo Debit0 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_DEBIT0_SHFT 38 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_DEBIT0_MASK 0x0000004000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_DEBIT2 */ +/* Description: NI0 Fifo Debit2 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_DEBIT2_SHFT 39 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_DEBIT2_MASK 0x0000008000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_DEBIT0 */ +/* Description: NI1 Fifo Debit0 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_DEBIT0_SHFT 40 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_DEBIT0_MASK 0x0000010000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_DEBIT2 */ +/* Description: NI1 Fifo Debit2 overflow */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_DEBIT2_SHFT 41 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_DEBIT2_MASK 0x0000020000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_VC0_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_VC0_CREDIT_OUT_SHFT 42 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_VC0_CREDIT_OUT_MASK 0x0000040000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_VC2_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_VC2_CREDIT_OUT_SHFT 43 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_PI_VC2_CREDIT_OUT_MASK 0x0000080000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_VC0_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_VC0_CREDIT_OUT_SHFT 44 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_VC0_CREDIT_OUT_MASK 0x0000100000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_VC2_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_VC2_CREDIT_OUT_SHFT 45 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_MD_VC2_CREDIT_OUT_MASK 0x0000200000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_VC0_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_VC0_CREDIT_OUT_SHFT 46 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_VC0_CREDIT_OUT_MASK 0x0000400000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_VC2_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_VC2_CREDIT_OUT_SHFT 47 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_IILB_VC2_CREDIT_OUT_MASK 0x0000800000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_VC0_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_VC0_CREDIT_OUT_SHFT 48 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_VC0_CREDIT_OUT_MASK 0x0001000000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_VC2_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_VC2_CREDIT_OUT_SHFT 49 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI0_VC2_CREDIT_OUT_MASK 0x0002000000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_VC0_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_VC0_CREDIT_OUT_SHFT 50 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_VC0_CREDIT_OUT_MASK 0x0004000000000000 + +/* SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_VC2_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_VC2_CREDIT_OUT_SHFT 51 +#define SH_XNIILB_FIRST_ERROR_OVERFLOW_NI1_VC2_CREDIT_OUT_MASK 0x0008000000000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_PI_VC0_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_PI_VC0_CREDIT_OUT_SHFT 52 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_PI_VC0_CREDIT_OUT_MASK 0x0010000000000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_PI_VC2_CREDIT_OUT */ +/* Description: PI VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_PI_VC2_CREDIT_OUT_SHFT 53 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_PI_VC2_CREDIT_OUT_MASK 0x0020000000000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_MD_VC0_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_MD_VC0_CREDIT_OUT_SHFT 54 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_MD_VC0_CREDIT_OUT_MASK 0x0040000000000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_MD_VC2_CREDIT_OUT */ +/* Description: MD VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_MD_VC2_CREDIT_OUT_SHFT 55 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_MD_VC2_CREDIT_OUT_MASK 0x0080000000000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_IILB_VC0_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_IILB_VC0_CREDIT_OUT_SHFT 56 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_IILB_VC0_CREDIT_OUT_MASK 0x0100000000000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_IILB_VC2_CREDIT_OUT */ +/* Description: IILB VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_IILB_VC2_CREDIT_OUT_SHFT 57 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_IILB_VC2_CREDIT_OUT_MASK 0x0200000000000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI0_VC0_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI0_VC0_CREDIT_OUT_SHFT 58 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI0_VC0_CREDIT_OUT_MASK 0x0400000000000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI0_VC2_CREDIT_OUT */ +/* Description: NI0 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI0_VC2_CREDIT_OUT_SHFT 59 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI0_VC2_CREDIT_OUT_MASK 0x0800000000000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI1_VC0_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI1_VC0_CREDIT_OUT_SHFT 60 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI1_VC0_CREDIT_OUT_MASK 0x1000000000000000 + +/* SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI1_VC2_CREDIT_OUT */ +/* Description: NI1 VC0 Credit overflow Pipe Out */ +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI1_VC2_CREDIT_OUT_SHFT 61 +#define SH_XNIILB_FIRST_ERROR_UNDERFLOW_NI1_VC2_CREDIT_OUT_MASK 0x2000000000000000 + +/* SH_XNIILB_FIRST_ERROR_CHIPLET_NOMATCH */ +/* Description: chiplet nomatch */ +#define SH_XNIILB_FIRST_ERROR_CHIPLET_NOMATCH_SHFT 62 +#define SH_XNIILB_FIRST_ERROR_CHIPLET_NOMATCH_MASK 0x4000000000000000 + +/* SH_XNIILB_FIRST_ERROR_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_XNIILB_FIRST_ERROR_LUT_READ_ERROR_SHFT 63 +#define SH_XNIILB_FIRST_ERROR_LUT_READ_ERROR_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_XNPI_ERROR_SUMMARY" */ +/* ==================================================================== */ + +#define SH_XNPI_ERROR_SUMMARY 0x0000000150040300 +#define SH_XNPI_ERROR_SUMMARY_MASK 0x0003ffffffffffff +#define SH_XNPI_ERROR_SUMMARY_INIT 0x0003ffffffffffff + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_SHFT 0 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_MASK 0x0000000000000001 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_VC0_SHFT 1 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_VC0_MASK 0x0000000000000002 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_SHFT 2 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_MASK 0x0000000000000004 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_VC2_SHFT 3 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_VC2_MASK 0x0000000000000008 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_SHFT 4 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_MASK 0x0000000000000010 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_VC0_SHFT 5 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_VC0_MASK 0x0000000000000020 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_SHFT 6 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_MASK 0x0000000000000040 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_VC2_SHFT 7 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_VC2_MASK 0x0000000000000080 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_SHFT 8 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_MASK 0x0000000000000100 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_VC0_SHFT 9 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_VC0_MASK 0x0000000000000200 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_SHFT 10 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_MASK 0x0000000000000400 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_VC2_SHFT 11 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_VC2_MASK 0x0000000000000800 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_VC0_CREDIT_SHFT 12 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_VC0_CREDIT_SHFT 13 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_VC0_CREDIT_MASK 0x0000000000002000 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_VC2_CREDIT_SHFT 14 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_VC2_CREDIT_MASK 0x0000000000004000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_VC2_CREDIT_SHFT 15 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_DATABUFF_VC0 */ +/* Description: VC0 Data Buffer overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_DATABUFF_VC0_SHFT 16 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_DATABUFF_VC0_MASK 0x0000000000010000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_DATABUFF_VC2 */ +/* Description: VC2 Data Buffer overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_DATABUFF_VC2_SHFT 17 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_DATABUFF_VC2_MASK 0x0000000000020000 + +/* SH_XNPI_ERROR_SUMMARY_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_XNPI_ERROR_SUMMARY_LUT_READ_ERROR_SHFT 18 +#define SH_XNPI_ERROR_SUMMARY_LUT_READ_ERROR_MASK 0x0000000000040000 + +/* SH_XNPI_ERROR_SUMMARY_SINGLE_BIT_ERROR0 */ +/* Description: Single Bit Error in Bits 63:0 */ +#define SH_XNPI_ERROR_SUMMARY_SINGLE_BIT_ERROR0_SHFT 19 +#define SH_XNPI_ERROR_SUMMARY_SINGLE_BIT_ERROR0_MASK 0x0000000000080000 + +/* SH_XNPI_ERROR_SUMMARY_SINGLE_BIT_ERROR1 */ +/* Description: Single Bit Error in Bits 127:64 */ +#define SH_XNPI_ERROR_SUMMARY_SINGLE_BIT_ERROR1_SHFT 20 +#define SH_XNPI_ERROR_SUMMARY_SINGLE_BIT_ERROR1_MASK 0x0000000000100000 + +/* SH_XNPI_ERROR_SUMMARY_SINGLE_BIT_ERROR2 */ +/* Description: Single Bit Error in Bits 191:128 */ +#define SH_XNPI_ERROR_SUMMARY_SINGLE_BIT_ERROR2_SHFT 21 +#define SH_XNPI_ERROR_SUMMARY_SINGLE_BIT_ERROR2_MASK 0x0000000000200000 + +/* SH_XNPI_ERROR_SUMMARY_SINGLE_BIT_ERROR3 */ +/* Description: Single Bit Error in Bits 255:192 */ +#define SH_XNPI_ERROR_SUMMARY_SINGLE_BIT_ERROR3_SHFT 22 +#define SH_XNPI_ERROR_SUMMARY_SINGLE_BIT_ERROR3_MASK 0x0000000000400000 + +/* SH_XNPI_ERROR_SUMMARY_UNCOR_ERROR0 */ +/* Description: Uncorrectable Error in Bits 63:0 */ +#define SH_XNPI_ERROR_SUMMARY_UNCOR_ERROR0_SHFT 23 +#define SH_XNPI_ERROR_SUMMARY_UNCOR_ERROR0_MASK 0x0000000000800000 + +/* SH_XNPI_ERROR_SUMMARY_UNCOR_ERROR1 */ +/* Description: Uncorrectable Error in Bits 127:64 */ +#define SH_XNPI_ERROR_SUMMARY_UNCOR_ERROR1_SHFT 24 +#define SH_XNPI_ERROR_SUMMARY_UNCOR_ERROR1_MASK 0x0000000001000000 + +/* SH_XNPI_ERROR_SUMMARY_UNCOR_ERROR2 */ +/* Description: Uncorrectable Error in Bits 191:128 */ +#define SH_XNPI_ERROR_SUMMARY_UNCOR_ERROR2_SHFT 25 +#define SH_XNPI_ERROR_SUMMARY_UNCOR_ERROR2_MASK 0x0000000002000000 + +/* SH_XNPI_ERROR_SUMMARY_UNCOR_ERROR3 */ +/* Description: Uncorrectable Error in Bits 255:192 */ +#define SH_XNPI_ERROR_SUMMARY_UNCOR_ERROR3_SHFT 26 +#define SH_XNPI_ERROR_SUMMARY_UNCOR_ERROR3_MASK 0x0000000004000000 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_SIC_CNTR0_SHFT 27 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_SIC_CNTR0_MASK 0x0000000008000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_SIC_CNTR0_SHFT 28 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_SIC_CNTR0_MASK 0x0000000010000000 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_SIC_CNTR2_SHFT 29 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_SIC_CNTR2_MASK 0x0000000020000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_SIC_CNTR2_SHFT 30 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_SIC_CNTR2_MASK 0x0000000040000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT0 */ +/* Description: NI0 Debit 0 Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT0_SHFT 31 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT0_MASK 0x0000000080000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT2 */ +/* Description: NI0 Debit 2 Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT2_SHFT 32 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT2_MASK 0x0000000100000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT0 */ +/* Description: NI1 Debit 0 Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT0_SHFT 33 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT0_MASK 0x0000000200000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT2 */ +/* Description: NI1 Debit 2 Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT2_SHFT 34 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT2_MASK 0x0000000400000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT0 */ +/* Description: IILB Debit 0 Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT0_SHFT 35 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT0_MASK 0x0000000800000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT2 */ +/* Description: IILB Debit 2 Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT2_SHFT 36 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT2_MASK 0x0000001000000000 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_CREDIT_SHFT 37 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_CREDIT_MASK 0x0000002000000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_VC0_CREDIT_SHFT 38 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_VC0_CREDIT_MASK 0x0000004000000000 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_CREDIT_SHFT 39 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_CREDIT_MASK 0x0000008000000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_VC2_CREDIT_SHFT 40 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI0_VC2_CREDIT_MASK 0x0000010000000000 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_CREDIT_SHFT 41 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_CREDIT_MASK 0x0000020000000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_VC0_CREDIT_SHFT 42 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_VC0_CREDIT_MASK 0x0000040000000000 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_CREDIT_SHFT 43 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_CREDIT_MASK 0x0000080000000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_VC2_CREDIT_SHFT 44 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_NI1_VC2_CREDIT_MASK 0x0000100000000000 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_CREDIT_SHFT 45 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_CREDIT_MASK 0x0000200000000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_VC0_CREDIT_SHFT 46 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_XNPI_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Underflow */ +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_CREDIT_SHFT 47 +#define SH_XNPI_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_VC2_CREDIT_SHFT 48 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_IILB_VC2_CREDIT_MASK 0x0001000000000000 + +/* SH_XNPI_ERROR_SUMMARY_OVERFLOW_HEADER_CANCEL_FIFO */ +/* Description: Header Cancel Fifo Overflow */ +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_HEADER_CANCEL_FIFO_SHFT 49 +#define SH_XNPI_ERROR_SUMMARY_OVERFLOW_HEADER_CANCEL_FIFO_MASK 0x0002000000000000 + +/* ==================================================================== */ +/* Register "SH_XNPI_ERRORS_ALIAS" */ +/* ==================================================================== */ + +#define SH_XNPI_ERRORS_ALIAS 0x0000000150040308 + +/* ==================================================================== */ +/* Register "SH_XNPI_ERROR_OVERFLOW" */ +/* ==================================================================== */ + +#define SH_XNPI_ERROR_OVERFLOW 0x0000000150040320 +#define SH_XNPI_ERROR_OVERFLOW_MASK 0x0003ffffffffffff +#define SH_XNPI_ERROR_OVERFLOW_INIT 0x0003ffffffffffff + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_SHFT 0 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_MASK 0x0000000000000001 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_SHFT 1 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_MASK 0x0000000000000002 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_SHFT 2 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_MASK 0x0000000000000004 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_SHFT 3 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_MASK 0x0000000000000008 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_SHFT 4 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_MASK 0x0000000000000010 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_SHFT 5 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_MASK 0x0000000000000020 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_SHFT 6 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_MASK 0x0000000000000040 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_SHFT 7 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_MASK 0x0000000000000080 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_SHFT 8 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_MASK 0x0000000000000100 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_SHFT 9 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_MASK 0x0000000000000200 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_SHFT 10 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_MASK 0x0000000000000400 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_SHFT 11 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_MASK 0x0000000000000800 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_VC0_CREDIT_SHFT 12 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_VC0_CREDIT_SHFT 13 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_VC0_CREDIT_MASK 0x0000000000002000 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_VC2_CREDIT_SHFT 14 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_VC2_CREDIT_MASK 0x0000000000004000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_VC2_CREDIT_SHFT 15 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_DATABUFF_VC0 */ +/* Description: VC0 Data Buffer overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_DATABUFF_VC0_SHFT 16 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_DATABUFF_VC0_MASK 0x0000000000010000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_DATABUFF_VC2 */ +/* Description: VC2 Data Buffer overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_DATABUFF_VC2_SHFT 17 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_DATABUFF_VC2_MASK 0x0000000000020000 + +/* SH_XNPI_ERROR_OVERFLOW_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_XNPI_ERROR_OVERFLOW_LUT_READ_ERROR_SHFT 18 +#define SH_XNPI_ERROR_OVERFLOW_LUT_READ_ERROR_MASK 0x0000000000040000 + +/* SH_XNPI_ERROR_OVERFLOW_SINGLE_BIT_ERROR0 */ +/* Description: Single Bit Error in Bits 63:0 */ +#define SH_XNPI_ERROR_OVERFLOW_SINGLE_BIT_ERROR0_SHFT 19 +#define SH_XNPI_ERROR_OVERFLOW_SINGLE_BIT_ERROR0_MASK 0x0000000000080000 + +/* SH_XNPI_ERROR_OVERFLOW_SINGLE_BIT_ERROR1 */ +/* Description: Single Bit Error in Bits 127:64 */ +#define SH_XNPI_ERROR_OVERFLOW_SINGLE_BIT_ERROR1_SHFT 20 +#define SH_XNPI_ERROR_OVERFLOW_SINGLE_BIT_ERROR1_MASK 0x0000000000100000 + +/* SH_XNPI_ERROR_OVERFLOW_SINGLE_BIT_ERROR2 */ +/* Description: Single Bit Error in Bits 191:128 */ +#define SH_XNPI_ERROR_OVERFLOW_SINGLE_BIT_ERROR2_SHFT 21 +#define SH_XNPI_ERROR_OVERFLOW_SINGLE_BIT_ERROR2_MASK 0x0000000000200000 + +/* SH_XNPI_ERROR_OVERFLOW_SINGLE_BIT_ERROR3 */ +/* Description: Single Bit Error in Bits 255:192 */ +#define SH_XNPI_ERROR_OVERFLOW_SINGLE_BIT_ERROR3_SHFT 22 +#define SH_XNPI_ERROR_OVERFLOW_SINGLE_BIT_ERROR3_MASK 0x0000000000400000 + +/* SH_XNPI_ERROR_OVERFLOW_UNCOR_ERROR0 */ +/* Description: Uncorrectable Error in Bits 63:0 */ +#define SH_XNPI_ERROR_OVERFLOW_UNCOR_ERROR0_SHFT 23 +#define SH_XNPI_ERROR_OVERFLOW_UNCOR_ERROR0_MASK 0x0000000000800000 + +/* SH_XNPI_ERROR_OVERFLOW_UNCOR_ERROR1 */ +/* Description: Uncorrectable Error in Bits 127:64 */ +#define SH_XNPI_ERROR_OVERFLOW_UNCOR_ERROR1_SHFT 24 +#define SH_XNPI_ERROR_OVERFLOW_UNCOR_ERROR1_MASK 0x0000000001000000 + +/* SH_XNPI_ERROR_OVERFLOW_UNCOR_ERROR2 */ +/* Description: Uncorrectable Error in Bits 191:128 */ +#define SH_XNPI_ERROR_OVERFLOW_UNCOR_ERROR2_SHFT 25 +#define SH_XNPI_ERROR_OVERFLOW_UNCOR_ERROR2_MASK 0x0000000002000000 + +/* SH_XNPI_ERROR_OVERFLOW_UNCOR_ERROR3 */ +/* Description: Uncorrectable Error in Bits 255:192 */ +#define SH_XNPI_ERROR_OVERFLOW_UNCOR_ERROR3_SHFT 26 +#define SH_XNPI_ERROR_OVERFLOW_UNCOR_ERROR3_MASK 0x0000000004000000 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_SIC_CNTR0_SHFT 27 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_SIC_CNTR0_MASK 0x0000000008000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_SIC_CNTR0_SHFT 28 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_SIC_CNTR0_MASK 0x0000000010000000 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_SIC_CNTR2_SHFT 29 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_SIC_CNTR2_MASK 0x0000000020000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_SIC_CNTR2_SHFT 30 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_SIC_CNTR2_MASK 0x0000000040000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT0 */ +/* Description: NI0 Debit 0 Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT0_SHFT 31 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT0_MASK 0x0000000080000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT2 */ +/* Description: NI0 Debit 2 Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT2_SHFT 32 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT2_MASK 0x0000000100000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT0 */ +/* Description: NI1 Debit 0 Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT0_SHFT 33 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT0_MASK 0x0000000200000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT2 */ +/* Description: NI1 Debit 2 Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT2_SHFT 34 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT2_MASK 0x0000000400000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT0 */ +/* Description: IILB Debit 0 Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT0_SHFT 35 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT0_MASK 0x0000000800000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT2 */ +/* Description: IILB Debit 2 Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT2_SHFT 36 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT2_MASK 0x0000001000000000 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_CREDIT_SHFT 37 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_CREDIT_MASK 0x0000002000000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_CREDIT_SHFT 38 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_CREDIT_MASK 0x0000004000000000 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_CREDIT_SHFT 39 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_CREDIT_MASK 0x0000008000000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_CREDIT_SHFT 40 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_CREDIT_MASK 0x0000010000000000 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_CREDIT_SHFT 41 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_CREDIT_MASK 0x0000020000000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_CREDIT_SHFT 42 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_CREDIT_MASK 0x0000040000000000 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_CREDIT_SHFT 43 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_CREDIT_MASK 0x0000080000000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_CREDIT_SHFT 44 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_CREDIT_MASK 0x0000100000000000 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_CREDIT_SHFT 45 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_CREDIT_MASK 0x0000200000000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_CREDIT_SHFT 46 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Underflow */ +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_CREDIT_SHFT 47 +#define SH_XNPI_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_CREDIT_SHFT 48 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_CREDIT_MASK 0x0001000000000000 + +/* SH_XNPI_ERROR_OVERFLOW_OVERFLOW_HEADER_CANCEL_FIFO */ +/* Description: Header Cancel Fifo Overflow */ +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_HEADER_CANCEL_FIFO_SHFT 49 +#define SH_XNPI_ERROR_OVERFLOW_OVERFLOW_HEADER_CANCEL_FIFO_MASK 0x0002000000000000 + +/* ==================================================================== */ +/* Register "SH_XNPI_ERROR_OVERFLOW_ALIAS" */ +/* ==================================================================== */ + +#define SH_XNPI_ERROR_OVERFLOW_ALIAS 0x0000000150040328 + +/* ==================================================================== */ +/* Register "SH_XNPI_ERROR_MASK" */ +/* ==================================================================== */ + +#define SH_XNPI_ERROR_MASK 0x0000000150040340 +#define SH_XNPI_ERROR_MASK_MASK 0x0003ffffffffffff +#define SH_XNPI_ERROR_MASK_INIT 0x0003ffffffffffff + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI0_VC0_SHFT 0 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI0_VC0_MASK 0x0000000000000001 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI0_VC0_SHFT 1 +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI0_VC0_MASK 0x0000000000000002 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI0_VC2_SHFT 2 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI0_VC2_MASK 0x0000000000000004 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI0_VC2_SHFT 3 +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI0_VC2_MASK 0x0000000000000008 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI1_VC0_SHFT 4 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI1_VC0_MASK 0x0000000000000010 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI1_VC0_SHFT 5 +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI1_VC0_MASK 0x0000000000000020 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI1_VC2_SHFT 6 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI1_VC2_MASK 0x0000000000000040 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI1_VC2_SHFT 7 +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI1_VC2_MASK 0x0000000000000080 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_IILB_VC0_SHFT 8 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_IILB_VC0_MASK 0x0000000000000100 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_IILB_VC0_SHFT 9 +#define SH_XNPI_ERROR_MASK_OVERFLOW_IILB_VC0_MASK 0x0000000000000200 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_IILB_VC2_SHFT 10 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_IILB_VC2_MASK 0x0000000000000400 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_IILB_VC2_SHFT 11 +#define SH_XNPI_ERROR_MASK_OVERFLOW_IILB_VC2_MASK 0x0000000000000800 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_VC0_CREDIT_SHFT 12 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_VC0_CREDIT_SHFT 13 +#define SH_XNPI_ERROR_MASK_OVERFLOW_VC0_CREDIT_MASK 0x0000000000002000 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_VC2_CREDIT_SHFT 14 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_VC2_CREDIT_MASK 0x0000000000004000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_VC2_CREDIT_SHFT 15 +#define SH_XNPI_ERROR_MASK_OVERFLOW_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_DATABUFF_VC0 */ +/* Description: VC0 Data Buffer overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_DATABUFF_VC0_SHFT 16 +#define SH_XNPI_ERROR_MASK_OVERFLOW_DATABUFF_VC0_MASK 0x0000000000010000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_DATABUFF_VC2 */ +/* Description: VC2 Data Buffer overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_DATABUFF_VC2_SHFT 17 +#define SH_XNPI_ERROR_MASK_OVERFLOW_DATABUFF_VC2_MASK 0x0000000000020000 + +/* SH_XNPI_ERROR_MASK_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_XNPI_ERROR_MASK_LUT_READ_ERROR_SHFT 18 +#define SH_XNPI_ERROR_MASK_LUT_READ_ERROR_MASK 0x0000000000040000 + +/* SH_XNPI_ERROR_MASK_SINGLE_BIT_ERROR0 */ +/* Description: Single Bit Error in Bits 63:0 */ +#define SH_XNPI_ERROR_MASK_SINGLE_BIT_ERROR0_SHFT 19 +#define SH_XNPI_ERROR_MASK_SINGLE_BIT_ERROR0_MASK 0x0000000000080000 + +/* SH_XNPI_ERROR_MASK_SINGLE_BIT_ERROR1 */ +/* Description: Single Bit Error in Bits 127:64 */ +#define SH_XNPI_ERROR_MASK_SINGLE_BIT_ERROR1_SHFT 20 +#define SH_XNPI_ERROR_MASK_SINGLE_BIT_ERROR1_MASK 0x0000000000100000 + +/* SH_XNPI_ERROR_MASK_SINGLE_BIT_ERROR2 */ +/* Description: Single Bit Error in Bits 191:128 */ +#define SH_XNPI_ERROR_MASK_SINGLE_BIT_ERROR2_SHFT 21 +#define SH_XNPI_ERROR_MASK_SINGLE_BIT_ERROR2_MASK 0x0000000000200000 + +/* SH_XNPI_ERROR_MASK_SINGLE_BIT_ERROR3 */ +/* Description: Single Bit Error in Bits 255:192 */ +#define SH_XNPI_ERROR_MASK_SINGLE_BIT_ERROR3_SHFT 22 +#define SH_XNPI_ERROR_MASK_SINGLE_BIT_ERROR3_MASK 0x0000000000400000 + +/* SH_XNPI_ERROR_MASK_UNCOR_ERROR0 */ +/* Description: Uncorrectable Error in Bits 63:0 */ +#define SH_XNPI_ERROR_MASK_UNCOR_ERROR0_SHFT 23 +#define SH_XNPI_ERROR_MASK_UNCOR_ERROR0_MASK 0x0000000000800000 + +/* SH_XNPI_ERROR_MASK_UNCOR_ERROR1 */ +/* Description: Uncorrectable Error in Bits 127:64 */ +#define SH_XNPI_ERROR_MASK_UNCOR_ERROR1_SHFT 24 +#define SH_XNPI_ERROR_MASK_UNCOR_ERROR1_MASK 0x0000000001000000 + +/* SH_XNPI_ERROR_MASK_UNCOR_ERROR2 */ +/* Description: Uncorrectable Error in Bits 191:128 */ +#define SH_XNPI_ERROR_MASK_UNCOR_ERROR2_SHFT 25 +#define SH_XNPI_ERROR_MASK_UNCOR_ERROR2_MASK 0x0000000002000000 + +/* SH_XNPI_ERROR_MASK_UNCOR_ERROR3 */ +/* Description: Uncorrectable Error in Bits 255:192 */ +#define SH_XNPI_ERROR_MASK_UNCOR_ERROR3_SHFT 26 +#define SH_XNPI_ERROR_MASK_UNCOR_ERROR3_MASK 0x0000000004000000 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_SIC_CNTR0_SHFT 27 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_SIC_CNTR0_MASK 0x0000000008000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_SIC_CNTR0_SHFT 28 +#define SH_XNPI_ERROR_MASK_OVERFLOW_SIC_CNTR0_MASK 0x0000000010000000 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_SIC_CNTR2_SHFT 29 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_SIC_CNTR2_MASK 0x0000000020000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_SIC_CNTR2_SHFT 30 +#define SH_XNPI_ERROR_MASK_OVERFLOW_SIC_CNTR2_MASK 0x0000000040000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_NI0_DEBIT0 */ +/* Description: NI0 Debit 0 Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI0_DEBIT0_SHFT 31 +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI0_DEBIT0_MASK 0x0000000080000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_NI0_DEBIT2 */ +/* Description: NI0 Debit 2 Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI0_DEBIT2_SHFT 32 +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI0_DEBIT2_MASK 0x0000000100000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_NI1_DEBIT0 */ +/* Description: NI1 Debit 0 Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI1_DEBIT0_SHFT 33 +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI1_DEBIT0_MASK 0x0000000200000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_NI1_DEBIT2 */ +/* Description: NI1 Debit 2 Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI1_DEBIT2_SHFT 34 +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI1_DEBIT2_MASK 0x0000000400000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_IILB_DEBIT0 */ +/* Description: IILB Debit 0 Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_IILB_DEBIT0_SHFT 35 +#define SH_XNPI_ERROR_MASK_OVERFLOW_IILB_DEBIT0_MASK 0x0000000800000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_IILB_DEBIT2 */ +/* Description: IILB Debit 2 Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_IILB_DEBIT2_SHFT 36 +#define SH_XNPI_ERROR_MASK_OVERFLOW_IILB_DEBIT2_MASK 0x0000001000000000 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI0_VC0_CREDIT_SHFT 37 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI0_VC0_CREDIT_MASK 0x0000002000000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI0_VC0_CREDIT_SHFT 38 +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI0_VC0_CREDIT_MASK 0x0000004000000000 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI0_VC2_CREDIT_SHFT 39 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI0_VC2_CREDIT_MASK 0x0000008000000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI0_VC2_CREDIT_SHFT 40 +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI0_VC2_CREDIT_MASK 0x0000010000000000 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI1_VC0_CREDIT_SHFT 41 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI1_VC0_CREDIT_MASK 0x0000020000000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI1_VC0_CREDIT_SHFT 42 +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI1_VC0_CREDIT_MASK 0x0000040000000000 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI1_VC2_CREDIT_SHFT 43 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_NI1_VC2_CREDIT_MASK 0x0000080000000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI1_VC2_CREDIT_SHFT 44 +#define SH_XNPI_ERROR_MASK_OVERFLOW_NI1_VC2_CREDIT_MASK 0x0000100000000000 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_IILB_VC0_CREDIT_SHFT 45 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_IILB_VC0_CREDIT_MASK 0x0000200000000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_IILB_VC0_CREDIT_SHFT 46 +#define SH_XNPI_ERROR_MASK_OVERFLOW_IILB_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_XNPI_ERROR_MASK_UNDERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Underflow */ +#define SH_XNPI_ERROR_MASK_UNDERFLOW_IILB_VC2_CREDIT_SHFT 47 +#define SH_XNPI_ERROR_MASK_UNDERFLOW_IILB_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_IILB_VC2_CREDIT_SHFT 48 +#define SH_XNPI_ERROR_MASK_OVERFLOW_IILB_VC2_CREDIT_MASK 0x0001000000000000 + +/* SH_XNPI_ERROR_MASK_OVERFLOW_HEADER_CANCEL_FIFO */ +/* Description: Header Cancel Fifo Overflow */ +#define SH_XNPI_ERROR_MASK_OVERFLOW_HEADER_CANCEL_FIFO_SHFT 49 +#define SH_XNPI_ERROR_MASK_OVERFLOW_HEADER_CANCEL_FIFO_MASK 0x0002000000000000 + +/* ==================================================================== */ +/* Register "SH_XNPI_FIRST_ERROR" */ +/* ==================================================================== */ + +#define SH_XNPI_FIRST_ERROR 0x0000000150040360 +#define SH_XNPI_FIRST_ERROR_MASK 0x0003ffffffffffff +#define SH_XNPI_FIRST_ERROR_INIT 0x0003ffffffffffff + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI0_VC0_SHFT 0 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI0_VC0_MASK 0x0000000000000001 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_VC0_SHFT 1 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_VC0_MASK 0x0000000000000002 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI0_VC2_SHFT 2 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI0_VC2_MASK 0x0000000000000004 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_VC2_SHFT 3 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_VC2_MASK 0x0000000000000008 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI1_VC0_SHFT 4 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI1_VC0_MASK 0x0000000000000010 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_VC0_SHFT 5 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_VC0_MASK 0x0000000000000020 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI1_VC2_SHFT 6 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI1_VC2_MASK 0x0000000000000040 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_VC2_SHFT 7 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_VC2_MASK 0x0000000000000080 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_IILB_VC0_SHFT 8 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_IILB_VC0_MASK 0x0000000000000100 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_VC0_SHFT 9 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_VC0_MASK 0x0000000000000200 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_IILB_VC2_SHFT 10 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_IILB_VC2_MASK 0x0000000000000400 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_VC2_SHFT 11 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_VC2_MASK 0x0000000000000800 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_VC0_CREDIT_SHFT 12 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_VC0_CREDIT_SHFT 13 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_VC0_CREDIT_MASK 0x0000000000002000 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_VC2_CREDIT_SHFT 14 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_VC2_CREDIT_MASK 0x0000000000004000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_VC2_CREDIT_SHFT 15 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_DATABUFF_VC0 */ +/* Description: VC0 Data Buffer overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_DATABUFF_VC0_SHFT 16 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_DATABUFF_VC0_MASK 0x0000000000010000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_DATABUFF_VC2 */ +/* Description: VC2 Data Buffer overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_DATABUFF_VC2_SHFT 17 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_DATABUFF_VC2_MASK 0x0000000000020000 + +/* SH_XNPI_FIRST_ERROR_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_XNPI_FIRST_ERROR_LUT_READ_ERROR_SHFT 18 +#define SH_XNPI_FIRST_ERROR_LUT_READ_ERROR_MASK 0x0000000000040000 + +/* SH_XNPI_FIRST_ERROR_SINGLE_BIT_ERROR0 */ +/* Description: Single Bit Error in Bits 63:0 */ +#define SH_XNPI_FIRST_ERROR_SINGLE_BIT_ERROR0_SHFT 19 +#define SH_XNPI_FIRST_ERROR_SINGLE_BIT_ERROR0_MASK 0x0000000000080000 + +/* SH_XNPI_FIRST_ERROR_SINGLE_BIT_ERROR1 */ +/* Description: Single Bit Error in Bits 127:64 */ +#define SH_XNPI_FIRST_ERROR_SINGLE_BIT_ERROR1_SHFT 20 +#define SH_XNPI_FIRST_ERROR_SINGLE_BIT_ERROR1_MASK 0x0000000000100000 + +/* SH_XNPI_FIRST_ERROR_SINGLE_BIT_ERROR2 */ +/* Description: Single Bit Error in Bits 191:128 */ +#define SH_XNPI_FIRST_ERROR_SINGLE_BIT_ERROR2_SHFT 21 +#define SH_XNPI_FIRST_ERROR_SINGLE_BIT_ERROR2_MASK 0x0000000000200000 + +/* SH_XNPI_FIRST_ERROR_SINGLE_BIT_ERROR3 */ +/* Description: Single Bit Error in Bits 255:192 */ +#define SH_XNPI_FIRST_ERROR_SINGLE_BIT_ERROR3_SHFT 22 +#define SH_XNPI_FIRST_ERROR_SINGLE_BIT_ERROR3_MASK 0x0000000000400000 + +/* SH_XNPI_FIRST_ERROR_UNCOR_ERROR0 */ +/* Description: Uncorrectable Error in Bits 63:0 */ +#define SH_XNPI_FIRST_ERROR_UNCOR_ERROR0_SHFT 23 +#define SH_XNPI_FIRST_ERROR_UNCOR_ERROR0_MASK 0x0000000000800000 + +/* SH_XNPI_FIRST_ERROR_UNCOR_ERROR1 */ +/* Description: Uncorrectable Error in Bits 127:64 */ +#define SH_XNPI_FIRST_ERROR_UNCOR_ERROR1_SHFT 24 +#define SH_XNPI_FIRST_ERROR_UNCOR_ERROR1_MASK 0x0000000001000000 + +/* SH_XNPI_FIRST_ERROR_UNCOR_ERROR2 */ +/* Description: Uncorrectable Error in Bits 191:128 */ +#define SH_XNPI_FIRST_ERROR_UNCOR_ERROR2_SHFT 25 +#define SH_XNPI_FIRST_ERROR_UNCOR_ERROR2_MASK 0x0000000002000000 + +/* SH_XNPI_FIRST_ERROR_UNCOR_ERROR3 */ +/* Description: Uncorrectable Error in Bits 255:192 */ +#define SH_XNPI_FIRST_ERROR_UNCOR_ERROR3_SHFT 26 +#define SH_XNPI_FIRST_ERROR_UNCOR_ERROR3_MASK 0x0000000004000000 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_SIC_CNTR0_SHFT 27 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_SIC_CNTR0_MASK 0x0000000008000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_SIC_CNTR0_SHFT 28 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_SIC_CNTR0_MASK 0x0000000010000000 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_SIC_CNTR2_SHFT 29 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_SIC_CNTR2_MASK 0x0000000020000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_SIC_CNTR2_SHFT 30 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_SIC_CNTR2_MASK 0x0000000040000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_DEBIT0 */ +/* Description: NI0 Debit 0 Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_DEBIT0_SHFT 31 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_DEBIT0_MASK 0x0000000080000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_DEBIT2 */ +/* Description: NI0 Debit 2 Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_DEBIT2_SHFT 32 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_DEBIT2_MASK 0x0000000100000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_DEBIT0 */ +/* Description: NI1 Debit 0 Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_DEBIT0_SHFT 33 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_DEBIT0_MASK 0x0000000200000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_DEBIT2 */ +/* Description: NI1 Debit 2 Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_DEBIT2_SHFT 34 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_DEBIT2_MASK 0x0000000400000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_DEBIT0 */ +/* Description: IILB Debit 0 Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_DEBIT0_SHFT 35 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_DEBIT0_MASK 0x0000000800000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_DEBIT2 */ +/* Description: IILB Debit 2 Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_DEBIT2_SHFT 36 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_DEBIT2_MASK 0x0000001000000000 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI0_VC0_CREDIT_SHFT 37 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI0_VC0_CREDIT_MASK 0x0000002000000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_VC0_CREDIT_SHFT 38 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_VC0_CREDIT_MASK 0x0000004000000000 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI0_VC2_CREDIT_SHFT 39 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI0_VC2_CREDIT_MASK 0x0000008000000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_VC2_CREDIT_SHFT 40 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI0_VC2_CREDIT_MASK 0x0000010000000000 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI1_VC0_CREDIT_SHFT 41 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI1_VC0_CREDIT_MASK 0x0000020000000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_VC0_CREDIT_SHFT 42 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_VC0_CREDIT_MASK 0x0000040000000000 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI1_VC2_CREDIT_SHFT 43 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_NI1_VC2_CREDIT_MASK 0x0000080000000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_VC2_CREDIT_SHFT 44 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_NI1_VC2_CREDIT_MASK 0x0000100000000000 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_IILB_VC0_CREDIT_SHFT 45 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_IILB_VC0_CREDIT_MASK 0x0000200000000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_VC0_CREDIT_SHFT 46 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_XNPI_FIRST_ERROR_UNDERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Underflow */ +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_IILB_VC2_CREDIT_SHFT 47 +#define SH_XNPI_FIRST_ERROR_UNDERFLOW_IILB_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_VC2_CREDIT_SHFT 48 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_IILB_VC2_CREDIT_MASK 0x0001000000000000 + +/* SH_XNPI_FIRST_ERROR_OVERFLOW_HEADER_CANCEL_FIFO */ +/* Description: Header Cancel Fifo Overflow */ +#define SH_XNPI_FIRST_ERROR_OVERFLOW_HEADER_CANCEL_FIFO_SHFT 49 +#define SH_XNPI_FIRST_ERROR_OVERFLOW_HEADER_CANCEL_FIFO_MASK 0x0002000000000000 + +/* ==================================================================== */ +/* Register "SH_XNMD_ERROR_SUMMARY" */ +/* ==================================================================== */ + +#define SH_XNMD_ERROR_SUMMARY 0x0000000150040400 +#define SH_XNMD_ERROR_SUMMARY_MASK 0x0003ffffffffffff +#define SH_XNMD_ERROR_SUMMARY_INIT 0x0003ffffffffffff + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_SHFT 0 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_MASK 0x0000000000000001 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_VC0_SHFT 1 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_VC0_MASK 0x0000000000000002 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_SHFT 2 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_MASK 0x0000000000000004 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_VC2_SHFT 3 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_VC2_MASK 0x0000000000000008 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_SHFT 4 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_MASK 0x0000000000000010 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_VC0_SHFT 5 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_VC0_MASK 0x0000000000000020 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_SHFT 6 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_MASK 0x0000000000000040 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_VC2_SHFT 7 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_VC2_MASK 0x0000000000000080 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_SHFT 8 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_MASK 0x0000000000000100 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_VC0_SHFT 9 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_VC0_MASK 0x0000000000000200 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_SHFT 10 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_MASK 0x0000000000000400 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_VC2_SHFT 11 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_VC2_MASK 0x0000000000000800 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_VC0_CREDIT_SHFT 12 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_VC0_CREDIT_SHFT 13 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_VC0_CREDIT_MASK 0x0000000000002000 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_VC2_CREDIT_SHFT 14 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_VC2_CREDIT_MASK 0x0000000000004000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_VC2_CREDIT_SHFT 15 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_DATABUFF_VC0 */ +/* Description: VC0 Data Buffer overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_DATABUFF_VC0_SHFT 16 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_DATABUFF_VC0_MASK 0x0000000000010000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_DATABUFF_VC2 */ +/* Description: VC2 Data Buffer overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_DATABUFF_VC2_SHFT 17 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_DATABUFF_VC2_MASK 0x0000000000020000 + +/* SH_XNMD_ERROR_SUMMARY_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_XNMD_ERROR_SUMMARY_LUT_READ_ERROR_SHFT 18 +#define SH_XNMD_ERROR_SUMMARY_LUT_READ_ERROR_MASK 0x0000000000040000 + +/* SH_XNMD_ERROR_SUMMARY_SINGLE_BIT_ERROR0 */ +/* Description: Single Bit Error in Bits 63:0 */ +#define SH_XNMD_ERROR_SUMMARY_SINGLE_BIT_ERROR0_SHFT 19 +#define SH_XNMD_ERROR_SUMMARY_SINGLE_BIT_ERROR0_MASK 0x0000000000080000 + +/* SH_XNMD_ERROR_SUMMARY_SINGLE_BIT_ERROR1 */ +/* Description: Single Bit Error in Bits 127:64 */ +#define SH_XNMD_ERROR_SUMMARY_SINGLE_BIT_ERROR1_SHFT 20 +#define SH_XNMD_ERROR_SUMMARY_SINGLE_BIT_ERROR1_MASK 0x0000000000100000 + +/* SH_XNMD_ERROR_SUMMARY_SINGLE_BIT_ERROR2 */ +/* Description: Single Bit Error in Bits 191:128 */ +#define SH_XNMD_ERROR_SUMMARY_SINGLE_BIT_ERROR2_SHFT 21 +#define SH_XNMD_ERROR_SUMMARY_SINGLE_BIT_ERROR2_MASK 0x0000000000200000 + +/* SH_XNMD_ERROR_SUMMARY_SINGLE_BIT_ERROR3 */ +/* Description: Single Bit Error in Bits 255:192 */ +#define SH_XNMD_ERROR_SUMMARY_SINGLE_BIT_ERROR3_SHFT 22 +#define SH_XNMD_ERROR_SUMMARY_SINGLE_BIT_ERROR3_MASK 0x0000000000400000 + +/* SH_XNMD_ERROR_SUMMARY_UNCOR_ERROR0 */ +/* Description: Uncorrectable Error in Bits 63:0 */ +#define SH_XNMD_ERROR_SUMMARY_UNCOR_ERROR0_SHFT 23 +#define SH_XNMD_ERROR_SUMMARY_UNCOR_ERROR0_MASK 0x0000000000800000 + +/* SH_XNMD_ERROR_SUMMARY_UNCOR_ERROR1 */ +/* Description: Uncorrectable Error in Bits 127:64 */ +#define SH_XNMD_ERROR_SUMMARY_UNCOR_ERROR1_SHFT 24 +#define SH_XNMD_ERROR_SUMMARY_UNCOR_ERROR1_MASK 0x0000000001000000 + +/* SH_XNMD_ERROR_SUMMARY_UNCOR_ERROR2 */ +/* Description: Uncorrectable Error in Bits 191:128 */ +#define SH_XNMD_ERROR_SUMMARY_UNCOR_ERROR2_SHFT 25 +#define SH_XNMD_ERROR_SUMMARY_UNCOR_ERROR2_MASK 0x0000000002000000 + +/* SH_XNMD_ERROR_SUMMARY_UNCOR_ERROR3 */ +/* Description: Uncorrectable Error in Bits 255:192 */ +#define SH_XNMD_ERROR_SUMMARY_UNCOR_ERROR3_SHFT 26 +#define SH_XNMD_ERROR_SUMMARY_UNCOR_ERROR3_MASK 0x0000000004000000 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_SIC_CNTR0_SHFT 27 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_SIC_CNTR0_MASK 0x0000000008000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_SIC_CNTR0_SHFT 28 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_SIC_CNTR0_MASK 0x0000000010000000 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_SIC_CNTR2_SHFT 29 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_SIC_CNTR2_MASK 0x0000000020000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_SIC_CNTR2_SHFT 30 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_SIC_CNTR2_MASK 0x0000000040000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT0 */ +/* Description: NI0 Debit 0 Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT0_SHFT 31 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT0_MASK 0x0000000080000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT2 */ +/* Description: NI0 Debit 2 Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT2_SHFT 32 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_DEBIT2_MASK 0x0000000100000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT0 */ +/* Description: NI1 Debit 0 Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT0_SHFT 33 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT0_MASK 0x0000000200000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT2 */ +/* Description: NI1 Debit 2 Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT2_SHFT 34 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_DEBIT2_MASK 0x0000000400000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT0 */ +/* Description: IILB Debit 0 Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT0_SHFT 35 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT0_MASK 0x0000000800000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT2 */ +/* Description: IILB Debit 2 Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT2_SHFT 36 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_DEBIT2_MASK 0x0000001000000000 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_CREDIT_SHFT 37 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI0_VC0_CREDIT_MASK 0x0000002000000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_VC0_CREDIT_SHFT 38 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_VC0_CREDIT_MASK 0x0000004000000000 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_CREDIT_SHFT 39 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI0_VC2_CREDIT_MASK 0x0000008000000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_VC2_CREDIT_SHFT 40 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI0_VC2_CREDIT_MASK 0x0000010000000000 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_CREDIT_SHFT 41 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI1_VC0_CREDIT_MASK 0x0000020000000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_VC0_CREDIT_SHFT 42 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_VC0_CREDIT_MASK 0x0000040000000000 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_CREDIT_SHFT 43 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_NI1_VC2_CREDIT_MASK 0x0000080000000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_VC2_CREDIT_SHFT 44 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_NI1_VC2_CREDIT_MASK 0x0000100000000000 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_CREDIT_SHFT 45 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_IILB_VC0_CREDIT_MASK 0x0000200000000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_VC0_CREDIT_SHFT 46 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_XNMD_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Underflow */ +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_CREDIT_SHFT 47 +#define SH_XNMD_ERROR_SUMMARY_UNDERFLOW_IILB_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_VC2_CREDIT_SHFT 48 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_IILB_VC2_CREDIT_MASK 0x0001000000000000 + +/* SH_XNMD_ERROR_SUMMARY_OVERFLOW_HEADER_CANCEL_FIFO */ +/* Description: Header Cancel Fifo Overflow */ +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_HEADER_CANCEL_FIFO_SHFT 49 +#define SH_XNMD_ERROR_SUMMARY_OVERFLOW_HEADER_CANCEL_FIFO_MASK 0x0002000000000000 + +/* ==================================================================== */ +/* Register "SH_XNMD_ERRORS_ALIAS" */ +/* ==================================================================== */ + +#define SH_XNMD_ERRORS_ALIAS 0x0000000150040408 + +/* ==================================================================== */ +/* Register "SH_XNMD_ERROR_OVERFLOW" */ +/* ==================================================================== */ + +#define SH_XNMD_ERROR_OVERFLOW 0x0000000150040420 +#define SH_XNMD_ERROR_OVERFLOW_MASK 0x0003ffffffffffff +#define SH_XNMD_ERROR_OVERFLOW_INIT 0x0003ffffffffffff + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_SHFT 0 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_MASK 0x0000000000000001 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_SHFT 1 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_MASK 0x0000000000000002 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_SHFT 2 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_MASK 0x0000000000000004 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_SHFT 3 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_MASK 0x0000000000000008 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_SHFT 4 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_MASK 0x0000000000000010 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_SHFT 5 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_MASK 0x0000000000000020 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_SHFT 6 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_MASK 0x0000000000000040 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_SHFT 7 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_MASK 0x0000000000000080 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_SHFT 8 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_MASK 0x0000000000000100 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_SHFT 9 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_MASK 0x0000000000000200 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_SHFT 10 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_MASK 0x0000000000000400 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_SHFT 11 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_MASK 0x0000000000000800 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_VC0_CREDIT_SHFT 12 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_VC0_CREDIT_SHFT 13 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_VC0_CREDIT_MASK 0x0000000000002000 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_VC2_CREDIT_SHFT 14 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_VC2_CREDIT_MASK 0x0000000000004000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_VC2_CREDIT_SHFT 15 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_DATABUFF_VC0 */ +/* Description: VC0 Data Buffer overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_DATABUFF_VC0_SHFT 16 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_DATABUFF_VC0_MASK 0x0000000000010000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_DATABUFF_VC2 */ +/* Description: VC2 Data Buffer overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_DATABUFF_VC2_SHFT 17 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_DATABUFF_VC2_MASK 0x0000000000020000 + +/* SH_XNMD_ERROR_OVERFLOW_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_XNMD_ERROR_OVERFLOW_LUT_READ_ERROR_SHFT 18 +#define SH_XNMD_ERROR_OVERFLOW_LUT_READ_ERROR_MASK 0x0000000000040000 + +/* SH_XNMD_ERROR_OVERFLOW_SINGLE_BIT_ERROR0 */ +/* Description: Single Bit Error in Bits 63:0 */ +#define SH_XNMD_ERROR_OVERFLOW_SINGLE_BIT_ERROR0_SHFT 19 +#define SH_XNMD_ERROR_OVERFLOW_SINGLE_BIT_ERROR0_MASK 0x0000000000080000 + +/* SH_XNMD_ERROR_OVERFLOW_SINGLE_BIT_ERROR1 */ +/* Description: Single Bit Error in Bits 127:64 */ +#define SH_XNMD_ERROR_OVERFLOW_SINGLE_BIT_ERROR1_SHFT 20 +#define SH_XNMD_ERROR_OVERFLOW_SINGLE_BIT_ERROR1_MASK 0x0000000000100000 + +/* SH_XNMD_ERROR_OVERFLOW_SINGLE_BIT_ERROR2 */ +/* Description: Single Bit Error in Bits 191:128 */ +#define SH_XNMD_ERROR_OVERFLOW_SINGLE_BIT_ERROR2_SHFT 21 +#define SH_XNMD_ERROR_OVERFLOW_SINGLE_BIT_ERROR2_MASK 0x0000000000200000 + +/* SH_XNMD_ERROR_OVERFLOW_SINGLE_BIT_ERROR3 */ +/* Description: Single Bit Error in Bits 255:192 */ +#define SH_XNMD_ERROR_OVERFLOW_SINGLE_BIT_ERROR3_SHFT 22 +#define SH_XNMD_ERROR_OVERFLOW_SINGLE_BIT_ERROR3_MASK 0x0000000000400000 + +/* SH_XNMD_ERROR_OVERFLOW_UNCOR_ERROR0 */ +/* Description: Uncorrectable Error in Bits 63:0 */ +#define SH_XNMD_ERROR_OVERFLOW_UNCOR_ERROR0_SHFT 23 +#define SH_XNMD_ERROR_OVERFLOW_UNCOR_ERROR0_MASK 0x0000000000800000 + +/* SH_XNMD_ERROR_OVERFLOW_UNCOR_ERROR1 */ +/* Description: Uncorrectable Error in Bits 127:64 */ +#define SH_XNMD_ERROR_OVERFLOW_UNCOR_ERROR1_SHFT 24 +#define SH_XNMD_ERROR_OVERFLOW_UNCOR_ERROR1_MASK 0x0000000001000000 + +/* SH_XNMD_ERROR_OVERFLOW_UNCOR_ERROR2 */ +/* Description: Uncorrectable Error in Bits 191:128 */ +#define SH_XNMD_ERROR_OVERFLOW_UNCOR_ERROR2_SHFT 25 +#define SH_XNMD_ERROR_OVERFLOW_UNCOR_ERROR2_MASK 0x0000000002000000 + +/* SH_XNMD_ERROR_OVERFLOW_UNCOR_ERROR3 */ +/* Description: Uncorrectable Error in Bits 255:192 */ +#define SH_XNMD_ERROR_OVERFLOW_UNCOR_ERROR3_SHFT 26 +#define SH_XNMD_ERROR_OVERFLOW_UNCOR_ERROR3_MASK 0x0000000004000000 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_SIC_CNTR0_SHFT 27 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_SIC_CNTR0_MASK 0x0000000008000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_SIC_CNTR0_SHFT 28 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_SIC_CNTR0_MASK 0x0000000010000000 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_SIC_CNTR2_SHFT 29 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_SIC_CNTR2_MASK 0x0000000020000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_SIC_CNTR2_SHFT 30 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_SIC_CNTR2_MASK 0x0000000040000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT0 */ +/* Description: NI0 Debit 0 Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT0_SHFT 31 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT0_MASK 0x0000000080000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT2 */ +/* Description: NI0 Debit 2 Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT2_SHFT 32 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_DEBIT2_MASK 0x0000000100000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT0 */ +/* Description: NI1 Debit 0 Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT0_SHFT 33 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT0_MASK 0x0000000200000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT2 */ +/* Description: NI1 Debit 2 Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT2_SHFT 34 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_DEBIT2_MASK 0x0000000400000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT0 */ +/* Description: IILB Debit 0 Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT0_SHFT 35 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT0_MASK 0x0000000800000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT2 */ +/* Description: IILB Debit 2 Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT2_SHFT 36 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_DEBIT2_MASK 0x0000001000000000 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_CREDIT_SHFT 37 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI0_VC0_CREDIT_MASK 0x0000002000000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_CREDIT_SHFT 38 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_VC0_CREDIT_MASK 0x0000004000000000 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_CREDIT_SHFT 39 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI0_VC2_CREDIT_MASK 0x0000008000000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_CREDIT_SHFT 40 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI0_VC2_CREDIT_MASK 0x0000010000000000 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_CREDIT_SHFT 41 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI1_VC0_CREDIT_MASK 0x0000020000000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_CREDIT_SHFT 42 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_VC0_CREDIT_MASK 0x0000040000000000 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_CREDIT_SHFT 43 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_NI1_VC2_CREDIT_MASK 0x0000080000000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_CREDIT_SHFT 44 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_NI1_VC2_CREDIT_MASK 0x0000100000000000 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_CREDIT_SHFT 45 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_IILB_VC0_CREDIT_MASK 0x0000200000000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_CREDIT_SHFT 46 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Underflow */ +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_CREDIT_SHFT 47 +#define SH_XNMD_ERROR_OVERFLOW_UNDERFLOW_IILB_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_CREDIT_SHFT 48 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_IILB_VC2_CREDIT_MASK 0x0001000000000000 + +/* SH_XNMD_ERROR_OVERFLOW_OVERFLOW_HEADER_CANCEL_FIFO */ +/* Description: Header Cancel Fifo Overflow */ +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_HEADER_CANCEL_FIFO_SHFT 49 +#define SH_XNMD_ERROR_OVERFLOW_OVERFLOW_HEADER_CANCEL_FIFO_MASK 0x0002000000000000 + +/* ==================================================================== */ +/* Register "SH_XNMD_ERROR_OVERFLOW_ALIAS" */ +/* ==================================================================== */ + +#define SH_XNMD_ERROR_OVERFLOW_ALIAS 0x0000000150040428 + +/* ==================================================================== */ +/* Register "SH_XNMD_ERROR_MASK" */ +/* ==================================================================== */ + +#define SH_XNMD_ERROR_MASK 0x0000000150040440 +#define SH_XNMD_ERROR_MASK_MASK 0x0003ffffffffffff +#define SH_XNMD_ERROR_MASK_INIT 0x0003ffffffffffff + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI0_VC0_SHFT 0 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI0_VC0_MASK 0x0000000000000001 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI0_VC0_SHFT 1 +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI0_VC0_MASK 0x0000000000000002 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI0_VC2_SHFT 2 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI0_VC2_MASK 0x0000000000000004 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI0_VC2_SHFT 3 +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI0_VC2_MASK 0x0000000000000008 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI1_VC0_SHFT 4 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI1_VC0_MASK 0x0000000000000010 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI1_VC0_SHFT 5 +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI1_VC0_MASK 0x0000000000000020 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI1_VC2_SHFT 6 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI1_VC2_MASK 0x0000000000000040 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI1_VC2_SHFT 7 +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI1_VC2_MASK 0x0000000000000080 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_IILB_VC0_SHFT 8 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_IILB_VC0_MASK 0x0000000000000100 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_IILB_VC0_SHFT 9 +#define SH_XNMD_ERROR_MASK_OVERFLOW_IILB_VC0_MASK 0x0000000000000200 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_IILB_VC2_SHFT 10 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_IILB_VC2_MASK 0x0000000000000400 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_IILB_VC2_SHFT 11 +#define SH_XNMD_ERROR_MASK_OVERFLOW_IILB_VC2_MASK 0x0000000000000800 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_VC0_CREDIT_SHFT 12 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_VC0_CREDIT_SHFT 13 +#define SH_XNMD_ERROR_MASK_OVERFLOW_VC0_CREDIT_MASK 0x0000000000002000 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_VC2_CREDIT_SHFT 14 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_VC2_CREDIT_MASK 0x0000000000004000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_VC2_CREDIT_SHFT 15 +#define SH_XNMD_ERROR_MASK_OVERFLOW_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_DATABUFF_VC0 */ +/* Description: VC0 Data Buffer overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_DATABUFF_VC0_SHFT 16 +#define SH_XNMD_ERROR_MASK_OVERFLOW_DATABUFF_VC0_MASK 0x0000000000010000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_DATABUFF_VC2 */ +/* Description: VC2 Data Buffer overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_DATABUFF_VC2_SHFT 17 +#define SH_XNMD_ERROR_MASK_OVERFLOW_DATABUFF_VC2_MASK 0x0000000000020000 + +/* SH_XNMD_ERROR_MASK_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_XNMD_ERROR_MASK_LUT_READ_ERROR_SHFT 18 +#define SH_XNMD_ERROR_MASK_LUT_READ_ERROR_MASK 0x0000000000040000 + +/* SH_XNMD_ERROR_MASK_SINGLE_BIT_ERROR0 */ +/* Description: Single Bit Error in Bits 63:0 */ +#define SH_XNMD_ERROR_MASK_SINGLE_BIT_ERROR0_SHFT 19 +#define SH_XNMD_ERROR_MASK_SINGLE_BIT_ERROR0_MASK 0x0000000000080000 + +/* SH_XNMD_ERROR_MASK_SINGLE_BIT_ERROR1 */ +/* Description: Single Bit Error in Bits 127:64 */ +#define SH_XNMD_ERROR_MASK_SINGLE_BIT_ERROR1_SHFT 20 +#define SH_XNMD_ERROR_MASK_SINGLE_BIT_ERROR1_MASK 0x0000000000100000 + +/* SH_XNMD_ERROR_MASK_SINGLE_BIT_ERROR2 */ +/* Description: Single Bit Error in Bits 191:128 */ +#define SH_XNMD_ERROR_MASK_SINGLE_BIT_ERROR2_SHFT 21 +#define SH_XNMD_ERROR_MASK_SINGLE_BIT_ERROR2_MASK 0x0000000000200000 + +/* SH_XNMD_ERROR_MASK_SINGLE_BIT_ERROR3 */ +/* Description: Single Bit Error in Bits 255:192 */ +#define SH_XNMD_ERROR_MASK_SINGLE_BIT_ERROR3_SHFT 22 +#define SH_XNMD_ERROR_MASK_SINGLE_BIT_ERROR3_MASK 0x0000000000400000 + +/* SH_XNMD_ERROR_MASK_UNCOR_ERROR0 */ +/* Description: Uncorrectable Error in Bits 63:0 */ +#define SH_XNMD_ERROR_MASK_UNCOR_ERROR0_SHFT 23 +#define SH_XNMD_ERROR_MASK_UNCOR_ERROR0_MASK 0x0000000000800000 + +/* SH_XNMD_ERROR_MASK_UNCOR_ERROR1 */ +/* Description: Uncorrectable Error in Bits 127:64 */ +#define SH_XNMD_ERROR_MASK_UNCOR_ERROR1_SHFT 24 +#define SH_XNMD_ERROR_MASK_UNCOR_ERROR1_MASK 0x0000000001000000 + +/* SH_XNMD_ERROR_MASK_UNCOR_ERROR2 */ +/* Description: Uncorrectable Error in Bits 191:128 */ +#define SH_XNMD_ERROR_MASK_UNCOR_ERROR2_SHFT 25 +#define SH_XNMD_ERROR_MASK_UNCOR_ERROR2_MASK 0x0000000002000000 + +/* SH_XNMD_ERROR_MASK_UNCOR_ERROR3 */ +/* Description: Uncorrectable Error in Bits 255:192 */ +#define SH_XNMD_ERROR_MASK_UNCOR_ERROR3_SHFT 26 +#define SH_XNMD_ERROR_MASK_UNCOR_ERROR3_MASK 0x0000000004000000 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_SIC_CNTR0_SHFT 27 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_SIC_CNTR0_MASK 0x0000000008000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_SIC_CNTR0_SHFT 28 +#define SH_XNMD_ERROR_MASK_OVERFLOW_SIC_CNTR0_MASK 0x0000000010000000 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_SIC_CNTR2_SHFT 29 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_SIC_CNTR2_MASK 0x0000000020000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_SIC_CNTR2_SHFT 30 +#define SH_XNMD_ERROR_MASK_OVERFLOW_SIC_CNTR2_MASK 0x0000000040000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_NI0_DEBIT0 */ +/* Description: NI0 Debit 0 Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI0_DEBIT0_SHFT 31 +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI0_DEBIT0_MASK 0x0000000080000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_NI0_DEBIT2 */ +/* Description: NI0 Debit 2 Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI0_DEBIT2_SHFT 32 +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI0_DEBIT2_MASK 0x0000000100000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_NI1_DEBIT0 */ +/* Description: NI1 Debit 0 Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI1_DEBIT0_SHFT 33 +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI1_DEBIT0_MASK 0x0000000200000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_NI1_DEBIT2 */ +/* Description: NI1 Debit 2 Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI1_DEBIT2_SHFT 34 +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI1_DEBIT2_MASK 0x0000000400000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_IILB_DEBIT0 */ +/* Description: IILB Debit 0 Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_IILB_DEBIT0_SHFT 35 +#define SH_XNMD_ERROR_MASK_OVERFLOW_IILB_DEBIT0_MASK 0x0000000800000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_IILB_DEBIT2 */ +/* Description: IILB Debit 2 Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_IILB_DEBIT2_SHFT 36 +#define SH_XNMD_ERROR_MASK_OVERFLOW_IILB_DEBIT2_MASK 0x0000001000000000 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI0_VC0_CREDIT_SHFT 37 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI0_VC0_CREDIT_MASK 0x0000002000000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI0_VC0_CREDIT_SHFT 38 +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI0_VC0_CREDIT_MASK 0x0000004000000000 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI0_VC2_CREDIT_SHFT 39 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI0_VC2_CREDIT_MASK 0x0000008000000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI0_VC2_CREDIT_SHFT 40 +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI0_VC2_CREDIT_MASK 0x0000010000000000 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI1_VC0_CREDIT_SHFT 41 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI1_VC0_CREDIT_MASK 0x0000020000000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI1_VC0_CREDIT_SHFT 42 +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI1_VC0_CREDIT_MASK 0x0000040000000000 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI1_VC2_CREDIT_SHFT 43 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_NI1_VC2_CREDIT_MASK 0x0000080000000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI1_VC2_CREDIT_SHFT 44 +#define SH_XNMD_ERROR_MASK_OVERFLOW_NI1_VC2_CREDIT_MASK 0x0000100000000000 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_IILB_VC0_CREDIT_SHFT 45 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_IILB_VC0_CREDIT_MASK 0x0000200000000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_IILB_VC0_CREDIT_SHFT 46 +#define SH_XNMD_ERROR_MASK_OVERFLOW_IILB_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_XNMD_ERROR_MASK_UNDERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Underflow */ +#define SH_XNMD_ERROR_MASK_UNDERFLOW_IILB_VC2_CREDIT_SHFT 47 +#define SH_XNMD_ERROR_MASK_UNDERFLOW_IILB_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_IILB_VC2_CREDIT_SHFT 48 +#define SH_XNMD_ERROR_MASK_OVERFLOW_IILB_VC2_CREDIT_MASK 0x0001000000000000 + +/* SH_XNMD_ERROR_MASK_OVERFLOW_HEADER_CANCEL_FIFO */ +/* Description: Header Cancel Fifo Overflow */ +#define SH_XNMD_ERROR_MASK_OVERFLOW_HEADER_CANCEL_FIFO_SHFT 49 +#define SH_XNMD_ERROR_MASK_OVERFLOW_HEADER_CANCEL_FIFO_MASK 0x0002000000000000 + +/* ==================================================================== */ +/* Register "SH_XNMD_FIRST_ERROR" */ +/* ==================================================================== */ + +#define SH_XNMD_FIRST_ERROR 0x0000000150040460 +#define SH_XNMD_FIRST_ERROR_MASK 0x0003ffffffffffff +#define SH_XNMD_FIRST_ERROR_INIT 0x0003ffffffffffff + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI0_VC0_SHFT 0 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI0_VC0_MASK 0x0000000000000001 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_VC0 */ +/* Description: NI0 VC0 fifo overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_VC0_SHFT 1 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_VC0_MASK 0x0000000000000002 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI0_VC2_SHFT 2 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI0_VC2_MASK 0x0000000000000004 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_VC2 */ +/* Description: NI0 VC2 fifo overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_VC2_SHFT 3 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_VC2_MASK 0x0000000000000008 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI1_VC0_SHFT 4 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI1_VC0_MASK 0x0000000000000010 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_VC0 */ +/* Description: NI1 VC0 fifo overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_VC0_SHFT 5 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_VC0_MASK 0x0000000000000020 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI1_VC2_SHFT 6 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI1_VC2_MASK 0x0000000000000040 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_VC2 */ +/* Description: NI1 VC2 fifo overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_VC2_SHFT 7 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_VC2_MASK 0x0000000000000080 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_IILB_VC0_SHFT 8 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_IILB_VC0_MASK 0x0000000000000100 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_VC0 */ +/* Description: IILB VC0 fifo overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_VC0_SHFT 9 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_VC0_MASK 0x0000000000000200 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_IILB_VC2_SHFT 10 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_IILB_VC2_MASK 0x0000000000000400 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_VC2 */ +/* Description: IILB VC2 fifo overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_VC2_SHFT 11 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_VC2_MASK 0x0000000000000800 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_VC0_CREDIT_SHFT 12 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_VC0_CREDIT_MASK 0x0000000000001000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_VC0_CREDIT */ +/* Description: VC0 Credit overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_VC0_CREDIT_SHFT 13 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_VC0_CREDIT_MASK 0x0000000000002000 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_VC2_CREDIT_SHFT 14 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_VC2_CREDIT_MASK 0x0000000000004000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_VC2_CREDIT */ +/* Description: VC2 Credit overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_VC2_CREDIT_SHFT 15 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_VC2_CREDIT_MASK 0x0000000000008000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_DATABUFF_VC0 */ +/* Description: VC0 Data Buffer overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_DATABUFF_VC0_SHFT 16 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_DATABUFF_VC0_MASK 0x0000000000010000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_DATABUFF_VC2 */ +/* Description: VC2 Data Buffer overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_DATABUFF_VC2_SHFT 17 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_DATABUFF_VC2_MASK 0x0000000000020000 + +/* SH_XNMD_FIRST_ERROR_LUT_READ_ERROR */ +/* Description: LUT Read Error */ +#define SH_XNMD_FIRST_ERROR_LUT_READ_ERROR_SHFT 18 +#define SH_XNMD_FIRST_ERROR_LUT_READ_ERROR_MASK 0x0000000000040000 + +/* SH_XNMD_FIRST_ERROR_SINGLE_BIT_ERROR0 */ +/* Description: Single Bit Error in Bits 63:0 */ +#define SH_XNMD_FIRST_ERROR_SINGLE_BIT_ERROR0_SHFT 19 +#define SH_XNMD_FIRST_ERROR_SINGLE_BIT_ERROR0_MASK 0x0000000000080000 + +/* SH_XNMD_FIRST_ERROR_SINGLE_BIT_ERROR1 */ +/* Description: Single Bit Error in Bits 127:64 */ +#define SH_XNMD_FIRST_ERROR_SINGLE_BIT_ERROR1_SHFT 20 +#define SH_XNMD_FIRST_ERROR_SINGLE_BIT_ERROR1_MASK 0x0000000000100000 + +/* SH_XNMD_FIRST_ERROR_SINGLE_BIT_ERROR2 */ +/* Description: Single Bit Error in Bits 191:128 */ +#define SH_XNMD_FIRST_ERROR_SINGLE_BIT_ERROR2_SHFT 21 +#define SH_XNMD_FIRST_ERROR_SINGLE_BIT_ERROR2_MASK 0x0000000000200000 + +/* SH_XNMD_FIRST_ERROR_SINGLE_BIT_ERROR3 */ +/* Description: Single Bit Error in Bits 255:192 */ +#define SH_XNMD_FIRST_ERROR_SINGLE_BIT_ERROR3_SHFT 22 +#define SH_XNMD_FIRST_ERROR_SINGLE_BIT_ERROR3_MASK 0x0000000000400000 + +/* SH_XNMD_FIRST_ERROR_UNCOR_ERROR0 */ +/* Description: Uncorrectable Error in Bits 63:0 */ +#define SH_XNMD_FIRST_ERROR_UNCOR_ERROR0_SHFT 23 +#define SH_XNMD_FIRST_ERROR_UNCOR_ERROR0_MASK 0x0000000000800000 + +/* SH_XNMD_FIRST_ERROR_UNCOR_ERROR1 */ +/* Description: Uncorrectable Error in Bits 127:64 */ +#define SH_XNMD_FIRST_ERROR_UNCOR_ERROR1_SHFT 24 +#define SH_XNMD_FIRST_ERROR_UNCOR_ERROR1_MASK 0x0000000001000000 + +/* SH_XNMD_FIRST_ERROR_UNCOR_ERROR2 */ +/* Description: Uncorrectable Error in Bits 191:128 */ +#define SH_XNMD_FIRST_ERROR_UNCOR_ERROR2_SHFT 25 +#define SH_XNMD_FIRST_ERROR_UNCOR_ERROR2_MASK 0x0000000002000000 + +/* SH_XNMD_FIRST_ERROR_UNCOR_ERROR3 */ +/* Description: Uncorrectable Error in Bits 255:192 */ +#define SH_XNMD_FIRST_ERROR_UNCOR_ERROR3_SHFT 26 +#define SH_XNMD_FIRST_ERROR_UNCOR_ERROR3_MASK 0x0000000004000000 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_SIC_CNTR0_SHFT 27 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_SIC_CNTR0_MASK 0x0000000008000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_SIC_CNTR0 */ +/* Description: SIC Counter 0 Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_SIC_CNTR0_SHFT 28 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_SIC_CNTR0_MASK 0x0000000010000000 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_SIC_CNTR2_SHFT 29 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_SIC_CNTR2_MASK 0x0000000020000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_SIC_CNTR2 */ +/* Description: SIC Counter 2 Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_SIC_CNTR2_SHFT 30 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_SIC_CNTR2_MASK 0x0000000040000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_DEBIT0 */ +/* Description: NI0 Debit 0 Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_DEBIT0_SHFT 31 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_DEBIT0_MASK 0x0000000080000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_DEBIT2 */ +/* Description: NI0 Debit 2 Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_DEBIT2_SHFT 32 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_DEBIT2_MASK 0x0000000100000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_DEBIT0 */ +/* Description: NI1 Debit 0 Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_DEBIT0_SHFT 33 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_DEBIT0_MASK 0x0000000200000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_DEBIT2 */ +/* Description: NI1 Debit 2 Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_DEBIT2_SHFT 34 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_DEBIT2_MASK 0x0000000400000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_DEBIT0 */ +/* Description: IILB Debit 0 Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_DEBIT0_SHFT 35 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_DEBIT0_MASK 0x0000000800000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_DEBIT2 */ +/* Description: IILB Debit 2 Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_DEBIT2_SHFT 36 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_DEBIT2_MASK 0x0000001000000000 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI0_VC0_CREDIT_SHFT 37 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI0_VC0_CREDIT_MASK 0x0000002000000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_VC0_CREDIT */ +/* Description: NI0 VC0 Credit Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_VC0_CREDIT_SHFT 38 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_VC0_CREDIT_MASK 0x0000004000000000 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI0_VC2_CREDIT_SHFT 39 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI0_VC2_CREDIT_MASK 0x0000008000000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_VC2_CREDIT */ +/* Description: NI0 VC2 Credit Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_VC2_CREDIT_SHFT 40 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI0_VC2_CREDIT_MASK 0x0000010000000000 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI1_VC0_CREDIT_SHFT 41 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI1_VC0_CREDIT_MASK 0x0000020000000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_VC0_CREDIT */ +/* Description: NI1 VC0 Credit Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_VC0_CREDIT_SHFT 42 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_VC0_CREDIT_MASK 0x0000040000000000 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI1_VC2_CREDIT_SHFT 43 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_NI1_VC2_CREDIT_MASK 0x0000080000000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_VC2_CREDIT */ +/* Description: NI1 VC2 Credit Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_VC2_CREDIT_SHFT 44 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_NI1_VC2_CREDIT_MASK 0x0000100000000000 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_IILB_VC0_CREDIT_SHFT 45 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_IILB_VC0_CREDIT_MASK 0x0000200000000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_VC0_CREDIT */ +/* Description: IILB VC0 Credit Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_VC0_CREDIT_SHFT 46 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_VC0_CREDIT_MASK 0x0000400000000000 + +/* SH_XNMD_FIRST_ERROR_UNDERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Underflow */ +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_IILB_VC2_CREDIT_SHFT 47 +#define SH_XNMD_FIRST_ERROR_UNDERFLOW_IILB_VC2_CREDIT_MASK 0x0000800000000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_VC2_CREDIT */ +/* Description: IILB VC2 Credit Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_VC2_CREDIT_SHFT 48 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_IILB_VC2_CREDIT_MASK 0x0001000000000000 + +/* SH_XNMD_FIRST_ERROR_OVERFLOW_HEADER_CANCEL_FIFO */ +/* Description: Header Cancel Fifo Overflow */ +#define SH_XNMD_FIRST_ERROR_OVERFLOW_HEADER_CANCEL_FIFO_SHFT 49 +#define SH_XNMD_FIRST_ERROR_OVERFLOW_HEADER_CANCEL_FIFO_MASK 0x0002000000000000 + +/* ==================================================================== */ +/* Register "SH_AUTO_REPLY_ENABLE0" */ +/* Automatic Maintenance Reply Enable 0 */ +/* ==================================================================== */ + +#define SH_AUTO_REPLY_ENABLE0 0x0000000110061000 +#define SH_AUTO_REPLY_ENABLE0_MASK 0xffffffffffffffff +#define SH_AUTO_REPLY_ENABLE0_INIT 0x0000000000000000 + +/* SH_AUTO_REPLY_ENABLE0_ENABLE0 */ +/* Description: Enable 0 */ +#define SH_AUTO_REPLY_ENABLE0_ENABLE0_SHFT 0 +#define SH_AUTO_REPLY_ENABLE0_ENABLE0_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_AUTO_REPLY_ENABLE1" */ +/* Automatic Maintenance Reply Enable 1 */ +/* ==================================================================== */ + +#define SH_AUTO_REPLY_ENABLE1 0x0000000110061080 +#define SH_AUTO_REPLY_ENABLE1_MASK 0xffffffffffffffff +#define SH_AUTO_REPLY_ENABLE1_INIT 0x0000000000000000 + +/* SH_AUTO_REPLY_ENABLE1_ENABLE1 */ +/* Description: Enable 1 */ +#define SH_AUTO_REPLY_ENABLE1_ENABLE1_SHFT 0 +#define SH_AUTO_REPLY_ENABLE1_ENABLE1_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_AUTO_REPLY_HEADER0" */ +/* Automatic Maintenance Reply Header 0 */ +/* ==================================================================== */ + +#define SH_AUTO_REPLY_HEADER0 0x0000000110061100 +#define SH_AUTO_REPLY_HEADER0_MASK 0xffffffffffffffff +#define SH_AUTO_REPLY_HEADER0_INIT 0x0000000000000000 + +/* SH_AUTO_REPLY_HEADER0_HEADER0 */ +/* Description: Header 0 */ +#define SH_AUTO_REPLY_HEADER0_HEADER0_SHFT 0 +#define SH_AUTO_REPLY_HEADER0_HEADER0_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_AUTO_REPLY_HEADER1" */ +/* Automatic Maintenance Reply Header 1 */ +/* ==================================================================== */ + +#define SH_AUTO_REPLY_HEADER1 0x0000000110061180 +#define SH_AUTO_REPLY_HEADER1_MASK 0xffffffffffffffff +#define SH_AUTO_REPLY_HEADER1_INIT 0x0000000000000000 + +/* SH_AUTO_REPLY_HEADER1_HEADER1 */ +/* Description: Header 1 */ +#define SH_AUTO_REPLY_HEADER1_HEADER1_SHFT 0 +#define SH_AUTO_REPLY_HEADER1_HEADER1_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_ENABLE_RP_AUTO_REPLY" */ +/* Enable Automatic Maintenance Reply From Reply Queue */ +/* ==================================================================== */ + +#define SH_ENABLE_RP_AUTO_REPLY 0x0000000110061200 +#define SH_ENABLE_RP_AUTO_REPLY_MASK 0x0000000000000001 +#define SH_ENABLE_RP_AUTO_REPLY_INIT 0x0000000000000000 + +/* SH_ENABLE_RP_AUTO_REPLY_ENABLE */ +/* Description: Enable Reply Auto Reply */ +#define SH_ENABLE_RP_AUTO_REPLY_ENABLE_SHFT 0 +#define SH_ENABLE_RP_AUTO_REPLY_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_ENABLE_RQ_AUTO_REPLY" */ +/* Enable Automatic Maintenance Reply From Request Queue */ +/* ==================================================================== */ + +#define SH_ENABLE_RQ_AUTO_REPLY 0x0000000110061280 +#define SH_ENABLE_RQ_AUTO_REPLY_MASK 0x0000000000000001 +#define SH_ENABLE_RQ_AUTO_REPLY_INIT 0x0000000000000000 + +/* SH_ENABLE_RQ_AUTO_REPLY_ENABLE */ +/* Description: Enable Request Auto Reply */ +#define SH_ENABLE_RQ_AUTO_REPLY_ENABLE_SHFT 0 +#define SH_ENABLE_RQ_AUTO_REPLY_ENABLE_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_REDIRECT_INVAL" */ +/* Redirect invalidate to LB instead of PI */ +/* ==================================================================== */ + +#define SH_REDIRECT_INVAL 0x0000000110061300 +#define SH_REDIRECT_INVAL_MASK 0x0000000000000001 +#define SH_REDIRECT_INVAL_INIT 0x0000000000000000 + +/* SH_REDIRECT_INVAL_REDIRECT */ +/* Description: Redirect invalidates to LB instead of PI */ +#define SH_REDIRECT_INVAL_REDIRECT_SHFT 0 +#define SH_REDIRECT_INVAL_REDIRECT_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_CNTRL" */ +/* Diagnostic Message Control Register */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_CNTRL 0x0000000110062000 +#define SH_DIAG_MSG_CNTRL_MASK 0xc000000000003fff +#define SH_DIAG_MSG_CNTRL_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_CNTRL_MSG_LENGTH */ +/* Description: Message data payload length, 0 - 63 */ +#define SH_DIAG_MSG_CNTRL_MSG_LENGTH_SHFT 0 +#define SH_DIAG_MSG_CNTRL_MSG_LENGTH_MASK 0x000000000000003f + +/* SH_DIAG_MSG_CNTRL_ERROR_INJECT_POINT */ +/* Description: Point message that the error bit would be activated */ +#define SH_DIAG_MSG_CNTRL_ERROR_INJECT_POINT_SHFT 6 +#define SH_DIAG_MSG_CNTRL_ERROR_INJECT_POINT_MASK 0x0000000000000fc0 + +/* SH_DIAG_MSG_CNTRL_ERROR_INJECT_ENABLE */ +/* Description: Enable ERROR_INJECT_POINT field */ +#define SH_DIAG_MSG_CNTRL_ERROR_INJECT_ENABLE_SHFT 12 +#define SH_DIAG_MSG_CNTRL_ERROR_INJECT_ENABLE_MASK 0x0000000000001000 + +/* SH_DIAG_MSG_CNTRL_PORT */ +/* Description: 0 = request port, 1 = reply port */ +#define SH_DIAG_MSG_CNTRL_PORT_SHFT 13 +#define SH_DIAG_MSG_CNTRL_PORT_MASK 0x0000000000002000 + +/* SH_DIAG_MSG_CNTRL_START */ +/* Description: Start */ +#define SH_DIAG_MSG_CNTRL_START_SHFT 62 +#define SH_DIAG_MSG_CNTRL_START_MASK 0x4000000000000000 + +/* SH_DIAG_MSG_CNTRL_BUSY */ +/* Description: Busy */ +#define SH_DIAG_MSG_CNTRL_BUSY_SHFT 63 +#define SH_DIAG_MSG_CNTRL_BUSY_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA0L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA0L 0x0000000110062080 +#define SH_DIAG_MSG_DATA0L_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA0L_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA0L_DATA_LOWER */ +/* Description: Lower 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA0L_DATA_LOWER_SHFT 0 +#define SH_DIAG_MSG_DATA0L_DATA_LOWER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA0U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA0U 0x0000000110062100 +#define SH_DIAG_MSG_DATA0U_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA0U_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA0U_DATA_UPPER */ +/* Description: Upper 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA0U_DATA_UPPER_SHFT 0 +#define SH_DIAG_MSG_DATA0U_DATA_UPPER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA1L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA1L 0x0000000110062180 +#define SH_DIAG_MSG_DATA1L_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA1L_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA1L_DATA_LOWER */ +/* Description: Lower 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA1L_DATA_LOWER_SHFT 0 +#define SH_DIAG_MSG_DATA1L_DATA_LOWER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA1U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA1U 0x0000000110062200 +#define SH_DIAG_MSG_DATA1U_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA1U_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA1U_DATA_UPPER */ +/* Description: Upper 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA1U_DATA_UPPER_SHFT 0 +#define SH_DIAG_MSG_DATA1U_DATA_UPPER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA2L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA2L 0x0000000110062280 +#define SH_DIAG_MSG_DATA2L_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA2L_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA2L_DATA_LOWER */ +/* Description: Lower 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA2L_DATA_LOWER_SHFT 0 +#define SH_DIAG_MSG_DATA2L_DATA_LOWER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA2U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA2U 0x0000000110062300 +#define SH_DIAG_MSG_DATA2U_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA2U_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA2U_DATA_UPPER */ +/* Description: Upper 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA2U_DATA_UPPER_SHFT 0 +#define SH_DIAG_MSG_DATA2U_DATA_UPPER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA3L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA3L 0x0000000110062380 +#define SH_DIAG_MSG_DATA3L_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA3L_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA3L_DATA_LOWER */ +/* Description: Lower 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA3L_DATA_LOWER_SHFT 0 +#define SH_DIAG_MSG_DATA3L_DATA_LOWER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA3U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA3U 0x0000000110062400 +#define SH_DIAG_MSG_DATA3U_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA3U_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA3U_DATA_UPPER */ +/* Description: Upper 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA3U_DATA_UPPER_SHFT 0 +#define SH_DIAG_MSG_DATA3U_DATA_UPPER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA4L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA4L 0x0000000110062480 +#define SH_DIAG_MSG_DATA4L_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA4L_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA4L_DATA_LOWER */ +/* Description: Lower 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA4L_DATA_LOWER_SHFT 0 +#define SH_DIAG_MSG_DATA4L_DATA_LOWER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA4U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA4U 0x0000000110062500 +#define SH_DIAG_MSG_DATA4U_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA4U_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA4U_DATA_UPPER */ +/* Description: Upper 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA4U_DATA_UPPER_SHFT 0 +#define SH_DIAG_MSG_DATA4U_DATA_UPPER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA5L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA5L 0x0000000110062580 +#define SH_DIAG_MSG_DATA5L_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA5L_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA5L_DATA_LOWER */ +/* Description: Lower 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA5L_DATA_LOWER_SHFT 0 +#define SH_DIAG_MSG_DATA5L_DATA_LOWER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA5U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA5U 0x0000000110062600 +#define SH_DIAG_MSG_DATA5U_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA5U_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA5U_DATA_UPPER */ +/* Description: Upper 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA5U_DATA_UPPER_SHFT 0 +#define SH_DIAG_MSG_DATA5U_DATA_UPPER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA6L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA6L 0x0000000110062680 +#define SH_DIAG_MSG_DATA6L_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA6L_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA6L_DATA_LOWER */ +/* Description: Lower 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA6L_DATA_LOWER_SHFT 0 +#define SH_DIAG_MSG_DATA6L_DATA_LOWER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA6U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA6U 0x0000000110062700 +#define SH_DIAG_MSG_DATA6U_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA6U_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA6U_DATA_UPPER */ +/* Description: Upper 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA6U_DATA_UPPER_SHFT 0 +#define SH_DIAG_MSG_DATA6U_DATA_UPPER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA7L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA7L 0x0000000110062780 +#define SH_DIAG_MSG_DATA7L_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA7L_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA7L_DATA_LOWER */ +/* Description: Lower 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA7L_DATA_LOWER_SHFT 0 +#define SH_DIAG_MSG_DATA7L_DATA_LOWER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA7U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA7U 0x0000000110062800 +#define SH_DIAG_MSG_DATA7U_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA7U_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA7U_DATA_UPPER */ +/* Description: Upper 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA7U_DATA_UPPER_SHFT 0 +#define SH_DIAG_MSG_DATA7U_DATA_UPPER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA8L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA8L 0x0000000110062880 +#define SH_DIAG_MSG_DATA8L_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA8L_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA8L_DATA_LOWER */ +/* Description: Lower 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA8L_DATA_LOWER_SHFT 0 +#define SH_DIAG_MSG_DATA8L_DATA_LOWER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA8U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_DATA8U 0x0000000110062900 +#define SH_DIAG_MSG_DATA8U_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_DATA8U_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_DATA8U_DATA_UPPER */ +/* Description: Upper 64 bits of Diagnositic Message Data */ +#define SH_DIAG_MSG_DATA8U_DATA_UPPER_SHFT 0 +#define SH_DIAG_MSG_DATA8U_DATA_UPPER_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_HDR0" */ +/* Diagnostice Data, lower 64 bits of header */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_HDR0 0x0000000110062980 +#define SH_DIAG_MSG_HDR0_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_HDR0_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_HDR0_HEADER0 */ +/* Description: Lower 64 bits of Diagnositic Message Header */ +#define SH_DIAG_MSG_HDR0_HEADER0_SHFT 0 +#define SH_DIAG_MSG_HDR0_HEADER0_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_HDR1" */ +/* Diagnostice Data, upper 64 bits of header */ +/* ==================================================================== */ + +#define SH_DIAG_MSG_HDR1 0x0000000110062a00 +#define SH_DIAG_MSG_HDR1_MASK 0xffffffffffffffff +#define SH_DIAG_MSG_HDR1_INIT 0x0000000000000000 + +/* SH_DIAG_MSG_HDR1_HEADER1 */ +/* Description: Upper 64 bits of Diagnositic Message Header */ +#define SH_DIAG_MSG_HDR1_HEADER1_SHFT 0 +#define SH_DIAG_MSG_HDR1_HEADER1_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_DEBUG_SELECT" */ +/* SHub Debug Port Select */ +/* ==================================================================== */ + +#define SH_DEBUG_SELECT 0x0000000110063000 +#define SH_DEBUG_SELECT_MASK 0x8fffffffffffffff +#define SH_DEBUG_SELECT_INIT 0x0000e38e38e38e38 + +/* SH_DEBUG_SELECT_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble0_nibble_select */ +#define SH_DEBUG_SELECT_NIBBLE0_NIBBLE_SEL_SHFT 0 +#define SH_DEBUG_SELECT_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000007 + +/* SH_DEBUG_SELECT_NIBBLE0_CHIPLET_SEL */ +/* Description: Nibble0_chiplet_select */ +#define SH_DEBUG_SELECT_NIBBLE0_CHIPLET_SEL_SHFT 3 +#define SH_DEBUG_SELECT_NIBBLE0_CHIPLET_SEL_MASK 0x0000000000000038 + +/* SH_DEBUG_SELECT_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble1_nibble_select */ +#define SH_DEBUG_SELECT_NIBBLE1_NIBBLE_SEL_SHFT 6 +#define SH_DEBUG_SELECT_NIBBLE1_NIBBLE_SEL_MASK 0x00000000000001c0 + +/* SH_DEBUG_SELECT_NIBBLE1_CHIPLET_SEL */ +/* Description: Nibble1_chiplet_select */ +#define SH_DEBUG_SELECT_NIBBLE1_CHIPLET_SEL_SHFT 9 +#define SH_DEBUG_SELECT_NIBBLE1_CHIPLET_SEL_MASK 0x0000000000000e00 + +/* SH_DEBUG_SELECT_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble2_nibble_select */ +#define SH_DEBUG_SELECT_NIBBLE2_NIBBLE_SEL_SHFT 12 +#define SH_DEBUG_SELECT_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_DEBUG_SELECT_NIBBLE2_CHIPLET_SEL */ +/* Description: Nibble2_chiplet_select */ +#define SH_DEBUG_SELECT_NIBBLE2_CHIPLET_SEL_SHFT 15 +#define SH_DEBUG_SELECT_NIBBLE2_CHIPLET_SEL_MASK 0x0000000000038000 + +/* SH_DEBUG_SELECT_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble3_nibble_select */ +#define SH_DEBUG_SELECT_NIBBLE3_NIBBLE_SEL_SHFT 18 +#define SH_DEBUG_SELECT_NIBBLE3_NIBBLE_SEL_MASK 0x00000000001c0000 + +/* SH_DEBUG_SELECT_NIBBLE3_CHIPLET_SEL */ +/* Description: Nibble3_chiplet_select */ +#define SH_DEBUG_SELECT_NIBBLE3_CHIPLET_SEL_SHFT 21 +#define SH_DEBUG_SELECT_NIBBLE3_CHIPLET_SEL_MASK 0x0000000000e00000 + +/* SH_DEBUG_SELECT_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble4_nibble_select */ +#define SH_DEBUG_SELECT_NIBBLE4_NIBBLE_SEL_SHFT 24 +#define SH_DEBUG_SELECT_NIBBLE4_NIBBLE_SEL_MASK 0x0000000007000000 + +/* SH_DEBUG_SELECT_NIBBLE4_CHIPLET_SEL */ +/* Description: Nibble4_chiplet_select */ +#define SH_DEBUG_SELECT_NIBBLE4_CHIPLET_SEL_SHFT 27 +#define SH_DEBUG_SELECT_NIBBLE4_CHIPLET_SEL_MASK 0x0000000038000000 + +/* SH_DEBUG_SELECT_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble5_nibble_select */ +#define SH_DEBUG_SELECT_NIBBLE5_NIBBLE_SEL_SHFT 30 +#define SH_DEBUG_SELECT_NIBBLE5_NIBBLE_SEL_MASK 0x00000001c0000000 + +/* SH_DEBUG_SELECT_NIBBLE5_CHIPLET_SEL */ +/* Description: Nibble5_chiplet_select */ +#define SH_DEBUG_SELECT_NIBBLE5_CHIPLET_SEL_SHFT 33 +#define SH_DEBUG_SELECT_NIBBLE5_CHIPLET_SEL_MASK 0x0000000e00000000 + +/* SH_DEBUG_SELECT_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble6_nibble_select */ +#define SH_DEBUG_SELECT_NIBBLE6_NIBBLE_SEL_SHFT 36 +#define SH_DEBUG_SELECT_NIBBLE6_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_DEBUG_SELECT_NIBBLE6_CHIPLET_SEL */ +/* Description: Nibble6_chiplet_select */ +#define SH_DEBUG_SELECT_NIBBLE6_CHIPLET_SEL_SHFT 39 +#define SH_DEBUG_SELECT_NIBBLE6_CHIPLET_SEL_MASK 0x0000038000000000 + +/* SH_DEBUG_SELECT_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble7_nibble_select */ +#define SH_DEBUG_SELECT_NIBBLE7_NIBBLE_SEL_SHFT 42 +#define SH_DEBUG_SELECT_NIBBLE7_NIBBLE_SEL_MASK 0x00001c0000000000 + +/* SH_DEBUG_SELECT_NIBBLE7_CHIPLET_SEL */ +/* Description: Nibble7_chiplet_select */ +#define SH_DEBUG_SELECT_NIBBLE7_CHIPLET_SEL_SHFT 45 +#define SH_DEBUG_SELECT_NIBBLE7_CHIPLET_SEL_MASK 0x0000e00000000000 + +/* SH_DEBUG_SELECT_DEBUG_II_SEL */ +/* Description: Select bits to II port */ +#define SH_DEBUG_SELECT_DEBUG_II_SEL_SHFT 48 +#define SH_DEBUG_SELECT_DEBUG_II_SEL_MASK 0x0007000000000000 + +/* SH_DEBUG_SELECT_SEL_II */ +/* Description: Select II to debug port */ +#define SH_DEBUG_SELECT_SEL_II_SHFT 51 +#define SH_DEBUG_SELECT_SEL_II_MASK 0x0ff8000000000000 + +/* SH_DEBUG_SELECT_TRIGGER_ENABLE */ +/* Description: Enable trigger on bit 32 of Analyzer data */ +#define SH_DEBUG_SELECT_TRIGGER_ENABLE_SHFT 63 +#define SH_DEBUG_SELECT_TRIGGER_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_TRIGGER_COMPARE_MASK" */ +/* SHub Trigger Compare Mask */ +/* ==================================================================== */ + +#define SH_TRIGGER_COMPARE_MASK 0x0000000110063080 +#define SH_TRIGGER_COMPARE_MASK_MASK 0x00000000ffffffff +#define SH_TRIGGER_COMPARE_MASK_INIT 0x0000000000000000 + +/* SH_TRIGGER_COMPARE_MASK_MASK */ +/* Description: SHub Trigger Compare Mask */ +#define SH_TRIGGER_COMPARE_MASK_MASK_SHFT 0 +#define SH_TRIGGER_COMPARE_MASK_MASK_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_TRIGGER_COMPARE_PATTERN" */ +/* SHub Trigger Compare Pattern */ +/* ==================================================================== */ + +#define SH_TRIGGER_COMPARE_PATTERN 0x0000000110063100 +#define SH_TRIGGER_COMPARE_PATTERN_MASK 0x00000000ffffffff +#define SH_TRIGGER_COMPARE_PATTERN_INIT 0x0000000000000000 + +/* SH_TRIGGER_COMPARE_PATTERN_DATA */ +/* Description: SHub Trigger Compare Pattern */ +#define SH_TRIGGER_COMPARE_PATTERN_DATA_SHFT 0 +#define SH_TRIGGER_COMPARE_PATTERN_DATA_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_TRIGGER_SEL" */ +/* Trigger select for SHUB debug port */ +/* ==================================================================== */ + +#define SH_TRIGGER_SEL 0x0000000110063180 +#define SH_TRIGGER_SEL_MASK 0x7777777777777777 +#define SH_TRIGGER_SEL_INIT 0x0000000000000000 + +/* SH_TRIGGER_SEL_NIBBLE0_INPUT_SEL */ +/* Description: Nibble 0 input select */ +#define SH_TRIGGER_SEL_NIBBLE0_INPUT_SEL_SHFT 0 +#define SH_TRIGGER_SEL_NIBBLE0_INPUT_SEL_MASK 0x0000000000000007 + +/* SH_TRIGGER_SEL_NIBBLE0_NIBBLE_SEL */ +/* Description: Nibble 0 Nibble select */ +#define SH_TRIGGER_SEL_NIBBLE0_NIBBLE_SEL_SHFT 4 +#define SH_TRIGGER_SEL_NIBBLE0_NIBBLE_SEL_MASK 0x0000000000000070 + +/* SH_TRIGGER_SEL_NIBBLE1_INPUT_SEL */ +/* Description: Nibble 1 input select */ +#define SH_TRIGGER_SEL_NIBBLE1_INPUT_SEL_SHFT 8 +#define SH_TRIGGER_SEL_NIBBLE1_INPUT_SEL_MASK 0x0000000000000700 + +/* SH_TRIGGER_SEL_NIBBLE1_NIBBLE_SEL */ +/* Description: Nibble 1 Nibble select */ +#define SH_TRIGGER_SEL_NIBBLE1_NIBBLE_SEL_SHFT 12 +#define SH_TRIGGER_SEL_NIBBLE1_NIBBLE_SEL_MASK 0x0000000000007000 + +/* SH_TRIGGER_SEL_NIBBLE2_INPUT_SEL */ +/* Description: Nibble 2 input select */ +#define SH_TRIGGER_SEL_NIBBLE2_INPUT_SEL_SHFT 16 +#define SH_TRIGGER_SEL_NIBBLE2_INPUT_SEL_MASK 0x0000000000070000 + +/* SH_TRIGGER_SEL_NIBBLE2_NIBBLE_SEL */ +/* Description: Nibble 2 Nibble select */ +#define SH_TRIGGER_SEL_NIBBLE2_NIBBLE_SEL_SHFT 20 +#define SH_TRIGGER_SEL_NIBBLE2_NIBBLE_SEL_MASK 0x0000000000700000 + +/* SH_TRIGGER_SEL_NIBBLE3_INPUT_SEL */ +/* Description: Nibble 3 input select */ +#define SH_TRIGGER_SEL_NIBBLE3_INPUT_SEL_SHFT 24 +#define SH_TRIGGER_SEL_NIBBLE3_INPUT_SEL_MASK 0x0000000007000000 + +/* SH_TRIGGER_SEL_NIBBLE3_NIBBLE_SEL */ +/* Description: Nibble 3 Nibble select */ +#define SH_TRIGGER_SEL_NIBBLE3_NIBBLE_SEL_SHFT 28 +#define SH_TRIGGER_SEL_NIBBLE3_NIBBLE_SEL_MASK 0x0000000070000000 + +/* SH_TRIGGER_SEL_NIBBLE4_INPUT_SEL */ +/* Description: Nibble 4 input select */ +#define SH_TRIGGER_SEL_NIBBLE4_INPUT_SEL_SHFT 32 +#define SH_TRIGGER_SEL_NIBBLE4_INPUT_SEL_MASK 0x0000000700000000 + +/* SH_TRIGGER_SEL_NIBBLE4_NIBBLE_SEL */ +/* Description: Nibble 4 Nibble select */ +#define SH_TRIGGER_SEL_NIBBLE4_NIBBLE_SEL_SHFT 36 +#define SH_TRIGGER_SEL_NIBBLE4_NIBBLE_SEL_MASK 0x0000007000000000 + +/* SH_TRIGGER_SEL_NIBBLE5_INPUT_SEL */ +/* Description: Nibble 5 input select */ +#define SH_TRIGGER_SEL_NIBBLE5_INPUT_SEL_SHFT 40 +#define SH_TRIGGER_SEL_NIBBLE5_INPUT_SEL_MASK 0x0000070000000000 + +/* SH_TRIGGER_SEL_NIBBLE5_NIBBLE_SEL */ +/* Description: Nibble 5 Nibble select */ +#define SH_TRIGGER_SEL_NIBBLE5_NIBBLE_SEL_SHFT 44 +#define SH_TRIGGER_SEL_NIBBLE5_NIBBLE_SEL_MASK 0x0000700000000000 + +/* SH_TRIGGER_SEL_NIBBLE6_INPUT_SEL */ +/* Description: Nibble 6 input select */ +#define SH_TRIGGER_SEL_NIBBLE6_INPUT_SEL_SHFT 48 +#define SH_TRIGGER_SEL_NIBBLE6_INPUT_SEL_MASK 0x0007000000000000 + +/* SH_TRIGGER_SEL_NIBBLE6_NIBBLE_SEL */ +/* Description: Nibble 6 Nibble select */ +#define SH_TRIGGER_SEL_NIBBLE6_NIBBLE_SEL_SHFT 52 +#define SH_TRIGGER_SEL_NIBBLE6_NIBBLE_SEL_MASK 0x0070000000000000 + +/* SH_TRIGGER_SEL_NIBBLE7_INPUT_SEL */ +/* Description: Nibble 7 input select */ +#define SH_TRIGGER_SEL_NIBBLE7_INPUT_SEL_SHFT 56 +#define SH_TRIGGER_SEL_NIBBLE7_INPUT_SEL_MASK 0x0700000000000000 + +/* SH_TRIGGER_SEL_NIBBLE7_NIBBLE_SEL */ +/* Description: Nibble 7 Nibble select */ +#define SH_TRIGGER_SEL_NIBBLE7_NIBBLE_SEL_SHFT 60 +#define SH_TRIGGER_SEL_NIBBLE7_NIBBLE_SEL_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_STOP_CLK_CONTROL" */ +/* Stop Clock Control */ +/* ==================================================================== */ + +#define SH_STOP_CLK_CONTROL 0x0000000110064000 +#define SH_STOP_CLK_CONTROL_MASK 0x00000000000000ff +#define SH_STOP_CLK_CONTROL_INIT 0x00000000000000e0 + +/* SH_STOP_CLK_CONTROL_STIMULUS */ +/* Description: Counter stimulus */ +#define SH_STOP_CLK_CONTROL_STIMULUS_SHFT 0 +#define SH_STOP_CLK_CONTROL_STIMULUS_MASK 0x000000000000001f + +/* SH_STOP_CLK_CONTROL_EVENT */ +/* Description: Counter event select (0-greater than, 1-equal) */ +#define SH_STOP_CLK_CONTROL_EVENT_SHFT 5 +#define SH_STOP_CLK_CONTROL_EVENT_MASK 0x0000000000000020 + +/* SH_STOP_CLK_CONTROL_POLARITY */ +/* Description: Counter polarity select (0-negative edge, 1-positiv */ +/* e edge) */ +#define SH_STOP_CLK_CONTROL_POLARITY_SHFT 6 +#define SH_STOP_CLK_CONTROL_POLARITY_MASK 0x0000000000000040 + +/* SH_STOP_CLK_CONTROL_MODE */ +/* Description: Counter mode select (0-internal, 1-external) */ +#define SH_STOP_CLK_CONTROL_MODE_SHFT 7 +#define SH_STOP_CLK_CONTROL_MODE_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_STOP_CLK_DELAY_PHASE" */ +/* Stop Clock Delay Phase */ +/* ==================================================================== */ + +#define SH_STOP_CLK_DELAY_PHASE 0x0000000110064080 +#define SH_STOP_CLK_DELAY_PHASE_MASK 0x00000000000000ff +#define SH_STOP_CLK_DELAY_PHASE_INIT 0x0000000000000000 + +/* SH_STOP_CLK_DELAY_PHASE_DELAY */ +/* Description: Delay phase */ +#define SH_STOP_CLK_DELAY_PHASE_DELAY_SHFT 0 +#define SH_STOP_CLK_DELAY_PHASE_DELAY_MASK 0x00000000000000ff + +/* ==================================================================== */ +/* Register "SH_TSF_ARM_MASK" */ +/* Trigger sequencing facility arm mask */ +/* ==================================================================== */ + +#define SH_TSF_ARM_MASK 0x0000000110065000 +#define SH_TSF_ARM_MASK_MASK 0xffffffffffffffff +#define SH_TSF_ARM_MASK_INIT 0x0000000000000000 + +/* SH_TSF_ARM_MASK_MASK */ +/* Description: Trigger sequencing facility arm mask */ +#define SH_TSF_ARM_MASK_MASK_SHFT 0 +#define SH_TSF_ARM_MASK_MASK_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_TSF_COUNTER_PRESETS" */ +/* Trigger sequencing facility counter presets */ +/* ==================================================================== */ + +#define SH_TSF_COUNTER_PRESETS 0x0000000110065080 +#define SH_TSF_COUNTER_PRESETS_MASK 0xffffffffffffffff +#define SH_TSF_COUNTER_PRESETS_INIT 0x0000000000000000 + +/* SH_TSF_COUNTER_PRESETS_COUNT_32 */ +/* Description: Trigger sequencing facility counter 32 */ +#define SH_TSF_COUNTER_PRESETS_COUNT_32_SHFT 0 +#define SH_TSF_COUNTER_PRESETS_COUNT_32_MASK 0x00000000ffffffff + +/* SH_TSF_COUNTER_PRESETS_COUNT_16 */ +/* Description: Trigger sequencing facility counter 16 */ +#define SH_TSF_COUNTER_PRESETS_COUNT_16_SHFT 32 +#define SH_TSF_COUNTER_PRESETS_COUNT_16_MASK 0x0000ffff00000000 + +/* SH_TSF_COUNTER_PRESETS_COUNT_8B */ +/* Description: Trigger sequencing facility counter 8b */ +#define SH_TSF_COUNTER_PRESETS_COUNT_8B_SHFT 48 +#define SH_TSF_COUNTER_PRESETS_COUNT_8B_MASK 0x00ff000000000000 + +/* SH_TSF_COUNTER_PRESETS_COUNT_8A */ +/* Description: Trigger sequencing facility counter 8a */ +#define SH_TSF_COUNTER_PRESETS_COUNT_8A_SHFT 56 +#define SH_TSF_COUNTER_PRESETS_COUNT_8A_MASK 0xff00000000000000 + +/* ==================================================================== */ +/* Register "SH_TSF_DECREMENT_CTL" */ +/* Trigger sequencing facility counter decrement control */ +/* ==================================================================== */ + +#define SH_TSF_DECREMENT_CTL 0x0000000110065100 +#define SH_TSF_DECREMENT_CTL_MASK 0x000000000000ffff +#define SH_TSF_DECREMENT_CTL_INIT 0x0000000000000000 + +/* SH_TSF_DECREMENT_CTL_CTL */ +/* Description: Trigger sequencing facility counter decrement contr */ +#define SH_TSF_DECREMENT_CTL_CTL_SHFT 0 +#define SH_TSF_DECREMENT_CTL_CTL_MASK 0x000000000000ffff + +/* ==================================================================== */ +/* Register "SH_TSF_DIAG_MSG_CTL" */ +/* Trigger sequencing facility diagnostic message control */ +/* ==================================================================== */ + +#define SH_TSF_DIAG_MSG_CTL 0x0000000110065180 +#define SH_TSF_DIAG_MSG_CTL_MASK 0x00000000000000ff +#define SH_TSF_DIAG_MSG_CTL_INIT 0x0000000000000000 + +/* SH_TSF_DIAG_MSG_CTL_ENABLE */ +/* Description: Trigger sequencing facility diagnostic message cont */ +#define SH_TSF_DIAG_MSG_CTL_ENABLE_SHFT 0 +#define SH_TSF_DIAG_MSG_CTL_ENABLE_MASK 0x00000000000000ff + +/* ==================================================================== */ +/* Register "SH_TSF_DISARM_MASK" */ +/* Trigger sequencing facility disarm mask */ +/* ==================================================================== */ + +#define SH_TSF_DISARM_MASK 0x0000000110065200 +#define SH_TSF_DISARM_MASK_MASK 0xffffffffffffffff +#define SH_TSF_DISARM_MASK_INIT 0x0000000000000000 + +/* SH_TSF_DISARM_MASK_MASK */ +/* Description: Trigger sequencing facility disarm mask */ +#define SH_TSF_DISARM_MASK_MASK_SHFT 0 +#define SH_TSF_DISARM_MASK_MASK_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_TSF_ENABLE_CTL" */ +/* Trigger sequencing facility counter enable control */ +/* ==================================================================== */ + +#define SH_TSF_ENABLE_CTL 0x0000000110065280 +#define SH_TSF_ENABLE_CTL_MASK 0x000000000000ffff +#define SH_TSF_ENABLE_CTL_INIT 0x0000000000000000 + +/* SH_TSF_ENABLE_CTL_CTL */ +/* Description: Trigger sequencing facility counter enable control */ +#define SH_TSF_ENABLE_CTL_CTL_SHFT 0 +#define SH_TSF_ENABLE_CTL_CTL_MASK 0x000000000000ffff + +/* ==================================================================== */ +/* Register "SH_TSF_SOFTWARE_ARM" */ +/* Trigger sequencing facility software arm */ +/* ==================================================================== */ + +#define SH_TSF_SOFTWARE_ARM 0x0000000110065300 +#define SH_TSF_SOFTWARE_ARM_MASK 0x00000000000000ff +#define SH_TSF_SOFTWARE_ARM_INIT 0x0000000000000000 + +/* SH_TSF_SOFTWARE_ARM_BIT0 */ +/* Description: Trigger sequencing facility software arm bit 0 */ +#define SH_TSF_SOFTWARE_ARM_BIT0_SHFT 0 +#define SH_TSF_SOFTWARE_ARM_BIT0_MASK 0x0000000000000001 + +/* SH_TSF_SOFTWARE_ARM_BIT1 */ +/* Description: Trigger sequencing facility software arm bit 1 */ +#define SH_TSF_SOFTWARE_ARM_BIT1_SHFT 1 +#define SH_TSF_SOFTWARE_ARM_BIT1_MASK 0x0000000000000002 + +/* SH_TSF_SOFTWARE_ARM_BIT2 */ +/* Description: Trigger sequencing facility software arm bit 2 */ +#define SH_TSF_SOFTWARE_ARM_BIT2_SHFT 2 +#define SH_TSF_SOFTWARE_ARM_BIT2_MASK 0x0000000000000004 + +/* SH_TSF_SOFTWARE_ARM_BIT3 */ +/* Description: Trigger sequencing facility software arm bit 3 */ +#define SH_TSF_SOFTWARE_ARM_BIT3_SHFT 3 +#define SH_TSF_SOFTWARE_ARM_BIT3_MASK 0x0000000000000008 + +/* SH_TSF_SOFTWARE_ARM_BIT4 */ +/* Description: Trigger sequencing facility software arm bit 4 */ +#define SH_TSF_SOFTWARE_ARM_BIT4_SHFT 4 +#define SH_TSF_SOFTWARE_ARM_BIT4_MASK 0x0000000000000010 + +/* SH_TSF_SOFTWARE_ARM_BIT5 */ +/* Description: Trigger sequencing facility software arm bit 5 */ +#define SH_TSF_SOFTWARE_ARM_BIT5_SHFT 5 +#define SH_TSF_SOFTWARE_ARM_BIT5_MASK 0x0000000000000020 + +/* SH_TSF_SOFTWARE_ARM_BIT6 */ +/* Description: Trigger sequencing facility software arm bit 6 */ +#define SH_TSF_SOFTWARE_ARM_BIT6_SHFT 6 +#define SH_TSF_SOFTWARE_ARM_BIT6_MASK 0x0000000000000040 + +/* SH_TSF_SOFTWARE_ARM_BIT7 */ +/* Description: Trigger sequencing facility software arm bit 7 */ +#define SH_TSF_SOFTWARE_ARM_BIT7_SHFT 7 +#define SH_TSF_SOFTWARE_ARM_BIT7_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_TSF_SOFTWARE_DISARM" */ +/* Trigger sequencing facility software disarm */ +/* ==================================================================== */ + +#define SH_TSF_SOFTWARE_DISARM 0x0000000110065380 +#define SH_TSF_SOFTWARE_DISARM_MASK 0x00000000000000ff +#define SH_TSF_SOFTWARE_DISARM_INIT 0x0000000000000000 + +/* SH_TSF_SOFTWARE_DISARM_BIT0 */ +/* Description: Trigger sequencing facility software disarm bit 0 */ +#define SH_TSF_SOFTWARE_DISARM_BIT0_SHFT 0 +#define SH_TSF_SOFTWARE_DISARM_BIT0_MASK 0x0000000000000001 + +/* SH_TSF_SOFTWARE_DISARM_BIT1 */ +/* Description: Trigger sequencing facility software disarm bit 1 */ +#define SH_TSF_SOFTWARE_DISARM_BIT1_SHFT 1 +#define SH_TSF_SOFTWARE_DISARM_BIT1_MASK 0x0000000000000002 + +/* SH_TSF_SOFTWARE_DISARM_BIT2 */ +/* Description: Trigger sequencing facility software disarm bit 2 */ +#define SH_TSF_SOFTWARE_DISARM_BIT2_SHFT 2 +#define SH_TSF_SOFTWARE_DISARM_BIT2_MASK 0x0000000000000004 + +/* SH_TSF_SOFTWARE_DISARM_BIT3 */ +/* Description: Trigger sequencing facility software disarm bit 3 */ +#define SH_TSF_SOFTWARE_DISARM_BIT3_SHFT 3 +#define SH_TSF_SOFTWARE_DISARM_BIT3_MASK 0x0000000000000008 + +/* SH_TSF_SOFTWARE_DISARM_BIT4 */ +/* Description: Trigger sequencing facility software disarm bit 4 */ +#define SH_TSF_SOFTWARE_DISARM_BIT4_SHFT 4 +#define SH_TSF_SOFTWARE_DISARM_BIT4_MASK 0x0000000000000010 + +/* SH_TSF_SOFTWARE_DISARM_BIT5 */ +/* Description: Trigger sequencing facility software disarm bit 5 */ +#define SH_TSF_SOFTWARE_DISARM_BIT5_SHFT 5 +#define SH_TSF_SOFTWARE_DISARM_BIT5_MASK 0x0000000000000020 + +/* SH_TSF_SOFTWARE_DISARM_BIT6 */ +/* Description: Trigger sequencing facility software disarm bit 6 */ +#define SH_TSF_SOFTWARE_DISARM_BIT6_SHFT 6 +#define SH_TSF_SOFTWARE_DISARM_BIT6_MASK 0x0000000000000040 + +/* SH_TSF_SOFTWARE_DISARM_BIT7 */ +/* Description: Trigger sequencing facility software disarm bit 7 */ +#define SH_TSF_SOFTWARE_DISARM_BIT7_SHFT 7 +#define SH_TSF_SOFTWARE_DISARM_BIT7_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_TSF_SOFTWARE_TRIGGERED" */ +/* Trigger sequencing facility software triggered */ +/* ==================================================================== */ + +#define SH_TSF_SOFTWARE_TRIGGERED 0x0000000110065400 +#define SH_TSF_SOFTWARE_TRIGGERED_MASK 0x00000000000000ff +#define SH_TSF_SOFTWARE_TRIGGERED_INIT 0x0000000000000000 + +/* SH_TSF_SOFTWARE_TRIGGERED_BIT0 */ +/* Description: Trigger sequencing facility software triggered bit */ +#define SH_TSF_SOFTWARE_TRIGGERED_BIT0_SHFT 0 +#define SH_TSF_SOFTWARE_TRIGGERED_BIT0_MASK 0x0000000000000001 + +/* SH_TSF_SOFTWARE_TRIGGERED_BIT1 */ +/* Description: Trigger sequencing facility software triggered bit */ +#define SH_TSF_SOFTWARE_TRIGGERED_BIT1_SHFT 1 +#define SH_TSF_SOFTWARE_TRIGGERED_BIT1_MASK 0x0000000000000002 + +/* SH_TSF_SOFTWARE_TRIGGERED_BIT2 */ +/* Description: Trigger sequencing facility software triggered bit */ +#define SH_TSF_SOFTWARE_TRIGGERED_BIT2_SHFT 2 +#define SH_TSF_SOFTWARE_TRIGGERED_BIT2_MASK 0x0000000000000004 + +/* SH_TSF_SOFTWARE_TRIGGERED_BIT3 */ +/* Description: Trigger sequencing facility software triggered bit */ +#define SH_TSF_SOFTWARE_TRIGGERED_BIT3_SHFT 3 +#define SH_TSF_SOFTWARE_TRIGGERED_BIT3_MASK 0x0000000000000008 + +/* SH_TSF_SOFTWARE_TRIGGERED_BIT4 */ +/* Description: Trigger sequencing facility software triggered bit */ +#define SH_TSF_SOFTWARE_TRIGGERED_BIT4_SHFT 4 +#define SH_TSF_SOFTWARE_TRIGGERED_BIT4_MASK 0x0000000000000010 + +/* SH_TSF_SOFTWARE_TRIGGERED_BIT5 */ +/* Description: Trigger sequencing facility software triggered bit */ +#define SH_TSF_SOFTWARE_TRIGGERED_BIT5_SHFT 5 +#define SH_TSF_SOFTWARE_TRIGGERED_BIT5_MASK 0x0000000000000020 + +/* SH_TSF_SOFTWARE_TRIGGERED_BIT6 */ +/* Description: Trigger sequencing facility software triggered bit */ +#define SH_TSF_SOFTWARE_TRIGGERED_BIT6_SHFT 6 +#define SH_TSF_SOFTWARE_TRIGGERED_BIT6_MASK 0x0000000000000040 + +/* SH_TSF_SOFTWARE_TRIGGERED_BIT7 */ +/* Description: Trigger sequencing facility software triggered bit */ +#define SH_TSF_SOFTWARE_TRIGGERED_BIT7_SHFT 7 +#define SH_TSF_SOFTWARE_TRIGGERED_BIT7_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_TSF_TRIGGER_MASK" */ +/* Trigger sequencing facility trigger mask */ +/* ==================================================================== */ + +#define SH_TSF_TRIGGER_MASK 0x0000000110065480 +#define SH_TSF_TRIGGER_MASK_MASK 0xffffffffffffffff +#define SH_TSF_TRIGGER_MASK_INIT 0x0000000000000000 + +/* SH_TSF_TRIGGER_MASK_MASK */ +/* Description: Trigger sequencing facility trigger mask */ +#define SH_TSF_TRIGGER_MASK_MASK_SHFT 0 +#define SH_TSF_TRIGGER_MASK_MASK_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_VEC_DATA" */ +/* Vector Write Request Message Data */ +/* ==================================================================== */ + +#define SH_VEC_DATA 0x0000000110066000 +#define SH_VEC_DATA_MASK 0xffffffffffffffff +#define SH_VEC_DATA_INIT 0x0000000000000000 + +/* SH_VEC_DATA_DATA */ +/* Description: Data */ +#define SH_VEC_DATA_DATA_SHFT 0 +#define SH_VEC_DATA_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_VEC_PARMS" */ +/* Vector Message Parameters Register */ +/* ==================================================================== */ + +#define SH_VEC_PARMS 0x0000000110066080 +#define SH_VEC_PARMS_MASK 0xc0003ffffffffffb +#define SH_VEC_PARMS_INIT 0x0000000000000000 + +/* SH_VEC_PARMS_TYPE */ +/* Description: Vector Request Message Type */ +#define SH_VEC_PARMS_TYPE_SHFT 0 +#define SH_VEC_PARMS_TYPE_MASK 0x0000000000000001 + +/* SH_VEC_PARMS_NI_PORT */ +/* Description: Network Interface Port Select */ +#define SH_VEC_PARMS_NI_PORT_SHFT 1 +#define SH_VEC_PARMS_NI_PORT_MASK 0x0000000000000002 + +/* SH_VEC_PARMS_ADDRESS */ +/* Description: Address[37:6] */ +#define SH_VEC_PARMS_ADDRESS_SHFT 3 +#define SH_VEC_PARMS_ADDRESS_MASK 0x00000007fffffff8 + +/* SH_VEC_PARMS_PIO_ID */ +/* Description: PIO ID */ +#define SH_VEC_PARMS_PIO_ID_SHFT 35 +#define SH_VEC_PARMS_PIO_ID_MASK 0x00003ff800000000 + +/* SH_VEC_PARMS_START */ +/* Description: Start */ +#define SH_VEC_PARMS_START_SHFT 62 +#define SH_VEC_PARMS_START_MASK 0x4000000000000000 + +/* SH_VEC_PARMS_BUSY */ +/* Description: Busy */ +#define SH_VEC_PARMS_BUSY_SHFT 63 +#define SH_VEC_PARMS_BUSY_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_VEC_ROUTE" */ +/* Vector Request Message Route */ +/* ==================================================================== */ + +#define SH_VEC_ROUTE 0x0000000110066100 +#define SH_VEC_ROUTE_MASK 0xffffffffffffffff +#define SH_VEC_ROUTE_INIT 0x0000000000000000 + +/* SH_VEC_ROUTE_ROUTE */ +/* Description: Route */ +#define SH_VEC_ROUTE_ROUTE_SHFT 0 +#define SH_VEC_ROUTE_ROUTE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_CPU_PERM" */ +/* CPU MMR Access Permission Bits */ +/* ==================================================================== */ + +#define SH_CPU_PERM 0x0000000110060000 +#define SH_CPU_PERM_MASK 0xffffffffffffffff +#define SH_CPU_PERM_INIT 0xffffffffffffffff + +/* SH_CPU_PERM_ACCESS_BITS */ +/* Description: Access Bits */ +#define SH_CPU_PERM_ACCESS_BITS_SHFT 0 +#define SH_CPU_PERM_ACCESS_BITS_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_CPU_PERM_OVR" */ +/* CPU MMR Access Permission Override */ +/* ==================================================================== */ + +#define SH_CPU_PERM_OVR 0x0000000110060080 +#define SH_CPU_PERM_OVR_MASK 0xffffffffffffffff +#define SH_CPU_PERM_OVR_INIT 0x0000000000000000 + +/* SH_CPU_PERM_OVR_OVERRIDE */ +/* Description: Override */ +#define SH_CPU_PERM_OVR_OVERRIDE_SHFT 0 +#define SH_CPU_PERM_OVR_OVERRIDE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_EXT_IO_PERM" */ +/* External IO MMR Access Permission Bits */ +/* ==================================================================== */ + +#define SH_EXT_IO_PERM 0x0000000110060100 +#define SH_EXT_IO_PERM_MASK 0xffffffffffffffff +#define SH_EXT_IO_PERM_INIT 0x0000000000000000 + +/* SH_EXT_IO_PERM_ACCESS_BITS */ +/* Description: Access Bits */ +#define SH_EXT_IO_PERM_ACCESS_BITS_SHFT 0 +#define SH_EXT_IO_PERM_ACCESS_BITS_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_EXT_IOI_ACCESS" */ +/* External IO Interrupt Access Permission Bits */ +/* ==================================================================== */ + +#define SH_EXT_IOI_ACCESS 0x0000000110060180 +#define SH_EXT_IOI_ACCESS_MASK 0xffffffffffffffff +#define SH_EXT_IOI_ACCESS_INIT 0xffffffffffffffff + +/* SH_EXT_IOI_ACCESS_ACCESS_BITS */ +/* Description: Access Bits */ +#define SH_EXT_IOI_ACCESS_ACCESS_BITS_SHFT 0 +#define SH_EXT_IOI_ACCESS_ACCESS_BITS_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_GC_FIL_CTRL" */ +/* SHub Global Clock Filter Control */ +/* ==================================================================== */ + +#define SH_GC_FIL_CTRL 0x0000000110060200 +#define SH_GC_FIL_CTRL_MASK 0x03ff3ff3ff1fff1f +#define SH_GC_FIL_CTRL_INIT 0x0000000000000000 + +/* SH_GC_FIL_CTRL_OFFSET */ +/* Description: Offset */ +#define SH_GC_FIL_CTRL_OFFSET_SHFT 0 +#define SH_GC_FIL_CTRL_OFFSET_MASK 0x000000000000001f + +/* SH_GC_FIL_CTRL_MASK_COUNTER */ +/* Description: Mask Counter */ +#define SH_GC_FIL_CTRL_MASK_COUNTER_SHFT 8 +#define SH_GC_FIL_CTRL_MASK_COUNTER_MASK 0x00000000000fff00 + +/* SH_GC_FIL_CTRL_MASK_ENABLE */ +/* Description: Mask Enable */ +#define SH_GC_FIL_CTRL_MASK_ENABLE_SHFT 20 +#define SH_GC_FIL_CTRL_MASK_ENABLE_MASK 0x0000000000100000 + +/* SH_GC_FIL_CTRL_DROPOUT_COUNTER */ +/* Description: Dropout Counter */ +#define SH_GC_FIL_CTRL_DROPOUT_COUNTER_SHFT 24 +#define SH_GC_FIL_CTRL_DROPOUT_COUNTER_MASK 0x00000003ff000000 + +/* SH_GC_FIL_CTRL_DROPOUT_THRESH */ +/* Description: Dropout threshold */ +#define SH_GC_FIL_CTRL_DROPOUT_THRESH_SHFT 36 +#define SH_GC_FIL_CTRL_DROPOUT_THRESH_MASK 0x00003ff000000000 + +/* SH_GC_FIL_CTRL_ERROR_COUNTER */ +/* Description: Error counter */ +#define SH_GC_FIL_CTRL_ERROR_COUNTER_SHFT 48 +#define SH_GC_FIL_CTRL_ERROR_COUNTER_MASK 0x03ff000000000000 + +/* ==================================================================== */ +/* Register "SH_GC_SRC_CTRL" */ +/* SHub Global Clock Control */ +/* ==================================================================== */ + +#define SH_GC_SRC_CTRL 0x0000000110060280 +#define SH_GC_SRC_CTRL_MASK 0x0000000313ff3ff1 +#define SH_GC_SRC_CTRL_INIT 0x0000000100000000 + +/* SH_GC_SRC_CTRL_ENABLE_COUNTER */ +/* Description: Enable Counter */ +#define SH_GC_SRC_CTRL_ENABLE_COUNTER_SHFT 0 +#define SH_GC_SRC_CTRL_ENABLE_COUNTER_MASK 0x0000000000000001 + +/* SH_GC_SRC_CTRL_MAX_COUNT */ +/* Description: Max Count */ +#define SH_GC_SRC_CTRL_MAX_COUNT_SHFT 4 +#define SH_GC_SRC_CTRL_MAX_COUNT_MASK 0x0000000000003ff0 + +/* SH_GC_SRC_CTRL_COUNTER */ +/* Description: Counter */ +#define SH_GC_SRC_CTRL_COUNTER_SHFT 16 +#define SH_GC_SRC_CTRL_COUNTER_MASK 0x0000000003ff0000 + +/* SH_GC_SRC_CTRL_TOGGLE_BIT */ +/* Description: Toggle bit */ +#define SH_GC_SRC_CTRL_TOGGLE_BIT_SHFT 28 +#define SH_GC_SRC_CTRL_TOGGLE_BIT_MASK 0x0000000010000000 + +/* SH_GC_SRC_CTRL_SOURCE_SEL */ +/* Description: Source select (0=ext., 1=Int., 2=SHUB) */ +#define SH_GC_SRC_CTRL_SOURCE_SEL_SHFT 32 +#define SH_GC_SRC_CTRL_SOURCE_SEL_MASK 0x0000000300000000 + +/* ==================================================================== */ +/* Register "SH_HARD_RESET" */ +/* SHub Hard Reset */ +/* ==================================================================== */ + +#define SH_HARD_RESET 0x0000000110060300 +#define SH_HARD_RESET_MASK 0x0000000000000001 +#define SH_HARD_RESET_INIT 0x0000000000000000 + +/* SH_HARD_RESET_HARD_RESET */ +/* Description: Hard Reset */ +#define SH_HARD_RESET_HARD_RESET_SHFT 0 +#define SH_HARD_RESET_HARD_RESET_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_IO_PERM" */ +/* II MMR Access Permission Bits */ +/* ==================================================================== */ + +#define SH_IO_PERM 0x0000000110060380 +#define SH_IO_PERM_MASK 0xffffffffffffffff +#define SH_IO_PERM_INIT 0x0000000000000000 + +/* SH_IO_PERM_ACCESS_BITS */ +/* Description: Access Bits */ +#define SH_IO_PERM_ACCESS_BITS_SHFT 0 +#define SH_IO_PERM_ACCESS_BITS_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_IOI_ACCESS" */ +/* II Interrupt Access Permission Bits */ +/* ==================================================================== */ + +#define SH_IOI_ACCESS 0x0000000110060400 +#define SH_IOI_ACCESS_MASK 0xffffffffffffffff +#define SH_IOI_ACCESS_INIT 0xffffffffffffffff + +/* SH_IOI_ACCESS_ACCESS_BITS */ +/* Description: Access Bits */ +#define SH_IOI_ACCESS_ACCESS_BITS_SHFT 0 +#define SH_IOI_ACCESS_ACCESS_BITS_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_IPI_ACCESS" */ +/* CPU interrupt Access Permission Bits */ +/* ==================================================================== */ + +#define SH_IPI_ACCESS 0x0000000110060480 +#define SH_IPI_ACCESS_MASK 0xffffffffffffffff +#define SH_IPI_ACCESS_INIT 0xffffffffffffffff + +/* SH_IPI_ACCESS_ACCESS_BITS */ +/* Description: Access Bits */ +#define SH_IPI_ACCESS_ACCESS_BITS_SHFT 0 +#define SH_IPI_ACCESS_ACCESS_BITS_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_JTAG_CONFIG" */ +/* SHub JTAG configuration */ +/* ==================================================================== */ + +#define SH_JTAG_CONFIG 0x0000000110060500 +#define SH_JTAG_CONFIG_MASK 0x00ffffffffffffff +#define SH_JTAG_CONFIG_INIT 0x0000000000000000 + +/* SH_JTAG_CONFIG_MD_CLK_SEL */ +/* Description: Select divide freq of DRAMCLK */ +#define SH_JTAG_CONFIG_MD_CLK_SEL_SHFT 0 +#define SH_JTAG_CONFIG_MD_CLK_SEL_MASK 0x0000000000000003 + +/* SH_JTAG_CONFIG_NI_CLK_SEL */ +/* Description: Selects clock source for NICLK domain */ +#define SH_JTAG_CONFIG_NI_CLK_SEL_SHFT 2 +#define SH_JTAG_CONFIG_NI_CLK_SEL_MASK 0x0000000000000004 + +/* SH_JTAG_CONFIG_II_CLK_SEL */ +/* Description: Selects clock source for IOCLK domain */ +#define SH_JTAG_CONFIG_II_CLK_SEL_SHFT 3 +#define SH_JTAG_CONFIG_II_CLK_SEL_MASK 0x0000000000000018 + +/* SH_JTAG_CONFIG_WRT90_TARGET */ +/* Description: wrt90_target */ +#define SH_JTAG_CONFIG_WRT90_TARGET_SHFT 5 +#define SH_JTAG_CONFIG_WRT90_TARGET_MASK 0x000000000007ffe0 + +/* SH_JTAG_CONFIG_WRT90_OVERRIDER */ +/* Description: wrt90_overrideR */ +#define SH_JTAG_CONFIG_WRT90_OVERRIDER_SHFT 19 +#define SH_JTAG_CONFIG_WRT90_OVERRIDER_MASK 0x0000000000080000 + +/* SH_JTAG_CONFIG_WRT90_OVERRIDE */ +/* Description: wrt90_override */ +#define SH_JTAG_CONFIG_WRT90_OVERRIDE_SHFT 20 +#define SH_JTAG_CONFIG_WRT90_OVERRIDE_MASK 0x0000000000100000 + +/* SH_JTAG_CONFIG_JTAG_MCI_RESET_DELAY */ +/* Description: jtag_mci_reset_delay */ +#define SH_JTAG_CONFIG_JTAG_MCI_RESET_DELAY_SHFT 21 +#define SH_JTAG_CONFIG_JTAG_MCI_RESET_DELAY_MASK 0x0000000001e00000 + +/* SH_JTAG_CONFIG_JTAG_MCI_TARGET */ +/* Description: jtag_mci_target */ +#define SH_JTAG_CONFIG_JTAG_MCI_TARGET_SHFT 25 +#define SH_JTAG_CONFIG_JTAG_MCI_TARGET_MASK 0x0000007ffe000000 + +/* SH_JTAG_CONFIG_JTAG_MCI_OVERRIDE */ +/* Description: jtag_mci_override */ +#define SH_JTAG_CONFIG_JTAG_MCI_OVERRIDE_SHFT 39 +#define SH_JTAG_CONFIG_JTAG_MCI_OVERRIDE_MASK 0x0000008000000000 + +/* SH_JTAG_CONFIG_FSB_CONFIG_IOQ_DEPTH */ +/* Description: 0=depth 8, 1=depth1 */ +#define SH_JTAG_CONFIG_FSB_CONFIG_IOQ_DEPTH_SHFT 40 +#define SH_JTAG_CONFIG_FSB_CONFIG_IOQ_DEPTH_MASK 0x0000010000000000 + +/* SH_JTAG_CONFIG_FSB_CONFIG_SAMPLE_BINIT */ +/* Description: Enable sampling of BINIT */ +#define SH_JTAG_CONFIG_FSB_CONFIG_SAMPLE_BINIT_SHFT 41 +#define SH_JTAG_CONFIG_FSB_CONFIG_SAMPLE_BINIT_MASK 0x0000020000000000 + +/* SH_JTAG_CONFIG_FSB_CONFIG_ENABLE_BUS_PARKING */ +#define SH_JTAG_CONFIG_FSB_CONFIG_ENABLE_BUS_PARKING_SHFT 42 +#define SH_JTAG_CONFIG_FSB_CONFIG_ENABLE_BUS_PARKING_MASK 0x0000040000000000 + +/* SH_JTAG_CONFIG_FSB_CONFIG_CLOCK_RATIO */ +#define SH_JTAG_CONFIG_FSB_CONFIG_CLOCK_RATIO_SHFT 43 +#define SH_JTAG_CONFIG_FSB_CONFIG_CLOCK_RATIO_MASK 0x0000f80000000000 + +/* SH_JTAG_CONFIG_FSB_CONFIG_OUTPUT_TRISTATE */ +/* Description: Output tristate control */ +#define SH_JTAG_CONFIG_FSB_CONFIG_OUTPUT_TRISTATE_SHFT 48 +#define SH_JTAG_CONFIG_FSB_CONFIG_OUTPUT_TRISTATE_MASK 0x000f000000000000 + +/* SH_JTAG_CONFIG_FSB_CONFIG_ENABLE_BIST */ +/* Description: Enables BIST */ +#define SH_JTAG_CONFIG_FSB_CONFIG_ENABLE_BIST_SHFT 52 +#define SH_JTAG_CONFIG_FSB_CONFIG_ENABLE_BIST_MASK 0x0010000000000000 + +/* SH_JTAG_CONFIG_FSB_CONFIG_AUX */ +/* Description: Enables BIST */ +#define SH_JTAG_CONFIG_FSB_CONFIG_AUX_SHFT 53 +#define SH_JTAG_CONFIG_FSB_CONFIG_AUX_MASK 0x0060000000000000 + +/* SH_JTAG_CONFIG_GTL_CONFIG_RE */ +/* Description: Reference Enable selection for GTL io */ +#define SH_JTAG_CONFIG_GTL_CONFIG_RE_SHFT 55 +#define SH_JTAG_CONFIG_GTL_CONFIG_RE_MASK 0x0080000000000000 + +/* ==================================================================== */ +/* Register "SH_SHUB_ID" */ +/* SHub ID Number */ +/* ==================================================================== */ + +#define SH_SHUB_ID 0x0000000110060580 +#define SH_SHUB_ID_MASK 0x011f37ffffffffff +#define SH_SHUB_ID_INIT 0x0010300000000000 + +/* SH_SHUB_ID_FORCE1 */ +/* Description: Must be 1 */ +#define SH_SHUB_ID_FORCE1_SHFT 0 +#define SH_SHUB_ID_FORCE1_MASK 0x0000000000000001 + +/* SH_SHUB_ID_MANUFACTURER */ +/* Description: Manufacturer */ +#define SH_SHUB_ID_MANUFACTURER_SHFT 1 +#define SH_SHUB_ID_MANUFACTURER_MASK 0x0000000000000ffe + +/* SH_SHUB_ID_PART_NUMBER */ +/* Description: Part Number */ +#define SH_SHUB_ID_PART_NUMBER_SHFT 12 +#define SH_SHUB_ID_PART_NUMBER_MASK 0x000000000ffff000 + +/* SH_SHUB_ID_REVISION */ +/* Description: Revision */ +#define SH_SHUB_ID_REVISION_SHFT 28 +#define SH_SHUB_ID_REVISION_MASK 0x00000000f0000000 + +/* SH_SHUB_ID_NODE_ID */ +/* Description: Node Identification */ +#define SH_SHUB_ID_NODE_ID_SHFT 32 +#define SH_SHUB_ID_NODE_ID_MASK 0x000007ff00000000 + +/* SH_SHUB_ID_SHARING_MODE */ +/* Description: Sharing mode (Coherency Domain Size) */ +#define SH_SHUB_ID_SHARING_MODE_SHFT 44 +#define SH_SHUB_ID_SHARING_MODE_MASK 0x0000300000000000 + +/* SH_SHUB_ID_NODES_PER_BIT */ +/* Description: Nodes per bit definition for MMR access */ +#define SH_SHUB_ID_NODES_PER_BIT_SHFT 48 +#define SH_SHUB_ID_NODES_PER_BIT_MASK 0x001f000000000000 + +/* SH_SHUB_ID_NI_PORT */ +/* Description: NI port of vector reference, 0 = NI0, 1 = NI1 */ +#define SH_SHUB_ID_NI_PORT_SHFT 56 +#define SH_SHUB_ID_NI_PORT_MASK 0x0100000000000000 + +/* ==================================================================== */ +/* Register "SH_SHUBS_PRESENT0" */ +/* Shubs 0 - 63 Present. Used for invalidate generation */ +/* ==================================================================== */ + +#define SH_SHUBS_PRESENT0 0x0000000110060600 +#define SH_SHUBS_PRESENT0_MASK 0xffffffffffffffff +#define SH_SHUBS_PRESENT0_INIT 0xffffffffffffffff + +/* SH_SHUBS_PRESENT0_SHUBS_PRESENT0 */ +/* Description: Shubs 0 - 63 Present configuration */ +#define SH_SHUBS_PRESENT0_SHUBS_PRESENT0_SHFT 0 +#define SH_SHUBS_PRESENT0_SHUBS_PRESENT0_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_SHUBS_PRESENT1" */ +/* Shubs 64 - 127 Present. Used for invalidate generation */ +/* ==================================================================== */ + +#define SH_SHUBS_PRESENT1 0x0000000110060680 +#define SH_SHUBS_PRESENT1_MASK 0xffffffffffffffff +#define SH_SHUBS_PRESENT1_INIT 0xffffffffffffffff + +/* SH_SHUBS_PRESENT1_SHUBS_PRESENT1 */ +/* Description: Shubs 64 - 127 Present configuration */ +#define SH_SHUBS_PRESENT1_SHUBS_PRESENT1_SHFT 0 +#define SH_SHUBS_PRESENT1_SHUBS_PRESENT1_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_SHUBS_PRESENT2" */ +/* Shubs 128 - 191 Present. Used for invalidate generation */ +/* ==================================================================== */ + +#define SH_SHUBS_PRESENT2 0x0000000110060700 +#define SH_SHUBS_PRESENT2_MASK 0xffffffffffffffff +#define SH_SHUBS_PRESENT2_INIT 0xffffffffffffffff + +/* SH_SHUBS_PRESENT2_SHUBS_PRESENT2 */ +/* Description: Shubs 128 - 191 Present configuration */ +#define SH_SHUBS_PRESENT2_SHUBS_PRESENT2_SHFT 0 +#define SH_SHUBS_PRESENT2_SHUBS_PRESENT2_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_SHUBS_PRESENT3" */ +/* Shubs 192 - 255 Present. Used for invalidate generation */ +/* ==================================================================== */ + +#define SH_SHUBS_PRESENT3 0x0000000110060780 +#define SH_SHUBS_PRESENT3_MASK 0xffffffffffffffff +#define SH_SHUBS_PRESENT3_INIT 0xffffffffffffffff + +/* SH_SHUBS_PRESENT3_SHUBS_PRESENT3 */ +/* Description: Shubs 192 - 255 Present configuration */ +#define SH_SHUBS_PRESENT3_SHUBS_PRESENT3_SHFT 0 +#define SH_SHUBS_PRESENT3_SHUBS_PRESENT3_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_SOFT_RESET" */ +/* SHub Soft Reset */ +/* ==================================================================== */ + +#define SH_SOFT_RESET 0x0000000110060800 +#define SH_SOFT_RESET_MASK 0x0000000000000001 +#define SH_SOFT_RESET_INIT 0x0000000000000000 + +/* SH_SOFT_RESET_SOFT_RESET */ +/* Description: Soft Reset */ +#define SH_SOFT_RESET_SOFT_RESET_SHFT 0 +#define SH_SOFT_RESET_SOFT_RESET_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_FIRST_ERROR" */ +/* Shub Global First Error Flags */ +/* ==================================================================== */ + +#define SH_FIRST_ERROR 0x0000000110071000 +#define SH_FIRST_ERROR_MASK 0x000000000007ffff +#define SH_FIRST_ERROR_INIT 0x0000000000000000 + +/* SH_FIRST_ERROR_FIRST_ERROR */ +/* Description: Chiplet with first error */ +#define SH_FIRST_ERROR_FIRST_ERROR_SHFT 0 +#define SH_FIRST_ERROR_FIRST_ERROR_MASK 0x000000000007ffff + +/* ==================================================================== */ +/* Register "SH_II_HW_TIME_STAMP" */ +/* II hardware error time stamp */ +/* ==================================================================== */ + +#define SH_II_HW_TIME_STAMP 0x0000000110071080 +#define SH_II_HW_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_II_HW_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_II_HW_TIME_STAMP_TIME */ +/* Description: II hardware error time stamp */ +#define SH_II_HW_TIME_STAMP_TIME_SHFT 0 +#define SH_II_HW_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_II_HW_TIME_STAMP_VALID */ +/* Description: II hardware error time stamp valid */ +#define SH_II_HW_TIME_STAMP_VALID_SHFT 63 +#define SH_II_HW_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_LB_HW_TIME_STAMP" */ +/* LB hardware error time stamp */ +/* ==================================================================== */ + +#define SH_LB_HW_TIME_STAMP 0x0000000110071100 +#define SH_LB_HW_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_LB_HW_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_LB_HW_TIME_STAMP_TIME */ +/* Description: LB hardware error time stamp */ +#define SH_LB_HW_TIME_STAMP_TIME_SHFT 0 +#define SH_LB_HW_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_LB_HW_TIME_STAMP_VALID */ +/* Description: LB hardware error time stamp valid */ +#define SH_LB_HW_TIME_STAMP_VALID_SHFT 63 +#define SH_LB_HW_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_COR_TIME_STAMP" */ +/* MD correctable error time stamp */ +/* ==================================================================== */ + +#define SH_MD_COR_TIME_STAMP 0x0000000110071180 +#define SH_MD_COR_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_MD_COR_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_MD_COR_TIME_STAMP_TIME */ +/* Description: MD correctable error time stamp */ +#define SH_MD_COR_TIME_STAMP_TIME_SHFT 0 +#define SH_MD_COR_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_MD_COR_TIME_STAMP_VALID */ +/* Description: MD correctable error time stamp valid */ +#define SH_MD_COR_TIME_STAMP_VALID_SHFT 63 +#define SH_MD_COR_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_HW_TIME_STAMP" */ +/* MD hardware error time stamp */ +/* ==================================================================== */ + +#define SH_MD_HW_TIME_STAMP 0x0000000110071200 +#define SH_MD_HW_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_MD_HW_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_MD_HW_TIME_STAMP_TIME */ +/* Description: MD hardware error time stamp */ +#define SH_MD_HW_TIME_STAMP_TIME_SHFT 0 +#define SH_MD_HW_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_MD_HW_TIME_STAMP_VALID */ +/* Description: MD hardware error time stamp valid */ +#define SH_MD_HW_TIME_STAMP_VALID_SHFT 63 +#define SH_MD_HW_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_UNCOR_TIME_STAMP" */ +/* MD uncorrectable error time stamp */ +/* ==================================================================== */ + +#define SH_MD_UNCOR_TIME_STAMP 0x0000000110071280 +#define SH_MD_UNCOR_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_MD_UNCOR_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_MD_UNCOR_TIME_STAMP_TIME */ +/* Description: MD uncorrectable error time stamp */ +#define SH_MD_UNCOR_TIME_STAMP_TIME_SHFT 0 +#define SH_MD_UNCOR_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_MD_UNCOR_TIME_STAMP_VALID */ +/* Description: MD uncorrectable error time stamp valid */ +#define SH_MD_UNCOR_TIME_STAMP_VALID_SHFT 63 +#define SH_MD_UNCOR_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_COR_TIME_STAMP" */ +/* PI correctable error time stamp */ +/* ==================================================================== */ + +#define SH_PI_COR_TIME_STAMP 0x0000000110071300 +#define SH_PI_COR_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_PI_COR_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_PI_COR_TIME_STAMP_TIME */ +/* Description: PI correctable error time stamp */ +#define SH_PI_COR_TIME_STAMP_TIME_SHFT 0 +#define SH_PI_COR_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_PI_COR_TIME_STAMP_VALID */ +/* Description: PI correctable error time stamp valid */ +#define SH_PI_COR_TIME_STAMP_VALID_SHFT 63 +#define SH_PI_COR_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_HW_TIME_STAMP" */ +/* PI hardware error time stamp */ +/* ==================================================================== */ + +#define SH_PI_HW_TIME_STAMP 0x0000000110071380 +#define SH_PI_HW_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_PI_HW_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_PI_HW_TIME_STAMP_TIME */ +/* Description: PI hardware error time stamp */ +#define SH_PI_HW_TIME_STAMP_TIME_SHFT 0 +#define SH_PI_HW_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_PI_HW_TIME_STAMP_VALID */ +/* Description: PI hardware error time stamp valid */ +#define SH_PI_HW_TIME_STAMP_VALID_SHFT 63 +#define SH_PI_HW_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PI_UNCOR_TIME_STAMP" */ +/* PI uncorrectable error time stamp */ +/* ==================================================================== */ + +#define SH_PI_UNCOR_TIME_STAMP 0x0000000110071400 +#define SH_PI_UNCOR_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_PI_UNCOR_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_PI_UNCOR_TIME_STAMP_TIME */ +/* Description: PI uncorrectable error time stamp */ +#define SH_PI_UNCOR_TIME_STAMP_TIME_SHFT 0 +#define SH_PI_UNCOR_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_PI_UNCOR_TIME_STAMP_VALID */ +/* Description: PI uncorrectable error time stamp valid */ +#define SH_PI_UNCOR_TIME_STAMP_VALID_SHFT 63 +#define SH_PI_UNCOR_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC0_ADV_TIME_STAMP" */ +/* Proc 0 advisory time stamp */ +/* ==================================================================== */ + +#define SH_PROC0_ADV_TIME_STAMP 0x0000000110071480 +#define SH_PROC0_ADV_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_PROC0_ADV_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_PROC0_ADV_TIME_STAMP_TIME */ +/* Description: Processor 0 advisory time stamp */ +#define SH_PROC0_ADV_TIME_STAMP_TIME_SHFT 0 +#define SH_PROC0_ADV_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_PROC0_ADV_TIME_STAMP_VALID */ +/* Description: Processor 0 advisory time stamp valid */ +#define SH_PROC0_ADV_TIME_STAMP_VALID_SHFT 63 +#define SH_PROC0_ADV_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC0_ERR_TIME_STAMP" */ +/* Proc 0 error time stamp */ +/* ==================================================================== */ + +#define SH_PROC0_ERR_TIME_STAMP 0x0000000110071500 +#define SH_PROC0_ERR_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_PROC0_ERR_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_PROC0_ERR_TIME_STAMP_TIME */ +/* Description: Processor 0 error time stamp */ +#define SH_PROC0_ERR_TIME_STAMP_TIME_SHFT 0 +#define SH_PROC0_ERR_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_PROC0_ERR_TIME_STAMP_VALID */ +/* Description: Processor 0 error time stamp valid */ +#define SH_PROC0_ERR_TIME_STAMP_VALID_SHFT 63 +#define SH_PROC0_ERR_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC1_ADV_TIME_STAMP" */ +/* Proc 1 advisory time stamp */ +/* ==================================================================== */ + +#define SH_PROC1_ADV_TIME_STAMP 0x0000000110071580 +#define SH_PROC1_ADV_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_PROC1_ADV_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_PROC1_ADV_TIME_STAMP_TIME */ +/* Description: Processor 1 advisory time stamp */ +#define SH_PROC1_ADV_TIME_STAMP_TIME_SHFT 0 +#define SH_PROC1_ADV_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_PROC1_ADV_TIME_STAMP_VALID */ +/* Description: Processor 1 advisory time stamp valid */ +#define SH_PROC1_ADV_TIME_STAMP_VALID_SHFT 63 +#define SH_PROC1_ADV_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC1_ERR_TIME_STAMP" */ +/* Proc 1 error time stamp */ +/* ==================================================================== */ + +#define SH_PROC1_ERR_TIME_STAMP 0x0000000110071600 +#define SH_PROC1_ERR_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_PROC1_ERR_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_PROC1_ERR_TIME_STAMP_TIME */ +/* Description: Processor 1 error time stamp */ +#define SH_PROC1_ERR_TIME_STAMP_TIME_SHFT 0 +#define SH_PROC1_ERR_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_PROC1_ERR_TIME_STAMP_VALID */ +/* Description: Processor 1 error time stamp valid */ +#define SH_PROC1_ERR_TIME_STAMP_VALID_SHFT 63 +#define SH_PROC1_ERR_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC2_ADV_TIME_STAMP" */ +/* Proc 2 advisory time stamp */ +/* ==================================================================== */ + +#define SH_PROC2_ADV_TIME_STAMP 0x0000000110071680 +#define SH_PROC2_ADV_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_PROC2_ADV_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_PROC2_ADV_TIME_STAMP_TIME */ +/* Description: Processor 2 advisory time stamp */ +#define SH_PROC2_ADV_TIME_STAMP_TIME_SHFT 0 +#define SH_PROC2_ADV_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_PROC2_ADV_TIME_STAMP_VALID */ +/* Description: Processor 2 advisory time stamp valid */ +#define SH_PROC2_ADV_TIME_STAMP_VALID_SHFT 63 +#define SH_PROC2_ADV_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC2_ERR_TIME_STAMP" */ +/* Proc 2 error time stamp */ +/* ==================================================================== */ + +#define SH_PROC2_ERR_TIME_STAMP 0x0000000110071700 +#define SH_PROC2_ERR_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_PROC2_ERR_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_PROC2_ERR_TIME_STAMP_TIME */ +/* Description: Processor 2 error time stamp */ +#define SH_PROC2_ERR_TIME_STAMP_TIME_SHFT 0 +#define SH_PROC2_ERR_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_PROC2_ERR_TIME_STAMP_VALID */ +/* Description: Processor 2 error time stamp valid */ +#define SH_PROC2_ERR_TIME_STAMP_VALID_SHFT 63 +#define SH_PROC2_ERR_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC3_ADV_TIME_STAMP" */ +/* Proc 3 advisory time stamp */ +/* ==================================================================== */ + +#define SH_PROC3_ADV_TIME_STAMP 0x0000000110071780 +#define SH_PROC3_ADV_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_PROC3_ADV_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_PROC3_ADV_TIME_STAMP_TIME */ +/* Description: Processor 3 advisory time stamp */ +#define SH_PROC3_ADV_TIME_STAMP_TIME_SHFT 0 +#define SH_PROC3_ADV_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_PROC3_ADV_TIME_STAMP_VALID */ +/* Description: Processor 3 advisory time stamp valid */ +#define SH_PROC3_ADV_TIME_STAMP_VALID_SHFT 63 +#define SH_PROC3_ADV_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PROC3_ERR_TIME_STAMP" */ +/* Proc 3 error time stamp */ +/* ==================================================================== */ + +#define SH_PROC3_ERR_TIME_STAMP 0x0000000110071800 +#define SH_PROC3_ERR_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_PROC3_ERR_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_PROC3_ERR_TIME_STAMP_TIME */ +/* Description: Processor 3 error time stamp */ +#define SH_PROC3_ERR_TIME_STAMP_TIME_SHFT 0 +#define SH_PROC3_ERR_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_PROC3_ERR_TIME_STAMP_VALID */ +/* Description: Processor 3 error time stamp valid */ +#define SH_PROC3_ERR_TIME_STAMP_VALID_SHFT 63 +#define SH_PROC3_ERR_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_XN_COR_TIME_STAMP" */ +/* XN correctable error time stamp */ +/* ==================================================================== */ + +#define SH_XN_COR_TIME_STAMP 0x0000000110071880 +#define SH_XN_COR_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_XN_COR_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_XN_COR_TIME_STAMP_TIME */ +/* Description: XN correctable error time stamp */ +#define SH_XN_COR_TIME_STAMP_TIME_SHFT 0 +#define SH_XN_COR_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_XN_COR_TIME_STAMP_VALID */ +/* Description: XN correctable error time stamp valid */ +#define SH_XN_COR_TIME_STAMP_VALID_SHFT 63 +#define SH_XN_COR_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_XN_HW_TIME_STAMP" */ +/* XN hardware error time stamp */ +/* ==================================================================== */ + +#define SH_XN_HW_TIME_STAMP 0x0000000110071900 +#define SH_XN_HW_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_XN_HW_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_XN_HW_TIME_STAMP_TIME */ +/* Description: XN hardware error time stamp */ +#define SH_XN_HW_TIME_STAMP_TIME_SHFT 0 +#define SH_XN_HW_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_XN_HW_TIME_STAMP_VALID */ +/* Description: XN hardware error time stamp valid */ +#define SH_XN_HW_TIME_STAMP_VALID_SHFT 63 +#define SH_XN_HW_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_XN_UNCOR_TIME_STAMP" */ +/* XN uncorrectable error time stamp */ +/* ==================================================================== */ + +#define SH_XN_UNCOR_TIME_STAMP 0x0000000110071980 +#define SH_XN_UNCOR_TIME_STAMP_MASK 0xffffffffffffffff +#define SH_XN_UNCOR_TIME_STAMP_INIT 0x0000000000000000 + +/* SH_XN_UNCOR_TIME_STAMP_TIME */ +/* Description: XN uncorrectable error time stamp */ +#define SH_XN_UNCOR_TIME_STAMP_TIME_SHFT 0 +#define SH_XN_UNCOR_TIME_STAMP_TIME_MASK 0x7fffffffffffffff + +/* SH_XN_UNCOR_TIME_STAMP_VALID */ +/* Description: XN uncorrectable error time stamp valid */ +#define SH_XN_UNCOR_TIME_STAMP_VALID_SHFT 63 +#define SH_XN_UNCOR_TIME_STAMP_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_DEBUG_PORT" */ +/* SHub Debug Port */ +/* ==================================================================== */ + +#define SH_DEBUG_PORT 0x0000000110072000 +#define SH_DEBUG_PORT_MASK 0x00000000ffffffff +#define SH_DEBUG_PORT_INIT 0x0000000000000000 + +/* SH_DEBUG_PORT_DEBUG_NIBBLE0 */ +/* Description: Debug port nibble 0 */ +#define SH_DEBUG_PORT_DEBUG_NIBBLE0_SHFT 0 +#define SH_DEBUG_PORT_DEBUG_NIBBLE0_MASK 0x000000000000000f + +/* SH_DEBUG_PORT_DEBUG_NIBBLE1 */ +/* Description: Debug port nibble 1 */ +#define SH_DEBUG_PORT_DEBUG_NIBBLE1_SHFT 4 +#define SH_DEBUG_PORT_DEBUG_NIBBLE1_MASK 0x00000000000000f0 + +/* SH_DEBUG_PORT_DEBUG_NIBBLE2 */ +/* Description: Debug port nibble 2 */ +#define SH_DEBUG_PORT_DEBUG_NIBBLE2_SHFT 8 +#define SH_DEBUG_PORT_DEBUG_NIBBLE2_MASK 0x0000000000000f00 + +/* SH_DEBUG_PORT_DEBUG_NIBBLE3 */ +/* Description: Debug port nibble 3 */ +#define SH_DEBUG_PORT_DEBUG_NIBBLE3_SHFT 12 +#define SH_DEBUG_PORT_DEBUG_NIBBLE3_MASK 0x000000000000f000 + +/* SH_DEBUG_PORT_DEBUG_NIBBLE4 */ +/* Description: Debug port nibble 4 */ +#define SH_DEBUG_PORT_DEBUG_NIBBLE4_SHFT 16 +#define SH_DEBUG_PORT_DEBUG_NIBBLE4_MASK 0x00000000000f0000 + +/* SH_DEBUG_PORT_DEBUG_NIBBLE5 */ +/* Description: Debug port nibble 5 */ +#define SH_DEBUG_PORT_DEBUG_NIBBLE5_SHFT 20 +#define SH_DEBUG_PORT_DEBUG_NIBBLE5_MASK 0x0000000000f00000 + +/* SH_DEBUG_PORT_DEBUG_NIBBLE6 */ +/* Description: Debug port nibble 6 */ +#define SH_DEBUG_PORT_DEBUG_NIBBLE6_SHFT 24 +#define SH_DEBUG_PORT_DEBUG_NIBBLE6_MASK 0x000000000f000000 + +/* SH_DEBUG_PORT_DEBUG_NIBBLE7 */ +/* Description: Debug port nibble 7 */ +#define SH_DEBUG_PORT_DEBUG_NIBBLE7_SHFT 28 +#define SH_DEBUG_PORT_DEBUG_NIBBLE7_MASK 0x00000000f0000000 + +/* ==================================================================== */ +/* Register "SH_II_DEBUG_DATA" */ +/* II Debug Data */ +/* ==================================================================== */ + +#define SH_II_DEBUG_DATA 0x0000000110072080 +#define SH_II_DEBUG_DATA_MASK 0x00000000ffffffff +#define SH_II_DEBUG_DATA_INIT 0x0000000000000000 + +/* SH_II_DEBUG_DATA_II_DATA */ +/* Description: II debug data */ +#define SH_II_DEBUG_DATA_II_DATA_SHFT 0 +#define SH_II_DEBUG_DATA_II_DATA_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_II_WRAP_DEBUG_DATA" */ +/* SHub II Wrapper Debug Data */ +/* ==================================================================== */ + +#define SH_II_WRAP_DEBUG_DATA 0x0000000110072100 +#define SH_II_WRAP_DEBUG_DATA_MASK 0x00000000ffffffff +#define SH_II_WRAP_DEBUG_DATA_INIT 0x0000000000000000 + +/* SH_II_WRAP_DEBUG_DATA_II_WRAP_DATA */ +/* Description: II wrapper debug data */ +#define SH_II_WRAP_DEBUG_DATA_II_WRAP_DATA_SHFT 0 +#define SH_II_WRAP_DEBUG_DATA_II_WRAP_DATA_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_LB_DEBUG_DATA" */ +/* SHub LB Debug Data */ +/* ==================================================================== */ + +#define SH_LB_DEBUG_DATA 0x0000000110072180 +#define SH_LB_DEBUG_DATA_MASK 0x00000000ffffffff +#define SH_LB_DEBUG_DATA_INIT 0x0000000000000000 + +/* SH_LB_DEBUG_DATA_LB_DATA */ +/* Description: LB debug data */ +#define SH_LB_DEBUG_DATA_LB_DATA_SHFT 0 +#define SH_LB_DEBUG_DATA_LB_DATA_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DEBUG_DATA" */ +/* SHub MD Debug Data */ +/* ==================================================================== */ + +#define SH_MD_DEBUG_DATA 0x0000000110072200 +#define SH_MD_DEBUG_DATA_MASK 0x00000000ffffffff +#define SH_MD_DEBUG_DATA_INIT 0x0000000000000000 + +/* SH_MD_DEBUG_DATA_MD_DATA */ +/* Description: MD debug data */ +#define SH_MD_DEBUG_DATA_MD_DATA_SHFT 0 +#define SH_MD_DEBUG_DATA_MD_DATA_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_PI_DEBUG_DATA" */ +/* SHub PI Debug Data */ +/* ==================================================================== */ + +#define SH_PI_DEBUG_DATA 0x0000000110072280 +#define SH_PI_DEBUG_DATA_MASK 0x00000000ffffffff +#define SH_PI_DEBUG_DATA_INIT 0x0000000000000000 + +/* SH_PI_DEBUG_DATA_PI_DATA */ +/* Description: PI Debug Data */ +#define SH_PI_DEBUG_DATA_PI_DATA_SHFT 0 +#define SH_PI_DEBUG_DATA_PI_DATA_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_XN_DEBUG_DATA" */ +/* SHub XN Debug Data */ +/* ==================================================================== */ + +#define SH_XN_DEBUG_DATA 0x0000000110072300 +#define SH_XN_DEBUG_DATA_MASK 0x00000000ffffffff +#define SH_XN_DEBUG_DATA_INIT 0x0000000000000000 + +/* SH_XN_DEBUG_DATA_XN_DATA */ +/* Description: XN debug data */ +#define SH_XN_DEBUG_DATA_XN_DATA_SHFT 0 +#define SH_XN_DEBUG_DATA_XN_DATA_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_TSF_ARMED_STATE" */ +/* Trigger sequencing facility arm state */ +/* ==================================================================== */ + +#define SH_TSF_ARMED_STATE 0x0000000110073000 +#define SH_TSF_ARMED_STATE_MASK 0x00000000000000ff +#define SH_TSF_ARMED_STATE_INIT 0x0000000000000000 + +/* SH_TSF_ARMED_STATE_STATE */ +/* Description: Trigger sequencing facility armed state */ +#define SH_TSF_ARMED_STATE_STATE_SHFT 0 +#define SH_TSF_ARMED_STATE_STATE_MASK 0x00000000000000ff + +/* ==================================================================== */ +/* Register "SH_TSF_COUNTER_VALUE" */ +/* Trigger sequencing facility counter value */ +/* ==================================================================== */ + +#define SH_TSF_COUNTER_VALUE 0x0000000110073080 +#define SH_TSF_COUNTER_VALUE_MASK 0xffffffffffffffff +#define SH_TSF_COUNTER_VALUE_INIT 0x0000000000000000 + +/* SH_TSF_COUNTER_VALUE_COUNT_32 */ +/* Description: Trigger sequencing facility counter 32 */ +#define SH_TSF_COUNTER_VALUE_COUNT_32_SHFT 0 +#define SH_TSF_COUNTER_VALUE_COUNT_32_MASK 0x00000000ffffffff + +/* SH_TSF_COUNTER_VALUE_COUNT_16 */ +/* Description: Trigger sequencing facility counter 16 */ +#define SH_TSF_COUNTER_VALUE_COUNT_16_SHFT 32 +#define SH_TSF_COUNTER_VALUE_COUNT_16_MASK 0x0000ffff00000000 + +/* SH_TSF_COUNTER_VALUE_COUNT_8B */ +/* Description: Trigger sequencing facility counter 8b */ +#define SH_TSF_COUNTER_VALUE_COUNT_8B_SHFT 48 +#define SH_TSF_COUNTER_VALUE_COUNT_8B_MASK 0x00ff000000000000 + +/* SH_TSF_COUNTER_VALUE_COUNT_8A */ +/* Description: Trigger sequencing facility counter 8a */ +#define SH_TSF_COUNTER_VALUE_COUNT_8A_SHFT 56 +#define SH_TSF_COUNTER_VALUE_COUNT_8A_MASK 0xff00000000000000 + +/* ==================================================================== */ +/* Register "SH_TSF_TRIGGERED_STATE" */ +/* Trigger sequencing facility triggered state */ +/* ==================================================================== */ + +#define SH_TSF_TRIGGERED_STATE 0x0000000110073100 +#define SH_TSF_TRIGGERED_STATE_MASK 0x00000000000000ff +#define SH_TSF_TRIGGERED_STATE_INIT 0x0000000000000000 + +/* SH_TSF_TRIGGERED_STATE_STATE */ +/* Description: Trigger sequencing facility triggered state */ +#define SH_TSF_TRIGGERED_STATE_STATE_SHFT 0 +#define SH_TSF_TRIGGERED_STATE_STATE_MASK 0x00000000000000ff + +/* ==================================================================== */ +/* Register "SH_VEC_RDDATA" */ +/* Vector Reply Message Data */ +/* ==================================================================== */ + +#define SH_VEC_RDDATA 0x0000000110074000 +#define SH_VEC_RDDATA_MASK 0xffffffffffffffff +#define SH_VEC_RDDATA_INIT 0x0000000000000000 + +/* SH_VEC_RDDATA_DATA */ +/* Description: Data */ +#define SH_VEC_RDDATA_DATA_SHFT 0 +#define SH_VEC_RDDATA_DATA_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_VEC_RETURN" */ +/* Vector Reply Message Return Route */ +/* ==================================================================== */ + +#define SH_VEC_RETURN 0x0000000110074080 +#define SH_VEC_RETURN_MASK 0xffffffffffffffff +#define SH_VEC_RETURN_INIT 0x0000000000000000 + +/* SH_VEC_RETURN_ROUTE */ +/* Description: Route */ +#define SH_VEC_RETURN_ROUTE_SHFT 0 +#define SH_VEC_RETURN_ROUTE_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_VEC_STATUS" */ +/* Vector Reply Message Status */ +/* ==================================================================== */ + +#define SH_VEC_STATUS 0x0000000110074100 +#define SH_VEC_STATUS_MASK 0xcfffffffffffffff +#define SH_VEC_STATUS_INIT 0x0000000000000000 + +/* SH_VEC_STATUS_TYPE */ +/* Description: Type */ +#define SH_VEC_STATUS_TYPE_SHFT 0 +#define SH_VEC_STATUS_TYPE_MASK 0x0000000000000007 + +/* SH_VEC_STATUS_ADDRESS */ +/* Description: Address */ +#define SH_VEC_STATUS_ADDRESS_SHFT 3 +#define SH_VEC_STATUS_ADDRESS_MASK 0x00000007fffffff8 + +/* SH_VEC_STATUS_PIO_ID */ +/* Description: PIO ID */ +#define SH_VEC_STATUS_PIO_ID_SHFT 35 +#define SH_VEC_STATUS_PIO_ID_MASK 0x00003ff800000000 + +/* SH_VEC_STATUS_SOURCE */ +/* Description: Source */ +#define SH_VEC_STATUS_SOURCE_SHFT 46 +#define SH_VEC_STATUS_SOURCE_MASK 0x0fffc00000000000 + +/* SH_VEC_STATUS_OVERRUN */ +/* Description: Overrun */ +#define SH_VEC_STATUS_OVERRUN_SHFT 62 +#define SH_VEC_STATUS_OVERRUN_MASK 0x4000000000000000 + +/* SH_VEC_STATUS_STATUS_VALID */ +/* Description: Status_Valid */ +#define SH_VEC_STATUS_STATUS_VALID_SHFT 63 +#define SH_VEC_STATUS_STATUS_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_VEC_STATUS_ALIAS" */ +/* Vector Reply Message Status Alias */ +/* ==================================================================== */ + +#define SH_VEC_STATUS_ALIAS 0x0000000110074108 + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT0_CONTROL" */ +/* Performance Counter 0 Control */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNT0_CONTROL 0x0000000110080000 +#define SH_PERFORMANCE_COUNT0_CONTROL_MASK 0x000000000007ffff +#define SH_PERFORMANCE_COUNT0_CONTROL_INIT 0x000000000000b8b8 + +/* SH_PERFORMANCE_COUNT0_CONTROL_UP_STIMULUS */ +/* Description: Counter 0 up stimulus */ +#define SH_PERFORMANCE_COUNT0_CONTROL_UP_STIMULUS_SHFT 0 +#define SH_PERFORMANCE_COUNT0_CONTROL_UP_STIMULUS_MASK 0x000000000000001f + +/* SH_PERFORMANCE_COUNT0_CONTROL_UP_EVENT */ +/* Description: Counter 0 up event select (1-greater than, 0-equal) */ +#define SH_PERFORMANCE_COUNT0_CONTROL_UP_EVENT_SHFT 5 +#define SH_PERFORMANCE_COUNT0_CONTROL_UP_EVENT_MASK 0x0000000000000020 + +/* SH_PERFORMANCE_COUNT0_CONTROL_UP_POLARITY */ +/* Description: Counter 0 up polarity select (1-negative edge, 0-po */ +/* sitive edge) */ +#define SH_PERFORMANCE_COUNT0_CONTROL_UP_POLARITY_SHFT 6 +#define SH_PERFORMANCE_COUNT0_CONTROL_UP_POLARITY_MASK 0x0000000000000040 + +/* SH_PERFORMANCE_COUNT0_CONTROL_UP_MODE */ +/* Description: Counter 0 up mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT0_CONTROL_UP_MODE_SHFT 7 +#define SH_PERFORMANCE_COUNT0_CONTROL_UP_MODE_MASK 0x0000000000000080 + +/* SH_PERFORMANCE_COUNT0_CONTROL_DN_STIMULUS */ +/* Description: Counter 0 down stimulus */ +#define SH_PERFORMANCE_COUNT0_CONTROL_DN_STIMULUS_SHFT 8 +#define SH_PERFORMANCE_COUNT0_CONTROL_DN_STIMULUS_MASK 0x0000000000001f00 + +/* SH_PERFORMANCE_COUNT0_CONTROL_DN_EVENT */ +/* Description: Counter 0 down event select (1-greater than, 0-equa */ +#define SH_PERFORMANCE_COUNT0_CONTROL_DN_EVENT_SHFT 13 +#define SH_PERFORMANCE_COUNT0_CONTROL_DN_EVENT_MASK 0x0000000000002000 + +/* SH_PERFORMANCE_COUNT0_CONTROL_DN_POLARITY */ +/* Description: Counter 0 down polarity select (1-negative edge, 0- */ +/* positive edge) */ +#define SH_PERFORMANCE_COUNT0_CONTROL_DN_POLARITY_SHFT 14 +#define SH_PERFORMANCE_COUNT0_CONTROL_DN_POLARITY_MASK 0x0000000000004000 + +/* SH_PERFORMANCE_COUNT0_CONTROL_DN_MODE */ +/* Description: Counter 0 down mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT0_CONTROL_DN_MODE_SHFT 15 +#define SH_PERFORMANCE_COUNT0_CONTROL_DN_MODE_MASK 0x0000000000008000 + +/* SH_PERFORMANCE_COUNT0_CONTROL_INC_ENABLE */ +/* Description: Counter 0 enable increment */ +#define SH_PERFORMANCE_COUNT0_CONTROL_INC_ENABLE_SHFT 16 +#define SH_PERFORMANCE_COUNT0_CONTROL_INC_ENABLE_MASK 0x0000000000010000 + +/* SH_PERFORMANCE_COUNT0_CONTROL_DEC_ENABLE */ +/* Description: Counter 0 enable decrement */ +#define SH_PERFORMANCE_COUNT0_CONTROL_DEC_ENABLE_SHFT 17 +#define SH_PERFORMANCE_COUNT0_CONTROL_DEC_ENABLE_MASK 0x0000000000020000 + +/* SH_PERFORMANCE_COUNT0_CONTROL_PEAK_DET_ENABLE */ +/* Description: Counter 0 enable peak detection */ +#define SH_PERFORMANCE_COUNT0_CONTROL_PEAK_DET_ENABLE_SHFT 18 +#define SH_PERFORMANCE_COUNT0_CONTROL_PEAK_DET_ENABLE_MASK 0x0000000000040000 + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT1_CONTROL" */ +/* Performance Counter 1 Control */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNT1_CONTROL 0x0000000110090000 +#define SH_PERFORMANCE_COUNT1_CONTROL_MASK 0x000000000007ffff +#define SH_PERFORMANCE_COUNT1_CONTROL_INIT 0x000000000000b8b8 + +/* SH_PERFORMANCE_COUNT1_CONTROL_UP_STIMULUS */ +/* Description: Counter 1 up stimulus */ +#define SH_PERFORMANCE_COUNT1_CONTROL_UP_STIMULUS_SHFT 0 +#define SH_PERFORMANCE_COUNT1_CONTROL_UP_STIMULUS_MASK 0x000000000000001f + +/* SH_PERFORMANCE_COUNT1_CONTROL_UP_EVENT */ +/* Description: Counter 1 up event select (1-greater than, 0-equal) */ +#define SH_PERFORMANCE_COUNT1_CONTROL_UP_EVENT_SHFT 5 +#define SH_PERFORMANCE_COUNT1_CONTROL_UP_EVENT_MASK 0x0000000000000020 + +/* SH_PERFORMANCE_COUNT1_CONTROL_UP_POLARITY */ +/* Description: Counter 1 up polarity select (1-negative edge, 0-po */ +/* sitive edge) */ +#define SH_PERFORMANCE_COUNT1_CONTROL_UP_POLARITY_SHFT 6 +#define SH_PERFORMANCE_COUNT1_CONTROL_UP_POLARITY_MASK 0x0000000000000040 + +/* SH_PERFORMANCE_COUNT1_CONTROL_UP_MODE */ +/* Description: Counter 1 up mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT1_CONTROL_UP_MODE_SHFT 7 +#define SH_PERFORMANCE_COUNT1_CONTROL_UP_MODE_MASK 0x0000000000000080 + +/* SH_PERFORMANCE_COUNT1_CONTROL_DN_STIMULUS */ +/* Description: Counter 1 down stimulus */ +#define SH_PERFORMANCE_COUNT1_CONTROL_DN_STIMULUS_SHFT 8 +#define SH_PERFORMANCE_COUNT1_CONTROL_DN_STIMULUS_MASK 0x0000000000001f00 + +/* SH_PERFORMANCE_COUNT1_CONTROL_DN_EVENT */ +/* Description: Counter 1 down event select (1-greater than, 0-equa */ +#define SH_PERFORMANCE_COUNT1_CONTROL_DN_EVENT_SHFT 13 +#define SH_PERFORMANCE_COUNT1_CONTROL_DN_EVENT_MASK 0x0000000000002000 + +/* SH_PERFORMANCE_COUNT1_CONTROL_DN_POLARITY */ +/* Description: Counter 1 down polarity select (1-negative edge, 0- */ +/* positive edge) */ +#define SH_PERFORMANCE_COUNT1_CONTROL_DN_POLARITY_SHFT 14 +#define SH_PERFORMANCE_COUNT1_CONTROL_DN_POLARITY_MASK 0x0000000000004000 + +/* SH_PERFORMANCE_COUNT1_CONTROL_DN_MODE */ +/* Description: Counter 1 down mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT1_CONTROL_DN_MODE_SHFT 15 +#define SH_PERFORMANCE_COUNT1_CONTROL_DN_MODE_MASK 0x0000000000008000 + +/* SH_PERFORMANCE_COUNT1_CONTROL_INC_ENABLE */ +/* Description: Counter 1 enable increment */ +#define SH_PERFORMANCE_COUNT1_CONTROL_INC_ENABLE_SHFT 16 +#define SH_PERFORMANCE_COUNT1_CONTROL_INC_ENABLE_MASK 0x0000000000010000 + +/* SH_PERFORMANCE_COUNT1_CONTROL_DEC_ENABLE */ +/* Description: Counter 1 enable decrement */ +#define SH_PERFORMANCE_COUNT1_CONTROL_DEC_ENABLE_SHFT 17 +#define SH_PERFORMANCE_COUNT1_CONTROL_DEC_ENABLE_MASK 0x0000000000020000 + +/* SH_PERFORMANCE_COUNT1_CONTROL_PEAK_DET_ENABLE */ +/* Description: Counter 1 enable peak detection */ +#define SH_PERFORMANCE_COUNT1_CONTROL_PEAK_DET_ENABLE_SHFT 18 +#define SH_PERFORMANCE_COUNT1_CONTROL_PEAK_DET_ENABLE_MASK 0x0000000000040000 + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT2_CONTROL" */ +/* Performance Counter 2 Control */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNT2_CONTROL 0x00000001100a0000 +#define SH_PERFORMANCE_COUNT2_CONTROL_MASK 0x000000000007ffff +#define SH_PERFORMANCE_COUNT2_CONTROL_INIT 0x000000000000b8b8 + +/* SH_PERFORMANCE_COUNT2_CONTROL_UP_STIMULUS */ +/* Description: Counter 2 up stimulus */ +#define SH_PERFORMANCE_COUNT2_CONTROL_UP_STIMULUS_SHFT 0 +#define SH_PERFORMANCE_COUNT2_CONTROL_UP_STIMULUS_MASK 0x000000000000001f + +/* SH_PERFORMANCE_COUNT2_CONTROL_UP_EVENT */ +/* Description: Counter 2 up event select (1-greater than, 0-equal) */ +#define SH_PERFORMANCE_COUNT2_CONTROL_UP_EVENT_SHFT 5 +#define SH_PERFORMANCE_COUNT2_CONTROL_UP_EVENT_MASK 0x0000000000000020 + +/* SH_PERFORMANCE_COUNT2_CONTROL_UP_POLARITY */ +/* Description: Counter 2 up polarity select (1-negative edge, 0-po */ +/* sitive edge) */ +#define SH_PERFORMANCE_COUNT2_CONTROL_UP_POLARITY_SHFT 6 +#define SH_PERFORMANCE_COUNT2_CONTROL_UP_POLARITY_MASK 0x0000000000000040 + +/* SH_PERFORMANCE_COUNT2_CONTROL_UP_MODE */ +/* Description: Counter 2 up mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT2_CONTROL_UP_MODE_SHFT 7 +#define SH_PERFORMANCE_COUNT2_CONTROL_UP_MODE_MASK 0x0000000000000080 + +/* SH_PERFORMANCE_COUNT2_CONTROL_DN_STIMULUS */ +/* Description: Counter 2 down stimulus */ +#define SH_PERFORMANCE_COUNT2_CONTROL_DN_STIMULUS_SHFT 8 +#define SH_PERFORMANCE_COUNT2_CONTROL_DN_STIMULUS_MASK 0x0000000000001f00 + +/* SH_PERFORMANCE_COUNT2_CONTROL_DN_EVENT */ +/* Description: Counter 2 down event select (1-greater than, 0-equa */ +#define SH_PERFORMANCE_COUNT2_CONTROL_DN_EVENT_SHFT 13 +#define SH_PERFORMANCE_COUNT2_CONTROL_DN_EVENT_MASK 0x0000000000002000 + +/* SH_PERFORMANCE_COUNT2_CONTROL_DN_POLARITY */ +/* Description: Counter 2 down polarity select (1-negative edge, 0- */ +/* positive edge) */ +#define SH_PERFORMANCE_COUNT2_CONTROL_DN_POLARITY_SHFT 14 +#define SH_PERFORMANCE_COUNT2_CONTROL_DN_POLARITY_MASK 0x0000000000004000 + +/* SH_PERFORMANCE_COUNT2_CONTROL_DN_MODE */ +/* Description: Counter 2 down mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT2_CONTROL_DN_MODE_SHFT 15 +#define SH_PERFORMANCE_COUNT2_CONTROL_DN_MODE_MASK 0x0000000000008000 + +/* SH_PERFORMANCE_COUNT2_CONTROL_INC_ENABLE */ +/* Description: Counter 2 enable increment */ +#define SH_PERFORMANCE_COUNT2_CONTROL_INC_ENABLE_SHFT 16 +#define SH_PERFORMANCE_COUNT2_CONTROL_INC_ENABLE_MASK 0x0000000000010000 + +/* SH_PERFORMANCE_COUNT2_CONTROL_DEC_ENABLE */ +/* Description: Counter 2 enable decrement */ +#define SH_PERFORMANCE_COUNT2_CONTROL_DEC_ENABLE_SHFT 17 +#define SH_PERFORMANCE_COUNT2_CONTROL_DEC_ENABLE_MASK 0x0000000000020000 + +/* SH_PERFORMANCE_COUNT2_CONTROL_PEAK_DET_ENABLE */ +/* Description: Counter 2 enable peak detection */ +#define SH_PERFORMANCE_COUNT2_CONTROL_PEAK_DET_ENABLE_SHFT 18 +#define SH_PERFORMANCE_COUNT2_CONTROL_PEAK_DET_ENABLE_MASK 0x0000000000040000 + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT3_CONTROL" */ +/* Performance Counter 3 Control */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNT3_CONTROL 0x00000001100b0000 +#define SH_PERFORMANCE_COUNT3_CONTROL_MASK 0x000000000007ffff +#define SH_PERFORMANCE_COUNT3_CONTROL_INIT 0x000000000000b8b8 + +/* SH_PERFORMANCE_COUNT3_CONTROL_UP_STIMULUS */ +/* Description: Counter 3 up stimulus */ +#define SH_PERFORMANCE_COUNT3_CONTROL_UP_STIMULUS_SHFT 0 +#define SH_PERFORMANCE_COUNT3_CONTROL_UP_STIMULUS_MASK 0x000000000000001f + +/* SH_PERFORMANCE_COUNT3_CONTROL_UP_EVENT */ +/* Description: Counter 3 up event select (1-greater than, 0-equal) */ +#define SH_PERFORMANCE_COUNT3_CONTROL_UP_EVENT_SHFT 5 +#define SH_PERFORMANCE_COUNT3_CONTROL_UP_EVENT_MASK 0x0000000000000020 + +/* SH_PERFORMANCE_COUNT3_CONTROL_UP_POLARITY */ +/* Description: Counter 3 up polarity select (1-negative edge, 0-po */ +/* sitive edge) */ +#define SH_PERFORMANCE_COUNT3_CONTROL_UP_POLARITY_SHFT 6 +#define SH_PERFORMANCE_COUNT3_CONTROL_UP_POLARITY_MASK 0x0000000000000040 + +/* SH_PERFORMANCE_COUNT3_CONTROL_UP_MODE */ +/* Description: Counter 3 up mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT3_CONTROL_UP_MODE_SHFT 7 +#define SH_PERFORMANCE_COUNT3_CONTROL_UP_MODE_MASK 0x0000000000000080 + +/* SH_PERFORMANCE_COUNT3_CONTROL_DN_STIMULUS */ +/* Description: Counter 3 down stimulus */ +#define SH_PERFORMANCE_COUNT3_CONTROL_DN_STIMULUS_SHFT 8 +#define SH_PERFORMANCE_COUNT3_CONTROL_DN_STIMULUS_MASK 0x0000000000001f00 + +/* SH_PERFORMANCE_COUNT3_CONTROL_DN_EVENT */ +/* Description: Counter 3 down event select (1-greater than, 0-equa */ +#define SH_PERFORMANCE_COUNT3_CONTROL_DN_EVENT_SHFT 13 +#define SH_PERFORMANCE_COUNT3_CONTROL_DN_EVENT_MASK 0x0000000000002000 + +/* SH_PERFORMANCE_COUNT3_CONTROL_DN_POLARITY */ +/* Description: Counter 3 down polarity select (1-negative edge, 0- */ +/* positive edge) */ +#define SH_PERFORMANCE_COUNT3_CONTROL_DN_POLARITY_SHFT 14 +#define SH_PERFORMANCE_COUNT3_CONTROL_DN_POLARITY_MASK 0x0000000000004000 + +/* SH_PERFORMANCE_COUNT3_CONTROL_DN_MODE */ +/* Description: Counter 3 down mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT3_CONTROL_DN_MODE_SHFT 15 +#define SH_PERFORMANCE_COUNT3_CONTROL_DN_MODE_MASK 0x0000000000008000 + +/* SH_PERFORMANCE_COUNT3_CONTROL_INC_ENABLE */ +/* Description: Counter 3 enable increment */ +#define SH_PERFORMANCE_COUNT3_CONTROL_INC_ENABLE_SHFT 16 +#define SH_PERFORMANCE_COUNT3_CONTROL_INC_ENABLE_MASK 0x0000000000010000 + +/* SH_PERFORMANCE_COUNT3_CONTROL_DEC_ENABLE */ +/* Description: Counter 3 enable decrement */ +#define SH_PERFORMANCE_COUNT3_CONTROL_DEC_ENABLE_SHFT 17 +#define SH_PERFORMANCE_COUNT3_CONTROL_DEC_ENABLE_MASK 0x0000000000020000 + +/* SH_PERFORMANCE_COUNT3_CONTROL_PEAK_DET_ENABLE */ +/* Description: Counter 3 enable peak detection */ +#define SH_PERFORMANCE_COUNT3_CONTROL_PEAK_DET_ENABLE_SHFT 18 +#define SH_PERFORMANCE_COUNT3_CONTROL_PEAK_DET_ENABLE_MASK 0x0000000000040000 + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT4_CONTROL" */ +/* Performance Counter 4 Control */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNT4_CONTROL 0x00000001100c0000 +#define SH_PERFORMANCE_COUNT4_CONTROL_MASK 0x000000000007ffff +#define SH_PERFORMANCE_COUNT4_CONTROL_INIT 0x000000000000b8b8 + +/* SH_PERFORMANCE_COUNT4_CONTROL_UP_STIMULUS */ +/* Description: Counter 4 up stimulus */ +#define SH_PERFORMANCE_COUNT4_CONTROL_UP_STIMULUS_SHFT 0 +#define SH_PERFORMANCE_COUNT4_CONTROL_UP_STIMULUS_MASK 0x000000000000001f + +/* SH_PERFORMANCE_COUNT4_CONTROL_UP_EVENT */ +/* Description: Counter 4 up event select (1-greater than, 0-equal) */ +#define SH_PERFORMANCE_COUNT4_CONTROL_UP_EVENT_SHFT 5 +#define SH_PERFORMANCE_COUNT4_CONTROL_UP_EVENT_MASK 0x0000000000000020 + +/* SH_PERFORMANCE_COUNT4_CONTROL_UP_POLARITY */ +/* Description: Counter 4 up polarity select (1-negative edge, 0-po */ +/* sitive edge) */ +#define SH_PERFORMANCE_COUNT4_CONTROL_UP_POLARITY_SHFT 6 +#define SH_PERFORMANCE_COUNT4_CONTROL_UP_POLARITY_MASK 0x0000000000000040 + +/* SH_PERFORMANCE_COUNT4_CONTROL_UP_MODE */ +/* Description: Counter 4 up mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT4_CONTROL_UP_MODE_SHFT 7 +#define SH_PERFORMANCE_COUNT4_CONTROL_UP_MODE_MASK 0x0000000000000080 + +/* SH_PERFORMANCE_COUNT4_CONTROL_DN_STIMULUS */ +/* Description: Counter 4 down stimulus */ +#define SH_PERFORMANCE_COUNT4_CONTROL_DN_STIMULUS_SHFT 8 +#define SH_PERFORMANCE_COUNT4_CONTROL_DN_STIMULUS_MASK 0x0000000000001f00 + +/* SH_PERFORMANCE_COUNT4_CONTROL_DN_EVENT */ +/* Description: Counter 4 down event select (1-greater than, 0-equa */ +#define SH_PERFORMANCE_COUNT4_CONTROL_DN_EVENT_SHFT 13 +#define SH_PERFORMANCE_COUNT4_CONTROL_DN_EVENT_MASK 0x0000000000002000 + +/* SH_PERFORMANCE_COUNT4_CONTROL_DN_POLARITY */ +/* Description: Counter 4 down polarity select (1-negative edge, 0- */ +/* positive edge) */ +#define SH_PERFORMANCE_COUNT4_CONTROL_DN_POLARITY_SHFT 14 +#define SH_PERFORMANCE_COUNT4_CONTROL_DN_POLARITY_MASK 0x0000000000004000 + +/* SH_PERFORMANCE_COUNT4_CONTROL_DN_MODE */ +/* Description: Counter 4 down mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT4_CONTROL_DN_MODE_SHFT 15 +#define SH_PERFORMANCE_COUNT4_CONTROL_DN_MODE_MASK 0x0000000000008000 + +/* SH_PERFORMANCE_COUNT4_CONTROL_INC_ENABLE */ +/* Description: Counter 4 enable increment */ +#define SH_PERFORMANCE_COUNT4_CONTROL_INC_ENABLE_SHFT 16 +#define SH_PERFORMANCE_COUNT4_CONTROL_INC_ENABLE_MASK 0x0000000000010000 + +/* SH_PERFORMANCE_COUNT4_CONTROL_DEC_ENABLE */ +/* Description: Counter 4 enable decrement */ +#define SH_PERFORMANCE_COUNT4_CONTROL_DEC_ENABLE_SHFT 17 +#define SH_PERFORMANCE_COUNT4_CONTROL_DEC_ENABLE_MASK 0x0000000000020000 + +/* SH_PERFORMANCE_COUNT4_CONTROL_PEAK_DET_ENABLE */ +/* Description: Counter 4 enable peak detection */ +#define SH_PERFORMANCE_COUNT4_CONTROL_PEAK_DET_ENABLE_SHFT 18 +#define SH_PERFORMANCE_COUNT4_CONTROL_PEAK_DET_ENABLE_MASK 0x0000000000040000 + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT5_CONTROL" */ +/* Performance Counter 5 Control */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNT5_CONTROL 0x00000001100d0000 +#define SH_PERFORMANCE_COUNT5_CONTROL_MASK 0x000000000007ffff +#define SH_PERFORMANCE_COUNT5_CONTROL_INIT 0x000000000000b8b8 + +/* SH_PERFORMANCE_COUNT5_CONTROL_UP_STIMULUS */ +/* Description: Counter 5 up stimulus */ +#define SH_PERFORMANCE_COUNT5_CONTROL_UP_STIMULUS_SHFT 0 +#define SH_PERFORMANCE_COUNT5_CONTROL_UP_STIMULUS_MASK 0x000000000000001f + +/* SH_PERFORMANCE_COUNT5_CONTROL_UP_EVENT */ +/* Description: Counter 5 up event select (1-greater than, 0-equal) */ +#define SH_PERFORMANCE_COUNT5_CONTROL_UP_EVENT_SHFT 5 +#define SH_PERFORMANCE_COUNT5_CONTROL_UP_EVENT_MASK 0x0000000000000020 + +/* SH_PERFORMANCE_COUNT5_CONTROL_UP_POLARITY */ +/* Description: Counter 5 up polarity select (1-negative edge, 0-po */ +/* sitive edge) */ +#define SH_PERFORMANCE_COUNT5_CONTROL_UP_POLARITY_SHFT 6 +#define SH_PERFORMANCE_COUNT5_CONTROL_UP_POLARITY_MASK 0x0000000000000040 + +/* SH_PERFORMANCE_COUNT5_CONTROL_UP_MODE */ +/* Description: Counter 5 up mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT5_CONTROL_UP_MODE_SHFT 7 +#define SH_PERFORMANCE_COUNT5_CONTROL_UP_MODE_MASK 0x0000000000000080 + +/* SH_PERFORMANCE_COUNT5_CONTROL_DN_STIMULUS */ +/* Description: Counter 5 down stimulus */ +#define SH_PERFORMANCE_COUNT5_CONTROL_DN_STIMULUS_SHFT 8 +#define SH_PERFORMANCE_COUNT5_CONTROL_DN_STIMULUS_MASK 0x0000000000001f00 + +/* SH_PERFORMANCE_COUNT5_CONTROL_DN_EVENT */ +/* Description: Counter 5 down event select (1-greater than, 0-equa */ +#define SH_PERFORMANCE_COUNT5_CONTROL_DN_EVENT_SHFT 13 +#define SH_PERFORMANCE_COUNT5_CONTROL_DN_EVENT_MASK 0x0000000000002000 + +/* SH_PERFORMANCE_COUNT5_CONTROL_DN_POLARITY */ +/* Description: Counter 5 down polarity select (1-negative edge, 0- */ +/* positive edge) */ +#define SH_PERFORMANCE_COUNT5_CONTROL_DN_POLARITY_SHFT 14 +#define SH_PERFORMANCE_COUNT5_CONTROL_DN_POLARITY_MASK 0x0000000000004000 + +/* SH_PERFORMANCE_COUNT5_CONTROL_DN_MODE */ +/* Description: Counter 5 down mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT5_CONTROL_DN_MODE_SHFT 15 +#define SH_PERFORMANCE_COUNT5_CONTROL_DN_MODE_MASK 0x0000000000008000 + +/* SH_PERFORMANCE_COUNT5_CONTROL_INC_ENABLE */ +/* Description: Counter 5 enable increment */ +#define SH_PERFORMANCE_COUNT5_CONTROL_INC_ENABLE_SHFT 16 +#define SH_PERFORMANCE_COUNT5_CONTROL_INC_ENABLE_MASK 0x0000000000010000 + +/* SH_PERFORMANCE_COUNT5_CONTROL_DEC_ENABLE */ +/* Description: Counter 5 enable decrement */ +#define SH_PERFORMANCE_COUNT5_CONTROL_DEC_ENABLE_SHFT 17 +#define SH_PERFORMANCE_COUNT5_CONTROL_DEC_ENABLE_MASK 0x0000000000020000 + +/* SH_PERFORMANCE_COUNT5_CONTROL_PEAK_DET_ENABLE */ +/* Description: Counter 5 enable peak detection */ +#define SH_PERFORMANCE_COUNT5_CONTROL_PEAK_DET_ENABLE_SHFT 18 +#define SH_PERFORMANCE_COUNT5_CONTROL_PEAK_DET_ENABLE_MASK 0x0000000000040000 + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT6_CONTROL" */ +/* Performance Counter 6 Control */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNT6_CONTROL 0x00000001100e0000 +#define SH_PERFORMANCE_COUNT6_CONTROL_MASK 0x000000000007ffff +#define SH_PERFORMANCE_COUNT6_CONTROL_INIT 0x000000000000b8b8 + +/* SH_PERFORMANCE_COUNT6_CONTROL_UP_STIMULUS */ +/* Description: Counter 6 up stimulus */ +#define SH_PERFORMANCE_COUNT6_CONTROL_UP_STIMULUS_SHFT 0 +#define SH_PERFORMANCE_COUNT6_CONTROL_UP_STIMULUS_MASK 0x000000000000001f + +/* SH_PERFORMANCE_COUNT6_CONTROL_UP_EVENT */ +/* Description: Counter 6 up event select (1-greater than, 0-equal) */ +#define SH_PERFORMANCE_COUNT6_CONTROL_UP_EVENT_SHFT 5 +#define SH_PERFORMANCE_COUNT6_CONTROL_UP_EVENT_MASK 0x0000000000000020 + +/* SH_PERFORMANCE_COUNT6_CONTROL_UP_POLARITY */ +/* Description: Counter 6 up polarity select (1-negative edge, 0-po */ +/* sitive edge) */ +#define SH_PERFORMANCE_COUNT6_CONTROL_UP_POLARITY_SHFT 6 +#define SH_PERFORMANCE_COUNT6_CONTROL_UP_POLARITY_MASK 0x0000000000000040 + +/* SH_PERFORMANCE_COUNT6_CONTROL_UP_MODE */ +/* Description: Counter 6 up mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT6_CONTROL_UP_MODE_SHFT 7 +#define SH_PERFORMANCE_COUNT6_CONTROL_UP_MODE_MASK 0x0000000000000080 + +/* SH_PERFORMANCE_COUNT6_CONTROL_DN_STIMULUS */ +/* Description: Counter 6 down stimulus */ +#define SH_PERFORMANCE_COUNT6_CONTROL_DN_STIMULUS_SHFT 8 +#define SH_PERFORMANCE_COUNT6_CONTROL_DN_STIMULUS_MASK 0x0000000000001f00 + +/* SH_PERFORMANCE_COUNT6_CONTROL_DN_EVENT */ +/* Description: Counter 6 down event select (1-greater than, 0-equa */ +#define SH_PERFORMANCE_COUNT6_CONTROL_DN_EVENT_SHFT 13 +#define SH_PERFORMANCE_COUNT6_CONTROL_DN_EVENT_MASK 0x0000000000002000 + +/* SH_PERFORMANCE_COUNT6_CONTROL_DN_POLARITY */ +/* Description: Counter 6 down polarity select (1-negative edge, 0- */ +/* positive edge) */ +#define SH_PERFORMANCE_COUNT6_CONTROL_DN_POLARITY_SHFT 14 +#define SH_PERFORMANCE_COUNT6_CONTROL_DN_POLARITY_MASK 0x0000000000004000 + +/* SH_PERFORMANCE_COUNT6_CONTROL_DN_MODE */ +/* Description: Counter 6 down mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT6_CONTROL_DN_MODE_SHFT 15 +#define SH_PERFORMANCE_COUNT6_CONTROL_DN_MODE_MASK 0x0000000000008000 + +/* SH_PERFORMANCE_COUNT6_CONTROL_INC_ENABLE */ +/* Description: Counter 6 enable increment */ +#define SH_PERFORMANCE_COUNT6_CONTROL_INC_ENABLE_SHFT 16 +#define SH_PERFORMANCE_COUNT6_CONTROL_INC_ENABLE_MASK 0x0000000000010000 + +/* SH_PERFORMANCE_COUNT6_CONTROL_DEC_ENABLE */ +/* Description: Counter 6 enable decrement */ +#define SH_PERFORMANCE_COUNT6_CONTROL_DEC_ENABLE_SHFT 17 +#define SH_PERFORMANCE_COUNT6_CONTROL_DEC_ENABLE_MASK 0x0000000000020000 + +/* SH_PERFORMANCE_COUNT6_CONTROL_PEAK_DET_ENABLE */ +/* Description: Counter 6 enable peak detection */ +#define SH_PERFORMANCE_COUNT6_CONTROL_PEAK_DET_ENABLE_SHFT 18 +#define SH_PERFORMANCE_COUNT6_CONTROL_PEAK_DET_ENABLE_MASK 0x0000000000040000 + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT7_CONTROL" */ +/* Performance Counter 7 Control */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNT7_CONTROL 0x00000001100f0000 +#define SH_PERFORMANCE_COUNT7_CONTROL_MASK 0x000000000007ffff +#define SH_PERFORMANCE_COUNT7_CONTROL_INIT 0x000000000000b8b8 + +/* SH_PERFORMANCE_COUNT7_CONTROL_UP_STIMULUS */ +/* Description: Counter 7 up stimulus */ +#define SH_PERFORMANCE_COUNT7_CONTROL_UP_STIMULUS_SHFT 0 +#define SH_PERFORMANCE_COUNT7_CONTROL_UP_STIMULUS_MASK 0x000000000000001f + +/* SH_PERFORMANCE_COUNT7_CONTROL_UP_EVENT */ +/* Description: Counter 7 up event select (1-greater than, 0-equal) */ +#define SH_PERFORMANCE_COUNT7_CONTROL_UP_EVENT_SHFT 5 +#define SH_PERFORMANCE_COUNT7_CONTROL_UP_EVENT_MASK 0x0000000000000020 + +/* SH_PERFORMANCE_COUNT7_CONTROL_UP_POLARITY */ +/* Description: Counter 7 up polarity select (1-negative edge, 0-po */ +/* sitive edge) */ +#define SH_PERFORMANCE_COUNT7_CONTROL_UP_POLARITY_SHFT 6 +#define SH_PERFORMANCE_COUNT7_CONTROL_UP_POLARITY_MASK 0x0000000000000040 + +/* SH_PERFORMANCE_COUNT7_CONTROL_UP_MODE */ +/* Description: Counter 7 up mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT7_CONTROL_UP_MODE_SHFT 7 +#define SH_PERFORMANCE_COUNT7_CONTROL_UP_MODE_MASK 0x0000000000000080 + +/* SH_PERFORMANCE_COUNT7_CONTROL_DN_STIMULUS */ +/* Description: Counter 7 down stimulus */ +#define SH_PERFORMANCE_COUNT7_CONTROL_DN_STIMULUS_SHFT 8 +#define SH_PERFORMANCE_COUNT7_CONTROL_DN_STIMULUS_MASK 0x0000000000001f00 + +/* SH_PERFORMANCE_COUNT7_CONTROL_DN_EVENT */ +/* Description: Counter 7 down event select (1-greater than, 0-equa */ +#define SH_PERFORMANCE_COUNT7_CONTROL_DN_EVENT_SHFT 13 +#define SH_PERFORMANCE_COUNT7_CONTROL_DN_EVENT_MASK 0x0000000000002000 + +/* SH_PERFORMANCE_COUNT7_CONTROL_DN_POLARITY */ +/* Description: Counter 7 down polarity select (1-negative edge, 0- */ +/* positive edge) */ +#define SH_PERFORMANCE_COUNT7_CONTROL_DN_POLARITY_SHFT 14 +#define SH_PERFORMANCE_COUNT7_CONTROL_DN_POLARITY_MASK 0x0000000000004000 + +/* SH_PERFORMANCE_COUNT7_CONTROL_DN_MODE */ +/* Description: Counter 7 down mode select (1-internal, 0-external) */ +#define SH_PERFORMANCE_COUNT7_CONTROL_DN_MODE_SHFT 15 +#define SH_PERFORMANCE_COUNT7_CONTROL_DN_MODE_MASK 0x0000000000008000 + +/* SH_PERFORMANCE_COUNT7_CONTROL_INC_ENABLE */ +/* Description: Counter 7 enable increment */ +#define SH_PERFORMANCE_COUNT7_CONTROL_INC_ENABLE_SHFT 16 +#define SH_PERFORMANCE_COUNT7_CONTROL_INC_ENABLE_MASK 0x0000000000010000 + +/* SH_PERFORMANCE_COUNT7_CONTROL_DEC_ENABLE */ +/* Description: Counter 7 enable decrement */ +#define SH_PERFORMANCE_COUNT7_CONTROL_DEC_ENABLE_SHFT 17 +#define SH_PERFORMANCE_COUNT7_CONTROL_DEC_ENABLE_MASK 0x0000000000020000 + +/* SH_PERFORMANCE_COUNT7_CONTROL_PEAK_DET_ENABLE */ +/* Description: Counter 7 enable peak detection */ +#define SH_PERFORMANCE_COUNT7_CONTROL_PEAK_DET_ENABLE_SHFT 18 +#define SH_PERFORMANCE_COUNT7_CONTROL_PEAK_DET_ENABLE_MASK 0x0000000000040000 + +/* ==================================================================== */ +/* Register "SH_PROFILE_DN_CONTROL" */ +/* Profile Counter Down Control */ +/* ==================================================================== */ + +#define SH_PROFILE_DN_CONTROL 0x0000000110100000 +#define SH_PROFILE_DN_CONTROL_MASK 0x00000000000000ff +#define SH_PROFILE_DN_CONTROL_INIT 0x00000000000000b8 + +/* SH_PROFILE_DN_CONTROL_STIMULUS */ +/* Description: Counter stimulus */ +#define SH_PROFILE_DN_CONTROL_STIMULUS_SHFT 0 +#define SH_PROFILE_DN_CONTROL_STIMULUS_MASK 0x000000000000001f + +/* SH_PROFILE_DN_CONTROL_EVENT */ +/* Description: Counter event select (1-greater than, 0-equal) */ +#define SH_PROFILE_DN_CONTROL_EVENT_SHFT 5 +#define SH_PROFILE_DN_CONTROL_EVENT_MASK 0x0000000000000020 + +/* SH_PROFILE_DN_CONTROL_POLARITY */ +/* Description: Counter polarity select (1-negative edge, 0-positiv */ +/* e edge) */ +#define SH_PROFILE_DN_CONTROL_POLARITY_SHFT 6 +#define SH_PROFILE_DN_CONTROL_POLARITY_MASK 0x0000000000000040 + +/* SH_PROFILE_DN_CONTROL_MODE */ +/* Description: Counter mode select (1-internal, 0-external) */ +#define SH_PROFILE_DN_CONTROL_MODE_SHFT 7 +#define SH_PROFILE_DN_CONTROL_MODE_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_PROFILE_PEAK_CONTROL" */ +/* Profile Counter Peak Control */ +/* ==================================================================== */ + +#define SH_PROFILE_PEAK_CONTROL 0x0000000110100080 +#define SH_PROFILE_PEAK_CONTROL_MASK 0x0000000000000068 +#define SH_PROFILE_PEAK_CONTROL_INIT 0x0000000000000060 + +/* SH_PROFILE_PEAK_CONTROL_STIMULUS */ +/* Description: Counter stimulus */ +#define SH_PROFILE_PEAK_CONTROL_STIMULUS_SHFT 3 +#define SH_PROFILE_PEAK_CONTROL_STIMULUS_MASK 0x0000000000000008 + +/* SH_PROFILE_PEAK_CONTROL_EVENT */ +/* Description: Counter event select (0-greater than, 1-equal) */ +#define SH_PROFILE_PEAK_CONTROL_EVENT_SHFT 5 +#define SH_PROFILE_PEAK_CONTROL_EVENT_MASK 0x0000000000000020 + +/* SH_PROFILE_PEAK_CONTROL_POLARITY */ +/* Description: Counter polarity select (0-negative edge, 1-positiv */ +/* e edge) */ +#define SH_PROFILE_PEAK_CONTROL_POLARITY_SHFT 6 +#define SH_PROFILE_PEAK_CONTROL_POLARITY_MASK 0x0000000000000040 + +/* ==================================================================== */ +/* Register "SH_PROFILE_RANGE" */ +/* Profile Counter Range */ +/* ==================================================================== */ + +#define SH_PROFILE_RANGE 0x0000000110100100 +#define SH_PROFILE_RANGE_MASK 0xffffffffffffffff +#define SH_PROFILE_RANGE_INIT 0x0000000000000000 + +/* SH_PROFILE_RANGE_RANGE0 */ +/* Description: Profiling range 0 */ +#define SH_PROFILE_RANGE_RANGE0_SHFT 0 +#define SH_PROFILE_RANGE_RANGE0_MASK 0x00000000000000ff + +/* SH_PROFILE_RANGE_RANGE1 */ +/* Description: Profiling range 1 */ +#define SH_PROFILE_RANGE_RANGE1_SHFT 8 +#define SH_PROFILE_RANGE_RANGE1_MASK 0x000000000000ff00 + +/* SH_PROFILE_RANGE_RANGE2 */ +/* Description: Profiling range 2 */ +#define SH_PROFILE_RANGE_RANGE2_SHFT 16 +#define SH_PROFILE_RANGE_RANGE2_MASK 0x0000000000ff0000 + +/* SH_PROFILE_RANGE_RANGE3 */ +/* Description: Profiling range 3 */ +#define SH_PROFILE_RANGE_RANGE3_SHFT 24 +#define SH_PROFILE_RANGE_RANGE3_MASK 0x00000000ff000000 + +/* SH_PROFILE_RANGE_RANGE4 */ +/* Description: Profiling range 4 */ +#define SH_PROFILE_RANGE_RANGE4_SHFT 32 +#define SH_PROFILE_RANGE_RANGE4_MASK 0x000000ff00000000 + +/* SH_PROFILE_RANGE_RANGE5 */ +/* Description: Profiling range 5 */ +#define SH_PROFILE_RANGE_RANGE5_SHFT 40 +#define SH_PROFILE_RANGE_RANGE5_MASK 0x0000ff0000000000 + +/* SH_PROFILE_RANGE_RANGE6 */ +/* Description: Profiling range 6 */ +#define SH_PROFILE_RANGE_RANGE6_SHFT 48 +#define SH_PROFILE_RANGE_RANGE6_MASK 0x00ff000000000000 + +/* SH_PROFILE_RANGE_RANGE7 */ +/* Description: Profiling range 7 */ +#define SH_PROFILE_RANGE_RANGE7_SHFT 56 +#define SH_PROFILE_RANGE_RANGE7_MASK 0xff00000000000000 + +/* ==================================================================== */ +/* Register "SH_PROFILE_UP_CONTROL" */ +/* Profile Counter Up Control */ +/* ==================================================================== */ + +#define SH_PROFILE_UP_CONTROL 0x0000000110100180 +#define SH_PROFILE_UP_CONTROL_MASK 0x00000000000000ff +#define SH_PROFILE_UP_CONTROL_INIT 0x00000000000000b8 + +/* SH_PROFILE_UP_CONTROL_STIMULUS */ +/* Description: Counter stimulus */ +#define SH_PROFILE_UP_CONTROL_STIMULUS_SHFT 0 +#define SH_PROFILE_UP_CONTROL_STIMULUS_MASK 0x000000000000001f + +/* SH_PROFILE_UP_CONTROL_EVENT */ +/* Description: Counter event select (1-greater than, 0-equal) */ +#define SH_PROFILE_UP_CONTROL_EVENT_SHFT 5 +#define SH_PROFILE_UP_CONTROL_EVENT_MASK 0x0000000000000020 + +/* SH_PROFILE_UP_CONTROL_POLARITY */ +/* Description: Counter polarity select (1-negative edge, 0-positiv */ +/* e edge) */ +#define SH_PROFILE_UP_CONTROL_POLARITY_SHFT 6 +#define SH_PROFILE_UP_CONTROL_POLARITY_MASK 0x0000000000000040 + +/* SH_PROFILE_UP_CONTROL_MODE */ +/* Description: Counter mode select (1-internal, 0-external) */ +#define SH_PROFILE_UP_CONTROL_MODE_SHFT 7 +#define SH_PROFILE_UP_CONTROL_MODE_MASK 0x0000000000000080 + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER0" */ +/* Performance Counter 0 */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNTER0 0x0000000110110000 +#define SH_PERFORMANCE_COUNTER0_MASK 0x00000000ffffffff +#define SH_PERFORMANCE_COUNTER0_INIT 0x0000000000000000 + +/* SH_PERFORMANCE_COUNTER0_COUNT */ +/* Description: Counter 0 */ +#define SH_PERFORMANCE_COUNTER0_COUNT_SHFT 0 +#define SH_PERFORMANCE_COUNTER0_COUNT_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER1" */ +/* Performance Counter 1 */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNTER1 0x0000000110120000 +#define SH_PERFORMANCE_COUNTER1_MASK 0x00000000ffffffff +#define SH_PERFORMANCE_COUNTER1_INIT 0x0000000000000000 + +/* SH_PERFORMANCE_COUNTER1_COUNT */ +/* Description: Counter 1 */ +#define SH_PERFORMANCE_COUNTER1_COUNT_SHFT 0 +#define SH_PERFORMANCE_COUNTER1_COUNT_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER2" */ +/* Performance Counter 2 */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNTER2 0x0000000110130000 +#define SH_PERFORMANCE_COUNTER2_MASK 0x00000000ffffffff +#define SH_PERFORMANCE_COUNTER2_INIT 0x0000000000000000 + +/* SH_PERFORMANCE_COUNTER2_COUNT */ +/* Description: Counter 2 */ +#define SH_PERFORMANCE_COUNTER2_COUNT_SHFT 0 +#define SH_PERFORMANCE_COUNTER2_COUNT_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER3" */ +/* Performance Counter 3 */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNTER3 0x0000000110140000 +#define SH_PERFORMANCE_COUNTER3_MASK 0x00000000ffffffff +#define SH_PERFORMANCE_COUNTER3_INIT 0x0000000000000000 + +/* SH_PERFORMANCE_COUNTER3_COUNT */ +/* Description: Counter 3 */ +#define SH_PERFORMANCE_COUNTER3_COUNT_SHFT 0 +#define SH_PERFORMANCE_COUNTER3_COUNT_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER4" */ +/* Performance Counter 4 */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNTER4 0x0000000110150000 +#define SH_PERFORMANCE_COUNTER4_MASK 0x00000000ffffffff +#define SH_PERFORMANCE_COUNTER4_INIT 0x0000000000000000 + +/* SH_PERFORMANCE_COUNTER4_COUNT */ +/* Description: Counter 4 */ +#define SH_PERFORMANCE_COUNTER4_COUNT_SHFT 0 +#define SH_PERFORMANCE_COUNTER4_COUNT_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER5" */ +/* Performance Counter 5 */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNTER5 0x0000000110160000 +#define SH_PERFORMANCE_COUNTER5_MASK 0x00000000ffffffff +#define SH_PERFORMANCE_COUNTER5_INIT 0x0000000000000000 + +/* SH_PERFORMANCE_COUNTER5_COUNT */ +/* Description: Counter 5 */ +#define SH_PERFORMANCE_COUNTER5_COUNT_SHFT 0 +#define SH_PERFORMANCE_COUNTER5_COUNT_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER6" */ +/* Performance Counter 6 */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNTER6 0x0000000110170000 +#define SH_PERFORMANCE_COUNTER6_MASK 0x00000000ffffffff +#define SH_PERFORMANCE_COUNTER6_INIT 0x0000000000000000 + +/* SH_PERFORMANCE_COUNTER6_COUNT */ +/* Description: Counter 6 */ +#define SH_PERFORMANCE_COUNTER6_COUNT_SHFT 0 +#define SH_PERFORMANCE_COUNTER6_COUNT_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER7" */ +/* Performance Counter 7 */ +/* ==================================================================== */ + +#define SH_PERFORMANCE_COUNTER7 0x0000000110180000 +#define SH_PERFORMANCE_COUNTER7_MASK 0x00000000ffffffff +#define SH_PERFORMANCE_COUNTER7_INIT 0x0000000000000000 + +/* SH_PERFORMANCE_COUNTER7_COUNT */ +/* Description: Counter 7 */ +#define SH_PERFORMANCE_COUNTER7_COUNT_SHFT 0 +#define SH_PERFORMANCE_COUNTER7_COUNT_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_PROFILE_COUNTER" */ +/* Profile Counter */ +/* ==================================================================== */ + +#define SH_PROFILE_COUNTER 0x0000000110190000 +#define SH_PROFILE_COUNTER_MASK 0x00000000000000ff +#define SH_PROFILE_COUNTER_INIT 0x0000000000000000 + +/* SH_PROFILE_COUNTER_COUNTER */ +/* Description: Counter Value */ +#define SH_PROFILE_COUNTER_COUNTER_SHFT 0 +#define SH_PROFILE_COUNTER_COUNTER_MASK 0x00000000000000ff + +/* ==================================================================== */ +/* Register "SH_PROFILE_PEAK" */ +/* Profile Peak Counter */ +/* ==================================================================== */ + +#define SH_PROFILE_PEAK 0x0000000110190080 +#define SH_PROFILE_PEAK_MASK 0x00000000000000ff +#define SH_PROFILE_PEAK_INIT 0x0000000000000000 + +/* SH_PROFILE_PEAK_COUNTER */ +/* Description: Counter Value */ +#define SH_PROFILE_PEAK_COUNTER_SHFT 0 +#define SH_PROFILE_PEAK_COUNTER_MASK 0x00000000000000ff + +/* ==================================================================== */ +/* Register "SH_PTC_0" */ +/* Puge Translation Cache Message Configuration Information */ +/* ==================================================================== */ + +#define SH_PTC_0 0x00000001101a0000 +#define SH_PTC_0_MASK 0x80000000fffffffd +#define SH_PTC_0_INIT 0x0000000000000000 + +/* SH_PTC_0_A */ +/* Description: Type */ +#define SH_PTC_0_A_SHFT 0 +#define SH_PTC_0_A_MASK 0x0000000000000001 + +/* SH_PTC_0_PS */ +/* Description: Page Size */ +#define SH_PTC_0_PS_SHFT 2 +#define SH_PTC_0_PS_MASK 0x00000000000000fc + +/* SH_PTC_0_RID */ +/* Description: Region ID */ +#define SH_PTC_0_RID_SHFT 8 +#define SH_PTC_0_RID_MASK 0x00000000ffffff00 + +/* SH_PTC_0_START */ +/* Description: Start */ +#define SH_PTC_0_START_SHFT 63 +#define SH_PTC_0_START_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PTC_1" */ +/* Puge Translation Cache Message Configuration Information */ +/* ==================================================================== */ + +#define SH_PTC_1 0x00000001101a0080 +#define SH_PTC_1_MASK 0x9ffffffffffff000 +#define SH_PTC_1_INIT 0x0000000000000000 + +/* SH_PTC_1_VPN */ +/* Description: Virtual page number */ +#define SH_PTC_1_VPN_SHFT 12 +#define SH_PTC_1_VPN_MASK 0x1ffffffffffff000 + +/* SH_PTC_1_START */ +/* Description: PTC_1 Start */ +#define SH_PTC_1_START_SHFT 63 +#define SH_PTC_1_START_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PTC_PARMS" */ +/* PTC Time-out parmaeters */ +/* ==================================================================== */ + +#define SH_PTC_PARMS 0x00000001101a0100 +#define SH_PTC_PARMS_MASK 0x0000000fffffffff +#define SH_PTC_PARMS_INIT 0x00000007ffffffff + +/* SH_PTC_PARMS_PTC_TO_WRAP */ +/* Description: PTC time-out period */ +#define SH_PTC_PARMS_PTC_TO_WRAP_SHFT 0 +#define SH_PTC_PARMS_PTC_TO_WRAP_MASK 0x0000000000ffffff + +/* SH_PTC_PARMS_PTC_TO_VAL */ +/* Description: PTC time-out valid */ +#define SH_PTC_PARMS_PTC_TO_VAL_SHFT 24 +#define SH_PTC_PARMS_PTC_TO_VAL_MASK 0x0000000fff000000 + +/* ==================================================================== */ +/* Register "SH_INT_CMPA" */ +/* RTC Compare Value for Processor A */ +/* ==================================================================== */ + +#define SH_INT_CMPA 0x00000001101b0000 +#define SH_INT_CMPA_MASK 0x007fffffffffffff +#define SH_INT_CMPA_INIT 0x0000000000000000 + +/* SH_INT_CMPA_REAL_TIME_CMPA */ +/* Description: Real Time Clock Compare */ +#define SH_INT_CMPA_REAL_TIME_CMPA_SHFT 0 +#define SH_INT_CMPA_REAL_TIME_CMPA_MASK 0x007fffffffffffff + +/* ==================================================================== */ +/* Register "SH_INT_CMPB" */ +/* RTC Compare Value for Processor B */ +/* ==================================================================== */ + +#define SH_INT_CMPB 0x00000001101b0080 +#define SH_INT_CMPB_MASK 0x007fffffffffffff +#define SH_INT_CMPB_INIT 0x0000000000000000 + +/* SH_INT_CMPB_REAL_TIME_CMPB */ +/* Description: Real Time Clock Compare */ +#define SH_INT_CMPB_REAL_TIME_CMPB_SHFT 0 +#define SH_INT_CMPB_REAL_TIME_CMPB_MASK 0x007fffffffffffff + +/* ==================================================================== */ +/* Register "SH_INT_CMPC" */ +/* RTC Compare Value for Processor C */ +/* ==================================================================== */ + +#define SH_INT_CMPC 0x00000001101b0100 +#define SH_INT_CMPC_MASK 0x007fffffffffffff +#define SH_INT_CMPC_INIT 0x0000000000000000 + +/* SH_INT_CMPC_REAL_TIME_CMPC */ +/* Description: Real Time Clock Compare */ +#define SH_INT_CMPC_REAL_TIME_CMPC_SHFT 0 +#define SH_INT_CMPC_REAL_TIME_CMPC_MASK 0x007fffffffffffff + +/* ==================================================================== */ +/* Register "SH_INT_CMPD" */ +/* RTC Compare Value for Processor D */ +/* ==================================================================== */ + +#define SH_INT_CMPD 0x00000001101b0180 +#define SH_INT_CMPD_MASK 0x007fffffffffffff +#define SH_INT_CMPD_INIT 0x0000000000000000 + +/* SH_INT_CMPD_REAL_TIME_CMPD */ +/* Description: Real Time Clock Compare */ +#define SH_INT_CMPD_REAL_TIME_CMPD_SHFT 0 +#define SH_INT_CMPD_REAL_TIME_CMPD_MASK 0x007fffffffffffff + +/* ==================================================================== */ +/* Register "SH_INT_PROF" */ +/* Profile Compare Registers */ +/* ==================================================================== */ + +#define SH_INT_PROF 0x00000001101b0200 +#define SH_INT_PROF_MASK 0x00000000ffffffff +#define SH_INT_PROF_INIT 0x0000000000000000 + +/* SH_INT_PROF_PROFILE_COMPARE */ +/* Description: Profile Compare */ +#define SH_INT_PROF_PROFILE_COMPARE_SHFT 0 +#define SH_INT_PROF_PROFILE_COMPARE_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_RTC" */ +/* Real-time Clock */ +/* ==================================================================== */ + +#define SH_RTC 0x00000001101c0000 +#define SH_RTC_MASK 0x007fffffffffffff +#define SH_RTC_INIT 0x0000000000000000 + +/* SH_RTC_REAL_TIME_CLOCK */ +/* Description: Real-time Clock */ +#define SH_RTC_REAL_TIME_CLOCK_SHFT 0 +#define SH_RTC_REAL_TIME_CLOCK_MASK 0x007fffffffffffff + +/* ==================================================================== */ +/* Register "SH_SCRATCH0" */ +/* Scratch Register 0 */ +/* ==================================================================== */ + +#define SH_SCRATCH0 0x00000001101d0000 +#define SH_SCRATCH0_MASK 0xffffffffffffffff +#define SH_SCRATCH0_INIT 0x0000000000000000 + +/* SH_SCRATCH0_SCRATCH0 */ +/* Description: Scratch register 0 */ +#define SH_SCRATCH0_SCRATCH0_SHFT 0 +#define SH_SCRATCH0_SCRATCH0_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_SCRATCH0_ALIAS" */ +/* Scratch Register 0 Alias Address */ +/* ==================================================================== */ + +#define SH_SCRATCH0_ALIAS 0x00000001101d0008 + +/* ==================================================================== */ +/* Register "SH_SCRATCH1" */ +/* Scratch Register 1 */ +/* ==================================================================== */ + +#define SH_SCRATCH1 0x00000001101d0080 +#define SH_SCRATCH1_MASK 0xffffffffffffffff +#define SH_SCRATCH1_INIT 0x0000000000000000 + +/* SH_SCRATCH1_SCRATCH1 */ +/* Description: Scratch register 1 */ +#define SH_SCRATCH1_SCRATCH1_SHFT 0 +#define SH_SCRATCH1_SCRATCH1_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_SCRATCH1_ALIAS" */ +/* Scratch Register 1 Alias Address */ +/* ==================================================================== */ + +#define SH_SCRATCH1_ALIAS 0x00000001101d0088 + +/* ==================================================================== */ +/* Register "SH_SCRATCH2" */ +/* Scratch Register 2 */ +/* ==================================================================== */ + +#define SH_SCRATCH2 0x00000001101d0100 +#define SH_SCRATCH2_MASK 0xffffffffffffffff +#define SH_SCRATCH2_INIT 0x0000000000000000 + +/* SH_SCRATCH2_SCRATCH2 */ +/* Description: Scratch register 2 */ +#define SH_SCRATCH2_SCRATCH2_SHFT 0 +#define SH_SCRATCH2_SCRATCH2_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_SCRATCH2_ALIAS" */ +/* Scratch Register 2 Alias Address */ +/* ==================================================================== */ + +#define SH_SCRATCH2_ALIAS 0x00000001101d0108 + +/* ==================================================================== */ +/* Register "SH_SCRATCH3" */ +/* Scratch Register 3 */ +/* ==================================================================== */ + +#define SH_SCRATCH3 0x00000001101d0180 +#define SH_SCRATCH3_MASK 0x0000000000000001 +#define SH_SCRATCH3_INIT 0x0000000000000000 + +/* SH_SCRATCH3_SCRATCH3 */ +/* Description: Scratch register 3 */ +#define SH_SCRATCH3_SCRATCH3_SHFT 0 +#define SH_SCRATCH3_SCRATCH3_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_SCRATCH3_ALIAS" */ +/* Scratch Register 3 Alias Address */ +/* ==================================================================== */ + +#define SH_SCRATCH3_ALIAS 0x00000001101d0188 + +/* ==================================================================== */ +/* Register "SH_SCRATCH4" */ +/* Scratch Register 4 */ +/* ==================================================================== */ + +#define SH_SCRATCH4 0x00000001101d0200 +#define SH_SCRATCH4_MASK 0x0000000000000001 +#define SH_SCRATCH4_INIT 0x0000000000000000 + +/* SH_SCRATCH4_SCRATCH4 */ +/* Description: Scratch register 4 */ +#define SH_SCRATCH4_SCRATCH4_SHFT 0 +#define SH_SCRATCH4_SCRATCH4_MASK 0x0000000000000001 + +/* ==================================================================== */ +/* Register "SH_SCRATCH4_ALIAS" */ +/* Scratch Register 4 Alias Address */ +/* ==================================================================== */ + +#define SH_SCRATCH4_ALIAS 0x00000001101d0208 + +/* ==================================================================== */ +/* Register "SH_CRB_MESSAGE_CONTROL" */ +/* Coherent Request Buffer Message Control */ +/* ==================================================================== */ + +#define SH_CRB_MESSAGE_CONTROL 0x0000000120000000 +#define SH_CRB_MESSAGE_CONTROL_MASK 0xffffffff00000fff +#define SH_CRB_MESSAGE_CONTROL_INIT 0x0000000000000006 + +/* SH_CRB_MESSAGE_CONTROL_SYSTEM_COHERENCE_ENABLE */ +/* Description: System Coherence Enabled */ +#define SH_CRB_MESSAGE_CONTROL_SYSTEM_COHERENCE_ENABLE_SHFT 0 +#define SH_CRB_MESSAGE_CONTROL_SYSTEM_COHERENCE_ENABLE_MASK 0x0000000000000001 + +/* SH_CRB_MESSAGE_CONTROL_LOCAL_SPECULATIVE_MESSAGE_ENABLE */ +/* Description: Speculative Read Requests to Local Memory Enabled */ +#define SH_CRB_MESSAGE_CONTROL_LOCAL_SPECULATIVE_MESSAGE_ENABLE_SHFT 1 +#define SH_CRB_MESSAGE_CONTROL_LOCAL_SPECULATIVE_MESSAGE_ENABLE_MASK 0x0000000000000002 + +/* SH_CRB_MESSAGE_CONTROL_REMOTE_SPECULATIVE_MESSAGE_ENABLE */ +/* Description: Speculative Read Requests to Remote Memory Enabled */ +#define SH_CRB_MESSAGE_CONTROL_REMOTE_SPECULATIVE_MESSAGE_ENABLE_SHFT 2 +#define SH_CRB_MESSAGE_CONTROL_REMOTE_SPECULATIVE_MESSAGE_ENABLE_MASK 0x0000000000000004 + +/* SH_CRB_MESSAGE_CONTROL_MESSAGE_COLOR */ +/* Description: Define color of message */ +#define SH_CRB_MESSAGE_CONTROL_MESSAGE_COLOR_SHFT 3 +#define SH_CRB_MESSAGE_CONTROL_MESSAGE_COLOR_MASK 0x0000000000000008 + +/* SH_CRB_MESSAGE_CONTROL_MESSAGE_COLOR_ENABLE */ +/* Description: Enable color message processing */ +#define SH_CRB_MESSAGE_CONTROL_MESSAGE_COLOR_ENABLE_SHFT 4 +#define SH_CRB_MESSAGE_CONTROL_MESSAGE_COLOR_ENABLE_MASK 0x0000000000000010 + +/* SH_CRB_MESSAGE_CONTROL_RRB_ATTRIBUTE_MISMATCH_FSB_ENABLE */ +/* Description: Enable FSB RRB Mismatch check */ +#define SH_CRB_MESSAGE_CONTROL_RRB_ATTRIBUTE_MISMATCH_FSB_ENABLE_SHFT 5 +#define SH_CRB_MESSAGE_CONTROL_RRB_ATTRIBUTE_MISMATCH_FSB_ENABLE_MASK 0x0000000000000020 + +/* SH_CRB_MESSAGE_CONTROL_WRB_ATTRIBUTE_MISMATCH_FSB_ENABLE */ +/* Description: Enable FSB WRB Mismatch check */ +#define SH_CRB_MESSAGE_CONTROL_WRB_ATTRIBUTE_MISMATCH_FSB_ENABLE_SHFT 6 +#define SH_CRB_MESSAGE_CONTROL_WRB_ATTRIBUTE_MISMATCH_FSB_ENABLE_MASK 0x0000000000000040 + +/* SH_CRB_MESSAGE_CONTROL_IRB_ATTRIBUTE_MISMATCH_FSB_ENABLE */ +/* Description: Enable FSB IRB Mismatch check */ +#define SH_CRB_MESSAGE_CONTROL_IRB_ATTRIBUTE_MISMATCH_FSB_ENABLE_SHFT 7 +#define SH_CRB_MESSAGE_CONTROL_IRB_ATTRIBUTE_MISMATCH_FSB_ENABLE_MASK 0x0000000000000080 + +/* SH_CRB_MESSAGE_CONTROL_RRB_ATTRIBUTE_MISMATCH_XB_ENABLE */ +/* Description: Enable XB RRB Mismatch check */ +#define SH_CRB_MESSAGE_CONTROL_RRB_ATTRIBUTE_MISMATCH_XB_ENABLE_SHFT 8 +#define SH_CRB_MESSAGE_CONTROL_RRB_ATTRIBUTE_MISMATCH_XB_ENABLE_MASK 0x0000000000000100 + +/* SH_CRB_MESSAGE_CONTROL_WRB_ATTRIBUTE_MISMATCH_XB_ENABLE */ +/* Description: Enable XB WRB Mismatch check */ +#define SH_CRB_MESSAGE_CONTROL_WRB_ATTRIBUTE_MISMATCH_XB_ENABLE_SHFT 9 +#define SH_CRB_MESSAGE_CONTROL_WRB_ATTRIBUTE_MISMATCH_XB_ENABLE_MASK 0x0000000000000200 + +/* SH_CRB_MESSAGE_CONTROL_SUPPRESS_BOGUS_WRITES */ +/* Description: ignor residual write data */ +#define SH_CRB_MESSAGE_CONTROL_SUPPRESS_BOGUS_WRITES_SHFT 10 +#define SH_CRB_MESSAGE_CONTROL_SUPPRESS_BOGUS_WRITES_MASK 0x0000000000000400 + +/* SH_CRB_MESSAGE_CONTROL_ENABLE_IVACK_CONSOLIDATION */ +/* Description: enable IVACK reply consolidation */ +#define SH_CRB_MESSAGE_CONTROL_ENABLE_IVACK_CONSOLIDATION_SHFT 11 +#define SH_CRB_MESSAGE_CONTROL_ENABLE_IVACK_CONSOLIDATION_MASK 0x0000000000000800 + +/* SH_CRB_MESSAGE_CONTROL_IVACK_STALL_COUNT */ +/* Description: IVACK stall counter */ +#define SH_CRB_MESSAGE_CONTROL_IVACK_STALL_COUNT_SHFT 32 +#define SH_CRB_MESSAGE_CONTROL_IVACK_STALL_COUNT_MASK 0x0000ffff00000000 + +/* SH_CRB_MESSAGE_CONTROL_IVACK_THROTTLE_CONTROL */ +/* Description: IVACK throttling limit/timer control */ +#define SH_CRB_MESSAGE_CONTROL_IVACK_THROTTLE_CONTROL_SHFT 48 +#define SH_CRB_MESSAGE_CONTROL_IVACK_THROTTLE_CONTROL_MASK 0xffff000000000000 + +/* ==================================================================== */ +/* Register "SH_CRB_NACK_LIMIT" */ +/* CRB Nack Limit */ +/* ==================================================================== */ + +#define SH_CRB_NACK_LIMIT 0x0000000120000080 +#define SH_CRB_NACK_LIMIT_MASK 0x800000000000ffff +#define SH_CRB_NACK_LIMIT_INIT 0x0000000000000000 + +/* SH_CRB_NACK_LIMIT_LIMIT */ +/* Description: Nack Count Limit */ +#define SH_CRB_NACK_LIMIT_LIMIT_SHFT 0 +#define SH_CRB_NACK_LIMIT_LIMIT_MASK 0x0000000000000fff + +/* SH_CRB_NACK_LIMIT_PRI_FREQ */ +/* Description: Frequency at which priority count is incremented */ +#define SH_CRB_NACK_LIMIT_PRI_FREQ_SHFT 12 +#define SH_CRB_NACK_LIMIT_PRI_FREQ_MASK 0x000000000000f000 + +/* SH_CRB_NACK_LIMIT_ENABLE */ +/* Description: Enable NACK limit detection */ +#define SH_CRB_NACK_LIMIT_ENABLE_SHFT 63 +#define SH_CRB_NACK_LIMIT_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_CRB_TIMEOUT_PRESCALE" */ +/* Coherent Request Buffer Timeout Prescale */ +/* ==================================================================== */ + +#define SH_CRB_TIMEOUT_PRESCALE 0x0000000120000100 +#define SH_CRB_TIMEOUT_PRESCALE_MASK 0x00000000ffffffff +#define SH_CRB_TIMEOUT_PRESCALE_INIT 0x0000000000000000 + +/* SH_CRB_TIMEOUT_PRESCALE_SCALING_FACTOR */ +/* Description: CRB Time-out Prescale Factor */ +#define SH_CRB_TIMEOUT_PRESCALE_SCALING_FACTOR_SHFT 0 +#define SH_CRB_TIMEOUT_PRESCALE_SCALING_FACTOR_MASK 0x00000000ffffffff + +/* ==================================================================== */ +/* Register "SH_CRB_TIMEOUT_SKID" */ +/* Coherent Request Buffer Timeout Skid Limit */ +/* ==================================================================== */ + +#define SH_CRB_TIMEOUT_SKID 0x0000000120000180 +#define SH_CRB_TIMEOUT_SKID_MASK 0x800000000000003f +#define SH_CRB_TIMEOUT_SKID_INIT 0x0000000000000007 + +/* SH_CRB_TIMEOUT_SKID_SKID */ +/* Description: CRB Time-out Skid */ +#define SH_CRB_TIMEOUT_SKID_SKID_SHFT 0 +#define SH_CRB_TIMEOUT_SKID_SKID_MASK 0x000000000000003f + +/* SH_CRB_TIMEOUT_SKID_RESET_SKID_COUNT */ +/* Description: Reset Skid counter */ +#define SH_CRB_TIMEOUT_SKID_RESET_SKID_COUNT_SHFT 63 +#define SH_CRB_TIMEOUT_SKID_RESET_SKID_COUNT_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_MEMORY_WRITE_STATUS_0" */ +/* Memory Write Status for CPU 0 */ +/* ==================================================================== */ + +#define SH_MEMORY_WRITE_STATUS_0 0x0000000120070000 +#define SH_MEMORY_WRITE_STATUS_0_MASK 0x000000000000003f +#define SH_MEMORY_WRITE_STATUS_0_INIT 0x0000000000000000 + +/* SH_MEMORY_WRITE_STATUS_0_PENDING_WRITE_COUNT */ +/* Description: Pending Write Count */ +#define SH_MEMORY_WRITE_STATUS_0_PENDING_WRITE_COUNT_SHFT 0 +#define SH_MEMORY_WRITE_STATUS_0_PENDING_WRITE_COUNT_MASK 0x000000000000003f + +/* ==================================================================== */ +/* Register "SH_MEMORY_WRITE_STATUS_1" */ +/* Memory Write Status for CPU 1 */ +/* ==================================================================== */ + +#define SH_MEMORY_WRITE_STATUS_1 0x0000000120070080 +#define SH_MEMORY_WRITE_STATUS_1_MASK 0x000000000000003f +#define SH_MEMORY_WRITE_STATUS_1_INIT 0x0000000000000000 + +/* SH_MEMORY_WRITE_STATUS_1_PENDING_WRITE_COUNT */ +/* Description: Pending Write Count */ +#define SH_MEMORY_WRITE_STATUS_1_PENDING_WRITE_COUNT_SHFT 0 +#define SH_MEMORY_WRITE_STATUS_1_PENDING_WRITE_COUNT_MASK 0x000000000000003f + +/* ==================================================================== */ +/* Register "SH_PIO_WRITE_STATUS_0" */ +/* PIO Write Status for CPU 0 */ +/* ==================================================================== */ + +#define SH_PIO_WRITE_STATUS_0 0x0000000120070200 +#define SH_PIO_WRITE_STATUS_0_MASK 0xbf03ffffffffffff +#define SH_PIO_WRITE_STATUS_0_INIT 0x8000000000000000 + +/* SH_PIO_WRITE_STATUS_0_MULTI_WRITE_ERROR */ +/* Description: More than one PIO write error occured */ +#define SH_PIO_WRITE_STATUS_0_MULTI_WRITE_ERROR_SHFT 0 +#define SH_PIO_WRITE_STATUS_0_MULTI_WRITE_ERROR_MASK 0x0000000000000001 + +/* SH_PIO_WRITE_STATUS_0_WRITE_DEADLOCK */ +/* Description: Deaklock response detected */ +#define SH_PIO_WRITE_STATUS_0_WRITE_DEADLOCK_SHFT 1 +#define SH_PIO_WRITE_STATUS_0_WRITE_DEADLOCK_MASK 0x0000000000000002 + +/* SH_PIO_WRITE_STATUS_0_WRITE_ERROR */ +/* Description: Error response detected */ +#define SH_PIO_WRITE_STATUS_0_WRITE_ERROR_SHFT 2 +#define SH_PIO_WRITE_STATUS_0_WRITE_ERROR_MASK 0x0000000000000004 + +/* SH_PIO_WRITE_STATUS_0_WRITE_ERROR_ADDRESS */ +/* Description: Address associated with error response */ +#define SH_PIO_WRITE_STATUS_0_WRITE_ERROR_ADDRESS_SHFT 3 +#define SH_PIO_WRITE_STATUS_0_WRITE_ERROR_ADDRESS_MASK 0x0003fffffffffff8 + +/* SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT */ +/* Description: Count of currently pending PIO writes */ +#define SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT_SHFT 56 +#define SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT_MASK 0x3f00000000000000 + +/* SH_PIO_WRITE_STATUS_0_WRITES_OK */ +/* Description: No pending writes or errors */ +#define SH_PIO_WRITE_STATUS_0_WRITES_OK_SHFT 63 +#define SH_PIO_WRITE_STATUS_0_WRITES_OK_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PIO_WRITE_STATUS_1" */ +/* PIO Write Status for CPU 1 */ +/* ==================================================================== */ + +#define SH_PIO_WRITE_STATUS_1 0x0000000120070280 +#define SH_PIO_WRITE_STATUS_1_MASK 0xbf03ffffffffffff +#define SH_PIO_WRITE_STATUS_1_INIT 0x8000000000000000 + +/* SH_PIO_WRITE_STATUS_1_MULTI_WRITE_ERROR */ +/* Description: More than one PIO write error occured */ +#define SH_PIO_WRITE_STATUS_1_MULTI_WRITE_ERROR_SHFT 0 +#define SH_PIO_WRITE_STATUS_1_MULTI_WRITE_ERROR_MASK 0x0000000000000001 + +/* SH_PIO_WRITE_STATUS_1_WRITE_DEADLOCK */ +/* Description: Deaklock response detected */ +#define SH_PIO_WRITE_STATUS_1_WRITE_DEADLOCK_SHFT 1 +#define SH_PIO_WRITE_STATUS_1_WRITE_DEADLOCK_MASK 0x0000000000000002 + +/* SH_PIO_WRITE_STATUS_1_WRITE_ERROR */ +/* Description: Error response detected */ +#define SH_PIO_WRITE_STATUS_1_WRITE_ERROR_SHFT 2 +#define SH_PIO_WRITE_STATUS_1_WRITE_ERROR_MASK 0x0000000000000004 + +/* SH_PIO_WRITE_STATUS_1_WRITE_ERROR_ADDRESS */ +/* Description: Address associated with error response */ +#define SH_PIO_WRITE_STATUS_1_WRITE_ERROR_ADDRESS_SHFT 3 +#define SH_PIO_WRITE_STATUS_1_WRITE_ERROR_ADDRESS_MASK 0x0003fffffffffff8 + +/* SH_PIO_WRITE_STATUS_1_PENDING_WRITE_COUNT */ +/* Description: Count of currently pending PIO writes */ +#define SH_PIO_WRITE_STATUS_1_PENDING_WRITE_COUNT_SHFT 56 +#define SH_PIO_WRITE_STATUS_1_PENDING_WRITE_COUNT_MASK 0x3f00000000000000 + +/* SH_PIO_WRITE_STATUS_1_WRITES_OK */ +/* Description: No pending writes or errors */ +#define SH_PIO_WRITE_STATUS_1_WRITES_OK_SHFT 63 +#define SH_PIO_WRITE_STATUS_1_WRITES_OK_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_PIO_WRITE_STATUS_0_ALIAS" */ +/* ==================================================================== */ + +#define SH_PIO_WRITE_STATUS_0_ALIAS 0x0000000120070208 + +/* ==================================================================== */ +/* Register "SH_PIO_WRITE_STATUS_1_ALIAS" */ +/* ==================================================================== */ + +#define SH_PIO_WRITE_STATUS_1_ALIAS 0x0000000120070288 + +/* ==================================================================== */ +/* Register "SH_MEMORY_WRITE_STATUS_NON_USER_0" */ +/* Memory Write Status for CPU 0. OS access only */ +/* ==================================================================== */ + +#define SH_MEMORY_WRITE_STATUS_NON_USER_0 0x0000000120070400 +#define SH_MEMORY_WRITE_STATUS_NON_USER_0_MASK 0x800000000000003f +#define SH_MEMORY_WRITE_STATUS_NON_USER_0_INIT 0x0000000000000000 + +/* SH_MEMORY_WRITE_STATUS_NON_USER_0_PENDING_WRITE_COUNT */ +/* Description: Pending Write Count */ +#define SH_MEMORY_WRITE_STATUS_NON_USER_0_PENDING_WRITE_COUNT_SHFT 0 +#define SH_MEMORY_WRITE_STATUS_NON_USER_0_PENDING_WRITE_COUNT_MASK 0x000000000000003f + +/* SH_MEMORY_WRITE_STATUS_NON_USER_0_CLEAR */ +/* Description: Clear pending write count */ +#define SH_MEMORY_WRITE_STATUS_NON_USER_0_CLEAR_SHFT 63 +#define SH_MEMORY_WRITE_STATUS_NON_USER_0_CLEAR_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_MEMORY_WRITE_STATUS_NON_USER_1" */ +/* Memory Write Status for CPU 1. OS access only */ +/* ==================================================================== */ + +#define SH_MEMORY_WRITE_STATUS_NON_USER_1 0x0000000120070480 +#define SH_MEMORY_WRITE_STATUS_NON_USER_1_MASK 0x800000000000003f +#define SH_MEMORY_WRITE_STATUS_NON_USER_1_INIT 0x0000000000000000 + +/* SH_MEMORY_WRITE_STATUS_NON_USER_1_PENDING_WRITE_COUNT */ +/* Description: Pending Write Count */ +#define SH_MEMORY_WRITE_STATUS_NON_USER_1_PENDING_WRITE_COUNT_SHFT 0 +#define SH_MEMORY_WRITE_STATUS_NON_USER_1_PENDING_WRITE_COUNT_MASK 0x000000000000003f + +/* SH_MEMORY_WRITE_STATUS_NON_USER_1_CLEAR */ +/* Description: Clear pending write count */ +#define SH_MEMORY_WRITE_STATUS_NON_USER_1_CLEAR_SHFT 63 +#define SH_MEMORY_WRITE_STATUS_NON_USER_1_CLEAR_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_MMRBIST_ERR" */ +/* Error capture for bist read errors */ +/* ==================================================================== */ + +#define SH_MMRBIST_ERR 0x0000000100000080 +#define SH_MMRBIST_ERR_MASK 0x00000071ffffffff +#define SH_MMRBIST_ERR_INIT 0x0000000000000000 + +/* SH_MMRBIST_ERR_ADDR */ +/* Description: dword address of bist error */ +#define SH_MMRBIST_ERR_ADDR_SHFT 0 +#define SH_MMRBIST_ERR_ADDR_MASK 0x00000001ffffffff + +/* SH_MMRBIST_ERR_DETECTED */ +/* Description: error detected flag */ +#define SH_MMRBIST_ERR_DETECTED_SHFT 36 +#define SH_MMRBIST_ERR_DETECTED_MASK 0x0000001000000000 + +/* SH_MMRBIST_ERR_MULTIPLE_DETECTED */ +/* Description: multiple errors detected flag */ +#define SH_MMRBIST_ERR_MULTIPLE_DETECTED_SHFT 37 +#define SH_MMRBIST_ERR_MULTIPLE_DETECTED_MASK 0x0000002000000000 + +/* SH_MMRBIST_ERR_CANCELLED */ +/* Description: mmr/bist was cancelled */ +#define SH_MMRBIST_ERR_CANCELLED_SHFT 38 +#define SH_MMRBIST_ERR_CANCELLED_MASK 0x0000004000000000 + +/* ==================================================================== */ +/* Register "SH_MISC_ERR_HDR_LOWER" */ +/* Header capture register */ +/* ==================================================================== */ + +#define SH_MISC_ERR_HDR_LOWER 0x0000000100000088 +#define SH_MISC_ERR_HDR_LOWER_MASK 0x93fffffffffffff8 +#define SH_MISC_ERR_HDR_LOWER_INIT 0x0000000000000000 + +/* SH_MISC_ERR_HDR_LOWER_ADDR */ +/* Description: upper bits of reference address */ +#define SH_MISC_ERR_HDR_LOWER_ADDR_SHFT 3 +#define SH_MISC_ERR_HDR_LOWER_ADDR_MASK 0x0000000ffffffff8 + +/* SH_MISC_ERR_HDR_LOWER_CMD */ +/* Description: command of reference */ +#define SH_MISC_ERR_HDR_LOWER_CMD_SHFT 36 +#define SH_MISC_ERR_HDR_LOWER_CMD_MASK 0x00000ff000000000 + +/* SH_MISC_ERR_HDR_LOWER_SRC */ +/* Description: source node of reference */ +#define SH_MISC_ERR_HDR_LOWER_SRC_SHFT 44 +#define SH_MISC_ERR_HDR_LOWER_SRC_MASK 0x03fff00000000000 + +/* SH_MISC_ERR_HDR_LOWER_WRITE */ +/* Description: reference is a write */ +#define SH_MISC_ERR_HDR_LOWER_WRITE_SHFT 60 +#define SH_MISC_ERR_HDR_LOWER_WRITE_MASK 0x1000000000000000 + +/* SH_MISC_ERR_HDR_LOWER_VALID */ +/* Description: set when capture occurs */ +#define SH_MISC_ERR_HDR_LOWER_VALID_SHFT 63 +#define SH_MISC_ERR_HDR_LOWER_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_MISC_ERR_HDR_UPPER" */ +/* Error header capture packet and protocol errors */ +/* ==================================================================== */ + +#define SH_MISC_ERR_HDR_UPPER 0x0000000100000090 +#define SH_MISC_ERR_HDR_UPPER_MASK 0x000000001ff000ff +#define SH_MISC_ERR_HDR_UPPER_INIT 0x0000000000000000 + +/* SH_MISC_ERR_HDR_UPPER_DIR_PROTOCOL */ +/* Description: indicates a directory protocol error captured */ +#define SH_MISC_ERR_HDR_UPPER_DIR_PROTOCOL_SHFT 0 +#define SH_MISC_ERR_HDR_UPPER_DIR_PROTOCOL_MASK 0x0000000000000001 + +/* SH_MISC_ERR_HDR_UPPER_ILLEGAL_CMD */ +/* Description: indicates an illegal command error captured */ +#define SH_MISC_ERR_HDR_UPPER_ILLEGAL_CMD_SHFT 1 +#define SH_MISC_ERR_HDR_UPPER_ILLEGAL_CMD_MASK 0x0000000000000002 + +/* SH_MISC_ERR_HDR_UPPER_NONEXIST_ADDR */ +/* Description: indicates a non-existent memory error captured */ +#define SH_MISC_ERR_HDR_UPPER_NONEXIST_ADDR_SHFT 2 +#define SH_MISC_ERR_HDR_UPPER_NONEXIST_ADDR_MASK 0x0000000000000004 + +/* SH_MISC_ERR_HDR_UPPER_RMW_UC */ +/* Description: indicates an uncorrectable store rmw */ +#define SH_MISC_ERR_HDR_UPPER_RMW_UC_SHFT 3 +#define SH_MISC_ERR_HDR_UPPER_RMW_UC_MASK 0x0000000000000008 + +/* SH_MISC_ERR_HDR_UPPER_RMW_COR */ +/* Description: indicates a correctable store rmw */ +#define SH_MISC_ERR_HDR_UPPER_RMW_COR_SHFT 4 +#define SH_MISC_ERR_HDR_UPPER_RMW_COR_MASK 0x0000000000000010 + +/* SH_MISC_ERR_HDR_UPPER_DIR_ACC */ +/* Description: indicates a data request to directory memory error */ +/* captured */ +#define SH_MISC_ERR_HDR_UPPER_DIR_ACC_SHFT 5 +#define SH_MISC_ERR_HDR_UPPER_DIR_ACC_MASK 0x0000000000000020 + +/* SH_MISC_ERR_HDR_UPPER_PI_PKT_SIZE */ +/* Description: indicates a pkt size error from pi */ +#define SH_MISC_ERR_HDR_UPPER_PI_PKT_SIZE_SHFT 6 +#define SH_MISC_ERR_HDR_UPPER_PI_PKT_SIZE_MASK 0x0000000000000040 + +/* SH_MISC_ERR_HDR_UPPER_XN_PKT_SIZE */ +/* Description: indicates a pkt size error from xn */ +#define SH_MISC_ERR_HDR_UPPER_XN_PKT_SIZE_SHFT 7 +#define SH_MISC_ERR_HDR_UPPER_XN_PKT_SIZE_MASK 0x0000000000000080 + +/* SH_MISC_ERR_HDR_UPPER_ECHO */ +#define SH_MISC_ERR_HDR_UPPER_ECHO_SHFT 20 +#define SH_MISC_ERR_HDR_UPPER_ECHO_MASK 0x000000001ff00000 + +/* ==================================================================== */ +/* Register "SH_DIR_UC_ERR_HDR_LOWER" */ +/* Header capture register */ +/* ==================================================================== */ + +#define SH_DIR_UC_ERR_HDR_LOWER 0x0000000100000098 +#define SH_DIR_UC_ERR_HDR_LOWER_MASK 0x93fffffffffffff8 +#define SH_DIR_UC_ERR_HDR_LOWER_INIT 0x0000000000000000 + +/* SH_DIR_UC_ERR_HDR_LOWER_ADDR */ +/* Description: upper bits of reference address */ +#define SH_DIR_UC_ERR_HDR_LOWER_ADDR_SHFT 3 +#define SH_DIR_UC_ERR_HDR_LOWER_ADDR_MASK 0x0000000ffffffff8 + +/* SH_DIR_UC_ERR_HDR_LOWER_CMD */ +/* Description: command of reference */ +#define SH_DIR_UC_ERR_HDR_LOWER_CMD_SHFT 36 +#define SH_DIR_UC_ERR_HDR_LOWER_CMD_MASK 0x00000ff000000000 + +/* SH_DIR_UC_ERR_HDR_LOWER_SRC */ +/* Description: source node of reference */ +#define SH_DIR_UC_ERR_HDR_LOWER_SRC_SHFT 44 +#define SH_DIR_UC_ERR_HDR_LOWER_SRC_MASK 0x03fff00000000000 + +/* SH_DIR_UC_ERR_HDR_LOWER_WRITE */ +/* Description: reference is a write */ +#define SH_DIR_UC_ERR_HDR_LOWER_WRITE_SHFT 60 +#define SH_DIR_UC_ERR_HDR_LOWER_WRITE_MASK 0x1000000000000000 + +/* SH_DIR_UC_ERR_HDR_LOWER_VALID */ +/* Description: set when capture occurs */ +#define SH_DIR_UC_ERR_HDR_LOWER_VALID_SHFT 63 +#define SH_DIR_UC_ERR_HDR_LOWER_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_DIR_UC_ERR_HDR_UPPER" */ +/* Error header capture packet and protocol errors */ +/* ==================================================================== */ + +#define SH_DIR_UC_ERR_HDR_UPPER 0x00000001000000a0 +#define SH_DIR_UC_ERR_HDR_UPPER_MASK 0x000000001ff00008 +#define SH_DIR_UC_ERR_HDR_UPPER_INIT 0x0000000000000000 + +/* SH_DIR_UC_ERR_HDR_UPPER_DIR_UC */ +/* Description: indicates uncorrectable directory error captured */ +#define SH_DIR_UC_ERR_HDR_UPPER_DIR_UC_SHFT 3 +#define SH_DIR_UC_ERR_HDR_UPPER_DIR_UC_MASK 0x0000000000000008 + +/* SH_DIR_UC_ERR_HDR_UPPER_ECHO */ +#define SH_DIR_UC_ERR_HDR_UPPER_ECHO_SHFT 20 +#define SH_DIR_UC_ERR_HDR_UPPER_ECHO_MASK 0x000000001ff00000 + +/* ==================================================================== */ +/* Register "SH_DIR_COR_ERR_HDR_LOWER" */ +/* Header capture register */ +/* ==================================================================== */ + +#define SH_DIR_COR_ERR_HDR_LOWER 0x00000001000000a8 +#define SH_DIR_COR_ERR_HDR_LOWER_MASK 0x93fffffffffffff8 +#define SH_DIR_COR_ERR_HDR_LOWER_INIT 0x0000000000000000 + +/* SH_DIR_COR_ERR_HDR_LOWER_ADDR */ +/* Description: upper bits of reference address */ +#define SH_DIR_COR_ERR_HDR_LOWER_ADDR_SHFT 3 +#define SH_DIR_COR_ERR_HDR_LOWER_ADDR_MASK 0x0000000ffffffff8 + +/* SH_DIR_COR_ERR_HDR_LOWER_CMD */ +/* Description: command of reference */ +#define SH_DIR_COR_ERR_HDR_LOWER_CMD_SHFT 36 +#define SH_DIR_COR_ERR_HDR_LOWER_CMD_MASK 0x00000ff000000000 + +/* SH_DIR_COR_ERR_HDR_LOWER_SRC */ +/* Description: source node of reference */ +#define SH_DIR_COR_ERR_HDR_LOWER_SRC_SHFT 44 +#define SH_DIR_COR_ERR_HDR_LOWER_SRC_MASK 0x03fff00000000000 + +/* SH_DIR_COR_ERR_HDR_LOWER_WRITE */ +/* Description: reference is a write */ +#define SH_DIR_COR_ERR_HDR_LOWER_WRITE_SHFT 60 +#define SH_DIR_COR_ERR_HDR_LOWER_WRITE_MASK 0x1000000000000000 + +/* SH_DIR_COR_ERR_HDR_LOWER_VALID */ +/* Description: set when capture occurs */ +#define SH_DIR_COR_ERR_HDR_LOWER_VALID_SHFT 63 +#define SH_DIR_COR_ERR_HDR_LOWER_VALID_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_DIR_COR_ERR_HDR_UPPER" */ +/* Error header capture packet and protocol errors */ +/* ==================================================================== */ + +#define SH_DIR_COR_ERR_HDR_UPPER 0x00000001000000b0 +#define SH_DIR_COR_ERR_HDR_UPPER_MASK 0x000000001ff00100 +#define SH_DIR_COR_ERR_HDR_UPPER_INIT 0x0000000000000000 + +/* SH_DIR_COR_ERR_HDR_UPPER_DIR_COR */ +/* Description: indicates correctable directory error captured */ +#define SH_DIR_COR_ERR_HDR_UPPER_DIR_COR_SHFT 8 +#define SH_DIR_COR_ERR_HDR_UPPER_DIR_COR_MASK 0x0000000000000100 + +/* SH_DIR_COR_ERR_HDR_UPPER_ECHO */ +#define SH_DIR_COR_ERR_HDR_UPPER_ECHO_SHFT 20 +#define SH_DIR_COR_ERR_HDR_UPPER_ECHO_MASK 0x000000001ff00000 + +/* ==================================================================== */ +/* Register "SH_MEM_ERROR_SUMMARY" */ +/* Memory error flags */ +/* ==================================================================== */ + +#define SH_MEM_ERROR_SUMMARY 0x00000001000000b8 +#define SH_MEM_ERROR_SUMMARY_MASK 0x00000007f77777ff +#define SH_MEM_ERROR_SUMMARY_INIT 0x0000000000000000 + +/* SH_MEM_ERROR_SUMMARY_ILLEGAL_CMD */ +/* Description: illegal command error */ +#define SH_MEM_ERROR_SUMMARY_ILLEGAL_CMD_SHFT 0 +#define SH_MEM_ERROR_SUMMARY_ILLEGAL_CMD_MASK 0x0000000000000001 + +/* SH_MEM_ERROR_SUMMARY_NONEXIST_ADDR */ +/* Description: non-existent memory error */ +#define SH_MEM_ERROR_SUMMARY_NONEXIST_ADDR_SHFT 1 +#define SH_MEM_ERROR_SUMMARY_NONEXIST_ADDR_MASK 0x0000000000000002 + +/* SH_MEM_ERROR_SUMMARY_DQLP_DIR_PERR */ +/* Description: directory protocol error in dqlp */ +#define SH_MEM_ERROR_SUMMARY_DQLP_DIR_PERR_SHFT 2 +#define SH_MEM_ERROR_SUMMARY_DQLP_DIR_PERR_MASK 0x0000000000000004 + +/* SH_MEM_ERROR_SUMMARY_DQRP_DIR_PERR */ +/* Description: directory protocol error in dqrp */ +#define SH_MEM_ERROR_SUMMARY_DQRP_DIR_PERR_SHFT 3 +#define SH_MEM_ERROR_SUMMARY_DQRP_DIR_PERR_MASK 0x0000000000000008 + +/* SH_MEM_ERROR_SUMMARY_DQLP_DIR_UC */ +/* Description: uncorrectable directory error in dqlp */ +#define SH_MEM_ERROR_SUMMARY_DQLP_DIR_UC_SHFT 4 +#define SH_MEM_ERROR_SUMMARY_DQLP_DIR_UC_MASK 0x0000000000000010 + +/* SH_MEM_ERROR_SUMMARY_DQLP_DIR_COR */ +/* Description: correctable directory error in dqlp */ +#define SH_MEM_ERROR_SUMMARY_DQLP_DIR_COR_SHFT 5 +#define SH_MEM_ERROR_SUMMARY_DQLP_DIR_COR_MASK 0x0000000000000020 + +/* SH_MEM_ERROR_SUMMARY_DQRP_DIR_UC */ +/* Description: uncorrectable directory error in dqrp */ +#define SH_MEM_ERROR_SUMMARY_DQRP_DIR_UC_SHFT 6 +#define SH_MEM_ERROR_SUMMARY_DQRP_DIR_UC_MASK 0x0000000000000040 + +/* SH_MEM_ERROR_SUMMARY_DQRP_DIR_COR */ +/* Description: correctable directory error in dqrp */ +#define SH_MEM_ERROR_SUMMARY_DQRP_DIR_COR_SHFT 7 +#define SH_MEM_ERROR_SUMMARY_DQRP_DIR_COR_MASK 0x0000000000000080 + +/* SH_MEM_ERROR_SUMMARY_ACX_INT_HW */ +/* Description: hardware interrupt from acx */ +#define SH_MEM_ERROR_SUMMARY_ACX_INT_HW_SHFT 8 +#define SH_MEM_ERROR_SUMMARY_ACX_INT_HW_MASK 0x0000000000000100 + +/* SH_MEM_ERROR_SUMMARY_ACY_INT_HW */ +/* Description: hardware interrupt from acy */ +#define SH_MEM_ERROR_SUMMARY_ACY_INT_HW_SHFT 9 +#define SH_MEM_ERROR_SUMMARY_ACY_INT_HW_MASK 0x0000000000000200 + +/* SH_MEM_ERROR_SUMMARY_DIR_ACC */ +/* Description: directory memory access error */ +#define SH_MEM_ERROR_SUMMARY_DIR_ACC_SHFT 10 +#define SH_MEM_ERROR_SUMMARY_DIR_ACC_MASK 0x0000000000000400 + +/* SH_MEM_ERROR_SUMMARY_DQLP_INT_UC */ +/* Description: uncorrectable interrupt from dqlp */ +#define SH_MEM_ERROR_SUMMARY_DQLP_INT_UC_SHFT 12 +#define SH_MEM_ERROR_SUMMARY_DQLP_INT_UC_MASK 0x0000000000001000 + +/* SH_MEM_ERROR_SUMMARY_DQLP_INT_COR */ +/* Description: correctable interrupt from dqlp */ +#define SH_MEM_ERROR_SUMMARY_DQLP_INT_COR_SHFT 13 +#define SH_MEM_ERROR_SUMMARY_DQLP_INT_COR_MASK 0x0000000000002000 + +/* SH_MEM_ERROR_SUMMARY_DQLP_INT_HW */ +/* Description: hardware interrupt from dqlp */ +#define SH_MEM_ERROR_SUMMARY_DQLP_INT_HW_SHFT 14 +#define SH_MEM_ERROR_SUMMARY_DQLP_INT_HW_MASK 0x0000000000004000 + +/* SH_MEM_ERROR_SUMMARY_DQLS_INT_UC */ +/* Description: uncorrectable interrupt from dqls */ +#define SH_MEM_ERROR_SUMMARY_DQLS_INT_UC_SHFT 16 +#define SH_MEM_ERROR_SUMMARY_DQLS_INT_UC_MASK 0x0000000000010000 + +/* SH_MEM_ERROR_SUMMARY_DQLS_INT_COR */ +/* Description: correctable interrupt from dqls */ +#define SH_MEM_ERROR_SUMMARY_DQLS_INT_COR_SHFT 17 +#define SH_MEM_ERROR_SUMMARY_DQLS_INT_COR_MASK 0x0000000000020000 + +/* SH_MEM_ERROR_SUMMARY_DQLS_INT_HW */ +/* Description: hardware interrupt from dqls */ +#define SH_MEM_ERROR_SUMMARY_DQLS_INT_HW_SHFT 18 +#define SH_MEM_ERROR_SUMMARY_DQLS_INT_HW_MASK 0x0000000000040000 + +/* SH_MEM_ERROR_SUMMARY_DQRP_INT_UC */ +/* Description: uncorrectable interrupt from dqrp */ +#define SH_MEM_ERROR_SUMMARY_DQRP_INT_UC_SHFT 20 +#define SH_MEM_ERROR_SUMMARY_DQRP_INT_UC_MASK 0x0000000000100000 + +/* SH_MEM_ERROR_SUMMARY_DQRP_INT_COR */ +/* Description: correctable interrupt from dqrp */ +#define SH_MEM_ERROR_SUMMARY_DQRP_INT_COR_SHFT 21 +#define SH_MEM_ERROR_SUMMARY_DQRP_INT_COR_MASK 0x0000000000200000 + +/* SH_MEM_ERROR_SUMMARY_DQRP_INT_HW */ +/* Description: hardware interrupt from dqrp */ +#define SH_MEM_ERROR_SUMMARY_DQRP_INT_HW_SHFT 22 +#define SH_MEM_ERROR_SUMMARY_DQRP_INT_HW_MASK 0x0000000000400000 + +/* SH_MEM_ERROR_SUMMARY_DQRS_INT_UC */ +/* Description: uncorrectable interrupt from dqrs */ +#define SH_MEM_ERROR_SUMMARY_DQRS_INT_UC_SHFT 24 +#define SH_MEM_ERROR_SUMMARY_DQRS_INT_UC_MASK 0x0000000001000000 + +/* SH_MEM_ERROR_SUMMARY_DQRS_INT_COR */ +/* Description: correctable interrupt from dqrs */ +#define SH_MEM_ERROR_SUMMARY_DQRS_INT_COR_SHFT 25 +#define SH_MEM_ERROR_SUMMARY_DQRS_INT_COR_MASK 0x0000000002000000 + +/* SH_MEM_ERROR_SUMMARY_DQRS_INT_HW */ +/* Description: hardware interrupt from dqrs */ +#define SH_MEM_ERROR_SUMMARY_DQRS_INT_HW_SHFT 26 +#define SH_MEM_ERROR_SUMMARY_DQRS_INT_HW_MASK 0x0000000004000000 + +/* SH_MEM_ERROR_SUMMARY_PI_REPLY_OVERFLOW */ +/* Description: too many reply packets came from pi */ +#define SH_MEM_ERROR_SUMMARY_PI_REPLY_OVERFLOW_SHFT 28 +#define SH_MEM_ERROR_SUMMARY_PI_REPLY_OVERFLOW_MASK 0x0000000010000000 + +/* SH_MEM_ERROR_SUMMARY_XN_REPLY_OVERFLOW */ +/* Description: too many reply packets came from xn */ +#define SH_MEM_ERROR_SUMMARY_XN_REPLY_OVERFLOW_SHFT 29 +#define SH_MEM_ERROR_SUMMARY_XN_REPLY_OVERFLOW_MASK 0x0000000020000000 + +/* SH_MEM_ERROR_SUMMARY_PI_REQUEST_OVERFLOW */ +/* Description: too many request packets came from pi */ +#define SH_MEM_ERROR_SUMMARY_PI_REQUEST_OVERFLOW_SHFT 30 +#define SH_MEM_ERROR_SUMMARY_PI_REQUEST_OVERFLOW_MASK 0x0000000040000000 + +/* SH_MEM_ERROR_SUMMARY_XN_REQUEST_OVERFLOW */ +/* Description: too many request packets came from xn */ +#define SH_MEM_ERROR_SUMMARY_XN_REQUEST_OVERFLOW_SHFT 31 +#define SH_MEM_ERROR_SUMMARY_XN_REQUEST_OVERFLOW_MASK 0x0000000080000000 + +/* SH_MEM_ERROR_SUMMARY_RED_BLACK_ERR_TIMEOUT */ +/* Description: red black scheme did not clean up soon enough */ +#define SH_MEM_ERROR_SUMMARY_RED_BLACK_ERR_TIMEOUT_SHFT 32 +#define SH_MEM_ERROR_SUMMARY_RED_BLACK_ERR_TIMEOUT_MASK 0x0000000100000000 + +/* SH_MEM_ERROR_SUMMARY_PI_PKT_SIZE */ +/* Description: received data bearing packet from pi with wrong siz */ +#define SH_MEM_ERROR_SUMMARY_PI_PKT_SIZE_SHFT 33 +#define SH_MEM_ERROR_SUMMARY_PI_PKT_SIZE_MASK 0x0000000200000000 + +/* SH_MEM_ERROR_SUMMARY_XN_PKT_SIZE */ +/* Description: received data bearing packet from xn with wrong siz */ +#define SH_MEM_ERROR_SUMMARY_XN_PKT_SIZE_SHFT 34 +#define SH_MEM_ERROR_SUMMARY_XN_PKT_SIZE_MASK 0x0000000400000000 + +/* ==================================================================== */ +/* Register "SH_MEM_ERROR_SUMMARY_ALIAS" */ +/* Memory error flags clear alias */ +/* ==================================================================== */ + +#define SH_MEM_ERROR_SUMMARY_ALIAS 0x00000001000000c0 + +/* ==================================================================== */ +/* Register "SH_MEM_ERROR_OVERFLOW" */ +/* Memory error flags */ +/* ==================================================================== */ + +#define SH_MEM_ERROR_OVERFLOW 0x00000001000000c8 +#define SH_MEM_ERROR_OVERFLOW_MASK 0x00000007f77777ff +#define SH_MEM_ERROR_OVERFLOW_INIT 0x0000000000000000 + +/* SH_MEM_ERROR_OVERFLOW_ILLEGAL_CMD */ +/* Description: illegal command error */ +#define SH_MEM_ERROR_OVERFLOW_ILLEGAL_CMD_SHFT 0 +#define SH_MEM_ERROR_OVERFLOW_ILLEGAL_CMD_MASK 0x0000000000000001 + +/* SH_MEM_ERROR_OVERFLOW_NONEXIST_ADDR */ +/* Description: non-existent memory error */ +#define SH_MEM_ERROR_OVERFLOW_NONEXIST_ADDR_SHFT 1 +#define SH_MEM_ERROR_OVERFLOW_NONEXIST_ADDR_MASK 0x0000000000000002 + +/* SH_MEM_ERROR_OVERFLOW_DQLP_DIR_PERR */ +/* Description: directory protocol error in dqlp */ +#define SH_MEM_ERROR_OVERFLOW_DQLP_DIR_PERR_SHFT 2 +#define SH_MEM_ERROR_OVERFLOW_DQLP_DIR_PERR_MASK 0x0000000000000004 + +/* SH_MEM_ERROR_OVERFLOW_DQRP_DIR_PERR */ +/* Description: directory protocol error in dqrp */ +#define SH_MEM_ERROR_OVERFLOW_DQRP_DIR_PERR_SHFT 3 +#define SH_MEM_ERROR_OVERFLOW_DQRP_DIR_PERR_MASK 0x0000000000000008 + +/* SH_MEM_ERROR_OVERFLOW_DQLP_DIR_UC */ +/* Description: uncorrectable directory error in dqlp */ +#define SH_MEM_ERROR_OVERFLOW_DQLP_DIR_UC_SHFT 4 +#define SH_MEM_ERROR_OVERFLOW_DQLP_DIR_UC_MASK 0x0000000000000010 + +/* SH_MEM_ERROR_OVERFLOW_DQLP_DIR_COR */ +/* Description: correctable directory error in dqlp */ +#define SH_MEM_ERROR_OVERFLOW_DQLP_DIR_COR_SHFT 5 +#define SH_MEM_ERROR_OVERFLOW_DQLP_DIR_COR_MASK 0x0000000000000020 + +/* SH_MEM_ERROR_OVERFLOW_DQRP_DIR_UC */ +/* Description: uncorrectable directory error in dqrp */ +#define SH_MEM_ERROR_OVERFLOW_DQRP_DIR_UC_SHFT 6 +#define SH_MEM_ERROR_OVERFLOW_DQRP_DIR_UC_MASK 0x0000000000000040 + +/* SH_MEM_ERROR_OVERFLOW_DQRP_DIR_COR */ +/* Description: correctable directory error in dqrp */ +#define SH_MEM_ERROR_OVERFLOW_DQRP_DIR_COR_SHFT 7 +#define SH_MEM_ERROR_OVERFLOW_DQRP_DIR_COR_MASK 0x0000000000000080 + +/* SH_MEM_ERROR_OVERFLOW_ACX_INT_HW */ +/* Description: hardware interrupt from acx */ +#define SH_MEM_ERROR_OVERFLOW_ACX_INT_HW_SHFT 8 +#define SH_MEM_ERROR_OVERFLOW_ACX_INT_HW_MASK 0x0000000000000100 + +/* SH_MEM_ERROR_OVERFLOW_ACY_INT_HW */ +/* Description: hardware interrupt from acy */ +#define SH_MEM_ERROR_OVERFLOW_ACY_INT_HW_SHFT 9 +#define SH_MEM_ERROR_OVERFLOW_ACY_INT_HW_MASK 0x0000000000000200 + +/* SH_MEM_ERROR_OVERFLOW_DIR_ACC */ +/* Description: directory memory access error */ +#define SH_MEM_ERROR_OVERFLOW_DIR_ACC_SHFT 10 +#define SH_MEM_ERROR_OVERFLOW_DIR_ACC_MASK 0x0000000000000400 + +/* SH_MEM_ERROR_OVERFLOW_DQLP_INT_UC */ +/* Description: uncorrectable interrupt from dqlp */ +#define SH_MEM_ERROR_OVERFLOW_DQLP_INT_UC_SHFT 12 +#define SH_MEM_ERROR_OVERFLOW_DQLP_INT_UC_MASK 0x0000000000001000 + +/* SH_MEM_ERROR_OVERFLOW_DQLP_INT_COR */ +/* Description: correctable interrupt from dqlp */ +#define SH_MEM_ERROR_OVERFLOW_DQLP_INT_COR_SHFT 13 +#define SH_MEM_ERROR_OVERFLOW_DQLP_INT_COR_MASK 0x0000000000002000 + +/* SH_MEM_ERROR_OVERFLOW_DQLP_INT_HW */ +/* Description: hardware interrupt from dqlp */ +#define SH_MEM_ERROR_OVERFLOW_DQLP_INT_HW_SHFT 14 +#define SH_MEM_ERROR_OVERFLOW_DQLP_INT_HW_MASK 0x0000000000004000 + +/* SH_MEM_ERROR_OVERFLOW_DQLS_INT_UC */ +/* Description: uncorrectable interrupt from dqls */ +#define SH_MEM_ERROR_OVERFLOW_DQLS_INT_UC_SHFT 16 +#define SH_MEM_ERROR_OVERFLOW_DQLS_INT_UC_MASK 0x0000000000010000 + +/* SH_MEM_ERROR_OVERFLOW_DQLS_INT_COR */ +/* Description: correctable interrupt from dqls */ +#define SH_MEM_ERROR_OVERFLOW_DQLS_INT_COR_SHFT 17 +#define SH_MEM_ERROR_OVERFLOW_DQLS_INT_COR_MASK 0x0000000000020000 + +/* SH_MEM_ERROR_OVERFLOW_DQLS_INT_HW */ +/* Description: hardware interrupt from dqls */ +#define SH_MEM_ERROR_OVERFLOW_DQLS_INT_HW_SHFT 18 +#define SH_MEM_ERROR_OVERFLOW_DQLS_INT_HW_MASK 0x0000000000040000 + +/* SH_MEM_ERROR_OVERFLOW_DQRP_INT_UC */ +/* Description: uncorrectable interrupt from dqrp */ +#define SH_MEM_ERROR_OVERFLOW_DQRP_INT_UC_SHFT 20 +#define SH_MEM_ERROR_OVERFLOW_DQRP_INT_UC_MASK 0x0000000000100000 + +/* SH_MEM_ERROR_OVERFLOW_DQRP_INT_COR */ +/* Description: correctable interrupt from dqrp */ +#define SH_MEM_ERROR_OVERFLOW_DQRP_INT_COR_SHFT 21 +#define SH_MEM_ERROR_OVERFLOW_DQRP_INT_COR_MASK 0x0000000000200000 + +/* SH_MEM_ERROR_OVERFLOW_DQRP_INT_HW */ +/* Description: hardware interrupt from dqrp */ +#define SH_MEM_ERROR_OVERFLOW_DQRP_INT_HW_SHFT 22 +#define SH_MEM_ERROR_OVERFLOW_DQRP_INT_HW_MASK 0x0000000000400000 + +/* SH_MEM_ERROR_OVERFLOW_DQRS_INT_UC */ +/* Description: uncorrectable interrupt from dqrs */ +#define SH_MEM_ERROR_OVERFLOW_DQRS_INT_UC_SHFT 24 +#define SH_MEM_ERROR_OVERFLOW_DQRS_INT_UC_MASK 0x0000000001000000 + +/* SH_MEM_ERROR_OVERFLOW_DQRS_INT_COR */ +/* Description: correctable interrupt from dqrs */ +#define SH_MEM_ERROR_OVERFLOW_DQRS_INT_COR_SHFT 25 +#define SH_MEM_ERROR_OVERFLOW_DQRS_INT_COR_MASK 0x0000000002000000 + +/* SH_MEM_ERROR_OVERFLOW_DQRS_INT_HW */ +/* Description: hardware interrupt from dqrs */ +#define SH_MEM_ERROR_OVERFLOW_DQRS_INT_HW_SHFT 26 +#define SH_MEM_ERROR_OVERFLOW_DQRS_INT_HW_MASK 0x0000000004000000 + +/* SH_MEM_ERROR_OVERFLOW_PI_REPLY_OVERFLOW */ +/* Description: too many reply packets came from pi */ +#define SH_MEM_ERROR_OVERFLOW_PI_REPLY_OVERFLOW_SHFT 28 +#define SH_MEM_ERROR_OVERFLOW_PI_REPLY_OVERFLOW_MASK 0x0000000010000000 + +/* SH_MEM_ERROR_OVERFLOW_XN_REPLY_OVERFLOW */ +/* Description: too many reply packets came from xn */ +#define SH_MEM_ERROR_OVERFLOW_XN_REPLY_OVERFLOW_SHFT 29 +#define SH_MEM_ERROR_OVERFLOW_XN_REPLY_OVERFLOW_MASK 0x0000000020000000 + +/* SH_MEM_ERROR_OVERFLOW_PI_REQUEST_OVERFLOW */ +/* Description: too many request packets came from pi */ +#define SH_MEM_ERROR_OVERFLOW_PI_REQUEST_OVERFLOW_SHFT 30 +#define SH_MEM_ERROR_OVERFLOW_PI_REQUEST_OVERFLOW_MASK 0x0000000040000000 + +/* SH_MEM_ERROR_OVERFLOW_XN_REQUEST_OVERFLOW */ +/* Description: too many request packets came from xn */ +#define SH_MEM_ERROR_OVERFLOW_XN_REQUEST_OVERFLOW_SHFT 31 +#define SH_MEM_ERROR_OVERFLOW_XN_REQUEST_OVERFLOW_MASK 0x0000000080000000 + +/* SH_MEM_ERROR_OVERFLOW_RED_BLACK_ERR_TIMEOUT */ +/* Description: red black scheme did not clean up soon enough */ +#define SH_MEM_ERROR_OVERFLOW_RED_BLACK_ERR_TIMEOUT_SHFT 32 +#define SH_MEM_ERROR_OVERFLOW_RED_BLACK_ERR_TIMEOUT_MASK 0x0000000100000000 + +/* SH_MEM_ERROR_OVERFLOW_PI_PKT_SIZE */ +/* Description: received data bearing packet from pi with wrong siz */ +#define SH_MEM_ERROR_OVERFLOW_PI_PKT_SIZE_SHFT 33 +#define SH_MEM_ERROR_OVERFLOW_PI_PKT_SIZE_MASK 0x0000000200000000 + +/* SH_MEM_ERROR_OVERFLOW_XN_PKT_SIZE */ +/* Description: received data bearing packet from xn with wrong siz */ +#define SH_MEM_ERROR_OVERFLOW_XN_PKT_SIZE_SHFT 34 +#define SH_MEM_ERROR_OVERFLOW_XN_PKT_SIZE_MASK 0x0000000400000000 + +/* ==================================================================== */ +/* Register "SH_MEM_ERROR_OVERFLOW_ALIAS" */ +/* Memory error flags clear alias */ +/* ==================================================================== */ + +#define SH_MEM_ERROR_OVERFLOW_ALIAS 0x00000001000000d0 + +/* ==================================================================== */ +/* Register "SH_MEM_ERROR_MASK" */ +/* Memory error flags */ +/* ==================================================================== */ + +#define SH_MEM_ERROR_MASK 0x00000001000000d8 +#define SH_MEM_ERROR_MASK_MASK 0x00000007f77777ff +#define SH_MEM_ERROR_MASK_INIT 0x00000007f77773ff + +/* SH_MEM_ERROR_MASK_ILLEGAL_CMD */ +/* Description: illegal command error */ +#define SH_MEM_ERROR_MASK_ILLEGAL_CMD_SHFT 0 +#define SH_MEM_ERROR_MASK_ILLEGAL_CMD_MASK 0x0000000000000001 + +/* SH_MEM_ERROR_MASK_NONEXIST_ADDR */ +/* Description: non-existent memory error */ +#define SH_MEM_ERROR_MASK_NONEXIST_ADDR_SHFT 1 +#define SH_MEM_ERROR_MASK_NONEXIST_ADDR_MASK 0x0000000000000002 + +/* SH_MEM_ERROR_MASK_DQLP_DIR_PERR */ +/* Description: directory protocol error in dqlp */ +#define SH_MEM_ERROR_MASK_DQLP_DIR_PERR_SHFT 2 +#define SH_MEM_ERROR_MASK_DQLP_DIR_PERR_MASK 0x0000000000000004 + +/* SH_MEM_ERROR_MASK_DQRP_DIR_PERR */ +/* Description: directory protocol error in dqrp */ +#define SH_MEM_ERROR_MASK_DQRP_DIR_PERR_SHFT 3 +#define SH_MEM_ERROR_MASK_DQRP_DIR_PERR_MASK 0x0000000000000008 + +/* SH_MEM_ERROR_MASK_DQLP_DIR_UC */ +/* Description: uncorrectable directory error in dqlp */ +#define SH_MEM_ERROR_MASK_DQLP_DIR_UC_SHFT 4 +#define SH_MEM_ERROR_MASK_DQLP_DIR_UC_MASK 0x0000000000000010 + +/* SH_MEM_ERROR_MASK_DQLP_DIR_COR */ +/* Description: correctable directory error in dqlp */ +#define SH_MEM_ERROR_MASK_DQLP_DIR_COR_SHFT 5 +#define SH_MEM_ERROR_MASK_DQLP_DIR_COR_MASK 0x0000000000000020 + +/* SH_MEM_ERROR_MASK_DQRP_DIR_UC */ +/* Description: uncorrectable directory error in dqrp */ +#define SH_MEM_ERROR_MASK_DQRP_DIR_UC_SHFT 6 +#define SH_MEM_ERROR_MASK_DQRP_DIR_UC_MASK 0x0000000000000040 + +/* SH_MEM_ERROR_MASK_DQRP_DIR_COR */ +/* Description: correctable directory error in dqrp */ +#define SH_MEM_ERROR_MASK_DQRP_DIR_COR_SHFT 7 +#define SH_MEM_ERROR_MASK_DQRP_DIR_COR_MASK 0x0000000000000080 + +/* SH_MEM_ERROR_MASK_ACX_INT_HW */ +/* Description: hardware interrupt from acx */ +#define SH_MEM_ERROR_MASK_ACX_INT_HW_SHFT 8 +#define SH_MEM_ERROR_MASK_ACX_INT_HW_MASK 0x0000000000000100 + +/* SH_MEM_ERROR_MASK_ACY_INT_HW */ +/* Description: hardware interrupt from acy */ +#define SH_MEM_ERROR_MASK_ACY_INT_HW_SHFT 9 +#define SH_MEM_ERROR_MASK_ACY_INT_HW_MASK 0x0000000000000200 + +/* SH_MEM_ERROR_MASK_DIR_ACC */ +/* Description: directory memory access error */ +#define SH_MEM_ERROR_MASK_DIR_ACC_SHFT 10 +#define SH_MEM_ERROR_MASK_DIR_ACC_MASK 0x0000000000000400 + +/* SH_MEM_ERROR_MASK_DQLP_INT_UC */ +/* Description: uncorrectable interrupt from dqlp */ +#define SH_MEM_ERROR_MASK_DQLP_INT_UC_SHFT 12 +#define SH_MEM_ERROR_MASK_DQLP_INT_UC_MASK 0x0000000000001000 + +/* SH_MEM_ERROR_MASK_DQLP_INT_COR */ +/* Description: correctable interrupt from dqlp */ +#define SH_MEM_ERROR_MASK_DQLP_INT_COR_SHFT 13 +#define SH_MEM_ERROR_MASK_DQLP_INT_COR_MASK 0x0000000000002000 + +/* SH_MEM_ERROR_MASK_DQLP_INT_HW */ +/* Description: hardware interrupt from dqlp */ +#define SH_MEM_ERROR_MASK_DQLP_INT_HW_SHFT 14 +#define SH_MEM_ERROR_MASK_DQLP_INT_HW_MASK 0x0000000000004000 + +/* SH_MEM_ERROR_MASK_DQLS_INT_UC */ +/* Description: uncorrectable interrupt from dqls */ +#define SH_MEM_ERROR_MASK_DQLS_INT_UC_SHFT 16 +#define SH_MEM_ERROR_MASK_DQLS_INT_UC_MASK 0x0000000000010000 + +/* SH_MEM_ERROR_MASK_DQLS_INT_COR */ +/* Description: correctable interrupt from dqls */ +#define SH_MEM_ERROR_MASK_DQLS_INT_COR_SHFT 17 +#define SH_MEM_ERROR_MASK_DQLS_INT_COR_MASK 0x0000000000020000 + +/* SH_MEM_ERROR_MASK_DQLS_INT_HW */ +/* Description: hardware interrupt from dqls */ +#define SH_MEM_ERROR_MASK_DQLS_INT_HW_SHFT 18 +#define SH_MEM_ERROR_MASK_DQLS_INT_HW_MASK 0x0000000000040000 + +/* SH_MEM_ERROR_MASK_DQRP_INT_UC */ +/* Description: uncorrectable interrupt from dqrp */ +#define SH_MEM_ERROR_MASK_DQRP_INT_UC_SHFT 20 +#define SH_MEM_ERROR_MASK_DQRP_INT_UC_MASK 0x0000000000100000 + +/* SH_MEM_ERROR_MASK_DQRP_INT_COR */ +/* Description: correctable interrupt from dqrp */ +#define SH_MEM_ERROR_MASK_DQRP_INT_COR_SHFT 21 +#define SH_MEM_ERROR_MASK_DQRP_INT_COR_MASK 0x0000000000200000 + +/* SH_MEM_ERROR_MASK_DQRP_INT_HW */ +/* Description: hardware interrupt from dqrp */ +#define SH_MEM_ERROR_MASK_DQRP_INT_HW_SHFT 22 +#define SH_MEM_ERROR_MASK_DQRP_INT_HW_MASK 0x0000000000400000 + +/* SH_MEM_ERROR_MASK_DQRS_INT_UC */ +/* Description: uncorrectable interrupt from dqrs */ +#define SH_MEM_ERROR_MASK_DQRS_INT_UC_SHFT 24 +#define SH_MEM_ERROR_MASK_DQRS_INT_UC_MASK 0x0000000001000000 + +/* SH_MEM_ERROR_MASK_DQRS_INT_COR */ +/* Description: correctable interrupt from dqrs */ +#define SH_MEM_ERROR_MASK_DQRS_INT_COR_SHFT 25 +#define SH_MEM_ERROR_MASK_DQRS_INT_COR_MASK 0x0000000002000000 + +/* SH_MEM_ERROR_MASK_DQRS_INT_HW */ +/* Description: hardware interrupt from dqrs */ +#define SH_MEM_ERROR_MASK_DQRS_INT_HW_SHFT 26 +#define SH_MEM_ERROR_MASK_DQRS_INT_HW_MASK 0x0000000004000000 + +/* SH_MEM_ERROR_MASK_PI_REPLY_OVERFLOW */ +/* Description: too many reply packets came from pi */ +#define SH_MEM_ERROR_MASK_PI_REPLY_OVERFLOW_SHFT 28 +#define SH_MEM_ERROR_MASK_PI_REPLY_OVERFLOW_MASK 0x0000000010000000 + +/* SH_MEM_ERROR_MASK_XN_REPLY_OVERFLOW */ +/* Description: too many reply packets came from xn */ +#define SH_MEM_ERROR_MASK_XN_REPLY_OVERFLOW_SHFT 29 +#define SH_MEM_ERROR_MASK_XN_REPLY_OVERFLOW_MASK 0x0000000020000000 + +/* SH_MEM_ERROR_MASK_PI_REQUEST_OVERFLOW */ +/* Description: too many request packets came from pi */ +#define SH_MEM_ERROR_MASK_PI_REQUEST_OVERFLOW_SHFT 30 +#define SH_MEM_ERROR_MASK_PI_REQUEST_OVERFLOW_MASK 0x0000000040000000 + +/* SH_MEM_ERROR_MASK_XN_REQUEST_OVERFLOW */ +/* Description: too many request packets came from xn */ +#define SH_MEM_ERROR_MASK_XN_REQUEST_OVERFLOW_SHFT 31 +#define SH_MEM_ERROR_MASK_XN_REQUEST_OVERFLOW_MASK 0x0000000080000000 + +/* SH_MEM_ERROR_MASK_RED_BLACK_ERR_TIMEOUT */ +/* Description: red black scheme did not clean up soon enough */ +#define SH_MEM_ERROR_MASK_RED_BLACK_ERR_TIMEOUT_SHFT 32 +#define SH_MEM_ERROR_MASK_RED_BLACK_ERR_TIMEOUT_MASK 0x0000000100000000 + +/* SH_MEM_ERROR_MASK_PI_PKT_SIZE */ +/* Description: received data bearing packet from pi with wrong siz */ +#define SH_MEM_ERROR_MASK_PI_PKT_SIZE_SHFT 33 +#define SH_MEM_ERROR_MASK_PI_PKT_SIZE_MASK 0x0000000200000000 + +/* SH_MEM_ERROR_MASK_XN_PKT_SIZE */ +/* Description: received data bearing packet from xn with wrong siz */ +#define SH_MEM_ERROR_MASK_XN_PKT_SIZE_SHFT 34 +#define SH_MEM_ERROR_MASK_XN_PKT_SIZE_MASK 0x0000000400000000 + +/* ==================================================================== */ +/* Register "SH_X_DIMM_CFG" */ +/* AC Mem Config Registers */ +/* ==================================================================== */ + +#define SH_X_DIMM_CFG 0x0000000100010000 +#define SH_X_DIMM_CFG_MASK 0x0000000f7f7f7f7f +#define SH_X_DIMM_CFG_INIT 0x000000026f4f2f0f + +/* SH_X_DIMM_CFG_DIMM0_SIZE */ +/* Description: DIMM 0 DRAM size */ +#define SH_X_DIMM_CFG_DIMM0_SIZE_SHFT 0 +#define SH_X_DIMM_CFG_DIMM0_SIZE_MASK 0x0000000000000007 + +/* SH_X_DIMM_CFG_DIMM0_2BK */ +/* Description: DIMM 0 has two physical banks */ +#define SH_X_DIMM_CFG_DIMM0_2BK_SHFT 3 +#define SH_X_DIMM_CFG_DIMM0_2BK_MASK 0x0000000000000008 + +/* SH_X_DIMM_CFG_DIMM0_REV */ +/* Description: DIMM 0 physical banks reversed */ +#define SH_X_DIMM_CFG_DIMM0_REV_SHFT 4 +#define SH_X_DIMM_CFG_DIMM0_REV_MASK 0x0000000000000010 + +/* SH_X_DIMM_CFG_DIMM0_CS */ +/* Description: DIMM 0 chip select, addr[35:34] match */ +#define SH_X_DIMM_CFG_DIMM0_CS_SHFT 5 +#define SH_X_DIMM_CFG_DIMM0_CS_MASK 0x0000000000000060 + +/* SH_X_DIMM_CFG_DIMM1_SIZE */ +/* Description: DIMM 1 DRAM size */ +#define SH_X_DIMM_CFG_DIMM1_SIZE_SHFT 8 +#define SH_X_DIMM_CFG_DIMM1_SIZE_MASK 0x0000000000000700 + +/* SH_X_DIMM_CFG_DIMM1_2BK */ +/* Description: DIMM 1 has two physical banks */ +#define SH_X_DIMM_CFG_DIMM1_2BK_SHFT 11 +#define SH_X_DIMM_CFG_DIMM1_2BK_MASK 0x0000000000000800 + +/* SH_X_DIMM_CFG_DIMM1_REV */ +/* Description: DIMM 1 physical banks reversed */ +#define SH_X_DIMM_CFG_DIMM1_REV_SHFT 12 +#define SH_X_DIMM_CFG_DIMM1_REV_MASK 0x0000000000001000 + +/* SH_X_DIMM_CFG_DIMM1_CS */ +/* Description: DIMM 1 chip select, addr[35:34] match */ +#define SH_X_DIMM_CFG_DIMM1_CS_SHFT 13 +#define SH_X_DIMM_CFG_DIMM1_CS_MASK 0x0000000000006000 + +/* SH_X_DIMM_CFG_DIMM2_SIZE */ +/* Description: DIMM 2 DRAM size */ +#define SH_X_DIMM_CFG_DIMM2_SIZE_SHFT 16 +#define SH_X_DIMM_CFG_DIMM2_SIZE_MASK 0x0000000000070000 + +/* SH_X_DIMM_CFG_DIMM2_2BK */ +/* Description: DIMM 2 has two physical banks */ +#define SH_X_DIMM_CFG_DIMM2_2BK_SHFT 19 +#define SH_X_DIMM_CFG_DIMM2_2BK_MASK 0x0000000000080000 + +/* SH_X_DIMM_CFG_DIMM2_REV */ +/* Description: DIMM 2 physical banks reversed */ +#define SH_X_DIMM_CFG_DIMM2_REV_SHFT 20 +#define SH_X_DIMM_CFG_DIMM2_REV_MASK 0x0000000000100000 + +/* SH_X_DIMM_CFG_DIMM2_CS */ +/* Description: DIMM 2 chip select, addr[35:34] match */ +#define SH_X_DIMM_CFG_DIMM2_CS_SHFT 21 +#define SH_X_DIMM_CFG_DIMM2_CS_MASK 0x0000000000600000 + +/* SH_X_DIMM_CFG_DIMM3_SIZE */ +/* Description: DIMM 3 DRAM size */ +#define SH_X_DIMM_CFG_DIMM3_SIZE_SHFT 24 +#define SH_X_DIMM_CFG_DIMM3_SIZE_MASK 0x0000000007000000 + +/* SH_X_DIMM_CFG_DIMM3_2BK */ +/* Description: DIMM 3 has two physical banks */ +#define SH_X_DIMM_CFG_DIMM3_2BK_SHFT 27 +#define SH_X_DIMM_CFG_DIMM3_2BK_MASK 0x0000000008000000 + +/* SH_X_DIMM_CFG_DIMM3_REV */ +/* Description: DIMM 3 physical banks reversed */ +#define SH_X_DIMM_CFG_DIMM3_REV_SHFT 28 +#define SH_X_DIMM_CFG_DIMM3_REV_MASK 0x0000000010000000 + +/* SH_X_DIMM_CFG_DIMM3_CS */ +/* Description: DIMM 3 chip select, addr[35:34] match */ +#define SH_X_DIMM_CFG_DIMM3_CS_SHFT 29 +#define SH_X_DIMM_CFG_DIMM3_CS_MASK 0x0000000060000000 + +/* SH_X_DIMM_CFG_FREQ */ +/* Description: DIMM frequency select */ +#define SH_X_DIMM_CFG_FREQ_SHFT 32 +#define SH_X_DIMM_CFG_FREQ_MASK 0x0000000f00000000 + +/* ==================================================================== */ +/* Register "SH_Y_DIMM_CFG" */ +/* AC Mem Config Registers */ +/* ==================================================================== */ + +#define SH_Y_DIMM_CFG 0x0000000100010008 +#define SH_Y_DIMM_CFG_MASK 0x0000000f7f7f7f7f +#define SH_Y_DIMM_CFG_INIT 0x000000026f4f2f0f + +/* SH_Y_DIMM_CFG_DIMM0_SIZE */ +/* Description: DIMM 0 DRAM size */ +#define SH_Y_DIMM_CFG_DIMM0_SIZE_SHFT 0 +#define SH_Y_DIMM_CFG_DIMM0_SIZE_MASK 0x0000000000000007 + +/* SH_Y_DIMM_CFG_DIMM0_2BK */ +/* Description: DIMM 0 has two physical banks */ +#define SH_Y_DIMM_CFG_DIMM0_2BK_SHFT 3 +#define SH_Y_DIMM_CFG_DIMM0_2BK_MASK 0x0000000000000008 + +/* SH_Y_DIMM_CFG_DIMM0_REV */ +/* Description: DIMM 0 physical banks reversed */ +#define SH_Y_DIMM_CFG_DIMM0_REV_SHFT 4 +#define SH_Y_DIMM_CFG_DIMM0_REV_MASK 0x0000000000000010 + +/* SH_Y_DIMM_CFG_DIMM0_CS */ +/* Description: DIMM 0 chip select, addr[35:34] match */ +#define SH_Y_DIMM_CFG_DIMM0_CS_SHFT 5 +#define SH_Y_DIMM_CFG_DIMM0_CS_MASK 0x0000000000000060 + +/* SH_Y_DIMM_CFG_DIMM1_SIZE */ +/* Description: DIMM 1 DRAM size */ +#define SH_Y_DIMM_CFG_DIMM1_SIZE_SHFT 8 +#define SH_Y_DIMM_CFG_DIMM1_SIZE_MASK 0x0000000000000700 + +/* SH_Y_DIMM_CFG_DIMM1_2BK */ +/* Description: DIMM 1 has two physical banks */ +#define SH_Y_DIMM_CFG_DIMM1_2BK_SHFT 11 +#define SH_Y_DIMM_CFG_DIMM1_2BK_MASK 0x0000000000000800 + +/* SH_Y_DIMM_CFG_DIMM1_REV */ +/* Description: DIMM 1 physical banks reversed */ +#define SH_Y_DIMM_CFG_DIMM1_REV_SHFT 12 +#define SH_Y_DIMM_CFG_DIMM1_REV_MASK 0x0000000000001000 + +/* SH_Y_DIMM_CFG_DIMM1_CS */ +/* Description: DIMM 1 chip select, addr[35:34] match */ +#define SH_Y_DIMM_CFG_DIMM1_CS_SHFT 13 +#define SH_Y_DIMM_CFG_DIMM1_CS_MASK 0x0000000000006000 + +/* SH_Y_DIMM_CFG_DIMM2_SIZE */ +/* Description: DIMM 2 DRAM size */ +#define SH_Y_DIMM_CFG_DIMM2_SIZE_SHFT 16 +#define SH_Y_DIMM_CFG_DIMM2_SIZE_MASK 0x0000000000070000 + +/* SH_Y_DIMM_CFG_DIMM2_2BK */ +/* Description: DIMM 2 has two physical banks */ +#define SH_Y_DIMM_CFG_DIMM2_2BK_SHFT 19 +#define SH_Y_DIMM_CFG_DIMM2_2BK_MASK 0x0000000000080000 + +/* SH_Y_DIMM_CFG_DIMM2_REV */ +/* Description: DIMM 2 physical banks reversed */ +#define SH_Y_DIMM_CFG_DIMM2_REV_SHFT 20 +#define SH_Y_DIMM_CFG_DIMM2_REV_MASK 0x0000000000100000 + +/* SH_Y_DIMM_CFG_DIMM2_CS */ +/* Description: DIMM 2 chip select, addr[35:34] match */ +#define SH_Y_DIMM_CFG_DIMM2_CS_SHFT 21 +#define SH_Y_DIMM_CFG_DIMM2_CS_MASK 0x0000000000600000 + +/* SH_Y_DIMM_CFG_DIMM3_SIZE */ +/* Description: DIMM 3 DRAM size */ +#define SH_Y_DIMM_CFG_DIMM3_SIZE_SHFT 24 +#define SH_Y_DIMM_CFG_DIMM3_SIZE_MASK 0x0000000007000000 + +/* SH_Y_DIMM_CFG_DIMM3_2BK */ +/* Description: DIMM 3 has two physical banks */ +#define SH_Y_DIMM_CFG_DIMM3_2BK_SHFT 27 +#define SH_Y_DIMM_CFG_DIMM3_2BK_MASK 0x0000000008000000 + +/* SH_Y_DIMM_CFG_DIMM3_REV */ +/* Description: DIMM 3 physical banks reversed */ +#define SH_Y_DIMM_CFG_DIMM3_REV_SHFT 28 +#define SH_Y_DIMM_CFG_DIMM3_REV_MASK 0x0000000010000000 + +/* SH_Y_DIMM_CFG_DIMM3_CS */ +/* Description: DIMM 3 chip select, addr[35:34] match */ +#define SH_Y_DIMM_CFG_DIMM3_CS_SHFT 29 +#define SH_Y_DIMM_CFG_DIMM3_CS_MASK 0x0000000060000000 + +/* SH_Y_DIMM_CFG_FREQ */ +/* Description: DIMM frequency select */ +#define SH_Y_DIMM_CFG_FREQ_SHFT 32 +#define SH_Y_DIMM_CFG_FREQ_MASK 0x0000000f00000000 + +/* ==================================================================== */ +/* Register "SH_JNR_DIMM_CFG" */ +/* AC Mem Config Registers */ +/* ==================================================================== */ + +#define SH_JNR_DIMM_CFG 0x0000000100010010 +#define SH_JNR_DIMM_CFG_MASK 0x0000000f7f7f7f7f +#define SH_JNR_DIMM_CFG_INIT 0x000000026f4f2f0f + +/* SH_JNR_DIMM_CFG_DIMM0_SIZE */ +/* Description: DIMM 0 DRAM size */ +#define SH_JNR_DIMM_CFG_DIMM0_SIZE_SHFT 0 +#define SH_JNR_DIMM_CFG_DIMM0_SIZE_MASK 0x0000000000000007 + +/* SH_JNR_DIMM_CFG_DIMM0_2BK */ +/* Description: DIMM 0 has two physical banks */ +#define SH_JNR_DIMM_CFG_DIMM0_2BK_SHFT 3 +#define SH_JNR_DIMM_CFG_DIMM0_2BK_MASK 0x0000000000000008 + +/* SH_JNR_DIMM_CFG_DIMM0_REV */ +/* Description: DIMM 0 physical banks reversed */ +#define SH_JNR_DIMM_CFG_DIMM0_REV_SHFT 4 +#define SH_JNR_DIMM_CFG_DIMM0_REV_MASK 0x0000000000000010 + +/* SH_JNR_DIMM_CFG_DIMM0_CS */ +/* Description: DIMM 0 chip select, addr[35:34] match */ +#define SH_JNR_DIMM_CFG_DIMM0_CS_SHFT 5 +#define SH_JNR_DIMM_CFG_DIMM0_CS_MASK 0x0000000000000060 + +/* SH_JNR_DIMM_CFG_DIMM1_SIZE */ +/* Description: DIMM 1 DRAM size */ +#define SH_JNR_DIMM_CFG_DIMM1_SIZE_SHFT 8 +#define SH_JNR_DIMM_CFG_DIMM1_SIZE_MASK 0x0000000000000700 + +/* SH_JNR_DIMM_CFG_DIMM1_2BK */ +/* Description: DIMM 1 has two physical banks */ +#define SH_JNR_DIMM_CFG_DIMM1_2BK_SHFT 11 +#define SH_JNR_DIMM_CFG_DIMM1_2BK_MASK 0x0000000000000800 + +/* SH_JNR_DIMM_CFG_DIMM1_REV */ +/* Description: DIMM 1 physical banks reversed */ +#define SH_JNR_DIMM_CFG_DIMM1_REV_SHFT 12 +#define SH_JNR_DIMM_CFG_DIMM1_REV_MASK 0x0000000000001000 + +/* SH_JNR_DIMM_CFG_DIMM1_CS */ +/* Description: DIMM 1 chip select, addr[35:34] match */ +#define SH_JNR_DIMM_CFG_DIMM1_CS_SHFT 13 +#define SH_JNR_DIMM_CFG_DIMM1_CS_MASK 0x0000000000006000 + +/* SH_JNR_DIMM_CFG_DIMM2_SIZE */ +/* Description: DIMM 2 DRAM size */ +#define SH_JNR_DIMM_CFG_DIMM2_SIZE_SHFT 16 +#define SH_JNR_DIMM_CFG_DIMM2_SIZE_MASK 0x0000000000070000 + +/* SH_JNR_DIMM_CFG_DIMM2_2BK */ +/* Description: DIMM 2 has two physical banks */ +#define SH_JNR_DIMM_CFG_DIMM2_2BK_SHFT 19 +#define SH_JNR_DIMM_CFG_DIMM2_2BK_MASK 0x0000000000080000 + +/* SH_JNR_DIMM_CFG_DIMM2_REV */ +/* Description: DIMM 2 physical banks reversed */ +#define SH_JNR_DIMM_CFG_DIMM2_REV_SHFT 20 +#define SH_JNR_DIMM_CFG_DIMM2_REV_MASK 0x0000000000100000 + +/* SH_JNR_DIMM_CFG_DIMM2_CS */ +/* Description: DIMM 2 chip select, addr[35:34] match */ +#define SH_JNR_DIMM_CFG_DIMM2_CS_SHFT 21 +#define SH_JNR_DIMM_CFG_DIMM2_CS_MASK 0x0000000000600000 + +/* SH_JNR_DIMM_CFG_DIMM3_SIZE */ +/* Description: DIMM 3 DRAM size */ +#define SH_JNR_DIMM_CFG_DIMM3_SIZE_SHFT 24 +#define SH_JNR_DIMM_CFG_DIMM3_SIZE_MASK 0x0000000007000000 + +/* SH_JNR_DIMM_CFG_DIMM3_2BK */ +/* Description: DIMM 3 has two physical banks */ +#define SH_JNR_DIMM_CFG_DIMM3_2BK_SHFT 27 +#define SH_JNR_DIMM_CFG_DIMM3_2BK_MASK 0x0000000008000000 + +/* SH_JNR_DIMM_CFG_DIMM3_REV */ +/* Description: DIMM 3 physical banks reversed */ +#define SH_JNR_DIMM_CFG_DIMM3_REV_SHFT 28 +#define SH_JNR_DIMM_CFG_DIMM3_REV_MASK 0x0000000010000000 + +/* SH_JNR_DIMM_CFG_DIMM3_CS */ +/* Description: DIMM 3 chip select, addr[35:34] match */ +#define SH_JNR_DIMM_CFG_DIMM3_CS_SHFT 29 +#define SH_JNR_DIMM_CFG_DIMM3_CS_MASK 0x0000000060000000 + +/* SH_JNR_DIMM_CFG_FREQ */ +/* Description: DIMM frequency select */ +#define SH_JNR_DIMM_CFG_FREQ_SHFT 32 +#define SH_JNR_DIMM_CFG_FREQ_MASK 0x0000000f00000000 + +/* ==================================================================== */ +/* Register "SH_X_PHASE_CFG" */ +/* AC Phase Config Registers */ +/* ==================================================================== */ + +#define SH_X_PHASE_CFG 0x0000000100010018 +#define SH_X_PHASE_CFG_MASK 0x7fffffffffffffff +#define SH_X_PHASE_CFG_INIT 0x0000000000000000 + +/* SH_X_PHASE_CFG_LD_A */ +/* Description: Address, control load core clock A latch */ +#define SH_X_PHASE_CFG_LD_A_SHFT 0 +#define SH_X_PHASE_CFG_LD_A_MASK 0x000000000000001f + +/* SH_X_PHASE_CFG_LD_B */ +/* Description: Address, control load core clock B latch */ +#define SH_X_PHASE_CFG_LD_B_SHFT 5 +#define SH_X_PHASE_CFG_LD_B_MASK 0x00000000000003e0 + +/* SH_X_PHASE_CFG_DQ_LD_A */ +/* Description: DATA MCI load core clock A latch */ +#define SH_X_PHASE_CFG_DQ_LD_A_SHFT 10 +#define SH_X_PHASE_CFG_DQ_LD_A_MASK 0x0000000000007c00 + +/* SH_X_PHASE_CFG_DQ_LD_B */ +/* Description: DATA MCI load core clock B latch */ +#define SH_X_PHASE_CFG_DQ_LD_B_SHFT 15 +#define SH_X_PHASE_CFG_DQ_LD_B_MASK 0x00000000000f8000 + +/* SH_X_PHASE_CFG_HOLD */ +/* Description: Hold request on core clock phase */ +#define SH_X_PHASE_CFG_HOLD_SHFT 20 +#define SH_X_PHASE_CFG_HOLD_MASK 0x0000000001f00000 + +/* SH_X_PHASE_CFG_HOLD_REQ */ +/* Description: Hold next request on core clock phase */ +#define SH_X_PHASE_CFG_HOLD_REQ_SHFT 25 +#define SH_X_PHASE_CFG_HOLD_REQ_MASK 0x000000003e000000 + +/* SH_X_PHASE_CFG_ADD_CP */ +/* Description: add delay clock period to dqct delay chain on phase */ +#define SH_X_PHASE_CFG_ADD_CP_SHFT 30 +#define SH_X_PHASE_CFG_ADD_CP_MASK 0x00000007c0000000 + +/* SH_X_PHASE_CFG_BUBBLE_EN */ +/* Description: bubble, idle core clock to wait for memory clock */ +#define SH_X_PHASE_CFG_BUBBLE_EN_SHFT 35 +#define SH_X_PHASE_CFG_BUBBLE_EN_MASK 0x000000f800000000 + +/* SH_X_PHASE_CFG_PHA_BUBBLE */ +/* Description: MMR phaseA bubble value */ +#define SH_X_PHASE_CFG_PHA_BUBBLE_SHFT 40 +#define SH_X_PHASE_CFG_PHA_BUBBLE_MASK 0x0000070000000000 + +/* SH_X_PHASE_CFG_PHB_BUBBLE */ +/* Description: MMR phaseB bubble value */ +#define SH_X_PHASE_CFG_PHB_BUBBLE_SHFT 43 +#define SH_X_PHASE_CFG_PHB_BUBBLE_MASK 0x0000380000000000 + +/* SH_X_PHASE_CFG_PHC_BUBBLE */ +/* Description: MMR phaseC bubble value */ +#define SH_X_PHASE_CFG_PHC_BUBBLE_SHFT 46 +#define SH_X_PHASE_CFG_PHC_BUBBLE_MASK 0x0001c00000000000 + +/* SH_X_PHASE_CFG_PHD_BUBBLE */ +/* Description: MMR phaseD bubble value */ +#define SH_X_PHASE_CFG_PHD_BUBBLE_SHFT 49 +#define SH_X_PHASE_CFG_PHD_BUBBLE_MASK 0x000e000000000000 + +/* SH_X_PHASE_CFG_PHE_BUBBLE */ +/* Description: MMR phaseE bubble value */ +#define SH_X_PHASE_CFG_PHE_BUBBLE_SHFT 52 +#define SH_X_PHASE_CFG_PHE_BUBBLE_MASK 0x0070000000000000 + +/* SH_X_PHASE_CFG_SEL_A */ +/* Description: address,control select A memory clock latch */ +#define SH_X_PHASE_CFG_SEL_A_SHFT 55 +#define SH_X_PHASE_CFG_SEL_A_MASK 0x0780000000000000 + +/* SH_X_PHASE_CFG_DQ_SEL_A */ +/* Description: DATA MCI select A memory clock latch */ +#define SH_X_PHASE_CFG_DQ_SEL_A_SHFT 59 +#define SH_X_PHASE_CFG_DQ_SEL_A_MASK 0x7800000000000000 + +/* ==================================================================== */ +/* Register "SH_X_CFG" */ +/* AC Config Registers */ +/* ==================================================================== */ + +#define SH_X_CFG 0x0000000100010020 +#define SH_X_CFG_MASK 0xffffffffffffffff +#define SH_X_CFG_INIT 0x108443103322100c + +/* SH_X_CFG_MODE_SERIAL */ +/* Description: Arbque arbitration in serial mode */ +#define SH_X_CFG_MODE_SERIAL_SHFT 0 +#define SH_X_CFG_MODE_SERIAL_MASK 0x0000000000000001 + +/* SH_X_CFG_DIRC_RANDOM_REPLACEMENT */ +/* Description: Directory cache random replacement */ +#define SH_X_CFG_DIRC_RANDOM_REPLACEMENT_SHFT 1 +#define SH_X_CFG_DIRC_RANDOM_REPLACEMENT_MASK 0x0000000000000002 + +/* SH_X_CFG_DIR_COUNTER_INIT */ +/* Description: Dir counter initial value */ +#define SH_X_CFG_DIR_COUNTER_INIT_SHFT 2 +#define SH_X_CFG_DIR_COUNTER_INIT_MASK 0x00000000000000fc + +/* SH_X_CFG_TA_DLYS */ +/* Description: Turn around delays */ +#define SH_X_CFG_TA_DLYS_SHFT 8 +#define SH_X_CFG_TA_DLYS_MASK 0x000000ffffffff00 + +/* SH_X_CFG_DA_BB_CLR */ +/* Description: Bank busy CPs for a data read request */ +#define SH_X_CFG_DA_BB_CLR_SHFT 40 +#define SH_X_CFG_DA_BB_CLR_MASK 0x00000f0000000000 + +/* SH_X_CFG_DC_BB_CLR */ +/* Description: Bank busy CPs for a directory cache read request */ +#define SH_X_CFG_DC_BB_CLR_SHFT 44 +#define SH_X_CFG_DC_BB_CLR_MASK 0x0000f00000000000 + +/* SH_X_CFG_WT_BB_CLR */ +/* Description: Bank busy CPs for all write request */ +#define SH_X_CFG_WT_BB_CLR_SHFT 48 +#define SH_X_CFG_WT_BB_CLR_MASK 0x000f000000000000 + +/* SH_X_CFG_SSO_WT_EN */ +/* Description: Simultaneous switching enabled on output data pins */ +#define SH_X_CFG_SSO_WT_EN_SHFT 52 +#define SH_X_CFG_SSO_WT_EN_MASK 0x0010000000000000 + +/* SH_X_CFG_TRCD2_EN */ +/* Description: Trcd, ras to cas delay of 2 CPs enabled */ +#define SH_X_CFG_TRCD2_EN_SHFT 53 +#define SH_X_CFG_TRCD2_EN_MASK 0x0020000000000000 + +/* SH_X_CFG_TRCD4_EN */ +/* Description: Trcd, ras to case delay of 4 CPs enabled */ +#define SH_X_CFG_TRCD4_EN_SHFT 54 +#define SH_X_CFG_TRCD4_EN_MASK 0x0040000000000000 + +/* SH_X_CFG_REQ_CNTR_DIS */ +/* Description: Request delay counter disabled */ +#define SH_X_CFG_REQ_CNTR_DIS_SHFT 55 +#define SH_X_CFG_REQ_CNTR_DIS_MASK 0x0080000000000000 + +/* SH_X_CFG_REQ_CNTR_VAL */ +/* Description: Request counter delay value in CPs */ +#define SH_X_CFG_REQ_CNTR_VAL_SHFT 56 +#define SH_X_CFG_REQ_CNTR_VAL_MASK 0x3f00000000000000 + +/* SH_X_CFG_INV_CAS_ADDR */ +/* Description: Invert cas address bits 3 to 7 */ +#define SH_X_CFG_INV_CAS_ADDR_SHFT 62 +#define SH_X_CFG_INV_CAS_ADDR_MASK 0x4000000000000000 + +/* SH_X_CFG_CLR_DIR_CACHE */ +/* Description: Clear directory cache tags */ +#define SH_X_CFG_CLR_DIR_CACHE_SHFT 63 +#define SH_X_CFG_CLR_DIR_CACHE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_X_DQCT_CFG" */ +/* AC Config Registers */ +/* ==================================================================== */ + +#define SH_X_DQCT_CFG 0x0000000100010028 +#define SH_X_DQCT_CFG_MASK 0x0000000000ffffff +#define SH_X_DQCT_CFG_INIT 0x0000000000585418 + +/* SH_X_DQCT_CFG_RD_SEL */ +/* Description: Read data select */ +#define SH_X_DQCT_CFG_RD_SEL_SHFT 0 +#define SH_X_DQCT_CFG_RD_SEL_MASK 0x000000000000000f + +/* SH_X_DQCT_CFG_WT_SEL */ +/* Description: Write data select */ +#define SH_X_DQCT_CFG_WT_SEL_SHFT 4 +#define SH_X_DQCT_CFG_WT_SEL_MASK 0x00000000000000f0 + +/* SH_X_DQCT_CFG_DTA_RD_SEL */ +/* Description: Data ready read select */ +#define SH_X_DQCT_CFG_DTA_RD_SEL_SHFT 8 +#define SH_X_DQCT_CFG_DTA_RD_SEL_MASK 0x0000000000000f00 + +/* SH_X_DQCT_CFG_DTA_WT_SEL */ +/* Description: Data ready write select */ +#define SH_X_DQCT_CFG_DTA_WT_SEL_SHFT 12 +#define SH_X_DQCT_CFG_DTA_WT_SEL_MASK 0x000000000000f000 + +/* SH_X_DQCT_CFG_DIR_RD_SEL */ +/* Description: Dir ready read select */ +#define SH_X_DQCT_CFG_DIR_RD_SEL_SHFT 16 +#define SH_X_DQCT_CFG_DIR_RD_SEL_MASK 0x00000000000f0000 + +/* SH_X_DQCT_CFG_MDIR_RD_SEL */ +/* Description: Dir ready read select */ +#define SH_X_DQCT_CFG_MDIR_RD_SEL_SHFT 20 +#define SH_X_DQCT_CFG_MDIR_RD_SEL_MASK 0x0000000000f00000 + +/* ==================================================================== */ +/* Register "SH_X_REFRESH_CONTROL" */ +/* Refresh Control Register */ +/* ==================================================================== */ + +#define SH_X_REFRESH_CONTROL 0x0000000100010030 +#define SH_X_REFRESH_CONTROL_MASK 0x000000000fffffff +#define SH_X_REFRESH_CONTROL_INIT 0x00000000009cc300 + +/* SH_X_REFRESH_CONTROL_ENABLE */ +/* Description: Refresh enable */ +#define SH_X_REFRESH_CONTROL_ENABLE_SHFT 0 +#define SH_X_REFRESH_CONTROL_ENABLE_MASK 0x00000000000000ff + +/* SH_X_REFRESH_CONTROL_INTERVAL */ +/* Description: Refresh interval in core CPs */ +#define SH_X_REFRESH_CONTROL_INTERVAL_SHFT 8 +#define SH_X_REFRESH_CONTROL_INTERVAL_MASK 0x000000000001ff00 + +/* SH_X_REFRESH_CONTROL_HOLD */ +/* Description: Refresh hold */ +#define SH_X_REFRESH_CONTROL_HOLD_SHFT 17 +#define SH_X_REFRESH_CONTROL_HOLD_MASK 0x00000000007e0000 + +/* SH_X_REFRESH_CONTROL_INTERLEAVE */ +/* Description: Refresh interleave */ +#define SH_X_REFRESH_CONTROL_INTERLEAVE_SHFT 23 +#define SH_X_REFRESH_CONTROL_INTERLEAVE_MASK 0x0000000000800000 + +/* SH_X_REFRESH_CONTROL_HALF_RATE */ +/* Description: Refresh half rate */ +#define SH_X_REFRESH_CONTROL_HALF_RATE_SHFT 24 +#define SH_X_REFRESH_CONTROL_HALF_RATE_MASK 0x000000000f000000 + +/* ==================================================================== */ +/* Register "SH_Y_PHASE_CFG" */ +/* AC Phase Config Registers */ +/* ==================================================================== */ + +#define SH_Y_PHASE_CFG 0x0000000100010038 +#define SH_Y_PHASE_CFG_MASK 0x7fffffffffffffff +#define SH_Y_PHASE_CFG_INIT 0x0000000000000000 + +/* SH_Y_PHASE_CFG_LD_A */ +/* Description: Address, control load core clock A latch */ +#define SH_Y_PHASE_CFG_LD_A_SHFT 0 +#define SH_Y_PHASE_CFG_LD_A_MASK 0x000000000000001f + +/* SH_Y_PHASE_CFG_LD_B */ +/* Description: Address, control load core clock B latch */ +#define SH_Y_PHASE_CFG_LD_B_SHFT 5 +#define SH_Y_PHASE_CFG_LD_B_MASK 0x00000000000003e0 + +/* SH_Y_PHASE_CFG_DQ_LD_A */ +/* Description: DATA MCI load core clock A latch */ +#define SH_Y_PHASE_CFG_DQ_LD_A_SHFT 10 +#define SH_Y_PHASE_CFG_DQ_LD_A_MASK 0x0000000000007c00 + +/* SH_Y_PHASE_CFG_DQ_LD_B */ +/* Description: DATA MCI load core clock B latch */ +#define SH_Y_PHASE_CFG_DQ_LD_B_SHFT 15 +#define SH_Y_PHASE_CFG_DQ_LD_B_MASK 0x00000000000f8000 + +/* SH_Y_PHASE_CFG_HOLD */ +/* Description: Hold request on core clock phase */ +#define SH_Y_PHASE_CFG_HOLD_SHFT 20 +#define SH_Y_PHASE_CFG_HOLD_MASK 0x0000000001f00000 + +/* SH_Y_PHASE_CFG_HOLD_REQ */ +/* Description: Hold next request on core clock phase */ +#define SH_Y_PHASE_CFG_HOLD_REQ_SHFT 25 +#define SH_Y_PHASE_CFG_HOLD_REQ_MASK 0x000000003e000000 + +/* SH_Y_PHASE_CFG_ADD_CP */ +/* Description: add delay clock period to dqct delay chain on phase */ +#define SH_Y_PHASE_CFG_ADD_CP_SHFT 30 +#define SH_Y_PHASE_CFG_ADD_CP_MASK 0x00000007c0000000 + +/* SH_Y_PHASE_CFG_BUBBLE_EN */ +/* Description: bubble, idle core clock to wait for memory clock */ +#define SH_Y_PHASE_CFG_BUBBLE_EN_SHFT 35 +#define SH_Y_PHASE_CFG_BUBBLE_EN_MASK 0x000000f800000000 + +/* SH_Y_PHASE_CFG_PHA_BUBBLE */ +/* Description: MMR phaseA bubble value */ +#define SH_Y_PHASE_CFG_PHA_BUBBLE_SHFT 40 +#define SH_Y_PHASE_CFG_PHA_BUBBLE_MASK 0x0000070000000000 + +/* SH_Y_PHASE_CFG_PHB_BUBBLE */ +/* Description: MMR phaseB bubble value */ +#define SH_Y_PHASE_CFG_PHB_BUBBLE_SHFT 43 +#define SH_Y_PHASE_CFG_PHB_BUBBLE_MASK 0x0000380000000000 + +/* SH_Y_PHASE_CFG_PHC_BUBBLE */ +/* Description: MMR phaseC bubble value */ +#define SH_Y_PHASE_CFG_PHC_BUBBLE_SHFT 46 +#define SH_Y_PHASE_CFG_PHC_BUBBLE_MASK 0x0001c00000000000 + +/* SH_Y_PHASE_CFG_PHD_BUBBLE */ +/* Description: MMR phaseD bubble value */ +#define SH_Y_PHASE_CFG_PHD_BUBBLE_SHFT 49 +#define SH_Y_PHASE_CFG_PHD_BUBBLE_MASK 0x000e000000000000 + +/* SH_Y_PHASE_CFG_PHE_BUBBLE */ +/* Description: MMR phaseE bubble value */ +#define SH_Y_PHASE_CFG_PHE_BUBBLE_SHFT 52 +#define SH_Y_PHASE_CFG_PHE_BUBBLE_MASK 0x0070000000000000 + +/* SH_Y_PHASE_CFG_SEL_A */ +/* Description: address,control select A memory clock latch */ +#define SH_Y_PHASE_CFG_SEL_A_SHFT 55 +#define SH_Y_PHASE_CFG_SEL_A_MASK 0x0780000000000000 + +/* SH_Y_PHASE_CFG_DQ_SEL_A */ +/* Description: DATA MCI select A memory clock latch */ +#define SH_Y_PHASE_CFG_DQ_SEL_A_SHFT 59 +#define SH_Y_PHASE_CFG_DQ_SEL_A_MASK 0x7800000000000000 + +/* ==================================================================== */ +/* Register "SH_Y_CFG" */ +/* AC Config Registers */ +/* ==================================================================== */ + +#define SH_Y_CFG 0x0000000100010040 +#define SH_Y_CFG_MASK 0xffffffffffffffff +#define SH_Y_CFG_INIT 0x108443103322100c + +/* SH_Y_CFG_MODE_SERIAL */ +/* Description: Arbque arbitration in serial mode */ +#define SH_Y_CFG_MODE_SERIAL_SHFT 0 +#define SH_Y_CFG_MODE_SERIAL_MASK 0x0000000000000001 + +/* SH_Y_CFG_DIRC_RANDOM_REPLACEMENT */ +/* Description: Directory cache random replacement */ +#define SH_Y_CFG_DIRC_RANDOM_REPLACEMENT_SHFT 1 +#define SH_Y_CFG_DIRC_RANDOM_REPLACEMENT_MASK 0x0000000000000002 + +/* SH_Y_CFG_DIR_COUNTER_INIT */ +/* Description: Dir counter initial value */ +#define SH_Y_CFG_DIR_COUNTER_INIT_SHFT 2 +#define SH_Y_CFG_DIR_COUNTER_INIT_MASK 0x00000000000000fc + +/* SH_Y_CFG_TA_DLYS */ +/* Description: Turn around delays */ +#define SH_Y_CFG_TA_DLYS_SHFT 8 +#define SH_Y_CFG_TA_DLYS_MASK 0x000000ffffffff00 + +/* SH_Y_CFG_DA_BB_CLR */ +/* Description: Bank busy CPs for a data read request */ +#define SH_Y_CFG_DA_BB_CLR_SHFT 40 +#define SH_Y_CFG_DA_BB_CLR_MASK 0x00000f0000000000 + +/* SH_Y_CFG_DC_BB_CLR */ +/* Description: Bank busy CPs for a directory cache read request */ +#define SH_Y_CFG_DC_BB_CLR_SHFT 44 +#define SH_Y_CFG_DC_BB_CLR_MASK 0x0000f00000000000 + +/* SH_Y_CFG_WT_BB_CLR */ +/* Description: Bank busy CPs for all write request */ +#define SH_Y_CFG_WT_BB_CLR_SHFT 48 +#define SH_Y_CFG_WT_BB_CLR_MASK 0x000f000000000000 + +/* SH_Y_CFG_SSO_WT_EN */ +/* Description: Simultaneous switching enabled on output data pins */ +#define SH_Y_CFG_SSO_WT_EN_SHFT 52 +#define SH_Y_CFG_SSO_WT_EN_MASK 0x0010000000000000 + +/* SH_Y_CFG_TRCD2_EN */ +/* Description: Trcd, ras to cas delay of 2 CPs enabled */ +#define SH_Y_CFG_TRCD2_EN_SHFT 53 +#define SH_Y_CFG_TRCD2_EN_MASK 0x0020000000000000 + +/* SH_Y_CFG_TRCD4_EN */ +/* Description: Trcd, ras to case delay of 4 CPs enabled */ +#define SH_Y_CFG_TRCD4_EN_SHFT 54 +#define SH_Y_CFG_TRCD4_EN_MASK 0x0040000000000000 + +/* SH_Y_CFG_REQ_CNTR_DIS */ +/* Description: Request delay counter disabled */ +#define SH_Y_CFG_REQ_CNTR_DIS_SHFT 55 +#define SH_Y_CFG_REQ_CNTR_DIS_MASK 0x0080000000000000 + +/* SH_Y_CFG_REQ_CNTR_VAL */ +/* Description: Request counter delay value in CPs */ +#define SH_Y_CFG_REQ_CNTR_VAL_SHFT 56 +#define SH_Y_CFG_REQ_CNTR_VAL_MASK 0x3f00000000000000 + +/* SH_Y_CFG_INV_CAS_ADDR */ +/* Description: Invert cas address bits 3 to 7 */ +#define SH_Y_CFG_INV_CAS_ADDR_SHFT 62 +#define SH_Y_CFG_INV_CAS_ADDR_MASK 0x4000000000000000 + +/* SH_Y_CFG_CLR_DIR_CACHE */ +/* Description: Clear directory cache tags */ +#define SH_Y_CFG_CLR_DIR_CACHE_SHFT 63 +#define SH_Y_CFG_CLR_DIR_CACHE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_Y_DQCT_CFG" */ +/* AC Config Registers */ +/* ==================================================================== */ + +#define SH_Y_DQCT_CFG 0x0000000100010048 +#define SH_Y_DQCT_CFG_MASK 0x0000000000ffffff +#define SH_Y_DQCT_CFG_INIT 0x0000000000585418 + +/* SH_Y_DQCT_CFG_RD_SEL */ +/* Description: Read data select */ +#define SH_Y_DQCT_CFG_RD_SEL_SHFT 0 +#define SH_Y_DQCT_CFG_RD_SEL_MASK 0x000000000000000f + +/* SH_Y_DQCT_CFG_WT_SEL */ +/* Description: Write data select */ +#define SH_Y_DQCT_CFG_WT_SEL_SHFT 4 +#define SH_Y_DQCT_CFG_WT_SEL_MASK 0x00000000000000f0 + +/* SH_Y_DQCT_CFG_DTA_RD_SEL */ +/* Description: Data ready read select */ +#define SH_Y_DQCT_CFG_DTA_RD_SEL_SHFT 8 +#define SH_Y_DQCT_CFG_DTA_RD_SEL_MASK 0x0000000000000f00 + +/* SH_Y_DQCT_CFG_DTA_WT_SEL */ +/* Description: Data ready write select */ +#define SH_Y_DQCT_CFG_DTA_WT_SEL_SHFT 12 +#define SH_Y_DQCT_CFG_DTA_WT_SEL_MASK 0x000000000000f000 + +/* SH_Y_DQCT_CFG_DIR_RD_SEL */ +/* Description: Dir ready read select */ +#define SH_Y_DQCT_CFG_DIR_RD_SEL_SHFT 16 +#define SH_Y_DQCT_CFG_DIR_RD_SEL_MASK 0x00000000000f0000 + +/* SH_Y_DQCT_CFG_MDIR_RD_SEL */ +/* Description: Dir ready read select */ +#define SH_Y_DQCT_CFG_MDIR_RD_SEL_SHFT 20 +#define SH_Y_DQCT_CFG_MDIR_RD_SEL_MASK 0x0000000000f00000 + +/* ==================================================================== */ +/* Register "SH_Y_REFRESH_CONTROL" */ +/* Refresh Control Register */ +/* ==================================================================== */ + +#define SH_Y_REFRESH_CONTROL 0x0000000100010050 +#define SH_Y_REFRESH_CONTROL_MASK 0x000000000fffffff +#define SH_Y_REFRESH_CONTROL_INIT 0x00000000009cc300 + +/* SH_Y_REFRESH_CONTROL_ENABLE */ +/* Description: Refresh enable */ +#define SH_Y_REFRESH_CONTROL_ENABLE_SHFT 0 +#define SH_Y_REFRESH_CONTROL_ENABLE_MASK 0x00000000000000ff + +/* SH_Y_REFRESH_CONTROL_INTERVAL */ +/* Description: Refresh interval in core CPs */ +#define SH_Y_REFRESH_CONTROL_INTERVAL_SHFT 8 +#define SH_Y_REFRESH_CONTROL_INTERVAL_MASK 0x000000000001ff00 + +/* SH_Y_REFRESH_CONTROL_HOLD */ +/* Description: Refresh hold */ +#define SH_Y_REFRESH_CONTROL_HOLD_SHFT 17 +#define SH_Y_REFRESH_CONTROL_HOLD_MASK 0x00000000007e0000 + +/* SH_Y_REFRESH_CONTROL_INTERLEAVE */ +/* Description: Refresh interleave */ +#define SH_Y_REFRESH_CONTROL_INTERLEAVE_SHFT 23 +#define SH_Y_REFRESH_CONTROL_INTERLEAVE_MASK 0x0000000000800000 + +/* SH_Y_REFRESH_CONTROL_HALF_RATE */ +/* Description: Refresh half rate */ +#define SH_Y_REFRESH_CONTROL_HALF_RATE_SHFT 24 +#define SH_Y_REFRESH_CONTROL_HALF_RATE_MASK 0x000000000f000000 + +/* ==================================================================== */ +/* Register "SH_MEM_RED_BLACK" */ +/* MD fairness watchdog timers */ +/* ==================================================================== */ + +#define SH_MEM_RED_BLACK 0x0000000100010058 +#define SH_MEM_RED_BLACK_MASK 0x000fffffffffffff +#define SH_MEM_RED_BLACK_INIT 0x0000000040000400 + +/* SH_MEM_RED_BLACK_TIME */ +/* Description: Clocks to tag references with a given color */ +#define SH_MEM_RED_BLACK_TIME_SHFT 0 +#define SH_MEM_RED_BLACK_TIME_MASK 0x000000000000ffff + +/* SH_MEM_RED_BLACK_ERR_TIME */ +/* Description: Max clocks to wait after red/black change for old c */ +/* olor to clear. */ +#define SH_MEM_RED_BLACK_ERR_TIME_SHFT 16 +#define SH_MEM_RED_BLACK_ERR_TIME_MASK 0x000fffffffff0000 + +/* ==================================================================== */ +/* Register "SH_MISC_MEM_CFG" */ +/* ==================================================================== */ + +#define SH_MISC_MEM_CFG 0x0000000100010060 +#define SH_MISC_MEM_CFG_MASK 0x0013f1f1fff3f3ff +#define SH_MISC_MEM_CFG_INIT 0x0000000000010107 + +/* SH_MISC_MEM_CFG_EXPRESS_HEADER_ENABLE */ +/* Description: enables the use of express headers from md to pi */ +#define SH_MISC_MEM_CFG_EXPRESS_HEADER_ENABLE_SHFT 0 +#define SH_MISC_MEM_CFG_EXPRESS_HEADER_ENABLE_MASK 0x0000000000000001 + +/* SH_MISC_MEM_CFG_SPEC_HEADER_ENABLE */ +/* Description: enables the use of speculative headers from md to p */ +#define SH_MISC_MEM_CFG_SPEC_HEADER_ENABLE_SHFT 1 +#define SH_MISC_MEM_CFG_SPEC_HEADER_ENABLE_MASK 0x0000000000000002 + +/* SH_MISC_MEM_CFG_JNR_BYPASS_ENABLE */ +/* Description: enables bypass path for requests going through ac */ +#define SH_MISC_MEM_CFG_JNR_BYPASS_ENABLE_SHFT 2 +#define SH_MISC_MEM_CFG_JNR_BYPASS_ENABLE_MASK 0x0000000000000004 + +/* SH_MISC_MEM_CFG_XN_RD_SAME_AS_PI */ +/* Description: disables a one clock delay of XN read data */ +#define SH_MISC_MEM_CFG_XN_RD_SAME_AS_PI_SHFT 3 +#define SH_MISC_MEM_CFG_XN_RD_SAME_AS_PI_MASK 0x0000000000000008 + +/* SH_MISC_MEM_CFG_LOW_WRITE_BUFFER_THRESHOLD */ +/* Description: point at which data writes get higher priority */ +#define SH_MISC_MEM_CFG_LOW_WRITE_BUFFER_THRESHOLD_SHFT 4 +#define SH_MISC_MEM_CFG_LOW_WRITE_BUFFER_THRESHOLD_MASK 0x00000000000003f0 + +/* SH_MISC_MEM_CFG_LOW_VICTIM_BUFFER_THRESHOLD */ +/* Description: point at which dir cache writes get higher priority */ +#define SH_MISC_MEM_CFG_LOW_VICTIM_BUFFER_THRESHOLD_SHFT 12 +#define SH_MISC_MEM_CFG_LOW_VICTIM_BUFFER_THRESHOLD_MASK 0x000000000003f000 + +/* SH_MISC_MEM_CFG_THROTTLE_CNT */ +/* Description: number of clocks between accepting references */ +#define SH_MISC_MEM_CFG_THROTTLE_CNT_SHFT 20 +#define SH_MISC_MEM_CFG_THROTTLE_CNT_MASK 0x000000000ff00000 + +/* SH_MISC_MEM_CFG_DISABLED_READ_TNUMS */ +/* Description: number of read tnums to take out of circulation */ +#define SH_MISC_MEM_CFG_DISABLED_READ_TNUMS_SHFT 28 +#define SH_MISC_MEM_CFG_DISABLED_READ_TNUMS_MASK 0x00000001f0000000 + +/* SH_MISC_MEM_CFG_DISABLED_WRITE_TNUMS */ +/* Description: number of write tnums to take out of circulation */ +#define SH_MISC_MEM_CFG_DISABLED_WRITE_TNUMS_SHFT 36 +#define SH_MISC_MEM_CFG_DISABLED_WRITE_TNUMS_MASK 0x000001f000000000 + +/* SH_MISC_MEM_CFG_DISABLED_VICTIMS */ +/* Description: number of dir cache victim buffers to take out of c */ +/* irculation in each quadrant of the MD */ +#define SH_MISC_MEM_CFG_DISABLED_VICTIMS_SHFT 44 +#define SH_MISC_MEM_CFG_DISABLED_VICTIMS_MASK 0x0003f00000000000 + +/* SH_MISC_MEM_CFG_ALTERNATE_XN_RP_PLANE */ +/* Description: enables plane alternating for replies to XN */ +#define SH_MISC_MEM_CFG_ALTERNATE_XN_RP_PLANE_SHFT 52 +#define SH_MISC_MEM_CFG_ALTERNATE_XN_RP_PLANE_MASK 0x0010000000000000 + +/* ==================================================================== */ +/* Register "SH_PIO_RQ_CRD_CTL" */ +/* pio_rq Credit Circulation Control */ +/* ==================================================================== */ + +#define SH_PIO_RQ_CRD_CTL 0x0000000100010068 +#define SH_PIO_RQ_CRD_CTL_MASK 0x000000000000003f +#define SH_PIO_RQ_CRD_CTL_INIT 0x0000000000000002 + +/* SH_PIO_RQ_CRD_CTL_DEPTH */ +/* Description: Total depth of buffering (in sic packets) */ +#define SH_PIO_RQ_CRD_CTL_DEPTH_SHFT 0 +#define SH_PIO_RQ_CRD_CTL_DEPTH_MASK 0x000000000000003f + +/* ==================================================================== */ +/* Register "SH_PI_MD_RQ_CRD_CTL" */ +/* pi_md_rq Credit Circulation Control */ +/* ==================================================================== */ + +#define SH_PI_MD_RQ_CRD_CTL 0x0000000100010070 +#define SH_PI_MD_RQ_CRD_CTL_MASK 0x000000000000003f +#define SH_PI_MD_RQ_CRD_CTL_INIT 0x0000000000000008 + +/* SH_PI_MD_RQ_CRD_CTL_DEPTH */ +/* Description: Total depth of buffering (in sic packets) */ +#define SH_PI_MD_RQ_CRD_CTL_DEPTH_SHFT 0 +#define SH_PI_MD_RQ_CRD_CTL_DEPTH_MASK 0x000000000000003f + +/* ==================================================================== */ +/* Register "SH_PI_MD_RP_CRD_CTL" */ +/* pi_md_rp Credit Circulation Control */ +/* ==================================================================== */ + +#define SH_PI_MD_RP_CRD_CTL 0x0000000100010078 +#define SH_PI_MD_RP_CRD_CTL_MASK 0x000000000000003f +#define SH_PI_MD_RP_CRD_CTL_INIT 0x0000000000000004 + +/* SH_PI_MD_RP_CRD_CTL_DEPTH */ +/* Description: Total depth of buffering (in sic packets) */ +#define SH_PI_MD_RP_CRD_CTL_DEPTH_SHFT 0 +#define SH_PI_MD_RP_CRD_CTL_DEPTH_MASK 0x000000000000003f + +/* ==================================================================== */ +/* Register "SH_XN_MD_RQ_CRD_CTL" */ +/* xn_md_rq Credit Circulation Control */ +/* ==================================================================== */ + +#define SH_XN_MD_RQ_CRD_CTL 0x0000000100010080 +#define SH_XN_MD_RQ_CRD_CTL_MASK 0x000000000000003f +#define SH_XN_MD_RQ_CRD_CTL_INIT 0x0000000000000008 + +/* SH_XN_MD_RQ_CRD_CTL_DEPTH */ +/* Description: Total depth of buffering (in sic packets) */ +#define SH_XN_MD_RQ_CRD_CTL_DEPTH_SHFT 0 +#define SH_XN_MD_RQ_CRD_CTL_DEPTH_MASK 0x000000000000003f + +/* ==================================================================== */ +/* Register "SH_XN_MD_RP_CRD_CTL" */ +/* xn_md_rp Credit Circulation Control */ +/* ==================================================================== */ + +#define SH_XN_MD_RP_CRD_CTL 0x0000000100010088 +#define SH_XN_MD_RP_CRD_CTL_MASK 0x000000000000003f +#define SH_XN_MD_RP_CRD_CTL_INIT 0x0000000000000004 + +/* SH_XN_MD_RP_CRD_CTL_DEPTH */ +/* Description: Total depth of buffering (in sic packets) */ +#define SH_XN_MD_RP_CRD_CTL_DEPTH_SHFT 0 +#define SH_XN_MD_RP_CRD_CTL_DEPTH_MASK 0x000000000000003f + +/* ==================================================================== */ +/* Register "SH_X_TAG0" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_X_TAG0 0x0000000100020000 +#define SH_X_TAG0_MASK 0x00000000000fffff +#define SH_X_TAG0_INIT 0x0000000000000000 + +/* SH_X_TAG0_TAG */ +/* Description: Valid + Tag Address */ +#define SH_X_TAG0_TAG_SHFT 0 +#define SH_X_TAG0_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_X_TAG1" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_X_TAG1 0x0000000100020008 +#define SH_X_TAG1_MASK 0x00000000000fffff +#define SH_X_TAG1_INIT 0x0000000000000000 + +/* SH_X_TAG1_TAG */ +/* Description: Valid + Tag Address */ +#define SH_X_TAG1_TAG_SHFT 0 +#define SH_X_TAG1_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_X_TAG2" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_X_TAG2 0x0000000100020010 +#define SH_X_TAG2_MASK 0x00000000000fffff +#define SH_X_TAG2_INIT 0x0000000000000000 + +/* SH_X_TAG2_TAG */ +/* Description: Valid + Tag Address */ +#define SH_X_TAG2_TAG_SHFT 0 +#define SH_X_TAG2_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_X_TAG3" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_X_TAG3 0x0000000100020018 +#define SH_X_TAG3_MASK 0x00000000000fffff +#define SH_X_TAG3_INIT 0x0000000000000000 + +/* SH_X_TAG3_TAG */ +/* Description: Valid + Tag Address */ +#define SH_X_TAG3_TAG_SHFT 0 +#define SH_X_TAG3_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_X_TAG4" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_X_TAG4 0x0000000100020020 +#define SH_X_TAG4_MASK 0x00000000000fffff +#define SH_X_TAG4_INIT 0x0000000000000000 + +/* SH_X_TAG4_TAG */ +/* Description: Valid + Tag Address */ +#define SH_X_TAG4_TAG_SHFT 0 +#define SH_X_TAG4_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_X_TAG5" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_X_TAG5 0x0000000100020028 +#define SH_X_TAG5_MASK 0x00000000000fffff +#define SH_X_TAG5_INIT 0x0000000000000000 + +/* SH_X_TAG5_TAG */ +/* Description: Valid + Tag Address */ +#define SH_X_TAG5_TAG_SHFT 0 +#define SH_X_TAG5_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_X_TAG6" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_X_TAG6 0x0000000100020030 +#define SH_X_TAG6_MASK 0x00000000000fffff +#define SH_X_TAG6_INIT 0x0000000000000000 + +/* SH_X_TAG6_TAG */ +/* Description: Valid + Tag Address */ +#define SH_X_TAG6_TAG_SHFT 0 +#define SH_X_TAG6_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_X_TAG7" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_X_TAG7 0x0000000100020038 +#define SH_X_TAG7_MASK 0x00000000000fffff +#define SH_X_TAG7_INIT 0x0000000000000000 + +/* SH_X_TAG7_TAG */ +/* Description: Valid + Tag Address */ +#define SH_X_TAG7_TAG_SHFT 0 +#define SH_X_TAG7_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_Y_TAG0" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_Y_TAG0 0x0000000100020040 +#define SH_Y_TAG0_MASK 0x00000000000fffff +#define SH_Y_TAG0_INIT 0x0000000000000000 + +/* SH_Y_TAG0_TAG */ +/* Description: Valid + Tag Address */ +#define SH_Y_TAG0_TAG_SHFT 0 +#define SH_Y_TAG0_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_Y_TAG1" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_Y_TAG1 0x0000000100020048 +#define SH_Y_TAG1_MASK 0x00000000000fffff +#define SH_Y_TAG1_INIT 0x0000000000000000 + +/* SH_Y_TAG1_TAG */ +/* Description: Valid + Tag Address */ +#define SH_Y_TAG1_TAG_SHFT 0 +#define SH_Y_TAG1_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_Y_TAG2" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_Y_TAG2 0x0000000100020050 +#define SH_Y_TAG2_MASK 0x00000000000fffff +#define SH_Y_TAG2_INIT 0x0000000000000000 + +/* SH_Y_TAG2_TAG */ +/* Description: Valid + Tag Address */ +#define SH_Y_TAG2_TAG_SHFT 0 +#define SH_Y_TAG2_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_Y_TAG3" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_Y_TAG3 0x0000000100020058 +#define SH_Y_TAG3_MASK 0x00000000000fffff +#define SH_Y_TAG3_INIT 0x0000000000000000 + +/* SH_Y_TAG3_TAG */ +/* Description: Valid + Tag Address */ +#define SH_Y_TAG3_TAG_SHFT 0 +#define SH_Y_TAG3_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_Y_TAG4" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_Y_TAG4 0x0000000100020060 +#define SH_Y_TAG4_MASK 0x00000000000fffff +#define SH_Y_TAG4_INIT 0x0000000000000000 + +/* SH_Y_TAG4_TAG */ +/* Description: Valid + Tag Address */ +#define SH_Y_TAG4_TAG_SHFT 0 +#define SH_Y_TAG4_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_Y_TAG5" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_Y_TAG5 0x0000000100020068 +#define SH_Y_TAG5_MASK 0x00000000000fffff +#define SH_Y_TAG5_INIT 0x0000000000000000 + +/* SH_Y_TAG5_TAG */ +/* Description: Valid + Tag Address */ +#define SH_Y_TAG5_TAG_SHFT 0 +#define SH_Y_TAG5_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_Y_TAG6" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_Y_TAG6 0x0000000100020070 +#define SH_Y_TAG6_MASK 0x00000000000fffff +#define SH_Y_TAG6_INIT 0x0000000000000000 + +/* SH_Y_TAG6_TAG */ +/* Description: Valid + Tag Address */ +#define SH_Y_TAG6_TAG_SHFT 0 +#define SH_Y_TAG6_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_Y_TAG7" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#define SH_Y_TAG7 0x0000000100020078 +#define SH_Y_TAG7_MASK 0x00000000000fffff +#define SH_Y_TAG7_INIT 0x0000000000000000 + +/* SH_Y_TAG7_TAG */ +/* Description: Valid + Tag Address */ +#define SH_Y_TAG7_TAG_SHFT 0 +#define SH_Y_TAG7_TAG_MASK 0x00000000000fffff + +/* ==================================================================== */ +/* Register "SH_MMRBIST_BASE" */ +/* mmr/bist base address */ +/* ==================================================================== */ + +#define SH_MMRBIST_BASE 0x0000000100020080 +#define SH_MMRBIST_BASE_MASK 0x0003fffffffffff8 +#define SH_MMRBIST_BASE_INIT 0x0000000000000000 + +/* SH_MMRBIST_BASE_DWORD_ADDR */ +/* Description: bits 49:3 of the memory address */ +#define SH_MMRBIST_BASE_DWORD_ADDR_SHFT 3 +#define SH_MMRBIST_BASE_DWORD_ADDR_MASK 0x0003fffffffffff8 + +/* ==================================================================== */ +/* Register "SH_MMRBIST_CTL" */ +/* Bist base address */ +/* ==================================================================== */ + +#define SH_MMRBIST_CTL 0x0000000100020088 +#define SH_MMRBIST_CTL_MASK 0x0000177f7fffffff +#define SH_MMRBIST_CTL_INIT 0x0000000000000000 + +/* SH_MMRBIST_CTL_BLOCK_LENGTH */ +/* Description: number of dwords in operation */ +#define SH_MMRBIST_CTL_BLOCK_LENGTH_SHFT 0 +#define SH_MMRBIST_CTL_BLOCK_LENGTH_MASK 0x000000007fffffff + +/* SH_MMRBIST_CTL_CMD */ +/* Description: mmr/bist function */ +#define SH_MMRBIST_CTL_CMD_SHFT 32 +#define SH_MMRBIST_CTL_CMD_MASK 0x0000007f00000000 + +/* SH_MMRBIST_CTL_IN_PROGRESS */ +/* Description: writing a 1 starts operation, hardware clears on co */ +/* mpletion */ +#define SH_MMRBIST_CTL_IN_PROGRESS_SHFT 40 +#define SH_MMRBIST_CTL_IN_PROGRESS_MASK 0x0000010000000000 + +/* SH_MMRBIST_CTL_FAIL */ +/* Description: mmr/bist had a data or address error */ +#define SH_MMRBIST_CTL_FAIL_SHFT 41 +#define SH_MMRBIST_CTL_FAIL_MASK 0x0000020000000000 + +/* SH_MMRBIST_CTL_MEM_IDLE */ +/* Description: all memory activity is complete */ +#define SH_MMRBIST_CTL_MEM_IDLE_SHFT 42 +#define SH_MMRBIST_CTL_MEM_IDLE_MASK 0x0000040000000000 + +/* SH_MMRBIST_CTL_RESET_STATE */ +/* Description: writing a 1 resets mmrbist hardware, hardware clear */ +/* s on completion */ +#define SH_MMRBIST_CTL_RESET_STATE_SHFT 44 +#define SH_MMRBIST_CTL_RESET_STATE_MASK 0x0000100000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DBUG_DATA_CFG" */ +/* configuration for md debug data muxes */ +/* ==================================================================== */ + +#define SH_MD_DBUG_DATA_CFG 0x0000000100020100 +#define SH_MD_DBUG_DATA_CFG_MASK 0x7777777777777777 +#define SH_MD_DBUG_DATA_CFG_INIT 0x0000000000000000 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE0_CHIPLET */ +/* Description: selects which md chiplet drives nibble0 */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE0_CHIPLET_SHFT 0 +#define SH_MD_DBUG_DATA_CFG_NIBBLE0_CHIPLET_MASK 0x0000000000000007 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE0_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE0_NIBBLE_SHFT 4 +#define SH_MD_DBUG_DATA_CFG_NIBBLE0_NIBBLE_MASK 0x0000000000000070 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE1_CHIPLET */ +/* Description: selects which md chiplet drives nibble1 */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE1_CHIPLET_SHFT 8 +#define SH_MD_DBUG_DATA_CFG_NIBBLE1_CHIPLET_MASK 0x0000000000000700 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE1_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE1_NIBBLE_SHFT 12 +#define SH_MD_DBUG_DATA_CFG_NIBBLE1_NIBBLE_MASK 0x0000000000007000 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE2_CHIPLET */ +/* Description: selects which md chiplet drives nibble2 */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE2_CHIPLET_SHFT 16 +#define SH_MD_DBUG_DATA_CFG_NIBBLE2_CHIPLET_MASK 0x0000000000070000 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE2_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE2_NIBBLE_SHFT 20 +#define SH_MD_DBUG_DATA_CFG_NIBBLE2_NIBBLE_MASK 0x0000000000700000 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE3_CHIPLET */ +/* Description: selects which md chiplet drives nibble3 */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE3_CHIPLET_SHFT 24 +#define SH_MD_DBUG_DATA_CFG_NIBBLE3_CHIPLET_MASK 0x0000000007000000 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE3_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE3_NIBBLE_SHFT 28 +#define SH_MD_DBUG_DATA_CFG_NIBBLE3_NIBBLE_MASK 0x0000000070000000 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE4_CHIPLET */ +/* Description: selects which md chiplet drives nibble4 */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE4_CHIPLET_SHFT 32 +#define SH_MD_DBUG_DATA_CFG_NIBBLE4_CHIPLET_MASK 0x0000000700000000 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE4_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE4_NIBBLE_SHFT 36 +#define SH_MD_DBUG_DATA_CFG_NIBBLE4_NIBBLE_MASK 0x0000007000000000 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE5_CHIPLET */ +/* Description: selects which md chiplet drives nibble5 */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE5_CHIPLET_SHFT 40 +#define SH_MD_DBUG_DATA_CFG_NIBBLE5_CHIPLET_MASK 0x0000070000000000 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE5_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE5_NIBBLE_SHFT 44 +#define SH_MD_DBUG_DATA_CFG_NIBBLE5_NIBBLE_MASK 0x0000700000000000 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE6_CHIPLET */ +/* Description: selects which md chiplet drives nibble6 */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE6_CHIPLET_SHFT 48 +#define SH_MD_DBUG_DATA_CFG_NIBBLE6_CHIPLET_MASK 0x0007000000000000 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE6_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE6_NIBBLE_SHFT 52 +#define SH_MD_DBUG_DATA_CFG_NIBBLE6_NIBBLE_MASK 0x0070000000000000 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE7_CHIPLET */ +/* Description: selects which md chiplet drives nibble7 */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE7_CHIPLET_SHFT 56 +#define SH_MD_DBUG_DATA_CFG_NIBBLE7_CHIPLET_MASK 0x0700000000000000 + +/* SH_MD_DBUG_DATA_CFG_NIBBLE7_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_DATA_CFG_NIBBLE7_NIBBLE_SHFT 60 +#define SH_MD_DBUG_DATA_CFG_NIBBLE7_NIBBLE_MASK 0x7000000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DBUG_TRIGGER_CFG" */ +/* configuration for md debug triggers */ +/* ==================================================================== */ + +#define SH_MD_DBUG_TRIGGER_CFG 0x0000000100020108 +#define SH_MD_DBUG_TRIGGER_CFG_MASK 0xf777777777777777 +#define SH_MD_DBUG_TRIGGER_CFG_INIT 0x0000000000000000 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE0_CHIPLET */ +/* Description: selects which md chiplet drives nibble0 */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE0_CHIPLET_SHFT 0 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE0_CHIPLET_MASK 0x0000000000000007 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE0_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE0_NIBBLE_SHFT 4 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE0_NIBBLE_MASK 0x0000000000000070 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE1_CHIPLET */ +/* Description: selects which md chiplet drives nibble1 */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE1_CHIPLET_SHFT 8 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE1_CHIPLET_MASK 0x0000000000000700 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE1_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE1_NIBBLE_SHFT 12 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE1_NIBBLE_MASK 0x0000000000007000 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE2_CHIPLET */ +/* Description: selects which md chiplet drives nibble2 */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE2_CHIPLET_SHFT 16 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE2_CHIPLET_MASK 0x0000000000070000 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE2_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE2_NIBBLE_SHFT 20 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE2_NIBBLE_MASK 0x0000000000700000 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE3_CHIPLET */ +/* Description: selects which md chiplet drives nibble3 */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE3_CHIPLET_SHFT 24 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE3_CHIPLET_MASK 0x0000000007000000 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE3_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE3_NIBBLE_SHFT 28 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE3_NIBBLE_MASK 0x0000000070000000 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE4_CHIPLET */ +/* Description: selects which md chiplet drives nibble4 */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE4_CHIPLET_SHFT 32 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE4_CHIPLET_MASK 0x0000000700000000 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE4_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE4_NIBBLE_SHFT 36 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE4_NIBBLE_MASK 0x0000007000000000 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE5_CHIPLET */ +/* Description: selects which md chiplet drives nibble5 */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE5_CHIPLET_SHFT 40 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE5_CHIPLET_MASK 0x0000070000000000 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE5_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE5_NIBBLE_SHFT 44 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE5_NIBBLE_MASK 0x0000700000000000 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE6_CHIPLET */ +/* Description: selects which md chiplet drives nibble6 */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE6_CHIPLET_SHFT 48 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE6_CHIPLET_MASK 0x0007000000000000 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE6_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE6_NIBBLE_SHFT 52 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE6_NIBBLE_MASK 0x0070000000000000 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE7_CHIPLET */ +/* Description: selects which md chiplet drives nibble7 */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE7_CHIPLET_SHFT 56 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE7_CHIPLET_MASK 0x0700000000000000 + +/* SH_MD_DBUG_TRIGGER_CFG_NIBBLE7_NIBBLE */ +/* Description: selects which nibble from selected chiplet drives n */ +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE7_NIBBLE_SHFT 60 +#define SH_MD_DBUG_TRIGGER_CFG_NIBBLE7_NIBBLE_MASK 0x7000000000000000 + +/* SH_MD_DBUG_TRIGGER_CFG_ENABLE */ +/* Description: enables triggering on pattern match */ +#define SH_MD_DBUG_TRIGGER_CFG_ENABLE_SHFT 63 +#define SH_MD_DBUG_TRIGGER_CFG_ENABLE_MASK 0x8000000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DBUG_COMPARE" */ +/* md debug compare pattern and mask */ +/* ==================================================================== */ + +#define SH_MD_DBUG_COMPARE 0x0000000100020110 +#define SH_MD_DBUG_COMPARE_MASK 0xffffffffffffffff +#define SH_MD_DBUG_COMPARE_INIT 0x0000000000000000 + +/* SH_MD_DBUG_COMPARE_PATTERN */ +/* Description: pattern against which to compare dbug data for trig */ +#define SH_MD_DBUG_COMPARE_PATTERN_SHFT 0 +#define SH_MD_DBUG_COMPARE_PATTERN_MASK 0x00000000ffffffff + +/* SH_MD_DBUG_COMPARE_MASK */ +/* Description: bits to include in compare of dbug data for trigger */ +#define SH_MD_DBUG_COMPARE_MASK_SHFT 32 +#define SH_MD_DBUG_COMPARE_MASK_MASK 0xffffffff00000000 + +/* ==================================================================== */ +/* Register "SH_X_MOD_DBUG_SEL" */ +/* MD acx debug select */ +/* ==================================================================== */ + +#define SH_X_MOD_DBUG_SEL 0x0000000100020118 +#define SH_X_MOD_DBUG_SEL_MASK 0x03ffffffffffffff +#define SH_X_MOD_DBUG_SEL_INIT 0x0000000000000000 + +/* SH_X_MOD_DBUG_SEL_TAG_SEL */ +/* Description: tagmgr select */ +#define SH_X_MOD_DBUG_SEL_TAG_SEL_SHFT 0 +#define SH_X_MOD_DBUG_SEL_TAG_SEL_MASK 0x00000000000000ff + +/* SH_X_MOD_DBUG_SEL_WBQ_SEL */ +/* Description: wbqtg select */ +#define SH_X_MOD_DBUG_SEL_WBQ_SEL_SHFT 8 +#define SH_X_MOD_DBUG_SEL_WBQ_SEL_MASK 0x000000000000ff00 + +/* SH_X_MOD_DBUG_SEL_ARB_SEL */ +/* Description: arbque select */ +#define SH_X_MOD_DBUG_SEL_ARB_SEL_SHFT 16 +#define SH_X_MOD_DBUG_SEL_ARB_SEL_MASK 0x0000000000ff0000 + +/* SH_X_MOD_DBUG_SEL_ATL_SEL */ +/* Description: aintl select */ +#define SH_X_MOD_DBUG_SEL_ATL_SEL_SHFT 24 +#define SH_X_MOD_DBUG_SEL_ATL_SEL_MASK 0x00000007ff000000 + +/* SH_X_MOD_DBUG_SEL_ATR_SEL */ +/* Description: aintr select */ +#define SH_X_MOD_DBUG_SEL_ATR_SEL_SHFT 35 +#define SH_X_MOD_DBUG_SEL_ATR_SEL_MASK 0x00003ff800000000 + +/* SH_X_MOD_DBUG_SEL_DQL_SEL */ +/* Description: dqctr select */ +#define SH_X_MOD_DBUG_SEL_DQL_SEL_SHFT 46 +#define SH_X_MOD_DBUG_SEL_DQL_SEL_MASK 0x000fc00000000000 + +/* SH_X_MOD_DBUG_SEL_DQR_SEL */ +/* Description: dqctl select */ +#define SH_X_MOD_DBUG_SEL_DQR_SEL_SHFT 52 +#define SH_X_MOD_DBUG_SEL_DQR_SEL_MASK 0x03f0000000000000 + +/* ==================================================================== */ +/* Register "SH_X_DBUG_SEL" */ +/* MD acx debug select */ +/* ==================================================================== */ + +#define SH_X_DBUG_SEL 0x0000000100020120 +#define SH_X_DBUG_SEL_MASK 0x0000000000ffffff +#define SH_X_DBUG_SEL_INIT 0x0000000000000000 + +/* SH_X_DBUG_SEL_DBG_SEL */ +/* Description: debug select */ +#define SH_X_DBUG_SEL_DBG_SEL_SHFT 0 +#define SH_X_DBUG_SEL_DBG_SEL_MASK 0x0000000000ffffff + +/* ==================================================================== */ +/* Register "SH_X_LADDR_CMP" */ +/* MD acx address compare */ +/* ==================================================================== */ + +#define SH_X_LADDR_CMP 0x0000000100020128 +#define SH_X_LADDR_CMP_MASK 0x0fffffff0fffffff +#define SH_X_LADDR_CMP_INIT 0x0000000000000000 + +/* SH_X_LADDR_CMP_CMP_VAL */ +/* Description: Compare value */ +#define SH_X_LADDR_CMP_CMP_VAL_SHFT 0 +#define SH_X_LADDR_CMP_CMP_VAL_MASK 0x000000000fffffff + +/* SH_X_LADDR_CMP_MASK_VAL */ +/* Description: Mask value */ +#define SH_X_LADDR_CMP_MASK_VAL_SHFT 32 +#define SH_X_LADDR_CMP_MASK_VAL_MASK 0x0fffffff00000000 + +/* ==================================================================== */ +/* Register "SH_X_RADDR_CMP" */ +/* MD acx address compare */ +/* ==================================================================== */ + +#define SH_X_RADDR_CMP 0x0000000100020130 +#define SH_X_RADDR_CMP_MASK 0x0fffffff0fffffff +#define SH_X_RADDR_CMP_INIT 0x0000000000000000 + +/* SH_X_RADDR_CMP_CMP_VAL */ +/* Description: Compare value */ +#define SH_X_RADDR_CMP_CMP_VAL_SHFT 0 +#define SH_X_RADDR_CMP_CMP_VAL_MASK 0x000000000fffffff + +/* SH_X_RADDR_CMP_MASK_VAL */ +/* Description: Mask value */ +#define SH_X_RADDR_CMP_MASK_VAL_SHFT 32 +#define SH_X_RADDR_CMP_MASK_VAL_MASK 0x0fffffff00000000 + +/* ==================================================================== */ +/* Register "SH_X_TAG_CMP" */ +/* MD acx tagmgr compare */ +/* ==================================================================== */ + +#define SH_X_TAG_CMP 0x0000000100020138 +#define SH_X_TAG_CMP_MASK 0x007fffffffffffff +#define SH_X_TAG_CMP_INIT 0x0000000000000000 + +/* SH_X_TAG_CMP_CMD */ +/* Description: Command compare value */ +#define SH_X_TAG_CMP_CMD_SHFT 0 +#define SH_X_TAG_CMP_CMD_MASK 0x00000000000000ff + +/* SH_X_TAG_CMP_ADDR */ +/* Description: Address compare value */ +#define SH_X_TAG_CMP_ADDR_SHFT 8 +#define SH_X_TAG_CMP_ADDR_MASK 0x000001ffffffff00 + +/* SH_X_TAG_CMP_SRC */ +/* Description: Source compare value */ +#define SH_X_TAG_CMP_SRC_SHFT 41 +#define SH_X_TAG_CMP_SRC_MASK 0x007ffe0000000000 + +/* ==================================================================== */ +/* Register "SH_X_TAG_MASK" */ +/* MD acx tagmgr mask */ +/* ==================================================================== */ + +#define SH_X_TAG_MASK 0x0000000100020140 +#define SH_X_TAG_MASK_MASK 0x007fffffffffffff +#define SH_X_TAG_MASK_INIT 0x0000000000000000 + +/* SH_X_TAG_MASK_CMD */ +/* Description: Command compare value */ +#define SH_X_TAG_MASK_CMD_SHFT 0 +#define SH_X_TAG_MASK_CMD_MASK 0x00000000000000ff + +/* SH_X_TAG_MASK_ADDR */ +/* Description: Address compare value */ +#define SH_X_TAG_MASK_ADDR_SHFT 8 +#define SH_X_TAG_MASK_ADDR_MASK 0x000001ffffffff00 + +/* SH_X_TAG_MASK_SRC */ +/* Description: Source compare value */ +#define SH_X_TAG_MASK_SRC_SHFT 41 +#define SH_X_TAG_MASK_SRC_MASK 0x007ffe0000000000 + +/* ==================================================================== */ +/* Register "SH_Y_MOD_DBUG_SEL" */ +/* MD acy debug select */ +/* ==================================================================== */ + +#define SH_Y_MOD_DBUG_SEL 0x0000000100020148 +#define SH_Y_MOD_DBUG_SEL_MASK 0x03ffffffffffffff +#define SH_Y_MOD_DBUG_SEL_INIT 0x0000000000000000 + +/* SH_Y_MOD_DBUG_SEL_TAG_SEL */ +/* Description: tagmgr select */ +#define SH_Y_MOD_DBUG_SEL_TAG_SEL_SHFT 0 +#define SH_Y_MOD_DBUG_SEL_TAG_SEL_MASK 0x00000000000000ff + +/* SH_Y_MOD_DBUG_SEL_WBQ_SEL */ +/* Description: wbqtg select */ +#define SH_Y_MOD_DBUG_SEL_WBQ_SEL_SHFT 8 +#define SH_Y_MOD_DBUG_SEL_WBQ_SEL_MASK 0x000000000000ff00 + +/* SH_Y_MOD_DBUG_SEL_ARB_SEL */ +/* Description: arbque select */ +#define SH_Y_MOD_DBUG_SEL_ARB_SEL_SHFT 16 +#define SH_Y_MOD_DBUG_SEL_ARB_SEL_MASK 0x0000000000ff0000 + +/* SH_Y_MOD_DBUG_SEL_ATL_SEL */ +/* Description: aintl select */ +#define SH_Y_MOD_DBUG_SEL_ATL_SEL_SHFT 24 +#define SH_Y_MOD_DBUG_SEL_ATL_SEL_MASK 0x00000007ff000000 + +/* SH_Y_MOD_DBUG_SEL_ATR_SEL */ +/* Description: aintr select */ +#define SH_Y_MOD_DBUG_SEL_ATR_SEL_SHFT 35 +#define SH_Y_MOD_DBUG_SEL_ATR_SEL_MASK 0x00003ff800000000 + +/* SH_Y_MOD_DBUG_SEL_DQL_SEL */ +/* Description: dqctr select */ +#define SH_Y_MOD_DBUG_SEL_DQL_SEL_SHFT 46 +#define SH_Y_MOD_DBUG_SEL_DQL_SEL_MASK 0x000fc00000000000 + +/* SH_Y_MOD_DBUG_SEL_DQR_SEL */ +/* Description: dqctl select */ +#define SH_Y_MOD_DBUG_SEL_DQR_SEL_SHFT 52 +#define SH_Y_MOD_DBUG_SEL_DQR_SEL_MASK 0x03f0000000000000 + +/* ==================================================================== */ +/* Register "SH_Y_DBUG_SEL" */ +/* MD acy debug select */ +/* ==================================================================== */ + +#define SH_Y_DBUG_SEL 0x0000000100020150 +#define SH_Y_DBUG_SEL_MASK 0x0000000000ffffff +#define SH_Y_DBUG_SEL_INIT 0x0000000000000000 + +/* SH_Y_DBUG_SEL_DBG_SEL */ +/* Description: debug select */ +#define SH_Y_DBUG_SEL_DBG_SEL_SHFT 0 +#define SH_Y_DBUG_SEL_DBG_SEL_MASK 0x0000000000ffffff + +/* ==================================================================== */ +/* Register "SH_Y_LADDR_CMP" */ +/* MD acy address compare */ +/* ==================================================================== */ + +#define SH_Y_LADDR_CMP 0x0000000100020158 +#define SH_Y_LADDR_CMP_MASK 0x0fffffff0fffffff +#define SH_Y_LADDR_CMP_INIT 0x0000000000000000 + +/* SH_Y_LADDR_CMP_CMP_VAL */ +/* Description: Compare value */ +#define SH_Y_LADDR_CMP_CMP_VAL_SHFT 0 +#define SH_Y_LADDR_CMP_CMP_VAL_MASK 0x000000000fffffff + +/* SH_Y_LADDR_CMP_MASK_VAL */ +/* Description: Mask value */ +#define SH_Y_LADDR_CMP_MASK_VAL_SHFT 32 +#define SH_Y_LADDR_CMP_MASK_VAL_MASK 0x0fffffff00000000 + +/* ==================================================================== */ +/* Register "SH_Y_RADDR_CMP" */ +/* MD acy address compare */ +/* ==================================================================== */ + +#define SH_Y_RADDR_CMP 0x0000000100020160 +#define SH_Y_RADDR_CMP_MASK 0x0fffffff0fffffff +#define SH_Y_RADDR_CMP_INIT 0x0000000000000000 + +/* SH_Y_RADDR_CMP_CMP_VAL */ +/* Description: Compare value */ +#define SH_Y_RADDR_CMP_CMP_VAL_SHFT 0 +#define SH_Y_RADDR_CMP_CMP_VAL_MASK 0x000000000fffffff + +/* SH_Y_RADDR_CMP_MASK_VAL */ +/* Description: Mask value */ +#define SH_Y_RADDR_CMP_MASK_VAL_SHFT 32 +#define SH_Y_RADDR_CMP_MASK_VAL_MASK 0x0fffffff00000000 + +/* ==================================================================== */ +/* Register "SH_Y_TAG_CMP" */ +/* MD acy tagmgr compare */ +/* ==================================================================== */ + +#define SH_Y_TAG_CMP 0x0000000100020168 +#define SH_Y_TAG_CMP_MASK 0x007fffffffffffff +#define SH_Y_TAG_CMP_INIT 0x0000000000000000 + +/* SH_Y_TAG_CMP_CMD */ +/* Description: Command compare value */ +#define SH_Y_TAG_CMP_CMD_SHFT 0 +#define SH_Y_TAG_CMP_CMD_MASK 0x00000000000000ff + +/* SH_Y_TAG_CMP_ADDR */ +/* Description: Address compare value */ +#define SH_Y_TAG_CMP_ADDR_SHFT 8 +#define SH_Y_TAG_CMP_ADDR_MASK 0x000001ffffffff00 + +/* SH_Y_TAG_CMP_SRC */ +/* Description: Source compare value */ +#define SH_Y_TAG_CMP_SRC_SHFT 41 +#define SH_Y_TAG_CMP_SRC_MASK 0x007ffe0000000000 + +/* ==================================================================== */ +/* Register "SH_Y_TAG_MASK" */ +/* MD acy tagmgr mask */ +/* ==================================================================== */ + +#define SH_Y_TAG_MASK 0x0000000100020170 +#define SH_Y_TAG_MASK_MASK 0x007fffffffffffff +#define SH_Y_TAG_MASK_INIT 0x0000000000000000 + +/* SH_Y_TAG_MASK_CMD */ +/* Description: Command compare value */ +#define SH_Y_TAG_MASK_CMD_SHFT 0 +#define SH_Y_TAG_MASK_CMD_MASK 0x00000000000000ff + +/* SH_Y_TAG_MASK_ADDR */ +/* Description: Address compare value */ +#define SH_Y_TAG_MASK_ADDR_SHFT 8 +#define SH_Y_TAG_MASK_ADDR_MASK 0x000001ffffffff00 + +/* SH_Y_TAG_MASK_SRC */ +/* Description: Source compare value */ +#define SH_Y_TAG_MASK_SRC_SHFT 41 +#define SH_Y_TAG_MASK_SRC_MASK 0x007ffe0000000000 + +/* ==================================================================== */ +/* Register "SH_MD_JNR_DBUG_DATA_CFG" */ +/* configuration for md jnr debug data muxes */ +/* ==================================================================== */ + +#define SH_MD_JNR_DBUG_DATA_CFG 0x0000000100020178 +#define SH_MD_JNR_DBUG_DATA_CFG_MASK 0x0000000077777777 +#define SH_MD_JNR_DBUG_DATA_CFG_INIT 0x0000000000000000 + +/* SH_MD_JNR_DBUG_DATA_CFG_NIBBLE0_SEL */ +/* Description: selects which nibble drives nibble0 */ +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE0_SEL_SHFT 0 +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE0_SEL_MASK 0x0000000000000007 + +/* SH_MD_JNR_DBUG_DATA_CFG_NIBBLE1_SEL */ +/* Description: selects which nibble drives nibble1 */ +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE1_SEL_SHFT 4 +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE1_SEL_MASK 0x0000000000000070 + +/* SH_MD_JNR_DBUG_DATA_CFG_NIBBLE2_SEL */ +/* Description: selects which nibble drives nibble2 */ +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE2_SEL_SHFT 8 +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE2_SEL_MASK 0x0000000000000700 + +/* SH_MD_JNR_DBUG_DATA_CFG_NIBBLE3_SEL */ +/* Description: selects which nibble drives nibble3 */ +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE3_SEL_SHFT 12 +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE3_SEL_MASK 0x0000000000007000 + +/* SH_MD_JNR_DBUG_DATA_CFG_NIBBLE4_SEL */ +/* Description: selects which nibble drives nibble4 */ +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE4_SEL_SHFT 16 +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE4_SEL_MASK 0x0000000000070000 + +/* SH_MD_JNR_DBUG_DATA_CFG_NIBBLE5_SEL */ +/* Description: selects which nibble drives nibble5 */ +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE5_SEL_SHFT 20 +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE5_SEL_MASK 0x0000000000700000 + +/* SH_MD_JNR_DBUG_DATA_CFG_NIBBLE6_SEL */ +/* Description: selects which nibble drives nibble6 */ +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE6_SEL_SHFT 24 +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE6_SEL_MASK 0x0000000007000000 + +/* SH_MD_JNR_DBUG_DATA_CFG_NIBBLE7_SEL */ +/* Description: selects which nibble drives nibble7 */ +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE7_SEL_SHFT 28 +#define SH_MD_JNR_DBUG_DATA_CFG_NIBBLE7_SEL_MASK 0x0000000070000000 + +/* ==================================================================== */ +/* Register "SH_MD_LAST_CREDIT" */ +/* captures last credit values on reset */ +/* ==================================================================== */ + +#define SH_MD_LAST_CREDIT 0x0000000100020180 +#define SH_MD_LAST_CREDIT_MASK 0x0000003f3f3f3f3f +#define SH_MD_LAST_CREDIT_INIT 0x0000000000000000 + +/* SH_MD_LAST_CREDIT_RQ_TO_PI */ +/* Description: capture of request credits to pi */ +#define SH_MD_LAST_CREDIT_RQ_TO_PI_SHFT 0 +#define SH_MD_LAST_CREDIT_RQ_TO_PI_MASK 0x000000000000003f + +/* SH_MD_LAST_CREDIT_RP_TO_PI */ +/* Description: capture of reply credits to pi */ +#define SH_MD_LAST_CREDIT_RP_TO_PI_SHFT 8 +#define SH_MD_LAST_CREDIT_RP_TO_PI_MASK 0x0000000000003f00 + +/* SH_MD_LAST_CREDIT_RQ_TO_XN */ +/* Description: capture of request credits to xn */ +#define SH_MD_LAST_CREDIT_RQ_TO_XN_SHFT 16 +#define SH_MD_LAST_CREDIT_RQ_TO_XN_MASK 0x00000000003f0000 + +/* SH_MD_LAST_CREDIT_RP_TO_XN */ +/* Description: capture of reply credits to xn */ +#define SH_MD_LAST_CREDIT_RP_TO_XN_SHFT 24 +#define SH_MD_LAST_CREDIT_RP_TO_XN_MASK 0x000000003f000000 + +/* SH_MD_LAST_CREDIT_TO_LB */ +/* Description: capture of credits to pi */ +#define SH_MD_LAST_CREDIT_TO_LB_SHFT 32 +#define SH_MD_LAST_CREDIT_TO_LB_MASK 0x0000003f00000000 + +/* ==================================================================== */ +/* Register "SH_MEM_CAPTURE_ADDR" */ +/* Address capture address register */ +/* ==================================================================== */ + +#define SH_MEM_CAPTURE_ADDR 0x0000000100020300 +#define SH_MEM_CAPTURE_ADDR_MASK 0x00000ffffffffff8 +#define SH_MEM_CAPTURE_ADDR_INIT 0x0000000000000000 + +/* SH_MEM_CAPTURE_ADDR_ADDR */ +/* Description: upper bits of address */ +#define SH_MEM_CAPTURE_ADDR_ADDR_SHFT 3 +#define SH_MEM_CAPTURE_ADDR_ADDR_MASK 0x0000000ffffffff8 + +/* SH_MEM_CAPTURE_ADDR_CMD */ +/* Description: command of reference */ +#define SH_MEM_CAPTURE_ADDR_CMD_SHFT 36 +#define SH_MEM_CAPTURE_ADDR_CMD_MASK 0x00000ff000000000 + +/* ==================================================================== */ +/* Register "SH_MEM_CAPTURE_MASK" */ +/* Address capture mask register */ +/* ==================================================================== */ + +#define SH_MEM_CAPTURE_MASK 0x0000000100020308 +#define SH_MEM_CAPTURE_MASK_MASK 0x00003ffffffffff8 +#define SH_MEM_CAPTURE_MASK_INIT 0x0000000000000000 + +/* SH_MEM_CAPTURE_MASK_ADDR */ +/* Description: upper bits of address */ +#define SH_MEM_CAPTURE_MASK_ADDR_SHFT 3 +#define SH_MEM_CAPTURE_MASK_ADDR_MASK 0x0000000ffffffff8 + +/* SH_MEM_CAPTURE_MASK_CMD */ +/* Description: command of reference */ +#define SH_MEM_CAPTURE_MASK_CMD_SHFT 36 +#define SH_MEM_CAPTURE_MASK_CMD_MASK 0x00000ff000000000 + +/* SH_MEM_CAPTURE_MASK_ENABLE_LOCAL */ +/* Description: capture references originating locally */ +#define SH_MEM_CAPTURE_MASK_ENABLE_LOCAL_SHFT 44 +#define SH_MEM_CAPTURE_MASK_ENABLE_LOCAL_MASK 0x0000100000000000 + +/* SH_MEM_CAPTURE_MASK_ENABLE_REMOTE */ +/* Description: capture references originating remotely */ +#define SH_MEM_CAPTURE_MASK_ENABLE_REMOTE_SHFT 45 +#define SH_MEM_CAPTURE_MASK_ENABLE_REMOTE_MASK 0x0000200000000000 + +/* ==================================================================== */ +/* Register "SH_MEM_CAPTURE_HDR" */ +/* Address capture header register */ +/* ==================================================================== */ + +#define SH_MEM_CAPTURE_HDR 0x0000000100020310 +#define SH_MEM_CAPTURE_HDR_MASK 0xfffffffffffffff8 +#define SH_MEM_CAPTURE_HDR_INIT 0x0000000000000000 + +/* SH_MEM_CAPTURE_HDR_ADDR */ +/* Description: upper bits of reference address */ +#define SH_MEM_CAPTURE_HDR_ADDR_SHFT 3 +#define SH_MEM_CAPTURE_HDR_ADDR_MASK 0x0000000ffffffff8 + +/* SH_MEM_CAPTURE_HDR_CMD */ +/* Description: command of reference */ +#define SH_MEM_CAPTURE_HDR_CMD_SHFT 36 +#define SH_MEM_CAPTURE_HDR_CMD_MASK 0x00000ff000000000 + +/* SH_MEM_CAPTURE_HDR_SRC */ +/* Description: source node of reference */ +#define SH_MEM_CAPTURE_HDR_SRC_SHFT 44 +#define SH_MEM_CAPTURE_HDR_SRC_MASK 0x03fff00000000000 + +/* SH_MEM_CAPTURE_HDR_CNTR */ +/* Description: increments on every capture */ +#define SH_MEM_CAPTURE_HDR_CNTR_SHFT 58 +#define SH_MEM_CAPTURE_HDR_CNTR_MASK 0xfc00000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_CONFIG" */ +/* DQ directory config register */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_CONFIG 0x0000000100030000 +#define SH_MD_DQLP_MMR_DIR_CONFIG_MASK 0x000000000000001f +#define SH_MD_DQLP_MMR_DIR_CONFIG_INIT 0x0000000000000010 + +/* SH_MD_DQLP_MMR_DIR_CONFIG_SYS_SIZE */ +/* Description: system size code */ +#define SH_MD_DQLP_MMR_DIR_CONFIG_SYS_SIZE_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_CONFIG_SYS_SIZE_MASK 0x0000000000000007 + +/* SH_MD_DQLP_MMR_DIR_CONFIG_EN_DIRECC */ +/* Description: enable directory ecc correction */ +#define SH_MD_DQLP_MMR_DIR_CONFIG_EN_DIRECC_SHFT 3 +#define SH_MD_DQLP_MMR_DIR_CONFIG_EN_DIRECC_MASK 0x0000000000000008 + +/* SH_MD_DQLP_MMR_DIR_CONFIG_EN_DIRPOIS */ +/* Description: enable local poisoning for dir table fall-through */ +#define SH_MD_DQLP_MMR_DIR_CONFIG_EN_DIRPOIS_SHFT 4 +#define SH_MD_DQLP_MMR_DIR_CONFIG_EN_DIRPOIS_MASK 0x0000000000000010 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRESVEC0" */ +/* node [63:0] presence bits */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_PRESVEC0 0x0000000100030100 +#define SH_MD_DQLP_MMR_DIR_PRESVEC0_MASK 0xffffffffffffffff +#define SH_MD_DQLP_MMR_DIR_PRESVEC0_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_PRESVEC0_VEC */ +/* Description: node presence bits, 1=present */ +#define SH_MD_DQLP_MMR_DIR_PRESVEC0_VEC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_PRESVEC0_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRESVEC1" */ +/* node [127:64] presence bits */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_PRESVEC1 0x0000000100030110 +#define SH_MD_DQLP_MMR_DIR_PRESVEC1_MASK 0xffffffffffffffff +#define SH_MD_DQLP_MMR_DIR_PRESVEC1_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_PRESVEC1_VEC */ +/* Description: node presence bits, 1=present */ +#define SH_MD_DQLP_MMR_DIR_PRESVEC1_VEC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_PRESVEC1_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRESVEC2" */ +/* node [191:128] presence bits */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_PRESVEC2 0x0000000100030120 +#define SH_MD_DQLP_MMR_DIR_PRESVEC2_MASK 0xffffffffffffffff +#define SH_MD_DQLP_MMR_DIR_PRESVEC2_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_PRESVEC2_VEC */ +/* Description: node presence bits, 1=present */ +#define SH_MD_DQLP_MMR_DIR_PRESVEC2_VEC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_PRESVEC2_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRESVEC3" */ +/* node [255:192] presence bits */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_PRESVEC3 0x0000000100030130 +#define SH_MD_DQLP_MMR_DIR_PRESVEC3_MASK 0xffffffffffffffff +#define SH_MD_DQLP_MMR_DIR_PRESVEC3_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_PRESVEC3_VEC */ +/* Description: node presence bits, 1=present */ +#define SH_MD_DQLP_MMR_DIR_PRESVEC3_VEC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_PRESVEC3_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC0" */ +/* local vector for acc=0 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_LOCVEC0 0x0000000100030200 +#define SH_MD_DQLP_MMR_DIR_LOCVEC0_MASK 0xffffffffffffffff +#define SH_MD_DQLP_MMR_DIR_LOCVEC0_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_LOCVEC0_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQLP_MMR_DIR_LOCVEC0_VEC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_LOCVEC0_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC1" */ +/* local vector for acc=1 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_LOCVEC1 0x0000000100030210 +#define SH_MD_DQLP_MMR_DIR_LOCVEC1_MASK 0xffffffffffffffff +#define SH_MD_DQLP_MMR_DIR_LOCVEC1_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_LOCVEC1_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQLP_MMR_DIR_LOCVEC1_VEC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_LOCVEC1_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC2" */ +/* local vector for acc=2 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_LOCVEC2 0x0000000100030220 +#define SH_MD_DQLP_MMR_DIR_LOCVEC2_MASK 0xffffffffffffffff +#define SH_MD_DQLP_MMR_DIR_LOCVEC2_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_LOCVEC2_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQLP_MMR_DIR_LOCVEC2_VEC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_LOCVEC2_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC3" */ +/* local vector for acc=3 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_LOCVEC3 0x0000000100030230 +#define SH_MD_DQLP_MMR_DIR_LOCVEC3_MASK 0xffffffffffffffff +#define SH_MD_DQLP_MMR_DIR_LOCVEC3_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_LOCVEC3_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQLP_MMR_DIR_LOCVEC3_VEC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_LOCVEC3_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC4" */ +/* local vector for acc=4 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_LOCVEC4 0x0000000100030240 +#define SH_MD_DQLP_MMR_DIR_LOCVEC4_MASK 0xffffffffffffffff +#define SH_MD_DQLP_MMR_DIR_LOCVEC4_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_LOCVEC4_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQLP_MMR_DIR_LOCVEC4_VEC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_LOCVEC4_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC5" */ +/* local vector for acc=5 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_LOCVEC5 0x0000000100030250 +#define SH_MD_DQLP_MMR_DIR_LOCVEC5_MASK 0xffffffffffffffff +#define SH_MD_DQLP_MMR_DIR_LOCVEC5_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_LOCVEC5_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQLP_MMR_DIR_LOCVEC5_VEC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_LOCVEC5_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC6" */ +/* local vector for acc=6 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_LOCVEC6 0x0000000100030260 +#define SH_MD_DQLP_MMR_DIR_LOCVEC6_MASK 0xffffffffffffffff +#define SH_MD_DQLP_MMR_DIR_LOCVEC6_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_LOCVEC6_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQLP_MMR_DIR_LOCVEC6_VEC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_LOCVEC6_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC7" */ +/* local vector for acc=7 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_LOCVEC7 0x0000000100030270 +#define SH_MD_DQLP_MMR_DIR_LOCVEC7_MASK 0xffffffffffffffff +#define SH_MD_DQLP_MMR_DIR_LOCVEC7_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_LOCVEC7_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQLP_MMR_DIR_LOCVEC7_VEC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_LOCVEC7_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC0" */ +/* privilege vector for acc=0 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_PRIVEC0 0x0000000100030300 +#define SH_MD_DQLP_MMR_DIR_PRIVEC0_MASK 0x000000000fffffff +#define SH_MD_DQLP_MMR_DIR_PRIVEC0_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_PRIVEC0_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC0_IN_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_PRIVEC0_IN_MASK 0x0000000000003fff + +/* SH_MD_DQLP_MMR_DIR_PRIVEC0_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC0_OUT_SHFT 14 +#define SH_MD_DQLP_MMR_DIR_PRIVEC0_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC1" */ +/* privilege vector for acc=1 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_PRIVEC1 0x0000000100030310 +#define SH_MD_DQLP_MMR_DIR_PRIVEC1_MASK 0x000000000fffffff +#define SH_MD_DQLP_MMR_DIR_PRIVEC1_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_PRIVEC1_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC1_IN_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_PRIVEC1_IN_MASK 0x0000000000003fff + +/* SH_MD_DQLP_MMR_DIR_PRIVEC1_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC1_OUT_SHFT 14 +#define SH_MD_DQLP_MMR_DIR_PRIVEC1_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC2" */ +/* privilege vector for acc=2 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_PRIVEC2 0x0000000100030320 +#define SH_MD_DQLP_MMR_DIR_PRIVEC2_MASK 0x000000000fffffff +#define SH_MD_DQLP_MMR_DIR_PRIVEC2_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_PRIVEC2_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC2_IN_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_PRIVEC2_IN_MASK 0x0000000000003fff + +/* SH_MD_DQLP_MMR_DIR_PRIVEC2_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC2_OUT_SHFT 14 +#define SH_MD_DQLP_MMR_DIR_PRIVEC2_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC3" */ +/* privilege vector for acc=3 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_PRIVEC3 0x0000000100030330 +#define SH_MD_DQLP_MMR_DIR_PRIVEC3_MASK 0x000000000fffffff +#define SH_MD_DQLP_MMR_DIR_PRIVEC3_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_PRIVEC3_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC3_IN_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_PRIVEC3_IN_MASK 0x0000000000003fff + +/* SH_MD_DQLP_MMR_DIR_PRIVEC3_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC3_OUT_SHFT 14 +#define SH_MD_DQLP_MMR_DIR_PRIVEC3_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC4" */ +/* privilege vector for acc=4 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_PRIVEC4 0x0000000100030340 +#define SH_MD_DQLP_MMR_DIR_PRIVEC4_MASK 0x000000000fffffff +#define SH_MD_DQLP_MMR_DIR_PRIVEC4_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_PRIVEC4_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC4_IN_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_PRIVEC4_IN_MASK 0x0000000000003fff + +/* SH_MD_DQLP_MMR_DIR_PRIVEC4_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC4_OUT_SHFT 14 +#define SH_MD_DQLP_MMR_DIR_PRIVEC4_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC5" */ +/* privilege vector for acc=5 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_PRIVEC5 0x0000000100030350 +#define SH_MD_DQLP_MMR_DIR_PRIVEC5_MASK 0x000000000fffffff +#define SH_MD_DQLP_MMR_DIR_PRIVEC5_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_PRIVEC5_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC5_IN_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_PRIVEC5_IN_MASK 0x0000000000003fff + +/* SH_MD_DQLP_MMR_DIR_PRIVEC5_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC5_OUT_SHFT 14 +#define SH_MD_DQLP_MMR_DIR_PRIVEC5_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC6" */ +/* privilege vector for acc=6 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_PRIVEC6 0x0000000100030360 +#define SH_MD_DQLP_MMR_DIR_PRIVEC6_MASK 0x000000000fffffff +#define SH_MD_DQLP_MMR_DIR_PRIVEC6_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_PRIVEC6_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC6_IN_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_PRIVEC6_IN_MASK 0x0000000000003fff + +/* SH_MD_DQLP_MMR_DIR_PRIVEC6_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC6_OUT_SHFT 14 +#define SH_MD_DQLP_MMR_DIR_PRIVEC6_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC7" */ +/* privilege vector for acc=7 */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_PRIVEC7 0x0000000100030370 +#define SH_MD_DQLP_MMR_DIR_PRIVEC7_MASK 0x000000000fffffff +#define SH_MD_DQLP_MMR_DIR_PRIVEC7_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_PRIVEC7_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC7_IN_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_PRIVEC7_IN_MASK 0x0000000000003fff + +/* SH_MD_DQLP_MMR_DIR_PRIVEC7_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQLP_MMR_DIR_PRIVEC7_OUT_SHFT 14 +#define SH_MD_DQLP_MMR_DIR_PRIVEC7_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_TIMER" */ +/* MD SXRO timer */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_TIMER 0x0000000100030400 +#define SH_MD_DQLP_MMR_DIR_TIMER_MASK 0x00000000003fffff +#define SH_MD_DQLP_MMR_DIR_TIMER_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_TIMER_TIMER_DIV */ +/* Description: timer divide register */ +#define SH_MD_DQLP_MMR_DIR_TIMER_TIMER_DIV_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_TIMER_TIMER_DIV_MASK 0x0000000000000fff + +/* SH_MD_DQLP_MMR_DIR_TIMER_TIMER_EN */ +/* Description: timer enable */ +#define SH_MD_DQLP_MMR_DIR_TIMER_TIMER_EN_SHFT 12 +#define SH_MD_DQLP_MMR_DIR_TIMER_TIMER_EN_MASK 0x0000000000001000 + +/* SH_MD_DQLP_MMR_DIR_TIMER_TIMER_CUR */ +/* Description: value of current timer */ +#define SH_MD_DQLP_MMR_DIR_TIMER_TIMER_CUR_SHFT 13 +#define SH_MD_DQLP_MMR_DIR_TIMER_TIMER_CUR_MASK 0x00000000003fe000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY" */ +/* directory pio write data */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY 0x0000000100031000 +#define SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_MASK 0x03ffffffffffffff +#define SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_DIRA */ +/* Description: directory entry A */ +#define SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_DIRA_SHFT 0 +#define SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_DIRA_MASK 0x0000000003ffffff + +/* SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_DIRB */ +/* Description: directory entry B */ +#define SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_DIRB_SHFT 26 +#define SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_DIRB_MASK 0x000ffffffc000000 + +/* SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_PRI */ +/* Description: directory priority */ +#define SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_PRI_SHFT 52 +#define SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_PRI_MASK 0x0070000000000000 + +/* SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_ACC */ +/* Description: directory access bits */ +#define SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_ACC_SHFT 55 +#define SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY_ACC_MASK 0x0380000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_PIOWD_DIR_ECC" */ +/* directory ecc register */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_PIOWD_DIR_ECC 0x0000000100031010 +#define SH_MD_DQLP_MMR_PIOWD_DIR_ECC_MASK 0x0000000000003fff +#define SH_MD_DQLP_MMR_PIOWD_DIR_ECC_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_PIOWD_DIR_ECC_ECCA */ +/* Description: XOR bits for directory ECC group 1 */ +#define SH_MD_DQLP_MMR_PIOWD_DIR_ECC_ECCA_SHFT 0 +#define SH_MD_DQLP_MMR_PIOWD_DIR_ECC_ECCA_MASK 0x000000000000007f + +/* SH_MD_DQLP_MMR_PIOWD_DIR_ECC_ECCB */ +/* Description: XOR bits for directory ECC group 2 */ +#define SH_MD_DQLP_MMR_PIOWD_DIR_ECC_ECCB_SHFT 7 +#define SH_MD_DQLP_MMR_PIOWD_DIR_ECC_ECCB_MASK 0x0000000000003f80 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY" */ +/* x directory pio read data */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY 0x0000000100032000 +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_MASK 0x0fffffffffffffff +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_DIRA */ +/* Description: directory entry A */ +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_DIRA_SHFT 0 +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_DIRA_MASK 0x0000000003ffffff + +/* SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_DIRB */ +/* Description: directory entry B */ +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_DIRB_SHFT 26 +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_DIRB_MASK 0x000ffffffc000000 + +/* SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_PRI */ +/* Description: directory priority */ +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_PRI_SHFT 52 +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_PRI_MASK 0x0070000000000000 + +/* SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_ACC */ +/* Description: directory access bits */ +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_ACC_SHFT 55 +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_ACC_MASK 0x0380000000000000 + +/* SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_COR */ +/* Description: correctable ecc error */ +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_COR_SHFT 58 +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_COR_MASK 0x0400000000000000 + +/* SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_UNC */ +/* Description: uncorrectable ecc error */ +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_UNC_SHFT 59 +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY_UNC_MASK 0x0800000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XPIORD_XDIR_ECC" */ +/* x directory ecc */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ECC 0x0000000100032010 +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ECC_MASK 0x0000000000003fff +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ECC_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_XPIORD_XDIR_ECC_ECCA */ +/* Description: group 1 ecc */ +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ECC_ECCA_SHFT 0 +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ECC_ECCA_MASK 0x000000000000007f + +/* SH_MD_DQLP_MMR_XPIORD_XDIR_ECC_ECCB */ +/* Description: group 2 ecc */ +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ECC_ECCB_SHFT 7 +#define SH_MD_DQLP_MMR_XPIORD_XDIR_ECC_ECCB_MASK 0x0000000000003f80 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY" */ +/* y directory pio read data */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY 0x0000000100032800 +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_MASK 0x0fffffffffffffff +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_DIRA */ +/* Description: directory entry A */ +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_DIRA_SHFT 0 +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_DIRA_MASK 0x0000000003ffffff + +/* SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_DIRB */ +/* Description: directory entry B */ +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_DIRB_SHFT 26 +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_DIRB_MASK 0x000ffffffc000000 + +/* SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_PRI */ +/* Description: directory priority */ +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_PRI_SHFT 52 +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_PRI_MASK 0x0070000000000000 + +/* SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_ACC */ +/* Description: directory access bits */ +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_ACC_SHFT 55 +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_ACC_MASK 0x0380000000000000 + +/* SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_COR */ +/* Description: correctable ecc error */ +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_COR_SHFT 58 +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_COR_MASK 0x0400000000000000 + +/* SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_UNC */ +/* Description: uncorrectable ecc error */ +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_UNC_SHFT 59 +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY_UNC_MASK 0x0800000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YPIORD_YDIR_ECC" */ +/* y directory ecc */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ECC 0x0000000100032810 +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ECC_MASK 0x0000000000003fff +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ECC_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_YPIORD_YDIR_ECC_ECCA */ +/* Description: group 1 ecc */ +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ECC_ECCA_SHFT 0 +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ECC_ECCA_MASK 0x000000000000007f + +/* SH_MD_DQLP_MMR_YPIORD_YDIR_ECC_ECCB */ +/* Description: group 2 ecc */ +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ECC_ECCB_SHFT 7 +#define SH_MD_DQLP_MMR_YPIORD_YDIR_ECC_ECCB_MASK 0x0000000000003f80 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XCERR1" */ +/* correctable dir ecc group 1 error register */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_XCERR1 0x0000000100033000 +#define SH_MD_DQLP_MMR_XCERR1_MASK 0x0000007fffffffff +#define SH_MD_DQLP_MMR_XCERR1_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_XCERR1_GRP1 */ +/* Description: ecc group 1 bits */ +#define SH_MD_DQLP_MMR_XCERR1_GRP1_SHFT 0 +#define SH_MD_DQLP_MMR_XCERR1_GRP1_MASK 0x0000000fffffffff + +/* SH_MD_DQLP_MMR_XCERR1_VAL */ +/* Description: correctable ecc error in group 1 bits */ +#define SH_MD_DQLP_MMR_XCERR1_VAL_SHFT 36 +#define SH_MD_DQLP_MMR_XCERR1_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQLP_MMR_XCERR1_MORE */ +/* Description: more than one correctable ecc error in group 1 */ +#define SH_MD_DQLP_MMR_XCERR1_MORE_SHFT 37 +#define SH_MD_DQLP_MMR_XCERR1_MORE_MASK 0x0000002000000000 + +/* SH_MD_DQLP_MMR_XCERR1_ARM */ +/* Description: writing 1 arms uncorrectable ecc error capture */ +#define SH_MD_DQLP_MMR_XCERR1_ARM_SHFT 38 +#define SH_MD_DQLP_MMR_XCERR1_ARM_MASK 0x0000004000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XCERR2" */ +/* correctable dir ecc group 2 error register */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_XCERR2 0x0000000100033010 +#define SH_MD_DQLP_MMR_XCERR2_MASK 0x0000003fffffffff +#define SH_MD_DQLP_MMR_XCERR2_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_XCERR2_GRP2 */ +/* Description: ecc group 2 bits */ +#define SH_MD_DQLP_MMR_XCERR2_GRP2_SHFT 0 +#define SH_MD_DQLP_MMR_XCERR2_GRP2_MASK 0x0000000fffffffff + +/* SH_MD_DQLP_MMR_XCERR2_VAL */ +/* Description: correctable ecc error in group 2 bits */ +#define SH_MD_DQLP_MMR_XCERR2_VAL_SHFT 36 +#define SH_MD_DQLP_MMR_XCERR2_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQLP_MMR_XCERR2_MORE */ +/* Description: more than one correctable ecc error in group 2 */ +#define SH_MD_DQLP_MMR_XCERR2_MORE_SHFT 37 +#define SH_MD_DQLP_MMR_XCERR2_MORE_MASK 0x0000002000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XUERR1" */ +/* uncorrectable dir ecc group 1 error register */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_XUERR1 0x0000000100033020 +#define SH_MD_DQLP_MMR_XUERR1_MASK 0x0000007fffffffff +#define SH_MD_DQLP_MMR_XUERR1_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_XUERR1_GRP1 */ +/* Description: ecc group 1 bits */ +#define SH_MD_DQLP_MMR_XUERR1_GRP1_SHFT 0 +#define SH_MD_DQLP_MMR_XUERR1_GRP1_MASK 0x0000000fffffffff + +/* SH_MD_DQLP_MMR_XUERR1_VAL */ +/* Description: uncorrectable ecc error in group 1 bits */ +#define SH_MD_DQLP_MMR_XUERR1_VAL_SHFT 36 +#define SH_MD_DQLP_MMR_XUERR1_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQLP_MMR_XUERR1_MORE */ +/* Description: more than one uncorrectable ecc error in group 1 */ +#define SH_MD_DQLP_MMR_XUERR1_MORE_SHFT 37 +#define SH_MD_DQLP_MMR_XUERR1_MORE_MASK 0x0000002000000000 + +/* SH_MD_DQLP_MMR_XUERR1_ARM */ +/* Description: writing 1 arms uncorrectable ecc error capture */ +#define SH_MD_DQLP_MMR_XUERR1_ARM_SHFT 38 +#define SH_MD_DQLP_MMR_XUERR1_ARM_MASK 0x0000004000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XUERR2" */ +/* uncorrectable dir ecc group 2 error register */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_XUERR2 0x0000000100033030 +#define SH_MD_DQLP_MMR_XUERR2_MASK 0x0000003fffffffff +#define SH_MD_DQLP_MMR_XUERR2_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_XUERR2_GRP2 */ +/* Description: ecc group 2 bits */ +#define SH_MD_DQLP_MMR_XUERR2_GRP2_SHFT 0 +#define SH_MD_DQLP_MMR_XUERR2_GRP2_MASK 0x0000000fffffffff + +/* SH_MD_DQLP_MMR_XUERR2_VAL */ +/* Description: uncorrectable ecc error in group 2 bits */ +#define SH_MD_DQLP_MMR_XUERR2_VAL_SHFT 36 +#define SH_MD_DQLP_MMR_XUERR2_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQLP_MMR_XUERR2_MORE */ +/* Description: more than one uncorrectable ecc error in group 2 */ +#define SH_MD_DQLP_MMR_XUERR2_MORE_SHFT 37 +#define SH_MD_DQLP_MMR_XUERR2_MORE_MASK 0x0000002000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XPERR" */ +/* protocol error register */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_XPERR 0x0000000100033040 +#define SH_MD_DQLP_MMR_XPERR_MASK 0x7fffffffffffffff +#define SH_MD_DQLP_MMR_XPERR_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_XPERR_DIR */ +/* Description: directory entry */ +#define SH_MD_DQLP_MMR_XPERR_DIR_SHFT 0 +#define SH_MD_DQLP_MMR_XPERR_DIR_MASK 0x0000000003ffffff + +/* SH_MD_DQLP_MMR_XPERR_CMD */ +/* Description: incoming command */ +#define SH_MD_DQLP_MMR_XPERR_CMD_SHFT 26 +#define SH_MD_DQLP_MMR_XPERR_CMD_MASK 0x00000003fc000000 + +/* SH_MD_DQLP_MMR_XPERR_SRC */ +/* Description: source node of dir operation */ +#define SH_MD_DQLP_MMR_XPERR_SRC_SHFT 34 +#define SH_MD_DQLP_MMR_XPERR_SRC_MASK 0x0000fffc00000000 + +/* SH_MD_DQLP_MMR_XPERR_PRIGE */ +/* Description: priority was greater-equal */ +#define SH_MD_DQLP_MMR_XPERR_PRIGE_SHFT 48 +#define SH_MD_DQLP_MMR_XPERR_PRIGE_MASK 0x0001000000000000 + +/* SH_MD_DQLP_MMR_XPERR_PRIV */ +/* Description: access privilege bit */ +#define SH_MD_DQLP_MMR_XPERR_PRIV_SHFT 49 +#define SH_MD_DQLP_MMR_XPERR_PRIV_MASK 0x0002000000000000 + +/* SH_MD_DQLP_MMR_XPERR_COR */ +/* Description: correctable ecc error */ +#define SH_MD_DQLP_MMR_XPERR_COR_SHFT 50 +#define SH_MD_DQLP_MMR_XPERR_COR_MASK 0x0004000000000000 + +/* SH_MD_DQLP_MMR_XPERR_UNC */ +/* Description: uncorrectable ecc error */ +#define SH_MD_DQLP_MMR_XPERR_UNC_SHFT 51 +#define SH_MD_DQLP_MMR_XPERR_UNC_MASK 0x0008000000000000 + +/* SH_MD_DQLP_MMR_XPERR_MYBIT */ +/* Description: ptreq,timeq,timlast,timspec,onlyme,anytim,ptrii,src */ +#define SH_MD_DQLP_MMR_XPERR_MYBIT_SHFT 52 +#define SH_MD_DQLP_MMR_XPERR_MYBIT_MASK 0x0ff0000000000000 + +/* SH_MD_DQLP_MMR_XPERR_VAL */ +/* Description: protocol error info valid */ +#define SH_MD_DQLP_MMR_XPERR_VAL_SHFT 60 +#define SH_MD_DQLP_MMR_XPERR_VAL_MASK 0x1000000000000000 + +/* SH_MD_DQLP_MMR_XPERR_MORE */ +/* Description: more than one protocol error */ +#define SH_MD_DQLP_MMR_XPERR_MORE_SHFT 61 +#define SH_MD_DQLP_MMR_XPERR_MORE_MASK 0x2000000000000000 + +/* SH_MD_DQLP_MMR_XPERR_ARM */ +/* Description: writing 1 arms error capture */ +#define SH_MD_DQLP_MMR_XPERR_ARM_SHFT 62 +#define SH_MD_DQLP_MMR_XPERR_ARM_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YCERR1" */ +/* correctable dir ecc group 1 error register */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_YCERR1 0x0000000100033800 +#define SH_MD_DQLP_MMR_YCERR1_MASK 0x0000007fffffffff +#define SH_MD_DQLP_MMR_YCERR1_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_YCERR1_GRP1 */ +/* Description: ecc group 1 bits */ +#define SH_MD_DQLP_MMR_YCERR1_GRP1_SHFT 0 +#define SH_MD_DQLP_MMR_YCERR1_GRP1_MASK 0x0000000fffffffff + +/* SH_MD_DQLP_MMR_YCERR1_VAL */ +/* Description: correctable ecc error in group 1 bits */ +#define SH_MD_DQLP_MMR_YCERR1_VAL_SHFT 36 +#define SH_MD_DQLP_MMR_YCERR1_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQLP_MMR_YCERR1_MORE */ +/* Description: more than one correctable ecc error in group 1 */ +#define SH_MD_DQLP_MMR_YCERR1_MORE_SHFT 37 +#define SH_MD_DQLP_MMR_YCERR1_MORE_MASK 0x0000002000000000 + +/* SH_MD_DQLP_MMR_YCERR1_ARM */ +/* Description: writing 1 arms uncorrectable ecc error capture */ +#define SH_MD_DQLP_MMR_YCERR1_ARM_SHFT 38 +#define SH_MD_DQLP_MMR_YCERR1_ARM_MASK 0x0000004000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YCERR2" */ +/* correctable dir ecc group 2 error register */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_YCERR2 0x0000000100033810 +#define SH_MD_DQLP_MMR_YCERR2_MASK 0x0000003fffffffff +#define SH_MD_DQLP_MMR_YCERR2_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_YCERR2_GRP2 */ +/* Description: ecc group 2 bits */ +#define SH_MD_DQLP_MMR_YCERR2_GRP2_SHFT 0 +#define SH_MD_DQLP_MMR_YCERR2_GRP2_MASK 0x0000000fffffffff + +/* SH_MD_DQLP_MMR_YCERR2_VAL */ +/* Description: correctable ecc error in group 2 bits */ +#define SH_MD_DQLP_MMR_YCERR2_VAL_SHFT 36 +#define SH_MD_DQLP_MMR_YCERR2_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQLP_MMR_YCERR2_MORE */ +/* Description: more than one correctable ecc error in group 2 */ +#define SH_MD_DQLP_MMR_YCERR2_MORE_SHFT 37 +#define SH_MD_DQLP_MMR_YCERR2_MORE_MASK 0x0000002000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YUERR1" */ +/* uncorrectable dir ecc group 1 error register */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_YUERR1 0x0000000100033820 +#define SH_MD_DQLP_MMR_YUERR1_MASK 0x0000007fffffffff +#define SH_MD_DQLP_MMR_YUERR1_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_YUERR1_GRP1 */ +/* Description: ecc group 1 bits */ +#define SH_MD_DQLP_MMR_YUERR1_GRP1_SHFT 0 +#define SH_MD_DQLP_MMR_YUERR1_GRP1_MASK 0x0000000fffffffff + +/* SH_MD_DQLP_MMR_YUERR1_VAL */ +/* Description: uncorrectable ecc error in group 1 bits */ +#define SH_MD_DQLP_MMR_YUERR1_VAL_SHFT 36 +#define SH_MD_DQLP_MMR_YUERR1_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQLP_MMR_YUERR1_MORE */ +/* Description: more than one uncorrectable ecc error in group 1 */ +#define SH_MD_DQLP_MMR_YUERR1_MORE_SHFT 37 +#define SH_MD_DQLP_MMR_YUERR1_MORE_MASK 0x0000002000000000 + +/* SH_MD_DQLP_MMR_YUERR1_ARM */ +/* Description: writing 1 arms uncorrectable ecc error capture */ +#define SH_MD_DQLP_MMR_YUERR1_ARM_SHFT 38 +#define SH_MD_DQLP_MMR_YUERR1_ARM_MASK 0x0000004000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YUERR2" */ +/* uncorrectable dir ecc group 2 error register */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_YUERR2 0x0000000100033830 +#define SH_MD_DQLP_MMR_YUERR2_MASK 0x0000003fffffffff +#define SH_MD_DQLP_MMR_YUERR2_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_YUERR2_GRP2 */ +/* Description: ecc group 2 bits */ +#define SH_MD_DQLP_MMR_YUERR2_GRP2_SHFT 0 +#define SH_MD_DQLP_MMR_YUERR2_GRP2_MASK 0x0000000fffffffff + +/* SH_MD_DQLP_MMR_YUERR2_VAL */ +/* Description: uncorrectable ecc error in group 2 bits */ +#define SH_MD_DQLP_MMR_YUERR2_VAL_SHFT 36 +#define SH_MD_DQLP_MMR_YUERR2_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQLP_MMR_YUERR2_MORE */ +/* Description: more than one uncorrectable ecc error in group 2 */ +#define SH_MD_DQLP_MMR_YUERR2_MORE_SHFT 37 +#define SH_MD_DQLP_MMR_YUERR2_MORE_MASK 0x0000002000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YPERR" */ +/* protocol error register */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_YPERR 0x0000000100033840 +#define SH_MD_DQLP_MMR_YPERR_MASK 0x7fffffffffffffff +#define SH_MD_DQLP_MMR_YPERR_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_YPERR_DIR */ +/* Description: directory entry */ +#define SH_MD_DQLP_MMR_YPERR_DIR_SHFT 0 +#define SH_MD_DQLP_MMR_YPERR_DIR_MASK 0x0000000003ffffff + +/* SH_MD_DQLP_MMR_YPERR_CMD */ +/* Description: incoming command */ +#define SH_MD_DQLP_MMR_YPERR_CMD_SHFT 26 +#define SH_MD_DQLP_MMR_YPERR_CMD_MASK 0x00000003fc000000 + +/* SH_MD_DQLP_MMR_YPERR_SRC */ +/* Description: source node of dir operation */ +#define SH_MD_DQLP_MMR_YPERR_SRC_SHFT 34 +#define SH_MD_DQLP_MMR_YPERR_SRC_MASK 0x0000fffc00000000 + +/* SH_MD_DQLP_MMR_YPERR_PRIGE */ +/* Description: priority was greater-equal */ +#define SH_MD_DQLP_MMR_YPERR_PRIGE_SHFT 48 +#define SH_MD_DQLP_MMR_YPERR_PRIGE_MASK 0x0001000000000000 + +/* SH_MD_DQLP_MMR_YPERR_PRIV */ +/* Description: access privilege bit */ +#define SH_MD_DQLP_MMR_YPERR_PRIV_SHFT 49 +#define SH_MD_DQLP_MMR_YPERR_PRIV_MASK 0x0002000000000000 + +/* SH_MD_DQLP_MMR_YPERR_COR */ +/* Description: correctable ecc error */ +#define SH_MD_DQLP_MMR_YPERR_COR_SHFT 50 +#define SH_MD_DQLP_MMR_YPERR_COR_MASK 0x0004000000000000 + +/* SH_MD_DQLP_MMR_YPERR_UNC */ +/* Description: uncorrectable ecc error */ +#define SH_MD_DQLP_MMR_YPERR_UNC_SHFT 51 +#define SH_MD_DQLP_MMR_YPERR_UNC_MASK 0x0008000000000000 + +/* SH_MD_DQLP_MMR_YPERR_MYBIT */ +/* Description: ptreq,timeq,timlast,timspec,onlyme,anytim,ptrii,src */ +#define SH_MD_DQLP_MMR_YPERR_MYBIT_SHFT 52 +#define SH_MD_DQLP_MMR_YPERR_MYBIT_MASK 0x0ff0000000000000 + +/* SH_MD_DQLP_MMR_YPERR_VAL */ +/* Description: protocol error info valid */ +#define SH_MD_DQLP_MMR_YPERR_VAL_SHFT 60 +#define SH_MD_DQLP_MMR_YPERR_VAL_MASK 0x1000000000000000 + +/* SH_MD_DQLP_MMR_YPERR_MORE */ +/* Description: more than one protocol error */ +#define SH_MD_DQLP_MMR_YPERR_MORE_SHFT 61 +#define SH_MD_DQLP_MMR_YPERR_MORE_MASK 0x2000000000000000 + +/* SH_MD_DQLP_MMR_YPERR_ARM */ +/* Description: writing 1 arms error capture */ +#define SH_MD_DQLP_MMR_YPERR_ARM_SHFT 62 +#define SH_MD_DQLP_MMR_YPERR_ARM_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_CMDTRIG" */ +/* cmd triggers */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_CMDTRIG 0x0000000100034000 +#define SH_MD_DQLP_MMR_DIR_CMDTRIG_MASK 0x00000000ffffffff +#define SH_MD_DQLP_MMR_DIR_CMDTRIG_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_CMDTRIG_CMD0 */ +/* Description: command trigger 0 */ +#define SH_MD_DQLP_MMR_DIR_CMDTRIG_CMD0_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_CMDTRIG_CMD0_MASK 0x00000000000000ff + +/* SH_MD_DQLP_MMR_DIR_CMDTRIG_CMD1 */ +/* Description: command trigger 1 */ +#define SH_MD_DQLP_MMR_DIR_CMDTRIG_CMD1_SHFT 8 +#define SH_MD_DQLP_MMR_DIR_CMDTRIG_CMD1_MASK 0x000000000000ff00 + +/* SH_MD_DQLP_MMR_DIR_CMDTRIG_CMD2 */ +/* Description: command trigger 2 */ +#define SH_MD_DQLP_MMR_DIR_CMDTRIG_CMD2_SHFT 16 +#define SH_MD_DQLP_MMR_DIR_CMDTRIG_CMD2_MASK 0x0000000000ff0000 + +/* SH_MD_DQLP_MMR_DIR_CMDTRIG_CMD3 */ +/* Description: command trigger 3 */ +#define SH_MD_DQLP_MMR_DIR_CMDTRIG_CMD3_SHFT 24 +#define SH_MD_DQLP_MMR_DIR_CMDTRIG_CMD3_MASK 0x00000000ff000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_TBLTRIG" */ +/* dir table trigger */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_TBLTRIG 0x0000000100034010 +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_MASK 0x000003ffffffffff +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_TBLTRIG_SRC */ +/* Description: source of request */ +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_SRC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_SRC_MASK 0x0000000000003fff + +/* SH_MD_DQLP_MMR_DIR_TBLTRIG_CMD */ +/* Description: incoming request */ +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_CMD_SHFT 14 +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_CMD_MASK 0x00000000003fc000 + +/* SH_MD_DQLP_MMR_DIR_TBLTRIG_ACC */ +/* Description: uncorrectable error, privilege bit */ +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_ACC_SHFT 22 +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_ACC_MASK 0x0000000000c00000 + +/* SH_MD_DQLP_MMR_DIR_TBLTRIG_PRIGE */ +/* Description: priority greater-equal */ +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_PRIGE_SHFT 24 +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_PRIGE_MASK 0x0000000001000000 + +/* SH_MD_DQLP_MMR_DIR_TBLTRIG_DIRST */ +/* Description: shrd,sxro,sub-state */ +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_DIRST_SHFT 25 +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_DIRST_MASK 0x00000003fe000000 + +/* SH_MD_DQLP_MMR_DIR_TBLTRIG_MYBIT */ +/* Description: ptreq,timeq,timlast,timspec,onlyme,anytim,ptrii,src */ +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_MYBIT_SHFT 34 +#define SH_MD_DQLP_MMR_DIR_TBLTRIG_MYBIT_MASK 0x000003fc00000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_TBLMASK" */ +/* dir table trigger mask */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_DIR_TBLMASK 0x0000000100034020 +#define SH_MD_DQLP_MMR_DIR_TBLMASK_MASK 0x000003ffffffffff +#define SH_MD_DQLP_MMR_DIR_TBLMASK_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_DIR_TBLMASK_SRC */ +/* Description: source of request */ +#define SH_MD_DQLP_MMR_DIR_TBLMASK_SRC_SHFT 0 +#define SH_MD_DQLP_MMR_DIR_TBLMASK_SRC_MASK 0x0000000000003fff + +/* SH_MD_DQLP_MMR_DIR_TBLMASK_CMD */ +/* Description: incoming request */ +#define SH_MD_DQLP_MMR_DIR_TBLMASK_CMD_SHFT 14 +#define SH_MD_DQLP_MMR_DIR_TBLMASK_CMD_MASK 0x00000000003fc000 + +/* SH_MD_DQLP_MMR_DIR_TBLMASK_ACC */ +/* Description: uncorrectable error, privilege bit */ +#define SH_MD_DQLP_MMR_DIR_TBLMASK_ACC_SHFT 22 +#define SH_MD_DQLP_MMR_DIR_TBLMASK_ACC_MASK 0x0000000000c00000 + +/* SH_MD_DQLP_MMR_DIR_TBLMASK_PRIGE */ +/* Description: priority greater-equal */ +#define SH_MD_DQLP_MMR_DIR_TBLMASK_PRIGE_SHFT 24 +#define SH_MD_DQLP_MMR_DIR_TBLMASK_PRIGE_MASK 0x0000000001000000 + +/* SH_MD_DQLP_MMR_DIR_TBLMASK_DIRST */ +/* Description: shrd,sxro,sub-state */ +#define SH_MD_DQLP_MMR_DIR_TBLMASK_DIRST_SHFT 25 +#define SH_MD_DQLP_MMR_DIR_TBLMASK_DIRST_MASK 0x00000003fe000000 + +/* SH_MD_DQLP_MMR_DIR_TBLMASK_MYBIT */ +/* Description: ptreq,timeq,timlast,timspec,onlyme,anytim,ptrii,src */ +#define SH_MD_DQLP_MMR_DIR_TBLMASK_MYBIT_SHFT 34 +#define SH_MD_DQLP_MMR_DIR_TBLMASK_MYBIT_MASK 0x000003fc00000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_XBIST_H 0x0000000100038000 +#define SH_MD_DQLP_MMR_XBIST_H_MASK 0x00000700ffffffff +#define SH_MD_DQLP_MMR_XBIST_H_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_XBIST_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLP_MMR_XBIST_H_PAT_SHFT 0 +#define SH_MD_DQLP_MMR_XBIST_H_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQLP_MMR_XBIST_H_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQLP_MMR_XBIST_H_INV_SHFT 40 +#define SH_MD_DQLP_MMR_XBIST_H_INV_MASK 0x0000010000000000 + +/* SH_MD_DQLP_MMR_XBIST_H_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQLP_MMR_XBIST_H_ROT_SHFT 41 +#define SH_MD_DQLP_MMR_XBIST_H_ROT_MASK 0x0000020000000000 + +/* SH_MD_DQLP_MMR_XBIST_H_ARM */ +/* Description: writing 1 arms data miscompare capture */ +#define SH_MD_DQLP_MMR_XBIST_H_ARM_SHFT 42 +#define SH_MD_DQLP_MMR_XBIST_H_ARM_MASK 0x0000040000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_XBIST_L 0x0000000100038010 +#define SH_MD_DQLP_MMR_XBIST_L_MASK 0x00000300ffffffff +#define SH_MD_DQLP_MMR_XBIST_L_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_XBIST_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLP_MMR_XBIST_L_PAT_SHFT 0 +#define SH_MD_DQLP_MMR_XBIST_L_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQLP_MMR_XBIST_L_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQLP_MMR_XBIST_L_INV_SHFT 40 +#define SH_MD_DQLP_MMR_XBIST_L_INV_MASK 0x0000010000000000 + +/* SH_MD_DQLP_MMR_XBIST_L_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQLP_MMR_XBIST_L_ROT_SHFT 41 +#define SH_MD_DQLP_MMR_XBIST_L_ROT_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_XBIST_ERR_H 0x0000000100038020 +#define SH_MD_DQLP_MMR_XBIST_ERR_H_MASK 0x00000300ffffffff +#define SH_MD_DQLP_MMR_XBIST_ERR_H_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_XBIST_ERR_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLP_MMR_XBIST_ERR_H_PAT_SHFT 0 +#define SH_MD_DQLP_MMR_XBIST_ERR_H_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQLP_MMR_XBIST_ERR_H_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQLP_MMR_XBIST_ERR_H_VAL_SHFT 40 +#define SH_MD_DQLP_MMR_XBIST_ERR_H_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQLP_MMR_XBIST_ERR_H_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQLP_MMR_XBIST_ERR_H_MORE_SHFT 41 +#define SH_MD_DQLP_MMR_XBIST_ERR_H_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_XBIST_ERR_L 0x0000000100038030 +#define SH_MD_DQLP_MMR_XBIST_ERR_L_MASK 0x00000300ffffffff +#define SH_MD_DQLP_MMR_XBIST_ERR_L_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_XBIST_ERR_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLP_MMR_XBIST_ERR_L_PAT_SHFT 0 +#define SH_MD_DQLP_MMR_XBIST_ERR_L_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQLP_MMR_XBIST_ERR_L_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQLP_MMR_XBIST_ERR_L_VAL_SHFT 40 +#define SH_MD_DQLP_MMR_XBIST_ERR_L_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQLP_MMR_XBIST_ERR_L_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQLP_MMR_XBIST_ERR_L_MORE_SHFT 41 +#define SH_MD_DQLP_MMR_XBIST_ERR_L_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_YBIST_H 0x0000000100038800 +#define SH_MD_DQLP_MMR_YBIST_H_MASK 0x00000700ffffffff +#define SH_MD_DQLP_MMR_YBIST_H_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_YBIST_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLP_MMR_YBIST_H_PAT_SHFT 0 +#define SH_MD_DQLP_MMR_YBIST_H_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQLP_MMR_YBIST_H_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQLP_MMR_YBIST_H_INV_SHFT 40 +#define SH_MD_DQLP_MMR_YBIST_H_INV_MASK 0x0000010000000000 + +/* SH_MD_DQLP_MMR_YBIST_H_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQLP_MMR_YBIST_H_ROT_SHFT 41 +#define SH_MD_DQLP_MMR_YBIST_H_ROT_MASK 0x0000020000000000 + +/* SH_MD_DQLP_MMR_YBIST_H_ARM */ +/* Description: writing 1 arms data miscompare capture */ +#define SH_MD_DQLP_MMR_YBIST_H_ARM_SHFT 42 +#define SH_MD_DQLP_MMR_YBIST_H_ARM_MASK 0x0000040000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_YBIST_L 0x0000000100038810 +#define SH_MD_DQLP_MMR_YBIST_L_MASK 0x00000300ffffffff +#define SH_MD_DQLP_MMR_YBIST_L_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_YBIST_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLP_MMR_YBIST_L_PAT_SHFT 0 +#define SH_MD_DQLP_MMR_YBIST_L_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQLP_MMR_YBIST_L_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQLP_MMR_YBIST_L_INV_SHFT 40 +#define SH_MD_DQLP_MMR_YBIST_L_INV_MASK 0x0000010000000000 + +/* SH_MD_DQLP_MMR_YBIST_L_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQLP_MMR_YBIST_L_ROT_SHFT 41 +#define SH_MD_DQLP_MMR_YBIST_L_ROT_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_YBIST_ERR_H 0x0000000100038820 +#define SH_MD_DQLP_MMR_YBIST_ERR_H_MASK 0x00000300ffffffff +#define SH_MD_DQLP_MMR_YBIST_ERR_H_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_YBIST_ERR_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLP_MMR_YBIST_ERR_H_PAT_SHFT 0 +#define SH_MD_DQLP_MMR_YBIST_ERR_H_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQLP_MMR_YBIST_ERR_H_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQLP_MMR_YBIST_ERR_H_VAL_SHFT 40 +#define SH_MD_DQLP_MMR_YBIST_ERR_H_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQLP_MMR_YBIST_ERR_H_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQLP_MMR_YBIST_ERR_H_MORE_SHFT 41 +#define SH_MD_DQLP_MMR_YBIST_ERR_H_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLP_MMR_YBIST_ERR_L 0x0000000100038830 +#define SH_MD_DQLP_MMR_YBIST_ERR_L_MASK 0x00000300ffffffff +#define SH_MD_DQLP_MMR_YBIST_ERR_L_INIT 0x0000000000000000 + +/* SH_MD_DQLP_MMR_YBIST_ERR_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLP_MMR_YBIST_ERR_L_PAT_SHFT 0 +#define SH_MD_DQLP_MMR_YBIST_ERR_L_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQLP_MMR_YBIST_ERR_L_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQLP_MMR_YBIST_ERR_L_VAL_SHFT 40 +#define SH_MD_DQLP_MMR_YBIST_ERR_L_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQLP_MMR_YBIST_ERR_L_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQLP_MMR_YBIST_ERR_L_MORE_SHFT 41 +#define SH_MD_DQLP_MMR_YBIST_ERR_L_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_XBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLS_MMR_XBIST_H 0x0000000100048000 +#define SH_MD_DQLS_MMR_XBIST_H_MASK 0x000007ffffffffff +#define SH_MD_DQLS_MMR_XBIST_H_INIT 0x0000000000000000 + +/* SH_MD_DQLS_MMR_XBIST_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLS_MMR_XBIST_H_PAT_SHFT 0 +#define SH_MD_DQLS_MMR_XBIST_H_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQLS_MMR_XBIST_H_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQLS_MMR_XBIST_H_INV_SHFT 40 +#define SH_MD_DQLS_MMR_XBIST_H_INV_MASK 0x0000010000000000 + +/* SH_MD_DQLS_MMR_XBIST_H_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQLS_MMR_XBIST_H_ROT_SHFT 41 +#define SH_MD_DQLS_MMR_XBIST_H_ROT_MASK 0x0000020000000000 + +/* SH_MD_DQLS_MMR_XBIST_H_ARM */ +/* Description: writing 1 arms data miscompare capture */ +#define SH_MD_DQLS_MMR_XBIST_H_ARM_SHFT 42 +#define SH_MD_DQLS_MMR_XBIST_H_ARM_MASK 0x0000040000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_XBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLS_MMR_XBIST_L 0x0000000100048010 +#define SH_MD_DQLS_MMR_XBIST_L_MASK 0x000003ffffffffff +#define SH_MD_DQLS_MMR_XBIST_L_INIT 0x0000000000000000 + +/* SH_MD_DQLS_MMR_XBIST_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLS_MMR_XBIST_L_PAT_SHFT 0 +#define SH_MD_DQLS_MMR_XBIST_L_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQLS_MMR_XBIST_L_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQLS_MMR_XBIST_L_INV_SHFT 40 +#define SH_MD_DQLS_MMR_XBIST_L_INV_MASK 0x0000010000000000 + +/* SH_MD_DQLS_MMR_XBIST_L_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQLS_MMR_XBIST_L_ROT_SHFT 41 +#define SH_MD_DQLS_MMR_XBIST_L_ROT_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_XBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLS_MMR_XBIST_ERR_H 0x0000000100048020 +#define SH_MD_DQLS_MMR_XBIST_ERR_H_MASK 0x000003ffffffffff +#define SH_MD_DQLS_MMR_XBIST_ERR_H_INIT 0x0000000000000000 + +/* SH_MD_DQLS_MMR_XBIST_ERR_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLS_MMR_XBIST_ERR_H_PAT_SHFT 0 +#define SH_MD_DQLS_MMR_XBIST_ERR_H_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQLS_MMR_XBIST_ERR_H_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQLS_MMR_XBIST_ERR_H_VAL_SHFT 40 +#define SH_MD_DQLS_MMR_XBIST_ERR_H_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQLS_MMR_XBIST_ERR_H_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQLS_MMR_XBIST_ERR_H_MORE_SHFT 41 +#define SH_MD_DQLS_MMR_XBIST_ERR_H_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_XBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLS_MMR_XBIST_ERR_L 0x0000000100048030 +#define SH_MD_DQLS_MMR_XBIST_ERR_L_MASK 0x000003ffffffffff +#define SH_MD_DQLS_MMR_XBIST_ERR_L_INIT 0x0000000000000000 + +/* SH_MD_DQLS_MMR_XBIST_ERR_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLS_MMR_XBIST_ERR_L_PAT_SHFT 0 +#define SH_MD_DQLS_MMR_XBIST_ERR_L_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQLS_MMR_XBIST_ERR_L_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQLS_MMR_XBIST_ERR_L_VAL_SHFT 40 +#define SH_MD_DQLS_MMR_XBIST_ERR_L_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQLS_MMR_XBIST_ERR_L_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQLS_MMR_XBIST_ERR_L_MORE_SHFT 41 +#define SH_MD_DQLS_MMR_XBIST_ERR_L_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_YBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLS_MMR_YBIST_H 0x0000000100048800 +#define SH_MD_DQLS_MMR_YBIST_H_MASK 0x000007ffffffffff +#define SH_MD_DQLS_MMR_YBIST_H_INIT 0x0000000000000000 + +/* SH_MD_DQLS_MMR_YBIST_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLS_MMR_YBIST_H_PAT_SHFT 0 +#define SH_MD_DQLS_MMR_YBIST_H_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQLS_MMR_YBIST_H_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQLS_MMR_YBIST_H_INV_SHFT 40 +#define SH_MD_DQLS_MMR_YBIST_H_INV_MASK 0x0000010000000000 + +/* SH_MD_DQLS_MMR_YBIST_H_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQLS_MMR_YBIST_H_ROT_SHFT 41 +#define SH_MD_DQLS_MMR_YBIST_H_ROT_MASK 0x0000020000000000 + +/* SH_MD_DQLS_MMR_YBIST_H_ARM */ +/* Description: writing 1 arms data miscompare capture */ +#define SH_MD_DQLS_MMR_YBIST_H_ARM_SHFT 42 +#define SH_MD_DQLS_MMR_YBIST_H_ARM_MASK 0x0000040000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_YBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLS_MMR_YBIST_L 0x0000000100048810 +#define SH_MD_DQLS_MMR_YBIST_L_MASK 0x000003ffffffffff +#define SH_MD_DQLS_MMR_YBIST_L_INIT 0x0000000000000000 + +/* SH_MD_DQLS_MMR_YBIST_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLS_MMR_YBIST_L_PAT_SHFT 0 +#define SH_MD_DQLS_MMR_YBIST_L_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQLS_MMR_YBIST_L_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQLS_MMR_YBIST_L_INV_SHFT 40 +#define SH_MD_DQLS_MMR_YBIST_L_INV_MASK 0x0000010000000000 + +/* SH_MD_DQLS_MMR_YBIST_L_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQLS_MMR_YBIST_L_ROT_SHFT 41 +#define SH_MD_DQLS_MMR_YBIST_L_ROT_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_YBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLS_MMR_YBIST_ERR_H 0x0000000100048820 +#define SH_MD_DQLS_MMR_YBIST_ERR_H_MASK 0x000003ffffffffff +#define SH_MD_DQLS_MMR_YBIST_ERR_H_INIT 0x0000000000000000 + +/* SH_MD_DQLS_MMR_YBIST_ERR_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLS_MMR_YBIST_ERR_H_PAT_SHFT 0 +#define SH_MD_DQLS_MMR_YBIST_ERR_H_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQLS_MMR_YBIST_ERR_H_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQLS_MMR_YBIST_ERR_H_VAL_SHFT 40 +#define SH_MD_DQLS_MMR_YBIST_ERR_H_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQLS_MMR_YBIST_ERR_H_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQLS_MMR_YBIST_ERR_H_MORE_SHFT 41 +#define SH_MD_DQLS_MMR_YBIST_ERR_H_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_YBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQLS_MMR_YBIST_ERR_L 0x0000000100048830 +#define SH_MD_DQLS_MMR_YBIST_ERR_L_MASK 0x000003ffffffffff +#define SH_MD_DQLS_MMR_YBIST_ERR_L_INIT 0x0000000000000000 + +/* SH_MD_DQLS_MMR_YBIST_ERR_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQLS_MMR_YBIST_ERR_L_PAT_SHFT 0 +#define SH_MD_DQLS_MMR_YBIST_ERR_L_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQLS_MMR_YBIST_ERR_L_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQLS_MMR_YBIST_ERR_L_VAL_SHFT 40 +#define SH_MD_DQLS_MMR_YBIST_ERR_L_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQLS_MMR_YBIST_ERR_L_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQLS_MMR_YBIST_ERR_L_MORE_SHFT 41 +#define SH_MD_DQLS_MMR_YBIST_ERR_L_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_JNR_DEBUG" */ +/* joiner/fct debug configuration */ +/* ==================================================================== */ + +#define SH_MD_DQLS_MMR_JNR_DEBUG 0x0000000100049000 +#define SH_MD_DQLS_MMR_JNR_DEBUG_MASK 0x0000000000000003 +#define SH_MD_DQLS_MMR_JNR_DEBUG_INIT 0x0000000000000000 + +/* SH_MD_DQLS_MMR_JNR_DEBUG_PX */ +/* Description: select 0=pi 1=xn side */ +#define SH_MD_DQLS_MMR_JNR_DEBUG_PX_SHFT 0 +#define SH_MD_DQLS_MMR_JNR_DEBUG_PX_MASK 0x0000000000000001 + +/* SH_MD_DQLS_MMR_JNR_DEBUG_RW */ +/* Description: select 0=read 1=write side */ +#define SH_MD_DQLS_MMR_JNR_DEBUG_RW_SHFT 1 +#define SH_MD_DQLS_MMR_JNR_DEBUG_RW_MASK 0x0000000000000002 + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_XAMOPW_ERR" */ +/* amo/partial rmw ecc error register */ +/* ==================================================================== */ + +#define SH_MD_DQLS_MMR_XAMOPW_ERR 0x000000010004a000 +#define SH_MD_DQLS_MMR_XAMOPW_ERR_MASK 0x0000000103ff03ff +#define SH_MD_DQLS_MMR_XAMOPW_ERR_INIT 0x0000000000000000 + +/* SH_MD_DQLS_MMR_XAMOPW_ERR_SSYN */ +/* Description: store data syndrome */ +#define SH_MD_DQLS_MMR_XAMOPW_ERR_SSYN_SHFT 0 +#define SH_MD_DQLS_MMR_XAMOPW_ERR_SSYN_MASK 0x00000000000000ff + +/* SH_MD_DQLS_MMR_XAMOPW_ERR_SCOR */ +/* Description: correctable ecc errror on store data */ +#define SH_MD_DQLS_MMR_XAMOPW_ERR_SCOR_SHFT 8 +#define SH_MD_DQLS_MMR_XAMOPW_ERR_SCOR_MASK 0x0000000000000100 + +/* SH_MD_DQLS_MMR_XAMOPW_ERR_SUNC */ +/* Description: uncorrectable ecc errror on store data */ +#define SH_MD_DQLS_MMR_XAMOPW_ERR_SUNC_SHFT 9 +#define SH_MD_DQLS_MMR_XAMOPW_ERR_SUNC_MASK 0x0000000000000200 + +/* SH_MD_DQLS_MMR_XAMOPW_ERR_RSYN */ +/* Description: memory read data syndrome */ +#define SH_MD_DQLS_MMR_XAMOPW_ERR_RSYN_SHFT 16 +#define SH_MD_DQLS_MMR_XAMOPW_ERR_RSYN_MASK 0x0000000000ff0000 + +/* SH_MD_DQLS_MMR_XAMOPW_ERR_RCOR */ +/* Description: correctable ecc errror on read data */ +#define SH_MD_DQLS_MMR_XAMOPW_ERR_RCOR_SHFT 24 +#define SH_MD_DQLS_MMR_XAMOPW_ERR_RCOR_MASK 0x0000000001000000 + +/* SH_MD_DQLS_MMR_XAMOPW_ERR_RUNC */ +/* Description: uncorrectable ecc errror on read data */ +#define SH_MD_DQLS_MMR_XAMOPW_ERR_RUNC_SHFT 25 +#define SH_MD_DQLS_MMR_XAMOPW_ERR_RUNC_MASK 0x0000000002000000 + +/* SH_MD_DQLS_MMR_XAMOPW_ERR_ARM */ +/* Description: writing 1 arms ecc error capture */ +#define SH_MD_DQLS_MMR_XAMOPW_ERR_ARM_SHFT 32 +#define SH_MD_DQLS_MMR_XAMOPW_ERR_ARM_MASK 0x0000000100000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_CONFIG" */ +/* DQ directory config register */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_CONFIG 0x0000000100050000 +#define SH_MD_DQRP_MMR_DIR_CONFIG_MASK 0x000000000000001f +#define SH_MD_DQRP_MMR_DIR_CONFIG_INIT 0x0000000000000010 + +/* SH_MD_DQRP_MMR_DIR_CONFIG_SYS_SIZE */ +/* Description: system size code */ +#define SH_MD_DQRP_MMR_DIR_CONFIG_SYS_SIZE_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_CONFIG_SYS_SIZE_MASK 0x0000000000000007 + +/* SH_MD_DQRP_MMR_DIR_CONFIG_EN_DIRECC */ +/* Description: enable directory ecc correction */ +#define SH_MD_DQRP_MMR_DIR_CONFIG_EN_DIRECC_SHFT 3 +#define SH_MD_DQRP_MMR_DIR_CONFIG_EN_DIRECC_MASK 0x0000000000000008 + +/* SH_MD_DQRP_MMR_DIR_CONFIG_EN_DIRPOIS */ +/* Description: enable local poisoning for dir table fall-through */ +#define SH_MD_DQRP_MMR_DIR_CONFIG_EN_DIRPOIS_SHFT 4 +#define SH_MD_DQRP_MMR_DIR_CONFIG_EN_DIRPOIS_MASK 0x0000000000000010 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRESVEC0" */ +/* node [63:0] presence bits */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_PRESVEC0 0x0000000100050100 +#define SH_MD_DQRP_MMR_DIR_PRESVEC0_MASK 0xffffffffffffffff +#define SH_MD_DQRP_MMR_DIR_PRESVEC0_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_PRESVEC0_VEC */ +/* Description: node presence bits, 1=present */ +#define SH_MD_DQRP_MMR_DIR_PRESVEC0_VEC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_PRESVEC0_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRESVEC1" */ +/* node [127:64] presence bits */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_PRESVEC1 0x0000000100050110 +#define SH_MD_DQRP_MMR_DIR_PRESVEC1_MASK 0xffffffffffffffff +#define SH_MD_DQRP_MMR_DIR_PRESVEC1_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_PRESVEC1_VEC */ +/* Description: node presence bits, 1=present */ +#define SH_MD_DQRP_MMR_DIR_PRESVEC1_VEC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_PRESVEC1_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRESVEC2" */ +/* node [191:128] presence bits */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_PRESVEC2 0x0000000100050120 +#define SH_MD_DQRP_MMR_DIR_PRESVEC2_MASK 0xffffffffffffffff +#define SH_MD_DQRP_MMR_DIR_PRESVEC2_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_PRESVEC2_VEC */ +/* Description: node presence bits, 1=present */ +#define SH_MD_DQRP_MMR_DIR_PRESVEC2_VEC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_PRESVEC2_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRESVEC3" */ +/* node [255:192] presence bits */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_PRESVEC3 0x0000000100050130 +#define SH_MD_DQRP_MMR_DIR_PRESVEC3_MASK 0xffffffffffffffff +#define SH_MD_DQRP_MMR_DIR_PRESVEC3_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_PRESVEC3_VEC */ +/* Description: node presence bits, 1=present */ +#define SH_MD_DQRP_MMR_DIR_PRESVEC3_VEC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_PRESVEC3_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC0" */ +/* local vector for acc=0 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_LOCVEC0 0x0000000100050200 +#define SH_MD_DQRP_MMR_DIR_LOCVEC0_MASK 0xffffffffffffffff +#define SH_MD_DQRP_MMR_DIR_LOCVEC0_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_LOCVEC0_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQRP_MMR_DIR_LOCVEC0_VEC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_LOCVEC0_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC1" */ +/* local vector for acc=1 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_LOCVEC1 0x0000000100050210 +#define SH_MD_DQRP_MMR_DIR_LOCVEC1_MASK 0xffffffffffffffff +#define SH_MD_DQRP_MMR_DIR_LOCVEC1_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_LOCVEC1_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQRP_MMR_DIR_LOCVEC1_VEC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_LOCVEC1_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC2" */ +/* local vector for acc=2 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_LOCVEC2 0x0000000100050220 +#define SH_MD_DQRP_MMR_DIR_LOCVEC2_MASK 0xffffffffffffffff +#define SH_MD_DQRP_MMR_DIR_LOCVEC2_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_LOCVEC2_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQRP_MMR_DIR_LOCVEC2_VEC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_LOCVEC2_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC3" */ +/* local vector for acc=3 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_LOCVEC3 0x0000000100050230 +#define SH_MD_DQRP_MMR_DIR_LOCVEC3_MASK 0xffffffffffffffff +#define SH_MD_DQRP_MMR_DIR_LOCVEC3_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_LOCVEC3_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQRP_MMR_DIR_LOCVEC3_VEC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_LOCVEC3_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC4" */ +/* local vector for acc=4 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_LOCVEC4 0x0000000100050240 +#define SH_MD_DQRP_MMR_DIR_LOCVEC4_MASK 0xffffffffffffffff +#define SH_MD_DQRP_MMR_DIR_LOCVEC4_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_LOCVEC4_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQRP_MMR_DIR_LOCVEC4_VEC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_LOCVEC4_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC5" */ +/* local vector for acc=5 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_LOCVEC5 0x0000000100050250 +#define SH_MD_DQRP_MMR_DIR_LOCVEC5_MASK 0xffffffffffffffff +#define SH_MD_DQRP_MMR_DIR_LOCVEC5_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_LOCVEC5_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQRP_MMR_DIR_LOCVEC5_VEC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_LOCVEC5_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC6" */ +/* local vector for acc=6 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_LOCVEC6 0x0000000100050260 +#define SH_MD_DQRP_MMR_DIR_LOCVEC6_MASK 0xffffffffffffffff +#define SH_MD_DQRP_MMR_DIR_LOCVEC6_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_LOCVEC6_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQRP_MMR_DIR_LOCVEC6_VEC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_LOCVEC6_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC7" */ +/* local vector for acc=7 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_LOCVEC7 0x0000000100050270 +#define SH_MD_DQRP_MMR_DIR_LOCVEC7_MASK 0xffffffffffffffff +#define SH_MD_DQRP_MMR_DIR_LOCVEC7_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_LOCVEC7_VEC */ +/* Description: 1 node is local */ +#define SH_MD_DQRP_MMR_DIR_LOCVEC7_VEC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_LOCVEC7_VEC_MASK 0xffffffffffffffff + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC0" */ +/* privilege vector for acc=0 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_PRIVEC0 0x0000000100050300 +#define SH_MD_DQRP_MMR_DIR_PRIVEC0_MASK 0x000000000fffffff +#define SH_MD_DQRP_MMR_DIR_PRIVEC0_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_PRIVEC0_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC0_IN_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_PRIVEC0_IN_MASK 0x0000000000003fff + +/* SH_MD_DQRP_MMR_DIR_PRIVEC0_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC0_OUT_SHFT 14 +#define SH_MD_DQRP_MMR_DIR_PRIVEC0_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC1" */ +/* privilege vector for acc=1 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_PRIVEC1 0x0000000100050310 +#define SH_MD_DQRP_MMR_DIR_PRIVEC1_MASK 0x000000000fffffff +#define SH_MD_DQRP_MMR_DIR_PRIVEC1_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_PRIVEC1_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC1_IN_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_PRIVEC1_IN_MASK 0x0000000000003fff + +/* SH_MD_DQRP_MMR_DIR_PRIVEC1_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC1_OUT_SHFT 14 +#define SH_MD_DQRP_MMR_DIR_PRIVEC1_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC2" */ +/* privilege vector for acc=2 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_PRIVEC2 0x0000000100050320 +#define SH_MD_DQRP_MMR_DIR_PRIVEC2_MASK 0x000000000fffffff +#define SH_MD_DQRP_MMR_DIR_PRIVEC2_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_PRIVEC2_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC2_IN_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_PRIVEC2_IN_MASK 0x0000000000003fff + +/* SH_MD_DQRP_MMR_DIR_PRIVEC2_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC2_OUT_SHFT 14 +#define SH_MD_DQRP_MMR_DIR_PRIVEC2_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC3" */ +/* privilege vector for acc=3 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_PRIVEC3 0x0000000100050330 +#define SH_MD_DQRP_MMR_DIR_PRIVEC3_MASK 0x000000000fffffff +#define SH_MD_DQRP_MMR_DIR_PRIVEC3_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_PRIVEC3_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC3_IN_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_PRIVEC3_IN_MASK 0x0000000000003fff + +/* SH_MD_DQRP_MMR_DIR_PRIVEC3_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC3_OUT_SHFT 14 +#define SH_MD_DQRP_MMR_DIR_PRIVEC3_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC4" */ +/* privilege vector for acc=4 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_PRIVEC4 0x0000000100050340 +#define SH_MD_DQRP_MMR_DIR_PRIVEC4_MASK 0x000000000fffffff +#define SH_MD_DQRP_MMR_DIR_PRIVEC4_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_PRIVEC4_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC4_IN_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_PRIVEC4_IN_MASK 0x0000000000003fff + +/* SH_MD_DQRP_MMR_DIR_PRIVEC4_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC4_OUT_SHFT 14 +#define SH_MD_DQRP_MMR_DIR_PRIVEC4_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC5" */ +/* privilege vector for acc=5 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_PRIVEC5 0x0000000100050350 +#define SH_MD_DQRP_MMR_DIR_PRIVEC5_MASK 0x000000000fffffff +#define SH_MD_DQRP_MMR_DIR_PRIVEC5_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_PRIVEC5_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC5_IN_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_PRIVEC5_IN_MASK 0x0000000000003fff + +/* SH_MD_DQRP_MMR_DIR_PRIVEC5_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC5_OUT_SHFT 14 +#define SH_MD_DQRP_MMR_DIR_PRIVEC5_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC6" */ +/* privilege vector for acc=6 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_PRIVEC6 0x0000000100050360 +#define SH_MD_DQRP_MMR_DIR_PRIVEC6_MASK 0x000000000fffffff +#define SH_MD_DQRP_MMR_DIR_PRIVEC6_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_PRIVEC6_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC6_IN_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_PRIVEC6_IN_MASK 0x0000000000003fff + +/* SH_MD_DQRP_MMR_DIR_PRIVEC6_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC6_OUT_SHFT 14 +#define SH_MD_DQRP_MMR_DIR_PRIVEC6_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC7" */ +/* privilege vector for acc=7 */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_PRIVEC7 0x0000000100050370 +#define SH_MD_DQRP_MMR_DIR_PRIVEC7_MASK 0x000000000fffffff +#define SH_MD_DQRP_MMR_DIR_PRIVEC7_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_PRIVEC7_IN */ +/* Description: in partition privileges, locvec bit=1 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC7_IN_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_PRIVEC7_IN_MASK 0x0000000000003fff + +/* SH_MD_DQRP_MMR_DIR_PRIVEC7_OUT */ +/* Description: out of partition privileges, locvec bit=0 */ +#define SH_MD_DQRP_MMR_DIR_PRIVEC7_OUT_SHFT 14 +#define SH_MD_DQRP_MMR_DIR_PRIVEC7_OUT_MASK 0x000000000fffc000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_TIMER" */ +/* MD SXRO timer */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_TIMER 0x0000000100050400 +#define SH_MD_DQRP_MMR_DIR_TIMER_MASK 0x00000000003fffff +#define SH_MD_DQRP_MMR_DIR_TIMER_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_TIMER_TIMER_DIV */ +/* Description: timer divide register */ +#define SH_MD_DQRP_MMR_DIR_TIMER_TIMER_DIV_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_TIMER_TIMER_DIV_MASK 0x0000000000000fff + +/* SH_MD_DQRP_MMR_DIR_TIMER_TIMER_EN */ +/* Description: timer enable */ +#define SH_MD_DQRP_MMR_DIR_TIMER_TIMER_EN_SHFT 12 +#define SH_MD_DQRP_MMR_DIR_TIMER_TIMER_EN_MASK 0x0000000000001000 + +/* SH_MD_DQRP_MMR_DIR_TIMER_TIMER_CUR */ +/* Description: value of current timer */ +#define SH_MD_DQRP_MMR_DIR_TIMER_TIMER_CUR_SHFT 13 +#define SH_MD_DQRP_MMR_DIR_TIMER_TIMER_CUR_MASK 0x00000000003fe000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY" */ +/* directory pio write data */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY 0x0000000100051000 +#define SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_MASK 0x03ffffffffffffff +#define SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_DIRA */ +/* Description: directory entry A */ +#define SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_DIRA_SHFT 0 +#define SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_DIRA_MASK 0x0000000003ffffff + +/* SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_DIRB */ +/* Description: directory entry B */ +#define SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_DIRB_SHFT 26 +#define SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_DIRB_MASK 0x000ffffffc000000 + +/* SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_PRI */ +/* Description: directory priority */ +#define SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_PRI_SHFT 52 +#define SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_PRI_MASK 0x0070000000000000 + +/* SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_ACC */ +/* Description: directory access bits */ +#define SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_ACC_SHFT 55 +#define SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY_ACC_MASK 0x0380000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_PIOWD_DIR_ECC" */ +/* directory ecc register */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_PIOWD_DIR_ECC 0x0000000100051010 +#define SH_MD_DQRP_MMR_PIOWD_DIR_ECC_MASK 0x0000000000003fff +#define SH_MD_DQRP_MMR_PIOWD_DIR_ECC_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_PIOWD_DIR_ECC_ECCA */ +/* Description: XOR bits for directory ECC group 1 */ +#define SH_MD_DQRP_MMR_PIOWD_DIR_ECC_ECCA_SHFT 0 +#define SH_MD_DQRP_MMR_PIOWD_DIR_ECC_ECCA_MASK 0x000000000000007f + +/* SH_MD_DQRP_MMR_PIOWD_DIR_ECC_ECCB */ +/* Description: XOR bits for directory ECC group 2 */ +#define SH_MD_DQRP_MMR_PIOWD_DIR_ECC_ECCB_SHFT 7 +#define SH_MD_DQRP_MMR_PIOWD_DIR_ECC_ECCB_MASK 0x0000000000003f80 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY" */ +/* x directory pio read data */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY 0x0000000100052000 +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_MASK 0x0fffffffffffffff +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_DIRA */ +/* Description: directory entry A */ +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_DIRA_SHFT 0 +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_DIRA_MASK 0x0000000003ffffff + +/* SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_DIRB */ +/* Description: directory entry B */ +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_DIRB_SHFT 26 +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_DIRB_MASK 0x000ffffffc000000 + +/* SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_PRI */ +/* Description: directory priority */ +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_PRI_SHFT 52 +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_PRI_MASK 0x0070000000000000 + +/* SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_ACC */ +/* Description: directory access bits */ +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_ACC_SHFT 55 +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_ACC_MASK 0x0380000000000000 + +/* SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_COR */ +/* Description: correctable ecc error */ +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_COR_SHFT 58 +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_COR_MASK 0x0400000000000000 + +/* SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_UNC */ +/* Description: uncorrectable ecc error */ +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_UNC_SHFT 59 +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY_UNC_MASK 0x0800000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XPIORD_XDIR_ECC" */ +/* x directory ecc */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ECC 0x0000000100052010 +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ECC_MASK 0x0000000000003fff +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ECC_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_XPIORD_XDIR_ECC_ECCA */ +/* Description: group 1 ecc */ +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ECC_ECCA_SHFT 0 +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ECC_ECCA_MASK 0x000000000000007f + +/* SH_MD_DQRP_MMR_XPIORD_XDIR_ECC_ECCB */ +/* Description: group 2 ecc */ +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ECC_ECCB_SHFT 7 +#define SH_MD_DQRP_MMR_XPIORD_XDIR_ECC_ECCB_MASK 0x0000000000003f80 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY" */ +/* y directory pio read data */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY 0x0000000100052800 +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_MASK 0x0fffffffffffffff +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_DIRA */ +/* Description: directory entry A */ +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_DIRA_SHFT 0 +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_DIRA_MASK 0x0000000003ffffff + +/* SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_DIRB */ +/* Description: directory entry B */ +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_DIRB_SHFT 26 +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_DIRB_MASK 0x000ffffffc000000 + +/* SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_PRI */ +/* Description: directory priority */ +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_PRI_SHFT 52 +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_PRI_MASK 0x0070000000000000 + +/* SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_ACC */ +/* Description: directory access bits */ +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_ACC_SHFT 55 +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_ACC_MASK 0x0380000000000000 + +/* SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_COR */ +/* Description: correctable ecc error */ +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_COR_SHFT 58 +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_COR_MASK 0x0400000000000000 + +/* SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_UNC */ +/* Description: uncorrectable ecc error */ +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_UNC_SHFT 59 +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY_UNC_MASK 0x0800000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YPIORD_YDIR_ECC" */ +/* y directory ecc */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ECC 0x0000000100052810 +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ECC_MASK 0x0000000000003fff +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ECC_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_YPIORD_YDIR_ECC_ECCA */ +/* Description: group 1 ecc */ +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ECC_ECCA_SHFT 0 +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ECC_ECCA_MASK 0x000000000000007f + +/* SH_MD_DQRP_MMR_YPIORD_YDIR_ECC_ECCB */ +/* Description: group 2 ecc */ +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ECC_ECCB_SHFT 7 +#define SH_MD_DQRP_MMR_YPIORD_YDIR_ECC_ECCB_MASK 0x0000000000003f80 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XCERR1" */ +/* correctable dir ecc group 1 error register */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_XCERR1 0x0000000100053000 +#define SH_MD_DQRP_MMR_XCERR1_MASK 0x0000007fffffffff +#define SH_MD_DQRP_MMR_XCERR1_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_XCERR1_GRP1 */ +/* Description: ecc group 1 bits */ +#define SH_MD_DQRP_MMR_XCERR1_GRP1_SHFT 0 +#define SH_MD_DQRP_MMR_XCERR1_GRP1_MASK 0x0000000fffffffff + +/* SH_MD_DQRP_MMR_XCERR1_VAL */ +/* Description: correctable ecc error in group 1 bits */ +#define SH_MD_DQRP_MMR_XCERR1_VAL_SHFT 36 +#define SH_MD_DQRP_MMR_XCERR1_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQRP_MMR_XCERR1_MORE */ +/* Description: more than one correctable ecc error in group 1 */ +#define SH_MD_DQRP_MMR_XCERR1_MORE_SHFT 37 +#define SH_MD_DQRP_MMR_XCERR1_MORE_MASK 0x0000002000000000 + +/* SH_MD_DQRP_MMR_XCERR1_ARM */ +/* Description: writing 1 arms uncorrectable ecc error capture */ +#define SH_MD_DQRP_MMR_XCERR1_ARM_SHFT 38 +#define SH_MD_DQRP_MMR_XCERR1_ARM_MASK 0x0000004000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XCERR2" */ +/* correctable dir ecc group 2 error register */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_XCERR2 0x0000000100053010 +#define SH_MD_DQRP_MMR_XCERR2_MASK 0x0000003fffffffff +#define SH_MD_DQRP_MMR_XCERR2_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_XCERR2_GRP2 */ +/* Description: ecc group 2 bits */ +#define SH_MD_DQRP_MMR_XCERR2_GRP2_SHFT 0 +#define SH_MD_DQRP_MMR_XCERR2_GRP2_MASK 0x0000000fffffffff + +/* SH_MD_DQRP_MMR_XCERR2_VAL */ +/* Description: correctable ecc error in group 2 bits */ +#define SH_MD_DQRP_MMR_XCERR2_VAL_SHFT 36 +#define SH_MD_DQRP_MMR_XCERR2_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQRP_MMR_XCERR2_MORE */ +/* Description: more than one correctable ecc error in group 2 */ +#define SH_MD_DQRP_MMR_XCERR2_MORE_SHFT 37 +#define SH_MD_DQRP_MMR_XCERR2_MORE_MASK 0x0000002000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XUERR1" */ +/* uncorrectable dir ecc group 1 error register */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_XUERR1 0x0000000100053020 +#define SH_MD_DQRP_MMR_XUERR1_MASK 0x0000007fffffffff +#define SH_MD_DQRP_MMR_XUERR1_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_XUERR1_GRP1 */ +/* Description: ecc group 1 bits */ +#define SH_MD_DQRP_MMR_XUERR1_GRP1_SHFT 0 +#define SH_MD_DQRP_MMR_XUERR1_GRP1_MASK 0x0000000fffffffff + +/* SH_MD_DQRP_MMR_XUERR1_VAL */ +/* Description: uncorrectable ecc error in group 1 bits */ +#define SH_MD_DQRP_MMR_XUERR1_VAL_SHFT 36 +#define SH_MD_DQRP_MMR_XUERR1_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQRP_MMR_XUERR1_MORE */ +/* Description: more than one uncorrectable ecc error in group 1 */ +#define SH_MD_DQRP_MMR_XUERR1_MORE_SHFT 37 +#define SH_MD_DQRP_MMR_XUERR1_MORE_MASK 0x0000002000000000 + +/* SH_MD_DQRP_MMR_XUERR1_ARM */ +/* Description: writing 1 arms uncorrectable ecc error capture */ +#define SH_MD_DQRP_MMR_XUERR1_ARM_SHFT 38 +#define SH_MD_DQRP_MMR_XUERR1_ARM_MASK 0x0000004000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XUERR2" */ +/* uncorrectable dir ecc group 2 error register */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_XUERR2 0x0000000100053030 +#define SH_MD_DQRP_MMR_XUERR2_MASK 0x0000003fffffffff +#define SH_MD_DQRP_MMR_XUERR2_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_XUERR2_GRP2 */ +/* Description: ecc group 2 bits */ +#define SH_MD_DQRP_MMR_XUERR2_GRP2_SHFT 0 +#define SH_MD_DQRP_MMR_XUERR2_GRP2_MASK 0x0000000fffffffff + +/* SH_MD_DQRP_MMR_XUERR2_VAL */ +/* Description: uncorrectable ecc error in group 2 bits */ +#define SH_MD_DQRP_MMR_XUERR2_VAL_SHFT 36 +#define SH_MD_DQRP_MMR_XUERR2_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQRP_MMR_XUERR2_MORE */ +/* Description: more than one uncorrectable ecc error in group 2 */ +#define SH_MD_DQRP_MMR_XUERR2_MORE_SHFT 37 +#define SH_MD_DQRP_MMR_XUERR2_MORE_MASK 0x0000002000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XPERR" */ +/* protocol error register */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_XPERR 0x0000000100053040 +#define SH_MD_DQRP_MMR_XPERR_MASK 0x7fffffffffffffff +#define SH_MD_DQRP_MMR_XPERR_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_XPERR_DIR */ +/* Description: directory entry */ +#define SH_MD_DQRP_MMR_XPERR_DIR_SHFT 0 +#define SH_MD_DQRP_MMR_XPERR_DIR_MASK 0x0000000003ffffff + +/* SH_MD_DQRP_MMR_XPERR_CMD */ +/* Description: incoming command */ +#define SH_MD_DQRP_MMR_XPERR_CMD_SHFT 26 +#define SH_MD_DQRP_MMR_XPERR_CMD_MASK 0x00000003fc000000 + +/* SH_MD_DQRP_MMR_XPERR_SRC */ +/* Description: source node of dir operation */ +#define SH_MD_DQRP_MMR_XPERR_SRC_SHFT 34 +#define SH_MD_DQRP_MMR_XPERR_SRC_MASK 0x0000fffc00000000 + +/* SH_MD_DQRP_MMR_XPERR_PRIGE */ +/* Description: priority was greater-equal */ +#define SH_MD_DQRP_MMR_XPERR_PRIGE_SHFT 48 +#define SH_MD_DQRP_MMR_XPERR_PRIGE_MASK 0x0001000000000000 + +/* SH_MD_DQRP_MMR_XPERR_PRIV */ +/* Description: access privilege bit */ +#define SH_MD_DQRP_MMR_XPERR_PRIV_SHFT 49 +#define SH_MD_DQRP_MMR_XPERR_PRIV_MASK 0x0002000000000000 + +/* SH_MD_DQRP_MMR_XPERR_COR */ +/* Description: correctable ecc error */ +#define SH_MD_DQRP_MMR_XPERR_COR_SHFT 50 +#define SH_MD_DQRP_MMR_XPERR_COR_MASK 0x0004000000000000 + +/* SH_MD_DQRP_MMR_XPERR_UNC */ +/* Description: uncorrectable ecc error */ +#define SH_MD_DQRP_MMR_XPERR_UNC_SHFT 51 +#define SH_MD_DQRP_MMR_XPERR_UNC_MASK 0x0008000000000000 + +/* SH_MD_DQRP_MMR_XPERR_MYBIT */ +/* Description: ptreq,timeq,timlast,timspec,onlyme,anytim,ptrii,src */ +#define SH_MD_DQRP_MMR_XPERR_MYBIT_SHFT 52 +#define SH_MD_DQRP_MMR_XPERR_MYBIT_MASK 0x0ff0000000000000 + +/* SH_MD_DQRP_MMR_XPERR_VAL */ +/* Description: protocol error info valid */ +#define SH_MD_DQRP_MMR_XPERR_VAL_SHFT 60 +#define SH_MD_DQRP_MMR_XPERR_VAL_MASK 0x1000000000000000 + +/* SH_MD_DQRP_MMR_XPERR_MORE */ +/* Description: more than one protocol error */ +#define SH_MD_DQRP_MMR_XPERR_MORE_SHFT 61 +#define SH_MD_DQRP_MMR_XPERR_MORE_MASK 0x2000000000000000 + +/* SH_MD_DQRP_MMR_XPERR_ARM */ +/* Description: writing 1 arms error capture */ +#define SH_MD_DQRP_MMR_XPERR_ARM_SHFT 62 +#define SH_MD_DQRP_MMR_XPERR_ARM_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YCERR1" */ +/* correctable dir ecc group 1 error register */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_YCERR1 0x0000000100053800 +#define SH_MD_DQRP_MMR_YCERR1_MASK 0x0000007fffffffff +#define SH_MD_DQRP_MMR_YCERR1_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_YCERR1_GRP1 */ +/* Description: ecc group 1 bits */ +#define SH_MD_DQRP_MMR_YCERR1_GRP1_SHFT 0 +#define SH_MD_DQRP_MMR_YCERR1_GRP1_MASK 0x0000000fffffffff + +/* SH_MD_DQRP_MMR_YCERR1_VAL */ +/* Description: correctable ecc error in group 1 bits */ +#define SH_MD_DQRP_MMR_YCERR1_VAL_SHFT 36 +#define SH_MD_DQRP_MMR_YCERR1_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQRP_MMR_YCERR1_MORE */ +/* Description: more than one correctable ecc error in group 1 */ +#define SH_MD_DQRP_MMR_YCERR1_MORE_SHFT 37 +#define SH_MD_DQRP_MMR_YCERR1_MORE_MASK 0x0000002000000000 + +/* SH_MD_DQRP_MMR_YCERR1_ARM */ +/* Description: writing 1 arms uncorrectable ecc error capture */ +#define SH_MD_DQRP_MMR_YCERR1_ARM_SHFT 38 +#define SH_MD_DQRP_MMR_YCERR1_ARM_MASK 0x0000004000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YCERR2" */ +/* correctable dir ecc group 2 error register */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_YCERR2 0x0000000100053810 +#define SH_MD_DQRP_MMR_YCERR2_MASK 0x0000003fffffffff +#define SH_MD_DQRP_MMR_YCERR2_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_YCERR2_GRP2 */ +/* Description: ecc group 2 bits */ +#define SH_MD_DQRP_MMR_YCERR2_GRP2_SHFT 0 +#define SH_MD_DQRP_MMR_YCERR2_GRP2_MASK 0x0000000fffffffff + +/* SH_MD_DQRP_MMR_YCERR2_VAL */ +/* Description: correctable ecc error in group 2 bits */ +#define SH_MD_DQRP_MMR_YCERR2_VAL_SHFT 36 +#define SH_MD_DQRP_MMR_YCERR2_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQRP_MMR_YCERR2_MORE */ +/* Description: more than one correctable ecc error in group 2 */ +#define SH_MD_DQRP_MMR_YCERR2_MORE_SHFT 37 +#define SH_MD_DQRP_MMR_YCERR2_MORE_MASK 0x0000002000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YUERR1" */ +/* uncorrectable dir ecc group 1 error register */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_YUERR1 0x0000000100053820 +#define SH_MD_DQRP_MMR_YUERR1_MASK 0x0000007fffffffff +#define SH_MD_DQRP_MMR_YUERR1_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_YUERR1_GRP1 */ +/* Description: ecc group 1 bits */ +#define SH_MD_DQRP_MMR_YUERR1_GRP1_SHFT 0 +#define SH_MD_DQRP_MMR_YUERR1_GRP1_MASK 0x0000000fffffffff + +/* SH_MD_DQRP_MMR_YUERR1_VAL */ +/* Description: uncorrectable ecc error in group 1 bits */ +#define SH_MD_DQRP_MMR_YUERR1_VAL_SHFT 36 +#define SH_MD_DQRP_MMR_YUERR1_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQRP_MMR_YUERR1_MORE */ +/* Description: more than one uncorrectable ecc error in group 1 */ +#define SH_MD_DQRP_MMR_YUERR1_MORE_SHFT 37 +#define SH_MD_DQRP_MMR_YUERR1_MORE_MASK 0x0000002000000000 + +/* SH_MD_DQRP_MMR_YUERR1_ARM */ +/* Description: writing 1 arms uncorrectable ecc error capture */ +#define SH_MD_DQRP_MMR_YUERR1_ARM_SHFT 38 +#define SH_MD_DQRP_MMR_YUERR1_ARM_MASK 0x0000004000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YUERR2" */ +/* uncorrectable dir ecc group 2 error register */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_YUERR2 0x0000000100053830 +#define SH_MD_DQRP_MMR_YUERR2_MASK 0x0000003fffffffff +#define SH_MD_DQRP_MMR_YUERR2_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_YUERR2_GRP2 */ +/* Description: ecc group 2 bits */ +#define SH_MD_DQRP_MMR_YUERR2_GRP2_SHFT 0 +#define SH_MD_DQRP_MMR_YUERR2_GRP2_MASK 0x0000000fffffffff + +/* SH_MD_DQRP_MMR_YUERR2_VAL */ +/* Description: uncorrectable ecc error in group 2 bits */ +#define SH_MD_DQRP_MMR_YUERR2_VAL_SHFT 36 +#define SH_MD_DQRP_MMR_YUERR2_VAL_MASK 0x0000001000000000 + +/* SH_MD_DQRP_MMR_YUERR2_MORE */ +/* Description: more than one uncorrectable ecc error in group 2 */ +#define SH_MD_DQRP_MMR_YUERR2_MORE_SHFT 37 +#define SH_MD_DQRP_MMR_YUERR2_MORE_MASK 0x0000002000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YPERR" */ +/* protocol error register */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_YPERR 0x0000000100053840 +#define SH_MD_DQRP_MMR_YPERR_MASK 0x7fffffffffffffff +#define SH_MD_DQRP_MMR_YPERR_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_YPERR_DIR */ +/* Description: directory entry */ +#define SH_MD_DQRP_MMR_YPERR_DIR_SHFT 0 +#define SH_MD_DQRP_MMR_YPERR_DIR_MASK 0x0000000003ffffff + +/* SH_MD_DQRP_MMR_YPERR_CMD */ +/* Description: incoming command */ +#define SH_MD_DQRP_MMR_YPERR_CMD_SHFT 26 +#define SH_MD_DQRP_MMR_YPERR_CMD_MASK 0x00000003fc000000 + +/* SH_MD_DQRP_MMR_YPERR_SRC */ +/* Description: source node of dir operation */ +#define SH_MD_DQRP_MMR_YPERR_SRC_SHFT 34 +#define SH_MD_DQRP_MMR_YPERR_SRC_MASK 0x0000fffc00000000 + +/* SH_MD_DQRP_MMR_YPERR_PRIGE */ +/* Description: priority was greater-equal */ +#define SH_MD_DQRP_MMR_YPERR_PRIGE_SHFT 48 +#define SH_MD_DQRP_MMR_YPERR_PRIGE_MASK 0x0001000000000000 + +/* SH_MD_DQRP_MMR_YPERR_PRIV */ +/* Description: access privilege bit */ +#define SH_MD_DQRP_MMR_YPERR_PRIV_SHFT 49 +#define SH_MD_DQRP_MMR_YPERR_PRIV_MASK 0x0002000000000000 + +/* SH_MD_DQRP_MMR_YPERR_COR */ +/* Description: correctable ecc error */ +#define SH_MD_DQRP_MMR_YPERR_COR_SHFT 50 +#define SH_MD_DQRP_MMR_YPERR_COR_MASK 0x0004000000000000 + +/* SH_MD_DQRP_MMR_YPERR_UNC */ +/* Description: uncorrectable ecc error */ +#define SH_MD_DQRP_MMR_YPERR_UNC_SHFT 51 +#define SH_MD_DQRP_MMR_YPERR_UNC_MASK 0x0008000000000000 + +/* SH_MD_DQRP_MMR_YPERR_MYBIT */ +/* Description: ptreq,timeq,timlast,timspec,onlyme,anytim,ptrii,src */ +#define SH_MD_DQRP_MMR_YPERR_MYBIT_SHFT 52 +#define SH_MD_DQRP_MMR_YPERR_MYBIT_MASK 0x0ff0000000000000 + +/* SH_MD_DQRP_MMR_YPERR_VAL */ +/* Description: protocol error info valid */ +#define SH_MD_DQRP_MMR_YPERR_VAL_SHFT 60 +#define SH_MD_DQRP_MMR_YPERR_VAL_MASK 0x1000000000000000 + +/* SH_MD_DQRP_MMR_YPERR_MORE */ +/* Description: more than one protocol error */ +#define SH_MD_DQRP_MMR_YPERR_MORE_SHFT 61 +#define SH_MD_DQRP_MMR_YPERR_MORE_MASK 0x2000000000000000 + +/* SH_MD_DQRP_MMR_YPERR_ARM */ +/* Description: writing 1 arms error capture */ +#define SH_MD_DQRP_MMR_YPERR_ARM_SHFT 62 +#define SH_MD_DQRP_MMR_YPERR_ARM_MASK 0x4000000000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_CMDTRIG" */ +/* cmd triggers */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_CMDTRIG 0x0000000100054000 +#define SH_MD_DQRP_MMR_DIR_CMDTRIG_MASK 0x00000000ffffffff +#define SH_MD_DQRP_MMR_DIR_CMDTRIG_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_CMDTRIG_CMD0 */ +/* Description: command trigger 0 */ +#define SH_MD_DQRP_MMR_DIR_CMDTRIG_CMD0_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_CMDTRIG_CMD0_MASK 0x00000000000000ff + +/* SH_MD_DQRP_MMR_DIR_CMDTRIG_CMD1 */ +/* Description: command trigger 1 */ +#define SH_MD_DQRP_MMR_DIR_CMDTRIG_CMD1_SHFT 8 +#define SH_MD_DQRP_MMR_DIR_CMDTRIG_CMD1_MASK 0x000000000000ff00 + +/* SH_MD_DQRP_MMR_DIR_CMDTRIG_CMD2 */ +/* Description: command trigger 2 */ +#define SH_MD_DQRP_MMR_DIR_CMDTRIG_CMD2_SHFT 16 +#define SH_MD_DQRP_MMR_DIR_CMDTRIG_CMD2_MASK 0x0000000000ff0000 + +/* SH_MD_DQRP_MMR_DIR_CMDTRIG_CMD3 */ +/* Description: command trigger 3 */ +#define SH_MD_DQRP_MMR_DIR_CMDTRIG_CMD3_SHFT 24 +#define SH_MD_DQRP_MMR_DIR_CMDTRIG_CMD3_MASK 0x00000000ff000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_TBLTRIG" */ +/* dir table trigger */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_TBLTRIG 0x0000000100054010 +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_MASK 0x000003ffffffffff +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_TBLTRIG_SRC */ +/* Description: source of request */ +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_SRC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_SRC_MASK 0x0000000000003fff + +/* SH_MD_DQRP_MMR_DIR_TBLTRIG_CMD */ +/* Description: incoming request */ +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_CMD_SHFT 14 +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_CMD_MASK 0x00000000003fc000 + +/* SH_MD_DQRP_MMR_DIR_TBLTRIG_ACC */ +/* Description: uncorrectable error, privilege bit */ +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_ACC_SHFT 22 +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_ACC_MASK 0x0000000000c00000 + +/* SH_MD_DQRP_MMR_DIR_TBLTRIG_PRIGE */ +/* Description: priority greater-equal */ +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_PRIGE_SHFT 24 +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_PRIGE_MASK 0x0000000001000000 + +/* SH_MD_DQRP_MMR_DIR_TBLTRIG_DIRST */ +/* Description: shrd,sxro,sub-state */ +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_DIRST_SHFT 25 +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_DIRST_MASK 0x00000003fe000000 + +/* SH_MD_DQRP_MMR_DIR_TBLTRIG_MYBIT */ +/* Description: ptreq,timeq,timlast,timspec,onlyme,anytim,ptrii,src */ +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_MYBIT_SHFT 34 +#define SH_MD_DQRP_MMR_DIR_TBLTRIG_MYBIT_MASK 0x000003fc00000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_TBLMASK" */ +/* dir table trigger mask */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_DIR_TBLMASK 0x0000000100054020 +#define SH_MD_DQRP_MMR_DIR_TBLMASK_MASK 0x000003ffffffffff +#define SH_MD_DQRP_MMR_DIR_TBLMASK_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_DIR_TBLMASK_SRC */ +/* Description: source of request */ +#define SH_MD_DQRP_MMR_DIR_TBLMASK_SRC_SHFT 0 +#define SH_MD_DQRP_MMR_DIR_TBLMASK_SRC_MASK 0x0000000000003fff + +/* SH_MD_DQRP_MMR_DIR_TBLMASK_CMD */ +/* Description: incoming request */ +#define SH_MD_DQRP_MMR_DIR_TBLMASK_CMD_SHFT 14 +#define SH_MD_DQRP_MMR_DIR_TBLMASK_CMD_MASK 0x00000000003fc000 + +/* SH_MD_DQRP_MMR_DIR_TBLMASK_ACC */ +/* Description: uncorrectable error, privilege bit */ +#define SH_MD_DQRP_MMR_DIR_TBLMASK_ACC_SHFT 22 +#define SH_MD_DQRP_MMR_DIR_TBLMASK_ACC_MASK 0x0000000000c00000 + +/* SH_MD_DQRP_MMR_DIR_TBLMASK_PRIGE */ +/* Description: priority greater-equal */ +#define SH_MD_DQRP_MMR_DIR_TBLMASK_PRIGE_SHFT 24 +#define SH_MD_DQRP_MMR_DIR_TBLMASK_PRIGE_MASK 0x0000000001000000 + +/* SH_MD_DQRP_MMR_DIR_TBLMASK_DIRST */ +/* Description: shrd,sxro,sub-state */ +#define SH_MD_DQRP_MMR_DIR_TBLMASK_DIRST_SHFT 25 +#define SH_MD_DQRP_MMR_DIR_TBLMASK_DIRST_MASK 0x00000003fe000000 + +/* SH_MD_DQRP_MMR_DIR_TBLMASK_MYBIT */ +/* Description: ptreq,timeq,timlast,timspec,onlyme,anytim,ptrii,src */ +#define SH_MD_DQRP_MMR_DIR_TBLMASK_MYBIT_SHFT 34 +#define SH_MD_DQRP_MMR_DIR_TBLMASK_MYBIT_MASK 0x000003fc00000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_XBIST_H 0x0000000100058000 +#define SH_MD_DQRP_MMR_XBIST_H_MASK 0x00000700ffffffff +#define SH_MD_DQRP_MMR_XBIST_H_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_XBIST_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRP_MMR_XBIST_H_PAT_SHFT 0 +#define SH_MD_DQRP_MMR_XBIST_H_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQRP_MMR_XBIST_H_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQRP_MMR_XBIST_H_INV_SHFT 40 +#define SH_MD_DQRP_MMR_XBIST_H_INV_MASK 0x0000010000000000 + +/* SH_MD_DQRP_MMR_XBIST_H_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQRP_MMR_XBIST_H_ROT_SHFT 41 +#define SH_MD_DQRP_MMR_XBIST_H_ROT_MASK 0x0000020000000000 + +/* SH_MD_DQRP_MMR_XBIST_H_ARM */ +/* Description: writing 1 arms data miscompare capture */ +#define SH_MD_DQRP_MMR_XBIST_H_ARM_SHFT 42 +#define SH_MD_DQRP_MMR_XBIST_H_ARM_MASK 0x0000040000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_XBIST_L 0x0000000100058010 +#define SH_MD_DQRP_MMR_XBIST_L_MASK 0x00000300ffffffff +#define SH_MD_DQRP_MMR_XBIST_L_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_XBIST_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRP_MMR_XBIST_L_PAT_SHFT 0 +#define SH_MD_DQRP_MMR_XBIST_L_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQRP_MMR_XBIST_L_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQRP_MMR_XBIST_L_INV_SHFT 40 +#define SH_MD_DQRP_MMR_XBIST_L_INV_MASK 0x0000010000000000 + +/* SH_MD_DQRP_MMR_XBIST_L_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQRP_MMR_XBIST_L_ROT_SHFT 41 +#define SH_MD_DQRP_MMR_XBIST_L_ROT_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_XBIST_ERR_H 0x0000000100058020 +#define SH_MD_DQRP_MMR_XBIST_ERR_H_MASK 0x00000300ffffffff +#define SH_MD_DQRP_MMR_XBIST_ERR_H_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_XBIST_ERR_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRP_MMR_XBIST_ERR_H_PAT_SHFT 0 +#define SH_MD_DQRP_MMR_XBIST_ERR_H_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQRP_MMR_XBIST_ERR_H_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQRP_MMR_XBIST_ERR_H_VAL_SHFT 40 +#define SH_MD_DQRP_MMR_XBIST_ERR_H_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQRP_MMR_XBIST_ERR_H_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQRP_MMR_XBIST_ERR_H_MORE_SHFT 41 +#define SH_MD_DQRP_MMR_XBIST_ERR_H_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_XBIST_ERR_L 0x0000000100058030 +#define SH_MD_DQRP_MMR_XBIST_ERR_L_MASK 0x00000300ffffffff +#define SH_MD_DQRP_MMR_XBIST_ERR_L_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_XBIST_ERR_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRP_MMR_XBIST_ERR_L_PAT_SHFT 0 +#define SH_MD_DQRP_MMR_XBIST_ERR_L_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQRP_MMR_XBIST_ERR_L_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQRP_MMR_XBIST_ERR_L_VAL_SHFT 40 +#define SH_MD_DQRP_MMR_XBIST_ERR_L_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQRP_MMR_XBIST_ERR_L_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQRP_MMR_XBIST_ERR_L_MORE_SHFT 41 +#define SH_MD_DQRP_MMR_XBIST_ERR_L_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_YBIST_H 0x0000000100058800 +#define SH_MD_DQRP_MMR_YBIST_H_MASK 0x00000700ffffffff +#define SH_MD_DQRP_MMR_YBIST_H_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_YBIST_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRP_MMR_YBIST_H_PAT_SHFT 0 +#define SH_MD_DQRP_MMR_YBIST_H_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQRP_MMR_YBIST_H_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQRP_MMR_YBIST_H_INV_SHFT 40 +#define SH_MD_DQRP_MMR_YBIST_H_INV_MASK 0x0000010000000000 + +/* SH_MD_DQRP_MMR_YBIST_H_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQRP_MMR_YBIST_H_ROT_SHFT 41 +#define SH_MD_DQRP_MMR_YBIST_H_ROT_MASK 0x0000020000000000 + +/* SH_MD_DQRP_MMR_YBIST_H_ARM */ +/* Description: writing 1 arms data miscompare capture */ +#define SH_MD_DQRP_MMR_YBIST_H_ARM_SHFT 42 +#define SH_MD_DQRP_MMR_YBIST_H_ARM_MASK 0x0000040000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_YBIST_L 0x0000000100058810 +#define SH_MD_DQRP_MMR_YBIST_L_MASK 0x00000300ffffffff +#define SH_MD_DQRP_MMR_YBIST_L_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_YBIST_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRP_MMR_YBIST_L_PAT_SHFT 0 +#define SH_MD_DQRP_MMR_YBIST_L_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQRP_MMR_YBIST_L_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQRP_MMR_YBIST_L_INV_SHFT 40 +#define SH_MD_DQRP_MMR_YBIST_L_INV_MASK 0x0000010000000000 + +/* SH_MD_DQRP_MMR_YBIST_L_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQRP_MMR_YBIST_L_ROT_SHFT 41 +#define SH_MD_DQRP_MMR_YBIST_L_ROT_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_YBIST_ERR_H 0x0000000100058820 +#define SH_MD_DQRP_MMR_YBIST_ERR_H_MASK 0x00000300ffffffff +#define SH_MD_DQRP_MMR_YBIST_ERR_H_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_YBIST_ERR_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRP_MMR_YBIST_ERR_H_PAT_SHFT 0 +#define SH_MD_DQRP_MMR_YBIST_ERR_H_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQRP_MMR_YBIST_ERR_H_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQRP_MMR_YBIST_ERR_H_VAL_SHFT 40 +#define SH_MD_DQRP_MMR_YBIST_ERR_H_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQRP_MMR_YBIST_ERR_H_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQRP_MMR_YBIST_ERR_H_MORE_SHFT 41 +#define SH_MD_DQRP_MMR_YBIST_ERR_H_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRP_MMR_YBIST_ERR_L 0x0000000100058830 +#define SH_MD_DQRP_MMR_YBIST_ERR_L_MASK 0x00000300ffffffff +#define SH_MD_DQRP_MMR_YBIST_ERR_L_INIT 0x0000000000000000 + +/* SH_MD_DQRP_MMR_YBIST_ERR_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRP_MMR_YBIST_ERR_L_PAT_SHFT 0 +#define SH_MD_DQRP_MMR_YBIST_ERR_L_PAT_MASK 0x00000000ffffffff + +/* SH_MD_DQRP_MMR_YBIST_ERR_L_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQRP_MMR_YBIST_ERR_L_VAL_SHFT 40 +#define SH_MD_DQRP_MMR_YBIST_ERR_L_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQRP_MMR_YBIST_ERR_L_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQRP_MMR_YBIST_ERR_L_MORE_SHFT 41 +#define SH_MD_DQRP_MMR_YBIST_ERR_L_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_XBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRS_MMR_XBIST_H 0x0000000100068000 +#define SH_MD_DQRS_MMR_XBIST_H_MASK 0x000007ffffffffff +#define SH_MD_DQRS_MMR_XBIST_H_INIT 0x0000000000000000 + +/* SH_MD_DQRS_MMR_XBIST_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRS_MMR_XBIST_H_PAT_SHFT 0 +#define SH_MD_DQRS_MMR_XBIST_H_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQRS_MMR_XBIST_H_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQRS_MMR_XBIST_H_INV_SHFT 40 +#define SH_MD_DQRS_MMR_XBIST_H_INV_MASK 0x0000010000000000 + +/* SH_MD_DQRS_MMR_XBIST_H_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQRS_MMR_XBIST_H_ROT_SHFT 41 +#define SH_MD_DQRS_MMR_XBIST_H_ROT_MASK 0x0000020000000000 + +/* SH_MD_DQRS_MMR_XBIST_H_ARM */ +/* Description: writing 1 arms data miscompare capture */ +#define SH_MD_DQRS_MMR_XBIST_H_ARM_SHFT 42 +#define SH_MD_DQRS_MMR_XBIST_H_ARM_MASK 0x0000040000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_XBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRS_MMR_XBIST_L 0x0000000100068010 +#define SH_MD_DQRS_MMR_XBIST_L_MASK 0x000003ffffffffff +#define SH_MD_DQRS_MMR_XBIST_L_INIT 0x0000000000000000 + +/* SH_MD_DQRS_MMR_XBIST_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRS_MMR_XBIST_L_PAT_SHFT 0 +#define SH_MD_DQRS_MMR_XBIST_L_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQRS_MMR_XBIST_L_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQRS_MMR_XBIST_L_INV_SHFT 40 +#define SH_MD_DQRS_MMR_XBIST_L_INV_MASK 0x0000010000000000 + +/* SH_MD_DQRS_MMR_XBIST_L_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQRS_MMR_XBIST_L_ROT_SHFT 41 +#define SH_MD_DQRS_MMR_XBIST_L_ROT_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_XBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRS_MMR_XBIST_ERR_H 0x0000000100068020 +#define SH_MD_DQRS_MMR_XBIST_ERR_H_MASK 0x000003ffffffffff +#define SH_MD_DQRS_MMR_XBIST_ERR_H_INIT 0x0000000000000000 + +/* SH_MD_DQRS_MMR_XBIST_ERR_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRS_MMR_XBIST_ERR_H_PAT_SHFT 0 +#define SH_MD_DQRS_MMR_XBIST_ERR_H_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQRS_MMR_XBIST_ERR_H_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQRS_MMR_XBIST_ERR_H_VAL_SHFT 40 +#define SH_MD_DQRS_MMR_XBIST_ERR_H_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQRS_MMR_XBIST_ERR_H_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQRS_MMR_XBIST_ERR_H_MORE_SHFT 41 +#define SH_MD_DQRS_MMR_XBIST_ERR_H_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_XBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRS_MMR_XBIST_ERR_L 0x0000000100068030 +#define SH_MD_DQRS_MMR_XBIST_ERR_L_MASK 0x000003ffffffffff +#define SH_MD_DQRS_MMR_XBIST_ERR_L_INIT 0x0000000000000000 + +/* SH_MD_DQRS_MMR_XBIST_ERR_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRS_MMR_XBIST_ERR_L_PAT_SHFT 0 +#define SH_MD_DQRS_MMR_XBIST_ERR_L_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQRS_MMR_XBIST_ERR_L_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQRS_MMR_XBIST_ERR_L_VAL_SHFT 40 +#define SH_MD_DQRS_MMR_XBIST_ERR_L_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQRS_MMR_XBIST_ERR_L_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQRS_MMR_XBIST_ERR_L_MORE_SHFT 41 +#define SH_MD_DQRS_MMR_XBIST_ERR_L_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_YBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRS_MMR_YBIST_H 0x0000000100068800 +#define SH_MD_DQRS_MMR_YBIST_H_MASK 0x000007ffffffffff +#define SH_MD_DQRS_MMR_YBIST_H_INIT 0x0000000000000000 + +/* SH_MD_DQRS_MMR_YBIST_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRS_MMR_YBIST_H_PAT_SHFT 0 +#define SH_MD_DQRS_MMR_YBIST_H_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQRS_MMR_YBIST_H_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQRS_MMR_YBIST_H_INV_SHFT 40 +#define SH_MD_DQRS_MMR_YBIST_H_INV_MASK 0x0000010000000000 + +/* SH_MD_DQRS_MMR_YBIST_H_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQRS_MMR_YBIST_H_ROT_SHFT 41 +#define SH_MD_DQRS_MMR_YBIST_H_ROT_MASK 0x0000020000000000 + +/* SH_MD_DQRS_MMR_YBIST_H_ARM */ +/* Description: writing 1 arms data miscompare capture */ +#define SH_MD_DQRS_MMR_YBIST_H_ARM_SHFT 42 +#define SH_MD_DQRS_MMR_YBIST_H_ARM_MASK 0x0000040000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_YBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRS_MMR_YBIST_L 0x0000000100068810 +#define SH_MD_DQRS_MMR_YBIST_L_MASK 0x000003ffffffffff +#define SH_MD_DQRS_MMR_YBIST_L_INIT 0x0000000000000000 + +/* SH_MD_DQRS_MMR_YBIST_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRS_MMR_YBIST_L_PAT_SHFT 0 +#define SH_MD_DQRS_MMR_YBIST_L_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQRS_MMR_YBIST_L_INV */ +/* Description: invert data pattern in next cycle */ +#define SH_MD_DQRS_MMR_YBIST_L_INV_SHFT 40 +#define SH_MD_DQRS_MMR_YBIST_L_INV_MASK 0x0000010000000000 + +/* SH_MD_DQRS_MMR_YBIST_L_ROT */ +/* Description: rotate left data pattern in next cycle */ +#define SH_MD_DQRS_MMR_YBIST_L_ROT_SHFT 41 +#define SH_MD_DQRS_MMR_YBIST_L_ROT_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_YBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRS_MMR_YBIST_ERR_H 0x0000000100068820 +#define SH_MD_DQRS_MMR_YBIST_ERR_H_MASK 0x000003ffffffffff +#define SH_MD_DQRS_MMR_YBIST_ERR_H_INIT 0x0000000000000000 + +/* SH_MD_DQRS_MMR_YBIST_ERR_H_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRS_MMR_YBIST_ERR_H_PAT_SHFT 0 +#define SH_MD_DQRS_MMR_YBIST_ERR_H_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQRS_MMR_YBIST_ERR_H_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQRS_MMR_YBIST_ERR_H_VAL_SHFT 40 +#define SH_MD_DQRS_MMR_YBIST_ERR_H_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQRS_MMR_YBIST_ERR_H_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQRS_MMR_YBIST_ERR_H_MORE_SHFT 41 +#define SH_MD_DQRS_MMR_YBIST_ERR_H_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_YBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#define SH_MD_DQRS_MMR_YBIST_ERR_L 0x0000000100068830 +#define SH_MD_DQRS_MMR_YBIST_ERR_L_MASK 0x000003ffffffffff +#define SH_MD_DQRS_MMR_YBIST_ERR_L_INIT 0x0000000000000000 + +/* SH_MD_DQRS_MMR_YBIST_ERR_L_PAT */ +/* Description: data pattern */ +#define SH_MD_DQRS_MMR_YBIST_ERR_L_PAT_SHFT 0 +#define SH_MD_DQRS_MMR_YBIST_ERR_L_PAT_MASK 0x000000ffffffffff + +/* SH_MD_DQRS_MMR_YBIST_ERR_L_VAL */ +/* Description: bist data miscompare */ +#define SH_MD_DQRS_MMR_YBIST_ERR_L_VAL_SHFT 40 +#define SH_MD_DQRS_MMR_YBIST_ERR_L_VAL_MASK 0x0000010000000000 + +/* SH_MD_DQRS_MMR_YBIST_ERR_L_MORE */ +/* Description: more than one bist data miscompare */ +#define SH_MD_DQRS_MMR_YBIST_ERR_L_MORE_SHFT 41 +#define SH_MD_DQRS_MMR_YBIST_ERR_L_MORE_MASK 0x0000020000000000 + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_JNR_DEBUG" */ +/* joiner/fct debug configuration */ +/* ==================================================================== */ + +#define SH_MD_DQRS_MMR_JNR_DEBUG 0x0000000100069000 +#define SH_MD_DQRS_MMR_JNR_DEBUG_MASK 0x0000000000000003 +#define SH_MD_DQRS_MMR_JNR_DEBUG_INIT 0x0000000000000000 + +/* SH_MD_DQRS_MMR_JNR_DEBUG_PX */ +/* Description: select 0=pi 1=xn side */ +#define SH_MD_DQRS_MMR_JNR_DEBUG_PX_SHFT 0 +#define SH_MD_DQRS_MMR_JNR_DEBUG_PX_MASK 0x0000000000000001 + +/* SH_MD_DQRS_MMR_JNR_DEBUG_RW */ +/* Description: select 0=read 1=write side */ +#define SH_MD_DQRS_MMR_JNR_DEBUG_RW_SHFT 1 +#define SH_MD_DQRS_MMR_JNR_DEBUG_RW_MASK 0x0000000000000002 + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_YAMOPW_ERR" */ +/* amo/partial rmw ecc error register */ +/* ==================================================================== */ + +#define SH_MD_DQRS_MMR_YAMOPW_ERR 0x000000010006a000 +#define SH_MD_DQRS_MMR_YAMOPW_ERR_MASK 0x0000000103ff03ff +#define SH_MD_DQRS_MMR_YAMOPW_ERR_INIT 0x0000000000000000 + +/* SH_MD_DQRS_MMR_YAMOPW_ERR_SSYN */ +/* Description: store data syndrome */ +#define SH_MD_DQRS_MMR_YAMOPW_ERR_SSYN_SHFT 0 +#define SH_MD_DQRS_MMR_YAMOPW_ERR_SSYN_MASK 0x00000000000000ff + +/* SH_MD_DQRS_MMR_YAMOPW_ERR_SCOR */ +/* Description: correctable ecc errror on store data */ +#define SH_MD_DQRS_MMR_YAMOPW_ERR_SCOR_SHFT 8 +#define SH_MD_DQRS_MMR_YAMOPW_ERR_SCOR_MASK 0x0000000000000100 + +/* SH_MD_DQRS_MMR_YAMOPW_ERR_SUNC */ +/* Description: uncorrectable ecc errror on store data */ +#define SH_MD_DQRS_MMR_YAMOPW_ERR_SUNC_SHFT 9 +#define SH_MD_DQRS_MMR_YAMOPW_ERR_SUNC_MASK 0x0000000000000200 + +/* SH_MD_DQRS_MMR_YAMOPW_ERR_RSYN */ +/* Description: memory read data syndrome */ +#define SH_MD_DQRS_MMR_YAMOPW_ERR_RSYN_SHFT 16 +#define SH_MD_DQRS_MMR_YAMOPW_ERR_RSYN_MASK 0x0000000000ff0000 + +/* SH_MD_DQRS_MMR_YAMOPW_ERR_RCOR */ +/* Description: correctable ecc errror on read data */ +#define SH_MD_DQRS_MMR_YAMOPW_ERR_RCOR_SHFT 24 +#define SH_MD_DQRS_MMR_YAMOPW_ERR_RCOR_MASK 0x0000000001000000 + +/* SH_MD_DQRS_MMR_YAMOPW_ERR_RUNC */ +/* Description: uncorrectable ecc errror on read data */ +#define SH_MD_DQRS_MMR_YAMOPW_ERR_RUNC_SHFT 25 +#define SH_MD_DQRS_MMR_YAMOPW_ERR_RUNC_MASK 0x0000000002000000 + +/* SH_MD_DQRS_MMR_YAMOPW_ERR_ARM */ +/* Description: writing 1 arms ecc error capture */ +#define SH_MD_DQRS_MMR_YAMOPW_ERR_ARM_SHFT 32 +#define SH_MD_DQRS_MMR_YAMOPW_ERR_ARM_MASK 0x0000000100000000 + + +#endif /* _ASM_IA64_SN_SN2_SHUB_MMR_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn2/shub_mmr_t.h lia64-2.4/include/asm-ia64/sn/sn2/shub_mmr_t.h --- linux-2.4.18/include/asm-ia64/sn/sn2/shub_mmr_t.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn2/shub_mmr_t.h Fri Jul 19 23:20:15 2002 @@ -0,0 +1,27385 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + + + +#ifndef _ASM_IA64_SN_SN2_SHUB_MMR_T_H +#define _ASM_IA64_SN_SN2_SHUB_MMR_T_H + +#include + +/* ==================================================================== */ +/* Register "SH_FSB_BINIT_CONTROL" */ +/* FSB BINIT# Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_fsb_binit_control_u { + mmr_t sh_fsb_binit_control_regval; + struct { + mmr_t binit : 1; + mmr_t reserved_0 : 63; + } sh_fsb_binit_control_s; +} sh_fsb_binit_control_u_t; +#else +typedef union sh_fsb_binit_control_u { + mmr_t sh_fsb_binit_control_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t binit : 1; + } sh_fsb_binit_control_s; +} sh_fsb_binit_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_FSB_RESET_CONTROL" */ +/* FSB Reset Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_fsb_reset_control_u { + mmr_t sh_fsb_reset_control_regval; + struct { + mmr_t reset : 1; + mmr_t reserved_0 : 63; + } sh_fsb_reset_control_s; +} sh_fsb_reset_control_u_t; +#else +typedef union sh_fsb_reset_control_u { + mmr_t sh_fsb_reset_control_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t reset : 1; + } sh_fsb_reset_control_s; +} sh_fsb_reset_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_FSB_SYSTEM_AGENT_CONFIG" */ +/* FSB System Agent Configuration */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_fsb_system_agent_config_u { + mmr_t sh_fsb_system_agent_config_regval; + struct { + mmr_t rcnt_scnt_en : 1; + mmr_t reserved_0 : 2; + mmr_t berr_assert_en : 1; + mmr_t berr_sampling_en : 1; + mmr_t binit_assert_en : 1; + mmr_t bnr_throttling_en : 1; + mmr_t short_hang_en : 1; + mmr_t inta_rsp_data : 8; + mmr_t io_trans_rsp : 1; + mmr_t xtpr_trans_rsp : 1; + mmr_t inta_trans_rsp : 1; + mmr_t reserved_1 : 4; + mmr_t tdot : 1; + mmr_t serialize_fsb_en : 1; + mmr_t reserved_2 : 7; + mmr_t binit_event_enables : 14; + mmr_t reserved_3 : 18; + } sh_fsb_system_agent_config_s; +} sh_fsb_system_agent_config_u_t; +#else +typedef union sh_fsb_system_agent_config_u { + mmr_t sh_fsb_system_agent_config_regval; + struct { + mmr_t reserved_3 : 18; + mmr_t binit_event_enables : 14; + mmr_t reserved_2 : 7; + mmr_t serialize_fsb_en : 1; + mmr_t tdot : 1; + mmr_t reserved_1 : 4; + mmr_t inta_trans_rsp : 1; + mmr_t xtpr_trans_rsp : 1; + mmr_t io_trans_rsp : 1; + mmr_t inta_rsp_data : 8; + mmr_t short_hang_en : 1; + mmr_t bnr_throttling_en : 1; + mmr_t binit_assert_en : 1; + mmr_t berr_sampling_en : 1; + mmr_t berr_assert_en : 1; + mmr_t reserved_0 : 2; + mmr_t rcnt_scnt_en : 1; + } sh_fsb_system_agent_config_s; +} sh_fsb_system_agent_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_FSB_VGA_REMAP" */ +/* FSB VGA Address Space Remap */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_fsb_vga_remap_u { + mmr_t sh_fsb_vga_remap_regval; + struct { + mmr_t reserved_0 : 17; + mmr_t offset : 19; + mmr_t asid : 2; + mmr_t nid : 11; + mmr_t reserved_1 : 13; + mmr_t vga_remapping_enabled : 1; + mmr_t reserved_2 : 1; + } sh_fsb_vga_remap_s; +} sh_fsb_vga_remap_u_t; +#else +typedef union sh_fsb_vga_remap_u { + mmr_t sh_fsb_vga_remap_regval; + struct { + mmr_t reserved_2 : 1; + mmr_t vga_remapping_enabled : 1; + mmr_t reserved_1 : 13; + mmr_t nid : 11; + mmr_t asid : 2; + mmr_t offset : 19; + mmr_t reserved_0 : 17; + } sh_fsb_vga_remap_s; +} sh_fsb_vga_remap_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_FSB_RESET_STATUS" */ +/* FSB Reset Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_fsb_reset_status_u { + mmr_t sh_fsb_reset_status_regval; + struct { + mmr_t reset_in_progress : 1; + mmr_t reserved_0 : 63; + } sh_fsb_reset_status_s; +} sh_fsb_reset_status_u_t; +#else +typedef union sh_fsb_reset_status_u { + mmr_t sh_fsb_reset_status_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t reset_in_progress : 1; + } sh_fsb_reset_status_s; +} sh_fsb_reset_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_FSB_SYMMETRIC_AGENT_STATUS" */ +/* FSB Symmetric Agent Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_fsb_symmetric_agent_status_u { + mmr_t sh_fsb_symmetric_agent_status_regval; + struct { + mmr_t cpu_0_active : 1; + mmr_t cpu_1_active : 1; + mmr_t cpus_ready : 1; + mmr_t reserved_0 : 61; + } sh_fsb_symmetric_agent_status_s; +} sh_fsb_symmetric_agent_status_u_t; +#else +typedef union sh_fsb_symmetric_agent_status_u { + mmr_t sh_fsb_symmetric_agent_status_regval; + struct { + mmr_t reserved_0 : 61; + mmr_t cpus_ready : 1; + mmr_t cpu_1_active : 1; + mmr_t cpu_0_active : 1; + } sh_fsb_symmetric_agent_status_s; +} sh_fsb_symmetric_agent_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_CREDIT_COUNT_0" */ +/* Graphics-write Credit Count for CPU 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_credit_count_0_u { + mmr_t sh_gfx_credit_count_0_regval; + struct { + mmr_t count : 20; + mmr_t reserved_0 : 43; + mmr_t reset_gfx_state : 1; + } sh_gfx_credit_count_0_s; +} sh_gfx_credit_count_0_u_t; +#else +typedef union sh_gfx_credit_count_0_u { + mmr_t sh_gfx_credit_count_0_regval; + struct { + mmr_t reset_gfx_state : 1; + mmr_t reserved_0 : 43; + mmr_t count : 20; + } sh_gfx_credit_count_0_s; +} sh_gfx_credit_count_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_CREDIT_COUNT_1" */ +/* Graphics-write Credit Count for CPU 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_credit_count_1_u { + mmr_t sh_gfx_credit_count_1_regval; + struct { + mmr_t count : 20; + mmr_t reserved_0 : 43; + mmr_t reset_gfx_state : 1; + } sh_gfx_credit_count_1_s; +} sh_gfx_credit_count_1_u_t; +#else +typedef union sh_gfx_credit_count_1_u { + mmr_t sh_gfx_credit_count_1_regval; + struct { + mmr_t reset_gfx_state : 1; + mmr_t reserved_0 : 43; + mmr_t count : 20; + } sh_gfx_credit_count_1_s; +} sh_gfx_credit_count_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_MODE_CNTRL_0" */ +/* Graphics credit mode amd message ordering for CPU 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_mode_cntrl_0_u { + mmr_t sh_gfx_mode_cntrl_0_regval; + struct { + mmr_t dword_credits : 1; + mmr_t mixed_mode_credits : 1; + mmr_t relaxed_ordering : 1; + mmr_t reserved_0 : 61; + } sh_gfx_mode_cntrl_0_s; +} sh_gfx_mode_cntrl_0_u_t; +#else +typedef union sh_gfx_mode_cntrl_0_u { + mmr_t sh_gfx_mode_cntrl_0_regval; + struct { + mmr_t reserved_0 : 61; + mmr_t relaxed_ordering : 1; + mmr_t mixed_mode_credits : 1; + mmr_t dword_credits : 1; + } sh_gfx_mode_cntrl_0_s; +} sh_gfx_mode_cntrl_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_MODE_CNTRL_1" */ +/* Graphics credit mode amd message ordering for CPU 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_mode_cntrl_1_u { + mmr_t sh_gfx_mode_cntrl_1_regval; + struct { + mmr_t dword_credits : 1; + mmr_t mixed_mode_credits : 1; + mmr_t relaxed_ordering : 1; + mmr_t reserved_0 : 61; + } sh_gfx_mode_cntrl_1_s; +} sh_gfx_mode_cntrl_1_u_t; +#else +typedef union sh_gfx_mode_cntrl_1_u { + mmr_t sh_gfx_mode_cntrl_1_regval; + struct { + mmr_t reserved_0 : 61; + mmr_t relaxed_ordering : 1; + mmr_t mixed_mode_credits : 1; + mmr_t dword_credits : 1; + } sh_gfx_mode_cntrl_1_s; +} sh_gfx_mode_cntrl_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_SKID_CREDIT_COUNT_0" */ +/* Graphics-write Skid Credit Count for CPU 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_skid_credit_count_0_u { + mmr_t sh_gfx_skid_credit_count_0_regval; + struct { + mmr_t skid : 20; + mmr_t reserved_0 : 44; + } sh_gfx_skid_credit_count_0_s; +} sh_gfx_skid_credit_count_0_u_t; +#else +typedef union sh_gfx_skid_credit_count_0_u { + mmr_t sh_gfx_skid_credit_count_0_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t skid : 20; + } sh_gfx_skid_credit_count_0_s; +} sh_gfx_skid_credit_count_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_SKID_CREDIT_COUNT_1" */ +/* Graphics-write Skid Credit Count for CPU 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_skid_credit_count_1_u { + mmr_t sh_gfx_skid_credit_count_1_regval; + struct { + mmr_t skid : 20; + mmr_t reserved_0 : 44; + } sh_gfx_skid_credit_count_1_s; +} sh_gfx_skid_credit_count_1_u_t; +#else +typedef union sh_gfx_skid_credit_count_1_u { + mmr_t sh_gfx_skid_credit_count_1_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t skid : 20; + } sh_gfx_skid_credit_count_1_s; +} sh_gfx_skid_credit_count_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_STALL_LIMIT_0" */ +/* Graphics-write Stall Limit for CPU 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_stall_limit_0_u { + mmr_t sh_gfx_stall_limit_0_regval; + struct { + mmr_t limit : 26; + mmr_t reserved_0 : 38; + } sh_gfx_stall_limit_0_s; +} sh_gfx_stall_limit_0_u_t; +#else +typedef union sh_gfx_stall_limit_0_u { + mmr_t sh_gfx_stall_limit_0_regval; + struct { + mmr_t reserved_0 : 38; + mmr_t limit : 26; + } sh_gfx_stall_limit_0_s; +} sh_gfx_stall_limit_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_STALL_LIMIT_1" */ +/* Graphics-write Stall Limit for CPU 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_stall_limit_1_u { + mmr_t sh_gfx_stall_limit_1_regval; + struct { + mmr_t limit : 26; + mmr_t reserved_0 : 38; + } sh_gfx_stall_limit_1_s; +} sh_gfx_stall_limit_1_u_t; +#else +typedef union sh_gfx_stall_limit_1_u { + mmr_t sh_gfx_stall_limit_1_regval; + struct { + mmr_t reserved_0 : 38; + mmr_t limit : 26; + } sh_gfx_stall_limit_1_s; +} sh_gfx_stall_limit_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_STALL_TIMER_0" */ +/* Graphics-write Stall Timer for CPU 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_stall_timer_0_u { + mmr_t sh_gfx_stall_timer_0_regval; + struct { + mmr_t timer_value : 26; + mmr_t reserved_0 : 38; + } sh_gfx_stall_timer_0_s; +} sh_gfx_stall_timer_0_u_t; +#else +typedef union sh_gfx_stall_timer_0_u { + mmr_t sh_gfx_stall_timer_0_regval; + struct { + mmr_t reserved_0 : 38; + mmr_t timer_value : 26; + } sh_gfx_stall_timer_0_s; +} sh_gfx_stall_timer_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_STALL_TIMER_1" */ +/* Graphics-write Stall Timer for CPU 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_stall_timer_1_u { + mmr_t sh_gfx_stall_timer_1_regval; + struct { + mmr_t timer_value : 26; + mmr_t reserved_0 : 38; + } sh_gfx_stall_timer_1_s; +} sh_gfx_stall_timer_1_u_t; +#else +typedef union sh_gfx_stall_timer_1_u { + mmr_t sh_gfx_stall_timer_1_regval; + struct { + mmr_t reserved_0 : 38; + mmr_t timer_value : 26; + } sh_gfx_stall_timer_1_s; +} sh_gfx_stall_timer_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_WINDOW_0" */ +/* Graphics-write Window for CPU 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_window_0_u { + mmr_t sh_gfx_window_0_regval; + struct { + mmr_t reserved_0 : 24; + mmr_t base_addr : 12; + mmr_t reserved_1 : 27; + mmr_t gfx_window_en : 1; + } sh_gfx_window_0_s; +} sh_gfx_window_0_u_t; +#else +typedef union sh_gfx_window_0_u { + mmr_t sh_gfx_window_0_regval; + struct { + mmr_t gfx_window_en : 1; + mmr_t reserved_1 : 27; + mmr_t base_addr : 12; + mmr_t reserved_0 : 24; + } sh_gfx_window_0_s; +} sh_gfx_window_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_WINDOW_1" */ +/* Graphics-write Window for CPU 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_window_1_u { + mmr_t sh_gfx_window_1_regval; + struct { + mmr_t reserved_0 : 24; + mmr_t base_addr : 12; + mmr_t reserved_1 : 27; + mmr_t gfx_window_en : 1; + } sh_gfx_window_1_s; +} sh_gfx_window_1_u_t; +#else +typedef union sh_gfx_window_1_u { + mmr_t sh_gfx_window_1_regval; + struct { + mmr_t gfx_window_en : 1; + mmr_t reserved_1 : 27; + mmr_t base_addr : 12; + mmr_t reserved_0 : 24; + } sh_gfx_window_1_s; +} sh_gfx_window_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_INTERRUPT_TIMER_LIMIT_0" */ +/* Graphics-write Interrupt Limit for CPU 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_interrupt_timer_limit_0_u { + mmr_t sh_gfx_interrupt_timer_limit_0_regval; + struct { + mmr_t interrupt_timer_limit : 8; + mmr_t reserved_0 : 56; + } sh_gfx_interrupt_timer_limit_0_s; +} sh_gfx_interrupt_timer_limit_0_u_t; +#else +typedef union sh_gfx_interrupt_timer_limit_0_u { + mmr_t sh_gfx_interrupt_timer_limit_0_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t interrupt_timer_limit : 8; + } sh_gfx_interrupt_timer_limit_0_s; +} sh_gfx_interrupt_timer_limit_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_INTERRUPT_TIMER_LIMIT_1" */ +/* Graphics-write Interrupt Limit for CPU 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_interrupt_timer_limit_1_u { + mmr_t sh_gfx_interrupt_timer_limit_1_regval; + struct { + mmr_t interrupt_timer_limit : 8; + mmr_t reserved_0 : 56; + } sh_gfx_interrupt_timer_limit_1_s; +} sh_gfx_interrupt_timer_limit_1_u_t; +#else +typedef union sh_gfx_interrupt_timer_limit_1_u { + mmr_t sh_gfx_interrupt_timer_limit_1_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t interrupt_timer_limit : 8; + } sh_gfx_interrupt_timer_limit_1_s; +} sh_gfx_interrupt_timer_limit_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_WRITE_STATUS_0" */ +/* Graphics Write Status for CPU 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_write_status_0_u { + mmr_t sh_gfx_write_status_0_regval; + struct { + mmr_t busy : 1; + mmr_t reserved_0 : 62; + mmr_t re_enable_gfx_stall : 1; + } sh_gfx_write_status_0_s; +} sh_gfx_write_status_0_u_t; +#else +typedef union sh_gfx_write_status_0_u { + mmr_t sh_gfx_write_status_0_regval; + struct { + mmr_t re_enable_gfx_stall : 1; + mmr_t reserved_0 : 62; + mmr_t busy : 1; + } sh_gfx_write_status_0_s; +} sh_gfx_write_status_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GFX_WRITE_STATUS_1" */ +/* Graphics Write Status for CPU 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gfx_write_status_1_u { + mmr_t sh_gfx_write_status_1_regval; + struct { + mmr_t busy : 1; + mmr_t reserved_0 : 62; + mmr_t re_enable_gfx_stall : 1; + } sh_gfx_write_status_1_s; +} sh_gfx_write_status_1_u_t; +#else +typedef union sh_gfx_write_status_1_u { + mmr_t sh_gfx_write_status_1_regval; + struct { + mmr_t re_enable_gfx_stall : 1; + mmr_t reserved_0 : 62; + mmr_t busy : 1; + } sh_gfx_write_status_1_s; +} sh_gfx_write_status_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_II_INT0" */ +/* SHub II Interrupt 0 Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ii_int0_u { + mmr_t sh_ii_int0_regval; + struct { + mmr_t idx : 8; + mmr_t send : 1; + mmr_t reserved_0 : 55; + } sh_ii_int0_s; +} sh_ii_int0_u_t; +#else +typedef union sh_ii_int0_u { + mmr_t sh_ii_int0_regval; + struct { + mmr_t reserved_0 : 55; + mmr_t send : 1; + mmr_t idx : 8; + } sh_ii_int0_s; +} sh_ii_int0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_II_INT0_CONFIG" */ +/* SHub II Interrupt 0 Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ii_int0_config_u { + mmr_t sh_ii_int0_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 14; + } sh_ii_int0_config_s; +} sh_ii_int0_config_u_t; +#else +typedef union sh_ii_int0_config_u { + mmr_t sh_ii_int0_config_regval; + struct { + mmr_t reserved_1 : 14; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_ii_int0_config_s; +} sh_ii_int0_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_II_INT0_ENABLE" */ +/* SHub II Interrupt 0 Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ii_int0_enable_u { + mmr_t sh_ii_int0_enable_regval; + struct { + mmr_t ii_enable : 1; + mmr_t reserved_0 : 63; + } sh_ii_int0_enable_s; +} sh_ii_int0_enable_u_t; +#else +typedef union sh_ii_int0_enable_u { + mmr_t sh_ii_int0_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t ii_enable : 1; + } sh_ii_int0_enable_s; +} sh_ii_int0_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_II_INT1" */ +/* SHub II Interrupt 1 Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ii_int1_u { + mmr_t sh_ii_int1_regval; + struct { + mmr_t idx : 8; + mmr_t send : 1; + mmr_t reserved_0 : 55; + } sh_ii_int1_s; +} sh_ii_int1_u_t; +#else +typedef union sh_ii_int1_u { + mmr_t sh_ii_int1_regval; + struct { + mmr_t reserved_0 : 55; + mmr_t send : 1; + mmr_t idx : 8; + } sh_ii_int1_s; +} sh_ii_int1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_II_INT1_CONFIG" */ +/* SHub II Interrupt 1 Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ii_int1_config_u { + mmr_t sh_ii_int1_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 14; + } sh_ii_int1_config_s; +} sh_ii_int1_config_u_t; +#else +typedef union sh_ii_int1_config_u { + mmr_t sh_ii_int1_config_regval; + struct { + mmr_t reserved_1 : 14; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_ii_int1_config_s; +} sh_ii_int1_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_II_INT1_ENABLE" */ +/* SHub II Interrupt 1 Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ii_int1_enable_u { + mmr_t sh_ii_int1_enable_regval; + struct { + mmr_t ii_enable : 1; + mmr_t reserved_0 : 63; + } sh_ii_int1_enable_s; +} sh_ii_int1_enable_u_t; +#else +typedef union sh_ii_int1_enable_u { + mmr_t sh_ii_int1_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t ii_enable : 1; + } sh_ii_int1_enable_s; +} sh_ii_int1_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_INT_NODE_ID_CONFIG" */ +/* SHub Interrupt Node ID Configuration */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_int_node_id_config_u { + mmr_t sh_int_node_id_config_regval; + struct { + mmr_t node_id : 11; + mmr_t id_sel : 1; + mmr_t reserved_0 : 52; + } sh_int_node_id_config_s; +} sh_int_node_id_config_u_t; +#else +typedef union sh_int_node_id_config_u { + mmr_t sh_int_node_id_config_regval; + struct { + mmr_t reserved_0 : 52; + mmr_t id_sel : 1; + mmr_t node_id : 11; + } sh_int_node_id_config_s; +} sh_int_node_id_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_IPI_INT" */ +/* SHub Inter-Processor Interrupt Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ipi_int_u { + mmr_t sh_ipi_int_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 3; + mmr_t send : 1; + } sh_ipi_int_s; +} sh_ipi_int_u_t; +#else +typedef union sh_ipi_int_u { + mmr_t sh_ipi_int_regval; + struct { + mmr_t send : 1; + mmr_t reserved_2 : 3; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_ipi_int_s; +} sh_ipi_int_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_IPI_INT_ENABLE" */ +/* SHub Inter-Processor Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ipi_int_enable_u { + mmr_t sh_ipi_int_enable_regval; + struct { + mmr_t pio_enable : 1; + mmr_t reserved_0 : 63; + } sh_ipi_int_enable_s; +} sh_ipi_int_enable_u_t; +#else +typedef union sh_ipi_int_enable_u { + mmr_t sh_ipi_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t pio_enable : 1; + } sh_ipi_int_enable_s; +} sh_ipi_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT0_CONFIG" */ +/* SHub Local Interrupt 0 Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_local_int0_config_u { + mmr_t sh_local_int0_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_local_int0_config_s; +} sh_local_int0_config_u_t; +#else +typedef union sh_local_int0_config_u { + mmr_t sh_local_int0_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_local_int0_config_s; +} sh_local_int0_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT0_ENABLE" */ +/* SHub Local Interrupt 0 Enable */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_local_int0_enable_u { + mmr_t sh_local_int0_enable_regval; + struct { + mmr_t pi_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t ii_hw_int : 1; + mmr_t pi_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t xn_uce_int : 1; + mmr_t reserved_0 : 1; + mmr_t system_shutdown_int : 1; + mmr_t uart_int : 1; + mmr_t l1_nmi_int : 1; + mmr_t stop_clock : 1; + mmr_t reserved_1 : 48; + } sh_local_int0_enable_s; +} sh_local_int0_enable_u_t; +#else +typedef union sh_local_int0_enable_u { + mmr_t sh_local_int0_enable_regval; + struct { + mmr_t reserved_1 : 48; + mmr_t stop_clock : 1; + mmr_t l1_nmi_int : 1; + mmr_t uart_int : 1; + mmr_t system_shutdown_int : 1; + mmr_t reserved_0 : 1; + mmr_t xn_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t pi_ce_int : 1; + mmr_t ii_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t pi_hw_int : 1; + } sh_local_int0_enable_s; +} sh_local_int0_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT1_CONFIG" */ +/* SHub Local Interrupt 1 Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_local_int1_config_u { + mmr_t sh_local_int1_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_local_int1_config_s; +} sh_local_int1_config_u_t; +#else +typedef union sh_local_int1_config_u { + mmr_t sh_local_int1_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_local_int1_config_s; +} sh_local_int1_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT1_ENABLE" */ +/* SHub Local Interrupt 1 Enable */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_local_int1_enable_u { + mmr_t sh_local_int1_enable_regval; + struct { + mmr_t pi_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t ii_hw_int : 1; + mmr_t pi_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t xn_uce_int : 1; + mmr_t reserved_0 : 1; + mmr_t system_shutdown_int : 1; + mmr_t uart_int : 1; + mmr_t l1_nmi_int : 1; + mmr_t stop_clock : 1; + mmr_t reserved_1 : 48; + } sh_local_int1_enable_s; +} sh_local_int1_enable_u_t; +#else +typedef union sh_local_int1_enable_u { + mmr_t sh_local_int1_enable_regval; + struct { + mmr_t reserved_1 : 48; + mmr_t stop_clock : 1; + mmr_t l1_nmi_int : 1; + mmr_t uart_int : 1; + mmr_t system_shutdown_int : 1; + mmr_t reserved_0 : 1; + mmr_t xn_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t pi_ce_int : 1; + mmr_t ii_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t pi_hw_int : 1; + } sh_local_int1_enable_s; +} sh_local_int1_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT2_CONFIG" */ +/* SHub Local Interrupt 2 Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_local_int2_config_u { + mmr_t sh_local_int2_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_local_int2_config_s; +} sh_local_int2_config_u_t; +#else +typedef union sh_local_int2_config_u { + mmr_t sh_local_int2_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_local_int2_config_s; +} sh_local_int2_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT2_ENABLE" */ +/* SHub Local Interrupt 2 Enable */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_local_int2_enable_u { + mmr_t sh_local_int2_enable_regval; + struct { + mmr_t pi_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t ii_hw_int : 1; + mmr_t pi_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t xn_uce_int : 1; + mmr_t reserved_0 : 1; + mmr_t system_shutdown_int : 1; + mmr_t uart_int : 1; + mmr_t l1_nmi_int : 1; + mmr_t stop_clock : 1; + mmr_t reserved_1 : 48; + } sh_local_int2_enable_s; +} sh_local_int2_enable_u_t; +#else +typedef union sh_local_int2_enable_u { + mmr_t sh_local_int2_enable_regval; + struct { + mmr_t reserved_1 : 48; + mmr_t stop_clock : 1; + mmr_t l1_nmi_int : 1; + mmr_t uart_int : 1; + mmr_t system_shutdown_int : 1; + mmr_t reserved_0 : 1; + mmr_t xn_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t pi_ce_int : 1; + mmr_t ii_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t pi_hw_int : 1; + } sh_local_int2_enable_s; +} sh_local_int2_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT3_CONFIG" */ +/* SHub Local Interrupt 3 Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_local_int3_config_u { + mmr_t sh_local_int3_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_local_int3_config_s; +} sh_local_int3_config_u_t; +#else +typedef union sh_local_int3_config_u { + mmr_t sh_local_int3_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_local_int3_config_s; +} sh_local_int3_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT3_ENABLE" */ +/* SHub Local Interrupt 3 Enable */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_local_int3_enable_u { + mmr_t sh_local_int3_enable_regval; + struct { + mmr_t pi_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t ii_hw_int : 1; + mmr_t pi_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t xn_uce_int : 1; + mmr_t reserved_0 : 1; + mmr_t system_shutdown_int : 1; + mmr_t uart_int : 1; + mmr_t l1_nmi_int : 1; + mmr_t stop_clock : 1; + mmr_t reserved_1 : 48; + } sh_local_int3_enable_s; +} sh_local_int3_enable_u_t; +#else +typedef union sh_local_int3_enable_u { + mmr_t sh_local_int3_enable_regval; + struct { + mmr_t reserved_1 : 48; + mmr_t stop_clock : 1; + mmr_t l1_nmi_int : 1; + mmr_t uart_int : 1; + mmr_t system_shutdown_int : 1; + mmr_t reserved_0 : 1; + mmr_t xn_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t pi_ce_int : 1; + mmr_t ii_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t pi_hw_int : 1; + } sh_local_int3_enable_s; +} sh_local_int3_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT4_CONFIG" */ +/* SHub Local Interrupt 4 Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_local_int4_config_u { + mmr_t sh_local_int4_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_local_int4_config_s; +} sh_local_int4_config_u_t; +#else +typedef union sh_local_int4_config_u { + mmr_t sh_local_int4_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_local_int4_config_s; +} sh_local_int4_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT4_ENABLE" */ +/* SHub Local Interrupt 4 Enable */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_local_int4_enable_u { + mmr_t sh_local_int4_enable_regval; + struct { + mmr_t pi_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t ii_hw_int : 1; + mmr_t pi_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t xn_uce_int : 1; + mmr_t reserved_0 : 1; + mmr_t system_shutdown_int : 1; + mmr_t uart_int : 1; + mmr_t l1_nmi_int : 1; + mmr_t stop_clock : 1; + mmr_t reserved_1 : 48; + } sh_local_int4_enable_s; +} sh_local_int4_enable_u_t; +#else +typedef union sh_local_int4_enable_u { + mmr_t sh_local_int4_enable_regval; + struct { + mmr_t reserved_1 : 48; + mmr_t stop_clock : 1; + mmr_t l1_nmi_int : 1; + mmr_t uart_int : 1; + mmr_t system_shutdown_int : 1; + mmr_t reserved_0 : 1; + mmr_t xn_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t pi_ce_int : 1; + mmr_t ii_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t pi_hw_int : 1; + } sh_local_int4_enable_s; +} sh_local_int4_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT5_CONFIG" */ +/* SHub Local Interrupt 5 Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_local_int5_config_u { + mmr_t sh_local_int5_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_local_int5_config_s; +} sh_local_int5_config_u_t; +#else +typedef union sh_local_int5_config_u { + mmr_t sh_local_int5_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_local_int5_config_s; +} sh_local_int5_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LOCAL_INT5_ENABLE" */ +/* SHub Local Interrupt 5 Enable */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_local_int5_enable_u { + mmr_t sh_local_int5_enable_regval; + struct { + mmr_t pi_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t ii_hw_int : 1; + mmr_t pi_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t xn_uce_int : 1; + mmr_t reserved_0 : 1; + mmr_t system_shutdown_int : 1; + mmr_t uart_int : 1; + mmr_t l1_nmi_int : 1; + mmr_t stop_clock : 1; + mmr_t reserved_1 : 48; + } sh_local_int5_enable_s; +} sh_local_int5_enable_u_t; +#else +typedef union sh_local_int5_enable_u { + mmr_t sh_local_int5_enable_regval; + struct { + mmr_t reserved_1 : 48; + mmr_t stop_clock : 1; + mmr_t l1_nmi_int : 1; + mmr_t uart_int : 1; + mmr_t system_shutdown_int : 1; + mmr_t reserved_0 : 1; + mmr_t xn_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t pi_ce_int : 1; + mmr_t ii_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t pi_hw_int : 1; + } sh_local_int5_enable_s; +} sh_local_int5_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC0_ERR_INT_CONFIG" */ +/* SHub Processor 0 Error Interrupt Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc0_err_int_config_u { + mmr_t sh_proc0_err_int_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_proc0_err_int_config_s; +} sh_proc0_err_int_config_u_t; +#else +typedef union sh_proc0_err_int_config_u { + mmr_t sh_proc0_err_int_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_proc0_err_int_config_s; +} sh_proc0_err_int_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC1_ERR_INT_CONFIG" */ +/* SHub Processor 1 Error Interrupt Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc1_err_int_config_u { + mmr_t sh_proc1_err_int_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_proc1_err_int_config_s; +} sh_proc1_err_int_config_u_t; +#else +typedef union sh_proc1_err_int_config_u { + mmr_t sh_proc1_err_int_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_proc1_err_int_config_s; +} sh_proc1_err_int_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC2_ERR_INT_CONFIG" */ +/* SHub Processor 2 Error Interrupt Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc2_err_int_config_u { + mmr_t sh_proc2_err_int_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_proc2_err_int_config_s; +} sh_proc2_err_int_config_u_t; +#else +typedef union sh_proc2_err_int_config_u { + mmr_t sh_proc2_err_int_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_proc2_err_int_config_s; +} sh_proc2_err_int_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC3_ERR_INT_CONFIG" */ +/* SHub Processor 3 Error Interrupt Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc3_err_int_config_u { + mmr_t sh_proc3_err_int_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_proc3_err_int_config_s; +} sh_proc3_err_int_config_u_t; +#else +typedef union sh_proc3_err_int_config_u { + mmr_t sh_proc3_err_int_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_proc3_err_int_config_s; +} sh_proc3_err_int_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC0_ADV_INT_CONFIG" */ +/* SHub Processor 0 Advisory Interrupt Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc0_adv_int_config_u { + mmr_t sh_proc0_adv_int_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_proc0_adv_int_config_s; +} sh_proc0_adv_int_config_u_t; +#else +typedef union sh_proc0_adv_int_config_u { + mmr_t sh_proc0_adv_int_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_proc0_adv_int_config_s; +} sh_proc0_adv_int_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC1_ADV_INT_CONFIG" */ +/* SHub Processor 1 Advisory Interrupt Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc1_adv_int_config_u { + mmr_t sh_proc1_adv_int_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_proc1_adv_int_config_s; +} sh_proc1_adv_int_config_u_t; +#else +typedef union sh_proc1_adv_int_config_u { + mmr_t sh_proc1_adv_int_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_proc1_adv_int_config_s; +} sh_proc1_adv_int_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC2_ADV_INT_CONFIG" */ +/* SHub Processor 2 Advisory Interrupt Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc2_adv_int_config_u { + mmr_t sh_proc2_adv_int_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_proc2_adv_int_config_s; +} sh_proc2_adv_int_config_u_t; +#else +typedef union sh_proc2_adv_int_config_u { + mmr_t sh_proc2_adv_int_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_proc2_adv_int_config_s; +} sh_proc2_adv_int_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC3_ADV_INT_CONFIG" */ +/* SHub Processor 3 Advisory Interrupt Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc3_adv_int_config_u { + mmr_t sh_proc3_adv_int_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_proc3_adv_int_config_s; +} sh_proc3_adv_int_config_u_t; +#else +typedef union sh_proc3_adv_int_config_u { + mmr_t sh_proc3_adv_int_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_proc3_adv_int_config_s; +} sh_proc3_adv_int_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC0_ERR_INT_ENABLE" */ +/* SHub Processor 0 Error Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc0_err_int_enable_u { + mmr_t sh_proc0_err_int_enable_regval; + struct { + mmr_t proc0_err_enable : 1; + mmr_t reserved_0 : 63; + } sh_proc0_err_int_enable_s; +} sh_proc0_err_int_enable_u_t; +#else +typedef union sh_proc0_err_int_enable_u { + mmr_t sh_proc0_err_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t proc0_err_enable : 1; + } sh_proc0_err_int_enable_s; +} sh_proc0_err_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC1_ERR_INT_ENABLE" */ +/* SHub Processor 1 Error Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc1_err_int_enable_u { + mmr_t sh_proc1_err_int_enable_regval; + struct { + mmr_t proc1_err_enable : 1; + mmr_t reserved_0 : 63; + } sh_proc1_err_int_enable_s; +} sh_proc1_err_int_enable_u_t; +#else +typedef union sh_proc1_err_int_enable_u { + mmr_t sh_proc1_err_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t proc1_err_enable : 1; + } sh_proc1_err_int_enable_s; +} sh_proc1_err_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC2_ERR_INT_ENABLE" */ +/* SHub Processor 2 Error Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc2_err_int_enable_u { + mmr_t sh_proc2_err_int_enable_regval; + struct { + mmr_t proc2_err_enable : 1; + mmr_t reserved_0 : 63; + } sh_proc2_err_int_enable_s; +} sh_proc2_err_int_enable_u_t; +#else +typedef union sh_proc2_err_int_enable_u { + mmr_t sh_proc2_err_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t proc2_err_enable : 1; + } sh_proc2_err_int_enable_s; +} sh_proc2_err_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC3_ERR_INT_ENABLE" */ +/* SHub Processor 3 Error Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc3_err_int_enable_u { + mmr_t sh_proc3_err_int_enable_regval; + struct { + mmr_t proc3_err_enable : 1; + mmr_t reserved_0 : 63; + } sh_proc3_err_int_enable_s; +} sh_proc3_err_int_enable_u_t; +#else +typedef union sh_proc3_err_int_enable_u { + mmr_t sh_proc3_err_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t proc3_err_enable : 1; + } sh_proc3_err_int_enable_s; +} sh_proc3_err_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC0_ADV_INT_ENABLE" */ +/* SHub Processor 0 Advisory Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc0_adv_int_enable_u { + mmr_t sh_proc0_adv_int_enable_regval; + struct { + mmr_t proc0_adv_enable : 1; + mmr_t reserved_0 : 63; + } sh_proc0_adv_int_enable_s; +} sh_proc0_adv_int_enable_u_t; +#else +typedef union sh_proc0_adv_int_enable_u { + mmr_t sh_proc0_adv_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t proc0_adv_enable : 1; + } sh_proc0_adv_int_enable_s; +} sh_proc0_adv_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC1_ADV_INT_ENABLE" */ +/* SHub Processor 1 Advisory Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc1_adv_int_enable_u { + mmr_t sh_proc1_adv_int_enable_regval; + struct { + mmr_t proc1_adv_enable : 1; + mmr_t reserved_0 : 63; + } sh_proc1_adv_int_enable_s; +} sh_proc1_adv_int_enable_u_t; +#else +typedef union sh_proc1_adv_int_enable_u { + mmr_t sh_proc1_adv_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t proc1_adv_enable : 1; + } sh_proc1_adv_int_enable_s; +} sh_proc1_adv_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC2_ADV_INT_ENABLE" */ +/* SHub Processor 2 Advisory Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc2_adv_int_enable_u { + mmr_t sh_proc2_adv_int_enable_regval; + struct { + mmr_t proc2_adv_enable : 1; + mmr_t reserved_0 : 63; + } sh_proc2_adv_int_enable_s; +} sh_proc2_adv_int_enable_u_t; +#else +typedef union sh_proc2_adv_int_enable_u { + mmr_t sh_proc2_adv_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t proc2_adv_enable : 1; + } sh_proc2_adv_int_enable_s; +} sh_proc2_adv_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC3_ADV_INT_ENABLE" */ +/* SHub Processor 3 Advisory Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc3_adv_int_enable_u { + mmr_t sh_proc3_adv_int_enable_regval; + struct { + mmr_t proc3_adv_enable : 1; + mmr_t reserved_0 : 63; + } sh_proc3_adv_int_enable_s; +} sh_proc3_adv_int_enable_u_t; +#else +typedef union sh_proc3_adv_int_enable_u { + mmr_t sh_proc3_adv_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t proc3_adv_enable : 1; + } sh_proc3_adv_int_enable_s; +} sh_proc3_adv_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROFILE_INT_CONFIG" */ +/* SHub Profile Interrupt Configuration Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_profile_int_config_u { + mmr_t sh_profile_int_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_profile_int_config_s; +} sh_profile_int_config_u_t; +#else +typedef union sh_profile_int_config_u { + mmr_t sh_profile_int_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_profile_int_config_s; +} sh_profile_int_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROFILE_INT_ENABLE" */ +/* SHub Profile Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_profile_int_enable_u { + mmr_t sh_profile_int_enable_regval; + struct { + mmr_t profile_enable : 1; + mmr_t reserved_0 : 63; + } sh_profile_int_enable_s; +} sh_profile_int_enable_u_t; +#else +typedef union sh_profile_int_enable_u { + mmr_t sh_profile_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t profile_enable : 1; + } sh_profile_int_enable_s; +} sh_profile_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_RTC0_INT_CONFIG" */ +/* SHub RTC 0 Interrupt Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_rtc0_int_config_u { + mmr_t sh_rtc0_int_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_rtc0_int_config_s; +} sh_rtc0_int_config_u_t; +#else +typedef union sh_rtc0_int_config_u { + mmr_t sh_rtc0_int_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_rtc0_int_config_s; +} sh_rtc0_int_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_RTC0_INT_ENABLE" */ +/* SHub RTC 0 Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_rtc0_int_enable_u { + mmr_t sh_rtc0_int_enable_regval; + struct { + mmr_t rtc0_enable : 1; + mmr_t reserved_0 : 63; + } sh_rtc0_int_enable_s; +} sh_rtc0_int_enable_u_t; +#else +typedef union sh_rtc0_int_enable_u { + mmr_t sh_rtc0_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t rtc0_enable : 1; + } sh_rtc0_int_enable_s; +} sh_rtc0_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_RTC1_INT_CONFIG" */ +/* SHub RTC 1 Interrupt Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_rtc1_int_config_u { + mmr_t sh_rtc1_int_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_rtc1_int_config_s; +} sh_rtc1_int_config_u_t; +#else +typedef union sh_rtc1_int_config_u { + mmr_t sh_rtc1_int_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_rtc1_int_config_s; +} sh_rtc1_int_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_RTC1_INT_ENABLE" */ +/* SHub RTC 1 Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_rtc1_int_enable_u { + mmr_t sh_rtc1_int_enable_regval; + struct { + mmr_t rtc1_enable : 1; + mmr_t reserved_0 : 63; + } sh_rtc1_int_enable_s; +} sh_rtc1_int_enable_u_t; +#else +typedef union sh_rtc1_int_enable_u { + mmr_t sh_rtc1_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t rtc1_enable : 1; + } sh_rtc1_int_enable_s; +} sh_rtc1_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_RTC2_INT_CONFIG" */ +/* SHub RTC 2 Interrupt Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_rtc2_int_config_u { + mmr_t sh_rtc2_int_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_rtc2_int_config_s; +} sh_rtc2_int_config_u_t; +#else +typedef union sh_rtc2_int_config_u { + mmr_t sh_rtc2_int_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_rtc2_int_config_s; +} sh_rtc2_int_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_RTC2_INT_ENABLE" */ +/* SHub RTC 2 Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_rtc2_int_enable_u { + mmr_t sh_rtc2_int_enable_regval; + struct { + mmr_t rtc2_enable : 1; + mmr_t reserved_0 : 63; + } sh_rtc2_int_enable_s; +} sh_rtc2_int_enable_u_t; +#else +typedef union sh_rtc2_int_enable_u { + mmr_t sh_rtc2_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t rtc2_enable : 1; + } sh_rtc2_int_enable_s; +} sh_rtc2_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_RTC3_INT_CONFIG" */ +/* SHub RTC 3 Interrupt Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_rtc3_int_config_u { + mmr_t sh_rtc3_int_config_regval; + struct { + mmr_t type : 3; + mmr_t agt : 1; + mmr_t pid : 16; + mmr_t reserved_0 : 1; + mmr_t base : 29; + mmr_t reserved_1 : 2; + mmr_t idx : 8; + mmr_t reserved_2 : 4; + } sh_rtc3_int_config_s; +} sh_rtc3_int_config_u_t; +#else +typedef union sh_rtc3_int_config_u { + mmr_t sh_rtc3_int_config_regval; + struct { + mmr_t reserved_2 : 4; + mmr_t idx : 8; + mmr_t reserved_1 : 2; + mmr_t base : 29; + mmr_t reserved_0 : 1; + mmr_t pid : 16; + mmr_t agt : 1; + mmr_t type : 3; + } sh_rtc3_int_config_s; +} sh_rtc3_int_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_RTC3_INT_ENABLE" */ +/* SHub RTC 3 Interrupt Enable Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_rtc3_int_enable_u { + mmr_t sh_rtc3_int_enable_regval; + struct { + mmr_t rtc3_enable : 1; + mmr_t reserved_0 : 63; + } sh_rtc3_int_enable_s; +} sh_rtc3_int_enable_u_t; +#else +typedef union sh_rtc3_int_enable_u { + mmr_t sh_rtc3_int_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t rtc3_enable : 1; + } sh_rtc3_int_enable_s; +} sh_rtc3_int_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_EVENT_OCCURRED" */ +/* SHub Interrupt Event Occurred */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_event_occurred_u { + mmr_t sh_event_occurred_regval; + struct { + mmr_t pi_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t ii_hw_int : 1; + mmr_t pi_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t xn_uce_int : 1; + mmr_t proc0_adv_int : 1; + mmr_t proc1_adv_int : 1; + mmr_t proc2_adv_int : 1; + mmr_t proc3_adv_int : 1; + mmr_t proc0_err_int : 1; + mmr_t proc1_err_int : 1; + mmr_t proc2_err_int : 1; + mmr_t proc3_err_int : 1; + mmr_t system_shutdown_int : 1; + mmr_t uart_int : 1; + mmr_t l1_nmi_int : 1; + mmr_t stop_clock : 1; + mmr_t rtc0_int : 1; + mmr_t rtc1_int : 1; + mmr_t rtc2_int : 1; + mmr_t rtc3_int : 1; + mmr_t profile_int : 1; + mmr_t ipi_int : 1; + mmr_t ii_int0 : 1; + mmr_t ii_int1 : 1; + mmr_t reserved_0 : 33; + } sh_event_occurred_s; +} sh_event_occurred_u_t; +#else +typedef union sh_event_occurred_u { + mmr_t sh_event_occurred_regval; + struct { + mmr_t reserved_0 : 33; + mmr_t ii_int1 : 1; + mmr_t ii_int0 : 1; + mmr_t ipi_int : 1; + mmr_t profile_int : 1; + mmr_t rtc3_int : 1; + mmr_t rtc2_int : 1; + mmr_t rtc1_int : 1; + mmr_t rtc0_int : 1; + mmr_t stop_clock : 1; + mmr_t l1_nmi_int : 1; + mmr_t uart_int : 1; + mmr_t system_shutdown_int : 1; + mmr_t proc3_err_int : 1; + mmr_t proc2_err_int : 1; + mmr_t proc1_err_int : 1; + mmr_t proc0_err_int : 1; + mmr_t proc3_adv_int : 1; + mmr_t proc2_adv_int : 1; + mmr_t proc1_adv_int : 1; + mmr_t proc0_adv_int : 1; + mmr_t xn_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t pi_ce_int : 1; + mmr_t ii_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t pi_hw_int : 1; + } sh_event_occurred_s; +} sh_event_occurred_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_EVENT_OVERFLOW" */ +/* SHub Interrupt Event Occurred Overflow */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_event_overflow_u { + mmr_t sh_event_overflow_regval; + struct { + mmr_t pi_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t ii_hw_int : 1; + mmr_t pi_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t xn_uce_int : 1; + mmr_t proc0_adv_int : 1; + mmr_t proc1_adv_int : 1; + mmr_t proc2_adv_int : 1; + mmr_t proc3_adv_int : 1; + mmr_t proc0_err_int : 1; + mmr_t proc1_err_int : 1; + mmr_t proc2_err_int : 1; + mmr_t proc3_err_int : 1; + mmr_t system_shutdown_int : 1; + mmr_t uart_int : 1; + mmr_t l1_nmi_int : 1; + mmr_t stop_clock : 1; + mmr_t rtc0_int : 1; + mmr_t rtc1_int : 1; + mmr_t rtc2_int : 1; + mmr_t rtc3_int : 1; + mmr_t profile_int : 1; + mmr_t reserved_0 : 36; + } sh_event_overflow_s; +} sh_event_overflow_u_t; +#else +typedef union sh_event_overflow_u { + mmr_t sh_event_overflow_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t profile_int : 1; + mmr_t rtc3_int : 1; + mmr_t rtc2_int : 1; + mmr_t rtc1_int : 1; + mmr_t rtc0_int : 1; + mmr_t stop_clock : 1; + mmr_t l1_nmi_int : 1; + mmr_t uart_int : 1; + mmr_t system_shutdown_int : 1; + mmr_t proc3_err_int : 1; + mmr_t proc2_err_int : 1; + mmr_t proc1_err_int : 1; + mmr_t proc0_err_int : 1; + mmr_t proc3_adv_int : 1; + mmr_t proc2_adv_int : 1; + mmr_t proc1_adv_int : 1; + mmr_t proc0_adv_int : 1; + mmr_t xn_uce_int : 1; + mmr_t md_uce_int : 1; + mmr_t pi_uce_int : 1; + mmr_t xn_ce_int : 1; + mmr_t md_ce_int : 1; + mmr_t pi_ce_int : 1; + mmr_t ii_hw_int : 1; + mmr_t lb_hw_int : 1; + mmr_t xn_hw_int : 1; + mmr_t md_hw_int : 1; + mmr_t pi_hw_int : 1; + } sh_event_overflow_s; +} sh_event_overflow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_JUNK_BUS_TIME" */ +/* Junk Bus Timing */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_junk_bus_time_u { + mmr_t sh_junk_bus_time_regval; + struct { + mmr_t fprom_setup_hold : 8; + mmr_t fprom_enable : 8; + mmr_t uart_setup_hold : 8; + mmr_t uart_enable : 8; + mmr_t reserved_0 : 32; + } sh_junk_bus_time_s; +} sh_junk_bus_time_u_t; +#else +typedef union sh_junk_bus_time_u { + mmr_t sh_junk_bus_time_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t uart_enable : 8; + mmr_t uart_setup_hold : 8; + mmr_t fprom_enable : 8; + mmr_t fprom_setup_hold : 8; + } sh_junk_bus_time_s; +} sh_junk_bus_time_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_JUNK_LATCH_TIME" */ +/* Junk Bus Latch Timing */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_junk_latch_time_u { + mmr_t sh_junk_latch_time_regval; + struct { + mmr_t setup_hold : 3; + mmr_t reserved_0 : 61; + } sh_junk_latch_time_s; +} sh_junk_latch_time_u_t; +#else +typedef union sh_junk_latch_time_u { + mmr_t sh_junk_latch_time_regval; + struct { + mmr_t reserved_0 : 61; + mmr_t setup_hold : 3; + } sh_junk_latch_time_s; +} sh_junk_latch_time_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_JUNK_NACK_RESET" */ +/* Junk Bus Nack Counter Reset */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_junk_nack_reset_u { + mmr_t sh_junk_nack_reset_regval; + struct { + mmr_t pulse : 1; + mmr_t reserved_0 : 63; + } sh_junk_nack_reset_s; +} sh_junk_nack_reset_u_t; +#else +typedef union sh_junk_nack_reset_u { + mmr_t sh_junk_nack_reset_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t pulse : 1; + } sh_junk_nack_reset_s; +} sh_junk_nack_reset_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_JUNK_BUS_LED0" */ +/* Junk Bus LED0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_junk_bus_led0_u { + mmr_t sh_junk_bus_led0_regval; + struct { + mmr_t led0_data : 8; + mmr_t reserved_0 : 56; + } sh_junk_bus_led0_s; +} sh_junk_bus_led0_u_t; +#else +typedef union sh_junk_bus_led0_u { + mmr_t sh_junk_bus_led0_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t led0_data : 8; + } sh_junk_bus_led0_s; +} sh_junk_bus_led0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_JUNK_BUS_LED1" */ +/* Junk Bus LED1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_junk_bus_led1_u { + mmr_t sh_junk_bus_led1_regval; + struct { + mmr_t led1_data : 8; + mmr_t reserved_0 : 56; + } sh_junk_bus_led1_s; +} sh_junk_bus_led1_u_t; +#else +typedef union sh_junk_bus_led1_u { + mmr_t sh_junk_bus_led1_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t led1_data : 8; + } sh_junk_bus_led1_s; +} sh_junk_bus_led1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_JUNK_BUS_LED2" */ +/* Junk Bus LED2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_junk_bus_led2_u { + mmr_t sh_junk_bus_led2_regval; + struct { + mmr_t led2_data : 8; + mmr_t reserved_0 : 56; + } sh_junk_bus_led2_s; +} sh_junk_bus_led2_u_t; +#else +typedef union sh_junk_bus_led2_u { + mmr_t sh_junk_bus_led2_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t led2_data : 8; + } sh_junk_bus_led2_s; +} sh_junk_bus_led2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_JUNK_BUS_LED3" */ +/* Junk Bus LED3 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_junk_bus_led3_u { + mmr_t sh_junk_bus_led3_regval; + struct { + mmr_t led3_data : 8; + mmr_t reserved_0 : 56; + } sh_junk_bus_led3_s; +} sh_junk_bus_led3_u_t; +#else +typedef union sh_junk_bus_led3_u { + mmr_t sh_junk_bus_led3_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t led3_data : 8; + } sh_junk_bus_led3_s; +} sh_junk_bus_led3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_JUNK_ERROR_STATUS" */ +/* Junk Bus Error Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_junk_error_status_u { + mmr_t sh_junk_error_status_regval; + struct { + mmr_t address : 47; + mmr_t reserved_0 : 1; + mmr_t cmd : 8; + mmr_t mode : 1; + mmr_t status : 4; + mmr_t reserved_1 : 3; + } sh_junk_error_status_s; +} sh_junk_error_status_u_t; +#else +typedef union sh_junk_error_status_u { + mmr_t sh_junk_error_status_regval; + struct { + mmr_t reserved_1 : 3; + mmr_t status : 4; + mmr_t mode : 1; + mmr_t cmd : 8; + mmr_t reserved_0 : 1; + mmr_t address : 47; + } sh_junk_error_status_s; +} sh_junk_error_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_STAT" */ +/* This register describes the LLP status. */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_llp_stat_u { + mmr_t sh_ni0_llp_stat_regval; + struct { + mmr_t link_reset_state : 4; + mmr_t reserved_0 : 60; + } sh_ni0_llp_stat_s; +} sh_ni0_llp_stat_u_t; +#else +typedef union sh_ni0_llp_stat_u { + mmr_t sh_ni0_llp_stat_regval; + struct { + mmr_t reserved_0 : 60; + mmr_t link_reset_state : 4; + } sh_ni0_llp_stat_s; +} sh_ni0_llp_stat_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_RESET" */ +/* Writing issues a reset to the network interface */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_llp_reset_u { + mmr_t sh_ni0_llp_reset_regval; + struct { + mmr_t link : 1; + mmr_t warm : 1; + mmr_t reserved_0 : 62; + } sh_ni0_llp_reset_s; +} sh_ni0_llp_reset_u_t; +#else +typedef union sh_ni0_llp_reset_u { + mmr_t sh_ni0_llp_reset_regval; + struct { + mmr_t reserved_0 : 62; + mmr_t warm : 1; + mmr_t link : 1; + } sh_ni0_llp_reset_s; +} sh_ni0_llp_reset_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_RESET_EN" */ +/* Controls LLP warm reset propagation */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_llp_reset_en_u { + mmr_t sh_ni0_llp_reset_en_regval; + struct { + mmr_t ok : 1; + mmr_t reserved_0 : 63; + } sh_ni0_llp_reset_en_s; +} sh_ni0_llp_reset_en_u_t; +#else +typedef union sh_ni0_llp_reset_en_u { + mmr_t sh_ni0_llp_reset_en_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t ok : 1; + } sh_ni0_llp_reset_en_s; +} sh_ni0_llp_reset_en_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_CHAN_MODE" */ +/* Sets the signaling mode of LLP and channel */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_llp_chan_mode_u { + mmr_t sh_ni0_llp_chan_mode_regval; + struct { + mmr_t bitmode32 : 1; + mmr_t ac_encode : 1; + mmr_t enable_tuning : 1; + mmr_t enable_rmt_ft_upd : 1; + mmr_t enable_clkquad : 1; + mmr_t reserved_0 : 59; + } sh_ni0_llp_chan_mode_s; +} sh_ni0_llp_chan_mode_u_t; +#else +typedef union sh_ni0_llp_chan_mode_u { + mmr_t sh_ni0_llp_chan_mode_regval; + struct { + mmr_t reserved_0 : 59; + mmr_t enable_clkquad : 1; + mmr_t enable_rmt_ft_upd : 1; + mmr_t enable_tuning : 1; + mmr_t ac_encode : 1; + mmr_t bitmode32 : 1; + } sh_ni0_llp_chan_mode_s; +} sh_ni0_llp_chan_mode_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_CONFIG" */ +/* Sets the configuration of LLP and channel */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_llp_config_u { + mmr_t sh_ni0_llp_config_regval; + struct { + mmr_t maxburst : 10; + mmr_t maxretry : 10; + mmr_t nulltimeout : 6; + mmr_t ftu_time : 12; + mmr_t reserved_0 : 26; + } sh_ni0_llp_config_s; +} sh_ni0_llp_config_u_t; +#else +typedef union sh_ni0_llp_config_u { + mmr_t sh_ni0_llp_config_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t ftu_time : 12; + mmr_t nulltimeout : 6; + mmr_t maxretry : 10; + mmr_t maxburst : 10; + } sh_ni0_llp_config_s; +} sh_ni0_llp_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_TEST_CTL" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_llp_test_ctl_u { + mmr_t sh_ni0_llp_test_ctl_regval; + struct { + mmr_t pattern : 40; + mmr_t send_test_mode : 2; + mmr_t reserved_0 : 2; + mmr_t wire_sel : 6; + mmr_t reserved_1 : 2; + mmr_t lfsr_mode : 2; + mmr_t noise_mode : 2; + mmr_t armcapture : 1; + mmr_t capturecbonly : 1; + mmr_t sendcberror : 1; + mmr_t sendsnerror : 1; + mmr_t fakesnerror : 1; + mmr_t captured : 1; + mmr_t cberror : 1; + mmr_t reserved_2 : 1; + } sh_ni0_llp_test_ctl_s; +} sh_ni0_llp_test_ctl_u_t; +#else +typedef union sh_ni0_llp_test_ctl_u { + mmr_t sh_ni0_llp_test_ctl_regval; + struct { + mmr_t reserved_2 : 1; + mmr_t cberror : 1; + mmr_t captured : 1; + mmr_t fakesnerror : 1; + mmr_t sendsnerror : 1; + mmr_t sendcberror : 1; + mmr_t capturecbonly : 1; + mmr_t armcapture : 1; + mmr_t noise_mode : 2; + mmr_t lfsr_mode : 2; + mmr_t reserved_1 : 2; + mmr_t wire_sel : 6; + mmr_t reserved_0 : 2; + mmr_t send_test_mode : 2; + mmr_t pattern : 40; + } sh_ni0_llp_test_ctl_s; +} sh_ni0_llp_test_ctl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_CAPT_WD1" */ +/* low order 64-bit captured word */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_llp_capt_wd1_u { + mmr_t sh_ni0_llp_capt_wd1_regval; + struct { + mmr_t data : 64; + } sh_ni0_llp_capt_wd1_s; +} sh_ni0_llp_capt_wd1_u_t; +#else +typedef union sh_ni0_llp_capt_wd1_u { + mmr_t sh_ni0_llp_capt_wd1_regval; + struct { + mmr_t data : 64; + } sh_ni0_llp_capt_wd1_s; +} sh_ni0_llp_capt_wd1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_CAPT_WD2" */ +/* high order 64-bit captured word */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_llp_capt_wd2_u { + mmr_t sh_ni0_llp_capt_wd2_regval; + struct { + mmr_t data : 64; + } sh_ni0_llp_capt_wd2_s; +} sh_ni0_llp_capt_wd2_u_t; +#else +typedef union sh_ni0_llp_capt_wd2_u { + mmr_t sh_ni0_llp_capt_wd2_regval; + struct { + mmr_t data : 64; + } sh_ni0_llp_capt_wd2_s; +} sh_ni0_llp_capt_wd2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_CAPT_SBCB" */ +/* captured sideband, sequence, and CRC */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_llp_capt_sbcb_u { + mmr_t sh_ni0_llp_capt_sbcb_regval; + struct { + mmr_t capturedrcvsbsn : 16; + mmr_t capturedrcvcrc : 16; + mmr_t sentallcberrors : 1; + mmr_t sentallsnerrors : 1; + mmr_t fakedallsnerrors : 1; + mmr_t chargeoverflow : 1; + mmr_t chargeunderflow : 1; + mmr_t reserved_0 : 27; + } sh_ni0_llp_capt_sbcb_s; +} sh_ni0_llp_capt_sbcb_u_t; +#else +typedef union sh_ni0_llp_capt_sbcb_u { + mmr_t sh_ni0_llp_capt_sbcb_regval; + struct { + mmr_t reserved_0 : 27; + mmr_t chargeunderflow : 1; + mmr_t chargeoverflow : 1; + mmr_t fakedallsnerrors : 1; + mmr_t sentallsnerrors : 1; + mmr_t sentallcberrors : 1; + mmr_t capturedrcvcrc : 16; + mmr_t capturedrcvsbsn : 16; + } sh_ni0_llp_capt_sbcb_s; +} sh_ni0_llp_capt_sbcb_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_LLP_ERR" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_llp_err_u { + mmr_t sh_ni0_llp_err_regval; + struct { + mmr_t rx_sn_err_count : 8; + mmr_t rx_cb_err_count : 8; + mmr_t retry_count : 8; + mmr_t retry_timeout : 1; + mmr_t rcv_link_reset : 1; + mmr_t squash : 1; + mmr_t power_not_ok : 1; + mmr_t wire_cnt : 24; + mmr_t wire_overflow : 1; + mmr_t reserved_0 : 11; + } sh_ni0_llp_err_s; +} sh_ni0_llp_err_u_t; +#else +typedef union sh_ni0_llp_err_u { + mmr_t sh_ni0_llp_err_regval; + struct { + mmr_t reserved_0 : 11; + mmr_t wire_overflow : 1; + mmr_t wire_cnt : 24; + mmr_t power_not_ok : 1; + mmr_t squash : 1; + mmr_t rcv_link_reset : 1; + mmr_t retry_timeout : 1; + mmr_t retry_count : 8; + mmr_t rx_cb_err_count : 8; + mmr_t rx_sn_err_count : 8; + } sh_ni0_llp_err_s; +} sh_ni0_llp_err_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_STAT" */ +/* This register describes the LLP status. */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_llp_stat_u { + mmr_t sh_ni1_llp_stat_regval; + struct { + mmr_t link_reset_state : 4; + mmr_t reserved_0 : 60; + } sh_ni1_llp_stat_s; +} sh_ni1_llp_stat_u_t; +#else +typedef union sh_ni1_llp_stat_u { + mmr_t sh_ni1_llp_stat_regval; + struct { + mmr_t reserved_0 : 60; + mmr_t link_reset_state : 4; + } sh_ni1_llp_stat_s; +} sh_ni1_llp_stat_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_RESET" */ +/* Writing issues a reset to the network interface */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_llp_reset_u { + mmr_t sh_ni1_llp_reset_regval; + struct { + mmr_t link : 1; + mmr_t warm : 1; + mmr_t reserved_0 : 62; + } sh_ni1_llp_reset_s; +} sh_ni1_llp_reset_u_t; +#else +typedef union sh_ni1_llp_reset_u { + mmr_t sh_ni1_llp_reset_regval; + struct { + mmr_t reserved_0 : 62; + mmr_t warm : 1; + mmr_t link : 1; + } sh_ni1_llp_reset_s; +} sh_ni1_llp_reset_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_RESET_EN" */ +/* Controls LLP warm reset propagation */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_llp_reset_en_u { + mmr_t sh_ni1_llp_reset_en_regval; + struct { + mmr_t ok : 1; + mmr_t reserved_0 : 63; + } sh_ni1_llp_reset_en_s; +} sh_ni1_llp_reset_en_u_t; +#else +typedef union sh_ni1_llp_reset_en_u { + mmr_t sh_ni1_llp_reset_en_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t ok : 1; + } sh_ni1_llp_reset_en_s; +} sh_ni1_llp_reset_en_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_CHAN_MODE" */ +/* Sets the signaling mode of LLP and channel */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_llp_chan_mode_u { + mmr_t sh_ni1_llp_chan_mode_regval; + struct { + mmr_t bitmode32 : 1; + mmr_t ac_encode : 1; + mmr_t enable_tuning : 1; + mmr_t enable_rmt_ft_upd : 1; + mmr_t enable_clkquad : 1; + mmr_t reserved_0 : 59; + } sh_ni1_llp_chan_mode_s; +} sh_ni1_llp_chan_mode_u_t; +#else +typedef union sh_ni1_llp_chan_mode_u { + mmr_t sh_ni1_llp_chan_mode_regval; + struct { + mmr_t reserved_0 : 59; + mmr_t enable_clkquad : 1; + mmr_t enable_rmt_ft_upd : 1; + mmr_t enable_tuning : 1; + mmr_t ac_encode : 1; + mmr_t bitmode32 : 1; + } sh_ni1_llp_chan_mode_s; +} sh_ni1_llp_chan_mode_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_CONFIG" */ +/* Sets the configuration of LLP and channel */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_llp_config_u { + mmr_t sh_ni1_llp_config_regval; + struct { + mmr_t maxburst : 10; + mmr_t maxretry : 10; + mmr_t nulltimeout : 6; + mmr_t ftu_time : 12; + mmr_t reserved_0 : 26; + } sh_ni1_llp_config_s; +} sh_ni1_llp_config_u_t; +#else +typedef union sh_ni1_llp_config_u { + mmr_t sh_ni1_llp_config_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t ftu_time : 12; + mmr_t nulltimeout : 6; + mmr_t maxretry : 10; + mmr_t maxburst : 10; + } sh_ni1_llp_config_s; +} sh_ni1_llp_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_TEST_CTL" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_llp_test_ctl_u { + mmr_t sh_ni1_llp_test_ctl_regval; + struct { + mmr_t pattern : 40; + mmr_t send_test_mode : 2; + mmr_t reserved_0 : 2; + mmr_t wire_sel : 6; + mmr_t reserved_1 : 2; + mmr_t lfsr_mode : 2; + mmr_t noise_mode : 2; + mmr_t armcapture : 1; + mmr_t capturecbonly : 1; + mmr_t sendcberror : 1; + mmr_t sendsnerror : 1; + mmr_t fakesnerror : 1; + mmr_t captured : 1; + mmr_t cberror : 1; + mmr_t reserved_2 : 1; + } sh_ni1_llp_test_ctl_s; +} sh_ni1_llp_test_ctl_u_t; +#else +typedef union sh_ni1_llp_test_ctl_u { + mmr_t sh_ni1_llp_test_ctl_regval; + struct { + mmr_t reserved_2 : 1; + mmr_t cberror : 1; + mmr_t captured : 1; + mmr_t fakesnerror : 1; + mmr_t sendsnerror : 1; + mmr_t sendcberror : 1; + mmr_t capturecbonly : 1; + mmr_t armcapture : 1; + mmr_t noise_mode : 2; + mmr_t lfsr_mode : 2; + mmr_t reserved_1 : 2; + mmr_t wire_sel : 6; + mmr_t reserved_0 : 2; + mmr_t send_test_mode : 2; + mmr_t pattern : 40; + } sh_ni1_llp_test_ctl_s; +} sh_ni1_llp_test_ctl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_CAPT_WD1" */ +/* low order 64-bit captured word */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_llp_capt_wd1_u { + mmr_t sh_ni1_llp_capt_wd1_regval; + struct { + mmr_t data : 64; + } sh_ni1_llp_capt_wd1_s; +} sh_ni1_llp_capt_wd1_u_t; +#else +typedef union sh_ni1_llp_capt_wd1_u { + mmr_t sh_ni1_llp_capt_wd1_regval; + struct { + mmr_t data : 64; + } sh_ni1_llp_capt_wd1_s; +} sh_ni1_llp_capt_wd1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_CAPT_WD2" */ +/* high order 64-bit captured word */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_llp_capt_wd2_u { + mmr_t sh_ni1_llp_capt_wd2_regval; + struct { + mmr_t data : 64; + } sh_ni1_llp_capt_wd2_s; +} sh_ni1_llp_capt_wd2_u_t; +#else +typedef union sh_ni1_llp_capt_wd2_u { + mmr_t sh_ni1_llp_capt_wd2_regval; + struct { + mmr_t data : 64; + } sh_ni1_llp_capt_wd2_s; +} sh_ni1_llp_capt_wd2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_CAPT_SBCB" */ +/* captured sideband, sequence, and CRC */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_llp_capt_sbcb_u { + mmr_t sh_ni1_llp_capt_sbcb_regval; + struct { + mmr_t capturedrcvsbsn : 16; + mmr_t capturedrcvcrc : 16; + mmr_t sentallcberrors : 1; + mmr_t sentallsnerrors : 1; + mmr_t fakedallsnerrors : 1; + mmr_t chargeoverflow : 1; + mmr_t chargeunderflow : 1; + mmr_t reserved_0 : 27; + } sh_ni1_llp_capt_sbcb_s; +} sh_ni1_llp_capt_sbcb_u_t; +#else +typedef union sh_ni1_llp_capt_sbcb_u { + mmr_t sh_ni1_llp_capt_sbcb_regval; + struct { + mmr_t reserved_0 : 27; + mmr_t chargeunderflow : 1; + mmr_t chargeoverflow : 1; + mmr_t fakedallsnerrors : 1; + mmr_t sentallsnerrors : 1; + mmr_t sentallcberrors : 1; + mmr_t capturedrcvcrc : 16; + mmr_t capturedrcvsbsn : 16; + } sh_ni1_llp_capt_sbcb_s; +} sh_ni1_llp_capt_sbcb_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_LLP_ERR" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_llp_err_u { + mmr_t sh_ni1_llp_err_regval; + struct { + mmr_t rx_sn_err_count : 8; + mmr_t rx_cb_err_count : 8; + mmr_t retry_count : 8; + mmr_t retry_timeout : 1; + mmr_t rcv_link_reset : 1; + mmr_t squash : 1; + mmr_t power_not_ok : 1; + mmr_t wire_cnt : 24; + mmr_t wire_overflow : 1; + mmr_t reserved_0 : 11; + } sh_ni1_llp_err_s; +} sh_ni1_llp_err_u_t; +#else +typedef union sh_ni1_llp_err_u { + mmr_t sh_ni1_llp_err_regval; + struct { + mmr_t reserved_0 : 11; + mmr_t wire_overflow : 1; + mmr_t wire_cnt : 24; + mmr_t power_not_ok : 1; + mmr_t squash : 1; + mmr_t rcv_link_reset : 1; + mmr_t retry_timeout : 1; + mmr_t retry_count : 8; + mmr_t rx_cb_err_count : 8; + mmr_t rx_sn_err_count : 8; + } sh_ni1_llp_err_s; +} sh_ni1_llp_err_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_LLP_TO_FIFO02_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_llp_to_fifo02_flow_u { + mmr_t sh_xnni0_llp_to_fifo02_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_6 : 2; + } sh_xnni0_llp_to_fifo02_flow_s; +} sh_xnni0_llp_to_fifo02_flow_u_t; +#else +typedef union sh_xnni0_llp_to_fifo02_flow_u { + mmr_t sh_xnni0_llp_to_fifo02_flow_regval; + struct { + mmr_t reserved_6 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_2 : 8; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnni0_llp_to_fifo02_flow_s; +} sh_xnni0_llp_to_fifo02_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_LLP_TO_FIFO13_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_llp_to_fifo13_flow_u { + mmr_t sh_xnni0_llp_to_fifo13_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_6 : 2; + } sh_xnni0_llp_to_fifo13_flow_s; +} sh_xnni0_llp_to_fifo13_flow_u_t; +#else +typedef union sh_xnni0_llp_to_fifo13_flow_u { + mmr_t sh_xnni0_llp_to_fifo13_flow_regval; + struct { + mmr_t reserved_6 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_2 : 8; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnni0_llp_to_fifo13_flow_s; +} sh_xnni0_llp_to_fifo13_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_LLP_DEBIT_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_llp_debit_flow_u { + mmr_t sh_xnni0_llp_debit_flow_regval; + struct { + mmr_t debit_vc0_dyn : 5; + mmr_t reserved_0 : 3; + mmr_t debit_vc0_cap : 5; + mmr_t reserved_1 : 3; + mmr_t debit_vc1_dyn : 5; + mmr_t reserved_2 : 3; + mmr_t debit_vc1_cap : 5; + mmr_t reserved_3 : 3; + mmr_t debit_vc2_dyn : 5; + mmr_t reserved_4 : 3; + mmr_t debit_vc2_cap : 5; + mmr_t reserved_5 : 3; + mmr_t debit_vc3_dyn : 5; + mmr_t reserved_6 : 3; + mmr_t debit_vc3_cap : 5; + mmr_t reserved_7 : 3; + } sh_xnni0_llp_debit_flow_s; +} sh_xnni0_llp_debit_flow_u_t; +#else +typedef union sh_xnni0_llp_debit_flow_u { + mmr_t sh_xnni0_llp_debit_flow_regval; + struct { + mmr_t reserved_7 : 3; + mmr_t debit_vc3_cap : 5; + mmr_t reserved_6 : 3; + mmr_t debit_vc3_dyn : 5; + mmr_t reserved_5 : 3; + mmr_t debit_vc2_cap : 5; + mmr_t reserved_4 : 3; + mmr_t debit_vc2_dyn : 5; + mmr_t reserved_3 : 3; + mmr_t debit_vc1_cap : 5; + mmr_t reserved_2 : 3; + mmr_t debit_vc1_dyn : 5; + mmr_t reserved_1 : 3; + mmr_t debit_vc0_cap : 5; + mmr_t reserved_0 : 3; + mmr_t debit_vc0_dyn : 5; + } sh_xnni0_llp_debit_flow_s; +} sh_xnni0_llp_debit_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_LINK_0_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_link_0_flow_u { + mmr_t sh_xnni0_link_0_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t credit_vc0_test : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc0_dyn : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc0_cap : 7; + mmr_t reserved_3 : 33; + } sh_xnni0_link_0_flow_s; +} sh_xnni0_link_0_flow_u_t; +#else +typedef union sh_xnni0_link_0_flow_u { + mmr_t sh_xnni0_link_0_flow_regval; + struct { + mmr_t reserved_3 : 33; + mmr_t credit_vc0_cap : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc0_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc0_test : 7; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnni0_link_0_flow_s; +} sh_xnni0_link_0_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_LINK_1_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_link_1_flow_u { + mmr_t sh_xnni0_link_1_flow_regval; + struct { + mmr_t debit_vc1_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc1_force_cred : 1; + mmr_t credit_vc1_test : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc1_dyn : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc1_cap : 7; + mmr_t reserved_3 : 33; + } sh_xnni0_link_1_flow_s; +} sh_xnni0_link_1_flow_u_t; +#else +typedef union sh_xnni0_link_1_flow_u { + mmr_t sh_xnni0_link_1_flow_regval; + struct { + mmr_t reserved_3 : 33; + mmr_t credit_vc1_cap : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc1_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc1_test : 7; + mmr_t debit_vc1_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc1_withhold : 6; + } sh_xnni0_link_1_flow_s; +} sh_xnni0_link_1_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_LINK_2_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_link_2_flow_u { + mmr_t sh_xnni0_link_2_flow_regval; + struct { + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t credit_vc2_test : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc2_dyn : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc2_cap : 7; + mmr_t reserved_3 : 33; + } sh_xnni0_link_2_flow_s; +} sh_xnni0_link_2_flow_u_t; +#else +typedef union sh_xnni0_link_2_flow_u { + mmr_t sh_xnni0_link_2_flow_regval; + struct { + mmr_t reserved_3 : 33; + mmr_t credit_vc2_cap : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc2_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc2_test : 7; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc2_withhold : 6; + } sh_xnni0_link_2_flow_s; +} sh_xnni0_link_2_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_LINK_3_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_link_3_flow_u { + mmr_t sh_xnni0_link_3_flow_regval; + struct { + mmr_t debit_vc3_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc3_force_cred : 1; + mmr_t credit_vc3_test : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc3_dyn : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc3_cap : 7; + mmr_t reserved_3 : 33; + } sh_xnni0_link_3_flow_s; +} sh_xnni0_link_3_flow_u_t; +#else +typedef union sh_xnni0_link_3_flow_u { + mmr_t sh_xnni0_link_3_flow_regval; + struct { + mmr_t reserved_3 : 33; + mmr_t credit_vc3_cap : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc3_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc3_test : 7; + mmr_t debit_vc3_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc3_withhold : 6; + } sh_xnni0_link_3_flow_s; +} sh_xnni0_link_3_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_LLP_TO_FIFO02_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_llp_to_fifo02_flow_u { + mmr_t sh_xnni1_llp_to_fifo02_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_6 : 2; + } sh_xnni1_llp_to_fifo02_flow_s; +} sh_xnni1_llp_to_fifo02_flow_u_t; +#else +typedef union sh_xnni1_llp_to_fifo02_flow_u { + mmr_t sh_xnni1_llp_to_fifo02_flow_regval; + struct { + mmr_t reserved_6 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_2 : 8; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnni1_llp_to_fifo02_flow_s; +} sh_xnni1_llp_to_fifo02_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_LLP_TO_FIFO13_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_llp_to_fifo13_flow_u { + mmr_t sh_xnni1_llp_to_fifo13_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_6 : 2; + } sh_xnni1_llp_to_fifo13_flow_s; +} sh_xnni1_llp_to_fifo13_flow_u_t; +#else +typedef union sh_xnni1_llp_to_fifo13_flow_u { + mmr_t sh_xnni1_llp_to_fifo13_flow_regval; + struct { + mmr_t reserved_6 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_2 : 8; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnni1_llp_to_fifo13_flow_s; +} sh_xnni1_llp_to_fifo13_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_LLP_DEBIT_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_llp_debit_flow_u { + mmr_t sh_xnni1_llp_debit_flow_regval; + struct { + mmr_t debit_vc0_dyn : 5; + mmr_t reserved_0 : 3; + mmr_t debit_vc0_cap : 5; + mmr_t reserved_1 : 3; + mmr_t debit_vc1_dyn : 5; + mmr_t reserved_2 : 3; + mmr_t debit_vc1_cap : 5; + mmr_t reserved_3 : 3; + mmr_t debit_vc2_dyn : 5; + mmr_t reserved_4 : 3; + mmr_t debit_vc2_cap : 5; + mmr_t reserved_5 : 3; + mmr_t debit_vc3_dyn : 5; + mmr_t reserved_6 : 3; + mmr_t debit_vc3_cap : 5; + mmr_t reserved_7 : 3; + } sh_xnni1_llp_debit_flow_s; +} sh_xnni1_llp_debit_flow_u_t; +#else +typedef union sh_xnni1_llp_debit_flow_u { + mmr_t sh_xnni1_llp_debit_flow_regval; + struct { + mmr_t reserved_7 : 3; + mmr_t debit_vc3_cap : 5; + mmr_t reserved_6 : 3; + mmr_t debit_vc3_dyn : 5; + mmr_t reserved_5 : 3; + mmr_t debit_vc2_cap : 5; + mmr_t reserved_4 : 3; + mmr_t debit_vc2_dyn : 5; + mmr_t reserved_3 : 3; + mmr_t debit_vc1_cap : 5; + mmr_t reserved_2 : 3; + mmr_t debit_vc1_dyn : 5; + mmr_t reserved_1 : 3; + mmr_t debit_vc0_cap : 5; + mmr_t reserved_0 : 3; + mmr_t debit_vc0_dyn : 5; + } sh_xnni1_llp_debit_flow_s; +} sh_xnni1_llp_debit_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_LINK_0_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_link_0_flow_u { + mmr_t sh_xnni1_link_0_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t credit_vc0_test : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc0_dyn : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc0_cap : 7; + mmr_t reserved_3 : 33; + } sh_xnni1_link_0_flow_s; +} sh_xnni1_link_0_flow_u_t; +#else +typedef union sh_xnni1_link_0_flow_u { + mmr_t sh_xnni1_link_0_flow_regval; + struct { + mmr_t reserved_3 : 33; + mmr_t credit_vc0_cap : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc0_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc0_test : 7; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnni1_link_0_flow_s; +} sh_xnni1_link_0_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_LINK_1_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_link_1_flow_u { + mmr_t sh_xnni1_link_1_flow_regval; + struct { + mmr_t debit_vc1_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc1_force_cred : 1; + mmr_t credit_vc1_test : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc1_dyn : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc1_cap : 7; + mmr_t reserved_3 : 33; + } sh_xnni1_link_1_flow_s; +} sh_xnni1_link_1_flow_u_t; +#else +typedef union sh_xnni1_link_1_flow_u { + mmr_t sh_xnni1_link_1_flow_regval; + struct { + mmr_t reserved_3 : 33; + mmr_t credit_vc1_cap : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc1_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc1_test : 7; + mmr_t debit_vc1_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc1_withhold : 6; + } sh_xnni1_link_1_flow_s; +} sh_xnni1_link_1_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_LINK_2_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_link_2_flow_u { + mmr_t sh_xnni1_link_2_flow_regval; + struct { + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t credit_vc2_test : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc2_dyn : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc2_cap : 7; + mmr_t reserved_3 : 33; + } sh_xnni1_link_2_flow_s; +} sh_xnni1_link_2_flow_u_t; +#else +typedef union sh_xnni1_link_2_flow_u { + mmr_t sh_xnni1_link_2_flow_regval; + struct { + mmr_t reserved_3 : 33; + mmr_t credit_vc2_cap : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc2_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc2_test : 7; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc2_withhold : 6; + } sh_xnni1_link_2_flow_s; +} sh_xnni1_link_2_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_LINK_3_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_link_3_flow_u { + mmr_t sh_xnni1_link_3_flow_regval; + struct { + mmr_t debit_vc3_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc3_force_cred : 1; + mmr_t credit_vc3_test : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc3_dyn : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc3_cap : 7; + mmr_t reserved_3 : 33; + } sh_xnni1_link_3_flow_s; +} sh_xnni1_link_3_flow_u_t; +#else +typedef union sh_xnni1_link_3_flow_u { + mmr_t sh_xnni1_link_3_flow_regval; + struct { + mmr_t reserved_3 : 33; + mmr_t credit_vc3_cap : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc3_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t credit_vc3_test : 7; + mmr_t debit_vc3_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc3_withhold : 6; + } sh_xnni1_link_3_flow_s; +} sh_xnni1_link_3_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_IILB_LOCAL_TABLE" */ +/* local lookup table */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_iilb_local_table_u { + mmr_t sh_iilb_local_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t ni_sel0 : 1; + mmr_t reserved_0 : 57; + mmr_t valid : 1; + } sh_iilb_local_table_s; +} sh_iilb_local_table_u_t; +#else +typedef union sh_iilb_local_table_u { + mmr_t sh_iilb_local_table_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_0 : 57; + mmr_t ni_sel0 : 1; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_iilb_local_table_s; +} sh_iilb_local_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_IILB_GLOBAL_TABLE" */ +/* global lookup table */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_iilb_global_table_u { + mmr_t sh_iilb_global_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t ni_sel0 : 1; + mmr_t reserved_0 : 57; + mmr_t valid : 1; + } sh_iilb_global_table_s; +} sh_iilb_global_table_u_t; +#else +typedef union sh_iilb_global_table_u { + mmr_t sh_iilb_global_table_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_0 : 57; + mmr_t ni_sel0 : 1; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_iilb_global_table_s; +} sh_iilb_global_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_IILB_OVER_RIDE_TABLE" */ +/* If enabled, bypass the Global/Local tables */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_iilb_over_ride_table_u { + mmr_t sh_iilb_over_ride_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t ni_sel0 : 1; + mmr_t reserved_0 : 57; + mmr_t enable : 1; + } sh_iilb_over_ride_table_s; +} sh_iilb_over_ride_table_u_t; +#else +typedef union sh_iilb_over_ride_table_u { + mmr_t sh_iilb_over_ride_table_regval; + struct { + mmr_t enable : 1; + mmr_t reserved_0 : 57; + mmr_t ni_sel0 : 1; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_iilb_over_ride_table_s; +} sh_iilb_over_ride_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_IILB_RSP_PLANE_HINT" */ +/* If enabled, invert incoming response only plane hint bit before lo */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_iilb_rsp_plane_hint_u { + mmr_t sh_iilb_rsp_plane_hint_regval; + struct { + mmr_t reserved_0 : 64; + } sh_iilb_rsp_plane_hint_s; +} sh_iilb_rsp_plane_hint_u_t; +#else +typedef union sh_iilb_rsp_plane_hint_u { + mmr_t sh_iilb_rsp_plane_hint_regval; + struct { + mmr_t reserved_0 : 64; + } sh_iilb_rsp_plane_hint_s; +} sh_iilb_rsp_plane_hint_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_LOCAL_TABLE" */ +/* local lookup table */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_local_table_u { + mmr_t sh_pi_local_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t ni_sel0 : 1; + mmr_t reserved_0 : 2; + mmr_t dir1 : 4; + mmr_t v1 : 1; + mmr_t ni_sel1 : 1; + mmr_t reserved_1 : 49; + mmr_t valid : 1; + } sh_pi_local_table_s; +} sh_pi_local_table_u_t; +#else +typedef union sh_pi_local_table_u { + mmr_t sh_pi_local_table_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_1 : 49; + mmr_t ni_sel1 : 1; + mmr_t v1 : 1; + mmr_t dir1 : 4; + mmr_t reserved_0 : 2; + mmr_t ni_sel0 : 1; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_pi_local_table_s; +} sh_pi_local_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_GLOBAL_TABLE" */ +/* global lookup table */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_global_table_u { + mmr_t sh_pi_global_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t ni_sel0 : 1; + mmr_t reserved_0 : 2; + mmr_t dir1 : 4; + mmr_t v1 : 1; + mmr_t ni_sel1 : 1; + mmr_t reserved_1 : 49; + mmr_t valid : 1; + } sh_pi_global_table_s; +} sh_pi_global_table_u_t; +#else +typedef union sh_pi_global_table_u { + mmr_t sh_pi_global_table_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_1 : 49; + mmr_t ni_sel1 : 1; + mmr_t v1 : 1; + mmr_t dir1 : 4; + mmr_t reserved_0 : 2; + mmr_t ni_sel0 : 1; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_pi_global_table_s; +} sh_pi_global_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_OVER_RIDE_TABLE" */ +/* If enabled, bypass the Global/Local tables */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_over_ride_table_u { + mmr_t sh_pi_over_ride_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t ni_sel0 : 1; + mmr_t reserved_0 : 2; + mmr_t dir1 : 4; + mmr_t v1 : 1; + mmr_t ni_sel1 : 1; + mmr_t reserved_1 : 49; + mmr_t enable : 1; + } sh_pi_over_ride_table_s; +} sh_pi_over_ride_table_u_t; +#else +typedef union sh_pi_over_ride_table_u { + mmr_t sh_pi_over_ride_table_regval; + struct { + mmr_t enable : 1; + mmr_t reserved_1 : 49; + mmr_t ni_sel1 : 1; + mmr_t v1 : 1; + mmr_t dir1 : 4; + mmr_t reserved_0 : 2; + mmr_t ni_sel0 : 1; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_pi_over_ride_table_s; +} sh_pi_over_ride_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_RSP_PLANE_HINT" */ +/* If enabled, invert incoming response only plane hint bit before lo */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_rsp_plane_hint_u { + mmr_t sh_pi_rsp_plane_hint_regval; + struct { + mmr_t invert : 1; + mmr_t reserved_0 : 63; + } sh_pi_rsp_plane_hint_s; +} sh_pi_rsp_plane_hint_u_t; +#else +typedef union sh_pi_rsp_plane_hint_u { + mmr_t sh_pi_rsp_plane_hint_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t invert : 1; + } sh_pi_rsp_plane_hint_s; +} sh_pi_rsp_plane_hint_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_LOCAL_TABLE" */ +/* local lookup table */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_local_table_u { + mmr_t sh_ni0_local_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t reserved_0 : 58; + mmr_t valid : 1; + } sh_ni0_local_table_s; +} sh_ni0_local_table_u_t; +#else +typedef union sh_ni0_local_table_u { + mmr_t sh_ni0_local_table_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_0 : 58; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_ni0_local_table_s; +} sh_ni0_local_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_GLOBAL_TABLE" */ +/* global lookup table */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_global_table_u { + mmr_t sh_ni0_global_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t reserved_0 : 58; + mmr_t valid : 1; + } sh_ni0_global_table_s; +} sh_ni0_global_table_u_t; +#else +typedef union sh_ni0_global_table_u { + mmr_t sh_ni0_global_table_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_0 : 58; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_ni0_global_table_s; +} sh_ni0_global_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_OVER_RIDE_TABLE" */ +/* If enabled, bypass the Global/Local tables */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_over_ride_table_u { + mmr_t sh_ni0_over_ride_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t reserved_0 : 58; + mmr_t enable : 1; + } sh_ni0_over_ride_table_s; +} sh_ni0_over_ride_table_u_t; +#else +typedef union sh_ni0_over_ride_table_u { + mmr_t sh_ni0_over_ride_table_regval; + struct { + mmr_t enable : 1; + mmr_t reserved_0 : 58; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_ni0_over_ride_table_s; +} sh_ni0_over_ride_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_RSP_PLANE_HINT" */ +/* If enabled, invert incoming response only plane hint bit before lo */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_rsp_plane_hint_u { + mmr_t sh_ni0_rsp_plane_hint_regval; + struct { + mmr_t reserved_0 : 64; + } sh_ni0_rsp_plane_hint_s; +} sh_ni0_rsp_plane_hint_u_t; +#else +typedef union sh_ni0_rsp_plane_hint_u { + mmr_t sh_ni0_rsp_plane_hint_regval; + struct { + mmr_t reserved_0 : 64; + } sh_ni0_rsp_plane_hint_s; +} sh_ni0_rsp_plane_hint_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_LOCAL_TABLE" */ +/* local lookup table */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_local_table_u { + mmr_t sh_ni1_local_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t reserved_0 : 58; + mmr_t valid : 1; + } sh_ni1_local_table_s; +} sh_ni1_local_table_u_t; +#else +typedef union sh_ni1_local_table_u { + mmr_t sh_ni1_local_table_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_0 : 58; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_ni1_local_table_s; +} sh_ni1_local_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_GLOBAL_TABLE" */ +/* global lookup table */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_global_table_u { + mmr_t sh_ni1_global_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t reserved_0 : 58; + mmr_t valid : 1; + } sh_ni1_global_table_s; +} sh_ni1_global_table_u_t; +#else +typedef union sh_ni1_global_table_u { + mmr_t sh_ni1_global_table_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_0 : 58; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_ni1_global_table_s; +} sh_ni1_global_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_OVER_RIDE_TABLE" */ +/* If enabled, bypass the Global/Local tables */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_over_ride_table_u { + mmr_t sh_ni1_over_ride_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t reserved_0 : 58; + mmr_t enable : 1; + } sh_ni1_over_ride_table_s; +} sh_ni1_over_ride_table_u_t; +#else +typedef union sh_ni1_over_ride_table_u { + mmr_t sh_ni1_over_ride_table_regval; + struct { + mmr_t enable : 1; + mmr_t reserved_0 : 58; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_ni1_over_ride_table_s; +} sh_ni1_over_ride_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_RSP_PLANE_HINT" */ +/* If enabled, invert incoming response only plane hint bit before lo */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_rsp_plane_hint_u { + mmr_t sh_ni1_rsp_plane_hint_regval; + struct { + mmr_t reserved_0 : 64; + } sh_ni1_rsp_plane_hint_s; +} sh_ni1_rsp_plane_hint_u_t; +#else +typedef union sh_ni1_rsp_plane_hint_u { + mmr_t sh_ni1_rsp_plane_hint_regval; + struct { + mmr_t reserved_0 : 64; + } sh_ni1_rsp_plane_hint_s; +} sh_ni1_rsp_plane_hint_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_LOCAL_TABLE" */ +/* local lookup table */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_local_table_u { + mmr_t sh_md_local_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t ni_sel0 : 1; + mmr_t reserved_0 : 2; + mmr_t dir1 : 4; + mmr_t v1 : 1; + mmr_t ni_sel1 : 1; + mmr_t reserved_1 : 49; + mmr_t valid : 1; + } sh_md_local_table_s; +} sh_md_local_table_u_t; +#else +typedef union sh_md_local_table_u { + mmr_t sh_md_local_table_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_1 : 49; + mmr_t ni_sel1 : 1; + mmr_t v1 : 1; + mmr_t dir1 : 4; + mmr_t reserved_0 : 2; + mmr_t ni_sel0 : 1; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_md_local_table_s; +} sh_md_local_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_GLOBAL_TABLE" */ +/* global lookup table */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_global_table_u { + mmr_t sh_md_global_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t ni_sel0 : 1; + mmr_t reserved_0 : 2; + mmr_t dir1 : 4; + mmr_t v1 : 1; + mmr_t ni_sel1 : 1; + mmr_t reserved_1 : 49; + mmr_t valid : 1; + } sh_md_global_table_s; +} sh_md_global_table_u_t; +#else +typedef union sh_md_global_table_u { + mmr_t sh_md_global_table_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_1 : 49; + mmr_t ni_sel1 : 1; + mmr_t v1 : 1; + mmr_t dir1 : 4; + mmr_t reserved_0 : 2; + mmr_t ni_sel0 : 1; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_md_global_table_s; +} sh_md_global_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_OVER_RIDE_TABLE" */ +/* If enabled, bypass the Global/Local tables */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_over_ride_table_u { + mmr_t sh_md_over_ride_table_regval; + struct { + mmr_t dir0 : 4; + mmr_t v0 : 1; + mmr_t ni_sel0 : 1; + mmr_t reserved_0 : 2; + mmr_t dir1 : 4; + mmr_t v1 : 1; + mmr_t ni_sel1 : 1; + mmr_t reserved_1 : 49; + mmr_t enable : 1; + } sh_md_over_ride_table_s; +} sh_md_over_ride_table_u_t; +#else +typedef union sh_md_over_ride_table_u { + mmr_t sh_md_over_ride_table_regval; + struct { + mmr_t enable : 1; + mmr_t reserved_1 : 49; + mmr_t ni_sel1 : 1; + mmr_t v1 : 1; + mmr_t dir1 : 4; + mmr_t reserved_0 : 2; + mmr_t ni_sel0 : 1; + mmr_t v0 : 1; + mmr_t dir0 : 4; + } sh_md_over_ride_table_s; +} sh_md_over_ride_table_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_RSP_PLANE_HINT" */ +/* If enabled, invert incoming response only plane hint bit before lo */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_rsp_plane_hint_u { + mmr_t sh_md_rsp_plane_hint_regval; + struct { + mmr_t invert : 1; + mmr_t reserved_0 : 63; + } sh_md_rsp_plane_hint_s; +} sh_md_rsp_plane_hint_u_t; +#else +typedef union sh_md_rsp_plane_hint_u { + mmr_t sh_md_rsp_plane_hint_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t invert : 1; + } sh_md_rsp_plane_hint_s; +} sh_md_rsp_plane_hint_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_LIQ_CTL" */ +/* Local Block LIQ Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_liq_ctl_u { + mmr_t sh_lb_liq_ctl_regval; + struct { + mmr_t liq_req_ctl : 5; + mmr_t reserved_0 : 3; + mmr_t liq_rpl_ctl : 4; + mmr_t reserved_1 : 4; + mmr_t force_rq_credit : 1; + mmr_t force_rp_credit : 1; + mmr_t force_linvv_credit : 1; + mmr_t reserved_2 : 45; + } sh_lb_liq_ctl_s; +} sh_lb_liq_ctl_u_t; +#else +typedef union sh_lb_liq_ctl_u { + mmr_t sh_lb_liq_ctl_regval; + struct { + mmr_t reserved_2 : 45; + mmr_t force_linvv_credit : 1; + mmr_t force_rp_credit : 1; + mmr_t force_rq_credit : 1; + mmr_t reserved_1 : 4; + mmr_t liq_rpl_ctl : 4; + mmr_t reserved_0 : 3; + mmr_t liq_req_ctl : 5; + } sh_lb_liq_ctl_s; +} sh_lb_liq_ctl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_LOQ_CTL" */ +/* Local Block LOQ Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_loq_ctl_u { + mmr_t sh_lb_loq_ctl_regval; + struct { + mmr_t loq_req_ctl : 1; + mmr_t loq_rpl_ctl : 1; + mmr_t reserved_0 : 62; + } sh_lb_loq_ctl_s; +} sh_lb_loq_ctl_u_t; +#else +typedef union sh_lb_loq_ctl_u { + mmr_t sh_lb_loq_ctl_regval; + struct { + mmr_t reserved_0 : 62; + mmr_t loq_rpl_ctl : 1; + mmr_t loq_req_ctl : 1; + } sh_lb_loq_ctl_s; +} sh_lb_loq_ctl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_MAX_REP_CREDIT_CNT" */ +/* Maximum number of reply credits from XN */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_max_rep_credit_cnt_u { + mmr_t sh_lb_max_rep_credit_cnt_regval; + struct { + mmr_t max_cnt : 5; + mmr_t reserved_0 : 59; + } sh_lb_max_rep_credit_cnt_s; +} sh_lb_max_rep_credit_cnt_u_t; +#else +typedef union sh_lb_max_rep_credit_cnt_u { + mmr_t sh_lb_max_rep_credit_cnt_regval; + struct { + mmr_t reserved_0 : 59; + mmr_t max_cnt : 5; + } sh_lb_max_rep_credit_cnt_s; +} sh_lb_max_rep_credit_cnt_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_MAX_REQ_CREDIT_CNT" */ +/* Maximum number of request credits from XN */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_max_req_credit_cnt_u { + mmr_t sh_lb_max_req_credit_cnt_regval; + struct { + mmr_t max_cnt : 5; + mmr_t reserved_0 : 59; + } sh_lb_max_req_credit_cnt_s; +} sh_lb_max_req_credit_cnt_u_t; +#else +typedef union sh_lb_max_req_credit_cnt_u { + mmr_t sh_lb_max_req_credit_cnt_regval; + struct { + mmr_t reserved_0 : 59; + mmr_t max_cnt : 5; + } sh_lb_max_req_credit_cnt_s; +} sh_lb_max_req_credit_cnt_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PIO_TIME_OUT" */ +/* Local Block PIO time out value */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pio_time_out_u { + mmr_t sh_pio_time_out_regval; + struct { + mmr_t value : 16; + mmr_t reserved_0 : 48; + } sh_pio_time_out_s; +} sh_pio_time_out_u_t; +#else +typedef union sh_pio_time_out_u { + mmr_t sh_pio_time_out_regval; + struct { + mmr_t reserved_0 : 48; + mmr_t value : 16; + } sh_pio_time_out_s; +} sh_pio_time_out_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PIO_NACK_RESET" */ +/* Local Block PIO Reset for nack counters */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pio_nack_reset_u { + mmr_t sh_pio_nack_reset_regval; + struct { + mmr_t pulse : 1; + mmr_t reserved_0 : 63; + } sh_pio_nack_reset_s; +} sh_pio_nack_reset_u_t; +#else +typedef union sh_pio_nack_reset_u { + mmr_t sh_pio_nack_reset_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t pulse : 1; + } sh_pio_nack_reset_s; +} sh_pio_nack_reset_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_CONVEYOR_BELT_TIME_OUT" */ +/* Local Block conveyor belt time out value */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_conveyor_belt_time_out_u { + mmr_t sh_conveyor_belt_time_out_regval; + struct { + mmr_t value : 12; + mmr_t reserved_0 : 52; + } sh_conveyor_belt_time_out_s; +} sh_conveyor_belt_time_out_u_t; +#else +typedef union sh_conveyor_belt_time_out_u { + mmr_t sh_conveyor_belt_time_out_regval; + struct { + mmr_t reserved_0 : 52; + mmr_t value : 12; + } sh_conveyor_belt_time_out_s; +} sh_conveyor_belt_time_out_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_CREDIT_STATUS" */ +/* Credit Counter Status Register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_credit_status_u { + mmr_t sh_lb_credit_status_regval; + struct { + mmr_t liq_rq_credit : 5; + mmr_t reserved_0 : 1; + mmr_t liq_rp_credit : 4; + mmr_t reserved_1 : 2; + mmr_t linvv_credit : 6; + mmr_t loq_rq_credit : 5; + mmr_t loq_rp_credit : 5; + mmr_t reserved_2 : 36; + } sh_lb_credit_status_s; +} sh_lb_credit_status_u_t; +#else +typedef union sh_lb_credit_status_u { + mmr_t sh_lb_credit_status_regval; + struct { + mmr_t reserved_2 : 36; + mmr_t loq_rp_credit : 5; + mmr_t loq_rq_credit : 5; + mmr_t linvv_credit : 6; + mmr_t reserved_1 : 2; + mmr_t liq_rp_credit : 4; + mmr_t reserved_0 : 1; + mmr_t liq_rq_credit : 5; + } sh_lb_credit_status_s; +} sh_lb_credit_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_DEBUG_LOCAL_SEL" */ +/* LB Debug Port Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_debug_local_sel_u { + mmr_t sh_lb_debug_local_sel_regval; + struct { + mmr_t nibble0_chiplet_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_chiplet_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_chiplet_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_chiplet_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_chiplet_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_chiplet_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_chiplet_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_chiplet_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t trigger_enable : 1; + } sh_lb_debug_local_sel_s; +} sh_lb_debug_local_sel_u_t; +#else +typedef union sh_lb_debug_local_sel_u { + mmr_t sh_lb_debug_local_sel_regval; + struct { + mmr_t trigger_enable : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_chiplet_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_chiplet_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_chiplet_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_chiplet_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_chiplet_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_chiplet_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_chiplet_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_chiplet_sel : 3; + } sh_lb_debug_local_sel_s; +} sh_lb_debug_local_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_DEBUG_PERF_SEL" */ +/* LB Debug Port Performance Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_debug_perf_sel_u { + mmr_t sh_lb_debug_perf_sel_regval; + struct { + mmr_t nibble0_chiplet_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_chiplet_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_chiplet_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_chiplet_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_chiplet_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_chiplet_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_chiplet_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_chiplet_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_15 : 1; + } sh_lb_debug_perf_sel_s; +} sh_lb_debug_perf_sel_u_t; +#else +typedef union sh_lb_debug_perf_sel_u { + mmr_t sh_lb_debug_perf_sel_regval; + struct { + mmr_t reserved_15 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_chiplet_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_chiplet_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_chiplet_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_chiplet_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_chiplet_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_chiplet_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_chiplet_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_chiplet_sel : 3; + } sh_lb_debug_perf_sel_s; +} sh_lb_debug_perf_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_DEBUG_TRIG_SEL" */ +/* LB Debug Trigger Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_debug_trig_sel_u { + mmr_t sh_lb_debug_trig_sel_regval; + struct { + mmr_t trigger0_chiplet_sel : 3; + mmr_t reserved_0 : 1; + mmr_t trigger0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t trigger1_chiplet_sel : 3; + mmr_t reserved_2 : 1; + mmr_t trigger1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t trigger2_chiplet_sel : 3; + mmr_t reserved_4 : 1; + mmr_t trigger2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t trigger3_chiplet_sel : 3; + mmr_t reserved_6 : 1; + mmr_t trigger3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t trigger4_chiplet_sel : 3; + mmr_t reserved_8 : 1; + mmr_t trigger4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t trigger5_chiplet_sel : 3; + mmr_t reserved_10 : 1; + mmr_t trigger5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t trigger6_chiplet_sel : 3; + mmr_t reserved_12 : 1; + mmr_t trigger6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t trigger7_chiplet_sel : 3; + mmr_t reserved_14 : 1; + mmr_t trigger7_nibble_sel : 3; + mmr_t reserved_15 : 1; + } sh_lb_debug_trig_sel_s; +} sh_lb_debug_trig_sel_u_t; +#else +typedef union sh_lb_debug_trig_sel_u { + mmr_t sh_lb_debug_trig_sel_regval; + struct { + mmr_t reserved_15 : 1; + mmr_t trigger7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t trigger7_chiplet_sel : 3; + mmr_t reserved_13 : 1; + mmr_t trigger6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t trigger6_chiplet_sel : 3; + mmr_t reserved_11 : 1; + mmr_t trigger5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t trigger5_chiplet_sel : 3; + mmr_t reserved_9 : 1; + mmr_t trigger4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t trigger4_chiplet_sel : 3; + mmr_t reserved_7 : 1; + mmr_t trigger3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t trigger3_chiplet_sel : 3; + mmr_t reserved_5 : 1; + mmr_t trigger2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t trigger2_chiplet_sel : 3; + mmr_t reserved_3 : 1; + mmr_t trigger1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t trigger1_chiplet_sel : 3; + mmr_t reserved_1 : 1; + mmr_t trigger0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t trigger0_chiplet_sel : 3; + } sh_lb_debug_trig_sel_s; +} sh_lb_debug_trig_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_DETAIL_1" */ +/* LB Error capture information: HDR1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_error_detail_1_u { + mmr_t sh_lb_error_detail_1_regval; + struct { + mmr_t command : 8; + mmr_t suppl : 14; + mmr_t reserved_0 : 2; + mmr_t source : 14; + mmr_t reserved_1 : 2; + mmr_t dest : 3; + mmr_t reserved_2 : 5; + mmr_t hdr_err : 1; + mmr_t data_err : 1; + mmr_t reserved_3 : 13; + mmr_t valid : 1; + } sh_lb_error_detail_1_s; +} sh_lb_error_detail_1_u_t; +#else +typedef union sh_lb_error_detail_1_u { + mmr_t sh_lb_error_detail_1_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_3 : 13; + mmr_t data_err : 1; + mmr_t hdr_err : 1; + mmr_t reserved_2 : 5; + mmr_t dest : 3; + mmr_t reserved_1 : 2; + mmr_t source : 14; + mmr_t reserved_0 : 2; + mmr_t suppl : 14; + mmr_t command : 8; + } sh_lb_error_detail_1_s; +} sh_lb_error_detail_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_DETAIL_2" */ +/* LB Error Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_error_detail_2_u { + mmr_t sh_lb_error_detail_2_regval; + struct { + mmr_t address : 47; + mmr_t reserved_0 : 17; + } sh_lb_error_detail_2_s; +} sh_lb_error_detail_2_u_t; +#else +typedef union sh_lb_error_detail_2_u { + mmr_t sh_lb_error_detail_2_regval; + struct { + mmr_t reserved_0 : 17; + mmr_t address : 47; + } sh_lb_error_detail_2_s; +} sh_lb_error_detail_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_DETAIL_3" */ +/* LB Error Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_error_detail_3_u { + mmr_t sh_lb_error_detail_3_regval; + struct { + mmr_t data : 64; + } sh_lb_error_detail_3_s; +} sh_lb_error_detail_3_u_t; +#else +typedef union sh_lb_error_detail_3_u { + mmr_t sh_lb_error_detail_3_regval; + struct { + mmr_t data : 64; + } sh_lb_error_detail_3_s; +} sh_lb_error_detail_3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_DETAIL_4" */ +/* LB Error Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_error_detail_4_u { + mmr_t sh_lb_error_detail_4_regval; + struct { + mmr_t route : 64; + } sh_lb_error_detail_4_s; +} sh_lb_error_detail_4_u_t; +#else +typedef union sh_lb_error_detail_4_u { + mmr_t sh_lb_error_detail_4_regval; + struct { + mmr_t route : 64; + } sh_lb_error_detail_4_s; +} sh_lb_error_detail_4_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_DETAIL_5" */ +/* LB Error Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_error_detail_5_u { + mmr_t sh_lb_error_detail_5_regval; + struct { + mmr_t read_retry : 1; + mmr_t ptc1_write : 1; + mmr_t write_retry : 1; + mmr_t count_a_overflow : 1; + mmr_t count_b_overflow : 1; + mmr_t nack_a_timeout : 1; + mmr_t nack_b_timeout : 1; + mmr_t reserved_0 : 57; + } sh_lb_error_detail_5_s; +} sh_lb_error_detail_5_u_t; +#else +typedef union sh_lb_error_detail_5_u { + mmr_t sh_lb_error_detail_5_regval; + struct { + mmr_t reserved_0 : 57; + mmr_t nack_b_timeout : 1; + mmr_t nack_a_timeout : 1; + mmr_t count_b_overflow : 1; + mmr_t count_a_overflow : 1; + mmr_t write_retry : 1; + mmr_t ptc1_write : 1; + mmr_t read_retry : 1; + } sh_lb_error_detail_5_s; +} sh_lb_error_detail_5_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_MASK" */ +/* LB Error Mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_error_mask_u { + mmr_t sh_lb_error_mask_regval; + struct { + mmr_t rq_bad_cmd : 1; + mmr_t rp_bad_cmd : 1; + mmr_t rq_short : 1; + mmr_t rp_short : 1; + mmr_t rq_long : 1; + mmr_t rp_long : 1; + mmr_t rq_bad_data : 1; + mmr_t rp_bad_data : 1; + mmr_t rq_bad_addr : 1; + mmr_t rq_time_out : 1; + mmr_t linvv_overflow : 1; + mmr_t unexpected_linv : 1; + mmr_t ptc_1_timeout : 1; + mmr_t junk_bus_err : 1; + mmr_t pio_cb_err : 1; + mmr_t vector_rq_route_error : 1; + mmr_t vector_rp_route_error : 1; + mmr_t gclk_drop : 1; + mmr_t rq_fifo_error : 1; + mmr_t rp_fifo_error : 1; + mmr_t unexp_valid : 1; + mmr_t rq_credit_overflow : 1; + mmr_t rp_credit_overflow : 1; + mmr_t reserved_0 : 41; + } sh_lb_error_mask_s; +} sh_lb_error_mask_u_t; +#else +typedef union sh_lb_error_mask_u { + mmr_t sh_lb_error_mask_regval; + struct { + mmr_t reserved_0 : 41; + mmr_t rp_credit_overflow : 1; + mmr_t rq_credit_overflow : 1; + mmr_t unexp_valid : 1; + mmr_t rp_fifo_error : 1; + mmr_t rq_fifo_error : 1; + mmr_t gclk_drop : 1; + mmr_t vector_rp_route_error : 1; + mmr_t vector_rq_route_error : 1; + mmr_t pio_cb_err : 1; + mmr_t junk_bus_err : 1; + mmr_t ptc_1_timeout : 1; + mmr_t unexpected_linv : 1; + mmr_t linvv_overflow : 1; + mmr_t rq_time_out : 1; + mmr_t rq_bad_addr : 1; + mmr_t rp_bad_data : 1; + mmr_t rq_bad_data : 1; + mmr_t rp_long : 1; + mmr_t rq_long : 1; + mmr_t rp_short : 1; + mmr_t rq_short : 1; + mmr_t rp_bad_cmd : 1; + mmr_t rq_bad_cmd : 1; + } sh_lb_error_mask_s; +} sh_lb_error_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_OVERFLOW" */ +/* LB Error Overflow */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_error_overflow_u { + mmr_t sh_lb_error_overflow_regval; + struct { + mmr_t rq_bad_cmd_ovrfl : 1; + mmr_t rp_bad_cmd_ovrfl : 1; + mmr_t rq_short_ovrfl : 1; + mmr_t rp_short_ovrfl : 1; + mmr_t rq_long_ovrfl : 1; + mmr_t rp_long_ovrfl : 1; + mmr_t rq_bad_data_ovrfl : 1; + mmr_t rp_bad_data_ovrfl : 1; + mmr_t rq_bad_addr_ovrfl : 1; + mmr_t rq_time_out_ovrfl : 1; + mmr_t linvv_overflow_ovrfl : 1; + mmr_t unexpected_linv_ovrfl : 1; + mmr_t ptc_1_timeout_ovrfl : 1; + mmr_t junk_bus_err_ovrfl : 1; + mmr_t pio_cb_err_ovrfl : 1; + mmr_t vector_rq_route_error_ovrfl : 1; + mmr_t vector_rp_route_error_ovrfl : 1; + mmr_t gclk_drop_ovrfl : 1; + mmr_t rq_fifo_error_ovrfl : 1; + mmr_t rp_fifo_error_ovrfl : 1; + mmr_t unexp_valid_ovrfl : 1; + mmr_t rq_credit_overflow_ovrfl : 1; + mmr_t rp_credit_overflow_ovrfl : 1; + mmr_t reserved_0 : 41; + } sh_lb_error_overflow_s; +} sh_lb_error_overflow_u_t; +#else +typedef union sh_lb_error_overflow_u { + mmr_t sh_lb_error_overflow_regval; + struct { + mmr_t reserved_0 : 41; + mmr_t rp_credit_overflow_ovrfl : 1; + mmr_t rq_credit_overflow_ovrfl : 1; + mmr_t unexp_valid_ovrfl : 1; + mmr_t rp_fifo_error_ovrfl : 1; + mmr_t rq_fifo_error_ovrfl : 1; + mmr_t gclk_drop_ovrfl : 1; + mmr_t vector_rp_route_error_ovrfl : 1; + mmr_t vector_rq_route_error_ovrfl : 1; + mmr_t pio_cb_err_ovrfl : 1; + mmr_t junk_bus_err_ovrfl : 1; + mmr_t ptc_1_timeout_ovrfl : 1; + mmr_t unexpected_linv_ovrfl : 1; + mmr_t linvv_overflow_ovrfl : 1; + mmr_t rq_time_out_ovrfl : 1; + mmr_t rq_bad_addr_ovrfl : 1; + mmr_t rp_bad_data_ovrfl : 1; + mmr_t rq_bad_data_ovrfl : 1; + mmr_t rp_long_ovrfl : 1; + mmr_t rq_long_ovrfl : 1; + mmr_t rp_short_ovrfl : 1; + mmr_t rq_short_ovrfl : 1; + mmr_t rp_bad_cmd_ovrfl : 1; + mmr_t rq_bad_cmd_ovrfl : 1; + } sh_lb_error_overflow_s; +} sh_lb_error_overflow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_ERROR_SUMMARY" */ +/* LB Error Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_error_summary_u { + mmr_t sh_lb_error_summary_regval; + struct { + mmr_t rq_bad_cmd : 1; + mmr_t rp_bad_cmd : 1; + mmr_t rq_short : 1; + mmr_t rp_short : 1; + mmr_t rq_long : 1; + mmr_t rp_long : 1; + mmr_t rq_bad_data : 1; + mmr_t rp_bad_data : 1; + mmr_t rq_bad_addr : 1; + mmr_t rq_time_out : 1; + mmr_t linvv_overflow : 1; + mmr_t unexpected_linv : 1; + mmr_t ptc_1_timeout : 1; + mmr_t junk_bus_err : 1; + mmr_t pio_cb_err : 1; + mmr_t vector_rq_route_error : 1; + mmr_t vector_rp_route_error : 1; + mmr_t gclk_drop : 1; + mmr_t rq_fifo_error : 1; + mmr_t rp_fifo_error : 1; + mmr_t unexp_valid : 1; + mmr_t rq_credit_overflow : 1; + mmr_t rp_credit_overflow : 1; + mmr_t reserved_0 : 41; + } sh_lb_error_summary_s; +} sh_lb_error_summary_u_t; +#else +typedef union sh_lb_error_summary_u { + mmr_t sh_lb_error_summary_regval; + struct { + mmr_t reserved_0 : 41; + mmr_t rp_credit_overflow : 1; + mmr_t rq_credit_overflow : 1; + mmr_t unexp_valid : 1; + mmr_t rp_fifo_error : 1; + mmr_t rq_fifo_error : 1; + mmr_t gclk_drop : 1; + mmr_t vector_rp_route_error : 1; + mmr_t vector_rq_route_error : 1; + mmr_t pio_cb_err : 1; + mmr_t junk_bus_err : 1; + mmr_t ptc_1_timeout : 1; + mmr_t unexpected_linv : 1; + mmr_t linvv_overflow : 1; + mmr_t rq_time_out : 1; + mmr_t rq_bad_addr : 1; + mmr_t rp_bad_data : 1; + mmr_t rq_bad_data : 1; + mmr_t rp_long : 1; + mmr_t rq_long : 1; + mmr_t rp_short : 1; + mmr_t rq_short : 1; + mmr_t rp_bad_cmd : 1; + mmr_t rq_bad_cmd : 1; + } sh_lb_error_summary_s; +} sh_lb_error_summary_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_FIRST_ERROR" */ +/* LB First Error */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_first_error_u { + mmr_t sh_lb_first_error_regval; + struct { + mmr_t rq_bad_cmd : 1; + mmr_t rp_bad_cmd : 1; + mmr_t rq_short : 1; + mmr_t rp_short : 1; + mmr_t rq_long : 1; + mmr_t rp_long : 1; + mmr_t rq_bad_data : 1; + mmr_t rp_bad_data : 1; + mmr_t rq_bad_addr : 1; + mmr_t rq_time_out : 1; + mmr_t linvv_overflow : 1; + mmr_t unexpected_linv : 1; + mmr_t ptc_1_timeout : 1; + mmr_t junk_bus_err : 1; + mmr_t pio_cb_err : 1; + mmr_t vector_rq_route_error : 1; + mmr_t vector_rp_route_error : 1; + mmr_t gclk_drop : 1; + mmr_t rq_fifo_error : 1; + mmr_t rp_fifo_error : 1; + mmr_t unexp_valid : 1; + mmr_t rq_credit_overflow : 1; + mmr_t rp_credit_overflow : 1; + mmr_t reserved_0 : 41; + } sh_lb_first_error_s; +} sh_lb_first_error_u_t; +#else +typedef union sh_lb_first_error_u { + mmr_t sh_lb_first_error_regval; + struct { + mmr_t reserved_0 : 41; + mmr_t rp_credit_overflow : 1; + mmr_t rq_credit_overflow : 1; + mmr_t unexp_valid : 1; + mmr_t rp_fifo_error : 1; + mmr_t rq_fifo_error : 1; + mmr_t gclk_drop : 1; + mmr_t vector_rp_route_error : 1; + mmr_t vector_rq_route_error : 1; + mmr_t pio_cb_err : 1; + mmr_t junk_bus_err : 1; + mmr_t ptc_1_timeout : 1; + mmr_t unexpected_linv : 1; + mmr_t linvv_overflow : 1; + mmr_t rq_time_out : 1; + mmr_t rq_bad_addr : 1; + mmr_t rp_bad_data : 1; + mmr_t rq_bad_data : 1; + mmr_t rp_long : 1; + mmr_t rq_long : 1; + mmr_t rp_short : 1; + mmr_t rq_short : 1; + mmr_t rp_bad_cmd : 1; + mmr_t rq_bad_cmd : 1; + } sh_lb_first_error_s; +} sh_lb_first_error_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_LAST_CREDIT" */ +/* Credit counter status register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_last_credit_u { + mmr_t sh_lb_last_credit_regval; + struct { + mmr_t liq_rq_credit : 5; + mmr_t reserved_0 : 1; + mmr_t liq_rp_credit : 4; + mmr_t reserved_1 : 2; + mmr_t linvv_credit : 6; + mmr_t loq_rq_credit : 5; + mmr_t loq_rp_credit : 5; + mmr_t reserved_2 : 36; + } sh_lb_last_credit_s; +} sh_lb_last_credit_u_t; +#else +typedef union sh_lb_last_credit_u { + mmr_t sh_lb_last_credit_regval; + struct { + mmr_t reserved_2 : 36; + mmr_t loq_rp_credit : 5; + mmr_t loq_rq_credit : 5; + mmr_t linvv_credit : 6; + mmr_t reserved_1 : 2; + mmr_t liq_rp_credit : 4; + mmr_t reserved_0 : 1; + mmr_t liq_rq_credit : 5; + } sh_lb_last_credit_s; +} sh_lb_last_credit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_NACK_STATUS" */ +/* Nack Counter Status Register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_nack_status_u { + mmr_t sh_lb_nack_status_regval; + struct { + mmr_t pio_nack_a : 12; + mmr_t reserved_0 : 4; + mmr_t pio_nack_b : 12; + mmr_t reserved_1 : 4; + mmr_t junk_nack : 16; + mmr_t cb_timeout_count : 12; + mmr_t cb_state : 2; + mmr_t reserved_2 : 2; + } sh_lb_nack_status_s; +} sh_lb_nack_status_u_t; +#else +typedef union sh_lb_nack_status_u { + mmr_t sh_lb_nack_status_regval; + struct { + mmr_t reserved_2 : 2; + mmr_t cb_state : 2; + mmr_t cb_timeout_count : 12; + mmr_t junk_nack : 16; + mmr_t reserved_1 : 4; + mmr_t pio_nack_b : 12; + mmr_t reserved_0 : 4; + mmr_t pio_nack_a : 12; + } sh_lb_nack_status_s; +} sh_lb_nack_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_TRIGGER_COMPARE" */ +/* LB Test-point Trigger Compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_trigger_compare_u { + mmr_t sh_lb_trigger_compare_regval; + struct { + mmr_t mask : 32; + mmr_t reserved_0 : 32; + } sh_lb_trigger_compare_s; +} sh_lb_trigger_compare_u_t; +#else +typedef union sh_lb_trigger_compare_u { + mmr_t sh_lb_trigger_compare_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t mask : 32; + } sh_lb_trigger_compare_s; +} sh_lb_trigger_compare_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_TRIGGER_DATA" */ +/* LB Test-point Trigger Compare Data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_trigger_data_u { + mmr_t sh_lb_trigger_data_regval; + struct { + mmr_t compare_pattern : 32; + mmr_t reserved_0 : 32; + } sh_lb_trigger_data_s; +} sh_lb_trigger_data_u_t; +#else +typedef union sh_lb_trigger_data_u { + mmr_t sh_lb_trigger_data_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t compare_pattern : 32; + } sh_lb_trigger_data_s; +} sh_lb_trigger_data_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_AEC_CONFIG" */ +/* PI Adaptive Error Correction Configuration */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_aec_config_u { + mmr_t sh_pi_aec_config_regval; + struct { + mmr_t mode : 3; + mmr_t reserved_0 : 61; + } sh_pi_aec_config_s; +} sh_pi_aec_config_u_t; +#else +typedef union sh_pi_aec_config_u { + mmr_t sh_pi_aec_config_regval; + struct { + mmr_t reserved_0 : 61; + mmr_t mode : 3; + } sh_pi_aec_config_s; +} sh_pi_aec_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_AFI_ERROR_MASK" */ +/* PI AFI Error Mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_afi_error_mask_u { + mmr_t sh_pi_afi_error_mask_regval; + struct { + mmr_t reserved_0 : 21; + mmr_t hung_bus : 1; + mmr_t rsp_parity : 1; + mmr_t ioq_overrun : 1; + mmr_t req_format : 1; + mmr_t addr_access : 1; + mmr_t req_parity : 1; + mmr_t addr_parity : 1; + mmr_t shub_fsb_dqe : 1; + mmr_t shub_fsb_uce : 1; + mmr_t shub_fsb_ce : 1; + mmr_t livelock : 1; + mmr_t bad_snoop : 1; + mmr_t fsb_tbl_miss : 1; + mmr_t msg_len : 1; + mmr_t reserved_1 : 29; + } sh_pi_afi_error_mask_s; +} sh_pi_afi_error_mask_u_t; +#else +typedef union sh_pi_afi_error_mask_u { + mmr_t sh_pi_afi_error_mask_regval; + struct { + mmr_t reserved_1 : 29; + mmr_t msg_len : 1; + mmr_t fsb_tbl_miss : 1; + mmr_t bad_snoop : 1; + mmr_t livelock : 1; + mmr_t shub_fsb_ce : 1; + mmr_t shub_fsb_uce : 1; + mmr_t shub_fsb_dqe : 1; + mmr_t addr_parity : 1; + mmr_t req_parity : 1; + mmr_t addr_access : 1; + mmr_t req_format : 1; + mmr_t ioq_overrun : 1; + mmr_t rsp_parity : 1; + mmr_t hung_bus : 1; + mmr_t reserved_0 : 21; + } sh_pi_afi_error_mask_s; +} sh_pi_afi_error_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_AFI_TEST_POINT_COMPARE" */ +/* PI AFI Test Point Compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_afi_test_point_compare_u { + mmr_t sh_pi_afi_test_point_compare_regval; + struct { + mmr_t compare_mask : 32; + mmr_t compare_pattern : 32; + } sh_pi_afi_test_point_compare_s; +} sh_pi_afi_test_point_compare_u_t; +#else +typedef union sh_pi_afi_test_point_compare_u { + mmr_t sh_pi_afi_test_point_compare_regval; + struct { + mmr_t compare_pattern : 32; + mmr_t compare_mask : 32; + } sh_pi_afi_test_point_compare_s; +} sh_pi_afi_test_point_compare_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_AFI_TEST_POINT_SELECT" */ +/* PI AFI Test Point Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_afi_test_point_select_u { + mmr_t sh_pi_afi_test_point_select_regval; + struct { + mmr_t nibble0_chiplet_sel : 4; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble1_chiplet_sel : 4; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble2_chiplet_sel : 4; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble3_chiplet_sel : 4; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble4_chiplet_sel : 4; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble5_chiplet_sel : 4; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble6_chiplet_sel : 4; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble7_chiplet_sel : 4; + mmr_t nibble7_nibble_sel : 3; + mmr_t trigger_enable : 1; + } sh_pi_afi_test_point_select_s; +} sh_pi_afi_test_point_select_u_t; +#else +typedef union sh_pi_afi_test_point_select_u { + mmr_t sh_pi_afi_test_point_select_regval; + struct { + mmr_t trigger_enable : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t nibble7_chiplet_sel : 4; + mmr_t reserved_6 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t nibble6_chiplet_sel : 4; + mmr_t reserved_5 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t nibble5_chiplet_sel : 4; + mmr_t reserved_4 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t nibble4_chiplet_sel : 4; + mmr_t reserved_3 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t nibble3_chiplet_sel : 4; + mmr_t reserved_2 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t nibble2_chiplet_sel : 4; + mmr_t reserved_1 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t nibble1_chiplet_sel : 4; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t nibble0_chiplet_sel : 4; + } sh_pi_afi_test_point_select_s; +} sh_pi_afi_test_point_select_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_AFI_TEST_POINT_TRIGGER_SELECT" */ +/* PI CRBC Test Point Trigger Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_afi_test_point_trigger_select_u { + mmr_t sh_pi_afi_test_point_trigger_select_regval; + struct { + mmr_t trigger0_chiplet_sel : 4; + mmr_t trigger0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t trigger1_chiplet_sel : 4; + mmr_t trigger1_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t trigger2_chiplet_sel : 4; + mmr_t trigger2_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t trigger3_chiplet_sel : 4; + mmr_t trigger3_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t trigger4_chiplet_sel : 4; + mmr_t trigger4_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t trigger5_chiplet_sel : 4; + mmr_t trigger5_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t trigger6_chiplet_sel : 4; + mmr_t trigger6_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t trigger7_chiplet_sel : 4; + mmr_t trigger7_nibble_sel : 3; + mmr_t reserved_7 : 1; + } sh_pi_afi_test_point_trigger_select_s; +} sh_pi_afi_test_point_trigger_select_u_t; +#else +typedef union sh_pi_afi_test_point_trigger_select_u { + mmr_t sh_pi_afi_test_point_trigger_select_regval; + struct { + mmr_t reserved_7 : 1; + mmr_t trigger7_nibble_sel : 3; + mmr_t trigger7_chiplet_sel : 4; + mmr_t reserved_6 : 1; + mmr_t trigger6_nibble_sel : 3; + mmr_t trigger6_chiplet_sel : 4; + mmr_t reserved_5 : 1; + mmr_t trigger5_nibble_sel : 3; + mmr_t trigger5_chiplet_sel : 4; + mmr_t reserved_4 : 1; + mmr_t trigger4_nibble_sel : 3; + mmr_t trigger4_chiplet_sel : 4; + mmr_t reserved_3 : 1; + mmr_t trigger3_nibble_sel : 3; + mmr_t trigger3_chiplet_sel : 4; + mmr_t reserved_2 : 1; + mmr_t trigger2_nibble_sel : 3; + mmr_t trigger2_chiplet_sel : 4; + mmr_t reserved_1 : 1; + mmr_t trigger1_nibble_sel : 3; + mmr_t trigger1_chiplet_sel : 4; + mmr_t reserved_0 : 1; + mmr_t trigger0_nibble_sel : 3; + mmr_t trigger0_chiplet_sel : 4; + } sh_pi_afi_test_point_trigger_select_s; +} sh_pi_afi_test_point_trigger_select_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_AUTO_REPLY_ENABLE" */ +/* PI Auto Reply Enable */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_auto_reply_enable_u { + mmr_t sh_pi_auto_reply_enable_regval; + struct { + mmr_t auto_reply_enable : 1; + mmr_t reserved_0 : 63; + } sh_pi_auto_reply_enable_s; +} sh_pi_auto_reply_enable_u_t; +#else +typedef union sh_pi_auto_reply_enable_u { + mmr_t sh_pi_auto_reply_enable_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t auto_reply_enable : 1; + } sh_pi_auto_reply_enable_s; +} sh_pi_auto_reply_enable_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CAM_CONTROL" */ +/* CRB CAM MMR Access Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_cam_control_u { + mmr_t sh_pi_cam_control_regval; + struct { + mmr_t cam_indx : 7; + mmr_t reserved_0 : 1; + mmr_t cam_write : 1; + mmr_t rrb_rd_xfer_clear : 1; + mmr_t reserved_1 : 53; + mmr_t start : 1; + } sh_pi_cam_control_s; +} sh_pi_cam_control_u_t; +#else +typedef union sh_pi_cam_control_u { + mmr_t sh_pi_cam_control_regval; + struct { + mmr_t start : 1; + mmr_t reserved_1 : 53; + mmr_t rrb_rd_xfer_clear : 1; + mmr_t cam_write : 1; + mmr_t reserved_0 : 1; + mmr_t cam_indx : 7; + } sh_pi_cam_control_s; +} sh_pi_cam_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBC_TEST_POINT_COMPARE" */ +/* PI CRBC Test Point Compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbc_test_point_compare_u { + mmr_t sh_pi_crbc_test_point_compare_regval; + struct { + mmr_t compare_mask : 32; + mmr_t compare_pattern : 32; + } sh_pi_crbc_test_point_compare_s; +} sh_pi_crbc_test_point_compare_u_t; +#else +typedef union sh_pi_crbc_test_point_compare_u { + mmr_t sh_pi_crbc_test_point_compare_regval; + struct { + mmr_t compare_pattern : 32; + mmr_t compare_mask : 32; + } sh_pi_crbc_test_point_compare_s; +} sh_pi_crbc_test_point_compare_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBC_TEST_POINT_SELECT" */ +/* PI CRBC Test Point Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbc_test_point_select_u { + mmr_t sh_pi_crbc_test_point_select_regval; + struct { + mmr_t nibble0_chiplet_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_chiplet_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_chiplet_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_chiplet_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_chiplet_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_chiplet_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_chiplet_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_chiplet_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t trigger_enable : 1; + } sh_pi_crbc_test_point_select_s; +} sh_pi_crbc_test_point_select_u_t; +#else +typedef union sh_pi_crbc_test_point_select_u { + mmr_t sh_pi_crbc_test_point_select_regval; + struct { + mmr_t trigger_enable : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_chiplet_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_chiplet_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_chiplet_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_chiplet_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_chiplet_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_chiplet_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_chiplet_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_chiplet_sel : 3; + } sh_pi_crbc_test_point_select_s; +} sh_pi_crbc_test_point_select_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT" */ +/* PI CRBC Test Point Trigger Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbc_test_point_trigger_select_u { + mmr_t sh_pi_crbc_test_point_trigger_select_regval; + struct { + mmr_t trigger0_chiplet_sel : 3; + mmr_t reserved_0 : 1; + mmr_t trigger0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t trigger1_chiplet_sel : 3; + mmr_t reserved_2 : 1; + mmr_t trigger1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t trigger2_chiplet_sel : 3; + mmr_t reserved_4 : 1; + mmr_t trigger2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t trigger3_chiplet_sel : 3; + mmr_t reserved_6 : 1; + mmr_t trigger3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t trigger4_chiplet_sel : 3; + mmr_t reserved_8 : 1; + mmr_t trigger4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t trigger5_chiplet_sel : 3; + mmr_t reserved_10 : 1; + mmr_t trigger5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t trigger6_chiplet_sel : 3; + mmr_t reserved_12 : 1; + mmr_t trigger6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t trigger7_chiplet_sel : 3; + mmr_t reserved_14 : 1; + mmr_t trigger7_nibble_sel : 3; + mmr_t reserved_15 : 1; + } sh_pi_crbc_test_point_trigger_select_s; +} sh_pi_crbc_test_point_trigger_select_u_t; +#else +typedef union sh_pi_crbc_test_point_trigger_select_u { + mmr_t sh_pi_crbc_test_point_trigger_select_regval; + struct { + mmr_t reserved_15 : 1; + mmr_t trigger7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t trigger7_chiplet_sel : 3; + mmr_t reserved_13 : 1; + mmr_t trigger6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t trigger6_chiplet_sel : 3; + mmr_t reserved_11 : 1; + mmr_t trigger5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t trigger5_chiplet_sel : 3; + mmr_t reserved_9 : 1; + mmr_t trigger4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t trigger4_chiplet_sel : 3; + mmr_t reserved_7 : 1; + mmr_t trigger3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t trigger3_chiplet_sel : 3; + mmr_t reserved_5 : 1; + mmr_t trigger2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t trigger2_chiplet_sel : 3; + mmr_t reserved_3 : 1; + mmr_t trigger1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t trigger1_chiplet_sel : 3; + mmr_t reserved_1 : 1; + mmr_t trigger0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t trigger0_chiplet_sel : 3; + } sh_pi_crbc_test_point_trigger_select_s; +} sh_pi_crbc_test_point_trigger_select_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_ERROR_MASK" */ +/* PI CRBP Error Mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbp_error_mask_u { + mmr_t sh_pi_crbp_error_mask_regval; + struct { + mmr_t fsb_proto_err : 1; + mmr_t gfx_rp_err : 1; + mmr_t xb_proto_err : 1; + mmr_t mem_rp_err : 1; + mmr_t pio_rp_err : 1; + mmr_t mem_to_err : 1; + mmr_t pio_to_err : 1; + mmr_t fsb_shub_uce : 1; + mmr_t fsb_shub_ce : 1; + mmr_t msg_color_err : 1; + mmr_t md_rq_q_oflow : 1; + mmr_t md_rp_q_oflow : 1; + mmr_t xn_rq_q_oflow : 1; + mmr_t xn_rp_q_oflow : 1; + mmr_t nack_oflow : 1; + mmr_t gfx_int_0 : 1; + mmr_t gfx_int_1 : 1; + mmr_t md_rq_crd_oflow : 1; + mmr_t md_rp_crd_oflow : 1; + mmr_t xn_rq_crd_oflow : 1; + mmr_t xn_rp_crd_oflow : 1; + mmr_t reserved_0 : 43; + } sh_pi_crbp_error_mask_s; +} sh_pi_crbp_error_mask_u_t; +#else +typedef union sh_pi_crbp_error_mask_u { + mmr_t sh_pi_crbp_error_mask_regval; + struct { + mmr_t reserved_0 : 43; + mmr_t xn_rp_crd_oflow : 1; + mmr_t xn_rq_crd_oflow : 1; + mmr_t md_rp_crd_oflow : 1; + mmr_t md_rq_crd_oflow : 1; + mmr_t gfx_int_1 : 1; + mmr_t gfx_int_0 : 1; + mmr_t nack_oflow : 1; + mmr_t xn_rp_q_oflow : 1; + mmr_t xn_rq_q_oflow : 1; + mmr_t md_rp_q_oflow : 1; + mmr_t md_rq_q_oflow : 1; + mmr_t msg_color_err : 1; + mmr_t fsb_shub_ce : 1; + mmr_t fsb_shub_uce : 1; + mmr_t pio_to_err : 1; + mmr_t mem_to_err : 1; + mmr_t pio_rp_err : 1; + mmr_t mem_rp_err : 1; + mmr_t xb_proto_err : 1; + mmr_t gfx_rp_err : 1; + mmr_t fsb_proto_err : 1; + } sh_pi_crbp_error_mask_s; +} sh_pi_crbp_error_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_FSB_PIPE_COMPARE" */ +/* CRBP FSB Pipe Compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbp_fsb_pipe_compare_u { + mmr_t sh_pi_crbp_fsb_pipe_compare_regval; + struct { + mmr_t compare_address : 47; + mmr_t compare_req : 6; + mmr_t reserved_0 : 11; + } sh_pi_crbp_fsb_pipe_compare_s; +} sh_pi_crbp_fsb_pipe_compare_u_t; +#else +typedef union sh_pi_crbp_fsb_pipe_compare_u { + mmr_t sh_pi_crbp_fsb_pipe_compare_regval; + struct { + mmr_t reserved_0 : 11; + mmr_t compare_req : 6; + mmr_t compare_address : 47; + } sh_pi_crbp_fsb_pipe_compare_s; +} sh_pi_crbp_fsb_pipe_compare_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_FSB_PIPE_MASK" */ +/* CRBP Compare Mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbp_fsb_pipe_mask_u { + mmr_t sh_pi_crbp_fsb_pipe_mask_regval; + struct { + mmr_t compare_address_mask : 47; + mmr_t compare_req_mask : 6; + mmr_t reserved_0 : 11; + } sh_pi_crbp_fsb_pipe_mask_s; +} sh_pi_crbp_fsb_pipe_mask_u_t; +#else +typedef union sh_pi_crbp_fsb_pipe_mask_u { + mmr_t sh_pi_crbp_fsb_pipe_mask_regval; + struct { + mmr_t reserved_0 : 11; + mmr_t compare_req_mask : 6; + mmr_t compare_address_mask : 47; + } sh_pi_crbp_fsb_pipe_mask_s; +} sh_pi_crbp_fsb_pipe_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_TEST_POINT_COMPARE" */ +/* PI CRBP Test Point Compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbp_test_point_compare_u { + mmr_t sh_pi_crbp_test_point_compare_regval; + struct { + mmr_t compare_mask : 32; + mmr_t compare_pattern : 32; + } sh_pi_crbp_test_point_compare_s; +} sh_pi_crbp_test_point_compare_u_t; +#else +typedef union sh_pi_crbp_test_point_compare_u { + mmr_t sh_pi_crbp_test_point_compare_regval; + struct { + mmr_t compare_pattern : 32; + mmr_t compare_mask : 32; + } sh_pi_crbp_test_point_compare_s; +} sh_pi_crbp_test_point_compare_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_TEST_POINT_SELECT" */ +/* PI CRBP Test Point Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbp_test_point_select_u { + mmr_t sh_pi_crbp_test_point_select_regval; + struct { + mmr_t nibble0_chiplet_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_chiplet_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_chiplet_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_chiplet_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_chiplet_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_chiplet_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_chiplet_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_chiplet_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t trigger_enable : 1; + } sh_pi_crbp_test_point_select_s; +} sh_pi_crbp_test_point_select_u_t; +#else +typedef union sh_pi_crbp_test_point_select_u { + mmr_t sh_pi_crbp_test_point_select_regval; + struct { + mmr_t trigger_enable : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_chiplet_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_chiplet_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_chiplet_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_chiplet_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_chiplet_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_chiplet_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_chiplet_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_chiplet_sel : 3; + } sh_pi_crbp_test_point_select_s; +} sh_pi_crbp_test_point_select_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT" */ +/* PI CRBP Test Point Trigger Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbp_test_point_trigger_select_u { + mmr_t sh_pi_crbp_test_point_trigger_select_regval; + struct { + mmr_t trigger0_chiplet_sel : 3; + mmr_t reserved_0 : 1; + mmr_t trigger0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t trigger1_chiplet_sel : 3; + mmr_t reserved_2 : 1; + mmr_t trigger1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t trigger2_chiplet_sel : 3; + mmr_t reserved_4 : 1; + mmr_t trigger2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t trigger3_chiplet_sel : 3; + mmr_t reserved_6 : 1; + mmr_t trigger3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t trigger4_chiplet_sel : 3; + mmr_t reserved_8 : 1; + mmr_t trigger4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t trigger5_chiplet_sel : 3; + mmr_t reserved_10 : 1; + mmr_t trigger5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t trigger6_chiplet_sel : 3; + mmr_t reserved_12 : 1; + mmr_t trigger6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t trigger7_chiplet_sel : 3; + mmr_t reserved_14 : 1; + mmr_t trigger7_nibble_sel : 3; + mmr_t reserved_15 : 1; + } sh_pi_crbp_test_point_trigger_select_s; +} sh_pi_crbp_test_point_trigger_select_u_t; +#else +typedef union sh_pi_crbp_test_point_trigger_select_u { + mmr_t sh_pi_crbp_test_point_trigger_select_regval; + struct { + mmr_t reserved_15 : 1; + mmr_t trigger7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t trigger7_chiplet_sel : 3; + mmr_t reserved_13 : 1; + mmr_t trigger6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t trigger6_chiplet_sel : 3; + mmr_t reserved_11 : 1; + mmr_t trigger5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t trigger5_chiplet_sel : 3; + mmr_t reserved_9 : 1; + mmr_t trigger4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t trigger4_chiplet_sel : 3; + mmr_t reserved_7 : 1; + mmr_t trigger3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t trigger3_chiplet_sel : 3; + mmr_t reserved_5 : 1; + mmr_t trigger2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t trigger2_chiplet_sel : 3; + mmr_t reserved_3 : 1; + mmr_t trigger1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t trigger1_chiplet_sel : 3; + mmr_t reserved_1 : 1; + mmr_t trigger0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t trigger0_chiplet_sel : 3; + } sh_pi_crbp_test_point_trigger_select_s; +} sh_pi_crbp_test_point_trigger_select_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_XB_PIPE_COMPARE_0" */ +/* CRBP XB Pipe Compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbp_xb_pipe_compare_0_u { + mmr_t sh_pi_crbp_xb_pipe_compare_0_regval; + struct { + mmr_t compare_address : 47; + mmr_t compare_command : 8; + mmr_t reserved_0 : 9; + } sh_pi_crbp_xb_pipe_compare_0_s; +} sh_pi_crbp_xb_pipe_compare_0_u_t; +#else +typedef union sh_pi_crbp_xb_pipe_compare_0_u { + mmr_t sh_pi_crbp_xb_pipe_compare_0_regval; + struct { + mmr_t reserved_0 : 9; + mmr_t compare_command : 8; + mmr_t compare_address : 47; + } sh_pi_crbp_xb_pipe_compare_0_s; +} sh_pi_crbp_xb_pipe_compare_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_XB_PIPE_COMPARE_1" */ +/* CRBP XB Pipe Compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbp_xb_pipe_compare_1_u { + mmr_t sh_pi_crbp_xb_pipe_compare_1_regval; + struct { + mmr_t compare_source : 14; + mmr_t reserved_0 : 2; + mmr_t compare_supplemental : 14; + mmr_t reserved_1 : 2; + mmr_t compare_echo : 9; + mmr_t reserved_2 : 23; + } sh_pi_crbp_xb_pipe_compare_1_s; +} sh_pi_crbp_xb_pipe_compare_1_u_t; +#else +typedef union sh_pi_crbp_xb_pipe_compare_1_u { + mmr_t sh_pi_crbp_xb_pipe_compare_1_regval; + struct { + mmr_t reserved_2 : 23; + mmr_t compare_echo : 9; + mmr_t reserved_1 : 2; + mmr_t compare_supplemental : 14; + mmr_t reserved_0 : 2; + mmr_t compare_source : 14; + } sh_pi_crbp_xb_pipe_compare_1_s; +} sh_pi_crbp_xb_pipe_compare_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_XB_PIPE_MASK_0" */ +/* CRBP Compare Mask Register 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbp_xb_pipe_mask_0_u { + mmr_t sh_pi_crbp_xb_pipe_mask_0_regval; + struct { + mmr_t compare_address_mask : 47; + mmr_t compare_command_mask : 8; + mmr_t reserved_0 : 9; + } sh_pi_crbp_xb_pipe_mask_0_s; +} sh_pi_crbp_xb_pipe_mask_0_u_t; +#else +typedef union sh_pi_crbp_xb_pipe_mask_0_u { + mmr_t sh_pi_crbp_xb_pipe_mask_0_regval; + struct { + mmr_t reserved_0 : 9; + mmr_t compare_command_mask : 8; + mmr_t compare_address_mask : 47; + } sh_pi_crbp_xb_pipe_mask_0_s; +} sh_pi_crbp_xb_pipe_mask_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_XB_PIPE_MASK_1" */ +/* CRBP XB Pipe Compare Mask Register 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbp_xb_pipe_mask_1_u { + mmr_t sh_pi_crbp_xb_pipe_mask_1_regval; + struct { + mmr_t compare_source_mask : 14; + mmr_t reserved_0 : 2; + mmr_t compare_supplemental_mask : 14; + mmr_t reserved_1 : 2; + mmr_t compare_echo_mask : 9; + mmr_t reserved_2 : 23; + } sh_pi_crbp_xb_pipe_mask_1_s; +} sh_pi_crbp_xb_pipe_mask_1_u_t; +#else +typedef union sh_pi_crbp_xb_pipe_mask_1_u { + mmr_t sh_pi_crbp_xb_pipe_mask_1_regval; + struct { + mmr_t reserved_2 : 23; + mmr_t compare_echo_mask : 9; + mmr_t reserved_1 : 2; + mmr_t compare_supplemental_mask : 14; + mmr_t reserved_0 : 2; + mmr_t compare_source_mask : 14; + } sh_pi_crbp_xb_pipe_mask_1_s; +} sh_pi_crbp_xb_pipe_mask_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_DPC_QUEUE_CONFIG" */ +/* DPC Queue Configuration */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_dpc_queue_config_u { + mmr_t sh_pi_dpc_queue_config_regval; + struct { + mmr_t dwcq_ae_level : 5; + mmr_t reserved_0 : 3; + mmr_t dwcq_af_thresh : 5; + mmr_t reserved_1 : 3; + mmr_t fwcq_ae_level : 5; + mmr_t reserved_2 : 3; + mmr_t fwcq_af_thresh : 5; + mmr_t reserved_3 : 35; + } sh_pi_dpc_queue_config_s; +} sh_pi_dpc_queue_config_u_t; +#else +typedef union sh_pi_dpc_queue_config_u { + mmr_t sh_pi_dpc_queue_config_regval; + struct { + mmr_t reserved_3 : 35; + mmr_t fwcq_af_thresh : 5; + mmr_t reserved_2 : 3; + mmr_t fwcq_ae_level : 5; + mmr_t reserved_1 : 3; + mmr_t dwcq_af_thresh : 5; + mmr_t reserved_0 : 3; + mmr_t dwcq_ae_level : 5; + } sh_pi_dpc_queue_config_s; +} sh_pi_dpc_queue_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_ERROR_MASK" */ +/* PI Error Mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_error_mask_u { + mmr_t sh_pi_error_mask_regval; + struct { + mmr_t fsb_proto_err : 1; + mmr_t gfx_rp_err : 1; + mmr_t xb_proto_err : 1; + mmr_t mem_rp_err : 1; + mmr_t pio_rp_err : 1; + mmr_t mem_to_err : 1; + mmr_t pio_to_err : 1; + mmr_t fsb_shub_uce : 1; + mmr_t fsb_shub_ce : 1; + mmr_t msg_color_err : 1; + mmr_t md_rq_q_oflow : 1; + mmr_t md_rp_q_oflow : 1; + mmr_t xn_rq_q_oflow : 1; + mmr_t xn_rp_q_oflow : 1; + mmr_t nack_oflow : 1; + mmr_t gfx_int_0 : 1; + mmr_t gfx_int_1 : 1; + mmr_t md_rq_crd_oflow : 1; + mmr_t md_rp_crd_oflow : 1; + mmr_t xn_rq_crd_oflow : 1; + mmr_t xn_rp_crd_oflow : 1; + mmr_t hung_bus : 1; + mmr_t rsp_parity : 1; + mmr_t ioq_overrun : 1; + mmr_t req_format : 1; + mmr_t addr_access : 1; + mmr_t req_parity : 1; + mmr_t addr_parity : 1; + mmr_t shub_fsb_dqe : 1; + mmr_t shub_fsb_uce : 1; + mmr_t shub_fsb_ce : 1; + mmr_t livelock : 1; + mmr_t bad_snoop : 1; + mmr_t fsb_tbl_miss : 1; + mmr_t msg_length : 1; + mmr_t reserved_0 : 29; + } sh_pi_error_mask_s; +} sh_pi_error_mask_u_t; +#else +typedef union sh_pi_error_mask_u { + mmr_t sh_pi_error_mask_regval; + struct { + mmr_t reserved_0 : 29; + mmr_t msg_length : 1; + mmr_t fsb_tbl_miss : 1; + mmr_t bad_snoop : 1; + mmr_t livelock : 1; + mmr_t shub_fsb_ce : 1; + mmr_t shub_fsb_uce : 1; + mmr_t shub_fsb_dqe : 1; + mmr_t addr_parity : 1; + mmr_t req_parity : 1; + mmr_t addr_access : 1; + mmr_t req_format : 1; + mmr_t ioq_overrun : 1; + mmr_t rsp_parity : 1; + mmr_t hung_bus : 1; + mmr_t xn_rp_crd_oflow : 1; + mmr_t xn_rq_crd_oflow : 1; + mmr_t md_rp_crd_oflow : 1; + mmr_t md_rq_crd_oflow : 1; + mmr_t gfx_int_1 : 1; + mmr_t gfx_int_0 : 1; + mmr_t nack_oflow : 1; + mmr_t xn_rp_q_oflow : 1; + mmr_t xn_rq_q_oflow : 1; + mmr_t md_rp_q_oflow : 1; + mmr_t md_rq_q_oflow : 1; + mmr_t msg_color_err : 1; + mmr_t fsb_shub_ce : 1; + mmr_t fsb_shub_uce : 1; + mmr_t pio_to_err : 1; + mmr_t mem_to_err : 1; + mmr_t pio_rp_err : 1; + mmr_t mem_rp_err : 1; + mmr_t xb_proto_err : 1; + mmr_t gfx_rp_err : 1; + mmr_t fsb_proto_err : 1; + } sh_pi_error_mask_s; +} sh_pi_error_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_EXPRESS_REPLY_CONFIG" */ +/* PI Express Reply Configuration */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_express_reply_config_u { + mmr_t sh_pi_express_reply_config_regval; + struct { + mmr_t mode : 3; + mmr_t reserved_0 : 61; + } sh_pi_express_reply_config_s; +} sh_pi_express_reply_config_u_t; +#else +typedef union sh_pi_express_reply_config_u { + mmr_t sh_pi_express_reply_config_regval; + struct { + mmr_t reserved_0 : 61; + mmr_t mode : 3; + } sh_pi_express_reply_config_s; +} sh_pi_express_reply_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_FSB_COMPARE_VALUE" */ +/* FSB Compare Value */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_fsb_compare_value_u { + mmr_t sh_pi_fsb_compare_value_regval; + struct { + mmr_t compare_value : 64; + } sh_pi_fsb_compare_value_s; +} sh_pi_fsb_compare_value_u_t; +#else +typedef union sh_pi_fsb_compare_value_u { + mmr_t sh_pi_fsb_compare_value_regval; + struct { + mmr_t compare_value : 64; + } sh_pi_fsb_compare_value_s; +} sh_pi_fsb_compare_value_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_FSB_COMPARE_MASK" */ +/* FSB Compare Mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_fsb_compare_mask_u { + mmr_t sh_pi_fsb_compare_mask_regval; + struct { + mmr_t mask_value : 64; + } sh_pi_fsb_compare_mask_s; +} sh_pi_fsb_compare_mask_u_t; +#else +typedef union sh_pi_fsb_compare_mask_u { + mmr_t sh_pi_fsb_compare_mask_regval; + struct { + mmr_t mask_value : 64; + } sh_pi_fsb_compare_mask_s; +} sh_pi_fsb_compare_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_FSB_ERROR_INJECTION" */ +/* Inject an Error onto the FSB */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_fsb_error_injection_u { + mmr_t sh_pi_fsb_error_injection_regval; + struct { + mmr_t rp_pe_to_fsb : 1; + mmr_t ap0_pe_to_fsb : 1; + mmr_t ap1_pe_to_fsb : 1; + mmr_t rsp_pe_to_fsb : 1; + mmr_t dw0_ce_to_fsb : 1; + mmr_t dw0_uce_to_fsb : 1; + mmr_t dw1_ce_to_fsb : 1; + mmr_t dw1_uce_to_fsb : 1; + mmr_t ip0_pe_to_fsb : 1; + mmr_t ip1_pe_to_fsb : 1; + mmr_t reserved_0 : 6; + mmr_t rp_pe_from_fsb : 1; + mmr_t ap0_pe_from_fsb : 1; + mmr_t ap1_pe_from_fsb : 1; + mmr_t rsp_pe_from_fsb : 1; + mmr_t dw0_ce_from_fsb : 1; + mmr_t dw0_uce_from_fsb : 1; + mmr_t dw1_ce_from_fsb : 1; + mmr_t dw1_uce_from_fsb : 1; + mmr_t dw2_ce_from_fsb : 1; + mmr_t dw2_uce_from_fsb : 1; + mmr_t dw3_ce_from_fsb : 1; + mmr_t dw3_uce_from_fsb : 1; + mmr_t reserved_1 : 4; + mmr_t ioq_overrun : 1; + mmr_t livelock : 1; + mmr_t bus_hang : 1; + mmr_t reserved_2 : 29; + } sh_pi_fsb_error_injection_s; +} sh_pi_fsb_error_injection_u_t; +#else +typedef union sh_pi_fsb_error_injection_u { + mmr_t sh_pi_fsb_error_injection_regval; + struct { + mmr_t reserved_2 : 29; + mmr_t bus_hang : 1; + mmr_t livelock : 1; + mmr_t ioq_overrun : 1; + mmr_t reserved_1 : 4; + mmr_t dw3_uce_from_fsb : 1; + mmr_t dw3_ce_from_fsb : 1; + mmr_t dw2_uce_from_fsb : 1; + mmr_t dw2_ce_from_fsb : 1; + mmr_t dw1_uce_from_fsb : 1; + mmr_t dw1_ce_from_fsb : 1; + mmr_t dw0_uce_from_fsb : 1; + mmr_t dw0_ce_from_fsb : 1; + mmr_t rsp_pe_from_fsb : 1; + mmr_t ap1_pe_from_fsb : 1; + mmr_t ap0_pe_from_fsb : 1; + mmr_t rp_pe_from_fsb : 1; + mmr_t reserved_0 : 6; + mmr_t ip1_pe_to_fsb : 1; + mmr_t ip0_pe_to_fsb : 1; + mmr_t dw1_uce_to_fsb : 1; + mmr_t dw1_ce_to_fsb : 1; + mmr_t dw0_uce_to_fsb : 1; + mmr_t dw0_ce_to_fsb : 1; + mmr_t rsp_pe_to_fsb : 1; + mmr_t ap1_pe_to_fsb : 1; + mmr_t ap0_pe_to_fsb : 1; + mmr_t rp_pe_to_fsb : 1; + } sh_pi_fsb_error_injection_s; +} sh_pi_fsb_error_injection_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_MD2PI_REPLY_VC_CONFIG" */ +/* MD-to-PI Reply Virtual Channel Configuration */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_md2pi_reply_vc_config_u { + mmr_t sh_pi_md2pi_reply_vc_config_regval; + struct { + mmr_t hdr_depth : 4; + mmr_t data_depth : 4; + mmr_t max_credits : 6; + mmr_t reserved_0 : 48; + mmr_t force_credit : 1; + mmr_t capture_credit_status : 1; + } sh_pi_md2pi_reply_vc_config_s; +} sh_pi_md2pi_reply_vc_config_u_t; +#else +typedef union sh_pi_md2pi_reply_vc_config_u { + mmr_t sh_pi_md2pi_reply_vc_config_regval; + struct { + mmr_t capture_credit_status : 1; + mmr_t force_credit : 1; + mmr_t reserved_0 : 48; + mmr_t max_credits : 6; + mmr_t data_depth : 4; + mmr_t hdr_depth : 4; + } sh_pi_md2pi_reply_vc_config_s; +} sh_pi_md2pi_reply_vc_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_MD2PI_REQUEST_VC_CONFIG" */ +/* MD-to-PI Request Virtual Channel Configuration */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_md2pi_request_vc_config_u { + mmr_t sh_pi_md2pi_request_vc_config_regval; + struct { + mmr_t hdr_depth : 4; + mmr_t data_depth : 4; + mmr_t max_credits : 6; + mmr_t reserved_0 : 48; + mmr_t force_credit : 1; + mmr_t capture_credit_status : 1; + } sh_pi_md2pi_request_vc_config_s; +} sh_pi_md2pi_request_vc_config_u_t; +#else +typedef union sh_pi_md2pi_request_vc_config_u { + mmr_t sh_pi_md2pi_request_vc_config_regval; + struct { + mmr_t capture_credit_status : 1; + mmr_t force_credit : 1; + mmr_t reserved_0 : 48; + mmr_t max_credits : 6; + mmr_t data_depth : 4; + mmr_t hdr_depth : 4; + } sh_pi_md2pi_request_vc_config_s; +} sh_pi_md2pi_request_vc_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_QUEUE_ERROR_INJECTION" */ +/* PI Queue Error Injection */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_queue_error_injection_u { + mmr_t sh_pi_queue_error_injection_regval; + struct { + mmr_t dat_dfr_q : 1; + mmr_t dxb_wtl_cmnd_q : 1; + mmr_t fsb_wtl_cmnd_q : 1; + mmr_t mdpi_rpy_bfr : 1; + mmr_t ptc_intr : 1; + mmr_t rxl_kill_q : 1; + mmr_t rxl_rdy_q : 1; + mmr_t xnpi_rpy_bfr : 1; + mmr_t reserved_0 : 56; + } sh_pi_queue_error_injection_s; +} sh_pi_queue_error_injection_u_t; +#else +typedef union sh_pi_queue_error_injection_u { + mmr_t sh_pi_queue_error_injection_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t xnpi_rpy_bfr : 1; + mmr_t rxl_rdy_q : 1; + mmr_t rxl_kill_q : 1; + mmr_t ptc_intr : 1; + mmr_t mdpi_rpy_bfr : 1; + mmr_t fsb_wtl_cmnd_q : 1; + mmr_t dxb_wtl_cmnd_q : 1; + mmr_t dat_dfr_q : 1; + } sh_pi_queue_error_injection_s; +} sh_pi_queue_error_injection_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_TEST_POINT_COMPARE" */ +/* PI Test Point Compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_test_point_compare_u { + mmr_t sh_pi_test_point_compare_regval; + struct { + mmr_t compare_mask : 32; + mmr_t compare_pattern : 32; + } sh_pi_test_point_compare_s; +} sh_pi_test_point_compare_u_t; +#else +typedef union sh_pi_test_point_compare_u { + mmr_t sh_pi_test_point_compare_regval; + struct { + mmr_t compare_pattern : 32; + mmr_t compare_mask : 32; + } sh_pi_test_point_compare_s; +} sh_pi_test_point_compare_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_TEST_POINT_SELECT" */ +/* PI Test Point Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_test_point_select_u { + mmr_t sh_pi_test_point_select_regval; + struct { + mmr_t nibble0_chiplet_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_chiplet_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_chiplet_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_chiplet_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_chiplet_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_chiplet_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_chiplet_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_chiplet_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t trigger_enable : 1; + } sh_pi_test_point_select_s; +} sh_pi_test_point_select_u_t; +#else +typedef union sh_pi_test_point_select_u { + mmr_t sh_pi_test_point_select_regval; + struct { + mmr_t trigger_enable : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_chiplet_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_chiplet_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_chiplet_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_chiplet_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_chiplet_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_chiplet_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_chiplet_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_chiplet_sel : 3; + } sh_pi_test_point_select_s; +} sh_pi_test_point_select_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_TEST_POINT_TRIGGER_SELECT" */ +/* PI Test Point Trigger Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_test_point_trigger_select_u { + mmr_t sh_pi_test_point_trigger_select_regval; + struct { + mmr_t trigger0_chiplet_sel : 3; + mmr_t reserved_0 : 1; + mmr_t trigger0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t trigger1_chiplet_sel : 3; + mmr_t reserved_2 : 1; + mmr_t trigger1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t trigger2_chiplet_sel : 3; + mmr_t reserved_4 : 1; + mmr_t trigger2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t trigger3_chiplet_sel : 3; + mmr_t reserved_6 : 1; + mmr_t trigger3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t trigger4_chiplet_sel : 3; + mmr_t reserved_8 : 1; + mmr_t trigger4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t trigger5_chiplet_sel : 3; + mmr_t reserved_10 : 1; + mmr_t trigger5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t trigger6_chiplet_sel : 3; + mmr_t reserved_12 : 1; + mmr_t trigger6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t trigger7_chiplet_sel : 3; + mmr_t reserved_14 : 1; + mmr_t trigger7_nibble_sel : 3; + mmr_t reserved_15 : 1; + } sh_pi_test_point_trigger_select_s; +} sh_pi_test_point_trigger_select_u_t; +#else +typedef union sh_pi_test_point_trigger_select_u { + mmr_t sh_pi_test_point_trigger_select_regval; + struct { + mmr_t reserved_15 : 1; + mmr_t trigger7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t trigger7_chiplet_sel : 3; + mmr_t reserved_13 : 1; + mmr_t trigger6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t trigger6_chiplet_sel : 3; + mmr_t reserved_11 : 1; + mmr_t trigger5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t trigger5_chiplet_sel : 3; + mmr_t reserved_9 : 1; + mmr_t trigger4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t trigger4_chiplet_sel : 3; + mmr_t reserved_7 : 1; + mmr_t trigger3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t trigger3_chiplet_sel : 3; + mmr_t reserved_5 : 1; + mmr_t trigger2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t trigger2_chiplet_sel : 3; + mmr_t reserved_3 : 1; + mmr_t trigger1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t trigger1_chiplet_sel : 3; + mmr_t reserved_1 : 1; + mmr_t trigger0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t trigger0_chiplet_sel : 3; + } sh_pi_test_point_trigger_select_s; +} sh_pi_test_point_trigger_select_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_XN2PI_REPLY_VC_CONFIG" */ +/* XN-to-PI Reply Virtual Channel Configuration */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_xn2pi_reply_vc_config_u { + mmr_t sh_pi_xn2pi_reply_vc_config_regval; + struct { + mmr_t hdr_depth : 4; + mmr_t data_depth : 4; + mmr_t max_credits : 6; + mmr_t reserved_0 : 48; + mmr_t force_credit : 1; + mmr_t capture_credit_status : 1; + } sh_pi_xn2pi_reply_vc_config_s; +} sh_pi_xn2pi_reply_vc_config_u_t; +#else +typedef union sh_pi_xn2pi_reply_vc_config_u { + mmr_t sh_pi_xn2pi_reply_vc_config_regval; + struct { + mmr_t capture_credit_status : 1; + mmr_t force_credit : 1; + mmr_t reserved_0 : 48; + mmr_t max_credits : 6; + mmr_t data_depth : 4; + mmr_t hdr_depth : 4; + } sh_pi_xn2pi_reply_vc_config_s; +} sh_pi_xn2pi_reply_vc_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_XN2PI_REQUEST_VC_CONFIG" */ +/* XN-to-PI Request Virtual Channel Configuration */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_xn2pi_request_vc_config_u { + mmr_t sh_pi_xn2pi_request_vc_config_regval; + struct { + mmr_t hdr_depth : 4; + mmr_t data_depth : 4; + mmr_t max_credits : 6; + mmr_t reserved_0 : 48; + mmr_t force_credit : 1; + mmr_t capture_credit_status : 1; + } sh_pi_xn2pi_request_vc_config_s; +} sh_pi_xn2pi_request_vc_config_u_t; +#else +typedef union sh_pi_xn2pi_request_vc_config_u { + mmr_t sh_pi_xn2pi_request_vc_config_regval; + struct { + mmr_t capture_credit_status : 1; + mmr_t force_credit : 1; + mmr_t reserved_0 : 48; + mmr_t max_credits : 6; + mmr_t data_depth : 4; + mmr_t hdr_depth : 4; + } sh_pi_xn2pi_request_vc_config_s; +} sh_pi_xn2pi_request_vc_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_AEC_STATUS" */ +/* PI Adaptive Error Correction Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_aec_status_u { + mmr_t sh_pi_aec_status_regval; + struct { + mmr_t state : 3; + mmr_t reserved_0 : 61; + } sh_pi_aec_status_s; +} sh_pi_aec_status_u_t; +#else +typedef union sh_pi_aec_status_u { + mmr_t sh_pi_aec_status_regval; + struct { + mmr_t reserved_0 : 61; + mmr_t state : 3; + } sh_pi_aec_status_s; +} sh_pi_aec_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_AFI_FIRST_ERROR" */ +/* PI AFI First Error */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_afi_first_error_u { + mmr_t sh_pi_afi_first_error_regval; + struct { + mmr_t reserved_0 : 7; + mmr_t fsb_shub_uce : 1; + mmr_t fsb_shub_ce : 1; + mmr_t reserved_1 : 12; + mmr_t hung_bus : 1; + mmr_t rsp_parity : 1; + mmr_t ioq_overrun : 1; + mmr_t req_format : 1; + mmr_t addr_access : 1; + mmr_t req_parity : 1; + mmr_t addr_parity : 1; + mmr_t shub_fsb_dqe : 1; + mmr_t shub_fsb_uce : 1; + mmr_t shub_fsb_ce : 1; + mmr_t livelock : 1; + mmr_t bad_snoop : 1; + mmr_t fsb_tbl_miss : 1; + mmr_t msg_len : 1; + mmr_t reserved_2 : 29; + } sh_pi_afi_first_error_s; +} sh_pi_afi_first_error_u_t; +#else +typedef union sh_pi_afi_first_error_u { + mmr_t sh_pi_afi_first_error_regval; + struct { + mmr_t reserved_2 : 29; + mmr_t msg_len : 1; + mmr_t fsb_tbl_miss : 1; + mmr_t bad_snoop : 1; + mmr_t livelock : 1; + mmr_t shub_fsb_ce : 1; + mmr_t shub_fsb_uce : 1; + mmr_t shub_fsb_dqe : 1; + mmr_t addr_parity : 1; + mmr_t req_parity : 1; + mmr_t addr_access : 1; + mmr_t req_format : 1; + mmr_t ioq_overrun : 1; + mmr_t rsp_parity : 1; + mmr_t hung_bus : 1; + mmr_t reserved_1 : 12; + mmr_t fsb_shub_ce : 1; + mmr_t fsb_shub_uce : 1; + mmr_t reserved_0 : 7; + } sh_pi_afi_first_error_s; +} sh_pi_afi_first_error_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CAM_ADDRESS_READ_DATA" */ +/* CRB CAM MMR Address Read Data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_cam_address_read_data_u { + mmr_t sh_pi_cam_address_read_data_regval; + struct { + mmr_t cam_addr : 48; + mmr_t reserved_0 : 15; + mmr_t cam_addr_val : 1; + } sh_pi_cam_address_read_data_s; +} sh_pi_cam_address_read_data_u_t; +#else +typedef union sh_pi_cam_address_read_data_u { + mmr_t sh_pi_cam_address_read_data_regval; + struct { + mmr_t cam_addr_val : 1; + mmr_t reserved_0 : 15; + mmr_t cam_addr : 48; + } sh_pi_cam_address_read_data_s; +} sh_pi_cam_address_read_data_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CAM_LPRA_READ_DATA" */ +/* CRB CAM MMR LPRA Read Data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_cam_lpra_read_data_u { + mmr_t sh_pi_cam_lpra_read_data_regval; + struct { + mmr_t cam_lpra : 64; + } sh_pi_cam_lpra_read_data_s; +} sh_pi_cam_lpra_read_data_u_t; +#else +typedef union sh_pi_cam_lpra_read_data_u { + mmr_t sh_pi_cam_lpra_read_data_regval; + struct { + mmr_t cam_lpra : 64; + } sh_pi_cam_lpra_read_data_s; +} sh_pi_cam_lpra_read_data_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CAM_STATE_READ_DATA" */ +/* CRB CAM MMR State Read Data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_cam_state_read_data_u { + mmr_t sh_pi_cam_state_read_data_regval; + struct { + mmr_t cam_state : 4; + mmr_t cam_to : 1; + mmr_t cam_state_rd_pend : 1; + mmr_t reserved_0 : 26; + mmr_t cam_lpra : 18; + mmr_t reserved_1 : 13; + mmr_t cam_rd_data_val : 1; + } sh_pi_cam_state_read_data_s; +} sh_pi_cam_state_read_data_u_t; +#else +typedef union sh_pi_cam_state_read_data_u { + mmr_t sh_pi_cam_state_read_data_regval; + struct { + mmr_t cam_rd_data_val : 1; + mmr_t reserved_1 : 13; + mmr_t cam_lpra : 18; + mmr_t reserved_0 : 26; + mmr_t cam_state_rd_pend : 1; + mmr_t cam_to : 1; + mmr_t cam_state : 4; + } sh_pi_cam_state_read_data_s; +} sh_pi_cam_state_read_data_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CORRECTED_DETAIL_1" */ +/* PI Corrected Error Detail */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_corrected_detail_1_u { + mmr_t sh_pi_corrected_detail_1_regval; + struct { + mmr_t address : 48; + mmr_t syndrome : 8; + mmr_t dep : 8; + } sh_pi_corrected_detail_1_s; +} sh_pi_corrected_detail_1_u_t; +#else +typedef union sh_pi_corrected_detail_1_u { + mmr_t sh_pi_corrected_detail_1_regval; + struct { + mmr_t dep : 8; + mmr_t syndrome : 8; + mmr_t address : 48; + } sh_pi_corrected_detail_1_s; +} sh_pi_corrected_detail_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CORRECTED_DETAIL_2" */ +/* PI Corrected Error Detail 2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_corrected_detail_2_u { + mmr_t sh_pi_corrected_detail_2_regval; + struct { + mmr_t data : 64; + } sh_pi_corrected_detail_2_s; +} sh_pi_corrected_detail_2_u_t; +#else +typedef union sh_pi_corrected_detail_2_u { + mmr_t sh_pi_corrected_detail_2_regval; + struct { + mmr_t data : 64; + } sh_pi_corrected_detail_2_s; +} sh_pi_corrected_detail_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CORRECTED_DETAIL_3" */ +/* PI Corrected Error Detail 3 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_corrected_detail_3_u { + mmr_t sh_pi_corrected_detail_3_regval; + struct { + mmr_t address : 48; + mmr_t syndrome : 8; + mmr_t dep : 8; + } sh_pi_corrected_detail_3_s; +} sh_pi_corrected_detail_3_u_t; +#else +typedef union sh_pi_corrected_detail_3_u { + mmr_t sh_pi_corrected_detail_3_regval; + struct { + mmr_t dep : 8; + mmr_t syndrome : 8; + mmr_t address : 48; + } sh_pi_corrected_detail_3_s; +} sh_pi_corrected_detail_3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CORRECTED_DETAIL_4" */ +/* PI Corrected Error Detail 4 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_corrected_detail_4_u { + mmr_t sh_pi_corrected_detail_4_regval; + struct { + mmr_t data : 64; + } sh_pi_corrected_detail_4_s; +} sh_pi_corrected_detail_4_u_t; +#else +typedef union sh_pi_corrected_detail_4_u { + mmr_t sh_pi_corrected_detail_4_regval; + struct { + mmr_t data : 64; + } sh_pi_corrected_detail_4_s; +} sh_pi_corrected_detail_4_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_CRBP_FIRST_ERROR" */ +/* PI CRBP First Error */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_crbp_first_error_u { + mmr_t sh_pi_crbp_first_error_regval; + struct { + mmr_t fsb_proto_err : 1; + mmr_t gfx_rp_err : 1; + mmr_t xb_proto_err : 1; + mmr_t mem_rp_err : 1; + mmr_t pio_rp_err : 1; + mmr_t mem_to_err : 1; + mmr_t pio_to_err : 1; + mmr_t fsb_shub_uce : 1; + mmr_t fsb_shub_ce : 1; + mmr_t msg_color_err : 1; + mmr_t md_rq_q_oflow : 1; + mmr_t md_rp_q_oflow : 1; + mmr_t xn_rq_q_oflow : 1; + mmr_t xn_rp_q_oflow : 1; + mmr_t nack_oflow : 1; + mmr_t gfx_int_0 : 1; + mmr_t gfx_int_1 : 1; + mmr_t md_rq_crd_oflow : 1; + mmr_t md_rp_crd_oflow : 1; + mmr_t xn_rq_crd_oflow : 1; + mmr_t xn_rp_crd_oflow : 1; + mmr_t reserved_0 : 43; + } sh_pi_crbp_first_error_s; +} sh_pi_crbp_first_error_u_t; +#else +typedef union sh_pi_crbp_first_error_u { + mmr_t sh_pi_crbp_first_error_regval; + struct { + mmr_t reserved_0 : 43; + mmr_t xn_rp_crd_oflow : 1; + mmr_t xn_rq_crd_oflow : 1; + mmr_t md_rp_crd_oflow : 1; + mmr_t md_rq_crd_oflow : 1; + mmr_t gfx_int_1 : 1; + mmr_t gfx_int_0 : 1; + mmr_t nack_oflow : 1; + mmr_t xn_rp_q_oflow : 1; + mmr_t xn_rq_q_oflow : 1; + mmr_t md_rp_q_oflow : 1; + mmr_t md_rq_q_oflow : 1; + mmr_t msg_color_err : 1; + mmr_t fsb_shub_ce : 1; + mmr_t fsb_shub_uce : 1; + mmr_t pio_to_err : 1; + mmr_t mem_to_err : 1; + mmr_t pio_rp_err : 1; + mmr_t mem_rp_err : 1; + mmr_t xb_proto_err : 1; + mmr_t gfx_rp_err : 1; + mmr_t fsb_proto_err : 1; + } sh_pi_crbp_first_error_s; +} sh_pi_crbp_first_error_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_ERROR_DETAIL_1" */ +/* PI Error Detail 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_error_detail_1_u { + mmr_t sh_pi_error_detail_1_regval; + struct { + mmr_t status : 64; + } sh_pi_error_detail_1_s; +} sh_pi_error_detail_1_u_t; +#else +typedef union sh_pi_error_detail_1_u { + mmr_t sh_pi_error_detail_1_regval; + struct { + mmr_t status : 64; + } sh_pi_error_detail_1_s; +} sh_pi_error_detail_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_ERROR_DETAIL_2" */ +/* PI Error Detail 2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_error_detail_2_u { + mmr_t sh_pi_error_detail_2_regval; + struct { + mmr_t status : 64; + } sh_pi_error_detail_2_s; +} sh_pi_error_detail_2_u_t; +#else +typedef union sh_pi_error_detail_2_u { + mmr_t sh_pi_error_detail_2_regval; + struct { + mmr_t status : 64; + } sh_pi_error_detail_2_s; +} sh_pi_error_detail_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_ERROR_OVERFLOW" */ +/* PI Error Overflow */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_error_overflow_u { + mmr_t sh_pi_error_overflow_regval; + struct { + mmr_t fsb_proto_err : 1; + mmr_t gfx_rp_err : 1; + mmr_t xb_proto_err : 1; + mmr_t mem_rp_err : 1; + mmr_t pio_rp_err : 1; + mmr_t mem_to_err : 1; + mmr_t pio_to_err : 1; + mmr_t fsb_shub_uce : 1; + mmr_t fsb_shub_ce : 1; + mmr_t msg_color_err : 1; + mmr_t md_rq_q_oflow : 1; + mmr_t md_rp_q_oflow : 1; + mmr_t xn_rq_q_oflow : 1; + mmr_t xn_rp_q_oflow : 1; + mmr_t nack_oflow : 1; + mmr_t gfx_int_0 : 1; + mmr_t gfx_int_1 : 1; + mmr_t md_rq_crd_oflow : 1; + mmr_t md_rp_crd_oflow : 1; + mmr_t xn_rq_crd_oflow : 1; + mmr_t xn_rp_crd_oflow : 1; + mmr_t hung_bus : 1; + mmr_t rsp_parity : 1; + mmr_t ioq_overrun : 1; + mmr_t req_format : 1; + mmr_t addr_access : 1; + mmr_t req_parity : 1; + mmr_t addr_parity : 1; + mmr_t shub_fsb_dqe : 1; + mmr_t shub_fsb_uce : 1; + mmr_t shub_fsb_ce : 1; + mmr_t livelock : 1; + mmr_t bad_snoop : 1; + mmr_t fsb_tbl_miss : 1; + mmr_t msg_length : 1; + mmr_t reserved_0 : 29; + } sh_pi_error_overflow_s; +} sh_pi_error_overflow_u_t; +#else +typedef union sh_pi_error_overflow_u { + mmr_t sh_pi_error_overflow_regval; + struct { + mmr_t reserved_0 : 29; + mmr_t msg_length : 1; + mmr_t fsb_tbl_miss : 1; + mmr_t bad_snoop : 1; + mmr_t livelock : 1; + mmr_t shub_fsb_ce : 1; + mmr_t shub_fsb_uce : 1; + mmr_t shub_fsb_dqe : 1; + mmr_t addr_parity : 1; + mmr_t req_parity : 1; + mmr_t addr_access : 1; + mmr_t req_format : 1; + mmr_t ioq_overrun : 1; + mmr_t rsp_parity : 1; + mmr_t hung_bus : 1; + mmr_t xn_rp_crd_oflow : 1; + mmr_t xn_rq_crd_oflow : 1; + mmr_t md_rp_crd_oflow : 1; + mmr_t md_rq_crd_oflow : 1; + mmr_t gfx_int_1 : 1; + mmr_t gfx_int_0 : 1; + mmr_t nack_oflow : 1; + mmr_t xn_rp_q_oflow : 1; + mmr_t xn_rq_q_oflow : 1; + mmr_t md_rp_q_oflow : 1; + mmr_t md_rq_q_oflow : 1; + mmr_t msg_color_err : 1; + mmr_t fsb_shub_ce : 1; + mmr_t fsb_shub_uce : 1; + mmr_t pio_to_err : 1; + mmr_t mem_to_err : 1; + mmr_t pio_rp_err : 1; + mmr_t mem_rp_err : 1; + mmr_t xb_proto_err : 1; + mmr_t gfx_rp_err : 1; + mmr_t fsb_proto_err : 1; + } sh_pi_error_overflow_s; +} sh_pi_error_overflow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_ERROR_SUMMARY" */ +/* PI Error Summary */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_error_summary_u { + mmr_t sh_pi_error_summary_regval; + struct { + mmr_t fsb_proto_err : 1; + mmr_t gfx_rp_err : 1; + mmr_t xb_proto_err : 1; + mmr_t mem_rp_err : 1; + mmr_t pio_rp_err : 1; + mmr_t mem_to_err : 1; + mmr_t pio_to_err : 1; + mmr_t fsb_shub_uce : 1; + mmr_t fsb_shub_ce : 1; + mmr_t msg_color_err : 1; + mmr_t md_rq_q_oflow : 1; + mmr_t md_rp_q_oflow : 1; + mmr_t xn_rq_q_oflow : 1; + mmr_t xn_rp_q_oflow : 1; + mmr_t nack_oflow : 1; + mmr_t gfx_int_0 : 1; + mmr_t gfx_int_1 : 1; + mmr_t md_rq_crd_oflow : 1; + mmr_t md_rp_crd_oflow : 1; + mmr_t xn_rq_crd_oflow : 1; + mmr_t xn_rp_crd_oflow : 1; + mmr_t hung_bus : 1; + mmr_t rsp_parity : 1; + mmr_t ioq_overrun : 1; + mmr_t req_format : 1; + mmr_t addr_access : 1; + mmr_t req_parity : 1; + mmr_t addr_parity : 1; + mmr_t shub_fsb_dqe : 1; + mmr_t shub_fsb_uce : 1; + mmr_t shub_fsb_ce : 1; + mmr_t livelock : 1; + mmr_t bad_snoop : 1; + mmr_t fsb_tbl_miss : 1; + mmr_t msg_length : 1; + mmr_t reserved_0 : 29; + } sh_pi_error_summary_s; +} sh_pi_error_summary_u_t; +#else +typedef union sh_pi_error_summary_u { + mmr_t sh_pi_error_summary_regval; + struct { + mmr_t reserved_0 : 29; + mmr_t msg_length : 1; + mmr_t fsb_tbl_miss : 1; + mmr_t bad_snoop : 1; + mmr_t livelock : 1; + mmr_t shub_fsb_ce : 1; + mmr_t shub_fsb_uce : 1; + mmr_t shub_fsb_dqe : 1; + mmr_t addr_parity : 1; + mmr_t req_parity : 1; + mmr_t addr_access : 1; + mmr_t req_format : 1; + mmr_t ioq_overrun : 1; + mmr_t rsp_parity : 1; + mmr_t hung_bus : 1; + mmr_t xn_rp_crd_oflow : 1; + mmr_t xn_rq_crd_oflow : 1; + mmr_t md_rp_crd_oflow : 1; + mmr_t md_rq_crd_oflow : 1; + mmr_t gfx_int_1 : 1; + mmr_t gfx_int_0 : 1; + mmr_t nack_oflow : 1; + mmr_t xn_rp_q_oflow : 1; + mmr_t xn_rq_q_oflow : 1; + mmr_t md_rp_q_oflow : 1; + mmr_t md_rq_q_oflow : 1; + mmr_t msg_color_err : 1; + mmr_t fsb_shub_ce : 1; + mmr_t fsb_shub_uce : 1; + mmr_t pio_to_err : 1; + mmr_t mem_to_err : 1; + mmr_t pio_rp_err : 1; + mmr_t mem_rp_err : 1; + mmr_t xb_proto_err : 1; + mmr_t gfx_rp_err : 1; + mmr_t fsb_proto_err : 1; + } sh_pi_error_summary_s; +} sh_pi_error_summary_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_EXPRESS_REPLY_STATUS" */ +/* PI Express Reply Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_express_reply_status_u { + mmr_t sh_pi_express_reply_status_regval; + struct { + mmr_t state : 3; + mmr_t reserved_0 : 61; + } sh_pi_express_reply_status_s; +} sh_pi_express_reply_status_u_t; +#else +typedef union sh_pi_express_reply_status_u { + mmr_t sh_pi_express_reply_status_regval; + struct { + mmr_t reserved_0 : 61; + mmr_t state : 3; + } sh_pi_express_reply_status_s; +} sh_pi_express_reply_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_FIRST_ERROR" */ +/* PI First Error */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_first_error_u { + mmr_t sh_pi_first_error_regval; + struct { + mmr_t fsb_proto_err : 1; + mmr_t gfx_rp_err : 1; + mmr_t xb_proto_err : 1; + mmr_t mem_rp_err : 1; + mmr_t pio_rp_err : 1; + mmr_t mem_to_err : 1; + mmr_t pio_to_err : 1; + mmr_t fsb_shub_uce : 1; + mmr_t fsb_shub_ce : 1; + mmr_t msg_color_err : 1; + mmr_t md_rq_q_oflow : 1; + mmr_t md_rp_q_oflow : 1; + mmr_t xn_rq_q_oflow : 1; + mmr_t xn_rp_q_oflow : 1; + mmr_t nack_oflow : 1; + mmr_t gfx_int_0 : 1; + mmr_t gfx_int_1 : 1; + mmr_t md_rq_crd_oflow : 1; + mmr_t md_rp_crd_oflow : 1; + mmr_t xn_rq_crd_oflow : 1; + mmr_t xn_rp_crd_oflow : 1; + mmr_t hung_bus : 1; + mmr_t rsp_parity : 1; + mmr_t ioq_overrun : 1; + mmr_t req_format : 1; + mmr_t addr_access : 1; + mmr_t req_parity : 1; + mmr_t addr_parity : 1; + mmr_t shub_fsb_dqe : 1; + mmr_t shub_fsb_uce : 1; + mmr_t shub_fsb_ce : 1; + mmr_t livelock : 1; + mmr_t bad_snoop : 1; + mmr_t fsb_tbl_miss : 1; + mmr_t msg_length : 1; + mmr_t reserved_0 : 29; + } sh_pi_first_error_s; +} sh_pi_first_error_u_t; +#else +typedef union sh_pi_first_error_u { + mmr_t sh_pi_first_error_regval; + struct { + mmr_t reserved_0 : 29; + mmr_t msg_length : 1; + mmr_t fsb_tbl_miss : 1; + mmr_t bad_snoop : 1; + mmr_t livelock : 1; + mmr_t shub_fsb_ce : 1; + mmr_t shub_fsb_uce : 1; + mmr_t shub_fsb_dqe : 1; + mmr_t addr_parity : 1; + mmr_t req_parity : 1; + mmr_t addr_access : 1; + mmr_t req_format : 1; + mmr_t ioq_overrun : 1; + mmr_t rsp_parity : 1; + mmr_t hung_bus : 1; + mmr_t xn_rp_crd_oflow : 1; + mmr_t xn_rq_crd_oflow : 1; + mmr_t md_rp_crd_oflow : 1; + mmr_t md_rq_crd_oflow : 1; + mmr_t gfx_int_1 : 1; + mmr_t gfx_int_0 : 1; + mmr_t nack_oflow : 1; + mmr_t xn_rp_q_oflow : 1; + mmr_t xn_rq_q_oflow : 1; + mmr_t md_rp_q_oflow : 1; + mmr_t md_rq_q_oflow : 1; + mmr_t msg_color_err : 1; + mmr_t fsb_shub_ce : 1; + mmr_t fsb_shub_uce : 1; + mmr_t pio_to_err : 1; + mmr_t mem_to_err : 1; + mmr_t pio_rp_err : 1; + mmr_t mem_rp_err : 1; + mmr_t xb_proto_err : 1; + mmr_t gfx_rp_err : 1; + mmr_t fsb_proto_err : 1; + } sh_pi_first_error_s; +} sh_pi_first_error_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_PI2MD_REPLY_VC_STATUS" */ +/* PI-to-MD Reply Virtual Channel Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_pi2md_reply_vc_status_u { + mmr_t sh_pi_pi2md_reply_vc_status_regval; + struct { + mmr_t output_crd_stat : 6; + mmr_t reserved_0 : 58; + } sh_pi_pi2md_reply_vc_status_s; +} sh_pi_pi2md_reply_vc_status_u_t; +#else +typedef union sh_pi_pi2md_reply_vc_status_u { + mmr_t sh_pi_pi2md_reply_vc_status_regval; + struct { + mmr_t reserved_0 : 58; + mmr_t output_crd_stat : 6; + } sh_pi_pi2md_reply_vc_status_s; +} sh_pi_pi2md_reply_vc_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_PI2MD_REQUEST_VC_STATUS" */ +/* PI-to-MD Request Virtual Channel Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_pi2md_request_vc_status_u { + mmr_t sh_pi_pi2md_request_vc_status_regval; + struct { + mmr_t output_crd_stat : 6; + mmr_t reserved_0 : 58; + } sh_pi_pi2md_request_vc_status_s; +} sh_pi_pi2md_request_vc_status_u_t; +#else +typedef union sh_pi_pi2md_request_vc_status_u { + mmr_t sh_pi_pi2md_request_vc_status_regval; + struct { + mmr_t reserved_0 : 58; + mmr_t output_crd_stat : 6; + } sh_pi_pi2md_request_vc_status_s; +} sh_pi_pi2md_request_vc_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_PI2XN_REPLY_VC_STATUS" */ +/* PI-to-XN Reply Virtual Channel Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_pi2xn_reply_vc_status_u { + mmr_t sh_pi_pi2xn_reply_vc_status_regval; + struct { + mmr_t output_crd_stat : 6; + mmr_t reserved_0 : 58; + } sh_pi_pi2xn_reply_vc_status_s; +} sh_pi_pi2xn_reply_vc_status_u_t; +#else +typedef union sh_pi_pi2xn_reply_vc_status_u { + mmr_t sh_pi_pi2xn_reply_vc_status_regval; + struct { + mmr_t reserved_0 : 58; + mmr_t output_crd_stat : 6; + } sh_pi_pi2xn_reply_vc_status_s; +} sh_pi_pi2xn_reply_vc_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_PI2XN_REQUEST_VC_STATUS" */ +/* PI-to-XN Request Virtual Channel Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_pi2xn_request_vc_status_u { + mmr_t sh_pi_pi2xn_request_vc_status_regval; + struct { + mmr_t output_crd_stat : 6; + mmr_t reserved_0 : 58; + } sh_pi_pi2xn_request_vc_status_s; +} sh_pi_pi2xn_request_vc_status_u_t; +#else +typedef union sh_pi_pi2xn_request_vc_status_u { + mmr_t sh_pi_pi2xn_request_vc_status_regval; + struct { + mmr_t reserved_0 : 58; + mmr_t output_crd_stat : 6; + } sh_pi_pi2xn_request_vc_status_s; +} sh_pi_pi2xn_request_vc_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_UNCORRECTED_DETAIL_1" */ +/* PI Uncorrected Error Detail 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_uncorrected_detail_1_u { + mmr_t sh_pi_uncorrected_detail_1_regval; + struct { + mmr_t address : 48; + mmr_t syndrome : 8; + mmr_t dep : 8; + } sh_pi_uncorrected_detail_1_s; +} sh_pi_uncorrected_detail_1_u_t; +#else +typedef union sh_pi_uncorrected_detail_1_u { + mmr_t sh_pi_uncorrected_detail_1_regval; + struct { + mmr_t dep : 8; + mmr_t syndrome : 8; + mmr_t address : 48; + } sh_pi_uncorrected_detail_1_s; +} sh_pi_uncorrected_detail_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_UNCORRECTED_DETAIL_2" */ +/* PI Uncorrected Error Detail 2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_uncorrected_detail_2_u { + mmr_t sh_pi_uncorrected_detail_2_regval; + struct { + mmr_t data : 64; + } sh_pi_uncorrected_detail_2_s; +} sh_pi_uncorrected_detail_2_u_t; +#else +typedef union sh_pi_uncorrected_detail_2_u { + mmr_t sh_pi_uncorrected_detail_2_regval; + struct { + mmr_t data : 64; + } sh_pi_uncorrected_detail_2_s; +} sh_pi_uncorrected_detail_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_UNCORRECTED_DETAIL_3" */ +/* PI Uncorrected Error Detail 3 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_uncorrected_detail_3_u { + mmr_t sh_pi_uncorrected_detail_3_regval; + struct { + mmr_t address : 48; + mmr_t syndrome : 8; + mmr_t dep : 8; + } sh_pi_uncorrected_detail_3_s; +} sh_pi_uncorrected_detail_3_u_t; +#else +typedef union sh_pi_uncorrected_detail_3_u { + mmr_t sh_pi_uncorrected_detail_3_regval; + struct { + mmr_t dep : 8; + mmr_t syndrome : 8; + mmr_t address : 48; + } sh_pi_uncorrected_detail_3_s; +} sh_pi_uncorrected_detail_3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_UNCORRECTED_DETAIL_4" */ +/* PI Uncorrected Error Detail 4 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_uncorrected_detail_4_u { + mmr_t sh_pi_uncorrected_detail_4_regval; + struct { + mmr_t data : 64; + } sh_pi_uncorrected_detail_4_s; +} sh_pi_uncorrected_detail_4_u_t; +#else +typedef union sh_pi_uncorrected_detail_4_u { + mmr_t sh_pi_uncorrected_detail_4_regval; + struct { + mmr_t data : 64; + } sh_pi_uncorrected_detail_4_s; +} sh_pi_uncorrected_detail_4_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_MD2PI_REPLY_VC_STATUS" */ +/* MD-to-PI Reply Virtual Channel Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_md2pi_reply_vc_status_u { + mmr_t sh_pi_md2pi_reply_vc_status_regval; + struct { + mmr_t input_hdr_crd_stat : 4; + mmr_t input_dat_crd_stat : 4; + mmr_t input_queue_stat : 4; + mmr_t reserved_0 : 52; + } sh_pi_md2pi_reply_vc_status_s; +} sh_pi_md2pi_reply_vc_status_u_t; +#else +typedef union sh_pi_md2pi_reply_vc_status_u { + mmr_t sh_pi_md2pi_reply_vc_status_regval; + struct { + mmr_t reserved_0 : 52; + mmr_t input_queue_stat : 4; + mmr_t input_dat_crd_stat : 4; + mmr_t input_hdr_crd_stat : 4; + } sh_pi_md2pi_reply_vc_status_s; +} sh_pi_md2pi_reply_vc_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_MD2PI_REQUEST_VC_STATUS" */ +/* MD-to-PI Request Virtual Channel Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_md2pi_request_vc_status_u { + mmr_t sh_pi_md2pi_request_vc_status_regval; + struct { + mmr_t input_hdr_crd_stat : 4; + mmr_t input_dat_crd_stat : 4; + mmr_t input_queue_stat : 4; + mmr_t reserved_0 : 52; + } sh_pi_md2pi_request_vc_status_s; +} sh_pi_md2pi_request_vc_status_u_t; +#else +typedef union sh_pi_md2pi_request_vc_status_u { + mmr_t sh_pi_md2pi_request_vc_status_regval; + struct { + mmr_t reserved_0 : 52; + mmr_t input_queue_stat : 4; + mmr_t input_dat_crd_stat : 4; + mmr_t input_hdr_crd_stat : 4; + } sh_pi_md2pi_request_vc_status_s; +} sh_pi_md2pi_request_vc_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_XN2PI_REPLY_VC_STATUS" */ +/* XN-to-PI Reply Virtual Channel Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_xn2pi_reply_vc_status_u { + mmr_t sh_pi_xn2pi_reply_vc_status_regval; + struct { + mmr_t input_hdr_crd_stat : 4; + mmr_t input_dat_crd_stat : 4; + mmr_t input_queue_stat : 4; + mmr_t reserved_0 : 52; + } sh_pi_xn2pi_reply_vc_status_s; +} sh_pi_xn2pi_reply_vc_status_u_t; +#else +typedef union sh_pi_xn2pi_reply_vc_status_u { + mmr_t sh_pi_xn2pi_reply_vc_status_regval; + struct { + mmr_t reserved_0 : 52; + mmr_t input_queue_stat : 4; + mmr_t input_dat_crd_stat : 4; + mmr_t input_hdr_crd_stat : 4; + } sh_pi_xn2pi_reply_vc_status_s; +} sh_pi_xn2pi_reply_vc_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_XN2PI_REQUEST_VC_STATUS" */ +/* XN-to-PI Request Virtual Channel Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_xn2pi_request_vc_status_u { + mmr_t sh_pi_xn2pi_request_vc_status_regval; + struct { + mmr_t input_hdr_crd_stat : 4; + mmr_t input_dat_crd_stat : 4; + mmr_t input_queue_stat : 4; + mmr_t reserved_0 : 52; + } sh_pi_xn2pi_request_vc_status_s; +} sh_pi_xn2pi_request_vc_status_u_t; +#else +typedef union sh_pi_xn2pi_request_vc_status_u { + mmr_t sh_pi_xn2pi_request_vc_status_regval; + struct { + mmr_t reserved_0 : 52; + mmr_t input_queue_stat : 4; + mmr_t input_dat_crd_stat : 4; + mmr_t input_hdr_crd_stat : 4; + } sh_pi_xn2pi_request_vc_status_s; +} sh_pi_xn2pi_request_vc_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_SIC_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_sic_flow_u { + mmr_t sh_xnpi_sic_flow_regval; + struct { + mmr_t debit_vc0_withhold : 5; + mmr_t reserved_0 : 2; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 5; + mmr_t reserved_1 : 2; + mmr_t debit_vc2_force_cred : 1; + mmr_t credit_vc0_test : 5; + mmr_t reserved_2 : 3; + mmr_t credit_vc0_dyn : 5; + mmr_t reserved_3 : 3; + mmr_t credit_vc0_cap : 5; + mmr_t reserved_4 : 3; + mmr_t credit_vc2_test : 5; + mmr_t reserved_5 : 3; + mmr_t credit_vc2_dyn : 5; + mmr_t reserved_6 : 3; + mmr_t credit_vc2_cap : 5; + mmr_t reserved_7 : 2; + mmr_t disable_bypass_out : 1; + } sh_xnpi_sic_flow_s; +} sh_xnpi_sic_flow_u_t; +#else +typedef union sh_xnpi_sic_flow_u { + mmr_t sh_xnpi_sic_flow_regval; + struct { + mmr_t disable_bypass_out : 1; + mmr_t reserved_7 : 2; + mmr_t credit_vc2_cap : 5; + mmr_t reserved_6 : 3; + mmr_t credit_vc2_dyn : 5; + mmr_t reserved_5 : 3; + mmr_t credit_vc2_test : 5; + mmr_t reserved_4 : 3; + mmr_t credit_vc0_cap : 5; + mmr_t reserved_3 : 3; + mmr_t credit_vc0_dyn : 5; + mmr_t reserved_2 : 3; + mmr_t credit_vc0_test : 5; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 2; + mmr_t debit_vc2_withhold : 5; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 2; + mmr_t debit_vc0_withhold : 5; + } sh_xnpi_sic_flow_s; +} sh_xnpi_sic_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_TO_NI0_PORT_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_to_ni0_port_flow_u { + mmr_t sh_xnpi_to_ni0_port_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_6 : 2; + } sh_xnpi_to_ni0_port_flow_s; +} sh_xnpi_to_ni0_port_flow_u_t; +#else +typedef union sh_xnpi_to_ni0_port_flow_u { + mmr_t sh_xnpi_to_ni0_port_flow_regval; + struct { + mmr_t reserved_6 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_2 : 8; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnpi_to_ni0_port_flow_s; +} sh_xnpi_to_ni0_port_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_TO_NI1_PORT_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_to_ni1_port_flow_u { + mmr_t sh_xnpi_to_ni1_port_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_6 : 2; + } sh_xnpi_to_ni1_port_flow_s; +} sh_xnpi_to_ni1_port_flow_u_t; +#else +typedef union sh_xnpi_to_ni1_port_flow_u { + mmr_t sh_xnpi_to_ni1_port_flow_regval; + struct { + mmr_t reserved_6 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_2 : 8; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnpi_to_ni1_port_flow_s; +} sh_xnpi_to_ni1_port_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_TO_IILB_PORT_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_to_iilb_port_flow_u { + mmr_t sh_xnpi_to_iilb_port_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_6 : 2; + } sh_xnpi_to_iilb_port_flow_s; +} sh_xnpi_to_iilb_port_flow_u_t; +#else +typedef union sh_xnpi_to_iilb_port_flow_u { + mmr_t sh_xnpi_to_iilb_port_flow_regval; + struct { + mmr_t reserved_6 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_2 : 8; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnpi_to_iilb_port_flow_s; +} sh_xnpi_to_iilb_port_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_FR_NI0_PORT_FLOW_FIFO" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_fr_ni0_port_flow_fifo_u { + mmr_t sh_xnpi_fr_ni0_port_flow_fifo_regval; + struct { + mmr_t entry_vc0_dyn : 6; + mmr_t reserved_0 : 2; + mmr_t entry_vc0_cap : 6; + mmr_t reserved_1 : 2; + mmr_t entry_vc2_dyn : 6; + mmr_t reserved_2 : 2; + mmr_t entry_vc2_cap : 6; + mmr_t reserved_3 : 2; + mmr_t entry_vc0_test : 5; + mmr_t reserved_4 : 3; + mmr_t entry_vc2_test : 5; + mmr_t reserved_5 : 19; + } sh_xnpi_fr_ni0_port_flow_fifo_s; +} sh_xnpi_fr_ni0_port_flow_fifo_u_t; +#else +typedef union sh_xnpi_fr_ni0_port_flow_fifo_u { + mmr_t sh_xnpi_fr_ni0_port_flow_fifo_regval; + struct { + mmr_t reserved_5 : 19; + mmr_t entry_vc2_test : 5; + mmr_t reserved_4 : 3; + mmr_t entry_vc0_test : 5; + mmr_t reserved_3 : 2; + mmr_t entry_vc2_cap : 6; + mmr_t reserved_2 : 2; + mmr_t entry_vc2_dyn : 6; + mmr_t reserved_1 : 2; + mmr_t entry_vc0_cap : 6; + mmr_t reserved_0 : 2; + mmr_t entry_vc0_dyn : 6; + } sh_xnpi_fr_ni0_port_flow_fifo_s; +} sh_xnpi_fr_ni0_port_flow_fifo_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_FR_NI1_PORT_FLOW_FIFO" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_fr_ni1_port_flow_fifo_u { + mmr_t sh_xnpi_fr_ni1_port_flow_fifo_regval; + struct { + mmr_t entry_vc0_dyn : 6; + mmr_t reserved_0 : 2; + mmr_t entry_vc0_cap : 6; + mmr_t reserved_1 : 2; + mmr_t entry_vc2_dyn : 6; + mmr_t reserved_2 : 2; + mmr_t entry_vc2_cap : 6; + mmr_t reserved_3 : 2; + mmr_t entry_vc0_test : 5; + mmr_t reserved_4 : 3; + mmr_t entry_vc2_test : 5; + mmr_t reserved_5 : 19; + } sh_xnpi_fr_ni1_port_flow_fifo_s; +} sh_xnpi_fr_ni1_port_flow_fifo_u_t; +#else +typedef union sh_xnpi_fr_ni1_port_flow_fifo_u { + mmr_t sh_xnpi_fr_ni1_port_flow_fifo_regval; + struct { + mmr_t reserved_5 : 19; + mmr_t entry_vc2_test : 5; + mmr_t reserved_4 : 3; + mmr_t entry_vc0_test : 5; + mmr_t reserved_3 : 2; + mmr_t entry_vc2_cap : 6; + mmr_t reserved_2 : 2; + mmr_t entry_vc2_dyn : 6; + mmr_t reserved_1 : 2; + mmr_t entry_vc0_cap : 6; + mmr_t reserved_0 : 2; + mmr_t entry_vc0_dyn : 6; + } sh_xnpi_fr_ni1_port_flow_fifo_s; +} sh_xnpi_fr_ni1_port_flow_fifo_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_FR_IILB_PORT_FLOW_FIFO" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_fr_iilb_port_flow_fifo_u { + mmr_t sh_xnpi_fr_iilb_port_flow_fifo_regval; + struct { + mmr_t entry_vc0_dyn : 6; + mmr_t reserved_0 : 2; + mmr_t entry_vc0_cap : 6; + mmr_t reserved_1 : 2; + mmr_t entry_vc2_dyn : 6; + mmr_t reserved_2 : 2; + mmr_t entry_vc2_cap : 6; + mmr_t reserved_3 : 2; + mmr_t entry_vc0_test : 5; + mmr_t reserved_4 : 3; + mmr_t entry_vc2_test : 5; + mmr_t reserved_5 : 19; + } sh_xnpi_fr_iilb_port_flow_fifo_s; +} sh_xnpi_fr_iilb_port_flow_fifo_u_t; +#else +typedef union sh_xnpi_fr_iilb_port_flow_fifo_u { + mmr_t sh_xnpi_fr_iilb_port_flow_fifo_regval; + struct { + mmr_t reserved_5 : 19; + mmr_t entry_vc2_test : 5; + mmr_t reserved_4 : 3; + mmr_t entry_vc0_test : 5; + mmr_t reserved_3 : 2; + mmr_t entry_vc2_cap : 6; + mmr_t reserved_2 : 2; + mmr_t entry_vc2_dyn : 6; + mmr_t reserved_1 : 2; + mmr_t entry_vc0_cap : 6; + mmr_t reserved_0 : 2; + mmr_t entry_vc0_dyn : 6; + } sh_xnpi_fr_iilb_port_flow_fifo_s; +} sh_xnpi_fr_iilb_port_flow_fifo_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_SIC_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_sic_flow_u { + mmr_t sh_xnmd_sic_flow_regval; + struct { + mmr_t debit_vc0_withhold : 5; + mmr_t reserved_0 : 2; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 5; + mmr_t reserved_1 : 2; + mmr_t debit_vc2_force_cred : 1; + mmr_t credit_vc0_test : 5; + mmr_t reserved_2 : 3; + mmr_t credit_vc0_dyn : 5; + mmr_t reserved_3 : 3; + mmr_t credit_vc0_cap : 5; + mmr_t reserved_4 : 3; + mmr_t credit_vc2_test : 5; + mmr_t reserved_5 : 3; + mmr_t credit_vc2_dyn : 5; + mmr_t reserved_6 : 3; + mmr_t credit_vc2_cap : 5; + mmr_t reserved_7 : 2; + mmr_t disable_bypass_out : 1; + } sh_xnmd_sic_flow_s; +} sh_xnmd_sic_flow_u_t; +#else +typedef union sh_xnmd_sic_flow_u { + mmr_t sh_xnmd_sic_flow_regval; + struct { + mmr_t disable_bypass_out : 1; + mmr_t reserved_7 : 2; + mmr_t credit_vc2_cap : 5; + mmr_t reserved_6 : 3; + mmr_t credit_vc2_dyn : 5; + mmr_t reserved_5 : 3; + mmr_t credit_vc2_test : 5; + mmr_t reserved_4 : 3; + mmr_t credit_vc0_cap : 5; + mmr_t reserved_3 : 3; + mmr_t credit_vc0_dyn : 5; + mmr_t reserved_2 : 3; + mmr_t credit_vc0_test : 5; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 2; + mmr_t debit_vc2_withhold : 5; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 2; + mmr_t debit_vc0_withhold : 5; + } sh_xnmd_sic_flow_s; +} sh_xnmd_sic_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_TO_NI0_PORT_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_to_ni0_port_flow_u { + mmr_t sh_xnmd_to_ni0_port_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_6 : 2; + } sh_xnmd_to_ni0_port_flow_s; +} sh_xnmd_to_ni0_port_flow_u_t; +#else +typedef union sh_xnmd_to_ni0_port_flow_u { + mmr_t sh_xnmd_to_ni0_port_flow_regval; + struct { + mmr_t reserved_6 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_2 : 8; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnmd_to_ni0_port_flow_s; +} sh_xnmd_to_ni0_port_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_TO_NI1_PORT_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_to_ni1_port_flow_u { + mmr_t sh_xnmd_to_ni1_port_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_6 : 2; + } sh_xnmd_to_ni1_port_flow_s; +} sh_xnmd_to_ni1_port_flow_u_t; +#else +typedef union sh_xnmd_to_ni1_port_flow_u { + mmr_t sh_xnmd_to_ni1_port_flow_regval; + struct { + mmr_t reserved_6 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_2 : 8; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnmd_to_ni1_port_flow_s; +} sh_xnmd_to_ni1_port_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_TO_IILB_PORT_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_to_iilb_port_flow_u { + mmr_t sh_xnmd_to_iilb_port_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_6 : 2; + } sh_xnmd_to_iilb_port_flow_s; +} sh_xnmd_to_iilb_port_flow_u_t; +#else +typedef union sh_xnmd_to_iilb_port_flow_u { + mmr_t sh_xnmd_to_iilb_port_flow_regval; + struct { + mmr_t reserved_6 : 2; + mmr_t credit_vc2_cap : 6; + mmr_t reserved_5 : 2; + mmr_t credit_vc2_dyn : 6; + mmr_t reserved_4 : 10; + mmr_t credit_vc0_cap : 6; + mmr_t reserved_3 : 2; + mmr_t credit_vc0_dyn : 6; + mmr_t reserved_2 : 8; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnmd_to_iilb_port_flow_s; +} sh_xnmd_to_iilb_port_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_FR_NI0_PORT_FLOW_FIFO" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_fr_ni0_port_flow_fifo_u { + mmr_t sh_xnmd_fr_ni0_port_flow_fifo_regval; + struct { + mmr_t entry_vc0_dyn : 6; + mmr_t reserved_0 : 2; + mmr_t entry_vc0_cap : 6; + mmr_t reserved_1 : 2; + mmr_t entry_vc2_dyn : 6; + mmr_t reserved_2 : 2; + mmr_t entry_vc2_cap : 6; + mmr_t reserved_3 : 2; + mmr_t entry_vc0_test : 5; + mmr_t reserved_4 : 3; + mmr_t entry_vc2_test : 5; + mmr_t reserved_5 : 19; + } sh_xnmd_fr_ni0_port_flow_fifo_s; +} sh_xnmd_fr_ni0_port_flow_fifo_u_t; +#else +typedef union sh_xnmd_fr_ni0_port_flow_fifo_u { + mmr_t sh_xnmd_fr_ni0_port_flow_fifo_regval; + struct { + mmr_t reserved_5 : 19; + mmr_t entry_vc2_test : 5; + mmr_t reserved_4 : 3; + mmr_t entry_vc0_test : 5; + mmr_t reserved_3 : 2; + mmr_t entry_vc2_cap : 6; + mmr_t reserved_2 : 2; + mmr_t entry_vc2_dyn : 6; + mmr_t reserved_1 : 2; + mmr_t entry_vc0_cap : 6; + mmr_t reserved_0 : 2; + mmr_t entry_vc0_dyn : 6; + } sh_xnmd_fr_ni0_port_flow_fifo_s; +} sh_xnmd_fr_ni0_port_flow_fifo_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_FR_NI1_PORT_FLOW_FIFO" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_fr_ni1_port_flow_fifo_u { + mmr_t sh_xnmd_fr_ni1_port_flow_fifo_regval; + struct { + mmr_t entry_vc0_dyn : 6; + mmr_t reserved_0 : 2; + mmr_t entry_vc0_cap : 6; + mmr_t reserved_1 : 2; + mmr_t entry_vc2_dyn : 6; + mmr_t reserved_2 : 2; + mmr_t entry_vc2_cap : 6; + mmr_t reserved_3 : 2; + mmr_t entry_vc0_test : 5; + mmr_t reserved_4 : 3; + mmr_t entry_vc2_test : 5; + mmr_t reserved_5 : 19; + } sh_xnmd_fr_ni1_port_flow_fifo_s; +} sh_xnmd_fr_ni1_port_flow_fifo_u_t; +#else +typedef union sh_xnmd_fr_ni1_port_flow_fifo_u { + mmr_t sh_xnmd_fr_ni1_port_flow_fifo_regval; + struct { + mmr_t reserved_5 : 19; + mmr_t entry_vc2_test : 5; + mmr_t reserved_4 : 3; + mmr_t entry_vc0_test : 5; + mmr_t reserved_3 : 2; + mmr_t entry_vc2_cap : 6; + mmr_t reserved_2 : 2; + mmr_t entry_vc2_dyn : 6; + mmr_t reserved_1 : 2; + mmr_t entry_vc0_cap : 6; + mmr_t reserved_0 : 2; + mmr_t entry_vc0_dyn : 6; + } sh_xnmd_fr_ni1_port_flow_fifo_s; +} sh_xnmd_fr_ni1_port_flow_fifo_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_FR_IILB_PORT_FLOW_FIFO" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_fr_iilb_port_flow_fifo_u { + mmr_t sh_xnmd_fr_iilb_port_flow_fifo_regval; + struct { + mmr_t entry_vc0_dyn : 6; + mmr_t reserved_0 : 2; + mmr_t entry_vc0_cap : 6; + mmr_t reserved_1 : 2; + mmr_t entry_vc2_dyn : 6; + mmr_t reserved_2 : 2; + mmr_t entry_vc2_cap : 6; + mmr_t reserved_3 : 2; + mmr_t entry_vc0_test : 5; + mmr_t reserved_4 : 3; + mmr_t entry_vc2_test : 5; + mmr_t reserved_5 : 19; + } sh_xnmd_fr_iilb_port_flow_fifo_s; +} sh_xnmd_fr_iilb_port_flow_fifo_u_t; +#else +typedef union sh_xnmd_fr_iilb_port_flow_fifo_u { + mmr_t sh_xnmd_fr_iilb_port_flow_fifo_regval; + struct { + mmr_t reserved_5 : 19; + mmr_t entry_vc2_test : 5; + mmr_t reserved_4 : 3; + mmr_t entry_vc0_test : 5; + mmr_t reserved_3 : 2; + mmr_t entry_vc2_cap : 6; + mmr_t reserved_2 : 2; + mmr_t entry_vc2_dyn : 6; + mmr_t reserved_1 : 2; + mmr_t entry_vc0_cap : 6; + mmr_t reserved_0 : 2; + mmr_t entry_vc0_dyn : 6; + } sh_xnmd_fr_iilb_port_flow_fifo_s; +} sh_xnmd_fr_iilb_port_flow_fifo_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNII_INTRA_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnii_intra_flow_u { + mmr_t sh_xnii_intra_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t credit_vc0_test : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc0_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t credit_vc0_cap : 7; + mmr_t reserved_4 : 1; + mmr_t credit_vc2_test : 7; + mmr_t reserved_5 : 1; + mmr_t credit_vc2_dyn : 7; + mmr_t reserved_6 : 1; + mmr_t credit_vc2_cap : 7; + mmr_t reserved_7 : 1; + } sh_xnii_intra_flow_s; +} sh_xnii_intra_flow_u_t; +#else +typedef union sh_xnii_intra_flow_u { + mmr_t sh_xnii_intra_flow_regval; + struct { + mmr_t reserved_7 : 1; + mmr_t credit_vc2_cap : 7; + mmr_t reserved_6 : 1; + mmr_t credit_vc2_dyn : 7; + mmr_t reserved_5 : 1; + mmr_t credit_vc2_test : 7; + mmr_t reserved_4 : 1; + mmr_t credit_vc0_cap : 7; + mmr_t reserved_3 : 1; + mmr_t credit_vc0_dyn : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc0_test : 7; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnii_intra_flow_s; +} sh_xnii_intra_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNLB_INTRA_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnlb_intra_flow_u { + mmr_t sh_xnlb_intra_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t credit_vc0_test : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc0_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t credit_vc0_cap : 7; + mmr_t reserved_4 : 1; + mmr_t credit_vc2_test : 7; + mmr_t reserved_5 : 1; + mmr_t credit_vc2_dyn : 7; + mmr_t reserved_6 : 1; + mmr_t credit_vc2_cap : 7; + mmr_t disable_bypass_in : 1; + } sh_xnlb_intra_flow_s; +} sh_xnlb_intra_flow_u_t; +#else +typedef union sh_xnlb_intra_flow_u { + mmr_t sh_xnlb_intra_flow_regval; + struct { + mmr_t disable_bypass_in : 1; + mmr_t credit_vc2_cap : 7; + mmr_t reserved_6 : 1; + mmr_t credit_vc2_dyn : 7; + mmr_t reserved_5 : 1; + mmr_t credit_vc2_test : 7; + mmr_t reserved_4 : 1; + mmr_t credit_vc0_cap : 7; + mmr_t reserved_3 : 1; + mmr_t credit_vc0_dyn : 7; + mmr_t reserved_2 : 1; + mmr_t credit_vc0_test : 7; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t debit_vc2_withhold : 6; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnlb_intra_flow_s; +} sh_xnlb_intra_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_to_ni0_intra_flow_debit_u { + mmr_t sh_xniilb_to_ni0_intra_flow_debit_regval; + struct { + mmr_t vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t vc0_force_cred : 1; + mmr_t vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t vc0_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_4 : 9; + mmr_t vc2_dyn : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_6 : 1; + } sh_xniilb_to_ni0_intra_flow_debit_s; +} sh_xniilb_to_ni0_intra_flow_debit_u_t; +#else +typedef union sh_xniilb_to_ni0_intra_flow_debit_u { + mmr_t sh_xniilb_to_ni0_intra_flow_debit_regval; + struct { + mmr_t reserved_6 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 9; + mmr_t vc0_cap : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_2 : 8; + mmr_t vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t vc2_withhold : 6; + mmr_t vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t vc0_withhold : 6; + } sh_xniilb_to_ni0_intra_flow_debit_s; +} sh_xniilb_to_ni0_intra_flow_debit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_to_ni1_intra_flow_debit_u { + mmr_t sh_xniilb_to_ni1_intra_flow_debit_regval; + struct { + mmr_t vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t vc0_force_cred : 1; + mmr_t vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t vc0_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_4 : 9; + mmr_t vc2_dyn : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_6 : 1; + } sh_xniilb_to_ni1_intra_flow_debit_s; +} sh_xniilb_to_ni1_intra_flow_debit_u_t; +#else +typedef union sh_xniilb_to_ni1_intra_flow_debit_u { + mmr_t sh_xniilb_to_ni1_intra_flow_debit_regval; + struct { + mmr_t reserved_6 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 9; + mmr_t vc0_cap : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_2 : 8; + mmr_t vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t vc2_withhold : 6; + mmr_t vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t vc0_withhold : 6; + } sh_xniilb_to_ni1_intra_flow_debit_s; +} sh_xniilb_to_ni1_intra_flow_debit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_to_md_intra_flow_debit_u { + mmr_t sh_xniilb_to_md_intra_flow_debit_regval; + struct { + mmr_t vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t vc0_force_cred : 1; + mmr_t vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t vc0_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_4 : 9; + mmr_t vc2_dyn : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_6 : 1; + } sh_xniilb_to_md_intra_flow_debit_s; +} sh_xniilb_to_md_intra_flow_debit_u_t; +#else +typedef union sh_xniilb_to_md_intra_flow_debit_u { + mmr_t sh_xniilb_to_md_intra_flow_debit_regval; + struct { + mmr_t reserved_6 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 9; + mmr_t vc0_cap : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_2 : 8; + mmr_t vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t vc2_withhold : 6; + mmr_t vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t vc0_withhold : 6; + } sh_xniilb_to_md_intra_flow_debit_s; +} sh_xniilb_to_md_intra_flow_debit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_to_iilb_intra_flow_debit_u { + mmr_t sh_xniilb_to_iilb_intra_flow_debit_regval; + struct { + mmr_t vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t vc0_force_cred : 1; + mmr_t vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t vc0_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_4 : 9; + mmr_t vc2_dyn : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_6 : 1; + } sh_xniilb_to_iilb_intra_flow_debit_s; +} sh_xniilb_to_iilb_intra_flow_debit_u_t; +#else +typedef union sh_xniilb_to_iilb_intra_flow_debit_u { + mmr_t sh_xniilb_to_iilb_intra_flow_debit_regval; + struct { + mmr_t reserved_6 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 9; + mmr_t vc0_cap : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_2 : 8; + mmr_t vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t vc2_withhold : 6; + mmr_t vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t vc0_withhold : 6; + } sh_xniilb_to_iilb_intra_flow_debit_s; +} sh_xniilb_to_iilb_intra_flow_debit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_to_pi_intra_flow_debit_u { + mmr_t sh_xniilb_to_pi_intra_flow_debit_regval; + struct { + mmr_t vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t vc0_force_cred : 1; + mmr_t vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t vc0_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_4 : 9; + mmr_t vc2_dyn : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_6 : 1; + } sh_xniilb_to_pi_intra_flow_debit_s; +} sh_xniilb_to_pi_intra_flow_debit_u_t; +#else +typedef union sh_xniilb_to_pi_intra_flow_debit_u { + mmr_t sh_xniilb_to_pi_intra_flow_debit_regval; + struct { + mmr_t reserved_6 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 9; + mmr_t vc0_cap : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_2 : 8; + mmr_t vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t vc2_withhold : 6; + mmr_t vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t vc0_withhold : 6; + } sh_xniilb_to_pi_intra_flow_debit_s; +} sh_xniilb_to_pi_intra_flow_debit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_fr_ni0_intra_flow_credit_u { + mmr_t sh_xniilb_fr_ni0_intra_flow_credit_regval; + struct { + mmr_t vc0_test : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_2 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 17; + } sh_xniilb_fr_ni0_intra_flow_credit_s; +} sh_xniilb_fr_ni0_intra_flow_credit_u_t; +#else +typedef union sh_xniilb_fr_ni0_intra_flow_credit_u { + mmr_t sh_xniilb_fr_ni0_intra_flow_credit_regval; + struct { + mmr_t reserved_5 : 17; + mmr_t vc2_cap : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_2 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_test : 7; + } sh_xniilb_fr_ni0_intra_flow_credit_s; +} sh_xniilb_fr_ni0_intra_flow_credit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_fr_ni1_intra_flow_credit_u { + mmr_t sh_xniilb_fr_ni1_intra_flow_credit_regval; + struct { + mmr_t vc0_test : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_2 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 17; + } sh_xniilb_fr_ni1_intra_flow_credit_s; +} sh_xniilb_fr_ni1_intra_flow_credit_u_t; +#else +typedef union sh_xniilb_fr_ni1_intra_flow_credit_u { + mmr_t sh_xniilb_fr_ni1_intra_flow_credit_regval; + struct { + mmr_t reserved_5 : 17; + mmr_t vc2_cap : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_2 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_test : 7; + } sh_xniilb_fr_ni1_intra_flow_credit_s; +} sh_xniilb_fr_ni1_intra_flow_credit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_fr_md_intra_flow_credit_u { + mmr_t sh_xniilb_fr_md_intra_flow_credit_regval; + struct { + mmr_t vc0_test : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_2 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 17; + } sh_xniilb_fr_md_intra_flow_credit_s; +} sh_xniilb_fr_md_intra_flow_credit_u_t; +#else +typedef union sh_xniilb_fr_md_intra_flow_credit_u { + mmr_t sh_xniilb_fr_md_intra_flow_credit_regval; + struct { + mmr_t reserved_5 : 17; + mmr_t vc2_cap : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_2 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_test : 7; + } sh_xniilb_fr_md_intra_flow_credit_s; +} sh_xniilb_fr_md_intra_flow_credit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_fr_iilb_intra_flow_credit_u { + mmr_t sh_xniilb_fr_iilb_intra_flow_credit_regval; + struct { + mmr_t vc0_test : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_2 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 17; + } sh_xniilb_fr_iilb_intra_flow_credit_s; +} sh_xniilb_fr_iilb_intra_flow_credit_u_t; +#else +typedef union sh_xniilb_fr_iilb_intra_flow_credit_u { + mmr_t sh_xniilb_fr_iilb_intra_flow_credit_regval; + struct { + mmr_t reserved_5 : 17; + mmr_t vc2_cap : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_2 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_test : 7; + } sh_xniilb_fr_iilb_intra_flow_credit_s; +} sh_xniilb_fr_iilb_intra_flow_credit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_fr_pi_intra_flow_credit_u { + mmr_t sh_xniilb_fr_pi_intra_flow_credit_regval; + struct { + mmr_t vc0_test : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_2 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 17; + } sh_xniilb_fr_pi_intra_flow_credit_s; +} sh_xniilb_fr_pi_intra_flow_credit_u_t; +#else +typedef union sh_xniilb_fr_pi_intra_flow_credit_u { + mmr_t sh_xniilb_fr_pi_intra_flow_credit_regval; + struct { + mmr_t reserved_5 : 17; + mmr_t vc2_cap : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_2 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_test : 7; + } sh_xniilb_fr_pi_intra_flow_credit_s; +} sh_xniilb_fr_pi_intra_flow_credit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_to_pi_intra_flow_debit_u { + mmr_t sh_xnni0_to_pi_intra_flow_debit_regval; + struct { + mmr_t vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t vc0_force_cred : 1; + mmr_t vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t vc0_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_4 : 9; + mmr_t vc2_dyn : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_6 : 1; + } sh_xnni0_to_pi_intra_flow_debit_s; +} sh_xnni0_to_pi_intra_flow_debit_u_t; +#else +typedef union sh_xnni0_to_pi_intra_flow_debit_u { + mmr_t sh_xnni0_to_pi_intra_flow_debit_regval; + struct { + mmr_t reserved_6 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 9; + mmr_t vc0_cap : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_2 : 8; + mmr_t vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t vc2_withhold : 6; + mmr_t vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t vc0_withhold : 6; + } sh_xnni0_to_pi_intra_flow_debit_s; +} sh_xnni0_to_pi_intra_flow_debit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_to_md_intra_flow_debit_u { + mmr_t sh_xnni0_to_md_intra_flow_debit_regval; + struct { + mmr_t vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t vc0_force_cred : 1; + mmr_t vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t vc0_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_4 : 9; + mmr_t vc2_dyn : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_6 : 1; + } sh_xnni0_to_md_intra_flow_debit_s; +} sh_xnni0_to_md_intra_flow_debit_u_t; +#else +typedef union sh_xnni0_to_md_intra_flow_debit_u { + mmr_t sh_xnni0_to_md_intra_flow_debit_regval; + struct { + mmr_t reserved_6 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 9; + mmr_t vc0_cap : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_2 : 8; + mmr_t vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t vc2_withhold : 6; + mmr_t vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t vc0_withhold : 6; + } sh_xnni0_to_md_intra_flow_debit_s; +} sh_xnni0_to_md_intra_flow_debit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_to_iilb_intra_flow_debit_u { + mmr_t sh_xnni0_to_iilb_intra_flow_debit_regval; + struct { + mmr_t vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t vc0_force_cred : 1; + mmr_t vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t vc0_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_4 : 9; + mmr_t vc2_dyn : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_6 : 1; + } sh_xnni0_to_iilb_intra_flow_debit_s; +} sh_xnni0_to_iilb_intra_flow_debit_u_t; +#else +typedef union sh_xnni0_to_iilb_intra_flow_debit_u { + mmr_t sh_xnni0_to_iilb_intra_flow_debit_regval; + struct { + mmr_t reserved_6 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 9; + mmr_t vc0_cap : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_2 : 8; + mmr_t vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t vc2_withhold : 6; + mmr_t vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t vc0_withhold : 6; + } sh_xnni0_to_iilb_intra_flow_debit_s; +} sh_xnni0_to_iilb_intra_flow_debit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_fr_pi_intra_flow_credit_u { + mmr_t sh_xnni0_fr_pi_intra_flow_credit_regval; + struct { + mmr_t vc0_test : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_2 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 17; + } sh_xnni0_fr_pi_intra_flow_credit_s; +} sh_xnni0_fr_pi_intra_flow_credit_u_t; +#else +typedef union sh_xnni0_fr_pi_intra_flow_credit_u { + mmr_t sh_xnni0_fr_pi_intra_flow_credit_regval; + struct { + mmr_t reserved_5 : 17; + mmr_t vc2_cap : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_2 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_test : 7; + } sh_xnni0_fr_pi_intra_flow_credit_s; +} sh_xnni0_fr_pi_intra_flow_credit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_fr_md_intra_flow_credit_u { + mmr_t sh_xnni0_fr_md_intra_flow_credit_regval; + struct { + mmr_t vc0_test : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_2 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 17; + } sh_xnni0_fr_md_intra_flow_credit_s; +} sh_xnni0_fr_md_intra_flow_credit_u_t; +#else +typedef union sh_xnni0_fr_md_intra_flow_credit_u { + mmr_t sh_xnni0_fr_md_intra_flow_credit_regval; + struct { + mmr_t reserved_5 : 17; + mmr_t vc2_cap : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_2 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_test : 7; + } sh_xnni0_fr_md_intra_flow_credit_s; +} sh_xnni0_fr_md_intra_flow_credit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_fr_iilb_intra_flow_credit_u { + mmr_t sh_xnni0_fr_iilb_intra_flow_credit_regval; + struct { + mmr_t vc0_test : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_2 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 17; + } sh_xnni0_fr_iilb_intra_flow_credit_s; +} sh_xnni0_fr_iilb_intra_flow_credit_u_t; +#else +typedef union sh_xnni0_fr_iilb_intra_flow_credit_u { + mmr_t sh_xnni0_fr_iilb_intra_flow_credit_regval; + struct { + mmr_t reserved_5 : 17; + mmr_t vc2_cap : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_2 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_test : 7; + } sh_xnni0_fr_iilb_intra_flow_credit_s; +} sh_xnni0_fr_iilb_intra_flow_credit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_0_INTRANI_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_0_intrani_flow_u { + mmr_t sh_xnni0_0_intrani_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_1 : 56; + } sh_xnni0_0_intrani_flow_s; +} sh_xnni0_0_intrani_flow_u_t; +#else +typedef union sh_xnni0_0_intrani_flow_u { + mmr_t sh_xnni0_0_intrani_flow_regval; + struct { + mmr_t reserved_1 : 56; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnni0_0_intrani_flow_s; +} sh_xnni0_0_intrani_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_1_INTRANI_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_1_intrani_flow_u { + mmr_t sh_xnni0_1_intrani_flow_regval; + struct { + mmr_t debit_vc1_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc1_force_cred : 1; + mmr_t reserved_1 : 56; + } sh_xnni0_1_intrani_flow_s; +} sh_xnni0_1_intrani_flow_u_t; +#else +typedef union sh_xnni0_1_intrani_flow_u { + mmr_t sh_xnni0_1_intrani_flow_regval; + struct { + mmr_t reserved_1 : 56; + mmr_t debit_vc1_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc1_withhold : 6; + } sh_xnni0_1_intrani_flow_s; +} sh_xnni0_1_intrani_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_2_INTRANI_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_2_intrani_flow_u { + mmr_t sh_xnni0_2_intrani_flow_regval; + struct { + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 56; + } sh_xnni0_2_intrani_flow_s; +} sh_xnni0_2_intrani_flow_u_t; +#else +typedef union sh_xnni0_2_intrani_flow_u { + mmr_t sh_xnni0_2_intrani_flow_regval; + struct { + mmr_t reserved_1 : 56; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc2_withhold : 6; + } sh_xnni0_2_intrani_flow_s; +} sh_xnni0_2_intrani_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_3_INTRANI_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_3_intrani_flow_u { + mmr_t sh_xnni0_3_intrani_flow_regval; + struct { + mmr_t debit_vc3_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc3_force_cred : 1; + mmr_t reserved_1 : 56; + } sh_xnni0_3_intrani_flow_s; +} sh_xnni0_3_intrani_flow_u_t; +#else +typedef union sh_xnni0_3_intrani_flow_u { + mmr_t sh_xnni0_3_intrani_flow_regval; + struct { + mmr_t reserved_1 : 56; + mmr_t debit_vc3_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc3_withhold : 6; + } sh_xnni0_3_intrani_flow_s; +} sh_xnni0_3_intrani_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_VCSWITCH_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_vcswitch_flow_u { + mmr_t sh_xnni0_vcswitch_flow_regval; + struct { + mmr_t ni_vcfifo_dateline_switch : 1; + mmr_t reserved_0 : 7; + mmr_t pi_vcfifo_switch : 1; + mmr_t reserved_1 : 7; + mmr_t md_vcfifo_switch : 1; + mmr_t reserved_2 : 7; + mmr_t iilb_vcfifo_switch : 1; + mmr_t reserved_3 : 7; + mmr_t disable_sync_bypass_in : 1; + mmr_t disable_sync_bypass_out : 1; + mmr_t async_fifoes : 1; + mmr_t reserved_4 : 29; + } sh_xnni0_vcswitch_flow_s; +} sh_xnni0_vcswitch_flow_u_t; +#else +typedef union sh_xnni0_vcswitch_flow_u { + mmr_t sh_xnni0_vcswitch_flow_regval; + struct { + mmr_t reserved_4 : 29; + mmr_t async_fifoes : 1; + mmr_t disable_sync_bypass_out : 1; + mmr_t disable_sync_bypass_in : 1; + mmr_t reserved_3 : 7; + mmr_t iilb_vcfifo_switch : 1; + mmr_t reserved_2 : 7; + mmr_t md_vcfifo_switch : 1; + mmr_t reserved_1 : 7; + mmr_t pi_vcfifo_switch : 1; + mmr_t reserved_0 : 7; + mmr_t ni_vcfifo_dateline_switch : 1; + } sh_xnni0_vcswitch_flow_s; +} sh_xnni0_vcswitch_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_TIMER_REG" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_timer_reg_u { + mmr_t sh_xnni0_timer_reg_regval; + struct { + mmr_t timeout_reg : 24; + mmr_t reserved_0 : 8; + mmr_t linkcleanup_reg : 1; + mmr_t reserved_1 : 31; + } sh_xnni0_timer_reg_s; +} sh_xnni0_timer_reg_u_t; +#else +typedef union sh_xnni0_timer_reg_u { + mmr_t sh_xnni0_timer_reg_regval; + struct { + mmr_t reserved_1 : 31; + mmr_t linkcleanup_reg : 1; + mmr_t reserved_0 : 8; + mmr_t timeout_reg : 24; + } sh_xnni0_timer_reg_s; +} sh_xnni0_timer_reg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_FIFO02_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_fifo02_flow_u { + mmr_t sh_xnni0_fifo02_flow_regval; + struct { + mmr_t count_vc0_limit : 4; + mmr_t reserved_0 : 4; + mmr_t count_vc0_dyn : 4; + mmr_t reserved_1 : 4; + mmr_t count_vc0_cap : 4; + mmr_t reserved_2 : 4; + mmr_t count_vc2_limit : 4; + mmr_t reserved_3 : 4; + mmr_t count_vc2_dyn : 4; + mmr_t reserved_4 : 4; + mmr_t count_vc2_cap : 4; + mmr_t reserved_5 : 20; + } sh_xnni0_fifo02_flow_s; +} sh_xnni0_fifo02_flow_u_t; +#else +typedef union sh_xnni0_fifo02_flow_u { + mmr_t sh_xnni0_fifo02_flow_regval; + struct { + mmr_t reserved_5 : 20; + mmr_t count_vc2_cap : 4; + mmr_t reserved_4 : 4; + mmr_t count_vc2_dyn : 4; + mmr_t reserved_3 : 4; + mmr_t count_vc2_limit : 4; + mmr_t reserved_2 : 4; + mmr_t count_vc0_cap : 4; + mmr_t reserved_1 : 4; + mmr_t count_vc0_dyn : 4; + mmr_t reserved_0 : 4; + mmr_t count_vc0_limit : 4; + } sh_xnni0_fifo02_flow_s; +} sh_xnni0_fifo02_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_FIFO13_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_fifo13_flow_u { + mmr_t sh_xnni0_fifo13_flow_regval; + struct { + mmr_t count_vc1_limit : 4; + mmr_t reserved_0 : 4; + mmr_t count_vc1_dyn : 4; + mmr_t reserved_1 : 4; + mmr_t count_vc1_cap : 4; + mmr_t reserved_2 : 4; + mmr_t count_vc3_limit : 4; + mmr_t reserved_3 : 4; + mmr_t count_vc3_dyn : 4; + mmr_t reserved_4 : 4; + mmr_t count_vc3_cap : 4; + mmr_t reserved_5 : 20; + } sh_xnni0_fifo13_flow_s; +} sh_xnni0_fifo13_flow_u_t; +#else +typedef union sh_xnni0_fifo13_flow_u { + mmr_t sh_xnni0_fifo13_flow_regval; + struct { + mmr_t reserved_5 : 20; + mmr_t count_vc3_cap : 4; + mmr_t reserved_4 : 4; + mmr_t count_vc3_dyn : 4; + mmr_t reserved_3 : 4; + mmr_t count_vc3_limit : 4; + mmr_t reserved_2 : 4; + mmr_t count_vc1_cap : 4; + mmr_t reserved_1 : 4; + mmr_t count_vc1_dyn : 4; + mmr_t reserved_0 : 4; + mmr_t count_vc1_limit : 4; + } sh_xnni0_fifo13_flow_s; +} sh_xnni0_fifo13_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_NI_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_ni_flow_u { + mmr_t sh_xnni0_ni_flow_regval; + struct { + mmr_t vc0_limit : 4; + mmr_t reserved_0 : 4; + mmr_t vc0_dyn : 4; + mmr_t vc0_cap : 4; + mmr_t vc1_limit : 4; + mmr_t reserved_1 : 4; + mmr_t vc1_dyn : 4; + mmr_t vc1_cap : 4; + mmr_t vc2_limit : 4; + mmr_t reserved_2 : 4; + mmr_t vc2_dyn : 4; + mmr_t vc2_cap : 4; + mmr_t vc3_limit : 4; + mmr_t reserved_3 : 4; + mmr_t vc3_dyn : 4; + mmr_t vc3_cap : 4; + } sh_xnni0_ni_flow_s; +} sh_xnni0_ni_flow_u_t; +#else +typedef union sh_xnni0_ni_flow_u { + mmr_t sh_xnni0_ni_flow_regval; + struct { + mmr_t vc3_cap : 4; + mmr_t vc3_dyn : 4; + mmr_t reserved_3 : 4; + mmr_t vc3_limit : 4; + mmr_t vc2_cap : 4; + mmr_t vc2_dyn : 4; + mmr_t reserved_2 : 4; + mmr_t vc2_limit : 4; + mmr_t vc1_cap : 4; + mmr_t vc1_dyn : 4; + mmr_t reserved_1 : 4; + mmr_t vc1_limit : 4; + mmr_t vc0_cap : 4; + mmr_t vc0_dyn : 4; + mmr_t reserved_0 : 4; + mmr_t vc0_limit : 4; + } sh_xnni0_ni_flow_s; +} sh_xnni0_ni_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_DEAD_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_dead_flow_u { + mmr_t sh_xnni0_dead_flow_regval; + struct { + mmr_t vc0_limit : 4; + mmr_t reserved_0 : 4; + mmr_t vc0_dyn : 4; + mmr_t vc0_cap : 4; + mmr_t vc1_limit : 4; + mmr_t reserved_1 : 4; + mmr_t vc1_dyn : 4; + mmr_t vc1_cap : 4; + mmr_t vc2_limit : 4; + mmr_t reserved_2 : 4; + mmr_t vc2_dyn : 4; + mmr_t vc2_cap : 4; + mmr_t vc3_limit : 4; + mmr_t reserved_3 : 4; + mmr_t vc3_dyn : 4; + mmr_t vc3_cap : 4; + } sh_xnni0_dead_flow_s; +} sh_xnni0_dead_flow_u_t; +#else +typedef union sh_xnni0_dead_flow_u { + mmr_t sh_xnni0_dead_flow_regval; + struct { + mmr_t vc3_cap : 4; + mmr_t vc3_dyn : 4; + mmr_t reserved_3 : 4; + mmr_t vc3_limit : 4; + mmr_t vc2_cap : 4; + mmr_t vc2_dyn : 4; + mmr_t reserved_2 : 4; + mmr_t vc2_limit : 4; + mmr_t vc1_cap : 4; + mmr_t vc1_dyn : 4; + mmr_t reserved_1 : 4; + mmr_t vc1_limit : 4; + mmr_t vc0_cap : 4; + mmr_t vc0_dyn : 4; + mmr_t reserved_0 : 4; + mmr_t vc0_limit : 4; + } sh_xnni0_dead_flow_s; +} sh_xnni0_dead_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI0_INJECT_AGE" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni0_inject_age_u { + mmr_t sh_xnni0_inject_age_regval; + struct { + mmr_t request_inject : 8; + mmr_t reply_inject : 8; + mmr_t reserved_0 : 48; + } sh_xnni0_inject_age_s; +} sh_xnni0_inject_age_u_t; +#else +typedef union sh_xnni0_inject_age_u { + mmr_t sh_xnni0_inject_age_regval; + struct { + mmr_t reserved_0 : 48; + mmr_t reply_inject : 8; + mmr_t request_inject : 8; + } sh_xnni0_inject_age_s; +} sh_xnni0_inject_age_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_to_pi_intra_flow_debit_u { + mmr_t sh_xnni1_to_pi_intra_flow_debit_regval; + struct { + mmr_t vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t vc0_force_cred : 1; + mmr_t vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t vc0_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_4 : 9; + mmr_t vc2_dyn : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_6 : 1; + } sh_xnni1_to_pi_intra_flow_debit_s; +} sh_xnni1_to_pi_intra_flow_debit_u_t; +#else +typedef union sh_xnni1_to_pi_intra_flow_debit_u { + mmr_t sh_xnni1_to_pi_intra_flow_debit_regval; + struct { + mmr_t reserved_6 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 9; + mmr_t vc0_cap : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_2 : 8; + mmr_t vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t vc2_withhold : 6; + mmr_t vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t vc0_withhold : 6; + } sh_xnni1_to_pi_intra_flow_debit_s; +} sh_xnni1_to_pi_intra_flow_debit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_to_md_intra_flow_debit_u { + mmr_t sh_xnni1_to_md_intra_flow_debit_regval; + struct { + mmr_t vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t vc0_force_cred : 1; + mmr_t vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t vc0_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_4 : 9; + mmr_t vc2_dyn : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_6 : 1; + } sh_xnni1_to_md_intra_flow_debit_s; +} sh_xnni1_to_md_intra_flow_debit_u_t; +#else +typedef union sh_xnni1_to_md_intra_flow_debit_u { + mmr_t sh_xnni1_to_md_intra_flow_debit_regval; + struct { + mmr_t reserved_6 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 9; + mmr_t vc0_cap : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_2 : 8; + mmr_t vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t vc2_withhold : 6; + mmr_t vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t vc0_withhold : 6; + } sh_xnni1_to_md_intra_flow_debit_s; +} sh_xnni1_to_md_intra_flow_debit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_to_iilb_intra_flow_debit_u { + mmr_t sh_xnni1_to_iilb_intra_flow_debit_regval; + struct { + mmr_t vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t vc0_force_cred : 1; + mmr_t vc2_withhold : 6; + mmr_t reserved_1 : 1; + mmr_t vc2_force_cred : 1; + mmr_t reserved_2 : 8; + mmr_t vc0_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_4 : 9; + mmr_t vc2_dyn : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_6 : 1; + } sh_xnni1_to_iilb_intra_flow_debit_s; +} sh_xnni1_to_iilb_intra_flow_debit_u_t; +#else +typedef union sh_xnni1_to_iilb_intra_flow_debit_u { + mmr_t sh_xnni1_to_iilb_intra_flow_debit_regval; + struct { + mmr_t reserved_6 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 9; + mmr_t vc0_cap : 7; + mmr_t reserved_3 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_2 : 8; + mmr_t vc2_force_cred : 1; + mmr_t reserved_1 : 1; + mmr_t vc2_withhold : 6; + mmr_t vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t vc0_withhold : 6; + } sh_xnni1_to_iilb_intra_flow_debit_s; +} sh_xnni1_to_iilb_intra_flow_debit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_fr_pi_intra_flow_credit_u { + mmr_t sh_xnni1_fr_pi_intra_flow_credit_regval; + struct { + mmr_t vc0_test : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_2 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 17; + } sh_xnni1_fr_pi_intra_flow_credit_s; +} sh_xnni1_fr_pi_intra_flow_credit_u_t; +#else +typedef union sh_xnni1_fr_pi_intra_flow_credit_u { + mmr_t sh_xnni1_fr_pi_intra_flow_credit_regval; + struct { + mmr_t reserved_5 : 17; + mmr_t vc2_cap : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_2 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_test : 7; + } sh_xnni1_fr_pi_intra_flow_credit_s; +} sh_xnni1_fr_pi_intra_flow_credit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_fr_md_intra_flow_credit_u { + mmr_t sh_xnni1_fr_md_intra_flow_credit_regval; + struct { + mmr_t vc0_test : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_2 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 17; + } sh_xnni1_fr_md_intra_flow_credit_s; +} sh_xnni1_fr_md_intra_flow_credit_u_t; +#else +typedef union sh_xnni1_fr_md_intra_flow_credit_u { + mmr_t sh_xnni1_fr_md_intra_flow_credit_regval; + struct { + mmr_t reserved_5 : 17; + mmr_t vc2_cap : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_2 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_test : 7; + } sh_xnni1_fr_md_intra_flow_credit_s; +} sh_xnni1_fr_md_intra_flow_credit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_fr_iilb_intra_flow_credit_u { + mmr_t sh_xnni1_fr_iilb_intra_flow_credit_regval; + struct { + mmr_t vc0_test : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_2 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_cap : 7; + mmr_t reserved_5 : 17; + } sh_xnni1_fr_iilb_intra_flow_credit_s; +} sh_xnni1_fr_iilb_intra_flow_credit_u_t; +#else +typedef union sh_xnni1_fr_iilb_intra_flow_credit_u { + mmr_t sh_xnni1_fr_iilb_intra_flow_credit_regval; + struct { + mmr_t reserved_5 : 17; + mmr_t vc2_cap : 7; + mmr_t reserved_4 : 1; + mmr_t vc2_dyn : 7; + mmr_t reserved_3 : 1; + mmr_t vc2_test : 7; + mmr_t reserved_2 : 1; + mmr_t vc0_cap : 7; + mmr_t reserved_1 : 1; + mmr_t vc0_dyn : 7; + mmr_t reserved_0 : 1; + mmr_t vc0_test : 7; + } sh_xnni1_fr_iilb_intra_flow_credit_s; +} sh_xnni1_fr_iilb_intra_flow_credit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_0_INTRANI_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_0_intrani_flow_u { + mmr_t sh_xnni1_0_intrani_flow_regval; + struct { + mmr_t debit_vc0_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_1 : 56; + } sh_xnni1_0_intrani_flow_s; +} sh_xnni1_0_intrani_flow_u_t; +#else +typedef union sh_xnni1_0_intrani_flow_u { + mmr_t sh_xnni1_0_intrani_flow_regval; + struct { + mmr_t reserved_1 : 56; + mmr_t debit_vc0_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc0_withhold : 6; + } sh_xnni1_0_intrani_flow_s; +} sh_xnni1_0_intrani_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_1_INTRANI_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_1_intrani_flow_u { + mmr_t sh_xnni1_1_intrani_flow_regval; + struct { + mmr_t debit_vc1_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc1_force_cred : 1; + mmr_t reserved_1 : 56; + } sh_xnni1_1_intrani_flow_s; +} sh_xnni1_1_intrani_flow_u_t; +#else +typedef union sh_xnni1_1_intrani_flow_u { + mmr_t sh_xnni1_1_intrani_flow_regval; + struct { + mmr_t reserved_1 : 56; + mmr_t debit_vc1_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc1_withhold : 6; + } sh_xnni1_1_intrani_flow_s; +} sh_xnni1_1_intrani_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_2_INTRANI_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_2_intrani_flow_u { + mmr_t sh_xnni1_2_intrani_flow_regval; + struct { + mmr_t debit_vc2_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_1 : 56; + } sh_xnni1_2_intrani_flow_s; +} sh_xnni1_2_intrani_flow_u_t; +#else +typedef union sh_xnni1_2_intrani_flow_u { + mmr_t sh_xnni1_2_intrani_flow_regval; + struct { + mmr_t reserved_1 : 56; + mmr_t debit_vc2_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc2_withhold : 6; + } sh_xnni1_2_intrani_flow_s; +} sh_xnni1_2_intrani_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_3_INTRANI_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_3_intrani_flow_u { + mmr_t sh_xnni1_3_intrani_flow_regval; + struct { + mmr_t debit_vc3_withhold : 6; + mmr_t reserved_0 : 1; + mmr_t debit_vc3_force_cred : 1; + mmr_t reserved_1 : 56; + } sh_xnni1_3_intrani_flow_s; +} sh_xnni1_3_intrani_flow_u_t; +#else +typedef union sh_xnni1_3_intrani_flow_u { + mmr_t sh_xnni1_3_intrani_flow_regval; + struct { + mmr_t reserved_1 : 56; + mmr_t debit_vc3_force_cred : 1; + mmr_t reserved_0 : 1; + mmr_t debit_vc3_withhold : 6; + } sh_xnni1_3_intrani_flow_s; +} sh_xnni1_3_intrani_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_VCSWITCH_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_vcswitch_flow_u { + mmr_t sh_xnni1_vcswitch_flow_regval; + struct { + mmr_t ni_vcfifo_dateline_switch : 1; + mmr_t reserved_0 : 7; + mmr_t pi_vcfifo_switch : 1; + mmr_t reserved_1 : 7; + mmr_t md_vcfifo_switch : 1; + mmr_t reserved_2 : 7; + mmr_t iilb_vcfifo_switch : 1; + mmr_t reserved_3 : 7; + mmr_t disable_sync_bypass_in : 1; + mmr_t disable_sync_bypass_out : 1; + mmr_t async_fifoes : 1; + mmr_t reserved_4 : 29; + } sh_xnni1_vcswitch_flow_s; +} sh_xnni1_vcswitch_flow_u_t; +#else +typedef union sh_xnni1_vcswitch_flow_u { + mmr_t sh_xnni1_vcswitch_flow_regval; + struct { + mmr_t reserved_4 : 29; + mmr_t async_fifoes : 1; + mmr_t disable_sync_bypass_out : 1; + mmr_t disable_sync_bypass_in : 1; + mmr_t reserved_3 : 7; + mmr_t iilb_vcfifo_switch : 1; + mmr_t reserved_2 : 7; + mmr_t md_vcfifo_switch : 1; + mmr_t reserved_1 : 7; + mmr_t pi_vcfifo_switch : 1; + mmr_t reserved_0 : 7; + mmr_t ni_vcfifo_dateline_switch : 1; + } sh_xnni1_vcswitch_flow_s; +} sh_xnni1_vcswitch_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_TIMER_REG" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_timer_reg_u { + mmr_t sh_xnni1_timer_reg_regval; + struct { + mmr_t timeout_reg : 24; + mmr_t reserved_0 : 8; + mmr_t linkcleanup_reg : 1; + mmr_t reserved_1 : 31; + } sh_xnni1_timer_reg_s; +} sh_xnni1_timer_reg_u_t; +#else +typedef union sh_xnni1_timer_reg_u { + mmr_t sh_xnni1_timer_reg_regval; + struct { + mmr_t reserved_1 : 31; + mmr_t linkcleanup_reg : 1; + mmr_t reserved_0 : 8; + mmr_t timeout_reg : 24; + } sh_xnni1_timer_reg_s; +} sh_xnni1_timer_reg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_FIFO02_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_fifo02_flow_u { + mmr_t sh_xnni1_fifo02_flow_regval; + struct { + mmr_t count_vc0_limit : 4; + mmr_t reserved_0 : 4; + mmr_t count_vc0_dyn : 4; + mmr_t reserved_1 : 4; + mmr_t count_vc0_cap : 4; + mmr_t reserved_2 : 4; + mmr_t count_vc2_limit : 4; + mmr_t reserved_3 : 4; + mmr_t count_vc2_dyn : 4; + mmr_t reserved_4 : 4; + mmr_t count_vc2_cap : 4; + mmr_t reserved_5 : 20; + } sh_xnni1_fifo02_flow_s; +} sh_xnni1_fifo02_flow_u_t; +#else +typedef union sh_xnni1_fifo02_flow_u { + mmr_t sh_xnni1_fifo02_flow_regval; + struct { + mmr_t reserved_5 : 20; + mmr_t count_vc2_cap : 4; + mmr_t reserved_4 : 4; + mmr_t count_vc2_dyn : 4; + mmr_t reserved_3 : 4; + mmr_t count_vc2_limit : 4; + mmr_t reserved_2 : 4; + mmr_t count_vc0_cap : 4; + mmr_t reserved_1 : 4; + mmr_t count_vc0_dyn : 4; + mmr_t reserved_0 : 4; + mmr_t count_vc0_limit : 4; + } sh_xnni1_fifo02_flow_s; +} sh_xnni1_fifo02_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_FIFO13_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_fifo13_flow_u { + mmr_t sh_xnni1_fifo13_flow_regval; + struct { + mmr_t count_vc1_limit : 4; + mmr_t reserved_0 : 4; + mmr_t count_vc1_dyn : 4; + mmr_t reserved_1 : 4; + mmr_t count_vc1_cap : 4; + mmr_t reserved_2 : 4; + mmr_t count_vc3_limit : 4; + mmr_t reserved_3 : 4; + mmr_t count_vc3_dyn : 4; + mmr_t reserved_4 : 4; + mmr_t count_vc3_cap : 4; + mmr_t reserved_5 : 20; + } sh_xnni1_fifo13_flow_s; +} sh_xnni1_fifo13_flow_u_t; +#else +typedef union sh_xnni1_fifo13_flow_u { + mmr_t sh_xnni1_fifo13_flow_regval; + struct { + mmr_t reserved_5 : 20; + mmr_t count_vc3_cap : 4; + mmr_t reserved_4 : 4; + mmr_t count_vc3_dyn : 4; + mmr_t reserved_3 : 4; + mmr_t count_vc3_limit : 4; + mmr_t reserved_2 : 4; + mmr_t count_vc1_cap : 4; + mmr_t reserved_1 : 4; + mmr_t count_vc1_dyn : 4; + mmr_t reserved_0 : 4; + mmr_t count_vc1_limit : 4; + } sh_xnni1_fifo13_flow_s; +} sh_xnni1_fifo13_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_NI_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_ni_flow_u { + mmr_t sh_xnni1_ni_flow_regval; + struct { + mmr_t vc0_limit : 4; + mmr_t reserved_0 : 4; + mmr_t vc0_dyn : 4; + mmr_t vc0_cap : 4; + mmr_t vc1_limit : 4; + mmr_t reserved_1 : 4; + mmr_t vc1_dyn : 4; + mmr_t vc1_cap : 4; + mmr_t vc2_limit : 4; + mmr_t reserved_2 : 4; + mmr_t vc2_dyn : 4; + mmr_t vc2_cap : 4; + mmr_t vc3_limit : 4; + mmr_t reserved_3 : 4; + mmr_t vc3_dyn : 4; + mmr_t vc3_cap : 4; + } sh_xnni1_ni_flow_s; +} sh_xnni1_ni_flow_u_t; +#else +typedef union sh_xnni1_ni_flow_u { + mmr_t sh_xnni1_ni_flow_regval; + struct { + mmr_t vc3_cap : 4; + mmr_t vc3_dyn : 4; + mmr_t reserved_3 : 4; + mmr_t vc3_limit : 4; + mmr_t vc2_cap : 4; + mmr_t vc2_dyn : 4; + mmr_t reserved_2 : 4; + mmr_t vc2_limit : 4; + mmr_t vc1_cap : 4; + mmr_t vc1_dyn : 4; + mmr_t reserved_1 : 4; + mmr_t vc1_limit : 4; + mmr_t vc0_cap : 4; + mmr_t vc0_dyn : 4; + mmr_t reserved_0 : 4; + mmr_t vc0_limit : 4; + } sh_xnni1_ni_flow_s; +} sh_xnni1_ni_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_DEAD_FLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_dead_flow_u { + mmr_t sh_xnni1_dead_flow_regval; + struct { + mmr_t vc0_limit : 4; + mmr_t reserved_0 : 4; + mmr_t vc0_dyn : 4; + mmr_t vc0_cap : 4; + mmr_t vc1_limit : 4; + mmr_t reserved_1 : 4; + mmr_t vc1_dyn : 4; + mmr_t vc1_cap : 4; + mmr_t vc2_limit : 4; + mmr_t reserved_2 : 4; + mmr_t vc2_dyn : 4; + mmr_t vc2_cap : 4; + mmr_t vc3_limit : 4; + mmr_t reserved_3 : 4; + mmr_t vc3_dyn : 4; + mmr_t vc3_cap : 4; + } sh_xnni1_dead_flow_s; +} sh_xnni1_dead_flow_u_t; +#else +typedef union sh_xnni1_dead_flow_u { + mmr_t sh_xnni1_dead_flow_regval; + struct { + mmr_t vc3_cap : 4; + mmr_t vc3_dyn : 4; + mmr_t reserved_3 : 4; + mmr_t vc3_limit : 4; + mmr_t vc2_cap : 4; + mmr_t vc2_dyn : 4; + mmr_t reserved_2 : 4; + mmr_t vc2_limit : 4; + mmr_t vc1_cap : 4; + mmr_t vc1_dyn : 4; + mmr_t reserved_1 : 4; + mmr_t vc1_limit : 4; + mmr_t vc0_cap : 4; + mmr_t vc0_dyn : 4; + mmr_t reserved_0 : 4; + mmr_t vc0_limit : 4; + } sh_xnni1_dead_flow_s; +} sh_xnni1_dead_flow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNNI1_INJECT_AGE" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnni1_inject_age_u { + mmr_t sh_xnni1_inject_age_regval; + struct { + mmr_t request_inject : 8; + mmr_t reply_inject : 8; + mmr_t reserved_0 : 48; + } sh_xnni1_inject_age_s; +} sh_xnni1_inject_age_u_t; +#else +typedef union sh_xnni1_inject_age_u { + mmr_t sh_xnni1_inject_age_regval; + struct { + mmr_t reserved_0 : 48; + mmr_t reply_inject : 8; + mmr_t request_inject : 8; + } sh_xnni1_inject_age_s; +} sh_xnni1_inject_age_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_DEBUG_SEL" */ +/* XN Debug Port Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_debug_sel_u { + mmr_t sh_xn_debug_sel_regval; + struct { + mmr_t nibble0_rlm_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_rlm_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_rlm_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_rlm_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_rlm_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_rlm_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_rlm_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_rlm_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t trigger_enable : 1; + } sh_xn_debug_sel_s; +} sh_xn_debug_sel_u_t; +#else +typedef union sh_xn_debug_sel_u { + mmr_t sh_xn_debug_sel_regval; + struct { + mmr_t trigger_enable : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_rlm_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_rlm_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_rlm_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_rlm_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_rlm_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_rlm_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_rlm_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_rlm_sel : 3; + } sh_xn_debug_sel_s; +} sh_xn_debug_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_DEBUG_TRIG_SEL" */ +/* XN Debug trigger Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_debug_trig_sel_u { + mmr_t sh_xn_debug_trig_sel_regval; + struct { + mmr_t trigger0_rlm_sel : 3; + mmr_t reserved_0 : 1; + mmr_t trigger0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t trigger1_rlm_sel : 3; + mmr_t reserved_2 : 1; + mmr_t trigger1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t trigger2_rlm_sel : 3; + mmr_t reserved_4 : 1; + mmr_t trigger2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t trigger3_rlm_sel : 3; + mmr_t reserved_6 : 1; + mmr_t trigger3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t trigger4_rlm_sel : 3; + mmr_t reserved_8 : 1; + mmr_t trigger4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t trigger5_rlm_sel : 3; + mmr_t reserved_10 : 1; + mmr_t trigger5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t trigger6_rlm_sel : 3; + mmr_t reserved_12 : 1; + mmr_t trigger6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t trigger7_rlm_sel : 3; + mmr_t reserved_14 : 1; + mmr_t trigger7_nibble_sel : 3; + mmr_t reserved_15 : 1; + } sh_xn_debug_trig_sel_s; +} sh_xn_debug_trig_sel_u_t; +#else +typedef union sh_xn_debug_trig_sel_u { + mmr_t sh_xn_debug_trig_sel_regval; + struct { + mmr_t reserved_15 : 1; + mmr_t trigger7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t trigger7_rlm_sel : 3; + mmr_t reserved_13 : 1; + mmr_t trigger6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t trigger6_rlm_sel : 3; + mmr_t reserved_11 : 1; + mmr_t trigger5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t trigger5_rlm_sel : 3; + mmr_t reserved_9 : 1; + mmr_t trigger4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t trigger4_rlm_sel : 3; + mmr_t reserved_7 : 1; + mmr_t trigger3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t trigger3_rlm_sel : 3; + mmr_t reserved_5 : 1; + mmr_t trigger2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t trigger2_rlm_sel : 3; + mmr_t reserved_3 : 1; + mmr_t trigger1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t trigger1_rlm_sel : 3; + mmr_t reserved_1 : 1; + mmr_t trigger0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t trigger0_rlm_sel : 3; + } sh_xn_debug_trig_sel_s; +} sh_xn_debug_trig_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_TRIGGER_COMPARE" */ +/* XN Debug Compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_trigger_compare_u { + mmr_t sh_xn_trigger_compare_regval; + struct { + mmr_t mask : 32; + mmr_t reserved_0 : 32; + } sh_xn_trigger_compare_s; +} sh_xn_trigger_compare_u_t; +#else +typedef union sh_xn_trigger_compare_u { + mmr_t sh_xn_trigger_compare_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t mask : 32; + } sh_xn_trigger_compare_s; +} sh_xn_trigger_compare_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_TRIGGER_DATA" */ +/* XN Debug Compare Data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_trigger_data_u { + mmr_t sh_xn_trigger_data_regval; + struct { + mmr_t compare_pattern : 32; + mmr_t reserved_0 : 32; + } sh_xn_trigger_data_s; +} sh_xn_trigger_data_u_t; +#else +typedef union sh_xn_trigger_data_u { + mmr_t sh_xn_trigger_data_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t compare_pattern : 32; + } sh_xn_trigger_data_s; +} sh_xn_trigger_data_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_DEBUG_SEL" */ +/* XN IILB Debug Port Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_debug_sel_u { + mmr_t sh_xn_iilb_debug_sel_regval; + struct { + mmr_t nibble0_input_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_input_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_input_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_input_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_input_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_input_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_input_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_input_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_15 : 1; + } sh_xn_iilb_debug_sel_s; +} sh_xn_iilb_debug_sel_u_t; +#else +typedef union sh_xn_iilb_debug_sel_u { + mmr_t sh_xn_iilb_debug_sel_regval; + struct { + mmr_t reserved_15 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_input_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_input_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_input_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_input_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_input_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_input_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_input_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_input_sel : 3; + } sh_xn_iilb_debug_sel_s; +} sh_xn_iilb_debug_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_DEBUG_SEL" */ +/* XN PI Debug Port Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_debug_sel_u { + mmr_t sh_xn_pi_debug_sel_regval; + struct { + mmr_t nibble0_input_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_input_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_input_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_input_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_input_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_input_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_input_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_input_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_15 : 1; + } sh_xn_pi_debug_sel_s; +} sh_xn_pi_debug_sel_u_t; +#else +typedef union sh_xn_pi_debug_sel_u { + mmr_t sh_xn_pi_debug_sel_regval; + struct { + mmr_t reserved_15 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_input_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_input_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_input_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_input_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_input_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_input_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_input_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_input_sel : 3; + } sh_xn_pi_debug_sel_s; +} sh_xn_pi_debug_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_DEBUG_SEL" */ +/* XN MD Debug Port Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_debug_sel_u { + mmr_t sh_xn_md_debug_sel_regval; + struct { + mmr_t nibble0_input_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_input_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_input_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_input_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_input_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_input_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_input_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_input_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_15 : 1; + } sh_xn_md_debug_sel_s; +} sh_xn_md_debug_sel_u_t; +#else +typedef union sh_xn_md_debug_sel_u { + mmr_t sh_xn_md_debug_sel_regval; + struct { + mmr_t reserved_15 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_input_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_input_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_input_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_input_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_input_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_input_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_input_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_input_sel : 3; + } sh_xn_md_debug_sel_s; +} sh_xn_md_debug_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_DEBUG_SEL" */ +/* XN NI0 Debug Port Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_debug_sel_u { + mmr_t sh_xn_ni0_debug_sel_regval; + struct { + mmr_t nibble0_input_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_input_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_input_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_input_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_input_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_input_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_input_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_input_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_15 : 1; + } sh_xn_ni0_debug_sel_s; +} sh_xn_ni0_debug_sel_u_t; +#else +typedef union sh_xn_ni0_debug_sel_u { + mmr_t sh_xn_ni0_debug_sel_regval; + struct { + mmr_t reserved_15 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_input_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_input_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_input_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_input_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_input_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_input_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_input_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_input_sel : 3; + } sh_xn_ni0_debug_sel_s; +} sh_xn_ni0_debug_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_DEBUG_SEL" */ +/* XN NI1 Debug Port Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_debug_sel_u { + mmr_t sh_xn_ni1_debug_sel_regval; + struct { + mmr_t nibble0_input_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_input_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_input_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_input_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_input_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_input_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_input_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_input_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_15 : 1; + } sh_xn_ni1_debug_sel_s; +} sh_xn_ni1_debug_sel_u_t; +#else +typedef union sh_xn_ni1_debug_sel_u { + mmr_t sh_xn_ni1_debug_sel_regval; + struct { + mmr_t reserved_15 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_input_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_input_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_input_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_input_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_input_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_input_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_input_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_input_sel : 3; + } sh_xn_ni1_debug_sel_s; +} sh_xn_ni1_debug_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_LB_CMP_EXP_DATA0" */ +/* IILB compare LB input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_lb_cmp_exp_data0_u { + mmr_t sh_xn_iilb_lb_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_lb_cmp_exp_data0_s; +} sh_xn_iilb_lb_cmp_exp_data0_u_t; +#else +typedef union sh_xn_iilb_lb_cmp_exp_data0_u { + mmr_t sh_xn_iilb_lb_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_lb_cmp_exp_data0_s; +} sh_xn_iilb_lb_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_LB_CMP_EXP_DATA1" */ +/* IILB compare LB input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_lb_cmp_exp_data1_u { + mmr_t sh_xn_iilb_lb_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_lb_cmp_exp_data1_s; +} sh_xn_iilb_lb_cmp_exp_data1_u_t; +#else +typedef union sh_xn_iilb_lb_cmp_exp_data1_u { + mmr_t sh_xn_iilb_lb_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_lb_cmp_exp_data1_s; +} sh_xn_iilb_lb_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_LB_CMP_ENABLE0" */ +/* IILB compare LB input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_lb_cmp_enable0_u { + mmr_t sh_xn_iilb_lb_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_lb_cmp_enable0_s; +} sh_xn_iilb_lb_cmp_enable0_u_t; +#else +typedef union sh_xn_iilb_lb_cmp_enable0_u { + mmr_t sh_xn_iilb_lb_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_lb_cmp_enable0_s; +} sh_xn_iilb_lb_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_LB_CMP_ENABLE1" */ +/* IILB compare LB input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_lb_cmp_enable1_u { + mmr_t sh_xn_iilb_lb_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_lb_cmp_enable1_s; +} sh_xn_iilb_lb_cmp_enable1_u_t; +#else +typedef union sh_xn_iilb_lb_cmp_enable1_u { + mmr_t sh_xn_iilb_lb_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_lb_cmp_enable1_s; +} sh_xn_iilb_lb_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_II_CMP_EXP_DATA0" */ +/* IILB compare II input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_ii_cmp_exp_data0_u { + mmr_t sh_xn_iilb_ii_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_ii_cmp_exp_data0_s; +} sh_xn_iilb_ii_cmp_exp_data0_u_t; +#else +typedef union sh_xn_iilb_ii_cmp_exp_data0_u { + mmr_t sh_xn_iilb_ii_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_ii_cmp_exp_data0_s; +} sh_xn_iilb_ii_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_II_CMP_EXP_DATA1" */ +/* IILB compare II input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_ii_cmp_exp_data1_u { + mmr_t sh_xn_iilb_ii_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_ii_cmp_exp_data1_s; +} sh_xn_iilb_ii_cmp_exp_data1_u_t; +#else +typedef union sh_xn_iilb_ii_cmp_exp_data1_u { + mmr_t sh_xn_iilb_ii_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_ii_cmp_exp_data1_s; +} sh_xn_iilb_ii_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_II_CMP_ENABLE0" */ +/* IILB compare II input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_ii_cmp_enable0_u { + mmr_t sh_xn_iilb_ii_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_ii_cmp_enable0_s; +} sh_xn_iilb_ii_cmp_enable0_u_t; +#else +typedef union sh_xn_iilb_ii_cmp_enable0_u { + mmr_t sh_xn_iilb_ii_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_ii_cmp_enable0_s; +} sh_xn_iilb_ii_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_II_CMP_ENABLE1" */ +/* IILB compare II input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_ii_cmp_enable1_u { + mmr_t sh_xn_iilb_ii_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_ii_cmp_enable1_s; +} sh_xn_iilb_ii_cmp_enable1_u_t; +#else +typedef union sh_xn_iilb_ii_cmp_enable1_u { + mmr_t sh_xn_iilb_ii_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_ii_cmp_enable1_s; +} sh_xn_iilb_ii_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_MD_CMP_EXP_DATA0" */ +/* IILB compare MD input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_md_cmp_exp_data0_u { + mmr_t sh_xn_iilb_md_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_md_cmp_exp_data0_s; +} sh_xn_iilb_md_cmp_exp_data0_u_t; +#else +typedef union sh_xn_iilb_md_cmp_exp_data0_u { + mmr_t sh_xn_iilb_md_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_md_cmp_exp_data0_s; +} sh_xn_iilb_md_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_MD_CMP_EXP_DATA1" */ +/* IILB compare MD input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_md_cmp_exp_data1_u { + mmr_t sh_xn_iilb_md_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_md_cmp_exp_data1_s; +} sh_xn_iilb_md_cmp_exp_data1_u_t; +#else +typedef union sh_xn_iilb_md_cmp_exp_data1_u { + mmr_t sh_xn_iilb_md_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_md_cmp_exp_data1_s; +} sh_xn_iilb_md_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_MD_CMP_ENABLE0" */ +/* IILB compare MD input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_md_cmp_enable0_u { + mmr_t sh_xn_iilb_md_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_md_cmp_enable0_s; +} sh_xn_iilb_md_cmp_enable0_u_t; +#else +typedef union sh_xn_iilb_md_cmp_enable0_u { + mmr_t sh_xn_iilb_md_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_md_cmp_enable0_s; +} sh_xn_iilb_md_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_MD_CMP_ENABLE1" */ +/* IILB compare MD input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_md_cmp_enable1_u { + mmr_t sh_xn_iilb_md_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_md_cmp_enable1_s; +} sh_xn_iilb_md_cmp_enable1_u_t; +#else +typedef union sh_xn_iilb_md_cmp_enable1_u { + mmr_t sh_xn_iilb_md_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_md_cmp_enable1_s; +} sh_xn_iilb_md_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_PI_CMP_EXP_DATA0" */ +/* IILB compare PI input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_pi_cmp_exp_data0_u { + mmr_t sh_xn_iilb_pi_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_pi_cmp_exp_data0_s; +} sh_xn_iilb_pi_cmp_exp_data0_u_t; +#else +typedef union sh_xn_iilb_pi_cmp_exp_data0_u { + mmr_t sh_xn_iilb_pi_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_pi_cmp_exp_data0_s; +} sh_xn_iilb_pi_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_PI_CMP_EXP_DATA1" */ +/* IILB compare PI input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_pi_cmp_exp_data1_u { + mmr_t sh_xn_iilb_pi_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_pi_cmp_exp_data1_s; +} sh_xn_iilb_pi_cmp_exp_data1_u_t; +#else +typedef union sh_xn_iilb_pi_cmp_exp_data1_u { + mmr_t sh_xn_iilb_pi_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_pi_cmp_exp_data1_s; +} sh_xn_iilb_pi_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_PI_CMP_ENABLE0" */ +/* IILB compare PI input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_pi_cmp_enable0_u { + mmr_t sh_xn_iilb_pi_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_pi_cmp_enable0_s; +} sh_xn_iilb_pi_cmp_enable0_u_t; +#else +typedef union sh_xn_iilb_pi_cmp_enable0_u { + mmr_t sh_xn_iilb_pi_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_pi_cmp_enable0_s; +} sh_xn_iilb_pi_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_PI_CMP_ENABLE1" */ +/* IILB compare PI input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_pi_cmp_enable1_u { + mmr_t sh_xn_iilb_pi_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_pi_cmp_enable1_s; +} sh_xn_iilb_pi_cmp_enable1_u_t; +#else +typedef union sh_xn_iilb_pi_cmp_enable1_u { + mmr_t sh_xn_iilb_pi_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_pi_cmp_enable1_s; +} sh_xn_iilb_pi_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI0_CMP_EXP_DATA0" */ +/* IILB compare NI0 input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_ni0_cmp_exp_data0_u { + mmr_t sh_xn_iilb_ni0_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_ni0_cmp_exp_data0_s; +} sh_xn_iilb_ni0_cmp_exp_data0_u_t; +#else +typedef union sh_xn_iilb_ni0_cmp_exp_data0_u { + mmr_t sh_xn_iilb_ni0_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_ni0_cmp_exp_data0_s; +} sh_xn_iilb_ni0_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI0_CMP_EXP_DATA1" */ +/* IILB compare NI0 input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_ni0_cmp_exp_data1_u { + mmr_t sh_xn_iilb_ni0_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_ni0_cmp_exp_data1_s; +} sh_xn_iilb_ni0_cmp_exp_data1_u_t; +#else +typedef union sh_xn_iilb_ni0_cmp_exp_data1_u { + mmr_t sh_xn_iilb_ni0_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_ni0_cmp_exp_data1_s; +} sh_xn_iilb_ni0_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI0_CMP_ENABLE0" */ +/* IILB compare NI0 input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_ni0_cmp_enable0_u { + mmr_t sh_xn_iilb_ni0_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_ni0_cmp_enable0_s; +} sh_xn_iilb_ni0_cmp_enable0_u_t; +#else +typedef union sh_xn_iilb_ni0_cmp_enable0_u { + mmr_t sh_xn_iilb_ni0_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_ni0_cmp_enable0_s; +} sh_xn_iilb_ni0_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI0_CMP_ENABLE1" */ +/* IILB compare NI0 input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_ni0_cmp_enable1_u { + mmr_t sh_xn_iilb_ni0_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_ni0_cmp_enable1_s; +} sh_xn_iilb_ni0_cmp_enable1_u_t; +#else +typedef union sh_xn_iilb_ni0_cmp_enable1_u { + mmr_t sh_xn_iilb_ni0_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_ni0_cmp_enable1_s; +} sh_xn_iilb_ni0_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI1_CMP_EXP_DATA0" */ +/* IILB compare NI1 input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_ni1_cmp_exp_data0_u { + mmr_t sh_xn_iilb_ni1_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_ni1_cmp_exp_data0_s; +} sh_xn_iilb_ni1_cmp_exp_data0_u_t; +#else +typedef union sh_xn_iilb_ni1_cmp_exp_data0_u { + mmr_t sh_xn_iilb_ni1_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_ni1_cmp_exp_data0_s; +} sh_xn_iilb_ni1_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI1_CMP_EXP_DATA1" */ +/* IILB compare NI1 input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_ni1_cmp_exp_data1_u { + mmr_t sh_xn_iilb_ni1_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_ni1_cmp_exp_data1_s; +} sh_xn_iilb_ni1_cmp_exp_data1_u_t; +#else +typedef union sh_xn_iilb_ni1_cmp_exp_data1_u { + mmr_t sh_xn_iilb_ni1_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_iilb_ni1_cmp_exp_data1_s; +} sh_xn_iilb_ni1_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI1_CMP_ENABLE0" */ +/* IILB compare NI1 input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_ni1_cmp_enable0_u { + mmr_t sh_xn_iilb_ni1_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_ni1_cmp_enable0_s; +} sh_xn_iilb_ni1_cmp_enable0_u_t; +#else +typedef union sh_xn_iilb_ni1_cmp_enable0_u { + mmr_t sh_xn_iilb_ni1_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_ni1_cmp_enable0_s; +} sh_xn_iilb_ni1_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_IILB_NI1_CMP_ENABLE1" */ +/* IILB compare NI1 input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_iilb_ni1_cmp_enable1_u { + mmr_t sh_xn_iilb_ni1_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_ni1_cmp_enable1_s; +} sh_xn_iilb_ni1_cmp_enable1_u_t; +#else +typedef union sh_xn_iilb_ni1_cmp_enable1_u { + mmr_t sh_xn_iilb_ni1_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_iilb_ni1_cmp_enable1_s; +} sh_xn_iilb_ni1_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_IILB_CMP_EXP_DATA0" */ +/* MD compare IILB input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_iilb_cmp_exp_data0_u { + mmr_t sh_xn_md_iilb_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_md_iilb_cmp_exp_data0_s; +} sh_xn_md_iilb_cmp_exp_data0_u_t; +#else +typedef union sh_xn_md_iilb_cmp_exp_data0_u { + mmr_t sh_xn_md_iilb_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_md_iilb_cmp_exp_data0_s; +} sh_xn_md_iilb_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_IILB_CMP_EXP_DATA1" */ +/* MD compare IILB input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_iilb_cmp_exp_data1_u { + mmr_t sh_xn_md_iilb_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_md_iilb_cmp_exp_data1_s; +} sh_xn_md_iilb_cmp_exp_data1_u_t; +#else +typedef union sh_xn_md_iilb_cmp_exp_data1_u { + mmr_t sh_xn_md_iilb_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_md_iilb_cmp_exp_data1_s; +} sh_xn_md_iilb_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_IILB_CMP_ENABLE0" */ +/* MD compare IILB input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_iilb_cmp_enable0_u { + mmr_t sh_xn_md_iilb_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_iilb_cmp_enable0_s; +} sh_xn_md_iilb_cmp_enable0_u_t; +#else +typedef union sh_xn_md_iilb_cmp_enable0_u { + mmr_t sh_xn_md_iilb_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_iilb_cmp_enable0_s; +} sh_xn_md_iilb_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_IILB_CMP_ENABLE1" */ +/* MD compare IILB input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_iilb_cmp_enable1_u { + mmr_t sh_xn_md_iilb_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_iilb_cmp_enable1_s; +} sh_xn_md_iilb_cmp_enable1_u_t; +#else +typedef union sh_xn_md_iilb_cmp_enable1_u { + mmr_t sh_xn_md_iilb_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_iilb_cmp_enable1_s; +} sh_xn_md_iilb_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI0_CMP_EXP_DATA0" */ +/* MD compare NI0 input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_ni0_cmp_exp_data0_u { + mmr_t sh_xn_md_ni0_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_md_ni0_cmp_exp_data0_s; +} sh_xn_md_ni0_cmp_exp_data0_u_t; +#else +typedef union sh_xn_md_ni0_cmp_exp_data0_u { + mmr_t sh_xn_md_ni0_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_md_ni0_cmp_exp_data0_s; +} sh_xn_md_ni0_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI0_CMP_EXP_DATA1" */ +/* MD compare NI0 input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_ni0_cmp_exp_data1_u { + mmr_t sh_xn_md_ni0_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_md_ni0_cmp_exp_data1_s; +} sh_xn_md_ni0_cmp_exp_data1_u_t; +#else +typedef union sh_xn_md_ni0_cmp_exp_data1_u { + mmr_t sh_xn_md_ni0_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_md_ni0_cmp_exp_data1_s; +} sh_xn_md_ni0_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI0_CMP_ENABLE0" */ +/* MD compare NI0 input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_ni0_cmp_enable0_u { + mmr_t sh_xn_md_ni0_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_ni0_cmp_enable0_s; +} sh_xn_md_ni0_cmp_enable0_u_t; +#else +typedef union sh_xn_md_ni0_cmp_enable0_u { + mmr_t sh_xn_md_ni0_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_ni0_cmp_enable0_s; +} sh_xn_md_ni0_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI0_CMP_ENABLE1" */ +/* MD compare NI0 input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_ni0_cmp_enable1_u { + mmr_t sh_xn_md_ni0_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_ni0_cmp_enable1_s; +} sh_xn_md_ni0_cmp_enable1_u_t; +#else +typedef union sh_xn_md_ni0_cmp_enable1_u { + mmr_t sh_xn_md_ni0_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_ni0_cmp_enable1_s; +} sh_xn_md_ni0_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI1_CMP_EXP_DATA0" */ +/* MD compare NI1 input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_ni1_cmp_exp_data0_u { + mmr_t sh_xn_md_ni1_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_md_ni1_cmp_exp_data0_s; +} sh_xn_md_ni1_cmp_exp_data0_u_t; +#else +typedef union sh_xn_md_ni1_cmp_exp_data0_u { + mmr_t sh_xn_md_ni1_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_md_ni1_cmp_exp_data0_s; +} sh_xn_md_ni1_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI1_CMP_EXP_DATA1" */ +/* MD compare NI1 input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_ni1_cmp_exp_data1_u { + mmr_t sh_xn_md_ni1_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_md_ni1_cmp_exp_data1_s; +} sh_xn_md_ni1_cmp_exp_data1_u_t; +#else +typedef union sh_xn_md_ni1_cmp_exp_data1_u { + mmr_t sh_xn_md_ni1_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_md_ni1_cmp_exp_data1_s; +} sh_xn_md_ni1_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI1_CMP_ENABLE0" */ +/* MD compare NI1 input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_ni1_cmp_enable0_u { + mmr_t sh_xn_md_ni1_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_ni1_cmp_enable0_s; +} sh_xn_md_ni1_cmp_enable0_u_t; +#else +typedef union sh_xn_md_ni1_cmp_enable0_u { + mmr_t sh_xn_md_ni1_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_ni1_cmp_enable0_s; +} sh_xn_md_ni1_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_NI1_CMP_ENABLE1" */ +/* MD compare NI1 input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_ni1_cmp_enable1_u { + mmr_t sh_xn_md_ni1_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_ni1_cmp_enable1_s; +} sh_xn_md_ni1_cmp_enable1_u_t; +#else +typedef union sh_xn_md_ni1_cmp_enable1_u { + mmr_t sh_xn_md_ni1_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_ni1_cmp_enable1_s; +} sh_xn_md_ni1_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_EXP_HDR0" */ +/* MD compare SIC input expected header0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_sic_cmp_exp_hdr0_u { + mmr_t sh_xn_md_sic_cmp_exp_hdr0_regval; + struct { + mmr_t data : 64; + } sh_xn_md_sic_cmp_exp_hdr0_s; +} sh_xn_md_sic_cmp_exp_hdr0_u_t; +#else +typedef union sh_xn_md_sic_cmp_exp_hdr0_u { + mmr_t sh_xn_md_sic_cmp_exp_hdr0_regval; + struct { + mmr_t data : 64; + } sh_xn_md_sic_cmp_exp_hdr0_s; +} sh_xn_md_sic_cmp_exp_hdr0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_EXP_HDR1" */ +/* MD compare SIC input expected header1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_sic_cmp_exp_hdr1_u { + mmr_t sh_xn_md_sic_cmp_exp_hdr1_regval; + struct { + mmr_t data : 42; + mmr_t reserved_0 : 22; + } sh_xn_md_sic_cmp_exp_hdr1_s; +} sh_xn_md_sic_cmp_exp_hdr1_u_t; +#else +typedef union sh_xn_md_sic_cmp_exp_hdr1_u { + mmr_t sh_xn_md_sic_cmp_exp_hdr1_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t data : 42; + } sh_xn_md_sic_cmp_exp_hdr1_s; +} sh_xn_md_sic_cmp_exp_hdr1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_HDR_ENABLE0" */ +/* MD compare SIC header enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_sic_cmp_hdr_enable0_u { + mmr_t sh_xn_md_sic_cmp_hdr_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_sic_cmp_hdr_enable0_s; +} sh_xn_md_sic_cmp_hdr_enable0_u_t; +#else +typedef union sh_xn_md_sic_cmp_hdr_enable0_u { + mmr_t sh_xn_md_sic_cmp_hdr_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_md_sic_cmp_hdr_enable0_s; +} sh_xn_md_sic_cmp_hdr_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_HDR_ENABLE1" */ +/* MD compare SIC header enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_sic_cmp_hdr_enable1_u { + mmr_t sh_xn_md_sic_cmp_hdr_enable1_regval; + struct { + mmr_t enable : 42; + mmr_t reserved_0 : 22; + } sh_xn_md_sic_cmp_hdr_enable1_s; +} sh_xn_md_sic_cmp_hdr_enable1_u_t; +#else +typedef union sh_xn_md_sic_cmp_hdr_enable1_u { + mmr_t sh_xn_md_sic_cmp_hdr_enable1_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t enable : 42; + } sh_xn_md_sic_cmp_hdr_enable1_s; +} sh_xn_md_sic_cmp_hdr_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA0" */ +/* MD compare SIC data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_sic_cmp_data0_u { + mmr_t sh_xn_md_sic_cmp_data0_regval; + struct { + mmr_t data0 : 64; + } sh_xn_md_sic_cmp_data0_s; +} sh_xn_md_sic_cmp_data0_u_t; +#else +typedef union sh_xn_md_sic_cmp_data0_u { + mmr_t sh_xn_md_sic_cmp_data0_regval; + struct { + mmr_t data0 : 64; + } sh_xn_md_sic_cmp_data0_s; +} sh_xn_md_sic_cmp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA1" */ +/* MD compare SIC data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_sic_cmp_data1_u { + mmr_t sh_xn_md_sic_cmp_data1_regval; + struct { + mmr_t data1 : 64; + } sh_xn_md_sic_cmp_data1_s; +} sh_xn_md_sic_cmp_data1_u_t; +#else +typedef union sh_xn_md_sic_cmp_data1_u { + mmr_t sh_xn_md_sic_cmp_data1_regval; + struct { + mmr_t data1 : 64; + } sh_xn_md_sic_cmp_data1_s; +} sh_xn_md_sic_cmp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA2" */ +/* MD compare SIC data2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_sic_cmp_data2_u { + mmr_t sh_xn_md_sic_cmp_data2_regval; + struct { + mmr_t data2 : 64; + } sh_xn_md_sic_cmp_data2_s; +} sh_xn_md_sic_cmp_data2_u_t; +#else +typedef union sh_xn_md_sic_cmp_data2_u { + mmr_t sh_xn_md_sic_cmp_data2_regval; + struct { + mmr_t data2 : 64; + } sh_xn_md_sic_cmp_data2_s; +} sh_xn_md_sic_cmp_data2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA3" */ +/* MD compare SIC data3 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_sic_cmp_data3_u { + mmr_t sh_xn_md_sic_cmp_data3_regval; + struct { + mmr_t data3 : 64; + } sh_xn_md_sic_cmp_data3_s; +} sh_xn_md_sic_cmp_data3_u_t; +#else +typedef union sh_xn_md_sic_cmp_data3_u { + mmr_t sh_xn_md_sic_cmp_data3_regval; + struct { + mmr_t data3 : 64; + } sh_xn_md_sic_cmp_data3_s; +} sh_xn_md_sic_cmp_data3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA_ENABLE0" */ +/* MD enable compare SIC data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_sic_cmp_data_enable0_u { + mmr_t sh_xn_md_sic_cmp_data_enable0_regval; + struct { + mmr_t data_enable0 : 64; + } sh_xn_md_sic_cmp_data_enable0_s; +} sh_xn_md_sic_cmp_data_enable0_u_t; +#else +typedef union sh_xn_md_sic_cmp_data_enable0_u { + mmr_t sh_xn_md_sic_cmp_data_enable0_regval; + struct { + mmr_t data_enable0 : 64; + } sh_xn_md_sic_cmp_data_enable0_s; +} sh_xn_md_sic_cmp_data_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA_ENABLE1" */ +/* MD enable compare SIC data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_sic_cmp_data_enable1_u { + mmr_t sh_xn_md_sic_cmp_data_enable1_regval; + struct { + mmr_t data_enable1 : 64; + } sh_xn_md_sic_cmp_data_enable1_s; +} sh_xn_md_sic_cmp_data_enable1_u_t; +#else +typedef union sh_xn_md_sic_cmp_data_enable1_u { + mmr_t sh_xn_md_sic_cmp_data_enable1_regval; + struct { + mmr_t data_enable1 : 64; + } sh_xn_md_sic_cmp_data_enable1_s; +} sh_xn_md_sic_cmp_data_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA_ENABLE2" */ +/* MD enable compare SIC data2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_sic_cmp_data_enable2_u { + mmr_t sh_xn_md_sic_cmp_data_enable2_regval; + struct { + mmr_t data_enable2 : 64; + } sh_xn_md_sic_cmp_data_enable2_s; +} sh_xn_md_sic_cmp_data_enable2_u_t; +#else +typedef union sh_xn_md_sic_cmp_data_enable2_u { + mmr_t sh_xn_md_sic_cmp_data_enable2_regval; + struct { + mmr_t data_enable2 : 64; + } sh_xn_md_sic_cmp_data_enable2_s; +} sh_xn_md_sic_cmp_data_enable2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_SIC_CMP_DATA_ENABLE3" */ +/* MD enable compare SIC data3 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_sic_cmp_data_enable3_u { + mmr_t sh_xn_md_sic_cmp_data_enable3_regval; + struct { + mmr_t data_enable3 : 64; + } sh_xn_md_sic_cmp_data_enable3_s; +} sh_xn_md_sic_cmp_data_enable3_u_t; +#else +typedef union sh_xn_md_sic_cmp_data_enable3_u { + mmr_t sh_xn_md_sic_cmp_data_enable3_regval; + struct { + mmr_t data_enable3 : 64; + } sh_xn_md_sic_cmp_data_enable3_s; +} sh_xn_md_sic_cmp_data_enable3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_IILB_CMP_EXP_DATA0" */ +/* PI compare IILB input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_iilb_cmp_exp_data0_u { + mmr_t sh_xn_pi_iilb_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_iilb_cmp_exp_data0_s; +} sh_xn_pi_iilb_cmp_exp_data0_u_t; +#else +typedef union sh_xn_pi_iilb_cmp_exp_data0_u { + mmr_t sh_xn_pi_iilb_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_iilb_cmp_exp_data0_s; +} sh_xn_pi_iilb_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_IILB_CMP_EXP_DATA1" */ +/* PI compare IILB input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_iilb_cmp_exp_data1_u { + mmr_t sh_xn_pi_iilb_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_iilb_cmp_exp_data1_s; +} sh_xn_pi_iilb_cmp_exp_data1_u_t; +#else +typedef union sh_xn_pi_iilb_cmp_exp_data1_u { + mmr_t sh_xn_pi_iilb_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_iilb_cmp_exp_data1_s; +} sh_xn_pi_iilb_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_IILB_CMP_ENABLE0" */ +/* PI compare IILB input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_iilb_cmp_enable0_u { + mmr_t sh_xn_pi_iilb_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_iilb_cmp_enable0_s; +} sh_xn_pi_iilb_cmp_enable0_u_t; +#else +typedef union sh_xn_pi_iilb_cmp_enable0_u { + mmr_t sh_xn_pi_iilb_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_iilb_cmp_enable0_s; +} sh_xn_pi_iilb_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_IILB_CMP_ENABLE1" */ +/* PI compare IILB input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_iilb_cmp_enable1_u { + mmr_t sh_xn_pi_iilb_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_iilb_cmp_enable1_s; +} sh_xn_pi_iilb_cmp_enable1_u_t; +#else +typedef union sh_xn_pi_iilb_cmp_enable1_u { + mmr_t sh_xn_pi_iilb_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_iilb_cmp_enable1_s; +} sh_xn_pi_iilb_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI0_CMP_EXP_DATA0" */ +/* PI compare NI0 input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_ni0_cmp_exp_data0_u { + mmr_t sh_xn_pi_ni0_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_ni0_cmp_exp_data0_s; +} sh_xn_pi_ni0_cmp_exp_data0_u_t; +#else +typedef union sh_xn_pi_ni0_cmp_exp_data0_u { + mmr_t sh_xn_pi_ni0_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_ni0_cmp_exp_data0_s; +} sh_xn_pi_ni0_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI0_CMP_EXP_DATA1" */ +/* PI compare NI0 input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_ni0_cmp_exp_data1_u { + mmr_t sh_xn_pi_ni0_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_ni0_cmp_exp_data1_s; +} sh_xn_pi_ni0_cmp_exp_data1_u_t; +#else +typedef union sh_xn_pi_ni0_cmp_exp_data1_u { + mmr_t sh_xn_pi_ni0_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_ni0_cmp_exp_data1_s; +} sh_xn_pi_ni0_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI0_CMP_ENABLE0" */ +/* PI compare NI0 input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_ni0_cmp_enable0_u { + mmr_t sh_xn_pi_ni0_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_ni0_cmp_enable0_s; +} sh_xn_pi_ni0_cmp_enable0_u_t; +#else +typedef union sh_xn_pi_ni0_cmp_enable0_u { + mmr_t sh_xn_pi_ni0_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_ni0_cmp_enable0_s; +} sh_xn_pi_ni0_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI0_CMP_ENABLE1" */ +/* PI compare NI0 input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_ni0_cmp_enable1_u { + mmr_t sh_xn_pi_ni0_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_ni0_cmp_enable1_s; +} sh_xn_pi_ni0_cmp_enable1_u_t; +#else +typedef union sh_xn_pi_ni0_cmp_enable1_u { + mmr_t sh_xn_pi_ni0_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_ni0_cmp_enable1_s; +} sh_xn_pi_ni0_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI1_CMP_EXP_DATA0" */ +/* PI compare NI1 input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_ni1_cmp_exp_data0_u { + mmr_t sh_xn_pi_ni1_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_ni1_cmp_exp_data0_s; +} sh_xn_pi_ni1_cmp_exp_data0_u_t; +#else +typedef union sh_xn_pi_ni1_cmp_exp_data0_u { + mmr_t sh_xn_pi_ni1_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_ni1_cmp_exp_data0_s; +} sh_xn_pi_ni1_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI1_CMP_EXP_DATA1" */ +/* PI compare NI1 input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_ni1_cmp_exp_data1_u { + mmr_t sh_xn_pi_ni1_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_ni1_cmp_exp_data1_s; +} sh_xn_pi_ni1_cmp_exp_data1_u_t; +#else +typedef union sh_xn_pi_ni1_cmp_exp_data1_u { + mmr_t sh_xn_pi_ni1_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_ni1_cmp_exp_data1_s; +} sh_xn_pi_ni1_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI1_CMP_ENABLE0" */ +/* PI compare NI1 input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_ni1_cmp_enable0_u { + mmr_t sh_xn_pi_ni1_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_ni1_cmp_enable0_s; +} sh_xn_pi_ni1_cmp_enable0_u_t; +#else +typedef union sh_xn_pi_ni1_cmp_enable0_u { + mmr_t sh_xn_pi_ni1_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_ni1_cmp_enable0_s; +} sh_xn_pi_ni1_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_NI1_CMP_ENABLE1" */ +/* PI compare NI1 input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_ni1_cmp_enable1_u { + mmr_t sh_xn_pi_ni1_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_ni1_cmp_enable1_s; +} sh_xn_pi_ni1_cmp_enable1_u_t; +#else +typedef union sh_xn_pi_ni1_cmp_enable1_u { + mmr_t sh_xn_pi_ni1_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_ni1_cmp_enable1_s; +} sh_xn_pi_ni1_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_EXP_HDR0" */ +/* PI compare SIC input expected header0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_sic_cmp_exp_hdr0_u { + mmr_t sh_xn_pi_sic_cmp_exp_hdr0_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_sic_cmp_exp_hdr0_s; +} sh_xn_pi_sic_cmp_exp_hdr0_u_t; +#else +typedef union sh_xn_pi_sic_cmp_exp_hdr0_u { + mmr_t sh_xn_pi_sic_cmp_exp_hdr0_regval; + struct { + mmr_t data : 64; + } sh_xn_pi_sic_cmp_exp_hdr0_s; +} sh_xn_pi_sic_cmp_exp_hdr0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_EXP_HDR1" */ +/* PI compare SIC input expected header1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_sic_cmp_exp_hdr1_u { + mmr_t sh_xn_pi_sic_cmp_exp_hdr1_regval; + struct { + mmr_t data : 42; + mmr_t reserved_0 : 22; + } sh_xn_pi_sic_cmp_exp_hdr1_s; +} sh_xn_pi_sic_cmp_exp_hdr1_u_t; +#else +typedef union sh_xn_pi_sic_cmp_exp_hdr1_u { + mmr_t sh_xn_pi_sic_cmp_exp_hdr1_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t data : 42; + } sh_xn_pi_sic_cmp_exp_hdr1_s; +} sh_xn_pi_sic_cmp_exp_hdr1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_HDR_ENABLE0" */ +/* PI compare SIC header enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_sic_cmp_hdr_enable0_u { + mmr_t sh_xn_pi_sic_cmp_hdr_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_sic_cmp_hdr_enable0_s; +} sh_xn_pi_sic_cmp_hdr_enable0_u_t; +#else +typedef union sh_xn_pi_sic_cmp_hdr_enable0_u { + mmr_t sh_xn_pi_sic_cmp_hdr_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_pi_sic_cmp_hdr_enable0_s; +} sh_xn_pi_sic_cmp_hdr_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_HDR_ENABLE1" */ +/* PI compare SIC header enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_sic_cmp_hdr_enable1_u { + mmr_t sh_xn_pi_sic_cmp_hdr_enable1_regval; + struct { + mmr_t enable : 42; + mmr_t reserved_0 : 22; + } sh_xn_pi_sic_cmp_hdr_enable1_s; +} sh_xn_pi_sic_cmp_hdr_enable1_u_t; +#else +typedef union sh_xn_pi_sic_cmp_hdr_enable1_u { + mmr_t sh_xn_pi_sic_cmp_hdr_enable1_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t enable : 42; + } sh_xn_pi_sic_cmp_hdr_enable1_s; +} sh_xn_pi_sic_cmp_hdr_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA0" */ +/* PI compare SIC data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_sic_cmp_data0_u { + mmr_t sh_xn_pi_sic_cmp_data0_regval; + struct { + mmr_t data0 : 64; + } sh_xn_pi_sic_cmp_data0_s; +} sh_xn_pi_sic_cmp_data0_u_t; +#else +typedef union sh_xn_pi_sic_cmp_data0_u { + mmr_t sh_xn_pi_sic_cmp_data0_regval; + struct { + mmr_t data0 : 64; + } sh_xn_pi_sic_cmp_data0_s; +} sh_xn_pi_sic_cmp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA1" */ +/* PI compare SIC data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_sic_cmp_data1_u { + mmr_t sh_xn_pi_sic_cmp_data1_regval; + struct { + mmr_t data1 : 64; + } sh_xn_pi_sic_cmp_data1_s; +} sh_xn_pi_sic_cmp_data1_u_t; +#else +typedef union sh_xn_pi_sic_cmp_data1_u { + mmr_t sh_xn_pi_sic_cmp_data1_regval; + struct { + mmr_t data1 : 64; + } sh_xn_pi_sic_cmp_data1_s; +} sh_xn_pi_sic_cmp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA2" */ +/* PI compare SIC data2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_sic_cmp_data2_u { + mmr_t sh_xn_pi_sic_cmp_data2_regval; + struct { + mmr_t data2 : 64; + } sh_xn_pi_sic_cmp_data2_s; +} sh_xn_pi_sic_cmp_data2_u_t; +#else +typedef union sh_xn_pi_sic_cmp_data2_u { + mmr_t sh_xn_pi_sic_cmp_data2_regval; + struct { + mmr_t data2 : 64; + } sh_xn_pi_sic_cmp_data2_s; +} sh_xn_pi_sic_cmp_data2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA3" */ +/* PI compare SIC data3 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_sic_cmp_data3_u { + mmr_t sh_xn_pi_sic_cmp_data3_regval; + struct { + mmr_t data3 : 64; + } sh_xn_pi_sic_cmp_data3_s; +} sh_xn_pi_sic_cmp_data3_u_t; +#else +typedef union sh_xn_pi_sic_cmp_data3_u { + mmr_t sh_xn_pi_sic_cmp_data3_regval; + struct { + mmr_t data3 : 64; + } sh_xn_pi_sic_cmp_data3_s; +} sh_xn_pi_sic_cmp_data3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA_ENABLE0" */ +/* PI enable compare SIC data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_sic_cmp_data_enable0_u { + mmr_t sh_xn_pi_sic_cmp_data_enable0_regval; + struct { + mmr_t data_enable0 : 64; + } sh_xn_pi_sic_cmp_data_enable0_s; +} sh_xn_pi_sic_cmp_data_enable0_u_t; +#else +typedef union sh_xn_pi_sic_cmp_data_enable0_u { + mmr_t sh_xn_pi_sic_cmp_data_enable0_regval; + struct { + mmr_t data_enable0 : 64; + } sh_xn_pi_sic_cmp_data_enable0_s; +} sh_xn_pi_sic_cmp_data_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA_ENABLE1" */ +/* PI enable compare SIC data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_sic_cmp_data_enable1_u { + mmr_t sh_xn_pi_sic_cmp_data_enable1_regval; + struct { + mmr_t data_enable1 : 64; + } sh_xn_pi_sic_cmp_data_enable1_s; +} sh_xn_pi_sic_cmp_data_enable1_u_t; +#else +typedef union sh_xn_pi_sic_cmp_data_enable1_u { + mmr_t sh_xn_pi_sic_cmp_data_enable1_regval; + struct { + mmr_t data_enable1 : 64; + } sh_xn_pi_sic_cmp_data_enable1_s; +} sh_xn_pi_sic_cmp_data_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA_ENABLE2" */ +/* PI enable compare SIC data2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_sic_cmp_data_enable2_u { + mmr_t sh_xn_pi_sic_cmp_data_enable2_regval; + struct { + mmr_t data_enable2 : 64; + } sh_xn_pi_sic_cmp_data_enable2_s; +} sh_xn_pi_sic_cmp_data_enable2_u_t; +#else +typedef union sh_xn_pi_sic_cmp_data_enable2_u { + mmr_t sh_xn_pi_sic_cmp_data_enable2_regval; + struct { + mmr_t data_enable2 : 64; + } sh_xn_pi_sic_cmp_data_enable2_s; +} sh_xn_pi_sic_cmp_data_enable2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_PI_SIC_CMP_DATA_ENABLE3" */ +/* PI enable compare SIC data3 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_pi_sic_cmp_data_enable3_u { + mmr_t sh_xn_pi_sic_cmp_data_enable3_regval; + struct { + mmr_t data_enable3 : 64; + } sh_xn_pi_sic_cmp_data_enable3_s; +} sh_xn_pi_sic_cmp_data_enable3_u_t; +#else +typedef union sh_xn_pi_sic_cmp_data_enable3_u { + mmr_t sh_xn_pi_sic_cmp_data_enable3_regval; + struct { + mmr_t data_enable3 : 64; + } sh_xn_pi_sic_cmp_data_enable3_s; +} sh_xn_pi_sic_cmp_data_enable3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_IILB_CMP_EXP_DATA0" */ +/* NI0 compare IILB input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_iilb_cmp_exp_data0_u { + mmr_t sh_xn_ni0_iilb_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_iilb_cmp_exp_data0_s; +} sh_xn_ni0_iilb_cmp_exp_data0_u_t; +#else +typedef union sh_xn_ni0_iilb_cmp_exp_data0_u { + mmr_t sh_xn_ni0_iilb_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_iilb_cmp_exp_data0_s; +} sh_xn_ni0_iilb_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_IILB_CMP_EXP_DATA1" */ +/* NI0 compare IILB input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_iilb_cmp_exp_data1_u { + mmr_t sh_xn_ni0_iilb_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_iilb_cmp_exp_data1_s; +} sh_xn_ni0_iilb_cmp_exp_data1_u_t; +#else +typedef union sh_xn_ni0_iilb_cmp_exp_data1_u { + mmr_t sh_xn_ni0_iilb_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_iilb_cmp_exp_data1_s; +} sh_xn_ni0_iilb_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_IILB_CMP_ENABLE0" */ +/* NI0 compare IILB input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_iilb_cmp_enable0_u { + mmr_t sh_xn_ni0_iilb_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_iilb_cmp_enable0_s; +} sh_xn_ni0_iilb_cmp_enable0_u_t; +#else +typedef union sh_xn_ni0_iilb_cmp_enable0_u { + mmr_t sh_xn_ni0_iilb_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_iilb_cmp_enable0_s; +} sh_xn_ni0_iilb_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_IILB_CMP_ENABLE1" */ +/* NI0 compare IILB input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_iilb_cmp_enable1_u { + mmr_t sh_xn_ni0_iilb_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_iilb_cmp_enable1_s; +} sh_xn_ni0_iilb_cmp_enable1_u_t; +#else +typedef union sh_xn_ni0_iilb_cmp_enable1_u { + mmr_t sh_xn_ni0_iilb_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_iilb_cmp_enable1_s; +} sh_xn_ni0_iilb_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_PI_CMP_EXP_DATA0" */ +/* NI0 compare PI input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_pi_cmp_exp_data0_u { + mmr_t sh_xn_ni0_pi_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_pi_cmp_exp_data0_s; +} sh_xn_ni0_pi_cmp_exp_data0_u_t; +#else +typedef union sh_xn_ni0_pi_cmp_exp_data0_u { + mmr_t sh_xn_ni0_pi_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_pi_cmp_exp_data0_s; +} sh_xn_ni0_pi_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_PI_CMP_EXP_DATA1" */ +/* NI0 compare PI input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_pi_cmp_exp_data1_u { + mmr_t sh_xn_ni0_pi_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_pi_cmp_exp_data1_s; +} sh_xn_ni0_pi_cmp_exp_data1_u_t; +#else +typedef union sh_xn_ni0_pi_cmp_exp_data1_u { + mmr_t sh_xn_ni0_pi_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_pi_cmp_exp_data1_s; +} sh_xn_ni0_pi_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_PI_CMP_ENABLE0" */ +/* NI0 compare PI input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_pi_cmp_enable0_u { + mmr_t sh_xn_ni0_pi_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_pi_cmp_enable0_s; +} sh_xn_ni0_pi_cmp_enable0_u_t; +#else +typedef union sh_xn_ni0_pi_cmp_enable0_u { + mmr_t sh_xn_ni0_pi_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_pi_cmp_enable0_s; +} sh_xn_ni0_pi_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_PI_CMP_ENABLE1" */ +/* NI0 compare PI input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_pi_cmp_enable1_u { + mmr_t sh_xn_ni0_pi_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_pi_cmp_enable1_s; +} sh_xn_ni0_pi_cmp_enable1_u_t; +#else +typedef union sh_xn_ni0_pi_cmp_enable1_u { + mmr_t sh_xn_ni0_pi_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_pi_cmp_enable1_s; +} sh_xn_ni0_pi_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_MD_CMP_EXP_DATA0" */ +/* NI0 compare MD input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_md_cmp_exp_data0_u { + mmr_t sh_xn_ni0_md_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_md_cmp_exp_data0_s; +} sh_xn_ni0_md_cmp_exp_data0_u_t; +#else +typedef union sh_xn_ni0_md_cmp_exp_data0_u { + mmr_t sh_xn_ni0_md_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_md_cmp_exp_data0_s; +} sh_xn_ni0_md_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_MD_CMP_EXP_DATA1" */ +/* NI0 compare MD input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_md_cmp_exp_data1_u { + mmr_t sh_xn_ni0_md_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_md_cmp_exp_data1_s; +} sh_xn_ni0_md_cmp_exp_data1_u_t; +#else +typedef union sh_xn_ni0_md_cmp_exp_data1_u { + mmr_t sh_xn_ni0_md_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_md_cmp_exp_data1_s; +} sh_xn_ni0_md_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_MD_CMP_ENABLE0" */ +/* NI0 compare MD input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_md_cmp_enable0_u { + mmr_t sh_xn_ni0_md_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_md_cmp_enable0_s; +} sh_xn_ni0_md_cmp_enable0_u_t; +#else +typedef union sh_xn_ni0_md_cmp_enable0_u { + mmr_t sh_xn_ni0_md_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_md_cmp_enable0_s; +} sh_xn_ni0_md_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_MD_CMP_ENABLE1" */ +/* NI0 compare MD input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_md_cmp_enable1_u { + mmr_t sh_xn_ni0_md_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_md_cmp_enable1_s; +} sh_xn_ni0_md_cmp_enable1_u_t; +#else +typedef union sh_xn_ni0_md_cmp_enable1_u { + mmr_t sh_xn_ni0_md_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_md_cmp_enable1_s; +} sh_xn_ni0_md_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_NI_CMP_EXP_DATA0" */ +/* NI0 compare NI input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_ni_cmp_exp_data0_u { + mmr_t sh_xn_ni0_ni_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_ni_cmp_exp_data0_s; +} sh_xn_ni0_ni_cmp_exp_data0_u_t; +#else +typedef union sh_xn_ni0_ni_cmp_exp_data0_u { + mmr_t sh_xn_ni0_ni_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_ni_cmp_exp_data0_s; +} sh_xn_ni0_ni_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_NI_CMP_EXP_DATA1" */ +/* NI0 compare NI input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_ni_cmp_exp_data1_u { + mmr_t sh_xn_ni0_ni_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_ni_cmp_exp_data1_s; +} sh_xn_ni0_ni_cmp_exp_data1_u_t; +#else +typedef union sh_xn_ni0_ni_cmp_exp_data1_u { + mmr_t sh_xn_ni0_ni_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_ni_cmp_exp_data1_s; +} sh_xn_ni0_ni_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_NI_CMP_ENABLE0" */ +/* NI0 compare NI input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_ni_cmp_enable0_u { + mmr_t sh_xn_ni0_ni_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_ni_cmp_enable0_s; +} sh_xn_ni0_ni_cmp_enable0_u_t; +#else +typedef union sh_xn_ni0_ni_cmp_enable0_u { + mmr_t sh_xn_ni0_ni_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_ni_cmp_enable0_s; +} sh_xn_ni0_ni_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_NI_CMP_ENABLE1" */ +/* NI0 compare NI input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_ni_cmp_enable1_u { + mmr_t sh_xn_ni0_ni_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_ni_cmp_enable1_s; +} sh_xn_ni0_ni_cmp_enable1_u_t; +#else +typedef union sh_xn_ni0_ni_cmp_enable1_u { + mmr_t sh_xn_ni0_ni_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_ni_cmp_enable1_s; +} sh_xn_ni0_ni_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_LLP_CMP_EXP_DATA0" */ +/* NI0 compare LLP input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_llp_cmp_exp_data0_u { + mmr_t sh_xn_ni0_llp_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_llp_cmp_exp_data0_s; +} sh_xn_ni0_llp_cmp_exp_data0_u_t; +#else +typedef union sh_xn_ni0_llp_cmp_exp_data0_u { + mmr_t sh_xn_ni0_llp_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_llp_cmp_exp_data0_s; +} sh_xn_ni0_llp_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_LLP_CMP_EXP_DATA1" */ +/* NI0 compare LLP input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_llp_cmp_exp_data1_u { + mmr_t sh_xn_ni0_llp_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_llp_cmp_exp_data1_s; +} sh_xn_ni0_llp_cmp_exp_data1_u_t; +#else +typedef union sh_xn_ni0_llp_cmp_exp_data1_u { + mmr_t sh_xn_ni0_llp_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni0_llp_cmp_exp_data1_s; +} sh_xn_ni0_llp_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_LLP_CMP_ENABLE0" */ +/* NI0 compare LLP input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_llp_cmp_enable0_u { + mmr_t sh_xn_ni0_llp_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_llp_cmp_enable0_s; +} sh_xn_ni0_llp_cmp_enable0_u_t; +#else +typedef union sh_xn_ni0_llp_cmp_enable0_u { + mmr_t sh_xn_ni0_llp_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_llp_cmp_enable0_s; +} sh_xn_ni0_llp_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI0_LLP_CMP_ENABLE1" */ +/* NI0 compare LLP input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni0_llp_cmp_enable1_u { + mmr_t sh_xn_ni0_llp_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_llp_cmp_enable1_s; +} sh_xn_ni0_llp_cmp_enable1_u_t; +#else +typedef union sh_xn_ni0_llp_cmp_enable1_u { + mmr_t sh_xn_ni0_llp_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni0_llp_cmp_enable1_s; +} sh_xn_ni0_llp_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_IILB_CMP_EXP_DATA0" */ +/* NI1 compare IILB input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_iilb_cmp_exp_data0_u { + mmr_t sh_xn_ni1_iilb_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_iilb_cmp_exp_data0_s; +} sh_xn_ni1_iilb_cmp_exp_data0_u_t; +#else +typedef union sh_xn_ni1_iilb_cmp_exp_data0_u { + mmr_t sh_xn_ni1_iilb_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_iilb_cmp_exp_data0_s; +} sh_xn_ni1_iilb_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_IILB_CMP_EXP_DATA1" */ +/* NI1 compare IILB input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_iilb_cmp_exp_data1_u { + mmr_t sh_xn_ni1_iilb_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_iilb_cmp_exp_data1_s; +} sh_xn_ni1_iilb_cmp_exp_data1_u_t; +#else +typedef union sh_xn_ni1_iilb_cmp_exp_data1_u { + mmr_t sh_xn_ni1_iilb_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_iilb_cmp_exp_data1_s; +} sh_xn_ni1_iilb_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_IILB_CMP_ENABLE0" */ +/* NI1 compare IILB input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_iilb_cmp_enable0_u { + mmr_t sh_xn_ni1_iilb_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_iilb_cmp_enable0_s; +} sh_xn_ni1_iilb_cmp_enable0_u_t; +#else +typedef union sh_xn_ni1_iilb_cmp_enable0_u { + mmr_t sh_xn_ni1_iilb_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_iilb_cmp_enable0_s; +} sh_xn_ni1_iilb_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_IILB_CMP_ENABLE1" */ +/* NI1 compare IILB input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_iilb_cmp_enable1_u { + mmr_t sh_xn_ni1_iilb_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_iilb_cmp_enable1_s; +} sh_xn_ni1_iilb_cmp_enable1_u_t; +#else +typedef union sh_xn_ni1_iilb_cmp_enable1_u { + mmr_t sh_xn_ni1_iilb_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_iilb_cmp_enable1_s; +} sh_xn_ni1_iilb_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_PI_CMP_EXP_DATA0" */ +/* NI1 compare PI input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_pi_cmp_exp_data0_u { + mmr_t sh_xn_ni1_pi_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_pi_cmp_exp_data0_s; +} sh_xn_ni1_pi_cmp_exp_data0_u_t; +#else +typedef union sh_xn_ni1_pi_cmp_exp_data0_u { + mmr_t sh_xn_ni1_pi_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_pi_cmp_exp_data0_s; +} sh_xn_ni1_pi_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_PI_CMP_EXP_DATA1" */ +/* NI1 compare PI input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_pi_cmp_exp_data1_u { + mmr_t sh_xn_ni1_pi_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_pi_cmp_exp_data1_s; +} sh_xn_ni1_pi_cmp_exp_data1_u_t; +#else +typedef union sh_xn_ni1_pi_cmp_exp_data1_u { + mmr_t sh_xn_ni1_pi_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_pi_cmp_exp_data1_s; +} sh_xn_ni1_pi_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_PI_CMP_ENABLE0" */ +/* NI1 compare PI input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_pi_cmp_enable0_u { + mmr_t sh_xn_ni1_pi_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_pi_cmp_enable0_s; +} sh_xn_ni1_pi_cmp_enable0_u_t; +#else +typedef union sh_xn_ni1_pi_cmp_enable0_u { + mmr_t sh_xn_ni1_pi_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_pi_cmp_enable0_s; +} sh_xn_ni1_pi_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_PI_CMP_ENABLE1" */ +/* NI1 compare PI input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_pi_cmp_enable1_u { + mmr_t sh_xn_ni1_pi_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_pi_cmp_enable1_s; +} sh_xn_ni1_pi_cmp_enable1_u_t; +#else +typedef union sh_xn_ni1_pi_cmp_enable1_u { + mmr_t sh_xn_ni1_pi_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_pi_cmp_enable1_s; +} sh_xn_ni1_pi_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_MD_CMP_EXP_DATA0" */ +/* NI1 compare MD input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_md_cmp_exp_data0_u { + mmr_t sh_xn_ni1_md_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_md_cmp_exp_data0_s; +} sh_xn_ni1_md_cmp_exp_data0_u_t; +#else +typedef union sh_xn_ni1_md_cmp_exp_data0_u { + mmr_t sh_xn_ni1_md_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_md_cmp_exp_data0_s; +} sh_xn_ni1_md_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_MD_CMP_EXP_DATA1" */ +/* NI1 compare MD input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_md_cmp_exp_data1_u { + mmr_t sh_xn_ni1_md_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_md_cmp_exp_data1_s; +} sh_xn_ni1_md_cmp_exp_data1_u_t; +#else +typedef union sh_xn_ni1_md_cmp_exp_data1_u { + mmr_t sh_xn_ni1_md_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_md_cmp_exp_data1_s; +} sh_xn_ni1_md_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_MD_CMP_ENABLE0" */ +/* NI1 compare MD input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_md_cmp_enable0_u { + mmr_t sh_xn_ni1_md_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_md_cmp_enable0_s; +} sh_xn_ni1_md_cmp_enable0_u_t; +#else +typedef union sh_xn_ni1_md_cmp_enable0_u { + mmr_t sh_xn_ni1_md_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_md_cmp_enable0_s; +} sh_xn_ni1_md_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_MD_CMP_ENABLE1" */ +/* NI1 compare MD input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_md_cmp_enable1_u { + mmr_t sh_xn_ni1_md_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_md_cmp_enable1_s; +} sh_xn_ni1_md_cmp_enable1_u_t; +#else +typedef union sh_xn_ni1_md_cmp_enable1_u { + mmr_t sh_xn_ni1_md_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_md_cmp_enable1_s; +} sh_xn_ni1_md_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_NI_CMP_EXP_DATA0" */ +/* NI1 compare NI input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_ni_cmp_exp_data0_u { + mmr_t sh_xn_ni1_ni_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_ni_cmp_exp_data0_s; +} sh_xn_ni1_ni_cmp_exp_data0_u_t; +#else +typedef union sh_xn_ni1_ni_cmp_exp_data0_u { + mmr_t sh_xn_ni1_ni_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_ni_cmp_exp_data0_s; +} sh_xn_ni1_ni_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_NI_CMP_EXP_DATA1" */ +/* NI1 compare NI input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_ni_cmp_exp_data1_u { + mmr_t sh_xn_ni1_ni_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_ni_cmp_exp_data1_s; +} sh_xn_ni1_ni_cmp_exp_data1_u_t; +#else +typedef union sh_xn_ni1_ni_cmp_exp_data1_u { + mmr_t sh_xn_ni1_ni_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_ni_cmp_exp_data1_s; +} sh_xn_ni1_ni_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_NI_CMP_ENABLE0" */ +/* NI1 compare NI input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_ni_cmp_enable0_u { + mmr_t sh_xn_ni1_ni_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_ni_cmp_enable0_s; +} sh_xn_ni1_ni_cmp_enable0_u_t; +#else +typedef union sh_xn_ni1_ni_cmp_enable0_u { + mmr_t sh_xn_ni1_ni_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_ni_cmp_enable0_s; +} sh_xn_ni1_ni_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_NI_CMP_ENABLE1" */ +/* NI1 compare NI input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_ni_cmp_enable1_u { + mmr_t sh_xn_ni1_ni_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_ni_cmp_enable1_s; +} sh_xn_ni1_ni_cmp_enable1_u_t; +#else +typedef union sh_xn_ni1_ni_cmp_enable1_u { + mmr_t sh_xn_ni1_ni_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_ni_cmp_enable1_s; +} sh_xn_ni1_ni_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_LLP_CMP_EXP_DATA0" */ +/* NI1 compare LLP input expected data0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_llp_cmp_exp_data0_u { + mmr_t sh_xn_ni1_llp_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_llp_cmp_exp_data0_s; +} sh_xn_ni1_llp_cmp_exp_data0_u_t; +#else +typedef union sh_xn_ni1_llp_cmp_exp_data0_u { + mmr_t sh_xn_ni1_llp_cmp_exp_data0_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_llp_cmp_exp_data0_s; +} sh_xn_ni1_llp_cmp_exp_data0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_LLP_CMP_EXP_DATA1" */ +/* NI1 compare LLP input expected data1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_llp_cmp_exp_data1_u { + mmr_t sh_xn_ni1_llp_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_llp_cmp_exp_data1_s; +} sh_xn_ni1_llp_cmp_exp_data1_u_t; +#else +typedef union sh_xn_ni1_llp_cmp_exp_data1_u { + mmr_t sh_xn_ni1_llp_cmp_exp_data1_regval; + struct { + mmr_t data : 64; + } sh_xn_ni1_llp_cmp_exp_data1_s; +} sh_xn_ni1_llp_cmp_exp_data1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_LLP_CMP_ENABLE0" */ +/* NI1 compare LLP input enable0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_llp_cmp_enable0_u { + mmr_t sh_xn_ni1_llp_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_llp_cmp_enable0_s; +} sh_xn_ni1_llp_cmp_enable0_u_t; +#else +typedef union sh_xn_ni1_llp_cmp_enable0_u { + mmr_t sh_xn_ni1_llp_cmp_enable0_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_llp_cmp_enable0_s; +} sh_xn_ni1_llp_cmp_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_NI1_LLP_CMP_ENABLE1" */ +/* NI1 compare LLP input enable1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_ni1_llp_cmp_enable1_u { + mmr_t sh_xn_ni1_llp_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_llp_cmp_enable1_s; +} sh_xn_ni1_llp_cmp_enable1_u_t; +#else +typedef union sh_xn_ni1_llp_cmp_enable1_u { + mmr_t sh_xn_ni1_llp_cmp_enable1_regval; + struct { + mmr_t enable : 64; + } sh_xn_ni1_llp_cmp_enable1_s; +} sh_xn_ni1_llp_cmp_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_ECC_INJ_REG" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_ecc_inj_reg_u { + mmr_t sh_xnpi_ecc_inj_reg_regval; + struct { + mmr_t byte0 : 8; + mmr_t reserved_0 : 4; + mmr_t data_1shot0 : 1; + mmr_t data_cont0 : 1; + mmr_t data_cb_1shot0 : 1; + mmr_t data_cb_cont0 : 1; + mmr_t byte1 : 8; + mmr_t reserved_1 : 4; + mmr_t data_1shot1 : 1; + mmr_t data_cont1 : 1; + mmr_t data_cb_1shot1 : 1; + mmr_t data_cb_cont1 : 1; + mmr_t byte2 : 8; + mmr_t reserved_2 : 4; + mmr_t data_1shot2 : 1; + mmr_t data_cont2 : 1; + mmr_t data_cb_1shot2 : 1; + mmr_t data_cb_cont2 : 1; + mmr_t byte3 : 8; + mmr_t reserved_3 : 4; + mmr_t data_1shot3 : 1; + mmr_t data_cont3 : 1; + mmr_t data_cb_1shot3 : 1; + mmr_t data_cb_cont3 : 1; + } sh_xnpi_ecc_inj_reg_s; +} sh_xnpi_ecc_inj_reg_u_t; +#else +typedef union sh_xnpi_ecc_inj_reg_u { + mmr_t sh_xnpi_ecc_inj_reg_regval; + struct { + mmr_t data_cb_cont3 : 1; + mmr_t data_cb_1shot3 : 1; + mmr_t data_cont3 : 1; + mmr_t data_1shot3 : 1; + mmr_t reserved_3 : 4; + mmr_t byte3 : 8; + mmr_t data_cb_cont2 : 1; + mmr_t data_cb_1shot2 : 1; + mmr_t data_cont2 : 1; + mmr_t data_1shot2 : 1; + mmr_t reserved_2 : 4; + mmr_t byte2 : 8; + mmr_t data_cb_cont1 : 1; + mmr_t data_cb_1shot1 : 1; + mmr_t data_cont1 : 1; + mmr_t data_1shot1 : 1; + mmr_t reserved_1 : 4; + mmr_t byte1 : 8; + mmr_t data_cb_cont0 : 1; + mmr_t data_cb_1shot0 : 1; + mmr_t data_cont0 : 1; + mmr_t data_1shot0 : 1; + mmr_t reserved_0 : 4; + mmr_t byte0 : 8; + } sh_xnpi_ecc_inj_reg_s; +} sh_xnpi_ecc_inj_reg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_ECC0_INJ_MASK_REG" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_ecc0_inj_mask_reg_u { + mmr_t sh_xnpi_ecc0_inj_mask_reg_regval; + struct { + mmr_t mask_ecc0 : 64; + } sh_xnpi_ecc0_inj_mask_reg_s; +} sh_xnpi_ecc0_inj_mask_reg_u_t; +#else +typedef union sh_xnpi_ecc0_inj_mask_reg_u { + mmr_t sh_xnpi_ecc0_inj_mask_reg_regval; + struct { + mmr_t mask_ecc0 : 64; + } sh_xnpi_ecc0_inj_mask_reg_s; +} sh_xnpi_ecc0_inj_mask_reg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_ECC1_INJ_MASK_REG" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_ecc1_inj_mask_reg_u { + mmr_t sh_xnpi_ecc1_inj_mask_reg_regval; + struct { + mmr_t mask_ecc1 : 64; + } sh_xnpi_ecc1_inj_mask_reg_s; +} sh_xnpi_ecc1_inj_mask_reg_u_t; +#else +typedef union sh_xnpi_ecc1_inj_mask_reg_u { + mmr_t sh_xnpi_ecc1_inj_mask_reg_regval; + struct { + mmr_t mask_ecc1 : 64; + } sh_xnpi_ecc1_inj_mask_reg_s; +} sh_xnpi_ecc1_inj_mask_reg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_ECC2_INJ_MASK_REG" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_ecc2_inj_mask_reg_u { + mmr_t sh_xnpi_ecc2_inj_mask_reg_regval; + struct { + mmr_t mask_ecc2 : 64; + } sh_xnpi_ecc2_inj_mask_reg_s; +} sh_xnpi_ecc2_inj_mask_reg_u_t; +#else +typedef union sh_xnpi_ecc2_inj_mask_reg_u { + mmr_t sh_xnpi_ecc2_inj_mask_reg_regval; + struct { + mmr_t mask_ecc2 : 64; + } sh_xnpi_ecc2_inj_mask_reg_s; +} sh_xnpi_ecc2_inj_mask_reg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_ECC3_INJ_MASK_REG" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_ecc3_inj_mask_reg_u { + mmr_t sh_xnpi_ecc3_inj_mask_reg_regval; + struct { + mmr_t mask_ecc3 : 64; + } sh_xnpi_ecc3_inj_mask_reg_s; +} sh_xnpi_ecc3_inj_mask_reg_u_t; +#else +typedef union sh_xnpi_ecc3_inj_mask_reg_u { + mmr_t sh_xnpi_ecc3_inj_mask_reg_regval; + struct { + mmr_t mask_ecc3 : 64; + } sh_xnpi_ecc3_inj_mask_reg_s; +} sh_xnpi_ecc3_inj_mask_reg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_ECC_INJ_REG" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_ecc_inj_reg_u { + mmr_t sh_xnmd_ecc_inj_reg_regval; + struct { + mmr_t byte0 : 8; + mmr_t reserved_0 : 4; + mmr_t data_1shot0 : 1; + mmr_t data_cont0 : 1; + mmr_t data_cb_1shot0 : 1; + mmr_t data_cb_cont0 : 1; + mmr_t byte1 : 8; + mmr_t reserved_1 : 4; + mmr_t data_1shot1 : 1; + mmr_t data_cont1 : 1; + mmr_t data_cb_1shot1 : 1; + mmr_t data_cb_cont1 : 1; + mmr_t byte2 : 8; + mmr_t reserved_2 : 4; + mmr_t data_1shot2 : 1; + mmr_t data_cont2 : 1; + mmr_t data_cb_1shot2 : 1; + mmr_t data_cb_cont2 : 1; + mmr_t byte3 : 8; + mmr_t reserved_3 : 4; + mmr_t data_1shot3 : 1; + mmr_t data_cont3 : 1; + mmr_t data_cb_1shot3 : 1; + mmr_t data_cb_cont3 : 1; + } sh_xnmd_ecc_inj_reg_s; +} sh_xnmd_ecc_inj_reg_u_t; +#else +typedef union sh_xnmd_ecc_inj_reg_u { + mmr_t sh_xnmd_ecc_inj_reg_regval; + struct { + mmr_t data_cb_cont3 : 1; + mmr_t data_cb_1shot3 : 1; + mmr_t data_cont3 : 1; + mmr_t data_1shot3 : 1; + mmr_t reserved_3 : 4; + mmr_t byte3 : 8; + mmr_t data_cb_cont2 : 1; + mmr_t data_cb_1shot2 : 1; + mmr_t data_cont2 : 1; + mmr_t data_1shot2 : 1; + mmr_t reserved_2 : 4; + mmr_t byte2 : 8; + mmr_t data_cb_cont1 : 1; + mmr_t data_cb_1shot1 : 1; + mmr_t data_cont1 : 1; + mmr_t data_1shot1 : 1; + mmr_t reserved_1 : 4; + mmr_t byte1 : 8; + mmr_t data_cb_cont0 : 1; + mmr_t data_cb_1shot0 : 1; + mmr_t data_cont0 : 1; + mmr_t data_1shot0 : 1; + mmr_t reserved_0 : 4; + mmr_t byte0 : 8; + } sh_xnmd_ecc_inj_reg_s; +} sh_xnmd_ecc_inj_reg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_ECC0_INJ_MASK_REG" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_ecc0_inj_mask_reg_u { + mmr_t sh_xnmd_ecc0_inj_mask_reg_regval; + struct { + mmr_t mask_ecc0 : 64; + } sh_xnmd_ecc0_inj_mask_reg_s; +} sh_xnmd_ecc0_inj_mask_reg_u_t; +#else +typedef union sh_xnmd_ecc0_inj_mask_reg_u { + mmr_t sh_xnmd_ecc0_inj_mask_reg_regval; + struct { + mmr_t mask_ecc0 : 64; + } sh_xnmd_ecc0_inj_mask_reg_s; +} sh_xnmd_ecc0_inj_mask_reg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_ECC1_INJ_MASK_REG" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_ecc1_inj_mask_reg_u { + mmr_t sh_xnmd_ecc1_inj_mask_reg_regval; + struct { + mmr_t mask_ecc1 : 64; + } sh_xnmd_ecc1_inj_mask_reg_s; +} sh_xnmd_ecc1_inj_mask_reg_u_t; +#else +typedef union sh_xnmd_ecc1_inj_mask_reg_u { + mmr_t sh_xnmd_ecc1_inj_mask_reg_regval; + struct { + mmr_t mask_ecc1 : 64; + } sh_xnmd_ecc1_inj_mask_reg_s; +} sh_xnmd_ecc1_inj_mask_reg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_ECC2_INJ_MASK_REG" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_ecc2_inj_mask_reg_u { + mmr_t sh_xnmd_ecc2_inj_mask_reg_regval; + struct { + mmr_t mask_ecc2 : 64; + } sh_xnmd_ecc2_inj_mask_reg_s; +} sh_xnmd_ecc2_inj_mask_reg_u_t; +#else +typedef union sh_xnmd_ecc2_inj_mask_reg_u { + mmr_t sh_xnmd_ecc2_inj_mask_reg_regval; + struct { + mmr_t mask_ecc2 : 64; + } sh_xnmd_ecc2_inj_mask_reg_s; +} sh_xnmd_ecc2_inj_mask_reg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_ECC3_INJ_MASK_REG" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_ecc3_inj_mask_reg_u { + mmr_t sh_xnmd_ecc3_inj_mask_reg_regval; + struct { + mmr_t mask_ecc3 : 64; + } sh_xnmd_ecc3_inj_mask_reg_s; +} sh_xnmd_ecc3_inj_mask_reg_u_t; +#else +typedef union sh_xnmd_ecc3_inj_mask_reg_u { + mmr_t sh_xnmd_ecc3_inj_mask_reg_regval; + struct { + mmr_t mask_ecc3 : 64; + } sh_xnmd_ecc3_inj_mask_reg_s; +} sh_xnmd_ecc3_inj_mask_reg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_ECC_ERR_REPORT" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_ecc_err_report_u { + mmr_t sh_xnmd_ecc_err_report_regval; + struct { + mmr_t ecc_disable0 : 1; + mmr_t reserved_0 : 15; + mmr_t ecc_disable1 : 1; + mmr_t reserved_1 : 15; + mmr_t ecc_disable2 : 1; + mmr_t reserved_2 : 15; + mmr_t ecc_disable3 : 1; + mmr_t reserved_3 : 15; + } sh_xnmd_ecc_err_report_s; +} sh_xnmd_ecc_err_report_u_t; +#else +typedef union sh_xnmd_ecc_err_report_u { + mmr_t sh_xnmd_ecc_err_report_regval; + struct { + mmr_t reserved_3 : 15; + mmr_t ecc_disable3 : 1; + mmr_t reserved_2 : 15; + mmr_t ecc_disable2 : 1; + mmr_t reserved_1 : 15; + mmr_t ecc_disable1 : 1; + mmr_t reserved_0 : 15; + mmr_t ecc_disable0 : 1; + } sh_xnmd_ecc_err_report_s; +} sh_xnmd_ecc_err_report_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_SUMMARY_1" */ +/* ni0 Error Summary Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_error_summary_1_u { + mmr_t sh_ni0_error_summary_1_regval; + struct { + mmr_t overflow_fifo02_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc3 : 1; + } sh_ni0_error_summary_1_s; +} sh_ni0_error_summary_1_u_t; +#else +typedef union sh_ni0_error_summary_1_u { + mmr_t sh_ni0_error_summary_1_regval; + struct { + mmr_t tail_timeout_ni_vc3 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo02_debit0 : 1; + } sh_ni0_error_summary_1_s; +} sh_ni0_error_summary_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_SUMMARY_2" */ +/* ni0 Error Summary Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_error_summary_2_u { + mmr_t sh_ni0_error_summary_2_regval; + struct { + mmr_t illegal_vcni : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vciilb : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow2_vc2_credit : 1; + mmr_t reserved_0 : 10; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t chiplet_nomatch : 1; + mmr_t lut_read_error : 1; + mmr_t retry_timeout_error : 1; + mmr_t reserved_1 : 1; + } sh_ni0_error_summary_2_s; +} sh_ni0_error_summary_2_u_t; +#else +typedef union sh_ni0_error_summary_2_u { + mmr_t sh_ni0_error_summary_2_regval; + struct { + mmr_t reserved_1 : 1; + mmr_t retry_timeout_error : 1; + mmr_t lut_read_error : 1; + mmr_t chiplet_nomatch : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t reserved_0 : 10; + mmr_t underflow2_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t illegal_vciilb : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcni : 1; + } sh_ni0_error_summary_2_s; +} sh_ni0_error_summary_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_OVERFLOW_1" */ +/* ni0 Error Overflow Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_error_overflow_1_u { + mmr_t sh_ni0_error_overflow_1_regval; + struct { + mmr_t overflow_fifo02_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc3 : 1; + } sh_ni0_error_overflow_1_s; +} sh_ni0_error_overflow_1_u_t; +#else +typedef union sh_ni0_error_overflow_1_u { + mmr_t sh_ni0_error_overflow_1_regval; + struct { + mmr_t tail_timeout_ni_vc3 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo02_debit0 : 1; + } sh_ni0_error_overflow_1_s; +} sh_ni0_error_overflow_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_OVERFLOW_2" */ +/* ni0 Error Overflow Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_error_overflow_2_u { + mmr_t sh_ni0_error_overflow_2_regval; + struct { + mmr_t illegal_vcni : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vciilb : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow2_vc2_credit : 1; + mmr_t reserved_0 : 10; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t chiplet_nomatch : 1; + mmr_t lut_read_error : 1; + mmr_t retry_timeout_error : 1; + mmr_t reserved_1 : 1; + } sh_ni0_error_overflow_2_s; +} sh_ni0_error_overflow_2_u_t; +#else +typedef union sh_ni0_error_overflow_2_u { + mmr_t sh_ni0_error_overflow_2_regval; + struct { + mmr_t reserved_1 : 1; + mmr_t retry_timeout_error : 1; + mmr_t lut_read_error : 1; + mmr_t chiplet_nomatch : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t reserved_0 : 10; + mmr_t underflow2_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t illegal_vciilb : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcni : 1; + } sh_ni0_error_overflow_2_s; +} sh_ni0_error_overflow_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_MASK_1" */ +/* ni0 Error Mask Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_error_mask_1_u { + mmr_t sh_ni0_error_mask_1_regval; + struct { + mmr_t overflow_fifo02_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc3 : 1; + } sh_ni0_error_mask_1_s; +} sh_ni0_error_mask_1_u_t; +#else +typedef union sh_ni0_error_mask_1_u { + mmr_t sh_ni0_error_mask_1_regval; + struct { + mmr_t tail_timeout_ni_vc3 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo02_debit0 : 1; + } sh_ni0_error_mask_1_s; +} sh_ni0_error_mask_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_MASK_2" */ +/* ni0 Error Mask Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_error_mask_2_u { + mmr_t sh_ni0_error_mask_2_regval; + struct { + mmr_t illegal_vcni : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vciilb : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow2_vc2_credit : 1; + mmr_t reserved_0 : 10; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t chiplet_nomatch : 1; + mmr_t lut_read_error : 1; + mmr_t retry_timeout_error : 1; + mmr_t reserved_1 : 1; + } sh_ni0_error_mask_2_s; +} sh_ni0_error_mask_2_u_t; +#else +typedef union sh_ni0_error_mask_2_u { + mmr_t sh_ni0_error_mask_2_regval; + struct { + mmr_t reserved_1 : 1; + mmr_t retry_timeout_error : 1; + mmr_t lut_read_error : 1; + mmr_t chiplet_nomatch : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t reserved_0 : 10; + mmr_t underflow2_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t illegal_vciilb : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcni : 1; + } sh_ni0_error_mask_2_s; +} sh_ni0_error_mask_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_FIRST_ERROR_1" */ +/* ni0 First Error Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_first_error_1_u { + mmr_t sh_ni0_first_error_1_regval; + struct { + mmr_t overflow_fifo02_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc3 : 1; + } sh_ni0_first_error_1_s; +} sh_ni0_first_error_1_u_t; +#else +typedef union sh_ni0_first_error_1_u { + mmr_t sh_ni0_first_error_1_regval; + struct { + mmr_t tail_timeout_ni_vc3 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo02_debit0 : 1; + } sh_ni0_first_error_1_s; +} sh_ni0_first_error_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_FIRST_ERROR_2" */ +/* ni0 First Error Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_first_error_2_u { + mmr_t sh_ni0_first_error_2_regval; + struct { + mmr_t illegal_vcni : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vciilb : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow2_vc2_credit : 1; + mmr_t reserved_0 : 10; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t chiplet_nomatch : 1; + mmr_t lut_read_error : 1; + mmr_t retry_timeout_error : 1; + mmr_t reserved_1 : 1; + } sh_ni0_first_error_2_s; +} sh_ni0_first_error_2_u_t; +#else +typedef union sh_ni0_first_error_2_u { + mmr_t sh_ni0_first_error_2_regval; + struct { + mmr_t reserved_1 : 1; + mmr_t retry_timeout_error : 1; + mmr_t lut_read_error : 1; + mmr_t chiplet_nomatch : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t reserved_0 : 10; + mmr_t underflow2_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t illegal_vciilb : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcni : 1; + } sh_ni0_first_error_2_s; +} sh_ni0_first_error_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_DETAIL_1" */ +/* ni0 Chiplet no match header bits 63:0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_error_detail_1_u { + mmr_t sh_ni0_error_detail_1_regval; + struct { + mmr_t header : 64; + } sh_ni0_error_detail_1_s; +} sh_ni0_error_detail_1_u_t; +#else +typedef union sh_ni0_error_detail_1_u { + mmr_t sh_ni0_error_detail_1_regval; + struct { + mmr_t header : 64; + } sh_ni0_error_detail_1_s; +} sh_ni0_error_detail_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_DETAIL_2" */ +/* ni0 Chiplet no match header bits 127:64 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_error_detail_2_u { + mmr_t sh_ni0_error_detail_2_regval; + struct { + mmr_t header : 64; + } sh_ni0_error_detail_2_s; +} sh_ni0_error_detail_2_u_t; +#else +typedef union sh_ni0_error_detail_2_u { + mmr_t sh_ni0_error_detail_2_regval; + struct { + mmr_t header : 64; + } sh_ni0_error_detail_2_s; +} sh_ni0_error_detail_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_SUMMARY_1" */ +/* ni1 Error Summary Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_error_summary_1_u { + mmr_t sh_ni1_error_summary_1_regval; + struct { + mmr_t overflow_fifo02_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc3 : 1; + } sh_ni1_error_summary_1_s; +} sh_ni1_error_summary_1_u_t; +#else +typedef union sh_ni1_error_summary_1_u { + mmr_t sh_ni1_error_summary_1_regval; + struct { + mmr_t tail_timeout_ni_vc3 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo02_debit0 : 1; + } sh_ni1_error_summary_1_s; +} sh_ni1_error_summary_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_SUMMARY_2" */ +/* ni1 Error Summary Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_error_summary_2_u { + mmr_t sh_ni1_error_summary_2_regval; + struct { + mmr_t illegal_vcni : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vciilb : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow2_vc2_credit : 1; + mmr_t reserved_0 : 10; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t chiplet_nomatch : 1; + mmr_t lut_read_error : 1; + mmr_t retry_timeout_error : 1; + mmr_t reserved_1 : 1; + } sh_ni1_error_summary_2_s; +} sh_ni1_error_summary_2_u_t; +#else +typedef union sh_ni1_error_summary_2_u { + mmr_t sh_ni1_error_summary_2_regval; + struct { + mmr_t reserved_1 : 1; + mmr_t retry_timeout_error : 1; + mmr_t lut_read_error : 1; + mmr_t chiplet_nomatch : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t reserved_0 : 10; + mmr_t underflow2_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t illegal_vciilb : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcni : 1; + } sh_ni1_error_summary_2_s; +} sh_ni1_error_summary_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_OVERFLOW_1" */ +/* ni1 Error Overflow Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_error_overflow_1_u { + mmr_t sh_ni1_error_overflow_1_regval; + struct { + mmr_t overflow_fifo02_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc3 : 1; + } sh_ni1_error_overflow_1_s; +} sh_ni1_error_overflow_1_u_t; +#else +typedef union sh_ni1_error_overflow_1_u { + mmr_t sh_ni1_error_overflow_1_regval; + struct { + mmr_t tail_timeout_ni_vc3 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo02_debit0 : 1; + } sh_ni1_error_overflow_1_s; +} sh_ni1_error_overflow_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_OVERFLOW_2" */ +/* ni1 Error Overflow Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_error_overflow_2_u { + mmr_t sh_ni1_error_overflow_2_regval; + struct { + mmr_t illegal_vcni : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vciilb : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow2_vc2_credit : 1; + mmr_t reserved_0 : 10; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t chiplet_nomatch : 1; + mmr_t lut_read_error : 1; + mmr_t retry_timeout_error : 1; + mmr_t reserved_1 : 1; + } sh_ni1_error_overflow_2_s; +} sh_ni1_error_overflow_2_u_t; +#else +typedef union sh_ni1_error_overflow_2_u { + mmr_t sh_ni1_error_overflow_2_regval; + struct { + mmr_t reserved_1 : 1; + mmr_t retry_timeout_error : 1; + mmr_t lut_read_error : 1; + mmr_t chiplet_nomatch : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t reserved_0 : 10; + mmr_t underflow2_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t illegal_vciilb : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcni : 1; + } sh_ni1_error_overflow_2_s; +} sh_ni1_error_overflow_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_MASK_1" */ +/* ni1 Error Mask Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_error_mask_1_u { + mmr_t sh_ni1_error_mask_1_regval; + struct { + mmr_t overflow_fifo02_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc3 : 1; + } sh_ni1_error_mask_1_s; +} sh_ni1_error_mask_1_u_t; +#else +typedef union sh_ni1_error_mask_1_u { + mmr_t sh_ni1_error_mask_1_regval; + struct { + mmr_t tail_timeout_ni_vc3 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo02_debit0 : 1; + } sh_ni1_error_mask_1_s; +} sh_ni1_error_mask_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_MASK_2" */ +/* ni1 Error Mask Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_error_mask_2_u { + mmr_t sh_ni1_error_mask_2_regval; + struct { + mmr_t illegal_vcni : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vciilb : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow2_vc2_credit : 1; + mmr_t reserved_0 : 10; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t chiplet_nomatch : 1; + mmr_t lut_read_error : 1; + mmr_t retry_timeout_error : 1; + mmr_t reserved_1 : 1; + } sh_ni1_error_mask_2_s; +} sh_ni1_error_mask_2_u_t; +#else +typedef union sh_ni1_error_mask_2_u { + mmr_t sh_ni1_error_mask_2_regval; + struct { + mmr_t reserved_1 : 1; + mmr_t retry_timeout_error : 1; + mmr_t lut_read_error : 1; + mmr_t chiplet_nomatch : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t reserved_0 : 10; + mmr_t underflow2_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t illegal_vciilb : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcni : 1; + } sh_ni1_error_mask_2_s; +} sh_ni1_error_mask_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_FIRST_ERROR_1" */ +/* ni1 First Error Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_first_error_1_u { + mmr_t sh_ni1_first_error_1_regval; + struct { + mmr_t overflow_fifo02_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc3 : 1; + } sh_ni1_first_error_1_s; +} sh_ni1_first_error_1_u_t; +#else +typedef union sh_ni1_first_error_1_u { + mmr_t sh_ni1_first_error_1_regval; + struct { + mmr_t tail_timeout_ni_vc3 : 1; + mmr_t tail_timeout_ni_vc2 : 1; + mmr_t tail_timeout_ni_vc1 : 1; + mmr_t tail_timeout_ni_vc0 : 1; + mmr_t tail_timeout_fifo13_vc3 : 1; + mmr_t tail_timeout_fifo13_vc1 : 1; + mmr_t tail_timeout_fifo02_vc2 : 1; + mmr_t tail_timeout_fifo02_vc0 : 1; + mmr_t overflow_ni_fifo_vc3_credit : 1; + mmr_t overflow_ni_fifo_vc2_credit : 1; + mmr_t overflow_ni_fifo_vc1_credit : 1; + mmr_t overflow_ni_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_credit : 1; + mmr_t overflow_md_fifo_vc0_credit : 1; + mmr_t overflow_iilb_fifo_vc2_credit : 1; + mmr_t overflow_iilb_fifo_vc0_credit : 1; + mmr_t overflow_pi_fifo_vc2_credit : 1; + mmr_t overflow_pi_fifo_vc0_credit : 1; + mmr_t overflow_md_fifo_vc2_push : 1; + mmr_t overflow_md_fifo_vc0_push : 1; + mmr_t overflow_iilb_fifo_vc2_push : 1; + mmr_t overflow_iilb_fifo_vc0_push : 1; + mmr_t overflow_pi_fifo_vc2_push : 1; + mmr_t overflow_pi_fifo_vc0_push : 1; + mmr_t overflow_ni_fifo_vc2_pop : 1; + mmr_t overflow_ni_fifo_vc0_pop : 1; + mmr_t overflow_md_fifo_vc2_pop : 1; + mmr_t overflow_md_fifo_vc0_pop : 1; + mmr_t overflow_iilb_fifo_vc2_pop : 1; + mmr_t overflow_iilb_fifo_vc0_pop : 1; + mmr_t overflow_pi_fifo_vc2_pop : 1; + mmr_t overflow_pi_fifo_vc0_pop : 1; + mmr_t overflow_ni_fifo_debit3 : 1; + mmr_t overflow_ni_fifo_debit2 : 1; + mmr_t overflow_ni_fifo_debit1 : 1; + mmr_t overflow_ni_fifo_debit0 : 1; + mmr_t overflow_md_fifo_debit2 : 1; + mmr_t overflow_md_fifo_debit0 : 1; + mmr_t overflow_iilb_fifo_debit2 : 1; + mmr_t overflow_iilb_fifo_debit0 : 1; + mmr_t overflow_pi_fifo_debit2 : 1; + mmr_t overflow_pi_fifo_debit0 : 1; + mmr_t overflow2_vc2_credit : 1; + mmr_t overflow1_vc2_credit : 1; + mmr_t overflow0_vc2_credit : 1; + mmr_t overflow2_vc0_credit : 1; + mmr_t overflow1_vc0_credit : 1; + mmr_t overflow0_vc0_credit : 1; + mmr_t overflow_fifo13_vc2_credit : 1; + mmr_t overflow_fifo13_vc0_credit : 1; + mmr_t overflow_fifo02_vc2_credit : 1; + mmr_t overflow_fifo02_vc0_credit : 1; + mmr_t overflow_fifo13_vc3_push : 1; + mmr_t overflow_fifo13_vc1_push : 1; + mmr_t overflow_fifo02_vc2_push : 1; + mmr_t overflow_fifo02_vc0_push : 1; + mmr_t overflow_fifo13_vc3_pop : 1; + mmr_t overflow_fifo13_vc1_pop : 1; + mmr_t overflow_fifo02_vc2_pop : 1; + mmr_t overflow_fifo02_vc0_pop : 1; + mmr_t overflow_fifo13_debit2 : 1; + mmr_t overflow_fifo13_debit0 : 1; + mmr_t overflow_fifo02_debit2 : 1; + mmr_t overflow_fifo02_debit0 : 1; + } sh_ni1_first_error_1_s; +} sh_ni1_first_error_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_FIRST_ERROR_2" */ +/* ni1 First Error Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_first_error_2_u { + mmr_t sh_ni1_first_error_2_regval; + struct { + mmr_t illegal_vcni : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vciilb : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow2_vc2_credit : 1; + mmr_t reserved_0 : 10; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t chiplet_nomatch : 1; + mmr_t lut_read_error : 1; + mmr_t retry_timeout_error : 1; + mmr_t reserved_1 : 1; + } sh_ni1_first_error_2_s; +} sh_ni1_first_error_2_u_t; +#else +typedef union sh_ni1_first_error_2_u { + mmr_t sh_ni1_first_error_2_regval; + struct { + mmr_t reserved_1 : 1; + mmr_t retry_timeout_error : 1; + mmr_t lut_read_error : 1; + mmr_t chiplet_nomatch : 1; + mmr_t llp_deadlock_vc3 : 1; + mmr_t llp_deadlock_vc2 : 1; + mmr_t llp_deadlock_vc1 : 1; + mmr_t llp_deadlock_vc0 : 1; + mmr_t underflow_ni_fifo_vc3_credit : 1; + mmr_t underflow_ni_fifo_vc2_credit : 1; + mmr_t underflow_ni_fifo_vc1_credit : 1; + mmr_t underflow_ni_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_credit : 1; + mmr_t underflow_md_fifo_vc0_credit : 1; + mmr_t underflow_iilb_fifo_vc2_credit : 1; + mmr_t underflow_iilb_fifo_vc0_credit : 1; + mmr_t underflow_pi_fifo_vc2_credit : 1; + mmr_t underflow_pi_fifo_vc0_credit : 1; + mmr_t underflow_md_fifo_vc2_push : 1; + mmr_t underflow_md_fifo_vc0_push : 1; + mmr_t underflow_iilb_fifo_vc2_push : 1; + mmr_t underflow_iilb_fifo_vc0_push : 1; + mmr_t underflow_pi_fifo_vc2_push : 1; + mmr_t underflow_pi_fifo_vc0_push : 1; + mmr_t underflow_ni_fifo_vc2_pop : 1; + mmr_t underflow_ni_fifo_vc0_pop : 1; + mmr_t underflow_md_fifo_vc2_pop : 1; + mmr_t underflow_md_fifo_vc0_pop : 1; + mmr_t underflow_iilb_fifo_vc2_pop : 1; + mmr_t underflow_iilb_fifo_vc0_pop : 1; + mmr_t underflow_pi_fifo_vc2_pop : 1; + mmr_t underflow_pi_fifo_vc0_pop : 1; + mmr_t reserved_0 : 10; + mmr_t underflow2_vc2_credit : 1; + mmr_t underflow1_vc2_credit : 1; + mmr_t underflow0_vc2_credit : 1; + mmr_t underflow2_vc0_credit : 1; + mmr_t underflow1_vc0_credit : 1; + mmr_t underflow0_vc0_credit : 1; + mmr_t underflow_fifo13_vc2_credit : 1; + mmr_t underflow_fifo13_vc0_credit : 1; + mmr_t underflow_fifo02_vc2_credit : 1; + mmr_t underflow_fifo02_vc0_credit : 1; + mmr_t underflow_fifo13_vc3_push : 1; + mmr_t underflow_fifo13_vc1_push : 1; + mmr_t underflow_fifo02_vc2_push : 1; + mmr_t underflow_fifo02_vc0_push : 1; + mmr_t underflow_fifo13_vc3_pop : 1; + mmr_t underflow_fifo13_vc1_pop : 1; + mmr_t underflow_fifo02_vc2_pop : 1; + mmr_t underflow_fifo02_vc0_pop : 1; + mmr_t illegal_vciilb : 1; + mmr_t illegal_vcmd : 1; + mmr_t illegal_vcpi : 1; + mmr_t illegal_vcni : 1; + } sh_ni1_first_error_2_s; +} sh_ni1_first_error_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_DETAIL_1" */ +/* ni1 Chiplet no match header bits 63:0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_error_detail_1_u { + mmr_t sh_ni1_error_detail_1_regval; + struct { + mmr_t header : 64; + } sh_ni1_error_detail_1_s; +} sh_ni1_error_detail_1_u_t; +#else +typedef union sh_ni1_error_detail_1_u { + mmr_t sh_ni1_error_detail_1_regval; + struct { + mmr_t header : 64; + } sh_ni1_error_detail_1_s; +} sh_ni1_error_detail_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_DETAIL_2" */ +/* ni1 Chiplet no match header bits 127:64 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_error_detail_2_u { + mmr_t sh_ni1_error_detail_2_regval; + struct { + mmr_t header : 64; + } sh_ni1_error_detail_2_s; +} sh_ni1_error_detail_2_u_t; +#else +typedef union sh_ni1_error_detail_2_u { + mmr_t sh_ni1_error_detail_2_regval; + struct { + mmr_t header : 64; + } sh_ni1_error_detail_2_s; +} sh_ni1_error_detail_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_CORRECTED_DETAIL_1" */ +/* Corrected error details */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_corrected_detail_1_u { + mmr_t sh_xn_corrected_detail_1_regval; + struct { + mmr_t ecc0_syndrome : 8; + mmr_t ecc0_wc : 2; + mmr_t ecc0_vc : 2; + mmr_t reserved_0 : 4; + mmr_t ecc1_syndrome : 8; + mmr_t ecc1_wc : 2; + mmr_t ecc1_vc : 2; + mmr_t reserved_1 : 4; + mmr_t ecc2_syndrome : 8; + mmr_t ecc2_wc : 2; + mmr_t ecc2_vc : 2; + mmr_t reserved_2 : 4; + mmr_t ecc3_syndrome : 8; + mmr_t ecc3_wc : 2; + mmr_t ecc3_vc : 2; + mmr_t reserved_3 : 4; + } sh_xn_corrected_detail_1_s; +} sh_xn_corrected_detail_1_u_t; +#else +typedef union sh_xn_corrected_detail_1_u { + mmr_t sh_xn_corrected_detail_1_regval; + struct { + mmr_t reserved_3 : 4; + mmr_t ecc3_vc : 2; + mmr_t ecc3_wc : 2; + mmr_t ecc3_syndrome : 8; + mmr_t reserved_2 : 4; + mmr_t ecc2_vc : 2; + mmr_t ecc2_wc : 2; + mmr_t ecc2_syndrome : 8; + mmr_t reserved_1 : 4; + mmr_t ecc1_vc : 2; + mmr_t ecc1_wc : 2; + mmr_t ecc1_syndrome : 8; + mmr_t reserved_0 : 4; + mmr_t ecc0_vc : 2; + mmr_t ecc0_wc : 2; + mmr_t ecc0_syndrome : 8; + } sh_xn_corrected_detail_1_s; +} sh_xn_corrected_detail_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_CORRECTED_DETAIL_2" */ +/* Corrected error data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_corrected_detail_2_u { + mmr_t sh_xn_corrected_detail_2_regval; + struct { + mmr_t data : 64; + } sh_xn_corrected_detail_2_s; +} sh_xn_corrected_detail_2_u_t; +#else +typedef union sh_xn_corrected_detail_2_u { + mmr_t sh_xn_corrected_detail_2_regval; + struct { + mmr_t data : 64; + } sh_xn_corrected_detail_2_s; +} sh_xn_corrected_detail_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_CORRECTED_DETAIL_3" */ +/* Corrected error header0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_corrected_detail_3_u { + mmr_t sh_xn_corrected_detail_3_regval; + struct { + mmr_t header0 : 64; + } sh_xn_corrected_detail_3_s; +} sh_xn_corrected_detail_3_u_t; +#else +typedef union sh_xn_corrected_detail_3_u { + mmr_t sh_xn_corrected_detail_3_regval; + struct { + mmr_t header0 : 64; + } sh_xn_corrected_detail_3_s; +} sh_xn_corrected_detail_3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_CORRECTED_DETAIL_4" */ +/* Corrected error header1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_corrected_detail_4_u { + mmr_t sh_xn_corrected_detail_4_regval; + struct { + mmr_t header1 : 42; + mmr_t reserved_0 : 20; + mmr_t err_group : 2; + } sh_xn_corrected_detail_4_s; +} sh_xn_corrected_detail_4_u_t; +#else +typedef union sh_xn_corrected_detail_4_u { + mmr_t sh_xn_corrected_detail_4_regval; + struct { + mmr_t err_group : 2; + mmr_t reserved_0 : 20; + mmr_t header1 : 42; + } sh_xn_corrected_detail_4_s; +} sh_xn_corrected_detail_4_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_UNCORRECTED_DETAIL_1" */ +/* Uncorrected error details */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_uncorrected_detail_1_u { + mmr_t sh_xn_uncorrected_detail_1_regval; + struct { + mmr_t ecc0_syndrome : 8; + mmr_t ecc0_wc : 2; + mmr_t ecc0_vc : 2; + mmr_t reserved_0 : 4; + mmr_t ecc1_syndrome : 8; + mmr_t ecc1_wc : 2; + mmr_t ecc1_vc : 2; + mmr_t reserved_1 : 4; + mmr_t ecc2_syndrome : 8; + mmr_t ecc2_wc : 2; + mmr_t ecc2_vc : 2; + mmr_t reserved_2 : 4; + mmr_t ecc3_syndrome : 8; + mmr_t ecc3_wc : 2; + mmr_t ecc3_vc : 2; + mmr_t reserved_3 : 4; + } sh_xn_uncorrected_detail_1_s; +} sh_xn_uncorrected_detail_1_u_t; +#else +typedef union sh_xn_uncorrected_detail_1_u { + mmr_t sh_xn_uncorrected_detail_1_regval; + struct { + mmr_t reserved_3 : 4; + mmr_t ecc3_vc : 2; + mmr_t ecc3_wc : 2; + mmr_t ecc3_syndrome : 8; + mmr_t reserved_2 : 4; + mmr_t ecc2_vc : 2; + mmr_t ecc2_wc : 2; + mmr_t ecc2_syndrome : 8; + mmr_t reserved_1 : 4; + mmr_t ecc1_vc : 2; + mmr_t ecc1_wc : 2; + mmr_t ecc1_syndrome : 8; + mmr_t reserved_0 : 4; + mmr_t ecc0_vc : 2; + mmr_t ecc0_wc : 2; + mmr_t ecc0_syndrome : 8; + } sh_xn_uncorrected_detail_1_s; +} sh_xn_uncorrected_detail_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_UNCORRECTED_DETAIL_2" */ +/* Uncorrected error data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_uncorrected_detail_2_u { + mmr_t sh_xn_uncorrected_detail_2_regval; + struct { + mmr_t data : 64; + } sh_xn_uncorrected_detail_2_s; +} sh_xn_uncorrected_detail_2_u_t; +#else +typedef union sh_xn_uncorrected_detail_2_u { + mmr_t sh_xn_uncorrected_detail_2_regval; + struct { + mmr_t data : 64; + } sh_xn_uncorrected_detail_2_s; +} sh_xn_uncorrected_detail_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_UNCORRECTED_DETAIL_3" */ +/* Uncorrected error header0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_uncorrected_detail_3_u { + mmr_t sh_xn_uncorrected_detail_3_regval; + struct { + mmr_t header0 : 64; + } sh_xn_uncorrected_detail_3_s; +} sh_xn_uncorrected_detail_3_u_t; +#else +typedef union sh_xn_uncorrected_detail_3_u { + mmr_t sh_xn_uncorrected_detail_3_regval; + struct { + mmr_t header0 : 64; + } sh_xn_uncorrected_detail_3_s; +} sh_xn_uncorrected_detail_3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_UNCORRECTED_DETAIL_4" */ +/* Uncorrected error header1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_uncorrected_detail_4_u { + mmr_t sh_xn_uncorrected_detail_4_regval; + struct { + mmr_t header1 : 42; + mmr_t reserved_0 : 20; + mmr_t err_group : 2; + } sh_xn_uncorrected_detail_4_s; +} sh_xn_uncorrected_detail_4_u_t; +#else +typedef union sh_xn_uncorrected_detail_4_u { + mmr_t sh_xn_uncorrected_detail_4_regval; + struct { + mmr_t err_group : 2; + mmr_t reserved_0 : 20; + mmr_t header1 : 42; + } sh_xn_uncorrected_detail_4_s; +} sh_xn_uncorrected_detail_4_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_ERROR_DETAIL_1" */ +/* Look Up Table Address (md) */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_error_detail_1_u { + mmr_t sh_xnmd_error_detail_1_regval; + struct { + mmr_t lut_addr : 11; + mmr_t reserved_0 : 53; + } sh_xnmd_error_detail_1_s; +} sh_xnmd_error_detail_1_u_t; +#else +typedef union sh_xnmd_error_detail_1_u { + mmr_t sh_xnmd_error_detail_1_regval; + struct { + mmr_t reserved_0 : 53; + mmr_t lut_addr : 11; + } sh_xnmd_error_detail_1_s; +} sh_xnmd_error_detail_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_ERROR_DETAIL_1" */ +/* Look Up Table Address (pi) */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_error_detail_1_u { + mmr_t sh_xnpi_error_detail_1_regval; + struct { + mmr_t lut_addr : 11; + mmr_t reserved_0 : 53; + } sh_xnpi_error_detail_1_s; +} sh_xnpi_error_detail_1_u_t; +#else +typedef union sh_xnpi_error_detail_1_u { + mmr_t sh_xnpi_error_detail_1_regval; + struct { + mmr_t reserved_0 : 53; + mmr_t lut_addr : 11; + } sh_xnpi_error_detail_1_s; +} sh_xnpi_error_detail_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERROR_DETAIL_1" */ +/* Chiplet NoMatch header [63:0] */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_error_detail_1_u { + mmr_t sh_xniilb_error_detail_1_regval; + struct { + mmr_t header : 64; + } sh_xniilb_error_detail_1_s; +} sh_xniilb_error_detail_1_u_t; +#else +typedef union sh_xniilb_error_detail_1_u { + mmr_t sh_xniilb_error_detail_1_regval; + struct { + mmr_t header : 64; + } sh_xniilb_error_detail_1_s; +} sh_xniilb_error_detail_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERROR_DETAIL_2" */ +/* Chiplet NoMatch header [127:64] */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_error_detail_2_u { + mmr_t sh_xniilb_error_detail_2_regval; + struct { + mmr_t header : 64; + } sh_xniilb_error_detail_2_s; +} sh_xniilb_error_detail_2_u_t; +#else +typedef union sh_xniilb_error_detail_2_u { + mmr_t sh_xniilb_error_detail_2_regval; + struct { + mmr_t header : 64; + } sh_xniilb_error_detail_2_s; +} sh_xniilb_error_detail_2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERROR_DETAIL_3" */ +/* Look Up Table Address (iilb) */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_error_detail_3_u { + mmr_t sh_xniilb_error_detail_3_regval; + struct { + mmr_t lut_addr : 11; + mmr_t reserved_0 : 53; + } sh_xniilb_error_detail_3_s; +} sh_xniilb_error_detail_3_u_t; +#else +typedef union sh_xniilb_error_detail_3_u { + mmr_t sh_xniilb_error_detail_3_regval; + struct { + mmr_t reserved_0 : 53; + mmr_t lut_addr : 11; + } sh_xniilb_error_detail_3_s; +} sh_xniilb_error_detail_3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI0_ERROR_DETAIL_3" */ +/* Look Up Table Address (ni0) */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni0_error_detail_3_u { + mmr_t sh_ni0_error_detail_3_regval; + struct { + mmr_t lut_addr : 11; + mmr_t reserved_0 : 53; + } sh_ni0_error_detail_3_s; +} sh_ni0_error_detail_3_u_t; +#else +typedef union sh_ni0_error_detail_3_u { + mmr_t sh_ni0_error_detail_3_regval; + struct { + mmr_t reserved_0 : 53; + mmr_t lut_addr : 11; + } sh_ni0_error_detail_3_s; +} sh_ni0_error_detail_3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_NI1_ERROR_DETAIL_3" */ +/* Look Up Table Address (ni1) */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ni1_error_detail_3_u { + mmr_t sh_ni1_error_detail_3_regval; + struct { + mmr_t lut_addr : 11; + mmr_t reserved_0 : 53; + } sh_ni1_error_detail_3_s; +} sh_ni1_error_detail_3_u_t; +#else +typedef union sh_ni1_error_detail_3_u { + mmr_t sh_ni1_error_detail_3_regval; + struct { + mmr_t reserved_0 : 53; + mmr_t lut_addr : 11; + } sh_ni1_error_detail_3_s; +} sh_ni1_error_detail_3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_ERROR_SUMMARY" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_error_summary_u { + mmr_t sh_xn_error_summary_regval; + struct { + mmr_t ni0_pop_overflow : 1; + mmr_t ni0_push_overflow : 1; + mmr_t ni0_credit_overflow : 1; + mmr_t ni0_debit_overflow : 1; + mmr_t ni0_pop_underflow : 1; + mmr_t ni0_push_underflow : 1; + mmr_t ni0_credit_underflow : 1; + mmr_t ni0_llp_error : 1; + mmr_t ni0_pipe_error : 1; + mmr_t ni1_pop_overflow : 1; + mmr_t ni1_push_overflow : 1; + mmr_t ni1_credit_overflow : 1; + mmr_t ni1_debit_overflow : 1; + mmr_t ni1_pop_underflow : 1; + mmr_t ni1_push_underflow : 1; + mmr_t ni1_credit_underflow : 1; + mmr_t ni1_llp_error : 1; + mmr_t ni1_pipe_error : 1; + mmr_t xnmd_credit_overflow : 1; + mmr_t xnmd_debit_overflow : 1; + mmr_t xnmd_data_buff_overflow : 1; + mmr_t xnmd_credit_underflow : 1; + mmr_t xnmd_sbe_error : 1; + mmr_t xnmd_uce_error : 1; + mmr_t xnmd_lut_error : 1; + mmr_t xnpi_credit_overflow : 1; + mmr_t xnpi_debit_overflow : 1; + mmr_t xnpi_data_buff_overflow : 1; + mmr_t xnpi_credit_underflow : 1; + mmr_t xnpi_sbe_error : 1; + mmr_t xnpi_uce_error : 1; + mmr_t xnpi_lut_error : 1; + mmr_t iilb_debit_overflow : 1; + mmr_t iilb_credit_overflow : 1; + mmr_t iilb_fifo_overflow : 1; + mmr_t iilb_credit_underflow : 1; + mmr_t iilb_fifo_underflow : 1; + mmr_t iilb_chiplet_or_lut : 1; + mmr_t reserved_0 : 26; + } sh_xn_error_summary_s; +} sh_xn_error_summary_u_t; +#else +typedef union sh_xn_error_summary_u { + mmr_t sh_xn_error_summary_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t iilb_chiplet_or_lut : 1; + mmr_t iilb_fifo_underflow : 1; + mmr_t iilb_credit_underflow : 1; + mmr_t iilb_fifo_overflow : 1; + mmr_t iilb_credit_overflow : 1; + mmr_t iilb_debit_overflow : 1; + mmr_t xnpi_lut_error : 1; + mmr_t xnpi_uce_error : 1; + mmr_t xnpi_sbe_error : 1; + mmr_t xnpi_credit_underflow : 1; + mmr_t xnpi_data_buff_overflow : 1; + mmr_t xnpi_debit_overflow : 1; + mmr_t xnpi_credit_overflow : 1; + mmr_t xnmd_lut_error : 1; + mmr_t xnmd_uce_error : 1; + mmr_t xnmd_sbe_error : 1; + mmr_t xnmd_credit_underflow : 1; + mmr_t xnmd_data_buff_overflow : 1; + mmr_t xnmd_debit_overflow : 1; + mmr_t xnmd_credit_overflow : 1; + mmr_t ni1_pipe_error : 1; + mmr_t ni1_llp_error : 1; + mmr_t ni1_credit_underflow : 1; + mmr_t ni1_push_underflow : 1; + mmr_t ni1_pop_underflow : 1; + mmr_t ni1_debit_overflow : 1; + mmr_t ni1_credit_overflow : 1; + mmr_t ni1_push_overflow : 1; + mmr_t ni1_pop_overflow : 1; + mmr_t ni0_pipe_error : 1; + mmr_t ni0_llp_error : 1; + mmr_t ni0_credit_underflow : 1; + mmr_t ni0_push_underflow : 1; + mmr_t ni0_pop_underflow : 1; + mmr_t ni0_debit_overflow : 1; + mmr_t ni0_credit_overflow : 1; + mmr_t ni0_push_overflow : 1; + mmr_t ni0_pop_overflow : 1; + } sh_xn_error_summary_s; +} sh_xn_error_summary_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_ERROR_OVERFLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_error_overflow_u { + mmr_t sh_xn_error_overflow_regval; + struct { + mmr_t ni0_pop_overflow : 1; + mmr_t ni0_push_overflow : 1; + mmr_t ni0_credit_overflow : 1; + mmr_t ni0_debit_overflow : 1; + mmr_t ni0_pop_underflow : 1; + mmr_t ni0_push_underflow : 1; + mmr_t ni0_credit_underflow : 1; + mmr_t ni0_llp_error : 1; + mmr_t ni0_pipe_error : 1; + mmr_t ni1_pop_overflow : 1; + mmr_t ni1_push_overflow : 1; + mmr_t ni1_credit_overflow : 1; + mmr_t ni1_debit_overflow : 1; + mmr_t ni1_pop_underflow : 1; + mmr_t ni1_push_underflow : 1; + mmr_t ni1_credit_underflow : 1; + mmr_t ni1_llp_error : 1; + mmr_t ni1_pipe_error : 1; + mmr_t xnmd_credit_overflow : 1; + mmr_t xnmd_debit_overflow : 1; + mmr_t xnmd_data_buff_overflow : 1; + mmr_t xnmd_credit_underflow : 1; + mmr_t xnmd_sbe_error : 1; + mmr_t xnmd_uce_error : 1; + mmr_t xnmd_lut_error : 1; + mmr_t xnpi_credit_overflow : 1; + mmr_t xnpi_debit_overflow : 1; + mmr_t xnpi_data_buff_overflow : 1; + mmr_t xnpi_credit_underflow : 1; + mmr_t xnpi_sbe_error : 1; + mmr_t xnpi_uce_error : 1; + mmr_t xnpi_lut_error : 1; + mmr_t iilb_debit_overflow : 1; + mmr_t iilb_credit_overflow : 1; + mmr_t iilb_fifo_overflow : 1; + mmr_t iilb_credit_underflow : 1; + mmr_t iilb_fifo_underflow : 1; + mmr_t iilb_chiplet_or_lut : 1; + mmr_t reserved_0 : 26; + } sh_xn_error_overflow_s; +} sh_xn_error_overflow_u_t; +#else +typedef union sh_xn_error_overflow_u { + mmr_t sh_xn_error_overflow_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t iilb_chiplet_or_lut : 1; + mmr_t iilb_fifo_underflow : 1; + mmr_t iilb_credit_underflow : 1; + mmr_t iilb_fifo_overflow : 1; + mmr_t iilb_credit_overflow : 1; + mmr_t iilb_debit_overflow : 1; + mmr_t xnpi_lut_error : 1; + mmr_t xnpi_uce_error : 1; + mmr_t xnpi_sbe_error : 1; + mmr_t xnpi_credit_underflow : 1; + mmr_t xnpi_data_buff_overflow : 1; + mmr_t xnpi_debit_overflow : 1; + mmr_t xnpi_credit_overflow : 1; + mmr_t xnmd_lut_error : 1; + mmr_t xnmd_uce_error : 1; + mmr_t xnmd_sbe_error : 1; + mmr_t xnmd_credit_underflow : 1; + mmr_t xnmd_data_buff_overflow : 1; + mmr_t xnmd_debit_overflow : 1; + mmr_t xnmd_credit_overflow : 1; + mmr_t ni1_pipe_error : 1; + mmr_t ni1_llp_error : 1; + mmr_t ni1_credit_underflow : 1; + mmr_t ni1_push_underflow : 1; + mmr_t ni1_pop_underflow : 1; + mmr_t ni1_debit_overflow : 1; + mmr_t ni1_credit_overflow : 1; + mmr_t ni1_push_overflow : 1; + mmr_t ni1_pop_overflow : 1; + mmr_t ni0_pipe_error : 1; + mmr_t ni0_llp_error : 1; + mmr_t ni0_credit_underflow : 1; + mmr_t ni0_push_underflow : 1; + mmr_t ni0_pop_underflow : 1; + mmr_t ni0_debit_overflow : 1; + mmr_t ni0_credit_overflow : 1; + mmr_t ni0_push_overflow : 1; + mmr_t ni0_pop_overflow : 1; + } sh_xn_error_overflow_s; +} sh_xn_error_overflow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_ERROR_MASK" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_error_mask_u { + mmr_t sh_xn_error_mask_regval; + struct { + mmr_t ni0_pop_overflow : 1; + mmr_t ni0_push_overflow : 1; + mmr_t ni0_credit_overflow : 1; + mmr_t ni0_debit_overflow : 1; + mmr_t ni0_pop_underflow : 1; + mmr_t ni0_push_underflow : 1; + mmr_t ni0_credit_underflow : 1; + mmr_t ni0_llp_error : 1; + mmr_t ni0_pipe_error : 1; + mmr_t ni1_pop_overflow : 1; + mmr_t ni1_push_overflow : 1; + mmr_t ni1_credit_overflow : 1; + mmr_t ni1_debit_overflow : 1; + mmr_t ni1_pop_underflow : 1; + mmr_t ni1_push_underflow : 1; + mmr_t ni1_credit_underflow : 1; + mmr_t ni1_llp_error : 1; + mmr_t ni1_pipe_error : 1; + mmr_t xnmd_credit_overflow : 1; + mmr_t xnmd_debit_overflow : 1; + mmr_t xnmd_data_buff_overflow : 1; + mmr_t xnmd_credit_underflow : 1; + mmr_t xnmd_sbe_error : 1; + mmr_t xnmd_uce_error : 1; + mmr_t xnmd_lut_error : 1; + mmr_t xnpi_credit_overflow : 1; + mmr_t xnpi_debit_overflow : 1; + mmr_t xnpi_data_buff_overflow : 1; + mmr_t xnpi_credit_underflow : 1; + mmr_t xnpi_sbe_error : 1; + mmr_t xnpi_uce_error : 1; + mmr_t xnpi_lut_error : 1; + mmr_t iilb_debit_overflow : 1; + mmr_t iilb_credit_overflow : 1; + mmr_t iilb_fifo_overflow : 1; + mmr_t iilb_credit_underflow : 1; + mmr_t iilb_fifo_underflow : 1; + mmr_t iilb_chiplet_or_lut : 1; + mmr_t reserved_0 : 26; + } sh_xn_error_mask_s; +} sh_xn_error_mask_u_t; +#else +typedef union sh_xn_error_mask_u { + mmr_t sh_xn_error_mask_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t iilb_chiplet_or_lut : 1; + mmr_t iilb_fifo_underflow : 1; + mmr_t iilb_credit_underflow : 1; + mmr_t iilb_fifo_overflow : 1; + mmr_t iilb_credit_overflow : 1; + mmr_t iilb_debit_overflow : 1; + mmr_t xnpi_lut_error : 1; + mmr_t xnpi_uce_error : 1; + mmr_t xnpi_sbe_error : 1; + mmr_t xnpi_credit_underflow : 1; + mmr_t xnpi_data_buff_overflow : 1; + mmr_t xnpi_debit_overflow : 1; + mmr_t xnpi_credit_overflow : 1; + mmr_t xnmd_lut_error : 1; + mmr_t xnmd_uce_error : 1; + mmr_t xnmd_sbe_error : 1; + mmr_t xnmd_credit_underflow : 1; + mmr_t xnmd_data_buff_overflow : 1; + mmr_t xnmd_debit_overflow : 1; + mmr_t xnmd_credit_overflow : 1; + mmr_t ni1_pipe_error : 1; + mmr_t ni1_llp_error : 1; + mmr_t ni1_credit_underflow : 1; + mmr_t ni1_push_underflow : 1; + mmr_t ni1_pop_underflow : 1; + mmr_t ni1_debit_overflow : 1; + mmr_t ni1_credit_overflow : 1; + mmr_t ni1_push_overflow : 1; + mmr_t ni1_pop_overflow : 1; + mmr_t ni0_pipe_error : 1; + mmr_t ni0_llp_error : 1; + mmr_t ni0_credit_underflow : 1; + mmr_t ni0_push_underflow : 1; + mmr_t ni0_pop_underflow : 1; + mmr_t ni0_debit_overflow : 1; + mmr_t ni0_credit_overflow : 1; + mmr_t ni0_push_overflow : 1; + mmr_t ni0_pop_overflow : 1; + } sh_xn_error_mask_s; +} sh_xn_error_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_FIRST_ERROR" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_first_error_u { + mmr_t sh_xn_first_error_regval; + struct { + mmr_t ni0_pop_overflow : 1; + mmr_t ni0_push_overflow : 1; + mmr_t ni0_credit_overflow : 1; + mmr_t ni0_debit_overflow : 1; + mmr_t ni0_pop_underflow : 1; + mmr_t ni0_push_underflow : 1; + mmr_t ni0_credit_underflow : 1; + mmr_t ni0_llp_error : 1; + mmr_t ni0_pipe_error : 1; + mmr_t ni1_pop_overflow : 1; + mmr_t ni1_push_overflow : 1; + mmr_t ni1_credit_overflow : 1; + mmr_t ni1_debit_overflow : 1; + mmr_t ni1_pop_underflow : 1; + mmr_t ni1_push_underflow : 1; + mmr_t ni1_credit_underflow : 1; + mmr_t ni1_llp_error : 1; + mmr_t ni1_pipe_error : 1; + mmr_t xnmd_credit_overflow : 1; + mmr_t xnmd_debit_overflow : 1; + mmr_t xnmd_data_buff_overflow : 1; + mmr_t xnmd_credit_underflow : 1; + mmr_t xnmd_sbe_error : 1; + mmr_t xnmd_uce_error : 1; + mmr_t xnmd_lut_error : 1; + mmr_t xnpi_credit_overflow : 1; + mmr_t xnpi_debit_overflow : 1; + mmr_t xnpi_data_buff_overflow : 1; + mmr_t xnpi_credit_underflow : 1; + mmr_t xnpi_sbe_error : 1; + mmr_t xnpi_uce_error : 1; + mmr_t xnpi_lut_error : 1; + mmr_t iilb_debit_overflow : 1; + mmr_t iilb_credit_overflow : 1; + mmr_t iilb_fifo_overflow : 1; + mmr_t iilb_credit_underflow : 1; + mmr_t iilb_fifo_underflow : 1; + mmr_t iilb_chiplet_or_lut : 1; + mmr_t reserved_0 : 26; + } sh_xn_first_error_s; +} sh_xn_first_error_u_t; +#else +typedef union sh_xn_first_error_u { + mmr_t sh_xn_first_error_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t iilb_chiplet_or_lut : 1; + mmr_t iilb_fifo_underflow : 1; + mmr_t iilb_credit_underflow : 1; + mmr_t iilb_fifo_overflow : 1; + mmr_t iilb_credit_overflow : 1; + mmr_t iilb_debit_overflow : 1; + mmr_t xnpi_lut_error : 1; + mmr_t xnpi_uce_error : 1; + mmr_t xnpi_sbe_error : 1; + mmr_t xnpi_credit_underflow : 1; + mmr_t xnpi_data_buff_overflow : 1; + mmr_t xnpi_debit_overflow : 1; + mmr_t xnpi_credit_overflow : 1; + mmr_t xnmd_lut_error : 1; + mmr_t xnmd_uce_error : 1; + mmr_t xnmd_sbe_error : 1; + mmr_t xnmd_credit_underflow : 1; + mmr_t xnmd_data_buff_overflow : 1; + mmr_t xnmd_debit_overflow : 1; + mmr_t xnmd_credit_overflow : 1; + mmr_t ni1_pipe_error : 1; + mmr_t ni1_llp_error : 1; + mmr_t ni1_credit_underflow : 1; + mmr_t ni1_push_underflow : 1; + mmr_t ni1_pop_underflow : 1; + mmr_t ni1_debit_overflow : 1; + mmr_t ni1_credit_overflow : 1; + mmr_t ni1_push_overflow : 1; + mmr_t ni1_pop_overflow : 1; + mmr_t ni0_pipe_error : 1; + mmr_t ni0_llp_error : 1; + mmr_t ni0_credit_underflow : 1; + mmr_t ni0_push_underflow : 1; + mmr_t ni0_pop_underflow : 1; + mmr_t ni0_debit_overflow : 1; + mmr_t ni0_credit_overflow : 1; + mmr_t ni0_push_overflow : 1; + mmr_t ni0_pop_overflow : 1; + } sh_xn_first_error_s; +} sh_xn_first_error_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERROR_SUMMARY" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_error_summary_u { + mmr_t sh_xniilb_error_summary_regval; + struct { + mmr_t overflow_ii_debit0 : 1; + mmr_t overflow_ii_debit2 : 1; + mmr_t overflow_lb_debit0 : 1; + mmr_t overflow_lb_debit2 : 1; + mmr_t overflow_ii_vc0 : 1; + mmr_t overflow_ii_vc2 : 1; + mmr_t underflow_ii_vc0 : 1; + mmr_t underflow_ii_vc2 : 1; + mmr_t overflow_lb_vc0 : 1; + mmr_t overflow_lb_vc2 : 1; + mmr_t underflow_lb_vc0 : 1; + mmr_t underflow_lb_vc2 : 1; + mmr_t overflow_pi_vc0_credit_in : 1; + mmr_t overflow_iilb_vc0_credit_in : 1; + mmr_t overflow_md_vc0_credit_in : 1; + mmr_t overflow_ni0_vc0_credit_in : 1; + mmr_t overflow_ni1_vc0_credit_in : 1; + mmr_t overflow_pi_vc2_credit_in : 1; + mmr_t overflow_iilb_vc2_credit_in : 1; + mmr_t overflow_md_vc2_credit_in : 1; + mmr_t overflow_ni0_vc2_credit_in : 1; + mmr_t overflow_ni1_vc2_credit_in : 1; + mmr_t underflow_pi_vc0_credit_in : 1; + mmr_t underflow_iilb_vc0_credit_in : 1; + mmr_t underflow_md_vc0_credit_in : 1; + mmr_t underflow_ni0_vc0_credit_in : 1; + mmr_t underflow_ni1_vc0_credit_in : 1; + mmr_t underflow_pi_vc2_credit_in : 1; + mmr_t underflow_iilb_vc2_credit_in : 1; + mmr_t underflow_md_vc2_credit_in : 1; + mmr_t underflow_ni0_vc2_credit_in : 1; + mmr_t underflow_ni1_vc2_credit_in : 1; + mmr_t overflow_pi_debit0 : 1; + mmr_t overflow_pi_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_md_debit0 : 1; + mmr_t overflow_md_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_pi_vc0_credit_out : 1; + mmr_t overflow_pi_vc2_credit_out : 1; + mmr_t overflow_md_vc0_credit_out : 1; + mmr_t overflow_md_vc2_credit_out : 1; + mmr_t overflow_iilb_vc0_credit_out : 1; + mmr_t overflow_iilb_vc2_credit_out : 1; + mmr_t overflow_ni0_vc0_credit_out : 1; + mmr_t overflow_ni0_vc2_credit_out : 1; + mmr_t overflow_ni1_vc0_credit_out : 1; + mmr_t overflow_ni1_vc2_credit_out : 1; + mmr_t underflow_pi_vc0_credit_out : 1; + mmr_t underflow_pi_vc2_credit_out : 1; + mmr_t underflow_md_vc0_credit_out : 1; + mmr_t underflow_md_vc2_credit_out : 1; + mmr_t underflow_iilb_vc0_credit_out : 1; + mmr_t underflow_iilb_vc2_credit_out : 1; + mmr_t underflow_ni0_vc0_credit_out : 1; + mmr_t underflow_ni0_vc2_credit_out : 1; + mmr_t underflow_ni1_vc0_credit_out : 1; + mmr_t underflow_ni1_vc2_credit_out : 1; + mmr_t chiplet_nomatch : 1; + mmr_t lut_read_error : 1; + } sh_xniilb_error_summary_s; +} sh_xniilb_error_summary_u_t; +#else +typedef union sh_xniilb_error_summary_u { + mmr_t sh_xniilb_error_summary_regval; + struct { + mmr_t lut_read_error : 1; + mmr_t chiplet_nomatch : 1; + mmr_t underflow_ni1_vc2_credit_out : 1; + mmr_t underflow_ni1_vc0_credit_out : 1; + mmr_t underflow_ni0_vc2_credit_out : 1; + mmr_t underflow_ni0_vc0_credit_out : 1; + mmr_t underflow_iilb_vc2_credit_out : 1; + mmr_t underflow_iilb_vc0_credit_out : 1; + mmr_t underflow_md_vc2_credit_out : 1; + mmr_t underflow_md_vc0_credit_out : 1; + mmr_t underflow_pi_vc2_credit_out : 1; + mmr_t underflow_pi_vc0_credit_out : 1; + mmr_t overflow_ni1_vc2_credit_out : 1; + mmr_t overflow_ni1_vc0_credit_out : 1; + mmr_t overflow_ni0_vc2_credit_out : 1; + mmr_t overflow_ni0_vc0_credit_out : 1; + mmr_t overflow_iilb_vc2_credit_out : 1; + mmr_t overflow_iilb_vc0_credit_out : 1; + mmr_t overflow_md_vc2_credit_out : 1; + mmr_t overflow_md_vc0_credit_out : 1; + mmr_t overflow_pi_vc2_credit_out : 1; + mmr_t overflow_pi_vc0_credit_out : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_md_debit2 : 1; + mmr_t overflow_md_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_pi_debit2 : 1; + mmr_t overflow_pi_debit0 : 1; + mmr_t underflow_ni1_vc2_credit_in : 1; + mmr_t underflow_ni0_vc2_credit_in : 1; + mmr_t underflow_md_vc2_credit_in : 1; + mmr_t underflow_iilb_vc2_credit_in : 1; + mmr_t underflow_pi_vc2_credit_in : 1; + mmr_t underflow_ni1_vc0_credit_in : 1; + mmr_t underflow_ni0_vc0_credit_in : 1; + mmr_t underflow_md_vc0_credit_in : 1; + mmr_t underflow_iilb_vc0_credit_in : 1; + mmr_t underflow_pi_vc0_credit_in : 1; + mmr_t overflow_ni1_vc2_credit_in : 1; + mmr_t overflow_ni0_vc2_credit_in : 1; + mmr_t overflow_md_vc2_credit_in : 1; + mmr_t overflow_iilb_vc2_credit_in : 1; + mmr_t overflow_pi_vc2_credit_in : 1; + mmr_t overflow_ni1_vc0_credit_in : 1; + mmr_t overflow_ni0_vc0_credit_in : 1; + mmr_t overflow_md_vc0_credit_in : 1; + mmr_t overflow_iilb_vc0_credit_in : 1; + mmr_t overflow_pi_vc0_credit_in : 1; + mmr_t underflow_lb_vc2 : 1; + mmr_t underflow_lb_vc0 : 1; + mmr_t overflow_lb_vc2 : 1; + mmr_t overflow_lb_vc0 : 1; + mmr_t underflow_ii_vc2 : 1; + mmr_t underflow_ii_vc0 : 1; + mmr_t overflow_ii_vc2 : 1; + mmr_t overflow_ii_vc0 : 1; + mmr_t overflow_lb_debit2 : 1; + mmr_t overflow_lb_debit0 : 1; + mmr_t overflow_ii_debit2 : 1; + mmr_t overflow_ii_debit0 : 1; + } sh_xniilb_error_summary_s; +} sh_xniilb_error_summary_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERROR_OVERFLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_error_overflow_u { + mmr_t sh_xniilb_error_overflow_regval; + struct { + mmr_t overflow_ii_debit0 : 1; + mmr_t overflow_ii_debit2 : 1; + mmr_t overflow_lb_debit0 : 1; + mmr_t overflow_lb_debit2 : 1; + mmr_t overflow_ii_vc0 : 1; + mmr_t overflow_ii_vc2 : 1; + mmr_t underflow_ii_vc0 : 1; + mmr_t underflow_ii_vc2 : 1; + mmr_t overflow_lb_vc0 : 1; + mmr_t overflow_lb_vc2 : 1; + mmr_t underflow_lb_vc0 : 1; + mmr_t underflow_lb_vc2 : 1; + mmr_t overflow_pi_vc0_credit_in : 1; + mmr_t overflow_iilb_vc0_credit_in : 1; + mmr_t overflow_md_vc0_credit_in : 1; + mmr_t overflow_ni0_vc0_credit_in : 1; + mmr_t overflow_ni1_vc0_credit_in : 1; + mmr_t overflow_pi_vc2_credit_in : 1; + mmr_t overflow_iilb_vc2_credit_in : 1; + mmr_t overflow_md_vc2_credit_in : 1; + mmr_t overflow_ni0_vc2_credit_in : 1; + mmr_t overflow_ni1_vc2_credit_in : 1; + mmr_t underflow_pi_vc0_credit_in : 1; + mmr_t underflow_iilb_vc0_credit_in : 1; + mmr_t underflow_md_vc0_credit_in : 1; + mmr_t underflow_ni0_vc0_credit_in : 1; + mmr_t underflow_ni1_vc0_credit_in : 1; + mmr_t underflow_pi_vc2_credit_in : 1; + mmr_t underflow_iilb_vc2_credit_in : 1; + mmr_t underflow_md_vc2_credit_in : 1; + mmr_t underflow_ni0_vc2_credit_in : 1; + mmr_t underflow_ni1_vc2_credit_in : 1; + mmr_t overflow_pi_debit0 : 1; + mmr_t overflow_pi_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_md_debit0 : 1; + mmr_t overflow_md_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_pi_vc0_credit_out : 1; + mmr_t overflow_pi_vc2_credit_out : 1; + mmr_t overflow_md_vc0_credit_out : 1; + mmr_t overflow_md_vc2_credit_out : 1; + mmr_t overflow_iilb_vc0_credit_out : 1; + mmr_t overflow_iilb_vc2_credit_out : 1; + mmr_t overflow_ni0_vc0_credit_out : 1; + mmr_t overflow_ni0_vc2_credit_out : 1; + mmr_t overflow_ni1_vc0_credit_out : 1; + mmr_t overflow_ni1_vc2_credit_out : 1; + mmr_t underflow_pi_vc0_credit_out : 1; + mmr_t underflow_pi_vc2_credit_out : 1; + mmr_t underflow_md_vc0_credit_out : 1; + mmr_t underflow_md_vc2_credit_out : 1; + mmr_t underflow_iilb_vc0_credit_out : 1; + mmr_t underflow_iilb_vc2_credit_out : 1; + mmr_t underflow_ni0_vc0_credit_out : 1; + mmr_t underflow_ni0_vc2_credit_out : 1; + mmr_t underflow_ni1_vc0_credit_out : 1; + mmr_t underflow_ni1_vc2_credit_out : 1; + mmr_t chiplet_nomatch : 1; + mmr_t lut_read_error : 1; + } sh_xniilb_error_overflow_s; +} sh_xniilb_error_overflow_u_t; +#else +typedef union sh_xniilb_error_overflow_u { + mmr_t sh_xniilb_error_overflow_regval; + struct { + mmr_t lut_read_error : 1; + mmr_t chiplet_nomatch : 1; + mmr_t underflow_ni1_vc2_credit_out : 1; + mmr_t underflow_ni1_vc0_credit_out : 1; + mmr_t underflow_ni0_vc2_credit_out : 1; + mmr_t underflow_ni0_vc0_credit_out : 1; + mmr_t underflow_iilb_vc2_credit_out : 1; + mmr_t underflow_iilb_vc0_credit_out : 1; + mmr_t underflow_md_vc2_credit_out : 1; + mmr_t underflow_md_vc0_credit_out : 1; + mmr_t underflow_pi_vc2_credit_out : 1; + mmr_t underflow_pi_vc0_credit_out : 1; + mmr_t overflow_ni1_vc2_credit_out : 1; + mmr_t overflow_ni1_vc0_credit_out : 1; + mmr_t overflow_ni0_vc2_credit_out : 1; + mmr_t overflow_ni0_vc0_credit_out : 1; + mmr_t overflow_iilb_vc2_credit_out : 1; + mmr_t overflow_iilb_vc0_credit_out : 1; + mmr_t overflow_md_vc2_credit_out : 1; + mmr_t overflow_md_vc0_credit_out : 1; + mmr_t overflow_pi_vc2_credit_out : 1; + mmr_t overflow_pi_vc0_credit_out : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_md_debit2 : 1; + mmr_t overflow_md_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_pi_debit2 : 1; + mmr_t overflow_pi_debit0 : 1; + mmr_t underflow_ni1_vc2_credit_in : 1; + mmr_t underflow_ni0_vc2_credit_in : 1; + mmr_t underflow_md_vc2_credit_in : 1; + mmr_t underflow_iilb_vc2_credit_in : 1; + mmr_t underflow_pi_vc2_credit_in : 1; + mmr_t underflow_ni1_vc0_credit_in : 1; + mmr_t underflow_ni0_vc0_credit_in : 1; + mmr_t underflow_md_vc0_credit_in : 1; + mmr_t underflow_iilb_vc0_credit_in : 1; + mmr_t underflow_pi_vc0_credit_in : 1; + mmr_t overflow_ni1_vc2_credit_in : 1; + mmr_t overflow_ni0_vc2_credit_in : 1; + mmr_t overflow_md_vc2_credit_in : 1; + mmr_t overflow_iilb_vc2_credit_in : 1; + mmr_t overflow_pi_vc2_credit_in : 1; + mmr_t overflow_ni1_vc0_credit_in : 1; + mmr_t overflow_ni0_vc0_credit_in : 1; + mmr_t overflow_md_vc0_credit_in : 1; + mmr_t overflow_iilb_vc0_credit_in : 1; + mmr_t overflow_pi_vc0_credit_in : 1; + mmr_t underflow_lb_vc2 : 1; + mmr_t underflow_lb_vc0 : 1; + mmr_t overflow_lb_vc2 : 1; + mmr_t overflow_lb_vc0 : 1; + mmr_t underflow_ii_vc2 : 1; + mmr_t underflow_ii_vc0 : 1; + mmr_t overflow_ii_vc2 : 1; + mmr_t overflow_ii_vc0 : 1; + mmr_t overflow_lb_debit2 : 1; + mmr_t overflow_lb_debit0 : 1; + mmr_t overflow_ii_debit2 : 1; + mmr_t overflow_ii_debit0 : 1; + } sh_xniilb_error_overflow_s; +} sh_xniilb_error_overflow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_ERROR_MASK" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_error_mask_u { + mmr_t sh_xniilb_error_mask_regval; + struct { + mmr_t overflow_ii_debit0 : 1; + mmr_t overflow_ii_debit2 : 1; + mmr_t overflow_lb_debit0 : 1; + mmr_t overflow_lb_debit2 : 1; + mmr_t overflow_ii_vc0 : 1; + mmr_t overflow_ii_vc2 : 1; + mmr_t underflow_ii_vc0 : 1; + mmr_t underflow_ii_vc2 : 1; + mmr_t overflow_lb_vc0 : 1; + mmr_t overflow_lb_vc2 : 1; + mmr_t underflow_lb_vc0 : 1; + mmr_t underflow_lb_vc2 : 1; + mmr_t overflow_pi_vc0_credit_in : 1; + mmr_t overflow_iilb_vc0_credit_in : 1; + mmr_t overflow_md_vc0_credit_in : 1; + mmr_t overflow_ni0_vc0_credit_in : 1; + mmr_t overflow_ni1_vc0_credit_in : 1; + mmr_t overflow_pi_vc2_credit_in : 1; + mmr_t overflow_iilb_vc2_credit_in : 1; + mmr_t overflow_md_vc2_credit_in : 1; + mmr_t overflow_ni0_vc2_credit_in : 1; + mmr_t overflow_ni1_vc2_credit_in : 1; + mmr_t underflow_pi_vc0_credit_in : 1; + mmr_t underflow_iilb_vc0_credit_in : 1; + mmr_t underflow_md_vc0_credit_in : 1; + mmr_t underflow_ni0_vc0_credit_in : 1; + mmr_t underflow_ni1_vc0_credit_in : 1; + mmr_t underflow_pi_vc2_credit_in : 1; + mmr_t underflow_iilb_vc2_credit_in : 1; + mmr_t underflow_md_vc2_credit_in : 1; + mmr_t underflow_ni0_vc2_credit_in : 1; + mmr_t underflow_ni1_vc2_credit_in : 1; + mmr_t overflow_pi_debit0 : 1; + mmr_t overflow_pi_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_md_debit0 : 1; + mmr_t overflow_md_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_pi_vc0_credit_out : 1; + mmr_t overflow_pi_vc2_credit_out : 1; + mmr_t overflow_md_vc0_credit_out : 1; + mmr_t overflow_md_vc2_credit_out : 1; + mmr_t overflow_iilb_vc0_credit_out : 1; + mmr_t overflow_iilb_vc2_credit_out : 1; + mmr_t overflow_ni0_vc0_credit_out : 1; + mmr_t overflow_ni0_vc2_credit_out : 1; + mmr_t overflow_ni1_vc0_credit_out : 1; + mmr_t overflow_ni1_vc2_credit_out : 1; + mmr_t underflow_pi_vc0_credit_out : 1; + mmr_t underflow_pi_vc2_credit_out : 1; + mmr_t underflow_md_vc0_credit_out : 1; + mmr_t underflow_md_vc2_credit_out : 1; + mmr_t underflow_iilb_vc0_credit_out : 1; + mmr_t underflow_iilb_vc2_credit_out : 1; + mmr_t underflow_ni0_vc0_credit_out : 1; + mmr_t underflow_ni0_vc2_credit_out : 1; + mmr_t underflow_ni1_vc0_credit_out : 1; + mmr_t underflow_ni1_vc2_credit_out : 1; + mmr_t chiplet_nomatch : 1; + mmr_t lut_read_error : 1; + } sh_xniilb_error_mask_s; +} sh_xniilb_error_mask_u_t; +#else +typedef union sh_xniilb_error_mask_u { + mmr_t sh_xniilb_error_mask_regval; + struct { + mmr_t lut_read_error : 1; + mmr_t chiplet_nomatch : 1; + mmr_t underflow_ni1_vc2_credit_out : 1; + mmr_t underflow_ni1_vc0_credit_out : 1; + mmr_t underflow_ni0_vc2_credit_out : 1; + mmr_t underflow_ni0_vc0_credit_out : 1; + mmr_t underflow_iilb_vc2_credit_out : 1; + mmr_t underflow_iilb_vc0_credit_out : 1; + mmr_t underflow_md_vc2_credit_out : 1; + mmr_t underflow_md_vc0_credit_out : 1; + mmr_t underflow_pi_vc2_credit_out : 1; + mmr_t underflow_pi_vc0_credit_out : 1; + mmr_t overflow_ni1_vc2_credit_out : 1; + mmr_t overflow_ni1_vc0_credit_out : 1; + mmr_t overflow_ni0_vc2_credit_out : 1; + mmr_t overflow_ni0_vc0_credit_out : 1; + mmr_t overflow_iilb_vc2_credit_out : 1; + mmr_t overflow_iilb_vc0_credit_out : 1; + mmr_t overflow_md_vc2_credit_out : 1; + mmr_t overflow_md_vc0_credit_out : 1; + mmr_t overflow_pi_vc2_credit_out : 1; + mmr_t overflow_pi_vc0_credit_out : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_md_debit2 : 1; + mmr_t overflow_md_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_pi_debit2 : 1; + mmr_t overflow_pi_debit0 : 1; + mmr_t underflow_ni1_vc2_credit_in : 1; + mmr_t underflow_ni0_vc2_credit_in : 1; + mmr_t underflow_md_vc2_credit_in : 1; + mmr_t underflow_iilb_vc2_credit_in : 1; + mmr_t underflow_pi_vc2_credit_in : 1; + mmr_t underflow_ni1_vc0_credit_in : 1; + mmr_t underflow_ni0_vc0_credit_in : 1; + mmr_t underflow_md_vc0_credit_in : 1; + mmr_t underflow_iilb_vc0_credit_in : 1; + mmr_t underflow_pi_vc0_credit_in : 1; + mmr_t overflow_ni1_vc2_credit_in : 1; + mmr_t overflow_ni0_vc2_credit_in : 1; + mmr_t overflow_md_vc2_credit_in : 1; + mmr_t overflow_iilb_vc2_credit_in : 1; + mmr_t overflow_pi_vc2_credit_in : 1; + mmr_t overflow_ni1_vc0_credit_in : 1; + mmr_t overflow_ni0_vc0_credit_in : 1; + mmr_t overflow_md_vc0_credit_in : 1; + mmr_t overflow_iilb_vc0_credit_in : 1; + mmr_t overflow_pi_vc0_credit_in : 1; + mmr_t underflow_lb_vc2 : 1; + mmr_t underflow_lb_vc0 : 1; + mmr_t overflow_lb_vc2 : 1; + mmr_t overflow_lb_vc0 : 1; + mmr_t underflow_ii_vc2 : 1; + mmr_t underflow_ii_vc0 : 1; + mmr_t overflow_ii_vc2 : 1; + mmr_t overflow_ii_vc0 : 1; + mmr_t overflow_lb_debit2 : 1; + mmr_t overflow_lb_debit0 : 1; + mmr_t overflow_ii_debit2 : 1; + mmr_t overflow_ii_debit0 : 1; + } sh_xniilb_error_mask_s; +} sh_xniilb_error_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNIILB_FIRST_ERROR" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xniilb_first_error_u { + mmr_t sh_xniilb_first_error_regval; + struct { + mmr_t overflow_ii_debit0 : 1; + mmr_t overflow_ii_debit2 : 1; + mmr_t overflow_lb_debit0 : 1; + mmr_t overflow_lb_debit2 : 1; + mmr_t overflow_ii_vc0 : 1; + mmr_t overflow_ii_vc2 : 1; + mmr_t underflow_ii_vc0 : 1; + mmr_t underflow_ii_vc2 : 1; + mmr_t overflow_lb_vc0 : 1; + mmr_t overflow_lb_vc2 : 1; + mmr_t underflow_lb_vc0 : 1; + mmr_t underflow_lb_vc2 : 1; + mmr_t overflow_pi_vc0_credit_in : 1; + mmr_t overflow_iilb_vc0_credit_in : 1; + mmr_t overflow_md_vc0_credit_in : 1; + mmr_t overflow_ni0_vc0_credit_in : 1; + mmr_t overflow_ni1_vc0_credit_in : 1; + mmr_t overflow_pi_vc2_credit_in : 1; + mmr_t overflow_iilb_vc2_credit_in : 1; + mmr_t overflow_md_vc2_credit_in : 1; + mmr_t overflow_ni0_vc2_credit_in : 1; + mmr_t overflow_ni1_vc2_credit_in : 1; + mmr_t underflow_pi_vc0_credit_in : 1; + mmr_t underflow_iilb_vc0_credit_in : 1; + mmr_t underflow_md_vc0_credit_in : 1; + mmr_t underflow_ni0_vc0_credit_in : 1; + mmr_t underflow_ni1_vc0_credit_in : 1; + mmr_t underflow_pi_vc2_credit_in : 1; + mmr_t underflow_iilb_vc2_credit_in : 1; + mmr_t underflow_md_vc2_credit_in : 1; + mmr_t underflow_ni0_vc2_credit_in : 1; + mmr_t underflow_ni1_vc2_credit_in : 1; + mmr_t overflow_pi_debit0 : 1; + mmr_t overflow_pi_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_md_debit0 : 1; + mmr_t overflow_md_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_pi_vc0_credit_out : 1; + mmr_t overflow_pi_vc2_credit_out : 1; + mmr_t overflow_md_vc0_credit_out : 1; + mmr_t overflow_md_vc2_credit_out : 1; + mmr_t overflow_iilb_vc0_credit_out : 1; + mmr_t overflow_iilb_vc2_credit_out : 1; + mmr_t overflow_ni0_vc0_credit_out : 1; + mmr_t overflow_ni0_vc2_credit_out : 1; + mmr_t overflow_ni1_vc0_credit_out : 1; + mmr_t overflow_ni1_vc2_credit_out : 1; + mmr_t underflow_pi_vc0_credit_out : 1; + mmr_t underflow_pi_vc2_credit_out : 1; + mmr_t underflow_md_vc0_credit_out : 1; + mmr_t underflow_md_vc2_credit_out : 1; + mmr_t underflow_iilb_vc0_credit_out : 1; + mmr_t underflow_iilb_vc2_credit_out : 1; + mmr_t underflow_ni0_vc0_credit_out : 1; + mmr_t underflow_ni0_vc2_credit_out : 1; + mmr_t underflow_ni1_vc0_credit_out : 1; + mmr_t underflow_ni1_vc2_credit_out : 1; + mmr_t chiplet_nomatch : 1; + mmr_t lut_read_error : 1; + } sh_xniilb_first_error_s; +} sh_xniilb_first_error_u_t; +#else +typedef union sh_xniilb_first_error_u { + mmr_t sh_xniilb_first_error_regval; + struct { + mmr_t lut_read_error : 1; + mmr_t chiplet_nomatch : 1; + mmr_t underflow_ni1_vc2_credit_out : 1; + mmr_t underflow_ni1_vc0_credit_out : 1; + mmr_t underflow_ni0_vc2_credit_out : 1; + mmr_t underflow_ni0_vc0_credit_out : 1; + mmr_t underflow_iilb_vc2_credit_out : 1; + mmr_t underflow_iilb_vc0_credit_out : 1; + mmr_t underflow_md_vc2_credit_out : 1; + mmr_t underflow_md_vc0_credit_out : 1; + mmr_t underflow_pi_vc2_credit_out : 1; + mmr_t underflow_pi_vc0_credit_out : 1; + mmr_t overflow_ni1_vc2_credit_out : 1; + mmr_t overflow_ni1_vc0_credit_out : 1; + mmr_t overflow_ni0_vc2_credit_out : 1; + mmr_t overflow_ni0_vc0_credit_out : 1; + mmr_t overflow_iilb_vc2_credit_out : 1; + mmr_t overflow_iilb_vc0_credit_out : 1; + mmr_t overflow_md_vc2_credit_out : 1; + mmr_t overflow_md_vc0_credit_out : 1; + mmr_t overflow_pi_vc2_credit_out : 1; + mmr_t overflow_pi_vc0_credit_out : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_md_debit2 : 1; + mmr_t overflow_md_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_pi_debit2 : 1; + mmr_t overflow_pi_debit0 : 1; + mmr_t underflow_ni1_vc2_credit_in : 1; + mmr_t underflow_ni0_vc2_credit_in : 1; + mmr_t underflow_md_vc2_credit_in : 1; + mmr_t underflow_iilb_vc2_credit_in : 1; + mmr_t underflow_pi_vc2_credit_in : 1; + mmr_t underflow_ni1_vc0_credit_in : 1; + mmr_t underflow_ni0_vc0_credit_in : 1; + mmr_t underflow_md_vc0_credit_in : 1; + mmr_t underflow_iilb_vc0_credit_in : 1; + mmr_t underflow_pi_vc0_credit_in : 1; + mmr_t overflow_ni1_vc2_credit_in : 1; + mmr_t overflow_ni0_vc2_credit_in : 1; + mmr_t overflow_md_vc2_credit_in : 1; + mmr_t overflow_iilb_vc2_credit_in : 1; + mmr_t overflow_pi_vc2_credit_in : 1; + mmr_t overflow_ni1_vc0_credit_in : 1; + mmr_t overflow_ni0_vc0_credit_in : 1; + mmr_t overflow_md_vc0_credit_in : 1; + mmr_t overflow_iilb_vc0_credit_in : 1; + mmr_t overflow_pi_vc0_credit_in : 1; + mmr_t underflow_lb_vc2 : 1; + mmr_t underflow_lb_vc0 : 1; + mmr_t overflow_lb_vc2 : 1; + mmr_t overflow_lb_vc0 : 1; + mmr_t underflow_ii_vc2 : 1; + mmr_t underflow_ii_vc0 : 1; + mmr_t overflow_ii_vc2 : 1; + mmr_t overflow_ii_vc0 : 1; + mmr_t overflow_lb_debit2 : 1; + mmr_t overflow_lb_debit0 : 1; + mmr_t overflow_ii_debit2 : 1; + mmr_t overflow_ii_debit0 : 1; + } sh_xniilb_first_error_s; +} sh_xniilb_first_error_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_ERROR_SUMMARY" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_error_summary_u { + mmr_t sh_xnpi_error_summary_regval; + struct { + mmr_t underflow_ni0_vc0 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t lut_read_error : 1; + mmr_t single_bit_error0 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error3 : 1; + mmr_t uncor_error0 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error3 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t reserved_0 : 14; + } sh_xnpi_error_summary_s; +} sh_xnpi_error_summary_u_t; +#else +typedef union sh_xnpi_error_summary_u { + mmr_t sh_xnpi_error_summary_regval; + struct { + mmr_t reserved_0 : 14; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t uncor_error3 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error0 : 1; + mmr_t single_bit_error3 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error0 : 1; + mmr_t lut_read_error : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc0 : 1; + } sh_xnpi_error_summary_s; +} sh_xnpi_error_summary_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_ERROR_OVERFLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_error_overflow_u { + mmr_t sh_xnpi_error_overflow_regval; + struct { + mmr_t underflow_ni0_vc0 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t lut_read_error : 1; + mmr_t single_bit_error0 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error3 : 1; + mmr_t uncor_error0 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error3 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t reserved_0 : 14; + } sh_xnpi_error_overflow_s; +} sh_xnpi_error_overflow_u_t; +#else +typedef union sh_xnpi_error_overflow_u { + mmr_t sh_xnpi_error_overflow_regval; + struct { + mmr_t reserved_0 : 14; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t uncor_error3 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error0 : 1; + mmr_t single_bit_error3 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error0 : 1; + mmr_t lut_read_error : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc0 : 1; + } sh_xnpi_error_overflow_s; +} sh_xnpi_error_overflow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_ERROR_MASK" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_error_mask_u { + mmr_t sh_xnpi_error_mask_regval; + struct { + mmr_t underflow_ni0_vc0 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t lut_read_error : 1; + mmr_t single_bit_error0 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error3 : 1; + mmr_t uncor_error0 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error3 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t reserved_0 : 14; + } sh_xnpi_error_mask_s; +} sh_xnpi_error_mask_u_t; +#else +typedef union sh_xnpi_error_mask_u { + mmr_t sh_xnpi_error_mask_regval; + struct { + mmr_t reserved_0 : 14; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t uncor_error3 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error0 : 1; + mmr_t single_bit_error3 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error0 : 1; + mmr_t lut_read_error : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc0 : 1; + } sh_xnpi_error_mask_s; +} sh_xnpi_error_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNPI_FIRST_ERROR" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnpi_first_error_u { + mmr_t sh_xnpi_first_error_regval; + struct { + mmr_t underflow_ni0_vc0 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t lut_read_error : 1; + mmr_t single_bit_error0 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error3 : 1; + mmr_t uncor_error0 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error3 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t reserved_0 : 14; + } sh_xnpi_first_error_s; +} sh_xnpi_first_error_u_t; +#else +typedef union sh_xnpi_first_error_u { + mmr_t sh_xnpi_first_error_regval; + struct { + mmr_t reserved_0 : 14; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t uncor_error3 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error0 : 1; + mmr_t single_bit_error3 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error0 : 1; + mmr_t lut_read_error : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc0 : 1; + } sh_xnpi_first_error_s; +} sh_xnpi_first_error_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_ERROR_SUMMARY" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_error_summary_u { + mmr_t sh_xnmd_error_summary_regval; + struct { + mmr_t underflow_ni0_vc0 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t lut_read_error : 1; + mmr_t single_bit_error0 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error3 : 1; + mmr_t uncor_error0 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error3 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t reserved_0 : 14; + } sh_xnmd_error_summary_s; +} sh_xnmd_error_summary_u_t; +#else +typedef union sh_xnmd_error_summary_u { + mmr_t sh_xnmd_error_summary_regval; + struct { + mmr_t reserved_0 : 14; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t uncor_error3 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error0 : 1; + mmr_t single_bit_error3 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error0 : 1; + mmr_t lut_read_error : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc0 : 1; + } sh_xnmd_error_summary_s; +} sh_xnmd_error_summary_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_ERROR_OVERFLOW" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_error_overflow_u { + mmr_t sh_xnmd_error_overflow_regval; + struct { + mmr_t underflow_ni0_vc0 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t lut_read_error : 1; + mmr_t single_bit_error0 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error3 : 1; + mmr_t uncor_error0 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error3 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t reserved_0 : 14; + } sh_xnmd_error_overflow_s; +} sh_xnmd_error_overflow_u_t; +#else +typedef union sh_xnmd_error_overflow_u { + mmr_t sh_xnmd_error_overflow_regval; + struct { + mmr_t reserved_0 : 14; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t uncor_error3 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error0 : 1; + mmr_t single_bit_error3 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error0 : 1; + mmr_t lut_read_error : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc0 : 1; + } sh_xnmd_error_overflow_s; +} sh_xnmd_error_overflow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_ERROR_MASK" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_error_mask_u { + mmr_t sh_xnmd_error_mask_regval; + struct { + mmr_t underflow_ni0_vc0 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t lut_read_error : 1; + mmr_t single_bit_error0 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error3 : 1; + mmr_t uncor_error0 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error3 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t reserved_0 : 14; + } sh_xnmd_error_mask_s; +} sh_xnmd_error_mask_u_t; +#else +typedef union sh_xnmd_error_mask_u { + mmr_t sh_xnmd_error_mask_regval; + struct { + mmr_t reserved_0 : 14; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t uncor_error3 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error0 : 1; + mmr_t single_bit_error3 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error0 : 1; + mmr_t lut_read_error : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc0 : 1; + } sh_xnmd_error_mask_s; +} sh_xnmd_error_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XNMD_FIRST_ERROR" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xnmd_first_error_u { + mmr_t sh_xnmd_first_error_regval; + struct { + mmr_t underflow_ni0_vc0 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t lut_read_error : 1; + mmr_t single_bit_error0 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error3 : 1; + mmr_t uncor_error0 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error3 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t reserved_0 : 14; + } sh_xnmd_first_error_s; +} sh_xnmd_first_error_u_t; +#else +typedef union sh_xnmd_first_error_u { + mmr_t sh_xnmd_first_error_regval; + struct { + mmr_t reserved_0 : 14; + mmr_t overflow_header_cancel_fifo : 1; + mmr_t overflow_iilb_vc2_credit : 1; + mmr_t underflow_iilb_vc2_credit : 1; + mmr_t overflow_iilb_vc0_credit : 1; + mmr_t underflow_iilb_vc0_credit : 1; + mmr_t overflow_ni1_vc2_credit : 1; + mmr_t underflow_ni1_vc2_credit : 1; + mmr_t overflow_ni1_vc0_credit : 1; + mmr_t underflow_ni1_vc0_credit : 1; + mmr_t overflow_ni0_vc2_credit : 1; + mmr_t underflow_ni0_vc2_credit : 1; + mmr_t overflow_ni0_vc0_credit : 1; + mmr_t underflow_ni0_vc0_credit : 1; + mmr_t overflow_iilb_debit2 : 1; + mmr_t overflow_iilb_debit0 : 1; + mmr_t overflow_ni1_debit2 : 1; + mmr_t overflow_ni1_debit0 : 1; + mmr_t overflow_ni0_debit2 : 1; + mmr_t overflow_ni0_debit0 : 1; + mmr_t overflow_sic_cntr2 : 1; + mmr_t underflow_sic_cntr2 : 1; + mmr_t overflow_sic_cntr0 : 1; + mmr_t underflow_sic_cntr0 : 1; + mmr_t uncor_error3 : 1; + mmr_t uncor_error2 : 1; + mmr_t uncor_error1 : 1; + mmr_t uncor_error0 : 1; + mmr_t single_bit_error3 : 1; + mmr_t single_bit_error2 : 1; + mmr_t single_bit_error1 : 1; + mmr_t single_bit_error0 : 1; + mmr_t lut_read_error : 1; + mmr_t overflow_databuff_vc2 : 1; + mmr_t overflow_databuff_vc0 : 1; + mmr_t overflow_vc2_credit : 1; + mmr_t underflow_vc2_credit : 1; + mmr_t overflow_vc0_credit : 1; + mmr_t underflow_vc0_credit : 1; + mmr_t overflow_iilb_vc2 : 1; + mmr_t underflow_iilb_vc2 : 1; + mmr_t overflow_iilb_vc0 : 1; + mmr_t underflow_iilb_vc0 : 1; + mmr_t overflow_ni1_vc2 : 1; + mmr_t underflow_ni1_vc2 : 1; + mmr_t overflow_ni1_vc0 : 1; + mmr_t underflow_ni1_vc0 : 1; + mmr_t overflow_ni0_vc2 : 1; + mmr_t underflow_ni0_vc2 : 1; + mmr_t overflow_ni0_vc0 : 1; + mmr_t underflow_ni0_vc0 : 1; + } sh_xnmd_first_error_s; +} sh_xnmd_first_error_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_AUTO_REPLY_ENABLE0" */ +/* Automatic Maintenance Reply Enable 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_auto_reply_enable0_u { + mmr_t sh_auto_reply_enable0_regval; + struct { + mmr_t enable0 : 64; + } sh_auto_reply_enable0_s; +} sh_auto_reply_enable0_u_t; +#else +typedef union sh_auto_reply_enable0_u { + mmr_t sh_auto_reply_enable0_regval; + struct { + mmr_t enable0 : 64; + } sh_auto_reply_enable0_s; +} sh_auto_reply_enable0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_AUTO_REPLY_ENABLE1" */ +/* Automatic Maintenance Reply Enable 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_auto_reply_enable1_u { + mmr_t sh_auto_reply_enable1_regval; + struct { + mmr_t enable1 : 64; + } sh_auto_reply_enable1_s; +} sh_auto_reply_enable1_u_t; +#else +typedef union sh_auto_reply_enable1_u { + mmr_t sh_auto_reply_enable1_regval; + struct { + mmr_t enable1 : 64; + } sh_auto_reply_enable1_s; +} sh_auto_reply_enable1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_AUTO_REPLY_HEADER0" */ +/* Automatic Maintenance Reply Header 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_auto_reply_header0_u { + mmr_t sh_auto_reply_header0_regval; + struct { + mmr_t header0 : 64; + } sh_auto_reply_header0_s; +} sh_auto_reply_header0_u_t; +#else +typedef union sh_auto_reply_header0_u { + mmr_t sh_auto_reply_header0_regval; + struct { + mmr_t header0 : 64; + } sh_auto_reply_header0_s; +} sh_auto_reply_header0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_AUTO_REPLY_HEADER1" */ +/* Automatic Maintenance Reply Header 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_auto_reply_header1_u { + mmr_t sh_auto_reply_header1_regval; + struct { + mmr_t header1 : 64; + } sh_auto_reply_header1_s; +} sh_auto_reply_header1_u_t; +#else +typedef union sh_auto_reply_header1_u { + mmr_t sh_auto_reply_header1_regval; + struct { + mmr_t header1 : 64; + } sh_auto_reply_header1_s; +} sh_auto_reply_header1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_ENABLE_RP_AUTO_REPLY" */ +/* Enable Automatic Maintenance Reply From Reply Queue */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_enable_rp_auto_reply_u { + mmr_t sh_enable_rp_auto_reply_regval; + struct { + mmr_t enable : 1; + mmr_t reserved_0 : 63; + } sh_enable_rp_auto_reply_s; +} sh_enable_rp_auto_reply_u_t; +#else +typedef union sh_enable_rp_auto_reply_u { + mmr_t sh_enable_rp_auto_reply_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t enable : 1; + } sh_enable_rp_auto_reply_s; +} sh_enable_rp_auto_reply_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_ENABLE_RQ_AUTO_REPLY" */ +/* Enable Automatic Maintenance Reply From Request Queue */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_enable_rq_auto_reply_u { + mmr_t sh_enable_rq_auto_reply_regval; + struct { + mmr_t enable : 1; + mmr_t reserved_0 : 63; + } sh_enable_rq_auto_reply_s; +} sh_enable_rq_auto_reply_u_t; +#else +typedef union sh_enable_rq_auto_reply_u { + mmr_t sh_enable_rq_auto_reply_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t enable : 1; + } sh_enable_rq_auto_reply_s; +} sh_enable_rq_auto_reply_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_REDIRECT_INVAL" */ +/* Redirect invalidate to LB instead of PI */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_redirect_inval_u { + mmr_t sh_redirect_inval_regval; + struct { + mmr_t redirect : 1; + mmr_t reserved_0 : 63; + } sh_redirect_inval_s; +} sh_redirect_inval_u_t; +#else +typedef union sh_redirect_inval_u { + mmr_t sh_redirect_inval_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t redirect : 1; + } sh_redirect_inval_s; +} sh_redirect_inval_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_CNTRL" */ +/* Diagnostic Message Control Register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_cntrl_u { + mmr_t sh_diag_msg_cntrl_regval; + struct { + mmr_t msg_length : 6; + mmr_t error_inject_point : 6; + mmr_t error_inject_enable : 1; + mmr_t port : 1; + mmr_t reserved_0 : 48; + mmr_t start : 1; + mmr_t busy : 1; + } sh_diag_msg_cntrl_s; +} sh_diag_msg_cntrl_u_t; +#else +typedef union sh_diag_msg_cntrl_u { + mmr_t sh_diag_msg_cntrl_regval; + struct { + mmr_t busy : 1; + mmr_t start : 1; + mmr_t reserved_0 : 48; + mmr_t port : 1; + mmr_t error_inject_enable : 1; + mmr_t error_inject_point : 6; + mmr_t msg_length : 6; + } sh_diag_msg_cntrl_s; +} sh_diag_msg_cntrl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA0L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data0l_u { + mmr_t sh_diag_msg_data0l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data0l_s; +} sh_diag_msg_data0l_u_t; +#else +typedef union sh_diag_msg_data0l_u { + mmr_t sh_diag_msg_data0l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data0l_s; +} sh_diag_msg_data0l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA0U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data0u_u { + mmr_t sh_diag_msg_data0u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data0u_s; +} sh_diag_msg_data0u_u_t; +#else +typedef union sh_diag_msg_data0u_u { + mmr_t sh_diag_msg_data0u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data0u_s; +} sh_diag_msg_data0u_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA1L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data1l_u { + mmr_t sh_diag_msg_data1l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data1l_s; +} sh_diag_msg_data1l_u_t; +#else +typedef union sh_diag_msg_data1l_u { + mmr_t sh_diag_msg_data1l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data1l_s; +} sh_diag_msg_data1l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA1U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data1u_u { + mmr_t sh_diag_msg_data1u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data1u_s; +} sh_diag_msg_data1u_u_t; +#else +typedef union sh_diag_msg_data1u_u { + mmr_t sh_diag_msg_data1u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data1u_s; +} sh_diag_msg_data1u_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA2L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data2l_u { + mmr_t sh_diag_msg_data2l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data2l_s; +} sh_diag_msg_data2l_u_t; +#else +typedef union sh_diag_msg_data2l_u { + mmr_t sh_diag_msg_data2l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data2l_s; +} sh_diag_msg_data2l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA2U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data2u_u { + mmr_t sh_diag_msg_data2u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data2u_s; +} sh_diag_msg_data2u_u_t; +#else +typedef union sh_diag_msg_data2u_u { + mmr_t sh_diag_msg_data2u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data2u_s; +} sh_diag_msg_data2u_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA3L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data3l_u { + mmr_t sh_diag_msg_data3l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data3l_s; +} sh_diag_msg_data3l_u_t; +#else +typedef union sh_diag_msg_data3l_u { + mmr_t sh_diag_msg_data3l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data3l_s; +} sh_diag_msg_data3l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA3U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data3u_u { + mmr_t sh_diag_msg_data3u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data3u_s; +} sh_diag_msg_data3u_u_t; +#else +typedef union sh_diag_msg_data3u_u { + mmr_t sh_diag_msg_data3u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data3u_s; +} sh_diag_msg_data3u_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA4L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data4l_u { + mmr_t sh_diag_msg_data4l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data4l_s; +} sh_diag_msg_data4l_u_t; +#else +typedef union sh_diag_msg_data4l_u { + mmr_t sh_diag_msg_data4l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data4l_s; +} sh_diag_msg_data4l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA4U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data4u_u { + mmr_t sh_diag_msg_data4u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data4u_s; +} sh_diag_msg_data4u_u_t; +#else +typedef union sh_diag_msg_data4u_u { + mmr_t sh_diag_msg_data4u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data4u_s; +} sh_diag_msg_data4u_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA5L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data5l_u { + mmr_t sh_diag_msg_data5l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data5l_s; +} sh_diag_msg_data5l_u_t; +#else +typedef union sh_diag_msg_data5l_u { + mmr_t sh_diag_msg_data5l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data5l_s; +} sh_diag_msg_data5l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA5U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data5u_u { + mmr_t sh_diag_msg_data5u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data5u_s; +} sh_diag_msg_data5u_u_t; +#else +typedef union sh_diag_msg_data5u_u { + mmr_t sh_diag_msg_data5u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data5u_s; +} sh_diag_msg_data5u_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA6L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data6l_u { + mmr_t sh_diag_msg_data6l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data6l_s; +} sh_diag_msg_data6l_u_t; +#else +typedef union sh_diag_msg_data6l_u { + mmr_t sh_diag_msg_data6l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data6l_s; +} sh_diag_msg_data6l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA6U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data6u_u { + mmr_t sh_diag_msg_data6u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data6u_s; +} sh_diag_msg_data6u_u_t; +#else +typedef union sh_diag_msg_data6u_u { + mmr_t sh_diag_msg_data6u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data6u_s; +} sh_diag_msg_data6u_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA7L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data7l_u { + mmr_t sh_diag_msg_data7l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data7l_s; +} sh_diag_msg_data7l_u_t; +#else +typedef union sh_diag_msg_data7l_u { + mmr_t sh_diag_msg_data7l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data7l_s; +} sh_diag_msg_data7l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA7U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data7u_u { + mmr_t sh_diag_msg_data7u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data7u_s; +} sh_diag_msg_data7u_u_t; +#else +typedef union sh_diag_msg_data7u_u { + mmr_t sh_diag_msg_data7u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data7u_s; +} sh_diag_msg_data7u_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA8L" */ +/* Diagnostic Data, lower 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data8l_u { + mmr_t sh_diag_msg_data8l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data8l_s; +} sh_diag_msg_data8l_u_t; +#else +typedef union sh_diag_msg_data8l_u { + mmr_t sh_diag_msg_data8l_regval; + struct { + mmr_t data_lower : 64; + } sh_diag_msg_data8l_s; +} sh_diag_msg_data8l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_DATA8U" */ +/* Diagnostice Data, upper 64 bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_data8u_u { + mmr_t sh_diag_msg_data8u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data8u_s; +} sh_diag_msg_data8u_u_t; +#else +typedef union sh_diag_msg_data8u_u { + mmr_t sh_diag_msg_data8u_regval; + struct { + mmr_t data_upper : 64; + } sh_diag_msg_data8u_s; +} sh_diag_msg_data8u_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_HDR0" */ +/* Diagnostice Data, lower 64 bits of header */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_hdr0_u { + mmr_t sh_diag_msg_hdr0_regval; + struct { + mmr_t header0 : 64; + } sh_diag_msg_hdr0_s; +} sh_diag_msg_hdr0_u_t; +#else +typedef union sh_diag_msg_hdr0_u { + mmr_t sh_diag_msg_hdr0_regval; + struct { + mmr_t header0 : 64; + } sh_diag_msg_hdr0_s; +} sh_diag_msg_hdr0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIAG_MSG_HDR1" */ +/* Diagnostice Data, upper 64 bits of header */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_diag_msg_hdr1_u { + mmr_t sh_diag_msg_hdr1_regval; + struct { + mmr_t header1 : 64; + } sh_diag_msg_hdr1_s; +} sh_diag_msg_hdr1_u_t; +#else +typedef union sh_diag_msg_hdr1_u { + mmr_t sh_diag_msg_hdr1_regval; + struct { + mmr_t header1 : 64; + } sh_diag_msg_hdr1_s; +} sh_diag_msg_hdr1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DEBUG_SELECT" */ +/* SHub Debug Port Select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_debug_select_u { + mmr_t sh_debug_select_regval; + struct { + mmr_t nibble0_nibble_sel : 3; + mmr_t nibble0_chiplet_sel : 3; + mmr_t nibble1_nibble_sel : 3; + mmr_t nibble1_chiplet_sel : 3; + mmr_t nibble2_nibble_sel : 3; + mmr_t nibble2_chiplet_sel : 3; + mmr_t nibble3_nibble_sel : 3; + mmr_t nibble3_chiplet_sel : 3; + mmr_t nibble4_nibble_sel : 3; + mmr_t nibble4_chiplet_sel : 3; + mmr_t nibble5_nibble_sel : 3; + mmr_t nibble5_chiplet_sel : 3; + mmr_t nibble6_nibble_sel : 3; + mmr_t nibble6_chiplet_sel : 3; + mmr_t nibble7_nibble_sel : 3; + mmr_t nibble7_chiplet_sel : 3; + mmr_t debug_ii_sel : 3; + mmr_t sel_ii : 9; + mmr_t reserved_0 : 3; + mmr_t trigger_enable : 1; + } sh_debug_select_s; +} sh_debug_select_u_t; +#else +typedef union sh_debug_select_u { + mmr_t sh_debug_select_regval; + struct { + mmr_t trigger_enable : 1; + mmr_t reserved_0 : 3; + mmr_t sel_ii : 9; + mmr_t debug_ii_sel : 3; + mmr_t nibble7_chiplet_sel : 3; + mmr_t nibble7_nibble_sel : 3; + mmr_t nibble6_chiplet_sel : 3; + mmr_t nibble6_nibble_sel : 3; + mmr_t nibble5_chiplet_sel : 3; + mmr_t nibble5_nibble_sel : 3; + mmr_t nibble4_chiplet_sel : 3; + mmr_t nibble4_nibble_sel : 3; + mmr_t nibble3_chiplet_sel : 3; + mmr_t nibble3_nibble_sel : 3; + mmr_t nibble2_chiplet_sel : 3; + mmr_t nibble2_nibble_sel : 3; + mmr_t nibble1_chiplet_sel : 3; + mmr_t nibble1_nibble_sel : 3; + mmr_t nibble0_chiplet_sel : 3; + mmr_t nibble0_nibble_sel : 3; + } sh_debug_select_s; +} sh_debug_select_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TRIGGER_COMPARE_MASK" */ +/* SHub Trigger Compare Mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_trigger_compare_mask_u { + mmr_t sh_trigger_compare_mask_regval; + struct { + mmr_t mask : 32; + mmr_t reserved_0 : 32; + } sh_trigger_compare_mask_s; +} sh_trigger_compare_mask_u_t; +#else +typedef union sh_trigger_compare_mask_u { + mmr_t sh_trigger_compare_mask_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t mask : 32; + } sh_trigger_compare_mask_s; +} sh_trigger_compare_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TRIGGER_COMPARE_PATTERN" */ +/* SHub Trigger Compare Pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_trigger_compare_pattern_u { + mmr_t sh_trigger_compare_pattern_regval; + struct { + mmr_t data : 32; + mmr_t reserved_0 : 32; + } sh_trigger_compare_pattern_s; +} sh_trigger_compare_pattern_u_t; +#else +typedef union sh_trigger_compare_pattern_u { + mmr_t sh_trigger_compare_pattern_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t data : 32; + } sh_trigger_compare_pattern_s; +} sh_trigger_compare_pattern_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TRIGGER_SEL" */ +/* Trigger select for SHUB debug port */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_trigger_sel_u { + mmr_t sh_trigger_sel_regval; + struct { + mmr_t nibble0_input_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_input_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_input_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_input_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_input_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_input_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_input_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_input_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_15 : 1; + } sh_trigger_sel_s; +} sh_trigger_sel_u_t; +#else +typedef union sh_trigger_sel_u { + mmr_t sh_trigger_sel_regval; + struct { + mmr_t reserved_15 : 1; + mmr_t nibble7_nibble_sel : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_input_sel : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble_sel : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_input_sel : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble_sel : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_input_sel : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble_sel : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_input_sel : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_input_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_input_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_input_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_input_sel : 3; + } sh_trigger_sel_s; +} sh_trigger_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_STOP_CLK_CONTROL" */ +/* Stop Clock Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_stop_clk_control_u { + mmr_t sh_stop_clk_control_regval; + struct { + mmr_t stimulus : 5; + mmr_t event : 1; + mmr_t polarity : 1; + mmr_t mode : 1; + mmr_t reserved_0 : 56; + } sh_stop_clk_control_s; +} sh_stop_clk_control_u_t; +#else +typedef union sh_stop_clk_control_u { + mmr_t sh_stop_clk_control_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t mode : 1; + mmr_t polarity : 1; + mmr_t event : 1; + mmr_t stimulus : 5; + } sh_stop_clk_control_s; +} sh_stop_clk_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_STOP_CLK_DELAY_PHASE" */ +/* Stop Clock Delay Phase */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_stop_clk_delay_phase_u { + mmr_t sh_stop_clk_delay_phase_regval; + struct { + mmr_t delay : 8; + mmr_t reserved_0 : 56; + } sh_stop_clk_delay_phase_s; +} sh_stop_clk_delay_phase_u_t; +#else +typedef union sh_stop_clk_delay_phase_u { + mmr_t sh_stop_clk_delay_phase_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t delay : 8; + } sh_stop_clk_delay_phase_s; +} sh_stop_clk_delay_phase_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TSF_ARM_MASK" */ +/* Trigger sequencing facility arm mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_tsf_arm_mask_u { + mmr_t sh_tsf_arm_mask_regval; + struct { + mmr_t mask : 64; + } sh_tsf_arm_mask_s; +} sh_tsf_arm_mask_u_t; +#else +typedef union sh_tsf_arm_mask_u { + mmr_t sh_tsf_arm_mask_regval; + struct { + mmr_t mask : 64; + } sh_tsf_arm_mask_s; +} sh_tsf_arm_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TSF_COUNTER_PRESETS" */ +/* Trigger sequencing facility counter presets */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_tsf_counter_presets_u { + mmr_t sh_tsf_counter_presets_regval; + struct { + mmr_t count_32 : 32; + mmr_t count_16 : 16; + mmr_t count_8b : 8; + mmr_t count_8a : 8; + } sh_tsf_counter_presets_s; +} sh_tsf_counter_presets_u_t; +#else +typedef union sh_tsf_counter_presets_u { + mmr_t sh_tsf_counter_presets_regval; + struct { + mmr_t count_8a : 8; + mmr_t count_8b : 8; + mmr_t count_16 : 16; + mmr_t count_32 : 32; + } sh_tsf_counter_presets_s; +} sh_tsf_counter_presets_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TSF_DECREMENT_CTL" */ +/* Trigger sequencing facility counter decrement control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_tsf_decrement_ctl_u { + mmr_t sh_tsf_decrement_ctl_regval; + struct { + mmr_t ctl : 16; + mmr_t reserved_0 : 48; + } sh_tsf_decrement_ctl_s; +} sh_tsf_decrement_ctl_u_t; +#else +typedef union sh_tsf_decrement_ctl_u { + mmr_t sh_tsf_decrement_ctl_regval; + struct { + mmr_t reserved_0 : 48; + mmr_t ctl : 16; + } sh_tsf_decrement_ctl_s; +} sh_tsf_decrement_ctl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TSF_DIAG_MSG_CTL" */ +/* Trigger sequencing facility diagnostic message control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_tsf_diag_msg_ctl_u { + mmr_t sh_tsf_diag_msg_ctl_regval; + struct { + mmr_t enable : 8; + mmr_t reserved_0 : 56; + } sh_tsf_diag_msg_ctl_s; +} sh_tsf_diag_msg_ctl_u_t; +#else +typedef union sh_tsf_diag_msg_ctl_u { + mmr_t sh_tsf_diag_msg_ctl_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t enable : 8; + } sh_tsf_diag_msg_ctl_s; +} sh_tsf_diag_msg_ctl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TSF_DISARM_MASK" */ +/* Trigger sequencing facility disarm mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_tsf_disarm_mask_u { + mmr_t sh_tsf_disarm_mask_regval; + struct { + mmr_t mask : 64; + } sh_tsf_disarm_mask_s; +} sh_tsf_disarm_mask_u_t; +#else +typedef union sh_tsf_disarm_mask_u { + mmr_t sh_tsf_disarm_mask_regval; + struct { + mmr_t mask : 64; + } sh_tsf_disarm_mask_s; +} sh_tsf_disarm_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TSF_ENABLE_CTL" */ +/* Trigger sequencing facility counter enable control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_tsf_enable_ctl_u { + mmr_t sh_tsf_enable_ctl_regval; + struct { + mmr_t ctl : 16; + mmr_t reserved_0 : 48; + } sh_tsf_enable_ctl_s; +} sh_tsf_enable_ctl_u_t; +#else +typedef union sh_tsf_enable_ctl_u { + mmr_t sh_tsf_enable_ctl_regval; + struct { + mmr_t reserved_0 : 48; + mmr_t ctl : 16; + } sh_tsf_enable_ctl_s; +} sh_tsf_enable_ctl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TSF_SOFTWARE_ARM" */ +/* Trigger sequencing facility software arm */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_tsf_software_arm_u { + mmr_t sh_tsf_software_arm_regval; + struct { + mmr_t bit0 : 1; + mmr_t bit1 : 1; + mmr_t bit2 : 1; + mmr_t bit3 : 1; + mmr_t bit4 : 1; + mmr_t bit5 : 1; + mmr_t bit6 : 1; + mmr_t bit7 : 1; + mmr_t reserved_0 : 56; + } sh_tsf_software_arm_s; +} sh_tsf_software_arm_u_t; +#else +typedef union sh_tsf_software_arm_u { + mmr_t sh_tsf_software_arm_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t bit7 : 1; + mmr_t bit6 : 1; + mmr_t bit5 : 1; + mmr_t bit4 : 1; + mmr_t bit3 : 1; + mmr_t bit2 : 1; + mmr_t bit1 : 1; + mmr_t bit0 : 1; + } sh_tsf_software_arm_s; +} sh_tsf_software_arm_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TSF_SOFTWARE_DISARM" */ +/* Trigger sequencing facility software disarm */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_tsf_software_disarm_u { + mmr_t sh_tsf_software_disarm_regval; + struct { + mmr_t bit0 : 1; + mmr_t bit1 : 1; + mmr_t bit2 : 1; + mmr_t bit3 : 1; + mmr_t bit4 : 1; + mmr_t bit5 : 1; + mmr_t bit6 : 1; + mmr_t bit7 : 1; + mmr_t reserved_0 : 56; + } sh_tsf_software_disarm_s; +} sh_tsf_software_disarm_u_t; +#else +typedef union sh_tsf_software_disarm_u { + mmr_t sh_tsf_software_disarm_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t bit7 : 1; + mmr_t bit6 : 1; + mmr_t bit5 : 1; + mmr_t bit4 : 1; + mmr_t bit3 : 1; + mmr_t bit2 : 1; + mmr_t bit1 : 1; + mmr_t bit0 : 1; + } sh_tsf_software_disarm_s; +} sh_tsf_software_disarm_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TSF_SOFTWARE_TRIGGERED" */ +/* Trigger sequencing facility software triggered */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_tsf_software_triggered_u { + mmr_t sh_tsf_software_triggered_regval; + struct { + mmr_t bit0 : 1; + mmr_t bit1 : 1; + mmr_t bit2 : 1; + mmr_t bit3 : 1; + mmr_t bit4 : 1; + mmr_t bit5 : 1; + mmr_t bit6 : 1; + mmr_t bit7 : 1; + mmr_t reserved_0 : 56; + } sh_tsf_software_triggered_s; +} sh_tsf_software_triggered_u_t; +#else +typedef union sh_tsf_software_triggered_u { + mmr_t sh_tsf_software_triggered_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t bit7 : 1; + mmr_t bit6 : 1; + mmr_t bit5 : 1; + mmr_t bit4 : 1; + mmr_t bit3 : 1; + mmr_t bit2 : 1; + mmr_t bit1 : 1; + mmr_t bit0 : 1; + } sh_tsf_software_triggered_s; +} sh_tsf_software_triggered_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TSF_TRIGGER_MASK" */ +/* Trigger sequencing facility trigger mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_tsf_trigger_mask_u { + mmr_t sh_tsf_trigger_mask_regval; + struct { + mmr_t mask : 64; + } sh_tsf_trigger_mask_s; +} sh_tsf_trigger_mask_u_t; +#else +typedef union sh_tsf_trigger_mask_u { + mmr_t sh_tsf_trigger_mask_regval; + struct { + mmr_t mask : 64; + } sh_tsf_trigger_mask_s; +} sh_tsf_trigger_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_VEC_DATA" */ +/* Vector Write Request Message Data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_vec_data_u { + mmr_t sh_vec_data_regval; + struct { + mmr_t data : 64; + } sh_vec_data_s; +} sh_vec_data_u_t; +#else +typedef union sh_vec_data_u { + mmr_t sh_vec_data_regval; + struct { + mmr_t data : 64; + } sh_vec_data_s; +} sh_vec_data_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_VEC_PARMS" */ +/* Vector Message Parameters Register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_vec_parms_u { + mmr_t sh_vec_parms_regval; + struct { + mmr_t type : 1; + mmr_t ni_port : 1; + mmr_t reserved_0 : 1; + mmr_t address : 32; + mmr_t pio_id : 11; + mmr_t reserved_1 : 16; + mmr_t start : 1; + mmr_t busy : 1; + } sh_vec_parms_s; +} sh_vec_parms_u_t; +#else +typedef union sh_vec_parms_u { + mmr_t sh_vec_parms_regval; + struct { + mmr_t busy : 1; + mmr_t start : 1; + mmr_t reserved_1 : 16; + mmr_t pio_id : 11; + mmr_t address : 32; + mmr_t reserved_0 : 1; + mmr_t ni_port : 1; + mmr_t type : 1; + } sh_vec_parms_s; +} sh_vec_parms_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_VEC_ROUTE" */ +/* Vector Request Message Route */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_vec_route_u { + mmr_t sh_vec_route_regval; + struct { + mmr_t route : 64; + } sh_vec_route_s; +} sh_vec_route_u_t; +#else +typedef union sh_vec_route_u { + mmr_t sh_vec_route_regval; + struct { + mmr_t route : 64; + } sh_vec_route_s; +} sh_vec_route_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_CPU_PERM" */ +/* CPU MMR Access Permission Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_cpu_perm_u { + mmr_t sh_cpu_perm_regval; + struct { + mmr_t access_bits : 64; + } sh_cpu_perm_s; +} sh_cpu_perm_u_t; +#else +typedef union sh_cpu_perm_u { + mmr_t sh_cpu_perm_regval; + struct { + mmr_t access_bits : 64; + } sh_cpu_perm_s; +} sh_cpu_perm_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_CPU_PERM_OVR" */ +/* CPU MMR Access Permission Override */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_cpu_perm_ovr_u { + mmr_t sh_cpu_perm_ovr_regval; + struct { + mmr_t override : 64; + } sh_cpu_perm_ovr_s; +} sh_cpu_perm_ovr_u_t; +#else +typedef union sh_cpu_perm_ovr_u { + mmr_t sh_cpu_perm_ovr_regval; + struct { + mmr_t override : 64; + } sh_cpu_perm_ovr_s; +} sh_cpu_perm_ovr_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_EXT_IO_PERM" */ +/* External IO MMR Access Permission Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ext_io_perm_u { + mmr_t sh_ext_io_perm_regval; + struct { + mmr_t access_bits : 64; + } sh_ext_io_perm_s; +} sh_ext_io_perm_u_t; +#else +typedef union sh_ext_io_perm_u { + mmr_t sh_ext_io_perm_regval; + struct { + mmr_t access_bits : 64; + } sh_ext_io_perm_s; +} sh_ext_io_perm_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_EXT_IOI_ACCESS" */ +/* External IO Interrupt Access Permission Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ext_ioi_access_u { + mmr_t sh_ext_ioi_access_regval; + struct { + mmr_t access_bits : 64; + } sh_ext_ioi_access_s; +} sh_ext_ioi_access_u_t; +#else +typedef union sh_ext_ioi_access_u { + mmr_t sh_ext_ioi_access_regval; + struct { + mmr_t access_bits : 64; + } sh_ext_ioi_access_s; +} sh_ext_ioi_access_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GC_FIL_CTRL" */ +/* SHub Global Clock Filter Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gc_fil_ctrl_u { + mmr_t sh_gc_fil_ctrl_regval; + struct { + mmr_t offset : 5; + mmr_t reserved_0 : 3; + mmr_t mask_counter : 12; + mmr_t mask_enable : 1; + mmr_t reserved_1 : 3; + mmr_t dropout_counter : 10; + mmr_t reserved_2 : 2; + mmr_t dropout_thresh : 10; + mmr_t reserved_3 : 2; + mmr_t error_counter : 10; + mmr_t reserved_4 : 6; + } sh_gc_fil_ctrl_s; +} sh_gc_fil_ctrl_u_t; +#else +typedef union sh_gc_fil_ctrl_u { + mmr_t sh_gc_fil_ctrl_regval; + struct { + mmr_t reserved_4 : 6; + mmr_t error_counter : 10; + mmr_t reserved_3 : 2; + mmr_t dropout_thresh : 10; + mmr_t reserved_2 : 2; + mmr_t dropout_counter : 10; + mmr_t reserved_1 : 3; + mmr_t mask_enable : 1; + mmr_t mask_counter : 12; + mmr_t reserved_0 : 3; + mmr_t offset : 5; + } sh_gc_fil_ctrl_s; +} sh_gc_fil_ctrl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_GC_SRC_CTRL" */ +/* SHub Global Clock Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_gc_src_ctrl_u { + mmr_t sh_gc_src_ctrl_regval; + struct { + mmr_t enable_counter : 1; + mmr_t reserved_0 : 3; + mmr_t max_count : 10; + mmr_t reserved_1 : 2; + mmr_t counter : 10; + mmr_t reserved_2 : 2; + mmr_t toggle_bit : 1; + mmr_t reserved_3 : 3; + mmr_t source_sel : 2; + mmr_t reserved_4 : 30; + } sh_gc_src_ctrl_s; +} sh_gc_src_ctrl_u_t; +#else +typedef union sh_gc_src_ctrl_u { + mmr_t sh_gc_src_ctrl_regval; + struct { + mmr_t reserved_4 : 30; + mmr_t source_sel : 2; + mmr_t reserved_3 : 3; + mmr_t toggle_bit : 1; + mmr_t reserved_2 : 2; + mmr_t counter : 10; + mmr_t reserved_1 : 2; + mmr_t max_count : 10; + mmr_t reserved_0 : 3; + mmr_t enable_counter : 1; + } sh_gc_src_ctrl_s; +} sh_gc_src_ctrl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_HARD_RESET" */ +/* SHub Hard Reset */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_hard_reset_u { + mmr_t sh_hard_reset_regval; + struct { + mmr_t hard_reset : 1; + mmr_t reserved_0 : 63; + } sh_hard_reset_s; +} sh_hard_reset_u_t; +#else +typedef union sh_hard_reset_u { + mmr_t sh_hard_reset_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t hard_reset : 1; + } sh_hard_reset_s; +} sh_hard_reset_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_IO_PERM" */ +/* II MMR Access Permission Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_io_perm_u { + mmr_t sh_io_perm_regval; + struct { + mmr_t access_bits : 64; + } sh_io_perm_s; +} sh_io_perm_u_t; +#else +typedef union sh_io_perm_u { + mmr_t sh_io_perm_regval; + struct { + mmr_t access_bits : 64; + } sh_io_perm_s; +} sh_io_perm_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_IOI_ACCESS" */ +/* II Interrupt Access Permission Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ioi_access_u { + mmr_t sh_ioi_access_regval; + struct { + mmr_t access_bits : 64; + } sh_ioi_access_s; +} sh_ioi_access_u_t; +#else +typedef union sh_ioi_access_u { + mmr_t sh_ioi_access_regval; + struct { + mmr_t access_bits : 64; + } sh_ioi_access_s; +} sh_ioi_access_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_IPI_ACCESS" */ +/* CPU interrupt Access Permission Bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ipi_access_u { + mmr_t sh_ipi_access_regval; + struct { + mmr_t access_bits : 64; + } sh_ipi_access_s; +} sh_ipi_access_u_t; +#else +typedef union sh_ipi_access_u { + mmr_t sh_ipi_access_regval; + struct { + mmr_t access_bits : 64; + } sh_ipi_access_s; +} sh_ipi_access_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_JTAG_CONFIG" */ +/* SHub JTAG configuration */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_jtag_config_u { + mmr_t sh_jtag_config_regval; + struct { + mmr_t md_clk_sel : 2; + mmr_t ni_clk_sel : 1; + mmr_t ii_clk_sel : 2; + mmr_t wrt90_target : 14; + mmr_t wrt90_overrider : 1; + mmr_t wrt90_override : 1; + mmr_t jtag_mci_reset_delay : 4; + mmr_t jtag_mci_target : 14; + mmr_t jtag_mci_override : 1; + mmr_t fsb_config_ioq_depth : 1; + mmr_t fsb_config_sample_binit : 1; + mmr_t fsb_config_enable_bus_parking : 1; + mmr_t fsb_config_clock_ratio : 5; + mmr_t fsb_config_output_tristate : 4; + mmr_t fsb_config_enable_bist : 1; + mmr_t fsb_config_aux : 2; + mmr_t gtl_config_re : 1; + mmr_t reserved_0 : 8; + } sh_jtag_config_s; +} sh_jtag_config_u_t; +#else +typedef union sh_jtag_config_u { + mmr_t sh_jtag_config_regval; + struct { + mmr_t reserved_0 : 8; + mmr_t gtl_config_re : 1; + mmr_t fsb_config_aux : 2; + mmr_t fsb_config_enable_bist : 1; + mmr_t fsb_config_output_tristate : 4; + mmr_t fsb_config_clock_ratio : 5; + mmr_t fsb_config_enable_bus_parking : 1; + mmr_t fsb_config_sample_binit : 1; + mmr_t fsb_config_ioq_depth : 1; + mmr_t jtag_mci_override : 1; + mmr_t jtag_mci_target : 14; + mmr_t jtag_mci_reset_delay : 4; + mmr_t wrt90_override : 1; + mmr_t wrt90_overrider : 1; + mmr_t wrt90_target : 14; + mmr_t ii_clk_sel : 2; + mmr_t ni_clk_sel : 1; + mmr_t md_clk_sel : 2; + } sh_jtag_config_s; +} sh_jtag_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_SHUB_ID" */ +/* SHub ID Number */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_shub_id_u { + mmr_t sh_shub_id_regval; + struct { + mmr_t force1 : 1; + mmr_t manufacturer : 11; + mmr_t part_number : 16; + mmr_t revision : 4; + mmr_t node_id : 11; + mmr_t reserved_0 : 1; + mmr_t sharing_mode : 2; + mmr_t reserved_1 : 2; + mmr_t nodes_per_bit : 5; + mmr_t reserved_2 : 3; + mmr_t ni_port : 1; + mmr_t reserved_3 : 7; + } sh_shub_id_s; +} sh_shub_id_u_t; +#else +typedef union sh_shub_id_u { + mmr_t sh_shub_id_regval; + struct { + mmr_t reserved_3 : 7; + mmr_t ni_port : 1; + mmr_t reserved_2 : 3; + mmr_t nodes_per_bit : 5; + mmr_t reserved_1 : 2; + mmr_t sharing_mode : 2; + mmr_t reserved_0 : 1; + mmr_t node_id : 11; + mmr_t revision : 4; + mmr_t part_number : 16; + mmr_t manufacturer : 11; + mmr_t force1 : 1; + } sh_shub_id_s; +} sh_shub_id_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_SHUBS_PRESENT0" */ +/* Shubs 0 - 63 Present. Used for invalidate generation */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_shubs_present0_u { + mmr_t sh_shubs_present0_regval; + struct { + mmr_t shubs_present0 : 64; + } sh_shubs_present0_s; +} sh_shubs_present0_u_t; +#else +typedef union sh_shubs_present0_u { + mmr_t sh_shubs_present0_regval; + struct { + mmr_t shubs_present0 : 64; + } sh_shubs_present0_s; +} sh_shubs_present0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_SHUBS_PRESENT1" */ +/* Shubs 64 - 127 Present. Used for invalidate generation */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_shubs_present1_u { + mmr_t sh_shubs_present1_regval; + struct { + mmr_t shubs_present1 : 64; + } sh_shubs_present1_s; +} sh_shubs_present1_u_t; +#else +typedef union sh_shubs_present1_u { + mmr_t sh_shubs_present1_regval; + struct { + mmr_t shubs_present1 : 64; + } sh_shubs_present1_s; +} sh_shubs_present1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_SHUBS_PRESENT2" */ +/* Shubs 128 - 191 Present. Used for invalidate generation */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_shubs_present2_u { + mmr_t sh_shubs_present2_regval; + struct { + mmr_t shubs_present2 : 64; + } sh_shubs_present2_s; +} sh_shubs_present2_u_t; +#else +typedef union sh_shubs_present2_u { + mmr_t sh_shubs_present2_regval; + struct { + mmr_t shubs_present2 : 64; + } sh_shubs_present2_s; +} sh_shubs_present2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_SHUBS_PRESENT3" */ +/* Shubs 192 - 255 Present. Used for invalidate generation */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_shubs_present3_u { + mmr_t sh_shubs_present3_regval; + struct { + mmr_t shubs_present3 : 64; + } sh_shubs_present3_s; +} sh_shubs_present3_u_t; +#else +typedef union sh_shubs_present3_u { + mmr_t sh_shubs_present3_regval; + struct { + mmr_t shubs_present3 : 64; + } sh_shubs_present3_s; +} sh_shubs_present3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_SOFT_RESET" */ +/* SHub Soft Reset */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_soft_reset_u { + mmr_t sh_soft_reset_regval; + struct { + mmr_t soft_reset : 1; + mmr_t reserved_0 : 63; + } sh_soft_reset_s; +} sh_soft_reset_u_t; +#else +typedef union sh_soft_reset_u { + mmr_t sh_soft_reset_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t soft_reset : 1; + } sh_soft_reset_s; +} sh_soft_reset_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_FIRST_ERROR" */ +/* Shub Global First Error Flags */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_first_error_u { + mmr_t sh_first_error_regval; + struct { + mmr_t first_error : 19; + mmr_t reserved_0 : 45; + } sh_first_error_s; +} sh_first_error_u_t; +#else +typedef union sh_first_error_u { + mmr_t sh_first_error_regval; + struct { + mmr_t reserved_0 : 45; + mmr_t first_error : 19; + } sh_first_error_s; +} sh_first_error_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_II_HW_TIME_STAMP" */ +/* II hardware error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ii_hw_time_stamp_u { + mmr_t sh_ii_hw_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_ii_hw_time_stamp_s; +} sh_ii_hw_time_stamp_u_t; +#else +typedef union sh_ii_hw_time_stamp_u { + mmr_t sh_ii_hw_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_ii_hw_time_stamp_s; +} sh_ii_hw_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_HW_TIME_STAMP" */ +/* LB hardware error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_hw_time_stamp_u { + mmr_t sh_lb_hw_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_lb_hw_time_stamp_s; +} sh_lb_hw_time_stamp_u_t; +#else +typedef union sh_lb_hw_time_stamp_u { + mmr_t sh_lb_hw_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_lb_hw_time_stamp_s; +} sh_lb_hw_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_COR_TIME_STAMP" */ +/* MD correctable error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_cor_time_stamp_u { + mmr_t sh_md_cor_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_md_cor_time_stamp_s; +} sh_md_cor_time_stamp_u_t; +#else +typedef union sh_md_cor_time_stamp_u { + mmr_t sh_md_cor_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_md_cor_time_stamp_s; +} sh_md_cor_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_HW_TIME_STAMP" */ +/* MD hardware error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_hw_time_stamp_u { + mmr_t sh_md_hw_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_md_hw_time_stamp_s; +} sh_md_hw_time_stamp_u_t; +#else +typedef union sh_md_hw_time_stamp_u { + mmr_t sh_md_hw_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_md_hw_time_stamp_s; +} sh_md_hw_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_UNCOR_TIME_STAMP" */ +/* MD uncorrectable error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_uncor_time_stamp_u { + mmr_t sh_md_uncor_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_md_uncor_time_stamp_s; +} sh_md_uncor_time_stamp_u_t; +#else +typedef union sh_md_uncor_time_stamp_u { + mmr_t sh_md_uncor_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_md_uncor_time_stamp_s; +} sh_md_uncor_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_COR_TIME_STAMP" */ +/* PI correctable error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_cor_time_stamp_u { + mmr_t sh_pi_cor_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_pi_cor_time_stamp_s; +} sh_pi_cor_time_stamp_u_t; +#else +typedef union sh_pi_cor_time_stamp_u { + mmr_t sh_pi_cor_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_pi_cor_time_stamp_s; +} sh_pi_cor_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_HW_TIME_STAMP" */ +/* PI hardware error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_hw_time_stamp_u { + mmr_t sh_pi_hw_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_pi_hw_time_stamp_s; +} sh_pi_hw_time_stamp_u_t; +#else +typedef union sh_pi_hw_time_stamp_u { + mmr_t sh_pi_hw_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_pi_hw_time_stamp_s; +} sh_pi_hw_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_UNCOR_TIME_STAMP" */ +/* PI uncorrectable error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_uncor_time_stamp_u { + mmr_t sh_pi_uncor_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_pi_uncor_time_stamp_s; +} sh_pi_uncor_time_stamp_u_t; +#else +typedef union sh_pi_uncor_time_stamp_u { + mmr_t sh_pi_uncor_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_pi_uncor_time_stamp_s; +} sh_pi_uncor_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC0_ADV_TIME_STAMP" */ +/* Proc 0 advisory time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc0_adv_time_stamp_u { + mmr_t sh_proc0_adv_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_proc0_adv_time_stamp_s; +} sh_proc0_adv_time_stamp_u_t; +#else +typedef union sh_proc0_adv_time_stamp_u { + mmr_t sh_proc0_adv_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_proc0_adv_time_stamp_s; +} sh_proc0_adv_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC0_ERR_TIME_STAMP" */ +/* Proc 0 error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc0_err_time_stamp_u { + mmr_t sh_proc0_err_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_proc0_err_time_stamp_s; +} sh_proc0_err_time_stamp_u_t; +#else +typedef union sh_proc0_err_time_stamp_u { + mmr_t sh_proc0_err_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_proc0_err_time_stamp_s; +} sh_proc0_err_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC1_ADV_TIME_STAMP" */ +/* Proc 1 advisory time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc1_adv_time_stamp_u { + mmr_t sh_proc1_adv_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_proc1_adv_time_stamp_s; +} sh_proc1_adv_time_stamp_u_t; +#else +typedef union sh_proc1_adv_time_stamp_u { + mmr_t sh_proc1_adv_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_proc1_adv_time_stamp_s; +} sh_proc1_adv_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC1_ERR_TIME_STAMP" */ +/* Proc 1 error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc1_err_time_stamp_u { + mmr_t sh_proc1_err_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_proc1_err_time_stamp_s; +} sh_proc1_err_time_stamp_u_t; +#else +typedef union sh_proc1_err_time_stamp_u { + mmr_t sh_proc1_err_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_proc1_err_time_stamp_s; +} sh_proc1_err_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC2_ADV_TIME_STAMP" */ +/* Proc 2 advisory time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc2_adv_time_stamp_u { + mmr_t sh_proc2_adv_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_proc2_adv_time_stamp_s; +} sh_proc2_adv_time_stamp_u_t; +#else +typedef union sh_proc2_adv_time_stamp_u { + mmr_t sh_proc2_adv_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_proc2_adv_time_stamp_s; +} sh_proc2_adv_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC2_ERR_TIME_STAMP" */ +/* Proc 2 error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc2_err_time_stamp_u { + mmr_t sh_proc2_err_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_proc2_err_time_stamp_s; +} sh_proc2_err_time_stamp_u_t; +#else +typedef union sh_proc2_err_time_stamp_u { + mmr_t sh_proc2_err_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_proc2_err_time_stamp_s; +} sh_proc2_err_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC3_ADV_TIME_STAMP" */ +/* Proc 3 advisory time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc3_adv_time_stamp_u { + mmr_t sh_proc3_adv_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_proc3_adv_time_stamp_s; +} sh_proc3_adv_time_stamp_u_t; +#else +typedef union sh_proc3_adv_time_stamp_u { + mmr_t sh_proc3_adv_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_proc3_adv_time_stamp_s; +} sh_proc3_adv_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROC3_ERR_TIME_STAMP" */ +/* Proc 3 error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_proc3_err_time_stamp_u { + mmr_t sh_proc3_err_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_proc3_err_time_stamp_s; +} sh_proc3_err_time_stamp_u_t; +#else +typedef union sh_proc3_err_time_stamp_u { + mmr_t sh_proc3_err_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_proc3_err_time_stamp_s; +} sh_proc3_err_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_COR_TIME_STAMP" */ +/* XN correctable error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_cor_time_stamp_u { + mmr_t sh_xn_cor_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_xn_cor_time_stamp_s; +} sh_xn_cor_time_stamp_u_t; +#else +typedef union sh_xn_cor_time_stamp_u { + mmr_t sh_xn_cor_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_xn_cor_time_stamp_s; +} sh_xn_cor_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_HW_TIME_STAMP" */ +/* XN hardware error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_hw_time_stamp_u { + mmr_t sh_xn_hw_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_xn_hw_time_stamp_s; +} sh_xn_hw_time_stamp_u_t; +#else +typedef union sh_xn_hw_time_stamp_u { + mmr_t sh_xn_hw_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_xn_hw_time_stamp_s; +} sh_xn_hw_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_UNCOR_TIME_STAMP" */ +/* XN uncorrectable error time stamp */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_uncor_time_stamp_u { + mmr_t sh_xn_uncor_time_stamp_regval; + struct { + mmr_t time : 63; + mmr_t valid : 1; + } sh_xn_uncor_time_stamp_s; +} sh_xn_uncor_time_stamp_u_t; +#else +typedef union sh_xn_uncor_time_stamp_u { + mmr_t sh_xn_uncor_time_stamp_regval; + struct { + mmr_t valid : 1; + mmr_t time : 63; + } sh_xn_uncor_time_stamp_s; +} sh_xn_uncor_time_stamp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DEBUG_PORT" */ +/* SHub Debug Port */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_debug_port_u { + mmr_t sh_debug_port_regval; + struct { + mmr_t debug_nibble0 : 4; + mmr_t debug_nibble1 : 4; + mmr_t debug_nibble2 : 4; + mmr_t debug_nibble3 : 4; + mmr_t debug_nibble4 : 4; + mmr_t debug_nibble5 : 4; + mmr_t debug_nibble6 : 4; + mmr_t debug_nibble7 : 4; + mmr_t reserved_0 : 32; + } sh_debug_port_s; +} sh_debug_port_u_t; +#else +typedef union sh_debug_port_u { + mmr_t sh_debug_port_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t debug_nibble7 : 4; + mmr_t debug_nibble6 : 4; + mmr_t debug_nibble5 : 4; + mmr_t debug_nibble4 : 4; + mmr_t debug_nibble3 : 4; + mmr_t debug_nibble2 : 4; + mmr_t debug_nibble1 : 4; + mmr_t debug_nibble0 : 4; + } sh_debug_port_s; +} sh_debug_port_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_II_DEBUG_DATA" */ +/* II Debug Data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ii_debug_data_u { + mmr_t sh_ii_debug_data_regval; + struct { + mmr_t ii_data : 32; + mmr_t reserved_0 : 32; + } sh_ii_debug_data_s; +} sh_ii_debug_data_u_t; +#else +typedef union sh_ii_debug_data_u { + mmr_t sh_ii_debug_data_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t ii_data : 32; + } sh_ii_debug_data_s; +} sh_ii_debug_data_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_II_WRAP_DEBUG_DATA" */ +/* SHub II Wrapper Debug Data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ii_wrap_debug_data_u { + mmr_t sh_ii_wrap_debug_data_regval; + struct { + mmr_t ii_wrap_data : 32; + mmr_t reserved_0 : 32; + } sh_ii_wrap_debug_data_s; +} sh_ii_wrap_debug_data_u_t; +#else +typedef union sh_ii_wrap_debug_data_u { + mmr_t sh_ii_wrap_debug_data_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t ii_wrap_data : 32; + } sh_ii_wrap_debug_data_s; +} sh_ii_wrap_debug_data_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_LB_DEBUG_DATA" */ +/* SHub LB Debug Data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_lb_debug_data_u { + mmr_t sh_lb_debug_data_regval; + struct { + mmr_t lb_data : 32; + mmr_t reserved_0 : 32; + } sh_lb_debug_data_s; +} sh_lb_debug_data_u_t; +#else +typedef union sh_lb_debug_data_u { + mmr_t sh_lb_debug_data_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t lb_data : 32; + } sh_lb_debug_data_s; +} sh_lb_debug_data_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DEBUG_DATA" */ +/* SHub MD Debug Data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_debug_data_u { + mmr_t sh_md_debug_data_regval; + struct { + mmr_t md_data : 32; + mmr_t reserved_0 : 32; + } sh_md_debug_data_s; +} sh_md_debug_data_u_t; +#else +typedef union sh_md_debug_data_u { + mmr_t sh_md_debug_data_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t md_data : 32; + } sh_md_debug_data_s; +} sh_md_debug_data_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_DEBUG_DATA" */ +/* SHub PI Debug Data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_debug_data_u { + mmr_t sh_pi_debug_data_regval; + struct { + mmr_t pi_data : 32; + mmr_t reserved_0 : 32; + } sh_pi_debug_data_s; +} sh_pi_debug_data_u_t; +#else +typedef union sh_pi_debug_data_u { + mmr_t sh_pi_debug_data_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t pi_data : 32; + } sh_pi_debug_data_s; +} sh_pi_debug_data_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_DEBUG_DATA" */ +/* SHub XN Debug Data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_debug_data_u { + mmr_t sh_xn_debug_data_regval; + struct { + mmr_t xn_data : 32; + mmr_t reserved_0 : 32; + } sh_xn_debug_data_s; +} sh_xn_debug_data_u_t; +#else +typedef union sh_xn_debug_data_u { + mmr_t sh_xn_debug_data_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t xn_data : 32; + } sh_xn_debug_data_s; +} sh_xn_debug_data_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TSF_ARMED_STATE" */ +/* Trigger sequencing facility arm state */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_tsf_armed_state_u { + mmr_t sh_tsf_armed_state_regval; + struct { + mmr_t state : 8; + mmr_t reserved_0 : 56; + } sh_tsf_armed_state_s; +} sh_tsf_armed_state_u_t; +#else +typedef union sh_tsf_armed_state_u { + mmr_t sh_tsf_armed_state_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t state : 8; + } sh_tsf_armed_state_s; +} sh_tsf_armed_state_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TSF_COUNTER_VALUE" */ +/* Trigger sequencing facility counter value */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_tsf_counter_value_u { + mmr_t sh_tsf_counter_value_regval; + struct { + mmr_t count_32 : 32; + mmr_t count_16 : 16; + mmr_t count_8b : 8; + mmr_t count_8a : 8; + } sh_tsf_counter_value_s; +} sh_tsf_counter_value_u_t; +#else +typedef union sh_tsf_counter_value_u { + mmr_t sh_tsf_counter_value_regval; + struct { + mmr_t count_8a : 8; + mmr_t count_8b : 8; + mmr_t count_16 : 16; + mmr_t count_32 : 32; + } sh_tsf_counter_value_s; +} sh_tsf_counter_value_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_TSF_TRIGGERED_STATE" */ +/* Trigger sequencing facility triggered state */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_tsf_triggered_state_u { + mmr_t sh_tsf_triggered_state_regval; + struct { + mmr_t state : 8; + mmr_t reserved_0 : 56; + } sh_tsf_triggered_state_s; +} sh_tsf_triggered_state_u_t; +#else +typedef union sh_tsf_triggered_state_u { + mmr_t sh_tsf_triggered_state_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t state : 8; + } sh_tsf_triggered_state_s; +} sh_tsf_triggered_state_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_VEC_RDDATA" */ +/* Vector Reply Message Data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_vec_rddata_u { + mmr_t sh_vec_rddata_regval; + struct { + mmr_t data : 64; + } sh_vec_rddata_s; +} sh_vec_rddata_u_t; +#else +typedef union sh_vec_rddata_u { + mmr_t sh_vec_rddata_regval; + struct { + mmr_t data : 64; + } sh_vec_rddata_s; +} sh_vec_rddata_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_VEC_RETURN" */ +/* Vector Reply Message Return Route */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_vec_return_u { + mmr_t sh_vec_return_regval; + struct { + mmr_t route : 64; + } sh_vec_return_s; +} sh_vec_return_u_t; +#else +typedef union sh_vec_return_u { + mmr_t sh_vec_return_regval; + struct { + mmr_t route : 64; + } sh_vec_return_s; +} sh_vec_return_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_VEC_STATUS" */ +/* Vector Reply Message Status */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_vec_status_u { + mmr_t sh_vec_status_regval; + struct { + mmr_t type : 3; + mmr_t address : 32; + mmr_t pio_id : 11; + mmr_t source : 14; + mmr_t reserved_0 : 2; + mmr_t overrun : 1; + mmr_t status_valid : 1; + } sh_vec_status_s; +} sh_vec_status_u_t; +#else +typedef union sh_vec_status_u { + mmr_t sh_vec_status_regval; + struct { + mmr_t status_valid : 1; + mmr_t overrun : 1; + mmr_t reserved_0 : 2; + mmr_t source : 14; + mmr_t pio_id : 11; + mmr_t address : 32; + mmr_t type : 3; + } sh_vec_status_s; +} sh_vec_status_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT0_CONTROL" */ +/* Performance Counter 0 Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_count0_control_u { + mmr_t sh_performance_count0_control_regval; + struct { + mmr_t up_stimulus : 5; + mmr_t up_event : 1; + mmr_t up_polarity : 1; + mmr_t up_mode : 1; + mmr_t dn_stimulus : 5; + mmr_t dn_event : 1; + mmr_t dn_polarity : 1; + mmr_t dn_mode : 1; + mmr_t inc_enable : 1; + mmr_t dec_enable : 1; + mmr_t peak_det_enable : 1; + mmr_t reserved_0 : 45; + } sh_performance_count0_control_s; +} sh_performance_count0_control_u_t; +#else +typedef union sh_performance_count0_control_u { + mmr_t sh_performance_count0_control_regval; + struct { + mmr_t reserved_0 : 45; + mmr_t peak_det_enable : 1; + mmr_t dec_enable : 1; + mmr_t inc_enable : 1; + mmr_t dn_mode : 1; + mmr_t dn_polarity : 1; + mmr_t dn_event : 1; + mmr_t dn_stimulus : 5; + mmr_t up_mode : 1; + mmr_t up_polarity : 1; + mmr_t up_event : 1; + mmr_t up_stimulus : 5; + } sh_performance_count0_control_s; +} sh_performance_count0_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT1_CONTROL" */ +/* Performance Counter 1 Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_count1_control_u { + mmr_t sh_performance_count1_control_regval; + struct { + mmr_t up_stimulus : 5; + mmr_t up_event : 1; + mmr_t up_polarity : 1; + mmr_t up_mode : 1; + mmr_t dn_stimulus : 5; + mmr_t dn_event : 1; + mmr_t dn_polarity : 1; + mmr_t dn_mode : 1; + mmr_t inc_enable : 1; + mmr_t dec_enable : 1; + mmr_t peak_det_enable : 1; + mmr_t reserved_0 : 45; + } sh_performance_count1_control_s; +} sh_performance_count1_control_u_t; +#else +typedef union sh_performance_count1_control_u { + mmr_t sh_performance_count1_control_regval; + struct { + mmr_t reserved_0 : 45; + mmr_t peak_det_enable : 1; + mmr_t dec_enable : 1; + mmr_t inc_enable : 1; + mmr_t dn_mode : 1; + mmr_t dn_polarity : 1; + mmr_t dn_event : 1; + mmr_t dn_stimulus : 5; + mmr_t up_mode : 1; + mmr_t up_polarity : 1; + mmr_t up_event : 1; + mmr_t up_stimulus : 5; + } sh_performance_count1_control_s; +} sh_performance_count1_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT2_CONTROL" */ +/* Performance Counter 2 Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_count2_control_u { + mmr_t sh_performance_count2_control_regval; + struct { + mmr_t up_stimulus : 5; + mmr_t up_event : 1; + mmr_t up_polarity : 1; + mmr_t up_mode : 1; + mmr_t dn_stimulus : 5; + mmr_t dn_event : 1; + mmr_t dn_polarity : 1; + mmr_t dn_mode : 1; + mmr_t inc_enable : 1; + mmr_t dec_enable : 1; + mmr_t peak_det_enable : 1; + mmr_t reserved_0 : 45; + } sh_performance_count2_control_s; +} sh_performance_count2_control_u_t; +#else +typedef union sh_performance_count2_control_u { + mmr_t sh_performance_count2_control_regval; + struct { + mmr_t reserved_0 : 45; + mmr_t peak_det_enable : 1; + mmr_t dec_enable : 1; + mmr_t inc_enable : 1; + mmr_t dn_mode : 1; + mmr_t dn_polarity : 1; + mmr_t dn_event : 1; + mmr_t dn_stimulus : 5; + mmr_t up_mode : 1; + mmr_t up_polarity : 1; + mmr_t up_event : 1; + mmr_t up_stimulus : 5; + } sh_performance_count2_control_s; +} sh_performance_count2_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT3_CONTROL" */ +/* Performance Counter 3 Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_count3_control_u { + mmr_t sh_performance_count3_control_regval; + struct { + mmr_t up_stimulus : 5; + mmr_t up_event : 1; + mmr_t up_polarity : 1; + mmr_t up_mode : 1; + mmr_t dn_stimulus : 5; + mmr_t dn_event : 1; + mmr_t dn_polarity : 1; + mmr_t dn_mode : 1; + mmr_t inc_enable : 1; + mmr_t dec_enable : 1; + mmr_t peak_det_enable : 1; + mmr_t reserved_0 : 45; + } sh_performance_count3_control_s; +} sh_performance_count3_control_u_t; +#else +typedef union sh_performance_count3_control_u { + mmr_t sh_performance_count3_control_regval; + struct { + mmr_t reserved_0 : 45; + mmr_t peak_det_enable : 1; + mmr_t dec_enable : 1; + mmr_t inc_enable : 1; + mmr_t dn_mode : 1; + mmr_t dn_polarity : 1; + mmr_t dn_event : 1; + mmr_t dn_stimulus : 5; + mmr_t up_mode : 1; + mmr_t up_polarity : 1; + mmr_t up_event : 1; + mmr_t up_stimulus : 5; + } sh_performance_count3_control_s; +} sh_performance_count3_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT4_CONTROL" */ +/* Performance Counter 4 Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_count4_control_u { + mmr_t sh_performance_count4_control_regval; + struct { + mmr_t up_stimulus : 5; + mmr_t up_event : 1; + mmr_t up_polarity : 1; + mmr_t up_mode : 1; + mmr_t dn_stimulus : 5; + mmr_t dn_event : 1; + mmr_t dn_polarity : 1; + mmr_t dn_mode : 1; + mmr_t inc_enable : 1; + mmr_t dec_enable : 1; + mmr_t peak_det_enable : 1; + mmr_t reserved_0 : 45; + } sh_performance_count4_control_s; +} sh_performance_count4_control_u_t; +#else +typedef union sh_performance_count4_control_u { + mmr_t sh_performance_count4_control_regval; + struct { + mmr_t reserved_0 : 45; + mmr_t peak_det_enable : 1; + mmr_t dec_enable : 1; + mmr_t inc_enable : 1; + mmr_t dn_mode : 1; + mmr_t dn_polarity : 1; + mmr_t dn_event : 1; + mmr_t dn_stimulus : 5; + mmr_t up_mode : 1; + mmr_t up_polarity : 1; + mmr_t up_event : 1; + mmr_t up_stimulus : 5; + } sh_performance_count4_control_s; +} sh_performance_count4_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT5_CONTROL" */ +/* Performance Counter 5 Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_count5_control_u { + mmr_t sh_performance_count5_control_regval; + struct { + mmr_t up_stimulus : 5; + mmr_t up_event : 1; + mmr_t up_polarity : 1; + mmr_t up_mode : 1; + mmr_t dn_stimulus : 5; + mmr_t dn_event : 1; + mmr_t dn_polarity : 1; + mmr_t dn_mode : 1; + mmr_t inc_enable : 1; + mmr_t dec_enable : 1; + mmr_t peak_det_enable : 1; + mmr_t reserved_0 : 45; + } sh_performance_count5_control_s; +} sh_performance_count5_control_u_t; +#else +typedef union sh_performance_count5_control_u { + mmr_t sh_performance_count5_control_regval; + struct { + mmr_t reserved_0 : 45; + mmr_t peak_det_enable : 1; + mmr_t dec_enable : 1; + mmr_t inc_enable : 1; + mmr_t dn_mode : 1; + mmr_t dn_polarity : 1; + mmr_t dn_event : 1; + mmr_t dn_stimulus : 5; + mmr_t up_mode : 1; + mmr_t up_polarity : 1; + mmr_t up_event : 1; + mmr_t up_stimulus : 5; + } sh_performance_count5_control_s; +} sh_performance_count5_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT6_CONTROL" */ +/* Performance Counter 6 Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_count6_control_u { + mmr_t sh_performance_count6_control_regval; + struct { + mmr_t up_stimulus : 5; + mmr_t up_event : 1; + mmr_t up_polarity : 1; + mmr_t up_mode : 1; + mmr_t dn_stimulus : 5; + mmr_t dn_event : 1; + mmr_t dn_polarity : 1; + mmr_t dn_mode : 1; + mmr_t inc_enable : 1; + mmr_t dec_enable : 1; + mmr_t peak_det_enable : 1; + mmr_t reserved_0 : 45; + } sh_performance_count6_control_s; +} sh_performance_count6_control_u_t; +#else +typedef union sh_performance_count6_control_u { + mmr_t sh_performance_count6_control_regval; + struct { + mmr_t reserved_0 : 45; + mmr_t peak_det_enable : 1; + mmr_t dec_enable : 1; + mmr_t inc_enable : 1; + mmr_t dn_mode : 1; + mmr_t dn_polarity : 1; + mmr_t dn_event : 1; + mmr_t dn_stimulus : 5; + mmr_t up_mode : 1; + mmr_t up_polarity : 1; + mmr_t up_event : 1; + mmr_t up_stimulus : 5; + } sh_performance_count6_control_s; +} sh_performance_count6_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNT7_CONTROL" */ +/* Performance Counter 7 Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_count7_control_u { + mmr_t sh_performance_count7_control_regval; + struct { + mmr_t up_stimulus : 5; + mmr_t up_event : 1; + mmr_t up_polarity : 1; + mmr_t up_mode : 1; + mmr_t dn_stimulus : 5; + mmr_t dn_event : 1; + mmr_t dn_polarity : 1; + mmr_t dn_mode : 1; + mmr_t inc_enable : 1; + mmr_t dec_enable : 1; + mmr_t peak_det_enable : 1; + mmr_t reserved_0 : 45; + } sh_performance_count7_control_s; +} sh_performance_count7_control_u_t; +#else +typedef union sh_performance_count7_control_u { + mmr_t sh_performance_count7_control_regval; + struct { + mmr_t reserved_0 : 45; + mmr_t peak_det_enable : 1; + mmr_t dec_enable : 1; + mmr_t inc_enable : 1; + mmr_t dn_mode : 1; + mmr_t dn_polarity : 1; + mmr_t dn_event : 1; + mmr_t dn_stimulus : 5; + mmr_t up_mode : 1; + mmr_t up_polarity : 1; + mmr_t up_event : 1; + mmr_t up_stimulus : 5; + } sh_performance_count7_control_s; +} sh_performance_count7_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROFILE_DN_CONTROL" */ +/* Profile Counter Down Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_profile_dn_control_u { + mmr_t sh_profile_dn_control_regval; + struct { + mmr_t stimulus : 5; + mmr_t event : 1; + mmr_t polarity : 1; + mmr_t mode : 1; + mmr_t reserved_0 : 56; + } sh_profile_dn_control_s; +} sh_profile_dn_control_u_t; +#else +typedef union sh_profile_dn_control_u { + mmr_t sh_profile_dn_control_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t mode : 1; + mmr_t polarity : 1; + mmr_t event : 1; + mmr_t stimulus : 5; + } sh_profile_dn_control_s; +} sh_profile_dn_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROFILE_PEAK_CONTROL" */ +/* Profile Counter Peak Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_profile_peak_control_u { + mmr_t sh_profile_peak_control_regval; + struct { + mmr_t reserved_0 : 3; + mmr_t stimulus : 1; + mmr_t reserved_1 : 1; + mmr_t event : 1; + mmr_t polarity : 1; + mmr_t reserved_2 : 57; + } sh_profile_peak_control_s; +} sh_profile_peak_control_u_t; +#else +typedef union sh_profile_peak_control_u { + mmr_t sh_profile_peak_control_regval; + struct { + mmr_t reserved_2 : 57; + mmr_t polarity : 1; + mmr_t event : 1; + mmr_t reserved_1 : 1; + mmr_t stimulus : 1; + mmr_t reserved_0 : 3; + } sh_profile_peak_control_s; +} sh_profile_peak_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROFILE_RANGE" */ +/* Profile Counter Range */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_profile_range_u { + mmr_t sh_profile_range_regval; + struct { + mmr_t range0 : 8; + mmr_t range1 : 8; + mmr_t range2 : 8; + mmr_t range3 : 8; + mmr_t range4 : 8; + mmr_t range5 : 8; + mmr_t range6 : 8; + mmr_t range7 : 8; + } sh_profile_range_s; +} sh_profile_range_u_t; +#else +typedef union sh_profile_range_u { + mmr_t sh_profile_range_regval; + struct { + mmr_t range7 : 8; + mmr_t range6 : 8; + mmr_t range5 : 8; + mmr_t range4 : 8; + mmr_t range3 : 8; + mmr_t range2 : 8; + mmr_t range1 : 8; + mmr_t range0 : 8; + } sh_profile_range_s; +} sh_profile_range_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROFILE_UP_CONTROL" */ +/* Profile Counter Up Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_profile_up_control_u { + mmr_t sh_profile_up_control_regval; + struct { + mmr_t stimulus : 5; + mmr_t event : 1; + mmr_t polarity : 1; + mmr_t mode : 1; + mmr_t reserved_0 : 56; + } sh_profile_up_control_s; +} sh_profile_up_control_u_t; +#else +typedef union sh_profile_up_control_u { + mmr_t sh_profile_up_control_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t mode : 1; + mmr_t polarity : 1; + mmr_t event : 1; + mmr_t stimulus : 5; + } sh_profile_up_control_s; +} sh_profile_up_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER0" */ +/* Performance Counter 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_counter0_u { + mmr_t sh_performance_counter0_regval; + struct { + mmr_t count : 32; + mmr_t reserved_0 : 32; + } sh_performance_counter0_s; +} sh_performance_counter0_u_t; +#else +typedef union sh_performance_counter0_u { + mmr_t sh_performance_counter0_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t count : 32; + } sh_performance_counter0_s; +} sh_performance_counter0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER1" */ +/* Performance Counter 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_counter1_u { + mmr_t sh_performance_counter1_regval; + struct { + mmr_t count : 32; + mmr_t reserved_0 : 32; + } sh_performance_counter1_s; +} sh_performance_counter1_u_t; +#else +typedef union sh_performance_counter1_u { + mmr_t sh_performance_counter1_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t count : 32; + } sh_performance_counter1_s; +} sh_performance_counter1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER2" */ +/* Performance Counter 2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_counter2_u { + mmr_t sh_performance_counter2_regval; + struct { + mmr_t count : 32; + mmr_t reserved_0 : 32; + } sh_performance_counter2_s; +} sh_performance_counter2_u_t; +#else +typedef union sh_performance_counter2_u { + mmr_t sh_performance_counter2_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t count : 32; + } sh_performance_counter2_s; +} sh_performance_counter2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER3" */ +/* Performance Counter 3 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_counter3_u { + mmr_t sh_performance_counter3_regval; + struct { + mmr_t count : 32; + mmr_t reserved_0 : 32; + } sh_performance_counter3_s; +} sh_performance_counter3_u_t; +#else +typedef union sh_performance_counter3_u { + mmr_t sh_performance_counter3_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t count : 32; + } sh_performance_counter3_s; +} sh_performance_counter3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER4" */ +/* Performance Counter 4 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_counter4_u { + mmr_t sh_performance_counter4_regval; + struct { + mmr_t count : 32; + mmr_t reserved_0 : 32; + } sh_performance_counter4_s; +} sh_performance_counter4_u_t; +#else +typedef union sh_performance_counter4_u { + mmr_t sh_performance_counter4_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t count : 32; + } sh_performance_counter4_s; +} sh_performance_counter4_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER5" */ +/* Performance Counter 5 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_counter5_u { + mmr_t sh_performance_counter5_regval; + struct { + mmr_t count : 32; + mmr_t reserved_0 : 32; + } sh_performance_counter5_s; +} sh_performance_counter5_u_t; +#else +typedef union sh_performance_counter5_u { + mmr_t sh_performance_counter5_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t count : 32; + } sh_performance_counter5_s; +} sh_performance_counter5_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER6" */ +/* Performance Counter 6 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_counter6_u { + mmr_t sh_performance_counter6_regval; + struct { + mmr_t count : 32; + mmr_t reserved_0 : 32; + } sh_performance_counter6_s; +} sh_performance_counter6_u_t; +#else +typedef union sh_performance_counter6_u { + mmr_t sh_performance_counter6_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t count : 32; + } sh_performance_counter6_s; +} sh_performance_counter6_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PERFORMANCE_COUNTER7" */ +/* Performance Counter 7 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_performance_counter7_u { + mmr_t sh_performance_counter7_regval; + struct { + mmr_t count : 32; + mmr_t reserved_0 : 32; + } sh_performance_counter7_s; +} sh_performance_counter7_u_t; +#else +typedef union sh_performance_counter7_u { + mmr_t sh_performance_counter7_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t count : 32; + } sh_performance_counter7_s; +} sh_performance_counter7_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROFILE_COUNTER" */ +/* Profile Counter */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_profile_counter_u { + mmr_t sh_profile_counter_regval; + struct { + mmr_t counter : 8; + mmr_t reserved_0 : 56; + } sh_profile_counter_s; +} sh_profile_counter_u_t; +#else +typedef union sh_profile_counter_u { + mmr_t sh_profile_counter_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t counter : 8; + } sh_profile_counter_s; +} sh_profile_counter_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PROFILE_PEAK" */ +/* Profile Peak Counter */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_profile_peak_u { + mmr_t sh_profile_peak_regval; + struct { + mmr_t counter : 8; + mmr_t reserved_0 : 56; + } sh_profile_peak_s; +} sh_profile_peak_u_t; +#else +typedef union sh_profile_peak_u { + mmr_t sh_profile_peak_regval; + struct { + mmr_t reserved_0 : 56; + mmr_t counter : 8; + } sh_profile_peak_s; +} sh_profile_peak_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PTC_0" */ +/* Puge Translation Cache Message Configuration Information */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ptc_0_u { + mmr_t sh_ptc_0_regval; + struct { + mmr_t a : 1; + mmr_t reserved_0 : 1; + mmr_t ps : 6; + mmr_t rid : 24; + mmr_t reserved_1 : 31; + mmr_t start : 1; + } sh_ptc_0_s; +} sh_ptc_0_u_t; +#else +typedef union sh_ptc_0_u { + mmr_t sh_ptc_0_regval; + struct { + mmr_t start : 1; + mmr_t reserved_1 : 31; + mmr_t rid : 24; + mmr_t ps : 6; + mmr_t reserved_0 : 1; + mmr_t a : 1; + } sh_ptc_0_s; +} sh_ptc_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PTC_1" */ +/* Puge Translation Cache Message Configuration Information */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ptc_1_u { + mmr_t sh_ptc_1_regval; + struct { + mmr_t reserved_0 : 12; + mmr_t vpn : 49; + mmr_t reserved_1 : 2; + mmr_t start : 1; + } sh_ptc_1_s; +} sh_ptc_1_u_t; +#else +typedef union sh_ptc_1_u { + mmr_t sh_ptc_1_regval; + struct { + mmr_t start : 1; + mmr_t reserved_1 : 2; + mmr_t vpn : 49; + mmr_t reserved_0 : 12; + } sh_ptc_1_s; +} sh_ptc_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PTC_PARMS" */ +/* PTC Time-out parmaeters */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_ptc_parms_u { + mmr_t sh_ptc_parms_regval; + struct { + mmr_t ptc_to_wrap : 24; + mmr_t ptc_to_val : 12; + mmr_t reserved_0 : 28; + } sh_ptc_parms_s; +} sh_ptc_parms_u_t; +#else +typedef union sh_ptc_parms_u { + mmr_t sh_ptc_parms_regval; + struct { + mmr_t reserved_0 : 28; + mmr_t ptc_to_val : 12; + mmr_t ptc_to_wrap : 24; + } sh_ptc_parms_s; +} sh_ptc_parms_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_INT_CMPA" */ +/* RTC Compare Value for Processor A */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_int_cmpa_u { + mmr_t sh_int_cmpa_regval; + struct { + mmr_t real_time_cmpa : 55; + mmr_t reserved_0 : 9; + } sh_int_cmpa_s; +} sh_int_cmpa_u_t; +#else +typedef union sh_int_cmpa_u { + mmr_t sh_int_cmpa_regval; + struct { + mmr_t reserved_0 : 9; + mmr_t real_time_cmpa : 55; + } sh_int_cmpa_s; +} sh_int_cmpa_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_INT_CMPB" */ +/* RTC Compare Value for Processor B */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_int_cmpb_u { + mmr_t sh_int_cmpb_regval; + struct { + mmr_t real_time_cmpb : 55; + mmr_t reserved_0 : 9; + } sh_int_cmpb_s; +} sh_int_cmpb_u_t; +#else +typedef union sh_int_cmpb_u { + mmr_t sh_int_cmpb_regval; + struct { + mmr_t reserved_0 : 9; + mmr_t real_time_cmpb : 55; + } sh_int_cmpb_s; +} sh_int_cmpb_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_INT_CMPC" */ +/* RTC Compare Value for Processor C */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_int_cmpc_u { + mmr_t sh_int_cmpc_regval; + struct { + mmr_t real_time_cmpc : 55; + mmr_t reserved_0 : 9; + } sh_int_cmpc_s; +} sh_int_cmpc_u_t; +#else +typedef union sh_int_cmpc_u { + mmr_t sh_int_cmpc_regval; + struct { + mmr_t reserved_0 : 9; + mmr_t real_time_cmpc : 55; + } sh_int_cmpc_s; +} sh_int_cmpc_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_INT_CMPD" */ +/* RTC Compare Value for Processor D */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_int_cmpd_u { + mmr_t sh_int_cmpd_regval; + struct { + mmr_t real_time_cmpd : 55; + mmr_t reserved_0 : 9; + } sh_int_cmpd_s; +} sh_int_cmpd_u_t; +#else +typedef union sh_int_cmpd_u { + mmr_t sh_int_cmpd_regval; + struct { + mmr_t reserved_0 : 9; + mmr_t real_time_cmpd : 55; + } sh_int_cmpd_s; +} sh_int_cmpd_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_INT_PROF" */ +/* Profile Compare Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_int_prof_u { + mmr_t sh_int_prof_regval; + struct { + mmr_t profile_compare : 32; + mmr_t reserved_0 : 32; + } sh_int_prof_s; +} sh_int_prof_u_t; +#else +typedef union sh_int_prof_u { + mmr_t sh_int_prof_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t profile_compare : 32; + } sh_int_prof_s; +} sh_int_prof_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_RTC" */ +/* Real-time Clock */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_rtc_u { + mmr_t sh_rtc_regval; + struct { + mmr_t real_time_clock : 55; + mmr_t reserved_0 : 9; + } sh_rtc_s; +} sh_rtc_u_t; +#else +typedef union sh_rtc_u { + mmr_t sh_rtc_regval; + struct { + mmr_t reserved_0 : 9; + mmr_t real_time_clock : 55; + } sh_rtc_s; +} sh_rtc_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_SCRATCH0" */ +/* Scratch Register 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_scratch0_u { + mmr_t sh_scratch0_regval; + struct { + mmr_t scratch0 : 64; + } sh_scratch0_s; +} sh_scratch0_u_t; +#else +typedef union sh_scratch0_u { + mmr_t sh_scratch0_regval; + struct { + mmr_t scratch0 : 64; + } sh_scratch0_s; +} sh_scratch0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_SCRATCH1" */ +/* Scratch Register 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_scratch1_u { + mmr_t sh_scratch1_regval; + struct { + mmr_t scratch1 : 64; + } sh_scratch1_s; +} sh_scratch1_u_t; +#else +typedef union sh_scratch1_u { + mmr_t sh_scratch1_regval; + struct { + mmr_t scratch1 : 64; + } sh_scratch1_s; +} sh_scratch1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_SCRATCH2" */ +/* Scratch Register 2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_scratch2_u { + mmr_t sh_scratch2_regval; + struct { + mmr_t scratch2 : 64; + } sh_scratch2_s; +} sh_scratch2_u_t; +#else +typedef union sh_scratch2_u { + mmr_t sh_scratch2_regval; + struct { + mmr_t scratch2 : 64; + } sh_scratch2_s; +} sh_scratch2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_SCRATCH3" */ +/* Scratch Register 3 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_scratch3_u { + mmr_t sh_scratch3_regval; + struct { + mmr_t scratch3 : 1; + mmr_t reserved_0 : 63; + } sh_scratch3_s; +} sh_scratch3_u_t; +#else +typedef union sh_scratch3_u { + mmr_t sh_scratch3_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t scratch3 : 1; + } sh_scratch3_s; +} sh_scratch3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_SCRATCH4" */ +/* Scratch Register 4 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_scratch4_u { + mmr_t sh_scratch4_regval; + struct { + mmr_t scratch4 : 1; + mmr_t reserved_0 : 63; + } sh_scratch4_s; +} sh_scratch4_u_t; +#else +typedef union sh_scratch4_u { + mmr_t sh_scratch4_regval; + struct { + mmr_t reserved_0 : 63; + mmr_t scratch4 : 1; + } sh_scratch4_s; +} sh_scratch4_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_CRB_MESSAGE_CONTROL" */ +/* Coherent Request Buffer Message Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_crb_message_control_u { + mmr_t sh_crb_message_control_regval; + struct { + mmr_t system_coherence_enable : 1; + mmr_t local_speculative_message_enable : 1; + mmr_t remote_speculative_message_enable : 1; + mmr_t message_color : 1; + mmr_t message_color_enable : 1; + mmr_t rrb_attribute_mismatch_fsb_enable : 1; + mmr_t wrb_attribute_mismatch_fsb_enable : 1; + mmr_t irb_attribute_mismatch_fsb_enable : 1; + mmr_t rrb_attribute_mismatch_xb_enable : 1; + mmr_t wrb_attribute_mismatch_xb_enable : 1; + mmr_t suppress_bogus_writes : 1; + mmr_t enable_ivack_consolidation : 1; + mmr_t reserved_0 : 20; + mmr_t ivack_stall_count : 16; + mmr_t ivack_throttle_control : 16; + } sh_crb_message_control_s; +} sh_crb_message_control_u_t; +#else +typedef union sh_crb_message_control_u { + mmr_t sh_crb_message_control_regval; + struct { + mmr_t ivack_throttle_control : 16; + mmr_t ivack_stall_count : 16; + mmr_t reserved_0 : 20; + mmr_t enable_ivack_consolidation : 1; + mmr_t suppress_bogus_writes : 1; + mmr_t wrb_attribute_mismatch_xb_enable : 1; + mmr_t rrb_attribute_mismatch_xb_enable : 1; + mmr_t irb_attribute_mismatch_fsb_enable : 1; + mmr_t wrb_attribute_mismatch_fsb_enable : 1; + mmr_t rrb_attribute_mismatch_fsb_enable : 1; + mmr_t message_color_enable : 1; + mmr_t message_color : 1; + mmr_t remote_speculative_message_enable : 1; + mmr_t local_speculative_message_enable : 1; + mmr_t system_coherence_enable : 1; + } sh_crb_message_control_s; +} sh_crb_message_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_CRB_NACK_LIMIT" */ +/* CRB Nack Limit */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_crb_nack_limit_u { + mmr_t sh_crb_nack_limit_regval; + struct { + mmr_t limit : 12; + mmr_t pri_freq : 4; + mmr_t reserved_0 : 47; + mmr_t enable : 1; + } sh_crb_nack_limit_s; +} sh_crb_nack_limit_u_t; +#else +typedef union sh_crb_nack_limit_u { + mmr_t sh_crb_nack_limit_regval; + struct { + mmr_t enable : 1; + mmr_t reserved_0 : 47; + mmr_t pri_freq : 4; + mmr_t limit : 12; + } sh_crb_nack_limit_s; +} sh_crb_nack_limit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_CRB_TIMEOUT_PRESCALE" */ +/* Coherent Request Buffer Timeout Prescale */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_crb_timeout_prescale_u { + mmr_t sh_crb_timeout_prescale_regval; + struct { + mmr_t scaling_factor : 32; + mmr_t reserved_0 : 32; + } sh_crb_timeout_prescale_s; +} sh_crb_timeout_prescale_u_t; +#else +typedef union sh_crb_timeout_prescale_u { + mmr_t sh_crb_timeout_prescale_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t scaling_factor : 32; + } sh_crb_timeout_prescale_s; +} sh_crb_timeout_prescale_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_CRB_TIMEOUT_SKID" */ +/* Coherent Request Buffer Timeout Skid Limit */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_crb_timeout_skid_u { + mmr_t sh_crb_timeout_skid_regval; + struct { + mmr_t skid : 6; + mmr_t reserved_0 : 57; + mmr_t reset_skid_count : 1; + } sh_crb_timeout_skid_s; +} sh_crb_timeout_skid_u_t; +#else +typedef union sh_crb_timeout_skid_u { + mmr_t sh_crb_timeout_skid_regval; + struct { + mmr_t reset_skid_count : 1; + mmr_t reserved_0 : 57; + mmr_t skid : 6; + } sh_crb_timeout_skid_s; +} sh_crb_timeout_skid_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MEMORY_WRITE_STATUS_0" */ +/* Memory Write Status for CPU 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_memory_write_status_0_u { + mmr_t sh_memory_write_status_0_regval; + struct { + mmr_t pending_write_count : 6; + mmr_t reserved_0 : 58; + } sh_memory_write_status_0_s; +} sh_memory_write_status_0_u_t; +#else +typedef union sh_memory_write_status_0_u { + mmr_t sh_memory_write_status_0_regval; + struct { + mmr_t reserved_0 : 58; + mmr_t pending_write_count : 6; + } sh_memory_write_status_0_s; +} sh_memory_write_status_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MEMORY_WRITE_STATUS_1" */ +/* Memory Write Status for CPU 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_memory_write_status_1_u { + mmr_t sh_memory_write_status_1_regval; + struct { + mmr_t pending_write_count : 6; + mmr_t reserved_0 : 58; + } sh_memory_write_status_1_s; +} sh_memory_write_status_1_u_t; +#else +typedef union sh_memory_write_status_1_u { + mmr_t sh_memory_write_status_1_regval; + struct { + mmr_t reserved_0 : 58; + mmr_t pending_write_count : 6; + } sh_memory_write_status_1_s; +} sh_memory_write_status_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PIO_WRITE_STATUS_0" */ +/* PIO Write Status for CPU 0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pio_write_status_0_u { + mmr_t sh_pio_write_status_0_regval; + struct { + mmr_t multi_write_error : 1; + mmr_t write_deadlock : 1; + mmr_t write_error : 1; + mmr_t write_error_address : 47; + mmr_t reserved_0 : 6; + mmr_t pending_write_count : 6; + mmr_t reserved_1 : 1; + mmr_t writes_ok : 1; + } sh_pio_write_status_0_s; +} sh_pio_write_status_0_u_t; +#else +typedef union sh_pio_write_status_0_u { + mmr_t sh_pio_write_status_0_regval; + struct { + mmr_t writes_ok : 1; + mmr_t reserved_1 : 1; + mmr_t pending_write_count : 6; + mmr_t reserved_0 : 6; + mmr_t write_error_address : 47; + mmr_t write_error : 1; + mmr_t write_deadlock : 1; + mmr_t multi_write_error : 1; + } sh_pio_write_status_0_s; +} sh_pio_write_status_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PIO_WRITE_STATUS_1" */ +/* PIO Write Status for CPU 1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pio_write_status_1_u { + mmr_t sh_pio_write_status_1_regval; + struct { + mmr_t multi_write_error : 1; + mmr_t write_deadlock : 1; + mmr_t write_error : 1; + mmr_t write_error_address : 47; + mmr_t reserved_0 : 6; + mmr_t pending_write_count : 6; + mmr_t reserved_1 : 1; + mmr_t writes_ok : 1; + } sh_pio_write_status_1_s; +} sh_pio_write_status_1_u_t; +#else +typedef union sh_pio_write_status_1_u { + mmr_t sh_pio_write_status_1_regval; + struct { + mmr_t writes_ok : 1; + mmr_t reserved_1 : 1; + mmr_t pending_write_count : 6; + mmr_t reserved_0 : 6; + mmr_t write_error_address : 47; + mmr_t write_error : 1; + mmr_t write_deadlock : 1; + mmr_t multi_write_error : 1; + } sh_pio_write_status_1_s; +} sh_pio_write_status_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MEMORY_WRITE_STATUS_NON_USER_0" */ +/* Memory Write Status for CPU 0. OS access only */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_memory_write_status_non_user_0_u { + mmr_t sh_memory_write_status_non_user_0_regval; + struct { + mmr_t pending_write_count : 6; + mmr_t reserved_0 : 57; + mmr_t clear : 1; + } sh_memory_write_status_non_user_0_s; +} sh_memory_write_status_non_user_0_u_t; +#else +typedef union sh_memory_write_status_non_user_0_u { + mmr_t sh_memory_write_status_non_user_0_regval; + struct { + mmr_t clear : 1; + mmr_t reserved_0 : 57; + mmr_t pending_write_count : 6; + } sh_memory_write_status_non_user_0_s; +} sh_memory_write_status_non_user_0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MEMORY_WRITE_STATUS_NON_USER_1" */ +/* Memory Write Status for CPU 1. OS access only */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_memory_write_status_non_user_1_u { + mmr_t sh_memory_write_status_non_user_1_regval; + struct { + mmr_t pending_write_count : 6; + mmr_t reserved_0 : 57; + mmr_t clear : 1; + } sh_memory_write_status_non_user_1_s; +} sh_memory_write_status_non_user_1_u_t; +#else +typedef union sh_memory_write_status_non_user_1_u { + mmr_t sh_memory_write_status_non_user_1_regval; + struct { + mmr_t clear : 1; + mmr_t reserved_0 : 57; + mmr_t pending_write_count : 6; + } sh_memory_write_status_non_user_1_s; +} sh_memory_write_status_non_user_1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MMRBIST_ERR" */ +/* Error capture for bist read errors */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_mmrbist_err_u { + mmr_t sh_mmrbist_err_regval; + struct { + mmr_t addr : 33; + mmr_t reserved_0 : 3; + mmr_t detected : 1; + mmr_t multiple_detected : 1; + mmr_t cancelled : 1; + mmr_t reserved_1 : 25; + } sh_mmrbist_err_s; +} sh_mmrbist_err_u_t; +#else +typedef union sh_mmrbist_err_u { + mmr_t sh_mmrbist_err_regval; + struct { + mmr_t reserved_1 : 25; + mmr_t cancelled : 1; + mmr_t multiple_detected : 1; + mmr_t detected : 1; + mmr_t reserved_0 : 3; + mmr_t addr : 33; + } sh_mmrbist_err_s; +} sh_mmrbist_err_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MISC_ERR_HDR_LOWER" */ +/* Header capture register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_misc_err_hdr_lower_u { + mmr_t sh_misc_err_hdr_lower_regval; + struct { + mmr_t reserved_0 : 3; + mmr_t addr : 33; + mmr_t cmd : 8; + mmr_t src : 14; + mmr_t reserved_1 : 2; + mmr_t write : 1; + mmr_t reserved_2 : 2; + mmr_t valid : 1; + } sh_misc_err_hdr_lower_s; +} sh_misc_err_hdr_lower_u_t; +#else +typedef union sh_misc_err_hdr_lower_u { + mmr_t sh_misc_err_hdr_lower_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_2 : 2; + mmr_t write : 1; + mmr_t reserved_1 : 2; + mmr_t src : 14; + mmr_t cmd : 8; + mmr_t addr : 33; + mmr_t reserved_0 : 3; + } sh_misc_err_hdr_lower_s; +} sh_misc_err_hdr_lower_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MISC_ERR_HDR_UPPER" */ +/* Error header capture packet and protocol errors */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_misc_err_hdr_upper_u { + mmr_t sh_misc_err_hdr_upper_regval; + struct { + mmr_t dir_protocol : 1; + mmr_t illegal_cmd : 1; + mmr_t nonexist_addr : 1; + mmr_t rmw_uc : 1; + mmr_t rmw_cor : 1; + mmr_t dir_acc : 1; + mmr_t pi_pkt_size : 1; + mmr_t xn_pkt_size : 1; + mmr_t reserved_0 : 12; + mmr_t echo : 9; + mmr_t reserved_1 : 35; + } sh_misc_err_hdr_upper_s; +} sh_misc_err_hdr_upper_u_t; +#else +typedef union sh_misc_err_hdr_upper_u { + mmr_t sh_misc_err_hdr_upper_regval; + struct { + mmr_t reserved_1 : 35; + mmr_t echo : 9; + mmr_t reserved_0 : 12; + mmr_t xn_pkt_size : 1; + mmr_t pi_pkt_size : 1; + mmr_t dir_acc : 1; + mmr_t rmw_cor : 1; + mmr_t rmw_uc : 1; + mmr_t nonexist_addr : 1; + mmr_t illegal_cmd : 1; + mmr_t dir_protocol : 1; + } sh_misc_err_hdr_upper_s; +} sh_misc_err_hdr_upper_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIR_UC_ERR_HDR_LOWER" */ +/* Header capture register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_dir_uc_err_hdr_lower_u { + mmr_t sh_dir_uc_err_hdr_lower_regval; + struct { + mmr_t reserved_0 : 3; + mmr_t addr : 33; + mmr_t cmd : 8; + mmr_t src : 14; + mmr_t reserved_1 : 2; + mmr_t write : 1; + mmr_t reserved_2 : 2; + mmr_t valid : 1; + } sh_dir_uc_err_hdr_lower_s; +} sh_dir_uc_err_hdr_lower_u_t; +#else +typedef union sh_dir_uc_err_hdr_lower_u { + mmr_t sh_dir_uc_err_hdr_lower_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_2 : 2; + mmr_t write : 1; + mmr_t reserved_1 : 2; + mmr_t src : 14; + mmr_t cmd : 8; + mmr_t addr : 33; + mmr_t reserved_0 : 3; + } sh_dir_uc_err_hdr_lower_s; +} sh_dir_uc_err_hdr_lower_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIR_UC_ERR_HDR_UPPER" */ +/* Error header capture packet and protocol errors */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_dir_uc_err_hdr_upper_u { + mmr_t sh_dir_uc_err_hdr_upper_regval; + struct { + mmr_t reserved_0 : 3; + mmr_t dir_uc : 1; + mmr_t reserved_1 : 16; + mmr_t echo : 9; + mmr_t reserved_2 : 35; + } sh_dir_uc_err_hdr_upper_s; +} sh_dir_uc_err_hdr_upper_u_t; +#else +typedef union sh_dir_uc_err_hdr_upper_u { + mmr_t sh_dir_uc_err_hdr_upper_regval; + struct { + mmr_t reserved_2 : 35; + mmr_t echo : 9; + mmr_t reserved_1 : 16; + mmr_t dir_uc : 1; + mmr_t reserved_0 : 3; + } sh_dir_uc_err_hdr_upper_s; +} sh_dir_uc_err_hdr_upper_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIR_COR_ERR_HDR_LOWER" */ +/* Header capture register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_dir_cor_err_hdr_lower_u { + mmr_t sh_dir_cor_err_hdr_lower_regval; + struct { + mmr_t reserved_0 : 3; + mmr_t addr : 33; + mmr_t cmd : 8; + mmr_t src : 14; + mmr_t reserved_1 : 2; + mmr_t write : 1; + mmr_t reserved_2 : 2; + mmr_t valid : 1; + } sh_dir_cor_err_hdr_lower_s; +} sh_dir_cor_err_hdr_lower_u_t; +#else +typedef union sh_dir_cor_err_hdr_lower_u { + mmr_t sh_dir_cor_err_hdr_lower_regval; + struct { + mmr_t valid : 1; + mmr_t reserved_2 : 2; + mmr_t write : 1; + mmr_t reserved_1 : 2; + mmr_t src : 14; + mmr_t cmd : 8; + mmr_t addr : 33; + mmr_t reserved_0 : 3; + } sh_dir_cor_err_hdr_lower_s; +} sh_dir_cor_err_hdr_lower_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_DIR_COR_ERR_HDR_UPPER" */ +/* Error header capture packet and protocol errors */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_dir_cor_err_hdr_upper_u { + mmr_t sh_dir_cor_err_hdr_upper_regval; + struct { + mmr_t reserved_0 : 8; + mmr_t dir_cor : 1; + mmr_t reserved_1 : 11; + mmr_t echo : 9; + mmr_t reserved_2 : 35; + } sh_dir_cor_err_hdr_upper_s; +} sh_dir_cor_err_hdr_upper_u_t; +#else +typedef union sh_dir_cor_err_hdr_upper_u { + mmr_t sh_dir_cor_err_hdr_upper_regval; + struct { + mmr_t reserved_2 : 35; + mmr_t echo : 9; + mmr_t reserved_1 : 11; + mmr_t dir_cor : 1; + mmr_t reserved_0 : 8; + } sh_dir_cor_err_hdr_upper_s; +} sh_dir_cor_err_hdr_upper_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MEM_ERROR_SUMMARY" */ +/* Memory error flags */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_mem_error_summary_u { + mmr_t sh_mem_error_summary_regval; + struct { + mmr_t illegal_cmd : 1; + mmr_t nonexist_addr : 1; + mmr_t dqlp_dir_perr : 1; + mmr_t dqrp_dir_perr : 1; + mmr_t dqlp_dir_uc : 1; + mmr_t dqlp_dir_cor : 1; + mmr_t dqrp_dir_uc : 1; + mmr_t dqrp_dir_cor : 1; + mmr_t acx_int_hw : 1; + mmr_t acy_int_hw : 1; + mmr_t dir_acc : 1; + mmr_t reserved_0 : 1; + mmr_t dqlp_int_uc : 1; + mmr_t dqlp_int_cor : 1; + mmr_t dqlp_int_hw : 1; + mmr_t reserved_1 : 1; + mmr_t dqls_int_uc : 1; + mmr_t dqls_int_cor : 1; + mmr_t dqls_int_hw : 1; + mmr_t reserved_2 : 1; + mmr_t dqrp_int_uc : 1; + mmr_t dqrp_int_cor : 1; + mmr_t dqrp_int_hw : 1; + mmr_t reserved_3 : 1; + mmr_t dqrs_int_uc : 1; + mmr_t dqrs_int_cor : 1; + mmr_t dqrs_int_hw : 1; + mmr_t reserved_4 : 1; + mmr_t pi_reply_overflow : 1; + mmr_t xn_reply_overflow : 1; + mmr_t pi_request_overflow : 1; + mmr_t xn_request_overflow : 1; + mmr_t red_black_err_timeout : 1; + mmr_t pi_pkt_size : 1; + mmr_t xn_pkt_size : 1; + mmr_t reserved_5 : 29; + } sh_mem_error_summary_s; +} sh_mem_error_summary_u_t; +#else +typedef union sh_mem_error_summary_u { + mmr_t sh_mem_error_summary_regval; + struct { + mmr_t reserved_5 : 29; + mmr_t xn_pkt_size : 1; + mmr_t pi_pkt_size : 1; + mmr_t red_black_err_timeout : 1; + mmr_t xn_request_overflow : 1; + mmr_t pi_request_overflow : 1; + mmr_t xn_reply_overflow : 1; + mmr_t pi_reply_overflow : 1; + mmr_t reserved_4 : 1; + mmr_t dqrs_int_hw : 1; + mmr_t dqrs_int_cor : 1; + mmr_t dqrs_int_uc : 1; + mmr_t reserved_3 : 1; + mmr_t dqrp_int_hw : 1; + mmr_t dqrp_int_cor : 1; + mmr_t dqrp_int_uc : 1; + mmr_t reserved_2 : 1; + mmr_t dqls_int_hw : 1; + mmr_t dqls_int_cor : 1; + mmr_t dqls_int_uc : 1; + mmr_t reserved_1 : 1; + mmr_t dqlp_int_hw : 1; + mmr_t dqlp_int_cor : 1; + mmr_t dqlp_int_uc : 1; + mmr_t reserved_0 : 1; + mmr_t dir_acc : 1; + mmr_t acy_int_hw : 1; + mmr_t acx_int_hw : 1; + mmr_t dqrp_dir_cor : 1; + mmr_t dqrp_dir_uc : 1; + mmr_t dqlp_dir_cor : 1; + mmr_t dqlp_dir_uc : 1; + mmr_t dqrp_dir_perr : 1; + mmr_t dqlp_dir_perr : 1; + mmr_t nonexist_addr : 1; + mmr_t illegal_cmd : 1; + } sh_mem_error_summary_s; +} sh_mem_error_summary_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MEM_ERROR_OVERFLOW" */ +/* Memory error flags */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_mem_error_overflow_u { + mmr_t sh_mem_error_overflow_regval; + struct { + mmr_t illegal_cmd : 1; + mmr_t nonexist_addr : 1; + mmr_t dqlp_dir_perr : 1; + mmr_t dqrp_dir_perr : 1; + mmr_t dqlp_dir_uc : 1; + mmr_t dqlp_dir_cor : 1; + mmr_t dqrp_dir_uc : 1; + mmr_t dqrp_dir_cor : 1; + mmr_t acx_int_hw : 1; + mmr_t acy_int_hw : 1; + mmr_t dir_acc : 1; + mmr_t reserved_0 : 1; + mmr_t dqlp_int_uc : 1; + mmr_t dqlp_int_cor : 1; + mmr_t dqlp_int_hw : 1; + mmr_t reserved_1 : 1; + mmr_t dqls_int_uc : 1; + mmr_t dqls_int_cor : 1; + mmr_t dqls_int_hw : 1; + mmr_t reserved_2 : 1; + mmr_t dqrp_int_uc : 1; + mmr_t dqrp_int_cor : 1; + mmr_t dqrp_int_hw : 1; + mmr_t reserved_3 : 1; + mmr_t dqrs_int_uc : 1; + mmr_t dqrs_int_cor : 1; + mmr_t dqrs_int_hw : 1; + mmr_t reserved_4 : 1; + mmr_t pi_reply_overflow : 1; + mmr_t xn_reply_overflow : 1; + mmr_t pi_request_overflow : 1; + mmr_t xn_request_overflow : 1; + mmr_t red_black_err_timeout : 1; + mmr_t pi_pkt_size : 1; + mmr_t xn_pkt_size : 1; + mmr_t reserved_5 : 29; + } sh_mem_error_overflow_s; +} sh_mem_error_overflow_u_t; +#else +typedef union sh_mem_error_overflow_u { + mmr_t sh_mem_error_overflow_regval; + struct { + mmr_t reserved_5 : 29; + mmr_t xn_pkt_size : 1; + mmr_t pi_pkt_size : 1; + mmr_t red_black_err_timeout : 1; + mmr_t xn_request_overflow : 1; + mmr_t pi_request_overflow : 1; + mmr_t xn_reply_overflow : 1; + mmr_t pi_reply_overflow : 1; + mmr_t reserved_4 : 1; + mmr_t dqrs_int_hw : 1; + mmr_t dqrs_int_cor : 1; + mmr_t dqrs_int_uc : 1; + mmr_t reserved_3 : 1; + mmr_t dqrp_int_hw : 1; + mmr_t dqrp_int_cor : 1; + mmr_t dqrp_int_uc : 1; + mmr_t reserved_2 : 1; + mmr_t dqls_int_hw : 1; + mmr_t dqls_int_cor : 1; + mmr_t dqls_int_uc : 1; + mmr_t reserved_1 : 1; + mmr_t dqlp_int_hw : 1; + mmr_t dqlp_int_cor : 1; + mmr_t dqlp_int_uc : 1; + mmr_t reserved_0 : 1; + mmr_t dir_acc : 1; + mmr_t acy_int_hw : 1; + mmr_t acx_int_hw : 1; + mmr_t dqrp_dir_cor : 1; + mmr_t dqrp_dir_uc : 1; + mmr_t dqlp_dir_cor : 1; + mmr_t dqlp_dir_uc : 1; + mmr_t dqrp_dir_perr : 1; + mmr_t dqlp_dir_perr : 1; + mmr_t nonexist_addr : 1; + mmr_t illegal_cmd : 1; + } sh_mem_error_overflow_s; +} sh_mem_error_overflow_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MEM_ERROR_MASK" */ +/* Memory error flags */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_mem_error_mask_u { + mmr_t sh_mem_error_mask_regval; + struct { + mmr_t illegal_cmd : 1; + mmr_t nonexist_addr : 1; + mmr_t dqlp_dir_perr : 1; + mmr_t dqrp_dir_perr : 1; + mmr_t dqlp_dir_uc : 1; + mmr_t dqlp_dir_cor : 1; + mmr_t dqrp_dir_uc : 1; + mmr_t dqrp_dir_cor : 1; + mmr_t acx_int_hw : 1; + mmr_t acy_int_hw : 1; + mmr_t dir_acc : 1; + mmr_t reserved_0 : 1; + mmr_t dqlp_int_uc : 1; + mmr_t dqlp_int_cor : 1; + mmr_t dqlp_int_hw : 1; + mmr_t reserved_1 : 1; + mmr_t dqls_int_uc : 1; + mmr_t dqls_int_cor : 1; + mmr_t dqls_int_hw : 1; + mmr_t reserved_2 : 1; + mmr_t dqrp_int_uc : 1; + mmr_t dqrp_int_cor : 1; + mmr_t dqrp_int_hw : 1; + mmr_t reserved_3 : 1; + mmr_t dqrs_int_uc : 1; + mmr_t dqrs_int_cor : 1; + mmr_t dqrs_int_hw : 1; + mmr_t reserved_4 : 1; + mmr_t pi_reply_overflow : 1; + mmr_t xn_reply_overflow : 1; + mmr_t pi_request_overflow : 1; + mmr_t xn_request_overflow : 1; + mmr_t red_black_err_timeout : 1; + mmr_t pi_pkt_size : 1; + mmr_t xn_pkt_size : 1; + mmr_t reserved_5 : 29; + } sh_mem_error_mask_s; +} sh_mem_error_mask_u_t; +#else +typedef union sh_mem_error_mask_u { + mmr_t sh_mem_error_mask_regval; + struct { + mmr_t reserved_5 : 29; + mmr_t xn_pkt_size : 1; + mmr_t pi_pkt_size : 1; + mmr_t red_black_err_timeout : 1; + mmr_t xn_request_overflow : 1; + mmr_t pi_request_overflow : 1; + mmr_t xn_reply_overflow : 1; + mmr_t pi_reply_overflow : 1; + mmr_t reserved_4 : 1; + mmr_t dqrs_int_hw : 1; + mmr_t dqrs_int_cor : 1; + mmr_t dqrs_int_uc : 1; + mmr_t reserved_3 : 1; + mmr_t dqrp_int_hw : 1; + mmr_t dqrp_int_cor : 1; + mmr_t dqrp_int_uc : 1; + mmr_t reserved_2 : 1; + mmr_t dqls_int_hw : 1; + mmr_t dqls_int_cor : 1; + mmr_t dqls_int_uc : 1; + mmr_t reserved_1 : 1; + mmr_t dqlp_int_hw : 1; + mmr_t dqlp_int_cor : 1; + mmr_t dqlp_int_uc : 1; + mmr_t reserved_0 : 1; + mmr_t dir_acc : 1; + mmr_t acy_int_hw : 1; + mmr_t acx_int_hw : 1; + mmr_t dqrp_dir_cor : 1; + mmr_t dqrp_dir_uc : 1; + mmr_t dqlp_dir_cor : 1; + mmr_t dqlp_dir_uc : 1; + mmr_t dqrp_dir_perr : 1; + mmr_t dqlp_dir_perr : 1; + mmr_t nonexist_addr : 1; + mmr_t illegal_cmd : 1; + } sh_mem_error_mask_s; +} sh_mem_error_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_DIMM_CFG" */ +/* AC Mem Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_dimm_cfg_u { + mmr_t sh_x_dimm_cfg_regval; + struct { + mmr_t dimm0_size : 3; + mmr_t dimm0_2bk : 1; + mmr_t dimm0_rev : 1; + mmr_t dimm0_cs : 2; + mmr_t reserved_0 : 1; + mmr_t dimm1_size : 3; + mmr_t dimm1_2bk : 1; + mmr_t dimm1_rev : 1; + mmr_t dimm1_cs : 2; + mmr_t reserved_1 : 1; + mmr_t dimm2_size : 3; + mmr_t dimm2_2bk : 1; + mmr_t dimm2_rev : 1; + mmr_t dimm2_cs : 2; + mmr_t reserved_2 : 1; + mmr_t dimm3_size : 3; + mmr_t dimm3_2bk : 1; + mmr_t dimm3_rev : 1; + mmr_t dimm3_cs : 2; + mmr_t reserved_3 : 1; + mmr_t freq : 4; + mmr_t reserved_4 : 28; + } sh_x_dimm_cfg_s; +} sh_x_dimm_cfg_u_t; +#else +typedef union sh_x_dimm_cfg_u { + mmr_t sh_x_dimm_cfg_regval; + struct { + mmr_t reserved_4 : 28; + mmr_t freq : 4; + mmr_t reserved_3 : 1; + mmr_t dimm3_cs : 2; + mmr_t dimm3_rev : 1; + mmr_t dimm3_2bk : 1; + mmr_t dimm3_size : 3; + mmr_t reserved_2 : 1; + mmr_t dimm2_cs : 2; + mmr_t dimm2_rev : 1; + mmr_t dimm2_2bk : 1; + mmr_t dimm2_size : 3; + mmr_t reserved_1 : 1; + mmr_t dimm1_cs : 2; + mmr_t dimm1_rev : 1; + mmr_t dimm1_2bk : 1; + mmr_t dimm1_size : 3; + mmr_t reserved_0 : 1; + mmr_t dimm0_cs : 2; + mmr_t dimm0_rev : 1; + mmr_t dimm0_2bk : 1; + mmr_t dimm0_size : 3; + } sh_x_dimm_cfg_s; +} sh_x_dimm_cfg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_DIMM_CFG" */ +/* AC Mem Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_dimm_cfg_u { + mmr_t sh_y_dimm_cfg_regval; + struct { + mmr_t dimm0_size : 3; + mmr_t dimm0_2bk : 1; + mmr_t dimm0_rev : 1; + mmr_t dimm0_cs : 2; + mmr_t reserved_0 : 1; + mmr_t dimm1_size : 3; + mmr_t dimm1_2bk : 1; + mmr_t dimm1_rev : 1; + mmr_t dimm1_cs : 2; + mmr_t reserved_1 : 1; + mmr_t dimm2_size : 3; + mmr_t dimm2_2bk : 1; + mmr_t dimm2_rev : 1; + mmr_t dimm2_cs : 2; + mmr_t reserved_2 : 1; + mmr_t dimm3_size : 3; + mmr_t dimm3_2bk : 1; + mmr_t dimm3_rev : 1; + mmr_t dimm3_cs : 2; + mmr_t reserved_3 : 1; + mmr_t freq : 4; + mmr_t reserved_4 : 28; + } sh_y_dimm_cfg_s; +} sh_y_dimm_cfg_u_t; +#else +typedef union sh_y_dimm_cfg_u { + mmr_t sh_y_dimm_cfg_regval; + struct { + mmr_t reserved_4 : 28; + mmr_t freq : 4; + mmr_t reserved_3 : 1; + mmr_t dimm3_cs : 2; + mmr_t dimm3_rev : 1; + mmr_t dimm3_2bk : 1; + mmr_t dimm3_size : 3; + mmr_t reserved_2 : 1; + mmr_t dimm2_cs : 2; + mmr_t dimm2_rev : 1; + mmr_t dimm2_2bk : 1; + mmr_t dimm2_size : 3; + mmr_t reserved_1 : 1; + mmr_t dimm1_cs : 2; + mmr_t dimm1_rev : 1; + mmr_t dimm1_2bk : 1; + mmr_t dimm1_size : 3; + mmr_t reserved_0 : 1; + mmr_t dimm0_cs : 2; + mmr_t dimm0_rev : 1; + mmr_t dimm0_2bk : 1; + mmr_t dimm0_size : 3; + } sh_y_dimm_cfg_s; +} sh_y_dimm_cfg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_JNR_DIMM_CFG" */ +/* AC Mem Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_jnr_dimm_cfg_u { + mmr_t sh_jnr_dimm_cfg_regval; + struct { + mmr_t dimm0_size : 3; + mmr_t dimm0_2bk : 1; + mmr_t dimm0_rev : 1; + mmr_t dimm0_cs : 2; + mmr_t reserved_0 : 1; + mmr_t dimm1_size : 3; + mmr_t dimm1_2bk : 1; + mmr_t dimm1_rev : 1; + mmr_t dimm1_cs : 2; + mmr_t reserved_1 : 1; + mmr_t dimm2_size : 3; + mmr_t dimm2_2bk : 1; + mmr_t dimm2_rev : 1; + mmr_t dimm2_cs : 2; + mmr_t reserved_2 : 1; + mmr_t dimm3_size : 3; + mmr_t dimm3_2bk : 1; + mmr_t dimm3_rev : 1; + mmr_t dimm3_cs : 2; + mmr_t reserved_3 : 1; + mmr_t freq : 4; + mmr_t reserved_4 : 28; + } sh_jnr_dimm_cfg_s; +} sh_jnr_dimm_cfg_u_t; +#else +typedef union sh_jnr_dimm_cfg_u { + mmr_t sh_jnr_dimm_cfg_regval; + struct { + mmr_t reserved_4 : 28; + mmr_t freq : 4; + mmr_t reserved_3 : 1; + mmr_t dimm3_cs : 2; + mmr_t dimm3_rev : 1; + mmr_t dimm3_2bk : 1; + mmr_t dimm3_size : 3; + mmr_t reserved_2 : 1; + mmr_t dimm2_cs : 2; + mmr_t dimm2_rev : 1; + mmr_t dimm2_2bk : 1; + mmr_t dimm2_size : 3; + mmr_t reserved_1 : 1; + mmr_t dimm1_cs : 2; + mmr_t dimm1_rev : 1; + mmr_t dimm1_2bk : 1; + mmr_t dimm1_size : 3; + mmr_t reserved_0 : 1; + mmr_t dimm0_cs : 2; + mmr_t dimm0_rev : 1; + mmr_t dimm0_2bk : 1; + mmr_t dimm0_size : 3; + } sh_jnr_dimm_cfg_s; +} sh_jnr_dimm_cfg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_PHASE_CFG" */ +/* AC Phase Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_phase_cfg_u { + mmr_t sh_x_phase_cfg_regval; + struct { + mmr_t ld_a : 5; + mmr_t ld_b : 5; + mmr_t dq_ld_a : 5; + mmr_t dq_ld_b : 5; + mmr_t hold : 5; + mmr_t hold_req : 5; + mmr_t add_cp : 5; + mmr_t bubble_en : 5; + mmr_t pha_bubble : 3; + mmr_t phb_bubble : 3; + mmr_t phc_bubble : 3; + mmr_t phd_bubble : 3; + mmr_t phe_bubble : 3; + mmr_t sel_a : 4; + mmr_t dq_sel_a : 4; + mmr_t reserved_0 : 1; + } sh_x_phase_cfg_s; +} sh_x_phase_cfg_u_t; +#else +typedef union sh_x_phase_cfg_u { + mmr_t sh_x_phase_cfg_regval; + struct { + mmr_t reserved_0 : 1; + mmr_t dq_sel_a : 4; + mmr_t sel_a : 4; + mmr_t phe_bubble : 3; + mmr_t phd_bubble : 3; + mmr_t phc_bubble : 3; + mmr_t phb_bubble : 3; + mmr_t pha_bubble : 3; + mmr_t bubble_en : 5; + mmr_t add_cp : 5; + mmr_t hold_req : 5; + mmr_t hold : 5; + mmr_t dq_ld_b : 5; + mmr_t dq_ld_a : 5; + mmr_t ld_b : 5; + mmr_t ld_a : 5; + } sh_x_phase_cfg_s; +} sh_x_phase_cfg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_CFG" */ +/* AC Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_cfg_u { + mmr_t sh_x_cfg_regval; + struct { + mmr_t mode_serial : 1; + mmr_t dirc_random_replacement : 1; + mmr_t dir_counter_init : 6; + mmr_t ta_dlys : 32; + mmr_t da_bb_clr : 4; + mmr_t dc_bb_clr : 4; + mmr_t wt_bb_clr : 4; + mmr_t sso_wt_en : 1; + mmr_t trcd2_en : 1; + mmr_t trcd4_en : 1; + mmr_t req_cntr_dis : 1; + mmr_t req_cntr_val : 6; + mmr_t inv_cas_addr : 1; + mmr_t clr_dir_cache : 1; + } sh_x_cfg_s; +} sh_x_cfg_u_t; +#else +typedef union sh_x_cfg_u { + mmr_t sh_x_cfg_regval; + struct { + mmr_t clr_dir_cache : 1; + mmr_t inv_cas_addr : 1; + mmr_t req_cntr_val : 6; + mmr_t req_cntr_dis : 1; + mmr_t trcd4_en : 1; + mmr_t trcd2_en : 1; + mmr_t sso_wt_en : 1; + mmr_t wt_bb_clr : 4; + mmr_t dc_bb_clr : 4; + mmr_t da_bb_clr : 4; + mmr_t ta_dlys : 32; + mmr_t dir_counter_init : 6; + mmr_t dirc_random_replacement : 1; + mmr_t mode_serial : 1; + } sh_x_cfg_s; +} sh_x_cfg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_DQCT_CFG" */ +/* AC Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_dqct_cfg_u { + mmr_t sh_x_dqct_cfg_regval; + struct { + mmr_t rd_sel : 4; + mmr_t wt_sel : 4; + mmr_t dta_rd_sel : 4; + mmr_t dta_wt_sel : 4; + mmr_t dir_rd_sel : 4; + mmr_t mdir_rd_sel : 4; + mmr_t reserved_0 : 40; + } sh_x_dqct_cfg_s; +} sh_x_dqct_cfg_u_t; +#else +typedef union sh_x_dqct_cfg_u { + mmr_t sh_x_dqct_cfg_regval; + struct { + mmr_t reserved_0 : 40; + mmr_t mdir_rd_sel : 4; + mmr_t dir_rd_sel : 4; + mmr_t dta_wt_sel : 4; + mmr_t dta_rd_sel : 4; + mmr_t wt_sel : 4; + mmr_t rd_sel : 4; + } sh_x_dqct_cfg_s; +} sh_x_dqct_cfg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_REFRESH_CONTROL" */ +/* Refresh Control Register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_refresh_control_u { + mmr_t sh_x_refresh_control_regval; + struct { + mmr_t enable : 8; + mmr_t interval : 9; + mmr_t hold : 6; + mmr_t interleave : 1; + mmr_t half_rate : 4; + mmr_t reserved_0 : 36; + } sh_x_refresh_control_s; +} sh_x_refresh_control_u_t; +#else +typedef union sh_x_refresh_control_u { + mmr_t sh_x_refresh_control_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t half_rate : 4; + mmr_t interleave : 1; + mmr_t hold : 6; + mmr_t interval : 9; + mmr_t enable : 8; + } sh_x_refresh_control_s; +} sh_x_refresh_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_PHASE_CFG" */ +/* AC Phase Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_phase_cfg_u { + mmr_t sh_y_phase_cfg_regval; + struct { + mmr_t ld_a : 5; + mmr_t ld_b : 5; + mmr_t dq_ld_a : 5; + mmr_t dq_ld_b : 5; + mmr_t hold : 5; + mmr_t hold_req : 5; + mmr_t add_cp : 5; + mmr_t bubble_en : 5; + mmr_t pha_bubble : 3; + mmr_t phb_bubble : 3; + mmr_t phc_bubble : 3; + mmr_t phd_bubble : 3; + mmr_t phe_bubble : 3; + mmr_t sel_a : 4; + mmr_t dq_sel_a : 4; + mmr_t reserved_0 : 1; + } sh_y_phase_cfg_s; +} sh_y_phase_cfg_u_t; +#else +typedef union sh_y_phase_cfg_u { + mmr_t sh_y_phase_cfg_regval; + struct { + mmr_t reserved_0 : 1; + mmr_t dq_sel_a : 4; + mmr_t sel_a : 4; + mmr_t phe_bubble : 3; + mmr_t phd_bubble : 3; + mmr_t phc_bubble : 3; + mmr_t phb_bubble : 3; + mmr_t pha_bubble : 3; + mmr_t bubble_en : 5; + mmr_t add_cp : 5; + mmr_t hold_req : 5; + mmr_t hold : 5; + mmr_t dq_ld_b : 5; + mmr_t dq_ld_a : 5; + mmr_t ld_b : 5; + mmr_t ld_a : 5; + } sh_y_phase_cfg_s; +} sh_y_phase_cfg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_CFG" */ +/* AC Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_cfg_u { + mmr_t sh_y_cfg_regval; + struct { + mmr_t mode_serial : 1; + mmr_t dirc_random_replacement : 1; + mmr_t dir_counter_init : 6; + mmr_t ta_dlys : 32; + mmr_t da_bb_clr : 4; + mmr_t dc_bb_clr : 4; + mmr_t wt_bb_clr : 4; + mmr_t sso_wt_en : 1; + mmr_t trcd2_en : 1; + mmr_t trcd4_en : 1; + mmr_t req_cntr_dis : 1; + mmr_t req_cntr_val : 6; + mmr_t inv_cas_addr : 1; + mmr_t clr_dir_cache : 1; + } sh_y_cfg_s; +} sh_y_cfg_u_t; +#else +typedef union sh_y_cfg_u { + mmr_t sh_y_cfg_regval; + struct { + mmr_t clr_dir_cache : 1; + mmr_t inv_cas_addr : 1; + mmr_t req_cntr_val : 6; + mmr_t req_cntr_dis : 1; + mmr_t trcd4_en : 1; + mmr_t trcd2_en : 1; + mmr_t sso_wt_en : 1; + mmr_t wt_bb_clr : 4; + mmr_t dc_bb_clr : 4; + mmr_t da_bb_clr : 4; + mmr_t ta_dlys : 32; + mmr_t dir_counter_init : 6; + mmr_t dirc_random_replacement : 1; + mmr_t mode_serial : 1; + } sh_y_cfg_s; +} sh_y_cfg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_DQCT_CFG" */ +/* AC Config Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_dqct_cfg_u { + mmr_t sh_y_dqct_cfg_regval; + struct { + mmr_t rd_sel : 4; + mmr_t wt_sel : 4; + mmr_t dta_rd_sel : 4; + mmr_t dta_wt_sel : 4; + mmr_t dir_rd_sel : 4; + mmr_t mdir_rd_sel : 4; + mmr_t reserved_0 : 40; + } sh_y_dqct_cfg_s; +} sh_y_dqct_cfg_u_t; +#else +typedef union sh_y_dqct_cfg_u { + mmr_t sh_y_dqct_cfg_regval; + struct { + mmr_t reserved_0 : 40; + mmr_t mdir_rd_sel : 4; + mmr_t dir_rd_sel : 4; + mmr_t dta_wt_sel : 4; + mmr_t dta_rd_sel : 4; + mmr_t wt_sel : 4; + mmr_t rd_sel : 4; + } sh_y_dqct_cfg_s; +} sh_y_dqct_cfg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_REFRESH_CONTROL" */ +/* Refresh Control Register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_refresh_control_u { + mmr_t sh_y_refresh_control_regval; + struct { + mmr_t enable : 8; + mmr_t interval : 9; + mmr_t hold : 6; + mmr_t interleave : 1; + mmr_t half_rate : 4; + mmr_t reserved_0 : 36; + } sh_y_refresh_control_s; +} sh_y_refresh_control_u_t; +#else +typedef union sh_y_refresh_control_u { + mmr_t sh_y_refresh_control_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t half_rate : 4; + mmr_t interleave : 1; + mmr_t hold : 6; + mmr_t interval : 9; + mmr_t enable : 8; + } sh_y_refresh_control_s; +} sh_y_refresh_control_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MEM_RED_BLACK" */ +/* MD fairness watchdog timers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_mem_red_black_u { + mmr_t sh_mem_red_black_regval; + struct { + mmr_t time : 16; + mmr_t err_time : 36; + mmr_t reserved_0 : 12; + } sh_mem_red_black_s; +} sh_mem_red_black_u_t; +#else +typedef union sh_mem_red_black_u { + mmr_t sh_mem_red_black_regval; + struct { + mmr_t reserved_0 : 12; + mmr_t err_time : 36; + mmr_t time : 16; + } sh_mem_red_black_s; +} sh_mem_red_black_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MISC_MEM_CFG" */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_misc_mem_cfg_u { + mmr_t sh_misc_mem_cfg_regval; + struct { + mmr_t express_header_enable : 1; + mmr_t spec_header_enable : 1; + mmr_t jnr_bypass_enable : 1; + mmr_t xn_rd_same_as_pi : 1; + mmr_t low_write_buffer_threshold : 6; + mmr_t reserved_0 : 2; + mmr_t low_victim_buffer_threshold : 6; + mmr_t reserved_1 : 2; + mmr_t throttle_cnt : 8; + mmr_t disabled_read_tnums : 5; + mmr_t reserved_2 : 3; + mmr_t disabled_write_tnums : 5; + mmr_t reserved_3 : 3; + mmr_t disabled_victims : 6; + mmr_t reserved_4 : 2; + mmr_t alternate_xn_rp_plane : 1; + mmr_t reserved_5 : 11; + } sh_misc_mem_cfg_s; +} sh_misc_mem_cfg_u_t; +#else +typedef union sh_misc_mem_cfg_u { + mmr_t sh_misc_mem_cfg_regval; + struct { + mmr_t reserved_5 : 11; + mmr_t alternate_xn_rp_plane : 1; + mmr_t reserved_4 : 2; + mmr_t disabled_victims : 6; + mmr_t reserved_3 : 3; + mmr_t disabled_write_tnums : 5; + mmr_t reserved_2 : 3; + mmr_t disabled_read_tnums : 5; + mmr_t throttle_cnt : 8; + mmr_t reserved_1 : 2; + mmr_t low_victim_buffer_threshold : 6; + mmr_t reserved_0 : 2; + mmr_t low_write_buffer_threshold : 6; + mmr_t xn_rd_same_as_pi : 1; + mmr_t jnr_bypass_enable : 1; + mmr_t spec_header_enable : 1; + mmr_t express_header_enable : 1; + } sh_misc_mem_cfg_s; +} sh_misc_mem_cfg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PIO_RQ_CRD_CTL" */ +/* pio_rq Credit Circulation Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pio_rq_crd_ctl_u { + mmr_t sh_pio_rq_crd_ctl_regval; + struct { + mmr_t depth : 6; + mmr_t reserved_0 : 58; + } sh_pio_rq_crd_ctl_s; +} sh_pio_rq_crd_ctl_u_t; +#else +typedef union sh_pio_rq_crd_ctl_u { + mmr_t sh_pio_rq_crd_ctl_regval; + struct { + mmr_t reserved_0 : 58; + mmr_t depth : 6; + } sh_pio_rq_crd_ctl_s; +} sh_pio_rq_crd_ctl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_MD_RQ_CRD_CTL" */ +/* pi_md_rq Credit Circulation Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_md_rq_crd_ctl_u { + mmr_t sh_pi_md_rq_crd_ctl_regval; + struct { + mmr_t depth : 6; + mmr_t reserved_0 : 58; + } sh_pi_md_rq_crd_ctl_s; +} sh_pi_md_rq_crd_ctl_u_t; +#else +typedef union sh_pi_md_rq_crd_ctl_u { + mmr_t sh_pi_md_rq_crd_ctl_regval; + struct { + mmr_t reserved_0 : 58; + mmr_t depth : 6; + } sh_pi_md_rq_crd_ctl_s; +} sh_pi_md_rq_crd_ctl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_PI_MD_RP_CRD_CTL" */ +/* pi_md_rp Credit Circulation Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_pi_md_rp_crd_ctl_u { + mmr_t sh_pi_md_rp_crd_ctl_regval; + struct { + mmr_t depth : 6; + mmr_t reserved_0 : 58; + } sh_pi_md_rp_crd_ctl_s; +} sh_pi_md_rp_crd_ctl_u_t; +#else +typedef union sh_pi_md_rp_crd_ctl_u { + mmr_t sh_pi_md_rp_crd_ctl_regval; + struct { + mmr_t reserved_0 : 58; + mmr_t depth : 6; + } sh_pi_md_rp_crd_ctl_s; +} sh_pi_md_rp_crd_ctl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_RQ_CRD_CTL" */ +/* xn_md_rq Credit Circulation Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_rq_crd_ctl_u { + mmr_t sh_xn_md_rq_crd_ctl_regval; + struct { + mmr_t depth : 6; + mmr_t reserved_0 : 58; + } sh_xn_md_rq_crd_ctl_s; +} sh_xn_md_rq_crd_ctl_u_t; +#else +typedef union sh_xn_md_rq_crd_ctl_u { + mmr_t sh_xn_md_rq_crd_ctl_regval; + struct { + mmr_t reserved_0 : 58; + mmr_t depth : 6; + } sh_xn_md_rq_crd_ctl_s; +} sh_xn_md_rq_crd_ctl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_XN_MD_RP_CRD_CTL" */ +/* xn_md_rp Credit Circulation Control */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_xn_md_rp_crd_ctl_u { + mmr_t sh_xn_md_rp_crd_ctl_regval; + struct { + mmr_t depth : 6; + mmr_t reserved_0 : 58; + } sh_xn_md_rp_crd_ctl_s; +} sh_xn_md_rp_crd_ctl_u_t; +#else +typedef union sh_xn_md_rp_crd_ctl_u { + mmr_t sh_xn_md_rp_crd_ctl_regval; + struct { + mmr_t reserved_0 : 58; + mmr_t depth : 6; + } sh_xn_md_rp_crd_ctl_s; +} sh_xn_md_rp_crd_ctl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_TAG0" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_tag0_u { + mmr_t sh_x_tag0_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_x_tag0_s; +} sh_x_tag0_u_t; +#else +typedef union sh_x_tag0_u { + mmr_t sh_x_tag0_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_x_tag0_s; +} sh_x_tag0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_TAG1" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_tag1_u { + mmr_t sh_x_tag1_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_x_tag1_s; +} sh_x_tag1_u_t; +#else +typedef union sh_x_tag1_u { + mmr_t sh_x_tag1_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_x_tag1_s; +} sh_x_tag1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_TAG2" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_tag2_u { + mmr_t sh_x_tag2_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_x_tag2_s; +} sh_x_tag2_u_t; +#else +typedef union sh_x_tag2_u { + mmr_t sh_x_tag2_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_x_tag2_s; +} sh_x_tag2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_TAG3" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_tag3_u { + mmr_t sh_x_tag3_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_x_tag3_s; +} sh_x_tag3_u_t; +#else +typedef union sh_x_tag3_u { + mmr_t sh_x_tag3_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_x_tag3_s; +} sh_x_tag3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_TAG4" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_tag4_u { + mmr_t sh_x_tag4_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_x_tag4_s; +} sh_x_tag4_u_t; +#else +typedef union sh_x_tag4_u { + mmr_t sh_x_tag4_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_x_tag4_s; +} sh_x_tag4_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_TAG5" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_tag5_u { + mmr_t sh_x_tag5_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_x_tag5_s; +} sh_x_tag5_u_t; +#else +typedef union sh_x_tag5_u { + mmr_t sh_x_tag5_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_x_tag5_s; +} sh_x_tag5_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_TAG6" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_tag6_u { + mmr_t sh_x_tag6_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_x_tag6_s; +} sh_x_tag6_u_t; +#else +typedef union sh_x_tag6_u { + mmr_t sh_x_tag6_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_x_tag6_s; +} sh_x_tag6_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_TAG7" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_tag7_u { + mmr_t sh_x_tag7_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_x_tag7_s; +} sh_x_tag7_u_t; +#else +typedef union sh_x_tag7_u { + mmr_t sh_x_tag7_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_x_tag7_s; +} sh_x_tag7_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_TAG0" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_tag0_u { + mmr_t sh_y_tag0_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_y_tag0_s; +} sh_y_tag0_u_t; +#else +typedef union sh_y_tag0_u { + mmr_t sh_y_tag0_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_y_tag0_s; +} sh_y_tag0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_TAG1" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_tag1_u { + mmr_t sh_y_tag1_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_y_tag1_s; +} sh_y_tag1_u_t; +#else +typedef union sh_y_tag1_u { + mmr_t sh_y_tag1_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_y_tag1_s; +} sh_y_tag1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_TAG2" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_tag2_u { + mmr_t sh_y_tag2_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_y_tag2_s; +} sh_y_tag2_u_t; +#else +typedef union sh_y_tag2_u { + mmr_t sh_y_tag2_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_y_tag2_s; +} sh_y_tag2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_TAG3" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_tag3_u { + mmr_t sh_y_tag3_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_y_tag3_s; +} sh_y_tag3_u_t; +#else +typedef union sh_y_tag3_u { + mmr_t sh_y_tag3_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_y_tag3_s; +} sh_y_tag3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_TAG4" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_tag4_u { + mmr_t sh_y_tag4_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_y_tag4_s; +} sh_y_tag4_u_t; +#else +typedef union sh_y_tag4_u { + mmr_t sh_y_tag4_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_y_tag4_s; +} sh_y_tag4_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_TAG5" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_tag5_u { + mmr_t sh_y_tag5_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_y_tag5_s; +} sh_y_tag5_u_t; +#else +typedef union sh_y_tag5_u { + mmr_t sh_y_tag5_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_y_tag5_s; +} sh_y_tag5_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_TAG6" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_tag6_u { + mmr_t sh_y_tag6_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_y_tag6_s; +} sh_y_tag6_u_t; +#else +typedef union sh_y_tag6_u { + mmr_t sh_y_tag6_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_y_tag6_s; +} sh_y_tag6_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_TAG7" */ +/* AC tag Registers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_tag7_u { + mmr_t sh_y_tag7_regval; + struct { + mmr_t tag : 20; + mmr_t reserved_0 : 44; + } sh_y_tag7_s; +} sh_y_tag7_u_t; +#else +typedef union sh_y_tag7_u { + mmr_t sh_y_tag7_regval; + struct { + mmr_t reserved_0 : 44; + mmr_t tag : 20; + } sh_y_tag7_s; +} sh_y_tag7_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MMRBIST_BASE" */ +/* mmr/bist base address */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_mmrbist_base_u { + mmr_t sh_mmrbist_base_regval; + struct { + mmr_t reserved_0 : 3; + mmr_t dword_addr : 47; + mmr_t reserved_1 : 14; + } sh_mmrbist_base_s; +} sh_mmrbist_base_u_t; +#else +typedef union sh_mmrbist_base_u { + mmr_t sh_mmrbist_base_regval; + struct { + mmr_t reserved_1 : 14; + mmr_t dword_addr : 47; + mmr_t reserved_0 : 3; + } sh_mmrbist_base_s; +} sh_mmrbist_base_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MMRBIST_CTL" */ +/* Bist base address */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_mmrbist_ctl_u { + mmr_t sh_mmrbist_ctl_regval; + struct { + mmr_t block_length : 31; + mmr_t reserved_0 : 1; + mmr_t cmd : 7; + mmr_t reserved_1 : 1; + mmr_t in_progress : 1; + mmr_t fail : 1; + mmr_t mem_idle : 1; + mmr_t reserved_2 : 1; + mmr_t reset_state : 1; + mmr_t reserved_3 : 19; + } sh_mmrbist_ctl_s; +} sh_mmrbist_ctl_u_t; +#else +typedef union sh_mmrbist_ctl_u { + mmr_t sh_mmrbist_ctl_regval; + struct { + mmr_t reserved_3 : 19; + mmr_t reset_state : 1; + mmr_t reserved_2 : 1; + mmr_t mem_idle : 1; + mmr_t fail : 1; + mmr_t in_progress : 1; + mmr_t reserved_1 : 1; + mmr_t cmd : 7; + mmr_t reserved_0 : 1; + mmr_t block_length : 31; + } sh_mmrbist_ctl_s; +} sh_mmrbist_ctl_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DBUG_DATA_CFG" */ +/* configuration for md debug data muxes */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dbug_data_cfg_u { + mmr_t sh_md_dbug_data_cfg_regval; + struct { + mmr_t nibble0_chiplet : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_chiplet : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_chiplet : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_chiplet : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_chiplet : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_chiplet : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_chiplet : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_chiplet : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble : 3; + mmr_t reserved_15 : 1; + } sh_md_dbug_data_cfg_s; +} sh_md_dbug_data_cfg_u_t; +#else +typedef union sh_md_dbug_data_cfg_u { + mmr_t sh_md_dbug_data_cfg_regval; + struct { + mmr_t reserved_15 : 1; + mmr_t nibble7_nibble : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_chiplet : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_chiplet : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_chiplet : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_chiplet : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_chiplet : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_chiplet : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_chiplet : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_chiplet : 3; + } sh_md_dbug_data_cfg_s; +} sh_md_dbug_data_cfg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DBUG_TRIGGER_CFG" */ +/* configuration for md debug triggers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dbug_trigger_cfg_u { + mmr_t sh_md_dbug_trigger_cfg_regval; + struct { + mmr_t nibble0_chiplet : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_nibble : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_chiplet : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_nibble : 3; + mmr_t reserved_3 : 1; + mmr_t nibble2_chiplet : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_nibble : 3; + mmr_t reserved_5 : 1; + mmr_t nibble3_chiplet : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_nibble : 3; + mmr_t reserved_7 : 1; + mmr_t nibble4_chiplet : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_nibble : 3; + mmr_t reserved_9 : 1; + mmr_t nibble5_chiplet : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_nibble : 3; + mmr_t reserved_11 : 1; + mmr_t nibble6_chiplet : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_nibble : 3; + mmr_t reserved_13 : 1; + mmr_t nibble7_chiplet : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_nibble : 3; + mmr_t enable : 1; + } sh_md_dbug_trigger_cfg_s; +} sh_md_dbug_trigger_cfg_u_t; +#else +typedef union sh_md_dbug_trigger_cfg_u { + mmr_t sh_md_dbug_trigger_cfg_regval; + struct { + mmr_t enable : 1; + mmr_t nibble7_nibble : 3; + mmr_t reserved_14 : 1; + mmr_t nibble7_chiplet : 3; + mmr_t reserved_13 : 1; + mmr_t nibble6_nibble : 3; + mmr_t reserved_12 : 1; + mmr_t nibble6_chiplet : 3; + mmr_t reserved_11 : 1; + mmr_t nibble5_nibble : 3; + mmr_t reserved_10 : 1; + mmr_t nibble5_chiplet : 3; + mmr_t reserved_9 : 1; + mmr_t nibble4_nibble : 3; + mmr_t reserved_8 : 1; + mmr_t nibble4_chiplet : 3; + mmr_t reserved_7 : 1; + mmr_t nibble3_nibble : 3; + mmr_t reserved_6 : 1; + mmr_t nibble3_chiplet : 3; + mmr_t reserved_5 : 1; + mmr_t nibble2_nibble : 3; + mmr_t reserved_4 : 1; + mmr_t nibble2_chiplet : 3; + mmr_t reserved_3 : 1; + mmr_t nibble1_nibble : 3; + mmr_t reserved_2 : 1; + mmr_t nibble1_chiplet : 3; + mmr_t reserved_1 : 1; + mmr_t nibble0_nibble : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_chiplet : 3; + } sh_md_dbug_trigger_cfg_s; +} sh_md_dbug_trigger_cfg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DBUG_COMPARE" */ +/* md debug compare pattern and mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dbug_compare_u { + mmr_t sh_md_dbug_compare_regval; + struct { + mmr_t pattern : 32; + mmr_t mask : 32; + } sh_md_dbug_compare_s; +} sh_md_dbug_compare_u_t; +#else +typedef union sh_md_dbug_compare_u { + mmr_t sh_md_dbug_compare_regval; + struct { + mmr_t mask : 32; + mmr_t pattern : 32; + } sh_md_dbug_compare_s; +} sh_md_dbug_compare_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_MOD_DBUG_SEL" */ +/* MD acx debug select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_mod_dbug_sel_u { + mmr_t sh_x_mod_dbug_sel_regval; + struct { + mmr_t tag_sel : 8; + mmr_t wbq_sel : 8; + mmr_t arb_sel : 8; + mmr_t atl_sel : 11; + mmr_t atr_sel : 11; + mmr_t dql_sel : 6; + mmr_t dqr_sel : 6; + mmr_t reserved_0 : 6; + } sh_x_mod_dbug_sel_s; +} sh_x_mod_dbug_sel_u_t; +#else +typedef union sh_x_mod_dbug_sel_u { + mmr_t sh_x_mod_dbug_sel_regval; + struct { + mmr_t reserved_0 : 6; + mmr_t dqr_sel : 6; + mmr_t dql_sel : 6; + mmr_t atr_sel : 11; + mmr_t atl_sel : 11; + mmr_t arb_sel : 8; + mmr_t wbq_sel : 8; + mmr_t tag_sel : 8; + } sh_x_mod_dbug_sel_s; +} sh_x_mod_dbug_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_DBUG_SEL" */ +/* MD acx debug select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_dbug_sel_u { + mmr_t sh_x_dbug_sel_regval; + struct { + mmr_t dbg_sel : 24; + mmr_t reserved_0 : 40; + } sh_x_dbug_sel_s; +} sh_x_dbug_sel_u_t; +#else +typedef union sh_x_dbug_sel_u { + mmr_t sh_x_dbug_sel_regval; + struct { + mmr_t reserved_0 : 40; + mmr_t dbg_sel : 24; + } sh_x_dbug_sel_s; +} sh_x_dbug_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_LADDR_CMP" */ +/* MD acx address compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_laddr_cmp_u { + mmr_t sh_x_laddr_cmp_regval; + struct { + mmr_t cmp_val : 28; + mmr_t reserved_0 : 4; + mmr_t mask_val : 28; + mmr_t reserved_1 : 4; + } sh_x_laddr_cmp_s; +} sh_x_laddr_cmp_u_t; +#else +typedef union sh_x_laddr_cmp_u { + mmr_t sh_x_laddr_cmp_regval; + struct { + mmr_t reserved_1 : 4; + mmr_t mask_val : 28; + mmr_t reserved_0 : 4; + mmr_t cmp_val : 28; + } sh_x_laddr_cmp_s; +} sh_x_laddr_cmp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_RADDR_CMP" */ +/* MD acx address compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_raddr_cmp_u { + mmr_t sh_x_raddr_cmp_regval; + struct { + mmr_t cmp_val : 28; + mmr_t reserved_0 : 4; + mmr_t mask_val : 28; + mmr_t reserved_1 : 4; + } sh_x_raddr_cmp_s; +} sh_x_raddr_cmp_u_t; +#else +typedef union sh_x_raddr_cmp_u { + mmr_t sh_x_raddr_cmp_regval; + struct { + mmr_t reserved_1 : 4; + mmr_t mask_val : 28; + mmr_t reserved_0 : 4; + mmr_t cmp_val : 28; + } sh_x_raddr_cmp_s; +} sh_x_raddr_cmp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_TAG_CMP" */ +/* MD acx tagmgr compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_tag_cmp_u { + mmr_t sh_x_tag_cmp_regval; + struct { + mmr_t cmd : 8; + mmr_t addr : 33; + mmr_t src : 14; + mmr_t reserved_0 : 9; + } sh_x_tag_cmp_s; +} sh_x_tag_cmp_u_t; +#else +typedef union sh_x_tag_cmp_u { + mmr_t sh_x_tag_cmp_regval; + struct { + mmr_t reserved_0 : 9; + mmr_t src : 14; + mmr_t addr : 33; + mmr_t cmd : 8; + } sh_x_tag_cmp_s; +} sh_x_tag_cmp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_X_TAG_MASK" */ +/* MD acx tagmgr mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_x_tag_mask_u { + mmr_t sh_x_tag_mask_regval; + struct { + mmr_t cmd : 8; + mmr_t addr : 33; + mmr_t src : 14; + mmr_t reserved_0 : 9; + } sh_x_tag_mask_s; +} sh_x_tag_mask_u_t; +#else +typedef union sh_x_tag_mask_u { + mmr_t sh_x_tag_mask_regval; + struct { + mmr_t reserved_0 : 9; + mmr_t src : 14; + mmr_t addr : 33; + mmr_t cmd : 8; + } sh_x_tag_mask_s; +} sh_x_tag_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_MOD_DBUG_SEL" */ +/* MD acy debug select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_mod_dbug_sel_u { + mmr_t sh_y_mod_dbug_sel_regval; + struct { + mmr_t tag_sel : 8; + mmr_t wbq_sel : 8; + mmr_t arb_sel : 8; + mmr_t atl_sel : 11; + mmr_t atr_sel : 11; + mmr_t dql_sel : 6; + mmr_t dqr_sel : 6; + mmr_t reserved_0 : 6; + } sh_y_mod_dbug_sel_s; +} sh_y_mod_dbug_sel_u_t; +#else +typedef union sh_y_mod_dbug_sel_u { + mmr_t sh_y_mod_dbug_sel_regval; + struct { + mmr_t reserved_0 : 6; + mmr_t dqr_sel : 6; + mmr_t dql_sel : 6; + mmr_t atr_sel : 11; + mmr_t atl_sel : 11; + mmr_t arb_sel : 8; + mmr_t wbq_sel : 8; + mmr_t tag_sel : 8; + } sh_y_mod_dbug_sel_s; +} sh_y_mod_dbug_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_DBUG_SEL" */ +/* MD acy debug select */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_dbug_sel_u { + mmr_t sh_y_dbug_sel_regval; + struct { + mmr_t dbg_sel : 24; + mmr_t reserved_0 : 40; + } sh_y_dbug_sel_s; +} sh_y_dbug_sel_u_t; +#else +typedef union sh_y_dbug_sel_u { + mmr_t sh_y_dbug_sel_regval; + struct { + mmr_t reserved_0 : 40; + mmr_t dbg_sel : 24; + } sh_y_dbug_sel_s; +} sh_y_dbug_sel_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_LADDR_CMP" */ +/* MD acy address compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_laddr_cmp_u { + mmr_t sh_y_laddr_cmp_regval; + struct { + mmr_t cmp_val : 28; + mmr_t reserved_0 : 4; + mmr_t mask_val : 28; + mmr_t reserved_1 : 4; + } sh_y_laddr_cmp_s; +} sh_y_laddr_cmp_u_t; +#else +typedef union sh_y_laddr_cmp_u { + mmr_t sh_y_laddr_cmp_regval; + struct { + mmr_t reserved_1 : 4; + mmr_t mask_val : 28; + mmr_t reserved_0 : 4; + mmr_t cmp_val : 28; + } sh_y_laddr_cmp_s; +} sh_y_laddr_cmp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_RADDR_CMP" */ +/* MD acy address compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_raddr_cmp_u { + mmr_t sh_y_raddr_cmp_regval; + struct { + mmr_t cmp_val : 28; + mmr_t reserved_0 : 4; + mmr_t mask_val : 28; + mmr_t reserved_1 : 4; + } sh_y_raddr_cmp_s; +} sh_y_raddr_cmp_u_t; +#else +typedef union sh_y_raddr_cmp_u { + mmr_t sh_y_raddr_cmp_regval; + struct { + mmr_t reserved_1 : 4; + mmr_t mask_val : 28; + mmr_t reserved_0 : 4; + mmr_t cmp_val : 28; + } sh_y_raddr_cmp_s; +} sh_y_raddr_cmp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_TAG_CMP" */ +/* MD acy tagmgr compare */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_tag_cmp_u { + mmr_t sh_y_tag_cmp_regval; + struct { + mmr_t cmd : 8; + mmr_t addr : 33; + mmr_t src : 14; + mmr_t reserved_0 : 9; + } sh_y_tag_cmp_s; +} sh_y_tag_cmp_u_t; +#else +typedef union sh_y_tag_cmp_u { + mmr_t sh_y_tag_cmp_regval; + struct { + mmr_t reserved_0 : 9; + mmr_t src : 14; + mmr_t addr : 33; + mmr_t cmd : 8; + } sh_y_tag_cmp_s; +} sh_y_tag_cmp_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_Y_TAG_MASK" */ +/* MD acy tagmgr mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_y_tag_mask_u { + mmr_t sh_y_tag_mask_regval; + struct { + mmr_t cmd : 8; + mmr_t addr : 33; + mmr_t src : 14; + mmr_t reserved_0 : 9; + } sh_y_tag_mask_s; +} sh_y_tag_mask_u_t; +#else +typedef union sh_y_tag_mask_u { + mmr_t sh_y_tag_mask_regval; + struct { + mmr_t reserved_0 : 9; + mmr_t src : 14; + mmr_t addr : 33; + mmr_t cmd : 8; + } sh_y_tag_mask_s; +} sh_y_tag_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_JNR_DBUG_DATA_CFG" */ +/* configuration for md jnr debug data muxes */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_jnr_dbug_data_cfg_u { + mmr_t sh_md_jnr_dbug_data_cfg_regval; + struct { + mmr_t nibble0_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble1_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble2_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble3_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble4_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble5_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble6_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble7_sel : 3; + mmr_t reserved_7 : 33; + } sh_md_jnr_dbug_data_cfg_s; +} sh_md_jnr_dbug_data_cfg_u_t; +#else +typedef union sh_md_jnr_dbug_data_cfg_u { + mmr_t sh_md_jnr_dbug_data_cfg_regval; + struct { + mmr_t reserved_7 : 33; + mmr_t nibble7_sel : 3; + mmr_t reserved_6 : 1; + mmr_t nibble6_sel : 3; + mmr_t reserved_5 : 1; + mmr_t nibble5_sel : 3; + mmr_t reserved_4 : 1; + mmr_t nibble4_sel : 3; + mmr_t reserved_3 : 1; + mmr_t nibble3_sel : 3; + mmr_t reserved_2 : 1; + mmr_t nibble2_sel : 3; + mmr_t reserved_1 : 1; + mmr_t nibble1_sel : 3; + mmr_t reserved_0 : 1; + mmr_t nibble0_sel : 3; + } sh_md_jnr_dbug_data_cfg_s; +} sh_md_jnr_dbug_data_cfg_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_LAST_CREDIT" */ +/* captures last credit values on reset */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_last_credit_u { + mmr_t sh_md_last_credit_regval; + struct { + mmr_t rq_to_pi : 6; + mmr_t reserved_0 : 2; + mmr_t rp_to_pi : 6; + mmr_t reserved_1 : 2; + mmr_t rq_to_xn : 6; + mmr_t reserved_2 : 2; + mmr_t rp_to_xn : 6; + mmr_t reserved_3 : 2; + mmr_t to_lb : 6; + mmr_t reserved_4 : 26; + } sh_md_last_credit_s; +} sh_md_last_credit_u_t; +#else +typedef union sh_md_last_credit_u { + mmr_t sh_md_last_credit_regval; + struct { + mmr_t reserved_4 : 26; + mmr_t to_lb : 6; + mmr_t reserved_3 : 2; + mmr_t rp_to_xn : 6; + mmr_t reserved_2 : 2; + mmr_t rq_to_xn : 6; + mmr_t reserved_1 : 2; + mmr_t rp_to_pi : 6; + mmr_t reserved_0 : 2; + mmr_t rq_to_pi : 6; + } sh_md_last_credit_s; +} sh_md_last_credit_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MEM_CAPTURE_ADDR" */ +/* Address capture address register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_mem_capture_addr_u { + mmr_t sh_mem_capture_addr_regval; + struct { + mmr_t reserved_0 : 3; + mmr_t addr : 33; + mmr_t cmd : 8; + mmr_t reserved_1 : 20; + } sh_mem_capture_addr_s; +} sh_mem_capture_addr_u_t; +#else +typedef union sh_mem_capture_addr_u { + mmr_t sh_mem_capture_addr_regval; + struct { + mmr_t reserved_1 : 20; + mmr_t cmd : 8; + mmr_t addr : 33; + mmr_t reserved_0 : 3; + } sh_mem_capture_addr_s; +} sh_mem_capture_addr_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MEM_CAPTURE_MASK" */ +/* Address capture mask register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_mem_capture_mask_u { + mmr_t sh_mem_capture_mask_regval; + struct { + mmr_t reserved_0 : 3; + mmr_t addr : 33; + mmr_t cmd : 8; + mmr_t enable_local : 1; + mmr_t enable_remote : 1; + mmr_t reserved_1 : 18; + } sh_mem_capture_mask_s; +} sh_mem_capture_mask_u_t; +#else +typedef union sh_mem_capture_mask_u { + mmr_t sh_mem_capture_mask_regval; + struct { + mmr_t reserved_1 : 18; + mmr_t enable_remote : 1; + mmr_t enable_local : 1; + mmr_t cmd : 8; + mmr_t addr : 33; + mmr_t reserved_0 : 3; + } sh_mem_capture_mask_s; +} sh_mem_capture_mask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MEM_CAPTURE_HDR" */ +/* Address capture header register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_mem_capture_hdr_u { + mmr_t sh_mem_capture_hdr_regval; + struct { + mmr_t reserved_0 : 3; + mmr_t addr : 33; + mmr_t cmd : 8; + mmr_t src : 14; + mmr_t cntr : 6; + } sh_mem_capture_hdr_s; +} sh_mem_capture_hdr_u_t; +#else +typedef union sh_mem_capture_hdr_u { + mmr_t sh_mem_capture_hdr_regval; + struct { + mmr_t cntr : 6; + mmr_t src : 14; + mmr_t cmd : 8; + mmr_t addr : 33; + mmr_t reserved_0 : 3; + } sh_mem_capture_hdr_s; +} sh_mem_capture_hdr_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_CONFIG" */ +/* DQ directory config register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_config_u { + mmr_t sh_md_dqlp_mmr_dir_config_regval; + struct { + mmr_t sys_size : 3; + mmr_t en_direcc : 1; + mmr_t en_dirpois : 1; + mmr_t reserved_0 : 59; + } sh_md_dqlp_mmr_dir_config_s; +} sh_md_dqlp_mmr_dir_config_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_config_u { + mmr_t sh_md_dqlp_mmr_dir_config_regval; + struct { + mmr_t reserved_0 : 59; + mmr_t en_dirpois : 1; + mmr_t en_direcc : 1; + mmr_t sys_size : 3; + } sh_md_dqlp_mmr_dir_config_s; +} sh_md_dqlp_mmr_dir_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRESVEC0" */ +/* node [63:0] presence bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_presvec0_u { + mmr_t sh_md_dqlp_mmr_dir_presvec0_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_presvec0_s; +} sh_md_dqlp_mmr_dir_presvec0_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_presvec0_u { + mmr_t sh_md_dqlp_mmr_dir_presvec0_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_presvec0_s; +} sh_md_dqlp_mmr_dir_presvec0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRESVEC1" */ +/* node [127:64] presence bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_presvec1_u { + mmr_t sh_md_dqlp_mmr_dir_presvec1_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_presvec1_s; +} sh_md_dqlp_mmr_dir_presvec1_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_presvec1_u { + mmr_t sh_md_dqlp_mmr_dir_presvec1_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_presvec1_s; +} sh_md_dqlp_mmr_dir_presvec1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRESVEC2" */ +/* node [191:128] presence bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_presvec2_u { + mmr_t sh_md_dqlp_mmr_dir_presvec2_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_presvec2_s; +} sh_md_dqlp_mmr_dir_presvec2_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_presvec2_u { + mmr_t sh_md_dqlp_mmr_dir_presvec2_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_presvec2_s; +} sh_md_dqlp_mmr_dir_presvec2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRESVEC3" */ +/* node [255:192] presence bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_presvec3_u { + mmr_t sh_md_dqlp_mmr_dir_presvec3_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_presvec3_s; +} sh_md_dqlp_mmr_dir_presvec3_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_presvec3_u { + mmr_t sh_md_dqlp_mmr_dir_presvec3_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_presvec3_s; +} sh_md_dqlp_mmr_dir_presvec3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC0" */ +/* local vector for acc=0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_locvec0_u { + mmr_t sh_md_dqlp_mmr_dir_locvec0_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec0_s; +} sh_md_dqlp_mmr_dir_locvec0_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_locvec0_u { + mmr_t sh_md_dqlp_mmr_dir_locvec0_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec0_s; +} sh_md_dqlp_mmr_dir_locvec0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC1" */ +/* local vector for acc=1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_locvec1_u { + mmr_t sh_md_dqlp_mmr_dir_locvec1_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec1_s; +} sh_md_dqlp_mmr_dir_locvec1_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_locvec1_u { + mmr_t sh_md_dqlp_mmr_dir_locvec1_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec1_s; +} sh_md_dqlp_mmr_dir_locvec1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC2" */ +/* local vector for acc=2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_locvec2_u { + mmr_t sh_md_dqlp_mmr_dir_locvec2_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec2_s; +} sh_md_dqlp_mmr_dir_locvec2_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_locvec2_u { + mmr_t sh_md_dqlp_mmr_dir_locvec2_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec2_s; +} sh_md_dqlp_mmr_dir_locvec2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC3" */ +/* local vector for acc=3 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_locvec3_u { + mmr_t sh_md_dqlp_mmr_dir_locvec3_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec3_s; +} sh_md_dqlp_mmr_dir_locvec3_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_locvec3_u { + mmr_t sh_md_dqlp_mmr_dir_locvec3_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec3_s; +} sh_md_dqlp_mmr_dir_locvec3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC4" */ +/* local vector for acc=4 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_locvec4_u { + mmr_t sh_md_dqlp_mmr_dir_locvec4_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec4_s; +} sh_md_dqlp_mmr_dir_locvec4_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_locvec4_u { + mmr_t sh_md_dqlp_mmr_dir_locvec4_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec4_s; +} sh_md_dqlp_mmr_dir_locvec4_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC5" */ +/* local vector for acc=5 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_locvec5_u { + mmr_t sh_md_dqlp_mmr_dir_locvec5_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec5_s; +} sh_md_dqlp_mmr_dir_locvec5_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_locvec5_u { + mmr_t sh_md_dqlp_mmr_dir_locvec5_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec5_s; +} sh_md_dqlp_mmr_dir_locvec5_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC6" */ +/* local vector for acc=6 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_locvec6_u { + mmr_t sh_md_dqlp_mmr_dir_locvec6_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec6_s; +} sh_md_dqlp_mmr_dir_locvec6_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_locvec6_u { + mmr_t sh_md_dqlp_mmr_dir_locvec6_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec6_s; +} sh_md_dqlp_mmr_dir_locvec6_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC7" */ +/* local vector for acc=7 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_locvec7_u { + mmr_t sh_md_dqlp_mmr_dir_locvec7_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec7_s; +} sh_md_dqlp_mmr_dir_locvec7_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_locvec7_u { + mmr_t sh_md_dqlp_mmr_dir_locvec7_regval; + struct { + mmr_t vec : 64; + } sh_md_dqlp_mmr_dir_locvec7_s; +} sh_md_dqlp_mmr_dir_locvec7_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC0" */ +/* privilege vector for acc=0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_privec0_u { + mmr_t sh_md_dqlp_mmr_dir_privec0_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqlp_mmr_dir_privec0_s; +} sh_md_dqlp_mmr_dir_privec0_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_privec0_u { + mmr_t sh_md_dqlp_mmr_dir_privec0_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqlp_mmr_dir_privec0_s; +} sh_md_dqlp_mmr_dir_privec0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC1" */ +/* privilege vector for acc=1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_privec1_u { + mmr_t sh_md_dqlp_mmr_dir_privec1_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqlp_mmr_dir_privec1_s; +} sh_md_dqlp_mmr_dir_privec1_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_privec1_u { + mmr_t sh_md_dqlp_mmr_dir_privec1_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqlp_mmr_dir_privec1_s; +} sh_md_dqlp_mmr_dir_privec1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC2" */ +/* privilege vector for acc=2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_privec2_u { + mmr_t sh_md_dqlp_mmr_dir_privec2_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqlp_mmr_dir_privec2_s; +} sh_md_dqlp_mmr_dir_privec2_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_privec2_u { + mmr_t sh_md_dqlp_mmr_dir_privec2_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqlp_mmr_dir_privec2_s; +} sh_md_dqlp_mmr_dir_privec2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC3" */ +/* privilege vector for acc=3 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_privec3_u { + mmr_t sh_md_dqlp_mmr_dir_privec3_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqlp_mmr_dir_privec3_s; +} sh_md_dqlp_mmr_dir_privec3_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_privec3_u { + mmr_t sh_md_dqlp_mmr_dir_privec3_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqlp_mmr_dir_privec3_s; +} sh_md_dqlp_mmr_dir_privec3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC4" */ +/* privilege vector for acc=4 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_privec4_u { + mmr_t sh_md_dqlp_mmr_dir_privec4_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqlp_mmr_dir_privec4_s; +} sh_md_dqlp_mmr_dir_privec4_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_privec4_u { + mmr_t sh_md_dqlp_mmr_dir_privec4_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqlp_mmr_dir_privec4_s; +} sh_md_dqlp_mmr_dir_privec4_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC5" */ +/* privilege vector for acc=5 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_privec5_u { + mmr_t sh_md_dqlp_mmr_dir_privec5_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqlp_mmr_dir_privec5_s; +} sh_md_dqlp_mmr_dir_privec5_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_privec5_u { + mmr_t sh_md_dqlp_mmr_dir_privec5_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqlp_mmr_dir_privec5_s; +} sh_md_dqlp_mmr_dir_privec5_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC6" */ +/* privilege vector for acc=6 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_privec6_u { + mmr_t sh_md_dqlp_mmr_dir_privec6_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqlp_mmr_dir_privec6_s; +} sh_md_dqlp_mmr_dir_privec6_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_privec6_u { + mmr_t sh_md_dqlp_mmr_dir_privec6_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqlp_mmr_dir_privec6_s; +} sh_md_dqlp_mmr_dir_privec6_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC7" */ +/* privilege vector for acc=7 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_privec7_u { + mmr_t sh_md_dqlp_mmr_dir_privec7_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqlp_mmr_dir_privec7_s; +} sh_md_dqlp_mmr_dir_privec7_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_privec7_u { + mmr_t sh_md_dqlp_mmr_dir_privec7_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqlp_mmr_dir_privec7_s; +} sh_md_dqlp_mmr_dir_privec7_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_TIMER" */ +/* MD SXRO timer */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_timer_u { + mmr_t sh_md_dqlp_mmr_dir_timer_regval; + struct { + mmr_t timer_div : 12; + mmr_t timer_en : 1; + mmr_t timer_cur : 9; + mmr_t reserved_0 : 42; + } sh_md_dqlp_mmr_dir_timer_s; +} sh_md_dqlp_mmr_dir_timer_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_timer_u { + mmr_t sh_md_dqlp_mmr_dir_timer_regval; + struct { + mmr_t reserved_0 : 42; + mmr_t timer_cur : 9; + mmr_t timer_en : 1; + mmr_t timer_div : 12; + } sh_md_dqlp_mmr_dir_timer_s; +} sh_md_dqlp_mmr_dir_timer_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY" */ +/* directory pio write data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_piowd_dir_entry_u { + mmr_t sh_md_dqlp_mmr_piowd_dir_entry_regval; + struct { + mmr_t dira : 26; + mmr_t dirb : 26; + mmr_t pri : 3; + mmr_t acc : 3; + mmr_t reserved_0 : 6; + } sh_md_dqlp_mmr_piowd_dir_entry_s; +} sh_md_dqlp_mmr_piowd_dir_entry_u_t; +#else +typedef union sh_md_dqlp_mmr_piowd_dir_entry_u { + mmr_t sh_md_dqlp_mmr_piowd_dir_entry_regval; + struct { + mmr_t reserved_0 : 6; + mmr_t acc : 3; + mmr_t pri : 3; + mmr_t dirb : 26; + mmr_t dira : 26; + } sh_md_dqlp_mmr_piowd_dir_entry_s; +} sh_md_dqlp_mmr_piowd_dir_entry_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_PIOWD_DIR_ECC" */ +/* directory ecc register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_piowd_dir_ecc_u { + mmr_t sh_md_dqlp_mmr_piowd_dir_ecc_regval; + struct { + mmr_t ecca : 7; + mmr_t eccb : 7; + mmr_t reserved_0 : 50; + } sh_md_dqlp_mmr_piowd_dir_ecc_s; +} sh_md_dqlp_mmr_piowd_dir_ecc_u_t; +#else +typedef union sh_md_dqlp_mmr_piowd_dir_ecc_u { + mmr_t sh_md_dqlp_mmr_piowd_dir_ecc_regval; + struct { + mmr_t reserved_0 : 50; + mmr_t eccb : 7; + mmr_t ecca : 7; + } sh_md_dqlp_mmr_piowd_dir_ecc_s; +} sh_md_dqlp_mmr_piowd_dir_ecc_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY" */ +/* x directory pio read data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_xpiord_xdir_entry_u { + mmr_t sh_md_dqlp_mmr_xpiord_xdir_entry_regval; + struct { + mmr_t dira : 26; + mmr_t dirb : 26; + mmr_t pri : 3; + mmr_t acc : 3; + mmr_t cor : 1; + mmr_t unc : 1; + mmr_t reserved_0 : 4; + } sh_md_dqlp_mmr_xpiord_xdir_entry_s; +} sh_md_dqlp_mmr_xpiord_xdir_entry_u_t; +#else +typedef union sh_md_dqlp_mmr_xpiord_xdir_entry_u { + mmr_t sh_md_dqlp_mmr_xpiord_xdir_entry_regval; + struct { + mmr_t reserved_0 : 4; + mmr_t unc : 1; + mmr_t cor : 1; + mmr_t acc : 3; + mmr_t pri : 3; + mmr_t dirb : 26; + mmr_t dira : 26; + } sh_md_dqlp_mmr_xpiord_xdir_entry_s; +} sh_md_dqlp_mmr_xpiord_xdir_entry_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XPIORD_XDIR_ECC" */ +/* x directory ecc */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_xpiord_xdir_ecc_u { + mmr_t sh_md_dqlp_mmr_xpiord_xdir_ecc_regval; + struct { + mmr_t ecca : 7; + mmr_t eccb : 7; + mmr_t reserved_0 : 50; + } sh_md_dqlp_mmr_xpiord_xdir_ecc_s; +} sh_md_dqlp_mmr_xpiord_xdir_ecc_u_t; +#else +typedef union sh_md_dqlp_mmr_xpiord_xdir_ecc_u { + mmr_t sh_md_dqlp_mmr_xpiord_xdir_ecc_regval; + struct { + mmr_t reserved_0 : 50; + mmr_t eccb : 7; + mmr_t ecca : 7; + } sh_md_dqlp_mmr_xpiord_xdir_ecc_s; +} sh_md_dqlp_mmr_xpiord_xdir_ecc_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY" */ +/* y directory pio read data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_ypiord_ydir_entry_u { + mmr_t sh_md_dqlp_mmr_ypiord_ydir_entry_regval; + struct { + mmr_t dira : 26; + mmr_t dirb : 26; + mmr_t pri : 3; + mmr_t acc : 3; + mmr_t cor : 1; + mmr_t unc : 1; + mmr_t reserved_0 : 4; + } sh_md_dqlp_mmr_ypiord_ydir_entry_s; +} sh_md_dqlp_mmr_ypiord_ydir_entry_u_t; +#else +typedef union sh_md_dqlp_mmr_ypiord_ydir_entry_u { + mmr_t sh_md_dqlp_mmr_ypiord_ydir_entry_regval; + struct { + mmr_t reserved_0 : 4; + mmr_t unc : 1; + mmr_t cor : 1; + mmr_t acc : 3; + mmr_t pri : 3; + mmr_t dirb : 26; + mmr_t dira : 26; + } sh_md_dqlp_mmr_ypiord_ydir_entry_s; +} sh_md_dqlp_mmr_ypiord_ydir_entry_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YPIORD_YDIR_ECC" */ +/* y directory ecc */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_ypiord_ydir_ecc_u { + mmr_t sh_md_dqlp_mmr_ypiord_ydir_ecc_regval; + struct { + mmr_t ecca : 7; + mmr_t eccb : 7; + mmr_t reserved_0 : 50; + } sh_md_dqlp_mmr_ypiord_ydir_ecc_s; +} sh_md_dqlp_mmr_ypiord_ydir_ecc_u_t; +#else +typedef union sh_md_dqlp_mmr_ypiord_ydir_ecc_u { + mmr_t sh_md_dqlp_mmr_ypiord_ydir_ecc_regval; + struct { + mmr_t reserved_0 : 50; + mmr_t eccb : 7; + mmr_t ecca : 7; + } sh_md_dqlp_mmr_ypiord_ydir_ecc_s; +} sh_md_dqlp_mmr_ypiord_ydir_ecc_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XCERR1" */ +/* correctable dir ecc group 1 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_xcerr1_u { + mmr_t sh_md_dqlp_mmr_xcerr1_regval; + struct { + mmr_t grp1 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 25; + } sh_md_dqlp_mmr_xcerr1_s; +} sh_md_dqlp_mmr_xcerr1_u_t; +#else +typedef union sh_md_dqlp_mmr_xcerr1_u { + mmr_t sh_md_dqlp_mmr_xcerr1_regval; + struct { + mmr_t reserved_0 : 25; + mmr_t arm : 1; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp1 : 36; + } sh_md_dqlp_mmr_xcerr1_s; +} sh_md_dqlp_mmr_xcerr1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XCERR2" */ +/* correctable dir ecc group 2 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_xcerr2_u { + mmr_t sh_md_dqlp_mmr_xcerr2_regval; + struct { + mmr_t grp2 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 26; + } sh_md_dqlp_mmr_xcerr2_s; +} sh_md_dqlp_mmr_xcerr2_u_t; +#else +typedef union sh_md_dqlp_mmr_xcerr2_u { + mmr_t sh_md_dqlp_mmr_xcerr2_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp2 : 36; + } sh_md_dqlp_mmr_xcerr2_s; +} sh_md_dqlp_mmr_xcerr2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XUERR1" */ +/* uncorrectable dir ecc group 1 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_xuerr1_u { + mmr_t sh_md_dqlp_mmr_xuerr1_regval; + struct { + mmr_t grp1 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 25; + } sh_md_dqlp_mmr_xuerr1_s; +} sh_md_dqlp_mmr_xuerr1_u_t; +#else +typedef union sh_md_dqlp_mmr_xuerr1_u { + mmr_t sh_md_dqlp_mmr_xuerr1_regval; + struct { + mmr_t reserved_0 : 25; + mmr_t arm : 1; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp1 : 36; + } sh_md_dqlp_mmr_xuerr1_s; +} sh_md_dqlp_mmr_xuerr1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XUERR2" */ +/* uncorrectable dir ecc group 2 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_xuerr2_u { + mmr_t sh_md_dqlp_mmr_xuerr2_regval; + struct { + mmr_t grp2 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 26; + } sh_md_dqlp_mmr_xuerr2_s; +} sh_md_dqlp_mmr_xuerr2_u_t; +#else +typedef union sh_md_dqlp_mmr_xuerr2_u { + mmr_t sh_md_dqlp_mmr_xuerr2_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp2 : 36; + } sh_md_dqlp_mmr_xuerr2_s; +} sh_md_dqlp_mmr_xuerr2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XPERR" */ +/* protocol error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_xperr_u { + mmr_t sh_md_dqlp_mmr_xperr_regval; + struct { + mmr_t dir : 26; + mmr_t cmd : 8; + mmr_t src : 14; + mmr_t prige : 1; + mmr_t priv : 1; + mmr_t cor : 1; + mmr_t unc : 1; + mmr_t mybit : 8; + mmr_t val : 1; + mmr_t more : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 1; + } sh_md_dqlp_mmr_xperr_s; +} sh_md_dqlp_mmr_xperr_u_t; +#else +typedef union sh_md_dqlp_mmr_xperr_u { + mmr_t sh_md_dqlp_mmr_xperr_regval; + struct { + mmr_t reserved_0 : 1; + mmr_t arm : 1; + mmr_t more : 1; + mmr_t val : 1; + mmr_t mybit : 8; + mmr_t unc : 1; + mmr_t cor : 1; + mmr_t priv : 1; + mmr_t prige : 1; + mmr_t src : 14; + mmr_t cmd : 8; + mmr_t dir : 26; + } sh_md_dqlp_mmr_xperr_s; +} sh_md_dqlp_mmr_xperr_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YCERR1" */ +/* correctable dir ecc group 1 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_ycerr1_u { + mmr_t sh_md_dqlp_mmr_ycerr1_regval; + struct { + mmr_t grp1 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 25; + } sh_md_dqlp_mmr_ycerr1_s; +} sh_md_dqlp_mmr_ycerr1_u_t; +#else +typedef union sh_md_dqlp_mmr_ycerr1_u { + mmr_t sh_md_dqlp_mmr_ycerr1_regval; + struct { + mmr_t reserved_0 : 25; + mmr_t arm : 1; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp1 : 36; + } sh_md_dqlp_mmr_ycerr1_s; +} sh_md_dqlp_mmr_ycerr1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YCERR2" */ +/* correctable dir ecc group 2 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_ycerr2_u { + mmr_t sh_md_dqlp_mmr_ycerr2_regval; + struct { + mmr_t grp2 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 26; + } sh_md_dqlp_mmr_ycerr2_s; +} sh_md_dqlp_mmr_ycerr2_u_t; +#else +typedef union sh_md_dqlp_mmr_ycerr2_u { + mmr_t sh_md_dqlp_mmr_ycerr2_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp2 : 36; + } sh_md_dqlp_mmr_ycerr2_s; +} sh_md_dqlp_mmr_ycerr2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YUERR1" */ +/* uncorrectable dir ecc group 1 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_yuerr1_u { + mmr_t sh_md_dqlp_mmr_yuerr1_regval; + struct { + mmr_t grp1 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 25; + } sh_md_dqlp_mmr_yuerr1_s; +} sh_md_dqlp_mmr_yuerr1_u_t; +#else +typedef union sh_md_dqlp_mmr_yuerr1_u { + mmr_t sh_md_dqlp_mmr_yuerr1_regval; + struct { + mmr_t reserved_0 : 25; + mmr_t arm : 1; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp1 : 36; + } sh_md_dqlp_mmr_yuerr1_s; +} sh_md_dqlp_mmr_yuerr1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YUERR2" */ +/* uncorrectable dir ecc group 2 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_yuerr2_u { + mmr_t sh_md_dqlp_mmr_yuerr2_regval; + struct { + mmr_t grp2 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 26; + } sh_md_dqlp_mmr_yuerr2_s; +} sh_md_dqlp_mmr_yuerr2_u_t; +#else +typedef union sh_md_dqlp_mmr_yuerr2_u { + mmr_t sh_md_dqlp_mmr_yuerr2_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp2 : 36; + } sh_md_dqlp_mmr_yuerr2_s; +} sh_md_dqlp_mmr_yuerr2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YPERR" */ +/* protocol error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_yperr_u { + mmr_t sh_md_dqlp_mmr_yperr_regval; + struct { + mmr_t dir : 26; + mmr_t cmd : 8; + mmr_t src : 14; + mmr_t prige : 1; + mmr_t priv : 1; + mmr_t cor : 1; + mmr_t unc : 1; + mmr_t mybit : 8; + mmr_t val : 1; + mmr_t more : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 1; + } sh_md_dqlp_mmr_yperr_s; +} sh_md_dqlp_mmr_yperr_u_t; +#else +typedef union sh_md_dqlp_mmr_yperr_u { + mmr_t sh_md_dqlp_mmr_yperr_regval; + struct { + mmr_t reserved_0 : 1; + mmr_t arm : 1; + mmr_t more : 1; + mmr_t val : 1; + mmr_t mybit : 8; + mmr_t unc : 1; + mmr_t cor : 1; + mmr_t priv : 1; + mmr_t prige : 1; + mmr_t src : 14; + mmr_t cmd : 8; + mmr_t dir : 26; + } sh_md_dqlp_mmr_yperr_s; +} sh_md_dqlp_mmr_yperr_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_CMDTRIG" */ +/* cmd triggers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_cmdtrig_u { + mmr_t sh_md_dqlp_mmr_dir_cmdtrig_regval; + struct { + mmr_t cmd0 : 8; + mmr_t cmd1 : 8; + mmr_t cmd2 : 8; + mmr_t cmd3 : 8; + mmr_t reserved_0 : 32; + } sh_md_dqlp_mmr_dir_cmdtrig_s; +} sh_md_dqlp_mmr_dir_cmdtrig_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_cmdtrig_u { + mmr_t sh_md_dqlp_mmr_dir_cmdtrig_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t cmd3 : 8; + mmr_t cmd2 : 8; + mmr_t cmd1 : 8; + mmr_t cmd0 : 8; + } sh_md_dqlp_mmr_dir_cmdtrig_s; +} sh_md_dqlp_mmr_dir_cmdtrig_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_TBLTRIG" */ +/* dir table trigger */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_tbltrig_u { + mmr_t sh_md_dqlp_mmr_dir_tbltrig_regval; + struct { + mmr_t src : 14; + mmr_t cmd : 8; + mmr_t acc : 2; + mmr_t prige : 1; + mmr_t dirst : 9; + mmr_t mybit : 8; + mmr_t reserved_0 : 22; + } sh_md_dqlp_mmr_dir_tbltrig_s; +} sh_md_dqlp_mmr_dir_tbltrig_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_tbltrig_u { + mmr_t sh_md_dqlp_mmr_dir_tbltrig_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t mybit : 8; + mmr_t dirst : 9; + mmr_t prige : 1; + mmr_t acc : 2; + mmr_t cmd : 8; + mmr_t src : 14; + } sh_md_dqlp_mmr_dir_tbltrig_s; +} sh_md_dqlp_mmr_dir_tbltrig_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_DIR_TBLMASK" */ +/* dir table trigger mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_dir_tblmask_u { + mmr_t sh_md_dqlp_mmr_dir_tblmask_regval; + struct { + mmr_t src : 14; + mmr_t cmd : 8; + mmr_t acc : 2; + mmr_t prige : 1; + mmr_t dirst : 9; + mmr_t mybit : 8; + mmr_t reserved_0 : 22; + } sh_md_dqlp_mmr_dir_tblmask_s; +} sh_md_dqlp_mmr_dir_tblmask_u_t; +#else +typedef union sh_md_dqlp_mmr_dir_tblmask_u { + mmr_t sh_md_dqlp_mmr_dir_tblmask_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t mybit : 8; + mmr_t dirst : 9; + mmr_t prige : 1; + mmr_t acc : 2; + mmr_t cmd : 8; + mmr_t src : 14; + } sh_md_dqlp_mmr_dir_tblmask_s; +} sh_md_dqlp_mmr_dir_tblmask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_xbist_h_u { + mmr_t sh_md_dqlp_mmr_xbist_h_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t arm : 1; + mmr_t reserved_1 : 21; + } sh_md_dqlp_mmr_xbist_h_s; +} sh_md_dqlp_mmr_xbist_h_u_t; +#else +typedef union sh_md_dqlp_mmr_xbist_h_u { + mmr_t sh_md_dqlp_mmr_xbist_h_regval; + struct { + mmr_t reserved_1 : 21; + mmr_t arm : 1; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqlp_mmr_xbist_h_s; +} sh_md_dqlp_mmr_xbist_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_xbist_l_u { + mmr_t sh_md_dqlp_mmr_xbist_l_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t reserved_1 : 22; + } sh_md_dqlp_mmr_xbist_l_s; +} sh_md_dqlp_mmr_xbist_l_u_t; +#else +typedef union sh_md_dqlp_mmr_xbist_l_u { + mmr_t sh_md_dqlp_mmr_xbist_l_regval; + struct { + mmr_t reserved_1 : 22; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqlp_mmr_xbist_l_s; +} sh_md_dqlp_mmr_xbist_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_xbist_err_h_u { + mmr_t sh_md_dqlp_mmr_xbist_err_h_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_1 : 22; + } sh_md_dqlp_mmr_xbist_err_h_s; +} sh_md_dqlp_mmr_xbist_err_h_u_t; +#else +typedef union sh_md_dqlp_mmr_xbist_err_h_u { + mmr_t sh_md_dqlp_mmr_xbist_err_h_regval; + struct { + mmr_t reserved_1 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqlp_mmr_xbist_err_h_s; +} sh_md_dqlp_mmr_xbist_err_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_XBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_xbist_err_l_u { + mmr_t sh_md_dqlp_mmr_xbist_err_l_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_1 : 22; + } sh_md_dqlp_mmr_xbist_err_l_s; +} sh_md_dqlp_mmr_xbist_err_l_u_t; +#else +typedef union sh_md_dqlp_mmr_xbist_err_l_u { + mmr_t sh_md_dqlp_mmr_xbist_err_l_regval; + struct { + mmr_t reserved_1 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqlp_mmr_xbist_err_l_s; +} sh_md_dqlp_mmr_xbist_err_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_ybist_h_u { + mmr_t sh_md_dqlp_mmr_ybist_h_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t arm : 1; + mmr_t reserved_1 : 21; + } sh_md_dqlp_mmr_ybist_h_s; +} sh_md_dqlp_mmr_ybist_h_u_t; +#else +typedef union sh_md_dqlp_mmr_ybist_h_u { + mmr_t sh_md_dqlp_mmr_ybist_h_regval; + struct { + mmr_t reserved_1 : 21; + mmr_t arm : 1; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqlp_mmr_ybist_h_s; +} sh_md_dqlp_mmr_ybist_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_ybist_l_u { + mmr_t sh_md_dqlp_mmr_ybist_l_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t reserved_1 : 22; + } sh_md_dqlp_mmr_ybist_l_s; +} sh_md_dqlp_mmr_ybist_l_u_t; +#else +typedef union sh_md_dqlp_mmr_ybist_l_u { + mmr_t sh_md_dqlp_mmr_ybist_l_regval; + struct { + mmr_t reserved_1 : 22; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqlp_mmr_ybist_l_s; +} sh_md_dqlp_mmr_ybist_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_ybist_err_h_u { + mmr_t sh_md_dqlp_mmr_ybist_err_h_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_1 : 22; + } sh_md_dqlp_mmr_ybist_err_h_s; +} sh_md_dqlp_mmr_ybist_err_h_u_t; +#else +typedef union sh_md_dqlp_mmr_ybist_err_h_u { + mmr_t sh_md_dqlp_mmr_ybist_err_h_regval; + struct { + mmr_t reserved_1 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqlp_mmr_ybist_err_h_s; +} sh_md_dqlp_mmr_ybist_err_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLP_MMR_YBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqlp_mmr_ybist_err_l_u { + mmr_t sh_md_dqlp_mmr_ybist_err_l_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_1 : 22; + } sh_md_dqlp_mmr_ybist_err_l_s; +} sh_md_dqlp_mmr_ybist_err_l_u_t; +#else +typedef union sh_md_dqlp_mmr_ybist_err_l_u { + mmr_t sh_md_dqlp_mmr_ybist_err_l_regval; + struct { + mmr_t reserved_1 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqlp_mmr_ybist_err_l_s; +} sh_md_dqlp_mmr_ybist_err_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_XBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqls_mmr_xbist_h_u { + mmr_t sh_md_dqls_mmr_xbist_h_regval; + struct { + mmr_t pat : 40; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 21; + } sh_md_dqls_mmr_xbist_h_s; +} sh_md_dqls_mmr_xbist_h_u_t; +#else +typedef union sh_md_dqls_mmr_xbist_h_u { + mmr_t sh_md_dqls_mmr_xbist_h_regval; + struct { + mmr_t reserved_0 : 21; + mmr_t arm : 1; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t pat : 40; + } sh_md_dqls_mmr_xbist_h_s; +} sh_md_dqls_mmr_xbist_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_XBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqls_mmr_xbist_l_u { + mmr_t sh_md_dqls_mmr_xbist_l_regval; + struct { + mmr_t pat : 40; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t reserved_0 : 22; + } sh_md_dqls_mmr_xbist_l_s; +} sh_md_dqls_mmr_xbist_l_u_t; +#else +typedef union sh_md_dqls_mmr_xbist_l_u { + mmr_t sh_md_dqls_mmr_xbist_l_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t pat : 40; + } sh_md_dqls_mmr_xbist_l_s; +} sh_md_dqls_mmr_xbist_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_XBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqls_mmr_xbist_err_h_u { + mmr_t sh_md_dqls_mmr_xbist_err_h_regval; + struct { + mmr_t pat : 40; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 22; + } sh_md_dqls_mmr_xbist_err_h_s; +} sh_md_dqls_mmr_xbist_err_h_u_t; +#else +typedef union sh_md_dqls_mmr_xbist_err_h_u { + mmr_t sh_md_dqls_mmr_xbist_err_h_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t pat : 40; + } sh_md_dqls_mmr_xbist_err_h_s; +} sh_md_dqls_mmr_xbist_err_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_XBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqls_mmr_xbist_err_l_u { + mmr_t sh_md_dqls_mmr_xbist_err_l_regval; + struct { + mmr_t pat : 40; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 22; + } sh_md_dqls_mmr_xbist_err_l_s; +} sh_md_dqls_mmr_xbist_err_l_u_t; +#else +typedef union sh_md_dqls_mmr_xbist_err_l_u { + mmr_t sh_md_dqls_mmr_xbist_err_l_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t pat : 40; + } sh_md_dqls_mmr_xbist_err_l_s; +} sh_md_dqls_mmr_xbist_err_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_YBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqls_mmr_ybist_h_u { + mmr_t sh_md_dqls_mmr_ybist_h_regval; + struct { + mmr_t pat : 40; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 21; + } sh_md_dqls_mmr_ybist_h_s; +} sh_md_dqls_mmr_ybist_h_u_t; +#else +typedef union sh_md_dqls_mmr_ybist_h_u { + mmr_t sh_md_dqls_mmr_ybist_h_regval; + struct { + mmr_t reserved_0 : 21; + mmr_t arm : 1; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t pat : 40; + } sh_md_dqls_mmr_ybist_h_s; +} sh_md_dqls_mmr_ybist_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_YBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqls_mmr_ybist_l_u { + mmr_t sh_md_dqls_mmr_ybist_l_regval; + struct { + mmr_t pat : 40; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t reserved_0 : 22; + } sh_md_dqls_mmr_ybist_l_s; +} sh_md_dqls_mmr_ybist_l_u_t; +#else +typedef union sh_md_dqls_mmr_ybist_l_u { + mmr_t sh_md_dqls_mmr_ybist_l_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t pat : 40; + } sh_md_dqls_mmr_ybist_l_s; +} sh_md_dqls_mmr_ybist_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_YBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqls_mmr_ybist_err_h_u { + mmr_t sh_md_dqls_mmr_ybist_err_h_regval; + struct { + mmr_t pat : 40; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 22; + } sh_md_dqls_mmr_ybist_err_h_s; +} sh_md_dqls_mmr_ybist_err_h_u_t; +#else +typedef union sh_md_dqls_mmr_ybist_err_h_u { + mmr_t sh_md_dqls_mmr_ybist_err_h_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t pat : 40; + } sh_md_dqls_mmr_ybist_err_h_s; +} sh_md_dqls_mmr_ybist_err_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_YBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqls_mmr_ybist_err_l_u { + mmr_t sh_md_dqls_mmr_ybist_err_l_regval; + struct { + mmr_t pat : 40; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 22; + } sh_md_dqls_mmr_ybist_err_l_s; +} sh_md_dqls_mmr_ybist_err_l_u_t; +#else +typedef union sh_md_dqls_mmr_ybist_err_l_u { + mmr_t sh_md_dqls_mmr_ybist_err_l_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t pat : 40; + } sh_md_dqls_mmr_ybist_err_l_s; +} sh_md_dqls_mmr_ybist_err_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_JNR_DEBUG" */ +/* joiner/fct debug configuration */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqls_mmr_jnr_debug_u { + mmr_t sh_md_dqls_mmr_jnr_debug_regval; + struct { + mmr_t px : 1; + mmr_t rw : 1; + mmr_t reserved_0 : 62; + } sh_md_dqls_mmr_jnr_debug_s; +} sh_md_dqls_mmr_jnr_debug_u_t; +#else +typedef union sh_md_dqls_mmr_jnr_debug_u { + mmr_t sh_md_dqls_mmr_jnr_debug_regval; + struct { + mmr_t reserved_0 : 62; + mmr_t rw : 1; + mmr_t px : 1; + } sh_md_dqls_mmr_jnr_debug_s; +} sh_md_dqls_mmr_jnr_debug_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQLS_MMR_XAMOPW_ERR" */ +/* amo/partial rmw ecc error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqls_mmr_xamopw_err_u { + mmr_t sh_md_dqls_mmr_xamopw_err_regval; + struct { + mmr_t ssyn : 8; + mmr_t scor : 1; + mmr_t sunc : 1; + mmr_t reserved_0 : 6; + mmr_t rsyn : 8; + mmr_t rcor : 1; + mmr_t runc : 1; + mmr_t reserved_1 : 6; + mmr_t arm : 1; + mmr_t reserved_2 : 31; + } sh_md_dqls_mmr_xamopw_err_s; +} sh_md_dqls_mmr_xamopw_err_u_t; +#else +typedef union sh_md_dqls_mmr_xamopw_err_u { + mmr_t sh_md_dqls_mmr_xamopw_err_regval; + struct { + mmr_t reserved_2 : 31; + mmr_t arm : 1; + mmr_t reserved_1 : 6; + mmr_t runc : 1; + mmr_t rcor : 1; + mmr_t rsyn : 8; + mmr_t reserved_0 : 6; + mmr_t sunc : 1; + mmr_t scor : 1; + mmr_t ssyn : 8; + } sh_md_dqls_mmr_xamopw_err_s; +} sh_md_dqls_mmr_xamopw_err_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_CONFIG" */ +/* DQ directory config register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_config_u { + mmr_t sh_md_dqrp_mmr_dir_config_regval; + struct { + mmr_t sys_size : 3; + mmr_t en_direcc : 1; + mmr_t en_dirpois : 1; + mmr_t reserved_0 : 59; + } sh_md_dqrp_mmr_dir_config_s; +} sh_md_dqrp_mmr_dir_config_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_config_u { + mmr_t sh_md_dqrp_mmr_dir_config_regval; + struct { + mmr_t reserved_0 : 59; + mmr_t en_dirpois : 1; + mmr_t en_direcc : 1; + mmr_t sys_size : 3; + } sh_md_dqrp_mmr_dir_config_s; +} sh_md_dqrp_mmr_dir_config_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRESVEC0" */ +/* node [63:0] presence bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_presvec0_u { + mmr_t sh_md_dqrp_mmr_dir_presvec0_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_presvec0_s; +} sh_md_dqrp_mmr_dir_presvec0_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_presvec0_u { + mmr_t sh_md_dqrp_mmr_dir_presvec0_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_presvec0_s; +} sh_md_dqrp_mmr_dir_presvec0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRESVEC1" */ +/* node [127:64] presence bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_presvec1_u { + mmr_t sh_md_dqrp_mmr_dir_presvec1_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_presvec1_s; +} sh_md_dqrp_mmr_dir_presvec1_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_presvec1_u { + mmr_t sh_md_dqrp_mmr_dir_presvec1_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_presvec1_s; +} sh_md_dqrp_mmr_dir_presvec1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRESVEC2" */ +/* node [191:128] presence bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_presvec2_u { + mmr_t sh_md_dqrp_mmr_dir_presvec2_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_presvec2_s; +} sh_md_dqrp_mmr_dir_presvec2_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_presvec2_u { + mmr_t sh_md_dqrp_mmr_dir_presvec2_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_presvec2_s; +} sh_md_dqrp_mmr_dir_presvec2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRESVEC3" */ +/* node [255:192] presence bits */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_presvec3_u { + mmr_t sh_md_dqrp_mmr_dir_presvec3_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_presvec3_s; +} sh_md_dqrp_mmr_dir_presvec3_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_presvec3_u { + mmr_t sh_md_dqrp_mmr_dir_presvec3_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_presvec3_s; +} sh_md_dqrp_mmr_dir_presvec3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC0" */ +/* local vector for acc=0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_locvec0_u { + mmr_t sh_md_dqrp_mmr_dir_locvec0_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec0_s; +} sh_md_dqrp_mmr_dir_locvec0_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_locvec0_u { + mmr_t sh_md_dqrp_mmr_dir_locvec0_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec0_s; +} sh_md_dqrp_mmr_dir_locvec0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC1" */ +/* local vector for acc=1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_locvec1_u { + mmr_t sh_md_dqrp_mmr_dir_locvec1_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec1_s; +} sh_md_dqrp_mmr_dir_locvec1_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_locvec1_u { + mmr_t sh_md_dqrp_mmr_dir_locvec1_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec1_s; +} sh_md_dqrp_mmr_dir_locvec1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC2" */ +/* local vector for acc=2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_locvec2_u { + mmr_t sh_md_dqrp_mmr_dir_locvec2_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec2_s; +} sh_md_dqrp_mmr_dir_locvec2_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_locvec2_u { + mmr_t sh_md_dqrp_mmr_dir_locvec2_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec2_s; +} sh_md_dqrp_mmr_dir_locvec2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC3" */ +/* local vector for acc=3 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_locvec3_u { + mmr_t sh_md_dqrp_mmr_dir_locvec3_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec3_s; +} sh_md_dqrp_mmr_dir_locvec3_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_locvec3_u { + mmr_t sh_md_dqrp_mmr_dir_locvec3_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec3_s; +} sh_md_dqrp_mmr_dir_locvec3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC4" */ +/* local vector for acc=4 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_locvec4_u { + mmr_t sh_md_dqrp_mmr_dir_locvec4_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec4_s; +} sh_md_dqrp_mmr_dir_locvec4_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_locvec4_u { + mmr_t sh_md_dqrp_mmr_dir_locvec4_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec4_s; +} sh_md_dqrp_mmr_dir_locvec4_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC5" */ +/* local vector for acc=5 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_locvec5_u { + mmr_t sh_md_dqrp_mmr_dir_locvec5_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec5_s; +} sh_md_dqrp_mmr_dir_locvec5_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_locvec5_u { + mmr_t sh_md_dqrp_mmr_dir_locvec5_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec5_s; +} sh_md_dqrp_mmr_dir_locvec5_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC6" */ +/* local vector for acc=6 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_locvec6_u { + mmr_t sh_md_dqrp_mmr_dir_locvec6_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec6_s; +} sh_md_dqrp_mmr_dir_locvec6_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_locvec6_u { + mmr_t sh_md_dqrp_mmr_dir_locvec6_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec6_s; +} sh_md_dqrp_mmr_dir_locvec6_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC7" */ +/* local vector for acc=7 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_locvec7_u { + mmr_t sh_md_dqrp_mmr_dir_locvec7_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec7_s; +} sh_md_dqrp_mmr_dir_locvec7_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_locvec7_u { + mmr_t sh_md_dqrp_mmr_dir_locvec7_regval; + struct { + mmr_t vec : 64; + } sh_md_dqrp_mmr_dir_locvec7_s; +} sh_md_dqrp_mmr_dir_locvec7_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC0" */ +/* privilege vector for acc=0 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_privec0_u { + mmr_t sh_md_dqrp_mmr_dir_privec0_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqrp_mmr_dir_privec0_s; +} sh_md_dqrp_mmr_dir_privec0_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_privec0_u { + mmr_t sh_md_dqrp_mmr_dir_privec0_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqrp_mmr_dir_privec0_s; +} sh_md_dqrp_mmr_dir_privec0_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC1" */ +/* privilege vector for acc=1 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_privec1_u { + mmr_t sh_md_dqrp_mmr_dir_privec1_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqrp_mmr_dir_privec1_s; +} sh_md_dqrp_mmr_dir_privec1_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_privec1_u { + mmr_t sh_md_dqrp_mmr_dir_privec1_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqrp_mmr_dir_privec1_s; +} sh_md_dqrp_mmr_dir_privec1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC2" */ +/* privilege vector for acc=2 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_privec2_u { + mmr_t sh_md_dqrp_mmr_dir_privec2_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqrp_mmr_dir_privec2_s; +} sh_md_dqrp_mmr_dir_privec2_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_privec2_u { + mmr_t sh_md_dqrp_mmr_dir_privec2_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqrp_mmr_dir_privec2_s; +} sh_md_dqrp_mmr_dir_privec2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC3" */ +/* privilege vector for acc=3 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_privec3_u { + mmr_t sh_md_dqrp_mmr_dir_privec3_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqrp_mmr_dir_privec3_s; +} sh_md_dqrp_mmr_dir_privec3_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_privec3_u { + mmr_t sh_md_dqrp_mmr_dir_privec3_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqrp_mmr_dir_privec3_s; +} sh_md_dqrp_mmr_dir_privec3_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC4" */ +/* privilege vector for acc=4 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_privec4_u { + mmr_t sh_md_dqrp_mmr_dir_privec4_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqrp_mmr_dir_privec4_s; +} sh_md_dqrp_mmr_dir_privec4_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_privec4_u { + mmr_t sh_md_dqrp_mmr_dir_privec4_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqrp_mmr_dir_privec4_s; +} sh_md_dqrp_mmr_dir_privec4_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC5" */ +/* privilege vector for acc=5 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_privec5_u { + mmr_t sh_md_dqrp_mmr_dir_privec5_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqrp_mmr_dir_privec5_s; +} sh_md_dqrp_mmr_dir_privec5_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_privec5_u { + mmr_t sh_md_dqrp_mmr_dir_privec5_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqrp_mmr_dir_privec5_s; +} sh_md_dqrp_mmr_dir_privec5_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC6" */ +/* privilege vector for acc=6 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_privec6_u { + mmr_t sh_md_dqrp_mmr_dir_privec6_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqrp_mmr_dir_privec6_s; +} sh_md_dqrp_mmr_dir_privec6_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_privec6_u { + mmr_t sh_md_dqrp_mmr_dir_privec6_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqrp_mmr_dir_privec6_s; +} sh_md_dqrp_mmr_dir_privec6_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC7" */ +/* privilege vector for acc=7 */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_privec7_u { + mmr_t sh_md_dqrp_mmr_dir_privec7_regval; + struct { + mmr_t in : 14; + mmr_t out : 14; + mmr_t reserved_0 : 36; + } sh_md_dqrp_mmr_dir_privec7_s; +} sh_md_dqrp_mmr_dir_privec7_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_privec7_u { + mmr_t sh_md_dqrp_mmr_dir_privec7_regval; + struct { + mmr_t reserved_0 : 36; + mmr_t out : 14; + mmr_t in : 14; + } sh_md_dqrp_mmr_dir_privec7_s; +} sh_md_dqrp_mmr_dir_privec7_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_TIMER" */ +/* MD SXRO timer */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_timer_u { + mmr_t sh_md_dqrp_mmr_dir_timer_regval; + struct { + mmr_t timer_div : 12; + mmr_t timer_en : 1; + mmr_t timer_cur : 9; + mmr_t reserved_0 : 42; + } sh_md_dqrp_mmr_dir_timer_s; +} sh_md_dqrp_mmr_dir_timer_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_timer_u { + mmr_t sh_md_dqrp_mmr_dir_timer_regval; + struct { + mmr_t reserved_0 : 42; + mmr_t timer_cur : 9; + mmr_t timer_en : 1; + mmr_t timer_div : 12; + } sh_md_dqrp_mmr_dir_timer_s; +} sh_md_dqrp_mmr_dir_timer_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY" */ +/* directory pio write data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_piowd_dir_entry_u { + mmr_t sh_md_dqrp_mmr_piowd_dir_entry_regval; + struct { + mmr_t dira : 26; + mmr_t dirb : 26; + mmr_t pri : 3; + mmr_t acc : 3; + mmr_t reserved_0 : 6; + } sh_md_dqrp_mmr_piowd_dir_entry_s; +} sh_md_dqrp_mmr_piowd_dir_entry_u_t; +#else +typedef union sh_md_dqrp_mmr_piowd_dir_entry_u { + mmr_t sh_md_dqrp_mmr_piowd_dir_entry_regval; + struct { + mmr_t reserved_0 : 6; + mmr_t acc : 3; + mmr_t pri : 3; + mmr_t dirb : 26; + mmr_t dira : 26; + } sh_md_dqrp_mmr_piowd_dir_entry_s; +} sh_md_dqrp_mmr_piowd_dir_entry_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_PIOWD_DIR_ECC" */ +/* directory ecc register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_piowd_dir_ecc_u { + mmr_t sh_md_dqrp_mmr_piowd_dir_ecc_regval; + struct { + mmr_t ecca : 7; + mmr_t eccb : 7; + mmr_t reserved_0 : 50; + } sh_md_dqrp_mmr_piowd_dir_ecc_s; +} sh_md_dqrp_mmr_piowd_dir_ecc_u_t; +#else +typedef union sh_md_dqrp_mmr_piowd_dir_ecc_u { + mmr_t sh_md_dqrp_mmr_piowd_dir_ecc_regval; + struct { + mmr_t reserved_0 : 50; + mmr_t eccb : 7; + mmr_t ecca : 7; + } sh_md_dqrp_mmr_piowd_dir_ecc_s; +} sh_md_dqrp_mmr_piowd_dir_ecc_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY" */ +/* x directory pio read data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_xpiord_xdir_entry_u { + mmr_t sh_md_dqrp_mmr_xpiord_xdir_entry_regval; + struct { + mmr_t dira : 26; + mmr_t dirb : 26; + mmr_t pri : 3; + mmr_t acc : 3; + mmr_t cor : 1; + mmr_t unc : 1; + mmr_t reserved_0 : 4; + } sh_md_dqrp_mmr_xpiord_xdir_entry_s; +} sh_md_dqrp_mmr_xpiord_xdir_entry_u_t; +#else +typedef union sh_md_dqrp_mmr_xpiord_xdir_entry_u { + mmr_t sh_md_dqrp_mmr_xpiord_xdir_entry_regval; + struct { + mmr_t reserved_0 : 4; + mmr_t unc : 1; + mmr_t cor : 1; + mmr_t acc : 3; + mmr_t pri : 3; + mmr_t dirb : 26; + mmr_t dira : 26; + } sh_md_dqrp_mmr_xpiord_xdir_entry_s; +} sh_md_dqrp_mmr_xpiord_xdir_entry_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XPIORD_XDIR_ECC" */ +/* x directory ecc */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_xpiord_xdir_ecc_u { + mmr_t sh_md_dqrp_mmr_xpiord_xdir_ecc_regval; + struct { + mmr_t ecca : 7; + mmr_t eccb : 7; + mmr_t reserved_0 : 50; + } sh_md_dqrp_mmr_xpiord_xdir_ecc_s; +} sh_md_dqrp_mmr_xpiord_xdir_ecc_u_t; +#else +typedef union sh_md_dqrp_mmr_xpiord_xdir_ecc_u { + mmr_t sh_md_dqrp_mmr_xpiord_xdir_ecc_regval; + struct { + mmr_t reserved_0 : 50; + mmr_t eccb : 7; + mmr_t ecca : 7; + } sh_md_dqrp_mmr_xpiord_xdir_ecc_s; +} sh_md_dqrp_mmr_xpiord_xdir_ecc_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY" */ +/* y directory pio read data */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_ypiord_ydir_entry_u { + mmr_t sh_md_dqrp_mmr_ypiord_ydir_entry_regval; + struct { + mmr_t dira : 26; + mmr_t dirb : 26; + mmr_t pri : 3; + mmr_t acc : 3; + mmr_t cor : 1; + mmr_t unc : 1; + mmr_t reserved_0 : 4; + } sh_md_dqrp_mmr_ypiord_ydir_entry_s; +} sh_md_dqrp_mmr_ypiord_ydir_entry_u_t; +#else +typedef union sh_md_dqrp_mmr_ypiord_ydir_entry_u { + mmr_t sh_md_dqrp_mmr_ypiord_ydir_entry_regval; + struct { + mmr_t reserved_0 : 4; + mmr_t unc : 1; + mmr_t cor : 1; + mmr_t acc : 3; + mmr_t pri : 3; + mmr_t dirb : 26; + mmr_t dira : 26; + } sh_md_dqrp_mmr_ypiord_ydir_entry_s; +} sh_md_dqrp_mmr_ypiord_ydir_entry_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YPIORD_YDIR_ECC" */ +/* y directory ecc */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_ypiord_ydir_ecc_u { + mmr_t sh_md_dqrp_mmr_ypiord_ydir_ecc_regval; + struct { + mmr_t ecca : 7; + mmr_t eccb : 7; + mmr_t reserved_0 : 50; + } sh_md_dqrp_mmr_ypiord_ydir_ecc_s; +} sh_md_dqrp_mmr_ypiord_ydir_ecc_u_t; +#else +typedef union sh_md_dqrp_mmr_ypiord_ydir_ecc_u { + mmr_t sh_md_dqrp_mmr_ypiord_ydir_ecc_regval; + struct { + mmr_t reserved_0 : 50; + mmr_t eccb : 7; + mmr_t ecca : 7; + } sh_md_dqrp_mmr_ypiord_ydir_ecc_s; +} sh_md_dqrp_mmr_ypiord_ydir_ecc_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XCERR1" */ +/* correctable dir ecc group 1 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_xcerr1_u { + mmr_t sh_md_dqrp_mmr_xcerr1_regval; + struct { + mmr_t grp1 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 25; + } sh_md_dqrp_mmr_xcerr1_s; +} sh_md_dqrp_mmr_xcerr1_u_t; +#else +typedef union sh_md_dqrp_mmr_xcerr1_u { + mmr_t sh_md_dqrp_mmr_xcerr1_regval; + struct { + mmr_t reserved_0 : 25; + mmr_t arm : 1; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp1 : 36; + } sh_md_dqrp_mmr_xcerr1_s; +} sh_md_dqrp_mmr_xcerr1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XCERR2" */ +/* correctable dir ecc group 2 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_xcerr2_u { + mmr_t sh_md_dqrp_mmr_xcerr2_regval; + struct { + mmr_t grp2 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 26; + } sh_md_dqrp_mmr_xcerr2_s; +} sh_md_dqrp_mmr_xcerr2_u_t; +#else +typedef union sh_md_dqrp_mmr_xcerr2_u { + mmr_t sh_md_dqrp_mmr_xcerr2_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp2 : 36; + } sh_md_dqrp_mmr_xcerr2_s; +} sh_md_dqrp_mmr_xcerr2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XUERR1" */ +/* uncorrectable dir ecc group 1 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_xuerr1_u { + mmr_t sh_md_dqrp_mmr_xuerr1_regval; + struct { + mmr_t grp1 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 25; + } sh_md_dqrp_mmr_xuerr1_s; +} sh_md_dqrp_mmr_xuerr1_u_t; +#else +typedef union sh_md_dqrp_mmr_xuerr1_u { + mmr_t sh_md_dqrp_mmr_xuerr1_regval; + struct { + mmr_t reserved_0 : 25; + mmr_t arm : 1; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp1 : 36; + } sh_md_dqrp_mmr_xuerr1_s; +} sh_md_dqrp_mmr_xuerr1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XUERR2" */ +/* uncorrectable dir ecc group 2 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_xuerr2_u { + mmr_t sh_md_dqrp_mmr_xuerr2_regval; + struct { + mmr_t grp2 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 26; + } sh_md_dqrp_mmr_xuerr2_s; +} sh_md_dqrp_mmr_xuerr2_u_t; +#else +typedef union sh_md_dqrp_mmr_xuerr2_u { + mmr_t sh_md_dqrp_mmr_xuerr2_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp2 : 36; + } sh_md_dqrp_mmr_xuerr2_s; +} sh_md_dqrp_mmr_xuerr2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XPERR" */ +/* protocol error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_xperr_u { + mmr_t sh_md_dqrp_mmr_xperr_regval; + struct { + mmr_t dir : 26; + mmr_t cmd : 8; + mmr_t src : 14; + mmr_t prige : 1; + mmr_t priv : 1; + mmr_t cor : 1; + mmr_t unc : 1; + mmr_t mybit : 8; + mmr_t val : 1; + mmr_t more : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 1; + } sh_md_dqrp_mmr_xperr_s; +} sh_md_dqrp_mmr_xperr_u_t; +#else +typedef union sh_md_dqrp_mmr_xperr_u { + mmr_t sh_md_dqrp_mmr_xperr_regval; + struct { + mmr_t reserved_0 : 1; + mmr_t arm : 1; + mmr_t more : 1; + mmr_t val : 1; + mmr_t mybit : 8; + mmr_t unc : 1; + mmr_t cor : 1; + mmr_t priv : 1; + mmr_t prige : 1; + mmr_t src : 14; + mmr_t cmd : 8; + mmr_t dir : 26; + } sh_md_dqrp_mmr_xperr_s; +} sh_md_dqrp_mmr_xperr_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YCERR1" */ +/* correctable dir ecc group 1 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_ycerr1_u { + mmr_t sh_md_dqrp_mmr_ycerr1_regval; + struct { + mmr_t grp1 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 25; + } sh_md_dqrp_mmr_ycerr1_s; +} sh_md_dqrp_mmr_ycerr1_u_t; +#else +typedef union sh_md_dqrp_mmr_ycerr1_u { + mmr_t sh_md_dqrp_mmr_ycerr1_regval; + struct { + mmr_t reserved_0 : 25; + mmr_t arm : 1; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp1 : 36; + } sh_md_dqrp_mmr_ycerr1_s; +} sh_md_dqrp_mmr_ycerr1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YCERR2" */ +/* correctable dir ecc group 2 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_ycerr2_u { + mmr_t sh_md_dqrp_mmr_ycerr2_regval; + struct { + mmr_t grp2 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 26; + } sh_md_dqrp_mmr_ycerr2_s; +} sh_md_dqrp_mmr_ycerr2_u_t; +#else +typedef union sh_md_dqrp_mmr_ycerr2_u { + mmr_t sh_md_dqrp_mmr_ycerr2_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp2 : 36; + } sh_md_dqrp_mmr_ycerr2_s; +} sh_md_dqrp_mmr_ycerr2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YUERR1" */ +/* uncorrectable dir ecc group 1 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_yuerr1_u { + mmr_t sh_md_dqrp_mmr_yuerr1_regval; + struct { + mmr_t grp1 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 25; + } sh_md_dqrp_mmr_yuerr1_s; +} sh_md_dqrp_mmr_yuerr1_u_t; +#else +typedef union sh_md_dqrp_mmr_yuerr1_u { + mmr_t sh_md_dqrp_mmr_yuerr1_regval; + struct { + mmr_t reserved_0 : 25; + mmr_t arm : 1; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp1 : 36; + } sh_md_dqrp_mmr_yuerr1_s; +} sh_md_dqrp_mmr_yuerr1_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YUERR2" */ +/* uncorrectable dir ecc group 2 error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_yuerr2_u { + mmr_t sh_md_dqrp_mmr_yuerr2_regval; + struct { + mmr_t grp2 : 36; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 26; + } sh_md_dqrp_mmr_yuerr2_s; +} sh_md_dqrp_mmr_yuerr2_u_t; +#else +typedef union sh_md_dqrp_mmr_yuerr2_u { + mmr_t sh_md_dqrp_mmr_yuerr2_regval; + struct { + mmr_t reserved_0 : 26; + mmr_t more : 1; + mmr_t val : 1; + mmr_t grp2 : 36; + } sh_md_dqrp_mmr_yuerr2_s; +} sh_md_dqrp_mmr_yuerr2_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YPERR" */ +/* protocol error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_yperr_u { + mmr_t sh_md_dqrp_mmr_yperr_regval; + struct { + mmr_t dir : 26; + mmr_t cmd : 8; + mmr_t src : 14; + mmr_t prige : 1; + mmr_t priv : 1; + mmr_t cor : 1; + mmr_t unc : 1; + mmr_t mybit : 8; + mmr_t val : 1; + mmr_t more : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 1; + } sh_md_dqrp_mmr_yperr_s; +} sh_md_dqrp_mmr_yperr_u_t; +#else +typedef union sh_md_dqrp_mmr_yperr_u { + mmr_t sh_md_dqrp_mmr_yperr_regval; + struct { + mmr_t reserved_0 : 1; + mmr_t arm : 1; + mmr_t more : 1; + mmr_t val : 1; + mmr_t mybit : 8; + mmr_t unc : 1; + mmr_t cor : 1; + mmr_t priv : 1; + mmr_t prige : 1; + mmr_t src : 14; + mmr_t cmd : 8; + mmr_t dir : 26; + } sh_md_dqrp_mmr_yperr_s; +} sh_md_dqrp_mmr_yperr_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_CMDTRIG" */ +/* cmd triggers */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_cmdtrig_u { + mmr_t sh_md_dqrp_mmr_dir_cmdtrig_regval; + struct { + mmr_t cmd0 : 8; + mmr_t cmd1 : 8; + mmr_t cmd2 : 8; + mmr_t cmd3 : 8; + mmr_t reserved_0 : 32; + } sh_md_dqrp_mmr_dir_cmdtrig_s; +} sh_md_dqrp_mmr_dir_cmdtrig_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_cmdtrig_u { + mmr_t sh_md_dqrp_mmr_dir_cmdtrig_regval; + struct { + mmr_t reserved_0 : 32; + mmr_t cmd3 : 8; + mmr_t cmd2 : 8; + mmr_t cmd1 : 8; + mmr_t cmd0 : 8; + } sh_md_dqrp_mmr_dir_cmdtrig_s; +} sh_md_dqrp_mmr_dir_cmdtrig_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_TBLTRIG" */ +/* dir table trigger */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_tbltrig_u { + mmr_t sh_md_dqrp_mmr_dir_tbltrig_regval; + struct { + mmr_t src : 14; + mmr_t cmd : 8; + mmr_t acc : 2; + mmr_t prige : 1; + mmr_t dirst : 9; + mmr_t mybit : 8; + mmr_t reserved_0 : 22; + } sh_md_dqrp_mmr_dir_tbltrig_s; +} sh_md_dqrp_mmr_dir_tbltrig_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_tbltrig_u { + mmr_t sh_md_dqrp_mmr_dir_tbltrig_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t mybit : 8; + mmr_t dirst : 9; + mmr_t prige : 1; + mmr_t acc : 2; + mmr_t cmd : 8; + mmr_t src : 14; + } sh_md_dqrp_mmr_dir_tbltrig_s; +} sh_md_dqrp_mmr_dir_tbltrig_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_DIR_TBLMASK" */ +/* dir table trigger mask */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_dir_tblmask_u { + mmr_t sh_md_dqrp_mmr_dir_tblmask_regval; + struct { + mmr_t src : 14; + mmr_t cmd : 8; + mmr_t acc : 2; + mmr_t prige : 1; + mmr_t dirst : 9; + mmr_t mybit : 8; + mmr_t reserved_0 : 22; + } sh_md_dqrp_mmr_dir_tblmask_s; +} sh_md_dqrp_mmr_dir_tblmask_u_t; +#else +typedef union sh_md_dqrp_mmr_dir_tblmask_u { + mmr_t sh_md_dqrp_mmr_dir_tblmask_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t mybit : 8; + mmr_t dirst : 9; + mmr_t prige : 1; + mmr_t acc : 2; + mmr_t cmd : 8; + mmr_t src : 14; + } sh_md_dqrp_mmr_dir_tblmask_s; +} sh_md_dqrp_mmr_dir_tblmask_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_xbist_h_u { + mmr_t sh_md_dqrp_mmr_xbist_h_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t arm : 1; + mmr_t reserved_1 : 21; + } sh_md_dqrp_mmr_xbist_h_s; +} sh_md_dqrp_mmr_xbist_h_u_t; +#else +typedef union sh_md_dqrp_mmr_xbist_h_u { + mmr_t sh_md_dqrp_mmr_xbist_h_regval; + struct { + mmr_t reserved_1 : 21; + mmr_t arm : 1; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqrp_mmr_xbist_h_s; +} sh_md_dqrp_mmr_xbist_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_xbist_l_u { + mmr_t sh_md_dqrp_mmr_xbist_l_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t reserved_1 : 22; + } sh_md_dqrp_mmr_xbist_l_s; +} sh_md_dqrp_mmr_xbist_l_u_t; +#else +typedef union sh_md_dqrp_mmr_xbist_l_u { + mmr_t sh_md_dqrp_mmr_xbist_l_regval; + struct { + mmr_t reserved_1 : 22; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqrp_mmr_xbist_l_s; +} sh_md_dqrp_mmr_xbist_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_xbist_err_h_u { + mmr_t sh_md_dqrp_mmr_xbist_err_h_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_1 : 22; + } sh_md_dqrp_mmr_xbist_err_h_s; +} sh_md_dqrp_mmr_xbist_err_h_u_t; +#else +typedef union sh_md_dqrp_mmr_xbist_err_h_u { + mmr_t sh_md_dqrp_mmr_xbist_err_h_regval; + struct { + mmr_t reserved_1 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqrp_mmr_xbist_err_h_s; +} sh_md_dqrp_mmr_xbist_err_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_XBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_xbist_err_l_u { + mmr_t sh_md_dqrp_mmr_xbist_err_l_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_1 : 22; + } sh_md_dqrp_mmr_xbist_err_l_s; +} sh_md_dqrp_mmr_xbist_err_l_u_t; +#else +typedef union sh_md_dqrp_mmr_xbist_err_l_u { + mmr_t sh_md_dqrp_mmr_xbist_err_l_regval; + struct { + mmr_t reserved_1 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqrp_mmr_xbist_err_l_s; +} sh_md_dqrp_mmr_xbist_err_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_ybist_h_u { + mmr_t sh_md_dqrp_mmr_ybist_h_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t arm : 1; + mmr_t reserved_1 : 21; + } sh_md_dqrp_mmr_ybist_h_s; +} sh_md_dqrp_mmr_ybist_h_u_t; +#else +typedef union sh_md_dqrp_mmr_ybist_h_u { + mmr_t sh_md_dqrp_mmr_ybist_h_regval; + struct { + mmr_t reserved_1 : 21; + mmr_t arm : 1; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqrp_mmr_ybist_h_s; +} sh_md_dqrp_mmr_ybist_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_ybist_l_u { + mmr_t sh_md_dqrp_mmr_ybist_l_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t reserved_1 : 22; + } sh_md_dqrp_mmr_ybist_l_s; +} sh_md_dqrp_mmr_ybist_l_u_t; +#else +typedef union sh_md_dqrp_mmr_ybist_l_u { + mmr_t sh_md_dqrp_mmr_ybist_l_regval; + struct { + mmr_t reserved_1 : 22; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqrp_mmr_ybist_l_s; +} sh_md_dqrp_mmr_ybist_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_ybist_err_h_u { + mmr_t sh_md_dqrp_mmr_ybist_err_h_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_1 : 22; + } sh_md_dqrp_mmr_ybist_err_h_s; +} sh_md_dqrp_mmr_ybist_err_h_u_t; +#else +typedef union sh_md_dqrp_mmr_ybist_err_h_u { + mmr_t sh_md_dqrp_mmr_ybist_err_h_regval; + struct { + mmr_t reserved_1 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqrp_mmr_ybist_err_h_s; +} sh_md_dqrp_mmr_ybist_err_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRP_MMR_YBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrp_mmr_ybist_err_l_u { + mmr_t sh_md_dqrp_mmr_ybist_err_l_regval; + struct { + mmr_t pat : 32; + mmr_t reserved_0 : 8; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_1 : 22; + } sh_md_dqrp_mmr_ybist_err_l_s; +} sh_md_dqrp_mmr_ybist_err_l_u_t; +#else +typedef union sh_md_dqrp_mmr_ybist_err_l_u { + mmr_t sh_md_dqrp_mmr_ybist_err_l_regval; + struct { + mmr_t reserved_1 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t reserved_0 : 8; + mmr_t pat : 32; + } sh_md_dqrp_mmr_ybist_err_l_s; +} sh_md_dqrp_mmr_ybist_err_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_XBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrs_mmr_xbist_h_u { + mmr_t sh_md_dqrs_mmr_xbist_h_regval; + struct { + mmr_t pat : 40; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 21; + } sh_md_dqrs_mmr_xbist_h_s; +} sh_md_dqrs_mmr_xbist_h_u_t; +#else +typedef union sh_md_dqrs_mmr_xbist_h_u { + mmr_t sh_md_dqrs_mmr_xbist_h_regval; + struct { + mmr_t reserved_0 : 21; + mmr_t arm : 1; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t pat : 40; + } sh_md_dqrs_mmr_xbist_h_s; +} sh_md_dqrs_mmr_xbist_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_XBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrs_mmr_xbist_l_u { + mmr_t sh_md_dqrs_mmr_xbist_l_regval; + struct { + mmr_t pat : 40; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t reserved_0 : 22; + } sh_md_dqrs_mmr_xbist_l_s; +} sh_md_dqrs_mmr_xbist_l_u_t; +#else +typedef union sh_md_dqrs_mmr_xbist_l_u { + mmr_t sh_md_dqrs_mmr_xbist_l_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t pat : 40; + } sh_md_dqrs_mmr_xbist_l_s; +} sh_md_dqrs_mmr_xbist_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_XBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrs_mmr_xbist_err_h_u { + mmr_t sh_md_dqrs_mmr_xbist_err_h_regval; + struct { + mmr_t pat : 40; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 22; + } sh_md_dqrs_mmr_xbist_err_h_s; +} sh_md_dqrs_mmr_xbist_err_h_u_t; +#else +typedef union sh_md_dqrs_mmr_xbist_err_h_u { + mmr_t sh_md_dqrs_mmr_xbist_err_h_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t pat : 40; + } sh_md_dqrs_mmr_xbist_err_h_s; +} sh_md_dqrs_mmr_xbist_err_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_XBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrs_mmr_xbist_err_l_u { + mmr_t sh_md_dqrs_mmr_xbist_err_l_regval; + struct { + mmr_t pat : 40; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 22; + } sh_md_dqrs_mmr_xbist_err_l_s; +} sh_md_dqrs_mmr_xbist_err_l_u_t; +#else +typedef union sh_md_dqrs_mmr_xbist_err_l_u { + mmr_t sh_md_dqrs_mmr_xbist_err_l_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t pat : 40; + } sh_md_dqrs_mmr_xbist_err_l_s; +} sh_md_dqrs_mmr_xbist_err_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_YBIST_H" */ +/* rising edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrs_mmr_ybist_h_u { + mmr_t sh_md_dqrs_mmr_ybist_h_regval; + struct { + mmr_t pat : 40; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t arm : 1; + mmr_t reserved_0 : 21; + } sh_md_dqrs_mmr_ybist_h_s; +} sh_md_dqrs_mmr_ybist_h_u_t; +#else +typedef union sh_md_dqrs_mmr_ybist_h_u { + mmr_t sh_md_dqrs_mmr_ybist_h_regval; + struct { + mmr_t reserved_0 : 21; + mmr_t arm : 1; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t pat : 40; + } sh_md_dqrs_mmr_ybist_h_s; +} sh_md_dqrs_mmr_ybist_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_YBIST_L" */ +/* falling edge bist/fill pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrs_mmr_ybist_l_u { + mmr_t sh_md_dqrs_mmr_ybist_l_regval; + struct { + mmr_t pat : 40; + mmr_t inv : 1; + mmr_t rot : 1; + mmr_t reserved_0 : 22; + } sh_md_dqrs_mmr_ybist_l_s; +} sh_md_dqrs_mmr_ybist_l_u_t; +#else +typedef union sh_md_dqrs_mmr_ybist_l_u { + mmr_t sh_md_dqrs_mmr_ybist_l_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t rot : 1; + mmr_t inv : 1; + mmr_t pat : 40; + } sh_md_dqrs_mmr_ybist_l_s; +} sh_md_dqrs_mmr_ybist_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_YBIST_ERR_H" */ +/* rising edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrs_mmr_ybist_err_h_u { + mmr_t sh_md_dqrs_mmr_ybist_err_h_regval; + struct { + mmr_t pat : 40; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 22; + } sh_md_dqrs_mmr_ybist_err_h_s; +} sh_md_dqrs_mmr_ybist_err_h_u_t; +#else +typedef union sh_md_dqrs_mmr_ybist_err_h_u { + mmr_t sh_md_dqrs_mmr_ybist_err_h_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t pat : 40; + } sh_md_dqrs_mmr_ybist_err_h_s; +} sh_md_dqrs_mmr_ybist_err_h_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_YBIST_ERR_L" */ +/* falling edge bist error pattern */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrs_mmr_ybist_err_l_u { + mmr_t sh_md_dqrs_mmr_ybist_err_l_regval; + struct { + mmr_t pat : 40; + mmr_t val : 1; + mmr_t more : 1; + mmr_t reserved_0 : 22; + } sh_md_dqrs_mmr_ybist_err_l_s; +} sh_md_dqrs_mmr_ybist_err_l_u_t; +#else +typedef union sh_md_dqrs_mmr_ybist_err_l_u { + mmr_t sh_md_dqrs_mmr_ybist_err_l_regval; + struct { + mmr_t reserved_0 : 22; + mmr_t more : 1; + mmr_t val : 1; + mmr_t pat : 40; + } sh_md_dqrs_mmr_ybist_err_l_s; +} sh_md_dqrs_mmr_ybist_err_l_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_JNR_DEBUG" */ +/* joiner/fct debug configuration */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrs_mmr_jnr_debug_u { + mmr_t sh_md_dqrs_mmr_jnr_debug_regval; + struct { + mmr_t px : 1; + mmr_t rw : 1; + mmr_t reserved_0 : 62; + } sh_md_dqrs_mmr_jnr_debug_s; +} sh_md_dqrs_mmr_jnr_debug_u_t; +#else +typedef union sh_md_dqrs_mmr_jnr_debug_u { + mmr_t sh_md_dqrs_mmr_jnr_debug_regval; + struct { + mmr_t reserved_0 : 62; + mmr_t rw : 1; + mmr_t px : 1; + } sh_md_dqrs_mmr_jnr_debug_s; +} sh_md_dqrs_mmr_jnr_debug_u_t; +#endif + +/* ==================================================================== */ +/* Register "SH_MD_DQRS_MMR_YAMOPW_ERR" */ +/* amo/partial rmw ecc error register */ +/* ==================================================================== */ + +#ifdef LITTLE_ENDIAN +typedef union sh_md_dqrs_mmr_yamopw_err_u { + mmr_t sh_md_dqrs_mmr_yamopw_err_regval; + struct { + mmr_t ssyn : 8; + mmr_t scor : 1; + mmr_t sunc : 1; + mmr_t reserved_0 : 6; + mmr_t rsyn : 8; + mmr_t rcor : 1; + mmr_t runc : 1; + mmr_t reserved_1 : 6; + mmr_t arm : 1; + mmr_t reserved_2 : 31; + } sh_md_dqrs_mmr_yamopw_err_s; +} sh_md_dqrs_mmr_yamopw_err_u_t; +#else +typedef union sh_md_dqrs_mmr_yamopw_err_u { + mmr_t sh_md_dqrs_mmr_yamopw_err_regval; + struct { + mmr_t reserved_2 : 31; + mmr_t arm : 1; + mmr_t reserved_1 : 6; + mmr_t runc : 1; + mmr_t rcor : 1; + mmr_t rsyn : 8; + mmr_t reserved_0 : 6; + mmr_t sunc : 1; + mmr_t scor : 1; + mmr_t ssyn : 8; + } sh_md_dqrs_mmr_yamopw_err_s; +} sh_md_dqrs_mmr_yamopw_err_u_t; +#endif + + +#endif /* _ASM_IA64_SN_SN2_SHUB_MMR_T_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn2/shubio.h lia64-2.4/include/asm-ia64/sn/sn2/shubio.h --- linux-2.4.18/include/asm-ia64/sn/sn2/shubio.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn2/shubio.h Fri Jul 19 23:21:07 2002 @@ -0,0 +1,3639 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ + +#ifndef _ASM_IA64_SN_SN2_SHUBIO_H +#define _ASM_IA64_SN_SN2_SHUBIO_H + +#include + +#define HUB_WIDGET_ID_MAX 0xf +#define IIO_NUM_ITTES 7 +#define HUB_NUM_BIG_WINDOW (IIO_NUM_ITTES - 1) + +#define IIO_WID 0x00400000 /* Crosstalk Widget Identification */ + /* This register is also accessible from + * Crosstalk at address 0x0. */ +#define IIO_WSTAT 0x00400008 /* Crosstalk Widget Status */ +#define IIO_WCR 0x00400020 /* Crosstalk Widget Control Register */ +#define IIO_ILAPR 0x00400100 /* IO Local Access Protection Register */ +#define IIO_ILAPO 0x00400108 /* IO Local Access Protection Override */ +#define IIO_IOWA 0x00400110 /* IO Outbound Widget Access */ +#define IIO_IIWA 0x00400118 /* IO Inbound Widget Access */ +#define IIO_IIDEM 0x00400120 /* IO Inbound Device Error Mask */ +#define IIO_ILCSR 0x00400128 /* IO LLP Control and Status Register */ +#define IIO_ILLR 0x00400130 /* IO LLP Log Register */ +#define IIO_IIDSR 0x00400138 /* IO Interrupt Destination */ + +#define IIO_IGFX0 0x00400140 /* IO Graphics Node-Widget Map 0 */ +#define IIO_IGFX1 0x00400148 /* IO Graphics Node-Widget Map 1 */ + +#define IIO_ISCR0 0x00400150 /* IO Scratch Register 0 */ +#define IIO_ISCR1 0x00400158 /* IO Scratch Register 1 */ + +#define IIO_ITTE1 0x00400160 /* IO Translation Table Entry 1 */ +#define IIO_ITTE2 0x00400168 /* IO Translation Table Entry 2 */ +#define IIO_ITTE3 0x00400170 /* IO Translation Table Entry 3 */ +#define IIO_ITTE4 0x00400178 /* IO Translation Table Entry 4 */ +#define IIO_ITTE5 0x00400180 /* IO Translation Table Entry 5 */ +#define IIO_ITTE6 0x00400188 /* IO Translation Table Entry 6 */ +#define IIO_ITTE7 0x00400190 /* IO Translation Table Entry 7 */ + +#define IIO_IPRB0 0x00400198 /* IO PRB Entry 0 */ +#define IIO_IPRB8 0x004001A0 /* IO PRB Entry 8 */ +#define IIO_IPRB9 0x004001A8 /* IO PRB Entry 9 */ +#define IIO_IPRBA 0x004001B0 /* IO PRB Entry A */ +#define IIO_IPRBB 0x004001B8 /* IO PRB Entry B */ +#define IIO_IPRBC 0x004001C0 /* IO PRB Entry C */ +#define IIO_IPRBD 0x004001C8 /* IO PRB Entry D */ +#define IIO_IPRBE 0x004001D0 /* IO PRB Entry E */ +#define IIO_IPRBF 0x004001D8 /* IO PRB Entry F */ + +#define IIO_IXCC 0x004001E0 /* IO Crosstalk Credit Count Timeout */ +#define IIO_IMEM 0x004001E8 /* IO Miscellaneous Error Mask */ +#define IIO_IXTT 0x004001F0 /* IO Crosstalk Timeout Threshold */ +#define IIO_IECLR 0x004001F8 /* IO Error Clear Register */ +#define IIO_IBCR 0x00400200 /* IO BTE Control Register */ + +#define IIO_IXSM 0x00400208 /* IO Crosstalk Spurious Message */ +#define IIO_IXSS 0x00400210 /* IO Crosstalk Spurious Sideband */ + +#define IIO_ILCT 0x00400218 /* IO LLP Channel Test */ + +#define IIO_IIEPH1 0x00400220 /* IO Incoming Error Packet Header, Part 1 */ +#define IIO_IIEPH2 0x00400228 /* IO Incoming Error Packet Header, Part 2 */ + + +#define IIO_ISLAPR 0x00400230 /* IO SXB Local Access Protection Regster */ +#define IIO_ISLAPO 0x00400238 /* IO SXB Local Access Protection Override */ + +#define IIO_IWI 0x00400240 /* IO Wrapper Interrupt Register */ +#define IIO_IWEL 0x00400248 /* IO Wrapper Error Log Register */ +#define IIO_IWC 0x00400250 /* IO Wrapper Control Register */ +#define IIO_IWS 0x00400258 /* IO Wrapper Status Register */ +#define IIO_IWEIM 0x00400260 /* IO Wrapper Error Interrupt Masking Register */ + +#define IIO_IPCA 0x00400300 /* IO PRB Counter Adjust */ + +#define IIO_IPRTE0_A 0x00400308 /* IO PIO Read Address Table Entry 0, Part A */ +#define IIO_IPRTE1_A 0x00400310 /* IO PIO Read Address Table Entry 1, Part A */ +#define IIO_IPRTE2_A 0x00400318 /* IO PIO Read Address Table Entry 2, Part A */ +#define IIO_IPRTE3_A 0x00400320 /* IO PIO Read Address Table Entry 3, Part A */ +#define IIO_IPRTE4_A 0x00400328 /* IO PIO Read Address Table Entry 4, Part A */ +#define IIO_IPRTE5_A 0x00400330 /* IO PIO Read Address Table Entry 5, Part A */ +#define IIO_IPRTE6_A 0x00400338 /* IO PIO Read Address Table Entry 6, Part A */ +#define IIO_IPRTE7_A 0x00400340 /* IO PIO Read Address Table Entry 7, Part A */ + +#define IIO_IPRTE0_B 0x00400348 /* IO PIO Read Address Table Entry 0, Part B */ +#define IIO_IPRTE1_B 0x00400350 /* IO PIO Read Address Table Entry 1, Part B */ +#define IIO_IPRTE2_B 0x00400358 /* IO PIO Read Address Table Entry 2, Part B */ +#define IIO_IPRTE3_B 0x00400360 /* IO PIO Read Address Table Entry 3, Part B */ +#define IIO_IPRTE4_B 0x00400368 /* IO PIO Read Address Table Entry 4, Part B */ +#define IIO_IPRTE5_B 0x00400370 /* IO PIO Read Address Table Entry 5, Part B */ +#define IIO_IPRTE6_B 0x00400378 /* IO PIO Read Address Table Entry 6, Part B */ +#define IIO_IPRTE7_B 0x00400380 /* IO PIO Read Address Table Entry 7, Part B */ + +#define IIO_IPDR 0x00400388 /* IO PIO Deallocation Register */ +#define IIO_ICDR 0x00400390 /* IO CRB Entry Deallocation Register */ +#define IIO_IFDR 0x00400398 /* IO IOQ FIFO Depth Register */ +#define IIO_IIAP 0x004003A0 /* IO IIQ Arbitration Parameters */ +#define IIO_ICMR 0x004003A8 /* IO CRB Management Register */ +#define IIO_ICCR 0x004003B0 /* IO CRB Control Register */ +#define IIO_ICTO 0x004003B8 /* IO CRB Timeout */ +#define IIO_ICTP 0x004003C0 /* IO CRB Timeout Prescalar */ + +#define IIO_ICRB0_A 0x00400400 /* IO CRB Entry 0_A */ +#define IIO_ICRB0_B 0x00400408 /* IO CRB Entry 0_B */ +#define IIO_ICRB0_C 0x00400410 /* IO CRB Entry 0_C */ +#define IIO_ICRB0_D 0x00400418 /* IO CRB Entry 0_D */ +#define IIO_ICRB0_E 0x00400420 /* IO CRB Entry 0_E */ + +#define IIO_ICRB1_A 0x00400430 /* IO CRB Entry 1_A */ +#define IIO_ICRB1_B 0x00400438 /* IO CRB Entry 1_B */ +#define IIO_ICRB1_C 0x00400440 /* IO CRB Entry 1_C */ +#define IIO_ICRB1_D 0x00400448 /* IO CRB Entry 1_D */ +#define IIO_ICRB1_E 0x00400450 /* IO CRB Entry 1_E */ + +#define IIO_ICRB2_A 0x00400460 /* IO CRB Entry 2_A */ +#define IIO_ICRB2_B 0x00400468 /* IO CRB Entry 2_B */ +#define IIO_ICRB2_C 0x00400470 /* IO CRB Entry 2_C */ +#define IIO_ICRB2_D 0x00400478 /* IO CRB Entry 2_D */ +#define IIO_ICRB2_E 0x00400480 /* IO CRB Entry 2_E */ + +#define IIO_ICRB3_A 0x00400490 /* IO CRB Entry 3_A */ +#define IIO_ICRB3_B 0x00400498 /* IO CRB Entry 3_B */ +#define IIO_ICRB3_C 0x004004a0 /* IO CRB Entry 3_C */ +#define IIO_ICRB3_D 0x004004a8 /* IO CRB Entry 3_D */ +#define IIO_ICRB3_E 0x004004b0 /* IO CRB Entry 3_E */ + +#define IIO_ICRB4_A 0x004004c0 /* IO CRB Entry 4_A */ +#define IIO_ICRB4_B 0x004004c8 /* IO CRB Entry 4_B */ +#define IIO_ICRB4_C 0x004004d0 /* IO CRB Entry 4_C */ +#define IIO_ICRB4_D 0x004004d8 /* IO CRB Entry 4_D */ +#define IIO_ICRB4_E 0x004004e0 /* IO CRB Entry 4_E */ + +#define IIO_ICRB5_A 0x004004f0 /* IO CRB Entry 5_A */ +#define IIO_ICRB5_B 0x004004f8 /* IO CRB Entry 5_B */ +#define IIO_ICRB5_C 0x00400500 /* IO CRB Entry 5_C */ +#define IIO_ICRB5_D 0x00400508 /* IO CRB Entry 5_D */ +#define IIO_ICRB5_E 0x00400510 /* IO CRB Entry 5_E */ + +#define IIO_ICRB6_A 0x00400520 /* IO CRB Entry 6_A */ +#define IIO_ICRB6_B 0x00400528 /* IO CRB Entry 6_B */ +#define IIO_ICRB6_C 0x00400530 /* IO CRB Entry 6_C */ +#define IIO_ICRB6_D 0x00400538 /* IO CRB Entry 6_D */ +#define IIO_ICRB6_E 0x00400540 /* IO CRB Entry 6_E */ + +#define IIO_ICRB7_A 0x00400550 /* IO CRB Entry 7_A */ +#define IIO_ICRB7_B 0x00400558 /* IO CRB Entry 7_B */ +#define IIO_ICRB7_C 0x00400560 /* IO CRB Entry 7_C */ +#define IIO_ICRB7_D 0x00400568 /* IO CRB Entry 7_D */ +#define IIO_ICRB7_E 0x00400570 /* IO CRB Entry 7_E */ + +#define IIO_ICRB8_A 0x00400580 /* IO CRB Entry 8_A */ +#define IIO_ICRB8_B 0x00400588 /* IO CRB Entry 8_B */ +#define IIO_ICRB8_C 0x00400590 /* IO CRB Entry 8_C */ +#define IIO_ICRB8_D 0x00400598 /* IO CRB Entry 8_D */ +#define IIO_ICRB8_E 0x004005a0 /* IO CRB Entry 8_E */ + +#define IIO_ICRB9_A 0x004005b0 /* IO CRB Entry 9_A */ +#define IIO_ICRB9_B 0x004005b8 /* IO CRB Entry 9_B */ +#define IIO_ICRB9_C 0x004005c0 /* IO CRB Entry 9_C */ +#define IIO_ICRB9_D 0x004005c8 /* IO CRB Entry 9_D */ +#define IIO_ICRB9_E 0x004005d0 /* IO CRB Entry 9_E */ + +#define IIO_ICRBA_A 0x004005e0 /* IO CRB Entry A_A */ +#define IIO_ICRBA_B 0x004005e8 /* IO CRB Entry A_B */ +#define IIO_ICRBA_C 0x004005f0 /* IO CRB Entry A_C */ +#define IIO_ICRBA_D 0x004005f8 /* IO CRB Entry A_D */ +#define IIO_ICRBA_E 0x00400600 /* IO CRB Entry A_E */ + +#define IIO_ICRBB_A 0x00400610 /* IO CRB Entry B_A */ +#define IIO_ICRBB_B 0x00400618 /* IO CRB Entry B_B */ +#define IIO_ICRBB_C 0x00400620 /* IO CRB Entry B_C */ +#define IIO_ICRBB_D 0x00400628 /* IO CRB Entry B_D */ +#define IIO_ICRBB_E 0x00400630 /* IO CRB Entry B_E */ + +#define IIO_ICRBC_A 0x00400640 /* IO CRB Entry C_A */ +#define IIO_ICRBC_B 0x00400648 /* IO CRB Entry C_B */ +#define IIO_ICRBC_C 0x00400650 /* IO CRB Entry C_C */ +#define IIO_ICRBC_D 0x00400658 /* IO CRB Entry C_D */ +#define IIO_ICRBC_E 0x00400660 /* IO CRB Entry C_E */ + +#define IIO_ICRBD_A 0x00400670 /* IO CRB Entry D_A */ +#define IIO_ICRBD_B 0x00400678 /* IO CRB Entry D_B */ +#define IIO_ICRBD_C 0x00400680 /* IO CRB Entry D_C */ +#define IIO_ICRBD_D 0x00400688 /* IO CRB Entry D_D */ +#define IIO_ICRBD_E 0x00400690 /* IO CRB Entry D_E */ + +#define IIO_ICRBE_A 0x004006a0 /* IO CRB Entry E_A */ +#define IIO_ICRBE_B 0x004006a8 /* IO CRB Entry E_B */ +#define IIO_ICRBE_C 0x004006b0 /* IO CRB Entry E_C */ +#define IIO_ICRBE_D 0x004006b8 /* IO CRB Entry E_D */ +#define IIO_ICRBE_E 0x004006c0 /* IO CRB Entry E_E */ + +#define IIO_ICSML 0x00400700 /* IO CRB Spurious Message Low */ +#define IIO_ICSMM 0x00400708 /* IO CRB Spurious Message Middle */ +#define IIO_ICSMH 0x00400710 /* IO CRB Spurious Message High */ + +#define IIO_IDBSS 0x00400718 /* IO Debug Submenu Select */ + +#define IIO_IBLS0 0x00410000 /* IO BTE Length Status 0 */ +#define IIO_IBSA0 0x00410008 /* IO BTE Source Address 0 */ +#define IIO_IBDA0 0x00410010 /* IO BTE Destination Address 0 */ +#define IIO_IBCT0 0x00410018 /* IO BTE Control Terminate 0 */ +#define IIO_IBNA0 0x00410020 /* IO BTE Notification Address 0 */ +#define IIO_IBIA0 0x00410028 /* IO BTE Interrupt Address 0 */ +#define IIO_IBLS1 0x00420000 /* IO BTE Length Status 1 */ +#define IIO_IBSA1 0x00420008 /* IO BTE Source Address 1 */ +#define IIO_IBDA1 0x00420010 /* IO BTE Destination Address 1 */ +#define IIO_IBCT1 0x00420018 /* IO BTE Control Terminate 1 */ +#define IIO_IBNA1 0x00420020 /* IO BTE Notification Address 1 */ +#define IIO_IBIA1 0x00420028 /* IO BTE Interrupt Address 1 */ + +#define IIO_IPCR 0x00430000 /* IO Performance Control */ +#define IIO_IPPR 0x00430008 /* IO Performance Profiling */ + + +#ifndef __ASSEMBLY__ + +/************************************************************************ + * * + * Description: This register echoes some information from the * + * LB_REV_ID register. It is available through Crosstalk as described * + * above. The REV_NUM and MFG_NUM fields receive their values from * + * the REVISION and MANUFACTURER fields in the LB_REV_ID register. * + * The PART_NUM field's value is the Crosstalk device ID number that * + * Steve Miller assigned to the SHub chip. * + * * + ************************************************************************/ + +typedef union ii_wid_u { + shubreg_t ii_wid_regval; + struct { + shubreg_t w_rsvd_1 : 1; + shubreg_t w_mfg_num : 11; + shubreg_t w_part_num : 16; + shubreg_t w_rev_num : 4; + shubreg_t w_rsvd : 32; + } ii_wid_fld_s; +} ii_wid_u_t; + + +/************************************************************************ + * * + * The fields in this register are set upon detection of an error * + * and cleared by various mechanisms, as explained in the * + * description. * + * * + ************************************************************************/ + +typedef union ii_wstat_u { + shubreg_t ii_wstat_regval; + struct { + shubreg_t w_pending : 4; + shubreg_t w_xt_crd_to : 1; + shubreg_t w_xt_tail_to : 1; + shubreg_t w_rsvd_3 : 3; + shubreg_t w_tx_mx_rty : 1; + shubreg_t w_rsvd_2 : 6; + shubreg_t w_llp_tx_cnt : 8; + shubreg_t w_rsvd_1 : 8; + shubreg_t w_crazy : 1; + shubreg_t w_rsvd : 31; + } ii_wstat_fld_s; +} ii_wstat_u_t; + + +/************************************************************************ + * * + * Description: This is a read-write enabled register. It controls * + * various aspects of the Crosstalk flow control. * + * * + ************************************************************************/ + +typedef union ii_wcr_u { + shubreg_t ii_wcr_regval; + struct { + shubreg_t w_wid : 4; + shubreg_t w_tag : 1; + shubreg_t w_rsvd_1 : 8; + shubreg_t w_dst_crd : 3; + shubreg_t w_f_bad_pkt : 1; + shubreg_t w_dir_con : 1; + shubreg_t w_e_thresh : 5; + shubreg_t w_rsvd : 41; + } ii_wcr_fld_s; +} ii_wcr_u_t; + + +/************************************************************************ + * * + * Description: This register's value is a bit vector that guards * + * access to local registers within the II as well as to external * + * Crosstalk widgets. Each bit in the register corresponds to a * + * particular region in the system; a region consists of one, two or * + * four nodes (depending on the value of the REGION_SIZE field in the * + * LB_REV_ID register, which is documented in Section 8.3.1.1). The * + * protection provided by this register applies to PIO read * + * operations as well as PIO write operations. The II will perform a * + * PIO read or write request only if the bit for the requestor's * + * region is set; otherwise, the II will not perform the requested * + * operation and will return an error response. When a PIO read or * + * write request targets an external Crosstalk widget, then not only * + * must the bit for the requestor's region be set in the ILAPR, but * + * also the target widget's bit in the IOWA register must be set in * + * order for the II to perform the requested operation; otherwise, * + * the II will return an error response. Hence, the protection * + * provided by the IOWA register supplements the protection provided * + * by the ILAPR for requests that target external Crosstalk widgets. * + * This register itself can be accessed only by the nodes whose * + * region ID bits are enabled in this same register. It can also be * + * accessed through the IAlias space by the local processors. * + * The reset value of this register allows access by all nodes. * + * * + ************************************************************************/ + +typedef union ii_ilapr_u { + shubreg_t ii_ilapr_regval; + struct { + shubreg_t i_region : 64; + } ii_ilapr_fld_s; +} ii_ilapr_u_t; + + + + +/************************************************************************ + * * + * Description: A write to this register of the 64-bit value * + * "SGIrules" in ASCII, will cause the bit in the ILAPR register * + * corresponding to the region of the requestor to be set (allow * + * access). A write of any other value will be ignored. Access * + * protection for this register is "SGIrules". * + * This register can also be accessed through the IAlias space. * + * However, this access will not change the access permissions in the * + * ILAPR. * + * * + ************************************************************************/ + +typedef union ii_ilapo_u { + shubreg_t ii_ilapo_regval; + struct { + shubreg_t i_io_ovrride : 64; + } ii_ilapo_fld_s; +} ii_ilapo_u_t; + + + +/************************************************************************ + * * + * This register qualifies all the PIO and Graphics writes launched * + * from the SHUB towards a widget. * + * * + ************************************************************************/ + +typedef union ii_iowa_u { + shubreg_t ii_iowa_regval; + struct { + shubreg_t i_w0_oac : 1; + shubreg_t i_rsvd_1 : 7; + shubreg_t i_wx_oac : 8; + shubreg_t i_rsvd : 48; + } ii_iowa_fld_s; +} ii_iowa_u_t; + + +/************************************************************************ + * * + * Description: This register qualifies all the requests launched * + * from a widget towards the Shub. This register is intended to be * + * used by software in case of misbehaving widgets. * + * * + * * + ************************************************************************/ + +typedef union ii_iiwa_u { + shubreg_t ii_iiwa_regval; + struct { + shubreg_t i_w0_iac : 1; + shubreg_t i_rsvd_1 : 7; + shubreg_t i_wx_iac : 8; + shubreg_t i_rsvd : 48; + } ii_iiwa_fld_s; +} ii_iiwa_u_t; + + + +/************************************************************************ + * * + * Description: This register qualifies all the operations launched * + * from a widget towards the SHub. It allows individual access * + * control for up to 8 devices per widget. A device refers to * + * individual DMA master hosted by a widget. * + * The bits in each field of this register are cleared by the Shub * + * upon detection of an error which requires the device to be * + * disabled. These fields assume that 0=TNUM=7 (i.e., Bridge-centric * + * Crosstalk). Whether or not a device has access rights to this * + * Shub is determined by an AND of the device enable bit in the * + * appropriate field of this register and the corresponding bit in * + * the Wx_IAC field (for the widget which this device belongs to). * + * The bits in this field are set by writing a 1 to them. Incoming * + * replies from Crosstalk are not subject to this access control * + * mechanism. * + * * + ************************************************************************/ + +typedef union ii_iidem_u { + shubreg_t ii_iidem_regval; + struct { + shubreg_t i_w8_dxs : 8; + shubreg_t i_w9_dxs : 8; + shubreg_t i_wa_dxs : 8; + shubreg_t i_wb_dxs : 8; + shubreg_t i_wc_dxs : 8; + shubreg_t i_wd_dxs : 8; + shubreg_t i_we_dxs : 8; + shubreg_t i_wf_dxs : 8; + } ii_iidem_fld_s; +} ii_iidem_u_t; + + +/************************************************************************ + * * + * This register contains the various programmable fields necessary * + * for controlling and observing the LLP signals. * + * * + ************************************************************************/ + +typedef union ii_ilcsr_u { + shubreg_t ii_ilcsr_regval; + struct { + shubreg_t i_nullto : 6; + shubreg_t i_rsvd_4 : 2; + shubreg_t i_wrmrst : 1; + shubreg_t i_rsvd_3 : 1; + shubreg_t i_llp_en : 1; + shubreg_t i_bm8 : 1; + shubreg_t i_llp_stat : 2; + shubreg_t i_remote_power : 1; + shubreg_t i_rsvd_2 : 1; + shubreg_t i_maxrtry : 10; + shubreg_t i_d_avail_sel : 2; + shubreg_t i_rsvd_1 : 4; + shubreg_t i_maxbrst : 10; + shubreg_t i_rsvd : 22; + + } ii_ilcsr_fld_s; +} ii_ilcsr_u_t; + + +/************************************************************************ + * * + * This is simply a status registers that monitors the LLP error * + * rate. * + * * + ************************************************************************/ + +typedef union ii_illr_u { + shubreg_t ii_illr_regval; + struct { + shubreg_t i_sn_cnt : 16; + shubreg_t i_cb_cnt : 16; + shubreg_t i_rsvd : 32; + } ii_illr_fld_s; +} ii_illr_u_t; + + +/************************************************************************ + * * + * Description: All II-detected non-BTE error interrupts are * + * specified via this register. * + * NOTE: The PI interrupt register address is hardcoded in the II. If * + * PI_ID==0, then the II sends an interrupt request (Duplonet PWRI * + * packet) to address offset 0x0180_0090 within the local register * + * address space of PI0 on the node specified by the NODE field. If * + * PI_ID==1, then the II sends the interrupt request to address * + * offset 0x01A0_0090 within the local register address space of PI1 * + * on the node specified by the NODE field. * + * * + ************************************************************************/ + +typedef union ii_iidsr_u { + shubreg_t ii_iidsr_regval; + struct { + shubreg_t i_level : 8; + shubreg_t i_pi_id : 1; + shubreg_t i_node : 11; + shubreg_t i_rsvd_3 : 4; + shubreg_t i_enable : 1; + shubreg_t i_rsvd_2 : 3; + shubreg_t i_int_sent : 2; + shubreg_t i_rsvd_1 : 2; + shubreg_t i_pi0_forward_int : 1; + shubreg_t i_pi1_forward_int : 1; + shubreg_t i_rsvd : 30; + } ii_iidsr_fld_s; +} ii_iidsr_u_t; + + + +/************************************************************************ + * * + * There are two instances of this register. This register is used * + * for matching up the incoming responses from the graphics widget to * + * the processor that initiated the graphics operation. The * + * write-responses are converted to graphics credits and returned to * + * the processor so that the processor interface can manage the flow * + * control. * + * * + ************************************************************************/ + +typedef union ii_igfx0_u { + shubreg_t ii_igfx0_regval; + struct { + shubreg_t i_w_num : 4; + shubreg_t i_pi_id : 1; + shubreg_t i_n_num : 12; + shubreg_t i_p_num : 1; + shubreg_t i_rsvd : 46; + } ii_igfx0_fld_s; +} ii_igfx0_u_t; + + +/************************************************************************ + * * + * There are two instances of this register. This register is used * + * for matching up the incoming responses from the graphics widget to * + * the processor that initiated the graphics operation. The * + * write-responses are converted to graphics credits and returned to * + * the processor so that the processor interface can manage the flow * + * control. * + * * + ************************************************************************/ + +typedef union ii_igfx1_u { + shubreg_t ii_igfx1_regval; + struct { + shubreg_t i_w_num : 4; + shubreg_t i_pi_id : 1; + shubreg_t i_n_num : 12; + shubreg_t i_p_num : 1; + shubreg_t i_rsvd : 46; + } ii_igfx1_fld_s; +} ii_igfx1_u_t; + + +/************************************************************************ + * * + * There are two instances of this registers. These registers are * + * used as scratch registers for software use. * + * * + ************************************************************************/ + +typedef union ii_iscr0_u { + shubreg_t ii_iscr0_regval; + struct { + shubreg_t i_scratch : 64; + } ii_iscr0_fld_s; +} ii_iscr0_u_t; + + + +/************************************************************************ + * * + * There are two instances of this registers. These registers are * + * used as scratch registers for software use. * + * * + ************************************************************************/ + +typedef union ii_iscr1_u { + shubreg_t ii_iscr1_regval; + struct { + shubreg_t i_scratch : 64; + } ii_iscr1_fld_s; +} ii_iscr1_u_t; + + +/************************************************************************ + * * + * Description: There are seven instances of translation table entry * + * registers. Each register maps a Shub Big Window to a 48-bit * + * address on Crosstalk. * + * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window * + * number) are used to select one of these 7 registers. The Widget * + * number field is then derived from the W_NUM field for synthesizing * + * a Crosstalk packet. The 5 bits of OFFSET are concatenated with * + * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34] * + * are padded with zeros. Although the maximum Crosstalk space * + * addressable by the SHub is thus the lower 16 GBytes per widget * + * (M-mode), however only 7/32nds of this * + * space can be accessed. * + * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big * + * Window number) are used to select one of these 7 registers. The * + * Widget number field is then derived from the W_NUM field for * + * synthesizing a Crosstalk packet. The 5 bits of OFFSET are * + * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP * + * field is used as Crosstalk[47], and remainder of the Crosstalk * + * address bits (Crosstalk[46:34]) are always zero. While the maximum * + * Crosstalk space addressable by the Shub is thus the lower * + * 8-GBytes per widget (N-mode), only 7/32nds * + * of this space can be accessed. * + * * + ************************************************************************/ + +typedef union ii_itte1_u { + shubreg_t ii_itte1_regval; + struct { + shubreg_t i_offset : 5; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_w_num : 4; + shubreg_t i_iosp : 1; + shubreg_t i_rsvd : 51; + } ii_itte1_fld_s; +} ii_itte1_u_t; + + +/************************************************************************ + * * + * Description: There are seven instances of translation table entry * + * registers. Each register maps a Shub Big Window to a 48-bit * + * address on Crosstalk. * + * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window * + * number) are used to select one of these 7 registers. The Widget * + * number field is then derived from the W_NUM field for synthesizing * + * a Crosstalk packet. The 5 bits of OFFSET are concatenated with * + * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34] * + * are padded with zeros. Although the maximum Crosstalk space * + * addressable by the Shub is thus the lower 16 GBytes per widget * + * (M-mode), however only 7/32nds of this * + * space can be accessed. * + * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big * + * Window number) are used to select one of these 7 registers. The * + * Widget number field is then derived from the W_NUM field for * + * synthesizing a Crosstalk packet. The 5 bits of OFFSET are * + * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP * + * field is used as Crosstalk[47], and remainder of the Crosstalk * + * address bits (Crosstalk[46:34]) are always zero. While the maximum * + * Crosstalk space addressable by the Shub is thus the lower * + * 8-GBytes per widget (N-mode), only 7/32nds * + * of this space can be accessed. * + * * + ************************************************************************/ + +typedef union ii_itte2_u { + shubreg_t ii_itte2_regval; + struct { + shubreg_t i_offset : 5; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_w_num : 4; + shubreg_t i_iosp : 1; + shubreg_t i_rsvd : 51; + } ii_itte2_fld_s; +} ii_itte2_u_t; + + +/************************************************************************ + * * + * Description: There are seven instances of translation table entry * + * registers. Each register maps a Shub Big Window to a 48-bit * + * address on Crosstalk. * + * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window * + * number) are used to select one of these 7 registers. The Widget * + * number field is then derived from the W_NUM field for synthesizing * + * a Crosstalk packet. The 5 bits of OFFSET are concatenated with * + * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34] * + * are padded with zeros. Although the maximum Crosstalk space * + * addressable by the Shub is thus the lower 16 GBytes per widget * + * (M-mode), however only 7/32nds of this * + * space can be accessed. * + * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big * + * Window number) are used to select one of these 7 registers. The * + * Widget number field is then derived from the W_NUM field for * + * synthesizing a Crosstalk packet. The 5 bits of OFFSET are * + * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP * + * field is used as Crosstalk[47], and remainder of the Crosstalk * + * address bits (Crosstalk[46:34]) are always zero. While the maximum * + * Crosstalk space addressable by the SHub is thus the lower * + * 8-GBytes per widget (N-mode), only 7/32nds * + * of this space can be accessed. * + * * + ************************************************************************/ + +typedef union ii_itte3_u { + shubreg_t ii_itte3_regval; + struct { + shubreg_t i_offset : 5; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_w_num : 4; + shubreg_t i_iosp : 1; + shubreg_t i_rsvd : 51; + } ii_itte3_fld_s; +} ii_itte3_u_t; + + +/************************************************************************ + * * + * Description: There are seven instances of translation table entry * + * registers. Each register maps a SHub Big Window to a 48-bit * + * address on Crosstalk. * + * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window * + * number) are used to select one of these 7 registers. The Widget * + * number field is then derived from the W_NUM field for synthesizing * + * a Crosstalk packet. The 5 bits of OFFSET are concatenated with * + * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34] * + * are padded with zeros. Although the maximum Crosstalk space * + * addressable by the SHub is thus the lower 16 GBytes per widget * + * (M-mode), however only 7/32nds of this * + * space can be accessed. * + * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big * + * Window number) are used to select one of these 7 registers. The * + * Widget number field is then derived from the W_NUM field for * + * synthesizing a Crosstalk packet. The 5 bits of OFFSET are * + * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP * + * field is used as Crosstalk[47], and remainder of the Crosstalk * + * address bits (Crosstalk[46:34]) are always zero. While the maximum * + * Crosstalk space addressable by the SHub is thus the lower * + * 8-GBytes per widget (N-mode), only 7/32nds * + * of this space can be accessed. * + * * + ************************************************************************/ + +typedef union ii_itte4_u { + shubreg_t ii_itte4_regval; + struct { + shubreg_t i_offset : 5; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_w_num : 4; + shubreg_t i_iosp : 1; + shubreg_t i_rsvd : 51; + } ii_itte4_fld_s; +} ii_itte4_u_t; + + +/************************************************************************ + * * + * Description: There are seven instances of translation table entry * + * registers. Each register maps a SHub Big Window to a 48-bit * + * address on Crosstalk. * + * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window * + * number) are used to select one of these 7 registers. The Widget * + * number field is then derived from the W_NUM field for synthesizing * + * a Crosstalk packet. The 5 bits of OFFSET are concatenated with * + * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34] * + * are padded with zeros. Although the maximum Crosstalk space * + * addressable by the Shub is thus the lower 16 GBytes per widget * + * (M-mode), however only 7/32nds of this * + * space can be accessed. * + * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big * + * Window number) are used to select one of these 7 registers. The * + * Widget number field is then derived from the W_NUM field for * + * synthesizing a Crosstalk packet. The 5 bits of OFFSET are * + * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP * + * field is used as Crosstalk[47], and remainder of the Crosstalk * + * address bits (Crosstalk[46:34]) are always zero. While the maximum * + * Crosstalk space addressable by the Shub is thus the lower * + * 8-GBytes per widget (N-mode), only 7/32nds * + * of this space can be accessed. * + * * + ************************************************************************/ + +typedef union ii_itte5_u { + shubreg_t ii_itte5_regval; + struct { + shubreg_t i_offset : 5; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_w_num : 4; + shubreg_t i_iosp : 1; + shubreg_t i_rsvd : 51; + } ii_itte5_fld_s; +} ii_itte5_u_t; + + +/************************************************************************ + * * + * Description: There are seven instances of translation table entry * + * registers. Each register maps a Shub Big Window to a 48-bit * + * address on Crosstalk. * + * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window * + * number) are used to select one of these 7 registers. The Widget * + * number field is then derived from the W_NUM field for synthesizing * + * a Crosstalk packet. The 5 bits of OFFSET are concatenated with * + * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34] * + * are padded with zeros. Although the maximum Crosstalk space * + * addressable by the Shub is thus the lower 16 GBytes per widget * + * (M-mode), however only 7/32nds of this * + * space can be accessed. * + * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big * + * Window number) are used to select one of these 7 registers. The * + * Widget number field is then derived from the W_NUM field for * + * synthesizing a Crosstalk packet. The 5 bits of OFFSET are * + * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP * + * field is used as Crosstalk[47], and remainder of the Crosstalk * + * address bits (Crosstalk[46:34]) are always zero. While the maximum * + * Crosstalk space addressable by the Shub is thus the lower * + * 8-GBytes per widget (N-mode), only 7/32nds * + * of this space can be accessed. * + * * + ************************************************************************/ + +typedef union ii_itte6_u { + shubreg_t ii_itte6_regval; + struct { + shubreg_t i_offset : 5; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_w_num : 4; + shubreg_t i_iosp : 1; + shubreg_t i_rsvd : 51; + } ii_itte6_fld_s; +} ii_itte6_u_t; + + +/************************************************************************ + * * + * Description: There are seven instances of translation table entry * + * registers. Each register maps a Shub Big Window to a 48-bit * + * address on Crosstalk. * + * For M-mode (128 nodes, 8 GBytes/node), SysAD[31:29] (Big Window * + * number) are used to select one of these 7 registers. The Widget * + * number field is then derived from the W_NUM field for synthesizing * + * a Crosstalk packet. The 5 bits of OFFSET are concatenated with * + * SysAD[28:0] to form Crosstalk[33:0]. The upper Crosstalk[47:34] * + * are padded with zeros. Although the maximum Crosstalk space * + * addressable by the Shub is thus the lower 16 GBytes per widget * + * (M-mode), however only 7/32nds of this * + * space can be accessed. * + * For the N-mode (256 nodes, 4 GBytes/node), SysAD[30:28] (Big * + * Window number) are used to select one of these 7 registers. The * + * Widget number field is then derived from the W_NUM field for * + * synthesizing a Crosstalk packet. The 5 bits of OFFSET are * + * concatenated with SysAD[27:0] to form Crosstalk[33:0]. The IOSP * + * field is used as Crosstalk[47], and remainder of the Crosstalk * + * address bits (Crosstalk[46:34]) are always zero. While the maximum * + * Crosstalk space addressable by the SHub is thus the lower * + * 8-GBytes per widget (N-mode), only 7/32nds * + * of this space can be accessed. * + * * + ************************************************************************/ + +typedef union ii_itte7_u { + shubreg_t ii_itte7_regval; + struct { + shubreg_t i_offset : 5; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_w_num : 4; + shubreg_t i_iosp : 1; + shubreg_t i_rsvd : 51; + } ii_itte7_fld_s; +} ii_itte7_u_t; + + +/************************************************************************ + * * + * Description: There are 9 instances of this register, one per * + * actual widget in this implementation of SHub and Crossbow. * + * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * + * refers to Crossbow's internal space. * + * This register contains the state elements per widget that are * + * necessary to manage the PIO flow control on Crosstalk and on the * + * Router Network. See the PIO Flow Control chapter for a complete * + * description of this register * + * The SPUR_WR bit requires some explanation. When this register is * + * written, the new value of the C field is captured in an internal * + * register so the hardware can remember what the programmer wrote * + * into the credit counter. The SPUR_WR bit sets whenever the C field * + * increments above this stored value, which indicates that there * + * have been more responses received than requests sent. The SPUR_WR * + * bit cannot be cleared until a value is written to the IPRBx * + * register; the write will correct the C field and capture its new * + * value in the internal register. Even if IECLR[E_PRB_x] is set, the * + * SPUR_WR bit will persist if IPRBx hasn't yet been written. * + * . * + * * + ************************************************************************/ + +typedef union ii_iprb0_u { + shubreg_t ii_iprb0_regval; + struct { + shubreg_t i_c : 8; + shubreg_t i_na : 14; + shubreg_t i_rsvd_2 : 2; + shubreg_t i_nb : 14; + shubreg_t i_rsvd_1 : 2; + shubreg_t i_m : 2; + shubreg_t i_f : 1; + shubreg_t i_of_cnt : 5; + shubreg_t i_error : 1; + shubreg_t i_rd_to : 1; + shubreg_t i_spur_wr : 1; + shubreg_t i_spur_rd : 1; + shubreg_t i_rsvd : 11; + shubreg_t i_mult_err : 1; + } ii_iprb0_fld_s; +} ii_iprb0_u_t; + + +/************************************************************************ + * * + * Description: There are 9 instances of this register, one per * + * actual widget in this implementation of SHub and Crossbow. * + * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * + * refers to Crossbow's internal space. * + * This register contains the state elements per widget that are * + * necessary to manage the PIO flow control on Crosstalk and on the * + * Router Network. See the PIO Flow Control chapter for a complete * + * description of this register * + * The SPUR_WR bit requires some explanation. When this register is * + * written, the new value of the C field is captured in an internal * + * register so the hardware can remember what the programmer wrote * + * into the credit counter. The SPUR_WR bit sets whenever the C field * + * increments above this stored value, which indicates that there * + * have been more responses received than requests sent. The SPUR_WR * + * bit cannot be cleared until a value is written to the IPRBx * + * register; the write will correct the C field and capture its new * + * value in the internal register. Even if IECLR[E_PRB_x] is set, the * + * SPUR_WR bit will persist if IPRBx hasn't yet been written. * + * . * + * * + ************************************************************************/ + +typedef union ii_iprb8_u { + shubreg_t ii_iprb8_regval; + struct { + shubreg_t i_c : 8; + shubreg_t i_na : 14; + shubreg_t i_rsvd_2 : 2; + shubreg_t i_nb : 14; + shubreg_t i_rsvd_1 : 2; + shubreg_t i_m : 2; + shubreg_t i_f : 1; + shubreg_t i_of_cnt : 5; + shubreg_t i_error : 1; + shubreg_t i_rd_to : 1; + shubreg_t i_spur_wr : 1; + shubreg_t i_spur_rd : 1; + shubreg_t i_rsvd : 11; + shubreg_t i_mult_err : 1; + } ii_iprb8_fld_s; +} ii_iprb8_u_t; + + +/************************************************************************ + * * + * Description: There are 9 instances of this register, one per * + * actual widget in this implementation of SHub and Crossbow. * + * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * + * refers to Crossbow's internal space. * + * This register contains the state elements per widget that are * + * necessary to manage the PIO flow control on Crosstalk and on the * + * Router Network. See the PIO Flow Control chapter for a complete * + * description of this register * + * The SPUR_WR bit requires some explanation. When this register is * + * written, the new value of the C field is captured in an internal * + * register so the hardware can remember what the programmer wrote * + * into the credit counter. The SPUR_WR bit sets whenever the C field * + * increments above this stored value, which indicates that there * + * have been more responses received than requests sent. The SPUR_WR * + * bit cannot be cleared until a value is written to the IPRBx * + * register; the write will correct the C field and capture its new * + * value in the internal register. Even if IECLR[E_PRB_x] is set, the * + * SPUR_WR bit will persist if IPRBx hasn't yet been written. * + * . * + * * + ************************************************************************/ + +typedef union ii_iprb9_u { + shubreg_t ii_iprb9_regval; + struct { + shubreg_t i_c : 8; + shubreg_t i_na : 14; + shubreg_t i_rsvd_2 : 2; + shubreg_t i_nb : 14; + shubreg_t i_rsvd_1 : 2; + shubreg_t i_m : 2; + shubreg_t i_f : 1; + shubreg_t i_of_cnt : 5; + shubreg_t i_error : 1; + shubreg_t i_rd_to : 1; + shubreg_t i_spur_wr : 1; + shubreg_t i_spur_rd : 1; + shubreg_t i_rsvd : 11; + shubreg_t i_mult_err : 1; + } ii_iprb9_fld_s; +} ii_iprb9_u_t; + + +/************************************************************************ + * * + * Description: There are 9 instances of this register, one per * + * actual widget in this implementation of SHub and Crossbow. * + * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * + * refers to Crossbow's internal space. * + * This register contains the state elements per widget that are * + * necessary to manage the PIO flow control on Crosstalk and on the * + * Router Network. See the PIO Flow Control chapter for a complete * + * description of this register * + * The SPUR_WR bit requires some explanation. When this register is * + * written, the new value of the C field is captured in an internal * + * register so the hardware can remember what the programmer wrote * + * into the credit counter. The SPUR_WR bit sets whenever the C field * + * increments above this stored value, which indicates that there * + * have been more responses received than requests sent. The SPUR_WR * + * bit cannot be cleared until a value is written to the IPRBx * + * register; the write will correct the C field and capture its new * + * value in the internal register. Even if IECLR[E_PRB_x] is set, the * + * SPUR_WR bit will persist if IPRBx hasn't yet been written. * + * * + * * + ************************************************************************/ + +typedef union ii_iprba_u { + shubreg_t ii_iprba_regval; + struct { + shubreg_t i_c : 8; + shubreg_t i_na : 14; + shubreg_t i_rsvd_2 : 2; + shubreg_t i_nb : 14; + shubreg_t i_rsvd_1 : 2; + shubreg_t i_m : 2; + shubreg_t i_f : 1; + shubreg_t i_of_cnt : 5; + shubreg_t i_error : 1; + shubreg_t i_rd_to : 1; + shubreg_t i_spur_wr : 1; + shubreg_t i_spur_rd : 1; + shubreg_t i_rsvd : 11; + shubreg_t i_mult_err : 1; + } ii_iprba_fld_s; +} ii_iprba_u_t; + + +/************************************************************************ + * * + * Description: There are 9 instances of this register, one per * + * actual widget in this implementation of SHub and Crossbow. * + * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * + * refers to Crossbow's internal space. * + * This register contains the state elements per widget that are * + * necessary to manage the PIO flow control on Crosstalk and on the * + * Router Network. See the PIO Flow Control chapter for a complete * + * description of this register * + * The SPUR_WR bit requires some explanation. When this register is * + * written, the new value of the C field is captured in an internal * + * register so the hardware can remember what the programmer wrote * + * into the credit counter. The SPUR_WR bit sets whenever the C field * + * increments above this stored value, which indicates that there * + * have been more responses received than requests sent. The SPUR_WR * + * bit cannot be cleared until a value is written to the IPRBx * + * register; the write will correct the C field and capture its new * + * value in the internal register. Even if IECLR[E_PRB_x] is set, the * + * SPUR_WR bit will persist if IPRBx hasn't yet been written. * + * . * + * * + ************************************************************************/ + +typedef union ii_iprbb_u { + shubreg_t ii_iprbb_regval; + struct { + shubreg_t i_c : 8; + shubreg_t i_na : 14; + shubreg_t i_rsvd_2 : 2; + shubreg_t i_nb : 14; + shubreg_t i_rsvd_1 : 2; + shubreg_t i_m : 2; + shubreg_t i_f : 1; + shubreg_t i_of_cnt : 5; + shubreg_t i_error : 1; + shubreg_t i_rd_to : 1; + shubreg_t i_spur_wr : 1; + shubreg_t i_spur_rd : 1; + shubreg_t i_rsvd : 11; + shubreg_t i_mult_err : 1; + } ii_iprbb_fld_s; +} ii_iprbb_u_t; + + +/************************************************************************ + * * + * Description: There are 9 instances of this register, one per * + * actual widget in this implementation of SHub and Crossbow. * + * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * + * refers to Crossbow's internal space. * + * This register contains the state elements per widget that are * + * necessary to manage the PIO flow control on Crosstalk and on the * + * Router Network. See the PIO Flow Control chapter for a complete * + * description of this register * + * The SPUR_WR bit requires some explanation. When this register is * + * written, the new value of the C field is captured in an internal * + * register so the hardware can remember what the programmer wrote * + * into the credit counter. The SPUR_WR bit sets whenever the C field * + * increments above this stored value, which indicates that there * + * have been more responses received than requests sent. The SPUR_WR * + * bit cannot be cleared until a value is written to the IPRBx * + * register; the write will correct the C field and capture its new * + * value in the internal register. Even if IECLR[E_PRB_x] is set, the * + * SPUR_WR bit will persist if IPRBx hasn't yet been written. * + * . * + * * + ************************************************************************/ + +typedef union ii_iprbc_u { + shubreg_t ii_iprbc_regval; + struct { + shubreg_t i_c : 8; + shubreg_t i_na : 14; + shubreg_t i_rsvd_2 : 2; + shubreg_t i_nb : 14; + shubreg_t i_rsvd_1 : 2; + shubreg_t i_m : 2; + shubreg_t i_f : 1; + shubreg_t i_of_cnt : 5; + shubreg_t i_error : 1; + shubreg_t i_rd_to : 1; + shubreg_t i_spur_wr : 1; + shubreg_t i_spur_rd : 1; + shubreg_t i_rsvd : 11; + shubreg_t i_mult_err : 1; + } ii_iprbc_fld_s; +} ii_iprbc_u_t; + + +/************************************************************************ + * * + * Description: There are 9 instances of this register, one per * + * actual widget in this implementation of SHub and Crossbow. * + * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * + * refers to Crossbow's internal space. * + * This register contains the state elements per widget that are * + * necessary to manage the PIO flow control on Crosstalk and on the * + * Router Network. See the PIO Flow Control chapter for a complete * + * description of this register * + * The SPUR_WR bit requires some explanation. When this register is * + * written, the new value of the C field is captured in an internal * + * register so the hardware can remember what the programmer wrote * + * into the credit counter. The SPUR_WR bit sets whenever the C field * + * increments above this stored value, which indicates that there * + * have been more responses received than requests sent. The SPUR_WR * + * bit cannot be cleared until a value is written to the IPRBx * + * register; the write will correct the C field and capture its new * + * value in the internal register. Even if IECLR[E_PRB_x] is set, the * + * SPUR_WR bit will persist if IPRBx hasn't yet been written. * + * . * + * * + ************************************************************************/ + +typedef union ii_iprbd_u { + shubreg_t ii_iprbd_regval; + struct { + shubreg_t i_c : 8; + shubreg_t i_na : 14; + shubreg_t i_rsvd_2 : 2; + shubreg_t i_nb : 14; + shubreg_t i_rsvd_1 : 2; + shubreg_t i_m : 2; + shubreg_t i_f : 1; + shubreg_t i_of_cnt : 5; + shubreg_t i_error : 1; + shubreg_t i_rd_to : 1; + shubreg_t i_spur_wr : 1; + shubreg_t i_spur_rd : 1; + shubreg_t i_rsvd : 11; + shubreg_t i_mult_err : 1; + } ii_iprbd_fld_s; +} ii_iprbd_u_t; + + +/************************************************************************ + * * + * Description: There are 9 instances of this register, one per * + * actual widget in this implementation of SHub and Crossbow. * + * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * + * refers to Crossbow's internal space. * + * This register contains the state elements per widget that are * + * necessary to manage the PIO flow control on Crosstalk and on the * + * Router Network. See the PIO Flow Control chapter for a complete * + * description of this register * + * The SPUR_WR bit requires some explanation. When this register is * + * written, the new value of the C field is captured in an internal * + * register so the hardware can remember what the programmer wrote * + * into the credit counter. The SPUR_WR bit sets whenever the C field * + * increments above this stored value, which indicates that there * + * have been more responses received than requests sent. The SPUR_WR * + * bit cannot be cleared until a value is written to the IPRBx * + * register; the write will correct the C field and capture its new * + * value in the internal register. Even if IECLR[E_PRB_x] is set, the * + * SPUR_WR bit will persist if IPRBx hasn't yet been written. * + * . * + * * + ************************************************************************/ + +typedef union ii_iprbe_u { + shubreg_t ii_iprbe_regval; + struct { + shubreg_t i_c : 8; + shubreg_t i_na : 14; + shubreg_t i_rsvd_2 : 2; + shubreg_t i_nb : 14; + shubreg_t i_rsvd_1 : 2; + shubreg_t i_m : 2; + shubreg_t i_f : 1; + shubreg_t i_of_cnt : 5; + shubreg_t i_error : 1; + shubreg_t i_rd_to : 1; + shubreg_t i_spur_wr : 1; + shubreg_t i_spur_rd : 1; + shubreg_t i_rsvd : 11; + shubreg_t i_mult_err : 1; + } ii_iprbe_fld_s; +} ii_iprbe_u_t; + + +/************************************************************************ + * * + * Description: There are 9 instances of this register, one per * + * actual widget in this implementation of Shub and Crossbow. * + * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * + * refers to Crossbow's internal space. * + * This register contains the state elements per widget that are * + * necessary to manage the PIO flow control on Crosstalk and on the * + * Router Network. See the PIO Flow Control chapter for a complete * + * description of this register * + * The SPUR_WR bit requires some explanation. When this register is * + * written, the new value of the C field is captured in an internal * + * register so the hardware can remember what the programmer wrote * + * into the credit counter. The SPUR_WR bit sets whenever the C field * + * increments above this stored value, which indicates that there * + * have been more responses received than requests sent. The SPUR_WR * + * bit cannot be cleared until a value is written to the IPRBx * + * register; the write will correct the C field and capture its new * + * value in the internal register. Even if IECLR[E_PRB_x] is set, the * + * SPUR_WR bit will persist if IPRBx hasn't yet been written. * + * . * + * * + ************************************************************************/ + +typedef union ii_iprbf_u { + shubreg_t ii_iprbf_regval; + struct { + shubreg_t i_c : 8; + shubreg_t i_na : 14; + shubreg_t i_rsvd_2 : 2; + shubreg_t i_nb : 14; + shubreg_t i_rsvd_1 : 2; + shubreg_t i_m : 2; + shubreg_t i_f : 1; + shubreg_t i_of_cnt : 5; + shubreg_t i_error : 1; + shubreg_t i_rd_to : 1; + shubreg_t i_spur_wr : 1; + shubreg_t i_spur_rd : 1; + shubreg_t i_rsvd : 11; + shubreg_t i_mult_err : 1; + } ii_iprbe_fld_s; +} ii_iprbf_u_t; + + +/************************************************************************ + * * + * This register specifies the timeout value to use for monitoring * + * Crosstalk credits which are used outbound to Crosstalk. An * + * internal counter called the Crosstalk Credit Timeout Counter * + * increments every 128 II clocks. The counter starts counting * + * anytime the credit count drops below a threshold, and resets to * + * zero (stops counting) anytime the credit count is at or above the * + * threshold. The threshold is 1 credit in direct connect mode and 2 * + * in Crossbow connect mode. When the internal Crosstalk Credit * + * Timeout Counter reaches the value programmed in this register, a * + * Crosstalk Credit Timeout has occurred. The internal counter is not * + * readable from software, and stops counting at its maximum value, * + * so it cannot cause more than one interrupt. * + * * + ************************************************************************/ + +typedef union ii_ixcc_u { + shubreg_t ii_ixcc_regval; + struct { + shubreg_t i_time_out : 26; + shubreg_t i_rsvd : 38; + } ii_ixcc_fld_s; +} ii_ixcc_u_t; + + +/************************************************************************ + * * + * Description: This register qualifies all the PIO and DMA * + * operations launched from widget 0 towards the SHub. In * + * addition, it also qualifies accesses by the BTE streams. * + * The bits in each field of this register are cleared by the SHub * + * upon detection of an error which requires widget 0 or the BTE * + * streams to be terminated. Whether or not widget x has access * + * rights to this SHub is determined by an AND of the device * + * enable bit in the appropriate field of this register and bit 0 in * + * the Wx_IAC field. The bits in this field are set by writing a 1 to * + * them. Incoming replies from Crosstalk are not subject to this * + * access control mechanism. * + * * + ************************************************************************/ + +typedef union ii_imem_u { + shubreg_t ii_imem_regval; + struct { + shubreg_t i_w0_esd : 1; + shubreg_t i_rsvd_3 : 3; + shubreg_t i_b0_esd : 1; + shubreg_t i_rsvd_2 : 3; + shubreg_t i_b1_esd : 1; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_clr_precise : 1; + shubreg_t i_rsvd : 51; + } ii_imem_fld_s; +} ii_imem_u_t; + + + +/************************************************************************ + * * + * Description: This register specifies the timeout value to use for * + * monitoring Crosstalk tail flits coming into the Shub in the * + * TAIL_TO field. An internal counter associated with this register * + * is incremented every 128 II internal clocks (7 bits). The counter * + * starts counting anytime a header micropacket is received and stops * + * counting (and resets to zero) any time a micropacket with a Tail * + * bit is received. Once the counter reaches the threshold value * + * programmed in this register, it generates an interrupt to the * + * processor that is programmed into the IIDSR. The counter saturates * + * (does not roll over) at its maximum value, so it cannot cause * + * another interrupt until after it is cleared. * + * The register also contains the Read Response Timeout values. The * + * Prescalar is 23 bits, and counts II clocks. An internal counter * + * increments on every II clock and when it reaches the value in the * + * Prescalar field, all IPRTE registers with their valid bits set * + * have their Read Response timers bumped. Whenever any of them match * + * the value in the RRSP_TO field, a Read Response Timeout has * + * occurred, and error handling occurs as described in the Error * + * Handling section of this document. * + * * + ************************************************************************/ + +typedef union ii_ixtt_u { + shubreg_t ii_ixtt_regval; + struct { + shubreg_t i_tail_to : 26; + shubreg_t i_rsvd_1 : 6; + shubreg_t i_rrsp_ps : 23; + shubreg_t i_rrsp_to : 5; + shubreg_t i_rsvd : 4; + } ii_ixtt_fld_s; +} ii_ixtt_u_t; + + +/************************************************************************ + * * + * Writing a 1 to the fields of this register clears the appropriate * + * error bits in other areas of SHub. Note that when the * + * E_PRB_x bits are used to clear error bits in PRB registers, * + * SPUR_RD and SPUR_WR may persist, because they require additional * + * action to clear them. See the IPRBx and IXSS Register * + * specifications. * + * * + ************************************************************************/ + +typedef union ii_ieclr_u { + shubreg_t ii_ieclr_regval; + struct { + shubreg_t i_e_prb_0 : 1; + shubreg_t i_rsvd : 7; + shubreg_t i_e_prb_8 : 1; + shubreg_t i_e_prb_9 : 1; + shubreg_t i_e_prb_a : 1; + shubreg_t i_e_prb_b : 1; + shubreg_t i_e_prb_c : 1; + shubreg_t i_e_prb_d : 1; + shubreg_t i_e_prb_e : 1; + shubreg_t i_e_prb_f : 1; + shubreg_t i_e_crazy : 1; + shubreg_t i_e_bte_0 : 1; + shubreg_t i_e_bte_1 : 1; + shubreg_t i_reserved_1 : 10; + shubreg_t i_spur_rd_hdr : 1; + shubreg_t i_cam_intr_to : 1; + shubreg_t i_cam_overflow : 1; + shubreg_t i_cam_read_miss : 1; + shubreg_t i_ioq_rep_underflow : 1; + shubreg_t i_ioq_req_underflow : 1; + shubreg_t i_ioq_rep_overflow : 1; + shubreg_t i_ioq_req_overflow : 1; + shubreg_t i_iiq_rep_overflow : 1; + shubreg_t i_iiq_req_overflow : 1; + shubreg_t i_ii_xn_rep_cred_overflow : 1; + shubreg_t i_ii_xn_req_cred_overflow : 1; + shubreg_t i_ii_xn_invalid_cmd : 1; + shubreg_t i_xn_ii_invalid_cmd : 1; + shubreg_t i_reserved_2 : 21; + } ii_ieclr_fld_s; +} ii_ieclr_u_t; + + +/************************************************************************ + * * + * This register controls both BTEs. SOFT_RESET is intended for * + * recovery after an error. COUNT controls the total number of CRBs * + * that both BTEs (combined) can use, which affects total BTE * + * bandwidth. * + * * + ************************************************************************/ + +typedef union ii_ibcr_u { + shubreg_t ii_ibcr_regval; + struct { + shubreg_t i_count : 4; + shubreg_t i_rsvd_1 : 4; + shubreg_t i_soft_reset : 1; + shubreg_t i_rsvd : 55; + } ii_ibcr_fld_s; +} ii_ibcr_u_t; + + +/************************************************************************ + * * + * This register contains the header of a spurious read response * + * received from Crosstalk. A spurious read response is defined as a * + * read response received by II from a widget for which (1) the SIDN * + * has a value between 1 and 7, inclusive (II never sends requests to * + * these widgets (2) there is no valid IPRTE register which * + * corresponds to the TNUM, or (3) the widget indicated in SIDN is * + * not the same as the widget recorded in the IPRTE register * + * referenced by the TNUM. If this condition is true, and if the * + * IXSS[VALID] bit is clear, then the header of the spurious read * + * response is capture in IXSM and IXSS, and IXSS[VALID] is set. The * + * errant header is thereby captured, and no further spurious read * + * respones are captured until IXSS[VALID] is cleared by setting the * + * appropriate bit in IECLR.Everytime a spurious read response is * + * detected, the SPUR_RD bit of the PRB corresponding to the incoming * + * message's SIDN field is set. This always happens, regarless of * + * whether a header is captured. The programmer should check * + * IXSM[SIDN] to determine which widget sent the spurious response, * + * because there may be more than one SPUR_RD bit set in the PRB * + * registers. The widget indicated by IXSM[SIDN] was the first * + * spurious read response to be received since the last time * + * IXSS[VALID] was clear. The SPUR_RD bit of the corresponding PRB * + * will be set. Any SPUR_RD bits in any other PRB registers indicate * + * spurious messages from other widets which were detected after the * + * header was captured.. * + * * + ************************************************************************/ + +typedef union ii_ixsm_u { + shubreg_t ii_ixsm_regval; + struct { + shubreg_t i_byte_en : 32; + shubreg_t i_reserved : 1; + shubreg_t i_tag : 3; + shubreg_t i_alt_pactyp : 4; + shubreg_t i_bo : 1; + shubreg_t i_error : 1; + shubreg_t i_vbpm : 1; + shubreg_t i_gbr : 1; + shubreg_t i_ds : 2; + shubreg_t i_ct : 1; + shubreg_t i_tnum : 5; + shubreg_t i_pactyp : 4; + shubreg_t i_sidn : 4; + shubreg_t i_didn : 4; + } ii_ixsm_fld_s; +} ii_ixsm_u_t; + + +/************************************************************************ + * * + * This register contains the sideband bits of a spurious read * + * response received from Crosstalk. * + * * + ************************************************************************/ + +typedef union ii_ixss_u { + shubreg_t ii_ixss_regval; + struct { + shubreg_t i_sideband : 8; + shubreg_t i_rsvd : 55; + shubreg_t i_valid : 1; + } ii_ixss_fld_s; +} ii_ixss_u_t; + + +/************************************************************************ + * * + * This register enables software to access the II LLP's test port. * + * Refer to the LLP 2.5 documentation for an explanation of the test * + * port. Software can write to this register to program the values * + * for the control fields (TestErrCapture, TestClear, TestFlit, * + * TestMask and TestSeed). Similarly, software can read from this * + * register to obtain the values of the test port's status outputs * + * (TestCBerr, TestValid and TestData). * + * * + ************************************************************************/ + +typedef union ii_ilct_u { + shubreg_t ii_ilct_regval; + struct { + shubreg_t i_test_seed : 20; + shubreg_t i_test_mask : 8; + shubreg_t i_test_data : 20; + shubreg_t i_test_valid : 1; + shubreg_t i_test_cberr : 1; + shubreg_t i_test_flit : 3; + shubreg_t i_test_clear : 1; + shubreg_t i_test_err_capture : 1; + shubreg_t i_rsvd : 9; + } ii_ilct_fld_s; +} ii_ilct_u_t; + + +/************************************************************************ + * * + * If the II detects an illegal incoming Duplonet packet (request or * + * reply) when VALID==0 in the IIEPH1 register, then it saves the * + * contents of the packet's header flit in the IIEPH1 and IIEPH2 * + * registers, sets the VALID bit in IIEPH1, clears the OVERRUN bit, * + * and assigns a value to the ERR_TYPE field which indicates the * + * specific nature of the error. The II recognizes four different * + * types of errors: short request packets (ERR_TYPE==2), short reply * + * packets (ERR_TYPE==3), long request packets (ERR_TYPE==4) and long * + * reply packets (ERR_TYPE==5). The encodings for these types of * + * errors were chosen to be consistent with the same types of errors * + * indicated by the ERR_TYPE field in the LB_ERROR_HDR1 register (in * + * the LB unit). If the II detects an illegal incoming Duplonet * + * packet when VALID==1 in the IIEPH1 register, then it merely sets * + * the OVERRUN bit to indicate that a subsequent error has happened, * + * and does nothing further. * + * * + ************************************************************************/ + +typedef union ii_iieph1_u { + shubreg_t ii_iieph1_regval; + struct { + shubreg_t i_command : 7; + shubreg_t i_rsvd_5 : 1; + shubreg_t i_suppl : 14; + shubreg_t i_rsvd_4 : 1; + shubreg_t i_source : 14; + shubreg_t i_rsvd_3 : 1; + shubreg_t i_err_type : 4; + shubreg_t i_rsvd_2 : 4; + shubreg_t i_overrun : 1; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_valid : 1; + shubreg_t i_rsvd : 13; + } ii_iieph1_fld_s; +} ii_iieph1_u_t; + + +/************************************************************************ + * * + * This register holds the Address field from the header flit of an * + * incoming erroneous Duplonet packet, along with the tail bit which * + * accompanied this header flit. This register is essentially an * + * extension of IIEPH1. Two registers were necessary because the 64 * + * bits available in only a single register were insufficient to * + * capture the entire header flit of an erroneous packet. * + * * + ************************************************************************/ + +typedef union ii_iieph2_u { + shubreg_t ii_iieph2_regval; + struct { + shubreg_t i_rsvd_0 : 3; + shubreg_t i_address : 47; + shubreg_t i_rsvd_1 : 10; + shubreg_t i_tail : 1; + shubreg_t i_rsvd : 3; + } ii_iieph2_fld_s; +} ii_iieph2_u_t; + + +/******************************/ + + + +/************************************************************************ + * * + * This register's value is a bit vector that guards access from SXBs * + * to local registers within the II as well as to external Crosstalk * + * widgets * + * * + ************************************************************************/ + +typedef union ii_islapr_u { + shubreg_t ii_islapr_regval; + struct { + shubreg_t i_region : 64; + } ii_islapr_fld_s; +} ii_islapr_u_t; + + +/************************************************************************ + * * + * A write to this register of the 56-bit value "Pup+Bun" will cause * + * the bit in the ISLAPR register corresponding to the region of the * + * requestor to be set (access allowed). ( + * * + ************************************************************************/ + +typedef union ii_islapo_u { + shubreg_t ii_islapo_regval; + struct { + shubreg_t i_io_sbx_ovrride : 56; + shubreg_t i_rsvd : 8; + } ii_islapo_fld_s; +} ii_islapo_u_t; + +/************************************************************************ + * * + * Determines how long the wrapper will wait aftr an interrupt is * + * initially issued from the II before it times out the outstanding * + * interrupt and drops it from the interrupt queue. * + * * + ************************************************************************/ + +typedef union ii_iwi_u { + shubreg_t ii_iwi_regval; + struct { + shubreg_t i_prescale : 24; + shubreg_t i_rsvd : 8; + shubreg_t i_timeout : 8; + shubreg_t i_rsvd1 : 8; + shubreg_t i_intrpt_retry_period : 8; + shubreg_t i_rsvd2 : 8; + } ii_iwi_fld_s; +} ii_iwi_u_t; + +/************************************************************************ + * * + * Log errors which have occurred in the II wrapper. The errors are * + * cleared by writing to the IECLR register. * + * * + ************************************************************************/ + +typedef union ii_iwel_u { + shubreg_t ii_iwel_regval; + struct { + shubreg_t i_intr_timed_out : 1; + shubreg_t i_rsvd : 7; + shubreg_t i_cam_overflow : 1; + shubreg_t i_cam_read_miss : 1; + shubreg_t i_rsvd1 : 2; + shubreg_t i_ioq_rep_underflow : 1; + shubreg_t i_ioq_req_underflow : 1; + shubreg_t i_ioq_rep_overflow : 1; + shubreg_t i_ioq_req_overflow : 1; + shubreg_t i_iiq_rep_overflow : 1; + shubreg_t i_iiq_req_overflow : 1; + shubreg_t i_rsvd2 : 6; + shubreg_t i_ii_xn_rep_cred_over_under: 1; + shubreg_t i_ii_xn_req_cred_over_under: 1; + shubreg_t i_rsvd3 : 6; + shubreg_t i_ii_xn_invalid_cmd : 1; + shubreg_t i_xn_ii_invalid_cmd : 1; + shubreg_t i_rsvd4 : 30; + } ii_iwel_fld_s; +} ii_iwel_u_t; + +/************************************************************************ + * * + * Controls the II wrapper. * + * * + ************************************************************************/ + +typedef union ii_iwc_u { + shubreg_t ii_iwc_regval; + struct { + shubreg_t i_dma_byte_swap : 1; + shubreg_t i_rsvd : 3; + shubreg_t i_cam_read_lines_reset : 1; + shubreg_t i_rsvd1 : 3; + shubreg_t i_ii_xn_cred_over_under_log: 1; + shubreg_t i_rsvd2 : 19; + shubreg_t i_xn_rep_iq_depth : 5; + shubreg_t i_rsvd3 : 3; + shubreg_t i_xn_req_iq_depth : 5; + shubreg_t i_rsvd4 : 3; + shubreg_t i_iiq_depth : 6; + shubreg_t i_rsvd5 : 12; + shubreg_t i_force_rep_cred : 1; + shubreg_t i_force_req_cred : 1; + } ii_iwc_fld_s; +} ii_iwc_u_t; + +/************************************************************************ + * * + * Status in the II wrapper. * + * * + ************************************************************************/ + +typedef union ii_iws_u { + shubreg_t ii_iws_regval; + struct { + shubreg_t i_xn_rep_iq_credits : 5; + shubreg_t i_rsvd : 3; + shubreg_t i_xn_req_iq_credits : 5; + shubreg_t i_rsvd1 : 51; + } ii_iws_fld_s; +} ii_iws_u_t; + +/************************************************************************ + * * + * Masks errors in the IWEL register. * + * * + ************************************************************************/ + +typedef union ii_iweim_u { + shubreg_t ii_iweim_regval; + struct { + shubreg_t i_intr_timed_out : 1; + shubreg_t i_rsvd : 7; + shubreg_t i_cam_overflow : 1; + shubreg_t i_cam_read_miss : 1; + shubreg_t i_rsvd1 : 2; + shubreg_t i_ioq_rep_underflow : 1; + shubreg_t i_ioq_req_underflow : 1; + shubreg_t i_ioq_rep_overflow : 1; + shubreg_t i_ioq_req_overflow : 1; + shubreg_t i_iiq_rep_overflow : 1; + shubreg_t i_iiq_req_overflow : 1; + shubreg_t i_rsvd2 : 6; + shubreg_t i_ii_xn_rep_cred_overflow : 1; + shubreg_t i_ii_xn_req_cred_overflow : 1; + shubreg_t i_rsvd3 : 6; + shubreg_t i_ii_xn_invalid_cmd : 1; + shubreg_t i_xn_ii_invalid_cmd : 1; + shubreg_t i_rsvd4 : 30; + } ii_iweim_fld_s; +} ii_iweim_u_t; + + +/************************************************************************ + * * + * A write to this register causes a particular field in the * + * corresponding widget's PRB entry to be adjusted up or down by 1. * + * This counter should be used when recovering from error and reset * + * conditions. Note that software would be capable of causing * + * inadvertent overflow or underflow of these counters. * + * * + ************************************************************************/ + +typedef union ii_ipca_u { + shubreg_t ii_ipca_regval; + struct { + shubreg_t i_wid : 4; + shubreg_t i_adjust : 1; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_field : 2; + shubreg_t i_rsvd : 54; + } ii_ipca_fld_s; +} ii_ipca_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + + +typedef union ii_iprte0a_u { + shubreg_t ii_iprte0a_regval; + struct { + shubreg_t i_rsvd_1 : 54; + shubreg_t i_widget : 4; + shubreg_t i_to_cnt : 5; + shubreg_t i_vld : 1; + } ii_iprte0a_fld_s; +} ii_iprte0a_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte1a_u { + shubreg_t ii_iprte1a_regval; + struct { + shubreg_t i_rsvd_1 : 54; + shubreg_t i_widget : 4; + shubreg_t i_to_cnt : 5; + shubreg_t i_vld : 1; + } ii_iprte1a_fld_s; +} ii_iprte1a_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte2a_u { + shubreg_t ii_iprte2a_regval; + struct { + shubreg_t i_rsvd_1 : 54; + shubreg_t i_widget : 4; + shubreg_t i_to_cnt : 5; + shubreg_t i_vld : 1; + } ii_iprte2a_fld_s; +} ii_iprte2a_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte3a_u { + shubreg_t ii_iprte3a_regval; + struct { + shubreg_t i_rsvd_1 : 54; + shubreg_t i_widget : 4; + shubreg_t i_to_cnt : 5; + shubreg_t i_vld : 1; + } ii_iprte3a_fld_s; +} ii_iprte3a_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte4a_u { + shubreg_t ii_iprte4a_regval; + struct { + shubreg_t i_rsvd_1 : 54; + shubreg_t i_widget : 4; + shubreg_t i_to_cnt : 5; + shubreg_t i_vld : 1; + } ii_iprte4a_fld_s; +} ii_iprte4a_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte5a_u { + shubreg_t ii_iprte5a_regval; + struct { + shubreg_t i_rsvd_1 : 54; + shubreg_t i_widget : 4; + shubreg_t i_to_cnt : 5; + shubreg_t i_vld : 1; + } ii_iprte5a_fld_s; +} ii_iprte5a_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte6a_u { + shubreg_t ii_iprte6a_regval; + struct { + shubreg_t i_rsvd_1 : 54; + shubreg_t i_widget : 4; + shubreg_t i_to_cnt : 5; + shubreg_t i_vld : 1; + } ii_iprte6a_fld_s; +} ii_iprte6a_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte7a_u { + shubreg_t ii_iprte7a_regval; + struct { + shubreg_t i_rsvd_1 : 54; + shubreg_t i_widget : 4; + shubreg_t i_to_cnt : 5; + shubreg_t i_vld : 1; + } ii_iprtea7_fld_s; +} ii_iprte7a_u_t; + + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + + +typedef union ii_iprte0b_u { + shubreg_t ii_iprte0b_regval; + struct { + shubreg_t i_rsvd_1 : 3; + shubreg_t i_address : 47; + shubreg_t i_init : 3; + shubreg_t i_source : 11; + } ii_iprte0b_fld_s; +} ii_iprte0b_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte1b_u { + shubreg_t ii_iprte1b_regval; + struct { + shubreg_t i_rsvd_1 : 3; + shubreg_t i_address : 47; + shubreg_t i_init : 3; + shubreg_t i_source : 11; + } ii_iprte1b_fld_s; +} ii_iprte1b_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte2b_u { + shubreg_t ii_iprte2b_regval; + struct { + shubreg_t i_rsvd_1 : 3; + shubreg_t i_address : 47; + shubreg_t i_init : 3; + shubreg_t i_source : 11; + } ii_iprte2b_fld_s; +} ii_iprte2b_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte3b_u { + shubreg_t ii_iprte3b_regval; + struct { + shubreg_t i_rsvd_1 : 3; + shubreg_t i_address : 47; + shubreg_t i_init : 3; + shubreg_t i_source : 11; + } ii_iprte3b_fld_s; +} ii_iprte3b_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte4b_u { + shubreg_t ii_iprte4b_regval; + struct { + shubreg_t i_rsvd_1 : 3; + shubreg_t i_address : 47; + shubreg_t i_init : 3; + shubreg_t i_source : 11; + } ii_iprte4b_fld_s; +} ii_iprte4b_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte5b_u { + shubreg_t ii_iprte5b_regval; + struct { + shubreg_t i_rsvd_1 : 3; + shubreg_t i_address : 47; + shubreg_t i_init : 3; + shubreg_t i_source : 11; + } ii_iprte5b_fld_s; +} ii_iprte5b_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte6b_u { + shubreg_t ii_iprte6b_regval; + struct { + shubreg_t i_rsvd_1 : 3; + shubreg_t i_address : 47; + shubreg_t i_init : 3; + shubreg_t i_source : 11; + + } ii_iprte6b_fld_s; +} ii_iprte6b_u_t; + + +/************************************************************************ + * * + * There are 8 instances of this register. This register contains * + * the information that the II has to remember once it has launched a * + * PIO Read operation. The contents are used to form the correct * + * Router Network packet and direct the Crosstalk reply to the * + * appropriate processor. * + * * + ************************************************************************/ + +typedef union ii_iprte7b_u { + shubreg_t ii_iprte7b_regval; + struct { + shubreg_t i_rsvd_1 : 3; + shubreg_t i_address : 47; + shubreg_t i_init : 3; + shubreg_t i_source : 11; + } ii_iprte7b_fld_s; +} ii_iprte7b_u_t; + + +/************************************************************************ + * * + * Description: SHub II contains a feature which did not exist in * + * the Hub which automatically cleans up after a Read Response * + * timeout, including deallocation of the IPRTE and recovery of IBuf * + * space. The inclusion of this register in SHub is for backward * + * compatibility * + * A write to this register causes an entry from the table of * + * outstanding PIO Read Requests to be freed and returned to the * + * stack of free entries. This register is used in handling the * + * timeout errors that result in a PIO Reply never returning from * + * Crosstalk. * + * Note that this register does not affect the contents of the IPRTE * + * registers. The Valid bits in those registers have to be * + * specifically turned off by software. * + * * + ************************************************************************/ + +typedef union ii_ipdr_u { + shubreg_t ii_ipdr_regval; + struct { + shubreg_t i_te : 3; + shubreg_t i_rsvd_1 : 1; + shubreg_t i_pnd : 1; + shubreg_t i_init_rpcnt : 1; + shubreg_t i_rsvd : 58; + } ii_ipdr_fld_s; +} ii_ipdr_u_t; + + +/************************************************************************ + * * + * A write to this register causes a CRB entry to be returned to the * + * queue of free CRBs. The entry should have previously been cleared * + * (mark bit) via backdoor access to the pertinent CRB entry. This * + * register is used in the last step of handling the errors that are * + * captured and marked in CRB entries. Briefly: 1) first error for * + * DMA write from a particular device, and first error for a * + * particular BTE stream, lead to a marked CRB entry, and processor * + * interrupt, 2) software reads the error information captured in the * + * CRB entry, and presumably takes some corrective action, 3) * + * software clears the mark bit, and finally 4) software writes to * + * the ICDR register to return the CRB entry to the list of free CRB * + * entries. * + * * + ************************************************************************/ + +typedef union ii_icdr_u { + shubreg_t ii_icdr_regval; + struct { + shubreg_t i_crb_num : 4; + shubreg_t i_pnd : 1; + shubreg_t i_rsvd : 59; + } ii_icdr_fld_s; +} ii_icdr_u_t; + + +/************************************************************************ + * * + * This register provides debug access to two FIFOs inside of II. * + * Both IOQ_MAX* fields of this register contain the instantaneous * + * depth (in units of the number of available entries) of the * + * associated IOQ FIFO. A read of this register will return the * + * number of free entries on each FIFO at the time of the read. So * + * when a FIFO is idle, the associated field contains the maximum * + * depth of the FIFO. This register is writable for debug reasons * + * and is intended to be written with the maximum desired FIFO depth * + * while the FIFO is idle. Software must assure that II is idle when * + * this register is written. If there are any active entries in any * + * of these FIFOs when this register is written, the results are * + * undefined. * + * * + ************************************************************************/ + +typedef union ii_ifdr_u { + shubreg_t ii_ifdr_regval; + struct { + shubreg_t i_ioq_max_rq : 7; + shubreg_t i_set_ioq_rq : 1; + shubreg_t i_ioq_max_rp : 7; + shubreg_t i_set_ioq_rp : 1; + shubreg_t i_rsvd : 48; + } ii_ifdr_fld_s; +} ii_ifdr_u_t; + + +/************************************************************************ + * * + * This register allows the II to become sluggish in removing * + * messages from its inbound queue (IIQ). This will cause messages to * + * back up in either virtual channel. Disabling the "molasses" mode * + * subsequently allows the II to be tested under stress. In the * + * sluggish ("Molasses") mode, the localized effects of congestion * + * can be observed. * + * * + ************************************************************************/ + +typedef union ii_iiap_u { + shubreg_t ii_iiap_regval; + struct { + shubreg_t i_rq_mls : 6; + shubreg_t i_rsvd_1 : 2; + shubreg_t i_rp_mls : 6; + shubreg_t i_rsvd : 50; + } ii_iiap_fld_s; +} ii_iiap_u_t; + + +/************************************************************************ + * * + * This register allows several parameters of CRB operation to be * + * set. Note that writing to this register can have catastrophic side * + * effects, if the CRB is not quiescent, i.e. if the CRB is * + * processing protocol messages when the write occurs. * + * * + ************************************************************************/ + +typedef union ii_icmr_u { + shubreg_t ii_icmr_regval; + struct { + shubreg_t i_sp_msg : 1; + shubreg_t i_rd_hdr : 1; + shubreg_t i_rsvd_4 : 2; + shubreg_t i_c_cnt : 4; + shubreg_t i_rsvd_3 : 4; + shubreg_t i_clr_rqpd : 1; + shubreg_t i_clr_rppd : 1; + shubreg_t i_rsvd_2 : 2; + shubreg_t i_fc_cnt : 4; + shubreg_t i_crb_vld : 15; + shubreg_t i_crb_mark : 15; + shubreg_t i_rsvd_1 : 2; + shubreg_t i_precise : 1; + shubreg_t i_rsvd : 11; + } ii_icmr_fld_s; +} ii_icmr_u_t; + + +/************************************************************************ + * * + * This register allows control of the table portion of the CRB * + * logic via software. Control operations from this register have * + * priority over all incoming Crosstalk or BTE requests. * + * * + ************************************************************************/ + +typedef union ii_iccr_u { + shubreg_t ii_iccr_regval; + struct { + shubreg_t i_crb_num : 4; + shubreg_t i_rsvd_1 : 4; + shubreg_t i_cmd : 8; + shubreg_t i_pending : 1; + shubreg_t i_rsvd : 47; + } ii_iccr_fld_s; +} ii_iccr_u_t; + + +/************************************************************************ + * * + * This register allows the maximum timeout value to be programmed. * + * * + ************************************************************************/ + +typedef union ii_icto_u { + shubreg_t ii_icto_regval; + struct { + shubreg_t i_timeout : 8; + shubreg_t i_rsvd : 56; + } ii_icto_fld_s; +} ii_icto_u_t; + + +/************************************************************************ + * * + * This register allows the timeout prescalar to be programmed. An * + * internal counter is associated with this register. When the * + * internal counter reaches the value of the PRESCALE field, the * + * timer registers in all valid CRBs are incremented (CRBx_D[TIMEOUT] * + * field). The internal counter resets to zero, and then continues * + * counting. * + * * + ************************************************************************/ + +typedef union ii_ictp_u { + shubreg_t ii_ictp_regval; + struct { + shubreg_t i_prescale : 24; + shubreg_t i_rsvd : 40; + } ii_ictp_fld_s; +} ii_ictp_u_t; + + +/************************************************************************ + * * + * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are * + * used for Crosstalk operations (both cacheline and partial * + * operations) or BTE/IO. Because the CRB entries are very wide, five * + * registers (_A to _E) are required to read and write each entry. * + * The CRB Entry registers can be conceptualized as rows and columns * + * (illustrated in the table above). Each row contains the 4 * + * registers required for a single CRB Entry. The first doubleword * + * (column) for each entry is labeled A, and the second doubleword * + * (higher address) is labeled B, the third doubleword is labeled C, * + * the fourth doubleword is labeled D and the fifth doubleword is * + * labeled E. All CRB entries have their addresses on a quarter * + * cacheline aligned boundary. * + * Upon reset, only the following fields are initialized: valid * + * (VLD), priority count, timeout, timeout valid, and context valid. * + * All other bits should be cleared by software before use (after * + * recovering any potential error state from before the reset). * + * The following four tables summarize the format for the four * + * registers that are used for each ICRB# Entry. * + * * + ************************************************************************/ + +typedef union ii_icrb0_a_u { + shubreg_t ii_icrb0_a_regval; + struct { + shubreg_t ia_iow : 1; + shubreg_t ia_vld : 1; + shubreg_t ia_addr : 47; + shubreg_t ia_tnum : 5; + shubreg_t ia_sidn : 4; + shubreg_t ia_rsvd : 6; + } ii_icrb0_a_fld_s; +} ii_icrb0_a_u_t; + + +/************************************************************************ + * * + * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are * + * used for Crosstalk operations (both cacheline and partial * + * operations) or BTE/IO. Because the CRB entries are very wide, five * + * registers (_A to _E) are required to read and write each entry. * + * * + ************************************************************************/ + +typedef union ii_icrb0_b_u { + shubreg_t ii_icrb0_b_regval; + struct { + shubreg_t ib_xt_err : 1; + shubreg_t ib_mark : 1; + shubreg_t ib_ln_uce : 1; + shubreg_t ib_errcode : 3; + shubreg_t ib_error : 1; + shubreg_t ib_stall__bte_1 : 1; + shubreg_t ib_stall__bte_0 : 1; + shubreg_t ib_stall__intr : 1; + shubreg_t ib_stall_ib : 1; + shubreg_t ib_intvn : 1; + shubreg_t ib_wb : 1; + shubreg_t ib_hold : 1; + shubreg_t ib_ack : 1; + shubreg_t ib_resp : 1; + shubreg_t ib_ack_cnt : 11; + shubreg_t ib_rsvd : 7; + shubreg_t ib_exc : 5; + shubreg_t ib_init : 3; + shubreg_t ib_imsg : 8; + shubreg_t ib_imsgtype : 2; + shubreg_t ib_use_old : 1; + shubreg_t ib_rsvd_1 : 11; + } ii_icrb0_b_fld_s; +} ii_icrb0_b_u_t; + + +/************************************************************************ + * * + * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are * + * used for Crosstalk operations (both cacheline and partial * + * operations) or BTE/IO. Because the CRB entries are very wide, five * + * registers (_A to _E) are required to read and write each entry. * + * * + ************************************************************************/ + +typedef union ii_icrb0_c_u { + shubreg_t ii_icrb0_c_regval; + struct { + shubreg_t ic_source : 15; + shubreg_t ic_size : 2; + shubreg_t ic_ct : 1; + shubreg_t ic_bte_num : 1; + shubreg_t ic_gbr : 1; + shubreg_t ic_resprqd : 1; + shubreg_t ic_bo : 1; + shubreg_t ic_suppl : 15; + shubreg_t ic_rsvd : 27; + } ii_icrb0_c_fld_s; +} ii_icrb0_c_u_t; + + +/************************************************************************ + * * + * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are * + * used for Crosstalk operations (both cacheline and partial * + * operations) or BTE/IO. Because the CRB entries are very wide, five * + * registers (_A to _E) are required to read and write each entry. * + * * + ************************************************************************/ + +typedef union ii_icrb0_d_u { + shubreg_t ii_icrb0_d_regval; + struct { + shubreg_t id_pa_be : 43; + shubreg_t id_bte_op : 1; + shubreg_t id_pr_psc : 4; + shubreg_t id_pr_cnt : 4; + shubreg_t id_sleep : 1; + shubreg_t id_rsvd : 11; + } ii_icrb0_d_fld_s; +} ii_icrb0_d_u_t; + + +/************************************************************************ + * * + * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are * + * used for Crosstalk operations (both cacheline and partial * + * operations) or BTE/IO. Because the CRB entries are very wide, five * + * registers (_A to _E) are required to read and write each entry. * + * * + ************************************************************************/ + +typedef union ii_icrb0_e_u { + shubreg_t ii_icrb0_e_regval; + struct { + shubreg_t ie_timeout : 8; + shubreg_t ie_context : 15; + shubreg_t ie_rsvd : 1; + shubreg_t ie_tvld : 1; + shubreg_t ie_cvld : 1; + shubreg_t ie_rsvd_0 : 38; + } ii_icrb0_e_fld_s; +} ii_icrb0_e_u_t; + + +/************************************************************************ + * * + * This register contains the lower 64 bits of the header of the * + * spurious message captured by II. Valid when the SP_MSG bit in ICMR * + * register is set. * + * * + ************************************************************************/ + +typedef union ii_icsml_u { + shubreg_t ii_icsml_regval; + struct { + shubreg_t i_tt_addr : 47; + shubreg_t i_newsuppl_ex : 14; + shubreg_t i_reserved : 2; + shubreg_t i_overflow : 1; + } ii_icsml_fld_s; +} ii_icsml_u_t; + + +/************************************************************************ + * * + * This register contains the middle 64 bits of the header of the * + * spurious message captured by II. Valid when the SP_MSG bit in ICMR * + * register is set. * + * * + ************************************************************************/ + +typedef union ii_icsmm_u { + shubreg_t ii_icsmm_regval; + struct { + shubreg_t i_tt_ack_cnt : 11; + shubreg_t i_reserved : 53; + } ii_icsmm_fld_s; +} ii_icsmm_u_t; + + +/************************************************************************ + * * + * This register contains the microscopic state, all the inputs to * + * the protocol table, captured with the spurious message. Valid when * + * the SP_MSG bit in the ICMR register is set. * + * * + ************************************************************************/ + +typedef union ii_icsmh_u { + shubreg_t ii_icsmh_regval; + struct { + shubreg_t i_tt_vld : 1; + shubreg_t i_xerr : 1; + shubreg_t i_ft_cwact_o : 1; + shubreg_t i_ft_wact_o : 1; + shubreg_t i_ft_active_o : 1; + shubreg_t i_sync : 1; + shubreg_t i_mnusg : 1; + shubreg_t i_mnusz : 1; + shubreg_t i_plusz : 1; + shubreg_t i_plusg : 1; + shubreg_t i_tt_exc : 5; + shubreg_t i_tt_wb : 1; + shubreg_t i_tt_hold : 1; + shubreg_t i_tt_ack : 1; + shubreg_t i_tt_resp : 1; + shubreg_t i_tt_intvn : 1; + shubreg_t i_g_stall_bte1 : 1; + shubreg_t i_g_stall_bte0 : 1; + shubreg_t i_g_stall_il : 1; + shubreg_t i_g_stall_ib : 1; + shubreg_t i_tt_imsg : 8; + shubreg_t i_tt_imsgtype : 2; + shubreg_t i_tt_use_old : 1; + shubreg_t i_tt_respreqd : 1; + shubreg_t i_tt_bte_num : 1; + shubreg_t i_cbn : 1; + shubreg_t i_match : 1; + shubreg_t i_rpcnt_lt_34 : 1; + shubreg_t i_rpcnt_ge_34 : 1; + shubreg_t i_rpcnt_lt_18 : 1; + shubreg_t i_rpcnt_ge_18 : 1; + shubreg_t i_rpcnt_lt_2 : 1; + shubreg_t i_rpcnt_ge_2 : 1; + shubreg_t i_rqcnt_lt_18 : 1; + shubreg_t i_rqcnt_ge_18 : 1; + shubreg_t i_rqcnt_lt_2 : 1; + shubreg_t i_rqcnt_ge_2 : 1; + shubreg_t i_tt_device : 7; + shubreg_t i_tt_init : 3; + shubreg_t i_reserved : 5; + } ii_icsmh_fld_s; +} ii_icsmh_u_t; + + +/************************************************************************ + * * + * The Shub DEBUG unit provides a 3-bit selection signal to the * + * II core and a 3-bit selection signal to the fsbclk domain in the II * + * wrapper. * + * * + ************************************************************************/ + +typedef union ii_idbss_u { + shubreg_t ii_idbss_regval; + struct { + shubreg_t i_iioclk_core_submenu : 3; + shubreg_t i_rsvd : 5; + shubreg_t i_fsbclk_wrapper_submenu : 3; + shubreg_t i_rsvd_1 : 5; + shubreg_t i_iioclk_menu : 5; + shubreg_t i_rsvd_2 : 43; + } ii_idbss_fld_s; +} ii_idbss_u_t; + + +/************************************************************************ + * * + * Description: This register is used to set up the length for a * + * transfer and then to monitor the progress of that transfer. This * + * register needs to be initialized before a transfer is started. A * + * legitimate write to this register will set the Busy bit, clear the * + * Error bit, and initialize the length to the value desired. * + * While the transfer is in progress, hardware will decrement the * + * length field with each successful block that is copied. Once the * + * transfer completes, hardware will clear the Busy bit. The length * + * field will also contain the number of cache lines left to be * + * transferred. * + * * + ************************************************************************/ + +typedef union ii_ibls0_u { + shubreg_t ii_ibls0_regval; + struct { + shubreg_t i_length : 16; + shubreg_t i_error : 1; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_busy : 1; + shubreg_t i_rsvd : 43; + } ii_ibls0_fld_s; +} ii_ibls0_u_t; + + +/************************************************************************ + * * + * This register should be loaded before a transfer is started. The * + * address to be loaded in bits 39:0 is the 40-bit TRex+ physical * + * address as described in Section 1.3, Figure2 and Figure3. Since * + * the bottom 7 bits of the address are always taken to be zero, BTE * + * transfers are always cacheline-aligned. * + * * + ************************************************************************/ + +typedef union ii_ibsa0_u { + shubreg_t ii_ibsa0_regval; + struct { + shubreg_t i_rsvd_1 : 7; + shubreg_t i_addr : 42; + shubreg_t i_rsvd : 15; + } ii_ibsa0_fld_s; +} ii_ibsa0_u_t; + + +/************************************************************************ + * * + * This register should be loaded before a transfer is started. The * + * address to be loaded in bits 39:0 is the 40-bit TRex+ physical * + * address as described in Section 1.3, Figure2 and Figure3. Since * + * the bottom 7 bits of the address are always taken to be zero, BTE * + * transfers are always cacheline-aligned. * + * * + ************************************************************************/ + +typedef union ii_ibda0_u { + shubreg_t ii_ibda0_regval; + struct { + shubreg_t i_rsvd_1 : 7; + shubreg_t i_addr : 42; + shubreg_t i_rsvd : 15; + } ii_ibda0_fld_s; +} ii_ibda0_u_t; + + +/************************************************************************ + * * + * Writing to this register sets up the attributes of the transfer * + * and initiates the transfer operation. Reading this register has * + * the side effect of terminating any transfer in progress. Note: * + * stopping a transfer midstream could have an adverse impact on the * + * other BTE. If a BTE stream has to be stopped (due to error * + * handling for example), both BTE streams should be stopped and * + * their transfers discarded. * + * * + ************************************************************************/ + +typedef union ii_ibct0_u { + shubreg_t ii_ibct0_regval; + struct { + shubreg_t i_zerofill : 1; + shubreg_t i_rsvd_2 : 3; + shubreg_t i_notify : 1; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_poison : 1; + shubreg_t i_rsvd : 55; + } ii_ibct0_fld_s; +} ii_ibct0_u_t; + + +/************************************************************************ + * * + * This register contains the address to which the WINV is sent. * + * This address has to be cache line aligned. * + * * + ************************************************************************/ + +typedef union ii_ibna0_u { + shubreg_t ii_ibna0_regval; + struct { + shubreg_t i_rsvd_1 : 7; + shubreg_t i_addr : 42; + shubreg_t i_rsvd : 15; + } ii_ibna0_fld_s; +} ii_ibna0_u_t; + + +/************************************************************************ + * * + * This register contains the programmable level as well as the node * + * ID and PI unit of the processor to which the interrupt will be * + * sent. * + * * + ************************************************************************/ + +typedef union ii_ibia0_u { + shubreg_t ii_ibia0_regval; + struct { + shubreg_t i_rsvd_2 : 1; + shubreg_t i_node_id : 11; + shubreg_t i_rsvd_1 : 4; + shubreg_t i_level : 7; + shubreg_t i_rsvd : 41; + } ii_ibia0_fld_s; +} ii_ibia0_u_t; + + +/************************************************************************ + * * + * Description: This register is used to set up the length for a * + * transfer and then to monitor the progress of that transfer. This * + * register needs to be initialized before a transfer is started. A * + * legitimate write to this register will set the Busy bit, clear the * + * Error bit, and initialize the length to the value desired. * + * While the transfer is in progress, hardware will decrement the * + * length field with each successful block that is copied. Once the * + * transfer completes, hardware will clear the Busy bit. The length * + * field will also contain the number of cache lines left to be * + * transferred. * + * * + ************************************************************************/ + +typedef union ii_ibls1_u { + shubreg_t ii_ibls1_regval; + struct { + shubreg_t i_length : 16; + shubreg_t i_error : 1; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_busy : 1; + shubreg_t i_rsvd : 43; + } ii_ibls1_fld_s; +} ii_ibls1_u_t; + + +/************************************************************************ + * * + * This register should be loaded before a transfer is started. The * + * address to be loaded in bits 39:0 is the 40-bit TRex+ physical * + * address as described in Section 1.3, Figure2 and Figure3. Since * + * the bottom 7 bits of the address are always taken to be zero, BTE * + * transfers are always cacheline-aligned. * + * * + ************************************************************************/ + +typedef union ii_ibsa1_u { + shubreg_t ii_ibsa1_regval; + struct { + shubreg_t i_rsvd_1 : 7; + shubreg_t i_addr : 33; + shubreg_t i_rsvd : 24; + } ii_ibsa1_fld_s; +} ii_ibsa1_u_t; + + +/************************************************************************ + * * + * This register should be loaded before a transfer is started. The * + * address to be loaded in bits 39:0 is the 40-bit TRex+ physical * + * address as described in Section 1.3, Figure2 and Figure3. Since * + * the bottom 7 bits of the address are always taken to be zero, BTE * + * transfers are always cacheline-aligned. * + * * + ************************************************************************/ + +typedef union ii_ibda1_u { + shubreg_t ii_ibda1_regval; + struct { + shubreg_t i_rsvd_1 : 7; + shubreg_t i_addr : 33; + shubreg_t i_rsvd : 24; + } ii_ibda1_fld_s; +} ii_ibda1_u_t; + + +/************************************************************************ + * * + * Writing to this register sets up the attributes of the transfer * + * and initiates the transfer operation. Reading this register has * + * the side effect of terminating any transfer in progress. Note: * + * stopping a transfer midstream could have an adverse impact on the * + * other BTE. If a BTE stream has to be stopped (due to error * + * handling for example), both BTE streams should be stopped and * + * their transfers discarded. * + * * + ************************************************************************/ + +typedef union ii_ibct1_u { + shubreg_t ii_ibct1_regval; + struct { + shubreg_t i_zerofill : 1; + shubreg_t i_rsvd_2 : 3; + shubreg_t i_notify : 1; + shubreg_t i_rsvd_1 : 3; + shubreg_t i_poison : 1; + shubreg_t i_rsvd : 55; + } ii_ibct1_fld_s; +} ii_ibct1_u_t; + + +/************************************************************************ + * * + * This register contains the address to which the WINV is sent. * + * This address has to be cache line aligned. * + * * + ************************************************************************/ + +typedef union ii_ibna1_u { + shubreg_t ii_ibna1_regval; + struct { + shubreg_t i_rsvd_1 : 7; + shubreg_t i_addr : 33; + shubreg_t i_rsvd : 24; + } ii_ibna1_fld_s; +} ii_ibna1_u_t; + + +/************************************************************************ + * * + * This register contains the programmable level as well as the node * + * ID and PI unit of the processor to which the interrupt will be * + * sent. * + * * + ************************************************************************/ + +typedef union ii_ibia1_u { + shubreg_t ii_ibia1_regval; + struct { + shubreg_t i_pi_id : 1; + shubreg_t i_node_id : 8; + shubreg_t i_rsvd_1 : 7; + shubreg_t i_level : 7; + shubreg_t i_rsvd : 41; + } ii_ibia1_fld_s; +} ii_ibia1_u_t; + + +/************************************************************************ + * * + * This register defines the resources that feed information into * + * the two performance counters located in the IO Performance * + * Profiling Register. There are 17 different quantities that can be * + * measured. Given these 17 different options, the two performance * + * counters have 15 of them in common; menu selections 0 through 0xE * + * are identical for each performance counter. As for the other two * + * options, one is available from one performance counter and the * + * other is available from the other performance counter. Hence, the * + * II supports all 17*16=272 possible combinations of quantities to * + * measure. * + * * + ************************************************************************/ + +typedef union ii_ipcr_u { + shubreg_t ii_ipcr_regval; + struct { + shubreg_t i_ippr0_c : 4; + shubreg_t i_ippr1_c : 4; + shubreg_t i_icct : 8; + shubreg_t i_rsvd : 48; + } ii_ipcr_fld_s; +} ii_ipcr_u_t; + + +/************************************************************************ + * * + * * + * * + ************************************************************************/ + +typedef union ii_ippr_u { + shubreg_t ii_ippr_regval; + struct { + shubreg_t i_ippr0 : 32; + shubreg_t i_ippr1 : 32; + } ii_ippr_fld_s; +} ii_ippr_u_t; + + +#endif /* __ASSEMBLY__ */ + +/************************************************************************** + * * + * The following defines which were not formed into structures are * + * probably indentical to another register, and the name of the * + * register is provided against each of these registers. This * + * information needs to be checked carefully * + * * + * IIO_ICRB1_A IIO_ICRB0_A * + * IIO_ICRB1_B IIO_ICRB0_B * + * IIO_ICRB1_C IIO_ICRB0_C * + * IIO_ICRB1_D IIO_ICRB0_D * + * IIO_ICRB1_E IIO_ICRB0_E * + * IIO_ICRB2_A IIO_ICRB0_A * + * IIO_ICRB2_B IIO_ICRB0_B * + * IIO_ICRB2_C IIO_ICRB0_C * + * IIO_ICRB2_D IIO_ICRB0_D * + * IIO_ICRB2_E IIO_ICRB0_E * + * IIO_ICRB3_A IIO_ICRB0_A * + * IIO_ICRB3_B IIO_ICRB0_B * + * IIO_ICRB3_C IIO_ICRB0_C * + * IIO_ICRB3_D IIO_ICRB0_D * + * IIO_ICRB3_E IIO_ICRB0_E * + * IIO_ICRB4_A IIO_ICRB0_A * + * IIO_ICRB4_B IIO_ICRB0_B * + * IIO_ICRB4_C IIO_ICRB0_C * + * IIO_ICRB4_D IIO_ICRB0_D * + * IIO_ICRB4_E IIO_ICRB0_E * + * IIO_ICRB5_A IIO_ICRB0_A * + * IIO_ICRB5_B IIO_ICRB0_B * + * IIO_ICRB5_C IIO_ICRB0_C * + * IIO_ICRB5_D IIO_ICRB0_D * + * IIO_ICRB5_E IIO_ICRB0_E * + * IIO_ICRB6_A IIO_ICRB0_A * + * IIO_ICRB6_B IIO_ICRB0_B * + * IIO_ICRB6_C IIO_ICRB0_C * + * IIO_ICRB6_D IIO_ICRB0_D * + * IIO_ICRB6_E IIO_ICRB0_E * + * IIO_ICRB7_A IIO_ICRB0_A * + * IIO_ICRB7_B IIO_ICRB0_B * + * IIO_ICRB7_C IIO_ICRB0_C * + * IIO_ICRB7_D IIO_ICRB0_D * + * IIO_ICRB7_E IIO_ICRB0_E * + * IIO_ICRB8_A IIO_ICRB0_A * + * IIO_ICRB8_B IIO_ICRB0_B * + * IIO_ICRB8_C IIO_ICRB0_C * + * IIO_ICRB8_D IIO_ICRB0_D * + * IIO_ICRB8_E IIO_ICRB0_E * + * IIO_ICRB9_A IIO_ICRB0_A * + * IIO_ICRB9_B IIO_ICRB0_B * + * IIO_ICRB9_C IIO_ICRB0_C * + * IIO_ICRB9_D IIO_ICRB0_D * + * IIO_ICRB9_E IIO_ICRB0_E * + * IIO_ICRBA_A IIO_ICRB0_A * + * IIO_ICRBA_B IIO_ICRB0_B * + * IIO_ICRBA_C IIO_ICRB0_C * + * IIO_ICRBA_D IIO_ICRB0_D * + * IIO_ICRBA_E IIO_ICRB0_E * + * IIO_ICRBB_A IIO_ICRB0_A * + * IIO_ICRBB_B IIO_ICRB0_B * + * IIO_ICRBB_C IIO_ICRB0_C * + * IIO_ICRBB_D IIO_ICRB0_D * + * IIO_ICRBB_E IIO_ICRB0_E * + * IIO_ICRBC_A IIO_ICRB0_A * + * IIO_ICRBC_B IIO_ICRB0_B * + * IIO_ICRBC_C IIO_ICRB0_C * + * IIO_ICRBC_D IIO_ICRB0_D * + * IIO_ICRBC_E IIO_ICRB0_E * + * IIO_ICRBD_A IIO_ICRB0_A * + * IIO_ICRBD_B IIO_ICRB0_B * + * IIO_ICRBD_C IIO_ICRB0_C * + * IIO_ICRBD_D IIO_ICRB0_D * + * IIO_ICRBD_E IIO_ICRB0_E * + * IIO_ICRBE_A IIO_ICRB0_A * + * IIO_ICRBE_B IIO_ICRB0_B * + * IIO_ICRBE_C IIO_ICRB0_C * + * IIO_ICRBE_D IIO_ICRB0_D * + * IIO_ICRBE_E IIO_ICRB0_E * + * * + **************************************************************************/ + + +/* + * Slightly friendlier names for some common registers. + */ +#define IIO_WIDGET IIO_WID /* Widget identification */ +#define IIO_WIDGET_STAT IIO_WSTAT /* Widget status register */ +#define IIO_WIDGET_CTRL IIO_WCR /* Widget control register */ +#define IIO_PROTECT IIO_ILAPR /* IO interface protection */ +#define IIO_PROTECT_OVRRD IIO_ILAPO /* IO protect override */ +#define IIO_OUTWIDGET_ACCESS IIO_IOWA /* Outbound widget access */ +#define IIO_INWIDGET_ACCESS IIO_IIWA /* Inbound widget access */ +#define IIO_INDEV_ERR_MASK IIO_IIDEM /* Inbound device error mask */ +#define IIO_LLP_CSR IIO_ILCSR /* LLP control and status */ +#define IIO_LLP_LOG IIO_ILLR /* LLP log */ +#define IIO_XTALKCC_TOUT IIO_IXCC /* Xtalk credit count timeout*/ +#define IIO_XTALKTT_TOUT IIO_IXTT /* Xtalk tail timeout */ +#define IIO_IO_ERR_CLR IIO_IECLR /* IO error clear */ +#define IIO_IGFX_0 IIO_IGFX0 +#define IIO_IGFX_1 IIO_IGFX1 +#define IIO_IBCT_0 IIO_IBCT0 +#define IIO_IBCT_1 IIO_IBCT1 +#define IIO_IBLS_0 IIO_IBLS0 +#define IIO_IBLS_1 IIO_IBLS1 +#define IIO_IBSA_0 IIO_IBSA0 +#define IIO_IBSA_1 IIO_IBSA1 +#define IIO_IBDA_0 IIO_IBDA0 +#define IIO_IBDA_1 IIO_IBDA1 +#define IIO_IBNA_0 IIO_IBNA0 +#define IIO_IBNA_1 IIO_IBNA1 +#define IIO_IBIA_0 IIO_IBIA0 +#define IIO_IBIA_1 IIO_IBIA1 +#define IIO_IOPRB_0 IIO_IPRB0 + +#define IIO_PRTE_A(_x) (IIO_IPRTE0_A + (8 * (_x))) +#define IIO_PRTE_B(_x) (IIO_IPRTE0_B + (8 * (_x))) +#define IIO_NUM_PRTES 8 /* Total number of PRB table entries */ +#define IIO_WIDPRTE_A(x) IIO_PRTE_A(((x) - 8)) /* widget ID to its PRTE num */ +#define IIO_WIDPRTE_B(x) IIO_PRTE_B(((x) - 8)) /* widget ID to its PRTE num */ + +#define IIO_NUM_IPRBS (9) + +#define IIO_LLP_CSR_IS_UP 0x00002000 +#define IIO_LLP_CSR_LLP_STAT_MASK 0x00003000 +#define IIO_LLP_CSR_LLP_STAT_SHFT 12 + +#define IIO_LLP_CB_MAX 0xffff /* in ILLR CB_CNT, Max Check Bit errors */ +#define IIO_LLP_SN_MAX 0xffff /* in ILLR SN_CNT, Max Sequence Number errors */ + +/* key to IIO_PROTECT_OVRRD */ +#define IIO_PROTECT_OVRRD_KEY 0x53474972756c6573ull /* "SGIrules" */ + +/* BTE register names */ +#define IIO_BTE_STAT_0 IIO_IBLS_0 /* Also BTE length/status 0 */ +#define IIO_BTE_SRC_0 IIO_IBSA_0 /* Also BTE source address 0 */ +#define IIO_BTE_DEST_0 IIO_IBDA_0 /* Also BTE dest. address 0 */ +#define IIO_BTE_CTRL_0 IIO_IBCT_0 /* Also BTE control/terminate 0 */ +#define IIO_BTE_NOTIFY_0 IIO_IBNA_0 /* Also BTE notification 0 */ +#define IIO_BTE_INT_0 IIO_IBIA_0 /* Also BTE interrupt 0 */ +#define IIO_BTE_OFF_0 0 /* Base offset from BTE 0 regs. */ +#define IIO_BTE_OFF_1 (IIO_IBLS_1 - IIO_IBLS_0) /* Offset from base to BTE 1 */ + +/* BTE register offsets from base */ +#define BTEOFF_STAT 0 +#define BTEOFF_SRC (IIO_BTE_SRC_0 - IIO_BTE_STAT_0) +#define BTEOFF_DEST (IIO_BTE_DEST_0 - IIO_BTE_STAT_0) +#define BTEOFF_CTRL (IIO_BTE_CTRL_0 - IIO_BTE_STAT_0) +#define BTEOFF_NOTIFY (IIO_BTE_NOTIFY_0 - IIO_BTE_STAT_0) +#define BTEOFF_INT (IIO_BTE_INT_0 - IIO_BTE_STAT_0) + + +/* names used in shub diags */ +#define IIO_BASE_BTE0 IIO_IBLS_0 +#define IIO_BASE_BTE1 IIO_IBLS_1 + +/* + * Macro which takes the widget number, and returns the + * IO PRB address of that widget. + * value _x is expected to be a widget number in the range + * 0, 8 - 0xF + */ +#define IIO_IOPRB(_x) (IIO_IOPRB_0 + ( ( (_x) < HUB_WIDGET_ID_MIN ? \ + (_x) : \ + (_x) - (HUB_WIDGET_ID_MIN-1)) << 3) ) + + +/* GFX Flow Control Node/Widget Register */ +#define IIO_IGFX_W_NUM_BITS 4 /* size of widget num field */ +#define IIO_IGFX_W_NUM_MASK ((1<> IIO_WSTAT_TXRETRY_SHFT) & \ + IIO_WSTAT_TXRETRY_MASK) + +/* Number of II perf. counters we can multiplex at once */ + +#define IO_PERF_SETS 32 + +#if __KERNEL__ +#ifndef __ASSEMBLY__ +#include +#include +#include +#include + +/* Bit for the widget in inbound access register */ +#define IIO_IIWA_WIDGET(_w) ((uint64_t)(1ULL << _w)) +/* Bit for the widget in outbound access register */ +#define IIO_IOWA_WIDGET(_w) ((uint64_t)(1ULL << _w)) + +/* NOTE: The following define assumes that we are going to get + * widget numbers from 8 thru F and the device numbers within + * widget from 0 thru 7. + */ +#define IIO_IIDEM_WIDGETDEV_MASK(w, d) ((uint64_t)(1ULL << (8 * ((w) - 8) + (d)))) + +/* IO Interrupt Destination Register */ +#define IIO_IIDSR_SENT_SHIFT 28 +#define IIO_IIDSR_SENT_MASK 0x30000000 +#define IIO_IIDSR_ENB_SHIFT 24 +#define IIO_IIDSR_ENB_MASK 0x01000000 +#define IIO_IIDSR_NODE_SHIFT 9 +#define IIO_IIDSR_NODE_MASK 0x000ff700 +#define IIO_IIDSR_PI_ID_SHIFT 8 +#define IIO_IIDSR_PI_ID_MASK 0x00000100 +#define IIO_IIDSR_LVL_SHIFT 0 +#define IIO_IIDSR_LVL_MASK 0x000000ff + +/* Xtalk timeout threshhold register (IIO_IXTT) */ +#define IXTT_RRSP_TO_SHFT 55 /* read response timeout */ +#define IXTT_RRSP_TO_MASK (0x1FULL << IXTT_RRSP_TO_SHFT) +#define IXTT_RRSP_PS_SHFT 32 /* read responsed TO prescalar */ +#define IXTT_RRSP_PS_MASK (0x7FFFFFULL << IXTT_RRSP_PS_SHFT) +#define IXTT_TAIL_TO_SHFT 0 /* tail timeout counter threshold */ +#define IXTT_TAIL_TO_MASK (0x3FFFFFFULL << IXTT_TAIL_TO_SHFT) + +/* + * The IO LLP control status register and widget control register + */ + +typedef union hubii_wcr_u { + uint64_t wcr_reg_value; + struct { + uint64_t wcr_widget_id: 4, /* LLP crossbar credit */ + wcr_tag_mode: 1, /* Tag mode */ + wcr_rsvd1: 8, /* Reserved */ + wcr_xbar_crd: 3, /* LLP crossbar credit */ + wcr_f_bad_pkt: 1, /* Force bad llp pkt enable */ + wcr_dir_con: 1, /* widget direct connect */ + wcr_e_thresh: 5, /* elasticity threshold */ + wcr_rsvd: 41; /* unused */ + } wcr_fields_s; +} hubii_wcr_t; + +#define iwcr_dir_con wcr_fields_s.wcr_dir_con + +/* The structures below are defined to extract and modify the ii +performance registers */ + +/* io_perf_sel allows the caller to specify what tests will be + performed */ + +typedef union io_perf_sel { + uint64_t perf_sel_reg; + struct { + uint64_t perf_ippr0 : 4, + perf_ippr1 : 4, + perf_icct : 8, + perf_rsvd : 48; + } perf_sel_bits; +} io_perf_sel_t; + +/* io_perf_cnt is to extract the count from the shub registers. Due to + hardware problems there is only one counter, not two. */ + +typedef union io_perf_cnt { + uint64_t perf_cnt; + struct { + uint64_t perf_cnt : 20, + perf_rsvd2 : 12, + perf_rsvd1 : 32; + } perf_cnt_bits; + +} io_perf_cnt_t; + +typedef union iprte_a { + shubreg_t entry; + struct { + shubreg_t i_rsvd_1 : 3; + shubreg_t i_addr : 38; + shubreg_t i_init : 3; + shubreg_t i_source : 8; + shubreg_t i_rsvd : 2; + shubreg_t i_widget : 4; + shubreg_t i_to_cnt : 5; + shubreg_t i_vld : 1; + } iprte_fields; +} iprte_a_t; + + +/* PIO MANAGEMENT */ +typedef struct hub_piomap_s *hub_piomap_t; + +extern hub_piomap_t +hub_piomap_alloc(devfs_handle_t dev, /* set up mapping for this device */ + device_desc_t dev_desc, /* device descriptor */ + iopaddr_t xtalk_addr, /* map for this xtalk_addr range */ + size_t byte_count, + size_t byte_count_max, /* maximum size of a mapping */ + unsigned flags); /* defined in sys/pio.h */ + +extern void hub_piomap_free(hub_piomap_t hub_piomap); + +extern caddr_t +hub_piomap_addr(hub_piomap_t hub_piomap, /* mapping resources */ + iopaddr_t xtalk_addr, /* map for this xtalk addr */ + size_t byte_count); /* map this many bytes */ + +extern void +hub_piomap_done(hub_piomap_t hub_piomap); + +extern caddr_t +hub_piotrans_addr( devfs_handle_t dev, /* translate to this device */ + device_desc_t dev_desc, /* device descriptor */ + iopaddr_t xtalk_addr, /* Crosstalk address */ + size_t byte_count, /* map this many bytes */ + unsigned flags); /* (currently unused) */ + +/* DMA MANAGEMENT */ +typedef struct hub_dmamap_s *hub_dmamap_t; + +extern hub_dmamap_t +hub_dmamap_alloc( devfs_handle_t dev, /* set up mappings for dev */ + device_desc_t dev_desc, /* device descriptor */ + size_t byte_count_max, /* max size of a mapping */ + unsigned flags); /* defined in dma.h */ + +extern void +hub_dmamap_free(hub_dmamap_t dmamap); + +extern iopaddr_t +hub_dmamap_addr( hub_dmamap_t dmamap, /* use mapping resources */ + paddr_t paddr, /* map for this address */ + size_t byte_count); /* map this many bytes */ + +extern alenlist_t +hub_dmamap_list( hub_dmamap_t dmamap, /* use mapping resources */ + alenlist_t alenlist, /* map this Addr/Length List */ + unsigned flags); + +extern void +hub_dmamap_done( hub_dmamap_t dmamap); /* done w/ mapping resources */ + +extern iopaddr_t +hub_dmatrans_addr( devfs_handle_t dev, /* translate for this device */ + device_desc_t dev_desc, /* device descriptor */ + paddr_t paddr, /* system physical address */ + size_t byte_count, /* length */ + unsigned flags); /* defined in dma.h */ + +extern alenlist_t +hub_dmatrans_list( devfs_handle_t dev, /* translate for this device */ + device_desc_t dev_desc, /* device descriptor */ + alenlist_t palenlist, /* system addr/length list */ + unsigned flags); /* defined in dma.h */ + +extern void +hub_dmamap_drain( hub_dmamap_t map); + +extern void +hub_dmaaddr_drain( devfs_handle_t vhdl, + paddr_t addr, + size_t bytes); + +extern void +hub_dmalist_drain( devfs_handle_t vhdl, + alenlist_t list); + + +/* INTERRUPT MANAGEMENT */ +typedef struct hub_intr_s *hub_intr_t; + +extern hub_intr_t +hub_intr_alloc( devfs_handle_t dev, /* which device */ + device_desc_t dev_desc, /* device descriptor */ + devfs_handle_t owner_dev); /* owner of this interrupt */ + +extern hub_intr_t +hub_intr_alloc_nothd(devfs_handle_t dev, /* which device */ + device_desc_t dev_desc, /* device descriptor */ + devfs_handle_t owner_dev); /* owner of this interrupt */ + +extern void +hub_intr_free(hub_intr_t intr_hdl); + +extern int +hub_intr_connect( hub_intr_t intr_hdl, /* xtalk intr resource hndl */ + xtalk_intr_setfunc_t setfunc, + /* func to set intr hw */ + void *setfunc_arg); /* arg to setfunc */ + +extern void +hub_intr_disconnect(hub_intr_t intr_hdl); + +extern devfs_handle_t +hub_intr_cpu_get(hub_intr_t intr_hdl); + +/* CONFIGURATION MANAGEMENT */ + +extern void +hub_provider_startup(devfs_handle_t hub); + +extern void +hub_provider_shutdown(devfs_handle_t hub); + +#define HUB_PIO_CONVEYOR 0x1 /* PIO in conveyor belt mode */ +#define HUB_PIO_FIRE_N_FORGET 0x2 /* PIO in fire-and-forget mode */ + +/* Flags that make sense to hub_widget_flags_set */ +#define HUB_WIDGET_FLAGS ( \ + HUB_PIO_CONVEYOR | \ + HUB_PIO_FIRE_N_FORGET \ + ) + + +typedef int hub_widget_flags_t; + +/* Set the PIO mode for a widget. These two functions perform the + * same operation, but hub_device_flags_set() takes a hardware graph + * vertex while hub_widget_flags_set() takes a nasid and widget + * number. In most cases, hub_device_flags_set() should be used. + */ +extern int hub_widget_flags_set(nasid_t nasid, + xwidgetnum_t widget_num, + hub_widget_flags_t flags); + +/* Depending on the flags set take the appropriate actions */ +extern int hub_device_flags_set(devfs_handle_t widget_dev, + hub_widget_flags_t flags); + + +/* Error Handling. */ +extern int hub_ioerror_handler(devfs_handle_t, int, int, struct io_error_s *); +extern int kl_ioerror_handler(cnodeid_t, cnodeid_t, cpuid_t, + int, paddr_t, caddr_t, ioerror_mode_t); +extern void hub_widget_reset(devfs_handle_t, xwidgetnum_t); +extern int hub_error_devenable(devfs_handle_t, int, int); +extern void hub_widgetdev_enable(devfs_handle_t, int); +extern void hub_widgetdev_shutdown(devfs_handle_t, int); +extern int hub_dma_enabled(devfs_handle_t); + +/* hubdev */ +extern void hubdev_init(void); +extern void hubdev_register(int (*attach_method)(devfs_handle_t)); +extern int hubdev_unregister(int (*attach_method)(devfs_handle_t)); +extern int hubdev_docallouts(devfs_handle_t hub); + +extern caddr_t hubdev_prombase_get(devfs_handle_t hub); +extern cnodeid_t hubdev_cnodeid_get(devfs_handle_t hub); + +#endif /* __ASSEMBLY__ */ +#endif /* _KERNEL */ +#endif /* _ASM_IA64_SN_SN2_SHUBIO_H */ + diff -urN linux-2.4.18/include/asm-ia64/sn/sn2/slotnum.h lia64-2.4/include/asm-ia64/sn/sn2/slotnum.h --- linux-2.4.18/include/asm-ia64/sn/sn2/slotnum.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn2/slotnum.h Mon Nov 19 23:23:00 2001 @@ -0,0 +1,41 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 1992 - 1997,2001 Silicon Graphics, Inc. All rights reserved. + */ + +#ifndef _ASM_IA64_SN_SN2_SLOTNUM_H +#define _ASM_IA64_SN_SN2_SLOTNUM_H + +#define SLOTNUM_MAXLENGTH 16 + +/* + * This file defines IO widget to slot/device assignments. + */ + + +/* This determines module to pnode mapping. */ + +#define NODESLOTS_PER_MODULE 1 +#define NODESLOTS_PER_MODULE_SHFT 1 + +#define SLOTNUM_NODE_CLASS 0x00 /* Node */ +#define SLOTNUM_ROUTER_CLASS 0x10 /* Router */ +#define SLOTNUM_XTALK_CLASS 0x20 /* Xtalk */ +#define SLOTNUM_MIDPLANE_CLASS 0x30 /* Midplane */ +#define SLOTNUM_XBOW_CLASS 0x40 /* Xbow */ +#define SLOTNUM_KNODE_CLASS 0x50 /* Kego node */ +#define SLOTNUM_PCI_CLASS 0x60 /* PCI widgets on XBridge */ +#define SLOTNUM_INVALID_CLASS 0xf0 /* Invalid */ + +#define SLOTNUM_CLASS_MASK 0xf0 +#define SLOTNUM_SLOT_MASK 0x0f + +#define SLOTNUM_GETCLASS(_sn) ((_sn) & SLOTNUM_CLASS_MASK) +#define SLOTNUM_GETSLOT(_sn) ((_sn) & SLOTNUM_SLOT_MASK) + + +#endif /* _ASM_IA64_SN_SN2_SLOTNUM_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn2/sn_private.h lia64-2.4/include/asm-ia64/sn/sn2/sn_private.h --- linux-2.4.18/include/asm-ia64/sn/sn2/sn_private.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn2/sn_private.h Mon Feb 4 17:48:58 2002 @@ -0,0 +1,251 @@ +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. + */ +#ifndef _ASM_IA64_SN_SN2_SN_PRIVATE_H +#define _ASM_IA64_SN_SN2_SN_PRIVATE_H + +#include +#include +#include +#include + +extern nasid_t master_nasid; + +/* promif.c */ +extern void he_arcs_set_vectors(void); +extern void mem_init(void); +extern void cpu_unenable(cpuid_t); +extern nasid_t get_lowest_nasid(void); +extern __psunsigned_t get_master_bridge_base(void); +extern void set_master_bridge_base(void); +extern int check_nasid_equiv(nasid_t, nasid_t); +extern nasid_t get_console_nasid(void); +extern char get_console_pcislot(void); + +extern int is_master_nasid_widget(nasid_t test_nasid, xwidgetnum_t test_wid); + +/* memsupport.c */ +extern void poison_state_alter_range(__psunsigned_t start, int len, int poison); +extern int memory_present(paddr_t); +extern int memory_read_accessible(paddr_t); +extern int memory_write_accessible(paddr_t); +extern void memory_set_access(paddr_t, int, int); +extern void show_dir_state(paddr_t, void (*)(char *, ...)); +extern void check_dir_state(nasid_t, int, void (*)(char *, ...)); +extern void set_dir_owner(paddr_t, int); +extern void set_dir_state(paddr_t, int); +extern void set_dir_state_POISONED(paddr_t); +extern void set_dir_state_UNOWNED(paddr_t); +extern int is_POISONED_dir_state(paddr_t); +extern int is_UNOWNED_dir_state(paddr_t); +extern void get_dir_ent(paddr_t paddr, int *state, + uint64_t *vec_ptr, hubreg_t *elo); + +/* intr.c */ +extern int intr_reserve_level(cpuid_t cpu, int level, int err, devfs_handle_t owner_dev, char *name); +extern void intr_unreserve_level(cpuid_t cpu, int level); +extern int intr_connect_level(cpuid_t cpu, int bit, ilvl_t mask_no, + intr_func_t intr_prefunc); +extern int intr_disconnect_level(cpuid_t cpu, int bit); +extern cpuid_t intr_heuristic(devfs_handle_t dev, device_desc_t dev_desc, + int req_bit,int intr_resflags,devfs_handle_t owner_dev, + char *intr_name,int *resp_bit); +extern void intr_block_bit(cpuid_t cpu, int bit); +extern void intr_unblock_bit(cpuid_t cpu, int bit); +extern void setrtvector(intr_func_t); +extern void install_cpuintr(cpuid_t cpu); +extern void install_dbgintr(cpuid_t cpu); +extern void install_tlbintr(cpuid_t cpu); +extern void hub_migrintr_init(cnodeid_t /*cnode*/); +extern int cause_intr_connect(int level, intr_func_t handler, uint intr_spl_mask); +extern int cause_intr_disconnect(int level); +extern void intr_dumpvec(cnodeid_t cnode, void (*pf)(char *, ...)); + +/* error_dump.c */ +extern char *hub_rrb_err_type[]; +extern char *hub_wrb_err_type[]; + +void nmi_dump(void); +void install_cpu_nmi_handler(int slice); + +/* klclock.c */ +extern void hub_rtc_init(cnodeid_t); + +/* bte.c */ +void bte_lateinit(void); +void bte_wait_for_xfer_completion(void *); + +/* klgraph.c */ +void klhwg_add_all_nodes(devfs_handle_t); +void klhwg_add_all_modules(devfs_handle_t); + +/* klidbg.c */ +void install_klidbg_functions(void); + +/* klnuma.c */ +extern void replicate_kernel_text(int numnodes); +extern __psunsigned_t get_freemem_start(cnodeid_t cnode); +extern void setup_replication_mask(int maxnodes); + +/* init.c */ +extern cnodeid_t get_compact_nodeid(void); /* get compact node id */ +extern void init_platform_nodepda(nodepda_t *npda, cnodeid_t node); +extern void init_platform_pda(cpuid_t cpu); +extern void per_cpu_init(void); +extern int is_fine_dirmode(void); +extern void update_node_information(cnodeid_t); + +/* shubio.c */ +extern void hubio_init(void); +extern void hub_merge_clean(nasid_t nasid); +extern void hub_set_piomode(nasid_t nasid, int conveyor); + +/* shuberror.c */ +extern void hub_error_init(cnodeid_t); +extern void dump_error_spool(cpuid_t cpu, void (*pf)(char *, ...)); +extern void hubni_error_handler(char *, int); +extern int check_ni_errors(void); + +/* Used for debugger to signal upper software a breakpoint has taken place */ + +extern void *debugger_update; +extern __psunsigned_t debugger_stopped; + +/* + * piomap, created by shub_pio_alloc. + * xtalk_info MUST BE FIRST, since this structure is cast to a + * xtalk_piomap_s by generic xtalk routines. + */ +struct hub_piomap_s { + struct xtalk_piomap_s hpio_xtalk_info;/* standard crosstalk pio info */ + devfs_handle_t hpio_hub; /* which shub's mapping registers are set up */ + short hpio_holdcnt; /* count of current users of bigwin mapping */ + char hpio_bigwin_num;/* if big window map, which one */ + int hpio_flags; /* defined below */ +}; +/* hub_piomap flags */ +#define HUB_PIOMAP_IS_VALID 0x1 +#define HUB_PIOMAP_IS_BIGWINDOW 0x2 +#define HUB_PIOMAP_IS_FIXED 0x4 + +#define hub_piomap_xt_piomap(hp) (&hp->hpio_xtalk_info) +#define hub_piomap_hub_v(hp) (hp->hpio_hub) +#define hub_piomap_winnum(hp) (hp->hpio_bigwin_num) + +/* + * dmamap, created by shub_pio_alloc. + * xtalk_info MUST BE FIRST, since this structure is cast to a + * xtalk_dmamap_s by generic xtalk routines. + */ +struct hub_dmamap_s { + struct xtalk_dmamap_s hdma_xtalk_info;/* standard crosstalk dma info */ + devfs_handle_t hdma_hub; /* which shub we go through */ + int hdma_flags; /* defined below */ +}; +/* shub_dmamap flags */ +#define HUB_DMAMAP_IS_VALID 0x1 +#define HUB_DMAMAP_USED 0x2 +#define HUB_DMAMAP_IS_FIXED 0x4 + +/* + * interrupt handle, created by shub_intr_alloc. + * xtalk_info MUST BE FIRST, since this structure is cast to a + * xtalk_intr_s by generic xtalk routines. + */ +struct hub_intr_s { + struct xtalk_intr_s i_xtalk_info; /* standard crosstalk intr info */ + ilvl_t i_swlevel; /* software level for blocking intr */ + cpuid_t i_cpuid; /* which cpu */ + int i_bit; /* which bit */ + int i_flags; +}; +/* flag values */ +#define HUB_INTR_IS_ALLOCED 0x1 /* for debug: allocated */ +#define HUB_INTR_IS_CONNECTED 0x4 /* for debug: connected to a software driver */ + +typedef struct hubinfo_s { + nodepda_t *h_nodepda; /* pointer to node's private data area */ + cnodeid_t h_cnodeid; /* compact nodeid */ + nasid_t h_nasid; /* nasid */ + + /* structures for PIO management */ + xwidgetnum_t h_widgetid; /* my widget # (as viewed from xbow) */ + struct hub_piomap_s h_small_window_piomap[HUB_WIDGET_ID_MAX+1]; + sv_t h_bwwait; /* wait for big window to free */ + spinlock_t h_bwlock; /* guard big window piomap's */ + spinlock_t h_crblock; /* gaurd CRB error handling */ + int h_num_big_window_fixed; /* count number of FIXED maps */ + struct hub_piomap_s h_big_window_piomap[HUB_NUM_BIG_WINDOW]; + hub_intr_t hub_ii_errintr; +} *hubinfo_t; + +#define hubinfo_get(vhdl, infoptr) ((void)hwgraph_info_get_LBL \ + (vhdl, INFO_LBL_NODE_INFO, (arbitrary_info_t *)infoptr)) + +#define hubinfo_set(vhdl, infoptr) (void)hwgraph_info_add_LBL \ + (vhdl, INFO_LBL_NODE_INFO, (arbitrary_info_t)infoptr) + +#define hubinfo_to_hubv(hinfo, hub_v) (hinfo->h_nodepda->node_vertex) + +/* + * Hub info PIO map access functions. + */ +#define hubinfo_bwin_piomap_get(hinfo, win) \ + (&hinfo->h_big_window_piomap[win]) +#define hubinfo_swin_piomap_get(hinfo, win) \ + (&hinfo->h_small_window_piomap[win]) + +/* cpu-specific information stored under INFO_LBL_CPU_INFO */ +typedef struct cpuinfo_s { + cpuid_t ci_cpuid; /* CPU ID */ +} *cpuinfo_t; + +#define cpuinfo_get(vhdl, infoptr) ((void)hwgraph_info_get_LBL \ + (vhdl, INFO_LBL_CPU_INFO, (arbitrary_info_t *)infoptr)) + +#define cpuinfo_set(vhdl, infoptr) (void)hwgraph_info_add_LBL \ + (vhdl, INFO_LBL_CPU_INFO, (arbitrary_info_t)infoptr) + +/* Special initialization function for xswitch vertices created during startup. */ +extern void xswitch_vertex_init(devfs_handle_t xswitch); + +extern xtalk_provider_t hub_provider; + +/* du.c */ +int ducons_write(char *buf, int len); + +/* memerror.c */ + +extern void install_eccintr(cpuid_t cpu); +extern void memerror_get_stats(cnodeid_t cnode, + int *bank_stats, int *bank_stats_max); +extern void probe_md_errors(nasid_t); +/* sysctlr.c */ +extern void sysctlr_init(void); +extern void sysctlr_power_off(int sdonly); +extern void sysctlr_keepalive(void); + +#define valid_cpuid(_x) (((_x) >= 0) && ((_x) < maxcpus)) + +/* Useful definitions to get the memory dimm given a physical + * address. + */ +#define paddr_dimm(_pa) ((_pa & MD_BANK_MASK) >> MD_BANK_SHFT) +#define paddr_cnode(_pa) (NASID_TO_COMPACT_NODEID(NASID_GET(_pa))) +extern void membank_pathname_get(paddr_t,char *); + +/* To redirect the output into the error buffer */ +#define errbuf_print(_s) printf("#%s",_s) + +extern void crbx(nasid_t nasid, void (*pf)(char *, ...)); +void bootstrap(void); + +/* sndrv.c */ +extern int sndrv_attach(devfs_handle_t vertex); + +#endif /* _ASM_IA64_SN_SN2_SN_PRIVATE_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn_cpuid.h lia64-2.4/include/asm-ia64/sn/sn_cpuid.h --- linux-2.4.18/include/asm-ia64/sn/sn_cpuid.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sn_cpuid.h Fri Jul 19 23:20:15 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Jack Steiner (steiner@sgi.com) + * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved. */ @@ -13,8 +12,13 @@ #define _ASM_IA64_SN_SN_CPUID_H #include -#include -#include +#include +#include +#include +#include +#include +#include + /* * Functions for converting between cpuids, nodeids and NASIDs. @@ -46,10 +50,15 @@ * * not real efficient - dont use in perf critical code * * LID - processor defined register (see PRM V2). + * + * On SN1 * 31:24 - id Contains the NASID * 23:16 - eid Contains 0-3 to identify the cpu on the node * bit 17 - synergy number * bit 16 - FSB slot number + * On SN2 + * 31:28 - id Contains 0-3 to identify the cpu on the node + * 27:16 - eid Contains the NASID * * * @@ -70,15 +79,15 @@ * | | * ------- ------- * | | | | - * | 0 | | 1 | SYNERGY + * | 0 | | 1 | SYNERGY (SN1 only) * | | | | * ------- ------- * | | * | | * ------------------------------- * | | - * | BEDROCK | NASID (0..127) - * | | CNODEID (0..numnodes-1) + * | BEDROCK / SHUB | NASID (0..MAX_NASIDS) + * | | CNODEID (0..num_compact_nodes-1) * | | * | | * ------------------------------- @@ -91,10 +100,25 @@ #define cpu_physical_id(cpuid) ((ia64_get_lid() >> 16) & 0xffff) #endif +#ifdef CONFIG_IA64_SGI_SN1 +/* + * macros for some of these exist in sn/addrs.h & sn/arch.h, etc. However, + * trying #include these files here causes circular dependencies. + */ #define cpu_physical_id_to_nasid(cpi) ((cpi) >> 8) #define cpu_physical_id_to_synergy(cpi) (((cpi) >> 1) & 1) #define cpu_physical_id_to_fsb_slot(cpi) ((cpi) & 1) #define cpu_physical_id_to_slice(cpi) ((cpi) & 3) +#define get_nasid() ((ia64_get_lid() >> 24)) +#define get_slice() ((ia64_get_lid() >> 16) & 3) +#define get_node_number(addr) (((unsigned long)(addr)>>33) & 0x7f) +#else +#define cpu_physical_id_to_nasid(cpi) ((cpi) &0xfff) +#define cpu_physical_id_to_slice(cpi) ((cpi>>12) & 3) +#define get_nasid() ((ia64_get_lid() >> 16) & 0xfff) +#define get_slice() ((ia64_get_lid() >> 28) & 0xf) +#define get_node_number(addr) (((unsigned long)(addr)>>38) & 0x7ff) +#endif /* * NOTE: id & eid refer to Intels definitions of the LID register @@ -118,15 +142,12 @@ +#ifdef CONFIG_IA64_SGI_SN1 /* * cpuid_to_fsb_slot - convert a cpuid to the fsb slot number that it is in. * (there are 2 cpus per FSB. This function returns 0 or 1) */ -static __inline__ int -cpuid_to_fsb_slot(int cpuid) -{ - return cpu_physical_id_to_fsb_slot(cpu_physical_id(cpuid)); -} +#define cpuid_to_fsb_slot(cpuid) (cpu_physical_id_to_fsb_slot(cpu_physical_id(cpuid))) /* @@ -134,108 +155,75 @@ * (there are 2 synergies per node. Function returns 0 or 1 to * specify which synergy the cpu is on) */ -static __inline__ int -cpuid_to_synergy(int cpuid) -{ - return cpu_physical_id_to_synergy(cpu_physical_id(cpuid)); -} +#define cpuid_to_synergy(cpuid) (cpu_physical_id_to_synergy(cpu_physical_id(cpuid))) +#endif /* * cpuid_to_slice - convert a cpuid to the slice that it resides on * There are 4 cpus per node. This function returns 0 .. 3) */ -static __inline__ int -cpuid_to_slice(int cpuid) -{ - return cpu_physical_id_to_slice(cpu_physical_id(cpuid)); -} +#define cpuid_to_slice(cpuid) (cpu_physical_id_to_slice(cpu_physical_id(cpuid))) /* * cpuid_to_nasid - convert a cpuid to the NASID that it resides on */ -static __inline__ int -cpuid_to_nasid(int cpuid) -{ - return cpu_physical_id_to_nasid(cpu_physical_id(cpuid)); -} +#define cpuid_to_nasid(cpuid) (cpu_physical_id_to_nasid(cpu_physical_id(cpuid))) /* * cpuid_to_cnodeid - convert a cpuid to the cnode that it resides on */ -static __inline__ int -cpuid_to_cnodeid(int cpuid) -{ - return nasid_map[cpuid_to_nasid(cpuid)]; -} +#define cpuid_to_cnodeid(cpuid) (local_node_data->physical_node_map[cpuid_to_nasid(cpuid)]) + /* * cnodeid_to_nasid - convert a cnodeid to a NASID + * Macro relies on pg_data for a node being on the node itself. + * Just extract the NASID from the pointer. + * */ -static __inline__ int -cnodeid_to_nasid(int cnodeid) -{ - if (nasid_map[cnodeid_map[cnodeid]] != cnodeid) - panic("cnodeid_to_nasid, cnode = %d", cnodeid); - return cnodeid_map[cnodeid]; -} +#define cnodeid_to_nasid(cnodeid) (get_node_number(local_node_data->pg_data_ptrs[cnodeid])) + /* * nasid_to_cnodeid - convert a NASID to a cnodeid */ -static __inline__ int -nasid_to_cnodeid(int nasid) -{ - if (cnodeid_map[nasid_map[nasid]] != nasid) - panic("nasid_to_cnodeid"); - return nasid_map[nasid]; -} +#define nasid_to_cnodeid(nasid) (local_node_data->physical_node_map[nasid]) /* * cnode_slice_to_cpuid - convert a codeid & slice to a cpuid */ -static __inline__ int -cnode_slice_to_cpuid(int cnodeid, int slice) { - return(id_eid_to_cpuid(cnodeid_to_nasid(cnodeid),slice)); -} +#define cnode_slice_to_cpuid(cnodeid,slice) (id_eid_to_cpuid(cnodeid_to_nasid(cnodeid),(slice))) + /* * cpuid_to_subnode - convert a cpuid to the subnode it resides on. * slice 0 & 1 are on subnode 0 * slice 2 & 3 are on subnode 1. */ -static __inline__ int -cpuid_to_subnode(int cpuid) { - int ret = cpuid_to_slice(cpuid); - if (ret < 2) return 0; - else return 1; -} +#define cpuid_to_subnode(cpuid) ((cpuid_to_slice(cpuid)<2) ? 0 : 1) + /* * cpuid_to_localslice - convert a cpuid to a local slice * slice 0 & 2 are local slice 0 * slice 1 & 3 are local slice 1 */ -static __inline__ int -cpuid_to_localslice(int cpuid) { - return(cpuid_to_slice(cpuid) & 1); -} - -static __inline__ int -cnodeid_to_cpuid(int cnode) { - int cpu; - - for (cpu = 0; cpu < smp_num_cpus; cpu++) { - if (cpuid_to_cnodeid(cpu) == cnode) { - break; - } - } - if (cpu == smp_num_cpus) cpu = -1; - return cpu; -} +#define cpuid_to_localslice(cpuid) (cpuid_to_slice(cpuid) & 1) + + +#define smp_physical_node_id() (cpuid_to_nasid(smp_processor_id())) + + +/* + * cnodeid_to_cpuid - convert a cnode to a cpuid of a cpu on the node. + * returns -1 if no cpus exist on the node + */ +extern int cnodeid_to_cpuid(int cnode); #endif /* _ASM_IA64_SN_SN_CPUID_H */ + diff -urN linux-2.4.18/include/asm-ia64/sn/sn_fru.h lia64-2.4/include/asm-ia64/sn/sn_fru.h --- linux-2.4.18/include/asm-ia64/sn/sn_fru.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sn_fru.h Mon Nov 19 23:23:00 2001 @@ -4,11 +4,11 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 1999-2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Patrick Gefre + * Copyright (C) 1992 - 1997, 1999-2001 Silicon Graphics, Inc. + * All rights reserved. */ -#ifndef _ASM_SN_SN_FRU_H -#define _ASM_SN_SN_FRU_H +#ifndef _ASM_IA64_SN_SN_FRU_H +#define _ASM_IA64_SN_SN_FRU_H #define MAX_DIMMS 8 /* max # of dimm banks */ #define MAX_PCIDEV 8 /* max # of pci devices on a pci bus */ @@ -42,5 +42,5 @@ } kf_pci_bus_t; -#endif /* _ASM_SN_SN_FRU_H */ +#endif /* _ASM_IA64_SN_SN_FRU_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn_pio_sync.h lia64-2.4/include/asm-ia64/sn/sn_pio_sync.h --- linux-2.4.18/include/asm-ia64/sn/sn_pio_sync.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sn_pio_sync.h Mon Feb 4 17:48:58 2002 @@ -0,0 +1,53 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001-2002 Silicon Graphics, Inc. All rights reserved. + */ + + +#ifndef _ASM_IA64_SN_SN_PIO_WRITE_SYNC_H +#define _ASM_IA64_SN_SN_PIO_WRITE_SYNC_H + +#include +#ifdef CONFIG_IA64_SGI_SN2 +#include +#include +#include +#include + +/* + * This macro flushes all outstanding PIOs performed by this cpu to the + * intended destination SHUB. This in essence ensures that all PIO's + * issues by this cpu has landed at it's destination. + * + * This macro expects the caller: + * 1. The thread is locked. + * 2. All prior PIO operations has been fenced with __ia64_mf_a(). + * + * The expectation is that get_slice() will return either 0 or 2. + * When we have multi-core cpu's, the expectation is get_slice() will + * return either 0,1 or 2,3. + */ + +#define SN_PIO_WRITE_SYNC \ + { \ + volatile unsigned long sn_pio_writes_done; \ + do { \ + sn_pio_writes_done = (volatile unsigned long) (SH_PIO_WRITE_STATUS_0_WRITES_OK_MASK & HUB_L( (unsigned long *)GLOBAL_MMR_ADDR(get_nasid(), (get_slice() < 2) ? SH_PIO_WRITE_STATUS_0 : SH_PIO_WRITE_STATUS_1 ))); \ + } while (!sn_pio_writes_done); \ + __ia64_mf_a(); \ + } +#else + +/* + * For all ARCHITECTURE type, this is a NOOP. + */ + +#define SN_PIO_WRITE_SYNC + +#endif + +#endif /* _ASM_IA64_SN_SN_PIO_WRITE_SYNC_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn_private.h lia64-2.4/include/asm-ia64/sn/sn_private.h --- linux-2.4.18/include/asm-ia64/sn/sn_private.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sn_private.h Mon Nov 19 23:23:00 2001 @@ -4,299 +4,20 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_PRIVATE_H -#define _ASM_SN_PRIVATE_H +#ifndef _ASM_IA64_SN_SN_PRIVATE_H +#define _ASM_IA64_SN_SN_PRIVATE_H +#include #include #include #include -extern nasid_t master_nasid; - -extern hubreg_t get_region(cnodeid_t); -extern hubreg_t nasid_to_region(nasid_t); -/* promif.c */ -#ifdef LATER -extern cpuid_t cpu_node_probe(cpumask_t *cpumask, int *numnodes); -#endif -extern void he_arcs_set_vectors(void); -extern void mem_init(void); -#ifdef LATER -extern int cpu_enabled(cpuid_t); -#endif -extern void cpu_unenable(cpuid_t); -extern nasid_t get_lowest_nasid(void); -extern __psunsigned_t get_master_bridge_base(void); -extern void set_master_bridge_base(void); -extern int check_nasid_equiv(nasid_t, nasid_t); -extern nasid_t get_console_nasid(void); -extern char get_console_pcislot(void); -#ifdef LATER -extern void intr_init_vecblk(nodepda_t *npda, cnodeid_t, int); -#endif - -extern int is_master_nasid_widget(nasid_t test_nasid, xwidgetnum_t test_wid); - -/* memsupport.c */ -extern void poison_state_alter_range(__psunsigned_t start, int len, int poison); -extern int memory_present(paddr_t); -extern int memory_read_accessible(paddr_t); -extern int memory_write_accessible(paddr_t); -extern void memory_set_access(paddr_t, int, int); -extern void show_dir_state(paddr_t, void (*)(char *, ...)); -extern void check_dir_state(nasid_t, int, void (*)(char *, ...)); -extern void set_dir_owner(paddr_t, int); -extern void set_dir_state(paddr_t, int); -extern void set_dir_state_POISONED(paddr_t); -extern void set_dir_state_UNOWNED(paddr_t); -extern int is_POISONED_dir_state(paddr_t); -extern int is_UNOWNED_dir_state(paddr_t); -extern void get_dir_ent(paddr_t paddr, int *state, - uint64_t *vec_ptr, hubreg_t *elo); - -/* intr.c */ -#if defined(NEW_INTERRUPTS) -extern int intr_reserve_level(cpuid_t cpu, int level, int err, devfs_handle_t owner_dev, char *name); -extern void intr_unreserve_level(cpuid_t cpu, int level); -extern int intr_connect_level(cpuid_t cpu, int bit, ilvl_t mask_no, - intr_func_t intr_func, void *intr_arg, - intr_func_t intr_prefunc); -extern int intr_disconnect_level(cpuid_t cpu, int bit); -extern cpuid_t intr_heuristic(devfs_handle_t dev, device_desc_t dev_desc, - int req_bit,int intr_resflags,devfs_handle_t owner_dev, - char *intr_name,int *resp_bit); -#endif /* NEW_INTERRUPTS */ -extern void intr_block_bit(cpuid_t cpu, int bit); -extern void intr_unblock_bit(cpuid_t cpu, int bit); -extern void setrtvector(intr_func_t); -extern void install_cpuintr(cpuid_t cpu); -extern void install_dbgintr(cpuid_t cpu); -extern void install_tlbintr(cpuid_t cpu); -extern void hub_migrintr_init(cnodeid_t /*cnode*/); -extern int cause_intr_connect(int level, intr_func_t handler, uint intr_spl_mask); -extern int cause_intr_disconnect(int level); -extern void intr_reserve_hardwired(cnodeid_t); -extern void intr_clear_all(nasid_t); -extern void intr_dumpvec(cnodeid_t cnode, void (*pf)(char *, ...)); -extern int protected_broadcast(hubreg_t intrbit); - -/* error_dump.c */ -extern char *hub_rrb_err_type[]; -extern char *hub_wrb_err_type[]; - -void nmi_dump(void); -void install_cpu_nmi_handler(int slice); - -/* klclock.c */ -extern void hub_rtc_init(cnodeid_t); - -/* bte.c */ -void bte_lateinit(void); -void bte_wait_for_xfer_completion(void *); - -/* klgraph.c */ -void klhwg_add_all_nodes(devfs_handle_t); -void klhwg_add_all_modules(devfs_handle_t); - -/* klidbg.c */ -void install_klidbg_functions(void); - -/* klnuma.c */ -extern void replicate_kernel_text(int numnodes); -extern __psunsigned_t get_freemem_start(cnodeid_t cnode); -extern void setup_replication_mask(int maxnodes); - -/* init.c */ -extern cnodeid_t get_compact_nodeid(void); /* get compact node id */ -#ifdef LATER -extern void init_platform_nodepda(nodepda_t *npda, cnodeid_t node); -extern void init_platform_pda(pda_t *ppda, cpuid_t cpu); +#if defined(CONFIG_IA64_SGI_SN1) +#include +#elif defined(CONFIG_IA64_SGI_SN2) +#include #endif -extern void per_cpu_init(void); -extern void per_hub_init(cnodeid_t); -#ifdef LATER -extern cpumask_t boot_cpumask; -#endif -extern int is_fine_dirmode(void); -extern void update_node_information(cnodeid_t); - -#ifdef LATER -/* clksupport.c */ -extern void early_counter_intr(eframe_t *); -#endif - -/* hubio.c */ -extern void hubio_init(void); -extern void hub_merge_clean(nasid_t nasid); -extern void hub_set_piomode(nasid_t nasid, int conveyor); - -/* huberror.c */ -extern void hub_error_init(cnodeid_t); -extern void dump_error_spool(cpuid_t cpu, void (*pf)(char *, ...)); -extern void hubni_error_handler(char *, int); -extern int check_ni_errors(void); - -/* Used for debugger to signal upper software a breakpoint has taken place */ - -extern void *debugger_update; -extern __psunsigned_t debugger_stopped; - -/* - * IP27 piomap, created by hub_pio_alloc. - * xtalk_info MUST BE FIRST, since this structure is cast to a - * xtalk_piomap_s by generic xtalk routines. - */ -struct hub_piomap_s { - struct xtalk_piomap_s hpio_xtalk_info;/* standard crosstalk pio info */ - devfs_handle_t hpio_hub; /* which hub's mapping registers are set up */ - short hpio_holdcnt; /* count of current users of bigwin mapping */ - char hpio_bigwin_num;/* if big window map, which one */ - int hpio_flags; /* defined below */ -}; -/* hub_piomap flags */ -#define HUB_PIOMAP_IS_VALID 0x1 -#define HUB_PIOMAP_IS_BIGWINDOW 0x2 -#define HUB_PIOMAP_IS_FIXED 0x4 - -#define hub_piomap_xt_piomap(hp) (&hp->hpio_xtalk_info) -#define hub_piomap_hub_v(hp) (hp->hpio_hub) -#define hub_piomap_winnum(hp) (hp->hpio_bigwin_num) - -#if TBD - /* Ensure that hpio_xtalk_info is first */ - #assert (&(((struct hub_piomap_s *)0)->hpio_xtalk_info) == 0) -#endif - - -/* - * IP27 dmamap, created by hub_pio_alloc. - * xtalk_info MUST BE FIRST, since this structure is cast to a - * xtalk_dmamap_s by generic xtalk routines. - */ -struct hub_dmamap_s { - struct xtalk_dmamap_s hdma_xtalk_info;/* standard crosstalk dma info */ - devfs_handle_t hdma_hub; /* which hub we go through */ - int hdma_flags; /* defined below */ -}; -/* hub_dmamap flags */ -#define HUB_DMAMAP_IS_VALID 0x1 -#define HUB_DMAMAP_USED 0x2 -#define HUB_DMAMAP_IS_FIXED 0x4 - -#if TBD - /* Ensure that hdma_xtalk_info is first */ - #assert (&(((struct hub_dmamap_s *)0)->hdma_xtalk_info) == 0) -#endif - -/* - * IP27 interrupt handle, created by hub_intr_alloc. - * xtalk_info MUST BE FIRST, since this structure is cast to a - * xtalk_intr_s by generic xtalk routines. - */ -struct hub_intr_s { - struct xtalk_intr_s i_xtalk_info; /* standard crosstalk intr info */ - ilvl_t i_swlevel; /* software level for blocking intr */ - cpuid_t i_cpuid; /* which cpu */ - int i_bit; /* which bit */ - int i_flags; -}; -/* flag values */ -#define HUB_INTR_IS_ALLOCED 0x1 /* for debug: allocated */ -#define HUB_INTR_IS_CONNECTED 0x4 /* for debug: connected to a software driver */ - -#if TBD - /* Ensure that i_xtalk_info is first */ - #assert (&(((struct hub_intr_s *)0)->i_xtalk_info) == 0) -#endif - - -/* IP27 hub-specific information stored under INFO_LBL_HUB_INFO */ -/* TBD: IP27-dependent stuff currently in nodepda.h should be here */ -typedef struct hubinfo_s { - nodepda_t *h_nodepda; /* pointer to node's private data area */ - cnodeid_t h_cnodeid; /* compact nodeid */ - nasid_t h_nasid; /* nasid */ - - /* structures for PIO management */ - xwidgetnum_t h_widgetid; /* my widget # (as viewed from xbow) */ - struct hub_piomap_s h_small_window_piomap[HUB_WIDGET_ID_MAX+1]; - sv_t h_bwwait; /* wait for big window to free */ - spinlock_t h_bwlock; /* guard big window piomap's */ - spinlock_t h_crblock; /* gaurd CRB error handling */ - int h_num_big_window_fixed; /* count number of FIXED maps */ - struct hub_piomap_s h_big_window_piomap[HUB_NUM_BIG_WINDOW]; - hub_intr_t hub_ii_errintr; -} *hubinfo_t; - -#define hubinfo_get(vhdl, infoptr) ((void)hwgraph_info_get_LBL \ - (vhdl, INFO_LBL_NODE_INFO, (arbitrary_info_t *)infoptr)) - -#define hubinfo_set(vhdl, infoptr) (void)hwgraph_info_add_LBL \ - (vhdl, INFO_LBL_NODE_INFO, (arbitrary_info_t)infoptr) - -#define hubinfo_to_hubv(hinfo, hub_v) (hinfo->h_nodepda->node_vertex) - -/* - * Hub info PIO map access functions. - */ -#define hubinfo_bwin_piomap_get(hinfo, win) \ - (&hinfo->h_big_window_piomap[win]) -#define hubinfo_swin_piomap_get(hinfo, win) \ - (&hinfo->h_small_window_piomap[win]) - -/* IP27 cpu-specific information stored under INFO_LBL_CPU_INFO */ -/* TBD: IP27-dependent stuff currently in pda.h should be here */ -typedef struct cpuinfo_s { -#ifdef LATER - pda_t *ci_cpupda; /* pointer to CPU's private data area */ -#endif - cpuid_t ci_cpuid; /* CPU ID */ -} *cpuinfo_t; - -#define cpuinfo_get(vhdl, infoptr) ((void)hwgraph_info_get_LBL \ - (vhdl, INFO_LBL_CPU_INFO, (arbitrary_info_t *)infoptr)) - -#define cpuinfo_set(vhdl, infoptr) (void)hwgraph_info_add_LBL \ - (vhdl, INFO_LBL_CPU_INFO, (arbitrary_info_t)infoptr) - -/* Special initialization function for xswitch vertices created during startup. */ -extern void xswitch_vertex_init(devfs_handle_t xswitch); - -extern xtalk_provider_t hub_provider; - -/* du.c */ -int ducons_write(char *buf, int len); - -/* memerror.c */ - -extern void install_eccintr(cpuid_t cpu); -extern void memerror_get_stats(cnodeid_t cnode, - int *bank_stats, int *bank_stats_max); -extern void probe_md_errors(nasid_t); -/* sysctlr.c */ -extern void sysctlr_init(void); -extern void sysctlr_power_off(int sdonly); -extern void sysctlr_keepalive(void); - -#define valid_cpuid(_x) (((_x) >= 0) && ((_x) < maxcpus)) - -/* Useful definitions to get the memory dimm given a physical - * address. - */ -#define paddr_dimm(_pa) ((_pa & MD_BANK_MASK) >> MD_BANK_SHFT) -#define paddr_cnode(_pa) (NASID_TO_COMPACT_NODEID(NASID_GET(_pa))) -extern void membank_pathname_get(paddr_t,char *); - -/* To redirect the output into the error buffer */ -#define errbuf_print(_s) printf("#%s",_s) - -extern void crbx(nasid_t nasid, void (*pf)(char *, ...)); -void bootstrap(void); - -/* sndrv.c */ -extern int sndrv_attach(devfs_handle_t vertex); -#endif /* _ASM_SN_PRIVATE_H */ +#endif /* _ASM_IA64_SN_SN_PRIVATE_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sn_sal.h lia64-2.4/include/asm-ia64/sn/sn_sal.h --- linux-2.4.18/include/asm-ia64/sn/sn_sal.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sn_sal.h Tue Feb 26 13:19:36 2002 @@ -1,25 +1,157 @@ -#ifndef _ASM_IA64_SN_SAL_H -#define _ASM_IA64_SN_SAL_H +#ifndef _ASM_IA64_SN_SN_SAL_H +#define _ASM_IA64_SN_SN_SAL_H /* * System Abstraction Layer definitions for IA64 * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. * - * Copyright (C) 2000, Silicon Graphics. - * Copyright (C) 2000. Jack Steiner (steiner@sgi.com) + * Copyright (c) 2000-2002 Silicon Graphics, Inc. All rights reserved. */ #include +#include // SGI Specific Calls #define SN_SAL_POD_MODE 0x02000001 #define SN_SAL_SYSTEM_RESET 0x02000002 #define SN_SAL_PROBE 0x02000003 +#define SN_SAL_GET_CONSOLE_NASID 0x02000004 +#define SN_SAL_GET_KLCONFIG_ADDR 0x02000005 +#define SN_SAL_LOG_CE 0x02000006 +#define SN_SAL_REGISTER_CE 0x02000007 +#define SN_SAL_CONSOLE_PUTC 0x02000021 +#define SN_SAL_CONSOLE_GETC 0x02000022 +#define SN_SAL_CONSOLE_PUTS 0x02000023 +#define SN_SAL_CONSOLE_GETS 0x02000024 +#define SN_SAL_CONSOLE_GETS_TIMEOUT 0x02000025 +#define SN_SAL_CONSOLE_POLL 0x02000026 +#define SN_SAL_CONSOLE_INTR 0x02000027 + +/* + * Service-specific constants + */ +#define SAL_CONSOLE_INTR_IN 0 /* manipulate input interrupts */ +#define SAL_CONSOLE_INTR_OUT 1 /* manipulate output low-water + * interrupts + */ +#define SAL_CONSOLE_INTR_OFF 0 /* turn the interrupt off */ +#define SAL_CONSOLE_INTR_ON 1 /* turn the interrupt on */ + + u64 ia64_sn_probe_io_slot(long paddr, long size, void *data_ptr); +/* + * Returns the master console nasid, if the call fails, return an illegal + * value. + */ +static inline u64 +ia64_sn_get_console_nasid(void) +{ + struct ia64_sal_retval ret_stuff; + + ret_stuff.status = (uint64_t)0; + ret_stuff.v0 = (uint64_t)0; + ret_stuff.v1 = (uint64_t)0; + ret_stuff.v2 = (uint64_t)0; + SAL_CALL(ret_stuff, SN_SAL_GET_CONSOLE_NASID, 0, 0, 0, 0, 0, 0, 0); + + if (ret_stuff.status < 0) + return ret_stuff.status; + + /* Master console nasid is in 'v0' */ + return ret_stuff.v0; +} + +static inline u64 +ia64_sn_get_klconfig_addr(nasid_t nasid) +{ + struct ia64_sal_retval ret_stuff; + extern u64 klgraph_addr[]; + int cnodeid; + + cnodeid = nasid_to_cnodeid(nasid); + if (klgraph_addr[cnodeid] == 0) { + ret_stuff.status = (uint64_t)0; + ret_stuff.v0 = (uint64_t)0; + ret_stuff.v1 = (uint64_t)0; + ret_stuff.v2 = (uint64_t)0; + SAL_CALL(ret_stuff, SN_SAL_GET_KLCONFIG_ADDR, (u64)nasid, 0, 0, 0, 0, 0, 0); + + /* + * We should panic if a valid cnode nasid does not produce + * a klconfig address. + */ + if (ret_stuff.status != 0) { + panic("ia64_sn_get_klconfig_addr: Returned error %lx\n", ret_stuff.status); + } + + klgraph_addr[cnodeid] = ret_stuff.v0; + } + return(klgraph_addr[cnodeid]); +} + +/* + * Returns the next console character. + */ +static inline u64 +ia64_sn_console_getc(int *ch) +{ + struct ia64_sal_retval ret_stuff; + + ret_stuff.status = (uint64_t)0; + ret_stuff.v0 = (uint64_t)0; + ret_stuff.v1 = (uint64_t)0; + ret_stuff.v2 = (uint64_t)0; + SAL_CALL(ret_stuff, SN_SAL_CONSOLE_GETC, 0, 0, 0, 0, 0, 0, 0); + + /* character is in 'v0' */ + *ch = (int)ret_stuff.v0; + + return ret_stuff.status; +} + +/* + * Sends the given character to the console. + */ +static inline u64 +ia64_sn_console_putc(char ch) +{ + struct ia64_sal_retval ret_stuff; + + ret_stuff.status = (uint64_t)0; + ret_stuff.v0 = (uint64_t)0; + ret_stuff.v1 = (uint64_t)0; + ret_stuff.v2 = (uint64_t)0; + SAL_CALL(ret_stuff, SN_SAL_CONSOLE_PUTC, (uint64_t)ch, 0, 0, 0, 0, 0, 0); + + return ret_stuff.status; +} + +/* + * Checks for console input. + */ +static inline u64 +ia64_sn_console_check(int *result) +{ + struct ia64_sal_retval ret_stuff; + + ret_stuff.status = (uint64_t)0; + ret_stuff.v0 = (uint64_t)0; + ret_stuff.v1 = (uint64_t)0; + ret_stuff.v2 = (uint64_t)0; + SAL_CALL(ret_stuff, SN_SAL_CONSOLE_POLL, 0, 0, 0, 0, 0, 0, 0); + + /* result is in 'v0' */ + *result = (int)ret_stuff.v0; + + return ret_stuff.status; +} -#endif /* _ASM_IA64_SN_SN1_SAL_H */ +#endif /* _ASM_IA64_SN_SN_SAL_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/snconfig.h lia64-2.4/include/asm-ia64/sn/snconfig.h --- linux-2.4.18/include/asm-ia64/sn/snconfig.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/snconfig.h Mon Nov 19 23:23:00 2001 @@ -0,0 +1,18 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2000-2001 Silicon Graphics, Inc. + */ +#ifndef _ASM_IA64_SN_SNCONFIG_H +#define _ASM_IA64_SN_SNCONFIG_H + +#include + +#if defined(CONFIG_IA64_SGI_SN1) +#include +#elif defined(CONFIG_IA64_SGI_SN2) +#endif + +#endif /* _ASM_IA64_SN_SNCONFIG_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sndrv.h lia64-2.4/include/asm-ia64/sn/sndrv.h --- linux-2.4.18/include/asm-ia64/sn/sndrv.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/sndrv.h Mon Nov 19 23:23:00 2001 @@ -0,0 +1,39 @@ +#ifndef _ASM_IA64_SN_SNDRV_H +#define _ASM_IA64_SN_SNDRV_H + +/* ioctl commands */ +#define SNDRV_GET_ROUTERINFO 1 +#define SNDRV_GET_INFOSIZE 2 +#define SNDRV_GET_HUBINFO 3 +#define SNDRV_GET_FLASHLOGSIZE 4 +#define SNDRV_SET_FLASHSYNC 5 +#define SNDRV_GET_FLASHLOGDATA 6 +#define SNDRV_GET_FLASHLOGALL 7 + +#define SNDRV_SET_HISTOGRAM_TYPE 14 + +#define SNDRV_ELSC_COMMAND 19 +#define SNDRV_CLEAR_LOG 20 +#define SNDRV_INIT_LOG 21 +#define SNDRV_GET_PIMM_PSC 22 +#define SNDRV_SET_PARTITION 23 +#define SNDRV_GET_PARTITION 24 + +/* see synergy_perf_ioctl() */ +#define SNDRV_GET_SYNERGY_VERSION 30 +#define SNDRV_GET_SYNERGY_STATUS 31 +#define SNDRV_GET_SYNERGYINFO 32 +#define SNDRV_SYNERGY_APPEND 33 +#define SNDRV_SYNERGY_ENABLE 34 +#define SNDRV_SYNERGY_FREQ 35 + +/* Devices */ +#define SNDRV_UKNOWN_DEVICE -1 +#define SNDRV_ROUTER_DEVICE 1 +#define SNDRV_HUB_DEVICE 2 +#define SNDRV_ELSC_NVRAM_DEVICE 3 +#define SNDRV_ELSC_CONTROLLER_DEVICE 4 +#define SNDRV_SYSCTL_SUBCH 5 +#define SNDRV_SYNERGY_DEVICE 6 + +#endif /* _ASM_IA64_SN_SNDRV_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/sv.h lia64-2.4/include/asm-ia64/sn/sv.h --- linux-2.4.18/include/asm-ia64/sn/sv.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/sv.h Fri Jul 19 23:20:15 2002 @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000 Silicon Graphics, Inc. All rights reserved + * Copyright (C) 2000-2001 Silicon Graphics, Inc. All rights reserved * * This implemenation of synchronization variables is heavily based on * one done by Steve Lord @@ -11,8 +11,8 @@ * Paul Cassella */ -#ifndef SV_H -#define SV_H +#ifndef _ASM_IA64_SN_SV_H +#define _ASM_IA64_SN_SV_H #include #include @@ -150,4 +150,4 @@ #undef _SV_ASSERT #endif -#endif +#endif /* _ASM_IA64_SN_SV_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/synergy.h lia64-2.4/include/asm-ia64/sn/synergy.h --- linux-2.4.18/include/asm-ia64/sn/synergy.h Thu Apr 12 12:16:36 2001 +++ lia64-2.4/include/asm-ia64/sn/synergy.h Wed Dec 31 16:00:00 1969 @@ -1,168 +0,0 @@ -#ifndef ASM_IA64_SN_SYNERGY_H -#define ASM_IA64_SN_SYNERGY_H - -#include - -#include "asm/io.h" -#include "asm/sn/nodepda.h" -#include "asm/sn/intr_public.h" - - -/* - * Definitions for the synergy asic driver - * - * These are for SGI platforms only. - * - * Copyright (C) 2000 Silicon Graphics, Inc - * Copyright (C) 2000 Alan Mayer (ajm@sgi.com) - */ - - -#define SSPEC_BASE (0xe0000000000) -#define LB_REG_BASE (SSPEC_BASE + 0x0) - -#define VEC_MASK3A_ADDR (0x2a0 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) -#define VEC_MASK3B_ADDR (0x2a8 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) -#define VEC_MASK3A (0x2a0) -#define VEC_MASK3B (0x2a8) - -#define VEC_MASK2A_ADDR (0x2b0 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) -#define VEC_MASK2B_ADDR (0x2b8 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) -#define VEC_MASK2A (0x2b0) -#define VEC_MASK2B (0x2b8) - -#define VEC_MASK1A_ADDR (0x2c0 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) -#define VEC_MASK1B_ADDR (0x2c8 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) -#define VEC_MASK1A (0x2c0) -#define VEC_MASK1B (0x2c8) - -#define VEC_MASK0A_ADDR (0x2d0 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) -#define VEC_MASK0B_ADDR (0x2d8 + LB_REG_BASE + __IA64_UNCACHED_OFFSET) -#define VEC_MASK0A (0x2d0) -#define VEC_MASK0B (0x2d8) - -#define WRITE_LOCAL_SYNERGY_REG(addr, value) __synergy_out(addr, value) - -#define HUBREG_CAST (volatile hubreg_t *) -#define HUB_L(_a) *(_a) -#define HUB_S(_a, _d) *(_a) = (_d) - -#define HSPEC_SYNERGY0_0 0x04000000 /* Synergy0 Registers */ -#define HSPEC_SYNERGY1_0 0x05000000 /* Synergy1 Registers */ -#define HS_SYNERGY_STRIDE (HSPEC_SYNERGY1_0 - HSPEC_SYNERGY0_0) -#define REMOTE_HSPEC(_n, _x) (HUBREG_CAST (RREG_BASE(_n) + (_x))) - -#define RREG_BASE(_n) (NODE_LREG_BASE(_n)) -#define NODE_LREG_BASE(_n) (NODE_HSPEC_BASE(_n) + 0x30000000) -#define NODE_HSPEC_BASE(_n) (HSPEC_BASE + NODE_OFFSET(_n)) -#ifndef HSPEC_BASE -#define HSPEC_BASE (SYN_UNCACHED_SPACE | HSPEC_BASE_SYN) -#endif -#define SYN_UNCACHED_SPACE 0xc000000000000000 -#define HSPEC_BASE_SYN 0x00000b0000000000 -#define NODE_OFFSET(_n) (UINT64_CAST (_n) << NODE_SIZE_BITS) -#define NODE_SIZE_BITS 33 - - -#define RSYN_REG_OFFSET(fsb, reg) (((fsb) ? HSPEC_SYNERGY1_0 : HSPEC_SYNERGY0_0) | (reg)) - -#define REMOTE_SYNERGY_LOAD(nasid, fsb, reg) __remote_synergy_in(nasid, fsb, reg) -#define REMOTE_SYNERGY_STORE(nasid, fsb, reg, val) __remote_synergy_out(nasid, fsb, reg, val) - -extern inline uint64_t -__remote_synergy_in(int nasid, int fsb, uint64_t reg) { - volatile uint64_t *addr; - - addr = (uint64_t *)(RREG_BASE(nasid) + RSYN_REG_OFFSET(fsb, reg)); - return (*addr); -} - -extern inline void -__remote_synergy_out(int nasid, int fsb, uint64_t reg, uint64_t value) { - volatile uint64_t *addr; - - addr = (uint64_t *)(RREG_BASE(nasid) + RSYN_REG_OFFSET(fsb, (reg<<2))); - *(addr+0) = value >> 48; - *(addr+1) = value >> 32; - *(addr+2) = value >> 16; - *(addr+3) = value; - __ia64_mf_a(); -} - -/* XX this doesn't make a lot of sense. Which fsb? */ -extern inline void -__synergy_out(unsigned long addr, unsigned long value) -{ - volatile unsigned long *adr = (unsigned long *) - (addr | __IA64_UNCACHED_OFFSET); - - *adr = value; - __ia64_mf_a(); -} - -#define READ_LOCAL_SYNERGY_REG(addr) __synergy_in(addr) - -/* XX this doesn't make a lot of sense. Which fsb? */ -extern inline unsigned long -__synergy_in(unsigned long addr) -{ - unsigned long ret, *adr = (unsigned long *) - (addr | __IA64_UNCACHED_OFFSET); - - ret = *adr; - __ia64_mf_a(); - return ret; -} - -struct sn1_intr_action { - void (*handler)(int, void *, struct pt_regs *); - void *intr_arg; - unsigned long flags; - struct sn1_intr_action * next; -}; - -typedef struct synergy_da_s { - hub_intmasks_t s_intmasks; -}synergy_da_t; - -struct sn1_cnode_action_list { - spinlock_t action_list_lock; - struct sn1_intr_action *action_list; -}; - -#if defined(CONFIG_IA64_SGI_SYNERGY_PERF) - -/* multiplex the counters every 10 timer interrupts */ -#define SYNERGY_PERF_FREQ_DEFAULT 10 - -/* synergy perf control registers */ -#define PERF_CNTL0_A 0xab0UL /* control A on FSB0 */ -#define PERF_CNTL0_B 0xab8UL /* control B on FSB0 */ -#define PERF_CNTL1_A 0xac0UL /* control A on FSB1 */ -#define PERF_CNTL1_B 0xac8UL /* control B on FSB1 */ - -/* synergy perf counters */ -#define PERF_CNTR0_A 0xad0UL /* counter A on FSB0 */ -#define PERF_CNTR0_B 0xad8UL /* counter B on FSB0 */ -#define PERF_CNTR1_A 0xaf0UL /* counter A on FSB1 */ -#define PERF_CNTR1_B 0xaf8UL /* counter B on FSB1 */ - -/* Synergy perf data. Each nodepda keeps a list of these */ -struct synergy_perf_s { - uint64_t intervals; /* count of active intervals for this event */ - uint64_t modesel; /* mode and sel bits, both A and B registers */ - struct synergy_perf_s *next; /* next in circular linked list */ - uint64_t counts[2]; /* [0] is synergy-A counter, [1] synergy-B counter */ -}; - -typedef struct synergy_perf_s synergy_perf_t; - -extern void synergy_perf_init(void); -extern void synergy_perf_update(int); - -#endif /* CONFIG_IA64_SGI_SYNERGY_PERF */ - - -/* Temporary defintions for testing: */ - -#endif ASM_IA64_SN_SYNERGY_H diff -urN linux-2.4.18/include/asm-ia64/sn/systeminfo.h lia64-2.4/include/asm-ia64/sn/systeminfo.h --- linux-2.4.18/include/asm-ia64/sn/systeminfo.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/systeminfo.h Mon Feb 4 17:48:58 2002 @@ -4,11 +4,12 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_SYSTEMINFO_H -#define _ASM_SN_SYSTEMINFO_H +#ifndef _ASM_IA64_SN_SYSTEMINFO_H +#define _ASM_IA64_SN_SYSTEMINFO_H + +#include #ifdef __cplusplus extern "C" { @@ -69,4 +70,4 @@ } #endif -#endif /* _ASM_SN_SYSTEMINFO_H */ +#endif /* _ASM_IA64_SN_SYSTEMINFO_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/types.h lia64-2.4/include/asm-ia64/sn/types.h --- linux-2.4.18/include/asm-ia64/sn/types.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/types.h Mon May 6 18:04:24 2002 @@ -3,30 +3,27 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1999 Silicon Graphics, Inc. + * Copyright (C) 1999,2001-2002 Silicon Graphics, Inc. All Rights Reserved. * Copyright (C) 1999 by Ralf Baechle */ -#ifndef _ASM_SN_TYPES_H -#define _ASM_SN_TYPES_H +#ifndef _ASM_IA64_SN_TYPES_H +#define _ASM_IA64_SN_TYPES_H #include typedef unsigned long cpuid_t; typedef unsigned long cpumask_t; -/* typedef unsigned long cnodemask_t; */ typedef signed short nasid_t; /* node id in numa-as-id space */ -typedef signed short cnodeid_t; /* node id in compact-id space */ typedef signed char partid_t; /* partition ID type */ typedef signed short moduleid_t; /* user-visible module number type */ typedef signed short cmoduleid_t; /* kernel compact module id type */ typedef unsigned char clusterid_t; /* Clusterid of the cell */ -#define __psunsigned_t uint64_t -#define lock_t uint64_t +typedef uint64_t __psunsigned_t; typedef unsigned long iopaddr_t; typedef unsigned char uchar_t; typedef unsigned long paddr_t; typedef unsigned long pfn_t; -#endif /* _ASM_SN_TYPES_H */ +#endif /* _ASM_IA64_SN_TYPES_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/uart16550.h lia64-2.4/include/asm-ia64/sn/uart16550.h --- linux-2.4.18/include/asm-ia64/sn/uart16550.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/asm-ia64/sn/uart16550.h Mon Nov 19 23:23:00 2001 @@ -0,0 +1,227 @@ +/* + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved. + */ + +#ifndef _ASM_IA64_SN_UART16550_H +#define _ASM_IA64_SN_UART16550_H + + +/* + * Definitions for 16550 chip + */ + + /* defined as offsets from the data register */ +#define REG_DAT 0 /* receive/transmit data */ +#define REG_ICR 1 /* interrupt control register */ +#define REG_ISR 2 /* interrupt status register */ +#define REG_FCR 2 /* fifo control register */ +#define REG_LCR 3 /* line control register */ +#define REG_MCR 4 /* modem control register */ +#define REG_LSR 5 /* line status register */ +#define REG_MSR 6 /* modem status register */ +#define REG_SCR 7 /* Scratch register */ +#define REG_DLL 0 /* divisor latch (lsb) */ +#define REG_DLH 1 /* divisor latch (msb) */ +#define REG_EFR 2 /* 16650 enhanced feature register */ + +/* + * 16450/16550 Registers Structure. + */ + +/* Line Control Register */ +#define LCR_WLS0 0x01 /*word length select bit 0 */ +#define LCR_WLS1 0x02 /*word length select bit 2 */ +#define LCR_STB 0x04 /* number of stop bits */ +#define LCR_PEN 0x08 /* parity enable */ +#define LCR_EPS 0x10 /* even parity select */ +#define LCR_SETBREAK 0x40 /* break key */ +#define LCR_DLAB 0x80 /* divisor latch access bit */ +#define LCR_RXLEN 0x03 /* # of data bits per received/xmitted char */ +#define LCR_STOP1 0x00 +#define LCR_STOP2 0x04 +#define LCR_PAREN 0x08 +#define LCR_PAREVN 0x10 +#define LCR_PARMARK 0x20 +#define LCR_SNDBRK 0x40 +#define LCR_DLAB 0x80 + + +#define LCR_BITS5 0x00 /* 5 bits per char */ +#define LCR_BITS6 0x01 /* 6 bits per char */ +#define LCR_BITS7 0x02 /* 7 bits per char */ +#define LCR_BITS8 0x03 /* 8 bits per char */ + +#define LCR_MASK_BITS_CHAR 0x03 +#define LCR_MASK_STOP_BITS 0x04 +#define LCR_MASK_PARITY_BITS 0x18 + + +/* Line Status Register */ +#define LSR_RCA 0x01 /* data ready */ +#define LSR_OVRRUN 0x02 /* overrun error */ +#define LSR_PARERR 0x04 /* parity error */ +#define LSR_FRMERR 0x08 /* framing error */ +#define LSR_BRKDET 0x10 /* a break has arrived */ +#define LSR_XHRE 0x20 /* tx hold reg is now empty */ +#define LSR_XSRE 0x40 /* tx shift reg is now empty */ +#define LSR_RFBE 0x80 /* rx FIFO Buffer error */ + +/* Interrupt Status Regisger */ +#define ISR_MSTATUS 0x00 +#define ISR_TxRDY 0x02 +#define ISR_RxRDY 0x04 +#define ISR_ERROR_INTR 0x08 +#define ISR_FFTMOUT 0x0c /* FIFO Timeout */ +#define ISR_RSTATUS 0x06 /* Receiver Line status */ + +/* Interrupt Enable Register */ +#define ICR_RIEN 0x01 /* Received Data Ready */ +#define ICR_TIEN 0x02 /* Tx Hold Register Empty */ +#define ICR_SIEN 0x04 /* Receiver Line Status */ +#define ICR_MIEN 0x08 /* Modem Status */ + +/* Modem Control Register */ +#define MCR_DTR 0x01 /* Data Terminal Ready */ +#define MCR_RTS 0x02 /* Request To Send */ +#define MCR_OUT1 0x04 /* Aux output - not used */ +#define MCR_OUT2 0x08 /* turns intr to 386 on/off */ +#define MCR_LOOP 0x10 /* loopback for diagnostics */ +#define MCR_AFE 0x20 /* Auto flow control enable */ + +/* Modem Status Register */ +#define MSR_DCTS 0x01 /* Delta Clear To Send */ +#define MSR_DDSR 0x02 /* Delta Data Set Ready */ +#define MSR_DRI 0x04 /* Trail Edge Ring Indicator */ +#define MSR_DDCD 0x08 /* Delta Data Carrier Detect */ +#define MSR_CTS 0x10 /* Clear To Send */ +#define MSR_DSR 0x20 /* Data Set Ready */ +#define MSR_RI 0x40 /* Ring Indicator */ +#define MSR_DCD 0x80 /* Data Carrier Detect */ + +#define DELTAS(x) ((x)&(MSR_DCTS|MSR_DDSR|MSR_DRI|MSR_DDCD)) +#define STATES(x) ((x)(MSR_CTS|MSR_DSR|MSR_RI|MSR_DCD)) + + +#define FCR_FIFOEN 0x01 /* enable receive/transmit fifo */ +#define FCR_RxFIFO 0x02 /* enable receive fifo */ +#define FCR_TxFIFO 0x04 /* enable transmit fifo */ +#define FCR_MODE1 0x08 /* change to mode 1 */ +#define RxLVL0 0x00 /* Rx fifo level at 1 */ +#define RxLVL1 0x40 /* Rx fifo level at 4 */ +#define RxLVL2 0x80 /* Rx fifo level at 8 */ +#define RxLVL3 0xc0 /* Rx fifo level at 14 */ + +#define FIFOEN (FCR_FIFOEN | FCR_RxFIFO | FCR_TxFIFO | RxLVL3 | FCR_MODE1) + +#define FCT_TxMASK 0x30 /* mask for Tx trigger */ +#define FCT_RxMASK 0xc0 /* mask for Rx trigger */ + +/* enhanced festures register */ +#define EFR_SFLOW 0x0f /* various S/w Flow Controls */ +#define EFR_EIC 0x10 /* Enhanced Interrupt Control bit */ +#define EFR_SCD 0x20 /* Special Character Detect */ +#define EFR_RTS 0x40 /* RTS flow control */ +#define EFR_CTS 0x80 /* CTS flow control */ + +/* Rx Tx software flow controls in 16650 enhanced mode */ +#define SFLOW_Tx0 0x00 /* no Xmit flow control */ +#define SFLOW_Tx1 0x08 /* Transmit Xon1, Xoff1 */ +#define SFLOW_Tx2 0x04 /* Transmit Xon2, Xoff2 */ +#define SFLOW_Tx3 0x0c /* Transmit Xon1,Xon2, Xoff1,Xoff2 */ +#define SFLOW_Rx0 0x00 /* no Rcv flow control */ +#define SFLOW_Rx1 0x02 /* Receiver compares Xon1, Xoff1 */ +#define SFLOW_Rx2 0x01 /* Receiver compares Xon2, Xoff2 */ + +#define ASSERT_DTR(x) (x |= MCR_DTR) +#define ASSERT_RTS(x) (x |= MCR_RTS) +#define DU_RTS_ASSERTED(x) (((x) & MCR_RTS) != 0) +#define DU_RTS_ASSERT(x) ((x) |= MCR_RTS) +#define DU_RTS_DEASSERT(x) ((x) &= ~MCR_RTS) + + +/* + * ioctl(fd, I_STR, arg) + * use the SIOC_RS422 and SIOC_EXTCLK combination to support MIDI + */ +#define SIOC ('z' << 8) /* z for z85130 */ +#define SIOC_EXTCLK (SIOC | 1) /* select/de-select external clock */ +#define SIOC_RS422 (SIOC | 2) /* select/de-select RS422 protocol */ +#define SIOC_ITIMER (SIOC | 3) /* upstream timer adjustment */ +#define SIOC_LOOPBACK (SIOC | 4) /* diagnostic loopback test mode */ + + +/* channel control register */ +#define DMA_INT_MASK 0xe0 /* ring intr mask */ +#define DMA_INT_TH25 0x20 /* 25% threshold */ +#define DMA_INT_TH50 0x40 /* 50% threshold */ +#define DMA_INT_TH75 0x60 /* 75% threshold */ +#define DMA_INT_EMPTY 0x80 /* ring buffer empty */ +#define DMA_INT_NEMPTY 0xa0 /* ring buffer not empty */ +#define DMA_INT_FULL 0xc0 /* ring buffer full */ +#define DMA_INT_NFULL 0xe0 /* ring buffer not full */ + +#define DMA_CHANNEL_RESET 0x400 /* reset dma channel */ +#define DMA_ENABLE 0x200 /* enable DMA */ + +/* peripheral controller intr status bits applicable to serial ports */ +#define ISA_SERIAL0_MASK 0x03f00000 /* mask for port #1 intrs */ +#define ISA_SERIAL0_DIR 0x00100000 /* device intr request */ +#define ISA_SERIAL0_Tx_THIR 0x00200000 /* Transmit DMA threshold */ +#define ISA_SERIAL0_Tx_PREQ 0x00400000 /* Transmit DMA pair req */ +#define ISA_SERIAL0_Tx_MEMERR 0x00800000 /* Transmit DMA memory err */ +#define ISA_SERIAL0_Rx_THIR 0x01000000 /* Receive DMA threshold */ +#define ISA_SERIAL0_Rx_OVERRUN 0x02000000 /* Receive DMA over-run */ + +#define ISA_SERIAL1_MASK 0xfc000000 /* mask for port #1 intrs */ +#define ISA_SERIAL1_DIR 0x04000000 /* device intr request */ +#define ISA_SERIAL1_Tx_THIR 0x08000000 /* Transmit DMA threshold */ +#define ISA_SERIAL1_Tx_PREQ 0x10000000 /* Transmit DMA pair req */ +#define ISA_SERIAL1_Tx_MEMERR 0x20000000 /* Transmit DMA memory err */ +#define ISA_SERIAL1_Rx_THIR 0x40000000 /* Receive DMA threshold */ +#define ISA_SERIAL1_Rx_OVERRUN 0x80000000 /* Receive DMA over-run */ + +#define MAX_RING_BLOCKS 128 /* 4096/32 */ +#define MAX_RING_SIZE 4096 + +/* DMA Input Control Byte */ +#define DMA_IC_OVRRUN 0x01 /* overrun error */ +#define DMA_IC_PARERR 0x02 /* parity error */ +#define DMA_IC_FRMERR 0x04 /* framing error */ +#define DMA_IC_BRKDET 0x08 /* a break has arrived */ +#define DMA_IC_VALID 0x80 /* pair is valid */ + +/* DMA Output Control Byte */ +#define DMA_OC_TxINTR 0x20 /* set Tx intr after processing byte */ +#define DMA_OC_INVALID 0x00 /* invalid pair */ +#define DMA_OC_WTHR 0x40 /* Write byte to THR */ +#define DMA_OC_WMCR 0x80 /* Write byte to MCR */ +#define DMA_OC_DELAY 0xc0 /* time delay before next xmit */ + +/* ring id's */ +#define RID_SERIAL0_TX 0x4 /* serial port 0, transmit ring buffer */ +#define RID_SERIAL0_RX 0x5 /* serial port 0, receive ring buffer */ +#define RID_SERIAL1_TX 0x6 /* serial port 1, transmit ring buffer */ +#define RID_SERIAL1_RX 0x7 /* serial port 1, receive ring buffer */ + +#define CLOCK_XIN 22 +#define PRESCALER_DIVISOR 3 +#define CLOCK_ACE 7333333 + +/* + * increment the ring offset. One way to do this would be to add b'100000. + * this would let the offset value roll over automatically when it reaches + * its maximum value (127). However when we use the offset, we must use + * the appropriate bits only by masking with 0xfe0. + * The other option is to shift the offset right by 5 bits and look at its + * value. Then increment if required and shift back + * note: 127 * 2^5 = 4064 + */ +#define INC_RING_POINTER(x) \ + ( ((x & 0xffe0) < 4064) ? (x += 32) : 0 ) + +#endif /* _ASM_IA64_SN_UART16550_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/vector.h lia64-2.4/include/asm-ia64/sn/vector.h --- linux-2.4.18/include/asm-ia64/sn/vector.h Thu Jan 4 15:25:55 2001 +++ lia64-2.4/include/asm-ia64/sn/vector.h Mon Feb 4 17:48:58 2002 @@ -4,11 +4,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved. */ -#ifndef _ASM_SN_VECTOR_H -#define _ASM_SN_VECTOR_H +#ifndef _ASM_IA64_SN_VECTOR_H +#define _ASM_IA64_SN_VECTOR_H #include @@ -37,7 +36,7 @@ #endif /* RTL */ -#if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) +#if defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC) #define VECTOR_PARMS LB_VECTOR_PARMS #define VECTOR_ROUTE LB_VECTOR_ROUTE #define VECTOR_DATA LB_VECTOR_DATA @@ -66,19 +65,22 @@ #define VS_ERROR_MASK LVS_ERROR_MASK #endif -#define NET_ERROR_NONE 0 /* No error */ -#define NET_ERROR_HARDWARE -1 /* Hardware error */ -#define NET_ERROR_OVERRUN -2 /* Extra response(s) */ -#define NET_ERROR_REPLY -3 /* Reply parms mismatch */ -#define NET_ERROR_ADDRESS -4 /* Addr error response */ -#define NET_ERROR_COMMAND -5 /* Cmd error response */ -#define NET_ERROR_PROT -6 /* Prot error response */ -#define NET_ERROR_TIMEOUT -7 /* Too many retries */ -#define NET_ERROR_VECTOR -8 /* Invalid vector/path */ -#define NET_ERROR_ROUTERLOCK -9 /* Timeout locking rtr */ -#define NET_ERROR_INVAL -10 /* Invalid vector request */ +#define NET_ERROR_NONE 0 /* No error */ +#define NET_ERROR_HARDWARE (-1) /* Hardware error */ +#define NET_ERROR_OVERRUN (-2) /* Extra response(s) */ +#define NET_ERROR_REPLY (-3) /* Reply parms mismatch */ +#define NET_ERROR_ADDRESS (-4) /* Addr error response */ +#define NET_ERROR_COMMAND (-5) /* Cmd error response */ +#define NET_ERROR_PROT (-6) /* Prot error response */ +#define NET_ERROR_TIMEOUT (-7) /* Too many retries */ +#define NET_ERROR_VECTOR (-8) /* Invalid vector/path */ +#define NET_ERROR_ROUTERLOCK (-9) /* Timeout locking rtr */ +#define NET_ERROR_INVAL (-10) /* Invalid vector request */ + +#ifndef __ASSEMBLY__ +#include +#include -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) typedef uint64_t net_reg_t; typedef uint64_t net_vec_t; @@ -114,6 +116,6 @@ int addr, net_reg_t *value); #endif -#endif /* _LANGUAGE_C || _LANGUAGE_C_PLUS_PLUS */ +#endif /* __ASSEMBLY__ */ -#endif /* _ASM_SN_VECTOR_H */ +#endif /* _ASM_IA64_SN_VECTOR_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/xtalk/xbow.h lia64-2.4/include/asm-ia64/sn/xtalk/xbow.h --- linux-2.4.18/include/asm-ia64/sn/xtalk/xbow.h Tue Mar 6 19:44:34 2001 +++ lia64-2.4/include/asm-ia64/sn/xtalk/xbow.h Mon Nov 19 23:23:00 2001 @@ -4,7 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. * Copyright (C) 2000 by Colin Ngam */ #ifndef _ASM_SN_SN_XTALK_XBOW_H @@ -17,7 +17,7 @@ #include #include #include -#ifdef LANGUAGE_C +#ifndef __ASSEMBLY__ #include #endif @@ -46,7 +46,7 @@ #define MAX_XBOW_NAME 16 -#if LANGUAGE_C +#ifndef __ASSEMBLY__ typedef uint32_t xbowreg_t; #define XBOWCONST (xbowreg_t) @@ -236,7 +236,7 @@ /* offset of arbitration register, given source widget id */ #define XBOW_ARB_OFF(wid) (XBOW_ARB_IS_UPPER(wid) ? 0x1c : 0x24) -#endif /* LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ #define XBOW_WID_ID WIDGET_ID #define XBOW_WID_STAT WIDGET_STATUS @@ -402,7 +402,7 @@ (XWIDGET_PART_NUM(XWIDGET_ID_READ(nasid, 0)) == XXBOW_WIDGET_PART_NUM) -#ifdef _LANGUAGE_C +#ifndef __ASSEMBLY__ /* * XBOW Widget 0 Register formats. * Format for many of these registers are similar to the standard @@ -891,5 +891,5 @@ #endif /* MACROFIELD_LINE */ -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ #endif /* _ASM_SN_SN_XTALK_XBOW_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/xtalk/xbow_info.h lia64-2.4/include/asm-ia64/sn/xtalk/xbow_info.h --- linux-2.4.18/include/asm-ia64/sn/xtalk/xbow_info.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/xtalk/xbow_info.h Mon Feb 4 17:48:58 2002 @@ -4,11 +4,13 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992-1997,2000-2002 Silicon Graphics, Inc. All Rights Reserved. */ #ifndef _ASM_SN_XTALK_XBOW_INFO_H #define _ASM_SN_XTALK_XBOW_INFO_H + +#include +#include #define XBOW_PERF_MODES 0x03 #define XBOW_PERF_COUNTERS 0x02 diff -urN linux-2.4.18/include/asm-ia64/sn/xtalk/xswitch.h lia64-2.4/include/asm-ia64/sn/xtalk/xswitch.h --- linux-2.4.18/include/asm-ia64/sn/xtalk/xswitch.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/xtalk/xswitch.h Mon Feb 4 17:48:58 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992-1997,2000-2002 Silicon Graphics, Inc. All Rights Reserved. */ #ifndef _ASM_SN_XTALK_XSWITCH_H #define _ASM_SN_XTALK_XSWITCH_H @@ -16,7 +15,10 @@ * xtalk bus providers. */ -#if LANGUAGE_C +#ifndef __ASSEMBLY__ + +#include +#include typedef struct xswitch_info_s *xswitch_info_t; @@ -54,6 +56,6 @@ extern int xswitch_id_get(devfs_handle_t vhdl); extern void xswitch_id_set(devfs_handle_t vhdl,int xbow_num); -#endif /* LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ #endif /* _ASM_SN_XTALK_XSWITCH_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/xtalk/xtalk.h lia64-2.4/include/asm-ia64/sn/xtalk/xtalk.h --- linux-2.4.18/include/asm-ia64/sn/xtalk/xtalk.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/xtalk/xtalk.h Fri Jul 19 23:21:07 2002 @@ -4,8 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992-1997, 2000-2002 Silicon Graphics, Inc. All Rights Reserved. */ #ifndef _ASM_SN_XTALK_XTALK_H #define _ASM_SN_XTALK_XTALK_H @@ -18,19 +17,19 @@ */ typedef char xwidgetnum_t; /* xtalk widget number (0..15) */ -#define XWIDGET_NONE -1 +#define XWIDGET_NONE (-1) typedef int xwidget_part_num_t; /* xtalk widget part number */ -#define XWIDGET_PART_NUM_NONE -1 +#define XWIDGET_PART_NUM_NONE (-1) typedef int xwidget_rev_num_t; /* xtalk widget revision number */ -#define XWIDGET_REV_NUM_NONE -1 +#define XWIDGET_REV_NUM_NONE (-1) typedef int xwidget_mfg_num_t; /* xtalk widget manufacturing ID */ -#define XWIDGET_MFG_NUM_NONE -1 +#define XWIDGET_MFG_NUM_NONE (-1) typedef struct xtalk_piomap_s *xtalk_piomap_t; @@ -57,7 +56,7 @@ #include #include #include -#include +#include #include struct xwidget_hwid_s; @@ -205,14 +204,8 @@ typedef int xtalk_intr_connect_f (xtalk_intr_t intr_hdl, /* xtalk intr resource handle */ - intr_func_t intr_func, /* xtalk intr handler */ - void *intr_arg, /* arg to intr handler */ xtalk_intr_setfunc_f *setfunc, /* func to set intr hw */ - void *setfunc_arg, /* arg to setfunc. This must be */ - /* sufficient to determine which */ - /* interrupt on which board needs */ - /* to be set. */ - void *thread); /* which intr thread to use */ + void *setfunc_arg); /* arg to setfunc */ typedef void xtalk_intr_disconnect_f (xtalk_intr_t intr_hdl); @@ -400,7 +393,6 @@ extern int xtalk_device_powerup(devfs_handle_t, xwidgetnum_t); extern int xtalk_device_shutdown(devfs_handle_t, xwidgetnum_t); -extern int xtalk_device_inquiry(devfs_handle_t, xwidgetnum_t); #endif /* __KERNEL__ */ #endif /* _ASM_SN_XTALK_XTALK_H */ diff -urN linux-2.4.18/include/asm-ia64/sn/xtalk/xtalk_private.h lia64-2.4/include/asm-ia64/sn/xtalk/xtalk_private.h --- linux-2.4.18/include/asm-ia64/sn/xtalk/xtalk_private.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/xtalk/xtalk_private.h Mon Feb 4 17:48:58 2002 @@ -4,13 +4,15 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. - * Copyright (C) 2000 by Colin Ngam + * Copyright (C) 1992-1997, 2000-2002 Silicon Graphics, Inc. All Rights Reserved. */ #ifndef _ASM_SN_XTALK_XTALK_PRIVATE_H #define _ASM_SN_XTALK_XTALK_PRIVATE_H #include /* for error function and arg types */ +#include +#include +#include /* * xtalk_private.h -- private definitions for xtalk diff -urN linux-2.4.18/include/asm-ia64/sn/xtalk/xtalkaddrs.h lia64-2.4/include/asm-ia64/sn/xtalk/xtalkaddrs.h --- linux-2.4.18/include/asm-ia64/sn/xtalk/xtalkaddrs.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/sn/xtalk/xtalkaddrs.h Mon Nov 19 23:23:00 2001 @@ -4,13 +4,12 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. * Copyright (C) 2000 by Colin Ngam */ #ifndef _ASM_SN_XTALK_XTALKADDRS_H #define _ASM_SN_XTALK_XTALKADDRS_H -#include /* * CrossTalk to SN0 Hub addressing support @@ -60,19 +59,15 @@ * This looks very much like a REMOTE_HUB access, except the nodeID * is in a different place, and the highest xtalk bit is set. */ - /* Hub-specific xtalk definitions */ #define HX_MEM_BIT 0L /* Hub's idea of xtalk memory access */ #define HX_IO_BIT 1L /* Hub's idea of xtalk register access */ #define HX_ACCTYPE_SHIFT 47 -#if CONFIG_SGI_IP35 || CONFIG_IA64_SGI_SN1 || CONFIG_IA64_GENERIC #define HX_NODE_SHIFT 39 -#endif #define HX_BIGWIN_SHIFT 28 - #define HX_SWIN_SHIFT 23 #define HX_LOCACC 0L /* local access */ diff -urN linux-2.4.18/include/asm-ia64/sn/xtalk/xwidget.h lia64-2.4/include/asm-ia64/sn/xtalk/xwidget.h --- linux-2.4.18/include/asm-ia64/sn/xtalk/xwidget.h Thu Jan 4 13:00:15 2001 +++ lia64-2.4/include/asm-ia64/sn/xtalk/xwidget.h Fri Jul 19 23:21:07 2002 @@ -4,7 +4,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc. + * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. * Copyright (C) 2000 by Colin Ngam */ #ifndef __ASM_SN_XTALK_XWIDGET_H__ @@ -15,9 +15,9 @@ */ #include -#if LANGUAGE_C +#ifndef __ASSEMBLY__ #include -#endif /* LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ #ifdef LITTLE_ENDIAN #define WIDGET_ID 0x00 @@ -115,7 +115,7 @@ * widget target flush register are widget dependent thus will not be * defined here */ -#if _LANGUAGE_C +#ifndef __ASSEMBLY__ typedef uint32_t widgetreg_t; /* widget configuration registers */ @@ -267,9 +267,6 @@ async_attach_t aa); extern int xwidget_unregister(devfs_handle_t); -extern void xwidget_error_register(devfs_handle_t xwidget, - error_handler_f * efunc, - error_handler_arg_t einfo); extern void xwidget_reset(devfs_handle_t xwidget); extern void xwidget_gfx_reset(devfs_handle_t xwidget); @@ -289,6 +286,9 @@ extern xwidget_rev_num_t xwidget_info_rev_num_get(xwidget_info_t xwidget_info); extern xwidget_mfg_num_t xwidget_info_mfg_num_get(xwidget_info_t xwidget_info); +extern xwidgetnum_t hub_widget_id(nasid_t); + + /* * TBD: DELETE THIS ENTIRE STRUCTURE! Equivalent is now in @@ -303,6 +303,6 @@ } v_widget_t; #endif /* _KERNEL */ -#endif /* _LANGUAGE_C */ +#endif /* __ASSEMBLY__ */ #endif /* __ASM_SN_XTALK_XWIDGET_H__ */ diff -urN linux-2.4.18/include/asm-ia64/softirq.h lia64-2.4/include/asm-ia64/softirq.h --- linux-2.4.18/include/asm-ia64/softirq.h Mon Sep 24 15:08:24 2001 +++ lia64-2.4/include/asm-ia64/softirq.h Fri Jul 19 23:20:20 2002 @@ -3,21 +3,21 @@ /* * Copyright (C) 1998-2001 Hewlett-Packard Co - * Copyright (C) 1998-2001 David Mosberger-Tang + * David Mosberger-Tang */ #include -#define __local_bh_enable() do { barrier(); local_bh_count()--; } while (0) +#define __local_bh_enable() do { barrier(); really_local_bh_count()--; } while (0) -#define local_bh_disable() do { local_bh_count()++; barrier(); } while (0) +#define local_bh_disable() do { really_local_bh_count()++; barrier(); } while (0) #define local_bh_enable() \ do { \ __local_bh_enable(); \ - if (__builtin_expect(local_softirq_pending(), 0) && local_bh_count() == 0) \ + if (__builtin_expect(local_softirq_pending(), 0) && really_local_bh_count() == 0) \ do_softirq(); \ } while (0) -#define in_softirq() (local_bh_count() != 0) +#define in_softirq() (really_local_bh_count() != 0) #endif /* _ASM_IA64_SOFTIRQ_H */ diff -urN linux-2.4.18/include/asm-ia64/spinlock.h lia64-2.4/include/asm-ia64/spinlock.h --- linux-2.4.18/include/asm-ia64/spinlock.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/spinlock.h Fri Jul 19 23:20:15 2002 @@ -3,7 +3,7 @@ /* * Copyright (C) 1998-2001 Hewlett-Packard Co - * Copyright (C) 1998-2001 David Mosberger-Tang + * David Mosberger-Tang * Copyright (C) 1999 Walt Drummond * * This file is used for SMP configurations only. @@ -84,7 +84,7 @@ "mov r29 = 1\n" \ ";;\n" \ "1:\n" \ - "ld4.bias r2 = [%0]\n" \ + "ld4 r2 = [%0]\n" \ ";;\n" \ "cmp4.eq p0,p7 = r0,r2\n" \ "(p7) br.cond.spnt.few 1b \n" \ @@ -93,7 +93,7 @@ "cmp4.eq p0,p7 = r0, r2\n" \ "(p7) br.cond.spnt.few 1b\n" \ ";;\n" \ - :: "r"(&(x)->lock) : "r2", "r29", "memory") + :: "r"(&(x)->lock) : "ar.ccv", "p7", "r2", "r29", "memory") #define spin_is_locked(x) ((x)->lock != 0) #define spin_unlock(x) do { barrier(); ((spinlock_t *) x)->lock = 0; } while (0) @@ -128,7 +128,7 @@ ";;\n" \ ".previous\n" \ : "=&r" (tmp) \ - : "r" (rw): "memory"); \ + : "r" (rw) : "p6", "memory"); \ } while(0) #define read_unlock(rw) \ @@ -156,13 +156,13 @@ "cmp4.eq p0,p7 = r0, r2\n" \ "(p7) br.cond.spnt.few 1b\n" \ ";;\n" \ - :: "r"(rw) : "r2", "r29", "memory"); \ + :: "r"(rw) : "ar.ccv", "p7", "r2", "r29", "memory"); \ } while(0) -/* - * clear_bit() has "acq" semantics; we're really need "rel" semantics, - * but for simplicity, we simply do a fence for now... - */ -#define write_unlock(x) ({clear_bit(31, (x)); mb();}) +#define write_unlock(x) \ +({ \ + smp_mb__before_clear_bit(); /* need barrier before releasing lock... */ \ + clear_bit(31, (x)); \ +}) #endif /* _ASM_IA64_SPINLOCK_H */ diff -urN linux-2.4.18/include/asm-ia64/string.h lia64-2.4/include/asm-ia64/string.h --- linux-2.4.18/include/asm-ia64/string.h Tue Jul 31 10:30:09 2001 +++ lia64-2.4/include/asm-ia64/string.h Thu Apr 25 18:16:09 2002 @@ -5,8 +5,8 @@ * Here is where we want to put optimized versions of the string * routines. * - * Copyright (C) 1998-2000 Hewlett-Packard Co - * Copyright (C) 1998-2000 David Mosberger-Tang + * Copyright (C) 1998-2000, 2002 Hewlett-Packard Co + * David Mosberger-Tang */ #include /* remove this once we remove the A-step workaround... */ @@ -17,7 +17,7 @@ #define __HAVE_ARCH_BCOPY 1 /* see arch/ia64/lib/memcpy.S */ extern __kernel_size_t strlen (const char *); -extern void *memset (void *, int, __kernel_size_t); extern void *memcpy (void *, const void *, __kernel_size_t); +extern void *memset (void *, int, __kernel_size_t); #endif /* _ASM_IA64_STRING_H */ diff -urN linux-2.4.18/include/asm-ia64/system.h lia64-2.4/include/asm-ia64/system.h --- linux-2.4.18/include/asm-ia64/system.h Wed Dec 26 16:58:57 2001 +++ lia64-2.4/include/asm-ia64/system.h Fri Jul 19 23:20:15 2002 @@ -7,25 +7,19 @@ * on information published in the Processor Abstraction Layer * and the System Abstraction Layer manual. * - * Copyright (C) 1998-2001 Hewlett-Packard Co - * Copyright (C) 1998-2001 David Mosberger-Tang + * Copyright (C) 1998-2002 Hewlett-Packard Co + * David Mosberger-Tang * Copyright (C) 1999 Asit Mallick * Copyright (C) 1999 Don Dugger */ #include +#include #include +#include #define KERNEL_START (PAGE_OFFSET + 68*1024*1024) -/* - * The following #defines must match with vmlinux.lds.S: - */ -#define IVT_ADDR (KERNEL_START) -#define IVT_END_ADDR (KERNEL_START + 0x8000) -#define ZERO_PAGE_ADDR PAGE_ALIGN(IVT_END_ADDR) -#define SWAPPER_PGD_ADDR (ZERO_PAGE_ADDR + 1*PAGE_SIZE) - #define GATE_ADDR (0xa000000000000000 + PAGE_SIZE) #define PERCPU_ADDR (0xa000000000000000 + 2*PAGE_SIZE) @@ -38,7 +32,7 @@ __u16 bus; /* PCI Bus number */ __u32 pci_id; /* ACPI split 16 bits device, 16 bits function (see section 6.1.1) */ __u8 pin; /* PCI PIN (0 = A, 1 = B, 2 = C, 3 = D) */ - __u8 irq; /* IRQ assigned */ + __u32 irq; /* IRQ assigned */ }; extern struct ia64_boot_param { @@ -109,6 +103,8 @@ #define set_mb(var, value) do { (var) = (value); mb(); } while (0) #define set_wmb(var, value) do { (var) = (value); mb(); } while (0) +#define safe_halt() ia64_pal_halt(1) /* PAL_HALT */ + /* * The group barrier in front of the rsm & ssm are necessary to ensure * that none of the previous instructions in the same group are @@ -143,16 +139,21 @@ } \ } while (0) -# define local_irq_restore(x) \ -do { \ - unsigned long ip, old_psr, psr = (x); \ - \ - __asm__ __volatile__ (";;mov %0=psr; mov psr.l=%1;; srlz.d" \ - : "=&r" (old_psr) : "r" (psr) : "memory"); \ - if ((old_psr & (1UL << 14)) && !(psr & (1UL << 14))) { \ - __asm__ ("mov %0=ip" : "=r"(ip)); \ - last_cli_ip = ip; \ - } \ +# define local_irq_restore(x) \ +do { \ + unsigned long ip, old_psr, psr = (x); \ + \ + __asm__ __volatile__ ("mov %0=psr;" \ + "cmp.ne p6,p7=%1,r0;;" \ + "(p6) ssm psr.i;" \ + "(p7) rsm psr.i;;" \ + "srlz.d" \ + : "=&r" (old_psr) : "r"((psr) & IA64_PSR_I) \ + : "p6", "p7", "memory"); \ + if ((old_psr & IA64_PSR_I) && !(psr & IA64_PSR_I)) { \ + __asm__ ("mov %0=ip" : "=r"(ip)); \ + last_cli_ip = ip; \ + } \ } while (0) #else /* !CONFIG_IA64_DEBUG_IRQ */ @@ -161,8 +162,12 @@ : "=r" (x) :: "memory") # define local_irq_disable() __asm__ __volatile__ (";; rsm psr.i;;" ::: "memory") /* (potentially) setting psr.i requires data serialization: */ -# define local_irq_restore(x) __asm__ __volatile__ (";; mov psr.l=%0;; srlz.d" \ - :: "r" (x) : "memory") +# define local_irq_restore(x) __asm__ __volatile__ ("cmp.ne p6,p7=%0,r0;;" \ + "(p6) ssm psr.i;" \ + "(p7) rsm psr.i;;" \ + "srlz.d" \ + :: "r"((x) & IA64_PSR_I) \ + : "p6", "p7", "memory") #endif /* !CONFIG_IA64_DEBUG_IRQ */ #define local_irq_enable() __asm__ __volatile__ (";; ssm psr.i;; srlz.d" ::: "memory") @@ -232,7 +237,7 @@ _tmp = __bad_increment_for_ia64_fetch_and_add(); \ break; \ } \ - (__typeof__(*v)) (_tmp + (i)); /* return new value */ \ + (__typeof__(*(v))) (_tmp + (i)); /* return new value */ \ }) /* @@ -378,24 +383,34 @@ extern void ia64_save_extra (struct task_struct *task); extern void ia64_load_extra (struct task_struct *task); +#if defined(CONFIG_SMP) && defined(CONFIG_PERFMON) +# define PERFMON_IS_SYSWIDE() (local_cpu_data->pfm_syst_wide != 0) +#else +# define PERFMON_IS_SYSWIDE() (0) +#endif + #define __switch_to(prev,next,last) do { \ if (((prev)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID)) \ - || IS_IA32_PROCESS(ia64_task_regs(prev))) \ + || IS_IA32_PROCESS(ia64_task_regs(prev)) || PERFMON_IS_SYSWIDE()) \ ia64_save_extra(prev); \ if (((next)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID)) \ - || IS_IA32_PROCESS(ia64_task_regs(next))) \ + || IS_IA32_PROCESS(ia64_task_regs(next)) || PERFMON_IS_SYSWIDE()) \ ia64_load_extra(next); \ (last) = ia64_switch_to((next)); \ } while (0) #ifdef CONFIG_SMP - /* - * In the SMP case, we save the fph state when context-switching - * away from a thread that modified fph. This way, when the thread - * gets scheduled on another CPU, the CPU can pick up the state from - * task->thread.fph, avoiding the complication of having to fetch - * the latest fph state from another CPU. - */ + +/* Return true if this CPU can call the console drivers in printk() */ +#define arch_consoles_callable() (cpu_online_map & (1UL << smp_processor_id())) + +/* + * In the SMP case, we save the fph state when context-switching + * away from a thread that modified fph. This way, when the thread + * gets scheduled on another CPU, the CPU can pick up the state from + * task->thread.fph, avoiding the complication of having to fetch + * the latest fph state from another CPU. + */ # define switch_to(prev,next,last) do { \ if (ia64_psr(ia64_task_regs(prev))->mfh) { \ ia64_psr(ia64_task_regs(prev))->mfh = 0; \ @@ -405,10 +420,6 @@ ia64_psr(ia64_task_regs(prev))->dfh = 1; \ __switch_to(prev,next,last); \ } while (0) - -/* Return true if this CPU can call the console drivers in printk() */ -#define arch_consoles_callable() (cpu_online_map & (1UL << smp_processor_id())) - #else # define switch_to(prev,next,last) do { \ ia64_psr(ia64_task_regs(next))->dfh = (ia64_get_fpu_owner() != (next)); \ diff -urN linux-2.4.18/include/asm-ia64/uaccess.h lia64-2.4/include/asm-ia64/uaccess.h --- linux-2.4.18/include/asm-ia64/uaccess.h Thu Apr 5 12:51:47 2001 +++ lia64-2.4/include/asm-ia64/uaccess.h Fri Jul 19 23:20:16 2002 @@ -320,4 +320,22 @@ extern struct exception_fixup search_exception_table (unsigned long addr); extern void handle_exception (struct pt_regs *regs, struct exception_fixup fixup); +#ifdef GAS_HAS_LOCAL_TAGS +#define SEARCH_EXCEPTION_TABLE(regs) search_exception_table(regs->cr_iip + ia64_psr(regs)->ri); +#else +#define SEARCH_EXCEPTION_TABLE(regs) search_exception_table(regs->cr_iip); +#endif + +static inline int +done_with_exception (struct pt_regs *regs) +{ + struct exception_fixup fix; + fix = SEARCH_EXCEPTION_TABLE(regs); + if (fix.cont) { + handle_exception(regs, fix); + return 1; + } + return 0; +} + #endif /* _ASM_IA64_UACCESS_H */ diff -urN linux-2.4.18/include/asm-ia64/unistd.h lia64-2.4/include/asm-ia64/unistd.h --- linux-2.4.18/include/asm-ia64/unistd.h Mon Nov 26 11:19:18 2001 +++ lia64-2.4/include/asm-ia64/unistd.h Mon May 20 08:56:38 2002 @@ -206,6 +206,10 @@ #define __NR_getdents64 1214 #define __NR_getunwind 1215 #define __NR_readahead 1216 +/* + * 1217-1232: reserved for xattr, tkill, futex, and sched_[sg]etaffinity. + */ +#define __NR_security 1233 /* syscall for security modules */ #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER) diff -urN linux-2.4.18/include/asm-ia64/vga.h lia64-2.4/include/asm-ia64/vga.h --- linux-2.4.18/include/asm-ia64/vga.h Sun Feb 6 18:42:40 2000 +++ lia64-2.4/include/asm-ia64/vga.h Fri Jul 19 23:20:39 2002 @@ -1,22 +1,39 @@ +#ifndef _ASM_IA64_VGA_H +#define _ASM_IA64_VGA_H + /* * Access to VGA videoram * * (c) 1998 Martin Mares * (c) 1999 Asit Mallick * (c) 1999 Don Dugger + * Copyright (C) 2002 Hewlett-Packard Co */ - -#ifndef __ASM_IA64_VGA_H_ -#define __ASM_IA64_VGA_H_ - /* - * On the PC, we can just recalculate addresses and then access the - * videoram directly without any black magic. + * 2002/07/19 davidm@hpl.hp.com Access frame-buffer memory via readX/writeX. */ +#include + +#define VT_BUF_HAVE_RW + #define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0)) -#define vga_readb(x) (*(x)) -#define vga_writeb(x,y) (*(y) = (x)) +#define vga_readb __raw_readb +#define vga_writeb __raw_writeb + +extern inline void +scr_writew (u16 val, volatile u16 *addr) +{ + /* Note: ADDR may point to normal memory. That's OK on ia64. */ + __raw_writew(val, (unsigned long) addr); +} + +extern inline u16 +scr_readw (volatile const u16 *addr) +{ + /* Note: ADDR may point to normal memory. That's OK on ia64. */ + return __raw_readw((unsigned long) addr); +} -#endif /* __ASM_IA64_VGA_H_ */ +#endif /* _ASM_IA64_VGA_H */ diff -urN linux-2.4.18/include/asm-m68k/page.h lia64-2.4/include/asm-m68k/page.h --- linux-2.4.18/include/asm-m68k/page.h Mon Nov 27 18:00:49 2000 +++ lia64-2.4/include/asm-m68k/page.h Sat Feb 9 14:39:22 2002 @@ -181,6 +181,9 @@ #endif /* __ASSEMBLY__ */ +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + #endif /* __KERNEL__ */ #endif /* _M68K_PAGE_H */ diff -urN linux-2.4.18/include/asm-mips/page.h lia64-2.4/include/asm-mips/page.h --- linux-2.4.18/include/asm-mips/page.h Wed Aug 9 13:46:02 2000 +++ lia64-2.4/include/asm-mips/page.h Sat Feb 9 14:39:45 2002 @@ -78,6 +78,9 @@ #define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT)) #define VALID_PAGE(page) ((page - mem_map) < max_mapnr) +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + #endif /* defined (__KERNEL__) */ #endif /* __ASM_PAGE_H */ diff -urN linux-2.4.18/include/asm-mips64/page.h lia64-2.4/include/asm-mips64/page.h --- linux-2.4.18/include/asm-mips64/page.h Wed Aug 9 13:46:02 2000 +++ lia64-2.4/include/asm-mips64/page.h Sat Feb 9 14:40:06 2002 @@ -73,6 +73,9 @@ #define VALID_PAGE(page) ((page - mem_map) < max_mapnr) #endif +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + #endif /* defined (__KERNEL__) */ #endif /* _ASM_PAGE_H */ diff -urN linux-2.4.18/include/asm-parisc/page.h lia64-2.4/include/asm-parisc/page.h --- linux-2.4.18/include/asm-parisc/page.h Tue Dec 5 12:29:39 2000 +++ lia64-2.4/include/asm-parisc/page.h Sat Feb 9 14:40:22 2002 @@ -81,6 +81,9 @@ #define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT)) #define VALID_PAGE(page) ((page - mem_map) < max_mapnr) +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + #endif /* __KERNEL__ */ #endif /* _PARISC_PAGE_H */ diff -urN linux-2.4.18/include/asm-ppc/page.h lia64-2.4/include/asm-ppc/page.h --- linux-2.4.18/include/asm-ppc/page.h Mon Sep 24 15:08:29 2001 +++ lia64-2.4/include/asm-ppc/page.h Sat Feb 9 14:40:49 2002 @@ -137,5 +137,9 @@ } #endif /* __ASSEMBLY__ */ + +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + #endif /* __KERNEL__ */ #endif /* _PPC_PAGE_H */ diff -urN linux-2.4.18/include/asm-s390/page.h lia64-2.4/include/asm-s390/page.h --- linux-2.4.18/include/asm-s390/page.h Wed Jul 25 14:12:02 2001 +++ lia64-2.4/include/asm-s390/page.h Sat Feb 9 14:41:18 2002 @@ -120,6 +120,9 @@ #define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT)) #define VALID_PAGE(page) ((page - mem_map) < max_mapnr) +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + #endif /* __KERNEL__ */ #endif /* _S390_PAGE_H */ diff -urN linux-2.4.18/include/asm-s390x/page.h lia64-2.4/include/asm-s390x/page.h --- linux-2.4.18/include/asm-s390x/page.h Wed Oct 24 10:18:00 2001 +++ lia64-2.4/include/asm-s390x/page.h Sat Feb 9 14:41:36 2002 @@ -117,6 +117,9 @@ #define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT)) #define VALID_PAGE(page) ((page - mem_map) < max_mapnr) +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + #endif /* __KERNEL__ */ #endif /* _S390_PAGE_H */ diff -urN linux-2.4.18/include/asm-sparc/page.h lia64-2.4/include/asm-sparc/page.h --- linux-2.4.18/include/asm-sparc/page.h Mon Oct 30 14:34:12 2000 +++ lia64-2.4/include/asm-sparc/page.h Sat Feb 9 14:42:00 2002 @@ -179,6 +179,9 @@ #define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT)) #define VALID_PAGE(page) ((page - mem_map) < max_mapnr) +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + #endif /* __KERNEL__ */ #endif /* _SPARC_PAGE_H */ diff -urN linux-2.4.18/include/asm-sparc64/page.h lia64-2.4/include/asm-sparc64/page.h --- linux-2.4.18/include/asm-sparc64/page.h Wed Dec 26 16:58:57 2001 +++ lia64-2.4/include/asm-sparc64/page.h Sat Feb 9 14:42:22 2002 @@ -153,6 +153,9 @@ #endif /* !(__ASSEMBLY__) */ +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + #endif /* !(__KERNEL__) */ #endif /* !(_SPARC64_PAGE_H) */ diff -urN linux-2.4.18/include/linux/acpi.h lia64-2.4/include/linux/acpi.h --- linux-2.4.18/include/linux/acpi.h Mon Sep 24 15:08:31 2001 +++ lia64-2.4/include/linux/acpi.h Fri Jul 19 23:20:15 2002 @@ -1,180 +1,384 @@ /* - * acpi.h - ACPI driver interface + * acpi.h - ACPI Interface * - * Copyright (C) 1999 Andrew Henroid + * Copyright (C) 2001 Paul Diefenbaugh * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #ifndef _LINUX_ACPI_H #define _LINUX_ACPI_H -#include -#include -#ifdef __KERNEL__ -#include -#include -#endif /* __KERNEL__ */ +#ifndef _LINUX +#define _LINUX +#endif + +#include /* - * Device states + * Yes this is ugly, but moving all of ACPI's private headers to include/acpi + * isn't the right answer either. Please just ignore it for now. */ -typedef enum { - ACPI_D0, /* fully-on */ - ACPI_D1, /* partial-on */ - ACPI_D2, /* partial-on */ - ACPI_D3, /* fully-off */ -} acpi_dstate_t; - -typedef enum { - ACPI_S0, /* working state */ - ACPI_S1, /* power-on suspend */ - ACPI_S2, /* suspend to ram, with devices */ - ACPI_S3, /* suspend to ram */ - ACPI_S4, /* suspend to disk */ - ACPI_S5, /* soft-off */ -} acpi_sstate_t; - -/* RSDP location */ -#define ACPI_BIOS_ROM_BASE (0x0e0000) -#define ACPI_BIOS_ROM_END (0x100000) - -/* Table signatures */ -#define ACPI_RSDP1_SIG 0x20445352 /* 'RSD ' */ -#define ACPI_RSDP2_SIG 0x20525450 /* 'PTR ' */ -#define ACPI_RSDT_SIG 0x54445352 /* 'RSDT' */ -#define ACPI_FADT_SIG 0x50434146 /* 'FACP' */ -#define ACPI_DSDT_SIG 0x54445344 /* 'DSDT' */ -#define ACPI_FACS_SIG 0x53434146 /* 'FACS' */ - -#define ACPI_SIG_LEN 4 -#define ACPI_FADT_SIGNATURE "FACP" - -/* PM1_STS/EN flags */ -#define ACPI_TMR 0x0001 -#define ACPI_BM 0x0010 -#define ACPI_GBL 0x0020 -#define ACPI_PWRBTN 0x0100 -#define ACPI_SLPBTN 0x0200 -#define ACPI_RTC 0x0400 -#define ACPI_WAK 0x8000 - -/* PM1_CNT flags */ -#define ACPI_SCI_EN 0x0001 -#define ACPI_BM_RLD 0x0002 -#define ACPI_GBL_RLS 0x0004 -#define ACPI_SLP_TYP0 0x0400 -#define ACPI_SLP_TYP1 0x0800 -#define ACPI_SLP_TYP2 0x1000 -#define ACPI_SLP_EN 0x2000 - -#define ACPI_SLP_TYP_MASK 0x1c00 -#define ACPI_SLP_TYP_SHIFT 10 - -/* PM_TMR masks */ -#define ACPI_TMR_VAL_EXT 0x00000100 -#define ACPI_TMR_MASK 0x00ffffff -#define ACPI_TMR_HZ 3579545 /* 3.58 MHz */ -#define ACPI_TMR_KHZ (ACPI_TMR_HZ / 1000) - -#define ACPI_MICROSEC_TO_TMR_TICKS(val) \ - (((val) * (ACPI_TMR_KHZ)) / 1000) - -/* PM2_CNT flags */ -#define ACPI_ARB_DIS 0x01 - -/* FADT flags */ -#define ACPI_WBINVD 0x00000001 -#define ACPI_WBINVD_FLUSH 0x00000002 -#define ACPI_PROC_C1 0x00000004 -#define ACPI_P_LVL2_UP 0x00000008 -#define ACPI_PWR_BUTTON 0x00000010 -#define ACPI_SLP_BUTTON 0x00000020 -#define ACPI_FIX_RTC 0x00000040 -#define ACPI_RTC_64 0x00000080 -#define ACPI_TMR_VAL_EXT 0x00000100 -#define ACPI_DCK_CAP 0x00000200 - -/* FADT BOOT_ARCH flags */ -#define FADT_BOOT_ARCH_LEGACY_DEVICES 0x0001 -#define FADT_BOOT_ARCH_KBD_CONTROLLER 0x0002 - -/* FACS flags */ -#define ACPI_S4BIOS 0x00000001 - -/* processor block offsets */ -#define ACPI_P_CNT 0x00000000 -#define ACPI_P_LVL2 0x00000004 -#define ACPI_P_LVL3 0x00000005 - -/* C-state latencies (microseconds) */ -#define ACPI_MAX_P_LVL2_LAT 100 -#define ACPI_MAX_P_LVL3_LAT 1000 -#define ACPI_INFINITE_LAT (~0UL) +#include "../../drivers/acpi/include/acpi.h" +#include + + +#ifdef CONFIG_ACPI_BOOT + +enum acpi_irq_model_id { + ACPI_IRQ_MODEL_PIC = 0, + ACPI_IRQ_MODEL_IOAPIC, + ACPI_IRQ_MODEL_IOSAPIC, + ACPI_IRQ_MODEL_COUNT +}; + +extern enum acpi_irq_model_id acpi_irq_model; + + +/* Root System Description Pointer (RSDP) */ + +struct acpi_table_rsdp { + char signature[8]; + u8 checksum; + char oem_id[6]; + u8 revision; + u32 rsdt_address; +} __attribute__ ((packed)); + +struct acpi20_table_rsdp { + char signature[8]; + u8 checksum; + char oem_id[6]; + u8 revision; + u32 rsdt_address; + u32 length; + u64 xsdt_address; + u8 ext_checksum; + u8 reserved[3]; +} __attribute__ ((packed)); + +/* Common table header */ + +struct acpi_table_header { + char signature[4]; + u32 length; + u8 revision; + u8 checksum; + char oem_id[6]; + char oem_table_id[8]; + u32 oem_revision; + char asl_compiler_id[4]; + u32 asl_compiler_revision; +} __attribute__ ((packed)); + +typedef struct { + u8 type; + u8 length; +} acpi_table_entry_header __attribute__ ((packed)); + +/* Root System Description Table (RSDT) */ + +struct acpi_table_rsdt { + struct acpi_table_header header; + u32 entry[1]; +} __attribute__ ((packed)); + +/* Extended System Description Table (XSDT) */ + +struct acpi_table_xsdt { + struct acpi_table_header header; + u64 entry[1]; +} __attribute__ ((packed)); + +/* Multiple APIC Description Table (MADT) */ + +struct acpi_table_madt { + struct acpi_table_header header; + u32 lapic_address; + struct { + u32 pcat_compat:1; + u32 reserved:31; + } flags; +} __attribute__ ((packed)); + +enum acpi_madt_entry_id { + ACPI_MADT_LAPIC = 0, + ACPI_MADT_IOAPIC, + ACPI_MADT_INT_SRC_OVR, + ACPI_MADT_NMI_SRC, + ACPI_MADT_LAPIC_NMI, + ACPI_MADT_LAPIC_ADDR_OVR, + ACPI_MADT_IOSAPIC, + ACPI_MADT_LSAPIC, + ACPI_MADT_PLAT_INT_SRC, + ACPI_MADT_ENTRY_COUNT +}; + +typedef struct { + u16 polarity:2; + u16 trigger:2; + u16 reserved:12; +} acpi_interrupt_flags __attribute__ ((packed)); + +struct acpi_table_lapic { + acpi_table_entry_header header; + u8 acpi_id; + u8 id; + struct { + u32 enabled:1; + u32 reserved:31; + } flags; +} __attribute__ ((packed)); + +struct acpi_table_ioapic { + acpi_table_entry_header header; + u8 id; + u8 reserved; + u32 address; + u32 global_irq_base; +} __attribute__ ((packed)); + +struct acpi_table_int_src_ovr { + acpi_table_entry_header header; + u8 bus; + u8 bus_irq; + u32 global_irq; + acpi_interrupt_flags flags; +} __attribute__ ((packed)); + +struct acpi_table_nmi_src { + acpi_table_entry_header header; + acpi_interrupt_flags flags; + u32 global_irq; +} __attribute__ ((packed)); + +struct acpi_table_lapic_nmi { + acpi_table_entry_header header; + u8 acpi_id; + acpi_interrupt_flags flags; + u8 lint; +} __attribute__ ((packed)); + +struct acpi_table_lapic_addr_ovr { + acpi_table_entry_header header; + u8 reserved[2]; + u64 address; +} __attribute__ ((packed)); + +struct acpi_table_iosapic { + acpi_table_entry_header header; + u8 id; + u8 reserved; + u32 global_irq_base; + u64 address; +} __attribute__ ((packed)); + +struct acpi_table_lsapic { + acpi_table_entry_header header; + u8 acpi_id; + u8 id; + u8 eid; + u8 reserved[3]; + struct { + u32 enabled:1; + u32 reserved:31; + } flags; +} __attribute__ ((packed)); + +struct acpi_table_plat_int_src { + acpi_table_entry_header header; + acpi_interrupt_flags flags; + u8 type; /* See acpi_interrupt_type */ + u8 id; + u8 eid; + u8 iosapic_vector; + u32 global_irq; + u32 reserved; +} __attribute__ ((packed)); + +enum acpi_interrupt_id { + ACPI_INTERRUPT_PMI = 1, + ACPI_INTERRUPT_INIT, + ACPI_INTERRUPT_CPEI, + ACPI_INTERRUPT_COUNT +}; /* - * Sysctl declarations + * System Resource Affinity Table (SRAT) + * see http://www.microsoft.com/hwdev/design/srat.htm */ -enum -{ - CTL_ACPI = 10 +struct acpi_table_srat { + struct acpi_table_header header; + u32 table_revision; + u64 reserved; +} __attribute__ ((packed)); + +enum acpi_srat_entry_id { + ACPI_SRAT_PROCESSOR_AFFINITY = 0, + ACPI_SRAT_MEMORY_AFFINITY, + ACPI_SRAT_ENTRY_COUNT +}; + +struct acpi_table_processor_affinity { + acpi_table_entry_header header; + u8 proximity_domain; + u8 apic_id; + struct { + u32 enabled:1; + u32 reserved:31; + } flags; + u8 lsapic_eid; + u8 reserved[7]; +} __attribute__ ((packed)); + +struct acpi_table_memory_affinity { + acpi_table_entry_header header; + u8 proximity_domain; + u8 reserved1[5]; + u32 base_addr_lo; + u32 base_addr_hi; + u32 length_lo; + u32 length_hi; + u32 memory_type; /* See acpi_address_range_id */ + struct { + u32 enabled:1; + u32 hot_pluggable:1; + u32 reserved:30; + } flags; + u64 reserved2; +} __attribute__ ((packed)); + +enum acpi_address_range_id { + ACPI_ADDRESS_RANGE_MEMORY = 1, + ACPI_ADDRESS_RANGE_RESERVED = 2, + ACPI_ADDRESS_RANGE_ACPI = 3, + ACPI_ADDRESS_RANGE_NVS = 4, + ACPI_ADDRESS_RANGE_COUNT }; -enum -{ - ACPI_FADT = 1, +/* + * System Locality Information Table (SLIT) + * see http://devresource.hp.com/devresource/docs/techpapers/ia64/slit.pdf + */ + +struct acpi_table_slit { + struct acpi_table_header header; + u64 localities; + u8 entry[1]; /* real size = localities^2 */ +} __attribute__ ((packed)); + +/* Smart Battery Description Table (SBST) */ + +struct acpi_table_sbst { + struct acpi_table_header header; + u32 warning; /* Warn user */ + u32 low; /* Critical sleep */ + u32 critical; /* Critical shutdown */ +} __attribute__ ((packed)); + +/* Embedded Controller Boot Resources Table (ECDT) */ + +struct acpi_table_ecdt { + struct acpi_table_header header; + acpi_generic_address ec_control; + acpi_generic_address ec_data; + u32 uid; + u8 gpe_bit; + char *ec_id; +} __attribute__ ((packed)); + +/* Table Handlers */ + +enum acpi_table_id { + ACPI_TABLE_UNKNOWN = 0, + ACPI_APIC, + ACPI_BOOT, + ACPI_DBGP, ACPI_DSDT, - ACPI_PM1_ENABLE, - ACPI_GPE_ENABLE, - ACPI_GPE_LEVEL, - ACPI_EVENT, - ACPI_P_BLK, - ACPI_ENTER_LVL2_LAT, - ACPI_ENTER_LVL3_LAT, - ACPI_P_LVL2_LAT, - ACPI_P_LVL3_LAT, - ACPI_C1_TIME, - ACPI_C2_TIME, - ACPI_C3_TIME, - ACPI_C1_COUNT, - ACPI_C2_COUNT, - ACPI_C3_COUNT, - ACPI_S0_SLP_TYP, - ACPI_S1_SLP_TYP, - ACPI_S5_SLP_TYP, - ACPI_SLEEP, + ACPI_ECDT, + ACPI_ETDT, + ACPI_FACP, ACPI_FACS, - ACPI_XSDT, - ACPI_PMTIMER, - ACPI_BATT, + ACPI_OEMX, + ACPI_PSDT, + ACPI_SBST, + ACPI_SLIT, + ACPI_SPCR, + ACPI_SRAT, + ACPI_SSDT, + ACPI_SPMI, + ACPI_TABLE_COUNT +}; + +typedef int (*acpi_table_handler) (unsigned long phys_addr, unsigned long size); + +extern acpi_table_handler acpi_table_ops[ACPI_TABLE_COUNT]; + +typedef int (*acpi_madt_entry_handler) (acpi_table_entry_header *header); + +char * __acpi_map_table (unsigned long phys_addr, unsigned long size); +unsigned long acpi_find_rsdp (void); +int acpi_boot_init (char *cmdline); + +int acpi_table_init (char *cmdline); +int acpi_table_parse (enum acpi_table_id, acpi_table_handler); +int acpi_table_parse_madt (enum acpi_table_id, acpi_madt_entry_handler); +void acpi_table_print (struct acpi_table_header *, unsigned long); +void acpi_table_print_madt_entry (acpi_table_entry_header *); + +#endif /*CONFIG_ACPI_BOOT*/ + + +#ifdef CONFIG_ACPI_PCI + +struct acpi_prt_entry { + struct list_head node; + acpi_pci_id id; + u8 pin; + struct { + acpi_handle handle; + u32 index; + } link; + u32 irq; }; -#define ACPI_SLP_TYP_DISABLED (~0UL) +struct acpi_prt_list { + int count; + struct list_head entries; +}; -#ifdef __KERNEL__ +extern struct acpi_prt_list acpi_prt; -/* routines for saving/restoring kernel state */ -FASTCALL(extern unsigned long acpi_save_state_mem(unsigned long return_point)); -FASTCALL(extern int acpi_save_state_disk(unsigned long return_point)); -extern void acpi_restore_state(void); +struct pci_dev; -extern unsigned long acpi_wakeup_address; +int acpi_pci_irq_enable (struct pci_dev *dev); +int acpi_pci_irq_init (void); -#endif /* __KERNEL__ */ +#endif /*CONFIG_ACPI_PCI*/ + + +#ifdef CONFIG_ACPI int acpi_init(void); -#endif /* _LINUX_ACPI_H */ +#endif /*CONFIG_ACPI*/ + + +#endif /*_LINUX_ACPI_H*/ diff -urN linux-2.4.18/include/linux/acpi_serial.h lia64-2.4/include/linux/acpi_serial.h --- linux-2.4.18/include/linux/acpi_serial.h Mon Nov 26 11:19:19 2001 +++ lia64-2.4/include/linux/acpi_serial.h Mon Jul 8 18:26:08 2002 @@ -11,6 +11,8 @@ extern void setup_serial_acpi(void *); +#define ACPI_SIG_LEN 4 + /* ACPI table signatures */ #define ACPI_SPCRT_SIGNATURE "SPCR" #define ACPI_DBGPT_SIGNATURE "DBGP" diff -urN linux-2.4.18/include/linux/agp_backend.h lia64-2.4/include/linux/agp_backend.h --- linux-2.4.18/include/linux/agp_backend.h Mon Nov 26 11:19:19 2001 +++ lia64-2.4/include/linux/agp_backend.h Thu Apr 11 14:58:36 2002 @@ -27,6 +27,8 @@ #ifndef _AGP_BACKEND_H #define _AGP_BACKEND_H 1 +#include + #ifndef TRUE #define TRUE 1 #endif @@ -52,6 +54,7 @@ INTEL_I845, INTEL_I850, INTEL_I860, + INTEL_460GX, VIA_GENERIC, VIA_VP3, VIA_MVP3, @@ -74,7 +77,8 @@ ALI_GENERIC, SVWRKS_HE, SVWRKS_LE, - SVWRKS_GENERIC + SVWRKS_GENERIC, + HP_ZX1, }; typedef struct _agp_version { @@ -115,6 +119,7 @@ size_t page_count; int num_scratch_pages; unsigned long *memory; + void *vmptr; off_t pg_start; u32 type; u32 physical; diff -urN linux-2.4.18/include/linux/fs.h lia64-2.4/include/linux/fs.h --- linux-2.4.18/include/linux/fs.h Tue Feb 26 11:05:05 2002 +++ lia64-2.4/include/linux/fs.h Fri Jul 19 23:20:15 2002 @@ -240,7 +240,7 @@ /* First cache line: */ struct buffer_head *b_next; /* Hash queue list */ unsigned long b_blocknr; /* block number */ - unsigned short b_size; /* block size */ + unsigned int b_size; /* block size */ unsigned short b_list; /* List that this buffer appears */ kdev_t b_dev; /* device (B_FREE = free) */ diff -urN linux-2.4.18/include/linux/hcdp_serial.h lia64-2.4/include/linux/hcdp_serial.h --- linux-2.4.18/include/linux/hcdp_serial.h Wed Dec 31 16:00:00 1969 +++ lia64-2.4/include/linux/hcdp_serial.h Mon Jul 8 15:20:33 2002 @@ -0,0 +1,84 @@ +/* + * linux/include/linux/hcdp_serial.h + * + * Copyright (C) 2002 Hewlett-Packard Co. + * Copyright (C) 2002 Khalid Aziz + * + * Definitions for HCDP defined serial ports (Serial console and + * debug ports) + * + */ +#ifndef _LINUX_HCDP_SERIAL_H +#define _LINUX_HCDP_SERIAL_H + +/* ACPI table signatures */ +#define HCDP_SIG_LEN 4 +#define HCDP_SIGNATURE "HCDP" + +/* Space ID as defined in ACPI generic address structure */ +#define ACPI_MEM_SPACE 0 +#define ACPI_IO_SPACE 1 +#define ACPI_PCICONF_SPACE 2 + +/* + * Maximum number of HCDP devices we want to read in + */ +#define MAX_HCDP_DEVICES 6 + +/* + * Default base baud rate if clock rate is 0 in HCDP table. + */ +#define DEFAULT_BAUD_BASE 115200 + +/* + * ACPI Generic Address Structure + */ +typedef struct { + u8 space_id; + u8 bit_width; + u8 bit_offset; + u8 resv; + u32 addrlo; + u32 addrhi; +} acpi_gen_addr; + +/* HCDP Device descriptor entry types */ +#define HCDP_DEV_CONSOLE 0 +#define HCDP_DEV_DEBUG 1 + +/* HCDP Device descriptor type */ +typedef struct { + u8 type; + u8 bits; + u8 parity; + u8 stop_bits; + u8 pci_seg; + u8 pci_bus; + u8 pci_dev; + u8 pci_func; + u64 baud; + acpi_gen_addr base_addr; + u16 pci_dev_id; + u16 pci_vendor_id; + u32 global_int; + u32 clock_rate; + u8 pci_prog_intfc; + u8 resv; +} hcdp_dev_t; + +/* HCDP Table format */ +typedef struct { + u8 signature[4]; + u32 len; + u8 rev; + u8 chksum; + u8 oemid[6]; + u8 oem_tabid[8]; + u32 oem_rev; + u8 creator_id[4]; + u32 creator_rev; + u32 num_entries; + hcdp_dev_t hcdp_dev[MAX_HCDP_DEVICES]; +} hcdp_t; + +#endif /* _LINUX_HCDP_SERIAL_H */ diff -urN linux-2.4.18/include/linux/highmem.h lia64-2.4/include/linux/highmem.h --- linux-2.4.18/include/linux/highmem.h Tue Feb 26 11:05:05 2002 +++ lia64-2.4/include/linux/highmem.h Fri Jul 19 23:20:25 2002 @@ -46,7 +46,7 @@ static inline void clear_user_highpage(struct page *page, unsigned long vaddr) { void *addr = kmap_atomic(page, KM_USER0); - clear_user_page(addr, vaddr); + clear_user_page(addr, vaddr, page); kunmap_atomic(addr, KM_USER0); } @@ -78,7 +78,7 @@ vfrom = kmap_atomic(from, KM_USER0); vto = kmap_atomic(to, KM_USER1); - copy_user_page(vto, vfrom, vaddr); + copy_user_page(vto, vfrom, vaddr, to); kunmap_atomic(vfrom, KM_USER0); kunmap_atomic(vto, KM_USER1); } diff -urN linux-2.4.18/include/linux/irq.h lia64-2.4/include/linux/irq.h --- linux-2.4.18/include/linux/irq.h Mon Sep 24 15:08:33 2001 +++ lia64-2.4/include/linux/irq.h Fri Jul 19 23:20:16 2002 @@ -56,15 +56,13 @@ * * Pad this out to 32 bytes for cache and indexing reasons. */ -typedef struct { +typedef struct irq_desc { unsigned int status; /* IRQ status */ hw_irq_controller *handler; struct irqaction *action; /* IRQ action list */ unsigned int depth; /* nested irq disables */ spinlock_t lock; } ____cacheline_aligned irq_desc_t; - -extern irq_desc_t irq_desc [NR_IRQS]; #include /* the arch dependent stuff */ diff -urN linux-2.4.18/include/linux/irq_cpustat.h lia64-2.4/include/linux/irq_cpustat.h --- linux-2.4.18/include/linux/irq_cpustat.h Fri Aug 10 18:13:47 2001 +++ lia64-2.4/include/linux/irq_cpustat.h Mon May 6 09:16:40 2002 @@ -23,15 +23,31 @@ #define __IRQ_STAT(cpu, member) (irq_stat[cpu].member) #else #define __IRQ_STAT(cpu, member) ((void)(cpu), irq_stat[0].member) -#endif +#endif /* arch independent irq_stat fields */ #define softirq_pending(cpu) __IRQ_STAT((cpu), __softirq_pending) -#define local_irq_count(cpu) __IRQ_STAT((cpu), __local_irq_count) -#define local_bh_count(cpu) __IRQ_STAT((cpu), __local_bh_count) +#define irq_count(cpu) __IRQ_STAT((cpu), __local_irq_count) +#define bh_count(cpu) __IRQ_STAT((cpu), __local_bh_count) #define syscall_count(cpu) __IRQ_STAT((cpu), __syscall_count) #define ksoftirqd_task(cpu) __IRQ_STAT((cpu), __ksoftirqd_task) /* arch dependent irq_stat fields */ #define nmi_count(cpu) __IRQ_STAT((cpu), __nmi_count) /* i386, ia64 */ + +#define local_hardirq_trylock() hardirq_trylock(smp_processor_id()) +#define local_hardirq_endlock() hardirq_trylock(smp_processor_id()) +#define local_irq_enter(irq) irq_enter(smp_processor_id(), (irq)) +#define local_irq_exit(irq) irq_exit(smp_processor_id(), (irq)) +#define local_softirq_pending() softirq_pending(smp_processor_id()) +#define local_ksoftirqd_task() ksoftirqd_task(smp_processor_id()) + +/* These will lose the "really_" prefix when the interim macros below are removed. */ +#define really_local_irq_count()bh_count(smp_processor_id()) +#define really_local_bh_count() bh_count(smp_processor_id()) + +/* Interim macros for backward compatibility. They are deprecated. Use irq_count() and + bh_count() instead. --davidm 01/11/28 */ +#define local_irq_count(cpu) irq_count(cpu) +#define local_bh_count(cpu) bh_count(cpu) #endif /* __irq_cpustat_h */ diff -urN linux-2.4.18/include/linux/mm.h lia64-2.4/include/linux/mm.h --- linux-2.4.18/include/linux/mm.h Wed Dec 26 16:58:57 2001 +++ lia64-2.4/include/linux/mm.h Fri Jul 19 23:20:20 2002 @@ -102,8 +102,10 @@ #define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */ #define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ #define VM_RESERVED 0x00080000 /* Don't unmap it from swap_out */ +#define VM_WRITECOMBINED 0x00100000 /* Write-combined */ +#define VM_NONCACHED 0x00200000 /* Noncached access */ -#define VM_STACK_FLAGS 0x00000177 +#define VM_STACK_FLAGS (VM_DATA_DEFAULT_FLAGS | VM_GROWSDOWN) #define VM_READHINTMASK (VM_SEQ_READ | VM_RAND_READ) #define VM_ClearReadHint(v) (v)->vm_flags &= ~VM_READHINTMASK diff -urN linux-2.4.18/include/linux/mmzone.h lia64-2.4/include/linux/mmzone.h --- linux-2.4.18/include/linux/mmzone.h Mon Sep 24 15:08:34 2001 +++ lia64-2.4/include/linux/mmzone.h Fri Jul 19 23:20:15 2002 @@ -59,7 +59,8 @@ * rarely used fields: */ char *name; - unsigned long size; + unsigned long totalsize; + unsigned long memsize; } zone_t; #define ZONE_DMA 0 diff -urN linux-2.4.18/include/linux/pci_ids.h lia64-2.4/include/linux/pci_ids.h --- linux-2.4.18/include/linux/pci_ids.h Tue Feb 26 11:05:06 2002 +++ lia64-2.4/include/linux/pci_ids.h Mon Jul 22 09:28:37 2002 @@ -505,6 +505,9 @@ #define PCI_DEVICE_ID_HP_DIVA1 0x1049 #define PCI_DEVICE_ID_HP_DIVA2 0x104A #define PCI_DEVICE_ID_HP_SP2_0 0x104B +#define PCI_DEVICE_ID_HP_ZX1_SBA 0x1229 +#define PCI_DEVICE_ID_HP_ZX1_IOC 0x122a +#define PCI_DEVICE_ID_HP_ZX1_LBA 0x122e #define PCI_VENDOR_ID_PCTECH 0x1042 #define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000 @@ -873,6 +876,7 @@ #define PCI_DEVICE_ID_NVIDIA_GEFORCE3_1 0x0201 #define PCI_DEVICE_ID_NVIDIA_GEFORCE3_2 0x0202 #define PCI_DEVICE_ID_NVIDIA_QUADRO_DDC 0x0203 +#define PCI_DEVICE_ID_NVIDIA_QUADRO4 0x0258 #define PCI_VENDOR_ID_IMS 0x10e0 #define PCI_DEVICE_ID_IMS_8849 0x8849 @@ -1505,8 +1509,12 @@ #define PCI_VENDOR_ID_BROADCOM 0x14e4 #define PCI_DEVICE_ID_TIGON3_5700 0x1644 +#define PCI_DEVICE_ID_TIGON3_5702 0x1646 #define PCI_DEVICE_ID_TIGON3_5701 0x1645 #define PCI_DEVICE_ID_TIGON3_5703 0x1647 +#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d +#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 +#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 #define PCI_VENDOR_ID_SYBA 0x1592 #define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 @@ -1520,6 +1528,10 @@ #define PCI_VENDOR_ID_PDC 0x15e9 #define PCI_DEVICE_ID_PDC_1841 0x1841 + +#define PCI_VENDOR_ID_ALTIMA 0x173b +#define PCI_DEVICE_ID_ALTIMA_AC1000 0x03e8 +#define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea #define PCI_VENDOR_ID_SYMPHONY 0x1c1c #define PCI_DEVICE_ID_SYMPHONY_101 0x0001 diff -urN linux-2.4.18/include/linux/serial.h lia64-2.4/include/linux/serial.h --- linux-2.4.18/include/linux/serial.h Mon Nov 26 11:19:23 2001 +++ lia64-2.4/include/linux/serial.h Fri Jul 19 23:20:27 2002 @@ -182,11 +182,12 @@ /* Allow complicated architectures to specify rs_table[] at run time */ extern int early_serial_setup(struct serial_struct *req); -#ifdef CONFIG_ACPI /* tty ports reserved for the ACPI serial console port and debug port */ #define ACPI_SERIAL_CONSOLE_PORT 4 #define ACPI_SERIAL_DEBUG_PORT 5 -#endif + +/* tty port reserved for the HCDP serial console port */ +#define HCDP_SERIAL_CONSOLE_PORT 4 #endif /* __KERNEL__ */ #endif /* _LINUX_SERIAL_H */ diff -urN linux-2.4.18/include/linux/smp.h lia64-2.4/include/linux/smp.h --- linux-2.4.18/include/linux/smp.h Fri Aug 10 18:13:47 2001 +++ lia64-2.4/include/linux/smp.h Fri Jul 19 23:20:15 2002 @@ -35,11 +35,6 @@ extern void smp_boot_cpus(void); /* - * Processor call in. Must hold processors until .. - */ -extern void smp_callin(void); - -/* * Multiprocessors may now schedule */ extern void smp_commence(void); @@ -53,13 +48,9 @@ /* * True once the per process idle is forked */ -extern int smp_threads_ready; +extern volatile int smp_threads_ready; extern int smp_num_cpus; - -extern volatile unsigned long smp_msg_data; -extern volatile int smp_src_cpu; -extern volatile int smp_msg_id; #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ #define MSG_ALL 0x8001 diff -urN linux-2.4.18/init/main.c lia64-2.4/init/main.c --- linux-2.4.18/init/main.c Tue Feb 26 11:05:09 2002 +++ lia64-2.4/init/main.c Tue Jun 11 14:24:23 2002 @@ -36,6 +36,10 @@ #include #endif +#ifdef CONFIG_ACPI +#include +#endif + #ifdef CONFIG_PCI #include #endif @@ -106,9 +110,6 @@ #if defined(CONFIG_SYSVIPC) extern void ipc_init(void); #endif -#ifdef CONFIG_PERFMON -extern void perfmon_init(void); -#endif /* * Boot command-line arguments @@ -596,9 +597,6 @@ kmem_cache_sizes_init(); pgtable_cache_init(); -#ifdef CONFIG_PERFMON - perfmon_init(); -#endif mempages = num_physpages; fork_init(mempages); @@ -699,7 +697,9 @@ #if defined(CONFIG_ARCH_S390) s390_init_machine_check(); #endif - +#ifdef CONFIG_ACPI_INTERPRETER + acpi_init(); +#endif #ifdef CONFIG_PCI pci_init(); #endif diff -urN linux-2.4.18/kernel/exec_domain.c lia64-2.4/kernel/exec_domain.c --- linux-2.4.18/kernel/exec_domain.c Tue Feb 26 11:05:09 2002 +++ lia64-2.4/kernel/exec_domain.c Tue Feb 26 11:39:03 2002 @@ -196,8 +196,10 @@ put_exec_domain(oep); +#if 0 printk(KERN_DEBUG "[%s:%d]: set personality to %lx\n", current->comm, current->pid, personality); +#endif return 0; } diff -urN linux-2.4.18/kernel/pm.c lia64-2.4/kernel/pm.c --- linux-2.4.18/kernel/pm.c Fri Apr 6 10:51:19 2001 +++ lia64-2.4/kernel/pm.c Mon Jul 23 14:22:24 2001 @@ -162,7 +162,7 @@ case PM_SUSPEND: case PM_RESUME: prev_state = dev->state; - next_state = (int) data; + next_state = (long) data; if (prev_state != next_state) { if (dev->callback) status = (*dev->callback)(dev, rqst, data); @@ -197,7 +197,7 @@ */ pm_request_t undo = (dev->prev_state ? PM_SUSPEND:PM_RESUME); - pm_send(dev, undo, (void*) dev->prev_state); + pm_send(dev, undo, (void*) (long) dev->prev_state); } entry = entry->prev; } diff -urN linux-2.4.18/kernel/printk.c lia64-2.4/kernel/printk.c --- linux-2.4.18/kernel/printk.c Tue Feb 26 11:05:09 2002 +++ lia64-2.4/kernel/printk.c Tue Feb 26 11:43:27 2002 @@ -29,7 +29,7 @@ #include -#ifdef CONFIG_MULTIQUAD +#if defined(CONFIG_MULTIQUAD) || defined(CONFIG_IA64) #define LOG_BUF_LEN (65536) #elif defined(CONFIG_ARCH_S390) #define LOG_BUF_LEN (131072) @@ -326,6 +326,12 @@ __call_console_drivers(start, end); } } +#ifdef CONFIG_IA64_EARLY_PRINTK + if (!console_drivers) { + static void early_printk (const char *str, size_t len); + early_printk(&LOG_BUF(start), end - start); + } +#endif } /* @@ -685,3 +691,50 @@ tty->driver.write(tty, 0, msg, strlen(msg)); return; } + +#ifdef CONFIG_IA64_EARLY_PRINTK + +#include + +#define VGABASE ((char *)0xc0000000000b8000) +#define VGALINES 24 +#define VGACOLS 80 + +static int current_ypos = VGALINES, current_xpos = 0; + +void +early_printk (const char *str, size_t len) +{ + char c; + int i, k, j; + + while (len-- > 0) { + c = *str++; + if (current_ypos >= VGALINES) { + /* scroll 1 line up */ + for (k = 1, j = 0; k < VGALINES; k++, j++) { + for (i = 0; i < VGACOLS; i++) { + writew(readw(VGABASE + 2*(VGACOLS*k + i)), + VGABASE + 2*(VGACOLS*j + i)); + } + } + for (i = 0; i < VGACOLS; i++) { + writew(0x720, VGABASE + 2*(VGACOLS*j + i)); + } + current_ypos = VGALINES-1; + } + if (c == '\n') { + current_xpos = 0; + current_ypos++; + } else if (c != '\r') { + writew(((0x7 << 8) | (unsigned short) c), + VGABASE + 2*(VGACOLS*current_ypos + current_xpos++)); + if (current_xpos >= VGACOLS) { + current_xpos = 0; + current_ypos++; + } + } + } +} + +#endif /* CONFIG_IA64_EARLY_PRINTK */ diff -urN linux-2.4.18/kernel/ptrace.c lia64-2.4/kernel/ptrace.c --- linux-2.4.18/kernel/ptrace.c Tue Feb 26 11:05:09 2002 +++ lia64-2.4/kernel/ptrace.c Tue Feb 26 11:39:07 2002 @@ -164,7 +164,8 @@ if (write) { memcpy(maddr + offset, buf, bytes); flush_page_to_ram(page); - flush_icache_page(vma, page); + flush_icache_range((unsigned long) maddr + offset, + (unsigned long) maddr + offset + bytes); } else { memcpy(buf, maddr + offset, bytes); flush_page_to_ram(page); diff -urN linux-2.4.18/kernel/signal.c lia64-2.4/kernel/signal.c --- linux-2.4.18/kernel/signal.c Mon Nov 26 11:19:24 2001 +++ lia64-2.4/kernel/signal.c Mon Nov 26 11:22:47 2001 @@ -1104,8 +1104,19 @@ ss_sp = NULL; } else { error = -ENOMEM; +#ifdef __ia64__ + /* + * XXX fix me: due to an oversight, MINSIGSTKSZ used to be defined + * as 2KB, which is far too small. This was after Linux kernel + * 2.4.9 but since there are a fair number of ia64 apps out there, + * we continue to allow "too" small sigaltstacks for a while. + */ + if (ss_size < 2048) + goto out; +#else if (ss_size < MINSIGSTKSZ) goto out; +#endif } current->sas_ss_sp = (unsigned long) ss_sp; diff -urN linux-2.4.18/kernel/softirq.c lia64-2.4/kernel/softirq.c --- linux-2.4.18/kernel/softirq.c Mon Nov 5 18:29:05 2001 +++ lia64-2.4/kernel/softirq.c Wed Nov 28 13:43:55 2001 @@ -40,7 +40,10 @@ - Bottom halves: globally serialized, grr... */ +/* No separate irq_stat for ia64, it is part of PSA */ +#if !defined(CONFIG_IA64) irq_cpustat_t irq_stat[NR_CPUS]; +#endif /* CONFIG_IA64 */ static struct softirq_action softirq_vec[32] __cacheline_aligned; @@ -60,7 +63,6 @@ asmlinkage void do_softirq() { - int cpu = smp_processor_id(); __u32 pending; long flags; __u32 mask; @@ -70,7 +72,7 @@ local_irq_save(flags); - pending = softirq_pending(cpu); + pending = local_softirq_pending(); if (pending) { struct softirq_action *h; @@ -79,7 +81,7 @@ local_bh_disable(); restart: /* Reset the pending bitmask before enabling irqs */ - softirq_pending(cpu) = 0; + local_softirq_pending() = 0; local_irq_enable(); @@ -94,7 +96,7 @@ local_irq_disable(); - pending = softirq_pending(cpu); + pending = local_softirq_pending(); if (pending & mask) { mask &= ~pending; goto restart; @@ -102,7 +104,7 @@ __local_bh_enable(); if (pending) - wakeup_softirqd(cpu); + wakeup_softirqd(smp_processor_id()); } local_irq_restore(flags); @@ -124,7 +126,7 @@ * Otherwise we wake up ksoftirqd to make sure we * schedule the softirq soon. */ - if (!(local_irq_count(cpu) | local_bh_count(cpu))) + if (!(irq_count(cpu) | bh_count(cpu))) wakeup_softirqd(cpu); } @@ -288,18 +290,16 @@ static void bh_action(unsigned long nr) { - int cpu = smp_processor_id(); - if (!spin_trylock(&global_bh_lock)) goto resched; - if (!hardirq_trylock(cpu)) + if (!local_hardirq_trylock()) goto resched_unlock; if (bh_base[nr]) bh_base[nr](); - hardirq_endlock(cpu); + local_hardirq_endlock(); spin_unlock(&global_bh_lock); return; @@ -378,15 +378,15 @@ __set_current_state(TASK_INTERRUPTIBLE); mb(); - ksoftirqd_task(cpu) = current; + local_ksoftirqd_task() = current; for (;;) { - if (!softirq_pending(cpu)) + if (!local_softirq_pending()) schedule(); __set_current_state(TASK_RUNNING); - while (softirq_pending(cpu)) { + while (local_softirq_pending()) { do_softirq(); if (current->need_resched) schedule(); diff -urN linux-2.4.18/kernel/time.c lia64-2.4/kernel/time.c --- linux-2.4.18/kernel/time.c Tue Feb 26 11:05:09 2002 +++ lia64-2.4/kernel/time.c Tue Feb 26 11:44:05 2002 @@ -39,6 +39,7 @@ /* The xtime_lock is not only serializing the xtime read/writes but it's also serializing all accesses to the global NTP variables now. */ extern rwlock_t xtime_lock; +extern unsigned long last_time_offset; #if !defined(__alpha__) && !defined(__ia64__) @@ -82,6 +83,7 @@ write_lock_irq(&xtime_lock); xtime.tv_sec = value; xtime.tv_usec = 0; + last_time_offset = 0; time_adjust = 0; /* stop active adjtime() */ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; @@ -127,6 +129,7 @@ { write_lock_irq(&xtime_lock); xtime.tv_sec += sys_tz.tz_minuteswest * 60; + last_time_offset = 0; write_unlock_irq(&xtime_lock); } @@ -213,13 +216,13 @@ /* In order to modify anything, you gotta be super-user! */ if (txc->modes && !capable(CAP_SYS_TIME)) return -EPERM; - + /* Now we validate the data before disabling interrupts */ if (txc->modes != ADJ_OFFSET_SINGLESHOT && (txc->modes & ADJ_OFFSET)) /* adjustment Offset limited to +- .512 seconds */ if (txc->offset <= - MAXPHASE || txc->offset >= MAXPHASE ) - return -EINVAL; + return -EINVAL; /* if the quartz is off by more than 10% something is VERY wrong ! */ if (txc->modes & ADJ_TICK) @@ -356,7 +359,7 @@ && (time_status & (STA_PPSWANDER|STA_PPSERROR)) != 0)) /* p. 24, (d) */ result = TIME_ERROR; - + if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) txc->offset = save_adjust; else { @@ -381,6 +384,7 @@ txc->calcnt = pps_calcnt; txc->errcnt = pps_errcnt; txc->stbcnt = pps_stbcnt; + last_time_offset = 0; write_unlock_irq(&xtime_lock); do_gettimeofday(&txc->time); return(result); diff -urN linux-2.4.18/kernel/timer.c lia64-2.4/kernel/timer.c --- linux-2.4.18/kernel/timer.c Wed Oct 10 16:32:16 2001 +++ lia64-2.4/kernel/timer.c Wed Nov 28 13:43:44 2001 @@ -592,7 +592,7 @@ else kstat.per_cpu_user[cpu] += user_tick; kstat.per_cpu_system[cpu] += system; - } else if (local_bh_count(cpu) || local_irq_count(cpu) > 1) + } else if (really_local_bh_count() || really_local_irq_count() > 1) kstat.per_cpu_system[cpu] += system; } @@ -644,6 +644,7 @@ * This spinlock protect us from races in SMP while playing with xtime. -arca */ rwlock_t xtime_lock = RW_LOCK_UNLOCKED; +unsigned long last_time_offset; static inline void update_times(void) { @@ -661,6 +662,7 @@ wall_jiffies += ticks; update_wall_time(ticks); } + last_time_offset = 0; write_unlock_irq(&xtime_lock); calc_load(ticks); } @@ -673,7 +675,7 @@ void do_timer(struct pt_regs *regs) { - (*(unsigned long *)&jiffies)++; + (*(volatile unsigned long *)&jiffies)++; #ifndef CONFIG_SMP /* SMP process accounting uses the local APIC timer */ @@ -811,7 +813,7 @@ if (t.tv_nsec >= 1000000000L || t.tv_nsec < 0 || t.tv_sec < 0) return -EINVAL; - +#if !defined(__ia64__) if (t.tv_sec == 0 && t.tv_nsec <= 2000000L && current->policy != SCHED_OTHER) { @@ -824,6 +826,7 @@ udelay((t.tv_nsec + 999) / 1000); return 0; } +#endif expire = timespec_to_jiffies(&t) + (t.tv_sec || t.tv_nsec); diff -urN linux-2.4.18/mm/bootmem.c lia64-2.4/mm/bootmem.c --- linux-2.4.18/mm/bootmem.c Wed Dec 26 16:58:58 2001 +++ lia64-2.4/mm/bootmem.c Fri Jul 19 16:50:35 2002 @@ -142,6 +142,7 @@ static void * __init __alloc_bootmem_core (bootmem_data_t *bdata, unsigned long size, unsigned long align, unsigned long goal) { + static unsigned long last_success; unsigned long i, start = 0; void *ret; unsigned long offset, remaining_size; @@ -167,6 +168,9 @@ if (goal && (goal >= bdata->node_boot_start) && ((goal >> PAGE_SHIFT) < bdata->node_low_pfn)) { preferred = goal - bdata->node_boot_start; + + if (last_success >= preferred) + preferred = last_success; } else preferred = 0; @@ -178,6 +182,8 @@ restart_scan: for (i = preferred; i < eidx; i += incr) { unsigned long j; + i = find_next_zero_bit((char *)bdata->node_bootmem_map, eidx, i); + i = (i + incr - 1) & -incr; if (test_bit(i, bdata->node_bootmem_map)) continue; for (j = i + 1; j < i + areasize; ++j) { @@ -196,6 +202,7 @@ } return NULL; found: + last_success = start << PAGE_SHIFT; if (start >= eidx) BUG(); @@ -242,22 +249,24 @@ static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat) { - struct page *page = pgdat->node_mem_map; bootmem_data_t *bdata = pgdat->bdata; unsigned long i, count, total = 0; + struct page *page; unsigned long idx; if (!bdata->node_bootmem_map) BUG(); count = 0; idx = bdata->node_low_pfn - (bdata->node_boot_start >> PAGE_SHIFT); - for (i = 0; i < idx; i++, page++) { - if (!test_bit(i, bdata->node_bootmem_map)) { - count++; - ClearPageReserved(page); - set_page_count(page, 1); - __free_page(page); - } + for (i = find_first_zero_bit(bdata->node_bootmem_map, idx); + i < idx; + i = find_next_zero_bit(bdata->node_bootmem_map, idx, i + 1)) + { + page = pgdat->node_mem_map + i; + count++; + ClearPageReserved(page); + set_page_count(page, 1); + __free_page(page); } total += count; diff -urN linux-2.4.18/mm/memory.c lia64-2.4/mm/memory.c --- linux-2.4.18/mm/memory.c Tue Feb 26 11:05:09 2002 +++ lia64-2.4/mm/memory.c Tue Feb 26 18:48:34 2002 @@ -119,7 +119,7 @@ pmd = pmd_offset(dir, 0); pgd_clear(dir); for (j = 0; j < PTRS_PER_PMD ; j++) { - prefetchw(pmd+j+(PREFETCH_STRIDE/16)); + prefetchw(pmd + j + PREFETCH_STRIDE/sizeof(*pmd)); free_one_pmd(pmd+j); } pmd_free(pmd); diff -urN linux-2.4.18/mm/mmap.c lia64-2.4/mm/mmap.c --- linux-2.4.18/mm/mmap.c Tue Feb 26 11:05:09 2002 +++ lia64-2.4/mm/mmap.c Wed Jun 19 18:23:42 2002 @@ -204,6 +204,12 @@ _trans(prot, PROT_WRITE, VM_WRITE) | _trans(prot, PROT_EXEC, VM_EXEC); flag_bits = +#ifdef MAP_WRITECOMBINED + _trans(flags, MAP_WRITECOMBINED, VM_WRITECOMBINED) | +#endif +#ifdef MAP_NONCACHED + _trans(flags, MAP_NONCACHED, VM_NONCACHED) | +#endif _trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN) | _trans(flags, MAP_DENYWRITE, VM_DENYWRITE) | _trans(flags, MAP_EXECUTABLE, VM_EXECUTABLE); @@ -877,6 +883,8 @@ break; } no_mmaps: + if (last < first) + return; /* * If the PGD bits are not consecutive in the virtual address, the * old method of shifting the VA >> by PGDIR_SHIFT doesn't work. @@ -1046,10 +1054,7 @@ if (!vm_enough_memory(len >> PAGE_SHIFT)) return -ENOMEM; - flags = calc_vm_flags(PROT_READ|PROT_WRITE|PROT_EXEC, - MAP_FIXED|MAP_PRIVATE) | mm->def_flags; - - flags |= VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC; + flags = VM_DATA_DEFAULT_FLAGS | mm->def_flags; /* Can we just expand an old anonymous mapping? */ if (rb_parent && vma_merge(mm, prev, rb_parent, addr, addr + len, flags)) diff -urN linux-2.4.18/mm/page_alloc.c lia64-2.4/mm/page_alloc.c --- linux-2.4.18/mm/page_alloc.c Tue Feb 26 11:05:09 2002 +++ lia64-2.4/mm/page_alloc.c Mon Jul 8 21:08:37 2002 @@ -54,7 +54,7 @@ /* * Temporary debugging check. */ -#define BAD_RANGE(zone,x) (((zone) != (x)->zone) || (((x)-mem_map) < (zone)->zone_start_mapnr) || (((x)-mem_map) >= (zone)->zone_start_mapnr+(zone)->size)) +#define BAD_RANGE(zone,x) (((zone) != (x)->zone) || (((x)-mem_map) < (zone)->zone_start_mapnr) || (((x)-mem_map) >= (zone)->zone_start_mapnr+(zone)->totalsize)) /* * Buddy system. Hairy. You really aren't expected to understand this @@ -476,7 +476,7 @@ zone_t *zone; for (zone = *zonep++; zone; zone = *zonep++) { - unsigned long size = zone->size; + unsigned long size = zone->memsize; unsigned long high = zone->pages_high; if (size > high) sum += size - high; @@ -545,7 +545,7 @@ unsigned long nr, total, flags; total = 0; - if (zone->size) { + if (zone->memsize) { spin_lock_irqsave(&zone->lock, flags); for (order = 0; order < MAX_ORDER; order++) { head = &(zone->free_area + order)->free_list; @@ -604,7 +604,7 @@ */ case ZONE_HIGHMEM: zone = pgdat->node_zones + ZONE_HIGHMEM; - if (zone->size) { + if (zone->memsize) { #ifndef CONFIG_HIGHMEM BUG(); #endif @@ -612,17 +612,49 @@ } case ZONE_NORMAL: zone = pgdat->node_zones + ZONE_NORMAL; - if (zone->size) + if (zone->memsize) zonelist->zones[j++] = zone; case ZONE_DMA: zone = pgdat->node_zones + ZONE_DMA; - if (zone->size) + if (zone->memsize) zonelist->zones[j++] = zone; } zonelist->zones[j++] = NULL; } } +#ifdef HAVE_ARCH_MEMMAP_INIT +# define MMI_INLINE +#else +# define MMI_INLINE inline +#endif + +static MMI_INLINE void memmap_init(struct page *start, struct page *end) +{ + struct page *p; + + for (p = start; p < end; p++) { + set_page_count(p, 0); + SetPageReserved(p); + init_waitqueue_head(&p->wait); + memlist_init(&p->list); + } +} + +static MMI_INLINE void memmap_zone_init(struct page *start, struct page *end, + zone_t *zone,unsigned long start_paddr, + int highmem_flag) +{ + struct page *p; + + for (p = start; p < end; p++) { + p->zone = zone; + if (!highmem_flag) + p->virtual = __va(start_paddr); + start_paddr += PAGE_SIZE; + } +} + #define LONG_ALIGN(x) (((x)+(sizeof(long))-1)&~((sizeof(long))-1)) /* @@ -635,7 +667,6 @@ unsigned long *zones_size, unsigned long zone_start_paddr, unsigned long *zholes_size, struct page *lmem_map) { - struct page *p; unsigned long i, j; unsigned long map_size; unsigned long totalpages, offset, realtotalpages; @@ -683,12 +714,11 @@ * up by free_all_bootmem() once the early boot process is * done. */ - for (p = lmem_map; p < lmem_map + totalpages; p++) { - set_page_count(p, 0); - SetPageReserved(p); - init_waitqueue_head(&p->wait); - memlist_init(&p->list); - } +#ifdef HAVE_ARCH_MEMMAP_INIT + arch_memmap_init(memmap_init, lmem_map, lmem_map + totalpages); +#else + memmap_init(lmem_map, lmem_map + totalpages); +#endif offset = lmem_map - mem_map; for (j = 0; j < MAX_NR_ZONES; j++) { @@ -701,7 +731,8 @@ realsize -= zholes_size[j]; printk("zone(%lu): %lu pages.\n", j, size); - zone->size = size; + zone->totalsize = size; + zone->memsize = realsize; zone->name = zone_names[j]; zone->lock = SPIN_LOCK_UNLOCKED; zone->zone_pgdat = pgdat; @@ -728,12 +759,19 @@ if ((zone_start_paddr >> PAGE_SHIFT) & (zone_required_alignment-1)) printk("BUG: wrong zone alignment, it will crash\n"); - for (i = 0; i < size; i++) { - struct page *page = mem_map + offset + i; - page->zone = zone; - if (j != ZONE_HIGHMEM) - page->virtual = __va(zone_start_paddr); - zone_start_paddr += PAGE_SIZE; + { + struct page *page = mem_map + offset; + +#ifdef HAVE_ARCH_MEMMAP_INIT + arch_memmap_zone_init(memmap_zone_init, page, page + size, + zone, zone_start_paddr, + (j == ZONE_HIGHMEM ? 1 : 0)); +#else + memmap_zone_init(page, page + size, zone, + zone_start_paddr, (j == ZONE_HIGHMEM ? 1 : 0)); +#endif + + zone_start_paddr += (size << PAGE_SHIFT); } offset += size;